From ba86e35d538a356b497b4f1904eedaaea834f060 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Wed, 4 Feb 2026 23:04:52 +0000 Subject: [PATCH 1/2] feat(spanner): include cache updates into the ResultSet response docs: A comment for field `transaction_tag` in message `.google.spanner.v1.RequestOptions` is changed docs: A comment for field `params` in message `.google.spanner.v1.PartitionQueryRequest` is changed docs: A comment for field `param_types` in message `.google.spanner.v1.PartitionQueryRequest` is changed docs: A comment for field `commit_timestamp` in message `.google.spanner.v1.BatchWriteResponse` is changed PiperOrigin-RevId: 865546011 Source-Link: https://github.com/googleapis/googleapis/commit/8d30990fb3a5325bad2ece30382fe9f97c328eea Source-Link: https://github.com/googleapis/googleapis-gen/commit/3dd15331ef8d4f7376990bb551ea57ae191ffc90 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiM2RkMTUzMzFlZjhkNGY3Mzc2OTkwYmI1NTFlYTU3YWUxOTFmZmM5MCJ9 --- .../admin/database/v1/.OwlBot.yaml | 19 + .../admin/database/v1/.eslintignore | 7 + .../admin/database/v1/.eslintrc.json | 3 + .../admin/database/v1/.gitattributes | 4 + owl-bot-staging/admin/database/v1/.gitignore | 14 + owl-bot-staging/admin/database/v1/.jsdoc.js | 55 + owl-bot-staging/admin/database/v1/.mocharc.js | 33 + owl-bot-staging/admin/database/v1/.nycrc | 24 + .../admin/database/v1/.prettierignore | 6 + .../admin/database/v1/.prettierrc.js | 22 + .../admin/database/v1/CODE_OF_CONDUCT.md | 94 + .../admin/database/v1/CONTRIBUTING.md | 76 + owl-bot-staging/admin/database/v1/LICENSE | 202 + owl-bot-staging/admin/database/v1/README.md | 108 + .../admin/database/v1/package.json | 58 + .../spanner/admin/database/v1/backup.proto | 773 + .../admin/database/v1/backup_schedule.proto | 230 + .../spanner/admin/database/v1/common.proto | 132 + .../database/v1/spanner_database_admin.proto | 1314 + .../admin/database/v1/protos/protos.d.ts | 16947 +++ .../admin/database/v1/protos/protos.js | 43422 ++++++ .../admin/database/v1/protos/protos.json | 4651 + .../admin/database/v1/src/index.ts | 25 + .../v1/src/v1/database_admin_client.ts | 5071 + .../src/v1/database_admin_client_config.json | 169 + .../v1/src/v1/database_admin_proto_list.json | 6 + .../database/v1/src/v1/gapic_metadata.json | 317 + .../admin/database/v1/src/v1/index.ts | 19 + .../v1/test/gapic_database_admin_v1.ts | 4820 + .../admin/database/v1/tsconfig.json | 22 + .../admin/database/v1/webpack.config.js | 64 + .../admin/instance/v1/.OwlBot.yaml | 19 + .../admin/instance/v1/.eslintignore | 7 + .../admin/instance/v1/.eslintrc.json | 3 + .../admin/instance/v1/.gitattributes | 4 + owl-bot-staging/admin/instance/v1/.gitignore | 14 + owl-bot-staging/admin/instance/v1/.jsdoc.js | 55 + owl-bot-staging/admin/instance/v1/.mocharc.js | 33 + owl-bot-staging/admin/instance/v1/.nycrc | 24 + .../admin/instance/v1/.prettierignore | 6 + .../admin/instance/v1/.prettierrc.js | 22 + .../admin/instance/v1/CODE_OF_CONDUCT.md | 94 + .../admin/instance/v1/CONTRIBUTING.md | 76 + owl-bot-staging/admin/instance/v1/LICENSE | 202 + owl-bot-staging/admin/instance/v1/README.md | 108 + .../admin/instance/v1/package.json | 58 + .../spanner/admin/instance/v1/common.proto | 64 + .../instance/v1/spanner_instance_admin.proto | 2184 + .../admin/instance/v1/protos/protos.d.ts | 14931 +++ .../admin/instance/v1/protos/protos.js | 38901 ++++++ .../admin/instance/v1/protos/protos.json | 4167 + .../admin/instance/v1/src/index.ts | 25 + .../instance/v1/src/v1/gapic_metadata.json | 253 + .../admin/instance/v1/src/v1/index.ts | 19 + .../v1/src/v1/instance_admin_client.ts | 4289 + .../src/v1/instance_admin_client_config.json | 129 + .../v1/src/v1/instance_admin_proto_list.json | 4 + .../v1/test/gapic_instance_admin_v1.ts | 3974 + .../admin/instance/v1/tsconfig.json | 22 + .../admin/instance/v1/webpack.config.js | 64 + owl-bot-staging/executor/v1/.OwlBot.yaml | 19 + owl-bot-staging/executor/v1/.eslintignore | 7 + owl-bot-staging/executor/v1/.eslintrc.json | 3 + owl-bot-staging/executor/v1/.gitattributes | 4 + owl-bot-staging/executor/v1/.gitignore | 14 + owl-bot-staging/executor/v1/.jsdoc.js | 55 + owl-bot-staging/executor/v1/.mocharc.js | 33 + owl-bot-staging/executor/v1/.nycrc | 24 + owl-bot-staging/executor/v1/.prettierignore | 6 + owl-bot-staging/executor/v1/.prettierrc.js | 22 + .../executor/v1/CODE_OF_CONDUCT.md | 94 + owl-bot-staging/executor/v1/CONTRIBUTING.md | 76 + owl-bot-staging/executor/v1/LICENSE | 202 + owl-bot-staging/executor/v1/README.md | 108 + owl-bot-staging/executor/v1/package.json | 61 + .../spanner/admin/database/v1/backup.proto | 773 + .../admin/database/v1/backup_schedule.proto | 230 + .../spanner/admin/database/v1/common.proto | 132 + .../database/v1/spanner_database_admin.proto | 1314 + .../spanner/admin/instance/v1/common.proto | 64 + .../instance/v1/spanner_instance_admin.proto | 2184 + .../spanner/executor/v1/cloud_executor.proto | 1520 + .../google/spanner/v1/change_stream.proto | 451 + .../google/spanner/v1/commit_response.proto | 64 + .../v1/protos/google/spanner/v1/keys.proto | 163 + .../protos/google/spanner/v1/location.proto | 388 + .../protos/google/spanner/v1/mutation.proto | 156 + .../protos/google/spanner/v1/query_plan.proto | 156 + .../protos/google/spanner/v1/result_set.proto | 260 + .../v1/protos/google/spanner/v1/spanner.proto | 1419 + .../google/spanner/v1/transaction.proto | 309 + .../v1/protos/google/spanner/v1/type.proto | 214 + .../executor/v1/protos/protos.d.ts | 40265 ++++++ owl-bot-staging/executor/v1/protos/protos.js | 104291 +++++++++++++++ .../executor/v1/protos/protos.json | 10772 ++ owl-bot-staging/executor/v1/src/index.ts | 25 + .../executor/v1/src/v1/gapic_metadata.json | 27 + owl-bot-staging/executor/v1/src/v1/index.ts | 19 + .../src/v1/spanner_executor_proxy_client.ts | 816 + .../spanner_executor_proxy_client_config.json | 30 + .../v1/spanner_executor_proxy_proto_list.json | 15 + .../test/gapic_spanner_executor_proxy_v1.ts | 660 + owl-bot-staging/executor/v1/tsconfig.json | 22 + owl-bot-staging/executor/v1/webpack.config.js | 64 + owl-bot-staging/v1/.OwlBot.yaml | 19 + owl-bot-staging/v1/.eslintignore | 7 + owl-bot-staging/v1/.eslintrc.json | 3 + owl-bot-staging/v1/.gitattributes | 4 + owl-bot-staging/v1/.gitignore | 14 + owl-bot-staging/v1/.jsdoc.js | 55 + owl-bot-staging/v1/.mocharc.js | 33 + owl-bot-staging/v1/.nycrc | 24 + owl-bot-staging/v1/.prettierignore | 6 + owl-bot-staging/v1/.prettierrc.js | 22 + owl-bot-staging/v1/CODE_OF_CONDUCT.md | 94 + owl-bot-staging/v1/CONTRIBUTING.md | 76 + owl-bot-staging/v1/LICENSE | 202 + owl-bot-staging/v1/README.md | 108 + owl-bot-staging/v1/package.json | 58 + .../google/spanner/v1/change_stream.proto | 451 + .../google/spanner/v1/commit_response.proto | 64 + .../v1/protos/google/spanner/v1/keys.proto | 163 + .../protos/google/spanner/v1/location.proto | 388 + .../protos/google/spanner/v1/mutation.proto | 156 + .../protos/google/spanner/v1/query_plan.proto | 156 + .../protos/google/spanner/v1/result_set.proto | 260 + .../v1/protos/google/spanner/v1/spanner.proto | 1419 + .../google/spanner/v1/transaction.proto | 309 + .../v1/protos/google/spanner/v1/type.proto | 214 + owl-bot-staging/v1/protos/protos.d.ts | 16769 +++ owl-bot-staging/v1/protos/protos.js | 45218 +++++++ owl-bot-staging/v1/protos/protos.json | 4346 + owl-bot-staging/v1/src/index.ts | 25 + owl-bot-staging/v1/src/v1/gapic_metadata.json | 172 + owl-bot-staging/v1/src/v1/index.ts | 19 + owl-bot-staging/v1/src/v1/spanner_client.ts | 2584 + .../v1/src/v1/spanner_client_config.json | 119 + .../v1/src/v1/spanner_proto_list.json | 12 + owl-bot-staging/v1/test/gapic_spanner_v1.ts | 2337 + owl-bot-staging/v1/tsconfig.json | 22 + owl-bot-staging/v1/webpack.config.js | 64 + 141 files changed, 391981 insertions(+) create mode 100644 owl-bot-staging/admin/database/v1/.OwlBot.yaml create mode 100644 owl-bot-staging/admin/database/v1/.eslintignore create mode 100644 owl-bot-staging/admin/database/v1/.eslintrc.json create mode 100644 owl-bot-staging/admin/database/v1/.gitattributes create mode 100644 owl-bot-staging/admin/database/v1/.gitignore create mode 100644 owl-bot-staging/admin/database/v1/.jsdoc.js create mode 100644 owl-bot-staging/admin/database/v1/.mocharc.js create mode 100644 owl-bot-staging/admin/database/v1/.nycrc create mode 100644 owl-bot-staging/admin/database/v1/.prettierignore create mode 100644 owl-bot-staging/admin/database/v1/.prettierrc.js create mode 100644 owl-bot-staging/admin/database/v1/CODE_OF_CONDUCT.md create mode 100644 owl-bot-staging/admin/database/v1/CONTRIBUTING.md create mode 100644 owl-bot-staging/admin/database/v1/LICENSE create mode 100644 owl-bot-staging/admin/database/v1/README.md create mode 100644 owl-bot-staging/admin/database/v1/package.json create mode 100644 owl-bot-staging/admin/database/v1/protos/google/spanner/admin/database/v1/backup.proto create mode 100644 owl-bot-staging/admin/database/v1/protos/google/spanner/admin/database/v1/backup_schedule.proto create mode 100644 owl-bot-staging/admin/database/v1/protos/google/spanner/admin/database/v1/common.proto create mode 100644 owl-bot-staging/admin/database/v1/protos/google/spanner/admin/database/v1/spanner_database_admin.proto create mode 100644 owl-bot-staging/admin/database/v1/protos/protos.d.ts create mode 100644 owl-bot-staging/admin/database/v1/protos/protos.js create mode 100644 owl-bot-staging/admin/database/v1/protos/protos.json create mode 100644 owl-bot-staging/admin/database/v1/src/index.ts create mode 100644 owl-bot-staging/admin/database/v1/src/v1/database_admin_client.ts create mode 100644 owl-bot-staging/admin/database/v1/src/v1/database_admin_client_config.json create mode 100644 owl-bot-staging/admin/database/v1/src/v1/database_admin_proto_list.json create mode 100644 owl-bot-staging/admin/database/v1/src/v1/gapic_metadata.json create mode 100644 owl-bot-staging/admin/database/v1/src/v1/index.ts create mode 100644 owl-bot-staging/admin/database/v1/test/gapic_database_admin_v1.ts create mode 100644 owl-bot-staging/admin/database/v1/tsconfig.json create mode 100644 owl-bot-staging/admin/database/v1/webpack.config.js create mode 100644 owl-bot-staging/admin/instance/v1/.OwlBot.yaml create mode 100644 owl-bot-staging/admin/instance/v1/.eslintignore create mode 100644 owl-bot-staging/admin/instance/v1/.eslintrc.json create mode 100644 owl-bot-staging/admin/instance/v1/.gitattributes create mode 100644 owl-bot-staging/admin/instance/v1/.gitignore create mode 100644 owl-bot-staging/admin/instance/v1/.jsdoc.js create mode 100644 owl-bot-staging/admin/instance/v1/.mocharc.js create mode 100644 owl-bot-staging/admin/instance/v1/.nycrc create mode 100644 owl-bot-staging/admin/instance/v1/.prettierignore create mode 100644 owl-bot-staging/admin/instance/v1/.prettierrc.js create mode 100644 owl-bot-staging/admin/instance/v1/CODE_OF_CONDUCT.md create mode 100644 owl-bot-staging/admin/instance/v1/CONTRIBUTING.md create mode 100644 owl-bot-staging/admin/instance/v1/LICENSE create mode 100644 owl-bot-staging/admin/instance/v1/README.md create mode 100644 owl-bot-staging/admin/instance/v1/package.json create mode 100644 owl-bot-staging/admin/instance/v1/protos/google/spanner/admin/instance/v1/common.proto create mode 100644 owl-bot-staging/admin/instance/v1/protos/google/spanner/admin/instance/v1/spanner_instance_admin.proto create mode 100644 owl-bot-staging/admin/instance/v1/protos/protos.d.ts create mode 100644 owl-bot-staging/admin/instance/v1/protos/protos.js create mode 100644 owl-bot-staging/admin/instance/v1/protos/protos.json create mode 100644 owl-bot-staging/admin/instance/v1/src/index.ts create mode 100644 owl-bot-staging/admin/instance/v1/src/v1/gapic_metadata.json create mode 100644 owl-bot-staging/admin/instance/v1/src/v1/index.ts create mode 100644 owl-bot-staging/admin/instance/v1/src/v1/instance_admin_client.ts create mode 100644 owl-bot-staging/admin/instance/v1/src/v1/instance_admin_client_config.json create mode 100644 owl-bot-staging/admin/instance/v1/src/v1/instance_admin_proto_list.json create mode 100644 owl-bot-staging/admin/instance/v1/test/gapic_instance_admin_v1.ts create mode 100644 owl-bot-staging/admin/instance/v1/tsconfig.json create mode 100644 owl-bot-staging/admin/instance/v1/webpack.config.js create mode 100644 owl-bot-staging/executor/v1/.OwlBot.yaml create mode 100644 owl-bot-staging/executor/v1/.eslintignore create mode 100644 owl-bot-staging/executor/v1/.eslintrc.json create mode 100644 owl-bot-staging/executor/v1/.gitattributes create mode 100644 owl-bot-staging/executor/v1/.gitignore create mode 100644 owl-bot-staging/executor/v1/.jsdoc.js create mode 100644 owl-bot-staging/executor/v1/.mocharc.js create mode 100644 owl-bot-staging/executor/v1/.nycrc create mode 100644 owl-bot-staging/executor/v1/.prettierignore create mode 100644 owl-bot-staging/executor/v1/.prettierrc.js create mode 100644 owl-bot-staging/executor/v1/CODE_OF_CONDUCT.md create mode 100644 owl-bot-staging/executor/v1/CONTRIBUTING.md create mode 100644 owl-bot-staging/executor/v1/LICENSE create mode 100644 owl-bot-staging/executor/v1/README.md create mode 100644 owl-bot-staging/executor/v1/package.json create mode 100644 owl-bot-staging/executor/v1/protos/google/spanner/admin/database/v1/backup.proto create mode 100644 owl-bot-staging/executor/v1/protos/google/spanner/admin/database/v1/backup_schedule.proto create mode 100644 owl-bot-staging/executor/v1/protos/google/spanner/admin/database/v1/common.proto create mode 100644 owl-bot-staging/executor/v1/protos/google/spanner/admin/database/v1/spanner_database_admin.proto create mode 100644 owl-bot-staging/executor/v1/protos/google/spanner/admin/instance/v1/common.proto create mode 100644 owl-bot-staging/executor/v1/protos/google/spanner/admin/instance/v1/spanner_instance_admin.proto create mode 100644 owl-bot-staging/executor/v1/protos/google/spanner/executor/v1/cloud_executor.proto create mode 100644 owl-bot-staging/executor/v1/protos/google/spanner/v1/change_stream.proto create mode 100644 owl-bot-staging/executor/v1/protos/google/spanner/v1/commit_response.proto create mode 100644 owl-bot-staging/executor/v1/protos/google/spanner/v1/keys.proto create mode 100644 owl-bot-staging/executor/v1/protos/google/spanner/v1/location.proto create mode 100644 owl-bot-staging/executor/v1/protos/google/spanner/v1/mutation.proto create mode 100644 owl-bot-staging/executor/v1/protos/google/spanner/v1/query_plan.proto create mode 100644 owl-bot-staging/executor/v1/protos/google/spanner/v1/result_set.proto create mode 100644 owl-bot-staging/executor/v1/protos/google/spanner/v1/spanner.proto create mode 100644 owl-bot-staging/executor/v1/protos/google/spanner/v1/transaction.proto create mode 100644 owl-bot-staging/executor/v1/protos/google/spanner/v1/type.proto create mode 100644 owl-bot-staging/executor/v1/protos/protos.d.ts create mode 100644 owl-bot-staging/executor/v1/protos/protos.js create mode 100644 owl-bot-staging/executor/v1/protos/protos.json create mode 100644 owl-bot-staging/executor/v1/src/index.ts create mode 100644 owl-bot-staging/executor/v1/src/v1/gapic_metadata.json create mode 100644 owl-bot-staging/executor/v1/src/v1/index.ts create mode 100644 owl-bot-staging/executor/v1/src/v1/spanner_executor_proxy_client.ts create mode 100644 owl-bot-staging/executor/v1/src/v1/spanner_executor_proxy_client_config.json create mode 100644 owl-bot-staging/executor/v1/src/v1/spanner_executor_proxy_proto_list.json create mode 100644 owl-bot-staging/executor/v1/test/gapic_spanner_executor_proxy_v1.ts create mode 100644 owl-bot-staging/executor/v1/tsconfig.json create mode 100644 owl-bot-staging/executor/v1/webpack.config.js create mode 100644 owl-bot-staging/v1/.OwlBot.yaml create mode 100644 owl-bot-staging/v1/.eslintignore create mode 100644 owl-bot-staging/v1/.eslintrc.json create mode 100644 owl-bot-staging/v1/.gitattributes create mode 100644 owl-bot-staging/v1/.gitignore create mode 100644 owl-bot-staging/v1/.jsdoc.js create mode 100644 owl-bot-staging/v1/.mocharc.js create mode 100644 owl-bot-staging/v1/.nycrc create mode 100644 owl-bot-staging/v1/.prettierignore create mode 100644 owl-bot-staging/v1/.prettierrc.js create mode 100644 owl-bot-staging/v1/CODE_OF_CONDUCT.md create mode 100644 owl-bot-staging/v1/CONTRIBUTING.md create mode 100644 owl-bot-staging/v1/LICENSE create mode 100644 owl-bot-staging/v1/README.md create mode 100644 owl-bot-staging/v1/package.json create mode 100644 owl-bot-staging/v1/protos/google/spanner/v1/change_stream.proto create mode 100644 owl-bot-staging/v1/protos/google/spanner/v1/commit_response.proto create mode 100644 owl-bot-staging/v1/protos/google/spanner/v1/keys.proto create mode 100644 owl-bot-staging/v1/protos/google/spanner/v1/location.proto create mode 100644 owl-bot-staging/v1/protos/google/spanner/v1/mutation.proto create mode 100644 owl-bot-staging/v1/protos/google/spanner/v1/query_plan.proto create mode 100644 owl-bot-staging/v1/protos/google/spanner/v1/result_set.proto create mode 100644 owl-bot-staging/v1/protos/google/spanner/v1/spanner.proto create mode 100644 owl-bot-staging/v1/protos/google/spanner/v1/transaction.proto create mode 100644 owl-bot-staging/v1/protos/google/spanner/v1/type.proto create mode 100644 owl-bot-staging/v1/protos/protos.d.ts create mode 100644 owl-bot-staging/v1/protos/protos.js create mode 100644 owl-bot-staging/v1/protos/protos.json create mode 100644 owl-bot-staging/v1/src/index.ts create mode 100644 owl-bot-staging/v1/src/v1/gapic_metadata.json create mode 100644 owl-bot-staging/v1/src/v1/index.ts create mode 100644 owl-bot-staging/v1/src/v1/spanner_client.ts create mode 100644 owl-bot-staging/v1/src/v1/spanner_client_config.json create mode 100644 owl-bot-staging/v1/src/v1/spanner_proto_list.json create mode 100644 owl-bot-staging/v1/test/gapic_spanner_v1.ts create mode 100644 owl-bot-staging/v1/tsconfig.json create mode 100644 owl-bot-staging/v1/webpack.config.js diff --git a/owl-bot-staging/admin/database/v1/.OwlBot.yaml b/owl-bot-staging/admin/database/v1/.OwlBot.yaml new file mode 100644 index 000000000..23a34a9ea --- /dev/null +++ b/owl-bot-staging/admin/database/v1/.OwlBot.yaml @@ -0,0 +1,19 @@ +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +deep-copy-regex: + - source: /google/spanner/admin/database/google-spanner-admin-database-nodejs + dest: /owl-bot-staging/google-spanner-admin-database + +api-name: database \ No newline at end of file diff --git a/owl-bot-staging/admin/database/v1/.eslintignore b/owl-bot-staging/admin/database/v1/.eslintignore new file mode 100644 index 000000000..cfc348ec4 --- /dev/null +++ b/owl-bot-staging/admin/database/v1/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/.coverage +build/ +docs/ +protos/ +system-test/ +samples/generated/ diff --git a/owl-bot-staging/admin/database/v1/.eslintrc.json b/owl-bot-staging/admin/database/v1/.eslintrc.json new file mode 100644 index 000000000..782153495 --- /dev/null +++ b/owl-bot-staging/admin/database/v1/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/owl-bot-staging/admin/database/v1/.gitattributes b/owl-bot-staging/admin/database/v1/.gitattributes new file mode 100644 index 000000000..33739cb74 --- /dev/null +++ b/owl-bot-staging/admin/database/v1/.gitattributes @@ -0,0 +1,4 @@ +*.ts text eol=lf +*.js text eol=lf +protos/* linguist-generated +**/api-extractor.json linguist-language=JSON-with-Comments diff --git a/owl-bot-staging/admin/database/v1/.gitignore b/owl-bot-staging/admin/database/v1/.gitignore new file mode 100644 index 000000000..d4f03a0df --- /dev/null +++ b/owl-bot-staging/admin/database/v1/.gitignore @@ -0,0 +1,14 @@ +**/*.log +**/node_modules +/.coverage +/coverage +/.nyc_output +/docs/ +/out/ +/build/ +system-test/secrets.js +system-test/*key.json +*.lock +.DS_Store +package-lock.json +__pycache__ diff --git a/owl-bot-staging/admin/database/v1/.jsdoc.js b/owl-bot-staging/admin/database/v1/.jsdoc.js new file mode 100644 index 000000000..89dbb7cd9 --- /dev/null +++ b/owl-bot-staging/admin/database/v1/.jsdoc.js @@ -0,0 +1,55 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +'use strict'; + +module.exports = { + opts: { + readme: './README.md', + package: './package.json', + template: './node_modules/jsdoc-fresh', + recurse: true, + verbose: true, + destination: './docs/' + }, + plugins: [ + 'plugins/markdown', + 'jsdoc-region-tag' + ], + source: { + excludePattern: '(^|\\/|\\\\)[._]', + include: [ + 'build/src', + 'protos' + ], + includePattern: '\\.js$' + }, + templates: { + copyright: 'Copyright 2026 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/spanner', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/owl-bot-staging/admin/database/v1/.mocharc.js b/owl-bot-staging/admin/database/v1/.mocharc.js new file mode 100644 index 000000000..5eb34e86c --- /dev/null +++ b/owl-bot-staging/admin/database/v1/.mocharc.js @@ -0,0 +1,33 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000 +} +if (process.env.MOCHA_THROW_DEPRECATION === 'false') { + delete config['throw-deprecation']; +} +if (process.env.MOCHA_REPORTER) { + config.reporter = process.env.MOCHA_REPORTER; +} +if (process.env.MOCHA_REPORTER_OUTPUT) { + config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; +} +module.exports = config diff --git a/owl-bot-staging/admin/database/v1/.nycrc b/owl-bot-staging/admin/database/v1/.nycrc new file mode 100644 index 000000000..81a95fc94 --- /dev/null +++ b/owl-bot-staging/admin/database/v1/.nycrc @@ -0,0 +1,24 @@ +{ + "report-dir": "./.coverage", + "reporter": ["text", "lcov"], + "exclude": [ + "**/*-test", + "**/.coverage", + "**/apis", + "**/benchmark", + "**/conformance", + "**/docs", + "**/samples", + "**/scripts", + "**/protos", + "**/test", + "**/*.d.ts", + ".jsdoc.js", + "**/.jsdoc.js", + "karma.conf.js", + "webpack-tests.config.js", + "webpack.config.js" + ], + "exclude-after-remap": false, + "all": true +} \ No newline at end of file diff --git a/owl-bot-staging/admin/database/v1/.prettierignore b/owl-bot-staging/admin/database/v1/.prettierignore new file mode 100644 index 000000000..9340ad9b8 --- /dev/null +++ b/owl-bot-staging/admin/database/v1/.prettierignore @@ -0,0 +1,6 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ diff --git a/owl-bot-staging/admin/database/v1/.prettierrc.js b/owl-bot-staging/admin/database/v1/.prettierrc.js new file mode 100644 index 000000000..7649ee3c2 --- /dev/null +++ b/owl-bot-staging/admin/database/v1/.prettierrc.js @@ -0,0 +1,22 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/owl-bot-staging/admin/database/v1/CODE_OF_CONDUCT.md b/owl-bot-staging/admin/database/v1/CODE_OF_CONDUCT.md new file mode 100644 index 000000000..2add2547a --- /dev/null +++ b/owl-bot-staging/admin/database/v1/CODE_OF_CONDUCT.md @@ -0,0 +1,94 @@ + +# Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of +experience, education, socio-economic status, nationality, personal appearance, +race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, or to ban temporarily or permanently any +contributor for other behaviors that they deem inappropriate, threatening, +offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +This Code of Conduct also applies outside the project spaces when the Project +Steward has a reasonable belief that an individual's behavior may have a +negative impact on the project or its community. + +## Conflict Resolution + +We do not believe that all conflict is bad; healthy debate and disagreement +often yield positive results. However, it is never okay to be disrespectful or +to engage in behavior that violates the project’s code of conduct. + +If you see someone violating the code of conduct, you are encouraged to address +the behavior directly with those involved. Many issues can be resolved quickly +and easily, and this gives people more control over the outcome of their +dispute. If you are unable to resolve the matter for any reason, or if the +behavior is threatening or harassing, report it. We are dedicated to providing +an environment where participants feel welcome and safe. + +Reports should be directed to *googleapis-stewards@google.com*, the +Project Steward(s) for *Google Cloud Client Libraries*. It is the Project Steward’s duty to +receive and address reported violations of the code of conduct. They will then +work with a committee consisting of representatives from the Open Source +Programs Office and the Google Open Source Strategy team. If for any reason you +are uncomfortable reaching out to the Project Steward, please email +opensource@google.com. + +We will investigate every complaint, but you may not receive a direct response. +We will use our discretion in determining when and how to follow up on reported +incidents, which may range from not taking action to permanent expulsion from +the project and project-sponsored spaces. We will notify the accused of the +report and provide them an opportunity to discuss it before any action is taken. +The identity of the reporter will be omitted from the details of the report +supplied to the accused. In potentially harmful situations, such as ongoing +harassment or threats to anyone's safety, we may take action without notice. + +## Attribution + +This Code of Conduct is adapted from the Contributor Covenant, version 1.4, +available at +https://www.contributor-covenant.org/version/1/4/code-of-conduct.html \ No newline at end of file diff --git a/owl-bot-staging/admin/database/v1/CONTRIBUTING.md b/owl-bot-staging/admin/database/v1/CONTRIBUTING.md new file mode 100644 index 000000000..6e5fdafe3 --- /dev/null +++ b/owl-bot-staging/admin/database/v1/CONTRIBUTING.md @@ -0,0 +1,76 @@ +# How to become a contributor and submit your own code + +**Table of contents** + +* [Contributor License Agreements](#contributor-license-agreements) +* [Contributing a patch](#contributing-a-patch) +* [Running the tests](#running-the-tests) +* [Releasing the library](#releasing-the-library) + +## Contributor License Agreements + +We'd love to accept your sample apps and patches! Before we can take them, we +have to jump a couple of legal hurdles. + +Please fill out either the individual or corporate Contributor License Agreement +(CLA). + + * If you are an individual writing original source code and you're sure you + own the intellectual property, then you'll need to sign an [individual CLA](https://developers.google.com/open-source/cla/individual). + * If you work for a company that wants to allow you to contribute your work, + then you'll need to sign a [corporate CLA](https://developers.google.com/open-source/cla/corporate). + +Follow either of the two links above to access the appropriate CLA and +instructions for how to sign and return it. Once we receive it, we'll be able to +accept your pull requests. + +## Contributing A Patch + +1. Submit an issue describing your proposed change to the repo in question. +1. The repo owner will respond to your issue promptly. +1. If your proposed change is accepted, and you haven't already done so, sign a + Contributor License Agreement (see details above). +1. Fork the desired repo, develop and test your code changes. +1. Ensure that your code adheres to the existing style in the code to which + you are contributing. +1. Ensure that your code has an appropriate set of tests which all pass. +1. Title your pull request following [Conventional Commits](https://www.conventionalcommits.org/) styling. +1. Submit a pull request. + +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Database API][enable_api]. +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + + +## Running the tests + +1. [Prepare your environment for Node.js setup][setup]. + +1. Install dependencies: + + npm install + +1. Run the tests: + + # Run unit tests. + npm test + + # Run sample integration tests. + npm run samples-test + + # Run all system tests. + npm run system-test + +1. Lint (and maybe fix) any changes: + + npm run fix + +[setup]: https://cloud.google.com/nodejs/docs/setup +[projects]: https://console.cloud.google.com/project +[billing]: https://support.google.com/cloud/answer/6293499#enable-billing +[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=spanner.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/owl-bot-staging/admin/database/v1/LICENSE b/owl-bot-staging/admin/database/v1/LICENSE new file mode 100644 index 000000000..d64569567 --- /dev/null +++ b/owl-bot-staging/admin/database/v1/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/owl-bot-staging/admin/database/v1/README.md b/owl-bot-staging/admin/database/v1/README.md new file mode 100644 index 000000000..601a2a6cb --- /dev/null +++ b/owl-bot-staging/admin/database/v1/README.md @@ -0,0 +1,108 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "The comments you see below are used to generate those parts of the template in later states." +Google Cloud Platform logo + +# [Cloud Spanner API: Nodejs Client][homepage] + +[//]: # "releaseLevel" + +[![npm version](https://img.shields.io/npm/v/@google-cloud/spanner.svg)](https://www.npmjs.org/package/@google-cloud/spanner) + +Cloud Spanner API client for Node.js + +[//]: # "partials.introduction" + +A comprehensive list of changes in each version may be found in +[the CHANGELOG][homepage_changelog]. + +* [Cloud Spanner API Nodejs Client API Reference](https://cloud.google.com/nodejs/docs/reference/database/latest) +* [Cloud Spanner API Documentation](https://cloud.google.com/spanner/) + +Read more about the client libraries for Cloud APIs, including the older +Google APIs Client Libraries, in [Client Libraries Explained][explained]. + +[explained]: https://cloud.google.com/apis/docs/client-libraries-explained + +**Table of contents:** + +* [Quickstart](#quickstart) + * [Before you begin](#before-you-begin) + * [Installing the client library](#installing-the-client-library) + +* [Versioning](#versioning) +* [Contributing](#contributing) +* [License](#license) + +## Quickstart +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Cloud Spanner API API][enable_api]. +1. [Set up authentication][auth] so you can access the + API from your local workstation. +### Installing the client library + +```bash +npm install @google-cloud/spanner +``` + +[//]: # "partials.body" + +## Samples + +Samples are in the [`samples/`][homepage_samples] directory. Each sample's `README.md` has instructions for running its sample. + +[//]: # "samples" + +## Supported Node.js Versions + +Our client libraries follow the [Node.js release schedule](https://github.com/nodejs/release#release-schedule). +Libraries are compatible with all current _active_ and _maintenance_ versions of +Node.js. +If you are using an end-of-life version of Node.js, we recommend that you update +as soon as possible to an actively supported LTS version. + +Google's client libraries support legacy versions of Node.js runtimes on a +best-efforts basis with the following warnings: + +* Legacy versions are not tested in continuous integration. +* Some security patches and features cannot be backported. +* Dependencies cannot be kept up-to-date. + +Client libraries targeting some end-of-life versions of Node.js are available, and +can be installed through npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). +The dist-tags follow the naming convention `legacy-(version)`. +For example, `npm install @google-cloud/spanner@legacy-8` installs client libraries +for versions compatible with Node.js 8. + +## Versioning + +This library follows [Semantic Versioning](http://semver.org/). + +More Information: [Google Cloud Platform Launch Stages][launch_stages] + +[launch_stages]: https://cloud.google.com/terms/launch-stages + +## Contributing + +Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-spanner-admin-database/CONTRIBUTING.md). + +Please note that this `README.md` +and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) +are generated from a central template. + +## License + +Apache Version 2.0 + +See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-spanner-admin-database/LICENSE) + +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[projects]: https://console.cloud.google.com/project +[billing]: https://support.google.com/cloud/answer/6293499#enable-billing +[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=spanner.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/external/set-up-adc-local +[homepage_samples]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-spanner-admin-database/samples +[homepage_changelog]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-spanner-admin-database/CHANGELOG.md +[homepage]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-spanner-admin-database diff --git a/owl-bot-staging/admin/database/v1/package.json b/owl-bot-staging/admin/database/v1/package.json new file mode 100644 index 000000000..a06896525 --- /dev/null +++ b/owl-bot-staging/admin/database/v1/package.json @@ -0,0 +1,58 @@ +{ + "name": "@google-cloud/spanner", + "version": "0.1.0", + "description": "Database client for Node.js", + "repository": "googleapis/nodejs-database", + "license": "Apache-2.0", + "author": "Google LLC", + "main": "build/src/index.js", + "files": [ + "build/src", + "build/protos" + ], + "keywords": [ + "google apis client", + "google api client", + "google apis", + "google api", + "google", + "google cloud platform", + "google cloud", + "cloud", + "google database", + "database", + "database admin" + ], + "scripts": { + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/ && minifyProtoJson", + "compile-protos": "compileProtos src", + "docs": "jsdoc -c .jsdoc.js", + "fix": "gts fix", + "lint": "gts check", + "prepare": "npm run compile-protos && npm run compile", + "system-test": "c8 mocha build/system-test", + "test": "c8 mocha build/test" + }, + "dependencies": { + "google-gax": "^5.1.1-rc.1" + }, + "devDependencies": { + "@types/mocha": "^10.0.10", + "@types/node": "^22.18.12", + "@types/sinon": "^17.0.4", + "c8": "^10.1.3", + "gapic-tools": "^1.0.3", + "gts": "^6.0.2", + "jsdoc": "^4.0.5", + "jsdoc-fresh": "^5.0.2", + "jsdoc-region-tag": "^4.0.1", + "mocha": "^11.7.4", + "pack-n-play": "^4.2.1", + "typescript": "5.8.3", + "sinon": "^21.0.0" + }, + "engines": { + "node": ">=v18" + } +} diff --git a/owl-bot-staging/admin/database/v1/protos/google/spanner/admin/database/v1/backup.proto b/owl-bot-staging/admin/database/v1/protos/google/spanner/admin/database/v1/backup.proto new file mode 100644 index 000000000..6898814c4 --- /dev/null +++ b/owl-bot-staging/admin/database/v1/protos/google/spanner/admin/database/v1/backup.proto @@ -0,0 +1,773 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.spanner.admin.database.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; +import "google/spanner/admin/database/v1/common.proto"; + +option csharp_namespace = "Google.Cloud.Spanner.Admin.Database.V1"; +option go_package = "cloud.google.com/go/spanner/admin/database/apiv1/databasepb;databasepb"; +option java_multiple_files = true; +option java_outer_classname = "BackupProto"; +option java_package = "com.google.spanner.admin.database.v1"; +option php_namespace = "Google\\Cloud\\Spanner\\Admin\\Database\\V1"; +option ruby_package = "Google::Cloud::Spanner::Admin::Database::V1"; + +// A backup of a Cloud Spanner database. +message Backup { + option (google.api.resource) = { + type: "spanner.googleapis.com/Backup" + pattern: "projects/{project}/instances/{instance}/backups/{backup}" + }; + + // Indicates the current state of the backup. + enum State { + // Not specified. + STATE_UNSPECIFIED = 0; + + // The pending backup is still being created. Operations on the + // backup may fail with `FAILED_PRECONDITION` in this state. + CREATING = 1; + + // The backup is complete and ready for use. + READY = 2; + } + + // Required for the + // [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] + // operation. Name of the database from which this backup was created. This + // needs to be in the same instance as the backup. Values are of the form + // `projects//instances//databases/`. + string database = 2 [(google.api.resource_reference) = { + type: "spanner.googleapis.com/Database" + }]; + + // The backup will contain an externally consistent copy of the database at + // the timestamp specified by `version_time`. If `version_time` is not + // specified, the system will set `version_time` to the `create_time` of the + // backup. + google.protobuf.Timestamp version_time = 9; + + // Required for the + // [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] + // operation. The expiration time of the backup, with microseconds + // granularity that must be at least 6 hours and at most 366 days + // from the time the CreateBackup request is processed. Once the `expire_time` + // has passed, the backup is eligible to be automatically deleted by Cloud + // Spanner to free the resources used by the backup. + google.protobuf.Timestamp expire_time = 3; + + // Output only for the + // [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] + // operation. Required for the + // [UpdateBackup][google.spanner.admin.database.v1.DatabaseAdmin.UpdateBackup] + // operation. + // + // A globally unique identifier for the backup which cannot be + // changed. Values are of the form + // `projects//instances//backups/[a-z][a-z0-9_\-]*[a-z0-9]` + // The final segment of the name must be between 2 and 60 characters + // in length. + // + // The backup is stored in the location(s) specified in the instance + // configuration of the instance containing the backup, identified + // by the prefix of the backup name of the form + // `projects//instances/`. + string name = 1; + + // Output only. The time the + // [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] + // request is received. If the request does not specify `version_time`, the + // `version_time` of the backup will be equivalent to the `create_time`. + google.protobuf.Timestamp create_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Size of the backup in bytes. + int64 size_bytes = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The number of bytes that will be freed by deleting this + // backup. This value will be zero if, for example, this backup is part of an + // incremental backup chain and younger backups in the chain require that we + // keep its data. For backups not in an incremental backup chain, this is + // always the size of the backup. This value may change if backups on the same + // chain get created, deleted or expired. + int64 freeable_size_bytes = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. For a backup in an incremental backup chain, this is the + // storage space needed to keep the data that has changed since the previous + // backup. For all other backups, this is always the size of the backup. This + // value may change if backups on the same chain get deleted or expired. + // + // This field can be used to calculate the total storage space used by a set + // of backups. For example, the total space used by all backups of a database + // can be computed by summing up this field. + int64 exclusive_size_bytes = 16 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The current state of the backup. + State state = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The names of the restored databases that reference the backup. + // The database names are of + // the form `projects//instances//databases/`. + // Referencing databases may exist in different instances. The existence of + // any referencing database prevents the backup from being deleted. When a + // restored database from the backup enters the `READY` state, the reference + // to the backup is removed. + repeated string referencing_databases = 7 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "spanner.googleapis.com/Database" + } + ]; + + // Output only. The encryption information for the backup. + EncryptionInfo encryption_info = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The encryption information for the backup, whether it is + // protected by one or more KMS keys. The information includes all Cloud + // KMS key versions used to encrypt the backup. The `encryption_status' field + // inside of each `EncryptionInfo` is not populated. At least one of the key + // versions must be available for the backup to be restored. If a key version + // is revoked in the middle of a restore, the restore behavior is undefined. + repeated EncryptionInfo encryption_information = 13 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The database dialect information for the backup. + DatabaseDialect database_dialect = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The names of the destination backups being created by copying + // this source backup. The backup names are of the form + // `projects//instances//backups/`. + // Referencing backups may exist in different instances. The existence of + // any referencing backup prevents the backup from being deleted. When the + // copy operation is done (either successfully completed or cancelled or the + // destination backup is deleted), the reference to the backup is removed. + repeated string referencing_backups = 11 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { type: "spanner.googleapis.com/Backup" } + ]; + + // Output only. The max allowed expiration time of the backup, with + // microseconds granularity. A backup's expiration time can be configured in + // multiple APIs: CreateBackup, UpdateBackup, CopyBackup. When updating or + // copying an existing backup, the expiration time specified must be + // less than `Backup.max_expire_time`. + google.protobuf.Timestamp max_expire_time = 12 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. List of backup schedule URIs that are associated with + // creating this backup. This is only applicable for scheduled backups, and + // is empty for on-demand backups. + // + // To optimize for storage, whenever possible, multiple schedules are + // collapsed together to create one backup. In such cases, this field captures + // the list of all backup schedule URIs that are associated with creating + // this backup. If collapsing is not done, then this field captures the + // single backup schedule URI associated with creating this backup. + repeated string backup_schedules = 14 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "spanner.googleapis.com/BackupSchedule" + } + ]; + + // Output only. Populated only for backups in an incremental backup chain. + // Backups share the same chain id if and only if they belong to the same + // incremental backup chain. Use this field to determine which backups are + // part of the same incremental backup chain. The ordering of backups in the + // chain can be determined by ordering the backup `version_time`. + string incremental_backup_chain_id = 17 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Data deleted at a time older than this is guaranteed not to be + // retained in order to support this backup. For a backup in an incremental + // backup chain, this is the version time of the oldest backup that exists or + // ever existed in the chain. For all other backups, this is the version time + // of the backup. This field can be used to understand what data is being + // retained by the backup system. + google.protobuf.Timestamp oldest_version_time = 18 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The instance partition(s) storing the backup. + // + // This is the same as the list of the instance partition(s) that the database + // had footprint in at the backup's `version_time`. + repeated BackupInstancePartition instance_partitions = 19 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The request for +// [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup]. +message CreateBackupRequest { + // Required. The name of the instance in which the backup will be + // created. This must be the same instance that contains the database the + // backup will be created from. The backup will be stored in the + // location(s) specified in the instance configuration of this + // instance. Values are of the form + // `projects//instances/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "spanner.googleapis.com/Instance" + } + ]; + + // Required. The id of the backup to be created. The `backup_id` appended to + // `parent` forms the full backup name of the form + // `projects//instances//backups/`. + string backup_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The backup to create. + Backup backup = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The encryption configuration used to encrypt the backup. If this + // field is not specified, the backup will use the same encryption + // configuration as the database by default, namely + // [encryption_type][google.spanner.admin.database.v1.CreateBackupEncryptionConfig.encryption_type] + // = `USE_DATABASE_ENCRYPTION`. + CreateBackupEncryptionConfig encryption_config = 4 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Metadata type for the operation returned by +// [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup]. +message CreateBackupMetadata { + // The name of the backup being created. + string name = 1 [ + (google.api.resource_reference) = { type: "spanner.googleapis.com/Backup" } + ]; + + // The name of the database the backup is created from. + string database = 2 [(google.api.resource_reference) = { + type: "spanner.googleapis.com/Database" + }]; + + // The progress of the + // [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] + // operation. + OperationProgress progress = 3; + + // The time at which cancellation of this operation was received. + // [Operations.CancelOperation][google.longrunning.Operations.CancelOperation] + // starts asynchronous cancellation on a long-running operation. The server + // makes a best effort to cancel the operation, but success is not guaranteed. + // Clients can use + // [Operations.GetOperation][google.longrunning.Operations.GetOperation] or + // other methods to check whether the cancellation succeeded or whether the + // operation completed despite cancellation. On successful cancellation, + // the operation is not deleted; instead, it becomes an operation with + // an [Operation.error][google.longrunning.Operation.error] value with a + // [google.rpc.Status.code][google.rpc.Status.code] of 1, + // corresponding to `Code.CANCELLED`. + google.protobuf.Timestamp cancel_time = 4; +} + +// The request for +// [CopyBackup][google.spanner.admin.database.v1.DatabaseAdmin.CopyBackup]. +message CopyBackupRequest { + // Required. The name of the destination instance that will contain the backup + // copy. Values are of the form: `projects//instances/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "spanner.googleapis.com/Instance" + } + ]; + + // Required. The id of the backup copy. + // The `backup_id` appended to `parent` forms the full backup_uri of the form + // `projects//instances//backups/`. + string backup_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The source backup to be copied. + // The source backup needs to be in READY state for it to be copied. + // Once CopyBackup is in progress, the source backup cannot be deleted or + // cleaned up on expiration until CopyBackup is finished. + // Values are of the form: + // `projects//instances//backups/`. + string source_backup = 3 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "spanner.googleapis.com/Backup" } + ]; + + // Required. The expiration time of the backup in microsecond granularity. + // The expiration time must be at least 6 hours and at most 366 days + // from the `create_time` of the source backup. Once the `expire_time` has + // passed, the backup is eligible to be automatically deleted by Cloud Spanner + // to free the resources used by the backup. + google.protobuf.Timestamp expire_time = 4 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. The encryption configuration used to encrypt the backup. If this + // field is not specified, the backup will use the same encryption + // configuration as the source backup by default, namely + // [encryption_type][google.spanner.admin.database.v1.CopyBackupEncryptionConfig.encryption_type] + // = `USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION`. + CopyBackupEncryptionConfig encryption_config = 5 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Metadata type for the operation returned by +// [CopyBackup][google.spanner.admin.database.v1.DatabaseAdmin.CopyBackup]. +message CopyBackupMetadata { + // The name of the backup being created through the copy operation. + // Values are of the form + // `projects//instances//backups/`. + string name = 1 [ + (google.api.resource_reference) = { type: "spanner.googleapis.com/Backup" } + ]; + + // The name of the source backup that is being copied. + // Values are of the form + // `projects//instances//backups/`. + string source_backup = 2 [ + (google.api.resource_reference) = { type: "spanner.googleapis.com/Backup" } + ]; + + // The progress of the + // [CopyBackup][google.spanner.admin.database.v1.DatabaseAdmin.CopyBackup] + // operation. + OperationProgress progress = 3; + + // The time at which cancellation of CopyBackup operation was received. + // [Operations.CancelOperation][google.longrunning.Operations.CancelOperation] + // starts asynchronous cancellation on a long-running operation. The server + // makes a best effort to cancel the operation, but success is not guaranteed. + // Clients can use + // [Operations.GetOperation][google.longrunning.Operations.GetOperation] or + // other methods to check whether the cancellation succeeded or whether the + // operation completed despite cancellation. On successful cancellation, + // the operation is not deleted; instead, it becomes an operation with + // an [Operation.error][google.longrunning.Operation.error] value with a + // [google.rpc.Status.code][google.rpc.Status.code] of 1, + // corresponding to `Code.CANCELLED`. + google.protobuf.Timestamp cancel_time = 4; +} + +// The request for +// [UpdateBackup][google.spanner.admin.database.v1.DatabaseAdmin.UpdateBackup]. +message UpdateBackupRequest { + // Required. The backup to update. `backup.name`, and the fields to be updated + // as specified by `update_mask` are required. Other fields are ignored. + // Update is only supported for the following fields: + // * `backup.expire_time`. + Backup backup = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. A mask specifying which fields (e.g. `expire_time`) in the + // Backup resource should be updated. This mask is relative to the Backup + // resource, not to the request message. The field mask must always be + // specified; this prevents any future fields from being erased accidentally + // by clients that do not know about them. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// The request for +// [GetBackup][google.spanner.admin.database.v1.DatabaseAdmin.GetBackup]. +message GetBackupRequest { + // Required. Name of the backup. + // Values are of the form + // `projects//instances//backups/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "spanner.googleapis.com/Backup" } + ]; +} + +// The request for +// [DeleteBackup][google.spanner.admin.database.v1.DatabaseAdmin.DeleteBackup]. +message DeleteBackupRequest { + // Required. Name of the backup to delete. + // Values are of the form + // `projects//instances//backups/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "spanner.googleapis.com/Backup" } + ]; +} + +// The request for +// [ListBackups][google.spanner.admin.database.v1.DatabaseAdmin.ListBackups]. +message ListBackupsRequest { + // Required. The instance to list backups from. Values are of the + // form `projects//instances/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "spanner.googleapis.com/Instance" + } + ]; + + // An expression that filters the list of returned backups. + // + // A filter expression consists of a field name, a comparison operator, and a + // value for filtering. + // The value must be a string, a number, or a boolean. The comparison operator + // must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. + // Colon `:` is the contains operator. Filter rules are not case sensitive. + // + // The following fields in the + // [Backup][google.spanner.admin.database.v1.Backup] are eligible for + // filtering: + // + // * `name` + // * `database` + // * `state` + // * `create_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) + // * `expire_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) + // * `version_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) + // * `size_bytes` + // * `backup_schedules` + // + // You can combine multiple expressions by enclosing each expression in + // parentheses. By default, expressions are combined with AND logic, but + // you can specify AND, OR, and NOT logic explicitly. + // + // Here are a few examples: + // + // * `name:Howl` - The backup's name contains the string "howl". + // * `database:prod` + // - The database's name contains the string "prod". + // * `state:CREATING` - The backup is pending creation. + // * `state:READY` - The backup is fully created and ready for use. + // * `(name:howl) AND (create_time < \"2018-03-28T14:50:00Z\")` + // - The backup name contains the string "howl" and `create_time` + // of the backup is before 2018-03-28T14:50:00Z. + // * `expire_time < \"2018-03-28T14:50:00Z\"` + // - The backup `expire_time` is before 2018-03-28T14:50:00Z. + // * `size_bytes > 10000000000` - The backup's size is greater than 10GB + // * `backup_schedules:daily` + // - The backup is created from a schedule with "daily" in its name. + string filter = 2; + + // Number of backups to be returned in the response. If 0 or + // less, defaults to the server's maximum allowed page size. + int32 page_size = 3; + + // If non-empty, `page_token` should contain a + // [next_page_token][google.spanner.admin.database.v1.ListBackupsResponse.next_page_token] + // from a previous + // [ListBackupsResponse][google.spanner.admin.database.v1.ListBackupsResponse] + // to the same `parent` and with the same `filter`. + string page_token = 4; +} + +// The response for +// [ListBackups][google.spanner.admin.database.v1.DatabaseAdmin.ListBackups]. +message ListBackupsResponse { + // The list of matching backups. Backups returned are ordered by `create_time` + // in descending order, starting from the most recent `create_time`. + repeated Backup backups = 1; + + // `next_page_token` can be sent in a subsequent + // [ListBackups][google.spanner.admin.database.v1.DatabaseAdmin.ListBackups] + // call to fetch more of the matching backups. + string next_page_token = 2; +} + +// The request for +// [ListBackupOperations][google.spanner.admin.database.v1.DatabaseAdmin.ListBackupOperations]. +message ListBackupOperationsRequest { + // Required. The instance of the backup operations. Values are of + // the form `projects//instances/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "spanner.googleapis.com/Instance" + } + ]; + + // An expression that filters the list of returned backup operations. + // + // A filter expression consists of a field name, a + // comparison operator, and a value for filtering. + // The value must be a string, a number, or a boolean. The comparison operator + // must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. + // Colon `:` is the contains operator. Filter rules are not case sensitive. + // + // The following fields in the [operation][google.longrunning.Operation] + // are eligible for filtering: + // + // * `name` - The name of the long-running operation + // * `done` - False if the operation is in progress, else true. + // * `metadata.@type` - the type of metadata. For example, the type string + // for + // [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata] + // is + // `type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata`. + // * `metadata.` - any field in metadata.value. + // `metadata.@type` must be specified first if filtering on metadata + // fields. + // * `error` - Error associated with the long-running operation. + // * `response.@type` - the type of response. + // * `response.` - any field in response.value. + // + // You can combine multiple expressions by enclosing each expression in + // parentheses. By default, expressions are combined with AND logic, but + // you can specify AND, OR, and NOT logic explicitly. + // + // Here are a few examples: + // + // * `done:true` - The operation is complete. + // * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \ + // `metadata.database:prod` - Returns operations where: + // * The operation's metadata type is + // [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. + // * The source database name of backup contains the string "prod". + // * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \ + // `(metadata.name:howl) AND` \ + // `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \ + // `(error:*)` - Returns operations where: + // * The operation's metadata type is + // [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. + // * The backup name contains the string "howl". + // * The operation started before 2018-03-28T14:50:00Z. + // * The operation resulted in an error. + // * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CopyBackupMetadata) AND` \ + // `(metadata.source_backup:test) AND` \ + // `(metadata.progress.start_time < \"2022-01-18T14:50:00Z\") AND` \ + // `(error:*)` - Returns operations where: + // * The operation's metadata type is + // [CopyBackupMetadata][google.spanner.admin.database.v1.CopyBackupMetadata]. + // * The source backup name contains the string "test". + // * The operation started before 2022-01-18T14:50:00Z. + // * The operation resulted in an error. + // * `((metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \ + // `(metadata.database:test_db)) OR` \ + // `((metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CopyBackupMetadata) + // AND` \ + // `(metadata.source_backup:test_bkp)) AND` \ + // `(error:*)` - Returns operations where: + // * The operation's metadata matches either of criteria: + // * The operation's metadata type is + // [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata] + // AND the source database name of the backup contains the string + // "test_db" + // * The operation's metadata type is + // [CopyBackupMetadata][google.spanner.admin.database.v1.CopyBackupMetadata] + // AND the source backup name contains the string "test_bkp" + // * The operation resulted in an error. + string filter = 2; + + // Number of operations to be returned in the response. If 0 or + // less, defaults to the server's maximum allowed page size. + int32 page_size = 3; + + // If non-empty, `page_token` should contain a + // [next_page_token][google.spanner.admin.database.v1.ListBackupOperationsResponse.next_page_token] + // from a previous + // [ListBackupOperationsResponse][google.spanner.admin.database.v1.ListBackupOperationsResponse] + // to the same `parent` and with the same `filter`. + string page_token = 4; +} + +// The response for +// [ListBackupOperations][google.spanner.admin.database.v1.DatabaseAdmin.ListBackupOperations]. +message ListBackupOperationsResponse { + // The list of matching backup [long-running + // operations][google.longrunning.Operation]. Each operation's name will be + // prefixed by the backup's name. The operation's + // [metadata][google.longrunning.Operation.metadata] field type + // `metadata.type_url` describes the type of the metadata. Operations returned + // include those that are pending or have completed/failed/canceled within the + // last 7 days. Operations returned are ordered by + // `operation.metadata.value.progress.start_time` in descending order starting + // from the most recently started operation. + repeated google.longrunning.Operation operations = 1; + + // `next_page_token` can be sent in a subsequent + // [ListBackupOperations][google.spanner.admin.database.v1.DatabaseAdmin.ListBackupOperations] + // call to fetch more of the matching metadata. + string next_page_token = 2; +} + +// Information about a backup. +message BackupInfo { + // Name of the backup. + string backup = 1 [ + (google.api.resource_reference) = { type: "spanner.googleapis.com/Backup" } + ]; + + // The backup contains an externally consistent copy of `source_database` at + // the timestamp specified by `version_time`. If the + // [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] + // request did not specify `version_time`, the `version_time` of the backup is + // equivalent to the `create_time`. + google.protobuf.Timestamp version_time = 4; + + // The time the + // [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] + // request was received. + google.protobuf.Timestamp create_time = 2; + + // Name of the database the backup was created from. + string source_database = 3 [(google.api.resource_reference) = { + type: "spanner.googleapis.com/Database" + }]; +} + +// Encryption configuration for the backup to create. +message CreateBackupEncryptionConfig { + // Encryption types for the backup. + enum EncryptionType { + // Unspecified. Do not use. + ENCRYPTION_TYPE_UNSPECIFIED = 0; + + // Use the same encryption configuration as the database. This is the + // default option when + // [encryption_config][google.spanner.admin.database.v1.CreateBackupEncryptionConfig] + // is empty. For example, if the database is using + // `Customer_Managed_Encryption`, the backup will be using the same Cloud + // KMS key as the database. + USE_DATABASE_ENCRYPTION = 1; + + // Use Google default encryption. + GOOGLE_DEFAULT_ENCRYPTION = 2; + + // Use customer managed encryption. If specified, `kms_key_name` + // must contain a valid Cloud KMS key. + CUSTOMER_MANAGED_ENCRYPTION = 3; + } + + // Required. The encryption type of the backup. + EncryptionType encryption_type = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The Cloud KMS key that will be used to protect the backup. + // This field should be set only when + // [encryption_type][google.spanner.admin.database.v1.CreateBackupEncryptionConfig.encryption_type] + // is `CUSTOMER_MANAGED_ENCRYPTION`. Values are of the form + // `projects//locations//keyRings//cryptoKeys/`. + string kms_key_name = 2 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "cloudkms.googleapis.com/CryptoKey" + } + ]; + + // Optional. Specifies the KMS configuration for the one or more keys used to + // protect the backup. Values are of the form + // `projects//locations//keyRings//cryptoKeys/`. + // + // The keys referenced by kms_key_names must fully cover all + // regions of the backup's instance configuration. Some examples: + // * For single region instance configs, specify a single regional + // location KMS key. + // * For multi-regional instance configs of type GOOGLE_MANAGED, + // either specify a multi-regional location KMS key or multiple regional + // location KMS keys that cover all regions in the instance config. + // * For an instance config of type USER_MANAGED, please specify only + // regional location KMS keys to cover each region in the instance config. + // Multi-regional location KMS keys are not supported for USER_MANAGED + // instance configs. + repeated string kms_key_names = 3 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "cloudkms.googleapis.com/CryptoKey" + } + ]; +} + +// Encryption configuration for the copied backup. +message CopyBackupEncryptionConfig { + // Encryption types for the backup. + enum EncryptionType { + // Unspecified. Do not use. + ENCRYPTION_TYPE_UNSPECIFIED = 0; + + // This is the default option for + // [CopyBackup][google.spanner.admin.database.v1.DatabaseAdmin.CopyBackup] + // when + // [encryption_config][google.spanner.admin.database.v1.CopyBackupEncryptionConfig] + // is not specified. For example, if the source backup is using + // `Customer_Managed_Encryption`, the backup will be using the same Cloud + // KMS key as the source backup. + USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION = 1; + + // Use Google default encryption. + GOOGLE_DEFAULT_ENCRYPTION = 2; + + // Use customer managed encryption. If specified, either `kms_key_name` or + // `kms_key_names` must contain valid Cloud KMS key(s). + CUSTOMER_MANAGED_ENCRYPTION = 3; + } + + // Required. The encryption type of the backup. + EncryptionType encryption_type = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The Cloud KMS key that will be used to protect the backup. + // This field should be set only when + // [encryption_type][google.spanner.admin.database.v1.CopyBackupEncryptionConfig.encryption_type] + // is `CUSTOMER_MANAGED_ENCRYPTION`. Values are of the form + // `projects//locations//keyRings//cryptoKeys/`. + string kms_key_name = 2 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "cloudkms.googleapis.com/CryptoKey" + } + ]; + + // Optional. Specifies the KMS configuration for the one or more keys used to + // protect the backup. Values are of the form + // `projects//locations//keyRings//cryptoKeys/`. + // Kms keys specified can be in any order. + // + // The keys referenced by kms_key_names must fully cover all + // regions of the backup's instance configuration. Some examples: + // * For single region instance configs, specify a single regional + // location KMS key. + // * For multi-regional instance configs of type GOOGLE_MANAGED, + // either specify a multi-regional location KMS key or multiple regional + // location KMS keys that cover all regions in the instance config. + // * For an instance config of type USER_MANAGED, please specify only + // regional location KMS keys to cover each region in the instance config. + // Multi-regional location KMS keys are not supported for USER_MANAGED + // instance configs. + repeated string kms_key_names = 3 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "cloudkms.googleapis.com/CryptoKey" + } + ]; +} + +// The specification for full backups. +// A full backup stores the entire contents of the database at a given +// version time. +message FullBackupSpec {} + +// The specification for incremental backup chains. +// An incremental backup stores the delta of changes between a previous +// backup and the database contents at a given version time. An +// incremental backup chain consists of a full backup and zero or more +// successive incremental backups. The first backup created for an +// incremental backup chain is always a full backup. +message IncrementalBackupSpec {} + +// Instance partition information for the backup. +message BackupInstancePartition { + // A unique identifier for the instance partition. Values are of the form + // `projects//instances//instancePartitions/` + string instance_partition = 1 [(google.api.resource_reference) = { + type: "spanner.googleapis.com/InstancePartition" + }]; +} diff --git a/owl-bot-staging/admin/database/v1/protos/google/spanner/admin/database/v1/backup_schedule.proto b/owl-bot-staging/admin/database/v1/protos/google/spanner/admin/database/v1/backup_schedule.proto new file mode 100644 index 000000000..c273516ae --- /dev/null +++ b/owl-bot-staging/admin/database/v1/protos/google/spanner/admin/database/v1/backup_schedule.proto @@ -0,0 +1,230 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.spanner.admin.database.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; +import "google/spanner/admin/database/v1/backup.proto"; + +option csharp_namespace = "Google.Cloud.Spanner.Admin.Database.V1"; +option go_package = "cloud.google.com/go/spanner/admin/database/apiv1/databasepb;databasepb"; +option java_multiple_files = true; +option java_outer_classname = "BackupScheduleProto"; +option java_package = "com.google.spanner.admin.database.v1"; +option php_namespace = "Google\\Cloud\\Spanner\\Admin\\Database\\V1"; +option ruby_package = "Google::Cloud::Spanner::Admin::Database::V1"; + +// Defines specifications of the backup schedule. +message BackupScheduleSpec { + // Required. + oneof schedule_spec { + // Cron style schedule specification. + CrontabSpec cron_spec = 1; + } +} + +// BackupSchedule expresses the automated backup creation specification for a +// Spanner database. +// Next ID: 10 +message BackupSchedule { + option (google.api.resource) = { + type: "spanner.googleapis.com/BackupSchedule" + pattern: "projects/{project}/instances/{instance}/databases/{database}/backupSchedules/{schedule}" + plural: "backupSchedules" + singular: "backupSchedule" + }; + + // Identifier. Output only for the + // [CreateBackupSchedule][DatabaseAdmin.CreateBackupSchededule] operation. + // Required for the + // [UpdateBackupSchedule][google.spanner.admin.database.v1.DatabaseAdmin.UpdateBackupSchedule] + // operation. A globally unique identifier for the backup schedule which + // cannot be changed. Values are of the form + // `projects//instances//databases//backupSchedules/[a-z][a-z0-9_\-]*[a-z0-9]` + // The final segment of the name must be between 2 and 60 characters in + // length. + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Optional. The schedule specification based on which the backup creations + // are triggered. + BackupScheduleSpec spec = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The retention duration of a backup that must be at least 6 hours + // and at most 366 days. The backup is eligible to be automatically deleted + // once the retention period has elapsed. + google.protobuf.Duration retention_duration = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The encryption configuration that will be used to encrypt the + // backup. If this field is not specified, the backup will use the same + // encryption configuration as the database. + CreateBackupEncryptionConfig encryption_config = 4 + [(google.api.field_behavior) = OPTIONAL]; + + // Required. Backup type spec determines the type of backup that is created by + // the backup schedule. Currently, only full backups are supported. + oneof backup_type_spec { + // The schedule creates only full backups. + FullBackupSpec full_backup_spec = 7; + + // The schedule creates incremental backup chains. + IncrementalBackupSpec incremental_backup_spec = 8; + } + + // Output only. The timestamp at which the schedule was last updated. + // If the schedule has never been updated, this field contains the timestamp + // when the schedule was first created. + google.protobuf.Timestamp update_time = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// CrontabSpec can be used to specify the version time and frequency at +// which the backup should be created. +message CrontabSpec { + // Required. Textual representation of the crontab. User can customize the + // backup frequency and the backup version time using the cron + // expression. The version time must be in UTC timezone. + // + // The backup will contain an externally consistent copy of the + // database at the version time. Allowed frequencies are 12 hour, 1 day, + // 1 week and 1 month. Examples of valid cron specifications: + // * `0 2/12 * * * ` : every 12 hours at (2, 14) hours past midnight in UTC. + // * `0 2,14 * * * ` : every 12 hours at (2,14) hours past midnight in UTC. + // * `0 2 * * * ` : once a day at 2 past midnight in UTC. + // * `0 2 * * 0 ` : once a week every Sunday at 2 past midnight in UTC. + // * `0 2 8 * * ` : once a month on 8th day at 2 past midnight in UTC. + string text = 1 [(google.api.field_behavior) = REQUIRED]; + + // Output only. The time zone of the times in `CrontabSpec.text`. Currently + // only UTC is supported. + string time_zone = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Schedule backups will contain an externally consistent copy + // of the database at the version time specified in + // `schedule_spec.cron_spec`. However, Spanner may not initiate the creation + // of the scheduled backups at that version time. Spanner will initiate + // the creation of scheduled backups within the time window bounded by the + // version_time specified in `schedule_spec.cron_spec` and version_time + + // `creation_window`. + google.protobuf.Duration creation_window = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The request for +// [CreateBackupSchedule][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackupSchedule]. +message CreateBackupScheduleRequest { + // Required. The name of the database that this backup schedule applies to. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "spanner.googleapis.com/Database" + } + ]; + + // Required. The Id to use for the backup schedule. The `backup_schedule_id` + // appended to `parent` forms the full backup schedule name of the form + // `projects//instances//databases//backupSchedules/`. + string backup_schedule_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The backup schedule to create. + BackupSchedule backup_schedule = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// The request for +// [GetBackupSchedule][google.spanner.admin.database.v1.DatabaseAdmin.GetBackupSchedule]. +message GetBackupScheduleRequest { + // Required. The name of the schedule to retrieve. + // Values are of the form + // `projects//instances//databases//backupSchedules/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "spanner.googleapis.com/BackupSchedule" + } + ]; +} + +// The request for +// [DeleteBackupSchedule][google.spanner.admin.database.v1.DatabaseAdmin.DeleteBackupSchedule]. +message DeleteBackupScheduleRequest { + // Required. The name of the schedule to delete. + // Values are of the form + // `projects//instances//databases//backupSchedules/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "spanner.googleapis.com/BackupSchedule" + } + ]; +} + +// The request for +// [ListBackupSchedules][google.spanner.admin.database.v1.DatabaseAdmin.ListBackupSchedules]. +message ListBackupSchedulesRequest { + // Required. Database is the parent resource whose backup schedules should be + // listed. Values are of the form + // projects//instances//databases/ + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "spanner.googleapis.com/Database" + } + ]; + + // Optional. Number of backup schedules to be returned in the response. If 0 + // or less, defaults to the server's maximum allowed page size. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If non-empty, `page_token` should contain a + // [next_page_token][google.spanner.admin.database.v1.ListBackupSchedulesResponse.next_page_token] + // from a previous + // [ListBackupSchedulesResponse][google.spanner.admin.database.v1.ListBackupSchedulesResponse] + // to the same `parent`. + string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// The response for +// [ListBackupSchedules][google.spanner.admin.database.v1.DatabaseAdmin.ListBackupSchedules]. +message ListBackupSchedulesResponse { + // The list of backup schedules for a database. + repeated BackupSchedule backup_schedules = 1; + + // `next_page_token` can be sent in a subsequent + // [ListBackupSchedules][google.spanner.admin.database.v1.DatabaseAdmin.ListBackupSchedules] + // call to fetch more of the schedules. + string next_page_token = 2; +} + +// The request for +// [UpdateBackupScheduleRequest][google.spanner.admin.database.v1.DatabaseAdmin.UpdateBackupSchedule]. +message UpdateBackupScheduleRequest { + // Required. The backup schedule to update. `backup_schedule.name`, and the + // fields to be updated as specified by `update_mask` are required. Other + // fields are ignored. + BackupSchedule backup_schedule = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. A mask specifying which fields in the BackupSchedule resource + // should be updated. This mask is relative to the BackupSchedule resource, + // not to the request message. The field mask must always be + // specified; this prevents any future fields from being erased + // accidentally. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; +} diff --git a/owl-bot-staging/admin/database/v1/protos/google/spanner/admin/database/v1/common.proto b/owl-bot-staging/admin/database/v1/protos/google/spanner/admin/database/v1/common.proto new file mode 100644 index 000000000..c494b8cf7 --- /dev/null +++ b/owl-bot-staging/admin/database/v1/protos/google/spanner/admin/database/v1/common.proto @@ -0,0 +1,132 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.spanner.admin.database.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +option csharp_namespace = "Google.Cloud.Spanner.Admin.Database.V1"; +option go_package = "cloud.google.com/go/spanner/admin/database/apiv1/databasepb;databasepb"; +option java_multiple_files = true; +option java_outer_classname = "CommonProto"; +option java_package = "com.google.spanner.admin.database.v1"; +option php_namespace = "Google\\Cloud\\Spanner\\Admin\\Database\\V1"; +option ruby_package = "Google::Cloud::Spanner::Admin::Database::V1"; +option (google.api.resource_definition) = { + type: "cloudkms.googleapis.com/CryptoKey" + pattern: "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}" +}; +option (google.api.resource_definition) = { + type: "cloudkms.googleapis.com/CryptoKeyVersion" + pattern: "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}" +}; + +// Encapsulates progress related information for a Cloud Spanner long +// running operation. +message OperationProgress { + // Percent completion of the operation. + // Values are between 0 and 100 inclusive. + int32 progress_percent = 1; + + // Time the request was received. + google.protobuf.Timestamp start_time = 2; + + // If set, the time at which this operation failed or was completed + // successfully. + google.protobuf.Timestamp end_time = 3; +} + +// Encryption configuration for a Cloud Spanner database. +message EncryptionConfig { + // The Cloud KMS key to be used for encrypting and decrypting + // the database. Values are of the form + // `projects//locations//keyRings//cryptoKeys/`. + string kms_key_name = 2 [(google.api.resource_reference) = { + type: "cloudkms.googleapis.com/CryptoKey" + }]; + + // Specifies the KMS configuration for the one or more keys used to encrypt + // the database. Values are of the form + // `projects//locations//keyRings//cryptoKeys/`. + // + // The keys referenced by kms_key_names must fully cover all + // regions of the database instance configuration. Some examples: + // * For single region database instance configs, specify a single regional + // location KMS key. + // * For multi-regional database instance configs of type GOOGLE_MANAGED, + // either specify a multi-regional location KMS key or multiple regional + // location KMS keys that cover all regions in the instance config. + // * For a database instance config of type USER_MANAGED, please specify only + // regional location KMS keys to cover each region in the instance config. + // Multi-regional location KMS keys are not supported for USER_MANAGED + // instance configs. + repeated string kms_key_names = 3 [(google.api.resource_reference) = { + type: "cloudkms.googleapis.com/CryptoKey" + }]; +} + +// Encryption information for a Cloud Spanner database or backup. +message EncryptionInfo { + // Possible encryption types. + enum Type { + // Encryption type was not specified, though data at rest remains encrypted. + TYPE_UNSPECIFIED = 0; + + // The data is encrypted at rest with a key that is + // fully managed by Google. No key version or status will be populated. + // This is the default state. + GOOGLE_DEFAULT_ENCRYPTION = 1; + + // The data is encrypted at rest with a key that is + // managed by the customer. The active version of the key. `kms_key_version` + // will be populated, and `encryption_status` may be populated. + CUSTOMER_MANAGED_ENCRYPTION = 2; + } + + // Output only. The type of encryption. + Type encryption_type = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. If present, the status of a recent encrypt/decrypt call on + // underlying data for this database or backup. Regardless of status, data is + // always encrypted at rest. + google.rpc.Status encryption_status = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A Cloud KMS key version that is being used to protect the + // database or backup. + string kms_key_version = 2 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "cloudkms.googleapis.com/CryptoKeyVersion" + } + ]; +} + +// Indicates the dialect type of a database. +enum DatabaseDialect { + // Default value. This value will create a database with the + // GOOGLE_STANDARD_SQL dialect. + DATABASE_DIALECT_UNSPECIFIED = 0; + + // GoogleSQL supported SQL. + GOOGLE_STANDARD_SQL = 1; + + // PostgreSQL supported SQL. + POSTGRESQL = 2; +} diff --git a/owl-bot-staging/admin/database/v1/protos/google/spanner/admin/database/v1/spanner_database_admin.proto b/owl-bot-staging/admin/database/v1/protos/google/spanner/admin/database/v1/spanner_database_admin.proto new file mode 100644 index 000000000..d41a4114c --- /dev/null +++ b/owl-bot-staging/admin/database/v1/protos/google/spanner/admin/database/v1/spanner_database_admin.proto @@ -0,0 +1,1314 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.spanner.admin.database.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/iam/v1/iam_policy.proto"; +import "google/iam/v1/policy.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; +import "google/spanner/admin/database/v1/backup.proto"; +import "google/spanner/admin/database/v1/backup_schedule.proto"; +import "google/spanner/admin/database/v1/common.proto"; + +option csharp_namespace = "Google.Cloud.Spanner.Admin.Database.V1"; +option go_package = "cloud.google.com/go/spanner/admin/database/apiv1/databasepb;databasepb"; +option java_multiple_files = true; +option java_outer_classname = "SpannerDatabaseAdminProto"; +option java_package = "com.google.spanner.admin.database.v1"; +option php_namespace = "Google\\Cloud\\Spanner\\Admin\\Database\\V1"; +option ruby_package = "Google::Cloud::Spanner::Admin::Database::V1"; +option (google.api.resource_definition) = { + type: "spanner.googleapis.com/Instance" + pattern: "projects/{project}/instances/{instance}" +}; +option (google.api.resource_definition) = { + type: "spanner.googleapis.com/InstancePartition" + pattern: "projects/{project}/instances/{instance}/instancePartitions/{instance_partition}" +}; + +// Cloud Spanner Database Admin API +// +// The Cloud Spanner Database Admin API can be used to: +// * create, drop, and list databases +// * update the schema of pre-existing databases +// * create, delete, copy and list backups for a database +// * restore a database from an existing backup +service DatabaseAdmin { + option (google.api.default_host) = "spanner.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/spanner.admin"; + + // Lists Cloud Spanner databases. + rpc ListDatabases(ListDatabasesRequest) returns (ListDatabasesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/instances/*}/databases" + }; + option (google.api.method_signature) = "parent"; + } + + // Creates a new Cloud Spanner database and starts to prepare it for serving. + // The returned [long-running operation][google.longrunning.Operation] will + // have a name of the format `/operations/` and + // can be used to track preparation of the database. The + // [metadata][google.longrunning.Operation.metadata] field type is + // [CreateDatabaseMetadata][google.spanner.admin.database.v1.CreateDatabaseMetadata]. + // The [response][google.longrunning.Operation.response] field type is + // [Database][google.spanner.admin.database.v1.Database], if successful. + rpc CreateDatabase(CreateDatabaseRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/instances/*}/databases" + body: "*" + }; + option (google.api.method_signature) = "parent,create_statement"; + option (google.longrunning.operation_info) = { + response_type: "google.spanner.admin.database.v1.Database" + metadata_type: "google.spanner.admin.database.v1.CreateDatabaseMetadata" + }; + } + + // Gets the state of a Cloud Spanner database. + rpc GetDatabase(GetDatabaseRequest) returns (Database) { + option (google.api.http) = { + get: "/v1/{name=projects/*/instances/*/databases/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates a Cloud Spanner database. The returned + // [long-running operation][google.longrunning.Operation] can be used to track + // the progress of updating the database. If the named database does not + // exist, returns `NOT_FOUND`. + // + // While the operation is pending: + // + // * The database's + // [reconciling][google.spanner.admin.database.v1.Database.reconciling] + // field is set to true. + // * Cancelling the operation is best-effort. If the cancellation succeeds, + // the operation metadata's + // [cancel_time][google.spanner.admin.database.v1.UpdateDatabaseMetadata.cancel_time] + // is set, the updates are reverted, and the operation terminates with a + // `CANCELLED` status. + // * New UpdateDatabase requests will return a `FAILED_PRECONDITION` error + // until the pending operation is done (returns successfully or with + // error). + // * Reading the database via the API continues to give the pre-request + // values. + // + // Upon completion of the returned operation: + // + // * The new values are in effect and readable via the API. + // * The database's + // [reconciling][google.spanner.admin.database.v1.Database.reconciling] + // field becomes false. + // + // The returned [long-running operation][google.longrunning.Operation] will + // have a name of the format + // `projects//instances//databases//operations/` + // and can be used to track the database modification. The + // [metadata][google.longrunning.Operation.metadata] field type is + // [UpdateDatabaseMetadata][google.spanner.admin.database.v1.UpdateDatabaseMetadata]. + // The [response][google.longrunning.Operation.response] field type is + // [Database][google.spanner.admin.database.v1.Database], if successful. + rpc UpdateDatabase(UpdateDatabaseRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{database.name=projects/*/instances/*/databases/*}" + body: "database" + }; + option (google.api.method_signature) = "database,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Database" + metadata_type: "UpdateDatabaseMetadata" + }; + } + + // Updates the schema of a Cloud Spanner database by + // creating/altering/dropping tables, columns, indexes, etc. The returned + // [long-running operation][google.longrunning.Operation] will have a name of + // the format `/operations/` and can be used to + // track execution of the schema change(s). The + // [metadata][google.longrunning.Operation.metadata] field type is + // [UpdateDatabaseDdlMetadata][google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata]. + // The operation has no response. + rpc UpdateDatabaseDdl(UpdateDatabaseDdlRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{database=projects/*/instances/*/databases/*}/ddl" + body: "*" + }; + option (google.api.method_signature) = "database,statements"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata" + }; + } + + // Drops (aka deletes) a Cloud Spanner database. + // Completed backups for the database will be retained according to their + // `expire_time`. + // Note: Cloud Spanner might continue to accept requests for a few seconds + // after the database has been deleted. + rpc DropDatabase(DropDatabaseRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{database=projects/*/instances/*/databases/*}" + }; + option (google.api.method_signature) = "database"; + } + + // Returns the schema of a Cloud Spanner database as a list of formatted + // DDL statements. This method does not show pending schema updates, those may + // be queried using the [Operations][google.longrunning.Operations] API. + rpc GetDatabaseDdl(GetDatabaseDdlRequest) returns (GetDatabaseDdlResponse) { + option (google.api.http) = { + get: "/v1/{database=projects/*/instances/*/databases/*}/ddl" + }; + option (google.api.method_signature) = "database"; + } + + // Sets the access control policy on a database or backup resource. + // Replaces any existing policy. + // + // Authorization requires `spanner.databases.setIamPolicy` + // permission on [resource][google.iam.v1.SetIamPolicyRequest.resource]. + // For backups, authorization requires `spanner.backups.setIamPolicy` + // permission on [resource][google.iam.v1.SetIamPolicyRequest.resource]. + rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) + returns (google.iam.v1.Policy) { + option (google.api.http) = { + post: "/v1/{resource=projects/*/instances/*/databases/*}:setIamPolicy" + body: "*" + additional_bindings { + post: "/v1/{resource=projects/*/instances/*/backups/*}:setIamPolicy" + body: "*" + } + additional_bindings { + post: "/v1/{resource=projects/*/instances/*/databases/*/backupSchedules/*}:setIamPolicy" + body: "*" + } + }; + option (google.api.method_signature) = "resource,policy"; + } + + // Gets the access control policy for a database or backup resource. + // Returns an empty policy if a database or backup exists but does not have a + // policy set. + // + // Authorization requires `spanner.databases.getIamPolicy` permission on + // [resource][google.iam.v1.GetIamPolicyRequest.resource]. + // For backups, authorization requires `spanner.backups.getIamPolicy` + // permission on [resource][google.iam.v1.GetIamPolicyRequest.resource]. + rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) + returns (google.iam.v1.Policy) { + option (google.api.http) = { + post: "/v1/{resource=projects/*/instances/*/databases/*}:getIamPolicy" + body: "*" + additional_bindings { + post: "/v1/{resource=projects/*/instances/*/backups/*}:getIamPolicy" + body: "*" + } + additional_bindings { + post: "/v1/{resource=projects/*/instances/*/databases/*/backupSchedules/*}:getIamPolicy" + body: "*" + } + }; + option (google.api.method_signature) = "resource"; + } + + // Returns permissions that the caller has on the specified database or backup + // resource. + // + // Attempting this RPC on a non-existent Cloud Spanner database will + // result in a NOT_FOUND error if the user has + // `spanner.databases.list` permission on the containing Cloud + // Spanner instance. Otherwise returns an empty set of permissions. + // Calling this method on a backup that does not exist will + // result in a NOT_FOUND error if the user has + // `spanner.backups.list` permission on the containing instance. + rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) + returns (google.iam.v1.TestIamPermissionsResponse) { + option (google.api.http) = { + post: "/v1/{resource=projects/*/instances/*/databases/*}:testIamPermissions" + body: "*" + additional_bindings { + post: "/v1/{resource=projects/*/instances/*/backups/*}:testIamPermissions" + body: "*" + } + additional_bindings { + post: "/v1/{resource=projects/*/instances/*/databases/*/backupSchedules/*}:testIamPermissions" + body: "*" + } + additional_bindings { + post: "/v1/{resource=projects/*/instances/*/databases/*/databaseRoles/*}:testIamPermissions" + body: "*" + } + }; + option (google.api.method_signature) = "resource,permissions"; + } + + // Starts creating a new Cloud Spanner Backup. + // The returned backup [long-running operation][google.longrunning.Operation] + // will have a name of the format + // `projects//instances//backups//operations/` + // and can be used to track creation of the backup. The + // [metadata][google.longrunning.Operation.metadata] field type is + // [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. + // The [response][google.longrunning.Operation.response] field type is + // [Backup][google.spanner.admin.database.v1.Backup], if successful. + // Cancelling the returned operation will stop the creation and delete the + // backup. There can be only one pending backup creation per database. Backup + // creation of different databases can run concurrently. + rpc CreateBackup(CreateBackupRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/instances/*}/backups" + body: "backup" + }; + option (google.api.method_signature) = "parent,backup,backup_id"; + option (google.longrunning.operation_info) = { + response_type: "google.spanner.admin.database.v1.Backup" + metadata_type: "google.spanner.admin.database.v1.CreateBackupMetadata" + }; + } + + // Starts copying a Cloud Spanner Backup. + // The returned backup [long-running operation][google.longrunning.Operation] + // will have a name of the format + // `projects//instances//backups//operations/` + // and can be used to track copying of the backup. The operation is associated + // with the destination backup. + // The [metadata][google.longrunning.Operation.metadata] field type is + // [CopyBackupMetadata][google.spanner.admin.database.v1.CopyBackupMetadata]. + // The [response][google.longrunning.Operation.response] field type is + // [Backup][google.spanner.admin.database.v1.Backup], if successful. + // Cancelling the returned operation will stop the copying and delete the + // destination backup. Concurrent CopyBackup requests can run on the same + // source backup. + rpc CopyBackup(CopyBackupRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/instances/*}/backups:copy" + body: "*" + }; + option (google.api.method_signature) = + "parent,backup_id,source_backup,expire_time"; + option (google.longrunning.operation_info) = { + response_type: "google.spanner.admin.database.v1.Backup" + metadata_type: "google.spanner.admin.database.v1.CopyBackupMetadata" + }; + } + + // Gets metadata on a pending or completed + // [Backup][google.spanner.admin.database.v1.Backup]. + rpc GetBackup(GetBackupRequest) returns (Backup) { + option (google.api.http) = { + get: "/v1/{name=projects/*/instances/*/backups/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates a pending or completed + // [Backup][google.spanner.admin.database.v1.Backup]. + rpc UpdateBackup(UpdateBackupRequest) returns (Backup) { + option (google.api.http) = { + patch: "/v1/{backup.name=projects/*/instances/*/backups/*}" + body: "backup" + }; + option (google.api.method_signature) = "backup,update_mask"; + } + + // Deletes a pending or completed + // [Backup][google.spanner.admin.database.v1.Backup]. + rpc DeleteBackup(DeleteBackupRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/instances/*/backups/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists completed and pending backups. + // Backups returned are ordered by `create_time` in descending order, + // starting from the most recent `create_time`. + rpc ListBackups(ListBackupsRequest) returns (ListBackupsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/instances/*}/backups" + }; + option (google.api.method_signature) = "parent"; + } + + // Create a new database by restoring from a completed backup. The new + // database must be in the same project and in an instance with the same + // instance configuration as the instance containing + // the backup. The returned database [long-running + // operation][google.longrunning.Operation] has a name of the format + // `projects//instances//databases//operations/`, + // and can be used to track the progress of the operation, and to cancel it. + // The [metadata][google.longrunning.Operation.metadata] field type is + // [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata]. + // The [response][google.longrunning.Operation.response] type + // is [Database][google.spanner.admin.database.v1.Database], if + // successful. Cancelling the returned operation will stop the restore and + // delete the database. + // There can be only one database being restored into an instance at a time. + // Once the restore operation completes, a new restore operation can be + // initiated, without waiting for the optimize operation associated with the + // first restore to complete. + rpc RestoreDatabase(RestoreDatabaseRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/instances/*}/databases:restore" + body: "*" + }; + option (google.api.method_signature) = "parent,database_id,backup"; + option (google.longrunning.operation_info) = { + response_type: "google.spanner.admin.database.v1.Database" + metadata_type: "google.spanner.admin.database.v1.RestoreDatabaseMetadata" + }; + } + + // Lists database [longrunning-operations][google.longrunning.Operation]. + // A database operation has a name of the form + // `projects//instances//databases//operations/`. + // The long-running operation + // [metadata][google.longrunning.Operation.metadata] field type + // `metadata.type_url` describes the type of the metadata. Operations returned + // include those that have completed/failed/canceled within the last 7 days, + // and pending operations. + rpc ListDatabaseOperations(ListDatabaseOperationsRequest) + returns (ListDatabaseOperationsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/instances/*}/databaseOperations" + }; + option (google.api.method_signature) = "parent"; + } + + // Lists the backup [long-running operations][google.longrunning.Operation] in + // the given instance. A backup operation has a name of the form + // `projects//instances//backups//operations/`. + // The long-running operation + // [metadata][google.longrunning.Operation.metadata] field type + // `metadata.type_url` describes the type of the metadata. Operations returned + // include those that have completed/failed/canceled within the last 7 days, + // and pending operations. Operations returned are ordered by + // `operation.metadata.value.progress.start_time` in descending order starting + // from the most recently started operation. + rpc ListBackupOperations(ListBackupOperationsRequest) + returns (ListBackupOperationsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/instances/*}/backupOperations" + }; + option (google.api.method_signature) = "parent"; + } + + // Lists Cloud Spanner database roles. + rpc ListDatabaseRoles(ListDatabaseRolesRequest) + returns (ListDatabaseRolesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/instances/*/databases/*}/databaseRoles" + }; + option (google.api.method_signature) = "parent"; + } + + // Adds split points to specified tables, indexes of a database. + rpc AddSplitPoints(AddSplitPointsRequest) returns (AddSplitPointsResponse) { + option (google.api.http) = { + post: "/v1/{database=projects/*/instances/*/databases/*}:addSplitPoints" + body: "*" + }; + option (google.api.method_signature) = "database,split_points"; + } + + // Creates a new backup schedule. + rpc CreateBackupSchedule(CreateBackupScheduleRequest) + returns (BackupSchedule) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/instances/*/databases/*}/backupSchedules" + body: "backup_schedule" + }; + option (google.api.method_signature) = + "parent,backup_schedule,backup_schedule_id"; + } + + // Gets backup schedule for the input schedule name. + rpc GetBackupSchedule(GetBackupScheduleRequest) returns (BackupSchedule) { + option (google.api.http) = { + get: "/v1/{name=projects/*/instances/*/databases/*/backupSchedules/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates a backup schedule. + rpc UpdateBackupSchedule(UpdateBackupScheduleRequest) + returns (BackupSchedule) { + option (google.api.http) = { + patch: "/v1/{backup_schedule.name=projects/*/instances/*/databases/*/backupSchedules/*}" + body: "backup_schedule" + }; + option (google.api.method_signature) = "backup_schedule,update_mask"; + } + + // Deletes a backup schedule. + rpc DeleteBackupSchedule(DeleteBackupScheduleRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/instances/*/databases/*/backupSchedules/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists all the backup schedules for the database. + rpc ListBackupSchedules(ListBackupSchedulesRequest) + returns (ListBackupSchedulesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/instances/*/databases/*}/backupSchedules" + }; + option (google.api.method_signature) = "parent"; + } + + // This is an internal API called by Spanner Graph jobs. You should never need + // to call this API directly. + rpc InternalUpdateGraphOperation(InternalUpdateGraphOperationRequest) + returns (InternalUpdateGraphOperationResponse) { + option (google.api.method_signature) = "database,operation_id"; + } +} + +// Information about the database restore. +message RestoreInfo { + // The type of the restore source. + RestoreSourceType source_type = 1; + + // Information about the source used to restore the database. + oneof source_info { + // Information about the backup used to restore the database. The backup + // may no longer exist. + BackupInfo backup_info = 2; + } +} + +// A Cloud Spanner database. +message Database { + option (google.api.resource) = { + type: "spanner.googleapis.com/Database" + pattern: "projects/{project}/instances/{instance}/databases/{database}" + }; + + // Indicates the current state of the database. + enum State { + // Not specified. + STATE_UNSPECIFIED = 0; + + // The database is still being created. Operations on the database may fail + // with `FAILED_PRECONDITION` in this state. + CREATING = 1; + + // The database is fully created and ready for use. + READY = 2; + + // The database is fully created and ready for use, but is still + // being optimized for performance and cannot handle full load. + // + // In this state, the database still references the backup + // it was restore from, preventing the backup + // from being deleted. When optimizations are complete, the full performance + // of the database will be restored, and the database will transition to + // `READY` state. + READY_OPTIMIZING = 3; + } + + // Required. The name of the database. Values are of the form + // `projects//instances//databases/`, + // where `` is as specified in the `CREATE DATABASE` + // statement. This name can be passed to other API methods to + // identify the database. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Output only. The current database state. + State state = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. If exists, the time at which the database creation started. + google.protobuf.Timestamp create_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Applicable only for restored databases. Contains information + // about the restore source. + RestoreInfo restore_info = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. For databases that are using customer managed encryption, this + // field contains the encryption configuration for the database. + // For databases that are using Google default or other types of encryption, + // this field is empty. + EncryptionConfig encryption_config = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. For databases that are using customer managed encryption, this + // field contains the encryption information for the database, such as + // all Cloud KMS key versions that are in use. The `encryption_status' field + // inside of each `EncryptionInfo` is not populated. + // + // For databases that are using Google default or other types of encryption, + // this field is empty. + // + // This field is propagated lazily from the backend. There might be a delay + // from when a key version is being used and when it appears in this field. + repeated EncryptionInfo encryption_info = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The period in which Cloud Spanner retains all versions of data + // for the database. This is the same as the value of version_retention_period + // database option set using + // [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl]. + // Defaults to 1 hour, if not set. + string version_retention_period = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Earliest timestamp at which older versions of the data can be + // read. This value is continuously updated by Cloud Spanner and becomes stale + // the moment it is queried. If you are using this value to recover data, make + // sure to account for the time from the moment when the value is queried to + // the moment when you initiate the recovery. + google.protobuf.Timestamp earliest_version_time = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The read-write region which contains the database's leader + // replicas. + // + // This is the same as the value of default_leader + // database option set using DatabaseAdmin.CreateDatabase or + // DatabaseAdmin.UpdateDatabaseDdl. If not explicitly set, this is empty. + string default_leader = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The dialect of the Cloud Spanner Database. + DatabaseDialect database_dialect = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Whether drop protection is enabled for this database. Defaults to false, + // if not set. For more details, please see how to [prevent accidental + // database + // deletion](https://cloud.google.com/spanner/docs/prevent-database-deletion). + bool enable_drop_protection = 11; + + // Output only. If true, the database is being updated. If false, there are no + // ongoing update operations for the database. + bool reconciling = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The request for +// [ListDatabases][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabases]. +message ListDatabasesRequest { + // Required. The instance whose databases should be listed. + // Values are of the form `projects//instances/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "spanner.googleapis.com/Instance" + } + ]; + + // Number of databases to be returned in the response. If 0 or less, + // defaults to the server's maximum allowed page size. + int32 page_size = 3; + + // If non-empty, `page_token` should contain a + // [next_page_token][google.spanner.admin.database.v1.ListDatabasesResponse.next_page_token] + // from a previous + // [ListDatabasesResponse][google.spanner.admin.database.v1.ListDatabasesResponse]. + string page_token = 4; +} + +// The response for +// [ListDatabases][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabases]. +message ListDatabasesResponse { + // Databases that matched the request. + repeated Database databases = 1; + + // `next_page_token` can be sent in a subsequent + // [ListDatabases][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabases] + // call to fetch more of the matching databases. + string next_page_token = 2; +} + +// The request for +// [CreateDatabase][google.spanner.admin.database.v1.DatabaseAdmin.CreateDatabase]. +message CreateDatabaseRequest { + // Required. The name of the instance that will serve the new database. + // Values are of the form `projects//instances/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "spanner.googleapis.com/Instance" + } + ]; + + // Required. A `CREATE DATABASE` statement, which specifies the ID of the + // new database. The database ID must conform to the regular expression + // `[a-z][a-z0-9_\-]*[a-z0-9]` and be between 2 and 30 characters in length. + // If the database ID is a reserved word or if it contains a hyphen, the + // database ID must be enclosed in backticks (`` ` ``). + string create_statement = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. A list of DDL statements to run inside the newly created + // database. Statements can create tables, indexes, etc. These + // statements execute atomically with the creation of the database: + // if there is an error in any statement, the database is not created. + repeated string extra_statements = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The encryption configuration for the database. If this field is + // not specified, Cloud Spanner will encrypt/decrypt all data at rest using + // Google default encryption. + EncryptionConfig encryption_config = 4 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The dialect of the Cloud Spanner Database. + DatabaseDialect database_dialect = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Proto descriptors used by CREATE/ALTER PROTO BUNDLE statements in + // 'extra_statements' above. + // Contains a protobuf-serialized + // [google.protobuf.FileDescriptorSet](https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/descriptor.proto). + // To generate it, [install](https://grpc.io/docs/protoc-installation/) and + // run `protoc` with --include_imports and --descriptor_set_out. For example, + // to generate for moon/shot/app.proto, run + // ``` + // $protoc --proto_path=/app_path --proto_path=/lib_path \ + // --include_imports \ + // --descriptor_set_out=descriptors.data \ + // moon/shot/app.proto + // ``` + // For more details, see protobuffer [self + // description](https://developers.google.com/protocol-buffers/docs/techniques#self-description). + bytes proto_descriptors = 6 [(google.api.field_behavior) = OPTIONAL]; +} + +// Metadata type for the operation returned by +// [CreateDatabase][google.spanner.admin.database.v1.DatabaseAdmin.CreateDatabase]. +message CreateDatabaseMetadata { + // The database being created. + string database = 1 [(google.api.resource_reference) = { + type: "spanner.googleapis.com/Database" + }]; +} + +// The request for +// [GetDatabase][google.spanner.admin.database.v1.DatabaseAdmin.GetDatabase]. +message GetDatabaseRequest { + // Required. The name of the requested database. Values are of the form + // `projects//instances//databases/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "spanner.googleapis.com/Database" + } + ]; +} + +// The request for +// [UpdateDatabase][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabase]. +message UpdateDatabaseRequest { + // Required. The database to update. + // The `name` field of the database is of the form + // `projects//instances//databases/`. + Database database = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The list of fields to update. Currently, only + // `enable_drop_protection` field can be updated. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// Metadata type for the operation returned by +// [UpdateDatabase][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabase]. +message UpdateDatabaseMetadata { + // The request for + // [UpdateDatabase][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabase]. + UpdateDatabaseRequest request = 1; + + // The progress of the + // [UpdateDatabase][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabase] + // operation. + OperationProgress progress = 2; + + // The time at which this operation was cancelled. If set, this operation is + // in the process of undoing itself (which is best-effort). + google.protobuf.Timestamp cancel_time = 3; +} + +// Enqueues the given DDL statements to be applied, in order but not +// necessarily all at once, to the database schema at some point (or +// points) in the future. The server checks that the statements +// are executable (syntactically valid, name tables that exist, etc.) +// before enqueueing them, but they may still fail upon +// later execution (e.g., if a statement from another batch of +// statements is applied first and it conflicts in some way, or if +// there is some data-related problem like a `NULL` value in a column to +// which `NOT NULL` would be added). If a statement fails, all +// subsequent statements in the batch are automatically cancelled. +// +// Each batch of statements is assigned a name which can be used with +// the [Operations][google.longrunning.Operations] API to monitor +// progress. See the +// [operation_id][google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.operation_id] +// field for more details. +message UpdateDatabaseDdlRequest { + // Required. The database to update. + string database = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "spanner.googleapis.com/Database" + } + ]; + + // Required. DDL statements to be applied to the database. + repeated string statements = 2 [(google.api.field_behavior) = REQUIRED]; + + // If empty, the new update request is assigned an + // automatically-generated operation ID. Otherwise, `operation_id` + // is used to construct the name of the resulting + // [Operation][google.longrunning.Operation]. + // + // Specifying an explicit operation ID simplifies determining + // whether the statements were executed in the event that the + // [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl] + // call is replayed, or the return value is otherwise lost: the + // [database][google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.database] + // and `operation_id` fields can be combined to form the + // [name][google.longrunning.Operation.name] of the resulting + // [longrunning.Operation][google.longrunning.Operation]: + // `/operations/`. + // + // `operation_id` should be unique within the database, and must be + // a valid identifier: `[a-z][a-z0-9_]*`. Note that + // automatically-generated operation IDs always begin with an + // underscore. If the named operation already exists, + // [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl] + // returns `ALREADY_EXISTS`. + string operation_id = 3; + + // Optional. Proto descriptors used by CREATE/ALTER PROTO BUNDLE statements. + // Contains a protobuf-serialized + // [google.protobuf.FileDescriptorSet](https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/descriptor.proto). + // To generate it, [install](https://grpc.io/docs/protoc-installation/) and + // run `protoc` with --include_imports and --descriptor_set_out. For example, + // to generate for moon/shot/app.proto, run + // ``` + // $protoc --proto_path=/app_path --proto_path=/lib_path \ + // --include_imports \ + // --descriptor_set_out=descriptors.data \ + // moon/shot/app.proto + // ``` + // For more details, see protobuffer [self + // description](https://developers.google.com/protocol-buffers/docs/techniques#self-description). + bytes proto_descriptors = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. This field is exposed to be used by the Spanner Migration Tool. + // For more details, see + // [SMT](https://github.com/GoogleCloudPlatform/spanner-migration-tool). + bool throughput_mode = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Action information extracted from a DDL statement. This proto is used to +// display the brief info of the DDL statement for the operation +// [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl]. +message DdlStatementActionInfo { + // The action for the DDL statement, e.g. CREATE, ALTER, DROP, GRANT, etc. + // This field is a non-empty string. + string action = 1; + + // The entity type for the DDL statement, e.g. TABLE, INDEX, VIEW, etc. + // This field can be empty string for some DDL statement, + // e.g. for statement "ANALYZE", `entity_type` = "". + string entity_type = 2; + + // The entity name(s) being operated on the DDL statement. + // E.g. + // 1. For statement "CREATE TABLE t1(...)", `entity_names` = ["t1"]. + // 2. For statement "GRANT ROLE r1, r2 ...", `entity_names` = ["r1", "r2"]. + // 3. For statement "ANALYZE", `entity_names` = []. + repeated string entity_names = 3; +} + +// Metadata type for the operation returned by +// [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl]. +message UpdateDatabaseDdlMetadata { + // The database being modified. + string database = 1 [(google.api.resource_reference) = { + type: "spanner.googleapis.com/Database" + }]; + + // For an update this list contains all the statements. For an + // individual statement, this list contains only that statement. + repeated string statements = 2; + + // Reports the commit timestamps of all statements that have + // succeeded so far, where `commit_timestamps[i]` is the commit + // timestamp for the statement `statements[i]`. + repeated google.protobuf.Timestamp commit_timestamps = 3; + + // Output only. When true, indicates that the operation is throttled e.g. + // due to resource constraints. When resources become available the operation + // will resume and this field will be false again. + bool throttled = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The progress of the + // [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl] + // operations. All DDL statements will have continuously updating progress, + // and `progress[i]` is the operation progress for `statements[i]`. Also, + // `progress[i]` will have start time and end time populated with commit + // timestamp of operation, as well as a progress of 100% once the operation + // has completed. + repeated OperationProgress progress = 5; + + // The brief action info for the DDL statements. + // `actions[i]` is the brief info for `statements[i]`. + repeated DdlStatementActionInfo actions = 6; +} + +// The request for +// [DropDatabase][google.spanner.admin.database.v1.DatabaseAdmin.DropDatabase]. +message DropDatabaseRequest { + // Required. The database to be dropped. + string database = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "spanner.googleapis.com/Database" + } + ]; +} + +// The request for +// [GetDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.GetDatabaseDdl]. +message GetDatabaseDdlRequest { + // Required. The database whose schema we wish to get. + // Values are of the form + // `projects//instances//databases/` + string database = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "spanner.googleapis.com/Database" + } + ]; +} + +// The response for +// [GetDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.GetDatabaseDdl]. +message GetDatabaseDdlResponse { + // A list of formatted DDL statements defining the schema of the database + // specified in the request. + repeated string statements = 1; + + // Proto descriptors stored in the database. + // Contains a protobuf-serialized + // [google.protobuf.FileDescriptorSet](https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/descriptor.proto). + // For more details, see protobuffer [self + // description](https://developers.google.com/protocol-buffers/docs/techniques#self-description). + bytes proto_descriptors = 2; +} + +// The request for +// [ListDatabaseOperations][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabaseOperations]. +message ListDatabaseOperationsRequest { + // Required. The instance of the database operations. + // Values are of the form `projects//instances/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "spanner.googleapis.com/Instance" + } + ]; + + // An expression that filters the list of returned operations. + // + // A filter expression consists of a field name, a + // comparison operator, and a value for filtering. + // The value must be a string, a number, or a boolean. The comparison operator + // must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. + // Colon `:` is the contains operator. Filter rules are not case sensitive. + // + // The following fields in the [Operation][google.longrunning.Operation] + // are eligible for filtering: + // + // * `name` - The name of the long-running operation + // * `done` - False if the operation is in progress, else true. + // * `metadata.@type` - the type of metadata. For example, the type string + // for + // [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata] + // is + // `type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata`. + // * `metadata.` - any field in metadata.value. + // `metadata.@type` must be specified first, if filtering on metadata + // fields. + // * `error` - Error associated with the long-running operation. + // * `response.@type` - the type of response. + // * `response.` - any field in response.value. + // + // You can combine multiple expressions by enclosing each expression in + // parentheses. By default, expressions are combined with AND logic. However, + // you can specify AND, OR, and NOT logic explicitly. + // + // Here are a few examples: + // + // * `done:true` - The operation is complete. + // * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata) AND` \ + // `(metadata.source_type:BACKUP) AND` \ + // `(metadata.backup_info.backup:backup_howl) AND` \ + // `(metadata.name:restored_howl) AND` \ + // `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \ + // `(error:*)` - Return operations where: + // * The operation's metadata type is + // [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata]. + // * The database is restored from a backup. + // * The backup name contains "backup_howl". + // * The restored database's name contains "restored_howl". + // * The operation started before 2018-03-28T14:50:00Z. + // * The operation resulted in an error. + string filter = 2; + + // Number of operations to be returned in the response. If 0 or + // less, defaults to the server's maximum allowed page size. + int32 page_size = 3; + + // If non-empty, `page_token` should contain a + // [next_page_token][google.spanner.admin.database.v1.ListDatabaseOperationsResponse.next_page_token] + // from a previous + // [ListDatabaseOperationsResponse][google.spanner.admin.database.v1.ListDatabaseOperationsResponse] + // to the same `parent` and with the same `filter`. + string page_token = 4; +} + +// The response for +// [ListDatabaseOperations][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabaseOperations]. +message ListDatabaseOperationsResponse { + // The list of matching database [long-running + // operations][google.longrunning.Operation]. Each operation's name will be + // prefixed by the database's name. The operation's + // [metadata][google.longrunning.Operation.metadata] field type + // `metadata.type_url` describes the type of the metadata. + repeated google.longrunning.Operation operations = 1; + + // `next_page_token` can be sent in a subsequent + // [ListDatabaseOperations][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabaseOperations] + // call to fetch more of the matching metadata. + string next_page_token = 2; +} + +// The request for +// [RestoreDatabase][google.spanner.admin.database.v1.DatabaseAdmin.RestoreDatabase]. +message RestoreDatabaseRequest { + // Required. The name of the instance in which to create the + // restored database. This instance must be in the same project and + // have the same instance configuration as the instance containing + // the source backup. Values are of the form + // `projects//instances/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "spanner.googleapis.com/Instance" + } + ]; + + // Required. The id of the database to create and restore to. This + // database must not already exist. The `database_id` appended to + // `parent` forms the full database name of the form + // `projects//instances//databases/`. + string database_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The source from which to restore. + oneof source { + // Name of the backup from which to restore. Values are of the form + // `projects//instances//backups/`. + string backup = 3 [(google.api.resource_reference) = { + type: "spanner.googleapis.com/Backup" + }]; + } + + // Optional. An encryption configuration describing the encryption type and + // key resources in Cloud KMS used to encrypt/decrypt the database to restore + // to. If this field is not specified, the restored database will use the same + // encryption configuration as the backup by default, namely + // [encryption_type][google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.encryption_type] + // = `USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION`. + RestoreDatabaseEncryptionConfig encryption_config = 4 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Encryption configuration for the restored database. +message RestoreDatabaseEncryptionConfig { + // Encryption types for the database to be restored. + enum EncryptionType { + // Unspecified. Do not use. + ENCRYPTION_TYPE_UNSPECIFIED = 0; + + // This is the default option when + // [encryption_config][google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig] + // is not specified. + USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION = 1; + + // Use Google default encryption. + GOOGLE_DEFAULT_ENCRYPTION = 2; + + // Use customer managed encryption. If specified, `kms_key_name` must + // must contain a valid Cloud KMS key. + CUSTOMER_MANAGED_ENCRYPTION = 3; + } + + // Required. The encryption type of the restored database. + EncryptionType encryption_type = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The Cloud KMS key that will be used to encrypt/decrypt the + // restored database. This field should be set only when + // [encryption_type][google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.encryption_type] + // is `CUSTOMER_MANAGED_ENCRYPTION`. Values are of the form + // `projects//locations//keyRings//cryptoKeys/`. + string kms_key_name = 2 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "cloudkms.googleapis.com/CryptoKey" + } + ]; + + // Optional. Specifies the KMS configuration for the one or more keys used to + // encrypt the database. Values are of the form + // `projects//locations//keyRings//cryptoKeys/`. + // + // The keys referenced by kms_key_names must fully cover all + // regions of the database instance configuration. Some examples: + // * For single region database instance configs, specify a single regional + // location KMS key. + // * For multi-regional database instance configs of type GOOGLE_MANAGED, + // either specify a multi-regional location KMS key or multiple regional + // location KMS keys that cover all regions in the instance config. + // * For a database instance config of type USER_MANAGED, please specify only + // regional location KMS keys to cover each region in the instance config. + // Multi-regional location KMS keys are not supported for USER_MANAGED + // instance configs. + repeated string kms_key_names = 3 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "cloudkms.googleapis.com/CryptoKey" + } + ]; +} + +// Metadata type for the long-running operation returned by +// [RestoreDatabase][google.spanner.admin.database.v1.DatabaseAdmin.RestoreDatabase]. +message RestoreDatabaseMetadata { + // Name of the database being created and restored to. + string name = 1 [(google.api.resource_reference) = { + type: "spanner.googleapis.com/Database" + }]; + + // The type of the restore source. + RestoreSourceType source_type = 2; + + // Information about the source used to restore the database, as specified by + // `source` in + // [RestoreDatabaseRequest][google.spanner.admin.database.v1.RestoreDatabaseRequest]. + oneof source_info { + // Information about the backup used to restore the database. + BackupInfo backup_info = 3; + } + + // The progress of the + // [RestoreDatabase][google.spanner.admin.database.v1.DatabaseAdmin.RestoreDatabase] + // operation. + OperationProgress progress = 4; + + // The time at which cancellation of this operation was received. + // [Operations.CancelOperation][google.longrunning.Operations.CancelOperation] + // starts asynchronous cancellation on a long-running operation. The server + // makes a best effort to cancel the operation, but success is not guaranteed. + // Clients can use + // [Operations.GetOperation][google.longrunning.Operations.GetOperation] or + // other methods to check whether the cancellation succeeded or whether the + // operation completed despite cancellation. On successful cancellation, + // the operation is not deleted; instead, it becomes an operation with + // an [Operation.error][google.longrunning.Operation.error] value with a + // [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + // `Code.CANCELLED`. + google.protobuf.Timestamp cancel_time = 5; + + // If exists, the name of the long-running operation that will be used to + // track the post-restore optimization process to optimize the performance of + // the restored database, and remove the dependency on the restore source. + // The name is of the form + // `projects//instances//databases//operations/` + // where the is the name of database being created and restored to. + // The metadata type of the long-running operation is + // [OptimizeRestoredDatabaseMetadata][google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata]. + // This long-running operation will be automatically created by the system + // after the RestoreDatabase long-running operation completes successfully. + // This operation will not be created if the restore was not successful. + string optimize_database_operation_name = 6; +} + +// Metadata type for the long-running operation used to track the progress +// of optimizations performed on a newly restored database. This long-running +// operation is automatically created by the system after the successful +// completion of a database restore, and cannot be cancelled. +message OptimizeRestoredDatabaseMetadata { + // Name of the restored database being optimized. + string name = 1 [(google.api.resource_reference) = { + type: "spanner.googleapis.com/Database" + }]; + + // The progress of the post-restore optimizations. + OperationProgress progress = 2; +} + +// Indicates the type of the restore source. +enum RestoreSourceType { + // No restore associated. + TYPE_UNSPECIFIED = 0; + + // A backup was used as the source of the restore. + BACKUP = 1; +} + +// A Cloud Spanner database role. +message DatabaseRole { + option (google.api.resource) = { + type: "spanner.googleapis.com/DatabaseRole" + pattern: "projects/{project}/instances/{instance}/databases/{database}/databaseRoles/{role}" + }; + + // Required. The name of the database role. Values are of the form + // `projects//instances//databases//databaseRoles/` + // where `` is as specified in the `CREATE ROLE` DDL statement. + string name = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// The request for +// [ListDatabaseRoles][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabaseRoles]. +message ListDatabaseRolesRequest { + // Required. The database whose roles should be listed. + // Values are of the form + // `projects//instances//databases/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "spanner.googleapis.com/Database" + } + ]; + + // Number of database roles to be returned in the response. If 0 or less, + // defaults to the server's maximum allowed page size. + int32 page_size = 2; + + // If non-empty, `page_token` should contain a + // [next_page_token][google.spanner.admin.database.v1.ListDatabaseRolesResponse.next_page_token] + // from a previous + // [ListDatabaseRolesResponse][google.spanner.admin.database.v1.ListDatabaseRolesResponse]. + string page_token = 3; +} + +// The response for +// [ListDatabaseRoles][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabaseRoles]. +message ListDatabaseRolesResponse { + // Database roles that matched the request. + repeated DatabaseRole database_roles = 1; + + // `next_page_token` can be sent in a subsequent + // [ListDatabaseRoles][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabaseRoles] + // call to fetch more of the matching roles. + string next_page_token = 2; +} + +// The request for +// [AddSplitPoints][google.spanner.admin.database.v1.DatabaseAdmin.AddSplitPoints]. +message AddSplitPointsRequest { + // Required. The database on whose tables/indexes split points are to be + // added. Values are of the form + // `projects//instances//databases/`. + string database = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "spanner.googleapis.com/Database" + } + ]; + + // Required. The split points to add. + repeated SplitPoints split_points = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. A user-supplied tag associated with the split points. + // For example, "intital_data_load", "special_event_1". + // Defaults to "CloudAddSplitPointsAPI" if not specified. + // The length of the tag must not exceed 50 characters,else will be trimmed. + // Only valid UTF8 characters are allowed. + string initiator = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// The response for +// [AddSplitPoints][google.spanner.admin.database.v1.DatabaseAdmin.AddSplitPoints]. +message AddSplitPointsResponse {} + +// The split points of a table/index. +message SplitPoints { + // A split key. + message Key { + // Required. The column values making up the split key. + google.protobuf.ListValue key_parts = 1 + [(google.api.field_behavior) = REQUIRED]; + } + + // The table to split. + string table = 1; + + // The index to split. + // If specified, the `table` field must refer to the index's base table. + string index = 2; + + // Required. The list of split keys, i.e., the split boundaries. + repeated Key keys = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The expiration timestamp of the split points. + // A timestamp in the past means immediate expiration. + // The maximum value can be 30 days in the future. + // Defaults to 10 days in the future if not specified. + google.protobuf.Timestamp expire_time = 5 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Internal request proto, do not use directly. +message InternalUpdateGraphOperationRequest { + // Internal field, do not use directly. + string database = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "spanner.googleapis.com/Database" + } + ]; + // Internal field, do not use directly. + string operation_id = 2 [(google.api.field_behavior) = REQUIRED]; + // Internal field, do not use directly. + string vm_identity_token = 5 [(google.api.field_behavior) = REQUIRED]; + // Internal field, do not use directly. + double progress = 3 [(google.api.field_behavior) = OPTIONAL]; + // Internal field, do not use directly. + google.rpc.Status status = 6 [(google.api.field_behavior) = OPTIONAL]; +} + +// Internal response proto, do not use directly. +message InternalUpdateGraphOperationResponse {} diff --git a/owl-bot-staging/admin/database/v1/protos/protos.d.ts b/owl-bot-staging/admin/database/v1/protos/protos.d.ts new file mode 100644 index 000000000..a4d7b0513 --- /dev/null +++ b/owl-bot-staging/admin/database/v1/protos/protos.d.ts @@ -0,0 +1,16947 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import type {protobuf as $protobuf} from "google-gax"; +import Long = require("long"); +/** Namespace google. */ +export namespace google { + + /** Namespace spanner. */ + namespace spanner { + + /** Namespace admin. */ + namespace admin { + + /** Namespace database. */ + namespace database { + + /** Namespace v1. */ + namespace v1 { + + /** Properties of a Backup. */ + interface IBackup { + + /** Backup database */ + database?: (string|null); + + /** Backup versionTime */ + versionTime?: (google.protobuf.ITimestamp|null); + + /** Backup expireTime */ + expireTime?: (google.protobuf.ITimestamp|null); + + /** Backup name */ + name?: (string|null); + + /** Backup createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Backup sizeBytes */ + sizeBytes?: (number|Long|string|null); + + /** Backup freeableSizeBytes */ + freeableSizeBytes?: (number|Long|string|null); + + /** Backup exclusiveSizeBytes */ + exclusiveSizeBytes?: (number|Long|string|null); + + /** Backup state */ + state?: (google.spanner.admin.database.v1.Backup.State|keyof typeof google.spanner.admin.database.v1.Backup.State|null); + + /** Backup referencingDatabases */ + referencingDatabases?: (string[]|null); + + /** Backup encryptionInfo */ + encryptionInfo?: (google.spanner.admin.database.v1.IEncryptionInfo|null); + + /** Backup encryptionInformation */ + encryptionInformation?: (google.spanner.admin.database.v1.IEncryptionInfo[]|null); + + /** Backup databaseDialect */ + databaseDialect?: (google.spanner.admin.database.v1.DatabaseDialect|keyof typeof google.spanner.admin.database.v1.DatabaseDialect|null); + + /** Backup referencingBackups */ + referencingBackups?: (string[]|null); + + /** Backup maxExpireTime */ + maxExpireTime?: (google.protobuf.ITimestamp|null); + + /** Backup backupSchedules */ + backupSchedules?: (string[]|null); + + /** Backup incrementalBackupChainId */ + incrementalBackupChainId?: (string|null); + + /** Backup oldestVersionTime */ + oldestVersionTime?: (google.protobuf.ITimestamp|null); + + /** Backup instancePartitions */ + instancePartitions?: (google.spanner.admin.database.v1.IBackupInstancePartition[]|null); + } + + /** Represents a Backup. */ + class Backup implements IBackup { + + /** + * Constructs a new Backup. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IBackup); + + /** Backup database. */ + public database: string; + + /** Backup versionTime. */ + public versionTime?: (google.protobuf.ITimestamp|null); + + /** Backup expireTime. */ + public expireTime?: (google.protobuf.ITimestamp|null); + + /** Backup name. */ + public name: string; + + /** Backup createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Backup sizeBytes. */ + public sizeBytes: (number|Long|string); + + /** Backup freeableSizeBytes. */ + public freeableSizeBytes: (number|Long|string); + + /** Backup exclusiveSizeBytes. */ + public exclusiveSizeBytes: (number|Long|string); + + /** Backup state. */ + public state: (google.spanner.admin.database.v1.Backup.State|keyof typeof google.spanner.admin.database.v1.Backup.State); + + /** Backup referencingDatabases. */ + public referencingDatabases: string[]; + + /** Backup encryptionInfo. */ + public encryptionInfo?: (google.spanner.admin.database.v1.IEncryptionInfo|null); + + /** Backup encryptionInformation. */ + public encryptionInformation: google.spanner.admin.database.v1.IEncryptionInfo[]; + + /** Backup databaseDialect. */ + public databaseDialect: (google.spanner.admin.database.v1.DatabaseDialect|keyof typeof google.spanner.admin.database.v1.DatabaseDialect); + + /** Backup referencingBackups. */ + public referencingBackups: string[]; + + /** Backup maxExpireTime. */ + public maxExpireTime?: (google.protobuf.ITimestamp|null); + + /** Backup backupSchedules. */ + public backupSchedules: string[]; + + /** Backup incrementalBackupChainId. */ + public incrementalBackupChainId: string; + + /** Backup oldestVersionTime. */ + public oldestVersionTime?: (google.protobuf.ITimestamp|null); + + /** Backup instancePartitions. */ + public instancePartitions: google.spanner.admin.database.v1.IBackupInstancePartition[]; + + /** + * Creates a new Backup instance using the specified properties. + * @param [properties] Properties to set + * @returns Backup instance + */ + public static create(properties?: google.spanner.admin.database.v1.IBackup): google.spanner.admin.database.v1.Backup; + + /** + * Encodes the specified Backup message. Does not implicitly {@link google.spanner.admin.database.v1.Backup.verify|verify} messages. + * @param message Backup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IBackup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Backup message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.Backup.verify|verify} messages. + * @param message Backup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IBackup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Backup message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Backup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.Backup; + + /** + * Decodes a Backup message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Backup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.Backup; + + /** + * Verifies a Backup message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Backup message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Backup + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.Backup; + + /** + * Creates a plain object from a Backup message. Also converts values to other types if specified. + * @param message Backup + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.Backup, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Backup to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Backup + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Backup { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + CREATING = 1, + READY = 2 + } + } + + /** Properties of a CreateBackupRequest. */ + interface ICreateBackupRequest { + + /** CreateBackupRequest parent */ + parent?: (string|null); + + /** CreateBackupRequest backupId */ + backupId?: (string|null); + + /** CreateBackupRequest backup */ + backup?: (google.spanner.admin.database.v1.IBackup|null); + + /** CreateBackupRequest encryptionConfig */ + encryptionConfig?: (google.spanner.admin.database.v1.ICreateBackupEncryptionConfig|null); + } + + /** Represents a CreateBackupRequest. */ + class CreateBackupRequest implements ICreateBackupRequest { + + /** + * Constructs a new CreateBackupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.ICreateBackupRequest); + + /** CreateBackupRequest parent. */ + public parent: string; + + /** CreateBackupRequest backupId. */ + public backupId: string; + + /** CreateBackupRequest backup. */ + public backup?: (google.spanner.admin.database.v1.IBackup|null); + + /** CreateBackupRequest encryptionConfig. */ + public encryptionConfig?: (google.spanner.admin.database.v1.ICreateBackupEncryptionConfig|null); + + /** + * Creates a new CreateBackupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateBackupRequest instance + */ + public static create(properties?: google.spanner.admin.database.v1.ICreateBackupRequest): google.spanner.admin.database.v1.CreateBackupRequest; + + /** + * Encodes the specified CreateBackupRequest message. Does not implicitly {@link google.spanner.admin.database.v1.CreateBackupRequest.verify|verify} messages. + * @param message CreateBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.ICreateBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateBackupRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.CreateBackupRequest.verify|verify} messages. + * @param message CreateBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.ICreateBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateBackupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.CreateBackupRequest; + + /** + * Decodes a CreateBackupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.CreateBackupRequest; + + /** + * Verifies a CreateBackupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateBackupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateBackupRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.CreateBackupRequest; + + /** + * Creates a plain object from a CreateBackupRequest message. Also converts values to other types if specified. + * @param message CreateBackupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.CreateBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateBackupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateBackupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateBackupMetadata. */ + interface ICreateBackupMetadata { + + /** CreateBackupMetadata name */ + name?: (string|null); + + /** CreateBackupMetadata database */ + database?: (string|null); + + /** CreateBackupMetadata progress */ + progress?: (google.spanner.admin.database.v1.IOperationProgress|null); + + /** CreateBackupMetadata cancelTime */ + cancelTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a CreateBackupMetadata. */ + class CreateBackupMetadata implements ICreateBackupMetadata { + + /** + * Constructs a new CreateBackupMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.ICreateBackupMetadata); + + /** CreateBackupMetadata name. */ + public name: string; + + /** CreateBackupMetadata database. */ + public database: string; + + /** CreateBackupMetadata progress. */ + public progress?: (google.spanner.admin.database.v1.IOperationProgress|null); + + /** CreateBackupMetadata cancelTime. */ + public cancelTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new CreateBackupMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateBackupMetadata instance + */ + public static create(properties?: google.spanner.admin.database.v1.ICreateBackupMetadata): google.spanner.admin.database.v1.CreateBackupMetadata; + + /** + * Encodes the specified CreateBackupMetadata message. Does not implicitly {@link google.spanner.admin.database.v1.CreateBackupMetadata.verify|verify} messages. + * @param message CreateBackupMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.ICreateBackupMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateBackupMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.CreateBackupMetadata.verify|verify} messages. + * @param message CreateBackupMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.ICreateBackupMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateBackupMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateBackupMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.CreateBackupMetadata; + + /** + * Decodes a CreateBackupMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateBackupMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.CreateBackupMetadata; + + /** + * Verifies a CreateBackupMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateBackupMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateBackupMetadata + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.CreateBackupMetadata; + + /** + * Creates a plain object from a CreateBackupMetadata message. Also converts values to other types if specified. + * @param message CreateBackupMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.CreateBackupMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateBackupMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateBackupMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CopyBackupRequest. */ + interface ICopyBackupRequest { + + /** CopyBackupRequest parent */ + parent?: (string|null); + + /** CopyBackupRequest backupId */ + backupId?: (string|null); + + /** CopyBackupRequest sourceBackup */ + sourceBackup?: (string|null); + + /** CopyBackupRequest expireTime */ + expireTime?: (google.protobuf.ITimestamp|null); + + /** CopyBackupRequest encryptionConfig */ + encryptionConfig?: (google.spanner.admin.database.v1.ICopyBackupEncryptionConfig|null); + } + + /** Represents a CopyBackupRequest. */ + class CopyBackupRequest implements ICopyBackupRequest { + + /** + * Constructs a new CopyBackupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.ICopyBackupRequest); + + /** CopyBackupRequest parent. */ + public parent: string; + + /** CopyBackupRequest backupId. */ + public backupId: string; + + /** CopyBackupRequest sourceBackup. */ + public sourceBackup: string; + + /** CopyBackupRequest expireTime. */ + public expireTime?: (google.protobuf.ITimestamp|null); + + /** CopyBackupRequest encryptionConfig. */ + public encryptionConfig?: (google.spanner.admin.database.v1.ICopyBackupEncryptionConfig|null); + + /** + * Creates a new CopyBackupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CopyBackupRequest instance + */ + public static create(properties?: google.spanner.admin.database.v1.ICopyBackupRequest): google.spanner.admin.database.v1.CopyBackupRequest; + + /** + * Encodes the specified CopyBackupRequest message. Does not implicitly {@link google.spanner.admin.database.v1.CopyBackupRequest.verify|verify} messages. + * @param message CopyBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.ICopyBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CopyBackupRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.CopyBackupRequest.verify|verify} messages. + * @param message CopyBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.ICopyBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CopyBackupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CopyBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.CopyBackupRequest; + + /** + * Decodes a CopyBackupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CopyBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.CopyBackupRequest; + + /** + * Verifies a CopyBackupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CopyBackupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CopyBackupRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.CopyBackupRequest; + + /** + * Creates a plain object from a CopyBackupRequest message. Also converts values to other types if specified. + * @param message CopyBackupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.CopyBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CopyBackupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CopyBackupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CopyBackupMetadata. */ + interface ICopyBackupMetadata { + + /** CopyBackupMetadata name */ + name?: (string|null); + + /** CopyBackupMetadata sourceBackup */ + sourceBackup?: (string|null); + + /** CopyBackupMetadata progress */ + progress?: (google.spanner.admin.database.v1.IOperationProgress|null); + + /** CopyBackupMetadata cancelTime */ + cancelTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a CopyBackupMetadata. */ + class CopyBackupMetadata implements ICopyBackupMetadata { + + /** + * Constructs a new CopyBackupMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.ICopyBackupMetadata); + + /** CopyBackupMetadata name. */ + public name: string; + + /** CopyBackupMetadata sourceBackup. */ + public sourceBackup: string; + + /** CopyBackupMetadata progress. */ + public progress?: (google.spanner.admin.database.v1.IOperationProgress|null); + + /** CopyBackupMetadata cancelTime. */ + public cancelTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new CopyBackupMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns CopyBackupMetadata instance + */ + public static create(properties?: google.spanner.admin.database.v1.ICopyBackupMetadata): google.spanner.admin.database.v1.CopyBackupMetadata; + + /** + * Encodes the specified CopyBackupMetadata message. Does not implicitly {@link google.spanner.admin.database.v1.CopyBackupMetadata.verify|verify} messages. + * @param message CopyBackupMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.ICopyBackupMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CopyBackupMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.CopyBackupMetadata.verify|verify} messages. + * @param message CopyBackupMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.ICopyBackupMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CopyBackupMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CopyBackupMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.CopyBackupMetadata; + + /** + * Decodes a CopyBackupMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CopyBackupMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.CopyBackupMetadata; + + /** + * Verifies a CopyBackupMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CopyBackupMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CopyBackupMetadata + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.CopyBackupMetadata; + + /** + * Creates a plain object from a CopyBackupMetadata message. Also converts values to other types if specified. + * @param message CopyBackupMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.CopyBackupMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CopyBackupMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CopyBackupMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateBackupRequest. */ + interface IUpdateBackupRequest { + + /** UpdateBackupRequest backup */ + backup?: (google.spanner.admin.database.v1.IBackup|null); + + /** UpdateBackupRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateBackupRequest. */ + class UpdateBackupRequest implements IUpdateBackupRequest { + + /** + * Constructs a new UpdateBackupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IUpdateBackupRequest); + + /** UpdateBackupRequest backup. */ + public backup?: (google.spanner.admin.database.v1.IBackup|null); + + /** UpdateBackupRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateBackupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateBackupRequest instance + */ + public static create(properties?: google.spanner.admin.database.v1.IUpdateBackupRequest): google.spanner.admin.database.v1.UpdateBackupRequest; + + /** + * Encodes the specified UpdateBackupRequest message. Does not implicitly {@link google.spanner.admin.database.v1.UpdateBackupRequest.verify|verify} messages. + * @param message UpdateBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IUpdateBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateBackupRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.UpdateBackupRequest.verify|verify} messages. + * @param message UpdateBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IUpdateBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateBackupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.UpdateBackupRequest; + + /** + * Decodes an UpdateBackupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.UpdateBackupRequest; + + /** + * Verifies an UpdateBackupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateBackupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateBackupRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.UpdateBackupRequest; + + /** + * Creates a plain object from an UpdateBackupRequest message. Also converts values to other types if specified. + * @param message UpdateBackupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.UpdateBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateBackupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateBackupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetBackupRequest. */ + interface IGetBackupRequest { + + /** GetBackupRequest name */ + name?: (string|null); + } + + /** Represents a GetBackupRequest. */ + class GetBackupRequest implements IGetBackupRequest { + + /** + * Constructs a new GetBackupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IGetBackupRequest); + + /** GetBackupRequest name. */ + public name: string; + + /** + * Creates a new GetBackupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetBackupRequest instance + */ + public static create(properties?: google.spanner.admin.database.v1.IGetBackupRequest): google.spanner.admin.database.v1.GetBackupRequest; + + /** + * Encodes the specified GetBackupRequest message. Does not implicitly {@link google.spanner.admin.database.v1.GetBackupRequest.verify|verify} messages. + * @param message GetBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IGetBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetBackupRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.GetBackupRequest.verify|verify} messages. + * @param message GetBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IGetBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetBackupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.GetBackupRequest; + + /** + * Decodes a GetBackupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.GetBackupRequest; + + /** + * Verifies a GetBackupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetBackupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetBackupRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.GetBackupRequest; + + /** + * Creates a plain object from a GetBackupRequest message. Also converts values to other types if specified. + * @param message GetBackupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.GetBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetBackupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetBackupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteBackupRequest. */ + interface IDeleteBackupRequest { + + /** DeleteBackupRequest name */ + name?: (string|null); + } + + /** Represents a DeleteBackupRequest. */ + class DeleteBackupRequest implements IDeleteBackupRequest { + + /** + * Constructs a new DeleteBackupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IDeleteBackupRequest); + + /** DeleteBackupRequest name. */ + public name: string; + + /** + * Creates a new DeleteBackupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteBackupRequest instance + */ + public static create(properties?: google.spanner.admin.database.v1.IDeleteBackupRequest): google.spanner.admin.database.v1.DeleteBackupRequest; + + /** + * Encodes the specified DeleteBackupRequest message. Does not implicitly {@link google.spanner.admin.database.v1.DeleteBackupRequest.verify|verify} messages. + * @param message DeleteBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IDeleteBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteBackupRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.DeleteBackupRequest.verify|verify} messages. + * @param message DeleteBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IDeleteBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteBackupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.DeleteBackupRequest; + + /** + * Decodes a DeleteBackupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.DeleteBackupRequest; + + /** + * Verifies a DeleteBackupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteBackupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteBackupRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.DeleteBackupRequest; + + /** + * Creates a plain object from a DeleteBackupRequest message. Also converts values to other types if specified. + * @param message DeleteBackupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.DeleteBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteBackupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteBackupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListBackupsRequest. */ + interface IListBackupsRequest { + + /** ListBackupsRequest parent */ + parent?: (string|null); + + /** ListBackupsRequest filter */ + filter?: (string|null); + + /** ListBackupsRequest pageSize */ + pageSize?: (number|null); + + /** ListBackupsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListBackupsRequest. */ + class ListBackupsRequest implements IListBackupsRequest { + + /** + * Constructs a new ListBackupsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IListBackupsRequest); + + /** ListBackupsRequest parent. */ + public parent: string; + + /** ListBackupsRequest filter. */ + public filter: string; + + /** ListBackupsRequest pageSize. */ + public pageSize: number; + + /** ListBackupsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListBackupsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListBackupsRequest instance + */ + public static create(properties?: google.spanner.admin.database.v1.IListBackupsRequest): google.spanner.admin.database.v1.ListBackupsRequest; + + /** + * Encodes the specified ListBackupsRequest message. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupsRequest.verify|verify} messages. + * @param message ListBackupsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IListBackupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListBackupsRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupsRequest.verify|verify} messages. + * @param message ListBackupsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IListBackupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListBackupsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListBackupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.ListBackupsRequest; + + /** + * Decodes a ListBackupsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListBackupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.ListBackupsRequest; + + /** + * Verifies a ListBackupsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListBackupsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListBackupsRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.ListBackupsRequest; + + /** + * Creates a plain object from a ListBackupsRequest message. Also converts values to other types if specified. + * @param message ListBackupsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.ListBackupsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListBackupsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListBackupsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListBackupsResponse. */ + interface IListBackupsResponse { + + /** ListBackupsResponse backups */ + backups?: (google.spanner.admin.database.v1.IBackup[]|null); + + /** ListBackupsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListBackupsResponse. */ + class ListBackupsResponse implements IListBackupsResponse { + + /** + * Constructs a new ListBackupsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IListBackupsResponse); + + /** ListBackupsResponse backups. */ + public backups: google.spanner.admin.database.v1.IBackup[]; + + /** ListBackupsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListBackupsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListBackupsResponse instance + */ + public static create(properties?: google.spanner.admin.database.v1.IListBackupsResponse): google.spanner.admin.database.v1.ListBackupsResponse; + + /** + * Encodes the specified ListBackupsResponse message. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupsResponse.verify|verify} messages. + * @param message ListBackupsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IListBackupsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListBackupsResponse message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupsResponse.verify|verify} messages. + * @param message ListBackupsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IListBackupsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListBackupsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListBackupsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.ListBackupsResponse; + + /** + * Decodes a ListBackupsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListBackupsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.ListBackupsResponse; + + /** + * Verifies a ListBackupsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListBackupsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListBackupsResponse + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.ListBackupsResponse; + + /** + * Creates a plain object from a ListBackupsResponse message. Also converts values to other types if specified. + * @param message ListBackupsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.ListBackupsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListBackupsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListBackupsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListBackupOperationsRequest. */ + interface IListBackupOperationsRequest { + + /** ListBackupOperationsRequest parent */ + parent?: (string|null); + + /** ListBackupOperationsRequest filter */ + filter?: (string|null); + + /** ListBackupOperationsRequest pageSize */ + pageSize?: (number|null); + + /** ListBackupOperationsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListBackupOperationsRequest. */ + class ListBackupOperationsRequest implements IListBackupOperationsRequest { + + /** + * Constructs a new ListBackupOperationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IListBackupOperationsRequest); + + /** ListBackupOperationsRequest parent. */ + public parent: string; + + /** ListBackupOperationsRequest filter. */ + public filter: string; + + /** ListBackupOperationsRequest pageSize. */ + public pageSize: number; + + /** ListBackupOperationsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListBackupOperationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListBackupOperationsRequest instance + */ + public static create(properties?: google.spanner.admin.database.v1.IListBackupOperationsRequest): google.spanner.admin.database.v1.ListBackupOperationsRequest; + + /** + * Encodes the specified ListBackupOperationsRequest message. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupOperationsRequest.verify|verify} messages. + * @param message ListBackupOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IListBackupOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListBackupOperationsRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupOperationsRequest.verify|verify} messages. + * @param message ListBackupOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IListBackupOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListBackupOperationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListBackupOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.ListBackupOperationsRequest; + + /** + * Decodes a ListBackupOperationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListBackupOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.ListBackupOperationsRequest; + + /** + * Verifies a ListBackupOperationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListBackupOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListBackupOperationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.ListBackupOperationsRequest; + + /** + * Creates a plain object from a ListBackupOperationsRequest message. Also converts values to other types if specified. + * @param message ListBackupOperationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.ListBackupOperationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListBackupOperationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListBackupOperationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListBackupOperationsResponse. */ + interface IListBackupOperationsResponse { + + /** ListBackupOperationsResponse operations */ + operations?: (google.longrunning.IOperation[]|null); + + /** ListBackupOperationsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListBackupOperationsResponse. */ + class ListBackupOperationsResponse implements IListBackupOperationsResponse { + + /** + * Constructs a new ListBackupOperationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IListBackupOperationsResponse); + + /** ListBackupOperationsResponse operations. */ + public operations: google.longrunning.IOperation[]; + + /** ListBackupOperationsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListBackupOperationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListBackupOperationsResponse instance + */ + public static create(properties?: google.spanner.admin.database.v1.IListBackupOperationsResponse): google.spanner.admin.database.v1.ListBackupOperationsResponse; + + /** + * Encodes the specified ListBackupOperationsResponse message. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupOperationsResponse.verify|verify} messages. + * @param message ListBackupOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IListBackupOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListBackupOperationsResponse message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupOperationsResponse.verify|verify} messages. + * @param message ListBackupOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IListBackupOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListBackupOperationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListBackupOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.ListBackupOperationsResponse; + + /** + * Decodes a ListBackupOperationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListBackupOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.ListBackupOperationsResponse; + + /** + * Verifies a ListBackupOperationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListBackupOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListBackupOperationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.ListBackupOperationsResponse; + + /** + * Creates a plain object from a ListBackupOperationsResponse message. Also converts values to other types if specified. + * @param message ListBackupOperationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.ListBackupOperationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListBackupOperationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListBackupOperationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BackupInfo. */ + interface IBackupInfo { + + /** BackupInfo backup */ + backup?: (string|null); + + /** BackupInfo versionTime */ + versionTime?: (google.protobuf.ITimestamp|null); + + /** BackupInfo createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** BackupInfo sourceDatabase */ + sourceDatabase?: (string|null); + } + + /** Represents a BackupInfo. */ + class BackupInfo implements IBackupInfo { + + /** + * Constructs a new BackupInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IBackupInfo); + + /** BackupInfo backup. */ + public backup: string; + + /** BackupInfo versionTime. */ + public versionTime?: (google.protobuf.ITimestamp|null); + + /** BackupInfo createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** BackupInfo sourceDatabase. */ + public sourceDatabase: string; + + /** + * Creates a new BackupInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns BackupInfo instance + */ + public static create(properties?: google.spanner.admin.database.v1.IBackupInfo): google.spanner.admin.database.v1.BackupInfo; + + /** + * Encodes the specified BackupInfo message. Does not implicitly {@link google.spanner.admin.database.v1.BackupInfo.verify|verify} messages. + * @param message BackupInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IBackupInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BackupInfo message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.BackupInfo.verify|verify} messages. + * @param message BackupInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IBackupInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BackupInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BackupInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.BackupInfo; + + /** + * Decodes a BackupInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BackupInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.BackupInfo; + + /** + * Verifies a BackupInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BackupInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BackupInfo + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.BackupInfo; + + /** + * Creates a plain object from a BackupInfo message. Also converts values to other types if specified. + * @param message BackupInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.BackupInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BackupInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BackupInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateBackupEncryptionConfig. */ + interface ICreateBackupEncryptionConfig { + + /** CreateBackupEncryptionConfig encryptionType */ + encryptionType?: (google.spanner.admin.database.v1.CreateBackupEncryptionConfig.EncryptionType|keyof typeof google.spanner.admin.database.v1.CreateBackupEncryptionConfig.EncryptionType|null); + + /** CreateBackupEncryptionConfig kmsKeyName */ + kmsKeyName?: (string|null); + + /** CreateBackupEncryptionConfig kmsKeyNames */ + kmsKeyNames?: (string[]|null); + } + + /** Represents a CreateBackupEncryptionConfig. */ + class CreateBackupEncryptionConfig implements ICreateBackupEncryptionConfig { + + /** + * Constructs a new CreateBackupEncryptionConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.ICreateBackupEncryptionConfig); + + /** CreateBackupEncryptionConfig encryptionType. */ + public encryptionType: (google.spanner.admin.database.v1.CreateBackupEncryptionConfig.EncryptionType|keyof typeof google.spanner.admin.database.v1.CreateBackupEncryptionConfig.EncryptionType); + + /** CreateBackupEncryptionConfig kmsKeyName. */ + public kmsKeyName: string; + + /** CreateBackupEncryptionConfig kmsKeyNames. */ + public kmsKeyNames: string[]; + + /** + * Creates a new CreateBackupEncryptionConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateBackupEncryptionConfig instance + */ + public static create(properties?: google.spanner.admin.database.v1.ICreateBackupEncryptionConfig): google.spanner.admin.database.v1.CreateBackupEncryptionConfig; + + /** + * Encodes the specified CreateBackupEncryptionConfig message. Does not implicitly {@link google.spanner.admin.database.v1.CreateBackupEncryptionConfig.verify|verify} messages. + * @param message CreateBackupEncryptionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.ICreateBackupEncryptionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateBackupEncryptionConfig message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.CreateBackupEncryptionConfig.verify|verify} messages. + * @param message CreateBackupEncryptionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.ICreateBackupEncryptionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateBackupEncryptionConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateBackupEncryptionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.CreateBackupEncryptionConfig; + + /** + * Decodes a CreateBackupEncryptionConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateBackupEncryptionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.CreateBackupEncryptionConfig; + + /** + * Verifies a CreateBackupEncryptionConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateBackupEncryptionConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateBackupEncryptionConfig + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.CreateBackupEncryptionConfig; + + /** + * Creates a plain object from a CreateBackupEncryptionConfig message. Also converts values to other types if specified. + * @param message CreateBackupEncryptionConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.CreateBackupEncryptionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateBackupEncryptionConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateBackupEncryptionConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace CreateBackupEncryptionConfig { + + /** EncryptionType enum. */ + enum EncryptionType { + ENCRYPTION_TYPE_UNSPECIFIED = 0, + USE_DATABASE_ENCRYPTION = 1, + GOOGLE_DEFAULT_ENCRYPTION = 2, + CUSTOMER_MANAGED_ENCRYPTION = 3 + } + } + + /** Properties of a CopyBackupEncryptionConfig. */ + interface ICopyBackupEncryptionConfig { + + /** CopyBackupEncryptionConfig encryptionType */ + encryptionType?: (google.spanner.admin.database.v1.CopyBackupEncryptionConfig.EncryptionType|keyof typeof google.spanner.admin.database.v1.CopyBackupEncryptionConfig.EncryptionType|null); + + /** CopyBackupEncryptionConfig kmsKeyName */ + kmsKeyName?: (string|null); + + /** CopyBackupEncryptionConfig kmsKeyNames */ + kmsKeyNames?: (string[]|null); + } + + /** Represents a CopyBackupEncryptionConfig. */ + class CopyBackupEncryptionConfig implements ICopyBackupEncryptionConfig { + + /** + * Constructs a new CopyBackupEncryptionConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.ICopyBackupEncryptionConfig); + + /** CopyBackupEncryptionConfig encryptionType. */ + public encryptionType: (google.spanner.admin.database.v1.CopyBackupEncryptionConfig.EncryptionType|keyof typeof google.spanner.admin.database.v1.CopyBackupEncryptionConfig.EncryptionType); + + /** CopyBackupEncryptionConfig kmsKeyName. */ + public kmsKeyName: string; + + /** CopyBackupEncryptionConfig kmsKeyNames. */ + public kmsKeyNames: string[]; + + /** + * Creates a new CopyBackupEncryptionConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns CopyBackupEncryptionConfig instance + */ + public static create(properties?: google.spanner.admin.database.v1.ICopyBackupEncryptionConfig): google.spanner.admin.database.v1.CopyBackupEncryptionConfig; + + /** + * Encodes the specified CopyBackupEncryptionConfig message. Does not implicitly {@link google.spanner.admin.database.v1.CopyBackupEncryptionConfig.verify|verify} messages. + * @param message CopyBackupEncryptionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.ICopyBackupEncryptionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CopyBackupEncryptionConfig message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.CopyBackupEncryptionConfig.verify|verify} messages. + * @param message CopyBackupEncryptionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.ICopyBackupEncryptionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CopyBackupEncryptionConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CopyBackupEncryptionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.CopyBackupEncryptionConfig; + + /** + * Decodes a CopyBackupEncryptionConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CopyBackupEncryptionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.CopyBackupEncryptionConfig; + + /** + * Verifies a CopyBackupEncryptionConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CopyBackupEncryptionConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CopyBackupEncryptionConfig + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.CopyBackupEncryptionConfig; + + /** + * Creates a plain object from a CopyBackupEncryptionConfig message. Also converts values to other types if specified. + * @param message CopyBackupEncryptionConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.CopyBackupEncryptionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CopyBackupEncryptionConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CopyBackupEncryptionConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace CopyBackupEncryptionConfig { + + /** EncryptionType enum. */ + enum EncryptionType { + ENCRYPTION_TYPE_UNSPECIFIED = 0, + USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION = 1, + GOOGLE_DEFAULT_ENCRYPTION = 2, + CUSTOMER_MANAGED_ENCRYPTION = 3 + } + } + + /** Properties of a FullBackupSpec. */ + interface IFullBackupSpec { + } + + /** Represents a FullBackupSpec. */ + class FullBackupSpec implements IFullBackupSpec { + + /** + * Constructs a new FullBackupSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IFullBackupSpec); + + /** + * Creates a new FullBackupSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns FullBackupSpec instance + */ + public static create(properties?: google.spanner.admin.database.v1.IFullBackupSpec): google.spanner.admin.database.v1.FullBackupSpec; + + /** + * Encodes the specified FullBackupSpec message. Does not implicitly {@link google.spanner.admin.database.v1.FullBackupSpec.verify|verify} messages. + * @param message FullBackupSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IFullBackupSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FullBackupSpec message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.FullBackupSpec.verify|verify} messages. + * @param message FullBackupSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IFullBackupSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FullBackupSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FullBackupSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.FullBackupSpec; + + /** + * Decodes a FullBackupSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FullBackupSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.FullBackupSpec; + + /** + * Verifies a FullBackupSpec message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FullBackupSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FullBackupSpec + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.FullBackupSpec; + + /** + * Creates a plain object from a FullBackupSpec message. Also converts values to other types if specified. + * @param message FullBackupSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.FullBackupSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FullBackupSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FullBackupSpec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an IncrementalBackupSpec. */ + interface IIncrementalBackupSpec { + } + + /** Represents an IncrementalBackupSpec. */ + class IncrementalBackupSpec implements IIncrementalBackupSpec { + + /** + * Constructs a new IncrementalBackupSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IIncrementalBackupSpec); + + /** + * Creates a new IncrementalBackupSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns IncrementalBackupSpec instance + */ + public static create(properties?: google.spanner.admin.database.v1.IIncrementalBackupSpec): google.spanner.admin.database.v1.IncrementalBackupSpec; + + /** + * Encodes the specified IncrementalBackupSpec message. Does not implicitly {@link google.spanner.admin.database.v1.IncrementalBackupSpec.verify|verify} messages. + * @param message IncrementalBackupSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IIncrementalBackupSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IncrementalBackupSpec message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.IncrementalBackupSpec.verify|verify} messages. + * @param message IncrementalBackupSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IIncrementalBackupSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IncrementalBackupSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IncrementalBackupSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.IncrementalBackupSpec; + + /** + * Decodes an IncrementalBackupSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IncrementalBackupSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.IncrementalBackupSpec; + + /** + * Verifies an IncrementalBackupSpec message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an IncrementalBackupSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IncrementalBackupSpec + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.IncrementalBackupSpec; + + /** + * Creates a plain object from an IncrementalBackupSpec message. Also converts values to other types if specified. + * @param message IncrementalBackupSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.IncrementalBackupSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IncrementalBackupSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IncrementalBackupSpec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BackupInstancePartition. */ + interface IBackupInstancePartition { + + /** BackupInstancePartition instancePartition */ + instancePartition?: (string|null); + } + + /** Represents a BackupInstancePartition. */ + class BackupInstancePartition implements IBackupInstancePartition { + + /** + * Constructs a new BackupInstancePartition. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IBackupInstancePartition); + + /** BackupInstancePartition instancePartition. */ + public instancePartition: string; + + /** + * Creates a new BackupInstancePartition instance using the specified properties. + * @param [properties] Properties to set + * @returns BackupInstancePartition instance + */ + public static create(properties?: google.spanner.admin.database.v1.IBackupInstancePartition): google.spanner.admin.database.v1.BackupInstancePartition; + + /** + * Encodes the specified BackupInstancePartition message. Does not implicitly {@link google.spanner.admin.database.v1.BackupInstancePartition.verify|verify} messages. + * @param message BackupInstancePartition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IBackupInstancePartition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BackupInstancePartition message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.BackupInstancePartition.verify|verify} messages. + * @param message BackupInstancePartition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IBackupInstancePartition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BackupInstancePartition message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BackupInstancePartition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.BackupInstancePartition; + + /** + * Decodes a BackupInstancePartition message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BackupInstancePartition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.BackupInstancePartition; + + /** + * Verifies a BackupInstancePartition message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BackupInstancePartition message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BackupInstancePartition + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.BackupInstancePartition; + + /** + * Creates a plain object from a BackupInstancePartition message. Also converts values to other types if specified. + * @param message BackupInstancePartition + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.BackupInstancePartition, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BackupInstancePartition to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BackupInstancePartition + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OperationProgress. */ + interface IOperationProgress { + + /** OperationProgress progressPercent */ + progressPercent?: (number|null); + + /** OperationProgress startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** OperationProgress endTime */ + endTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents an OperationProgress. */ + class OperationProgress implements IOperationProgress { + + /** + * Constructs a new OperationProgress. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IOperationProgress); + + /** OperationProgress progressPercent. */ + public progressPercent: number; + + /** OperationProgress startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** OperationProgress endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new OperationProgress instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationProgress instance + */ + public static create(properties?: google.spanner.admin.database.v1.IOperationProgress): google.spanner.admin.database.v1.OperationProgress; + + /** + * Encodes the specified OperationProgress message. Does not implicitly {@link google.spanner.admin.database.v1.OperationProgress.verify|verify} messages. + * @param message OperationProgress message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IOperationProgress, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationProgress message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.OperationProgress.verify|verify} messages. + * @param message OperationProgress message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IOperationProgress, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationProgress message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationProgress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.OperationProgress; + + /** + * Decodes an OperationProgress message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationProgress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.OperationProgress; + + /** + * Verifies an OperationProgress message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OperationProgress message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationProgress + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.OperationProgress; + + /** + * Creates a plain object from an OperationProgress message. Also converts values to other types if specified. + * @param message OperationProgress + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.OperationProgress, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationProgress to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OperationProgress + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EncryptionConfig. */ + interface IEncryptionConfig { + + /** EncryptionConfig kmsKeyName */ + kmsKeyName?: (string|null); + + /** EncryptionConfig kmsKeyNames */ + kmsKeyNames?: (string[]|null); + } + + /** Represents an EncryptionConfig. */ + class EncryptionConfig implements IEncryptionConfig { + + /** + * Constructs a new EncryptionConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IEncryptionConfig); + + /** EncryptionConfig kmsKeyName. */ + public kmsKeyName: string; + + /** EncryptionConfig kmsKeyNames. */ + public kmsKeyNames: string[]; + + /** + * Creates a new EncryptionConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns EncryptionConfig instance + */ + public static create(properties?: google.spanner.admin.database.v1.IEncryptionConfig): google.spanner.admin.database.v1.EncryptionConfig; + + /** + * Encodes the specified EncryptionConfig message. Does not implicitly {@link google.spanner.admin.database.v1.EncryptionConfig.verify|verify} messages. + * @param message EncryptionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IEncryptionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EncryptionConfig message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.EncryptionConfig.verify|verify} messages. + * @param message EncryptionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IEncryptionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EncryptionConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EncryptionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.EncryptionConfig; + + /** + * Decodes an EncryptionConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EncryptionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.EncryptionConfig; + + /** + * Verifies an EncryptionConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EncryptionConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EncryptionConfig + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.EncryptionConfig; + + /** + * Creates a plain object from an EncryptionConfig message. Also converts values to other types if specified. + * @param message EncryptionConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.EncryptionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EncryptionConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EncryptionConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EncryptionInfo. */ + interface IEncryptionInfo { + + /** EncryptionInfo encryptionType */ + encryptionType?: (google.spanner.admin.database.v1.EncryptionInfo.Type|keyof typeof google.spanner.admin.database.v1.EncryptionInfo.Type|null); + + /** EncryptionInfo encryptionStatus */ + encryptionStatus?: (google.rpc.IStatus|null); + + /** EncryptionInfo kmsKeyVersion */ + kmsKeyVersion?: (string|null); + } + + /** Represents an EncryptionInfo. */ + class EncryptionInfo implements IEncryptionInfo { + + /** + * Constructs a new EncryptionInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IEncryptionInfo); + + /** EncryptionInfo encryptionType. */ + public encryptionType: (google.spanner.admin.database.v1.EncryptionInfo.Type|keyof typeof google.spanner.admin.database.v1.EncryptionInfo.Type); + + /** EncryptionInfo encryptionStatus. */ + public encryptionStatus?: (google.rpc.IStatus|null); + + /** EncryptionInfo kmsKeyVersion. */ + public kmsKeyVersion: string; + + /** + * Creates a new EncryptionInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns EncryptionInfo instance + */ + public static create(properties?: google.spanner.admin.database.v1.IEncryptionInfo): google.spanner.admin.database.v1.EncryptionInfo; + + /** + * Encodes the specified EncryptionInfo message. Does not implicitly {@link google.spanner.admin.database.v1.EncryptionInfo.verify|verify} messages. + * @param message EncryptionInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IEncryptionInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EncryptionInfo message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.EncryptionInfo.verify|verify} messages. + * @param message EncryptionInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IEncryptionInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EncryptionInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EncryptionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.EncryptionInfo; + + /** + * Decodes an EncryptionInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EncryptionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.EncryptionInfo; + + /** + * Verifies an EncryptionInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EncryptionInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EncryptionInfo + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.EncryptionInfo; + + /** + * Creates a plain object from an EncryptionInfo message. Also converts values to other types if specified. + * @param message EncryptionInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.EncryptionInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EncryptionInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EncryptionInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EncryptionInfo { + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + GOOGLE_DEFAULT_ENCRYPTION = 1, + CUSTOMER_MANAGED_ENCRYPTION = 2 + } + } + + /** DatabaseDialect enum. */ + enum DatabaseDialect { + DATABASE_DIALECT_UNSPECIFIED = 0, + GOOGLE_STANDARD_SQL = 1, + POSTGRESQL = 2 + } + + /** Properties of a BackupScheduleSpec. */ + interface IBackupScheduleSpec { + + /** BackupScheduleSpec cronSpec */ + cronSpec?: (google.spanner.admin.database.v1.ICrontabSpec|null); + } + + /** Represents a BackupScheduleSpec. */ + class BackupScheduleSpec implements IBackupScheduleSpec { + + /** + * Constructs a new BackupScheduleSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IBackupScheduleSpec); + + /** BackupScheduleSpec cronSpec. */ + public cronSpec?: (google.spanner.admin.database.v1.ICrontabSpec|null); + + /** BackupScheduleSpec scheduleSpec. */ + public scheduleSpec?: "cronSpec"; + + /** + * Creates a new BackupScheduleSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns BackupScheduleSpec instance + */ + public static create(properties?: google.spanner.admin.database.v1.IBackupScheduleSpec): google.spanner.admin.database.v1.BackupScheduleSpec; + + /** + * Encodes the specified BackupScheduleSpec message. Does not implicitly {@link google.spanner.admin.database.v1.BackupScheduleSpec.verify|verify} messages. + * @param message BackupScheduleSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IBackupScheduleSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BackupScheduleSpec message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.BackupScheduleSpec.verify|verify} messages. + * @param message BackupScheduleSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IBackupScheduleSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BackupScheduleSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BackupScheduleSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.BackupScheduleSpec; + + /** + * Decodes a BackupScheduleSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BackupScheduleSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.BackupScheduleSpec; + + /** + * Verifies a BackupScheduleSpec message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BackupScheduleSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BackupScheduleSpec + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.BackupScheduleSpec; + + /** + * Creates a plain object from a BackupScheduleSpec message. Also converts values to other types if specified. + * @param message BackupScheduleSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.BackupScheduleSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BackupScheduleSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BackupScheduleSpec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BackupSchedule. */ + interface IBackupSchedule { + + /** BackupSchedule name */ + name?: (string|null); + + /** BackupSchedule spec */ + spec?: (google.spanner.admin.database.v1.IBackupScheduleSpec|null); + + /** BackupSchedule retentionDuration */ + retentionDuration?: (google.protobuf.IDuration|null); + + /** BackupSchedule encryptionConfig */ + encryptionConfig?: (google.spanner.admin.database.v1.ICreateBackupEncryptionConfig|null); + + /** BackupSchedule fullBackupSpec */ + fullBackupSpec?: (google.spanner.admin.database.v1.IFullBackupSpec|null); + + /** BackupSchedule incrementalBackupSpec */ + incrementalBackupSpec?: (google.spanner.admin.database.v1.IIncrementalBackupSpec|null); + + /** BackupSchedule updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a BackupSchedule. */ + class BackupSchedule implements IBackupSchedule { + + /** + * Constructs a new BackupSchedule. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IBackupSchedule); + + /** BackupSchedule name. */ + public name: string; + + /** BackupSchedule spec. */ + public spec?: (google.spanner.admin.database.v1.IBackupScheduleSpec|null); + + /** BackupSchedule retentionDuration. */ + public retentionDuration?: (google.protobuf.IDuration|null); + + /** BackupSchedule encryptionConfig. */ + public encryptionConfig?: (google.spanner.admin.database.v1.ICreateBackupEncryptionConfig|null); + + /** BackupSchedule fullBackupSpec. */ + public fullBackupSpec?: (google.spanner.admin.database.v1.IFullBackupSpec|null); + + /** BackupSchedule incrementalBackupSpec. */ + public incrementalBackupSpec?: (google.spanner.admin.database.v1.IIncrementalBackupSpec|null); + + /** BackupSchedule updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** BackupSchedule backupTypeSpec. */ + public backupTypeSpec?: ("fullBackupSpec"|"incrementalBackupSpec"); + + /** + * Creates a new BackupSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns BackupSchedule instance + */ + public static create(properties?: google.spanner.admin.database.v1.IBackupSchedule): google.spanner.admin.database.v1.BackupSchedule; + + /** + * Encodes the specified BackupSchedule message. Does not implicitly {@link google.spanner.admin.database.v1.BackupSchedule.verify|verify} messages. + * @param message BackupSchedule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IBackupSchedule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BackupSchedule message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.BackupSchedule.verify|verify} messages. + * @param message BackupSchedule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IBackupSchedule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BackupSchedule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BackupSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.BackupSchedule; + + /** + * Decodes a BackupSchedule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BackupSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.BackupSchedule; + + /** + * Verifies a BackupSchedule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BackupSchedule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BackupSchedule + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.BackupSchedule; + + /** + * Creates a plain object from a BackupSchedule message. Also converts values to other types if specified. + * @param message BackupSchedule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.BackupSchedule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BackupSchedule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BackupSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CrontabSpec. */ + interface ICrontabSpec { + + /** CrontabSpec text */ + text?: (string|null); + + /** CrontabSpec timeZone */ + timeZone?: (string|null); + + /** CrontabSpec creationWindow */ + creationWindow?: (google.protobuf.IDuration|null); + } + + /** Represents a CrontabSpec. */ + class CrontabSpec implements ICrontabSpec { + + /** + * Constructs a new CrontabSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.ICrontabSpec); + + /** CrontabSpec text. */ + public text: string; + + /** CrontabSpec timeZone. */ + public timeZone: string; + + /** CrontabSpec creationWindow. */ + public creationWindow?: (google.protobuf.IDuration|null); + + /** + * Creates a new CrontabSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns CrontabSpec instance + */ + public static create(properties?: google.spanner.admin.database.v1.ICrontabSpec): google.spanner.admin.database.v1.CrontabSpec; + + /** + * Encodes the specified CrontabSpec message. Does not implicitly {@link google.spanner.admin.database.v1.CrontabSpec.verify|verify} messages. + * @param message CrontabSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.ICrontabSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CrontabSpec message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.CrontabSpec.verify|verify} messages. + * @param message CrontabSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.ICrontabSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CrontabSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CrontabSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.CrontabSpec; + + /** + * Decodes a CrontabSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CrontabSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.CrontabSpec; + + /** + * Verifies a CrontabSpec message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CrontabSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CrontabSpec + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.CrontabSpec; + + /** + * Creates a plain object from a CrontabSpec message. Also converts values to other types if specified. + * @param message CrontabSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.CrontabSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CrontabSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CrontabSpec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateBackupScheduleRequest. */ + interface ICreateBackupScheduleRequest { + + /** CreateBackupScheduleRequest parent */ + parent?: (string|null); + + /** CreateBackupScheduleRequest backupScheduleId */ + backupScheduleId?: (string|null); + + /** CreateBackupScheduleRequest backupSchedule */ + backupSchedule?: (google.spanner.admin.database.v1.IBackupSchedule|null); + } + + /** Represents a CreateBackupScheduleRequest. */ + class CreateBackupScheduleRequest implements ICreateBackupScheduleRequest { + + /** + * Constructs a new CreateBackupScheduleRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.ICreateBackupScheduleRequest); + + /** CreateBackupScheduleRequest parent. */ + public parent: string; + + /** CreateBackupScheduleRequest backupScheduleId. */ + public backupScheduleId: string; + + /** CreateBackupScheduleRequest backupSchedule. */ + public backupSchedule?: (google.spanner.admin.database.v1.IBackupSchedule|null); + + /** + * Creates a new CreateBackupScheduleRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateBackupScheduleRequest instance + */ + public static create(properties?: google.spanner.admin.database.v1.ICreateBackupScheduleRequest): google.spanner.admin.database.v1.CreateBackupScheduleRequest; + + /** + * Encodes the specified CreateBackupScheduleRequest message. Does not implicitly {@link google.spanner.admin.database.v1.CreateBackupScheduleRequest.verify|verify} messages. + * @param message CreateBackupScheduleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.ICreateBackupScheduleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateBackupScheduleRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.CreateBackupScheduleRequest.verify|verify} messages. + * @param message CreateBackupScheduleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.ICreateBackupScheduleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateBackupScheduleRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateBackupScheduleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.CreateBackupScheduleRequest; + + /** + * Decodes a CreateBackupScheduleRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateBackupScheduleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.CreateBackupScheduleRequest; + + /** + * Verifies a CreateBackupScheduleRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateBackupScheduleRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateBackupScheduleRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.CreateBackupScheduleRequest; + + /** + * Creates a plain object from a CreateBackupScheduleRequest message. Also converts values to other types if specified. + * @param message CreateBackupScheduleRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.CreateBackupScheduleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateBackupScheduleRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateBackupScheduleRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetBackupScheduleRequest. */ + interface IGetBackupScheduleRequest { + + /** GetBackupScheduleRequest name */ + name?: (string|null); + } + + /** Represents a GetBackupScheduleRequest. */ + class GetBackupScheduleRequest implements IGetBackupScheduleRequest { + + /** + * Constructs a new GetBackupScheduleRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IGetBackupScheduleRequest); + + /** GetBackupScheduleRequest name. */ + public name: string; + + /** + * Creates a new GetBackupScheduleRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetBackupScheduleRequest instance + */ + public static create(properties?: google.spanner.admin.database.v1.IGetBackupScheduleRequest): google.spanner.admin.database.v1.GetBackupScheduleRequest; + + /** + * Encodes the specified GetBackupScheduleRequest message. Does not implicitly {@link google.spanner.admin.database.v1.GetBackupScheduleRequest.verify|verify} messages. + * @param message GetBackupScheduleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IGetBackupScheduleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetBackupScheduleRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.GetBackupScheduleRequest.verify|verify} messages. + * @param message GetBackupScheduleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IGetBackupScheduleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetBackupScheduleRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetBackupScheduleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.GetBackupScheduleRequest; + + /** + * Decodes a GetBackupScheduleRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetBackupScheduleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.GetBackupScheduleRequest; + + /** + * Verifies a GetBackupScheduleRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetBackupScheduleRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetBackupScheduleRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.GetBackupScheduleRequest; + + /** + * Creates a plain object from a GetBackupScheduleRequest message. Also converts values to other types if specified. + * @param message GetBackupScheduleRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.GetBackupScheduleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetBackupScheduleRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetBackupScheduleRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteBackupScheduleRequest. */ + interface IDeleteBackupScheduleRequest { + + /** DeleteBackupScheduleRequest name */ + name?: (string|null); + } + + /** Represents a DeleteBackupScheduleRequest. */ + class DeleteBackupScheduleRequest implements IDeleteBackupScheduleRequest { + + /** + * Constructs a new DeleteBackupScheduleRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IDeleteBackupScheduleRequest); + + /** DeleteBackupScheduleRequest name. */ + public name: string; + + /** + * Creates a new DeleteBackupScheduleRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteBackupScheduleRequest instance + */ + public static create(properties?: google.spanner.admin.database.v1.IDeleteBackupScheduleRequest): google.spanner.admin.database.v1.DeleteBackupScheduleRequest; + + /** + * Encodes the specified DeleteBackupScheduleRequest message. Does not implicitly {@link google.spanner.admin.database.v1.DeleteBackupScheduleRequest.verify|verify} messages. + * @param message DeleteBackupScheduleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IDeleteBackupScheduleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteBackupScheduleRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.DeleteBackupScheduleRequest.verify|verify} messages. + * @param message DeleteBackupScheduleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IDeleteBackupScheduleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteBackupScheduleRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteBackupScheduleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.DeleteBackupScheduleRequest; + + /** + * Decodes a DeleteBackupScheduleRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteBackupScheduleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.DeleteBackupScheduleRequest; + + /** + * Verifies a DeleteBackupScheduleRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteBackupScheduleRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteBackupScheduleRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.DeleteBackupScheduleRequest; + + /** + * Creates a plain object from a DeleteBackupScheduleRequest message. Also converts values to other types if specified. + * @param message DeleteBackupScheduleRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.DeleteBackupScheduleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteBackupScheduleRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteBackupScheduleRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListBackupSchedulesRequest. */ + interface IListBackupSchedulesRequest { + + /** ListBackupSchedulesRequest parent */ + parent?: (string|null); + + /** ListBackupSchedulesRequest pageSize */ + pageSize?: (number|null); + + /** ListBackupSchedulesRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListBackupSchedulesRequest. */ + class ListBackupSchedulesRequest implements IListBackupSchedulesRequest { + + /** + * Constructs a new ListBackupSchedulesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IListBackupSchedulesRequest); + + /** ListBackupSchedulesRequest parent. */ + public parent: string; + + /** ListBackupSchedulesRequest pageSize. */ + public pageSize: number; + + /** ListBackupSchedulesRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListBackupSchedulesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListBackupSchedulesRequest instance + */ + public static create(properties?: google.spanner.admin.database.v1.IListBackupSchedulesRequest): google.spanner.admin.database.v1.ListBackupSchedulesRequest; + + /** + * Encodes the specified ListBackupSchedulesRequest message. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupSchedulesRequest.verify|verify} messages. + * @param message ListBackupSchedulesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IListBackupSchedulesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListBackupSchedulesRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupSchedulesRequest.verify|verify} messages. + * @param message ListBackupSchedulesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IListBackupSchedulesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListBackupSchedulesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListBackupSchedulesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.ListBackupSchedulesRequest; + + /** + * Decodes a ListBackupSchedulesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListBackupSchedulesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.ListBackupSchedulesRequest; + + /** + * Verifies a ListBackupSchedulesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListBackupSchedulesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListBackupSchedulesRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.ListBackupSchedulesRequest; + + /** + * Creates a plain object from a ListBackupSchedulesRequest message. Also converts values to other types if specified. + * @param message ListBackupSchedulesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.ListBackupSchedulesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListBackupSchedulesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListBackupSchedulesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListBackupSchedulesResponse. */ + interface IListBackupSchedulesResponse { + + /** ListBackupSchedulesResponse backupSchedules */ + backupSchedules?: (google.spanner.admin.database.v1.IBackupSchedule[]|null); + + /** ListBackupSchedulesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListBackupSchedulesResponse. */ + class ListBackupSchedulesResponse implements IListBackupSchedulesResponse { + + /** + * Constructs a new ListBackupSchedulesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IListBackupSchedulesResponse); + + /** ListBackupSchedulesResponse backupSchedules. */ + public backupSchedules: google.spanner.admin.database.v1.IBackupSchedule[]; + + /** ListBackupSchedulesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListBackupSchedulesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListBackupSchedulesResponse instance + */ + public static create(properties?: google.spanner.admin.database.v1.IListBackupSchedulesResponse): google.spanner.admin.database.v1.ListBackupSchedulesResponse; + + /** + * Encodes the specified ListBackupSchedulesResponse message. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupSchedulesResponse.verify|verify} messages. + * @param message ListBackupSchedulesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IListBackupSchedulesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListBackupSchedulesResponse message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupSchedulesResponse.verify|verify} messages. + * @param message ListBackupSchedulesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IListBackupSchedulesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListBackupSchedulesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListBackupSchedulesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.ListBackupSchedulesResponse; + + /** + * Decodes a ListBackupSchedulesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListBackupSchedulesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.ListBackupSchedulesResponse; + + /** + * Verifies a ListBackupSchedulesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListBackupSchedulesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListBackupSchedulesResponse + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.ListBackupSchedulesResponse; + + /** + * Creates a plain object from a ListBackupSchedulesResponse message. Also converts values to other types if specified. + * @param message ListBackupSchedulesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.ListBackupSchedulesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListBackupSchedulesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListBackupSchedulesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateBackupScheduleRequest. */ + interface IUpdateBackupScheduleRequest { + + /** UpdateBackupScheduleRequest backupSchedule */ + backupSchedule?: (google.spanner.admin.database.v1.IBackupSchedule|null); + + /** UpdateBackupScheduleRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateBackupScheduleRequest. */ + class UpdateBackupScheduleRequest implements IUpdateBackupScheduleRequest { + + /** + * Constructs a new UpdateBackupScheduleRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IUpdateBackupScheduleRequest); + + /** UpdateBackupScheduleRequest backupSchedule. */ + public backupSchedule?: (google.spanner.admin.database.v1.IBackupSchedule|null); + + /** UpdateBackupScheduleRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateBackupScheduleRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateBackupScheduleRequest instance + */ + public static create(properties?: google.spanner.admin.database.v1.IUpdateBackupScheduleRequest): google.spanner.admin.database.v1.UpdateBackupScheduleRequest; + + /** + * Encodes the specified UpdateBackupScheduleRequest message. Does not implicitly {@link google.spanner.admin.database.v1.UpdateBackupScheduleRequest.verify|verify} messages. + * @param message UpdateBackupScheduleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IUpdateBackupScheduleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateBackupScheduleRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.UpdateBackupScheduleRequest.verify|verify} messages. + * @param message UpdateBackupScheduleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IUpdateBackupScheduleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateBackupScheduleRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateBackupScheduleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.UpdateBackupScheduleRequest; + + /** + * Decodes an UpdateBackupScheduleRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateBackupScheduleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.UpdateBackupScheduleRequest; + + /** + * Verifies an UpdateBackupScheduleRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateBackupScheduleRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateBackupScheduleRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.UpdateBackupScheduleRequest; + + /** + * Creates a plain object from an UpdateBackupScheduleRequest message. Also converts values to other types if specified. + * @param message UpdateBackupScheduleRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.UpdateBackupScheduleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateBackupScheduleRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateBackupScheduleRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a DatabaseAdmin */ + class DatabaseAdmin extends $protobuf.rpc.Service { + + /** + * Constructs a new DatabaseAdmin service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new DatabaseAdmin 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): DatabaseAdmin; + + /** + * Calls ListDatabases. + * @param request ListDatabasesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListDatabasesResponse + */ + public listDatabases(request: google.spanner.admin.database.v1.IListDatabasesRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.ListDatabasesCallback): void; + + /** + * Calls ListDatabases. + * @param request ListDatabasesRequest message or plain object + * @returns Promise + */ + public listDatabases(request: google.spanner.admin.database.v1.IListDatabasesRequest): Promise; + + /** + * Calls CreateDatabase. + * @param request CreateDatabaseRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createDatabase(request: google.spanner.admin.database.v1.ICreateDatabaseRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.CreateDatabaseCallback): void; + + /** + * Calls CreateDatabase. + * @param request CreateDatabaseRequest message or plain object + * @returns Promise + */ + public createDatabase(request: google.spanner.admin.database.v1.ICreateDatabaseRequest): Promise; + + /** + * Calls GetDatabase. + * @param request GetDatabaseRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Database + */ + public getDatabase(request: google.spanner.admin.database.v1.IGetDatabaseRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.GetDatabaseCallback): void; + + /** + * Calls GetDatabase. + * @param request GetDatabaseRequest message or plain object + * @returns Promise + */ + public getDatabase(request: google.spanner.admin.database.v1.IGetDatabaseRequest): Promise; + + /** + * Calls UpdateDatabase. + * @param request UpdateDatabaseRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateDatabase(request: google.spanner.admin.database.v1.IUpdateDatabaseRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseCallback): void; + + /** + * Calls UpdateDatabase. + * @param request UpdateDatabaseRequest message or plain object + * @returns Promise + */ + public updateDatabase(request: google.spanner.admin.database.v1.IUpdateDatabaseRequest): Promise; + + /** + * Calls UpdateDatabaseDdl. + * @param request UpdateDatabaseDdlRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateDatabaseDdl(request: google.spanner.admin.database.v1.IUpdateDatabaseDdlRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdlCallback): void; + + /** + * Calls UpdateDatabaseDdl. + * @param request UpdateDatabaseDdlRequest message or plain object + * @returns Promise + */ + public updateDatabaseDdl(request: google.spanner.admin.database.v1.IUpdateDatabaseDdlRequest): Promise; + + /** + * Calls DropDatabase. + * @param request DropDatabaseRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public dropDatabase(request: google.spanner.admin.database.v1.IDropDatabaseRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.DropDatabaseCallback): void; + + /** + * Calls DropDatabase. + * @param request DropDatabaseRequest message or plain object + * @returns Promise + */ + public dropDatabase(request: google.spanner.admin.database.v1.IDropDatabaseRequest): Promise; + + /** + * Calls GetDatabaseDdl. + * @param request GetDatabaseDdlRequest message or plain object + * @param callback Node-style callback called with the error, if any, and GetDatabaseDdlResponse + */ + public getDatabaseDdl(request: google.spanner.admin.database.v1.IGetDatabaseDdlRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.GetDatabaseDdlCallback): void; + + /** + * Calls GetDatabaseDdl. + * @param request GetDatabaseDdlRequest message or plain object + * @returns Promise + */ + public getDatabaseDdl(request: google.spanner.admin.database.v1.IGetDatabaseDdlRequest): Promise; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.SetIamPolicyCallback): void; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @returns Promise + */ + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest): Promise; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.GetIamPolicyCallback): void; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @returns Promise + */ + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest): Promise; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + */ + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.TestIamPermissionsCallback): void; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @returns Promise + */ + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest): Promise; + + /** + * Calls CreateBackup. + * @param request CreateBackupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createBackup(request: google.spanner.admin.database.v1.ICreateBackupRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.CreateBackupCallback): void; + + /** + * Calls CreateBackup. + * @param request CreateBackupRequest message or plain object + * @returns Promise + */ + public createBackup(request: google.spanner.admin.database.v1.ICreateBackupRequest): Promise; + + /** + * Calls CopyBackup. + * @param request CopyBackupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public copyBackup(request: google.spanner.admin.database.v1.ICopyBackupRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.CopyBackupCallback): void; + + /** + * Calls CopyBackup. + * @param request CopyBackupRequest message or plain object + * @returns Promise + */ + public copyBackup(request: google.spanner.admin.database.v1.ICopyBackupRequest): Promise; + + /** + * Calls GetBackup. + * @param request GetBackupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Backup + */ + public getBackup(request: google.spanner.admin.database.v1.IGetBackupRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.GetBackupCallback): void; + + /** + * Calls GetBackup. + * @param request GetBackupRequest message or plain object + * @returns Promise + */ + public getBackup(request: google.spanner.admin.database.v1.IGetBackupRequest): Promise; + + /** + * Calls UpdateBackup. + * @param request UpdateBackupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Backup + */ + public updateBackup(request: google.spanner.admin.database.v1.IUpdateBackupRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.UpdateBackupCallback): void; + + /** + * Calls UpdateBackup. + * @param request UpdateBackupRequest message or plain object + * @returns Promise + */ + public updateBackup(request: google.spanner.admin.database.v1.IUpdateBackupRequest): Promise; + + /** + * Calls DeleteBackup. + * @param request DeleteBackupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteBackup(request: google.spanner.admin.database.v1.IDeleteBackupRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.DeleteBackupCallback): void; + + /** + * Calls DeleteBackup. + * @param request DeleteBackupRequest message or plain object + * @returns Promise + */ + public deleteBackup(request: google.spanner.admin.database.v1.IDeleteBackupRequest): Promise; + + /** + * Calls ListBackups. + * @param request ListBackupsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListBackupsResponse + */ + public listBackups(request: google.spanner.admin.database.v1.IListBackupsRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.ListBackupsCallback): void; + + /** + * Calls ListBackups. + * @param request ListBackupsRequest message or plain object + * @returns Promise + */ + public listBackups(request: google.spanner.admin.database.v1.IListBackupsRequest): Promise; + + /** + * Calls RestoreDatabase. + * @param request RestoreDatabaseRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public restoreDatabase(request: google.spanner.admin.database.v1.IRestoreDatabaseRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.RestoreDatabaseCallback): void; + + /** + * Calls RestoreDatabase. + * @param request RestoreDatabaseRequest message or plain object + * @returns Promise + */ + public restoreDatabase(request: google.spanner.admin.database.v1.IRestoreDatabaseRequest): Promise; + + /** + * Calls ListDatabaseOperations. + * @param request ListDatabaseOperationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListDatabaseOperationsResponse + */ + public listDatabaseOperations(request: google.spanner.admin.database.v1.IListDatabaseOperationsRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.ListDatabaseOperationsCallback): void; + + /** + * Calls ListDatabaseOperations. + * @param request ListDatabaseOperationsRequest message or plain object + * @returns Promise + */ + public listDatabaseOperations(request: google.spanner.admin.database.v1.IListDatabaseOperationsRequest): Promise; + + /** + * Calls ListBackupOperations. + * @param request ListBackupOperationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListBackupOperationsResponse + */ + public listBackupOperations(request: google.spanner.admin.database.v1.IListBackupOperationsRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.ListBackupOperationsCallback): void; + + /** + * Calls ListBackupOperations. + * @param request ListBackupOperationsRequest message or plain object + * @returns Promise + */ + public listBackupOperations(request: google.spanner.admin.database.v1.IListBackupOperationsRequest): Promise; + + /** + * Calls ListDatabaseRoles. + * @param request ListDatabaseRolesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListDatabaseRolesResponse + */ + public listDatabaseRoles(request: google.spanner.admin.database.v1.IListDatabaseRolesRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.ListDatabaseRolesCallback): void; + + /** + * Calls ListDatabaseRoles. + * @param request ListDatabaseRolesRequest message or plain object + * @returns Promise + */ + public listDatabaseRoles(request: google.spanner.admin.database.v1.IListDatabaseRolesRequest): Promise; + + /** + * Calls AddSplitPoints. + * @param request AddSplitPointsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AddSplitPointsResponse + */ + public addSplitPoints(request: google.spanner.admin.database.v1.IAddSplitPointsRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.AddSplitPointsCallback): void; + + /** + * Calls AddSplitPoints. + * @param request AddSplitPointsRequest message or plain object + * @returns Promise + */ + public addSplitPoints(request: google.spanner.admin.database.v1.IAddSplitPointsRequest): Promise; + + /** + * Calls CreateBackupSchedule. + * @param request CreateBackupScheduleRequest message or plain object + * @param callback Node-style callback called with the error, if any, and BackupSchedule + */ + public createBackupSchedule(request: google.spanner.admin.database.v1.ICreateBackupScheduleRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.CreateBackupScheduleCallback): void; + + /** + * Calls CreateBackupSchedule. + * @param request CreateBackupScheduleRequest message or plain object + * @returns Promise + */ + public createBackupSchedule(request: google.spanner.admin.database.v1.ICreateBackupScheduleRequest): Promise; + + /** + * Calls GetBackupSchedule. + * @param request GetBackupScheduleRequest message or plain object + * @param callback Node-style callback called with the error, if any, and BackupSchedule + */ + public getBackupSchedule(request: google.spanner.admin.database.v1.IGetBackupScheduleRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.GetBackupScheduleCallback): void; + + /** + * Calls GetBackupSchedule. + * @param request GetBackupScheduleRequest message or plain object + * @returns Promise + */ + public getBackupSchedule(request: google.spanner.admin.database.v1.IGetBackupScheduleRequest): Promise; + + /** + * Calls UpdateBackupSchedule. + * @param request UpdateBackupScheduleRequest message or plain object + * @param callback Node-style callback called with the error, if any, and BackupSchedule + */ + public updateBackupSchedule(request: google.spanner.admin.database.v1.IUpdateBackupScheduleRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.UpdateBackupScheduleCallback): void; + + /** + * Calls UpdateBackupSchedule. + * @param request UpdateBackupScheduleRequest message or plain object + * @returns Promise + */ + public updateBackupSchedule(request: google.spanner.admin.database.v1.IUpdateBackupScheduleRequest): Promise; + + /** + * Calls DeleteBackupSchedule. + * @param request DeleteBackupScheduleRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteBackupSchedule(request: google.spanner.admin.database.v1.IDeleteBackupScheduleRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.DeleteBackupScheduleCallback): void; + + /** + * Calls DeleteBackupSchedule. + * @param request DeleteBackupScheduleRequest message or plain object + * @returns Promise + */ + public deleteBackupSchedule(request: google.spanner.admin.database.v1.IDeleteBackupScheduleRequest): Promise; + + /** + * Calls ListBackupSchedules. + * @param request ListBackupSchedulesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListBackupSchedulesResponse + */ + public listBackupSchedules(request: google.spanner.admin.database.v1.IListBackupSchedulesRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.ListBackupSchedulesCallback): void; + + /** + * Calls ListBackupSchedules. + * @param request ListBackupSchedulesRequest message or plain object + * @returns Promise + */ + public listBackupSchedules(request: google.spanner.admin.database.v1.IListBackupSchedulesRequest): Promise; + + /** + * Calls InternalUpdateGraphOperation. + * @param request InternalUpdateGraphOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and InternalUpdateGraphOperationResponse + */ + public internalUpdateGraphOperation(request: google.spanner.admin.database.v1.IInternalUpdateGraphOperationRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.InternalUpdateGraphOperationCallback): void; + + /** + * Calls InternalUpdateGraphOperation. + * @param request InternalUpdateGraphOperationRequest message or plain object + * @returns Promise + */ + public internalUpdateGraphOperation(request: google.spanner.admin.database.v1.IInternalUpdateGraphOperationRequest): Promise; + } + + namespace DatabaseAdmin { + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|listDatabases}. + * @param error Error, if any + * @param [response] ListDatabasesResponse + */ + type ListDatabasesCallback = (error: (Error|null), response?: google.spanner.admin.database.v1.ListDatabasesResponse) => void; + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|createDatabase}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateDatabaseCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|getDatabase}. + * @param error Error, if any + * @param [response] Database + */ + type GetDatabaseCallback = (error: (Error|null), response?: google.spanner.admin.database.v1.Database) => void; + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|updateDatabase}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateDatabaseCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|updateDatabaseDdl}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateDatabaseDdlCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|dropDatabase}. + * @param error Error, if any + * @param [response] Empty + */ + type DropDatabaseCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|getDatabaseDdl}. + * @param error Error, if any + * @param [response] GetDatabaseDdlResponse + */ + type GetDatabaseDdlCallback = (error: (Error|null), response?: google.spanner.admin.database.v1.GetDatabaseDdlResponse) => void; + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|setIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type SetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|getIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type GetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|testIamPermissions}. + * @param error Error, if any + * @param [response] TestIamPermissionsResponse + */ + type TestIamPermissionsCallback = (error: (Error|null), response?: google.iam.v1.TestIamPermissionsResponse) => void; + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|createBackup}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateBackupCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|copyBackup}. + * @param error Error, if any + * @param [response] Operation + */ + type CopyBackupCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|getBackup}. + * @param error Error, if any + * @param [response] Backup + */ + type GetBackupCallback = (error: (Error|null), response?: google.spanner.admin.database.v1.Backup) => void; + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|updateBackup}. + * @param error Error, if any + * @param [response] Backup + */ + type UpdateBackupCallback = (error: (Error|null), response?: google.spanner.admin.database.v1.Backup) => void; + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|deleteBackup}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteBackupCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|listBackups}. + * @param error Error, if any + * @param [response] ListBackupsResponse + */ + type ListBackupsCallback = (error: (Error|null), response?: google.spanner.admin.database.v1.ListBackupsResponse) => void; + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|restoreDatabase}. + * @param error Error, if any + * @param [response] Operation + */ + type RestoreDatabaseCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|listDatabaseOperations}. + * @param error Error, if any + * @param [response] ListDatabaseOperationsResponse + */ + type ListDatabaseOperationsCallback = (error: (Error|null), response?: google.spanner.admin.database.v1.ListDatabaseOperationsResponse) => void; + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|listBackupOperations}. + * @param error Error, if any + * @param [response] ListBackupOperationsResponse + */ + type ListBackupOperationsCallback = (error: (Error|null), response?: google.spanner.admin.database.v1.ListBackupOperationsResponse) => void; + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|listDatabaseRoles}. + * @param error Error, if any + * @param [response] ListDatabaseRolesResponse + */ + type ListDatabaseRolesCallback = (error: (Error|null), response?: google.spanner.admin.database.v1.ListDatabaseRolesResponse) => void; + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|addSplitPoints}. + * @param error Error, if any + * @param [response] AddSplitPointsResponse + */ + type AddSplitPointsCallback = (error: (Error|null), response?: google.spanner.admin.database.v1.AddSplitPointsResponse) => void; + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|createBackupSchedule}. + * @param error Error, if any + * @param [response] BackupSchedule + */ + type CreateBackupScheduleCallback = (error: (Error|null), response?: google.spanner.admin.database.v1.BackupSchedule) => void; + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|getBackupSchedule}. + * @param error Error, if any + * @param [response] BackupSchedule + */ + type GetBackupScheduleCallback = (error: (Error|null), response?: google.spanner.admin.database.v1.BackupSchedule) => void; + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|updateBackupSchedule}. + * @param error Error, if any + * @param [response] BackupSchedule + */ + type UpdateBackupScheduleCallback = (error: (Error|null), response?: google.spanner.admin.database.v1.BackupSchedule) => void; + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|deleteBackupSchedule}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteBackupScheduleCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|listBackupSchedules}. + * @param error Error, if any + * @param [response] ListBackupSchedulesResponse + */ + type ListBackupSchedulesCallback = (error: (Error|null), response?: google.spanner.admin.database.v1.ListBackupSchedulesResponse) => void; + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|internalUpdateGraphOperation}. + * @param error Error, if any + * @param [response] InternalUpdateGraphOperationResponse + */ + type InternalUpdateGraphOperationCallback = (error: (Error|null), response?: google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse) => void; + } + + /** Properties of a RestoreInfo. */ + interface IRestoreInfo { + + /** RestoreInfo sourceType */ + sourceType?: (google.spanner.admin.database.v1.RestoreSourceType|keyof typeof google.spanner.admin.database.v1.RestoreSourceType|null); + + /** RestoreInfo backupInfo */ + backupInfo?: (google.spanner.admin.database.v1.IBackupInfo|null); + } + + /** Represents a RestoreInfo. */ + class RestoreInfo implements IRestoreInfo { + + /** + * Constructs a new RestoreInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IRestoreInfo); + + /** RestoreInfo sourceType. */ + public sourceType: (google.spanner.admin.database.v1.RestoreSourceType|keyof typeof google.spanner.admin.database.v1.RestoreSourceType); + + /** RestoreInfo backupInfo. */ + public backupInfo?: (google.spanner.admin.database.v1.IBackupInfo|null); + + /** RestoreInfo sourceInfo. */ + public sourceInfo?: "backupInfo"; + + /** + * Creates a new RestoreInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns RestoreInfo instance + */ + public static create(properties?: google.spanner.admin.database.v1.IRestoreInfo): google.spanner.admin.database.v1.RestoreInfo; + + /** + * Encodes the specified RestoreInfo message. Does not implicitly {@link google.spanner.admin.database.v1.RestoreInfo.verify|verify} messages. + * @param message RestoreInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IRestoreInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RestoreInfo message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.RestoreInfo.verify|verify} messages. + * @param message RestoreInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IRestoreInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RestoreInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RestoreInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.RestoreInfo; + + /** + * Decodes a RestoreInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RestoreInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.RestoreInfo; + + /** + * Verifies a RestoreInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RestoreInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RestoreInfo + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.RestoreInfo; + + /** + * Creates a plain object from a RestoreInfo message. Also converts values to other types if specified. + * @param message RestoreInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.RestoreInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RestoreInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RestoreInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Database. */ + interface IDatabase { + + /** Database name */ + name?: (string|null); + + /** Database state */ + state?: (google.spanner.admin.database.v1.Database.State|keyof typeof google.spanner.admin.database.v1.Database.State|null); + + /** Database createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Database restoreInfo */ + restoreInfo?: (google.spanner.admin.database.v1.IRestoreInfo|null); + + /** Database encryptionConfig */ + encryptionConfig?: (google.spanner.admin.database.v1.IEncryptionConfig|null); + + /** Database encryptionInfo */ + encryptionInfo?: (google.spanner.admin.database.v1.IEncryptionInfo[]|null); + + /** Database versionRetentionPeriod */ + versionRetentionPeriod?: (string|null); + + /** Database earliestVersionTime */ + earliestVersionTime?: (google.protobuf.ITimestamp|null); + + /** Database defaultLeader */ + defaultLeader?: (string|null); + + /** Database databaseDialect */ + databaseDialect?: (google.spanner.admin.database.v1.DatabaseDialect|keyof typeof google.spanner.admin.database.v1.DatabaseDialect|null); + + /** Database enableDropProtection */ + enableDropProtection?: (boolean|null); + + /** Database reconciling */ + reconciling?: (boolean|null); + } + + /** Represents a Database. */ + class Database implements IDatabase { + + /** + * Constructs a new Database. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IDatabase); + + /** Database name. */ + public name: string; + + /** Database state. */ + public state: (google.spanner.admin.database.v1.Database.State|keyof typeof google.spanner.admin.database.v1.Database.State); + + /** Database createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Database restoreInfo. */ + public restoreInfo?: (google.spanner.admin.database.v1.IRestoreInfo|null); + + /** Database encryptionConfig. */ + public encryptionConfig?: (google.spanner.admin.database.v1.IEncryptionConfig|null); + + /** Database encryptionInfo. */ + public encryptionInfo: google.spanner.admin.database.v1.IEncryptionInfo[]; + + /** Database versionRetentionPeriod. */ + public versionRetentionPeriod: string; + + /** Database earliestVersionTime. */ + public earliestVersionTime?: (google.protobuf.ITimestamp|null); + + /** Database defaultLeader. */ + public defaultLeader: string; + + /** Database databaseDialect. */ + public databaseDialect: (google.spanner.admin.database.v1.DatabaseDialect|keyof typeof google.spanner.admin.database.v1.DatabaseDialect); + + /** Database enableDropProtection. */ + public enableDropProtection: boolean; + + /** Database reconciling. */ + public reconciling: boolean; + + /** + * Creates a new Database instance using the specified properties. + * @param [properties] Properties to set + * @returns Database instance + */ + public static create(properties?: google.spanner.admin.database.v1.IDatabase): google.spanner.admin.database.v1.Database; + + /** + * Encodes the specified Database message. Does not implicitly {@link google.spanner.admin.database.v1.Database.verify|verify} messages. + * @param message Database message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IDatabase, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Database message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.Database.verify|verify} messages. + * @param message Database message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IDatabase, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Database message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Database + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.Database; + + /** + * Decodes a Database message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Database + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.Database; + + /** + * Verifies a Database message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Database message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Database + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.Database; + + /** + * Creates a plain object from a Database message. Also converts values to other types if specified. + * @param message Database + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.Database, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Database to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Database + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Database { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + CREATING = 1, + READY = 2, + READY_OPTIMIZING = 3 + } + } + + /** Properties of a ListDatabasesRequest. */ + interface IListDatabasesRequest { + + /** ListDatabasesRequest parent */ + parent?: (string|null); + + /** ListDatabasesRequest pageSize */ + pageSize?: (number|null); + + /** ListDatabasesRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListDatabasesRequest. */ + class ListDatabasesRequest implements IListDatabasesRequest { + + /** + * Constructs a new ListDatabasesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IListDatabasesRequest); + + /** ListDatabasesRequest parent. */ + public parent: string; + + /** ListDatabasesRequest pageSize. */ + public pageSize: number; + + /** ListDatabasesRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListDatabasesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDatabasesRequest instance + */ + public static create(properties?: google.spanner.admin.database.v1.IListDatabasesRequest): google.spanner.admin.database.v1.ListDatabasesRequest; + + /** + * Encodes the specified ListDatabasesRequest message. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabasesRequest.verify|verify} messages. + * @param message ListDatabasesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IListDatabasesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDatabasesRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabasesRequest.verify|verify} messages. + * @param message ListDatabasesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IListDatabasesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDatabasesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDatabasesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.ListDatabasesRequest; + + /** + * Decodes a ListDatabasesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDatabasesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.ListDatabasesRequest; + + /** + * Verifies a ListDatabasesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDatabasesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDatabasesRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.ListDatabasesRequest; + + /** + * Creates a plain object from a ListDatabasesRequest message. Also converts values to other types if specified. + * @param message ListDatabasesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.ListDatabasesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDatabasesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDatabasesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListDatabasesResponse. */ + interface IListDatabasesResponse { + + /** ListDatabasesResponse databases */ + databases?: (google.spanner.admin.database.v1.IDatabase[]|null); + + /** ListDatabasesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListDatabasesResponse. */ + class ListDatabasesResponse implements IListDatabasesResponse { + + /** + * Constructs a new ListDatabasesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IListDatabasesResponse); + + /** ListDatabasesResponse databases. */ + public databases: google.spanner.admin.database.v1.IDatabase[]; + + /** ListDatabasesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListDatabasesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDatabasesResponse instance + */ + public static create(properties?: google.spanner.admin.database.v1.IListDatabasesResponse): google.spanner.admin.database.v1.ListDatabasesResponse; + + /** + * Encodes the specified ListDatabasesResponse message. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabasesResponse.verify|verify} messages. + * @param message ListDatabasesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IListDatabasesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDatabasesResponse message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabasesResponse.verify|verify} messages. + * @param message ListDatabasesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IListDatabasesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDatabasesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDatabasesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.ListDatabasesResponse; + + /** + * Decodes a ListDatabasesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDatabasesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.ListDatabasesResponse; + + /** + * Verifies a ListDatabasesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDatabasesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDatabasesResponse + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.ListDatabasesResponse; + + /** + * Creates a plain object from a ListDatabasesResponse message. Also converts values to other types if specified. + * @param message ListDatabasesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.ListDatabasesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDatabasesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDatabasesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateDatabaseRequest. */ + interface ICreateDatabaseRequest { + + /** CreateDatabaseRequest parent */ + parent?: (string|null); + + /** CreateDatabaseRequest createStatement */ + createStatement?: (string|null); + + /** CreateDatabaseRequest extraStatements */ + extraStatements?: (string[]|null); + + /** CreateDatabaseRequest encryptionConfig */ + encryptionConfig?: (google.spanner.admin.database.v1.IEncryptionConfig|null); + + /** CreateDatabaseRequest databaseDialect */ + databaseDialect?: (google.spanner.admin.database.v1.DatabaseDialect|keyof typeof google.spanner.admin.database.v1.DatabaseDialect|null); + + /** CreateDatabaseRequest protoDescriptors */ + protoDescriptors?: (Uint8Array|Buffer|string|null); + } + + /** Represents a CreateDatabaseRequest. */ + class CreateDatabaseRequest implements ICreateDatabaseRequest { + + /** + * Constructs a new CreateDatabaseRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.ICreateDatabaseRequest); + + /** CreateDatabaseRequest parent. */ + public parent: string; + + /** CreateDatabaseRequest createStatement. */ + public createStatement: string; + + /** CreateDatabaseRequest extraStatements. */ + public extraStatements: string[]; + + /** CreateDatabaseRequest encryptionConfig. */ + public encryptionConfig?: (google.spanner.admin.database.v1.IEncryptionConfig|null); + + /** CreateDatabaseRequest databaseDialect. */ + public databaseDialect: (google.spanner.admin.database.v1.DatabaseDialect|keyof typeof google.spanner.admin.database.v1.DatabaseDialect); + + /** CreateDatabaseRequest protoDescriptors. */ + public protoDescriptors: (Uint8Array|Buffer|string); + + /** + * Creates a new CreateDatabaseRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateDatabaseRequest instance + */ + public static create(properties?: google.spanner.admin.database.v1.ICreateDatabaseRequest): google.spanner.admin.database.v1.CreateDatabaseRequest; + + /** + * Encodes the specified CreateDatabaseRequest message. Does not implicitly {@link google.spanner.admin.database.v1.CreateDatabaseRequest.verify|verify} messages. + * @param message CreateDatabaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.ICreateDatabaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateDatabaseRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.CreateDatabaseRequest.verify|verify} messages. + * @param message CreateDatabaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.ICreateDatabaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateDatabaseRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateDatabaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.CreateDatabaseRequest; + + /** + * Decodes a CreateDatabaseRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateDatabaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.CreateDatabaseRequest; + + /** + * Verifies a CreateDatabaseRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateDatabaseRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateDatabaseRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.CreateDatabaseRequest; + + /** + * Creates a plain object from a CreateDatabaseRequest message. Also converts values to other types if specified. + * @param message CreateDatabaseRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.CreateDatabaseRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateDatabaseRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateDatabaseRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateDatabaseMetadata. */ + interface ICreateDatabaseMetadata { + + /** CreateDatabaseMetadata database */ + database?: (string|null); + } + + /** Represents a CreateDatabaseMetadata. */ + class CreateDatabaseMetadata implements ICreateDatabaseMetadata { + + /** + * Constructs a new CreateDatabaseMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.ICreateDatabaseMetadata); + + /** CreateDatabaseMetadata database. */ + public database: string; + + /** + * Creates a new CreateDatabaseMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateDatabaseMetadata instance + */ + public static create(properties?: google.spanner.admin.database.v1.ICreateDatabaseMetadata): google.spanner.admin.database.v1.CreateDatabaseMetadata; + + /** + * Encodes the specified CreateDatabaseMetadata message. Does not implicitly {@link google.spanner.admin.database.v1.CreateDatabaseMetadata.verify|verify} messages. + * @param message CreateDatabaseMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.ICreateDatabaseMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateDatabaseMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.CreateDatabaseMetadata.verify|verify} messages. + * @param message CreateDatabaseMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.ICreateDatabaseMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateDatabaseMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateDatabaseMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.CreateDatabaseMetadata; + + /** + * Decodes a CreateDatabaseMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateDatabaseMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.CreateDatabaseMetadata; + + /** + * Verifies a CreateDatabaseMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateDatabaseMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateDatabaseMetadata + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.CreateDatabaseMetadata; + + /** + * Creates a plain object from a CreateDatabaseMetadata message. Also converts values to other types if specified. + * @param message CreateDatabaseMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.CreateDatabaseMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateDatabaseMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateDatabaseMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetDatabaseRequest. */ + interface IGetDatabaseRequest { + + /** GetDatabaseRequest name */ + name?: (string|null); + } + + /** Represents a GetDatabaseRequest. */ + class GetDatabaseRequest implements IGetDatabaseRequest { + + /** + * Constructs a new GetDatabaseRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IGetDatabaseRequest); + + /** GetDatabaseRequest name. */ + public name: string; + + /** + * Creates a new GetDatabaseRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetDatabaseRequest instance + */ + public static create(properties?: google.spanner.admin.database.v1.IGetDatabaseRequest): google.spanner.admin.database.v1.GetDatabaseRequest; + + /** + * Encodes the specified GetDatabaseRequest message. Does not implicitly {@link google.spanner.admin.database.v1.GetDatabaseRequest.verify|verify} messages. + * @param message GetDatabaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IGetDatabaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetDatabaseRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.GetDatabaseRequest.verify|verify} messages. + * @param message GetDatabaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IGetDatabaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetDatabaseRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetDatabaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.GetDatabaseRequest; + + /** + * Decodes a GetDatabaseRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetDatabaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.GetDatabaseRequest; + + /** + * Verifies a GetDatabaseRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetDatabaseRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetDatabaseRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.GetDatabaseRequest; + + /** + * Creates a plain object from a GetDatabaseRequest message. Also converts values to other types if specified. + * @param message GetDatabaseRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.GetDatabaseRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetDatabaseRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetDatabaseRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateDatabaseRequest. */ + interface IUpdateDatabaseRequest { + + /** UpdateDatabaseRequest database */ + database?: (google.spanner.admin.database.v1.IDatabase|null); + + /** UpdateDatabaseRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateDatabaseRequest. */ + class UpdateDatabaseRequest implements IUpdateDatabaseRequest { + + /** + * Constructs a new UpdateDatabaseRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IUpdateDatabaseRequest); + + /** UpdateDatabaseRequest database. */ + public database?: (google.spanner.admin.database.v1.IDatabase|null); + + /** UpdateDatabaseRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateDatabaseRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateDatabaseRequest instance + */ + public static create(properties?: google.spanner.admin.database.v1.IUpdateDatabaseRequest): google.spanner.admin.database.v1.UpdateDatabaseRequest; + + /** + * Encodes the specified UpdateDatabaseRequest message. Does not implicitly {@link google.spanner.admin.database.v1.UpdateDatabaseRequest.verify|verify} messages. + * @param message UpdateDatabaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IUpdateDatabaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateDatabaseRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.UpdateDatabaseRequest.verify|verify} messages. + * @param message UpdateDatabaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IUpdateDatabaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateDatabaseRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateDatabaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.UpdateDatabaseRequest; + + /** + * Decodes an UpdateDatabaseRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateDatabaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.UpdateDatabaseRequest; + + /** + * Verifies an UpdateDatabaseRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateDatabaseRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateDatabaseRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.UpdateDatabaseRequest; + + /** + * Creates a plain object from an UpdateDatabaseRequest message. Also converts values to other types if specified. + * @param message UpdateDatabaseRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.UpdateDatabaseRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateDatabaseRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateDatabaseRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateDatabaseMetadata. */ + interface IUpdateDatabaseMetadata { + + /** UpdateDatabaseMetadata request */ + request?: (google.spanner.admin.database.v1.IUpdateDatabaseRequest|null); + + /** UpdateDatabaseMetadata progress */ + progress?: (google.spanner.admin.database.v1.IOperationProgress|null); + + /** UpdateDatabaseMetadata cancelTime */ + cancelTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents an UpdateDatabaseMetadata. */ + class UpdateDatabaseMetadata implements IUpdateDatabaseMetadata { + + /** + * Constructs a new UpdateDatabaseMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IUpdateDatabaseMetadata); + + /** UpdateDatabaseMetadata request. */ + public request?: (google.spanner.admin.database.v1.IUpdateDatabaseRequest|null); + + /** UpdateDatabaseMetadata progress. */ + public progress?: (google.spanner.admin.database.v1.IOperationProgress|null); + + /** UpdateDatabaseMetadata cancelTime. */ + public cancelTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new UpdateDatabaseMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateDatabaseMetadata instance + */ + public static create(properties?: google.spanner.admin.database.v1.IUpdateDatabaseMetadata): google.spanner.admin.database.v1.UpdateDatabaseMetadata; + + /** + * Encodes the specified UpdateDatabaseMetadata message. Does not implicitly {@link google.spanner.admin.database.v1.UpdateDatabaseMetadata.verify|verify} messages. + * @param message UpdateDatabaseMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IUpdateDatabaseMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateDatabaseMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.UpdateDatabaseMetadata.verify|verify} messages. + * @param message UpdateDatabaseMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IUpdateDatabaseMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateDatabaseMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateDatabaseMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.UpdateDatabaseMetadata; + + /** + * Decodes an UpdateDatabaseMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateDatabaseMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.UpdateDatabaseMetadata; + + /** + * Verifies an UpdateDatabaseMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateDatabaseMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateDatabaseMetadata + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.UpdateDatabaseMetadata; + + /** + * Creates a plain object from an UpdateDatabaseMetadata message. Also converts values to other types if specified. + * @param message UpdateDatabaseMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.UpdateDatabaseMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateDatabaseMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateDatabaseMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateDatabaseDdlRequest. */ + interface IUpdateDatabaseDdlRequest { + + /** UpdateDatabaseDdlRequest database */ + database?: (string|null); + + /** UpdateDatabaseDdlRequest statements */ + statements?: (string[]|null); + + /** UpdateDatabaseDdlRequest operationId */ + operationId?: (string|null); + + /** UpdateDatabaseDdlRequest protoDescriptors */ + protoDescriptors?: (Uint8Array|Buffer|string|null); + + /** UpdateDatabaseDdlRequest throughputMode */ + throughputMode?: (boolean|null); + } + + /** Represents an UpdateDatabaseDdlRequest. */ + class UpdateDatabaseDdlRequest implements IUpdateDatabaseDdlRequest { + + /** + * Constructs a new UpdateDatabaseDdlRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IUpdateDatabaseDdlRequest); + + /** UpdateDatabaseDdlRequest database. */ + public database: string; + + /** UpdateDatabaseDdlRequest statements. */ + public statements: string[]; + + /** UpdateDatabaseDdlRequest operationId. */ + public operationId: string; + + /** UpdateDatabaseDdlRequest protoDescriptors. */ + public protoDescriptors: (Uint8Array|Buffer|string); + + /** UpdateDatabaseDdlRequest throughputMode. */ + public throughputMode: boolean; + + /** + * Creates a new UpdateDatabaseDdlRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateDatabaseDdlRequest instance + */ + public static create(properties?: google.spanner.admin.database.v1.IUpdateDatabaseDdlRequest): google.spanner.admin.database.v1.UpdateDatabaseDdlRequest; + + /** + * Encodes the specified UpdateDatabaseDdlRequest message. Does not implicitly {@link google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.verify|verify} messages. + * @param message UpdateDatabaseDdlRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IUpdateDatabaseDdlRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateDatabaseDdlRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.verify|verify} messages. + * @param message UpdateDatabaseDdlRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IUpdateDatabaseDdlRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateDatabaseDdlRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateDatabaseDdlRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.UpdateDatabaseDdlRequest; + + /** + * Decodes an UpdateDatabaseDdlRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateDatabaseDdlRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.UpdateDatabaseDdlRequest; + + /** + * Verifies an UpdateDatabaseDdlRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateDatabaseDdlRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateDatabaseDdlRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.UpdateDatabaseDdlRequest; + + /** + * Creates a plain object from an UpdateDatabaseDdlRequest message. Also converts values to other types if specified. + * @param message UpdateDatabaseDdlRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.UpdateDatabaseDdlRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateDatabaseDdlRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateDatabaseDdlRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DdlStatementActionInfo. */ + interface IDdlStatementActionInfo { + + /** DdlStatementActionInfo action */ + action?: (string|null); + + /** DdlStatementActionInfo entityType */ + entityType?: (string|null); + + /** DdlStatementActionInfo entityNames */ + entityNames?: (string[]|null); + } + + /** Represents a DdlStatementActionInfo. */ + class DdlStatementActionInfo implements IDdlStatementActionInfo { + + /** + * Constructs a new DdlStatementActionInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IDdlStatementActionInfo); + + /** DdlStatementActionInfo action. */ + public action: string; + + /** DdlStatementActionInfo entityType. */ + public entityType: string; + + /** DdlStatementActionInfo entityNames. */ + public entityNames: string[]; + + /** + * Creates a new DdlStatementActionInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns DdlStatementActionInfo instance + */ + public static create(properties?: google.spanner.admin.database.v1.IDdlStatementActionInfo): google.spanner.admin.database.v1.DdlStatementActionInfo; + + /** + * Encodes the specified DdlStatementActionInfo message. Does not implicitly {@link google.spanner.admin.database.v1.DdlStatementActionInfo.verify|verify} messages. + * @param message DdlStatementActionInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IDdlStatementActionInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DdlStatementActionInfo message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.DdlStatementActionInfo.verify|verify} messages. + * @param message DdlStatementActionInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IDdlStatementActionInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DdlStatementActionInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DdlStatementActionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.DdlStatementActionInfo; + + /** + * Decodes a DdlStatementActionInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DdlStatementActionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.DdlStatementActionInfo; + + /** + * Verifies a DdlStatementActionInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DdlStatementActionInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DdlStatementActionInfo + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.DdlStatementActionInfo; + + /** + * Creates a plain object from a DdlStatementActionInfo message. Also converts values to other types if specified. + * @param message DdlStatementActionInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.DdlStatementActionInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DdlStatementActionInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DdlStatementActionInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateDatabaseDdlMetadata. */ + interface IUpdateDatabaseDdlMetadata { + + /** UpdateDatabaseDdlMetadata database */ + database?: (string|null); + + /** UpdateDatabaseDdlMetadata statements */ + statements?: (string[]|null); + + /** UpdateDatabaseDdlMetadata commitTimestamps */ + commitTimestamps?: (google.protobuf.ITimestamp[]|null); + + /** UpdateDatabaseDdlMetadata throttled */ + throttled?: (boolean|null); + + /** UpdateDatabaseDdlMetadata progress */ + progress?: (google.spanner.admin.database.v1.IOperationProgress[]|null); + + /** UpdateDatabaseDdlMetadata actions */ + actions?: (google.spanner.admin.database.v1.IDdlStatementActionInfo[]|null); + } + + /** Represents an UpdateDatabaseDdlMetadata. */ + class UpdateDatabaseDdlMetadata implements IUpdateDatabaseDdlMetadata { + + /** + * Constructs a new UpdateDatabaseDdlMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IUpdateDatabaseDdlMetadata); + + /** UpdateDatabaseDdlMetadata database. */ + public database: string; + + /** UpdateDatabaseDdlMetadata statements. */ + public statements: string[]; + + /** UpdateDatabaseDdlMetadata commitTimestamps. */ + public commitTimestamps: google.protobuf.ITimestamp[]; + + /** UpdateDatabaseDdlMetadata throttled. */ + public throttled: boolean; + + /** UpdateDatabaseDdlMetadata progress. */ + public progress: google.spanner.admin.database.v1.IOperationProgress[]; + + /** UpdateDatabaseDdlMetadata actions. */ + public actions: google.spanner.admin.database.v1.IDdlStatementActionInfo[]; + + /** + * Creates a new UpdateDatabaseDdlMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateDatabaseDdlMetadata instance + */ + public static create(properties?: google.spanner.admin.database.v1.IUpdateDatabaseDdlMetadata): google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata; + + /** + * Encodes the specified UpdateDatabaseDdlMetadata message. Does not implicitly {@link google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata.verify|verify} messages. + * @param message UpdateDatabaseDdlMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IUpdateDatabaseDdlMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateDatabaseDdlMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata.verify|verify} messages. + * @param message UpdateDatabaseDdlMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IUpdateDatabaseDdlMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateDatabaseDdlMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateDatabaseDdlMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata; + + /** + * Decodes an UpdateDatabaseDdlMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateDatabaseDdlMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata; + + /** + * Verifies an UpdateDatabaseDdlMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateDatabaseDdlMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateDatabaseDdlMetadata + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata; + + /** + * Creates a plain object from an UpdateDatabaseDdlMetadata message. Also converts values to other types if specified. + * @param message UpdateDatabaseDdlMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateDatabaseDdlMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateDatabaseDdlMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DropDatabaseRequest. */ + interface IDropDatabaseRequest { + + /** DropDatabaseRequest database */ + database?: (string|null); + } + + /** Represents a DropDatabaseRequest. */ + class DropDatabaseRequest implements IDropDatabaseRequest { + + /** + * Constructs a new DropDatabaseRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IDropDatabaseRequest); + + /** DropDatabaseRequest database. */ + public database: string; + + /** + * Creates a new DropDatabaseRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DropDatabaseRequest instance + */ + public static create(properties?: google.spanner.admin.database.v1.IDropDatabaseRequest): google.spanner.admin.database.v1.DropDatabaseRequest; + + /** + * Encodes the specified DropDatabaseRequest message. Does not implicitly {@link google.spanner.admin.database.v1.DropDatabaseRequest.verify|verify} messages. + * @param message DropDatabaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IDropDatabaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DropDatabaseRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.DropDatabaseRequest.verify|verify} messages. + * @param message DropDatabaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IDropDatabaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DropDatabaseRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DropDatabaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.DropDatabaseRequest; + + /** + * Decodes a DropDatabaseRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DropDatabaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.DropDatabaseRequest; + + /** + * Verifies a DropDatabaseRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DropDatabaseRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DropDatabaseRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.DropDatabaseRequest; + + /** + * Creates a plain object from a DropDatabaseRequest message. Also converts values to other types if specified. + * @param message DropDatabaseRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.DropDatabaseRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DropDatabaseRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DropDatabaseRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetDatabaseDdlRequest. */ + interface IGetDatabaseDdlRequest { + + /** GetDatabaseDdlRequest database */ + database?: (string|null); + } + + /** Represents a GetDatabaseDdlRequest. */ + class GetDatabaseDdlRequest implements IGetDatabaseDdlRequest { + + /** + * Constructs a new GetDatabaseDdlRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IGetDatabaseDdlRequest); + + /** GetDatabaseDdlRequest database. */ + public database: string; + + /** + * Creates a new GetDatabaseDdlRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetDatabaseDdlRequest instance + */ + public static create(properties?: google.spanner.admin.database.v1.IGetDatabaseDdlRequest): google.spanner.admin.database.v1.GetDatabaseDdlRequest; + + /** + * Encodes the specified GetDatabaseDdlRequest message. Does not implicitly {@link google.spanner.admin.database.v1.GetDatabaseDdlRequest.verify|verify} messages. + * @param message GetDatabaseDdlRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IGetDatabaseDdlRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetDatabaseDdlRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.GetDatabaseDdlRequest.verify|verify} messages. + * @param message GetDatabaseDdlRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IGetDatabaseDdlRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetDatabaseDdlRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetDatabaseDdlRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.GetDatabaseDdlRequest; + + /** + * Decodes a GetDatabaseDdlRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetDatabaseDdlRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.GetDatabaseDdlRequest; + + /** + * Verifies a GetDatabaseDdlRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetDatabaseDdlRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetDatabaseDdlRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.GetDatabaseDdlRequest; + + /** + * Creates a plain object from a GetDatabaseDdlRequest message. Also converts values to other types if specified. + * @param message GetDatabaseDdlRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.GetDatabaseDdlRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetDatabaseDdlRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetDatabaseDdlRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetDatabaseDdlResponse. */ + interface IGetDatabaseDdlResponse { + + /** GetDatabaseDdlResponse statements */ + statements?: (string[]|null); + + /** GetDatabaseDdlResponse protoDescriptors */ + protoDescriptors?: (Uint8Array|Buffer|string|null); + } + + /** Represents a GetDatabaseDdlResponse. */ + class GetDatabaseDdlResponse implements IGetDatabaseDdlResponse { + + /** + * Constructs a new GetDatabaseDdlResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IGetDatabaseDdlResponse); + + /** GetDatabaseDdlResponse statements. */ + public statements: string[]; + + /** GetDatabaseDdlResponse protoDescriptors. */ + public protoDescriptors: (Uint8Array|Buffer|string); + + /** + * Creates a new GetDatabaseDdlResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns GetDatabaseDdlResponse instance + */ + public static create(properties?: google.spanner.admin.database.v1.IGetDatabaseDdlResponse): google.spanner.admin.database.v1.GetDatabaseDdlResponse; + + /** + * Encodes the specified GetDatabaseDdlResponse message. Does not implicitly {@link google.spanner.admin.database.v1.GetDatabaseDdlResponse.verify|verify} messages. + * @param message GetDatabaseDdlResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IGetDatabaseDdlResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetDatabaseDdlResponse message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.GetDatabaseDdlResponse.verify|verify} messages. + * @param message GetDatabaseDdlResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IGetDatabaseDdlResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetDatabaseDdlResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetDatabaseDdlResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.GetDatabaseDdlResponse; + + /** + * Decodes a GetDatabaseDdlResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetDatabaseDdlResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.GetDatabaseDdlResponse; + + /** + * Verifies a GetDatabaseDdlResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetDatabaseDdlResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetDatabaseDdlResponse + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.GetDatabaseDdlResponse; + + /** + * Creates a plain object from a GetDatabaseDdlResponse message. Also converts values to other types if specified. + * @param message GetDatabaseDdlResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.GetDatabaseDdlResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetDatabaseDdlResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetDatabaseDdlResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListDatabaseOperationsRequest. */ + interface IListDatabaseOperationsRequest { + + /** ListDatabaseOperationsRequest parent */ + parent?: (string|null); + + /** ListDatabaseOperationsRequest filter */ + filter?: (string|null); + + /** ListDatabaseOperationsRequest pageSize */ + pageSize?: (number|null); + + /** ListDatabaseOperationsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListDatabaseOperationsRequest. */ + class ListDatabaseOperationsRequest implements IListDatabaseOperationsRequest { + + /** + * Constructs a new ListDatabaseOperationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IListDatabaseOperationsRequest); + + /** ListDatabaseOperationsRequest parent. */ + public parent: string; + + /** ListDatabaseOperationsRequest filter. */ + public filter: string; + + /** ListDatabaseOperationsRequest pageSize. */ + public pageSize: number; + + /** ListDatabaseOperationsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListDatabaseOperationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDatabaseOperationsRequest instance + */ + public static create(properties?: google.spanner.admin.database.v1.IListDatabaseOperationsRequest): google.spanner.admin.database.v1.ListDatabaseOperationsRequest; + + /** + * Encodes the specified ListDatabaseOperationsRequest message. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabaseOperationsRequest.verify|verify} messages. + * @param message ListDatabaseOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IListDatabaseOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDatabaseOperationsRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabaseOperationsRequest.verify|verify} messages. + * @param message ListDatabaseOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IListDatabaseOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDatabaseOperationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDatabaseOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.ListDatabaseOperationsRequest; + + /** + * Decodes a ListDatabaseOperationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDatabaseOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.ListDatabaseOperationsRequest; + + /** + * Verifies a ListDatabaseOperationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDatabaseOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDatabaseOperationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.ListDatabaseOperationsRequest; + + /** + * Creates a plain object from a ListDatabaseOperationsRequest message. Also converts values to other types if specified. + * @param message ListDatabaseOperationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.ListDatabaseOperationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDatabaseOperationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDatabaseOperationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListDatabaseOperationsResponse. */ + interface IListDatabaseOperationsResponse { + + /** ListDatabaseOperationsResponse operations */ + operations?: (google.longrunning.IOperation[]|null); + + /** ListDatabaseOperationsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListDatabaseOperationsResponse. */ + class ListDatabaseOperationsResponse implements IListDatabaseOperationsResponse { + + /** + * Constructs a new ListDatabaseOperationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IListDatabaseOperationsResponse); + + /** ListDatabaseOperationsResponse operations. */ + public operations: google.longrunning.IOperation[]; + + /** ListDatabaseOperationsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListDatabaseOperationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDatabaseOperationsResponse instance + */ + public static create(properties?: google.spanner.admin.database.v1.IListDatabaseOperationsResponse): google.spanner.admin.database.v1.ListDatabaseOperationsResponse; + + /** + * Encodes the specified ListDatabaseOperationsResponse message. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabaseOperationsResponse.verify|verify} messages. + * @param message ListDatabaseOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IListDatabaseOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDatabaseOperationsResponse message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabaseOperationsResponse.verify|verify} messages. + * @param message ListDatabaseOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IListDatabaseOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDatabaseOperationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDatabaseOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.ListDatabaseOperationsResponse; + + /** + * Decodes a ListDatabaseOperationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDatabaseOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.ListDatabaseOperationsResponse; + + /** + * Verifies a ListDatabaseOperationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDatabaseOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDatabaseOperationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.ListDatabaseOperationsResponse; + + /** + * Creates a plain object from a ListDatabaseOperationsResponse message. Also converts values to other types if specified. + * @param message ListDatabaseOperationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.ListDatabaseOperationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDatabaseOperationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDatabaseOperationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RestoreDatabaseRequest. */ + interface IRestoreDatabaseRequest { + + /** RestoreDatabaseRequest parent */ + parent?: (string|null); + + /** RestoreDatabaseRequest databaseId */ + databaseId?: (string|null); + + /** RestoreDatabaseRequest backup */ + backup?: (string|null); + + /** RestoreDatabaseRequest encryptionConfig */ + encryptionConfig?: (google.spanner.admin.database.v1.IRestoreDatabaseEncryptionConfig|null); + } + + /** Represents a RestoreDatabaseRequest. */ + class RestoreDatabaseRequest implements IRestoreDatabaseRequest { + + /** + * Constructs a new RestoreDatabaseRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IRestoreDatabaseRequest); + + /** RestoreDatabaseRequest parent. */ + public parent: string; + + /** RestoreDatabaseRequest databaseId. */ + public databaseId: string; + + /** RestoreDatabaseRequest backup. */ + public backup?: (string|null); + + /** RestoreDatabaseRequest encryptionConfig. */ + public encryptionConfig?: (google.spanner.admin.database.v1.IRestoreDatabaseEncryptionConfig|null); + + /** RestoreDatabaseRequest source. */ + public source?: "backup"; + + /** + * Creates a new RestoreDatabaseRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RestoreDatabaseRequest instance + */ + public static create(properties?: google.spanner.admin.database.v1.IRestoreDatabaseRequest): google.spanner.admin.database.v1.RestoreDatabaseRequest; + + /** + * Encodes the specified RestoreDatabaseRequest message. Does not implicitly {@link google.spanner.admin.database.v1.RestoreDatabaseRequest.verify|verify} messages. + * @param message RestoreDatabaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IRestoreDatabaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RestoreDatabaseRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.RestoreDatabaseRequest.verify|verify} messages. + * @param message RestoreDatabaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IRestoreDatabaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RestoreDatabaseRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RestoreDatabaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.RestoreDatabaseRequest; + + /** + * Decodes a RestoreDatabaseRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RestoreDatabaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.RestoreDatabaseRequest; + + /** + * Verifies a RestoreDatabaseRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RestoreDatabaseRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RestoreDatabaseRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.RestoreDatabaseRequest; + + /** + * Creates a plain object from a RestoreDatabaseRequest message. Also converts values to other types if specified. + * @param message RestoreDatabaseRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.RestoreDatabaseRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RestoreDatabaseRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RestoreDatabaseRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RestoreDatabaseEncryptionConfig. */ + interface IRestoreDatabaseEncryptionConfig { + + /** RestoreDatabaseEncryptionConfig encryptionType */ + encryptionType?: (google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.EncryptionType|keyof typeof google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.EncryptionType|null); + + /** RestoreDatabaseEncryptionConfig kmsKeyName */ + kmsKeyName?: (string|null); + + /** RestoreDatabaseEncryptionConfig kmsKeyNames */ + kmsKeyNames?: (string[]|null); + } + + /** Represents a RestoreDatabaseEncryptionConfig. */ + class RestoreDatabaseEncryptionConfig implements IRestoreDatabaseEncryptionConfig { + + /** + * Constructs a new RestoreDatabaseEncryptionConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IRestoreDatabaseEncryptionConfig); + + /** RestoreDatabaseEncryptionConfig encryptionType. */ + public encryptionType: (google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.EncryptionType|keyof typeof google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.EncryptionType); + + /** RestoreDatabaseEncryptionConfig kmsKeyName. */ + public kmsKeyName: string; + + /** RestoreDatabaseEncryptionConfig kmsKeyNames. */ + public kmsKeyNames: string[]; + + /** + * Creates a new RestoreDatabaseEncryptionConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns RestoreDatabaseEncryptionConfig instance + */ + public static create(properties?: google.spanner.admin.database.v1.IRestoreDatabaseEncryptionConfig): google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig; + + /** + * Encodes the specified RestoreDatabaseEncryptionConfig message. Does not implicitly {@link google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.verify|verify} messages. + * @param message RestoreDatabaseEncryptionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IRestoreDatabaseEncryptionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RestoreDatabaseEncryptionConfig message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.verify|verify} messages. + * @param message RestoreDatabaseEncryptionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IRestoreDatabaseEncryptionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RestoreDatabaseEncryptionConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RestoreDatabaseEncryptionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig; + + /** + * Decodes a RestoreDatabaseEncryptionConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RestoreDatabaseEncryptionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig; + + /** + * Verifies a RestoreDatabaseEncryptionConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RestoreDatabaseEncryptionConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RestoreDatabaseEncryptionConfig + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig; + + /** + * Creates a plain object from a RestoreDatabaseEncryptionConfig message. Also converts values to other types if specified. + * @param message RestoreDatabaseEncryptionConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RestoreDatabaseEncryptionConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RestoreDatabaseEncryptionConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace RestoreDatabaseEncryptionConfig { + + /** EncryptionType enum. */ + enum EncryptionType { + ENCRYPTION_TYPE_UNSPECIFIED = 0, + USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION = 1, + GOOGLE_DEFAULT_ENCRYPTION = 2, + CUSTOMER_MANAGED_ENCRYPTION = 3 + } + } + + /** Properties of a RestoreDatabaseMetadata. */ + interface IRestoreDatabaseMetadata { + + /** RestoreDatabaseMetadata name */ + name?: (string|null); + + /** RestoreDatabaseMetadata sourceType */ + sourceType?: (google.spanner.admin.database.v1.RestoreSourceType|keyof typeof google.spanner.admin.database.v1.RestoreSourceType|null); + + /** RestoreDatabaseMetadata backupInfo */ + backupInfo?: (google.spanner.admin.database.v1.IBackupInfo|null); + + /** RestoreDatabaseMetadata progress */ + progress?: (google.spanner.admin.database.v1.IOperationProgress|null); + + /** RestoreDatabaseMetadata cancelTime */ + cancelTime?: (google.protobuf.ITimestamp|null); + + /** RestoreDatabaseMetadata optimizeDatabaseOperationName */ + optimizeDatabaseOperationName?: (string|null); + } + + /** Represents a RestoreDatabaseMetadata. */ + class RestoreDatabaseMetadata implements IRestoreDatabaseMetadata { + + /** + * Constructs a new RestoreDatabaseMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IRestoreDatabaseMetadata); + + /** RestoreDatabaseMetadata name. */ + public name: string; + + /** RestoreDatabaseMetadata sourceType. */ + public sourceType: (google.spanner.admin.database.v1.RestoreSourceType|keyof typeof google.spanner.admin.database.v1.RestoreSourceType); + + /** RestoreDatabaseMetadata backupInfo. */ + public backupInfo?: (google.spanner.admin.database.v1.IBackupInfo|null); + + /** RestoreDatabaseMetadata progress. */ + public progress?: (google.spanner.admin.database.v1.IOperationProgress|null); + + /** RestoreDatabaseMetadata cancelTime. */ + public cancelTime?: (google.protobuf.ITimestamp|null); + + /** RestoreDatabaseMetadata optimizeDatabaseOperationName. */ + public optimizeDatabaseOperationName: string; + + /** RestoreDatabaseMetadata sourceInfo. */ + public sourceInfo?: "backupInfo"; + + /** + * Creates a new RestoreDatabaseMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns RestoreDatabaseMetadata instance + */ + public static create(properties?: google.spanner.admin.database.v1.IRestoreDatabaseMetadata): google.spanner.admin.database.v1.RestoreDatabaseMetadata; + + /** + * Encodes the specified RestoreDatabaseMetadata message. Does not implicitly {@link google.spanner.admin.database.v1.RestoreDatabaseMetadata.verify|verify} messages. + * @param message RestoreDatabaseMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IRestoreDatabaseMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RestoreDatabaseMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.RestoreDatabaseMetadata.verify|verify} messages. + * @param message RestoreDatabaseMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IRestoreDatabaseMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RestoreDatabaseMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RestoreDatabaseMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.RestoreDatabaseMetadata; + + /** + * Decodes a RestoreDatabaseMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RestoreDatabaseMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.RestoreDatabaseMetadata; + + /** + * Verifies a RestoreDatabaseMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RestoreDatabaseMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RestoreDatabaseMetadata + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.RestoreDatabaseMetadata; + + /** + * Creates a plain object from a RestoreDatabaseMetadata message. Also converts values to other types if specified. + * @param message RestoreDatabaseMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.RestoreDatabaseMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RestoreDatabaseMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RestoreDatabaseMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OptimizeRestoredDatabaseMetadata. */ + interface IOptimizeRestoredDatabaseMetadata { + + /** OptimizeRestoredDatabaseMetadata name */ + name?: (string|null); + + /** OptimizeRestoredDatabaseMetadata progress */ + progress?: (google.spanner.admin.database.v1.IOperationProgress|null); + } + + /** Represents an OptimizeRestoredDatabaseMetadata. */ + class OptimizeRestoredDatabaseMetadata implements IOptimizeRestoredDatabaseMetadata { + + /** + * Constructs a new OptimizeRestoredDatabaseMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IOptimizeRestoredDatabaseMetadata); + + /** OptimizeRestoredDatabaseMetadata name. */ + public name: string; + + /** OptimizeRestoredDatabaseMetadata progress. */ + public progress?: (google.spanner.admin.database.v1.IOperationProgress|null); + + /** + * Creates a new OptimizeRestoredDatabaseMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns OptimizeRestoredDatabaseMetadata instance + */ + public static create(properties?: google.spanner.admin.database.v1.IOptimizeRestoredDatabaseMetadata): google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata; + + /** + * Encodes the specified OptimizeRestoredDatabaseMetadata message. Does not implicitly {@link google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata.verify|verify} messages. + * @param message OptimizeRestoredDatabaseMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IOptimizeRestoredDatabaseMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OptimizeRestoredDatabaseMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata.verify|verify} messages. + * @param message OptimizeRestoredDatabaseMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IOptimizeRestoredDatabaseMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OptimizeRestoredDatabaseMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OptimizeRestoredDatabaseMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata; + + /** + * Decodes an OptimizeRestoredDatabaseMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OptimizeRestoredDatabaseMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata; + + /** + * Verifies an OptimizeRestoredDatabaseMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OptimizeRestoredDatabaseMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OptimizeRestoredDatabaseMetadata + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata; + + /** + * Creates a plain object from an OptimizeRestoredDatabaseMetadata message. Also converts values to other types if specified. + * @param message OptimizeRestoredDatabaseMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OptimizeRestoredDatabaseMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OptimizeRestoredDatabaseMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** RestoreSourceType enum. */ + enum RestoreSourceType { + TYPE_UNSPECIFIED = 0, + BACKUP = 1 + } + + /** Properties of a DatabaseRole. */ + interface IDatabaseRole { + + /** DatabaseRole name */ + name?: (string|null); + } + + /** Represents a DatabaseRole. */ + class DatabaseRole implements IDatabaseRole { + + /** + * Constructs a new DatabaseRole. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IDatabaseRole); + + /** DatabaseRole name. */ + public name: string; + + /** + * Creates a new DatabaseRole instance using the specified properties. + * @param [properties] Properties to set + * @returns DatabaseRole instance + */ + public static create(properties?: google.spanner.admin.database.v1.IDatabaseRole): google.spanner.admin.database.v1.DatabaseRole; + + /** + * Encodes the specified DatabaseRole message. Does not implicitly {@link google.spanner.admin.database.v1.DatabaseRole.verify|verify} messages. + * @param message DatabaseRole message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IDatabaseRole, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DatabaseRole message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.DatabaseRole.verify|verify} messages. + * @param message DatabaseRole message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IDatabaseRole, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DatabaseRole message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DatabaseRole + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.DatabaseRole; + + /** + * Decodes a DatabaseRole message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DatabaseRole + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.DatabaseRole; + + /** + * Verifies a DatabaseRole message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DatabaseRole message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DatabaseRole + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.DatabaseRole; + + /** + * Creates a plain object from a DatabaseRole message. Also converts values to other types if specified. + * @param message DatabaseRole + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.DatabaseRole, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DatabaseRole to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DatabaseRole + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListDatabaseRolesRequest. */ + interface IListDatabaseRolesRequest { + + /** ListDatabaseRolesRequest parent */ + parent?: (string|null); + + /** ListDatabaseRolesRequest pageSize */ + pageSize?: (number|null); + + /** ListDatabaseRolesRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListDatabaseRolesRequest. */ + class ListDatabaseRolesRequest implements IListDatabaseRolesRequest { + + /** + * Constructs a new ListDatabaseRolesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IListDatabaseRolesRequest); + + /** ListDatabaseRolesRequest parent. */ + public parent: string; + + /** ListDatabaseRolesRequest pageSize. */ + public pageSize: number; + + /** ListDatabaseRolesRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListDatabaseRolesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDatabaseRolesRequest instance + */ + public static create(properties?: google.spanner.admin.database.v1.IListDatabaseRolesRequest): google.spanner.admin.database.v1.ListDatabaseRolesRequest; + + /** + * Encodes the specified ListDatabaseRolesRequest message. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabaseRolesRequest.verify|verify} messages. + * @param message ListDatabaseRolesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IListDatabaseRolesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDatabaseRolesRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabaseRolesRequest.verify|verify} messages. + * @param message ListDatabaseRolesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IListDatabaseRolesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDatabaseRolesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDatabaseRolesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.ListDatabaseRolesRequest; + + /** + * Decodes a ListDatabaseRolesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDatabaseRolesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.ListDatabaseRolesRequest; + + /** + * Verifies a ListDatabaseRolesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDatabaseRolesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDatabaseRolesRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.ListDatabaseRolesRequest; + + /** + * Creates a plain object from a ListDatabaseRolesRequest message. Also converts values to other types if specified. + * @param message ListDatabaseRolesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.ListDatabaseRolesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDatabaseRolesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDatabaseRolesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListDatabaseRolesResponse. */ + interface IListDatabaseRolesResponse { + + /** ListDatabaseRolesResponse databaseRoles */ + databaseRoles?: (google.spanner.admin.database.v1.IDatabaseRole[]|null); + + /** ListDatabaseRolesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListDatabaseRolesResponse. */ + class ListDatabaseRolesResponse implements IListDatabaseRolesResponse { + + /** + * Constructs a new ListDatabaseRolesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IListDatabaseRolesResponse); + + /** ListDatabaseRolesResponse databaseRoles. */ + public databaseRoles: google.spanner.admin.database.v1.IDatabaseRole[]; + + /** ListDatabaseRolesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListDatabaseRolesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDatabaseRolesResponse instance + */ + public static create(properties?: google.spanner.admin.database.v1.IListDatabaseRolesResponse): google.spanner.admin.database.v1.ListDatabaseRolesResponse; + + /** + * Encodes the specified ListDatabaseRolesResponse message. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabaseRolesResponse.verify|verify} messages. + * @param message ListDatabaseRolesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IListDatabaseRolesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDatabaseRolesResponse message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabaseRolesResponse.verify|verify} messages. + * @param message ListDatabaseRolesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IListDatabaseRolesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDatabaseRolesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDatabaseRolesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.ListDatabaseRolesResponse; + + /** + * Decodes a ListDatabaseRolesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDatabaseRolesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.ListDatabaseRolesResponse; + + /** + * Verifies a ListDatabaseRolesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDatabaseRolesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDatabaseRolesResponse + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.ListDatabaseRolesResponse; + + /** + * Creates a plain object from a ListDatabaseRolesResponse message. Also converts values to other types if specified. + * @param message ListDatabaseRolesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.ListDatabaseRolesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDatabaseRolesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDatabaseRolesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AddSplitPointsRequest. */ + interface IAddSplitPointsRequest { + + /** AddSplitPointsRequest database */ + database?: (string|null); + + /** AddSplitPointsRequest splitPoints */ + splitPoints?: (google.spanner.admin.database.v1.ISplitPoints[]|null); + + /** AddSplitPointsRequest initiator */ + initiator?: (string|null); + } + + /** Represents an AddSplitPointsRequest. */ + class AddSplitPointsRequest implements IAddSplitPointsRequest { + + /** + * Constructs a new AddSplitPointsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IAddSplitPointsRequest); + + /** AddSplitPointsRequest database. */ + public database: string; + + /** AddSplitPointsRequest splitPoints. */ + public splitPoints: google.spanner.admin.database.v1.ISplitPoints[]; + + /** AddSplitPointsRequest initiator. */ + public initiator: string; + + /** + * Creates a new AddSplitPointsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AddSplitPointsRequest instance + */ + public static create(properties?: google.spanner.admin.database.v1.IAddSplitPointsRequest): google.spanner.admin.database.v1.AddSplitPointsRequest; + + /** + * Encodes the specified AddSplitPointsRequest message. Does not implicitly {@link google.spanner.admin.database.v1.AddSplitPointsRequest.verify|verify} messages. + * @param message AddSplitPointsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IAddSplitPointsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AddSplitPointsRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.AddSplitPointsRequest.verify|verify} messages. + * @param message AddSplitPointsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IAddSplitPointsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AddSplitPointsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AddSplitPointsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.AddSplitPointsRequest; + + /** + * Decodes an AddSplitPointsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AddSplitPointsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.AddSplitPointsRequest; + + /** + * Verifies an AddSplitPointsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AddSplitPointsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AddSplitPointsRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.AddSplitPointsRequest; + + /** + * Creates a plain object from an AddSplitPointsRequest message. Also converts values to other types if specified. + * @param message AddSplitPointsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.AddSplitPointsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AddSplitPointsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AddSplitPointsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AddSplitPointsResponse. */ + interface IAddSplitPointsResponse { + } + + /** Represents an AddSplitPointsResponse. */ + class AddSplitPointsResponse implements IAddSplitPointsResponse { + + /** + * Constructs a new AddSplitPointsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IAddSplitPointsResponse); + + /** + * Creates a new AddSplitPointsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns AddSplitPointsResponse instance + */ + public static create(properties?: google.spanner.admin.database.v1.IAddSplitPointsResponse): google.spanner.admin.database.v1.AddSplitPointsResponse; + + /** + * Encodes the specified AddSplitPointsResponse message. Does not implicitly {@link google.spanner.admin.database.v1.AddSplitPointsResponse.verify|verify} messages. + * @param message AddSplitPointsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IAddSplitPointsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AddSplitPointsResponse message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.AddSplitPointsResponse.verify|verify} messages. + * @param message AddSplitPointsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IAddSplitPointsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AddSplitPointsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AddSplitPointsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.AddSplitPointsResponse; + + /** + * Decodes an AddSplitPointsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AddSplitPointsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.AddSplitPointsResponse; + + /** + * Verifies an AddSplitPointsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AddSplitPointsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AddSplitPointsResponse + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.AddSplitPointsResponse; + + /** + * Creates a plain object from an AddSplitPointsResponse message. Also converts values to other types if specified. + * @param message AddSplitPointsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.AddSplitPointsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AddSplitPointsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AddSplitPointsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SplitPoints. */ + interface ISplitPoints { + + /** SplitPoints table */ + table?: (string|null); + + /** SplitPoints index */ + index?: (string|null); + + /** SplitPoints keys */ + keys?: (google.spanner.admin.database.v1.SplitPoints.IKey[]|null); + + /** SplitPoints expireTime */ + expireTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a SplitPoints. */ + class SplitPoints implements ISplitPoints { + + /** + * Constructs a new SplitPoints. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.ISplitPoints); + + /** SplitPoints table. */ + public table: string; + + /** SplitPoints index. */ + public index: string; + + /** SplitPoints keys. */ + public keys: google.spanner.admin.database.v1.SplitPoints.IKey[]; + + /** SplitPoints expireTime. */ + public expireTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new SplitPoints instance using the specified properties. + * @param [properties] Properties to set + * @returns SplitPoints instance + */ + public static create(properties?: google.spanner.admin.database.v1.ISplitPoints): google.spanner.admin.database.v1.SplitPoints; + + /** + * Encodes the specified SplitPoints message. Does not implicitly {@link google.spanner.admin.database.v1.SplitPoints.verify|verify} messages. + * @param message SplitPoints message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.ISplitPoints, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SplitPoints message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.SplitPoints.verify|verify} messages. + * @param message SplitPoints message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.ISplitPoints, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SplitPoints message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SplitPoints + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.SplitPoints; + + /** + * Decodes a SplitPoints message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SplitPoints + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.SplitPoints; + + /** + * Verifies a SplitPoints message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SplitPoints message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SplitPoints + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.SplitPoints; + + /** + * Creates a plain object from a SplitPoints message. Also converts values to other types if specified. + * @param message SplitPoints + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.SplitPoints, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SplitPoints to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SplitPoints + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SplitPoints { + + /** Properties of a Key. */ + interface IKey { + + /** Key keyParts */ + keyParts?: (google.protobuf.IListValue|null); + } + + /** Represents a Key. */ + class Key implements IKey { + + /** + * Constructs a new Key. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.SplitPoints.IKey); + + /** Key keyParts. */ + public keyParts?: (google.protobuf.IListValue|null); + + /** + * Creates a new Key instance using the specified properties. + * @param [properties] Properties to set + * @returns Key instance + */ + public static create(properties?: google.spanner.admin.database.v1.SplitPoints.IKey): google.spanner.admin.database.v1.SplitPoints.Key; + + /** + * Encodes the specified Key message. Does not implicitly {@link google.spanner.admin.database.v1.SplitPoints.Key.verify|verify} messages. + * @param message Key message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.SplitPoints.IKey, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Key message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.SplitPoints.Key.verify|verify} messages. + * @param message Key message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.SplitPoints.IKey, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Key message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.SplitPoints.Key; + + /** + * Decodes a Key message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.SplitPoints.Key; + + /** + * Verifies a Key message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Key message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Key + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.SplitPoints.Key; + + /** + * Creates a plain object from a Key message. Also converts values to other types if specified. + * @param message Key + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.SplitPoints.Key, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Key to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Key + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an InternalUpdateGraphOperationRequest. */ + interface IInternalUpdateGraphOperationRequest { + + /** InternalUpdateGraphOperationRequest database */ + database?: (string|null); + + /** InternalUpdateGraphOperationRequest operationId */ + operationId?: (string|null); + + /** InternalUpdateGraphOperationRequest vmIdentityToken */ + vmIdentityToken?: (string|null); + + /** InternalUpdateGraphOperationRequest progress */ + progress?: (number|null); + + /** InternalUpdateGraphOperationRequest status */ + status?: (google.rpc.IStatus|null); + } + + /** Represents an InternalUpdateGraphOperationRequest. */ + class InternalUpdateGraphOperationRequest implements IInternalUpdateGraphOperationRequest { + + /** + * Constructs a new InternalUpdateGraphOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IInternalUpdateGraphOperationRequest); + + /** InternalUpdateGraphOperationRequest database. */ + public database: string; + + /** InternalUpdateGraphOperationRequest operationId. */ + public operationId: string; + + /** InternalUpdateGraphOperationRequest vmIdentityToken. */ + public vmIdentityToken: string; + + /** InternalUpdateGraphOperationRequest progress. */ + public progress: number; + + /** InternalUpdateGraphOperationRequest status. */ + public status?: (google.rpc.IStatus|null); + + /** + * Creates a new InternalUpdateGraphOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InternalUpdateGraphOperationRequest instance + */ + public static create(properties?: google.spanner.admin.database.v1.IInternalUpdateGraphOperationRequest): google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest; + + /** + * Encodes the specified InternalUpdateGraphOperationRequest message. Does not implicitly {@link google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest.verify|verify} messages. + * @param message InternalUpdateGraphOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IInternalUpdateGraphOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InternalUpdateGraphOperationRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest.verify|verify} messages. + * @param message InternalUpdateGraphOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IInternalUpdateGraphOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InternalUpdateGraphOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InternalUpdateGraphOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest; + + /** + * Decodes an InternalUpdateGraphOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InternalUpdateGraphOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest; + + /** + * Verifies an InternalUpdateGraphOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InternalUpdateGraphOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InternalUpdateGraphOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest; + + /** + * Creates a plain object from an InternalUpdateGraphOperationRequest message. Also converts values to other types if specified. + * @param message InternalUpdateGraphOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InternalUpdateGraphOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InternalUpdateGraphOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an InternalUpdateGraphOperationResponse. */ + interface IInternalUpdateGraphOperationResponse { + } + + /** Represents an InternalUpdateGraphOperationResponse. */ + class InternalUpdateGraphOperationResponse implements IInternalUpdateGraphOperationResponse { + + /** + * Constructs a new InternalUpdateGraphOperationResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IInternalUpdateGraphOperationResponse); + + /** + * Creates a new InternalUpdateGraphOperationResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns InternalUpdateGraphOperationResponse instance + */ + public static create(properties?: google.spanner.admin.database.v1.IInternalUpdateGraphOperationResponse): google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse; + + /** + * Encodes the specified InternalUpdateGraphOperationResponse message. Does not implicitly {@link google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse.verify|verify} messages. + * @param message InternalUpdateGraphOperationResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IInternalUpdateGraphOperationResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InternalUpdateGraphOperationResponse message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse.verify|verify} messages. + * @param message InternalUpdateGraphOperationResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IInternalUpdateGraphOperationResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InternalUpdateGraphOperationResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InternalUpdateGraphOperationResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse; + + /** + * Decodes an InternalUpdateGraphOperationResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InternalUpdateGraphOperationResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse; + + /** + * Verifies an InternalUpdateGraphOperationResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InternalUpdateGraphOperationResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InternalUpdateGraphOperationResponse + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse; + + /** + * Creates a plain object from an InternalUpdateGraphOperationResponse message. Also converts values to other types if specified. + * @param message InternalUpdateGraphOperationResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InternalUpdateGraphOperationResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InternalUpdateGraphOperationResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + } + } + + /** Namespace api. */ + namespace api { + + /** FieldBehavior enum. */ + enum FieldBehavior { + FIELD_BEHAVIOR_UNSPECIFIED = 0, + OPTIONAL = 1, + REQUIRED = 2, + OUTPUT_ONLY = 3, + INPUT_ONLY = 4, + IMMUTABLE = 5, + UNORDERED_LIST = 6, + NON_EMPTY_DEFAULT = 7, + IDENTIFIER = 8 + } + + /** Properties of a ResourceDescriptor. */ + interface IResourceDescriptor { + + /** ResourceDescriptor type */ + type?: (string|null); + + /** ResourceDescriptor pattern */ + pattern?: (string[]|null); + + /** ResourceDescriptor nameField */ + nameField?: (string|null); + + /** ResourceDescriptor history */ + history?: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History|null); + + /** ResourceDescriptor plural */ + plural?: (string|null); + + /** ResourceDescriptor singular */ + singular?: (string|null); + + /** ResourceDescriptor style */ + style?: (google.api.ResourceDescriptor.Style[]|null); + } + + /** Represents a ResourceDescriptor. */ + class ResourceDescriptor implements IResourceDescriptor { + + /** + * Constructs a new ResourceDescriptor. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceDescriptor); + + /** ResourceDescriptor type. */ + public type: string; + + /** ResourceDescriptor pattern. */ + public pattern: string[]; + + /** ResourceDescriptor nameField. */ + public nameField: string; + + /** ResourceDescriptor history. */ + public history: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History); + + /** ResourceDescriptor plural. */ + public plural: string; + + /** ResourceDescriptor singular. */ + public singular: string; + + /** ResourceDescriptor style. */ + public style: google.api.ResourceDescriptor.Style[]; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceDescriptor instance + */ + public static create(properties?: google.api.IResourceDescriptor): google.api.ResourceDescriptor; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceDescriptor; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceDescriptor; + + /** + * Verifies a ResourceDescriptor message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceDescriptor + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceDescriptor; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @param message ResourceDescriptor + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceDescriptor to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceDescriptor + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ResourceDescriptor { + + /** History enum. */ + enum History { + HISTORY_UNSPECIFIED = 0, + ORIGINALLY_SINGLE_PATTERN = 1, + FUTURE_MULTI_PATTERN = 2 + } + + /** Style enum. */ + enum Style { + STYLE_UNSPECIFIED = 0, + DECLARATIVE_FRIENDLY = 1 + } + } + + /** Properties of a ResourceReference. */ + interface IResourceReference { + + /** ResourceReference type */ + type?: (string|null); + + /** ResourceReference childType */ + childType?: (string|null); + } + + /** Represents a ResourceReference. */ + class ResourceReference implements IResourceReference { + + /** + * Constructs a new ResourceReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceReference); + + /** ResourceReference type. */ + public type: string; + + /** ResourceReference childType. */ + public childType: string; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceReference instance + */ + public static create(properties?: google.api.IResourceReference): google.api.ResourceReference; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceReference; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceReference; + + /** + * Verifies a ResourceReference message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceReference + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceReference; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @param message ResourceReference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceReference + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Http. */ + interface IHttp { + + /** Http rules */ + rules?: (google.api.IHttpRule[]|null); + + /** Http fullyDecodeReservedExpansion */ + fullyDecodeReservedExpansion?: (boolean|null); + } + + /** Represents a Http. */ + class Http implements IHttp { + + /** + * Constructs a new Http. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttp); + + /** Http rules. */ + public rules: google.api.IHttpRule[]; + + /** Http fullyDecodeReservedExpansion. */ + public fullyDecodeReservedExpansion: boolean; + + /** + * Creates a new Http instance using the specified properties. + * @param [properties] Properties to set + * @returns Http instance + */ + public static create(properties?: google.api.IHttp): google.api.Http; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Http message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Http; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Http; + + /** + * Verifies a Http message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Http + */ + public static fromObject(object: { [k: string]: any }): google.api.Http; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @param message Http + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Http to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Http + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a HttpRule. */ + interface IHttpRule { + + /** HttpRule selector */ + selector?: (string|null); + + /** HttpRule get */ + get?: (string|null); + + /** HttpRule put */ + put?: (string|null); + + /** HttpRule post */ + post?: (string|null); + + /** HttpRule delete */ + "delete"?: (string|null); + + /** HttpRule patch */ + patch?: (string|null); + + /** HttpRule custom */ + custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body */ + body?: (string|null); + + /** HttpRule responseBody */ + responseBody?: (string|null); + + /** HttpRule additionalBindings */ + additionalBindings?: (google.api.IHttpRule[]|null); + } + + /** Represents a HttpRule. */ + class HttpRule implements IHttpRule { + + /** + * Constructs a new HttpRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttpRule); + + /** HttpRule selector. */ + public selector: string; + + /** HttpRule get. */ + public get?: (string|null); + + /** HttpRule put. */ + public put?: (string|null); + + /** HttpRule post. */ + public post?: (string|null); + + /** HttpRule delete. */ + public delete?: (string|null); + + /** HttpRule patch. */ + public patch?: (string|null); + + /** HttpRule custom. */ + public custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body. */ + public body: string; + + /** HttpRule responseBody. */ + public responseBody: string; + + /** HttpRule additionalBindings. */ + public additionalBindings: google.api.IHttpRule[]; + + /** HttpRule pattern. */ + public pattern?: ("get"|"put"|"post"|"delete"|"patch"|"custom"); + + /** + * Creates a new HttpRule instance using the specified properties. + * @param [properties] Properties to set + * @returns HttpRule instance + */ + public static create(properties?: google.api.IHttpRule): google.api.HttpRule; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.HttpRule; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.HttpRule; + + /** + * Verifies a HttpRule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HttpRule + */ + public static fromObject(object: { [k: string]: any }): google.api.HttpRule; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @param message HttpRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.HttpRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HttpRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HttpRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomHttpPattern. */ + interface ICustomHttpPattern { + + /** CustomHttpPattern kind */ + kind?: (string|null); + + /** CustomHttpPattern path */ + path?: (string|null); + } + + /** Represents a CustomHttpPattern. */ + class CustomHttpPattern implements ICustomHttpPattern { + + /** + * Constructs a new CustomHttpPattern. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICustomHttpPattern); + + /** CustomHttpPattern kind. */ + public kind: string; + + /** CustomHttpPattern path. */ + public path: string; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomHttpPattern instance + */ + public static create(properties?: google.api.ICustomHttpPattern): google.api.CustomHttpPattern; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CustomHttpPattern; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CustomHttpPattern; + + /** + * Verifies a CustomHttpPattern message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomHttpPattern + */ + public static fromObject(object: { [k: string]: any }): google.api.CustomHttpPattern; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @param message CustomHttpPattern + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CustomHttpPattern, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomHttpPattern to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomHttpPattern + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CommonLanguageSettings. */ + interface ICommonLanguageSettings { + + /** CommonLanguageSettings referenceDocsUri */ + referenceDocsUri?: (string|null); + + /** CommonLanguageSettings destinations */ + destinations?: (google.api.ClientLibraryDestination[]|null); + } + + /** Represents a CommonLanguageSettings. */ + class CommonLanguageSettings implements ICommonLanguageSettings { + + /** + * Constructs a new CommonLanguageSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICommonLanguageSettings); + + /** CommonLanguageSettings referenceDocsUri. */ + public referenceDocsUri: string; + + /** CommonLanguageSettings destinations. */ + public destinations: google.api.ClientLibraryDestination[]; + + /** + * Creates a new CommonLanguageSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns CommonLanguageSettings instance + */ + public static create(properties?: google.api.ICommonLanguageSettings): google.api.CommonLanguageSettings; + + /** + * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @param message CommonLanguageSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @param message CommonLanguageSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CommonLanguageSettings; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CommonLanguageSettings; + + /** + * Verifies a CommonLanguageSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CommonLanguageSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.CommonLanguageSettings; + + /** + * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. + * @param message CommonLanguageSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CommonLanguageSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CommonLanguageSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CommonLanguageSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ClientLibrarySettings. */ + interface IClientLibrarySettings { + + /** ClientLibrarySettings version */ + version?: (string|null); + + /** ClientLibrarySettings launchStage */ + launchStage?: (google.api.LaunchStage|keyof typeof google.api.LaunchStage|null); + + /** ClientLibrarySettings restNumericEnums */ + restNumericEnums?: (boolean|null); + + /** ClientLibrarySettings javaSettings */ + javaSettings?: (google.api.IJavaSettings|null); + + /** ClientLibrarySettings cppSettings */ + cppSettings?: (google.api.ICppSettings|null); + + /** ClientLibrarySettings phpSettings */ + phpSettings?: (google.api.IPhpSettings|null); + + /** ClientLibrarySettings pythonSettings */ + pythonSettings?: (google.api.IPythonSettings|null); + + /** ClientLibrarySettings nodeSettings */ + nodeSettings?: (google.api.INodeSettings|null); + + /** ClientLibrarySettings dotnetSettings */ + dotnetSettings?: (google.api.IDotnetSettings|null); + + /** ClientLibrarySettings rubySettings */ + rubySettings?: (google.api.IRubySettings|null); + + /** ClientLibrarySettings goSettings */ + goSettings?: (google.api.IGoSettings|null); + } + + /** Represents a ClientLibrarySettings. */ + class ClientLibrarySettings implements IClientLibrarySettings { + + /** + * Constructs a new ClientLibrarySettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IClientLibrarySettings); + + /** ClientLibrarySettings version. */ + public version: string; + + /** ClientLibrarySettings launchStage. */ + public launchStage: (google.api.LaunchStage|keyof typeof google.api.LaunchStage); + + /** ClientLibrarySettings restNumericEnums. */ + public restNumericEnums: boolean; + + /** ClientLibrarySettings javaSettings. */ + public javaSettings?: (google.api.IJavaSettings|null); + + /** ClientLibrarySettings cppSettings. */ + public cppSettings?: (google.api.ICppSettings|null); + + /** ClientLibrarySettings phpSettings. */ + public phpSettings?: (google.api.IPhpSettings|null); + + /** ClientLibrarySettings pythonSettings. */ + public pythonSettings?: (google.api.IPythonSettings|null); + + /** ClientLibrarySettings nodeSettings. */ + public nodeSettings?: (google.api.INodeSettings|null); + + /** ClientLibrarySettings dotnetSettings. */ + public dotnetSettings?: (google.api.IDotnetSettings|null); + + /** ClientLibrarySettings rubySettings. */ + public rubySettings?: (google.api.IRubySettings|null); + + /** ClientLibrarySettings goSettings. */ + public goSettings?: (google.api.IGoSettings|null); + + /** + * Creates a new ClientLibrarySettings instance using the specified properties. + * @param [properties] Properties to set + * @returns ClientLibrarySettings instance + */ + public static create(properties?: google.api.IClientLibrarySettings): google.api.ClientLibrarySettings; + + /** + * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @param message ClientLibrarySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @param message ClientLibrarySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ClientLibrarySettings; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ClientLibrarySettings; + + /** + * Verifies a ClientLibrarySettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClientLibrarySettings + */ + public static fromObject(object: { [k: string]: any }): google.api.ClientLibrarySettings; + + /** + * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. + * @param message ClientLibrarySettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ClientLibrarySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClientLibrarySettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClientLibrarySettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Publishing. */ + interface IPublishing { + + /** Publishing methodSettings */ + methodSettings?: (google.api.IMethodSettings[]|null); + + /** Publishing newIssueUri */ + newIssueUri?: (string|null); + + /** Publishing documentationUri */ + documentationUri?: (string|null); + + /** Publishing apiShortName */ + apiShortName?: (string|null); + + /** Publishing githubLabel */ + githubLabel?: (string|null); + + /** Publishing codeownerGithubTeams */ + codeownerGithubTeams?: (string[]|null); + + /** Publishing docTagPrefix */ + docTagPrefix?: (string|null); + + /** Publishing organization */ + organization?: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization|null); + + /** Publishing librarySettings */ + librarySettings?: (google.api.IClientLibrarySettings[]|null); + + /** Publishing protoReferenceDocumentationUri */ + protoReferenceDocumentationUri?: (string|null); + + /** Publishing restReferenceDocumentationUri */ + restReferenceDocumentationUri?: (string|null); + } + + /** Represents a Publishing. */ + class Publishing implements IPublishing { + + /** + * Constructs a new Publishing. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPublishing); + + /** Publishing methodSettings. */ + public methodSettings: google.api.IMethodSettings[]; + + /** Publishing newIssueUri. */ + public newIssueUri: string; + + /** Publishing documentationUri. */ + public documentationUri: string; + + /** Publishing apiShortName. */ + public apiShortName: string; + + /** Publishing githubLabel. */ + public githubLabel: string; + + /** Publishing codeownerGithubTeams. */ + public codeownerGithubTeams: string[]; + + /** Publishing docTagPrefix. */ + public docTagPrefix: string; + + /** Publishing organization. */ + public organization: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization); + + /** Publishing librarySettings. */ + public librarySettings: google.api.IClientLibrarySettings[]; + + /** Publishing protoReferenceDocumentationUri. */ + public protoReferenceDocumentationUri: string; + + /** Publishing restReferenceDocumentationUri. */ + public restReferenceDocumentationUri: string; + + /** + * Creates a new Publishing instance using the specified properties. + * @param [properties] Properties to set + * @returns Publishing instance + */ + public static create(properties?: google.api.IPublishing): google.api.Publishing; + + /** + * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @param message Publishing message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @param message Publishing message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Publishing message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Publishing; + + /** + * Decodes a Publishing message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Publishing; + + /** + * Verifies a Publishing message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Publishing message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Publishing + */ + public static fromObject(object: { [k: string]: any }): google.api.Publishing; + + /** + * Creates a plain object from a Publishing message. Also converts values to other types if specified. + * @param message Publishing + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Publishing, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Publishing to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Publishing + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a JavaSettings. */ + interface IJavaSettings { + + /** JavaSettings libraryPackage */ + libraryPackage?: (string|null); + + /** JavaSettings serviceClassNames */ + serviceClassNames?: ({ [k: string]: string }|null); + + /** JavaSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a JavaSettings. */ + class JavaSettings implements IJavaSettings { + + /** + * Constructs a new JavaSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IJavaSettings); + + /** JavaSettings libraryPackage. */ + public libraryPackage: string; + + /** JavaSettings serviceClassNames. */ + public serviceClassNames: { [k: string]: string }; + + /** JavaSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new JavaSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns JavaSettings instance + */ + public static create(properties?: google.api.IJavaSettings): google.api.JavaSettings; + + /** + * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @param message JavaSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @param message JavaSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JavaSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.JavaSettings; + + /** + * Decodes a JavaSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.JavaSettings; + + /** + * Verifies a JavaSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JavaSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.JavaSettings; + + /** + * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. + * @param message JavaSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.JavaSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JavaSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JavaSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CppSettings. */ + interface ICppSettings { + + /** CppSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a CppSettings. */ + class CppSettings implements ICppSettings { + + /** + * Constructs a new CppSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICppSettings); + + /** CppSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new CppSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns CppSettings instance + */ + public static create(properties?: google.api.ICppSettings): google.api.CppSettings; + + /** + * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @param message CppSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @param message CppSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CppSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CppSettings; + + /** + * Decodes a CppSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CppSettings; + + /** + * Verifies a CppSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CppSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.CppSettings; + + /** + * Creates a plain object from a CppSettings message. Also converts values to other types if specified. + * @param message CppSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CppSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CppSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CppSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PhpSettings. */ + interface IPhpSettings { + + /** PhpSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a PhpSettings. */ + class PhpSettings implements IPhpSettings { + + /** + * Constructs a new PhpSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPhpSettings); + + /** PhpSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new PhpSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns PhpSettings instance + */ + public static create(properties?: google.api.IPhpSettings): google.api.PhpSettings; + + /** + * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @param message PhpSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @param message PhpSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PhpSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PhpSettings; + + /** + * Decodes a PhpSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PhpSettings; + + /** + * Verifies a PhpSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PhpSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.PhpSettings; + + /** + * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. + * @param message PhpSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PhpSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PhpSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PhpSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PythonSettings. */ + interface IPythonSettings { + + /** PythonSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a PythonSettings. */ + class PythonSettings implements IPythonSettings { + + /** + * Constructs a new PythonSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPythonSettings); + + /** PythonSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new PythonSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns PythonSettings instance + */ + public static create(properties?: google.api.IPythonSettings): google.api.PythonSettings; + + /** + * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @param message PythonSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @param message PythonSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PythonSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PythonSettings; + + /** + * Decodes a PythonSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PythonSettings; + + /** + * Verifies a PythonSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PythonSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.PythonSettings; + + /** + * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. + * @param message PythonSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PythonSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PythonSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PythonSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeSettings. */ + interface INodeSettings { + + /** NodeSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a NodeSettings. */ + class NodeSettings implements INodeSettings { + + /** + * Constructs a new NodeSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.INodeSettings); + + /** NodeSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new NodeSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeSettings instance + */ + public static create(properties?: google.api.INodeSettings): google.api.NodeSettings; + + /** + * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @param message NodeSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @param message NodeSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.NodeSettings; + + /** + * Decodes a NodeSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.NodeSettings; + + /** + * Verifies a NodeSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NodeSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.NodeSettings; + + /** + * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. + * @param message NodeSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.NodeSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NodeSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NodeSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DotnetSettings. */ + interface IDotnetSettings { + + /** DotnetSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + + /** DotnetSettings renamedServices */ + renamedServices?: ({ [k: string]: string }|null); + + /** DotnetSettings renamedResources */ + renamedResources?: ({ [k: string]: string }|null); + + /** DotnetSettings ignoredResources */ + ignoredResources?: (string[]|null); + + /** DotnetSettings forcedNamespaceAliases */ + forcedNamespaceAliases?: (string[]|null); + + /** DotnetSettings handwrittenSignatures */ + handwrittenSignatures?: (string[]|null); + } + + /** Represents a DotnetSettings. */ + class DotnetSettings implements IDotnetSettings { + + /** + * Constructs a new DotnetSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IDotnetSettings); + + /** DotnetSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** DotnetSettings renamedServices. */ + public renamedServices: { [k: string]: string }; + + /** DotnetSettings renamedResources. */ + public renamedResources: { [k: string]: string }; + + /** DotnetSettings ignoredResources. */ + public ignoredResources: string[]; + + /** DotnetSettings forcedNamespaceAliases. */ + public forcedNamespaceAliases: string[]; + + /** DotnetSettings handwrittenSignatures. */ + public handwrittenSignatures: string[]; + + /** + * Creates a new DotnetSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns DotnetSettings instance + */ + public static create(properties?: google.api.IDotnetSettings): google.api.DotnetSettings; + + /** + * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @param message DotnetSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @param message DotnetSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.DotnetSettings; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.DotnetSettings; + + /** + * Verifies a DotnetSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DotnetSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.DotnetSettings; + + /** + * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. + * @param message DotnetSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.DotnetSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DotnetSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DotnetSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RubySettings. */ + interface IRubySettings { + + /** RubySettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a RubySettings. */ + class RubySettings implements IRubySettings { + + /** + * Constructs a new RubySettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IRubySettings); + + /** RubySettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new RubySettings instance using the specified properties. + * @param [properties] Properties to set + * @returns RubySettings instance + */ + public static create(properties?: google.api.IRubySettings): google.api.RubySettings; + + /** + * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @param message RubySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @param message RubySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RubySettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.RubySettings; + + /** + * Decodes a RubySettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.RubySettings; + + /** + * Verifies a RubySettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RubySettings + */ + public static fromObject(object: { [k: string]: any }): google.api.RubySettings; + + /** + * Creates a plain object from a RubySettings message. Also converts values to other types if specified. + * @param message RubySettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.RubySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RubySettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RubySettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GoSettings. */ + interface IGoSettings { + + /** GoSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a GoSettings. */ + class GoSettings implements IGoSettings { + + /** + * Constructs a new GoSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IGoSettings); + + /** GoSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new GoSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns GoSettings instance + */ + public static create(properties?: google.api.IGoSettings): google.api.GoSettings; + + /** + * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @param message GoSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @param message GoSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GoSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.GoSettings; + + /** + * Decodes a GoSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.GoSettings; + + /** + * Verifies a GoSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GoSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.GoSettings; + + /** + * Creates a plain object from a GoSettings message. Also converts values to other types if specified. + * @param message GoSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.GoSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GoSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GoSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodSettings. */ + interface IMethodSettings { + + /** MethodSettings selector */ + selector?: (string|null); + + /** MethodSettings longRunning */ + longRunning?: (google.api.MethodSettings.ILongRunning|null); + + /** MethodSettings autoPopulatedFields */ + autoPopulatedFields?: (string[]|null); + } + + /** Represents a MethodSettings. */ + class MethodSettings implements IMethodSettings { + + /** + * Constructs a new MethodSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IMethodSettings); + + /** MethodSettings selector. */ + public selector: string; + + /** MethodSettings longRunning. */ + public longRunning?: (google.api.MethodSettings.ILongRunning|null); + + /** MethodSettings autoPopulatedFields. */ + public autoPopulatedFields: string[]; + + /** + * Creates a new MethodSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodSettings instance + */ + public static create(properties?: google.api.IMethodSettings): google.api.MethodSettings; + + /** + * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @param message MethodSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @param message MethodSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.MethodSettings; + + /** + * Decodes a MethodSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.MethodSettings; + + /** + * Verifies a MethodSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.MethodSettings; + + /** + * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. + * @param message MethodSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.MethodSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MethodSettings { + + /** Properties of a LongRunning. */ + interface ILongRunning { + + /** LongRunning initialPollDelay */ + initialPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning pollDelayMultiplier */ + pollDelayMultiplier?: (number|null); + + /** LongRunning maxPollDelay */ + maxPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning totalPollTimeout */ + totalPollTimeout?: (google.protobuf.IDuration|null); + } + + /** Represents a LongRunning. */ + class LongRunning implements ILongRunning { + + /** + * Constructs a new LongRunning. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.MethodSettings.ILongRunning); + + /** LongRunning initialPollDelay. */ + public initialPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning pollDelayMultiplier. */ + public pollDelayMultiplier: number; + + /** LongRunning maxPollDelay. */ + public maxPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning totalPollTimeout. */ + public totalPollTimeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new LongRunning instance using the specified properties. + * @param [properties] Properties to set + * @returns LongRunning instance + */ + public static create(properties?: google.api.MethodSettings.ILongRunning): google.api.MethodSettings.LongRunning; + + /** + * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @param message LongRunning message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @param message LongRunning message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LongRunning message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.MethodSettings.LongRunning; + + /** + * Decodes a LongRunning message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.MethodSettings.LongRunning; + + /** + * Verifies a LongRunning message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LongRunning + */ + public static fromObject(object: { [k: string]: any }): google.api.MethodSettings.LongRunning; + + /** + * Creates a plain object from a LongRunning message. Also converts values to other types if specified. + * @param message LongRunning + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.MethodSettings.LongRunning, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LongRunning to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LongRunning + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** ClientLibraryOrganization enum. */ + enum ClientLibraryOrganization { + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0, + CLOUD = 1, + ADS = 2, + PHOTOS = 3, + STREET_VIEW = 4, + SHOPPING = 5, + GEO = 6, + GENERATIVE_AI = 7 + } + + /** ClientLibraryDestination enum. */ + enum ClientLibraryDestination { + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0, + GITHUB = 10, + PACKAGE_MANAGER = 20 + } + + /** LaunchStage enum. */ + enum LaunchStage { + LAUNCH_STAGE_UNSPECIFIED = 0, + UNIMPLEMENTED = 6, + PRELAUNCH = 7, + EARLY_ACCESS = 1, + ALPHA = 2, + BETA = 3, + GA = 4, + DEPRECATED = 5 + } + } + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a FileDescriptorSet. */ + interface IFileDescriptorSet { + + /** FileDescriptorSet file */ + file?: (google.protobuf.IFileDescriptorProto[]|null); + } + + /** Represents a FileDescriptorSet. */ + class FileDescriptorSet implements IFileDescriptorSet { + + /** + * Constructs a new FileDescriptorSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorSet); + + /** FileDescriptorSet file. */ + public file: google.protobuf.IFileDescriptorProto[]; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorSet instance + */ + public static create(properties?: google.protobuf.IFileDescriptorSet): google.protobuf.FileDescriptorSet; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorSet; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorSet; + + /** + * Verifies a FileDescriptorSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorSet + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorSet; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @param message FileDescriptorSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileDescriptorSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Edition enum. */ + enum Edition { + EDITION_UNKNOWN = 0, + EDITION_PROTO2 = 998, + EDITION_PROTO3 = 999, + EDITION_2023 = 1000, + EDITION_2024 = 1001, + EDITION_1_TEST_ONLY = 1, + EDITION_2_TEST_ONLY = 2, + EDITION_99997_TEST_ONLY = 99997, + EDITION_99998_TEST_ONLY = 99998, + EDITION_99999_TEST_ONLY = 99999, + EDITION_MAX = 2147483647 + } + + /** Properties of a FileDescriptorProto. */ + interface IFileDescriptorProto { + + /** FileDescriptorProto name */ + name?: (string|null); + + /** FileDescriptorProto package */ + "package"?: (string|null); + + /** FileDescriptorProto dependency */ + dependency?: (string[]|null); + + /** FileDescriptorProto publicDependency */ + publicDependency?: (number[]|null); + + /** FileDescriptorProto weakDependency */ + weakDependency?: (number[]|null); + + /** FileDescriptorProto messageType */ + messageType?: (google.protobuf.IDescriptorProto[]|null); + + /** FileDescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** FileDescriptorProto service */ + service?: (google.protobuf.IServiceDescriptorProto[]|null); + + /** FileDescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** FileDescriptorProto options */ + options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo */ + sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax */ + syntax?: (string|null); + + /** FileDescriptorProto edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + } + + /** Represents a FileDescriptorProto. */ + class FileDescriptorProto implements IFileDescriptorProto { + + /** + * Constructs a new FileDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorProto); + + /** FileDescriptorProto name. */ + public name: string; + + /** FileDescriptorProto package. */ + public package: string; + + /** FileDescriptorProto dependency. */ + public dependency: string[]; + + /** FileDescriptorProto publicDependency. */ + public publicDependency: number[]; + + /** FileDescriptorProto weakDependency. */ + public weakDependency: number[]; + + /** FileDescriptorProto messageType. */ + public messageType: google.protobuf.IDescriptorProto[]; + + /** FileDescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** FileDescriptorProto service. */ + public service: google.protobuf.IServiceDescriptorProto[]; + + /** FileDescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** FileDescriptorProto options. */ + public options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo. */ + public sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax. */ + public syntax: string; + + /** FileDescriptorProto edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFileDescriptorProto): google.protobuf.FileDescriptorProto; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorProto; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorProto; + + /** + * Verifies a FileDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorProto; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @param message FileDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DescriptorProto. */ + interface IDescriptorProto { + + /** DescriptorProto name */ + name?: (string|null); + + /** DescriptorProto field */ + field?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto nestedType */ + nestedType?: (google.protobuf.IDescriptorProto[]|null); + + /** DescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** DescriptorProto extensionRange */ + extensionRange?: (google.protobuf.DescriptorProto.IExtensionRange[]|null); + + /** DescriptorProto oneofDecl */ + oneofDecl?: (google.protobuf.IOneofDescriptorProto[]|null); + + /** DescriptorProto options */ + options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange */ + reservedRange?: (google.protobuf.DescriptorProto.IReservedRange[]|null); + + /** DescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents a DescriptorProto. */ + class DescriptorProto implements IDescriptorProto { + + /** + * Constructs a new DescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDescriptorProto); + + /** DescriptorProto name. */ + public name: string; + + /** DescriptorProto field. */ + public field: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto nestedType. */ + public nestedType: google.protobuf.IDescriptorProto[]; + + /** DescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** DescriptorProto extensionRange. */ + public extensionRange: google.protobuf.DescriptorProto.IExtensionRange[]; + + /** DescriptorProto oneofDecl. */ + public oneofDecl: google.protobuf.IOneofDescriptorProto[]; + + /** DescriptorProto options. */ + public options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange. */ + public reservedRange: google.protobuf.DescriptorProto.IReservedRange[]; + + /** DescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns DescriptorProto instance + */ + public static create(properties?: google.protobuf.IDescriptorProto): google.protobuf.DescriptorProto; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto; + + /** + * Verifies a DescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @param message DescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DescriptorProto { + + /** Properties of an ExtensionRange. */ + interface IExtensionRange { + + /** ExtensionRange start */ + start?: (number|null); + + /** ExtensionRange end */ + end?: (number|null); + + /** ExtensionRange options */ + options?: (google.protobuf.IExtensionRangeOptions|null); + } + + /** Represents an ExtensionRange. */ + class ExtensionRange implements IExtensionRange { + + /** + * Constructs a new ExtensionRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange); + + /** ExtensionRange start. */ + public start: number; + + /** ExtensionRange end. */ + public end: number; + + /** ExtensionRange options. */ + public options?: (google.protobuf.IExtensionRangeOptions|null); + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IExtensionRange): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Verifies an ExtensionRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @param message ExtensionRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ExtensionRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtensionRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReservedRange. */ + interface IReservedRange { + + /** ReservedRange start */ + start?: (number|null); + + /** ReservedRange end */ + end?: (number|null); + } + + /** Represents a ReservedRange. */ + class ReservedRange implements IReservedRange { + + /** + * Constructs a new ReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IReservedRange); + + /** ReservedRange start. */ + public start: number; + + /** ReservedRange end. */ + public end: number; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ReservedRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IReservedRange): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Verifies a ReservedRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @param message ReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ExtensionRangeOptions. */ + interface IExtensionRangeOptions { + + /** ExtensionRangeOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** ExtensionRangeOptions declaration */ + declaration?: (google.protobuf.ExtensionRangeOptions.IDeclaration[]|null); + + /** ExtensionRangeOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** ExtensionRangeOptions verification */ + verification?: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState|null); + } + + /** Represents an ExtensionRangeOptions. */ + class ExtensionRangeOptions implements IExtensionRangeOptions { + + /** + * Constructs a new ExtensionRangeOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IExtensionRangeOptions); + + /** ExtensionRangeOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** ExtensionRangeOptions declaration. */ + public declaration: google.protobuf.ExtensionRangeOptions.IDeclaration[]; + + /** ExtensionRangeOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** ExtensionRangeOptions verification. */ + public verification: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState); + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRangeOptions instance + */ + public static create(properties?: google.protobuf.IExtensionRangeOptions): google.protobuf.ExtensionRangeOptions; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions; + + /** + * Verifies an ExtensionRangeOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRangeOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @param message ExtensionRangeOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ExtensionRangeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ExtensionRangeOptions { + + /** Properties of a Declaration. */ + interface IDeclaration { + + /** Declaration number */ + number?: (number|null); + + /** Declaration fullName */ + fullName?: (string|null); + + /** Declaration type */ + type?: (string|null); + + /** Declaration reserved */ + reserved?: (boolean|null); + + /** Declaration repeated */ + repeated?: (boolean|null); + } + + /** Represents a Declaration. */ + class Declaration implements IDeclaration { + + /** + * Constructs a new Declaration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration); + + /** Declaration number. */ + public number: number; + + /** Declaration fullName. */ + public fullName: string; + + /** Declaration type. */ + public type: string; + + /** Declaration reserved. */ + public reserved: boolean; + + /** Declaration repeated. */ + public repeated: boolean; + + /** + * Creates a new Declaration instance using the specified properties. + * @param [properties] Properties to set + * @returns Declaration instance + */ + public static create(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @param message Declaration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @param message Declaration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Declaration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Decodes a Declaration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Verifies a Declaration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Declaration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Declaration + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Creates a plain object from a Declaration message. Also converts values to other types if specified. + * @param message Declaration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ExtensionRangeOptions.Declaration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Declaration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Declaration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** VerificationState enum. */ + enum VerificationState { + DECLARATION = 0, + UNVERIFIED = 1 + } + } + + /** Properties of a FieldDescriptorProto. */ + interface IFieldDescriptorProto { + + /** FieldDescriptorProto name */ + name?: (string|null); + + /** FieldDescriptorProto number */ + number?: (number|null); + + /** FieldDescriptorProto label */ + label?: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label|null); + + /** FieldDescriptorProto type */ + type?: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type|null); + + /** FieldDescriptorProto typeName */ + typeName?: (string|null); + + /** FieldDescriptorProto extendee */ + extendee?: (string|null); + + /** FieldDescriptorProto defaultValue */ + defaultValue?: (string|null); + + /** FieldDescriptorProto oneofIndex */ + oneofIndex?: (number|null); + + /** FieldDescriptorProto jsonName */ + jsonName?: (string|null); + + /** FieldDescriptorProto options */ + options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional */ + proto3Optional?: (boolean|null); + } + + /** Represents a FieldDescriptorProto. */ + class FieldDescriptorProto implements IFieldDescriptorProto { + + /** + * Constructs a new FieldDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldDescriptorProto); + + /** FieldDescriptorProto name. */ + public name: string; + + /** FieldDescriptorProto number. */ + public number: number; + + /** FieldDescriptorProto label. */ + public label: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label); + + /** FieldDescriptorProto type. */ + public type: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type); + + /** FieldDescriptorProto typeName. */ + public typeName: string; + + /** FieldDescriptorProto extendee. */ + public extendee: string; + + /** FieldDescriptorProto defaultValue. */ + public defaultValue: string; + + /** FieldDescriptorProto oneofIndex. */ + public oneofIndex: number; + + /** FieldDescriptorProto jsonName. */ + public jsonName: string; + + /** FieldDescriptorProto options. */ + public options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional. */ + public proto3Optional: boolean; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFieldDescriptorProto): google.protobuf.FieldDescriptorProto; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldDescriptorProto; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldDescriptorProto; + + /** + * Verifies a FieldDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @param message FieldDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldDescriptorProto { + + /** Type enum. */ + enum Type { + TYPE_DOUBLE = 1, + TYPE_FLOAT = 2, + TYPE_INT64 = 3, + TYPE_UINT64 = 4, + TYPE_INT32 = 5, + TYPE_FIXED64 = 6, + TYPE_FIXED32 = 7, + TYPE_BOOL = 8, + TYPE_STRING = 9, + TYPE_GROUP = 10, + TYPE_MESSAGE = 11, + TYPE_BYTES = 12, + TYPE_UINT32 = 13, + TYPE_ENUM = 14, + TYPE_SFIXED32 = 15, + TYPE_SFIXED64 = 16, + TYPE_SINT32 = 17, + TYPE_SINT64 = 18 + } + + /** Label enum. */ + enum Label { + LABEL_OPTIONAL = 1, + LABEL_REPEATED = 3, + LABEL_REQUIRED = 2 + } + } + + /** Properties of an OneofDescriptorProto. */ + interface IOneofDescriptorProto { + + /** OneofDescriptorProto name */ + name?: (string|null); + + /** OneofDescriptorProto options */ + options?: (google.protobuf.IOneofOptions|null); + } + + /** Represents an OneofDescriptorProto. */ + class OneofDescriptorProto implements IOneofDescriptorProto { + + /** + * Constructs a new OneofDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofDescriptorProto); + + /** OneofDescriptorProto name. */ + public name: string; + + /** OneofDescriptorProto options. */ + public options?: (google.protobuf.IOneofOptions|null); + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofDescriptorProto instance + */ + public static create(properties?: google.protobuf.IOneofDescriptorProto): google.protobuf.OneofDescriptorProto; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofDescriptorProto; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofDescriptorProto; + + /** + * Verifies an OneofDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofDescriptorProto; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @param message OneofDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneofDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumDescriptorProto. */ + interface IEnumDescriptorProto { + + /** EnumDescriptorProto name */ + name?: (string|null); + + /** EnumDescriptorProto value */ + value?: (google.protobuf.IEnumValueDescriptorProto[]|null); + + /** EnumDescriptorProto options */ + options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange */ + reservedRange?: (google.protobuf.EnumDescriptorProto.IEnumReservedRange[]|null); + + /** EnumDescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents an EnumDescriptorProto. */ + class EnumDescriptorProto implements IEnumDescriptorProto { + + /** + * Constructs a new EnumDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumDescriptorProto); + + /** EnumDescriptorProto name. */ + public name: string; + + /** EnumDescriptorProto value. */ + public value: google.protobuf.IEnumValueDescriptorProto[]; + + /** EnumDescriptorProto options. */ + public options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange. */ + public reservedRange: google.protobuf.EnumDescriptorProto.IEnumReservedRange[]; + + /** EnumDescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumDescriptorProto): google.protobuf.EnumDescriptorProto; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto; + + /** + * Verifies an EnumDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @param message EnumDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EnumDescriptorProto { + + /** Properties of an EnumReservedRange. */ + interface IEnumReservedRange { + + /** EnumReservedRange start */ + start?: (number|null); + + /** EnumReservedRange end */ + end?: (number|null); + } + + /** Represents an EnumReservedRange. */ + class EnumReservedRange implements IEnumReservedRange { + + /** + * Constructs a new EnumReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange); + + /** EnumReservedRange start. */ + public start: number; + + /** EnumReservedRange end. */ + public end: number; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumReservedRange instance + */ + public static create(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Verifies an EnumReservedRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @param message EnumReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto.EnumReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an EnumValueDescriptorProto. */ + interface IEnumValueDescriptorProto { + + /** EnumValueDescriptorProto name */ + name?: (string|null); + + /** EnumValueDescriptorProto number */ + number?: (number|null); + + /** EnumValueDescriptorProto options */ + options?: (google.protobuf.IEnumValueOptions|null); + } + + /** Represents an EnumValueDescriptorProto. */ + class EnumValueDescriptorProto implements IEnumValueDescriptorProto { + + /** + * Constructs a new EnumValueDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueDescriptorProto); + + /** EnumValueDescriptorProto name. */ + public name: string; + + /** EnumValueDescriptorProto number. */ + public number: number; + + /** EnumValueDescriptorProto options. */ + public options?: (google.protobuf.IEnumValueOptions|null); + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumValueDescriptorProto): google.protobuf.EnumValueDescriptorProto; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueDescriptorProto; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueDescriptorProto; + + /** + * Verifies an EnumValueDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueDescriptorProto; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @param message EnumValueDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceDescriptorProto. */ + interface IServiceDescriptorProto { + + /** ServiceDescriptorProto name */ + name?: (string|null); + + /** ServiceDescriptorProto method */ + method?: (google.protobuf.IMethodDescriptorProto[]|null); + + /** ServiceDescriptorProto options */ + options?: (google.protobuf.IServiceOptions|null); + } + + /** Represents a ServiceDescriptorProto. */ + class ServiceDescriptorProto implements IServiceDescriptorProto { + + /** + * Constructs a new ServiceDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceDescriptorProto); + + /** ServiceDescriptorProto name. */ + public name: string; + + /** ServiceDescriptorProto method. */ + public method: google.protobuf.IMethodDescriptorProto[]; + + /** ServiceDescriptorProto options. */ + public options?: (google.protobuf.IServiceOptions|null); + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceDescriptorProto instance + */ + public static create(properties?: google.protobuf.IServiceDescriptorProto): google.protobuf.ServiceDescriptorProto; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceDescriptorProto; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceDescriptorProto; + + /** + * Verifies a ServiceDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceDescriptorProto; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @param message ServiceDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodDescriptorProto. */ + interface IMethodDescriptorProto { + + /** MethodDescriptorProto name */ + name?: (string|null); + + /** MethodDescriptorProto inputType */ + inputType?: (string|null); + + /** MethodDescriptorProto outputType */ + outputType?: (string|null); + + /** MethodDescriptorProto options */ + options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming */ + clientStreaming?: (boolean|null); + + /** MethodDescriptorProto serverStreaming */ + serverStreaming?: (boolean|null); + } + + /** Represents a MethodDescriptorProto. */ + class MethodDescriptorProto implements IMethodDescriptorProto { + + /** + * Constructs a new MethodDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodDescriptorProto); + + /** MethodDescriptorProto name. */ + public name: string; + + /** MethodDescriptorProto inputType. */ + public inputType: string; + + /** MethodDescriptorProto outputType. */ + public outputType: string; + + /** MethodDescriptorProto options. */ + public options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming. */ + public clientStreaming: boolean; + + /** MethodDescriptorProto serverStreaming. */ + public serverStreaming: boolean; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodDescriptorProto instance + */ + public static create(properties?: google.protobuf.IMethodDescriptorProto): google.protobuf.MethodDescriptorProto; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodDescriptorProto; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodDescriptorProto; + + /** + * Verifies a MethodDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodDescriptorProto; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @param message MethodDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileOptions. */ + interface IFileOptions { + + /** FileOptions javaPackage */ + javaPackage?: (string|null); + + /** FileOptions javaOuterClassname */ + javaOuterClassname?: (string|null); + + /** FileOptions javaMultipleFiles */ + javaMultipleFiles?: (boolean|null); + + /** FileOptions javaGenerateEqualsAndHash */ + javaGenerateEqualsAndHash?: (boolean|null); + + /** FileOptions javaStringCheckUtf8 */ + javaStringCheckUtf8?: (boolean|null); + + /** FileOptions optimizeFor */ + optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode|null); + + /** FileOptions goPackage */ + goPackage?: (string|null); + + /** FileOptions ccGenericServices */ + ccGenericServices?: (boolean|null); + + /** FileOptions javaGenericServices */ + javaGenericServices?: (boolean|null); + + /** FileOptions pyGenericServices */ + pyGenericServices?: (boolean|null); + + /** FileOptions deprecated */ + deprecated?: (boolean|null); + + /** FileOptions ccEnableArenas */ + ccEnableArenas?: (boolean|null); + + /** FileOptions objcClassPrefix */ + objcClassPrefix?: (string|null); + + /** FileOptions csharpNamespace */ + csharpNamespace?: (string|null); + + /** FileOptions swiftPrefix */ + swiftPrefix?: (string|null); + + /** FileOptions phpClassPrefix */ + phpClassPrefix?: (string|null); + + /** FileOptions phpNamespace */ + phpNamespace?: (string|null); + + /** FileOptions phpMetadataNamespace */ + phpMetadataNamespace?: (string|null); + + /** FileOptions rubyPackage */ + rubyPackage?: (string|null); + + /** FileOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** FileOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FileOptions .google.api.resourceDefinition */ + ".google.api.resourceDefinition"?: (google.api.IResourceDescriptor[]|null); + } + + /** Represents a FileOptions. */ + class FileOptions implements IFileOptions { + + /** + * Constructs a new FileOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileOptions); + + /** FileOptions javaPackage. */ + public javaPackage: string; + + /** FileOptions javaOuterClassname. */ + public javaOuterClassname: string; + + /** FileOptions javaMultipleFiles. */ + public javaMultipleFiles: boolean; + + /** FileOptions javaGenerateEqualsAndHash. */ + public javaGenerateEqualsAndHash: boolean; + + /** FileOptions javaStringCheckUtf8. */ + public javaStringCheckUtf8: boolean; + + /** FileOptions optimizeFor. */ + public optimizeFor: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode); + + /** FileOptions goPackage. */ + public goPackage: string; + + /** FileOptions ccGenericServices. */ + public ccGenericServices: boolean; + + /** FileOptions javaGenericServices. */ + public javaGenericServices: boolean; + + /** FileOptions pyGenericServices. */ + public pyGenericServices: boolean; + + /** FileOptions deprecated. */ + public deprecated: boolean; + + /** FileOptions ccEnableArenas. */ + public ccEnableArenas: boolean; + + /** FileOptions objcClassPrefix. */ + public objcClassPrefix: string; + + /** FileOptions csharpNamespace. */ + public csharpNamespace: string; + + /** FileOptions swiftPrefix. */ + public swiftPrefix: string; + + /** FileOptions phpClassPrefix. */ + public phpClassPrefix: string; + + /** FileOptions phpNamespace. */ + public phpNamespace: string; + + /** FileOptions phpMetadataNamespace. */ + public phpMetadataNamespace: string; + + /** FileOptions rubyPackage. */ + public rubyPackage: string; + + /** FileOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** FileOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FileOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FileOptions instance + */ + public static create(properties?: google.protobuf.IFileOptions): google.protobuf.FileOptions; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileOptions; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileOptions; + + /** + * Verifies a FileOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileOptions; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @param message FileOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FileOptions { + + /** OptimizeMode enum. */ + enum OptimizeMode { + SPEED = 1, + CODE_SIZE = 2, + LITE_RUNTIME = 3 + } + } + + /** Properties of a MessageOptions. */ + interface IMessageOptions { + + /** MessageOptions messageSetWireFormat */ + messageSetWireFormat?: (boolean|null); + + /** MessageOptions noStandardDescriptorAccessor */ + noStandardDescriptorAccessor?: (boolean|null); + + /** MessageOptions deprecated */ + deprecated?: (boolean|null); + + /** MessageOptions mapEntry */ + mapEntry?: (boolean|null); + + /** MessageOptions deprecatedLegacyJsonFieldConflicts */ + deprecatedLegacyJsonFieldConflicts?: (boolean|null); + + /** MessageOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** MessageOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MessageOptions .google.api.resource */ + ".google.api.resource"?: (google.api.IResourceDescriptor|null); + } + + /** Represents a MessageOptions. */ + class MessageOptions implements IMessageOptions { + + /** + * Constructs a new MessageOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMessageOptions); + + /** MessageOptions messageSetWireFormat. */ + public messageSetWireFormat: boolean; + + /** MessageOptions noStandardDescriptorAccessor. */ + public noStandardDescriptorAccessor: boolean; + + /** MessageOptions deprecated. */ + public deprecated: boolean; + + /** MessageOptions mapEntry. */ + public mapEntry: boolean; + + /** MessageOptions deprecatedLegacyJsonFieldConflicts. */ + public deprecatedLegacyJsonFieldConflicts: boolean; + + /** MessageOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** MessageOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MessageOptions instance + */ + public static create(properties?: google.protobuf.IMessageOptions): google.protobuf.MessageOptions; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MessageOptions; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MessageOptions; + + /** + * Verifies a MessageOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MessageOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MessageOptions; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @param message MessageOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MessageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MessageOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MessageOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldOptions. */ + interface IFieldOptions { + + /** FieldOptions ctype */ + ctype?: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType|null); + + /** FieldOptions packed */ + packed?: (boolean|null); + + /** FieldOptions jstype */ + jstype?: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType|null); + + /** FieldOptions lazy */ + lazy?: (boolean|null); + + /** FieldOptions unverifiedLazy */ + unverifiedLazy?: (boolean|null); + + /** FieldOptions deprecated */ + deprecated?: (boolean|null); + + /** FieldOptions weak */ + weak?: (boolean|null); + + /** FieldOptions debugRedact */ + debugRedact?: (boolean|null); + + /** FieldOptions retention */ + retention?: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention|null); + + /** FieldOptions targets */ + targets?: (google.protobuf.FieldOptions.OptionTargetType[]|null); + + /** FieldOptions editionDefaults */ + editionDefaults?: (google.protobuf.FieldOptions.IEditionDefault[]|null); + + /** FieldOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** FieldOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FieldOptions .google.api.fieldBehavior */ + ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); + + /** FieldOptions .google.api.resourceReference */ + ".google.api.resourceReference"?: (google.api.IResourceReference|null); + } + + /** Represents a FieldOptions. */ + class FieldOptions implements IFieldOptions { + + /** + * Constructs a new FieldOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldOptions); + + /** FieldOptions ctype. */ + public ctype: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType); + + /** FieldOptions packed. */ + public packed: boolean; + + /** FieldOptions jstype. */ + public jstype: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType); + + /** FieldOptions lazy. */ + public lazy: boolean; + + /** FieldOptions unverifiedLazy. */ + public unverifiedLazy: boolean; + + /** FieldOptions deprecated. */ + public deprecated: boolean; + + /** FieldOptions weak. */ + public weak: boolean; + + /** FieldOptions debugRedact. */ + public debugRedact: boolean; + + /** FieldOptions retention. */ + public retention: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention); + + /** FieldOptions targets. */ + public targets: google.protobuf.FieldOptions.OptionTargetType[]; + + /** FieldOptions editionDefaults. */ + public editionDefaults: google.protobuf.FieldOptions.IEditionDefault[]; + + /** FieldOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** FieldOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldOptions instance + */ + public static create(properties?: google.protobuf.IFieldOptions): google.protobuf.FieldOptions; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions; + + /** + * Verifies a FieldOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @param message FieldOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldOptions { + + /** CType enum. */ + enum CType { + STRING = 0, + CORD = 1, + STRING_PIECE = 2 + } + + /** JSType enum. */ + enum JSType { + JS_NORMAL = 0, + JS_STRING = 1, + JS_NUMBER = 2 + } + + /** OptionRetention enum. */ + enum OptionRetention { + RETENTION_UNKNOWN = 0, + RETENTION_RUNTIME = 1, + RETENTION_SOURCE = 2 + } + + /** OptionTargetType enum. */ + enum OptionTargetType { + TARGET_TYPE_UNKNOWN = 0, + TARGET_TYPE_FILE = 1, + TARGET_TYPE_EXTENSION_RANGE = 2, + TARGET_TYPE_MESSAGE = 3, + TARGET_TYPE_FIELD = 4, + TARGET_TYPE_ONEOF = 5, + TARGET_TYPE_ENUM = 6, + TARGET_TYPE_ENUM_ENTRY = 7, + TARGET_TYPE_SERVICE = 8, + TARGET_TYPE_METHOD = 9 + } + + /** Properties of an EditionDefault. */ + interface IEditionDefault { + + /** EditionDefault edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** EditionDefault value */ + value?: (string|null); + } + + /** Represents an EditionDefault. */ + class EditionDefault implements IEditionDefault { + + /** + * Constructs a new EditionDefault. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FieldOptions.IEditionDefault); + + /** EditionDefault edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** EditionDefault value. */ + public value: string; + + /** + * Creates a new EditionDefault instance using the specified properties. + * @param [properties] Properties to set + * @returns EditionDefault instance + */ + public static create(properties?: google.protobuf.FieldOptions.IEditionDefault): google.protobuf.FieldOptions.EditionDefault; + + /** + * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @param message EditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @param message EditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EditionDefault message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions.EditionDefault; + + /** + * Decodes an EditionDefault message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions.EditionDefault; + + /** + * Verifies an EditionDefault message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EditionDefault + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions.EditionDefault; + + /** + * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. + * @param message EditionDefault + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions.EditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EditionDefault to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EditionDefault + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an OneofOptions. */ + interface IOneofOptions { + + /** OneofOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** OneofOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an OneofOptions. */ + class OneofOptions implements IOneofOptions { + + /** + * Constructs a new OneofOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofOptions); + + /** OneofOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** OneofOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofOptions instance + */ + public static create(properties?: google.protobuf.IOneofOptions): google.protobuf.OneofOptions; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofOptions; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofOptions; + + /** + * Verifies an OneofOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofOptions; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @param message OneofOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneofOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumOptions. */ + interface IEnumOptions { + + /** EnumOptions allowAlias */ + allowAlias?: (boolean|null); + + /** EnumOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumOptions deprecatedLegacyJsonFieldConflicts */ + deprecatedLegacyJsonFieldConflicts?: (boolean|null); + + /** EnumOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** EnumOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumOptions. */ + class EnumOptions implements IEnumOptions { + + /** + * Constructs a new EnumOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumOptions); + + /** EnumOptions allowAlias. */ + public allowAlias: boolean; + + /** EnumOptions deprecated. */ + public deprecated: boolean; + + /** EnumOptions deprecatedLegacyJsonFieldConflicts. */ + public deprecatedLegacyJsonFieldConflicts: boolean; + + /** EnumOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** EnumOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumOptions instance + */ + public static create(properties?: google.protobuf.IEnumOptions): google.protobuf.EnumOptions; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumOptions; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumOptions; + + /** + * Verifies an EnumOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumOptions; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @param message EnumOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumValueOptions. */ + interface IEnumValueOptions { + + /** EnumValueOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumValueOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** EnumValueOptions debugRedact */ + debugRedact?: (boolean|null); + + /** EnumValueOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumValueOptions. */ + class EnumValueOptions implements IEnumValueOptions { + + /** + * Constructs a new EnumValueOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueOptions); + + /** EnumValueOptions deprecated. */ + public deprecated: boolean; + + /** EnumValueOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** EnumValueOptions debugRedact. */ + public debugRedact: boolean; + + /** EnumValueOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueOptions instance + */ + public static create(properties?: google.protobuf.IEnumValueOptions): google.protobuf.EnumValueOptions; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueOptions; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueOptions; + + /** + * Verifies an EnumValueOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueOptions; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @param message EnumValueOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceOptions. */ + interface IServiceOptions { + + /** ServiceOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** ServiceOptions deprecated */ + deprecated?: (boolean|null); + + /** ServiceOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** ServiceOptions .google.api.defaultHost */ + ".google.api.defaultHost"?: (string|null); + + /** ServiceOptions .google.api.oauthScopes */ + ".google.api.oauthScopes"?: (string|null); + + /** ServiceOptions .google.api.apiVersion */ + ".google.api.apiVersion"?: (string|null); + } + + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { + + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceOptions); + + /** ServiceOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** ServiceOptions deprecated. */ + public deprecated: boolean; + + /** ServiceOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceOptions instance + */ + public static create(properties?: google.protobuf.IServiceOptions): google.protobuf.ServiceOptions; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceOptions; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceOptions; + + /** + * Verifies a ServiceOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @param message ServiceOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodOptions. */ + interface IMethodOptions { + + /** MethodOptions deprecated */ + deprecated?: (boolean|null); + + /** MethodOptions idempotencyLevel */ + idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); + + /** MethodOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** MethodOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MethodOptions .google.api.http */ + ".google.api.http"?: (google.api.IHttpRule|null); + + /** MethodOptions .google.api.methodSignature */ + ".google.api.methodSignature"?: (string[]|null); + + /** MethodOptions .google.longrunning.operationInfo */ + ".google.longrunning.operationInfo"?: (google.longrunning.IOperationInfo|null); + } + + /** Represents a MethodOptions. */ + class MethodOptions implements IMethodOptions { + + /** + * Constructs a new MethodOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodOptions); + + /** MethodOptions deprecated. */ + public deprecated: boolean; + + /** MethodOptions idempotencyLevel. */ + public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); + + /** MethodOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** MethodOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodOptions instance + */ + public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodOptions; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodOptions; + + /** + * Verifies a MethodOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @param message MethodOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MethodOptions { + + /** IdempotencyLevel enum. */ + enum IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0, + NO_SIDE_EFFECTS = 1, + IDEMPOTENT = 2 + } + } + + /** Properties of an UninterpretedOption. */ + interface IUninterpretedOption { + + /** UninterpretedOption name */ + name?: (google.protobuf.UninterpretedOption.INamePart[]|null); + + /** UninterpretedOption identifierValue */ + identifierValue?: (string|null); + + /** UninterpretedOption positiveIntValue */ + positiveIntValue?: (number|Long|string|null); + + /** UninterpretedOption negativeIntValue */ + negativeIntValue?: (number|Long|string|null); + + /** UninterpretedOption doubleValue */ + doubleValue?: (number|null); + + /** UninterpretedOption stringValue */ + stringValue?: (Uint8Array|Buffer|string|null); + + /** UninterpretedOption aggregateValue */ + aggregateValue?: (string|null); + } + + /** Represents an UninterpretedOption. */ + class UninterpretedOption implements IUninterpretedOption { + + /** + * Constructs a new UninterpretedOption. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUninterpretedOption); + + /** UninterpretedOption name. */ + public name: google.protobuf.UninterpretedOption.INamePart[]; + + /** UninterpretedOption identifierValue. */ + public identifierValue: string; + + /** UninterpretedOption positiveIntValue. */ + public positiveIntValue: (number|Long|string); + + /** UninterpretedOption negativeIntValue. */ + public negativeIntValue: (number|Long|string); + + /** UninterpretedOption doubleValue. */ + public doubleValue: number; + + /** UninterpretedOption stringValue. */ + public stringValue: (Uint8Array|Buffer|string); + + /** UninterpretedOption aggregateValue. */ + public aggregateValue: string; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @param [properties] Properties to set + * @returns UninterpretedOption instance + */ + public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption; + + /** + * Verifies an UninterpretedOption message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UninterpretedOption + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @param message UninterpretedOption + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UninterpretedOption to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UninterpretedOption + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace UninterpretedOption { + + /** Properties of a NamePart. */ + interface INamePart { + + /** NamePart namePart */ + namePart: string; + + /** NamePart isExtension */ + isExtension: boolean; + } + + /** Represents a NamePart. */ + class NamePart implements INamePart { + + /** + * Constructs a new NamePart. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.UninterpretedOption.INamePart); + + /** NamePart namePart. */ + public namePart: string; + + /** NamePart isExtension. */ + public isExtension: boolean; + + /** + * Creates a new NamePart instance using the specified properties. + * @param [properties] Properties to set + * @returns NamePart instance + */ + public static create(properties?: google.protobuf.UninterpretedOption.INamePart): google.protobuf.UninterpretedOption.NamePart; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption.NamePart; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption.NamePart; + + /** + * Verifies a NamePart message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NamePart + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @param message NamePart + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NamePart to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NamePart + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a FeatureSet. */ + interface IFeatureSet { + + /** FeatureSet fieldPresence */ + fieldPresence?: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence|null); + + /** FeatureSet enumType */ + enumType?: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType|null); + + /** FeatureSet repeatedFieldEncoding */ + repeatedFieldEncoding?: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding|null); + + /** FeatureSet utf8Validation */ + utf8Validation?: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation|null); + + /** FeatureSet messageEncoding */ + messageEncoding?: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding|null); + + /** FeatureSet jsonFormat */ + jsonFormat?: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat|null); + } + + /** Represents a FeatureSet. */ + class FeatureSet implements IFeatureSet { + + /** + * Constructs a new FeatureSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFeatureSet); + + /** FeatureSet fieldPresence. */ + public fieldPresence: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence); + + /** FeatureSet enumType. */ + public enumType: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType); + + /** FeatureSet repeatedFieldEncoding. */ + public repeatedFieldEncoding: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding); + + /** FeatureSet utf8Validation. */ + public utf8Validation: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation); + + /** FeatureSet messageEncoding. */ + public messageEncoding: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding); + + /** FeatureSet jsonFormat. */ + public jsonFormat: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat); + + /** + * Creates a new FeatureSet instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSet instance + */ + public static create(properties?: google.protobuf.IFeatureSet): google.protobuf.FeatureSet; + + /** + * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @param message FeatureSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @param message FeatureSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSet; + + /** + * Decodes a FeatureSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSet; + + /** + * Verifies a FeatureSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSet + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSet; + + /** + * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. + * @param message FeatureSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FeatureSet { + + /** FieldPresence enum. */ + enum FieldPresence { + FIELD_PRESENCE_UNKNOWN = 0, + EXPLICIT = 1, + IMPLICIT = 2, + LEGACY_REQUIRED = 3 + } + + /** EnumType enum. */ + enum EnumType { + ENUM_TYPE_UNKNOWN = 0, + OPEN = 1, + CLOSED = 2 + } + + /** RepeatedFieldEncoding enum. */ + enum RepeatedFieldEncoding { + REPEATED_FIELD_ENCODING_UNKNOWN = 0, + PACKED = 1, + EXPANDED = 2 + } + + /** Utf8Validation enum. */ + enum Utf8Validation { + UTF8_VALIDATION_UNKNOWN = 0, + VERIFY = 2, + NONE = 3 + } + + /** MessageEncoding enum. */ + enum MessageEncoding { + MESSAGE_ENCODING_UNKNOWN = 0, + LENGTH_PREFIXED = 1, + DELIMITED = 2 + } + + /** JsonFormat enum. */ + enum JsonFormat { + JSON_FORMAT_UNKNOWN = 0, + ALLOW = 1, + LEGACY_BEST_EFFORT = 2 + } + } + + /** Properties of a FeatureSetDefaults. */ + interface IFeatureSetDefaults { + + /** FeatureSetDefaults defaults */ + defaults?: (google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]|null); + + /** FeatureSetDefaults minimumEdition */ + minimumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSetDefaults maximumEdition */ + maximumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + } + + /** Represents a FeatureSetDefaults. */ + class FeatureSetDefaults implements IFeatureSetDefaults { + + /** + * Constructs a new FeatureSetDefaults. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFeatureSetDefaults); + + /** FeatureSetDefaults defaults. */ + public defaults: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]; + + /** FeatureSetDefaults minimumEdition. */ + public minimumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSetDefaults maximumEdition. */ + public maximumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** + * Creates a new FeatureSetDefaults instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSetDefaults instance + */ + public static create(properties?: google.protobuf.IFeatureSetDefaults): google.protobuf.FeatureSetDefaults; + + /** + * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @param message FeatureSetDefaults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @param message FeatureSetDefaults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSetDefaults; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSetDefaults; + + /** + * Verifies a FeatureSetDefaults message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSetDefaults + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults; + + /** + * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. + * @param message FeatureSetDefaults + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSetDefaults, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSetDefaults to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSetDefaults + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FeatureSetDefaults { + + /** Properties of a FeatureSetEditionDefault. */ + interface IFeatureSetEditionDefault { + + /** FeatureSetEditionDefault edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSetEditionDefault features */ + features?: (google.protobuf.IFeatureSet|null); + } + + /** Represents a FeatureSetEditionDefault. */ + class FeatureSetEditionDefault implements IFeatureSetEditionDefault { + + /** + * Constructs a new FeatureSetEditionDefault. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault); + + /** FeatureSetEditionDefault edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSetEditionDefault features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** + * Creates a new FeatureSetEditionDefault instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSetEditionDefault instance + */ + public static create(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @param message FeatureSetEditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @param message FeatureSetEditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Verifies a FeatureSetEditionDefault message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSetEditionDefault + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. + * @param message FeatureSetEditionDefault + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSetEditionDefault to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSetEditionDefault + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a SourceCodeInfo. */ + interface ISourceCodeInfo { + + /** SourceCodeInfo location */ + location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); + } + + /** Represents a SourceCodeInfo. */ + class SourceCodeInfo implements ISourceCodeInfo { + + /** + * Constructs a new SourceCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ISourceCodeInfo); + + /** SourceCodeInfo location. */ + public location: google.protobuf.SourceCodeInfo.ILocation[]; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns SourceCodeInfo instance + */ + public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo; + + /** + * Verifies a SourceCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SourceCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @param message SourceCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SourceCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SourceCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SourceCodeInfo { + + /** Properties of a Location. */ + interface ILocation { + + /** Location path */ + path?: (number[]|null); + + /** Location span */ + span?: (number[]|null); + + /** Location leadingComments */ + leadingComments?: (string|null); + + /** Location trailingComments */ + trailingComments?: (string|null); + + /** Location leadingDetachedComments */ + leadingDetachedComments?: (string[]|null); + } + + /** Represents a Location. */ + class Location implements ILocation { + + /** + * Constructs a new Location. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); + + /** Location path. */ + public path: number[]; + + /** Location span. */ + public span: number[]; + + /** Location leadingComments. */ + public leadingComments: string; + + /** Location trailingComments. */ + public trailingComments: string; + + /** Location leadingDetachedComments. */ + public leadingDetachedComments: string[]; + + /** + * Creates a new Location instance using the specified properties. + * @param [properties] Properties to set + * @returns Location instance + */ + public static create(properties?: google.protobuf.SourceCodeInfo.ILocation): google.protobuf.SourceCodeInfo.Location; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Location message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo.Location; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo.Location; + + /** + * Verifies a Location message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Location + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @param message Location + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Location to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Location + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a GeneratedCodeInfo. */ + interface IGeneratedCodeInfo { + + /** GeneratedCodeInfo annotation */ + annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); + } + + /** Represents a GeneratedCodeInfo. */ + class GeneratedCodeInfo implements IGeneratedCodeInfo { + + /** + * Constructs a new GeneratedCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IGeneratedCodeInfo); + + /** GeneratedCodeInfo annotation. */ + public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns GeneratedCodeInfo instance + */ + public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo; + + /** + * Verifies a GeneratedCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GeneratedCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @param message GeneratedCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GeneratedCodeInfo { + + /** Properties of an Annotation. */ + interface IAnnotation { + + /** Annotation path */ + path?: (number[]|null); + + /** Annotation sourceFile */ + sourceFile?: (string|null); + + /** Annotation begin */ + begin?: (number|null); + + /** Annotation end */ + end?: (number|null); + + /** Annotation semantic */ + semantic?: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null); + } + + /** Represents an Annotation. */ + class Annotation implements IAnnotation { + + /** + * Constructs a new Annotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); + + /** Annotation path. */ + public path: number[]; + + /** Annotation sourceFile. */ + public sourceFile: string; + + /** Annotation begin. */ + public begin: number; + + /** Annotation end. */ + public end: number; + + /** Annotation semantic. */ + public semantic: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic); + + /** + * Creates a new Annotation instance using the specified properties. + * @param [properties] Properties to set + * @returns Annotation instance + */ + public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Verifies an Annotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Annotation + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @param message Annotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Annotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Annotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Annotation { + + /** Semantic enum. */ + enum Semantic { + NONE = 0, + SET = 1, + ALIAS = 2 + } + } + } + + /** Properties of a Duration. */ + interface IDuration { + + /** Duration seconds */ + seconds?: (number|Long|string|null); + + /** Duration nanos */ + nanos?: (number|null); + } + + /** Represents a Duration. */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDuration); + + /** Duration seconds. */ + public seconds: (number|Long|string); + + /** Duration nanos. */ + public nanos: number; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: google.protobuf.IDuration): google.protobuf.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Duration; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Duration; + + /** + * Verifies a Duration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Duration + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @param message Duration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Duration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Any. */ + interface IAny { + + /** Any type_url */ + type_url?: (string|null); + + /** Any value */ + value?: (Uint8Array|Buffer|string|null); + } + + /** Represents an Any. */ + class Any implements IAny { + + /** + * Constructs a new Any. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IAny); + + /** Any type_url. */ + public type_url: string; + + /** Any value. */ + public value: (Uint8Array|Buffer|string); + + /** + * Creates a new Any instance using the specified properties. + * @param [properties] Properties to set + * @returns Any instance + */ + public static create(properties?: google.protobuf.IAny): google.protobuf.Any; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Any message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Any; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Any; + + /** + * Verifies an Any message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Any + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Any; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @param message Any + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Any, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Any to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Any + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Empty. */ + interface IEmpty { + } + + /** Represents an Empty. */ + class Empty implements IEmpty { + + /** + * Constructs a new Empty. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEmpty); + + /** + * Creates a new Empty instance using the specified properties. + * @param [properties] Properties to set + * @returns Empty instance + */ + public static create(properties?: google.protobuf.IEmpty): google.protobuf.Empty; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Empty; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Empty; + + /** + * Verifies an Empty message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Empty + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Empty; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @param message Empty + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Empty to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Empty + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldMask. */ + interface IFieldMask { + + /** FieldMask paths */ + paths?: (string[]|null); + } + + /** Represents a FieldMask. */ + class FieldMask implements IFieldMask { + + /** + * Constructs a new FieldMask. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldMask); + + /** FieldMask paths. */ + public paths: string[]; + + /** + * Creates a new FieldMask instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldMask instance + */ + public static create(properties?: google.protobuf.IFieldMask): google.protobuf.FieldMask; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldMask; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldMask; + + /** + * Verifies a FieldMask message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldMask + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldMask; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @param message FieldMask + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldMask, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldMask to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldMask + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** Timestamp seconds */ + seconds?: (number|Long|string|null); + + /** Timestamp nanos */ + nanos?: (number|null); + } + + /** Represents a Timestamp. */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ITimestamp); + + /** Timestamp seconds. */ + public seconds: (number|Long|string); + + /** Timestamp nanos. */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Timestamp; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Timestamp; + + /** + * Verifies a Timestamp message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Timestamp + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @param message Timestamp + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Timestamp to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Struct. */ + interface IStruct { + + /** Struct fields */ + fields?: ({ [k: string]: google.protobuf.IValue }|null); + } + + /** Represents a Struct. */ + class Struct implements IStruct { + + /** + * Constructs a new Struct. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IStruct); + + /** Struct fields. */ + public fields: { [k: string]: google.protobuf.IValue }; + + /** + * Creates a new Struct instance using the specified properties. + * @param [properties] Properties to set + * @returns Struct instance + */ + public static create(properties?: google.protobuf.IStruct): google.protobuf.Struct; + + /** + * Encodes the specified Struct message. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @param message Struct message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IStruct, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Struct message, length delimited. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @param message Struct message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IStruct, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Struct message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Struct; + + /** + * Decodes a Struct message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Struct; + + /** + * Verifies a Struct message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Struct message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Struct + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Struct; + + /** + * Creates a plain object from a Struct message. Also converts values to other types if specified. + * @param message Struct + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Struct, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Struct to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Struct + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Value. */ + interface IValue { + + /** Value nullValue */ + nullValue?: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue|null); + + /** Value numberValue */ + numberValue?: (number|null); + + /** Value stringValue */ + stringValue?: (string|null); + + /** Value boolValue */ + boolValue?: (boolean|null); + + /** Value structValue */ + structValue?: (google.protobuf.IStruct|null); + + /** Value listValue */ + listValue?: (google.protobuf.IListValue|null); + } + + /** Represents a Value. */ + class Value implements IValue { + + /** + * Constructs a new Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IValue); + + /** Value nullValue. */ + public nullValue?: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue|null); + + /** Value numberValue. */ + public numberValue?: (number|null); + + /** Value stringValue. */ + public stringValue?: (string|null); + + /** Value boolValue. */ + public boolValue?: (boolean|null); + + /** Value structValue. */ + public structValue?: (google.protobuf.IStruct|null); + + /** Value listValue. */ + public listValue?: (google.protobuf.IListValue|null); + + /** Value kind. */ + public kind?: ("nullValue"|"numberValue"|"stringValue"|"boolValue"|"structValue"|"listValue"); + + /** + * Creates a new Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Value instance + */ + public static create(properties?: google.protobuf.IValue): google.protobuf.Value; + + /** + * Encodes the specified Value message. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @param message Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Value message, length delimited. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @param message Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Value; + + /** + * Decodes a Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Value; + + /** + * Verifies a Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Value; + + /** + * Creates a plain object from a Value message. Also converts values to other types if specified. + * @param message Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** NullValue enum. */ + enum NullValue { + NULL_VALUE = 0 + } + + /** Properties of a ListValue. */ + interface IListValue { + + /** ListValue values */ + values?: (google.protobuf.IValue[]|null); + } + + /** Represents a ListValue. */ + class ListValue implements IListValue { + + /** + * Constructs a new ListValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IListValue); + + /** ListValue values. */ + public values: google.protobuf.IValue[]; + + /** + * Creates a new ListValue instance using the specified properties. + * @param [properties] Properties to set + * @returns ListValue instance + */ + public static create(properties?: google.protobuf.IListValue): google.protobuf.ListValue; + + /** + * Encodes the specified ListValue message. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @param message ListValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IListValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListValue message, length delimited. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @param message ListValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IListValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListValue + * @throws {Error} If the payload is not 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.ListValue; + + /** + * Decodes a ListValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListValue + * @throws {Error} If the payload 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.ListValue; + + /** + * Verifies a ListValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ListValue; + + /** + * Creates a plain object from a ListValue message. Also converts values to other types if specified. + * @param message ListValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ListValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace longrunning. */ + namespace longrunning { + + /** Represents an Operations */ + class Operations extends $protobuf.rpc.Service { + + /** + * Constructs a new Operations service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Operations service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Operations; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListOperationsResponse + */ + public listOperations(request: google.longrunning.IListOperationsRequest, callback: google.longrunning.Operations.ListOperationsCallback): void; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @returns Promise + */ + public listOperations(request: google.longrunning.IListOperationsRequest): Promise; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public getOperation(request: google.longrunning.IGetOperationRequest, callback: google.longrunning.Operations.GetOperationCallback): void; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @returns Promise + */ + public getOperation(request: google.longrunning.IGetOperationRequest): Promise; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest, callback: google.longrunning.Operations.DeleteOperationCallback): void; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @returns Promise + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest): Promise; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest, callback: google.longrunning.Operations.CancelOperationCallback): void; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @returns Promise + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest): Promise; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest, callback: google.longrunning.Operations.WaitOperationCallback): void; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @returns Promise + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest): Promise; + } + + namespace Operations { + + /** + * Callback as used by {@link google.longrunning.Operations|listOperations}. + * @param error Error, if any + * @param [response] ListOperationsResponse + */ + type ListOperationsCallback = (error: (Error|null), response?: google.longrunning.ListOperationsResponse) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|getOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type GetOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type CancelOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|waitOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type WaitOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of an Operation. */ + interface IOperation { + + /** Operation name */ + name?: (string|null); + + /** Operation metadata */ + metadata?: (google.protobuf.IAny|null); + + /** Operation done */ + done?: (boolean|null); + + /** Operation error */ + error?: (google.rpc.IStatus|null); + + /** Operation response */ + response?: (google.protobuf.IAny|null); + } + + /** Represents an Operation. */ + class Operation implements IOperation { + + /** + * Constructs a new Operation. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperation); + + /** Operation name. */ + public name: string; + + /** Operation metadata. */ + public metadata?: (google.protobuf.IAny|null); + + /** Operation done. */ + public done: boolean; + + /** Operation error. */ + public error?: (google.rpc.IStatus|null); + + /** Operation response. */ + public response?: (google.protobuf.IAny|null); + + /** Operation result. */ + public result?: ("error"|"response"); + + /** + * Creates a new Operation instance using the specified properties. + * @param [properties] Properties to set + * @returns Operation instance + */ + public static create(properties?: google.longrunning.IOperation): google.longrunning.Operation; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.Operation; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.Operation; + + /** + * Verifies an Operation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Operation + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.Operation; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @param message Operation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.Operation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Operation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Operation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetOperationRequest. */ + interface IGetOperationRequest { + + /** GetOperationRequest name */ + name?: (string|null); + } + + /** Represents a GetOperationRequest. */ + class GetOperationRequest implements IGetOperationRequest { + + /** + * Constructs a new GetOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IGetOperationRequest); + + /** GetOperationRequest name. */ + public name: string; + + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetOperationRequest instance + */ + public static create(properties?: google.longrunning.IGetOperationRequest): google.longrunning.GetOperationRequest; + + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.GetOperationRequest; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.GetOperationRequest; + + /** + * Verifies a GetOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.GetOperationRequest; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @param message GetOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.GetOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOperationsRequest. */ + interface IListOperationsRequest { + + /** ListOperationsRequest name */ + name?: (string|null); + + /** ListOperationsRequest filter */ + filter?: (string|null); + + /** ListOperationsRequest pageSize */ + pageSize?: (number|null); + + /** ListOperationsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListOperationsRequest. */ + class ListOperationsRequest implements IListOperationsRequest { + + /** + * Constructs a new ListOperationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsRequest); + + /** ListOperationsRequest name. */ + public name: string; + + /** ListOperationsRequest filter. */ + public filter: string; + + /** ListOperationsRequest pageSize. */ + public pageSize: number; + + /** ListOperationsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsRequest instance + */ + public static create(properties?: google.longrunning.IListOperationsRequest): google.longrunning.ListOperationsRequest; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsRequest; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsRequest; + + /** + * Verifies a ListOperationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsRequest; + + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @param message ListOperationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOperationsResponse. */ + interface IListOperationsResponse { + + /** ListOperationsResponse operations */ + operations?: (google.longrunning.IOperation[]|null); + + /** ListOperationsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListOperationsResponse. */ + class ListOperationsResponse implements IListOperationsResponse { + + /** + * Constructs a new ListOperationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsResponse); + + /** ListOperationsResponse operations. */ + public operations: google.longrunning.IOperation[]; + + /** ListOperationsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsResponse instance + */ + public static create(properties?: google.longrunning.IListOperationsResponse): google.longrunning.ListOperationsResponse; + + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsResponse; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsResponse; + + /** + * Verifies a ListOperationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsResponse; + + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @param message ListOperationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CancelOperationRequest. */ + interface ICancelOperationRequest { + + /** CancelOperationRequest name */ + name?: (string|null); + } + + /** Represents a CancelOperationRequest. */ + class CancelOperationRequest implements ICancelOperationRequest { + + /** + * Constructs a new CancelOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.ICancelOperationRequest); + + /** CancelOperationRequest name. */ + public name: string; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CancelOperationRequest instance + */ + public static create(properties?: google.longrunning.ICancelOperationRequest): google.longrunning.CancelOperationRequest; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.CancelOperationRequest; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.CancelOperationRequest; + + /** + * Verifies a CancelOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CancelOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.CancelOperationRequest; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @param message CancelOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.CancelOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CancelOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CancelOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteOperationRequest. */ + interface IDeleteOperationRequest { + + /** DeleteOperationRequest name */ + name?: (string|null); + } + + /** Represents a DeleteOperationRequest. */ + class DeleteOperationRequest implements IDeleteOperationRequest { + + /** + * Constructs a new DeleteOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IDeleteOperationRequest); + + /** DeleteOperationRequest name. */ + public name: string; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteOperationRequest instance + */ + public static create(properties?: google.longrunning.IDeleteOperationRequest): google.longrunning.DeleteOperationRequest; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.DeleteOperationRequest; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.DeleteOperationRequest; + + /** + * Verifies a DeleteOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.DeleteOperationRequest; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @param message DeleteOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.DeleteOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WaitOperationRequest. */ + interface IWaitOperationRequest { + + /** WaitOperationRequest name */ + name?: (string|null); + + /** WaitOperationRequest timeout */ + timeout?: (google.protobuf.IDuration|null); + } + + /** Represents a WaitOperationRequest. */ + class WaitOperationRequest implements IWaitOperationRequest { + + /** + * Constructs a new WaitOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IWaitOperationRequest); + + /** WaitOperationRequest name. */ + public name: string; + + /** WaitOperationRequest timeout. */ + public timeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns WaitOperationRequest instance + */ + public static create(properties?: google.longrunning.IWaitOperationRequest): google.longrunning.WaitOperationRequest; + + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.WaitOperationRequest; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.WaitOperationRequest; + + /** + * Verifies a WaitOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WaitOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.WaitOperationRequest; + + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @param message WaitOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.WaitOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WaitOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WaitOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OperationInfo. */ + interface IOperationInfo { + + /** OperationInfo responseType */ + responseType?: (string|null); + + /** OperationInfo metadataType */ + metadataType?: (string|null); + } + + /** Represents an OperationInfo. */ + class OperationInfo implements IOperationInfo { + + /** + * Constructs a new OperationInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperationInfo); + + /** OperationInfo responseType. */ + public responseType: string; + + /** OperationInfo metadataType. */ + public metadataType: string; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationInfo instance + */ + public static create(properties?: google.longrunning.IOperationInfo): google.longrunning.OperationInfo; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.OperationInfo; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.OperationInfo; + + /** + * Verifies an OperationInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationInfo + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.OperationInfo; + + /** + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @param message OperationInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.OperationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OperationInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace rpc. */ + namespace rpc { + + /** Properties of a Status. */ + interface IStatus { + + /** Status code */ + code?: (number|null); + + /** Status message */ + message?: (string|null); + + /** Status details */ + details?: (google.protobuf.IAny[]|null); + } + + /** Represents a Status. */ + class Status implements IStatus { + + /** + * Constructs a new Status. + * @param [properties] Properties to set + */ + constructor(properties?: google.rpc.IStatus); + + /** Status code. */ + public code: number; + + /** Status message. */ + public message: string; + + /** Status details. */ + public details: google.protobuf.IAny[]; + + /** + * Creates a new Status instance using the specified properties. + * @param [properties] Properties to set + * @returns Status instance + */ + public static create(properties?: google.rpc.IStatus): google.rpc.Status; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Status message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.rpc.Status; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.rpc.Status; + + /** + * Verifies a Status message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Status + */ + public static fromObject(object: { [k: string]: any }): google.rpc.Status; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @param message Status + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.rpc.Status, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Status to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Status + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace iam. */ + namespace iam { + + /** Namespace v1. */ + namespace v1 { + + /** Represents a IAMPolicy */ + class IAMPolicy extends $protobuf.rpc.Service { + + /** + * Constructs a new IAMPolicy service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new IAMPolicy service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): IAMPolicy; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest, callback: google.iam.v1.IAMPolicy.SetIamPolicyCallback): void; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @returns Promise + */ + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest): Promise; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest, callback: google.iam.v1.IAMPolicy.GetIamPolicyCallback): void; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @returns Promise + */ + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest): Promise; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + */ + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest, callback: google.iam.v1.IAMPolicy.TestIamPermissionsCallback): void; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @returns Promise + */ + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest): Promise; + } + + namespace IAMPolicy { + + /** + * Callback as used by {@link google.iam.v1.IAMPolicy|setIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type SetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + + /** + * Callback as used by {@link google.iam.v1.IAMPolicy|getIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type GetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + + /** + * Callback as used by {@link google.iam.v1.IAMPolicy|testIamPermissions}. + * @param error Error, if any + * @param [response] TestIamPermissionsResponse + */ + type TestIamPermissionsCallback = (error: (Error|null), response?: google.iam.v1.TestIamPermissionsResponse) => void; + } + + /** Properties of a SetIamPolicyRequest. */ + interface ISetIamPolicyRequest { + + /** SetIamPolicyRequest resource */ + resource?: (string|null); + + /** SetIamPolicyRequest policy */ + policy?: (google.iam.v1.IPolicy|null); + + /** SetIamPolicyRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents a SetIamPolicyRequest. */ + class SetIamPolicyRequest implements ISetIamPolicyRequest { + + /** + * Constructs a new SetIamPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.ISetIamPolicyRequest); + + /** SetIamPolicyRequest resource. */ + public resource: string; + + /** SetIamPolicyRequest policy. */ + public policy?: (google.iam.v1.IPolicy|null); + + /** SetIamPolicyRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new SetIamPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SetIamPolicyRequest instance + */ + public static create(properties?: google.iam.v1.ISetIamPolicyRequest): google.iam.v1.SetIamPolicyRequest; + + /** + * Encodes the specified SetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. + * @param message SetIamPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.ISetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. + * @param message SetIamPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.ISetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetIamPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.SetIamPolicyRequest; + + /** + * Decodes a SetIamPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.SetIamPolicyRequest; + + /** + * Verifies a SetIamPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetIamPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.SetIamPolicyRequest; + + /** + * Creates a plain object from a SetIamPolicyRequest message. Also converts values to other types if specified. + * @param message SetIamPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.SetIamPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetIamPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SetIamPolicyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetIamPolicyRequest. */ + interface IGetIamPolicyRequest { + + /** GetIamPolicyRequest resource */ + resource?: (string|null); + + /** GetIamPolicyRequest options */ + options?: (google.iam.v1.IGetPolicyOptions|null); + } + + /** Represents a GetIamPolicyRequest. */ + class GetIamPolicyRequest implements IGetIamPolicyRequest { + + /** + * Constructs a new GetIamPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IGetIamPolicyRequest); + + /** GetIamPolicyRequest resource. */ + public resource: string; + + /** GetIamPolicyRequest options. */ + public options?: (google.iam.v1.IGetPolicyOptions|null); + + /** + * Creates a new GetIamPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetIamPolicyRequest instance + */ + public static create(properties?: google.iam.v1.IGetIamPolicyRequest): google.iam.v1.GetIamPolicyRequest; + + /** + * Encodes the specified GetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. + * @param message GetIamPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IGetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. + * @param message GetIamPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IGetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetIamPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.GetIamPolicyRequest; + + /** + * Decodes a GetIamPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.GetIamPolicyRequest; + + /** + * Verifies a GetIamPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetIamPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.GetIamPolicyRequest; + + /** + * Creates a plain object from a GetIamPolicyRequest message. Also converts values to other types if specified. + * @param message GetIamPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.GetIamPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetIamPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetIamPolicyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TestIamPermissionsRequest. */ + interface ITestIamPermissionsRequest { + + /** TestIamPermissionsRequest resource */ + resource?: (string|null); + + /** TestIamPermissionsRequest permissions */ + permissions?: (string[]|null); + } + + /** Represents a TestIamPermissionsRequest. */ + class TestIamPermissionsRequest implements ITestIamPermissionsRequest { + + /** + * Constructs a new TestIamPermissionsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.ITestIamPermissionsRequest); + + /** TestIamPermissionsRequest resource. */ + public resource: string; + + /** TestIamPermissionsRequest permissions. */ + public permissions: string[]; + + /** + * Creates a new TestIamPermissionsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns TestIamPermissionsRequest instance + */ + public static create(properties?: google.iam.v1.ITestIamPermissionsRequest): google.iam.v1.TestIamPermissionsRequest; + + /** + * Encodes the specified TestIamPermissionsRequest message. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. + * @param message TestIamPermissionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.ITestIamPermissionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TestIamPermissionsRequest message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. + * @param message TestIamPermissionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.ITestIamPermissionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TestIamPermissionsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TestIamPermissionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.TestIamPermissionsRequest; + + /** + * Decodes a TestIamPermissionsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TestIamPermissionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.TestIamPermissionsRequest; + + /** + * Verifies a TestIamPermissionsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TestIamPermissionsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TestIamPermissionsRequest + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.TestIamPermissionsRequest; + + /** + * Creates a plain object from a TestIamPermissionsRequest message. Also converts values to other types if specified. + * @param message TestIamPermissionsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.TestIamPermissionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TestIamPermissionsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TestIamPermissionsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TestIamPermissionsResponse. */ + interface ITestIamPermissionsResponse { + + /** TestIamPermissionsResponse permissions */ + permissions?: (string[]|null); + } + + /** Represents a TestIamPermissionsResponse. */ + class TestIamPermissionsResponse implements ITestIamPermissionsResponse { + + /** + * Constructs a new TestIamPermissionsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.ITestIamPermissionsResponse); + + /** TestIamPermissionsResponse permissions. */ + public permissions: string[]; + + /** + * Creates a new TestIamPermissionsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns TestIamPermissionsResponse instance + */ + public static create(properties?: google.iam.v1.ITestIamPermissionsResponse): google.iam.v1.TestIamPermissionsResponse; + + /** + * Encodes the specified TestIamPermissionsResponse message. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. + * @param message TestIamPermissionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.ITestIamPermissionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TestIamPermissionsResponse message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. + * @param message TestIamPermissionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.ITestIamPermissionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TestIamPermissionsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TestIamPermissionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.TestIamPermissionsResponse; + + /** + * Decodes a TestIamPermissionsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TestIamPermissionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.TestIamPermissionsResponse; + + /** + * Verifies a TestIamPermissionsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TestIamPermissionsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TestIamPermissionsResponse + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.TestIamPermissionsResponse; + + /** + * Creates a plain object from a TestIamPermissionsResponse message. Also converts values to other types if specified. + * @param message TestIamPermissionsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.TestIamPermissionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TestIamPermissionsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TestIamPermissionsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetPolicyOptions. */ + interface IGetPolicyOptions { + + /** GetPolicyOptions requestedPolicyVersion */ + requestedPolicyVersion?: (number|null); + } + + /** Represents a GetPolicyOptions. */ + class GetPolicyOptions implements IGetPolicyOptions { + + /** + * Constructs a new GetPolicyOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IGetPolicyOptions); + + /** GetPolicyOptions requestedPolicyVersion. */ + public requestedPolicyVersion: number; + + /** + * Creates a new GetPolicyOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns GetPolicyOptions instance + */ + public static create(properties?: google.iam.v1.IGetPolicyOptions): google.iam.v1.GetPolicyOptions; + + /** + * Encodes the specified GetPolicyOptions message. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages. + * @param message GetPolicyOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IGetPolicyOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetPolicyOptions message, length delimited. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages. + * @param message GetPolicyOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IGetPolicyOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetPolicyOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetPolicyOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.GetPolicyOptions; + + /** + * Decodes a GetPolicyOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetPolicyOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.GetPolicyOptions; + + /** + * Verifies a GetPolicyOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetPolicyOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetPolicyOptions + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.GetPolicyOptions; + + /** + * Creates a plain object from a GetPolicyOptions message. Also converts values to other types if specified. + * @param message GetPolicyOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.GetPolicyOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetPolicyOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetPolicyOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Policy. */ + interface IPolicy { + + /** Policy version */ + version?: (number|null); + + /** Policy bindings */ + bindings?: (google.iam.v1.IBinding[]|null); + + /** Policy auditConfigs */ + auditConfigs?: (google.iam.v1.IAuditConfig[]|null); + + /** Policy etag */ + etag?: (Uint8Array|Buffer|string|null); + } + + /** Represents a Policy. */ + class Policy implements IPolicy { + + /** + * Constructs a new Policy. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IPolicy); + + /** Policy version. */ + public version: number; + + /** Policy bindings. */ + public bindings: google.iam.v1.IBinding[]; + + /** Policy auditConfigs. */ + public auditConfigs: google.iam.v1.IAuditConfig[]; + + /** Policy etag. */ + public etag: (Uint8Array|Buffer|string); + + /** + * Creates a new Policy instance using the specified properties. + * @param [properties] Properties to set + * @returns Policy instance + */ + public static create(properties?: google.iam.v1.IPolicy): google.iam.v1.Policy; + + /** + * Encodes the specified Policy message. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @param message Policy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Policy message, length delimited. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @param message Policy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Policy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.Policy; + + /** + * Decodes a Policy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.Policy; + + /** + * Verifies a Policy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Policy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Policy + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.Policy; + + /** + * Creates a plain object from a Policy message. Also converts values to other types if specified. + * @param message Policy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.Policy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Policy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Policy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Binding. */ + interface IBinding { + + /** Binding role */ + role?: (string|null); + + /** Binding members */ + members?: (string[]|null); + + /** Binding condition */ + condition?: (google.type.IExpr|null); + } + + /** Represents a Binding. */ + class Binding implements IBinding { + + /** + * Constructs a new Binding. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IBinding); + + /** Binding role. */ + public role: string; + + /** Binding members. */ + public members: string[]; + + /** Binding condition. */ + public condition?: (google.type.IExpr|null); + + /** + * Creates a new Binding instance using the specified properties. + * @param [properties] Properties to set + * @returns Binding instance + */ + public static create(properties?: google.iam.v1.IBinding): google.iam.v1.Binding; + + /** + * Encodes the specified Binding message. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @param message Binding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IBinding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Binding message, length delimited. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @param message Binding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IBinding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Binding message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Binding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.Binding; + + /** + * Decodes a Binding message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Binding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.Binding; + + /** + * Verifies a Binding message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Binding message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Binding + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.Binding; + + /** + * Creates a plain object from a Binding message. Also converts values to other types if specified. + * @param message Binding + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.Binding, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Binding to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Binding + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AuditConfig. */ + interface IAuditConfig { + + /** AuditConfig service */ + service?: (string|null); + + /** AuditConfig auditLogConfigs */ + auditLogConfigs?: (google.iam.v1.IAuditLogConfig[]|null); + } + + /** Represents an AuditConfig. */ + class AuditConfig implements IAuditConfig { + + /** + * Constructs a new AuditConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IAuditConfig); + + /** AuditConfig service. */ + public service: string; + + /** AuditConfig auditLogConfigs. */ + public auditLogConfigs: google.iam.v1.IAuditLogConfig[]; + + /** + * Creates a new AuditConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AuditConfig instance + */ + public static create(properties?: google.iam.v1.IAuditConfig): google.iam.v1.AuditConfig; + + /** + * Encodes the specified AuditConfig message. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. + * @param message AuditConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IAuditConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuditConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. + * @param message AuditConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IAuditConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuditConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuditConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.AuditConfig; + + /** + * Decodes an AuditConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuditConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.AuditConfig; + + /** + * Verifies an AuditConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AuditConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuditConfig + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditConfig; + + /** + * Creates a plain object from an AuditConfig message. Also converts values to other types if specified. + * @param message AuditConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.AuditConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuditConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AuditConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AuditLogConfig. */ + interface IAuditLogConfig { + + /** AuditLogConfig logType */ + logType?: (google.iam.v1.AuditLogConfig.LogType|keyof typeof google.iam.v1.AuditLogConfig.LogType|null); + + /** AuditLogConfig exemptedMembers */ + exemptedMembers?: (string[]|null); + } + + /** Represents an AuditLogConfig. */ + class AuditLogConfig implements IAuditLogConfig { + + /** + * Constructs a new AuditLogConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IAuditLogConfig); + + /** AuditLogConfig logType. */ + public logType: (google.iam.v1.AuditLogConfig.LogType|keyof typeof google.iam.v1.AuditLogConfig.LogType); + + /** AuditLogConfig exemptedMembers. */ + public exemptedMembers: string[]; + + /** + * Creates a new AuditLogConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AuditLogConfig instance + */ + public static create(properties?: google.iam.v1.IAuditLogConfig): google.iam.v1.AuditLogConfig; + + /** + * Encodes the specified AuditLogConfig message. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. + * @param message AuditLogConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IAuditLogConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuditLogConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. + * @param message AuditLogConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IAuditLogConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuditLogConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuditLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.AuditLogConfig; + + /** + * Decodes an AuditLogConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuditLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.AuditLogConfig; + + /** + * Verifies an AuditLogConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AuditLogConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuditLogConfig + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditLogConfig; + + /** + * Creates a plain object from an AuditLogConfig message. Also converts values to other types if specified. + * @param message AuditLogConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.AuditLogConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuditLogConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AuditLogConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AuditLogConfig { + + /** LogType enum. */ + enum LogType { + LOG_TYPE_UNSPECIFIED = 0, + ADMIN_READ = 1, + DATA_WRITE = 2, + DATA_READ = 3 + } + } + + /** Properties of a PolicyDelta. */ + interface IPolicyDelta { + + /** PolicyDelta bindingDeltas */ + bindingDeltas?: (google.iam.v1.IBindingDelta[]|null); + + /** PolicyDelta auditConfigDeltas */ + auditConfigDeltas?: (google.iam.v1.IAuditConfigDelta[]|null); + } + + /** Represents a PolicyDelta. */ + class PolicyDelta implements IPolicyDelta { + + /** + * Constructs a new PolicyDelta. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IPolicyDelta); + + /** PolicyDelta bindingDeltas. */ + public bindingDeltas: google.iam.v1.IBindingDelta[]; + + /** PolicyDelta auditConfigDeltas. */ + public auditConfigDeltas: google.iam.v1.IAuditConfigDelta[]; + + /** + * Creates a new PolicyDelta instance using the specified properties. + * @param [properties] Properties to set + * @returns PolicyDelta instance + */ + public static create(properties?: google.iam.v1.IPolicyDelta): google.iam.v1.PolicyDelta; + + /** + * Encodes the specified PolicyDelta message. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @param message PolicyDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IPolicyDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PolicyDelta message, length delimited. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @param message PolicyDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IPolicyDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PolicyDelta message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PolicyDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.PolicyDelta; + + /** + * Decodes a PolicyDelta message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PolicyDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.PolicyDelta; + + /** + * Verifies a PolicyDelta message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PolicyDelta message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PolicyDelta + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.PolicyDelta; + + /** + * Creates a plain object from a PolicyDelta message. Also converts values to other types if specified. + * @param message PolicyDelta + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.PolicyDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PolicyDelta to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PolicyDelta + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BindingDelta. */ + interface IBindingDelta { + + /** BindingDelta action */ + action?: (google.iam.v1.BindingDelta.Action|keyof typeof google.iam.v1.BindingDelta.Action|null); + + /** BindingDelta role */ + role?: (string|null); + + /** BindingDelta member */ + member?: (string|null); + + /** BindingDelta condition */ + condition?: (google.type.IExpr|null); + } + + /** Represents a BindingDelta. */ + class BindingDelta implements IBindingDelta { + + /** + * Constructs a new BindingDelta. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IBindingDelta); + + /** BindingDelta action. */ + public action: (google.iam.v1.BindingDelta.Action|keyof typeof google.iam.v1.BindingDelta.Action); + + /** BindingDelta role. */ + public role: string; + + /** BindingDelta member. */ + public member: string; + + /** BindingDelta condition. */ + public condition?: (google.type.IExpr|null); + + /** + * Creates a new BindingDelta instance using the specified properties. + * @param [properties] Properties to set + * @returns BindingDelta instance + */ + public static create(properties?: google.iam.v1.IBindingDelta): google.iam.v1.BindingDelta; + + /** + * Encodes the specified BindingDelta message. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @param message BindingDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IBindingDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BindingDelta message, length delimited. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @param message BindingDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IBindingDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BindingDelta message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BindingDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.BindingDelta; + + /** + * Decodes a BindingDelta message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BindingDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.BindingDelta; + + /** + * Verifies a BindingDelta message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BindingDelta message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BindingDelta + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.BindingDelta; + + /** + * Creates a plain object from a BindingDelta message. Also converts values to other types if specified. + * @param message BindingDelta + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.BindingDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BindingDelta to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BindingDelta + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BindingDelta { + + /** Action enum. */ + enum Action { + ACTION_UNSPECIFIED = 0, + ADD = 1, + REMOVE = 2 + } + } + + /** Properties of an AuditConfigDelta. */ + interface IAuditConfigDelta { + + /** AuditConfigDelta action */ + action?: (google.iam.v1.AuditConfigDelta.Action|keyof typeof google.iam.v1.AuditConfigDelta.Action|null); + + /** AuditConfigDelta service */ + service?: (string|null); + + /** AuditConfigDelta exemptedMember */ + exemptedMember?: (string|null); + + /** AuditConfigDelta logType */ + logType?: (string|null); + } + + /** Represents an AuditConfigDelta. */ + class AuditConfigDelta implements IAuditConfigDelta { + + /** + * Constructs a new AuditConfigDelta. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IAuditConfigDelta); + + /** AuditConfigDelta action. */ + public action: (google.iam.v1.AuditConfigDelta.Action|keyof typeof google.iam.v1.AuditConfigDelta.Action); + + /** AuditConfigDelta service. */ + public service: string; + + /** AuditConfigDelta exemptedMember. */ + public exemptedMember: string; + + /** AuditConfigDelta logType. */ + public logType: string; + + /** + * Creates a new AuditConfigDelta instance using the specified properties. + * @param [properties] Properties to set + * @returns AuditConfigDelta instance + */ + public static create(properties?: google.iam.v1.IAuditConfigDelta): google.iam.v1.AuditConfigDelta; + + /** + * Encodes the specified AuditConfigDelta message. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @param message AuditConfigDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IAuditConfigDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuditConfigDelta message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @param message AuditConfigDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IAuditConfigDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuditConfigDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.AuditConfigDelta; + + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuditConfigDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.AuditConfigDelta; + + /** + * Verifies an AuditConfigDelta message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AuditConfigDelta message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuditConfigDelta + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditConfigDelta; + + /** + * Creates a plain object from an AuditConfigDelta message. Also converts values to other types if specified. + * @param message AuditConfigDelta + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.AuditConfigDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuditConfigDelta to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AuditConfigDelta + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AuditConfigDelta { + + /** Action enum. */ + enum Action { + ACTION_UNSPECIFIED = 0, + ADD = 1, + REMOVE = 2 + } + } + } + } + + /** Namespace type. */ + namespace type { + + /** Properties of an Expr. */ + interface IExpr { + + /** Expr expression */ + expression?: (string|null); + + /** Expr title */ + title?: (string|null); + + /** Expr description */ + description?: (string|null); + + /** Expr location */ + location?: (string|null); + } + + /** Represents an Expr. */ + class Expr implements IExpr { + + /** + * Constructs a new Expr. + * @param [properties] Properties to set + */ + constructor(properties?: google.type.IExpr); + + /** Expr expression. */ + public expression: string; + + /** Expr title. */ + public title: string; + + /** Expr description. */ + public description: string; + + /** Expr location. */ + public location: string; + + /** + * Creates a new Expr instance using the specified properties. + * @param [properties] Properties to set + * @returns Expr instance + */ + public static create(properties?: google.type.IExpr): google.type.Expr; + + /** + * Encodes the specified Expr message. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @param message Expr message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.type.IExpr, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Expr message, length delimited. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @param message Expr message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.type.IExpr, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Expr message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.type.Expr; + + /** + * Decodes an Expr message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.type.Expr; + + /** + * Verifies an Expr message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Expr message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Expr + */ + public static fromObject(object: { [k: string]: any }): google.type.Expr; + + /** + * Creates a plain object from an Expr message. Also converts values to other types if specified. + * @param message Expr + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.type.Expr, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Expr to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Expr + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } +} diff --git a/owl-bot-staging/admin/database/v1/protos/protos.js b/owl-bot-staging/admin/database/v1/protos/protos.js new file mode 100644 index 000000000..b8aa818b1 --- /dev/null +++ b/owl-bot-staging/admin/database/v1/protos/protos.js @@ -0,0 +1,43422 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +(function(global, factory) { /* global define, require, module */ + + /* AMD */ if (typeof define === 'function' && define.amd) + define(["protobufjs/minimal"], factory); + + /* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports) + module.exports = factory(require("google-gax/build/src/protobuf").protobufMinimal); + +})(this, function($protobuf) { + "use strict"; + + // Common aliases + var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + + // Exported root namespace + var $root = $protobuf.roots._google_cloud_spanner_protos || ($protobuf.roots._google_cloud_spanner_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.spanner = (function() { + + /** + * Namespace spanner. + * @memberof google + * @namespace + */ + var spanner = {}; + + spanner.admin = (function() { + + /** + * Namespace admin. + * @memberof google.spanner + * @namespace + */ + var admin = {}; + + admin.database = (function() { + + /** + * Namespace database. + * @memberof google.spanner.admin + * @namespace + */ + var database = {}; + + database.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.spanner.admin.database + * @namespace + */ + var v1 = {}; + + v1.Backup = (function() { + + /** + * Properties of a Backup. + * @memberof google.spanner.admin.database.v1 + * @interface IBackup + * @property {string|null} [database] Backup database + * @property {google.protobuf.ITimestamp|null} [versionTime] Backup versionTime + * @property {google.protobuf.ITimestamp|null} [expireTime] Backup expireTime + * @property {string|null} [name] Backup name + * @property {google.protobuf.ITimestamp|null} [createTime] Backup createTime + * @property {number|Long|null} [sizeBytes] Backup sizeBytes + * @property {number|Long|null} [freeableSizeBytes] Backup freeableSizeBytes + * @property {number|Long|null} [exclusiveSizeBytes] Backup exclusiveSizeBytes + * @property {google.spanner.admin.database.v1.Backup.State|null} [state] Backup state + * @property {Array.|null} [referencingDatabases] Backup referencingDatabases + * @property {google.spanner.admin.database.v1.IEncryptionInfo|null} [encryptionInfo] Backup encryptionInfo + * @property {Array.|null} [encryptionInformation] Backup encryptionInformation + * @property {google.spanner.admin.database.v1.DatabaseDialect|null} [databaseDialect] Backup databaseDialect + * @property {Array.|null} [referencingBackups] Backup referencingBackups + * @property {google.protobuf.ITimestamp|null} [maxExpireTime] Backup maxExpireTime + * @property {Array.|null} [backupSchedules] Backup backupSchedules + * @property {string|null} [incrementalBackupChainId] Backup incrementalBackupChainId + * @property {google.protobuf.ITimestamp|null} [oldestVersionTime] Backup oldestVersionTime + * @property {Array.|null} [instancePartitions] Backup instancePartitions + */ + + /** + * Constructs a new Backup. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents a Backup. + * @implements IBackup + * @constructor + * @param {google.spanner.admin.database.v1.IBackup=} [properties] Properties to set + */ + function Backup(properties) { + this.referencingDatabases = []; + this.encryptionInformation = []; + this.referencingBackups = []; + this.backupSchedules = []; + this.instancePartitions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Backup database. + * @member {string} database + * @memberof google.spanner.admin.database.v1.Backup + * @instance + */ + Backup.prototype.database = ""; + + /** + * Backup versionTime. + * @member {google.protobuf.ITimestamp|null|undefined} versionTime + * @memberof google.spanner.admin.database.v1.Backup + * @instance + */ + Backup.prototype.versionTime = null; + + /** + * Backup expireTime. + * @member {google.protobuf.ITimestamp|null|undefined} expireTime + * @memberof google.spanner.admin.database.v1.Backup + * @instance + */ + Backup.prototype.expireTime = null; + + /** + * Backup name. + * @member {string} name + * @memberof google.spanner.admin.database.v1.Backup + * @instance + */ + Backup.prototype.name = ""; + + /** + * Backup createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.spanner.admin.database.v1.Backup + * @instance + */ + Backup.prototype.createTime = null; + + /** + * Backup sizeBytes. + * @member {number|Long} sizeBytes + * @memberof google.spanner.admin.database.v1.Backup + * @instance + */ + Backup.prototype.sizeBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Backup freeableSizeBytes. + * @member {number|Long} freeableSizeBytes + * @memberof google.spanner.admin.database.v1.Backup + * @instance + */ + Backup.prototype.freeableSizeBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Backup exclusiveSizeBytes. + * @member {number|Long} exclusiveSizeBytes + * @memberof google.spanner.admin.database.v1.Backup + * @instance + */ + Backup.prototype.exclusiveSizeBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Backup state. + * @member {google.spanner.admin.database.v1.Backup.State} state + * @memberof google.spanner.admin.database.v1.Backup + * @instance + */ + Backup.prototype.state = 0; + + /** + * Backup referencingDatabases. + * @member {Array.} referencingDatabases + * @memberof google.spanner.admin.database.v1.Backup + * @instance + */ + Backup.prototype.referencingDatabases = $util.emptyArray; + + /** + * Backup encryptionInfo. + * @member {google.spanner.admin.database.v1.IEncryptionInfo|null|undefined} encryptionInfo + * @memberof google.spanner.admin.database.v1.Backup + * @instance + */ + Backup.prototype.encryptionInfo = null; + + /** + * Backup encryptionInformation. + * @member {Array.} encryptionInformation + * @memberof google.spanner.admin.database.v1.Backup + * @instance + */ + Backup.prototype.encryptionInformation = $util.emptyArray; + + /** + * Backup databaseDialect. + * @member {google.spanner.admin.database.v1.DatabaseDialect} databaseDialect + * @memberof google.spanner.admin.database.v1.Backup + * @instance + */ + Backup.prototype.databaseDialect = 0; + + /** + * Backup referencingBackups. + * @member {Array.} referencingBackups + * @memberof google.spanner.admin.database.v1.Backup + * @instance + */ + Backup.prototype.referencingBackups = $util.emptyArray; + + /** + * Backup maxExpireTime. + * @member {google.protobuf.ITimestamp|null|undefined} maxExpireTime + * @memberof google.spanner.admin.database.v1.Backup + * @instance + */ + Backup.prototype.maxExpireTime = null; + + /** + * Backup backupSchedules. + * @member {Array.} backupSchedules + * @memberof google.spanner.admin.database.v1.Backup + * @instance + */ + Backup.prototype.backupSchedules = $util.emptyArray; + + /** + * Backup incrementalBackupChainId. + * @member {string} incrementalBackupChainId + * @memberof google.spanner.admin.database.v1.Backup + * @instance + */ + Backup.prototype.incrementalBackupChainId = ""; + + /** + * Backup oldestVersionTime. + * @member {google.protobuf.ITimestamp|null|undefined} oldestVersionTime + * @memberof google.spanner.admin.database.v1.Backup + * @instance + */ + Backup.prototype.oldestVersionTime = null; + + /** + * Backup instancePartitions. + * @member {Array.} instancePartitions + * @memberof google.spanner.admin.database.v1.Backup + * @instance + */ + Backup.prototype.instancePartitions = $util.emptyArray; + + /** + * Creates a new Backup instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.Backup + * @static + * @param {google.spanner.admin.database.v1.IBackup=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.Backup} Backup instance + */ + Backup.create = function create(properties) { + return new Backup(properties); + }; + + /** + * Encodes the specified Backup message. Does not implicitly {@link google.spanner.admin.database.v1.Backup.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.Backup + * @static + * @param {google.spanner.admin.database.v1.IBackup} message Backup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Backup.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.database != null && Object.hasOwnProperty.call(message, "database")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.database); + if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) + $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.sizeBytes != null && Object.hasOwnProperty.call(message, "sizeBytes")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.sizeBytes); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.state); + if (message.referencingDatabases != null && message.referencingDatabases.length) + for (var i = 0; i < message.referencingDatabases.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.referencingDatabases[i]); + if (message.encryptionInfo != null && Object.hasOwnProperty.call(message, "encryptionInfo")) + $root.google.spanner.admin.database.v1.EncryptionInfo.encode(message.encryptionInfo, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.versionTime != null && Object.hasOwnProperty.call(message, "versionTime")) + $root.google.protobuf.Timestamp.encode(message.versionTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.databaseDialect != null && Object.hasOwnProperty.call(message, "databaseDialect")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.databaseDialect); + if (message.referencingBackups != null && message.referencingBackups.length) + for (var i = 0; i < message.referencingBackups.length; ++i) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.referencingBackups[i]); + if (message.maxExpireTime != null && Object.hasOwnProperty.call(message, "maxExpireTime")) + $root.google.protobuf.Timestamp.encode(message.maxExpireTime, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.encryptionInformation != null && message.encryptionInformation.length) + for (var i = 0; i < message.encryptionInformation.length; ++i) + $root.google.spanner.admin.database.v1.EncryptionInfo.encode(message.encryptionInformation[i], writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.backupSchedules != null && message.backupSchedules.length) + for (var i = 0; i < message.backupSchedules.length; ++i) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.backupSchedules[i]); + if (message.freeableSizeBytes != null && Object.hasOwnProperty.call(message, "freeableSizeBytes")) + writer.uint32(/* id 15, wireType 0 =*/120).int64(message.freeableSizeBytes); + if (message.exclusiveSizeBytes != null && Object.hasOwnProperty.call(message, "exclusiveSizeBytes")) + writer.uint32(/* id 16, wireType 0 =*/128).int64(message.exclusiveSizeBytes); + if (message.incrementalBackupChainId != null && Object.hasOwnProperty.call(message, "incrementalBackupChainId")) + writer.uint32(/* id 17, wireType 2 =*/138).string(message.incrementalBackupChainId); + if (message.oldestVersionTime != null && Object.hasOwnProperty.call(message, "oldestVersionTime")) + $root.google.protobuf.Timestamp.encode(message.oldestVersionTime, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.instancePartitions != null && message.instancePartitions.length) + for (var i = 0; i < message.instancePartitions.length; ++i) + $root.google.spanner.admin.database.v1.BackupInstancePartition.encode(message.instancePartitions[i], writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Backup message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.Backup.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.Backup + * @static + * @param {google.spanner.admin.database.v1.IBackup} message Backup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Backup.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Backup message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.Backup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.Backup} Backup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Backup.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.Backup(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.database = reader.string(); + break; + } + case 9: { + message.versionTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 1: { + message.name = reader.string(); + break; + } + case 4: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.sizeBytes = reader.int64(); + break; + } + case 15: { + message.freeableSizeBytes = reader.int64(); + break; + } + case 16: { + message.exclusiveSizeBytes = reader.int64(); + break; + } + case 6: { + message.state = reader.int32(); + break; + } + case 7: { + if (!(message.referencingDatabases && message.referencingDatabases.length)) + message.referencingDatabases = []; + message.referencingDatabases.push(reader.string()); + break; + } + case 8: { + message.encryptionInfo = $root.google.spanner.admin.database.v1.EncryptionInfo.decode(reader, reader.uint32()); + break; + } + case 13: { + if (!(message.encryptionInformation && message.encryptionInformation.length)) + message.encryptionInformation = []; + message.encryptionInformation.push($root.google.spanner.admin.database.v1.EncryptionInfo.decode(reader, reader.uint32())); + break; + } + case 10: { + message.databaseDialect = reader.int32(); + break; + } + case 11: { + if (!(message.referencingBackups && message.referencingBackups.length)) + message.referencingBackups = []; + message.referencingBackups.push(reader.string()); + break; + } + case 12: { + message.maxExpireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 14: { + if (!(message.backupSchedules && message.backupSchedules.length)) + message.backupSchedules = []; + message.backupSchedules.push(reader.string()); + break; + } + case 17: { + message.incrementalBackupChainId = reader.string(); + break; + } + case 18: { + message.oldestVersionTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 19: { + if (!(message.instancePartitions && message.instancePartitions.length)) + message.instancePartitions = []; + message.instancePartitions.push($root.google.spanner.admin.database.v1.BackupInstancePartition.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Backup message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.Backup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.Backup} Backup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Backup.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Backup message. + * @function verify + * @memberof google.spanner.admin.database.v1.Backup + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Backup.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.database != null && message.hasOwnProperty("database")) + if (!$util.isString(message.database)) + return "database: string expected"; + if (message.versionTime != null && message.hasOwnProperty("versionTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.versionTime); + if (error) + return "versionTime." + error; + } + if (message.expireTime != null && message.hasOwnProperty("expireTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.expireTime); + if (error) + return "expireTime." + error; + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.sizeBytes != null && message.hasOwnProperty("sizeBytes")) + if (!$util.isInteger(message.sizeBytes) && !(message.sizeBytes && $util.isInteger(message.sizeBytes.low) && $util.isInteger(message.sizeBytes.high))) + return "sizeBytes: integer|Long expected"; + if (message.freeableSizeBytes != null && message.hasOwnProperty("freeableSizeBytes")) + if (!$util.isInteger(message.freeableSizeBytes) && !(message.freeableSizeBytes && $util.isInteger(message.freeableSizeBytes.low) && $util.isInteger(message.freeableSizeBytes.high))) + return "freeableSizeBytes: integer|Long expected"; + if (message.exclusiveSizeBytes != null && message.hasOwnProperty("exclusiveSizeBytes")) + if (!$util.isInteger(message.exclusiveSizeBytes) && !(message.exclusiveSizeBytes && $util.isInteger(message.exclusiveSizeBytes.low) && $util.isInteger(message.exclusiveSizeBytes.high))) + return "exclusiveSizeBytes: integer|Long expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.referencingDatabases != null && message.hasOwnProperty("referencingDatabases")) { + if (!Array.isArray(message.referencingDatabases)) + return "referencingDatabases: array expected"; + for (var i = 0; i < message.referencingDatabases.length; ++i) + if (!$util.isString(message.referencingDatabases[i])) + return "referencingDatabases: string[] expected"; + } + if (message.encryptionInfo != null && message.hasOwnProperty("encryptionInfo")) { + var error = $root.google.spanner.admin.database.v1.EncryptionInfo.verify(message.encryptionInfo); + if (error) + return "encryptionInfo." + error; + } + if (message.encryptionInformation != null && message.hasOwnProperty("encryptionInformation")) { + if (!Array.isArray(message.encryptionInformation)) + return "encryptionInformation: array expected"; + for (var i = 0; i < message.encryptionInformation.length; ++i) { + var error = $root.google.spanner.admin.database.v1.EncryptionInfo.verify(message.encryptionInformation[i]); + if (error) + return "encryptionInformation." + error; + } + } + if (message.databaseDialect != null && message.hasOwnProperty("databaseDialect")) + switch (message.databaseDialect) { + default: + return "databaseDialect: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.referencingBackups != null && message.hasOwnProperty("referencingBackups")) { + if (!Array.isArray(message.referencingBackups)) + return "referencingBackups: array expected"; + for (var i = 0; i < message.referencingBackups.length; ++i) + if (!$util.isString(message.referencingBackups[i])) + return "referencingBackups: string[] expected"; + } + if (message.maxExpireTime != null && message.hasOwnProperty("maxExpireTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.maxExpireTime); + if (error) + return "maxExpireTime." + error; + } + if (message.backupSchedules != null && message.hasOwnProperty("backupSchedules")) { + if (!Array.isArray(message.backupSchedules)) + return "backupSchedules: array expected"; + for (var i = 0; i < message.backupSchedules.length; ++i) + if (!$util.isString(message.backupSchedules[i])) + return "backupSchedules: string[] expected"; + } + if (message.incrementalBackupChainId != null && message.hasOwnProperty("incrementalBackupChainId")) + if (!$util.isString(message.incrementalBackupChainId)) + return "incrementalBackupChainId: string expected"; + if (message.oldestVersionTime != null && message.hasOwnProperty("oldestVersionTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.oldestVersionTime); + if (error) + return "oldestVersionTime." + error; + } + if (message.instancePartitions != null && message.hasOwnProperty("instancePartitions")) { + if (!Array.isArray(message.instancePartitions)) + return "instancePartitions: array expected"; + for (var i = 0; i < message.instancePartitions.length; ++i) { + var error = $root.google.spanner.admin.database.v1.BackupInstancePartition.verify(message.instancePartitions[i]); + if (error) + return "instancePartitions." + error; + } + } + return null; + }; + + /** + * Creates a Backup message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.Backup + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.Backup} Backup + */ + Backup.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.Backup) + return object; + var message = new $root.google.spanner.admin.database.v1.Backup(); + if (object.database != null) + message.database = String(object.database); + if (object.versionTime != null) { + if (typeof object.versionTime !== "object") + throw TypeError(".google.spanner.admin.database.v1.Backup.versionTime: object expected"); + message.versionTime = $root.google.protobuf.Timestamp.fromObject(object.versionTime); + } + if (object.expireTime != null) { + if (typeof object.expireTime !== "object") + throw TypeError(".google.spanner.admin.database.v1.Backup.expireTime: object expected"); + message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); + } + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.spanner.admin.database.v1.Backup.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.sizeBytes != null) + if ($util.Long) + (message.sizeBytes = $util.Long.fromValue(object.sizeBytes)).unsigned = false; + else if (typeof object.sizeBytes === "string") + message.sizeBytes = parseInt(object.sizeBytes, 10); + else if (typeof object.sizeBytes === "number") + message.sizeBytes = object.sizeBytes; + else if (typeof object.sizeBytes === "object") + message.sizeBytes = new $util.LongBits(object.sizeBytes.low >>> 0, object.sizeBytes.high >>> 0).toNumber(); + if (object.freeableSizeBytes != null) + if ($util.Long) + (message.freeableSizeBytes = $util.Long.fromValue(object.freeableSizeBytes)).unsigned = false; + else if (typeof object.freeableSizeBytes === "string") + message.freeableSizeBytes = parseInt(object.freeableSizeBytes, 10); + else if (typeof object.freeableSizeBytes === "number") + message.freeableSizeBytes = object.freeableSizeBytes; + else if (typeof object.freeableSizeBytes === "object") + message.freeableSizeBytes = new $util.LongBits(object.freeableSizeBytes.low >>> 0, object.freeableSizeBytes.high >>> 0).toNumber(); + if (object.exclusiveSizeBytes != null) + if ($util.Long) + (message.exclusiveSizeBytes = $util.Long.fromValue(object.exclusiveSizeBytes)).unsigned = false; + else if (typeof object.exclusiveSizeBytes === "string") + message.exclusiveSizeBytes = parseInt(object.exclusiveSizeBytes, 10); + else if (typeof object.exclusiveSizeBytes === "number") + message.exclusiveSizeBytes = object.exclusiveSizeBytes; + else if (typeof object.exclusiveSizeBytes === "object") + message.exclusiveSizeBytes = new $util.LongBits(object.exclusiveSizeBytes.low >>> 0, object.exclusiveSizeBytes.high >>> 0).toNumber(); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "CREATING": + case 1: + message.state = 1; + break; + case "READY": + case 2: + message.state = 2; + break; + } + if (object.referencingDatabases) { + if (!Array.isArray(object.referencingDatabases)) + throw TypeError(".google.spanner.admin.database.v1.Backup.referencingDatabases: array expected"); + message.referencingDatabases = []; + for (var i = 0; i < object.referencingDatabases.length; ++i) + message.referencingDatabases[i] = String(object.referencingDatabases[i]); + } + if (object.encryptionInfo != null) { + if (typeof object.encryptionInfo !== "object") + throw TypeError(".google.spanner.admin.database.v1.Backup.encryptionInfo: object expected"); + message.encryptionInfo = $root.google.spanner.admin.database.v1.EncryptionInfo.fromObject(object.encryptionInfo); + } + if (object.encryptionInformation) { + if (!Array.isArray(object.encryptionInformation)) + throw TypeError(".google.spanner.admin.database.v1.Backup.encryptionInformation: array expected"); + message.encryptionInformation = []; + for (var i = 0; i < object.encryptionInformation.length; ++i) { + if (typeof object.encryptionInformation[i] !== "object") + throw TypeError(".google.spanner.admin.database.v1.Backup.encryptionInformation: object expected"); + message.encryptionInformation[i] = $root.google.spanner.admin.database.v1.EncryptionInfo.fromObject(object.encryptionInformation[i]); + } + } + switch (object.databaseDialect) { + default: + if (typeof object.databaseDialect === "number") { + message.databaseDialect = object.databaseDialect; + break; + } + break; + case "DATABASE_DIALECT_UNSPECIFIED": + case 0: + message.databaseDialect = 0; + break; + case "GOOGLE_STANDARD_SQL": + case 1: + message.databaseDialect = 1; + break; + case "POSTGRESQL": + case 2: + message.databaseDialect = 2; + break; + } + if (object.referencingBackups) { + if (!Array.isArray(object.referencingBackups)) + throw TypeError(".google.spanner.admin.database.v1.Backup.referencingBackups: array expected"); + message.referencingBackups = []; + for (var i = 0; i < object.referencingBackups.length; ++i) + message.referencingBackups[i] = String(object.referencingBackups[i]); + } + if (object.maxExpireTime != null) { + if (typeof object.maxExpireTime !== "object") + throw TypeError(".google.spanner.admin.database.v1.Backup.maxExpireTime: object expected"); + message.maxExpireTime = $root.google.protobuf.Timestamp.fromObject(object.maxExpireTime); + } + if (object.backupSchedules) { + if (!Array.isArray(object.backupSchedules)) + throw TypeError(".google.spanner.admin.database.v1.Backup.backupSchedules: array expected"); + message.backupSchedules = []; + for (var i = 0; i < object.backupSchedules.length; ++i) + message.backupSchedules[i] = String(object.backupSchedules[i]); + } + if (object.incrementalBackupChainId != null) + message.incrementalBackupChainId = String(object.incrementalBackupChainId); + if (object.oldestVersionTime != null) { + if (typeof object.oldestVersionTime !== "object") + throw TypeError(".google.spanner.admin.database.v1.Backup.oldestVersionTime: object expected"); + message.oldestVersionTime = $root.google.protobuf.Timestamp.fromObject(object.oldestVersionTime); + } + if (object.instancePartitions) { + if (!Array.isArray(object.instancePartitions)) + throw TypeError(".google.spanner.admin.database.v1.Backup.instancePartitions: array expected"); + message.instancePartitions = []; + for (var i = 0; i < object.instancePartitions.length; ++i) { + if (typeof object.instancePartitions[i] !== "object") + throw TypeError(".google.spanner.admin.database.v1.Backup.instancePartitions: object expected"); + message.instancePartitions[i] = $root.google.spanner.admin.database.v1.BackupInstancePartition.fromObject(object.instancePartitions[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Backup message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.Backup + * @static + * @param {google.spanner.admin.database.v1.Backup} message Backup + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Backup.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.referencingDatabases = []; + object.referencingBackups = []; + object.encryptionInformation = []; + object.backupSchedules = []; + object.instancePartitions = []; + } + if (options.defaults) { + object.name = ""; + object.database = ""; + object.expireTime = null; + object.createTime = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.sizeBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.sizeBytes = options.longs === String ? "0" : 0; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.encryptionInfo = null; + object.versionTime = null; + object.databaseDialect = options.enums === String ? "DATABASE_DIALECT_UNSPECIFIED" : 0; + object.maxExpireTime = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.freeableSizeBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.freeableSizeBytes = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.exclusiveSizeBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.exclusiveSizeBytes = options.longs === String ? "0" : 0; + object.incrementalBackupChainId = ""; + object.oldestVersionTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.database != null && message.hasOwnProperty("database")) + object.database = message.database; + if (message.expireTime != null && message.hasOwnProperty("expireTime")) + object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.sizeBytes != null && message.hasOwnProperty("sizeBytes")) + if (typeof message.sizeBytes === "number") + object.sizeBytes = options.longs === String ? String(message.sizeBytes) : message.sizeBytes; + else + object.sizeBytes = options.longs === String ? $util.Long.prototype.toString.call(message.sizeBytes) : options.longs === Number ? new $util.LongBits(message.sizeBytes.low >>> 0, message.sizeBytes.high >>> 0).toNumber() : message.sizeBytes; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.spanner.admin.database.v1.Backup.State[message.state] === undefined ? message.state : $root.google.spanner.admin.database.v1.Backup.State[message.state] : message.state; + if (message.referencingDatabases && message.referencingDatabases.length) { + object.referencingDatabases = []; + for (var j = 0; j < message.referencingDatabases.length; ++j) + object.referencingDatabases[j] = message.referencingDatabases[j]; + } + if (message.encryptionInfo != null && message.hasOwnProperty("encryptionInfo")) + object.encryptionInfo = $root.google.spanner.admin.database.v1.EncryptionInfo.toObject(message.encryptionInfo, options); + if (message.versionTime != null && message.hasOwnProperty("versionTime")) + object.versionTime = $root.google.protobuf.Timestamp.toObject(message.versionTime, options); + if (message.databaseDialect != null && message.hasOwnProperty("databaseDialect")) + object.databaseDialect = options.enums === String ? $root.google.spanner.admin.database.v1.DatabaseDialect[message.databaseDialect] === undefined ? message.databaseDialect : $root.google.spanner.admin.database.v1.DatabaseDialect[message.databaseDialect] : message.databaseDialect; + if (message.referencingBackups && message.referencingBackups.length) { + object.referencingBackups = []; + for (var j = 0; j < message.referencingBackups.length; ++j) + object.referencingBackups[j] = message.referencingBackups[j]; + } + if (message.maxExpireTime != null && message.hasOwnProperty("maxExpireTime")) + object.maxExpireTime = $root.google.protobuf.Timestamp.toObject(message.maxExpireTime, options); + if (message.encryptionInformation && message.encryptionInformation.length) { + object.encryptionInformation = []; + for (var j = 0; j < message.encryptionInformation.length; ++j) + object.encryptionInformation[j] = $root.google.spanner.admin.database.v1.EncryptionInfo.toObject(message.encryptionInformation[j], options); + } + if (message.backupSchedules && message.backupSchedules.length) { + object.backupSchedules = []; + for (var j = 0; j < message.backupSchedules.length; ++j) + object.backupSchedules[j] = message.backupSchedules[j]; + } + if (message.freeableSizeBytes != null && message.hasOwnProperty("freeableSizeBytes")) + if (typeof message.freeableSizeBytes === "number") + object.freeableSizeBytes = options.longs === String ? String(message.freeableSizeBytes) : message.freeableSizeBytes; + else + object.freeableSizeBytes = options.longs === String ? $util.Long.prototype.toString.call(message.freeableSizeBytes) : options.longs === Number ? new $util.LongBits(message.freeableSizeBytes.low >>> 0, message.freeableSizeBytes.high >>> 0).toNumber() : message.freeableSizeBytes; + if (message.exclusiveSizeBytes != null && message.hasOwnProperty("exclusiveSizeBytes")) + if (typeof message.exclusiveSizeBytes === "number") + object.exclusiveSizeBytes = options.longs === String ? String(message.exclusiveSizeBytes) : message.exclusiveSizeBytes; + else + object.exclusiveSizeBytes = options.longs === String ? $util.Long.prototype.toString.call(message.exclusiveSizeBytes) : options.longs === Number ? new $util.LongBits(message.exclusiveSizeBytes.low >>> 0, message.exclusiveSizeBytes.high >>> 0).toNumber() : message.exclusiveSizeBytes; + if (message.incrementalBackupChainId != null && message.hasOwnProperty("incrementalBackupChainId")) + object.incrementalBackupChainId = message.incrementalBackupChainId; + if (message.oldestVersionTime != null && message.hasOwnProperty("oldestVersionTime")) + object.oldestVersionTime = $root.google.protobuf.Timestamp.toObject(message.oldestVersionTime, options); + if (message.instancePartitions && message.instancePartitions.length) { + object.instancePartitions = []; + for (var j = 0; j < message.instancePartitions.length; ++j) + object.instancePartitions[j] = $root.google.spanner.admin.database.v1.BackupInstancePartition.toObject(message.instancePartitions[j], options); + } + return object; + }; + + /** + * Converts this Backup to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.Backup + * @instance + * @returns {Object.} JSON object + */ + Backup.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Backup + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.Backup + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Backup.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.Backup"; + }; + + /** + * State enum. + * @name google.spanner.admin.database.v1.Backup.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} CREATING=1 CREATING value + * @property {number} READY=2 READY value + */ + Backup.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CREATING"] = 1; + values[valuesById[2] = "READY"] = 2; + return values; + })(); + + return Backup; + })(); + + v1.CreateBackupRequest = (function() { + + /** + * Properties of a CreateBackupRequest. + * @memberof google.spanner.admin.database.v1 + * @interface ICreateBackupRequest + * @property {string|null} [parent] CreateBackupRequest parent + * @property {string|null} [backupId] CreateBackupRequest backupId + * @property {google.spanner.admin.database.v1.IBackup|null} [backup] CreateBackupRequest backup + * @property {google.spanner.admin.database.v1.ICreateBackupEncryptionConfig|null} [encryptionConfig] CreateBackupRequest encryptionConfig + */ + + /** + * Constructs a new CreateBackupRequest. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents a CreateBackupRequest. + * @implements ICreateBackupRequest + * @constructor + * @param {google.spanner.admin.database.v1.ICreateBackupRequest=} [properties] Properties to set + */ + function CreateBackupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateBackupRequest parent. + * @member {string} parent + * @memberof google.spanner.admin.database.v1.CreateBackupRequest + * @instance + */ + CreateBackupRequest.prototype.parent = ""; + + /** + * CreateBackupRequest backupId. + * @member {string} backupId + * @memberof google.spanner.admin.database.v1.CreateBackupRequest + * @instance + */ + CreateBackupRequest.prototype.backupId = ""; + + /** + * CreateBackupRequest backup. + * @member {google.spanner.admin.database.v1.IBackup|null|undefined} backup + * @memberof google.spanner.admin.database.v1.CreateBackupRequest + * @instance + */ + CreateBackupRequest.prototype.backup = null; + + /** + * CreateBackupRequest encryptionConfig. + * @member {google.spanner.admin.database.v1.ICreateBackupEncryptionConfig|null|undefined} encryptionConfig + * @memberof google.spanner.admin.database.v1.CreateBackupRequest + * @instance + */ + CreateBackupRequest.prototype.encryptionConfig = null; + + /** + * Creates a new CreateBackupRequest instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.CreateBackupRequest + * @static + * @param {google.spanner.admin.database.v1.ICreateBackupRequest=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.CreateBackupRequest} CreateBackupRequest instance + */ + CreateBackupRequest.create = function create(properties) { + return new CreateBackupRequest(properties); + }; + + /** + * Encodes the specified CreateBackupRequest message. Does not implicitly {@link google.spanner.admin.database.v1.CreateBackupRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.CreateBackupRequest + * @static + * @param {google.spanner.admin.database.v1.ICreateBackupRequest} message CreateBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateBackupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.backupId != null && Object.hasOwnProperty.call(message, "backupId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.backupId); + if (message.backup != null && Object.hasOwnProperty.call(message, "backup")) + $root.google.spanner.admin.database.v1.Backup.encode(message.backup, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) + $root.google.spanner.admin.database.v1.CreateBackupEncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateBackupRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.CreateBackupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.CreateBackupRequest + * @static + * @param {google.spanner.admin.database.v1.ICreateBackupRequest} message CreateBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateBackupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.CreateBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.CreateBackupRequest} CreateBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateBackupRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.CreateBackupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.backupId = reader.string(); + break; + } + case 3: { + message.backup = $root.google.spanner.admin.database.v1.Backup.decode(reader, reader.uint32()); + break; + } + case 4: { + message.encryptionConfig = $root.google.spanner.admin.database.v1.CreateBackupEncryptionConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateBackupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.CreateBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.CreateBackupRequest} CreateBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateBackupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateBackupRequest message. + * @function verify + * @memberof google.spanner.admin.database.v1.CreateBackupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateBackupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.backupId != null && message.hasOwnProperty("backupId")) + if (!$util.isString(message.backupId)) + return "backupId: string expected"; + if (message.backup != null && message.hasOwnProperty("backup")) { + var error = $root.google.spanner.admin.database.v1.Backup.verify(message.backup); + if (error) + return "backup." + error; + } + if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { + var error = $root.google.spanner.admin.database.v1.CreateBackupEncryptionConfig.verify(message.encryptionConfig); + if (error) + return "encryptionConfig." + error; + } + return null; + }; + + /** + * Creates a CreateBackupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.CreateBackupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.CreateBackupRequest} CreateBackupRequest + */ + CreateBackupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.CreateBackupRequest) + return object; + var message = new $root.google.spanner.admin.database.v1.CreateBackupRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.backupId != null) + message.backupId = String(object.backupId); + if (object.backup != null) { + if (typeof object.backup !== "object") + throw TypeError(".google.spanner.admin.database.v1.CreateBackupRequest.backup: object expected"); + message.backup = $root.google.spanner.admin.database.v1.Backup.fromObject(object.backup); + } + if (object.encryptionConfig != null) { + if (typeof object.encryptionConfig !== "object") + throw TypeError(".google.spanner.admin.database.v1.CreateBackupRequest.encryptionConfig: object expected"); + message.encryptionConfig = $root.google.spanner.admin.database.v1.CreateBackupEncryptionConfig.fromObject(object.encryptionConfig); + } + return message; + }; + + /** + * Creates a plain object from a CreateBackupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.CreateBackupRequest + * @static + * @param {google.spanner.admin.database.v1.CreateBackupRequest} message CreateBackupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateBackupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.backupId = ""; + object.backup = null; + object.encryptionConfig = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.backupId != null && message.hasOwnProperty("backupId")) + object.backupId = message.backupId; + if (message.backup != null && message.hasOwnProperty("backup")) + object.backup = $root.google.spanner.admin.database.v1.Backup.toObject(message.backup, options); + if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) + object.encryptionConfig = $root.google.spanner.admin.database.v1.CreateBackupEncryptionConfig.toObject(message.encryptionConfig, options); + return object; + }; + + /** + * Converts this CreateBackupRequest to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.CreateBackupRequest + * @instance + * @returns {Object.} JSON object + */ + CreateBackupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateBackupRequest + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.CreateBackupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.CreateBackupRequest"; + }; + + return CreateBackupRequest; + })(); + + v1.CreateBackupMetadata = (function() { + + /** + * Properties of a CreateBackupMetadata. + * @memberof google.spanner.admin.database.v1 + * @interface ICreateBackupMetadata + * @property {string|null} [name] CreateBackupMetadata name + * @property {string|null} [database] CreateBackupMetadata database + * @property {google.spanner.admin.database.v1.IOperationProgress|null} [progress] CreateBackupMetadata progress + * @property {google.protobuf.ITimestamp|null} [cancelTime] CreateBackupMetadata cancelTime + */ + + /** + * Constructs a new CreateBackupMetadata. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents a CreateBackupMetadata. + * @implements ICreateBackupMetadata + * @constructor + * @param {google.spanner.admin.database.v1.ICreateBackupMetadata=} [properties] Properties to set + */ + function CreateBackupMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateBackupMetadata name. + * @member {string} name + * @memberof google.spanner.admin.database.v1.CreateBackupMetadata + * @instance + */ + CreateBackupMetadata.prototype.name = ""; + + /** + * CreateBackupMetadata database. + * @member {string} database + * @memberof google.spanner.admin.database.v1.CreateBackupMetadata + * @instance + */ + CreateBackupMetadata.prototype.database = ""; + + /** + * CreateBackupMetadata progress. + * @member {google.spanner.admin.database.v1.IOperationProgress|null|undefined} progress + * @memberof google.spanner.admin.database.v1.CreateBackupMetadata + * @instance + */ + CreateBackupMetadata.prototype.progress = null; + + /** + * CreateBackupMetadata cancelTime. + * @member {google.protobuf.ITimestamp|null|undefined} cancelTime + * @memberof google.spanner.admin.database.v1.CreateBackupMetadata + * @instance + */ + CreateBackupMetadata.prototype.cancelTime = null; + + /** + * Creates a new CreateBackupMetadata instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.CreateBackupMetadata + * @static + * @param {google.spanner.admin.database.v1.ICreateBackupMetadata=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.CreateBackupMetadata} CreateBackupMetadata instance + */ + CreateBackupMetadata.create = function create(properties) { + return new CreateBackupMetadata(properties); + }; + + /** + * Encodes the specified CreateBackupMetadata message. Does not implicitly {@link google.spanner.admin.database.v1.CreateBackupMetadata.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.CreateBackupMetadata + * @static + * @param {google.spanner.admin.database.v1.ICreateBackupMetadata} message CreateBackupMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateBackupMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.database != null && Object.hasOwnProperty.call(message, "database")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.database); + if (message.progress != null && Object.hasOwnProperty.call(message, "progress")) + $root.google.spanner.admin.database.v1.OperationProgress.encode(message.progress, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.cancelTime != null && Object.hasOwnProperty.call(message, "cancelTime")) + $root.google.protobuf.Timestamp.encode(message.cancelTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateBackupMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.CreateBackupMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.CreateBackupMetadata + * @static + * @param {google.spanner.admin.database.v1.ICreateBackupMetadata} message CreateBackupMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateBackupMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateBackupMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.CreateBackupMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.CreateBackupMetadata} CreateBackupMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateBackupMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.CreateBackupMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.database = reader.string(); + break; + } + case 3: { + message.progress = $root.google.spanner.admin.database.v1.OperationProgress.decode(reader, reader.uint32()); + break; + } + case 4: { + message.cancelTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateBackupMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.CreateBackupMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.CreateBackupMetadata} CreateBackupMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateBackupMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateBackupMetadata message. + * @function verify + * @memberof google.spanner.admin.database.v1.CreateBackupMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateBackupMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.database != null && message.hasOwnProperty("database")) + if (!$util.isString(message.database)) + return "database: string expected"; + if (message.progress != null && message.hasOwnProperty("progress")) { + var error = $root.google.spanner.admin.database.v1.OperationProgress.verify(message.progress); + if (error) + return "progress." + error; + } + if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.cancelTime); + if (error) + return "cancelTime." + error; + } + return null; + }; + + /** + * Creates a CreateBackupMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.CreateBackupMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.CreateBackupMetadata} CreateBackupMetadata + */ + CreateBackupMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.CreateBackupMetadata) + return object; + var message = new $root.google.spanner.admin.database.v1.CreateBackupMetadata(); + if (object.name != null) + message.name = String(object.name); + if (object.database != null) + message.database = String(object.database); + if (object.progress != null) { + if (typeof object.progress !== "object") + throw TypeError(".google.spanner.admin.database.v1.CreateBackupMetadata.progress: object expected"); + message.progress = $root.google.spanner.admin.database.v1.OperationProgress.fromObject(object.progress); + } + if (object.cancelTime != null) { + if (typeof object.cancelTime !== "object") + throw TypeError(".google.spanner.admin.database.v1.CreateBackupMetadata.cancelTime: object expected"); + message.cancelTime = $root.google.protobuf.Timestamp.fromObject(object.cancelTime); + } + return message; + }; + + /** + * Creates a plain object from a CreateBackupMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.CreateBackupMetadata + * @static + * @param {google.spanner.admin.database.v1.CreateBackupMetadata} message CreateBackupMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateBackupMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.database = ""; + object.progress = null; + object.cancelTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.database != null && message.hasOwnProperty("database")) + object.database = message.database; + if (message.progress != null && message.hasOwnProperty("progress")) + object.progress = $root.google.spanner.admin.database.v1.OperationProgress.toObject(message.progress, options); + if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) + object.cancelTime = $root.google.protobuf.Timestamp.toObject(message.cancelTime, options); + return object; + }; + + /** + * Converts this CreateBackupMetadata to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.CreateBackupMetadata + * @instance + * @returns {Object.} JSON object + */ + CreateBackupMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateBackupMetadata + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.CreateBackupMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateBackupMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.CreateBackupMetadata"; + }; + + return CreateBackupMetadata; + })(); + + v1.CopyBackupRequest = (function() { + + /** + * Properties of a CopyBackupRequest. + * @memberof google.spanner.admin.database.v1 + * @interface ICopyBackupRequest + * @property {string|null} [parent] CopyBackupRequest parent + * @property {string|null} [backupId] CopyBackupRequest backupId + * @property {string|null} [sourceBackup] CopyBackupRequest sourceBackup + * @property {google.protobuf.ITimestamp|null} [expireTime] CopyBackupRequest expireTime + * @property {google.spanner.admin.database.v1.ICopyBackupEncryptionConfig|null} [encryptionConfig] CopyBackupRequest encryptionConfig + */ + + /** + * Constructs a new CopyBackupRequest. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents a CopyBackupRequest. + * @implements ICopyBackupRequest + * @constructor + * @param {google.spanner.admin.database.v1.ICopyBackupRequest=} [properties] Properties to set + */ + function CopyBackupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CopyBackupRequest parent. + * @member {string} parent + * @memberof google.spanner.admin.database.v1.CopyBackupRequest + * @instance + */ + CopyBackupRequest.prototype.parent = ""; + + /** + * CopyBackupRequest backupId. + * @member {string} backupId + * @memberof google.spanner.admin.database.v1.CopyBackupRequest + * @instance + */ + CopyBackupRequest.prototype.backupId = ""; + + /** + * CopyBackupRequest sourceBackup. + * @member {string} sourceBackup + * @memberof google.spanner.admin.database.v1.CopyBackupRequest + * @instance + */ + CopyBackupRequest.prototype.sourceBackup = ""; + + /** + * CopyBackupRequest expireTime. + * @member {google.protobuf.ITimestamp|null|undefined} expireTime + * @memberof google.spanner.admin.database.v1.CopyBackupRequest + * @instance + */ + CopyBackupRequest.prototype.expireTime = null; + + /** + * CopyBackupRequest encryptionConfig. + * @member {google.spanner.admin.database.v1.ICopyBackupEncryptionConfig|null|undefined} encryptionConfig + * @memberof google.spanner.admin.database.v1.CopyBackupRequest + * @instance + */ + CopyBackupRequest.prototype.encryptionConfig = null; + + /** + * Creates a new CopyBackupRequest instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.CopyBackupRequest + * @static + * @param {google.spanner.admin.database.v1.ICopyBackupRequest=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.CopyBackupRequest} CopyBackupRequest instance + */ + CopyBackupRequest.create = function create(properties) { + return new CopyBackupRequest(properties); + }; + + /** + * Encodes the specified CopyBackupRequest message. Does not implicitly {@link google.spanner.admin.database.v1.CopyBackupRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.CopyBackupRequest + * @static + * @param {google.spanner.admin.database.v1.ICopyBackupRequest} message CopyBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CopyBackupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.backupId != null && Object.hasOwnProperty.call(message, "backupId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.backupId); + if (message.sourceBackup != null && Object.hasOwnProperty.call(message, "sourceBackup")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.sourceBackup); + if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) + $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) + $root.google.spanner.admin.database.v1.CopyBackupEncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CopyBackupRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.CopyBackupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.CopyBackupRequest + * @static + * @param {google.spanner.admin.database.v1.ICopyBackupRequest} message CopyBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CopyBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CopyBackupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.CopyBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.CopyBackupRequest} CopyBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CopyBackupRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.CopyBackupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.backupId = reader.string(); + break; + } + case 3: { + message.sourceBackup = reader.string(); + break; + } + case 4: { + message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.encryptionConfig = $root.google.spanner.admin.database.v1.CopyBackupEncryptionConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CopyBackupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.CopyBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.CopyBackupRequest} CopyBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CopyBackupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CopyBackupRequest message. + * @function verify + * @memberof google.spanner.admin.database.v1.CopyBackupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CopyBackupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.backupId != null && message.hasOwnProperty("backupId")) + if (!$util.isString(message.backupId)) + return "backupId: string expected"; + if (message.sourceBackup != null && message.hasOwnProperty("sourceBackup")) + if (!$util.isString(message.sourceBackup)) + return "sourceBackup: string expected"; + if (message.expireTime != null && message.hasOwnProperty("expireTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.expireTime); + if (error) + return "expireTime." + error; + } + if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { + var error = $root.google.spanner.admin.database.v1.CopyBackupEncryptionConfig.verify(message.encryptionConfig); + if (error) + return "encryptionConfig." + error; + } + return null; + }; + + /** + * Creates a CopyBackupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.CopyBackupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.CopyBackupRequest} CopyBackupRequest + */ + CopyBackupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.CopyBackupRequest) + return object; + var message = new $root.google.spanner.admin.database.v1.CopyBackupRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.backupId != null) + message.backupId = String(object.backupId); + if (object.sourceBackup != null) + message.sourceBackup = String(object.sourceBackup); + if (object.expireTime != null) { + if (typeof object.expireTime !== "object") + throw TypeError(".google.spanner.admin.database.v1.CopyBackupRequest.expireTime: object expected"); + message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); + } + if (object.encryptionConfig != null) { + if (typeof object.encryptionConfig !== "object") + throw TypeError(".google.spanner.admin.database.v1.CopyBackupRequest.encryptionConfig: object expected"); + message.encryptionConfig = $root.google.spanner.admin.database.v1.CopyBackupEncryptionConfig.fromObject(object.encryptionConfig); + } + return message; + }; + + /** + * Creates a plain object from a CopyBackupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.CopyBackupRequest + * @static + * @param {google.spanner.admin.database.v1.CopyBackupRequest} message CopyBackupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CopyBackupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.backupId = ""; + object.sourceBackup = ""; + object.expireTime = null; + object.encryptionConfig = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.backupId != null && message.hasOwnProperty("backupId")) + object.backupId = message.backupId; + if (message.sourceBackup != null && message.hasOwnProperty("sourceBackup")) + object.sourceBackup = message.sourceBackup; + if (message.expireTime != null && message.hasOwnProperty("expireTime")) + object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); + if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) + object.encryptionConfig = $root.google.spanner.admin.database.v1.CopyBackupEncryptionConfig.toObject(message.encryptionConfig, options); + return object; + }; + + /** + * Converts this CopyBackupRequest to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.CopyBackupRequest + * @instance + * @returns {Object.} JSON object + */ + CopyBackupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CopyBackupRequest + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.CopyBackupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CopyBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.CopyBackupRequest"; + }; + + return CopyBackupRequest; + })(); + + v1.CopyBackupMetadata = (function() { + + /** + * Properties of a CopyBackupMetadata. + * @memberof google.spanner.admin.database.v1 + * @interface ICopyBackupMetadata + * @property {string|null} [name] CopyBackupMetadata name + * @property {string|null} [sourceBackup] CopyBackupMetadata sourceBackup + * @property {google.spanner.admin.database.v1.IOperationProgress|null} [progress] CopyBackupMetadata progress + * @property {google.protobuf.ITimestamp|null} [cancelTime] CopyBackupMetadata cancelTime + */ + + /** + * Constructs a new CopyBackupMetadata. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents a CopyBackupMetadata. + * @implements ICopyBackupMetadata + * @constructor + * @param {google.spanner.admin.database.v1.ICopyBackupMetadata=} [properties] Properties to set + */ + function CopyBackupMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CopyBackupMetadata name. + * @member {string} name + * @memberof google.spanner.admin.database.v1.CopyBackupMetadata + * @instance + */ + CopyBackupMetadata.prototype.name = ""; + + /** + * CopyBackupMetadata sourceBackup. + * @member {string} sourceBackup + * @memberof google.spanner.admin.database.v1.CopyBackupMetadata + * @instance + */ + CopyBackupMetadata.prototype.sourceBackup = ""; + + /** + * CopyBackupMetadata progress. + * @member {google.spanner.admin.database.v1.IOperationProgress|null|undefined} progress + * @memberof google.spanner.admin.database.v1.CopyBackupMetadata + * @instance + */ + CopyBackupMetadata.prototype.progress = null; + + /** + * CopyBackupMetadata cancelTime. + * @member {google.protobuf.ITimestamp|null|undefined} cancelTime + * @memberof google.spanner.admin.database.v1.CopyBackupMetadata + * @instance + */ + CopyBackupMetadata.prototype.cancelTime = null; + + /** + * Creates a new CopyBackupMetadata instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.CopyBackupMetadata + * @static + * @param {google.spanner.admin.database.v1.ICopyBackupMetadata=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.CopyBackupMetadata} CopyBackupMetadata instance + */ + CopyBackupMetadata.create = function create(properties) { + return new CopyBackupMetadata(properties); + }; + + /** + * Encodes the specified CopyBackupMetadata message. Does not implicitly {@link google.spanner.admin.database.v1.CopyBackupMetadata.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.CopyBackupMetadata + * @static + * @param {google.spanner.admin.database.v1.ICopyBackupMetadata} message CopyBackupMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CopyBackupMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.sourceBackup != null && Object.hasOwnProperty.call(message, "sourceBackup")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceBackup); + if (message.progress != null && Object.hasOwnProperty.call(message, "progress")) + $root.google.spanner.admin.database.v1.OperationProgress.encode(message.progress, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.cancelTime != null && Object.hasOwnProperty.call(message, "cancelTime")) + $root.google.protobuf.Timestamp.encode(message.cancelTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CopyBackupMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.CopyBackupMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.CopyBackupMetadata + * @static + * @param {google.spanner.admin.database.v1.ICopyBackupMetadata} message CopyBackupMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CopyBackupMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CopyBackupMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.CopyBackupMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.CopyBackupMetadata} CopyBackupMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CopyBackupMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.CopyBackupMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.sourceBackup = reader.string(); + break; + } + case 3: { + message.progress = $root.google.spanner.admin.database.v1.OperationProgress.decode(reader, reader.uint32()); + break; + } + case 4: { + message.cancelTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CopyBackupMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.CopyBackupMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.CopyBackupMetadata} CopyBackupMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CopyBackupMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CopyBackupMetadata message. + * @function verify + * @memberof google.spanner.admin.database.v1.CopyBackupMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CopyBackupMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.sourceBackup != null && message.hasOwnProperty("sourceBackup")) + if (!$util.isString(message.sourceBackup)) + return "sourceBackup: string expected"; + if (message.progress != null && message.hasOwnProperty("progress")) { + var error = $root.google.spanner.admin.database.v1.OperationProgress.verify(message.progress); + if (error) + return "progress." + error; + } + if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.cancelTime); + if (error) + return "cancelTime." + error; + } + return null; + }; + + /** + * Creates a CopyBackupMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.CopyBackupMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.CopyBackupMetadata} CopyBackupMetadata + */ + CopyBackupMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.CopyBackupMetadata) + return object; + var message = new $root.google.spanner.admin.database.v1.CopyBackupMetadata(); + if (object.name != null) + message.name = String(object.name); + if (object.sourceBackup != null) + message.sourceBackup = String(object.sourceBackup); + if (object.progress != null) { + if (typeof object.progress !== "object") + throw TypeError(".google.spanner.admin.database.v1.CopyBackupMetadata.progress: object expected"); + message.progress = $root.google.spanner.admin.database.v1.OperationProgress.fromObject(object.progress); + } + if (object.cancelTime != null) { + if (typeof object.cancelTime !== "object") + throw TypeError(".google.spanner.admin.database.v1.CopyBackupMetadata.cancelTime: object expected"); + message.cancelTime = $root.google.protobuf.Timestamp.fromObject(object.cancelTime); + } + return message; + }; + + /** + * Creates a plain object from a CopyBackupMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.CopyBackupMetadata + * @static + * @param {google.spanner.admin.database.v1.CopyBackupMetadata} message CopyBackupMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CopyBackupMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.sourceBackup = ""; + object.progress = null; + object.cancelTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.sourceBackup != null && message.hasOwnProperty("sourceBackup")) + object.sourceBackup = message.sourceBackup; + if (message.progress != null && message.hasOwnProperty("progress")) + object.progress = $root.google.spanner.admin.database.v1.OperationProgress.toObject(message.progress, options); + if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) + object.cancelTime = $root.google.protobuf.Timestamp.toObject(message.cancelTime, options); + return object; + }; + + /** + * Converts this CopyBackupMetadata to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.CopyBackupMetadata + * @instance + * @returns {Object.} JSON object + */ + CopyBackupMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CopyBackupMetadata + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.CopyBackupMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CopyBackupMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.CopyBackupMetadata"; + }; + + return CopyBackupMetadata; + })(); + + v1.UpdateBackupRequest = (function() { + + /** + * Properties of an UpdateBackupRequest. + * @memberof google.spanner.admin.database.v1 + * @interface IUpdateBackupRequest + * @property {google.spanner.admin.database.v1.IBackup|null} [backup] UpdateBackupRequest backup + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateBackupRequest updateMask + */ + + /** + * Constructs a new UpdateBackupRequest. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents an UpdateBackupRequest. + * @implements IUpdateBackupRequest + * @constructor + * @param {google.spanner.admin.database.v1.IUpdateBackupRequest=} [properties] Properties to set + */ + function UpdateBackupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateBackupRequest backup. + * @member {google.spanner.admin.database.v1.IBackup|null|undefined} backup + * @memberof google.spanner.admin.database.v1.UpdateBackupRequest + * @instance + */ + UpdateBackupRequest.prototype.backup = null; + + /** + * UpdateBackupRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.spanner.admin.database.v1.UpdateBackupRequest + * @instance + */ + UpdateBackupRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateBackupRequest instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.UpdateBackupRequest + * @static + * @param {google.spanner.admin.database.v1.IUpdateBackupRequest=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.UpdateBackupRequest} UpdateBackupRequest instance + */ + UpdateBackupRequest.create = function create(properties) { + return new UpdateBackupRequest(properties); + }; + + /** + * Encodes the specified UpdateBackupRequest message. Does not implicitly {@link google.spanner.admin.database.v1.UpdateBackupRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.UpdateBackupRequest + * @static + * @param {google.spanner.admin.database.v1.IUpdateBackupRequest} message UpdateBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateBackupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.backup != null && Object.hasOwnProperty.call(message, "backup")) + $root.google.spanner.admin.database.v1.Backup.encode(message.backup, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateBackupRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.UpdateBackupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.UpdateBackupRequest + * @static + * @param {google.spanner.admin.database.v1.IUpdateBackupRequest} message UpdateBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateBackupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.UpdateBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.UpdateBackupRequest} UpdateBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateBackupRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.UpdateBackupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.backup = $root.google.spanner.admin.database.v1.Backup.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateBackupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.UpdateBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.UpdateBackupRequest} UpdateBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateBackupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateBackupRequest message. + * @function verify + * @memberof google.spanner.admin.database.v1.UpdateBackupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateBackupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.backup != null && message.hasOwnProperty("backup")) { + var error = $root.google.spanner.admin.database.v1.Backup.verify(message.backup); + if (error) + return "backup." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateBackupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.UpdateBackupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.UpdateBackupRequest} UpdateBackupRequest + */ + UpdateBackupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.UpdateBackupRequest) + return object; + var message = new $root.google.spanner.admin.database.v1.UpdateBackupRequest(); + if (object.backup != null) { + if (typeof object.backup !== "object") + throw TypeError(".google.spanner.admin.database.v1.UpdateBackupRequest.backup: object expected"); + message.backup = $root.google.spanner.admin.database.v1.Backup.fromObject(object.backup); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.spanner.admin.database.v1.UpdateBackupRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateBackupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.UpdateBackupRequest + * @static + * @param {google.spanner.admin.database.v1.UpdateBackupRequest} message UpdateBackupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateBackupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.backup = null; + object.updateMask = null; + } + if (message.backup != null && message.hasOwnProperty("backup")) + object.backup = $root.google.spanner.admin.database.v1.Backup.toObject(message.backup, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateBackupRequest to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.UpdateBackupRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateBackupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateBackupRequest + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.UpdateBackupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.UpdateBackupRequest"; + }; + + return UpdateBackupRequest; + })(); + + v1.GetBackupRequest = (function() { + + /** + * Properties of a GetBackupRequest. + * @memberof google.spanner.admin.database.v1 + * @interface IGetBackupRequest + * @property {string|null} [name] GetBackupRequest name + */ + + /** + * Constructs a new GetBackupRequest. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents a GetBackupRequest. + * @implements IGetBackupRequest + * @constructor + * @param {google.spanner.admin.database.v1.IGetBackupRequest=} [properties] Properties to set + */ + function GetBackupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetBackupRequest name. + * @member {string} name + * @memberof google.spanner.admin.database.v1.GetBackupRequest + * @instance + */ + GetBackupRequest.prototype.name = ""; + + /** + * Creates a new GetBackupRequest instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.GetBackupRequest + * @static + * @param {google.spanner.admin.database.v1.IGetBackupRequest=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.GetBackupRequest} GetBackupRequest instance + */ + GetBackupRequest.create = function create(properties) { + return new GetBackupRequest(properties); + }; + + /** + * Encodes the specified GetBackupRequest message. Does not implicitly {@link google.spanner.admin.database.v1.GetBackupRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.GetBackupRequest + * @static + * @param {google.spanner.admin.database.v1.IGetBackupRequest} message GetBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBackupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetBackupRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.GetBackupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.GetBackupRequest + * @static + * @param {google.spanner.admin.database.v1.IGetBackupRequest} message GetBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetBackupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.GetBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.GetBackupRequest} GetBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBackupRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.GetBackupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetBackupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.GetBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.GetBackupRequest} GetBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBackupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetBackupRequest message. + * @function verify + * @memberof google.spanner.admin.database.v1.GetBackupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetBackupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetBackupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.GetBackupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.GetBackupRequest} GetBackupRequest + */ + GetBackupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.GetBackupRequest) + return object; + var message = new $root.google.spanner.admin.database.v1.GetBackupRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetBackupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.GetBackupRequest + * @static + * @param {google.spanner.admin.database.v1.GetBackupRequest} message GetBackupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetBackupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetBackupRequest to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.GetBackupRequest + * @instance + * @returns {Object.} JSON object + */ + GetBackupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetBackupRequest + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.GetBackupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.GetBackupRequest"; + }; + + return GetBackupRequest; + })(); + + v1.DeleteBackupRequest = (function() { + + /** + * Properties of a DeleteBackupRequest. + * @memberof google.spanner.admin.database.v1 + * @interface IDeleteBackupRequest + * @property {string|null} [name] DeleteBackupRequest name + */ + + /** + * Constructs a new DeleteBackupRequest. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents a DeleteBackupRequest. + * @implements IDeleteBackupRequest + * @constructor + * @param {google.spanner.admin.database.v1.IDeleteBackupRequest=} [properties] Properties to set + */ + function DeleteBackupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteBackupRequest name. + * @member {string} name + * @memberof google.spanner.admin.database.v1.DeleteBackupRequest + * @instance + */ + DeleteBackupRequest.prototype.name = ""; + + /** + * Creates a new DeleteBackupRequest instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.DeleteBackupRequest + * @static + * @param {google.spanner.admin.database.v1.IDeleteBackupRequest=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.DeleteBackupRequest} DeleteBackupRequest instance + */ + DeleteBackupRequest.create = function create(properties) { + return new DeleteBackupRequest(properties); + }; + + /** + * Encodes the specified DeleteBackupRequest message. Does not implicitly {@link google.spanner.admin.database.v1.DeleteBackupRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.DeleteBackupRequest + * @static + * @param {google.spanner.admin.database.v1.IDeleteBackupRequest} message DeleteBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteBackupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteBackupRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.DeleteBackupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.DeleteBackupRequest + * @static + * @param {google.spanner.admin.database.v1.IDeleteBackupRequest} message DeleteBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteBackupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.DeleteBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.DeleteBackupRequest} DeleteBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteBackupRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.DeleteBackupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteBackupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.DeleteBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.DeleteBackupRequest} DeleteBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteBackupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteBackupRequest message. + * @function verify + * @memberof google.spanner.admin.database.v1.DeleteBackupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteBackupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteBackupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.DeleteBackupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.DeleteBackupRequest} DeleteBackupRequest + */ + DeleteBackupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.DeleteBackupRequest) + return object; + var message = new $root.google.spanner.admin.database.v1.DeleteBackupRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteBackupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.DeleteBackupRequest + * @static + * @param {google.spanner.admin.database.v1.DeleteBackupRequest} message DeleteBackupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteBackupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteBackupRequest to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.DeleteBackupRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteBackupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteBackupRequest + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.DeleteBackupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.DeleteBackupRequest"; + }; + + return DeleteBackupRequest; + })(); + + v1.ListBackupsRequest = (function() { + + /** + * Properties of a ListBackupsRequest. + * @memberof google.spanner.admin.database.v1 + * @interface IListBackupsRequest + * @property {string|null} [parent] ListBackupsRequest parent + * @property {string|null} [filter] ListBackupsRequest filter + * @property {number|null} [pageSize] ListBackupsRequest pageSize + * @property {string|null} [pageToken] ListBackupsRequest pageToken + */ + + /** + * Constructs a new ListBackupsRequest. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents a ListBackupsRequest. + * @implements IListBackupsRequest + * @constructor + * @param {google.spanner.admin.database.v1.IListBackupsRequest=} [properties] Properties to set + */ + function ListBackupsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListBackupsRequest parent. + * @member {string} parent + * @memberof google.spanner.admin.database.v1.ListBackupsRequest + * @instance + */ + ListBackupsRequest.prototype.parent = ""; + + /** + * ListBackupsRequest filter. + * @member {string} filter + * @memberof google.spanner.admin.database.v1.ListBackupsRequest + * @instance + */ + ListBackupsRequest.prototype.filter = ""; + + /** + * ListBackupsRequest pageSize. + * @member {number} pageSize + * @memberof google.spanner.admin.database.v1.ListBackupsRequest + * @instance + */ + ListBackupsRequest.prototype.pageSize = 0; + + /** + * ListBackupsRequest pageToken. + * @member {string} pageToken + * @memberof google.spanner.admin.database.v1.ListBackupsRequest + * @instance + */ + ListBackupsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListBackupsRequest instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.ListBackupsRequest + * @static + * @param {google.spanner.admin.database.v1.IListBackupsRequest=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.ListBackupsRequest} ListBackupsRequest instance + */ + ListBackupsRequest.create = function create(properties) { + return new ListBackupsRequest(properties); + }; + + /** + * Encodes the specified ListBackupsRequest message. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupsRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.ListBackupsRequest + * @static + * @param {google.spanner.admin.database.v1.IListBackupsRequest} message ListBackupsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListBackupsRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.ListBackupsRequest + * @static + * @param {google.spanner.admin.database.v1.IListBackupsRequest} message ListBackupsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListBackupsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.ListBackupsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.ListBackupsRequest} ListBackupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.ListBackupsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.filter = reader.string(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListBackupsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.ListBackupsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.ListBackupsRequest} ListBackupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListBackupsRequest message. + * @function verify + * @memberof google.spanner.admin.database.v1.ListBackupsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListBackupsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListBackupsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.ListBackupsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.ListBackupsRequest} ListBackupsRequest + */ + ListBackupsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.ListBackupsRequest) + return object; + var message = new $root.google.spanner.admin.database.v1.ListBackupsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListBackupsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.ListBackupsRequest + * @static + * @param {google.spanner.admin.database.v1.ListBackupsRequest} message ListBackupsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListBackupsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListBackupsRequest to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.ListBackupsRequest + * @instance + * @returns {Object.} JSON object + */ + ListBackupsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListBackupsRequest + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.ListBackupsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListBackupsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.ListBackupsRequest"; + }; + + return ListBackupsRequest; + })(); + + v1.ListBackupsResponse = (function() { + + /** + * Properties of a ListBackupsResponse. + * @memberof google.spanner.admin.database.v1 + * @interface IListBackupsResponse + * @property {Array.|null} [backups] ListBackupsResponse backups + * @property {string|null} [nextPageToken] ListBackupsResponse nextPageToken + */ + + /** + * Constructs a new ListBackupsResponse. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents a ListBackupsResponse. + * @implements IListBackupsResponse + * @constructor + * @param {google.spanner.admin.database.v1.IListBackupsResponse=} [properties] Properties to set + */ + function ListBackupsResponse(properties) { + this.backups = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListBackupsResponse backups. + * @member {Array.} backups + * @memberof google.spanner.admin.database.v1.ListBackupsResponse + * @instance + */ + ListBackupsResponse.prototype.backups = $util.emptyArray; + + /** + * ListBackupsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.spanner.admin.database.v1.ListBackupsResponse + * @instance + */ + ListBackupsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListBackupsResponse instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.ListBackupsResponse + * @static + * @param {google.spanner.admin.database.v1.IListBackupsResponse=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.ListBackupsResponse} ListBackupsResponse instance + */ + ListBackupsResponse.create = function create(properties) { + return new ListBackupsResponse(properties); + }; + + /** + * Encodes the specified ListBackupsResponse message. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupsResponse.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.ListBackupsResponse + * @static + * @param {google.spanner.admin.database.v1.IListBackupsResponse} message ListBackupsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.backups != null && message.backups.length) + for (var i = 0; i < message.backups.length; ++i) + $root.google.spanner.admin.database.v1.Backup.encode(message.backups[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListBackupsResponse message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.ListBackupsResponse + * @static + * @param {google.spanner.admin.database.v1.IListBackupsResponse} message ListBackupsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListBackupsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.ListBackupsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.ListBackupsResponse} ListBackupsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.ListBackupsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.backups && message.backups.length)) + message.backups = []; + message.backups.push($root.google.spanner.admin.database.v1.Backup.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListBackupsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.ListBackupsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.ListBackupsResponse} ListBackupsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListBackupsResponse message. + * @function verify + * @memberof google.spanner.admin.database.v1.ListBackupsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListBackupsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.backups != null && message.hasOwnProperty("backups")) { + if (!Array.isArray(message.backups)) + return "backups: array expected"; + for (var i = 0; i < message.backups.length; ++i) { + var error = $root.google.spanner.admin.database.v1.Backup.verify(message.backups[i]); + if (error) + return "backups." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListBackupsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.ListBackupsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.ListBackupsResponse} ListBackupsResponse + */ + ListBackupsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.ListBackupsResponse) + return object; + var message = new $root.google.spanner.admin.database.v1.ListBackupsResponse(); + if (object.backups) { + if (!Array.isArray(object.backups)) + throw TypeError(".google.spanner.admin.database.v1.ListBackupsResponse.backups: array expected"); + message.backups = []; + for (var i = 0; i < object.backups.length; ++i) { + if (typeof object.backups[i] !== "object") + throw TypeError(".google.spanner.admin.database.v1.ListBackupsResponse.backups: object expected"); + message.backups[i] = $root.google.spanner.admin.database.v1.Backup.fromObject(object.backups[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListBackupsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.ListBackupsResponse + * @static + * @param {google.spanner.admin.database.v1.ListBackupsResponse} message ListBackupsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListBackupsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.backups = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.backups && message.backups.length) { + object.backups = []; + for (var j = 0; j < message.backups.length; ++j) + object.backups[j] = $root.google.spanner.admin.database.v1.Backup.toObject(message.backups[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListBackupsResponse to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.ListBackupsResponse + * @instance + * @returns {Object.} JSON object + */ + ListBackupsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListBackupsResponse + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.ListBackupsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListBackupsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.ListBackupsResponse"; + }; + + return ListBackupsResponse; + })(); + + v1.ListBackupOperationsRequest = (function() { + + /** + * Properties of a ListBackupOperationsRequest. + * @memberof google.spanner.admin.database.v1 + * @interface IListBackupOperationsRequest + * @property {string|null} [parent] ListBackupOperationsRequest parent + * @property {string|null} [filter] ListBackupOperationsRequest filter + * @property {number|null} [pageSize] ListBackupOperationsRequest pageSize + * @property {string|null} [pageToken] ListBackupOperationsRequest pageToken + */ + + /** + * Constructs a new ListBackupOperationsRequest. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents a ListBackupOperationsRequest. + * @implements IListBackupOperationsRequest + * @constructor + * @param {google.spanner.admin.database.v1.IListBackupOperationsRequest=} [properties] Properties to set + */ + function ListBackupOperationsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListBackupOperationsRequest parent. + * @member {string} parent + * @memberof google.spanner.admin.database.v1.ListBackupOperationsRequest + * @instance + */ + ListBackupOperationsRequest.prototype.parent = ""; + + /** + * ListBackupOperationsRequest filter. + * @member {string} filter + * @memberof google.spanner.admin.database.v1.ListBackupOperationsRequest + * @instance + */ + ListBackupOperationsRequest.prototype.filter = ""; + + /** + * ListBackupOperationsRequest pageSize. + * @member {number} pageSize + * @memberof google.spanner.admin.database.v1.ListBackupOperationsRequest + * @instance + */ + ListBackupOperationsRequest.prototype.pageSize = 0; + + /** + * ListBackupOperationsRequest pageToken. + * @member {string} pageToken + * @memberof google.spanner.admin.database.v1.ListBackupOperationsRequest + * @instance + */ + ListBackupOperationsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListBackupOperationsRequest instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.ListBackupOperationsRequest + * @static + * @param {google.spanner.admin.database.v1.IListBackupOperationsRequest=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.ListBackupOperationsRequest} ListBackupOperationsRequest instance + */ + ListBackupOperationsRequest.create = function create(properties) { + return new ListBackupOperationsRequest(properties); + }; + + /** + * Encodes the specified ListBackupOperationsRequest message. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupOperationsRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.ListBackupOperationsRequest + * @static + * @param {google.spanner.admin.database.v1.IListBackupOperationsRequest} message ListBackupOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupOperationsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListBackupOperationsRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupOperationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.ListBackupOperationsRequest + * @static + * @param {google.spanner.admin.database.v1.IListBackupOperationsRequest} message ListBackupOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListBackupOperationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.ListBackupOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.ListBackupOperationsRequest} ListBackupOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupOperationsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.ListBackupOperationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.filter = reader.string(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListBackupOperationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.ListBackupOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.ListBackupOperationsRequest} ListBackupOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupOperationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListBackupOperationsRequest message. + * @function verify + * @memberof google.spanner.admin.database.v1.ListBackupOperationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListBackupOperationsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.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 ListBackupOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.ListBackupOperationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.ListBackupOperationsRequest} ListBackupOperationsRequest + */ + ListBackupOperationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.ListBackupOperationsRequest) + return object; + var message = new $root.google.spanner.admin.database.v1.ListBackupOperationsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListBackupOperationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.ListBackupOperationsRequest + * @static + * @param {google.spanner.admin.database.v1.ListBackupOperationsRequest} message ListBackupOperationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListBackupOperationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListBackupOperationsRequest to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.ListBackupOperationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListBackupOperationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListBackupOperationsRequest + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.ListBackupOperationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListBackupOperationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.ListBackupOperationsRequest"; + }; + + return ListBackupOperationsRequest; + })(); + + v1.ListBackupOperationsResponse = (function() { + + /** + * Properties of a ListBackupOperationsResponse. + * @memberof google.spanner.admin.database.v1 + * @interface IListBackupOperationsResponse + * @property {Array.|null} [operations] ListBackupOperationsResponse operations + * @property {string|null} [nextPageToken] ListBackupOperationsResponse nextPageToken + */ + + /** + * Constructs a new ListBackupOperationsResponse. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents a ListBackupOperationsResponse. + * @implements IListBackupOperationsResponse + * @constructor + * @param {google.spanner.admin.database.v1.IListBackupOperationsResponse=} [properties] Properties to set + */ + function ListBackupOperationsResponse(properties) { + this.operations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListBackupOperationsResponse operations. + * @member {Array.} operations + * @memberof google.spanner.admin.database.v1.ListBackupOperationsResponse + * @instance + */ + ListBackupOperationsResponse.prototype.operations = $util.emptyArray; + + /** + * ListBackupOperationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.spanner.admin.database.v1.ListBackupOperationsResponse + * @instance + */ + ListBackupOperationsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListBackupOperationsResponse instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.ListBackupOperationsResponse + * @static + * @param {google.spanner.admin.database.v1.IListBackupOperationsResponse=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.ListBackupOperationsResponse} ListBackupOperationsResponse instance + */ + ListBackupOperationsResponse.create = function create(properties) { + return new ListBackupOperationsResponse(properties); + }; + + /** + * Encodes the specified ListBackupOperationsResponse message. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupOperationsResponse.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.ListBackupOperationsResponse + * @static + * @param {google.spanner.admin.database.v1.IListBackupOperationsResponse} message ListBackupOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupOperationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.operations != null && message.operations.length) + for (var i = 0; i < message.operations.length; ++i) + $root.google.longrunning.Operation.encode(message.operations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListBackupOperationsResponse message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupOperationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.ListBackupOperationsResponse + * @static + * @param {google.spanner.admin.database.v1.IListBackupOperationsResponse} message ListBackupOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupOperationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListBackupOperationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.ListBackupOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.ListBackupOperationsResponse} ListBackupOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupOperationsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.ListBackupOperationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.operations && message.operations.length)) + message.operations = []; + message.operations.push($root.google.longrunning.Operation.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListBackupOperationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.ListBackupOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.ListBackupOperationsResponse} ListBackupOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupOperationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListBackupOperationsResponse message. + * @function verify + * @memberof google.spanner.admin.database.v1.ListBackupOperationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListBackupOperationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.operations != null && message.hasOwnProperty("operations")) { + if (!Array.isArray(message.operations)) + return "operations: array expected"; + for (var i = 0; i < message.operations.length; ++i) { + var error = $root.google.longrunning.Operation.verify(message.operations[i]); + if (error) + return "operations." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListBackupOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.ListBackupOperationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.ListBackupOperationsResponse} ListBackupOperationsResponse + */ + ListBackupOperationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.ListBackupOperationsResponse) + return object; + var message = new $root.google.spanner.admin.database.v1.ListBackupOperationsResponse(); + if (object.operations) { + if (!Array.isArray(object.operations)) + throw TypeError(".google.spanner.admin.database.v1.ListBackupOperationsResponse.operations: array expected"); + message.operations = []; + for (var i = 0; i < object.operations.length; ++i) { + if (typeof object.operations[i] !== "object") + throw TypeError(".google.spanner.admin.database.v1.ListBackupOperationsResponse.operations: object expected"); + message.operations[i] = $root.google.longrunning.Operation.fromObject(object.operations[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListBackupOperationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.ListBackupOperationsResponse + * @static + * @param {google.spanner.admin.database.v1.ListBackupOperationsResponse} message ListBackupOperationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListBackupOperationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.operations = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.operations && message.operations.length) { + object.operations = []; + for (var j = 0; j < message.operations.length; ++j) + object.operations[j] = $root.google.longrunning.Operation.toObject(message.operations[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListBackupOperationsResponse to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.ListBackupOperationsResponse + * @instance + * @returns {Object.} JSON object + */ + ListBackupOperationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListBackupOperationsResponse + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.ListBackupOperationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListBackupOperationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.ListBackupOperationsResponse"; + }; + + return ListBackupOperationsResponse; + })(); + + v1.BackupInfo = (function() { + + /** + * Properties of a BackupInfo. + * @memberof google.spanner.admin.database.v1 + * @interface IBackupInfo + * @property {string|null} [backup] BackupInfo backup + * @property {google.protobuf.ITimestamp|null} [versionTime] BackupInfo versionTime + * @property {google.protobuf.ITimestamp|null} [createTime] BackupInfo createTime + * @property {string|null} [sourceDatabase] BackupInfo sourceDatabase + */ + + /** + * Constructs a new BackupInfo. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents a BackupInfo. + * @implements IBackupInfo + * @constructor + * @param {google.spanner.admin.database.v1.IBackupInfo=} [properties] Properties to set + */ + function BackupInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BackupInfo backup. + * @member {string} backup + * @memberof google.spanner.admin.database.v1.BackupInfo + * @instance + */ + BackupInfo.prototype.backup = ""; + + /** + * BackupInfo versionTime. + * @member {google.protobuf.ITimestamp|null|undefined} versionTime + * @memberof google.spanner.admin.database.v1.BackupInfo + * @instance + */ + BackupInfo.prototype.versionTime = null; + + /** + * BackupInfo createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.spanner.admin.database.v1.BackupInfo + * @instance + */ + BackupInfo.prototype.createTime = null; + + /** + * BackupInfo sourceDatabase. + * @member {string} sourceDatabase + * @memberof google.spanner.admin.database.v1.BackupInfo + * @instance + */ + BackupInfo.prototype.sourceDatabase = ""; + + /** + * Creates a new BackupInfo instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.BackupInfo + * @static + * @param {google.spanner.admin.database.v1.IBackupInfo=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.BackupInfo} BackupInfo instance + */ + BackupInfo.create = function create(properties) { + return new BackupInfo(properties); + }; + + /** + * Encodes the specified BackupInfo message. Does not implicitly {@link google.spanner.admin.database.v1.BackupInfo.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.BackupInfo + * @static + * @param {google.spanner.admin.database.v1.IBackupInfo} message BackupInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.backup != null && Object.hasOwnProperty.call(message, "backup")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.backup); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.sourceDatabase != null && Object.hasOwnProperty.call(message, "sourceDatabase")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.sourceDatabase); + if (message.versionTime != null && Object.hasOwnProperty.call(message, "versionTime")) + $root.google.protobuf.Timestamp.encode(message.versionTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BackupInfo message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.BackupInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.BackupInfo + * @static + * @param {google.spanner.admin.database.v1.IBackupInfo} message BackupInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BackupInfo message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.BackupInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.BackupInfo} BackupInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.BackupInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.backup = reader.string(); + break; + } + case 4: { + message.versionTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.sourceDatabase = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BackupInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.BackupInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.BackupInfo} BackupInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BackupInfo message. + * @function verify + * @memberof google.spanner.admin.database.v1.BackupInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BackupInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.backup != null && message.hasOwnProperty("backup")) + if (!$util.isString(message.backup)) + return "backup: string expected"; + if (message.versionTime != null && message.hasOwnProperty("versionTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.versionTime); + if (error) + return "versionTime." + error; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.sourceDatabase != null && message.hasOwnProperty("sourceDatabase")) + if (!$util.isString(message.sourceDatabase)) + return "sourceDatabase: string expected"; + return null; + }; + + /** + * Creates a BackupInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.BackupInfo + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.BackupInfo} BackupInfo + */ + BackupInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.BackupInfo) + return object; + var message = new $root.google.spanner.admin.database.v1.BackupInfo(); + if (object.backup != null) + message.backup = String(object.backup); + if (object.versionTime != null) { + if (typeof object.versionTime !== "object") + throw TypeError(".google.spanner.admin.database.v1.BackupInfo.versionTime: object expected"); + message.versionTime = $root.google.protobuf.Timestamp.fromObject(object.versionTime); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.spanner.admin.database.v1.BackupInfo.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.sourceDatabase != null) + message.sourceDatabase = String(object.sourceDatabase); + return message; + }; + + /** + * Creates a plain object from a BackupInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.BackupInfo + * @static + * @param {google.spanner.admin.database.v1.BackupInfo} message BackupInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BackupInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.backup = ""; + object.createTime = null; + object.sourceDatabase = ""; + object.versionTime = null; + } + if (message.backup != null && message.hasOwnProperty("backup")) + object.backup = message.backup; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.sourceDatabase != null && message.hasOwnProperty("sourceDatabase")) + object.sourceDatabase = message.sourceDatabase; + if (message.versionTime != null && message.hasOwnProperty("versionTime")) + object.versionTime = $root.google.protobuf.Timestamp.toObject(message.versionTime, options); + return object; + }; + + /** + * Converts this BackupInfo to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.BackupInfo + * @instance + * @returns {Object.} JSON object + */ + BackupInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BackupInfo + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.BackupInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BackupInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.BackupInfo"; + }; + + return BackupInfo; + })(); + + v1.CreateBackupEncryptionConfig = (function() { + + /** + * Properties of a CreateBackupEncryptionConfig. + * @memberof google.spanner.admin.database.v1 + * @interface ICreateBackupEncryptionConfig + * @property {google.spanner.admin.database.v1.CreateBackupEncryptionConfig.EncryptionType|null} [encryptionType] CreateBackupEncryptionConfig encryptionType + * @property {string|null} [kmsKeyName] CreateBackupEncryptionConfig kmsKeyName + * @property {Array.|null} [kmsKeyNames] CreateBackupEncryptionConfig kmsKeyNames + */ + + /** + * Constructs a new CreateBackupEncryptionConfig. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents a CreateBackupEncryptionConfig. + * @implements ICreateBackupEncryptionConfig + * @constructor + * @param {google.spanner.admin.database.v1.ICreateBackupEncryptionConfig=} [properties] Properties to set + */ + function CreateBackupEncryptionConfig(properties) { + this.kmsKeyNames = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateBackupEncryptionConfig encryptionType. + * @member {google.spanner.admin.database.v1.CreateBackupEncryptionConfig.EncryptionType} encryptionType + * @memberof google.spanner.admin.database.v1.CreateBackupEncryptionConfig + * @instance + */ + CreateBackupEncryptionConfig.prototype.encryptionType = 0; + + /** + * CreateBackupEncryptionConfig kmsKeyName. + * @member {string} kmsKeyName + * @memberof google.spanner.admin.database.v1.CreateBackupEncryptionConfig + * @instance + */ + CreateBackupEncryptionConfig.prototype.kmsKeyName = ""; + + /** + * CreateBackupEncryptionConfig kmsKeyNames. + * @member {Array.} kmsKeyNames + * @memberof google.spanner.admin.database.v1.CreateBackupEncryptionConfig + * @instance + */ + CreateBackupEncryptionConfig.prototype.kmsKeyNames = $util.emptyArray; + + /** + * Creates a new CreateBackupEncryptionConfig instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.CreateBackupEncryptionConfig + * @static + * @param {google.spanner.admin.database.v1.ICreateBackupEncryptionConfig=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.CreateBackupEncryptionConfig} CreateBackupEncryptionConfig instance + */ + CreateBackupEncryptionConfig.create = function create(properties) { + return new CreateBackupEncryptionConfig(properties); + }; + + /** + * Encodes the specified CreateBackupEncryptionConfig message. Does not implicitly {@link google.spanner.admin.database.v1.CreateBackupEncryptionConfig.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.CreateBackupEncryptionConfig + * @static + * @param {google.spanner.admin.database.v1.ICreateBackupEncryptionConfig} message CreateBackupEncryptionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateBackupEncryptionConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.encryptionType != null && Object.hasOwnProperty.call(message, "encryptionType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.encryptionType); + if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.kmsKeyName); + if (message.kmsKeyNames != null && message.kmsKeyNames.length) + for (var i = 0; i < message.kmsKeyNames.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.kmsKeyNames[i]); + return writer; + }; + + /** + * Encodes the specified CreateBackupEncryptionConfig message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.CreateBackupEncryptionConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.CreateBackupEncryptionConfig + * @static + * @param {google.spanner.admin.database.v1.ICreateBackupEncryptionConfig} message CreateBackupEncryptionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateBackupEncryptionConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateBackupEncryptionConfig message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.CreateBackupEncryptionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.CreateBackupEncryptionConfig} CreateBackupEncryptionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateBackupEncryptionConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.CreateBackupEncryptionConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.encryptionType = reader.int32(); + break; + } + case 2: { + message.kmsKeyName = reader.string(); + break; + } + case 3: { + if (!(message.kmsKeyNames && message.kmsKeyNames.length)) + message.kmsKeyNames = []; + message.kmsKeyNames.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateBackupEncryptionConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.CreateBackupEncryptionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.CreateBackupEncryptionConfig} CreateBackupEncryptionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateBackupEncryptionConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateBackupEncryptionConfig message. + * @function verify + * @memberof google.spanner.admin.database.v1.CreateBackupEncryptionConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateBackupEncryptionConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.encryptionType != null && message.hasOwnProperty("encryptionType")) + switch (message.encryptionType) { + default: + return "encryptionType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + if (!$util.isString(message.kmsKeyName)) + return "kmsKeyName: string expected"; + if (message.kmsKeyNames != null && message.hasOwnProperty("kmsKeyNames")) { + if (!Array.isArray(message.kmsKeyNames)) + return "kmsKeyNames: array expected"; + for (var i = 0; i < message.kmsKeyNames.length; ++i) + if (!$util.isString(message.kmsKeyNames[i])) + return "kmsKeyNames: string[] expected"; + } + return null; + }; + + /** + * Creates a CreateBackupEncryptionConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.CreateBackupEncryptionConfig + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.CreateBackupEncryptionConfig} CreateBackupEncryptionConfig + */ + CreateBackupEncryptionConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.CreateBackupEncryptionConfig) + return object; + var message = new $root.google.spanner.admin.database.v1.CreateBackupEncryptionConfig(); + switch (object.encryptionType) { + default: + if (typeof object.encryptionType === "number") { + message.encryptionType = object.encryptionType; + break; + } + break; + case "ENCRYPTION_TYPE_UNSPECIFIED": + case 0: + message.encryptionType = 0; + break; + case "USE_DATABASE_ENCRYPTION": + case 1: + message.encryptionType = 1; + break; + case "GOOGLE_DEFAULT_ENCRYPTION": + case 2: + message.encryptionType = 2; + break; + case "CUSTOMER_MANAGED_ENCRYPTION": + case 3: + message.encryptionType = 3; + break; + } + if (object.kmsKeyName != null) + message.kmsKeyName = String(object.kmsKeyName); + if (object.kmsKeyNames) { + if (!Array.isArray(object.kmsKeyNames)) + throw TypeError(".google.spanner.admin.database.v1.CreateBackupEncryptionConfig.kmsKeyNames: array expected"); + message.kmsKeyNames = []; + for (var i = 0; i < object.kmsKeyNames.length; ++i) + message.kmsKeyNames[i] = String(object.kmsKeyNames[i]); + } + return message; + }; + + /** + * Creates a plain object from a CreateBackupEncryptionConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.CreateBackupEncryptionConfig + * @static + * @param {google.spanner.admin.database.v1.CreateBackupEncryptionConfig} message CreateBackupEncryptionConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateBackupEncryptionConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.kmsKeyNames = []; + if (options.defaults) { + object.encryptionType = options.enums === String ? "ENCRYPTION_TYPE_UNSPECIFIED" : 0; + object.kmsKeyName = ""; + } + if (message.encryptionType != null && message.hasOwnProperty("encryptionType")) + object.encryptionType = options.enums === String ? $root.google.spanner.admin.database.v1.CreateBackupEncryptionConfig.EncryptionType[message.encryptionType] === undefined ? message.encryptionType : $root.google.spanner.admin.database.v1.CreateBackupEncryptionConfig.EncryptionType[message.encryptionType] : message.encryptionType; + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + object.kmsKeyName = message.kmsKeyName; + if (message.kmsKeyNames && message.kmsKeyNames.length) { + object.kmsKeyNames = []; + for (var j = 0; j < message.kmsKeyNames.length; ++j) + object.kmsKeyNames[j] = message.kmsKeyNames[j]; + } + return object; + }; + + /** + * Converts this CreateBackupEncryptionConfig to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.CreateBackupEncryptionConfig + * @instance + * @returns {Object.} JSON object + */ + CreateBackupEncryptionConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateBackupEncryptionConfig + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.CreateBackupEncryptionConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateBackupEncryptionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.CreateBackupEncryptionConfig"; + }; + + /** + * EncryptionType enum. + * @name google.spanner.admin.database.v1.CreateBackupEncryptionConfig.EncryptionType + * @enum {number} + * @property {number} ENCRYPTION_TYPE_UNSPECIFIED=0 ENCRYPTION_TYPE_UNSPECIFIED value + * @property {number} USE_DATABASE_ENCRYPTION=1 USE_DATABASE_ENCRYPTION value + * @property {number} GOOGLE_DEFAULT_ENCRYPTION=2 GOOGLE_DEFAULT_ENCRYPTION value + * @property {number} CUSTOMER_MANAGED_ENCRYPTION=3 CUSTOMER_MANAGED_ENCRYPTION value + */ + CreateBackupEncryptionConfig.EncryptionType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENCRYPTION_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "USE_DATABASE_ENCRYPTION"] = 1; + values[valuesById[2] = "GOOGLE_DEFAULT_ENCRYPTION"] = 2; + values[valuesById[3] = "CUSTOMER_MANAGED_ENCRYPTION"] = 3; + return values; + })(); + + return CreateBackupEncryptionConfig; + })(); + + v1.CopyBackupEncryptionConfig = (function() { + + /** + * Properties of a CopyBackupEncryptionConfig. + * @memberof google.spanner.admin.database.v1 + * @interface ICopyBackupEncryptionConfig + * @property {google.spanner.admin.database.v1.CopyBackupEncryptionConfig.EncryptionType|null} [encryptionType] CopyBackupEncryptionConfig encryptionType + * @property {string|null} [kmsKeyName] CopyBackupEncryptionConfig kmsKeyName + * @property {Array.|null} [kmsKeyNames] CopyBackupEncryptionConfig kmsKeyNames + */ + + /** + * Constructs a new CopyBackupEncryptionConfig. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents a CopyBackupEncryptionConfig. + * @implements ICopyBackupEncryptionConfig + * @constructor + * @param {google.spanner.admin.database.v1.ICopyBackupEncryptionConfig=} [properties] Properties to set + */ + function CopyBackupEncryptionConfig(properties) { + this.kmsKeyNames = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CopyBackupEncryptionConfig encryptionType. + * @member {google.spanner.admin.database.v1.CopyBackupEncryptionConfig.EncryptionType} encryptionType + * @memberof google.spanner.admin.database.v1.CopyBackupEncryptionConfig + * @instance + */ + CopyBackupEncryptionConfig.prototype.encryptionType = 0; + + /** + * CopyBackupEncryptionConfig kmsKeyName. + * @member {string} kmsKeyName + * @memberof google.spanner.admin.database.v1.CopyBackupEncryptionConfig + * @instance + */ + CopyBackupEncryptionConfig.prototype.kmsKeyName = ""; + + /** + * CopyBackupEncryptionConfig kmsKeyNames. + * @member {Array.} kmsKeyNames + * @memberof google.spanner.admin.database.v1.CopyBackupEncryptionConfig + * @instance + */ + CopyBackupEncryptionConfig.prototype.kmsKeyNames = $util.emptyArray; + + /** + * Creates a new CopyBackupEncryptionConfig instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.CopyBackupEncryptionConfig + * @static + * @param {google.spanner.admin.database.v1.ICopyBackupEncryptionConfig=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.CopyBackupEncryptionConfig} CopyBackupEncryptionConfig instance + */ + CopyBackupEncryptionConfig.create = function create(properties) { + return new CopyBackupEncryptionConfig(properties); + }; + + /** + * Encodes the specified CopyBackupEncryptionConfig message. Does not implicitly {@link google.spanner.admin.database.v1.CopyBackupEncryptionConfig.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.CopyBackupEncryptionConfig + * @static + * @param {google.spanner.admin.database.v1.ICopyBackupEncryptionConfig} message CopyBackupEncryptionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CopyBackupEncryptionConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.encryptionType != null && Object.hasOwnProperty.call(message, "encryptionType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.encryptionType); + if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.kmsKeyName); + if (message.kmsKeyNames != null && message.kmsKeyNames.length) + for (var i = 0; i < message.kmsKeyNames.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.kmsKeyNames[i]); + return writer; + }; + + /** + * Encodes the specified CopyBackupEncryptionConfig message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.CopyBackupEncryptionConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.CopyBackupEncryptionConfig + * @static + * @param {google.spanner.admin.database.v1.ICopyBackupEncryptionConfig} message CopyBackupEncryptionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CopyBackupEncryptionConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CopyBackupEncryptionConfig message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.CopyBackupEncryptionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.CopyBackupEncryptionConfig} CopyBackupEncryptionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CopyBackupEncryptionConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.CopyBackupEncryptionConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.encryptionType = reader.int32(); + break; + } + case 2: { + message.kmsKeyName = reader.string(); + break; + } + case 3: { + if (!(message.kmsKeyNames && message.kmsKeyNames.length)) + message.kmsKeyNames = []; + message.kmsKeyNames.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CopyBackupEncryptionConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.CopyBackupEncryptionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.CopyBackupEncryptionConfig} CopyBackupEncryptionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CopyBackupEncryptionConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CopyBackupEncryptionConfig message. + * @function verify + * @memberof google.spanner.admin.database.v1.CopyBackupEncryptionConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CopyBackupEncryptionConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.encryptionType != null && message.hasOwnProperty("encryptionType")) + switch (message.encryptionType) { + default: + return "encryptionType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + if (!$util.isString(message.kmsKeyName)) + return "kmsKeyName: string expected"; + if (message.kmsKeyNames != null && message.hasOwnProperty("kmsKeyNames")) { + if (!Array.isArray(message.kmsKeyNames)) + return "kmsKeyNames: array expected"; + for (var i = 0; i < message.kmsKeyNames.length; ++i) + if (!$util.isString(message.kmsKeyNames[i])) + return "kmsKeyNames: string[] expected"; + } + return null; + }; + + /** + * Creates a CopyBackupEncryptionConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.CopyBackupEncryptionConfig + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.CopyBackupEncryptionConfig} CopyBackupEncryptionConfig + */ + CopyBackupEncryptionConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.CopyBackupEncryptionConfig) + return object; + var message = new $root.google.spanner.admin.database.v1.CopyBackupEncryptionConfig(); + switch (object.encryptionType) { + default: + if (typeof object.encryptionType === "number") { + message.encryptionType = object.encryptionType; + break; + } + break; + case "ENCRYPTION_TYPE_UNSPECIFIED": + case 0: + message.encryptionType = 0; + break; + case "USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION": + case 1: + message.encryptionType = 1; + break; + case "GOOGLE_DEFAULT_ENCRYPTION": + case 2: + message.encryptionType = 2; + break; + case "CUSTOMER_MANAGED_ENCRYPTION": + case 3: + message.encryptionType = 3; + break; + } + if (object.kmsKeyName != null) + message.kmsKeyName = String(object.kmsKeyName); + if (object.kmsKeyNames) { + if (!Array.isArray(object.kmsKeyNames)) + throw TypeError(".google.spanner.admin.database.v1.CopyBackupEncryptionConfig.kmsKeyNames: array expected"); + message.kmsKeyNames = []; + for (var i = 0; i < object.kmsKeyNames.length; ++i) + message.kmsKeyNames[i] = String(object.kmsKeyNames[i]); + } + return message; + }; + + /** + * Creates a plain object from a CopyBackupEncryptionConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.CopyBackupEncryptionConfig + * @static + * @param {google.spanner.admin.database.v1.CopyBackupEncryptionConfig} message CopyBackupEncryptionConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CopyBackupEncryptionConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.kmsKeyNames = []; + if (options.defaults) { + object.encryptionType = options.enums === String ? "ENCRYPTION_TYPE_UNSPECIFIED" : 0; + object.kmsKeyName = ""; + } + if (message.encryptionType != null && message.hasOwnProperty("encryptionType")) + object.encryptionType = options.enums === String ? $root.google.spanner.admin.database.v1.CopyBackupEncryptionConfig.EncryptionType[message.encryptionType] === undefined ? message.encryptionType : $root.google.spanner.admin.database.v1.CopyBackupEncryptionConfig.EncryptionType[message.encryptionType] : message.encryptionType; + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + object.kmsKeyName = message.kmsKeyName; + if (message.kmsKeyNames && message.kmsKeyNames.length) { + object.kmsKeyNames = []; + for (var j = 0; j < message.kmsKeyNames.length; ++j) + object.kmsKeyNames[j] = message.kmsKeyNames[j]; + } + return object; + }; + + /** + * Converts this CopyBackupEncryptionConfig to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.CopyBackupEncryptionConfig + * @instance + * @returns {Object.} JSON object + */ + CopyBackupEncryptionConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CopyBackupEncryptionConfig + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.CopyBackupEncryptionConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CopyBackupEncryptionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.CopyBackupEncryptionConfig"; + }; + + /** + * EncryptionType enum. + * @name google.spanner.admin.database.v1.CopyBackupEncryptionConfig.EncryptionType + * @enum {number} + * @property {number} ENCRYPTION_TYPE_UNSPECIFIED=0 ENCRYPTION_TYPE_UNSPECIFIED value + * @property {number} USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION=1 USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION value + * @property {number} GOOGLE_DEFAULT_ENCRYPTION=2 GOOGLE_DEFAULT_ENCRYPTION value + * @property {number} CUSTOMER_MANAGED_ENCRYPTION=3 CUSTOMER_MANAGED_ENCRYPTION value + */ + CopyBackupEncryptionConfig.EncryptionType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENCRYPTION_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION"] = 1; + values[valuesById[2] = "GOOGLE_DEFAULT_ENCRYPTION"] = 2; + values[valuesById[3] = "CUSTOMER_MANAGED_ENCRYPTION"] = 3; + return values; + })(); + + return CopyBackupEncryptionConfig; + })(); + + v1.FullBackupSpec = (function() { + + /** + * Properties of a FullBackupSpec. + * @memberof google.spanner.admin.database.v1 + * @interface IFullBackupSpec + */ + + /** + * Constructs a new FullBackupSpec. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents a FullBackupSpec. + * @implements IFullBackupSpec + * @constructor + * @param {google.spanner.admin.database.v1.IFullBackupSpec=} [properties] Properties to set + */ + function FullBackupSpec(properties) { + if (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 FullBackupSpec instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.FullBackupSpec + * @static + * @param {google.spanner.admin.database.v1.IFullBackupSpec=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.FullBackupSpec} FullBackupSpec instance + */ + FullBackupSpec.create = function create(properties) { + return new FullBackupSpec(properties); + }; + + /** + * Encodes the specified FullBackupSpec message. Does not implicitly {@link google.spanner.admin.database.v1.FullBackupSpec.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.FullBackupSpec + * @static + * @param {google.spanner.admin.database.v1.IFullBackupSpec} message FullBackupSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FullBackupSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified FullBackupSpec message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.FullBackupSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.FullBackupSpec + * @static + * @param {google.spanner.admin.database.v1.IFullBackupSpec} message FullBackupSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FullBackupSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FullBackupSpec message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.FullBackupSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.FullBackupSpec} FullBackupSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FullBackupSpec.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.FullBackupSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FullBackupSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.FullBackupSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.FullBackupSpec} FullBackupSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FullBackupSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FullBackupSpec message. + * @function verify + * @memberof google.spanner.admin.database.v1.FullBackupSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FullBackupSpec.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a FullBackupSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.FullBackupSpec + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.FullBackupSpec} FullBackupSpec + */ + FullBackupSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.FullBackupSpec) + return object; + return new $root.google.spanner.admin.database.v1.FullBackupSpec(); + }; + + /** + * Creates a plain object from a FullBackupSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.FullBackupSpec + * @static + * @param {google.spanner.admin.database.v1.FullBackupSpec} message FullBackupSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FullBackupSpec.toObject = function toObject() { + return {}; + }; + + /** + * Converts this FullBackupSpec to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.FullBackupSpec + * @instance + * @returns {Object.} JSON object + */ + FullBackupSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FullBackupSpec + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.FullBackupSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FullBackupSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.FullBackupSpec"; + }; + + return FullBackupSpec; + })(); + + v1.IncrementalBackupSpec = (function() { + + /** + * Properties of an IncrementalBackupSpec. + * @memberof google.spanner.admin.database.v1 + * @interface IIncrementalBackupSpec + */ + + /** + * Constructs a new IncrementalBackupSpec. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents an IncrementalBackupSpec. + * @implements IIncrementalBackupSpec + * @constructor + * @param {google.spanner.admin.database.v1.IIncrementalBackupSpec=} [properties] Properties to set + */ + function IncrementalBackupSpec(properties) { + if (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 IncrementalBackupSpec instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.IncrementalBackupSpec + * @static + * @param {google.spanner.admin.database.v1.IIncrementalBackupSpec=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.IncrementalBackupSpec} IncrementalBackupSpec instance + */ + IncrementalBackupSpec.create = function create(properties) { + return new IncrementalBackupSpec(properties); + }; + + /** + * Encodes the specified IncrementalBackupSpec message. Does not implicitly {@link google.spanner.admin.database.v1.IncrementalBackupSpec.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.IncrementalBackupSpec + * @static + * @param {google.spanner.admin.database.v1.IIncrementalBackupSpec} message IncrementalBackupSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IncrementalBackupSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified IncrementalBackupSpec message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.IncrementalBackupSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.IncrementalBackupSpec + * @static + * @param {google.spanner.admin.database.v1.IIncrementalBackupSpec} message IncrementalBackupSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IncrementalBackupSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IncrementalBackupSpec message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.IncrementalBackupSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.IncrementalBackupSpec} IncrementalBackupSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IncrementalBackupSpec.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.IncrementalBackupSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IncrementalBackupSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.IncrementalBackupSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.IncrementalBackupSpec} IncrementalBackupSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IncrementalBackupSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IncrementalBackupSpec message. + * @function verify + * @memberof google.spanner.admin.database.v1.IncrementalBackupSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IncrementalBackupSpec.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an IncrementalBackupSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.IncrementalBackupSpec + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.IncrementalBackupSpec} IncrementalBackupSpec + */ + IncrementalBackupSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.IncrementalBackupSpec) + return object; + return new $root.google.spanner.admin.database.v1.IncrementalBackupSpec(); + }; + + /** + * Creates a plain object from an IncrementalBackupSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.IncrementalBackupSpec + * @static + * @param {google.spanner.admin.database.v1.IncrementalBackupSpec} message IncrementalBackupSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IncrementalBackupSpec.toObject = function toObject() { + return {}; + }; + + /** + * Converts this IncrementalBackupSpec to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.IncrementalBackupSpec + * @instance + * @returns {Object.} JSON object + */ + IncrementalBackupSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IncrementalBackupSpec + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.IncrementalBackupSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IncrementalBackupSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.IncrementalBackupSpec"; + }; + + return IncrementalBackupSpec; + })(); + + v1.BackupInstancePartition = (function() { + + /** + * Properties of a BackupInstancePartition. + * @memberof google.spanner.admin.database.v1 + * @interface IBackupInstancePartition + * @property {string|null} [instancePartition] BackupInstancePartition instancePartition + */ + + /** + * Constructs a new BackupInstancePartition. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents a BackupInstancePartition. + * @implements IBackupInstancePartition + * @constructor + * @param {google.spanner.admin.database.v1.IBackupInstancePartition=} [properties] Properties to set + */ + function BackupInstancePartition(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BackupInstancePartition instancePartition. + * @member {string} instancePartition + * @memberof google.spanner.admin.database.v1.BackupInstancePartition + * @instance + */ + BackupInstancePartition.prototype.instancePartition = ""; + + /** + * Creates a new BackupInstancePartition instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.BackupInstancePartition + * @static + * @param {google.spanner.admin.database.v1.IBackupInstancePartition=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.BackupInstancePartition} BackupInstancePartition instance + */ + BackupInstancePartition.create = function create(properties) { + return new BackupInstancePartition(properties); + }; + + /** + * Encodes the specified BackupInstancePartition message. Does not implicitly {@link google.spanner.admin.database.v1.BackupInstancePartition.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.BackupInstancePartition + * @static + * @param {google.spanner.admin.database.v1.IBackupInstancePartition} message BackupInstancePartition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupInstancePartition.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.instancePartition != null && Object.hasOwnProperty.call(message, "instancePartition")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.instancePartition); + return writer; + }; + + /** + * Encodes the specified BackupInstancePartition message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.BackupInstancePartition.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.BackupInstancePartition + * @static + * @param {google.spanner.admin.database.v1.IBackupInstancePartition} message BackupInstancePartition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupInstancePartition.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BackupInstancePartition message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.BackupInstancePartition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.BackupInstancePartition} BackupInstancePartition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupInstancePartition.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.BackupInstancePartition(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.instancePartition = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BackupInstancePartition message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.BackupInstancePartition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.BackupInstancePartition} BackupInstancePartition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupInstancePartition.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BackupInstancePartition message. + * @function verify + * @memberof google.spanner.admin.database.v1.BackupInstancePartition + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BackupInstancePartition.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.instancePartition != null && message.hasOwnProperty("instancePartition")) + if (!$util.isString(message.instancePartition)) + return "instancePartition: string expected"; + return null; + }; + + /** + * Creates a BackupInstancePartition message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.BackupInstancePartition + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.BackupInstancePartition} BackupInstancePartition + */ + BackupInstancePartition.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.BackupInstancePartition) + return object; + var message = new $root.google.spanner.admin.database.v1.BackupInstancePartition(); + if (object.instancePartition != null) + message.instancePartition = String(object.instancePartition); + return message; + }; + + /** + * Creates a plain object from a BackupInstancePartition message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.BackupInstancePartition + * @static + * @param {google.spanner.admin.database.v1.BackupInstancePartition} message BackupInstancePartition + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BackupInstancePartition.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.instancePartition = ""; + if (message.instancePartition != null && message.hasOwnProperty("instancePartition")) + object.instancePartition = message.instancePartition; + return object; + }; + + /** + * Converts this BackupInstancePartition to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.BackupInstancePartition + * @instance + * @returns {Object.} JSON object + */ + BackupInstancePartition.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BackupInstancePartition + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.BackupInstancePartition + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BackupInstancePartition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.BackupInstancePartition"; + }; + + return BackupInstancePartition; + })(); + + v1.OperationProgress = (function() { + + /** + * Properties of an OperationProgress. + * @memberof google.spanner.admin.database.v1 + * @interface IOperationProgress + * @property {number|null} [progressPercent] OperationProgress progressPercent + * @property {google.protobuf.ITimestamp|null} [startTime] OperationProgress startTime + * @property {google.protobuf.ITimestamp|null} [endTime] OperationProgress endTime + */ + + /** + * Constructs a new OperationProgress. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents an OperationProgress. + * @implements IOperationProgress + * @constructor + * @param {google.spanner.admin.database.v1.IOperationProgress=} [properties] Properties to set + */ + function OperationProgress(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OperationProgress progressPercent. + * @member {number} progressPercent + * @memberof google.spanner.admin.database.v1.OperationProgress + * @instance + */ + OperationProgress.prototype.progressPercent = 0; + + /** + * OperationProgress startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.spanner.admin.database.v1.OperationProgress + * @instance + */ + OperationProgress.prototype.startTime = null; + + /** + * OperationProgress endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.spanner.admin.database.v1.OperationProgress + * @instance + */ + OperationProgress.prototype.endTime = null; + + /** + * Creates a new OperationProgress instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.OperationProgress + * @static + * @param {google.spanner.admin.database.v1.IOperationProgress=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.OperationProgress} OperationProgress instance + */ + OperationProgress.create = function create(properties) { + return new OperationProgress(properties); + }; + + /** + * Encodes the specified OperationProgress message. Does not implicitly {@link google.spanner.admin.database.v1.OperationProgress.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.OperationProgress + * @static + * @param {google.spanner.admin.database.v1.IOperationProgress} message OperationProgress message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationProgress.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.progressPercent != null && Object.hasOwnProperty.call(message, "progressPercent")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.progressPercent); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OperationProgress message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.OperationProgress.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.OperationProgress + * @static + * @param {google.spanner.admin.database.v1.IOperationProgress} message OperationProgress message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationProgress.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationProgress message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.OperationProgress + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.OperationProgress} OperationProgress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationProgress.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.OperationProgress(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.progressPercent = reader.int32(); + break; + } + case 2: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationProgress message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.OperationProgress + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.OperationProgress} OperationProgress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationProgress.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationProgress message. + * @function verify + * @memberof google.spanner.admin.database.v1.OperationProgress + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationProgress.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.progressPercent != null && message.hasOwnProperty("progressPercent")) + if (!$util.isInteger(message.progressPercent)) + return "progressPercent: integer expected"; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + return null; + }; + + /** + * Creates an OperationProgress message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.OperationProgress + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.OperationProgress} OperationProgress + */ + OperationProgress.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.OperationProgress) + return object; + var message = new $root.google.spanner.admin.database.v1.OperationProgress(); + if (object.progressPercent != null) + message.progressPercent = object.progressPercent | 0; + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.spanner.admin.database.v1.OperationProgress.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.spanner.admin.database.v1.OperationProgress.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + return message; + }; + + /** + * Creates a plain object from an OperationProgress message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.OperationProgress + * @static + * @param {google.spanner.admin.database.v1.OperationProgress} message OperationProgress + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationProgress.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.progressPercent = 0; + object.startTime = null; + object.endTime = null; + } + if (message.progressPercent != null && message.hasOwnProperty("progressPercent")) + object.progressPercent = message.progressPercent; + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + return object; + }; + + /** + * Converts this OperationProgress to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.OperationProgress + * @instance + * @returns {Object.} JSON object + */ + OperationProgress.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OperationProgress + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.OperationProgress + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OperationProgress.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.OperationProgress"; + }; + + return OperationProgress; + })(); + + v1.EncryptionConfig = (function() { + + /** + * Properties of an EncryptionConfig. + * @memberof google.spanner.admin.database.v1 + * @interface IEncryptionConfig + * @property {string|null} [kmsKeyName] EncryptionConfig kmsKeyName + * @property {Array.|null} [kmsKeyNames] EncryptionConfig kmsKeyNames + */ + + /** + * Constructs a new EncryptionConfig. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents an EncryptionConfig. + * @implements IEncryptionConfig + * @constructor + * @param {google.spanner.admin.database.v1.IEncryptionConfig=} [properties] Properties to set + */ + function EncryptionConfig(properties) { + this.kmsKeyNames = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EncryptionConfig kmsKeyName. + * @member {string} kmsKeyName + * @memberof google.spanner.admin.database.v1.EncryptionConfig + * @instance + */ + EncryptionConfig.prototype.kmsKeyName = ""; + + /** + * EncryptionConfig kmsKeyNames. + * @member {Array.} kmsKeyNames + * @memberof google.spanner.admin.database.v1.EncryptionConfig + * @instance + */ + EncryptionConfig.prototype.kmsKeyNames = $util.emptyArray; + + /** + * Creates a new EncryptionConfig instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.EncryptionConfig + * @static + * @param {google.spanner.admin.database.v1.IEncryptionConfig=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.EncryptionConfig} EncryptionConfig instance + */ + EncryptionConfig.create = function create(properties) { + return new EncryptionConfig(properties); + }; + + /** + * Encodes the specified EncryptionConfig message. Does not implicitly {@link google.spanner.admin.database.v1.EncryptionConfig.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.EncryptionConfig + * @static + * @param {google.spanner.admin.database.v1.IEncryptionConfig} message EncryptionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EncryptionConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.kmsKeyName); + if (message.kmsKeyNames != null && message.kmsKeyNames.length) + for (var i = 0; i < message.kmsKeyNames.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.kmsKeyNames[i]); + return writer; + }; + + /** + * Encodes the specified EncryptionConfig message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.EncryptionConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.EncryptionConfig + * @static + * @param {google.spanner.admin.database.v1.IEncryptionConfig} message EncryptionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EncryptionConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EncryptionConfig message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.EncryptionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.EncryptionConfig} EncryptionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EncryptionConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.EncryptionConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.kmsKeyName = reader.string(); + break; + } + case 3: { + if (!(message.kmsKeyNames && message.kmsKeyNames.length)) + message.kmsKeyNames = []; + message.kmsKeyNames.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EncryptionConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.EncryptionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.EncryptionConfig} EncryptionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EncryptionConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EncryptionConfig message. + * @function verify + * @memberof google.spanner.admin.database.v1.EncryptionConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EncryptionConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + if (!$util.isString(message.kmsKeyName)) + return "kmsKeyName: string expected"; + if (message.kmsKeyNames != null && message.hasOwnProperty("kmsKeyNames")) { + if (!Array.isArray(message.kmsKeyNames)) + return "kmsKeyNames: array expected"; + for (var i = 0; i < message.kmsKeyNames.length; ++i) + if (!$util.isString(message.kmsKeyNames[i])) + return "kmsKeyNames: string[] expected"; + } + return null; + }; + + /** + * Creates an EncryptionConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.EncryptionConfig + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.EncryptionConfig} EncryptionConfig + */ + EncryptionConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.EncryptionConfig) + return object; + var message = new $root.google.spanner.admin.database.v1.EncryptionConfig(); + if (object.kmsKeyName != null) + message.kmsKeyName = String(object.kmsKeyName); + if (object.kmsKeyNames) { + if (!Array.isArray(object.kmsKeyNames)) + throw TypeError(".google.spanner.admin.database.v1.EncryptionConfig.kmsKeyNames: array expected"); + message.kmsKeyNames = []; + for (var i = 0; i < object.kmsKeyNames.length; ++i) + message.kmsKeyNames[i] = String(object.kmsKeyNames[i]); + } + return message; + }; + + /** + * Creates a plain object from an EncryptionConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.EncryptionConfig + * @static + * @param {google.spanner.admin.database.v1.EncryptionConfig} message EncryptionConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EncryptionConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.kmsKeyNames = []; + if (options.defaults) + object.kmsKeyName = ""; + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + object.kmsKeyName = message.kmsKeyName; + if (message.kmsKeyNames && message.kmsKeyNames.length) { + object.kmsKeyNames = []; + for (var j = 0; j < message.kmsKeyNames.length; ++j) + object.kmsKeyNames[j] = message.kmsKeyNames[j]; + } + return object; + }; + + /** + * Converts this EncryptionConfig to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.EncryptionConfig + * @instance + * @returns {Object.} JSON object + */ + EncryptionConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EncryptionConfig + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.EncryptionConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EncryptionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.EncryptionConfig"; + }; + + return EncryptionConfig; + })(); + + v1.EncryptionInfo = (function() { + + /** + * Properties of an EncryptionInfo. + * @memberof google.spanner.admin.database.v1 + * @interface IEncryptionInfo + * @property {google.spanner.admin.database.v1.EncryptionInfo.Type|null} [encryptionType] EncryptionInfo encryptionType + * @property {google.rpc.IStatus|null} [encryptionStatus] EncryptionInfo encryptionStatus + * @property {string|null} [kmsKeyVersion] EncryptionInfo kmsKeyVersion + */ + + /** + * Constructs a new EncryptionInfo. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents an EncryptionInfo. + * @implements IEncryptionInfo + * @constructor + * @param {google.spanner.admin.database.v1.IEncryptionInfo=} [properties] Properties to set + */ + function EncryptionInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EncryptionInfo encryptionType. + * @member {google.spanner.admin.database.v1.EncryptionInfo.Type} encryptionType + * @memberof google.spanner.admin.database.v1.EncryptionInfo + * @instance + */ + EncryptionInfo.prototype.encryptionType = 0; + + /** + * EncryptionInfo encryptionStatus. + * @member {google.rpc.IStatus|null|undefined} encryptionStatus + * @memberof google.spanner.admin.database.v1.EncryptionInfo + * @instance + */ + EncryptionInfo.prototype.encryptionStatus = null; + + /** + * EncryptionInfo kmsKeyVersion. + * @member {string} kmsKeyVersion + * @memberof google.spanner.admin.database.v1.EncryptionInfo + * @instance + */ + EncryptionInfo.prototype.kmsKeyVersion = ""; + + /** + * Creates a new EncryptionInfo instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.EncryptionInfo + * @static + * @param {google.spanner.admin.database.v1.IEncryptionInfo=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.EncryptionInfo} EncryptionInfo instance + */ + EncryptionInfo.create = function create(properties) { + return new EncryptionInfo(properties); + }; + + /** + * Encodes the specified EncryptionInfo message. Does not implicitly {@link google.spanner.admin.database.v1.EncryptionInfo.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.EncryptionInfo + * @static + * @param {google.spanner.admin.database.v1.IEncryptionInfo} message EncryptionInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EncryptionInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kmsKeyVersion != null && Object.hasOwnProperty.call(message, "kmsKeyVersion")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.kmsKeyVersion); + if (message.encryptionType != null && Object.hasOwnProperty.call(message, "encryptionType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.encryptionType); + if (message.encryptionStatus != null && Object.hasOwnProperty.call(message, "encryptionStatus")) + $root.google.rpc.Status.encode(message.encryptionStatus, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EncryptionInfo message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.EncryptionInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.EncryptionInfo + * @static + * @param {google.spanner.admin.database.v1.IEncryptionInfo} message EncryptionInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EncryptionInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EncryptionInfo message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.EncryptionInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.EncryptionInfo} EncryptionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EncryptionInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.EncryptionInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.encryptionType = reader.int32(); + break; + } + case 4: { + message.encryptionStatus = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 2: { + message.kmsKeyVersion = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EncryptionInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.EncryptionInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.EncryptionInfo} EncryptionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EncryptionInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EncryptionInfo message. + * @function verify + * @memberof google.spanner.admin.database.v1.EncryptionInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EncryptionInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.encryptionType != null && message.hasOwnProperty("encryptionType")) + switch (message.encryptionType) { + default: + return "encryptionType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.encryptionStatus != null && message.hasOwnProperty("encryptionStatus")) { + var error = $root.google.rpc.Status.verify(message.encryptionStatus); + if (error) + return "encryptionStatus." + error; + } + if (message.kmsKeyVersion != null && message.hasOwnProperty("kmsKeyVersion")) + if (!$util.isString(message.kmsKeyVersion)) + return "kmsKeyVersion: string expected"; + return null; + }; + + /** + * Creates an EncryptionInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.EncryptionInfo + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.EncryptionInfo} EncryptionInfo + */ + EncryptionInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.EncryptionInfo) + return object; + var message = new $root.google.spanner.admin.database.v1.EncryptionInfo(); + switch (object.encryptionType) { + default: + if (typeof object.encryptionType === "number") { + message.encryptionType = object.encryptionType; + break; + } + break; + case "TYPE_UNSPECIFIED": + case 0: + message.encryptionType = 0; + break; + case "GOOGLE_DEFAULT_ENCRYPTION": + case 1: + message.encryptionType = 1; + break; + case "CUSTOMER_MANAGED_ENCRYPTION": + case 2: + message.encryptionType = 2; + break; + } + if (object.encryptionStatus != null) { + if (typeof object.encryptionStatus !== "object") + throw TypeError(".google.spanner.admin.database.v1.EncryptionInfo.encryptionStatus: object expected"); + message.encryptionStatus = $root.google.rpc.Status.fromObject(object.encryptionStatus); + } + if (object.kmsKeyVersion != null) + message.kmsKeyVersion = String(object.kmsKeyVersion); + return message; + }; + + /** + * Creates a plain object from an EncryptionInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.EncryptionInfo + * @static + * @param {google.spanner.admin.database.v1.EncryptionInfo} message EncryptionInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EncryptionInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.kmsKeyVersion = ""; + object.encryptionType = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.encryptionStatus = null; + } + if (message.kmsKeyVersion != null && message.hasOwnProperty("kmsKeyVersion")) + object.kmsKeyVersion = message.kmsKeyVersion; + if (message.encryptionType != null && message.hasOwnProperty("encryptionType")) + object.encryptionType = options.enums === String ? $root.google.spanner.admin.database.v1.EncryptionInfo.Type[message.encryptionType] === undefined ? message.encryptionType : $root.google.spanner.admin.database.v1.EncryptionInfo.Type[message.encryptionType] : message.encryptionType; + if (message.encryptionStatus != null && message.hasOwnProperty("encryptionStatus")) + object.encryptionStatus = $root.google.rpc.Status.toObject(message.encryptionStatus, options); + return object; + }; + + /** + * Converts this EncryptionInfo to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.EncryptionInfo + * @instance + * @returns {Object.} JSON object + */ + EncryptionInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EncryptionInfo + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.EncryptionInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EncryptionInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.EncryptionInfo"; + }; + + /** + * Type enum. + * @name google.spanner.admin.database.v1.EncryptionInfo.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} GOOGLE_DEFAULT_ENCRYPTION=1 GOOGLE_DEFAULT_ENCRYPTION value + * @property {number} CUSTOMER_MANAGED_ENCRYPTION=2 CUSTOMER_MANAGED_ENCRYPTION value + */ + EncryptionInfo.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "GOOGLE_DEFAULT_ENCRYPTION"] = 1; + values[valuesById[2] = "CUSTOMER_MANAGED_ENCRYPTION"] = 2; + return values; + })(); + + return EncryptionInfo; + })(); + + /** + * DatabaseDialect enum. + * @name google.spanner.admin.database.v1.DatabaseDialect + * @enum {number} + * @property {number} DATABASE_DIALECT_UNSPECIFIED=0 DATABASE_DIALECT_UNSPECIFIED value + * @property {number} GOOGLE_STANDARD_SQL=1 GOOGLE_STANDARD_SQL value + * @property {number} POSTGRESQL=2 POSTGRESQL value + */ + v1.DatabaseDialect = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DATABASE_DIALECT_UNSPECIFIED"] = 0; + values[valuesById[1] = "GOOGLE_STANDARD_SQL"] = 1; + values[valuesById[2] = "POSTGRESQL"] = 2; + return values; + })(); + + v1.BackupScheduleSpec = (function() { + + /** + * Properties of a BackupScheduleSpec. + * @memberof google.spanner.admin.database.v1 + * @interface IBackupScheduleSpec + * @property {google.spanner.admin.database.v1.ICrontabSpec|null} [cronSpec] BackupScheduleSpec cronSpec + */ + + /** + * Constructs a new BackupScheduleSpec. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents a BackupScheduleSpec. + * @implements IBackupScheduleSpec + * @constructor + * @param {google.spanner.admin.database.v1.IBackupScheduleSpec=} [properties] Properties to set + */ + function BackupScheduleSpec(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BackupScheduleSpec cronSpec. + * @member {google.spanner.admin.database.v1.ICrontabSpec|null|undefined} cronSpec + * @memberof google.spanner.admin.database.v1.BackupScheduleSpec + * @instance + */ + BackupScheduleSpec.prototype.cronSpec = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BackupScheduleSpec scheduleSpec. + * @member {"cronSpec"|undefined} scheduleSpec + * @memberof google.spanner.admin.database.v1.BackupScheduleSpec + * @instance + */ + Object.defineProperty(BackupScheduleSpec.prototype, "scheduleSpec", { + get: $util.oneOfGetter($oneOfFields = ["cronSpec"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BackupScheduleSpec instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.BackupScheduleSpec + * @static + * @param {google.spanner.admin.database.v1.IBackupScheduleSpec=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.BackupScheduleSpec} BackupScheduleSpec instance + */ + BackupScheduleSpec.create = function create(properties) { + return new BackupScheduleSpec(properties); + }; + + /** + * Encodes the specified BackupScheduleSpec message. Does not implicitly {@link google.spanner.admin.database.v1.BackupScheduleSpec.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.BackupScheduleSpec + * @static + * @param {google.spanner.admin.database.v1.IBackupScheduleSpec} message BackupScheduleSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupScheduleSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cronSpec != null && Object.hasOwnProperty.call(message, "cronSpec")) + $root.google.spanner.admin.database.v1.CrontabSpec.encode(message.cronSpec, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BackupScheduleSpec message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.BackupScheduleSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.BackupScheduleSpec + * @static + * @param {google.spanner.admin.database.v1.IBackupScheduleSpec} message BackupScheduleSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupScheduleSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BackupScheduleSpec message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.BackupScheduleSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.BackupScheduleSpec} BackupScheduleSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupScheduleSpec.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.BackupScheduleSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.cronSpec = $root.google.spanner.admin.database.v1.CrontabSpec.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BackupScheduleSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.BackupScheduleSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.BackupScheduleSpec} BackupScheduleSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupScheduleSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BackupScheduleSpec message. + * @function verify + * @memberof google.spanner.admin.database.v1.BackupScheduleSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BackupScheduleSpec.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.cronSpec != null && message.hasOwnProperty("cronSpec")) { + properties.scheduleSpec = 1; + { + var error = $root.google.spanner.admin.database.v1.CrontabSpec.verify(message.cronSpec); + if (error) + return "cronSpec." + error; + } + } + return null; + }; + + /** + * Creates a BackupScheduleSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.BackupScheduleSpec + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.BackupScheduleSpec} BackupScheduleSpec + */ + BackupScheduleSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.BackupScheduleSpec) + return object; + var message = new $root.google.spanner.admin.database.v1.BackupScheduleSpec(); + if (object.cronSpec != null) { + if (typeof object.cronSpec !== "object") + throw TypeError(".google.spanner.admin.database.v1.BackupScheduleSpec.cronSpec: object expected"); + message.cronSpec = $root.google.spanner.admin.database.v1.CrontabSpec.fromObject(object.cronSpec); + } + return message; + }; + + /** + * Creates a plain object from a BackupScheduleSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.BackupScheduleSpec + * @static + * @param {google.spanner.admin.database.v1.BackupScheduleSpec} message BackupScheduleSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BackupScheduleSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.cronSpec != null && message.hasOwnProperty("cronSpec")) { + object.cronSpec = $root.google.spanner.admin.database.v1.CrontabSpec.toObject(message.cronSpec, options); + if (options.oneofs) + object.scheduleSpec = "cronSpec"; + } + return object; + }; + + /** + * Converts this BackupScheduleSpec to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.BackupScheduleSpec + * @instance + * @returns {Object.} JSON object + */ + BackupScheduleSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BackupScheduleSpec + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.BackupScheduleSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BackupScheduleSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.BackupScheduleSpec"; + }; + + return BackupScheduleSpec; + })(); + + v1.BackupSchedule = (function() { + + /** + * Properties of a BackupSchedule. + * @memberof google.spanner.admin.database.v1 + * @interface IBackupSchedule + * @property {string|null} [name] BackupSchedule name + * @property {google.spanner.admin.database.v1.IBackupScheduleSpec|null} [spec] BackupSchedule spec + * @property {google.protobuf.IDuration|null} [retentionDuration] BackupSchedule retentionDuration + * @property {google.spanner.admin.database.v1.ICreateBackupEncryptionConfig|null} [encryptionConfig] BackupSchedule encryptionConfig + * @property {google.spanner.admin.database.v1.IFullBackupSpec|null} [fullBackupSpec] BackupSchedule fullBackupSpec + * @property {google.spanner.admin.database.v1.IIncrementalBackupSpec|null} [incrementalBackupSpec] BackupSchedule incrementalBackupSpec + * @property {google.protobuf.ITimestamp|null} [updateTime] BackupSchedule updateTime + */ + + /** + * Constructs a new BackupSchedule. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents a BackupSchedule. + * @implements IBackupSchedule + * @constructor + * @param {google.spanner.admin.database.v1.IBackupSchedule=} [properties] Properties to set + */ + function BackupSchedule(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BackupSchedule name. + * @member {string} name + * @memberof google.spanner.admin.database.v1.BackupSchedule + * @instance + */ + BackupSchedule.prototype.name = ""; + + /** + * BackupSchedule spec. + * @member {google.spanner.admin.database.v1.IBackupScheduleSpec|null|undefined} spec + * @memberof google.spanner.admin.database.v1.BackupSchedule + * @instance + */ + BackupSchedule.prototype.spec = null; + + /** + * BackupSchedule retentionDuration. + * @member {google.protobuf.IDuration|null|undefined} retentionDuration + * @memberof google.spanner.admin.database.v1.BackupSchedule + * @instance + */ + BackupSchedule.prototype.retentionDuration = null; + + /** + * BackupSchedule encryptionConfig. + * @member {google.spanner.admin.database.v1.ICreateBackupEncryptionConfig|null|undefined} encryptionConfig + * @memberof google.spanner.admin.database.v1.BackupSchedule + * @instance + */ + BackupSchedule.prototype.encryptionConfig = null; + + /** + * BackupSchedule fullBackupSpec. + * @member {google.spanner.admin.database.v1.IFullBackupSpec|null|undefined} fullBackupSpec + * @memberof google.spanner.admin.database.v1.BackupSchedule + * @instance + */ + BackupSchedule.prototype.fullBackupSpec = null; + + /** + * BackupSchedule incrementalBackupSpec. + * @member {google.spanner.admin.database.v1.IIncrementalBackupSpec|null|undefined} incrementalBackupSpec + * @memberof google.spanner.admin.database.v1.BackupSchedule + * @instance + */ + BackupSchedule.prototype.incrementalBackupSpec = null; + + /** + * BackupSchedule updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.spanner.admin.database.v1.BackupSchedule + * @instance + */ + BackupSchedule.prototype.updateTime = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BackupSchedule backupTypeSpec. + * @member {"fullBackupSpec"|"incrementalBackupSpec"|undefined} backupTypeSpec + * @memberof google.spanner.admin.database.v1.BackupSchedule + * @instance + */ + Object.defineProperty(BackupSchedule.prototype, "backupTypeSpec", { + get: $util.oneOfGetter($oneOfFields = ["fullBackupSpec", "incrementalBackupSpec"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BackupSchedule instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.BackupSchedule + * @static + * @param {google.spanner.admin.database.v1.IBackupSchedule=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.BackupSchedule} BackupSchedule instance + */ + BackupSchedule.create = function create(properties) { + return new BackupSchedule(properties); + }; + + /** + * Encodes the specified BackupSchedule message. Does not implicitly {@link google.spanner.admin.database.v1.BackupSchedule.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.BackupSchedule + * @static + * @param {google.spanner.admin.database.v1.IBackupSchedule} message BackupSchedule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupSchedule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.retentionDuration != null && Object.hasOwnProperty.call(message, "retentionDuration")) + $root.google.protobuf.Duration.encode(message.retentionDuration, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) + $root.google.spanner.admin.database.v1.CreateBackupEncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.spec != null && Object.hasOwnProperty.call(message, "spec")) + $root.google.spanner.admin.database.v1.BackupScheduleSpec.encode(message.spec, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.fullBackupSpec != null && Object.hasOwnProperty.call(message, "fullBackupSpec")) + $root.google.spanner.admin.database.v1.FullBackupSpec.encode(message.fullBackupSpec, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.incrementalBackupSpec != null && Object.hasOwnProperty.call(message, "incrementalBackupSpec")) + $root.google.spanner.admin.database.v1.IncrementalBackupSpec.encode(message.incrementalBackupSpec, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BackupSchedule message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.BackupSchedule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.BackupSchedule + * @static + * @param {google.spanner.admin.database.v1.IBackupSchedule} message BackupSchedule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupSchedule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BackupSchedule message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.BackupSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.BackupSchedule} BackupSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupSchedule.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.BackupSchedule(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 6: { + message.spec = $root.google.spanner.admin.database.v1.BackupScheduleSpec.decode(reader, reader.uint32()); + break; + } + case 3: { + message.retentionDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 4: { + message.encryptionConfig = $root.google.spanner.admin.database.v1.CreateBackupEncryptionConfig.decode(reader, reader.uint32()); + break; + } + case 7: { + message.fullBackupSpec = $root.google.spanner.admin.database.v1.FullBackupSpec.decode(reader, reader.uint32()); + break; + } + case 8: { + message.incrementalBackupSpec = $root.google.spanner.admin.database.v1.IncrementalBackupSpec.decode(reader, reader.uint32()); + break; + } + case 9: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BackupSchedule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.BackupSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.BackupSchedule} BackupSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupSchedule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BackupSchedule message. + * @function verify + * @memberof google.spanner.admin.database.v1.BackupSchedule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BackupSchedule.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.spec != null && message.hasOwnProperty("spec")) { + var error = $root.google.spanner.admin.database.v1.BackupScheduleSpec.verify(message.spec); + if (error) + return "spec." + error; + } + if (message.retentionDuration != null && message.hasOwnProperty("retentionDuration")) { + var error = $root.google.protobuf.Duration.verify(message.retentionDuration); + if (error) + return "retentionDuration." + error; + } + if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { + var error = $root.google.spanner.admin.database.v1.CreateBackupEncryptionConfig.verify(message.encryptionConfig); + if (error) + return "encryptionConfig." + error; + } + if (message.fullBackupSpec != null && message.hasOwnProperty("fullBackupSpec")) { + properties.backupTypeSpec = 1; + { + var error = $root.google.spanner.admin.database.v1.FullBackupSpec.verify(message.fullBackupSpec); + if (error) + return "fullBackupSpec." + error; + } + } + if (message.incrementalBackupSpec != null && message.hasOwnProperty("incrementalBackupSpec")) { + if (properties.backupTypeSpec === 1) + return "backupTypeSpec: multiple values"; + properties.backupTypeSpec = 1; + { + var error = $root.google.spanner.admin.database.v1.IncrementalBackupSpec.verify(message.incrementalBackupSpec); + if (error) + return "incrementalBackupSpec." + error; + } + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + return null; + }; + + /** + * Creates a BackupSchedule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.BackupSchedule + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.BackupSchedule} BackupSchedule + */ + BackupSchedule.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.BackupSchedule) + return object; + var message = new $root.google.spanner.admin.database.v1.BackupSchedule(); + if (object.name != null) + message.name = String(object.name); + if (object.spec != null) { + if (typeof object.spec !== "object") + throw TypeError(".google.spanner.admin.database.v1.BackupSchedule.spec: object expected"); + message.spec = $root.google.spanner.admin.database.v1.BackupScheduleSpec.fromObject(object.spec); + } + if (object.retentionDuration != null) { + if (typeof object.retentionDuration !== "object") + throw TypeError(".google.spanner.admin.database.v1.BackupSchedule.retentionDuration: object expected"); + message.retentionDuration = $root.google.protobuf.Duration.fromObject(object.retentionDuration); + } + if (object.encryptionConfig != null) { + if (typeof object.encryptionConfig !== "object") + throw TypeError(".google.spanner.admin.database.v1.BackupSchedule.encryptionConfig: object expected"); + message.encryptionConfig = $root.google.spanner.admin.database.v1.CreateBackupEncryptionConfig.fromObject(object.encryptionConfig); + } + if (object.fullBackupSpec != null) { + if (typeof object.fullBackupSpec !== "object") + throw TypeError(".google.spanner.admin.database.v1.BackupSchedule.fullBackupSpec: object expected"); + message.fullBackupSpec = $root.google.spanner.admin.database.v1.FullBackupSpec.fromObject(object.fullBackupSpec); + } + if (object.incrementalBackupSpec != null) { + if (typeof object.incrementalBackupSpec !== "object") + throw TypeError(".google.spanner.admin.database.v1.BackupSchedule.incrementalBackupSpec: object expected"); + message.incrementalBackupSpec = $root.google.spanner.admin.database.v1.IncrementalBackupSpec.fromObject(object.incrementalBackupSpec); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.spanner.admin.database.v1.BackupSchedule.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + return message; + }; + + /** + * Creates a plain object from a BackupSchedule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.BackupSchedule + * @static + * @param {google.spanner.admin.database.v1.BackupSchedule} message BackupSchedule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BackupSchedule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.retentionDuration = null; + object.encryptionConfig = null; + object.spec = null; + object.updateTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.retentionDuration != null && message.hasOwnProperty("retentionDuration")) + object.retentionDuration = $root.google.protobuf.Duration.toObject(message.retentionDuration, options); + if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) + object.encryptionConfig = $root.google.spanner.admin.database.v1.CreateBackupEncryptionConfig.toObject(message.encryptionConfig, options); + if (message.spec != null && message.hasOwnProperty("spec")) + object.spec = $root.google.spanner.admin.database.v1.BackupScheduleSpec.toObject(message.spec, options); + if (message.fullBackupSpec != null && message.hasOwnProperty("fullBackupSpec")) { + object.fullBackupSpec = $root.google.spanner.admin.database.v1.FullBackupSpec.toObject(message.fullBackupSpec, options); + if (options.oneofs) + object.backupTypeSpec = "fullBackupSpec"; + } + if (message.incrementalBackupSpec != null && message.hasOwnProperty("incrementalBackupSpec")) { + object.incrementalBackupSpec = $root.google.spanner.admin.database.v1.IncrementalBackupSpec.toObject(message.incrementalBackupSpec, options); + if (options.oneofs) + object.backupTypeSpec = "incrementalBackupSpec"; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + return object; + }; + + /** + * Converts this BackupSchedule to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.BackupSchedule + * @instance + * @returns {Object.} JSON object + */ + BackupSchedule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BackupSchedule + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.BackupSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BackupSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.BackupSchedule"; + }; + + return BackupSchedule; + })(); + + v1.CrontabSpec = (function() { + + /** + * Properties of a CrontabSpec. + * @memberof google.spanner.admin.database.v1 + * @interface ICrontabSpec + * @property {string|null} [text] CrontabSpec text + * @property {string|null} [timeZone] CrontabSpec timeZone + * @property {google.protobuf.IDuration|null} [creationWindow] CrontabSpec creationWindow + */ + + /** + * Constructs a new CrontabSpec. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents a CrontabSpec. + * @implements ICrontabSpec + * @constructor + * @param {google.spanner.admin.database.v1.ICrontabSpec=} [properties] Properties to set + */ + function CrontabSpec(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CrontabSpec text. + * @member {string} text + * @memberof google.spanner.admin.database.v1.CrontabSpec + * @instance + */ + CrontabSpec.prototype.text = ""; + + /** + * CrontabSpec timeZone. + * @member {string} timeZone + * @memberof google.spanner.admin.database.v1.CrontabSpec + * @instance + */ + CrontabSpec.prototype.timeZone = ""; + + /** + * CrontabSpec creationWindow. + * @member {google.protobuf.IDuration|null|undefined} creationWindow + * @memberof google.spanner.admin.database.v1.CrontabSpec + * @instance + */ + CrontabSpec.prototype.creationWindow = null; + + /** + * Creates a new CrontabSpec instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.CrontabSpec + * @static + * @param {google.spanner.admin.database.v1.ICrontabSpec=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.CrontabSpec} CrontabSpec instance + */ + CrontabSpec.create = function create(properties) { + return new CrontabSpec(properties); + }; + + /** + * Encodes the specified CrontabSpec message. Does not implicitly {@link google.spanner.admin.database.v1.CrontabSpec.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.CrontabSpec + * @static + * @param {google.spanner.admin.database.v1.ICrontabSpec} message CrontabSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CrontabSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); + if (message.timeZone != null && Object.hasOwnProperty.call(message, "timeZone")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.timeZone); + if (message.creationWindow != null && Object.hasOwnProperty.call(message, "creationWindow")) + $root.google.protobuf.Duration.encode(message.creationWindow, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CrontabSpec message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.CrontabSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.CrontabSpec + * @static + * @param {google.spanner.admin.database.v1.ICrontabSpec} message CrontabSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CrontabSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CrontabSpec message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.CrontabSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.CrontabSpec} CrontabSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CrontabSpec.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.CrontabSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.text = reader.string(); + break; + } + case 2: { + message.timeZone = reader.string(); + break; + } + case 3: { + message.creationWindow = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CrontabSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.CrontabSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.CrontabSpec} CrontabSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CrontabSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CrontabSpec message. + * @function verify + * @memberof google.spanner.admin.database.v1.CrontabSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CrontabSpec.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.text != null && message.hasOwnProperty("text")) + if (!$util.isString(message.text)) + return "text: string expected"; + if (message.timeZone != null && message.hasOwnProperty("timeZone")) + if (!$util.isString(message.timeZone)) + return "timeZone: string expected"; + if (message.creationWindow != null && message.hasOwnProperty("creationWindow")) { + var error = $root.google.protobuf.Duration.verify(message.creationWindow); + if (error) + return "creationWindow." + error; + } + return null; + }; + + /** + * Creates a CrontabSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.CrontabSpec + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.CrontabSpec} CrontabSpec + */ + CrontabSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.CrontabSpec) + return object; + var message = new $root.google.spanner.admin.database.v1.CrontabSpec(); + if (object.text != null) + message.text = String(object.text); + if (object.timeZone != null) + message.timeZone = String(object.timeZone); + if (object.creationWindow != null) { + if (typeof object.creationWindow !== "object") + throw TypeError(".google.spanner.admin.database.v1.CrontabSpec.creationWindow: object expected"); + message.creationWindow = $root.google.protobuf.Duration.fromObject(object.creationWindow); + } + return message; + }; + + /** + * Creates a plain object from a CrontabSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.CrontabSpec + * @static + * @param {google.spanner.admin.database.v1.CrontabSpec} message CrontabSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CrontabSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.text = ""; + object.timeZone = ""; + object.creationWindow = null; + } + if (message.text != null && message.hasOwnProperty("text")) + object.text = message.text; + if (message.timeZone != null && message.hasOwnProperty("timeZone")) + object.timeZone = message.timeZone; + if (message.creationWindow != null && message.hasOwnProperty("creationWindow")) + object.creationWindow = $root.google.protobuf.Duration.toObject(message.creationWindow, options); + return object; + }; + + /** + * Converts this CrontabSpec to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.CrontabSpec + * @instance + * @returns {Object.} JSON object + */ + CrontabSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CrontabSpec + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.CrontabSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CrontabSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.CrontabSpec"; + }; + + return CrontabSpec; + })(); + + v1.CreateBackupScheduleRequest = (function() { + + /** + * Properties of a CreateBackupScheduleRequest. + * @memberof google.spanner.admin.database.v1 + * @interface ICreateBackupScheduleRequest + * @property {string|null} [parent] CreateBackupScheduleRequest parent + * @property {string|null} [backupScheduleId] CreateBackupScheduleRequest backupScheduleId + * @property {google.spanner.admin.database.v1.IBackupSchedule|null} [backupSchedule] CreateBackupScheduleRequest backupSchedule + */ + + /** + * Constructs a new CreateBackupScheduleRequest. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents a CreateBackupScheduleRequest. + * @implements ICreateBackupScheduleRequest + * @constructor + * @param {google.spanner.admin.database.v1.ICreateBackupScheduleRequest=} [properties] Properties to set + */ + function CreateBackupScheduleRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateBackupScheduleRequest parent. + * @member {string} parent + * @memberof google.spanner.admin.database.v1.CreateBackupScheduleRequest + * @instance + */ + CreateBackupScheduleRequest.prototype.parent = ""; + + /** + * CreateBackupScheduleRequest backupScheduleId. + * @member {string} backupScheduleId + * @memberof google.spanner.admin.database.v1.CreateBackupScheduleRequest + * @instance + */ + CreateBackupScheduleRequest.prototype.backupScheduleId = ""; + + /** + * CreateBackupScheduleRequest backupSchedule. + * @member {google.spanner.admin.database.v1.IBackupSchedule|null|undefined} backupSchedule + * @memberof google.spanner.admin.database.v1.CreateBackupScheduleRequest + * @instance + */ + CreateBackupScheduleRequest.prototype.backupSchedule = null; + + /** + * Creates a new CreateBackupScheduleRequest instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.CreateBackupScheduleRequest + * @static + * @param {google.spanner.admin.database.v1.ICreateBackupScheduleRequest=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.CreateBackupScheduleRequest} CreateBackupScheduleRequest instance + */ + CreateBackupScheduleRequest.create = function create(properties) { + return new CreateBackupScheduleRequest(properties); + }; + + /** + * Encodes the specified CreateBackupScheduleRequest message. Does not implicitly {@link google.spanner.admin.database.v1.CreateBackupScheduleRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.CreateBackupScheduleRequest + * @static + * @param {google.spanner.admin.database.v1.ICreateBackupScheduleRequest} message CreateBackupScheduleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateBackupScheduleRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.backupScheduleId != null && Object.hasOwnProperty.call(message, "backupScheduleId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.backupScheduleId); + if (message.backupSchedule != null && Object.hasOwnProperty.call(message, "backupSchedule")) + $root.google.spanner.admin.database.v1.BackupSchedule.encode(message.backupSchedule, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateBackupScheduleRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.CreateBackupScheduleRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.CreateBackupScheduleRequest + * @static + * @param {google.spanner.admin.database.v1.ICreateBackupScheduleRequest} message CreateBackupScheduleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateBackupScheduleRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateBackupScheduleRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.CreateBackupScheduleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.CreateBackupScheduleRequest} CreateBackupScheduleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateBackupScheduleRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.CreateBackupScheduleRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.backupScheduleId = reader.string(); + break; + } + case 3: { + message.backupSchedule = $root.google.spanner.admin.database.v1.BackupSchedule.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateBackupScheduleRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.CreateBackupScheduleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.CreateBackupScheduleRequest} CreateBackupScheduleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateBackupScheduleRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateBackupScheduleRequest message. + * @function verify + * @memberof google.spanner.admin.database.v1.CreateBackupScheduleRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateBackupScheduleRequest.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.backupScheduleId != null && message.hasOwnProperty("backupScheduleId")) + if (!$util.isString(message.backupScheduleId)) + return "backupScheduleId: string expected"; + if (message.backupSchedule != null && message.hasOwnProperty("backupSchedule")) { + var error = $root.google.spanner.admin.database.v1.BackupSchedule.verify(message.backupSchedule); + if (error) + return "backupSchedule." + error; + } + return null; + }; + + /** + * Creates a CreateBackupScheduleRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.CreateBackupScheduleRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.CreateBackupScheduleRequest} CreateBackupScheduleRequest + */ + CreateBackupScheduleRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.CreateBackupScheduleRequest) + return object; + var message = new $root.google.spanner.admin.database.v1.CreateBackupScheduleRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.backupScheduleId != null) + message.backupScheduleId = String(object.backupScheduleId); + if (object.backupSchedule != null) { + if (typeof object.backupSchedule !== "object") + throw TypeError(".google.spanner.admin.database.v1.CreateBackupScheduleRequest.backupSchedule: object expected"); + message.backupSchedule = $root.google.spanner.admin.database.v1.BackupSchedule.fromObject(object.backupSchedule); + } + return message; + }; + + /** + * Creates a plain object from a CreateBackupScheduleRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.CreateBackupScheduleRequest + * @static + * @param {google.spanner.admin.database.v1.CreateBackupScheduleRequest} message CreateBackupScheduleRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateBackupScheduleRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.backupScheduleId = ""; + object.backupSchedule = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.backupScheduleId != null && message.hasOwnProperty("backupScheduleId")) + object.backupScheduleId = message.backupScheduleId; + if (message.backupSchedule != null && message.hasOwnProperty("backupSchedule")) + object.backupSchedule = $root.google.spanner.admin.database.v1.BackupSchedule.toObject(message.backupSchedule, options); + return object; + }; + + /** + * Converts this CreateBackupScheduleRequest to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.CreateBackupScheduleRequest + * @instance + * @returns {Object.} JSON object + */ + CreateBackupScheduleRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateBackupScheduleRequest + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.CreateBackupScheduleRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateBackupScheduleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.CreateBackupScheduleRequest"; + }; + + return CreateBackupScheduleRequest; + })(); + + v1.GetBackupScheduleRequest = (function() { + + /** + * Properties of a GetBackupScheduleRequest. + * @memberof google.spanner.admin.database.v1 + * @interface IGetBackupScheduleRequest + * @property {string|null} [name] GetBackupScheduleRequest name + */ + + /** + * Constructs a new GetBackupScheduleRequest. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents a GetBackupScheduleRequest. + * @implements IGetBackupScheduleRequest + * @constructor + * @param {google.spanner.admin.database.v1.IGetBackupScheduleRequest=} [properties] Properties to set + */ + function GetBackupScheduleRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetBackupScheduleRequest name. + * @member {string} name + * @memberof google.spanner.admin.database.v1.GetBackupScheduleRequest + * @instance + */ + GetBackupScheduleRequest.prototype.name = ""; + + /** + * Creates a new GetBackupScheduleRequest instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.GetBackupScheduleRequest + * @static + * @param {google.spanner.admin.database.v1.IGetBackupScheduleRequest=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.GetBackupScheduleRequest} GetBackupScheduleRequest instance + */ + GetBackupScheduleRequest.create = function create(properties) { + return new GetBackupScheduleRequest(properties); + }; + + /** + * Encodes the specified GetBackupScheduleRequest message. Does not implicitly {@link google.spanner.admin.database.v1.GetBackupScheduleRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.GetBackupScheduleRequest + * @static + * @param {google.spanner.admin.database.v1.IGetBackupScheduleRequest} message GetBackupScheduleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBackupScheduleRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetBackupScheduleRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.GetBackupScheduleRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.GetBackupScheduleRequest + * @static + * @param {google.spanner.admin.database.v1.IGetBackupScheduleRequest} message GetBackupScheduleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBackupScheduleRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetBackupScheduleRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.GetBackupScheduleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.GetBackupScheduleRequest} GetBackupScheduleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBackupScheduleRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.GetBackupScheduleRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetBackupScheduleRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.GetBackupScheduleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.GetBackupScheduleRequest} GetBackupScheduleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBackupScheduleRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetBackupScheduleRequest message. + * @function verify + * @memberof google.spanner.admin.database.v1.GetBackupScheduleRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetBackupScheduleRequest.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 GetBackupScheduleRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.GetBackupScheduleRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.GetBackupScheduleRequest} GetBackupScheduleRequest + */ + GetBackupScheduleRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.GetBackupScheduleRequest) + return object; + var message = new $root.google.spanner.admin.database.v1.GetBackupScheduleRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetBackupScheduleRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.GetBackupScheduleRequest + * @static + * @param {google.spanner.admin.database.v1.GetBackupScheduleRequest} message GetBackupScheduleRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetBackupScheduleRequest.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 GetBackupScheduleRequest to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.GetBackupScheduleRequest + * @instance + * @returns {Object.} JSON object + */ + GetBackupScheduleRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetBackupScheduleRequest + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.GetBackupScheduleRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetBackupScheduleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.GetBackupScheduleRequest"; + }; + + return GetBackupScheduleRequest; + })(); + + v1.DeleteBackupScheduleRequest = (function() { + + /** + * Properties of a DeleteBackupScheduleRequest. + * @memberof google.spanner.admin.database.v1 + * @interface IDeleteBackupScheduleRequest + * @property {string|null} [name] DeleteBackupScheduleRequest name + */ + + /** + * Constructs a new DeleteBackupScheduleRequest. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents a DeleteBackupScheduleRequest. + * @implements IDeleteBackupScheduleRequest + * @constructor + * @param {google.spanner.admin.database.v1.IDeleteBackupScheduleRequest=} [properties] Properties to set + */ + function DeleteBackupScheduleRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteBackupScheduleRequest name. + * @member {string} name + * @memberof google.spanner.admin.database.v1.DeleteBackupScheduleRequest + * @instance + */ + DeleteBackupScheduleRequest.prototype.name = ""; + + /** + * Creates a new DeleteBackupScheduleRequest instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.DeleteBackupScheduleRequest + * @static + * @param {google.spanner.admin.database.v1.IDeleteBackupScheduleRequest=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.DeleteBackupScheduleRequest} DeleteBackupScheduleRequest instance + */ + DeleteBackupScheduleRequest.create = function create(properties) { + return new DeleteBackupScheduleRequest(properties); + }; + + /** + * Encodes the specified DeleteBackupScheduleRequest message. Does not implicitly {@link google.spanner.admin.database.v1.DeleteBackupScheduleRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.DeleteBackupScheduleRequest + * @static + * @param {google.spanner.admin.database.v1.IDeleteBackupScheduleRequest} message DeleteBackupScheduleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteBackupScheduleRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteBackupScheduleRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.DeleteBackupScheduleRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.DeleteBackupScheduleRequest + * @static + * @param {google.spanner.admin.database.v1.IDeleteBackupScheduleRequest} message DeleteBackupScheduleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteBackupScheduleRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteBackupScheduleRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.DeleteBackupScheduleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.DeleteBackupScheduleRequest} DeleteBackupScheduleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteBackupScheduleRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.DeleteBackupScheduleRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteBackupScheduleRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.DeleteBackupScheduleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.DeleteBackupScheduleRequest} DeleteBackupScheduleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteBackupScheduleRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteBackupScheduleRequest message. + * @function verify + * @memberof google.spanner.admin.database.v1.DeleteBackupScheduleRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteBackupScheduleRequest.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 DeleteBackupScheduleRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.DeleteBackupScheduleRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.DeleteBackupScheduleRequest} DeleteBackupScheduleRequest + */ + DeleteBackupScheduleRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.DeleteBackupScheduleRequest) + return object; + var message = new $root.google.spanner.admin.database.v1.DeleteBackupScheduleRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteBackupScheduleRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.DeleteBackupScheduleRequest + * @static + * @param {google.spanner.admin.database.v1.DeleteBackupScheduleRequest} message DeleteBackupScheduleRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteBackupScheduleRequest.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 DeleteBackupScheduleRequest to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.DeleteBackupScheduleRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteBackupScheduleRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteBackupScheduleRequest + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.DeleteBackupScheduleRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteBackupScheduleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.DeleteBackupScheduleRequest"; + }; + + return DeleteBackupScheduleRequest; + })(); + + v1.ListBackupSchedulesRequest = (function() { + + /** + * Properties of a ListBackupSchedulesRequest. + * @memberof google.spanner.admin.database.v1 + * @interface IListBackupSchedulesRequest + * @property {string|null} [parent] ListBackupSchedulesRequest parent + * @property {number|null} [pageSize] ListBackupSchedulesRequest pageSize + * @property {string|null} [pageToken] ListBackupSchedulesRequest pageToken + */ + + /** + * Constructs a new ListBackupSchedulesRequest. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents a ListBackupSchedulesRequest. + * @implements IListBackupSchedulesRequest + * @constructor + * @param {google.spanner.admin.database.v1.IListBackupSchedulesRequest=} [properties] Properties to set + */ + function ListBackupSchedulesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListBackupSchedulesRequest parent. + * @member {string} parent + * @memberof google.spanner.admin.database.v1.ListBackupSchedulesRequest + * @instance + */ + ListBackupSchedulesRequest.prototype.parent = ""; + + /** + * ListBackupSchedulesRequest pageSize. + * @member {number} pageSize + * @memberof google.spanner.admin.database.v1.ListBackupSchedulesRequest + * @instance + */ + ListBackupSchedulesRequest.prototype.pageSize = 0; + + /** + * ListBackupSchedulesRequest pageToken. + * @member {string} pageToken + * @memberof google.spanner.admin.database.v1.ListBackupSchedulesRequest + * @instance + */ + ListBackupSchedulesRequest.prototype.pageToken = ""; + + /** + * Creates a new ListBackupSchedulesRequest instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.ListBackupSchedulesRequest + * @static + * @param {google.spanner.admin.database.v1.IListBackupSchedulesRequest=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.ListBackupSchedulesRequest} ListBackupSchedulesRequest instance + */ + ListBackupSchedulesRequest.create = function create(properties) { + return new ListBackupSchedulesRequest(properties); + }; + + /** + * Encodes the specified ListBackupSchedulesRequest message. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupSchedulesRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.ListBackupSchedulesRequest + * @static + * @param {google.spanner.admin.database.v1.IListBackupSchedulesRequest} message ListBackupSchedulesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupSchedulesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListBackupSchedulesRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupSchedulesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.ListBackupSchedulesRequest + * @static + * @param {google.spanner.admin.database.v1.IListBackupSchedulesRequest} message ListBackupSchedulesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupSchedulesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListBackupSchedulesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.ListBackupSchedulesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.ListBackupSchedulesRequest} ListBackupSchedulesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupSchedulesRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.ListBackupSchedulesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListBackupSchedulesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.ListBackupSchedulesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.ListBackupSchedulesRequest} ListBackupSchedulesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupSchedulesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListBackupSchedulesRequest message. + * @function verify + * @memberof google.spanner.admin.database.v1.ListBackupSchedulesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListBackupSchedulesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListBackupSchedulesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.ListBackupSchedulesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.ListBackupSchedulesRequest} ListBackupSchedulesRequest + */ + ListBackupSchedulesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.ListBackupSchedulesRequest) + return object; + var message = new $root.google.spanner.admin.database.v1.ListBackupSchedulesRequest(); + 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 ListBackupSchedulesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.ListBackupSchedulesRequest + * @static + * @param {google.spanner.admin.database.v1.ListBackupSchedulesRequest} message ListBackupSchedulesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListBackupSchedulesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListBackupSchedulesRequest to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.ListBackupSchedulesRequest + * @instance + * @returns {Object.} JSON object + */ + ListBackupSchedulesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListBackupSchedulesRequest + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.ListBackupSchedulesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListBackupSchedulesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.ListBackupSchedulesRequest"; + }; + + return ListBackupSchedulesRequest; + })(); + + v1.ListBackupSchedulesResponse = (function() { + + /** + * Properties of a ListBackupSchedulesResponse. + * @memberof google.spanner.admin.database.v1 + * @interface IListBackupSchedulesResponse + * @property {Array.|null} [backupSchedules] ListBackupSchedulesResponse backupSchedules + * @property {string|null} [nextPageToken] ListBackupSchedulesResponse nextPageToken + */ + + /** + * Constructs a new ListBackupSchedulesResponse. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents a ListBackupSchedulesResponse. + * @implements IListBackupSchedulesResponse + * @constructor + * @param {google.spanner.admin.database.v1.IListBackupSchedulesResponse=} [properties] Properties to set + */ + function ListBackupSchedulesResponse(properties) { + this.backupSchedules = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListBackupSchedulesResponse backupSchedules. + * @member {Array.} backupSchedules + * @memberof google.spanner.admin.database.v1.ListBackupSchedulesResponse + * @instance + */ + ListBackupSchedulesResponse.prototype.backupSchedules = $util.emptyArray; + + /** + * ListBackupSchedulesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.spanner.admin.database.v1.ListBackupSchedulesResponse + * @instance + */ + ListBackupSchedulesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListBackupSchedulesResponse instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.ListBackupSchedulesResponse + * @static + * @param {google.spanner.admin.database.v1.IListBackupSchedulesResponse=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.ListBackupSchedulesResponse} ListBackupSchedulesResponse instance + */ + ListBackupSchedulesResponse.create = function create(properties) { + return new ListBackupSchedulesResponse(properties); + }; + + /** + * Encodes the specified ListBackupSchedulesResponse message. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupSchedulesResponse.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.ListBackupSchedulesResponse + * @static + * @param {google.spanner.admin.database.v1.IListBackupSchedulesResponse} message ListBackupSchedulesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupSchedulesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.backupSchedules != null && message.backupSchedules.length) + for (var i = 0; i < message.backupSchedules.length; ++i) + $root.google.spanner.admin.database.v1.BackupSchedule.encode(message.backupSchedules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListBackupSchedulesResponse message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupSchedulesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.ListBackupSchedulesResponse + * @static + * @param {google.spanner.admin.database.v1.IListBackupSchedulesResponse} message ListBackupSchedulesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupSchedulesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListBackupSchedulesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.ListBackupSchedulesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.ListBackupSchedulesResponse} ListBackupSchedulesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupSchedulesResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.ListBackupSchedulesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.backupSchedules && message.backupSchedules.length)) + message.backupSchedules = []; + message.backupSchedules.push($root.google.spanner.admin.database.v1.BackupSchedule.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListBackupSchedulesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.ListBackupSchedulesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.ListBackupSchedulesResponse} ListBackupSchedulesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupSchedulesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListBackupSchedulesResponse message. + * @function verify + * @memberof google.spanner.admin.database.v1.ListBackupSchedulesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListBackupSchedulesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.backupSchedules != null && message.hasOwnProperty("backupSchedules")) { + if (!Array.isArray(message.backupSchedules)) + return "backupSchedules: array expected"; + for (var i = 0; i < message.backupSchedules.length; ++i) { + var error = $root.google.spanner.admin.database.v1.BackupSchedule.verify(message.backupSchedules[i]); + if (error) + return "backupSchedules." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListBackupSchedulesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.ListBackupSchedulesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.ListBackupSchedulesResponse} ListBackupSchedulesResponse + */ + ListBackupSchedulesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.ListBackupSchedulesResponse) + return object; + var message = new $root.google.spanner.admin.database.v1.ListBackupSchedulesResponse(); + if (object.backupSchedules) { + if (!Array.isArray(object.backupSchedules)) + throw TypeError(".google.spanner.admin.database.v1.ListBackupSchedulesResponse.backupSchedules: array expected"); + message.backupSchedules = []; + for (var i = 0; i < object.backupSchedules.length; ++i) { + if (typeof object.backupSchedules[i] !== "object") + throw TypeError(".google.spanner.admin.database.v1.ListBackupSchedulesResponse.backupSchedules: object expected"); + message.backupSchedules[i] = $root.google.spanner.admin.database.v1.BackupSchedule.fromObject(object.backupSchedules[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListBackupSchedulesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.ListBackupSchedulesResponse + * @static + * @param {google.spanner.admin.database.v1.ListBackupSchedulesResponse} message ListBackupSchedulesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListBackupSchedulesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.backupSchedules = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.backupSchedules && message.backupSchedules.length) { + object.backupSchedules = []; + for (var j = 0; j < message.backupSchedules.length; ++j) + object.backupSchedules[j] = $root.google.spanner.admin.database.v1.BackupSchedule.toObject(message.backupSchedules[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListBackupSchedulesResponse to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.ListBackupSchedulesResponse + * @instance + * @returns {Object.} JSON object + */ + ListBackupSchedulesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListBackupSchedulesResponse + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.ListBackupSchedulesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListBackupSchedulesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.ListBackupSchedulesResponse"; + }; + + return ListBackupSchedulesResponse; + })(); + + v1.UpdateBackupScheduleRequest = (function() { + + /** + * Properties of an UpdateBackupScheduleRequest. + * @memberof google.spanner.admin.database.v1 + * @interface IUpdateBackupScheduleRequest + * @property {google.spanner.admin.database.v1.IBackupSchedule|null} [backupSchedule] UpdateBackupScheduleRequest backupSchedule + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateBackupScheduleRequest updateMask + */ + + /** + * Constructs a new UpdateBackupScheduleRequest. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents an UpdateBackupScheduleRequest. + * @implements IUpdateBackupScheduleRequest + * @constructor + * @param {google.spanner.admin.database.v1.IUpdateBackupScheduleRequest=} [properties] Properties to set + */ + function UpdateBackupScheduleRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateBackupScheduleRequest backupSchedule. + * @member {google.spanner.admin.database.v1.IBackupSchedule|null|undefined} backupSchedule + * @memberof google.spanner.admin.database.v1.UpdateBackupScheduleRequest + * @instance + */ + UpdateBackupScheduleRequest.prototype.backupSchedule = null; + + /** + * UpdateBackupScheduleRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.spanner.admin.database.v1.UpdateBackupScheduleRequest + * @instance + */ + UpdateBackupScheduleRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateBackupScheduleRequest instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.UpdateBackupScheduleRequest + * @static + * @param {google.spanner.admin.database.v1.IUpdateBackupScheduleRequest=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.UpdateBackupScheduleRequest} UpdateBackupScheduleRequest instance + */ + UpdateBackupScheduleRequest.create = function create(properties) { + return new UpdateBackupScheduleRequest(properties); + }; + + /** + * Encodes the specified UpdateBackupScheduleRequest message. Does not implicitly {@link google.spanner.admin.database.v1.UpdateBackupScheduleRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.UpdateBackupScheduleRequest + * @static + * @param {google.spanner.admin.database.v1.IUpdateBackupScheduleRequest} message UpdateBackupScheduleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateBackupScheduleRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.backupSchedule != null && Object.hasOwnProperty.call(message, "backupSchedule")) + $root.google.spanner.admin.database.v1.BackupSchedule.encode(message.backupSchedule, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateBackupScheduleRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.UpdateBackupScheduleRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.UpdateBackupScheduleRequest + * @static + * @param {google.spanner.admin.database.v1.IUpdateBackupScheduleRequest} message UpdateBackupScheduleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateBackupScheduleRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateBackupScheduleRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.UpdateBackupScheduleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.UpdateBackupScheduleRequest} UpdateBackupScheduleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateBackupScheduleRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.UpdateBackupScheduleRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.backupSchedule = $root.google.spanner.admin.database.v1.BackupSchedule.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateBackupScheduleRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.UpdateBackupScheduleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.UpdateBackupScheduleRequest} UpdateBackupScheduleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateBackupScheduleRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateBackupScheduleRequest message. + * @function verify + * @memberof google.spanner.admin.database.v1.UpdateBackupScheduleRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateBackupScheduleRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.backupSchedule != null && message.hasOwnProperty("backupSchedule")) { + var error = $root.google.spanner.admin.database.v1.BackupSchedule.verify(message.backupSchedule); + if (error) + return "backupSchedule." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateBackupScheduleRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.UpdateBackupScheduleRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.UpdateBackupScheduleRequest} UpdateBackupScheduleRequest + */ + UpdateBackupScheduleRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.UpdateBackupScheduleRequest) + return object; + var message = new $root.google.spanner.admin.database.v1.UpdateBackupScheduleRequest(); + if (object.backupSchedule != null) { + if (typeof object.backupSchedule !== "object") + throw TypeError(".google.spanner.admin.database.v1.UpdateBackupScheduleRequest.backupSchedule: object expected"); + message.backupSchedule = $root.google.spanner.admin.database.v1.BackupSchedule.fromObject(object.backupSchedule); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.spanner.admin.database.v1.UpdateBackupScheduleRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateBackupScheduleRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.UpdateBackupScheduleRequest + * @static + * @param {google.spanner.admin.database.v1.UpdateBackupScheduleRequest} message UpdateBackupScheduleRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateBackupScheduleRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.backupSchedule = null; + object.updateMask = null; + } + if (message.backupSchedule != null && message.hasOwnProperty("backupSchedule")) + object.backupSchedule = $root.google.spanner.admin.database.v1.BackupSchedule.toObject(message.backupSchedule, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateBackupScheduleRequest to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.UpdateBackupScheduleRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateBackupScheduleRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateBackupScheduleRequest + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.UpdateBackupScheduleRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateBackupScheduleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.UpdateBackupScheduleRequest"; + }; + + return UpdateBackupScheduleRequest; + })(); + + v1.DatabaseAdmin = (function() { + + /** + * Constructs a new DatabaseAdmin service. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents a DatabaseAdmin + * @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 DatabaseAdmin(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (DatabaseAdmin.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = DatabaseAdmin; + + /** + * Creates new DatabaseAdmin service using the specified rpc implementation. + * @function create + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @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 {DatabaseAdmin} RPC service. Useful where requests and/or responses are streamed. + */ + DatabaseAdmin.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|listDatabases}. + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @typedef ListDatabasesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.spanner.admin.database.v1.ListDatabasesResponse} [response] ListDatabasesResponse + */ + + /** + * Calls ListDatabases. + * @function listDatabases + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.IListDatabasesRequest} request ListDatabasesRequest message or plain object + * @param {google.spanner.admin.database.v1.DatabaseAdmin.ListDatabasesCallback} callback Node-style callback called with the error, if any, and ListDatabasesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DatabaseAdmin.prototype.listDatabases = function listDatabases(request, callback) { + return this.rpcCall(listDatabases, $root.google.spanner.admin.database.v1.ListDatabasesRequest, $root.google.spanner.admin.database.v1.ListDatabasesResponse, request, callback); + }, "name", { value: "ListDatabases" }); + + /** + * Calls ListDatabases. + * @function listDatabases + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.IListDatabasesRequest} request ListDatabasesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|createDatabase}. + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @typedef CreateDatabaseCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateDatabase. + * @function createDatabase + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.ICreateDatabaseRequest} request CreateDatabaseRequest message or plain object + * @param {google.spanner.admin.database.v1.DatabaseAdmin.CreateDatabaseCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DatabaseAdmin.prototype.createDatabase = function createDatabase(request, callback) { + return this.rpcCall(createDatabase, $root.google.spanner.admin.database.v1.CreateDatabaseRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateDatabase" }); + + /** + * Calls CreateDatabase. + * @function createDatabase + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.ICreateDatabaseRequest} request CreateDatabaseRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|getDatabase}. + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @typedef GetDatabaseCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.spanner.admin.database.v1.Database} [response] Database + */ + + /** + * Calls GetDatabase. + * @function getDatabase + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.IGetDatabaseRequest} request GetDatabaseRequest message or plain object + * @param {google.spanner.admin.database.v1.DatabaseAdmin.GetDatabaseCallback} callback Node-style callback called with the error, if any, and Database + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DatabaseAdmin.prototype.getDatabase = function getDatabase(request, callback) { + return this.rpcCall(getDatabase, $root.google.spanner.admin.database.v1.GetDatabaseRequest, $root.google.spanner.admin.database.v1.Database, request, callback); + }, "name", { value: "GetDatabase" }); + + /** + * Calls GetDatabase. + * @function getDatabase + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.IGetDatabaseRequest} request GetDatabaseRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|updateDatabase}. + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @typedef UpdateDatabaseCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateDatabase. + * @function updateDatabase + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.IUpdateDatabaseRequest} request UpdateDatabaseRequest message or plain object + * @param {google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DatabaseAdmin.prototype.updateDatabase = function updateDatabase(request, callback) { + return this.rpcCall(updateDatabase, $root.google.spanner.admin.database.v1.UpdateDatabaseRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateDatabase" }); + + /** + * Calls UpdateDatabase. + * @function updateDatabase + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.IUpdateDatabaseRequest} request UpdateDatabaseRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|updateDatabaseDdl}. + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @typedef UpdateDatabaseDdlCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateDatabaseDdl. + * @function updateDatabaseDdl + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.IUpdateDatabaseDdlRequest} request UpdateDatabaseDdlRequest message or plain object + * @param {google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdlCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DatabaseAdmin.prototype.updateDatabaseDdl = function updateDatabaseDdl(request, callback) { + return this.rpcCall(updateDatabaseDdl, $root.google.spanner.admin.database.v1.UpdateDatabaseDdlRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateDatabaseDdl" }); + + /** + * Calls UpdateDatabaseDdl. + * @function updateDatabaseDdl + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.IUpdateDatabaseDdlRequest} request UpdateDatabaseDdlRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|dropDatabase}. + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @typedef DropDatabaseCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DropDatabase. + * @function dropDatabase + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.IDropDatabaseRequest} request DropDatabaseRequest message or plain object + * @param {google.spanner.admin.database.v1.DatabaseAdmin.DropDatabaseCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DatabaseAdmin.prototype.dropDatabase = function dropDatabase(request, callback) { + return this.rpcCall(dropDatabase, $root.google.spanner.admin.database.v1.DropDatabaseRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DropDatabase" }); + + /** + * Calls DropDatabase. + * @function dropDatabase + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.IDropDatabaseRequest} request DropDatabaseRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|getDatabaseDdl}. + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @typedef GetDatabaseDdlCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.spanner.admin.database.v1.GetDatabaseDdlResponse} [response] GetDatabaseDdlResponse + */ + + /** + * Calls GetDatabaseDdl. + * @function getDatabaseDdl + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.IGetDatabaseDdlRequest} request GetDatabaseDdlRequest message or plain object + * @param {google.spanner.admin.database.v1.DatabaseAdmin.GetDatabaseDdlCallback} callback Node-style callback called with the error, if any, and GetDatabaseDdlResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DatabaseAdmin.prototype.getDatabaseDdl = function getDatabaseDdl(request, callback) { + return this.rpcCall(getDatabaseDdl, $root.google.spanner.admin.database.v1.GetDatabaseDdlRequest, $root.google.spanner.admin.database.v1.GetDatabaseDdlResponse, request, callback); + }, "name", { value: "GetDatabaseDdl" }); + + /** + * Calls GetDatabaseDdl. + * @function getDatabaseDdl + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.IGetDatabaseDdlRequest} request GetDatabaseDdlRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|setIamPolicy}. + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @typedef SetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @param {google.spanner.admin.database.v1.DatabaseAdmin.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DatabaseAdmin.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.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|getIamPolicy}. + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @typedef GetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @param {google.spanner.admin.database.v1.DatabaseAdmin.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DatabaseAdmin.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.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|testIamPermissions}. + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @typedef TestIamPermissionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.TestIamPermissionsResponse} [response] TestIamPermissionsResponse + */ + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @param {google.spanner.admin.database.v1.DatabaseAdmin.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DatabaseAdmin.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.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|createBackup}. + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @typedef CreateBackupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateBackup. + * @function createBackup + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.ICreateBackupRequest} request CreateBackupRequest message or plain object + * @param {google.spanner.admin.database.v1.DatabaseAdmin.CreateBackupCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DatabaseAdmin.prototype.createBackup = function createBackup(request, callback) { + return this.rpcCall(createBackup, $root.google.spanner.admin.database.v1.CreateBackupRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateBackup" }); + + /** + * Calls CreateBackup. + * @function createBackup + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.ICreateBackupRequest} request CreateBackupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|copyBackup}. + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @typedef CopyBackupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CopyBackup. + * @function copyBackup + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.ICopyBackupRequest} request CopyBackupRequest message or plain object + * @param {google.spanner.admin.database.v1.DatabaseAdmin.CopyBackupCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DatabaseAdmin.prototype.copyBackup = function copyBackup(request, callback) { + return this.rpcCall(copyBackup, $root.google.spanner.admin.database.v1.CopyBackupRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CopyBackup" }); + + /** + * Calls CopyBackup. + * @function copyBackup + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.ICopyBackupRequest} request CopyBackupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|getBackup}. + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @typedef GetBackupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.spanner.admin.database.v1.Backup} [response] Backup + */ + + /** + * Calls GetBackup. + * @function getBackup + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.IGetBackupRequest} request GetBackupRequest message or plain object + * @param {google.spanner.admin.database.v1.DatabaseAdmin.GetBackupCallback} callback Node-style callback called with the error, if any, and Backup + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DatabaseAdmin.prototype.getBackup = function getBackup(request, callback) { + return this.rpcCall(getBackup, $root.google.spanner.admin.database.v1.GetBackupRequest, $root.google.spanner.admin.database.v1.Backup, request, callback); + }, "name", { value: "GetBackup" }); + + /** + * Calls GetBackup. + * @function getBackup + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.IGetBackupRequest} request GetBackupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|updateBackup}. + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @typedef UpdateBackupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.spanner.admin.database.v1.Backup} [response] Backup + */ + + /** + * Calls UpdateBackup. + * @function updateBackup + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.IUpdateBackupRequest} request UpdateBackupRequest message or plain object + * @param {google.spanner.admin.database.v1.DatabaseAdmin.UpdateBackupCallback} callback Node-style callback called with the error, if any, and Backup + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DatabaseAdmin.prototype.updateBackup = function updateBackup(request, callback) { + return this.rpcCall(updateBackup, $root.google.spanner.admin.database.v1.UpdateBackupRequest, $root.google.spanner.admin.database.v1.Backup, request, callback); + }, "name", { value: "UpdateBackup" }); + + /** + * Calls UpdateBackup. + * @function updateBackup + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.IUpdateBackupRequest} request UpdateBackupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|deleteBackup}. + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @typedef DeleteBackupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteBackup. + * @function deleteBackup + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.IDeleteBackupRequest} request DeleteBackupRequest message or plain object + * @param {google.spanner.admin.database.v1.DatabaseAdmin.DeleteBackupCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DatabaseAdmin.prototype.deleteBackup = function deleteBackup(request, callback) { + return this.rpcCall(deleteBackup, $root.google.spanner.admin.database.v1.DeleteBackupRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteBackup" }); + + /** + * Calls DeleteBackup. + * @function deleteBackup + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.IDeleteBackupRequest} request DeleteBackupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|listBackups}. + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @typedef ListBackupsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.spanner.admin.database.v1.ListBackupsResponse} [response] ListBackupsResponse + */ + + /** + * Calls ListBackups. + * @function listBackups + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.IListBackupsRequest} request ListBackupsRequest message or plain object + * @param {google.spanner.admin.database.v1.DatabaseAdmin.ListBackupsCallback} callback Node-style callback called with the error, if any, and ListBackupsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DatabaseAdmin.prototype.listBackups = function listBackups(request, callback) { + return this.rpcCall(listBackups, $root.google.spanner.admin.database.v1.ListBackupsRequest, $root.google.spanner.admin.database.v1.ListBackupsResponse, request, callback); + }, "name", { value: "ListBackups" }); + + /** + * Calls ListBackups. + * @function listBackups + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.IListBackupsRequest} request ListBackupsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|restoreDatabase}. + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @typedef RestoreDatabaseCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls RestoreDatabase. + * @function restoreDatabase + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.IRestoreDatabaseRequest} request RestoreDatabaseRequest message or plain object + * @param {google.spanner.admin.database.v1.DatabaseAdmin.RestoreDatabaseCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DatabaseAdmin.prototype.restoreDatabase = function restoreDatabase(request, callback) { + return this.rpcCall(restoreDatabase, $root.google.spanner.admin.database.v1.RestoreDatabaseRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "RestoreDatabase" }); + + /** + * Calls RestoreDatabase. + * @function restoreDatabase + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.IRestoreDatabaseRequest} request RestoreDatabaseRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|listDatabaseOperations}. + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @typedef ListDatabaseOperationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.spanner.admin.database.v1.ListDatabaseOperationsResponse} [response] ListDatabaseOperationsResponse + */ + + /** + * Calls ListDatabaseOperations. + * @function listDatabaseOperations + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.IListDatabaseOperationsRequest} request ListDatabaseOperationsRequest message or plain object + * @param {google.spanner.admin.database.v1.DatabaseAdmin.ListDatabaseOperationsCallback} callback Node-style callback called with the error, if any, and ListDatabaseOperationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DatabaseAdmin.prototype.listDatabaseOperations = function listDatabaseOperations(request, callback) { + return this.rpcCall(listDatabaseOperations, $root.google.spanner.admin.database.v1.ListDatabaseOperationsRequest, $root.google.spanner.admin.database.v1.ListDatabaseOperationsResponse, request, callback); + }, "name", { value: "ListDatabaseOperations" }); + + /** + * Calls ListDatabaseOperations. + * @function listDatabaseOperations + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.IListDatabaseOperationsRequest} request ListDatabaseOperationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|listBackupOperations}. + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @typedef ListBackupOperationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.spanner.admin.database.v1.ListBackupOperationsResponse} [response] ListBackupOperationsResponse + */ + + /** + * Calls ListBackupOperations. + * @function listBackupOperations + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.IListBackupOperationsRequest} request ListBackupOperationsRequest message or plain object + * @param {google.spanner.admin.database.v1.DatabaseAdmin.ListBackupOperationsCallback} callback Node-style callback called with the error, if any, and ListBackupOperationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DatabaseAdmin.prototype.listBackupOperations = function listBackupOperations(request, callback) { + return this.rpcCall(listBackupOperations, $root.google.spanner.admin.database.v1.ListBackupOperationsRequest, $root.google.spanner.admin.database.v1.ListBackupOperationsResponse, request, callback); + }, "name", { value: "ListBackupOperations" }); + + /** + * Calls ListBackupOperations. + * @function listBackupOperations + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.IListBackupOperationsRequest} request ListBackupOperationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|listDatabaseRoles}. + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @typedef ListDatabaseRolesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.spanner.admin.database.v1.ListDatabaseRolesResponse} [response] ListDatabaseRolesResponse + */ + + /** + * Calls ListDatabaseRoles. + * @function listDatabaseRoles + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.IListDatabaseRolesRequest} request ListDatabaseRolesRequest message or plain object + * @param {google.spanner.admin.database.v1.DatabaseAdmin.ListDatabaseRolesCallback} callback Node-style callback called with the error, if any, and ListDatabaseRolesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DatabaseAdmin.prototype.listDatabaseRoles = function listDatabaseRoles(request, callback) { + return this.rpcCall(listDatabaseRoles, $root.google.spanner.admin.database.v1.ListDatabaseRolesRequest, $root.google.spanner.admin.database.v1.ListDatabaseRolesResponse, request, callback); + }, "name", { value: "ListDatabaseRoles" }); + + /** + * Calls ListDatabaseRoles. + * @function listDatabaseRoles + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.IListDatabaseRolesRequest} request ListDatabaseRolesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|addSplitPoints}. + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @typedef AddSplitPointsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.spanner.admin.database.v1.AddSplitPointsResponse} [response] AddSplitPointsResponse + */ + + /** + * Calls AddSplitPoints. + * @function addSplitPoints + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.IAddSplitPointsRequest} request AddSplitPointsRequest message or plain object + * @param {google.spanner.admin.database.v1.DatabaseAdmin.AddSplitPointsCallback} callback Node-style callback called with the error, if any, and AddSplitPointsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DatabaseAdmin.prototype.addSplitPoints = function addSplitPoints(request, callback) { + return this.rpcCall(addSplitPoints, $root.google.spanner.admin.database.v1.AddSplitPointsRequest, $root.google.spanner.admin.database.v1.AddSplitPointsResponse, request, callback); + }, "name", { value: "AddSplitPoints" }); + + /** + * Calls AddSplitPoints. + * @function addSplitPoints + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.IAddSplitPointsRequest} request AddSplitPointsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|createBackupSchedule}. + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @typedef CreateBackupScheduleCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.spanner.admin.database.v1.BackupSchedule} [response] BackupSchedule + */ + + /** + * Calls CreateBackupSchedule. + * @function createBackupSchedule + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.ICreateBackupScheduleRequest} request CreateBackupScheduleRequest message or plain object + * @param {google.spanner.admin.database.v1.DatabaseAdmin.CreateBackupScheduleCallback} callback Node-style callback called with the error, if any, and BackupSchedule + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DatabaseAdmin.prototype.createBackupSchedule = function createBackupSchedule(request, callback) { + return this.rpcCall(createBackupSchedule, $root.google.spanner.admin.database.v1.CreateBackupScheduleRequest, $root.google.spanner.admin.database.v1.BackupSchedule, request, callback); + }, "name", { value: "CreateBackupSchedule" }); + + /** + * Calls CreateBackupSchedule. + * @function createBackupSchedule + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.ICreateBackupScheduleRequest} request CreateBackupScheduleRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|getBackupSchedule}. + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @typedef GetBackupScheduleCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.spanner.admin.database.v1.BackupSchedule} [response] BackupSchedule + */ + + /** + * Calls GetBackupSchedule. + * @function getBackupSchedule + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.IGetBackupScheduleRequest} request GetBackupScheduleRequest message or plain object + * @param {google.spanner.admin.database.v1.DatabaseAdmin.GetBackupScheduleCallback} callback Node-style callback called with the error, if any, and BackupSchedule + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DatabaseAdmin.prototype.getBackupSchedule = function getBackupSchedule(request, callback) { + return this.rpcCall(getBackupSchedule, $root.google.spanner.admin.database.v1.GetBackupScheduleRequest, $root.google.spanner.admin.database.v1.BackupSchedule, request, callback); + }, "name", { value: "GetBackupSchedule" }); + + /** + * Calls GetBackupSchedule. + * @function getBackupSchedule + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.IGetBackupScheduleRequest} request GetBackupScheduleRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|updateBackupSchedule}. + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @typedef UpdateBackupScheduleCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.spanner.admin.database.v1.BackupSchedule} [response] BackupSchedule + */ + + /** + * Calls UpdateBackupSchedule. + * @function updateBackupSchedule + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.IUpdateBackupScheduleRequest} request UpdateBackupScheduleRequest message or plain object + * @param {google.spanner.admin.database.v1.DatabaseAdmin.UpdateBackupScheduleCallback} callback Node-style callback called with the error, if any, and BackupSchedule + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DatabaseAdmin.prototype.updateBackupSchedule = function updateBackupSchedule(request, callback) { + return this.rpcCall(updateBackupSchedule, $root.google.spanner.admin.database.v1.UpdateBackupScheduleRequest, $root.google.spanner.admin.database.v1.BackupSchedule, request, callback); + }, "name", { value: "UpdateBackupSchedule" }); + + /** + * Calls UpdateBackupSchedule. + * @function updateBackupSchedule + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.IUpdateBackupScheduleRequest} request UpdateBackupScheduleRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|deleteBackupSchedule}. + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @typedef DeleteBackupScheduleCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteBackupSchedule. + * @function deleteBackupSchedule + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.IDeleteBackupScheduleRequest} request DeleteBackupScheduleRequest message or plain object + * @param {google.spanner.admin.database.v1.DatabaseAdmin.DeleteBackupScheduleCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DatabaseAdmin.prototype.deleteBackupSchedule = function deleteBackupSchedule(request, callback) { + return this.rpcCall(deleteBackupSchedule, $root.google.spanner.admin.database.v1.DeleteBackupScheduleRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteBackupSchedule" }); + + /** + * Calls DeleteBackupSchedule. + * @function deleteBackupSchedule + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.IDeleteBackupScheduleRequest} request DeleteBackupScheduleRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|listBackupSchedules}. + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @typedef ListBackupSchedulesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.spanner.admin.database.v1.ListBackupSchedulesResponse} [response] ListBackupSchedulesResponse + */ + + /** + * Calls ListBackupSchedules. + * @function listBackupSchedules + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.IListBackupSchedulesRequest} request ListBackupSchedulesRequest message or plain object + * @param {google.spanner.admin.database.v1.DatabaseAdmin.ListBackupSchedulesCallback} callback Node-style callback called with the error, if any, and ListBackupSchedulesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DatabaseAdmin.prototype.listBackupSchedules = function listBackupSchedules(request, callback) { + return this.rpcCall(listBackupSchedules, $root.google.spanner.admin.database.v1.ListBackupSchedulesRequest, $root.google.spanner.admin.database.v1.ListBackupSchedulesResponse, request, callback); + }, "name", { value: "ListBackupSchedules" }); + + /** + * Calls ListBackupSchedules. + * @function listBackupSchedules + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.IListBackupSchedulesRequest} request ListBackupSchedulesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|internalUpdateGraphOperation}. + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @typedef InternalUpdateGraphOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse} [response] InternalUpdateGraphOperationResponse + */ + + /** + * Calls InternalUpdateGraphOperation. + * @function internalUpdateGraphOperation + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.IInternalUpdateGraphOperationRequest} request InternalUpdateGraphOperationRequest message or plain object + * @param {google.spanner.admin.database.v1.DatabaseAdmin.InternalUpdateGraphOperationCallback} callback Node-style callback called with the error, if any, and InternalUpdateGraphOperationResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DatabaseAdmin.prototype.internalUpdateGraphOperation = function internalUpdateGraphOperation(request, callback) { + return this.rpcCall(internalUpdateGraphOperation, $root.google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest, $root.google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse, request, callback); + }, "name", { value: "InternalUpdateGraphOperation" }); + + /** + * Calls InternalUpdateGraphOperation. + * @function internalUpdateGraphOperation + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.IInternalUpdateGraphOperationRequest} request InternalUpdateGraphOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return DatabaseAdmin; + })(); + + v1.RestoreInfo = (function() { + + /** + * Properties of a RestoreInfo. + * @memberof google.spanner.admin.database.v1 + * @interface IRestoreInfo + * @property {google.spanner.admin.database.v1.RestoreSourceType|null} [sourceType] RestoreInfo sourceType + * @property {google.spanner.admin.database.v1.IBackupInfo|null} [backupInfo] RestoreInfo backupInfo + */ + + /** + * Constructs a new RestoreInfo. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents a RestoreInfo. + * @implements IRestoreInfo + * @constructor + * @param {google.spanner.admin.database.v1.IRestoreInfo=} [properties] Properties to set + */ + function RestoreInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RestoreInfo sourceType. + * @member {google.spanner.admin.database.v1.RestoreSourceType} sourceType + * @memberof google.spanner.admin.database.v1.RestoreInfo + * @instance + */ + RestoreInfo.prototype.sourceType = 0; + + /** + * RestoreInfo backupInfo. + * @member {google.spanner.admin.database.v1.IBackupInfo|null|undefined} backupInfo + * @memberof google.spanner.admin.database.v1.RestoreInfo + * @instance + */ + RestoreInfo.prototype.backupInfo = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RestoreInfo sourceInfo. + * @member {"backupInfo"|undefined} sourceInfo + * @memberof google.spanner.admin.database.v1.RestoreInfo + * @instance + */ + Object.defineProperty(RestoreInfo.prototype, "sourceInfo", { + get: $util.oneOfGetter($oneOfFields = ["backupInfo"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RestoreInfo instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.RestoreInfo + * @static + * @param {google.spanner.admin.database.v1.IRestoreInfo=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.RestoreInfo} RestoreInfo instance + */ + RestoreInfo.create = function create(properties) { + return new RestoreInfo(properties); + }; + + /** + * Encodes the specified RestoreInfo message. Does not implicitly {@link google.spanner.admin.database.v1.RestoreInfo.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.RestoreInfo + * @static + * @param {google.spanner.admin.database.v1.IRestoreInfo} message RestoreInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sourceType != null && Object.hasOwnProperty.call(message, "sourceType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.sourceType); + if (message.backupInfo != null && Object.hasOwnProperty.call(message, "backupInfo")) + $root.google.spanner.admin.database.v1.BackupInfo.encode(message.backupInfo, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RestoreInfo message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.RestoreInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.RestoreInfo + * @static + * @param {google.spanner.admin.database.v1.IRestoreInfo} message RestoreInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RestoreInfo message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.RestoreInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.RestoreInfo} RestoreInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.RestoreInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.sourceType = reader.int32(); + break; + } + case 2: { + message.backupInfo = $root.google.spanner.admin.database.v1.BackupInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RestoreInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.RestoreInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.RestoreInfo} RestoreInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RestoreInfo message. + * @function verify + * @memberof google.spanner.admin.database.v1.RestoreInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RestoreInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.sourceType != null && message.hasOwnProperty("sourceType")) + switch (message.sourceType) { + default: + return "sourceType: enum value expected"; + case 0: + case 1: + break; + } + if (message.backupInfo != null && message.hasOwnProperty("backupInfo")) { + properties.sourceInfo = 1; + { + var error = $root.google.spanner.admin.database.v1.BackupInfo.verify(message.backupInfo); + if (error) + return "backupInfo." + error; + } + } + return null; + }; + + /** + * Creates a RestoreInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.RestoreInfo + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.RestoreInfo} RestoreInfo + */ + RestoreInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.RestoreInfo) + return object; + var message = new $root.google.spanner.admin.database.v1.RestoreInfo(); + switch (object.sourceType) { + default: + if (typeof object.sourceType === "number") { + message.sourceType = object.sourceType; + break; + } + break; + case "TYPE_UNSPECIFIED": + case 0: + message.sourceType = 0; + break; + case "BACKUP": + case 1: + message.sourceType = 1; + break; + } + if (object.backupInfo != null) { + if (typeof object.backupInfo !== "object") + throw TypeError(".google.spanner.admin.database.v1.RestoreInfo.backupInfo: object expected"); + message.backupInfo = $root.google.spanner.admin.database.v1.BackupInfo.fromObject(object.backupInfo); + } + return message; + }; + + /** + * Creates a plain object from a RestoreInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.RestoreInfo + * @static + * @param {google.spanner.admin.database.v1.RestoreInfo} message RestoreInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RestoreInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.sourceType = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + if (message.sourceType != null && message.hasOwnProperty("sourceType")) + object.sourceType = options.enums === String ? $root.google.spanner.admin.database.v1.RestoreSourceType[message.sourceType] === undefined ? message.sourceType : $root.google.spanner.admin.database.v1.RestoreSourceType[message.sourceType] : message.sourceType; + if (message.backupInfo != null && message.hasOwnProperty("backupInfo")) { + object.backupInfo = $root.google.spanner.admin.database.v1.BackupInfo.toObject(message.backupInfo, options); + if (options.oneofs) + object.sourceInfo = "backupInfo"; + } + return object; + }; + + /** + * Converts this RestoreInfo to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.RestoreInfo + * @instance + * @returns {Object.} JSON object + */ + RestoreInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RestoreInfo + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.RestoreInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RestoreInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.RestoreInfo"; + }; + + return RestoreInfo; + })(); + + v1.Database = (function() { + + /** + * Properties of a Database. + * @memberof google.spanner.admin.database.v1 + * @interface IDatabase + * @property {string|null} [name] Database name + * @property {google.spanner.admin.database.v1.Database.State|null} [state] Database state + * @property {google.protobuf.ITimestamp|null} [createTime] Database createTime + * @property {google.spanner.admin.database.v1.IRestoreInfo|null} [restoreInfo] Database restoreInfo + * @property {google.spanner.admin.database.v1.IEncryptionConfig|null} [encryptionConfig] Database encryptionConfig + * @property {Array.|null} [encryptionInfo] Database encryptionInfo + * @property {string|null} [versionRetentionPeriod] Database versionRetentionPeriod + * @property {google.protobuf.ITimestamp|null} [earliestVersionTime] Database earliestVersionTime + * @property {string|null} [defaultLeader] Database defaultLeader + * @property {google.spanner.admin.database.v1.DatabaseDialect|null} [databaseDialect] Database databaseDialect + * @property {boolean|null} [enableDropProtection] Database enableDropProtection + * @property {boolean|null} [reconciling] Database reconciling + */ + + /** + * Constructs a new Database. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents a Database. + * @implements IDatabase + * @constructor + * @param {google.spanner.admin.database.v1.IDatabase=} [properties] Properties to set + */ + function Database(properties) { + this.encryptionInfo = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Database name. + * @member {string} name + * @memberof google.spanner.admin.database.v1.Database + * @instance + */ + Database.prototype.name = ""; + + /** + * Database state. + * @member {google.spanner.admin.database.v1.Database.State} state + * @memberof google.spanner.admin.database.v1.Database + * @instance + */ + Database.prototype.state = 0; + + /** + * Database createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.spanner.admin.database.v1.Database + * @instance + */ + Database.prototype.createTime = null; + + /** + * Database restoreInfo. + * @member {google.spanner.admin.database.v1.IRestoreInfo|null|undefined} restoreInfo + * @memberof google.spanner.admin.database.v1.Database + * @instance + */ + Database.prototype.restoreInfo = null; + + /** + * Database encryptionConfig. + * @member {google.spanner.admin.database.v1.IEncryptionConfig|null|undefined} encryptionConfig + * @memberof google.spanner.admin.database.v1.Database + * @instance + */ + Database.prototype.encryptionConfig = null; + + /** + * Database encryptionInfo. + * @member {Array.} encryptionInfo + * @memberof google.spanner.admin.database.v1.Database + * @instance + */ + Database.prototype.encryptionInfo = $util.emptyArray; + + /** + * Database versionRetentionPeriod. + * @member {string} versionRetentionPeriod + * @memberof google.spanner.admin.database.v1.Database + * @instance + */ + Database.prototype.versionRetentionPeriod = ""; + + /** + * Database earliestVersionTime. + * @member {google.protobuf.ITimestamp|null|undefined} earliestVersionTime + * @memberof google.spanner.admin.database.v1.Database + * @instance + */ + Database.prototype.earliestVersionTime = null; + + /** + * Database defaultLeader. + * @member {string} defaultLeader + * @memberof google.spanner.admin.database.v1.Database + * @instance + */ + Database.prototype.defaultLeader = ""; + + /** + * Database databaseDialect. + * @member {google.spanner.admin.database.v1.DatabaseDialect} databaseDialect + * @memberof google.spanner.admin.database.v1.Database + * @instance + */ + Database.prototype.databaseDialect = 0; + + /** + * Database enableDropProtection. + * @member {boolean} enableDropProtection + * @memberof google.spanner.admin.database.v1.Database + * @instance + */ + Database.prototype.enableDropProtection = false; + + /** + * Database reconciling. + * @member {boolean} reconciling + * @memberof google.spanner.admin.database.v1.Database + * @instance + */ + Database.prototype.reconciling = false; + + /** + * Creates a new Database instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.Database + * @static + * @param {google.spanner.admin.database.v1.IDatabase=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.Database} Database instance + */ + Database.create = function create(properties) { + return new Database(properties); + }; + + /** + * Encodes the specified Database message. Does not implicitly {@link google.spanner.admin.database.v1.Database.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.Database + * @static + * @param {google.spanner.admin.database.v1.IDatabase} message Database message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Database.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.restoreInfo != null && Object.hasOwnProperty.call(message, "restoreInfo")) + $root.google.spanner.admin.database.v1.RestoreInfo.encode(message.restoreInfo, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) + $root.google.spanner.admin.database.v1.EncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.versionRetentionPeriod != null && Object.hasOwnProperty.call(message, "versionRetentionPeriod")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.versionRetentionPeriod); + if (message.earliestVersionTime != null && Object.hasOwnProperty.call(message, "earliestVersionTime")) + $root.google.protobuf.Timestamp.encode(message.earliestVersionTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.encryptionInfo != null && message.encryptionInfo.length) + for (var i = 0; i < message.encryptionInfo.length; ++i) + $root.google.spanner.admin.database.v1.EncryptionInfo.encode(message.encryptionInfo[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.defaultLeader != null && Object.hasOwnProperty.call(message, "defaultLeader")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.defaultLeader); + if (message.databaseDialect != null && Object.hasOwnProperty.call(message, "databaseDialect")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.databaseDialect); + if (message.enableDropProtection != null && Object.hasOwnProperty.call(message, "enableDropProtection")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.enableDropProtection); + if (message.reconciling != null && Object.hasOwnProperty.call(message, "reconciling")) + writer.uint32(/* id 12, wireType 0 =*/96).bool(message.reconciling); + return writer; + }; + + /** + * Encodes the specified Database message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.Database.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.Database + * @static + * @param {google.spanner.admin.database.v1.IDatabase} message Database message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Database.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Database message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.Database + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.Database} Database + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Database.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.Database(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.state = reader.int32(); + break; + } + case 3: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.restoreInfo = $root.google.spanner.admin.database.v1.RestoreInfo.decode(reader, reader.uint32()); + break; + } + case 5: { + message.encryptionConfig = $root.google.spanner.admin.database.v1.EncryptionConfig.decode(reader, reader.uint32()); + break; + } + case 8: { + if (!(message.encryptionInfo && message.encryptionInfo.length)) + message.encryptionInfo = []; + message.encryptionInfo.push($root.google.spanner.admin.database.v1.EncryptionInfo.decode(reader, reader.uint32())); + break; + } + case 6: { + message.versionRetentionPeriod = reader.string(); + break; + } + case 7: { + message.earliestVersionTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 9: { + message.defaultLeader = reader.string(); + break; + } + case 10: { + message.databaseDialect = reader.int32(); + break; + } + case 11: { + message.enableDropProtection = reader.bool(); + break; + } + case 12: { + message.reconciling = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Database message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.Database + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.Database} Database + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Database.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Database message. + * @function verify + * @memberof google.spanner.admin.database.v1.Database + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Database.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.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.restoreInfo != null && message.hasOwnProperty("restoreInfo")) { + var error = $root.google.spanner.admin.database.v1.RestoreInfo.verify(message.restoreInfo); + if (error) + return "restoreInfo." + error; + } + if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { + var error = $root.google.spanner.admin.database.v1.EncryptionConfig.verify(message.encryptionConfig); + if (error) + return "encryptionConfig." + error; + } + if (message.encryptionInfo != null && message.hasOwnProperty("encryptionInfo")) { + if (!Array.isArray(message.encryptionInfo)) + return "encryptionInfo: array expected"; + for (var i = 0; i < message.encryptionInfo.length; ++i) { + var error = $root.google.spanner.admin.database.v1.EncryptionInfo.verify(message.encryptionInfo[i]); + if (error) + return "encryptionInfo." + error; + } + } + if (message.versionRetentionPeriod != null && message.hasOwnProperty("versionRetentionPeriod")) + if (!$util.isString(message.versionRetentionPeriod)) + return "versionRetentionPeriod: string expected"; + if (message.earliestVersionTime != null && message.hasOwnProperty("earliestVersionTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.earliestVersionTime); + if (error) + return "earliestVersionTime." + error; + } + if (message.defaultLeader != null && message.hasOwnProperty("defaultLeader")) + if (!$util.isString(message.defaultLeader)) + return "defaultLeader: string expected"; + if (message.databaseDialect != null && message.hasOwnProperty("databaseDialect")) + switch (message.databaseDialect) { + default: + return "databaseDialect: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.enableDropProtection != null && message.hasOwnProperty("enableDropProtection")) + if (typeof message.enableDropProtection !== "boolean") + return "enableDropProtection: boolean expected"; + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + if (typeof message.reconciling !== "boolean") + return "reconciling: boolean expected"; + return null; + }; + + /** + * Creates a Database message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.Database + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.Database} Database + */ + Database.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.Database) + return object; + var message = new $root.google.spanner.admin.database.v1.Database(); + if (object.name != null) + message.name = String(object.name); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "CREATING": + case 1: + message.state = 1; + break; + case "READY": + case 2: + message.state = 2; + break; + case "READY_OPTIMIZING": + case 3: + message.state = 3; + break; + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.spanner.admin.database.v1.Database.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.restoreInfo != null) { + if (typeof object.restoreInfo !== "object") + throw TypeError(".google.spanner.admin.database.v1.Database.restoreInfo: object expected"); + message.restoreInfo = $root.google.spanner.admin.database.v1.RestoreInfo.fromObject(object.restoreInfo); + } + if (object.encryptionConfig != null) { + if (typeof object.encryptionConfig !== "object") + throw TypeError(".google.spanner.admin.database.v1.Database.encryptionConfig: object expected"); + message.encryptionConfig = $root.google.spanner.admin.database.v1.EncryptionConfig.fromObject(object.encryptionConfig); + } + if (object.encryptionInfo) { + if (!Array.isArray(object.encryptionInfo)) + throw TypeError(".google.spanner.admin.database.v1.Database.encryptionInfo: array expected"); + message.encryptionInfo = []; + for (var i = 0; i < object.encryptionInfo.length; ++i) { + if (typeof object.encryptionInfo[i] !== "object") + throw TypeError(".google.spanner.admin.database.v1.Database.encryptionInfo: object expected"); + message.encryptionInfo[i] = $root.google.spanner.admin.database.v1.EncryptionInfo.fromObject(object.encryptionInfo[i]); + } + } + if (object.versionRetentionPeriod != null) + message.versionRetentionPeriod = String(object.versionRetentionPeriod); + if (object.earliestVersionTime != null) { + if (typeof object.earliestVersionTime !== "object") + throw TypeError(".google.spanner.admin.database.v1.Database.earliestVersionTime: object expected"); + message.earliestVersionTime = $root.google.protobuf.Timestamp.fromObject(object.earliestVersionTime); + } + if (object.defaultLeader != null) + message.defaultLeader = String(object.defaultLeader); + switch (object.databaseDialect) { + default: + if (typeof object.databaseDialect === "number") { + message.databaseDialect = object.databaseDialect; + break; + } + break; + case "DATABASE_DIALECT_UNSPECIFIED": + case 0: + message.databaseDialect = 0; + break; + case "GOOGLE_STANDARD_SQL": + case 1: + message.databaseDialect = 1; + break; + case "POSTGRESQL": + case 2: + message.databaseDialect = 2; + break; + } + if (object.enableDropProtection != null) + message.enableDropProtection = Boolean(object.enableDropProtection); + if (object.reconciling != null) + message.reconciling = Boolean(object.reconciling); + return message; + }; + + /** + * Creates a plain object from a Database message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.Database + * @static + * @param {google.spanner.admin.database.v1.Database} message Database + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Database.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.encryptionInfo = []; + if (options.defaults) { + object.name = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.createTime = null; + object.restoreInfo = null; + object.encryptionConfig = null; + object.versionRetentionPeriod = ""; + object.earliestVersionTime = null; + object.defaultLeader = ""; + object.databaseDialect = options.enums === String ? "DATABASE_DIALECT_UNSPECIFIED" : 0; + object.enableDropProtection = false; + object.reconciling = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.spanner.admin.database.v1.Database.State[message.state] === undefined ? message.state : $root.google.spanner.admin.database.v1.Database.State[message.state] : message.state; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.restoreInfo != null && message.hasOwnProperty("restoreInfo")) + object.restoreInfo = $root.google.spanner.admin.database.v1.RestoreInfo.toObject(message.restoreInfo, options); + if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) + object.encryptionConfig = $root.google.spanner.admin.database.v1.EncryptionConfig.toObject(message.encryptionConfig, options); + if (message.versionRetentionPeriod != null && message.hasOwnProperty("versionRetentionPeriod")) + object.versionRetentionPeriod = message.versionRetentionPeriod; + if (message.earliestVersionTime != null && message.hasOwnProperty("earliestVersionTime")) + object.earliestVersionTime = $root.google.protobuf.Timestamp.toObject(message.earliestVersionTime, options); + if (message.encryptionInfo && message.encryptionInfo.length) { + object.encryptionInfo = []; + for (var j = 0; j < message.encryptionInfo.length; ++j) + object.encryptionInfo[j] = $root.google.spanner.admin.database.v1.EncryptionInfo.toObject(message.encryptionInfo[j], options); + } + if (message.defaultLeader != null && message.hasOwnProperty("defaultLeader")) + object.defaultLeader = message.defaultLeader; + if (message.databaseDialect != null && message.hasOwnProperty("databaseDialect")) + object.databaseDialect = options.enums === String ? $root.google.spanner.admin.database.v1.DatabaseDialect[message.databaseDialect] === undefined ? message.databaseDialect : $root.google.spanner.admin.database.v1.DatabaseDialect[message.databaseDialect] : message.databaseDialect; + if (message.enableDropProtection != null && message.hasOwnProperty("enableDropProtection")) + object.enableDropProtection = message.enableDropProtection; + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + object.reconciling = message.reconciling; + return object; + }; + + /** + * Converts this Database to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.Database + * @instance + * @returns {Object.} JSON object + */ + Database.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Database + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.Database + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Database.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.Database"; + }; + + /** + * State enum. + * @name google.spanner.admin.database.v1.Database.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} CREATING=1 CREATING value + * @property {number} READY=2 READY value + * @property {number} READY_OPTIMIZING=3 READY_OPTIMIZING value + */ + Database.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CREATING"] = 1; + values[valuesById[2] = "READY"] = 2; + values[valuesById[3] = "READY_OPTIMIZING"] = 3; + return values; + })(); + + return Database; + })(); + + v1.ListDatabasesRequest = (function() { + + /** + * Properties of a ListDatabasesRequest. + * @memberof google.spanner.admin.database.v1 + * @interface IListDatabasesRequest + * @property {string|null} [parent] ListDatabasesRequest parent + * @property {number|null} [pageSize] ListDatabasesRequest pageSize + * @property {string|null} [pageToken] ListDatabasesRequest pageToken + */ + + /** + * Constructs a new ListDatabasesRequest. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents a ListDatabasesRequest. + * @implements IListDatabasesRequest + * @constructor + * @param {google.spanner.admin.database.v1.IListDatabasesRequest=} [properties] Properties to set + */ + function ListDatabasesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListDatabasesRequest parent. + * @member {string} parent + * @memberof google.spanner.admin.database.v1.ListDatabasesRequest + * @instance + */ + ListDatabasesRequest.prototype.parent = ""; + + /** + * ListDatabasesRequest pageSize. + * @member {number} pageSize + * @memberof google.spanner.admin.database.v1.ListDatabasesRequest + * @instance + */ + ListDatabasesRequest.prototype.pageSize = 0; + + /** + * ListDatabasesRequest pageToken. + * @member {string} pageToken + * @memberof google.spanner.admin.database.v1.ListDatabasesRequest + * @instance + */ + ListDatabasesRequest.prototype.pageToken = ""; + + /** + * Creates a new ListDatabasesRequest instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.ListDatabasesRequest + * @static + * @param {google.spanner.admin.database.v1.IListDatabasesRequest=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.ListDatabasesRequest} ListDatabasesRequest instance + */ + ListDatabasesRequest.create = function create(properties) { + return new ListDatabasesRequest(properties); + }; + + /** + * Encodes the specified ListDatabasesRequest message. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabasesRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.ListDatabasesRequest + * @static + * @param {google.spanner.admin.database.v1.IListDatabasesRequest} message ListDatabasesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDatabasesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListDatabasesRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabasesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.ListDatabasesRequest + * @static + * @param {google.spanner.admin.database.v1.IListDatabasesRequest} message ListDatabasesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDatabasesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDatabasesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.ListDatabasesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.ListDatabasesRequest} ListDatabasesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDatabasesRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.ListDatabasesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListDatabasesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.ListDatabasesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.ListDatabasesRequest} ListDatabasesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDatabasesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDatabasesRequest message. + * @function verify + * @memberof google.spanner.admin.database.v1.ListDatabasesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDatabasesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListDatabasesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.ListDatabasesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.ListDatabasesRequest} ListDatabasesRequest + */ + ListDatabasesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.ListDatabasesRequest) + return object; + var message = new $root.google.spanner.admin.database.v1.ListDatabasesRequest(); + 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 ListDatabasesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.ListDatabasesRequest + * @static + * @param {google.spanner.admin.database.v1.ListDatabasesRequest} message ListDatabasesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDatabasesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListDatabasesRequest to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.ListDatabasesRequest + * @instance + * @returns {Object.} JSON object + */ + ListDatabasesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDatabasesRequest + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.ListDatabasesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDatabasesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.ListDatabasesRequest"; + }; + + return ListDatabasesRequest; + })(); + + v1.ListDatabasesResponse = (function() { + + /** + * Properties of a ListDatabasesResponse. + * @memberof google.spanner.admin.database.v1 + * @interface IListDatabasesResponse + * @property {Array.|null} [databases] ListDatabasesResponse databases + * @property {string|null} [nextPageToken] ListDatabasesResponse nextPageToken + */ + + /** + * Constructs a new ListDatabasesResponse. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents a ListDatabasesResponse. + * @implements IListDatabasesResponse + * @constructor + * @param {google.spanner.admin.database.v1.IListDatabasesResponse=} [properties] Properties to set + */ + function ListDatabasesResponse(properties) { + this.databases = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListDatabasesResponse databases. + * @member {Array.} databases + * @memberof google.spanner.admin.database.v1.ListDatabasesResponse + * @instance + */ + ListDatabasesResponse.prototype.databases = $util.emptyArray; + + /** + * ListDatabasesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.spanner.admin.database.v1.ListDatabasesResponse + * @instance + */ + ListDatabasesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListDatabasesResponse instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.ListDatabasesResponse + * @static + * @param {google.spanner.admin.database.v1.IListDatabasesResponse=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.ListDatabasesResponse} ListDatabasesResponse instance + */ + ListDatabasesResponse.create = function create(properties) { + return new ListDatabasesResponse(properties); + }; + + /** + * Encodes the specified ListDatabasesResponse message. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabasesResponse.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.ListDatabasesResponse + * @static + * @param {google.spanner.admin.database.v1.IListDatabasesResponse} message ListDatabasesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDatabasesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.databases != null && message.databases.length) + for (var i = 0; i < message.databases.length; ++i) + $root.google.spanner.admin.database.v1.Database.encode(message.databases[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListDatabasesResponse message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabasesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.ListDatabasesResponse + * @static + * @param {google.spanner.admin.database.v1.IListDatabasesResponse} message ListDatabasesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDatabasesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDatabasesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.ListDatabasesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.ListDatabasesResponse} ListDatabasesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDatabasesResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.ListDatabasesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.databases && message.databases.length)) + message.databases = []; + message.databases.push($root.google.spanner.admin.database.v1.Database.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListDatabasesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.ListDatabasesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.ListDatabasesResponse} ListDatabasesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDatabasesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDatabasesResponse message. + * @function verify + * @memberof google.spanner.admin.database.v1.ListDatabasesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDatabasesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.databases != null && message.hasOwnProperty("databases")) { + if (!Array.isArray(message.databases)) + return "databases: array expected"; + for (var i = 0; i < message.databases.length; ++i) { + var error = $root.google.spanner.admin.database.v1.Database.verify(message.databases[i]); + if (error) + return "databases." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListDatabasesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.ListDatabasesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.ListDatabasesResponse} ListDatabasesResponse + */ + ListDatabasesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.ListDatabasesResponse) + return object; + var message = new $root.google.spanner.admin.database.v1.ListDatabasesResponse(); + if (object.databases) { + if (!Array.isArray(object.databases)) + throw TypeError(".google.spanner.admin.database.v1.ListDatabasesResponse.databases: array expected"); + message.databases = []; + for (var i = 0; i < object.databases.length; ++i) { + if (typeof object.databases[i] !== "object") + throw TypeError(".google.spanner.admin.database.v1.ListDatabasesResponse.databases: object expected"); + message.databases[i] = $root.google.spanner.admin.database.v1.Database.fromObject(object.databases[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListDatabasesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.ListDatabasesResponse + * @static + * @param {google.spanner.admin.database.v1.ListDatabasesResponse} message ListDatabasesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDatabasesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.databases = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.databases && message.databases.length) { + object.databases = []; + for (var j = 0; j < message.databases.length; ++j) + object.databases[j] = $root.google.spanner.admin.database.v1.Database.toObject(message.databases[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListDatabasesResponse to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.ListDatabasesResponse + * @instance + * @returns {Object.} JSON object + */ + ListDatabasesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDatabasesResponse + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.ListDatabasesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDatabasesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.ListDatabasesResponse"; + }; + + return ListDatabasesResponse; + })(); + + v1.CreateDatabaseRequest = (function() { + + /** + * Properties of a CreateDatabaseRequest. + * @memberof google.spanner.admin.database.v1 + * @interface ICreateDatabaseRequest + * @property {string|null} [parent] CreateDatabaseRequest parent + * @property {string|null} [createStatement] CreateDatabaseRequest createStatement + * @property {Array.|null} [extraStatements] CreateDatabaseRequest extraStatements + * @property {google.spanner.admin.database.v1.IEncryptionConfig|null} [encryptionConfig] CreateDatabaseRequest encryptionConfig + * @property {google.spanner.admin.database.v1.DatabaseDialect|null} [databaseDialect] CreateDatabaseRequest databaseDialect + * @property {Uint8Array|null} [protoDescriptors] CreateDatabaseRequest protoDescriptors + */ + + /** + * Constructs a new CreateDatabaseRequest. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents a CreateDatabaseRequest. + * @implements ICreateDatabaseRequest + * @constructor + * @param {google.spanner.admin.database.v1.ICreateDatabaseRequest=} [properties] Properties to set + */ + function CreateDatabaseRequest(properties) { + this.extraStatements = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateDatabaseRequest parent. + * @member {string} parent + * @memberof google.spanner.admin.database.v1.CreateDatabaseRequest + * @instance + */ + CreateDatabaseRequest.prototype.parent = ""; + + /** + * CreateDatabaseRequest createStatement. + * @member {string} createStatement + * @memberof google.spanner.admin.database.v1.CreateDatabaseRequest + * @instance + */ + CreateDatabaseRequest.prototype.createStatement = ""; + + /** + * CreateDatabaseRequest extraStatements. + * @member {Array.} extraStatements + * @memberof google.spanner.admin.database.v1.CreateDatabaseRequest + * @instance + */ + CreateDatabaseRequest.prototype.extraStatements = $util.emptyArray; + + /** + * CreateDatabaseRequest encryptionConfig. + * @member {google.spanner.admin.database.v1.IEncryptionConfig|null|undefined} encryptionConfig + * @memberof google.spanner.admin.database.v1.CreateDatabaseRequest + * @instance + */ + CreateDatabaseRequest.prototype.encryptionConfig = null; + + /** + * CreateDatabaseRequest databaseDialect. + * @member {google.spanner.admin.database.v1.DatabaseDialect} databaseDialect + * @memberof google.spanner.admin.database.v1.CreateDatabaseRequest + * @instance + */ + CreateDatabaseRequest.prototype.databaseDialect = 0; + + /** + * CreateDatabaseRequest protoDescriptors. + * @member {Uint8Array} protoDescriptors + * @memberof google.spanner.admin.database.v1.CreateDatabaseRequest + * @instance + */ + CreateDatabaseRequest.prototype.protoDescriptors = $util.newBuffer([]); + + /** + * Creates a new CreateDatabaseRequest instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.CreateDatabaseRequest + * @static + * @param {google.spanner.admin.database.v1.ICreateDatabaseRequest=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.CreateDatabaseRequest} CreateDatabaseRequest instance + */ + CreateDatabaseRequest.create = function create(properties) { + return new CreateDatabaseRequest(properties); + }; + + /** + * Encodes the specified CreateDatabaseRequest message. Does not implicitly {@link google.spanner.admin.database.v1.CreateDatabaseRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.CreateDatabaseRequest + * @static + * @param {google.spanner.admin.database.v1.ICreateDatabaseRequest} message CreateDatabaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateDatabaseRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.createStatement != null && Object.hasOwnProperty.call(message, "createStatement")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.createStatement); + if (message.extraStatements != null && message.extraStatements.length) + for (var i = 0; i < message.extraStatements.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.extraStatements[i]); + if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) + $root.google.spanner.admin.database.v1.EncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.databaseDialect != null && Object.hasOwnProperty.call(message, "databaseDialect")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.databaseDialect); + if (message.protoDescriptors != null && Object.hasOwnProperty.call(message, "protoDescriptors")) + writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.protoDescriptors); + return writer; + }; + + /** + * Encodes the specified CreateDatabaseRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.CreateDatabaseRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.CreateDatabaseRequest + * @static + * @param {google.spanner.admin.database.v1.ICreateDatabaseRequest} message CreateDatabaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateDatabaseRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateDatabaseRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.CreateDatabaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.CreateDatabaseRequest} CreateDatabaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateDatabaseRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.CreateDatabaseRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.createStatement = reader.string(); + break; + } + case 3: { + if (!(message.extraStatements && message.extraStatements.length)) + message.extraStatements = []; + message.extraStatements.push(reader.string()); + break; + } + case 4: { + message.encryptionConfig = $root.google.spanner.admin.database.v1.EncryptionConfig.decode(reader, reader.uint32()); + break; + } + case 5: { + message.databaseDialect = reader.int32(); + break; + } + case 6: { + message.protoDescriptors = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateDatabaseRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.CreateDatabaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.CreateDatabaseRequest} CreateDatabaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateDatabaseRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateDatabaseRequest message. + * @function verify + * @memberof google.spanner.admin.database.v1.CreateDatabaseRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateDatabaseRequest.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.createStatement != null && message.hasOwnProperty("createStatement")) + if (!$util.isString(message.createStatement)) + return "createStatement: string expected"; + if (message.extraStatements != null && message.hasOwnProperty("extraStatements")) { + if (!Array.isArray(message.extraStatements)) + return "extraStatements: array expected"; + for (var i = 0; i < message.extraStatements.length; ++i) + if (!$util.isString(message.extraStatements[i])) + return "extraStatements: string[] expected"; + } + if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { + var error = $root.google.spanner.admin.database.v1.EncryptionConfig.verify(message.encryptionConfig); + if (error) + return "encryptionConfig." + error; + } + if (message.databaseDialect != null && message.hasOwnProperty("databaseDialect")) + switch (message.databaseDialect) { + default: + return "databaseDialect: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.protoDescriptors != null && message.hasOwnProperty("protoDescriptors")) + if (!(message.protoDescriptors && typeof message.protoDescriptors.length === "number" || $util.isString(message.protoDescriptors))) + return "protoDescriptors: buffer expected"; + return null; + }; + + /** + * Creates a CreateDatabaseRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.CreateDatabaseRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.CreateDatabaseRequest} CreateDatabaseRequest + */ + CreateDatabaseRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.CreateDatabaseRequest) + return object; + var message = new $root.google.spanner.admin.database.v1.CreateDatabaseRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.createStatement != null) + message.createStatement = String(object.createStatement); + if (object.extraStatements) { + if (!Array.isArray(object.extraStatements)) + throw TypeError(".google.spanner.admin.database.v1.CreateDatabaseRequest.extraStatements: array expected"); + message.extraStatements = []; + for (var i = 0; i < object.extraStatements.length; ++i) + message.extraStatements[i] = String(object.extraStatements[i]); + } + if (object.encryptionConfig != null) { + if (typeof object.encryptionConfig !== "object") + throw TypeError(".google.spanner.admin.database.v1.CreateDatabaseRequest.encryptionConfig: object expected"); + message.encryptionConfig = $root.google.spanner.admin.database.v1.EncryptionConfig.fromObject(object.encryptionConfig); + } + switch (object.databaseDialect) { + default: + if (typeof object.databaseDialect === "number") { + message.databaseDialect = object.databaseDialect; + break; + } + break; + case "DATABASE_DIALECT_UNSPECIFIED": + case 0: + message.databaseDialect = 0; + break; + case "GOOGLE_STANDARD_SQL": + case 1: + message.databaseDialect = 1; + break; + case "POSTGRESQL": + case 2: + message.databaseDialect = 2; + break; + } + if (object.protoDescriptors != null) + if (typeof object.protoDescriptors === "string") + $util.base64.decode(object.protoDescriptors, message.protoDescriptors = $util.newBuffer($util.base64.length(object.protoDescriptors)), 0); + else if (object.protoDescriptors.length >= 0) + message.protoDescriptors = object.protoDescriptors; + return message; + }; + + /** + * Creates a plain object from a CreateDatabaseRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.CreateDatabaseRequest + * @static + * @param {google.spanner.admin.database.v1.CreateDatabaseRequest} message CreateDatabaseRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateDatabaseRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.extraStatements = []; + if (options.defaults) { + object.parent = ""; + object.createStatement = ""; + object.encryptionConfig = null; + object.databaseDialect = options.enums === String ? "DATABASE_DIALECT_UNSPECIFIED" : 0; + if (options.bytes === String) + object.protoDescriptors = ""; + else { + object.protoDescriptors = []; + if (options.bytes !== Array) + object.protoDescriptors = $util.newBuffer(object.protoDescriptors); + } + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.createStatement != null && message.hasOwnProperty("createStatement")) + object.createStatement = message.createStatement; + if (message.extraStatements && message.extraStatements.length) { + object.extraStatements = []; + for (var j = 0; j < message.extraStatements.length; ++j) + object.extraStatements[j] = message.extraStatements[j]; + } + if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) + object.encryptionConfig = $root.google.spanner.admin.database.v1.EncryptionConfig.toObject(message.encryptionConfig, options); + if (message.databaseDialect != null && message.hasOwnProperty("databaseDialect")) + object.databaseDialect = options.enums === String ? $root.google.spanner.admin.database.v1.DatabaseDialect[message.databaseDialect] === undefined ? message.databaseDialect : $root.google.spanner.admin.database.v1.DatabaseDialect[message.databaseDialect] : message.databaseDialect; + if (message.protoDescriptors != null && message.hasOwnProperty("protoDescriptors")) + object.protoDescriptors = options.bytes === String ? $util.base64.encode(message.protoDescriptors, 0, message.protoDescriptors.length) : options.bytes === Array ? Array.prototype.slice.call(message.protoDescriptors) : message.protoDescriptors; + return object; + }; + + /** + * Converts this CreateDatabaseRequest to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.CreateDatabaseRequest + * @instance + * @returns {Object.} JSON object + */ + CreateDatabaseRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateDatabaseRequest + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.CreateDatabaseRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateDatabaseRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.CreateDatabaseRequest"; + }; + + return CreateDatabaseRequest; + })(); + + v1.CreateDatabaseMetadata = (function() { + + /** + * Properties of a CreateDatabaseMetadata. + * @memberof google.spanner.admin.database.v1 + * @interface ICreateDatabaseMetadata + * @property {string|null} [database] CreateDatabaseMetadata database + */ + + /** + * Constructs a new CreateDatabaseMetadata. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents a CreateDatabaseMetadata. + * @implements ICreateDatabaseMetadata + * @constructor + * @param {google.spanner.admin.database.v1.ICreateDatabaseMetadata=} [properties] Properties to set + */ + function CreateDatabaseMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateDatabaseMetadata database. + * @member {string} database + * @memberof google.spanner.admin.database.v1.CreateDatabaseMetadata + * @instance + */ + CreateDatabaseMetadata.prototype.database = ""; + + /** + * Creates a new CreateDatabaseMetadata instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.CreateDatabaseMetadata + * @static + * @param {google.spanner.admin.database.v1.ICreateDatabaseMetadata=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.CreateDatabaseMetadata} CreateDatabaseMetadata instance + */ + CreateDatabaseMetadata.create = function create(properties) { + return new CreateDatabaseMetadata(properties); + }; + + /** + * Encodes the specified CreateDatabaseMetadata message. Does not implicitly {@link google.spanner.admin.database.v1.CreateDatabaseMetadata.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.CreateDatabaseMetadata + * @static + * @param {google.spanner.admin.database.v1.ICreateDatabaseMetadata} message CreateDatabaseMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateDatabaseMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.database != null && Object.hasOwnProperty.call(message, "database")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.database); + return writer; + }; + + /** + * Encodes the specified CreateDatabaseMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.CreateDatabaseMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.CreateDatabaseMetadata + * @static + * @param {google.spanner.admin.database.v1.ICreateDatabaseMetadata} message CreateDatabaseMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateDatabaseMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateDatabaseMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.CreateDatabaseMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.CreateDatabaseMetadata} CreateDatabaseMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateDatabaseMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.CreateDatabaseMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.database = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateDatabaseMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.CreateDatabaseMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.CreateDatabaseMetadata} CreateDatabaseMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateDatabaseMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateDatabaseMetadata message. + * @function verify + * @memberof google.spanner.admin.database.v1.CreateDatabaseMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateDatabaseMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.database != null && message.hasOwnProperty("database")) + if (!$util.isString(message.database)) + return "database: string expected"; + return null; + }; + + /** + * Creates a CreateDatabaseMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.CreateDatabaseMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.CreateDatabaseMetadata} CreateDatabaseMetadata + */ + CreateDatabaseMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.CreateDatabaseMetadata) + return object; + var message = new $root.google.spanner.admin.database.v1.CreateDatabaseMetadata(); + if (object.database != null) + message.database = String(object.database); + return message; + }; + + /** + * Creates a plain object from a CreateDatabaseMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.CreateDatabaseMetadata + * @static + * @param {google.spanner.admin.database.v1.CreateDatabaseMetadata} message CreateDatabaseMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateDatabaseMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.database = ""; + if (message.database != null && message.hasOwnProperty("database")) + object.database = message.database; + return object; + }; + + /** + * Converts this CreateDatabaseMetadata to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.CreateDatabaseMetadata + * @instance + * @returns {Object.} JSON object + */ + CreateDatabaseMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateDatabaseMetadata + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.CreateDatabaseMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateDatabaseMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.CreateDatabaseMetadata"; + }; + + return CreateDatabaseMetadata; + })(); + + v1.GetDatabaseRequest = (function() { + + /** + * Properties of a GetDatabaseRequest. + * @memberof google.spanner.admin.database.v1 + * @interface IGetDatabaseRequest + * @property {string|null} [name] GetDatabaseRequest name + */ + + /** + * Constructs a new GetDatabaseRequest. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents a GetDatabaseRequest. + * @implements IGetDatabaseRequest + * @constructor + * @param {google.spanner.admin.database.v1.IGetDatabaseRequest=} [properties] Properties to set + */ + function GetDatabaseRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetDatabaseRequest name. + * @member {string} name + * @memberof google.spanner.admin.database.v1.GetDatabaseRequest + * @instance + */ + GetDatabaseRequest.prototype.name = ""; + + /** + * Creates a new GetDatabaseRequest instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.GetDatabaseRequest + * @static + * @param {google.spanner.admin.database.v1.IGetDatabaseRequest=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.GetDatabaseRequest} GetDatabaseRequest instance + */ + GetDatabaseRequest.create = function create(properties) { + return new GetDatabaseRequest(properties); + }; + + /** + * Encodes the specified GetDatabaseRequest message. Does not implicitly {@link google.spanner.admin.database.v1.GetDatabaseRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.GetDatabaseRequest + * @static + * @param {google.spanner.admin.database.v1.IGetDatabaseRequest} message GetDatabaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDatabaseRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetDatabaseRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.GetDatabaseRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.GetDatabaseRequest + * @static + * @param {google.spanner.admin.database.v1.IGetDatabaseRequest} message GetDatabaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDatabaseRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDatabaseRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.GetDatabaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.GetDatabaseRequest} GetDatabaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDatabaseRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.GetDatabaseRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetDatabaseRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.GetDatabaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.GetDatabaseRequest} GetDatabaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDatabaseRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDatabaseRequest message. + * @function verify + * @memberof google.spanner.admin.database.v1.GetDatabaseRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDatabaseRequest.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 GetDatabaseRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.GetDatabaseRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.GetDatabaseRequest} GetDatabaseRequest + */ + GetDatabaseRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.GetDatabaseRequest) + return object; + var message = new $root.google.spanner.admin.database.v1.GetDatabaseRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetDatabaseRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.GetDatabaseRequest + * @static + * @param {google.spanner.admin.database.v1.GetDatabaseRequest} message GetDatabaseRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDatabaseRequest.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 GetDatabaseRequest to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.GetDatabaseRequest + * @instance + * @returns {Object.} JSON object + */ + GetDatabaseRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetDatabaseRequest + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.GetDatabaseRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetDatabaseRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.GetDatabaseRequest"; + }; + + return GetDatabaseRequest; + })(); + + v1.UpdateDatabaseRequest = (function() { + + /** + * Properties of an UpdateDatabaseRequest. + * @memberof google.spanner.admin.database.v1 + * @interface IUpdateDatabaseRequest + * @property {google.spanner.admin.database.v1.IDatabase|null} [database] UpdateDatabaseRequest database + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateDatabaseRequest updateMask + */ + + /** + * Constructs a new UpdateDatabaseRequest. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents an UpdateDatabaseRequest. + * @implements IUpdateDatabaseRequest + * @constructor + * @param {google.spanner.admin.database.v1.IUpdateDatabaseRequest=} [properties] Properties to set + */ + function UpdateDatabaseRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateDatabaseRequest database. + * @member {google.spanner.admin.database.v1.IDatabase|null|undefined} database + * @memberof google.spanner.admin.database.v1.UpdateDatabaseRequest + * @instance + */ + UpdateDatabaseRequest.prototype.database = null; + + /** + * UpdateDatabaseRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.spanner.admin.database.v1.UpdateDatabaseRequest + * @instance + */ + UpdateDatabaseRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateDatabaseRequest instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.UpdateDatabaseRequest + * @static + * @param {google.spanner.admin.database.v1.IUpdateDatabaseRequest=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.UpdateDatabaseRequest} UpdateDatabaseRequest instance + */ + UpdateDatabaseRequest.create = function create(properties) { + return new UpdateDatabaseRequest(properties); + }; + + /** + * Encodes the specified UpdateDatabaseRequest message. Does not implicitly {@link google.spanner.admin.database.v1.UpdateDatabaseRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.UpdateDatabaseRequest + * @static + * @param {google.spanner.admin.database.v1.IUpdateDatabaseRequest} message UpdateDatabaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDatabaseRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.database != null && Object.hasOwnProperty.call(message, "database")) + $root.google.spanner.admin.database.v1.Database.encode(message.database, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateDatabaseRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.UpdateDatabaseRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.UpdateDatabaseRequest + * @static + * @param {google.spanner.admin.database.v1.IUpdateDatabaseRequest} message UpdateDatabaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDatabaseRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateDatabaseRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.UpdateDatabaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.UpdateDatabaseRequest} UpdateDatabaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDatabaseRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.UpdateDatabaseRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.database = $root.google.spanner.admin.database.v1.Database.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateDatabaseRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.UpdateDatabaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.UpdateDatabaseRequest} UpdateDatabaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDatabaseRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateDatabaseRequest message. + * @function verify + * @memberof google.spanner.admin.database.v1.UpdateDatabaseRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateDatabaseRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.database != null && message.hasOwnProperty("database")) { + var error = $root.google.spanner.admin.database.v1.Database.verify(message.database); + if (error) + return "database." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateDatabaseRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.UpdateDatabaseRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.UpdateDatabaseRequest} UpdateDatabaseRequest + */ + UpdateDatabaseRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.UpdateDatabaseRequest) + return object; + var message = new $root.google.spanner.admin.database.v1.UpdateDatabaseRequest(); + if (object.database != null) { + if (typeof object.database !== "object") + throw TypeError(".google.spanner.admin.database.v1.UpdateDatabaseRequest.database: object expected"); + message.database = $root.google.spanner.admin.database.v1.Database.fromObject(object.database); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.spanner.admin.database.v1.UpdateDatabaseRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateDatabaseRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.UpdateDatabaseRequest + * @static + * @param {google.spanner.admin.database.v1.UpdateDatabaseRequest} message UpdateDatabaseRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateDatabaseRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.database = null; + object.updateMask = null; + } + if (message.database != null && message.hasOwnProperty("database")) + object.database = $root.google.spanner.admin.database.v1.Database.toObject(message.database, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateDatabaseRequest to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.UpdateDatabaseRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateDatabaseRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateDatabaseRequest + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.UpdateDatabaseRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateDatabaseRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.UpdateDatabaseRequest"; + }; + + return UpdateDatabaseRequest; + })(); + + v1.UpdateDatabaseMetadata = (function() { + + /** + * Properties of an UpdateDatabaseMetadata. + * @memberof google.spanner.admin.database.v1 + * @interface IUpdateDatabaseMetadata + * @property {google.spanner.admin.database.v1.IUpdateDatabaseRequest|null} [request] UpdateDatabaseMetadata request + * @property {google.spanner.admin.database.v1.IOperationProgress|null} [progress] UpdateDatabaseMetadata progress + * @property {google.protobuf.ITimestamp|null} [cancelTime] UpdateDatabaseMetadata cancelTime + */ + + /** + * Constructs a new UpdateDatabaseMetadata. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents an UpdateDatabaseMetadata. + * @implements IUpdateDatabaseMetadata + * @constructor + * @param {google.spanner.admin.database.v1.IUpdateDatabaseMetadata=} [properties] Properties to set + */ + function UpdateDatabaseMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateDatabaseMetadata request. + * @member {google.spanner.admin.database.v1.IUpdateDatabaseRequest|null|undefined} request + * @memberof google.spanner.admin.database.v1.UpdateDatabaseMetadata + * @instance + */ + UpdateDatabaseMetadata.prototype.request = null; + + /** + * UpdateDatabaseMetadata progress. + * @member {google.spanner.admin.database.v1.IOperationProgress|null|undefined} progress + * @memberof google.spanner.admin.database.v1.UpdateDatabaseMetadata + * @instance + */ + UpdateDatabaseMetadata.prototype.progress = null; + + /** + * UpdateDatabaseMetadata cancelTime. + * @member {google.protobuf.ITimestamp|null|undefined} cancelTime + * @memberof google.spanner.admin.database.v1.UpdateDatabaseMetadata + * @instance + */ + UpdateDatabaseMetadata.prototype.cancelTime = null; + + /** + * Creates a new UpdateDatabaseMetadata instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.UpdateDatabaseMetadata + * @static + * @param {google.spanner.admin.database.v1.IUpdateDatabaseMetadata=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.UpdateDatabaseMetadata} UpdateDatabaseMetadata instance + */ + UpdateDatabaseMetadata.create = function create(properties) { + return new UpdateDatabaseMetadata(properties); + }; + + /** + * Encodes the specified UpdateDatabaseMetadata message. Does not implicitly {@link google.spanner.admin.database.v1.UpdateDatabaseMetadata.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.UpdateDatabaseMetadata + * @static + * @param {google.spanner.admin.database.v1.IUpdateDatabaseMetadata} message UpdateDatabaseMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDatabaseMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.request != null && Object.hasOwnProperty.call(message, "request")) + $root.google.spanner.admin.database.v1.UpdateDatabaseRequest.encode(message.request, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.progress != null && Object.hasOwnProperty.call(message, "progress")) + $root.google.spanner.admin.database.v1.OperationProgress.encode(message.progress, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.cancelTime != null && Object.hasOwnProperty.call(message, "cancelTime")) + $root.google.protobuf.Timestamp.encode(message.cancelTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateDatabaseMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.UpdateDatabaseMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.UpdateDatabaseMetadata + * @static + * @param {google.spanner.admin.database.v1.IUpdateDatabaseMetadata} message UpdateDatabaseMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDatabaseMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateDatabaseMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.UpdateDatabaseMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.UpdateDatabaseMetadata} UpdateDatabaseMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDatabaseMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.UpdateDatabaseMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.request = $root.google.spanner.admin.database.v1.UpdateDatabaseRequest.decode(reader, reader.uint32()); + break; + } + case 2: { + message.progress = $root.google.spanner.admin.database.v1.OperationProgress.decode(reader, reader.uint32()); + break; + } + case 3: { + message.cancelTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateDatabaseMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.UpdateDatabaseMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.UpdateDatabaseMetadata} UpdateDatabaseMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDatabaseMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateDatabaseMetadata message. + * @function verify + * @memberof google.spanner.admin.database.v1.UpdateDatabaseMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateDatabaseMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.request != null && message.hasOwnProperty("request")) { + var error = $root.google.spanner.admin.database.v1.UpdateDatabaseRequest.verify(message.request); + if (error) + return "request." + error; + } + if (message.progress != null && message.hasOwnProperty("progress")) { + var error = $root.google.spanner.admin.database.v1.OperationProgress.verify(message.progress); + if (error) + return "progress." + error; + } + if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.cancelTime); + if (error) + return "cancelTime." + error; + } + return null; + }; + + /** + * Creates an UpdateDatabaseMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.UpdateDatabaseMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.UpdateDatabaseMetadata} UpdateDatabaseMetadata + */ + UpdateDatabaseMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.UpdateDatabaseMetadata) + return object; + var message = new $root.google.spanner.admin.database.v1.UpdateDatabaseMetadata(); + if (object.request != null) { + if (typeof object.request !== "object") + throw TypeError(".google.spanner.admin.database.v1.UpdateDatabaseMetadata.request: object expected"); + message.request = $root.google.spanner.admin.database.v1.UpdateDatabaseRequest.fromObject(object.request); + } + if (object.progress != null) { + if (typeof object.progress !== "object") + throw TypeError(".google.spanner.admin.database.v1.UpdateDatabaseMetadata.progress: object expected"); + message.progress = $root.google.spanner.admin.database.v1.OperationProgress.fromObject(object.progress); + } + if (object.cancelTime != null) { + if (typeof object.cancelTime !== "object") + throw TypeError(".google.spanner.admin.database.v1.UpdateDatabaseMetadata.cancelTime: object expected"); + message.cancelTime = $root.google.protobuf.Timestamp.fromObject(object.cancelTime); + } + return message; + }; + + /** + * Creates a plain object from an UpdateDatabaseMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.UpdateDatabaseMetadata + * @static + * @param {google.spanner.admin.database.v1.UpdateDatabaseMetadata} message UpdateDatabaseMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateDatabaseMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.request = null; + object.progress = null; + object.cancelTime = null; + } + if (message.request != null && message.hasOwnProperty("request")) + object.request = $root.google.spanner.admin.database.v1.UpdateDatabaseRequest.toObject(message.request, options); + if (message.progress != null && message.hasOwnProperty("progress")) + object.progress = $root.google.spanner.admin.database.v1.OperationProgress.toObject(message.progress, options); + if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) + object.cancelTime = $root.google.protobuf.Timestamp.toObject(message.cancelTime, options); + return object; + }; + + /** + * Converts this UpdateDatabaseMetadata to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.UpdateDatabaseMetadata + * @instance + * @returns {Object.} JSON object + */ + UpdateDatabaseMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateDatabaseMetadata + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.UpdateDatabaseMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateDatabaseMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.UpdateDatabaseMetadata"; + }; + + return UpdateDatabaseMetadata; + })(); + + v1.UpdateDatabaseDdlRequest = (function() { + + /** + * Properties of an UpdateDatabaseDdlRequest. + * @memberof google.spanner.admin.database.v1 + * @interface IUpdateDatabaseDdlRequest + * @property {string|null} [database] UpdateDatabaseDdlRequest database + * @property {Array.|null} [statements] UpdateDatabaseDdlRequest statements + * @property {string|null} [operationId] UpdateDatabaseDdlRequest operationId + * @property {Uint8Array|null} [protoDescriptors] UpdateDatabaseDdlRequest protoDescriptors + * @property {boolean|null} [throughputMode] UpdateDatabaseDdlRequest throughputMode + */ + + /** + * Constructs a new UpdateDatabaseDdlRequest. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents an UpdateDatabaseDdlRequest. + * @implements IUpdateDatabaseDdlRequest + * @constructor + * @param {google.spanner.admin.database.v1.IUpdateDatabaseDdlRequest=} [properties] Properties to set + */ + function UpdateDatabaseDdlRequest(properties) { + this.statements = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateDatabaseDdlRequest database. + * @member {string} database + * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlRequest + * @instance + */ + UpdateDatabaseDdlRequest.prototype.database = ""; + + /** + * UpdateDatabaseDdlRequest statements. + * @member {Array.} statements + * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlRequest + * @instance + */ + UpdateDatabaseDdlRequest.prototype.statements = $util.emptyArray; + + /** + * UpdateDatabaseDdlRequest operationId. + * @member {string} operationId + * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlRequest + * @instance + */ + UpdateDatabaseDdlRequest.prototype.operationId = ""; + + /** + * UpdateDatabaseDdlRequest protoDescriptors. + * @member {Uint8Array} protoDescriptors + * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlRequest + * @instance + */ + UpdateDatabaseDdlRequest.prototype.protoDescriptors = $util.newBuffer([]); + + /** + * UpdateDatabaseDdlRequest throughputMode. + * @member {boolean} throughputMode + * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlRequest + * @instance + */ + UpdateDatabaseDdlRequest.prototype.throughputMode = false; + + /** + * Creates a new UpdateDatabaseDdlRequest instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlRequest + * @static + * @param {google.spanner.admin.database.v1.IUpdateDatabaseDdlRequest=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.UpdateDatabaseDdlRequest} UpdateDatabaseDdlRequest instance + */ + UpdateDatabaseDdlRequest.create = function create(properties) { + return new UpdateDatabaseDdlRequest(properties); + }; + + /** + * Encodes the specified UpdateDatabaseDdlRequest message. Does not implicitly {@link google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlRequest + * @static + * @param {google.spanner.admin.database.v1.IUpdateDatabaseDdlRequest} message UpdateDatabaseDdlRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDatabaseDdlRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.database != null && Object.hasOwnProperty.call(message, "database")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.database); + if (message.statements != null && message.statements.length) + for (var i = 0; i < message.statements.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.statements[i]); + if (message.operationId != null && Object.hasOwnProperty.call(message, "operationId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.operationId); + if (message.protoDescriptors != null && Object.hasOwnProperty.call(message, "protoDescriptors")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.protoDescriptors); + if (message.throughputMode != null && Object.hasOwnProperty.call(message, "throughputMode")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.throughputMode); + return writer; + }; + + /** + * Encodes the specified UpdateDatabaseDdlRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlRequest + * @static + * @param {google.spanner.admin.database.v1.IUpdateDatabaseDdlRequest} message UpdateDatabaseDdlRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDatabaseDdlRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateDatabaseDdlRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.UpdateDatabaseDdlRequest} UpdateDatabaseDdlRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDatabaseDdlRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.UpdateDatabaseDdlRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.database = reader.string(); + break; + } + case 2: { + if (!(message.statements && message.statements.length)) + message.statements = []; + message.statements.push(reader.string()); + break; + } + case 3: { + message.operationId = reader.string(); + break; + } + case 4: { + message.protoDescriptors = reader.bytes(); + break; + } + case 5: { + message.throughputMode = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateDatabaseDdlRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.UpdateDatabaseDdlRequest} UpdateDatabaseDdlRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDatabaseDdlRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateDatabaseDdlRequest message. + * @function verify + * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateDatabaseDdlRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.database != null && message.hasOwnProperty("database")) + if (!$util.isString(message.database)) + return "database: string expected"; + if (message.statements != null && message.hasOwnProperty("statements")) { + if (!Array.isArray(message.statements)) + return "statements: array expected"; + for (var i = 0; i < message.statements.length; ++i) + if (!$util.isString(message.statements[i])) + return "statements: string[] expected"; + } + if (message.operationId != null && message.hasOwnProperty("operationId")) + if (!$util.isString(message.operationId)) + return "operationId: string expected"; + if (message.protoDescriptors != null && message.hasOwnProperty("protoDescriptors")) + if (!(message.protoDescriptors && typeof message.protoDescriptors.length === "number" || $util.isString(message.protoDescriptors))) + return "protoDescriptors: buffer expected"; + if (message.throughputMode != null && message.hasOwnProperty("throughputMode")) + if (typeof message.throughputMode !== "boolean") + return "throughputMode: boolean expected"; + return null; + }; + + /** + * Creates an UpdateDatabaseDdlRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.UpdateDatabaseDdlRequest} UpdateDatabaseDdlRequest + */ + UpdateDatabaseDdlRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.UpdateDatabaseDdlRequest) + return object; + var message = new $root.google.spanner.admin.database.v1.UpdateDatabaseDdlRequest(); + if (object.database != null) + message.database = String(object.database); + if (object.statements) { + if (!Array.isArray(object.statements)) + throw TypeError(".google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.statements: array expected"); + message.statements = []; + for (var i = 0; i < object.statements.length; ++i) + message.statements[i] = String(object.statements[i]); + } + if (object.operationId != null) + message.operationId = String(object.operationId); + if (object.protoDescriptors != null) + if (typeof object.protoDescriptors === "string") + $util.base64.decode(object.protoDescriptors, message.protoDescriptors = $util.newBuffer($util.base64.length(object.protoDescriptors)), 0); + else if (object.protoDescriptors.length >= 0) + message.protoDescriptors = object.protoDescriptors; + if (object.throughputMode != null) + message.throughputMode = Boolean(object.throughputMode); + return message; + }; + + /** + * Creates a plain object from an UpdateDatabaseDdlRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlRequest + * @static + * @param {google.spanner.admin.database.v1.UpdateDatabaseDdlRequest} message UpdateDatabaseDdlRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateDatabaseDdlRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.statements = []; + if (options.defaults) { + object.database = ""; + object.operationId = ""; + if (options.bytes === String) + object.protoDescriptors = ""; + else { + object.protoDescriptors = []; + if (options.bytes !== Array) + object.protoDescriptors = $util.newBuffer(object.protoDescriptors); + } + object.throughputMode = false; + } + if (message.database != null && message.hasOwnProperty("database")) + object.database = message.database; + if (message.statements && message.statements.length) { + object.statements = []; + for (var j = 0; j < message.statements.length; ++j) + object.statements[j] = message.statements[j]; + } + if (message.operationId != null && message.hasOwnProperty("operationId")) + object.operationId = message.operationId; + if (message.protoDescriptors != null && message.hasOwnProperty("protoDescriptors")) + object.protoDescriptors = options.bytes === String ? $util.base64.encode(message.protoDescriptors, 0, message.protoDescriptors.length) : options.bytes === Array ? Array.prototype.slice.call(message.protoDescriptors) : message.protoDescriptors; + if (message.throughputMode != null && message.hasOwnProperty("throughputMode")) + object.throughputMode = message.throughputMode; + return object; + }; + + /** + * Converts this UpdateDatabaseDdlRequest to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateDatabaseDdlRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateDatabaseDdlRequest + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateDatabaseDdlRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.UpdateDatabaseDdlRequest"; + }; + + return UpdateDatabaseDdlRequest; + })(); + + v1.DdlStatementActionInfo = (function() { + + /** + * Properties of a DdlStatementActionInfo. + * @memberof google.spanner.admin.database.v1 + * @interface IDdlStatementActionInfo + * @property {string|null} [action] DdlStatementActionInfo action + * @property {string|null} [entityType] DdlStatementActionInfo entityType + * @property {Array.|null} [entityNames] DdlStatementActionInfo entityNames + */ + + /** + * Constructs a new DdlStatementActionInfo. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents a DdlStatementActionInfo. + * @implements IDdlStatementActionInfo + * @constructor + * @param {google.spanner.admin.database.v1.IDdlStatementActionInfo=} [properties] Properties to set + */ + function DdlStatementActionInfo(properties) { + this.entityNames = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DdlStatementActionInfo action. + * @member {string} action + * @memberof google.spanner.admin.database.v1.DdlStatementActionInfo + * @instance + */ + DdlStatementActionInfo.prototype.action = ""; + + /** + * DdlStatementActionInfo entityType. + * @member {string} entityType + * @memberof google.spanner.admin.database.v1.DdlStatementActionInfo + * @instance + */ + DdlStatementActionInfo.prototype.entityType = ""; + + /** + * DdlStatementActionInfo entityNames. + * @member {Array.} entityNames + * @memberof google.spanner.admin.database.v1.DdlStatementActionInfo + * @instance + */ + DdlStatementActionInfo.prototype.entityNames = $util.emptyArray; + + /** + * Creates a new DdlStatementActionInfo instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.DdlStatementActionInfo + * @static + * @param {google.spanner.admin.database.v1.IDdlStatementActionInfo=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.DdlStatementActionInfo} DdlStatementActionInfo instance + */ + DdlStatementActionInfo.create = function create(properties) { + return new DdlStatementActionInfo(properties); + }; + + /** + * Encodes the specified DdlStatementActionInfo message. Does not implicitly {@link google.spanner.admin.database.v1.DdlStatementActionInfo.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.DdlStatementActionInfo + * @static + * @param {google.spanner.admin.database.v1.IDdlStatementActionInfo} message DdlStatementActionInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DdlStatementActionInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.action); + if (message.entityType != null && Object.hasOwnProperty.call(message, "entityType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.entityType); + if (message.entityNames != null && message.entityNames.length) + for (var i = 0; i < message.entityNames.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.entityNames[i]); + return writer; + }; + + /** + * Encodes the specified DdlStatementActionInfo message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.DdlStatementActionInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.DdlStatementActionInfo + * @static + * @param {google.spanner.admin.database.v1.IDdlStatementActionInfo} message DdlStatementActionInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DdlStatementActionInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DdlStatementActionInfo message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.DdlStatementActionInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.DdlStatementActionInfo} DdlStatementActionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DdlStatementActionInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.DdlStatementActionInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.action = reader.string(); + break; + } + case 2: { + message.entityType = reader.string(); + break; + } + case 3: { + if (!(message.entityNames && message.entityNames.length)) + message.entityNames = []; + message.entityNames.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DdlStatementActionInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.DdlStatementActionInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.DdlStatementActionInfo} DdlStatementActionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DdlStatementActionInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DdlStatementActionInfo message. + * @function verify + * @memberof google.spanner.admin.database.v1.DdlStatementActionInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DdlStatementActionInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.action != null && message.hasOwnProperty("action")) + if (!$util.isString(message.action)) + return "action: string expected"; + if (message.entityType != null && message.hasOwnProperty("entityType")) + if (!$util.isString(message.entityType)) + return "entityType: string expected"; + if (message.entityNames != null && message.hasOwnProperty("entityNames")) { + if (!Array.isArray(message.entityNames)) + return "entityNames: array expected"; + for (var i = 0; i < message.entityNames.length; ++i) + if (!$util.isString(message.entityNames[i])) + return "entityNames: string[] expected"; + } + return null; + }; + + /** + * Creates a DdlStatementActionInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.DdlStatementActionInfo + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.DdlStatementActionInfo} DdlStatementActionInfo + */ + DdlStatementActionInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.DdlStatementActionInfo) + return object; + var message = new $root.google.spanner.admin.database.v1.DdlStatementActionInfo(); + if (object.action != null) + message.action = String(object.action); + if (object.entityType != null) + message.entityType = String(object.entityType); + if (object.entityNames) { + if (!Array.isArray(object.entityNames)) + throw TypeError(".google.spanner.admin.database.v1.DdlStatementActionInfo.entityNames: array expected"); + message.entityNames = []; + for (var i = 0; i < object.entityNames.length; ++i) + message.entityNames[i] = String(object.entityNames[i]); + } + return message; + }; + + /** + * Creates a plain object from a DdlStatementActionInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.DdlStatementActionInfo + * @static + * @param {google.spanner.admin.database.v1.DdlStatementActionInfo} message DdlStatementActionInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DdlStatementActionInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.entityNames = []; + if (options.defaults) { + object.action = ""; + object.entityType = ""; + } + if (message.action != null && message.hasOwnProperty("action")) + object.action = message.action; + if (message.entityType != null && message.hasOwnProperty("entityType")) + object.entityType = message.entityType; + if (message.entityNames && message.entityNames.length) { + object.entityNames = []; + for (var j = 0; j < message.entityNames.length; ++j) + object.entityNames[j] = message.entityNames[j]; + } + return object; + }; + + /** + * Converts this DdlStatementActionInfo to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.DdlStatementActionInfo + * @instance + * @returns {Object.} JSON object + */ + DdlStatementActionInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DdlStatementActionInfo + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.DdlStatementActionInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DdlStatementActionInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.DdlStatementActionInfo"; + }; + + return DdlStatementActionInfo; + })(); + + v1.UpdateDatabaseDdlMetadata = (function() { + + /** + * Properties of an UpdateDatabaseDdlMetadata. + * @memberof google.spanner.admin.database.v1 + * @interface IUpdateDatabaseDdlMetadata + * @property {string|null} [database] UpdateDatabaseDdlMetadata database + * @property {Array.|null} [statements] UpdateDatabaseDdlMetadata statements + * @property {Array.|null} [commitTimestamps] UpdateDatabaseDdlMetadata commitTimestamps + * @property {boolean|null} [throttled] UpdateDatabaseDdlMetadata throttled + * @property {Array.|null} [progress] UpdateDatabaseDdlMetadata progress + * @property {Array.|null} [actions] UpdateDatabaseDdlMetadata actions + */ + + /** + * Constructs a new UpdateDatabaseDdlMetadata. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents an UpdateDatabaseDdlMetadata. + * @implements IUpdateDatabaseDdlMetadata + * @constructor + * @param {google.spanner.admin.database.v1.IUpdateDatabaseDdlMetadata=} [properties] Properties to set + */ + function UpdateDatabaseDdlMetadata(properties) { + this.statements = []; + this.commitTimestamps = []; + this.progress = []; + this.actions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateDatabaseDdlMetadata database. + * @member {string} database + * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata + * @instance + */ + UpdateDatabaseDdlMetadata.prototype.database = ""; + + /** + * UpdateDatabaseDdlMetadata statements. + * @member {Array.} statements + * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata + * @instance + */ + UpdateDatabaseDdlMetadata.prototype.statements = $util.emptyArray; + + /** + * UpdateDatabaseDdlMetadata commitTimestamps. + * @member {Array.} commitTimestamps + * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata + * @instance + */ + UpdateDatabaseDdlMetadata.prototype.commitTimestamps = $util.emptyArray; + + /** + * UpdateDatabaseDdlMetadata throttled. + * @member {boolean} throttled + * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata + * @instance + */ + UpdateDatabaseDdlMetadata.prototype.throttled = false; + + /** + * UpdateDatabaseDdlMetadata progress. + * @member {Array.} progress + * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata + * @instance + */ + UpdateDatabaseDdlMetadata.prototype.progress = $util.emptyArray; + + /** + * UpdateDatabaseDdlMetadata actions. + * @member {Array.} actions + * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata + * @instance + */ + UpdateDatabaseDdlMetadata.prototype.actions = $util.emptyArray; + + /** + * Creates a new UpdateDatabaseDdlMetadata instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata + * @static + * @param {google.spanner.admin.database.v1.IUpdateDatabaseDdlMetadata=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata} UpdateDatabaseDdlMetadata instance + */ + UpdateDatabaseDdlMetadata.create = function create(properties) { + return new UpdateDatabaseDdlMetadata(properties); + }; + + /** + * Encodes the specified UpdateDatabaseDdlMetadata message. Does not implicitly {@link google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata + * @static + * @param {google.spanner.admin.database.v1.IUpdateDatabaseDdlMetadata} message UpdateDatabaseDdlMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDatabaseDdlMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.database != null && Object.hasOwnProperty.call(message, "database")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.database); + if (message.statements != null && message.statements.length) + for (var i = 0; i < message.statements.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.statements[i]); + if (message.commitTimestamps != null && message.commitTimestamps.length) + for (var i = 0; i < message.commitTimestamps.length; ++i) + $root.google.protobuf.Timestamp.encode(message.commitTimestamps[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.throttled != null && Object.hasOwnProperty.call(message, "throttled")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.throttled); + if (message.progress != null && message.progress.length) + for (var i = 0; i < message.progress.length; ++i) + $root.google.spanner.admin.database.v1.OperationProgress.encode(message.progress[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.actions != null && message.actions.length) + for (var i = 0; i < message.actions.length; ++i) + $root.google.spanner.admin.database.v1.DdlStatementActionInfo.encode(message.actions[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateDatabaseDdlMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata + * @static + * @param {google.spanner.admin.database.v1.IUpdateDatabaseDdlMetadata} message UpdateDatabaseDdlMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDatabaseDdlMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateDatabaseDdlMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata} UpdateDatabaseDdlMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDatabaseDdlMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.database = reader.string(); + break; + } + case 2: { + if (!(message.statements && message.statements.length)) + message.statements = []; + message.statements.push(reader.string()); + break; + } + case 3: { + if (!(message.commitTimestamps && message.commitTimestamps.length)) + message.commitTimestamps = []; + message.commitTimestamps.push($root.google.protobuf.Timestamp.decode(reader, reader.uint32())); + break; + } + case 4: { + message.throttled = reader.bool(); + break; + } + case 5: { + if (!(message.progress && message.progress.length)) + message.progress = []; + message.progress.push($root.google.spanner.admin.database.v1.OperationProgress.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.actions && message.actions.length)) + message.actions = []; + message.actions.push($root.google.spanner.admin.database.v1.DdlStatementActionInfo.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateDatabaseDdlMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata} UpdateDatabaseDdlMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDatabaseDdlMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateDatabaseDdlMetadata message. + * @function verify + * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateDatabaseDdlMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.database != null && message.hasOwnProperty("database")) + if (!$util.isString(message.database)) + return "database: string expected"; + if (message.statements != null && message.hasOwnProperty("statements")) { + if (!Array.isArray(message.statements)) + return "statements: array expected"; + for (var i = 0; i < message.statements.length; ++i) + if (!$util.isString(message.statements[i])) + return "statements: string[] expected"; + } + if (message.commitTimestamps != null && message.hasOwnProperty("commitTimestamps")) { + if (!Array.isArray(message.commitTimestamps)) + return "commitTimestamps: array expected"; + for (var i = 0; i < message.commitTimestamps.length; ++i) { + var error = $root.google.protobuf.Timestamp.verify(message.commitTimestamps[i]); + if (error) + return "commitTimestamps." + error; + } + } + if (message.throttled != null && message.hasOwnProperty("throttled")) + if (typeof message.throttled !== "boolean") + return "throttled: boolean expected"; + if (message.progress != null && message.hasOwnProperty("progress")) { + if (!Array.isArray(message.progress)) + return "progress: array expected"; + for (var i = 0; i < message.progress.length; ++i) { + var error = $root.google.spanner.admin.database.v1.OperationProgress.verify(message.progress[i]); + if (error) + return "progress." + error; + } + } + if (message.actions != null && message.hasOwnProperty("actions")) { + if (!Array.isArray(message.actions)) + return "actions: array expected"; + for (var i = 0; i < message.actions.length; ++i) { + var error = $root.google.spanner.admin.database.v1.DdlStatementActionInfo.verify(message.actions[i]); + if (error) + return "actions." + error; + } + } + return null; + }; + + /** + * Creates an UpdateDatabaseDdlMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata} UpdateDatabaseDdlMetadata + */ + UpdateDatabaseDdlMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata) + return object; + var message = new $root.google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata(); + if (object.database != null) + message.database = String(object.database); + if (object.statements) { + if (!Array.isArray(object.statements)) + throw TypeError(".google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata.statements: array expected"); + message.statements = []; + for (var i = 0; i < object.statements.length; ++i) + message.statements[i] = String(object.statements[i]); + } + if (object.commitTimestamps) { + if (!Array.isArray(object.commitTimestamps)) + throw TypeError(".google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata.commitTimestamps: array expected"); + message.commitTimestamps = []; + for (var i = 0; i < object.commitTimestamps.length; ++i) { + if (typeof object.commitTimestamps[i] !== "object") + throw TypeError(".google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata.commitTimestamps: object expected"); + message.commitTimestamps[i] = $root.google.protobuf.Timestamp.fromObject(object.commitTimestamps[i]); + } + } + if (object.throttled != null) + message.throttled = Boolean(object.throttled); + if (object.progress) { + if (!Array.isArray(object.progress)) + throw TypeError(".google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata.progress: array expected"); + message.progress = []; + for (var i = 0; i < object.progress.length; ++i) { + if (typeof object.progress[i] !== "object") + throw TypeError(".google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata.progress: object expected"); + message.progress[i] = $root.google.spanner.admin.database.v1.OperationProgress.fromObject(object.progress[i]); + } + } + if (object.actions) { + if (!Array.isArray(object.actions)) + throw TypeError(".google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata.actions: array expected"); + message.actions = []; + for (var i = 0; i < object.actions.length; ++i) { + if (typeof object.actions[i] !== "object") + throw TypeError(".google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata.actions: object expected"); + message.actions[i] = $root.google.spanner.admin.database.v1.DdlStatementActionInfo.fromObject(object.actions[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an UpdateDatabaseDdlMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata + * @static + * @param {google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata} message UpdateDatabaseDdlMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateDatabaseDdlMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.statements = []; + object.commitTimestamps = []; + object.progress = []; + object.actions = []; + } + if (options.defaults) { + object.database = ""; + object.throttled = false; + } + if (message.database != null && message.hasOwnProperty("database")) + object.database = message.database; + if (message.statements && message.statements.length) { + object.statements = []; + for (var j = 0; j < message.statements.length; ++j) + object.statements[j] = message.statements[j]; + } + if (message.commitTimestamps && message.commitTimestamps.length) { + object.commitTimestamps = []; + for (var j = 0; j < message.commitTimestamps.length; ++j) + object.commitTimestamps[j] = $root.google.protobuf.Timestamp.toObject(message.commitTimestamps[j], options); + } + if (message.throttled != null && message.hasOwnProperty("throttled")) + object.throttled = message.throttled; + if (message.progress && message.progress.length) { + object.progress = []; + for (var j = 0; j < message.progress.length; ++j) + object.progress[j] = $root.google.spanner.admin.database.v1.OperationProgress.toObject(message.progress[j], options); + } + if (message.actions && message.actions.length) { + object.actions = []; + for (var j = 0; j < message.actions.length; ++j) + object.actions[j] = $root.google.spanner.admin.database.v1.DdlStatementActionInfo.toObject(message.actions[j], options); + } + return object; + }; + + /** + * Converts this UpdateDatabaseDdlMetadata to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata + * @instance + * @returns {Object.} JSON object + */ + UpdateDatabaseDdlMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateDatabaseDdlMetadata + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateDatabaseDdlMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata"; + }; + + return UpdateDatabaseDdlMetadata; + })(); + + v1.DropDatabaseRequest = (function() { + + /** + * Properties of a DropDatabaseRequest. + * @memberof google.spanner.admin.database.v1 + * @interface IDropDatabaseRequest + * @property {string|null} [database] DropDatabaseRequest database + */ + + /** + * Constructs a new DropDatabaseRequest. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents a DropDatabaseRequest. + * @implements IDropDatabaseRequest + * @constructor + * @param {google.spanner.admin.database.v1.IDropDatabaseRequest=} [properties] Properties to set + */ + function DropDatabaseRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DropDatabaseRequest database. + * @member {string} database + * @memberof google.spanner.admin.database.v1.DropDatabaseRequest + * @instance + */ + DropDatabaseRequest.prototype.database = ""; + + /** + * Creates a new DropDatabaseRequest instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.DropDatabaseRequest + * @static + * @param {google.spanner.admin.database.v1.IDropDatabaseRequest=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.DropDatabaseRequest} DropDatabaseRequest instance + */ + DropDatabaseRequest.create = function create(properties) { + return new DropDatabaseRequest(properties); + }; + + /** + * Encodes the specified DropDatabaseRequest message. Does not implicitly {@link google.spanner.admin.database.v1.DropDatabaseRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.DropDatabaseRequest + * @static + * @param {google.spanner.admin.database.v1.IDropDatabaseRequest} message DropDatabaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DropDatabaseRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.database != null && Object.hasOwnProperty.call(message, "database")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.database); + return writer; + }; + + /** + * Encodes the specified DropDatabaseRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.DropDatabaseRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.DropDatabaseRequest + * @static + * @param {google.spanner.admin.database.v1.IDropDatabaseRequest} message DropDatabaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DropDatabaseRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DropDatabaseRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.DropDatabaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.DropDatabaseRequest} DropDatabaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DropDatabaseRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.DropDatabaseRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.database = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DropDatabaseRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.DropDatabaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.DropDatabaseRequest} DropDatabaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DropDatabaseRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DropDatabaseRequest message. + * @function verify + * @memberof google.spanner.admin.database.v1.DropDatabaseRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DropDatabaseRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.database != null && message.hasOwnProperty("database")) + if (!$util.isString(message.database)) + return "database: string expected"; + return null; + }; + + /** + * Creates a DropDatabaseRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.DropDatabaseRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.DropDatabaseRequest} DropDatabaseRequest + */ + DropDatabaseRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.DropDatabaseRequest) + return object; + var message = new $root.google.spanner.admin.database.v1.DropDatabaseRequest(); + if (object.database != null) + message.database = String(object.database); + return message; + }; + + /** + * Creates a plain object from a DropDatabaseRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.DropDatabaseRequest + * @static + * @param {google.spanner.admin.database.v1.DropDatabaseRequest} message DropDatabaseRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DropDatabaseRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.database = ""; + if (message.database != null && message.hasOwnProperty("database")) + object.database = message.database; + return object; + }; + + /** + * Converts this DropDatabaseRequest to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.DropDatabaseRequest + * @instance + * @returns {Object.} JSON object + */ + DropDatabaseRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DropDatabaseRequest + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.DropDatabaseRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DropDatabaseRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.DropDatabaseRequest"; + }; + + return DropDatabaseRequest; + })(); + + v1.GetDatabaseDdlRequest = (function() { + + /** + * Properties of a GetDatabaseDdlRequest. + * @memberof google.spanner.admin.database.v1 + * @interface IGetDatabaseDdlRequest + * @property {string|null} [database] GetDatabaseDdlRequest database + */ + + /** + * Constructs a new GetDatabaseDdlRequest. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents a GetDatabaseDdlRequest. + * @implements IGetDatabaseDdlRequest + * @constructor + * @param {google.spanner.admin.database.v1.IGetDatabaseDdlRequest=} [properties] Properties to set + */ + function GetDatabaseDdlRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetDatabaseDdlRequest database. + * @member {string} database + * @memberof google.spanner.admin.database.v1.GetDatabaseDdlRequest + * @instance + */ + GetDatabaseDdlRequest.prototype.database = ""; + + /** + * Creates a new GetDatabaseDdlRequest instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.GetDatabaseDdlRequest + * @static + * @param {google.spanner.admin.database.v1.IGetDatabaseDdlRequest=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.GetDatabaseDdlRequest} GetDatabaseDdlRequest instance + */ + GetDatabaseDdlRequest.create = function create(properties) { + return new GetDatabaseDdlRequest(properties); + }; + + /** + * Encodes the specified GetDatabaseDdlRequest message. Does not implicitly {@link google.spanner.admin.database.v1.GetDatabaseDdlRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.GetDatabaseDdlRequest + * @static + * @param {google.spanner.admin.database.v1.IGetDatabaseDdlRequest} message GetDatabaseDdlRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDatabaseDdlRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.database != null && Object.hasOwnProperty.call(message, "database")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.database); + return writer; + }; + + /** + * Encodes the specified GetDatabaseDdlRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.GetDatabaseDdlRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.GetDatabaseDdlRequest + * @static + * @param {google.spanner.admin.database.v1.IGetDatabaseDdlRequest} message GetDatabaseDdlRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDatabaseDdlRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDatabaseDdlRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.GetDatabaseDdlRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.GetDatabaseDdlRequest} GetDatabaseDdlRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDatabaseDdlRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.GetDatabaseDdlRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.database = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetDatabaseDdlRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.GetDatabaseDdlRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.GetDatabaseDdlRequest} GetDatabaseDdlRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDatabaseDdlRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDatabaseDdlRequest message. + * @function verify + * @memberof google.spanner.admin.database.v1.GetDatabaseDdlRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDatabaseDdlRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.database != null && message.hasOwnProperty("database")) + if (!$util.isString(message.database)) + return "database: string expected"; + return null; + }; + + /** + * Creates a GetDatabaseDdlRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.GetDatabaseDdlRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.GetDatabaseDdlRequest} GetDatabaseDdlRequest + */ + GetDatabaseDdlRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.GetDatabaseDdlRequest) + return object; + var message = new $root.google.spanner.admin.database.v1.GetDatabaseDdlRequest(); + if (object.database != null) + message.database = String(object.database); + return message; + }; + + /** + * Creates a plain object from a GetDatabaseDdlRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.GetDatabaseDdlRequest + * @static + * @param {google.spanner.admin.database.v1.GetDatabaseDdlRequest} message GetDatabaseDdlRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDatabaseDdlRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.database = ""; + if (message.database != null && message.hasOwnProperty("database")) + object.database = message.database; + return object; + }; + + /** + * Converts this GetDatabaseDdlRequest to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.GetDatabaseDdlRequest + * @instance + * @returns {Object.} JSON object + */ + GetDatabaseDdlRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetDatabaseDdlRequest + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.GetDatabaseDdlRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetDatabaseDdlRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.GetDatabaseDdlRequest"; + }; + + return GetDatabaseDdlRequest; + })(); + + v1.GetDatabaseDdlResponse = (function() { + + /** + * Properties of a GetDatabaseDdlResponse. + * @memberof google.spanner.admin.database.v1 + * @interface IGetDatabaseDdlResponse + * @property {Array.|null} [statements] GetDatabaseDdlResponse statements + * @property {Uint8Array|null} [protoDescriptors] GetDatabaseDdlResponse protoDescriptors + */ + + /** + * Constructs a new GetDatabaseDdlResponse. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents a GetDatabaseDdlResponse. + * @implements IGetDatabaseDdlResponse + * @constructor + * @param {google.spanner.admin.database.v1.IGetDatabaseDdlResponse=} [properties] Properties to set + */ + function GetDatabaseDdlResponse(properties) { + this.statements = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetDatabaseDdlResponse statements. + * @member {Array.} statements + * @memberof google.spanner.admin.database.v1.GetDatabaseDdlResponse + * @instance + */ + GetDatabaseDdlResponse.prototype.statements = $util.emptyArray; + + /** + * GetDatabaseDdlResponse protoDescriptors. + * @member {Uint8Array} protoDescriptors + * @memberof google.spanner.admin.database.v1.GetDatabaseDdlResponse + * @instance + */ + GetDatabaseDdlResponse.prototype.protoDescriptors = $util.newBuffer([]); + + /** + * Creates a new GetDatabaseDdlResponse instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.GetDatabaseDdlResponse + * @static + * @param {google.spanner.admin.database.v1.IGetDatabaseDdlResponse=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.GetDatabaseDdlResponse} GetDatabaseDdlResponse instance + */ + GetDatabaseDdlResponse.create = function create(properties) { + return new GetDatabaseDdlResponse(properties); + }; + + /** + * Encodes the specified GetDatabaseDdlResponse message. Does not implicitly {@link google.spanner.admin.database.v1.GetDatabaseDdlResponse.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.GetDatabaseDdlResponse + * @static + * @param {google.spanner.admin.database.v1.IGetDatabaseDdlResponse} message GetDatabaseDdlResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDatabaseDdlResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.statements != null && message.statements.length) + for (var i = 0; i < message.statements.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.statements[i]); + if (message.protoDescriptors != null && Object.hasOwnProperty.call(message, "protoDescriptors")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.protoDescriptors); + return writer; + }; + + /** + * Encodes the specified GetDatabaseDdlResponse message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.GetDatabaseDdlResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.GetDatabaseDdlResponse + * @static + * @param {google.spanner.admin.database.v1.IGetDatabaseDdlResponse} message GetDatabaseDdlResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDatabaseDdlResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDatabaseDdlResponse message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.GetDatabaseDdlResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.GetDatabaseDdlResponse} GetDatabaseDdlResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDatabaseDdlResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.GetDatabaseDdlResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.statements && message.statements.length)) + message.statements = []; + message.statements.push(reader.string()); + break; + } + case 2: { + message.protoDescriptors = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetDatabaseDdlResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.GetDatabaseDdlResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.GetDatabaseDdlResponse} GetDatabaseDdlResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDatabaseDdlResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDatabaseDdlResponse message. + * @function verify + * @memberof google.spanner.admin.database.v1.GetDatabaseDdlResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDatabaseDdlResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.statements != null && message.hasOwnProperty("statements")) { + if (!Array.isArray(message.statements)) + return "statements: array expected"; + for (var i = 0; i < message.statements.length; ++i) + if (!$util.isString(message.statements[i])) + return "statements: string[] expected"; + } + if (message.protoDescriptors != null && message.hasOwnProperty("protoDescriptors")) + if (!(message.protoDescriptors && typeof message.protoDescriptors.length === "number" || $util.isString(message.protoDescriptors))) + return "protoDescriptors: buffer expected"; + return null; + }; + + /** + * Creates a GetDatabaseDdlResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.GetDatabaseDdlResponse + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.GetDatabaseDdlResponse} GetDatabaseDdlResponse + */ + GetDatabaseDdlResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.GetDatabaseDdlResponse) + return object; + var message = new $root.google.spanner.admin.database.v1.GetDatabaseDdlResponse(); + if (object.statements) { + if (!Array.isArray(object.statements)) + throw TypeError(".google.spanner.admin.database.v1.GetDatabaseDdlResponse.statements: array expected"); + message.statements = []; + for (var i = 0; i < object.statements.length; ++i) + message.statements[i] = String(object.statements[i]); + } + if (object.protoDescriptors != null) + if (typeof object.protoDescriptors === "string") + $util.base64.decode(object.protoDescriptors, message.protoDescriptors = $util.newBuffer($util.base64.length(object.protoDescriptors)), 0); + else if (object.protoDescriptors.length >= 0) + message.protoDescriptors = object.protoDescriptors; + return message; + }; + + /** + * Creates a plain object from a GetDatabaseDdlResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.GetDatabaseDdlResponse + * @static + * @param {google.spanner.admin.database.v1.GetDatabaseDdlResponse} message GetDatabaseDdlResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDatabaseDdlResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.statements = []; + if (options.defaults) + if (options.bytes === String) + object.protoDescriptors = ""; + else { + object.protoDescriptors = []; + if (options.bytes !== Array) + object.protoDescriptors = $util.newBuffer(object.protoDescriptors); + } + if (message.statements && message.statements.length) { + object.statements = []; + for (var j = 0; j < message.statements.length; ++j) + object.statements[j] = message.statements[j]; + } + if (message.protoDescriptors != null && message.hasOwnProperty("protoDescriptors")) + object.protoDescriptors = options.bytes === String ? $util.base64.encode(message.protoDescriptors, 0, message.protoDescriptors.length) : options.bytes === Array ? Array.prototype.slice.call(message.protoDescriptors) : message.protoDescriptors; + return object; + }; + + /** + * Converts this GetDatabaseDdlResponse to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.GetDatabaseDdlResponse + * @instance + * @returns {Object.} JSON object + */ + GetDatabaseDdlResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetDatabaseDdlResponse + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.GetDatabaseDdlResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetDatabaseDdlResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.GetDatabaseDdlResponse"; + }; + + return GetDatabaseDdlResponse; + })(); + + v1.ListDatabaseOperationsRequest = (function() { + + /** + * Properties of a ListDatabaseOperationsRequest. + * @memberof google.spanner.admin.database.v1 + * @interface IListDatabaseOperationsRequest + * @property {string|null} [parent] ListDatabaseOperationsRequest parent + * @property {string|null} [filter] ListDatabaseOperationsRequest filter + * @property {number|null} [pageSize] ListDatabaseOperationsRequest pageSize + * @property {string|null} [pageToken] ListDatabaseOperationsRequest pageToken + */ + + /** + * Constructs a new ListDatabaseOperationsRequest. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents a ListDatabaseOperationsRequest. + * @implements IListDatabaseOperationsRequest + * @constructor + * @param {google.spanner.admin.database.v1.IListDatabaseOperationsRequest=} [properties] Properties to set + */ + function ListDatabaseOperationsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListDatabaseOperationsRequest parent. + * @member {string} parent + * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsRequest + * @instance + */ + ListDatabaseOperationsRequest.prototype.parent = ""; + + /** + * ListDatabaseOperationsRequest filter. + * @member {string} filter + * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsRequest + * @instance + */ + ListDatabaseOperationsRequest.prototype.filter = ""; + + /** + * ListDatabaseOperationsRequest pageSize. + * @member {number} pageSize + * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsRequest + * @instance + */ + ListDatabaseOperationsRequest.prototype.pageSize = 0; + + /** + * ListDatabaseOperationsRequest pageToken. + * @member {string} pageToken + * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsRequest + * @instance + */ + ListDatabaseOperationsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListDatabaseOperationsRequest instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsRequest + * @static + * @param {google.spanner.admin.database.v1.IListDatabaseOperationsRequest=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.ListDatabaseOperationsRequest} ListDatabaseOperationsRequest instance + */ + ListDatabaseOperationsRequest.create = function create(properties) { + return new ListDatabaseOperationsRequest(properties); + }; + + /** + * Encodes the specified ListDatabaseOperationsRequest message. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabaseOperationsRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsRequest + * @static + * @param {google.spanner.admin.database.v1.IListDatabaseOperationsRequest} message ListDatabaseOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDatabaseOperationsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListDatabaseOperationsRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabaseOperationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsRequest + * @static + * @param {google.spanner.admin.database.v1.IListDatabaseOperationsRequest} message ListDatabaseOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDatabaseOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDatabaseOperationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.ListDatabaseOperationsRequest} ListDatabaseOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDatabaseOperationsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.ListDatabaseOperationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.filter = reader.string(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListDatabaseOperationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.ListDatabaseOperationsRequest} ListDatabaseOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDatabaseOperationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDatabaseOperationsRequest message. + * @function verify + * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDatabaseOperationsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.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 ListDatabaseOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.ListDatabaseOperationsRequest} ListDatabaseOperationsRequest + */ + ListDatabaseOperationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.ListDatabaseOperationsRequest) + return object; + var message = new $root.google.spanner.admin.database.v1.ListDatabaseOperationsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListDatabaseOperationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsRequest + * @static + * @param {google.spanner.admin.database.v1.ListDatabaseOperationsRequest} message ListDatabaseOperationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDatabaseOperationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListDatabaseOperationsRequest to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListDatabaseOperationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDatabaseOperationsRequest + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDatabaseOperationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.ListDatabaseOperationsRequest"; + }; + + return ListDatabaseOperationsRequest; + })(); + + v1.ListDatabaseOperationsResponse = (function() { + + /** + * Properties of a ListDatabaseOperationsResponse. + * @memberof google.spanner.admin.database.v1 + * @interface IListDatabaseOperationsResponse + * @property {Array.|null} [operations] ListDatabaseOperationsResponse operations + * @property {string|null} [nextPageToken] ListDatabaseOperationsResponse nextPageToken + */ + + /** + * Constructs a new ListDatabaseOperationsResponse. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents a ListDatabaseOperationsResponse. + * @implements IListDatabaseOperationsResponse + * @constructor + * @param {google.spanner.admin.database.v1.IListDatabaseOperationsResponse=} [properties] Properties to set + */ + function ListDatabaseOperationsResponse(properties) { + this.operations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListDatabaseOperationsResponse operations. + * @member {Array.} operations + * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsResponse + * @instance + */ + ListDatabaseOperationsResponse.prototype.operations = $util.emptyArray; + + /** + * ListDatabaseOperationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsResponse + * @instance + */ + ListDatabaseOperationsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListDatabaseOperationsResponse instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsResponse + * @static + * @param {google.spanner.admin.database.v1.IListDatabaseOperationsResponse=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.ListDatabaseOperationsResponse} ListDatabaseOperationsResponse instance + */ + ListDatabaseOperationsResponse.create = function create(properties) { + return new ListDatabaseOperationsResponse(properties); + }; + + /** + * Encodes the specified ListDatabaseOperationsResponse message. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabaseOperationsResponse.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsResponse + * @static + * @param {google.spanner.admin.database.v1.IListDatabaseOperationsResponse} message ListDatabaseOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDatabaseOperationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.operations != null && message.operations.length) + for (var i = 0; i < message.operations.length; ++i) + $root.google.longrunning.Operation.encode(message.operations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListDatabaseOperationsResponse message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabaseOperationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsResponse + * @static + * @param {google.spanner.admin.database.v1.IListDatabaseOperationsResponse} message ListDatabaseOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDatabaseOperationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDatabaseOperationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.ListDatabaseOperationsResponse} ListDatabaseOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDatabaseOperationsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.ListDatabaseOperationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.operations && message.operations.length)) + message.operations = []; + message.operations.push($root.google.longrunning.Operation.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListDatabaseOperationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.ListDatabaseOperationsResponse} ListDatabaseOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDatabaseOperationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDatabaseOperationsResponse message. + * @function verify + * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDatabaseOperationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.operations != null && message.hasOwnProperty("operations")) { + if (!Array.isArray(message.operations)) + return "operations: array expected"; + for (var i = 0; i < message.operations.length; ++i) { + var error = $root.google.longrunning.Operation.verify(message.operations[i]); + if (error) + return "operations." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListDatabaseOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.ListDatabaseOperationsResponse} ListDatabaseOperationsResponse + */ + ListDatabaseOperationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.ListDatabaseOperationsResponse) + return object; + var message = new $root.google.spanner.admin.database.v1.ListDatabaseOperationsResponse(); + if (object.operations) { + if (!Array.isArray(object.operations)) + throw TypeError(".google.spanner.admin.database.v1.ListDatabaseOperationsResponse.operations: array expected"); + message.operations = []; + for (var i = 0; i < object.operations.length; ++i) { + if (typeof object.operations[i] !== "object") + throw TypeError(".google.spanner.admin.database.v1.ListDatabaseOperationsResponse.operations: object expected"); + message.operations[i] = $root.google.longrunning.Operation.fromObject(object.operations[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListDatabaseOperationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsResponse + * @static + * @param {google.spanner.admin.database.v1.ListDatabaseOperationsResponse} message ListDatabaseOperationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDatabaseOperationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.operations = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.operations && message.operations.length) { + object.operations = []; + for (var j = 0; j < message.operations.length; ++j) + object.operations[j] = $root.google.longrunning.Operation.toObject(message.operations[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListDatabaseOperationsResponse to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsResponse + * @instance + * @returns {Object.} JSON object + */ + ListDatabaseOperationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDatabaseOperationsResponse + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDatabaseOperationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.ListDatabaseOperationsResponse"; + }; + + return ListDatabaseOperationsResponse; + })(); + + v1.RestoreDatabaseRequest = (function() { + + /** + * Properties of a RestoreDatabaseRequest. + * @memberof google.spanner.admin.database.v1 + * @interface IRestoreDatabaseRequest + * @property {string|null} [parent] RestoreDatabaseRequest parent + * @property {string|null} [databaseId] RestoreDatabaseRequest databaseId + * @property {string|null} [backup] RestoreDatabaseRequest backup + * @property {google.spanner.admin.database.v1.IRestoreDatabaseEncryptionConfig|null} [encryptionConfig] RestoreDatabaseRequest encryptionConfig + */ + + /** + * Constructs a new RestoreDatabaseRequest. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents a RestoreDatabaseRequest. + * @implements IRestoreDatabaseRequest + * @constructor + * @param {google.spanner.admin.database.v1.IRestoreDatabaseRequest=} [properties] Properties to set + */ + function RestoreDatabaseRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RestoreDatabaseRequest parent. + * @member {string} parent + * @memberof google.spanner.admin.database.v1.RestoreDatabaseRequest + * @instance + */ + RestoreDatabaseRequest.prototype.parent = ""; + + /** + * RestoreDatabaseRequest databaseId. + * @member {string} databaseId + * @memberof google.spanner.admin.database.v1.RestoreDatabaseRequest + * @instance + */ + RestoreDatabaseRequest.prototype.databaseId = ""; + + /** + * RestoreDatabaseRequest backup. + * @member {string|null|undefined} backup + * @memberof google.spanner.admin.database.v1.RestoreDatabaseRequest + * @instance + */ + RestoreDatabaseRequest.prototype.backup = null; + + /** + * RestoreDatabaseRequest encryptionConfig. + * @member {google.spanner.admin.database.v1.IRestoreDatabaseEncryptionConfig|null|undefined} encryptionConfig + * @memberof google.spanner.admin.database.v1.RestoreDatabaseRequest + * @instance + */ + RestoreDatabaseRequest.prototype.encryptionConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RestoreDatabaseRequest source. + * @member {"backup"|undefined} source + * @memberof google.spanner.admin.database.v1.RestoreDatabaseRequest + * @instance + */ + Object.defineProperty(RestoreDatabaseRequest.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["backup"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RestoreDatabaseRequest instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.RestoreDatabaseRequest + * @static + * @param {google.spanner.admin.database.v1.IRestoreDatabaseRequest=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.RestoreDatabaseRequest} RestoreDatabaseRequest instance + */ + RestoreDatabaseRequest.create = function create(properties) { + return new RestoreDatabaseRequest(properties); + }; + + /** + * Encodes the specified RestoreDatabaseRequest message. Does not implicitly {@link google.spanner.admin.database.v1.RestoreDatabaseRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.RestoreDatabaseRequest + * @static + * @param {google.spanner.admin.database.v1.IRestoreDatabaseRequest} message RestoreDatabaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreDatabaseRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.databaseId != null && Object.hasOwnProperty.call(message, "databaseId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.databaseId); + if (message.backup != null && Object.hasOwnProperty.call(message, "backup")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.backup); + if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) + $root.google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RestoreDatabaseRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.RestoreDatabaseRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.RestoreDatabaseRequest + * @static + * @param {google.spanner.admin.database.v1.IRestoreDatabaseRequest} message RestoreDatabaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreDatabaseRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RestoreDatabaseRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.RestoreDatabaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.RestoreDatabaseRequest} RestoreDatabaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreDatabaseRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.RestoreDatabaseRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.databaseId = reader.string(); + break; + } + case 3: { + message.backup = reader.string(); + break; + } + case 4: { + message.encryptionConfig = $root.google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RestoreDatabaseRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.RestoreDatabaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.RestoreDatabaseRequest} RestoreDatabaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreDatabaseRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RestoreDatabaseRequest message. + * @function verify + * @memberof google.spanner.admin.database.v1.RestoreDatabaseRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RestoreDatabaseRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.databaseId != null && message.hasOwnProperty("databaseId")) + if (!$util.isString(message.databaseId)) + return "databaseId: string expected"; + if (message.backup != null && message.hasOwnProperty("backup")) { + properties.source = 1; + if (!$util.isString(message.backup)) + return "backup: string expected"; + } + if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { + var error = $root.google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.verify(message.encryptionConfig); + if (error) + return "encryptionConfig." + error; + } + return null; + }; + + /** + * Creates a RestoreDatabaseRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.RestoreDatabaseRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.RestoreDatabaseRequest} RestoreDatabaseRequest + */ + RestoreDatabaseRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.RestoreDatabaseRequest) + return object; + var message = new $root.google.spanner.admin.database.v1.RestoreDatabaseRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.databaseId != null) + message.databaseId = String(object.databaseId); + if (object.backup != null) + message.backup = String(object.backup); + if (object.encryptionConfig != null) { + if (typeof object.encryptionConfig !== "object") + throw TypeError(".google.spanner.admin.database.v1.RestoreDatabaseRequest.encryptionConfig: object expected"); + message.encryptionConfig = $root.google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.fromObject(object.encryptionConfig); + } + return message; + }; + + /** + * Creates a plain object from a RestoreDatabaseRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.RestoreDatabaseRequest + * @static + * @param {google.spanner.admin.database.v1.RestoreDatabaseRequest} message RestoreDatabaseRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RestoreDatabaseRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.databaseId = ""; + object.encryptionConfig = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.databaseId != null && message.hasOwnProperty("databaseId")) + object.databaseId = message.databaseId; + if (message.backup != null && message.hasOwnProperty("backup")) { + object.backup = message.backup; + if (options.oneofs) + object.source = "backup"; + } + if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) + object.encryptionConfig = $root.google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.toObject(message.encryptionConfig, options); + return object; + }; + + /** + * Converts this RestoreDatabaseRequest to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.RestoreDatabaseRequest + * @instance + * @returns {Object.} JSON object + */ + RestoreDatabaseRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RestoreDatabaseRequest + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.RestoreDatabaseRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RestoreDatabaseRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.RestoreDatabaseRequest"; + }; + + return RestoreDatabaseRequest; + })(); + + v1.RestoreDatabaseEncryptionConfig = (function() { + + /** + * Properties of a RestoreDatabaseEncryptionConfig. + * @memberof google.spanner.admin.database.v1 + * @interface IRestoreDatabaseEncryptionConfig + * @property {google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.EncryptionType|null} [encryptionType] RestoreDatabaseEncryptionConfig encryptionType + * @property {string|null} [kmsKeyName] RestoreDatabaseEncryptionConfig kmsKeyName + * @property {Array.|null} [kmsKeyNames] RestoreDatabaseEncryptionConfig kmsKeyNames + */ + + /** + * Constructs a new RestoreDatabaseEncryptionConfig. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents a RestoreDatabaseEncryptionConfig. + * @implements IRestoreDatabaseEncryptionConfig + * @constructor + * @param {google.spanner.admin.database.v1.IRestoreDatabaseEncryptionConfig=} [properties] Properties to set + */ + function RestoreDatabaseEncryptionConfig(properties) { + this.kmsKeyNames = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RestoreDatabaseEncryptionConfig encryptionType. + * @member {google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.EncryptionType} encryptionType + * @memberof google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig + * @instance + */ + RestoreDatabaseEncryptionConfig.prototype.encryptionType = 0; + + /** + * RestoreDatabaseEncryptionConfig kmsKeyName. + * @member {string} kmsKeyName + * @memberof google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig + * @instance + */ + RestoreDatabaseEncryptionConfig.prototype.kmsKeyName = ""; + + /** + * RestoreDatabaseEncryptionConfig kmsKeyNames. + * @member {Array.} kmsKeyNames + * @memberof google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig + * @instance + */ + RestoreDatabaseEncryptionConfig.prototype.kmsKeyNames = $util.emptyArray; + + /** + * Creates a new RestoreDatabaseEncryptionConfig instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig + * @static + * @param {google.spanner.admin.database.v1.IRestoreDatabaseEncryptionConfig=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig} RestoreDatabaseEncryptionConfig instance + */ + RestoreDatabaseEncryptionConfig.create = function create(properties) { + return new RestoreDatabaseEncryptionConfig(properties); + }; + + /** + * Encodes the specified RestoreDatabaseEncryptionConfig message. Does not implicitly {@link google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig + * @static + * @param {google.spanner.admin.database.v1.IRestoreDatabaseEncryptionConfig} message RestoreDatabaseEncryptionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreDatabaseEncryptionConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.encryptionType != null && Object.hasOwnProperty.call(message, "encryptionType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.encryptionType); + if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.kmsKeyName); + if (message.kmsKeyNames != null && message.kmsKeyNames.length) + for (var i = 0; i < message.kmsKeyNames.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.kmsKeyNames[i]); + return writer; + }; + + /** + * Encodes the specified RestoreDatabaseEncryptionConfig message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig + * @static + * @param {google.spanner.admin.database.v1.IRestoreDatabaseEncryptionConfig} message RestoreDatabaseEncryptionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreDatabaseEncryptionConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RestoreDatabaseEncryptionConfig message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig} RestoreDatabaseEncryptionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreDatabaseEncryptionConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.encryptionType = reader.int32(); + break; + } + case 2: { + message.kmsKeyName = reader.string(); + break; + } + case 3: { + if (!(message.kmsKeyNames && message.kmsKeyNames.length)) + message.kmsKeyNames = []; + message.kmsKeyNames.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RestoreDatabaseEncryptionConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig} RestoreDatabaseEncryptionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreDatabaseEncryptionConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RestoreDatabaseEncryptionConfig message. + * @function verify + * @memberof google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RestoreDatabaseEncryptionConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.encryptionType != null && message.hasOwnProperty("encryptionType")) + switch (message.encryptionType) { + default: + return "encryptionType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + if (!$util.isString(message.kmsKeyName)) + return "kmsKeyName: string expected"; + if (message.kmsKeyNames != null && message.hasOwnProperty("kmsKeyNames")) { + if (!Array.isArray(message.kmsKeyNames)) + return "kmsKeyNames: array expected"; + for (var i = 0; i < message.kmsKeyNames.length; ++i) + if (!$util.isString(message.kmsKeyNames[i])) + return "kmsKeyNames: string[] expected"; + } + return null; + }; + + /** + * Creates a RestoreDatabaseEncryptionConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig} RestoreDatabaseEncryptionConfig + */ + RestoreDatabaseEncryptionConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig) + return object; + var message = new $root.google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig(); + switch (object.encryptionType) { + default: + if (typeof object.encryptionType === "number") { + message.encryptionType = object.encryptionType; + break; + } + break; + case "ENCRYPTION_TYPE_UNSPECIFIED": + case 0: + message.encryptionType = 0; + break; + case "USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION": + case 1: + message.encryptionType = 1; + break; + case "GOOGLE_DEFAULT_ENCRYPTION": + case 2: + message.encryptionType = 2; + break; + case "CUSTOMER_MANAGED_ENCRYPTION": + case 3: + message.encryptionType = 3; + break; + } + if (object.kmsKeyName != null) + message.kmsKeyName = String(object.kmsKeyName); + if (object.kmsKeyNames) { + if (!Array.isArray(object.kmsKeyNames)) + throw TypeError(".google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.kmsKeyNames: array expected"); + message.kmsKeyNames = []; + for (var i = 0; i < object.kmsKeyNames.length; ++i) + message.kmsKeyNames[i] = String(object.kmsKeyNames[i]); + } + return message; + }; + + /** + * Creates a plain object from a RestoreDatabaseEncryptionConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig + * @static + * @param {google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig} message RestoreDatabaseEncryptionConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RestoreDatabaseEncryptionConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.kmsKeyNames = []; + if (options.defaults) { + object.encryptionType = options.enums === String ? "ENCRYPTION_TYPE_UNSPECIFIED" : 0; + object.kmsKeyName = ""; + } + if (message.encryptionType != null && message.hasOwnProperty("encryptionType")) + object.encryptionType = options.enums === String ? $root.google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.EncryptionType[message.encryptionType] === undefined ? message.encryptionType : $root.google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.EncryptionType[message.encryptionType] : message.encryptionType; + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + object.kmsKeyName = message.kmsKeyName; + if (message.kmsKeyNames && message.kmsKeyNames.length) { + object.kmsKeyNames = []; + for (var j = 0; j < message.kmsKeyNames.length; ++j) + object.kmsKeyNames[j] = message.kmsKeyNames[j]; + } + return object; + }; + + /** + * Converts this RestoreDatabaseEncryptionConfig to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig + * @instance + * @returns {Object.} JSON object + */ + RestoreDatabaseEncryptionConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RestoreDatabaseEncryptionConfig + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RestoreDatabaseEncryptionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig"; + }; + + /** + * EncryptionType enum. + * @name google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.EncryptionType + * @enum {number} + * @property {number} ENCRYPTION_TYPE_UNSPECIFIED=0 ENCRYPTION_TYPE_UNSPECIFIED value + * @property {number} USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION=1 USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION value + * @property {number} GOOGLE_DEFAULT_ENCRYPTION=2 GOOGLE_DEFAULT_ENCRYPTION value + * @property {number} CUSTOMER_MANAGED_ENCRYPTION=3 CUSTOMER_MANAGED_ENCRYPTION value + */ + RestoreDatabaseEncryptionConfig.EncryptionType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENCRYPTION_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION"] = 1; + values[valuesById[2] = "GOOGLE_DEFAULT_ENCRYPTION"] = 2; + values[valuesById[3] = "CUSTOMER_MANAGED_ENCRYPTION"] = 3; + return values; + })(); + + return RestoreDatabaseEncryptionConfig; + })(); + + v1.RestoreDatabaseMetadata = (function() { + + /** + * Properties of a RestoreDatabaseMetadata. + * @memberof google.spanner.admin.database.v1 + * @interface IRestoreDatabaseMetadata + * @property {string|null} [name] RestoreDatabaseMetadata name + * @property {google.spanner.admin.database.v1.RestoreSourceType|null} [sourceType] RestoreDatabaseMetadata sourceType + * @property {google.spanner.admin.database.v1.IBackupInfo|null} [backupInfo] RestoreDatabaseMetadata backupInfo + * @property {google.spanner.admin.database.v1.IOperationProgress|null} [progress] RestoreDatabaseMetadata progress + * @property {google.protobuf.ITimestamp|null} [cancelTime] RestoreDatabaseMetadata cancelTime + * @property {string|null} [optimizeDatabaseOperationName] RestoreDatabaseMetadata optimizeDatabaseOperationName + */ + + /** + * Constructs a new RestoreDatabaseMetadata. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents a RestoreDatabaseMetadata. + * @implements IRestoreDatabaseMetadata + * @constructor + * @param {google.spanner.admin.database.v1.IRestoreDatabaseMetadata=} [properties] Properties to set + */ + function RestoreDatabaseMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RestoreDatabaseMetadata name. + * @member {string} name + * @memberof google.spanner.admin.database.v1.RestoreDatabaseMetadata + * @instance + */ + RestoreDatabaseMetadata.prototype.name = ""; + + /** + * RestoreDatabaseMetadata sourceType. + * @member {google.spanner.admin.database.v1.RestoreSourceType} sourceType + * @memberof google.spanner.admin.database.v1.RestoreDatabaseMetadata + * @instance + */ + RestoreDatabaseMetadata.prototype.sourceType = 0; + + /** + * RestoreDatabaseMetadata backupInfo. + * @member {google.spanner.admin.database.v1.IBackupInfo|null|undefined} backupInfo + * @memberof google.spanner.admin.database.v1.RestoreDatabaseMetadata + * @instance + */ + RestoreDatabaseMetadata.prototype.backupInfo = null; + + /** + * RestoreDatabaseMetadata progress. + * @member {google.spanner.admin.database.v1.IOperationProgress|null|undefined} progress + * @memberof google.spanner.admin.database.v1.RestoreDatabaseMetadata + * @instance + */ + RestoreDatabaseMetadata.prototype.progress = null; + + /** + * RestoreDatabaseMetadata cancelTime. + * @member {google.protobuf.ITimestamp|null|undefined} cancelTime + * @memberof google.spanner.admin.database.v1.RestoreDatabaseMetadata + * @instance + */ + RestoreDatabaseMetadata.prototype.cancelTime = null; + + /** + * RestoreDatabaseMetadata optimizeDatabaseOperationName. + * @member {string} optimizeDatabaseOperationName + * @memberof google.spanner.admin.database.v1.RestoreDatabaseMetadata + * @instance + */ + RestoreDatabaseMetadata.prototype.optimizeDatabaseOperationName = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RestoreDatabaseMetadata sourceInfo. + * @member {"backupInfo"|undefined} sourceInfo + * @memberof google.spanner.admin.database.v1.RestoreDatabaseMetadata + * @instance + */ + Object.defineProperty(RestoreDatabaseMetadata.prototype, "sourceInfo", { + get: $util.oneOfGetter($oneOfFields = ["backupInfo"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RestoreDatabaseMetadata instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.RestoreDatabaseMetadata + * @static + * @param {google.spanner.admin.database.v1.IRestoreDatabaseMetadata=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.RestoreDatabaseMetadata} RestoreDatabaseMetadata instance + */ + RestoreDatabaseMetadata.create = function create(properties) { + return new RestoreDatabaseMetadata(properties); + }; + + /** + * Encodes the specified RestoreDatabaseMetadata message. Does not implicitly {@link google.spanner.admin.database.v1.RestoreDatabaseMetadata.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.RestoreDatabaseMetadata + * @static + * @param {google.spanner.admin.database.v1.IRestoreDatabaseMetadata} message RestoreDatabaseMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreDatabaseMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.sourceType != null && Object.hasOwnProperty.call(message, "sourceType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.sourceType); + if (message.backupInfo != null && Object.hasOwnProperty.call(message, "backupInfo")) + $root.google.spanner.admin.database.v1.BackupInfo.encode(message.backupInfo, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.progress != null && Object.hasOwnProperty.call(message, "progress")) + $root.google.spanner.admin.database.v1.OperationProgress.encode(message.progress, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.cancelTime != null && Object.hasOwnProperty.call(message, "cancelTime")) + $root.google.protobuf.Timestamp.encode(message.cancelTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.optimizeDatabaseOperationName != null && Object.hasOwnProperty.call(message, "optimizeDatabaseOperationName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.optimizeDatabaseOperationName); + return writer; + }; + + /** + * Encodes the specified RestoreDatabaseMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.RestoreDatabaseMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.RestoreDatabaseMetadata + * @static + * @param {google.spanner.admin.database.v1.IRestoreDatabaseMetadata} message RestoreDatabaseMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreDatabaseMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RestoreDatabaseMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.RestoreDatabaseMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.RestoreDatabaseMetadata} RestoreDatabaseMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreDatabaseMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.RestoreDatabaseMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.sourceType = reader.int32(); + break; + } + case 3: { + message.backupInfo = $root.google.spanner.admin.database.v1.BackupInfo.decode(reader, reader.uint32()); + break; + } + case 4: { + message.progress = $root.google.spanner.admin.database.v1.OperationProgress.decode(reader, reader.uint32()); + break; + } + case 5: { + message.cancelTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.optimizeDatabaseOperationName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RestoreDatabaseMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.RestoreDatabaseMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.RestoreDatabaseMetadata} RestoreDatabaseMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreDatabaseMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RestoreDatabaseMetadata message. + * @function verify + * @memberof google.spanner.admin.database.v1.RestoreDatabaseMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RestoreDatabaseMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.sourceType != null && message.hasOwnProperty("sourceType")) + switch (message.sourceType) { + default: + return "sourceType: enum value expected"; + case 0: + case 1: + break; + } + if (message.backupInfo != null && message.hasOwnProperty("backupInfo")) { + properties.sourceInfo = 1; + { + var error = $root.google.spanner.admin.database.v1.BackupInfo.verify(message.backupInfo); + if (error) + return "backupInfo." + error; + } + } + if (message.progress != null && message.hasOwnProperty("progress")) { + var error = $root.google.spanner.admin.database.v1.OperationProgress.verify(message.progress); + if (error) + return "progress." + error; + } + if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.cancelTime); + if (error) + return "cancelTime." + error; + } + if (message.optimizeDatabaseOperationName != null && message.hasOwnProperty("optimizeDatabaseOperationName")) + if (!$util.isString(message.optimizeDatabaseOperationName)) + return "optimizeDatabaseOperationName: string expected"; + return null; + }; + + /** + * Creates a RestoreDatabaseMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.RestoreDatabaseMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.RestoreDatabaseMetadata} RestoreDatabaseMetadata + */ + RestoreDatabaseMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.RestoreDatabaseMetadata) + return object; + var message = new $root.google.spanner.admin.database.v1.RestoreDatabaseMetadata(); + if (object.name != null) + message.name = String(object.name); + switch (object.sourceType) { + default: + if (typeof object.sourceType === "number") { + message.sourceType = object.sourceType; + break; + } + break; + case "TYPE_UNSPECIFIED": + case 0: + message.sourceType = 0; + break; + case "BACKUP": + case 1: + message.sourceType = 1; + break; + } + if (object.backupInfo != null) { + if (typeof object.backupInfo !== "object") + throw TypeError(".google.spanner.admin.database.v1.RestoreDatabaseMetadata.backupInfo: object expected"); + message.backupInfo = $root.google.spanner.admin.database.v1.BackupInfo.fromObject(object.backupInfo); + } + if (object.progress != null) { + if (typeof object.progress !== "object") + throw TypeError(".google.spanner.admin.database.v1.RestoreDatabaseMetadata.progress: object expected"); + message.progress = $root.google.spanner.admin.database.v1.OperationProgress.fromObject(object.progress); + } + if (object.cancelTime != null) { + if (typeof object.cancelTime !== "object") + throw TypeError(".google.spanner.admin.database.v1.RestoreDatabaseMetadata.cancelTime: object expected"); + message.cancelTime = $root.google.protobuf.Timestamp.fromObject(object.cancelTime); + } + if (object.optimizeDatabaseOperationName != null) + message.optimizeDatabaseOperationName = String(object.optimizeDatabaseOperationName); + return message; + }; + + /** + * Creates a plain object from a RestoreDatabaseMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.RestoreDatabaseMetadata + * @static + * @param {google.spanner.admin.database.v1.RestoreDatabaseMetadata} message RestoreDatabaseMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RestoreDatabaseMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.sourceType = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.progress = null; + object.cancelTime = null; + object.optimizeDatabaseOperationName = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.sourceType != null && message.hasOwnProperty("sourceType")) + object.sourceType = options.enums === String ? $root.google.spanner.admin.database.v1.RestoreSourceType[message.sourceType] === undefined ? message.sourceType : $root.google.spanner.admin.database.v1.RestoreSourceType[message.sourceType] : message.sourceType; + if (message.backupInfo != null && message.hasOwnProperty("backupInfo")) { + object.backupInfo = $root.google.spanner.admin.database.v1.BackupInfo.toObject(message.backupInfo, options); + if (options.oneofs) + object.sourceInfo = "backupInfo"; + } + if (message.progress != null && message.hasOwnProperty("progress")) + object.progress = $root.google.spanner.admin.database.v1.OperationProgress.toObject(message.progress, options); + if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) + object.cancelTime = $root.google.protobuf.Timestamp.toObject(message.cancelTime, options); + if (message.optimizeDatabaseOperationName != null && message.hasOwnProperty("optimizeDatabaseOperationName")) + object.optimizeDatabaseOperationName = message.optimizeDatabaseOperationName; + return object; + }; + + /** + * Converts this RestoreDatabaseMetadata to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.RestoreDatabaseMetadata + * @instance + * @returns {Object.} JSON object + */ + RestoreDatabaseMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RestoreDatabaseMetadata + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.RestoreDatabaseMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RestoreDatabaseMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.RestoreDatabaseMetadata"; + }; + + return RestoreDatabaseMetadata; + })(); + + v1.OptimizeRestoredDatabaseMetadata = (function() { + + /** + * Properties of an OptimizeRestoredDatabaseMetadata. + * @memberof google.spanner.admin.database.v1 + * @interface IOptimizeRestoredDatabaseMetadata + * @property {string|null} [name] OptimizeRestoredDatabaseMetadata name + * @property {google.spanner.admin.database.v1.IOperationProgress|null} [progress] OptimizeRestoredDatabaseMetadata progress + */ + + /** + * Constructs a new OptimizeRestoredDatabaseMetadata. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents an OptimizeRestoredDatabaseMetadata. + * @implements IOptimizeRestoredDatabaseMetadata + * @constructor + * @param {google.spanner.admin.database.v1.IOptimizeRestoredDatabaseMetadata=} [properties] Properties to set + */ + function OptimizeRestoredDatabaseMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OptimizeRestoredDatabaseMetadata name. + * @member {string} name + * @memberof google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata + * @instance + */ + OptimizeRestoredDatabaseMetadata.prototype.name = ""; + + /** + * OptimizeRestoredDatabaseMetadata progress. + * @member {google.spanner.admin.database.v1.IOperationProgress|null|undefined} progress + * @memberof google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata + * @instance + */ + OptimizeRestoredDatabaseMetadata.prototype.progress = null; + + /** + * Creates a new OptimizeRestoredDatabaseMetadata instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata + * @static + * @param {google.spanner.admin.database.v1.IOptimizeRestoredDatabaseMetadata=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata} OptimizeRestoredDatabaseMetadata instance + */ + OptimizeRestoredDatabaseMetadata.create = function create(properties) { + return new OptimizeRestoredDatabaseMetadata(properties); + }; + + /** + * Encodes the specified OptimizeRestoredDatabaseMetadata message. Does not implicitly {@link google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata + * @static + * @param {google.spanner.admin.database.v1.IOptimizeRestoredDatabaseMetadata} message OptimizeRestoredDatabaseMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OptimizeRestoredDatabaseMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.progress != null && Object.hasOwnProperty.call(message, "progress")) + $root.google.spanner.admin.database.v1.OperationProgress.encode(message.progress, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OptimizeRestoredDatabaseMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata + * @static + * @param {google.spanner.admin.database.v1.IOptimizeRestoredDatabaseMetadata} message OptimizeRestoredDatabaseMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OptimizeRestoredDatabaseMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OptimizeRestoredDatabaseMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata} OptimizeRestoredDatabaseMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OptimizeRestoredDatabaseMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.progress = $root.google.spanner.admin.database.v1.OperationProgress.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OptimizeRestoredDatabaseMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata} OptimizeRestoredDatabaseMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OptimizeRestoredDatabaseMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OptimizeRestoredDatabaseMetadata message. + * @function verify + * @memberof google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OptimizeRestoredDatabaseMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.progress != null && message.hasOwnProperty("progress")) { + var error = $root.google.spanner.admin.database.v1.OperationProgress.verify(message.progress); + if (error) + return "progress." + error; + } + return null; + }; + + /** + * Creates an OptimizeRestoredDatabaseMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata} OptimizeRestoredDatabaseMetadata + */ + OptimizeRestoredDatabaseMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata) + return object; + var message = new $root.google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata(); + if (object.name != null) + message.name = String(object.name); + if (object.progress != null) { + if (typeof object.progress !== "object") + throw TypeError(".google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata.progress: object expected"); + message.progress = $root.google.spanner.admin.database.v1.OperationProgress.fromObject(object.progress); + } + return message; + }; + + /** + * Creates a plain object from an OptimizeRestoredDatabaseMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata + * @static + * @param {google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata} message OptimizeRestoredDatabaseMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OptimizeRestoredDatabaseMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.progress = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.progress != null && message.hasOwnProperty("progress")) + object.progress = $root.google.spanner.admin.database.v1.OperationProgress.toObject(message.progress, options); + return object; + }; + + /** + * Converts this OptimizeRestoredDatabaseMetadata to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata + * @instance + * @returns {Object.} JSON object + */ + OptimizeRestoredDatabaseMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OptimizeRestoredDatabaseMetadata + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OptimizeRestoredDatabaseMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata"; + }; + + return OptimizeRestoredDatabaseMetadata; + })(); + + /** + * RestoreSourceType enum. + * @name google.spanner.admin.database.v1.RestoreSourceType + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} BACKUP=1 BACKUP value + */ + v1.RestoreSourceType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "BACKUP"] = 1; + return values; + })(); + + v1.DatabaseRole = (function() { + + /** + * Properties of a DatabaseRole. + * @memberof google.spanner.admin.database.v1 + * @interface IDatabaseRole + * @property {string|null} [name] DatabaseRole name + */ + + /** + * Constructs a new DatabaseRole. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents a DatabaseRole. + * @implements IDatabaseRole + * @constructor + * @param {google.spanner.admin.database.v1.IDatabaseRole=} [properties] Properties to set + */ + function DatabaseRole(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DatabaseRole name. + * @member {string} name + * @memberof google.spanner.admin.database.v1.DatabaseRole + * @instance + */ + DatabaseRole.prototype.name = ""; + + /** + * Creates a new DatabaseRole instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.DatabaseRole + * @static + * @param {google.spanner.admin.database.v1.IDatabaseRole=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.DatabaseRole} DatabaseRole instance + */ + DatabaseRole.create = function create(properties) { + return new DatabaseRole(properties); + }; + + /** + * Encodes the specified DatabaseRole message. Does not implicitly {@link google.spanner.admin.database.v1.DatabaseRole.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.DatabaseRole + * @static + * @param {google.spanner.admin.database.v1.IDatabaseRole} message DatabaseRole message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DatabaseRole.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DatabaseRole message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.DatabaseRole.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.DatabaseRole + * @static + * @param {google.spanner.admin.database.v1.IDatabaseRole} message DatabaseRole message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DatabaseRole.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DatabaseRole message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.DatabaseRole + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.DatabaseRole} DatabaseRole + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DatabaseRole.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.DatabaseRole(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DatabaseRole message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.DatabaseRole + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.DatabaseRole} DatabaseRole + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DatabaseRole.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DatabaseRole message. + * @function verify + * @memberof google.spanner.admin.database.v1.DatabaseRole + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DatabaseRole.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 DatabaseRole message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.DatabaseRole + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.DatabaseRole} DatabaseRole + */ + DatabaseRole.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.DatabaseRole) + return object; + var message = new $root.google.spanner.admin.database.v1.DatabaseRole(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DatabaseRole message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.DatabaseRole + * @static + * @param {google.spanner.admin.database.v1.DatabaseRole} message DatabaseRole + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DatabaseRole.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 DatabaseRole to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.DatabaseRole + * @instance + * @returns {Object.} JSON object + */ + DatabaseRole.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DatabaseRole + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.DatabaseRole + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DatabaseRole.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.DatabaseRole"; + }; + + return DatabaseRole; + })(); + + v1.ListDatabaseRolesRequest = (function() { + + /** + * Properties of a ListDatabaseRolesRequest. + * @memberof google.spanner.admin.database.v1 + * @interface IListDatabaseRolesRequest + * @property {string|null} [parent] ListDatabaseRolesRequest parent + * @property {number|null} [pageSize] ListDatabaseRolesRequest pageSize + * @property {string|null} [pageToken] ListDatabaseRolesRequest pageToken + */ + + /** + * Constructs a new ListDatabaseRolesRequest. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents a ListDatabaseRolesRequest. + * @implements IListDatabaseRolesRequest + * @constructor + * @param {google.spanner.admin.database.v1.IListDatabaseRolesRequest=} [properties] Properties to set + */ + function ListDatabaseRolesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListDatabaseRolesRequest parent. + * @member {string} parent + * @memberof google.spanner.admin.database.v1.ListDatabaseRolesRequest + * @instance + */ + ListDatabaseRolesRequest.prototype.parent = ""; + + /** + * ListDatabaseRolesRequest pageSize. + * @member {number} pageSize + * @memberof google.spanner.admin.database.v1.ListDatabaseRolesRequest + * @instance + */ + ListDatabaseRolesRequest.prototype.pageSize = 0; + + /** + * ListDatabaseRolesRequest pageToken. + * @member {string} pageToken + * @memberof google.spanner.admin.database.v1.ListDatabaseRolesRequest + * @instance + */ + ListDatabaseRolesRequest.prototype.pageToken = ""; + + /** + * Creates a new ListDatabaseRolesRequest instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.ListDatabaseRolesRequest + * @static + * @param {google.spanner.admin.database.v1.IListDatabaseRolesRequest=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.ListDatabaseRolesRequest} ListDatabaseRolesRequest instance + */ + ListDatabaseRolesRequest.create = function create(properties) { + return new ListDatabaseRolesRequest(properties); + }; + + /** + * Encodes the specified ListDatabaseRolesRequest message. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabaseRolesRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.ListDatabaseRolesRequest + * @static + * @param {google.spanner.admin.database.v1.IListDatabaseRolesRequest} message ListDatabaseRolesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDatabaseRolesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListDatabaseRolesRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabaseRolesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.ListDatabaseRolesRequest + * @static + * @param {google.spanner.admin.database.v1.IListDatabaseRolesRequest} message ListDatabaseRolesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDatabaseRolesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDatabaseRolesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.ListDatabaseRolesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.ListDatabaseRolesRequest} ListDatabaseRolesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDatabaseRolesRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.ListDatabaseRolesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListDatabaseRolesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.ListDatabaseRolesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.ListDatabaseRolesRequest} ListDatabaseRolesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDatabaseRolesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDatabaseRolesRequest message. + * @function verify + * @memberof google.spanner.admin.database.v1.ListDatabaseRolesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDatabaseRolesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListDatabaseRolesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.ListDatabaseRolesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.ListDatabaseRolesRequest} ListDatabaseRolesRequest + */ + ListDatabaseRolesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.ListDatabaseRolesRequest) + return object; + var message = new $root.google.spanner.admin.database.v1.ListDatabaseRolesRequest(); + 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 ListDatabaseRolesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.ListDatabaseRolesRequest + * @static + * @param {google.spanner.admin.database.v1.ListDatabaseRolesRequest} message ListDatabaseRolesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDatabaseRolesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListDatabaseRolesRequest to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.ListDatabaseRolesRequest + * @instance + * @returns {Object.} JSON object + */ + ListDatabaseRolesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDatabaseRolesRequest + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.ListDatabaseRolesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDatabaseRolesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.ListDatabaseRolesRequest"; + }; + + return ListDatabaseRolesRequest; + })(); + + v1.ListDatabaseRolesResponse = (function() { + + /** + * Properties of a ListDatabaseRolesResponse. + * @memberof google.spanner.admin.database.v1 + * @interface IListDatabaseRolesResponse + * @property {Array.|null} [databaseRoles] ListDatabaseRolesResponse databaseRoles + * @property {string|null} [nextPageToken] ListDatabaseRolesResponse nextPageToken + */ + + /** + * Constructs a new ListDatabaseRolesResponse. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents a ListDatabaseRolesResponse. + * @implements IListDatabaseRolesResponse + * @constructor + * @param {google.spanner.admin.database.v1.IListDatabaseRolesResponse=} [properties] Properties to set + */ + function ListDatabaseRolesResponse(properties) { + this.databaseRoles = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListDatabaseRolesResponse databaseRoles. + * @member {Array.} databaseRoles + * @memberof google.spanner.admin.database.v1.ListDatabaseRolesResponse + * @instance + */ + ListDatabaseRolesResponse.prototype.databaseRoles = $util.emptyArray; + + /** + * ListDatabaseRolesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.spanner.admin.database.v1.ListDatabaseRolesResponse + * @instance + */ + ListDatabaseRolesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListDatabaseRolesResponse instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.ListDatabaseRolesResponse + * @static + * @param {google.spanner.admin.database.v1.IListDatabaseRolesResponse=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.ListDatabaseRolesResponse} ListDatabaseRolesResponse instance + */ + ListDatabaseRolesResponse.create = function create(properties) { + return new ListDatabaseRolesResponse(properties); + }; + + /** + * Encodes the specified ListDatabaseRolesResponse message. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabaseRolesResponse.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.ListDatabaseRolesResponse + * @static + * @param {google.spanner.admin.database.v1.IListDatabaseRolesResponse} message ListDatabaseRolesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDatabaseRolesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.databaseRoles != null && message.databaseRoles.length) + for (var i = 0; i < message.databaseRoles.length; ++i) + $root.google.spanner.admin.database.v1.DatabaseRole.encode(message.databaseRoles[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListDatabaseRolesResponse message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabaseRolesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.ListDatabaseRolesResponse + * @static + * @param {google.spanner.admin.database.v1.IListDatabaseRolesResponse} message ListDatabaseRolesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDatabaseRolesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDatabaseRolesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.ListDatabaseRolesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.ListDatabaseRolesResponse} ListDatabaseRolesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDatabaseRolesResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.ListDatabaseRolesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.databaseRoles && message.databaseRoles.length)) + message.databaseRoles = []; + message.databaseRoles.push($root.google.spanner.admin.database.v1.DatabaseRole.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListDatabaseRolesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.ListDatabaseRolesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.ListDatabaseRolesResponse} ListDatabaseRolesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDatabaseRolesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDatabaseRolesResponse message. + * @function verify + * @memberof google.spanner.admin.database.v1.ListDatabaseRolesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDatabaseRolesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.databaseRoles != null && message.hasOwnProperty("databaseRoles")) { + if (!Array.isArray(message.databaseRoles)) + return "databaseRoles: array expected"; + for (var i = 0; i < message.databaseRoles.length; ++i) { + var error = $root.google.spanner.admin.database.v1.DatabaseRole.verify(message.databaseRoles[i]); + if (error) + return "databaseRoles." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListDatabaseRolesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.ListDatabaseRolesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.ListDatabaseRolesResponse} ListDatabaseRolesResponse + */ + ListDatabaseRolesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.ListDatabaseRolesResponse) + return object; + var message = new $root.google.spanner.admin.database.v1.ListDatabaseRolesResponse(); + if (object.databaseRoles) { + if (!Array.isArray(object.databaseRoles)) + throw TypeError(".google.spanner.admin.database.v1.ListDatabaseRolesResponse.databaseRoles: array expected"); + message.databaseRoles = []; + for (var i = 0; i < object.databaseRoles.length; ++i) { + if (typeof object.databaseRoles[i] !== "object") + throw TypeError(".google.spanner.admin.database.v1.ListDatabaseRolesResponse.databaseRoles: object expected"); + message.databaseRoles[i] = $root.google.spanner.admin.database.v1.DatabaseRole.fromObject(object.databaseRoles[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListDatabaseRolesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.ListDatabaseRolesResponse + * @static + * @param {google.spanner.admin.database.v1.ListDatabaseRolesResponse} message ListDatabaseRolesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDatabaseRolesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.databaseRoles = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.databaseRoles && message.databaseRoles.length) { + object.databaseRoles = []; + for (var j = 0; j < message.databaseRoles.length; ++j) + object.databaseRoles[j] = $root.google.spanner.admin.database.v1.DatabaseRole.toObject(message.databaseRoles[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListDatabaseRolesResponse to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.ListDatabaseRolesResponse + * @instance + * @returns {Object.} JSON object + */ + ListDatabaseRolesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDatabaseRolesResponse + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.ListDatabaseRolesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDatabaseRolesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.ListDatabaseRolesResponse"; + }; + + return ListDatabaseRolesResponse; + })(); + + v1.AddSplitPointsRequest = (function() { + + /** + * Properties of an AddSplitPointsRequest. + * @memberof google.spanner.admin.database.v1 + * @interface IAddSplitPointsRequest + * @property {string|null} [database] AddSplitPointsRequest database + * @property {Array.|null} [splitPoints] AddSplitPointsRequest splitPoints + * @property {string|null} [initiator] AddSplitPointsRequest initiator + */ + + /** + * Constructs a new AddSplitPointsRequest. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents an AddSplitPointsRequest. + * @implements IAddSplitPointsRequest + * @constructor + * @param {google.spanner.admin.database.v1.IAddSplitPointsRequest=} [properties] Properties to set + */ + function AddSplitPointsRequest(properties) { + this.splitPoints = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AddSplitPointsRequest database. + * @member {string} database + * @memberof google.spanner.admin.database.v1.AddSplitPointsRequest + * @instance + */ + AddSplitPointsRequest.prototype.database = ""; + + /** + * AddSplitPointsRequest splitPoints. + * @member {Array.} splitPoints + * @memberof google.spanner.admin.database.v1.AddSplitPointsRequest + * @instance + */ + AddSplitPointsRequest.prototype.splitPoints = $util.emptyArray; + + /** + * AddSplitPointsRequest initiator. + * @member {string} initiator + * @memberof google.spanner.admin.database.v1.AddSplitPointsRequest + * @instance + */ + AddSplitPointsRequest.prototype.initiator = ""; + + /** + * Creates a new AddSplitPointsRequest instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.AddSplitPointsRequest + * @static + * @param {google.spanner.admin.database.v1.IAddSplitPointsRequest=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.AddSplitPointsRequest} AddSplitPointsRequest instance + */ + AddSplitPointsRequest.create = function create(properties) { + return new AddSplitPointsRequest(properties); + }; + + /** + * Encodes the specified AddSplitPointsRequest message. Does not implicitly {@link google.spanner.admin.database.v1.AddSplitPointsRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.AddSplitPointsRequest + * @static + * @param {google.spanner.admin.database.v1.IAddSplitPointsRequest} message AddSplitPointsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AddSplitPointsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.database != null && Object.hasOwnProperty.call(message, "database")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.database); + if (message.splitPoints != null && message.splitPoints.length) + for (var i = 0; i < message.splitPoints.length; ++i) + $root.google.spanner.admin.database.v1.SplitPoints.encode(message.splitPoints[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.initiator != null && Object.hasOwnProperty.call(message, "initiator")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.initiator); + return writer; + }; + + /** + * Encodes the specified AddSplitPointsRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.AddSplitPointsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.AddSplitPointsRequest + * @static + * @param {google.spanner.admin.database.v1.IAddSplitPointsRequest} message AddSplitPointsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AddSplitPointsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AddSplitPointsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.AddSplitPointsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.AddSplitPointsRequest} AddSplitPointsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AddSplitPointsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.AddSplitPointsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.database = reader.string(); + break; + } + case 2: { + if (!(message.splitPoints && message.splitPoints.length)) + message.splitPoints = []; + message.splitPoints.push($root.google.spanner.admin.database.v1.SplitPoints.decode(reader, reader.uint32())); + break; + } + case 3: { + message.initiator = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AddSplitPointsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.AddSplitPointsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.AddSplitPointsRequest} AddSplitPointsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AddSplitPointsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AddSplitPointsRequest message. + * @function verify + * @memberof google.spanner.admin.database.v1.AddSplitPointsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AddSplitPointsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.database != null && message.hasOwnProperty("database")) + if (!$util.isString(message.database)) + return "database: string expected"; + if (message.splitPoints != null && message.hasOwnProperty("splitPoints")) { + if (!Array.isArray(message.splitPoints)) + return "splitPoints: array expected"; + for (var i = 0; i < message.splitPoints.length; ++i) { + var error = $root.google.spanner.admin.database.v1.SplitPoints.verify(message.splitPoints[i]); + if (error) + return "splitPoints." + error; + } + } + if (message.initiator != null && message.hasOwnProperty("initiator")) + if (!$util.isString(message.initiator)) + return "initiator: string expected"; + return null; + }; + + /** + * Creates an AddSplitPointsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.AddSplitPointsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.AddSplitPointsRequest} AddSplitPointsRequest + */ + AddSplitPointsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.AddSplitPointsRequest) + return object; + var message = new $root.google.spanner.admin.database.v1.AddSplitPointsRequest(); + if (object.database != null) + message.database = String(object.database); + if (object.splitPoints) { + if (!Array.isArray(object.splitPoints)) + throw TypeError(".google.spanner.admin.database.v1.AddSplitPointsRequest.splitPoints: array expected"); + message.splitPoints = []; + for (var i = 0; i < object.splitPoints.length; ++i) { + if (typeof object.splitPoints[i] !== "object") + throw TypeError(".google.spanner.admin.database.v1.AddSplitPointsRequest.splitPoints: object expected"); + message.splitPoints[i] = $root.google.spanner.admin.database.v1.SplitPoints.fromObject(object.splitPoints[i]); + } + } + if (object.initiator != null) + message.initiator = String(object.initiator); + return message; + }; + + /** + * Creates a plain object from an AddSplitPointsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.AddSplitPointsRequest + * @static + * @param {google.spanner.admin.database.v1.AddSplitPointsRequest} message AddSplitPointsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AddSplitPointsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.splitPoints = []; + if (options.defaults) { + object.database = ""; + object.initiator = ""; + } + if (message.database != null && message.hasOwnProperty("database")) + object.database = message.database; + if (message.splitPoints && message.splitPoints.length) { + object.splitPoints = []; + for (var j = 0; j < message.splitPoints.length; ++j) + object.splitPoints[j] = $root.google.spanner.admin.database.v1.SplitPoints.toObject(message.splitPoints[j], options); + } + if (message.initiator != null && message.hasOwnProperty("initiator")) + object.initiator = message.initiator; + return object; + }; + + /** + * Converts this AddSplitPointsRequest to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.AddSplitPointsRequest + * @instance + * @returns {Object.} JSON object + */ + AddSplitPointsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AddSplitPointsRequest + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.AddSplitPointsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AddSplitPointsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.AddSplitPointsRequest"; + }; + + return AddSplitPointsRequest; + })(); + + v1.AddSplitPointsResponse = (function() { + + /** + * Properties of an AddSplitPointsResponse. + * @memberof google.spanner.admin.database.v1 + * @interface IAddSplitPointsResponse + */ + + /** + * Constructs a new AddSplitPointsResponse. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents an AddSplitPointsResponse. + * @implements IAddSplitPointsResponse + * @constructor + * @param {google.spanner.admin.database.v1.IAddSplitPointsResponse=} [properties] Properties to set + */ + function AddSplitPointsResponse(properties) { + if (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 AddSplitPointsResponse instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.AddSplitPointsResponse + * @static + * @param {google.spanner.admin.database.v1.IAddSplitPointsResponse=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.AddSplitPointsResponse} AddSplitPointsResponse instance + */ + AddSplitPointsResponse.create = function create(properties) { + return new AddSplitPointsResponse(properties); + }; + + /** + * Encodes the specified AddSplitPointsResponse message. Does not implicitly {@link google.spanner.admin.database.v1.AddSplitPointsResponse.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.AddSplitPointsResponse + * @static + * @param {google.spanner.admin.database.v1.IAddSplitPointsResponse} message AddSplitPointsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AddSplitPointsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified AddSplitPointsResponse message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.AddSplitPointsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.AddSplitPointsResponse + * @static + * @param {google.spanner.admin.database.v1.IAddSplitPointsResponse} message AddSplitPointsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AddSplitPointsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AddSplitPointsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.AddSplitPointsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.AddSplitPointsResponse} AddSplitPointsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AddSplitPointsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.AddSplitPointsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AddSplitPointsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.AddSplitPointsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.AddSplitPointsResponse} AddSplitPointsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AddSplitPointsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AddSplitPointsResponse message. + * @function verify + * @memberof google.spanner.admin.database.v1.AddSplitPointsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AddSplitPointsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an AddSplitPointsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.AddSplitPointsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.AddSplitPointsResponse} AddSplitPointsResponse + */ + AddSplitPointsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.AddSplitPointsResponse) + return object; + return new $root.google.spanner.admin.database.v1.AddSplitPointsResponse(); + }; + + /** + * Creates a plain object from an AddSplitPointsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.AddSplitPointsResponse + * @static + * @param {google.spanner.admin.database.v1.AddSplitPointsResponse} message AddSplitPointsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AddSplitPointsResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this AddSplitPointsResponse to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.AddSplitPointsResponse + * @instance + * @returns {Object.} JSON object + */ + AddSplitPointsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AddSplitPointsResponse + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.AddSplitPointsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AddSplitPointsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.AddSplitPointsResponse"; + }; + + return AddSplitPointsResponse; + })(); + + v1.SplitPoints = (function() { + + /** + * Properties of a SplitPoints. + * @memberof google.spanner.admin.database.v1 + * @interface ISplitPoints + * @property {string|null} [table] SplitPoints table + * @property {string|null} [index] SplitPoints index + * @property {Array.|null} [keys] SplitPoints keys + * @property {google.protobuf.ITimestamp|null} [expireTime] SplitPoints expireTime + */ + + /** + * Constructs a new SplitPoints. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents a SplitPoints. + * @implements ISplitPoints + * @constructor + * @param {google.spanner.admin.database.v1.ISplitPoints=} [properties] Properties to set + */ + function SplitPoints(properties) { + this.keys = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SplitPoints table. + * @member {string} table + * @memberof google.spanner.admin.database.v1.SplitPoints + * @instance + */ + SplitPoints.prototype.table = ""; + + /** + * SplitPoints index. + * @member {string} index + * @memberof google.spanner.admin.database.v1.SplitPoints + * @instance + */ + SplitPoints.prototype.index = ""; + + /** + * SplitPoints keys. + * @member {Array.} keys + * @memberof google.spanner.admin.database.v1.SplitPoints + * @instance + */ + SplitPoints.prototype.keys = $util.emptyArray; + + /** + * SplitPoints expireTime. + * @member {google.protobuf.ITimestamp|null|undefined} expireTime + * @memberof google.spanner.admin.database.v1.SplitPoints + * @instance + */ + SplitPoints.prototype.expireTime = null; + + /** + * Creates a new SplitPoints instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.SplitPoints + * @static + * @param {google.spanner.admin.database.v1.ISplitPoints=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.SplitPoints} SplitPoints instance + */ + SplitPoints.create = function create(properties) { + return new SplitPoints(properties); + }; + + /** + * Encodes the specified SplitPoints message. Does not implicitly {@link google.spanner.admin.database.v1.SplitPoints.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.SplitPoints + * @static + * @param {google.spanner.admin.database.v1.ISplitPoints} message SplitPoints message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SplitPoints.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.table != null && Object.hasOwnProperty.call(message, "table")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.table); + if (message.index != null && Object.hasOwnProperty.call(message, "index")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.index); + if (message.keys != null && message.keys.length) + for (var i = 0; i < message.keys.length; ++i) + $root.google.spanner.admin.database.v1.SplitPoints.Key.encode(message.keys[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) + $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SplitPoints message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.SplitPoints.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.SplitPoints + * @static + * @param {google.spanner.admin.database.v1.ISplitPoints} message SplitPoints message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SplitPoints.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SplitPoints message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.SplitPoints + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.SplitPoints} SplitPoints + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SplitPoints.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.SplitPoints(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.table = reader.string(); + break; + } + case 2: { + message.index = reader.string(); + break; + } + case 3: { + if (!(message.keys && message.keys.length)) + message.keys = []; + message.keys.push($root.google.spanner.admin.database.v1.SplitPoints.Key.decode(reader, reader.uint32())); + break; + } + case 5: { + message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SplitPoints message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.SplitPoints + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.SplitPoints} SplitPoints + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SplitPoints.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SplitPoints message. + * @function verify + * @memberof google.spanner.admin.database.v1.SplitPoints + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SplitPoints.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.table != null && message.hasOwnProperty("table")) + if (!$util.isString(message.table)) + return "table: string expected"; + if (message.index != null && message.hasOwnProperty("index")) + if (!$util.isString(message.index)) + return "index: string expected"; + if (message.keys != null && message.hasOwnProperty("keys")) { + if (!Array.isArray(message.keys)) + return "keys: array expected"; + for (var i = 0; i < message.keys.length; ++i) { + var error = $root.google.spanner.admin.database.v1.SplitPoints.Key.verify(message.keys[i]); + if (error) + return "keys." + error; + } + } + if (message.expireTime != null && message.hasOwnProperty("expireTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.expireTime); + if (error) + return "expireTime." + error; + } + return null; + }; + + /** + * Creates a SplitPoints message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.SplitPoints + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.SplitPoints} SplitPoints + */ + SplitPoints.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.SplitPoints) + return object; + var message = new $root.google.spanner.admin.database.v1.SplitPoints(); + if (object.table != null) + message.table = String(object.table); + if (object.index != null) + message.index = String(object.index); + if (object.keys) { + if (!Array.isArray(object.keys)) + throw TypeError(".google.spanner.admin.database.v1.SplitPoints.keys: array expected"); + message.keys = []; + for (var i = 0; i < object.keys.length; ++i) { + if (typeof object.keys[i] !== "object") + throw TypeError(".google.spanner.admin.database.v1.SplitPoints.keys: object expected"); + message.keys[i] = $root.google.spanner.admin.database.v1.SplitPoints.Key.fromObject(object.keys[i]); + } + } + if (object.expireTime != null) { + if (typeof object.expireTime !== "object") + throw TypeError(".google.spanner.admin.database.v1.SplitPoints.expireTime: object expected"); + message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); + } + return message; + }; + + /** + * Creates a plain object from a SplitPoints message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.SplitPoints + * @static + * @param {google.spanner.admin.database.v1.SplitPoints} message SplitPoints + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SplitPoints.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.keys = []; + if (options.defaults) { + object.table = ""; + object.index = ""; + object.expireTime = null; + } + if (message.table != null && message.hasOwnProperty("table")) + object.table = message.table; + if (message.index != null && message.hasOwnProperty("index")) + object.index = message.index; + if (message.keys && message.keys.length) { + object.keys = []; + for (var j = 0; j < message.keys.length; ++j) + object.keys[j] = $root.google.spanner.admin.database.v1.SplitPoints.Key.toObject(message.keys[j], options); + } + if (message.expireTime != null && message.hasOwnProperty("expireTime")) + object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); + return object; + }; + + /** + * Converts this SplitPoints to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.SplitPoints + * @instance + * @returns {Object.} JSON object + */ + SplitPoints.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SplitPoints + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.SplitPoints + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SplitPoints.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.SplitPoints"; + }; + + SplitPoints.Key = (function() { + + /** + * Properties of a Key. + * @memberof google.spanner.admin.database.v1.SplitPoints + * @interface IKey + * @property {google.protobuf.IListValue|null} [keyParts] Key keyParts + */ + + /** + * Constructs a new Key. + * @memberof google.spanner.admin.database.v1.SplitPoints + * @classdesc Represents a Key. + * @implements IKey + * @constructor + * @param {google.spanner.admin.database.v1.SplitPoints.IKey=} [properties] Properties to set + */ + function Key(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Key keyParts. + * @member {google.protobuf.IListValue|null|undefined} keyParts + * @memberof google.spanner.admin.database.v1.SplitPoints.Key + * @instance + */ + Key.prototype.keyParts = null; + + /** + * Creates a new Key instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.SplitPoints.Key + * @static + * @param {google.spanner.admin.database.v1.SplitPoints.IKey=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.SplitPoints.Key} Key instance + */ + Key.create = function create(properties) { + return new Key(properties); + }; + + /** + * Encodes the specified Key message. Does not implicitly {@link google.spanner.admin.database.v1.SplitPoints.Key.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.SplitPoints.Key + * @static + * @param {google.spanner.admin.database.v1.SplitPoints.IKey} message Key message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Key.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.keyParts != null && Object.hasOwnProperty.call(message, "keyParts")) + $root.google.protobuf.ListValue.encode(message.keyParts, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Key message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.SplitPoints.Key.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.SplitPoints.Key + * @static + * @param {google.spanner.admin.database.v1.SplitPoints.IKey} message Key message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Key.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Key message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.SplitPoints.Key + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.SplitPoints.Key} Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Key.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.SplitPoints.Key(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.keyParts = $root.google.protobuf.ListValue.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Key message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.SplitPoints.Key + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.SplitPoints.Key} Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Key.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Key message. + * @function verify + * @memberof google.spanner.admin.database.v1.SplitPoints.Key + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Key.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.keyParts != null && message.hasOwnProperty("keyParts")) { + var error = $root.google.protobuf.ListValue.verify(message.keyParts); + if (error) + return "keyParts." + error; + } + return null; + }; + + /** + * Creates a Key message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.SplitPoints.Key + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.SplitPoints.Key} Key + */ + Key.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.SplitPoints.Key) + return object; + var message = new $root.google.spanner.admin.database.v1.SplitPoints.Key(); + if (object.keyParts != null) { + if (typeof object.keyParts !== "object") + throw TypeError(".google.spanner.admin.database.v1.SplitPoints.Key.keyParts: object expected"); + message.keyParts = $root.google.protobuf.ListValue.fromObject(object.keyParts); + } + return message; + }; + + /** + * Creates a plain object from a Key message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.SplitPoints.Key + * @static + * @param {google.spanner.admin.database.v1.SplitPoints.Key} message Key + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Key.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.keyParts = null; + if (message.keyParts != null && message.hasOwnProperty("keyParts")) + object.keyParts = $root.google.protobuf.ListValue.toObject(message.keyParts, options); + return object; + }; + + /** + * Converts this Key to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.SplitPoints.Key + * @instance + * @returns {Object.} JSON object + */ + Key.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Key + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.SplitPoints.Key + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Key.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.SplitPoints.Key"; + }; + + return Key; + })(); + + return SplitPoints; + })(); + + v1.InternalUpdateGraphOperationRequest = (function() { + + /** + * Properties of an InternalUpdateGraphOperationRequest. + * @memberof google.spanner.admin.database.v1 + * @interface IInternalUpdateGraphOperationRequest + * @property {string|null} [database] InternalUpdateGraphOperationRequest database + * @property {string|null} [operationId] InternalUpdateGraphOperationRequest operationId + * @property {string|null} [vmIdentityToken] InternalUpdateGraphOperationRequest vmIdentityToken + * @property {number|null} [progress] InternalUpdateGraphOperationRequest progress + * @property {google.rpc.IStatus|null} [status] InternalUpdateGraphOperationRequest status + */ + + /** + * Constructs a new InternalUpdateGraphOperationRequest. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents an InternalUpdateGraphOperationRequest. + * @implements IInternalUpdateGraphOperationRequest + * @constructor + * @param {google.spanner.admin.database.v1.IInternalUpdateGraphOperationRequest=} [properties] Properties to set + */ + function InternalUpdateGraphOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InternalUpdateGraphOperationRequest database. + * @member {string} database + * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest + * @instance + */ + InternalUpdateGraphOperationRequest.prototype.database = ""; + + /** + * InternalUpdateGraphOperationRequest operationId. + * @member {string} operationId + * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest + * @instance + */ + InternalUpdateGraphOperationRequest.prototype.operationId = ""; + + /** + * InternalUpdateGraphOperationRequest vmIdentityToken. + * @member {string} vmIdentityToken + * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest + * @instance + */ + InternalUpdateGraphOperationRequest.prototype.vmIdentityToken = ""; + + /** + * InternalUpdateGraphOperationRequest progress. + * @member {number} progress + * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest + * @instance + */ + InternalUpdateGraphOperationRequest.prototype.progress = 0; + + /** + * InternalUpdateGraphOperationRequest status. + * @member {google.rpc.IStatus|null|undefined} status + * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest + * @instance + */ + InternalUpdateGraphOperationRequest.prototype.status = null; + + /** + * Creates a new InternalUpdateGraphOperationRequest instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest + * @static + * @param {google.spanner.admin.database.v1.IInternalUpdateGraphOperationRequest=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest} InternalUpdateGraphOperationRequest instance + */ + InternalUpdateGraphOperationRequest.create = function create(properties) { + return new InternalUpdateGraphOperationRequest(properties); + }; + + /** + * Encodes the specified InternalUpdateGraphOperationRequest message. Does not implicitly {@link google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest + * @static + * @param {google.spanner.admin.database.v1.IInternalUpdateGraphOperationRequest} message InternalUpdateGraphOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InternalUpdateGraphOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.database != null && Object.hasOwnProperty.call(message, "database")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.database); + if (message.operationId != null && Object.hasOwnProperty.call(message, "operationId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.operationId); + if (message.progress != null && Object.hasOwnProperty.call(message, "progress")) + writer.uint32(/* id 3, wireType 1 =*/25).double(message.progress); + if (message.vmIdentityToken != null && Object.hasOwnProperty.call(message, "vmIdentityToken")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.vmIdentityToken); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + $root.google.rpc.Status.encode(message.status, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InternalUpdateGraphOperationRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest + * @static + * @param {google.spanner.admin.database.v1.IInternalUpdateGraphOperationRequest} message InternalUpdateGraphOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InternalUpdateGraphOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InternalUpdateGraphOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest} InternalUpdateGraphOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InternalUpdateGraphOperationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.database = reader.string(); + break; + } + case 2: { + message.operationId = reader.string(); + break; + } + case 5: { + message.vmIdentityToken = reader.string(); + break; + } + case 3: { + message.progress = reader.double(); + break; + } + case 6: { + message.status = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InternalUpdateGraphOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest} InternalUpdateGraphOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InternalUpdateGraphOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InternalUpdateGraphOperationRequest message. + * @function verify + * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InternalUpdateGraphOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.database != null && message.hasOwnProperty("database")) + if (!$util.isString(message.database)) + return "database: string expected"; + if (message.operationId != null && message.hasOwnProperty("operationId")) + if (!$util.isString(message.operationId)) + return "operationId: string expected"; + if (message.vmIdentityToken != null && message.hasOwnProperty("vmIdentityToken")) + if (!$util.isString(message.vmIdentityToken)) + return "vmIdentityToken: string expected"; + if (message.progress != null && message.hasOwnProperty("progress")) + if (typeof message.progress !== "number") + return "progress: number expected"; + if (message.status != null && message.hasOwnProperty("status")) { + var error = $root.google.rpc.Status.verify(message.status); + if (error) + return "status." + error; + } + return null; + }; + + /** + * Creates an InternalUpdateGraphOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest} InternalUpdateGraphOperationRequest + */ + InternalUpdateGraphOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest) + return object; + var message = new $root.google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest(); + if (object.database != null) + message.database = String(object.database); + if (object.operationId != null) + message.operationId = String(object.operationId); + if (object.vmIdentityToken != null) + message.vmIdentityToken = String(object.vmIdentityToken); + if (object.progress != null) + message.progress = Number(object.progress); + if (object.status != null) { + if (typeof object.status !== "object") + throw TypeError(".google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest.status: object expected"); + message.status = $root.google.rpc.Status.fromObject(object.status); + } + return message; + }; + + /** + * Creates a plain object from an InternalUpdateGraphOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest + * @static + * @param {google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest} message InternalUpdateGraphOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InternalUpdateGraphOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.database = ""; + object.operationId = ""; + object.progress = 0; + object.vmIdentityToken = ""; + object.status = null; + } + if (message.database != null && message.hasOwnProperty("database")) + object.database = message.database; + if (message.operationId != null && message.hasOwnProperty("operationId")) + object.operationId = message.operationId; + if (message.progress != null && message.hasOwnProperty("progress")) + object.progress = options.json && !isFinite(message.progress) ? String(message.progress) : message.progress; + if (message.vmIdentityToken != null && message.hasOwnProperty("vmIdentityToken")) + object.vmIdentityToken = message.vmIdentityToken; + if (message.status != null && message.hasOwnProperty("status")) + object.status = $root.google.rpc.Status.toObject(message.status, options); + return object; + }; + + /** + * Converts this InternalUpdateGraphOperationRequest to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest + * @instance + * @returns {Object.} JSON object + */ + InternalUpdateGraphOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InternalUpdateGraphOperationRequest + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InternalUpdateGraphOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest"; + }; + + return InternalUpdateGraphOperationRequest; + })(); + + v1.InternalUpdateGraphOperationResponse = (function() { + + /** + * Properties of an InternalUpdateGraphOperationResponse. + * @memberof google.spanner.admin.database.v1 + * @interface IInternalUpdateGraphOperationResponse + */ + + /** + * Constructs a new InternalUpdateGraphOperationResponse. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents an InternalUpdateGraphOperationResponse. + * @implements IInternalUpdateGraphOperationResponse + * @constructor + * @param {google.spanner.admin.database.v1.IInternalUpdateGraphOperationResponse=} [properties] Properties to set + */ + function InternalUpdateGraphOperationResponse(properties) { + if (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 InternalUpdateGraphOperationResponse instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse + * @static + * @param {google.spanner.admin.database.v1.IInternalUpdateGraphOperationResponse=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse} InternalUpdateGraphOperationResponse instance + */ + InternalUpdateGraphOperationResponse.create = function create(properties) { + return new InternalUpdateGraphOperationResponse(properties); + }; + + /** + * Encodes the specified InternalUpdateGraphOperationResponse message. Does not implicitly {@link google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse + * @static + * @param {google.spanner.admin.database.v1.IInternalUpdateGraphOperationResponse} message InternalUpdateGraphOperationResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InternalUpdateGraphOperationResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified InternalUpdateGraphOperationResponse message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse + * @static + * @param {google.spanner.admin.database.v1.IInternalUpdateGraphOperationResponse} message InternalUpdateGraphOperationResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InternalUpdateGraphOperationResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InternalUpdateGraphOperationResponse message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse} InternalUpdateGraphOperationResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InternalUpdateGraphOperationResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InternalUpdateGraphOperationResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse} InternalUpdateGraphOperationResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InternalUpdateGraphOperationResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InternalUpdateGraphOperationResponse message. + * @function verify + * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InternalUpdateGraphOperationResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an InternalUpdateGraphOperationResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse} InternalUpdateGraphOperationResponse + */ + InternalUpdateGraphOperationResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse) + return object; + return new $root.google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse(); + }; + + /** + * Creates a plain object from an InternalUpdateGraphOperationResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse + * @static + * @param {google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse} message InternalUpdateGraphOperationResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InternalUpdateGraphOperationResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this InternalUpdateGraphOperationResponse to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse + * @instance + * @returns {Object.} JSON object + */ + InternalUpdateGraphOperationResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InternalUpdateGraphOperationResponse + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InternalUpdateGraphOperationResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse"; + }; + + return InternalUpdateGraphOperationResponse; + })(); + + return v1; + })(); + + return database; + })(); + + return admin; + })(); + + return spanner; + })(); + + google.api = (function() { + + /** + * Namespace api. + * @memberof google + * @namespace + */ + var api = {}; + + /** + * FieldBehavior enum. + * @name google.api.FieldBehavior + * @enum {number} + * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value + * @property {number} OPTIONAL=1 OPTIONAL value + * @property {number} REQUIRED=2 REQUIRED value + * @property {number} OUTPUT_ONLY=3 OUTPUT_ONLY value + * @property {number} INPUT_ONLY=4 INPUT_ONLY value + * @property {number} IMMUTABLE=5 IMMUTABLE value + * @property {number} UNORDERED_LIST=6 UNORDERED_LIST value + * @property {number} NON_EMPTY_DEFAULT=7 NON_EMPTY_DEFAULT value + * @property {number} IDENTIFIER=8 IDENTIFIER value + */ + api.FieldBehavior = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_BEHAVIOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "OPTIONAL"] = 1; + values[valuesById[2] = "REQUIRED"] = 2; + values[valuesById[3] = "OUTPUT_ONLY"] = 3; + values[valuesById[4] = "INPUT_ONLY"] = 4; + values[valuesById[5] = "IMMUTABLE"] = 5; + values[valuesById[6] = "UNORDERED_LIST"] = 6; + values[valuesById[7] = "NON_EMPTY_DEFAULT"] = 7; + values[valuesById[8] = "IDENTIFIER"] = 8; + return values; + })(); + + api.ResourceDescriptor = (function() { + + /** + * Properties of a ResourceDescriptor. + * @memberof google.api + * @interface IResourceDescriptor + * @property {string|null} [type] ResourceDescriptor type + * @property {Array.|null} [pattern] ResourceDescriptor pattern + * @property {string|null} [nameField] ResourceDescriptor nameField + * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history + * @property {string|null} [plural] ResourceDescriptor plural + * @property {string|null} [singular] ResourceDescriptor singular + * @property {Array.|null} [style] ResourceDescriptor style + */ + + /** + * Constructs a new ResourceDescriptor. + * @memberof google.api + * @classdesc Represents a ResourceDescriptor. + * @implements IResourceDescriptor + * @constructor + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + */ + function ResourceDescriptor(properties) { + this.pattern = []; + this.style = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceDescriptor type. + * @member {string} type + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.type = ""; + + /** + * ResourceDescriptor pattern. + * @member {Array.} pattern + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.pattern = $util.emptyArray; + + /** + * ResourceDescriptor nameField. + * @member {string} nameField + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.nameField = ""; + + /** + * ResourceDescriptor history. + * @member {google.api.ResourceDescriptor.History} history + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.history = 0; + + /** + * ResourceDescriptor plural. + * @member {string} plural + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.plural = ""; + + /** + * ResourceDescriptor singular. + * @member {string} singular + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.singular = ""; + + /** + * ResourceDescriptor style. + * @member {Array.} style + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.style = $util.emptyArray; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @function create + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance + */ + ResourceDescriptor.create = function create(properties) { + return new ResourceDescriptor(properties); + }; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.pattern != null && message.pattern.length) + for (var i = 0; i < message.pattern.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pattern[i]); + if (message.nameField != null && Object.hasOwnProperty.call(message, "nameField")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); + if (message.history != null && Object.hasOwnProperty.call(message, "history")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); + if (message.plural != null && Object.hasOwnProperty.call(message, "plural")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); + if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); + if (message.style != null && message.style.length) { + writer.uint32(/* id 10, wireType 2 =*/82).fork(); + for (var i = 0; i < message.style.length; ++i) + writer.int32(message.style[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceDescriptor(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + if (!(message.pattern && message.pattern.length)) + message.pattern = []; + message.pattern.push(reader.string()); + break; + } + case 3: { + message.nameField = reader.string(); + break; + } + case 4: { + message.history = reader.int32(); + break; + } + case 5: { + message.plural = reader.string(); + break; + } + case 6: { + message.singular = reader.string(); + break; + } + case 10: { + if (!(message.style && message.style.length)) + message.style = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.style.push(reader.int32()); + } else + message.style.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceDescriptor message. + * @function verify + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceDescriptor.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.pattern != null && message.hasOwnProperty("pattern")) { + if (!Array.isArray(message.pattern)) + return "pattern: array expected"; + for (var i = 0; i < message.pattern.length; ++i) + if (!$util.isString(message.pattern[i])) + return "pattern: string[] expected"; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + if (!$util.isString(message.nameField)) + return "nameField: string expected"; + if (message.history != null && message.hasOwnProperty("history")) + switch (message.history) { + default: + return "history: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.plural != null && message.hasOwnProperty("plural")) + if (!$util.isString(message.plural)) + return "plural: string expected"; + if (message.singular != null && message.hasOwnProperty("singular")) + if (!$util.isString(message.singular)) + return "singular: string expected"; + if (message.style != null && message.hasOwnProperty("style")) { + if (!Array.isArray(message.style)) + return "style: array expected"; + for (var i = 0; i < message.style.length; ++i) + switch (message.style[i]) { + default: + return "style: enum value[] expected"; + case 0: + case 1: + break; + } + } + return null; + }; + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + */ + ResourceDescriptor.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceDescriptor) + return object; + var message = new $root.google.api.ResourceDescriptor(); + if (object.type != null) + message.type = String(object.type); + if (object.pattern) { + if (!Array.isArray(object.pattern)) + throw TypeError(".google.api.ResourceDescriptor.pattern: array expected"); + message.pattern = []; + for (var i = 0; i < object.pattern.length; ++i) + message.pattern[i] = String(object.pattern[i]); + } + if (object.nameField != null) + message.nameField = String(object.nameField); + switch (object.history) { + default: + if (typeof object.history === "number") { + message.history = object.history; + break; + } + break; + case "HISTORY_UNSPECIFIED": + case 0: + message.history = 0; + break; + case "ORIGINALLY_SINGLE_PATTERN": + case 1: + message.history = 1; + break; + case "FUTURE_MULTI_PATTERN": + case 2: + message.history = 2; + break; + } + if (object.plural != null) + message.plural = String(object.plural); + if (object.singular != null) + message.singular = String(object.singular); + if (object.style) { + if (!Array.isArray(object.style)) + throw TypeError(".google.api.ResourceDescriptor.style: array expected"); + message.style = []; + for (var i = 0; i < object.style.length; ++i) + switch (object.style[i]) { + default: + if (typeof object.style[i] === "number") { + message.style[i] = object.style[i]; + break; + } + case "STYLE_UNSPECIFIED": + case 0: + message.style[i] = 0; + break; + case "DECLARATIVE_FRIENDLY": + case 1: + message.style[i] = 1; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.ResourceDescriptor} message ResourceDescriptor + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceDescriptor.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.pattern = []; + object.style = []; + } + if (options.defaults) { + object.type = ""; + object.nameField = ""; + object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; + object.plural = ""; + object.singular = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.pattern && message.pattern.length) { + object.pattern = []; + for (var j = 0; j < message.pattern.length; ++j) + object.pattern[j] = message.pattern[j]; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + object.nameField = message.nameField; + if (message.history != null && message.hasOwnProperty("history")) + object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] === undefined ? message.history : $root.google.api.ResourceDescriptor.History[message.history] : message.history; + if (message.plural != null && message.hasOwnProperty("plural")) + object.plural = message.plural; + if (message.singular != null && message.hasOwnProperty("singular")) + object.singular = message.singular; + if (message.style && message.style.length) { + object.style = []; + for (var j = 0; j < message.style.length; ++j) + object.style[j] = options.enums === String ? $root.google.api.ResourceDescriptor.Style[message.style[j]] === undefined ? message.style[j] : $root.google.api.ResourceDescriptor.Style[message.style[j]] : message.style[j]; + } + return object; + }; + + /** + * Converts this ResourceDescriptor to JSON. + * @function toJSON + * @memberof google.api.ResourceDescriptor + * @instance + * @returns {Object.} JSON object + */ + ResourceDescriptor.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceDescriptor + * @function getTypeUrl + * @memberof google.api.ResourceDescriptor + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceDescriptor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceDescriptor"; + }; + + /** + * History enum. + * @name google.api.ResourceDescriptor.History + * @enum {number} + * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value + * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value + * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value + */ + ResourceDescriptor.History = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HISTORY_UNSPECIFIED"] = 0; + values[valuesById[1] = "ORIGINALLY_SINGLE_PATTERN"] = 1; + values[valuesById[2] = "FUTURE_MULTI_PATTERN"] = 2; + return values; + })(); + + /** + * Style enum. + * @name google.api.ResourceDescriptor.Style + * @enum {number} + * @property {number} STYLE_UNSPECIFIED=0 STYLE_UNSPECIFIED value + * @property {number} DECLARATIVE_FRIENDLY=1 DECLARATIVE_FRIENDLY value + */ + ResourceDescriptor.Style = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STYLE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DECLARATIVE_FRIENDLY"] = 1; + return values; + })(); + + return ResourceDescriptor; + })(); + + api.ResourceReference = (function() { + + /** + * Properties of a ResourceReference. + * @memberof google.api + * @interface IResourceReference + * @property {string|null} [type] ResourceReference type + * @property {string|null} [childType] ResourceReference childType + */ + + /** + * Constructs a new ResourceReference. + * @memberof google.api + * @classdesc Represents a ResourceReference. + * @implements IResourceReference + * @constructor + * @param {google.api.IResourceReference=} [properties] Properties to set + */ + function ResourceReference(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceReference type. + * @member {string} type + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.type = ""; + + /** + * ResourceReference childType. + * @member {string} childType + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.childType = ""; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @function create + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference=} [properties] Properties to set + * @returns {google.api.ResourceReference} ResourceReference instance + */ + ResourceReference.create = function create(properties) { + return new ResourceReference(properties); + }; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.childType != null && Object.hasOwnProperty.call(message, "childType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); + return writer; + }; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceReference(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + message.childType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceReference message. + * @function verify + * @memberof google.api.ResourceReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceReference.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.childType != null && message.hasOwnProperty("childType")) + if (!$util.isString(message.childType)) + return "childType: string expected"; + return null; + }; + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceReference + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceReference} ResourceReference + */ + ResourceReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceReference) + return object; + var message = new $root.google.api.ResourceReference(); + if (object.type != null) + message.type = String(object.type); + if (object.childType != null) + message.childType = String(object.childType); + return message; + }; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceReference + * @static + * @param {google.api.ResourceReference} message ResourceReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceReference.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = ""; + object.childType = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.childType != null && message.hasOwnProperty("childType")) + object.childType = message.childType; + return object; + }; + + /** + * Converts this ResourceReference to JSON. + * @function toJSON + * @memberof google.api.ResourceReference + * @instance + * @returns {Object.} JSON object + */ + ResourceReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceReference + * @function getTypeUrl + * @memberof google.api.ResourceReference + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceReference"; + }; + + return ResourceReference; + })(); + + api.Http = (function() { + + /** + * Properties of a Http. + * @memberof google.api + * @interface IHttp + * @property {Array.|null} [rules] Http rules + * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion + */ + + /** + * Constructs a new Http. + * @memberof google.api + * @classdesc Represents a Http. + * @implements IHttp + * @constructor + * @param {google.api.IHttp=} [properties] Properties to set + */ + function Http(properties) { + this.rules = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Http rules. + * @member {Array.} rules + * @memberof google.api.Http + * @instance + */ + Http.prototype.rules = $util.emptyArray; + + /** + * Http fullyDecodeReservedExpansion. + * @member {boolean} fullyDecodeReservedExpansion + * @memberof google.api.Http + * @instance + */ + Http.prototype.fullyDecodeReservedExpansion = false; + + /** + * Creates a new Http instance using the specified properties. + * @function create + * @memberof google.api.Http + * @static + * @param {google.api.IHttp=} [properties] Properties to set + * @returns {google.api.Http} Http instance + */ + Http.create = function create(properties) { + return new Http(properties); + }; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encode + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rules != null && message.rules.length) + for (var i = 0; i < message.rules.length; ++i) + $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); + return writer; + }; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Http message from the specified reader or buffer. + * @function decode + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + case 2: { + message.fullyDecodeReservedExpansion = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Http message. + * @function verify + * @memberof google.api.Http + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Http.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rules != null && message.hasOwnProperty("rules")) { + if (!Array.isArray(message.rules)) + return "rules: array expected"; + for (var i = 0; i < message.rules.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.rules[i]); + if (error) + return "rules." + error; + } + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + if (typeof message.fullyDecodeReservedExpansion !== "boolean") + return "fullyDecodeReservedExpansion: boolean expected"; + return null; + }; + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Http + * @static + * @param {Object.} object Plain object + * @returns {google.api.Http} Http + */ + Http.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Http) + return object; + var message = new $root.google.api.Http(); + if (object.rules) { + if (!Array.isArray(object.rules)) + throw TypeError(".google.api.Http.rules: array expected"); + message.rules = []; + for (var i = 0; i < object.rules.length; ++i) { + if (typeof object.rules[i] !== "object") + throw TypeError(".google.api.Http.rules: object expected"); + message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); + } + } + if (object.fullyDecodeReservedExpansion != null) + message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); + return message; + }; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Http + * @static + * @param {google.api.Http} message Http + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Http.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rules = []; + if (options.defaults) + object.fullyDecodeReservedExpansion = false; + if (message.rules && message.rules.length) { + object.rules = []; + for (var j = 0; j < message.rules.length; ++j) + object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; + return object; + }; + + /** + * Converts this Http to JSON. + * @function toJSON + * @memberof google.api.Http + * @instance + * @returns {Object.} JSON object + */ + Http.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Http + * @function getTypeUrl + * @memberof google.api.Http + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Http.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Http"; + }; + + return Http; + })(); + + api.HttpRule = (function() { + + /** + * Properties of a HttpRule. + * @memberof google.api + * @interface IHttpRule + * @property {string|null} [selector] HttpRule selector + * @property {string|null} [get] HttpRule get + * @property {string|null} [put] HttpRule put + * @property {string|null} [post] HttpRule post + * @property {string|null} ["delete"] HttpRule delete + * @property {string|null} [patch] HttpRule patch + * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom + * @property {string|null} [body] HttpRule body + * @property {string|null} [responseBody] HttpRule responseBody + * @property {Array.|null} [additionalBindings] HttpRule additionalBindings + */ + + /** + * Constructs a new HttpRule. + * @memberof google.api + * @classdesc Represents a HttpRule. + * @implements IHttpRule + * @constructor + * @param {google.api.IHttpRule=} [properties] Properties to set + */ + function HttpRule(properties) { + this.additionalBindings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HttpRule selector. + * @member {string} selector + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.selector = ""; + + /** + * HttpRule get. + * @member {string|null|undefined} get + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.get = null; + + /** + * HttpRule put. + * @member {string|null|undefined} put + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.put = null; + + /** + * HttpRule post. + * @member {string|null|undefined} post + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.post = null; + + /** + * HttpRule delete. + * @member {string|null|undefined} delete + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype["delete"] = null; + + /** + * HttpRule patch. + * @member {string|null|undefined} patch + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.patch = null; + + /** + * HttpRule custom. + * @member {google.api.ICustomHttpPattern|null|undefined} custom + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.custom = null; + + /** + * HttpRule body. + * @member {string} body + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.body = ""; + + /** + * HttpRule responseBody. + * @member {string} responseBody + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.responseBody = ""; + + /** + * HttpRule additionalBindings. + * @member {Array.} additionalBindings + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.additionalBindings = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HttpRule pattern. + * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern + * @memberof google.api.HttpRule + * @instance + */ + Object.defineProperty(HttpRule.prototype, "pattern", { + get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HttpRule instance using the specified properties. + * @function create + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule=} [properties] Properties to set + * @returns {google.api.HttpRule} HttpRule instance + */ + HttpRule.create = function create(properties) { + return new HttpRule(properties); + }; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encode + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.get != null && Object.hasOwnProperty.call(message, "get")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); + if (message.put != null && Object.hasOwnProperty.call(message, "put")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); + if (message.post != null && Object.hasOwnProperty.call(message, "post")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); + if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); + if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); + if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) + $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.additionalBindings != null && message.additionalBindings.length) + for (var i = 0; i < message.additionalBindings.length; ++i) + $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); + return writer; + }; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @function decode + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.get = reader.string(); + break; + } + case 3: { + message.put = reader.string(); + break; + } + case 4: { + message.post = reader.string(); + break; + } + case 5: { + message["delete"] = reader.string(); + break; + } + case 6: { + message.patch = reader.string(); + break; + } + case 8: { + message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); + break; + } + case 7: { + message.body = reader.string(); + break; + } + case 12: { + message.responseBody = reader.string(); + break; + } + case 11: { + if (!(message.additionalBindings && message.additionalBindings.length)) + message.additionalBindings = []; + message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HttpRule message. + * @function verify + * @memberof google.api.HttpRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HttpRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.get != null && message.hasOwnProperty("get")) { + properties.pattern = 1; + if (!$util.isString(message.get)) + return "get: string expected"; + } + if (message.put != null && message.hasOwnProperty("put")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.put)) + return "put: string expected"; + } + if (message.post != null && message.hasOwnProperty("post")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.post)) + return "post: string expected"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message["delete"])) + return "delete: string expected"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.patch)) + return "patch: string expected"; + } + if (message.custom != null && message.hasOwnProperty("custom")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + { + var error = $root.google.api.CustomHttpPattern.verify(message.custom); + if (error) + return "custom." + error; + } + } + if (message.body != null && message.hasOwnProperty("body")) + if (!$util.isString(message.body)) + return "body: string expected"; + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + if (!$util.isString(message.responseBody)) + return "responseBody: string expected"; + if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) { + if (!Array.isArray(message.additionalBindings)) + return "additionalBindings: array expected"; + for (var i = 0; i < message.additionalBindings.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]); + if (error) + return "additionalBindings." + error; + } + } + return null; + }; + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.HttpRule + * @static + * @param {Object.} object Plain object + * @returns {google.api.HttpRule} HttpRule + */ + HttpRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.HttpRule) + return object; + var message = new $root.google.api.HttpRule(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.get != null) + message.get = String(object.get); + if (object.put != null) + message.put = String(object.put); + if (object.post != null) + message.post = String(object.post); + if (object["delete"] != null) + message["delete"] = String(object["delete"]); + if (object.patch != null) + message.patch = String(object.patch); + if (object.custom != null) { + if (typeof object.custom !== "object") + throw TypeError(".google.api.HttpRule.custom: object expected"); + message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); + } + if (object.body != null) + message.body = String(object.body); + if (object.responseBody != null) + message.responseBody = String(object.responseBody); + if (object.additionalBindings) { + if (!Array.isArray(object.additionalBindings)) + throw TypeError(".google.api.HttpRule.additionalBindings: array expected"); + message.additionalBindings = []; + for (var i = 0; i < object.additionalBindings.length; ++i) { + if (typeof object.additionalBindings[i] !== "object") + throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); + message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.HttpRule + * @static + * @param {google.api.HttpRule} message HttpRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HttpRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.additionalBindings = []; + if (options.defaults) { + object.selector = ""; + object.body = ""; + object.responseBody = ""; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.get != null && message.hasOwnProperty("get")) { + object.get = message.get; + if (options.oneofs) + object.pattern = "get"; + } + if (message.put != null && message.hasOwnProperty("put")) { + object.put = message.put; + if (options.oneofs) + object.pattern = "put"; + } + if (message.post != null && message.hasOwnProperty("post")) { + object.post = message.post; + if (options.oneofs) + object.pattern = "post"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + object["delete"] = message["delete"]; + if (options.oneofs) + object.pattern = "delete"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + object.patch = message.patch; + if (options.oneofs) + object.pattern = "patch"; + } + if (message.body != null && message.hasOwnProperty("body")) + object.body = message.body; + if (message.custom != null && message.hasOwnProperty("custom")) { + object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); + if (options.oneofs) + object.pattern = "custom"; + } + if (message.additionalBindings && message.additionalBindings.length) { + object.additionalBindings = []; + for (var j = 0; j < message.additionalBindings.length; ++j) + object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options); + } + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + object.responseBody = message.responseBody; + return object; + }; + + /** + * Converts this HttpRule to JSON. + * @function toJSON + * @memberof google.api.HttpRule + * @instance + * @returns {Object.} JSON object + */ + HttpRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HttpRule + * @function getTypeUrl + * @memberof google.api.HttpRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HttpRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.HttpRule"; + }; + + return HttpRule; + })(); + + api.CustomHttpPattern = (function() { + + /** + * Properties of a CustomHttpPattern. + * @memberof google.api + * @interface ICustomHttpPattern + * @property {string|null} [kind] CustomHttpPattern kind + * @property {string|null} [path] CustomHttpPattern path + */ + + /** + * Constructs a new CustomHttpPattern. + * @memberof google.api + * @classdesc Represents a CustomHttpPattern. + * @implements ICustomHttpPattern + * @constructor + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + */ + function CustomHttpPattern(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CustomHttpPattern kind. + * @member {string} kind + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.kind = ""; + + /** + * CustomHttpPattern path. + * @member {string} path + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.path = ""; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @function create + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance + */ + CustomHttpPattern.create = function create(properties) { + return new CustomHttpPattern(properties); + }; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encode + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); + return writer; + }; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @function decode + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.kind = reader.string(); + break; + } + case 2: { + message.path = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomHttpPattern message. + * @function verify + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomHttpPattern.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kind != null && message.hasOwnProperty("kind")) + if (!$util.isString(message.kind)) + return "kind: string expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + return null; + }; + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} object Plain object + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + */ + CustomHttpPattern.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CustomHttpPattern) + return object; + var message = new $root.google.api.CustomHttpPattern(); + if (object.kind != null) + message.kind = String(object.kind); + if (object.path != null) + message.path = String(object.path); + return message; + }; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.CustomHttpPattern} message CustomHttpPattern + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomHttpPattern.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.kind = ""; + object.path = ""; + } + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = message.kind; + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; + return object; + }; + + /** + * Converts this CustomHttpPattern to JSON. + * @function toJSON + * @memberof google.api.CustomHttpPattern + * @instance + * @returns {Object.} JSON object + */ + CustomHttpPattern.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomHttpPattern + * @function getTypeUrl + * @memberof google.api.CustomHttpPattern + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomHttpPattern.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CustomHttpPattern"; + }; + + return CustomHttpPattern; + })(); + + api.CommonLanguageSettings = (function() { + + /** + * Properties of a CommonLanguageSettings. + * @memberof google.api + * @interface ICommonLanguageSettings + * @property {string|null} [referenceDocsUri] CommonLanguageSettings referenceDocsUri + * @property {Array.|null} [destinations] CommonLanguageSettings destinations + */ + + /** + * Constructs a new CommonLanguageSettings. + * @memberof google.api + * @classdesc Represents a CommonLanguageSettings. + * @implements ICommonLanguageSettings + * @constructor + * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set + */ + function CommonLanguageSettings(properties) { + this.destinations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CommonLanguageSettings referenceDocsUri. + * @member {string} referenceDocsUri + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.referenceDocsUri = ""; + + /** + * CommonLanguageSettings destinations. + * @member {Array.} destinations + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.destinations = $util.emptyArray; + + /** + * Creates a new CommonLanguageSettings instance using the specified properties. + * @function create + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings instance + */ + CommonLanguageSettings.create = function create(properties) { + return new CommonLanguageSettings(properties); + }; + + /** + * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @function encode + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommonLanguageSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.referenceDocsUri != null && Object.hasOwnProperty.call(message, "referenceDocsUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.referenceDocsUri); + if (message.destinations != null && message.destinations.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.destinations.length; ++i) + writer.int32(message.destinations[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommonLanguageSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.CommonLanguageSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommonLanguageSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CommonLanguageSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.referenceDocsUri = reader.string(); + break; + } + case 2: { + if (!(message.destinations && message.destinations.length)) + message.destinations = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.destinations.push(reader.int32()); + } else + message.destinations.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CommonLanguageSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommonLanguageSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CommonLanguageSettings message. + * @function verify + * @memberof google.api.CommonLanguageSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CommonLanguageSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) + if (!$util.isString(message.referenceDocsUri)) + return "referenceDocsUri: string expected"; + if (message.destinations != null && message.hasOwnProperty("destinations")) { + if (!Array.isArray(message.destinations)) + return "destinations: array expected"; + for (var i = 0; i < message.destinations.length; ++i) + switch (message.destinations[i]) { + default: + return "destinations: enum value[] expected"; + case 0: + case 10: + case 20: + break; + } + } + return null; + }; + + /** + * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CommonLanguageSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + */ + CommonLanguageSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CommonLanguageSettings) + return object; + var message = new $root.google.api.CommonLanguageSettings(); + if (object.referenceDocsUri != null) + message.referenceDocsUri = String(object.referenceDocsUri); + if (object.destinations) { + if (!Array.isArray(object.destinations)) + throw TypeError(".google.api.CommonLanguageSettings.destinations: array expected"); + message.destinations = []; + for (var i = 0; i < object.destinations.length; ++i) + switch (object.destinations[i]) { + default: + if (typeof object.destinations[i] === "number") { + message.destinations[i] = object.destinations[i]; + break; + } + case "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": + case 0: + message.destinations[i] = 0; + break; + case "GITHUB": + case 10: + message.destinations[i] = 10; + break; + case "PACKAGE_MANAGER": + case 20: + message.destinations[i] = 20; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.CommonLanguageSettings} message CommonLanguageSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CommonLanguageSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.destinations = []; + if (options.defaults) + object.referenceDocsUri = ""; + if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) + object.referenceDocsUri = message.referenceDocsUri; + if (message.destinations && message.destinations.length) { + object.destinations = []; + for (var j = 0; j < message.destinations.length; ++j) + object.destinations[j] = options.enums === String ? $root.google.api.ClientLibraryDestination[message.destinations[j]] === undefined ? message.destinations[j] : $root.google.api.ClientLibraryDestination[message.destinations[j]] : message.destinations[j]; + } + return object; + }; + + /** + * Converts this CommonLanguageSettings to JSON. + * @function toJSON + * @memberof google.api.CommonLanguageSettings + * @instance + * @returns {Object.} JSON object + */ + CommonLanguageSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CommonLanguageSettings + * @function getTypeUrl + * @memberof google.api.CommonLanguageSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CommonLanguageSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CommonLanguageSettings"; + }; + + return CommonLanguageSettings; + })(); + + api.ClientLibrarySettings = (function() { + + /** + * Properties of a ClientLibrarySettings. + * @memberof google.api + * @interface IClientLibrarySettings + * @property {string|null} [version] ClientLibrarySettings version + * @property {google.api.LaunchStage|null} [launchStage] ClientLibrarySettings launchStage + * @property {boolean|null} [restNumericEnums] ClientLibrarySettings restNumericEnums + * @property {google.api.IJavaSettings|null} [javaSettings] ClientLibrarySettings javaSettings + * @property {google.api.ICppSettings|null} [cppSettings] ClientLibrarySettings cppSettings + * @property {google.api.IPhpSettings|null} [phpSettings] ClientLibrarySettings phpSettings + * @property {google.api.IPythonSettings|null} [pythonSettings] ClientLibrarySettings pythonSettings + * @property {google.api.INodeSettings|null} [nodeSettings] ClientLibrarySettings nodeSettings + * @property {google.api.IDotnetSettings|null} [dotnetSettings] ClientLibrarySettings dotnetSettings + * @property {google.api.IRubySettings|null} [rubySettings] ClientLibrarySettings rubySettings + * @property {google.api.IGoSettings|null} [goSettings] ClientLibrarySettings goSettings + */ + + /** + * Constructs a new ClientLibrarySettings. + * @memberof google.api + * @classdesc Represents a ClientLibrarySettings. + * @implements IClientLibrarySettings + * @constructor + * @param {google.api.IClientLibrarySettings=} [properties] Properties to set + */ + function ClientLibrarySettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClientLibrarySettings version. + * @member {string} version + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.version = ""; + + /** + * ClientLibrarySettings launchStage. + * @member {google.api.LaunchStage} launchStage + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.launchStage = 0; + + /** + * ClientLibrarySettings restNumericEnums. + * @member {boolean} restNumericEnums + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.restNumericEnums = false; + + /** + * ClientLibrarySettings javaSettings. + * @member {google.api.IJavaSettings|null|undefined} javaSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.javaSettings = null; + + /** + * ClientLibrarySettings cppSettings. + * @member {google.api.ICppSettings|null|undefined} cppSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.cppSettings = null; + + /** + * ClientLibrarySettings phpSettings. + * @member {google.api.IPhpSettings|null|undefined} phpSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.phpSettings = null; + + /** + * ClientLibrarySettings pythonSettings. + * @member {google.api.IPythonSettings|null|undefined} pythonSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.pythonSettings = null; + + /** + * ClientLibrarySettings nodeSettings. + * @member {google.api.INodeSettings|null|undefined} nodeSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.nodeSettings = null; + + /** + * ClientLibrarySettings dotnetSettings. + * @member {google.api.IDotnetSettings|null|undefined} dotnetSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.dotnetSettings = null; + + /** + * ClientLibrarySettings rubySettings. + * @member {google.api.IRubySettings|null|undefined} rubySettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.rubySettings = null; + + /** + * ClientLibrarySettings goSettings. + * @member {google.api.IGoSettings|null|undefined} goSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.goSettings = null; + + /** + * Creates a new ClientLibrarySettings instance using the specified properties. + * @function create + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings=} [properties] Properties to set + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings instance + */ + ClientLibrarySettings.create = function create(properties) { + return new ClientLibrarySettings(properties); + }; + + /** + * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @function encode + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientLibrarySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); + if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.launchStage); + if (message.restNumericEnums != null && Object.hasOwnProperty.call(message, "restNumericEnums")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.restNumericEnums); + if (message.javaSettings != null && Object.hasOwnProperty.call(message, "javaSettings")) + $root.google.api.JavaSettings.encode(message.javaSettings, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.cppSettings != null && Object.hasOwnProperty.call(message, "cppSettings")) + $root.google.api.CppSettings.encode(message.cppSettings, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.phpSettings != null && Object.hasOwnProperty.call(message, "phpSettings")) + $root.google.api.PhpSettings.encode(message.phpSettings, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.pythonSettings != null && Object.hasOwnProperty.call(message, "pythonSettings")) + $root.google.api.PythonSettings.encode(message.pythonSettings, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + if (message.nodeSettings != null && Object.hasOwnProperty.call(message, "nodeSettings")) + $root.google.api.NodeSettings.encode(message.nodeSettings, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); + if (message.dotnetSettings != null && Object.hasOwnProperty.call(message, "dotnetSettings")) + $root.google.api.DotnetSettings.encode(message.dotnetSettings, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + if (message.rubySettings != null && Object.hasOwnProperty.call(message, "rubySettings")) + $root.google.api.RubySettings.encode(message.rubySettings, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); + if (message.goSettings != null && Object.hasOwnProperty.call(message, "goSettings")) + $root.google.api.GoSettings.encode(message.goSettings, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientLibrarySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.ClientLibrarySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientLibrarySettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ClientLibrarySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.version = reader.string(); + break; + } + case 2: { + message.launchStage = reader.int32(); + break; + } + case 3: { + message.restNumericEnums = reader.bool(); + break; + } + case 21: { + message.javaSettings = $root.google.api.JavaSettings.decode(reader, reader.uint32()); + break; + } + case 22: { + message.cppSettings = $root.google.api.CppSettings.decode(reader, reader.uint32()); + break; + } + case 23: { + message.phpSettings = $root.google.api.PhpSettings.decode(reader, reader.uint32()); + break; + } + case 24: { + message.pythonSettings = $root.google.api.PythonSettings.decode(reader, reader.uint32()); + break; + } + case 25: { + message.nodeSettings = $root.google.api.NodeSettings.decode(reader, reader.uint32()); + break; + } + case 26: { + message.dotnetSettings = $root.google.api.DotnetSettings.decode(reader, reader.uint32()); + break; + } + case 27: { + message.rubySettings = $root.google.api.RubySettings.decode(reader, reader.uint32()); + break; + } + case 28: { + message.goSettings = $root.google.api.GoSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ClientLibrarySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientLibrarySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClientLibrarySettings message. + * @function verify + * @memberof google.api.ClientLibrarySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClientLibrarySettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + switch (message.launchStage) { + default: + return "launchStage: enum value expected"; + case 0: + case 6: + case 7: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) + if (typeof message.restNumericEnums !== "boolean") + return "restNumericEnums: boolean expected"; + if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) { + var error = $root.google.api.JavaSettings.verify(message.javaSettings); + if (error) + return "javaSettings." + error; + } + if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) { + var error = $root.google.api.CppSettings.verify(message.cppSettings); + if (error) + return "cppSettings." + error; + } + if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) { + var error = $root.google.api.PhpSettings.verify(message.phpSettings); + if (error) + return "phpSettings." + error; + } + if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) { + var error = $root.google.api.PythonSettings.verify(message.pythonSettings); + if (error) + return "pythonSettings." + error; + } + if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) { + var error = $root.google.api.NodeSettings.verify(message.nodeSettings); + if (error) + return "nodeSettings." + error; + } + if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) { + var error = $root.google.api.DotnetSettings.verify(message.dotnetSettings); + if (error) + return "dotnetSettings." + error; + } + if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) { + var error = $root.google.api.RubySettings.verify(message.rubySettings); + if (error) + return "rubySettings." + error; + } + if (message.goSettings != null && message.hasOwnProperty("goSettings")) { + var error = $root.google.api.GoSettings.verify(message.goSettings); + if (error) + return "goSettings." + error; + } + return null; + }; + + /** + * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ClientLibrarySettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + */ + ClientLibrarySettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ClientLibrarySettings) + return object; + var message = new $root.google.api.ClientLibrarySettings(); + if (object.version != null) + message.version = String(object.version); + switch (object.launchStage) { + default: + if (typeof object.launchStage === "number") { + message.launchStage = object.launchStage; + break; + } + break; + case "LAUNCH_STAGE_UNSPECIFIED": + case 0: + message.launchStage = 0; + break; + case "UNIMPLEMENTED": + case 6: + message.launchStage = 6; + break; + case "PRELAUNCH": + case 7: + message.launchStage = 7; + break; + case "EARLY_ACCESS": + case 1: + message.launchStage = 1; + break; + case "ALPHA": + case 2: + message.launchStage = 2; + break; + case "BETA": + case 3: + message.launchStage = 3; + break; + case "GA": + case 4: + message.launchStage = 4; + break; + case "DEPRECATED": + case 5: + message.launchStage = 5; + break; + } + if (object.restNumericEnums != null) + message.restNumericEnums = Boolean(object.restNumericEnums); + if (object.javaSettings != null) { + if (typeof object.javaSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.javaSettings: object expected"); + message.javaSettings = $root.google.api.JavaSettings.fromObject(object.javaSettings); + } + if (object.cppSettings != null) { + if (typeof object.cppSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.cppSettings: object expected"); + message.cppSettings = $root.google.api.CppSettings.fromObject(object.cppSettings); + } + if (object.phpSettings != null) { + if (typeof object.phpSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.phpSettings: object expected"); + message.phpSettings = $root.google.api.PhpSettings.fromObject(object.phpSettings); + } + if (object.pythonSettings != null) { + if (typeof object.pythonSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.pythonSettings: object expected"); + message.pythonSettings = $root.google.api.PythonSettings.fromObject(object.pythonSettings); + } + if (object.nodeSettings != null) { + if (typeof object.nodeSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.nodeSettings: object expected"); + message.nodeSettings = $root.google.api.NodeSettings.fromObject(object.nodeSettings); + } + if (object.dotnetSettings != null) { + if (typeof object.dotnetSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.dotnetSettings: object expected"); + message.dotnetSettings = $root.google.api.DotnetSettings.fromObject(object.dotnetSettings); + } + if (object.rubySettings != null) { + if (typeof object.rubySettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.rubySettings: object expected"); + message.rubySettings = $root.google.api.RubySettings.fromObject(object.rubySettings); + } + if (object.goSettings != null) { + if (typeof object.goSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.goSettings: object expected"); + message.goSettings = $root.google.api.GoSettings.fromObject(object.goSettings); + } + return message; + }; + + /** + * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.ClientLibrarySettings} message ClientLibrarySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClientLibrarySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.version = ""; + object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; + object.restNumericEnums = false; + object.javaSettings = null; + object.cppSettings = null; + object.phpSettings = null; + object.pythonSettings = null; + object.nodeSettings = null; + object.dotnetSettings = null; + object.rubySettings = null; + object.goSettings = null; + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + object.launchStage = options.enums === String ? $root.google.api.LaunchStage[message.launchStage] === undefined ? message.launchStage : $root.google.api.LaunchStage[message.launchStage] : message.launchStage; + if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) + object.restNumericEnums = message.restNumericEnums; + if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) + object.javaSettings = $root.google.api.JavaSettings.toObject(message.javaSettings, options); + if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) + object.cppSettings = $root.google.api.CppSettings.toObject(message.cppSettings, options); + if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) + object.phpSettings = $root.google.api.PhpSettings.toObject(message.phpSettings, options); + if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) + object.pythonSettings = $root.google.api.PythonSettings.toObject(message.pythonSettings, options); + if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) + object.nodeSettings = $root.google.api.NodeSettings.toObject(message.nodeSettings, options); + if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) + object.dotnetSettings = $root.google.api.DotnetSettings.toObject(message.dotnetSettings, options); + if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) + object.rubySettings = $root.google.api.RubySettings.toObject(message.rubySettings, options); + if (message.goSettings != null && message.hasOwnProperty("goSettings")) + object.goSettings = $root.google.api.GoSettings.toObject(message.goSettings, options); + return object; + }; + + /** + * Converts this ClientLibrarySettings to JSON. + * @function toJSON + * @memberof google.api.ClientLibrarySettings + * @instance + * @returns {Object.} JSON object + */ + ClientLibrarySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClientLibrarySettings + * @function getTypeUrl + * @memberof google.api.ClientLibrarySettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClientLibrarySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ClientLibrarySettings"; + }; + + return ClientLibrarySettings; + })(); + + api.Publishing = (function() { + + /** + * Properties of a Publishing. + * @memberof google.api + * @interface IPublishing + * @property {Array.|null} [methodSettings] Publishing methodSettings + * @property {string|null} [newIssueUri] Publishing newIssueUri + * @property {string|null} [documentationUri] Publishing documentationUri + * @property {string|null} [apiShortName] Publishing apiShortName + * @property {string|null} [githubLabel] Publishing githubLabel + * @property {Array.|null} [codeownerGithubTeams] Publishing codeownerGithubTeams + * @property {string|null} [docTagPrefix] Publishing docTagPrefix + * @property {google.api.ClientLibraryOrganization|null} [organization] Publishing organization + * @property {Array.|null} [librarySettings] Publishing librarySettings + * @property {string|null} [protoReferenceDocumentationUri] Publishing protoReferenceDocumentationUri + * @property {string|null} [restReferenceDocumentationUri] Publishing restReferenceDocumentationUri + */ + + /** + * Constructs a new Publishing. + * @memberof google.api + * @classdesc Represents a Publishing. + * @implements IPublishing + * @constructor + * @param {google.api.IPublishing=} [properties] Properties to set + */ + function Publishing(properties) { + this.methodSettings = []; + this.codeownerGithubTeams = []; + this.librarySettings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Publishing methodSettings. + * @member {Array.} methodSettings + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.methodSettings = $util.emptyArray; + + /** + * Publishing newIssueUri. + * @member {string} newIssueUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.newIssueUri = ""; + + /** + * Publishing documentationUri. + * @member {string} documentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.documentationUri = ""; + + /** + * Publishing apiShortName. + * @member {string} apiShortName + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.apiShortName = ""; + + /** + * Publishing githubLabel. + * @member {string} githubLabel + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.githubLabel = ""; + + /** + * Publishing codeownerGithubTeams. + * @member {Array.} codeownerGithubTeams + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.codeownerGithubTeams = $util.emptyArray; + + /** + * Publishing docTagPrefix. + * @member {string} docTagPrefix + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.docTagPrefix = ""; + + /** + * Publishing organization. + * @member {google.api.ClientLibraryOrganization} organization + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.organization = 0; + + /** + * Publishing librarySettings. + * @member {Array.} librarySettings + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.librarySettings = $util.emptyArray; + + /** + * Publishing protoReferenceDocumentationUri. + * @member {string} protoReferenceDocumentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.protoReferenceDocumentationUri = ""; + + /** + * Publishing restReferenceDocumentationUri. + * @member {string} restReferenceDocumentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.restReferenceDocumentationUri = ""; + + /** + * Creates a new Publishing instance using the specified properties. + * @function create + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing=} [properties] Properties to set + * @returns {google.api.Publishing} Publishing instance + */ + Publishing.create = function create(properties) { + return new Publishing(properties); + }; + + /** + * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @function encode + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing} message Publishing message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Publishing.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.methodSettings != null && message.methodSettings.length) + for (var i = 0; i < message.methodSettings.length; ++i) + $root.google.api.MethodSettings.encode(message.methodSettings[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.newIssueUri != null && Object.hasOwnProperty.call(message, "newIssueUri")) + writer.uint32(/* id 101, wireType 2 =*/810).string(message.newIssueUri); + if (message.documentationUri != null && Object.hasOwnProperty.call(message, "documentationUri")) + writer.uint32(/* id 102, wireType 2 =*/818).string(message.documentationUri); + if (message.apiShortName != null && Object.hasOwnProperty.call(message, "apiShortName")) + writer.uint32(/* id 103, wireType 2 =*/826).string(message.apiShortName); + if (message.githubLabel != null && Object.hasOwnProperty.call(message, "githubLabel")) + writer.uint32(/* id 104, wireType 2 =*/834).string(message.githubLabel); + if (message.codeownerGithubTeams != null && message.codeownerGithubTeams.length) + for (var i = 0; i < message.codeownerGithubTeams.length; ++i) + writer.uint32(/* id 105, wireType 2 =*/842).string(message.codeownerGithubTeams[i]); + if (message.docTagPrefix != null && Object.hasOwnProperty.call(message, "docTagPrefix")) + writer.uint32(/* id 106, wireType 2 =*/850).string(message.docTagPrefix); + if (message.organization != null && Object.hasOwnProperty.call(message, "organization")) + writer.uint32(/* id 107, wireType 0 =*/856).int32(message.organization); + if (message.librarySettings != null && message.librarySettings.length) + for (var i = 0; i < message.librarySettings.length; ++i) + $root.google.api.ClientLibrarySettings.encode(message.librarySettings[i], writer.uint32(/* id 109, wireType 2 =*/874).fork()).ldelim(); + if (message.protoReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "protoReferenceDocumentationUri")) + writer.uint32(/* id 110, wireType 2 =*/882).string(message.protoReferenceDocumentationUri); + if (message.restReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "restReferenceDocumentationUri")) + writer.uint32(/* id 111, wireType 2 =*/890).string(message.restReferenceDocumentationUri); + return writer; + }; + + /** + * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing} message Publishing message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Publishing.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Publishing message from the specified reader or buffer. + * @function decode + * @memberof google.api.Publishing + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Publishing} Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Publishing.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Publishing(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + if (!(message.methodSettings && message.methodSettings.length)) + message.methodSettings = []; + message.methodSettings.push($root.google.api.MethodSettings.decode(reader, reader.uint32())); + break; + } + case 101: { + message.newIssueUri = reader.string(); + break; + } + case 102: { + message.documentationUri = reader.string(); + break; + } + case 103: { + message.apiShortName = reader.string(); + break; + } + case 104: { + message.githubLabel = reader.string(); + break; + } + case 105: { + if (!(message.codeownerGithubTeams && message.codeownerGithubTeams.length)) + message.codeownerGithubTeams = []; + message.codeownerGithubTeams.push(reader.string()); + break; + } + case 106: { + message.docTagPrefix = reader.string(); + break; + } + case 107: { + message.organization = reader.int32(); + break; + } + case 109: { + if (!(message.librarySettings && message.librarySettings.length)) + message.librarySettings = []; + message.librarySettings.push($root.google.api.ClientLibrarySettings.decode(reader, reader.uint32())); + break; + } + case 110: { + message.protoReferenceDocumentationUri = reader.string(); + break; + } + case 111: { + message.restReferenceDocumentationUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Publishing message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Publishing + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Publishing} Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Publishing.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Publishing message. + * @function verify + * @memberof google.api.Publishing + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Publishing.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.methodSettings != null && message.hasOwnProperty("methodSettings")) { + if (!Array.isArray(message.methodSettings)) + return "methodSettings: array expected"; + for (var i = 0; i < message.methodSettings.length; ++i) { + var error = $root.google.api.MethodSettings.verify(message.methodSettings[i]); + if (error) + return "methodSettings." + error; + } + } + if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) + if (!$util.isString(message.newIssueUri)) + return "newIssueUri: string expected"; + if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) + if (!$util.isString(message.documentationUri)) + return "documentationUri: string expected"; + if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) + if (!$util.isString(message.apiShortName)) + return "apiShortName: string expected"; + if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) + if (!$util.isString(message.githubLabel)) + return "githubLabel: string expected"; + if (message.codeownerGithubTeams != null && message.hasOwnProperty("codeownerGithubTeams")) { + if (!Array.isArray(message.codeownerGithubTeams)) + return "codeownerGithubTeams: array expected"; + for (var i = 0; i < message.codeownerGithubTeams.length; ++i) + if (!$util.isString(message.codeownerGithubTeams[i])) + return "codeownerGithubTeams: string[] expected"; + } + if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) + if (!$util.isString(message.docTagPrefix)) + return "docTagPrefix: string expected"; + if (message.organization != null && message.hasOwnProperty("organization")) + switch (message.organization) { + default: + return "organization: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + if (message.librarySettings != null && message.hasOwnProperty("librarySettings")) { + if (!Array.isArray(message.librarySettings)) + return "librarySettings: array expected"; + for (var i = 0; i < message.librarySettings.length; ++i) { + var error = $root.google.api.ClientLibrarySettings.verify(message.librarySettings[i]); + if (error) + return "librarySettings." + error; + } + } + if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) + if (!$util.isString(message.protoReferenceDocumentationUri)) + return "protoReferenceDocumentationUri: string expected"; + if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) + if (!$util.isString(message.restReferenceDocumentationUri)) + return "restReferenceDocumentationUri: string expected"; + return null; + }; + + /** + * Creates a Publishing message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Publishing + * @static + * @param {Object.} object Plain object + * @returns {google.api.Publishing} Publishing + */ + Publishing.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Publishing) + return object; + var message = new $root.google.api.Publishing(); + if (object.methodSettings) { + if (!Array.isArray(object.methodSettings)) + throw TypeError(".google.api.Publishing.methodSettings: array expected"); + message.methodSettings = []; + for (var i = 0; i < object.methodSettings.length; ++i) { + if (typeof object.methodSettings[i] !== "object") + throw TypeError(".google.api.Publishing.methodSettings: object expected"); + message.methodSettings[i] = $root.google.api.MethodSettings.fromObject(object.methodSettings[i]); + } + } + if (object.newIssueUri != null) + message.newIssueUri = String(object.newIssueUri); + if (object.documentationUri != null) + message.documentationUri = String(object.documentationUri); + if (object.apiShortName != null) + message.apiShortName = String(object.apiShortName); + if (object.githubLabel != null) + message.githubLabel = String(object.githubLabel); + if (object.codeownerGithubTeams) { + if (!Array.isArray(object.codeownerGithubTeams)) + throw TypeError(".google.api.Publishing.codeownerGithubTeams: array expected"); + message.codeownerGithubTeams = []; + for (var i = 0; i < object.codeownerGithubTeams.length; ++i) + message.codeownerGithubTeams[i] = String(object.codeownerGithubTeams[i]); + } + if (object.docTagPrefix != null) + message.docTagPrefix = String(object.docTagPrefix); + switch (object.organization) { + default: + if (typeof object.organization === "number") { + message.organization = object.organization; + break; + } + break; + case "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": + case 0: + message.organization = 0; + break; + case "CLOUD": + case 1: + message.organization = 1; + break; + case "ADS": + case 2: + message.organization = 2; + break; + case "PHOTOS": + case 3: + message.organization = 3; + break; + case "STREET_VIEW": + case 4: + message.organization = 4; + break; + case "SHOPPING": + case 5: + message.organization = 5; + break; + case "GEO": + case 6: + message.organization = 6; + break; + case "GENERATIVE_AI": + case 7: + message.organization = 7; + break; + } + if (object.librarySettings) { + if (!Array.isArray(object.librarySettings)) + throw TypeError(".google.api.Publishing.librarySettings: array expected"); + message.librarySettings = []; + for (var i = 0; i < object.librarySettings.length; ++i) { + if (typeof object.librarySettings[i] !== "object") + throw TypeError(".google.api.Publishing.librarySettings: object expected"); + message.librarySettings[i] = $root.google.api.ClientLibrarySettings.fromObject(object.librarySettings[i]); + } + } + if (object.protoReferenceDocumentationUri != null) + message.protoReferenceDocumentationUri = String(object.protoReferenceDocumentationUri); + if (object.restReferenceDocumentationUri != null) + message.restReferenceDocumentationUri = String(object.restReferenceDocumentationUri); + return message; + }; + + /** + * Creates a plain object from a Publishing message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Publishing + * @static + * @param {google.api.Publishing} message Publishing + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Publishing.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.methodSettings = []; + object.codeownerGithubTeams = []; + object.librarySettings = []; + } + if (options.defaults) { + object.newIssueUri = ""; + object.documentationUri = ""; + object.apiShortName = ""; + object.githubLabel = ""; + object.docTagPrefix = ""; + object.organization = options.enums === String ? "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED" : 0; + object.protoReferenceDocumentationUri = ""; + object.restReferenceDocumentationUri = ""; + } + if (message.methodSettings && message.methodSettings.length) { + object.methodSettings = []; + for (var j = 0; j < message.methodSettings.length; ++j) + object.methodSettings[j] = $root.google.api.MethodSettings.toObject(message.methodSettings[j], options); + } + if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) + object.newIssueUri = message.newIssueUri; + if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) + object.documentationUri = message.documentationUri; + if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) + object.apiShortName = message.apiShortName; + if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) + object.githubLabel = message.githubLabel; + if (message.codeownerGithubTeams && message.codeownerGithubTeams.length) { + object.codeownerGithubTeams = []; + for (var j = 0; j < message.codeownerGithubTeams.length; ++j) + object.codeownerGithubTeams[j] = message.codeownerGithubTeams[j]; + } + if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) + object.docTagPrefix = message.docTagPrefix; + if (message.organization != null && message.hasOwnProperty("organization")) + object.organization = options.enums === String ? $root.google.api.ClientLibraryOrganization[message.organization] === undefined ? message.organization : $root.google.api.ClientLibraryOrganization[message.organization] : message.organization; + if (message.librarySettings && message.librarySettings.length) { + object.librarySettings = []; + for (var j = 0; j < message.librarySettings.length; ++j) + object.librarySettings[j] = $root.google.api.ClientLibrarySettings.toObject(message.librarySettings[j], options); + } + if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) + object.protoReferenceDocumentationUri = message.protoReferenceDocumentationUri; + if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) + object.restReferenceDocumentationUri = message.restReferenceDocumentationUri; + return object; + }; + + /** + * Converts this Publishing to JSON. + * @function toJSON + * @memberof google.api.Publishing + * @instance + * @returns {Object.} JSON object + */ + Publishing.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Publishing + * @function getTypeUrl + * @memberof google.api.Publishing + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Publishing.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Publishing"; + }; + + return Publishing; + })(); + + api.JavaSettings = (function() { + + /** + * Properties of a JavaSettings. + * @memberof google.api + * @interface IJavaSettings + * @property {string|null} [libraryPackage] JavaSettings libraryPackage + * @property {Object.|null} [serviceClassNames] JavaSettings serviceClassNames + * @property {google.api.ICommonLanguageSettings|null} [common] JavaSettings common + */ + + /** + * Constructs a new JavaSettings. + * @memberof google.api + * @classdesc Represents a JavaSettings. + * @implements IJavaSettings + * @constructor + * @param {google.api.IJavaSettings=} [properties] Properties to set + */ + function JavaSettings(properties) { + this.serviceClassNames = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * JavaSettings libraryPackage. + * @member {string} libraryPackage + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.libraryPackage = ""; + + /** + * JavaSettings serviceClassNames. + * @member {Object.} serviceClassNames + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.serviceClassNames = $util.emptyObject; + + /** + * JavaSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.common = null; + + /** + * Creates a new JavaSettings instance using the specified properties. + * @function create + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings=} [properties] Properties to set + * @returns {google.api.JavaSettings} JavaSettings instance + */ + JavaSettings.create = function create(properties) { + return new JavaSettings(properties); + }; + + /** + * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @function encode + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JavaSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.libraryPackage != null && Object.hasOwnProperty.call(message, "libraryPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.libraryPackage); + if (message.serviceClassNames != null && Object.hasOwnProperty.call(message, "serviceClassNames")) + for (var keys = Object.keys(message.serviceClassNames), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.serviceClassNames[keys[i]]).ldelim(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JavaSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a JavaSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.JavaSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.JavaSettings} JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JavaSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.JavaSettings(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.libraryPackage = reader.string(); + break; + } + case 2: { + if (message.serviceClassNames === $util.emptyObject) + message.serviceClassNames = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.serviceClassNames[key] = value; + break; + } + case 3: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a JavaSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.JavaSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.JavaSettings} JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JavaSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JavaSettings message. + * @function verify + * @memberof google.api.JavaSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JavaSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) + if (!$util.isString(message.libraryPackage)) + return "libraryPackage: string expected"; + if (message.serviceClassNames != null && message.hasOwnProperty("serviceClassNames")) { + if (!$util.isObject(message.serviceClassNames)) + return "serviceClassNames: object expected"; + var key = Object.keys(message.serviceClassNames); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.serviceClassNames[key[i]])) + return "serviceClassNames: string{k:string} expected"; + } + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.JavaSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.JavaSettings} JavaSettings + */ + JavaSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.JavaSettings) + return object; + var message = new $root.google.api.JavaSettings(); + if (object.libraryPackage != null) + message.libraryPackage = String(object.libraryPackage); + if (object.serviceClassNames) { + if (typeof object.serviceClassNames !== "object") + throw TypeError(".google.api.JavaSettings.serviceClassNames: object expected"); + message.serviceClassNames = {}; + for (var keys = Object.keys(object.serviceClassNames), i = 0; i < keys.length; ++i) + message.serviceClassNames[keys[i]] = String(object.serviceClassNames[keys[i]]); + } + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.JavaSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.JavaSettings + * @static + * @param {google.api.JavaSettings} message JavaSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JavaSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.serviceClassNames = {}; + if (options.defaults) { + object.libraryPackage = ""; + object.common = null; + } + if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) + object.libraryPackage = message.libraryPackage; + var keys2; + if (message.serviceClassNames && (keys2 = Object.keys(message.serviceClassNames)).length) { + object.serviceClassNames = {}; + for (var j = 0; j < keys2.length; ++j) + object.serviceClassNames[keys2[j]] = message.serviceClassNames[keys2[j]]; + } + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this JavaSettings to JSON. + * @function toJSON + * @memberof google.api.JavaSettings + * @instance + * @returns {Object.} JSON object + */ + JavaSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JavaSettings + * @function getTypeUrl + * @memberof google.api.JavaSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JavaSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.JavaSettings"; + }; + + return JavaSettings; + })(); + + api.CppSettings = (function() { + + /** + * Properties of a CppSettings. + * @memberof google.api + * @interface ICppSettings + * @property {google.api.ICommonLanguageSettings|null} [common] CppSettings common + */ + + /** + * Constructs a new CppSettings. + * @memberof google.api + * @classdesc Represents a CppSettings. + * @implements ICppSettings + * @constructor + * @param {google.api.ICppSettings=} [properties] Properties to set + */ + function CppSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CppSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.CppSettings + * @instance + */ + CppSettings.prototype.common = null; + + /** + * Creates a new CppSettings instance using the specified properties. + * @function create + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings=} [properties] Properties to set + * @returns {google.api.CppSettings} CppSettings instance + */ + CppSettings.create = function create(properties) { + return new CppSettings(properties); + }; + + /** + * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @function encode + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings} message CppSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CppSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings} message CppSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CppSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CppSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.CppSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CppSettings} CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CppSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CppSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CppSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CppSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CppSettings} CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CppSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CppSettings message. + * @function verify + * @memberof google.api.CppSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CppSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CppSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.CppSettings} CppSettings + */ + CppSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CppSettings) + return object; + var message = new $root.google.api.CppSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.CppSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a CppSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CppSettings + * @static + * @param {google.api.CppSettings} message CppSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CppSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this CppSettings to JSON. + * @function toJSON + * @memberof google.api.CppSettings + * @instance + * @returns {Object.} JSON object + */ + CppSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CppSettings + * @function getTypeUrl + * @memberof google.api.CppSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CppSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CppSettings"; + }; + + return CppSettings; + })(); + + api.PhpSettings = (function() { + + /** + * Properties of a PhpSettings. + * @memberof google.api + * @interface IPhpSettings + * @property {google.api.ICommonLanguageSettings|null} [common] PhpSettings common + */ + + /** + * Constructs a new PhpSettings. + * @memberof google.api + * @classdesc Represents a PhpSettings. + * @implements IPhpSettings + * @constructor + * @param {google.api.IPhpSettings=} [properties] Properties to set + */ + function PhpSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PhpSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.PhpSettings + * @instance + */ + PhpSettings.prototype.common = null; + + /** + * Creates a new PhpSettings instance using the specified properties. + * @function create + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings=} [properties] Properties to set + * @returns {google.api.PhpSettings} PhpSettings instance + */ + PhpSettings.create = function create(properties) { + return new PhpSettings(properties); + }; + + /** + * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @function encode + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PhpSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PhpSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PhpSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.PhpSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PhpSettings} PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PhpSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PhpSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PhpSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PhpSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PhpSettings} PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PhpSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PhpSettings message. + * @function verify + * @memberof google.api.PhpSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PhpSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PhpSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.PhpSettings} PhpSettings + */ + PhpSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.PhpSettings) + return object; + var message = new $root.google.api.PhpSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.PhpSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PhpSettings + * @static + * @param {google.api.PhpSettings} message PhpSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PhpSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this PhpSettings to JSON. + * @function toJSON + * @memberof google.api.PhpSettings + * @instance + * @returns {Object.} JSON object + */ + PhpSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PhpSettings + * @function getTypeUrl + * @memberof google.api.PhpSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PhpSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PhpSettings"; + }; + + return PhpSettings; + })(); + + api.PythonSettings = (function() { + + /** + * Properties of a PythonSettings. + * @memberof google.api + * @interface IPythonSettings + * @property {google.api.ICommonLanguageSettings|null} [common] PythonSettings common + */ + + /** + * Constructs a new PythonSettings. + * @memberof google.api + * @classdesc Represents a PythonSettings. + * @implements IPythonSettings + * @constructor + * @param {google.api.IPythonSettings=} [properties] Properties to set + */ + function PythonSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PythonSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.PythonSettings + * @instance + */ + PythonSettings.prototype.common = null; + + /** + * Creates a new PythonSettings instance using the specified properties. + * @function create + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings=} [properties] Properties to set + * @returns {google.api.PythonSettings} PythonSettings instance + */ + PythonSettings.create = function create(properties) { + return new PythonSettings(properties); + }; + + /** + * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @function encode + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PythonSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PythonSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PythonSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.PythonSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PythonSettings} PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PythonSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PythonSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PythonSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PythonSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PythonSettings} PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PythonSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PythonSettings message. + * @function verify + * @memberof google.api.PythonSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PythonSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PythonSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.PythonSettings} PythonSettings + */ + PythonSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.PythonSettings) + return object; + var message = new $root.google.api.PythonSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.PythonSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PythonSettings + * @static + * @param {google.api.PythonSettings} message PythonSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PythonSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this PythonSettings to JSON. + * @function toJSON + * @memberof google.api.PythonSettings + * @instance + * @returns {Object.} JSON object + */ + PythonSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PythonSettings + * @function getTypeUrl + * @memberof google.api.PythonSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PythonSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PythonSettings"; + }; + + return PythonSettings; + })(); + + api.NodeSettings = (function() { + + /** + * Properties of a NodeSettings. + * @memberof google.api + * @interface INodeSettings + * @property {google.api.ICommonLanguageSettings|null} [common] NodeSettings common + */ + + /** + * Constructs a new NodeSettings. + * @memberof google.api + * @classdesc Represents a NodeSettings. + * @implements INodeSettings + * @constructor + * @param {google.api.INodeSettings=} [properties] Properties to set + */ + function NodeSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NodeSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.NodeSettings + * @instance + */ + NodeSettings.prototype.common = null; + + /** + * Creates a new NodeSettings instance using the specified properties. + * @function create + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings=} [properties] Properties to set + * @returns {google.api.NodeSettings} NodeSettings instance + */ + NodeSettings.create = function create(properties) { + return new NodeSettings(properties); + }; + + /** + * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @function encode + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NodeSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.NodeSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.NodeSettings} NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.NodeSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NodeSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.NodeSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.NodeSettings} NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NodeSettings message. + * @function verify + * @memberof google.api.NodeSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NodeSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.NodeSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.NodeSettings} NodeSettings + */ + NodeSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.NodeSettings) + return object; + var message = new $root.google.api.NodeSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.NodeSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.NodeSettings + * @static + * @param {google.api.NodeSettings} message NodeSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NodeSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this NodeSettings to JSON. + * @function toJSON + * @memberof google.api.NodeSettings + * @instance + * @returns {Object.} JSON object + */ + NodeSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NodeSettings + * @function getTypeUrl + * @memberof google.api.NodeSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.NodeSettings"; + }; + + return NodeSettings; + })(); + + api.DotnetSettings = (function() { + + /** + * Properties of a DotnetSettings. + * @memberof google.api + * @interface IDotnetSettings + * @property {google.api.ICommonLanguageSettings|null} [common] DotnetSettings common + * @property {Object.|null} [renamedServices] DotnetSettings renamedServices + * @property {Object.|null} [renamedResources] DotnetSettings renamedResources + * @property {Array.|null} [ignoredResources] DotnetSettings ignoredResources + * @property {Array.|null} [forcedNamespaceAliases] DotnetSettings forcedNamespaceAliases + * @property {Array.|null} [handwrittenSignatures] DotnetSettings handwrittenSignatures + */ + + /** + * Constructs a new DotnetSettings. + * @memberof google.api + * @classdesc Represents a DotnetSettings. + * @implements IDotnetSettings + * @constructor + * @param {google.api.IDotnetSettings=} [properties] Properties to set + */ + function DotnetSettings(properties) { + this.renamedServices = {}; + this.renamedResources = {}; + this.ignoredResources = []; + this.forcedNamespaceAliases = []; + this.handwrittenSignatures = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DotnetSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.common = null; + + /** + * DotnetSettings renamedServices. + * @member {Object.} renamedServices + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.renamedServices = $util.emptyObject; + + /** + * DotnetSettings renamedResources. + * @member {Object.} renamedResources + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.renamedResources = $util.emptyObject; + + /** + * DotnetSettings ignoredResources. + * @member {Array.} ignoredResources + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.ignoredResources = $util.emptyArray; + + /** + * DotnetSettings forcedNamespaceAliases. + * @member {Array.} forcedNamespaceAliases + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.forcedNamespaceAliases = $util.emptyArray; + + /** + * DotnetSettings handwrittenSignatures. + * @member {Array.} handwrittenSignatures + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.handwrittenSignatures = $util.emptyArray; + + /** + * Creates a new DotnetSettings instance using the specified properties. + * @function create + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings=} [properties] Properties to set + * @returns {google.api.DotnetSettings} DotnetSettings instance + */ + DotnetSettings.create = function create(properties) { + return new DotnetSettings(properties); + }; + + /** + * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @function encode + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DotnetSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.renamedServices != null && Object.hasOwnProperty.call(message, "renamedServices")) + for (var keys = Object.keys(message.renamedServices), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedServices[keys[i]]).ldelim(); + if (message.renamedResources != null && Object.hasOwnProperty.call(message, "renamedResources")) + for (var keys = Object.keys(message.renamedResources), i = 0; i < keys.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedResources[keys[i]]).ldelim(); + if (message.ignoredResources != null && message.ignoredResources.length) + for (var i = 0; i < message.ignoredResources.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.ignoredResources[i]); + if (message.forcedNamespaceAliases != null && message.forcedNamespaceAliases.length) + for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.forcedNamespaceAliases[i]); + if (message.handwrittenSignatures != null && message.handwrittenSignatures.length) + for (var i = 0; i < message.handwrittenSignatures.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.handwrittenSignatures[i]); + return writer; + }; + + /** + * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DotnetSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.DotnetSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.DotnetSettings} DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DotnetSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.DotnetSettings(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + case 2: { + if (message.renamedServices === $util.emptyObject) + message.renamedServices = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.renamedServices[key] = value; + break; + } + case 3: { + if (message.renamedResources === $util.emptyObject) + message.renamedResources = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.renamedResources[key] = value; + break; + } + case 4: { + if (!(message.ignoredResources && message.ignoredResources.length)) + message.ignoredResources = []; + message.ignoredResources.push(reader.string()); + break; + } + case 5: { + if (!(message.forcedNamespaceAliases && message.forcedNamespaceAliases.length)) + message.forcedNamespaceAliases = []; + message.forcedNamespaceAliases.push(reader.string()); + break; + } + case 6: { + if (!(message.handwrittenSignatures && message.handwrittenSignatures.length)) + message.handwrittenSignatures = []; + message.handwrittenSignatures.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.DotnetSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.DotnetSettings} DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DotnetSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DotnetSettings message. + * @function verify + * @memberof google.api.DotnetSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DotnetSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + if (message.renamedServices != null && message.hasOwnProperty("renamedServices")) { + if (!$util.isObject(message.renamedServices)) + return "renamedServices: object expected"; + var key = Object.keys(message.renamedServices); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.renamedServices[key[i]])) + return "renamedServices: string{k:string} expected"; + } + if (message.renamedResources != null && message.hasOwnProperty("renamedResources")) { + if (!$util.isObject(message.renamedResources)) + return "renamedResources: object expected"; + var key = Object.keys(message.renamedResources); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.renamedResources[key[i]])) + return "renamedResources: string{k:string} expected"; + } + if (message.ignoredResources != null && message.hasOwnProperty("ignoredResources")) { + if (!Array.isArray(message.ignoredResources)) + return "ignoredResources: array expected"; + for (var i = 0; i < message.ignoredResources.length; ++i) + if (!$util.isString(message.ignoredResources[i])) + return "ignoredResources: string[] expected"; + } + if (message.forcedNamespaceAliases != null && message.hasOwnProperty("forcedNamespaceAliases")) { + if (!Array.isArray(message.forcedNamespaceAliases)) + return "forcedNamespaceAliases: array expected"; + for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) + if (!$util.isString(message.forcedNamespaceAliases[i])) + return "forcedNamespaceAliases: string[] expected"; + } + if (message.handwrittenSignatures != null && message.hasOwnProperty("handwrittenSignatures")) { + if (!Array.isArray(message.handwrittenSignatures)) + return "handwrittenSignatures: array expected"; + for (var i = 0; i < message.handwrittenSignatures.length; ++i) + if (!$util.isString(message.handwrittenSignatures[i])) + return "handwrittenSignatures: string[] expected"; + } + return null; + }; + + /** + * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.DotnetSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.DotnetSettings} DotnetSettings + */ + DotnetSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.DotnetSettings) + return object; + var message = new $root.google.api.DotnetSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.DotnetSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + if (object.renamedServices) { + if (typeof object.renamedServices !== "object") + throw TypeError(".google.api.DotnetSettings.renamedServices: object expected"); + message.renamedServices = {}; + for (var keys = Object.keys(object.renamedServices), i = 0; i < keys.length; ++i) + message.renamedServices[keys[i]] = String(object.renamedServices[keys[i]]); + } + if (object.renamedResources) { + if (typeof object.renamedResources !== "object") + throw TypeError(".google.api.DotnetSettings.renamedResources: object expected"); + message.renamedResources = {}; + for (var keys = Object.keys(object.renamedResources), i = 0; i < keys.length; ++i) + message.renamedResources[keys[i]] = String(object.renamedResources[keys[i]]); + } + if (object.ignoredResources) { + if (!Array.isArray(object.ignoredResources)) + throw TypeError(".google.api.DotnetSettings.ignoredResources: array expected"); + message.ignoredResources = []; + for (var i = 0; i < object.ignoredResources.length; ++i) + message.ignoredResources[i] = String(object.ignoredResources[i]); + } + if (object.forcedNamespaceAliases) { + if (!Array.isArray(object.forcedNamespaceAliases)) + throw TypeError(".google.api.DotnetSettings.forcedNamespaceAliases: array expected"); + message.forcedNamespaceAliases = []; + for (var i = 0; i < object.forcedNamespaceAliases.length; ++i) + message.forcedNamespaceAliases[i] = String(object.forcedNamespaceAliases[i]); + } + if (object.handwrittenSignatures) { + if (!Array.isArray(object.handwrittenSignatures)) + throw TypeError(".google.api.DotnetSettings.handwrittenSignatures: array expected"); + message.handwrittenSignatures = []; + for (var i = 0; i < object.handwrittenSignatures.length; ++i) + message.handwrittenSignatures[i] = String(object.handwrittenSignatures[i]); + } + return message; + }; + + /** + * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.DotnetSettings} message DotnetSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DotnetSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.ignoredResources = []; + object.forcedNamespaceAliases = []; + object.handwrittenSignatures = []; + } + if (options.objects || options.defaults) { + object.renamedServices = {}; + object.renamedResources = {}; + } + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + var keys2; + if (message.renamedServices && (keys2 = Object.keys(message.renamedServices)).length) { + object.renamedServices = {}; + for (var j = 0; j < keys2.length; ++j) + object.renamedServices[keys2[j]] = message.renamedServices[keys2[j]]; + } + if (message.renamedResources && (keys2 = Object.keys(message.renamedResources)).length) { + object.renamedResources = {}; + for (var j = 0; j < keys2.length; ++j) + object.renamedResources[keys2[j]] = message.renamedResources[keys2[j]]; + } + if (message.ignoredResources && message.ignoredResources.length) { + object.ignoredResources = []; + for (var j = 0; j < message.ignoredResources.length; ++j) + object.ignoredResources[j] = message.ignoredResources[j]; + } + if (message.forcedNamespaceAliases && message.forcedNamespaceAliases.length) { + object.forcedNamespaceAliases = []; + for (var j = 0; j < message.forcedNamespaceAliases.length; ++j) + object.forcedNamespaceAliases[j] = message.forcedNamespaceAliases[j]; + } + if (message.handwrittenSignatures && message.handwrittenSignatures.length) { + object.handwrittenSignatures = []; + for (var j = 0; j < message.handwrittenSignatures.length; ++j) + object.handwrittenSignatures[j] = message.handwrittenSignatures[j]; + } + return object; + }; + + /** + * Converts this DotnetSettings to JSON. + * @function toJSON + * @memberof google.api.DotnetSettings + * @instance + * @returns {Object.} JSON object + */ + DotnetSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DotnetSettings + * @function getTypeUrl + * @memberof google.api.DotnetSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DotnetSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.DotnetSettings"; + }; + + return DotnetSettings; + })(); + + api.RubySettings = (function() { + + /** + * Properties of a RubySettings. + * @memberof google.api + * @interface IRubySettings + * @property {google.api.ICommonLanguageSettings|null} [common] RubySettings common + */ + + /** + * Constructs a new RubySettings. + * @memberof google.api + * @classdesc Represents a RubySettings. + * @implements IRubySettings + * @constructor + * @param {google.api.IRubySettings=} [properties] Properties to set + */ + function RubySettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RubySettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.RubySettings + * @instance + */ + RubySettings.prototype.common = null; + + /** + * Creates a new RubySettings instance using the specified properties. + * @function create + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings=} [properties] Properties to set + * @returns {google.api.RubySettings} RubySettings instance + */ + RubySettings.create = function create(properties) { + return new RubySettings(properties); + }; + + /** + * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @function encode + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings} message RubySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RubySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings} message RubySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RubySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RubySettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.RubySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.RubySettings} RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RubySettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.RubySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RubySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.RubySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.RubySettings} RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RubySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RubySettings message. + * @function verify + * @memberof google.api.RubySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RubySettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.RubySettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.RubySettings} RubySettings + */ + RubySettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.RubySettings) + return object; + var message = new $root.google.api.RubySettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.RubySettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a RubySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.RubySettings + * @static + * @param {google.api.RubySettings} message RubySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RubySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this RubySettings to JSON. + * @function toJSON + * @memberof google.api.RubySettings + * @instance + * @returns {Object.} JSON object + */ + RubySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RubySettings + * @function getTypeUrl + * @memberof google.api.RubySettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RubySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.RubySettings"; + }; + + return RubySettings; + })(); + + api.GoSettings = (function() { + + /** + * Properties of a GoSettings. + * @memberof google.api + * @interface IGoSettings + * @property {google.api.ICommonLanguageSettings|null} [common] GoSettings common + */ + + /** + * Constructs a new GoSettings. + * @memberof google.api + * @classdesc Represents a GoSettings. + * @implements IGoSettings + * @constructor + * @param {google.api.IGoSettings=} [properties] Properties to set + */ + function GoSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GoSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.GoSettings + * @instance + */ + GoSettings.prototype.common = null; + + /** + * Creates a new GoSettings instance using the specified properties. + * @function create + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings=} [properties] Properties to set + * @returns {google.api.GoSettings} GoSettings instance + */ + GoSettings.create = function create(properties) { + return new GoSettings(properties); + }; + + /** + * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @function encode + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings} message GoSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings} message GoSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GoSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.GoSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.GoSettings} GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.GoSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GoSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.GoSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.GoSettings} GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GoSettings message. + * @function verify + * @memberof google.api.GoSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GoSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.GoSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.GoSettings} GoSettings + */ + GoSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.GoSettings) + return object; + var message = new $root.google.api.GoSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.GoSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a GoSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.GoSettings + * @static + * @param {google.api.GoSettings} message GoSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GoSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this GoSettings to JSON. + * @function toJSON + * @memberof google.api.GoSettings + * @instance + * @returns {Object.} JSON object + */ + GoSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GoSettings + * @function getTypeUrl + * @memberof google.api.GoSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GoSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.GoSettings"; + }; + + return GoSettings; + })(); + + api.MethodSettings = (function() { + + /** + * Properties of a MethodSettings. + * @memberof google.api + * @interface IMethodSettings + * @property {string|null} [selector] MethodSettings selector + * @property {google.api.MethodSettings.ILongRunning|null} [longRunning] MethodSettings longRunning + * @property {Array.|null} [autoPopulatedFields] MethodSettings autoPopulatedFields + */ + + /** + * Constructs a new MethodSettings. + * @memberof google.api + * @classdesc Represents a MethodSettings. + * @implements IMethodSettings + * @constructor + * @param {google.api.IMethodSettings=} [properties] Properties to set + */ + function MethodSettings(properties) { + this.autoPopulatedFields = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodSettings selector. + * @member {string} selector + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.selector = ""; + + /** + * MethodSettings longRunning. + * @member {google.api.MethodSettings.ILongRunning|null|undefined} longRunning + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.longRunning = null; + + /** + * MethodSettings autoPopulatedFields. + * @member {Array.} autoPopulatedFields + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.autoPopulatedFields = $util.emptyArray; + + /** + * Creates a new MethodSettings instance using the specified properties. + * @function create + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings=} [properties] Properties to set + * @returns {google.api.MethodSettings} MethodSettings instance + */ + MethodSettings.create = function create(properties) { + return new MethodSettings(properties); + }; + + /** + * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @function encode + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.longRunning != null && Object.hasOwnProperty.call(message, "longRunning")) + $root.google.api.MethodSettings.LongRunning.encode(message.longRunning, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.autoPopulatedFields != null && message.autoPopulatedFields.length) + for (var i = 0; i < message.autoPopulatedFields.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.autoPopulatedFields[i]); + return writer; + }; + + /** + * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.MethodSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.MethodSettings} MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.longRunning = $root.google.api.MethodSettings.LongRunning.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.autoPopulatedFields && message.autoPopulatedFields.length)) + message.autoPopulatedFields = []; + message.autoPopulatedFields.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.MethodSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.MethodSettings} MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodSettings message. + * @function verify + * @memberof google.api.MethodSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.longRunning != null && message.hasOwnProperty("longRunning")) { + var error = $root.google.api.MethodSettings.LongRunning.verify(message.longRunning); + if (error) + return "longRunning." + error; + } + if (message.autoPopulatedFields != null && message.hasOwnProperty("autoPopulatedFields")) { + if (!Array.isArray(message.autoPopulatedFields)) + return "autoPopulatedFields: array expected"; + for (var i = 0; i < message.autoPopulatedFields.length; ++i) + if (!$util.isString(message.autoPopulatedFields[i])) + return "autoPopulatedFields: string[] expected"; + } + return null; + }; + + /** + * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.MethodSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.MethodSettings} MethodSettings + */ + MethodSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.MethodSettings) + return object; + var message = new $root.google.api.MethodSettings(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.longRunning != null) { + if (typeof object.longRunning !== "object") + throw TypeError(".google.api.MethodSettings.longRunning: object expected"); + message.longRunning = $root.google.api.MethodSettings.LongRunning.fromObject(object.longRunning); + } + if (object.autoPopulatedFields) { + if (!Array.isArray(object.autoPopulatedFields)) + throw TypeError(".google.api.MethodSettings.autoPopulatedFields: array expected"); + message.autoPopulatedFields = []; + for (var i = 0; i < object.autoPopulatedFields.length; ++i) + message.autoPopulatedFields[i] = String(object.autoPopulatedFields[i]); + } + return message; + }; + + /** + * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.MethodSettings + * @static + * @param {google.api.MethodSettings} message MethodSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.autoPopulatedFields = []; + if (options.defaults) { + object.selector = ""; + object.longRunning = null; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.longRunning != null && message.hasOwnProperty("longRunning")) + object.longRunning = $root.google.api.MethodSettings.LongRunning.toObject(message.longRunning, options); + if (message.autoPopulatedFields && message.autoPopulatedFields.length) { + object.autoPopulatedFields = []; + for (var j = 0; j < message.autoPopulatedFields.length; ++j) + object.autoPopulatedFields[j] = message.autoPopulatedFields[j]; + } + return object; + }; + + /** + * Converts this MethodSettings to JSON. + * @function toJSON + * @memberof google.api.MethodSettings + * @instance + * @returns {Object.} JSON object + */ + MethodSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodSettings + * @function getTypeUrl + * @memberof google.api.MethodSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.MethodSettings"; + }; + + MethodSettings.LongRunning = (function() { + + /** + * Properties of a LongRunning. + * @memberof google.api.MethodSettings + * @interface ILongRunning + * @property {google.protobuf.IDuration|null} [initialPollDelay] LongRunning initialPollDelay + * @property {number|null} [pollDelayMultiplier] LongRunning pollDelayMultiplier + * @property {google.protobuf.IDuration|null} [maxPollDelay] LongRunning maxPollDelay + * @property {google.protobuf.IDuration|null} [totalPollTimeout] LongRunning totalPollTimeout + */ + + /** + * Constructs a new LongRunning. + * @memberof google.api.MethodSettings + * @classdesc Represents a LongRunning. + * @implements ILongRunning + * @constructor + * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set + */ + function LongRunning(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LongRunning initialPollDelay. + * @member {google.protobuf.IDuration|null|undefined} initialPollDelay + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.initialPollDelay = null; + + /** + * LongRunning pollDelayMultiplier. + * @member {number} pollDelayMultiplier + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.pollDelayMultiplier = 0; + + /** + * LongRunning maxPollDelay. + * @member {google.protobuf.IDuration|null|undefined} maxPollDelay + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.maxPollDelay = null; + + /** + * LongRunning totalPollTimeout. + * @member {google.protobuf.IDuration|null|undefined} totalPollTimeout + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.totalPollTimeout = null; + + /** + * Creates a new LongRunning instance using the specified properties. + * @function create + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set + * @returns {google.api.MethodSettings.LongRunning} LongRunning instance + */ + LongRunning.create = function create(properties) { + return new LongRunning(properties); + }; + + /** + * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @function encode + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunning.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.initialPollDelay != null && Object.hasOwnProperty.call(message, "initialPollDelay")) + $root.google.protobuf.Duration.encode(message.initialPollDelay, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pollDelayMultiplier != null && Object.hasOwnProperty.call(message, "pollDelayMultiplier")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.pollDelayMultiplier); + if (message.maxPollDelay != null && Object.hasOwnProperty.call(message, "maxPollDelay")) + $root.google.protobuf.Duration.encode(message.maxPollDelay, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.totalPollTimeout != null && Object.hasOwnProperty.call(message, "totalPollTimeout")) + $root.google.protobuf.Duration.encode(message.totalPollTimeout, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunning.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LongRunning message from the specified reader or buffer. + * @function decode + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.MethodSettings.LongRunning} LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunning.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings.LongRunning(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.initialPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 2: { + message.pollDelayMultiplier = reader.float(); + break; + } + case 3: { + message.maxPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 4: { + message.totalPollTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LongRunning message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.MethodSettings.LongRunning} LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunning.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LongRunning message. + * @function verify + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LongRunning.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) { + var error = $root.google.protobuf.Duration.verify(message.initialPollDelay); + if (error) + return "initialPollDelay." + error; + } + if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) + if (typeof message.pollDelayMultiplier !== "number") + return "pollDelayMultiplier: number expected"; + if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) { + var error = $root.google.protobuf.Duration.verify(message.maxPollDelay); + if (error) + return "maxPollDelay." + error; + } + if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) { + var error = $root.google.protobuf.Duration.verify(message.totalPollTimeout); + if (error) + return "totalPollTimeout." + error; + } + return null; + }; + + /** + * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {Object.} object Plain object + * @returns {google.api.MethodSettings.LongRunning} LongRunning + */ + LongRunning.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.MethodSettings.LongRunning) + return object; + var message = new $root.google.api.MethodSettings.LongRunning(); + if (object.initialPollDelay != null) { + if (typeof object.initialPollDelay !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.initialPollDelay: object expected"); + message.initialPollDelay = $root.google.protobuf.Duration.fromObject(object.initialPollDelay); + } + if (object.pollDelayMultiplier != null) + message.pollDelayMultiplier = Number(object.pollDelayMultiplier); + if (object.maxPollDelay != null) { + if (typeof object.maxPollDelay !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.maxPollDelay: object expected"); + message.maxPollDelay = $root.google.protobuf.Duration.fromObject(object.maxPollDelay); + } + if (object.totalPollTimeout != null) { + if (typeof object.totalPollTimeout !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.totalPollTimeout: object expected"); + message.totalPollTimeout = $root.google.protobuf.Duration.fromObject(object.totalPollTimeout); + } + return message; + }; + + /** + * Creates a plain object from a LongRunning message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.LongRunning} message LongRunning + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LongRunning.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.initialPollDelay = null; + object.pollDelayMultiplier = 0; + object.maxPollDelay = null; + object.totalPollTimeout = null; + } + if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) + object.initialPollDelay = $root.google.protobuf.Duration.toObject(message.initialPollDelay, options); + if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) + object.pollDelayMultiplier = options.json && !isFinite(message.pollDelayMultiplier) ? String(message.pollDelayMultiplier) : message.pollDelayMultiplier; + if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) + object.maxPollDelay = $root.google.protobuf.Duration.toObject(message.maxPollDelay, options); + if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) + object.totalPollTimeout = $root.google.protobuf.Duration.toObject(message.totalPollTimeout, options); + return object; + }; + + /** + * Converts this LongRunning to JSON. + * @function toJSON + * @memberof google.api.MethodSettings.LongRunning + * @instance + * @returns {Object.} JSON object + */ + LongRunning.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LongRunning + * @function getTypeUrl + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LongRunning.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.MethodSettings.LongRunning"; + }; + + return LongRunning; + })(); + + return MethodSettings; + })(); + + /** + * ClientLibraryOrganization enum. + * @name google.api.ClientLibraryOrganization + * @enum {number} + * @property {number} CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED=0 CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED value + * @property {number} CLOUD=1 CLOUD value + * @property {number} ADS=2 ADS value + * @property {number} PHOTOS=3 PHOTOS value + * @property {number} STREET_VIEW=4 STREET_VIEW value + * @property {number} SHOPPING=5 SHOPPING value + * @property {number} GEO=6 GEO value + * @property {number} GENERATIVE_AI=7 GENERATIVE_AI value + */ + api.ClientLibraryOrganization = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED"] = 0; + values[valuesById[1] = "CLOUD"] = 1; + values[valuesById[2] = "ADS"] = 2; + values[valuesById[3] = "PHOTOS"] = 3; + values[valuesById[4] = "STREET_VIEW"] = 4; + values[valuesById[5] = "SHOPPING"] = 5; + values[valuesById[6] = "GEO"] = 6; + values[valuesById[7] = "GENERATIVE_AI"] = 7; + return values; + })(); + + /** + * ClientLibraryDestination enum. + * @name google.api.ClientLibraryDestination + * @enum {number} + * @property {number} CLIENT_LIBRARY_DESTINATION_UNSPECIFIED=0 CLIENT_LIBRARY_DESTINATION_UNSPECIFIED value + * @property {number} GITHUB=10 GITHUB value + * @property {number} PACKAGE_MANAGER=20 PACKAGE_MANAGER value + */ + api.ClientLibraryDestination = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED"] = 0; + values[valuesById[10] = "GITHUB"] = 10; + values[valuesById[20] = "PACKAGE_MANAGER"] = 20; + return values; + })(); + + /** + * LaunchStage enum. + * @name google.api.LaunchStage + * @enum {number} + * @property {number} LAUNCH_STAGE_UNSPECIFIED=0 LAUNCH_STAGE_UNSPECIFIED value + * @property {number} UNIMPLEMENTED=6 UNIMPLEMENTED value + * @property {number} PRELAUNCH=7 PRELAUNCH value + * @property {number} EARLY_ACCESS=1 EARLY_ACCESS value + * @property {number} ALPHA=2 ALPHA value + * @property {number} BETA=3 BETA value + * @property {number} GA=4 GA value + * @property {number} DEPRECATED=5 DEPRECATED value + */ + api.LaunchStage = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LAUNCH_STAGE_UNSPECIFIED"] = 0; + values[valuesById[6] = "UNIMPLEMENTED"] = 6; + values[valuesById[7] = "PRELAUNCH"] = 7; + values[valuesById[1] = "EARLY_ACCESS"] = 1; + values[valuesById[2] = "ALPHA"] = 2; + values[valuesById[3] = "BETA"] = 3; + values[valuesById[4] = "GA"] = 4; + values[valuesById[5] = "DEPRECATED"] = 5; + return values; + })(); + + return api; + })(); + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + var protobuf = {}; + + protobuf.FileDescriptorSet = (function() { + + /** + * Properties of a FileDescriptorSet. + * @memberof google.protobuf + * @interface IFileDescriptorSet + * @property {Array.|null} [file] FileDescriptorSet file + */ + + /** + * Constructs a new FileDescriptorSet. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorSet. + * @implements IFileDescriptorSet + * @constructor + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + */ + function FileDescriptorSet(properties) { + this.file = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileDescriptorSet file. + * @member {Array.} file + * @memberof google.protobuf.FileDescriptorSet + * @instance + */ + FileDescriptorSet.prototype.file = $util.emptyArray; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance + */ + FileDescriptorSet.create = function create(properties) { + return new FileDescriptorSet(properties); + }; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.file != null && message.file.length) + for (var i = 0; i < message.file.length; ++i) + $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.file && message.file.length)) + message.file = []; + message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorSet message. + * @function verify + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.file != null && message.hasOwnProperty("file")) { + if (!Array.isArray(message.file)) + return "file: array expected"; + for (var i = 0; i < message.file.length; ++i) { + var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]); + if (error) + return "file." + error; + } + } + return null; + }; + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + */ + FileDescriptorSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorSet) + return object; + var message = new $root.google.protobuf.FileDescriptorSet(); + if (object.file) { + if (!Array.isArray(object.file)) + throw TypeError(".google.protobuf.FileDescriptorSet.file: array expected"); + message.file = []; + for (var i = 0; i < object.file.length; ++i) { + if (typeof object.file[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected"); + message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.file = []; + if (message.file && message.file.length) { + object.file = []; + for (var j = 0; j < message.file.length; ++j) + object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options); + } + return object; + }; + + /** + * Converts this FileDescriptorSet to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorSet + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileDescriptorSet + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorSet"; + }; + + return FileDescriptorSet; + })(); + + /** + * Edition enum. + * @name google.protobuf.Edition + * @enum {number} + * @property {number} EDITION_UNKNOWN=0 EDITION_UNKNOWN value + * @property {number} EDITION_PROTO2=998 EDITION_PROTO2 value + * @property {number} EDITION_PROTO3=999 EDITION_PROTO3 value + * @property {number} EDITION_2023=1000 EDITION_2023 value + * @property {number} EDITION_2024=1001 EDITION_2024 value + * @property {number} EDITION_1_TEST_ONLY=1 EDITION_1_TEST_ONLY value + * @property {number} EDITION_2_TEST_ONLY=2 EDITION_2_TEST_ONLY value + * @property {number} EDITION_99997_TEST_ONLY=99997 EDITION_99997_TEST_ONLY value + * @property {number} EDITION_99998_TEST_ONLY=99998 EDITION_99998_TEST_ONLY value + * @property {number} EDITION_99999_TEST_ONLY=99999 EDITION_99999_TEST_ONLY value + * @property {number} EDITION_MAX=2147483647 EDITION_MAX value + */ + protobuf.Edition = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EDITION_UNKNOWN"] = 0; + values[valuesById[998] = "EDITION_PROTO2"] = 998; + values[valuesById[999] = "EDITION_PROTO3"] = 999; + values[valuesById[1000] = "EDITION_2023"] = 1000; + values[valuesById[1001] = "EDITION_2024"] = 1001; + values[valuesById[1] = "EDITION_1_TEST_ONLY"] = 1; + values[valuesById[2] = "EDITION_2_TEST_ONLY"] = 2; + values[valuesById[99997] = "EDITION_99997_TEST_ONLY"] = 99997; + values[valuesById[99998] = "EDITION_99998_TEST_ONLY"] = 99998; + values[valuesById[99999] = "EDITION_99999_TEST_ONLY"] = 99999; + values[valuesById[2147483647] = "EDITION_MAX"] = 2147483647; + return values; + })(); + + protobuf.FileDescriptorProto = (function() { + + /** + * Properties of a FileDescriptorProto. + * @memberof google.protobuf + * @interface IFileDescriptorProto + * @property {string|null} [name] FileDescriptorProto name + * @property {string|null} ["package"] FileDescriptorProto package + * @property {Array.|null} [dependency] FileDescriptorProto dependency + * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency + * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency + * @property {Array.|null} [messageType] FileDescriptorProto messageType + * @property {Array.|null} [enumType] FileDescriptorProto enumType + * @property {Array.|null} [service] FileDescriptorProto service + * @property {Array.|null} [extension] FileDescriptorProto extension + * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options + * @property {google.protobuf.ISourceCodeInfo|null} [sourceCodeInfo] FileDescriptorProto sourceCodeInfo + * @property {string|null} [syntax] FileDescriptorProto syntax + * @property {google.protobuf.Edition|null} [edition] FileDescriptorProto edition + */ + + /** + * Constructs a new FileDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorProto. + * @implements IFileDescriptorProto + * @constructor + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + */ + function FileDescriptorProto(properties) { + this.dependency = []; + this.publicDependency = []; + this.weakDependency = []; + this.messageType = []; + this.enumType = []; + this.service = []; + this.extension = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.name = ""; + + /** + * FileDescriptorProto package. + * @member {string} package + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype["package"] = ""; + + /** + * FileDescriptorProto dependency. + * @member {Array.} dependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.dependency = $util.emptyArray; + + /** + * FileDescriptorProto publicDependency. + * @member {Array.} publicDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.publicDependency = $util.emptyArray; + + /** + * FileDescriptorProto weakDependency. + * @member {Array.} weakDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.weakDependency = $util.emptyArray; + + /** + * FileDescriptorProto messageType. + * @member {Array.} messageType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.messageType = $util.emptyArray; + + /** + * FileDescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * FileDescriptorProto service. + * @member {Array.} service + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.service = $util.emptyArray; + + /** + * FileDescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.extension = $util.emptyArray; + + /** + * FileDescriptorProto options. + * @member {google.protobuf.IFileOptions|null|undefined} options + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.options = null; + + /** + * FileDescriptorProto sourceCodeInfo. + * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.sourceCodeInfo = null; + + /** + * FileDescriptorProto syntax. + * @member {string} syntax + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.syntax = ""; + + /** + * FileDescriptorProto edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.edition = 0; + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance + */ + FileDescriptorProto.create = function create(properties) { + return new FileDescriptorProto(properties); + }; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); + if (message.dependency != null && message.dependency.length) + for (var i = 0; i < message.dependency.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); + if (message.messageType != null && message.messageType.length) + for (var i = 0; i < message.messageType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.service != null && message.service.length) + for (var i = 0; i < message.service.length; ++i) + $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo")) + $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.publicDependency != null && message.publicDependency.length) + for (var i = 0; i < message.publicDependency.length; ++i) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]); + if (message.weakDependency != null && message.weakDependency.length) + for (var i = 0; i < message.weakDependency.length; ++i) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); + if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 14, wireType 0 =*/112).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message["package"] = reader.string(); + break; + } + case 3: { + if (!(message.dependency && message.dependency.length)) + message.dependency = []; + message.dependency.push(reader.string()); + break; + } + case 10: { + if (!(message.publicDependency && message.publicDependency.length)) + message.publicDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.publicDependency.push(reader.int32()); + } else + message.publicDependency.push(reader.int32()); + break; + } + case 11: { + if (!(message.weakDependency && message.weakDependency.length)) + message.weakDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.weakDependency.push(reader.int32()); + } else + message.weakDependency.push(reader.int32()); + break; + } + case 4: { + if (!(message.messageType && message.messageType.length)) + message.messageType = []; + message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.service && message.service.length)) + message.service = []; + message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 7: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 8: { + message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32()); + break; + } + case 12: { + message.syntax = reader.string(); + break; + } + case 14: { + message.edition = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorProto message. + * @function verify + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message["package"] != null && message.hasOwnProperty("package")) + if (!$util.isString(message["package"])) + return "package: string expected"; + if (message.dependency != null && message.hasOwnProperty("dependency")) { + if (!Array.isArray(message.dependency)) + return "dependency: array expected"; + for (var i = 0; i < message.dependency.length; ++i) + if (!$util.isString(message.dependency[i])) + return "dependency: string[] expected"; + } + if (message.publicDependency != null && message.hasOwnProperty("publicDependency")) { + if (!Array.isArray(message.publicDependency)) + return "publicDependency: array expected"; + for (var i = 0; i < message.publicDependency.length; ++i) + if (!$util.isInteger(message.publicDependency[i])) + return "publicDependency: integer[] expected"; + } + if (message.weakDependency != null && message.hasOwnProperty("weakDependency")) { + if (!Array.isArray(message.weakDependency)) + return "weakDependency: array expected"; + for (var i = 0; i < message.weakDependency.length; ++i) + if (!$util.isInteger(message.weakDependency[i])) + return "weakDependency: integer[] expected"; + } + if (message.messageType != null && message.hasOwnProperty("messageType")) { + if (!Array.isArray(message.messageType)) + return "messageType: array expected"; + for (var i = 0; i < message.messageType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.messageType[i]); + if (error) + return "messageType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.service != null && message.hasOwnProperty("service")) { + if (!Array.isArray(message.service)) + return "service: array expected"; + for (var i = 0; i < message.service.length; ++i) { + var error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i]); + if (error) + return "service." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FileOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) { + var error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo); + if (error) + return "sourceCodeInfo." + error; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + if (!$util.isString(message.syntax)) + return "syntax: string expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + return null; + }; + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + */ + FileDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorProto) + return object; + var message = new $root.google.protobuf.FileDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object["package"] != null) + message["package"] = String(object["package"]); + if (object.dependency) { + if (!Array.isArray(object.dependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.dependency: array expected"); + message.dependency = []; + for (var i = 0; i < object.dependency.length; ++i) + message.dependency[i] = String(object.dependency[i]); + } + if (object.publicDependency) { + if (!Array.isArray(object.publicDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.publicDependency: array expected"); + message.publicDependency = []; + for (var i = 0; i < object.publicDependency.length; ++i) + message.publicDependency[i] = object.publicDependency[i] | 0; + } + if (object.weakDependency) { + if (!Array.isArray(object.weakDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.weakDependency: array expected"); + message.weakDependency = []; + for (var i = 0; i < object.weakDependency.length; ++i) + message.weakDependency[i] = object.weakDependency[i] | 0; + } + if (object.messageType) { + if (!Array.isArray(object.messageType)) + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); + message.messageType = []; + for (var i = 0; i < object.messageType.length; ++i) { + if (typeof object.messageType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: object expected"); + message.messageType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.messageType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.service) { + if (!Array.isArray(object.service)) + throw TypeError(".google.protobuf.FileDescriptorProto.service: array expected"); + message.service = []; + for (var i = 0; i < object.service.length; ++i) { + if (typeof object.service[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.service: object expected"); + message.service[i] = $root.google.protobuf.ServiceDescriptorProto.fromObject(object.service[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.FileDescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FileOptions.fromObject(object.options); + } + if (object.sourceCodeInfo != null) { + if (typeof object.sourceCodeInfo !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.sourceCodeInfo: object expected"); + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.fromObject(object.sourceCodeInfo); + } + if (object.syntax != null) + message.syntax = String(object.syntax); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + return message; + }; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.dependency = []; + object.messageType = []; + object.enumType = []; + object.service = []; + object.extension = []; + object.publicDependency = []; + object.weakDependency = []; + } + if (options.defaults) { + object.name = ""; + object["package"] = ""; + object.options = null; + object.sourceCodeInfo = null; + object.syntax = ""; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message["package"] != null && message.hasOwnProperty("package")) + object["package"] = message["package"]; + if (message.dependency && message.dependency.length) { + object.dependency = []; + for (var j = 0; j < message.dependency.length; ++j) + object.dependency[j] = message.dependency[j]; + } + if (message.messageType && message.messageType.length) { + object.messageType = []; + for (var j = 0; j < message.messageType.length; ++j) + object.messageType[j] = $root.google.protobuf.DescriptorProto.toObject(message.messageType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.service && message.service.length) { + object.service = []; + for (var j = 0; j < message.service.length; ++j) + object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FileOptions.toObject(message.options, options); + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) + object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options); + if (message.publicDependency && message.publicDependency.length) { + object.publicDependency = []; + for (var j = 0; j < message.publicDependency.length; ++j) + object.publicDependency[j] = message.publicDependency[j]; + } + if (message.weakDependency && message.weakDependency.length) { + object.weakDependency = []; + for (var j = 0; j < message.weakDependency.length; ++j) + object.weakDependency[j] = message.weakDependency[j]; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + object.syntax = message.syntax; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this FileDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorProto"; + }; + + return FileDescriptorProto; + })(); + + protobuf.DescriptorProto = (function() { + + /** + * Properties of a DescriptorProto. + * @memberof google.protobuf + * @interface IDescriptorProto + * @property {string|null} [name] DescriptorProto name + * @property {Array.|null} [field] DescriptorProto field + * @property {Array.|null} [extension] DescriptorProto extension + * @property {Array.|null} [nestedType] DescriptorProto nestedType + * @property {Array.|null} [enumType] DescriptorProto enumType + * @property {Array.|null} [extensionRange] DescriptorProto extensionRange + * @property {Array.|null} [oneofDecl] DescriptorProto oneofDecl + * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options + * @property {Array.|null} [reservedRange] DescriptorProto reservedRange + * @property {Array.|null} [reservedName] DescriptorProto reservedName + */ + + /** + * Constructs a new DescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a DescriptorProto. + * @implements IDescriptorProto + * @constructor + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + */ + function DescriptorProto(properties) { + this.field = []; + this.extension = []; + this.nestedType = []; + this.enumType = []; + this.extensionRange = []; + this.oneofDecl = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DescriptorProto name. + * @member {string} name + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.name = ""; + + /** + * DescriptorProto field. + * @member {Array.} field + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.field = $util.emptyArray; + + /** + * DescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extension = $util.emptyArray; + + /** + * DescriptorProto nestedType. + * @member {Array.} nestedType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.nestedType = $util.emptyArray; + + /** + * DescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * DescriptorProto extensionRange. + * @member {Array.} extensionRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extensionRange = $util.emptyArray; + + /** + * DescriptorProto oneofDecl. + * @member {Array.} oneofDecl + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.oneofDecl = $util.emptyArray; + + /** + * DescriptorProto options. + * @member {google.protobuf.IMessageOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.options = null; + + /** + * DescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * DescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto} DescriptorProto instance + */ + DescriptorProto.create = function create(properties) { + return new DescriptorProto(properties); + }; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.field != null && message.field.length) + for (var i = 0; i < message.field.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nestedType != null && message.nestedType.length) + for (var i = 0; i < message.nestedType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.nestedType[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.extensionRange != null && message.extensionRange.length) + for (var i = 0; i < message.extensionRange.length; ++i) + $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extensionRange[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.oneofDecl != null && message.oneofDecl.length) + for (var i = 0; i < message.oneofDecl.length; ++i) + $root.google.protobuf.OneofDescriptorProto.encode(message.oneofDecl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.field && message.field.length)) + message.field = []; + message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.nestedType && message.nestedType.length)) + message.nestedType = []; + message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.extensionRange && message.extensionRange.length)) + message.extensionRange = []; + message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32())); + break; + } + case 8: { + if (!(message.oneofDecl && message.oneofDecl.length)) + message.oneofDecl = []; + message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 7: { + message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32())); + break; + } + case 10: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DescriptorProto message. + * @function verify + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.field != null && message.hasOwnProperty("field")) { + if (!Array.isArray(message.field)) + return "field: array expected"; + for (var i = 0; i < message.field.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.field[i]); + if (error) + return "field." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.nestedType != null && message.hasOwnProperty("nestedType")) { + if (!Array.isArray(message.nestedType)) + return "nestedType: array expected"; + for (var i = 0; i < message.nestedType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.nestedType[i]); + if (error) + return "nestedType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.extensionRange != null && message.hasOwnProperty("extensionRange")) { + if (!Array.isArray(message.extensionRange)) + return "extensionRange: array expected"; + for (var i = 0; i < message.extensionRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ExtensionRange.verify(message.extensionRange[i]); + if (error) + return "extensionRange." + error; + } + } + if (message.oneofDecl != null && message.hasOwnProperty("oneofDecl")) { + if (!Array.isArray(message.oneofDecl)) + return "oneofDecl: array expected"; + for (var i = 0; i < message.oneofDecl.length; ++i) { + var error = $root.google.protobuf.OneofDescriptorProto.verify(message.oneofDecl[i]); + if (error) + return "oneofDecl." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MessageOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto} DescriptorProto + */ + DescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto) + return object; + var message = new $root.google.protobuf.DescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.field) { + if (!Array.isArray(object.field)) + throw TypeError(".google.protobuf.DescriptorProto.field: array expected"); + message.field = []; + for (var i = 0; i < object.field.length; ++i) { + if (typeof object.field[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.field: object expected"); + message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.DescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.nestedType) { + if (!Array.isArray(object.nestedType)) + throw TypeError(".google.protobuf.DescriptorProto.nestedType: array expected"); + message.nestedType = []; + for (var i = 0; i < object.nestedType.length; ++i) { + if (typeof object.nestedType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.nestedType: object expected"); + message.nestedType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nestedType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.DescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.extensionRange) { + if (!Array.isArray(object.extensionRange)) + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: array expected"); + message.extensionRange = []; + for (var i = 0; i < object.extensionRange.length; ++i) { + if (typeof object.extensionRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: object expected"); + message.extensionRange[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extensionRange[i]); + } + } + if (object.oneofDecl) { + if (!Array.isArray(object.oneofDecl)) + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: array expected"); + message.oneofDecl = []; + for (var i = 0; i < object.oneofDecl.length; ++i) { + if (typeof object.oneofDecl[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: object expected"); + message.oneofDecl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneofDecl[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MessageOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.DescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.DescriptorProto} message DescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.field = []; + object.nestedType = []; + object.enumType = []; + object.extensionRange = []; + object.extension = []; + object.oneofDecl = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.field && message.field.length) { + object.field = []; + for (var j = 0; j < message.field.length; ++j) + object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options); + } + if (message.nestedType && message.nestedType.length) { + object.nestedType = []; + for (var j = 0; j < message.nestedType.length; ++j) + object.nestedType[j] = $root.google.protobuf.DescriptorProto.toObject(message.nestedType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.extensionRange && message.extensionRange.length) { + object.extensionRange = []; + for (var j = 0; j < message.extensionRange.length; ++j) + object.extensionRange[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extensionRange[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options); + if (message.oneofDecl && message.oneofDecl.length) { + object.oneofDecl = []; + for (var j = 0; j < message.oneofDecl.length; ++j) + object.oneofDecl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneofDecl[j], options); + } + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this DescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto + * @instance + * @returns {Object.} JSON object + */ + DescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto"; + }; + + DescriptorProto.ExtensionRange = (function() { + + /** + * Properties of an ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @interface IExtensionRange + * @property {number|null} [start] ExtensionRange start + * @property {number|null} [end] ExtensionRange end + * @property {google.protobuf.IExtensionRangeOptions|null} [options] ExtensionRange options + */ + + /** + * Constructs a new ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents an ExtensionRange. + * @implements IExtensionRange + * @constructor + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + */ + function ExtensionRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.start = 0; + + /** + * ExtensionRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.end = 0; + + /** + * ExtensionRange options. + * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.options = null; + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance + */ + ExtensionRange.create = function create(properties) { + return new ExtensionRange(properties); + }; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.ExtensionRangeOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ExtensionRangeOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + */ + ExtensionRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange.options: object expected"); + message.options = $root.google.protobuf.ExtensionRangeOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + object.options = null; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ExtensionRangeOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ExtensionRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + * @returns {Object.} JSON object + */ + ExtensionRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtensionRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ExtensionRange"; + }; + + return ExtensionRange; + })(); + + DescriptorProto.ReservedRange = (function() { + + /** + * Properties of a ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @interface IReservedRange + * @property {number|null} [start] ReservedRange start + * @property {number|null} [end] ReservedRange end + */ + + /** + * Constructs a new ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents a ReservedRange. + * @implements IReservedRange + * @constructor + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + */ + function ReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReservedRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.start = 0; + + /** + * ReservedRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.end = 0; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance + */ + ReservedRange.create = function create(properties) { + return new ReservedRange(properties); + }; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReservedRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + */ + ReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this ReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + * @returns {Object.} JSON object + */ + ReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReservedRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ReservedRange"; + }; + + return ReservedRange; + })(); + + return DescriptorProto; + })(); + + protobuf.ExtensionRangeOptions = (function() { + + /** + * Properties of an ExtensionRangeOptions. + * @memberof google.protobuf + * @interface IExtensionRangeOptions + * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption + * @property {Array.|null} [declaration] ExtensionRangeOptions declaration + * @property {google.protobuf.IFeatureSet|null} [features] ExtensionRangeOptions features + * @property {google.protobuf.ExtensionRangeOptions.VerificationState|null} [verification] ExtensionRangeOptions verification + */ + + /** + * Constructs a new ExtensionRangeOptions. + * @memberof google.protobuf + * @classdesc Represents an ExtensionRangeOptions. + * @implements IExtensionRangeOptions + * @constructor + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + */ + function ExtensionRangeOptions(properties) { + this.uninterpretedOption = []; + this.declaration = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRangeOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * ExtensionRangeOptions declaration. + * @member {Array.} declaration + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.declaration = $util.emptyArray; + + /** + * ExtensionRangeOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.features = null; + + /** + * ExtensionRangeOptions verification. + * @member {google.protobuf.ExtensionRangeOptions.VerificationState} verification + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.verification = 1; + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions instance + */ + ExtensionRangeOptions.create = function create(properties) { + return new ExtensionRangeOptions(properties); + }; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.declaration != null && message.declaration.length) + for (var i = 0; i < message.declaration.length; ++i) + $root.google.protobuf.ExtensionRangeOptions.Declaration.encode(message.declaration[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.verification != null && Object.hasOwnProperty.call(message, "verification")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.verification); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.declaration && message.declaration.length)) + message.declaration = []; + message.declaration.push($root.google.protobuf.ExtensionRangeOptions.Declaration.decode(reader, reader.uint32())); + break; + } + case 50: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 3: { + message.verification = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRangeOptions message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRangeOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message.declaration != null && message.hasOwnProperty("declaration")) { + if (!Array.isArray(message.declaration)) + return "declaration: array expected"; + for (var i = 0; i < message.declaration.length; ++i) { + var error = $root.google.protobuf.ExtensionRangeOptions.Declaration.verify(message.declaration[i]); + if (error) + return "declaration." + error; + } + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.verification != null && message.hasOwnProperty("verification")) + switch (message.verification) { + default: + return "verification: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + */ + ExtensionRangeOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions) + return object; + var message = new $root.google.protobuf.ExtensionRangeOptions(); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object.declaration) { + if (!Array.isArray(object.declaration)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: array expected"); + message.declaration = []; + for (var i = 0; i < object.declaration.length; ++i) { + if (typeof object.declaration[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: object expected"); + message.declaration[i] = $root.google.protobuf.ExtensionRangeOptions.Declaration.fromObject(object.declaration[i]); + } + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + switch (object.verification) { + case "DECLARATION": + case 0: + message.verification = 0; + break; + default: + if (typeof object.verification === "number") { + message.verification = object.verification; + break; + } + break; + case "UNVERIFIED": + case 1: + message.verification = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRangeOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.declaration = []; + object.uninterpretedOption = []; + } + if (options.defaults) { + object.verification = options.enums === String ? "UNVERIFIED" : 1; + object.features = null; + } + if (message.declaration && message.declaration.length) { + object.declaration = []; + for (var j = 0; j < message.declaration.length; ++j) + object.declaration[j] = $root.google.protobuf.ExtensionRangeOptions.Declaration.toObject(message.declaration[j], options); + } + if (message.verification != null && message.hasOwnProperty("verification")) + object.verification = options.enums === String ? $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] === undefined ? message.verification : $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] : message.verification; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + * @returns {Object.} JSON object + */ + ExtensionRangeOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @function getTypeUrl + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRangeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions"; + }; + + ExtensionRangeOptions.Declaration = (function() { + + /** + * Properties of a Declaration. + * @memberof google.protobuf.ExtensionRangeOptions + * @interface IDeclaration + * @property {number|null} [number] Declaration number + * @property {string|null} [fullName] Declaration fullName + * @property {string|null} [type] Declaration type + * @property {boolean|null} [reserved] Declaration reserved + * @property {boolean|null} [repeated] Declaration repeated + */ + + /** + * Constructs a new Declaration. + * @memberof google.protobuf.ExtensionRangeOptions + * @classdesc Represents a Declaration. + * @implements IDeclaration + * @constructor + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set + */ + function Declaration(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Declaration number. + * @member {number} number + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.number = 0; + + /** + * Declaration fullName. + * @member {string} fullName + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.fullName = ""; + + /** + * Declaration type. + * @member {string} type + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.type = ""; + + /** + * Declaration reserved. + * @member {boolean} reserved + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.reserved = false; + + /** + * Declaration repeated. + * @member {boolean} repeated + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.repeated = false; + + /** + * Creates a new Declaration instance using the specified properties. + * @function create + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration instance + */ + Declaration.create = function create(properties) { + return new Declaration(properties); + }; + + /** + * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Declaration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.number); + if (message.fullName != null && Object.hasOwnProperty.call(message, "fullName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.fullName); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.type); + if (message.reserved != null && Object.hasOwnProperty.call(message, "reserved")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.reserved); + if (message.repeated != null && Object.hasOwnProperty.call(message, "repeated")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.repeated); + return writer; + }; + + /** + * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Declaration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Declaration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Declaration.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.number = reader.int32(); + break; + } + case 2: { + message.fullName = reader.string(); + break; + } + case 3: { + message.type = reader.string(); + break; + } + case 5: { + message.reserved = reader.bool(); + break; + } + case 6: { + message.repeated = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Declaration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Declaration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Declaration message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Declaration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.fullName != null && message.hasOwnProperty("fullName")) + if (!$util.isString(message.fullName)) + return "fullName: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.reserved != null && message.hasOwnProperty("reserved")) + if (typeof message.reserved !== "boolean") + return "reserved: boolean expected"; + if (message.repeated != null && message.hasOwnProperty("repeated")) + if (typeof message.repeated !== "boolean") + return "repeated: boolean expected"; + return null; + }; + + /** + * Creates a Declaration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + */ + Declaration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions.Declaration) + return object; + var message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); + if (object.number != null) + message.number = object.number | 0; + if (object.fullName != null) + message.fullName = String(object.fullName); + if (object.type != null) + message.type = String(object.type); + if (object.reserved != null) + message.reserved = Boolean(object.reserved); + if (object.repeated != null) + message.repeated = Boolean(object.repeated); + return message; + }; + + /** + * Creates a plain object from a Declaration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.Declaration} message Declaration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Declaration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.number = 0; + object.fullName = ""; + object.type = ""; + object.reserved = false; + object.repeated = false; + } + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.fullName != null && message.hasOwnProperty("fullName")) + object.fullName = message.fullName; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.reserved != null && message.hasOwnProperty("reserved")) + object.reserved = message.reserved; + if (message.repeated != null && message.hasOwnProperty("repeated")) + object.repeated = message.repeated; + return object; + }; + + /** + * Converts this Declaration to JSON. + * @function toJSON + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + * @returns {Object.} JSON object + */ + Declaration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Declaration + * @function getTypeUrl + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Declaration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions.Declaration"; + }; + + return Declaration; + })(); + + /** + * VerificationState enum. + * @name google.protobuf.ExtensionRangeOptions.VerificationState + * @enum {number} + * @property {number} DECLARATION=0 DECLARATION value + * @property {number} UNVERIFIED=1 UNVERIFIED value + */ + ExtensionRangeOptions.VerificationState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DECLARATION"] = 0; + values[valuesById[1] = "UNVERIFIED"] = 1; + return values; + })(); + + return ExtensionRangeOptions; + })(); + + protobuf.FieldDescriptorProto = (function() { + + /** + * Properties of a FieldDescriptorProto. + * @memberof google.protobuf + * @interface IFieldDescriptorProto + * @property {string|null} [name] FieldDescriptorProto name + * @property {number|null} [number] FieldDescriptorProto number + * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label + * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type + * @property {string|null} [typeName] FieldDescriptorProto typeName + * @property {string|null} [extendee] FieldDescriptorProto extendee + * @property {string|null} [defaultValue] FieldDescriptorProto defaultValue + * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex + * @property {string|null} [jsonName] FieldDescriptorProto jsonName + * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options + * @property {boolean|null} [proto3Optional] FieldDescriptorProto proto3Optional + */ + + /** + * Constructs a new FieldDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FieldDescriptorProto. + * @implements IFieldDescriptorProto + * @constructor + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + */ + function FieldDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.name = ""; + + /** + * FieldDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.number = 0; + + /** + * FieldDescriptorProto label. + * @member {google.protobuf.FieldDescriptorProto.Label} label + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.label = 1; + + /** + * FieldDescriptorProto type. + * @member {google.protobuf.FieldDescriptorProto.Type} type + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.type = 1; + + /** + * FieldDescriptorProto typeName. + * @member {string} typeName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.typeName = ""; + + /** + * FieldDescriptorProto extendee. + * @member {string} extendee + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.extendee = ""; + + /** + * FieldDescriptorProto defaultValue. + * @member {string} defaultValue + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.defaultValue = ""; + + /** + * FieldDescriptorProto oneofIndex. + * @member {number} oneofIndex + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.oneofIndex = 0; + + /** + * FieldDescriptorProto jsonName. + * @member {string} jsonName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.jsonName = ""; + + /** + * FieldDescriptorProto options. + * @member {google.protobuf.IFieldOptions|null|undefined} options + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.options = null; + + /** + * FieldDescriptorProto proto3Optional. + * @member {boolean} proto3Optional + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.proto3Optional = false; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance + */ + FieldDescriptorProto.create = function create(properties) { + return new FieldDescriptorProto(properties); + }; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); + if (message.label != null && Object.hasOwnProperty.call(message, "label")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); + if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); + if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); + if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); + if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.proto3Optional); + return writer; + }; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.number = reader.int32(); + break; + } + case 4: { + message.label = reader.int32(); + break; + } + case 5: { + message.type = reader.int32(); + break; + } + case 6: { + message.typeName = reader.string(); + break; + } + case 2: { + message.extendee = reader.string(); + break; + } + case 7: { + message.defaultValue = reader.string(); + break; + } + case 9: { + message.oneofIndex = reader.int32(); + break; + } + case 10: { + message.jsonName = reader.string(); + break; + } + case 8: { + message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); + break; + } + case 17: { + message.proto3Optional = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldDescriptorProto message. + * @function verify + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.label != null && message.hasOwnProperty("label")) + switch (message.label) { + default: + return "label: enum value expected"; + case 1: + case 3: + case 2: + break; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + break; + } + if (message.typeName != null && message.hasOwnProperty("typeName")) + if (!$util.isString(message.typeName)) + return "typeName: string expected"; + if (message.extendee != null && message.hasOwnProperty("extendee")) + if (!$util.isString(message.extendee)) + return "extendee: string expected"; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + if (!$util.isString(message.defaultValue)) + return "defaultValue: string expected"; + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + if (!$util.isInteger(message.oneofIndex)) + return "oneofIndex: integer expected"; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + if (!$util.isString(message.jsonName)) + return "jsonName: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FieldOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + if (typeof message.proto3Optional !== "boolean") + return "proto3Optional: boolean expected"; + return null; + }; + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + */ + FieldDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldDescriptorProto) + return object; + var message = new $root.google.protobuf.FieldDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + switch (object.label) { + default: + if (typeof object.label === "number") { + message.label = object.label; + break; + } + break; + case "LABEL_OPTIONAL": + case 1: + message.label = 1; + break; + case "LABEL_REPEATED": + case 3: + message.label = 3; + break; + case "LABEL_REQUIRED": + case 2: + message.label = 2; + break; + } + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_DOUBLE": + case 1: + message.type = 1; + break; + case "TYPE_FLOAT": + case 2: + message.type = 2; + break; + case "TYPE_INT64": + case 3: + message.type = 3; + break; + case "TYPE_UINT64": + case 4: + message.type = 4; + break; + case "TYPE_INT32": + case 5: + message.type = 5; + break; + case "TYPE_FIXED64": + case 6: + message.type = 6; + break; + case "TYPE_FIXED32": + case 7: + message.type = 7; + break; + case "TYPE_BOOL": + case 8: + message.type = 8; + break; + case "TYPE_STRING": + case 9: + message.type = 9; + break; + case "TYPE_GROUP": + case 10: + message.type = 10; + break; + case "TYPE_MESSAGE": + case 11: + message.type = 11; + break; + case "TYPE_BYTES": + case 12: + message.type = 12; + break; + case "TYPE_UINT32": + case 13: + message.type = 13; + break; + case "TYPE_ENUM": + case 14: + message.type = 14; + break; + case "TYPE_SFIXED32": + case 15: + message.type = 15; + break; + case "TYPE_SFIXED64": + case 16: + message.type = 16; + break; + case "TYPE_SINT32": + case 17: + message.type = 17; + break; + case "TYPE_SINT64": + case 18: + message.type = 18; + break; + } + if (object.typeName != null) + message.typeName = String(object.typeName); + if (object.extendee != null) + message.extendee = String(object.extendee); + if (object.defaultValue != null) + message.defaultValue = String(object.defaultValue); + if (object.oneofIndex != null) + message.oneofIndex = object.oneofIndex | 0; + if (object.jsonName != null) + message.jsonName = String(object.jsonName); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FieldOptions.fromObject(object.options); + } + if (object.proto3Optional != null) + message.proto3Optional = Boolean(object.proto3Optional); + return message; + }; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.extendee = ""; + object.number = 0; + object.label = options.enums === String ? "LABEL_OPTIONAL" : 1; + object.type = options.enums === String ? "TYPE_DOUBLE" : 1; + object.typeName = ""; + object.defaultValue = ""; + object.options = null; + object.oneofIndex = 0; + object.jsonName = ""; + object.proto3Optional = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.extendee != null && message.hasOwnProperty("extendee")) + object.extendee = message.extendee; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.label != null && message.hasOwnProperty("label")) + object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] === undefined ? message.label : $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] === undefined ? message.type : $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; + if (message.typeName != null && message.hasOwnProperty("typeName")) + object.typeName = message.typeName; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + object.defaultValue = message.defaultValue; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options); + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + object.oneofIndex = message.oneofIndex; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + object.jsonName = message.jsonName; + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + object.proto3Optional = message.proto3Optional; + return object; + }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FieldDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FieldDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldDescriptorProto"; + }; + + /** + * Type enum. + * @name google.protobuf.FieldDescriptorProto.Type + * @enum {number} + * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value + * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value + * @property {number} TYPE_INT64=3 TYPE_INT64 value + * @property {number} TYPE_UINT64=4 TYPE_UINT64 value + * @property {number} TYPE_INT32=5 TYPE_INT32 value + * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value + * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value + * @property {number} TYPE_BOOL=8 TYPE_BOOL value + * @property {number} TYPE_STRING=9 TYPE_STRING value + * @property {number} TYPE_GROUP=10 TYPE_GROUP value + * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value + * @property {number} TYPE_BYTES=12 TYPE_BYTES value + * @property {number} TYPE_UINT32=13 TYPE_UINT32 value + * @property {number} TYPE_ENUM=14 TYPE_ENUM value + * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value + * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value + * @property {number} TYPE_SINT32=17 TYPE_SINT32 value + * @property {number} TYPE_SINT64=18 TYPE_SINT64 value + */ + FieldDescriptorProto.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "TYPE_DOUBLE"] = 1; + values[valuesById[2] = "TYPE_FLOAT"] = 2; + values[valuesById[3] = "TYPE_INT64"] = 3; + values[valuesById[4] = "TYPE_UINT64"] = 4; + values[valuesById[5] = "TYPE_INT32"] = 5; + values[valuesById[6] = "TYPE_FIXED64"] = 6; + values[valuesById[7] = "TYPE_FIXED32"] = 7; + values[valuesById[8] = "TYPE_BOOL"] = 8; + values[valuesById[9] = "TYPE_STRING"] = 9; + values[valuesById[10] = "TYPE_GROUP"] = 10; + values[valuesById[11] = "TYPE_MESSAGE"] = 11; + values[valuesById[12] = "TYPE_BYTES"] = 12; + values[valuesById[13] = "TYPE_UINT32"] = 13; + values[valuesById[14] = "TYPE_ENUM"] = 14; + values[valuesById[15] = "TYPE_SFIXED32"] = 15; + values[valuesById[16] = "TYPE_SFIXED64"] = 16; + values[valuesById[17] = "TYPE_SINT32"] = 17; + values[valuesById[18] = "TYPE_SINT64"] = 18; + return values; + })(); + + /** + * Label enum. + * @name google.protobuf.FieldDescriptorProto.Label + * @enum {number} + * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value + * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value + * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value + */ + FieldDescriptorProto.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "LABEL_OPTIONAL"] = 1; + values[valuesById[3] = "LABEL_REPEATED"] = 3; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; + return values; + })(); + + return FieldDescriptorProto; + })(); + + protobuf.OneofDescriptorProto = (function() { + + /** + * Properties of an OneofDescriptorProto. + * @memberof google.protobuf + * @interface IOneofDescriptorProto + * @property {string|null} [name] OneofDescriptorProto name + * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options + */ + + /** + * Constructs a new OneofDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an OneofDescriptorProto. + * @implements IOneofDescriptorProto + * @constructor + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + */ + function OneofDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.name = ""; + + /** + * OneofDescriptorProto options. + * @member {google.protobuf.IOneofOptions|null|undefined} options + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.options = null; + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance + */ + OneofDescriptorProto.create = function create(properties) { + return new OneofDescriptorProto(properties); + }; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofDescriptorProto message. + * @function verify + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.OneofOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + */ + OneofDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofDescriptorProto) + return object; + var message = new $root.google.protobuf.OneofDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.OneofOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.OneofDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + OneofDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OneofDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofDescriptorProto"; + }; + + return OneofDescriptorProto; + })(); + + protobuf.EnumDescriptorProto = (function() { + + /** + * Properties of an EnumDescriptorProto. + * @memberof google.protobuf + * @interface IEnumDescriptorProto + * @property {string|null} [name] EnumDescriptorProto name + * @property {Array.|null} [value] EnumDescriptorProto value + * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options + * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange + * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName + */ + + /** + * Constructs a new EnumDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumDescriptorProto. + * @implements IEnumDescriptorProto + * @constructor + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + */ + function EnumDescriptorProto(properties) { + this.value = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.name = ""; + + /** + * EnumDescriptorProto value. + * @member {Array.} value + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.value = $util.emptyArray; + + /** + * EnumDescriptorProto options. + * @member {google.protobuf.IEnumOptions|null|undefined} options + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.options = null; + + /** + * EnumDescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * EnumDescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance + */ + EnumDescriptorProto.create = function create(properties) { + return new EnumDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.value != null && message.value.length) + for (var i = 0; i < message.value.length; ++i) + $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.value && message.value.length)) + message.value = []; + message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); + break; + } + case 4: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.value != null && message.hasOwnProperty("value")) { + if (!Array.isArray(message.value)) + return "value: array expected"; + for (var i = 0; i < message.value.length; ++i) { + var error = $root.google.protobuf.EnumValueDescriptorProto.verify(message.value[i]); + if (error) + return "value." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + */ + EnumDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.value) { + if (!Array.isArray(object.value)) + throw TypeError(".google.protobuf.EnumDescriptorProto.value: array expected"); + message.value = []; + for (var i = 0; i < object.value.length; ++i) { + if (typeof object.value[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.value: object expected"); + message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.value = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.value && message.value.length) { + object.value = []; + for (var j = 0; j < message.value.length; ++j) + object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options); + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto"; + }; + + EnumDescriptorProto.EnumReservedRange = (function() { + + /** + * Properties of an EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @interface IEnumReservedRange + * @property {number|null} [start] EnumReservedRange start + * @property {number|null} [end] EnumReservedRange end + */ + + /** + * Constructs a new EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @classdesc Represents an EnumReservedRange. + * @implements IEnumReservedRange + * @constructor + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + */ + function EnumReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumReservedRange start. + * @member {number} start + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.start = 0; + + /** + * EnumReservedRange end. + * @member {number} end + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.end = 0; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance + */ + EnumReservedRange.create = function create(properties) { + return new EnumReservedRange(properties); + }; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumReservedRange message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + */ + EnumReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto.EnumReservedRange) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.EnumReservedRange} message EnumReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this EnumReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + * @returns {Object.} JSON object + */ + EnumReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumReservedRange + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto.EnumReservedRange"; + }; + + return EnumReservedRange; + })(); + + return EnumDescriptorProto; + })(); + + protobuf.EnumValueDescriptorProto = (function() { + + /** + * Properties of an EnumValueDescriptorProto. + * @memberof google.protobuf + * @interface IEnumValueDescriptorProto + * @property {string|null} [name] EnumValueDescriptorProto name + * @property {number|null} [number] EnumValueDescriptorProto number + * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options + */ + + /** + * Constructs a new EnumValueDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumValueDescriptorProto. + * @implements IEnumValueDescriptorProto + * @constructor + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + */ + function EnumValueDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.name = ""; + + /** + * EnumValueDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.number = 0; + + /** + * EnumValueDescriptorProto options. + * @member {google.protobuf.IEnumValueOptions|null|undefined} options + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.options = null; + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance + */ + EnumValueDescriptorProto.create = function create(properties) { + return new EnumValueDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.number = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumValueOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + */ + EnumValueDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumValueDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.number = 0; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumValueDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueDescriptorProto"; + }; + + return EnumValueDescriptorProto; + })(); + + protobuf.ServiceDescriptorProto = (function() { + + /** + * Properties of a ServiceDescriptorProto. + * @memberof google.protobuf + * @interface IServiceDescriptorProto + * @property {string|null} [name] ServiceDescriptorProto name + * @property {Array.|null} [method] ServiceDescriptorProto method + * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options + */ + + /** + * Constructs a new ServiceDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a ServiceDescriptorProto. + * @implements IServiceDescriptorProto + * @constructor + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + */ + function ServiceDescriptorProto(properties) { + this.method = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.name = ""; + + /** + * ServiceDescriptorProto method. + * @member {Array.} method + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.method = $util.emptyArray; + + /** + * ServiceDescriptorProto options. + * @member {google.protobuf.IServiceOptions|null|undefined} options + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.options = null; + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance + */ + ServiceDescriptorProto.create = function create(properties) { + return new ServiceDescriptorProto(properties); + }; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.method != null && message.method.length) + for (var i = 0; i < message.method.length; ++i) + $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.method && message.method.length)) + message.method = []; + message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceDescriptorProto message. + * @function verify + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.method != null && message.hasOwnProperty("method")) { + if (!Array.isArray(message.method)) + return "method: array expected"; + for (var i = 0; i < message.method.length; ++i) { + var error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i]); + if (error) + return "method." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ServiceOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + */ + ServiceDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceDescriptorProto) + return object; + var message = new $root.google.protobuf.ServiceDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.method) { + if (!Array.isArray(object.method)) + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: array expected"); + message.method = []; + for (var i = 0; i < object.method.length; ++i) { + if (typeof object.method[i] !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: object expected"); + message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.method = []; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.method && message.method.length) { + object.method = []; + for (var j = 0; j < message.method.length; ++j) + object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + ServiceDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceDescriptorProto"; + }; + + return ServiceDescriptorProto; + })(); + + protobuf.MethodDescriptorProto = (function() { + + /** + * Properties of a MethodDescriptorProto. + * @memberof google.protobuf + * @interface IMethodDescriptorProto + * @property {string|null} [name] MethodDescriptorProto name + * @property {string|null} [inputType] MethodDescriptorProto inputType + * @property {string|null} [outputType] MethodDescriptorProto outputType + * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options + * @property {boolean|null} [clientStreaming] MethodDescriptorProto clientStreaming + * @property {boolean|null} [serverStreaming] MethodDescriptorProto serverStreaming + */ + + /** + * Constructs a new MethodDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a MethodDescriptorProto. + * @implements IMethodDescriptorProto + * @constructor + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + */ + function MethodDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.name = ""; + + /** + * MethodDescriptorProto inputType. + * @member {string} inputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.inputType = ""; + + /** + * MethodDescriptorProto outputType. + * @member {string} outputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.outputType = ""; + + /** + * MethodDescriptorProto options. + * @member {google.protobuf.IMethodOptions|null|undefined} options + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.options = null; + + /** + * MethodDescriptorProto clientStreaming. + * @member {boolean} clientStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.clientStreaming = false; + + /** + * MethodDescriptorProto serverStreaming. + * @member {boolean} serverStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.serverStreaming = false; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance + */ + MethodDescriptorProto.create = function create(properties) { + return new MethodDescriptorProto(properties); + }; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); + if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); + if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); + return writer; + }; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.inputType = reader.string(); + break; + } + case 3: { + message.outputType = reader.string(); + break; + } + case 4: { + message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); + break; + } + case 5: { + message.clientStreaming = reader.bool(); + break; + } + case 6: { + message.serverStreaming = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodDescriptorProto message. + * @function verify + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.inputType != null && message.hasOwnProperty("inputType")) + if (!$util.isString(message.inputType)) + return "inputType: string expected"; + if (message.outputType != null && message.hasOwnProperty("outputType")) + if (!$util.isString(message.outputType)) + return "outputType: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MethodOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + if (typeof message.clientStreaming !== "boolean") + return "clientStreaming: boolean expected"; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + if (typeof message.serverStreaming !== "boolean") + return "serverStreaming: boolean expected"; + return null; + }; + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + */ + MethodDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodDescriptorProto) + return object; + var message = new $root.google.protobuf.MethodDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.inputType != null) + message.inputType = String(object.inputType); + if (object.outputType != null) + message.outputType = String(object.outputType); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MethodOptions.fromObject(object.options); + } + if (object.clientStreaming != null) + message.clientStreaming = Boolean(object.clientStreaming); + if (object.serverStreaming != null) + message.serverStreaming = Boolean(object.serverStreaming); + return message; + }; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.inputType = ""; + object.outputType = ""; + object.options = null; + object.clientStreaming = false; + object.serverStreaming = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.inputType != null && message.hasOwnProperty("inputType")) + object.inputType = message.inputType; + if (message.outputType != null && message.hasOwnProperty("outputType")) + object.outputType = message.outputType; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options); + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + object.clientStreaming = message.clientStreaming; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + object.serverStreaming = message.serverStreaming; + return object; + }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.MethodDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + MethodDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodDescriptorProto"; + }; + + return MethodDescriptorProto; + })(); + + protobuf.FileOptions = (function() { + + /** + * Properties of a FileOptions. + * @memberof google.protobuf + * @interface IFileOptions + * @property {string|null} [javaPackage] FileOptions javaPackage + * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname + * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles + * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash + * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8 + * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor + * @property {string|null} [goPackage] FileOptions goPackage + * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices + * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices + * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices + * @property {boolean|null} [deprecated] FileOptions deprecated + * @property {boolean|null} [ccEnableArenas] FileOptions ccEnableArenas + * @property {string|null} [objcClassPrefix] FileOptions objcClassPrefix + * @property {string|null} [csharpNamespace] FileOptions csharpNamespace + * @property {string|null} [swiftPrefix] FileOptions swiftPrefix + * @property {string|null} [phpClassPrefix] FileOptions phpClassPrefix + * @property {string|null} [phpNamespace] FileOptions phpNamespace + * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace + * @property {string|null} [rubyPackage] FileOptions rubyPackage + * @property {google.protobuf.IFeatureSet|null} [features] FileOptions features + * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption + * @property {Array.|null} [".google.api.resourceDefinition"] FileOptions .google.api.resourceDefinition + */ + + /** + * Constructs a new FileOptions. + * @memberof google.protobuf + * @classdesc Represents a FileOptions. + * @implements IFileOptions + * @constructor + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + */ + function FileOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.resourceDefinition"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileOptions javaPackage. + * @member {string} javaPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaPackage = ""; + + /** + * FileOptions javaOuterClassname. + * @member {string} javaOuterClassname + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaOuterClassname = ""; + + /** + * FileOptions javaMultipleFiles. + * @member {boolean} javaMultipleFiles + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaMultipleFiles = false; + + /** + * FileOptions javaGenerateEqualsAndHash. + * @member {boolean} javaGenerateEqualsAndHash + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenerateEqualsAndHash = false; + + /** + * FileOptions javaStringCheckUtf8. + * @member {boolean} javaStringCheckUtf8 + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaStringCheckUtf8 = false; + + /** + * FileOptions optimizeFor. + * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.optimizeFor = 1; + + /** + * FileOptions goPackage. + * @member {string} goPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.goPackage = ""; + + /** + * FileOptions ccGenericServices. + * @member {boolean} ccGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccGenericServices = false; + + /** + * FileOptions javaGenericServices. + * @member {boolean} javaGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenericServices = false; + + /** + * FileOptions pyGenericServices. + * @member {boolean} pyGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.pyGenericServices = false; + + /** + * FileOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.deprecated = false; + + /** + * FileOptions ccEnableArenas. + * @member {boolean} ccEnableArenas + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccEnableArenas = true; + + /** + * FileOptions objcClassPrefix. + * @member {string} objcClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.objcClassPrefix = ""; + + /** + * FileOptions csharpNamespace. + * @member {string} csharpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.csharpNamespace = ""; + + /** + * FileOptions swiftPrefix. + * @member {string} swiftPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.swiftPrefix = ""; + + /** + * FileOptions phpClassPrefix. + * @member {string} phpClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpClassPrefix = ""; + + /** + * FileOptions phpNamespace. + * @member {string} phpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpNamespace = ""; + + /** + * FileOptions phpMetadataNamespace. + * @member {string} phpMetadataNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpMetadataNamespace = ""; + + /** + * FileOptions rubyPackage. + * @member {string} rubyPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.rubyPackage = ""; + + /** + * FileOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.features = null; + + /** + * FileOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FileOptions .google.api.resourceDefinition. + * @member {Array.} .google.api.resourceDefinition + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray; + + /** + * Creates a new FileOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + * @returns {google.protobuf.FileOptions} FileOptions instance + */ + FileOptions.create = function create(properties) { + return new FileOptions(properties); + }; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); + if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); + if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); + if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); + if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); + if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); + if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); + if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) + writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); + if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) + writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); + if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) + writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); + if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) + writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); + if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) + writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); + if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) + writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); + if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) + writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); + if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) + writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); + if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) + writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); + if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) + writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); + if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) + writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resourceDefinition"] != null && message[".google.api.resourceDefinition"].length) + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resourceDefinition"][i], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.javaPackage = reader.string(); + break; + } + case 8: { + message.javaOuterClassname = reader.string(); + break; + } + case 10: { + message.javaMultipleFiles = reader.bool(); + break; + } + case 20: { + message.javaGenerateEqualsAndHash = reader.bool(); + break; + } + case 27: { + message.javaStringCheckUtf8 = reader.bool(); + break; + } + case 9: { + message.optimizeFor = reader.int32(); + break; + } + case 11: { + message.goPackage = reader.string(); + break; + } + case 16: { + message.ccGenericServices = reader.bool(); + break; + } + case 17: { + message.javaGenericServices = reader.bool(); + break; + } + case 18: { + message.pyGenericServices = reader.bool(); + break; + } + case 23: { + message.deprecated = reader.bool(); + break; + } + case 31: { + message.ccEnableArenas = reader.bool(); + break; + } + case 36: { + message.objcClassPrefix = reader.string(); + break; + } + case 37: { + message.csharpNamespace = reader.string(); + break; + } + case 39: { + message.swiftPrefix = reader.string(); + break; + } + case 40: { + message.phpClassPrefix = reader.string(); + break; + } + case 41: { + message.phpNamespace = reader.string(); + break; + } + case 44: { + message.phpMetadataNamespace = reader.string(); + break; + } + case 45: { + message.rubyPackage = reader.string(); + break; + } + case 50: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1053: { + if (!(message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length)) + message[".google.api.resourceDefinition"] = []; + message[".google.api.resourceDefinition"].push($root.google.api.ResourceDescriptor.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileOptions message. + * @function verify + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + if (!$util.isString(message.javaPackage)) + return "javaPackage: string expected"; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + if (!$util.isString(message.javaOuterClassname)) + return "javaOuterClassname: string expected"; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + if (typeof message.javaMultipleFiles !== "boolean") + return "javaMultipleFiles: boolean expected"; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + if (typeof message.javaGenerateEqualsAndHash !== "boolean") + return "javaGenerateEqualsAndHash: boolean expected"; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + if (typeof message.javaStringCheckUtf8 !== "boolean") + return "javaStringCheckUtf8: boolean expected"; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + switch (message.optimizeFor) { + default: + return "optimizeFor: enum value expected"; + case 1: + case 2: + case 3: + break; + } + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + if (!$util.isString(message.goPackage)) + return "goPackage: string expected"; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + if (typeof message.ccGenericServices !== "boolean") + return "ccGenericServices: boolean expected"; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + if (typeof message.javaGenericServices !== "boolean") + return "javaGenericServices: boolean expected"; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + if (typeof message.pyGenericServices !== "boolean") + return "pyGenericServices: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + if (typeof message.ccEnableArenas !== "boolean") + return "ccEnableArenas: boolean expected"; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + if (!$util.isString(message.objcClassPrefix)) + return "objcClassPrefix: string expected"; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + if (!$util.isString(message.csharpNamespace)) + return "csharpNamespace: string expected"; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + if (!$util.isString(message.swiftPrefix)) + return "swiftPrefix: string expected"; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + if (!$util.isString(message.phpClassPrefix)) + return "phpClassPrefix: string expected"; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + if (!$util.isString(message.phpNamespace)) + return "phpNamespace: string expected"; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + if (!$util.isString(message.phpMetadataNamespace)) + return "phpMetadataNamespace: string expected"; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + if (!$util.isString(message.rubyPackage)) + return "rubyPackage: string expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resourceDefinition"] != null && message.hasOwnProperty(".google.api.resourceDefinition")) { + if (!Array.isArray(message[".google.api.resourceDefinition"])) + return ".google.api.resourceDefinition: array expected"; + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resourceDefinition"][i]); + if (error) + return ".google.api.resourceDefinition." + error; + } + } + return null; + }; + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileOptions} FileOptions + */ + FileOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileOptions) + return object; + var message = new $root.google.protobuf.FileOptions(); + if (object.javaPackage != null) + message.javaPackage = String(object.javaPackage); + if (object.javaOuterClassname != null) + message.javaOuterClassname = String(object.javaOuterClassname); + if (object.javaMultipleFiles != null) + message.javaMultipleFiles = Boolean(object.javaMultipleFiles); + if (object.javaGenerateEqualsAndHash != null) + message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash); + if (object.javaStringCheckUtf8 != null) + message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); + switch (object.optimizeFor) { + default: + if (typeof object.optimizeFor === "number") { + message.optimizeFor = object.optimizeFor; + break; + } + break; + case "SPEED": + case 1: + message.optimizeFor = 1; + break; + case "CODE_SIZE": + case 2: + message.optimizeFor = 2; + break; + case "LITE_RUNTIME": + case 3: + message.optimizeFor = 3; + break; + } + if (object.goPackage != null) + message.goPackage = String(object.goPackage); + if (object.ccGenericServices != null) + message.ccGenericServices = Boolean(object.ccGenericServices); + if (object.javaGenericServices != null) + message.javaGenericServices = Boolean(object.javaGenericServices); + if (object.pyGenericServices != null) + message.pyGenericServices = Boolean(object.pyGenericServices); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.ccEnableArenas != null) + message.ccEnableArenas = Boolean(object.ccEnableArenas); + if (object.objcClassPrefix != null) + message.objcClassPrefix = String(object.objcClassPrefix); + if (object.csharpNamespace != null) + message.csharpNamespace = String(object.csharpNamespace); + if (object.swiftPrefix != null) + message.swiftPrefix = String(object.swiftPrefix); + if (object.phpClassPrefix != null) + message.phpClassPrefix = String(object.phpClassPrefix); + if (object.phpNamespace != null) + message.phpNamespace = String(object.phpNamespace); + if (object.phpMetadataNamespace != null) + message.phpMetadataNamespace = String(object.phpMetadataNamespace); + if (object.rubyPackage != null) + message.rubyPackage = String(object.rubyPackage); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FileOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resourceDefinition"]) { + if (!Array.isArray(object[".google.api.resourceDefinition"])) + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: array expected"); + message[".google.api.resourceDefinition"] = []; + for (var i = 0; i < object[".google.api.resourceDefinition"].length; ++i) { + if (typeof object[".google.api.resourceDefinition"][i] !== "object") + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: object expected"); + message[".google.api.resourceDefinition"][i] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resourceDefinition"][i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.FileOptions} message FileOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.resourceDefinition"] = []; + } + if (options.defaults) { + object.javaPackage = ""; + object.javaOuterClassname = ""; + object.optimizeFor = options.enums === String ? "SPEED" : 1; + object.javaMultipleFiles = false; + object.goPackage = ""; + object.ccGenericServices = false; + object.javaGenericServices = false; + object.pyGenericServices = false; + object.javaGenerateEqualsAndHash = false; + object.deprecated = false; + object.javaStringCheckUtf8 = false; + object.ccEnableArenas = true; + object.objcClassPrefix = ""; + object.csharpNamespace = ""; + object.swiftPrefix = ""; + object.phpClassPrefix = ""; + object.phpNamespace = ""; + object.phpMetadataNamespace = ""; + object.rubyPackage = ""; + object.features = null; + } + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + object.javaPackage = message.javaPackage; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + object.javaOuterClassname = message.javaOuterClassname; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] === undefined ? message.optimizeFor : $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + object.javaMultipleFiles = message.javaMultipleFiles; + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + object.goPackage = message.goPackage; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + object.ccGenericServices = message.ccGenericServices; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + object.javaGenericServices = message.javaGenericServices; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + object.pyGenericServices = message.pyGenericServices; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + object.javaStringCheckUtf8 = message.javaStringCheckUtf8; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + object.ccEnableArenas = message.ccEnableArenas; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + object.objcClassPrefix = message.objcClassPrefix; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + object.csharpNamespace = message.csharpNamespace; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + object.swiftPrefix = message.swiftPrefix; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + object.phpClassPrefix = message.phpClassPrefix; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + object.phpNamespace = message.phpNamespace; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + object.phpMetadataNamespace = message.phpMetadataNamespace; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + object.rubyPackage = message.rubyPackage; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length) { + object[".google.api.resourceDefinition"] = []; + for (var j = 0; j < message[".google.api.resourceDefinition"].length; ++j) + object[".google.api.resourceDefinition"][j] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resourceDefinition"][j], options); + } + return object; + }; + + /** + * Converts this FileOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FileOptions + * @instance + * @returns {Object.} JSON object + */ + FileOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileOptions + * @function getTypeUrl + * @memberof google.protobuf.FileOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileOptions"; + }; + + /** + * OptimizeMode enum. + * @name google.protobuf.FileOptions.OptimizeMode + * @enum {number} + * @property {number} SPEED=1 SPEED value + * @property {number} CODE_SIZE=2 CODE_SIZE value + * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value + */ + FileOptions.OptimizeMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "SPEED"] = 1; + values[valuesById[2] = "CODE_SIZE"] = 2; + values[valuesById[3] = "LITE_RUNTIME"] = 3; + return values; + })(); + + return FileOptions; + })(); + + protobuf.MessageOptions = (function() { + + /** + * Properties of a MessageOptions. + * @memberof google.protobuf + * @interface IMessageOptions + * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat + * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor + * @property {boolean|null} [deprecated] MessageOptions deprecated + * @property {boolean|null} [mapEntry] MessageOptions mapEntry + * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] MessageOptions deprecatedLegacyJsonFieldConflicts + * @property {google.protobuf.IFeatureSet|null} [features] MessageOptions features + * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption + * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource + */ + + /** + * Constructs a new MessageOptions. + * @memberof google.protobuf + * @classdesc Represents a MessageOptions. + * @implements IMessageOptions + * @constructor + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + */ + function MessageOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MessageOptions messageSetWireFormat. + * @member {boolean} messageSetWireFormat + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.messageSetWireFormat = false; + + /** + * MessageOptions noStandardDescriptorAccessor. + * @member {boolean} noStandardDescriptorAccessor + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.noStandardDescriptorAccessor = false; + + /** + * MessageOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecated = false; + + /** + * MessageOptions mapEntry. + * @member {boolean} mapEntry + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.mapEntry = false; + + /** + * MessageOptions deprecatedLegacyJsonFieldConflicts. + * @member {boolean} deprecatedLegacyJsonFieldConflicts + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; + + /** + * MessageOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.features = null; + + /** + * MessageOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MessageOptions .google.api.resource. + * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype[".google.api.resource"] = null; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + * @returns {google.protobuf.MessageOptions} MessageOptions instance + */ + MessageOptions.create = function create(properties) { + return new MessageOptions(properties); + }; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); + if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); + if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.deprecatedLegacyJsonFieldConflicts); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resource"] != null && Object.hasOwnProperty.call(message, ".google.api.resource")) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.messageSetWireFormat = reader.bool(); + break; + } + case 2: { + message.noStandardDescriptorAccessor = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 7: { + message.mapEntry = reader.bool(); + break; + } + case 11: { + message.deprecatedLegacyJsonFieldConflicts = reader.bool(); + break; + } + case 12: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1053: { + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MessageOptions message. + * @function verify + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MessageOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + if (typeof message.messageSetWireFormat !== "boolean") + return "messageSetWireFormat: boolean expected"; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + if (typeof message.noStandardDescriptorAccessor !== "boolean") + return "noStandardDescriptorAccessor: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + if (typeof message.mapEntry !== "boolean") + return "mapEntry: boolean expected"; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") + return "deprecatedLegacyJsonFieldConflicts: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resource"]); + if (error) + return ".google.api.resource." + error; + } + return null; + }; + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MessageOptions} MessageOptions + */ + MessageOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MessageOptions) + return object; + var message = new $root.google.protobuf.MessageOptions(); + if (object.messageSetWireFormat != null) + message.messageSetWireFormat = Boolean(object.messageSetWireFormat); + if (object.noStandardDescriptorAccessor != null) + message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.mapEntry != null) + message.mapEntry = Boolean(object.mapEntry); + if (object.deprecatedLegacyJsonFieldConflicts != null) + message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.MessageOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resource"] != null) { + if (typeof object[".google.api.resource"] !== "object") + throw TypeError(".google.protobuf.MessageOptions..google.api.resource: object expected"); + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resource"]); + } + return message; + }; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.MessageOptions} message MessageOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MessageOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.messageSetWireFormat = false; + object.noStandardDescriptorAccessor = false; + object.deprecated = false; + object.mapEntry = false; + object.deprecatedLegacyJsonFieldConflicts = false; + object.features = null; + object[".google.api.resource"] = null; + } + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + object.messageSetWireFormat = message.messageSetWireFormat; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + object.mapEntry = message.mapEntry; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) + object[".google.api.resource"] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resource"], options); + return object; + }; + + /** + * Converts this MessageOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MessageOptions + * @instance + * @returns {Object.} JSON object + */ + MessageOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MessageOptions + * @function getTypeUrl + * @memberof google.protobuf.MessageOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MessageOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MessageOptions"; + }; + + return MessageOptions; + })(); + + protobuf.FieldOptions = (function() { + + /** + * Properties of a FieldOptions. + * @memberof google.protobuf + * @interface IFieldOptions + * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype + * @property {boolean|null} [packed] FieldOptions packed + * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype + * @property {boolean|null} [lazy] FieldOptions lazy + * @property {boolean|null} [unverifiedLazy] FieldOptions unverifiedLazy + * @property {boolean|null} [deprecated] FieldOptions deprecated + * @property {boolean|null} [weak] FieldOptions weak + * @property {boolean|null} [debugRedact] FieldOptions debugRedact + * @property {google.protobuf.FieldOptions.OptionRetention|null} [retention] FieldOptions retention + * @property {Array.|null} [targets] FieldOptions targets + * @property {Array.|null} [editionDefaults] FieldOptions editionDefaults + * @property {google.protobuf.IFeatureSet|null} [features] FieldOptions features + * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption + * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior + * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference + */ + + /** + * Constructs a new FieldOptions. + * @memberof google.protobuf + * @classdesc Represents a FieldOptions. + * @implements IFieldOptions + * @constructor + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + */ + function FieldOptions(properties) { + this.targets = []; + this.editionDefaults = []; + this.uninterpretedOption = []; + this[".google.api.fieldBehavior"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldOptions ctype. + * @member {google.protobuf.FieldOptions.CType} ctype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.ctype = 0; + + /** + * FieldOptions packed. + * @member {boolean} packed + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.packed = false; + + /** + * FieldOptions jstype. + * @member {google.protobuf.FieldOptions.JSType} jstype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.jstype = 0; + + /** + * FieldOptions lazy. + * @member {boolean} lazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.lazy = false; + + /** + * FieldOptions unverifiedLazy. + * @member {boolean} unverifiedLazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.unverifiedLazy = false; + + /** + * FieldOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.deprecated = false; + + /** + * FieldOptions weak. + * @member {boolean} weak + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.weak = false; + + /** + * FieldOptions debugRedact. + * @member {boolean} debugRedact + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.debugRedact = false; + + /** + * FieldOptions retention. + * @member {google.protobuf.FieldOptions.OptionRetention} retention + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.retention = 0; + + /** + * FieldOptions targets. + * @member {Array.} targets + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.targets = $util.emptyArray; + + /** + * FieldOptions editionDefaults. + * @member {Array.} editionDefaults + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.editionDefaults = $util.emptyArray; + + /** + * FieldOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.features = null; + + /** + * FieldOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FieldOptions .google.api.fieldBehavior. + * @member {Array.} .google.api.fieldBehavior + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; + + /** + * FieldOptions .google.api.resourceReference. + * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.resourceReference"] = null; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions} FieldOptions instance + */ + FieldOptions.create = function create(properties) { + return new FieldOptions(properties); + }; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); + if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); + if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); + if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); + if (message.unverifiedLazy != null && Object.hasOwnProperty.call(message, "unverifiedLazy")) + writer.uint32(/* id 15, wireType 0 =*/120).bool(message.unverifiedLazy); + if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.debugRedact); + if (message.retention != null && Object.hasOwnProperty.call(message, "retention")) + writer.uint32(/* id 17, wireType 0 =*/136).int32(message.retention); + if (message.targets != null && message.targets.length) + for (var i = 0; i < message.targets.length; ++i) + writer.uint32(/* id 19, wireType 0 =*/152).int32(message.targets[i]); + if (message.editionDefaults != null && message.editionDefaults.length) + for (var i = 0; i < message.editionDefaults.length; ++i) + $root.google.protobuf.FieldOptions.EditionDefault.encode(message.editionDefaults[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + writer.uint32(/* id 1052, wireType 0 =*/8416).int32(message[".google.api.fieldBehavior"][i]); + if (message[".google.api.resourceReference"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceReference")) + $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.ctype = reader.int32(); + break; + } + case 2: { + message.packed = reader.bool(); + break; + } + case 6: { + message.jstype = reader.int32(); + break; + } + case 5: { + message.lazy = reader.bool(); + break; + } + case 15: { + message.unverifiedLazy = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 10: { + message.weak = reader.bool(); + break; + } + case 16: { + message.debugRedact = reader.bool(); + break; + } + case 17: { + message.retention = reader.int32(); + break; + } + case 19: { + if (!(message.targets && message.targets.length)) + message.targets = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.targets.push(reader.int32()); + } else + message.targets.push(reader.int32()); + break; + } + case 20: { + if (!(message.editionDefaults && message.editionDefaults.length)) + message.editionDefaults = []; + message.editionDefaults.push($root.google.protobuf.FieldOptions.EditionDefault.decode(reader, reader.uint32())); + break; + } + case 21: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1052: { + if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) + message[".google.api.fieldBehavior"] = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message[".google.api.fieldBehavior"].push(reader.int32()); + } else + message[".google.api.fieldBehavior"].push(reader.int32()); + break; + } + case 1055: { + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldOptions message. + * @function verify + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ctype != null && message.hasOwnProperty("ctype")) + switch (message.ctype) { + default: + return "ctype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.packed != null && message.hasOwnProperty("packed")) + if (typeof message.packed !== "boolean") + return "packed: boolean expected"; + if (message.jstype != null && message.hasOwnProperty("jstype")) + switch (message.jstype) { + default: + return "jstype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.lazy != null && message.hasOwnProperty("lazy")) + if (typeof message.lazy !== "boolean") + return "lazy: boolean expected"; + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + if (typeof message.unverifiedLazy !== "boolean") + return "unverifiedLazy: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.weak != null && message.hasOwnProperty("weak")) + if (typeof message.weak !== "boolean") + return "weak: boolean expected"; + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + if (typeof message.debugRedact !== "boolean") + return "debugRedact: boolean expected"; + if (message.retention != null && message.hasOwnProperty("retention")) + switch (message.retention) { + default: + return "retention: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.targets != null && message.hasOwnProperty("targets")) { + if (!Array.isArray(message.targets)) + return "targets: array expected"; + for (var i = 0; i < message.targets.length; ++i) + switch (message.targets[i]) { + default: + return "targets: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + break; + } + } + if (message.editionDefaults != null && message.hasOwnProperty("editionDefaults")) { + if (!Array.isArray(message.editionDefaults)) + return "editionDefaults: array expected"; + for (var i = 0; i < message.editionDefaults.length; ++i) { + var error = $root.google.protobuf.FieldOptions.EditionDefault.verify(message.editionDefaults[i]); + if (error) + return "editionDefaults." + error; + } + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) { + if (!Array.isArray(message[".google.api.fieldBehavior"])) + return ".google.api.fieldBehavior: array expected"; + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + switch (message[".google.api.fieldBehavior"][i]) { + default: + return ".google.api.fieldBehavior: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + break; + } + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) { + var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"]); + if (error) + return ".google.api.resourceReference." + error; + } + return null; + }; + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions} FieldOptions + */ + FieldOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions) + return object; + var message = new $root.google.protobuf.FieldOptions(); + switch (object.ctype) { + default: + if (typeof object.ctype === "number") { + message.ctype = object.ctype; + break; + } + break; + case "STRING": + case 0: + message.ctype = 0; + break; + case "CORD": + case 1: + message.ctype = 1; + break; + case "STRING_PIECE": + case 2: + message.ctype = 2; + break; + } + if (object.packed != null) + message.packed = Boolean(object.packed); + switch (object.jstype) { + default: + if (typeof object.jstype === "number") { + message.jstype = object.jstype; + break; + } + break; + case "JS_NORMAL": + case 0: + message.jstype = 0; + break; + case "JS_STRING": + case 1: + message.jstype = 1; + break; + case "JS_NUMBER": + case 2: + message.jstype = 2; + break; + } + if (object.lazy != null) + message.lazy = Boolean(object.lazy); + if (object.unverifiedLazy != null) + message.unverifiedLazy = Boolean(object.unverifiedLazy); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.weak != null) + message.weak = Boolean(object.weak); + if (object.debugRedact != null) + message.debugRedact = Boolean(object.debugRedact); + switch (object.retention) { + default: + if (typeof object.retention === "number") { + message.retention = object.retention; + break; + } + break; + case "RETENTION_UNKNOWN": + case 0: + message.retention = 0; + break; + case "RETENTION_RUNTIME": + case 1: + message.retention = 1; + break; + case "RETENTION_SOURCE": + case 2: + message.retention = 2; + break; + } + if (object.targets) { + if (!Array.isArray(object.targets)) + throw TypeError(".google.protobuf.FieldOptions.targets: array expected"); + message.targets = []; + for (var i = 0; i < object.targets.length; ++i) + switch (object.targets[i]) { + default: + if (typeof object.targets[i] === "number") { + message.targets[i] = object.targets[i]; + break; + } + case "TARGET_TYPE_UNKNOWN": + case 0: + message.targets[i] = 0; + break; + case "TARGET_TYPE_FILE": + case 1: + message.targets[i] = 1; + break; + case "TARGET_TYPE_EXTENSION_RANGE": + case 2: + message.targets[i] = 2; + break; + case "TARGET_TYPE_MESSAGE": + case 3: + message.targets[i] = 3; + break; + case "TARGET_TYPE_FIELD": + case 4: + message.targets[i] = 4; + break; + case "TARGET_TYPE_ONEOF": + case 5: + message.targets[i] = 5; + break; + case "TARGET_TYPE_ENUM": + case 6: + message.targets[i] = 6; + break; + case "TARGET_TYPE_ENUM_ENTRY": + case 7: + message.targets[i] = 7; + break; + case "TARGET_TYPE_SERVICE": + case 8: + message.targets[i] = 8; + break; + case "TARGET_TYPE_METHOD": + case 9: + message.targets[i] = 9; + break; + } + } + if (object.editionDefaults) { + if (!Array.isArray(object.editionDefaults)) + throw TypeError(".google.protobuf.FieldOptions.editionDefaults: array expected"); + message.editionDefaults = []; + for (var i = 0; i < object.editionDefaults.length; ++i) { + if (typeof object.editionDefaults[i] !== "object") + throw TypeError(".google.protobuf.FieldOptions.editionDefaults: object expected"); + message.editionDefaults[i] = $root.google.protobuf.FieldOptions.EditionDefault.fromObject(object.editionDefaults[i]); + } + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FieldOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.fieldBehavior"]) { + if (!Array.isArray(object[".google.api.fieldBehavior"])) + throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected"); + message[".google.api.fieldBehavior"] = []; + for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i) + switch (object[".google.api.fieldBehavior"][i]) { + default: + if (typeof object[".google.api.fieldBehavior"][i] === "number") { + message[".google.api.fieldBehavior"][i] = object[".google.api.fieldBehavior"][i]; + break; + } + case "FIELD_BEHAVIOR_UNSPECIFIED": + case 0: + message[".google.api.fieldBehavior"][i] = 0; + break; + case "OPTIONAL": + case 1: + message[".google.api.fieldBehavior"][i] = 1; + break; + case "REQUIRED": + case 2: + message[".google.api.fieldBehavior"][i] = 2; + break; + case "OUTPUT_ONLY": + case 3: + message[".google.api.fieldBehavior"][i] = 3; + break; + case "INPUT_ONLY": + case 4: + message[".google.api.fieldBehavior"][i] = 4; + break; + case "IMMUTABLE": + case 5: + message[".google.api.fieldBehavior"][i] = 5; + break; + case "UNORDERED_LIST": + case 6: + message[".google.api.fieldBehavior"][i] = 6; + break; + case "NON_EMPTY_DEFAULT": + case 7: + message[".google.api.fieldBehavior"][i] = 7; + break; + case "IDENTIFIER": + case 8: + message[".google.api.fieldBehavior"][i] = 8; + break; + } + } + if (object[".google.api.resourceReference"] != null) { + if (typeof object[".google.api.resourceReference"] !== "object") + throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected"); + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"]); + } + return message; + }; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.FieldOptions} message FieldOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.targets = []; + object.editionDefaults = []; + object.uninterpretedOption = []; + object[".google.api.fieldBehavior"] = []; + } + if (options.defaults) { + object.ctype = options.enums === String ? "STRING" : 0; + object.packed = false; + object.deprecated = false; + object.lazy = false; + object.jstype = options.enums === String ? "JS_NORMAL" : 0; + object.weak = false; + object.unverifiedLazy = false; + object.debugRedact = false; + object.retention = options.enums === String ? "RETENTION_UNKNOWN" : 0; + object.features = null; + object[".google.api.resourceReference"] = null; + } + if (message.ctype != null && message.hasOwnProperty("ctype")) + object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] === undefined ? message.ctype : $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; + if (message.packed != null && message.hasOwnProperty("packed")) + object.packed = message.packed; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.lazy != null && message.hasOwnProperty("lazy")) + object.lazy = message.lazy; + if (message.jstype != null && message.hasOwnProperty("jstype")) + object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] === undefined ? message.jstype : $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; + if (message.weak != null && message.hasOwnProperty("weak")) + object.weak = message.weak; + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + object.unverifiedLazy = message.unverifiedLazy; + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + object.debugRedact = message.debugRedact; + if (message.retention != null && message.hasOwnProperty("retention")) + object.retention = options.enums === String ? $root.google.protobuf.FieldOptions.OptionRetention[message.retention] === undefined ? message.retention : $root.google.protobuf.FieldOptions.OptionRetention[message.retention] : message.retention; + if (message.targets && message.targets.length) { + object.targets = []; + for (var j = 0; j < message.targets.length; ++j) + object.targets[j] = options.enums === String ? $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] === undefined ? message.targets[j] : $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] : message.targets[j]; + } + if (message.editionDefaults && message.editionDefaults.length) { + object.editionDefaults = []; + for (var j = 0; j < message.editionDefaults.length; ++j) + object.editionDefaults[j] = $root.google.protobuf.FieldOptions.EditionDefault.toObject(message.editionDefaults[j], options); + } + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length) { + object[".google.api.fieldBehavior"] = []; + for (var j = 0; j < message[".google.api.fieldBehavior"].length; ++j) + object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] === undefined ? message[".google.api.fieldBehavior"][j] : $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) + object[".google.api.resourceReference"] = $root.google.api.ResourceReference.toObject(message[".google.api.resourceReference"], options); + return object; + }; + + /** + * Converts this FieldOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions + * @instance + * @returns {Object.} JSON object + */ + FieldOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldOptions + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions"; + }; + + /** + * CType enum. + * @name google.protobuf.FieldOptions.CType + * @enum {number} + * @property {number} STRING=0 STRING value + * @property {number} CORD=1 CORD value + * @property {number} STRING_PIECE=2 STRING_PIECE value + */ + FieldOptions.CType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STRING"] = 0; + values[valuesById[1] = "CORD"] = 1; + values[valuesById[2] = "STRING_PIECE"] = 2; + return values; + })(); + + /** + * JSType enum. + * @name google.protobuf.FieldOptions.JSType + * @enum {number} + * @property {number} JS_NORMAL=0 JS_NORMAL value + * @property {number} JS_STRING=1 JS_STRING value + * @property {number} JS_NUMBER=2 JS_NUMBER value + */ + FieldOptions.JSType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JS_NORMAL"] = 0; + values[valuesById[1] = "JS_STRING"] = 1; + values[valuesById[2] = "JS_NUMBER"] = 2; + return values; + })(); + + /** + * OptionRetention enum. + * @name google.protobuf.FieldOptions.OptionRetention + * @enum {number} + * @property {number} RETENTION_UNKNOWN=0 RETENTION_UNKNOWN value + * @property {number} RETENTION_RUNTIME=1 RETENTION_RUNTIME value + * @property {number} RETENTION_SOURCE=2 RETENTION_SOURCE value + */ + FieldOptions.OptionRetention = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RETENTION_UNKNOWN"] = 0; + values[valuesById[1] = "RETENTION_RUNTIME"] = 1; + values[valuesById[2] = "RETENTION_SOURCE"] = 2; + return values; + })(); + + /** + * OptionTargetType enum. + * @name google.protobuf.FieldOptions.OptionTargetType + * @enum {number} + * @property {number} TARGET_TYPE_UNKNOWN=0 TARGET_TYPE_UNKNOWN value + * @property {number} TARGET_TYPE_FILE=1 TARGET_TYPE_FILE value + * @property {number} TARGET_TYPE_EXTENSION_RANGE=2 TARGET_TYPE_EXTENSION_RANGE value + * @property {number} TARGET_TYPE_MESSAGE=3 TARGET_TYPE_MESSAGE value + * @property {number} TARGET_TYPE_FIELD=4 TARGET_TYPE_FIELD value + * @property {number} TARGET_TYPE_ONEOF=5 TARGET_TYPE_ONEOF value + * @property {number} TARGET_TYPE_ENUM=6 TARGET_TYPE_ENUM value + * @property {number} TARGET_TYPE_ENUM_ENTRY=7 TARGET_TYPE_ENUM_ENTRY value + * @property {number} TARGET_TYPE_SERVICE=8 TARGET_TYPE_SERVICE value + * @property {number} TARGET_TYPE_METHOD=9 TARGET_TYPE_METHOD value + */ + FieldOptions.OptionTargetType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TARGET_TYPE_UNKNOWN"] = 0; + values[valuesById[1] = "TARGET_TYPE_FILE"] = 1; + values[valuesById[2] = "TARGET_TYPE_EXTENSION_RANGE"] = 2; + values[valuesById[3] = "TARGET_TYPE_MESSAGE"] = 3; + values[valuesById[4] = "TARGET_TYPE_FIELD"] = 4; + values[valuesById[5] = "TARGET_TYPE_ONEOF"] = 5; + values[valuesById[6] = "TARGET_TYPE_ENUM"] = 6; + values[valuesById[7] = "TARGET_TYPE_ENUM_ENTRY"] = 7; + values[valuesById[8] = "TARGET_TYPE_SERVICE"] = 8; + values[valuesById[9] = "TARGET_TYPE_METHOD"] = 9; + return values; + })(); + + FieldOptions.EditionDefault = (function() { + + /** + * Properties of an EditionDefault. + * @memberof google.protobuf.FieldOptions + * @interface IEditionDefault + * @property {google.protobuf.Edition|null} [edition] EditionDefault edition + * @property {string|null} [value] EditionDefault value + */ + + /** + * Constructs a new EditionDefault. + * @memberof google.protobuf.FieldOptions + * @classdesc Represents an EditionDefault. + * @implements IEditionDefault + * @constructor + * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set + */ + function EditionDefault(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EditionDefault edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + */ + EditionDefault.prototype.edition = 0; + + /** + * EditionDefault value. + * @member {string} value + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + */ + EditionDefault.prototype.value = ""; + + /** + * Creates a new EditionDefault instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault instance + */ + EditionDefault.create = function create(properties) { + return new EditionDefault(properties); + }; + + /** + * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EditionDefault.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EditionDefault.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EditionDefault message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EditionDefault.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions.EditionDefault(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.edition = reader.int32(); + break; + } + case 2: { + message.value = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EditionDefault message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EditionDefault.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EditionDefault message. + * @function verify + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EditionDefault.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + */ + EditionDefault.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions.EditionDefault) + return object; + var message = new $root.google.protobuf.FieldOptions.EditionDefault(); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.EditionDefault} message EditionDefault + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EditionDefault.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.value = ""; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this EditionDefault to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + * @returns {Object.} JSON object + */ + EditionDefault.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EditionDefault + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions.EditionDefault"; + }; + + return EditionDefault; + })(); + + return FieldOptions; + })(); + + protobuf.OneofOptions = (function() { + + /** + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @property {google.protobuf.IFeatureSet|null} [features] OneofOptions features + * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption + */ + + /** + * Constructs a new OneofOptions. + * @memberof google.protobuf + * @classdesc Represents an OneofOptions. + * @implements IOneofOptions + * @constructor + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + */ + function OneofOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.features = null; + + /** + * OneofOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + * @returns {google.protobuf.OneofOptions} OneofOptions instance + */ + OneofOptions.create = function create(properties) { + return new OneofOptions(properties); + }; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofOptions message. + * @function verify + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofOptions} OneofOptions + */ + OneofOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofOptions) + return object; + var message = new $root.google.protobuf.OneofOptions(); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.OneofOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.OneofOptions} message OneofOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) + object.features = null; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this OneofOptions to JSON. + * @function toJSON + * @memberof google.protobuf.OneofOptions + * @instance + * @returns {Object.} JSON object + */ + OneofOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OneofOptions + * @function getTypeUrl + * @memberof google.protobuf.OneofOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofOptions"; + }; + + return OneofOptions; + })(); + + protobuf.EnumOptions = (function() { + + /** + * Properties of an EnumOptions. + * @memberof google.protobuf + * @interface IEnumOptions + * @property {boolean|null} [allowAlias] EnumOptions allowAlias + * @property {boolean|null} [deprecated] EnumOptions deprecated + * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] EnumOptions deprecatedLegacyJsonFieldConflicts + * @property {google.protobuf.IFeatureSet|null} [features] EnumOptions features + * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption + */ + + /** + * Constructs a new EnumOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumOptions. + * @implements IEnumOptions + * @constructor + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + */ + function EnumOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumOptions allowAlias. + * @member {boolean} allowAlias + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.allowAlias = false; + + /** + * EnumOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecated = false; + + /** + * EnumOptions deprecatedLegacyJsonFieldConflicts. + * @member {boolean} deprecatedLegacyJsonFieldConflicts + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; + + /** + * EnumOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.features = null; + + /** + * EnumOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumOptions} EnumOptions instance + */ + EnumOptions.create = function create(properties) { + return new EnumOptions(properties); + }; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.deprecatedLegacyJsonFieldConflicts); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.allowAlias = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 6: { + message.deprecatedLegacyJsonFieldConflicts = reader.bool(); + break; + } + case 7: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumOptions message. + * @function verify + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + if (typeof message.allowAlias !== "boolean") + return "allowAlias: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") + return "deprecatedLegacyJsonFieldConflicts: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumOptions} EnumOptions + */ + EnumOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumOptions) + return object; + var message = new $root.google.protobuf.EnumOptions(); + if (object.allowAlias != null) + message.allowAlias = Boolean(object.allowAlias); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.deprecatedLegacyJsonFieldConflicts != null) + message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.EnumOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.EnumOptions} message EnumOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.allowAlias = false; + object.deprecated = false; + object.deprecatedLegacyJsonFieldConflicts = false; + object.features = null; + } + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + object.allowAlias = message.allowAlias; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumOptions + * @instance + * @returns {Object.} JSON object + */ + EnumOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumOptions"; + }; + + return EnumOptions; + })(); + + protobuf.EnumValueOptions = (function() { + + /** + * Properties of an EnumValueOptions. + * @memberof google.protobuf + * @interface IEnumValueOptions + * @property {boolean|null} [deprecated] EnumValueOptions deprecated + * @property {google.protobuf.IFeatureSet|null} [features] EnumValueOptions features + * @property {boolean|null} [debugRedact] EnumValueOptions debugRedact + * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption + */ + + /** + * Constructs a new EnumValueOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumValueOptions. + * @implements IEnumValueOptions + * @constructor + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + */ + function EnumValueOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.deprecated = false; + + /** + * EnumValueOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.features = null; + + /** + * EnumValueOptions debugRedact. + * @member {boolean} debugRedact + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.debugRedact = false; + + /** + * EnumValueOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance + */ + EnumValueOptions.create = function create(properties) { + return new EnumValueOptions(properties); + }; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.debugRedact); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.deprecated = reader.bool(); + break; + } + case 2: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 3: { + message.debugRedact = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueOptions message. + * @function verify + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + if (typeof message.debugRedact !== "boolean") + return "debugRedact: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + */ + EnumValueOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueOptions) + return object; + var message = new $root.google.protobuf.EnumValueOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.debugRedact != null) + message.debugRedact = Boolean(object.debugRedact); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.EnumValueOptions} message EnumValueOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object.features = null; + object.debugRedact = false; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + object.debugRedact = message.debugRedact; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumValueOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueOptions + * @instance + * @returns {Object.} JSON object + */ + EnumValueOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValueOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueOptions"; + }; + + return EnumValueOptions; + })(); + + protobuf.ServiceOptions = (function() { + + /** + * Properties of a ServiceOptions. + * @memberof google.protobuf + * @interface IServiceOptions + * @property {google.protobuf.IFeatureSet|null} [features] ServiceOptions features + * @property {boolean|null} [deprecated] ServiceOptions deprecated + * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption + * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost + * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes + * @property {string|null} [".google.api.apiVersion"] ServiceOptions .google.api.apiVersion + */ + + /** + * Constructs a new ServiceOptions. + * @memberof google.protobuf + * @classdesc Represents a ServiceOptions. + * @implements IServiceOptions + * @constructor + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + */ + function ServiceOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.features = null; + + /** + * ServiceOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.deprecated = false; + + /** + * ServiceOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * ServiceOptions .google.api.defaultHost. + * @member {string} .google.api.defaultHost + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.defaultHost"] = ""; + + /** + * ServiceOptions .google.api.oauthScopes. + * @member {string} .google.api.oauthScopes + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.oauthScopes"] = ""; + + /** + * ServiceOptions .google.api.apiVersion. + * @member {string} .google.api.apiVersion + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.apiVersion"] = ""; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + * @returns {google.protobuf.ServiceOptions} ServiceOptions instance + */ + ServiceOptions.create = function create(properties) { + return new ServiceOptions(properties); + }; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 34, wireType 2 =*/274).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) + writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); + if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) + writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); + if (message[".google.api.apiVersion"] != null && Object.hasOwnProperty.call(message, ".google.api.apiVersion")) + writer.uint32(/* id 525000001, wireType 2 =*/4200000010).string(message[".google.api.apiVersion"]); + return writer; + }; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 34: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 33: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1049: { + message[".google.api.defaultHost"] = reader.string(); + break; + } + case 1050: { + message[".google.api.oauthScopes"] = reader.string(); + break; + } + case 525000001: { + message[".google.api.apiVersion"] = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceOptions message. + * @function verify + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + if (!$util.isString(message[".google.api.defaultHost"])) + return ".google.api.defaultHost: string expected"; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + if (!$util.isString(message[".google.api.oauthScopes"])) + return ".google.api.oauthScopes: string expected"; + if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) + if (!$util.isString(message[".google.api.apiVersion"])) + return ".google.api.apiVersion: string expected"; + return null; + }; + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceOptions} ServiceOptions + */ + ServiceOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceOptions) + return object; + var message = new $root.google.protobuf.ServiceOptions(); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.ServiceOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.defaultHost"] != null) + message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); + if (object[".google.api.oauthScopes"] != null) + message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); + if (object[".google.api.apiVersion"] != null) + message[".google.api.apiVersion"] = String(object[".google.api.apiVersion"]); + return message; + }; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.ServiceOptions} message ServiceOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object.features = null; + object[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + object[".google.api.apiVersion"] = ""; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; + if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) + object[".google.api.apiVersion"] = message[".google.api.apiVersion"]; + return object; + }; + + /** + * Converts this ServiceOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceOptions + * @instance + * @returns {Object.} JSON object + */ + ServiceOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceOptions + * @function getTypeUrl + * @memberof google.protobuf.ServiceOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceOptions"; + }; + + return ServiceOptions; + })(); + + protobuf.MethodOptions = (function() { + + /** + * Properties of a MethodOptions. + * @memberof google.protobuf + * @interface IMethodOptions + * @property {boolean|null} [deprecated] MethodOptions deprecated + * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel + * @property {google.protobuf.IFeatureSet|null} [features] MethodOptions features + * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption + * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http + * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature + * @property {google.longrunning.IOperationInfo|null} [".google.longrunning.operationInfo"] MethodOptions .google.longrunning.operationInfo + */ + + /** + * Constructs a new MethodOptions. + * @memberof google.protobuf + * @classdesc Represents a MethodOptions. + * @implements IMethodOptions + * @constructor + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + */ + function MethodOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.methodSignature"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.deprecated = false; + + /** + * MethodOptions idempotencyLevel. + * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.idempotencyLevel = 0; + + /** + * MethodOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.features = null; + + /** + * MethodOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MethodOptions .google.api.http. + * @member {google.api.IHttpRule|null|undefined} .google.api.http + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.http"] = null; + + /** + * MethodOptions .google.api.methodSignature. + * @member {Array.} .google.api.methodSignature + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; + + /** + * MethodOptions .google.longrunning.operationInfo. + * @member {google.longrunning.IOperationInfo|null|undefined} .google.longrunning.operationInfo + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.longrunning.operationInfo"] = null; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + * @returns {google.protobuf.MethodOptions} MethodOptions instance + */ + MethodOptions.create = function create(properties) { + return new MethodOptions(properties); + }; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel")) + writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 35, wireType 2 =*/282).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.longrunning.operationInfo"] != null && Object.hasOwnProperty.call(message, ".google.longrunning.operationInfo")) + $root.google.longrunning.OperationInfo.encode(message[".google.longrunning.operationInfo"], writer.uint32(/* id 1049, wireType 2 =*/8394).fork()).ldelim(); + if (message[".google.api.methodSignature"] != null && message[".google.api.methodSignature"].length) + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + writer.uint32(/* id 1051, wireType 2 =*/8410).string(message[".google.api.methodSignature"][i]); + if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http")) + $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 33: { + message.deprecated = reader.bool(); + break; + } + case 34: { + message.idempotencyLevel = reader.int32(); + break; + } + case 35: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 72295728: { + message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); + break; + } + case 1051: { + if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) + message[".google.api.methodSignature"] = []; + message[".google.api.methodSignature"].push(reader.string()); + break; + } + case 1049: { + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodOptions message. + * @function verify + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + switch (message.idempotencyLevel) { + default: + return "idempotencyLevel: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) { + var error = $root.google.api.HttpRule.verify(message[".google.api.http"]); + if (error) + return ".google.api.http." + error; + } + if (message[".google.api.methodSignature"] != null && message.hasOwnProperty(".google.api.methodSignature")) { + if (!Array.isArray(message[".google.api.methodSignature"])) + return ".google.api.methodSignature: array expected"; + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + if (!$util.isString(message[".google.api.methodSignature"][i])) + return ".google.api.methodSignature: string[] expected"; + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) { + var error = $root.google.longrunning.OperationInfo.verify(message[".google.longrunning.operationInfo"]); + if (error) + return ".google.longrunning.operationInfo." + error; + } + return null; + }; + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodOptions} MethodOptions + */ + MethodOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodOptions) + return object; + var message = new $root.google.protobuf.MethodOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + switch (object.idempotencyLevel) { + default: + if (typeof object.idempotencyLevel === "number") { + message.idempotencyLevel = object.idempotencyLevel; + break; + } + break; + case "IDEMPOTENCY_UNKNOWN": + case 0: + message.idempotencyLevel = 0; + break; + case "NO_SIDE_EFFECTS": + case 1: + message.idempotencyLevel = 1; + break; + case "IDEMPOTENT": + case 2: + message.idempotencyLevel = 2; + break; + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.MethodOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.http"] != null) { + if (typeof object[".google.api.http"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected"); + message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"]); + } + if (object[".google.api.methodSignature"]) { + if (!Array.isArray(object[".google.api.methodSignature"])) + throw TypeError(".google.protobuf.MethodOptions..google.api.methodSignature: array expected"); + message[".google.api.methodSignature"] = []; + for (var i = 0; i < object[".google.api.methodSignature"].length; ++i) + message[".google.api.methodSignature"][i] = String(object[".google.api.methodSignature"][i]); + } + if (object[".google.longrunning.operationInfo"] != null) { + if (typeof object[".google.longrunning.operationInfo"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.longrunning.operationInfo: object expected"); + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.fromObject(object[".google.longrunning.operationInfo"]); + } + return message; + }; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.MethodOptions} message MethodOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.methodSignature"] = []; + } + if (options.defaults) { + object.deprecated = false; + object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0; + object.features = null; + object[".google.longrunning.operationInfo"] = null; + object[".google.api.http"] = null; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] === undefined ? message.idempotencyLevel : $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) + object[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.toObject(message[".google.longrunning.operationInfo"], options); + if (message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length) { + object[".google.api.methodSignature"] = []; + for (var j = 0; j < message[".google.api.methodSignature"].length; ++j) + object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j]; + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) + object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); + return object; + }; + + /** + * Converts this MethodOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MethodOptions + * @instance + * @returns {Object.} JSON object + */ + MethodOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodOptions + * @function getTypeUrl + * @memberof google.protobuf.MethodOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodOptions"; + }; + + /** + * IdempotencyLevel enum. + * @name google.protobuf.MethodOptions.IdempotencyLevel + * @enum {number} + * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value + * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value + * @property {number} IDEMPOTENT=2 IDEMPOTENT value + */ + MethodOptions.IdempotencyLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0; + values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1; + values[valuesById[2] = "IDEMPOTENT"] = 2; + return values; + })(); + + return MethodOptions; + })(); + + protobuf.UninterpretedOption = (function() { + + /** + * Properties of an UninterpretedOption. + * @memberof google.protobuf + * @interface IUninterpretedOption + * @property {Array.|null} [name] UninterpretedOption name + * @property {string|null} [identifierValue] UninterpretedOption identifierValue + * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue + * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue + * @property {number|null} [doubleValue] UninterpretedOption doubleValue + * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue + * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue + */ + + /** + * Constructs a new UninterpretedOption. + * @memberof google.protobuf + * @classdesc Represents an UninterpretedOption. + * @implements IUninterpretedOption + * @constructor + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + */ + function UninterpretedOption(properties) { + this.name = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UninterpretedOption name. + * @member {Array.} name + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.name = $util.emptyArray; + + /** + * UninterpretedOption identifierValue. + * @member {string} identifierValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.identifierValue = ""; + + /** + * UninterpretedOption positiveIntValue. + * @member {number|Long} positiveIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * UninterpretedOption negativeIntValue. + * @member {number|Long} negativeIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * UninterpretedOption doubleValue. + * @member {number} doubleValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.doubleValue = 0; + + /** + * UninterpretedOption stringValue. + * @member {Uint8Array} stringValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.stringValue = $util.newBuffer([]); + + /** + * UninterpretedOption aggregateValue. + * @member {string} aggregateValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.aggregateValue = ""; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance + */ + UninterpretedOption.create = function create(properties) { + return new UninterpretedOption(properties); + }; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.name.length) + for (var i = 0; i < message.name.length; ++i) + $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); + if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); + if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); + if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) + writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); + if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); + return writer; + }; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + if (!(message.name && message.name.length)) + message.name = []; + message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); + break; + } + case 3: { + message.identifierValue = reader.string(); + break; + } + case 4: { + message.positiveIntValue = reader.uint64(); + break; + } + case 5: { + message.negativeIntValue = reader.int64(); + break; + } + case 6: { + message.doubleValue = reader.double(); + break; + } + case 7: { + message.stringValue = reader.bytes(); + break; + } + case 8: { + message.aggregateValue = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UninterpretedOption message. + * @function verify + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UninterpretedOption.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) { + if (!Array.isArray(message.name)) + return "name: array expected"; + for (var i = 0; i < message.name.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]); + if (error) + return "name." + error; + } + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + if (!$util.isString(message.identifierValue)) + return "identifierValue: string expected"; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high))) + return "positiveIntValue: integer|Long expected"; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high))) + return "negativeIntValue: integer|Long expected"; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + if (typeof message.doubleValue !== "number") + return "doubleValue: number expected"; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue))) + return "stringValue: buffer expected"; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + if (!$util.isString(message.aggregateValue)) + return "aggregateValue: string expected"; + return null; + }; + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + */ + UninterpretedOption.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption) + return object; + var message = new $root.google.protobuf.UninterpretedOption(); + if (object.name) { + if (!Array.isArray(object.name)) + throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); + message.name = []; + for (var i = 0; i < object.name.length; ++i) { + if (typeof object.name[i] !== "object") + throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); + message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); + } + } + if (object.identifierValue != null) + message.identifierValue = String(object.identifierValue); + if (object.positiveIntValue != null) + if ($util.Long) + (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; + else if (typeof object.positiveIntValue === "string") + message.positiveIntValue = parseInt(object.positiveIntValue, 10); + else if (typeof object.positiveIntValue === "number") + message.positiveIntValue = object.positiveIntValue; + else if (typeof object.positiveIntValue === "object") + message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); + if (object.negativeIntValue != null) + if ($util.Long) + (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false; + else if (typeof object.negativeIntValue === "string") + message.negativeIntValue = parseInt(object.negativeIntValue, 10); + else if (typeof object.negativeIntValue === "number") + message.negativeIntValue = object.negativeIntValue; + else if (typeof object.negativeIntValue === "object") + message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); + if (object.doubleValue != null) + message.doubleValue = Number(object.doubleValue); + if (object.stringValue != null) + if (typeof object.stringValue === "string") + $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); + else if (object.stringValue.length >= 0) + message.stringValue = object.stringValue; + if (object.aggregateValue != null) + message.aggregateValue = String(object.aggregateValue); + return message; + }; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.UninterpretedOption} message UninterpretedOption + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UninterpretedOption.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.name = []; + if (options.defaults) { + object.identifierValue = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.positiveIntValue = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.negativeIntValue = options.longs === String ? "0" : 0; + object.doubleValue = 0; + if (options.bytes === String) + object.stringValue = ""; + else { + object.stringValue = []; + if (options.bytes !== Array) + object.stringValue = $util.newBuffer(object.stringValue); + } + object.aggregateValue = ""; + } + if (message.name && message.name.length) { + object.name = []; + for (var j = 0; j < message.name.length; ++j) + object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + object.identifierValue = message.identifierValue; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (typeof message.positiveIntValue === "number") + object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue; + else + object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (typeof message.negativeIntValue === "number") + object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue; + else + object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + object.aggregateValue = message.aggregateValue; + return object; + }; + + /** + * Converts this UninterpretedOption to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption + * @instance + * @returns {Object.} JSON object + */ + UninterpretedOption.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UninterpretedOption + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UninterpretedOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption"; + }; + + UninterpretedOption.NamePart = (function() { + + /** + * Properties of a NamePart. + * @memberof google.protobuf.UninterpretedOption + * @interface INamePart + * @property {string} namePart NamePart namePart + * @property {boolean} isExtension NamePart isExtension + */ + + /** + * Constructs a new NamePart. + * @memberof google.protobuf.UninterpretedOption + * @classdesc Represents a NamePart. + * @implements INamePart + * @constructor + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + */ + function NamePart(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NamePart namePart. + * @member {string} namePart + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.namePart = ""; + + /** + * NamePart isExtension. + * @member {boolean} isExtension + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.isExtension = false; + + /** + * Creates a new NamePart instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance + */ + NamePart.create = function create(properties) { + return new NamePart(properties); + }; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart); + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension); + return writer; + }; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.namePart = reader.string(); + break; + } + case 2: { + message.isExtension = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + if (!message.hasOwnProperty("namePart")) + throw $util.ProtocolError("missing required 'namePart'", { instance: message }); + if (!message.hasOwnProperty("isExtension")) + throw $util.ProtocolError("missing required 'isExtension'", { instance: message }); + return message; + }; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NamePart message. + * @function verify + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NamePart.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (!$util.isString(message.namePart)) + return "namePart: string expected"; + if (typeof message.isExtension !== "boolean") + return "isExtension: boolean expected"; + return null; + }; + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + */ + NamePart.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) + return object; + var message = new $root.google.protobuf.UninterpretedOption.NamePart(); + if (object.namePart != null) + message.namePart = String(object.namePart); + if (object.isExtension != null) + message.isExtension = Boolean(object.isExtension); + return message; + }; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NamePart.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.namePart = ""; + object.isExtension = false; + } + if (message.namePart != null && message.hasOwnProperty("namePart")) + object.namePart = message.namePart; + if (message.isExtension != null && message.hasOwnProperty("isExtension")) + object.isExtension = message.isExtension; + return object; + }; + + /** + * Converts this NamePart to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + * @returns {Object.} JSON object + */ + NamePart.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NamePart + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NamePart.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption.NamePart"; + }; + + return NamePart; + })(); + + return UninterpretedOption; + })(); + + protobuf.FeatureSet = (function() { + + /** + * Properties of a FeatureSet. + * @memberof google.protobuf + * @interface IFeatureSet + * @property {google.protobuf.FeatureSet.FieldPresence|null} [fieldPresence] FeatureSet fieldPresence + * @property {google.protobuf.FeatureSet.EnumType|null} [enumType] FeatureSet enumType + * @property {google.protobuf.FeatureSet.RepeatedFieldEncoding|null} [repeatedFieldEncoding] FeatureSet repeatedFieldEncoding + * @property {google.protobuf.FeatureSet.Utf8Validation|null} [utf8Validation] FeatureSet utf8Validation + * @property {google.protobuf.FeatureSet.MessageEncoding|null} [messageEncoding] FeatureSet messageEncoding + * @property {google.protobuf.FeatureSet.JsonFormat|null} [jsonFormat] FeatureSet jsonFormat + */ + + /** + * Constructs a new FeatureSet. + * @memberof google.protobuf + * @classdesc Represents a FeatureSet. + * @implements IFeatureSet + * @constructor + * @param {google.protobuf.IFeatureSet=} [properties] Properties to set + */ + function FeatureSet(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSet fieldPresence. + * @member {google.protobuf.FeatureSet.FieldPresence} fieldPresence + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.fieldPresence = 0; + + /** + * FeatureSet enumType. + * @member {google.protobuf.FeatureSet.EnumType} enumType + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.enumType = 0; + + /** + * FeatureSet repeatedFieldEncoding. + * @member {google.protobuf.FeatureSet.RepeatedFieldEncoding} repeatedFieldEncoding + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.repeatedFieldEncoding = 0; + + /** + * FeatureSet utf8Validation. + * @member {google.protobuf.FeatureSet.Utf8Validation} utf8Validation + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.utf8Validation = 0; + + /** + * FeatureSet messageEncoding. + * @member {google.protobuf.FeatureSet.MessageEncoding} messageEncoding + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.messageEncoding = 0; + + /** + * FeatureSet jsonFormat. + * @member {google.protobuf.FeatureSet.JsonFormat} jsonFormat + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.jsonFormat = 0; + + /** + * Creates a new FeatureSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet=} [properties] Properties to set + * @returns {google.protobuf.FeatureSet} FeatureSet instance + */ + FeatureSet.create = function create(properties) { + return new FeatureSet(properties); + }; + + /** + * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fieldPresence != null && Object.hasOwnProperty.call(message, "fieldPresence")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.fieldPresence); + if (message.enumType != null && Object.hasOwnProperty.call(message, "enumType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.enumType); + if (message.repeatedFieldEncoding != null && Object.hasOwnProperty.call(message, "repeatedFieldEncoding")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.repeatedFieldEncoding); + if (message.utf8Validation != null && Object.hasOwnProperty.call(message, "utf8Validation")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.utf8Validation); + if (message.messageEncoding != null && Object.hasOwnProperty.call(message, "messageEncoding")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.messageEncoding); + if (message.jsonFormat != null && Object.hasOwnProperty.call(message, "jsonFormat")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jsonFormat); + return writer; + }; + + /** + * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSet} FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSet.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.fieldPresence = reader.int32(); + break; + } + case 2: { + message.enumType = reader.int32(); + break; + } + case 3: { + message.repeatedFieldEncoding = reader.int32(); + break; + } + case 4: { + message.utf8Validation = reader.int32(); + break; + } + case 5: { + message.messageEncoding = reader.int32(); + break; + } + case 6: { + message.jsonFormat = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSet} FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSet message. + * @function verify + * @memberof google.protobuf.FeatureSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) + switch (message.fieldPresence) { + default: + return "fieldPresence: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.enumType != null && message.hasOwnProperty("enumType")) + switch (message.enumType) { + default: + return "enumType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) + switch (message.repeatedFieldEncoding) { + default: + return "repeatedFieldEncoding: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) + switch (message.utf8Validation) { + default: + return "utf8Validation: enum value expected"; + case 0: + case 2: + case 3: + break; + } + if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) + switch (message.messageEncoding) { + default: + return "messageEncoding: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) + switch (message.jsonFormat) { + default: + return "jsonFormat: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSet} FeatureSet + */ + FeatureSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSet) + return object; + var message = new $root.google.protobuf.FeatureSet(); + switch (object.fieldPresence) { + default: + if (typeof object.fieldPresence === "number") { + message.fieldPresence = object.fieldPresence; + break; + } + break; + case "FIELD_PRESENCE_UNKNOWN": + case 0: + message.fieldPresence = 0; + break; + case "EXPLICIT": + case 1: + message.fieldPresence = 1; + break; + case "IMPLICIT": + case 2: + message.fieldPresence = 2; + break; + case "LEGACY_REQUIRED": + case 3: + message.fieldPresence = 3; + break; + } + switch (object.enumType) { + default: + if (typeof object.enumType === "number") { + message.enumType = object.enumType; + break; + } + break; + case "ENUM_TYPE_UNKNOWN": + case 0: + message.enumType = 0; + break; + case "OPEN": + case 1: + message.enumType = 1; + break; + case "CLOSED": + case 2: + message.enumType = 2; + break; + } + switch (object.repeatedFieldEncoding) { + default: + if (typeof object.repeatedFieldEncoding === "number") { + message.repeatedFieldEncoding = object.repeatedFieldEncoding; + break; + } + break; + case "REPEATED_FIELD_ENCODING_UNKNOWN": + case 0: + message.repeatedFieldEncoding = 0; + break; + case "PACKED": + case 1: + message.repeatedFieldEncoding = 1; + break; + case "EXPANDED": + case 2: + message.repeatedFieldEncoding = 2; + break; + } + switch (object.utf8Validation) { + default: + if (typeof object.utf8Validation === "number") { + message.utf8Validation = object.utf8Validation; + break; + } + break; + case "UTF8_VALIDATION_UNKNOWN": + case 0: + message.utf8Validation = 0; + break; + case "VERIFY": + case 2: + message.utf8Validation = 2; + break; + case "NONE": + case 3: + message.utf8Validation = 3; + break; + } + switch (object.messageEncoding) { + default: + if (typeof object.messageEncoding === "number") { + message.messageEncoding = object.messageEncoding; + break; + } + break; + case "MESSAGE_ENCODING_UNKNOWN": + case 0: + message.messageEncoding = 0; + break; + case "LENGTH_PREFIXED": + case 1: + message.messageEncoding = 1; + break; + case "DELIMITED": + case 2: + message.messageEncoding = 2; + break; + } + switch (object.jsonFormat) { + default: + if (typeof object.jsonFormat === "number") { + message.jsonFormat = object.jsonFormat; + break; + } + break; + case "JSON_FORMAT_UNKNOWN": + case 0: + message.jsonFormat = 0; + break; + case "ALLOW": + case 1: + message.jsonFormat = 1; + break; + case "LEGACY_BEST_EFFORT": + case 2: + message.jsonFormat = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.FeatureSet} message FeatureSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.fieldPresence = options.enums === String ? "FIELD_PRESENCE_UNKNOWN" : 0; + object.enumType = options.enums === String ? "ENUM_TYPE_UNKNOWN" : 0; + object.repeatedFieldEncoding = options.enums === String ? "REPEATED_FIELD_ENCODING_UNKNOWN" : 0; + object.utf8Validation = options.enums === String ? "UTF8_VALIDATION_UNKNOWN" : 0; + object.messageEncoding = options.enums === String ? "MESSAGE_ENCODING_UNKNOWN" : 0; + object.jsonFormat = options.enums === String ? "JSON_FORMAT_UNKNOWN" : 0; + } + if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) + object.fieldPresence = options.enums === String ? $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] === undefined ? message.fieldPresence : $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] : message.fieldPresence; + if (message.enumType != null && message.hasOwnProperty("enumType")) + object.enumType = options.enums === String ? $root.google.protobuf.FeatureSet.EnumType[message.enumType] === undefined ? message.enumType : $root.google.protobuf.FeatureSet.EnumType[message.enumType] : message.enumType; + if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) + object.repeatedFieldEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] === undefined ? message.repeatedFieldEncoding : $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] : message.repeatedFieldEncoding; + if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) + object.utf8Validation = options.enums === String ? $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] === undefined ? message.utf8Validation : $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] : message.utf8Validation; + if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) + object.messageEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] === undefined ? message.messageEncoding : $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] : message.messageEncoding; + if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) + object.jsonFormat = options.enums === String ? $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] === undefined ? message.jsonFormat : $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] : message.jsonFormat; + return object; + }; + + /** + * Converts this FeatureSet to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSet + * @instance + * @returns {Object.} JSON object + */ + FeatureSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSet + * @function getTypeUrl + * @memberof google.protobuf.FeatureSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSet"; + }; + + /** + * FieldPresence enum. + * @name google.protobuf.FeatureSet.FieldPresence + * @enum {number} + * @property {number} FIELD_PRESENCE_UNKNOWN=0 FIELD_PRESENCE_UNKNOWN value + * @property {number} EXPLICIT=1 EXPLICIT value + * @property {number} IMPLICIT=2 IMPLICIT value + * @property {number} LEGACY_REQUIRED=3 LEGACY_REQUIRED value + */ + FeatureSet.FieldPresence = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_PRESENCE_UNKNOWN"] = 0; + values[valuesById[1] = "EXPLICIT"] = 1; + values[valuesById[2] = "IMPLICIT"] = 2; + values[valuesById[3] = "LEGACY_REQUIRED"] = 3; + return values; + })(); + + /** + * EnumType enum. + * @name google.protobuf.FeatureSet.EnumType + * @enum {number} + * @property {number} ENUM_TYPE_UNKNOWN=0 ENUM_TYPE_UNKNOWN value + * @property {number} OPEN=1 OPEN value + * @property {number} CLOSED=2 CLOSED value + */ + FeatureSet.EnumType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENUM_TYPE_UNKNOWN"] = 0; + values[valuesById[1] = "OPEN"] = 1; + values[valuesById[2] = "CLOSED"] = 2; + return values; + })(); + + /** + * RepeatedFieldEncoding enum. + * @name google.protobuf.FeatureSet.RepeatedFieldEncoding + * @enum {number} + * @property {number} REPEATED_FIELD_ENCODING_UNKNOWN=0 REPEATED_FIELD_ENCODING_UNKNOWN value + * @property {number} PACKED=1 PACKED value + * @property {number} EXPANDED=2 EXPANDED value + */ + FeatureSet.RepeatedFieldEncoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "REPEATED_FIELD_ENCODING_UNKNOWN"] = 0; + values[valuesById[1] = "PACKED"] = 1; + values[valuesById[2] = "EXPANDED"] = 2; + return values; + })(); + + /** + * Utf8Validation enum. + * @name google.protobuf.FeatureSet.Utf8Validation + * @enum {number} + * @property {number} UTF8_VALIDATION_UNKNOWN=0 UTF8_VALIDATION_UNKNOWN value + * @property {number} VERIFY=2 VERIFY value + * @property {number} NONE=3 NONE value + */ + FeatureSet.Utf8Validation = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UTF8_VALIDATION_UNKNOWN"] = 0; + values[valuesById[2] = "VERIFY"] = 2; + values[valuesById[3] = "NONE"] = 3; + return values; + })(); + + /** + * MessageEncoding enum. + * @name google.protobuf.FeatureSet.MessageEncoding + * @enum {number} + * @property {number} MESSAGE_ENCODING_UNKNOWN=0 MESSAGE_ENCODING_UNKNOWN value + * @property {number} LENGTH_PREFIXED=1 LENGTH_PREFIXED value + * @property {number} DELIMITED=2 DELIMITED value + */ + FeatureSet.MessageEncoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MESSAGE_ENCODING_UNKNOWN"] = 0; + values[valuesById[1] = "LENGTH_PREFIXED"] = 1; + values[valuesById[2] = "DELIMITED"] = 2; + return values; + })(); + + /** + * JsonFormat enum. + * @name google.protobuf.FeatureSet.JsonFormat + * @enum {number} + * @property {number} JSON_FORMAT_UNKNOWN=0 JSON_FORMAT_UNKNOWN value + * @property {number} ALLOW=1 ALLOW value + * @property {number} LEGACY_BEST_EFFORT=2 LEGACY_BEST_EFFORT value + */ + FeatureSet.JsonFormat = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JSON_FORMAT_UNKNOWN"] = 0; + values[valuesById[1] = "ALLOW"] = 1; + values[valuesById[2] = "LEGACY_BEST_EFFORT"] = 2; + return values; + })(); + + return FeatureSet; + })(); + + protobuf.FeatureSetDefaults = (function() { + + /** + * Properties of a FeatureSetDefaults. + * @memberof google.protobuf + * @interface IFeatureSetDefaults + * @property {Array.|null} [defaults] FeatureSetDefaults defaults + * @property {google.protobuf.Edition|null} [minimumEdition] FeatureSetDefaults minimumEdition + * @property {google.protobuf.Edition|null} [maximumEdition] FeatureSetDefaults maximumEdition + */ + + /** + * Constructs a new FeatureSetDefaults. + * @memberof google.protobuf + * @classdesc Represents a FeatureSetDefaults. + * @implements IFeatureSetDefaults + * @constructor + * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set + */ + function FeatureSetDefaults(properties) { + this.defaults = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSetDefaults defaults. + * @member {Array.} defaults + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.defaults = $util.emptyArray; + + /** + * FeatureSetDefaults minimumEdition. + * @member {google.protobuf.Edition} minimumEdition + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.minimumEdition = 0; + + /** + * FeatureSetDefaults maximumEdition. + * @member {google.protobuf.Edition} maximumEdition + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.maximumEdition = 0; + + /** + * Creates a new FeatureSetDefaults instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults instance + */ + FeatureSetDefaults.create = function create(properties) { + return new FeatureSetDefaults(properties); + }; + + /** + * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetDefaults.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.defaults != null && message.defaults.length) + for (var i = 0; i < message.defaults.length; ++i) + $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.encode(message.defaults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.minimumEdition != null && Object.hasOwnProperty.call(message, "minimumEdition")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.minimumEdition); + if (message.maximumEdition != null && Object.hasOwnProperty.call(message, "maximumEdition")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maximumEdition); + return writer; + }; + + /** + * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetDefaults.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetDefaults.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.defaults && message.defaults.length)) + message.defaults = []; + message.defaults.push($root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.decode(reader, reader.uint32())); + break; + } + case 4: { + message.minimumEdition = reader.int32(); + break; + } + case 5: { + message.maximumEdition = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetDefaults.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSetDefaults message. + * @function verify + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSetDefaults.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.defaults != null && message.hasOwnProperty("defaults")) { + if (!Array.isArray(message.defaults)) + return "defaults: array expected"; + for (var i = 0; i < message.defaults.length; ++i) { + var error = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify(message.defaults[i]); + if (error) + return "defaults." + error; + } + } + if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) + switch (message.minimumEdition) { + default: + return "minimumEdition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) + switch (message.maximumEdition) { + default: + return "maximumEdition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + return null; + }; + + /** + * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + */ + FeatureSetDefaults.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSetDefaults) + return object; + var message = new $root.google.protobuf.FeatureSetDefaults(); + if (object.defaults) { + if (!Array.isArray(object.defaults)) + throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: array expected"); + message.defaults = []; + for (var i = 0; i < object.defaults.length; ++i) { + if (typeof object.defaults[i] !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: object expected"); + message.defaults[i] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fromObject(object.defaults[i]); + } + } + switch (object.minimumEdition) { + default: + if (typeof object.minimumEdition === "number") { + message.minimumEdition = object.minimumEdition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.minimumEdition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.minimumEdition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.minimumEdition = 999; + break; + case "EDITION_2023": + case 1000: + message.minimumEdition = 1000; + break; + case "EDITION_2024": + case 1001: + message.minimumEdition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.minimumEdition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.minimumEdition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.minimumEdition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.minimumEdition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.minimumEdition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.minimumEdition = 2147483647; + break; + } + switch (object.maximumEdition) { + default: + if (typeof object.maximumEdition === "number") { + message.maximumEdition = object.maximumEdition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.maximumEdition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.maximumEdition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.maximumEdition = 999; + break; + case "EDITION_2023": + case 1000: + message.maximumEdition = 1000; + break; + case "EDITION_2024": + case 1001: + message.maximumEdition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.maximumEdition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.maximumEdition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.maximumEdition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.maximumEdition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.maximumEdition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.maximumEdition = 2147483647; + break; + } + return message; + }; + + /** + * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.FeatureSetDefaults} message FeatureSetDefaults + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSetDefaults.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.defaults = []; + if (options.defaults) { + object.minimumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.maximumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.defaults && message.defaults.length) { + object.defaults = []; + for (var j = 0; j < message.defaults.length; ++j) + object.defaults[j] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.toObject(message.defaults[j], options); + } + if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) + object.minimumEdition = options.enums === String ? $root.google.protobuf.Edition[message.minimumEdition] === undefined ? message.minimumEdition : $root.google.protobuf.Edition[message.minimumEdition] : message.minimumEdition; + if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) + object.maximumEdition = options.enums === String ? $root.google.protobuf.Edition[message.maximumEdition] === undefined ? message.maximumEdition : $root.google.protobuf.Edition[message.maximumEdition] : message.maximumEdition; + return object; + }; + + /** + * Converts this FeatureSetDefaults to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSetDefaults + * @instance + * @returns {Object.} JSON object + */ + FeatureSetDefaults.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSetDefaults + * @function getTypeUrl + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSetDefaults.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults"; + }; + + FeatureSetDefaults.FeatureSetEditionDefault = (function() { + + /** + * Properties of a FeatureSetEditionDefault. + * @memberof google.protobuf.FeatureSetDefaults + * @interface IFeatureSetEditionDefault + * @property {google.protobuf.Edition|null} [edition] FeatureSetEditionDefault edition + * @property {google.protobuf.IFeatureSet|null} [features] FeatureSetEditionDefault features + */ + + /** + * Constructs a new FeatureSetEditionDefault. + * @memberof google.protobuf.FeatureSetDefaults + * @classdesc Represents a FeatureSetEditionDefault. + * @implements IFeatureSetEditionDefault + * @constructor + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set + */ + function FeatureSetEditionDefault(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSetEditionDefault edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.edition = 0; + + /** + * FeatureSetEditionDefault features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.features = null; + + /** + * Creates a new FeatureSetEditionDefault instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault instance + */ + FeatureSetEditionDefault.create = function create(properties) { + return new FeatureSetEditionDefault(properties); + }; + + /** + * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetEditionDefault.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetEditionDefault.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetEditionDefault.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.edition = reader.int32(); + break; + } + case 2: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetEditionDefault.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSetEditionDefault message. + * @function verify + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSetEditionDefault.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + return null; + }; + + /** + * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + */ + FeatureSetEditionDefault.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault) + return object; + var message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + return message; + }; + + /** + * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} message FeatureSetEditionDefault + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSetEditionDefault.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.features = null; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this FeatureSetEditionDefault to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + * @returns {Object.} JSON object + */ + FeatureSetEditionDefault.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSetEditionDefault + * @function getTypeUrl + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSetEditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault"; + }; + + return FeatureSetEditionDefault; + })(); + + return FeatureSetDefaults; + })(); + + protobuf.SourceCodeInfo = (function() { + + /** + * Properties of a SourceCodeInfo. + * @memberof google.protobuf + * @interface ISourceCodeInfo + * @property {Array.|null} [location] SourceCodeInfo location + */ + + /** + * Constructs a new SourceCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a SourceCodeInfo. + * @implements ISourceCodeInfo + * @constructor + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + */ + function SourceCodeInfo(properties) { + this.location = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SourceCodeInfo location. + * @member {Array.} location + * @memberof google.protobuf.SourceCodeInfo + * @instance + */ + SourceCodeInfo.prototype.location = $util.emptyArray; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance + */ + SourceCodeInfo.create = function create(properties) { + return new SourceCodeInfo(properties); + }; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.location != null && message.location.length) + for (var i = 0; i < message.location.length; ++i) + $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.location && message.location.length)) + message.location = []; + message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SourceCodeInfo message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SourceCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.location != null && message.hasOwnProperty("location")) { + if (!Array.isArray(message.location)) + return "location: array expected"; + for (var i = 0; i < message.location.length; ++i) { + var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]); + if (error) + return "location." + error; + } + } + return null; + }; + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + */ + SourceCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo) + return object; + var message = new $root.google.protobuf.SourceCodeInfo(); + if (object.location) { + if (!Array.isArray(object.location)) + throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); + message.location = []; + for (var i = 0; i < object.location.length; ++i) { + if (typeof object.location[i] !== "object") + throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); + message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SourceCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.location = []; + if (message.location && message.location.length) { + object.location = []; + for (var j = 0; j < message.location.length; ++j) + object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options); + } + return object; + }; + + /** + * Converts this SourceCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo + * @instance + * @returns {Object.} JSON object + */ + SourceCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SourceCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SourceCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo"; + }; + + SourceCodeInfo.Location = (function() { + + /** + * Properties of a Location. + * @memberof google.protobuf.SourceCodeInfo + * @interface ILocation + * @property {Array.|null} [path] Location path + * @property {Array.|null} [span] Location span + * @property {string|null} [leadingComments] Location leadingComments + * @property {string|null} [trailingComments] Location trailingComments + * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments + */ + + /** + * Constructs a new Location. + * @memberof google.protobuf.SourceCodeInfo + * @classdesc Represents a Location. + * @implements ILocation + * @constructor + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + */ + function Location(properties) { + this.path = []; + this.span = []; + this.leadingDetachedComments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Location path. + * @member {Array.} path + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.path = $util.emptyArray; + + /** + * Location span. + * @member {Array.} span + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.span = $util.emptyArray; + + /** + * Location leadingComments. + * @member {string} leadingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingComments = ""; + + /** + * Location trailingComments. + * @member {string} trailingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.trailingComments = ""; + + /** + * Location leadingDetachedComments. + * @member {Array.} leadingDetachedComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingDetachedComments = $util.emptyArray; + + /** + * Creates a new Location instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo.Location} Location instance + */ + Location.create = function create(properties) { + return new Location(properties); + }; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.span != null && message.span.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.span.length; ++i) + writer.int32(message.span[i]); + writer.ldelim(); + } + if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); + if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); + if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); + return writer; + }; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Location message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + if (!(message.span && message.span.length)) + message.span = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.span.push(reader.int32()); + } else + message.span.push(reader.int32()); + break; + } + case 3: { + message.leadingComments = reader.string(); + break; + } + case 4: { + message.trailingComments = reader.string(); + break; + } + case 6: { + if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) + message.leadingDetachedComments = []; + message.leadingDetachedComments.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Location message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Location.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.span != null && message.hasOwnProperty("span")) { + if (!Array.isArray(message.span)) + return "span: array expected"; + for (var i = 0; i < message.span.length; ++i) + if (!$util.isInteger(message.span[i])) + return "span: integer[] expected"; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + if (!$util.isString(message.leadingComments)) + return "leadingComments: string expected"; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + if (!$util.isString(message.trailingComments)) + return "trailingComments: string expected"; + if (message.leadingDetachedComments != null && message.hasOwnProperty("leadingDetachedComments")) { + if (!Array.isArray(message.leadingDetachedComments)) + return "leadingDetachedComments: array expected"; + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + if (!$util.isString(message.leadingDetachedComments[i])) + return "leadingDetachedComments: string[] expected"; + } + return null; + }; + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo.Location} Location + */ + Location.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) + return object; + var message = new $root.google.protobuf.SourceCodeInfo.Location(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.span) { + if (!Array.isArray(object.span)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); + message.span = []; + for (var i = 0; i < object.span.length; ++i) + message.span[i] = object.span[i] | 0; + } + if (object.leadingComments != null) + message.leadingComments = String(object.leadingComments); + if (object.trailingComments != null) + message.trailingComments = String(object.trailingComments); + if (object.leadingDetachedComments) { + if (!Array.isArray(object.leadingDetachedComments)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected"); + message.leadingDetachedComments = []; + for (var i = 0; i < object.leadingDetachedComments.length; ++i) + message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]); + } + return message; + }; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.Location} message Location + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Location.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.path = []; + object.span = []; + object.leadingDetachedComments = []; + } + if (options.defaults) { + object.leadingComments = ""; + object.trailingComments = ""; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.span && message.span.length) { + object.span = []; + for (var j = 0; j < message.span.length; ++j) + object.span[j] = message.span[j]; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + object.leadingComments = message.leadingComments; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + object.trailingComments = message.trailingComments; + if (message.leadingDetachedComments && message.leadingDetachedComments.length) { + object.leadingDetachedComments = []; + for (var j = 0; j < message.leadingDetachedComments.length; ++j) + object.leadingDetachedComments[j] = message.leadingDetachedComments[j]; + } + return object; + }; + + /** + * Converts this Location to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + * @returns {Object.} JSON object + */ + Location.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Location + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Location.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo.Location"; + }; + + return Location; + })(); + + return SourceCodeInfo; + })(); + + protobuf.GeneratedCodeInfo = (function() { + + /** + * Properties of a GeneratedCodeInfo. + * @memberof google.protobuf + * @interface IGeneratedCodeInfo + * @property {Array.|null} [annotation] GeneratedCodeInfo annotation + */ + + /** + * Constructs a new GeneratedCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a GeneratedCodeInfo. + * @implements IGeneratedCodeInfo + * @constructor + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + */ + function GeneratedCodeInfo(properties) { + this.annotation = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GeneratedCodeInfo annotation. + * @member {Array.} annotation + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + */ + GeneratedCodeInfo.prototype.annotation = $util.emptyArray; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance + */ + GeneratedCodeInfo.create = function create(properties) { + return new GeneratedCodeInfo(properties); + }; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotation != null && message.annotation.length) + for (var i = 0; i < message.annotation.length; ++i) + $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.annotation && message.annotation.length)) + message.annotation = []; + message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GeneratedCodeInfo message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GeneratedCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.annotation != null && message.hasOwnProperty("annotation")) { + if (!Array.isArray(message.annotation)) + return "annotation: array expected"; + for (var i = 0; i < message.annotation.length; ++i) { + var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]); + if (error) + return "annotation." + error; + } + } + return null; + }; + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + */ + GeneratedCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo(); + if (object.annotation) { + if (!Array.isArray(object.annotation)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); + message.annotation = []; + for (var i = 0; i < object.annotation.length; ++i) { + if (typeof object.annotation[i] !== "object") + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); + message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GeneratedCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.annotation = []; + if (message.annotation && message.annotation.length) { + object.annotation = []; + for (var j = 0; j < message.annotation.length; ++j) + object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options); + } + return object; + }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + * @returns {Object.} JSON object + */ + GeneratedCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GeneratedCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo"; + }; + + GeneratedCodeInfo.Annotation = (function() { + + /** + * Properties of an Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @interface IAnnotation + * @property {Array.|null} [path] Annotation path + * @property {string|null} [sourceFile] Annotation sourceFile + * @property {number|null} [begin] Annotation begin + * @property {number|null} [end] Annotation end + * @property {google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null} [semantic] Annotation semantic + */ + + /** + * Constructs a new Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @classdesc Represents an Annotation. + * @implements IAnnotation + * @constructor + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + */ + function Annotation(properties) { + this.path = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Annotation path. + * @member {Array.} path + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.path = $util.emptyArray; + + /** + * Annotation sourceFile. + * @member {string} sourceFile + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.sourceFile = ""; + + /** + * Annotation begin. + * @member {number} begin + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.begin = 0; + + /** + * Annotation end. + * @member {number} end + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.end = 0; + + /** + * Annotation semantic. + * @member {google.protobuf.GeneratedCodeInfo.Annotation.Semantic} semantic + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.semantic = 0; + + /** + * Creates a new Annotation instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance + */ + Annotation.create = function create(properties) { + return new Annotation(properties); + }; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); + if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); + if (message.semantic != null && Object.hasOwnProperty.call(message, "semantic")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.semantic); + return writer; + }; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + message.sourceFile = reader.string(); + break; + } + case 3: { + message.begin = reader.int32(); + break; + } + case 4: { + message.end = reader.int32(); + break; + } + case 5: { + message.semantic = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Annotation message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Annotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + if (!$util.isString(message.sourceFile)) + return "sourceFile: string expected"; + if (message.begin != null && message.hasOwnProperty("begin")) + if (!$util.isInteger(message.begin)) + return "begin: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.semantic != null && message.hasOwnProperty("semantic")) + switch (message.semantic) { + default: + return "semantic: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + */ + Annotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.sourceFile != null) + message.sourceFile = String(object.sourceFile); + if (object.begin != null) + message.begin = object.begin | 0; + if (object.end != null) + message.end = object.end | 0; + switch (object.semantic) { + default: + if (typeof object.semantic === "number") { + message.semantic = object.semantic; + break; + } + break; + case "NONE": + case 0: + message.semantic = 0; + break; + case "SET": + case 1: + message.semantic = 1; + break; + case "ALIAS": + case 2: + message.semantic = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Annotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.path = []; + if (options.defaults) { + object.sourceFile = ""; + object.begin = 0; + object.end = 0; + object.semantic = options.enums === String ? "NONE" : 0; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + object.sourceFile = message.sourceFile; + if (message.begin != null && message.hasOwnProperty("begin")) + object.begin = message.begin; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.semantic != null && message.hasOwnProperty("semantic")) + object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] === undefined ? message.semantic : $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic; + return object; + }; + + /** + * Converts this Annotation to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + * @returns {Object.} JSON object + */ + Annotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Annotation + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Annotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo.Annotation"; + }; + + /** + * Semantic enum. + * @name google.protobuf.GeneratedCodeInfo.Annotation.Semantic + * @enum {number} + * @property {number} NONE=0 NONE value + * @property {number} SET=1 SET value + * @property {number} ALIAS=2 ALIAS value + */ + Annotation.Semantic = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "SET"] = 1; + values[valuesById[2] = "ALIAS"] = 2; + return values; + })(); + + return Annotation; + })(); + + return GeneratedCodeInfo; + })(); + + protobuf.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof google.protobuf + * @interface IDuration + * @property {number|Long|null} [seconds] Duration seconds + * @property {number|null} [nanos] Duration nanos + */ + + /** + * Constructs a new Duration. + * @memberof google.protobuf + * @classdesc Represents a Duration. + * @implements IDuration + * @constructor + * @param {google.protobuf.IDuration=} [properties] Properties to set + */ + function Duration(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Duration seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Duration nanos. + * @member {number} nanos + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.nanos = 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration=} [properties] Properties to set + * @returns {google.protobuf.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Duration message. + * @function verify + * @memberof google.protobuf.Duration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Duration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Duration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Duration} Duration + */ + Duration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Duration) + return object; + var message = new $root.google.protobuf.Duration(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.Duration} message Duration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Duration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Duration to JSON. + * @function toJSON + * @memberof google.protobuf.Duration + * @instance + * @returns {Object.} JSON object + */ + Duration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof google.protobuf.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Duration"; + }; + + return Duration; + })(); + + protobuf.Any = (function() { + + /** + * Properties of an Any. + * @memberof google.protobuf + * @interface IAny + * @property {string|null} [type_url] Any type_url + * @property {Uint8Array|null} [value] Any value + */ + + /** + * Constructs a new Any. + * @memberof google.protobuf + * @classdesc Represents an Any. + * @implements IAny + * @constructor + * @param {google.protobuf.IAny=} [properties] Properties to set + */ + function Any(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Any type_url. + * @member {string} type_url + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.type_url = ""; + + /** + * Any value. + * @member {Uint8Array} value + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.value = $util.newBuffer([]); + + /** + * Creates a new Any instance using the specified properties. + * @function create + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny=} [properties] Properties to set + * @returns {google.protobuf.Any} Any instance + */ + Any.create = function create(properties) { + return new Any(properties); + }; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Any message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.type_url = reader.string(); + break; + } + case 2: { + message.value = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Any message. + * @function verify + * @memberof google.protobuf.Any + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Any.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type_url != null && message.hasOwnProperty("type_url")) + if (!$util.isString(message.type_url)) + return "type_url: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Any + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Any} Any + */ + Any.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Any) + return object; + var message = new $root.google.protobuf.Any(); + if (object.type_url != null) + message.type_url = String(object.type_url); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length >= 0) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.Any} message Any + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Any.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type_url = ""; + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + } + if (message.type_url != null && message.hasOwnProperty("type_url")) + object.type_url = message.type_url; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this Any to JSON. + * @function toJSON + * @memberof google.protobuf.Any + * @instance + * @returns {Object.} JSON object + */ + Any.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Any + * @function getTypeUrl + * @memberof google.protobuf.Any + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Any.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Any"; + }; + + return Any; + })(); + + protobuf.Empty = (function() { + + /** + * Properties of an Empty. + * @memberof google.protobuf + * @interface IEmpty + */ + + /** + * Constructs a new Empty. + * @memberof google.protobuf + * @classdesc Represents an Empty. + * @implements IEmpty + * @constructor + * @param {google.protobuf.IEmpty=} [properties] Properties to set + */ + function Empty(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new Empty instance using the specified properties. + * @function create + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty=} [properties] Properties to set + * @returns {google.protobuf.Empty} Empty instance + */ + Empty.create = function create(properties) { + return new Empty(properties); + }; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Empty message. + * @function verify + * @memberof google.protobuf.Empty + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Empty.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Empty + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Empty} Empty + */ + Empty.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Empty) + return object; + return new $root.google.protobuf.Empty(); + }; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.Empty} message Empty + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Empty.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Empty to JSON. + * @function toJSON + * @memberof google.protobuf.Empty + * @instance + * @returns {Object.} JSON object + */ + Empty.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Empty + * @function getTypeUrl + * @memberof google.protobuf.Empty + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Empty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Empty"; + }; + + return Empty; + })(); + + protobuf.FieldMask = (function() { + + /** + * Properties of a FieldMask. + * @memberof google.protobuf + * @interface IFieldMask + * @property {Array.|null} [paths] FieldMask paths + */ + + /** + * Constructs a new FieldMask. + * @memberof google.protobuf + * @classdesc Represents a FieldMask. + * @implements IFieldMask + * @constructor + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + */ + function FieldMask(properties) { + this.paths = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldMask paths. + * @member {Array.} paths + * @memberof google.protobuf.FieldMask + * @instance + */ + FieldMask.prototype.paths = $util.emptyArray; + + /** + * Creates a new FieldMask instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + * @returns {google.protobuf.FieldMask} FieldMask instance + */ + FieldMask.create = function create(properties) { + return new FieldMask(properties); + }; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.paths != null && message.paths.length) + for (var i = 0; i < message.paths.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.paths[i]); + return writer; + }; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldMask(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.paths && message.paths.length)) + message.paths = []; + message.paths.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldMask message. + * @function verify + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldMask.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.paths != null && message.hasOwnProperty("paths")) { + if (!Array.isArray(message.paths)) + return "paths: array expected"; + for (var i = 0; i < message.paths.length; ++i) + if (!$util.isString(message.paths[i])) + return "paths: string[] expected"; + } + return null; + }; + + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldMask} FieldMask + */ + FieldMask.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldMask) + return object; + var message = new $root.google.protobuf.FieldMask(); + if (object.paths) { + if (!Array.isArray(object.paths)) + throw TypeError(".google.protobuf.FieldMask.paths: array expected"); + message.paths = []; + for (var i = 0; i < object.paths.length; ++i) + message.paths[i] = String(object.paths[i]); + } + return message; + }; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.FieldMask} message FieldMask + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldMask.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.paths = []; + if (message.paths && message.paths.length) { + object.paths = []; + for (var j = 0; j < message.paths.length; ++j) + object.paths[j] = message.paths[j]; + } + return object; + }; + + /** + * Converts this FieldMask to JSON. + * @function toJSON + * @memberof google.protobuf.FieldMask + * @instance + * @returns {Object.} JSON object + */ + FieldMask.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldMask + * @function getTypeUrl + * @memberof google.protobuf.FieldMask + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldMask.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldMask"; + }; + + return FieldMask; + })(); + + protobuf.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof google.protobuf + * @interface ITimestamp + * @property {number|Long|null} [seconds] Timestamp seconds + * @property {number|null} [nanos] Timestamp nanos + */ + + /** + * Constructs a new Timestamp. + * @memberof google.protobuf + * @classdesc Represents a Timestamp. + * @implements ITimestamp + * @constructor + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + */ + function Timestamp(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Timestamp seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Timestamp nanos. + * @member {number} nanos + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + * @returns {google.protobuf.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Timestamp message. + * @function verify + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Timestamp.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Timestamp} Timestamp + */ + Timestamp.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Timestamp) + return object; + var message = new $root.google.protobuf.Timestamp(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.Timestamp} message Timestamp + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Timestamp.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Timestamp to JSON. + * @function toJSON + * @memberof google.protobuf.Timestamp + * @instance + * @returns {Object.} JSON object + */ + Timestamp.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof google.protobuf.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Timestamp"; + }; + + return Timestamp; + })(); + + protobuf.Struct = (function() { + + /** + * Properties of a Struct. + * @memberof google.protobuf + * @interface IStruct + * @property {Object.|null} [fields] Struct fields + */ + + /** + * Constructs a new Struct. + * @memberof google.protobuf + * @classdesc Represents a Struct. + * @implements IStruct + * @constructor + * @param {google.protobuf.IStruct=} [properties] Properties to set + */ + function Struct(properties) { + this.fields = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Struct fields. + * @member {Object.} fields + * @memberof google.protobuf.Struct + * @instance + */ + Struct.prototype.fields = $util.emptyObject; + + /** + * Creates a new Struct instance using the specified properties. + * @function create + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.IStruct=} [properties] Properties to set + * @returns {google.protobuf.Struct} Struct instance + */ + Struct.create = function create(properties) { + return new Struct(properties); + }; + + /** + * Encodes the specified Struct message. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.IStruct} message Struct message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Struct.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fields != null && Object.hasOwnProperty.call(message, "fields")) + for (var keys = Object.keys(message.fields), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.protobuf.Value.encode(message.fields[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified Struct message, length delimited. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.IStruct} message Struct message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Struct.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Struct message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Struct + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Struct} Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Struct.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Struct(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (message.fields === $util.emptyObject) + message.fields = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.fields[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Struct message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Struct + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Struct} Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Struct.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Struct message. + * @function verify + * @memberof google.protobuf.Struct + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Struct.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fields != null && message.hasOwnProperty("fields")) { + if (!$util.isObject(message.fields)) + return "fields: object expected"; + var key = Object.keys(message.fields); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.fields[key[i]]); + if (error) + return "fields." + error; + } + } + return null; + }; + + /** + * Creates a Struct message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Struct + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Struct} Struct + */ + Struct.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Struct) + return object; + var message = new $root.google.protobuf.Struct(); + if (object.fields) { + if (typeof object.fields !== "object") + throw TypeError(".google.protobuf.Struct.fields: object expected"); + message.fields = {}; + for (var keys = Object.keys(object.fields), i = 0; i < keys.length; ++i) { + if (typeof object.fields[keys[i]] !== "object") + throw TypeError(".google.protobuf.Struct.fields: object expected"); + message.fields[keys[i]] = $root.google.protobuf.Value.fromObject(object.fields[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a Struct message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.Struct} message Struct + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Struct.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.fields = {}; + var keys2; + if (message.fields && (keys2 = Object.keys(message.fields)).length) { + object.fields = {}; + for (var j = 0; j < keys2.length; ++j) + object.fields[keys2[j]] = $root.google.protobuf.Value.toObject(message.fields[keys2[j]], options); + } + return object; + }; + + /** + * Converts this Struct to JSON. + * @function toJSON + * @memberof google.protobuf.Struct + * @instance + * @returns {Object.} JSON object + */ + Struct.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Struct + * @function getTypeUrl + * @memberof google.protobuf.Struct + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Struct.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Struct"; + }; + + return Struct; + })(); + + protobuf.Value = (function() { + + /** + * Properties of a Value. + * @memberof google.protobuf + * @interface IValue + * @property {google.protobuf.NullValue|null} [nullValue] Value nullValue + * @property {number|null} [numberValue] Value numberValue + * @property {string|null} [stringValue] Value stringValue + * @property {boolean|null} [boolValue] Value boolValue + * @property {google.protobuf.IStruct|null} [structValue] Value structValue + * @property {google.protobuf.IListValue|null} [listValue] Value listValue + */ + + /** + * Constructs a new Value. + * @memberof google.protobuf + * @classdesc Represents a Value. + * @implements IValue + * @constructor + * @param {google.protobuf.IValue=} [properties] Properties to set + */ + function Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Value nullValue. + * @member {google.protobuf.NullValue|null|undefined} nullValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.nullValue = null; + + /** + * Value numberValue. + * @member {number|null|undefined} numberValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.numberValue = null; + + /** + * Value stringValue. + * @member {string|null|undefined} stringValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.stringValue = null; + + /** + * Value boolValue. + * @member {boolean|null|undefined} boolValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.boolValue = null; + + /** + * Value structValue. + * @member {google.protobuf.IStruct|null|undefined} structValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.structValue = null; + + /** + * Value listValue. + * @member {google.protobuf.IListValue|null|undefined} listValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.listValue = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Value kind. + * @member {"nullValue"|"numberValue"|"stringValue"|"boolValue"|"structValue"|"listValue"|undefined} kind + * @memberof google.protobuf.Value + * @instance + */ + Object.defineProperty(Value.prototype, "kind", { + get: $util.oneOfGetter($oneOfFields = ["nullValue", "numberValue", "stringValue", "boolValue", "structValue", "listValue"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.IValue=} [properties] Properties to set + * @returns {google.protobuf.Value} Value instance + */ + Value.create = function create(properties) { + return new Value(properties); + }; + + /** + * Encodes the specified Value message. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.IValue} message Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.nullValue != null && Object.hasOwnProperty.call(message, "nullValue")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.nullValue); + if (message.numberValue != null && Object.hasOwnProperty.call(message, "numberValue")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.numberValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.stringValue); + if (message.boolValue != null && Object.hasOwnProperty.call(message, "boolValue")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.boolValue); + if (message.structValue != null && Object.hasOwnProperty.call(message, "structValue")) + $root.google.protobuf.Struct.encode(message.structValue, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.listValue != null && Object.hasOwnProperty.call(message, "listValue")) + $root.google.protobuf.ListValue.encode(message.listValue, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Value message, length delimited. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.IValue} message Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Value} Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Value.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.nullValue = reader.int32(); + break; + } + case 2: { + message.numberValue = reader.double(); + break; + } + case 3: { + message.stringValue = reader.string(); + break; + } + case 4: { + message.boolValue = reader.bool(); + break; + } + case 5: { + message.structValue = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 6: { + message.listValue = $root.google.protobuf.ListValue.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Value} Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Value message. + * @function verify + * @memberof google.protobuf.Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.nullValue != null && message.hasOwnProperty("nullValue")) { + properties.kind = 1; + switch (message.nullValue) { + default: + return "nullValue: enum value expected"; + case 0: + break; + } + } + if (message.numberValue != null && message.hasOwnProperty("numberValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (typeof message.numberValue !== "number") + return "numberValue: number expected"; + } + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (!$util.isString(message.stringValue)) + return "stringValue: string expected"; + } + if (message.boolValue != null && message.hasOwnProperty("boolValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (typeof message.boolValue !== "boolean") + return "boolValue: boolean expected"; + } + if (message.structValue != null && message.hasOwnProperty("structValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.protobuf.Struct.verify(message.structValue); + if (error) + return "structValue." + error; + } + } + if (message.listValue != null && message.hasOwnProperty("listValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.protobuf.ListValue.verify(message.listValue); + if (error) + return "listValue." + error; + } + } + return null; + }; + + /** + * Creates a Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Value} Value + */ + Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Value) + return object; + var message = new $root.google.protobuf.Value(); + switch (object.nullValue) { + default: + if (typeof object.nullValue === "number") { + message.nullValue = object.nullValue; + break; + } + break; + case "NULL_VALUE": + case 0: + message.nullValue = 0; + break; + } + if (object.numberValue != null) + message.numberValue = Number(object.numberValue); + if (object.stringValue != null) + message.stringValue = String(object.stringValue); + if (object.boolValue != null) + message.boolValue = Boolean(object.boolValue); + if (object.structValue != null) { + if (typeof object.structValue !== "object") + throw TypeError(".google.protobuf.Value.structValue: object expected"); + message.structValue = $root.google.protobuf.Struct.fromObject(object.structValue); + } + if (object.listValue != null) { + if (typeof object.listValue !== "object") + throw TypeError(".google.protobuf.Value.listValue: object expected"); + message.listValue = $root.google.protobuf.ListValue.fromObject(object.listValue); + } + return message; + }; + + /** + * Creates a plain object from a Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.Value} message Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.nullValue != null && message.hasOwnProperty("nullValue")) { + object.nullValue = options.enums === String ? $root.google.protobuf.NullValue[message.nullValue] === undefined ? message.nullValue : $root.google.protobuf.NullValue[message.nullValue] : message.nullValue; + if (options.oneofs) + object.kind = "nullValue"; + } + if (message.numberValue != null && message.hasOwnProperty("numberValue")) { + object.numberValue = options.json && !isFinite(message.numberValue) ? String(message.numberValue) : message.numberValue; + if (options.oneofs) + object.kind = "numberValue"; + } + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + object.stringValue = message.stringValue; + if (options.oneofs) + object.kind = "stringValue"; + } + if (message.boolValue != null && message.hasOwnProperty("boolValue")) { + object.boolValue = message.boolValue; + if (options.oneofs) + object.kind = "boolValue"; + } + if (message.structValue != null && message.hasOwnProperty("structValue")) { + object.structValue = $root.google.protobuf.Struct.toObject(message.structValue, options); + if (options.oneofs) + object.kind = "structValue"; + } + if (message.listValue != null && message.hasOwnProperty("listValue")) { + object.listValue = $root.google.protobuf.ListValue.toObject(message.listValue, options); + if (options.oneofs) + object.kind = "listValue"; + } + return object; + }; + + /** + * Converts this Value to JSON. + * @function toJSON + * @memberof google.protobuf.Value + * @instance + * @returns {Object.} JSON object + */ + Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Value + * @function getTypeUrl + * @memberof google.protobuf.Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Value"; + }; + + return Value; + })(); + + /** + * NullValue enum. + * @name google.protobuf.NullValue + * @enum {number} + * @property {number} NULL_VALUE=0 NULL_VALUE value + */ + protobuf.NullValue = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NULL_VALUE"] = 0; + return values; + })(); + + protobuf.ListValue = (function() { + + /** + * Properties of a ListValue. + * @memberof google.protobuf + * @interface IListValue + * @property {Array.|null} [values] ListValue values + */ + + /** + * Constructs a new ListValue. + * @memberof google.protobuf + * @classdesc Represents a ListValue. + * @implements IListValue + * @constructor + * @param {google.protobuf.IListValue=} [properties] Properties to set + */ + function ListValue(properties) { + this.values = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListValue values. + * @member {Array.} values + * @memberof google.protobuf.ListValue + * @instance + */ + ListValue.prototype.values = $util.emptyArray; + + /** + * Creates a new ListValue instance using the specified properties. + * @function create + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.IListValue=} [properties] Properties to set + * @returns {google.protobuf.ListValue} ListValue instance + */ + ListValue.create = function create(properties) { + return new ListValue(properties); + }; + + /** + * Encodes the specified ListValue message. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.IListValue} message ListValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.values != null && message.values.length) + for (var i = 0; i < message.values.length; ++i) + $root.google.protobuf.Value.encode(message.values[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ListValue message, length delimited. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.IListValue} message ListValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ListValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ListValue} ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListValue.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ListValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.values && message.values.length)) + message.values = []; + message.values.push($root.google.protobuf.Value.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ListValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ListValue} ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListValue message. + * @function verify + * @memberof google.protobuf.ListValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.values != null && message.hasOwnProperty("values")) { + if (!Array.isArray(message.values)) + return "values: array expected"; + for (var i = 0; i < message.values.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.values[i]); + if (error) + return "values." + error; + } + } + return null; + }; + + /** + * Creates a ListValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ListValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ListValue} ListValue + */ + ListValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ListValue) + return object; + var message = new $root.google.protobuf.ListValue(); + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.protobuf.ListValue.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) { + if (typeof object.values[i] !== "object") + throw TypeError(".google.protobuf.ListValue.values: object expected"); + message.values[i] = $root.google.protobuf.Value.fromObject(object.values[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ListValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.ListValue} message ListValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.values = []; + if (message.values && message.values.length) { + object.values = []; + for (var j = 0; j < message.values.length; ++j) + object.values[j] = $root.google.protobuf.Value.toObject(message.values[j], options); + } + return object; + }; + + /** + * Converts this ListValue to JSON. + * @function toJSON + * @memberof google.protobuf.ListValue + * @instance + * @returns {Object.} JSON object + */ + ListValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListValue + * @function getTypeUrl + * @memberof google.protobuf.ListValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ListValue"; + }; + + return ListValue; + })(); + + return protobuf; + })(); + + google.longrunning = (function() { + + /** + * Namespace longrunning. + * @memberof google + * @namespace + */ + var longrunning = {}; + + longrunning.Operations = (function() { + + /** + * Constructs a new Operations service. + * @memberof google.longrunning + * @classdesc Represents an Operations + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Operations(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Operations.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Operations; + + /** + * Creates new Operations service using the specified rpc implementation. + * @function create + * @memberof google.longrunning.Operations + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Operations} RPC service. Useful where requests and/or responses are streamed. + */ + Operations.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.longrunning.Operations|listOperations}. + * @memberof google.longrunning.Operations + * @typedef ListOperationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.ListOperationsResponse} [response] ListOperationsResponse + */ + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @param {google.longrunning.Operations.ListOperationsCallback} callback Node-style callback called with the error, if any, and ListOperationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.listOperations = function listOperations(request, callback) { + return this.rpcCall(listOperations, $root.google.longrunning.ListOperationsRequest, $root.google.longrunning.ListOperationsResponse, request, callback); + }, "name", { value: "ListOperations" }); + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|getOperation}. + * @memberof google.longrunning.Operations + * @typedef GetOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @param {google.longrunning.Operations.GetOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.getOperation = function getOperation(request, callback) { + return this.rpcCall(getOperation, $root.google.longrunning.GetOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "GetOperation" }); + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. + * @memberof google.longrunning.Operations + * @typedef DeleteOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @param {google.longrunning.Operations.DeleteOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.deleteOperation = function deleteOperation(request, callback) { + return this.rpcCall(deleteOperation, $root.google.longrunning.DeleteOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteOperation" }); + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. + * @memberof google.longrunning.Operations + * @typedef CancelOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @param {google.longrunning.Operations.CancelOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.cancelOperation = function cancelOperation(request, callback) { + return this.rpcCall(cancelOperation, $root.google.longrunning.CancelOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "CancelOperation" }); + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|waitOperation}. + * @memberof google.longrunning.Operations + * @typedef WaitOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @param {google.longrunning.Operations.WaitOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.waitOperation = function waitOperation(request, callback) { + return this.rpcCall(waitOperation, $root.google.longrunning.WaitOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "WaitOperation" }); + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Operations; + })(); + + longrunning.Operation = (function() { + + /** + * Properties of an Operation. + * @memberof google.longrunning + * @interface IOperation + * @property {string|null} [name] Operation name + * @property {google.protobuf.IAny|null} [metadata] Operation metadata + * @property {boolean|null} [done] Operation done + * @property {google.rpc.IStatus|null} [error] Operation error + * @property {google.protobuf.IAny|null} [response] Operation response + */ + + /** + * Constructs a new Operation. + * @memberof google.longrunning + * @classdesc Represents an Operation. + * @implements IOperation + * @constructor + * @param {google.longrunning.IOperation=} [properties] Properties to set + */ + function Operation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Operation name. + * @member {string} name + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.name = ""; + + /** + * Operation metadata. + * @member {google.protobuf.IAny|null|undefined} metadata + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.metadata = null; + + /** + * Operation done. + * @member {boolean} done + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.done = false; + + /** + * Operation error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.error = null; + + /** + * Operation response. + * @member {google.protobuf.IAny|null|undefined} response + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.response = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Operation result. + * @member {"error"|"response"|undefined} result + * @memberof google.longrunning.Operation + * @instance + */ + Object.defineProperty(Operation.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["error", "response"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Operation instance using the specified properties. + * @function create + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation=} [properties] Properties to set + * @returns {google.longrunning.Operation} Operation instance + */ + Operation.create = function create(properties) { + return new Operation(properties); + }; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @function encode + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.protobuf.Any.encode(message.metadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.done != null && Object.hasOwnProperty.call(message, "done")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.done); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.response != null && Object.hasOwnProperty.call(message, "response")) + $root.google.protobuf.Any.encode(message.response, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.Operation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.metadata = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } + case 3: { + message.done = reader.bool(); + break; + } + case 4: { + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 5: { + message.response = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Operation message. + * @function verify + * @memberof google.longrunning.Operation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Operation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.protobuf.Any.verify(message.metadata); + if (error) + return "metadata." + error; + } + if (message.done != null && message.hasOwnProperty("done")) + if (typeof message.done !== "boolean") + return "done: boolean expected"; + if (message.error != null && message.hasOwnProperty("error")) { + properties.result = 1; + { + var error = $root.google.rpc.Status.verify(message.error); + if (error) + return "error." + error; + } + } + if (message.response != null && message.hasOwnProperty("response")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.google.protobuf.Any.verify(message.response); + if (error) + return "response." + error; + } + } + return null; + }; + + /** + * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.Operation + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.Operation} Operation + */ + Operation.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.Operation) + return object; + var message = new $root.google.longrunning.Operation(); + if (object.name != null) + message.name = String(object.name); + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.longrunning.Operation.metadata: object expected"); + message.metadata = $root.google.protobuf.Any.fromObject(object.metadata); + } + if (object.done != null) + message.done = Boolean(object.done); + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.longrunning.Operation.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + if (object.response != null) { + if (typeof object.response !== "object") + throw TypeError(".google.longrunning.Operation.response: object expected"); + message.response = $root.google.protobuf.Any.fromObject(object.response); + } + return message; + }; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.Operation} message Operation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Operation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.metadata = null; + object.done = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.protobuf.Any.toObject(message.metadata, options); + if (message.done != null && message.hasOwnProperty("done")) + object.done = message.done; + if (message.error != null && message.hasOwnProperty("error")) { + object.error = $root.google.rpc.Status.toObject(message.error, options); + if (options.oneofs) + object.result = "error"; + } + if (message.response != null && message.hasOwnProperty("response")) { + object.response = $root.google.protobuf.Any.toObject(message.response, options); + if (options.oneofs) + object.result = "response"; + } + return object; + }; + + /** + * Converts this Operation to JSON. + * @function toJSON + * @memberof google.longrunning.Operation + * @instance + * @returns {Object.} JSON object + */ + Operation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Operation + * @function getTypeUrl + * @memberof google.longrunning.Operation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Operation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.Operation"; + }; + + return Operation; + })(); + + longrunning.GetOperationRequest = (function() { + + /** + * Properties of a GetOperationRequest. + * @memberof google.longrunning + * @interface IGetOperationRequest + * @property {string|null} [name] GetOperationRequest name + */ + + /** + * Constructs a new GetOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a GetOperationRequest. + * @implements IGetOperationRequest + * @constructor + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + */ + function GetOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetOperationRequest name. + * @member {string} name + * @memberof google.longrunning.GetOperationRequest + * @instance + */ + GetOperationRequest.prototype.name = ""; + + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest instance + */ + GetOperationRequest.create = function create(properties) { + return new GetOperationRequest(properties); + }; + + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.GetOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetOperationRequest message. + * @function verify + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + */ + GetOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.GetOperationRequest) + return object; + var message = new $root.google.longrunning.GetOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.GetOperationRequest} message GetOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.GetOperationRequest + * @instance + * @returns {Object.} JSON object + */ + GetOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.GetOperationRequest"; + }; + + return GetOperationRequest; + })(); + + longrunning.ListOperationsRequest = (function() { + + /** + * Properties of a ListOperationsRequest. + * @memberof google.longrunning + * @interface IListOperationsRequest + * @property {string|null} [name] ListOperationsRequest name + * @property {string|null} [filter] ListOperationsRequest filter + * @property {number|null} [pageSize] ListOperationsRequest pageSize + * @property {string|null} [pageToken] ListOperationsRequest pageToken + */ + + /** + * Constructs a new ListOperationsRequest. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsRequest. + * @implements IListOperationsRequest + * @constructor + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + */ + function ListOperationsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOperationsRequest name. + * @member {string} name + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.name = ""; + + /** + * ListOperationsRequest filter. + * @member {string} filter + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.filter = ""; + + /** + * ListOperationsRequest pageSize. + * @member {number} pageSize + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageSize = 0; + + /** + * ListOperationsRequest pageToken. + * @member {string} pageToken + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest instance + */ + ListOperationsRequest.create = function create(properties) { + return new ListOperationsRequest(properties); + }; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); + return writer; + }; + + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 4: { + message.name = reader.string(); + break; + } + case 1: { + message.filter = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOperationsRequest message. + * @function verify + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOperationsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + */ + ListOperationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.ListOperationsRequest) + return object; + var message = new $root.google.longrunning.ListOperationsRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.ListOperationsRequest} message ListOperationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOperationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + object.name = ""; + } + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this ListOperationsRequest to JSON. + * @function toJSON + * @memberof google.longrunning.ListOperationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListOperationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOperationsRequest + * @function getTypeUrl + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOperationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.ListOperationsRequest"; + }; + + return ListOperationsRequest; + })(); + + longrunning.ListOperationsResponse = (function() { + + /** + * Properties of a ListOperationsResponse. + * @memberof google.longrunning + * @interface IListOperationsResponse + * @property {Array.|null} [operations] ListOperationsResponse operations + * @property {string|null} [nextPageToken] ListOperationsResponse nextPageToken + */ + + /** + * Constructs a new ListOperationsResponse. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsResponse. + * @implements IListOperationsResponse + * @constructor + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + */ + function ListOperationsResponse(properties) { + this.operations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOperationsResponse operations. + * @member {Array.} operations + * @memberof google.longrunning.ListOperationsResponse + * @instance + */ + ListOperationsResponse.prototype.operations = $util.emptyArray; + + /** + * ListOperationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.longrunning.ListOperationsResponse + * @instance + */ + ListOperationsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @function create + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse instance + */ + ListOperationsResponse.create = function create(properties) { + return new ListOperationsResponse(properties); + }; + + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @function encode + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.operations != null && message.operations.length) + for (var i = 0; i < message.operations.length; ++i) + $root.google.longrunning.Operation.encode(message.operations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.operations && message.operations.length)) + message.operations = []; + message.operations.push($root.google.longrunning.Operation.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOperationsResponse message. + * @function verify + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOperationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.operations != null && message.hasOwnProperty("operations")) { + if (!Array.isArray(message.operations)) + return "operations: array expected"; + for (var i = 0; i < message.operations.length; ++i) { + var error = $root.google.longrunning.Operation.verify(message.operations[i]); + if (error) + return "operations." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + */ + ListOperationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.ListOperationsResponse) + return object; + var message = new $root.google.longrunning.ListOperationsResponse(); + if (object.operations) { + if (!Array.isArray(object.operations)) + throw TypeError(".google.longrunning.ListOperationsResponse.operations: array expected"); + message.operations = []; + for (var i = 0; i < object.operations.length; ++i) { + if (typeof object.operations[i] !== "object") + throw TypeError(".google.longrunning.ListOperationsResponse.operations: object expected"); + message.operations[i] = $root.google.longrunning.Operation.fromObject(object.operations[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.ListOperationsResponse} message ListOperationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOperationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.operations = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.operations && message.operations.length) { + object.operations = []; + for (var j = 0; j < message.operations.length; ++j) + object.operations[j] = $root.google.longrunning.Operation.toObject(message.operations[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListOperationsResponse to JSON. + * @function toJSON + * @memberof google.longrunning.ListOperationsResponse + * @instance + * @returns {Object.} JSON object + */ + ListOperationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOperationsResponse + * @function getTypeUrl + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOperationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.ListOperationsResponse"; + }; + + return ListOperationsResponse; + })(); + + longrunning.CancelOperationRequest = (function() { + + /** + * Properties of a CancelOperationRequest. + * @memberof google.longrunning + * @interface ICancelOperationRequest + * @property {string|null} [name] CancelOperationRequest name + */ + + /** + * Constructs a new CancelOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a CancelOperationRequest. + * @implements ICancelOperationRequest + * @constructor + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + */ + function CancelOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CancelOperationRequest name. + * @member {string} name + * @memberof google.longrunning.CancelOperationRequest + * @instance + */ + CancelOperationRequest.prototype.name = ""; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest instance + */ + CancelOperationRequest.create = function create(properties) { + return new CancelOperationRequest(properties); + }; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelOperationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.CancelOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CancelOperationRequest message. + * @function verify + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CancelOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + */ + CancelOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.CancelOperationRequest) + return object; + var message = new $root.google.longrunning.CancelOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.CancelOperationRequest} message CancelOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CancelOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this CancelOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.CancelOperationRequest + * @instance + * @returns {Object.} JSON object + */ + CancelOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CancelOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CancelOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.CancelOperationRequest"; + }; + + return CancelOperationRequest; + })(); + + longrunning.DeleteOperationRequest = (function() { + + /** + * Properties of a DeleteOperationRequest. + * @memberof google.longrunning + * @interface IDeleteOperationRequest + * @property {string|null} [name] DeleteOperationRequest name + */ + + /** + * Constructs a new DeleteOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a DeleteOperationRequest. + * @implements IDeleteOperationRequest + * @constructor + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set + */ + function DeleteOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteOperationRequest name. + * @member {string} name + * @memberof google.longrunning.DeleteOperationRequest + * @instance + */ + DeleteOperationRequest.prototype.name = ""; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest instance + */ + DeleteOperationRequest.create = function create(properties) { + return new DeleteOperationRequest(properties); + }; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.DeleteOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteOperationRequest message. + * @function verify + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + */ + DeleteOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.DeleteOperationRequest) + return object; + var message = new $root.google.longrunning.DeleteOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.DeleteOperationRequest} message DeleteOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.DeleteOperationRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.DeleteOperationRequest"; + }; + + return DeleteOperationRequest; + })(); + + longrunning.WaitOperationRequest = (function() { + + /** + * Properties of a WaitOperationRequest. + * @memberof google.longrunning + * @interface IWaitOperationRequest + * @property {string|null} [name] WaitOperationRequest name + * @property {google.protobuf.IDuration|null} [timeout] WaitOperationRequest timeout + */ + + /** + * Constructs a new WaitOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a WaitOperationRequest. + * @implements IWaitOperationRequest + * @constructor + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set + */ + function WaitOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WaitOperationRequest name. + * @member {string} name + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.name = ""; + + /** + * WaitOperationRequest timeout. + * @member {google.protobuf.IDuration|null|undefined} timeout + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.timeout = null; + + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest instance + */ + WaitOperationRequest.create = function create(properties) { + return new WaitOperationRequest(properties); + }; + + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) + $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitOperationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.WaitOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WaitOperationRequest message. + * @function verify + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WaitOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.timeout != null && message.hasOwnProperty("timeout")) { + var error = $root.google.protobuf.Duration.verify(message.timeout); + if (error) + return "timeout." + error; + } + return null; + }; + + /** + * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + */ + WaitOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.WaitOperationRequest) + return object; + var message = new $root.google.longrunning.WaitOperationRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.timeout != null) { + if (typeof object.timeout !== "object") + throw TypeError(".google.longrunning.WaitOperationRequest.timeout: object expected"); + message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); + } + return message; + }; + + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.WaitOperationRequest} message WaitOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WaitOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.timeout = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.timeout != null && message.hasOwnProperty("timeout")) + object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); + return object; + }; + + /** + * Converts this WaitOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.WaitOperationRequest + * @instance + * @returns {Object.} JSON object + */ + WaitOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WaitOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WaitOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.WaitOperationRequest"; + }; + + return WaitOperationRequest; + })(); + + longrunning.OperationInfo = (function() { + + /** + * Properties of an OperationInfo. + * @memberof google.longrunning + * @interface IOperationInfo + * @property {string|null} [responseType] OperationInfo responseType + * @property {string|null} [metadataType] OperationInfo metadataType + */ + + /** + * Constructs a new OperationInfo. + * @memberof google.longrunning + * @classdesc Represents an OperationInfo. + * @implements IOperationInfo + * @constructor + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + */ + function OperationInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OperationInfo responseType. + * @member {string} responseType + * @memberof google.longrunning.OperationInfo + * @instance + */ + OperationInfo.prototype.responseType = ""; + + /** + * OperationInfo metadataType. + * @member {string} metadataType + * @memberof google.longrunning.OperationInfo + * @instance + */ + OperationInfo.prototype.metadataType = ""; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @function create + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + * @returns {google.longrunning.OperationInfo} OperationInfo instance + */ + OperationInfo.create = function create(properties) { + return new OperationInfo(properties); + }; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @function encode + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.responseType != null && Object.hasOwnProperty.call(message, "responseType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseType); + if (message.metadataType != null && Object.hasOwnProperty.call(message, "metadataType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.metadataType); + return writer; + }; + + /** + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.OperationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.OperationInfo} OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.OperationInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.responseType = reader.string(); + break; + } + case 2: { + message.metadataType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.OperationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.OperationInfo} OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationInfo message. + * @function verify + * @memberof google.longrunning.OperationInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.responseType != null && message.hasOwnProperty("responseType")) + if (!$util.isString(message.responseType)) + return "responseType: string expected"; + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + if (!$util.isString(message.metadataType)) + return "metadataType: string expected"; + return null; + }; + + /** + * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.OperationInfo + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.OperationInfo} OperationInfo + */ + OperationInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.OperationInfo) + return object; + var message = new $root.google.longrunning.OperationInfo(); + if (object.responseType != null) + message.responseType = String(object.responseType); + if (object.metadataType != null) + message.metadataType = String(object.metadataType); + return message; + }; + + /** + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.OperationInfo} message OperationInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.responseType = ""; + object.metadataType = ""; + } + if (message.responseType != null && message.hasOwnProperty("responseType")) + object.responseType = message.responseType; + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + object.metadataType = message.metadataType; + return object; + }; + + /** + * Converts this OperationInfo to JSON. + * @function toJSON + * @memberof google.longrunning.OperationInfo + * @instance + * @returns {Object.} JSON object + */ + OperationInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OperationInfo + * @function getTypeUrl + * @memberof google.longrunning.OperationInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OperationInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.OperationInfo"; + }; + + return OperationInfo; + })(); + + return longrunning; + })(); + + google.rpc = (function() { + + /** + * Namespace rpc. + * @memberof google + * @namespace + */ + var rpc = {}; + + rpc.Status = (function() { + + /** + * Properties of a Status. + * @memberof google.rpc + * @interface IStatus + * @property {number|null} [code] Status code + * @property {string|null} [message] Status message + * @property {Array.|null} [details] Status details + */ + + /** + * Constructs a new Status. + * @memberof google.rpc + * @classdesc Represents a Status. + * @implements IStatus + * @constructor + * @param {google.rpc.IStatus=} [properties] Properties to set + */ + function Status(properties) { + this.details = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Status code. + * @member {number} code + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.code = 0; + + /** + * Status message. + * @member {string} message + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.message = ""; + + /** + * Status details. + * @member {Array.} details + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.details = $util.emptyArray; + + /** + * Creates a new Status instance using the specified properties. + * @function create + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus=} [properties] Properties to set + * @returns {google.rpc.Status} Status instance + */ + Status.create = function create(properties) { + return new Status(properties); + }; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encode + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); + if (message.details != null && message.details.length) + for (var i = 0; i < message.details.length; ++i) + $root.google.protobuf.Any.encode(message.details[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encodeDelimited + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Status message from the specified reader or buffer. + * @function decode + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.rpc.Status(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.code = reader.int32(); + break; + } + case 2: { + message.message = reader.string(); + break; + } + case 3: { + if (!(message.details && message.details.length)) + message.details = []; + message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Status message. + * @function verify + * @memberof google.rpc.Status + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Status.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + if (!$util.isInteger(message.code)) + return "code: integer expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.details != null && message.hasOwnProperty("details")) { + if (!Array.isArray(message.details)) + return "details: array expected"; + for (var i = 0; i < message.details.length; ++i) { + var error = $root.google.protobuf.Any.verify(message.details[i]); + if (error) + return "details." + error; + } + } + return null; + }; + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.rpc.Status + * @static + * @param {Object.} object Plain object + * @returns {google.rpc.Status} Status + */ + Status.fromObject = function fromObject(object) { + if (object instanceof $root.google.rpc.Status) + return object; + var message = new $root.google.rpc.Status(); + if (object.code != null) + message.code = object.code | 0; + if (object.message != null) + message.message = String(object.message); + if (object.details) { + if (!Array.isArray(object.details)) + throw TypeError(".google.rpc.Status.details: array expected"); + message.details = []; + for (var i = 0; i < object.details.length; ++i) { + if (typeof object.details[i] !== "object") + throw TypeError(".google.rpc.Status.details: object expected"); + message.details[i] = $root.google.protobuf.Any.fromObject(object.details[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @function toObject + * @memberof google.rpc.Status + * @static + * @param {google.rpc.Status} message Status + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Status.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.details = []; + if (options.defaults) { + object.code = 0; + object.message = ""; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = message.code; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.details && message.details.length) { + object.details = []; + for (var j = 0; j < message.details.length; ++j) + object.details[j] = $root.google.protobuf.Any.toObject(message.details[j], options); + } + return object; + }; + + /** + * Converts this Status to JSON. + * @function toJSON + * @memberof google.rpc.Status + * @instance + * @returns {Object.} JSON object + */ + Status.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Status + * @function getTypeUrl + * @memberof google.rpc.Status + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Status.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.rpc.Status"; + }; + + return Status; + })(); + + return rpc; + })(); + + google.iam = (function() { + + /** + * Namespace iam. + * @memberof google + * @namespace + */ + var iam = {}; + + iam.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.iam + * @namespace + */ + var v1 = {}; + + v1.IAMPolicy = (function() { + + /** + * Constructs a new IAMPolicy service. + * @memberof google.iam.v1 + * @classdesc Represents a IAMPolicy + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function IAMPolicy(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (IAMPolicy.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = IAMPolicy; + + /** + * Creates new IAMPolicy service using the specified rpc implementation. + * @function create + * @memberof google.iam.v1.IAMPolicy + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {IAMPolicy} RPC service. Useful where requests and/or responses are streamed. + */ + IAMPolicy.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.iam.v1.IAMPolicy|setIamPolicy}. + * @memberof google.iam.v1.IAMPolicy + * @typedef SetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.iam.v1.IAMPolicy + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @param {google.iam.v1.IAMPolicy.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(IAMPolicy.prototype.setIamPolicy = function setIamPolicy(request, callback) { + return this.rpcCall(setIamPolicy, $root.google.iam.v1.SetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "SetIamPolicy" }); + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.iam.v1.IAMPolicy + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.iam.v1.IAMPolicy|getIamPolicy}. + * @memberof google.iam.v1.IAMPolicy + * @typedef GetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.iam.v1.IAMPolicy + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @param {google.iam.v1.IAMPolicy.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(IAMPolicy.prototype.getIamPolicy = function getIamPolicy(request, callback) { + return this.rpcCall(getIamPolicy, $root.google.iam.v1.GetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "GetIamPolicy" }); + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.iam.v1.IAMPolicy + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.iam.v1.IAMPolicy|testIamPermissions}. + * @memberof google.iam.v1.IAMPolicy + * @typedef TestIamPermissionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.TestIamPermissionsResponse} [response] TestIamPermissionsResponse + */ + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.iam.v1.IAMPolicy + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @param {google.iam.v1.IAMPolicy.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(IAMPolicy.prototype.testIamPermissions = function testIamPermissions(request, callback) { + return this.rpcCall(testIamPermissions, $root.google.iam.v1.TestIamPermissionsRequest, $root.google.iam.v1.TestIamPermissionsResponse, request, callback); + }, "name", { value: "TestIamPermissions" }); + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.iam.v1.IAMPolicy + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return IAMPolicy; + })(); + + v1.SetIamPolicyRequest = (function() { + + /** + * Properties of a SetIamPolicyRequest. + * @memberof google.iam.v1 + * @interface ISetIamPolicyRequest + * @property {string|null} [resource] SetIamPolicyRequest resource + * @property {google.iam.v1.IPolicy|null} [policy] SetIamPolicyRequest policy + * @property {google.protobuf.IFieldMask|null} [updateMask] SetIamPolicyRequest updateMask + */ + + /** + * Constructs a new SetIamPolicyRequest. + * @memberof google.iam.v1 + * @classdesc Represents a SetIamPolicyRequest. + * @implements ISetIamPolicyRequest + * @constructor + * @param {google.iam.v1.ISetIamPolicyRequest=} [properties] Properties to set + */ + function SetIamPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SetIamPolicyRequest resource. + * @member {string} resource + * @memberof google.iam.v1.SetIamPolicyRequest + * @instance + */ + SetIamPolicyRequest.prototype.resource = ""; + + /** + * SetIamPolicyRequest policy. + * @member {google.iam.v1.IPolicy|null|undefined} policy + * @memberof google.iam.v1.SetIamPolicyRequest + * @instance + */ + SetIamPolicyRequest.prototype.policy = null; + + /** + * SetIamPolicyRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.iam.v1.SetIamPolicyRequest + * @instance + */ + SetIamPolicyRequest.prototype.updateMask = null; + + /** + * Creates a new SetIamPolicyRequest instance using the specified properties. + * @function create + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {google.iam.v1.ISetIamPolicyRequest=} [properties] Properties to set + * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest instance + */ + SetIamPolicyRequest.create = function create(properties) { + return new SetIamPolicyRequest(properties); + }; + + /** + * Encodes the specified SetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {google.iam.v1.ISetIamPolicyRequest} message SetIamPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetIamPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); + if (message.policy != null && Object.hasOwnProperty.call(message, "policy")) + $root.google.iam.v1.Policy.encode(message.policy, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {google.iam.v1.ISetIamPolicyRequest} message SetIamPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetIamPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetIamPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetIamPolicyRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.SetIamPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.resource = reader.string(); + break; + } + case 2: { + message.policy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetIamPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetIamPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetIamPolicyRequest message. + * @function verify + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetIamPolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.policy != null && message.hasOwnProperty("policy")) { + var error = $root.google.iam.v1.Policy.verify(message.policy); + if (error) + return "policy." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates a SetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest + */ + SetIamPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.SetIamPolicyRequest) + return object; + var message = new $root.google.iam.v1.SetIamPolicyRequest(); + if (object.resource != null) + message.resource = String(object.resource); + if (object.policy != null) { + if (typeof object.policy !== "object") + throw TypeError(".google.iam.v1.SetIamPolicyRequest.policy: object expected"); + message.policy = $root.google.iam.v1.Policy.fromObject(object.policy); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.iam.v1.SetIamPolicyRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from a SetIamPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {google.iam.v1.SetIamPolicyRequest} message SetIamPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetIamPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.resource = ""; + object.policy = null; + object.updateMask = null; + } + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.policy != null && message.hasOwnProperty("policy")) + object.policy = $root.google.iam.v1.Policy.toObject(message.policy, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this SetIamPolicyRequest to JSON. + * @function toJSON + * @memberof google.iam.v1.SetIamPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + SetIamPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SetIamPolicyRequest + * @function getTypeUrl + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SetIamPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.SetIamPolicyRequest"; + }; + + return SetIamPolicyRequest; + })(); + + v1.GetIamPolicyRequest = (function() { + + /** + * Properties of a GetIamPolicyRequest. + * @memberof google.iam.v1 + * @interface IGetIamPolicyRequest + * @property {string|null} [resource] GetIamPolicyRequest resource + * @property {google.iam.v1.IGetPolicyOptions|null} [options] GetIamPolicyRequest options + */ + + /** + * Constructs a new GetIamPolicyRequest. + * @memberof google.iam.v1 + * @classdesc Represents a GetIamPolicyRequest. + * @implements IGetIamPolicyRequest + * @constructor + * @param {google.iam.v1.IGetIamPolicyRequest=} [properties] Properties to set + */ + function GetIamPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIamPolicyRequest resource. + * @member {string} resource + * @memberof google.iam.v1.GetIamPolicyRequest + * @instance + */ + GetIamPolicyRequest.prototype.resource = ""; + + /** + * GetIamPolicyRequest options. + * @member {google.iam.v1.IGetPolicyOptions|null|undefined} options + * @memberof google.iam.v1.GetIamPolicyRequest + * @instance + */ + GetIamPolicyRequest.prototype.options = null; + + /** + * Creates a new GetIamPolicyRequest instance using the specified properties. + * @function create + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {google.iam.v1.IGetIamPolicyRequest=} [properties] Properties to set + * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest instance + */ + GetIamPolicyRequest.create = function create(properties) { + return new GetIamPolicyRequest(properties); + }; + + /** + * Encodes the specified GetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {google.iam.v1.IGetIamPolicyRequest} message GetIamPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIamPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.iam.v1.GetPolicyOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {google.iam.v1.IGetIamPolicyRequest} message GetIamPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIamPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIamPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIamPolicyRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.GetIamPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.resource = reader.string(); + break; + } + case 2: { + message.options = $root.google.iam.v1.GetPolicyOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIamPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIamPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIamPolicyRequest message. + * @function verify + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIamPolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.iam.v1.GetPolicyOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates a GetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest + */ + GetIamPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.GetIamPolicyRequest) + return object; + var message = new $root.google.iam.v1.GetIamPolicyRequest(); + if (object.resource != null) + message.resource = String(object.resource); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.iam.v1.GetIamPolicyRequest.options: object expected"); + message.options = $root.google.iam.v1.GetPolicyOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from a GetIamPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {google.iam.v1.GetIamPolicyRequest} message GetIamPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIamPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.resource = ""; + object.options = null; + } + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.iam.v1.GetPolicyOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this GetIamPolicyRequest to JSON. + * @function toJSON + * @memberof google.iam.v1.GetIamPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + GetIamPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetIamPolicyRequest + * @function getTypeUrl + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetIamPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.GetIamPolicyRequest"; + }; + + return GetIamPolicyRequest; + })(); + + v1.TestIamPermissionsRequest = (function() { + + /** + * Properties of a TestIamPermissionsRequest. + * @memberof google.iam.v1 + * @interface ITestIamPermissionsRequest + * @property {string|null} [resource] TestIamPermissionsRequest resource + * @property {Array.|null} [permissions] TestIamPermissionsRequest permissions + */ + + /** + * Constructs a new TestIamPermissionsRequest. + * @memberof google.iam.v1 + * @classdesc Represents a TestIamPermissionsRequest. + * @implements ITestIamPermissionsRequest + * @constructor + * @param {google.iam.v1.ITestIamPermissionsRequest=} [properties] Properties to set + */ + function TestIamPermissionsRequest(properties) { + this.permissions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TestIamPermissionsRequest resource. + * @member {string} resource + * @memberof google.iam.v1.TestIamPermissionsRequest + * @instance + */ + TestIamPermissionsRequest.prototype.resource = ""; + + /** + * TestIamPermissionsRequest permissions. + * @member {Array.} permissions + * @memberof google.iam.v1.TestIamPermissionsRequest + * @instance + */ + TestIamPermissionsRequest.prototype.permissions = $util.emptyArray; + + /** + * Creates a new TestIamPermissionsRequest instance using the specified properties. + * @function create + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {google.iam.v1.ITestIamPermissionsRequest=} [properties] Properties to set + * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest instance + */ + TestIamPermissionsRequest.create = function create(properties) { + return new TestIamPermissionsRequest(properties); + }; + + /** + * Encodes the specified TestIamPermissionsRequest message. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {google.iam.v1.ITestIamPermissionsRequest} message TestIamPermissionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestIamPermissionsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); + if (message.permissions != null && message.permissions.length) + for (var i = 0; i < message.permissions.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.permissions[i]); + return writer; + }; + + /** + * Encodes the specified TestIamPermissionsRequest message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {google.iam.v1.ITestIamPermissionsRequest} message TestIamPermissionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestIamPermissionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TestIamPermissionsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestIamPermissionsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.TestIamPermissionsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.resource = reader.string(); + break; + } + case 2: { + if (!(message.permissions && message.permissions.length)) + message.permissions = []; + message.permissions.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TestIamPermissionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestIamPermissionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TestIamPermissionsRequest message. + * @function verify + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TestIamPermissionsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.permissions != null && message.hasOwnProperty("permissions")) { + if (!Array.isArray(message.permissions)) + return "permissions: array expected"; + for (var i = 0; i < message.permissions.length; ++i) + if (!$util.isString(message.permissions[i])) + return "permissions: string[] expected"; + } + return null; + }; + + /** + * Creates a TestIamPermissionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest + */ + TestIamPermissionsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.TestIamPermissionsRequest) + return object; + var message = new $root.google.iam.v1.TestIamPermissionsRequest(); + if (object.resource != null) + message.resource = String(object.resource); + if (object.permissions) { + if (!Array.isArray(object.permissions)) + throw TypeError(".google.iam.v1.TestIamPermissionsRequest.permissions: array expected"); + message.permissions = []; + for (var i = 0; i < object.permissions.length; ++i) + message.permissions[i] = String(object.permissions[i]); + } + return message; + }; + + /** + * Creates a plain object from a TestIamPermissionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {google.iam.v1.TestIamPermissionsRequest} message TestIamPermissionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TestIamPermissionsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.permissions = []; + if (options.defaults) + object.resource = ""; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.permissions && message.permissions.length) { + object.permissions = []; + for (var j = 0; j < message.permissions.length; ++j) + object.permissions[j] = message.permissions[j]; + } + return object; + }; + + /** + * Converts this TestIamPermissionsRequest to JSON. + * @function toJSON + * @memberof google.iam.v1.TestIamPermissionsRequest + * @instance + * @returns {Object.} JSON object + */ + TestIamPermissionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TestIamPermissionsRequest + * @function getTypeUrl + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TestIamPermissionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.TestIamPermissionsRequest"; + }; + + return TestIamPermissionsRequest; + })(); + + v1.TestIamPermissionsResponse = (function() { + + /** + * Properties of a TestIamPermissionsResponse. + * @memberof google.iam.v1 + * @interface ITestIamPermissionsResponse + * @property {Array.|null} [permissions] TestIamPermissionsResponse permissions + */ + + /** + * Constructs a new TestIamPermissionsResponse. + * @memberof google.iam.v1 + * @classdesc Represents a TestIamPermissionsResponse. + * @implements ITestIamPermissionsResponse + * @constructor + * @param {google.iam.v1.ITestIamPermissionsResponse=} [properties] Properties to set + */ + function TestIamPermissionsResponse(properties) { + this.permissions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TestIamPermissionsResponse permissions. + * @member {Array.} permissions + * @memberof google.iam.v1.TestIamPermissionsResponse + * @instance + */ + TestIamPermissionsResponse.prototype.permissions = $util.emptyArray; + + /** + * Creates a new TestIamPermissionsResponse instance using the specified properties. + * @function create + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {google.iam.v1.ITestIamPermissionsResponse=} [properties] Properties to set + * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse instance + */ + TestIamPermissionsResponse.create = function create(properties) { + return new TestIamPermissionsResponse(properties); + }; + + /** + * Encodes the specified TestIamPermissionsResponse message. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {google.iam.v1.ITestIamPermissionsResponse} message TestIamPermissionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestIamPermissionsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.permissions != null && message.permissions.length) + for (var i = 0; i < message.permissions.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.permissions[i]); + return writer; + }; + + /** + * Encodes the specified TestIamPermissionsResponse message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {google.iam.v1.ITestIamPermissionsResponse} message TestIamPermissionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestIamPermissionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TestIamPermissionsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestIamPermissionsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.TestIamPermissionsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.permissions && message.permissions.length)) + message.permissions = []; + message.permissions.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TestIamPermissionsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestIamPermissionsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TestIamPermissionsResponse message. + * @function verify + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TestIamPermissionsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.permissions != null && message.hasOwnProperty("permissions")) { + if (!Array.isArray(message.permissions)) + return "permissions: array expected"; + for (var i = 0; i < message.permissions.length; ++i) + if (!$util.isString(message.permissions[i])) + return "permissions: string[] expected"; + } + return null; + }; + + /** + * Creates a TestIamPermissionsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse + */ + TestIamPermissionsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.TestIamPermissionsResponse) + return object; + var message = new $root.google.iam.v1.TestIamPermissionsResponse(); + if (object.permissions) { + if (!Array.isArray(object.permissions)) + throw TypeError(".google.iam.v1.TestIamPermissionsResponse.permissions: array expected"); + message.permissions = []; + for (var i = 0; i < object.permissions.length; ++i) + message.permissions[i] = String(object.permissions[i]); + } + return message; + }; + + /** + * Creates a plain object from a TestIamPermissionsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {google.iam.v1.TestIamPermissionsResponse} message TestIamPermissionsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TestIamPermissionsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.permissions = []; + if (message.permissions && message.permissions.length) { + object.permissions = []; + for (var j = 0; j < message.permissions.length; ++j) + object.permissions[j] = message.permissions[j]; + } + return object; + }; + + /** + * Converts this TestIamPermissionsResponse to JSON. + * @function toJSON + * @memberof google.iam.v1.TestIamPermissionsResponse + * @instance + * @returns {Object.} JSON object + */ + TestIamPermissionsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TestIamPermissionsResponse + * @function getTypeUrl + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TestIamPermissionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.TestIamPermissionsResponse"; + }; + + return TestIamPermissionsResponse; + })(); + + v1.GetPolicyOptions = (function() { + + /** + * Properties of a GetPolicyOptions. + * @memberof google.iam.v1 + * @interface IGetPolicyOptions + * @property {number|null} [requestedPolicyVersion] GetPolicyOptions requestedPolicyVersion + */ + + /** + * Constructs a new GetPolicyOptions. + * @memberof google.iam.v1 + * @classdesc Represents a GetPolicyOptions. + * @implements IGetPolicyOptions + * @constructor + * @param {google.iam.v1.IGetPolicyOptions=} [properties] Properties to set + */ + function GetPolicyOptions(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetPolicyOptions requestedPolicyVersion. + * @member {number} requestedPolicyVersion + * @memberof google.iam.v1.GetPolicyOptions + * @instance + */ + GetPolicyOptions.prototype.requestedPolicyVersion = 0; + + /** + * Creates a new GetPolicyOptions instance using the specified properties. + * @function create + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {google.iam.v1.IGetPolicyOptions=} [properties] Properties to set + * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions instance + */ + GetPolicyOptions.create = function create(properties) { + return new GetPolicyOptions(properties); + }; + + /** + * Encodes the specified GetPolicyOptions message. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {google.iam.v1.IGetPolicyOptions} message GetPolicyOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPolicyOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestedPolicyVersion != null && Object.hasOwnProperty.call(message, "requestedPolicyVersion")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.requestedPolicyVersion); + return writer; + }; + + /** + * Encodes the specified GetPolicyOptions message, length delimited. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {google.iam.v1.IGetPolicyOptions} message GetPolicyOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPolicyOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetPolicyOptions message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPolicyOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.GetPolicyOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.requestedPolicyVersion = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetPolicyOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPolicyOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetPolicyOptions message. + * @function verify + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetPolicyOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.requestedPolicyVersion != null && message.hasOwnProperty("requestedPolicyVersion")) + if (!$util.isInteger(message.requestedPolicyVersion)) + return "requestedPolicyVersion: integer expected"; + return null; + }; + + /** + * Creates a GetPolicyOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions + */ + GetPolicyOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.GetPolicyOptions) + return object; + var message = new $root.google.iam.v1.GetPolicyOptions(); + if (object.requestedPolicyVersion != null) + message.requestedPolicyVersion = object.requestedPolicyVersion | 0; + return message; + }; + + /** + * Creates a plain object from a GetPolicyOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {google.iam.v1.GetPolicyOptions} message GetPolicyOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetPolicyOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.requestedPolicyVersion = 0; + if (message.requestedPolicyVersion != null && message.hasOwnProperty("requestedPolicyVersion")) + object.requestedPolicyVersion = message.requestedPolicyVersion; + return object; + }; + + /** + * Converts this GetPolicyOptions to JSON. + * @function toJSON + * @memberof google.iam.v1.GetPolicyOptions + * @instance + * @returns {Object.} JSON object + */ + GetPolicyOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetPolicyOptions + * @function getTypeUrl + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetPolicyOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.GetPolicyOptions"; + }; + + return GetPolicyOptions; + })(); + + v1.Policy = (function() { + + /** + * Properties of a Policy. + * @memberof google.iam.v1 + * @interface IPolicy + * @property {number|null} [version] Policy version + * @property {Array.|null} [bindings] Policy bindings + * @property {Array.|null} [auditConfigs] Policy auditConfigs + * @property {Uint8Array|null} [etag] Policy etag + */ + + /** + * Constructs a new Policy. + * @memberof google.iam.v1 + * @classdesc Represents a Policy. + * @implements IPolicy + * @constructor + * @param {google.iam.v1.IPolicy=} [properties] Properties to set + */ + function Policy(properties) { + this.bindings = []; + this.auditConfigs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Policy version. + * @member {number} version + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.version = 0; + + /** + * Policy bindings. + * @member {Array.} bindings + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.bindings = $util.emptyArray; + + /** + * Policy auditConfigs. + * @member {Array.} auditConfigs + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.auditConfigs = $util.emptyArray; + + /** + * Policy etag. + * @member {Uint8Array} etag + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.etag = $util.newBuffer([]); + + /** + * Creates a new Policy instance using the specified properties. + * @function create + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.IPolicy=} [properties] Properties to set + * @returns {google.iam.v1.Policy} Policy instance + */ + Policy.create = function create(properties) { + return new Policy(properties); + }; + + /** + * Encodes the specified Policy message. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.IPolicy} message Policy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Policy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.version); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.etag); + if (message.bindings != null && message.bindings.length) + for (var i = 0; i < message.bindings.length; ++i) + $root.google.iam.v1.Binding.encode(message.bindings[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.auditConfigs != null && message.auditConfigs.length) + for (var i = 0; i < message.auditConfigs.length; ++i) + $root.google.iam.v1.AuditConfig.encode(message.auditConfigs[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Policy message, length delimited. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.IPolicy} message Policy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Policy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Policy message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.Policy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.Policy} Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Policy.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.Policy(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.version = reader.int32(); + break; + } + case 4: { + if (!(message.bindings && message.bindings.length)) + message.bindings = []; + message.bindings.push($root.google.iam.v1.Binding.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.auditConfigs && message.auditConfigs.length)) + message.auditConfigs = []; + message.auditConfigs.push($root.google.iam.v1.AuditConfig.decode(reader, reader.uint32())); + break; + } + case 3: { + message.etag = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Policy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.Policy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.Policy} Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Policy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Policy message. + * @function verify + * @memberof google.iam.v1.Policy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Policy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isInteger(message.version)) + return "version: integer expected"; + if (message.bindings != null && message.hasOwnProperty("bindings")) { + if (!Array.isArray(message.bindings)) + return "bindings: array expected"; + for (var i = 0; i < message.bindings.length; ++i) { + var error = $root.google.iam.v1.Binding.verify(message.bindings[i]); + if (error) + return "bindings." + error; + } + } + if (message.auditConfigs != null && message.hasOwnProperty("auditConfigs")) { + if (!Array.isArray(message.auditConfigs)) + return "auditConfigs: array expected"; + for (var i = 0; i < message.auditConfigs.length; ++i) { + var error = $root.google.iam.v1.AuditConfig.verify(message.auditConfigs[i]); + if (error) + return "auditConfigs." + error; + } + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!(message.etag && typeof message.etag.length === "number" || $util.isString(message.etag))) + return "etag: buffer expected"; + return null; + }; + + /** + * Creates a Policy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.Policy + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.Policy} Policy + */ + Policy.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.Policy) + return object; + var message = new $root.google.iam.v1.Policy(); + if (object.version != null) + message.version = object.version | 0; + if (object.bindings) { + if (!Array.isArray(object.bindings)) + throw TypeError(".google.iam.v1.Policy.bindings: array expected"); + message.bindings = []; + for (var i = 0; i < object.bindings.length; ++i) { + if (typeof object.bindings[i] !== "object") + throw TypeError(".google.iam.v1.Policy.bindings: object expected"); + message.bindings[i] = $root.google.iam.v1.Binding.fromObject(object.bindings[i]); + } + } + if (object.auditConfigs) { + if (!Array.isArray(object.auditConfigs)) + throw TypeError(".google.iam.v1.Policy.auditConfigs: array expected"); + message.auditConfigs = []; + for (var i = 0; i < object.auditConfigs.length; ++i) { + if (typeof object.auditConfigs[i] !== "object") + throw TypeError(".google.iam.v1.Policy.auditConfigs: object expected"); + message.auditConfigs[i] = $root.google.iam.v1.AuditConfig.fromObject(object.auditConfigs[i]); + } + } + if (object.etag != null) + if (typeof object.etag === "string") + $util.base64.decode(object.etag, message.etag = $util.newBuffer($util.base64.length(object.etag)), 0); + else if (object.etag.length >= 0) + message.etag = object.etag; + return message; + }; + + /** + * Creates a plain object from a Policy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.Policy} message Policy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Policy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.bindings = []; + object.auditConfigs = []; + } + if (options.defaults) { + object.version = 0; + if (options.bytes === String) + object.etag = ""; + else { + object.etag = []; + if (options.bytes !== Array) + object.etag = $util.newBuffer(object.etag); + } + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = options.bytes === String ? $util.base64.encode(message.etag, 0, message.etag.length) : options.bytes === Array ? Array.prototype.slice.call(message.etag) : message.etag; + if (message.bindings && message.bindings.length) { + object.bindings = []; + for (var j = 0; j < message.bindings.length; ++j) + object.bindings[j] = $root.google.iam.v1.Binding.toObject(message.bindings[j], options); + } + if (message.auditConfigs && message.auditConfigs.length) { + object.auditConfigs = []; + for (var j = 0; j < message.auditConfigs.length; ++j) + object.auditConfigs[j] = $root.google.iam.v1.AuditConfig.toObject(message.auditConfigs[j], options); + } + return object; + }; + + /** + * Converts this Policy to JSON. + * @function toJSON + * @memberof google.iam.v1.Policy + * @instance + * @returns {Object.} JSON object + */ + Policy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Policy + * @function getTypeUrl + * @memberof google.iam.v1.Policy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Policy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.Policy"; + }; + + return Policy; + })(); + + v1.Binding = (function() { + + /** + * Properties of a Binding. + * @memberof google.iam.v1 + * @interface IBinding + * @property {string|null} [role] Binding role + * @property {Array.|null} [members] Binding members + * @property {google.type.IExpr|null} [condition] Binding condition + */ + + /** + * Constructs a new Binding. + * @memberof google.iam.v1 + * @classdesc Represents a Binding. + * @implements IBinding + * @constructor + * @param {google.iam.v1.IBinding=} [properties] Properties to set + */ + function Binding(properties) { + this.members = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Binding role. + * @member {string} role + * @memberof google.iam.v1.Binding + * @instance + */ + Binding.prototype.role = ""; + + /** + * Binding members. + * @member {Array.} members + * @memberof google.iam.v1.Binding + * @instance + */ + Binding.prototype.members = $util.emptyArray; + + /** + * Binding condition. + * @member {google.type.IExpr|null|undefined} condition + * @memberof google.iam.v1.Binding + * @instance + */ + Binding.prototype.condition = null; + + /** + * Creates a new Binding instance using the specified properties. + * @function create + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.IBinding=} [properties] Properties to set + * @returns {google.iam.v1.Binding} Binding instance + */ + Binding.create = function create(properties) { + return new Binding(properties); + }; + + /** + * Encodes the specified Binding message. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.IBinding} message Binding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Binding.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.role != null && Object.hasOwnProperty.call(message, "role")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.role); + if (message.members != null && message.members.length) + for (var i = 0; i < message.members.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.members[i]); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + $root.google.type.Expr.encode(message.condition, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Binding message, length delimited. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.IBinding} message Binding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Binding.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Binding message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.Binding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.Binding} Binding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Binding.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.Binding(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.role = reader.string(); + break; + } + case 2: { + if (!(message.members && message.members.length)) + message.members = []; + message.members.push(reader.string()); + break; + } + case 3: { + message.condition = $root.google.type.Expr.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Binding message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.Binding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.Binding} Binding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Binding.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Binding message. + * @function verify + * @memberof google.iam.v1.Binding + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Binding.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.role != null && message.hasOwnProperty("role")) + if (!$util.isString(message.role)) + return "role: string expected"; + if (message.members != null && message.hasOwnProperty("members")) { + if (!Array.isArray(message.members)) + return "members: array expected"; + for (var i = 0; i < message.members.length; ++i) + if (!$util.isString(message.members[i])) + return "members: string[] expected"; + } + if (message.condition != null && message.hasOwnProperty("condition")) { + var error = $root.google.type.Expr.verify(message.condition); + if (error) + return "condition." + error; + } + return null; + }; + + /** + * Creates a Binding message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.Binding + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.Binding} Binding + */ + Binding.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.Binding) + return object; + var message = new $root.google.iam.v1.Binding(); + if (object.role != null) + message.role = String(object.role); + if (object.members) { + if (!Array.isArray(object.members)) + throw TypeError(".google.iam.v1.Binding.members: array expected"); + message.members = []; + for (var i = 0; i < object.members.length; ++i) + message.members[i] = String(object.members[i]); + } + if (object.condition != null) { + if (typeof object.condition !== "object") + throw TypeError(".google.iam.v1.Binding.condition: object expected"); + message.condition = $root.google.type.Expr.fromObject(object.condition); + } + return message; + }; + + /** + * Creates a plain object from a Binding message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.Binding} message Binding + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Binding.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.members = []; + if (options.defaults) { + object.role = ""; + object.condition = null; + } + if (message.role != null && message.hasOwnProperty("role")) + object.role = message.role; + if (message.members && message.members.length) { + object.members = []; + for (var j = 0; j < message.members.length; ++j) + object.members[j] = message.members[j]; + } + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = $root.google.type.Expr.toObject(message.condition, options); + return object; + }; + + /** + * Converts this Binding to JSON. + * @function toJSON + * @memberof google.iam.v1.Binding + * @instance + * @returns {Object.} JSON object + */ + Binding.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Binding + * @function getTypeUrl + * @memberof google.iam.v1.Binding + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Binding.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.Binding"; + }; + + return Binding; + })(); + + v1.AuditConfig = (function() { + + /** + * Properties of an AuditConfig. + * @memberof google.iam.v1 + * @interface IAuditConfig + * @property {string|null} [service] AuditConfig service + * @property {Array.|null} [auditLogConfigs] AuditConfig auditLogConfigs + */ + + /** + * Constructs a new AuditConfig. + * @memberof google.iam.v1 + * @classdesc Represents an AuditConfig. + * @implements IAuditConfig + * @constructor + * @param {google.iam.v1.IAuditConfig=} [properties] Properties to set + */ + function AuditConfig(properties) { + this.auditLogConfigs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AuditConfig service. + * @member {string} service + * @memberof google.iam.v1.AuditConfig + * @instance + */ + AuditConfig.prototype.service = ""; + + /** + * AuditConfig auditLogConfigs. + * @member {Array.} auditLogConfigs + * @memberof google.iam.v1.AuditConfig + * @instance + */ + AuditConfig.prototype.auditLogConfigs = $util.emptyArray; + + /** + * Creates a new AuditConfig instance using the specified properties. + * @function create + * @memberof google.iam.v1.AuditConfig + * @static + * @param {google.iam.v1.IAuditConfig=} [properties] Properties to set + * @returns {google.iam.v1.AuditConfig} AuditConfig instance + */ + AuditConfig.create = function create(properties) { + return new AuditConfig(properties); + }; + + /** + * Encodes the specified AuditConfig message. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.AuditConfig + * @static + * @param {google.iam.v1.IAuditConfig} message AuditConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.service != null && Object.hasOwnProperty.call(message, "service")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.service); + if (message.auditLogConfigs != null && message.auditLogConfigs.length) + for (var i = 0; i < message.auditLogConfigs.length; ++i) + $root.google.iam.v1.AuditLogConfig.encode(message.auditLogConfigs[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AuditConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.AuditConfig + * @static + * @param {google.iam.v1.IAuditConfig} message AuditConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuditConfig message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.AuditConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.AuditConfig} AuditConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.AuditConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.service = reader.string(); + break; + } + case 3: { + if (!(message.auditLogConfigs && message.auditLogConfigs.length)) + message.auditLogConfigs = []; + message.auditLogConfigs.push($root.google.iam.v1.AuditLogConfig.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuditConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.AuditConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.AuditConfig} AuditConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuditConfig message. + * @function verify + * @memberof google.iam.v1.AuditConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuditConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.service != null && message.hasOwnProperty("service")) + if (!$util.isString(message.service)) + return "service: string expected"; + if (message.auditLogConfigs != null && message.hasOwnProperty("auditLogConfigs")) { + if (!Array.isArray(message.auditLogConfigs)) + return "auditLogConfigs: array expected"; + for (var i = 0; i < message.auditLogConfigs.length; ++i) { + var error = $root.google.iam.v1.AuditLogConfig.verify(message.auditLogConfigs[i]); + if (error) + return "auditLogConfigs." + error; + } + } + return null; + }; + + /** + * Creates an AuditConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.AuditConfig + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.AuditConfig} AuditConfig + */ + AuditConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.AuditConfig) + return object; + var message = new $root.google.iam.v1.AuditConfig(); + if (object.service != null) + message.service = String(object.service); + if (object.auditLogConfigs) { + if (!Array.isArray(object.auditLogConfigs)) + throw TypeError(".google.iam.v1.AuditConfig.auditLogConfigs: array expected"); + message.auditLogConfigs = []; + for (var i = 0; i < object.auditLogConfigs.length; ++i) { + if (typeof object.auditLogConfigs[i] !== "object") + throw TypeError(".google.iam.v1.AuditConfig.auditLogConfigs: object expected"); + message.auditLogConfigs[i] = $root.google.iam.v1.AuditLogConfig.fromObject(object.auditLogConfigs[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an AuditConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.AuditConfig + * @static + * @param {google.iam.v1.AuditConfig} message AuditConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuditConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.auditLogConfigs = []; + if (options.defaults) + object.service = ""; + if (message.service != null && message.hasOwnProperty("service")) + object.service = message.service; + if (message.auditLogConfigs && message.auditLogConfigs.length) { + object.auditLogConfigs = []; + for (var j = 0; j < message.auditLogConfigs.length; ++j) + object.auditLogConfigs[j] = $root.google.iam.v1.AuditLogConfig.toObject(message.auditLogConfigs[j], options); + } + return object; + }; + + /** + * Converts this AuditConfig to JSON. + * @function toJSON + * @memberof google.iam.v1.AuditConfig + * @instance + * @returns {Object.} JSON object + */ + AuditConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AuditConfig + * @function getTypeUrl + * @memberof google.iam.v1.AuditConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AuditConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.AuditConfig"; + }; + + return AuditConfig; + })(); + + v1.AuditLogConfig = (function() { + + /** + * Properties of an AuditLogConfig. + * @memberof google.iam.v1 + * @interface IAuditLogConfig + * @property {google.iam.v1.AuditLogConfig.LogType|null} [logType] AuditLogConfig logType + * @property {Array.|null} [exemptedMembers] AuditLogConfig exemptedMembers + */ + + /** + * Constructs a new AuditLogConfig. + * @memberof google.iam.v1 + * @classdesc Represents an AuditLogConfig. + * @implements IAuditLogConfig + * @constructor + * @param {google.iam.v1.IAuditLogConfig=} [properties] Properties to set + */ + function AuditLogConfig(properties) { + this.exemptedMembers = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AuditLogConfig logType. + * @member {google.iam.v1.AuditLogConfig.LogType} logType + * @memberof google.iam.v1.AuditLogConfig + * @instance + */ + AuditLogConfig.prototype.logType = 0; + + /** + * AuditLogConfig exemptedMembers. + * @member {Array.} exemptedMembers + * @memberof google.iam.v1.AuditLogConfig + * @instance + */ + AuditLogConfig.prototype.exemptedMembers = $util.emptyArray; + + /** + * Creates a new AuditLogConfig instance using the specified properties. + * @function create + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {google.iam.v1.IAuditLogConfig=} [properties] Properties to set + * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig instance + */ + AuditLogConfig.create = function create(properties) { + return new AuditLogConfig(properties); + }; + + /** + * Encodes the specified AuditLogConfig message. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {google.iam.v1.IAuditLogConfig} message AuditLogConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditLogConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.logType != null && Object.hasOwnProperty.call(message, "logType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.logType); + if (message.exemptedMembers != null && message.exemptedMembers.length) + for (var i = 0; i < message.exemptedMembers.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.exemptedMembers[i]); + return writer; + }; + + /** + * Encodes the specified AuditLogConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {google.iam.v1.IAuditLogConfig} message AuditLogConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditLogConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuditLogConfig message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditLogConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.AuditLogConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.logType = reader.int32(); + break; + } + case 2: { + if (!(message.exemptedMembers && message.exemptedMembers.length)) + message.exemptedMembers = []; + message.exemptedMembers.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuditLogConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditLogConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuditLogConfig message. + * @function verify + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuditLogConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.logType != null && message.hasOwnProperty("logType")) + switch (message.logType) { + default: + return "logType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.exemptedMembers != null && message.hasOwnProperty("exemptedMembers")) { + if (!Array.isArray(message.exemptedMembers)) + return "exemptedMembers: array expected"; + for (var i = 0; i < message.exemptedMembers.length; ++i) + if (!$util.isString(message.exemptedMembers[i])) + return "exemptedMembers: string[] expected"; + } + return null; + }; + + /** + * Creates an AuditLogConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig + */ + AuditLogConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.AuditLogConfig) + return object; + var message = new $root.google.iam.v1.AuditLogConfig(); + switch (object.logType) { + default: + if (typeof object.logType === "number") { + message.logType = object.logType; + break; + } + break; + case "LOG_TYPE_UNSPECIFIED": + case 0: + message.logType = 0; + break; + case "ADMIN_READ": + case 1: + message.logType = 1; + break; + case "DATA_WRITE": + case 2: + message.logType = 2; + break; + case "DATA_READ": + case 3: + message.logType = 3; + break; + } + if (object.exemptedMembers) { + if (!Array.isArray(object.exemptedMembers)) + throw TypeError(".google.iam.v1.AuditLogConfig.exemptedMembers: array expected"); + message.exemptedMembers = []; + for (var i = 0; i < object.exemptedMembers.length; ++i) + message.exemptedMembers[i] = String(object.exemptedMembers[i]); + } + return message; + }; + + /** + * Creates a plain object from an AuditLogConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {google.iam.v1.AuditLogConfig} message AuditLogConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuditLogConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.exemptedMembers = []; + if (options.defaults) + object.logType = options.enums === String ? "LOG_TYPE_UNSPECIFIED" : 0; + if (message.logType != null && message.hasOwnProperty("logType")) + object.logType = options.enums === String ? $root.google.iam.v1.AuditLogConfig.LogType[message.logType] === undefined ? message.logType : $root.google.iam.v1.AuditLogConfig.LogType[message.logType] : message.logType; + if (message.exemptedMembers && message.exemptedMembers.length) { + object.exemptedMembers = []; + for (var j = 0; j < message.exemptedMembers.length; ++j) + object.exemptedMembers[j] = message.exemptedMembers[j]; + } + return object; + }; + + /** + * Converts this AuditLogConfig to JSON. + * @function toJSON + * @memberof google.iam.v1.AuditLogConfig + * @instance + * @returns {Object.} JSON object + */ + AuditLogConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AuditLogConfig + * @function getTypeUrl + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AuditLogConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.AuditLogConfig"; + }; + + /** + * LogType enum. + * @name google.iam.v1.AuditLogConfig.LogType + * @enum {number} + * @property {number} LOG_TYPE_UNSPECIFIED=0 LOG_TYPE_UNSPECIFIED value + * @property {number} ADMIN_READ=1 ADMIN_READ value + * @property {number} DATA_WRITE=2 DATA_WRITE value + * @property {number} DATA_READ=3 DATA_READ value + */ + AuditLogConfig.LogType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LOG_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ADMIN_READ"] = 1; + values[valuesById[2] = "DATA_WRITE"] = 2; + values[valuesById[3] = "DATA_READ"] = 3; + return values; + })(); + + return AuditLogConfig; + })(); + + v1.PolicyDelta = (function() { + + /** + * Properties of a PolicyDelta. + * @memberof google.iam.v1 + * @interface IPolicyDelta + * @property {Array.|null} [bindingDeltas] PolicyDelta bindingDeltas + * @property {Array.|null} [auditConfigDeltas] PolicyDelta auditConfigDeltas + */ + + /** + * Constructs a new PolicyDelta. + * @memberof google.iam.v1 + * @classdesc Represents a PolicyDelta. + * @implements IPolicyDelta + * @constructor + * @param {google.iam.v1.IPolicyDelta=} [properties] Properties to set + */ + function PolicyDelta(properties) { + this.bindingDeltas = []; + this.auditConfigDeltas = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PolicyDelta bindingDeltas. + * @member {Array.} bindingDeltas + * @memberof google.iam.v1.PolicyDelta + * @instance + */ + PolicyDelta.prototype.bindingDeltas = $util.emptyArray; + + /** + * PolicyDelta auditConfigDeltas. + * @member {Array.} auditConfigDeltas + * @memberof google.iam.v1.PolicyDelta + * @instance + */ + PolicyDelta.prototype.auditConfigDeltas = $util.emptyArray; + + /** + * Creates a new PolicyDelta instance using the specified properties. + * @function create + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.IPolicyDelta=} [properties] Properties to set + * @returns {google.iam.v1.PolicyDelta} PolicyDelta instance + */ + PolicyDelta.create = function create(properties) { + return new PolicyDelta(properties); + }; + + /** + * Encodes the specified PolicyDelta message. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.IPolicyDelta} message PolicyDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PolicyDelta.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bindingDeltas != null && message.bindingDeltas.length) + for (var i = 0; i < message.bindingDeltas.length; ++i) + $root.google.iam.v1.BindingDelta.encode(message.bindingDeltas[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.auditConfigDeltas != null && message.auditConfigDeltas.length) + for (var i = 0; i < message.auditConfigDeltas.length; ++i) + $root.google.iam.v1.AuditConfigDelta.encode(message.auditConfigDeltas[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PolicyDelta message, length delimited. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.IPolicyDelta} message PolicyDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PolicyDelta.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PolicyDelta message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.PolicyDelta} PolicyDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PolicyDelta.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.PolicyDelta(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.bindingDeltas && message.bindingDeltas.length)) + message.bindingDeltas = []; + message.bindingDeltas.push($root.google.iam.v1.BindingDelta.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.auditConfigDeltas && message.auditConfigDeltas.length)) + message.auditConfigDeltas = []; + message.auditConfigDeltas.push($root.google.iam.v1.AuditConfigDelta.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PolicyDelta message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.PolicyDelta} PolicyDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PolicyDelta.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PolicyDelta message. + * @function verify + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PolicyDelta.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.bindingDeltas != null && message.hasOwnProperty("bindingDeltas")) { + if (!Array.isArray(message.bindingDeltas)) + return "bindingDeltas: array expected"; + for (var i = 0; i < message.bindingDeltas.length; ++i) { + var error = $root.google.iam.v1.BindingDelta.verify(message.bindingDeltas[i]); + if (error) + return "bindingDeltas." + error; + } + } + if (message.auditConfigDeltas != null && message.hasOwnProperty("auditConfigDeltas")) { + if (!Array.isArray(message.auditConfigDeltas)) + return "auditConfigDeltas: array expected"; + for (var i = 0; i < message.auditConfigDeltas.length; ++i) { + var error = $root.google.iam.v1.AuditConfigDelta.verify(message.auditConfigDeltas[i]); + if (error) + return "auditConfigDeltas." + error; + } + } + return null; + }; + + /** + * Creates a PolicyDelta message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.PolicyDelta} PolicyDelta + */ + PolicyDelta.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.PolicyDelta) + return object; + var message = new $root.google.iam.v1.PolicyDelta(); + if (object.bindingDeltas) { + if (!Array.isArray(object.bindingDeltas)) + throw TypeError(".google.iam.v1.PolicyDelta.bindingDeltas: array expected"); + message.bindingDeltas = []; + for (var i = 0; i < object.bindingDeltas.length; ++i) { + if (typeof object.bindingDeltas[i] !== "object") + throw TypeError(".google.iam.v1.PolicyDelta.bindingDeltas: object expected"); + message.bindingDeltas[i] = $root.google.iam.v1.BindingDelta.fromObject(object.bindingDeltas[i]); + } + } + if (object.auditConfigDeltas) { + if (!Array.isArray(object.auditConfigDeltas)) + throw TypeError(".google.iam.v1.PolicyDelta.auditConfigDeltas: array expected"); + message.auditConfigDeltas = []; + for (var i = 0; i < object.auditConfigDeltas.length; ++i) { + if (typeof object.auditConfigDeltas[i] !== "object") + throw TypeError(".google.iam.v1.PolicyDelta.auditConfigDeltas: object expected"); + message.auditConfigDeltas[i] = $root.google.iam.v1.AuditConfigDelta.fromObject(object.auditConfigDeltas[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a PolicyDelta message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.PolicyDelta} message PolicyDelta + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PolicyDelta.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.bindingDeltas = []; + object.auditConfigDeltas = []; + } + if (message.bindingDeltas && message.bindingDeltas.length) { + object.bindingDeltas = []; + for (var j = 0; j < message.bindingDeltas.length; ++j) + object.bindingDeltas[j] = $root.google.iam.v1.BindingDelta.toObject(message.bindingDeltas[j], options); + } + if (message.auditConfigDeltas && message.auditConfigDeltas.length) { + object.auditConfigDeltas = []; + for (var j = 0; j < message.auditConfigDeltas.length; ++j) + object.auditConfigDeltas[j] = $root.google.iam.v1.AuditConfigDelta.toObject(message.auditConfigDeltas[j], options); + } + return object; + }; + + /** + * Converts this PolicyDelta to JSON. + * @function toJSON + * @memberof google.iam.v1.PolicyDelta + * @instance + * @returns {Object.} JSON object + */ + PolicyDelta.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PolicyDelta + * @function getTypeUrl + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PolicyDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.PolicyDelta"; + }; + + return PolicyDelta; + })(); + + v1.BindingDelta = (function() { + + /** + * Properties of a BindingDelta. + * @memberof google.iam.v1 + * @interface IBindingDelta + * @property {google.iam.v1.BindingDelta.Action|null} [action] BindingDelta action + * @property {string|null} [role] BindingDelta role + * @property {string|null} [member] BindingDelta member + * @property {google.type.IExpr|null} [condition] BindingDelta condition + */ + + /** + * Constructs a new BindingDelta. + * @memberof google.iam.v1 + * @classdesc Represents a BindingDelta. + * @implements IBindingDelta + * @constructor + * @param {google.iam.v1.IBindingDelta=} [properties] Properties to set + */ + function BindingDelta(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BindingDelta action. + * @member {google.iam.v1.BindingDelta.Action} action + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.action = 0; + + /** + * BindingDelta role. + * @member {string} role + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.role = ""; + + /** + * BindingDelta member. + * @member {string} member + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.member = ""; + + /** + * BindingDelta condition. + * @member {google.type.IExpr|null|undefined} condition + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.condition = null; + + /** + * Creates a new BindingDelta instance using the specified properties. + * @function create + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.IBindingDelta=} [properties] Properties to set + * @returns {google.iam.v1.BindingDelta} BindingDelta instance + */ + BindingDelta.create = function create(properties) { + return new BindingDelta(properties); + }; + + /** + * Encodes the specified BindingDelta message. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.IBindingDelta} message BindingDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BindingDelta.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); + if (message.role != null && Object.hasOwnProperty.call(message, "role")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.role); + if (message.member != null && Object.hasOwnProperty.call(message, "member")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.member); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + $root.google.type.Expr.encode(message.condition, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BindingDelta message, length delimited. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.IBindingDelta} message BindingDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BindingDelta.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BindingDelta message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.BindingDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.BindingDelta} BindingDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BindingDelta.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.BindingDelta(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.action = reader.int32(); + break; + } + case 2: { + message.role = reader.string(); + break; + } + case 3: { + message.member = reader.string(); + break; + } + case 4: { + message.condition = $root.google.type.Expr.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BindingDelta message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.BindingDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.BindingDelta} BindingDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BindingDelta.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BindingDelta message. + * @function verify + * @memberof google.iam.v1.BindingDelta + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BindingDelta.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.action != null && message.hasOwnProperty("action")) + switch (message.action) { + default: + return "action: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.role != null && message.hasOwnProperty("role")) + if (!$util.isString(message.role)) + return "role: string expected"; + if (message.member != null && message.hasOwnProperty("member")) + if (!$util.isString(message.member)) + return "member: string expected"; + if (message.condition != null && message.hasOwnProperty("condition")) { + var error = $root.google.type.Expr.verify(message.condition); + if (error) + return "condition." + error; + } + return null; + }; + + /** + * Creates a BindingDelta message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.BindingDelta + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.BindingDelta} BindingDelta + */ + BindingDelta.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.BindingDelta) + return object; + var message = new $root.google.iam.v1.BindingDelta(); + switch (object.action) { + default: + if (typeof object.action === "number") { + message.action = object.action; + break; + } + break; + case "ACTION_UNSPECIFIED": + case 0: + message.action = 0; + break; + case "ADD": + case 1: + message.action = 1; + break; + case "REMOVE": + case 2: + message.action = 2; + break; + } + if (object.role != null) + message.role = String(object.role); + if (object.member != null) + message.member = String(object.member); + if (object.condition != null) { + if (typeof object.condition !== "object") + throw TypeError(".google.iam.v1.BindingDelta.condition: object expected"); + message.condition = $root.google.type.Expr.fromObject(object.condition); + } + return message; + }; + + /** + * Creates a plain object from a BindingDelta message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.BindingDelta} message BindingDelta + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BindingDelta.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.action = options.enums === String ? "ACTION_UNSPECIFIED" : 0; + object.role = ""; + object.member = ""; + object.condition = null; + } + if (message.action != null && message.hasOwnProperty("action")) + object.action = options.enums === String ? $root.google.iam.v1.BindingDelta.Action[message.action] === undefined ? message.action : $root.google.iam.v1.BindingDelta.Action[message.action] : message.action; + if (message.role != null && message.hasOwnProperty("role")) + object.role = message.role; + if (message.member != null && message.hasOwnProperty("member")) + object.member = message.member; + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = $root.google.type.Expr.toObject(message.condition, options); + return object; + }; + + /** + * Converts this BindingDelta to JSON. + * @function toJSON + * @memberof google.iam.v1.BindingDelta + * @instance + * @returns {Object.} JSON object + */ + BindingDelta.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BindingDelta + * @function getTypeUrl + * @memberof google.iam.v1.BindingDelta + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BindingDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.BindingDelta"; + }; + + /** + * Action enum. + * @name google.iam.v1.BindingDelta.Action + * @enum {number} + * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value + * @property {number} ADD=1 ADD value + * @property {number} REMOVE=2 REMOVE value + */ + BindingDelta.Action = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "ADD"] = 1; + values[valuesById[2] = "REMOVE"] = 2; + return values; + })(); + + return BindingDelta; + })(); + + v1.AuditConfigDelta = (function() { + + /** + * Properties of an AuditConfigDelta. + * @memberof google.iam.v1 + * @interface IAuditConfigDelta + * @property {google.iam.v1.AuditConfigDelta.Action|null} [action] AuditConfigDelta action + * @property {string|null} [service] AuditConfigDelta service + * @property {string|null} [exemptedMember] AuditConfigDelta exemptedMember + * @property {string|null} [logType] AuditConfigDelta logType + */ + + /** + * Constructs a new AuditConfigDelta. + * @memberof google.iam.v1 + * @classdesc Represents an AuditConfigDelta. + * @implements IAuditConfigDelta + * @constructor + * @param {google.iam.v1.IAuditConfigDelta=} [properties] Properties to set + */ + function AuditConfigDelta(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AuditConfigDelta action. + * @member {google.iam.v1.AuditConfigDelta.Action} action + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.action = 0; + + /** + * AuditConfigDelta service. + * @member {string} service + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.service = ""; + + /** + * AuditConfigDelta exemptedMember. + * @member {string} exemptedMember + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.exemptedMember = ""; + + /** + * AuditConfigDelta logType. + * @member {string} logType + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.logType = ""; + + /** + * Creates a new AuditConfigDelta instance using the specified properties. + * @function create + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.IAuditConfigDelta=} [properties] Properties to set + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta instance + */ + AuditConfigDelta.create = function create(properties) { + return new AuditConfigDelta(properties); + }; + + /** + * Encodes the specified AuditConfigDelta message. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.IAuditConfigDelta} message AuditConfigDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfigDelta.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); + if (message.service != null && Object.hasOwnProperty.call(message, "service")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.service); + if (message.exemptedMember != null && Object.hasOwnProperty.call(message, "exemptedMember")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.exemptedMember); + if (message.logType != null && Object.hasOwnProperty.call(message, "logType")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.logType); + return writer; + }; + + /** + * Encodes the specified AuditConfigDelta message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.IAuditConfigDelta} message AuditConfigDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfigDelta.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfigDelta.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.AuditConfigDelta(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.action = reader.int32(); + break; + } + case 2: { + message.service = reader.string(); + break; + } + case 3: { + message.exemptedMember = reader.string(); + break; + } + case 4: { + message.logType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfigDelta.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuditConfigDelta message. + * @function verify + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuditConfigDelta.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.action != null && message.hasOwnProperty("action")) + switch (message.action) { + default: + return "action: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.service != null && message.hasOwnProperty("service")) + if (!$util.isString(message.service)) + return "service: string expected"; + if (message.exemptedMember != null && message.hasOwnProperty("exemptedMember")) + if (!$util.isString(message.exemptedMember)) + return "exemptedMember: string expected"; + if (message.logType != null && message.hasOwnProperty("logType")) + if (!$util.isString(message.logType)) + return "logType: string expected"; + return null; + }; + + /** + * Creates an AuditConfigDelta message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta + */ + AuditConfigDelta.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.AuditConfigDelta) + return object; + var message = new $root.google.iam.v1.AuditConfigDelta(); + switch (object.action) { + default: + if (typeof object.action === "number") { + message.action = object.action; + break; + } + break; + case "ACTION_UNSPECIFIED": + case 0: + message.action = 0; + break; + case "ADD": + case 1: + message.action = 1; + break; + case "REMOVE": + case 2: + message.action = 2; + break; + } + if (object.service != null) + message.service = String(object.service); + if (object.exemptedMember != null) + message.exemptedMember = String(object.exemptedMember); + if (object.logType != null) + message.logType = String(object.logType); + return message; + }; + + /** + * Creates a plain object from an AuditConfigDelta message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.AuditConfigDelta} message AuditConfigDelta + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuditConfigDelta.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.action = options.enums === String ? "ACTION_UNSPECIFIED" : 0; + object.service = ""; + object.exemptedMember = ""; + object.logType = ""; + } + if (message.action != null && message.hasOwnProperty("action")) + object.action = options.enums === String ? $root.google.iam.v1.AuditConfigDelta.Action[message.action] === undefined ? message.action : $root.google.iam.v1.AuditConfigDelta.Action[message.action] : message.action; + if (message.service != null && message.hasOwnProperty("service")) + object.service = message.service; + if (message.exemptedMember != null && message.hasOwnProperty("exemptedMember")) + object.exemptedMember = message.exemptedMember; + if (message.logType != null && message.hasOwnProperty("logType")) + object.logType = message.logType; + return object; + }; + + /** + * Converts this AuditConfigDelta to JSON. + * @function toJSON + * @memberof google.iam.v1.AuditConfigDelta + * @instance + * @returns {Object.} JSON object + */ + AuditConfigDelta.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AuditConfigDelta + * @function getTypeUrl + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AuditConfigDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.AuditConfigDelta"; + }; + + /** + * Action enum. + * @name google.iam.v1.AuditConfigDelta.Action + * @enum {number} + * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value + * @property {number} ADD=1 ADD value + * @property {number} REMOVE=2 REMOVE value + */ + AuditConfigDelta.Action = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "ADD"] = 1; + values[valuesById[2] = "REMOVE"] = 2; + return values; + })(); + + return AuditConfigDelta; + })(); + + return v1; + })(); + + return iam; + })(); + + google.type = (function() { + + /** + * Namespace type. + * @memberof google + * @namespace + */ + var type = {}; + + type.Expr = (function() { + + /** + * Properties of an Expr. + * @memberof google.type + * @interface IExpr + * @property {string|null} [expression] Expr expression + * @property {string|null} [title] Expr title + * @property {string|null} [description] Expr description + * @property {string|null} [location] Expr location + */ + + /** + * Constructs a new Expr. + * @memberof google.type + * @classdesc Represents an Expr. + * @implements IExpr + * @constructor + * @param {google.type.IExpr=} [properties] Properties to set + */ + function Expr(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Expr expression. + * @member {string} expression + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.expression = ""; + + /** + * Expr title. + * @member {string} title + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.title = ""; + + /** + * Expr description. + * @member {string} description + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.description = ""; + + /** + * Expr location. + * @member {string} location + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.location = ""; + + /** + * Creates a new Expr instance using the specified properties. + * @function create + * @memberof google.type.Expr + * @static + * @param {google.type.IExpr=} [properties] Properties to set + * @returns {google.type.Expr} Expr instance + */ + Expr.create = function create(properties) { + return new Expr(properties); + }; + + /** + * Encodes the specified Expr message. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @function encode + * @memberof google.type.Expr + * @static + * @param {google.type.IExpr} message Expr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Expr.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.expression != null && Object.hasOwnProperty.call(message, "expression")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.expression); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.title); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.location); + return writer; + }; + + /** + * Encodes the specified Expr message, length delimited. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @function encodeDelimited + * @memberof google.type.Expr + * @static + * @param {google.type.IExpr} message Expr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Expr.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Expr message from the specified reader or buffer. + * @function decode + * @memberof google.type.Expr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.type.Expr} Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Expr.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.Expr(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.expression = reader.string(); + break; + } + case 2: { + message.title = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + message.location = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Expr message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.type.Expr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.type.Expr} Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Expr.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Expr message. + * @function verify + * @memberof google.type.Expr + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Expr.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.expression != null && message.hasOwnProperty("expression")) + if (!$util.isString(message.expression)) + return "expression: string expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + return null; + }; + + /** + * Creates an Expr message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.type.Expr + * @static + * @param {Object.} object Plain object + * @returns {google.type.Expr} Expr + */ + Expr.fromObject = function fromObject(object) { + if (object instanceof $root.google.type.Expr) + return object; + var message = new $root.google.type.Expr(); + if (object.expression != null) + message.expression = String(object.expression); + if (object.title != null) + message.title = String(object.title); + if (object.description != null) + message.description = String(object.description); + if (object.location != null) + message.location = String(object.location); + return message; + }; + + /** + * Creates a plain object from an Expr message. Also converts values to other types if specified. + * @function toObject + * @memberof google.type.Expr + * @static + * @param {google.type.Expr} message Expr + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Expr.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.expression = ""; + object.title = ""; + object.description = ""; + object.location = ""; + } + if (message.expression != null && message.hasOwnProperty("expression")) + object.expression = message.expression; + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this Expr to JSON. + * @function toJSON + * @memberof google.type.Expr + * @instance + * @returns {Object.} JSON object + */ + Expr.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Expr + * @function getTypeUrl + * @memberof google.type.Expr + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Expr.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.type.Expr"; + }; + + return Expr; + })(); + + return type; + })(); + + return google; + })(); + + return $root; +}); diff --git a/owl-bot-staging/admin/database/v1/protos/protos.json b/owl-bot-staging/admin/database/v1/protos/protos.json new file mode 100644 index 000000000..46977cdbc --- /dev/null +++ b/owl-bot-staging/admin/database/v1/protos/protos.json @@ -0,0 +1,4651 @@ +{ + "nested": { + "google": { + "nested": { + "spanner": { + "nested": { + "admin": { + "nested": { + "database": { + "nested": { + "v1": { + "options": { + "csharp_namespace": "Google.Cloud.Spanner.Admin.Database.V1", + "go_package": "cloud.google.com/go/spanner/admin/database/apiv1/databasepb;databasepb", + "java_multiple_files": true, + "java_outer_classname": "SpannerDatabaseAdminProto", + "java_package": "com.google.spanner.admin.database.v1", + "php_namespace": "Google\\Cloud\\Spanner\\Admin\\Database\\V1", + "ruby_package": "Google::Cloud::Spanner::Admin::Database::V1", + "(google.api.resource_definition).type": "spanner.googleapis.com/InstancePartition", + "(google.api.resource_definition).pattern": "projects/{project}/instances/{instance}/instancePartitions/{instance_partition}" + }, + "nested": { + "Backup": { + "options": { + "(google.api.resource).type": "spanner.googleapis.com/Backup", + "(google.api.resource).pattern": "projects/{project}/instances/{instance}/backups/{backup}" + }, + "fields": { + "database": { + "type": "string", + "id": 2, + "options": { + "(google.api.resource_reference).type": "spanner.googleapis.com/Database" + } + }, + "versionTime": { + "type": "google.protobuf.Timestamp", + "id": 9 + }, + "expireTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + }, + "name": { + "type": "string", + "id": 1 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "sizeBytes": { + "type": "int64", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "freeableSizeBytes": { + "type": "int64", + "id": 15, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "exclusiveSizeBytes": { + "type": "int64", + "id": 16, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "State", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "referencingDatabases": { + "rule": "repeated", + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "spanner.googleapis.com/Database" + } + }, + "encryptionInfo": { + "type": "EncryptionInfo", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "encryptionInformation": { + "rule": "repeated", + "type": "EncryptionInfo", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "databaseDialect": { + "type": "DatabaseDialect", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "referencingBackups": { + "rule": "repeated", + "type": "string", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "spanner.googleapis.com/Backup" + } + }, + "maxExpireTime": { + "type": "google.protobuf.Timestamp", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "backupSchedules": { + "rule": "repeated", + "type": "string", + "id": 14, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "spanner.googleapis.com/BackupSchedule" + } + }, + "incrementalBackupChainId": { + "type": "string", + "id": 17, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "oldestVersionTime": { + "type": "google.protobuf.Timestamp", + "id": 18, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "instancePartitions": { + "rule": "repeated", + "type": "BackupInstancePartition", + "id": 19, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "CREATING": 1, + "READY": 2 + } + } + } + }, + "CreateBackupRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/Instance" + } + }, + "backupId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "backup": { + "type": "Backup", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "encryptionConfig": { + "type": "CreateBackupEncryptionConfig", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "CreateBackupMetadata": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "spanner.googleapis.com/Backup" + } + }, + "database": { + "type": "string", + "id": 2, + "options": { + "(google.api.resource_reference).type": "spanner.googleapis.com/Database" + } + }, + "progress": { + "type": "OperationProgress", + "id": 3 + }, + "cancelTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + } + } + }, + "CopyBackupRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/Instance" + } + }, + "backupId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "sourceBackup": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/Backup" + } + }, + "expireTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "encryptionConfig": { + "type": "CopyBackupEncryptionConfig", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "CopyBackupMetadata": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "spanner.googleapis.com/Backup" + } + }, + "sourceBackup": { + "type": "string", + "id": 2, + "options": { + "(google.api.resource_reference).type": "spanner.googleapis.com/Backup" + } + }, + "progress": { + "type": "OperationProgress", + "id": 3 + }, + "cancelTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + } + } + }, + "UpdateBackupRequest": { + "fields": { + "backup": { + "type": "Backup", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetBackupRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/Backup" + } + } + } + }, + "DeleteBackupRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/Backup" + } + } + } + }, + "ListBackupsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/Instance" + } + }, + "filter": { + "type": "string", + "id": 2 + }, + "pageSize": { + "type": "int32", + "id": 3 + }, + "pageToken": { + "type": "string", + "id": 4 + } + } + }, + "ListBackupsResponse": { + "fields": { + "backups": { + "rule": "repeated", + "type": "Backup", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "ListBackupOperationsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/Instance" + } + }, + "filter": { + "type": "string", + "id": 2 + }, + "pageSize": { + "type": "int32", + "id": 3 + }, + "pageToken": { + "type": "string", + "id": 4 + } + } + }, + "ListBackupOperationsResponse": { + "fields": { + "operations": { + "rule": "repeated", + "type": "google.longrunning.Operation", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "BackupInfo": { + "fields": { + "backup": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "spanner.googleapis.com/Backup" + } + }, + "versionTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "sourceDatabase": { + "type": "string", + "id": 3, + "options": { + "(google.api.resource_reference).type": "spanner.googleapis.com/Database" + } + } + } + }, + "CreateBackupEncryptionConfig": { + "fields": { + "encryptionType": { + "type": "EncryptionType", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "kmsKeyName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" + } + }, + "kmsKeyNames": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" + } + } + }, + "nested": { + "EncryptionType": { + "values": { + "ENCRYPTION_TYPE_UNSPECIFIED": 0, + "USE_DATABASE_ENCRYPTION": 1, + "GOOGLE_DEFAULT_ENCRYPTION": 2, + "CUSTOMER_MANAGED_ENCRYPTION": 3 + } + } + } + }, + "CopyBackupEncryptionConfig": { + "fields": { + "encryptionType": { + "type": "EncryptionType", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "kmsKeyName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" + } + }, + "kmsKeyNames": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" + } + } + }, + "nested": { + "EncryptionType": { + "values": { + "ENCRYPTION_TYPE_UNSPECIFIED": 0, + "USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION": 1, + "GOOGLE_DEFAULT_ENCRYPTION": 2, + "CUSTOMER_MANAGED_ENCRYPTION": 3 + } + } + } + }, + "FullBackupSpec": { + "fields": {} + }, + "IncrementalBackupSpec": { + "fields": {} + }, + "BackupInstancePartition": { + "fields": { + "instancePartition": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "spanner.googleapis.com/InstancePartition" + } + } + } + }, + "OperationProgress": { + "fields": { + "progressPercent": { + "type": "int32", + "id": 1 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + } + } + }, + "EncryptionConfig": { + "fields": { + "kmsKeyName": { + "type": "string", + "id": 2, + "options": { + "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" + } + }, + "kmsKeyNames": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" + } + } + } + }, + "EncryptionInfo": { + "fields": { + "encryptionType": { + "type": "Type", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "encryptionStatus": { + "type": "google.rpc.Status", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "kmsKeyVersion": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKeyVersion" + } + } + }, + "nested": { + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "GOOGLE_DEFAULT_ENCRYPTION": 1, + "CUSTOMER_MANAGED_ENCRYPTION": 2 + } + } + } + }, + "DatabaseDialect": { + "values": { + "DATABASE_DIALECT_UNSPECIFIED": 0, + "GOOGLE_STANDARD_SQL": 1, + "POSTGRESQL": 2 + } + }, + "BackupScheduleSpec": { + "oneofs": { + "scheduleSpec": { + "oneof": [ + "cronSpec" + ] + } + }, + "fields": { + "cronSpec": { + "type": "CrontabSpec", + "id": 1 + } + } + }, + "BackupSchedule": { + "options": { + "(google.api.resource).type": "spanner.googleapis.com/BackupSchedule", + "(google.api.resource).pattern": "projects/{project}/instances/{instance}/databases/{database}/backupSchedules/{schedule}", + "(google.api.resource).plural": "backupSchedules", + "(google.api.resource).singular": "backupSchedule" + }, + "oneofs": { + "backupTypeSpec": { + "oneof": [ + "fullBackupSpec", + "incrementalBackupSpec" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "spec": { + "type": "BackupScheduleSpec", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "retentionDuration": { + "type": "google.protobuf.Duration", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "encryptionConfig": { + "type": "CreateBackupEncryptionConfig", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "fullBackupSpec": { + "type": "FullBackupSpec", + "id": 7 + }, + "incrementalBackupSpec": { + "type": "IncrementalBackupSpec", + "id": 8 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "CrontabSpec": { + "fields": { + "text": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "timeZone": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "creationWindow": { + "type": "google.protobuf.Duration", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "CreateBackupScheduleRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/Database" + } + }, + "backupScheduleId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "backupSchedule": { + "type": "BackupSchedule", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetBackupScheduleRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/BackupSchedule" + } + } + } + }, + "DeleteBackupScheduleRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/BackupSchedule" + } + } + } + }, + "ListBackupSchedulesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/Database" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListBackupSchedulesResponse": { + "fields": { + "backupSchedules": { + "rule": "repeated", + "type": "BackupSchedule", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "UpdateBackupScheduleRequest": { + "fields": { + "backupSchedule": { + "type": "BackupSchedule", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DatabaseAdmin": { + "options": { + "(google.api.default_host)": "spanner.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/spanner.admin" + }, + "methods": { + "ListDatabases": { + "requestType": "ListDatabasesRequest", + "responseType": "ListDatabasesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/instances/*}/databases", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/instances/*}/databases" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "CreateDatabase": { + "requestType": "CreateDatabaseRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/instances/*}/databases", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent,create_statement", + "(google.longrunning.operation_info).response_type": "google.spanner.admin.database.v1.Database", + "(google.longrunning.operation_info).metadata_type": "google.spanner.admin.database.v1.CreateDatabaseMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/instances/*}/databases", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent,create_statement" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.spanner.admin.database.v1.Database", + "metadata_type": "google.spanner.admin.database.v1.CreateDatabaseMetadata" + } + } + ] + }, + "GetDatabase": { + "requestType": "GetDatabaseRequest", + "responseType": "Database", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/instances/*/databases/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/instances/*/databases/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateDatabase": { + "requestType": "UpdateDatabaseRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{database.name=projects/*/instances/*/databases/*}", + "(google.api.http).body": "database", + "(google.api.method_signature)": "database,update_mask", + "(google.longrunning.operation_info).response_type": "Database", + "(google.longrunning.operation_info).metadata_type": "UpdateDatabaseMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{database.name=projects/*/instances/*/databases/*}", + "body": "database" + } + }, + { + "(google.api.method_signature)": "database,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Database", + "metadata_type": "UpdateDatabaseMetadata" + } + } + ] + }, + "UpdateDatabaseDdl": { + "requestType": "UpdateDatabaseDdlRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{database=projects/*/instances/*/databases/*}/ddl", + "(google.api.http).body": "*", + "(google.api.method_signature)": "database,statements", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{database=projects/*/instances/*/databases/*}/ddl", + "body": "*" + } + }, + { + "(google.api.method_signature)": "database,statements" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata" + } + } + ] + }, + "DropDatabase": { + "requestType": "DropDatabaseRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{database=projects/*/instances/*/databases/*}", + "(google.api.method_signature)": "database" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{database=projects/*/instances/*/databases/*}" + } + }, + { + "(google.api.method_signature)": "database" + } + ] + }, + "GetDatabaseDdl": { + "requestType": "GetDatabaseDdlRequest", + "responseType": "GetDatabaseDdlResponse", + "options": { + "(google.api.http).get": "/v1/{database=projects/*/instances/*/databases/*}/ddl", + "(google.api.method_signature)": "database" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{database=projects/*/instances/*/databases/*}/ddl" + } + }, + { + "(google.api.method_signature)": "database" + } + ] + }, + "SetIamPolicy": { + "requestType": "google.iam.v1.SetIamPolicyRequest", + "responseType": "google.iam.v1.Policy", + "options": { + "(google.api.http).post": "/v1/{resource=projects/*/instances/*/databases/*}:setIamPolicy", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1/{resource=projects/*/instances/*/databases/*/backupSchedules/*}:setIamPolicy", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "resource,policy" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{resource=projects/*/instances/*/databases/*}:setIamPolicy", + "body": "*", + "additional_bindings": [ + { + "post": "/v1/{resource=projects/*/instances/*/backups/*}:setIamPolicy", + "body": "*" + }, + { + "post": "/v1/{resource=projects/*/instances/*/databases/*/backupSchedules/*}:setIamPolicy", + "body": "*" + } + ] + } + }, + { + "(google.api.method_signature)": "resource,policy" + } + ] + }, + "GetIamPolicy": { + "requestType": "google.iam.v1.GetIamPolicyRequest", + "responseType": "google.iam.v1.Policy", + "options": { + "(google.api.http).post": "/v1/{resource=projects/*/instances/*/databases/*}:getIamPolicy", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1/{resource=projects/*/instances/*/databases/*/backupSchedules/*}:getIamPolicy", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{resource=projects/*/instances/*/databases/*}:getIamPolicy", + "body": "*", + "additional_bindings": [ + { + "post": "/v1/{resource=projects/*/instances/*/backups/*}:getIamPolicy", + "body": "*" + }, + { + "post": "/v1/{resource=projects/*/instances/*/databases/*/backupSchedules/*}:getIamPolicy", + "body": "*" + } + ] + } + }, + { + "(google.api.method_signature)": "resource" + } + ] + }, + "TestIamPermissions": { + "requestType": "google.iam.v1.TestIamPermissionsRequest", + "responseType": "google.iam.v1.TestIamPermissionsResponse", + "options": { + "(google.api.http).post": "/v1/{resource=projects/*/instances/*/databases/*}:testIamPermissions", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1/{resource=projects/*/instances/*/databases/*/databaseRoles/*}:testIamPermissions", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "resource,permissions" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{resource=projects/*/instances/*/databases/*}:testIamPermissions", + "body": "*", + "additional_bindings": [ + { + "post": "/v1/{resource=projects/*/instances/*/backups/*}:testIamPermissions", + "body": "*" + }, + { + "post": "/v1/{resource=projects/*/instances/*/databases/*/backupSchedules/*}:testIamPermissions", + "body": "*" + }, + { + "post": "/v1/{resource=projects/*/instances/*/databases/*/databaseRoles/*}:testIamPermissions", + "body": "*" + } + ] + } + }, + { + "(google.api.method_signature)": "resource,permissions" + } + ] + }, + "CreateBackup": { + "requestType": "CreateBackupRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/instances/*}/backups", + "(google.api.http).body": "backup", + "(google.api.method_signature)": "parent,backup,backup_id", + "(google.longrunning.operation_info).response_type": "google.spanner.admin.database.v1.Backup", + "(google.longrunning.operation_info).metadata_type": "google.spanner.admin.database.v1.CreateBackupMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/instances/*}/backups", + "body": "backup" + } + }, + { + "(google.api.method_signature)": "parent,backup,backup_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.spanner.admin.database.v1.Backup", + "metadata_type": "google.spanner.admin.database.v1.CreateBackupMetadata" + } + } + ] + }, + "CopyBackup": { + "requestType": "CopyBackupRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/instances/*}/backups:copy", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent,backup_id,source_backup,expire_time", + "(google.longrunning.operation_info).response_type": "google.spanner.admin.database.v1.Backup", + "(google.longrunning.operation_info).metadata_type": "google.spanner.admin.database.v1.CopyBackupMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/instances/*}/backups:copy", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent,backup_id,source_backup,expire_time" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.spanner.admin.database.v1.Backup", + "metadata_type": "google.spanner.admin.database.v1.CopyBackupMetadata" + } + } + ] + }, + "GetBackup": { + "requestType": "GetBackupRequest", + "responseType": "Backup", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/instances/*/backups/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/instances/*/backups/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateBackup": { + "requestType": "UpdateBackupRequest", + "responseType": "Backup", + "options": { + "(google.api.http).patch": "/v1/{backup.name=projects/*/instances/*/backups/*}", + "(google.api.http).body": "backup", + "(google.api.method_signature)": "backup,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{backup.name=projects/*/instances/*/backups/*}", + "body": "backup" + } + }, + { + "(google.api.method_signature)": "backup,update_mask" + } + ] + }, + "DeleteBackup": { + "requestType": "DeleteBackupRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/instances/*/backups/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/instances/*/backups/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListBackups": { + "requestType": "ListBackupsRequest", + "responseType": "ListBackupsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/instances/*}/backups", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/instances/*}/backups" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "RestoreDatabase": { + "requestType": "RestoreDatabaseRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/instances/*}/databases:restore", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent,database_id,backup", + "(google.longrunning.operation_info).response_type": "google.spanner.admin.database.v1.Database", + "(google.longrunning.operation_info).metadata_type": "google.spanner.admin.database.v1.RestoreDatabaseMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/instances/*}/databases:restore", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent,database_id,backup" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.spanner.admin.database.v1.Database", + "metadata_type": "google.spanner.admin.database.v1.RestoreDatabaseMetadata" + } + } + ] + }, + "ListDatabaseOperations": { + "requestType": "ListDatabaseOperationsRequest", + "responseType": "ListDatabaseOperationsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/instances/*}/databaseOperations", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/instances/*}/databaseOperations" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "ListBackupOperations": { + "requestType": "ListBackupOperationsRequest", + "responseType": "ListBackupOperationsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/instances/*}/backupOperations", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/instances/*}/backupOperations" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "ListDatabaseRoles": { + "requestType": "ListDatabaseRolesRequest", + "responseType": "ListDatabaseRolesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/instances/*/databases/*}/databaseRoles", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/instances/*/databases/*}/databaseRoles" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "AddSplitPoints": { + "requestType": "AddSplitPointsRequest", + "responseType": "AddSplitPointsResponse", + "options": { + "(google.api.http).post": "/v1/{database=projects/*/instances/*/databases/*}:addSplitPoints", + "(google.api.http).body": "*", + "(google.api.method_signature)": "database,split_points" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{database=projects/*/instances/*/databases/*}:addSplitPoints", + "body": "*" + } + }, + { + "(google.api.method_signature)": "database,split_points" + } + ] + }, + "CreateBackupSchedule": { + "requestType": "CreateBackupScheduleRequest", + "responseType": "BackupSchedule", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/instances/*/databases/*}/backupSchedules", + "(google.api.http).body": "backup_schedule", + "(google.api.method_signature)": "parent,backup_schedule,backup_schedule_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/instances/*/databases/*}/backupSchedules", + "body": "backup_schedule" + } + }, + { + "(google.api.method_signature)": "parent,backup_schedule,backup_schedule_id" + } + ] + }, + "GetBackupSchedule": { + "requestType": "GetBackupScheduleRequest", + "responseType": "BackupSchedule", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/instances/*/databases/*/backupSchedules/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/instances/*/databases/*/backupSchedules/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateBackupSchedule": { + "requestType": "UpdateBackupScheduleRequest", + "responseType": "BackupSchedule", + "options": { + "(google.api.http).patch": "/v1/{backup_schedule.name=projects/*/instances/*/databases/*/backupSchedules/*}", + "(google.api.http).body": "backup_schedule", + "(google.api.method_signature)": "backup_schedule,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{backup_schedule.name=projects/*/instances/*/databases/*/backupSchedules/*}", + "body": "backup_schedule" + } + }, + { + "(google.api.method_signature)": "backup_schedule,update_mask" + } + ] + }, + "DeleteBackupSchedule": { + "requestType": "DeleteBackupScheduleRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/instances/*/databases/*/backupSchedules/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/instances/*/databases/*/backupSchedules/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListBackupSchedules": { + "requestType": "ListBackupSchedulesRequest", + "responseType": "ListBackupSchedulesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/instances/*/databases/*}/backupSchedules", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/instances/*/databases/*}/backupSchedules" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "InternalUpdateGraphOperation": { + "requestType": "InternalUpdateGraphOperationRequest", + "responseType": "InternalUpdateGraphOperationResponse", + "options": { + "(google.api.method_signature)": "database,operation_id" + }, + "parsedOptions": [ + { + "(google.api.method_signature)": "database,operation_id" + } + ] + } + } + }, + "RestoreInfo": { + "oneofs": { + "sourceInfo": { + "oneof": [ + "backupInfo" + ] + } + }, + "fields": { + "sourceType": { + "type": "RestoreSourceType", + "id": 1 + }, + "backupInfo": { + "type": "BackupInfo", + "id": 2 + } + } + }, + "Database": { + "options": { + "(google.api.resource).type": "spanner.googleapis.com/Database", + "(google.api.resource).pattern": "projects/{project}/instances/{instance}/databases/{database}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "state": { + "type": "State", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "restoreInfo": { + "type": "RestoreInfo", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "encryptionConfig": { + "type": "EncryptionConfig", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "encryptionInfo": { + "rule": "repeated", + "type": "EncryptionInfo", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "versionRetentionPeriod": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "earliestVersionTime": { + "type": "google.protobuf.Timestamp", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "defaultLeader": { + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "databaseDialect": { + "type": "DatabaseDialect", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "enableDropProtection": { + "type": "bool", + "id": 11 + }, + "reconciling": { + "type": "bool", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "CREATING": 1, + "READY": 2, + "READY_OPTIMIZING": 3 + } + } + } + }, + "ListDatabasesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/Instance" + } + }, + "pageSize": { + "type": "int32", + "id": 3 + }, + "pageToken": { + "type": "string", + "id": 4 + } + } + }, + "ListDatabasesResponse": { + "fields": { + "databases": { + "rule": "repeated", + "type": "Database", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CreateDatabaseRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/Instance" + } + }, + "createStatement": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "extraStatements": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "encryptionConfig": { + "type": "EncryptionConfig", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "databaseDialect": { + "type": "DatabaseDialect", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "protoDescriptors": { + "type": "bytes", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "CreateDatabaseMetadata": { + "fields": { + "database": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "spanner.googleapis.com/Database" + } + } + } + }, + "GetDatabaseRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/Database" + } + } + } + }, + "UpdateDatabaseRequest": { + "fields": { + "database": { + "type": "Database", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateDatabaseMetadata": { + "fields": { + "request": { + "type": "UpdateDatabaseRequest", + "id": 1 + }, + "progress": { + "type": "OperationProgress", + "id": 2 + }, + "cancelTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + } + } + }, + "UpdateDatabaseDdlRequest": { + "fields": { + "database": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/Database" + } + }, + "statements": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "operationId": { + "type": "string", + "id": 3 + }, + "protoDescriptors": { + "type": "bytes", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "throughputMode": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DdlStatementActionInfo": { + "fields": { + "action": { + "type": "string", + "id": 1 + }, + "entityType": { + "type": "string", + "id": 2 + }, + "entityNames": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "UpdateDatabaseDdlMetadata": { + "fields": { + "database": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "spanner.googleapis.com/Database" + } + }, + "statements": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "commitTimestamps": { + "rule": "repeated", + "type": "google.protobuf.Timestamp", + "id": 3 + }, + "throttled": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "progress": { + "rule": "repeated", + "type": "OperationProgress", + "id": 5 + }, + "actions": { + "rule": "repeated", + "type": "DdlStatementActionInfo", + "id": 6 + } + } + }, + "DropDatabaseRequest": { + "fields": { + "database": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/Database" + } + } + } + }, + "GetDatabaseDdlRequest": { + "fields": { + "database": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/Database" + } + } + } + }, + "GetDatabaseDdlResponse": { + "fields": { + "statements": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "protoDescriptors": { + "type": "bytes", + "id": 2 + } + } + }, + "ListDatabaseOperationsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/Instance" + } + }, + "filter": { + "type": "string", + "id": 2 + }, + "pageSize": { + "type": "int32", + "id": 3 + }, + "pageToken": { + "type": "string", + "id": 4 + } + } + }, + "ListDatabaseOperationsResponse": { + "fields": { + "operations": { + "rule": "repeated", + "type": "google.longrunning.Operation", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "RestoreDatabaseRequest": { + "oneofs": { + "source": { + "oneof": [ + "backup" + ] + } + }, + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/Instance" + } + }, + "databaseId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "backup": { + "type": "string", + "id": 3, + "options": { + "(google.api.resource_reference).type": "spanner.googleapis.com/Backup" + } + }, + "encryptionConfig": { + "type": "RestoreDatabaseEncryptionConfig", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "RestoreDatabaseEncryptionConfig": { + "fields": { + "encryptionType": { + "type": "EncryptionType", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "kmsKeyName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" + } + }, + "kmsKeyNames": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" + } + } + }, + "nested": { + "EncryptionType": { + "values": { + "ENCRYPTION_TYPE_UNSPECIFIED": 0, + "USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION": 1, + "GOOGLE_DEFAULT_ENCRYPTION": 2, + "CUSTOMER_MANAGED_ENCRYPTION": 3 + } + } + } + }, + "RestoreDatabaseMetadata": { + "oneofs": { + "sourceInfo": { + "oneof": [ + "backupInfo" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "spanner.googleapis.com/Database" + } + }, + "sourceType": { + "type": "RestoreSourceType", + "id": 2 + }, + "backupInfo": { + "type": "BackupInfo", + "id": 3 + }, + "progress": { + "type": "OperationProgress", + "id": 4 + }, + "cancelTime": { + "type": "google.protobuf.Timestamp", + "id": 5 + }, + "optimizeDatabaseOperationName": { + "type": "string", + "id": 6 + } + } + }, + "OptimizeRestoredDatabaseMetadata": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "spanner.googleapis.com/Database" + } + }, + "progress": { + "type": "OperationProgress", + "id": 2 + } + } + }, + "RestoreSourceType": { + "values": { + "TYPE_UNSPECIFIED": 0, + "BACKUP": 1 + } + }, + "DatabaseRole": { + "options": { + "(google.api.resource).type": "spanner.googleapis.com/DatabaseRole", + "(google.api.resource).pattern": "projects/{project}/instances/{instance}/databases/{database}/databaseRoles/{role}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListDatabaseRolesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/Database" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListDatabaseRolesResponse": { + "fields": { + "databaseRoles": { + "rule": "repeated", + "type": "DatabaseRole", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "AddSplitPointsRequest": { + "fields": { + "database": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/Database" + } + }, + "splitPoints": { + "rule": "repeated", + "type": "SplitPoints", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "initiator": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "AddSplitPointsResponse": { + "fields": {} + }, + "SplitPoints": { + "fields": { + "table": { + "type": "string", + "id": 1 + }, + "index": { + "type": "string", + "id": 2 + }, + "keys": { + "rule": "repeated", + "type": "Key", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "expireTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "Key": { + "fields": { + "keyParts": { + "type": "google.protobuf.ListValue", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + } + } + }, + "InternalUpdateGraphOperationRequest": { + "fields": { + "database": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/Database" + } + }, + "operationId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "vmIdentityToken": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "progress": { + "type": "double", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "status": { + "type": "google.rpc.Status", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "InternalUpdateGraphOperationResponse": { + "fields": {} + } + } + } + } + } + } + } + } + }, + "api": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/api;api", + "java_multiple_files": true, + "java_outer_classname": "LaunchStageProto", + "java_package": "com.google.api", + "objc_class_prefix": "GAPI", + "cc_enable_arenas": true + }, + "nested": { + "fieldBehavior": { + "rule": "repeated", + "type": "google.api.FieldBehavior", + "id": 1052, + "extend": "google.protobuf.FieldOptions", + "options": { + "packed": false + } + }, + "FieldBehavior": { + "values": { + "FIELD_BEHAVIOR_UNSPECIFIED": 0, + "OPTIONAL": 1, + "REQUIRED": 2, + "OUTPUT_ONLY": 3, + "INPUT_ONLY": 4, + "IMMUTABLE": 5, + "UNORDERED_LIST": 6, + "NON_EMPTY_DEFAULT": 7, + "IDENTIFIER": 8 + } + }, + "resourceReference": { + "type": "google.api.ResourceReference", + "id": 1055, + "extend": "google.protobuf.FieldOptions" + }, + "resourceDefinition": { + "rule": "repeated", + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.FileOptions" + }, + "resource": { + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.MessageOptions" + }, + "ResourceDescriptor": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "pattern": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "nameField": { + "type": "string", + "id": 3 + }, + "history": { + "type": "History", + "id": 4 + }, + "plural": { + "type": "string", + "id": 5 + }, + "singular": { + "type": "string", + "id": 6 + }, + "style": { + "rule": "repeated", + "type": "Style", + "id": 10 + } + }, + "nested": { + "History": { + "values": { + "HISTORY_UNSPECIFIED": 0, + "ORIGINALLY_SINGLE_PATTERN": 1, + "FUTURE_MULTI_PATTERN": 2 + } + }, + "Style": { + "values": { + "STYLE_UNSPECIFIED": 0, + "DECLARATIVE_FRIENDLY": 1 + } + } + } + }, + "ResourceReference": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "childType": { + "type": "string", + "id": 2 + } + } + }, + "http": { + "type": "HttpRule", + "id": 72295728, + "extend": "google.protobuf.MethodOptions" + }, + "Http": { + "fields": { + "rules": { + "rule": "repeated", + "type": "HttpRule", + "id": 1 + }, + "fullyDecodeReservedExpansion": { + "type": "bool", + "id": 2 + } + } + }, + "HttpRule": { + "oneofs": { + "pattern": { + "oneof": [ + "get", + "put", + "post", + "delete", + "patch", + "custom" + ] + } + }, + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "get": { + "type": "string", + "id": 2 + }, + "put": { + "type": "string", + "id": 3 + }, + "post": { + "type": "string", + "id": 4 + }, + "delete": { + "type": "string", + "id": 5 + }, + "patch": { + "type": "string", + "id": 6 + }, + "custom": { + "type": "CustomHttpPattern", + "id": 8 + }, + "body": { + "type": "string", + "id": 7 + }, + "responseBody": { + "type": "string", + "id": 12 + }, + "additionalBindings": { + "rule": "repeated", + "type": "HttpRule", + "id": 11 + } + } + }, + "CustomHttpPattern": { + "fields": { + "kind": { + "type": "string", + "id": 1 + }, + "path": { + "type": "string", + "id": 2 + } + } + }, + "methodSignature": { + "rule": "repeated", + "type": "string", + "id": 1051, + "extend": "google.protobuf.MethodOptions" + }, + "defaultHost": { + "type": "string", + "id": 1049, + "extend": "google.protobuf.ServiceOptions" + }, + "oauthScopes": { + "type": "string", + "id": 1050, + "extend": "google.protobuf.ServiceOptions" + }, + "apiVersion": { + "type": "string", + "id": 525000001, + "extend": "google.protobuf.ServiceOptions" + }, + "CommonLanguageSettings": { + "fields": { + "referenceDocsUri": { + "type": "string", + "id": 1, + "options": { + "deprecated": true + } + }, + "destinations": { + "rule": "repeated", + "type": "ClientLibraryDestination", + "id": 2 + } + } + }, + "ClientLibrarySettings": { + "fields": { + "version": { + "type": "string", + "id": 1 + }, + "launchStage": { + "type": "LaunchStage", + "id": 2 + }, + "restNumericEnums": { + "type": "bool", + "id": 3 + }, + "javaSettings": { + "type": "JavaSettings", + "id": 21 + }, + "cppSettings": { + "type": "CppSettings", + "id": 22 + }, + "phpSettings": { + "type": "PhpSettings", + "id": 23 + }, + "pythonSettings": { + "type": "PythonSettings", + "id": 24 + }, + "nodeSettings": { + "type": "NodeSettings", + "id": 25 + }, + "dotnetSettings": { + "type": "DotnetSettings", + "id": 26 + }, + "rubySettings": { + "type": "RubySettings", + "id": 27 + }, + "goSettings": { + "type": "GoSettings", + "id": 28 + } + } + }, + "Publishing": { + "fields": { + "methodSettings": { + "rule": "repeated", + "type": "MethodSettings", + "id": 2 + }, + "newIssueUri": { + "type": "string", + "id": 101 + }, + "documentationUri": { + "type": "string", + "id": 102 + }, + "apiShortName": { + "type": "string", + "id": 103 + }, + "githubLabel": { + "type": "string", + "id": 104 + }, + "codeownerGithubTeams": { + "rule": "repeated", + "type": "string", + "id": 105 + }, + "docTagPrefix": { + "type": "string", + "id": 106 + }, + "organization": { + "type": "ClientLibraryOrganization", + "id": 107 + }, + "librarySettings": { + "rule": "repeated", + "type": "ClientLibrarySettings", + "id": 109 + }, + "protoReferenceDocumentationUri": { + "type": "string", + "id": 110 + }, + "restReferenceDocumentationUri": { + "type": "string", + "id": 111 + } + } + }, + "JavaSettings": { + "fields": { + "libraryPackage": { + "type": "string", + "id": 1 + }, + "serviceClassNames": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "common": { + "type": "CommonLanguageSettings", + "id": 3 + } + } + }, + "CppSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "PhpSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "PythonSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "NodeSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "DotnetSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + }, + "renamedServices": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "renamedResources": { + "keyType": "string", + "type": "string", + "id": 3 + }, + "ignoredResources": { + "rule": "repeated", + "type": "string", + "id": 4 + }, + "forcedNamespaceAliases": { + "rule": "repeated", + "type": "string", + "id": 5 + }, + "handwrittenSignatures": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + }, + "RubySettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "GoSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "MethodSettings": { + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "longRunning": { + "type": "LongRunning", + "id": 2 + }, + "autoPopulatedFields": { + "rule": "repeated", + "type": "string", + "id": 3 + } + }, + "nested": { + "LongRunning": { + "fields": { + "initialPollDelay": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "pollDelayMultiplier": { + "type": "float", + "id": 2 + }, + "maxPollDelay": { + "type": "google.protobuf.Duration", + "id": 3 + }, + "totalPollTimeout": { + "type": "google.protobuf.Duration", + "id": 4 + } + } + } + } + }, + "ClientLibraryOrganization": { + "values": { + "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": 0, + "CLOUD": 1, + "ADS": 2, + "PHOTOS": 3, + "STREET_VIEW": 4, + "SHOPPING": 5, + "GEO": 6, + "GENERATIVE_AI": 7 + } + }, + "ClientLibraryDestination": { + "values": { + "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": 0, + "GITHUB": 10, + "PACKAGE_MANAGER": 20 + } + }, + "LaunchStage": { + "values": { + "LAUNCH_STAGE_UNSPECIFIED": 0, + "UNIMPLEMENTED": 6, + "PRELAUNCH": 7, + "EARLY_ACCESS": 1, + "ALPHA": 2, + "BETA": 3, + "GA": 4, + "DEPRECATED": 5 + } + } + } + }, + "protobuf": { + "options": { + "go_package": "google.golang.org/protobuf/types/descriptorpb", + "java_package": "com.google.protobuf", + "java_outer_classname": "DescriptorProtos", + "csharp_namespace": "Google.Protobuf.Reflection", + "objc_class_prefix": "GPB", + "cc_enable_arenas": true, + "optimize_for": "SPEED" + }, + "nested": { + "FileDescriptorSet": { + "edition": "proto2", + "fields": { + "file": { + "rule": "repeated", + "type": "FileDescriptorProto", + "id": 1 + } + } + }, + "Edition": { + "edition": "proto2", + "values": { + "EDITION_UNKNOWN": 0, + "EDITION_PROTO2": 998, + "EDITION_PROTO3": 999, + "EDITION_2023": 1000, + "EDITION_2024": 1001, + "EDITION_1_TEST_ONLY": 1, + "EDITION_2_TEST_ONLY": 2, + "EDITION_99997_TEST_ONLY": 99997, + "EDITION_99998_TEST_ONLY": 99998, + "EDITION_99999_TEST_ONLY": 99999, + "EDITION_MAX": 2147483647 + } + }, + "FileDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "package": { + "type": "string", + "id": 2 + }, + "dependency": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "publicDependency": { + "rule": "repeated", + "type": "int32", + "id": 10 + }, + "weakDependency": { + "rule": "repeated", + "type": "int32", + "id": 11 + }, + "messageType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 4 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 5 + }, + "service": { + "rule": "repeated", + "type": "ServiceDescriptorProto", + "id": 6 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 7 + }, + "options": { + "type": "FileOptions", + "id": 8 + }, + "sourceCodeInfo": { + "type": "SourceCodeInfo", + "id": 9 + }, + "syntax": { + "type": "string", + "id": 12 + }, + "edition": { + "type": "Edition", + "id": 14 + } + } + }, + "DescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "field": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 2 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 6 + }, + "nestedType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 3 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 4 + }, + "extensionRange": { + "rule": "repeated", + "type": "ExtensionRange", + "id": 5 + }, + "oneofDecl": { + "rule": "repeated", + "type": "OneofDescriptorProto", + "id": 8 + }, + "options": { + "type": "MessageOptions", + "id": 7 + }, + "reservedRange": { + "rule": "repeated", + "type": "ReservedRange", + "id": 9 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 10 + } + }, + "nested": { + "ExtensionRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "ExtensionRangeOptions", + "id": 3 + } + } + }, + "ReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "ExtensionRangeOptions": { + "edition": "proto2", + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + }, + "declaration": { + "rule": "repeated", + "type": "Declaration", + "id": 2, + "options": { + "retention": "RETENTION_SOURCE" + } + }, + "features": { + "type": "FeatureSet", + "id": 50 + }, + "verification": { + "type": "VerificationState", + "id": 3, + "options": { + "default": "UNVERIFIED", + "retention": "RETENTION_SOURCE" + } + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "Declaration": { + "fields": { + "number": { + "type": "int32", + "id": 1 + }, + "fullName": { + "type": "string", + "id": 2 + }, + "type": { + "type": "string", + "id": 3 + }, + "reserved": { + "type": "bool", + "id": 5 + }, + "repeated": { + "type": "bool", + "id": 6 + } + }, + "reserved": [ + [ + 4, + 4 + ] + ] + }, + "VerificationState": { + "values": { + "DECLARATION": 0, + "UNVERIFIED": 1 + } + } + } + }, + "FieldDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 3 + }, + "label": { + "type": "Label", + "id": 4 + }, + "type": { + "type": "Type", + "id": 5 + }, + "typeName": { + "type": "string", + "id": 6 + }, + "extendee": { + "type": "string", + "id": 2 + }, + "defaultValue": { + "type": "string", + "id": 7 + }, + "oneofIndex": { + "type": "int32", + "id": 9 + }, + "jsonName": { + "type": "string", + "id": 10 + }, + "options": { + "type": "FieldOptions", + "id": 8 + }, + "proto3Optional": { + "type": "bool", + "id": 17 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_DOUBLE": 1, + "TYPE_FLOAT": 2, + "TYPE_INT64": 3, + "TYPE_UINT64": 4, + "TYPE_INT32": 5, + "TYPE_FIXED64": 6, + "TYPE_FIXED32": 7, + "TYPE_BOOL": 8, + "TYPE_STRING": 9, + "TYPE_GROUP": 10, + "TYPE_MESSAGE": 11, + "TYPE_BYTES": 12, + "TYPE_UINT32": 13, + "TYPE_ENUM": 14, + "TYPE_SFIXED32": 15, + "TYPE_SFIXED64": 16, + "TYPE_SINT32": 17, + "TYPE_SINT64": 18 + } + }, + "Label": { + "values": { + "LABEL_OPTIONAL": 1, + "LABEL_REPEATED": 3, + "LABEL_REQUIRED": 2 + } + } + } + }, + "OneofDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "options": { + "type": "OneofOptions", + "id": 2 + } + } + }, + "EnumDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "value": { + "rule": "repeated", + "type": "EnumValueDescriptorProto", + "id": 2 + }, + "options": { + "type": "EnumOptions", + "id": 3 + }, + "reservedRange": { + "rule": "repeated", + "type": "EnumReservedRange", + "id": 4 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 5 + } + }, + "nested": { + "EnumReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "EnumValueDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "EnumValueOptions", + "id": 3 + } + } + }, + "ServiceDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "method": { + "rule": "repeated", + "type": "MethodDescriptorProto", + "id": 2 + }, + "options": { + "type": "ServiceOptions", + "id": 3 + } + } + }, + "MethodDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "inputType": { + "type": "string", + "id": 2 + }, + "outputType": { + "type": "string", + "id": 3 + }, + "options": { + "type": "MethodOptions", + "id": 4 + }, + "clientStreaming": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "serverStreaming": { + "type": "bool", + "id": 6, + "options": { + "default": false + } + } + } + }, + "FileOptions": { + "edition": "proto2", + "fields": { + "javaPackage": { + "type": "string", + "id": 1 + }, + "javaOuterClassname": { + "type": "string", + "id": 8 + }, + "javaMultipleFiles": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "javaGenerateEqualsAndHash": { + "type": "bool", + "id": 20, + "options": { + "deprecated": true + } + }, + "javaStringCheckUtf8": { + "type": "bool", + "id": 27, + "options": { + "default": false + } + }, + "optimizeFor": { + "type": "OptimizeMode", + "id": 9, + "options": { + "default": "SPEED" + } + }, + "goPackage": { + "type": "string", + "id": 11 + }, + "ccGenericServices": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "javaGenericServices": { + "type": "bool", + "id": 17, + "options": { + "default": false + } + }, + "pyGenericServices": { + "type": "bool", + "id": 18, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 23, + "options": { + "default": false + } + }, + "ccEnableArenas": { + "type": "bool", + "id": 31, + "options": { + "default": true + } + }, + "objcClassPrefix": { + "type": "string", + "id": 36 + }, + "csharpNamespace": { + "type": "string", + "id": 37 + }, + "swiftPrefix": { + "type": "string", + "id": 39 + }, + "phpClassPrefix": { + "type": "string", + "id": 40 + }, + "phpNamespace": { + "type": "string", + "id": 41 + }, + "phpMetadataNamespace": { + "type": "string", + "id": 44 + }, + "rubyPackage": { + "type": "string", + "id": 45 + }, + "features": { + "type": "FeatureSet", + "id": 50 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 42, + 42 + ], + [ + 38, + 38 + ] + ], + "nested": { + "OptimizeMode": { + "values": { + "SPEED": 1, + "CODE_SIZE": 2, + "LITE_RUNTIME": 3 + } + } + } + }, + "MessageOptions": { + "edition": "proto2", + "fields": { + "messageSetWireFormat": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "noStandardDescriptorAccessor": { + "type": "bool", + "id": 2, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "mapEntry": { + "type": "bool", + "id": 7 + }, + "deprecatedLegacyJsonFieldConflicts": { + "type": "bool", + "id": 11, + "options": { + "deprecated": true + } + }, + "features": { + "type": "FeatureSet", + "id": 12 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ], + [ + 5, + 5 + ], + [ + 6, + 6 + ], + [ + 8, + 8 + ], + [ + 9, + 9 + ] + ] + }, + "FieldOptions": { + "edition": "proto2", + "fields": { + "ctype": { + "type": "CType", + "id": 1, + "options": { + "default": "STRING" + } + }, + "packed": { + "type": "bool", + "id": 2 + }, + "jstype": { + "type": "JSType", + "id": 6, + "options": { + "default": "JS_NORMAL" + } + }, + "lazy": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "unverifiedLazy": { + "type": "bool", + "id": 15, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "weak": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "debugRedact": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "retention": { + "type": "OptionRetention", + "id": 17 + }, + "targets": { + "rule": "repeated", + "type": "OptionTargetType", + "id": 19 + }, + "editionDefaults": { + "rule": "repeated", + "type": "EditionDefault", + "id": 20 + }, + "features": { + "type": "FeatureSet", + "id": 21 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ], + [ + 18, + 18 + ] + ], + "nested": { + "CType": { + "values": { + "STRING": 0, + "CORD": 1, + "STRING_PIECE": 2 + } + }, + "JSType": { + "values": { + "JS_NORMAL": 0, + "JS_STRING": 1, + "JS_NUMBER": 2 + } + }, + "OptionRetention": { + "values": { + "RETENTION_UNKNOWN": 0, + "RETENTION_RUNTIME": 1, + "RETENTION_SOURCE": 2 + } + }, + "OptionTargetType": { + "values": { + "TARGET_TYPE_UNKNOWN": 0, + "TARGET_TYPE_FILE": 1, + "TARGET_TYPE_EXTENSION_RANGE": 2, + "TARGET_TYPE_MESSAGE": 3, + "TARGET_TYPE_FIELD": 4, + "TARGET_TYPE_ONEOF": 5, + "TARGET_TYPE_ENUM": 6, + "TARGET_TYPE_ENUM_ENTRY": 7, + "TARGET_TYPE_SERVICE": 8, + "TARGET_TYPE_METHOD": 9 + } + }, + "EditionDefault": { + "fields": { + "edition": { + "type": "Edition", + "id": 3 + }, + "value": { + "type": "string", + "id": 2 + } + } + } + } + }, + "OneofOptions": { + "edition": "proto2", + "fields": { + "features": { + "type": "FeatureSet", + "id": 1 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "EnumOptions": { + "edition": "proto2", + "fields": { + "allowAlias": { + "type": "bool", + "id": 2 + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "deprecatedLegacyJsonFieldConflicts": { + "type": "bool", + "id": 6, + "options": { + "deprecated": true + } + }, + "features": { + "type": "FeatureSet", + "id": 7 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 5, + 5 + ] + ] + }, + "EnumValueOptions": { + "edition": "proto2", + "fields": { + "deprecated": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "features": { + "type": "FeatureSet", + "id": 2 + }, + "debugRedact": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "edition": "proto2", + "fields": { + "features": { + "type": "FeatureSet", + "id": 34 + }, + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "MethodOptions": { + "edition": "proto2", + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "idempotencyLevel": { + "type": "IdempotencyLevel", + "id": 34, + "options": { + "default": "IDEMPOTENCY_UNKNOWN" + } + }, + "features": { + "type": "FeatureSet", + "id": 35 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "IdempotencyLevel": { + "values": { + "IDEMPOTENCY_UNKNOWN": 0, + "NO_SIDE_EFFECTS": 1, + "IDEMPOTENT": 2 + } + } + } + }, + "UninterpretedOption": { + "edition": "proto2", + "fields": { + "name": { + "rule": "repeated", + "type": "NamePart", + "id": 2 + }, + "identifierValue": { + "type": "string", + "id": 3 + }, + "positiveIntValue": { + "type": "uint64", + "id": 4 + }, + "negativeIntValue": { + "type": "int64", + "id": 5 + }, + "doubleValue": { + "type": "double", + "id": 6 + }, + "stringValue": { + "type": "bytes", + "id": 7 + }, + "aggregateValue": { + "type": "string", + "id": 8 + } + }, + "nested": { + "NamePart": { + "fields": { + "namePart": { + "rule": "required", + "type": "string", + "id": 1 + }, + "isExtension": { + "rule": "required", + "type": "bool", + "id": 2 + } + } + } + } + }, + "FeatureSet": { + "edition": "proto2", + "fields": { + "fieldPresence": { + "type": "FieldPresence", + "id": 1, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_2023", + "edition_defaults.value": "EXPLICIT" + } + }, + "enumType": { + "type": "EnumType", + "id": 2, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "OPEN" + } + }, + "repeatedFieldEncoding": { + "type": "RepeatedFieldEncoding", + "id": 3, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "PACKED" + } + }, + "utf8Validation": { + "type": "Utf8Validation", + "id": 4, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "VERIFY" + } + }, + "messageEncoding": { + "type": "MessageEncoding", + "id": 5, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO2", + "edition_defaults.value": "LENGTH_PREFIXED" + } + }, + "jsonFormat": { + "type": "JsonFormat", + "id": 6, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "ALLOW" + } + } + }, + "extensions": [ + [ + 1000, + 1000 + ], + [ + 1001, + 1001 + ], + [ + 1002, + 1002 + ], + [ + 9990, + 9990 + ], + [ + 9995, + 9999 + ], + [ + 10000, + 10000 + ] + ], + "reserved": [ + [ + 999, + 999 + ] + ], + "nested": { + "FieldPresence": { + "values": { + "FIELD_PRESENCE_UNKNOWN": 0, + "EXPLICIT": 1, + "IMPLICIT": 2, + "LEGACY_REQUIRED": 3 + } + }, + "EnumType": { + "values": { + "ENUM_TYPE_UNKNOWN": 0, + "OPEN": 1, + "CLOSED": 2 + } + }, + "RepeatedFieldEncoding": { + "values": { + "REPEATED_FIELD_ENCODING_UNKNOWN": 0, + "PACKED": 1, + "EXPANDED": 2 + } + }, + "Utf8Validation": { + "values": { + "UTF8_VALIDATION_UNKNOWN": 0, + "VERIFY": 2, + "NONE": 3 + } + }, + "MessageEncoding": { + "values": { + "MESSAGE_ENCODING_UNKNOWN": 0, + "LENGTH_PREFIXED": 1, + "DELIMITED": 2 + } + }, + "JsonFormat": { + "values": { + "JSON_FORMAT_UNKNOWN": 0, + "ALLOW": 1, + "LEGACY_BEST_EFFORT": 2 + } + } + } + }, + "FeatureSetDefaults": { + "edition": "proto2", + "fields": { + "defaults": { + "rule": "repeated", + "type": "FeatureSetEditionDefault", + "id": 1 + }, + "minimumEdition": { + "type": "Edition", + "id": 4 + }, + "maximumEdition": { + "type": "Edition", + "id": 5 + } + }, + "nested": { + "FeatureSetEditionDefault": { + "fields": { + "edition": { + "type": "Edition", + "id": 3 + }, + "features": { + "type": "FeatureSet", + "id": 2 + } + } + } + } + }, + "SourceCodeInfo": { + "edition": "proto2", + "fields": { + "location": { + "rule": "repeated", + "type": "Location", + "id": 1 + } + }, + "nested": { + "Location": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1, + "options": { + "packed": true + } + }, + "span": { + "rule": "repeated", + "type": "int32", + "id": 2, + "options": { + "packed": true + } + }, + "leadingComments": { + "type": "string", + "id": 3 + }, + "trailingComments": { + "type": "string", + "id": 4 + }, + "leadingDetachedComments": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + } + } + }, + "GeneratedCodeInfo": { + "edition": "proto2", + "fields": { + "annotation": { + "rule": "repeated", + "type": "Annotation", + "id": 1 + } + }, + "nested": { + "Annotation": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1, + "options": { + "packed": true + } + }, + "sourceFile": { + "type": "string", + "id": 2 + }, + "begin": { + "type": "int32", + "id": 3 + }, + "end": { + "type": "int32", + "id": 4 + }, + "semantic": { + "type": "Semantic", + "id": 5 + } + }, + "nested": { + "Semantic": { + "values": { + "NONE": 0, + "SET": 1, + "ALIAS": 2 + } + } + } + } + } + }, + "Duration": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Any": { + "fields": { + "type_url": { + "type": "string", + "id": 1 + }, + "value": { + "type": "bytes", + "id": 2 + } + } + }, + "Empty": { + "fields": {} + }, + "FieldMask": { + "fields": { + "paths": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "Timestamp": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Struct": { + "fields": { + "fields": { + "keyType": "string", + "type": "Value", + "id": 1 + } + } + }, + "Value": { + "oneofs": { + "kind": { + "oneof": [ + "nullValue", + "numberValue", + "stringValue", + "boolValue", + "structValue", + "listValue" + ] + } + }, + "fields": { + "nullValue": { + "type": "NullValue", + "id": 1 + }, + "numberValue": { + "type": "double", + "id": 2 + }, + "stringValue": { + "type": "string", + "id": 3 + }, + "boolValue": { + "type": "bool", + "id": 4 + }, + "structValue": { + "type": "Struct", + "id": 5 + }, + "listValue": { + "type": "ListValue", + "id": 6 + } + } + }, + "NullValue": { + "values": { + "NULL_VALUE": 0 + } + }, + "ListValue": { + "fields": { + "values": { + "rule": "repeated", + "type": "Value", + "id": 1 + } + } + } + } + }, + "longrunning": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.LongRunning", + "go_package": "cloud.google.com/go/longrunning/autogen/longrunningpb;longrunningpb", + "java_multiple_files": true, + "java_outer_classname": "OperationsProto", + "java_package": "com.google.longrunning", + "php_namespace": "Google\\LongRunning" + }, + "nested": { + "operationInfo": { + "type": "google.longrunning.OperationInfo", + "id": 1049, + "extend": "google.protobuf.MethodOptions" + }, + "Operations": { + "options": { + "(google.api.default_host)": "longrunning.googleapis.com" + }, + "methods": { + "ListOperations": { + "requestType": "ListOperationsRequest", + "responseType": "ListOperationsResponse", + "options": { + "(google.api.http).get": "/v1/{name=operations}", + "(google.api.method_signature)": "name,filter" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations}" + } + }, + { + "(google.api.method_signature)": "name,filter" + } + ] + }, + "GetOperation": { + "requestType": "GetOperationRequest", + "responseType": "Operation", + "options": { + "(google.api.http).get": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "DeleteOperation": { + "requestType": "DeleteOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CancelOperation": { + "requestType": "CancelOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).post": "/v1/{name=operations/**}:cancel", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=operations/**}:cancel", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "WaitOperation": { + "requestType": "WaitOperationRequest", + "responseType": "Operation" + } + } + }, + "Operation": { + "oneofs": { + "result": { + "oneof": [ + "error", + "response" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "metadata": { + "type": "google.protobuf.Any", + "id": 2 + }, + "done": { + "type": "bool", + "id": 3 + }, + "error": { + "type": "google.rpc.Status", + "id": 4 + }, + "response": { + "type": "google.protobuf.Any", + "id": 5 + } + } + }, + "GetOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "ListOperationsRequest": { + "fields": { + "name": { + "type": "string", + "id": 4 + }, + "filter": { + "type": "string", + "id": 1 + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListOperationsResponse": { + "fields": { + "operations": { + "rule": "repeated", + "type": "Operation", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CancelOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "DeleteOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "WaitOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "timeout": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + }, + "OperationInfo": { + "fields": { + "responseType": { + "type": "string", + "id": 1 + }, + "metadataType": { + "type": "string", + "id": 2 + } + } + } + } + }, + "rpc": { + "options": { + "cc_enable_arenas": true, + "go_package": "google.golang.org/genproto/googleapis/rpc/status;status", + "java_multiple_files": true, + "java_outer_classname": "StatusProto", + "java_package": "com.google.rpc", + "objc_class_prefix": "RPC" + }, + "nested": { + "Status": { + "fields": { + "code": { + "type": "int32", + "id": 1 + }, + "message": { + "type": "string", + "id": 2 + }, + "details": { + "rule": "repeated", + "type": "google.protobuf.Any", + "id": 3 + } + } + } + } + }, + "iam": { + "nested": { + "v1": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.Cloud.Iam.V1", + "go_package": "cloud.google.com/go/iam/apiv1/iampb;iampb", + "java_multiple_files": true, + "java_outer_classname": "PolicyProto", + "java_package": "com.google.iam.v1", + "php_namespace": "Google\\Cloud\\Iam\\V1" + }, + "nested": { + "IAMPolicy": { + "options": { + "(google.api.default_host)": "iam-meta-api.googleapis.com" + }, + "methods": { + "SetIamPolicy": { + "requestType": "SetIamPolicyRequest", + "responseType": "Policy", + "options": { + "(google.api.http).post": "/v1/{resource=**}:setIamPolicy", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{resource=**}:setIamPolicy", + "body": "*" + } + } + ] + }, + "GetIamPolicy": { + "requestType": "GetIamPolicyRequest", + "responseType": "Policy", + "options": { + "(google.api.http).post": "/v1/{resource=**}:getIamPolicy", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{resource=**}:getIamPolicy", + "body": "*" + } + } + ] + }, + "TestIamPermissions": { + "requestType": "TestIamPermissionsRequest", + "responseType": "TestIamPermissionsResponse", + "options": { + "(google.api.http).post": "/v1/{resource=**}:testIamPermissions", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{resource=**}:testIamPermissions", + "body": "*" + } + } + ] + } + } + }, + "SetIamPolicyRequest": { + "fields": { + "resource": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "*" + } + }, + "policy": { + "type": "Policy", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 3 + } + } + }, + "GetIamPolicyRequest": { + "fields": { + "resource": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "*" + } + }, + "options": { + "type": "GetPolicyOptions", + "id": 2 + } + } + }, + "TestIamPermissionsRequest": { + "fields": { + "resource": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "*" + } + }, + "permissions": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "TestIamPermissionsResponse": { + "fields": { + "permissions": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "GetPolicyOptions": { + "fields": { + "requestedPolicyVersion": { + "type": "int32", + "id": 1 + } + } + }, + "Policy": { + "fields": { + "version": { + "type": "int32", + "id": 1 + }, + "bindings": { + "rule": "repeated", + "type": "Binding", + "id": 4 + }, + "auditConfigs": { + "rule": "repeated", + "type": "AuditConfig", + "id": 6 + }, + "etag": { + "type": "bytes", + "id": 3 + } + } + }, + "Binding": { + "fields": { + "role": { + "type": "string", + "id": 1 + }, + "members": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "condition": { + "type": "google.type.Expr", + "id": 3 + } + } + }, + "AuditConfig": { + "fields": { + "service": { + "type": "string", + "id": 1 + }, + "auditLogConfigs": { + "rule": "repeated", + "type": "AuditLogConfig", + "id": 3 + } + } + }, + "AuditLogConfig": { + "fields": { + "logType": { + "type": "LogType", + "id": 1 + }, + "exemptedMembers": { + "rule": "repeated", + "type": "string", + "id": 2 + } + }, + "nested": { + "LogType": { + "values": { + "LOG_TYPE_UNSPECIFIED": 0, + "ADMIN_READ": 1, + "DATA_WRITE": 2, + "DATA_READ": 3 + } + } + } + }, + "PolicyDelta": { + "fields": { + "bindingDeltas": { + "rule": "repeated", + "type": "BindingDelta", + "id": 1 + }, + "auditConfigDeltas": { + "rule": "repeated", + "type": "AuditConfigDelta", + "id": 2 + } + } + }, + "BindingDelta": { + "fields": { + "action": { + "type": "Action", + "id": 1 + }, + "role": { + "type": "string", + "id": 2 + }, + "member": { + "type": "string", + "id": 3 + }, + "condition": { + "type": "google.type.Expr", + "id": 4 + } + }, + "nested": { + "Action": { + "values": { + "ACTION_UNSPECIFIED": 0, + "ADD": 1, + "REMOVE": 2 + } + } + } + }, + "AuditConfigDelta": { + "fields": { + "action": { + "type": "Action", + "id": 1 + }, + "service": { + "type": "string", + "id": 2 + }, + "exemptedMember": { + "type": "string", + "id": 3 + }, + "logType": { + "type": "string", + "id": 4 + } + }, + "nested": { + "Action": { + "values": { + "ACTION_UNSPECIFIED": 0, + "ADD": 1, + "REMOVE": 2 + } + } + } + } + } + } + } + }, + "type": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/type/expr;expr", + "java_multiple_files": true, + "java_outer_classname": "ExprProto", + "java_package": "com.google.type", + "objc_class_prefix": "GTP" + }, + "nested": { + "Expr": { + "fields": { + "expression": { + "type": "string", + "id": 1 + }, + "title": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + }, + "location": { + "type": "string", + "id": 4 + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/owl-bot-staging/admin/database/v1/src/index.ts b/owl-bot-staging/admin/database/v1/src/index.ts new file mode 100644 index 000000000..20347cf74 --- /dev/null +++ b/owl-bot-staging/admin/database/v1/src/index.ts @@ -0,0 +1,25 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as v1 from './v1'; +const DatabaseAdminClient = v1.DatabaseAdminClient; +type DatabaseAdminClient = v1.DatabaseAdminClient; +export {v1, DatabaseAdminClient}; +export default {v1, DatabaseAdminClient}; +import * as protos from '../protos/protos'; +export {protos} diff --git a/owl-bot-staging/admin/database/v1/src/v1/database_admin_client.ts b/owl-bot-staging/admin/database/v1/src/v1/database_admin_client.ts new file mode 100644 index 000000000..bbc6b09d5 --- /dev/null +++ b/owl-bot-staging/admin/database/v1/src/v1/database_admin_client.ts @@ -0,0 +1,5071 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v1/database_admin_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './database_admin_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Cloud Spanner Database Admin API + * + * The Cloud Spanner Database Admin API can be used to: + * * create, drop, and list databases + * * update the schema of pre-existing databases + * * create, delete, copy and list backups for a database + * * restore a database from an existing backup + * @class + * @memberof v1 + */ +export class DatabaseAdminClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('spanner'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + databaseAdminStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of DatabaseAdminClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new DatabaseAdminClient({fallback: true}, gax); + * ``` + */ + constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof DatabaseAdminClient; + if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { + throw new Error('Please set either universe_domain or universeDomain, but not both.'); + } + const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; + this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; + this._servicePath = 'spanner.' + this._universeDomain; + const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== this._servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process === 'object' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + backupPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/instances/{instance}/backups/{backup}' + ), + backupSchedulePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/instances/{instance}/databases/{database}/backupSchedules/{schedule}' + ), + cryptoKeyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}' + ), + databasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/instances/{instance}/databases/{database}' + ), + databaseRolePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/instances/{instance}/databases/{database}/databaseRoles/{role}' + ), + instancePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/instances/{instance}' + ), + }; + + // 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 = { + listDatabases: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'databases'), + listBackups: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'backups'), + listDatabaseOperations: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'operations'), + listBackupOperations: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'operations'), + listDatabaseRoles: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'databaseRoles'), + listBackupSchedules: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'backupSchedules') + }; + + const protoFilesRoot = this._gaxModule.protobufFromJSON(jsonProtos); + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }; + if (opts.fallback) { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [{selector: 'google.longrunning.Operations.CancelOperation',post: '/v1/{name=projects/*/instances/*/databases/*/operations/*}:cancel',additional_bindings: [{post: '/v1/{name=projects/*/instances/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/instances/*/backups/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/instanceConfigs/*/operations/*}:cancel',}], + },{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/v1/{name=projects/*/instances/*/databases/*/operations/*}',additional_bindings: [{delete: '/v1/{name=projects/*/instances/*/operations/*}',},{delete: '/v1/{name=projects/*/instances/*/backups/*/operations/*}',},{delete: '/v1/{name=projects/*/instanceConfigs/*/operations/*}',}], + },{selector: 'google.longrunning.Operations.GetOperation',get: '/v1/{name=projects/*/instances/*/databases/*/operations/*}',additional_bindings: [{get: '/v1/{name=projects/*/instances/*/operations/*}',},{get: '/v1/{name=projects/*/instances/*/backups/*/operations/*}',},{get: '/v1/{name=projects/*/instanceConfigs/*/operations/*}',}], + },{selector: 'google.longrunning.Operations.ListOperations',get: '/v1/{name=projects/*/instances/*/databases/*/operations}',additional_bindings: [{get: '/v1/{name=projects/*/instances/*/operations}',},{get: '/v1/{name=projects/*/instances/*/backups/*/operations}',},{get: '/v1/{name=projects/*/instanceConfigs/*/operations}',}], + }]; + } + this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); + const createDatabaseResponse = protoFilesRoot.lookup( + '.google.spanner.admin.database.v1.Database') as gax.protobuf.Type; + const createDatabaseMetadata = protoFilesRoot.lookup( + '.google.spanner.admin.database.v1.CreateDatabaseMetadata') as gax.protobuf.Type; + const updateDatabaseResponse = protoFilesRoot.lookup( + '.google.spanner.admin.database.v1.Database') as gax.protobuf.Type; + const updateDatabaseMetadata = protoFilesRoot.lookup( + '.google.spanner.admin.database.v1.UpdateDatabaseMetadata') as gax.protobuf.Type; + const updateDatabaseDdlResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const updateDatabaseDdlMetadata = protoFilesRoot.lookup( + '.google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata') as gax.protobuf.Type; + const createBackupResponse = protoFilesRoot.lookup( + '.google.spanner.admin.database.v1.Backup') as gax.protobuf.Type; + const createBackupMetadata = protoFilesRoot.lookup( + '.google.spanner.admin.database.v1.CreateBackupMetadata') as gax.protobuf.Type; + const copyBackupResponse = protoFilesRoot.lookup( + '.google.spanner.admin.database.v1.Backup') as gax.protobuf.Type; + const copyBackupMetadata = protoFilesRoot.lookup( + '.google.spanner.admin.database.v1.CopyBackupMetadata') as gax.protobuf.Type; + const restoreDatabaseResponse = protoFilesRoot.lookup( + '.google.spanner.admin.database.v1.Database') as gax.protobuf.Type; + const restoreDatabaseMetadata = protoFilesRoot.lookup( + '.google.spanner.admin.database.v1.RestoreDatabaseMetadata') as gax.protobuf.Type; + + this.descriptors.longrunning = { + createDatabase: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createDatabaseResponse.decode.bind(createDatabaseResponse), + createDatabaseMetadata.decode.bind(createDatabaseMetadata)), + updateDatabase: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateDatabaseResponse.decode.bind(updateDatabaseResponse), + updateDatabaseMetadata.decode.bind(updateDatabaseMetadata)), + updateDatabaseDdl: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateDatabaseDdlResponse.decode.bind(updateDatabaseDdlResponse), + updateDatabaseDdlMetadata.decode.bind(updateDatabaseDdlMetadata)), + createBackup: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createBackupResponse.decode.bind(createBackupResponse), + createBackupMetadata.decode.bind(createBackupMetadata)), + copyBackup: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + copyBackupResponse.decode.bind(copyBackupResponse), + copyBackupMetadata.decode.bind(copyBackupMetadata)), + restoreDatabase: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + restoreDatabaseResponse.decode.bind(restoreDatabaseResponse), + restoreDatabaseMetadata.decode.bind(restoreDatabaseMetadata)) + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.spanner.admin.database.v1.DatabaseAdmin', gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.databaseAdminStub) { + return this.databaseAdminStub; + } + + // Put together the "service stub" for + // google.spanner.admin.database.v1.DatabaseAdmin. + this.databaseAdminStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.spanner.admin.database.v1.DatabaseAdmin') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.spanner.admin.database.v1.DatabaseAdmin, + this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const databaseAdminStubMethods = + ['listDatabases', 'createDatabase', 'getDatabase', 'updateDatabase', 'updateDatabaseDdl', 'dropDatabase', 'getDatabaseDdl', 'setIamPolicy', 'getIamPolicy', 'testIamPermissions', 'createBackup', 'copyBackup', 'getBackup', 'updateBackup', 'deleteBackup', 'listBackups', 'restoreDatabase', 'listDatabaseOperations', 'listBackupOperations', 'listDatabaseRoles', 'addSplitPoints', 'createBackupSchedule', 'getBackupSchedule', 'updateBackupSchedule', 'deleteBackupSchedule', 'listBackupSchedules', 'internalUpdateGraphOperation']; + for (const methodName of databaseAdminStubMethods) { + const callPromise = this.databaseAdminStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.databaseAdminStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'spanner.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'spanner.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/spanner.admin' + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- +/** + * Gets the state of a Cloud Spanner database. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the requested database. Values are of the form + * `projects//instances//databases/`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.spanner.admin.database.v1.Database|Database}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + */ + getDatabase( + request?: protos.google.spanner.admin.database.v1.IGetDatabaseRequest, + options?: CallOptions): + Promise<[ + protos.google.spanner.admin.database.v1.IDatabase, + protos.google.spanner.admin.database.v1.IGetDatabaseRequest|undefined, {}|undefined + ]>; + getDatabase( + request: protos.google.spanner.admin.database.v1.IGetDatabaseRequest, + options: CallOptions, + callback: Callback< + protos.google.spanner.admin.database.v1.IDatabase, + protos.google.spanner.admin.database.v1.IGetDatabaseRequest|null|undefined, + {}|null|undefined>): void; + getDatabase( + request: protos.google.spanner.admin.database.v1.IGetDatabaseRequest, + callback: Callback< + protos.google.spanner.admin.database.v1.IDatabase, + protos.google.spanner.admin.database.v1.IGetDatabaseRequest|null|undefined, + {}|null|undefined>): void; + getDatabase( + request?: protos.google.spanner.admin.database.v1.IGetDatabaseRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.spanner.admin.database.v1.IDatabase, + protos.google.spanner.admin.database.v1.IGetDatabaseRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.spanner.admin.database.v1.IDatabase, + protos.google.spanner.admin.database.v1.IGetDatabaseRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.spanner.admin.database.v1.IDatabase, + protos.google.spanner.admin.database.v1.IGetDatabaseRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getDatabase request %j', request); + const wrappedCallback: Callback< + protos.google.spanner.admin.database.v1.IDatabase, + protos.google.spanner.admin.database.v1.IGetDatabaseRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getDatabase response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getDatabase(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.spanner.admin.database.v1.IDatabase, + protos.google.spanner.admin.database.v1.IGetDatabaseRequest|undefined, + {}|undefined + ]) => { + this._log.info('getDatabase response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Drops (aka deletes) a Cloud Spanner database. + * Completed backups for the database will be retained according to their + * `expire_time`. + * Note: Cloud Spanner might continue to accept requests for a few seconds + * after the database has been deleted. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.database + * Required. The database to be dropped. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + */ + dropDatabase( + request?: protos.google.spanner.admin.database.v1.IDropDatabaseRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.spanner.admin.database.v1.IDropDatabaseRequest|undefined, {}|undefined + ]>; + dropDatabase( + request: protos.google.spanner.admin.database.v1.IDropDatabaseRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.spanner.admin.database.v1.IDropDatabaseRequest|null|undefined, + {}|null|undefined>): void; + dropDatabase( + request: protos.google.spanner.admin.database.v1.IDropDatabaseRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.spanner.admin.database.v1.IDropDatabaseRequest|null|undefined, + {}|null|undefined>): void; + dropDatabase( + request?: protos.google.spanner.admin.database.v1.IDropDatabaseRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.spanner.admin.database.v1.IDropDatabaseRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.spanner.admin.database.v1.IDropDatabaseRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.spanner.admin.database.v1.IDropDatabaseRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'database': request.database ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('dropDatabase request %j', request); + const wrappedCallback: Callback< + protos.google.protobuf.IEmpty, + protos.google.spanner.admin.database.v1.IDropDatabaseRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('dropDatabase response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.dropDatabase(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.spanner.admin.database.v1.IDropDatabaseRequest|undefined, + {}|undefined + ]) => { + this._log.info('dropDatabase response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Returns the schema of a Cloud Spanner database as a list of formatted + * DDL statements. This method does not show pending schema updates, those may + * be queried using the {@link protos.google.longrunning.Operations|Operations} API. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.database + * Required. The database whose schema we wish to get. + * Values are of the form + * `projects//instances//databases/` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.spanner.admin.database.v1.GetDatabaseDdlResponse|GetDatabaseDdlResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + */ + getDatabaseDdl( + request?: protos.google.spanner.admin.database.v1.IGetDatabaseDdlRequest, + options?: CallOptions): + Promise<[ + protos.google.spanner.admin.database.v1.IGetDatabaseDdlResponse, + protos.google.spanner.admin.database.v1.IGetDatabaseDdlRequest|undefined, {}|undefined + ]>; + getDatabaseDdl( + request: protos.google.spanner.admin.database.v1.IGetDatabaseDdlRequest, + options: CallOptions, + callback: Callback< + protos.google.spanner.admin.database.v1.IGetDatabaseDdlResponse, + protos.google.spanner.admin.database.v1.IGetDatabaseDdlRequest|null|undefined, + {}|null|undefined>): void; + getDatabaseDdl( + request: protos.google.spanner.admin.database.v1.IGetDatabaseDdlRequest, + callback: Callback< + protos.google.spanner.admin.database.v1.IGetDatabaseDdlResponse, + protos.google.spanner.admin.database.v1.IGetDatabaseDdlRequest|null|undefined, + {}|null|undefined>): void; + getDatabaseDdl( + request?: protos.google.spanner.admin.database.v1.IGetDatabaseDdlRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.spanner.admin.database.v1.IGetDatabaseDdlResponse, + protos.google.spanner.admin.database.v1.IGetDatabaseDdlRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.spanner.admin.database.v1.IGetDatabaseDdlResponse, + protos.google.spanner.admin.database.v1.IGetDatabaseDdlRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.spanner.admin.database.v1.IGetDatabaseDdlResponse, + protos.google.spanner.admin.database.v1.IGetDatabaseDdlRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'database': request.database ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getDatabaseDdl request %j', request); + const wrappedCallback: Callback< + protos.google.spanner.admin.database.v1.IGetDatabaseDdlResponse, + protos.google.spanner.admin.database.v1.IGetDatabaseDdlRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getDatabaseDdl response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getDatabaseDdl(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.spanner.admin.database.v1.IGetDatabaseDdlResponse, + protos.google.spanner.admin.database.v1.IGetDatabaseDdlRequest|undefined, + {}|undefined + ]) => { + this._log.info('getDatabaseDdl response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Sets the access control policy on a database or backup resource. + * Replaces any existing policy. + * + * Authorization requires `spanner.databases.setIamPolicy` + * permission on {@link protos.google.iam.v1.SetIamPolicyRequest.resource|resource}. + * For backups, authorization requires `spanner.backups.setIamPolicy` + * permission on {@link protos.google.iam.v1.SetIamPolicyRequest.resource|resource}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being specified. + * See the operation documentation for the appropriate value for this field. + * @param {google.iam.v1.Policy} request.policy + * REQUIRED: The complete policy to be applied to the `resource`. The size of + * the policy is limited to a few 10s of KB. An empty policy is a + * valid policy but certain Cloud Platform services (such as Projects) + * might reject them. + * @param {google.protobuf.FieldMask} request.updateMask + * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + * the fields in the mask will be modified. If no mask is provided, the + * following default mask is used: + * + * `paths: "bindings, etag"` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.iam.v1.Policy|Policy}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + */ + setIamPolicy( + request?: protos.google.iam.v1.ISetIamPolicyRequest, + options?: CallOptions): + Promise<[ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest|undefined, {}|undefined + ]>; + setIamPolicy( + request: protos.google.iam.v1.ISetIamPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, + {}|null|undefined>): void; + setIamPolicy( + request: protos.google.iam.v1.ISetIamPolicyRequest, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, + {}|null|undefined>): void; + setIamPolicy( + request?: protos.google.iam.v1.ISetIamPolicyRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'resource': request.resource ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('setIamPolicy request %j', request); + const wrappedCallback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('setIamPolicy response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.setIamPolicy(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest|undefined, + {}|undefined + ]) => { + this._log.info('setIamPolicy response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Gets the access control policy for a database or backup resource. + * Returns an empty policy if a database or backup exists but does not have a + * policy set. + * + * Authorization requires `spanner.databases.getIamPolicy` permission on + * {@link protos.google.iam.v1.GetIamPolicyRequest.resource|resource}. + * For backups, authorization requires `spanner.backups.getIamPolicy` + * permission on {@link protos.google.iam.v1.GetIamPolicyRequest.resource|resource}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {google.iam.v1.GetPolicyOptions} request.options + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.iam.v1.Policy|Policy}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + */ + getIamPolicy( + request?: protos.google.iam.v1.IGetIamPolicyRequest, + options?: CallOptions): + Promise<[ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest|undefined, {}|undefined + ]>; + getIamPolicy( + request: protos.google.iam.v1.IGetIamPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, + {}|null|undefined>): void; + getIamPolicy( + request: protos.google.iam.v1.IGetIamPolicyRequest, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, + {}|null|undefined>): void; + getIamPolicy( + request?: protos.google.iam.v1.IGetIamPolicyRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'resource': request.resource ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getIamPolicy request %j', request); + const wrappedCallback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getIamPolicy response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getIamPolicy(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest|undefined, + {}|undefined + ]) => { + this._log.info('getIamPolicy response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Returns permissions that the caller has on the specified database or backup + * resource. + * + * Attempting this RPC on a non-existent Cloud Spanner database will + * result in a NOT_FOUND error if the user has + * `spanner.databases.list` permission on the containing Cloud + * Spanner instance. Otherwise returns an empty set of permissions. + * Calling this method on a backup that does not exist will + * result in a NOT_FOUND error if the user has + * `spanner.backups.list` permission on the containing instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.iam.v1.TestIamPermissionsResponse|TestIamPermissionsResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + */ + testIamPermissions( + request?: protos.google.iam.v1.ITestIamPermissionsRequest, + options?: CallOptions): + Promise<[ + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest|undefined, {}|undefined + ]>; + testIamPermissions( + request: protos.google.iam.v1.ITestIamPermissionsRequest, + options: CallOptions, + callback: Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, + {}|null|undefined>): void; + testIamPermissions( + request: protos.google.iam.v1.ITestIamPermissionsRequest, + callback: Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, + {}|null|undefined>): void; + testIamPermissions( + request?: protos.google.iam.v1.ITestIamPermissionsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'resource': request.resource ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('testIamPermissions request %j', request); + const wrappedCallback: Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('testIamPermissions response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.testIamPermissions(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest|undefined, + {}|undefined + ]) => { + this._log.info('testIamPermissions response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Gets metadata on a pending or completed + * {@link protos.google.spanner.admin.database.v1.Backup|Backup}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the backup. + * Values are of the form + * `projects//instances//backups/`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.spanner.admin.database.v1.Backup|Backup}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + */ + getBackup( + request?: protos.google.spanner.admin.database.v1.IGetBackupRequest, + options?: CallOptions): + Promise<[ + protos.google.spanner.admin.database.v1.IBackup, + protos.google.spanner.admin.database.v1.IGetBackupRequest|undefined, {}|undefined + ]>; + getBackup( + request: protos.google.spanner.admin.database.v1.IGetBackupRequest, + options: CallOptions, + callback: Callback< + protos.google.spanner.admin.database.v1.IBackup, + protos.google.spanner.admin.database.v1.IGetBackupRequest|null|undefined, + {}|null|undefined>): void; + getBackup( + request: protos.google.spanner.admin.database.v1.IGetBackupRequest, + callback: Callback< + protos.google.spanner.admin.database.v1.IBackup, + protos.google.spanner.admin.database.v1.IGetBackupRequest|null|undefined, + {}|null|undefined>): void; + getBackup( + request?: protos.google.spanner.admin.database.v1.IGetBackupRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.spanner.admin.database.v1.IBackup, + protos.google.spanner.admin.database.v1.IGetBackupRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.spanner.admin.database.v1.IBackup, + protos.google.spanner.admin.database.v1.IGetBackupRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.spanner.admin.database.v1.IBackup, + protos.google.spanner.admin.database.v1.IGetBackupRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getBackup request %j', request); + const wrappedCallback: Callback< + protos.google.spanner.admin.database.v1.IBackup, + protos.google.spanner.admin.database.v1.IGetBackupRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getBackup response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getBackup(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.spanner.admin.database.v1.IBackup, + protos.google.spanner.admin.database.v1.IGetBackupRequest|undefined, + {}|undefined + ]) => { + this._log.info('getBackup response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Updates a pending or completed + * {@link protos.google.spanner.admin.database.v1.Backup|Backup}. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.spanner.admin.database.v1.Backup} request.backup + * Required. The backup to update. `backup.name`, and the fields to be updated + * as specified by `update_mask` are required. Other fields are ignored. + * Update is only supported for the following fields: + * * `backup.expire_time`. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. A mask specifying which fields (e.g. `expire_time`) in the + * Backup resource should be updated. This mask is relative to the Backup + * resource, not to the request message. The field mask must always be + * specified; this prevents any future fields from being erased accidentally + * by clients that do not know about them. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.spanner.admin.database.v1.Backup|Backup}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + */ + updateBackup( + request?: protos.google.spanner.admin.database.v1.IUpdateBackupRequest, + options?: CallOptions): + Promise<[ + protos.google.spanner.admin.database.v1.IBackup, + protos.google.spanner.admin.database.v1.IUpdateBackupRequest|undefined, {}|undefined + ]>; + updateBackup( + request: protos.google.spanner.admin.database.v1.IUpdateBackupRequest, + options: CallOptions, + callback: Callback< + protos.google.spanner.admin.database.v1.IBackup, + protos.google.spanner.admin.database.v1.IUpdateBackupRequest|null|undefined, + {}|null|undefined>): void; + updateBackup( + request: protos.google.spanner.admin.database.v1.IUpdateBackupRequest, + callback: Callback< + protos.google.spanner.admin.database.v1.IBackup, + protos.google.spanner.admin.database.v1.IUpdateBackupRequest|null|undefined, + {}|null|undefined>): void; + updateBackup( + request?: protos.google.spanner.admin.database.v1.IUpdateBackupRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.spanner.admin.database.v1.IBackup, + protos.google.spanner.admin.database.v1.IUpdateBackupRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.spanner.admin.database.v1.IBackup, + protos.google.spanner.admin.database.v1.IUpdateBackupRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.spanner.admin.database.v1.IBackup, + protos.google.spanner.admin.database.v1.IUpdateBackupRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'backup.name': request.backup!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('updateBackup request %j', request); + const wrappedCallback: Callback< + protos.google.spanner.admin.database.v1.IBackup, + protos.google.spanner.admin.database.v1.IUpdateBackupRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateBackup response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.updateBackup(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.spanner.admin.database.v1.IBackup, + protos.google.spanner.admin.database.v1.IUpdateBackupRequest|undefined, + {}|undefined + ]) => { + this._log.info('updateBackup response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Deletes a pending or completed + * {@link protos.google.spanner.admin.database.v1.Backup|Backup}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the backup to delete. + * Values are of the form + * `projects//instances//backups/`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + */ + deleteBackup( + request?: protos.google.spanner.admin.database.v1.IDeleteBackupRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.spanner.admin.database.v1.IDeleteBackupRequest|undefined, {}|undefined + ]>; + deleteBackup( + request: protos.google.spanner.admin.database.v1.IDeleteBackupRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.spanner.admin.database.v1.IDeleteBackupRequest|null|undefined, + {}|null|undefined>): void; + deleteBackup( + request: protos.google.spanner.admin.database.v1.IDeleteBackupRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.spanner.admin.database.v1.IDeleteBackupRequest|null|undefined, + {}|null|undefined>): void; + deleteBackup( + request?: protos.google.spanner.admin.database.v1.IDeleteBackupRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.spanner.admin.database.v1.IDeleteBackupRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.spanner.admin.database.v1.IDeleteBackupRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.spanner.admin.database.v1.IDeleteBackupRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('deleteBackup request %j', request); + const wrappedCallback: Callback< + protos.google.protobuf.IEmpty, + protos.google.spanner.admin.database.v1.IDeleteBackupRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteBackup response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.deleteBackup(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.spanner.admin.database.v1.IDeleteBackupRequest|undefined, + {}|undefined + ]) => { + this._log.info('deleteBackup response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Adds split points to specified tables, indexes of a database. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.database + * Required. The database on whose tables/indexes split points are to be + * added. Values are of the form + * `projects//instances//databases/`. + * @param {number[]} request.splitPoints + * Required. The split points to add. + * @param {string} [request.initiator] + * Optional. A user-supplied tag associated with the split points. + * For example, "intital_data_load", "special_event_1". + * Defaults to "CloudAddSplitPointsAPI" if not specified. + * The length of the tag must not exceed 50 characters,else will be trimmed. + * Only valid UTF8 characters are allowed. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.spanner.admin.database.v1.AddSplitPointsResponse|AddSplitPointsResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + */ + addSplitPoints( + request?: protos.google.spanner.admin.database.v1.IAddSplitPointsRequest, + options?: CallOptions): + Promise<[ + protos.google.spanner.admin.database.v1.IAddSplitPointsResponse, + protos.google.spanner.admin.database.v1.IAddSplitPointsRequest|undefined, {}|undefined + ]>; + addSplitPoints( + request: protos.google.spanner.admin.database.v1.IAddSplitPointsRequest, + options: CallOptions, + callback: Callback< + protos.google.spanner.admin.database.v1.IAddSplitPointsResponse, + protos.google.spanner.admin.database.v1.IAddSplitPointsRequest|null|undefined, + {}|null|undefined>): void; + addSplitPoints( + request: protos.google.spanner.admin.database.v1.IAddSplitPointsRequest, + callback: Callback< + protos.google.spanner.admin.database.v1.IAddSplitPointsResponse, + protos.google.spanner.admin.database.v1.IAddSplitPointsRequest|null|undefined, + {}|null|undefined>): void; + addSplitPoints( + request?: protos.google.spanner.admin.database.v1.IAddSplitPointsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.spanner.admin.database.v1.IAddSplitPointsResponse, + protos.google.spanner.admin.database.v1.IAddSplitPointsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.spanner.admin.database.v1.IAddSplitPointsResponse, + protos.google.spanner.admin.database.v1.IAddSplitPointsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.spanner.admin.database.v1.IAddSplitPointsResponse, + protos.google.spanner.admin.database.v1.IAddSplitPointsRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'database': request.database ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('addSplitPoints request %j', request); + const wrappedCallback: Callback< + protos.google.spanner.admin.database.v1.IAddSplitPointsResponse, + protos.google.spanner.admin.database.v1.IAddSplitPointsRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('addSplitPoints response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.addSplitPoints(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.spanner.admin.database.v1.IAddSplitPointsResponse, + protos.google.spanner.admin.database.v1.IAddSplitPointsRequest|undefined, + {}|undefined + ]) => { + this._log.info('addSplitPoints response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Creates a new backup schedule. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the database that this backup schedule applies to. + * @param {string} request.backupScheduleId + * Required. The Id to use for the backup schedule. The `backup_schedule_id` + * appended to `parent` forms the full backup schedule name of the form + * `projects//instances//databases//backupSchedules/`. + * @param {google.spanner.admin.database.v1.BackupSchedule} request.backupSchedule + * Required. The backup schedule to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.spanner.admin.database.v1.BackupSchedule|BackupSchedule}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + */ + createBackupSchedule( + request?: protos.google.spanner.admin.database.v1.ICreateBackupScheduleRequest, + options?: CallOptions): + Promise<[ + protos.google.spanner.admin.database.v1.IBackupSchedule, + protos.google.spanner.admin.database.v1.ICreateBackupScheduleRequest|undefined, {}|undefined + ]>; + createBackupSchedule( + request: protos.google.spanner.admin.database.v1.ICreateBackupScheduleRequest, + options: CallOptions, + callback: Callback< + protos.google.spanner.admin.database.v1.IBackupSchedule, + protos.google.spanner.admin.database.v1.ICreateBackupScheduleRequest|null|undefined, + {}|null|undefined>): void; + createBackupSchedule( + request: protos.google.spanner.admin.database.v1.ICreateBackupScheduleRequest, + callback: Callback< + protos.google.spanner.admin.database.v1.IBackupSchedule, + protos.google.spanner.admin.database.v1.ICreateBackupScheduleRequest|null|undefined, + {}|null|undefined>): void; + createBackupSchedule( + request?: protos.google.spanner.admin.database.v1.ICreateBackupScheduleRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.spanner.admin.database.v1.IBackupSchedule, + protos.google.spanner.admin.database.v1.ICreateBackupScheduleRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.spanner.admin.database.v1.IBackupSchedule, + protos.google.spanner.admin.database.v1.ICreateBackupScheduleRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.spanner.admin.database.v1.IBackupSchedule, + protos.google.spanner.admin.database.v1.ICreateBackupScheduleRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('createBackupSchedule request %j', request); + const wrappedCallback: Callback< + protos.google.spanner.admin.database.v1.IBackupSchedule, + protos.google.spanner.admin.database.v1.ICreateBackupScheduleRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createBackupSchedule response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.createBackupSchedule(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.spanner.admin.database.v1.IBackupSchedule, + protos.google.spanner.admin.database.v1.ICreateBackupScheduleRequest|undefined, + {}|undefined + ]) => { + this._log.info('createBackupSchedule response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Gets backup schedule for the input schedule name. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the schedule to retrieve. + * Values are of the form + * `projects//instances//databases//backupSchedules/`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.spanner.admin.database.v1.BackupSchedule|BackupSchedule}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + */ + getBackupSchedule( + request?: protos.google.spanner.admin.database.v1.IGetBackupScheduleRequest, + options?: CallOptions): + Promise<[ + protos.google.spanner.admin.database.v1.IBackupSchedule, + protos.google.spanner.admin.database.v1.IGetBackupScheduleRequest|undefined, {}|undefined + ]>; + getBackupSchedule( + request: protos.google.spanner.admin.database.v1.IGetBackupScheduleRequest, + options: CallOptions, + callback: Callback< + protos.google.spanner.admin.database.v1.IBackupSchedule, + protos.google.spanner.admin.database.v1.IGetBackupScheduleRequest|null|undefined, + {}|null|undefined>): void; + getBackupSchedule( + request: protos.google.spanner.admin.database.v1.IGetBackupScheduleRequest, + callback: Callback< + protos.google.spanner.admin.database.v1.IBackupSchedule, + protos.google.spanner.admin.database.v1.IGetBackupScheduleRequest|null|undefined, + {}|null|undefined>): void; + getBackupSchedule( + request?: protos.google.spanner.admin.database.v1.IGetBackupScheduleRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.spanner.admin.database.v1.IBackupSchedule, + protos.google.spanner.admin.database.v1.IGetBackupScheduleRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.spanner.admin.database.v1.IBackupSchedule, + protos.google.spanner.admin.database.v1.IGetBackupScheduleRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.spanner.admin.database.v1.IBackupSchedule, + protos.google.spanner.admin.database.v1.IGetBackupScheduleRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getBackupSchedule request %j', request); + const wrappedCallback: Callback< + protos.google.spanner.admin.database.v1.IBackupSchedule, + protos.google.spanner.admin.database.v1.IGetBackupScheduleRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getBackupSchedule response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getBackupSchedule(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.spanner.admin.database.v1.IBackupSchedule, + protos.google.spanner.admin.database.v1.IGetBackupScheduleRequest|undefined, + {}|undefined + ]) => { + this._log.info('getBackupSchedule response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Updates a backup schedule. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.spanner.admin.database.v1.BackupSchedule} request.backupSchedule + * Required. The backup schedule to update. `backup_schedule.name`, and the + * fields to be updated as specified by `update_mask` are required. Other + * fields are ignored. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. A mask specifying which fields in the BackupSchedule resource + * should be updated. This mask is relative to the BackupSchedule resource, + * not to the request message. The field mask must always be + * specified; this prevents any future fields from being erased + * accidentally. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.spanner.admin.database.v1.BackupSchedule|BackupSchedule}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + */ + updateBackupSchedule( + request?: protos.google.spanner.admin.database.v1.IUpdateBackupScheduleRequest, + options?: CallOptions): + Promise<[ + protos.google.spanner.admin.database.v1.IBackupSchedule, + protos.google.spanner.admin.database.v1.IUpdateBackupScheduleRequest|undefined, {}|undefined + ]>; + updateBackupSchedule( + request: protos.google.spanner.admin.database.v1.IUpdateBackupScheduleRequest, + options: CallOptions, + callback: Callback< + protos.google.spanner.admin.database.v1.IBackupSchedule, + protos.google.spanner.admin.database.v1.IUpdateBackupScheduleRequest|null|undefined, + {}|null|undefined>): void; + updateBackupSchedule( + request: protos.google.spanner.admin.database.v1.IUpdateBackupScheduleRequest, + callback: Callback< + protos.google.spanner.admin.database.v1.IBackupSchedule, + protos.google.spanner.admin.database.v1.IUpdateBackupScheduleRequest|null|undefined, + {}|null|undefined>): void; + updateBackupSchedule( + request?: protos.google.spanner.admin.database.v1.IUpdateBackupScheduleRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.spanner.admin.database.v1.IBackupSchedule, + protos.google.spanner.admin.database.v1.IUpdateBackupScheduleRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.spanner.admin.database.v1.IBackupSchedule, + protos.google.spanner.admin.database.v1.IUpdateBackupScheduleRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.spanner.admin.database.v1.IBackupSchedule, + protos.google.spanner.admin.database.v1.IUpdateBackupScheduleRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'backup_schedule.name': request.backupSchedule!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('updateBackupSchedule request %j', request); + const wrappedCallback: Callback< + protos.google.spanner.admin.database.v1.IBackupSchedule, + protos.google.spanner.admin.database.v1.IUpdateBackupScheduleRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateBackupSchedule response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.updateBackupSchedule(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.spanner.admin.database.v1.IBackupSchedule, + protos.google.spanner.admin.database.v1.IUpdateBackupScheduleRequest|undefined, + {}|undefined + ]) => { + this._log.info('updateBackupSchedule response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Deletes a backup schedule. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the schedule to delete. + * Values are of the form + * `projects//instances//databases//backupSchedules/`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + */ + deleteBackupSchedule( + request?: protos.google.spanner.admin.database.v1.IDeleteBackupScheduleRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.spanner.admin.database.v1.IDeleteBackupScheduleRequest|undefined, {}|undefined + ]>; + deleteBackupSchedule( + request: protos.google.spanner.admin.database.v1.IDeleteBackupScheduleRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.spanner.admin.database.v1.IDeleteBackupScheduleRequest|null|undefined, + {}|null|undefined>): void; + deleteBackupSchedule( + request: protos.google.spanner.admin.database.v1.IDeleteBackupScheduleRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.spanner.admin.database.v1.IDeleteBackupScheduleRequest|null|undefined, + {}|null|undefined>): void; + deleteBackupSchedule( + request?: protos.google.spanner.admin.database.v1.IDeleteBackupScheduleRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.spanner.admin.database.v1.IDeleteBackupScheduleRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.spanner.admin.database.v1.IDeleteBackupScheduleRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.spanner.admin.database.v1.IDeleteBackupScheduleRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('deleteBackupSchedule request %j', request); + const wrappedCallback: Callback< + protos.google.protobuf.IEmpty, + protos.google.spanner.admin.database.v1.IDeleteBackupScheduleRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteBackupSchedule response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.deleteBackupSchedule(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.spanner.admin.database.v1.IDeleteBackupScheduleRequest|undefined, + {}|undefined + ]) => { + this._log.info('deleteBackupSchedule response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * This is an internal API called by Spanner Graph jobs. You should never need + * to call this API directly. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.database + * Internal field, do not use directly. + * @param {string} request.operationId + * Internal field, do not use directly. + * @param {string} request.vmIdentityToken + * Internal field, do not use directly. + * @param {number} [request.progress] + * Internal field, do not use directly. + * @param {google.rpc.Status} [request.status] + * Internal field, do not use directly. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse|InternalUpdateGraphOperationResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + */ + internalUpdateGraphOperation( + request?: protos.google.spanner.admin.database.v1.IInternalUpdateGraphOperationRequest, + options?: CallOptions): + Promise<[ + protos.google.spanner.admin.database.v1.IInternalUpdateGraphOperationResponse, + protos.google.spanner.admin.database.v1.IInternalUpdateGraphOperationRequest|undefined, {}|undefined + ]>; + internalUpdateGraphOperation( + request: protos.google.spanner.admin.database.v1.IInternalUpdateGraphOperationRequest, + options: CallOptions, + callback: Callback< + protos.google.spanner.admin.database.v1.IInternalUpdateGraphOperationResponse, + protos.google.spanner.admin.database.v1.IInternalUpdateGraphOperationRequest|null|undefined, + {}|null|undefined>): void; + internalUpdateGraphOperation( + request: protos.google.spanner.admin.database.v1.IInternalUpdateGraphOperationRequest, + callback: Callback< + protos.google.spanner.admin.database.v1.IInternalUpdateGraphOperationResponse, + protos.google.spanner.admin.database.v1.IInternalUpdateGraphOperationRequest|null|undefined, + {}|null|undefined>): void; + internalUpdateGraphOperation( + request?: protos.google.spanner.admin.database.v1.IInternalUpdateGraphOperationRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.spanner.admin.database.v1.IInternalUpdateGraphOperationResponse, + protos.google.spanner.admin.database.v1.IInternalUpdateGraphOperationRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.spanner.admin.database.v1.IInternalUpdateGraphOperationResponse, + protos.google.spanner.admin.database.v1.IInternalUpdateGraphOperationRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.spanner.admin.database.v1.IInternalUpdateGraphOperationResponse, + protos.google.spanner.admin.database.v1.IInternalUpdateGraphOperationRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + this.initialize().catch(err => {throw err}); + this._log.info('internalUpdateGraphOperation request %j', request); + const wrappedCallback: Callback< + protos.google.spanner.admin.database.v1.IInternalUpdateGraphOperationResponse, + protos.google.spanner.admin.database.v1.IInternalUpdateGraphOperationRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('internalUpdateGraphOperation response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.internalUpdateGraphOperation(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.spanner.admin.database.v1.IInternalUpdateGraphOperationResponse, + protos.google.spanner.admin.database.v1.IInternalUpdateGraphOperationRequest|undefined, + {}|undefined + ]) => { + this._log.info('internalUpdateGraphOperation response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } + +/** + * Creates a new Cloud Spanner database and starts to prepare it for serving. + * The returned {@link protos.google.longrunning.Operation|long-running operation} will + * have a name of the format `/operations/` and + * can be used to track preparation of the database. The + * {@link protos.google.longrunning.Operation.metadata|metadata} field type is + * {@link protos.google.spanner.admin.database.v1.CreateDatabaseMetadata|CreateDatabaseMetadata}. + * The {@link protos.google.longrunning.Operation.response|response} field type is + * {@link protos.google.spanner.admin.database.v1.Database|Database}, if successful. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the instance that will serve the new database. + * Values are of the form `projects//instances/`. + * @param {string} request.createStatement + * Required. A `CREATE DATABASE` statement, which specifies the ID of the + * new database. The database ID must conform to the regular expression + * `{@link protos.a-z0-9_\-|a-z}*[a-z0-9]` and be between 2 and 30 characters in length. + * If the database ID is a reserved word or if it contains a hyphen, the + * database ID must be enclosed in backticks (`` ` ``). + * @param {string[]} [request.extraStatements] + * Optional. A list of DDL statements to run inside the newly created + * database. Statements can create tables, indexes, etc. These + * statements execute atomically with the creation of the database: + * if there is an error in any statement, the database is not created. + * @param {google.spanner.admin.database.v1.EncryptionConfig} [request.encryptionConfig] + * Optional. The encryption configuration for the database. If this field is + * not specified, Cloud Spanner will encrypt/decrypt all data at rest using + * Google default encryption. + * @param {google.spanner.admin.database.v1.DatabaseDialect} [request.databaseDialect] + * Optional. The dialect of the Cloud Spanner Database. + * @param {Buffer} [request.protoDescriptors] + * Optional. Proto descriptors used by CREATE/ALTER PROTO BUNDLE statements in + * 'extra_statements' above. + * Contains a protobuf-serialized + * [google.protobuf.FileDescriptorSet](https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/descriptor.proto). + * To generate it, [install](https://grpc.io/docs/protoc-installation/) and + * run `protoc` with --include_imports and --descriptor_set_out. For example, + * to generate for moon/shot/app.proto, run + * ``` + * $protoc --proto_path=/app_path --proto_path=/lib_path \ + * --include_imports \ + * --descriptor_set_out=descriptors.data \ + * moon/shot/app.proto + * ``` + * For more details, see protobuffer [self + * description](https://developers.google.com/protocol-buffers/docs/techniques#self-description). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + */ + createDatabase( + request?: protos.google.spanner.admin.database.v1.ICreateDatabaseRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createDatabase( + request: protos.google.spanner.admin.database.v1.ICreateDatabaseRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createDatabase( + request: protos.google.spanner.admin.database.v1.ICreateDatabaseRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createDatabase( + request?: protos.google.spanner.admin.database.v1.ICreateDatabaseRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createDatabase response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createDatabase request %j', request); + return this.innerApiCalls.createDatabase(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('createDatabase response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `createDatabase()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + */ + async checkCreateDatabaseProgress(name: string): Promise>{ + this._log.info('createDatabase long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createDatabase, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Updates a Cloud Spanner database. The returned + * {@link protos.google.longrunning.Operation|long-running operation} can be used to track + * the progress of updating the database. If the named database does not + * exist, returns `NOT_FOUND`. + * + * While the operation is pending: + * + * * The database's + * {@link protos.google.spanner.admin.database.v1.Database.reconciling|reconciling} + * field is set to true. + * * Cancelling the operation is best-effort. If the cancellation succeeds, + * the operation metadata's + * {@link protos.google.spanner.admin.database.v1.UpdateDatabaseMetadata.cancel_time|cancel_time} + * is set, the updates are reverted, and the operation terminates with a + * `CANCELLED` status. + * * New UpdateDatabase requests will return a `FAILED_PRECONDITION` error + * until the pending operation is done (returns successfully or with + * error). + * * Reading the database via the API continues to give the pre-request + * values. + * + * Upon completion of the returned operation: + * + * * The new values are in effect and readable via the API. + * * The database's + * {@link protos.google.spanner.admin.database.v1.Database.reconciling|reconciling} + * field becomes false. + * + * The returned {@link protos.google.longrunning.Operation|long-running operation} will + * have a name of the format + * `projects//instances//databases//operations/` + * and can be used to track the database modification. The + * {@link protos.google.longrunning.Operation.metadata|metadata} field type is + * {@link protos.google.spanner.admin.database.v1.UpdateDatabaseMetadata|UpdateDatabaseMetadata}. + * The {@link protos.google.longrunning.Operation.response|response} field type is + * {@link protos.google.spanner.admin.database.v1.Database|Database}, if successful. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.spanner.admin.database.v1.Database} request.database + * Required. The database to update. + * The `name` field of the database is of the form + * `projects//instances//databases/`. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The list of fields to update. Currently, only + * `enable_drop_protection` field can be updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + */ + updateDatabase( + request?: protos.google.spanner.admin.database.v1.IUpdateDatabaseRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + updateDatabase( + request: protos.google.spanner.admin.database.v1.IUpdateDatabaseRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateDatabase( + request: protos.google.spanner.admin.database.v1.IUpdateDatabaseRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateDatabase( + request?: protos.google.spanner.admin.database.v1.IUpdateDatabaseRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'database.name': request.database!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateDatabase response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateDatabase request %j', request); + return this.innerApiCalls.updateDatabase(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('updateDatabase response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `updateDatabase()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + */ + async checkUpdateDatabaseProgress(name: string): Promise>{ + this._log.info('updateDatabase long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateDatabase, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Updates the schema of a Cloud Spanner database by + * creating/altering/dropping tables, columns, indexes, etc. The returned + * {@link protos.google.longrunning.Operation|long-running operation} will have a name of + * the format `/operations/` and can be used to + * track execution of the schema change(s). The + * {@link protos.google.longrunning.Operation.metadata|metadata} field type is + * {@link protos.google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata|UpdateDatabaseDdlMetadata}. + * The operation has no response. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.database + * Required. The database to update. + * @param {string[]} request.statements + * Required. DDL statements to be applied to the database. + * @param {string} request.operationId + * If empty, the new update request is assigned an + * automatically-generated operation ID. Otherwise, `operation_id` + * is used to construct the name of the resulting + * {@link protos.google.longrunning.Operation|Operation}. + * + * Specifying an explicit operation ID simplifies determining + * whether the statements were executed in the event that the + * {@link protos.google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl|UpdateDatabaseDdl} + * call is replayed, or the return value is otherwise lost: the + * {@link protos.google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.database|database} + * and `operation_id` fields can be combined to form the + * {@link protos.google.longrunning.Operation.name|name} of the resulting + * {@link protos.google.longrunning.Operation|longrunning.Operation}: + * `/operations/`. + * + * `operation_id` should be unique within the database, and must be + * a valid identifier: `{@link protos.a-z0-9_|a-z}*`. Note that + * automatically-generated operation IDs always begin with an + * underscore. If the named operation already exists, + * {@link protos.google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl|UpdateDatabaseDdl} + * returns `ALREADY_EXISTS`. + * @param {Buffer} [request.protoDescriptors] + * Optional. Proto descriptors used by CREATE/ALTER PROTO BUNDLE statements. + * Contains a protobuf-serialized + * [google.protobuf.FileDescriptorSet](https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/descriptor.proto). + * To generate it, [install](https://grpc.io/docs/protoc-installation/) and + * run `protoc` with --include_imports and --descriptor_set_out. For example, + * to generate for moon/shot/app.proto, run + * ``` + * $protoc --proto_path=/app_path --proto_path=/lib_path \ + * --include_imports \ + * --descriptor_set_out=descriptors.data \ + * moon/shot/app.proto + * ``` + * For more details, see protobuffer [self + * description](https://developers.google.com/protocol-buffers/docs/techniques#self-description). + * @param {boolean} [request.throughputMode] + * Optional. This field is exposed to be used by the Spanner Migration Tool. + * For more details, see + * [SMT](https://github.com/GoogleCloudPlatform/spanner-migration-tool). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + */ + updateDatabaseDdl( + request?: protos.google.spanner.admin.database.v1.IUpdateDatabaseDdlRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + updateDatabaseDdl( + request: protos.google.spanner.admin.database.v1.IUpdateDatabaseDdlRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateDatabaseDdl( + request: protos.google.spanner.admin.database.v1.IUpdateDatabaseDdlRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateDatabaseDdl( + request?: protos.google.spanner.admin.database.v1.IUpdateDatabaseDdlRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'database': request.database ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateDatabaseDdl response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateDatabaseDdl request %j', request); + return this.innerApiCalls.updateDatabaseDdl(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('updateDatabaseDdl response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `updateDatabaseDdl()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + */ + async checkUpdateDatabaseDdlProgress(name: string): Promise>{ + this._log.info('updateDatabaseDdl long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateDatabaseDdl, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Starts creating a new Cloud Spanner Backup. + * The returned backup {@link protos.google.longrunning.Operation|long-running operation} + * will have a name of the format + * `projects//instances//backups//operations/` + * and can be used to track creation of the backup. The + * {@link protos.google.longrunning.Operation.metadata|metadata} field type is + * {@link protos.google.spanner.admin.database.v1.CreateBackupMetadata|CreateBackupMetadata}. + * The {@link protos.google.longrunning.Operation.response|response} field type is + * {@link protos.google.spanner.admin.database.v1.Backup|Backup}, if successful. + * Cancelling the returned operation will stop the creation and delete the + * backup. There can be only one pending backup creation per database. Backup + * creation of different databases can run concurrently. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the instance in which the backup will be + * created. This must be the same instance that contains the database the + * backup will be created from. The backup will be stored in the + * location(s) specified in the instance configuration of this + * instance. Values are of the form + * `projects//instances/`. + * @param {string} request.backupId + * Required. The id of the backup to be created. The `backup_id` appended to + * `parent` forms the full backup name of the form + * `projects//instances//backups/`. + * @param {google.spanner.admin.database.v1.Backup} request.backup + * Required. The backup to create. + * @param {google.spanner.admin.database.v1.CreateBackupEncryptionConfig} [request.encryptionConfig] + * Optional. The encryption configuration used to encrypt the backup. If this + * field is not specified, the backup will use the same encryption + * configuration as the database by default, namely + * {@link protos.google.spanner.admin.database.v1.CreateBackupEncryptionConfig.encryption_type|encryption_type} + * = `USE_DATABASE_ENCRYPTION`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + */ + createBackup( + request?: protos.google.spanner.admin.database.v1.ICreateBackupRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createBackup( + request: protos.google.spanner.admin.database.v1.ICreateBackupRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createBackup( + request: protos.google.spanner.admin.database.v1.ICreateBackupRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createBackup( + request?: protos.google.spanner.admin.database.v1.ICreateBackupRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createBackup response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createBackup request %j', request); + return this.innerApiCalls.createBackup(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('createBackup response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `createBackup()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + */ + async checkCreateBackupProgress(name: string): Promise>{ + this._log.info('createBackup long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createBackup, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Starts copying a Cloud Spanner Backup. + * The returned backup {@link protos.google.longrunning.Operation|long-running operation} + * will have a name of the format + * `projects//instances//backups//operations/` + * and can be used to track copying of the backup. The operation is associated + * with the destination backup. + * The {@link protos.google.longrunning.Operation.metadata|metadata} field type is + * {@link protos.google.spanner.admin.database.v1.CopyBackupMetadata|CopyBackupMetadata}. + * The {@link protos.google.longrunning.Operation.response|response} field type is + * {@link protos.google.spanner.admin.database.v1.Backup|Backup}, if successful. + * Cancelling the returned operation will stop the copying and delete the + * destination backup. Concurrent CopyBackup requests can run on the same + * source backup. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the destination instance that will contain the backup + * copy. Values are of the form: `projects//instances/`. + * @param {string} request.backupId + * Required. The id of the backup copy. + * The `backup_id` appended to `parent` forms the full backup_uri of the form + * `projects//instances//backups/`. + * @param {string} request.sourceBackup + * Required. The source backup to be copied. + * The source backup needs to be in READY state for it to be copied. + * Once CopyBackup is in progress, the source backup cannot be deleted or + * cleaned up on expiration until CopyBackup is finished. + * Values are of the form: + * `projects//instances//backups/`. + * @param {google.protobuf.Timestamp} request.expireTime + * Required. The expiration time of the backup in microsecond granularity. + * The expiration time must be at least 6 hours and at most 366 days + * from the `create_time` of the source backup. Once the `expire_time` has + * passed, the backup is eligible to be automatically deleted by Cloud Spanner + * to free the resources used by the backup. + * @param {google.spanner.admin.database.v1.CopyBackupEncryptionConfig} [request.encryptionConfig] + * Optional. The encryption configuration used to encrypt the backup. If this + * field is not specified, the backup will use the same encryption + * configuration as the source backup by default, namely + * {@link protos.google.spanner.admin.database.v1.CopyBackupEncryptionConfig.encryption_type|encryption_type} + * = `USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + */ + copyBackup( + request?: protos.google.spanner.admin.database.v1.ICopyBackupRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + copyBackup( + request: protos.google.spanner.admin.database.v1.ICopyBackupRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + copyBackup( + request: protos.google.spanner.admin.database.v1.ICopyBackupRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + copyBackup( + request?: protos.google.spanner.admin.database.v1.ICopyBackupRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('copyBackup response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('copyBackup request %j', request); + return this.innerApiCalls.copyBackup(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('copyBackup response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `copyBackup()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + */ + async checkCopyBackupProgress(name: string): Promise>{ + this._log.info('copyBackup long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.copyBackup, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Create a new database by restoring from a completed backup. The new + * database must be in the same project and in an instance with the same + * instance configuration as the instance containing + * the backup. The returned database [long-running + * operation][google.longrunning.Operation] has a name of the format + * `projects//instances//databases//operations/`, + * and can be used to track the progress of the operation, and to cancel it. + * The {@link protos.google.longrunning.Operation.metadata|metadata} field type is + * {@link protos.google.spanner.admin.database.v1.RestoreDatabaseMetadata|RestoreDatabaseMetadata}. + * The {@link protos.google.longrunning.Operation.response|response} type + * is {@link protos.google.spanner.admin.database.v1.Database|Database}, if + * successful. Cancelling the returned operation will stop the restore and + * delete the database. + * There can be only one database being restored into an instance at a time. + * Once the restore operation completes, a new restore operation can be + * initiated, without waiting for the optimize operation associated with the + * first restore to complete. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the instance in which to create the + * restored database. This instance must be in the same project and + * have the same instance configuration as the instance containing + * the source backup. Values are of the form + * `projects//instances/`. + * @param {string} request.databaseId + * Required. The id of the database to create and restore to. This + * database must not already exist. The `database_id` appended to + * `parent` forms the full database name of the form + * `projects//instances//databases/`. + * @param {string} request.backup + * Name of the backup from which to restore. Values are of the form + * `projects//instances//backups/`. + * @param {google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig} [request.encryptionConfig] + * Optional. An encryption configuration describing the encryption type and + * key resources in Cloud KMS used to encrypt/decrypt the database to restore + * to. If this field is not specified, the restored database will use the same + * encryption configuration as the backup by default, namely + * {@link protos.google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.encryption_type|encryption_type} + * = `USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + */ + restoreDatabase( + request?: protos.google.spanner.admin.database.v1.IRestoreDatabaseRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + restoreDatabase( + request: protos.google.spanner.admin.database.v1.IRestoreDatabaseRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + restoreDatabase( + request: protos.google.spanner.admin.database.v1.IRestoreDatabaseRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + restoreDatabase( + request?: protos.google.spanner.admin.database.v1.IRestoreDatabaseRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('restoreDatabase response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('restoreDatabase request %j', request); + return this.innerApiCalls.restoreDatabase(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('restoreDatabase response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `restoreDatabase()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + */ + async checkRestoreDatabaseProgress(name: string): Promise>{ + this._log.info('restoreDatabase long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.restoreDatabase, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } + /** + * Lists Cloud Spanner databases. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The instance whose databases should be listed. + * Values are of the form `projects//instances/`. + * @param {number} request.pageSize + * Number of databases to be returned in the response. If 0 or less, + * defaults to the server's maximum allowed page size. + * @param {string} request.pageToken + * If non-empty, `page_token` should contain a + * {@link protos.google.spanner.admin.database.v1.ListDatabasesResponse.next_page_token|next_page_token} + * from a previous + * {@link protos.google.spanner.admin.database.v1.ListDatabasesResponse|ListDatabasesResponse}. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.spanner.admin.database.v1.Database|Database}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listDatabasesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listDatabases( + request?: protos.google.spanner.admin.database.v1.IListDatabasesRequest, + options?: CallOptions): + Promise<[ + protos.google.spanner.admin.database.v1.IDatabase[], + protos.google.spanner.admin.database.v1.IListDatabasesRequest|null, + protos.google.spanner.admin.database.v1.IListDatabasesResponse + ]>; + listDatabases( + request: protos.google.spanner.admin.database.v1.IListDatabasesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.spanner.admin.database.v1.IListDatabasesRequest, + protos.google.spanner.admin.database.v1.IListDatabasesResponse|null|undefined, + protos.google.spanner.admin.database.v1.IDatabase>): void; + listDatabases( + request: protos.google.spanner.admin.database.v1.IListDatabasesRequest, + callback: PaginationCallback< + protos.google.spanner.admin.database.v1.IListDatabasesRequest, + protos.google.spanner.admin.database.v1.IListDatabasesResponse|null|undefined, + protos.google.spanner.admin.database.v1.IDatabase>): void; + listDatabases( + request?: protos.google.spanner.admin.database.v1.IListDatabasesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.spanner.admin.database.v1.IListDatabasesRequest, + protos.google.spanner.admin.database.v1.IListDatabasesResponse|null|undefined, + protos.google.spanner.admin.database.v1.IDatabase>, + callback?: PaginationCallback< + protos.google.spanner.admin.database.v1.IListDatabasesRequest, + protos.google.spanner.admin.database.v1.IListDatabasesResponse|null|undefined, + protos.google.spanner.admin.database.v1.IDatabase>): + Promise<[ + protos.google.spanner.admin.database.v1.IDatabase[], + protos.google.spanner.admin.database.v1.IListDatabasesRequest|null, + protos.google.spanner.admin.database.v1.IListDatabasesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.spanner.admin.database.v1.IListDatabasesRequest, + protos.google.spanner.admin.database.v1.IListDatabasesResponse|null|undefined, + protos.google.spanner.admin.database.v1.IDatabase>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listDatabases values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listDatabases request %j', request); + return this.innerApiCalls + .listDatabases(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.spanner.admin.database.v1.IDatabase[], + protos.google.spanner.admin.database.v1.IListDatabasesRequest|null, + protos.google.spanner.admin.database.v1.IListDatabasesResponse + ]) => { + this._log.info('listDatabases values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listDatabases`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The instance whose databases should be listed. + * Values are of the form `projects//instances/`. + * @param {number} request.pageSize + * Number of databases to be returned in the response. If 0 or less, + * defaults to the server's maximum allowed page size. + * @param {string} request.pageToken + * If non-empty, `page_token` should contain a + * {@link protos.google.spanner.admin.database.v1.ListDatabasesResponse.next_page_token|next_page_token} + * from a previous + * {@link protos.google.spanner.admin.database.v1.ListDatabasesResponse|ListDatabasesResponse}. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.spanner.admin.database.v1.Database|Database} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listDatabasesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listDatabasesStream( + request?: protos.google.spanner.admin.database.v1.IListDatabasesRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listDatabases']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listDatabases stream %j', request); + return this.descriptors.page.listDatabases.createStream( + this.innerApiCalls.listDatabases as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listDatabases`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The instance whose databases should be listed. + * Values are of the form `projects//instances/`. + * @param {number} request.pageSize + * Number of databases to be returned in the response. If 0 or less, + * defaults to the server's maximum allowed page size. + * @param {string} request.pageToken + * If non-empty, `page_token` should contain a + * {@link protos.google.spanner.admin.database.v1.ListDatabasesResponse.next_page_token|next_page_token} + * from a previous + * {@link protos.google.spanner.admin.database.v1.ListDatabasesResponse|ListDatabasesResponse}. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.spanner.admin.database.v1.Database|Database}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listDatabasesAsync( + request?: protos.google.spanner.admin.database.v1.IListDatabasesRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listDatabases']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listDatabases iterate %j', request); + return this.descriptors.page.listDatabases.asyncIterate( + this.innerApiCalls['listDatabases'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists completed and pending backups. + * Backups returned are ordered by `create_time` in descending order, + * starting from the most recent `create_time`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The instance to list backups from. Values are of the + * form `projects//instances/`. + * @param {string} request.filter + * An expression that filters the list of returned backups. + * + * A filter expression consists of a field name, a comparison operator, and a + * value for filtering. + * The value must be a string, a number, or a boolean. The comparison operator + * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. + * Colon `:` is the contains operator. Filter rules are not case sensitive. + * + * The following fields in the + * {@link protos.google.spanner.admin.database.v1.Backup|Backup} are eligible for + * filtering: + * + * * `name` + * * `database` + * * `state` + * * `create_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) + * * `expire_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) + * * `version_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) + * * `size_bytes` + * * `backup_schedules` + * + * You can combine multiple expressions by enclosing each expression in + * parentheses. By default, expressions are combined with AND logic, but + * you can specify AND, OR, and NOT logic explicitly. + * + * Here are a few examples: + * + * * `name:Howl` - The backup's name contains the string "howl". + * * `database:prod` + * - The database's name contains the string "prod". + * * `state:CREATING` - The backup is pending creation. + * * `state:READY` - The backup is fully created and ready for use. + * * `(name:howl) AND (create_time < \"2018-03-28T14:50:00Z\")` + * - The backup name contains the string "howl" and `create_time` + * of the backup is before 2018-03-28T14:50:00Z. + * * `expire_time < \"2018-03-28T14:50:00Z\"` + * - The backup `expire_time` is before 2018-03-28T14:50:00Z. + * * `size_bytes > 10000000000` - The backup's size is greater than 10GB + * * `backup_schedules:daily` + * - The backup is created from a schedule with "daily" in its name. + * @param {number} request.pageSize + * Number of backups to be returned in the response. If 0 or + * less, defaults to the server's maximum allowed page size. + * @param {string} request.pageToken + * If non-empty, `page_token` should contain a + * {@link protos.google.spanner.admin.database.v1.ListBackupsResponse.next_page_token|next_page_token} + * from a previous + * {@link protos.google.spanner.admin.database.v1.ListBackupsResponse|ListBackupsResponse} + * to the same `parent` and with the same `filter`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.spanner.admin.database.v1.Backup|Backup}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listBackupsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listBackups( + request?: protos.google.spanner.admin.database.v1.IListBackupsRequest, + options?: CallOptions): + Promise<[ + protos.google.spanner.admin.database.v1.IBackup[], + protos.google.spanner.admin.database.v1.IListBackupsRequest|null, + protos.google.spanner.admin.database.v1.IListBackupsResponse + ]>; + listBackups( + request: protos.google.spanner.admin.database.v1.IListBackupsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.spanner.admin.database.v1.IListBackupsRequest, + protos.google.spanner.admin.database.v1.IListBackupsResponse|null|undefined, + protos.google.spanner.admin.database.v1.IBackup>): void; + listBackups( + request: protos.google.spanner.admin.database.v1.IListBackupsRequest, + callback: PaginationCallback< + protos.google.spanner.admin.database.v1.IListBackupsRequest, + protos.google.spanner.admin.database.v1.IListBackupsResponse|null|undefined, + protos.google.spanner.admin.database.v1.IBackup>): void; + listBackups( + request?: protos.google.spanner.admin.database.v1.IListBackupsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.spanner.admin.database.v1.IListBackupsRequest, + protos.google.spanner.admin.database.v1.IListBackupsResponse|null|undefined, + protos.google.spanner.admin.database.v1.IBackup>, + callback?: PaginationCallback< + protos.google.spanner.admin.database.v1.IListBackupsRequest, + protos.google.spanner.admin.database.v1.IListBackupsResponse|null|undefined, + protos.google.spanner.admin.database.v1.IBackup>): + Promise<[ + protos.google.spanner.admin.database.v1.IBackup[], + protos.google.spanner.admin.database.v1.IListBackupsRequest|null, + protos.google.spanner.admin.database.v1.IListBackupsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.spanner.admin.database.v1.IListBackupsRequest, + protos.google.spanner.admin.database.v1.IListBackupsResponse|null|undefined, + protos.google.spanner.admin.database.v1.IBackup>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listBackups values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listBackups request %j', request); + return this.innerApiCalls + .listBackups(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.spanner.admin.database.v1.IBackup[], + protos.google.spanner.admin.database.v1.IListBackupsRequest|null, + protos.google.spanner.admin.database.v1.IListBackupsResponse + ]) => { + this._log.info('listBackups values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listBackups`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The instance to list backups from. Values are of the + * form `projects//instances/`. + * @param {string} request.filter + * An expression that filters the list of returned backups. + * + * A filter expression consists of a field name, a comparison operator, and a + * value for filtering. + * The value must be a string, a number, or a boolean. The comparison operator + * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. + * Colon `:` is the contains operator. Filter rules are not case sensitive. + * + * The following fields in the + * {@link protos.google.spanner.admin.database.v1.Backup|Backup} are eligible for + * filtering: + * + * * `name` + * * `database` + * * `state` + * * `create_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) + * * `expire_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) + * * `version_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) + * * `size_bytes` + * * `backup_schedules` + * + * You can combine multiple expressions by enclosing each expression in + * parentheses. By default, expressions are combined with AND logic, but + * you can specify AND, OR, and NOT logic explicitly. + * + * Here are a few examples: + * + * * `name:Howl` - The backup's name contains the string "howl". + * * `database:prod` + * - The database's name contains the string "prod". + * * `state:CREATING` - The backup is pending creation. + * * `state:READY` - The backup is fully created and ready for use. + * * `(name:howl) AND (create_time < \"2018-03-28T14:50:00Z\")` + * - The backup name contains the string "howl" and `create_time` + * of the backup is before 2018-03-28T14:50:00Z. + * * `expire_time < \"2018-03-28T14:50:00Z\"` + * - The backup `expire_time` is before 2018-03-28T14:50:00Z. + * * `size_bytes > 10000000000` - The backup's size is greater than 10GB + * * `backup_schedules:daily` + * - The backup is created from a schedule with "daily" in its name. + * @param {number} request.pageSize + * Number of backups to be returned in the response. If 0 or + * less, defaults to the server's maximum allowed page size. + * @param {string} request.pageToken + * If non-empty, `page_token` should contain a + * {@link protos.google.spanner.admin.database.v1.ListBackupsResponse.next_page_token|next_page_token} + * from a previous + * {@link protos.google.spanner.admin.database.v1.ListBackupsResponse|ListBackupsResponse} + * to the same `parent` and with the same `filter`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.spanner.admin.database.v1.Backup|Backup} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listBackupsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listBackupsStream( + request?: protos.google.spanner.admin.database.v1.IListBackupsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listBackups']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listBackups stream %j', request); + return this.descriptors.page.listBackups.createStream( + this.innerApiCalls.listBackups as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listBackups`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The instance to list backups from. Values are of the + * form `projects//instances/`. + * @param {string} request.filter + * An expression that filters the list of returned backups. + * + * A filter expression consists of a field name, a comparison operator, and a + * value for filtering. + * The value must be a string, a number, or a boolean. The comparison operator + * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. + * Colon `:` is the contains operator. Filter rules are not case sensitive. + * + * The following fields in the + * {@link protos.google.spanner.admin.database.v1.Backup|Backup} are eligible for + * filtering: + * + * * `name` + * * `database` + * * `state` + * * `create_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) + * * `expire_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) + * * `version_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) + * * `size_bytes` + * * `backup_schedules` + * + * You can combine multiple expressions by enclosing each expression in + * parentheses. By default, expressions are combined with AND logic, but + * you can specify AND, OR, and NOT logic explicitly. + * + * Here are a few examples: + * + * * `name:Howl` - The backup's name contains the string "howl". + * * `database:prod` + * - The database's name contains the string "prod". + * * `state:CREATING` - The backup is pending creation. + * * `state:READY` - The backup is fully created and ready for use. + * * `(name:howl) AND (create_time < \"2018-03-28T14:50:00Z\")` + * - The backup name contains the string "howl" and `create_time` + * of the backup is before 2018-03-28T14:50:00Z. + * * `expire_time < \"2018-03-28T14:50:00Z\"` + * - The backup `expire_time` is before 2018-03-28T14:50:00Z. + * * `size_bytes > 10000000000` - The backup's size is greater than 10GB + * * `backup_schedules:daily` + * - The backup is created from a schedule with "daily" in its name. + * @param {number} request.pageSize + * Number of backups to be returned in the response. If 0 or + * less, defaults to the server's maximum allowed page size. + * @param {string} request.pageToken + * If non-empty, `page_token` should contain a + * {@link protos.google.spanner.admin.database.v1.ListBackupsResponse.next_page_token|next_page_token} + * from a previous + * {@link protos.google.spanner.admin.database.v1.ListBackupsResponse|ListBackupsResponse} + * to the same `parent` and with the same `filter`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.spanner.admin.database.v1.Backup|Backup}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listBackupsAsync( + request?: protos.google.spanner.admin.database.v1.IListBackupsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listBackups']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listBackups iterate %j', request); + return this.descriptors.page.listBackups.asyncIterate( + this.innerApiCalls['listBackups'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists database {@link protos.google.longrunning.Operation|longrunning-operations}. + * A database operation has a name of the form + * `projects//instances//databases//operations/`. + * The long-running operation + * {@link protos.google.longrunning.Operation.metadata|metadata} field type + * `metadata.type_url` describes the type of the metadata. Operations returned + * include those that have completed/failed/canceled within the last 7 days, + * and pending operations. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The instance of the database operations. + * Values are of the form `projects//instances/`. + * @param {string} request.filter + * An expression that filters the list of returned operations. + * + * A filter expression consists of a field name, a + * comparison operator, and a value for filtering. + * The value must be a string, a number, or a boolean. The comparison operator + * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. + * Colon `:` is the contains operator. Filter rules are not case sensitive. + * + * The following fields in the {@link protos.google.longrunning.Operation|Operation} + * are eligible for filtering: + * + * * `name` - The name of the long-running operation + * * `done` - False if the operation is in progress, else true. + * * `metadata.@type` - the type of metadata. For example, the type string + * for + * {@link protos.google.spanner.admin.database.v1.RestoreDatabaseMetadata|RestoreDatabaseMetadata} + * is + * `type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata`. + * * `metadata.` - any field in metadata.value. + * `metadata.@type` must be specified first, if filtering on metadata + * fields. + * * `error` - Error associated with the long-running operation. + * * `response.@type` - the type of response. + * * `response.` - any field in response.value. + * + * You can combine multiple expressions by enclosing each expression in + * parentheses. By default, expressions are combined with AND logic. However, + * you can specify AND, OR, and NOT logic explicitly. + * + * Here are a few examples: + * + * * `done:true` - The operation is complete. + * * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata) AND` \ + * `(metadata.source_type:BACKUP) AND` \ + * `(metadata.backup_info.backup:backup_howl) AND` \ + * `(metadata.name:restored_howl) AND` \ + * `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \ + * `(error:*)` - Return operations where: + * * The operation's metadata type is + * {@link protos.google.spanner.admin.database.v1.RestoreDatabaseMetadata|RestoreDatabaseMetadata}. + * * The database is restored from a backup. + * * The backup name contains "backup_howl". + * * The restored database's name contains "restored_howl". + * * The operation started before 2018-03-28T14:50:00Z. + * * The operation resulted in an error. + * @param {number} request.pageSize + * Number of operations to be returned in the response. If 0 or + * less, defaults to the server's maximum allowed page size. + * @param {string} request.pageToken + * If non-empty, `page_token` should contain a + * {@link protos.google.spanner.admin.database.v1.ListDatabaseOperationsResponse.next_page_token|next_page_token} + * from a previous + * {@link protos.google.spanner.admin.database.v1.ListDatabaseOperationsResponse|ListDatabaseOperationsResponse} + * to the same `parent` and with the same `filter`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.longrunning.Operation|Operation}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listDatabaseOperationsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listDatabaseOperations( + request?: protos.google.spanner.admin.database.v1.IListDatabaseOperationsRequest, + options?: CallOptions): + Promise<[ + protos.google.longrunning.IOperation[], + protos.google.spanner.admin.database.v1.IListDatabaseOperationsRequest|null, + protos.google.spanner.admin.database.v1.IListDatabaseOperationsResponse + ]>; + listDatabaseOperations( + request: protos.google.spanner.admin.database.v1.IListDatabaseOperationsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.spanner.admin.database.v1.IListDatabaseOperationsRequest, + protos.google.spanner.admin.database.v1.IListDatabaseOperationsResponse|null|undefined, + protos.google.longrunning.IOperation>): void; + listDatabaseOperations( + request: protos.google.spanner.admin.database.v1.IListDatabaseOperationsRequest, + callback: PaginationCallback< + protos.google.spanner.admin.database.v1.IListDatabaseOperationsRequest, + protos.google.spanner.admin.database.v1.IListDatabaseOperationsResponse|null|undefined, + protos.google.longrunning.IOperation>): void; + listDatabaseOperations( + request?: protos.google.spanner.admin.database.v1.IListDatabaseOperationsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.spanner.admin.database.v1.IListDatabaseOperationsRequest, + protos.google.spanner.admin.database.v1.IListDatabaseOperationsResponse|null|undefined, + protos.google.longrunning.IOperation>, + callback?: PaginationCallback< + protos.google.spanner.admin.database.v1.IListDatabaseOperationsRequest, + protos.google.spanner.admin.database.v1.IListDatabaseOperationsResponse|null|undefined, + protos.google.longrunning.IOperation>): + Promise<[ + protos.google.longrunning.IOperation[], + protos.google.spanner.admin.database.v1.IListDatabaseOperationsRequest|null, + protos.google.spanner.admin.database.v1.IListDatabaseOperationsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.spanner.admin.database.v1.IListDatabaseOperationsRequest, + protos.google.spanner.admin.database.v1.IListDatabaseOperationsResponse|null|undefined, + protos.google.longrunning.IOperation>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listDatabaseOperations values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listDatabaseOperations request %j', request); + return this.innerApiCalls + .listDatabaseOperations(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.longrunning.IOperation[], + protos.google.spanner.admin.database.v1.IListDatabaseOperationsRequest|null, + protos.google.spanner.admin.database.v1.IListDatabaseOperationsResponse + ]) => { + this._log.info('listDatabaseOperations values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listDatabaseOperations`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The instance of the database operations. + * Values are of the form `projects//instances/`. + * @param {string} request.filter + * An expression that filters the list of returned operations. + * + * A filter expression consists of a field name, a + * comparison operator, and a value for filtering. + * The value must be a string, a number, or a boolean. The comparison operator + * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. + * Colon `:` is the contains operator. Filter rules are not case sensitive. + * + * The following fields in the {@link protos.google.longrunning.Operation|Operation} + * are eligible for filtering: + * + * * `name` - The name of the long-running operation + * * `done` - False if the operation is in progress, else true. + * * `metadata.@type` - the type of metadata. For example, the type string + * for + * {@link protos.google.spanner.admin.database.v1.RestoreDatabaseMetadata|RestoreDatabaseMetadata} + * is + * `type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata`. + * * `metadata.` - any field in metadata.value. + * `metadata.@type` must be specified first, if filtering on metadata + * fields. + * * `error` - Error associated with the long-running operation. + * * `response.@type` - the type of response. + * * `response.` - any field in response.value. + * + * You can combine multiple expressions by enclosing each expression in + * parentheses. By default, expressions are combined with AND logic. However, + * you can specify AND, OR, and NOT logic explicitly. + * + * Here are a few examples: + * + * * `done:true` - The operation is complete. + * * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata) AND` \ + * `(metadata.source_type:BACKUP) AND` \ + * `(metadata.backup_info.backup:backup_howl) AND` \ + * `(metadata.name:restored_howl) AND` \ + * `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \ + * `(error:*)` - Return operations where: + * * The operation's metadata type is + * {@link protos.google.spanner.admin.database.v1.RestoreDatabaseMetadata|RestoreDatabaseMetadata}. + * * The database is restored from a backup. + * * The backup name contains "backup_howl". + * * The restored database's name contains "restored_howl". + * * The operation started before 2018-03-28T14:50:00Z. + * * The operation resulted in an error. + * @param {number} request.pageSize + * Number of operations to be returned in the response. If 0 or + * less, defaults to the server's maximum allowed page size. + * @param {string} request.pageToken + * If non-empty, `page_token` should contain a + * {@link protos.google.spanner.admin.database.v1.ListDatabaseOperationsResponse.next_page_token|next_page_token} + * from a previous + * {@link protos.google.spanner.admin.database.v1.ListDatabaseOperationsResponse|ListDatabaseOperationsResponse} + * to the same `parent` and with the same `filter`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.longrunning.Operation|Operation} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listDatabaseOperationsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listDatabaseOperationsStream( + request?: protos.google.spanner.admin.database.v1.IListDatabaseOperationsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listDatabaseOperations']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listDatabaseOperations stream %j', request); + return this.descriptors.page.listDatabaseOperations.createStream( + this.innerApiCalls.listDatabaseOperations as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listDatabaseOperations`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The instance of the database operations. + * Values are of the form `projects//instances/`. + * @param {string} request.filter + * An expression that filters the list of returned operations. + * + * A filter expression consists of a field name, a + * comparison operator, and a value for filtering. + * The value must be a string, a number, or a boolean. The comparison operator + * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. + * Colon `:` is the contains operator. Filter rules are not case sensitive. + * + * The following fields in the {@link protos.google.longrunning.Operation|Operation} + * are eligible for filtering: + * + * * `name` - The name of the long-running operation + * * `done` - False if the operation is in progress, else true. + * * `metadata.@type` - the type of metadata. For example, the type string + * for + * {@link protos.google.spanner.admin.database.v1.RestoreDatabaseMetadata|RestoreDatabaseMetadata} + * is + * `type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata`. + * * `metadata.` - any field in metadata.value. + * `metadata.@type` must be specified first, if filtering on metadata + * fields. + * * `error` - Error associated with the long-running operation. + * * `response.@type` - the type of response. + * * `response.` - any field in response.value. + * + * You can combine multiple expressions by enclosing each expression in + * parentheses. By default, expressions are combined with AND logic. However, + * you can specify AND, OR, and NOT logic explicitly. + * + * Here are a few examples: + * + * * `done:true` - The operation is complete. + * * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata) AND` \ + * `(metadata.source_type:BACKUP) AND` \ + * `(metadata.backup_info.backup:backup_howl) AND` \ + * `(metadata.name:restored_howl) AND` \ + * `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \ + * `(error:*)` - Return operations where: + * * The operation's metadata type is + * {@link protos.google.spanner.admin.database.v1.RestoreDatabaseMetadata|RestoreDatabaseMetadata}. + * * The database is restored from a backup. + * * The backup name contains "backup_howl". + * * The restored database's name contains "restored_howl". + * * The operation started before 2018-03-28T14:50:00Z. + * * The operation resulted in an error. + * @param {number} request.pageSize + * Number of operations to be returned in the response. If 0 or + * less, defaults to the server's maximum allowed page size. + * @param {string} request.pageToken + * If non-empty, `page_token` should contain a + * {@link protos.google.spanner.admin.database.v1.ListDatabaseOperationsResponse.next_page_token|next_page_token} + * from a previous + * {@link protos.google.spanner.admin.database.v1.ListDatabaseOperationsResponse|ListDatabaseOperationsResponse} + * to the same `parent` and with the same `filter`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.longrunning.Operation|Operation}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listDatabaseOperationsAsync( + request?: protos.google.spanner.admin.database.v1.IListDatabaseOperationsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listDatabaseOperations']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listDatabaseOperations iterate %j', request); + return this.descriptors.page.listDatabaseOperations.asyncIterate( + this.innerApiCalls['listDatabaseOperations'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists the backup {@link protos.google.longrunning.Operation|long-running operations} in + * the given instance. A backup operation has a name of the form + * `projects//instances//backups//operations/`. + * The long-running operation + * {@link protos.google.longrunning.Operation.metadata|metadata} field type + * `metadata.type_url` describes the type of the metadata. Operations returned + * include those that have completed/failed/canceled within the last 7 days, + * and pending operations. Operations returned are ordered by + * `operation.metadata.value.progress.start_time` in descending order starting + * from the most recently started operation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The instance of the backup operations. Values are of + * the form `projects//instances/`. + * @param {string} request.filter + * An expression that filters the list of returned backup operations. + * + * A filter expression consists of a field name, a + * comparison operator, and a value for filtering. + * The value must be a string, a number, or a boolean. The comparison operator + * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. + * Colon `:` is the contains operator. Filter rules are not case sensitive. + * + * The following fields in the {@link protos.google.longrunning.Operation|operation} + * are eligible for filtering: + * + * * `name` - The name of the long-running operation + * * `done` - False if the operation is in progress, else true. + * * `metadata.@type` - the type of metadata. For example, the type string + * for + * {@link protos.google.spanner.admin.database.v1.CreateBackupMetadata|CreateBackupMetadata} + * is + * `type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata`. + * * `metadata.` - any field in metadata.value. + * `metadata.@type` must be specified first if filtering on metadata + * fields. + * * `error` - Error associated with the long-running operation. + * * `response.@type` - the type of response. + * * `response.` - any field in response.value. + * + * You can combine multiple expressions by enclosing each expression in + * parentheses. By default, expressions are combined with AND logic, but + * you can specify AND, OR, and NOT logic explicitly. + * + * Here are a few examples: + * + * * `done:true` - The operation is complete. + * * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \ + * `metadata.database:prod` - Returns operations where: + * * The operation's metadata type is + * {@link protos.google.spanner.admin.database.v1.CreateBackupMetadata|CreateBackupMetadata}. + * * The source database name of backup contains the string "prod". + * * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \ + * `(metadata.name:howl) AND` \ + * `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \ + * `(error:*)` - Returns operations where: + * * The operation's metadata type is + * {@link protos.google.spanner.admin.database.v1.CreateBackupMetadata|CreateBackupMetadata}. + * * The backup name contains the string "howl". + * * The operation started before 2018-03-28T14:50:00Z. + * * The operation resulted in an error. + * * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CopyBackupMetadata) AND` \ + * `(metadata.source_backup:test) AND` \ + * `(metadata.progress.start_time < \"2022-01-18T14:50:00Z\") AND` \ + * `(error:*)` - Returns operations where: + * * The operation's metadata type is + * {@link protos.google.spanner.admin.database.v1.CopyBackupMetadata|CopyBackupMetadata}. + * * The source backup name contains the string "test". + * * The operation started before 2022-01-18T14:50:00Z. + * * The operation resulted in an error. + * * `((metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \ + * `(metadata.database:test_db)) OR` \ + * `((metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CopyBackupMetadata) + * AND` \ + * `(metadata.source_backup:test_bkp)) AND` \ + * `(error:*)` - Returns operations where: + * * The operation's metadata matches either of criteria: + * * The operation's metadata type is + * {@link protos.google.spanner.admin.database.v1.CreateBackupMetadata|CreateBackupMetadata} + * AND the source database name of the backup contains the string + * "test_db" + * * The operation's metadata type is + * {@link protos.google.spanner.admin.database.v1.CopyBackupMetadata|CopyBackupMetadata} + * AND the source backup name contains the string "test_bkp" + * * The operation resulted in an error. + * @param {number} request.pageSize + * Number of operations to be returned in the response. If 0 or + * less, defaults to the server's maximum allowed page size. + * @param {string} request.pageToken + * If non-empty, `page_token` should contain a + * {@link protos.google.spanner.admin.database.v1.ListBackupOperationsResponse.next_page_token|next_page_token} + * from a previous + * {@link protos.google.spanner.admin.database.v1.ListBackupOperationsResponse|ListBackupOperationsResponse} + * to the same `parent` and with the same `filter`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.longrunning.Operation|Operation}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listBackupOperationsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listBackupOperations( + request?: protos.google.spanner.admin.database.v1.IListBackupOperationsRequest, + options?: CallOptions): + Promise<[ + protos.google.longrunning.IOperation[], + protos.google.spanner.admin.database.v1.IListBackupOperationsRequest|null, + protos.google.spanner.admin.database.v1.IListBackupOperationsResponse + ]>; + listBackupOperations( + request: protos.google.spanner.admin.database.v1.IListBackupOperationsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.spanner.admin.database.v1.IListBackupOperationsRequest, + protos.google.spanner.admin.database.v1.IListBackupOperationsResponse|null|undefined, + protos.google.longrunning.IOperation>): void; + listBackupOperations( + request: protos.google.spanner.admin.database.v1.IListBackupOperationsRequest, + callback: PaginationCallback< + protos.google.spanner.admin.database.v1.IListBackupOperationsRequest, + protos.google.spanner.admin.database.v1.IListBackupOperationsResponse|null|undefined, + protos.google.longrunning.IOperation>): void; + listBackupOperations( + request?: protos.google.spanner.admin.database.v1.IListBackupOperationsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.spanner.admin.database.v1.IListBackupOperationsRequest, + protos.google.spanner.admin.database.v1.IListBackupOperationsResponse|null|undefined, + protos.google.longrunning.IOperation>, + callback?: PaginationCallback< + protos.google.spanner.admin.database.v1.IListBackupOperationsRequest, + protos.google.spanner.admin.database.v1.IListBackupOperationsResponse|null|undefined, + protos.google.longrunning.IOperation>): + Promise<[ + protos.google.longrunning.IOperation[], + protos.google.spanner.admin.database.v1.IListBackupOperationsRequest|null, + protos.google.spanner.admin.database.v1.IListBackupOperationsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.spanner.admin.database.v1.IListBackupOperationsRequest, + protos.google.spanner.admin.database.v1.IListBackupOperationsResponse|null|undefined, + protos.google.longrunning.IOperation>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listBackupOperations values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listBackupOperations request %j', request); + return this.innerApiCalls + .listBackupOperations(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.longrunning.IOperation[], + protos.google.spanner.admin.database.v1.IListBackupOperationsRequest|null, + protos.google.spanner.admin.database.v1.IListBackupOperationsResponse + ]) => { + this._log.info('listBackupOperations values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listBackupOperations`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The instance of the backup operations. Values are of + * the form `projects//instances/`. + * @param {string} request.filter + * An expression that filters the list of returned backup operations. + * + * A filter expression consists of a field name, a + * comparison operator, and a value for filtering. + * The value must be a string, a number, or a boolean. The comparison operator + * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. + * Colon `:` is the contains operator. Filter rules are not case sensitive. + * + * The following fields in the {@link protos.google.longrunning.Operation|operation} + * are eligible for filtering: + * + * * `name` - The name of the long-running operation + * * `done` - False if the operation is in progress, else true. + * * `metadata.@type` - the type of metadata. For example, the type string + * for + * {@link protos.google.spanner.admin.database.v1.CreateBackupMetadata|CreateBackupMetadata} + * is + * `type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata`. + * * `metadata.` - any field in metadata.value. + * `metadata.@type` must be specified first if filtering on metadata + * fields. + * * `error` - Error associated with the long-running operation. + * * `response.@type` - the type of response. + * * `response.` - any field in response.value. + * + * You can combine multiple expressions by enclosing each expression in + * parentheses. By default, expressions are combined with AND logic, but + * you can specify AND, OR, and NOT logic explicitly. + * + * Here are a few examples: + * + * * `done:true` - The operation is complete. + * * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \ + * `metadata.database:prod` - Returns operations where: + * * The operation's metadata type is + * {@link protos.google.spanner.admin.database.v1.CreateBackupMetadata|CreateBackupMetadata}. + * * The source database name of backup contains the string "prod". + * * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \ + * `(metadata.name:howl) AND` \ + * `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \ + * `(error:*)` - Returns operations where: + * * The operation's metadata type is + * {@link protos.google.spanner.admin.database.v1.CreateBackupMetadata|CreateBackupMetadata}. + * * The backup name contains the string "howl". + * * The operation started before 2018-03-28T14:50:00Z. + * * The operation resulted in an error. + * * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CopyBackupMetadata) AND` \ + * `(metadata.source_backup:test) AND` \ + * `(metadata.progress.start_time < \"2022-01-18T14:50:00Z\") AND` \ + * `(error:*)` - Returns operations where: + * * The operation's metadata type is + * {@link protos.google.spanner.admin.database.v1.CopyBackupMetadata|CopyBackupMetadata}. + * * The source backup name contains the string "test". + * * The operation started before 2022-01-18T14:50:00Z. + * * The operation resulted in an error. + * * `((metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \ + * `(metadata.database:test_db)) OR` \ + * `((metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CopyBackupMetadata) + * AND` \ + * `(metadata.source_backup:test_bkp)) AND` \ + * `(error:*)` - Returns operations where: + * * The operation's metadata matches either of criteria: + * * The operation's metadata type is + * {@link protos.google.spanner.admin.database.v1.CreateBackupMetadata|CreateBackupMetadata} + * AND the source database name of the backup contains the string + * "test_db" + * * The operation's metadata type is + * {@link protos.google.spanner.admin.database.v1.CopyBackupMetadata|CopyBackupMetadata} + * AND the source backup name contains the string "test_bkp" + * * The operation resulted in an error. + * @param {number} request.pageSize + * Number of operations to be returned in the response. If 0 or + * less, defaults to the server's maximum allowed page size. + * @param {string} request.pageToken + * If non-empty, `page_token` should contain a + * {@link protos.google.spanner.admin.database.v1.ListBackupOperationsResponse.next_page_token|next_page_token} + * from a previous + * {@link protos.google.spanner.admin.database.v1.ListBackupOperationsResponse|ListBackupOperationsResponse} + * to the same `parent` and with the same `filter`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.longrunning.Operation|Operation} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listBackupOperationsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listBackupOperationsStream( + request?: protos.google.spanner.admin.database.v1.IListBackupOperationsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listBackupOperations']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listBackupOperations stream %j', request); + return this.descriptors.page.listBackupOperations.createStream( + this.innerApiCalls.listBackupOperations as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listBackupOperations`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The instance of the backup operations. Values are of + * the form `projects//instances/`. + * @param {string} request.filter + * An expression that filters the list of returned backup operations. + * + * A filter expression consists of a field name, a + * comparison operator, and a value for filtering. + * The value must be a string, a number, or a boolean. The comparison operator + * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. + * Colon `:` is the contains operator. Filter rules are not case sensitive. + * + * The following fields in the {@link protos.google.longrunning.Operation|operation} + * are eligible for filtering: + * + * * `name` - The name of the long-running operation + * * `done` - False if the operation is in progress, else true. + * * `metadata.@type` - the type of metadata. For example, the type string + * for + * {@link protos.google.spanner.admin.database.v1.CreateBackupMetadata|CreateBackupMetadata} + * is + * `type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata`. + * * `metadata.` - any field in metadata.value. + * `metadata.@type` must be specified first if filtering on metadata + * fields. + * * `error` - Error associated with the long-running operation. + * * `response.@type` - the type of response. + * * `response.` - any field in response.value. + * + * You can combine multiple expressions by enclosing each expression in + * parentheses. By default, expressions are combined with AND logic, but + * you can specify AND, OR, and NOT logic explicitly. + * + * Here are a few examples: + * + * * `done:true` - The operation is complete. + * * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \ + * `metadata.database:prod` - Returns operations where: + * * The operation's metadata type is + * {@link protos.google.spanner.admin.database.v1.CreateBackupMetadata|CreateBackupMetadata}. + * * The source database name of backup contains the string "prod". + * * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \ + * `(metadata.name:howl) AND` \ + * `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \ + * `(error:*)` - Returns operations where: + * * The operation's metadata type is + * {@link protos.google.spanner.admin.database.v1.CreateBackupMetadata|CreateBackupMetadata}. + * * The backup name contains the string "howl". + * * The operation started before 2018-03-28T14:50:00Z. + * * The operation resulted in an error. + * * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CopyBackupMetadata) AND` \ + * `(metadata.source_backup:test) AND` \ + * `(metadata.progress.start_time < \"2022-01-18T14:50:00Z\") AND` \ + * `(error:*)` - Returns operations where: + * * The operation's metadata type is + * {@link protos.google.spanner.admin.database.v1.CopyBackupMetadata|CopyBackupMetadata}. + * * The source backup name contains the string "test". + * * The operation started before 2022-01-18T14:50:00Z. + * * The operation resulted in an error. + * * `((metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \ + * `(metadata.database:test_db)) OR` \ + * `((metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CopyBackupMetadata) + * AND` \ + * `(metadata.source_backup:test_bkp)) AND` \ + * `(error:*)` - Returns operations where: + * * The operation's metadata matches either of criteria: + * * The operation's metadata type is + * {@link protos.google.spanner.admin.database.v1.CreateBackupMetadata|CreateBackupMetadata} + * AND the source database name of the backup contains the string + * "test_db" + * * The operation's metadata type is + * {@link protos.google.spanner.admin.database.v1.CopyBackupMetadata|CopyBackupMetadata} + * AND the source backup name contains the string "test_bkp" + * * The operation resulted in an error. + * @param {number} request.pageSize + * Number of operations to be returned in the response. If 0 or + * less, defaults to the server's maximum allowed page size. + * @param {string} request.pageToken + * If non-empty, `page_token` should contain a + * {@link protos.google.spanner.admin.database.v1.ListBackupOperationsResponse.next_page_token|next_page_token} + * from a previous + * {@link protos.google.spanner.admin.database.v1.ListBackupOperationsResponse|ListBackupOperationsResponse} + * to the same `parent` and with the same `filter`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.longrunning.Operation|Operation}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listBackupOperationsAsync( + request?: protos.google.spanner.admin.database.v1.IListBackupOperationsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listBackupOperations']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listBackupOperations iterate %j', request); + return this.descriptors.page.listBackupOperations.asyncIterate( + this.innerApiCalls['listBackupOperations'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists Cloud Spanner database roles. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The database whose roles should be listed. + * Values are of the form + * `projects//instances//databases/`. + * @param {number} request.pageSize + * Number of database roles to be returned in the response. If 0 or less, + * defaults to the server's maximum allowed page size. + * @param {string} request.pageToken + * If non-empty, `page_token` should contain a + * {@link protos.google.spanner.admin.database.v1.ListDatabaseRolesResponse.next_page_token|next_page_token} + * from a previous + * {@link protos.google.spanner.admin.database.v1.ListDatabaseRolesResponse|ListDatabaseRolesResponse}. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.spanner.admin.database.v1.DatabaseRole|DatabaseRole}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listDatabaseRolesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listDatabaseRoles( + request?: protos.google.spanner.admin.database.v1.IListDatabaseRolesRequest, + options?: CallOptions): + Promise<[ + protos.google.spanner.admin.database.v1.IDatabaseRole[], + protos.google.spanner.admin.database.v1.IListDatabaseRolesRequest|null, + protos.google.spanner.admin.database.v1.IListDatabaseRolesResponse + ]>; + listDatabaseRoles( + request: protos.google.spanner.admin.database.v1.IListDatabaseRolesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.spanner.admin.database.v1.IListDatabaseRolesRequest, + protos.google.spanner.admin.database.v1.IListDatabaseRolesResponse|null|undefined, + protos.google.spanner.admin.database.v1.IDatabaseRole>): void; + listDatabaseRoles( + request: protos.google.spanner.admin.database.v1.IListDatabaseRolesRequest, + callback: PaginationCallback< + protos.google.spanner.admin.database.v1.IListDatabaseRolesRequest, + protos.google.spanner.admin.database.v1.IListDatabaseRolesResponse|null|undefined, + protos.google.spanner.admin.database.v1.IDatabaseRole>): void; + listDatabaseRoles( + request?: protos.google.spanner.admin.database.v1.IListDatabaseRolesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.spanner.admin.database.v1.IListDatabaseRolesRequest, + protos.google.spanner.admin.database.v1.IListDatabaseRolesResponse|null|undefined, + protos.google.spanner.admin.database.v1.IDatabaseRole>, + callback?: PaginationCallback< + protos.google.spanner.admin.database.v1.IListDatabaseRolesRequest, + protos.google.spanner.admin.database.v1.IListDatabaseRolesResponse|null|undefined, + protos.google.spanner.admin.database.v1.IDatabaseRole>): + Promise<[ + protos.google.spanner.admin.database.v1.IDatabaseRole[], + protos.google.spanner.admin.database.v1.IListDatabaseRolesRequest|null, + protos.google.spanner.admin.database.v1.IListDatabaseRolesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.spanner.admin.database.v1.IListDatabaseRolesRequest, + protos.google.spanner.admin.database.v1.IListDatabaseRolesResponse|null|undefined, + protos.google.spanner.admin.database.v1.IDatabaseRole>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listDatabaseRoles values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listDatabaseRoles request %j', request); + return this.innerApiCalls + .listDatabaseRoles(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.spanner.admin.database.v1.IDatabaseRole[], + protos.google.spanner.admin.database.v1.IListDatabaseRolesRequest|null, + protos.google.spanner.admin.database.v1.IListDatabaseRolesResponse + ]) => { + this._log.info('listDatabaseRoles values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listDatabaseRoles`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The database whose roles should be listed. + * Values are of the form + * `projects//instances//databases/`. + * @param {number} request.pageSize + * Number of database roles to be returned in the response. If 0 or less, + * defaults to the server's maximum allowed page size. + * @param {string} request.pageToken + * If non-empty, `page_token` should contain a + * {@link protos.google.spanner.admin.database.v1.ListDatabaseRolesResponse.next_page_token|next_page_token} + * from a previous + * {@link protos.google.spanner.admin.database.v1.ListDatabaseRolesResponse|ListDatabaseRolesResponse}. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.spanner.admin.database.v1.DatabaseRole|DatabaseRole} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listDatabaseRolesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listDatabaseRolesStream( + request?: protos.google.spanner.admin.database.v1.IListDatabaseRolesRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listDatabaseRoles']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listDatabaseRoles stream %j', request); + return this.descriptors.page.listDatabaseRoles.createStream( + this.innerApiCalls.listDatabaseRoles as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listDatabaseRoles`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The database whose roles should be listed. + * Values are of the form + * `projects//instances//databases/`. + * @param {number} request.pageSize + * Number of database roles to be returned in the response. If 0 or less, + * defaults to the server's maximum allowed page size. + * @param {string} request.pageToken + * If non-empty, `page_token` should contain a + * {@link protos.google.spanner.admin.database.v1.ListDatabaseRolesResponse.next_page_token|next_page_token} + * from a previous + * {@link protos.google.spanner.admin.database.v1.ListDatabaseRolesResponse|ListDatabaseRolesResponse}. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.spanner.admin.database.v1.DatabaseRole|DatabaseRole}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listDatabaseRolesAsync( + request?: protos.google.spanner.admin.database.v1.IListDatabaseRolesRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listDatabaseRoles']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listDatabaseRoles iterate %j', request); + return this.descriptors.page.listDatabaseRoles.asyncIterate( + this.innerApiCalls['listDatabaseRoles'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists all the backup schedules for the database. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Database is the parent resource whose backup schedules should be + * listed. Values are of the form + * projects//instances//databases/ + * @param {number} [request.pageSize] + * Optional. Number of backup schedules to be returned in the response. If 0 + * or less, defaults to the server's maximum allowed page size. + * @param {string} [request.pageToken] + * Optional. If non-empty, `page_token` should contain a + * {@link protos.google.spanner.admin.database.v1.ListBackupSchedulesResponse.next_page_token|next_page_token} + * from a previous + * {@link protos.google.spanner.admin.database.v1.ListBackupSchedulesResponse|ListBackupSchedulesResponse} + * to the same `parent`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.spanner.admin.database.v1.BackupSchedule|BackupSchedule}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listBackupSchedulesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listBackupSchedules( + request?: protos.google.spanner.admin.database.v1.IListBackupSchedulesRequest, + options?: CallOptions): + Promise<[ + protos.google.spanner.admin.database.v1.IBackupSchedule[], + protos.google.spanner.admin.database.v1.IListBackupSchedulesRequest|null, + protos.google.spanner.admin.database.v1.IListBackupSchedulesResponse + ]>; + listBackupSchedules( + request: protos.google.spanner.admin.database.v1.IListBackupSchedulesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.spanner.admin.database.v1.IListBackupSchedulesRequest, + protos.google.spanner.admin.database.v1.IListBackupSchedulesResponse|null|undefined, + protos.google.spanner.admin.database.v1.IBackupSchedule>): void; + listBackupSchedules( + request: protos.google.spanner.admin.database.v1.IListBackupSchedulesRequest, + callback: PaginationCallback< + protos.google.spanner.admin.database.v1.IListBackupSchedulesRequest, + protos.google.spanner.admin.database.v1.IListBackupSchedulesResponse|null|undefined, + protos.google.spanner.admin.database.v1.IBackupSchedule>): void; + listBackupSchedules( + request?: protos.google.spanner.admin.database.v1.IListBackupSchedulesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.spanner.admin.database.v1.IListBackupSchedulesRequest, + protos.google.spanner.admin.database.v1.IListBackupSchedulesResponse|null|undefined, + protos.google.spanner.admin.database.v1.IBackupSchedule>, + callback?: PaginationCallback< + protos.google.spanner.admin.database.v1.IListBackupSchedulesRequest, + protos.google.spanner.admin.database.v1.IListBackupSchedulesResponse|null|undefined, + protos.google.spanner.admin.database.v1.IBackupSchedule>): + Promise<[ + protos.google.spanner.admin.database.v1.IBackupSchedule[], + protos.google.spanner.admin.database.v1.IListBackupSchedulesRequest|null, + protos.google.spanner.admin.database.v1.IListBackupSchedulesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.spanner.admin.database.v1.IListBackupSchedulesRequest, + protos.google.spanner.admin.database.v1.IListBackupSchedulesResponse|null|undefined, + protos.google.spanner.admin.database.v1.IBackupSchedule>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listBackupSchedules values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listBackupSchedules request %j', request); + return this.innerApiCalls + .listBackupSchedules(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.spanner.admin.database.v1.IBackupSchedule[], + protos.google.spanner.admin.database.v1.IListBackupSchedulesRequest|null, + protos.google.spanner.admin.database.v1.IListBackupSchedulesResponse + ]) => { + this._log.info('listBackupSchedules values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listBackupSchedules`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Database is the parent resource whose backup schedules should be + * listed. Values are of the form + * projects//instances//databases/ + * @param {number} [request.pageSize] + * Optional. Number of backup schedules to be returned in the response. If 0 + * or less, defaults to the server's maximum allowed page size. + * @param {string} [request.pageToken] + * Optional. If non-empty, `page_token` should contain a + * {@link protos.google.spanner.admin.database.v1.ListBackupSchedulesResponse.next_page_token|next_page_token} + * from a previous + * {@link protos.google.spanner.admin.database.v1.ListBackupSchedulesResponse|ListBackupSchedulesResponse} + * to the same `parent`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.spanner.admin.database.v1.BackupSchedule|BackupSchedule} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listBackupSchedulesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listBackupSchedulesStream( + request?: protos.google.spanner.admin.database.v1.IListBackupSchedulesRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listBackupSchedules']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listBackupSchedules stream %j', request); + return this.descriptors.page.listBackupSchedules.createStream( + this.innerApiCalls.listBackupSchedules as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listBackupSchedules`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Database is the parent resource whose backup schedules should be + * listed. Values are of the form + * projects//instances//databases/ + * @param {number} [request.pageSize] + * Optional. Number of backup schedules to be returned in the response. If 0 + * or less, defaults to the server's maximum allowed page size. + * @param {string} [request.pageToken] + * Optional. If non-empty, `page_token` should contain a + * {@link protos.google.spanner.admin.database.v1.ListBackupSchedulesResponse.next_page_token|next_page_token} + * from a previous + * {@link protos.google.spanner.admin.database.v1.ListBackupSchedulesResponse|ListBackupSchedulesResponse} + * to the same `parent`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.spanner.admin.database.v1.BackupSchedule|BackupSchedule}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listBackupSchedulesAsync( + request?: protos.google.spanner.admin.database.v1.IListBackupSchedulesRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listBackupSchedules']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listBackupSchedules iterate %j', request); + return this.descriptors.page.listBackupSchedules.asyncIterate( + this.innerApiCalls['listBackupSchedules'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } +/** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * 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 + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + 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'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | iteration protocols}. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + 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'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * for the details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + 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'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified backup resource name string. + * + * @param {string} project + * @param {string} instance + * @param {string} backup + * @returns {string} Resource name string. + */ + backupPath(project:string,instance:string,backup:string) { + return this.pathTemplates.backupPathTemplate.render({ + project: project, + instance: instance, + backup: backup, + }); + } + + /** + * Parse the project from Backup resource. + * + * @param {string} backupName + * A fully-qualified path representing Backup resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBackupName(backupName: string) { + return this.pathTemplates.backupPathTemplate.match(backupName).project; + } + + /** + * Parse the instance from Backup resource. + * + * @param {string} backupName + * A fully-qualified path representing Backup resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromBackupName(backupName: string) { + return this.pathTemplates.backupPathTemplate.match(backupName).instance; + } + + /** + * Parse the backup from Backup resource. + * + * @param {string} backupName + * A fully-qualified path representing Backup resource. + * @returns {string} A string representing the backup. + */ + matchBackupFromBackupName(backupName: string) { + return this.pathTemplates.backupPathTemplate.match(backupName).backup; + } + + /** + * Return a fully-qualified backupSchedule resource name string. + * + * @param {string} project + * @param {string} instance + * @param {string} database + * @param {string} schedule + * @returns {string} Resource name string. + */ + backupSchedulePath(project:string,instance:string,database:string,schedule:string) { + return this.pathTemplates.backupSchedulePathTemplate.render({ + project: project, + instance: instance, + database: database, + schedule: schedule, + }); + } + + /** + * Parse the project from BackupSchedule resource. + * + * @param {string} backupScheduleName + * A fully-qualified path representing BackupSchedule resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBackupScheduleName(backupScheduleName: string) { + return this.pathTemplates.backupSchedulePathTemplate.match(backupScheduleName).project; + } + + /** + * Parse the instance from BackupSchedule resource. + * + * @param {string} backupScheduleName + * A fully-qualified path representing BackupSchedule resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromBackupScheduleName(backupScheduleName: string) { + return this.pathTemplates.backupSchedulePathTemplate.match(backupScheduleName).instance; + } + + /** + * Parse the database from BackupSchedule resource. + * + * @param {string} backupScheduleName + * A fully-qualified path representing BackupSchedule resource. + * @returns {string} A string representing the database. + */ + matchDatabaseFromBackupScheduleName(backupScheduleName: string) { + return this.pathTemplates.backupSchedulePathTemplate.match(backupScheduleName).database; + } + + /** + * Parse the schedule from BackupSchedule resource. + * + * @param {string} backupScheduleName + * A fully-qualified path representing BackupSchedule resource. + * @returns {string} A string representing the schedule. + */ + matchScheduleFromBackupScheduleName(backupScheduleName: string) { + return this.pathTemplates.backupSchedulePathTemplate.match(backupScheduleName).schedule; + } + + /** + * Return a fully-qualified cryptoKey resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} key_ring + * @param {string} crypto_key + * @returns {string} Resource name string. + */ + cryptoKeyPath(project:string,location:string,keyRing:string,cryptoKey:string) { + return this.pathTemplates.cryptoKeyPathTemplate.render({ + project: project, + location: location, + key_ring: keyRing, + crypto_key: cryptoKey, + }); + } + + /** + * Parse the project from CryptoKey resource. + * + * @param {string} cryptoKeyName + * A fully-qualified path representing CryptoKey resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCryptoKeyName(cryptoKeyName: string) { + return this.pathTemplates.cryptoKeyPathTemplate.match(cryptoKeyName).project; + } + + /** + * Parse the location from CryptoKey resource. + * + * @param {string} cryptoKeyName + * A fully-qualified path representing CryptoKey resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCryptoKeyName(cryptoKeyName: string) { + return this.pathTemplates.cryptoKeyPathTemplate.match(cryptoKeyName).location; + } + + /** + * Parse the key_ring from CryptoKey resource. + * + * @param {string} cryptoKeyName + * A fully-qualified path representing CryptoKey resource. + * @returns {string} A string representing the key_ring. + */ + matchKeyRingFromCryptoKeyName(cryptoKeyName: string) { + return this.pathTemplates.cryptoKeyPathTemplate.match(cryptoKeyName).key_ring; + } + + /** + * Parse the crypto_key from CryptoKey resource. + * + * @param {string} cryptoKeyName + * A fully-qualified path representing CryptoKey resource. + * @returns {string} A string representing the crypto_key. + */ + matchCryptoKeyFromCryptoKeyName(cryptoKeyName: string) { + return this.pathTemplates.cryptoKeyPathTemplate.match(cryptoKeyName).crypto_key; + } + + /** + * Return a fully-qualified database resource name string. + * + * @param {string} project + * @param {string} instance + * @param {string} database + * @returns {string} Resource name string. + */ + databasePath(project:string,instance:string,database:string) { + return this.pathTemplates.databasePathTemplate.render({ + project: project, + instance: instance, + database: database, + }); + } + + /** + * Parse the project from Database resource. + * + * @param {string} databaseName + * A fully-qualified path representing Database resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDatabaseName(databaseName: string) { + return this.pathTemplates.databasePathTemplate.match(databaseName).project; + } + + /** + * Parse the instance from Database resource. + * + * @param {string} databaseName + * A fully-qualified path representing Database resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromDatabaseName(databaseName: string) { + return this.pathTemplates.databasePathTemplate.match(databaseName).instance; + } + + /** + * Parse the database from Database resource. + * + * @param {string} databaseName + * A fully-qualified path representing Database resource. + * @returns {string} A string representing the database. + */ + matchDatabaseFromDatabaseName(databaseName: string) { + return this.pathTemplates.databasePathTemplate.match(databaseName).database; + } + + /** + * Return a fully-qualified databaseRole resource name string. + * + * @param {string} project + * @param {string} instance + * @param {string} database + * @param {string} role + * @returns {string} Resource name string. + */ + databaseRolePath(project:string,instance:string,database:string,role:string) { + return this.pathTemplates.databaseRolePathTemplate.render({ + project: project, + instance: instance, + database: database, + role: role, + }); + } + + /** + * Parse the project from DatabaseRole resource. + * + * @param {string} databaseRoleName + * A fully-qualified path representing DatabaseRole resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDatabaseRoleName(databaseRoleName: string) { + return this.pathTemplates.databaseRolePathTemplate.match(databaseRoleName).project; + } + + /** + * Parse the instance from DatabaseRole resource. + * + * @param {string} databaseRoleName + * A fully-qualified path representing DatabaseRole resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromDatabaseRoleName(databaseRoleName: string) { + return this.pathTemplates.databaseRolePathTemplate.match(databaseRoleName).instance; + } + + /** + * Parse the database from DatabaseRole resource. + * + * @param {string} databaseRoleName + * A fully-qualified path representing DatabaseRole resource. + * @returns {string} A string representing the database. + */ + matchDatabaseFromDatabaseRoleName(databaseRoleName: string) { + return this.pathTemplates.databaseRolePathTemplate.match(databaseRoleName).database; + } + + /** + * Parse the role from DatabaseRole resource. + * + * @param {string} databaseRoleName + * A fully-qualified path representing DatabaseRole resource. + * @returns {string} A string representing the role. + */ + matchRoleFromDatabaseRoleName(databaseRoleName: string) { + return this.pathTemplates.databaseRolePathTemplate.match(databaseRoleName).role; + } + + /** + * Return a fully-qualified instance resource name string. + * + * @param {string} project + * @param {string} instance + * @returns {string} Resource name string. + */ + instancePath(project:string,instance:string) { + return this.pathTemplates.instancePathTemplate.render({ + project: project, + instance: instance, + }); + } + + /** + * Parse the project from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the project. + */ + matchProjectFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).project; + } + + /** + * Parse the instance from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).instance; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.databaseAdminStub && !this._terminated) { + return this.databaseAdminStub.then(stub => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + void this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} \ No newline at end of file diff --git a/owl-bot-staging/admin/database/v1/src/v1/database_admin_client_config.json b/owl-bot-staging/admin/database/v1/src/v1/database_admin_client_config.json new file mode 100644 index 000000000..5b58878bc --- /dev/null +++ b/owl-bot-staging/admin/database/v1/src/v1/database_admin_client_config.json @@ -0,0 +1,169 @@ +{ + "interfaces": { + "google.spanner.admin.database.v1.DatabaseAdmin": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + }, + "e9fafda332ce8a1702dc1575de3ca81c4feb4799": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 32000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ListDatabases": { + "timeout_millis": 3600000, + "retry_codes_name": "idempotent", + "retry_params_name": "e9fafda332ce8a1702dc1575de3ca81c4feb4799" + }, + "CreateDatabase": { + "timeout_millis": 3600000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetDatabase": { + "timeout_millis": 3600000, + "retry_codes_name": "idempotent", + "retry_params_name": "e9fafda332ce8a1702dc1575de3ca81c4feb4799" + }, + "UpdateDatabase": { + "timeout_millis": 3600000, + "retry_codes_name": "idempotent", + "retry_params_name": "e9fafda332ce8a1702dc1575de3ca81c4feb4799" + }, + "UpdateDatabaseDdl": { + "timeout_millis": 3600000, + "retry_codes_name": "idempotent", + "retry_params_name": "e9fafda332ce8a1702dc1575de3ca81c4feb4799" + }, + "DropDatabase": { + "timeout_millis": 3600000, + "retry_codes_name": "idempotent", + "retry_params_name": "e9fafda332ce8a1702dc1575de3ca81c4feb4799" + }, + "GetDatabaseDdl": { + "timeout_millis": 3600000, + "retry_codes_name": "idempotent", + "retry_params_name": "e9fafda332ce8a1702dc1575de3ca81c4feb4799" + }, + "SetIamPolicy": { + "timeout_millis": 30000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetIamPolicy": { + "timeout_millis": 30000, + "retry_codes_name": "idempotent", + "retry_params_name": "e9fafda332ce8a1702dc1575de3ca81c4feb4799" + }, + "TestIamPermissions": { + "timeout_millis": 30000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateBackup": { + "timeout_millis": 3600000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CopyBackup": { + "timeout_millis": 3600000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetBackup": { + "timeout_millis": 3600000, + "retry_codes_name": "idempotent", + "retry_params_name": "e9fafda332ce8a1702dc1575de3ca81c4feb4799" + }, + "UpdateBackup": { + "timeout_millis": 3600000, + "retry_codes_name": "idempotent", + "retry_params_name": "e9fafda332ce8a1702dc1575de3ca81c4feb4799" + }, + "DeleteBackup": { + "timeout_millis": 3600000, + "retry_codes_name": "idempotent", + "retry_params_name": "e9fafda332ce8a1702dc1575de3ca81c4feb4799" + }, + "ListBackups": { + "timeout_millis": 3600000, + "retry_codes_name": "idempotent", + "retry_params_name": "e9fafda332ce8a1702dc1575de3ca81c4feb4799" + }, + "RestoreDatabase": { + "timeout_millis": 3600000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListDatabaseOperations": { + "timeout_millis": 3600000, + "retry_codes_name": "idempotent", + "retry_params_name": "e9fafda332ce8a1702dc1575de3ca81c4feb4799" + }, + "ListBackupOperations": { + "timeout_millis": 3600000, + "retry_codes_name": "idempotent", + "retry_params_name": "e9fafda332ce8a1702dc1575de3ca81c4feb4799" + }, + "ListDatabaseRoles": { + "timeout_millis": 3600000, + "retry_codes_name": "idempotent", + "retry_params_name": "e9fafda332ce8a1702dc1575de3ca81c4feb4799" + }, + "AddSplitPoints": { + "timeout_millis": 3600000, + "retry_codes_name": "idempotent", + "retry_params_name": "e9fafda332ce8a1702dc1575de3ca81c4feb4799" + }, + "CreateBackupSchedule": { + "timeout_millis": 3600000, + "retry_codes_name": "idempotent", + "retry_params_name": "e9fafda332ce8a1702dc1575de3ca81c4feb4799" + }, + "GetBackupSchedule": { + "timeout_millis": 3600000, + "retry_codes_name": "idempotent", + "retry_params_name": "e9fafda332ce8a1702dc1575de3ca81c4feb4799" + }, + "UpdateBackupSchedule": { + "timeout_millis": 3600000, + "retry_codes_name": "idempotent", + "retry_params_name": "e9fafda332ce8a1702dc1575de3ca81c4feb4799" + }, + "DeleteBackupSchedule": { + "timeout_millis": 3600000, + "retry_codes_name": "idempotent", + "retry_params_name": "e9fafda332ce8a1702dc1575de3ca81c4feb4799" + }, + "ListBackupSchedules": { + "timeout_millis": 3600000, + "retry_codes_name": "idempotent", + "retry_params_name": "e9fafda332ce8a1702dc1575de3ca81c4feb4799" + }, + "InternalUpdateGraphOperation": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/admin/database/v1/src/v1/database_admin_proto_list.json b/owl-bot-staging/admin/database/v1/src/v1/database_admin_proto_list.json new file mode 100644 index 000000000..8d5db481c --- /dev/null +++ b/owl-bot-staging/admin/database/v1/src/v1/database_admin_proto_list.json @@ -0,0 +1,6 @@ +[ + "../../protos/google/spanner/admin/database/v1/backup.proto", + "../../protos/google/spanner/admin/database/v1/backup_schedule.proto", + "../../protos/google/spanner/admin/database/v1/common.proto", + "../../protos/google/spanner/admin/database/v1/spanner_database_admin.proto" +] diff --git a/owl-bot-staging/admin/database/v1/src/v1/gapic_metadata.json b/owl-bot-staging/admin/database/v1/src/v1/gapic_metadata.json new file mode 100644 index 000000000..ee4064fc1 --- /dev/null +++ b/owl-bot-staging/admin/database/v1/src/v1/gapic_metadata.json @@ -0,0 +1,317 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.spanner.admin.database.v1", + "libraryPackage": "@google-cloud/spanner", + "services": { + "DatabaseAdmin": { + "clients": { + "grpc": { + "libraryClient": "DatabaseAdminClient", + "rpcs": { + "GetDatabase": { + "methods": [ + "getDatabase" + ] + }, + "DropDatabase": { + "methods": [ + "dropDatabase" + ] + }, + "GetDatabaseDdl": { + "methods": [ + "getDatabaseDdl" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "GetBackup": { + "methods": [ + "getBackup" + ] + }, + "UpdateBackup": { + "methods": [ + "updateBackup" + ] + }, + "DeleteBackup": { + "methods": [ + "deleteBackup" + ] + }, + "AddSplitPoints": { + "methods": [ + "addSplitPoints" + ] + }, + "CreateBackupSchedule": { + "methods": [ + "createBackupSchedule" + ] + }, + "GetBackupSchedule": { + "methods": [ + "getBackupSchedule" + ] + }, + "UpdateBackupSchedule": { + "methods": [ + "updateBackupSchedule" + ] + }, + "DeleteBackupSchedule": { + "methods": [ + "deleteBackupSchedule" + ] + }, + "InternalUpdateGraphOperation": { + "methods": [ + "internalUpdateGraphOperation" + ] + }, + "CreateDatabase": { + "methods": [ + "createDatabase" + ] + }, + "UpdateDatabase": { + "methods": [ + "updateDatabase" + ] + }, + "UpdateDatabaseDdl": { + "methods": [ + "updateDatabaseDdl" + ] + }, + "CreateBackup": { + "methods": [ + "createBackup" + ] + }, + "CopyBackup": { + "methods": [ + "copyBackup" + ] + }, + "RestoreDatabase": { + "methods": [ + "restoreDatabase" + ] + }, + "ListDatabases": { + "methods": [ + "listDatabases", + "listDatabasesStream", + "listDatabasesAsync" + ] + }, + "ListBackups": { + "methods": [ + "listBackups", + "listBackupsStream", + "listBackupsAsync" + ] + }, + "ListDatabaseOperations": { + "methods": [ + "listDatabaseOperations", + "listDatabaseOperationsStream", + "listDatabaseOperationsAsync" + ] + }, + "ListBackupOperations": { + "methods": [ + "listBackupOperations", + "listBackupOperationsStream", + "listBackupOperationsAsync" + ] + }, + "ListDatabaseRoles": { + "methods": [ + "listDatabaseRoles", + "listDatabaseRolesStream", + "listDatabaseRolesAsync" + ] + }, + "ListBackupSchedules": { + "methods": [ + "listBackupSchedules", + "listBackupSchedulesStream", + "listBackupSchedulesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "DatabaseAdminClient", + "rpcs": { + "GetDatabase": { + "methods": [ + "getDatabase" + ] + }, + "DropDatabase": { + "methods": [ + "dropDatabase" + ] + }, + "GetDatabaseDdl": { + "methods": [ + "getDatabaseDdl" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "GetBackup": { + "methods": [ + "getBackup" + ] + }, + "UpdateBackup": { + "methods": [ + "updateBackup" + ] + }, + "DeleteBackup": { + "methods": [ + "deleteBackup" + ] + }, + "AddSplitPoints": { + "methods": [ + "addSplitPoints" + ] + }, + "CreateBackupSchedule": { + "methods": [ + "createBackupSchedule" + ] + }, + "GetBackupSchedule": { + "methods": [ + "getBackupSchedule" + ] + }, + "UpdateBackupSchedule": { + "methods": [ + "updateBackupSchedule" + ] + }, + "DeleteBackupSchedule": { + "methods": [ + "deleteBackupSchedule" + ] + }, + "InternalUpdateGraphOperation": { + "methods": [ + "internalUpdateGraphOperation" + ] + }, + "CreateDatabase": { + "methods": [ + "createDatabase" + ] + }, + "UpdateDatabase": { + "methods": [ + "updateDatabase" + ] + }, + "UpdateDatabaseDdl": { + "methods": [ + "updateDatabaseDdl" + ] + }, + "CreateBackup": { + "methods": [ + "createBackup" + ] + }, + "CopyBackup": { + "methods": [ + "copyBackup" + ] + }, + "RestoreDatabase": { + "methods": [ + "restoreDatabase" + ] + }, + "ListDatabases": { + "methods": [ + "listDatabases", + "listDatabasesStream", + "listDatabasesAsync" + ] + }, + "ListBackups": { + "methods": [ + "listBackups", + "listBackupsStream", + "listBackupsAsync" + ] + }, + "ListDatabaseOperations": { + "methods": [ + "listDatabaseOperations", + "listDatabaseOperationsStream", + "listDatabaseOperationsAsync" + ] + }, + "ListBackupOperations": { + "methods": [ + "listBackupOperations", + "listBackupOperationsStream", + "listBackupOperationsAsync" + ] + }, + "ListDatabaseRoles": { + "methods": [ + "listDatabaseRoles", + "listDatabaseRolesStream", + "listDatabaseRolesAsync" + ] + }, + "ListBackupSchedules": { + "methods": [ + "listBackupSchedules", + "listBackupSchedulesStream", + "listBackupSchedulesAsync" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/admin/database/v1/src/v1/index.ts b/owl-bot-staging/admin/database/v1/src/v1/index.ts new file mode 100644 index 000000000..125ff6efe --- /dev/null +++ b/owl-bot-staging/admin/database/v1/src/v1/index.ts @@ -0,0 +1,19 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +export {DatabaseAdminClient} from './database_admin_client'; diff --git a/owl-bot-staging/admin/database/v1/test/gapic_database_admin_v1.ts b/owl-bot-staging/admin/database/v1/test/gapic_database_admin_v1.ts new file mode 100644 index 000000000..b208d07b4 --- /dev/null +++ b/owl-bot-staging/admin/database/v1/test/gapic_database_admin_v1.ts @@ -0,0 +1,4820 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as databaseadminModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +} + +function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { mockStream.write({}); }); + } + setImmediate(() => { mockStream.end(); }); + } else { + setImmediate(() => { mockStream.write({}); }); + setImmediate(() => { mockStream.end(); }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + } + }; + } + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1.DatabaseAdminClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new databaseadminModule.v1.DatabaseAdminClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'spanner.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new databaseadminModule.v1.DatabaseAdminClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, "googleapis.com"); + }); + + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = databaseadminModule.v1.DatabaseAdminClient.servicePath; + assert.strictEqual(servicePath, 'spanner.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = databaseadminModule.v1.DatabaseAdminClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'spanner.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'spanner.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'spanner.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new databaseadminModule.v1.DatabaseAdminClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'spanner.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new databaseadminModule.v1.DatabaseAdminClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'spanner.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { new databaseadminModule.v1.DatabaseAdminClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = databaseadminModule.v1.DatabaseAdminClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new databaseadminModule.v1.DatabaseAdminClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.databaseAdminStub, undefined); + await client.initialize(); + assert(client.databaseAdminStub); + }); + + it('has close method for the initialized client', done => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize().catch(err => {throw err}); + assert(client.databaseAdminStub); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has close method for the non-initialized client', done => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.databaseAdminStub, undefined); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error|null, projectId?: string|null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + }); + + describe('getDatabase', () => { + it('invokes getDatabase without error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.GetDatabaseRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.GetDatabaseRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.spanner.admin.database.v1.Database() + ); + client.innerApiCalls.getDatabase = stubSimpleCall(expectedResponse); + const [response] = await client.getDatabase(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getDatabase as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getDatabase as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDatabase without error using callback', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.GetDatabaseRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.GetDatabaseRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.spanner.admin.database.v1.Database() + ); + client.innerApiCalls.getDatabase = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getDatabase( + request, + (err?: Error|null, result?: protos.google.spanner.admin.database.v1.IDatabase|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getDatabase as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getDatabase as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDatabase with error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.GetDatabaseRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.GetDatabaseRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getDatabase = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getDatabase(request), expectedError); + const actualRequest = (client.innerApiCalls.getDatabase as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getDatabase as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDatabase with closed client', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.GetDatabaseRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.GetDatabaseRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getDatabase(request), expectedError); + }); + }); + + describe('dropDatabase', () => { + it('invokes dropDatabase without error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.DropDatabaseRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.DropDatabaseRequest', ['database']); + request.database = defaultValue1; + const expectedHeaderRequestParams = `database=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.dropDatabase = stubSimpleCall(expectedResponse); + const [response] = await client.dropDatabase(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.dropDatabase as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.dropDatabase as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes dropDatabase without error using callback', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.DropDatabaseRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.DropDatabaseRequest', ['database']); + request.database = defaultValue1; + const expectedHeaderRequestParams = `database=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.dropDatabase = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.dropDatabase( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.dropDatabase as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.dropDatabase as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes dropDatabase with error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.DropDatabaseRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.DropDatabaseRequest', ['database']); + request.database = defaultValue1; + const expectedHeaderRequestParams = `database=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.dropDatabase = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.dropDatabase(request), expectedError); + const actualRequest = (client.innerApiCalls.dropDatabase as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.dropDatabase as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes dropDatabase with closed client', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.DropDatabaseRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.DropDatabaseRequest', ['database']); + request.database = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.dropDatabase(request), expectedError); + }); + }); + + describe('getDatabaseDdl', () => { + it('invokes getDatabaseDdl without error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.GetDatabaseDdlRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.GetDatabaseDdlRequest', ['database']); + request.database = defaultValue1; + const expectedHeaderRequestParams = `database=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.spanner.admin.database.v1.GetDatabaseDdlResponse() + ); + client.innerApiCalls.getDatabaseDdl = stubSimpleCall(expectedResponse); + const [response] = await client.getDatabaseDdl(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getDatabaseDdl as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getDatabaseDdl as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDatabaseDdl without error using callback', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.GetDatabaseDdlRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.GetDatabaseDdlRequest', ['database']); + request.database = defaultValue1; + const expectedHeaderRequestParams = `database=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.spanner.admin.database.v1.GetDatabaseDdlResponse() + ); + client.innerApiCalls.getDatabaseDdl = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getDatabaseDdl( + request, + (err?: Error|null, result?: protos.google.spanner.admin.database.v1.IGetDatabaseDdlResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getDatabaseDdl as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getDatabaseDdl as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDatabaseDdl with error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.GetDatabaseDdlRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.GetDatabaseDdlRequest', ['database']); + request.database = defaultValue1; + const expectedHeaderRequestParams = `database=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getDatabaseDdl = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getDatabaseDdl(request), expectedError); + const actualRequest = (client.innerApiCalls.getDatabaseDdl as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getDatabaseDdl as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDatabaseDdl with closed client', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.GetDatabaseDdlRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.GetDatabaseDdlRequest', ['database']); + request.database = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getDatabaseDdl(request), expectedError); + }); + }); + + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.SetIamPolicyRequest', ['resource']); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy() + ); + client.innerApiCalls.setIamPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.setIamPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setIamPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setIamPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setIamPolicy without error using callback', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.SetIamPolicyRequest', ['resource']); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy() + ); + client.innerApiCalls.setIamPolicy = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + (err?: Error|null, result?: protos.google.iam.v1.IPolicy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setIamPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setIamPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setIamPolicy with error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.SetIamPolicyRequest', ['resource']); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.setIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setIamPolicy(request), expectedError); + const actualRequest = (client.innerApiCalls.setIamPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setIamPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setIamPolicy with closed client', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.SetIamPolicyRequest', ['resource']); + request.resource = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.setIamPolicy(request), expectedError); + }); + }); + + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.GetIamPolicyRequest', ['resource']); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy() + ); + client.innerApiCalls.getIamPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.getIamPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getIamPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getIamPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getIamPolicy without error using callback', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.GetIamPolicyRequest', ['resource']); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy() + ); + client.innerApiCalls.getIamPolicy = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + (err?: Error|null, result?: protos.google.iam.v1.IPolicy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getIamPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getIamPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getIamPolicy with error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.GetIamPolicyRequest', ['resource']); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getIamPolicy(request), expectedError); + const actualRequest = (client.innerApiCalls.getIamPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getIamPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getIamPolicy with closed client', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.GetIamPolicyRequest', ['resource']); + request.resource = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getIamPolicy(request), expectedError); + }); + }); + + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.TestIamPermissionsRequest', ['resource']); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsResponse() + ); + client.innerApiCalls.testIamPermissions = stubSimpleCall(expectedResponse); + const [response] = await client.testIamPermissions(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes testIamPermissions without error using callback', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.TestIamPermissionsRequest', ['resource']); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsResponse() + ); + client.innerApiCalls.testIamPermissions = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + (err?: Error|null, result?: protos.google.iam.v1.ITestIamPermissionsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes testIamPermissions with error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.TestIamPermissionsRequest', ['resource']); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.testIamPermissions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.testIamPermissions(request), expectedError); + const actualRequest = (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes testIamPermissions with closed client', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.TestIamPermissionsRequest', ['resource']); + request.resource = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.testIamPermissions(request), expectedError); + }); + }); + + describe('getBackup', () => { + it('invokes getBackup without error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.GetBackupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.GetBackupRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.spanner.admin.database.v1.Backup() + ); + client.innerApiCalls.getBackup = stubSimpleCall(expectedResponse); + const [response] = await client.getBackup(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getBackup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getBackup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getBackup without error using callback', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.GetBackupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.GetBackupRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.spanner.admin.database.v1.Backup() + ); + client.innerApiCalls.getBackup = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getBackup( + request, + (err?: Error|null, result?: protos.google.spanner.admin.database.v1.IBackup|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getBackup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getBackup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getBackup with error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.GetBackupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.GetBackupRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getBackup = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getBackup(request), expectedError); + const actualRequest = (client.innerApiCalls.getBackup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getBackup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getBackup with closed client', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.GetBackupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.GetBackupRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getBackup(request), expectedError); + }); + }); + + describe('updateBackup', () => { + it('invokes updateBackup without error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.UpdateBackupRequest() + ); + request.backup ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.UpdateBackupRequest', ['backup', 'name']); + request.backup.name = defaultValue1; + const expectedHeaderRequestParams = `backup.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.spanner.admin.database.v1.Backup() + ); + client.innerApiCalls.updateBackup = stubSimpleCall(expectedResponse); + const [response] = await client.updateBackup(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateBackup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateBackup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateBackup without error using callback', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.UpdateBackupRequest() + ); + request.backup ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.UpdateBackupRequest', ['backup', 'name']); + request.backup.name = defaultValue1; + const expectedHeaderRequestParams = `backup.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.spanner.admin.database.v1.Backup() + ); + client.innerApiCalls.updateBackup = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateBackup( + request, + (err?: Error|null, result?: protos.google.spanner.admin.database.v1.IBackup|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateBackup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateBackup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateBackup with error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.UpdateBackupRequest() + ); + request.backup ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.UpdateBackupRequest', ['backup', 'name']); + request.backup.name = defaultValue1; + const expectedHeaderRequestParams = `backup.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateBackup = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateBackup(request), expectedError); + const actualRequest = (client.innerApiCalls.updateBackup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateBackup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateBackup with closed client', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.UpdateBackupRequest() + ); + request.backup ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.UpdateBackupRequest', ['backup', 'name']); + request.backup.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.updateBackup(request), expectedError); + }); + }); + + describe('deleteBackup', () => { + it('invokes deleteBackup without error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.DeleteBackupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.DeleteBackupRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteBackup = stubSimpleCall(expectedResponse); + const [response] = await client.deleteBackup(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteBackup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteBackup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteBackup without error using callback', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.DeleteBackupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.DeleteBackupRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteBackup = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteBackup( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteBackup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteBackup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteBackup with error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.DeleteBackupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.DeleteBackupRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteBackup = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteBackup(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteBackup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteBackup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteBackup with closed client', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.DeleteBackupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.DeleteBackupRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.deleteBackup(request), expectedError); + }); + }); + + describe('addSplitPoints', () => { + it('invokes addSplitPoints without error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.AddSplitPointsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.AddSplitPointsRequest', ['database']); + request.database = defaultValue1; + const expectedHeaderRequestParams = `database=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.spanner.admin.database.v1.AddSplitPointsResponse() + ); + client.innerApiCalls.addSplitPoints = stubSimpleCall(expectedResponse); + const [response] = await client.addSplitPoints(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.addSplitPoints as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.addSplitPoints as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes addSplitPoints without error using callback', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.AddSplitPointsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.AddSplitPointsRequest', ['database']); + request.database = defaultValue1; + const expectedHeaderRequestParams = `database=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.spanner.admin.database.v1.AddSplitPointsResponse() + ); + client.innerApiCalls.addSplitPoints = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.addSplitPoints( + request, + (err?: Error|null, result?: protos.google.spanner.admin.database.v1.IAddSplitPointsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.addSplitPoints as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.addSplitPoints as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes addSplitPoints with error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.AddSplitPointsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.AddSplitPointsRequest', ['database']); + request.database = defaultValue1; + const expectedHeaderRequestParams = `database=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.addSplitPoints = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.addSplitPoints(request), expectedError); + const actualRequest = (client.innerApiCalls.addSplitPoints as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.addSplitPoints as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes addSplitPoints with closed client', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.AddSplitPointsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.AddSplitPointsRequest', ['database']); + request.database = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.addSplitPoints(request), expectedError); + }); + }); + + describe('createBackupSchedule', () => { + it('invokes createBackupSchedule without error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.CreateBackupScheduleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.CreateBackupScheduleRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.spanner.admin.database.v1.BackupSchedule() + ); + client.innerApiCalls.createBackupSchedule = stubSimpleCall(expectedResponse); + const [response] = await client.createBackupSchedule(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createBackupSchedule as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createBackupSchedule as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createBackupSchedule without error using callback', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.CreateBackupScheduleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.CreateBackupScheduleRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.spanner.admin.database.v1.BackupSchedule() + ); + client.innerApiCalls.createBackupSchedule = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createBackupSchedule( + request, + (err?: Error|null, result?: protos.google.spanner.admin.database.v1.IBackupSchedule|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createBackupSchedule as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createBackupSchedule as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createBackupSchedule with error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.CreateBackupScheduleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.CreateBackupScheduleRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createBackupSchedule = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createBackupSchedule(request), expectedError); + const actualRequest = (client.innerApiCalls.createBackupSchedule as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createBackupSchedule as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createBackupSchedule with closed client', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.CreateBackupScheduleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.CreateBackupScheduleRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.createBackupSchedule(request), expectedError); + }); + }); + + describe('getBackupSchedule', () => { + it('invokes getBackupSchedule without error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.GetBackupScheduleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.GetBackupScheduleRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.spanner.admin.database.v1.BackupSchedule() + ); + client.innerApiCalls.getBackupSchedule = stubSimpleCall(expectedResponse); + const [response] = await client.getBackupSchedule(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getBackupSchedule as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getBackupSchedule as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getBackupSchedule without error using callback', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.GetBackupScheduleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.GetBackupScheduleRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.spanner.admin.database.v1.BackupSchedule() + ); + client.innerApiCalls.getBackupSchedule = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getBackupSchedule( + request, + (err?: Error|null, result?: protos.google.spanner.admin.database.v1.IBackupSchedule|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getBackupSchedule as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getBackupSchedule as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getBackupSchedule with error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.GetBackupScheduleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.GetBackupScheduleRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getBackupSchedule = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getBackupSchedule(request), expectedError); + const actualRequest = (client.innerApiCalls.getBackupSchedule as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getBackupSchedule as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getBackupSchedule with closed client', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.GetBackupScheduleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.GetBackupScheduleRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getBackupSchedule(request), expectedError); + }); + }); + + describe('updateBackupSchedule', () => { + it('invokes updateBackupSchedule without error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.UpdateBackupScheduleRequest() + ); + request.backupSchedule ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.UpdateBackupScheduleRequest', ['backupSchedule', 'name']); + request.backupSchedule.name = defaultValue1; + const expectedHeaderRequestParams = `backup_schedule.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.spanner.admin.database.v1.BackupSchedule() + ); + client.innerApiCalls.updateBackupSchedule = stubSimpleCall(expectedResponse); + const [response] = await client.updateBackupSchedule(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateBackupSchedule as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateBackupSchedule as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateBackupSchedule without error using callback', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.UpdateBackupScheduleRequest() + ); + request.backupSchedule ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.UpdateBackupScheduleRequest', ['backupSchedule', 'name']); + request.backupSchedule.name = defaultValue1; + const expectedHeaderRequestParams = `backup_schedule.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.spanner.admin.database.v1.BackupSchedule() + ); + client.innerApiCalls.updateBackupSchedule = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateBackupSchedule( + request, + (err?: Error|null, result?: protos.google.spanner.admin.database.v1.IBackupSchedule|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateBackupSchedule as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateBackupSchedule as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateBackupSchedule with error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.UpdateBackupScheduleRequest() + ); + request.backupSchedule ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.UpdateBackupScheduleRequest', ['backupSchedule', 'name']); + request.backupSchedule.name = defaultValue1; + const expectedHeaderRequestParams = `backup_schedule.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateBackupSchedule = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateBackupSchedule(request), expectedError); + const actualRequest = (client.innerApiCalls.updateBackupSchedule as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateBackupSchedule as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateBackupSchedule with closed client', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.UpdateBackupScheduleRequest() + ); + request.backupSchedule ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.UpdateBackupScheduleRequest', ['backupSchedule', 'name']); + request.backupSchedule.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.updateBackupSchedule(request), expectedError); + }); + }); + + describe('deleteBackupSchedule', () => { + it('invokes deleteBackupSchedule without error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.DeleteBackupScheduleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.DeleteBackupScheduleRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteBackupSchedule = stubSimpleCall(expectedResponse); + const [response] = await client.deleteBackupSchedule(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteBackupSchedule as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteBackupSchedule as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteBackupSchedule without error using callback', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.DeleteBackupScheduleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.DeleteBackupScheduleRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteBackupSchedule = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteBackupSchedule( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteBackupSchedule as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteBackupSchedule as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteBackupSchedule with error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.DeleteBackupScheduleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.DeleteBackupScheduleRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteBackupSchedule = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteBackupSchedule(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteBackupSchedule as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteBackupSchedule as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteBackupSchedule with closed client', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.DeleteBackupScheduleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.DeleteBackupScheduleRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.deleteBackupSchedule(request), expectedError); + }); + }); + + describe('internalUpdateGraphOperation', () => { + it('invokes internalUpdateGraphOperation without error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse() + ); + client.innerApiCalls.internalUpdateGraphOperation = stubSimpleCall(expectedResponse); + const [response] = await client.internalUpdateGraphOperation(request); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes internalUpdateGraphOperation without error using callback', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse() + ); + client.innerApiCalls.internalUpdateGraphOperation = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.internalUpdateGraphOperation( + request, + (err?: Error|null, result?: protos.google.spanner.admin.database.v1.IInternalUpdateGraphOperationResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes internalUpdateGraphOperation with error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.internalUpdateGraphOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.internalUpdateGraphOperation(request), expectedError); + }); + + it('invokes internalUpdateGraphOperation with closed client', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest() + ); + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.internalUpdateGraphOperation(request), expectedError); + }); + }); + + describe('createDatabase', () => { + it('invokes createDatabase without error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.CreateDatabaseRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.CreateDatabaseRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createDatabase = stubLongRunningCall(expectedResponse); + const [operation] = await client.createDatabase(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createDatabase as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createDatabase as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDatabase without error using callback', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.CreateDatabaseRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.CreateDatabaseRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createDatabase = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createDatabase( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createDatabase as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createDatabase as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDatabase with call error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.CreateDatabaseRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.CreateDatabaseRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createDatabase = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createDatabase(request), expectedError); + const actualRequest = (client.innerApiCalls.createDatabase as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createDatabase as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDatabase with LRO error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.CreateDatabaseRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.CreateDatabaseRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createDatabase = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createDatabase(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.createDatabase as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createDatabase as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateDatabaseProgress without error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateDatabaseProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateDatabaseProgress with error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkCreateDatabaseProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('updateDatabase', () => { + it('invokes updateDatabase without error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.UpdateDatabaseRequest() + ); + request.database ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.UpdateDatabaseRequest', ['database', 'name']); + request.database.name = defaultValue1; + const expectedHeaderRequestParams = `database.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateDatabase = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateDatabase(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateDatabase as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateDatabase as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDatabase without error using callback', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.UpdateDatabaseRequest() + ); + request.database ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.UpdateDatabaseRequest', ['database', 'name']); + request.database.name = defaultValue1; + const expectedHeaderRequestParams = `database.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateDatabase = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateDatabase( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateDatabase as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateDatabase as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDatabase with call error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.UpdateDatabaseRequest() + ); + request.database ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.UpdateDatabaseRequest', ['database', 'name']); + request.database.name = defaultValue1; + const expectedHeaderRequestParams = `database.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateDatabase = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.updateDatabase(request), expectedError); + const actualRequest = (client.innerApiCalls.updateDatabase as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateDatabase as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDatabase with LRO error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.UpdateDatabaseRequest() + ); + request.database ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.UpdateDatabaseRequest', ['database', 'name']); + request.database.name = defaultValue1; + const expectedHeaderRequestParams = `database.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateDatabase = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.updateDatabase(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.updateDatabase as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateDatabase as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateDatabaseProgress without error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateDatabaseProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateDatabaseProgress with error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkUpdateDatabaseProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('updateDatabaseDdl', () => { + it('invokes updateDatabaseDdl without error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.UpdateDatabaseDdlRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.UpdateDatabaseDdlRequest', ['database']); + request.database = defaultValue1; + const expectedHeaderRequestParams = `database=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateDatabaseDdl = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateDatabaseDdl(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateDatabaseDdl as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateDatabaseDdl as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDatabaseDdl without error using callback', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.UpdateDatabaseDdlRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.UpdateDatabaseDdlRequest', ['database']); + request.database = defaultValue1; + const expectedHeaderRequestParams = `database=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateDatabaseDdl = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateDatabaseDdl( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateDatabaseDdl as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateDatabaseDdl as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDatabaseDdl with call error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.UpdateDatabaseDdlRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.UpdateDatabaseDdlRequest', ['database']); + request.database = defaultValue1; + const expectedHeaderRequestParams = `database=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateDatabaseDdl = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.updateDatabaseDdl(request), expectedError); + const actualRequest = (client.innerApiCalls.updateDatabaseDdl as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateDatabaseDdl as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDatabaseDdl with LRO error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.UpdateDatabaseDdlRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.UpdateDatabaseDdlRequest', ['database']); + request.database = defaultValue1; + const expectedHeaderRequestParams = `database=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateDatabaseDdl = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.updateDatabaseDdl(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.updateDatabaseDdl as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateDatabaseDdl as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateDatabaseDdlProgress without error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateDatabaseDdlProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateDatabaseDdlProgress with error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkUpdateDatabaseDdlProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('createBackup', () => { + it('invokes createBackup without error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.CreateBackupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.CreateBackupRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createBackup = stubLongRunningCall(expectedResponse); + const [operation] = await client.createBackup(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createBackup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createBackup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createBackup without error using callback', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.CreateBackupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.CreateBackupRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createBackup = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createBackup( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createBackup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createBackup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createBackup with call error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.CreateBackupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.CreateBackupRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createBackup = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createBackup(request), expectedError); + const actualRequest = (client.innerApiCalls.createBackup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createBackup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createBackup with LRO error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.CreateBackupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.CreateBackupRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createBackup = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createBackup(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.createBackup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createBackup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateBackupProgress without error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateBackupProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateBackupProgress with error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkCreateBackupProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('copyBackup', () => { + it('invokes copyBackup without error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.CopyBackupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.CopyBackupRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.copyBackup = stubLongRunningCall(expectedResponse); + const [operation] = await client.copyBackup(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.copyBackup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.copyBackup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes copyBackup without error using callback', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.CopyBackupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.CopyBackupRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.copyBackup = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.copyBackup( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.copyBackup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.copyBackup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes copyBackup with call error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.CopyBackupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.CopyBackupRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.copyBackup = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.copyBackup(request), expectedError); + const actualRequest = (client.innerApiCalls.copyBackup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.copyBackup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes copyBackup with LRO error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.CopyBackupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.CopyBackupRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.copyBackup = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.copyBackup(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.copyBackup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.copyBackup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCopyBackupProgress without error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCopyBackupProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCopyBackupProgress with error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkCopyBackupProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('restoreDatabase', () => { + it('invokes restoreDatabase without error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.RestoreDatabaseRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.RestoreDatabaseRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.restoreDatabase = stubLongRunningCall(expectedResponse); + const [operation] = await client.restoreDatabase(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.restoreDatabase as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.restoreDatabase as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes restoreDatabase without error using callback', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.RestoreDatabaseRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.RestoreDatabaseRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.restoreDatabase = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.restoreDatabase( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.restoreDatabase as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.restoreDatabase as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes restoreDatabase with call error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.RestoreDatabaseRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.RestoreDatabaseRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.restoreDatabase = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.restoreDatabase(request), expectedError); + const actualRequest = (client.innerApiCalls.restoreDatabase as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.restoreDatabase as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes restoreDatabase with LRO error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.RestoreDatabaseRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.RestoreDatabaseRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.restoreDatabase = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.restoreDatabase(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.restoreDatabase as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.restoreDatabase as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkRestoreDatabaseProgress without error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkRestoreDatabaseProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkRestoreDatabaseProgress with error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkRestoreDatabaseProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('listDatabases', () => { + it('invokes listDatabases without error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.ListDatabasesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.ListDatabasesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.spanner.admin.database.v1.Database()), + generateSampleMessage(new protos.google.spanner.admin.database.v1.Database()), + generateSampleMessage(new protos.google.spanner.admin.database.v1.Database()), + ]; + client.innerApiCalls.listDatabases = stubSimpleCall(expectedResponse); + const [response] = await client.listDatabases(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listDatabases as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listDatabases as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDatabases without error using callback', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.ListDatabasesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.ListDatabasesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.spanner.admin.database.v1.Database()), + generateSampleMessage(new protos.google.spanner.admin.database.v1.Database()), + generateSampleMessage(new protos.google.spanner.admin.database.v1.Database()), + ]; + client.innerApiCalls.listDatabases = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listDatabases( + request, + (err?: Error|null, result?: protos.google.spanner.admin.database.v1.IDatabase[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listDatabases as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listDatabases as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDatabases with error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.ListDatabasesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.ListDatabasesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listDatabases = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listDatabases(request), expectedError); + const actualRequest = (client.innerApiCalls.listDatabases as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listDatabases as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDatabasesStream without error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.ListDatabasesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.ListDatabasesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.spanner.admin.database.v1.Database()), + generateSampleMessage(new protos.google.spanner.admin.database.v1.Database()), + generateSampleMessage(new protos.google.spanner.admin.database.v1.Database()), + ]; + client.descriptors.page.listDatabases.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listDatabasesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.spanner.admin.database.v1.Database[] = []; + stream.on('data', (response: protos.google.spanner.admin.database.v1.Database) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listDatabases.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listDatabases, request)); + assert( + (client.descriptors.page.listDatabases.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listDatabasesStream with error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.ListDatabasesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.ListDatabasesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listDatabases.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listDatabasesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.spanner.admin.database.v1.Database[] = []; + stream.on('data', (response: protos.google.spanner.admin.database.v1.Database) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listDatabases.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listDatabases, request)); + assert( + (client.descriptors.page.listDatabases.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listDatabases without error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.ListDatabasesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.ListDatabasesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.spanner.admin.database.v1.Database()), + generateSampleMessage(new protos.google.spanner.admin.database.v1.Database()), + generateSampleMessage(new protos.google.spanner.admin.database.v1.Database()), + ]; + client.descriptors.page.listDatabases.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.spanner.admin.database.v1.IDatabase[] = []; + const iterable = client.listDatabasesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listDatabases.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listDatabases.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listDatabases with error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.ListDatabasesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.ListDatabasesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listDatabases.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listDatabasesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.spanner.admin.database.v1.IDatabase[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listDatabases.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listDatabases.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listBackups', () => { + it('invokes listBackups without error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.ListBackupsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.ListBackupsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.spanner.admin.database.v1.Backup()), + generateSampleMessage(new protos.google.spanner.admin.database.v1.Backup()), + generateSampleMessage(new protos.google.spanner.admin.database.v1.Backup()), + ]; + client.innerApiCalls.listBackups = stubSimpleCall(expectedResponse); + const [response] = await client.listBackups(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listBackups as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listBackups as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listBackups without error using callback', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.ListBackupsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.ListBackupsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.spanner.admin.database.v1.Backup()), + generateSampleMessage(new protos.google.spanner.admin.database.v1.Backup()), + generateSampleMessage(new protos.google.spanner.admin.database.v1.Backup()), + ]; + client.innerApiCalls.listBackups = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listBackups( + request, + (err?: Error|null, result?: protos.google.spanner.admin.database.v1.IBackup[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listBackups as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listBackups as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listBackups with error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.ListBackupsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.ListBackupsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listBackups = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listBackups(request), expectedError); + const actualRequest = (client.innerApiCalls.listBackups as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listBackups as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listBackupsStream without error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.ListBackupsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.ListBackupsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.spanner.admin.database.v1.Backup()), + generateSampleMessage(new protos.google.spanner.admin.database.v1.Backup()), + generateSampleMessage(new protos.google.spanner.admin.database.v1.Backup()), + ]; + client.descriptors.page.listBackups.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listBackupsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.spanner.admin.database.v1.Backup[] = []; + stream.on('data', (response: protos.google.spanner.admin.database.v1.Backup) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listBackups.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listBackups, request)); + assert( + (client.descriptors.page.listBackups.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listBackupsStream with error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.ListBackupsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.ListBackupsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listBackups.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listBackupsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.spanner.admin.database.v1.Backup[] = []; + stream.on('data', (response: protos.google.spanner.admin.database.v1.Backup) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listBackups.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listBackups, request)); + assert( + (client.descriptors.page.listBackups.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listBackups without error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.ListBackupsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.ListBackupsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.spanner.admin.database.v1.Backup()), + generateSampleMessage(new protos.google.spanner.admin.database.v1.Backup()), + generateSampleMessage(new protos.google.spanner.admin.database.v1.Backup()), + ]; + client.descriptors.page.listBackups.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.spanner.admin.database.v1.IBackup[] = []; + const iterable = client.listBackupsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listBackups.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listBackups.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listBackups with error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.ListBackupsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.ListBackupsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listBackups.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listBackupsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.spanner.admin.database.v1.IBackup[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listBackups.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listBackups.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listDatabaseOperations', () => { + it('invokes listDatabaseOperations without error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.ListDatabaseOperationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.ListDatabaseOperationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.longrunning.Operation()), + generateSampleMessage(new protos.google.longrunning.Operation()), + generateSampleMessage(new protos.google.longrunning.Operation()), + ]; + client.innerApiCalls.listDatabaseOperations = stubSimpleCall(expectedResponse); + const [response] = await client.listDatabaseOperations(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listDatabaseOperations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listDatabaseOperations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDatabaseOperations without error using callback', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.ListDatabaseOperationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.ListDatabaseOperationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.longrunning.Operation()), + generateSampleMessage(new protos.google.longrunning.Operation()), + generateSampleMessage(new protos.google.longrunning.Operation()), + ]; + client.innerApiCalls.listDatabaseOperations = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listDatabaseOperations( + request, + (err?: Error|null, result?: protos.google.longrunning.IOperation[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listDatabaseOperations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listDatabaseOperations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDatabaseOperations with error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.ListDatabaseOperationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.ListDatabaseOperationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listDatabaseOperations = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listDatabaseOperations(request), expectedError); + const actualRequest = (client.innerApiCalls.listDatabaseOperations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listDatabaseOperations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDatabaseOperationsStream without error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.ListDatabaseOperationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.ListDatabaseOperationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.longrunning.Operation()), + generateSampleMessage(new protos.google.longrunning.Operation()), + generateSampleMessage(new protos.google.longrunning.Operation()), + ]; + client.descriptors.page.listDatabaseOperations.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listDatabaseOperationsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.longrunning.Operation[] = []; + stream.on('data', (response: protos.google.longrunning.Operation) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listDatabaseOperations.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listDatabaseOperations, request)); + assert( + (client.descriptors.page.listDatabaseOperations.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listDatabaseOperationsStream with error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.ListDatabaseOperationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.ListDatabaseOperationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listDatabaseOperations.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listDatabaseOperationsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.longrunning.Operation[] = []; + stream.on('data', (response: protos.google.longrunning.Operation) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listDatabaseOperations.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listDatabaseOperations, request)); + assert( + (client.descriptors.page.listDatabaseOperations.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listDatabaseOperations without error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.ListDatabaseOperationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.ListDatabaseOperationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.longrunning.Operation()), + generateSampleMessage(new protos.google.longrunning.Operation()), + generateSampleMessage(new protos.google.longrunning.Operation()), + ]; + client.descriptors.page.listDatabaseOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.longrunning.IOperation[] = []; + const iterable = client.listDatabaseOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listDatabaseOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listDatabaseOperations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listDatabaseOperations with error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.ListDatabaseOperationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.ListDatabaseOperationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listDatabaseOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listDatabaseOperationsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.longrunning.IOperation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listDatabaseOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listDatabaseOperations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listBackupOperations', () => { + it('invokes listBackupOperations without error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.ListBackupOperationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.ListBackupOperationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.longrunning.Operation()), + generateSampleMessage(new protos.google.longrunning.Operation()), + generateSampleMessage(new protos.google.longrunning.Operation()), + ]; + client.innerApiCalls.listBackupOperations = stubSimpleCall(expectedResponse); + const [response] = await client.listBackupOperations(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listBackupOperations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listBackupOperations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listBackupOperations without error using callback', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.ListBackupOperationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.ListBackupOperationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.longrunning.Operation()), + generateSampleMessage(new protos.google.longrunning.Operation()), + generateSampleMessage(new protos.google.longrunning.Operation()), + ]; + client.innerApiCalls.listBackupOperations = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listBackupOperations( + request, + (err?: Error|null, result?: protos.google.longrunning.IOperation[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listBackupOperations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listBackupOperations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listBackupOperations with error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.ListBackupOperationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.ListBackupOperationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listBackupOperations = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listBackupOperations(request), expectedError); + const actualRequest = (client.innerApiCalls.listBackupOperations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listBackupOperations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listBackupOperationsStream without error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.ListBackupOperationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.ListBackupOperationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.longrunning.Operation()), + generateSampleMessage(new protos.google.longrunning.Operation()), + generateSampleMessage(new protos.google.longrunning.Operation()), + ]; + client.descriptors.page.listBackupOperations.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listBackupOperationsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.longrunning.Operation[] = []; + stream.on('data', (response: protos.google.longrunning.Operation) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listBackupOperations.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listBackupOperations, request)); + assert( + (client.descriptors.page.listBackupOperations.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listBackupOperationsStream with error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.ListBackupOperationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.ListBackupOperationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listBackupOperations.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listBackupOperationsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.longrunning.Operation[] = []; + stream.on('data', (response: protos.google.longrunning.Operation) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listBackupOperations.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listBackupOperations, request)); + assert( + (client.descriptors.page.listBackupOperations.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listBackupOperations without error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.ListBackupOperationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.ListBackupOperationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.longrunning.Operation()), + generateSampleMessage(new protos.google.longrunning.Operation()), + generateSampleMessage(new protos.google.longrunning.Operation()), + ]; + client.descriptors.page.listBackupOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.longrunning.IOperation[] = []; + const iterable = client.listBackupOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listBackupOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listBackupOperations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listBackupOperations with error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.ListBackupOperationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.ListBackupOperationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listBackupOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listBackupOperationsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.longrunning.IOperation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listBackupOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listBackupOperations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listDatabaseRoles', () => { + it('invokes listDatabaseRoles without error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.ListDatabaseRolesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.ListDatabaseRolesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.spanner.admin.database.v1.DatabaseRole()), + generateSampleMessage(new protos.google.spanner.admin.database.v1.DatabaseRole()), + generateSampleMessage(new protos.google.spanner.admin.database.v1.DatabaseRole()), + ]; + client.innerApiCalls.listDatabaseRoles = stubSimpleCall(expectedResponse); + const [response] = await client.listDatabaseRoles(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listDatabaseRoles as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listDatabaseRoles as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDatabaseRoles without error using callback', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.ListDatabaseRolesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.ListDatabaseRolesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.spanner.admin.database.v1.DatabaseRole()), + generateSampleMessage(new protos.google.spanner.admin.database.v1.DatabaseRole()), + generateSampleMessage(new protos.google.spanner.admin.database.v1.DatabaseRole()), + ]; + client.innerApiCalls.listDatabaseRoles = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listDatabaseRoles( + request, + (err?: Error|null, result?: protos.google.spanner.admin.database.v1.IDatabaseRole[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listDatabaseRoles as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listDatabaseRoles as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDatabaseRoles with error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.ListDatabaseRolesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.ListDatabaseRolesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listDatabaseRoles = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listDatabaseRoles(request), expectedError); + const actualRequest = (client.innerApiCalls.listDatabaseRoles as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listDatabaseRoles as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDatabaseRolesStream without error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.ListDatabaseRolesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.ListDatabaseRolesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.spanner.admin.database.v1.DatabaseRole()), + generateSampleMessage(new protos.google.spanner.admin.database.v1.DatabaseRole()), + generateSampleMessage(new protos.google.spanner.admin.database.v1.DatabaseRole()), + ]; + client.descriptors.page.listDatabaseRoles.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listDatabaseRolesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.spanner.admin.database.v1.DatabaseRole[] = []; + stream.on('data', (response: protos.google.spanner.admin.database.v1.DatabaseRole) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listDatabaseRoles.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listDatabaseRoles, request)); + assert( + (client.descriptors.page.listDatabaseRoles.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listDatabaseRolesStream with error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.ListDatabaseRolesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.ListDatabaseRolesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listDatabaseRoles.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listDatabaseRolesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.spanner.admin.database.v1.DatabaseRole[] = []; + stream.on('data', (response: protos.google.spanner.admin.database.v1.DatabaseRole) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listDatabaseRoles.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listDatabaseRoles, request)); + assert( + (client.descriptors.page.listDatabaseRoles.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listDatabaseRoles without error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.ListDatabaseRolesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.ListDatabaseRolesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.spanner.admin.database.v1.DatabaseRole()), + generateSampleMessage(new protos.google.spanner.admin.database.v1.DatabaseRole()), + generateSampleMessage(new protos.google.spanner.admin.database.v1.DatabaseRole()), + ]; + client.descriptors.page.listDatabaseRoles.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.spanner.admin.database.v1.IDatabaseRole[] = []; + const iterable = client.listDatabaseRolesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listDatabaseRoles.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listDatabaseRoles.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listDatabaseRoles with error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.ListDatabaseRolesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.ListDatabaseRolesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listDatabaseRoles.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listDatabaseRolesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.spanner.admin.database.v1.IDatabaseRole[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listDatabaseRoles.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listDatabaseRoles.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listBackupSchedules', () => { + it('invokes listBackupSchedules without error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.ListBackupSchedulesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.ListBackupSchedulesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.spanner.admin.database.v1.BackupSchedule()), + generateSampleMessage(new protos.google.spanner.admin.database.v1.BackupSchedule()), + generateSampleMessage(new protos.google.spanner.admin.database.v1.BackupSchedule()), + ]; + client.innerApiCalls.listBackupSchedules = stubSimpleCall(expectedResponse); + const [response] = await client.listBackupSchedules(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listBackupSchedules as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listBackupSchedules as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listBackupSchedules without error using callback', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.ListBackupSchedulesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.ListBackupSchedulesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.spanner.admin.database.v1.BackupSchedule()), + generateSampleMessage(new protos.google.spanner.admin.database.v1.BackupSchedule()), + generateSampleMessage(new protos.google.spanner.admin.database.v1.BackupSchedule()), + ]; + client.innerApiCalls.listBackupSchedules = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listBackupSchedules( + request, + (err?: Error|null, result?: protos.google.spanner.admin.database.v1.IBackupSchedule[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listBackupSchedules as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listBackupSchedules as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listBackupSchedules with error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.ListBackupSchedulesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.ListBackupSchedulesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listBackupSchedules = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listBackupSchedules(request), expectedError); + const actualRequest = (client.innerApiCalls.listBackupSchedules as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listBackupSchedules as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listBackupSchedulesStream without error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.ListBackupSchedulesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.ListBackupSchedulesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.spanner.admin.database.v1.BackupSchedule()), + generateSampleMessage(new protos.google.spanner.admin.database.v1.BackupSchedule()), + generateSampleMessage(new protos.google.spanner.admin.database.v1.BackupSchedule()), + ]; + client.descriptors.page.listBackupSchedules.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listBackupSchedulesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.spanner.admin.database.v1.BackupSchedule[] = []; + stream.on('data', (response: protos.google.spanner.admin.database.v1.BackupSchedule) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listBackupSchedules.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listBackupSchedules, request)); + assert( + (client.descriptors.page.listBackupSchedules.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listBackupSchedulesStream with error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.ListBackupSchedulesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.ListBackupSchedulesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listBackupSchedules.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listBackupSchedulesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.spanner.admin.database.v1.BackupSchedule[] = []; + stream.on('data', (response: protos.google.spanner.admin.database.v1.BackupSchedule) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listBackupSchedules.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listBackupSchedules, request)); + assert( + (client.descriptors.page.listBackupSchedules.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listBackupSchedules without error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.ListBackupSchedulesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.ListBackupSchedulesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.spanner.admin.database.v1.BackupSchedule()), + generateSampleMessage(new protos.google.spanner.admin.database.v1.BackupSchedule()), + generateSampleMessage(new protos.google.spanner.admin.database.v1.BackupSchedule()), + ]; + client.descriptors.page.listBackupSchedules.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.spanner.admin.database.v1.IBackupSchedule[] = []; + const iterable = client.listBackupSchedulesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listBackupSchedules.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listBackupSchedules.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listBackupSchedules with error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.database.v1.ListBackupSchedulesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.database.v1.ListBackupSchedulesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listBackupSchedules.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listBackupSchedulesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.spanner.admin.database.v1.IBackupSchedule[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listBackupSchedules.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listBackupSchedules.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.getOperation(request)}, expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('deleteOperation', () => { + it('invokes deleteOperation without error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('listOperationsAsync', () => { + it('uses async iteration with listOperations without error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.IOperation[] = []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.IOperation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + }); + + describe('Path templates', () => { + + describe('backup', async () => { + const fakePath = "/rendered/path/backup"; + const expectedParameters = { + project: "projectValue", + instance: "instanceValue", + backup: "backupValue", + }; + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.backupPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.backupPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('backupPath', () => { + const result = client.backupPath("projectValue", "instanceValue", "backupValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.backupPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromBackupName', () => { + const result = client.matchProjectFromBackupName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.backupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInstanceFromBackupName', () => { + const result = client.matchInstanceFromBackupName(fakePath); + assert.strictEqual(result, "instanceValue"); + assert((client.pathTemplates.backupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchBackupFromBackupName', () => { + const result = client.matchBackupFromBackupName(fakePath); + assert.strictEqual(result, "backupValue"); + assert((client.pathTemplates.backupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('backupSchedule', async () => { + const fakePath = "/rendered/path/backupSchedule"; + const expectedParameters = { + project: "projectValue", + instance: "instanceValue", + database: "databaseValue", + schedule: "scheduleValue", + }; + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.backupSchedulePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.backupSchedulePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('backupSchedulePath', () => { + const result = client.backupSchedulePath("projectValue", "instanceValue", "databaseValue", "scheduleValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.backupSchedulePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromBackupScheduleName', () => { + const result = client.matchProjectFromBackupScheduleName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.backupSchedulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInstanceFromBackupScheduleName', () => { + const result = client.matchInstanceFromBackupScheduleName(fakePath); + assert.strictEqual(result, "instanceValue"); + assert((client.pathTemplates.backupSchedulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatabaseFromBackupScheduleName', () => { + const result = client.matchDatabaseFromBackupScheduleName(fakePath); + assert.strictEqual(result, "databaseValue"); + assert((client.pathTemplates.backupSchedulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchScheduleFromBackupScheduleName', () => { + const result = client.matchScheduleFromBackupScheduleName(fakePath); + assert.strictEqual(result, "scheduleValue"); + assert((client.pathTemplates.backupSchedulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('cryptoKey', async () => { + const fakePath = "/rendered/path/cryptoKey"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + key_ring: "keyRingValue", + crypto_key: "cryptoKeyValue", + }; + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.cryptoKeyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.cryptoKeyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('cryptoKeyPath', () => { + const result = client.cryptoKeyPath("projectValue", "locationValue", "keyRingValue", "cryptoKeyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.cryptoKeyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromCryptoKeyName', () => { + const result = client.matchProjectFromCryptoKeyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.cryptoKeyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromCryptoKeyName', () => { + const result = client.matchLocationFromCryptoKeyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.cryptoKeyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchKeyRingFromCryptoKeyName', () => { + const result = client.matchKeyRingFromCryptoKeyName(fakePath); + assert.strictEqual(result, "keyRingValue"); + assert((client.pathTemplates.cryptoKeyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCryptoKeyFromCryptoKeyName', () => { + const result = client.matchCryptoKeyFromCryptoKeyName(fakePath); + assert.strictEqual(result, "cryptoKeyValue"); + assert((client.pathTemplates.cryptoKeyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('database', async () => { + const fakePath = "/rendered/path/database"; + const expectedParameters = { + project: "projectValue", + instance: "instanceValue", + database: "databaseValue", + }; + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.databasePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.databasePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('databasePath', () => { + const result = client.databasePath("projectValue", "instanceValue", "databaseValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.databasePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDatabaseName', () => { + const result = client.matchProjectFromDatabaseName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.databasePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInstanceFromDatabaseName', () => { + const result = client.matchInstanceFromDatabaseName(fakePath); + assert.strictEqual(result, "instanceValue"); + assert((client.pathTemplates.databasePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatabaseFromDatabaseName', () => { + const result = client.matchDatabaseFromDatabaseName(fakePath); + assert.strictEqual(result, "databaseValue"); + assert((client.pathTemplates.databasePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('databaseRole', async () => { + const fakePath = "/rendered/path/databaseRole"; + const expectedParameters = { + project: "projectValue", + instance: "instanceValue", + database: "databaseValue", + role: "roleValue", + }; + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.databaseRolePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.databaseRolePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('databaseRolePath', () => { + const result = client.databaseRolePath("projectValue", "instanceValue", "databaseValue", "roleValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.databaseRolePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDatabaseRoleName', () => { + const result = client.matchProjectFromDatabaseRoleName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.databaseRolePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInstanceFromDatabaseRoleName', () => { + const result = client.matchInstanceFromDatabaseRoleName(fakePath); + assert.strictEqual(result, "instanceValue"); + assert((client.pathTemplates.databaseRolePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatabaseFromDatabaseRoleName', () => { + const result = client.matchDatabaseFromDatabaseRoleName(fakePath); + assert.strictEqual(result, "databaseValue"); + assert((client.pathTemplates.databaseRolePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRoleFromDatabaseRoleName', () => { + const result = client.matchRoleFromDatabaseRoleName(fakePath); + assert.strictEqual(result, "roleValue"); + assert((client.pathTemplates.databaseRolePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('instance', async () => { + const fakePath = "/rendered/path/instance"; + const expectedParameters = { + project: "projectValue", + instance: "instanceValue", + }; + const client = new databaseadminModule.v1.DatabaseAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.instancePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.instancePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('instancePath', () => { + const result = client.instancePath("projectValue", "instanceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.instancePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromInstanceName', () => { + const result = client.matchProjectFromInstanceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInstanceFromInstanceName', () => { + const result = client.matchInstanceFromInstanceName(fakePath); + assert.strictEqual(result, "instanceValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/admin/database/v1/tsconfig.json b/owl-bot-staging/admin/database/v1/tsconfig.json new file mode 100644 index 000000000..ca73e7bfc --- /dev/null +++ b/owl-bot-staging/admin/database/v1/tsconfig.json @@ -0,0 +1,22 @@ +{ + "extends": "./node_modules/gts/tsconfig-google.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "build", + "resolveJsonModule": true, + "lib": [ + "es2023", + "dom" + ] + }, + "include": [ + "src/*.ts", + "src/**/*.ts", + "test/*.ts", + "test/**/*.ts", + "system-test/*.ts", + "src/**/*.json", + "samples/**/*.json", + "protos/protos.json" + ] +} diff --git a/owl-bot-staging/admin/database/v1/webpack.config.js b/owl-bot-staging/admin/database/v1/webpack.config.js new file mode 100644 index 000000000..ef04209ca --- /dev/null +++ b/owl-bot-staging/admin/database/v1/webpack.config.js @@ -0,0 +1,64 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +const path = require('path'); + +module.exports = { + entry: './src/index.ts', + output: { + library: 'DatabaseAdmin', + filename: './database-admin.js', + }, + node: { + child_process: 'empty', + fs: 'empty', + crypto: 'empty', + }, + resolve: { + alias: { + '../../../package.json': path.resolve(__dirname, 'package.json'), + }, + extensions: ['.js', '.json', '.ts'], + }, + module: { + rules: [ + { + test: /\.tsx?$/, + use: 'ts-loader', + exclude: /node_modules/ + }, + { + test: /node_modules[\\/]@grpc[\\/]grpc-js/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]grpc/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]retry-request/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]https?-proxy-agent/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]gtoken/, + use: 'null-loader' + }, + ], + }, + mode: 'production', +}; diff --git a/owl-bot-staging/admin/instance/v1/.OwlBot.yaml b/owl-bot-staging/admin/instance/v1/.OwlBot.yaml new file mode 100644 index 000000000..b3fd66363 --- /dev/null +++ b/owl-bot-staging/admin/instance/v1/.OwlBot.yaml @@ -0,0 +1,19 @@ +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +deep-copy-regex: + - source: /google/spanner/admin/instance/google-spanner-admin-instance-nodejs + dest: /owl-bot-staging/google-spanner-admin-instance + +api-name: instance \ No newline at end of file diff --git a/owl-bot-staging/admin/instance/v1/.eslintignore b/owl-bot-staging/admin/instance/v1/.eslintignore new file mode 100644 index 000000000..cfc348ec4 --- /dev/null +++ b/owl-bot-staging/admin/instance/v1/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/.coverage +build/ +docs/ +protos/ +system-test/ +samples/generated/ diff --git a/owl-bot-staging/admin/instance/v1/.eslintrc.json b/owl-bot-staging/admin/instance/v1/.eslintrc.json new file mode 100644 index 000000000..782153495 --- /dev/null +++ b/owl-bot-staging/admin/instance/v1/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/owl-bot-staging/admin/instance/v1/.gitattributes b/owl-bot-staging/admin/instance/v1/.gitattributes new file mode 100644 index 000000000..33739cb74 --- /dev/null +++ b/owl-bot-staging/admin/instance/v1/.gitattributes @@ -0,0 +1,4 @@ +*.ts text eol=lf +*.js text eol=lf +protos/* linguist-generated +**/api-extractor.json linguist-language=JSON-with-Comments diff --git a/owl-bot-staging/admin/instance/v1/.gitignore b/owl-bot-staging/admin/instance/v1/.gitignore new file mode 100644 index 000000000..d4f03a0df --- /dev/null +++ b/owl-bot-staging/admin/instance/v1/.gitignore @@ -0,0 +1,14 @@ +**/*.log +**/node_modules +/.coverage +/coverage +/.nyc_output +/docs/ +/out/ +/build/ +system-test/secrets.js +system-test/*key.json +*.lock +.DS_Store +package-lock.json +__pycache__ diff --git a/owl-bot-staging/admin/instance/v1/.jsdoc.js b/owl-bot-staging/admin/instance/v1/.jsdoc.js new file mode 100644 index 000000000..89dbb7cd9 --- /dev/null +++ b/owl-bot-staging/admin/instance/v1/.jsdoc.js @@ -0,0 +1,55 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +'use strict'; + +module.exports = { + opts: { + readme: './README.md', + package: './package.json', + template: './node_modules/jsdoc-fresh', + recurse: true, + verbose: true, + destination: './docs/' + }, + plugins: [ + 'plugins/markdown', + 'jsdoc-region-tag' + ], + source: { + excludePattern: '(^|\\/|\\\\)[._]', + include: [ + 'build/src', + 'protos' + ], + includePattern: '\\.js$' + }, + templates: { + copyright: 'Copyright 2026 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/spanner', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/owl-bot-staging/admin/instance/v1/.mocharc.js b/owl-bot-staging/admin/instance/v1/.mocharc.js new file mode 100644 index 000000000..5eb34e86c --- /dev/null +++ b/owl-bot-staging/admin/instance/v1/.mocharc.js @@ -0,0 +1,33 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000 +} +if (process.env.MOCHA_THROW_DEPRECATION === 'false') { + delete config['throw-deprecation']; +} +if (process.env.MOCHA_REPORTER) { + config.reporter = process.env.MOCHA_REPORTER; +} +if (process.env.MOCHA_REPORTER_OUTPUT) { + config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; +} +module.exports = config diff --git a/owl-bot-staging/admin/instance/v1/.nycrc b/owl-bot-staging/admin/instance/v1/.nycrc new file mode 100644 index 000000000..81a95fc94 --- /dev/null +++ b/owl-bot-staging/admin/instance/v1/.nycrc @@ -0,0 +1,24 @@ +{ + "report-dir": "./.coverage", + "reporter": ["text", "lcov"], + "exclude": [ + "**/*-test", + "**/.coverage", + "**/apis", + "**/benchmark", + "**/conformance", + "**/docs", + "**/samples", + "**/scripts", + "**/protos", + "**/test", + "**/*.d.ts", + ".jsdoc.js", + "**/.jsdoc.js", + "karma.conf.js", + "webpack-tests.config.js", + "webpack.config.js" + ], + "exclude-after-remap": false, + "all": true +} \ No newline at end of file diff --git a/owl-bot-staging/admin/instance/v1/.prettierignore b/owl-bot-staging/admin/instance/v1/.prettierignore new file mode 100644 index 000000000..9340ad9b8 --- /dev/null +++ b/owl-bot-staging/admin/instance/v1/.prettierignore @@ -0,0 +1,6 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ diff --git a/owl-bot-staging/admin/instance/v1/.prettierrc.js b/owl-bot-staging/admin/instance/v1/.prettierrc.js new file mode 100644 index 000000000..7649ee3c2 --- /dev/null +++ b/owl-bot-staging/admin/instance/v1/.prettierrc.js @@ -0,0 +1,22 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/owl-bot-staging/admin/instance/v1/CODE_OF_CONDUCT.md b/owl-bot-staging/admin/instance/v1/CODE_OF_CONDUCT.md new file mode 100644 index 000000000..2add2547a --- /dev/null +++ b/owl-bot-staging/admin/instance/v1/CODE_OF_CONDUCT.md @@ -0,0 +1,94 @@ + +# Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of +experience, education, socio-economic status, nationality, personal appearance, +race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, or to ban temporarily or permanently any +contributor for other behaviors that they deem inappropriate, threatening, +offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +This Code of Conduct also applies outside the project spaces when the Project +Steward has a reasonable belief that an individual's behavior may have a +negative impact on the project or its community. + +## Conflict Resolution + +We do not believe that all conflict is bad; healthy debate and disagreement +often yield positive results. However, it is never okay to be disrespectful or +to engage in behavior that violates the project’s code of conduct. + +If you see someone violating the code of conduct, you are encouraged to address +the behavior directly with those involved. Many issues can be resolved quickly +and easily, and this gives people more control over the outcome of their +dispute. If you are unable to resolve the matter for any reason, or if the +behavior is threatening or harassing, report it. We are dedicated to providing +an environment where participants feel welcome and safe. + +Reports should be directed to *googleapis-stewards@google.com*, the +Project Steward(s) for *Google Cloud Client Libraries*. It is the Project Steward’s duty to +receive and address reported violations of the code of conduct. They will then +work with a committee consisting of representatives from the Open Source +Programs Office and the Google Open Source Strategy team. If for any reason you +are uncomfortable reaching out to the Project Steward, please email +opensource@google.com. + +We will investigate every complaint, but you may not receive a direct response. +We will use our discretion in determining when and how to follow up on reported +incidents, which may range from not taking action to permanent expulsion from +the project and project-sponsored spaces. We will notify the accused of the +report and provide them an opportunity to discuss it before any action is taken. +The identity of the reporter will be omitted from the details of the report +supplied to the accused. In potentially harmful situations, such as ongoing +harassment or threats to anyone's safety, we may take action without notice. + +## Attribution + +This Code of Conduct is adapted from the Contributor Covenant, version 1.4, +available at +https://www.contributor-covenant.org/version/1/4/code-of-conduct.html \ No newline at end of file diff --git a/owl-bot-staging/admin/instance/v1/CONTRIBUTING.md b/owl-bot-staging/admin/instance/v1/CONTRIBUTING.md new file mode 100644 index 000000000..bc72d8a26 --- /dev/null +++ b/owl-bot-staging/admin/instance/v1/CONTRIBUTING.md @@ -0,0 +1,76 @@ +# How to become a contributor and submit your own code + +**Table of contents** + +* [Contributor License Agreements](#contributor-license-agreements) +* [Contributing a patch](#contributing-a-patch) +* [Running the tests](#running-the-tests) +* [Releasing the library](#releasing-the-library) + +## Contributor License Agreements + +We'd love to accept your sample apps and patches! Before we can take them, we +have to jump a couple of legal hurdles. + +Please fill out either the individual or corporate Contributor License Agreement +(CLA). + + * If you are an individual writing original source code and you're sure you + own the intellectual property, then you'll need to sign an [individual CLA](https://developers.google.com/open-source/cla/individual). + * If you work for a company that wants to allow you to contribute your work, + then you'll need to sign a [corporate CLA](https://developers.google.com/open-source/cla/corporate). + +Follow either of the two links above to access the appropriate CLA and +instructions for how to sign and return it. Once we receive it, we'll be able to +accept your pull requests. + +## Contributing A Patch + +1. Submit an issue describing your proposed change to the repo in question. +1. The repo owner will respond to your issue promptly. +1. If your proposed change is accepted, and you haven't already done so, sign a + Contributor License Agreement (see details above). +1. Fork the desired repo, develop and test your code changes. +1. Ensure that your code adheres to the existing style in the code to which + you are contributing. +1. Ensure that your code has an appropriate set of tests which all pass. +1. Title your pull request following [Conventional Commits](https://www.conventionalcommits.org/) styling. +1. Submit a pull request. + +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Instance API][enable_api]. +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + + +## Running the tests + +1. [Prepare your environment for Node.js setup][setup]. + +1. Install dependencies: + + npm install + +1. Run the tests: + + # Run unit tests. + npm test + + # Run sample integration tests. + npm run samples-test + + # Run all system tests. + npm run system-test + +1. Lint (and maybe fix) any changes: + + npm run fix + +[setup]: https://cloud.google.com/nodejs/docs/setup +[projects]: https://console.cloud.google.com/project +[billing]: https://support.google.com/cloud/answer/6293499#enable-billing +[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=spanner.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/owl-bot-staging/admin/instance/v1/LICENSE b/owl-bot-staging/admin/instance/v1/LICENSE new file mode 100644 index 000000000..d64569567 --- /dev/null +++ b/owl-bot-staging/admin/instance/v1/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/owl-bot-staging/admin/instance/v1/README.md b/owl-bot-staging/admin/instance/v1/README.md new file mode 100644 index 000000000..d6dda670d --- /dev/null +++ b/owl-bot-staging/admin/instance/v1/README.md @@ -0,0 +1,108 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "The comments you see below are used to generate those parts of the template in later states." +Google Cloud Platform logo + +# [Cloud Spanner API: Nodejs Client][homepage] + +[//]: # "releaseLevel" + +[![npm version](https://img.shields.io/npm/v/@google-cloud/spanner.svg)](https://www.npmjs.org/package/@google-cloud/spanner) + +Cloud Spanner API client for Node.js + +[//]: # "partials.introduction" + +A comprehensive list of changes in each version may be found in +[the CHANGELOG][homepage_changelog]. + +* [Cloud Spanner API Nodejs Client API Reference](https://cloud.google.com/nodejs/docs/reference/instance/latest) +* [Cloud Spanner API Documentation](https://cloud.google.com/spanner/) + +Read more about the client libraries for Cloud APIs, including the older +Google APIs Client Libraries, in [Client Libraries Explained][explained]. + +[explained]: https://cloud.google.com/apis/docs/client-libraries-explained + +**Table of contents:** + +* [Quickstart](#quickstart) + * [Before you begin](#before-you-begin) + * [Installing the client library](#installing-the-client-library) + +* [Versioning](#versioning) +* [Contributing](#contributing) +* [License](#license) + +## Quickstart +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Cloud Spanner API API][enable_api]. +1. [Set up authentication][auth] so you can access the + API from your local workstation. +### Installing the client library + +```bash +npm install @google-cloud/spanner +``` + +[//]: # "partials.body" + +## Samples + +Samples are in the [`samples/`][homepage_samples] directory. Each sample's `README.md` has instructions for running its sample. + +[//]: # "samples" + +## Supported Node.js Versions + +Our client libraries follow the [Node.js release schedule](https://github.com/nodejs/release#release-schedule). +Libraries are compatible with all current _active_ and _maintenance_ versions of +Node.js. +If you are using an end-of-life version of Node.js, we recommend that you update +as soon as possible to an actively supported LTS version. + +Google's client libraries support legacy versions of Node.js runtimes on a +best-efforts basis with the following warnings: + +* Legacy versions are not tested in continuous integration. +* Some security patches and features cannot be backported. +* Dependencies cannot be kept up-to-date. + +Client libraries targeting some end-of-life versions of Node.js are available, and +can be installed through npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). +The dist-tags follow the naming convention `legacy-(version)`. +For example, `npm install @google-cloud/spanner@legacy-8` installs client libraries +for versions compatible with Node.js 8. + +## Versioning + +This library follows [Semantic Versioning](http://semver.org/). + +More Information: [Google Cloud Platform Launch Stages][launch_stages] + +[launch_stages]: https://cloud.google.com/terms/launch-stages + +## Contributing + +Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-spanner-admin-instance/CONTRIBUTING.md). + +Please note that this `README.md` +and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) +are generated from a central template. + +## License + +Apache Version 2.0 + +See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-spanner-admin-instance/LICENSE) + +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[projects]: https://console.cloud.google.com/project +[billing]: https://support.google.com/cloud/answer/6293499#enable-billing +[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=spanner.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/external/set-up-adc-local +[homepage_samples]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-spanner-admin-instance/samples +[homepage_changelog]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-spanner-admin-instance/CHANGELOG.md +[homepage]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-spanner-admin-instance diff --git a/owl-bot-staging/admin/instance/v1/package.json b/owl-bot-staging/admin/instance/v1/package.json new file mode 100644 index 000000000..46b2931c2 --- /dev/null +++ b/owl-bot-staging/admin/instance/v1/package.json @@ -0,0 +1,58 @@ +{ + "name": "@google-cloud/spanner", + "version": "0.1.0", + "description": "Instance client for Node.js", + "repository": "googleapis/nodejs-instance", + "license": "Apache-2.0", + "author": "Google LLC", + "main": "build/src/index.js", + "files": [ + "build/src", + "build/protos" + ], + "keywords": [ + "google apis client", + "google api client", + "google apis", + "google api", + "google", + "google cloud platform", + "google cloud", + "cloud", + "google instance", + "instance", + "instance admin" + ], + "scripts": { + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/ && minifyProtoJson", + "compile-protos": "compileProtos src", + "docs": "jsdoc -c .jsdoc.js", + "fix": "gts fix", + "lint": "gts check", + "prepare": "npm run compile-protos && npm run compile", + "system-test": "c8 mocha build/system-test", + "test": "c8 mocha build/test" + }, + "dependencies": { + "google-gax": "^5.1.1-rc.1" + }, + "devDependencies": { + "@types/mocha": "^10.0.10", + "@types/node": "^22.18.12", + "@types/sinon": "^17.0.4", + "c8": "^10.1.3", + "gapic-tools": "^1.0.3", + "gts": "^6.0.2", + "jsdoc": "^4.0.5", + "jsdoc-fresh": "^5.0.2", + "jsdoc-region-tag": "^4.0.1", + "mocha": "^11.7.4", + "pack-n-play": "^4.2.1", + "typescript": "5.8.3", + "sinon": "^21.0.0" + }, + "engines": { + "node": ">=v18" + } +} diff --git a/owl-bot-staging/admin/instance/v1/protos/google/spanner/admin/instance/v1/common.proto b/owl-bot-staging/admin/instance/v1/protos/google/spanner/admin/instance/v1/common.proto new file mode 100644 index 000000000..0b5282c7d --- /dev/null +++ b/owl-bot-staging/admin/instance/v1/protos/google/spanner/admin/instance/v1/common.proto @@ -0,0 +1,64 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.spanner.admin.instance.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Spanner.Admin.Instance.V1"; +option go_package = "cloud.google.com/go/spanner/admin/instance/apiv1/instancepb;instancepb"; +option java_multiple_files = true; +option java_outer_classname = "CommonProto"; +option java_package = "com.google.spanner.admin.instance.v1"; +option php_namespace = "Google\\Cloud\\Spanner\\Admin\\Instance\\V1"; +option ruby_package = "Google::Cloud::Spanner::Admin::Instance::V1"; + +// Encapsulates progress related information for a Cloud Spanner long +// running instance operations. +message OperationProgress { + // Percent completion of the operation. + // Values are between 0 and 100 inclusive. + int32 progress_percent = 1; + + // Time the request was received. + google.protobuf.Timestamp start_time = 2; + + // If set, the time at which this operation failed or was completed + // successfully. + google.protobuf.Timestamp end_time = 3; +} + +// Indicates the expected fulfillment period of an operation. +enum FulfillmentPeriod { + // Not specified. + FULFILLMENT_PERIOD_UNSPECIFIED = 0; + + // Normal fulfillment period. The operation is expected to complete within + // minutes. + FULFILLMENT_PERIOD_NORMAL = 1; + + // Extended fulfillment period. It can take up to an hour for the operation + // to complete. + FULFILLMENT_PERIOD_EXTENDED = 2; +} + +// ReplicaSelection identifies replicas with common properties. +message ReplicaSelection { + // Required. Name of the location of the replicas (e.g., "us-central1"). + string location = 1 [(google.api.field_behavior) = REQUIRED]; +} diff --git a/owl-bot-staging/admin/instance/v1/protos/google/spanner/admin/instance/v1/spanner_instance_admin.proto b/owl-bot-staging/admin/instance/v1/protos/google/spanner/admin/instance/v1/spanner_instance_admin.proto new file mode 100644 index 000000000..d16ab2ca5 --- /dev/null +++ b/owl-bot-staging/admin/instance/v1/protos/google/spanner/admin/instance/v1/spanner_instance_admin.proto @@ -0,0 +1,2184 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.spanner.admin.instance.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/iam/v1/iam_policy.proto"; +import "google/iam/v1/policy.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; +import "google/spanner/admin/instance/v1/common.proto"; + +option csharp_namespace = "Google.Cloud.Spanner.Admin.Instance.V1"; +option go_package = "cloud.google.com/go/spanner/admin/instance/apiv1/instancepb;instancepb"; +option java_multiple_files = true; +option java_outer_classname = "SpannerInstanceAdminProto"; +option java_package = "com.google.spanner.admin.instance.v1"; +option php_namespace = "Google\\Cloud\\Spanner\\Admin\\Instance\\V1"; +option ruby_package = "Google::Cloud::Spanner::Admin::Instance::V1"; + +// Cloud Spanner Instance Admin API +// +// The Cloud Spanner Instance Admin API can be used to create, delete, +// modify and list instances. Instances are dedicated Cloud Spanner serving +// and storage resources to be used by Cloud Spanner databases. +// +// Each instance has a "configuration", which dictates where the +// serving resources for the Cloud Spanner instance are located (e.g., +// US-central, Europe). Configurations are created by Google based on +// resource availability. +// +// Cloud Spanner billing is based on the instances that exist and their +// sizes. After an instance exists, there are no additional +// per-database or per-operation charges for use of the instance +// (though there may be additional network bandwidth charges). +// Instances offer isolation: problems with databases in one instance +// will not affect other instances. However, within an instance +// databases can affect each other. For example, if one database in an +// instance receives a lot of requests and consumes most of the +// instance resources, fewer resources are available for other +// databases in that instance, and their performance may suffer. +service InstanceAdmin { + option (google.api.default_host) = "spanner.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/spanner.admin"; + + // Lists the supported instance configurations for a given project. + // + // Returns both Google-managed configurations and user-managed + // configurations. + rpc ListInstanceConfigs(ListInstanceConfigsRequest) + returns (ListInstanceConfigsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*}/instanceConfigs" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets information about a particular instance configuration. + rpc GetInstanceConfig(GetInstanceConfigRequest) returns (InstanceConfig) { + option (google.api.http) = { + get: "/v1/{name=projects/*/instanceConfigs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates an instance configuration and begins preparing it to be used. The + // returned long-running operation + // can be used to track the progress of preparing the new + // instance configuration. The instance configuration name is assigned by the + // caller. If the named instance configuration already exists, + // `CreateInstanceConfig` returns `ALREADY_EXISTS`. + // + // Immediately after the request returns: + // + // * The instance configuration is readable via the API, with all requested + // attributes. The instance configuration's + // [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling] + // field is set to true. Its state is `CREATING`. + // + // While the operation is pending: + // + // * Cancelling the operation renders the instance configuration immediately + // unreadable via the API. + // * Except for deleting the creating resource, all other attempts to modify + // the instance configuration are rejected. + // + // Upon completion of the returned operation: + // + // * Instances can be created using the instance configuration. + // * The instance configuration's + // [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling] + // field becomes false. Its state becomes `READY`. + // + // The returned long-running operation will + // have a name of the format + // `/operations/` and can be used to track + // creation of the instance configuration. The + // metadata field type is + // [CreateInstanceConfigMetadata][google.spanner.admin.instance.v1.CreateInstanceConfigMetadata]. + // The response field type is + // [InstanceConfig][google.spanner.admin.instance.v1.InstanceConfig], if + // successful. + // + // Authorization requires `spanner.instanceConfigs.create` permission on + // the resource + // [parent][google.spanner.admin.instance.v1.CreateInstanceConfigRequest.parent]. + rpc CreateInstanceConfig(CreateInstanceConfigRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*}/instanceConfigs" + body: "*" + }; + option (google.api.method_signature) = + "parent,instance_config,instance_config_id"; + option (google.longrunning.operation_info) = { + response_type: "google.spanner.admin.instance.v1.InstanceConfig" + metadata_type: "google.spanner.admin.instance.v1.CreateInstanceConfigMetadata" + }; + } + + // Updates an instance configuration. The returned + // long-running operation can be used to track + // the progress of updating the instance. If the named instance configuration + // does not exist, returns `NOT_FOUND`. + // + // Only user-managed configurations can be updated. + // + // Immediately after the request returns: + // + // * The instance configuration's + // [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling] + // field is set to true. + // + // While the operation is pending: + // + // * Cancelling the operation sets its metadata's + // [cancel_time][google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata.cancel_time]. + // The operation is guaranteed to succeed at undoing all changes, after + // which point it terminates with a `CANCELLED` status. + // * All other attempts to modify the instance configuration are rejected. + // * Reading the instance configuration via the API continues to give the + // pre-request values. + // + // Upon completion of the returned operation: + // + // * Creating instances using the instance configuration uses the new + // values. + // * The new values of the instance configuration are readable via the API. + // * The instance configuration's + // [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling] + // field becomes false. + // + // The returned long-running operation will + // have a name of the format + // `/operations/` and can be used to track + // the instance configuration modification. The + // metadata field type is + // [UpdateInstanceConfigMetadata][google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata]. + // The response field type is + // [InstanceConfig][google.spanner.admin.instance.v1.InstanceConfig], if + // successful. + // + // Authorization requires `spanner.instanceConfigs.update` permission on + // the resource [name][google.spanner.admin.instance.v1.InstanceConfig.name]. + rpc UpdateInstanceConfig(UpdateInstanceConfigRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{instance_config.name=projects/*/instanceConfigs/*}" + body: "*" + }; + option (google.api.method_signature) = "instance_config,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "google.spanner.admin.instance.v1.InstanceConfig" + metadata_type: "google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata" + }; + } + + // Deletes the instance configuration. Deletion is only allowed when no + // instances are using the configuration. If any instances are using + // the configuration, returns `FAILED_PRECONDITION`. + // + // Only user-managed configurations can be deleted. + // + // Authorization requires `spanner.instanceConfigs.delete` permission on + // the resource [name][google.spanner.admin.instance.v1.InstanceConfig.name]. + rpc DeleteInstanceConfig(DeleteInstanceConfigRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/instanceConfigs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists the user-managed instance configuration long-running + // operations in the given project. An instance + // configuration operation has a name of the form + // `projects//instanceConfigs//operations/`. + // The long-running operation + // metadata field type + // `metadata.type_url` describes the type of the metadata. Operations returned + // include those that have completed/failed/canceled within the last 7 days, + // and pending operations. Operations returned are ordered by + // `operation.metadata.value.start_time` in descending order starting + // from the most recently started operation. + rpc ListInstanceConfigOperations(ListInstanceConfigOperationsRequest) + returns (ListInstanceConfigOperationsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*}/instanceConfigOperations" + }; + option (google.api.method_signature) = "parent"; + } + + // Lists all instances in the given project. + rpc ListInstances(ListInstancesRequest) returns (ListInstancesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*}/instances" + }; + option (google.api.method_signature) = "parent"; + } + + // Lists all instance partitions for the given instance. + rpc ListInstancePartitions(ListInstancePartitionsRequest) + returns (ListInstancePartitionsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/instances/*}/instancePartitions" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets information about a particular instance. + rpc GetInstance(GetInstanceRequest) returns (Instance) { + option (google.api.http) = { + get: "/v1/{name=projects/*/instances/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates an instance and begins preparing it to begin serving. The + // returned long-running operation + // can be used to track the progress of preparing the new + // instance. The instance name is assigned by the caller. If the + // named instance already exists, `CreateInstance` returns + // `ALREADY_EXISTS`. + // + // Immediately upon completion of this request: + // + // * The instance is readable via the API, with all requested attributes + // but no allocated resources. Its state is `CREATING`. + // + // Until completion of the returned operation: + // + // * Cancelling the operation renders the instance immediately unreadable + // via the API. + // * The instance can be deleted. + // * All other attempts to modify the instance are rejected. + // + // Upon completion of the returned operation: + // + // * Billing for all successfully-allocated resources begins (some types + // may have lower than the requested levels). + // * Databases can be created in the instance. + // * The instance's allocated resource levels are readable via the API. + // * The instance's state becomes `READY`. + // + // The returned long-running operation will + // have a name of the format `/operations/` and + // can be used to track creation of the instance. The + // metadata field type is + // [CreateInstanceMetadata][google.spanner.admin.instance.v1.CreateInstanceMetadata]. + // The response field type is + // [Instance][google.spanner.admin.instance.v1.Instance], if successful. + rpc CreateInstance(CreateInstanceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*}/instances" + body: "*" + }; + option (google.api.method_signature) = "parent,instance_id,instance"; + option (google.longrunning.operation_info) = { + response_type: "google.spanner.admin.instance.v1.Instance" + metadata_type: "google.spanner.admin.instance.v1.CreateInstanceMetadata" + }; + } + + // Updates an instance, and begins allocating or releasing resources + // as requested. The returned long-running operation can be used to track the + // progress of updating the instance. If the named instance does not + // exist, returns `NOT_FOUND`. + // + // Immediately upon completion of this request: + // + // * For resource types for which a decrease in the instance's allocation + // has been requested, billing is based on the newly-requested level. + // + // Until completion of the returned operation: + // + // * Cancelling the operation sets its metadata's + // [cancel_time][google.spanner.admin.instance.v1.UpdateInstanceMetadata.cancel_time], + // and begins restoring resources to their pre-request values. The + // operation is guaranteed to succeed at undoing all resource changes, + // after which point it terminates with a `CANCELLED` status. + // * All other attempts to modify the instance are rejected. + // * Reading the instance via the API continues to give the pre-request + // resource levels. + // + // Upon completion of the returned operation: + // + // * Billing begins for all successfully-allocated resources (some types + // may have lower than the requested levels). + // * All newly-reserved resources are available for serving the instance's + // tables. + // * The instance's new resource levels are readable via the API. + // + // The returned long-running operation will + // have a name of the format `/operations/` and + // can be used to track the instance modification. The + // metadata field type is + // [UpdateInstanceMetadata][google.spanner.admin.instance.v1.UpdateInstanceMetadata]. + // The response field type is + // [Instance][google.spanner.admin.instance.v1.Instance], if successful. + // + // Authorization requires `spanner.instances.update` permission on + // the resource [name][google.spanner.admin.instance.v1.Instance.name]. + rpc UpdateInstance(UpdateInstanceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{instance.name=projects/*/instances/*}" + body: "*" + }; + option (google.api.method_signature) = "instance,field_mask"; + option (google.longrunning.operation_info) = { + response_type: "google.spanner.admin.instance.v1.Instance" + metadata_type: "google.spanner.admin.instance.v1.UpdateInstanceMetadata" + }; + } + + // Deletes an instance. + // + // Immediately upon completion of the request: + // + // * Billing ceases for all of the instance's reserved resources. + // + // Soon afterward: + // + // * The instance and *all of its databases* immediately and + // irrevocably disappear from the API. All data in the databases + // is permanently deleted. + rpc DeleteInstance(DeleteInstanceRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/instances/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Sets the access control policy on an instance resource. Replaces any + // existing policy. + // + // Authorization requires `spanner.instances.setIamPolicy` on + // [resource][google.iam.v1.SetIamPolicyRequest.resource]. + rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) + returns (google.iam.v1.Policy) { + option (google.api.http) = { + post: "/v1/{resource=projects/*/instances/*}:setIamPolicy" + body: "*" + }; + option (google.api.method_signature) = "resource,policy"; + } + + // Gets the access control policy for an instance resource. Returns an empty + // policy if an instance exists but does not have a policy set. + // + // Authorization requires `spanner.instances.getIamPolicy` on + // [resource][google.iam.v1.GetIamPolicyRequest.resource]. + rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) + returns (google.iam.v1.Policy) { + option (google.api.http) = { + post: "/v1/{resource=projects/*/instances/*}:getIamPolicy" + body: "*" + }; + option (google.api.method_signature) = "resource"; + } + + // Returns permissions that the caller has on the specified instance resource. + // + // Attempting this RPC on a non-existent Cloud Spanner instance resource will + // result in a NOT_FOUND error if the user has `spanner.instances.list` + // permission on the containing Google Cloud Project. Otherwise returns an + // empty set of permissions. + rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) + returns (google.iam.v1.TestIamPermissionsResponse) { + option (google.api.http) = { + post: "/v1/{resource=projects/*/instances/*}:testIamPermissions" + body: "*" + }; + option (google.api.method_signature) = "resource,permissions"; + } + + // Gets information about a particular instance partition. + rpc GetInstancePartition(GetInstancePartitionRequest) + returns (InstancePartition) { + option (google.api.http) = { + get: "/v1/{name=projects/*/instances/*/instancePartitions/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates an instance partition and begins preparing it to be used. The + // returned long-running operation + // can be used to track the progress of preparing the new instance partition. + // The instance partition name is assigned by the caller. If the named + // instance partition already exists, `CreateInstancePartition` returns + // `ALREADY_EXISTS`. + // + // Immediately upon completion of this request: + // + // * The instance partition is readable via the API, with all requested + // attributes but no allocated resources. Its state is `CREATING`. + // + // Until completion of the returned operation: + // + // * Cancelling the operation renders the instance partition immediately + // unreadable via the API. + // * The instance partition can be deleted. + // * All other attempts to modify the instance partition are rejected. + // + // Upon completion of the returned operation: + // + // * Billing for all successfully-allocated resources begins (some types + // may have lower than the requested levels). + // * Databases can start using this instance partition. + // * The instance partition's allocated resource levels are readable via the + // API. + // * The instance partition's state becomes `READY`. + // + // The returned long-running operation will + // have a name of the format + // `/operations/` and can be used to + // track creation of the instance partition. The + // metadata field type is + // [CreateInstancePartitionMetadata][google.spanner.admin.instance.v1.CreateInstancePartitionMetadata]. + // The response field type is + // [InstancePartition][google.spanner.admin.instance.v1.InstancePartition], if + // successful. + rpc CreateInstancePartition(CreateInstancePartitionRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/instances/*}/instancePartitions" + body: "*" + }; + option (google.api.method_signature) = + "parent,instance_partition,instance_partition_id"; + option (google.longrunning.operation_info) = { + response_type: "google.spanner.admin.instance.v1.InstancePartition" + metadata_type: "google.spanner.admin.instance.v1.CreateInstancePartitionMetadata" + }; + } + + // Deletes an existing instance partition. Requires that the + // instance partition is not used by any database or backup and is not the + // default instance partition of an instance. + // + // Authorization requires `spanner.instancePartitions.delete` permission on + // the resource + // [name][google.spanner.admin.instance.v1.InstancePartition.name]. + rpc DeleteInstancePartition(DeleteInstancePartitionRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/instances/*/instancePartitions/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates an instance partition, and begins allocating or releasing resources + // as requested. The returned long-running operation can be used to track the + // progress of updating the instance partition. If the named instance + // partition does not exist, returns `NOT_FOUND`. + // + // Immediately upon completion of this request: + // + // * For resource types for which a decrease in the instance partition's + // allocation has been requested, billing is based on the newly-requested + // level. + // + // Until completion of the returned operation: + // + // * Cancelling the operation sets its metadata's + // [cancel_time][google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata.cancel_time], + // and begins restoring resources to their pre-request values. The + // operation is guaranteed to succeed at undoing all resource changes, + // after which point it terminates with a `CANCELLED` status. + // * All other attempts to modify the instance partition are rejected. + // * Reading the instance partition via the API continues to give the + // pre-request resource levels. + // + // Upon completion of the returned operation: + // + // * Billing begins for all successfully-allocated resources (some types + // may have lower than the requested levels). + // * All newly-reserved resources are available for serving the instance + // partition's tables. + // * The instance partition's new resource levels are readable via the API. + // + // The returned long-running operation will + // have a name of the format + // `/operations/` and can be used to + // track the instance partition modification. The + // metadata field type is + // [UpdateInstancePartitionMetadata][google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata]. + // The response field type is + // [InstancePartition][google.spanner.admin.instance.v1.InstancePartition], if + // successful. + // + // Authorization requires `spanner.instancePartitions.update` permission on + // the resource + // [name][google.spanner.admin.instance.v1.InstancePartition.name]. + rpc UpdateInstancePartition(UpdateInstancePartitionRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{instance_partition.name=projects/*/instances/*/instancePartitions/*}" + body: "*" + }; + option (google.api.method_signature) = "instance_partition,field_mask"; + option (google.longrunning.operation_info) = { + response_type: "google.spanner.admin.instance.v1.InstancePartition" + metadata_type: "google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata" + }; + } + + // Lists instance partition long-running operations in the given instance. + // An instance partition operation has a name of the form + // `projects//instances//instancePartitions//operations/`. + // The long-running operation + // metadata field type + // `metadata.type_url` describes the type of the metadata. Operations returned + // include those that have completed/failed/canceled within the last 7 days, + // and pending operations. Operations returned are ordered by + // `operation.metadata.value.start_time` in descending order starting from the + // most recently started operation. + // + // Authorization requires `spanner.instancePartitionOperations.list` + // permission on the resource + // [parent][google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest.parent]. + rpc ListInstancePartitionOperations(ListInstancePartitionOperationsRequest) + returns (ListInstancePartitionOperationsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/instances/*}/instancePartitionOperations" + }; + option (google.api.method_signature) = "parent"; + } + + // Moves an instance to the target instance configuration. You can use the + // returned long-running operation to track + // the progress of moving the instance. + // + // `MoveInstance` returns `FAILED_PRECONDITION` if the instance meets any of + // the following criteria: + // + // * Is undergoing a move to a different instance configuration + // * Has backups + // * Has an ongoing update + // * Contains any CMEK-enabled databases + // * Is a free trial instance + // + // While the operation is pending: + // + // * All other attempts to modify the instance, including changes to its + // compute capacity, are rejected. + // * The following database and backup admin operations are rejected: + // + // * `DatabaseAdmin.CreateDatabase` + // * `DatabaseAdmin.UpdateDatabaseDdl` (disabled if default_leader is + // specified in the request.) + // * `DatabaseAdmin.RestoreDatabase` + // * `DatabaseAdmin.CreateBackup` + // * `DatabaseAdmin.CopyBackup` + // + // * Both the source and target instance configurations are subject to + // hourly compute and storage charges. + // * The instance might experience higher read-write latencies and a higher + // transaction abort rate. However, moving an instance doesn't cause any + // downtime. + // + // The returned long-running operation has + // a name of the format + // `/operations/` and can be used to track + // the move instance operation. The + // metadata field type is + // [MoveInstanceMetadata][google.spanner.admin.instance.v1.MoveInstanceMetadata]. + // The response field type is + // [Instance][google.spanner.admin.instance.v1.Instance], + // if successful. + // Cancelling the operation sets its metadata's + // [cancel_time][google.spanner.admin.instance.v1.MoveInstanceMetadata.cancel_time]. + // Cancellation is not immediate because it involves moving any data + // previously moved to the target instance configuration back to the original + // instance configuration. You can use this operation to track the progress of + // the cancellation. Upon successful completion of the cancellation, the + // operation terminates with `CANCELLED` status. + // + // If not cancelled, upon completion of the returned operation: + // + // * The instance successfully moves to the target instance + // configuration. + // * You are billed for compute and storage in target instance + // configuration. + // + // Authorization requires the `spanner.instances.update` permission on + // the resource [instance][google.spanner.admin.instance.v1.Instance]. + // + // For more details, see + // [Move an instance](https://cloud.google.com/spanner/docs/move-instance). + rpc MoveInstance(MoveInstanceRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/instances/*}:move" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "google.spanner.admin.instance.v1.MoveInstanceResponse" + metadata_type: "google.spanner.admin.instance.v1.MoveInstanceMetadata" + }; + } +} + +message ReplicaInfo { + // Indicates the type of replica. See the [replica types + // documentation](https://cloud.google.com/spanner/docs/replication#replica_types) + // for more details. + enum ReplicaType { + // Not specified. + TYPE_UNSPECIFIED = 0; + + // Read-write replicas support both reads and writes. These replicas: + // + // * Maintain a full copy of your data. + // * Serve reads. + // * Can vote whether to commit a write. + // * Participate in leadership election. + // * Are eligible to become a leader. + READ_WRITE = 1; + + // Read-only replicas only support reads (not writes). Read-only replicas: + // + // * Maintain a full copy of your data. + // * Serve reads. + // * Do not participate in voting to commit writes. + // * Are not eligible to become a leader. + READ_ONLY = 2; + + // Witness replicas don't support reads but do participate in voting to + // commit writes. Witness replicas: + // + // * Do not maintain a full copy of data. + // * Do not serve reads. + // * Vote whether to commit writes. + // * Participate in leader election but are not eligible to become leader. + WITNESS = 3; + } + + // The location of the serving resources, e.g., "us-central1". + string location = 1; + + // The type of replica. + ReplicaType type = 2; + + // If true, this location is designated as the default leader location where + // leader replicas are placed. See the [region types + // documentation](https://cloud.google.com/spanner/docs/instances#region_types) + // for more details. + bool default_leader_location = 3; +} + +// A possible configuration for a Cloud Spanner instance. Configurations +// define the geographic placement of nodes and their replication. +message InstanceConfig { + option (google.api.resource) = { + type: "spanner.googleapis.com/InstanceConfig" + pattern: "projects/{project}/instanceConfigs/{instance_config}" + plural: "instanceConfigs" + singular: "instanceConfig" + }; + + // The type of this configuration. + enum Type { + // Unspecified. + TYPE_UNSPECIFIED = 0; + + // Google-managed configuration. + GOOGLE_MANAGED = 1; + + // User-managed configuration. + USER_MANAGED = 2; + } + + // Indicates the current state of the instance configuration. + enum State { + // Not specified. + STATE_UNSPECIFIED = 0; + + // The instance configuration is still being created. + CREATING = 1; + + // The instance configuration is fully created and ready to be used to + // create instances. + READY = 2; + } + + // Describes the availability for free instances to be created in an instance + // configuration. + enum FreeInstanceAvailability { + // Not specified. + FREE_INSTANCE_AVAILABILITY_UNSPECIFIED = 0; + + // Indicates that free instances are available to be created in this + // instance configuration. + AVAILABLE = 1; + + // Indicates that free instances are not supported in this instance + // configuration. + UNSUPPORTED = 2; + + // Indicates that free instances are currently not available to be created + // in this instance configuration. + DISABLED = 3; + + // Indicates that additional free instances cannot be created in this + // instance configuration because the project has reached its limit of free + // instances. + QUOTA_EXCEEDED = 4; + } + + // Indicates the quorum type of this instance configuration. + enum QuorumType { + // Quorum type not specified. + QUORUM_TYPE_UNSPECIFIED = 0; + + // An instance configuration tagged with `REGION` quorum type forms a write + // quorum in a single region. + REGION = 1; + + // An instance configuration tagged with the `DUAL_REGION` quorum type forms + // a write quorum with exactly two read-write regions in a multi-region + // configuration. + // + // This instance configuration requires failover in the event of + // regional failures. + DUAL_REGION = 2; + + // An instance configuration tagged with the `MULTI_REGION` quorum type + // forms a write quorum from replicas that are spread across more than one + // region in a multi-region configuration. + MULTI_REGION = 3; + } + + // A unique identifier for the instance configuration. Values + // are of the form + // `projects//instanceConfigs/[a-z][-a-z0-9]*`. + // + // User instance configuration must start with `custom-`. + string name = 1; + + // The name of this instance configuration as it appears in UIs. + string display_name = 2; + + // Output only. Whether this instance configuration is a Google-managed or + // user-managed configuration. + Type config_type = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The geographic placement of nodes in this instance configuration and their + // replication properties. + // + // To create user-managed configurations, input + // `replicas` must include all replicas in `replicas` of the `base_config` + // and include one or more replicas in the `optional_replicas` of the + // `base_config`. + repeated ReplicaInfo replicas = 3; + + // Output only. The available optional replicas to choose from for + // user-managed configurations. Populated for Google-managed configurations. + repeated ReplicaInfo optional_replicas = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Base configuration name, e.g. projects//instanceConfigs/nam3, + // based on which this configuration is created. Only set for user-managed + // configurations. `base_config` must refer to a configuration of type + // `GOOGLE_MANAGED` in the same project as this configuration. + string base_config = 7 [(google.api.resource_reference) = { + type: "spanner.googleapis.com/InstanceConfig" + }]; + + // Cloud Labels are a flexible and lightweight mechanism for organizing cloud + // resources into groups that reflect a customer's organizational needs and + // deployment strategies. Cloud Labels can be used to filter collections of + // resources. They can be used to control how resource metrics are aggregated. + // And they can be used as arguments to policy management rules (e.g. route, + // firewall, load balancing, etc.). + // + // * Label keys must be between 1 and 63 characters long and must conform to + // the following regular expression: `[a-z][a-z0-9_-]{0,62}`. + // * Label values must be between 0 and 63 characters long and must conform + // to the regular expression `[a-z0-9_-]{0,63}`. + // * No more than 64 labels can be associated with a given resource. + // + // See https://goo.gl/xmQnxf for more information on and examples of labels. + // + // If you plan to use labels in your own code, please note that additional + // characters may be allowed in the future. Therefore, you are advised to use + // an internal label representation, such as JSON, which doesn't rely upon + // specific characters being disallowed. For example, representing labels + // as the string: name + "_" + value would prove problematic if we were to + // allow "_" in a future release. + map labels = 8; + + // etag is used for optimistic concurrency control as a way + // to help prevent simultaneous updates of a instance configuration from + // overwriting each other. It is strongly suggested that systems make use of + // the etag in the read-modify-write cycle to perform instance configuration + // updates in order to avoid race conditions: An etag is returned in the + // response which contains instance configurations, and systems are expected + // to put that etag in the request to update instance configuration to ensure + // that their change is applied to the same version of the instance + // configuration. If no etag is provided in the call to update the instance + // configuration, then the existing instance configuration is overwritten + // blindly. + string etag = 9; + + // Allowed values of the "default_leader" schema option for databases in + // instances that use this instance configuration. + repeated string leader_options = 4; + + // Output only. If true, the instance configuration is being created or + // updated. If false, there are no ongoing operations for the instance + // configuration. + bool reconciling = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The current instance configuration state. Applicable only for + // `USER_MANAGED` configurations. + State state = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Describes whether free instances are available to be created + // in this instance configuration. + FreeInstanceAvailability free_instance_availability = 12 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The `QuorumType` of the instance configuration. + QuorumType quorum_type = 18 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The storage limit in bytes per processing unit. + int64 storage_limit_per_processing_unit = 19 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// ReplicaComputeCapacity describes the amount of server resources that are +// allocated to each replica identified by the replica selection. +message ReplicaComputeCapacity { + // Required. Identifies replicas by specified properties. + // All replicas in the selection have the same amount of compute capacity. + ReplicaSelection replica_selection = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Compute capacity allocated to each replica identified by the specified + // selection. + // The unit is selected based on the unit used to specify the instance size + // for non-autoscaling instances, or the unit used in autoscaling limit for + // autoscaling instances. + oneof compute_capacity { + // The number of nodes allocated to each replica. + // + // This may be zero in API responses for instances that are not yet in + // state `READY`. + int32 node_count = 2; + + // The number of processing units allocated to each replica. + // + // This may be zero in API responses for instances that are not yet in + // state `READY`. + int32 processing_units = 3; + } +} + +// Autoscaling configuration for an instance. +message AutoscalingConfig { + // The autoscaling limits for the instance. Users can define the minimum and + // maximum compute capacity allocated to the instance, and the autoscaler will + // only scale within that range. Users can either use nodes or processing + // units to specify the limits, but should use the same unit to set both the + // min_limit and max_limit. + message AutoscalingLimits { + // The minimum compute capacity for the instance. + oneof min_limit { + // Minimum number of nodes allocated to the instance. If set, this number + // should be greater than or equal to 1. + int32 min_nodes = 1; + + // Minimum number of processing units allocated to the instance. If set, + // this number should be multiples of 1000. + int32 min_processing_units = 2; + } + + // The maximum compute capacity for the instance. The maximum compute + // capacity should be less than or equal to 10X the minimum compute + // capacity. + oneof max_limit { + // Maximum number of nodes allocated to the instance. If set, this number + // should be greater than or equal to min_nodes. + int32 max_nodes = 3; + + // Maximum number of processing units allocated to the instance. If set, + // this number should be multiples of 1000 and be greater than or equal to + // min_processing_units. + int32 max_processing_units = 4; + } + } + + // The autoscaling targets for an instance. + message AutoscalingTargets { + // Optional. The target high priority cpu utilization percentage that the + // autoscaler should be trying to achieve for the instance. This number is + // on a scale from 0 (no utilization) to 100 (full utilization). The valid + // range is [10, 90] inclusive. If not specified or set to 0, the autoscaler + // skips scaling based on high priority CPU utilization. + int32 high_priority_cpu_utilization_percent = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The target total CPU utilization percentage that the autoscaler + // should be trying to achieve for the instance. This number is on a scale + // from 0 (no utilization) to 100 (full utilization). The valid range is + // [10, 90] inclusive. If not specified or set to 0, the autoscaler skips + // scaling based on total CPU utilization. If both + // `high_priority_cpu_utilization_percent` and + // `total_cpu_utilization_percent` are specified, the autoscaler provisions + // the larger of the two required compute capacities to satisfy both + // targets. + int32 total_cpu_utilization_percent = 4 + [(google.api.field_behavior) = OPTIONAL]; + + // Required. The target storage utilization percentage that the autoscaler + // should be trying to achieve for the instance. This number is on a scale + // from 0 (no utilization) to 100 (full utilization). The valid range is + // [10, 99] inclusive. + int32 storage_utilization_percent = 2 + [(google.api.field_behavior) = REQUIRED]; + } + + // AsymmetricAutoscalingOption specifies the scaling of replicas identified by + // the given selection. + message AsymmetricAutoscalingOption { + // Overrides the top-level autoscaling configuration for the replicas + // identified by `replica_selection`. All fields in this message are + // optional. Any unspecified fields will use the corresponding values from + // the top-level autoscaling configuration. + message AutoscalingConfigOverrides { + // Optional. If specified, overrides the min/max limit in the top-level + // autoscaling configuration for the selected replicas. + AutoscalingLimits autoscaling_limits = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If specified, overrides the autoscaling target + // high_priority_cpu_utilization_percent in the top-level autoscaling + // configuration for the selected replicas. + int32 autoscaling_target_high_priority_cpu_utilization_percent = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If specified, overrides the + // autoscaling target `total_cpu_utilization_percent` + // in the top-level autoscaling configuration for the selected replicas. + int32 autoscaling_target_total_cpu_utilization_percent = 4 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If true, disables high priority CPU autoscaling for the + // selected replicas and ignores + // [high_priority_cpu_utilization_percent][google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets.high_priority_cpu_utilization_percent] + // in the top-level autoscaling configuration. + // + // When setting this field to true, setting + // [autoscaling_target_high_priority_cpu_utilization_percent][google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides.autoscaling_target_high_priority_cpu_utilization_percent] + // field to a non-zero value for the same replica is not supported. + // + // If false, the + // [autoscaling_target_high_priority_cpu_utilization_percent][google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides.autoscaling_target_high_priority_cpu_utilization_percent] + // field in the replica will be used if set to a non-zero value. + // Otherwise, the + // [high_priority_cpu_utilization_percent][google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets.high_priority_cpu_utilization_percent] + // field in the top-level autoscaling configuration will be used. + // + // Setting both + // [disable_high_priority_cpu_autoscaling][google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides.disable_high_priority_cpu_autoscaling] + // and + // [disable_total_cpu_autoscaling][google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides.disable_total_cpu_autoscaling] + // to true for the same replica is not supported. + bool disable_high_priority_cpu_autoscaling = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If true, disables total CPU autoscaling for the selected + // replicas and ignores + // [total_cpu_utilization_percent][google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets.total_cpu_utilization_percent] + // in the top-level autoscaling configuration. + // + // When setting this field to true, setting + // [autoscaling_target_total_cpu_utilization_percent][google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides.autoscaling_target_total_cpu_utilization_percent] + // field to a non-zero value for the same replica is not supported. + // + // If false, the + // [autoscaling_target_total_cpu_utilization_percent][google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides.autoscaling_target_total_cpu_utilization_percent] + // field in the replica will be used if set to a non-zero value. + // Otherwise, the + // [total_cpu_utilization_percent][google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets.total_cpu_utilization_percent] + // field in the top-level autoscaling configuration will be used. + // + // Setting both + // [disable_high_priority_cpu_autoscaling][google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides.disable_high_priority_cpu_autoscaling] + // and + // [disable_total_cpu_autoscaling][google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides.disable_total_cpu_autoscaling] + // to true for the same replica is not supported. + bool disable_total_cpu_autoscaling = 6 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Required. Selects the replicas to which this AsymmetricAutoscalingOption + // applies. Only read-only replicas are supported. + ReplicaSelection replica_selection = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. Overrides applied to the top-level autoscaling configuration + // for the selected replicas. + AutoscalingConfigOverrides overrides = 2 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Required. Autoscaling limits for an instance. + AutoscalingLimits autoscaling_limits = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. The autoscaling targets for an instance. + AutoscalingTargets autoscaling_targets = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. Optional asymmetric autoscaling options. + // Replicas matching the replica selection criteria will be autoscaled + // independently from other replicas. The autoscaler will scale the replicas + // based on the utilization of replicas identified by the replica selection. + // Replica selections should not overlap with each other. + // + // Other replicas (those do not match any replica selection) will be + // autoscaled together and will have the same compute capacity allocated to + // them. + repeated AsymmetricAutoscalingOption asymmetric_autoscaling_options = 3 + [(google.api.field_behavior) = OPTIONAL]; +} + +// An isolated set of Cloud Spanner resources on which databases can be hosted. +message Instance { + option (google.api.resource) = { + type: "spanner.googleapis.com/Instance" + pattern: "projects/{project}/instances/{instance}" + plural: "instances" + singular: "instance" + }; + + // Indicates the current state of the instance. + enum State { + // Not specified. + STATE_UNSPECIFIED = 0; + + // The instance is still being created. Resources may not be + // available yet, and operations such as database creation may not + // work. + CREATING = 1; + + // The instance is fully created and ready to do work such as + // creating databases. + READY = 2; + } + + // The type of this instance. The type can be used to distinguish product + // variants, that can affect aspects like: usage restrictions, quotas and + // billing. Currently this is used to distinguish FREE_INSTANCE vs PROVISIONED + // instances. + enum InstanceType { + // Not specified. + INSTANCE_TYPE_UNSPECIFIED = 0; + + // Provisioned instances have dedicated resources, standard usage limits and + // support. + PROVISIONED = 1; + + // Free instances provide no guarantee for dedicated resources, + // [node_count, processing_units] should be 0. They come + // with stricter usage limits and limited support. + FREE_INSTANCE = 2; + } + + // The edition selected for this instance. Different editions provide + // different capabilities at different price points. + enum Edition { + // Edition not specified. + EDITION_UNSPECIFIED = 0; + + // Standard edition. + STANDARD = 1; + + // Enterprise edition. + ENTERPRISE = 2; + + // Enterprise Plus edition. + ENTERPRISE_PLUS = 3; + } + + // Indicates the + // [default backup + // schedule](https://cloud.google.com/spanner/docs/backup#default-backup-schedules) + // behavior for new databases within the instance. + enum DefaultBackupScheduleType { + // Not specified. + DEFAULT_BACKUP_SCHEDULE_TYPE_UNSPECIFIED = 0; + + // A default backup schedule isn't created automatically when a new database + // is created in the instance. + NONE = 1; + + // A default backup schedule is created automatically when a new database + // is created in the instance. The default backup schedule creates a full + // backup every 24 hours. These full backups are retained for 7 days. + // You can edit or delete the default backup schedule once it's created. + AUTOMATIC = 2; + } + + // Required. A unique identifier for the instance, which cannot be changed + // after the instance is created. Values are of the form + // `projects//instances/[a-z][-a-z0-9]*[a-z0-9]`. The final + // segment of the name must be between 2 and 64 characters in length. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The name of the instance's configuration. Values are of the form + // `projects//instanceConfigs/`. See + // also [InstanceConfig][google.spanner.admin.instance.v1.InstanceConfig] and + // [ListInstanceConfigs][google.spanner.admin.instance.v1.InstanceAdmin.ListInstanceConfigs]. + string config = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "spanner.googleapis.com/InstanceConfig" + } + ]; + + // Required. The descriptive name for this instance as it appears in UIs. + // Must be unique per project and between 4 and 30 characters in length. + string display_name = 3 [(google.api.field_behavior) = REQUIRED]; + + // The number of nodes allocated to this instance. At most, one of either + // `node_count` or `processing_units` should be present in the message. + // + // Users can set the `node_count` field to specify the target number of nodes + // allocated to the instance. + // + // If autoscaling is enabled, `node_count` is treated as an `OUTPUT_ONLY` + // field and reflects the current number of nodes allocated to the instance. + // + // This might be zero in API responses for instances that are not yet in the + // `READY` state. + // + // + // For more information, see + // [Compute capacity, nodes, and processing + // units](https://cloud.google.com/spanner/docs/compute-capacity). + int32 node_count = 5; + + // The number of processing units allocated to this instance. At most, one of + // either `processing_units` or `node_count` should be present in the message. + // + // Users can set the `processing_units` field to specify the target number of + // processing units allocated to the instance. + // + // If autoscaling is enabled, `processing_units` is treated as an + // `OUTPUT_ONLY` field and reflects the current number of processing units + // allocated to the instance. + // + // This might be zero in API responses for instances that are not yet in the + // `READY` state. + // + // + // For more information, see + // [Compute capacity, nodes and processing + // units](https://cloud.google.com/spanner/docs/compute-capacity). + int32 processing_units = 9; + + // Output only. Lists the compute capacity per ReplicaSelection. A replica + // selection identifies a set of replicas with common properties. Replicas + // identified by a ReplicaSelection are scaled with the same compute capacity. + repeated ReplicaComputeCapacity replica_compute_capacity = 19 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The autoscaling configuration. Autoscaling is enabled if this + // field is set. When autoscaling is enabled, node_count and processing_units + // are treated as OUTPUT_ONLY fields and reflect the current compute capacity + // allocated to the instance. + AutoscalingConfig autoscaling_config = 17 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The current instance state. For + // [CreateInstance][google.spanner.admin.instance.v1.InstanceAdmin.CreateInstance], + // the state must be either omitted or set to `CREATING`. For + // [UpdateInstance][google.spanner.admin.instance.v1.InstanceAdmin.UpdateInstance], + // the state must be either omitted or set to `READY`. + State state = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Cloud Labels are a flexible and lightweight mechanism for organizing cloud + // resources into groups that reflect a customer's organizational needs and + // deployment strategies. Cloud Labels can be used to filter collections of + // resources. They can be used to control how resource metrics are aggregated. + // And they can be used as arguments to policy management rules (e.g. route, + // firewall, load balancing, etc.). + // + // * Label keys must be between 1 and 63 characters long and must conform to + // the following regular expression: `[a-z][a-z0-9_-]{0,62}`. + // * Label values must be between 0 and 63 characters long and must conform + // to the regular expression `[a-z0-9_-]{0,63}`. + // * No more than 64 labels can be associated with a given resource. + // + // See https://goo.gl/xmQnxf for more information on and examples of labels. + // + // If you plan to use labels in your own code, please note that additional + // characters may be allowed in the future. And so you are advised to use an + // internal label representation, such as JSON, which doesn't rely upon + // specific characters being disallowed. For example, representing labels + // as the string: name + "_" + value would prove problematic if we were to + // allow "_" in a future release. + map labels = 7; + + // The `InstanceType` of the current instance. + InstanceType instance_type = 10; + + // Deprecated. This field is not populated. + repeated string endpoint_uris = 8; + + // Output only. The time at which the instance was created. + google.protobuf.Timestamp create_time = 11 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which the instance was most recently updated. + google.protobuf.Timestamp update_time = 12 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Free instance metadata. Only populated for free instances. + FreeInstanceMetadata free_instance_metadata = 13; + + // Optional. The `Edition` of the current instance. + Edition edition = 20 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Controls the default backup schedule behavior for new databases + // within the instance. By default, a backup schedule is created automatically + // when a new database is created in a new instance. + // + // Note that the `AUTOMATIC` value isn't permitted for free instances, + // as backups and backup schedules aren't supported for free instances. + // + // In the `GetInstance` or `ListInstances` response, if the value of + // `default_backup_schedule_type` isn't set, or set to `NONE`, Spanner doesn't + // create a default backup schedule for new databases in the instance. + DefaultBackupScheduleType default_backup_schedule_type = 23 + [(google.api.field_behavior) = OPTIONAL]; +} + +// The request for +// [ListInstanceConfigs][google.spanner.admin.instance.v1.InstanceAdmin.ListInstanceConfigs]. +message ListInstanceConfigsRequest { + // Required. The name of the project for which a list of supported instance + // configurations is requested. Values are of the form + // `projects/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // Number of instance configurations to be returned in the response. If 0 or + // less, defaults to the server's maximum allowed page size. + int32 page_size = 2; + + // If non-empty, `page_token` should contain a + // [next_page_token][google.spanner.admin.instance.v1.ListInstanceConfigsResponse.next_page_token] + // from a previous + // [ListInstanceConfigsResponse][google.spanner.admin.instance.v1.ListInstanceConfigsResponse]. + string page_token = 3; +} + +// The response for +// [ListInstanceConfigs][google.spanner.admin.instance.v1.InstanceAdmin.ListInstanceConfigs]. +message ListInstanceConfigsResponse { + // The list of requested instance configurations. + repeated InstanceConfig instance_configs = 1; + + // `next_page_token` can be sent in a subsequent + // [ListInstanceConfigs][google.spanner.admin.instance.v1.InstanceAdmin.ListInstanceConfigs] + // call to fetch more of the matching instance configurations. + string next_page_token = 2; +} + +// The request for +// [GetInstanceConfigRequest][google.spanner.admin.instance.v1.InstanceAdmin.GetInstanceConfig]. +message GetInstanceConfigRequest { + // Required. The name of the requested instance configuration. Values are of + // the form `projects//instanceConfigs/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "spanner.googleapis.com/InstanceConfig" + } + ]; +} + +// The request for +// [CreateInstanceConfig][google.spanner.admin.instance.v1.InstanceAdmin.CreateInstanceConfig]. +message CreateInstanceConfigRequest { + // Required. The name of the project in which to create the instance + // configuration. Values are of the form `projects/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // Required. The ID of the instance configuration to create. Valid identifiers + // are of the form `custom-[-a-z0-9]*[a-z0-9]` and must be between 2 and 64 + // characters in length. The `custom-` prefix is required to avoid name + // conflicts with Google-managed configurations. + string instance_config_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The `InstanceConfig` proto of the configuration to create. + // `instance_config.name` must be + // `/instanceConfigs/`. + // `instance_config.base_config` must be a Google-managed configuration name, + // e.g. /instanceConfigs/us-east1, /instanceConfigs/nam3. + InstanceConfig instance_config = 3 [(google.api.field_behavior) = REQUIRED]; + + // An option to validate, but not actually execute, a request, + // and provide the same response. + bool validate_only = 4; +} + +// The request for +// [UpdateInstanceConfig][google.spanner.admin.instance.v1.InstanceAdmin.UpdateInstanceConfig]. +message UpdateInstanceConfigRequest { + // Required. The user instance configuration to update, which must always + // include the instance configuration name. Otherwise, only fields mentioned + // in + // [update_mask][google.spanner.admin.instance.v1.UpdateInstanceConfigRequest.update_mask] + // need be included. To prevent conflicts of concurrent updates, + // [etag][google.spanner.admin.instance.v1.InstanceConfig.reconciling] can + // be used. + InstanceConfig instance_config = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. A mask specifying which fields in + // [InstanceConfig][google.spanner.admin.instance.v1.InstanceConfig] should be + // updated. The field mask must always be specified; this prevents any future + // fields in [InstanceConfig][google.spanner.admin.instance.v1.InstanceConfig] + // from being erased accidentally by clients that do not know about them. Only + // display_name and labels can be updated. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; + + // An option to validate, but not actually execute, a request, + // and provide the same response. + bool validate_only = 3; +} + +// The request for +// [DeleteInstanceConfig][google.spanner.admin.instance.v1.InstanceAdmin.DeleteInstanceConfig]. +message DeleteInstanceConfigRequest { + // Required. The name of the instance configuration to be deleted. + // Values are of the form + // `projects//instanceConfigs/` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "spanner.googleapis.com/InstanceConfig" + } + ]; + + // Used for optimistic concurrency control as a way to help prevent + // simultaneous deletes of an instance configuration from overwriting each + // other. If not empty, the API + // only deletes the instance configuration when the etag provided matches the + // current status of the requested instance configuration. Otherwise, deletes + // the instance configuration without checking the current status of the + // requested instance configuration. + string etag = 2; + + // An option to validate, but not actually execute, a request, + // and provide the same response. + bool validate_only = 3; +} + +// The request for +// [ListInstanceConfigOperations][google.spanner.admin.instance.v1.InstanceAdmin.ListInstanceConfigOperations]. +message ListInstanceConfigOperationsRequest { + // Required. The project of the instance configuration operations. + // Values are of the form `projects/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // An expression that filters the list of returned operations. + // + // A filter expression consists of a field name, a + // comparison operator, and a value for filtering. + // The value must be a string, a number, or a boolean. The comparison operator + // must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. + // Colon `:` is the contains operator. Filter rules are not case sensitive. + // + // The following fields in the Operation are eligible for filtering: + // + // * `name` - The name of the long-running operation + // * `done` - False if the operation is in progress, else true. + // * `metadata.@type` - the type of metadata. For example, the type string + // for + // [CreateInstanceConfigMetadata][google.spanner.admin.instance.v1.CreateInstanceConfigMetadata] + // is + // `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstanceConfigMetadata`. + // * `metadata.` - any field in metadata.value. + // `metadata.@type` must be specified first, if filtering on metadata + // fields. + // * `error` - Error associated with the long-running operation. + // * `response.@type` - the type of response. + // * `response.` - any field in response.value. + // + // You can combine multiple expressions by enclosing each expression in + // parentheses. By default, expressions are combined with AND logic. However, + // you can specify AND, OR, and NOT logic explicitly. + // + // Here are a few examples: + // + // * `done:true` - The operation is complete. + // * `(metadata.@type=` \ + // `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstanceConfigMetadata) + // AND` \ + // `(metadata.instance_config.name:custom-config) AND` \ + // `(metadata.progress.start_time < \"2021-03-28T14:50:00Z\") AND` \ + // `(error:*)` - Return operations where: + // * The operation's metadata type is + // [CreateInstanceConfigMetadata][google.spanner.admin.instance.v1.CreateInstanceConfigMetadata]. + // * The instance configuration name contains "custom-config". + // * The operation started before 2021-03-28T14:50:00Z. + // * The operation resulted in an error. + string filter = 2; + + // Number of operations to be returned in the response. If 0 or + // less, defaults to the server's maximum allowed page size. + int32 page_size = 3; + + // If non-empty, `page_token` should contain a + // [next_page_token][google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse.next_page_token] + // from a previous + // [ListInstanceConfigOperationsResponse][google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse] + // to the same `parent` and with the same `filter`. + string page_token = 4; +} + +// The response for +// [ListInstanceConfigOperations][google.spanner.admin.instance.v1.InstanceAdmin.ListInstanceConfigOperations]. +message ListInstanceConfigOperationsResponse { + // The list of matching instance configuration long-running operations. Each + // operation's name will be + // prefixed by the name of the instance configuration. The operation's + // metadata field type + // `metadata.type_url` describes the type of the metadata. + repeated google.longrunning.Operation operations = 1; + + // `next_page_token` can be sent in a subsequent + // [ListInstanceConfigOperations][google.spanner.admin.instance.v1.InstanceAdmin.ListInstanceConfigOperations] + // call to fetch more of the matching metadata. + string next_page_token = 2; +} + +// The request for +// [GetInstance][google.spanner.admin.instance.v1.InstanceAdmin.GetInstance]. +message GetInstanceRequest { + // Required. The name of the requested instance. Values are of the form + // `projects//instances/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "spanner.googleapis.com/Instance" + } + ]; + + // If field_mask is present, specifies the subset of + // [Instance][google.spanner.admin.instance.v1.Instance] fields that should be + // returned. If absent, all + // [Instance][google.spanner.admin.instance.v1.Instance] fields are returned. + google.protobuf.FieldMask field_mask = 2; +} + +// The request for +// [CreateInstance][google.spanner.admin.instance.v1.InstanceAdmin.CreateInstance]. +message CreateInstanceRequest { + // Required. The name of the project in which to create the instance. Values + // are of the form `projects/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // Required. The ID of the instance to create. Valid identifiers are of the + // form `[a-z][-a-z0-9]*[a-z0-9]` and must be between 2 and 64 characters in + // length. + string instance_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The instance to create. The name may be omitted, but if + // specified must be `/instances/`. + Instance instance = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// The request for +// [ListInstances][google.spanner.admin.instance.v1.InstanceAdmin.ListInstances]. +message ListInstancesRequest { + // Required. The name of the project for which a list of instances is + // requested. Values are of the form `projects/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // Number of instances to be returned in the response. If 0 or less, defaults + // to the server's maximum allowed page size. + int32 page_size = 2; + + // If non-empty, `page_token` should contain a + // [next_page_token][google.spanner.admin.instance.v1.ListInstancesResponse.next_page_token] + // from a previous + // [ListInstancesResponse][google.spanner.admin.instance.v1.ListInstancesResponse]. + string page_token = 3; + + // An expression for filtering the results of the request. Filter rules are + // case insensitive. The fields eligible for filtering are: + // + // * `name` + // * `display_name` + // * `labels.key` where key is the name of a label + // + // Some examples of using filters are: + // + // * `name:*` --> The instance has a name. + // * `name:Howl` --> The instance's name contains the string "howl". + // * `name:HOWL` --> Equivalent to above. + // * `NAME:howl` --> Equivalent to above. + // * `labels.env:*` --> The instance has the label "env". + // * `labels.env:dev` --> The instance has the label "env" and the value of + // the label contains the string "dev". + // * `name:howl labels.env:dev` --> The instance's name contains "howl" and + // it has the label "env" with its value + // containing "dev". + string filter = 4; + + // Deadline used while retrieving metadata for instances. + // Instances whose metadata cannot be retrieved within this deadline will be + // added to + // [unreachable][google.spanner.admin.instance.v1.ListInstancesResponse.unreachable] + // in + // [ListInstancesResponse][google.spanner.admin.instance.v1.ListInstancesResponse]. + google.protobuf.Timestamp instance_deadline = 5; +} + +// The response for +// [ListInstances][google.spanner.admin.instance.v1.InstanceAdmin.ListInstances]. +message ListInstancesResponse { + // The list of requested instances. + repeated Instance instances = 1; + + // `next_page_token` can be sent in a subsequent + // [ListInstances][google.spanner.admin.instance.v1.InstanceAdmin.ListInstances] + // call to fetch more of the matching instances. + string next_page_token = 2; + + // The list of unreachable instances. + // It includes the names of instances whose metadata could not be retrieved + // within + // [instance_deadline][google.spanner.admin.instance.v1.ListInstancesRequest.instance_deadline]. + repeated string unreachable = 3; +} + +// The request for +// [UpdateInstance][google.spanner.admin.instance.v1.InstanceAdmin.UpdateInstance]. +message UpdateInstanceRequest { + // Required. The instance to update, which must always include the instance + // name. Otherwise, only fields mentioned in + // [field_mask][google.spanner.admin.instance.v1.UpdateInstanceRequest.field_mask] + // need be included. + Instance instance = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. A mask specifying which fields in + // [Instance][google.spanner.admin.instance.v1.Instance] should be updated. + // The field mask must always be specified; this prevents any future fields in + // [Instance][google.spanner.admin.instance.v1.Instance] from being erased + // accidentally by clients that do not know about them. + google.protobuf.FieldMask field_mask = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// The request for +// [DeleteInstance][google.spanner.admin.instance.v1.InstanceAdmin.DeleteInstance]. +message DeleteInstanceRequest { + // Required. The name of the instance to be deleted. Values are of the form + // `projects//instances/` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "spanner.googleapis.com/Instance" + } + ]; +} + +// Metadata type for the operation returned by +// [CreateInstance][google.spanner.admin.instance.v1.InstanceAdmin.CreateInstance]. +message CreateInstanceMetadata { + // The instance being created. + Instance instance = 1; + + // The time at which the + // [CreateInstance][google.spanner.admin.instance.v1.InstanceAdmin.CreateInstance] + // request was received. + google.protobuf.Timestamp start_time = 2; + + // The time at which this operation was cancelled. If set, this operation is + // in the process of undoing itself (which is guaranteed to succeed) and + // cannot be cancelled again. + google.protobuf.Timestamp cancel_time = 3; + + // The time at which this operation failed or was completed successfully. + google.protobuf.Timestamp end_time = 4; + + // The expected fulfillment period of this create operation. + FulfillmentPeriod expected_fulfillment_period = 5; +} + +// Metadata type for the operation returned by +// [UpdateInstance][google.spanner.admin.instance.v1.InstanceAdmin.UpdateInstance]. +message UpdateInstanceMetadata { + // The desired end state of the update. + Instance instance = 1; + + // The time at which + // [UpdateInstance][google.spanner.admin.instance.v1.InstanceAdmin.UpdateInstance] + // request was received. + google.protobuf.Timestamp start_time = 2; + + // The time at which this operation was cancelled. If set, this operation is + // in the process of undoing itself (which is guaranteed to succeed) and + // cannot be cancelled again. + google.protobuf.Timestamp cancel_time = 3; + + // The time at which this operation failed or was completed successfully. + google.protobuf.Timestamp end_time = 4; + + // The expected fulfillment period of this update operation. + FulfillmentPeriod expected_fulfillment_period = 5; +} + +// Free instance specific metadata that is kept even after an instance has been +// upgraded for tracking purposes. +message FreeInstanceMetadata { + // Allows users to change behavior when a free instance expires. + enum ExpireBehavior { + // Not specified. + EXPIRE_BEHAVIOR_UNSPECIFIED = 0; + + // When the free instance expires, upgrade the instance to a provisioned + // instance. + FREE_TO_PROVISIONED = 1; + + // When the free instance expires, disable the instance, and delete it + // after the grace period passes if it has not been upgraded. + REMOVE_AFTER_GRACE_PERIOD = 2; + } + + // Output only. Timestamp after which the instance will either be upgraded or + // scheduled for deletion after a grace period. ExpireBehavior is used to + // choose between upgrading or scheduling the free instance for deletion. This + // timestamp is set during the creation of a free instance. + google.protobuf.Timestamp expire_time = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. If present, the timestamp at which the free instance was + // upgraded to a provisioned instance. + google.protobuf.Timestamp upgrade_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Specifies the expiration behavior of a free instance. The default of + // ExpireBehavior is `REMOVE_AFTER_GRACE_PERIOD`. This can be modified during + // or after creation, and before expiration. + ExpireBehavior expire_behavior = 3; +} + +// Metadata type for the operation returned by +// [CreateInstanceConfig][google.spanner.admin.instance.v1.InstanceAdmin.CreateInstanceConfig]. +message CreateInstanceConfigMetadata { + // The target instance configuration end state. + InstanceConfig instance_config = 1; + + // The progress of the + // [CreateInstanceConfig][google.spanner.admin.instance.v1.InstanceAdmin.CreateInstanceConfig] + // operation. + OperationProgress progress = 2; + + // The time at which this operation was cancelled. + google.protobuf.Timestamp cancel_time = 3; +} + +// Metadata type for the operation returned by +// [UpdateInstanceConfig][google.spanner.admin.instance.v1.InstanceAdmin.UpdateInstanceConfig]. +message UpdateInstanceConfigMetadata { + // The desired instance configuration after updating. + InstanceConfig instance_config = 1; + + // The progress of the + // [UpdateInstanceConfig][google.spanner.admin.instance.v1.InstanceAdmin.UpdateInstanceConfig] + // operation. + OperationProgress progress = 2; + + // The time at which this operation was cancelled. + google.protobuf.Timestamp cancel_time = 3; +} + +// An isolated set of Cloud Spanner resources that databases can define +// placements on. +message InstancePartition { + option (google.api.resource) = { + type: "spanner.googleapis.com/InstancePartition" + pattern: "projects/{project}/instances/{instance}/instancePartitions/{instance_partition}" + plural: "instancePartitions" + singular: "instancePartition" + }; + + // Indicates the current state of the instance partition. + enum State { + // Not specified. + STATE_UNSPECIFIED = 0; + + // The instance partition is still being created. Resources may not be + // available yet, and operations such as creating placements using this + // instance partition may not work. + CREATING = 1; + + // The instance partition is fully created and ready to do work such as + // creating placements and using in databases. + READY = 2; + } + + // Required. A unique identifier for the instance partition. Values are of the + // form + // `projects//instances//instancePartitions/[a-z][-a-z0-9]*[a-z0-9]`. + // The final segment of the name must be between 2 and 64 characters in + // length. An instance partition's name cannot be changed after the instance + // partition is created. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The name of the instance partition's configuration. Values are of + // the form `projects//instanceConfigs/`. See also + // [InstanceConfig][google.spanner.admin.instance.v1.InstanceConfig] and + // [ListInstanceConfigs][google.spanner.admin.instance.v1.InstanceAdmin.ListInstanceConfigs]. + string config = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "spanner.googleapis.com/InstanceConfig" + } + ]; + + // Required. The descriptive name for this instance partition as it appears in + // UIs. Must be unique per project and between 4 and 30 characters in length. + string display_name = 3 [(google.api.field_behavior) = REQUIRED]; + + // Compute capacity defines amount of server and storage resources that are + // available to the databases in an instance partition. At most, one of either + // `node_count` or` processing_units` should be present in the message. For + // more information, see + // [Compute capacity, nodes, and processing + // units](https://cloud.google.com/spanner/docs/compute-capacity). + oneof compute_capacity { + // The number of nodes allocated to this instance partition. + // + // Users can set the `node_count` field to specify the target number of + // nodes allocated to the instance partition. + // + // This may be zero in API responses for instance partitions that are not + // yet in state `READY`. + int32 node_count = 5; + + // The number of processing units allocated to this instance partition. + // + // Users can set the `processing_units` field to specify the target number + // of processing units allocated to the instance partition. + // + // This might be zero in API responses for instance partitions that are not + // yet in the `READY` state. + int32 processing_units = 6; + } + + // Optional. The autoscaling configuration. Autoscaling is enabled if this + // field is set. When autoscaling is enabled, fields in compute_capacity are + // treated as OUTPUT_ONLY fields and reflect the current compute capacity + // allocated to the instance partition. + AutoscalingConfig autoscaling_config = 13 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The current instance partition state. + State state = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which the instance partition was created. + google.protobuf.Timestamp create_time = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which the instance partition was most recently + // updated. + google.protobuf.Timestamp update_time = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The names of the databases that reference this + // instance partition. Referencing databases should share the parent instance. + // The existence of any referencing database prevents the instance partition + // from being deleted. + repeated string referencing_databases = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Deprecated: This field is not populated. + // Output only. The names of the backups that reference this instance + // partition. Referencing backups should share the parent instance. The + // existence of any referencing backup prevents the instance partition from + // being deleted. + repeated string referencing_backups = 11 + [deprecated = true, (google.api.field_behavior) = OUTPUT_ONLY]; + + // Used for optimistic concurrency control as a way + // to help prevent simultaneous updates of a instance partition from + // overwriting each other. It is strongly suggested that systems make use of + // the etag in the read-modify-write cycle to perform instance partition + // updates in order to avoid race conditions: An etag is returned in the + // response which contains instance partitions, and systems are expected to + // put that etag in the request to update instance partitions to ensure that + // their change will be applied to the same version of the instance partition. + // If no etag is provided in the call to update instance partition, then the + // existing instance partition is overwritten blindly. + string etag = 12; +} + +// Metadata type for the operation returned by +// [CreateInstancePartition][google.spanner.admin.instance.v1.InstanceAdmin.CreateInstancePartition]. +message CreateInstancePartitionMetadata { + // The instance partition being created. + InstancePartition instance_partition = 1; + + // The time at which the + // [CreateInstancePartition][google.spanner.admin.instance.v1.InstanceAdmin.CreateInstancePartition] + // request was received. + google.protobuf.Timestamp start_time = 2; + + // The time at which this operation was cancelled. If set, this operation is + // in the process of undoing itself (which is guaranteed to succeed) and + // cannot be cancelled again. + google.protobuf.Timestamp cancel_time = 3; + + // The time at which this operation failed or was completed successfully. + google.protobuf.Timestamp end_time = 4; +} + +// The request for +// [CreateInstancePartition][google.spanner.admin.instance.v1.InstanceAdmin.CreateInstancePartition]. +message CreateInstancePartitionRequest { + // Required. The name of the instance in which to create the instance + // partition. Values are of the form + // `projects//instances/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "spanner.googleapis.com/Instance" + } + ]; + + // Required. The ID of the instance partition to create. Valid identifiers are + // of the form `[a-z][-a-z0-9]*[a-z0-9]` and must be between 2 and 64 + // characters in length. + string instance_partition_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The instance partition to create. The instance_partition.name may + // be omitted, but if specified must be + // `/instancePartitions/`. + InstancePartition instance_partition = 3 + [(google.api.field_behavior) = REQUIRED]; +} + +// The request for +// [DeleteInstancePartition][google.spanner.admin.instance.v1.InstanceAdmin.DeleteInstancePartition]. +message DeleteInstancePartitionRequest { + // Required. The name of the instance partition to be deleted. + // Values are of the form + // `projects/{project}/instances/{instance}/instancePartitions/{instance_partition}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "spanner.googleapis.com/InstancePartition" + } + ]; + + // Optional. If not empty, the API only deletes the instance partition when + // the etag provided matches the current status of the requested instance + // partition. Otherwise, deletes the instance partition without checking the + // current status of the requested instance partition. + string etag = 2; +} + +// The request for +// [GetInstancePartition][google.spanner.admin.instance.v1.InstanceAdmin.GetInstancePartition]. +message GetInstancePartitionRequest { + // Required. The name of the requested instance partition. Values are of + // the form + // `projects/{project}/instances/{instance}/instancePartitions/{instance_partition}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "spanner.googleapis.com/InstancePartition" + } + ]; +} + +// The request for +// [UpdateInstancePartition][google.spanner.admin.instance.v1.InstanceAdmin.UpdateInstancePartition]. +message UpdateInstancePartitionRequest { + // Required. The instance partition to update, which must always include the + // instance partition name. Otherwise, only fields mentioned in + // [field_mask][google.spanner.admin.instance.v1.UpdateInstancePartitionRequest.field_mask] + // need be included. + InstancePartition instance_partition = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. A mask specifying which fields in + // [InstancePartition][google.spanner.admin.instance.v1.InstancePartition] + // should be updated. The field mask must always be specified; this prevents + // any future fields in + // [InstancePartition][google.spanner.admin.instance.v1.InstancePartition] + // from being erased accidentally by clients that do not know about them. + google.protobuf.FieldMask field_mask = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// Metadata type for the operation returned by +// [UpdateInstancePartition][google.spanner.admin.instance.v1.InstanceAdmin.UpdateInstancePartition]. +message UpdateInstancePartitionMetadata { + // The desired end state of the update. + InstancePartition instance_partition = 1; + + // The time at which + // [UpdateInstancePartition][google.spanner.admin.instance.v1.InstanceAdmin.UpdateInstancePartition] + // request was received. + google.protobuf.Timestamp start_time = 2; + + // The time at which this operation was cancelled. If set, this operation is + // in the process of undoing itself (which is guaranteed to succeed) and + // cannot be cancelled again. + google.protobuf.Timestamp cancel_time = 3; + + // The time at which this operation failed or was completed successfully. + google.protobuf.Timestamp end_time = 4; +} + +// The request for +// [ListInstancePartitions][google.spanner.admin.instance.v1.InstanceAdmin.ListInstancePartitions]. +message ListInstancePartitionsRequest { + // Required. The instance whose instance partitions should be listed. Values + // are of the form `projects//instances/`. Use `{instance} + // = '-'` to list instance partitions for all Instances in a project, e.g., + // `projects/myproject/instances/-`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "spanner.googleapis.com/Instance" + } + ]; + + // Number of instance partitions to be returned in the response. If 0 or less, + // defaults to the server's maximum allowed page size. + int32 page_size = 2; + + // If non-empty, `page_token` should contain a + // [next_page_token][google.spanner.admin.instance.v1.ListInstancePartitionsResponse.next_page_token] + // from a previous + // [ListInstancePartitionsResponse][google.spanner.admin.instance.v1.ListInstancePartitionsResponse]. + string page_token = 3; + + // Optional. Deadline used while retrieving metadata for instance partitions. + // Instance partitions whose metadata cannot be retrieved within this deadline + // will be added to + // [unreachable][google.spanner.admin.instance.v1.ListInstancePartitionsResponse.unreachable] + // in + // [ListInstancePartitionsResponse][google.spanner.admin.instance.v1.ListInstancePartitionsResponse]. + google.protobuf.Timestamp instance_partition_deadline = 4 + [(google.api.field_behavior) = OPTIONAL]; +} + +// The response for +// [ListInstancePartitions][google.spanner.admin.instance.v1.InstanceAdmin.ListInstancePartitions]. +message ListInstancePartitionsResponse { + // The list of requested instancePartitions. + repeated InstancePartition instance_partitions = 1; + + // `next_page_token` can be sent in a subsequent + // [ListInstancePartitions][google.spanner.admin.instance.v1.InstanceAdmin.ListInstancePartitions] + // call to fetch more of the matching instance partitions. + string next_page_token = 2; + + // The list of unreachable instances or instance partitions. + // It includes the names of instances or instance partitions whose metadata + // could not be retrieved within + // [instance_partition_deadline][google.spanner.admin.instance.v1.ListInstancePartitionsRequest.instance_partition_deadline]. + repeated string unreachable = 3; +} + +// The request for +// [ListInstancePartitionOperations][google.spanner.admin.instance.v1.InstanceAdmin.ListInstancePartitionOperations]. +message ListInstancePartitionOperationsRequest { + // Required. The parent instance of the instance partition operations. + // Values are of the form `projects//instances/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "spanner.googleapis.com/Instance" + } + ]; + + // Optional. An expression that filters the list of returned operations. + // + // A filter expression consists of a field name, a + // comparison operator, and a value for filtering. + // The value must be a string, a number, or a boolean. The comparison operator + // must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. + // Colon `:` is the contains operator. Filter rules are not case sensitive. + // + // The following fields in the Operation are eligible for filtering: + // + // * `name` - The name of the long-running operation + // * `done` - False if the operation is in progress, else true. + // * `metadata.@type` - the type of metadata. For example, the type string + // for + // [CreateInstancePartitionMetadata][google.spanner.admin.instance.v1.CreateInstancePartitionMetadata] + // is + // `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstancePartitionMetadata`. + // * `metadata.` - any field in metadata.value. + // `metadata.@type` must be specified first, if filtering on metadata + // fields. + // * `error` - Error associated with the long-running operation. + // * `response.@type` - the type of response. + // * `response.` - any field in response.value. + // + // You can combine multiple expressions by enclosing each expression in + // parentheses. By default, expressions are combined with AND logic. However, + // you can specify AND, OR, and NOT logic explicitly. + // + // Here are a few examples: + // + // * `done:true` - The operation is complete. + // * `(metadata.@type=` \ + // `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstancePartitionMetadata) + // AND` \ + // `(metadata.instance_partition.name:custom-instance-partition) AND` \ + // `(metadata.start_time < \"2021-03-28T14:50:00Z\") AND` \ + // `(error:*)` - Return operations where: + // * The operation's metadata type is + // [CreateInstancePartitionMetadata][google.spanner.admin.instance.v1.CreateInstancePartitionMetadata]. + // * The instance partition name contains "custom-instance-partition". + // * The operation started before 2021-03-28T14:50:00Z. + // * The operation resulted in an error. + string filter = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Number of operations to be returned in the response. If 0 or + // less, defaults to the server's maximum allowed page size. + int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If non-empty, `page_token` should contain a + // [next_page_token][google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse.next_page_token] + // from a previous + // [ListInstancePartitionOperationsResponse][google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse] + // to the same `parent` and with the same `filter`. + string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Deadline used while retrieving metadata for instance partition + // operations. Instance partitions whose operation metadata cannot be + // retrieved within this deadline will be added to + // [unreachable_instance_partitions][google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse.unreachable_instance_partitions] + // in + // [ListInstancePartitionOperationsResponse][google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse]. + google.protobuf.Timestamp instance_partition_deadline = 5 + [(google.api.field_behavior) = OPTIONAL]; +} + +// The response for +// [ListInstancePartitionOperations][google.spanner.admin.instance.v1.InstanceAdmin.ListInstancePartitionOperations]. +message ListInstancePartitionOperationsResponse { + // The list of matching instance partition long-running operations. Each + // operation's name will be + // prefixed by the instance partition's name. The operation's + // metadata field type + // `metadata.type_url` describes the type of the metadata. + repeated google.longrunning.Operation operations = 1; + + // `next_page_token` can be sent in a subsequent + // [ListInstancePartitionOperations][google.spanner.admin.instance.v1.InstanceAdmin.ListInstancePartitionOperations] + // call to fetch more of the matching metadata. + string next_page_token = 2; + + // The list of unreachable instance partitions. + // It includes the names of instance partitions whose operation metadata could + // not be retrieved within + // [instance_partition_deadline][google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest.instance_partition_deadline]. + repeated string unreachable_instance_partitions = 3; +} + +// The request for +// [MoveInstance][google.spanner.admin.instance.v1.InstanceAdmin.MoveInstance]. +message MoveInstanceRequest { + // Required. The instance to move. + // Values are of the form `projects//instances/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "spanner.googleapis.com/Instance" + } + ]; + + // Required. The target instance configuration where to move the instance. + // Values are of the form `projects//instanceConfigs/`. + string target_config = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "spanner.googleapis.com/InstanceConfig" + } + ]; +} + +// The response for +// [MoveInstance][google.spanner.admin.instance.v1.InstanceAdmin.MoveInstance]. +message MoveInstanceResponse {} + +// Metadata type for the operation returned by +// [MoveInstance][google.spanner.admin.instance.v1.InstanceAdmin.MoveInstance]. +message MoveInstanceMetadata { + // The target instance configuration where to move the instance. + // Values are of the form `projects//instanceConfigs/`. + string target_config = 1; + + // The progress of the + // [MoveInstance][google.spanner.admin.instance.v1.InstanceAdmin.MoveInstance] + // operation. + // [progress_percent][google.spanner.admin.instance.v1.OperationProgress.progress_percent] + // is reset when cancellation is requested. + OperationProgress progress = 2; + + // The time at which this operation was cancelled. + google.protobuf.Timestamp cancel_time = 3; +} diff --git a/owl-bot-staging/admin/instance/v1/protos/protos.d.ts b/owl-bot-staging/admin/instance/v1/protos/protos.d.ts new file mode 100644 index 000000000..3610433c9 --- /dev/null +++ b/owl-bot-staging/admin/instance/v1/protos/protos.d.ts @@ -0,0 +1,14931 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import type {protobuf as $protobuf} from "google-gax"; +import Long = require("long"); +/** Namespace google. */ +export namespace google { + + /** Namespace spanner. */ + namespace spanner { + + /** Namespace admin. */ + namespace admin { + + /** Namespace instance. */ + namespace instance { + + /** Namespace v1. */ + namespace v1 { + + /** Properties of an OperationProgress. */ + interface IOperationProgress { + + /** OperationProgress progressPercent */ + progressPercent?: (number|null); + + /** OperationProgress startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** OperationProgress endTime */ + endTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents an OperationProgress. */ + class OperationProgress implements IOperationProgress { + + /** + * Constructs a new OperationProgress. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.instance.v1.IOperationProgress); + + /** OperationProgress progressPercent. */ + public progressPercent: number; + + /** OperationProgress startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** OperationProgress endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new OperationProgress instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationProgress instance + */ + public static create(properties?: google.spanner.admin.instance.v1.IOperationProgress): google.spanner.admin.instance.v1.OperationProgress; + + /** + * Encodes the specified OperationProgress message. Does not implicitly {@link google.spanner.admin.instance.v1.OperationProgress.verify|verify} messages. + * @param message OperationProgress message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.instance.v1.IOperationProgress, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationProgress message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.OperationProgress.verify|verify} messages. + * @param message OperationProgress message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.instance.v1.IOperationProgress, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationProgress message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationProgress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.OperationProgress; + + /** + * Decodes an OperationProgress message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationProgress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.OperationProgress; + + /** + * Verifies an OperationProgress message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OperationProgress message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationProgress + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.OperationProgress; + + /** + * Creates a plain object from an OperationProgress message. Also converts values to other types if specified. + * @param message OperationProgress + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.instance.v1.OperationProgress, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationProgress to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OperationProgress + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** FulfillmentPeriod enum. */ + enum FulfillmentPeriod { + FULFILLMENT_PERIOD_UNSPECIFIED = 0, + FULFILLMENT_PERIOD_NORMAL = 1, + FULFILLMENT_PERIOD_EXTENDED = 2 + } + + /** Properties of a ReplicaSelection. */ + interface IReplicaSelection { + + /** ReplicaSelection location */ + location?: (string|null); + } + + /** Represents a ReplicaSelection. */ + class ReplicaSelection implements IReplicaSelection { + + /** + * Constructs a new ReplicaSelection. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.instance.v1.IReplicaSelection); + + /** ReplicaSelection location. */ + public location: string; + + /** + * Creates a new ReplicaSelection instance using the specified properties. + * @param [properties] Properties to set + * @returns ReplicaSelection instance + */ + public static create(properties?: google.spanner.admin.instance.v1.IReplicaSelection): google.spanner.admin.instance.v1.ReplicaSelection; + + /** + * Encodes the specified ReplicaSelection message. Does not implicitly {@link google.spanner.admin.instance.v1.ReplicaSelection.verify|verify} messages. + * @param message ReplicaSelection message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.instance.v1.IReplicaSelection, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReplicaSelection message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ReplicaSelection.verify|verify} messages. + * @param message ReplicaSelection message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.instance.v1.IReplicaSelection, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReplicaSelection message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReplicaSelection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.ReplicaSelection; + + /** + * Decodes a ReplicaSelection message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReplicaSelection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.ReplicaSelection; + + /** + * Verifies a ReplicaSelection message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReplicaSelection message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReplicaSelection + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.ReplicaSelection; + + /** + * Creates a plain object from a ReplicaSelection message. Also converts values to other types if specified. + * @param message ReplicaSelection + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.instance.v1.ReplicaSelection, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReplicaSelection to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReplicaSelection + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents an InstanceAdmin */ + class InstanceAdmin extends $protobuf.rpc.Service { + + /** + * Constructs a new InstanceAdmin service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new InstanceAdmin 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): InstanceAdmin; + + /** + * Calls ListInstanceConfigs. + * @param request ListInstanceConfigsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListInstanceConfigsResponse + */ + public listInstanceConfigs(request: google.spanner.admin.instance.v1.IListInstanceConfigsRequest, callback: google.spanner.admin.instance.v1.InstanceAdmin.ListInstanceConfigsCallback): void; + + /** + * Calls ListInstanceConfigs. + * @param request ListInstanceConfigsRequest message or plain object + * @returns Promise + */ + public listInstanceConfigs(request: google.spanner.admin.instance.v1.IListInstanceConfigsRequest): Promise; + + /** + * Calls GetInstanceConfig. + * @param request GetInstanceConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and InstanceConfig + */ + public getInstanceConfig(request: google.spanner.admin.instance.v1.IGetInstanceConfigRequest, callback: google.spanner.admin.instance.v1.InstanceAdmin.GetInstanceConfigCallback): void; + + /** + * Calls GetInstanceConfig. + * @param request GetInstanceConfigRequest message or plain object + * @returns Promise + */ + public getInstanceConfig(request: google.spanner.admin.instance.v1.IGetInstanceConfigRequest): Promise; + + /** + * Calls CreateInstanceConfig. + * @param request CreateInstanceConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createInstanceConfig(request: google.spanner.admin.instance.v1.ICreateInstanceConfigRequest, callback: google.spanner.admin.instance.v1.InstanceAdmin.CreateInstanceConfigCallback): void; + + /** + * Calls CreateInstanceConfig. + * @param request CreateInstanceConfigRequest message or plain object + * @returns Promise + */ + public createInstanceConfig(request: google.spanner.admin.instance.v1.ICreateInstanceConfigRequest): Promise; + + /** + * Calls UpdateInstanceConfig. + * @param request UpdateInstanceConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateInstanceConfig(request: google.spanner.admin.instance.v1.IUpdateInstanceConfigRequest, callback: google.spanner.admin.instance.v1.InstanceAdmin.UpdateInstanceConfigCallback): void; + + /** + * Calls UpdateInstanceConfig. + * @param request UpdateInstanceConfigRequest message or plain object + * @returns Promise + */ + public updateInstanceConfig(request: google.spanner.admin.instance.v1.IUpdateInstanceConfigRequest): Promise; + + /** + * Calls DeleteInstanceConfig. + * @param request DeleteInstanceConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteInstanceConfig(request: google.spanner.admin.instance.v1.IDeleteInstanceConfigRequest, callback: google.spanner.admin.instance.v1.InstanceAdmin.DeleteInstanceConfigCallback): void; + + /** + * Calls DeleteInstanceConfig. + * @param request DeleteInstanceConfigRequest message or plain object + * @returns Promise + */ + public deleteInstanceConfig(request: google.spanner.admin.instance.v1.IDeleteInstanceConfigRequest): Promise; + + /** + * Calls ListInstanceConfigOperations. + * @param request ListInstanceConfigOperationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListInstanceConfigOperationsResponse + */ + public listInstanceConfigOperations(request: google.spanner.admin.instance.v1.IListInstanceConfigOperationsRequest, callback: google.spanner.admin.instance.v1.InstanceAdmin.ListInstanceConfigOperationsCallback): void; + + /** + * Calls ListInstanceConfigOperations. + * @param request ListInstanceConfigOperationsRequest message or plain object + * @returns Promise + */ + public listInstanceConfigOperations(request: google.spanner.admin.instance.v1.IListInstanceConfigOperationsRequest): Promise; + + /** + * Calls ListInstances. + * @param request ListInstancesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListInstancesResponse + */ + public listInstances(request: google.spanner.admin.instance.v1.IListInstancesRequest, callback: google.spanner.admin.instance.v1.InstanceAdmin.ListInstancesCallback): void; + + /** + * Calls ListInstances. + * @param request ListInstancesRequest message or plain object + * @returns Promise + */ + public listInstances(request: google.spanner.admin.instance.v1.IListInstancesRequest): Promise; + + /** + * Calls ListInstancePartitions. + * @param request ListInstancePartitionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListInstancePartitionsResponse + */ + public listInstancePartitions(request: google.spanner.admin.instance.v1.IListInstancePartitionsRequest, callback: google.spanner.admin.instance.v1.InstanceAdmin.ListInstancePartitionsCallback): void; + + /** + * Calls ListInstancePartitions. + * @param request ListInstancePartitionsRequest message or plain object + * @returns Promise + */ + public listInstancePartitions(request: google.spanner.admin.instance.v1.IListInstancePartitionsRequest): Promise; + + /** + * Calls GetInstance. + * @param request GetInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Instance + */ + public getInstance(request: google.spanner.admin.instance.v1.IGetInstanceRequest, callback: google.spanner.admin.instance.v1.InstanceAdmin.GetInstanceCallback): void; + + /** + * Calls GetInstance. + * @param request GetInstanceRequest message or plain object + * @returns Promise + */ + public getInstance(request: google.spanner.admin.instance.v1.IGetInstanceRequest): Promise; + + /** + * 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.spanner.admin.instance.v1.ICreateInstanceRequest, callback: google.spanner.admin.instance.v1.InstanceAdmin.CreateInstanceCallback): void; + + /** + * Calls CreateInstance. + * @param request CreateInstanceRequest message or plain object + * @returns Promise + */ + public createInstance(request: google.spanner.admin.instance.v1.ICreateInstanceRequest): Promise; + + /** + * Calls UpdateInstance. + * @param request UpdateInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateInstance(request: google.spanner.admin.instance.v1.IUpdateInstanceRequest, callback: google.spanner.admin.instance.v1.InstanceAdmin.UpdateInstanceCallback): void; + + /** + * Calls UpdateInstance. + * @param request UpdateInstanceRequest message or plain object + * @returns Promise + */ + public updateInstance(request: google.spanner.admin.instance.v1.IUpdateInstanceRequest): Promise; + + /** + * Calls DeleteInstance. + * @param request DeleteInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteInstance(request: google.spanner.admin.instance.v1.IDeleteInstanceRequest, callback: google.spanner.admin.instance.v1.InstanceAdmin.DeleteInstanceCallback): void; + + /** + * Calls DeleteInstance. + * @param request DeleteInstanceRequest message or plain object + * @returns Promise + */ + public deleteInstance(request: google.spanner.admin.instance.v1.IDeleteInstanceRequest): Promise; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest, callback: google.spanner.admin.instance.v1.InstanceAdmin.SetIamPolicyCallback): void; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @returns Promise + */ + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest): Promise; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest, callback: google.spanner.admin.instance.v1.InstanceAdmin.GetIamPolicyCallback): void; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @returns Promise + */ + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest): Promise; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + */ + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest, callback: google.spanner.admin.instance.v1.InstanceAdmin.TestIamPermissionsCallback): void; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @returns Promise + */ + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest): Promise; + + /** + * Calls GetInstancePartition. + * @param request GetInstancePartitionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and InstancePartition + */ + public getInstancePartition(request: google.spanner.admin.instance.v1.IGetInstancePartitionRequest, callback: google.spanner.admin.instance.v1.InstanceAdmin.GetInstancePartitionCallback): void; + + /** + * Calls GetInstancePartition. + * @param request GetInstancePartitionRequest message or plain object + * @returns Promise + */ + public getInstancePartition(request: google.spanner.admin.instance.v1.IGetInstancePartitionRequest): Promise; + + /** + * Calls CreateInstancePartition. + * @param request CreateInstancePartitionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createInstancePartition(request: google.spanner.admin.instance.v1.ICreateInstancePartitionRequest, callback: google.spanner.admin.instance.v1.InstanceAdmin.CreateInstancePartitionCallback): void; + + /** + * Calls CreateInstancePartition. + * @param request CreateInstancePartitionRequest message or plain object + * @returns Promise + */ + public createInstancePartition(request: google.spanner.admin.instance.v1.ICreateInstancePartitionRequest): Promise; + + /** + * Calls DeleteInstancePartition. + * @param request DeleteInstancePartitionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteInstancePartition(request: google.spanner.admin.instance.v1.IDeleteInstancePartitionRequest, callback: google.spanner.admin.instance.v1.InstanceAdmin.DeleteInstancePartitionCallback): void; + + /** + * Calls DeleteInstancePartition. + * @param request DeleteInstancePartitionRequest message or plain object + * @returns Promise + */ + public deleteInstancePartition(request: google.spanner.admin.instance.v1.IDeleteInstancePartitionRequest): Promise; + + /** + * Calls UpdateInstancePartition. + * @param request UpdateInstancePartitionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateInstancePartition(request: google.spanner.admin.instance.v1.IUpdateInstancePartitionRequest, callback: google.spanner.admin.instance.v1.InstanceAdmin.UpdateInstancePartitionCallback): void; + + /** + * Calls UpdateInstancePartition. + * @param request UpdateInstancePartitionRequest message or plain object + * @returns Promise + */ + public updateInstancePartition(request: google.spanner.admin.instance.v1.IUpdateInstancePartitionRequest): Promise; + + /** + * Calls ListInstancePartitionOperations. + * @param request ListInstancePartitionOperationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListInstancePartitionOperationsResponse + */ + public listInstancePartitionOperations(request: google.spanner.admin.instance.v1.IListInstancePartitionOperationsRequest, callback: google.spanner.admin.instance.v1.InstanceAdmin.ListInstancePartitionOperationsCallback): void; + + /** + * Calls ListInstancePartitionOperations. + * @param request ListInstancePartitionOperationsRequest message or plain object + * @returns Promise + */ + public listInstancePartitionOperations(request: google.spanner.admin.instance.v1.IListInstancePartitionOperationsRequest): Promise; + + /** + * Calls MoveInstance. + * @param request MoveInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public moveInstance(request: google.spanner.admin.instance.v1.IMoveInstanceRequest, callback: google.spanner.admin.instance.v1.InstanceAdmin.MoveInstanceCallback): void; + + /** + * Calls MoveInstance. + * @param request MoveInstanceRequest message or plain object + * @returns Promise + */ + public moveInstance(request: google.spanner.admin.instance.v1.IMoveInstanceRequest): Promise; + } + + namespace InstanceAdmin { + + /** + * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|listInstanceConfigs}. + * @param error Error, if any + * @param [response] ListInstanceConfigsResponse + */ + type ListInstanceConfigsCallback = (error: (Error|null), response?: google.spanner.admin.instance.v1.ListInstanceConfigsResponse) => void; + + /** + * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|getInstanceConfig}. + * @param error Error, if any + * @param [response] InstanceConfig + */ + type GetInstanceConfigCallback = (error: (Error|null), response?: google.spanner.admin.instance.v1.InstanceConfig) => void; + + /** + * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|createInstanceConfig}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateInstanceConfigCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|updateInstanceConfig}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateInstanceConfigCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|deleteInstanceConfig}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteInstanceConfigCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|listInstanceConfigOperations}. + * @param error Error, if any + * @param [response] ListInstanceConfigOperationsResponse + */ + type ListInstanceConfigOperationsCallback = (error: (Error|null), response?: google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse) => void; + + /** + * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|listInstances}. + * @param error Error, if any + * @param [response] ListInstancesResponse + */ + type ListInstancesCallback = (error: (Error|null), response?: google.spanner.admin.instance.v1.ListInstancesResponse) => void; + + /** + * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|listInstancePartitions}. + * @param error Error, if any + * @param [response] ListInstancePartitionsResponse + */ + type ListInstancePartitionsCallback = (error: (Error|null), response?: google.spanner.admin.instance.v1.ListInstancePartitionsResponse) => void; + + /** + * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|getInstance}. + * @param error Error, if any + * @param [response] Instance + */ + type GetInstanceCallback = (error: (Error|null), response?: google.spanner.admin.instance.v1.Instance) => void; + + /** + * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|createInstance}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|updateInstance}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|deleteInstance}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteInstanceCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|setIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type SetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + + /** + * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|getIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type GetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + + /** + * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|testIamPermissions}. + * @param error Error, if any + * @param [response] TestIamPermissionsResponse + */ + type TestIamPermissionsCallback = (error: (Error|null), response?: google.iam.v1.TestIamPermissionsResponse) => void; + + /** + * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|getInstancePartition}. + * @param error Error, if any + * @param [response] InstancePartition + */ + type GetInstancePartitionCallback = (error: (Error|null), response?: google.spanner.admin.instance.v1.InstancePartition) => void; + + /** + * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|createInstancePartition}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateInstancePartitionCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|deleteInstancePartition}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteInstancePartitionCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|updateInstancePartition}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateInstancePartitionCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|listInstancePartitionOperations}. + * @param error Error, if any + * @param [response] ListInstancePartitionOperationsResponse + */ + type ListInstancePartitionOperationsCallback = (error: (Error|null), response?: google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse) => void; + + /** + * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|moveInstance}. + * @param error Error, if any + * @param [response] Operation + */ + type MoveInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of a ReplicaInfo. */ + interface IReplicaInfo { + + /** ReplicaInfo location */ + location?: (string|null); + + /** ReplicaInfo type */ + type?: (google.spanner.admin.instance.v1.ReplicaInfo.ReplicaType|keyof typeof google.spanner.admin.instance.v1.ReplicaInfo.ReplicaType|null); + + /** ReplicaInfo defaultLeaderLocation */ + defaultLeaderLocation?: (boolean|null); + } + + /** Represents a ReplicaInfo. */ + class ReplicaInfo implements IReplicaInfo { + + /** + * Constructs a new ReplicaInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.instance.v1.IReplicaInfo); + + /** ReplicaInfo location. */ + public location: string; + + /** ReplicaInfo type. */ + public type: (google.spanner.admin.instance.v1.ReplicaInfo.ReplicaType|keyof typeof google.spanner.admin.instance.v1.ReplicaInfo.ReplicaType); + + /** ReplicaInfo defaultLeaderLocation. */ + public defaultLeaderLocation: boolean; + + /** + * Creates a new ReplicaInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns ReplicaInfo instance + */ + public static create(properties?: google.spanner.admin.instance.v1.IReplicaInfo): google.spanner.admin.instance.v1.ReplicaInfo; + + /** + * Encodes the specified ReplicaInfo message. Does not implicitly {@link google.spanner.admin.instance.v1.ReplicaInfo.verify|verify} messages. + * @param message ReplicaInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.instance.v1.IReplicaInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReplicaInfo message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ReplicaInfo.verify|verify} messages. + * @param message ReplicaInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.instance.v1.IReplicaInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReplicaInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReplicaInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.ReplicaInfo; + + /** + * Decodes a ReplicaInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReplicaInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.ReplicaInfo; + + /** + * Verifies a ReplicaInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReplicaInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReplicaInfo + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.ReplicaInfo; + + /** + * Creates a plain object from a ReplicaInfo message. Also converts values to other types if specified. + * @param message ReplicaInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.instance.v1.ReplicaInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReplicaInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReplicaInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ReplicaInfo { + + /** ReplicaType enum. */ + enum ReplicaType { + TYPE_UNSPECIFIED = 0, + READ_WRITE = 1, + READ_ONLY = 2, + WITNESS = 3 + } + } + + /** Properties of an InstanceConfig. */ + interface IInstanceConfig { + + /** InstanceConfig name */ + name?: (string|null); + + /** InstanceConfig displayName */ + displayName?: (string|null); + + /** InstanceConfig configType */ + configType?: (google.spanner.admin.instance.v1.InstanceConfig.Type|keyof typeof google.spanner.admin.instance.v1.InstanceConfig.Type|null); + + /** InstanceConfig replicas */ + replicas?: (google.spanner.admin.instance.v1.IReplicaInfo[]|null); + + /** InstanceConfig optionalReplicas */ + optionalReplicas?: (google.spanner.admin.instance.v1.IReplicaInfo[]|null); + + /** InstanceConfig baseConfig */ + baseConfig?: (string|null); + + /** InstanceConfig labels */ + labels?: ({ [k: string]: string }|null); + + /** InstanceConfig etag */ + etag?: (string|null); + + /** InstanceConfig leaderOptions */ + leaderOptions?: (string[]|null); + + /** InstanceConfig reconciling */ + reconciling?: (boolean|null); + + /** InstanceConfig state */ + state?: (google.spanner.admin.instance.v1.InstanceConfig.State|keyof typeof google.spanner.admin.instance.v1.InstanceConfig.State|null); + + /** InstanceConfig freeInstanceAvailability */ + freeInstanceAvailability?: (google.spanner.admin.instance.v1.InstanceConfig.FreeInstanceAvailability|keyof typeof google.spanner.admin.instance.v1.InstanceConfig.FreeInstanceAvailability|null); + + /** InstanceConfig quorumType */ + quorumType?: (google.spanner.admin.instance.v1.InstanceConfig.QuorumType|keyof typeof google.spanner.admin.instance.v1.InstanceConfig.QuorumType|null); + + /** InstanceConfig storageLimitPerProcessingUnit */ + storageLimitPerProcessingUnit?: (number|Long|string|null); + } + + /** Represents an InstanceConfig. */ + class InstanceConfig implements IInstanceConfig { + + /** + * Constructs a new InstanceConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.instance.v1.IInstanceConfig); + + /** InstanceConfig name. */ + public name: string; + + /** InstanceConfig displayName. */ + public displayName: string; + + /** InstanceConfig configType. */ + public configType: (google.spanner.admin.instance.v1.InstanceConfig.Type|keyof typeof google.spanner.admin.instance.v1.InstanceConfig.Type); + + /** InstanceConfig replicas. */ + public replicas: google.spanner.admin.instance.v1.IReplicaInfo[]; + + /** InstanceConfig optionalReplicas. */ + public optionalReplicas: google.spanner.admin.instance.v1.IReplicaInfo[]; + + /** InstanceConfig baseConfig. */ + public baseConfig: string; + + /** InstanceConfig labels. */ + public labels: { [k: string]: string }; + + /** InstanceConfig etag. */ + public etag: string; + + /** InstanceConfig leaderOptions. */ + public leaderOptions: string[]; + + /** InstanceConfig reconciling. */ + public reconciling: boolean; + + /** InstanceConfig state. */ + public state: (google.spanner.admin.instance.v1.InstanceConfig.State|keyof typeof google.spanner.admin.instance.v1.InstanceConfig.State); + + /** InstanceConfig freeInstanceAvailability. */ + public freeInstanceAvailability: (google.spanner.admin.instance.v1.InstanceConfig.FreeInstanceAvailability|keyof typeof google.spanner.admin.instance.v1.InstanceConfig.FreeInstanceAvailability); + + /** InstanceConfig quorumType. */ + public quorumType: (google.spanner.admin.instance.v1.InstanceConfig.QuorumType|keyof typeof google.spanner.admin.instance.v1.InstanceConfig.QuorumType); + + /** InstanceConfig storageLimitPerProcessingUnit. */ + public storageLimitPerProcessingUnit: (number|Long|string); + + /** + * Creates a new InstanceConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns InstanceConfig instance + */ + public static create(properties?: google.spanner.admin.instance.v1.IInstanceConfig): google.spanner.admin.instance.v1.InstanceConfig; + + /** + * Encodes the specified InstanceConfig message. Does not implicitly {@link google.spanner.admin.instance.v1.InstanceConfig.verify|verify} messages. + * @param message InstanceConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.instance.v1.IInstanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstanceConfig message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.InstanceConfig.verify|verify} messages. + * @param message InstanceConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.instance.v1.IInstanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstanceConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.InstanceConfig; + + /** + * Decodes an InstanceConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.InstanceConfig; + + /** + * Verifies an InstanceConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstanceConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstanceConfig + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.InstanceConfig; + + /** + * Creates a plain object from an InstanceConfig message. Also converts values to other types if specified. + * @param message InstanceConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.instance.v1.InstanceConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstanceConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InstanceConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace InstanceConfig { + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + GOOGLE_MANAGED = 1, + USER_MANAGED = 2 + } + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + CREATING = 1, + READY = 2 + } + + /** FreeInstanceAvailability enum. */ + enum FreeInstanceAvailability { + FREE_INSTANCE_AVAILABILITY_UNSPECIFIED = 0, + AVAILABLE = 1, + UNSUPPORTED = 2, + DISABLED = 3, + QUOTA_EXCEEDED = 4 + } + + /** QuorumType enum. */ + enum QuorumType { + QUORUM_TYPE_UNSPECIFIED = 0, + REGION = 1, + DUAL_REGION = 2, + MULTI_REGION = 3 + } + } + + /** Properties of a ReplicaComputeCapacity. */ + interface IReplicaComputeCapacity { + + /** ReplicaComputeCapacity replicaSelection */ + replicaSelection?: (google.spanner.admin.instance.v1.IReplicaSelection|null); + + /** ReplicaComputeCapacity nodeCount */ + nodeCount?: (number|null); + + /** ReplicaComputeCapacity processingUnits */ + processingUnits?: (number|null); + } + + /** Represents a ReplicaComputeCapacity. */ + class ReplicaComputeCapacity implements IReplicaComputeCapacity { + + /** + * Constructs a new ReplicaComputeCapacity. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.instance.v1.IReplicaComputeCapacity); + + /** ReplicaComputeCapacity replicaSelection. */ + public replicaSelection?: (google.spanner.admin.instance.v1.IReplicaSelection|null); + + /** ReplicaComputeCapacity nodeCount. */ + public nodeCount?: (number|null); + + /** ReplicaComputeCapacity processingUnits. */ + public processingUnits?: (number|null); + + /** ReplicaComputeCapacity computeCapacity. */ + public computeCapacity?: ("nodeCount"|"processingUnits"); + + /** + * Creates a new ReplicaComputeCapacity instance using the specified properties. + * @param [properties] Properties to set + * @returns ReplicaComputeCapacity instance + */ + public static create(properties?: google.spanner.admin.instance.v1.IReplicaComputeCapacity): google.spanner.admin.instance.v1.ReplicaComputeCapacity; + + /** + * Encodes the specified ReplicaComputeCapacity message. Does not implicitly {@link google.spanner.admin.instance.v1.ReplicaComputeCapacity.verify|verify} messages. + * @param message ReplicaComputeCapacity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.instance.v1.IReplicaComputeCapacity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReplicaComputeCapacity message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ReplicaComputeCapacity.verify|verify} messages. + * @param message ReplicaComputeCapacity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.instance.v1.IReplicaComputeCapacity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReplicaComputeCapacity message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReplicaComputeCapacity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.ReplicaComputeCapacity; + + /** + * Decodes a ReplicaComputeCapacity message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReplicaComputeCapacity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.ReplicaComputeCapacity; + + /** + * Verifies a ReplicaComputeCapacity message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReplicaComputeCapacity message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReplicaComputeCapacity + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.ReplicaComputeCapacity; + + /** + * Creates a plain object from a ReplicaComputeCapacity message. Also converts values to other types if specified. + * @param message ReplicaComputeCapacity + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.instance.v1.ReplicaComputeCapacity, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReplicaComputeCapacity to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReplicaComputeCapacity + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AutoscalingConfig. */ + interface IAutoscalingConfig { + + /** AutoscalingConfig autoscalingLimits */ + autoscalingLimits?: (google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingLimits|null); + + /** AutoscalingConfig autoscalingTargets */ + autoscalingTargets?: (google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingTargets|null); + + /** AutoscalingConfig asymmetricAutoscalingOptions */ + asymmetricAutoscalingOptions?: (google.spanner.admin.instance.v1.AutoscalingConfig.IAsymmetricAutoscalingOption[]|null); + } + + /** Represents an AutoscalingConfig. */ + class AutoscalingConfig implements IAutoscalingConfig { + + /** + * Constructs a new AutoscalingConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.instance.v1.IAutoscalingConfig); + + /** AutoscalingConfig autoscalingLimits. */ + public autoscalingLimits?: (google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingLimits|null); + + /** AutoscalingConfig autoscalingTargets. */ + public autoscalingTargets?: (google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingTargets|null); + + /** AutoscalingConfig asymmetricAutoscalingOptions. */ + public asymmetricAutoscalingOptions: google.spanner.admin.instance.v1.AutoscalingConfig.IAsymmetricAutoscalingOption[]; + + /** + * Creates a new AutoscalingConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AutoscalingConfig instance + */ + public static create(properties?: google.spanner.admin.instance.v1.IAutoscalingConfig): google.spanner.admin.instance.v1.AutoscalingConfig; + + /** + * Encodes the specified AutoscalingConfig message. Does not implicitly {@link google.spanner.admin.instance.v1.AutoscalingConfig.verify|verify} messages. + * @param message AutoscalingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.instance.v1.IAutoscalingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AutoscalingConfig message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.AutoscalingConfig.verify|verify} messages. + * @param message AutoscalingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.instance.v1.IAutoscalingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AutoscalingConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AutoscalingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.AutoscalingConfig; + + /** + * Decodes an AutoscalingConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AutoscalingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.AutoscalingConfig; + + /** + * Verifies an AutoscalingConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AutoscalingConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AutoscalingConfig + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.AutoscalingConfig; + + /** + * Creates a plain object from an AutoscalingConfig message. Also converts values to other types if specified. + * @param message AutoscalingConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.instance.v1.AutoscalingConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AutoscalingConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AutoscalingConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AutoscalingConfig { + + /** Properties of an AutoscalingLimits. */ + interface IAutoscalingLimits { + + /** AutoscalingLimits minNodes */ + minNodes?: (number|null); + + /** AutoscalingLimits minProcessingUnits */ + minProcessingUnits?: (number|null); + + /** AutoscalingLimits maxNodes */ + maxNodes?: (number|null); + + /** AutoscalingLimits maxProcessingUnits */ + maxProcessingUnits?: (number|null); + } + + /** Represents an AutoscalingLimits. */ + class AutoscalingLimits implements IAutoscalingLimits { + + /** + * Constructs a new AutoscalingLimits. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingLimits); + + /** AutoscalingLimits minNodes. */ + public minNodes?: (number|null); + + /** AutoscalingLimits minProcessingUnits. */ + public minProcessingUnits?: (number|null); + + /** AutoscalingLimits maxNodes. */ + public maxNodes?: (number|null); + + /** AutoscalingLimits maxProcessingUnits. */ + public maxProcessingUnits?: (number|null); + + /** AutoscalingLimits minLimit. */ + public minLimit?: ("minNodes"|"minProcessingUnits"); + + /** AutoscalingLimits maxLimit. */ + public maxLimit?: ("maxNodes"|"maxProcessingUnits"); + + /** + * Creates a new AutoscalingLimits instance using the specified properties. + * @param [properties] Properties to set + * @returns AutoscalingLimits instance + */ + public static create(properties?: google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingLimits): google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits; + + /** + * Encodes the specified AutoscalingLimits message. Does not implicitly {@link google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits.verify|verify} messages. + * @param message AutoscalingLimits message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingLimits, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AutoscalingLimits message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits.verify|verify} messages. + * @param message AutoscalingLimits message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingLimits, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AutoscalingLimits message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AutoscalingLimits + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits; + + /** + * Decodes an AutoscalingLimits message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AutoscalingLimits + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits; + + /** + * Verifies an AutoscalingLimits message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AutoscalingLimits message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AutoscalingLimits + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits; + + /** + * Creates a plain object from an AutoscalingLimits message. Also converts values to other types if specified. + * @param message AutoscalingLimits + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AutoscalingLimits to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AutoscalingLimits + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AutoscalingTargets. */ + interface IAutoscalingTargets { + + /** AutoscalingTargets highPriorityCpuUtilizationPercent */ + highPriorityCpuUtilizationPercent?: (number|null); + + /** AutoscalingTargets totalCpuUtilizationPercent */ + totalCpuUtilizationPercent?: (number|null); + + /** AutoscalingTargets storageUtilizationPercent */ + storageUtilizationPercent?: (number|null); + } + + /** Represents an AutoscalingTargets. */ + class AutoscalingTargets implements IAutoscalingTargets { + + /** + * Constructs a new AutoscalingTargets. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingTargets); + + /** AutoscalingTargets highPriorityCpuUtilizationPercent. */ + public highPriorityCpuUtilizationPercent: number; + + /** AutoscalingTargets totalCpuUtilizationPercent. */ + public totalCpuUtilizationPercent: number; + + /** AutoscalingTargets storageUtilizationPercent. */ + public storageUtilizationPercent: number; + + /** + * Creates a new AutoscalingTargets instance using the specified properties. + * @param [properties] Properties to set + * @returns AutoscalingTargets instance + */ + public static create(properties?: google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingTargets): google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets; + + /** + * Encodes the specified AutoscalingTargets message. Does not implicitly {@link google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets.verify|verify} messages. + * @param message AutoscalingTargets message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingTargets, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AutoscalingTargets message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets.verify|verify} messages. + * @param message AutoscalingTargets message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingTargets, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AutoscalingTargets message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AutoscalingTargets + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets; + + /** + * Decodes an AutoscalingTargets message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AutoscalingTargets + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets; + + /** + * Verifies an AutoscalingTargets message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AutoscalingTargets message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AutoscalingTargets + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets; + + /** + * Creates a plain object from an AutoscalingTargets message. Also converts values to other types if specified. + * @param message AutoscalingTargets + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AutoscalingTargets to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AutoscalingTargets + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AsymmetricAutoscalingOption. */ + interface IAsymmetricAutoscalingOption { + + /** AsymmetricAutoscalingOption replicaSelection */ + replicaSelection?: (google.spanner.admin.instance.v1.IReplicaSelection|null); + + /** AsymmetricAutoscalingOption overrides */ + overrides?: (google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.IAutoscalingConfigOverrides|null); + } + + /** Represents an AsymmetricAutoscalingOption. */ + class AsymmetricAutoscalingOption implements IAsymmetricAutoscalingOption { + + /** + * Constructs a new AsymmetricAutoscalingOption. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.instance.v1.AutoscalingConfig.IAsymmetricAutoscalingOption); + + /** AsymmetricAutoscalingOption replicaSelection. */ + public replicaSelection?: (google.spanner.admin.instance.v1.IReplicaSelection|null); + + /** AsymmetricAutoscalingOption overrides. */ + public overrides?: (google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.IAutoscalingConfigOverrides|null); + + /** + * Creates a new AsymmetricAutoscalingOption instance using the specified properties. + * @param [properties] Properties to set + * @returns AsymmetricAutoscalingOption instance + */ + public static create(properties?: google.spanner.admin.instance.v1.AutoscalingConfig.IAsymmetricAutoscalingOption): google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption; + + /** + * Encodes the specified AsymmetricAutoscalingOption message. Does not implicitly {@link google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.verify|verify} messages. + * @param message AsymmetricAutoscalingOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.instance.v1.AutoscalingConfig.IAsymmetricAutoscalingOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AsymmetricAutoscalingOption message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.verify|verify} messages. + * @param message AsymmetricAutoscalingOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.instance.v1.AutoscalingConfig.IAsymmetricAutoscalingOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AsymmetricAutoscalingOption message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AsymmetricAutoscalingOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption; + + /** + * Decodes an AsymmetricAutoscalingOption message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AsymmetricAutoscalingOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption; + + /** + * Verifies an AsymmetricAutoscalingOption message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AsymmetricAutoscalingOption message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AsymmetricAutoscalingOption + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption; + + /** + * Creates a plain object from an AsymmetricAutoscalingOption message. Also converts values to other types if specified. + * @param message AsymmetricAutoscalingOption + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AsymmetricAutoscalingOption to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AsymmetricAutoscalingOption + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AsymmetricAutoscalingOption { + + /** Properties of an AutoscalingConfigOverrides. */ + interface IAutoscalingConfigOverrides { + + /** AutoscalingConfigOverrides autoscalingLimits */ + autoscalingLimits?: (google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingLimits|null); + + /** AutoscalingConfigOverrides autoscalingTargetHighPriorityCpuUtilizationPercent */ + autoscalingTargetHighPriorityCpuUtilizationPercent?: (number|null); + + /** AutoscalingConfigOverrides autoscalingTargetTotalCpuUtilizationPercent */ + autoscalingTargetTotalCpuUtilizationPercent?: (number|null); + + /** AutoscalingConfigOverrides disableHighPriorityCpuAutoscaling */ + disableHighPriorityCpuAutoscaling?: (boolean|null); + + /** AutoscalingConfigOverrides disableTotalCpuAutoscaling */ + disableTotalCpuAutoscaling?: (boolean|null); + } + + /** Represents an AutoscalingConfigOverrides. */ + class AutoscalingConfigOverrides implements IAutoscalingConfigOverrides { + + /** + * Constructs a new AutoscalingConfigOverrides. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.IAutoscalingConfigOverrides); + + /** AutoscalingConfigOverrides autoscalingLimits. */ + public autoscalingLimits?: (google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingLimits|null); + + /** AutoscalingConfigOverrides autoscalingTargetHighPriorityCpuUtilizationPercent. */ + public autoscalingTargetHighPriorityCpuUtilizationPercent: number; + + /** AutoscalingConfigOverrides autoscalingTargetTotalCpuUtilizationPercent. */ + public autoscalingTargetTotalCpuUtilizationPercent: number; + + /** AutoscalingConfigOverrides disableHighPriorityCpuAutoscaling. */ + public disableHighPriorityCpuAutoscaling: boolean; + + /** AutoscalingConfigOverrides disableTotalCpuAutoscaling. */ + public disableTotalCpuAutoscaling: boolean; + + /** + * Creates a new AutoscalingConfigOverrides instance using the specified properties. + * @param [properties] Properties to set + * @returns AutoscalingConfigOverrides instance + */ + public static create(properties?: google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.IAutoscalingConfigOverrides): google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides; + + /** + * Encodes the specified AutoscalingConfigOverrides message. Does not implicitly {@link google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides.verify|verify} messages. + * @param message AutoscalingConfigOverrides message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.IAutoscalingConfigOverrides, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AutoscalingConfigOverrides message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides.verify|verify} messages. + * @param message AutoscalingConfigOverrides message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.IAutoscalingConfigOverrides, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AutoscalingConfigOverrides message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AutoscalingConfigOverrides + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides; + + /** + * Decodes an AutoscalingConfigOverrides message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AutoscalingConfigOverrides + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides; + + /** + * Verifies an AutoscalingConfigOverrides message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AutoscalingConfigOverrides message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AutoscalingConfigOverrides + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides; + + /** + * Creates a plain object from an AutoscalingConfigOverrides message. Also converts values to other types if specified. + * @param message AutoscalingConfigOverrides + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AutoscalingConfigOverrides to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AutoscalingConfigOverrides + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Properties of an Instance. */ + interface IInstance { + + /** Instance name */ + name?: (string|null); + + /** Instance config */ + config?: (string|null); + + /** Instance displayName */ + displayName?: (string|null); + + /** Instance nodeCount */ + nodeCount?: (number|null); + + /** Instance processingUnits */ + processingUnits?: (number|null); + + /** Instance replicaComputeCapacity */ + replicaComputeCapacity?: (google.spanner.admin.instance.v1.IReplicaComputeCapacity[]|null); + + /** Instance autoscalingConfig */ + autoscalingConfig?: (google.spanner.admin.instance.v1.IAutoscalingConfig|null); + + /** Instance state */ + state?: (google.spanner.admin.instance.v1.Instance.State|keyof typeof google.spanner.admin.instance.v1.Instance.State|null); + + /** Instance labels */ + labels?: ({ [k: string]: string }|null); + + /** Instance instanceType */ + instanceType?: (google.spanner.admin.instance.v1.Instance.InstanceType|keyof typeof google.spanner.admin.instance.v1.Instance.InstanceType|null); + + /** Instance endpointUris */ + endpointUris?: (string[]|null); + + /** Instance createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Instance updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Instance freeInstanceMetadata */ + freeInstanceMetadata?: (google.spanner.admin.instance.v1.IFreeInstanceMetadata|null); + + /** Instance edition */ + edition?: (google.spanner.admin.instance.v1.Instance.Edition|keyof typeof google.spanner.admin.instance.v1.Instance.Edition|null); + + /** Instance defaultBackupScheduleType */ + defaultBackupScheduleType?: (google.spanner.admin.instance.v1.Instance.DefaultBackupScheduleType|keyof typeof google.spanner.admin.instance.v1.Instance.DefaultBackupScheduleType|null); + } + + /** Represents an Instance. */ + class Instance implements IInstance { + + /** + * Constructs a new Instance. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.instance.v1.IInstance); + + /** Instance name. */ + public name: string; + + /** Instance config. */ + public config: string; + + /** Instance displayName. */ + public displayName: string; + + /** Instance nodeCount. */ + public nodeCount: number; + + /** Instance processingUnits. */ + public processingUnits: number; + + /** Instance replicaComputeCapacity. */ + public replicaComputeCapacity: google.spanner.admin.instance.v1.IReplicaComputeCapacity[]; + + /** Instance autoscalingConfig. */ + public autoscalingConfig?: (google.spanner.admin.instance.v1.IAutoscalingConfig|null); + + /** Instance state. */ + public state: (google.spanner.admin.instance.v1.Instance.State|keyof typeof google.spanner.admin.instance.v1.Instance.State); + + /** Instance labels. */ + public labels: { [k: string]: string }; + + /** Instance instanceType. */ + public instanceType: (google.spanner.admin.instance.v1.Instance.InstanceType|keyof typeof google.spanner.admin.instance.v1.Instance.InstanceType); + + /** Instance endpointUris. */ + public endpointUris: string[]; + + /** Instance createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Instance updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Instance freeInstanceMetadata. */ + public freeInstanceMetadata?: (google.spanner.admin.instance.v1.IFreeInstanceMetadata|null); + + /** Instance edition. */ + public edition: (google.spanner.admin.instance.v1.Instance.Edition|keyof typeof google.spanner.admin.instance.v1.Instance.Edition); + + /** Instance defaultBackupScheduleType. */ + public defaultBackupScheduleType: (google.spanner.admin.instance.v1.Instance.DefaultBackupScheduleType|keyof typeof google.spanner.admin.instance.v1.Instance.DefaultBackupScheduleType); + + /** + * Creates a new Instance instance using the specified properties. + * @param [properties] Properties to set + * @returns Instance instance + */ + public static create(properties?: google.spanner.admin.instance.v1.IInstance): google.spanner.admin.instance.v1.Instance; + + /** + * Encodes the specified Instance message. Does not implicitly {@link google.spanner.admin.instance.v1.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.spanner.admin.instance.v1.IInstance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Instance message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.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.spanner.admin.instance.v1.IInstance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Instance message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Instance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.Instance; + + /** + * Decodes an Instance message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Instance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.Instance; + + /** + * Verifies an Instance message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Instance message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Instance + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.Instance; + + /** + * Creates a plain object from an Instance message. Also converts values to other types if specified. + * @param message Instance + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.instance.v1.Instance, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Instance to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Instance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Instance { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + CREATING = 1, + READY = 2 + } + + /** InstanceType enum. */ + enum InstanceType { + INSTANCE_TYPE_UNSPECIFIED = 0, + PROVISIONED = 1, + FREE_INSTANCE = 2 + } + + /** Edition enum. */ + enum Edition { + EDITION_UNSPECIFIED = 0, + STANDARD = 1, + ENTERPRISE = 2, + ENTERPRISE_PLUS = 3 + } + + /** DefaultBackupScheduleType enum. */ + enum DefaultBackupScheduleType { + DEFAULT_BACKUP_SCHEDULE_TYPE_UNSPECIFIED = 0, + NONE = 1, + AUTOMATIC = 2 + } + } + + /** Properties of a ListInstanceConfigsRequest. */ + interface IListInstanceConfigsRequest { + + /** ListInstanceConfigsRequest parent */ + parent?: (string|null); + + /** ListInstanceConfigsRequest pageSize */ + pageSize?: (number|null); + + /** ListInstanceConfigsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListInstanceConfigsRequest. */ + class ListInstanceConfigsRequest implements IListInstanceConfigsRequest { + + /** + * Constructs a new ListInstanceConfigsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.instance.v1.IListInstanceConfigsRequest); + + /** ListInstanceConfigsRequest parent. */ + public parent: string; + + /** ListInstanceConfigsRequest pageSize. */ + public pageSize: number; + + /** ListInstanceConfigsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListInstanceConfigsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInstanceConfigsRequest instance + */ + public static create(properties?: google.spanner.admin.instance.v1.IListInstanceConfigsRequest): google.spanner.admin.instance.v1.ListInstanceConfigsRequest; + + /** + * Encodes the specified ListInstanceConfigsRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstanceConfigsRequest.verify|verify} messages. + * @param message ListInstanceConfigsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.instance.v1.IListInstanceConfigsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInstanceConfigsRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstanceConfigsRequest.verify|verify} messages. + * @param message ListInstanceConfigsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.instance.v1.IListInstanceConfigsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListInstanceConfigsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListInstanceConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.ListInstanceConfigsRequest; + + /** + * Decodes a ListInstanceConfigsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListInstanceConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.ListInstanceConfigsRequest; + + /** + * Verifies a ListInstanceConfigsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListInstanceConfigsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListInstanceConfigsRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.ListInstanceConfigsRequest; + + /** + * Creates a plain object from a ListInstanceConfigsRequest message. Also converts values to other types if specified. + * @param message ListInstanceConfigsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.instance.v1.ListInstanceConfigsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListInstanceConfigsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListInstanceConfigsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListInstanceConfigsResponse. */ + interface IListInstanceConfigsResponse { + + /** ListInstanceConfigsResponse instanceConfigs */ + instanceConfigs?: (google.spanner.admin.instance.v1.IInstanceConfig[]|null); + + /** ListInstanceConfigsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListInstanceConfigsResponse. */ + class ListInstanceConfigsResponse implements IListInstanceConfigsResponse { + + /** + * Constructs a new ListInstanceConfigsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.instance.v1.IListInstanceConfigsResponse); + + /** ListInstanceConfigsResponse instanceConfigs. */ + public instanceConfigs: google.spanner.admin.instance.v1.IInstanceConfig[]; + + /** ListInstanceConfigsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListInstanceConfigsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInstanceConfigsResponse instance + */ + public static create(properties?: google.spanner.admin.instance.v1.IListInstanceConfigsResponse): google.spanner.admin.instance.v1.ListInstanceConfigsResponse; + + /** + * Encodes the specified ListInstanceConfigsResponse message. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstanceConfigsResponse.verify|verify} messages. + * @param message ListInstanceConfigsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.instance.v1.IListInstanceConfigsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInstanceConfigsResponse message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstanceConfigsResponse.verify|verify} messages. + * @param message ListInstanceConfigsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.instance.v1.IListInstanceConfigsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListInstanceConfigsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListInstanceConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.ListInstanceConfigsResponse; + + /** + * Decodes a ListInstanceConfigsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListInstanceConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.ListInstanceConfigsResponse; + + /** + * Verifies a ListInstanceConfigsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListInstanceConfigsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListInstanceConfigsResponse + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.ListInstanceConfigsResponse; + + /** + * Creates a plain object from a ListInstanceConfigsResponse message. Also converts values to other types if specified. + * @param message ListInstanceConfigsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.instance.v1.ListInstanceConfigsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListInstanceConfigsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListInstanceConfigsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetInstanceConfigRequest. */ + interface IGetInstanceConfigRequest { + + /** GetInstanceConfigRequest name */ + name?: (string|null); + } + + /** Represents a GetInstanceConfigRequest. */ + class GetInstanceConfigRequest implements IGetInstanceConfigRequest { + + /** + * Constructs a new GetInstanceConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.instance.v1.IGetInstanceConfigRequest); + + /** GetInstanceConfigRequest name. */ + public name: string; + + /** + * Creates a new GetInstanceConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetInstanceConfigRequest instance + */ + public static create(properties?: google.spanner.admin.instance.v1.IGetInstanceConfigRequest): google.spanner.admin.instance.v1.GetInstanceConfigRequest; + + /** + * Encodes the specified GetInstanceConfigRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.GetInstanceConfigRequest.verify|verify} messages. + * @param message GetInstanceConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.instance.v1.IGetInstanceConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetInstanceConfigRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.GetInstanceConfigRequest.verify|verify} messages. + * @param message GetInstanceConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.instance.v1.IGetInstanceConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetInstanceConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetInstanceConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.GetInstanceConfigRequest; + + /** + * Decodes a GetInstanceConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetInstanceConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.GetInstanceConfigRequest; + + /** + * Verifies a GetInstanceConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetInstanceConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetInstanceConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.GetInstanceConfigRequest; + + /** + * Creates a plain object from a GetInstanceConfigRequest message. Also converts values to other types if specified. + * @param message GetInstanceConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.instance.v1.GetInstanceConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetInstanceConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetInstanceConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateInstanceConfigRequest. */ + interface ICreateInstanceConfigRequest { + + /** CreateInstanceConfigRequest parent */ + parent?: (string|null); + + /** CreateInstanceConfigRequest instanceConfigId */ + instanceConfigId?: (string|null); + + /** CreateInstanceConfigRequest instanceConfig */ + instanceConfig?: (google.spanner.admin.instance.v1.IInstanceConfig|null); + + /** CreateInstanceConfigRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents a CreateInstanceConfigRequest. */ + class CreateInstanceConfigRequest implements ICreateInstanceConfigRequest { + + /** + * Constructs a new CreateInstanceConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.instance.v1.ICreateInstanceConfigRequest); + + /** CreateInstanceConfigRequest parent. */ + public parent: string; + + /** CreateInstanceConfigRequest instanceConfigId. */ + public instanceConfigId: string; + + /** CreateInstanceConfigRequest instanceConfig. */ + public instanceConfig?: (google.spanner.admin.instance.v1.IInstanceConfig|null); + + /** CreateInstanceConfigRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new CreateInstanceConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateInstanceConfigRequest instance + */ + public static create(properties?: google.spanner.admin.instance.v1.ICreateInstanceConfigRequest): google.spanner.admin.instance.v1.CreateInstanceConfigRequest; + + /** + * Encodes the specified CreateInstanceConfigRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.CreateInstanceConfigRequest.verify|verify} messages. + * @param message CreateInstanceConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.instance.v1.ICreateInstanceConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateInstanceConfigRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.CreateInstanceConfigRequest.verify|verify} messages. + * @param message CreateInstanceConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.instance.v1.ICreateInstanceConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateInstanceConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateInstanceConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.CreateInstanceConfigRequest; + + /** + * Decodes a CreateInstanceConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateInstanceConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.CreateInstanceConfigRequest; + + /** + * Verifies a CreateInstanceConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateInstanceConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateInstanceConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.CreateInstanceConfigRequest; + + /** + * Creates a plain object from a CreateInstanceConfigRequest message. Also converts values to other types if specified. + * @param message CreateInstanceConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.instance.v1.CreateInstanceConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateInstanceConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateInstanceConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateInstanceConfigRequest. */ + interface IUpdateInstanceConfigRequest { + + /** UpdateInstanceConfigRequest instanceConfig */ + instanceConfig?: (google.spanner.admin.instance.v1.IInstanceConfig|null); + + /** UpdateInstanceConfigRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateInstanceConfigRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents an UpdateInstanceConfigRequest. */ + class UpdateInstanceConfigRequest implements IUpdateInstanceConfigRequest { + + /** + * Constructs a new UpdateInstanceConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.instance.v1.IUpdateInstanceConfigRequest); + + /** UpdateInstanceConfigRequest instanceConfig. */ + public instanceConfig?: (google.spanner.admin.instance.v1.IInstanceConfig|null); + + /** UpdateInstanceConfigRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateInstanceConfigRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new UpdateInstanceConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateInstanceConfigRequest instance + */ + public static create(properties?: google.spanner.admin.instance.v1.IUpdateInstanceConfigRequest): google.spanner.admin.instance.v1.UpdateInstanceConfigRequest; + + /** + * Encodes the specified UpdateInstanceConfigRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.UpdateInstanceConfigRequest.verify|verify} messages. + * @param message UpdateInstanceConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.instance.v1.IUpdateInstanceConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateInstanceConfigRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.UpdateInstanceConfigRequest.verify|verify} messages. + * @param message UpdateInstanceConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.instance.v1.IUpdateInstanceConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateInstanceConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateInstanceConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.UpdateInstanceConfigRequest; + + /** + * Decodes an UpdateInstanceConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateInstanceConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.UpdateInstanceConfigRequest; + + /** + * Verifies an UpdateInstanceConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateInstanceConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateInstanceConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.UpdateInstanceConfigRequest; + + /** + * Creates a plain object from an UpdateInstanceConfigRequest message. Also converts values to other types if specified. + * @param message UpdateInstanceConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.instance.v1.UpdateInstanceConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateInstanceConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateInstanceConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteInstanceConfigRequest. */ + interface IDeleteInstanceConfigRequest { + + /** DeleteInstanceConfigRequest name */ + name?: (string|null); + + /** DeleteInstanceConfigRequest etag */ + etag?: (string|null); + + /** DeleteInstanceConfigRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents a DeleteInstanceConfigRequest. */ + class DeleteInstanceConfigRequest implements IDeleteInstanceConfigRequest { + + /** + * Constructs a new DeleteInstanceConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.instance.v1.IDeleteInstanceConfigRequest); + + /** DeleteInstanceConfigRequest name. */ + public name: string; + + /** DeleteInstanceConfigRequest etag. */ + public etag: string; + + /** DeleteInstanceConfigRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new DeleteInstanceConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteInstanceConfigRequest instance + */ + public static create(properties?: google.spanner.admin.instance.v1.IDeleteInstanceConfigRequest): google.spanner.admin.instance.v1.DeleteInstanceConfigRequest; + + /** + * Encodes the specified DeleteInstanceConfigRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.DeleteInstanceConfigRequest.verify|verify} messages. + * @param message DeleteInstanceConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.instance.v1.IDeleteInstanceConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteInstanceConfigRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.DeleteInstanceConfigRequest.verify|verify} messages. + * @param message DeleteInstanceConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.instance.v1.IDeleteInstanceConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteInstanceConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteInstanceConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.DeleteInstanceConfigRequest; + + /** + * Decodes a DeleteInstanceConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteInstanceConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.DeleteInstanceConfigRequest; + + /** + * Verifies a DeleteInstanceConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteInstanceConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteInstanceConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.DeleteInstanceConfigRequest; + + /** + * Creates a plain object from a DeleteInstanceConfigRequest message. Also converts values to other types if specified. + * @param message DeleteInstanceConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.instance.v1.DeleteInstanceConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteInstanceConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteInstanceConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListInstanceConfigOperationsRequest. */ + interface IListInstanceConfigOperationsRequest { + + /** ListInstanceConfigOperationsRequest parent */ + parent?: (string|null); + + /** ListInstanceConfigOperationsRequest filter */ + filter?: (string|null); + + /** ListInstanceConfigOperationsRequest pageSize */ + pageSize?: (number|null); + + /** ListInstanceConfigOperationsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListInstanceConfigOperationsRequest. */ + class ListInstanceConfigOperationsRequest implements IListInstanceConfigOperationsRequest { + + /** + * Constructs a new ListInstanceConfigOperationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.instance.v1.IListInstanceConfigOperationsRequest); + + /** ListInstanceConfigOperationsRequest parent. */ + public parent: string; + + /** ListInstanceConfigOperationsRequest filter. */ + public filter: string; + + /** ListInstanceConfigOperationsRequest pageSize. */ + public pageSize: number; + + /** ListInstanceConfigOperationsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListInstanceConfigOperationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInstanceConfigOperationsRequest instance + */ + public static create(properties?: google.spanner.admin.instance.v1.IListInstanceConfigOperationsRequest): google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest; + + /** + * Encodes the specified ListInstanceConfigOperationsRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest.verify|verify} messages. + * @param message ListInstanceConfigOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.instance.v1.IListInstanceConfigOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInstanceConfigOperationsRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest.verify|verify} messages. + * @param message ListInstanceConfigOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.instance.v1.IListInstanceConfigOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListInstanceConfigOperationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListInstanceConfigOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest; + + /** + * Decodes a ListInstanceConfigOperationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListInstanceConfigOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest; + + /** + * Verifies a ListInstanceConfigOperationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListInstanceConfigOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListInstanceConfigOperationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest; + + /** + * Creates a plain object from a ListInstanceConfigOperationsRequest message. Also converts values to other types if specified. + * @param message ListInstanceConfigOperationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListInstanceConfigOperationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListInstanceConfigOperationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListInstanceConfigOperationsResponse. */ + interface IListInstanceConfigOperationsResponse { + + /** ListInstanceConfigOperationsResponse operations */ + operations?: (google.longrunning.IOperation[]|null); + + /** ListInstanceConfigOperationsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListInstanceConfigOperationsResponse. */ + class ListInstanceConfigOperationsResponse implements IListInstanceConfigOperationsResponse { + + /** + * Constructs a new ListInstanceConfigOperationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.instance.v1.IListInstanceConfigOperationsResponse); + + /** ListInstanceConfigOperationsResponse operations. */ + public operations: google.longrunning.IOperation[]; + + /** ListInstanceConfigOperationsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListInstanceConfigOperationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInstanceConfigOperationsResponse instance + */ + public static create(properties?: google.spanner.admin.instance.v1.IListInstanceConfigOperationsResponse): google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse; + + /** + * Encodes the specified ListInstanceConfigOperationsResponse message. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse.verify|verify} messages. + * @param message ListInstanceConfigOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.instance.v1.IListInstanceConfigOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInstanceConfigOperationsResponse message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse.verify|verify} messages. + * @param message ListInstanceConfigOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.instance.v1.IListInstanceConfigOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListInstanceConfigOperationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListInstanceConfigOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse; + + /** + * Decodes a ListInstanceConfigOperationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListInstanceConfigOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse; + + /** + * Verifies a ListInstanceConfigOperationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListInstanceConfigOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListInstanceConfigOperationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse; + + /** + * Creates a plain object from a ListInstanceConfigOperationsResponse message. Also converts values to other types if specified. + * @param message ListInstanceConfigOperationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListInstanceConfigOperationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListInstanceConfigOperationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetInstanceRequest. */ + interface IGetInstanceRequest { + + /** GetInstanceRequest name */ + name?: (string|null); + + /** GetInstanceRequest fieldMask */ + fieldMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents a GetInstanceRequest. */ + class GetInstanceRequest implements IGetInstanceRequest { + + /** + * Constructs a new GetInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.instance.v1.IGetInstanceRequest); + + /** GetInstanceRequest name. */ + public name: string; + + /** GetInstanceRequest fieldMask. */ + public fieldMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new GetInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetInstanceRequest instance + */ + public static create(properties?: google.spanner.admin.instance.v1.IGetInstanceRequest): google.spanner.admin.instance.v1.GetInstanceRequest; + + /** + * Encodes the specified GetInstanceRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.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.spanner.admin.instance.v1.IGetInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetInstanceRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.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.spanner.admin.instance.v1.IGetInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.GetInstanceRequest; + + /** + * Decodes a GetInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.GetInstanceRequest; + + /** + * Verifies a GetInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.GetInstanceRequest; + + /** + * Creates a plain object from a GetInstanceRequest message. Also converts values to other types if specified. + * @param message GetInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.instance.v1.GetInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateInstanceRequest. */ + interface ICreateInstanceRequest { + + /** CreateInstanceRequest parent */ + parent?: (string|null); + + /** CreateInstanceRequest instanceId */ + instanceId?: (string|null); + + /** CreateInstanceRequest instance */ + instance?: (google.spanner.admin.instance.v1.IInstance|null); + } + + /** Represents a CreateInstanceRequest. */ + class CreateInstanceRequest implements ICreateInstanceRequest { + + /** + * Constructs a new CreateInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.instance.v1.ICreateInstanceRequest); + + /** CreateInstanceRequest parent. */ + public parent: string; + + /** CreateInstanceRequest instanceId. */ + public instanceId: string; + + /** CreateInstanceRequest instance. */ + public instance?: (google.spanner.admin.instance.v1.IInstance|null); + + /** + * Creates a new CreateInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateInstanceRequest instance + */ + public static create(properties?: google.spanner.admin.instance.v1.ICreateInstanceRequest): google.spanner.admin.instance.v1.CreateInstanceRequest; + + /** + * Encodes the specified CreateInstanceRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.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.spanner.admin.instance.v1.ICreateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateInstanceRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.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.spanner.admin.instance.v1.ICreateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.CreateInstanceRequest; + + /** + * Decodes a CreateInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.CreateInstanceRequest; + + /** + * Verifies a CreateInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.CreateInstanceRequest; + + /** + * Creates a plain object from a CreateInstanceRequest message. Also converts values to other types if specified. + * @param message CreateInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.instance.v1.CreateInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListInstancesRequest. */ + interface IListInstancesRequest { + + /** ListInstancesRequest parent */ + parent?: (string|null); + + /** ListInstancesRequest pageSize */ + pageSize?: (number|null); + + /** ListInstancesRequest pageToken */ + pageToken?: (string|null); + + /** ListInstancesRequest filter */ + filter?: (string|null); + + /** ListInstancesRequest instanceDeadline */ + instanceDeadline?: (google.protobuf.ITimestamp|null); + } + + /** Represents a ListInstancesRequest. */ + class ListInstancesRequest implements IListInstancesRequest { + + /** + * Constructs a new ListInstancesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.instance.v1.IListInstancesRequest); + + /** ListInstancesRequest parent. */ + public parent: string; + + /** ListInstancesRequest pageSize. */ + public pageSize: number; + + /** ListInstancesRequest pageToken. */ + public pageToken: string; + + /** ListInstancesRequest filter. */ + public filter: string; + + /** ListInstancesRequest instanceDeadline. */ + public instanceDeadline?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new ListInstancesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInstancesRequest instance + */ + public static create(properties?: google.spanner.admin.instance.v1.IListInstancesRequest): google.spanner.admin.instance.v1.ListInstancesRequest; + + /** + * Encodes the specified ListInstancesRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancesRequest.verify|verify} messages. + * @param message ListInstancesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.instance.v1.IListInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInstancesRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancesRequest.verify|verify} messages. + * @param message ListInstancesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.instance.v1.IListInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListInstancesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.ListInstancesRequest; + + /** + * Decodes a ListInstancesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.ListInstancesRequest; + + /** + * Verifies a ListInstancesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListInstancesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListInstancesRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.ListInstancesRequest; + + /** + * Creates a plain object from a ListInstancesRequest message. Also converts values to other types if specified. + * @param message ListInstancesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.instance.v1.ListInstancesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListInstancesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListInstancesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListInstancesResponse. */ + interface IListInstancesResponse { + + /** ListInstancesResponse instances */ + instances?: (google.spanner.admin.instance.v1.IInstance[]|null); + + /** ListInstancesResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListInstancesResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListInstancesResponse. */ + class ListInstancesResponse implements IListInstancesResponse { + + /** + * Constructs a new ListInstancesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.instance.v1.IListInstancesResponse); + + /** ListInstancesResponse instances. */ + public instances: google.spanner.admin.instance.v1.IInstance[]; + + /** ListInstancesResponse nextPageToken. */ + public nextPageToken: string; + + /** ListInstancesResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListInstancesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInstancesResponse instance + */ + public static create(properties?: google.spanner.admin.instance.v1.IListInstancesResponse): google.spanner.admin.instance.v1.ListInstancesResponse; + + /** + * Encodes the specified ListInstancesResponse message. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancesResponse.verify|verify} messages. + * @param message ListInstancesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.instance.v1.IListInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInstancesResponse message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancesResponse.verify|verify} messages. + * @param message ListInstancesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.instance.v1.IListInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListInstancesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.ListInstancesResponse; + + /** + * Decodes a ListInstancesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.ListInstancesResponse; + + /** + * Verifies a ListInstancesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListInstancesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListInstancesResponse + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.ListInstancesResponse; + + /** + * Creates a plain object from a ListInstancesResponse message. Also converts values to other types if specified. + * @param message ListInstancesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.instance.v1.ListInstancesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListInstancesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListInstancesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateInstanceRequest. */ + interface IUpdateInstanceRequest { + + /** UpdateInstanceRequest instance */ + instance?: (google.spanner.admin.instance.v1.IInstance|null); + + /** UpdateInstanceRequest fieldMask */ + fieldMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateInstanceRequest. */ + class UpdateInstanceRequest implements IUpdateInstanceRequest { + + /** + * Constructs a new UpdateInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.instance.v1.IUpdateInstanceRequest); + + /** UpdateInstanceRequest instance. */ + public instance?: (google.spanner.admin.instance.v1.IInstance|null); + + /** UpdateInstanceRequest fieldMask. */ + public fieldMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateInstanceRequest instance + */ + public static create(properties?: google.spanner.admin.instance.v1.IUpdateInstanceRequest): google.spanner.admin.instance.v1.UpdateInstanceRequest; + + /** + * Encodes the specified UpdateInstanceRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.UpdateInstanceRequest.verify|verify} messages. + * @param message UpdateInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.instance.v1.IUpdateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateInstanceRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.UpdateInstanceRequest.verify|verify} messages. + * @param message UpdateInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.instance.v1.IUpdateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.UpdateInstanceRequest; + + /** + * Decodes an UpdateInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.UpdateInstanceRequest; + + /** + * Verifies an UpdateInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.UpdateInstanceRequest; + + /** + * Creates a plain object from an UpdateInstanceRequest message. Also converts values to other types if specified. + * @param message UpdateInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.instance.v1.UpdateInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteInstanceRequest. */ + interface IDeleteInstanceRequest { + + /** DeleteInstanceRequest name */ + name?: (string|null); + } + + /** Represents a DeleteInstanceRequest. */ + class DeleteInstanceRequest implements IDeleteInstanceRequest { + + /** + * Constructs a new DeleteInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.instance.v1.IDeleteInstanceRequest); + + /** DeleteInstanceRequest name. */ + public name: string; + + /** + * Creates a new DeleteInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteInstanceRequest instance + */ + public static create(properties?: google.spanner.admin.instance.v1.IDeleteInstanceRequest): google.spanner.admin.instance.v1.DeleteInstanceRequest; + + /** + * Encodes the specified DeleteInstanceRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.DeleteInstanceRequest.verify|verify} messages. + * @param message DeleteInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.instance.v1.IDeleteInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteInstanceRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.DeleteInstanceRequest.verify|verify} messages. + * @param message DeleteInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.instance.v1.IDeleteInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.DeleteInstanceRequest; + + /** + * Decodes a DeleteInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.DeleteInstanceRequest; + + /** + * Verifies a DeleteInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.DeleteInstanceRequest; + + /** + * Creates a plain object from a DeleteInstanceRequest message. Also converts values to other types if specified. + * @param message DeleteInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.instance.v1.DeleteInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateInstanceMetadata. */ + interface ICreateInstanceMetadata { + + /** CreateInstanceMetadata instance */ + instance?: (google.spanner.admin.instance.v1.IInstance|null); + + /** CreateInstanceMetadata startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** CreateInstanceMetadata cancelTime */ + cancelTime?: (google.protobuf.ITimestamp|null); + + /** CreateInstanceMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** CreateInstanceMetadata expectedFulfillmentPeriod */ + expectedFulfillmentPeriod?: (google.spanner.admin.instance.v1.FulfillmentPeriod|keyof typeof google.spanner.admin.instance.v1.FulfillmentPeriod|null); + } + + /** Represents a CreateInstanceMetadata. */ + class CreateInstanceMetadata implements ICreateInstanceMetadata { + + /** + * Constructs a new CreateInstanceMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.instance.v1.ICreateInstanceMetadata); + + /** CreateInstanceMetadata instance. */ + public instance?: (google.spanner.admin.instance.v1.IInstance|null); + + /** CreateInstanceMetadata startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** CreateInstanceMetadata cancelTime. */ + public cancelTime?: (google.protobuf.ITimestamp|null); + + /** CreateInstanceMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** CreateInstanceMetadata expectedFulfillmentPeriod. */ + public expectedFulfillmentPeriod: (google.spanner.admin.instance.v1.FulfillmentPeriod|keyof typeof google.spanner.admin.instance.v1.FulfillmentPeriod); + + /** + * Creates a new CreateInstanceMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateInstanceMetadata instance + */ + public static create(properties?: google.spanner.admin.instance.v1.ICreateInstanceMetadata): google.spanner.admin.instance.v1.CreateInstanceMetadata; + + /** + * Encodes the specified CreateInstanceMetadata message. Does not implicitly {@link google.spanner.admin.instance.v1.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.spanner.admin.instance.v1.ICreateInstanceMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateInstanceMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.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.spanner.admin.instance.v1.ICreateInstanceMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateInstanceMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateInstanceMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.CreateInstanceMetadata; + + /** + * Decodes a CreateInstanceMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateInstanceMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.CreateInstanceMetadata; + + /** + * Verifies a CreateInstanceMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateInstanceMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateInstanceMetadata + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.CreateInstanceMetadata; + + /** + * Creates a plain object from a CreateInstanceMetadata message. Also converts values to other types if specified. + * @param message CreateInstanceMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.instance.v1.CreateInstanceMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateInstanceMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateInstanceMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateInstanceMetadata. */ + interface IUpdateInstanceMetadata { + + /** UpdateInstanceMetadata instance */ + instance?: (google.spanner.admin.instance.v1.IInstance|null); + + /** UpdateInstanceMetadata startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** UpdateInstanceMetadata cancelTime */ + cancelTime?: (google.protobuf.ITimestamp|null); + + /** UpdateInstanceMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** UpdateInstanceMetadata expectedFulfillmentPeriod */ + expectedFulfillmentPeriod?: (google.spanner.admin.instance.v1.FulfillmentPeriod|keyof typeof google.spanner.admin.instance.v1.FulfillmentPeriod|null); + } + + /** Represents an UpdateInstanceMetadata. */ + class UpdateInstanceMetadata implements IUpdateInstanceMetadata { + + /** + * Constructs a new UpdateInstanceMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.instance.v1.IUpdateInstanceMetadata); + + /** UpdateInstanceMetadata instance. */ + public instance?: (google.spanner.admin.instance.v1.IInstance|null); + + /** UpdateInstanceMetadata startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** UpdateInstanceMetadata cancelTime. */ + public cancelTime?: (google.protobuf.ITimestamp|null); + + /** UpdateInstanceMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** UpdateInstanceMetadata expectedFulfillmentPeriod. */ + public expectedFulfillmentPeriod: (google.spanner.admin.instance.v1.FulfillmentPeriod|keyof typeof google.spanner.admin.instance.v1.FulfillmentPeriod); + + /** + * Creates a new UpdateInstanceMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateInstanceMetadata instance + */ + public static create(properties?: google.spanner.admin.instance.v1.IUpdateInstanceMetadata): google.spanner.admin.instance.v1.UpdateInstanceMetadata; + + /** + * Encodes the specified UpdateInstanceMetadata message. Does not implicitly {@link google.spanner.admin.instance.v1.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.spanner.admin.instance.v1.IUpdateInstanceMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateInstanceMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.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.spanner.admin.instance.v1.IUpdateInstanceMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateInstanceMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateInstanceMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.UpdateInstanceMetadata; + + /** + * Decodes an UpdateInstanceMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateInstanceMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.UpdateInstanceMetadata; + + /** + * Verifies an UpdateInstanceMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateInstanceMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateInstanceMetadata + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.UpdateInstanceMetadata; + + /** + * Creates a plain object from an UpdateInstanceMetadata message. Also converts values to other types if specified. + * @param message UpdateInstanceMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.instance.v1.UpdateInstanceMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateInstanceMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateInstanceMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FreeInstanceMetadata. */ + interface IFreeInstanceMetadata { + + /** FreeInstanceMetadata expireTime */ + expireTime?: (google.protobuf.ITimestamp|null); + + /** FreeInstanceMetadata upgradeTime */ + upgradeTime?: (google.protobuf.ITimestamp|null); + + /** FreeInstanceMetadata expireBehavior */ + expireBehavior?: (google.spanner.admin.instance.v1.FreeInstanceMetadata.ExpireBehavior|keyof typeof google.spanner.admin.instance.v1.FreeInstanceMetadata.ExpireBehavior|null); + } + + /** Represents a FreeInstanceMetadata. */ + class FreeInstanceMetadata implements IFreeInstanceMetadata { + + /** + * Constructs a new FreeInstanceMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.instance.v1.IFreeInstanceMetadata); + + /** FreeInstanceMetadata expireTime. */ + public expireTime?: (google.protobuf.ITimestamp|null); + + /** FreeInstanceMetadata upgradeTime. */ + public upgradeTime?: (google.protobuf.ITimestamp|null); + + /** FreeInstanceMetadata expireBehavior. */ + public expireBehavior: (google.spanner.admin.instance.v1.FreeInstanceMetadata.ExpireBehavior|keyof typeof google.spanner.admin.instance.v1.FreeInstanceMetadata.ExpireBehavior); + + /** + * Creates a new FreeInstanceMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns FreeInstanceMetadata instance + */ + public static create(properties?: google.spanner.admin.instance.v1.IFreeInstanceMetadata): google.spanner.admin.instance.v1.FreeInstanceMetadata; + + /** + * Encodes the specified FreeInstanceMetadata message. Does not implicitly {@link google.spanner.admin.instance.v1.FreeInstanceMetadata.verify|verify} messages. + * @param message FreeInstanceMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.instance.v1.IFreeInstanceMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FreeInstanceMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.FreeInstanceMetadata.verify|verify} messages. + * @param message FreeInstanceMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.instance.v1.IFreeInstanceMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FreeInstanceMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FreeInstanceMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.FreeInstanceMetadata; + + /** + * Decodes a FreeInstanceMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FreeInstanceMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.FreeInstanceMetadata; + + /** + * Verifies a FreeInstanceMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FreeInstanceMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FreeInstanceMetadata + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.FreeInstanceMetadata; + + /** + * Creates a plain object from a FreeInstanceMetadata message. Also converts values to other types if specified. + * @param message FreeInstanceMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.instance.v1.FreeInstanceMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FreeInstanceMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FreeInstanceMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FreeInstanceMetadata { + + /** ExpireBehavior enum. */ + enum ExpireBehavior { + EXPIRE_BEHAVIOR_UNSPECIFIED = 0, + FREE_TO_PROVISIONED = 1, + REMOVE_AFTER_GRACE_PERIOD = 2 + } + } + + /** Properties of a CreateInstanceConfigMetadata. */ + interface ICreateInstanceConfigMetadata { + + /** CreateInstanceConfigMetadata instanceConfig */ + instanceConfig?: (google.spanner.admin.instance.v1.IInstanceConfig|null); + + /** CreateInstanceConfigMetadata progress */ + progress?: (google.spanner.admin.instance.v1.IOperationProgress|null); + + /** CreateInstanceConfigMetadata cancelTime */ + cancelTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a CreateInstanceConfigMetadata. */ + class CreateInstanceConfigMetadata implements ICreateInstanceConfigMetadata { + + /** + * Constructs a new CreateInstanceConfigMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.instance.v1.ICreateInstanceConfigMetadata); + + /** CreateInstanceConfigMetadata instanceConfig. */ + public instanceConfig?: (google.spanner.admin.instance.v1.IInstanceConfig|null); + + /** CreateInstanceConfigMetadata progress. */ + public progress?: (google.spanner.admin.instance.v1.IOperationProgress|null); + + /** CreateInstanceConfigMetadata cancelTime. */ + public cancelTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new CreateInstanceConfigMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateInstanceConfigMetadata instance + */ + public static create(properties?: google.spanner.admin.instance.v1.ICreateInstanceConfigMetadata): google.spanner.admin.instance.v1.CreateInstanceConfigMetadata; + + /** + * Encodes the specified CreateInstanceConfigMetadata message. Does not implicitly {@link google.spanner.admin.instance.v1.CreateInstanceConfigMetadata.verify|verify} messages. + * @param message CreateInstanceConfigMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.instance.v1.ICreateInstanceConfigMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateInstanceConfigMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.CreateInstanceConfigMetadata.verify|verify} messages. + * @param message CreateInstanceConfigMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.instance.v1.ICreateInstanceConfigMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateInstanceConfigMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateInstanceConfigMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.CreateInstanceConfigMetadata; + + /** + * Decodes a CreateInstanceConfigMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateInstanceConfigMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.CreateInstanceConfigMetadata; + + /** + * Verifies a CreateInstanceConfigMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateInstanceConfigMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateInstanceConfigMetadata + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.CreateInstanceConfigMetadata; + + /** + * Creates a plain object from a CreateInstanceConfigMetadata message. Also converts values to other types if specified. + * @param message CreateInstanceConfigMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.instance.v1.CreateInstanceConfigMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateInstanceConfigMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateInstanceConfigMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateInstanceConfigMetadata. */ + interface IUpdateInstanceConfigMetadata { + + /** UpdateInstanceConfigMetadata instanceConfig */ + instanceConfig?: (google.spanner.admin.instance.v1.IInstanceConfig|null); + + /** UpdateInstanceConfigMetadata progress */ + progress?: (google.spanner.admin.instance.v1.IOperationProgress|null); + + /** UpdateInstanceConfigMetadata cancelTime */ + cancelTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents an UpdateInstanceConfigMetadata. */ + class UpdateInstanceConfigMetadata implements IUpdateInstanceConfigMetadata { + + /** + * Constructs a new UpdateInstanceConfigMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.instance.v1.IUpdateInstanceConfigMetadata); + + /** UpdateInstanceConfigMetadata instanceConfig. */ + public instanceConfig?: (google.spanner.admin.instance.v1.IInstanceConfig|null); + + /** UpdateInstanceConfigMetadata progress. */ + public progress?: (google.spanner.admin.instance.v1.IOperationProgress|null); + + /** UpdateInstanceConfigMetadata cancelTime. */ + public cancelTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new UpdateInstanceConfigMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateInstanceConfigMetadata instance + */ + public static create(properties?: google.spanner.admin.instance.v1.IUpdateInstanceConfigMetadata): google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata; + + /** + * Encodes the specified UpdateInstanceConfigMetadata message. Does not implicitly {@link google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata.verify|verify} messages. + * @param message UpdateInstanceConfigMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.instance.v1.IUpdateInstanceConfigMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateInstanceConfigMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata.verify|verify} messages. + * @param message UpdateInstanceConfigMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.instance.v1.IUpdateInstanceConfigMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateInstanceConfigMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateInstanceConfigMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata; + + /** + * Decodes an UpdateInstanceConfigMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateInstanceConfigMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata; + + /** + * Verifies an UpdateInstanceConfigMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateInstanceConfigMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateInstanceConfigMetadata + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata; + + /** + * Creates a plain object from an UpdateInstanceConfigMetadata message. Also converts values to other types if specified. + * @param message UpdateInstanceConfigMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateInstanceConfigMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateInstanceConfigMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an InstancePartition. */ + interface IInstancePartition { + + /** InstancePartition name */ + name?: (string|null); + + /** InstancePartition config */ + config?: (string|null); + + /** InstancePartition displayName */ + displayName?: (string|null); + + /** InstancePartition nodeCount */ + nodeCount?: (number|null); + + /** InstancePartition processingUnits */ + processingUnits?: (number|null); + + /** InstancePartition autoscalingConfig */ + autoscalingConfig?: (google.spanner.admin.instance.v1.IAutoscalingConfig|null); + + /** InstancePartition state */ + state?: (google.spanner.admin.instance.v1.InstancePartition.State|keyof typeof google.spanner.admin.instance.v1.InstancePartition.State|null); + + /** InstancePartition createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** InstancePartition updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** InstancePartition referencingDatabases */ + referencingDatabases?: (string[]|null); + + /** InstancePartition referencingBackups */ + referencingBackups?: (string[]|null); + + /** InstancePartition etag */ + etag?: (string|null); + } + + /** Represents an InstancePartition. */ + class InstancePartition implements IInstancePartition { + + /** + * Constructs a new InstancePartition. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.instance.v1.IInstancePartition); + + /** InstancePartition name. */ + public name: string; + + /** InstancePartition config. */ + public config: string; + + /** InstancePartition displayName. */ + public displayName: string; + + /** InstancePartition nodeCount. */ + public nodeCount?: (number|null); + + /** InstancePartition processingUnits. */ + public processingUnits?: (number|null); + + /** InstancePartition autoscalingConfig. */ + public autoscalingConfig?: (google.spanner.admin.instance.v1.IAutoscalingConfig|null); + + /** InstancePartition state. */ + public state: (google.spanner.admin.instance.v1.InstancePartition.State|keyof typeof google.spanner.admin.instance.v1.InstancePartition.State); + + /** InstancePartition createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** InstancePartition updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** InstancePartition referencingDatabases. */ + public referencingDatabases: string[]; + + /** InstancePartition referencingBackups. */ + public referencingBackups: string[]; + + /** InstancePartition etag. */ + public etag: string; + + /** InstancePartition computeCapacity. */ + public computeCapacity?: ("nodeCount"|"processingUnits"); + + /** + * Creates a new InstancePartition instance using the specified properties. + * @param [properties] Properties to set + * @returns InstancePartition instance + */ + public static create(properties?: google.spanner.admin.instance.v1.IInstancePartition): google.spanner.admin.instance.v1.InstancePartition; + + /** + * Encodes the specified InstancePartition message. Does not implicitly {@link google.spanner.admin.instance.v1.InstancePartition.verify|verify} messages. + * @param message InstancePartition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.instance.v1.IInstancePartition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstancePartition message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.InstancePartition.verify|verify} messages. + * @param message InstancePartition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.instance.v1.IInstancePartition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstancePartition message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstancePartition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.InstancePartition; + + /** + * Decodes an InstancePartition message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstancePartition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.InstancePartition; + + /** + * Verifies an InstancePartition message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstancePartition message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstancePartition + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.InstancePartition; + + /** + * Creates a plain object from an InstancePartition message. Also converts values to other types if specified. + * @param message InstancePartition + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.instance.v1.InstancePartition, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstancePartition to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InstancePartition + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace InstancePartition { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + CREATING = 1, + READY = 2 + } + } + + /** Properties of a CreateInstancePartitionMetadata. */ + interface ICreateInstancePartitionMetadata { + + /** CreateInstancePartitionMetadata instancePartition */ + instancePartition?: (google.spanner.admin.instance.v1.IInstancePartition|null); + + /** CreateInstancePartitionMetadata startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** CreateInstancePartitionMetadata cancelTime */ + cancelTime?: (google.protobuf.ITimestamp|null); + + /** CreateInstancePartitionMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a CreateInstancePartitionMetadata. */ + class CreateInstancePartitionMetadata implements ICreateInstancePartitionMetadata { + + /** + * Constructs a new CreateInstancePartitionMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.instance.v1.ICreateInstancePartitionMetadata); + + /** CreateInstancePartitionMetadata instancePartition. */ + public instancePartition?: (google.spanner.admin.instance.v1.IInstancePartition|null); + + /** CreateInstancePartitionMetadata startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** CreateInstancePartitionMetadata cancelTime. */ + public cancelTime?: (google.protobuf.ITimestamp|null); + + /** CreateInstancePartitionMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new CreateInstancePartitionMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateInstancePartitionMetadata instance + */ + public static create(properties?: google.spanner.admin.instance.v1.ICreateInstancePartitionMetadata): google.spanner.admin.instance.v1.CreateInstancePartitionMetadata; + + /** + * Encodes the specified CreateInstancePartitionMetadata message. Does not implicitly {@link google.spanner.admin.instance.v1.CreateInstancePartitionMetadata.verify|verify} messages. + * @param message CreateInstancePartitionMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.instance.v1.ICreateInstancePartitionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateInstancePartitionMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.CreateInstancePartitionMetadata.verify|verify} messages. + * @param message CreateInstancePartitionMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.instance.v1.ICreateInstancePartitionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateInstancePartitionMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateInstancePartitionMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.CreateInstancePartitionMetadata; + + /** + * Decodes a CreateInstancePartitionMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateInstancePartitionMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.CreateInstancePartitionMetadata; + + /** + * Verifies a CreateInstancePartitionMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateInstancePartitionMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateInstancePartitionMetadata + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.CreateInstancePartitionMetadata; + + /** + * Creates a plain object from a CreateInstancePartitionMetadata message. Also converts values to other types if specified. + * @param message CreateInstancePartitionMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.instance.v1.CreateInstancePartitionMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateInstancePartitionMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateInstancePartitionMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateInstancePartitionRequest. */ + interface ICreateInstancePartitionRequest { + + /** CreateInstancePartitionRequest parent */ + parent?: (string|null); + + /** CreateInstancePartitionRequest instancePartitionId */ + instancePartitionId?: (string|null); + + /** CreateInstancePartitionRequest instancePartition */ + instancePartition?: (google.spanner.admin.instance.v1.IInstancePartition|null); + } + + /** Represents a CreateInstancePartitionRequest. */ + class CreateInstancePartitionRequest implements ICreateInstancePartitionRequest { + + /** + * Constructs a new CreateInstancePartitionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.instance.v1.ICreateInstancePartitionRequest); + + /** CreateInstancePartitionRequest parent. */ + public parent: string; + + /** CreateInstancePartitionRequest instancePartitionId. */ + public instancePartitionId: string; + + /** CreateInstancePartitionRequest instancePartition. */ + public instancePartition?: (google.spanner.admin.instance.v1.IInstancePartition|null); + + /** + * Creates a new CreateInstancePartitionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateInstancePartitionRequest instance + */ + public static create(properties?: google.spanner.admin.instance.v1.ICreateInstancePartitionRequest): google.spanner.admin.instance.v1.CreateInstancePartitionRequest; + + /** + * Encodes the specified CreateInstancePartitionRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.CreateInstancePartitionRequest.verify|verify} messages. + * @param message CreateInstancePartitionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.instance.v1.ICreateInstancePartitionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateInstancePartitionRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.CreateInstancePartitionRequest.verify|verify} messages. + * @param message CreateInstancePartitionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.instance.v1.ICreateInstancePartitionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateInstancePartitionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateInstancePartitionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.CreateInstancePartitionRequest; + + /** + * Decodes a CreateInstancePartitionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateInstancePartitionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.CreateInstancePartitionRequest; + + /** + * Verifies a CreateInstancePartitionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateInstancePartitionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateInstancePartitionRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.CreateInstancePartitionRequest; + + /** + * Creates a plain object from a CreateInstancePartitionRequest message. Also converts values to other types if specified. + * @param message CreateInstancePartitionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.instance.v1.CreateInstancePartitionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateInstancePartitionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateInstancePartitionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteInstancePartitionRequest. */ + interface IDeleteInstancePartitionRequest { + + /** DeleteInstancePartitionRequest name */ + name?: (string|null); + + /** DeleteInstancePartitionRequest etag */ + etag?: (string|null); + } + + /** Represents a DeleteInstancePartitionRequest. */ + class DeleteInstancePartitionRequest implements IDeleteInstancePartitionRequest { + + /** + * Constructs a new DeleteInstancePartitionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.instance.v1.IDeleteInstancePartitionRequest); + + /** DeleteInstancePartitionRequest name. */ + public name: string; + + /** DeleteInstancePartitionRequest etag. */ + public etag: string; + + /** + * Creates a new DeleteInstancePartitionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteInstancePartitionRequest instance + */ + public static create(properties?: google.spanner.admin.instance.v1.IDeleteInstancePartitionRequest): google.spanner.admin.instance.v1.DeleteInstancePartitionRequest; + + /** + * Encodes the specified DeleteInstancePartitionRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.DeleteInstancePartitionRequest.verify|verify} messages. + * @param message DeleteInstancePartitionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.instance.v1.IDeleteInstancePartitionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteInstancePartitionRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.DeleteInstancePartitionRequest.verify|verify} messages. + * @param message DeleteInstancePartitionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.instance.v1.IDeleteInstancePartitionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteInstancePartitionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteInstancePartitionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.DeleteInstancePartitionRequest; + + /** + * Decodes a DeleteInstancePartitionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteInstancePartitionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.DeleteInstancePartitionRequest; + + /** + * Verifies a DeleteInstancePartitionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteInstancePartitionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteInstancePartitionRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.DeleteInstancePartitionRequest; + + /** + * Creates a plain object from a DeleteInstancePartitionRequest message. Also converts values to other types if specified. + * @param message DeleteInstancePartitionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.instance.v1.DeleteInstancePartitionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteInstancePartitionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteInstancePartitionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetInstancePartitionRequest. */ + interface IGetInstancePartitionRequest { + + /** GetInstancePartitionRequest name */ + name?: (string|null); + } + + /** Represents a GetInstancePartitionRequest. */ + class GetInstancePartitionRequest implements IGetInstancePartitionRequest { + + /** + * Constructs a new GetInstancePartitionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.instance.v1.IGetInstancePartitionRequest); + + /** GetInstancePartitionRequest name. */ + public name: string; + + /** + * Creates a new GetInstancePartitionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetInstancePartitionRequest instance + */ + public static create(properties?: google.spanner.admin.instance.v1.IGetInstancePartitionRequest): google.spanner.admin.instance.v1.GetInstancePartitionRequest; + + /** + * Encodes the specified GetInstancePartitionRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.GetInstancePartitionRequest.verify|verify} messages. + * @param message GetInstancePartitionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.instance.v1.IGetInstancePartitionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetInstancePartitionRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.GetInstancePartitionRequest.verify|verify} messages. + * @param message GetInstancePartitionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.instance.v1.IGetInstancePartitionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetInstancePartitionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetInstancePartitionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.GetInstancePartitionRequest; + + /** + * Decodes a GetInstancePartitionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetInstancePartitionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.GetInstancePartitionRequest; + + /** + * Verifies a GetInstancePartitionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetInstancePartitionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetInstancePartitionRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.GetInstancePartitionRequest; + + /** + * Creates a plain object from a GetInstancePartitionRequest message. Also converts values to other types if specified. + * @param message GetInstancePartitionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.instance.v1.GetInstancePartitionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetInstancePartitionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetInstancePartitionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateInstancePartitionRequest. */ + interface IUpdateInstancePartitionRequest { + + /** UpdateInstancePartitionRequest instancePartition */ + instancePartition?: (google.spanner.admin.instance.v1.IInstancePartition|null); + + /** UpdateInstancePartitionRequest fieldMask */ + fieldMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateInstancePartitionRequest. */ + class UpdateInstancePartitionRequest implements IUpdateInstancePartitionRequest { + + /** + * Constructs a new UpdateInstancePartitionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.instance.v1.IUpdateInstancePartitionRequest); + + /** UpdateInstancePartitionRequest instancePartition. */ + public instancePartition?: (google.spanner.admin.instance.v1.IInstancePartition|null); + + /** UpdateInstancePartitionRequest fieldMask. */ + public fieldMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateInstancePartitionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateInstancePartitionRequest instance + */ + public static create(properties?: google.spanner.admin.instance.v1.IUpdateInstancePartitionRequest): google.spanner.admin.instance.v1.UpdateInstancePartitionRequest; + + /** + * Encodes the specified UpdateInstancePartitionRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.UpdateInstancePartitionRequest.verify|verify} messages. + * @param message UpdateInstancePartitionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.instance.v1.IUpdateInstancePartitionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateInstancePartitionRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.UpdateInstancePartitionRequest.verify|verify} messages. + * @param message UpdateInstancePartitionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.instance.v1.IUpdateInstancePartitionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateInstancePartitionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateInstancePartitionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.UpdateInstancePartitionRequest; + + /** + * Decodes an UpdateInstancePartitionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateInstancePartitionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.UpdateInstancePartitionRequest; + + /** + * Verifies an UpdateInstancePartitionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateInstancePartitionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateInstancePartitionRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.UpdateInstancePartitionRequest; + + /** + * Creates a plain object from an UpdateInstancePartitionRequest message. Also converts values to other types if specified. + * @param message UpdateInstancePartitionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.instance.v1.UpdateInstancePartitionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateInstancePartitionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateInstancePartitionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateInstancePartitionMetadata. */ + interface IUpdateInstancePartitionMetadata { + + /** UpdateInstancePartitionMetadata instancePartition */ + instancePartition?: (google.spanner.admin.instance.v1.IInstancePartition|null); + + /** UpdateInstancePartitionMetadata startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** UpdateInstancePartitionMetadata cancelTime */ + cancelTime?: (google.protobuf.ITimestamp|null); + + /** UpdateInstancePartitionMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents an UpdateInstancePartitionMetadata. */ + class UpdateInstancePartitionMetadata implements IUpdateInstancePartitionMetadata { + + /** + * Constructs a new UpdateInstancePartitionMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.instance.v1.IUpdateInstancePartitionMetadata); + + /** UpdateInstancePartitionMetadata instancePartition. */ + public instancePartition?: (google.spanner.admin.instance.v1.IInstancePartition|null); + + /** UpdateInstancePartitionMetadata startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** UpdateInstancePartitionMetadata cancelTime. */ + public cancelTime?: (google.protobuf.ITimestamp|null); + + /** UpdateInstancePartitionMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new UpdateInstancePartitionMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateInstancePartitionMetadata instance + */ + public static create(properties?: google.spanner.admin.instance.v1.IUpdateInstancePartitionMetadata): google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata; + + /** + * Encodes the specified UpdateInstancePartitionMetadata message. Does not implicitly {@link google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata.verify|verify} messages. + * @param message UpdateInstancePartitionMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.instance.v1.IUpdateInstancePartitionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateInstancePartitionMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata.verify|verify} messages. + * @param message UpdateInstancePartitionMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.instance.v1.IUpdateInstancePartitionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateInstancePartitionMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateInstancePartitionMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata; + + /** + * Decodes an UpdateInstancePartitionMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateInstancePartitionMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata; + + /** + * Verifies an UpdateInstancePartitionMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateInstancePartitionMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateInstancePartitionMetadata + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata; + + /** + * Creates a plain object from an UpdateInstancePartitionMetadata message. Also converts values to other types if specified. + * @param message UpdateInstancePartitionMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateInstancePartitionMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateInstancePartitionMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListInstancePartitionsRequest. */ + interface IListInstancePartitionsRequest { + + /** ListInstancePartitionsRequest parent */ + parent?: (string|null); + + /** ListInstancePartitionsRequest pageSize */ + pageSize?: (number|null); + + /** ListInstancePartitionsRequest pageToken */ + pageToken?: (string|null); + + /** ListInstancePartitionsRequest instancePartitionDeadline */ + instancePartitionDeadline?: (google.protobuf.ITimestamp|null); + } + + /** Represents a ListInstancePartitionsRequest. */ + class ListInstancePartitionsRequest implements IListInstancePartitionsRequest { + + /** + * Constructs a new ListInstancePartitionsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.instance.v1.IListInstancePartitionsRequest); + + /** ListInstancePartitionsRequest parent. */ + public parent: string; + + /** ListInstancePartitionsRequest pageSize. */ + public pageSize: number; + + /** ListInstancePartitionsRequest pageToken. */ + public pageToken: string; + + /** ListInstancePartitionsRequest instancePartitionDeadline. */ + public instancePartitionDeadline?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new ListInstancePartitionsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInstancePartitionsRequest instance + */ + public static create(properties?: google.spanner.admin.instance.v1.IListInstancePartitionsRequest): google.spanner.admin.instance.v1.ListInstancePartitionsRequest; + + /** + * Encodes the specified ListInstancePartitionsRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancePartitionsRequest.verify|verify} messages. + * @param message ListInstancePartitionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.instance.v1.IListInstancePartitionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInstancePartitionsRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancePartitionsRequest.verify|verify} messages. + * @param message ListInstancePartitionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.instance.v1.IListInstancePartitionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListInstancePartitionsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListInstancePartitionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.ListInstancePartitionsRequest; + + /** + * Decodes a ListInstancePartitionsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListInstancePartitionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.ListInstancePartitionsRequest; + + /** + * Verifies a ListInstancePartitionsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListInstancePartitionsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListInstancePartitionsRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.ListInstancePartitionsRequest; + + /** + * Creates a plain object from a ListInstancePartitionsRequest message. Also converts values to other types if specified. + * @param message ListInstancePartitionsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.instance.v1.ListInstancePartitionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListInstancePartitionsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListInstancePartitionsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListInstancePartitionsResponse. */ + interface IListInstancePartitionsResponse { + + /** ListInstancePartitionsResponse instancePartitions */ + instancePartitions?: (google.spanner.admin.instance.v1.IInstancePartition[]|null); + + /** ListInstancePartitionsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListInstancePartitionsResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListInstancePartitionsResponse. */ + class ListInstancePartitionsResponse implements IListInstancePartitionsResponse { + + /** + * Constructs a new ListInstancePartitionsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.instance.v1.IListInstancePartitionsResponse); + + /** ListInstancePartitionsResponse instancePartitions. */ + public instancePartitions: google.spanner.admin.instance.v1.IInstancePartition[]; + + /** ListInstancePartitionsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListInstancePartitionsResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListInstancePartitionsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInstancePartitionsResponse instance + */ + public static create(properties?: google.spanner.admin.instance.v1.IListInstancePartitionsResponse): google.spanner.admin.instance.v1.ListInstancePartitionsResponse; + + /** + * Encodes the specified ListInstancePartitionsResponse message. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancePartitionsResponse.verify|verify} messages. + * @param message ListInstancePartitionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.instance.v1.IListInstancePartitionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInstancePartitionsResponse message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancePartitionsResponse.verify|verify} messages. + * @param message ListInstancePartitionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.instance.v1.IListInstancePartitionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListInstancePartitionsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListInstancePartitionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.ListInstancePartitionsResponse; + + /** + * Decodes a ListInstancePartitionsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListInstancePartitionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.ListInstancePartitionsResponse; + + /** + * Verifies a ListInstancePartitionsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListInstancePartitionsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListInstancePartitionsResponse + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.ListInstancePartitionsResponse; + + /** + * Creates a plain object from a ListInstancePartitionsResponse message. Also converts values to other types if specified. + * @param message ListInstancePartitionsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.instance.v1.ListInstancePartitionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListInstancePartitionsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListInstancePartitionsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListInstancePartitionOperationsRequest. */ + interface IListInstancePartitionOperationsRequest { + + /** ListInstancePartitionOperationsRequest parent */ + parent?: (string|null); + + /** ListInstancePartitionOperationsRequest filter */ + filter?: (string|null); + + /** ListInstancePartitionOperationsRequest pageSize */ + pageSize?: (number|null); + + /** ListInstancePartitionOperationsRequest pageToken */ + pageToken?: (string|null); + + /** ListInstancePartitionOperationsRequest instancePartitionDeadline */ + instancePartitionDeadline?: (google.protobuf.ITimestamp|null); + } + + /** Represents a ListInstancePartitionOperationsRequest. */ + class ListInstancePartitionOperationsRequest implements IListInstancePartitionOperationsRequest { + + /** + * Constructs a new ListInstancePartitionOperationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.instance.v1.IListInstancePartitionOperationsRequest); + + /** ListInstancePartitionOperationsRequest parent. */ + public parent: string; + + /** ListInstancePartitionOperationsRequest filter. */ + public filter: string; + + /** ListInstancePartitionOperationsRequest pageSize. */ + public pageSize: number; + + /** ListInstancePartitionOperationsRequest pageToken. */ + public pageToken: string; + + /** ListInstancePartitionOperationsRequest instancePartitionDeadline. */ + public instancePartitionDeadline?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new ListInstancePartitionOperationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInstancePartitionOperationsRequest instance + */ + public static create(properties?: google.spanner.admin.instance.v1.IListInstancePartitionOperationsRequest): google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest; + + /** + * Encodes the specified ListInstancePartitionOperationsRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest.verify|verify} messages. + * @param message ListInstancePartitionOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.instance.v1.IListInstancePartitionOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInstancePartitionOperationsRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest.verify|verify} messages. + * @param message ListInstancePartitionOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.instance.v1.IListInstancePartitionOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListInstancePartitionOperationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListInstancePartitionOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest; + + /** + * Decodes a ListInstancePartitionOperationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListInstancePartitionOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest; + + /** + * Verifies a ListInstancePartitionOperationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListInstancePartitionOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListInstancePartitionOperationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest; + + /** + * Creates a plain object from a ListInstancePartitionOperationsRequest message. Also converts values to other types if specified. + * @param message ListInstancePartitionOperationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListInstancePartitionOperationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListInstancePartitionOperationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListInstancePartitionOperationsResponse. */ + interface IListInstancePartitionOperationsResponse { + + /** ListInstancePartitionOperationsResponse operations */ + operations?: (google.longrunning.IOperation[]|null); + + /** ListInstancePartitionOperationsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListInstancePartitionOperationsResponse unreachableInstancePartitions */ + unreachableInstancePartitions?: (string[]|null); + } + + /** Represents a ListInstancePartitionOperationsResponse. */ + class ListInstancePartitionOperationsResponse implements IListInstancePartitionOperationsResponse { + + /** + * Constructs a new ListInstancePartitionOperationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.instance.v1.IListInstancePartitionOperationsResponse); + + /** ListInstancePartitionOperationsResponse operations. */ + public operations: google.longrunning.IOperation[]; + + /** ListInstancePartitionOperationsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListInstancePartitionOperationsResponse unreachableInstancePartitions. */ + public unreachableInstancePartitions: string[]; + + /** + * Creates a new ListInstancePartitionOperationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInstancePartitionOperationsResponse instance + */ + public static create(properties?: google.spanner.admin.instance.v1.IListInstancePartitionOperationsResponse): google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse; + + /** + * Encodes the specified ListInstancePartitionOperationsResponse message. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse.verify|verify} messages. + * @param message ListInstancePartitionOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.instance.v1.IListInstancePartitionOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInstancePartitionOperationsResponse message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse.verify|verify} messages. + * @param message ListInstancePartitionOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.instance.v1.IListInstancePartitionOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListInstancePartitionOperationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListInstancePartitionOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse; + + /** + * Decodes a ListInstancePartitionOperationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListInstancePartitionOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse; + + /** + * Verifies a ListInstancePartitionOperationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListInstancePartitionOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListInstancePartitionOperationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse; + + /** + * Creates a plain object from a ListInstancePartitionOperationsResponse message. Also converts values to other types if specified. + * @param message ListInstancePartitionOperationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListInstancePartitionOperationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListInstancePartitionOperationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MoveInstanceRequest. */ + interface IMoveInstanceRequest { + + /** MoveInstanceRequest name */ + name?: (string|null); + + /** MoveInstanceRequest targetConfig */ + targetConfig?: (string|null); + } + + /** Represents a MoveInstanceRequest. */ + class MoveInstanceRequest implements IMoveInstanceRequest { + + /** + * Constructs a new MoveInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.instance.v1.IMoveInstanceRequest); + + /** MoveInstanceRequest name. */ + public name: string; + + /** MoveInstanceRequest targetConfig. */ + public targetConfig: string; + + /** + * Creates a new MoveInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns MoveInstanceRequest instance + */ + public static create(properties?: google.spanner.admin.instance.v1.IMoveInstanceRequest): google.spanner.admin.instance.v1.MoveInstanceRequest; + + /** + * Encodes the specified MoveInstanceRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.MoveInstanceRequest.verify|verify} messages. + * @param message MoveInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.instance.v1.IMoveInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MoveInstanceRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.MoveInstanceRequest.verify|verify} messages. + * @param message MoveInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.instance.v1.IMoveInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MoveInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MoveInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.MoveInstanceRequest; + + /** + * Decodes a MoveInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MoveInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.MoveInstanceRequest; + + /** + * Verifies a MoveInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MoveInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MoveInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.MoveInstanceRequest; + + /** + * Creates a plain object from a MoveInstanceRequest message. Also converts values to other types if specified. + * @param message MoveInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.instance.v1.MoveInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MoveInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MoveInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MoveInstanceResponse. */ + interface IMoveInstanceResponse { + } + + /** Represents a MoveInstanceResponse. */ + class MoveInstanceResponse implements IMoveInstanceResponse { + + /** + * Constructs a new MoveInstanceResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.instance.v1.IMoveInstanceResponse); + + /** + * Creates a new MoveInstanceResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns MoveInstanceResponse instance + */ + public static create(properties?: google.spanner.admin.instance.v1.IMoveInstanceResponse): google.spanner.admin.instance.v1.MoveInstanceResponse; + + /** + * Encodes the specified MoveInstanceResponse message. Does not implicitly {@link google.spanner.admin.instance.v1.MoveInstanceResponse.verify|verify} messages. + * @param message MoveInstanceResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.instance.v1.IMoveInstanceResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MoveInstanceResponse message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.MoveInstanceResponse.verify|verify} messages. + * @param message MoveInstanceResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.instance.v1.IMoveInstanceResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MoveInstanceResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MoveInstanceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.MoveInstanceResponse; + + /** + * Decodes a MoveInstanceResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MoveInstanceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.MoveInstanceResponse; + + /** + * Verifies a MoveInstanceResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MoveInstanceResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MoveInstanceResponse + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.MoveInstanceResponse; + + /** + * Creates a plain object from a MoveInstanceResponse message. Also converts values to other types if specified. + * @param message MoveInstanceResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.instance.v1.MoveInstanceResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MoveInstanceResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MoveInstanceResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MoveInstanceMetadata. */ + interface IMoveInstanceMetadata { + + /** MoveInstanceMetadata targetConfig */ + targetConfig?: (string|null); + + /** MoveInstanceMetadata progress */ + progress?: (google.spanner.admin.instance.v1.IOperationProgress|null); + + /** MoveInstanceMetadata cancelTime */ + cancelTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a MoveInstanceMetadata. */ + class MoveInstanceMetadata implements IMoveInstanceMetadata { + + /** + * Constructs a new MoveInstanceMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.instance.v1.IMoveInstanceMetadata); + + /** MoveInstanceMetadata targetConfig. */ + public targetConfig: string; + + /** MoveInstanceMetadata progress. */ + public progress?: (google.spanner.admin.instance.v1.IOperationProgress|null); + + /** MoveInstanceMetadata cancelTime. */ + public cancelTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new MoveInstanceMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns MoveInstanceMetadata instance + */ + public static create(properties?: google.spanner.admin.instance.v1.IMoveInstanceMetadata): google.spanner.admin.instance.v1.MoveInstanceMetadata; + + /** + * Encodes the specified MoveInstanceMetadata message. Does not implicitly {@link google.spanner.admin.instance.v1.MoveInstanceMetadata.verify|verify} messages. + * @param message MoveInstanceMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.instance.v1.IMoveInstanceMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MoveInstanceMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.MoveInstanceMetadata.verify|verify} messages. + * @param message MoveInstanceMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.instance.v1.IMoveInstanceMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MoveInstanceMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MoveInstanceMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.MoveInstanceMetadata; + + /** + * Decodes a MoveInstanceMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MoveInstanceMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.MoveInstanceMetadata; + + /** + * Verifies a MoveInstanceMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MoveInstanceMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MoveInstanceMetadata + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.MoveInstanceMetadata; + + /** + * Creates a plain object from a MoveInstanceMetadata message. Also converts values to other types if specified. + * @param message MoveInstanceMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.instance.v1.MoveInstanceMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MoveInstanceMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MoveInstanceMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + } + } + + /** Namespace api. */ + namespace api { + + /** FieldBehavior enum. */ + enum FieldBehavior { + FIELD_BEHAVIOR_UNSPECIFIED = 0, + OPTIONAL = 1, + REQUIRED = 2, + OUTPUT_ONLY = 3, + INPUT_ONLY = 4, + IMMUTABLE = 5, + UNORDERED_LIST = 6, + NON_EMPTY_DEFAULT = 7, + IDENTIFIER = 8 + } + + /** Properties of a ResourceDescriptor. */ + interface IResourceDescriptor { + + /** ResourceDescriptor type */ + type?: (string|null); + + /** ResourceDescriptor pattern */ + pattern?: (string[]|null); + + /** ResourceDescriptor nameField */ + nameField?: (string|null); + + /** ResourceDescriptor history */ + history?: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History|null); + + /** ResourceDescriptor plural */ + plural?: (string|null); + + /** ResourceDescriptor singular */ + singular?: (string|null); + + /** ResourceDescriptor style */ + style?: (google.api.ResourceDescriptor.Style[]|null); + } + + /** Represents a ResourceDescriptor. */ + class ResourceDescriptor implements IResourceDescriptor { + + /** + * Constructs a new ResourceDescriptor. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceDescriptor); + + /** ResourceDescriptor type. */ + public type: string; + + /** ResourceDescriptor pattern. */ + public pattern: string[]; + + /** ResourceDescriptor nameField. */ + public nameField: string; + + /** ResourceDescriptor history. */ + public history: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History); + + /** ResourceDescriptor plural. */ + public plural: string; + + /** ResourceDescriptor singular. */ + public singular: string; + + /** ResourceDescriptor style. */ + public style: google.api.ResourceDescriptor.Style[]; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceDescriptor instance + */ + public static create(properties?: google.api.IResourceDescriptor): google.api.ResourceDescriptor; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceDescriptor; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceDescriptor; + + /** + * Verifies a ResourceDescriptor message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceDescriptor + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceDescriptor; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @param message ResourceDescriptor + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceDescriptor to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceDescriptor + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ResourceDescriptor { + + /** History enum. */ + enum History { + HISTORY_UNSPECIFIED = 0, + ORIGINALLY_SINGLE_PATTERN = 1, + FUTURE_MULTI_PATTERN = 2 + } + + /** Style enum. */ + enum Style { + STYLE_UNSPECIFIED = 0, + DECLARATIVE_FRIENDLY = 1 + } + } + + /** Properties of a ResourceReference. */ + interface IResourceReference { + + /** ResourceReference type */ + type?: (string|null); + + /** ResourceReference childType */ + childType?: (string|null); + } + + /** Represents a ResourceReference. */ + class ResourceReference implements IResourceReference { + + /** + * Constructs a new ResourceReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceReference); + + /** ResourceReference type. */ + public type: string; + + /** ResourceReference childType. */ + public childType: string; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceReference instance + */ + public static create(properties?: google.api.IResourceReference): google.api.ResourceReference; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceReference; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceReference; + + /** + * Verifies a ResourceReference message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceReference + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceReference; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @param message ResourceReference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceReference + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Http. */ + interface IHttp { + + /** Http rules */ + rules?: (google.api.IHttpRule[]|null); + + /** Http fullyDecodeReservedExpansion */ + fullyDecodeReservedExpansion?: (boolean|null); + } + + /** Represents a Http. */ + class Http implements IHttp { + + /** + * Constructs a new Http. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttp); + + /** Http rules. */ + public rules: google.api.IHttpRule[]; + + /** Http fullyDecodeReservedExpansion. */ + public fullyDecodeReservedExpansion: boolean; + + /** + * Creates a new Http instance using the specified properties. + * @param [properties] Properties to set + * @returns Http instance + */ + public static create(properties?: google.api.IHttp): google.api.Http; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Http message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Http; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Http; + + /** + * Verifies a Http message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Http + */ + public static fromObject(object: { [k: string]: any }): google.api.Http; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @param message Http + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Http to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Http + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a HttpRule. */ + interface IHttpRule { + + /** HttpRule selector */ + selector?: (string|null); + + /** HttpRule get */ + get?: (string|null); + + /** HttpRule put */ + put?: (string|null); + + /** HttpRule post */ + post?: (string|null); + + /** HttpRule delete */ + "delete"?: (string|null); + + /** HttpRule patch */ + patch?: (string|null); + + /** HttpRule custom */ + custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body */ + body?: (string|null); + + /** HttpRule responseBody */ + responseBody?: (string|null); + + /** HttpRule additionalBindings */ + additionalBindings?: (google.api.IHttpRule[]|null); + } + + /** Represents a HttpRule. */ + class HttpRule implements IHttpRule { + + /** + * Constructs a new HttpRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttpRule); + + /** HttpRule selector. */ + public selector: string; + + /** HttpRule get. */ + public get?: (string|null); + + /** HttpRule put. */ + public put?: (string|null); + + /** HttpRule post. */ + public post?: (string|null); + + /** HttpRule delete. */ + public delete?: (string|null); + + /** HttpRule patch. */ + public patch?: (string|null); + + /** HttpRule custom. */ + public custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body. */ + public body: string; + + /** HttpRule responseBody. */ + public responseBody: string; + + /** HttpRule additionalBindings. */ + public additionalBindings: google.api.IHttpRule[]; + + /** HttpRule pattern. */ + public pattern?: ("get"|"put"|"post"|"delete"|"patch"|"custom"); + + /** + * Creates a new HttpRule instance using the specified properties. + * @param [properties] Properties to set + * @returns HttpRule instance + */ + public static create(properties?: google.api.IHttpRule): google.api.HttpRule; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.HttpRule; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.HttpRule; + + /** + * Verifies a HttpRule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HttpRule + */ + public static fromObject(object: { [k: string]: any }): google.api.HttpRule; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @param message HttpRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.HttpRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HttpRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HttpRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomHttpPattern. */ + interface ICustomHttpPattern { + + /** CustomHttpPattern kind */ + kind?: (string|null); + + /** CustomHttpPattern path */ + path?: (string|null); + } + + /** Represents a CustomHttpPattern. */ + class CustomHttpPattern implements ICustomHttpPattern { + + /** + * Constructs a new CustomHttpPattern. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICustomHttpPattern); + + /** CustomHttpPattern kind. */ + public kind: string; + + /** CustomHttpPattern path. */ + public path: string; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomHttpPattern instance + */ + public static create(properties?: google.api.ICustomHttpPattern): google.api.CustomHttpPattern; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CustomHttpPattern; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CustomHttpPattern; + + /** + * Verifies a CustomHttpPattern message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomHttpPattern + */ + public static fromObject(object: { [k: string]: any }): google.api.CustomHttpPattern; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @param message CustomHttpPattern + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CustomHttpPattern, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomHttpPattern to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomHttpPattern + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CommonLanguageSettings. */ + interface ICommonLanguageSettings { + + /** CommonLanguageSettings referenceDocsUri */ + referenceDocsUri?: (string|null); + + /** CommonLanguageSettings destinations */ + destinations?: (google.api.ClientLibraryDestination[]|null); + } + + /** Represents a CommonLanguageSettings. */ + class CommonLanguageSettings implements ICommonLanguageSettings { + + /** + * Constructs a new CommonLanguageSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICommonLanguageSettings); + + /** CommonLanguageSettings referenceDocsUri. */ + public referenceDocsUri: string; + + /** CommonLanguageSettings destinations. */ + public destinations: google.api.ClientLibraryDestination[]; + + /** + * Creates a new CommonLanguageSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns CommonLanguageSettings instance + */ + public static create(properties?: google.api.ICommonLanguageSettings): google.api.CommonLanguageSettings; + + /** + * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @param message CommonLanguageSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @param message CommonLanguageSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CommonLanguageSettings; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CommonLanguageSettings; + + /** + * Verifies a CommonLanguageSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CommonLanguageSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.CommonLanguageSettings; + + /** + * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. + * @param message CommonLanguageSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CommonLanguageSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CommonLanguageSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CommonLanguageSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ClientLibrarySettings. */ + interface IClientLibrarySettings { + + /** ClientLibrarySettings version */ + version?: (string|null); + + /** ClientLibrarySettings launchStage */ + launchStage?: (google.api.LaunchStage|keyof typeof google.api.LaunchStage|null); + + /** ClientLibrarySettings restNumericEnums */ + restNumericEnums?: (boolean|null); + + /** ClientLibrarySettings javaSettings */ + javaSettings?: (google.api.IJavaSettings|null); + + /** ClientLibrarySettings cppSettings */ + cppSettings?: (google.api.ICppSettings|null); + + /** ClientLibrarySettings phpSettings */ + phpSettings?: (google.api.IPhpSettings|null); + + /** ClientLibrarySettings pythonSettings */ + pythonSettings?: (google.api.IPythonSettings|null); + + /** ClientLibrarySettings nodeSettings */ + nodeSettings?: (google.api.INodeSettings|null); + + /** ClientLibrarySettings dotnetSettings */ + dotnetSettings?: (google.api.IDotnetSettings|null); + + /** ClientLibrarySettings rubySettings */ + rubySettings?: (google.api.IRubySettings|null); + + /** ClientLibrarySettings goSettings */ + goSettings?: (google.api.IGoSettings|null); + } + + /** Represents a ClientLibrarySettings. */ + class ClientLibrarySettings implements IClientLibrarySettings { + + /** + * Constructs a new ClientLibrarySettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IClientLibrarySettings); + + /** ClientLibrarySettings version. */ + public version: string; + + /** ClientLibrarySettings launchStage. */ + public launchStage: (google.api.LaunchStage|keyof typeof google.api.LaunchStage); + + /** ClientLibrarySettings restNumericEnums. */ + public restNumericEnums: boolean; + + /** ClientLibrarySettings javaSettings. */ + public javaSettings?: (google.api.IJavaSettings|null); + + /** ClientLibrarySettings cppSettings. */ + public cppSettings?: (google.api.ICppSettings|null); + + /** ClientLibrarySettings phpSettings. */ + public phpSettings?: (google.api.IPhpSettings|null); + + /** ClientLibrarySettings pythonSettings. */ + public pythonSettings?: (google.api.IPythonSettings|null); + + /** ClientLibrarySettings nodeSettings. */ + public nodeSettings?: (google.api.INodeSettings|null); + + /** ClientLibrarySettings dotnetSettings. */ + public dotnetSettings?: (google.api.IDotnetSettings|null); + + /** ClientLibrarySettings rubySettings. */ + public rubySettings?: (google.api.IRubySettings|null); + + /** ClientLibrarySettings goSettings. */ + public goSettings?: (google.api.IGoSettings|null); + + /** + * Creates a new ClientLibrarySettings instance using the specified properties. + * @param [properties] Properties to set + * @returns ClientLibrarySettings instance + */ + public static create(properties?: google.api.IClientLibrarySettings): google.api.ClientLibrarySettings; + + /** + * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @param message ClientLibrarySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @param message ClientLibrarySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ClientLibrarySettings; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ClientLibrarySettings; + + /** + * Verifies a ClientLibrarySettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClientLibrarySettings + */ + public static fromObject(object: { [k: string]: any }): google.api.ClientLibrarySettings; + + /** + * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. + * @param message ClientLibrarySettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ClientLibrarySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClientLibrarySettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClientLibrarySettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Publishing. */ + interface IPublishing { + + /** Publishing methodSettings */ + methodSettings?: (google.api.IMethodSettings[]|null); + + /** Publishing newIssueUri */ + newIssueUri?: (string|null); + + /** Publishing documentationUri */ + documentationUri?: (string|null); + + /** Publishing apiShortName */ + apiShortName?: (string|null); + + /** Publishing githubLabel */ + githubLabel?: (string|null); + + /** Publishing codeownerGithubTeams */ + codeownerGithubTeams?: (string[]|null); + + /** Publishing docTagPrefix */ + docTagPrefix?: (string|null); + + /** Publishing organization */ + organization?: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization|null); + + /** Publishing librarySettings */ + librarySettings?: (google.api.IClientLibrarySettings[]|null); + + /** Publishing protoReferenceDocumentationUri */ + protoReferenceDocumentationUri?: (string|null); + + /** Publishing restReferenceDocumentationUri */ + restReferenceDocumentationUri?: (string|null); + } + + /** Represents a Publishing. */ + class Publishing implements IPublishing { + + /** + * Constructs a new Publishing. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPublishing); + + /** Publishing methodSettings. */ + public methodSettings: google.api.IMethodSettings[]; + + /** Publishing newIssueUri. */ + public newIssueUri: string; + + /** Publishing documentationUri. */ + public documentationUri: string; + + /** Publishing apiShortName. */ + public apiShortName: string; + + /** Publishing githubLabel. */ + public githubLabel: string; + + /** Publishing codeownerGithubTeams. */ + public codeownerGithubTeams: string[]; + + /** Publishing docTagPrefix. */ + public docTagPrefix: string; + + /** Publishing organization. */ + public organization: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization); + + /** Publishing librarySettings. */ + public librarySettings: google.api.IClientLibrarySettings[]; + + /** Publishing protoReferenceDocumentationUri. */ + public protoReferenceDocumentationUri: string; + + /** Publishing restReferenceDocumentationUri. */ + public restReferenceDocumentationUri: string; + + /** + * Creates a new Publishing instance using the specified properties. + * @param [properties] Properties to set + * @returns Publishing instance + */ + public static create(properties?: google.api.IPublishing): google.api.Publishing; + + /** + * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @param message Publishing message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @param message Publishing message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Publishing message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Publishing; + + /** + * Decodes a Publishing message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Publishing; + + /** + * Verifies a Publishing message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Publishing message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Publishing + */ + public static fromObject(object: { [k: string]: any }): google.api.Publishing; + + /** + * Creates a plain object from a Publishing message. Also converts values to other types if specified. + * @param message Publishing + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Publishing, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Publishing to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Publishing + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a JavaSettings. */ + interface IJavaSettings { + + /** JavaSettings libraryPackage */ + libraryPackage?: (string|null); + + /** JavaSettings serviceClassNames */ + serviceClassNames?: ({ [k: string]: string }|null); + + /** JavaSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a JavaSettings. */ + class JavaSettings implements IJavaSettings { + + /** + * Constructs a new JavaSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IJavaSettings); + + /** JavaSettings libraryPackage. */ + public libraryPackage: string; + + /** JavaSettings serviceClassNames. */ + public serviceClassNames: { [k: string]: string }; + + /** JavaSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new JavaSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns JavaSettings instance + */ + public static create(properties?: google.api.IJavaSettings): google.api.JavaSettings; + + /** + * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @param message JavaSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @param message JavaSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JavaSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.JavaSettings; + + /** + * Decodes a JavaSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.JavaSettings; + + /** + * Verifies a JavaSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JavaSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.JavaSettings; + + /** + * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. + * @param message JavaSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.JavaSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JavaSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JavaSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CppSettings. */ + interface ICppSettings { + + /** CppSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a CppSettings. */ + class CppSettings implements ICppSettings { + + /** + * Constructs a new CppSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICppSettings); + + /** CppSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new CppSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns CppSettings instance + */ + public static create(properties?: google.api.ICppSettings): google.api.CppSettings; + + /** + * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @param message CppSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @param message CppSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CppSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CppSettings; + + /** + * Decodes a CppSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CppSettings; + + /** + * Verifies a CppSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CppSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.CppSettings; + + /** + * Creates a plain object from a CppSettings message. Also converts values to other types if specified. + * @param message CppSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CppSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CppSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CppSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PhpSettings. */ + interface IPhpSettings { + + /** PhpSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a PhpSettings. */ + class PhpSettings implements IPhpSettings { + + /** + * Constructs a new PhpSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPhpSettings); + + /** PhpSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new PhpSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns PhpSettings instance + */ + public static create(properties?: google.api.IPhpSettings): google.api.PhpSettings; + + /** + * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @param message PhpSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @param message PhpSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PhpSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PhpSettings; + + /** + * Decodes a PhpSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PhpSettings; + + /** + * Verifies a PhpSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PhpSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.PhpSettings; + + /** + * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. + * @param message PhpSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PhpSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PhpSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PhpSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PythonSettings. */ + interface IPythonSettings { + + /** PythonSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a PythonSettings. */ + class PythonSettings implements IPythonSettings { + + /** + * Constructs a new PythonSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPythonSettings); + + /** PythonSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new PythonSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns PythonSettings instance + */ + public static create(properties?: google.api.IPythonSettings): google.api.PythonSettings; + + /** + * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @param message PythonSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @param message PythonSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PythonSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PythonSettings; + + /** + * Decodes a PythonSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PythonSettings; + + /** + * Verifies a PythonSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PythonSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.PythonSettings; + + /** + * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. + * @param message PythonSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PythonSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PythonSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PythonSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeSettings. */ + interface INodeSettings { + + /** NodeSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a NodeSettings. */ + class NodeSettings implements INodeSettings { + + /** + * Constructs a new NodeSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.INodeSettings); + + /** NodeSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new NodeSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeSettings instance + */ + public static create(properties?: google.api.INodeSettings): google.api.NodeSettings; + + /** + * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @param message NodeSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @param message NodeSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.NodeSettings; + + /** + * Decodes a NodeSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.NodeSettings; + + /** + * Verifies a NodeSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NodeSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.NodeSettings; + + /** + * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. + * @param message NodeSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.NodeSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NodeSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NodeSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DotnetSettings. */ + interface IDotnetSettings { + + /** DotnetSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + + /** DotnetSettings renamedServices */ + renamedServices?: ({ [k: string]: string }|null); + + /** DotnetSettings renamedResources */ + renamedResources?: ({ [k: string]: string }|null); + + /** DotnetSettings ignoredResources */ + ignoredResources?: (string[]|null); + + /** DotnetSettings forcedNamespaceAliases */ + forcedNamespaceAliases?: (string[]|null); + + /** DotnetSettings handwrittenSignatures */ + handwrittenSignatures?: (string[]|null); + } + + /** Represents a DotnetSettings. */ + class DotnetSettings implements IDotnetSettings { + + /** + * Constructs a new DotnetSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IDotnetSettings); + + /** DotnetSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** DotnetSettings renamedServices. */ + public renamedServices: { [k: string]: string }; + + /** DotnetSettings renamedResources. */ + public renamedResources: { [k: string]: string }; + + /** DotnetSettings ignoredResources. */ + public ignoredResources: string[]; + + /** DotnetSettings forcedNamespaceAliases. */ + public forcedNamespaceAliases: string[]; + + /** DotnetSettings handwrittenSignatures. */ + public handwrittenSignatures: string[]; + + /** + * Creates a new DotnetSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns DotnetSettings instance + */ + public static create(properties?: google.api.IDotnetSettings): google.api.DotnetSettings; + + /** + * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @param message DotnetSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @param message DotnetSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.DotnetSettings; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.DotnetSettings; + + /** + * Verifies a DotnetSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DotnetSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.DotnetSettings; + + /** + * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. + * @param message DotnetSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.DotnetSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DotnetSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DotnetSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RubySettings. */ + interface IRubySettings { + + /** RubySettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a RubySettings. */ + class RubySettings implements IRubySettings { + + /** + * Constructs a new RubySettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IRubySettings); + + /** RubySettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new RubySettings instance using the specified properties. + * @param [properties] Properties to set + * @returns RubySettings instance + */ + public static create(properties?: google.api.IRubySettings): google.api.RubySettings; + + /** + * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @param message RubySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @param message RubySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RubySettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.RubySettings; + + /** + * Decodes a RubySettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.RubySettings; + + /** + * Verifies a RubySettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RubySettings + */ + public static fromObject(object: { [k: string]: any }): google.api.RubySettings; + + /** + * Creates a plain object from a RubySettings message. Also converts values to other types if specified. + * @param message RubySettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.RubySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RubySettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RubySettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GoSettings. */ + interface IGoSettings { + + /** GoSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a GoSettings. */ + class GoSettings implements IGoSettings { + + /** + * Constructs a new GoSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IGoSettings); + + /** GoSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new GoSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns GoSettings instance + */ + public static create(properties?: google.api.IGoSettings): google.api.GoSettings; + + /** + * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @param message GoSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @param message GoSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GoSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.GoSettings; + + /** + * Decodes a GoSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.GoSettings; + + /** + * Verifies a GoSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GoSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.GoSettings; + + /** + * Creates a plain object from a GoSettings message. Also converts values to other types if specified. + * @param message GoSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.GoSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GoSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GoSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodSettings. */ + interface IMethodSettings { + + /** MethodSettings selector */ + selector?: (string|null); + + /** MethodSettings longRunning */ + longRunning?: (google.api.MethodSettings.ILongRunning|null); + + /** MethodSettings autoPopulatedFields */ + autoPopulatedFields?: (string[]|null); + } + + /** Represents a MethodSettings. */ + class MethodSettings implements IMethodSettings { + + /** + * Constructs a new MethodSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IMethodSettings); + + /** MethodSettings selector. */ + public selector: string; + + /** MethodSettings longRunning. */ + public longRunning?: (google.api.MethodSettings.ILongRunning|null); + + /** MethodSettings autoPopulatedFields. */ + public autoPopulatedFields: string[]; + + /** + * Creates a new MethodSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodSettings instance + */ + public static create(properties?: google.api.IMethodSettings): google.api.MethodSettings; + + /** + * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @param message MethodSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @param message MethodSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.MethodSettings; + + /** + * Decodes a MethodSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.MethodSettings; + + /** + * Verifies a MethodSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.MethodSettings; + + /** + * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. + * @param message MethodSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.MethodSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MethodSettings { + + /** Properties of a LongRunning. */ + interface ILongRunning { + + /** LongRunning initialPollDelay */ + initialPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning pollDelayMultiplier */ + pollDelayMultiplier?: (number|null); + + /** LongRunning maxPollDelay */ + maxPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning totalPollTimeout */ + totalPollTimeout?: (google.protobuf.IDuration|null); + } + + /** Represents a LongRunning. */ + class LongRunning implements ILongRunning { + + /** + * Constructs a new LongRunning. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.MethodSettings.ILongRunning); + + /** LongRunning initialPollDelay. */ + public initialPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning pollDelayMultiplier. */ + public pollDelayMultiplier: number; + + /** LongRunning maxPollDelay. */ + public maxPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning totalPollTimeout. */ + public totalPollTimeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new LongRunning instance using the specified properties. + * @param [properties] Properties to set + * @returns LongRunning instance + */ + public static create(properties?: google.api.MethodSettings.ILongRunning): google.api.MethodSettings.LongRunning; + + /** + * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @param message LongRunning message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @param message LongRunning message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LongRunning message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.MethodSettings.LongRunning; + + /** + * Decodes a LongRunning message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.MethodSettings.LongRunning; + + /** + * Verifies a LongRunning message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LongRunning + */ + public static fromObject(object: { [k: string]: any }): google.api.MethodSettings.LongRunning; + + /** + * Creates a plain object from a LongRunning message. Also converts values to other types if specified. + * @param message LongRunning + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.MethodSettings.LongRunning, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LongRunning to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LongRunning + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** ClientLibraryOrganization enum. */ + enum ClientLibraryOrganization { + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0, + CLOUD = 1, + ADS = 2, + PHOTOS = 3, + STREET_VIEW = 4, + SHOPPING = 5, + GEO = 6, + GENERATIVE_AI = 7 + } + + /** ClientLibraryDestination enum. */ + enum ClientLibraryDestination { + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0, + GITHUB = 10, + PACKAGE_MANAGER = 20 + } + + /** LaunchStage enum. */ + enum LaunchStage { + LAUNCH_STAGE_UNSPECIFIED = 0, + UNIMPLEMENTED = 6, + PRELAUNCH = 7, + EARLY_ACCESS = 1, + ALPHA = 2, + BETA = 3, + GA = 4, + DEPRECATED = 5 + } + } + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a FileDescriptorSet. */ + interface IFileDescriptorSet { + + /** FileDescriptorSet file */ + file?: (google.protobuf.IFileDescriptorProto[]|null); + } + + /** Represents a FileDescriptorSet. */ + class FileDescriptorSet implements IFileDescriptorSet { + + /** + * Constructs a new FileDescriptorSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorSet); + + /** FileDescriptorSet file. */ + public file: google.protobuf.IFileDescriptorProto[]; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorSet instance + */ + public static create(properties?: google.protobuf.IFileDescriptorSet): google.protobuf.FileDescriptorSet; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorSet; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorSet; + + /** + * Verifies a FileDescriptorSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorSet + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorSet; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @param message FileDescriptorSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileDescriptorSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Edition enum. */ + enum Edition { + EDITION_UNKNOWN = 0, + EDITION_PROTO2 = 998, + EDITION_PROTO3 = 999, + EDITION_2023 = 1000, + EDITION_2024 = 1001, + EDITION_1_TEST_ONLY = 1, + EDITION_2_TEST_ONLY = 2, + EDITION_99997_TEST_ONLY = 99997, + EDITION_99998_TEST_ONLY = 99998, + EDITION_99999_TEST_ONLY = 99999, + EDITION_MAX = 2147483647 + } + + /** Properties of a FileDescriptorProto. */ + interface IFileDescriptorProto { + + /** FileDescriptorProto name */ + name?: (string|null); + + /** FileDescriptorProto package */ + "package"?: (string|null); + + /** FileDescriptorProto dependency */ + dependency?: (string[]|null); + + /** FileDescriptorProto publicDependency */ + publicDependency?: (number[]|null); + + /** FileDescriptorProto weakDependency */ + weakDependency?: (number[]|null); + + /** FileDescriptorProto messageType */ + messageType?: (google.protobuf.IDescriptorProto[]|null); + + /** FileDescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** FileDescriptorProto service */ + service?: (google.protobuf.IServiceDescriptorProto[]|null); + + /** FileDescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** FileDescriptorProto options */ + options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo */ + sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax */ + syntax?: (string|null); + + /** FileDescriptorProto edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + } + + /** Represents a FileDescriptorProto. */ + class FileDescriptorProto implements IFileDescriptorProto { + + /** + * Constructs a new FileDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorProto); + + /** FileDescriptorProto name. */ + public name: string; + + /** FileDescriptorProto package. */ + public package: string; + + /** FileDescriptorProto dependency. */ + public dependency: string[]; + + /** FileDescriptorProto publicDependency. */ + public publicDependency: number[]; + + /** FileDescriptorProto weakDependency. */ + public weakDependency: number[]; + + /** FileDescriptorProto messageType. */ + public messageType: google.protobuf.IDescriptorProto[]; + + /** FileDescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** FileDescriptorProto service. */ + public service: google.protobuf.IServiceDescriptorProto[]; + + /** FileDescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** FileDescriptorProto options. */ + public options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo. */ + public sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax. */ + public syntax: string; + + /** FileDescriptorProto edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFileDescriptorProto): google.protobuf.FileDescriptorProto; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorProto; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorProto; + + /** + * Verifies a FileDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorProto; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @param message FileDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DescriptorProto. */ + interface IDescriptorProto { + + /** DescriptorProto name */ + name?: (string|null); + + /** DescriptorProto field */ + field?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto nestedType */ + nestedType?: (google.protobuf.IDescriptorProto[]|null); + + /** DescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** DescriptorProto extensionRange */ + extensionRange?: (google.protobuf.DescriptorProto.IExtensionRange[]|null); + + /** DescriptorProto oneofDecl */ + oneofDecl?: (google.protobuf.IOneofDescriptorProto[]|null); + + /** DescriptorProto options */ + options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange */ + reservedRange?: (google.protobuf.DescriptorProto.IReservedRange[]|null); + + /** DescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents a DescriptorProto. */ + class DescriptorProto implements IDescriptorProto { + + /** + * Constructs a new DescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDescriptorProto); + + /** DescriptorProto name. */ + public name: string; + + /** DescriptorProto field. */ + public field: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto nestedType. */ + public nestedType: google.protobuf.IDescriptorProto[]; + + /** DescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** DescriptorProto extensionRange. */ + public extensionRange: google.protobuf.DescriptorProto.IExtensionRange[]; + + /** DescriptorProto oneofDecl. */ + public oneofDecl: google.protobuf.IOneofDescriptorProto[]; + + /** DescriptorProto options. */ + public options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange. */ + public reservedRange: google.protobuf.DescriptorProto.IReservedRange[]; + + /** DescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns DescriptorProto instance + */ + public static create(properties?: google.protobuf.IDescriptorProto): google.protobuf.DescriptorProto; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto; + + /** + * Verifies a DescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @param message DescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DescriptorProto { + + /** Properties of an ExtensionRange. */ + interface IExtensionRange { + + /** ExtensionRange start */ + start?: (number|null); + + /** ExtensionRange end */ + end?: (number|null); + + /** ExtensionRange options */ + options?: (google.protobuf.IExtensionRangeOptions|null); + } + + /** Represents an ExtensionRange. */ + class ExtensionRange implements IExtensionRange { + + /** + * Constructs a new ExtensionRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange); + + /** ExtensionRange start. */ + public start: number; + + /** ExtensionRange end. */ + public end: number; + + /** ExtensionRange options. */ + public options?: (google.protobuf.IExtensionRangeOptions|null); + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IExtensionRange): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Verifies an ExtensionRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @param message ExtensionRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ExtensionRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtensionRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReservedRange. */ + interface IReservedRange { + + /** ReservedRange start */ + start?: (number|null); + + /** ReservedRange end */ + end?: (number|null); + } + + /** Represents a ReservedRange. */ + class ReservedRange implements IReservedRange { + + /** + * Constructs a new ReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IReservedRange); + + /** ReservedRange start. */ + public start: number; + + /** ReservedRange end. */ + public end: number; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ReservedRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IReservedRange): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Verifies a ReservedRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @param message ReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ExtensionRangeOptions. */ + interface IExtensionRangeOptions { + + /** ExtensionRangeOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** ExtensionRangeOptions declaration */ + declaration?: (google.protobuf.ExtensionRangeOptions.IDeclaration[]|null); + + /** ExtensionRangeOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** ExtensionRangeOptions verification */ + verification?: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState|null); + } + + /** Represents an ExtensionRangeOptions. */ + class ExtensionRangeOptions implements IExtensionRangeOptions { + + /** + * Constructs a new ExtensionRangeOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IExtensionRangeOptions); + + /** ExtensionRangeOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** ExtensionRangeOptions declaration. */ + public declaration: google.protobuf.ExtensionRangeOptions.IDeclaration[]; + + /** ExtensionRangeOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** ExtensionRangeOptions verification. */ + public verification: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState); + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRangeOptions instance + */ + public static create(properties?: google.protobuf.IExtensionRangeOptions): google.protobuf.ExtensionRangeOptions; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions; + + /** + * Verifies an ExtensionRangeOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRangeOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @param message ExtensionRangeOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ExtensionRangeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ExtensionRangeOptions { + + /** Properties of a Declaration. */ + interface IDeclaration { + + /** Declaration number */ + number?: (number|null); + + /** Declaration fullName */ + fullName?: (string|null); + + /** Declaration type */ + type?: (string|null); + + /** Declaration reserved */ + reserved?: (boolean|null); + + /** Declaration repeated */ + repeated?: (boolean|null); + } + + /** Represents a Declaration. */ + class Declaration implements IDeclaration { + + /** + * Constructs a new Declaration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration); + + /** Declaration number. */ + public number: number; + + /** Declaration fullName. */ + public fullName: string; + + /** Declaration type. */ + public type: string; + + /** Declaration reserved. */ + public reserved: boolean; + + /** Declaration repeated. */ + public repeated: boolean; + + /** + * Creates a new Declaration instance using the specified properties. + * @param [properties] Properties to set + * @returns Declaration instance + */ + public static create(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @param message Declaration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @param message Declaration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Declaration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Decodes a Declaration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Verifies a Declaration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Declaration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Declaration + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Creates a plain object from a Declaration message. Also converts values to other types if specified. + * @param message Declaration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ExtensionRangeOptions.Declaration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Declaration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Declaration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** VerificationState enum. */ + enum VerificationState { + DECLARATION = 0, + UNVERIFIED = 1 + } + } + + /** Properties of a FieldDescriptorProto. */ + interface IFieldDescriptorProto { + + /** FieldDescriptorProto name */ + name?: (string|null); + + /** FieldDescriptorProto number */ + number?: (number|null); + + /** FieldDescriptorProto label */ + label?: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label|null); + + /** FieldDescriptorProto type */ + type?: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type|null); + + /** FieldDescriptorProto typeName */ + typeName?: (string|null); + + /** FieldDescriptorProto extendee */ + extendee?: (string|null); + + /** FieldDescriptorProto defaultValue */ + defaultValue?: (string|null); + + /** FieldDescriptorProto oneofIndex */ + oneofIndex?: (number|null); + + /** FieldDescriptorProto jsonName */ + jsonName?: (string|null); + + /** FieldDescriptorProto options */ + options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional */ + proto3Optional?: (boolean|null); + } + + /** Represents a FieldDescriptorProto. */ + class FieldDescriptorProto implements IFieldDescriptorProto { + + /** + * Constructs a new FieldDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldDescriptorProto); + + /** FieldDescriptorProto name. */ + public name: string; + + /** FieldDescriptorProto number. */ + public number: number; + + /** FieldDescriptorProto label. */ + public label: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label); + + /** FieldDescriptorProto type. */ + public type: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type); + + /** FieldDescriptorProto typeName. */ + public typeName: string; + + /** FieldDescriptorProto extendee. */ + public extendee: string; + + /** FieldDescriptorProto defaultValue. */ + public defaultValue: string; + + /** FieldDescriptorProto oneofIndex. */ + public oneofIndex: number; + + /** FieldDescriptorProto jsonName. */ + public jsonName: string; + + /** FieldDescriptorProto options. */ + public options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional. */ + public proto3Optional: boolean; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFieldDescriptorProto): google.protobuf.FieldDescriptorProto; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldDescriptorProto; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldDescriptorProto; + + /** + * Verifies a FieldDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @param message FieldDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldDescriptorProto { + + /** Type enum. */ + enum Type { + TYPE_DOUBLE = 1, + TYPE_FLOAT = 2, + TYPE_INT64 = 3, + TYPE_UINT64 = 4, + TYPE_INT32 = 5, + TYPE_FIXED64 = 6, + TYPE_FIXED32 = 7, + TYPE_BOOL = 8, + TYPE_STRING = 9, + TYPE_GROUP = 10, + TYPE_MESSAGE = 11, + TYPE_BYTES = 12, + TYPE_UINT32 = 13, + TYPE_ENUM = 14, + TYPE_SFIXED32 = 15, + TYPE_SFIXED64 = 16, + TYPE_SINT32 = 17, + TYPE_SINT64 = 18 + } + + /** Label enum. */ + enum Label { + LABEL_OPTIONAL = 1, + LABEL_REPEATED = 3, + LABEL_REQUIRED = 2 + } + } + + /** Properties of an OneofDescriptorProto. */ + interface IOneofDescriptorProto { + + /** OneofDescriptorProto name */ + name?: (string|null); + + /** OneofDescriptorProto options */ + options?: (google.protobuf.IOneofOptions|null); + } + + /** Represents an OneofDescriptorProto. */ + class OneofDescriptorProto implements IOneofDescriptorProto { + + /** + * Constructs a new OneofDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofDescriptorProto); + + /** OneofDescriptorProto name. */ + public name: string; + + /** OneofDescriptorProto options. */ + public options?: (google.protobuf.IOneofOptions|null); + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofDescriptorProto instance + */ + public static create(properties?: google.protobuf.IOneofDescriptorProto): google.protobuf.OneofDescriptorProto; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofDescriptorProto; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofDescriptorProto; + + /** + * Verifies an OneofDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofDescriptorProto; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @param message OneofDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneofDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumDescriptorProto. */ + interface IEnumDescriptorProto { + + /** EnumDescriptorProto name */ + name?: (string|null); + + /** EnumDescriptorProto value */ + value?: (google.protobuf.IEnumValueDescriptorProto[]|null); + + /** EnumDescriptorProto options */ + options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange */ + reservedRange?: (google.protobuf.EnumDescriptorProto.IEnumReservedRange[]|null); + + /** EnumDescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents an EnumDescriptorProto. */ + class EnumDescriptorProto implements IEnumDescriptorProto { + + /** + * Constructs a new EnumDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumDescriptorProto); + + /** EnumDescriptorProto name. */ + public name: string; + + /** EnumDescriptorProto value. */ + public value: google.protobuf.IEnumValueDescriptorProto[]; + + /** EnumDescriptorProto options. */ + public options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange. */ + public reservedRange: google.protobuf.EnumDescriptorProto.IEnumReservedRange[]; + + /** EnumDescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumDescriptorProto): google.protobuf.EnumDescriptorProto; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto; + + /** + * Verifies an EnumDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @param message EnumDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EnumDescriptorProto { + + /** Properties of an EnumReservedRange. */ + interface IEnumReservedRange { + + /** EnumReservedRange start */ + start?: (number|null); + + /** EnumReservedRange end */ + end?: (number|null); + } + + /** Represents an EnumReservedRange. */ + class EnumReservedRange implements IEnumReservedRange { + + /** + * Constructs a new EnumReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange); + + /** EnumReservedRange start. */ + public start: number; + + /** EnumReservedRange end. */ + public end: number; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumReservedRange instance + */ + public static create(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Verifies an EnumReservedRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @param message EnumReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto.EnumReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an EnumValueDescriptorProto. */ + interface IEnumValueDescriptorProto { + + /** EnumValueDescriptorProto name */ + name?: (string|null); + + /** EnumValueDescriptorProto number */ + number?: (number|null); + + /** EnumValueDescriptorProto options */ + options?: (google.protobuf.IEnumValueOptions|null); + } + + /** Represents an EnumValueDescriptorProto. */ + class EnumValueDescriptorProto implements IEnumValueDescriptorProto { + + /** + * Constructs a new EnumValueDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueDescriptorProto); + + /** EnumValueDescriptorProto name. */ + public name: string; + + /** EnumValueDescriptorProto number. */ + public number: number; + + /** EnumValueDescriptorProto options. */ + public options?: (google.protobuf.IEnumValueOptions|null); + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumValueDescriptorProto): google.protobuf.EnumValueDescriptorProto; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueDescriptorProto; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueDescriptorProto; + + /** + * Verifies an EnumValueDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueDescriptorProto; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @param message EnumValueDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceDescriptorProto. */ + interface IServiceDescriptorProto { + + /** ServiceDescriptorProto name */ + name?: (string|null); + + /** ServiceDescriptorProto method */ + method?: (google.protobuf.IMethodDescriptorProto[]|null); + + /** ServiceDescriptorProto options */ + options?: (google.protobuf.IServiceOptions|null); + } + + /** Represents a ServiceDescriptorProto. */ + class ServiceDescriptorProto implements IServiceDescriptorProto { + + /** + * Constructs a new ServiceDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceDescriptorProto); + + /** ServiceDescriptorProto name. */ + public name: string; + + /** ServiceDescriptorProto method. */ + public method: google.protobuf.IMethodDescriptorProto[]; + + /** ServiceDescriptorProto options. */ + public options?: (google.protobuf.IServiceOptions|null); + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceDescriptorProto instance + */ + public static create(properties?: google.protobuf.IServiceDescriptorProto): google.protobuf.ServiceDescriptorProto; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceDescriptorProto; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceDescriptorProto; + + /** + * Verifies a ServiceDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceDescriptorProto; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @param message ServiceDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodDescriptorProto. */ + interface IMethodDescriptorProto { + + /** MethodDescriptorProto name */ + name?: (string|null); + + /** MethodDescriptorProto inputType */ + inputType?: (string|null); + + /** MethodDescriptorProto outputType */ + outputType?: (string|null); + + /** MethodDescriptorProto options */ + options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming */ + clientStreaming?: (boolean|null); + + /** MethodDescriptorProto serverStreaming */ + serverStreaming?: (boolean|null); + } + + /** Represents a MethodDescriptorProto. */ + class MethodDescriptorProto implements IMethodDescriptorProto { + + /** + * Constructs a new MethodDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodDescriptorProto); + + /** MethodDescriptorProto name. */ + public name: string; + + /** MethodDescriptorProto inputType. */ + public inputType: string; + + /** MethodDescriptorProto outputType. */ + public outputType: string; + + /** MethodDescriptorProto options. */ + public options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming. */ + public clientStreaming: boolean; + + /** MethodDescriptorProto serverStreaming. */ + public serverStreaming: boolean; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodDescriptorProto instance + */ + public static create(properties?: google.protobuf.IMethodDescriptorProto): google.protobuf.MethodDescriptorProto; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodDescriptorProto; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodDescriptorProto; + + /** + * Verifies a MethodDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodDescriptorProto; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @param message MethodDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileOptions. */ + interface IFileOptions { + + /** FileOptions javaPackage */ + javaPackage?: (string|null); + + /** FileOptions javaOuterClassname */ + javaOuterClassname?: (string|null); + + /** FileOptions javaMultipleFiles */ + javaMultipleFiles?: (boolean|null); + + /** FileOptions javaGenerateEqualsAndHash */ + javaGenerateEqualsAndHash?: (boolean|null); + + /** FileOptions javaStringCheckUtf8 */ + javaStringCheckUtf8?: (boolean|null); + + /** FileOptions optimizeFor */ + optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode|null); + + /** FileOptions goPackage */ + goPackage?: (string|null); + + /** FileOptions ccGenericServices */ + ccGenericServices?: (boolean|null); + + /** FileOptions javaGenericServices */ + javaGenericServices?: (boolean|null); + + /** FileOptions pyGenericServices */ + pyGenericServices?: (boolean|null); + + /** FileOptions deprecated */ + deprecated?: (boolean|null); + + /** FileOptions ccEnableArenas */ + ccEnableArenas?: (boolean|null); + + /** FileOptions objcClassPrefix */ + objcClassPrefix?: (string|null); + + /** FileOptions csharpNamespace */ + csharpNamespace?: (string|null); + + /** FileOptions swiftPrefix */ + swiftPrefix?: (string|null); + + /** FileOptions phpClassPrefix */ + phpClassPrefix?: (string|null); + + /** FileOptions phpNamespace */ + phpNamespace?: (string|null); + + /** FileOptions phpMetadataNamespace */ + phpMetadataNamespace?: (string|null); + + /** FileOptions rubyPackage */ + rubyPackage?: (string|null); + + /** FileOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** FileOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FileOptions .google.api.resourceDefinition */ + ".google.api.resourceDefinition"?: (google.api.IResourceDescriptor[]|null); + } + + /** Represents a FileOptions. */ + class FileOptions implements IFileOptions { + + /** + * Constructs a new FileOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileOptions); + + /** FileOptions javaPackage. */ + public javaPackage: string; + + /** FileOptions javaOuterClassname. */ + public javaOuterClassname: string; + + /** FileOptions javaMultipleFiles. */ + public javaMultipleFiles: boolean; + + /** FileOptions javaGenerateEqualsAndHash. */ + public javaGenerateEqualsAndHash: boolean; + + /** FileOptions javaStringCheckUtf8. */ + public javaStringCheckUtf8: boolean; + + /** FileOptions optimizeFor. */ + public optimizeFor: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode); + + /** FileOptions goPackage. */ + public goPackage: string; + + /** FileOptions ccGenericServices. */ + public ccGenericServices: boolean; + + /** FileOptions javaGenericServices. */ + public javaGenericServices: boolean; + + /** FileOptions pyGenericServices. */ + public pyGenericServices: boolean; + + /** FileOptions deprecated. */ + public deprecated: boolean; + + /** FileOptions ccEnableArenas. */ + public ccEnableArenas: boolean; + + /** FileOptions objcClassPrefix. */ + public objcClassPrefix: string; + + /** FileOptions csharpNamespace. */ + public csharpNamespace: string; + + /** FileOptions swiftPrefix. */ + public swiftPrefix: string; + + /** FileOptions phpClassPrefix. */ + public phpClassPrefix: string; + + /** FileOptions phpNamespace. */ + public phpNamespace: string; + + /** FileOptions phpMetadataNamespace. */ + public phpMetadataNamespace: string; + + /** FileOptions rubyPackage. */ + public rubyPackage: string; + + /** FileOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** FileOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FileOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FileOptions instance + */ + public static create(properties?: google.protobuf.IFileOptions): google.protobuf.FileOptions; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileOptions; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileOptions; + + /** + * Verifies a FileOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileOptions; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @param message FileOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FileOptions { + + /** OptimizeMode enum. */ + enum OptimizeMode { + SPEED = 1, + CODE_SIZE = 2, + LITE_RUNTIME = 3 + } + } + + /** Properties of a MessageOptions. */ + interface IMessageOptions { + + /** MessageOptions messageSetWireFormat */ + messageSetWireFormat?: (boolean|null); + + /** MessageOptions noStandardDescriptorAccessor */ + noStandardDescriptorAccessor?: (boolean|null); + + /** MessageOptions deprecated */ + deprecated?: (boolean|null); + + /** MessageOptions mapEntry */ + mapEntry?: (boolean|null); + + /** MessageOptions deprecatedLegacyJsonFieldConflicts */ + deprecatedLegacyJsonFieldConflicts?: (boolean|null); + + /** MessageOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** MessageOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MessageOptions .google.api.resource */ + ".google.api.resource"?: (google.api.IResourceDescriptor|null); + } + + /** Represents a MessageOptions. */ + class MessageOptions implements IMessageOptions { + + /** + * Constructs a new MessageOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMessageOptions); + + /** MessageOptions messageSetWireFormat. */ + public messageSetWireFormat: boolean; + + /** MessageOptions noStandardDescriptorAccessor. */ + public noStandardDescriptorAccessor: boolean; + + /** MessageOptions deprecated. */ + public deprecated: boolean; + + /** MessageOptions mapEntry. */ + public mapEntry: boolean; + + /** MessageOptions deprecatedLegacyJsonFieldConflicts. */ + public deprecatedLegacyJsonFieldConflicts: boolean; + + /** MessageOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** MessageOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MessageOptions instance + */ + public static create(properties?: google.protobuf.IMessageOptions): google.protobuf.MessageOptions; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MessageOptions; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MessageOptions; + + /** + * Verifies a MessageOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MessageOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MessageOptions; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @param message MessageOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MessageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MessageOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MessageOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldOptions. */ + interface IFieldOptions { + + /** FieldOptions ctype */ + ctype?: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType|null); + + /** FieldOptions packed */ + packed?: (boolean|null); + + /** FieldOptions jstype */ + jstype?: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType|null); + + /** FieldOptions lazy */ + lazy?: (boolean|null); + + /** FieldOptions unverifiedLazy */ + unverifiedLazy?: (boolean|null); + + /** FieldOptions deprecated */ + deprecated?: (boolean|null); + + /** FieldOptions weak */ + weak?: (boolean|null); + + /** FieldOptions debugRedact */ + debugRedact?: (boolean|null); + + /** FieldOptions retention */ + retention?: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention|null); + + /** FieldOptions targets */ + targets?: (google.protobuf.FieldOptions.OptionTargetType[]|null); + + /** FieldOptions editionDefaults */ + editionDefaults?: (google.protobuf.FieldOptions.IEditionDefault[]|null); + + /** FieldOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** FieldOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FieldOptions .google.api.fieldBehavior */ + ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); + + /** FieldOptions .google.api.resourceReference */ + ".google.api.resourceReference"?: (google.api.IResourceReference|null); + } + + /** Represents a FieldOptions. */ + class FieldOptions implements IFieldOptions { + + /** + * Constructs a new FieldOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldOptions); + + /** FieldOptions ctype. */ + public ctype: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType); + + /** FieldOptions packed. */ + public packed: boolean; + + /** FieldOptions jstype. */ + public jstype: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType); + + /** FieldOptions lazy. */ + public lazy: boolean; + + /** FieldOptions unverifiedLazy. */ + public unverifiedLazy: boolean; + + /** FieldOptions deprecated. */ + public deprecated: boolean; + + /** FieldOptions weak. */ + public weak: boolean; + + /** FieldOptions debugRedact. */ + public debugRedact: boolean; + + /** FieldOptions retention. */ + public retention: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention); + + /** FieldOptions targets. */ + public targets: google.protobuf.FieldOptions.OptionTargetType[]; + + /** FieldOptions editionDefaults. */ + public editionDefaults: google.protobuf.FieldOptions.IEditionDefault[]; + + /** FieldOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** FieldOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldOptions instance + */ + public static create(properties?: google.protobuf.IFieldOptions): google.protobuf.FieldOptions; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions; + + /** + * Verifies a FieldOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @param message FieldOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldOptions { + + /** CType enum. */ + enum CType { + STRING = 0, + CORD = 1, + STRING_PIECE = 2 + } + + /** JSType enum. */ + enum JSType { + JS_NORMAL = 0, + JS_STRING = 1, + JS_NUMBER = 2 + } + + /** OptionRetention enum. */ + enum OptionRetention { + RETENTION_UNKNOWN = 0, + RETENTION_RUNTIME = 1, + RETENTION_SOURCE = 2 + } + + /** OptionTargetType enum. */ + enum OptionTargetType { + TARGET_TYPE_UNKNOWN = 0, + TARGET_TYPE_FILE = 1, + TARGET_TYPE_EXTENSION_RANGE = 2, + TARGET_TYPE_MESSAGE = 3, + TARGET_TYPE_FIELD = 4, + TARGET_TYPE_ONEOF = 5, + TARGET_TYPE_ENUM = 6, + TARGET_TYPE_ENUM_ENTRY = 7, + TARGET_TYPE_SERVICE = 8, + TARGET_TYPE_METHOD = 9 + } + + /** Properties of an EditionDefault. */ + interface IEditionDefault { + + /** EditionDefault edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** EditionDefault value */ + value?: (string|null); + } + + /** Represents an EditionDefault. */ + class EditionDefault implements IEditionDefault { + + /** + * Constructs a new EditionDefault. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FieldOptions.IEditionDefault); + + /** EditionDefault edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** EditionDefault value. */ + public value: string; + + /** + * Creates a new EditionDefault instance using the specified properties. + * @param [properties] Properties to set + * @returns EditionDefault instance + */ + public static create(properties?: google.protobuf.FieldOptions.IEditionDefault): google.protobuf.FieldOptions.EditionDefault; + + /** + * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @param message EditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @param message EditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EditionDefault message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions.EditionDefault; + + /** + * Decodes an EditionDefault message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions.EditionDefault; + + /** + * Verifies an EditionDefault message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EditionDefault + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions.EditionDefault; + + /** + * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. + * @param message EditionDefault + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions.EditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EditionDefault to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EditionDefault + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an OneofOptions. */ + interface IOneofOptions { + + /** OneofOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** OneofOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an OneofOptions. */ + class OneofOptions implements IOneofOptions { + + /** + * Constructs a new OneofOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofOptions); + + /** OneofOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** OneofOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofOptions instance + */ + public static create(properties?: google.protobuf.IOneofOptions): google.protobuf.OneofOptions; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofOptions; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofOptions; + + /** + * Verifies an OneofOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofOptions; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @param message OneofOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneofOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumOptions. */ + interface IEnumOptions { + + /** EnumOptions allowAlias */ + allowAlias?: (boolean|null); + + /** EnumOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumOptions deprecatedLegacyJsonFieldConflicts */ + deprecatedLegacyJsonFieldConflicts?: (boolean|null); + + /** EnumOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** EnumOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumOptions. */ + class EnumOptions implements IEnumOptions { + + /** + * Constructs a new EnumOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumOptions); + + /** EnumOptions allowAlias. */ + public allowAlias: boolean; + + /** EnumOptions deprecated. */ + public deprecated: boolean; + + /** EnumOptions deprecatedLegacyJsonFieldConflicts. */ + public deprecatedLegacyJsonFieldConflicts: boolean; + + /** EnumOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** EnumOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumOptions instance + */ + public static create(properties?: google.protobuf.IEnumOptions): google.protobuf.EnumOptions; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumOptions; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumOptions; + + /** + * Verifies an EnumOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumOptions; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @param message EnumOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumValueOptions. */ + interface IEnumValueOptions { + + /** EnumValueOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumValueOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** EnumValueOptions debugRedact */ + debugRedact?: (boolean|null); + + /** EnumValueOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumValueOptions. */ + class EnumValueOptions implements IEnumValueOptions { + + /** + * Constructs a new EnumValueOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueOptions); + + /** EnumValueOptions deprecated. */ + public deprecated: boolean; + + /** EnumValueOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** EnumValueOptions debugRedact. */ + public debugRedact: boolean; + + /** EnumValueOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueOptions instance + */ + public static create(properties?: google.protobuf.IEnumValueOptions): google.protobuf.EnumValueOptions; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueOptions; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueOptions; + + /** + * Verifies an EnumValueOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueOptions; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @param message EnumValueOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceOptions. */ + interface IServiceOptions { + + /** ServiceOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** ServiceOptions deprecated */ + deprecated?: (boolean|null); + + /** ServiceOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** ServiceOptions .google.api.defaultHost */ + ".google.api.defaultHost"?: (string|null); + + /** ServiceOptions .google.api.oauthScopes */ + ".google.api.oauthScopes"?: (string|null); + + /** ServiceOptions .google.api.apiVersion */ + ".google.api.apiVersion"?: (string|null); + } + + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { + + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceOptions); + + /** ServiceOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** ServiceOptions deprecated. */ + public deprecated: boolean; + + /** ServiceOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceOptions instance + */ + public static create(properties?: google.protobuf.IServiceOptions): google.protobuf.ServiceOptions; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceOptions; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceOptions; + + /** + * Verifies a ServiceOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @param message ServiceOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodOptions. */ + interface IMethodOptions { + + /** MethodOptions deprecated */ + deprecated?: (boolean|null); + + /** MethodOptions idempotencyLevel */ + idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); + + /** MethodOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** MethodOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MethodOptions .google.api.http */ + ".google.api.http"?: (google.api.IHttpRule|null); + + /** MethodOptions .google.api.methodSignature */ + ".google.api.methodSignature"?: (string[]|null); + + /** MethodOptions .google.longrunning.operationInfo */ + ".google.longrunning.operationInfo"?: (google.longrunning.IOperationInfo|null); + } + + /** Represents a MethodOptions. */ + class MethodOptions implements IMethodOptions { + + /** + * Constructs a new MethodOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodOptions); + + /** MethodOptions deprecated. */ + public deprecated: boolean; + + /** MethodOptions idempotencyLevel. */ + public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); + + /** MethodOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** MethodOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodOptions instance + */ + public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodOptions; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodOptions; + + /** + * Verifies a MethodOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @param message MethodOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MethodOptions { + + /** IdempotencyLevel enum. */ + enum IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0, + NO_SIDE_EFFECTS = 1, + IDEMPOTENT = 2 + } + } + + /** Properties of an UninterpretedOption. */ + interface IUninterpretedOption { + + /** UninterpretedOption name */ + name?: (google.protobuf.UninterpretedOption.INamePart[]|null); + + /** UninterpretedOption identifierValue */ + identifierValue?: (string|null); + + /** UninterpretedOption positiveIntValue */ + positiveIntValue?: (number|Long|string|null); + + /** UninterpretedOption negativeIntValue */ + negativeIntValue?: (number|Long|string|null); + + /** UninterpretedOption doubleValue */ + doubleValue?: (number|null); + + /** UninterpretedOption stringValue */ + stringValue?: (Uint8Array|Buffer|string|null); + + /** UninterpretedOption aggregateValue */ + aggregateValue?: (string|null); + } + + /** Represents an UninterpretedOption. */ + class UninterpretedOption implements IUninterpretedOption { + + /** + * Constructs a new UninterpretedOption. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUninterpretedOption); + + /** UninterpretedOption name. */ + public name: google.protobuf.UninterpretedOption.INamePart[]; + + /** UninterpretedOption identifierValue. */ + public identifierValue: string; + + /** UninterpretedOption positiveIntValue. */ + public positiveIntValue: (number|Long|string); + + /** UninterpretedOption negativeIntValue. */ + public negativeIntValue: (number|Long|string); + + /** UninterpretedOption doubleValue. */ + public doubleValue: number; + + /** UninterpretedOption stringValue. */ + public stringValue: (Uint8Array|Buffer|string); + + /** UninterpretedOption aggregateValue. */ + public aggregateValue: string; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @param [properties] Properties to set + * @returns UninterpretedOption instance + */ + public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption; + + /** + * Verifies an UninterpretedOption message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UninterpretedOption + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @param message UninterpretedOption + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UninterpretedOption to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UninterpretedOption + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace UninterpretedOption { + + /** Properties of a NamePart. */ + interface INamePart { + + /** NamePart namePart */ + namePart: string; + + /** NamePart isExtension */ + isExtension: boolean; + } + + /** Represents a NamePart. */ + class NamePart implements INamePart { + + /** + * Constructs a new NamePart. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.UninterpretedOption.INamePart); + + /** NamePart namePart. */ + public namePart: string; + + /** NamePart isExtension. */ + public isExtension: boolean; + + /** + * Creates a new NamePart instance using the specified properties. + * @param [properties] Properties to set + * @returns NamePart instance + */ + public static create(properties?: google.protobuf.UninterpretedOption.INamePart): google.protobuf.UninterpretedOption.NamePart; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption.NamePart; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption.NamePart; + + /** + * Verifies a NamePart message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NamePart + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @param message NamePart + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NamePart to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NamePart + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a FeatureSet. */ + interface IFeatureSet { + + /** FeatureSet fieldPresence */ + fieldPresence?: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence|null); + + /** FeatureSet enumType */ + enumType?: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType|null); + + /** FeatureSet repeatedFieldEncoding */ + repeatedFieldEncoding?: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding|null); + + /** FeatureSet utf8Validation */ + utf8Validation?: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation|null); + + /** FeatureSet messageEncoding */ + messageEncoding?: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding|null); + + /** FeatureSet jsonFormat */ + jsonFormat?: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat|null); + } + + /** Represents a FeatureSet. */ + class FeatureSet implements IFeatureSet { + + /** + * Constructs a new FeatureSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFeatureSet); + + /** FeatureSet fieldPresence. */ + public fieldPresence: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence); + + /** FeatureSet enumType. */ + public enumType: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType); + + /** FeatureSet repeatedFieldEncoding. */ + public repeatedFieldEncoding: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding); + + /** FeatureSet utf8Validation. */ + public utf8Validation: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation); + + /** FeatureSet messageEncoding. */ + public messageEncoding: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding); + + /** FeatureSet jsonFormat. */ + public jsonFormat: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat); + + /** + * Creates a new FeatureSet instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSet instance + */ + public static create(properties?: google.protobuf.IFeatureSet): google.protobuf.FeatureSet; + + /** + * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @param message FeatureSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @param message FeatureSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSet; + + /** + * Decodes a FeatureSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSet; + + /** + * Verifies a FeatureSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSet + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSet; + + /** + * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. + * @param message FeatureSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FeatureSet { + + /** FieldPresence enum. */ + enum FieldPresence { + FIELD_PRESENCE_UNKNOWN = 0, + EXPLICIT = 1, + IMPLICIT = 2, + LEGACY_REQUIRED = 3 + } + + /** EnumType enum. */ + enum EnumType { + ENUM_TYPE_UNKNOWN = 0, + OPEN = 1, + CLOSED = 2 + } + + /** RepeatedFieldEncoding enum. */ + enum RepeatedFieldEncoding { + REPEATED_FIELD_ENCODING_UNKNOWN = 0, + PACKED = 1, + EXPANDED = 2 + } + + /** Utf8Validation enum. */ + enum Utf8Validation { + UTF8_VALIDATION_UNKNOWN = 0, + VERIFY = 2, + NONE = 3 + } + + /** MessageEncoding enum. */ + enum MessageEncoding { + MESSAGE_ENCODING_UNKNOWN = 0, + LENGTH_PREFIXED = 1, + DELIMITED = 2 + } + + /** JsonFormat enum. */ + enum JsonFormat { + JSON_FORMAT_UNKNOWN = 0, + ALLOW = 1, + LEGACY_BEST_EFFORT = 2 + } + } + + /** Properties of a FeatureSetDefaults. */ + interface IFeatureSetDefaults { + + /** FeatureSetDefaults defaults */ + defaults?: (google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]|null); + + /** FeatureSetDefaults minimumEdition */ + minimumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSetDefaults maximumEdition */ + maximumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + } + + /** Represents a FeatureSetDefaults. */ + class FeatureSetDefaults implements IFeatureSetDefaults { + + /** + * Constructs a new FeatureSetDefaults. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFeatureSetDefaults); + + /** FeatureSetDefaults defaults. */ + public defaults: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]; + + /** FeatureSetDefaults minimumEdition. */ + public minimumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSetDefaults maximumEdition. */ + public maximumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** + * Creates a new FeatureSetDefaults instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSetDefaults instance + */ + public static create(properties?: google.protobuf.IFeatureSetDefaults): google.protobuf.FeatureSetDefaults; + + /** + * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @param message FeatureSetDefaults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @param message FeatureSetDefaults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSetDefaults; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSetDefaults; + + /** + * Verifies a FeatureSetDefaults message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSetDefaults + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults; + + /** + * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. + * @param message FeatureSetDefaults + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSetDefaults, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSetDefaults to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSetDefaults + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FeatureSetDefaults { + + /** Properties of a FeatureSetEditionDefault. */ + interface IFeatureSetEditionDefault { + + /** FeatureSetEditionDefault edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSetEditionDefault features */ + features?: (google.protobuf.IFeatureSet|null); + } + + /** Represents a FeatureSetEditionDefault. */ + class FeatureSetEditionDefault implements IFeatureSetEditionDefault { + + /** + * Constructs a new FeatureSetEditionDefault. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault); + + /** FeatureSetEditionDefault edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSetEditionDefault features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** + * Creates a new FeatureSetEditionDefault instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSetEditionDefault instance + */ + public static create(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @param message FeatureSetEditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @param message FeatureSetEditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Verifies a FeatureSetEditionDefault message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSetEditionDefault + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. + * @param message FeatureSetEditionDefault + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSetEditionDefault to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSetEditionDefault + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a SourceCodeInfo. */ + interface ISourceCodeInfo { + + /** SourceCodeInfo location */ + location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); + } + + /** Represents a SourceCodeInfo. */ + class SourceCodeInfo implements ISourceCodeInfo { + + /** + * Constructs a new SourceCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ISourceCodeInfo); + + /** SourceCodeInfo location. */ + public location: google.protobuf.SourceCodeInfo.ILocation[]; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns SourceCodeInfo instance + */ + public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo; + + /** + * Verifies a SourceCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SourceCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @param message SourceCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SourceCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SourceCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SourceCodeInfo { + + /** Properties of a Location. */ + interface ILocation { + + /** Location path */ + path?: (number[]|null); + + /** Location span */ + span?: (number[]|null); + + /** Location leadingComments */ + leadingComments?: (string|null); + + /** Location trailingComments */ + trailingComments?: (string|null); + + /** Location leadingDetachedComments */ + leadingDetachedComments?: (string[]|null); + } + + /** Represents a Location. */ + class Location implements ILocation { + + /** + * Constructs a new Location. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); + + /** Location path. */ + public path: number[]; + + /** Location span. */ + public span: number[]; + + /** Location leadingComments. */ + public leadingComments: string; + + /** Location trailingComments. */ + public trailingComments: string; + + /** Location leadingDetachedComments. */ + public leadingDetachedComments: string[]; + + /** + * Creates a new Location instance using the specified properties. + * @param [properties] Properties to set + * @returns Location instance + */ + public static create(properties?: google.protobuf.SourceCodeInfo.ILocation): google.protobuf.SourceCodeInfo.Location; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Location message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo.Location; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo.Location; + + /** + * Verifies a Location message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Location + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @param message Location + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Location to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Location + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a GeneratedCodeInfo. */ + interface IGeneratedCodeInfo { + + /** GeneratedCodeInfo annotation */ + annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); + } + + /** Represents a GeneratedCodeInfo. */ + class GeneratedCodeInfo implements IGeneratedCodeInfo { + + /** + * Constructs a new GeneratedCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IGeneratedCodeInfo); + + /** GeneratedCodeInfo annotation. */ + public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns GeneratedCodeInfo instance + */ + public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo; + + /** + * Verifies a GeneratedCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GeneratedCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @param message GeneratedCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GeneratedCodeInfo { + + /** Properties of an Annotation. */ + interface IAnnotation { + + /** Annotation path */ + path?: (number[]|null); + + /** Annotation sourceFile */ + sourceFile?: (string|null); + + /** Annotation begin */ + begin?: (number|null); + + /** Annotation end */ + end?: (number|null); + + /** Annotation semantic */ + semantic?: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null); + } + + /** Represents an Annotation. */ + class Annotation implements IAnnotation { + + /** + * Constructs a new Annotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); + + /** Annotation path. */ + public path: number[]; + + /** Annotation sourceFile. */ + public sourceFile: string; + + /** Annotation begin. */ + public begin: number; + + /** Annotation end. */ + public end: number; + + /** Annotation semantic. */ + public semantic: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic); + + /** + * Creates a new Annotation instance using the specified properties. + * @param [properties] Properties to set + * @returns Annotation instance + */ + public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Verifies an Annotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Annotation + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @param message Annotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Annotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Annotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Annotation { + + /** Semantic enum. */ + enum Semantic { + NONE = 0, + SET = 1, + ALIAS = 2 + } + } + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** Timestamp seconds */ + seconds?: (number|Long|string|null); + + /** Timestamp nanos */ + nanos?: (number|null); + } + + /** Represents a Timestamp. */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ITimestamp); + + /** Timestamp seconds. */ + public seconds: (number|Long|string); + + /** Timestamp nanos. */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Timestamp; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Timestamp; + + /** + * Verifies a Timestamp message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Timestamp + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @param message Timestamp + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Timestamp to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Duration. */ + interface IDuration { + + /** Duration seconds */ + seconds?: (number|Long|string|null); + + /** Duration nanos */ + nanos?: (number|null); + } + + /** Represents a Duration. */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDuration); + + /** Duration seconds. */ + public seconds: (number|Long|string); + + /** Duration nanos. */ + public nanos: number; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: google.protobuf.IDuration): google.protobuf.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Duration; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Duration; + + /** + * Verifies a Duration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Duration + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @param message Duration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Duration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldMask. */ + interface IFieldMask { + + /** FieldMask paths */ + paths?: (string[]|null); + } + + /** Represents a FieldMask. */ + class FieldMask implements IFieldMask { + + /** + * Constructs a new FieldMask. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldMask); + + /** FieldMask paths. */ + public paths: string[]; + + /** + * Creates a new FieldMask instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldMask instance + */ + public static create(properties?: google.protobuf.IFieldMask): google.protobuf.FieldMask; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldMask; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldMask; + + /** + * Verifies a FieldMask message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldMask + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldMask; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @param message FieldMask + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldMask, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldMask to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldMask + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Any. */ + interface IAny { + + /** Any type_url */ + type_url?: (string|null); + + /** Any value */ + value?: (Uint8Array|Buffer|string|null); + } + + /** Represents an Any. */ + class Any implements IAny { + + /** + * Constructs a new Any. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IAny); + + /** Any type_url. */ + public type_url: string; + + /** Any value. */ + public value: (Uint8Array|Buffer|string); + + /** + * Creates a new Any instance using the specified properties. + * @param [properties] Properties to set + * @returns Any instance + */ + public static create(properties?: google.protobuf.IAny): google.protobuf.Any; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Any message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Any; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Any; + + /** + * Verifies an Any message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Any + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Any; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @param message Any + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Any, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Any to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Any + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Empty. */ + interface IEmpty { + } + + /** Represents an Empty. */ + class Empty implements IEmpty { + + /** + * Constructs a new Empty. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEmpty); + + /** + * Creates a new Empty instance using the specified properties. + * @param [properties] Properties to set + * @returns Empty instance + */ + public static create(properties?: google.protobuf.IEmpty): google.protobuf.Empty; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Empty; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Empty; + + /** + * Verifies an Empty message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Empty + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Empty; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @param message Empty + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Empty to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Empty + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace iam. */ + namespace iam { + + /** Namespace v1. */ + namespace v1 { + + /** Represents a IAMPolicy */ + class IAMPolicy extends $protobuf.rpc.Service { + + /** + * Constructs a new IAMPolicy service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new IAMPolicy service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): IAMPolicy; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest, callback: google.iam.v1.IAMPolicy.SetIamPolicyCallback): void; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @returns Promise + */ + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest): Promise; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest, callback: google.iam.v1.IAMPolicy.GetIamPolicyCallback): void; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @returns Promise + */ + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest): Promise; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + */ + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest, callback: google.iam.v1.IAMPolicy.TestIamPermissionsCallback): void; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @returns Promise + */ + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest): Promise; + } + + namespace IAMPolicy { + + /** + * Callback as used by {@link google.iam.v1.IAMPolicy|setIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type SetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + + /** + * Callback as used by {@link google.iam.v1.IAMPolicy|getIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type GetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + + /** + * Callback as used by {@link google.iam.v1.IAMPolicy|testIamPermissions}. + * @param error Error, if any + * @param [response] TestIamPermissionsResponse + */ + type TestIamPermissionsCallback = (error: (Error|null), response?: google.iam.v1.TestIamPermissionsResponse) => void; + } + + /** Properties of a SetIamPolicyRequest. */ + interface ISetIamPolicyRequest { + + /** SetIamPolicyRequest resource */ + resource?: (string|null); + + /** SetIamPolicyRequest policy */ + policy?: (google.iam.v1.IPolicy|null); + + /** SetIamPolicyRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents a SetIamPolicyRequest. */ + class SetIamPolicyRequest implements ISetIamPolicyRequest { + + /** + * Constructs a new SetIamPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.ISetIamPolicyRequest); + + /** SetIamPolicyRequest resource. */ + public resource: string; + + /** SetIamPolicyRequest policy. */ + public policy?: (google.iam.v1.IPolicy|null); + + /** SetIamPolicyRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new SetIamPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SetIamPolicyRequest instance + */ + public static create(properties?: google.iam.v1.ISetIamPolicyRequest): google.iam.v1.SetIamPolicyRequest; + + /** + * Encodes the specified SetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. + * @param message SetIamPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.ISetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. + * @param message SetIamPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.ISetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetIamPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.SetIamPolicyRequest; + + /** + * Decodes a SetIamPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.SetIamPolicyRequest; + + /** + * Verifies a SetIamPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetIamPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.SetIamPolicyRequest; + + /** + * Creates a plain object from a SetIamPolicyRequest message. Also converts values to other types if specified. + * @param message SetIamPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.SetIamPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetIamPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SetIamPolicyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetIamPolicyRequest. */ + interface IGetIamPolicyRequest { + + /** GetIamPolicyRequest resource */ + resource?: (string|null); + + /** GetIamPolicyRequest options */ + options?: (google.iam.v1.IGetPolicyOptions|null); + } + + /** Represents a GetIamPolicyRequest. */ + class GetIamPolicyRequest implements IGetIamPolicyRequest { + + /** + * Constructs a new GetIamPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IGetIamPolicyRequest); + + /** GetIamPolicyRequest resource. */ + public resource: string; + + /** GetIamPolicyRequest options. */ + public options?: (google.iam.v1.IGetPolicyOptions|null); + + /** + * Creates a new GetIamPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetIamPolicyRequest instance + */ + public static create(properties?: google.iam.v1.IGetIamPolicyRequest): google.iam.v1.GetIamPolicyRequest; + + /** + * Encodes the specified GetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. + * @param message GetIamPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IGetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. + * @param message GetIamPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IGetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetIamPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.GetIamPolicyRequest; + + /** + * Decodes a GetIamPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.GetIamPolicyRequest; + + /** + * Verifies a GetIamPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetIamPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.GetIamPolicyRequest; + + /** + * Creates a plain object from a GetIamPolicyRequest message. Also converts values to other types if specified. + * @param message GetIamPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.GetIamPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetIamPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetIamPolicyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TestIamPermissionsRequest. */ + interface ITestIamPermissionsRequest { + + /** TestIamPermissionsRequest resource */ + resource?: (string|null); + + /** TestIamPermissionsRequest permissions */ + permissions?: (string[]|null); + } + + /** Represents a TestIamPermissionsRequest. */ + class TestIamPermissionsRequest implements ITestIamPermissionsRequest { + + /** + * Constructs a new TestIamPermissionsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.ITestIamPermissionsRequest); + + /** TestIamPermissionsRequest resource. */ + public resource: string; + + /** TestIamPermissionsRequest permissions. */ + public permissions: string[]; + + /** + * Creates a new TestIamPermissionsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns TestIamPermissionsRequest instance + */ + public static create(properties?: google.iam.v1.ITestIamPermissionsRequest): google.iam.v1.TestIamPermissionsRequest; + + /** + * Encodes the specified TestIamPermissionsRequest message. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. + * @param message TestIamPermissionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.ITestIamPermissionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TestIamPermissionsRequest message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. + * @param message TestIamPermissionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.ITestIamPermissionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TestIamPermissionsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TestIamPermissionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.TestIamPermissionsRequest; + + /** + * Decodes a TestIamPermissionsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TestIamPermissionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.TestIamPermissionsRequest; + + /** + * Verifies a TestIamPermissionsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TestIamPermissionsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TestIamPermissionsRequest + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.TestIamPermissionsRequest; + + /** + * Creates a plain object from a TestIamPermissionsRequest message. Also converts values to other types if specified. + * @param message TestIamPermissionsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.TestIamPermissionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TestIamPermissionsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TestIamPermissionsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TestIamPermissionsResponse. */ + interface ITestIamPermissionsResponse { + + /** TestIamPermissionsResponse permissions */ + permissions?: (string[]|null); + } + + /** Represents a TestIamPermissionsResponse. */ + class TestIamPermissionsResponse implements ITestIamPermissionsResponse { + + /** + * Constructs a new TestIamPermissionsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.ITestIamPermissionsResponse); + + /** TestIamPermissionsResponse permissions. */ + public permissions: string[]; + + /** + * Creates a new TestIamPermissionsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns TestIamPermissionsResponse instance + */ + public static create(properties?: google.iam.v1.ITestIamPermissionsResponse): google.iam.v1.TestIamPermissionsResponse; + + /** + * Encodes the specified TestIamPermissionsResponse message. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. + * @param message TestIamPermissionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.ITestIamPermissionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TestIamPermissionsResponse message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. + * @param message TestIamPermissionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.ITestIamPermissionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TestIamPermissionsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TestIamPermissionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.TestIamPermissionsResponse; + + /** + * Decodes a TestIamPermissionsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TestIamPermissionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.TestIamPermissionsResponse; + + /** + * Verifies a TestIamPermissionsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TestIamPermissionsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TestIamPermissionsResponse + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.TestIamPermissionsResponse; + + /** + * Creates a plain object from a TestIamPermissionsResponse message. Also converts values to other types if specified. + * @param message TestIamPermissionsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.TestIamPermissionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TestIamPermissionsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TestIamPermissionsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetPolicyOptions. */ + interface IGetPolicyOptions { + + /** GetPolicyOptions requestedPolicyVersion */ + requestedPolicyVersion?: (number|null); + } + + /** Represents a GetPolicyOptions. */ + class GetPolicyOptions implements IGetPolicyOptions { + + /** + * Constructs a new GetPolicyOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IGetPolicyOptions); + + /** GetPolicyOptions requestedPolicyVersion. */ + public requestedPolicyVersion: number; + + /** + * Creates a new GetPolicyOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns GetPolicyOptions instance + */ + public static create(properties?: google.iam.v1.IGetPolicyOptions): google.iam.v1.GetPolicyOptions; + + /** + * Encodes the specified GetPolicyOptions message. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages. + * @param message GetPolicyOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IGetPolicyOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetPolicyOptions message, length delimited. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages. + * @param message GetPolicyOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IGetPolicyOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetPolicyOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetPolicyOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.GetPolicyOptions; + + /** + * Decodes a GetPolicyOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetPolicyOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.GetPolicyOptions; + + /** + * Verifies a GetPolicyOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetPolicyOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetPolicyOptions + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.GetPolicyOptions; + + /** + * Creates a plain object from a GetPolicyOptions message. Also converts values to other types if specified. + * @param message GetPolicyOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.GetPolicyOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetPolicyOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetPolicyOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Policy. */ + interface IPolicy { + + /** Policy version */ + version?: (number|null); + + /** Policy bindings */ + bindings?: (google.iam.v1.IBinding[]|null); + + /** Policy auditConfigs */ + auditConfigs?: (google.iam.v1.IAuditConfig[]|null); + + /** Policy etag */ + etag?: (Uint8Array|Buffer|string|null); + } + + /** Represents a Policy. */ + class Policy implements IPolicy { + + /** + * Constructs a new Policy. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IPolicy); + + /** Policy version. */ + public version: number; + + /** Policy bindings. */ + public bindings: google.iam.v1.IBinding[]; + + /** Policy auditConfigs. */ + public auditConfigs: google.iam.v1.IAuditConfig[]; + + /** Policy etag. */ + public etag: (Uint8Array|Buffer|string); + + /** + * Creates a new Policy instance using the specified properties. + * @param [properties] Properties to set + * @returns Policy instance + */ + public static create(properties?: google.iam.v1.IPolicy): google.iam.v1.Policy; + + /** + * Encodes the specified Policy message. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @param message Policy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Policy message, length delimited. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @param message Policy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Policy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.Policy; + + /** + * Decodes a Policy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.Policy; + + /** + * Verifies a Policy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Policy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Policy + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.Policy; + + /** + * Creates a plain object from a Policy message. Also converts values to other types if specified. + * @param message Policy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.Policy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Policy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Policy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Binding. */ + interface IBinding { + + /** Binding role */ + role?: (string|null); + + /** Binding members */ + members?: (string[]|null); + + /** Binding condition */ + condition?: (google.type.IExpr|null); + } + + /** Represents a Binding. */ + class Binding implements IBinding { + + /** + * Constructs a new Binding. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IBinding); + + /** Binding role. */ + public role: string; + + /** Binding members. */ + public members: string[]; + + /** Binding condition. */ + public condition?: (google.type.IExpr|null); + + /** + * Creates a new Binding instance using the specified properties. + * @param [properties] Properties to set + * @returns Binding instance + */ + public static create(properties?: google.iam.v1.IBinding): google.iam.v1.Binding; + + /** + * Encodes the specified Binding message. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @param message Binding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IBinding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Binding message, length delimited. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @param message Binding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IBinding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Binding message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Binding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.Binding; + + /** + * Decodes a Binding message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Binding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.Binding; + + /** + * Verifies a Binding message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Binding message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Binding + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.Binding; + + /** + * Creates a plain object from a Binding message. Also converts values to other types if specified. + * @param message Binding + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.Binding, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Binding to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Binding + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AuditConfig. */ + interface IAuditConfig { + + /** AuditConfig service */ + service?: (string|null); + + /** AuditConfig auditLogConfigs */ + auditLogConfigs?: (google.iam.v1.IAuditLogConfig[]|null); + } + + /** Represents an AuditConfig. */ + class AuditConfig implements IAuditConfig { + + /** + * Constructs a new AuditConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IAuditConfig); + + /** AuditConfig service. */ + public service: string; + + /** AuditConfig auditLogConfigs. */ + public auditLogConfigs: google.iam.v1.IAuditLogConfig[]; + + /** + * Creates a new AuditConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AuditConfig instance + */ + public static create(properties?: google.iam.v1.IAuditConfig): google.iam.v1.AuditConfig; + + /** + * Encodes the specified AuditConfig message. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. + * @param message AuditConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IAuditConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuditConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. + * @param message AuditConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IAuditConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuditConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuditConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.AuditConfig; + + /** + * Decodes an AuditConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuditConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.AuditConfig; + + /** + * Verifies an AuditConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AuditConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuditConfig + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditConfig; + + /** + * Creates a plain object from an AuditConfig message. Also converts values to other types if specified. + * @param message AuditConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.AuditConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuditConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AuditConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AuditLogConfig. */ + interface IAuditLogConfig { + + /** AuditLogConfig logType */ + logType?: (google.iam.v1.AuditLogConfig.LogType|keyof typeof google.iam.v1.AuditLogConfig.LogType|null); + + /** AuditLogConfig exemptedMembers */ + exemptedMembers?: (string[]|null); + } + + /** Represents an AuditLogConfig. */ + class AuditLogConfig implements IAuditLogConfig { + + /** + * Constructs a new AuditLogConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IAuditLogConfig); + + /** AuditLogConfig logType. */ + public logType: (google.iam.v1.AuditLogConfig.LogType|keyof typeof google.iam.v1.AuditLogConfig.LogType); + + /** AuditLogConfig exemptedMembers. */ + public exemptedMembers: string[]; + + /** + * Creates a new AuditLogConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AuditLogConfig instance + */ + public static create(properties?: google.iam.v1.IAuditLogConfig): google.iam.v1.AuditLogConfig; + + /** + * Encodes the specified AuditLogConfig message. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. + * @param message AuditLogConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IAuditLogConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuditLogConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. + * @param message AuditLogConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IAuditLogConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuditLogConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuditLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.AuditLogConfig; + + /** + * Decodes an AuditLogConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuditLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.AuditLogConfig; + + /** + * Verifies an AuditLogConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AuditLogConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuditLogConfig + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditLogConfig; + + /** + * Creates a plain object from an AuditLogConfig message. Also converts values to other types if specified. + * @param message AuditLogConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.AuditLogConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuditLogConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AuditLogConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AuditLogConfig { + + /** LogType enum. */ + enum LogType { + LOG_TYPE_UNSPECIFIED = 0, + ADMIN_READ = 1, + DATA_WRITE = 2, + DATA_READ = 3 + } + } + + /** Properties of a PolicyDelta. */ + interface IPolicyDelta { + + /** PolicyDelta bindingDeltas */ + bindingDeltas?: (google.iam.v1.IBindingDelta[]|null); + + /** PolicyDelta auditConfigDeltas */ + auditConfigDeltas?: (google.iam.v1.IAuditConfigDelta[]|null); + } + + /** Represents a PolicyDelta. */ + class PolicyDelta implements IPolicyDelta { + + /** + * Constructs a new PolicyDelta. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IPolicyDelta); + + /** PolicyDelta bindingDeltas. */ + public bindingDeltas: google.iam.v1.IBindingDelta[]; + + /** PolicyDelta auditConfigDeltas. */ + public auditConfigDeltas: google.iam.v1.IAuditConfigDelta[]; + + /** + * Creates a new PolicyDelta instance using the specified properties. + * @param [properties] Properties to set + * @returns PolicyDelta instance + */ + public static create(properties?: google.iam.v1.IPolicyDelta): google.iam.v1.PolicyDelta; + + /** + * Encodes the specified PolicyDelta message. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @param message PolicyDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IPolicyDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PolicyDelta message, length delimited. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @param message PolicyDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IPolicyDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PolicyDelta message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PolicyDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.PolicyDelta; + + /** + * Decodes a PolicyDelta message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PolicyDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.PolicyDelta; + + /** + * Verifies a PolicyDelta message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PolicyDelta message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PolicyDelta + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.PolicyDelta; + + /** + * Creates a plain object from a PolicyDelta message. Also converts values to other types if specified. + * @param message PolicyDelta + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.PolicyDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PolicyDelta to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PolicyDelta + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BindingDelta. */ + interface IBindingDelta { + + /** BindingDelta action */ + action?: (google.iam.v1.BindingDelta.Action|keyof typeof google.iam.v1.BindingDelta.Action|null); + + /** BindingDelta role */ + role?: (string|null); + + /** BindingDelta member */ + member?: (string|null); + + /** BindingDelta condition */ + condition?: (google.type.IExpr|null); + } + + /** Represents a BindingDelta. */ + class BindingDelta implements IBindingDelta { + + /** + * Constructs a new BindingDelta. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IBindingDelta); + + /** BindingDelta action. */ + public action: (google.iam.v1.BindingDelta.Action|keyof typeof google.iam.v1.BindingDelta.Action); + + /** BindingDelta role. */ + public role: string; + + /** BindingDelta member. */ + public member: string; + + /** BindingDelta condition. */ + public condition?: (google.type.IExpr|null); + + /** + * Creates a new BindingDelta instance using the specified properties. + * @param [properties] Properties to set + * @returns BindingDelta instance + */ + public static create(properties?: google.iam.v1.IBindingDelta): google.iam.v1.BindingDelta; + + /** + * Encodes the specified BindingDelta message. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @param message BindingDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IBindingDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BindingDelta message, length delimited. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @param message BindingDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IBindingDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BindingDelta message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BindingDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.BindingDelta; + + /** + * Decodes a BindingDelta message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BindingDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.BindingDelta; + + /** + * Verifies a BindingDelta message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BindingDelta message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BindingDelta + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.BindingDelta; + + /** + * Creates a plain object from a BindingDelta message. Also converts values to other types if specified. + * @param message BindingDelta + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.BindingDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BindingDelta to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BindingDelta + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BindingDelta { + + /** Action enum. */ + enum Action { + ACTION_UNSPECIFIED = 0, + ADD = 1, + REMOVE = 2 + } + } + + /** Properties of an AuditConfigDelta. */ + interface IAuditConfigDelta { + + /** AuditConfigDelta action */ + action?: (google.iam.v1.AuditConfigDelta.Action|keyof typeof google.iam.v1.AuditConfigDelta.Action|null); + + /** AuditConfigDelta service */ + service?: (string|null); + + /** AuditConfigDelta exemptedMember */ + exemptedMember?: (string|null); + + /** AuditConfigDelta logType */ + logType?: (string|null); + } + + /** Represents an AuditConfigDelta. */ + class AuditConfigDelta implements IAuditConfigDelta { + + /** + * Constructs a new AuditConfigDelta. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IAuditConfigDelta); + + /** AuditConfigDelta action. */ + public action: (google.iam.v1.AuditConfigDelta.Action|keyof typeof google.iam.v1.AuditConfigDelta.Action); + + /** AuditConfigDelta service. */ + public service: string; + + /** AuditConfigDelta exemptedMember. */ + public exemptedMember: string; + + /** AuditConfigDelta logType. */ + public logType: string; + + /** + * Creates a new AuditConfigDelta instance using the specified properties. + * @param [properties] Properties to set + * @returns AuditConfigDelta instance + */ + public static create(properties?: google.iam.v1.IAuditConfigDelta): google.iam.v1.AuditConfigDelta; + + /** + * Encodes the specified AuditConfigDelta message. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @param message AuditConfigDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IAuditConfigDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuditConfigDelta message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @param message AuditConfigDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IAuditConfigDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuditConfigDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.AuditConfigDelta; + + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuditConfigDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.AuditConfigDelta; + + /** + * Verifies an AuditConfigDelta message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AuditConfigDelta message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuditConfigDelta + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditConfigDelta; + + /** + * Creates a plain object from an AuditConfigDelta message. Also converts values to other types if specified. + * @param message AuditConfigDelta + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.AuditConfigDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuditConfigDelta to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AuditConfigDelta + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AuditConfigDelta { + + /** Action enum. */ + enum Action { + ACTION_UNSPECIFIED = 0, + ADD = 1, + REMOVE = 2 + } + } + } + } + + /** Namespace type. */ + namespace type { + + /** Properties of an Expr. */ + interface IExpr { + + /** Expr expression */ + expression?: (string|null); + + /** Expr title */ + title?: (string|null); + + /** Expr description */ + description?: (string|null); + + /** Expr location */ + location?: (string|null); + } + + /** Represents an Expr. */ + class Expr implements IExpr { + + /** + * Constructs a new Expr. + * @param [properties] Properties to set + */ + constructor(properties?: google.type.IExpr); + + /** Expr expression. */ + public expression: string; + + /** Expr title. */ + public title: string; + + /** Expr description. */ + public description: string; + + /** Expr location. */ + public location: string; + + /** + * Creates a new Expr instance using the specified properties. + * @param [properties] Properties to set + * @returns Expr instance + */ + public static create(properties?: google.type.IExpr): google.type.Expr; + + /** + * Encodes the specified Expr message. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @param message Expr message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.type.IExpr, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Expr message, length delimited. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @param message Expr message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.type.IExpr, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Expr message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.type.Expr; + + /** + * Decodes an Expr message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.type.Expr; + + /** + * Verifies an Expr message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Expr message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Expr + */ + public static fromObject(object: { [k: string]: any }): google.type.Expr; + + /** + * Creates a plain object from an Expr message. Also converts values to other types if specified. + * @param message Expr + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.type.Expr, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Expr to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Expr + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace longrunning. */ + namespace longrunning { + + /** Represents an Operations */ + class Operations extends $protobuf.rpc.Service { + + /** + * Constructs a new Operations service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Operations service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Operations; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListOperationsResponse + */ + public listOperations(request: google.longrunning.IListOperationsRequest, callback: google.longrunning.Operations.ListOperationsCallback): void; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @returns Promise + */ + public listOperations(request: google.longrunning.IListOperationsRequest): Promise; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public getOperation(request: google.longrunning.IGetOperationRequest, callback: google.longrunning.Operations.GetOperationCallback): void; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @returns Promise + */ + public getOperation(request: google.longrunning.IGetOperationRequest): Promise; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest, callback: google.longrunning.Operations.DeleteOperationCallback): void; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @returns Promise + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest): Promise; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest, callback: google.longrunning.Operations.CancelOperationCallback): void; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @returns Promise + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest): Promise; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest, callback: google.longrunning.Operations.WaitOperationCallback): void; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @returns Promise + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest): Promise; + } + + namespace Operations { + + /** + * Callback as used by {@link google.longrunning.Operations|listOperations}. + * @param error Error, if any + * @param [response] ListOperationsResponse + */ + type ListOperationsCallback = (error: (Error|null), response?: google.longrunning.ListOperationsResponse) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|getOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type GetOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type CancelOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|waitOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type WaitOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of an Operation. */ + interface IOperation { + + /** Operation name */ + name?: (string|null); + + /** Operation metadata */ + metadata?: (google.protobuf.IAny|null); + + /** Operation done */ + done?: (boolean|null); + + /** Operation error */ + error?: (google.rpc.IStatus|null); + + /** Operation response */ + response?: (google.protobuf.IAny|null); + } + + /** Represents an Operation. */ + class Operation implements IOperation { + + /** + * Constructs a new Operation. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperation); + + /** Operation name. */ + public name: string; + + /** Operation metadata. */ + public metadata?: (google.protobuf.IAny|null); + + /** Operation done. */ + public done: boolean; + + /** Operation error. */ + public error?: (google.rpc.IStatus|null); + + /** Operation response. */ + public response?: (google.protobuf.IAny|null); + + /** Operation result. */ + public result?: ("error"|"response"); + + /** + * Creates a new Operation instance using the specified properties. + * @param [properties] Properties to set + * @returns Operation instance + */ + public static create(properties?: google.longrunning.IOperation): google.longrunning.Operation; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.Operation; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.Operation; + + /** + * Verifies an Operation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Operation + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.Operation; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @param message Operation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.Operation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Operation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Operation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetOperationRequest. */ + interface IGetOperationRequest { + + /** GetOperationRequest name */ + name?: (string|null); + } + + /** Represents a GetOperationRequest. */ + class GetOperationRequest implements IGetOperationRequest { + + /** + * Constructs a new GetOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IGetOperationRequest); + + /** GetOperationRequest name. */ + public name: string; + + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetOperationRequest instance + */ + public static create(properties?: google.longrunning.IGetOperationRequest): google.longrunning.GetOperationRequest; + + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.GetOperationRequest; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.GetOperationRequest; + + /** + * Verifies a GetOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.GetOperationRequest; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @param message GetOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.GetOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOperationsRequest. */ + interface IListOperationsRequest { + + /** ListOperationsRequest name */ + name?: (string|null); + + /** ListOperationsRequest filter */ + filter?: (string|null); + + /** ListOperationsRequest pageSize */ + pageSize?: (number|null); + + /** ListOperationsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListOperationsRequest. */ + class ListOperationsRequest implements IListOperationsRequest { + + /** + * Constructs a new ListOperationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsRequest); + + /** ListOperationsRequest name. */ + public name: string; + + /** ListOperationsRequest filter. */ + public filter: string; + + /** ListOperationsRequest pageSize. */ + public pageSize: number; + + /** ListOperationsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsRequest instance + */ + public static create(properties?: google.longrunning.IListOperationsRequest): google.longrunning.ListOperationsRequest; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsRequest; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsRequest; + + /** + * Verifies a ListOperationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsRequest; + + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @param message ListOperationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOperationsResponse. */ + interface IListOperationsResponse { + + /** ListOperationsResponse operations */ + operations?: (google.longrunning.IOperation[]|null); + + /** ListOperationsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListOperationsResponse. */ + class ListOperationsResponse implements IListOperationsResponse { + + /** + * Constructs a new ListOperationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsResponse); + + /** ListOperationsResponse operations. */ + public operations: google.longrunning.IOperation[]; + + /** ListOperationsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsResponse instance + */ + public static create(properties?: google.longrunning.IListOperationsResponse): google.longrunning.ListOperationsResponse; + + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsResponse; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsResponse; + + /** + * Verifies a ListOperationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsResponse; + + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @param message ListOperationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CancelOperationRequest. */ + interface ICancelOperationRequest { + + /** CancelOperationRequest name */ + name?: (string|null); + } + + /** Represents a CancelOperationRequest. */ + class CancelOperationRequest implements ICancelOperationRequest { + + /** + * Constructs a new CancelOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.ICancelOperationRequest); + + /** CancelOperationRequest name. */ + public name: string; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CancelOperationRequest instance + */ + public static create(properties?: google.longrunning.ICancelOperationRequest): google.longrunning.CancelOperationRequest; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.CancelOperationRequest; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.CancelOperationRequest; + + /** + * Verifies a CancelOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CancelOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.CancelOperationRequest; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @param message CancelOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.CancelOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CancelOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CancelOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteOperationRequest. */ + interface IDeleteOperationRequest { + + /** DeleteOperationRequest name */ + name?: (string|null); + } + + /** Represents a DeleteOperationRequest. */ + class DeleteOperationRequest implements IDeleteOperationRequest { + + /** + * Constructs a new DeleteOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IDeleteOperationRequest); + + /** DeleteOperationRequest name. */ + public name: string; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteOperationRequest instance + */ + public static create(properties?: google.longrunning.IDeleteOperationRequest): google.longrunning.DeleteOperationRequest; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.DeleteOperationRequest; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.DeleteOperationRequest; + + /** + * Verifies a DeleteOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.DeleteOperationRequest; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @param message DeleteOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.DeleteOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WaitOperationRequest. */ + interface IWaitOperationRequest { + + /** WaitOperationRequest name */ + name?: (string|null); + + /** WaitOperationRequest timeout */ + timeout?: (google.protobuf.IDuration|null); + } + + /** Represents a WaitOperationRequest. */ + class WaitOperationRequest implements IWaitOperationRequest { + + /** + * Constructs a new WaitOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IWaitOperationRequest); + + /** WaitOperationRequest name. */ + public name: string; + + /** WaitOperationRequest timeout. */ + public timeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns WaitOperationRequest instance + */ + public static create(properties?: google.longrunning.IWaitOperationRequest): google.longrunning.WaitOperationRequest; + + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.WaitOperationRequest; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.WaitOperationRequest; + + /** + * Verifies a WaitOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WaitOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.WaitOperationRequest; + + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @param message WaitOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.WaitOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WaitOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WaitOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OperationInfo. */ + interface IOperationInfo { + + /** OperationInfo responseType */ + responseType?: (string|null); + + /** OperationInfo metadataType */ + metadataType?: (string|null); + } + + /** Represents an OperationInfo. */ + class OperationInfo implements IOperationInfo { + + /** + * Constructs a new OperationInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperationInfo); + + /** OperationInfo responseType. */ + public responseType: string; + + /** OperationInfo metadataType. */ + public metadataType: string; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationInfo instance + */ + public static create(properties?: google.longrunning.IOperationInfo): google.longrunning.OperationInfo; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.OperationInfo; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.OperationInfo; + + /** + * Verifies an OperationInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationInfo + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.OperationInfo; + + /** + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @param message OperationInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.OperationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OperationInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace rpc. */ + namespace rpc { + + /** Properties of a Status. */ + interface IStatus { + + /** Status code */ + code?: (number|null); + + /** Status message */ + message?: (string|null); + + /** Status details */ + details?: (google.protobuf.IAny[]|null); + } + + /** Represents a Status. */ + class Status implements IStatus { + + /** + * Constructs a new Status. + * @param [properties] Properties to set + */ + constructor(properties?: google.rpc.IStatus); + + /** Status code. */ + public code: number; + + /** Status message. */ + public message: string; + + /** Status details. */ + public details: google.protobuf.IAny[]; + + /** + * Creates a new Status instance using the specified properties. + * @param [properties] Properties to set + * @returns Status instance + */ + public static create(properties?: google.rpc.IStatus): google.rpc.Status; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Status message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.rpc.Status; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.rpc.Status; + + /** + * Verifies a Status message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Status + */ + public static fromObject(object: { [k: string]: any }): google.rpc.Status; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @param message Status + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.rpc.Status, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Status to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Status + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } +} diff --git a/owl-bot-staging/admin/instance/v1/protos/protos.js b/owl-bot-staging/admin/instance/v1/protos/protos.js new file mode 100644 index 000000000..06d864f7a --- /dev/null +++ b/owl-bot-staging/admin/instance/v1/protos/protos.js @@ -0,0 +1,38901 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +(function(global, factory) { /* global define, require, module */ + + /* AMD */ if (typeof define === 'function' && define.amd) + define(["protobufjs/minimal"], factory); + + /* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports) + module.exports = factory(require("google-gax/build/src/protobuf").protobufMinimal); + +})(this, function($protobuf) { + "use strict"; + + // Common aliases + var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + + // Exported root namespace + var $root = $protobuf.roots._google_cloud_spanner_protos || ($protobuf.roots._google_cloud_spanner_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.spanner = (function() { + + /** + * Namespace spanner. + * @memberof google + * @namespace + */ + var spanner = {}; + + spanner.admin = (function() { + + /** + * Namespace admin. + * @memberof google.spanner + * @namespace + */ + var admin = {}; + + admin.instance = (function() { + + /** + * Namespace instance. + * @memberof google.spanner.admin + * @namespace + */ + var instance = {}; + + instance.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.spanner.admin.instance + * @namespace + */ + var v1 = {}; + + v1.OperationProgress = (function() { + + /** + * Properties of an OperationProgress. + * @memberof google.spanner.admin.instance.v1 + * @interface IOperationProgress + * @property {number|null} [progressPercent] OperationProgress progressPercent + * @property {google.protobuf.ITimestamp|null} [startTime] OperationProgress startTime + * @property {google.protobuf.ITimestamp|null} [endTime] OperationProgress endTime + */ + + /** + * Constructs a new OperationProgress. + * @memberof google.spanner.admin.instance.v1 + * @classdesc Represents an OperationProgress. + * @implements IOperationProgress + * @constructor + * @param {google.spanner.admin.instance.v1.IOperationProgress=} [properties] Properties to set + */ + function OperationProgress(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OperationProgress progressPercent. + * @member {number} progressPercent + * @memberof google.spanner.admin.instance.v1.OperationProgress + * @instance + */ + OperationProgress.prototype.progressPercent = 0; + + /** + * OperationProgress startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.spanner.admin.instance.v1.OperationProgress + * @instance + */ + OperationProgress.prototype.startTime = null; + + /** + * OperationProgress endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.spanner.admin.instance.v1.OperationProgress + * @instance + */ + OperationProgress.prototype.endTime = null; + + /** + * Creates a new OperationProgress instance using the specified properties. + * @function create + * @memberof google.spanner.admin.instance.v1.OperationProgress + * @static + * @param {google.spanner.admin.instance.v1.IOperationProgress=} [properties] Properties to set + * @returns {google.spanner.admin.instance.v1.OperationProgress} OperationProgress instance + */ + OperationProgress.create = function create(properties) { + return new OperationProgress(properties); + }; + + /** + * Encodes the specified OperationProgress message. Does not implicitly {@link google.spanner.admin.instance.v1.OperationProgress.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.instance.v1.OperationProgress + * @static + * @param {google.spanner.admin.instance.v1.IOperationProgress} message OperationProgress message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationProgress.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.progressPercent != null && Object.hasOwnProperty.call(message, "progressPercent")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.progressPercent); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OperationProgress message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.OperationProgress.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.instance.v1.OperationProgress + * @static + * @param {google.spanner.admin.instance.v1.IOperationProgress} message OperationProgress message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationProgress.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationProgress message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.instance.v1.OperationProgress + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.instance.v1.OperationProgress} OperationProgress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationProgress.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.OperationProgress(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.progressPercent = reader.int32(); + break; + } + case 2: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationProgress message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.instance.v1.OperationProgress + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.instance.v1.OperationProgress} OperationProgress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationProgress.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationProgress message. + * @function verify + * @memberof google.spanner.admin.instance.v1.OperationProgress + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationProgress.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.progressPercent != null && message.hasOwnProperty("progressPercent")) + if (!$util.isInteger(message.progressPercent)) + return "progressPercent: integer expected"; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + return null; + }; + + /** + * Creates an OperationProgress message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.instance.v1.OperationProgress + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.instance.v1.OperationProgress} OperationProgress + */ + OperationProgress.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.instance.v1.OperationProgress) + return object; + var message = new $root.google.spanner.admin.instance.v1.OperationProgress(); + if (object.progressPercent != null) + message.progressPercent = object.progressPercent | 0; + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.spanner.admin.instance.v1.OperationProgress.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.spanner.admin.instance.v1.OperationProgress.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + return message; + }; + + /** + * Creates a plain object from an OperationProgress message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.instance.v1.OperationProgress + * @static + * @param {google.spanner.admin.instance.v1.OperationProgress} message OperationProgress + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationProgress.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.progressPercent = 0; + object.startTime = null; + object.endTime = null; + } + if (message.progressPercent != null && message.hasOwnProperty("progressPercent")) + object.progressPercent = message.progressPercent; + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + return object; + }; + + /** + * Converts this OperationProgress to JSON. + * @function toJSON + * @memberof google.spanner.admin.instance.v1.OperationProgress + * @instance + * @returns {Object.} JSON object + */ + OperationProgress.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OperationProgress + * @function getTypeUrl + * @memberof google.spanner.admin.instance.v1.OperationProgress + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OperationProgress.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.instance.v1.OperationProgress"; + }; + + return OperationProgress; + })(); + + /** + * FulfillmentPeriod enum. + * @name google.spanner.admin.instance.v1.FulfillmentPeriod + * @enum {number} + * @property {number} FULFILLMENT_PERIOD_UNSPECIFIED=0 FULFILLMENT_PERIOD_UNSPECIFIED value + * @property {number} FULFILLMENT_PERIOD_NORMAL=1 FULFILLMENT_PERIOD_NORMAL value + * @property {number} FULFILLMENT_PERIOD_EXTENDED=2 FULFILLMENT_PERIOD_EXTENDED value + */ + v1.FulfillmentPeriod = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FULFILLMENT_PERIOD_UNSPECIFIED"] = 0; + values[valuesById[1] = "FULFILLMENT_PERIOD_NORMAL"] = 1; + values[valuesById[2] = "FULFILLMENT_PERIOD_EXTENDED"] = 2; + return values; + })(); + + v1.ReplicaSelection = (function() { + + /** + * Properties of a ReplicaSelection. + * @memberof google.spanner.admin.instance.v1 + * @interface IReplicaSelection + * @property {string|null} [location] ReplicaSelection location + */ + + /** + * Constructs a new ReplicaSelection. + * @memberof google.spanner.admin.instance.v1 + * @classdesc Represents a ReplicaSelection. + * @implements IReplicaSelection + * @constructor + * @param {google.spanner.admin.instance.v1.IReplicaSelection=} [properties] Properties to set + */ + function ReplicaSelection(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReplicaSelection location. + * @member {string} location + * @memberof google.spanner.admin.instance.v1.ReplicaSelection + * @instance + */ + ReplicaSelection.prototype.location = ""; + + /** + * Creates a new ReplicaSelection instance using the specified properties. + * @function create + * @memberof google.spanner.admin.instance.v1.ReplicaSelection + * @static + * @param {google.spanner.admin.instance.v1.IReplicaSelection=} [properties] Properties to set + * @returns {google.spanner.admin.instance.v1.ReplicaSelection} ReplicaSelection instance + */ + ReplicaSelection.create = function create(properties) { + return new ReplicaSelection(properties); + }; + + /** + * Encodes the specified ReplicaSelection message. Does not implicitly {@link google.spanner.admin.instance.v1.ReplicaSelection.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.instance.v1.ReplicaSelection + * @static + * @param {google.spanner.admin.instance.v1.IReplicaSelection} message ReplicaSelection message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReplicaSelection.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.location); + return writer; + }; + + /** + * Encodes the specified ReplicaSelection message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ReplicaSelection.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.instance.v1.ReplicaSelection + * @static + * @param {google.spanner.admin.instance.v1.IReplicaSelection} message ReplicaSelection message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReplicaSelection.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReplicaSelection message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.instance.v1.ReplicaSelection + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.instance.v1.ReplicaSelection} ReplicaSelection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReplicaSelection.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.ReplicaSelection(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.location = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReplicaSelection message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.instance.v1.ReplicaSelection + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.instance.v1.ReplicaSelection} ReplicaSelection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReplicaSelection.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReplicaSelection message. + * @function verify + * @memberof google.spanner.admin.instance.v1.ReplicaSelection + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReplicaSelection.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + return null; + }; + + /** + * Creates a ReplicaSelection message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.instance.v1.ReplicaSelection + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.instance.v1.ReplicaSelection} ReplicaSelection + */ + ReplicaSelection.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.instance.v1.ReplicaSelection) + return object; + var message = new $root.google.spanner.admin.instance.v1.ReplicaSelection(); + if (object.location != null) + message.location = String(object.location); + return message; + }; + + /** + * Creates a plain object from a ReplicaSelection message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.instance.v1.ReplicaSelection + * @static + * @param {google.spanner.admin.instance.v1.ReplicaSelection} message ReplicaSelection + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReplicaSelection.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.location = ""; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this ReplicaSelection to JSON. + * @function toJSON + * @memberof google.spanner.admin.instance.v1.ReplicaSelection + * @instance + * @returns {Object.} JSON object + */ + ReplicaSelection.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReplicaSelection + * @function getTypeUrl + * @memberof google.spanner.admin.instance.v1.ReplicaSelection + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReplicaSelection.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.instance.v1.ReplicaSelection"; + }; + + return ReplicaSelection; + })(); + + v1.InstanceAdmin = (function() { + + /** + * Constructs a new InstanceAdmin service. + * @memberof google.spanner.admin.instance.v1 + * @classdesc Represents an InstanceAdmin + * @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 InstanceAdmin(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (InstanceAdmin.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = InstanceAdmin; + + /** + * Creates new InstanceAdmin service using the specified rpc implementation. + * @function create + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @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 {InstanceAdmin} RPC service. Useful where requests and/or responses are streamed. + */ + InstanceAdmin.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|listInstanceConfigs}. + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @typedef ListInstanceConfigsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.spanner.admin.instance.v1.ListInstanceConfigsResponse} [response] ListInstanceConfigsResponse + */ + + /** + * Calls ListInstanceConfigs. + * @function listInstanceConfigs + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @instance + * @param {google.spanner.admin.instance.v1.IListInstanceConfigsRequest} request ListInstanceConfigsRequest message or plain object + * @param {google.spanner.admin.instance.v1.InstanceAdmin.ListInstanceConfigsCallback} callback Node-style callback called with the error, if any, and ListInstanceConfigsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(InstanceAdmin.prototype.listInstanceConfigs = function listInstanceConfigs(request, callback) { + return this.rpcCall(listInstanceConfigs, $root.google.spanner.admin.instance.v1.ListInstanceConfigsRequest, $root.google.spanner.admin.instance.v1.ListInstanceConfigsResponse, request, callback); + }, "name", { value: "ListInstanceConfigs" }); + + /** + * Calls ListInstanceConfigs. + * @function listInstanceConfigs + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @instance + * @param {google.spanner.admin.instance.v1.IListInstanceConfigsRequest} request ListInstanceConfigsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|getInstanceConfig}. + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @typedef GetInstanceConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.spanner.admin.instance.v1.InstanceConfig} [response] InstanceConfig + */ + + /** + * Calls GetInstanceConfig. + * @function getInstanceConfig + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @instance + * @param {google.spanner.admin.instance.v1.IGetInstanceConfigRequest} request GetInstanceConfigRequest message or plain object + * @param {google.spanner.admin.instance.v1.InstanceAdmin.GetInstanceConfigCallback} callback Node-style callback called with the error, if any, and InstanceConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(InstanceAdmin.prototype.getInstanceConfig = function getInstanceConfig(request, callback) { + return this.rpcCall(getInstanceConfig, $root.google.spanner.admin.instance.v1.GetInstanceConfigRequest, $root.google.spanner.admin.instance.v1.InstanceConfig, request, callback); + }, "name", { value: "GetInstanceConfig" }); + + /** + * Calls GetInstanceConfig. + * @function getInstanceConfig + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @instance + * @param {google.spanner.admin.instance.v1.IGetInstanceConfigRequest} request GetInstanceConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|createInstanceConfig}. + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @typedef CreateInstanceConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateInstanceConfig. + * @function createInstanceConfig + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @instance + * @param {google.spanner.admin.instance.v1.ICreateInstanceConfigRequest} request CreateInstanceConfigRequest message or plain object + * @param {google.spanner.admin.instance.v1.InstanceAdmin.CreateInstanceConfigCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(InstanceAdmin.prototype.createInstanceConfig = function createInstanceConfig(request, callback) { + return this.rpcCall(createInstanceConfig, $root.google.spanner.admin.instance.v1.CreateInstanceConfigRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateInstanceConfig" }); + + /** + * Calls CreateInstanceConfig. + * @function createInstanceConfig + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @instance + * @param {google.spanner.admin.instance.v1.ICreateInstanceConfigRequest} request CreateInstanceConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|updateInstanceConfig}. + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @typedef UpdateInstanceConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateInstanceConfig. + * @function updateInstanceConfig + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @instance + * @param {google.spanner.admin.instance.v1.IUpdateInstanceConfigRequest} request UpdateInstanceConfigRequest message or plain object + * @param {google.spanner.admin.instance.v1.InstanceAdmin.UpdateInstanceConfigCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(InstanceAdmin.prototype.updateInstanceConfig = function updateInstanceConfig(request, callback) { + return this.rpcCall(updateInstanceConfig, $root.google.spanner.admin.instance.v1.UpdateInstanceConfigRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateInstanceConfig" }); + + /** + * Calls UpdateInstanceConfig. + * @function updateInstanceConfig + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @instance + * @param {google.spanner.admin.instance.v1.IUpdateInstanceConfigRequest} request UpdateInstanceConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|deleteInstanceConfig}. + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @typedef DeleteInstanceConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteInstanceConfig. + * @function deleteInstanceConfig + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @instance + * @param {google.spanner.admin.instance.v1.IDeleteInstanceConfigRequest} request DeleteInstanceConfigRequest message or plain object + * @param {google.spanner.admin.instance.v1.InstanceAdmin.DeleteInstanceConfigCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(InstanceAdmin.prototype.deleteInstanceConfig = function deleteInstanceConfig(request, callback) { + return this.rpcCall(deleteInstanceConfig, $root.google.spanner.admin.instance.v1.DeleteInstanceConfigRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteInstanceConfig" }); + + /** + * Calls DeleteInstanceConfig. + * @function deleteInstanceConfig + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @instance + * @param {google.spanner.admin.instance.v1.IDeleteInstanceConfigRequest} request DeleteInstanceConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|listInstanceConfigOperations}. + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @typedef ListInstanceConfigOperationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse} [response] ListInstanceConfigOperationsResponse + */ + + /** + * Calls ListInstanceConfigOperations. + * @function listInstanceConfigOperations + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @instance + * @param {google.spanner.admin.instance.v1.IListInstanceConfigOperationsRequest} request ListInstanceConfigOperationsRequest message or plain object + * @param {google.spanner.admin.instance.v1.InstanceAdmin.ListInstanceConfigOperationsCallback} callback Node-style callback called with the error, if any, and ListInstanceConfigOperationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(InstanceAdmin.prototype.listInstanceConfigOperations = function listInstanceConfigOperations(request, callback) { + return this.rpcCall(listInstanceConfigOperations, $root.google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest, $root.google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse, request, callback); + }, "name", { value: "ListInstanceConfigOperations" }); + + /** + * Calls ListInstanceConfigOperations. + * @function listInstanceConfigOperations + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @instance + * @param {google.spanner.admin.instance.v1.IListInstanceConfigOperationsRequest} request ListInstanceConfigOperationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|listInstances}. + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @typedef ListInstancesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.spanner.admin.instance.v1.ListInstancesResponse} [response] ListInstancesResponse + */ + + /** + * Calls ListInstances. + * @function listInstances + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @instance + * @param {google.spanner.admin.instance.v1.IListInstancesRequest} request ListInstancesRequest message or plain object + * @param {google.spanner.admin.instance.v1.InstanceAdmin.ListInstancesCallback} callback Node-style callback called with the error, if any, and ListInstancesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(InstanceAdmin.prototype.listInstances = function listInstances(request, callback) { + return this.rpcCall(listInstances, $root.google.spanner.admin.instance.v1.ListInstancesRequest, $root.google.spanner.admin.instance.v1.ListInstancesResponse, request, callback); + }, "name", { value: "ListInstances" }); + + /** + * Calls ListInstances. + * @function listInstances + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @instance + * @param {google.spanner.admin.instance.v1.IListInstancesRequest} request ListInstancesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|listInstancePartitions}. + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @typedef ListInstancePartitionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.spanner.admin.instance.v1.ListInstancePartitionsResponse} [response] ListInstancePartitionsResponse + */ + + /** + * Calls ListInstancePartitions. + * @function listInstancePartitions + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @instance + * @param {google.spanner.admin.instance.v1.IListInstancePartitionsRequest} request ListInstancePartitionsRequest message or plain object + * @param {google.spanner.admin.instance.v1.InstanceAdmin.ListInstancePartitionsCallback} callback Node-style callback called with the error, if any, and ListInstancePartitionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(InstanceAdmin.prototype.listInstancePartitions = function listInstancePartitions(request, callback) { + return this.rpcCall(listInstancePartitions, $root.google.spanner.admin.instance.v1.ListInstancePartitionsRequest, $root.google.spanner.admin.instance.v1.ListInstancePartitionsResponse, request, callback); + }, "name", { value: "ListInstancePartitions" }); + + /** + * Calls ListInstancePartitions. + * @function listInstancePartitions + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @instance + * @param {google.spanner.admin.instance.v1.IListInstancePartitionsRequest} request ListInstancePartitionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|getInstance}. + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @typedef GetInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.spanner.admin.instance.v1.Instance} [response] Instance + */ + + /** + * Calls GetInstance. + * @function getInstance + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @instance + * @param {google.spanner.admin.instance.v1.IGetInstanceRequest} request GetInstanceRequest message or plain object + * @param {google.spanner.admin.instance.v1.InstanceAdmin.GetInstanceCallback} callback Node-style callback called with the error, if any, and Instance + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(InstanceAdmin.prototype.getInstance = function getInstance(request, callback) { + return this.rpcCall(getInstance, $root.google.spanner.admin.instance.v1.GetInstanceRequest, $root.google.spanner.admin.instance.v1.Instance, request, callback); + }, "name", { value: "GetInstance" }); + + /** + * Calls GetInstance. + * @function getInstance + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @instance + * @param {google.spanner.admin.instance.v1.IGetInstanceRequest} request GetInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|createInstance}. + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @typedef CreateInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateInstance. + * @function createInstance + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @instance + * @param {google.spanner.admin.instance.v1.ICreateInstanceRequest} request CreateInstanceRequest message or plain object + * @param {google.spanner.admin.instance.v1.InstanceAdmin.CreateInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(InstanceAdmin.prototype.createInstance = function createInstance(request, callback) { + return this.rpcCall(createInstance, $root.google.spanner.admin.instance.v1.CreateInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateInstance" }); + + /** + * Calls CreateInstance. + * @function createInstance + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @instance + * @param {google.spanner.admin.instance.v1.ICreateInstanceRequest} request CreateInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|updateInstance}. + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @typedef UpdateInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateInstance. + * @function updateInstance + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @instance + * @param {google.spanner.admin.instance.v1.IUpdateInstanceRequest} request UpdateInstanceRequest message or plain object + * @param {google.spanner.admin.instance.v1.InstanceAdmin.UpdateInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(InstanceAdmin.prototype.updateInstance = function updateInstance(request, callback) { + return this.rpcCall(updateInstance, $root.google.spanner.admin.instance.v1.UpdateInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateInstance" }); + + /** + * Calls UpdateInstance. + * @function updateInstance + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @instance + * @param {google.spanner.admin.instance.v1.IUpdateInstanceRequest} request UpdateInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|deleteInstance}. + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @typedef DeleteInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteInstance. + * @function deleteInstance + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @instance + * @param {google.spanner.admin.instance.v1.IDeleteInstanceRequest} request DeleteInstanceRequest message or plain object + * @param {google.spanner.admin.instance.v1.InstanceAdmin.DeleteInstanceCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(InstanceAdmin.prototype.deleteInstance = function deleteInstance(request, callback) { + return this.rpcCall(deleteInstance, $root.google.spanner.admin.instance.v1.DeleteInstanceRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteInstance" }); + + /** + * Calls DeleteInstance. + * @function deleteInstance + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @instance + * @param {google.spanner.admin.instance.v1.IDeleteInstanceRequest} request DeleteInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|setIamPolicy}. + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @typedef SetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @param {google.spanner.admin.instance.v1.InstanceAdmin.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(InstanceAdmin.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.spanner.admin.instance.v1.InstanceAdmin + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|getIamPolicy}. + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @typedef GetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @param {google.spanner.admin.instance.v1.InstanceAdmin.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(InstanceAdmin.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.spanner.admin.instance.v1.InstanceAdmin + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|testIamPermissions}. + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @typedef TestIamPermissionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.TestIamPermissionsResponse} [response] TestIamPermissionsResponse + */ + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @param {google.spanner.admin.instance.v1.InstanceAdmin.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(InstanceAdmin.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.spanner.admin.instance.v1.InstanceAdmin + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|getInstancePartition}. + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @typedef GetInstancePartitionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.spanner.admin.instance.v1.InstancePartition} [response] InstancePartition + */ + + /** + * Calls GetInstancePartition. + * @function getInstancePartition + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @instance + * @param {google.spanner.admin.instance.v1.IGetInstancePartitionRequest} request GetInstancePartitionRequest message or plain object + * @param {google.spanner.admin.instance.v1.InstanceAdmin.GetInstancePartitionCallback} callback Node-style callback called with the error, if any, and InstancePartition + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(InstanceAdmin.prototype.getInstancePartition = function getInstancePartition(request, callback) { + return this.rpcCall(getInstancePartition, $root.google.spanner.admin.instance.v1.GetInstancePartitionRequest, $root.google.spanner.admin.instance.v1.InstancePartition, request, callback); + }, "name", { value: "GetInstancePartition" }); + + /** + * Calls GetInstancePartition. + * @function getInstancePartition + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @instance + * @param {google.spanner.admin.instance.v1.IGetInstancePartitionRequest} request GetInstancePartitionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|createInstancePartition}. + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @typedef CreateInstancePartitionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateInstancePartition. + * @function createInstancePartition + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @instance + * @param {google.spanner.admin.instance.v1.ICreateInstancePartitionRequest} request CreateInstancePartitionRequest message or plain object + * @param {google.spanner.admin.instance.v1.InstanceAdmin.CreateInstancePartitionCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(InstanceAdmin.prototype.createInstancePartition = function createInstancePartition(request, callback) { + return this.rpcCall(createInstancePartition, $root.google.spanner.admin.instance.v1.CreateInstancePartitionRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateInstancePartition" }); + + /** + * Calls CreateInstancePartition. + * @function createInstancePartition + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @instance + * @param {google.spanner.admin.instance.v1.ICreateInstancePartitionRequest} request CreateInstancePartitionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|deleteInstancePartition}. + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @typedef DeleteInstancePartitionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteInstancePartition. + * @function deleteInstancePartition + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @instance + * @param {google.spanner.admin.instance.v1.IDeleteInstancePartitionRequest} request DeleteInstancePartitionRequest message or plain object + * @param {google.spanner.admin.instance.v1.InstanceAdmin.DeleteInstancePartitionCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(InstanceAdmin.prototype.deleteInstancePartition = function deleteInstancePartition(request, callback) { + return this.rpcCall(deleteInstancePartition, $root.google.spanner.admin.instance.v1.DeleteInstancePartitionRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteInstancePartition" }); + + /** + * Calls DeleteInstancePartition. + * @function deleteInstancePartition + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @instance + * @param {google.spanner.admin.instance.v1.IDeleteInstancePartitionRequest} request DeleteInstancePartitionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|updateInstancePartition}. + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @typedef UpdateInstancePartitionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateInstancePartition. + * @function updateInstancePartition + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @instance + * @param {google.spanner.admin.instance.v1.IUpdateInstancePartitionRequest} request UpdateInstancePartitionRequest message or plain object + * @param {google.spanner.admin.instance.v1.InstanceAdmin.UpdateInstancePartitionCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(InstanceAdmin.prototype.updateInstancePartition = function updateInstancePartition(request, callback) { + return this.rpcCall(updateInstancePartition, $root.google.spanner.admin.instance.v1.UpdateInstancePartitionRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateInstancePartition" }); + + /** + * Calls UpdateInstancePartition. + * @function updateInstancePartition + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @instance + * @param {google.spanner.admin.instance.v1.IUpdateInstancePartitionRequest} request UpdateInstancePartitionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|listInstancePartitionOperations}. + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @typedef ListInstancePartitionOperationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse} [response] ListInstancePartitionOperationsResponse + */ + + /** + * Calls ListInstancePartitionOperations. + * @function listInstancePartitionOperations + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @instance + * @param {google.spanner.admin.instance.v1.IListInstancePartitionOperationsRequest} request ListInstancePartitionOperationsRequest message or plain object + * @param {google.spanner.admin.instance.v1.InstanceAdmin.ListInstancePartitionOperationsCallback} callback Node-style callback called with the error, if any, and ListInstancePartitionOperationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(InstanceAdmin.prototype.listInstancePartitionOperations = function listInstancePartitionOperations(request, callback) { + return this.rpcCall(listInstancePartitionOperations, $root.google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest, $root.google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse, request, callback); + }, "name", { value: "ListInstancePartitionOperations" }); + + /** + * Calls ListInstancePartitionOperations. + * @function listInstancePartitionOperations + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @instance + * @param {google.spanner.admin.instance.v1.IListInstancePartitionOperationsRequest} request ListInstancePartitionOperationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|moveInstance}. + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @typedef MoveInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls MoveInstance. + * @function moveInstance + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @instance + * @param {google.spanner.admin.instance.v1.IMoveInstanceRequest} request MoveInstanceRequest message or plain object + * @param {google.spanner.admin.instance.v1.InstanceAdmin.MoveInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(InstanceAdmin.prototype.moveInstance = function moveInstance(request, callback) { + return this.rpcCall(moveInstance, $root.google.spanner.admin.instance.v1.MoveInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "MoveInstance" }); + + /** + * Calls MoveInstance. + * @function moveInstance + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @instance + * @param {google.spanner.admin.instance.v1.IMoveInstanceRequest} request MoveInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return InstanceAdmin; + })(); + + v1.ReplicaInfo = (function() { + + /** + * Properties of a ReplicaInfo. + * @memberof google.spanner.admin.instance.v1 + * @interface IReplicaInfo + * @property {string|null} [location] ReplicaInfo location + * @property {google.spanner.admin.instance.v1.ReplicaInfo.ReplicaType|null} [type] ReplicaInfo type + * @property {boolean|null} [defaultLeaderLocation] ReplicaInfo defaultLeaderLocation + */ + + /** + * Constructs a new ReplicaInfo. + * @memberof google.spanner.admin.instance.v1 + * @classdesc Represents a ReplicaInfo. + * @implements IReplicaInfo + * @constructor + * @param {google.spanner.admin.instance.v1.IReplicaInfo=} [properties] Properties to set + */ + function ReplicaInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReplicaInfo location. + * @member {string} location + * @memberof google.spanner.admin.instance.v1.ReplicaInfo + * @instance + */ + ReplicaInfo.prototype.location = ""; + + /** + * ReplicaInfo type. + * @member {google.spanner.admin.instance.v1.ReplicaInfo.ReplicaType} type + * @memberof google.spanner.admin.instance.v1.ReplicaInfo + * @instance + */ + ReplicaInfo.prototype.type = 0; + + /** + * ReplicaInfo defaultLeaderLocation. + * @member {boolean} defaultLeaderLocation + * @memberof google.spanner.admin.instance.v1.ReplicaInfo + * @instance + */ + ReplicaInfo.prototype.defaultLeaderLocation = false; + + /** + * Creates a new ReplicaInfo instance using the specified properties. + * @function create + * @memberof google.spanner.admin.instance.v1.ReplicaInfo + * @static + * @param {google.spanner.admin.instance.v1.IReplicaInfo=} [properties] Properties to set + * @returns {google.spanner.admin.instance.v1.ReplicaInfo} ReplicaInfo instance + */ + ReplicaInfo.create = function create(properties) { + return new ReplicaInfo(properties); + }; + + /** + * Encodes the specified ReplicaInfo message. Does not implicitly {@link google.spanner.admin.instance.v1.ReplicaInfo.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.instance.v1.ReplicaInfo + * @static + * @param {google.spanner.admin.instance.v1.IReplicaInfo} message ReplicaInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReplicaInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.location); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.type); + if (message.defaultLeaderLocation != null && Object.hasOwnProperty.call(message, "defaultLeaderLocation")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.defaultLeaderLocation); + return writer; + }; + + /** + * Encodes the specified ReplicaInfo message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ReplicaInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.instance.v1.ReplicaInfo + * @static + * @param {google.spanner.admin.instance.v1.IReplicaInfo} message ReplicaInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReplicaInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReplicaInfo message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.instance.v1.ReplicaInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.instance.v1.ReplicaInfo} ReplicaInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReplicaInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.ReplicaInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.location = reader.string(); + break; + } + case 2: { + message.type = reader.int32(); + break; + } + case 3: { + message.defaultLeaderLocation = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReplicaInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.instance.v1.ReplicaInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.instance.v1.ReplicaInfo} ReplicaInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReplicaInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReplicaInfo message. + * @function verify + * @memberof google.spanner.admin.instance.v1.ReplicaInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReplicaInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.defaultLeaderLocation != null && message.hasOwnProperty("defaultLeaderLocation")) + if (typeof message.defaultLeaderLocation !== "boolean") + return "defaultLeaderLocation: boolean expected"; + return null; + }; + + /** + * Creates a ReplicaInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.instance.v1.ReplicaInfo + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.instance.v1.ReplicaInfo} ReplicaInfo + */ + ReplicaInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.instance.v1.ReplicaInfo) + return object; + var message = new $root.google.spanner.admin.instance.v1.ReplicaInfo(); + if (object.location != null) + message.location = String(object.location); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "READ_WRITE": + case 1: + message.type = 1; + break; + case "READ_ONLY": + case 2: + message.type = 2; + break; + case "WITNESS": + case 3: + message.type = 3; + break; + } + if (object.defaultLeaderLocation != null) + message.defaultLeaderLocation = Boolean(object.defaultLeaderLocation); + return message; + }; + + /** + * Creates a plain object from a ReplicaInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.instance.v1.ReplicaInfo + * @static + * @param {google.spanner.admin.instance.v1.ReplicaInfo} message ReplicaInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReplicaInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.location = ""; + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.defaultLeaderLocation = false; + } + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.spanner.admin.instance.v1.ReplicaInfo.ReplicaType[message.type] === undefined ? message.type : $root.google.spanner.admin.instance.v1.ReplicaInfo.ReplicaType[message.type] : message.type; + if (message.defaultLeaderLocation != null && message.hasOwnProperty("defaultLeaderLocation")) + object.defaultLeaderLocation = message.defaultLeaderLocation; + return object; + }; + + /** + * Converts this ReplicaInfo to JSON. + * @function toJSON + * @memberof google.spanner.admin.instance.v1.ReplicaInfo + * @instance + * @returns {Object.} JSON object + */ + ReplicaInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReplicaInfo + * @function getTypeUrl + * @memberof google.spanner.admin.instance.v1.ReplicaInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReplicaInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.instance.v1.ReplicaInfo"; + }; + + /** + * ReplicaType enum. + * @name google.spanner.admin.instance.v1.ReplicaInfo.ReplicaType + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} READ_WRITE=1 READ_WRITE value + * @property {number} READ_ONLY=2 READ_ONLY value + * @property {number} WITNESS=3 WITNESS value + */ + ReplicaInfo.ReplicaType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "READ_WRITE"] = 1; + values[valuesById[2] = "READ_ONLY"] = 2; + values[valuesById[3] = "WITNESS"] = 3; + return values; + })(); + + return ReplicaInfo; + })(); + + v1.InstanceConfig = (function() { + + /** + * Properties of an InstanceConfig. + * @memberof google.spanner.admin.instance.v1 + * @interface IInstanceConfig + * @property {string|null} [name] InstanceConfig name + * @property {string|null} [displayName] InstanceConfig displayName + * @property {google.spanner.admin.instance.v1.InstanceConfig.Type|null} [configType] InstanceConfig configType + * @property {Array.|null} [replicas] InstanceConfig replicas + * @property {Array.|null} [optionalReplicas] InstanceConfig optionalReplicas + * @property {string|null} [baseConfig] InstanceConfig baseConfig + * @property {Object.|null} [labels] InstanceConfig labels + * @property {string|null} [etag] InstanceConfig etag + * @property {Array.|null} [leaderOptions] InstanceConfig leaderOptions + * @property {boolean|null} [reconciling] InstanceConfig reconciling + * @property {google.spanner.admin.instance.v1.InstanceConfig.State|null} [state] InstanceConfig state + * @property {google.spanner.admin.instance.v1.InstanceConfig.FreeInstanceAvailability|null} [freeInstanceAvailability] InstanceConfig freeInstanceAvailability + * @property {google.spanner.admin.instance.v1.InstanceConfig.QuorumType|null} [quorumType] InstanceConfig quorumType + * @property {number|Long|null} [storageLimitPerProcessingUnit] InstanceConfig storageLimitPerProcessingUnit + */ + + /** + * Constructs a new InstanceConfig. + * @memberof google.spanner.admin.instance.v1 + * @classdesc Represents an InstanceConfig. + * @implements IInstanceConfig + * @constructor + * @param {google.spanner.admin.instance.v1.IInstanceConfig=} [properties] Properties to set + */ + function InstanceConfig(properties) { + this.replicas = []; + this.optionalReplicas = []; + this.labels = {}; + this.leaderOptions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstanceConfig name. + * @member {string} name + * @memberof google.spanner.admin.instance.v1.InstanceConfig + * @instance + */ + InstanceConfig.prototype.name = ""; + + /** + * InstanceConfig displayName. + * @member {string} displayName + * @memberof google.spanner.admin.instance.v1.InstanceConfig + * @instance + */ + InstanceConfig.prototype.displayName = ""; + + /** + * InstanceConfig configType. + * @member {google.spanner.admin.instance.v1.InstanceConfig.Type} configType + * @memberof google.spanner.admin.instance.v1.InstanceConfig + * @instance + */ + InstanceConfig.prototype.configType = 0; + + /** + * InstanceConfig replicas. + * @member {Array.} replicas + * @memberof google.spanner.admin.instance.v1.InstanceConfig + * @instance + */ + InstanceConfig.prototype.replicas = $util.emptyArray; + + /** + * InstanceConfig optionalReplicas. + * @member {Array.} optionalReplicas + * @memberof google.spanner.admin.instance.v1.InstanceConfig + * @instance + */ + InstanceConfig.prototype.optionalReplicas = $util.emptyArray; + + /** + * InstanceConfig baseConfig. + * @member {string} baseConfig + * @memberof google.spanner.admin.instance.v1.InstanceConfig + * @instance + */ + InstanceConfig.prototype.baseConfig = ""; + + /** + * InstanceConfig labels. + * @member {Object.} labels + * @memberof google.spanner.admin.instance.v1.InstanceConfig + * @instance + */ + InstanceConfig.prototype.labels = $util.emptyObject; + + /** + * InstanceConfig etag. + * @member {string} etag + * @memberof google.spanner.admin.instance.v1.InstanceConfig + * @instance + */ + InstanceConfig.prototype.etag = ""; + + /** + * InstanceConfig leaderOptions. + * @member {Array.} leaderOptions + * @memberof google.spanner.admin.instance.v1.InstanceConfig + * @instance + */ + InstanceConfig.prototype.leaderOptions = $util.emptyArray; + + /** + * InstanceConfig reconciling. + * @member {boolean} reconciling + * @memberof google.spanner.admin.instance.v1.InstanceConfig + * @instance + */ + InstanceConfig.prototype.reconciling = false; + + /** + * InstanceConfig state. + * @member {google.spanner.admin.instance.v1.InstanceConfig.State} state + * @memberof google.spanner.admin.instance.v1.InstanceConfig + * @instance + */ + InstanceConfig.prototype.state = 0; + + /** + * InstanceConfig freeInstanceAvailability. + * @member {google.spanner.admin.instance.v1.InstanceConfig.FreeInstanceAvailability} freeInstanceAvailability + * @memberof google.spanner.admin.instance.v1.InstanceConfig + * @instance + */ + InstanceConfig.prototype.freeInstanceAvailability = 0; + + /** + * InstanceConfig quorumType. + * @member {google.spanner.admin.instance.v1.InstanceConfig.QuorumType} quorumType + * @memberof google.spanner.admin.instance.v1.InstanceConfig + * @instance + */ + InstanceConfig.prototype.quorumType = 0; + + /** + * InstanceConfig storageLimitPerProcessingUnit. + * @member {number|Long} storageLimitPerProcessingUnit + * @memberof google.spanner.admin.instance.v1.InstanceConfig + * @instance + */ + InstanceConfig.prototype.storageLimitPerProcessingUnit = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new InstanceConfig instance using the specified properties. + * @function create + * @memberof google.spanner.admin.instance.v1.InstanceConfig + * @static + * @param {google.spanner.admin.instance.v1.IInstanceConfig=} [properties] Properties to set + * @returns {google.spanner.admin.instance.v1.InstanceConfig} InstanceConfig instance + */ + InstanceConfig.create = function create(properties) { + return new InstanceConfig(properties); + }; + + /** + * Encodes the specified InstanceConfig message. Does not implicitly {@link google.spanner.admin.instance.v1.InstanceConfig.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.instance.v1.InstanceConfig + * @static + * @param {google.spanner.admin.instance.v1.IInstanceConfig} message InstanceConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.replicas != null && message.replicas.length) + for (var i = 0; i < message.replicas.length; ++i) + $root.google.spanner.admin.instance.v1.ReplicaInfo.encode(message.replicas[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.leaderOptions != null && message.leaderOptions.length) + for (var i = 0; i < message.leaderOptions.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.leaderOptions[i]); + if (message.configType != null && Object.hasOwnProperty.call(message, "configType")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.configType); + if (message.optionalReplicas != null && message.optionalReplicas.length) + for (var i = 0; i < message.optionalReplicas.length; ++i) + $root.google.spanner.admin.instance.v1.ReplicaInfo.encode(message.optionalReplicas[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.baseConfig != null && Object.hasOwnProperty.call(message, "baseConfig")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.baseConfig); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 8, wireType 2 =*/66).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.etag); + if (message.reconciling != null && Object.hasOwnProperty.call(message, "reconciling")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.reconciling); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.state); + if (message.freeInstanceAvailability != null && Object.hasOwnProperty.call(message, "freeInstanceAvailability")) + writer.uint32(/* id 12, wireType 0 =*/96).int32(message.freeInstanceAvailability); + if (message.quorumType != null && Object.hasOwnProperty.call(message, "quorumType")) + writer.uint32(/* id 18, wireType 0 =*/144).int32(message.quorumType); + if (message.storageLimitPerProcessingUnit != null && Object.hasOwnProperty.call(message, "storageLimitPerProcessingUnit")) + writer.uint32(/* id 19, wireType 0 =*/152).int64(message.storageLimitPerProcessingUnit); + return writer; + }; + + /** + * Encodes the specified InstanceConfig message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.InstanceConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.instance.v1.InstanceConfig + * @static + * @param {google.spanner.admin.instance.v1.IInstanceConfig} message InstanceConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstanceConfig message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.instance.v1.InstanceConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.instance.v1.InstanceConfig} InstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.InstanceConfig(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 5: { + message.configType = reader.int32(); + break; + } + case 3: { + if (!(message.replicas && message.replicas.length)) + message.replicas = []; + message.replicas.push($root.google.spanner.admin.instance.v1.ReplicaInfo.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.optionalReplicas && message.optionalReplicas.length)) + message.optionalReplicas = []; + message.optionalReplicas.push($root.google.spanner.admin.instance.v1.ReplicaInfo.decode(reader, reader.uint32())); + break; + } + case 7: { + message.baseConfig = reader.string(); + break; + } + case 8: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 9: { + message.etag = reader.string(); + break; + } + case 4: { + if (!(message.leaderOptions && message.leaderOptions.length)) + message.leaderOptions = []; + message.leaderOptions.push(reader.string()); + break; + } + case 10: { + message.reconciling = reader.bool(); + break; + } + case 11: { + message.state = reader.int32(); + break; + } + case 12: { + message.freeInstanceAvailability = reader.int32(); + break; + } + case 18: { + message.quorumType = reader.int32(); + break; + } + case 19: { + message.storageLimitPerProcessingUnit = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstanceConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.instance.v1.InstanceConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.instance.v1.InstanceConfig} InstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstanceConfig message. + * @function verify + * @memberof google.spanner.admin.instance.v1.InstanceConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstanceConfig.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.configType != null && message.hasOwnProperty("configType")) + switch (message.configType) { + default: + return "configType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.replicas != null && message.hasOwnProperty("replicas")) { + if (!Array.isArray(message.replicas)) + return "replicas: array expected"; + for (var i = 0; i < message.replicas.length; ++i) { + var error = $root.google.spanner.admin.instance.v1.ReplicaInfo.verify(message.replicas[i]); + if (error) + return "replicas." + error; + } + } + if (message.optionalReplicas != null && message.hasOwnProperty("optionalReplicas")) { + if (!Array.isArray(message.optionalReplicas)) + return "optionalReplicas: array expected"; + for (var i = 0; i < message.optionalReplicas.length; ++i) { + var error = $root.google.spanner.admin.instance.v1.ReplicaInfo.verify(message.optionalReplicas[i]); + if (error) + return "optionalReplicas." + error; + } + } + if (message.baseConfig != null && message.hasOwnProperty("baseConfig")) + if (!$util.isString(message.baseConfig)) + return "baseConfig: string expected"; + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.leaderOptions != null && message.hasOwnProperty("leaderOptions")) { + if (!Array.isArray(message.leaderOptions)) + return "leaderOptions: array expected"; + for (var i = 0; i < message.leaderOptions.length; ++i) + if (!$util.isString(message.leaderOptions[i])) + return "leaderOptions: string[] expected"; + } + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + if (typeof message.reconciling !== "boolean") + return "reconciling: boolean 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.freeInstanceAvailability != null && message.hasOwnProperty("freeInstanceAvailability")) + switch (message.freeInstanceAvailability) { + default: + return "freeInstanceAvailability: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.quorumType != null && message.hasOwnProperty("quorumType")) + switch (message.quorumType) { + default: + return "quorumType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.storageLimitPerProcessingUnit != null && message.hasOwnProperty("storageLimitPerProcessingUnit")) + if (!$util.isInteger(message.storageLimitPerProcessingUnit) && !(message.storageLimitPerProcessingUnit && $util.isInteger(message.storageLimitPerProcessingUnit.low) && $util.isInteger(message.storageLimitPerProcessingUnit.high))) + return "storageLimitPerProcessingUnit: integer|Long expected"; + return null; + }; + + /** + * Creates an InstanceConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.instance.v1.InstanceConfig + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.instance.v1.InstanceConfig} InstanceConfig + */ + InstanceConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.instance.v1.InstanceConfig) + return object; + var message = new $root.google.spanner.admin.instance.v1.InstanceConfig(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + switch (object.configType) { + default: + if (typeof object.configType === "number") { + message.configType = object.configType; + break; + } + break; + case "TYPE_UNSPECIFIED": + case 0: + message.configType = 0; + break; + case "GOOGLE_MANAGED": + case 1: + message.configType = 1; + break; + case "USER_MANAGED": + case 2: + message.configType = 2; + break; + } + if (object.replicas) { + if (!Array.isArray(object.replicas)) + throw TypeError(".google.spanner.admin.instance.v1.InstanceConfig.replicas: array expected"); + message.replicas = []; + for (var i = 0; i < object.replicas.length; ++i) { + if (typeof object.replicas[i] !== "object") + throw TypeError(".google.spanner.admin.instance.v1.InstanceConfig.replicas: object expected"); + message.replicas[i] = $root.google.spanner.admin.instance.v1.ReplicaInfo.fromObject(object.replicas[i]); + } + } + if (object.optionalReplicas) { + if (!Array.isArray(object.optionalReplicas)) + throw TypeError(".google.spanner.admin.instance.v1.InstanceConfig.optionalReplicas: array expected"); + message.optionalReplicas = []; + for (var i = 0; i < object.optionalReplicas.length; ++i) { + if (typeof object.optionalReplicas[i] !== "object") + throw TypeError(".google.spanner.admin.instance.v1.InstanceConfig.optionalReplicas: object expected"); + message.optionalReplicas[i] = $root.google.spanner.admin.instance.v1.ReplicaInfo.fromObject(object.optionalReplicas[i]); + } + } + if (object.baseConfig != null) + message.baseConfig = String(object.baseConfig); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.spanner.admin.instance.v1.InstanceConfig.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.etag != null) + message.etag = String(object.etag); + if (object.leaderOptions) { + if (!Array.isArray(object.leaderOptions)) + throw TypeError(".google.spanner.admin.instance.v1.InstanceConfig.leaderOptions: array expected"); + message.leaderOptions = []; + for (var i = 0; i < object.leaderOptions.length; ++i) + message.leaderOptions[i] = String(object.leaderOptions[i]); + } + if (object.reconciling != null) + message.reconciling = Boolean(object.reconciling); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "CREATING": + case 1: + message.state = 1; + break; + case "READY": + case 2: + message.state = 2; + break; + } + switch (object.freeInstanceAvailability) { + default: + if (typeof object.freeInstanceAvailability === "number") { + message.freeInstanceAvailability = object.freeInstanceAvailability; + break; + } + break; + case "FREE_INSTANCE_AVAILABILITY_UNSPECIFIED": + case 0: + message.freeInstanceAvailability = 0; + break; + case "AVAILABLE": + case 1: + message.freeInstanceAvailability = 1; + break; + case "UNSUPPORTED": + case 2: + message.freeInstanceAvailability = 2; + break; + case "DISABLED": + case 3: + message.freeInstanceAvailability = 3; + break; + case "QUOTA_EXCEEDED": + case 4: + message.freeInstanceAvailability = 4; + break; + } + switch (object.quorumType) { + default: + if (typeof object.quorumType === "number") { + message.quorumType = object.quorumType; + break; + } + break; + case "QUORUM_TYPE_UNSPECIFIED": + case 0: + message.quorumType = 0; + break; + case "REGION": + case 1: + message.quorumType = 1; + break; + case "DUAL_REGION": + case 2: + message.quorumType = 2; + break; + case "MULTI_REGION": + case 3: + message.quorumType = 3; + break; + } + if (object.storageLimitPerProcessingUnit != null) + if ($util.Long) + (message.storageLimitPerProcessingUnit = $util.Long.fromValue(object.storageLimitPerProcessingUnit)).unsigned = false; + else if (typeof object.storageLimitPerProcessingUnit === "string") + message.storageLimitPerProcessingUnit = parseInt(object.storageLimitPerProcessingUnit, 10); + else if (typeof object.storageLimitPerProcessingUnit === "number") + message.storageLimitPerProcessingUnit = object.storageLimitPerProcessingUnit; + else if (typeof object.storageLimitPerProcessingUnit === "object") + message.storageLimitPerProcessingUnit = new $util.LongBits(object.storageLimitPerProcessingUnit.low >>> 0, object.storageLimitPerProcessingUnit.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from an InstanceConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.instance.v1.InstanceConfig + * @static + * @param {google.spanner.admin.instance.v1.InstanceConfig} message InstanceConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstanceConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.replicas = []; + object.leaderOptions = []; + object.optionalReplicas = []; + } + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.configType = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.baseConfig = ""; + object.etag = ""; + object.reconciling = false; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.freeInstanceAvailability = options.enums === String ? "FREE_INSTANCE_AVAILABILITY_UNSPECIFIED" : 0; + object.quorumType = options.enums === String ? "QUORUM_TYPE_UNSPECIFIED" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.storageLimitPerProcessingUnit = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.storageLimitPerProcessingUnit = options.longs === String ? "0" : 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.replicas && message.replicas.length) { + object.replicas = []; + for (var j = 0; j < message.replicas.length; ++j) + object.replicas[j] = $root.google.spanner.admin.instance.v1.ReplicaInfo.toObject(message.replicas[j], options); + } + if (message.leaderOptions && message.leaderOptions.length) { + object.leaderOptions = []; + for (var j = 0; j < message.leaderOptions.length; ++j) + object.leaderOptions[j] = message.leaderOptions[j]; + } + if (message.configType != null && message.hasOwnProperty("configType")) + object.configType = options.enums === String ? $root.google.spanner.admin.instance.v1.InstanceConfig.Type[message.configType] === undefined ? message.configType : $root.google.spanner.admin.instance.v1.InstanceConfig.Type[message.configType] : message.configType; + if (message.optionalReplicas && message.optionalReplicas.length) { + object.optionalReplicas = []; + for (var j = 0; j < message.optionalReplicas.length; ++j) + object.optionalReplicas[j] = $root.google.spanner.admin.instance.v1.ReplicaInfo.toObject(message.optionalReplicas[j], options); + } + if (message.baseConfig != null && message.hasOwnProperty("baseConfig")) + object.baseConfig = message.baseConfig; + 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.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + object.reconciling = message.reconciling; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.spanner.admin.instance.v1.InstanceConfig.State[message.state] === undefined ? message.state : $root.google.spanner.admin.instance.v1.InstanceConfig.State[message.state] : message.state; + if (message.freeInstanceAvailability != null && message.hasOwnProperty("freeInstanceAvailability")) + object.freeInstanceAvailability = options.enums === String ? $root.google.spanner.admin.instance.v1.InstanceConfig.FreeInstanceAvailability[message.freeInstanceAvailability] === undefined ? message.freeInstanceAvailability : $root.google.spanner.admin.instance.v1.InstanceConfig.FreeInstanceAvailability[message.freeInstanceAvailability] : message.freeInstanceAvailability; + if (message.quorumType != null && message.hasOwnProperty("quorumType")) + object.quorumType = options.enums === String ? $root.google.spanner.admin.instance.v1.InstanceConfig.QuorumType[message.quorumType] === undefined ? message.quorumType : $root.google.spanner.admin.instance.v1.InstanceConfig.QuorumType[message.quorumType] : message.quorumType; + if (message.storageLimitPerProcessingUnit != null && message.hasOwnProperty("storageLimitPerProcessingUnit")) + if (typeof message.storageLimitPerProcessingUnit === "number") + object.storageLimitPerProcessingUnit = options.longs === String ? String(message.storageLimitPerProcessingUnit) : message.storageLimitPerProcessingUnit; + else + object.storageLimitPerProcessingUnit = options.longs === String ? $util.Long.prototype.toString.call(message.storageLimitPerProcessingUnit) : options.longs === Number ? new $util.LongBits(message.storageLimitPerProcessingUnit.low >>> 0, message.storageLimitPerProcessingUnit.high >>> 0).toNumber() : message.storageLimitPerProcessingUnit; + return object; + }; + + /** + * Converts this InstanceConfig to JSON. + * @function toJSON + * @memberof google.spanner.admin.instance.v1.InstanceConfig + * @instance + * @returns {Object.} JSON object + */ + InstanceConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InstanceConfig + * @function getTypeUrl + * @memberof google.spanner.admin.instance.v1.InstanceConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InstanceConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.instance.v1.InstanceConfig"; + }; + + /** + * Type enum. + * @name google.spanner.admin.instance.v1.InstanceConfig.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} GOOGLE_MANAGED=1 GOOGLE_MANAGED value + * @property {number} USER_MANAGED=2 USER_MANAGED value + */ + InstanceConfig.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "GOOGLE_MANAGED"] = 1; + values[valuesById[2] = "USER_MANAGED"] = 2; + return values; + })(); + + /** + * State enum. + * @name google.spanner.admin.instance.v1.InstanceConfig.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} CREATING=1 CREATING value + * @property {number} READY=2 READY value + */ + InstanceConfig.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CREATING"] = 1; + values[valuesById[2] = "READY"] = 2; + return values; + })(); + + /** + * FreeInstanceAvailability enum. + * @name google.spanner.admin.instance.v1.InstanceConfig.FreeInstanceAvailability + * @enum {number} + * @property {number} FREE_INSTANCE_AVAILABILITY_UNSPECIFIED=0 FREE_INSTANCE_AVAILABILITY_UNSPECIFIED value + * @property {number} AVAILABLE=1 AVAILABLE value + * @property {number} UNSUPPORTED=2 UNSUPPORTED value + * @property {number} DISABLED=3 DISABLED value + * @property {number} QUOTA_EXCEEDED=4 QUOTA_EXCEEDED value + */ + InstanceConfig.FreeInstanceAvailability = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FREE_INSTANCE_AVAILABILITY_UNSPECIFIED"] = 0; + values[valuesById[1] = "AVAILABLE"] = 1; + values[valuesById[2] = "UNSUPPORTED"] = 2; + values[valuesById[3] = "DISABLED"] = 3; + values[valuesById[4] = "QUOTA_EXCEEDED"] = 4; + return values; + })(); + + /** + * QuorumType enum. + * @name google.spanner.admin.instance.v1.InstanceConfig.QuorumType + * @enum {number} + * @property {number} QUORUM_TYPE_UNSPECIFIED=0 QUORUM_TYPE_UNSPECIFIED value + * @property {number} REGION=1 REGION value + * @property {number} DUAL_REGION=2 DUAL_REGION value + * @property {number} MULTI_REGION=3 MULTI_REGION value + */ + InstanceConfig.QuorumType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "QUORUM_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "REGION"] = 1; + values[valuesById[2] = "DUAL_REGION"] = 2; + values[valuesById[3] = "MULTI_REGION"] = 3; + return values; + })(); + + return InstanceConfig; + })(); + + v1.ReplicaComputeCapacity = (function() { + + /** + * Properties of a ReplicaComputeCapacity. + * @memberof google.spanner.admin.instance.v1 + * @interface IReplicaComputeCapacity + * @property {google.spanner.admin.instance.v1.IReplicaSelection|null} [replicaSelection] ReplicaComputeCapacity replicaSelection + * @property {number|null} [nodeCount] ReplicaComputeCapacity nodeCount + * @property {number|null} [processingUnits] ReplicaComputeCapacity processingUnits + */ + + /** + * Constructs a new ReplicaComputeCapacity. + * @memberof google.spanner.admin.instance.v1 + * @classdesc Represents a ReplicaComputeCapacity. + * @implements IReplicaComputeCapacity + * @constructor + * @param {google.spanner.admin.instance.v1.IReplicaComputeCapacity=} [properties] Properties to set + */ + function ReplicaComputeCapacity(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReplicaComputeCapacity replicaSelection. + * @member {google.spanner.admin.instance.v1.IReplicaSelection|null|undefined} replicaSelection + * @memberof google.spanner.admin.instance.v1.ReplicaComputeCapacity + * @instance + */ + ReplicaComputeCapacity.prototype.replicaSelection = null; + + /** + * ReplicaComputeCapacity nodeCount. + * @member {number|null|undefined} nodeCount + * @memberof google.spanner.admin.instance.v1.ReplicaComputeCapacity + * @instance + */ + ReplicaComputeCapacity.prototype.nodeCount = null; + + /** + * ReplicaComputeCapacity processingUnits. + * @member {number|null|undefined} processingUnits + * @memberof google.spanner.admin.instance.v1.ReplicaComputeCapacity + * @instance + */ + ReplicaComputeCapacity.prototype.processingUnits = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ReplicaComputeCapacity computeCapacity. + * @member {"nodeCount"|"processingUnits"|undefined} computeCapacity + * @memberof google.spanner.admin.instance.v1.ReplicaComputeCapacity + * @instance + */ + Object.defineProperty(ReplicaComputeCapacity.prototype, "computeCapacity", { + get: $util.oneOfGetter($oneOfFields = ["nodeCount", "processingUnits"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ReplicaComputeCapacity instance using the specified properties. + * @function create + * @memberof google.spanner.admin.instance.v1.ReplicaComputeCapacity + * @static + * @param {google.spanner.admin.instance.v1.IReplicaComputeCapacity=} [properties] Properties to set + * @returns {google.spanner.admin.instance.v1.ReplicaComputeCapacity} ReplicaComputeCapacity instance + */ + ReplicaComputeCapacity.create = function create(properties) { + return new ReplicaComputeCapacity(properties); + }; + + /** + * Encodes the specified ReplicaComputeCapacity message. Does not implicitly {@link google.spanner.admin.instance.v1.ReplicaComputeCapacity.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.instance.v1.ReplicaComputeCapacity + * @static + * @param {google.spanner.admin.instance.v1.IReplicaComputeCapacity} message ReplicaComputeCapacity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReplicaComputeCapacity.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.replicaSelection != null && Object.hasOwnProperty.call(message, "replicaSelection")) + $root.google.spanner.admin.instance.v1.ReplicaSelection.encode(message.replicaSelection, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nodeCount != null && Object.hasOwnProperty.call(message, "nodeCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nodeCount); + if (message.processingUnits != null && Object.hasOwnProperty.call(message, "processingUnits")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.processingUnits); + return writer; + }; + + /** + * Encodes the specified ReplicaComputeCapacity message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ReplicaComputeCapacity.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.instance.v1.ReplicaComputeCapacity + * @static + * @param {google.spanner.admin.instance.v1.IReplicaComputeCapacity} message ReplicaComputeCapacity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReplicaComputeCapacity.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReplicaComputeCapacity message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.instance.v1.ReplicaComputeCapacity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.instance.v1.ReplicaComputeCapacity} ReplicaComputeCapacity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReplicaComputeCapacity.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.ReplicaComputeCapacity(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.replicaSelection = $root.google.spanner.admin.instance.v1.ReplicaSelection.decode(reader, reader.uint32()); + break; + } + case 2: { + message.nodeCount = reader.int32(); + break; + } + case 3: { + message.processingUnits = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReplicaComputeCapacity message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.instance.v1.ReplicaComputeCapacity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.instance.v1.ReplicaComputeCapacity} ReplicaComputeCapacity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReplicaComputeCapacity.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReplicaComputeCapacity message. + * @function verify + * @memberof google.spanner.admin.instance.v1.ReplicaComputeCapacity + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReplicaComputeCapacity.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.replicaSelection != null && message.hasOwnProperty("replicaSelection")) { + var error = $root.google.spanner.admin.instance.v1.ReplicaSelection.verify(message.replicaSelection); + if (error) + return "replicaSelection." + error; + } + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) { + properties.computeCapacity = 1; + if (!$util.isInteger(message.nodeCount)) + return "nodeCount: integer expected"; + } + if (message.processingUnits != null && message.hasOwnProperty("processingUnits")) { + if (properties.computeCapacity === 1) + return "computeCapacity: multiple values"; + properties.computeCapacity = 1; + if (!$util.isInteger(message.processingUnits)) + return "processingUnits: integer expected"; + } + return null; + }; + + /** + * Creates a ReplicaComputeCapacity message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.instance.v1.ReplicaComputeCapacity + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.instance.v1.ReplicaComputeCapacity} ReplicaComputeCapacity + */ + ReplicaComputeCapacity.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.instance.v1.ReplicaComputeCapacity) + return object; + var message = new $root.google.spanner.admin.instance.v1.ReplicaComputeCapacity(); + if (object.replicaSelection != null) { + if (typeof object.replicaSelection !== "object") + throw TypeError(".google.spanner.admin.instance.v1.ReplicaComputeCapacity.replicaSelection: object expected"); + message.replicaSelection = $root.google.spanner.admin.instance.v1.ReplicaSelection.fromObject(object.replicaSelection); + } + if (object.nodeCount != null) + message.nodeCount = object.nodeCount | 0; + if (object.processingUnits != null) + message.processingUnits = object.processingUnits | 0; + return message; + }; + + /** + * Creates a plain object from a ReplicaComputeCapacity message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.instance.v1.ReplicaComputeCapacity + * @static + * @param {google.spanner.admin.instance.v1.ReplicaComputeCapacity} message ReplicaComputeCapacity + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReplicaComputeCapacity.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.replicaSelection = null; + if (message.replicaSelection != null && message.hasOwnProperty("replicaSelection")) + object.replicaSelection = $root.google.spanner.admin.instance.v1.ReplicaSelection.toObject(message.replicaSelection, options); + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) { + object.nodeCount = message.nodeCount; + if (options.oneofs) + object.computeCapacity = "nodeCount"; + } + if (message.processingUnits != null && message.hasOwnProperty("processingUnits")) { + object.processingUnits = message.processingUnits; + if (options.oneofs) + object.computeCapacity = "processingUnits"; + } + return object; + }; + + /** + * Converts this ReplicaComputeCapacity to JSON. + * @function toJSON + * @memberof google.spanner.admin.instance.v1.ReplicaComputeCapacity + * @instance + * @returns {Object.} JSON object + */ + ReplicaComputeCapacity.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReplicaComputeCapacity + * @function getTypeUrl + * @memberof google.spanner.admin.instance.v1.ReplicaComputeCapacity + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReplicaComputeCapacity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.instance.v1.ReplicaComputeCapacity"; + }; + + return ReplicaComputeCapacity; + })(); + + v1.AutoscalingConfig = (function() { + + /** + * Properties of an AutoscalingConfig. + * @memberof google.spanner.admin.instance.v1 + * @interface IAutoscalingConfig + * @property {google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingLimits|null} [autoscalingLimits] AutoscalingConfig autoscalingLimits + * @property {google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingTargets|null} [autoscalingTargets] AutoscalingConfig autoscalingTargets + * @property {Array.|null} [asymmetricAutoscalingOptions] AutoscalingConfig asymmetricAutoscalingOptions + */ + + /** + * Constructs a new AutoscalingConfig. + * @memberof google.spanner.admin.instance.v1 + * @classdesc Represents an AutoscalingConfig. + * @implements IAutoscalingConfig + * @constructor + * @param {google.spanner.admin.instance.v1.IAutoscalingConfig=} [properties] Properties to set + */ + function AutoscalingConfig(properties) { + this.asymmetricAutoscalingOptions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AutoscalingConfig autoscalingLimits. + * @member {google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingLimits|null|undefined} autoscalingLimits + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig + * @instance + */ + AutoscalingConfig.prototype.autoscalingLimits = null; + + /** + * AutoscalingConfig autoscalingTargets. + * @member {google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingTargets|null|undefined} autoscalingTargets + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig + * @instance + */ + AutoscalingConfig.prototype.autoscalingTargets = null; + + /** + * AutoscalingConfig asymmetricAutoscalingOptions. + * @member {Array.} asymmetricAutoscalingOptions + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig + * @instance + */ + AutoscalingConfig.prototype.asymmetricAutoscalingOptions = $util.emptyArray; + + /** + * Creates a new AutoscalingConfig instance using the specified properties. + * @function create + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig + * @static + * @param {google.spanner.admin.instance.v1.IAutoscalingConfig=} [properties] Properties to set + * @returns {google.spanner.admin.instance.v1.AutoscalingConfig} AutoscalingConfig instance + */ + AutoscalingConfig.create = function create(properties) { + return new AutoscalingConfig(properties); + }; + + /** + * Encodes the specified AutoscalingConfig message. Does not implicitly {@link google.spanner.admin.instance.v1.AutoscalingConfig.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig + * @static + * @param {google.spanner.admin.instance.v1.IAutoscalingConfig} message AutoscalingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutoscalingConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.autoscalingLimits != null && Object.hasOwnProperty.call(message, "autoscalingLimits")) + $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits.encode(message.autoscalingLimits, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.autoscalingTargets != null && Object.hasOwnProperty.call(message, "autoscalingTargets")) + $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets.encode(message.autoscalingTargets, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.asymmetricAutoscalingOptions != null && message.asymmetricAutoscalingOptions.length) + for (var i = 0; i < message.asymmetricAutoscalingOptions.length; ++i) + $root.google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.encode(message.asymmetricAutoscalingOptions[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AutoscalingConfig message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.AutoscalingConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig + * @static + * @param {google.spanner.admin.instance.v1.IAutoscalingConfig} message AutoscalingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutoscalingConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AutoscalingConfig message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.instance.v1.AutoscalingConfig} AutoscalingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutoscalingConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.AutoscalingConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.autoscalingLimits = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits.decode(reader, reader.uint32()); + break; + } + case 2: { + message.autoscalingTargets = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.asymmetricAutoscalingOptions && message.asymmetricAutoscalingOptions.length)) + message.asymmetricAutoscalingOptions = []; + message.asymmetricAutoscalingOptions.push($root.google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AutoscalingConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.instance.v1.AutoscalingConfig} AutoscalingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutoscalingConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AutoscalingConfig message. + * @function verify + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AutoscalingConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.autoscalingLimits != null && message.hasOwnProperty("autoscalingLimits")) { + var error = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits.verify(message.autoscalingLimits); + if (error) + return "autoscalingLimits." + error; + } + if (message.autoscalingTargets != null && message.hasOwnProperty("autoscalingTargets")) { + var error = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets.verify(message.autoscalingTargets); + if (error) + return "autoscalingTargets." + error; + } + if (message.asymmetricAutoscalingOptions != null && message.hasOwnProperty("asymmetricAutoscalingOptions")) { + if (!Array.isArray(message.asymmetricAutoscalingOptions)) + return "asymmetricAutoscalingOptions: array expected"; + for (var i = 0; i < message.asymmetricAutoscalingOptions.length; ++i) { + var error = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.verify(message.asymmetricAutoscalingOptions[i]); + if (error) + return "asymmetricAutoscalingOptions." + error; + } + } + return null; + }; + + /** + * Creates an AutoscalingConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.instance.v1.AutoscalingConfig} AutoscalingConfig + */ + AutoscalingConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.instance.v1.AutoscalingConfig) + return object; + var message = new $root.google.spanner.admin.instance.v1.AutoscalingConfig(); + if (object.autoscalingLimits != null) { + if (typeof object.autoscalingLimits !== "object") + throw TypeError(".google.spanner.admin.instance.v1.AutoscalingConfig.autoscalingLimits: object expected"); + message.autoscalingLimits = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits.fromObject(object.autoscalingLimits); + } + if (object.autoscalingTargets != null) { + if (typeof object.autoscalingTargets !== "object") + throw TypeError(".google.spanner.admin.instance.v1.AutoscalingConfig.autoscalingTargets: object expected"); + message.autoscalingTargets = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets.fromObject(object.autoscalingTargets); + } + if (object.asymmetricAutoscalingOptions) { + if (!Array.isArray(object.asymmetricAutoscalingOptions)) + throw TypeError(".google.spanner.admin.instance.v1.AutoscalingConfig.asymmetricAutoscalingOptions: array expected"); + message.asymmetricAutoscalingOptions = []; + for (var i = 0; i < object.asymmetricAutoscalingOptions.length; ++i) { + if (typeof object.asymmetricAutoscalingOptions[i] !== "object") + throw TypeError(".google.spanner.admin.instance.v1.AutoscalingConfig.asymmetricAutoscalingOptions: object expected"); + message.asymmetricAutoscalingOptions[i] = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.fromObject(object.asymmetricAutoscalingOptions[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an AutoscalingConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig + * @static + * @param {google.spanner.admin.instance.v1.AutoscalingConfig} message AutoscalingConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AutoscalingConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.asymmetricAutoscalingOptions = []; + if (options.defaults) { + object.autoscalingLimits = null; + object.autoscalingTargets = null; + } + if (message.autoscalingLimits != null && message.hasOwnProperty("autoscalingLimits")) + object.autoscalingLimits = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits.toObject(message.autoscalingLimits, options); + if (message.autoscalingTargets != null && message.hasOwnProperty("autoscalingTargets")) + object.autoscalingTargets = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets.toObject(message.autoscalingTargets, options); + if (message.asymmetricAutoscalingOptions && message.asymmetricAutoscalingOptions.length) { + object.asymmetricAutoscalingOptions = []; + for (var j = 0; j < message.asymmetricAutoscalingOptions.length; ++j) + object.asymmetricAutoscalingOptions[j] = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.toObject(message.asymmetricAutoscalingOptions[j], options); + } + return object; + }; + + /** + * Converts this AutoscalingConfig to JSON. + * @function toJSON + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig + * @instance + * @returns {Object.} JSON object + */ + AutoscalingConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AutoscalingConfig + * @function getTypeUrl + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AutoscalingConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.instance.v1.AutoscalingConfig"; + }; + + AutoscalingConfig.AutoscalingLimits = (function() { + + /** + * Properties of an AutoscalingLimits. + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig + * @interface IAutoscalingLimits + * @property {number|null} [minNodes] AutoscalingLimits minNodes + * @property {number|null} [minProcessingUnits] AutoscalingLimits minProcessingUnits + * @property {number|null} [maxNodes] AutoscalingLimits maxNodes + * @property {number|null} [maxProcessingUnits] AutoscalingLimits maxProcessingUnits + */ + + /** + * Constructs a new AutoscalingLimits. + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig + * @classdesc Represents an AutoscalingLimits. + * @implements IAutoscalingLimits + * @constructor + * @param {google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingLimits=} [properties] Properties to set + */ + function AutoscalingLimits(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AutoscalingLimits minNodes. + * @member {number|null|undefined} minNodes + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits + * @instance + */ + AutoscalingLimits.prototype.minNodes = null; + + /** + * AutoscalingLimits minProcessingUnits. + * @member {number|null|undefined} minProcessingUnits + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits + * @instance + */ + AutoscalingLimits.prototype.minProcessingUnits = null; + + /** + * AutoscalingLimits maxNodes. + * @member {number|null|undefined} maxNodes + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits + * @instance + */ + AutoscalingLimits.prototype.maxNodes = null; + + /** + * AutoscalingLimits maxProcessingUnits. + * @member {number|null|undefined} maxProcessingUnits + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits + * @instance + */ + AutoscalingLimits.prototype.maxProcessingUnits = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AutoscalingLimits minLimit. + * @member {"minNodes"|"minProcessingUnits"|undefined} minLimit + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits + * @instance + */ + Object.defineProperty(AutoscalingLimits.prototype, "minLimit", { + get: $util.oneOfGetter($oneOfFields = ["minNodes", "minProcessingUnits"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AutoscalingLimits maxLimit. + * @member {"maxNodes"|"maxProcessingUnits"|undefined} maxLimit + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits + * @instance + */ + Object.defineProperty(AutoscalingLimits.prototype, "maxLimit", { + get: $util.oneOfGetter($oneOfFields = ["maxNodes", "maxProcessingUnits"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AutoscalingLimits instance using the specified properties. + * @function create + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits + * @static + * @param {google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingLimits=} [properties] Properties to set + * @returns {google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits} AutoscalingLimits instance + */ + AutoscalingLimits.create = function create(properties) { + return new AutoscalingLimits(properties); + }; + + /** + * Encodes the specified AutoscalingLimits message. Does not implicitly {@link google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits + * @static + * @param {google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingLimits} message AutoscalingLimits message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutoscalingLimits.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.minNodes != null && Object.hasOwnProperty.call(message, "minNodes")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.minNodes); + if (message.minProcessingUnits != null && Object.hasOwnProperty.call(message, "minProcessingUnits")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.minProcessingUnits); + if (message.maxNodes != null && Object.hasOwnProperty.call(message, "maxNodes")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.maxNodes); + if (message.maxProcessingUnits != null && Object.hasOwnProperty.call(message, "maxProcessingUnits")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.maxProcessingUnits); + return writer; + }; + + /** + * Encodes the specified AutoscalingLimits message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits + * @static + * @param {google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingLimits} message AutoscalingLimits message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutoscalingLimits.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AutoscalingLimits message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits} AutoscalingLimits + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutoscalingLimits.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.minNodes = reader.int32(); + break; + } + case 2: { + message.minProcessingUnits = reader.int32(); + break; + } + case 3: { + message.maxNodes = reader.int32(); + break; + } + case 4: { + message.maxProcessingUnits = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AutoscalingLimits message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits} AutoscalingLimits + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutoscalingLimits.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AutoscalingLimits message. + * @function verify + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AutoscalingLimits.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.minNodes != null && message.hasOwnProperty("minNodes")) { + properties.minLimit = 1; + if (!$util.isInteger(message.minNodes)) + return "minNodes: integer expected"; + } + if (message.minProcessingUnits != null && message.hasOwnProperty("minProcessingUnits")) { + if (properties.minLimit === 1) + return "minLimit: multiple values"; + properties.minLimit = 1; + if (!$util.isInteger(message.minProcessingUnits)) + return "minProcessingUnits: integer expected"; + } + if (message.maxNodes != null && message.hasOwnProperty("maxNodes")) { + properties.maxLimit = 1; + if (!$util.isInteger(message.maxNodes)) + return "maxNodes: integer expected"; + } + if (message.maxProcessingUnits != null && message.hasOwnProperty("maxProcessingUnits")) { + if (properties.maxLimit === 1) + return "maxLimit: multiple values"; + properties.maxLimit = 1; + if (!$util.isInteger(message.maxProcessingUnits)) + return "maxProcessingUnits: integer expected"; + } + return null; + }; + + /** + * Creates an AutoscalingLimits message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits} AutoscalingLimits + */ + AutoscalingLimits.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits) + return object; + var message = new $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits(); + if (object.minNodes != null) + message.minNodes = object.minNodes | 0; + if (object.minProcessingUnits != null) + message.minProcessingUnits = object.minProcessingUnits | 0; + if (object.maxNodes != null) + message.maxNodes = object.maxNodes | 0; + if (object.maxProcessingUnits != null) + message.maxProcessingUnits = object.maxProcessingUnits | 0; + return message; + }; + + /** + * Creates a plain object from an AutoscalingLimits message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits + * @static + * @param {google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits} message AutoscalingLimits + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AutoscalingLimits.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.minNodes != null && message.hasOwnProperty("minNodes")) { + object.minNodes = message.minNodes; + if (options.oneofs) + object.minLimit = "minNodes"; + } + if (message.minProcessingUnits != null && message.hasOwnProperty("minProcessingUnits")) { + object.minProcessingUnits = message.minProcessingUnits; + if (options.oneofs) + object.minLimit = "minProcessingUnits"; + } + if (message.maxNodes != null && message.hasOwnProperty("maxNodes")) { + object.maxNodes = message.maxNodes; + if (options.oneofs) + object.maxLimit = "maxNodes"; + } + if (message.maxProcessingUnits != null && message.hasOwnProperty("maxProcessingUnits")) { + object.maxProcessingUnits = message.maxProcessingUnits; + if (options.oneofs) + object.maxLimit = "maxProcessingUnits"; + } + return object; + }; + + /** + * Converts this AutoscalingLimits to JSON. + * @function toJSON + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits + * @instance + * @returns {Object.} JSON object + */ + AutoscalingLimits.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AutoscalingLimits + * @function getTypeUrl + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AutoscalingLimits.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits"; + }; + + return AutoscalingLimits; + })(); + + AutoscalingConfig.AutoscalingTargets = (function() { + + /** + * Properties of an AutoscalingTargets. + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig + * @interface IAutoscalingTargets + * @property {number|null} [highPriorityCpuUtilizationPercent] AutoscalingTargets highPriorityCpuUtilizationPercent + * @property {number|null} [totalCpuUtilizationPercent] AutoscalingTargets totalCpuUtilizationPercent + * @property {number|null} [storageUtilizationPercent] AutoscalingTargets storageUtilizationPercent + */ + + /** + * Constructs a new AutoscalingTargets. + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig + * @classdesc Represents an AutoscalingTargets. + * @implements IAutoscalingTargets + * @constructor + * @param {google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingTargets=} [properties] Properties to set + */ + function AutoscalingTargets(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AutoscalingTargets highPriorityCpuUtilizationPercent. + * @member {number} highPriorityCpuUtilizationPercent + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets + * @instance + */ + AutoscalingTargets.prototype.highPriorityCpuUtilizationPercent = 0; + + /** + * AutoscalingTargets totalCpuUtilizationPercent. + * @member {number} totalCpuUtilizationPercent + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets + * @instance + */ + AutoscalingTargets.prototype.totalCpuUtilizationPercent = 0; + + /** + * AutoscalingTargets storageUtilizationPercent. + * @member {number} storageUtilizationPercent + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets + * @instance + */ + AutoscalingTargets.prototype.storageUtilizationPercent = 0; + + /** + * Creates a new AutoscalingTargets instance using the specified properties. + * @function create + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets + * @static + * @param {google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingTargets=} [properties] Properties to set + * @returns {google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets} AutoscalingTargets instance + */ + AutoscalingTargets.create = function create(properties) { + return new AutoscalingTargets(properties); + }; + + /** + * Encodes the specified AutoscalingTargets message. Does not implicitly {@link google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets + * @static + * @param {google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingTargets} message AutoscalingTargets message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutoscalingTargets.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.highPriorityCpuUtilizationPercent != null && Object.hasOwnProperty.call(message, "highPriorityCpuUtilizationPercent")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.highPriorityCpuUtilizationPercent); + if (message.storageUtilizationPercent != null && Object.hasOwnProperty.call(message, "storageUtilizationPercent")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.storageUtilizationPercent); + if (message.totalCpuUtilizationPercent != null && Object.hasOwnProperty.call(message, "totalCpuUtilizationPercent")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.totalCpuUtilizationPercent); + return writer; + }; + + /** + * Encodes the specified AutoscalingTargets message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets + * @static + * @param {google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingTargets} message AutoscalingTargets message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutoscalingTargets.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AutoscalingTargets message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets} AutoscalingTargets + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutoscalingTargets.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.highPriorityCpuUtilizationPercent = reader.int32(); + break; + } + case 4: { + message.totalCpuUtilizationPercent = reader.int32(); + break; + } + case 2: { + message.storageUtilizationPercent = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AutoscalingTargets message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets} AutoscalingTargets + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutoscalingTargets.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AutoscalingTargets message. + * @function verify + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AutoscalingTargets.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.highPriorityCpuUtilizationPercent != null && message.hasOwnProperty("highPriorityCpuUtilizationPercent")) + if (!$util.isInteger(message.highPriorityCpuUtilizationPercent)) + return "highPriorityCpuUtilizationPercent: integer expected"; + if (message.totalCpuUtilizationPercent != null && message.hasOwnProperty("totalCpuUtilizationPercent")) + if (!$util.isInteger(message.totalCpuUtilizationPercent)) + return "totalCpuUtilizationPercent: integer expected"; + if (message.storageUtilizationPercent != null && message.hasOwnProperty("storageUtilizationPercent")) + if (!$util.isInteger(message.storageUtilizationPercent)) + return "storageUtilizationPercent: integer expected"; + return null; + }; + + /** + * Creates an AutoscalingTargets message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets} AutoscalingTargets + */ + AutoscalingTargets.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets) + return object; + var message = new $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets(); + if (object.highPriorityCpuUtilizationPercent != null) + message.highPriorityCpuUtilizationPercent = object.highPriorityCpuUtilizationPercent | 0; + if (object.totalCpuUtilizationPercent != null) + message.totalCpuUtilizationPercent = object.totalCpuUtilizationPercent | 0; + if (object.storageUtilizationPercent != null) + message.storageUtilizationPercent = object.storageUtilizationPercent | 0; + return message; + }; + + /** + * Creates a plain object from an AutoscalingTargets message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets + * @static + * @param {google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets} message AutoscalingTargets + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AutoscalingTargets.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.highPriorityCpuUtilizationPercent = 0; + object.storageUtilizationPercent = 0; + object.totalCpuUtilizationPercent = 0; + } + if (message.highPriorityCpuUtilizationPercent != null && message.hasOwnProperty("highPriorityCpuUtilizationPercent")) + object.highPriorityCpuUtilizationPercent = message.highPriorityCpuUtilizationPercent; + if (message.storageUtilizationPercent != null && message.hasOwnProperty("storageUtilizationPercent")) + object.storageUtilizationPercent = message.storageUtilizationPercent; + if (message.totalCpuUtilizationPercent != null && message.hasOwnProperty("totalCpuUtilizationPercent")) + object.totalCpuUtilizationPercent = message.totalCpuUtilizationPercent; + return object; + }; + + /** + * Converts this AutoscalingTargets to JSON. + * @function toJSON + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets + * @instance + * @returns {Object.} JSON object + */ + AutoscalingTargets.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AutoscalingTargets + * @function getTypeUrl + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AutoscalingTargets.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets"; + }; + + return AutoscalingTargets; + })(); + + AutoscalingConfig.AsymmetricAutoscalingOption = (function() { + + /** + * Properties of an AsymmetricAutoscalingOption. + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig + * @interface IAsymmetricAutoscalingOption + * @property {google.spanner.admin.instance.v1.IReplicaSelection|null} [replicaSelection] AsymmetricAutoscalingOption replicaSelection + * @property {google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.IAutoscalingConfigOverrides|null} [overrides] AsymmetricAutoscalingOption overrides + */ + + /** + * Constructs a new AsymmetricAutoscalingOption. + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig + * @classdesc Represents an AsymmetricAutoscalingOption. + * @implements IAsymmetricAutoscalingOption + * @constructor + * @param {google.spanner.admin.instance.v1.AutoscalingConfig.IAsymmetricAutoscalingOption=} [properties] Properties to set + */ + function AsymmetricAutoscalingOption(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AsymmetricAutoscalingOption replicaSelection. + * @member {google.spanner.admin.instance.v1.IReplicaSelection|null|undefined} replicaSelection + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption + * @instance + */ + AsymmetricAutoscalingOption.prototype.replicaSelection = null; + + /** + * AsymmetricAutoscalingOption overrides. + * @member {google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.IAutoscalingConfigOverrides|null|undefined} overrides + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption + * @instance + */ + AsymmetricAutoscalingOption.prototype.overrides = null; + + /** + * Creates a new AsymmetricAutoscalingOption instance using the specified properties. + * @function create + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption + * @static + * @param {google.spanner.admin.instance.v1.AutoscalingConfig.IAsymmetricAutoscalingOption=} [properties] Properties to set + * @returns {google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption} AsymmetricAutoscalingOption instance + */ + AsymmetricAutoscalingOption.create = function create(properties) { + return new AsymmetricAutoscalingOption(properties); + }; + + /** + * Encodes the specified AsymmetricAutoscalingOption message. Does not implicitly {@link google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption + * @static + * @param {google.spanner.admin.instance.v1.AutoscalingConfig.IAsymmetricAutoscalingOption} message AsymmetricAutoscalingOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AsymmetricAutoscalingOption.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.replicaSelection != null && Object.hasOwnProperty.call(message, "replicaSelection")) + $root.google.spanner.admin.instance.v1.ReplicaSelection.encode(message.replicaSelection, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.overrides != null && Object.hasOwnProperty.call(message, "overrides")) + $root.google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides.encode(message.overrides, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AsymmetricAutoscalingOption message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption + * @static + * @param {google.spanner.admin.instance.v1.AutoscalingConfig.IAsymmetricAutoscalingOption} message AsymmetricAutoscalingOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AsymmetricAutoscalingOption.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AsymmetricAutoscalingOption message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption} AsymmetricAutoscalingOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AsymmetricAutoscalingOption.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.replicaSelection = $root.google.spanner.admin.instance.v1.ReplicaSelection.decode(reader, reader.uint32()); + break; + } + case 2: { + message.overrides = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AsymmetricAutoscalingOption message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption} AsymmetricAutoscalingOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AsymmetricAutoscalingOption.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AsymmetricAutoscalingOption message. + * @function verify + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AsymmetricAutoscalingOption.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.replicaSelection != null && message.hasOwnProperty("replicaSelection")) { + var error = $root.google.spanner.admin.instance.v1.ReplicaSelection.verify(message.replicaSelection); + if (error) + return "replicaSelection." + error; + } + if (message.overrides != null && message.hasOwnProperty("overrides")) { + var error = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides.verify(message.overrides); + if (error) + return "overrides." + error; + } + return null; + }; + + /** + * Creates an AsymmetricAutoscalingOption message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption} AsymmetricAutoscalingOption + */ + AsymmetricAutoscalingOption.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption) + return object; + var message = new $root.google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption(); + if (object.replicaSelection != null) { + if (typeof object.replicaSelection !== "object") + throw TypeError(".google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.replicaSelection: object expected"); + message.replicaSelection = $root.google.spanner.admin.instance.v1.ReplicaSelection.fromObject(object.replicaSelection); + } + if (object.overrides != null) { + if (typeof object.overrides !== "object") + throw TypeError(".google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.overrides: object expected"); + message.overrides = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides.fromObject(object.overrides); + } + return message; + }; + + /** + * Creates a plain object from an AsymmetricAutoscalingOption message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption + * @static + * @param {google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption} message AsymmetricAutoscalingOption + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AsymmetricAutoscalingOption.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.replicaSelection = null; + object.overrides = null; + } + if (message.replicaSelection != null && message.hasOwnProperty("replicaSelection")) + object.replicaSelection = $root.google.spanner.admin.instance.v1.ReplicaSelection.toObject(message.replicaSelection, options); + if (message.overrides != null && message.hasOwnProperty("overrides")) + object.overrides = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides.toObject(message.overrides, options); + return object; + }; + + /** + * Converts this AsymmetricAutoscalingOption to JSON. + * @function toJSON + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption + * @instance + * @returns {Object.} JSON object + */ + AsymmetricAutoscalingOption.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AsymmetricAutoscalingOption + * @function getTypeUrl + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AsymmetricAutoscalingOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption"; + }; + + AsymmetricAutoscalingOption.AutoscalingConfigOverrides = (function() { + + /** + * Properties of an AutoscalingConfigOverrides. + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption + * @interface IAutoscalingConfigOverrides + * @property {google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingLimits|null} [autoscalingLimits] AutoscalingConfigOverrides autoscalingLimits + * @property {number|null} [autoscalingTargetHighPriorityCpuUtilizationPercent] AutoscalingConfigOverrides autoscalingTargetHighPriorityCpuUtilizationPercent + * @property {number|null} [autoscalingTargetTotalCpuUtilizationPercent] AutoscalingConfigOverrides autoscalingTargetTotalCpuUtilizationPercent + * @property {boolean|null} [disableHighPriorityCpuAutoscaling] AutoscalingConfigOverrides disableHighPriorityCpuAutoscaling + * @property {boolean|null} [disableTotalCpuAutoscaling] AutoscalingConfigOverrides disableTotalCpuAutoscaling + */ + + /** + * Constructs a new AutoscalingConfigOverrides. + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption + * @classdesc Represents an AutoscalingConfigOverrides. + * @implements IAutoscalingConfigOverrides + * @constructor + * @param {google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.IAutoscalingConfigOverrides=} [properties] Properties to set + */ + function AutoscalingConfigOverrides(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AutoscalingConfigOverrides autoscalingLimits. + * @member {google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingLimits|null|undefined} autoscalingLimits + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides + * @instance + */ + AutoscalingConfigOverrides.prototype.autoscalingLimits = null; + + /** + * AutoscalingConfigOverrides autoscalingTargetHighPriorityCpuUtilizationPercent. + * @member {number} autoscalingTargetHighPriorityCpuUtilizationPercent + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides + * @instance + */ + AutoscalingConfigOverrides.prototype.autoscalingTargetHighPriorityCpuUtilizationPercent = 0; + + /** + * AutoscalingConfigOverrides autoscalingTargetTotalCpuUtilizationPercent. + * @member {number} autoscalingTargetTotalCpuUtilizationPercent + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides + * @instance + */ + AutoscalingConfigOverrides.prototype.autoscalingTargetTotalCpuUtilizationPercent = 0; + + /** + * AutoscalingConfigOverrides disableHighPriorityCpuAutoscaling. + * @member {boolean} disableHighPriorityCpuAutoscaling + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides + * @instance + */ + AutoscalingConfigOverrides.prototype.disableHighPriorityCpuAutoscaling = false; + + /** + * AutoscalingConfigOverrides disableTotalCpuAutoscaling. + * @member {boolean} disableTotalCpuAutoscaling + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides + * @instance + */ + AutoscalingConfigOverrides.prototype.disableTotalCpuAutoscaling = false; + + /** + * Creates a new AutoscalingConfigOverrides instance using the specified properties. + * @function create + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides + * @static + * @param {google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.IAutoscalingConfigOverrides=} [properties] Properties to set + * @returns {google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides} AutoscalingConfigOverrides instance + */ + AutoscalingConfigOverrides.create = function create(properties) { + return new AutoscalingConfigOverrides(properties); + }; + + /** + * Encodes the specified AutoscalingConfigOverrides message. Does not implicitly {@link google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides + * @static + * @param {google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.IAutoscalingConfigOverrides} message AutoscalingConfigOverrides message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutoscalingConfigOverrides.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.autoscalingLimits != null && Object.hasOwnProperty.call(message, "autoscalingLimits")) + $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits.encode(message.autoscalingLimits, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.autoscalingTargetHighPriorityCpuUtilizationPercent != null && Object.hasOwnProperty.call(message, "autoscalingTargetHighPriorityCpuUtilizationPercent")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.autoscalingTargetHighPriorityCpuUtilizationPercent); + if (message.autoscalingTargetTotalCpuUtilizationPercent != null && Object.hasOwnProperty.call(message, "autoscalingTargetTotalCpuUtilizationPercent")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.autoscalingTargetTotalCpuUtilizationPercent); + if (message.disableHighPriorityCpuAutoscaling != null && Object.hasOwnProperty.call(message, "disableHighPriorityCpuAutoscaling")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.disableHighPriorityCpuAutoscaling); + if (message.disableTotalCpuAutoscaling != null && Object.hasOwnProperty.call(message, "disableTotalCpuAutoscaling")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.disableTotalCpuAutoscaling); + return writer; + }; + + /** + * Encodes the specified AutoscalingConfigOverrides message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides + * @static + * @param {google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.IAutoscalingConfigOverrides} message AutoscalingConfigOverrides message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutoscalingConfigOverrides.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AutoscalingConfigOverrides message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides} AutoscalingConfigOverrides + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutoscalingConfigOverrides.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.autoscalingLimits = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits.decode(reader, reader.uint32()); + break; + } + case 2: { + message.autoscalingTargetHighPriorityCpuUtilizationPercent = reader.int32(); + break; + } + case 4: { + message.autoscalingTargetTotalCpuUtilizationPercent = reader.int32(); + break; + } + case 5: { + message.disableHighPriorityCpuAutoscaling = reader.bool(); + break; + } + case 6: { + message.disableTotalCpuAutoscaling = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AutoscalingConfigOverrides message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides} AutoscalingConfigOverrides + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutoscalingConfigOverrides.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AutoscalingConfigOverrides message. + * @function verify + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AutoscalingConfigOverrides.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.autoscalingLimits != null && message.hasOwnProperty("autoscalingLimits")) { + var error = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits.verify(message.autoscalingLimits); + if (error) + return "autoscalingLimits." + error; + } + if (message.autoscalingTargetHighPriorityCpuUtilizationPercent != null && message.hasOwnProperty("autoscalingTargetHighPriorityCpuUtilizationPercent")) + if (!$util.isInteger(message.autoscalingTargetHighPriorityCpuUtilizationPercent)) + return "autoscalingTargetHighPriorityCpuUtilizationPercent: integer expected"; + if (message.autoscalingTargetTotalCpuUtilizationPercent != null && message.hasOwnProperty("autoscalingTargetTotalCpuUtilizationPercent")) + if (!$util.isInteger(message.autoscalingTargetTotalCpuUtilizationPercent)) + return "autoscalingTargetTotalCpuUtilizationPercent: integer expected"; + if (message.disableHighPriorityCpuAutoscaling != null && message.hasOwnProperty("disableHighPriorityCpuAutoscaling")) + if (typeof message.disableHighPriorityCpuAutoscaling !== "boolean") + return "disableHighPriorityCpuAutoscaling: boolean expected"; + if (message.disableTotalCpuAutoscaling != null && message.hasOwnProperty("disableTotalCpuAutoscaling")) + if (typeof message.disableTotalCpuAutoscaling !== "boolean") + return "disableTotalCpuAutoscaling: boolean expected"; + return null; + }; + + /** + * Creates an AutoscalingConfigOverrides message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides} AutoscalingConfigOverrides + */ + AutoscalingConfigOverrides.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides) + return object; + var message = new $root.google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides(); + if (object.autoscalingLimits != null) { + if (typeof object.autoscalingLimits !== "object") + throw TypeError(".google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides.autoscalingLimits: object expected"); + message.autoscalingLimits = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits.fromObject(object.autoscalingLimits); + } + if (object.autoscalingTargetHighPriorityCpuUtilizationPercent != null) + message.autoscalingTargetHighPriorityCpuUtilizationPercent = object.autoscalingTargetHighPriorityCpuUtilizationPercent | 0; + if (object.autoscalingTargetTotalCpuUtilizationPercent != null) + message.autoscalingTargetTotalCpuUtilizationPercent = object.autoscalingTargetTotalCpuUtilizationPercent | 0; + if (object.disableHighPriorityCpuAutoscaling != null) + message.disableHighPriorityCpuAutoscaling = Boolean(object.disableHighPriorityCpuAutoscaling); + if (object.disableTotalCpuAutoscaling != null) + message.disableTotalCpuAutoscaling = Boolean(object.disableTotalCpuAutoscaling); + return message; + }; + + /** + * Creates a plain object from an AutoscalingConfigOverrides message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides + * @static + * @param {google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides} message AutoscalingConfigOverrides + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AutoscalingConfigOverrides.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.autoscalingLimits = null; + object.autoscalingTargetHighPriorityCpuUtilizationPercent = 0; + object.autoscalingTargetTotalCpuUtilizationPercent = 0; + object.disableHighPriorityCpuAutoscaling = false; + object.disableTotalCpuAutoscaling = false; + } + if (message.autoscalingLimits != null && message.hasOwnProperty("autoscalingLimits")) + object.autoscalingLimits = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits.toObject(message.autoscalingLimits, options); + if (message.autoscalingTargetHighPriorityCpuUtilizationPercent != null && message.hasOwnProperty("autoscalingTargetHighPriorityCpuUtilizationPercent")) + object.autoscalingTargetHighPriorityCpuUtilizationPercent = message.autoscalingTargetHighPriorityCpuUtilizationPercent; + if (message.autoscalingTargetTotalCpuUtilizationPercent != null && message.hasOwnProperty("autoscalingTargetTotalCpuUtilizationPercent")) + object.autoscalingTargetTotalCpuUtilizationPercent = message.autoscalingTargetTotalCpuUtilizationPercent; + if (message.disableHighPriorityCpuAutoscaling != null && message.hasOwnProperty("disableHighPriorityCpuAutoscaling")) + object.disableHighPriorityCpuAutoscaling = message.disableHighPriorityCpuAutoscaling; + if (message.disableTotalCpuAutoscaling != null && message.hasOwnProperty("disableTotalCpuAutoscaling")) + object.disableTotalCpuAutoscaling = message.disableTotalCpuAutoscaling; + return object; + }; + + /** + * Converts this AutoscalingConfigOverrides to JSON. + * @function toJSON + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides + * @instance + * @returns {Object.} JSON object + */ + AutoscalingConfigOverrides.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AutoscalingConfigOverrides + * @function getTypeUrl + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AutoscalingConfigOverrides.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides"; + }; + + return AutoscalingConfigOverrides; + })(); + + return AsymmetricAutoscalingOption; + })(); + + return AutoscalingConfig; + })(); + + v1.Instance = (function() { + + /** + * Properties of an Instance. + * @memberof google.spanner.admin.instance.v1 + * @interface IInstance + * @property {string|null} [name] Instance name + * @property {string|null} [config] Instance config + * @property {string|null} [displayName] Instance displayName + * @property {number|null} [nodeCount] Instance nodeCount + * @property {number|null} [processingUnits] Instance processingUnits + * @property {Array.|null} [replicaComputeCapacity] Instance replicaComputeCapacity + * @property {google.spanner.admin.instance.v1.IAutoscalingConfig|null} [autoscalingConfig] Instance autoscalingConfig + * @property {google.spanner.admin.instance.v1.Instance.State|null} [state] Instance state + * @property {Object.|null} [labels] Instance labels + * @property {google.spanner.admin.instance.v1.Instance.InstanceType|null} [instanceType] Instance instanceType + * @property {Array.|null} [endpointUris] Instance endpointUris + * @property {google.protobuf.ITimestamp|null} [createTime] Instance createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Instance updateTime + * @property {google.spanner.admin.instance.v1.IFreeInstanceMetadata|null} [freeInstanceMetadata] Instance freeInstanceMetadata + * @property {google.spanner.admin.instance.v1.Instance.Edition|null} [edition] Instance edition + * @property {google.spanner.admin.instance.v1.Instance.DefaultBackupScheduleType|null} [defaultBackupScheduleType] Instance defaultBackupScheduleType + */ + + /** + * Constructs a new Instance. + * @memberof google.spanner.admin.instance.v1 + * @classdesc Represents an Instance. + * @implements IInstance + * @constructor + * @param {google.spanner.admin.instance.v1.IInstance=} [properties] Properties to set + */ + function Instance(properties) { + this.replicaComputeCapacity = []; + this.labels = {}; + this.endpointUris = []; + if (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.spanner.admin.instance.v1.Instance + * @instance + */ + Instance.prototype.name = ""; + + /** + * Instance config. + * @member {string} config + * @memberof google.spanner.admin.instance.v1.Instance + * @instance + */ + Instance.prototype.config = ""; + + /** + * Instance displayName. + * @member {string} displayName + * @memberof google.spanner.admin.instance.v1.Instance + * @instance + */ + Instance.prototype.displayName = ""; + + /** + * Instance nodeCount. + * @member {number} nodeCount + * @memberof google.spanner.admin.instance.v1.Instance + * @instance + */ + Instance.prototype.nodeCount = 0; + + /** + * Instance processingUnits. + * @member {number} processingUnits + * @memberof google.spanner.admin.instance.v1.Instance + * @instance + */ + Instance.prototype.processingUnits = 0; + + /** + * Instance replicaComputeCapacity. + * @member {Array.} replicaComputeCapacity + * @memberof google.spanner.admin.instance.v1.Instance + * @instance + */ + Instance.prototype.replicaComputeCapacity = $util.emptyArray; + + /** + * Instance autoscalingConfig. + * @member {google.spanner.admin.instance.v1.IAutoscalingConfig|null|undefined} autoscalingConfig + * @memberof google.spanner.admin.instance.v1.Instance + * @instance + */ + Instance.prototype.autoscalingConfig = null; + + /** + * Instance state. + * @member {google.spanner.admin.instance.v1.Instance.State} state + * @memberof google.spanner.admin.instance.v1.Instance + * @instance + */ + Instance.prototype.state = 0; + + /** + * Instance labels. + * @member {Object.} labels + * @memberof google.spanner.admin.instance.v1.Instance + * @instance + */ + Instance.prototype.labels = $util.emptyObject; + + /** + * Instance instanceType. + * @member {google.spanner.admin.instance.v1.Instance.InstanceType} instanceType + * @memberof google.spanner.admin.instance.v1.Instance + * @instance + */ + Instance.prototype.instanceType = 0; + + /** + * Instance endpointUris. + * @member {Array.} endpointUris + * @memberof google.spanner.admin.instance.v1.Instance + * @instance + */ + Instance.prototype.endpointUris = $util.emptyArray; + + /** + * Instance createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.spanner.admin.instance.v1.Instance + * @instance + */ + Instance.prototype.createTime = null; + + /** + * Instance updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.spanner.admin.instance.v1.Instance + * @instance + */ + Instance.prototype.updateTime = null; + + /** + * Instance freeInstanceMetadata. + * @member {google.spanner.admin.instance.v1.IFreeInstanceMetadata|null|undefined} freeInstanceMetadata + * @memberof google.spanner.admin.instance.v1.Instance + * @instance + */ + Instance.prototype.freeInstanceMetadata = null; + + /** + * Instance edition. + * @member {google.spanner.admin.instance.v1.Instance.Edition} edition + * @memberof google.spanner.admin.instance.v1.Instance + * @instance + */ + Instance.prototype.edition = 0; + + /** + * Instance defaultBackupScheduleType. + * @member {google.spanner.admin.instance.v1.Instance.DefaultBackupScheduleType} defaultBackupScheduleType + * @memberof google.spanner.admin.instance.v1.Instance + * @instance + */ + Instance.prototype.defaultBackupScheduleType = 0; + + /** + * Creates a new Instance instance using the specified properties. + * @function create + * @memberof google.spanner.admin.instance.v1.Instance + * @static + * @param {google.spanner.admin.instance.v1.IInstance=} [properties] Properties to set + * @returns {google.spanner.admin.instance.v1.Instance} Instance instance + */ + Instance.create = function create(properties) { + return new Instance(properties); + }; + + /** + * Encodes the specified Instance message. Does not implicitly {@link google.spanner.admin.instance.v1.Instance.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.instance.v1.Instance + * @static + * @param {google.spanner.admin.instance.v1.IInstance} message Instance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Instance.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.config != null && Object.hasOwnProperty.call(message, "config")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.config); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.displayName); + if (message.nodeCount != null && Object.hasOwnProperty.call(message, "nodeCount")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.nodeCount); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.state); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.endpointUris != null && message.endpointUris.length) + for (var i = 0; i < message.endpointUris.length; ++i) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.endpointUris[i]); + if (message.processingUnits != null && Object.hasOwnProperty.call(message, "processingUnits")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.processingUnits); + if (message.instanceType != null && Object.hasOwnProperty.call(message, "instanceType")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.instanceType); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.freeInstanceMetadata != null && Object.hasOwnProperty.call(message, "freeInstanceMetadata")) + $root.google.spanner.admin.instance.v1.FreeInstanceMetadata.encode(message.freeInstanceMetadata, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.autoscalingConfig != null && Object.hasOwnProperty.call(message, "autoscalingConfig")) + $root.google.spanner.admin.instance.v1.AutoscalingConfig.encode(message.autoscalingConfig, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.replicaComputeCapacity != null && message.replicaComputeCapacity.length) + for (var i = 0; i < message.replicaComputeCapacity.length; ++i) + $root.google.spanner.admin.instance.v1.ReplicaComputeCapacity.encode(message.replicaComputeCapacity[i], writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 20, wireType 0 =*/160).int32(message.edition); + if (message.defaultBackupScheduleType != null && Object.hasOwnProperty.call(message, "defaultBackupScheduleType")) + writer.uint32(/* id 23, wireType 0 =*/184).int32(message.defaultBackupScheduleType); + return writer; + }; + + /** + * Encodes the specified Instance message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.Instance.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.instance.v1.Instance + * @static + * @param {google.spanner.admin.instance.v1.IInstance} message Instance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Instance.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Instance message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.instance.v1.Instance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.instance.v1.Instance} Instance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Instance.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.Instance(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.config = reader.string(); + break; + } + case 3: { + message.displayName = reader.string(); + break; + } + case 5: { + message.nodeCount = reader.int32(); + break; + } + case 9: { + message.processingUnits = reader.int32(); + break; + } + case 19: { + if (!(message.replicaComputeCapacity && message.replicaComputeCapacity.length)) + message.replicaComputeCapacity = []; + message.replicaComputeCapacity.push($root.google.spanner.admin.instance.v1.ReplicaComputeCapacity.decode(reader, reader.uint32())); + break; + } + case 17: { + message.autoscalingConfig = $root.google.spanner.admin.instance.v1.AutoscalingConfig.decode(reader, reader.uint32()); + break; + } + case 6: { + message.state = reader.int32(); + break; + } + case 7: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 10: { + message.instanceType = reader.int32(); + break; + } + case 8: { + if (!(message.endpointUris && message.endpointUris.length)) + message.endpointUris = []; + message.endpointUris.push(reader.string()); + break; + } + case 11: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 12: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 13: { + message.freeInstanceMetadata = $root.google.spanner.admin.instance.v1.FreeInstanceMetadata.decode(reader, reader.uint32()); + break; + } + case 20: { + message.edition = reader.int32(); + break; + } + case 23: { + message.defaultBackupScheduleType = reader.int32(); + 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.spanner.admin.instance.v1.Instance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.instance.v1.Instance} Instance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Instance.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Instance message. + * @function verify + * @memberof google.spanner.admin.instance.v1.Instance + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Instance.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.config != null && message.hasOwnProperty("config")) + if (!$util.isString(message.config)) + return "config: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + if (!$util.isInteger(message.nodeCount)) + return "nodeCount: integer expected"; + if (message.processingUnits != null && message.hasOwnProperty("processingUnits")) + if (!$util.isInteger(message.processingUnits)) + return "processingUnits: integer expected"; + if (message.replicaComputeCapacity != null && message.hasOwnProperty("replicaComputeCapacity")) { + if (!Array.isArray(message.replicaComputeCapacity)) + return "replicaComputeCapacity: array expected"; + for (var i = 0; i < message.replicaComputeCapacity.length; ++i) { + var error = $root.google.spanner.admin.instance.v1.ReplicaComputeCapacity.verify(message.replicaComputeCapacity[i]); + if (error) + return "replicaComputeCapacity." + error; + } + } + if (message.autoscalingConfig != null && message.hasOwnProperty("autoscalingConfig")) { + var error = $root.google.spanner.admin.instance.v1.AutoscalingConfig.verify(message.autoscalingConfig); + if (error) + return "autoscalingConfig." + 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.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.instanceType != null && message.hasOwnProperty("instanceType")) + switch (message.instanceType) { + default: + return "instanceType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.endpointUris != null && message.hasOwnProperty("endpointUris")) { + if (!Array.isArray(message.endpointUris)) + return "endpointUris: array expected"; + for (var i = 0; i < message.endpointUris.length; ++i) + if (!$util.isString(message.endpointUris[i])) + return "endpointUris: string[] expected"; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.freeInstanceMetadata != null && message.hasOwnProperty("freeInstanceMetadata")) { + var error = $root.google.spanner.admin.instance.v1.FreeInstanceMetadata.verify(message.freeInstanceMetadata); + if (error) + return "freeInstanceMetadata." + error; + } + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.defaultBackupScheduleType != null && message.hasOwnProperty("defaultBackupScheduleType")) + switch (message.defaultBackupScheduleType) { + default: + return "defaultBackupScheduleType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an Instance message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.instance.v1.Instance + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.instance.v1.Instance} Instance + */ + Instance.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.instance.v1.Instance) + return object; + var message = new $root.google.spanner.admin.instance.v1.Instance(); + if (object.name != null) + message.name = String(object.name); + if (object.config != null) + message.config = String(object.config); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.nodeCount != null) + message.nodeCount = object.nodeCount | 0; + if (object.processingUnits != null) + message.processingUnits = object.processingUnits | 0; + if (object.replicaComputeCapacity) { + if (!Array.isArray(object.replicaComputeCapacity)) + throw TypeError(".google.spanner.admin.instance.v1.Instance.replicaComputeCapacity: array expected"); + message.replicaComputeCapacity = []; + for (var i = 0; i < object.replicaComputeCapacity.length; ++i) { + if (typeof object.replicaComputeCapacity[i] !== "object") + throw TypeError(".google.spanner.admin.instance.v1.Instance.replicaComputeCapacity: object expected"); + message.replicaComputeCapacity[i] = $root.google.spanner.admin.instance.v1.ReplicaComputeCapacity.fromObject(object.replicaComputeCapacity[i]); + } + } + if (object.autoscalingConfig != null) { + if (typeof object.autoscalingConfig !== "object") + throw TypeError(".google.spanner.admin.instance.v1.Instance.autoscalingConfig: object expected"); + message.autoscalingConfig = $root.google.spanner.admin.instance.v1.AutoscalingConfig.fromObject(object.autoscalingConfig); + } + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "CREATING": + case 1: + message.state = 1; + break; + case "READY": + case 2: + message.state = 2; + break; + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.spanner.admin.instance.v1.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]]); + } + switch (object.instanceType) { + default: + if (typeof object.instanceType === "number") { + message.instanceType = object.instanceType; + break; + } + break; + case "INSTANCE_TYPE_UNSPECIFIED": + case 0: + message.instanceType = 0; + break; + case "PROVISIONED": + case 1: + message.instanceType = 1; + break; + case "FREE_INSTANCE": + case 2: + message.instanceType = 2; + break; + } + if (object.endpointUris) { + if (!Array.isArray(object.endpointUris)) + throw TypeError(".google.spanner.admin.instance.v1.Instance.endpointUris: array expected"); + message.endpointUris = []; + for (var i = 0; i < object.endpointUris.length; ++i) + message.endpointUris[i] = String(object.endpointUris[i]); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.spanner.admin.instance.v1.Instance.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.spanner.admin.instance.v1.Instance.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.freeInstanceMetadata != null) { + if (typeof object.freeInstanceMetadata !== "object") + throw TypeError(".google.spanner.admin.instance.v1.Instance.freeInstanceMetadata: object expected"); + message.freeInstanceMetadata = $root.google.spanner.admin.instance.v1.FreeInstanceMetadata.fromObject(object.freeInstanceMetadata); + } + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNSPECIFIED": + case 0: + message.edition = 0; + break; + case "STANDARD": + case 1: + message.edition = 1; + break; + case "ENTERPRISE": + case 2: + message.edition = 2; + break; + case "ENTERPRISE_PLUS": + case 3: + message.edition = 3; + break; + } + switch (object.defaultBackupScheduleType) { + default: + if (typeof object.defaultBackupScheduleType === "number") { + message.defaultBackupScheduleType = object.defaultBackupScheduleType; + break; + } + break; + case "DEFAULT_BACKUP_SCHEDULE_TYPE_UNSPECIFIED": + case 0: + message.defaultBackupScheduleType = 0; + break; + case "NONE": + case 1: + message.defaultBackupScheduleType = 1; + break; + case "AUTOMATIC": + case 2: + message.defaultBackupScheduleType = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an Instance message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.instance.v1.Instance + * @static + * @param {google.spanner.admin.instance.v1.Instance} message Instance + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Instance.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.endpointUris = []; + object.replicaComputeCapacity = []; + } + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.config = ""; + object.displayName = ""; + object.nodeCount = 0; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.processingUnits = 0; + object.instanceType = options.enums === String ? "INSTANCE_TYPE_UNSPECIFIED" : 0; + object.createTime = null; + object.updateTime = null; + object.freeInstanceMetadata = null; + object.autoscalingConfig = null; + object.edition = options.enums === String ? "EDITION_UNSPECIFIED" : 0; + object.defaultBackupScheduleType = options.enums === String ? "DEFAULT_BACKUP_SCHEDULE_TYPE_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.config != null && message.hasOwnProperty("config")) + object.config = message.config; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + object.nodeCount = message.nodeCount; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.spanner.admin.instance.v1.Instance.State[message.state] === undefined ? message.state : $root.google.spanner.admin.instance.v1.Instance.State[message.state] : message.state; + 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.endpointUris && message.endpointUris.length) { + object.endpointUris = []; + for (var j = 0; j < message.endpointUris.length; ++j) + object.endpointUris[j] = message.endpointUris[j]; + } + if (message.processingUnits != null && message.hasOwnProperty("processingUnits")) + object.processingUnits = message.processingUnits; + if (message.instanceType != null && message.hasOwnProperty("instanceType")) + object.instanceType = options.enums === String ? $root.google.spanner.admin.instance.v1.Instance.InstanceType[message.instanceType] === undefined ? message.instanceType : $root.google.spanner.admin.instance.v1.Instance.InstanceType[message.instanceType] : message.instanceType; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.freeInstanceMetadata != null && message.hasOwnProperty("freeInstanceMetadata")) + object.freeInstanceMetadata = $root.google.spanner.admin.instance.v1.FreeInstanceMetadata.toObject(message.freeInstanceMetadata, options); + if (message.autoscalingConfig != null && message.hasOwnProperty("autoscalingConfig")) + object.autoscalingConfig = $root.google.spanner.admin.instance.v1.AutoscalingConfig.toObject(message.autoscalingConfig, options); + if (message.replicaComputeCapacity && message.replicaComputeCapacity.length) { + object.replicaComputeCapacity = []; + for (var j = 0; j < message.replicaComputeCapacity.length; ++j) + object.replicaComputeCapacity[j] = $root.google.spanner.admin.instance.v1.ReplicaComputeCapacity.toObject(message.replicaComputeCapacity[j], options); + } + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.spanner.admin.instance.v1.Instance.Edition[message.edition] === undefined ? message.edition : $root.google.spanner.admin.instance.v1.Instance.Edition[message.edition] : message.edition; + if (message.defaultBackupScheduleType != null && message.hasOwnProperty("defaultBackupScheduleType")) + object.defaultBackupScheduleType = options.enums === String ? $root.google.spanner.admin.instance.v1.Instance.DefaultBackupScheduleType[message.defaultBackupScheduleType] === undefined ? message.defaultBackupScheduleType : $root.google.spanner.admin.instance.v1.Instance.DefaultBackupScheduleType[message.defaultBackupScheduleType] : message.defaultBackupScheduleType; + return object; + }; + + /** + * Converts this Instance to JSON. + * @function toJSON + * @memberof google.spanner.admin.instance.v1.Instance + * @instance + * @returns {Object.} JSON object + */ + Instance.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Instance + * @function getTypeUrl + * @memberof google.spanner.admin.instance.v1.Instance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Instance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.instance.v1.Instance"; + }; + + /** + * State enum. + * @name google.spanner.admin.instance.v1.Instance.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} CREATING=1 CREATING value + * @property {number} READY=2 READY value + */ + Instance.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CREATING"] = 1; + values[valuesById[2] = "READY"] = 2; + return values; + })(); + + /** + * InstanceType enum. + * @name google.spanner.admin.instance.v1.Instance.InstanceType + * @enum {number} + * @property {number} INSTANCE_TYPE_UNSPECIFIED=0 INSTANCE_TYPE_UNSPECIFIED value + * @property {number} PROVISIONED=1 PROVISIONED value + * @property {number} FREE_INSTANCE=2 FREE_INSTANCE value + */ + Instance.InstanceType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INSTANCE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PROVISIONED"] = 1; + values[valuesById[2] = "FREE_INSTANCE"] = 2; + return values; + })(); + + /** + * Edition enum. + * @name google.spanner.admin.instance.v1.Instance.Edition + * @enum {number} + * @property {number} EDITION_UNSPECIFIED=0 EDITION_UNSPECIFIED value + * @property {number} STANDARD=1 STANDARD value + * @property {number} ENTERPRISE=2 ENTERPRISE value + * @property {number} ENTERPRISE_PLUS=3 ENTERPRISE_PLUS value + */ + Instance.Edition = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EDITION_UNSPECIFIED"] = 0; + values[valuesById[1] = "STANDARD"] = 1; + values[valuesById[2] = "ENTERPRISE"] = 2; + values[valuesById[3] = "ENTERPRISE_PLUS"] = 3; + return values; + })(); + + /** + * DefaultBackupScheduleType enum. + * @name google.spanner.admin.instance.v1.Instance.DefaultBackupScheduleType + * @enum {number} + * @property {number} DEFAULT_BACKUP_SCHEDULE_TYPE_UNSPECIFIED=0 DEFAULT_BACKUP_SCHEDULE_TYPE_UNSPECIFIED value + * @property {number} NONE=1 NONE value + * @property {number} AUTOMATIC=2 AUTOMATIC value + */ + Instance.DefaultBackupScheduleType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEFAULT_BACKUP_SCHEDULE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "NONE"] = 1; + values[valuesById[2] = "AUTOMATIC"] = 2; + return values; + })(); + + return Instance; + })(); + + v1.ListInstanceConfigsRequest = (function() { + + /** + * Properties of a ListInstanceConfigsRequest. + * @memberof google.spanner.admin.instance.v1 + * @interface IListInstanceConfigsRequest + * @property {string|null} [parent] ListInstanceConfigsRequest parent + * @property {number|null} [pageSize] ListInstanceConfigsRequest pageSize + * @property {string|null} [pageToken] ListInstanceConfigsRequest pageToken + */ + + /** + * Constructs a new ListInstanceConfigsRequest. + * @memberof google.spanner.admin.instance.v1 + * @classdesc Represents a ListInstanceConfigsRequest. + * @implements IListInstanceConfigsRequest + * @constructor + * @param {google.spanner.admin.instance.v1.IListInstanceConfigsRequest=} [properties] Properties to set + */ + function ListInstanceConfigsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListInstanceConfigsRequest parent. + * @member {string} parent + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsRequest + * @instance + */ + ListInstanceConfigsRequest.prototype.parent = ""; + + /** + * ListInstanceConfigsRequest pageSize. + * @member {number} pageSize + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsRequest + * @instance + */ + ListInstanceConfigsRequest.prototype.pageSize = 0; + + /** + * ListInstanceConfigsRequest pageToken. + * @member {string} pageToken + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsRequest + * @instance + */ + ListInstanceConfigsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListInstanceConfigsRequest instance using the specified properties. + * @function create + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsRequest + * @static + * @param {google.spanner.admin.instance.v1.IListInstanceConfigsRequest=} [properties] Properties to set + * @returns {google.spanner.admin.instance.v1.ListInstanceConfigsRequest} ListInstanceConfigsRequest instance + */ + ListInstanceConfigsRequest.create = function create(properties) { + return new ListInstanceConfigsRequest(properties); + }; + + /** + * Encodes the specified ListInstanceConfigsRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstanceConfigsRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsRequest + * @static + * @param {google.spanner.admin.instance.v1.IListInstanceConfigsRequest} message ListInstanceConfigsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstanceConfigsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListInstanceConfigsRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstanceConfigsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsRequest + * @static + * @param {google.spanner.admin.instance.v1.IListInstanceConfigsRequest} message ListInstanceConfigsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstanceConfigsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListInstanceConfigsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.instance.v1.ListInstanceConfigsRequest} ListInstanceConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstanceConfigsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.ListInstanceConfigsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListInstanceConfigsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.instance.v1.ListInstanceConfigsRequest} ListInstanceConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstanceConfigsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListInstanceConfigsRequest message. + * @function verify + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListInstanceConfigsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListInstanceConfigsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.instance.v1.ListInstanceConfigsRequest} ListInstanceConfigsRequest + */ + ListInstanceConfigsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.instance.v1.ListInstanceConfigsRequest) + return object; + var message = new $root.google.spanner.admin.instance.v1.ListInstanceConfigsRequest(); + 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 ListInstanceConfigsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsRequest + * @static + * @param {google.spanner.admin.instance.v1.ListInstanceConfigsRequest} message ListInstanceConfigsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListInstanceConfigsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListInstanceConfigsRequest to JSON. + * @function toJSON + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsRequest + * @instance + * @returns {Object.} JSON object + */ + ListInstanceConfigsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListInstanceConfigsRequest + * @function getTypeUrl + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListInstanceConfigsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.instance.v1.ListInstanceConfigsRequest"; + }; + + return ListInstanceConfigsRequest; + })(); + + v1.ListInstanceConfigsResponse = (function() { + + /** + * Properties of a ListInstanceConfigsResponse. + * @memberof google.spanner.admin.instance.v1 + * @interface IListInstanceConfigsResponse + * @property {Array.|null} [instanceConfigs] ListInstanceConfigsResponse instanceConfigs + * @property {string|null} [nextPageToken] ListInstanceConfigsResponse nextPageToken + */ + + /** + * Constructs a new ListInstanceConfigsResponse. + * @memberof google.spanner.admin.instance.v1 + * @classdesc Represents a ListInstanceConfigsResponse. + * @implements IListInstanceConfigsResponse + * @constructor + * @param {google.spanner.admin.instance.v1.IListInstanceConfigsResponse=} [properties] Properties to set + */ + function ListInstanceConfigsResponse(properties) { + this.instanceConfigs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListInstanceConfigsResponse instanceConfigs. + * @member {Array.} instanceConfigs + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsResponse + * @instance + */ + ListInstanceConfigsResponse.prototype.instanceConfigs = $util.emptyArray; + + /** + * ListInstanceConfigsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsResponse + * @instance + */ + ListInstanceConfigsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListInstanceConfigsResponse instance using the specified properties. + * @function create + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsResponse + * @static + * @param {google.spanner.admin.instance.v1.IListInstanceConfigsResponse=} [properties] Properties to set + * @returns {google.spanner.admin.instance.v1.ListInstanceConfigsResponse} ListInstanceConfigsResponse instance + */ + ListInstanceConfigsResponse.create = function create(properties) { + return new ListInstanceConfigsResponse(properties); + }; + + /** + * Encodes the specified ListInstanceConfigsResponse message. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstanceConfigsResponse.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsResponse + * @static + * @param {google.spanner.admin.instance.v1.IListInstanceConfigsResponse} message ListInstanceConfigsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstanceConfigsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.instanceConfigs != null && message.instanceConfigs.length) + for (var i = 0; i < message.instanceConfigs.length; ++i) + $root.google.spanner.admin.instance.v1.InstanceConfig.encode(message.instanceConfigs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListInstanceConfigsResponse message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstanceConfigsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsResponse + * @static + * @param {google.spanner.admin.instance.v1.IListInstanceConfigsResponse} message ListInstanceConfigsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstanceConfigsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListInstanceConfigsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.instance.v1.ListInstanceConfigsResponse} ListInstanceConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstanceConfigsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.ListInstanceConfigsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.instanceConfigs && message.instanceConfigs.length)) + message.instanceConfigs = []; + message.instanceConfigs.push($root.google.spanner.admin.instance.v1.InstanceConfig.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListInstanceConfigsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.instance.v1.ListInstanceConfigsResponse} ListInstanceConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstanceConfigsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListInstanceConfigsResponse message. + * @function verify + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListInstanceConfigsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.instanceConfigs != null && message.hasOwnProperty("instanceConfigs")) { + if (!Array.isArray(message.instanceConfigs)) + return "instanceConfigs: array expected"; + for (var i = 0; i < message.instanceConfigs.length; ++i) { + var error = $root.google.spanner.admin.instance.v1.InstanceConfig.verify(message.instanceConfigs[i]); + if (error) + return "instanceConfigs." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListInstanceConfigsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.instance.v1.ListInstanceConfigsResponse} ListInstanceConfigsResponse + */ + ListInstanceConfigsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.instance.v1.ListInstanceConfigsResponse) + return object; + var message = new $root.google.spanner.admin.instance.v1.ListInstanceConfigsResponse(); + if (object.instanceConfigs) { + if (!Array.isArray(object.instanceConfigs)) + throw TypeError(".google.spanner.admin.instance.v1.ListInstanceConfigsResponse.instanceConfigs: array expected"); + message.instanceConfigs = []; + for (var i = 0; i < object.instanceConfigs.length; ++i) { + if (typeof object.instanceConfigs[i] !== "object") + throw TypeError(".google.spanner.admin.instance.v1.ListInstanceConfigsResponse.instanceConfigs: object expected"); + message.instanceConfigs[i] = $root.google.spanner.admin.instance.v1.InstanceConfig.fromObject(object.instanceConfigs[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListInstanceConfigsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsResponse + * @static + * @param {google.spanner.admin.instance.v1.ListInstanceConfigsResponse} message ListInstanceConfigsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListInstanceConfigsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.instanceConfigs = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.instanceConfigs && message.instanceConfigs.length) { + object.instanceConfigs = []; + for (var j = 0; j < message.instanceConfigs.length; ++j) + object.instanceConfigs[j] = $root.google.spanner.admin.instance.v1.InstanceConfig.toObject(message.instanceConfigs[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListInstanceConfigsResponse to JSON. + * @function toJSON + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsResponse + * @instance + * @returns {Object.} JSON object + */ + ListInstanceConfigsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListInstanceConfigsResponse + * @function getTypeUrl + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListInstanceConfigsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.instance.v1.ListInstanceConfigsResponse"; + }; + + return ListInstanceConfigsResponse; + })(); + + v1.GetInstanceConfigRequest = (function() { + + /** + * Properties of a GetInstanceConfigRequest. + * @memberof google.spanner.admin.instance.v1 + * @interface IGetInstanceConfigRequest + * @property {string|null} [name] GetInstanceConfigRequest name + */ + + /** + * Constructs a new GetInstanceConfigRequest. + * @memberof google.spanner.admin.instance.v1 + * @classdesc Represents a GetInstanceConfigRequest. + * @implements IGetInstanceConfigRequest + * @constructor + * @param {google.spanner.admin.instance.v1.IGetInstanceConfigRequest=} [properties] Properties to set + */ + function GetInstanceConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetInstanceConfigRequest name. + * @member {string} name + * @memberof google.spanner.admin.instance.v1.GetInstanceConfigRequest + * @instance + */ + GetInstanceConfigRequest.prototype.name = ""; + + /** + * Creates a new GetInstanceConfigRequest instance using the specified properties. + * @function create + * @memberof google.spanner.admin.instance.v1.GetInstanceConfigRequest + * @static + * @param {google.spanner.admin.instance.v1.IGetInstanceConfigRequest=} [properties] Properties to set + * @returns {google.spanner.admin.instance.v1.GetInstanceConfigRequest} GetInstanceConfigRequest instance + */ + GetInstanceConfigRequest.create = function create(properties) { + return new GetInstanceConfigRequest(properties); + }; + + /** + * Encodes the specified GetInstanceConfigRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.GetInstanceConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.instance.v1.GetInstanceConfigRequest + * @static + * @param {google.spanner.admin.instance.v1.IGetInstanceConfigRequest} message GetInstanceConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetInstanceConfigRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetInstanceConfigRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.GetInstanceConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.instance.v1.GetInstanceConfigRequest + * @static + * @param {google.spanner.admin.instance.v1.IGetInstanceConfigRequest} message GetInstanceConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetInstanceConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetInstanceConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.instance.v1.GetInstanceConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.instance.v1.GetInstanceConfigRequest} GetInstanceConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetInstanceConfigRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.GetInstanceConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetInstanceConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.instance.v1.GetInstanceConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.instance.v1.GetInstanceConfigRequest} GetInstanceConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetInstanceConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetInstanceConfigRequest message. + * @function verify + * @memberof google.spanner.admin.instance.v1.GetInstanceConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetInstanceConfigRequest.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 GetInstanceConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.instance.v1.GetInstanceConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.instance.v1.GetInstanceConfigRequest} GetInstanceConfigRequest + */ + GetInstanceConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.instance.v1.GetInstanceConfigRequest) + return object; + var message = new $root.google.spanner.admin.instance.v1.GetInstanceConfigRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetInstanceConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.instance.v1.GetInstanceConfigRequest + * @static + * @param {google.spanner.admin.instance.v1.GetInstanceConfigRequest} message GetInstanceConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetInstanceConfigRequest.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 GetInstanceConfigRequest to JSON. + * @function toJSON + * @memberof google.spanner.admin.instance.v1.GetInstanceConfigRequest + * @instance + * @returns {Object.} JSON object + */ + GetInstanceConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetInstanceConfigRequest + * @function getTypeUrl + * @memberof google.spanner.admin.instance.v1.GetInstanceConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetInstanceConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.instance.v1.GetInstanceConfigRequest"; + }; + + return GetInstanceConfigRequest; + })(); + + v1.CreateInstanceConfigRequest = (function() { + + /** + * Properties of a CreateInstanceConfigRequest. + * @memberof google.spanner.admin.instance.v1 + * @interface ICreateInstanceConfigRequest + * @property {string|null} [parent] CreateInstanceConfigRequest parent + * @property {string|null} [instanceConfigId] CreateInstanceConfigRequest instanceConfigId + * @property {google.spanner.admin.instance.v1.IInstanceConfig|null} [instanceConfig] CreateInstanceConfigRequest instanceConfig + * @property {boolean|null} [validateOnly] CreateInstanceConfigRequest validateOnly + */ + + /** + * Constructs a new CreateInstanceConfigRequest. + * @memberof google.spanner.admin.instance.v1 + * @classdesc Represents a CreateInstanceConfigRequest. + * @implements ICreateInstanceConfigRequest + * @constructor + * @param {google.spanner.admin.instance.v1.ICreateInstanceConfigRequest=} [properties] Properties to set + */ + function CreateInstanceConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateInstanceConfigRequest parent. + * @member {string} parent + * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigRequest + * @instance + */ + CreateInstanceConfigRequest.prototype.parent = ""; + + /** + * CreateInstanceConfigRequest instanceConfigId. + * @member {string} instanceConfigId + * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigRequest + * @instance + */ + CreateInstanceConfigRequest.prototype.instanceConfigId = ""; + + /** + * CreateInstanceConfigRequest instanceConfig. + * @member {google.spanner.admin.instance.v1.IInstanceConfig|null|undefined} instanceConfig + * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigRequest + * @instance + */ + CreateInstanceConfigRequest.prototype.instanceConfig = null; + + /** + * CreateInstanceConfigRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigRequest + * @instance + */ + CreateInstanceConfigRequest.prototype.validateOnly = false; + + /** + * Creates a new CreateInstanceConfigRequest instance using the specified properties. + * @function create + * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigRequest + * @static + * @param {google.spanner.admin.instance.v1.ICreateInstanceConfigRequest=} [properties] Properties to set + * @returns {google.spanner.admin.instance.v1.CreateInstanceConfigRequest} CreateInstanceConfigRequest instance + */ + CreateInstanceConfigRequest.create = function create(properties) { + return new CreateInstanceConfigRequest(properties); + }; + + /** + * Encodes the specified CreateInstanceConfigRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.CreateInstanceConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigRequest + * @static + * @param {google.spanner.admin.instance.v1.ICreateInstanceConfigRequest} message CreateInstanceConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateInstanceConfigRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.instanceConfigId != null && Object.hasOwnProperty.call(message, "instanceConfigId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.instanceConfigId); + if (message.instanceConfig != null && Object.hasOwnProperty.call(message, "instanceConfig")) + $root.google.spanner.admin.instance.v1.InstanceConfig.encode(message.instanceConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified CreateInstanceConfigRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.CreateInstanceConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigRequest + * @static + * @param {google.spanner.admin.instance.v1.ICreateInstanceConfigRequest} message CreateInstanceConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateInstanceConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateInstanceConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.instance.v1.CreateInstanceConfigRequest} CreateInstanceConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateInstanceConfigRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.CreateInstanceConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.instanceConfigId = reader.string(); + break; + } + case 3: { + message.instanceConfig = $root.google.spanner.admin.instance.v1.InstanceConfig.decode(reader, reader.uint32()); + break; + } + case 4: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateInstanceConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.instance.v1.CreateInstanceConfigRequest} CreateInstanceConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateInstanceConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateInstanceConfigRequest message. + * @function verify + * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateInstanceConfigRequest.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.instanceConfigId != null && message.hasOwnProperty("instanceConfigId")) + if (!$util.isString(message.instanceConfigId)) + return "instanceConfigId: string expected"; + if (message.instanceConfig != null && message.hasOwnProperty("instanceConfig")) { + var error = $root.google.spanner.admin.instance.v1.InstanceConfig.verify(message.instanceConfig); + if (error) + return "instanceConfig." + error; + } + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates a CreateInstanceConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.instance.v1.CreateInstanceConfigRequest} CreateInstanceConfigRequest + */ + CreateInstanceConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.instance.v1.CreateInstanceConfigRequest) + return object; + var message = new $root.google.spanner.admin.instance.v1.CreateInstanceConfigRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.instanceConfigId != null) + message.instanceConfigId = String(object.instanceConfigId); + if (object.instanceConfig != null) { + if (typeof object.instanceConfig !== "object") + throw TypeError(".google.spanner.admin.instance.v1.CreateInstanceConfigRequest.instanceConfig: object expected"); + message.instanceConfig = $root.google.spanner.admin.instance.v1.InstanceConfig.fromObject(object.instanceConfig); + } + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from a CreateInstanceConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigRequest + * @static + * @param {google.spanner.admin.instance.v1.CreateInstanceConfigRequest} message CreateInstanceConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateInstanceConfigRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.instanceConfigId = ""; + object.instanceConfig = null; + object.validateOnly = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.instanceConfigId != null && message.hasOwnProperty("instanceConfigId")) + object.instanceConfigId = message.instanceConfigId; + if (message.instanceConfig != null && message.hasOwnProperty("instanceConfig")) + object.instanceConfig = $root.google.spanner.admin.instance.v1.InstanceConfig.toObject(message.instanceConfig, options); + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this CreateInstanceConfigRequest to JSON. + * @function toJSON + * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigRequest + * @instance + * @returns {Object.} JSON object + */ + CreateInstanceConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateInstanceConfigRequest + * @function getTypeUrl + * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateInstanceConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.instance.v1.CreateInstanceConfigRequest"; + }; + + return CreateInstanceConfigRequest; + })(); + + v1.UpdateInstanceConfigRequest = (function() { + + /** + * Properties of an UpdateInstanceConfigRequest. + * @memberof google.spanner.admin.instance.v1 + * @interface IUpdateInstanceConfigRequest + * @property {google.spanner.admin.instance.v1.IInstanceConfig|null} [instanceConfig] UpdateInstanceConfigRequest instanceConfig + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateInstanceConfigRequest updateMask + * @property {boolean|null} [validateOnly] UpdateInstanceConfigRequest validateOnly + */ + + /** + * Constructs a new UpdateInstanceConfigRequest. + * @memberof google.spanner.admin.instance.v1 + * @classdesc Represents an UpdateInstanceConfigRequest. + * @implements IUpdateInstanceConfigRequest + * @constructor + * @param {google.spanner.admin.instance.v1.IUpdateInstanceConfigRequest=} [properties] Properties to set + */ + function UpdateInstanceConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateInstanceConfigRequest instanceConfig. + * @member {google.spanner.admin.instance.v1.IInstanceConfig|null|undefined} instanceConfig + * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigRequest + * @instance + */ + UpdateInstanceConfigRequest.prototype.instanceConfig = null; + + /** + * UpdateInstanceConfigRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigRequest + * @instance + */ + UpdateInstanceConfigRequest.prototype.updateMask = null; + + /** + * UpdateInstanceConfigRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigRequest + * @instance + */ + UpdateInstanceConfigRequest.prototype.validateOnly = false; + + /** + * Creates a new UpdateInstanceConfigRequest instance using the specified properties. + * @function create + * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigRequest + * @static + * @param {google.spanner.admin.instance.v1.IUpdateInstanceConfigRequest=} [properties] Properties to set + * @returns {google.spanner.admin.instance.v1.UpdateInstanceConfigRequest} UpdateInstanceConfigRequest instance + */ + UpdateInstanceConfigRequest.create = function create(properties) { + return new UpdateInstanceConfigRequest(properties); + }; + + /** + * Encodes the specified UpdateInstanceConfigRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.UpdateInstanceConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigRequest + * @static + * @param {google.spanner.admin.instance.v1.IUpdateInstanceConfigRequest} message UpdateInstanceConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateInstanceConfigRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.instanceConfig != null && Object.hasOwnProperty.call(message, "instanceConfig")) + $root.google.spanner.admin.instance.v1.InstanceConfig.encode(message.instanceConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified UpdateInstanceConfigRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.UpdateInstanceConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigRequest + * @static + * @param {google.spanner.admin.instance.v1.IUpdateInstanceConfigRequest} message UpdateInstanceConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateInstanceConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateInstanceConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.instance.v1.UpdateInstanceConfigRequest} UpdateInstanceConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateInstanceConfigRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.UpdateInstanceConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.instanceConfig = $root.google.spanner.admin.instance.v1.InstanceConfig.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 3: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateInstanceConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.instance.v1.UpdateInstanceConfigRequest} UpdateInstanceConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateInstanceConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateInstanceConfigRequest message. + * @function verify + * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateInstanceConfigRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.instanceConfig != null && message.hasOwnProperty("instanceConfig")) { + var error = $root.google.spanner.admin.instance.v1.InstanceConfig.verify(message.instanceConfig); + if (error) + return "instanceConfig." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates an UpdateInstanceConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.instance.v1.UpdateInstanceConfigRequest} UpdateInstanceConfigRequest + */ + UpdateInstanceConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.instance.v1.UpdateInstanceConfigRequest) + return object; + var message = new $root.google.spanner.admin.instance.v1.UpdateInstanceConfigRequest(); + if (object.instanceConfig != null) { + if (typeof object.instanceConfig !== "object") + throw TypeError(".google.spanner.admin.instance.v1.UpdateInstanceConfigRequest.instanceConfig: object expected"); + message.instanceConfig = $root.google.spanner.admin.instance.v1.InstanceConfig.fromObject(object.instanceConfig); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.spanner.admin.instance.v1.UpdateInstanceConfigRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from an UpdateInstanceConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigRequest + * @static + * @param {google.spanner.admin.instance.v1.UpdateInstanceConfigRequest} message UpdateInstanceConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateInstanceConfigRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.instanceConfig = null; + object.updateMask = null; + object.validateOnly = false; + } + if (message.instanceConfig != null && message.hasOwnProperty("instanceConfig")) + object.instanceConfig = $root.google.spanner.admin.instance.v1.InstanceConfig.toObject(message.instanceConfig, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this UpdateInstanceConfigRequest to JSON. + * @function toJSON + * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateInstanceConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateInstanceConfigRequest + * @function getTypeUrl + * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateInstanceConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.instance.v1.UpdateInstanceConfigRequest"; + }; + + return UpdateInstanceConfigRequest; + })(); + + v1.DeleteInstanceConfigRequest = (function() { + + /** + * Properties of a DeleteInstanceConfigRequest. + * @memberof google.spanner.admin.instance.v1 + * @interface IDeleteInstanceConfigRequest + * @property {string|null} [name] DeleteInstanceConfigRequest name + * @property {string|null} [etag] DeleteInstanceConfigRequest etag + * @property {boolean|null} [validateOnly] DeleteInstanceConfigRequest validateOnly + */ + + /** + * Constructs a new DeleteInstanceConfigRequest. + * @memberof google.spanner.admin.instance.v1 + * @classdesc Represents a DeleteInstanceConfigRequest. + * @implements IDeleteInstanceConfigRequest + * @constructor + * @param {google.spanner.admin.instance.v1.IDeleteInstanceConfigRequest=} [properties] Properties to set + */ + function DeleteInstanceConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteInstanceConfigRequest name. + * @member {string} name + * @memberof google.spanner.admin.instance.v1.DeleteInstanceConfigRequest + * @instance + */ + DeleteInstanceConfigRequest.prototype.name = ""; + + /** + * DeleteInstanceConfigRequest etag. + * @member {string} etag + * @memberof google.spanner.admin.instance.v1.DeleteInstanceConfigRequest + * @instance + */ + DeleteInstanceConfigRequest.prototype.etag = ""; + + /** + * DeleteInstanceConfigRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.spanner.admin.instance.v1.DeleteInstanceConfigRequest + * @instance + */ + DeleteInstanceConfigRequest.prototype.validateOnly = false; + + /** + * Creates a new DeleteInstanceConfigRequest instance using the specified properties. + * @function create + * @memberof google.spanner.admin.instance.v1.DeleteInstanceConfigRequest + * @static + * @param {google.spanner.admin.instance.v1.IDeleteInstanceConfigRequest=} [properties] Properties to set + * @returns {google.spanner.admin.instance.v1.DeleteInstanceConfigRequest} DeleteInstanceConfigRequest instance + */ + DeleteInstanceConfigRequest.create = function create(properties) { + return new DeleteInstanceConfigRequest(properties); + }; + + /** + * Encodes the specified DeleteInstanceConfigRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.DeleteInstanceConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.instance.v1.DeleteInstanceConfigRequest + * @static + * @param {google.spanner.admin.instance.v1.IDeleteInstanceConfigRequest} message DeleteInstanceConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteInstanceConfigRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.etag); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified DeleteInstanceConfigRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.DeleteInstanceConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.instance.v1.DeleteInstanceConfigRequest + * @static + * @param {google.spanner.admin.instance.v1.IDeleteInstanceConfigRequest} message DeleteInstanceConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteInstanceConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteInstanceConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.instance.v1.DeleteInstanceConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.instance.v1.DeleteInstanceConfigRequest} DeleteInstanceConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteInstanceConfigRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.DeleteInstanceConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.etag = reader.string(); + break; + } + case 3: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteInstanceConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.instance.v1.DeleteInstanceConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.instance.v1.DeleteInstanceConfigRequest} DeleteInstanceConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteInstanceConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteInstanceConfigRequest message. + * @function verify + * @memberof google.spanner.admin.instance.v1.DeleteInstanceConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteInstanceConfigRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates a DeleteInstanceConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.instance.v1.DeleteInstanceConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.instance.v1.DeleteInstanceConfigRequest} DeleteInstanceConfigRequest + */ + DeleteInstanceConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.instance.v1.DeleteInstanceConfigRequest) + return object; + var message = new $root.google.spanner.admin.instance.v1.DeleteInstanceConfigRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.etag != null) + message.etag = String(object.etag); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from a DeleteInstanceConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.instance.v1.DeleteInstanceConfigRequest + * @static + * @param {google.spanner.admin.instance.v1.DeleteInstanceConfigRequest} message DeleteInstanceConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteInstanceConfigRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.etag = ""; + object.validateOnly = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this DeleteInstanceConfigRequest to JSON. + * @function toJSON + * @memberof google.spanner.admin.instance.v1.DeleteInstanceConfigRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteInstanceConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteInstanceConfigRequest + * @function getTypeUrl + * @memberof google.spanner.admin.instance.v1.DeleteInstanceConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteInstanceConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.instance.v1.DeleteInstanceConfigRequest"; + }; + + return DeleteInstanceConfigRequest; + })(); + + v1.ListInstanceConfigOperationsRequest = (function() { + + /** + * Properties of a ListInstanceConfigOperationsRequest. + * @memberof google.spanner.admin.instance.v1 + * @interface IListInstanceConfigOperationsRequest + * @property {string|null} [parent] ListInstanceConfigOperationsRequest parent + * @property {string|null} [filter] ListInstanceConfigOperationsRequest filter + * @property {number|null} [pageSize] ListInstanceConfigOperationsRequest pageSize + * @property {string|null} [pageToken] ListInstanceConfigOperationsRequest pageToken + */ + + /** + * Constructs a new ListInstanceConfigOperationsRequest. + * @memberof google.spanner.admin.instance.v1 + * @classdesc Represents a ListInstanceConfigOperationsRequest. + * @implements IListInstanceConfigOperationsRequest + * @constructor + * @param {google.spanner.admin.instance.v1.IListInstanceConfigOperationsRequest=} [properties] Properties to set + */ + function ListInstanceConfigOperationsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListInstanceConfigOperationsRequest parent. + * @member {string} parent + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest + * @instance + */ + ListInstanceConfigOperationsRequest.prototype.parent = ""; + + /** + * ListInstanceConfigOperationsRequest filter. + * @member {string} filter + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest + * @instance + */ + ListInstanceConfigOperationsRequest.prototype.filter = ""; + + /** + * ListInstanceConfigOperationsRequest pageSize. + * @member {number} pageSize + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest + * @instance + */ + ListInstanceConfigOperationsRequest.prototype.pageSize = 0; + + /** + * ListInstanceConfigOperationsRequest pageToken. + * @member {string} pageToken + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest + * @instance + */ + ListInstanceConfigOperationsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListInstanceConfigOperationsRequest instance using the specified properties. + * @function create + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest + * @static + * @param {google.spanner.admin.instance.v1.IListInstanceConfigOperationsRequest=} [properties] Properties to set + * @returns {google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest} ListInstanceConfigOperationsRequest instance + */ + ListInstanceConfigOperationsRequest.create = function create(properties) { + return new ListInstanceConfigOperationsRequest(properties); + }; + + /** + * Encodes the specified ListInstanceConfigOperationsRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest + * @static + * @param {google.spanner.admin.instance.v1.IListInstanceConfigOperationsRequest} message ListInstanceConfigOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstanceConfigOperationsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListInstanceConfigOperationsRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest + * @static + * @param {google.spanner.admin.instance.v1.IListInstanceConfigOperationsRequest} message ListInstanceConfigOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstanceConfigOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListInstanceConfigOperationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest} ListInstanceConfigOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstanceConfigOperationsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.filter = reader.string(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListInstanceConfigOperationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest} ListInstanceConfigOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstanceConfigOperationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListInstanceConfigOperationsRequest message. + * @function verify + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListInstanceConfigOperationsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.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 ListInstanceConfigOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest} ListInstanceConfigOperationsRequest + */ + ListInstanceConfigOperationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest) + return object; + var message = new $root.google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListInstanceConfigOperationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest + * @static + * @param {google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest} message ListInstanceConfigOperationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListInstanceConfigOperationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListInstanceConfigOperationsRequest to JSON. + * @function toJSON + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListInstanceConfigOperationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListInstanceConfigOperationsRequest + * @function getTypeUrl + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListInstanceConfigOperationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest"; + }; + + return ListInstanceConfigOperationsRequest; + })(); + + v1.ListInstanceConfigOperationsResponse = (function() { + + /** + * Properties of a ListInstanceConfigOperationsResponse. + * @memberof google.spanner.admin.instance.v1 + * @interface IListInstanceConfigOperationsResponse + * @property {Array.|null} [operations] ListInstanceConfigOperationsResponse operations + * @property {string|null} [nextPageToken] ListInstanceConfigOperationsResponse nextPageToken + */ + + /** + * Constructs a new ListInstanceConfigOperationsResponse. + * @memberof google.spanner.admin.instance.v1 + * @classdesc Represents a ListInstanceConfigOperationsResponse. + * @implements IListInstanceConfigOperationsResponse + * @constructor + * @param {google.spanner.admin.instance.v1.IListInstanceConfigOperationsResponse=} [properties] Properties to set + */ + function ListInstanceConfigOperationsResponse(properties) { + this.operations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListInstanceConfigOperationsResponse operations. + * @member {Array.} operations + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse + * @instance + */ + ListInstanceConfigOperationsResponse.prototype.operations = $util.emptyArray; + + /** + * ListInstanceConfigOperationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse + * @instance + */ + ListInstanceConfigOperationsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListInstanceConfigOperationsResponse instance using the specified properties. + * @function create + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse + * @static + * @param {google.spanner.admin.instance.v1.IListInstanceConfigOperationsResponse=} [properties] Properties to set + * @returns {google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse} ListInstanceConfigOperationsResponse instance + */ + ListInstanceConfigOperationsResponse.create = function create(properties) { + return new ListInstanceConfigOperationsResponse(properties); + }; + + /** + * Encodes the specified ListInstanceConfigOperationsResponse message. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse + * @static + * @param {google.spanner.admin.instance.v1.IListInstanceConfigOperationsResponse} message ListInstanceConfigOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstanceConfigOperationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.operations != null && message.operations.length) + for (var i = 0; i < message.operations.length; ++i) + $root.google.longrunning.Operation.encode(message.operations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListInstanceConfigOperationsResponse message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse + * @static + * @param {google.spanner.admin.instance.v1.IListInstanceConfigOperationsResponse} message ListInstanceConfigOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstanceConfigOperationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListInstanceConfigOperationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse} ListInstanceConfigOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstanceConfigOperationsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.operations && message.operations.length)) + message.operations = []; + message.operations.push($root.google.longrunning.Operation.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListInstanceConfigOperationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse} ListInstanceConfigOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstanceConfigOperationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListInstanceConfigOperationsResponse message. + * @function verify + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListInstanceConfigOperationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.operations != null && message.hasOwnProperty("operations")) { + if (!Array.isArray(message.operations)) + return "operations: array expected"; + for (var i = 0; i < message.operations.length; ++i) { + var error = $root.google.longrunning.Operation.verify(message.operations[i]); + if (error) + return "operations." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListInstanceConfigOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse} ListInstanceConfigOperationsResponse + */ + ListInstanceConfigOperationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse) + return object; + var message = new $root.google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse(); + if (object.operations) { + if (!Array.isArray(object.operations)) + throw TypeError(".google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse.operations: array expected"); + message.operations = []; + for (var i = 0; i < object.operations.length; ++i) { + if (typeof object.operations[i] !== "object") + throw TypeError(".google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse.operations: object expected"); + message.operations[i] = $root.google.longrunning.Operation.fromObject(object.operations[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListInstanceConfigOperationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse + * @static + * @param {google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse} message ListInstanceConfigOperationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListInstanceConfigOperationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.operations = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.operations && message.operations.length) { + object.operations = []; + for (var j = 0; j < message.operations.length; ++j) + object.operations[j] = $root.google.longrunning.Operation.toObject(message.operations[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListInstanceConfigOperationsResponse to JSON. + * @function toJSON + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse + * @instance + * @returns {Object.} JSON object + */ + ListInstanceConfigOperationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListInstanceConfigOperationsResponse + * @function getTypeUrl + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListInstanceConfigOperationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse"; + }; + + return ListInstanceConfigOperationsResponse; + })(); + + v1.GetInstanceRequest = (function() { + + /** + * Properties of a GetInstanceRequest. + * @memberof google.spanner.admin.instance.v1 + * @interface IGetInstanceRequest + * @property {string|null} [name] GetInstanceRequest name + * @property {google.protobuf.IFieldMask|null} [fieldMask] GetInstanceRequest fieldMask + */ + + /** + * Constructs a new GetInstanceRequest. + * @memberof google.spanner.admin.instance.v1 + * @classdesc Represents a GetInstanceRequest. + * @implements IGetInstanceRequest + * @constructor + * @param {google.spanner.admin.instance.v1.IGetInstanceRequest=} [properties] Properties to set + */ + function GetInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetInstanceRequest name. + * @member {string} name + * @memberof google.spanner.admin.instance.v1.GetInstanceRequest + * @instance + */ + GetInstanceRequest.prototype.name = ""; + + /** + * GetInstanceRequest fieldMask. + * @member {google.protobuf.IFieldMask|null|undefined} fieldMask + * @memberof google.spanner.admin.instance.v1.GetInstanceRequest + * @instance + */ + GetInstanceRequest.prototype.fieldMask = null; + + /** + * Creates a new GetInstanceRequest instance using the specified properties. + * @function create + * @memberof google.spanner.admin.instance.v1.GetInstanceRequest + * @static + * @param {google.spanner.admin.instance.v1.IGetInstanceRequest=} [properties] Properties to set + * @returns {google.spanner.admin.instance.v1.GetInstanceRequest} GetInstanceRequest instance + */ + GetInstanceRequest.create = function create(properties) { + return new GetInstanceRequest(properties); + }; + + /** + * Encodes the specified GetInstanceRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.GetInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.instance.v1.GetInstanceRequest + * @static + * @param {google.spanner.admin.instance.v1.IGetInstanceRequest} message GetInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.fieldMask != null && Object.hasOwnProperty.call(message, "fieldMask")) + $root.google.protobuf.FieldMask.encode(message.fieldMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetInstanceRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.GetInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.instance.v1.GetInstanceRequest + * @static + * @param {google.spanner.admin.instance.v1.IGetInstanceRequest} message GetInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.instance.v1.GetInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.instance.v1.GetInstanceRequest} GetInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetInstanceRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.GetInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.fieldMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + 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.spanner.admin.instance.v1.GetInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.instance.v1.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.spanner.admin.instance.v1.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"; + if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.fieldMask); + if (error) + return "fieldMask." + error; + } + return null; + }; + + /** + * Creates a GetInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.instance.v1.GetInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.instance.v1.GetInstanceRequest} GetInstanceRequest + */ + GetInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.instance.v1.GetInstanceRequest) + return object; + var message = new $root.google.spanner.admin.instance.v1.GetInstanceRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.fieldMask != null) { + if (typeof object.fieldMask !== "object") + throw TypeError(".google.spanner.admin.instance.v1.GetInstanceRequest.fieldMask: object expected"); + message.fieldMask = $root.google.protobuf.FieldMask.fromObject(object.fieldMask); + } + return message; + }; + + /** + * Creates a plain object from a GetInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.instance.v1.GetInstanceRequest + * @static + * @param {google.spanner.admin.instance.v1.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 = ""; + object.fieldMask = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) + object.fieldMask = $root.google.protobuf.FieldMask.toObject(message.fieldMask, options); + return object; + }; + + /** + * Converts this GetInstanceRequest to JSON. + * @function toJSON + * @memberof google.spanner.admin.instance.v1.GetInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + GetInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetInstanceRequest + * @function getTypeUrl + * @memberof google.spanner.admin.instance.v1.GetInstanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.instance.v1.GetInstanceRequest"; + }; + + return GetInstanceRequest; + })(); + + v1.CreateInstanceRequest = (function() { + + /** + * Properties of a CreateInstanceRequest. + * @memberof google.spanner.admin.instance.v1 + * @interface ICreateInstanceRequest + * @property {string|null} [parent] CreateInstanceRequest parent + * @property {string|null} [instanceId] CreateInstanceRequest instanceId + * @property {google.spanner.admin.instance.v1.IInstance|null} [instance] CreateInstanceRequest instance + */ + + /** + * Constructs a new CreateInstanceRequest. + * @memberof google.spanner.admin.instance.v1 + * @classdesc Represents a CreateInstanceRequest. + * @implements ICreateInstanceRequest + * @constructor + * @param {google.spanner.admin.instance.v1.ICreateInstanceRequest=} [properties] Properties to set + */ + function CreateInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateInstanceRequest parent. + * @member {string} parent + * @memberof google.spanner.admin.instance.v1.CreateInstanceRequest + * @instance + */ + CreateInstanceRequest.prototype.parent = ""; + + /** + * CreateInstanceRequest instanceId. + * @member {string} instanceId + * @memberof google.spanner.admin.instance.v1.CreateInstanceRequest + * @instance + */ + CreateInstanceRequest.prototype.instanceId = ""; + + /** + * CreateInstanceRequest instance. + * @member {google.spanner.admin.instance.v1.IInstance|null|undefined} instance + * @memberof google.spanner.admin.instance.v1.CreateInstanceRequest + * @instance + */ + CreateInstanceRequest.prototype.instance = null; + + /** + * Creates a new CreateInstanceRequest instance using the specified properties. + * @function create + * @memberof google.spanner.admin.instance.v1.CreateInstanceRequest + * @static + * @param {google.spanner.admin.instance.v1.ICreateInstanceRequest=} [properties] Properties to set + * @returns {google.spanner.admin.instance.v1.CreateInstanceRequest} CreateInstanceRequest instance + */ + CreateInstanceRequest.create = function create(properties) { + return new CreateInstanceRequest(properties); + }; + + /** + * Encodes the specified CreateInstanceRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.CreateInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.instance.v1.CreateInstanceRequest + * @static + * @param {google.spanner.admin.instance.v1.ICreateInstanceRequest} message CreateInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.instanceId); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + $root.google.spanner.admin.instance.v1.Instance.encode(message.instance, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateInstanceRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.CreateInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.instance.v1.CreateInstanceRequest + * @static + * @param {google.spanner.admin.instance.v1.ICreateInstanceRequest} message CreateInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.instance.v1.CreateInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.instance.v1.CreateInstanceRequest} CreateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateInstanceRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.CreateInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.instanceId = reader.string(); + break; + } + case 3: { + message.instance = $root.google.spanner.admin.instance.v1.Instance.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.instance.v1.CreateInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.instance.v1.CreateInstanceRequest} CreateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateInstanceRequest message. + * @function verify + * @memberof google.spanner.admin.instance.v1.CreateInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateInstanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + if (!$util.isString(message.instanceId)) + return "instanceId: string expected"; + if (message.instance != null && message.hasOwnProperty("instance")) { + var error = $root.google.spanner.admin.instance.v1.Instance.verify(message.instance); + if (error) + return "instance." + error; + } + return null; + }; + + /** + * Creates a CreateInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.instance.v1.CreateInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.instance.v1.CreateInstanceRequest} CreateInstanceRequest + */ + CreateInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.instance.v1.CreateInstanceRequest) + return object; + var message = new $root.google.spanner.admin.instance.v1.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.spanner.admin.instance.v1.CreateInstanceRequest.instance: object expected"); + message.instance = $root.google.spanner.admin.instance.v1.Instance.fromObject(object.instance); + } + return message; + }; + + /** + * Creates a plain object from a CreateInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.instance.v1.CreateInstanceRequest + * @static + * @param {google.spanner.admin.instance.v1.CreateInstanceRequest} message CreateInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.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.spanner.admin.instance.v1.Instance.toObject(message.instance, options); + return object; + }; + + /** + * Converts this CreateInstanceRequest to JSON. + * @function toJSON + * @memberof google.spanner.admin.instance.v1.CreateInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + CreateInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateInstanceRequest + * @function getTypeUrl + * @memberof google.spanner.admin.instance.v1.CreateInstanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.instance.v1.CreateInstanceRequest"; + }; + + return CreateInstanceRequest; + })(); + + v1.ListInstancesRequest = (function() { + + /** + * Properties of a ListInstancesRequest. + * @memberof google.spanner.admin.instance.v1 + * @interface IListInstancesRequest + * @property {string|null} [parent] ListInstancesRequest parent + * @property {number|null} [pageSize] ListInstancesRequest pageSize + * @property {string|null} [pageToken] ListInstancesRequest pageToken + * @property {string|null} [filter] ListInstancesRequest filter + * @property {google.protobuf.ITimestamp|null} [instanceDeadline] ListInstancesRequest instanceDeadline + */ + + /** + * Constructs a new ListInstancesRequest. + * @memberof google.spanner.admin.instance.v1 + * @classdesc Represents a ListInstancesRequest. + * @implements IListInstancesRequest + * @constructor + * @param {google.spanner.admin.instance.v1.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.spanner.admin.instance.v1.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.parent = ""; + + /** + * ListInstancesRequest pageSize. + * @member {number} pageSize + * @memberof google.spanner.admin.instance.v1.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.pageSize = 0; + + /** + * ListInstancesRequest pageToken. + * @member {string} pageToken + * @memberof google.spanner.admin.instance.v1.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.pageToken = ""; + + /** + * ListInstancesRequest filter. + * @member {string} filter + * @memberof google.spanner.admin.instance.v1.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.filter = ""; + + /** + * ListInstancesRequest instanceDeadline. + * @member {google.protobuf.ITimestamp|null|undefined} instanceDeadline + * @memberof google.spanner.admin.instance.v1.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.instanceDeadline = null; + + /** + * Creates a new ListInstancesRequest instance using the specified properties. + * @function create + * @memberof google.spanner.admin.instance.v1.ListInstancesRequest + * @static + * @param {google.spanner.admin.instance.v1.IListInstancesRequest=} [properties] Properties to set + * @returns {google.spanner.admin.instance.v1.ListInstancesRequest} ListInstancesRequest instance + */ + ListInstancesRequest.create = function create(properties) { + return new ListInstancesRequest(properties); + }; + + /** + * Encodes the specified ListInstancesRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancesRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.instance.v1.ListInstancesRequest + * @static + * @param {google.spanner.admin.instance.v1.IListInstancesRequest} message ListInstancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstancesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.instanceDeadline != null && Object.hasOwnProperty.call(message, "instanceDeadline")) + $root.google.protobuf.Timestamp.encode(message.instanceDeadline, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ListInstancesRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.instance.v1.ListInstancesRequest + * @static + * @param {google.spanner.admin.instance.v1.IListInstancesRequest} message ListInstancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstancesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListInstancesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.instance.v1.ListInstancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.instance.v1.ListInstancesRequest} ListInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstancesRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.ListInstancesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.instanceDeadline = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListInstancesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.instance.v1.ListInstancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.instance.v1.ListInstancesRequest} ListInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstancesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListInstancesRequest message. + * @function verify + * @memberof google.spanner.admin.instance.v1.ListInstancesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListInstancesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.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.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.instanceDeadline != null && message.hasOwnProperty("instanceDeadline")) { + var error = $root.google.protobuf.Timestamp.verify(message.instanceDeadline); + if (error) + return "instanceDeadline." + error; + } + return null; + }; + + /** + * Creates a ListInstancesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.instance.v1.ListInstancesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.instance.v1.ListInstancesRequest} ListInstancesRequest + */ + ListInstancesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.instance.v1.ListInstancesRequest) + return object; + var message = new $root.google.spanner.admin.instance.v1.ListInstancesRequest(); + 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); + if (object.filter != null) + message.filter = String(object.filter); + if (object.instanceDeadline != null) { + if (typeof object.instanceDeadline !== "object") + throw TypeError(".google.spanner.admin.instance.v1.ListInstancesRequest.instanceDeadline: object expected"); + message.instanceDeadline = $root.google.protobuf.Timestamp.fromObject(object.instanceDeadline); + } + return message; + }; + + /** + * Creates a plain object from a ListInstancesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.instance.v1.ListInstancesRequest + * @static + * @param {google.spanner.admin.instance.v1.ListInstancesRequest} message ListInstancesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListInstancesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.instanceDeadline = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.instanceDeadline != null && message.hasOwnProperty("instanceDeadline")) + object.instanceDeadline = $root.google.protobuf.Timestamp.toObject(message.instanceDeadline, options); + return object; + }; + + /** + * Converts this ListInstancesRequest to JSON. + * @function toJSON + * @memberof google.spanner.admin.instance.v1.ListInstancesRequest + * @instance + * @returns {Object.} JSON object + */ + ListInstancesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListInstancesRequest + * @function getTypeUrl + * @memberof google.spanner.admin.instance.v1.ListInstancesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListInstancesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.instance.v1.ListInstancesRequest"; + }; + + return ListInstancesRequest; + })(); + + v1.ListInstancesResponse = (function() { + + /** + * Properties of a ListInstancesResponse. + * @memberof google.spanner.admin.instance.v1 + * @interface IListInstancesResponse + * @property {Array.|null} [instances] ListInstancesResponse instances + * @property {string|null} [nextPageToken] ListInstancesResponse nextPageToken + * @property {Array.|null} [unreachable] ListInstancesResponse unreachable + */ + + /** + * Constructs a new ListInstancesResponse. + * @memberof google.spanner.admin.instance.v1 + * @classdesc Represents a ListInstancesResponse. + * @implements IListInstancesResponse + * @constructor + * @param {google.spanner.admin.instance.v1.IListInstancesResponse=} [properties] Properties to set + */ + function ListInstancesResponse(properties) { + this.instances = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListInstancesResponse instances. + * @member {Array.} instances + * @memberof google.spanner.admin.instance.v1.ListInstancesResponse + * @instance + */ + ListInstancesResponse.prototype.instances = $util.emptyArray; + + /** + * ListInstancesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.spanner.admin.instance.v1.ListInstancesResponse + * @instance + */ + ListInstancesResponse.prototype.nextPageToken = ""; + + /** + * ListInstancesResponse unreachable. + * @member {Array.} unreachable + * @memberof google.spanner.admin.instance.v1.ListInstancesResponse + * @instance + */ + ListInstancesResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListInstancesResponse instance using the specified properties. + * @function create + * @memberof google.spanner.admin.instance.v1.ListInstancesResponse + * @static + * @param {google.spanner.admin.instance.v1.IListInstancesResponse=} [properties] Properties to set + * @returns {google.spanner.admin.instance.v1.ListInstancesResponse} ListInstancesResponse instance + */ + ListInstancesResponse.create = function create(properties) { + return new ListInstancesResponse(properties); + }; + + /** + * Encodes the specified ListInstancesResponse message. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancesResponse.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.instance.v1.ListInstancesResponse + * @static + * @param {google.spanner.admin.instance.v1.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.spanner.admin.instance.v1.Instance.encode(message.instances[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListInstancesResponse message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.instance.v1.ListInstancesResponse + * @static + * @param {google.spanner.admin.instance.v1.IListInstancesResponse} message ListInstancesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstancesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListInstancesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.instance.v1.ListInstancesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.instance.v1.ListInstancesResponse} ListInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstancesResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.ListInstancesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.instances && message.instances.length)) + message.instances = []; + message.instances.push($root.google.spanner.admin.instance.v1.Instance.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListInstancesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.instance.v1.ListInstancesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.instance.v1.ListInstancesResponse} ListInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstancesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListInstancesResponse message. + * @function verify + * @memberof google.spanner.admin.instance.v1.ListInstancesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListInstancesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.instances != null && message.hasOwnProperty("instances")) { + if (!Array.isArray(message.instances)) + return "instances: array expected"; + for (var i = 0; i < message.instances.length; ++i) { + var error = $root.google.spanner.admin.instance.v1.Instance.verify(message.instances[i]); + if (error) + return "instances." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListInstancesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.instance.v1.ListInstancesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.instance.v1.ListInstancesResponse} ListInstancesResponse + */ + ListInstancesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.instance.v1.ListInstancesResponse) + return object; + var message = new $root.google.spanner.admin.instance.v1.ListInstancesResponse(); + if (object.instances) { + if (!Array.isArray(object.instances)) + throw TypeError(".google.spanner.admin.instance.v1.ListInstancesResponse.instances: array expected"); + message.instances = []; + for (var i = 0; i < object.instances.length; ++i) { + if (typeof object.instances[i] !== "object") + throw TypeError(".google.spanner.admin.instance.v1.ListInstancesResponse.instances: object expected"); + message.instances[i] = $root.google.spanner.admin.instance.v1.Instance.fromObject(object.instances[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.spanner.admin.instance.v1.ListInstancesResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListInstancesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.instance.v1.ListInstancesResponse + * @static + * @param {google.spanner.admin.instance.v1.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.unreachable = []; + } + 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.spanner.admin.instance.v1.Instance.toObject(message.instances[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListInstancesResponse to JSON. + * @function toJSON + * @memberof google.spanner.admin.instance.v1.ListInstancesResponse + * @instance + * @returns {Object.} JSON object + */ + ListInstancesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListInstancesResponse + * @function getTypeUrl + * @memberof google.spanner.admin.instance.v1.ListInstancesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListInstancesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.instance.v1.ListInstancesResponse"; + }; + + return ListInstancesResponse; + })(); + + v1.UpdateInstanceRequest = (function() { + + /** + * Properties of an UpdateInstanceRequest. + * @memberof google.spanner.admin.instance.v1 + * @interface IUpdateInstanceRequest + * @property {google.spanner.admin.instance.v1.IInstance|null} [instance] UpdateInstanceRequest instance + * @property {google.protobuf.IFieldMask|null} [fieldMask] UpdateInstanceRequest fieldMask + */ + + /** + * Constructs a new UpdateInstanceRequest. + * @memberof google.spanner.admin.instance.v1 + * @classdesc Represents an UpdateInstanceRequest. + * @implements IUpdateInstanceRequest + * @constructor + * @param {google.spanner.admin.instance.v1.IUpdateInstanceRequest=} [properties] Properties to set + */ + function UpdateInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateInstanceRequest instance. + * @member {google.spanner.admin.instance.v1.IInstance|null|undefined} instance + * @memberof google.spanner.admin.instance.v1.UpdateInstanceRequest + * @instance + */ + UpdateInstanceRequest.prototype.instance = null; + + /** + * UpdateInstanceRequest fieldMask. + * @member {google.protobuf.IFieldMask|null|undefined} fieldMask + * @memberof google.spanner.admin.instance.v1.UpdateInstanceRequest + * @instance + */ + UpdateInstanceRequest.prototype.fieldMask = null; + + /** + * Creates a new UpdateInstanceRequest instance using the specified properties. + * @function create + * @memberof google.spanner.admin.instance.v1.UpdateInstanceRequest + * @static + * @param {google.spanner.admin.instance.v1.IUpdateInstanceRequest=} [properties] Properties to set + * @returns {google.spanner.admin.instance.v1.UpdateInstanceRequest} UpdateInstanceRequest instance + */ + UpdateInstanceRequest.create = function create(properties) { + return new UpdateInstanceRequest(properties); + }; + + /** + * Encodes the specified UpdateInstanceRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.UpdateInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.instance.v1.UpdateInstanceRequest + * @static + * @param {google.spanner.admin.instance.v1.IUpdateInstanceRequest} message UpdateInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + $root.google.spanner.admin.instance.v1.Instance.encode(message.instance, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fieldMask != null && Object.hasOwnProperty.call(message, "fieldMask")) + $root.google.protobuf.FieldMask.encode(message.fieldMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateInstanceRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.UpdateInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.instance.v1.UpdateInstanceRequest + * @static + * @param {google.spanner.admin.instance.v1.IUpdateInstanceRequest} message UpdateInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.instance.v1.UpdateInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.instance.v1.UpdateInstanceRequest} UpdateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateInstanceRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.UpdateInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.instance = $root.google.spanner.admin.instance.v1.Instance.decode(reader, reader.uint32()); + break; + } + case 2: { + message.fieldMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.instance.v1.UpdateInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.instance.v1.UpdateInstanceRequest} UpdateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateInstanceRequest message. + * @function verify + * @memberof google.spanner.admin.instance.v1.UpdateInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateInstanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.instance != null && message.hasOwnProperty("instance")) { + var error = $root.google.spanner.admin.instance.v1.Instance.verify(message.instance); + if (error) + return "instance." + error; + } + if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.fieldMask); + if (error) + return "fieldMask." + error; + } + return null; + }; + + /** + * Creates an UpdateInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.instance.v1.UpdateInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.instance.v1.UpdateInstanceRequest} UpdateInstanceRequest + */ + UpdateInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.instance.v1.UpdateInstanceRequest) + return object; + var message = new $root.google.spanner.admin.instance.v1.UpdateInstanceRequest(); + if (object.instance != null) { + if (typeof object.instance !== "object") + throw TypeError(".google.spanner.admin.instance.v1.UpdateInstanceRequest.instance: object expected"); + message.instance = $root.google.spanner.admin.instance.v1.Instance.fromObject(object.instance); + } + if (object.fieldMask != null) { + if (typeof object.fieldMask !== "object") + throw TypeError(".google.spanner.admin.instance.v1.UpdateInstanceRequest.fieldMask: object expected"); + message.fieldMask = $root.google.protobuf.FieldMask.fromObject(object.fieldMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.instance.v1.UpdateInstanceRequest + * @static + * @param {google.spanner.admin.instance.v1.UpdateInstanceRequest} message UpdateInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.instance = null; + object.fieldMask = null; + } + if (message.instance != null && message.hasOwnProperty("instance")) + object.instance = $root.google.spanner.admin.instance.v1.Instance.toObject(message.instance, options); + if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) + object.fieldMask = $root.google.protobuf.FieldMask.toObject(message.fieldMask, options); + return object; + }; + + /** + * Converts this UpdateInstanceRequest to JSON. + * @function toJSON + * @memberof google.spanner.admin.instance.v1.UpdateInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateInstanceRequest + * @function getTypeUrl + * @memberof google.spanner.admin.instance.v1.UpdateInstanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.instance.v1.UpdateInstanceRequest"; + }; + + return UpdateInstanceRequest; + })(); + + v1.DeleteInstanceRequest = (function() { + + /** + * Properties of a DeleteInstanceRequest. + * @memberof google.spanner.admin.instance.v1 + * @interface IDeleteInstanceRequest + * @property {string|null} [name] DeleteInstanceRequest name + */ + + /** + * Constructs a new DeleteInstanceRequest. + * @memberof google.spanner.admin.instance.v1 + * @classdesc Represents a DeleteInstanceRequest. + * @implements IDeleteInstanceRequest + * @constructor + * @param {google.spanner.admin.instance.v1.IDeleteInstanceRequest=} [properties] Properties to set + */ + function DeleteInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteInstanceRequest name. + * @member {string} name + * @memberof google.spanner.admin.instance.v1.DeleteInstanceRequest + * @instance + */ + DeleteInstanceRequest.prototype.name = ""; + + /** + * Creates a new DeleteInstanceRequest instance using the specified properties. + * @function create + * @memberof google.spanner.admin.instance.v1.DeleteInstanceRequest + * @static + * @param {google.spanner.admin.instance.v1.IDeleteInstanceRequest=} [properties] Properties to set + * @returns {google.spanner.admin.instance.v1.DeleteInstanceRequest} DeleteInstanceRequest instance + */ + DeleteInstanceRequest.create = function create(properties) { + return new DeleteInstanceRequest(properties); + }; + + /** + * Encodes the specified DeleteInstanceRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.DeleteInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.instance.v1.DeleteInstanceRequest + * @static + * @param {google.spanner.admin.instance.v1.IDeleteInstanceRequest} message DeleteInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteInstanceRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.DeleteInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.instance.v1.DeleteInstanceRequest + * @static + * @param {google.spanner.admin.instance.v1.IDeleteInstanceRequest} message DeleteInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.instance.v1.DeleteInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.instance.v1.DeleteInstanceRequest} DeleteInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteInstanceRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.DeleteInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.instance.v1.DeleteInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.instance.v1.DeleteInstanceRequest} DeleteInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteInstanceRequest message. + * @function verify + * @memberof google.spanner.admin.instance.v1.DeleteInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteInstanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.instance.v1.DeleteInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.instance.v1.DeleteInstanceRequest} DeleteInstanceRequest + */ + DeleteInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.instance.v1.DeleteInstanceRequest) + return object; + var message = new $root.google.spanner.admin.instance.v1.DeleteInstanceRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.instance.v1.DeleteInstanceRequest + * @static + * @param {google.spanner.admin.instance.v1.DeleteInstanceRequest} message DeleteInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteInstanceRequest to JSON. + * @function toJSON + * @memberof google.spanner.admin.instance.v1.DeleteInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteInstanceRequest + * @function getTypeUrl + * @memberof google.spanner.admin.instance.v1.DeleteInstanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.instance.v1.DeleteInstanceRequest"; + }; + + return DeleteInstanceRequest; + })(); + + v1.CreateInstanceMetadata = (function() { + + /** + * Properties of a CreateInstanceMetadata. + * @memberof google.spanner.admin.instance.v1 + * @interface ICreateInstanceMetadata + * @property {google.spanner.admin.instance.v1.IInstance|null} [instance] CreateInstanceMetadata instance + * @property {google.protobuf.ITimestamp|null} [startTime] CreateInstanceMetadata startTime + * @property {google.protobuf.ITimestamp|null} [cancelTime] CreateInstanceMetadata cancelTime + * @property {google.protobuf.ITimestamp|null} [endTime] CreateInstanceMetadata endTime + * @property {google.spanner.admin.instance.v1.FulfillmentPeriod|null} [expectedFulfillmentPeriod] CreateInstanceMetadata expectedFulfillmentPeriod + */ + + /** + * Constructs a new CreateInstanceMetadata. + * @memberof google.spanner.admin.instance.v1 + * @classdesc Represents a CreateInstanceMetadata. + * @implements ICreateInstanceMetadata + * @constructor + * @param {google.spanner.admin.instance.v1.ICreateInstanceMetadata=} [properties] Properties to set + */ + function CreateInstanceMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateInstanceMetadata instance. + * @member {google.spanner.admin.instance.v1.IInstance|null|undefined} instance + * @memberof google.spanner.admin.instance.v1.CreateInstanceMetadata + * @instance + */ + CreateInstanceMetadata.prototype.instance = null; + + /** + * CreateInstanceMetadata startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.spanner.admin.instance.v1.CreateInstanceMetadata + * @instance + */ + CreateInstanceMetadata.prototype.startTime = null; + + /** + * CreateInstanceMetadata cancelTime. + * @member {google.protobuf.ITimestamp|null|undefined} cancelTime + * @memberof google.spanner.admin.instance.v1.CreateInstanceMetadata + * @instance + */ + CreateInstanceMetadata.prototype.cancelTime = null; + + /** + * CreateInstanceMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.spanner.admin.instance.v1.CreateInstanceMetadata + * @instance + */ + CreateInstanceMetadata.prototype.endTime = null; + + /** + * CreateInstanceMetadata expectedFulfillmentPeriod. + * @member {google.spanner.admin.instance.v1.FulfillmentPeriod} expectedFulfillmentPeriod + * @memberof google.spanner.admin.instance.v1.CreateInstanceMetadata + * @instance + */ + CreateInstanceMetadata.prototype.expectedFulfillmentPeriod = 0; + + /** + * Creates a new CreateInstanceMetadata instance using the specified properties. + * @function create + * @memberof google.spanner.admin.instance.v1.CreateInstanceMetadata + * @static + * @param {google.spanner.admin.instance.v1.ICreateInstanceMetadata=} [properties] Properties to set + * @returns {google.spanner.admin.instance.v1.CreateInstanceMetadata} CreateInstanceMetadata instance + */ + CreateInstanceMetadata.create = function create(properties) { + return new CreateInstanceMetadata(properties); + }; + + /** + * Encodes the specified CreateInstanceMetadata message. Does not implicitly {@link google.spanner.admin.instance.v1.CreateInstanceMetadata.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.instance.v1.CreateInstanceMetadata + * @static + * @param {google.spanner.admin.instance.v1.ICreateInstanceMetadata} message CreateInstanceMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateInstanceMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + $root.google.spanner.admin.instance.v1.Instance.encode(message.instance, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.cancelTime != null && Object.hasOwnProperty.call(message, "cancelTime")) + $root.google.protobuf.Timestamp.encode(message.cancelTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.expectedFulfillmentPeriod != null && Object.hasOwnProperty.call(message, "expectedFulfillmentPeriod")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.expectedFulfillmentPeriod); + return writer; + }; + + /** + * Encodes the specified CreateInstanceMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.CreateInstanceMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.instance.v1.CreateInstanceMetadata + * @static + * @param {google.spanner.admin.instance.v1.ICreateInstanceMetadata} message CreateInstanceMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateInstanceMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateInstanceMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.instance.v1.CreateInstanceMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.instance.v1.CreateInstanceMetadata} CreateInstanceMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateInstanceMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.CreateInstanceMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.instance = $root.google.spanner.admin.instance.v1.Instance.decode(reader, reader.uint32()); + break; + } + case 2: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.cancelTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.expectedFulfillmentPeriod = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateInstanceMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.instance.v1.CreateInstanceMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.instance.v1.CreateInstanceMetadata} CreateInstanceMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateInstanceMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateInstanceMetadata message. + * @function verify + * @memberof google.spanner.admin.instance.v1.CreateInstanceMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateInstanceMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.instance != null && message.hasOwnProperty("instance")) { + var error = $root.google.spanner.admin.instance.v1.Instance.verify(message.instance); + if (error) + return "instance." + error; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.cancelTime); + if (error) + return "cancelTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.expectedFulfillmentPeriod != null && message.hasOwnProperty("expectedFulfillmentPeriod")) + switch (message.expectedFulfillmentPeriod) { + default: + return "expectedFulfillmentPeriod: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a CreateInstanceMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.instance.v1.CreateInstanceMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.instance.v1.CreateInstanceMetadata} CreateInstanceMetadata + */ + CreateInstanceMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.instance.v1.CreateInstanceMetadata) + return object; + var message = new $root.google.spanner.admin.instance.v1.CreateInstanceMetadata(); + if (object.instance != null) { + if (typeof object.instance !== "object") + throw TypeError(".google.spanner.admin.instance.v1.CreateInstanceMetadata.instance: object expected"); + message.instance = $root.google.spanner.admin.instance.v1.Instance.fromObject(object.instance); + } + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.spanner.admin.instance.v1.CreateInstanceMetadata.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.cancelTime != null) { + if (typeof object.cancelTime !== "object") + throw TypeError(".google.spanner.admin.instance.v1.CreateInstanceMetadata.cancelTime: object expected"); + message.cancelTime = $root.google.protobuf.Timestamp.fromObject(object.cancelTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.spanner.admin.instance.v1.CreateInstanceMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + switch (object.expectedFulfillmentPeriod) { + default: + if (typeof object.expectedFulfillmentPeriod === "number") { + message.expectedFulfillmentPeriod = object.expectedFulfillmentPeriod; + break; + } + break; + case "FULFILLMENT_PERIOD_UNSPECIFIED": + case 0: + message.expectedFulfillmentPeriod = 0; + break; + case "FULFILLMENT_PERIOD_NORMAL": + case 1: + message.expectedFulfillmentPeriod = 1; + break; + case "FULFILLMENT_PERIOD_EXTENDED": + case 2: + message.expectedFulfillmentPeriod = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a CreateInstanceMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.instance.v1.CreateInstanceMetadata + * @static + * @param {google.spanner.admin.instance.v1.CreateInstanceMetadata} message CreateInstanceMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateInstanceMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.instance = null; + object.startTime = null; + object.cancelTime = null; + object.endTime = null; + object.expectedFulfillmentPeriod = options.enums === String ? "FULFILLMENT_PERIOD_UNSPECIFIED" : 0; + } + if (message.instance != null && message.hasOwnProperty("instance")) + object.instance = $root.google.spanner.admin.instance.v1.Instance.toObject(message.instance, options); + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) + object.cancelTime = $root.google.protobuf.Timestamp.toObject(message.cancelTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.expectedFulfillmentPeriod != null && message.hasOwnProperty("expectedFulfillmentPeriod")) + object.expectedFulfillmentPeriod = options.enums === String ? $root.google.spanner.admin.instance.v1.FulfillmentPeriod[message.expectedFulfillmentPeriod] === undefined ? message.expectedFulfillmentPeriod : $root.google.spanner.admin.instance.v1.FulfillmentPeriod[message.expectedFulfillmentPeriod] : message.expectedFulfillmentPeriod; + return object; + }; + + /** + * Converts this CreateInstanceMetadata to JSON. + * @function toJSON + * @memberof google.spanner.admin.instance.v1.CreateInstanceMetadata + * @instance + * @returns {Object.} JSON object + */ + CreateInstanceMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateInstanceMetadata + * @function getTypeUrl + * @memberof google.spanner.admin.instance.v1.CreateInstanceMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateInstanceMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.instance.v1.CreateInstanceMetadata"; + }; + + return CreateInstanceMetadata; + })(); + + v1.UpdateInstanceMetadata = (function() { + + /** + * Properties of an UpdateInstanceMetadata. + * @memberof google.spanner.admin.instance.v1 + * @interface IUpdateInstanceMetadata + * @property {google.spanner.admin.instance.v1.IInstance|null} [instance] UpdateInstanceMetadata instance + * @property {google.protobuf.ITimestamp|null} [startTime] UpdateInstanceMetadata startTime + * @property {google.protobuf.ITimestamp|null} [cancelTime] UpdateInstanceMetadata cancelTime + * @property {google.protobuf.ITimestamp|null} [endTime] UpdateInstanceMetadata endTime + * @property {google.spanner.admin.instance.v1.FulfillmentPeriod|null} [expectedFulfillmentPeriod] UpdateInstanceMetadata expectedFulfillmentPeriod + */ + + /** + * Constructs a new UpdateInstanceMetadata. + * @memberof google.spanner.admin.instance.v1 + * @classdesc Represents an UpdateInstanceMetadata. + * @implements IUpdateInstanceMetadata + * @constructor + * @param {google.spanner.admin.instance.v1.IUpdateInstanceMetadata=} [properties] Properties to set + */ + function UpdateInstanceMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateInstanceMetadata instance. + * @member {google.spanner.admin.instance.v1.IInstance|null|undefined} instance + * @memberof google.spanner.admin.instance.v1.UpdateInstanceMetadata + * @instance + */ + UpdateInstanceMetadata.prototype.instance = null; + + /** + * UpdateInstanceMetadata startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.spanner.admin.instance.v1.UpdateInstanceMetadata + * @instance + */ + UpdateInstanceMetadata.prototype.startTime = null; + + /** + * UpdateInstanceMetadata cancelTime. + * @member {google.protobuf.ITimestamp|null|undefined} cancelTime + * @memberof google.spanner.admin.instance.v1.UpdateInstanceMetadata + * @instance + */ + UpdateInstanceMetadata.prototype.cancelTime = null; + + /** + * UpdateInstanceMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.spanner.admin.instance.v1.UpdateInstanceMetadata + * @instance + */ + UpdateInstanceMetadata.prototype.endTime = null; + + /** + * UpdateInstanceMetadata expectedFulfillmentPeriod. + * @member {google.spanner.admin.instance.v1.FulfillmentPeriod} expectedFulfillmentPeriod + * @memberof google.spanner.admin.instance.v1.UpdateInstanceMetadata + * @instance + */ + UpdateInstanceMetadata.prototype.expectedFulfillmentPeriod = 0; + + /** + * Creates a new UpdateInstanceMetadata instance using the specified properties. + * @function create + * @memberof google.spanner.admin.instance.v1.UpdateInstanceMetadata + * @static + * @param {google.spanner.admin.instance.v1.IUpdateInstanceMetadata=} [properties] Properties to set + * @returns {google.spanner.admin.instance.v1.UpdateInstanceMetadata} UpdateInstanceMetadata instance + */ + UpdateInstanceMetadata.create = function create(properties) { + return new UpdateInstanceMetadata(properties); + }; + + /** + * Encodes the specified UpdateInstanceMetadata message. Does not implicitly {@link google.spanner.admin.instance.v1.UpdateInstanceMetadata.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.instance.v1.UpdateInstanceMetadata + * @static + * @param {google.spanner.admin.instance.v1.IUpdateInstanceMetadata} message UpdateInstanceMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateInstanceMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + $root.google.spanner.admin.instance.v1.Instance.encode(message.instance, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.cancelTime != null && Object.hasOwnProperty.call(message, "cancelTime")) + $root.google.protobuf.Timestamp.encode(message.cancelTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.expectedFulfillmentPeriod != null && Object.hasOwnProperty.call(message, "expectedFulfillmentPeriod")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.expectedFulfillmentPeriod); + return writer; + }; + + /** + * Encodes the specified UpdateInstanceMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.UpdateInstanceMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.instance.v1.UpdateInstanceMetadata + * @static + * @param {google.spanner.admin.instance.v1.IUpdateInstanceMetadata} message UpdateInstanceMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateInstanceMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateInstanceMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.instance.v1.UpdateInstanceMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.instance.v1.UpdateInstanceMetadata} UpdateInstanceMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateInstanceMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.UpdateInstanceMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.instance = $root.google.spanner.admin.instance.v1.Instance.decode(reader, reader.uint32()); + break; + } + case 2: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.cancelTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.expectedFulfillmentPeriod = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateInstanceMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.instance.v1.UpdateInstanceMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.instance.v1.UpdateInstanceMetadata} UpdateInstanceMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateInstanceMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateInstanceMetadata message. + * @function verify + * @memberof google.spanner.admin.instance.v1.UpdateInstanceMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateInstanceMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.instance != null && message.hasOwnProperty("instance")) { + var error = $root.google.spanner.admin.instance.v1.Instance.verify(message.instance); + if (error) + return "instance." + error; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.cancelTime); + if (error) + return "cancelTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.expectedFulfillmentPeriod != null && message.hasOwnProperty("expectedFulfillmentPeriod")) + switch (message.expectedFulfillmentPeriod) { + default: + return "expectedFulfillmentPeriod: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an UpdateInstanceMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.instance.v1.UpdateInstanceMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.instance.v1.UpdateInstanceMetadata} UpdateInstanceMetadata + */ + UpdateInstanceMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.instance.v1.UpdateInstanceMetadata) + return object; + var message = new $root.google.spanner.admin.instance.v1.UpdateInstanceMetadata(); + if (object.instance != null) { + if (typeof object.instance !== "object") + throw TypeError(".google.spanner.admin.instance.v1.UpdateInstanceMetadata.instance: object expected"); + message.instance = $root.google.spanner.admin.instance.v1.Instance.fromObject(object.instance); + } + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.spanner.admin.instance.v1.UpdateInstanceMetadata.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.cancelTime != null) { + if (typeof object.cancelTime !== "object") + throw TypeError(".google.spanner.admin.instance.v1.UpdateInstanceMetadata.cancelTime: object expected"); + message.cancelTime = $root.google.protobuf.Timestamp.fromObject(object.cancelTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.spanner.admin.instance.v1.UpdateInstanceMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + switch (object.expectedFulfillmentPeriod) { + default: + if (typeof object.expectedFulfillmentPeriod === "number") { + message.expectedFulfillmentPeriod = object.expectedFulfillmentPeriod; + break; + } + break; + case "FULFILLMENT_PERIOD_UNSPECIFIED": + case 0: + message.expectedFulfillmentPeriod = 0; + break; + case "FULFILLMENT_PERIOD_NORMAL": + case 1: + message.expectedFulfillmentPeriod = 1; + break; + case "FULFILLMENT_PERIOD_EXTENDED": + case 2: + message.expectedFulfillmentPeriod = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an UpdateInstanceMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.instance.v1.UpdateInstanceMetadata + * @static + * @param {google.spanner.admin.instance.v1.UpdateInstanceMetadata} message UpdateInstanceMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateInstanceMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.instance = null; + object.startTime = null; + object.cancelTime = null; + object.endTime = null; + object.expectedFulfillmentPeriod = options.enums === String ? "FULFILLMENT_PERIOD_UNSPECIFIED" : 0; + } + if (message.instance != null && message.hasOwnProperty("instance")) + object.instance = $root.google.spanner.admin.instance.v1.Instance.toObject(message.instance, options); + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) + object.cancelTime = $root.google.protobuf.Timestamp.toObject(message.cancelTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.expectedFulfillmentPeriod != null && message.hasOwnProperty("expectedFulfillmentPeriod")) + object.expectedFulfillmentPeriod = options.enums === String ? $root.google.spanner.admin.instance.v1.FulfillmentPeriod[message.expectedFulfillmentPeriod] === undefined ? message.expectedFulfillmentPeriod : $root.google.spanner.admin.instance.v1.FulfillmentPeriod[message.expectedFulfillmentPeriod] : message.expectedFulfillmentPeriod; + return object; + }; + + /** + * Converts this UpdateInstanceMetadata to JSON. + * @function toJSON + * @memberof google.spanner.admin.instance.v1.UpdateInstanceMetadata + * @instance + * @returns {Object.} JSON object + */ + UpdateInstanceMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateInstanceMetadata + * @function getTypeUrl + * @memberof google.spanner.admin.instance.v1.UpdateInstanceMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateInstanceMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.instance.v1.UpdateInstanceMetadata"; + }; + + return UpdateInstanceMetadata; + })(); + + v1.FreeInstanceMetadata = (function() { + + /** + * Properties of a FreeInstanceMetadata. + * @memberof google.spanner.admin.instance.v1 + * @interface IFreeInstanceMetadata + * @property {google.protobuf.ITimestamp|null} [expireTime] FreeInstanceMetadata expireTime + * @property {google.protobuf.ITimestamp|null} [upgradeTime] FreeInstanceMetadata upgradeTime + * @property {google.spanner.admin.instance.v1.FreeInstanceMetadata.ExpireBehavior|null} [expireBehavior] FreeInstanceMetadata expireBehavior + */ + + /** + * Constructs a new FreeInstanceMetadata. + * @memberof google.spanner.admin.instance.v1 + * @classdesc Represents a FreeInstanceMetadata. + * @implements IFreeInstanceMetadata + * @constructor + * @param {google.spanner.admin.instance.v1.IFreeInstanceMetadata=} [properties] Properties to set + */ + function FreeInstanceMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FreeInstanceMetadata expireTime. + * @member {google.protobuf.ITimestamp|null|undefined} expireTime + * @memberof google.spanner.admin.instance.v1.FreeInstanceMetadata + * @instance + */ + FreeInstanceMetadata.prototype.expireTime = null; + + /** + * FreeInstanceMetadata upgradeTime. + * @member {google.protobuf.ITimestamp|null|undefined} upgradeTime + * @memberof google.spanner.admin.instance.v1.FreeInstanceMetadata + * @instance + */ + FreeInstanceMetadata.prototype.upgradeTime = null; + + /** + * FreeInstanceMetadata expireBehavior. + * @member {google.spanner.admin.instance.v1.FreeInstanceMetadata.ExpireBehavior} expireBehavior + * @memberof google.spanner.admin.instance.v1.FreeInstanceMetadata + * @instance + */ + FreeInstanceMetadata.prototype.expireBehavior = 0; + + /** + * Creates a new FreeInstanceMetadata instance using the specified properties. + * @function create + * @memberof google.spanner.admin.instance.v1.FreeInstanceMetadata + * @static + * @param {google.spanner.admin.instance.v1.IFreeInstanceMetadata=} [properties] Properties to set + * @returns {google.spanner.admin.instance.v1.FreeInstanceMetadata} FreeInstanceMetadata instance + */ + FreeInstanceMetadata.create = function create(properties) { + return new FreeInstanceMetadata(properties); + }; + + /** + * Encodes the specified FreeInstanceMetadata message. Does not implicitly {@link google.spanner.admin.instance.v1.FreeInstanceMetadata.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.instance.v1.FreeInstanceMetadata + * @static + * @param {google.spanner.admin.instance.v1.IFreeInstanceMetadata} message FreeInstanceMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FreeInstanceMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) + $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.upgradeTime != null && Object.hasOwnProperty.call(message, "upgradeTime")) + $root.google.protobuf.Timestamp.encode(message.upgradeTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.expireBehavior != null && Object.hasOwnProperty.call(message, "expireBehavior")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.expireBehavior); + return writer; + }; + + /** + * Encodes the specified FreeInstanceMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.FreeInstanceMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.instance.v1.FreeInstanceMetadata + * @static + * @param {google.spanner.admin.instance.v1.IFreeInstanceMetadata} message FreeInstanceMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FreeInstanceMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FreeInstanceMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.instance.v1.FreeInstanceMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.instance.v1.FreeInstanceMetadata} FreeInstanceMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FreeInstanceMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.FreeInstanceMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.upgradeTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.expireBehavior = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FreeInstanceMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.instance.v1.FreeInstanceMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.instance.v1.FreeInstanceMetadata} FreeInstanceMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FreeInstanceMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FreeInstanceMetadata message. + * @function verify + * @memberof google.spanner.admin.instance.v1.FreeInstanceMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FreeInstanceMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.expireTime != null && message.hasOwnProperty("expireTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.expireTime); + if (error) + return "expireTime." + error; + } + if (message.upgradeTime != null && message.hasOwnProperty("upgradeTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.upgradeTime); + if (error) + return "upgradeTime." + error; + } + if (message.expireBehavior != null && message.hasOwnProperty("expireBehavior")) + switch (message.expireBehavior) { + default: + return "expireBehavior: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a FreeInstanceMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.instance.v1.FreeInstanceMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.instance.v1.FreeInstanceMetadata} FreeInstanceMetadata + */ + FreeInstanceMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.instance.v1.FreeInstanceMetadata) + return object; + var message = new $root.google.spanner.admin.instance.v1.FreeInstanceMetadata(); + if (object.expireTime != null) { + if (typeof object.expireTime !== "object") + throw TypeError(".google.spanner.admin.instance.v1.FreeInstanceMetadata.expireTime: object expected"); + message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); + } + if (object.upgradeTime != null) { + if (typeof object.upgradeTime !== "object") + throw TypeError(".google.spanner.admin.instance.v1.FreeInstanceMetadata.upgradeTime: object expected"); + message.upgradeTime = $root.google.protobuf.Timestamp.fromObject(object.upgradeTime); + } + switch (object.expireBehavior) { + default: + if (typeof object.expireBehavior === "number") { + message.expireBehavior = object.expireBehavior; + break; + } + break; + case "EXPIRE_BEHAVIOR_UNSPECIFIED": + case 0: + message.expireBehavior = 0; + break; + case "FREE_TO_PROVISIONED": + case 1: + message.expireBehavior = 1; + break; + case "REMOVE_AFTER_GRACE_PERIOD": + case 2: + message.expireBehavior = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a FreeInstanceMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.instance.v1.FreeInstanceMetadata + * @static + * @param {google.spanner.admin.instance.v1.FreeInstanceMetadata} message FreeInstanceMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FreeInstanceMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.expireTime = null; + object.upgradeTime = null; + object.expireBehavior = options.enums === String ? "EXPIRE_BEHAVIOR_UNSPECIFIED" : 0; + } + if (message.expireTime != null && message.hasOwnProperty("expireTime")) + object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); + if (message.upgradeTime != null && message.hasOwnProperty("upgradeTime")) + object.upgradeTime = $root.google.protobuf.Timestamp.toObject(message.upgradeTime, options); + if (message.expireBehavior != null && message.hasOwnProperty("expireBehavior")) + object.expireBehavior = options.enums === String ? $root.google.spanner.admin.instance.v1.FreeInstanceMetadata.ExpireBehavior[message.expireBehavior] === undefined ? message.expireBehavior : $root.google.spanner.admin.instance.v1.FreeInstanceMetadata.ExpireBehavior[message.expireBehavior] : message.expireBehavior; + return object; + }; + + /** + * Converts this FreeInstanceMetadata to JSON. + * @function toJSON + * @memberof google.spanner.admin.instance.v1.FreeInstanceMetadata + * @instance + * @returns {Object.} JSON object + */ + FreeInstanceMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FreeInstanceMetadata + * @function getTypeUrl + * @memberof google.spanner.admin.instance.v1.FreeInstanceMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FreeInstanceMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.instance.v1.FreeInstanceMetadata"; + }; + + /** + * ExpireBehavior enum. + * @name google.spanner.admin.instance.v1.FreeInstanceMetadata.ExpireBehavior + * @enum {number} + * @property {number} EXPIRE_BEHAVIOR_UNSPECIFIED=0 EXPIRE_BEHAVIOR_UNSPECIFIED value + * @property {number} FREE_TO_PROVISIONED=1 FREE_TO_PROVISIONED value + * @property {number} REMOVE_AFTER_GRACE_PERIOD=2 REMOVE_AFTER_GRACE_PERIOD value + */ + FreeInstanceMetadata.ExpireBehavior = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EXPIRE_BEHAVIOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "FREE_TO_PROVISIONED"] = 1; + values[valuesById[2] = "REMOVE_AFTER_GRACE_PERIOD"] = 2; + return values; + })(); + + return FreeInstanceMetadata; + })(); + + v1.CreateInstanceConfigMetadata = (function() { + + /** + * Properties of a CreateInstanceConfigMetadata. + * @memberof google.spanner.admin.instance.v1 + * @interface ICreateInstanceConfigMetadata + * @property {google.spanner.admin.instance.v1.IInstanceConfig|null} [instanceConfig] CreateInstanceConfigMetadata instanceConfig + * @property {google.spanner.admin.instance.v1.IOperationProgress|null} [progress] CreateInstanceConfigMetadata progress + * @property {google.protobuf.ITimestamp|null} [cancelTime] CreateInstanceConfigMetadata cancelTime + */ + + /** + * Constructs a new CreateInstanceConfigMetadata. + * @memberof google.spanner.admin.instance.v1 + * @classdesc Represents a CreateInstanceConfigMetadata. + * @implements ICreateInstanceConfigMetadata + * @constructor + * @param {google.spanner.admin.instance.v1.ICreateInstanceConfigMetadata=} [properties] Properties to set + */ + function CreateInstanceConfigMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateInstanceConfigMetadata instanceConfig. + * @member {google.spanner.admin.instance.v1.IInstanceConfig|null|undefined} instanceConfig + * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigMetadata + * @instance + */ + CreateInstanceConfigMetadata.prototype.instanceConfig = null; + + /** + * CreateInstanceConfigMetadata progress. + * @member {google.spanner.admin.instance.v1.IOperationProgress|null|undefined} progress + * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigMetadata + * @instance + */ + CreateInstanceConfigMetadata.prototype.progress = null; + + /** + * CreateInstanceConfigMetadata cancelTime. + * @member {google.protobuf.ITimestamp|null|undefined} cancelTime + * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigMetadata + * @instance + */ + CreateInstanceConfigMetadata.prototype.cancelTime = null; + + /** + * Creates a new CreateInstanceConfigMetadata instance using the specified properties. + * @function create + * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigMetadata + * @static + * @param {google.spanner.admin.instance.v1.ICreateInstanceConfigMetadata=} [properties] Properties to set + * @returns {google.spanner.admin.instance.v1.CreateInstanceConfigMetadata} CreateInstanceConfigMetadata instance + */ + CreateInstanceConfigMetadata.create = function create(properties) { + return new CreateInstanceConfigMetadata(properties); + }; + + /** + * Encodes the specified CreateInstanceConfigMetadata message. Does not implicitly {@link google.spanner.admin.instance.v1.CreateInstanceConfigMetadata.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigMetadata + * @static + * @param {google.spanner.admin.instance.v1.ICreateInstanceConfigMetadata} message CreateInstanceConfigMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateInstanceConfigMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.instanceConfig != null && Object.hasOwnProperty.call(message, "instanceConfig")) + $root.google.spanner.admin.instance.v1.InstanceConfig.encode(message.instanceConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.progress != null && Object.hasOwnProperty.call(message, "progress")) + $root.google.spanner.admin.instance.v1.OperationProgress.encode(message.progress, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.cancelTime != null && Object.hasOwnProperty.call(message, "cancelTime")) + $root.google.protobuf.Timestamp.encode(message.cancelTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateInstanceConfigMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.CreateInstanceConfigMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigMetadata + * @static + * @param {google.spanner.admin.instance.v1.ICreateInstanceConfigMetadata} message CreateInstanceConfigMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateInstanceConfigMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateInstanceConfigMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.instance.v1.CreateInstanceConfigMetadata} CreateInstanceConfigMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateInstanceConfigMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.CreateInstanceConfigMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.instanceConfig = $root.google.spanner.admin.instance.v1.InstanceConfig.decode(reader, reader.uint32()); + break; + } + case 2: { + message.progress = $root.google.spanner.admin.instance.v1.OperationProgress.decode(reader, reader.uint32()); + break; + } + case 3: { + message.cancelTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateInstanceConfigMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.instance.v1.CreateInstanceConfigMetadata} CreateInstanceConfigMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateInstanceConfigMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateInstanceConfigMetadata message. + * @function verify + * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateInstanceConfigMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.instanceConfig != null && message.hasOwnProperty("instanceConfig")) { + var error = $root.google.spanner.admin.instance.v1.InstanceConfig.verify(message.instanceConfig); + if (error) + return "instanceConfig." + error; + } + if (message.progress != null && message.hasOwnProperty("progress")) { + var error = $root.google.spanner.admin.instance.v1.OperationProgress.verify(message.progress); + if (error) + return "progress." + error; + } + if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.cancelTime); + if (error) + return "cancelTime." + error; + } + return null; + }; + + /** + * Creates a CreateInstanceConfigMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.instance.v1.CreateInstanceConfigMetadata} CreateInstanceConfigMetadata + */ + CreateInstanceConfigMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.instance.v1.CreateInstanceConfigMetadata) + return object; + var message = new $root.google.spanner.admin.instance.v1.CreateInstanceConfigMetadata(); + if (object.instanceConfig != null) { + if (typeof object.instanceConfig !== "object") + throw TypeError(".google.spanner.admin.instance.v1.CreateInstanceConfigMetadata.instanceConfig: object expected"); + message.instanceConfig = $root.google.spanner.admin.instance.v1.InstanceConfig.fromObject(object.instanceConfig); + } + if (object.progress != null) { + if (typeof object.progress !== "object") + throw TypeError(".google.spanner.admin.instance.v1.CreateInstanceConfigMetadata.progress: object expected"); + message.progress = $root.google.spanner.admin.instance.v1.OperationProgress.fromObject(object.progress); + } + if (object.cancelTime != null) { + if (typeof object.cancelTime !== "object") + throw TypeError(".google.spanner.admin.instance.v1.CreateInstanceConfigMetadata.cancelTime: object expected"); + message.cancelTime = $root.google.protobuf.Timestamp.fromObject(object.cancelTime); + } + return message; + }; + + /** + * Creates a plain object from a CreateInstanceConfigMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigMetadata + * @static + * @param {google.spanner.admin.instance.v1.CreateInstanceConfigMetadata} message CreateInstanceConfigMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateInstanceConfigMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.instanceConfig = null; + object.progress = null; + object.cancelTime = null; + } + if (message.instanceConfig != null && message.hasOwnProperty("instanceConfig")) + object.instanceConfig = $root.google.spanner.admin.instance.v1.InstanceConfig.toObject(message.instanceConfig, options); + if (message.progress != null && message.hasOwnProperty("progress")) + object.progress = $root.google.spanner.admin.instance.v1.OperationProgress.toObject(message.progress, options); + if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) + object.cancelTime = $root.google.protobuf.Timestamp.toObject(message.cancelTime, options); + return object; + }; + + /** + * Converts this CreateInstanceConfigMetadata to JSON. + * @function toJSON + * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigMetadata + * @instance + * @returns {Object.} JSON object + */ + CreateInstanceConfigMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateInstanceConfigMetadata + * @function getTypeUrl + * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateInstanceConfigMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.instance.v1.CreateInstanceConfigMetadata"; + }; + + return CreateInstanceConfigMetadata; + })(); + + v1.UpdateInstanceConfigMetadata = (function() { + + /** + * Properties of an UpdateInstanceConfigMetadata. + * @memberof google.spanner.admin.instance.v1 + * @interface IUpdateInstanceConfigMetadata + * @property {google.spanner.admin.instance.v1.IInstanceConfig|null} [instanceConfig] UpdateInstanceConfigMetadata instanceConfig + * @property {google.spanner.admin.instance.v1.IOperationProgress|null} [progress] UpdateInstanceConfigMetadata progress + * @property {google.protobuf.ITimestamp|null} [cancelTime] UpdateInstanceConfigMetadata cancelTime + */ + + /** + * Constructs a new UpdateInstanceConfigMetadata. + * @memberof google.spanner.admin.instance.v1 + * @classdesc Represents an UpdateInstanceConfigMetadata. + * @implements IUpdateInstanceConfigMetadata + * @constructor + * @param {google.spanner.admin.instance.v1.IUpdateInstanceConfigMetadata=} [properties] Properties to set + */ + function UpdateInstanceConfigMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateInstanceConfigMetadata instanceConfig. + * @member {google.spanner.admin.instance.v1.IInstanceConfig|null|undefined} instanceConfig + * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata + * @instance + */ + UpdateInstanceConfigMetadata.prototype.instanceConfig = null; + + /** + * UpdateInstanceConfigMetadata progress. + * @member {google.spanner.admin.instance.v1.IOperationProgress|null|undefined} progress + * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata + * @instance + */ + UpdateInstanceConfigMetadata.prototype.progress = null; + + /** + * UpdateInstanceConfigMetadata cancelTime. + * @member {google.protobuf.ITimestamp|null|undefined} cancelTime + * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata + * @instance + */ + UpdateInstanceConfigMetadata.prototype.cancelTime = null; + + /** + * Creates a new UpdateInstanceConfigMetadata instance using the specified properties. + * @function create + * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata + * @static + * @param {google.spanner.admin.instance.v1.IUpdateInstanceConfigMetadata=} [properties] Properties to set + * @returns {google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata} UpdateInstanceConfigMetadata instance + */ + UpdateInstanceConfigMetadata.create = function create(properties) { + return new UpdateInstanceConfigMetadata(properties); + }; + + /** + * Encodes the specified UpdateInstanceConfigMetadata message. Does not implicitly {@link google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata + * @static + * @param {google.spanner.admin.instance.v1.IUpdateInstanceConfigMetadata} message UpdateInstanceConfigMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateInstanceConfigMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.instanceConfig != null && Object.hasOwnProperty.call(message, "instanceConfig")) + $root.google.spanner.admin.instance.v1.InstanceConfig.encode(message.instanceConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.progress != null && Object.hasOwnProperty.call(message, "progress")) + $root.google.spanner.admin.instance.v1.OperationProgress.encode(message.progress, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.cancelTime != null && Object.hasOwnProperty.call(message, "cancelTime")) + $root.google.protobuf.Timestamp.encode(message.cancelTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateInstanceConfigMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata + * @static + * @param {google.spanner.admin.instance.v1.IUpdateInstanceConfigMetadata} message UpdateInstanceConfigMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateInstanceConfigMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateInstanceConfigMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata} UpdateInstanceConfigMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateInstanceConfigMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.instanceConfig = $root.google.spanner.admin.instance.v1.InstanceConfig.decode(reader, reader.uint32()); + break; + } + case 2: { + message.progress = $root.google.spanner.admin.instance.v1.OperationProgress.decode(reader, reader.uint32()); + break; + } + case 3: { + message.cancelTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateInstanceConfigMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata} UpdateInstanceConfigMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateInstanceConfigMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateInstanceConfigMetadata message. + * @function verify + * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateInstanceConfigMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.instanceConfig != null && message.hasOwnProperty("instanceConfig")) { + var error = $root.google.spanner.admin.instance.v1.InstanceConfig.verify(message.instanceConfig); + if (error) + return "instanceConfig." + error; + } + if (message.progress != null && message.hasOwnProperty("progress")) { + var error = $root.google.spanner.admin.instance.v1.OperationProgress.verify(message.progress); + if (error) + return "progress." + error; + } + if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.cancelTime); + if (error) + return "cancelTime." + error; + } + return null; + }; + + /** + * Creates an UpdateInstanceConfigMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata} UpdateInstanceConfigMetadata + */ + UpdateInstanceConfigMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata) + return object; + var message = new $root.google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata(); + if (object.instanceConfig != null) { + if (typeof object.instanceConfig !== "object") + throw TypeError(".google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata.instanceConfig: object expected"); + message.instanceConfig = $root.google.spanner.admin.instance.v1.InstanceConfig.fromObject(object.instanceConfig); + } + if (object.progress != null) { + if (typeof object.progress !== "object") + throw TypeError(".google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata.progress: object expected"); + message.progress = $root.google.spanner.admin.instance.v1.OperationProgress.fromObject(object.progress); + } + if (object.cancelTime != null) { + if (typeof object.cancelTime !== "object") + throw TypeError(".google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata.cancelTime: object expected"); + message.cancelTime = $root.google.protobuf.Timestamp.fromObject(object.cancelTime); + } + return message; + }; + + /** + * Creates a plain object from an UpdateInstanceConfigMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata + * @static + * @param {google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata} message UpdateInstanceConfigMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateInstanceConfigMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.instanceConfig = null; + object.progress = null; + object.cancelTime = null; + } + if (message.instanceConfig != null && message.hasOwnProperty("instanceConfig")) + object.instanceConfig = $root.google.spanner.admin.instance.v1.InstanceConfig.toObject(message.instanceConfig, options); + if (message.progress != null && message.hasOwnProperty("progress")) + object.progress = $root.google.spanner.admin.instance.v1.OperationProgress.toObject(message.progress, options); + if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) + object.cancelTime = $root.google.protobuf.Timestamp.toObject(message.cancelTime, options); + return object; + }; + + /** + * Converts this UpdateInstanceConfigMetadata to JSON. + * @function toJSON + * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata + * @instance + * @returns {Object.} JSON object + */ + UpdateInstanceConfigMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateInstanceConfigMetadata + * @function getTypeUrl + * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateInstanceConfigMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata"; + }; + + return UpdateInstanceConfigMetadata; + })(); + + v1.InstancePartition = (function() { + + /** + * Properties of an InstancePartition. + * @memberof google.spanner.admin.instance.v1 + * @interface IInstancePartition + * @property {string|null} [name] InstancePartition name + * @property {string|null} [config] InstancePartition config + * @property {string|null} [displayName] InstancePartition displayName + * @property {number|null} [nodeCount] InstancePartition nodeCount + * @property {number|null} [processingUnits] InstancePartition processingUnits + * @property {google.spanner.admin.instance.v1.IAutoscalingConfig|null} [autoscalingConfig] InstancePartition autoscalingConfig + * @property {google.spanner.admin.instance.v1.InstancePartition.State|null} [state] InstancePartition state + * @property {google.protobuf.ITimestamp|null} [createTime] InstancePartition createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] InstancePartition updateTime + * @property {Array.|null} [referencingDatabases] InstancePartition referencingDatabases + * @property {Array.|null} [referencingBackups] InstancePartition referencingBackups + * @property {string|null} [etag] InstancePartition etag + */ + + /** + * Constructs a new InstancePartition. + * @memberof google.spanner.admin.instance.v1 + * @classdesc Represents an InstancePartition. + * @implements IInstancePartition + * @constructor + * @param {google.spanner.admin.instance.v1.IInstancePartition=} [properties] Properties to set + */ + function InstancePartition(properties) { + this.referencingDatabases = []; + this.referencingBackups = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstancePartition name. + * @member {string} name + * @memberof google.spanner.admin.instance.v1.InstancePartition + * @instance + */ + InstancePartition.prototype.name = ""; + + /** + * InstancePartition config. + * @member {string} config + * @memberof google.spanner.admin.instance.v1.InstancePartition + * @instance + */ + InstancePartition.prototype.config = ""; + + /** + * InstancePartition displayName. + * @member {string} displayName + * @memberof google.spanner.admin.instance.v1.InstancePartition + * @instance + */ + InstancePartition.prototype.displayName = ""; + + /** + * InstancePartition nodeCount. + * @member {number|null|undefined} nodeCount + * @memberof google.spanner.admin.instance.v1.InstancePartition + * @instance + */ + InstancePartition.prototype.nodeCount = null; + + /** + * InstancePartition processingUnits. + * @member {number|null|undefined} processingUnits + * @memberof google.spanner.admin.instance.v1.InstancePartition + * @instance + */ + InstancePartition.prototype.processingUnits = null; + + /** + * InstancePartition autoscalingConfig. + * @member {google.spanner.admin.instance.v1.IAutoscalingConfig|null|undefined} autoscalingConfig + * @memberof google.spanner.admin.instance.v1.InstancePartition + * @instance + */ + InstancePartition.prototype.autoscalingConfig = null; + + /** + * InstancePartition state. + * @member {google.spanner.admin.instance.v1.InstancePartition.State} state + * @memberof google.spanner.admin.instance.v1.InstancePartition + * @instance + */ + InstancePartition.prototype.state = 0; + + /** + * InstancePartition createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.spanner.admin.instance.v1.InstancePartition + * @instance + */ + InstancePartition.prototype.createTime = null; + + /** + * InstancePartition updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.spanner.admin.instance.v1.InstancePartition + * @instance + */ + InstancePartition.prototype.updateTime = null; + + /** + * InstancePartition referencingDatabases. + * @member {Array.} referencingDatabases + * @memberof google.spanner.admin.instance.v1.InstancePartition + * @instance + */ + InstancePartition.prototype.referencingDatabases = $util.emptyArray; + + /** + * InstancePartition referencingBackups. + * @member {Array.} referencingBackups + * @memberof google.spanner.admin.instance.v1.InstancePartition + * @instance + */ + InstancePartition.prototype.referencingBackups = $util.emptyArray; + + /** + * InstancePartition etag. + * @member {string} etag + * @memberof google.spanner.admin.instance.v1.InstancePartition + * @instance + */ + InstancePartition.prototype.etag = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InstancePartition computeCapacity. + * @member {"nodeCount"|"processingUnits"|undefined} computeCapacity + * @memberof google.spanner.admin.instance.v1.InstancePartition + * @instance + */ + Object.defineProperty(InstancePartition.prototype, "computeCapacity", { + get: $util.oneOfGetter($oneOfFields = ["nodeCount", "processingUnits"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InstancePartition instance using the specified properties. + * @function create + * @memberof google.spanner.admin.instance.v1.InstancePartition + * @static + * @param {google.spanner.admin.instance.v1.IInstancePartition=} [properties] Properties to set + * @returns {google.spanner.admin.instance.v1.InstancePartition} InstancePartition instance + */ + InstancePartition.create = function create(properties) { + return new InstancePartition(properties); + }; + + /** + * Encodes the specified InstancePartition message. Does not implicitly {@link google.spanner.admin.instance.v1.InstancePartition.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.instance.v1.InstancePartition + * @static + * @param {google.spanner.admin.instance.v1.IInstancePartition} message InstancePartition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstancePartition.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.config != null && Object.hasOwnProperty.call(message, "config")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.config); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.displayName); + if (message.nodeCount != null && Object.hasOwnProperty.call(message, "nodeCount")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.nodeCount); + if (message.processingUnits != null && Object.hasOwnProperty.call(message, "processingUnits")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.processingUnits); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.state); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.referencingDatabases != null && message.referencingDatabases.length) + for (var i = 0; i < message.referencingDatabases.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.referencingDatabases[i]); + if (message.referencingBackups != null && message.referencingBackups.length) + for (var i = 0; i < message.referencingBackups.length; ++i) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.referencingBackups[i]); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.etag); + if (message.autoscalingConfig != null && Object.hasOwnProperty.call(message, "autoscalingConfig")) + $root.google.spanner.admin.instance.v1.AutoscalingConfig.encode(message.autoscalingConfig, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InstancePartition message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.InstancePartition.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.instance.v1.InstancePartition + * @static + * @param {google.spanner.admin.instance.v1.IInstancePartition} message InstancePartition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstancePartition.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstancePartition message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.instance.v1.InstancePartition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.instance.v1.InstancePartition} InstancePartition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstancePartition.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.InstancePartition(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.config = reader.string(); + break; + } + case 3: { + message.displayName = reader.string(); + break; + } + case 5: { + message.nodeCount = reader.int32(); + break; + } + case 6: { + message.processingUnits = reader.int32(); + break; + } + case 13: { + message.autoscalingConfig = $root.google.spanner.admin.instance.v1.AutoscalingConfig.decode(reader, reader.uint32()); + break; + } + case 7: { + message.state = reader.int32(); + break; + } + case 8: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 9: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 10: { + if (!(message.referencingDatabases && message.referencingDatabases.length)) + message.referencingDatabases = []; + message.referencingDatabases.push(reader.string()); + break; + } + case 11: { + if (!(message.referencingBackups && message.referencingBackups.length)) + message.referencingBackups = []; + message.referencingBackups.push(reader.string()); + break; + } + case 12: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstancePartition message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.instance.v1.InstancePartition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.instance.v1.InstancePartition} InstancePartition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstancePartition.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstancePartition message. + * @function verify + * @memberof google.spanner.admin.instance.v1.InstancePartition + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstancePartition.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.config != null && message.hasOwnProperty("config")) + if (!$util.isString(message.config)) + return "config: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) { + properties.computeCapacity = 1; + if (!$util.isInteger(message.nodeCount)) + return "nodeCount: integer expected"; + } + if (message.processingUnits != null && message.hasOwnProperty("processingUnits")) { + if (properties.computeCapacity === 1) + return "computeCapacity: multiple values"; + properties.computeCapacity = 1; + if (!$util.isInteger(message.processingUnits)) + return "processingUnits: integer expected"; + } + if (message.autoscalingConfig != null && message.hasOwnProperty("autoscalingConfig")) { + var error = $root.google.spanner.admin.instance.v1.AutoscalingConfig.verify(message.autoscalingConfig); + if (error) + return "autoscalingConfig." + 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.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.referencingDatabases != null && message.hasOwnProperty("referencingDatabases")) { + if (!Array.isArray(message.referencingDatabases)) + return "referencingDatabases: array expected"; + for (var i = 0; i < message.referencingDatabases.length; ++i) + if (!$util.isString(message.referencingDatabases[i])) + return "referencingDatabases: string[] expected"; + } + if (message.referencingBackups != null && message.hasOwnProperty("referencingBackups")) { + if (!Array.isArray(message.referencingBackups)) + return "referencingBackups: array expected"; + for (var i = 0; i < message.referencingBackups.length; ++i) + if (!$util.isString(message.referencingBackups[i])) + return "referencingBackups: string[] expected"; + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates an InstancePartition message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.instance.v1.InstancePartition + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.instance.v1.InstancePartition} InstancePartition + */ + InstancePartition.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.instance.v1.InstancePartition) + return object; + var message = new $root.google.spanner.admin.instance.v1.InstancePartition(); + if (object.name != null) + message.name = String(object.name); + if (object.config != null) + message.config = String(object.config); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.nodeCount != null) + message.nodeCount = object.nodeCount | 0; + if (object.processingUnits != null) + message.processingUnits = object.processingUnits | 0; + if (object.autoscalingConfig != null) { + if (typeof object.autoscalingConfig !== "object") + throw TypeError(".google.spanner.admin.instance.v1.InstancePartition.autoscalingConfig: object expected"); + message.autoscalingConfig = $root.google.spanner.admin.instance.v1.AutoscalingConfig.fromObject(object.autoscalingConfig); + } + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "CREATING": + case 1: + message.state = 1; + break; + case "READY": + case 2: + message.state = 2; + break; + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.spanner.admin.instance.v1.InstancePartition.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.spanner.admin.instance.v1.InstancePartition.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.referencingDatabases) { + if (!Array.isArray(object.referencingDatabases)) + throw TypeError(".google.spanner.admin.instance.v1.InstancePartition.referencingDatabases: array expected"); + message.referencingDatabases = []; + for (var i = 0; i < object.referencingDatabases.length; ++i) + message.referencingDatabases[i] = String(object.referencingDatabases[i]); + } + if (object.referencingBackups) { + if (!Array.isArray(object.referencingBackups)) + throw TypeError(".google.spanner.admin.instance.v1.InstancePartition.referencingBackups: array expected"); + message.referencingBackups = []; + for (var i = 0; i < object.referencingBackups.length; ++i) + message.referencingBackups[i] = String(object.referencingBackups[i]); + } + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from an InstancePartition message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.instance.v1.InstancePartition + * @static + * @param {google.spanner.admin.instance.v1.InstancePartition} message InstancePartition + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstancePartition.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.referencingDatabases = []; + object.referencingBackups = []; + } + if (options.defaults) { + object.name = ""; + object.config = ""; + object.displayName = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.createTime = null; + object.updateTime = null; + object.etag = ""; + object.autoscalingConfig = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.config != null && message.hasOwnProperty("config")) + object.config = message.config; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) { + object.nodeCount = message.nodeCount; + if (options.oneofs) + object.computeCapacity = "nodeCount"; + } + if (message.processingUnits != null && message.hasOwnProperty("processingUnits")) { + object.processingUnits = message.processingUnits; + if (options.oneofs) + object.computeCapacity = "processingUnits"; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.spanner.admin.instance.v1.InstancePartition.State[message.state] === undefined ? message.state : $root.google.spanner.admin.instance.v1.InstancePartition.State[message.state] : message.state; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.referencingDatabases && message.referencingDatabases.length) { + object.referencingDatabases = []; + for (var j = 0; j < message.referencingDatabases.length; ++j) + object.referencingDatabases[j] = message.referencingDatabases[j]; + } + if (message.referencingBackups && message.referencingBackups.length) { + object.referencingBackups = []; + for (var j = 0; j < message.referencingBackups.length; ++j) + object.referencingBackups[j] = message.referencingBackups[j]; + } + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.autoscalingConfig != null && message.hasOwnProperty("autoscalingConfig")) + object.autoscalingConfig = $root.google.spanner.admin.instance.v1.AutoscalingConfig.toObject(message.autoscalingConfig, options); + return object; + }; + + /** + * Converts this InstancePartition to JSON. + * @function toJSON + * @memberof google.spanner.admin.instance.v1.InstancePartition + * @instance + * @returns {Object.} JSON object + */ + InstancePartition.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InstancePartition + * @function getTypeUrl + * @memberof google.spanner.admin.instance.v1.InstancePartition + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InstancePartition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.instance.v1.InstancePartition"; + }; + + /** + * State enum. + * @name google.spanner.admin.instance.v1.InstancePartition.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} CREATING=1 CREATING value + * @property {number} READY=2 READY value + */ + InstancePartition.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CREATING"] = 1; + values[valuesById[2] = "READY"] = 2; + return values; + })(); + + return InstancePartition; + })(); + + v1.CreateInstancePartitionMetadata = (function() { + + /** + * Properties of a CreateInstancePartitionMetadata. + * @memberof google.spanner.admin.instance.v1 + * @interface ICreateInstancePartitionMetadata + * @property {google.spanner.admin.instance.v1.IInstancePartition|null} [instancePartition] CreateInstancePartitionMetadata instancePartition + * @property {google.protobuf.ITimestamp|null} [startTime] CreateInstancePartitionMetadata startTime + * @property {google.protobuf.ITimestamp|null} [cancelTime] CreateInstancePartitionMetadata cancelTime + * @property {google.protobuf.ITimestamp|null} [endTime] CreateInstancePartitionMetadata endTime + */ + + /** + * Constructs a new CreateInstancePartitionMetadata. + * @memberof google.spanner.admin.instance.v1 + * @classdesc Represents a CreateInstancePartitionMetadata. + * @implements ICreateInstancePartitionMetadata + * @constructor + * @param {google.spanner.admin.instance.v1.ICreateInstancePartitionMetadata=} [properties] Properties to set + */ + function CreateInstancePartitionMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateInstancePartitionMetadata instancePartition. + * @member {google.spanner.admin.instance.v1.IInstancePartition|null|undefined} instancePartition + * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionMetadata + * @instance + */ + CreateInstancePartitionMetadata.prototype.instancePartition = null; + + /** + * CreateInstancePartitionMetadata startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionMetadata + * @instance + */ + CreateInstancePartitionMetadata.prototype.startTime = null; + + /** + * CreateInstancePartitionMetadata cancelTime. + * @member {google.protobuf.ITimestamp|null|undefined} cancelTime + * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionMetadata + * @instance + */ + CreateInstancePartitionMetadata.prototype.cancelTime = null; + + /** + * CreateInstancePartitionMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionMetadata + * @instance + */ + CreateInstancePartitionMetadata.prototype.endTime = null; + + /** + * Creates a new CreateInstancePartitionMetadata instance using the specified properties. + * @function create + * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionMetadata + * @static + * @param {google.spanner.admin.instance.v1.ICreateInstancePartitionMetadata=} [properties] Properties to set + * @returns {google.spanner.admin.instance.v1.CreateInstancePartitionMetadata} CreateInstancePartitionMetadata instance + */ + CreateInstancePartitionMetadata.create = function create(properties) { + return new CreateInstancePartitionMetadata(properties); + }; + + /** + * Encodes the specified CreateInstancePartitionMetadata message. Does not implicitly {@link google.spanner.admin.instance.v1.CreateInstancePartitionMetadata.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionMetadata + * @static + * @param {google.spanner.admin.instance.v1.ICreateInstancePartitionMetadata} message CreateInstancePartitionMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateInstancePartitionMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.instancePartition != null && Object.hasOwnProperty.call(message, "instancePartition")) + $root.google.spanner.admin.instance.v1.InstancePartition.encode(message.instancePartition, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.cancelTime != null && Object.hasOwnProperty.call(message, "cancelTime")) + $root.google.protobuf.Timestamp.encode(message.cancelTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateInstancePartitionMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.CreateInstancePartitionMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionMetadata + * @static + * @param {google.spanner.admin.instance.v1.ICreateInstancePartitionMetadata} message CreateInstancePartitionMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateInstancePartitionMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateInstancePartitionMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.instance.v1.CreateInstancePartitionMetadata} CreateInstancePartitionMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateInstancePartitionMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.CreateInstancePartitionMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.instancePartition = $root.google.spanner.admin.instance.v1.InstancePartition.decode(reader, reader.uint32()); + break; + } + case 2: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.cancelTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateInstancePartitionMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.instance.v1.CreateInstancePartitionMetadata} CreateInstancePartitionMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateInstancePartitionMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateInstancePartitionMetadata message. + * @function verify + * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateInstancePartitionMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.instancePartition != null && message.hasOwnProperty("instancePartition")) { + var error = $root.google.spanner.admin.instance.v1.InstancePartition.verify(message.instancePartition); + if (error) + return "instancePartition." + error; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.cancelTime); + if (error) + return "cancelTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + return null; + }; + + /** + * Creates a CreateInstancePartitionMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.instance.v1.CreateInstancePartitionMetadata} CreateInstancePartitionMetadata + */ + CreateInstancePartitionMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.instance.v1.CreateInstancePartitionMetadata) + return object; + var message = new $root.google.spanner.admin.instance.v1.CreateInstancePartitionMetadata(); + if (object.instancePartition != null) { + if (typeof object.instancePartition !== "object") + throw TypeError(".google.spanner.admin.instance.v1.CreateInstancePartitionMetadata.instancePartition: object expected"); + message.instancePartition = $root.google.spanner.admin.instance.v1.InstancePartition.fromObject(object.instancePartition); + } + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.spanner.admin.instance.v1.CreateInstancePartitionMetadata.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.cancelTime != null) { + if (typeof object.cancelTime !== "object") + throw TypeError(".google.spanner.admin.instance.v1.CreateInstancePartitionMetadata.cancelTime: object expected"); + message.cancelTime = $root.google.protobuf.Timestamp.fromObject(object.cancelTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.spanner.admin.instance.v1.CreateInstancePartitionMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + return message; + }; + + /** + * Creates a plain object from a CreateInstancePartitionMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionMetadata + * @static + * @param {google.spanner.admin.instance.v1.CreateInstancePartitionMetadata} message CreateInstancePartitionMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateInstancePartitionMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.instancePartition = null; + object.startTime = null; + object.cancelTime = null; + object.endTime = null; + } + if (message.instancePartition != null && message.hasOwnProperty("instancePartition")) + object.instancePartition = $root.google.spanner.admin.instance.v1.InstancePartition.toObject(message.instancePartition, options); + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) + object.cancelTime = $root.google.protobuf.Timestamp.toObject(message.cancelTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + return object; + }; + + /** + * Converts this CreateInstancePartitionMetadata to JSON. + * @function toJSON + * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionMetadata + * @instance + * @returns {Object.} JSON object + */ + CreateInstancePartitionMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateInstancePartitionMetadata + * @function getTypeUrl + * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateInstancePartitionMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.instance.v1.CreateInstancePartitionMetadata"; + }; + + return CreateInstancePartitionMetadata; + })(); + + v1.CreateInstancePartitionRequest = (function() { + + /** + * Properties of a CreateInstancePartitionRequest. + * @memberof google.spanner.admin.instance.v1 + * @interface ICreateInstancePartitionRequest + * @property {string|null} [parent] CreateInstancePartitionRequest parent + * @property {string|null} [instancePartitionId] CreateInstancePartitionRequest instancePartitionId + * @property {google.spanner.admin.instance.v1.IInstancePartition|null} [instancePartition] CreateInstancePartitionRequest instancePartition + */ + + /** + * Constructs a new CreateInstancePartitionRequest. + * @memberof google.spanner.admin.instance.v1 + * @classdesc Represents a CreateInstancePartitionRequest. + * @implements ICreateInstancePartitionRequest + * @constructor + * @param {google.spanner.admin.instance.v1.ICreateInstancePartitionRequest=} [properties] Properties to set + */ + function CreateInstancePartitionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateInstancePartitionRequest parent. + * @member {string} parent + * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionRequest + * @instance + */ + CreateInstancePartitionRequest.prototype.parent = ""; + + /** + * CreateInstancePartitionRequest instancePartitionId. + * @member {string} instancePartitionId + * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionRequest + * @instance + */ + CreateInstancePartitionRequest.prototype.instancePartitionId = ""; + + /** + * CreateInstancePartitionRequest instancePartition. + * @member {google.spanner.admin.instance.v1.IInstancePartition|null|undefined} instancePartition + * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionRequest + * @instance + */ + CreateInstancePartitionRequest.prototype.instancePartition = null; + + /** + * Creates a new CreateInstancePartitionRequest instance using the specified properties. + * @function create + * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionRequest + * @static + * @param {google.spanner.admin.instance.v1.ICreateInstancePartitionRequest=} [properties] Properties to set + * @returns {google.spanner.admin.instance.v1.CreateInstancePartitionRequest} CreateInstancePartitionRequest instance + */ + CreateInstancePartitionRequest.create = function create(properties) { + return new CreateInstancePartitionRequest(properties); + }; + + /** + * Encodes the specified CreateInstancePartitionRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.CreateInstancePartitionRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionRequest + * @static + * @param {google.spanner.admin.instance.v1.ICreateInstancePartitionRequest} message CreateInstancePartitionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateInstancePartitionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.instancePartitionId != null && Object.hasOwnProperty.call(message, "instancePartitionId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.instancePartitionId); + if (message.instancePartition != null && Object.hasOwnProperty.call(message, "instancePartition")) + $root.google.spanner.admin.instance.v1.InstancePartition.encode(message.instancePartition, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateInstancePartitionRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.CreateInstancePartitionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionRequest + * @static + * @param {google.spanner.admin.instance.v1.ICreateInstancePartitionRequest} message CreateInstancePartitionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateInstancePartitionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateInstancePartitionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.instance.v1.CreateInstancePartitionRequest} CreateInstancePartitionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateInstancePartitionRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.CreateInstancePartitionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.instancePartitionId = reader.string(); + break; + } + case 3: { + message.instancePartition = $root.google.spanner.admin.instance.v1.InstancePartition.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateInstancePartitionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.instance.v1.CreateInstancePartitionRequest} CreateInstancePartitionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateInstancePartitionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateInstancePartitionRequest message. + * @function verify + * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateInstancePartitionRequest.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.instancePartitionId != null && message.hasOwnProperty("instancePartitionId")) + if (!$util.isString(message.instancePartitionId)) + return "instancePartitionId: string expected"; + if (message.instancePartition != null && message.hasOwnProperty("instancePartition")) { + var error = $root.google.spanner.admin.instance.v1.InstancePartition.verify(message.instancePartition); + if (error) + return "instancePartition." + error; + } + return null; + }; + + /** + * Creates a CreateInstancePartitionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.instance.v1.CreateInstancePartitionRequest} CreateInstancePartitionRequest + */ + CreateInstancePartitionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.instance.v1.CreateInstancePartitionRequest) + return object; + var message = new $root.google.spanner.admin.instance.v1.CreateInstancePartitionRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.instancePartitionId != null) + message.instancePartitionId = String(object.instancePartitionId); + if (object.instancePartition != null) { + if (typeof object.instancePartition !== "object") + throw TypeError(".google.spanner.admin.instance.v1.CreateInstancePartitionRequest.instancePartition: object expected"); + message.instancePartition = $root.google.spanner.admin.instance.v1.InstancePartition.fromObject(object.instancePartition); + } + return message; + }; + + /** + * Creates a plain object from a CreateInstancePartitionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionRequest + * @static + * @param {google.spanner.admin.instance.v1.CreateInstancePartitionRequest} message CreateInstancePartitionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateInstancePartitionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.instancePartitionId = ""; + object.instancePartition = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.instancePartitionId != null && message.hasOwnProperty("instancePartitionId")) + object.instancePartitionId = message.instancePartitionId; + if (message.instancePartition != null && message.hasOwnProperty("instancePartition")) + object.instancePartition = $root.google.spanner.admin.instance.v1.InstancePartition.toObject(message.instancePartition, options); + return object; + }; + + /** + * Converts this CreateInstancePartitionRequest to JSON. + * @function toJSON + * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionRequest + * @instance + * @returns {Object.} JSON object + */ + CreateInstancePartitionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateInstancePartitionRequest + * @function getTypeUrl + * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateInstancePartitionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.instance.v1.CreateInstancePartitionRequest"; + }; + + return CreateInstancePartitionRequest; + })(); + + v1.DeleteInstancePartitionRequest = (function() { + + /** + * Properties of a DeleteInstancePartitionRequest. + * @memberof google.spanner.admin.instance.v1 + * @interface IDeleteInstancePartitionRequest + * @property {string|null} [name] DeleteInstancePartitionRequest name + * @property {string|null} [etag] DeleteInstancePartitionRequest etag + */ + + /** + * Constructs a new DeleteInstancePartitionRequest. + * @memberof google.spanner.admin.instance.v1 + * @classdesc Represents a DeleteInstancePartitionRequest. + * @implements IDeleteInstancePartitionRequest + * @constructor + * @param {google.spanner.admin.instance.v1.IDeleteInstancePartitionRequest=} [properties] Properties to set + */ + function DeleteInstancePartitionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteInstancePartitionRequest name. + * @member {string} name + * @memberof google.spanner.admin.instance.v1.DeleteInstancePartitionRequest + * @instance + */ + DeleteInstancePartitionRequest.prototype.name = ""; + + /** + * DeleteInstancePartitionRequest etag. + * @member {string} etag + * @memberof google.spanner.admin.instance.v1.DeleteInstancePartitionRequest + * @instance + */ + DeleteInstancePartitionRequest.prototype.etag = ""; + + /** + * Creates a new DeleteInstancePartitionRequest instance using the specified properties. + * @function create + * @memberof google.spanner.admin.instance.v1.DeleteInstancePartitionRequest + * @static + * @param {google.spanner.admin.instance.v1.IDeleteInstancePartitionRequest=} [properties] Properties to set + * @returns {google.spanner.admin.instance.v1.DeleteInstancePartitionRequest} DeleteInstancePartitionRequest instance + */ + DeleteInstancePartitionRequest.create = function create(properties) { + return new DeleteInstancePartitionRequest(properties); + }; + + /** + * Encodes the specified DeleteInstancePartitionRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.DeleteInstancePartitionRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.instance.v1.DeleteInstancePartitionRequest + * @static + * @param {google.spanner.admin.instance.v1.IDeleteInstancePartitionRequest} message DeleteInstancePartitionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteInstancePartitionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.etag); + return writer; + }; + + /** + * Encodes the specified DeleteInstancePartitionRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.DeleteInstancePartitionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.instance.v1.DeleteInstancePartitionRequest + * @static + * @param {google.spanner.admin.instance.v1.IDeleteInstancePartitionRequest} message DeleteInstancePartitionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteInstancePartitionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteInstancePartitionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.instance.v1.DeleteInstancePartitionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.instance.v1.DeleteInstancePartitionRequest} DeleteInstancePartitionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteInstancePartitionRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.DeleteInstancePartitionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteInstancePartitionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.instance.v1.DeleteInstancePartitionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.instance.v1.DeleteInstancePartitionRequest} DeleteInstancePartitionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteInstancePartitionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteInstancePartitionRequest message. + * @function verify + * @memberof google.spanner.admin.instance.v1.DeleteInstancePartitionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteInstancePartitionRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a DeleteInstancePartitionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.instance.v1.DeleteInstancePartitionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.instance.v1.DeleteInstancePartitionRequest} DeleteInstancePartitionRequest + */ + DeleteInstancePartitionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.instance.v1.DeleteInstancePartitionRequest) + return object; + var message = new $root.google.spanner.admin.instance.v1.DeleteInstancePartitionRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a DeleteInstancePartitionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.instance.v1.DeleteInstancePartitionRequest + * @static + * @param {google.spanner.admin.instance.v1.DeleteInstancePartitionRequest} message DeleteInstancePartitionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteInstancePartitionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this DeleteInstancePartitionRequest to JSON. + * @function toJSON + * @memberof google.spanner.admin.instance.v1.DeleteInstancePartitionRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteInstancePartitionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteInstancePartitionRequest + * @function getTypeUrl + * @memberof google.spanner.admin.instance.v1.DeleteInstancePartitionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteInstancePartitionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.instance.v1.DeleteInstancePartitionRequest"; + }; + + return DeleteInstancePartitionRequest; + })(); + + v1.GetInstancePartitionRequest = (function() { + + /** + * Properties of a GetInstancePartitionRequest. + * @memberof google.spanner.admin.instance.v1 + * @interface IGetInstancePartitionRequest + * @property {string|null} [name] GetInstancePartitionRequest name + */ + + /** + * Constructs a new GetInstancePartitionRequest. + * @memberof google.spanner.admin.instance.v1 + * @classdesc Represents a GetInstancePartitionRequest. + * @implements IGetInstancePartitionRequest + * @constructor + * @param {google.spanner.admin.instance.v1.IGetInstancePartitionRequest=} [properties] Properties to set + */ + function GetInstancePartitionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetInstancePartitionRequest name. + * @member {string} name + * @memberof google.spanner.admin.instance.v1.GetInstancePartitionRequest + * @instance + */ + GetInstancePartitionRequest.prototype.name = ""; + + /** + * Creates a new GetInstancePartitionRequest instance using the specified properties. + * @function create + * @memberof google.spanner.admin.instance.v1.GetInstancePartitionRequest + * @static + * @param {google.spanner.admin.instance.v1.IGetInstancePartitionRequest=} [properties] Properties to set + * @returns {google.spanner.admin.instance.v1.GetInstancePartitionRequest} GetInstancePartitionRequest instance + */ + GetInstancePartitionRequest.create = function create(properties) { + return new GetInstancePartitionRequest(properties); + }; + + /** + * Encodes the specified GetInstancePartitionRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.GetInstancePartitionRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.instance.v1.GetInstancePartitionRequest + * @static + * @param {google.spanner.admin.instance.v1.IGetInstancePartitionRequest} message GetInstancePartitionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetInstancePartitionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetInstancePartitionRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.GetInstancePartitionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.instance.v1.GetInstancePartitionRequest + * @static + * @param {google.spanner.admin.instance.v1.IGetInstancePartitionRequest} message GetInstancePartitionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetInstancePartitionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetInstancePartitionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.instance.v1.GetInstancePartitionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.instance.v1.GetInstancePartitionRequest} GetInstancePartitionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetInstancePartitionRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.GetInstancePartitionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetInstancePartitionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.instance.v1.GetInstancePartitionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.instance.v1.GetInstancePartitionRequest} GetInstancePartitionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetInstancePartitionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetInstancePartitionRequest message. + * @function verify + * @memberof google.spanner.admin.instance.v1.GetInstancePartitionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetInstancePartitionRequest.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 GetInstancePartitionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.instance.v1.GetInstancePartitionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.instance.v1.GetInstancePartitionRequest} GetInstancePartitionRequest + */ + GetInstancePartitionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.instance.v1.GetInstancePartitionRequest) + return object; + var message = new $root.google.spanner.admin.instance.v1.GetInstancePartitionRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetInstancePartitionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.instance.v1.GetInstancePartitionRequest + * @static + * @param {google.spanner.admin.instance.v1.GetInstancePartitionRequest} message GetInstancePartitionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetInstancePartitionRequest.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 GetInstancePartitionRequest to JSON. + * @function toJSON + * @memberof google.spanner.admin.instance.v1.GetInstancePartitionRequest + * @instance + * @returns {Object.} JSON object + */ + GetInstancePartitionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetInstancePartitionRequest + * @function getTypeUrl + * @memberof google.spanner.admin.instance.v1.GetInstancePartitionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetInstancePartitionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.instance.v1.GetInstancePartitionRequest"; + }; + + return GetInstancePartitionRequest; + })(); + + v1.UpdateInstancePartitionRequest = (function() { + + /** + * Properties of an UpdateInstancePartitionRequest. + * @memberof google.spanner.admin.instance.v1 + * @interface IUpdateInstancePartitionRequest + * @property {google.spanner.admin.instance.v1.IInstancePartition|null} [instancePartition] UpdateInstancePartitionRequest instancePartition + * @property {google.protobuf.IFieldMask|null} [fieldMask] UpdateInstancePartitionRequest fieldMask + */ + + /** + * Constructs a new UpdateInstancePartitionRequest. + * @memberof google.spanner.admin.instance.v1 + * @classdesc Represents an UpdateInstancePartitionRequest. + * @implements IUpdateInstancePartitionRequest + * @constructor + * @param {google.spanner.admin.instance.v1.IUpdateInstancePartitionRequest=} [properties] Properties to set + */ + function UpdateInstancePartitionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateInstancePartitionRequest instancePartition. + * @member {google.spanner.admin.instance.v1.IInstancePartition|null|undefined} instancePartition + * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionRequest + * @instance + */ + UpdateInstancePartitionRequest.prototype.instancePartition = null; + + /** + * UpdateInstancePartitionRequest fieldMask. + * @member {google.protobuf.IFieldMask|null|undefined} fieldMask + * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionRequest + * @instance + */ + UpdateInstancePartitionRequest.prototype.fieldMask = null; + + /** + * Creates a new UpdateInstancePartitionRequest instance using the specified properties. + * @function create + * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionRequest + * @static + * @param {google.spanner.admin.instance.v1.IUpdateInstancePartitionRequest=} [properties] Properties to set + * @returns {google.spanner.admin.instance.v1.UpdateInstancePartitionRequest} UpdateInstancePartitionRequest instance + */ + UpdateInstancePartitionRequest.create = function create(properties) { + return new UpdateInstancePartitionRequest(properties); + }; + + /** + * Encodes the specified UpdateInstancePartitionRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.UpdateInstancePartitionRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionRequest + * @static + * @param {google.spanner.admin.instance.v1.IUpdateInstancePartitionRequest} message UpdateInstancePartitionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateInstancePartitionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.instancePartition != null && Object.hasOwnProperty.call(message, "instancePartition")) + $root.google.spanner.admin.instance.v1.InstancePartition.encode(message.instancePartition, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fieldMask != null && Object.hasOwnProperty.call(message, "fieldMask")) + $root.google.protobuf.FieldMask.encode(message.fieldMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateInstancePartitionRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.UpdateInstancePartitionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionRequest + * @static + * @param {google.spanner.admin.instance.v1.IUpdateInstancePartitionRequest} message UpdateInstancePartitionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateInstancePartitionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateInstancePartitionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.instance.v1.UpdateInstancePartitionRequest} UpdateInstancePartitionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateInstancePartitionRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.UpdateInstancePartitionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.instancePartition = $root.google.spanner.admin.instance.v1.InstancePartition.decode(reader, reader.uint32()); + break; + } + case 2: { + message.fieldMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateInstancePartitionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.instance.v1.UpdateInstancePartitionRequest} UpdateInstancePartitionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateInstancePartitionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateInstancePartitionRequest message. + * @function verify + * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateInstancePartitionRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.instancePartition != null && message.hasOwnProperty("instancePartition")) { + var error = $root.google.spanner.admin.instance.v1.InstancePartition.verify(message.instancePartition); + if (error) + return "instancePartition." + error; + } + if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.fieldMask); + if (error) + return "fieldMask." + error; + } + return null; + }; + + /** + * Creates an UpdateInstancePartitionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.instance.v1.UpdateInstancePartitionRequest} UpdateInstancePartitionRequest + */ + UpdateInstancePartitionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.instance.v1.UpdateInstancePartitionRequest) + return object; + var message = new $root.google.spanner.admin.instance.v1.UpdateInstancePartitionRequest(); + if (object.instancePartition != null) { + if (typeof object.instancePartition !== "object") + throw TypeError(".google.spanner.admin.instance.v1.UpdateInstancePartitionRequest.instancePartition: object expected"); + message.instancePartition = $root.google.spanner.admin.instance.v1.InstancePartition.fromObject(object.instancePartition); + } + if (object.fieldMask != null) { + if (typeof object.fieldMask !== "object") + throw TypeError(".google.spanner.admin.instance.v1.UpdateInstancePartitionRequest.fieldMask: object expected"); + message.fieldMask = $root.google.protobuf.FieldMask.fromObject(object.fieldMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateInstancePartitionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionRequest + * @static + * @param {google.spanner.admin.instance.v1.UpdateInstancePartitionRequest} message UpdateInstancePartitionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateInstancePartitionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.instancePartition = null; + object.fieldMask = null; + } + if (message.instancePartition != null && message.hasOwnProperty("instancePartition")) + object.instancePartition = $root.google.spanner.admin.instance.v1.InstancePartition.toObject(message.instancePartition, options); + if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) + object.fieldMask = $root.google.protobuf.FieldMask.toObject(message.fieldMask, options); + return object; + }; + + /** + * Converts this UpdateInstancePartitionRequest to JSON. + * @function toJSON + * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateInstancePartitionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateInstancePartitionRequest + * @function getTypeUrl + * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateInstancePartitionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.instance.v1.UpdateInstancePartitionRequest"; + }; + + return UpdateInstancePartitionRequest; + })(); + + v1.UpdateInstancePartitionMetadata = (function() { + + /** + * Properties of an UpdateInstancePartitionMetadata. + * @memberof google.spanner.admin.instance.v1 + * @interface IUpdateInstancePartitionMetadata + * @property {google.spanner.admin.instance.v1.IInstancePartition|null} [instancePartition] UpdateInstancePartitionMetadata instancePartition + * @property {google.protobuf.ITimestamp|null} [startTime] UpdateInstancePartitionMetadata startTime + * @property {google.protobuf.ITimestamp|null} [cancelTime] UpdateInstancePartitionMetadata cancelTime + * @property {google.protobuf.ITimestamp|null} [endTime] UpdateInstancePartitionMetadata endTime + */ + + /** + * Constructs a new UpdateInstancePartitionMetadata. + * @memberof google.spanner.admin.instance.v1 + * @classdesc Represents an UpdateInstancePartitionMetadata. + * @implements IUpdateInstancePartitionMetadata + * @constructor + * @param {google.spanner.admin.instance.v1.IUpdateInstancePartitionMetadata=} [properties] Properties to set + */ + function UpdateInstancePartitionMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateInstancePartitionMetadata instancePartition. + * @member {google.spanner.admin.instance.v1.IInstancePartition|null|undefined} instancePartition + * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata + * @instance + */ + UpdateInstancePartitionMetadata.prototype.instancePartition = null; + + /** + * UpdateInstancePartitionMetadata startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata + * @instance + */ + UpdateInstancePartitionMetadata.prototype.startTime = null; + + /** + * UpdateInstancePartitionMetadata cancelTime. + * @member {google.protobuf.ITimestamp|null|undefined} cancelTime + * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata + * @instance + */ + UpdateInstancePartitionMetadata.prototype.cancelTime = null; + + /** + * UpdateInstancePartitionMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata + * @instance + */ + UpdateInstancePartitionMetadata.prototype.endTime = null; + + /** + * Creates a new UpdateInstancePartitionMetadata instance using the specified properties. + * @function create + * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata + * @static + * @param {google.spanner.admin.instance.v1.IUpdateInstancePartitionMetadata=} [properties] Properties to set + * @returns {google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata} UpdateInstancePartitionMetadata instance + */ + UpdateInstancePartitionMetadata.create = function create(properties) { + return new UpdateInstancePartitionMetadata(properties); + }; + + /** + * Encodes the specified UpdateInstancePartitionMetadata message. Does not implicitly {@link google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata + * @static + * @param {google.spanner.admin.instance.v1.IUpdateInstancePartitionMetadata} message UpdateInstancePartitionMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateInstancePartitionMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.instancePartition != null && Object.hasOwnProperty.call(message, "instancePartition")) + $root.google.spanner.admin.instance.v1.InstancePartition.encode(message.instancePartition, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.cancelTime != null && Object.hasOwnProperty.call(message, "cancelTime")) + $root.google.protobuf.Timestamp.encode(message.cancelTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateInstancePartitionMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata + * @static + * @param {google.spanner.admin.instance.v1.IUpdateInstancePartitionMetadata} message UpdateInstancePartitionMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateInstancePartitionMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateInstancePartitionMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata} UpdateInstancePartitionMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateInstancePartitionMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.instancePartition = $root.google.spanner.admin.instance.v1.InstancePartition.decode(reader, reader.uint32()); + break; + } + case 2: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.cancelTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateInstancePartitionMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata} UpdateInstancePartitionMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateInstancePartitionMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateInstancePartitionMetadata message. + * @function verify + * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateInstancePartitionMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.instancePartition != null && message.hasOwnProperty("instancePartition")) { + var error = $root.google.spanner.admin.instance.v1.InstancePartition.verify(message.instancePartition); + if (error) + return "instancePartition." + error; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.cancelTime); + if (error) + return "cancelTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + return null; + }; + + /** + * Creates an UpdateInstancePartitionMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata} UpdateInstancePartitionMetadata + */ + UpdateInstancePartitionMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata) + return object; + var message = new $root.google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata(); + if (object.instancePartition != null) { + if (typeof object.instancePartition !== "object") + throw TypeError(".google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata.instancePartition: object expected"); + message.instancePartition = $root.google.spanner.admin.instance.v1.InstancePartition.fromObject(object.instancePartition); + } + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.cancelTime != null) { + if (typeof object.cancelTime !== "object") + throw TypeError(".google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata.cancelTime: object expected"); + message.cancelTime = $root.google.protobuf.Timestamp.fromObject(object.cancelTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + return message; + }; + + /** + * Creates a plain object from an UpdateInstancePartitionMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata + * @static + * @param {google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata} message UpdateInstancePartitionMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateInstancePartitionMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.instancePartition = null; + object.startTime = null; + object.cancelTime = null; + object.endTime = null; + } + if (message.instancePartition != null && message.hasOwnProperty("instancePartition")) + object.instancePartition = $root.google.spanner.admin.instance.v1.InstancePartition.toObject(message.instancePartition, options); + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) + object.cancelTime = $root.google.protobuf.Timestamp.toObject(message.cancelTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + return object; + }; + + /** + * Converts this UpdateInstancePartitionMetadata to JSON. + * @function toJSON + * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata + * @instance + * @returns {Object.} JSON object + */ + UpdateInstancePartitionMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateInstancePartitionMetadata + * @function getTypeUrl + * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateInstancePartitionMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata"; + }; + + return UpdateInstancePartitionMetadata; + })(); + + v1.ListInstancePartitionsRequest = (function() { + + /** + * Properties of a ListInstancePartitionsRequest. + * @memberof google.spanner.admin.instance.v1 + * @interface IListInstancePartitionsRequest + * @property {string|null} [parent] ListInstancePartitionsRequest parent + * @property {number|null} [pageSize] ListInstancePartitionsRequest pageSize + * @property {string|null} [pageToken] ListInstancePartitionsRequest pageToken + * @property {google.protobuf.ITimestamp|null} [instancePartitionDeadline] ListInstancePartitionsRequest instancePartitionDeadline + */ + + /** + * Constructs a new ListInstancePartitionsRequest. + * @memberof google.spanner.admin.instance.v1 + * @classdesc Represents a ListInstancePartitionsRequest. + * @implements IListInstancePartitionsRequest + * @constructor + * @param {google.spanner.admin.instance.v1.IListInstancePartitionsRequest=} [properties] Properties to set + */ + function ListInstancePartitionsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListInstancePartitionsRequest parent. + * @member {string} parent + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsRequest + * @instance + */ + ListInstancePartitionsRequest.prototype.parent = ""; + + /** + * ListInstancePartitionsRequest pageSize. + * @member {number} pageSize + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsRequest + * @instance + */ + ListInstancePartitionsRequest.prototype.pageSize = 0; + + /** + * ListInstancePartitionsRequest pageToken. + * @member {string} pageToken + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsRequest + * @instance + */ + ListInstancePartitionsRequest.prototype.pageToken = ""; + + /** + * ListInstancePartitionsRequest instancePartitionDeadline. + * @member {google.protobuf.ITimestamp|null|undefined} instancePartitionDeadline + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsRequest + * @instance + */ + ListInstancePartitionsRequest.prototype.instancePartitionDeadline = null; + + /** + * Creates a new ListInstancePartitionsRequest instance using the specified properties. + * @function create + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsRequest + * @static + * @param {google.spanner.admin.instance.v1.IListInstancePartitionsRequest=} [properties] Properties to set + * @returns {google.spanner.admin.instance.v1.ListInstancePartitionsRequest} ListInstancePartitionsRequest instance + */ + ListInstancePartitionsRequest.create = function create(properties) { + return new ListInstancePartitionsRequest(properties); + }; + + /** + * Encodes the specified ListInstancePartitionsRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancePartitionsRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsRequest + * @static + * @param {google.spanner.admin.instance.v1.IListInstancePartitionsRequest} message ListInstancePartitionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstancePartitionsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.instancePartitionDeadline != null && Object.hasOwnProperty.call(message, "instancePartitionDeadline")) + $root.google.protobuf.Timestamp.encode(message.instancePartitionDeadline, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ListInstancePartitionsRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancePartitionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsRequest + * @static + * @param {google.spanner.admin.instance.v1.IListInstancePartitionsRequest} message ListInstancePartitionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstancePartitionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListInstancePartitionsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.instance.v1.ListInstancePartitionsRequest} ListInstancePartitionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstancePartitionsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.ListInstancePartitionsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.instancePartitionDeadline = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListInstancePartitionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.instance.v1.ListInstancePartitionsRequest} ListInstancePartitionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstancePartitionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListInstancePartitionsRequest message. + * @function verify + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListInstancePartitionsRequest.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.instancePartitionDeadline != null && message.hasOwnProperty("instancePartitionDeadline")) { + var error = $root.google.protobuf.Timestamp.verify(message.instancePartitionDeadline); + if (error) + return "instancePartitionDeadline." + error; + } + return null; + }; + + /** + * Creates a ListInstancePartitionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.instance.v1.ListInstancePartitionsRequest} ListInstancePartitionsRequest + */ + ListInstancePartitionsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.instance.v1.ListInstancePartitionsRequest) + return object; + var message = new $root.google.spanner.admin.instance.v1.ListInstancePartitionsRequest(); + 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); + if (object.instancePartitionDeadline != null) { + if (typeof object.instancePartitionDeadline !== "object") + throw TypeError(".google.spanner.admin.instance.v1.ListInstancePartitionsRequest.instancePartitionDeadline: object expected"); + message.instancePartitionDeadline = $root.google.protobuf.Timestamp.fromObject(object.instancePartitionDeadline); + } + return message; + }; + + /** + * Creates a plain object from a ListInstancePartitionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsRequest + * @static + * @param {google.spanner.admin.instance.v1.ListInstancePartitionsRequest} message ListInstancePartitionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListInstancePartitionsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.instancePartitionDeadline = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.instancePartitionDeadline != null && message.hasOwnProperty("instancePartitionDeadline")) + object.instancePartitionDeadline = $root.google.protobuf.Timestamp.toObject(message.instancePartitionDeadline, options); + return object; + }; + + /** + * Converts this ListInstancePartitionsRequest to JSON. + * @function toJSON + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsRequest + * @instance + * @returns {Object.} JSON object + */ + ListInstancePartitionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListInstancePartitionsRequest + * @function getTypeUrl + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListInstancePartitionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.instance.v1.ListInstancePartitionsRequest"; + }; + + return ListInstancePartitionsRequest; + })(); + + v1.ListInstancePartitionsResponse = (function() { + + /** + * Properties of a ListInstancePartitionsResponse. + * @memberof google.spanner.admin.instance.v1 + * @interface IListInstancePartitionsResponse + * @property {Array.|null} [instancePartitions] ListInstancePartitionsResponse instancePartitions + * @property {string|null} [nextPageToken] ListInstancePartitionsResponse nextPageToken + * @property {Array.|null} [unreachable] ListInstancePartitionsResponse unreachable + */ + + /** + * Constructs a new ListInstancePartitionsResponse. + * @memberof google.spanner.admin.instance.v1 + * @classdesc Represents a ListInstancePartitionsResponse. + * @implements IListInstancePartitionsResponse + * @constructor + * @param {google.spanner.admin.instance.v1.IListInstancePartitionsResponse=} [properties] Properties to set + */ + function ListInstancePartitionsResponse(properties) { + this.instancePartitions = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListInstancePartitionsResponse instancePartitions. + * @member {Array.} instancePartitions + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsResponse + * @instance + */ + ListInstancePartitionsResponse.prototype.instancePartitions = $util.emptyArray; + + /** + * ListInstancePartitionsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsResponse + * @instance + */ + ListInstancePartitionsResponse.prototype.nextPageToken = ""; + + /** + * ListInstancePartitionsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsResponse + * @instance + */ + ListInstancePartitionsResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListInstancePartitionsResponse instance using the specified properties. + * @function create + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsResponse + * @static + * @param {google.spanner.admin.instance.v1.IListInstancePartitionsResponse=} [properties] Properties to set + * @returns {google.spanner.admin.instance.v1.ListInstancePartitionsResponse} ListInstancePartitionsResponse instance + */ + ListInstancePartitionsResponse.create = function create(properties) { + return new ListInstancePartitionsResponse(properties); + }; + + /** + * Encodes the specified ListInstancePartitionsResponse message. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancePartitionsResponse.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsResponse + * @static + * @param {google.spanner.admin.instance.v1.IListInstancePartitionsResponse} message ListInstancePartitionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstancePartitionsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.instancePartitions != null && message.instancePartitions.length) + for (var i = 0; i < message.instancePartitions.length; ++i) + $root.google.spanner.admin.instance.v1.InstancePartition.encode(message.instancePartitions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListInstancePartitionsResponse message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancePartitionsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsResponse + * @static + * @param {google.spanner.admin.instance.v1.IListInstancePartitionsResponse} message ListInstancePartitionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstancePartitionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListInstancePartitionsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.instance.v1.ListInstancePartitionsResponse} ListInstancePartitionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstancePartitionsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.ListInstancePartitionsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.instancePartitions && message.instancePartitions.length)) + message.instancePartitions = []; + message.instancePartitions.push($root.google.spanner.admin.instance.v1.InstancePartition.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListInstancePartitionsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.instance.v1.ListInstancePartitionsResponse} ListInstancePartitionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstancePartitionsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListInstancePartitionsResponse message. + * @function verify + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListInstancePartitionsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.instancePartitions != null && message.hasOwnProperty("instancePartitions")) { + if (!Array.isArray(message.instancePartitions)) + return "instancePartitions: array expected"; + for (var i = 0; i < message.instancePartitions.length; ++i) { + var error = $root.google.spanner.admin.instance.v1.InstancePartition.verify(message.instancePartitions[i]); + if (error) + return "instancePartitions." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListInstancePartitionsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.instance.v1.ListInstancePartitionsResponse} ListInstancePartitionsResponse + */ + ListInstancePartitionsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.instance.v1.ListInstancePartitionsResponse) + return object; + var message = new $root.google.spanner.admin.instance.v1.ListInstancePartitionsResponse(); + if (object.instancePartitions) { + if (!Array.isArray(object.instancePartitions)) + throw TypeError(".google.spanner.admin.instance.v1.ListInstancePartitionsResponse.instancePartitions: array expected"); + message.instancePartitions = []; + for (var i = 0; i < object.instancePartitions.length; ++i) { + if (typeof object.instancePartitions[i] !== "object") + throw TypeError(".google.spanner.admin.instance.v1.ListInstancePartitionsResponse.instancePartitions: object expected"); + message.instancePartitions[i] = $root.google.spanner.admin.instance.v1.InstancePartition.fromObject(object.instancePartitions[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.spanner.admin.instance.v1.ListInstancePartitionsResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListInstancePartitionsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsResponse + * @static + * @param {google.spanner.admin.instance.v1.ListInstancePartitionsResponse} message ListInstancePartitionsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListInstancePartitionsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.instancePartitions = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.instancePartitions && message.instancePartitions.length) { + object.instancePartitions = []; + for (var j = 0; j < message.instancePartitions.length; ++j) + object.instancePartitions[j] = $root.google.spanner.admin.instance.v1.InstancePartition.toObject(message.instancePartitions[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListInstancePartitionsResponse to JSON. + * @function toJSON + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsResponse + * @instance + * @returns {Object.} JSON object + */ + ListInstancePartitionsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListInstancePartitionsResponse + * @function getTypeUrl + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListInstancePartitionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.instance.v1.ListInstancePartitionsResponse"; + }; + + return ListInstancePartitionsResponse; + })(); + + v1.ListInstancePartitionOperationsRequest = (function() { + + /** + * Properties of a ListInstancePartitionOperationsRequest. + * @memberof google.spanner.admin.instance.v1 + * @interface IListInstancePartitionOperationsRequest + * @property {string|null} [parent] ListInstancePartitionOperationsRequest parent + * @property {string|null} [filter] ListInstancePartitionOperationsRequest filter + * @property {number|null} [pageSize] ListInstancePartitionOperationsRequest pageSize + * @property {string|null} [pageToken] ListInstancePartitionOperationsRequest pageToken + * @property {google.protobuf.ITimestamp|null} [instancePartitionDeadline] ListInstancePartitionOperationsRequest instancePartitionDeadline + */ + + /** + * Constructs a new ListInstancePartitionOperationsRequest. + * @memberof google.spanner.admin.instance.v1 + * @classdesc Represents a ListInstancePartitionOperationsRequest. + * @implements IListInstancePartitionOperationsRequest + * @constructor + * @param {google.spanner.admin.instance.v1.IListInstancePartitionOperationsRequest=} [properties] Properties to set + */ + function ListInstancePartitionOperationsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListInstancePartitionOperationsRequest parent. + * @member {string} parent + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest + * @instance + */ + ListInstancePartitionOperationsRequest.prototype.parent = ""; + + /** + * ListInstancePartitionOperationsRequest filter. + * @member {string} filter + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest + * @instance + */ + ListInstancePartitionOperationsRequest.prototype.filter = ""; + + /** + * ListInstancePartitionOperationsRequest pageSize. + * @member {number} pageSize + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest + * @instance + */ + ListInstancePartitionOperationsRequest.prototype.pageSize = 0; + + /** + * ListInstancePartitionOperationsRequest pageToken. + * @member {string} pageToken + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest + * @instance + */ + ListInstancePartitionOperationsRequest.prototype.pageToken = ""; + + /** + * ListInstancePartitionOperationsRequest instancePartitionDeadline. + * @member {google.protobuf.ITimestamp|null|undefined} instancePartitionDeadline + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest + * @instance + */ + ListInstancePartitionOperationsRequest.prototype.instancePartitionDeadline = null; + + /** + * Creates a new ListInstancePartitionOperationsRequest instance using the specified properties. + * @function create + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest + * @static + * @param {google.spanner.admin.instance.v1.IListInstancePartitionOperationsRequest=} [properties] Properties to set + * @returns {google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest} ListInstancePartitionOperationsRequest instance + */ + ListInstancePartitionOperationsRequest.create = function create(properties) { + return new ListInstancePartitionOperationsRequest(properties); + }; + + /** + * Encodes the specified ListInstancePartitionOperationsRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest + * @static + * @param {google.spanner.admin.instance.v1.IListInstancePartitionOperationsRequest} message ListInstancePartitionOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstancePartitionOperationsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + if (message.instancePartitionDeadline != null && Object.hasOwnProperty.call(message, "instancePartitionDeadline")) + $root.google.protobuf.Timestamp.encode(message.instancePartitionDeadline, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ListInstancePartitionOperationsRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest + * @static + * @param {google.spanner.admin.instance.v1.IListInstancePartitionOperationsRequest} message ListInstancePartitionOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstancePartitionOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListInstancePartitionOperationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest} ListInstancePartitionOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstancePartitionOperationsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.filter = reader.string(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } + case 5: { + message.instancePartitionDeadline = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListInstancePartitionOperationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest} ListInstancePartitionOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstancePartitionOperationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListInstancePartitionOperationsRequest message. + * @function verify + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListInstancePartitionOperationsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.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.instancePartitionDeadline != null && message.hasOwnProperty("instancePartitionDeadline")) { + var error = $root.google.protobuf.Timestamp.verify(message.instancePartitionDeadline); + if (error) + return "instancePartitionDeadline." + error; + } + return null; + }; + + /** + * Creates a ListInstancePartitionOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest} ListInstancePartitionOperationsRequest + */ + ListInstancePartitionOperationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest) + return object; + var message = new $root.google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.instancePartitionDeadline != null) { + if (typeof object.instancePartitionDeadline !== "object") + throw TypeError(".google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest.instancePartitionDeadline: object expected"); + message.instancePartitionDeadline = $root.google.protobuf.Timestamp.fromObject(object.instancePartitionDeadline); + } + return message; + }; + + /** + * Creates a plain object from a ListInstancePartitionOperationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest + * @static + * @param {google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest} message ListInstancePartitionOperationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListInstancePartitionOperationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + object.instancePartitionDeadline = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.instancePartitionDeadline != null && message.hasOwnProperty("instancePartitionDeadline")) + object.instancePartitionDeadline = $root.google.protobuf.Timestamp.toObject(message.instancePartitionDeadline, options); + return object; + }; + + /** + * Converts this ListInstancePartitionOperationsRequest to JSON. + * @function toJSON + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListInstancePartitionOperationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListInstancePartitionOperationsRequest + * @function getTypeUrl + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListInstancePartitionOperationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest"; + }; + + return ListInstancePartitionOperationsRequest; + })(); + + v1.ListInstancePartitionOperationsResponse = (function() { + + /** + * Properties of a ListInstancePartitionOperationsResponse. + * @memberof google.spanner.admin.instance.v1 + * @interface IListInstancePartitionOperationsResponse + * @property {Array.|null} [operations] ListInstancePartitionOperationsResponse operations + * @property {string|null} [nextPageToken] ListInstancePartitionOperationsResponse nextPageToken + * @property {Array.|null} [unreachableInstancePartitions] ListInstancePartitionOperationsResponse unreachableInstancePartitions + */ + + /** + * Constructs a new ListInstancePartitionOperationsResponse. + * @memberof google.spanner.admin.instance.v1 + * @classdesc Represents a ListInstancePartitionOperationsResponse. + * @implements IListInstancePartitionOperationsResponse + * @constructor + * @param {google.spanner.admin.instance.v1.IListInstancePartitionOperationsResponse=} [properties] Properties to set + */ + function ListInstancePartitionOperationsResponse(properties) { + this.operations = []; + this.unreachableInstancePartitions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListInstancePartitionOperationsResponse operations. + * @member {Array.} operations + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse + * @instance + */ + ListInstancePartitionOperationsResponse.prototype.operations = $util.emptyArray; + + /** + * ListInstancePartitionOperationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse + * @instance + */ + ListInstancePartitionOperationsResponse.prototype.nextPageToken = ""; + + /** + * ListInstancePartitionOperationsResponse unreachableInstancePartitions. + * @member {Array.} unreachableInstancePartitions + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse + * @instance + */ + ListInstancePartitionOperationsResponse.prototype.unreachableInstancePartitions = $util.emptyArray; + + /** + * Creates a new ListInstancePartitionOperationsResponse instance using the specified properties. + * @function create + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse + * @static + * @param {google.spanner.admin.instance.v1.IListInstancePartitionOperationsResponse=} [properties] Properties to set + * @returns {google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse} ListInstancePartitionOperationsResponse instance + */ + ListInstancePartitionOperationsResponse.create = function create(properties) { + return new ListInstancePartitionOperationsResponse(properties); + }; + + /** + * Encodes the specified ListInstancePartitionOperationsResponse message. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse + * @static + * @param {google.spanner.admin.instance.v1.IListInstancePartitionOperationsResponse} message ListInstancePartitionOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstancePartitionOperationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.operations != null && message.operations.length) + for (var i = 0; i < message.operations.length; ++i) + $root.google.longrunning.Operation.encode(message.operations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachableInstancePartitions != null && message.unreachableInstancePartitions.length) + for (var i = 0; i < message.unreachableInstancePartitions.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachableInstancePartitions[i]); + return writer; + }; + + /** + * Encodes the specified ListInstancePartitionOperationsResponse message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse + * @static + * @param {google.spanner.admin.instance.v1.IListInstancePartitionOperationsResponse} message ListInstancePartitionOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstancePartitionOperationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListInstancePartitionOperationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse} ListInstancePartitionOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstancePartitionOperationsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.operations && message.operations.length)) + message.operations = []; + message.operations.push($root.google.longrunning.Operation.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachableInstancePartitions && message.unreachableInstancePartitions.length)) + message.unreachableInstancePartitions = []; + message.unreachableInstancePartitions.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListInstancePartitionOperationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse} ListInstancePartitionOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstancePartitionOperationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListInstancePartitionOperationsResponse message. + * @function verify + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListInstancePartitionOperationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.operations != null && message.hasOwnProperty("operations")) { + if (!Array.isArray(message.operations)) + return "operations: array expected"; + for (var i = 0; i < message.operations.length; ++i) { + var error = $root.google.longrunning.Operation.verify(message.operations[i]); + if (error) + return "operations." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachableInstancePartitions != null && message.hasOwnProperty("unreachableInstancePartitions")) { + if (!Array.isArray(message.unreachableInstancePartitions)) + return "unreachableInstancePartitions: array expected"; + for (var i = 0; i < message.unreachableInstancePartitions.length; ++i) + if (!$util.isString(message.unreachableInstancePartitions[i])) + return "unreachableInstancePartitions: string[] expected"; + } + return null; + }; + + /** + * Creates a ListInstancePartitionOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse} ListInstancePartitionOperationsResponse + */ + ListInstancePartitionOperationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse) + return object; + var message = new $root.google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse(); + if (object.operations) { + if (!Array.isArray(object.operations)) + throw TypeError(".google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse.operations: array expected"); + message.operations = []; + for (var i = 0; i < object.operations.length; ++i) { + if (typeof object.operations[i] !== "object") + throw TypeError(".google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse.operations: object expected"); + message.operations[i] = $root.google.longrunning.Operation.fromObject(object.operations[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachableInstancePartitions) { + if (!Array.isArray(object.unreachableInstancePartitions)) + throw TypeError(".google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse.unreachableInstancePartitions: array expected"); + message.unreachableInstancePartitions = []; + for (var i = 0; i < object.unreachableInstancePartitions.length; ++i) + message.unreachableInstancePartitions[i] = String(object.unreachableInstancePartitions[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListInstancePartitionOperationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse + * @static + * @param {google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse} message ListInstancePartitionOperationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListInstancePartitionOperationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.operations = []; + object.unreachableInstancePartitions = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.operations && message.operations.length) { + object.operations = []; + for (var j = 0; j < message.operations.length; ++j) + object.operations[j] = $root.google.longrunning.Operation.toObject(message.operations[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachableInstancePartitions && message.unreachableInstancePartitions.length) { + object.unreachableInstancePartitions = []; + for (var j = 0; j < message.unreachableInstancePartitions.length; ++j) + object.unreachableInstancePartitions[j] = message.unreachableInstancePartitions[j]; + } + return object; + }; + + /** + * Converts this ListInstancePartitionOperationsResponse to JSON. + * @function toJSON + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse + * @instance + * @returns {Object.} JSON object + */ + ListInstancePartitionOperationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListInstancePartitionOperationsResponse + * @function getTypeUrl + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListInstancePartitionOperationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse"; + }; + + return ListInstancePartitionOperationsResponse; + })(); + + v1.MoveInstanceRequest = (function() { + + /** + * Properties of a MoveInstanceRequest. + * @memberof google.spanner.admin.instance.v1 + * @interface IMoveInstanceRequest + * @property {string|null} [name] MoveInstanceRequest name + * @property {string|null} [targetConfig] MoveInstanceRequest targetConfig + */ + + /** + * Constructs a new MoveInstanceRequest. + * @memberof google.spanner.admin.instance.v1 + * @classdesc Represents a MoveInstanceRequest. + * @implements IMoveInstanceRequest + * @constructor + * @param {google.spanner.admin.instance.v1.IMoveInstanceRequest=} [properties] Properties to set + */ + function MoveInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MoveInstanceRequest name. + * @member {string} name + * @memberof google.spanner.admin.instance.v1.MoveInstanceRequest + * @instance + */ + MoveInstanceRequest.prototype.name = ""; + + /** + * MoveInstanceRequest targetConfig. + * @member {string} targetConfig + * @memberof google.spanner.admin.instance.v1.MoveInstanceRequest + * @instance + */ + MoveInstanceRequest.prototype.targetConfig = ""; + + /** + * Creates a new MoveInstanceRequest instance using the specified properties. + * @function create + * @memberof google.spanner.admin.instance.v1.MoveInstanceRequest + * @static + * @param {google.spanner.admin.instance.v1.IMoveInstanceRequest=} [properties] Properties to set + * @returns {google.spanner.admin.instance.v1.MoveInstanceRequest} MoveInstanceRequest instance + */ + MoveInstanceRequest.create = function create(properties) { + return new MoveInstanceRequest(properties); + }; + + /** + * Encodes the specified MoveInstanceRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.MoveInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.instance.v1.MoveInstanceRequest + * @static + * @param {google.spanner.admin.instance.v1.IMoveInstanceRequest} message MoveInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MoveInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.targetConfig != null && Object.hasOwnProperty.call(message, "targetConfig")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.targetConfig); + return writer; + }; + + /** + * Encodes the specified MoveInstanceRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.MoveInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.instance.v1.MoveInstanceRequest + * @static + * @param {google.spanner.admin.instance.v1.IMoveInstanceRequest} message MoveInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MoveInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MoveInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.instance.v1.MoveInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.instance.v1.MoveInstanceRequest} MoveInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MoveInstanceRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.MoveInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.targetConfig = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MoveInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.instance.v1.MoveInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.instance.v1.MoveInstanceRequest} MoveInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MoveInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MoveInstanceRequest message. + * @function verify + * @memberof google.spanner.admin.instance.v1.MoveInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MoveInstanceRequest.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.targetConfig != null && message.hasOwnProperty("targetConfig")) + if (!$util.isString(message.targetConfig)) + return "targetConfig: string expected"; + return null; + }; + + /** + * Creates a MoveInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.instance.v1.MoveInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.instance.v1.MoveInstanceRequest} MoveInstanceRequest + */ + MoveInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.instance.v1.MoveInstanceRequest) + return object; + var message = new $root.google.spanner.admin.instance.v1.MoveInstanceRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.targetConfig != null) + message.targetConfig = String(object.targetConfig); + return message; + }; + + /** + * Creates a plain object from a MoveInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.instance.v1.MoveInstanceRequest + * @static + * @param {google.spanner.admin.instance.v1.MoveInstanceRequest} message MoveInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MoveInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.targetConfig = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.targetConfig != null && message.hasOwnProperty("targetConfig")) + object.targetConfig = message.targetConfig; + return object; + }; + + /** + * Converts this MoveInstanceRequest to JSON. + * @function toJSON + * @memberof google.spanner.admin.instance.v1.MoveInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + MoveInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MoveInstanceRequest + * @function getTypeUrl + * @memberof google.spanner.admin.instance.v1.MoveInstanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MoveInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.instance.v1.MoveInstanceRequest"; + }; + + return MoveInstanceRequest; + })(); + + v1.MoveInstanceResponse = (function() { + + /** + * Properties of a MoveInstanceResponse. + * @memberof google.spanner.admin.instance.v1 + * @interface IMoveInstanceResponse + */ + + /** + * Constructs a new MoveInstanceResponse. + * @memberof google.spanner.admin.instance.v1 + * @classdesc Represents a MoveInstanceResponse. + * @implements IMoveInstanceResponse + * @constructor + * @param {google.spanner.admin.instance.v1.IMoveInstanceResponse=} [properties] Properties to set + */ + function MoveInstanceResponse(properties) { + if (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 MoveInstanceResponse instance using the specified properties. + * @function create + * @memberof google.spanner.admin.instance.v1.MoveInstanceResponse + * @static + * @param {google.spanner.admin.instance.v1.IMoveInstanceResponse=} [properties] Properties to set + * @returns {google.spanner.admin.instance.v1.MoveInstanceResponse} MoveInstanceResponse instance + */ + MoveInstanceResponse.create = function create(properties) { + return new MoveInstanceResponse(properties); + }; + + /** + * Encodes the specified MoveInstanceResponse message. Does not implicitly {@link google.spanner.admin.instance.v1.MoveInstanceResponse.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.instance.v1.MoveInstanceResponse + * @static + * @param {google.spanner.admin.instance.v1.IMoveInstanceResponse} message MoveInstanceResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MoveInstanceResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified MoveInstanceResponse message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.MoveInstanceResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.instance.v1.MoveInstanceResponse + * @static + * @param {google.spanner.admin.instance.v1.IMoveInstanceResponse} message MoveInstanceResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MoveInstanceResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MoveInstanceResponse message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.instance.v1.MoveInstanceResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.instance.v1.MoveInstanceResponse} MoveInstanceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MoveInstanceResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.MoveInstanceResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MoveInstanceResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.instance.v1.MoveInstanceResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.instance.v1.MoveInstanceResponse} MoveInstanceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MoveInstanceResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MoveInstanceResponse message. + * @function verify + * @memberof google.spanner.admin.instance.v1.MoveInstanceResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MoveInstanceResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a MoveInstanceResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.instance.v1.MoveInstanceResponse + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.instance.v1.MoveInstanceResponse} MoveInstanceResponse + */ + MoveInstanceResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.instance.v1.MoveInstanceResponse) + return object; + return new $root.google.spanner.admin.instance.v1.MoveInstanceResponse(); + }; + + /** + * Creates a plain object from a MoveInstanceResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.instance.v1.MoveInstanceResponse + * @static + * @param {google.spanner.admin.instance.v1.MoveInstanceResponse} message MoveInstanceResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MoveInstanceResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this MoveInstanceResponse to JSON. + * @function toJSON + * @memberof google.spanner.admin.instance.v1.MoveInstanceResponse + * @instance + * @returns {Object.} JSON object + */ + MoveInstanceResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MoveInstanceResponse + * @function getTypeUrl + * @memberof google.spanner.admin.instance.v1.MoveInstanceResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MoveInstanceResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.instance.v1.MoveInstanceResponse"; + }; + + return MoveInstanceResponse; + })(); + + v1.MoveInstanceMetadata = (function() { + + /** + * Properties of a MoveInstanceMetadata. + * @memberof google.spanner.admin.instance.v1 + * @interface IMoveInstanceMetadata + * @property {string|null} [targetConfig] MoveInstanceMetadata targetConfig + * @property {google.spanner.admin.instance.v1.IOperationProgress|null} [progress] MoveInstanceMetadata progress + * @property {google.protobuf.ITimestamp|null} [cancelTime] MoveInstanceMetadata cancelTime + */ + + /** + * Constructs a new MoveInstanceMetadata. + * @memberof google.spanner.admin.instance.v1 + * @classdesc Represents a MoveInstanceMetadata. + * @implements IMoveInstanceMetadata + * @constructor + * @param {google.spanner.admin.instance.v1.IMoveInstanceMetadata=} [properties] Properties to set + */ + function MoveInstanceMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MoveInstanceMetadata targetConfig. + * @member {string} targetConfig + * @memberof google.spanner.admin.instance.v1.MoveInstanceMetadata + * @instance + */ + MoveInstanceMetadata.prototype.targetConfig = ""; + + /** + * MoveInstanceMetadata progress. + * @member {google.spanner.admin.instance.v1.IOperationProgress|null|undefined} progress + * @memberof google.spanner.admin.instance.v1.MoveInstanceMetadata + * @instance + */ + MoveInstanceMetadata.prototype.progress = null; + + /** + * MoveInstanceMetadata cancelTime. + * @member {google.protobuf.ITimestamp|null|undefined} cancelTime + * @memberof google.spanner.admin.instance.v1.MoveInstanceMetadata + * @instance + */ + MoveInstanceMetadata.prototype.cancelTime = null; + + /** + * Creates a new MoveInstanceMetadata instance using the specified properties. + * @function create + * @memberof google.spanner.admin.instance.v1.MoveInstanceMetadata + * @static + * @param {google.spanner.admin.instance.v1.IMoveInstanceMetadata=} [properties] Properties to set + * @returns {google.spanner.admin.instance.v1.MoveInstanceMetadata} MoveInstanceMetadata instance + */ + MoveInstanceMetadata.create = function create(properties) { + return new MoveInstanceMetadata(properties); + }; + + /** + * Encodes the specified MoveInstanceMetadata message. Does not implicitly {@link google.spanner.admin.instance.v1.MoveInstanceMetadata.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.instance.v1.MoveInstanceMetadata + * @static + * @param {google.spanner.admin.instance.v1.IMoveInstanceMetadata} message MoveInstanceMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MoveInstanceMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.targetConfig != null && Object.hasOwnProperty.call(message, "targetConfig")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.targetConfig); + if (message.progress != null && Object.hasOwnProperty.call(message, "progress")) + $root.google.spanner.admin.instance.v1.OperationProgress.encode(message.progress, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.cancelTime != null && Object.hasOwnProperty.call(message, "cancelTime")) + $root.google.protobuf.Timestamp.encode(message.cancelTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MoveInstanceMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.MoveInstanceMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.instance.v1.MoveInstanceMetadata + * @static + * @param {google.spanner.admin.instance.v1.IMoveInstanceMetadata} message MoveInstanceMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MoveInstanceMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MoveInstanceMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.instance.v1.MoveInstanceMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.instance.v1.MoveInstanceMetadata} MoveInstanceMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MoveInstanceMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.MoveInstanceMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.targetConfig = reader.string(); + break; + } + case 2: { + message.progress = $root.google.spanner.admin.instance.v1.OperationProgress.decode(reader, reader.uint32()); + break; + } + case 3: { + message.cancelTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MoveInstanceMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.instance.v1.MoveInstanceMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.instance.v1.MoveInstanceMetadata} MoveInstanceMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MoveInstanceMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MoveInstanceMetadata message. + * @function verify + * @memberof google.spanner.admin.instance.v1.MoveInstanceMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MoveInstanceMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.targetConfig != null && message.hasOwnProperty("targetConfig")) + if (!$util.isString(message.targetConfig)) + return "targetConfig: string expected"; + if (message.progress != null && message.hasOwnProperty("progress")) { + var error = $root.google.spanner.admin.instance.v1.OperationProgress.verify(message.progress); + if (error) + return "progress." + error; + } + if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.cancelTime); + if (error) + return "cancelTime." + error; + } + return null; + }; + + /** + * Creates a MoveInstanceMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.instance.v1.MoveInstanceMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.instance.v1.MoveInstanceMetadata} MoveInstanceMetadata + */ + MoveInstanceMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.instance.v1.MoveInstanceMetadata) + return object; + var message = new $root.google.spanner.admin.instance.v1.MoveInstanceMetadata(); + if (object.targetConfig != null) + message.targetConfig = String(object.targetConfig); + if (object.progress != null) { + if (typeof object.progress !== "object") + throw TypeError(".google.spanner.admin.instance.v1.MoveInstanceMetadata.progress: object expected"); + message.progress = $root.google.spanner.admin.instance.v1.OperationProgress.fromObject(object.progress); + } + if (object.cancelTime != null) { + if (typeof object.cancelTime !== "object") + throw TypeError(".google.spanner.admin.instance.v1.MoveInstanceMetadata.cancelTime: object expected"); + message.cancelTime = $root.google.protobuf.Timestamp.fromObject(object.cancelTime); + } + return message; + }; + + /** + * Creates a plain object from a MoveInstanceMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.instance.v1.MoveInstanceMetadata + * @static + * @param {google.spanner.admin.instance.v1.MoveInstanceMetadata} message MoveInstanceMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MoveInstanceMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.targetConfig = ""; + object.progress = null; + object.cancelTime = null; + } + if (message.targetConfig != null && message.hasOwnProperty("targetConfig")) + object.targetConfig = message.targetConfig; + if (message.progress != null && message.hasOwnProperty("progress")) + object.progress = $root.google.spanner.admin.instance.v1.OperationProgress.toObject(message.progress, options); + if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) + object.cancelTime = $root.google.protobuf.Timestamp.toObject(message.cancelTime, options); + return object; + }; + + /** + * Converts this MoveInstanceMetadata to JSON. + * @function toJSON + * @memberof google.spanner.admin.instance.v1.MoveInstanceMetadata + * @instance + * @returns {Object.} JSON object + */ + MoveInstanceMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MoveInstanceMetadata + * @function getTypeUrl + * @memberof google.spanner.admin.instance.v1.MoveInstanceMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MoveInstanceMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.instance.v1.MoveInstanceMetadata"; + }; + + return MoveInstanceMetadata; + })(); + + return v1; + })(); + + return instance; + })(); + + return admin; + })(); + + return spanner; + })(); + + google.api = (function() { + + /** + * Namespace api. + * @memberof google + * @namespace + */ + var api = {}; + + /** + * FieldBehavior enum. + * @name google.api.FieldBehavior + * @enum {number} + * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value + * @property {number} OPTIONAL=1 OPTIONAL value + * @property {number} REQUIRED=2 REQUIRED value + * @property {number} OUTPUT_ONLY=3 OUTPUT_ONLY value + * @property {number} INPUT_ONLY=4 INPUT_ONLY value + * @property {number} IMMUTABLE=5 IMMUTABLE value + * @property {number} UNORDERED_LIST=6 UNORDERED_LIST value + * @property {number} NON_EMPTY_DEFAULT=7 NON_EMPTY_DEFAULT value + * @property {number} IDENTIFIER=8 IDENTIFIER value + */ + api.FieldBehavior = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_BEHAVIOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "OPTIONAL"] = 1; + values[valuesById[2] = "REQUIRED"] = 2; + values[valuesById[3] = "OUTPUT_ONLY"] = 3; + values[valuesById[4] = "INPUT_ONLY"] = 4; + values[valuesById[5] = "IMMUTABLE"] = 5; + values[valuesById[6] = "UNORDERED_LIST"] = 6; + values[valuesById[7] = "NON_EMPTY_DEFAULT"] = 7; + values[valuesById[8] = "IDENTIFIER"] = 8; + return values; + })(); + + api.ResourceDescriptor = (function() { + + /** + * Properties of a ResourceDescriptor. + * @memberof google.api + * @interface IResourceDescriptor + * @property {string|null} [type] ResourceDescriptor type + * @property {Array.|null} [pattern] ResourceDescriptor pattern + * @property {string|null} [nameField] ResourceDescriptor nameField + * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history + * @property {string|null} [plural] ResourceDescriptor plural + * @property {string|null} [singular] ResourceDescriptor singular + * @property {Array.|null} [style] ResourceDescriptor style + */ + + /** + * Constructs a new ResourceDescriptor. + * @memberof google.api + * @classdesc Represents a ResourceDescriptor. + * @implements IResourceDescriptor + * @constructor + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + */ + function ResourceDescriptor(properties) { + this.pattern = []; + this.style = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceDescriptor type. + * @member {string} type + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.type = ""; + + /** + * ResourceDescriptor pattern. + * @member {Array.} pattern + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.pattern = $util.emptyArray; + + /** + * ResourceDescriptor nameField. + * @member {string} nameField + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.nameField = ""; + + /** + * ResourceDescriptor history. + * @member {google.api.ResourceDescriptor.History} history + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.history = 0; + + /** + * ResourceDescriptor plural. + * @member {string} plural + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.plural = ""; + + /** + * ResourceDescriptor singular. + * @member {string} singular + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.singular = ""; + + /** + * ResourceDescriptor style. + * @member {Array.} style + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.style = $util.emptyArray; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @function create + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance + */ + ResourceDescriptor.create = function create(properties) { + return new ResourceDescriptor(properties); + }; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.pattern != null && message.pattern.length) + for (var i = 0; i < message.pattern.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pattern[i]); + if (message.nameField != null && Object.hasOwnProperty.call(message, "nameField")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); + if (message.history != null && Object.hasOwnProperty.call(message, "history")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); + if (message.plural != null && Object.hasOwnProperty.call(message, "plural")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); + if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); + if (message.style != null && message.style.length) { + writer.uint32(/* id 10, wireType 2 =*/82).fork(); + for (var i = 0; i < message.style.length; ++i) + writer.int32(message.style[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceDescriptor(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + if (!(message.pattern && message.pattern.length)) + message.pattern = []; + message.pattern.push(reader.string()); + break; + } + case 3: { + message.nameField = reader.string(); + break; + } + case 4: { + message.history = reader.int32(); + break; + } + case 5: { + message.plural = reader.string(); + break; + } + case 6: { + message.singular = reader.string(); + break; + } + case 10: { + if (!(message.style && message.style.length)) + message.style = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.style.push(reader.int32()); + } else + message.style.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceDescriptor message. + * @function verify + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceDescriptor.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.pattern != null && message.hasOwnProperty("pattern")) { + if (!Array.isArray(message.pattern)) + return "pattern: array expected"; + for (var i = 0; i < message.pattern.length; ++i) + if (!$util.isString(message.pattern[i])) + return "pattern: string[] expected"; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + if (!$util.isString(message.nameField)) + return "nameField: string expected"; + if (message.history != null && message.hasOwnProperty("history")) + switch (message.history) { + default: + return "history: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.plural != null && message.hasOwnProperty("plural")) + if (!$util.isString(message.plural)) + return "plural: string expected"; + if (message.singular != null && message.hasOwnProperty("singular")) + if (!$util.isString(message.singular)) + return "singular: string expected"; + if (message.style != null && message.hasOwnProperty("style")) { + if (!Array.isArray(message.style)) + return "style: array expected"; + for (var i = 0; i < message.style.length; ++i) + switch (message.style[i]) { + default: + return "style: enum value[] expected"; + case 0: + case 1: + break; + } + } + return null; + }; + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + */ + ResourceDescriptor.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceDescriptor) + return object; + var message = new $root.google.api.ResourceDescriptor(); + if (object.type != null) + message.type = String(object.type); + if (object.pattern) { + if (!Array.isArray(object.pattern)) + throw TypeError(".google.api.ResourceDescriptor.pattern: array expected"); + message.pattern = []; + for (var i = 0; i < object.pattern.length; ++i) + message.pattern[i] = String(object.pattern[i]); + } + if (object.nameField != null) + message.nameField = String(object.nameField); + switch (object.history) { + default: + if (typeof object.history === "number") { + message.history = object.history; + break; + } + break; + case "HISTORY_UNSPECIFIED": + case 0: + message.history = 0; + break; + case "ORIGINALLY_SINGLE_PATTERN": + case 1: + message.history = 1; + break; + case "FUTURE_MULTI_PATTERN": + case 2: + message.history = 2; + break; + } + if (object.plural != null) + message.plural = String(object.plural); + if (object.singular != null) + message.singular = String(object.singular); + if (object.style) { + if (!Array.isArray(object.style)) + throw TypeError(".google.api.ResourceDescriptor.style: array expected"); + message.style = []; + for (var i = 0; i < object.style.length; ++i) + switch (object.style[i]) { + default: + if (typeof object.style[i] === "number") { + message.style[i] = object.style[i]; + break; + } + case "STYLE_UNSPECIFIED": + case 0: + message.style[i] = 0; + break; + case "DECLARATIVE_FRIENDLY": + case 1: + message.style[i] = 1; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.ResourceDescriptor} message ResourceDescriptor + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceDescriptor.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.pattern = []; + object.style = []; + } + if (options.defaults) { + object.type = ""; + object.nameField = ""; + object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; + object.plural = ""; + object.singular = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.pattern && message.pattern.length) { + object.pattern = []; + for (var j = 0; j < message.pattern.length; ++j) + object.pattern[j] = message.pattern[j]; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + object.nameField = message.nameField; + if (message.history != null && message.hasOwnProperty("history")) + object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] === undefined ? message.history : $root.google.api.ResourceDescriptor.History[message.history] : message.history; + if (message.plural != null && message.hasOwnProperty("plural")) + object.plural = message.plural; + if (message.singular != null && message.hasOwnProperty("singular")) + object.singular = message.singular; + if (message.style && message.style.length) { + object.style = []; + for (var j = 0; j < message.style.length; ++j) + object.style[j] = options.enums === String ? $root.google.api.ResourceDescriptor.Style[message.style[j]] === undefined ? message.style[j] : $root.google.api.ResourceDescriptor.Style[message.style[j]] : message.style[j]; + } + return object; + }; + + /** + * Converts this ResourceDescriptor to JSON. + * @function toJSON + * @memberof google.api.ResourceDescriptor + * @instance + * @returns {Object.} JSON object + */ + ResourceDescriptor.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceDescriptor + * @function getTypeUrl + * @memberof google.api.ResourceDescriptor + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceDescriptor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceDescriptor"; + }; + + /** + * History enum. + * @name google.api.ResourceDescriptor.History + * @enum {number} + * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value + * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value + * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value + */ + ResourceDescriptor.History = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HISTORY_UNSPECIFIED"] = 0; + values[valuesById[1] = "ORIGINALLY_SINGLE_PATTERN"] = 1; + values[valuesById[2] = "FUTURE_MULTI_PATTERN"] = 2; + return values; + })(); + + /** + * Style enum. + * @name google.api.ResourceDescriptor.Style + * @enum {number} + * @property {number} STYLE_UNSPECIFIED=0 STYLE_UNSPECIFIED value + * @property {number} DECLARATIVE_FRIENDLY=1 DECLARATIVE_FRIENDLY value + */ + ResourceDescriptor.Style = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STYLE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DECLARATIVE_FRIENDLY"] = 1; + return values; + })(); + + return ResourceDescriptor; + })(); + + api.ResourceReference = (function() { + + /** + * Properties of a ResourceReference. + * @memberof google.api + * @interface IResourceReference + * @property {string|null} [type] ResourceReference type + * @property {string|null} [childType] ResourceReference childType + */ + + /** + * Constructs a new ResourceReference. + * @memberof google.api + * @classdesc Represents a ResourceReference. + * @implements IResourceReference + * @constructor + * @param {google.api.IResourceReference=} [properties] Properties to set + */ + function ResourceReference(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceReference type. + * @member {string} type + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.type = ""; + + /** + * ResourceReference childType. + * @member {string} childType + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.childType = ""; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @function create + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference=} [properties] Properties to set + * @returns {google.api.ResourceReference} ResourceReference instance + */ + ResourceReference.create = function create(properties) { + return new ResourceReference(properties); + }; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.childType != null && Object.hasOwnProperty.call(message, "childType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); + return writer; + }; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceReference(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + message.childType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceReference message. + * @function verify + * @memberof google.api.ResourceReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceReference.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.childType != null && message.hasOwnProperty("childType")) + if (!$util.isString(message.childType)) + return "childType: string expected"; + return null; + }; + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceReference + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceReference} ResourceReference + */ + ResourceReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceReference) + return object; + var message = new $root.google.api.ResourceReference(); + if (object.type != null) + message.type = String(object.type); + if (object.childType != null) + message.childType = String(object.childType); + return message; + }; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceReference + * @static + * @param {google.api.ResourceReference} message ResourceReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceReference.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = ""; + object.childType = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.childType != null && message.hasOwnProperty("childType")) + object.childType = message.childType; + return object; + }; + + /** + * Converts this ResourceReference to JSON. + * @function toJSON + * @memberof google.api.ResourceReference + * @instance + * @returns {Object.} JSON object + */ + ResourceReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceReference + * @function getTypeUrl + * @memberof google.api.ResourceReference + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceReference"; + }; + + return ResourceReference; + })(); + + api.Http = (function() { + + /** + * Properties of a Http. + * @memberof google.api + * @interface IHttp + * @property {Array.|null} [rules] Http rules + * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion + */ + + /** + * Constructs a new Http. + * @memberof google.api + * @classdesc Represents a Http. + * @implements IHttp + * @constructor + * @param {google.api.IHttp=} [properties] Properties to set + */ + function Http(properties) { + this.rules = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Http rules. + * @member {Array.} rules + * @memberof google.api.Http + * @instance + */ + Http.prototype.rules = $util.emptyArray; + + /** + * Http fullyDecodeReservedExpansion. + * @member {boolean} fullyDecodeReservedExpansion + * @memberof google.api.Http + * @instance + */ + Http.prototype.fullyDecodeReservedExpansion = false; + + /** + * Creates a new Http instance using the specified properties. + * @function create + * @memberof google.api.Http + * @static + * @param {google.api.IHttp=} [properties] Properties to set + * @returns {google.api.Http} Http instance + */ + Http.create = function create(properties) { + return new Http(properties); + }; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encode + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rules != null && message.rules.length) + for (var i = 0; i < message.rules.length; ++i) + $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); + return writer; + }; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Http message from the specified reader or buffer. + * @function decode + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + case 2: { + message.fullyDecodeReservedExpansion = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Http message. + * @function verify + * @memberof google.api.Http + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Http.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rules != null && message.hasOwnProperty("rules")) { + if (!Array.isArray(message.rules)) + return "rules: array expected"; + for (var i = 0; i < message.rules.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.rules[i]); + if (error) + return "rules." + error; + } + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + if (typeof message.fullyDecodeReservedExpansion !== "boolean") + return "fullyDecodeReservedExpansion: boolean expected"; + return null; + }; + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Http + * @static + * @param {Object.} object Plain object + * @returns {google.api.Http} Http + */ + Http.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Http) + return object; + var message = new $root.google.api.Http(); + if (object.rules) { + if (!Array.isArray(object.rules)) + throw TypeError(".google.api.Http.rules: array expected"); + message.rules = []; + for (var i = 0; i < object.rules.length; ++i) { + if (typeof object.rules[i] !== "object") + throw TypeError(".google.api.Http.rules: object expected"); + message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); + } + } + if (object.fullyDecodeReservedExpansion != null) + message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); + return message; + }; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Http + * @static + * @param {google.api.Http} message Http + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Http.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rules = []; + if (options.defaults) + object.fullyDecodeReservedExpansion = false; + if (message.rules && message.rules.length) { + object.rules = []; + for (var j = 0; j < message.rules.length; ++j) + object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; + return object; + }; + + /** + * Converts this Http to JSON. + * @function toJSON + * @memberof google.api.Http + * @instance + * @returns {Object.} JSON object + */ + Http.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Http + * @function getTypeUrl + * @memberof google.api.Http + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Http.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Http"; + }; + + return Http; + })(); + + api.HttpRule = (function() { + + /** + * Properties of a HttpRule. + * @memberof google.api + * @interface IHttpRule + * @property {string|null} [selector] HttpRule selector + * @property {string|null} [get] HttpRule get + * @property {string|null} [put] HttpRule put + * @property {string|null} [post] HttpRule post + * @property {string|null} ["delete"] HttpRule delete + * @property {string|null} [patch] HttpRule patch + * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom + * @property {string|null} [body] HttpRule body + * @property {string|null} [responseBody] HttpRule responseBody + * @property {Array.|null} [additionalBindings] HttpRule additionalBindings + */ + + /** + * Constructs a new HttpRule. + * @memberof google.api + * @classdesc Represents a HttpRule. + * @implements IHttpRule + * @constructor + * @param {google.api.IHttpRule=} [properties] Properties to set + */ + function HttpRule(properties) { + this.additionalBindings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HttpRule selector. + * @member {string} selector + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.selector = ""; + + /** + * HttpRule get. + * @member {string|null|undefined} get + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.get = null; + + /** + * HttpRule put. + * @member {string|null|undefined} put + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.put = null; + + /** + * HttpRule post. + * @member {string|null|undefined} post + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.post = null; + + /** + * HttpRule delete. + * @member {string|null|undefined} delete + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype["delete"] = null; + + /** + * HttpRule patch. + * @member {string|null|undefined} patch + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.patch = null; + + /** + * HttpRule custom. + * @member {google.api.ICustomHttpPattern|null|undefined} custom + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.custom = null; + + /** + * HttpRule body. + * @member {string} body + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.body = ""; + + /** + * HttpRule responseBody. + * @member {string} responseBody + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.responseBody = ""; + + /** + * HttpRule additionalBindings. + * @member {Array.} additionalBindings + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.additionalBindings = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HttpRule pattern. + * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern + * @memberof google.api.HttpRule + * @instance + */ + Object.defineProperty(HttpRule.prototype, "pattern", { + get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HttpRule instance using the specified properties. + * @function create + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule=} [properties] Properties to set + * @returns {google.api.HttpRule} HttpRule instance + */ + HttpRule.create = function create(properties) { + return new HttpRule(properties); + }; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encode + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.get != null && Object.hasOwnProperty.call(message, "get")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); + if (message.put != null && Object.hasOwnProperty.call(message, "put")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); + if (message.post != null && Object.hasOwnProperty.call(message, "post")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); + if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); + if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); + if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) + $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.additionalBindings != null && message.additionalBindings.length) + for (var i = 0; i < message.additionalBindings.length; ++i) + $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); + return writer; + }; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @function decode + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.get = reader.string(); + break; + } + case 3: { + message.put = reader.string(); + break; + } + case 4: { + message.post = reader.string(); + break; + } + case 5: { + message["delete"] = reader.string(); + break; + } + case 6: { + message.patch = reader.string(); + break; + } + case 8: { + message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); + break; + } + case 7: { + message.body = reader.string(); + break; + } + case 12: { + message.responseBody = reader.string(); + break; + } + case 11: { + if (!(message.additionalBindings && message.additionalBindings.length)) + message.additionalBindings = []; + message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HttpRule message. + * @function verify + * @memberof google.api.HttpRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HttpRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.get != null && message.hasOwnProperty("get")) { + properties.pattern = 1; + if (!$util.isString(message.get)) + return "get: string expected"; + } + if (message.put != null && message.hasOwnProperty("put")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.put)) + return "put: string expected"; + } + if (message.post != null && message.hasOwnProperty("post")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.post)) + return "post: string expected"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message["delete"])) + return "delete: string expected"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.patch)) + return "patch: string expected"; + } + if (message.custom != null && message.hasOwnProperty("custom")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + { + var error = $root.google.api.CustomHttpPattern.verify(message.custom); + if (error) + return "custom." + error; + } + } + if (message.body != null && message.hasOwnProperty("body")) + if (!$util.isString(message.body)) + return "body: string expected"; + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + if (!$util.isString(message.responseBody)) + return "responseBody: string expected"; + if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) { + if (!Array.isArray(message.additionalBindings)) + return "additionalBindings: array expected"; + for (var i = 0; i < message.additionalBindings.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]); + if (error) + return "additionalBindings." + error; + } + } + return null; + }; + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.HttpRule + * @static + * @param {Object.} object Plain object + * @returns {google.api.HttpRule} HttpRule + */ + HttpRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.HttpRule) + return object; + var message = new $root.google.api.HttpRule(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.get != null) + message.get = String(object.get); + if (object.put != null) + message.put = String(object.put); + if (object.post != null) + message.post = String(object.post); + if (object["delete"] != null) + message["delete"] = String(object["delete"]); + if (object.patch != null) + message.patch = String(object.patch); + if (object.custom != null) { + if (typeof object.custom !== "object") + throw TypeError(".google.api.HttpRule.custom: object expected"); + message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); + } + if (object.body != null) + message.body = String(object.body); + if (object.responseBody != null) + message.responseBody = String(object.responseBody); + if (object.additionalBindings) { + if (!Array.isArray(object.additionalBindings)) + throw TypeError(".google.api.HttpRule.additionalBindings: array expected"); + message.additionalBindings = []; + for (var i = 0; i < object.additionalBindings.length; ++i) { + if (typeof object.additionalBindings[i] !== "object") + throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); + message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.HttpRule + * @static + * @param {google.api.HttpRule} message HttpRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HttpRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.additionalBindings = []; + if (options.defaults) { + object.selector = ""; + object.body = ""; + object.responseBody = ""; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.get != null && message.hasOwnProperty("get")) { + object.get = message.get; + if (options.oneofs) + object.pattern = "get"; + } + if (message.put != null && message.hasOwnProperty("put")) { + object.put = message.put; + if (options.oneofs) + object.pattern = "put"; + } + if (message.post != null && message.hasOwnProperty("post")) { + object.post = message.post; + if (options.oneofs) + object.pattern = "post"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + object["delete"] = message["delete"]; + if (options.oneofs) + object.pattern = "delete"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + object.patch = message.patch; + if (options.oneofs) + object.pattern = "patch"; + } + if (message.body != null && message.hasOwnProperty("body")) + object.body = message.body; + if (message.custom != null && message.hasOwnProperty("custom")) { + object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); + if (options.oneofs) + object.pattern = "custom"; + } + if (message.additionalBindings && message.additionalBindings.length) { + object.additionalBindings = []; + for (var j = 0; j < message.additionalBindings.length; ++j) + object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options); + } + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + object.responseBody = message.responseBody; + return object; + }; + + /** + * Converts this HttpRule to JSON. + * @function toJSON + * @memberof google.api.HttpRule + * @instance + * @returns {Object.} JSON object + */ + HttpRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HttpRule + * @function getTypeUrl + * @memberof google.api.HttpRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HttpRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.HttpRule"; + }; + + return HttpRule; + })(); + + api.CustomHttpPattern = (function() { + + /** + * Properties of a CustomHttpPattern. + * @memberof google.api + * @interface ICustomHttpPattern + * @property {string|null} [kind] CustomHttpPattern kind + * @property {string|null} [path] CustomHttpPattern path + */ + + /** + * Constructs a new CustomHttpPattern. + * @memberof google.api + * @classdesc Represents a CustomHttpPattern. + * @implements ICustomHttpPattern + * @constructor + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + */ + function CustomHttpPattern(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CustomHttpPattern kind. + * @member {string} kind + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.kind = ""; + + /** + * CustomHttpPattern path. + * @member {string} path + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.path = ""; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @function create + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance + */ + CustomHttpPattern.create = function create(properties) { + return new CustomHttpPattern(properties); + }; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encode + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); + return writer; + }; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @function decode + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.kind = reader.string(); + break; + } + case 2: { + message.path = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomHttpPattern message. + * @function verify + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomHttpPattern.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kind != null && message.hasOwnProperty("kind")) + if (!$util.isString(message.kind)) + return "kind: string expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + return null; + }; + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} object Plain object + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + */ + CustomHttpPattern.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CustomHttpPattern) + return object; + var message = new $root.google.api.CustomHttpPattern(); + if (object.kind != null) + message.kind = String(object.kind); + if (object.path != null) + message.path = String(object.path); + return message; + }; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.CustomHttpPattern} message CustomHttpPattern + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomHttpPattern.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.kind = ""; + object.path = ""; + } + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = message.kind; + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; + return object; + }; + + /** + * Converts this CustomHttpPattern to JSON. + * @function toJSON + * @memberof google.api.CustomHttpPattern + * @instance + * @returns {Object.} JSON object + */ + CustomHttpPattern.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomHttpPattern + * @function getTypeUrl + * @memberof google.api.CustomHttpPattern + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomHttpPattern.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CustomHttpPattern"; + }; + + return CustomHttpPattern; + })(); + + api.CommonLanguageSettings = (function() { + + /** + * Properties of a CommonLanguageSettings. + * @memberof google.api + * @interface ICommonLanguageSettings + * @property {string|null} [referenceDocsUri] CommonLanguageSettings referenceDocsUri + * @property {Array.|null} [destinations] CommonLanguageSettings destinations + */ + + /** + * Constructs a new CommonLanguageSettings. + * @memberof google.api + * @classdesc Represents a CommonLanguageSettings. + * @implements ICommonLanguageSettings + * @constructor + * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set + */ + function CommonLanguageSettings(properties) { + this.destinations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CommonLanguageSettings referenceDocsUri. + * @member {string} referenceDocsUri + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.referenceDocsUri = ""; + + /** + * CommonLanguageSettings destinations. + * @member {Array.} destinations + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.destinations = $util.emptyArray; + + /** + * Creates a new CommonLanguageSettings instance using the specified properties. + * @function create + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings instance + */ + CommonLanguageSettings.create = function create(properties) { + return new CommonLanguageSettings(properties); + }; + + /** + * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @function encode + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommonLanguageSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.referenceDocsUri != null && Object.hasOwnProperty.call(message, "referenceDocsUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.referenceDocsUri); + if (message.destinations != null && message.destinations.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.destinations.length; ++i) + writer.int32(message.destinations[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommonLanguageSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.CommonLanguageSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommonLanguageSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CommonLanguageSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.referenceDocsUri = reader.string(); + break; + } + case 2: { + if (!(message.destinations && message.destinations.length)) + message.destinations = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.destinations.push(reader.int32()); + } else + message.destinations.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CommonLanguageSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommonLanguageSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CommonLanguageSettings message. + * @function verify + * @memberof google.api.CommonLanguageSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CommonLanguageSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) + if (!$util.isString(message.referenceDocsUri)) + return "referenceDocsUri: string expected"; + if (message.destinations != null && message.hasOwnProperty("destinations")) { + if (!Array.isArray(message.destinations)) + return "destinations: array expected"; + for (var i = 0; i < message.destinations.length; ++i) + switch (message.destinations[i]) { + default: + return "destinations: enum value[] expected"; + case 0: + case 10: + case 20: + break; + } + } + return null; + }; + + /** + * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CommonLanguageSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + */ + CommonLanguageSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CommonLanguageSettings) + return object; + var message = new $root.google.api.CommonLanguageSettings(); + if (object.referenceDocsUri != null) + message.referenceDocsUri = String(object.referenceDocsUri); + if (object.destinations) { + if (!Array.isArray(object.destinations)) + throw TypeError(".google.api.CommonLanguageSettings.destinations: array expected"); + message.destinations = []; + for (var i = 0; i < object.destinations.length; ++i) + switch (object.destinations[i]) { + default: + if (typeof object.destinations[i] === "number") { + message.destinations[i] = object.destinations[i]; + break; + } + case "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": + case 0: + message.destinations[i] = 0; + break; + case "GITHUB": + case 10: + message.destinations[i] = 10; + break; + case "PACKAGE_MANAGER": + case 20: + message.destinations[i] = 20; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.CommonLanguageSettings} message CommonLanguageSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CommonLanguageSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.destinations = []; + if (options.defaults) + object.referenceDocsUri = ""; + if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) + object.referenceDocsUri = message.referenceDocsUri; + if (message.destinations && message.destinations.length) { + object.destinations = []; + for (var j = 0; j < message.destinations.length; ++j) + object.destinations[j] = options.enums === String ? $root.google.api.ClientLibraryDestination[message.destinations[j]] === undefined ? message.destinations[j] : $root.google.api.ClientLibraryDestination[message.destinations[j]] : message.destinations[j]; + } + return object; + }; + + /** + * Converts this CommonLanguageSettings to JSON. + * @function toJSON + * @memberof google.api.CommonLanguageSettings + * @instance + * @returns {Object.} JSON object + */ + CommonLanguageSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CommonLanguageSettings + * @function getTypeUrl + * @memberof google.api.CommonLanguageSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CommonLanguageSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CommonLanguageSettings"; + }; + + return CommonLanguageSettings; + })(); + + api.ClientLibrarySettings = (function() { + + /** + * Properties of a ClientLibrarySettings. + * @memberof google.api + * @interface IClientLibrarySettings + * @property {string|null} [version] ClientLibrarySettings version + * @property {google.api.LaunchStage|null} [launchStage] ClientLibrarySettings launchStage + * @property {boolean|null} [restNumericEnums] ClientLibrarySettings restNumericEnums + * @property {google.api.IJavaSettings|null} [javaSettings] ClientLibrarySettings javaSettings + * @property {google.api.ICppSettings|null} [cppSettings] ClientLibrarySettings cppSettings + * @property {google.api.IPhpSettings|null} [phpSettings] ClientLibrarySettings phpSettings + * @property {google.api.IPythonSettings|null} [pythonSettings] ClientLibrarySettings pythonSettings + * @property {google.api.INodeSettings|null} [nodeSettings] ClientLibrarySettings nodeSettings + * @property {google.api.IDotnetSettings|null} [dotnetSettings] ClientLibrarySettings dotnetSettings + * @property {google.api.IRubySettings|null} [rubySettings] ClientLibrarySettings rubySettings + * @property {google.api.IGoSettings|null} [goSettings] ClientLibrarySettings goSettings + */ + + /** + * Constructs a new ClientLibrarySettings. + * @memberof google.api + * @classdesc Represents a ClientLibrarySettings. + * @implements IClientLibrarySettings + * @constructor + * @param {google.api.IClientLibrarySettings=} [properties] Properties to set + */ + function ClientLibrarySettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClientLibrarySettings version. + * @member {string} version + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.version = ""; + + /** + * ClientLibrarySettings launchStage. + * @member {google.api.LaunchStage} launchStage + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.launchStage = 0; + + /** + * ClientLibrarySettings restNumericEnums. + * @member {boolean} restNumericEnums + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.restNumericEnums = false; + + /** + * ClientLibrarySettings javaSettings. + * @member {google.api.IJavaSettings|null|undefined} javaSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.javaSettings = null; + + /** + * ClientLibrarySettings cppSettings. + * @member {google.api.ICppSettings|null|undefined} cppSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.cppSettings = null; + + /** + * ClientLibrarySettings phpSettings. + * @member {google.api.IPhpSettings|null|undefined} phpSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.phpSettings = null; + + /** + * ClientLibrarySettings pythonSettings. + * @member {google.api.IPythonSettings|null|undefined} pythonSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.pythonSettings = null; + + /** + * ClientLibrarySettings nodeSettings. + * @member {google.api.INodeSettings|null|undefined} nodeSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.nodeSettings = null; + + /** + * ClientLibrarySettings dotnetSettings. + * @member {google.api.IDotnetSettings|null|undefined} dotnetSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.dotnetSettings = null; + + /** + * ClientLibrarySettings rubySettings. + * @member {google.api.IRubySettings|null|undefined} rubySettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.rubySettings = null; + + /** + * ClientLibrarySettings goSettings. + * @member {google.api.IGoSettings|null|undefined} goSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.goSettings = null; + + /** + * Creates a new ClientLibrarySettings instance using the specified properties. + * @function create + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings=} [properties] Properties to set + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings instance + */ + ClientLibrarySettings.create = function create(properties) { + return new ClientLibrarySettings(properties); + }; + + /** + * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @function encode + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientLibrarySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); + if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.launchStage); + if (message.restNumericEnums != null && Object.hasOwnProperty.call(message, "restNumericEnums")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.restNumericEnums); + if (message.javaSettings != null && Object.hasOwnProperty.call(message, "javaSettings")) + $root.google.api.JavaSettings.encode(message.javaSettings, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.cppSettings != null && Object.hasOwnProperty.call(message, "cppSettings")) + $root.google.api.CppSettings.encode(message.cppSettings, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.phpSettings != null && Object.hasOwnProperty.call(message, "phpSettings")) + $root.google.api.PhpSettings.encode(message.phpSettings, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.pythonSettings != null && Object.hasOwnProperty.call(message, "pythonSettings")) + $root.google.api.PythonSettings.encode(message.pythonSettings, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + if (message.nodeSettings != null && Object.hasOwnProperty.call(message, "nodeSettings")) + $root.google.api.NodeSettings.encode(message.nodeSettings, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); + if (message.dotnetSettings != null && Object.hasOwnProperty.call(message, "dotnetSettings")) + $root.google.api.DotnetSettings.encode(message.dotnetSettings, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + if (message.rubySettings != null && Object.hasOwnProperty.call(message, "rubySettings")) + $root.google.api.RubySettings.encode(message.rubySettings, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); + if (message.goSettings != null && Object.hasOwnProperty.call(message, "goSettings")) + $root.google.api.GoSettings.encode(message.goSettings, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientLibrarySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.ClientLibrarySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientLibrarySettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ClientLibrarySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.version = reader.string(); + break; + } + case 2: { + message.launchStage = reader.int32(); + break; + } + case 3: { + message.restNumericEnums = reader.bool(); + break; + } + case 21: { + message.javaSettings = $root.google.api.JavaSettings.decode(reader, reader.uint32()); + break; + } + case 22: { + message.cppSettings = $root.google.api.CppSettings.decode(reader, reader.uint32()); + break; + } + case 23: { + message.phpSettings = $root.google.api.PhpSettings.decode(reader, reader.uint32()); + break; + } + case 24: { + message.pythonSettings = $root.google.api.PythonSettings.decode(reader, reader.uint32()); + break; + } + case 25: { + message.nodeSettings = $root.google.api.NodeSettings.decode(reader, reader.uint32()); + break; + } + case 26: { + message.dotnetSettings = $root.google.api.DotnetSettings.decode(reader, reader.uint32()); + break; + } + case 27: { + message.rubySettings = $root.google.api.RubySettings.decode(reader, reader.uint32()); + break; + } + case 28: { + message.goSettings = $root.google.api.GoSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ClientLibrarySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientLibrarySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClientLibrarySettings message. + * @function verify + * @memberof google.api.ClientLibrarySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClientLibrarySettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + switch (message.launchStage) { + default: + return "launchStage: enum value expected"; + case 0: + case 6: + case 7: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) + if (typeof message.restNumericEnums !== "boolean") + return "restNumericEnums: boolean expected"; + if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) { + var error = $root.google.api.JavaSettings.verify(message.javaSettings); + if (error) + return "javaSettings." + error; + } + if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) { + var error = $root.google.api.CppSettings.verify(message.cppSettings); + if (error) + return "cppSettings." + error; + } + if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) { + var error = $root.google.api.PhpSettings.verify(message.phpSettings); + if (error) + return "phpSettings." + error; + } + if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) { + var error = $root.google.api.PythonSettings.verify(message.pythonSettings); + if (error) + return "pythonSettings." + error; + } + if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) { + var error = $root.google.api.NodeSettings.verify(message.nodeSettings); + if (error) + return "nodeSettings." + error; + } + if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) { + var error = $root.google.api.DotnetSettings.verify(message.dotnetSettings); + if (error) + return "dotnetSettings." + error; + } + if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) { + var error = $root.google.api.RubySettings.verify(message.rubySettings); + if (error) + return "rubySettings." + error; + } + if (message.goSettings != null && message.hasOwnProperty("goSettings")) { + var error = $root.google.api.GoSettings.verify(message.goSettings); + if (error) + return "goSettings." + error; + } + return null; + }; + + /** + * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ClientLibrarySettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + */ + ClientLibrarySettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ClientLibrarySettings) + return object; + var message = new $root.google.api.ClientLibrarySettings(); + if (object.version != null) + message.version = String(object.version); + switch (object.launchStage) { + default: + if (typeof object.launchStage === "number") { + message.launchStage = object.launchStage; + break; + } + break; + case "LAUNCH_STAGE_UNSPECIFIED": + case 0: + message.launchStage = 0; + break; + case "UNIMPLEMENTED": + case 6: + message.launchStage = 6; + break; + case "PRELAUNCH": + case 7: + message.launchStage = 7; + break; + case "EARLY_ACCESS": + case 1: + message.launchStage = 1; + break; + case "ALPHA": + case 2: + message.launchStage = 2; + break; + case "BETA": + case 3: + message.launchStage = 3; + break; + case "GA": + case 4: + message.launchStage = 4; + break; + case "DEPRECATED": + case 5: + message.launchStage = 5; + break; + } + if (object.restNumericEnums != null) + message.restNumericEnums = Boolean(object.restNumericEnums); + if (object.javaSettings != null) { + if (typeof object.javaSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.javaSettings: object expected"); + message.javaSettings = $root.google.api.JavaSettings.fromObject(object.javaSettings); + } + if (object.cppSettings != null) { + if (typeof object.cppSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.cppSettings: object expected"); + message.cppSettings = $root.google.api.CppSettings.fromObject(object.cppSettings); + } + if (object.phpSettings != null) { + if (typeof object.phpSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.phpSettings: object expected"); + message.phpSettings = $root.google.api.PhpSettings.fromObject(object.phpSettings); + } + if (object.pythonSettings != null) { + if (typeof object.pythonSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.pythonSettings: object expected"); + message.pythonSettings = $root.google.api.PythonSettings.fromObject(object.pythonSettings); + } + if (object.nodeSettings != null) { + if (typeof object.nodeSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.nodeSettings: object expected"); + message.nodeSettings = $root.google.api.NodeSettings.fromObject(object.nodeSettings); + } + if (object.dotnetSettings != null) { + if (typeof object.dotnetSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.dotnetSettings: object expected"); + message.dotnetSettings = $root.google.api.DotnetSettings.fromObject(object.dotnetSettings); + } + if (object.rubySettings != null) { + if (typeof object.rubySettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.rubySettings: object expected"); + message.rubySettings = $root.google.api.RubySettings.fromObject(object.rubySettings); + } + if (object.goSettings != null) { + if (typeof object.goSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.goSettings: object expected"); + message.goSettings = $root.google.api.GoSettings.fromObject(object.goSettings); + } + return message; + }; + + /** + * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.ClientLibrarySettings} message ClientLibrarySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClientLibrarySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.version = ""; + object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; + object.restNumericEnums = false; + object.javaSettings = null; + object.cppSettings = null; + object.phpSettings = null; + object.pythonSettings = null; + object.nodeSettings = null; + object.dotnetSettings = null; + object.rubySettings = null; + object.goSettings = null; + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + object.launchStage = options.enums === String ? $root.google.api.LaunchStage[message.launchStage] === undefined ? message.launchStage : $root.google.api.LaunchStage[message.launchStage] : message.launchStage; + if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) + object.restNumericEnums = message.restNumericEnums; + if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) + object.javaSettings = $root.google.api.JavaSettings.toObject(message.javaSettings, options); + if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) + object.cppSettings = $root.google.api.CppSettings.toObject(message.cppSettings, options); + if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) + object.phpSettings = $root.google.api.PhpSettings.toObject(message.phpSettings, options); + if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) + object.pythonSettings = $root.google.api.PythonSettings.toObject(message.pythonSettings, options); + if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) + object.nodeSettings = $root.google.api.NodeSettings.toObject(message.nodeSettings, options); + if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) + object.dotnetSettings = $root.google.api.DotnetSettings.toObject(message.dotnetSettings, options); + if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) + object.rubySettings = $root.google.api.RubySettings.toObject(message.rubySettings, options); + if (message.goSettings != null && message.hasOwnProperty("goSettings")) + object.goSettings = $root.google.api.GoSettings.toObject(message.goSettings, options); + return object; + }; + + /** + * Converts this ClientLibrarySettings to JSON. + * @function toJSON + * @memberof google.api.ClientLibrarySettings + * @instance + * @returns {Object.} JSON object + */ + ClientLibrarySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClientLibrarySettings + * @function getTypeUrl + * @memberof google.api.ClientLibrarySettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClientLibrarySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ClientLibrarySettings"; + }; + + return ClientLibrarySettings; + })(); + + api.Publishing = (function() { + + /** + * Properties of a Publishing. + * @memberof google.api + * @interface IPublishing + * @property {Array.|null} [methodSettings] Publishing methodSettings + * @property {string|null} [newIssueUri] Publishing newIssueUri + * @property {string|null} [documentationUri] Publishing documentationUri + * @property {string|null} [apiShortName] Publishing apiShortName + * @property {string|null} [githubLabel] Publishing githubLabel + * @property {Array.|null} [codeownerGithubTeams] Publishing codeownerGithubTeams + * @property {string|null} [docTagPrefix] Publishing docTagPrefix + * @property {google.api.ClientLibraryOrganization|null} [organization] Publishing organization + * @property {Array.|null} [librarySettings] Publishing librarySettings + * @property {string|null} [protoReferenceDocumentationUri] Publishing protoReferenceDocumentationUri + * @property {string|null} [restReferenceDocumentationUri] Publishing restReferenceDocumentationUri + */ + + /** + * Constructs a new Publishing. + * @memberof google.api + * @classdesc Represents a Publishing. + * @implements IPublishing + * @constructor + * @param {google.api.IPublishing=} [properties] Properties to set + */ + function Publishing(properties) { + this.methodSettings = []; + this.codeownerGithubTeams = []; + this.librarySettings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Publishing methodSettings. + * @member {Array.} methodSettings + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.methodSettings = $util.emptyArray; + + /** + * Publishing newIssueUri. + * @member {string} newIssueUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.newIssueUri = ""; + + /** + * Publishing documentationUri. + * @member {string} documentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.documentationUri = ""; + + /** + * Publishing apiShortName. + * @member {string} apiShortName + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.apiShortName = ""; + + /** + * Publishing githubLabel. + * @member {string} githubLabel + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.githubLabel = ""; + + /** + * Publishing codeownerGithubTeams. + * @member {Array.} codeownerGithubTeams + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.codeownerGithubTeams = $util.emptyArray; + + /** + * Publishing docTagPrefix. + * @member {string} docTagPrefix + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.docTagPrefix = ""; + + /** + * Publishing organization. + * @member {google.api.ClientLibraryOrganization} organization + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.organization = 0; + + /** + * Publishing librarySettings. + * @member {Array.} librarySettings + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.librarySettings = $util.emptyArray; + + /** + * Publishing protoReferenceDocumentationUri. + * @member {string} protoReferenceDocumentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.protoReferenceDocumentationUri = ""; + + /** + * Publishing restReferenceDocumentationUri. + * @member {string} restReferenceDocumentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.restReferenceDocumentationUri = ""; + + /** + * Creates a new Publishing instance using the specified properties. + * @function create + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing=} [properties] Properties to set + * @returns {google.api.Publishing} Publishing instance + */ + Publishing.create = function create(properties) { + return new Publishing(properties); + }; + + /** + * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @function encode + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing} message Publishing message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Publishing.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.methodSettings != null && message.methodSettings.length) + for (var i = 0; i < message.methodSettings.length; ++i) + $root.google.api.MethodSettings.encode(message.methodSettings[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.newIssueUri != null && Object.hasOwnProperty.call(message, "newIssueUri")) + writer.uint32(/* id 101, wireType 2 =*/810).string(message.newIssueUri); + if (message.documentationUri != null && Object.hasOwnProperty.call(message, "documentationUri")) + writer.uint32(/* id 102, wireType 2 =*/818).string(message.documentationUri); + if (message.apiShortName != null && Object.hasOwnProperty.call(message, "apiShortName")) + writer.uint32(/* id 103, wireType 2 =*/826).string(message.apiShortName); + if (message.githubLabel != null && Object.hasOwnProperty.call(message, "githubLabel")) + writer.uint32(/* id 104, wireType 2 =*/834).string(message.githubLabel); + if (message.codeownerGithubTeams != null && message.codeownerGithubTeams.length) + for (var i = 0; i < message.codeownerGithubTeams.length; ++i) + writer.uint32(/* id 105, wireType 2 =*/842).string(message.codeownerGithubTeams[i]); + if (message.docTagPrefix != null && Object.hasOwnProperty.call(message, "docTagPrefix")) + writer.uint32(/* id 106, wireType 2 =*/850).string(message.docTagPrefix); + if (message.organization != null && Object.hasOwnProperty.call(message, "organization")) + writer.uint32(/* id 107, wireType 0 =*/856).int32(message.organization); + if (message.librarySettings != null && message.librarySettings.length) + for (var i = 0; i < message.librarySettings.length; ++i) + $root.google.api.ClientLibrarySettings.encode(message.librarySettings[i], writer.uint32(/* id 109, wireType 2 =*/874).fork()).ldelim(); + if (message.protoReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "protoReferenceDocumentationUri")) + writer.uint32(/* id 110, wireType 2 =*/882).string(message.protoReferenceDocumentationUri); + if (message.restReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "restReferenceDocumentationUri")) + writer.uint32(/* id 111, wireType 2 =*/890).string(message.restReferenceDocumentationUri); + return writer; + }; + + /** + * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing} message Publishing message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Publishing.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Publishing message from the specified reader or buffer. + * @function decode + * @memberof google.api.Publishing + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Publishing} Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Publishing.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Publishing(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + if (!(message.methodSettings && message.methodSettings.length)) + message.methodSettings = []; + message.methodSettings.push($root.google.api.MethodSettings.decode(reader, reader.uint32())); + break; + } + case 101: { + message.newIssueUri = reader.string(); + break; + } + case 102: { + message.documentationUri = reader.string(); + break; + } + case 103: { + message.apiShortName = reader.string(); + break; + } + case 104: { + message.githubLabel = reader.string(); + break; + } + case 105: { + if (!(message.codeownerGithubTeams && message.codeownerGithubTeams.length)) + message.codeownerGithubTeams = []; + message.codeownerGithubTeams.push(reader.string()); + break; + } + case 106: { + message.docTagPrefix = reader.string(); + break; + } + case 107: { + message.organization = reader.int32(); + break; + } + case 109: { + if (!(message.librarySettings && message.librarySettings.length)) + message.librarySettings = []; + message.librarySettings.push($root.google.api.ClientLibrarySettings.decode(reader, reader.uint32())); + break; + } + case 110: { + message.protoReferenceDocumentationUri = reader.string(); + break; + } + case 111: { + message.restReferenceDocumentationUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Publishing message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Publishing + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Publishing} Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Publishing.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Publishing message. + * @function verify + * @memberof google.api.Publishing + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Publishing.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.methodSettings != null && message.hasOwnProperty("methodSettings")) { + if (!Array.isArray(message.methodSettings)) + return "methodSettings: array expected"; + for (var i = 0; i < message.methodSettings.length; ++i) { + var error = $root.google.api.MethodSettings.verify(message.methodSettings[i]); + if (error) + return "methodSettings." + error; + } + } + if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) + if (!$util.isString(message.newIssueUri)) + return "newIssueUri: string expected"; + if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) + if (!$util.isString(message.documentationUri)) + return "documentationUri: string expected"; + if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) + if (!$util.isString(message.apiShortName)) + return "apiShortName: string expected"; + if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) + if (!$util.isString(message.githubLabel)) + return "githubLabel: string expected"; + if (message.codeownerGithubTeams != null && message.hasOwnProperty("codeownerGithubTeams")) { + if (!Array.isArray(message.codeownerGithubTeams)) + return "codeownerGithubTeams: array expected"; + for (var i = 0; i < message.codeownerGithubTeams.length; ++i) + if (!$util.isString(message.codeownerGithubTeams[i])) + return "codeownerGithubTeams: string[] expected"; + } + if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) + if (!$util.isString(message.docTagPrefix)) + return "docTagPrefix: string expected"; + if (message.organization != null && message.hasOwnProperty("organization")) + switch (message.organization) { + default: + return "organization: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + if (message.librarySettings != null && message.hasOwnProperty("librarySettings")) { + if (!Array.isArray(message.librarySettings)) + return "librarySettings: array expected"; + for (var i = 0; i < message.librarySettings.length; ++i) { + var error = $root.google.api.ClientLibrarySettings.verify(message.librarySettings[i]); + if (error) + return "librarySettings." + error; + } + } + if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) + if (!$util.isString(message.protoReferenceDocumentationUri)) + return "protoReferenceDocumentationUri: string expected"; + if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) + if (!$util.isString(message.restReferenceDocumentationUri)) + return "restReferenceDocumentationUri: string expected"; + return null; + }; + + /** + * Creates a Publishing message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Publishing + * @static + * @param {Object.} object Plain object + * @returns {google.api.Publishing} Publishing + */ + Publishing.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Publishing) + return object; + var message = new $root.google.api.Publishing(); + if (object.methodSettings) { + if (!Array.isArray(object.methodSettings)) + throw TypeError(".google.api.Publishing.methodSettings: array expected"); + message.methodSettings = []; + for (var i = 0; i < object.methodSettings.length; ++i) { + if (typeof object.methodSettings[i] !== "object") + throw TypeError(".google.api.Publishing.methodSettings: object expected"); + message.methodSettings[i] = $root.google.api.MethodSettings.fromObject(object.methodSettings[i]); + } + } + if (object.newIssueUri != null) + message.newIssueUri = String(object.newIssueUri); + if (object.documentationUri != null) + message.documentationUri = String(object.documentationUri); + if (object.apiShortName != null) + message.apiShortName = String(object.apiShortName); + if (object.githubLabel != null) + message.githubLabel = String(object.githubLabel); + if (object.codeownerGithubTeams) { + if (!Array.isArray(object.codeownerGithubTeams)) + throw TypeError(".google.api.Publishing.codeownerGithubTeams: array expected"); + message.codeownerGithubTeams = []; + for (var i = 0; i < object.codeownerGithubTeams.length; ++i) + message.codeownerGithubTeams[i] = String(object.codeownerGithubTeams[i]); + } + if (object.docTagPrefix != null) + message.docTagPrefix = String(object.docTagPrefix); + switch (object.organization) { + default: + if (typeof object.organization === "number") { + message.organization = object.organization; + break; + } + break; + case "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": + case 0: + message.organization = 0; + break; + case "CLOUD": + case 1: + message.organization = 1; + break; + case "ADS": + case 2: + message.organization = 2; + break; + case "PHOTOS": + case 3: + message.organization = 3; + break; + case "STREET_VIEW": + case 4: + message.organization = 4; + break; + case "SHOPPING": + case 5: + message.organization = 5; + break; + case "GEO": + case 6: + message.organization = 6; + break; + case "GENERATIVE_AI": + case 7: + message.organization = 7; + break; + } + if (object.librarySettings) { + if (!Array.isArray(object.librarySettings)) + throw TypeError(".google.api.Publishing.librarySettings: array expected"); + message.librarySettings = []; + for (var i = 0; i < object.librarySettings.length; ++i) { + if (typeof object.librarySettings[i] !== "object") + throw TypeError(".google.api.Publishing.librarySettings: object expected"); + message.librarySettings[i] = $root.google.api.ClientLibrarySettings.fromObject(object.librarySettings[i]); + } + } + if (object.protoReferenceDocumentationUri != null) + message.protoReferenceDocumentationUri = String(object.protoReferenceDocumentationUri); + if (object.restReferenceDocumentationUri != null) + message.restReferenceDocumentationUri = String(object.restReferenceDocumentationUri); + return message; + }; + + /** + * Creates a plain object from a Publishing message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Publishing + * @static + * @param {google.api.Publishing} message Publishing + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Publishing.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.methodSettings = []; + object.codeownerGithubTeams = []; + object.librarySettings = []; + } + if (options.defaults) { + object.newIssueUri = ""; + object.documentationUri = ""; + object.apiShortName = ""; + object.githubLabel = ""; + object.docTagPrefix = ""; + object.organization = options.enums === String ? "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED" : 0; + object.protoReferenceDocumentationUri = ""; + object.restReferenceDocumentationUri = ""; + } + if (message.methodSettings && message.methodSettings.length) { + object.methodSettings = []; + for (var j = 0; j < message.methodSettings.length; ++j) + object.methodSettings[j] = $root.google.api.MethodSettings.toObject(message.methodSettings[j], options); + } + if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) + object.newIssueUri = message.newIssueUri; + if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) + object.documentationUri = message.documentationUri; + if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) + object.apiShortName = message.apiShortName; + if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) + object.githubLabel = message.githubLabel; + if (message.codeownerGithubTeams && message.codeownerGithubTeams.length) { + object.codeownerGithubTeams = []; + for (var j = 0; j < message.codeownerGithubTeams.length; ++j) + object.codeownerGithubTeams[j] = message.codeownerGithubTeams[j]; + } + if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) + object.docTagPrefix = message.docTagPrefix; + if (message.organization != null && message.hasOwnProperty("organization")) + object.organization = options.enums === String ? $root.google.api.ClientLibraryOrganization[message.organization] === undefined ? message.organization : $root.google.api.ClientLibraryOrganization[message.organization] : message.organization; + if (message.librarySettings && message.librarySettings.length) { + object.librarySettings = []; + for (var j = 0; j < message.librarySettings.length; ++j) + object.librarySettings[j] = $root.google.api.ClientLibrarySettings.toObject(message.librarySettings[j], options); + } + if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) + object.protoReferenceDocumentationUri = message.protoReferenceDocumentationUri; + if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) + object.restReferenceDocumentationUri = message.restReferenceDocumentationUri; + return object; + }; + + /** + * Converts this Publishing to JSON. + * @function toJSON + * @memberof google.api.Publishing + * @instance + * @returns {Object.} JSON object + */ + Publishing.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Publishing + * @function getTypeUrl + * @memberof google.api.Publishing + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Publishing.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Publishing"; + }; + + return Publishing; + })(); + + api.JavaSettings = (function() { + + /** + * Properties of a JavaSettings. + * @memberof google.api + * @interface IJavaSettings + * @property {string|null} [libraryPackage] JavaSettings libraryPackage + * @property {Object.|null} [serviceClassNames] JavaSettings serviceClassNames + * @property {google.api.ICommonLanguageSettings|null} [common] JavaSettings common + */ + + /** + * Constructs a new JavaSettings. + * @memberof google.api + * @classdesc Represents a JavaSettings. + * @implements IJavaSettings + * @constructor + * @param {google.api.IJavaSettings=} [properties] Properties to set + */ + function JavaSettings(properties) { + this.serviceClassNames = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * JavaSettings libraryPackage. + * @member {string} libraryPackage + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.libraryPackage = ""; + + /** + * JavaSettings serviceClassNames. + * @member {Object.} serviceClassNames + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.serviceClassNames = $util.emptyObject; + + /** + * JavaSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.common = null; + + /** + * Creates a new JavaSettings instance using the specified properties. + * @function create + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings=} [properties] Properties to set + * @returns {google.api.JavaSettings} JavaSettings instance + */ + JavaSettings.create = function create(properties) { + return new JavaSettings(properties); + }; + + /** + * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @function encode + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JavaSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.libraryPackage != null && Object.hasOwnProperty.call(message, "libraryPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.libraryPackage); + if (message.serviceClassNames != null && Object.hasOwnProperty.call(message, "serviceClassNames")) + for (var keys = Object.keys(message.serviceClassNames), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.serviceClassNames[keys[i]]).ldelim(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JavaSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a JavaSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.JavaSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.JavaSettings} JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JavaSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.JavaSettings(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.libraryPackage = reader.string(); + break; + } + case 2: { + if (message.serviceClassNames === $util.emptyObject) + message.serviceClassNames = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.serviceClassNames[key] = value; + break; + } + case 3: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a JavaSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.JavaSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.JavaSettings} JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JavaSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JavaSettings message. + * @function verify + * @memberof google.api.JavaSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JavaSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) + if (!$util.isString(message.libraryPackage)) + return "libraryPackage: string expected"; + if (message.serviceClassNames != null && message.hasOwnProperty("serviceClassNames")) { + if (!$util.isObject(message.serviceClassNames)) + return "serviceClassNames: object expected"; + var key = Object.keys(message.serviceClassNames); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.serviceClassNames[key[i]])) + return "serviceClassNames: string{k:string} expected"; + } + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.JavaSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.JavaSettings} JavaSettings + */ + JavaSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.JavaSettings) + return object; + var message = new $root.google.api.JavaSettings(); + if (object.libraryPackage != null) + message.libraryPackage = String(object.libraryPackage); + if (object.serviceClassNames) { + if (typeof object.serviceClassNames !== "object") + throw TypeError(".google.api.JavaSettings.serviceClassNames: object expected"); + message.serviceClassNames = {}; + for (var keys = Object.keys(object.serviceClassNames), i = 0; i < keys.length; ++i) + message.serviceClassNames[keys[i]] = String(object.serviceClassNames[keys[i]]); + } + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.JavaSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.JavaSettings + * @static + * @param {google.api.JavaSettings} message JavaSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JavaSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.serviceClassNames = {}; + if (options.defaults) { + object.libraryPackage = ""; + object.common = null; + } + if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) + object.libraryPackage = message.libraryPackage; + var keys2; + if (message.serviceClassNames && (keys2 = Object.keys(message.serviceClassNames)).length) { + object.serviceClassNames = {}; + for (var j = 0; j < keys2.length; ++j) + object.serviceClassNames[keys2[j]] = message.serviceClassNames[keys2[j]]; + } + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this JavaSettings to JSON. + * @function toJSON + * @memberof google.api.JavaSettings + * @instance + * @returns {Object.} JSON object + */ + JavaSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JavaSettings + * @function getTypeUrl + * @memberof google.api.JavaSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JavaSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.JavaSettings"; + }; + + return JavaSettings; + })(); + + api.CppSettings = (function() { + + /** + * Properties of a CppSettings. + * @memberof google.api + * @interface ICppSettings + * @property {google.api.ICommonLanguageSettings|null} [common] CppSettings common + */ + + /** + * Constructs a new CppSettings. + * @memberof google.api + * @classdesc Represents a CppSettings. + * @implements ICppSettings + * @constructor + * @param {google.api.ICppSettings=} [properties] Properties to set + */ + function CppSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CppSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.CppSettings + * @instance + */ + CppSettings.prototype.common = null; + + /** + * Creates a new CppSettings instance using the specified properties. + * @function create + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings=} [properties] Properties to set + * @returns {google.api.CppSettings} CppSettings instance + */ + CppSettings.create = function create(properties) { + return new CppSettings(properties); + }; + + /** + * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @function encode + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings} message CppSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CppSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings} message CppSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CppSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CppSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.CppSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CppSettings} CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CppSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CppSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CppSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CppSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CppSettings} CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CppSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CppSettings message. + * @function verify + * @memberof google.api.CppSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CppSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CppSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.CppSettings} CppSettings + */ + CppSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CppSettings) + return object; + var message = new $root.google.api.CppSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.CppSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a CppSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CppSettings + * @static + * @param {google.api.CppSettings} message CppSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CppSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this CppSettings to JSON. + * @function toJSON + * @memberof google.api.CppSettings + * @instance + * @returns {Object.} JSON object + */ + CppSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CppSettings + * @function getTypeUrl + * @memberof google.api.CppSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CppSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CppSettings"; + }; + + return CppSettings; + })(); + + api.PhpSettings = (function() { + + /** + * Properties of a PhpSettings. + * @memberof google.api + * @interface IPhpSettings + * @property {google.api.ICommonLanguageSettings|null} [common] PhpSettings common + */ + + /** + * Constructs a new PhpSettings. + * @memberof google.api + * @classdesc Represents a PhpSettings. + * @implements IPhpSettings + * @constructor + * @param {google.api.IPhpSettings=} [properties] Properties to set + */ + function PhpSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PhpSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.PhpSettings + * @instance + */ + PhpSettings.prototype.common = null; + + /** + * Creates a new PhpSettings instance using the specified properties. + * @function create + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings=} [properties] Properties to set + * @returns {google.api.PhpSettings} PhpSettings instance + */ + PhpSettings.create = function create(properties) { + return new PhpSettings(properties); + }; + + /** + * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @function encode + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PhpSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PhpSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PhpSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.PhpSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PhpSettings} PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PhpSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PhpSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PhpSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PhpSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PhpSettings} PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PhpSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PhpSettings message. + * @function verify + * @memberof google.api.PhpSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PhpSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PhpSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.PhpSettings} PhpSettings + */ + PhpSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.PhpSettings) + return object; + var message = new $root.google.api.PhpSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.PhpSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PhpSettings + * @static + * @param {google.api.PhpSettings} message PhpSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PhpSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this PhpSettings to JSON. + * @function toJSON + * @memberof google.api.PhpSettings + * @instance + * @returns {Object.} JSON object + */ + PhpSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PhpSettings + * @function getTypeUrl + * @memberof google.api.PhpSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PhpSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PhpSettings"; + }; + + return PhpSettings; + })(); + + api.PythonSettings = (function() { + + /** + * Properties of a PythonSettings. + * @memberof google.api + * @interface IPythonSettings + * @property {google.api.ICommonLanguageSettings|null} [common] PythonSettings common + */ + + /** + * Constructs a new PythonSettings. + * @memberof google.api + * @classdesc Represents a PythonSettings. + * @implements IPythonSettings + * @constructor + * @param {google.api.IPythonSettings=} [properties] Properties to set + */ + function PythonSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PythonSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.PythonSettings + * @instance + */ + PythonSettings.prototype.common = null; + + /** + * Creates a new PythonSettings instance using the specified properties. + * @function create + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings=} [properties] Properties to set + * @returns {google.api.PythonSettings} PythonSettings instance + */ + PythonSettings.create = function create(properties) { + return new PythonSettings(properties); + }; + + /** + * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @function encode + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PythonSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PythonSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PythonSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.PythonSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PythonSettings} PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PythonSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PythonSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PythonSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PythonSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PythonSettings} PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PythonSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PythonSettings message. + * @function verify + * @memberof google.api.PythonSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PythonSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PythonSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.PythonSettings} PythonSettings + */ + PythonSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.PythonSettings) + return object; + var message = new $root.google.api.PythonSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.PythonSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PythonSettings + * @static + * @param {google.api.PythonSettings} message PythonSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PythonSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this PythonSettings to JSON. + * @function toJSON + * @memberof google.api.PythonSettings + * @instance + * @returns {Object.} JSON object + */ + PythonSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PythonSettings + * @function getTypeUrl + * @memberof google.api.PythonSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PythonSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PythonSettings"; + }; + + return PythonSettings; + })(); + + api.NodeSettings = (function() { + + /** + * Properties of a NodeSettings. + * @memberof google.api + * @interface INodeSettings + * @property {google.api.ICommonLanguageSettings|null} [common] NodeSettings common + */ + + /** + * Constructs a new NodeSettings. + * @memberof google.api + * @classdesc Represents a NodeSettings. + * @implements INodeSettings + * @constructor + * @param {google.api.INodeSettings=} [properties] Properties to set + */ + function NodeSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NodeSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.NodeSettings + * @instance + */ + NodeSettings.prototype.common = null; + + /** + * Creates a new NodeSettings instance using the specified properties. + * @function create + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings=} [properties] Properties to set + * @returns {google.api.NodeSettings} NodeSettings instance + */ + NodeSettings.create = function create(properties) { + return new NodeSettings(properties); + }; + + /** + * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @function encode + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NodeSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.NodeSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.NodeSettings} NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.NodeSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NodeSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.NodeSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.NodeSettings} NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NodeSettings message. + * @function verify + * @memberof google.api.NodeSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NodeSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.NodeSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.NodeSettings} NodeSettings + */ + NodeSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.NodeSettings) + return object; + var message = new $root.google.api.NodeSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.NodeSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.NodeSettings + * @static + * @param {google.api.NodeSettings} message NodeSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NodeSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this NodeSettings to JSON. + * @function toJSON + * @memberof google.api.NodeSettings + * @instance + * @returns {Object.} JSON object + */ + NodeSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NodeSettings + * @function getTypeUrl + * @memberof google.api.NodeSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.NodeSettings"; + }; + + return NodeSettings; + })(); + + api.DotnetSettings = (function() { + + /** + * Properties of a DotnetSettings. + * @memberof google.api + * @interface IDotnetSettings + * @property {google.api.ICommonLanguageSettings|null} [common] DotnetSettings common + * @property {Object.|null} [renamedServices] DotnetSettings renamedServices + * @property {Object.|null} [renamedResources] DotnetSettings renamedResources + * @property {Array.|null} [ignoredResources] DotnetSettings ignoredResources + * @property {Array.|null} [forcedNamespaceAliases] DotnetSettings forcedNamespaceAliases + * @property {Array.|null} [handwrittenSignatures] DotnetSettings handwrittenSignatures + */ + + /** + * Constructs a new DotnetSettings. + * @memberof google.api + * @classdesc Represents a DotnetSettings. + * @implements IDotnetSettings + * @constructor + * @param {google.api.IDotnetSettings=} [properties] Properties to set + */ + function DotnetSettings(properties) { + this.renamedServices = {}; + this.renamedResources = {}; + this.ignoredResources = []; + this.forcedNamespaceAliases = []; + this.handwrittenSignatures = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DotnetSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.common = null; + + /** + * DotnetSettings renamedServices. + * @member {Object.} renamedServices + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.renamedServices = $util.emptyObject; + + /** + * DotnetSettings renamedResources. + * @member {Object.} renamedResources + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.renamedResources = $util.emptyObject; + + /** + * DotnetSettings ignoredResources. + * @member {Array.} ignoredResources + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.ignoredResources = $util.emptyArray; + + /** + * DotnetSettings forcedNamespaceAliases. + * @member {Array.} forcedNamespaceAliases + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.forcedNamespaceAliases = $util.emptyArray; + + /** + * DotnetSettings handwrittenSignatures. + * @member {Array.} handwrittenSignatures + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.handwrittenSignatures = $util.emptyArray; + + /** + * Creates a new DotnetSettings instance using the specified properties. + * @function create + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings=} [properties] Properties to set + * @returns {google.api.DotnetSettings} DotnetSettings instance + */ + DotnetSettings.create = function create(properties) { + return new DotnetSettings(properties); + }; + + /** + * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @function encode + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DotnetSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.renamedServices != null && Object.hasOwnProperty.call(message, "renamedServices")) + for (var keys = Object.keys(message.renamedServices), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedServices[keys[i]]).ldelim(); + if (message.renamedResources != null && Object.hasOwnProperty.call(message, "renamedResources")) + for (var keys = Object.keys(message.renamedResources), i = 0; i < keys.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedResources[keys[i]]).ldelim(); + if (message.ignoredResources != null && message.ignoredResources.length) + for (var i = 0; i < message.ignoredResources.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.ignoredResources[i]); + if (message.forcedNamespaceAliases != null && message.forcedNamespaceAliases.length) + for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.forcedNamespaceAliases[i]); + if (message.handwrittenSignatures != null && message.handwrittenSignatures.length) + for (var i = 0; i < message.handwrittenSignatures.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.handwrittenSignatures[i]); + return writer; + }; + + /** + * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DotnetSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.DotnetSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.DotnetSettings} DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DotnetSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.DotnetSettings(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + case 2: { + if (message.renamedServices === $util.emptyObject) + message.renamedServices = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.renamedServices[key] = value; + break; + } + case 3: { + if (message.renamedResources === $util.emptyObject) + message.renamedResources = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.renamedResources[key] = value; + break; + } + case 4: { + if (!(message.ignoredResources && message.ignoredResources.length)) + message.ignoredResources = []; + message.ignoredResources.push(reader.string()); + break; + } + case 5: { + if (!(message.forcedNamespaceAliases && message.forcedNamespaceAliases.length)) + message.forcedNamespaceAliases = []; + message.forcedNamespaceAliases.push(reader.string()); + break; + } + case 6: { + if (!(message.handwrittenSignatures && message.handwrittenSignatures.length)) + message.handwrittenSignatures = []; + message.handwrittenSignatures.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.DotnetSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.DotnetSettings} DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DotnetSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DotnetSettings message. + * @function verify + * @memberof google.api.DotnetSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DotnetSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + if (message.renamedServices != null && message.hasOwnProperty("renamedServices")) { + if (!$util.isObject(message.renamedServices)) + return "renamedServices: object expected"; + var key = Object.keys(message.renamedServices); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.renamedServices[key[i]])) + return "renamedServices: string{k:string} expected"; + } + if (message.renamedResources != null && message.hasOwnProperty("renamedResources")) { + if (!$util.isObject(message.renamedResources)) + return "renamedResources: object expected"; + var key = Object.keys(message.renamedResources); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.renamedResources[key[i]])) + return "renamedResources: string{k:string} expected"; + } + if (message.ignoredResources != null && message.hasOwnProperty("ignoredResources")) { + if (!Array.isArray(message.ignoredResources)) + return "ignoredResources: array expected"; + for (var i = 0; i < message.ignoredResources.length; ++i) + if (!$util.isString(message.ignoredResources[i])) + return "ignoredResources: string[] expected"; + } + if (message.forcedNamespaceAliases != null && message.hasOwnProperty("forcedNamespaceAliases")) { + if (!Array.isArray(message.forcedNamespaceAliases)) + return "forcedNamespaceAliases: array expected"; + for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) + if (!$util.isString(message.forcedNamespaceAliases[i])) + return "forcedNamespaceAliases: string[] expected"; + } + if (message.handwrittenSignatures != null && message.hasOwnProperty("handwrittenSignatures")) { + if (!Array.isArray(message.handwrittenSignatures)) + return "handwrittenSignatures: array expected"; + for (var i = 0; i < message.handwrittenSignatures.length; ++i) + if (!$util.isString(message.handwrittenSignatures[i])) + return "handwrittenSignatures: string[] expected"; + } + return null; + }; + + /** + * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.DotnetSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.DotnetSettings} DotnetSettings + */ + DotnetSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.DotnetSettings) + return object; + var message = new $root.google.api.DotnetSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.DotnetSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + if (object.renamedServices) { + if (typeof object.renamedServices !== "object") + throw TypeError(".google.api.DotnetSettings.renamedServices: object expected"); + message.renamedServices = {}; + for (var keys = Object.keys(object.renamedServices), i = 0; i < keys.length; ++i) + message.renamedServices[keys[i]] = String(object.renamedServices[keys[i]]); + } + if (object.renamedResources) { + if (typeof object.renamedResources !== "object") + throw TypeError(".google.api.DotnetSettings.renamedResources: object expected"); + message.renamedResources = {}; + for (var keys = Object.keys(object.renamedResources), i = 0; i < keys.length; ++i) + message.renamedResources[keys[i]] = String(object.renamedResources[keys[i]]); + } + if (object.ignoredResources) { + if (!Array.isArray(object.ignoredResources)) + throw TypeError(".google.api.DotnetSettings.ignoredResources: array expected"); + message.ignoredResources = []; + for (var i = 0; i < object.ignoredResources.length; ++i) + message.ignoredResources[i] = String(object.ignoredResources[i]); + } + if (object.forcedNamespaceAliases) { + if (!Array.isArray(object.forcedNamespaceAliases)) + throw TypeError(".google.api.DotnetSettings.forcedNamespaceAliases: array expected"); + message.forcedNamespaceAliases = []; + for (var i = 0; i < object.forcedNamespaceAliases.length; ++i) + message.forcedNamespaceAliases[i] = String(object.forcedNamespaceAliases[i]); + } + if (object.handwrittenSignatures) { + if (!Array.isArray(object.handwrittenSignatures)) + throw TypeError(".google.api.DotnetSettings.handwrittenSignatures: array expected"); + message.handwrittenSignatures = []; + for (var i = 0; i < object.handwrittenSignatures.length; ++i) + message.handwrittenSignatures[i] = String(object.handwrittenSignatures[i]); + } + return message; + }; + + /** + * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.DotnetSettings} message DotnetSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DotnetSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.ignoredResources = []; + object.forcedNamespaceAliases = []; + object.handwrittenSignatures = []; + } + if (options.objects || options.defaults) { + object.renamedServices = {}; + object.renamedResources = {}; + } + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + var keys2; + if (message.renamedServices && (keys2 = Object.keys(message.renamedServices)).length) { + object.renamedServices = {}; + for (var j = 0; j < keys2.length; ++j) + object.renamedServices[keys2[j]] = message.renamedServices[keys2[j]]; + } + if (message.renamedResources && (keys2 = Object.keys(message.renamedResources)).length) { + object.renamedResources = {}; + for (var j = 0; j < keys2.length; ++j) + object.renamedResources[keys2[j]] = message.renamedResources[keys2[j]]; + } + if (message.ignoredResources && message.ignoredResources.length) { + object.ignoredResources = []; + for (var j = 0; j < message.ignoredResources.length; ++j) + object.ignoredResources[j] = message.ignoredResources[j]; + } + if (message.forcedNamespaceAliases && message.forcedNamespaceAliases.length) { + object.forcedNamespaceAliases = []; + for (var j = 0; j < message.forcedNamespaceAliases.length; ++j) + object.forcedNamespaceAliases[j] = message.forcedNamespaceAliases[j]; + } + if (message.handwrittenSignatures && message.handwrittenSignatures.length) { + object.handwrittenSignatures = []; + for (var j = 0; j < message.handwrittenSignatures.length; ++j) + object.handwrittenSignatures[j] = message.handwrittenSignatures[j]; + } + return object; + }; + + /** + * Converts this DotnetSettings to JSON. + * @function toJSON + * @memberof google.api.DotnetSettings + * @instance + * @returns {Object.} JSON object + */ + DotnetSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DotnetSettings + * @function getTypeUrl + * @memberof google.api.DotnetSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DotnetSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.DotnetSettings"; + }; + + return DotnetSettings; + })(); + + api.RubySettings = (function() { + + /** + * Properties of a RubySettings. + * @memberof google.api + * @interface IRubySettings + * @property {google.api.ICommonLanguageSettings|null} [common] RubySettings common + */ + + /** + * Constructs a new RubySettings. + * @memberof google.api + * @classdesc Represents a RubySettings. + * @implements IRubySettings + * @constructor + * @param {google.api.IRubySettings=} [properties] Properties to set + */ + function RubySettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RubySettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.RubySettings + * @instance + */ + RubySettings.prototype.common = null; + + /** + * Creates a new RubySettings instance using the specified properties. + * @function create + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings=} [properties] Properties to set + * @returns {google.api.RubySettings} RubySettings instance + */ + RubySettings.create = function create(properties) { + return new RubySettings(properties); + }; + + /** + * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @function encode + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings} message RubySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RubySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings} message RubySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RubySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RubySettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.RubySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.RubySettings} RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RubySettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.RubySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RubySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.RubySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.RubySettings} RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RubySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RubySettings message. + * @function verify + * @memberof google.api.RubySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RubySettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.RubySettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.RubySettings} RubySettings + */ + RubySettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.RubySettings) + return object; + var message = new $root.google.api.RubySettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.RubySettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a RubySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.RubySettings + * @static + * @param {google.api.RubySettings} message RubySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RubySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this RubySettings to JSON. + * @function toJSON + * @memberof google.api.RubySettings + * @instance + * @returns {Object.} JSON object + */ + RubySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RubySettings + * @function getTypeUrl + * @memberof google.api.RubySettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RubySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.RubySettings"; + }; + + return RubySettings; + })(); + + api.GoSettings = (function() { + + /** + * Properties of a GoSettings. + * @memberof google.api + * @interface IGoSettings + * @property {google.api.ICommonLanguageSettings|null} [common] GoSettings common + */ + + /** + * Constructs a new GoSettings. + * @memberof google.api + * @classdesc Represents a GoSettings. + * @implements IGoSettings + * @constructor + * @param {google.api.IGoSettings=} [properties] Properties to set + */ + function GoSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GoSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.GoSettings + * @instance + */ + GoSettings.prototype.common = null; + + /** + * Creates a new GoSettings instance using the specified properties. + * @function create + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings=} [properties] Properties to set + * @returns {google.api.GoSettings} GoSettings instance + */ + GoSettings.create = function create(properties) { + return new GoSettings(properties); + }; + + /** + * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @function encode + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings} message GoSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings} message GoSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GoSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.GoSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.GoSettings} GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.GoSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GoSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.GoSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.GoSettings} GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GoSettings message. + * @function verify + * @memberof google.api.GoSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GoSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.GoSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.GoSettings} GoSettings + */ + GoSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.GoSettings) + return object; + var message = new $root.google.api.GoSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.GoSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a GoSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.GoSettings + * @static + * @param {google.api.GoSettings} message GoSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GoSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this GoSettings to JSON. + * @function toJSON + * @memberof google.api.GoSettings + * @instance + * @returns {Object.} JSON object + */ + GoSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GoSettings + * @function getTypeUrl + * @memberof google.api.GoSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GoSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.GoSettings"; + }; + + return GoSettings; + })(); + + api.MethodSettings = (function() { + + /** + * Properties of a MethodSettings. + * @memberof google.api + * @interface IMethodSettings + * @property {string|null} [selector] MethodSettings selector + * @property {google.api.MethodSettings.ILongRunning|null} [longRunning] MethodSettings longRunning + * @property {Array.|null} [autoPopulatedFields] MethodSettings autoPopulatedFields + */ + + /** + * Constructs a new MethodSettings. + * @memberof google.api + * @classdesc Represents a MethodSettings. + * @implements IMethodSettings + * @constructor + * @param {google.api.IMethodSettings=} [properties] Properties to set + */ + function MethodSettings(properties) { + this.autoPopulatedFields = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodSettings selector. + * @member {string} selector + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.selector = ""; + + /** + * MethodSettings longRunning. + * @member {google.api.MethodSettings.ILongRunning|null|undefined} longRunning + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.longRunning = null; + + /** + * MethodSettings autoPopulatedFields. + * @member {Array.} autoPopulatedFields + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.autoPopulatedFields = $util.emptyArray; + + /** + * Creates a new MethodSettings instance using the specified properties. + * @function create + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings=} [properties] Properties to set + * @returns {google.api.MethodSettings} MethodSettings instance + */ + MethodSettings.create = function create(properties) { + return new MethodSettings(properties); + }; + + /** + * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @function encode + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.longRunning != null && Object.hasOwnProperty.call(message, "longRunning")) + $root.google.api.MethodSettings.LongRunning.encode(message.longRunning, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.autoPopulatedFields != null && message.autoPopulatedFields.length) + for (var i = 0; i < message.autoPopulatedFields.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.autoPopulatedFields[i]); + return writer; + }; + + /** + * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.MethodSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.MethodSettings} MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.longRunning = $root.google.api.MethodSettings.LongRunning.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.autoPopulatedFields && message.autoPopulatedFields.length)) + message.autoPopulatedFields = []; + message.autoPopulatedFields.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.MethodSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.MethodSettings} MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodSettings message. + * @function verify + * @memberof google.api.MethodSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.longRunning != null && message.hasOwnProperty("longRunning")) { + var error = $root.google.api.MethodSettings.LongRunning.verify(message.longRunning); + if (error) + return "longRunning." + error; + } + if (message.autoPopulatedFields != null && message.hasOwnProperty("autoPopulatedFields")) { + if (!Array.isArray(message.autoPopulatedFields)) + return "autoPopulatedFields: array expected"; + for (var i = 0; i < message.autoPopulatedFields.length; ++i) + if (!$util.isString(message.autoPopulatedFields[i])) + return "autoPopulatedFields: string[] expected"; + } + return null; + }; + + /** + * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.MethodSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.MethodSettings} MethodSettings + */ + MethodSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.MethodSettings) + return object; + var message = new $root.google.api.MethodSettings(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.longRunning != null) { + if (typeof object.longRunning !== "object") + throw TypeError(".google.api.MethodSettings.longRunning: object expected"); + message.longRunning = $root.google.api.MethodSettings.LongRunning.fromObject(object.longRunning); + } + if (object.autoPopulatedFields) { + if (!Array.isArray(object.autoPopulatedFields)) + throw TypeError(".google.api.MethodSettings.autoPopulatedFields: array expected"); + message.autoPopulatedFields = []; + for (var i = 0; i < object.autoPopulatedFields.length; ++i) + message.autoPopulatedFields[i] = String(object.autoPopulatedFields[i]); + } + return message; + }; + + /** + * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.MethodSettings + * @static + * @param {google.api.MethodSettings} message MethodSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.autoPopulatedFields = []; + if (options.defaults) { + object.selector = ""; + object.longRunning = null; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.longRunning != null && message.hasOwnProperty("longRunning")) + object.longRunning = $root.google.api.MethodSettings.LongRunning.toObject(message.longRunning, options); + if (message.autoPopulatedFields && message.autoPopulatedFields.length) { + object.autoPopulatedFields = []; + for (var j = 0; j < message.autoPopulatedFields.length; ++j) + object.autoPopulatedFields[j] = message.autoPopulatedFields[j]; + } + return object; + }; + + /** + * Converts this MethodSettings to JSON. + * @function toJSON + * @memberof google.api.MethodSettings + * @instance + * @returns {Object.} JSON object + */ + MethodSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodSettings + * @function getTypeUrl + * @memberof google.api.MethodSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.MethodSettings"; + }; + + MethodSettings.LongRunning = (function() { + + /** + * Properties of a LongRunning. + * @memberof google.api.MethodSettings + * @interface ILongRunning + * @property {google.protobuf.IDuration|null} [initialPollDelay] LongRunning initialPollDelay + * @property {number|null} [pollDelayMultiplier] LongRunning pollDelayMultiplier + * @property {google.protobuf.IDuration|null} [maxPollDelay] LongRunning maxPollDelay + * @property {google.protobuf.IDuration|null} [totalPollTimeout] LongRunning totalPollTimeout + */ + + /** + * Constructs a new LongRunning. + * @memberof google.api.MethodSettings + * @classdesc Represents a LongRunning. + * @implements ILongRunning + * @constructor + * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set + */ + function LongRunning(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LongRunning initialPollDelay. + * @member {google.protobuf.IDuration|null|undefined} initialPollDelay + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.initialPollDelay = null; + + /** + * LongRunning pollDelayMultiplier. + * @member {number} pollDelayMultiplier + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.pollDelayMultiplier = 0; + + /** + * LongRunning maxPollDelay. + * @member {google.protobuf.IDuration|null|undefined} maxPollDelay + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.maxPollDelay = null; + + /** + * LongRunning totalPollTimeout. + * @member {google.protobuf.IDuration|null|undefined} totalPollTimeout + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.totalPollTimeout = null; + + /** + * Creates a new LongRunning instance using the specified properties. + * @function create + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set + * @returns {google.api.MethodSettings.LongRunning} LongRunning instance + */ + LongRunning.create = function create(properties) { + return new LongRunning(properties); + }; + + /** + * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @function encode + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunning.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.initialPollDelay != null && Object.hasOwnProperty.call(message, "initialPollDelay")) + $root.google.protobuf.Duration.encode(message.initialPollDelay, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pollDelayMultiplier != null && Object.hasOwnProperty.call(message, "pollDelayMultiplier")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.pollDelayMultiplier); + if (message.maxPollDelay != null && Object.hasOwnProperty.call(message, "maxPollDelay")) + $root.google.protobuf.Duration.encode(message.maxPollDelay, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.totalPollTimeout != null && Object.hasOwnProperty.call(message, "totalPollTimeout")) + $root.google.protobuf.Duration.encode(message.totalPollTimeout, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunning.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LongRunning message from the specified reader or buffer. + * @function decode + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.MethodSettings.LongRunning} LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunning.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings.LongRunning(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.initialPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 2: { + message.pollDelayMultiplier = reader.float(); + break; + } + case 3: { + message.maxPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 4: { + message.totalPollTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LongRunning message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.MethodSettings.LongRunning} LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunning.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LongRunning message. + * @function verify + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LongRunning.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) { + var error = $root.google.protobuf.Duration.verify(message.initialPollDelay); + if (error) + return "initialPollDelay." + error; + } + if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) + if (typeof message.pollDelayMultiplier !== "number") + return "pollDelayMultiplier: number expected"; + if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) { + var error = $root.google.protobuf.Duration.verify(message.maxPollDelay); + if (error) + return "maxPollDelay." + error; + } + if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) { + var error = $root.google.protobuf.Duration.verify(message.totalPollTimeout); + if (error) + return "totalPollTimeout." + error; + } + return null; + }; + + /** + * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {Object.} object Plain object + * @returns {google.api.MethodSettings.LongRunning} LongRunning + */ + LongRunning.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.MethodSettings.LongRunning) + return object; + var message = new $root.google.api.MethodSettings.LongRunning(); + if (object.initialPollDelay != null) { + if (typeof object.initialPollDelay !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.initialPollDelay: object expected"); + message.initialPollDelay = $root.google.protobuf.Duration.fromObject(object.initialPollDelay); + } + if (object.pollDelayMultiplier != null) + message.pollDelayMultiplier = Number(object.pollDelayMultiplier); + if (object.maxPollDelay != null) { + if (typeof object.maxPollDelay !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.maxPollDelay: object expected"); + message.maxPollDelay = $root.google.protobuf.Duration.fromObject(object.maxPollDelay); + } + if (object.totalPollTimeout != null) { + if (typeof object.totalPollTimeout !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.totalPollTimeout: object expected"); + message.totalPollTimeout = $root.google.protobuf.Duration.fromObject(object.totalPollTimeout); + } + return message; + }; + + /** + * Creates a plain object from a LongRunning message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.LongRunning} message LongRunning + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LongRunning.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.initialPollDelay = null; + object.pollDelayMultiplier = 0; + object.maxPollDelay = null; + object.totalPollTimeout = null; + } + if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) + object.initialPollDelay = $root.google.protobuf.Duration.toObject(message.initialPollDelay, options); + if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) + object.pollDelayMultiplier = options.json && !isFinite(message.pollDelayMultiplier) ? String(message.pollDelayMultiplier) : message.pollDelayMultiplier; + if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) + object.maxPollDelay = $root.google.protobuf.Duration.toObject(message.maxPollDelay, options); + if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) + object.totalPollTimeout = $root.google.protobuf.Duration.toObject(message.totalPollTimeout, options); + return object; + }; + + /** + * Converts this LongRunning to JSON. + * @function toJSON + * @memberof google.api.MethodSettings.LongRunning + * @instance + * @returns {Object.} JSON object + */ + LongRunning.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LongRunning + * @function getTypeUrl + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LongRunning.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.MethodSettings.LongRunning"; + }; + + return LongRunning; + })(); + + return MethodSettings; + })(); + + /** + * ClientLibraryOrganization enum. + * @name google.api.ClientLibraryOrganization + * @enum {number} + * @property {number} CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED=0 CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED value + * @property {number} CLOUD=1 CLOUD value + * @property {number} ADS=2 ADS value + * @property {number} PHOTOS=3 PHOTOS value + * @property {number} STREET_VIEW=4 STREET_VIEW value + * @property {number} SHOPPING=5 SHOPPING value + * @property {number} GEO=6 GEO value + * @property {number} GENERATIVE_AI=7 GENERATIVE_AI value + */ + api.ClientLibraryOrganization = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED"] = 0; + values[valuesById[1] = "CLOUD"] = 1; + values[valuesById[2] = "ADS"] = 2; + values[valuesById[3] = "PHOTOS"] = 3; + values[valuesById[4] = "STREET_VIEW"] = 4; + values[valuesById[5] = "SHOPPING"] = 5; + values[valuesById[6] = "GEO"] = 6; + values[valuesById[7] = "GENERATIVE_AI"] = 7; + return values; + })(); + + /** + * ClientLibraryDestination enum. + * @name google.api.ClientLibraryDestination + * @enum {number} + * @property {number} CLIENT_LIBRARY_DESTINATION_UNSPECIFIED=0 CLIENT_LIBRARY_DESTINATION_UNSPECIFIED value + * @property {number} GITHUB=10 GITHUB value + * @property {number} PACKAGE_MANAGER=20 PACKAGE_MANAGER value + */ + api.ClientLibraryDestination = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED"] = 0; + values[valuesById[10] = "GITHUB"] = 10; + values[valuesById[20] = "PACKAGE_MANAGER"] = 20; + return values; + })(); + + /** + * LaunchStage enum. + * @name google.api.LaunchStage + * @enum {number} + * @property {number} LAUNCH_STAGE_UNSPECIFIED=0 LAUNCH_STAGE_UNSPECIFIED value + * @property {number} UNIMPLEMENTED=6 UNIMPLEMENTED value + * @property {number} PRELAUNCH=7 PRELAUNCH value + * @property {number} EARLY_ACCESS=1 EARLY_ACCESS value + * @property {number} ALPHA=2 ALPHA value + * @property {number} BETA=3 BETA value + * @property {number} GA=4 GA value + * @property {number} DEPRECATED=5 DEPRECATED value + */ + api.LaunchStage = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LAUNCH_STAGE_UNSPECIFIED"] = 0; + values[valuesById[6] = "UNIMPLEMENTED"] = 6; + values[valuesById[7] = "PRELAUNCH"] = 7; + values[valuesById[1] = "EARLY_ACCESS"] = 1; + values[valuesById[2] = "ALPHA"] = 2; + values[valuesById[3] = "BETA"] = 3; + values[valuesById[4] = "GA"] = 4; + values[valuesById[5] = "DEPRECATED"] = 5; + return values; + })(); + + return api; + })(); + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + var protobuf = {}; + + protobuf.FileDescriptorSet = (function() { + + /** + * Properties of a FileDescriptorSet. + * @memberof google.protobuf + * @interface IFileDescriptorSet + * @property {Array.|null} [file] FileDescriptorSet file + */ + + /** + * Constructs a new FileDescriptorSet. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorSet. + * @implements IFileDescriptorSet + * @constructor + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + */ + function FileDescriptorSet(properties) { + this.file = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileDescriptorSet file. + * @member {Array.} file + * @memberof google.protobuf.FileDescriptorSet + * @instance + */ + FileDescriptorSet.prototype.file = $util.emptyArray; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance + */ + FileDescriptorSet.create = function create(properties) { + return new FileDescriptorSet(properties); + }; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.file != null && message.file.length) + for (var i = 0; i < message.file.length; ++i) + $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.file && message.file.length)) + message.file = []; + message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorSet message. + * @function verify + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.file != null && message.hasOwnProperty("file")) { + if (!Array.isArray(message.file)) + return "file: array expected"; + for (var i = 0; i < message.file.length; ++i) { + var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]); + if (error) + return "file." + error; + } + } + return null; + }; + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + */ + FileDescriptorSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorSet) + return object; + var message = new $root.google.protobuf.FileDescriptorSet(); + if (object.file) { + if (!Array.isArray(object.file)) + throw TypeError(".google.protobuf.FileDescriptorSet.file: array expected"); + message.file = []; + for (var i = 0; i < object.file.length; ++i) { + if (typeof object.file[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected"); + message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.file = []; + if (message.file && message.file.length) { + object.file = []; + for (var j = 0; j < message.file.length; ++j) + object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options); + } + return object; + }; + + /** + * Converts this FileDescriptorSet to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorSet + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileDescriptorSet + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorSet"; + }; + + return FileDescriptorSet; + })(); + + /** + * Edition enum. + * @name google.protobuf.Edition + * @enum {number} + * @property {number} EDITION_UNKNOWN=0 EDITION_UNKNOWN value + * @property {number} EDITION_PROTO2=998 EDITION_PROTO2 value + * @property {number} EDITION_PROTO3=999 EDITION_PROTO3 value + * @property {number} EDITION_2023=1000 EDITION_2023 value + * @property {number} EDITION_2024=1001 EDITION_2024 value + * @property {number} EDITION_1_TEST_ONLY=1 EDITION_1_TEST_ONLY value + * @property {number} EDITION_2_TEST_ONLY=2 EDITION_2_TEST_ONLY value + * @property {number} EDITION_99997_TEST_ONLY=99997 EDITION_99997_TEST_ONLY value + * @property {number} EDITION_99998_TEST_ONLY=99998 EDITION_99998_TEST_ONLY value + * @property {number} EDITION_99999_TEST_ONLY=99999 EDITION_99999_TEST_ONLY value + * @property {number} EDITION_MAX=2147483647 EDITION_MAX value + */ + protobuf.Edition = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EDITION_UNKNOWN"] = 0; + values[valuesById[998] = "EDITION_PROTO2"] = 998; + values[valuesById[999] = "EDITION_PROTO3"] = 999; + values[valuesById[1000] = "EDITION_2023"] = 1000; + values[valuesById[1001] = "EDITION_2024"] = 1001; + values[valuesById[1] = "EDITION_1_TEST_ONLY"] = 1; + values[valuesById[2] = "EDITION_2_TEST_ONLY"] = 2; + values[valuesById[99997] = "EDITION_99997_TEST_ONLY"] = 99997; + values[valuesById[99998] = "EDITION_99998_TEST_ONLY"] = 99998; + values[valuesById[99999] = "EDITION_99999_TEST_ONLY"] = 99999; + values[valuesById[2147483647] = "EDITION_MAX"] = 2147483647; + return values; + })(); + + protobuf.FileDescriptorProto = (function() { + + /** + * Properties of a FileDescriptorProto. + * @memberof google.protobuf + * @interface IFileDescriptorProto + * @property {string|null} [name] FileDescriptorProto name + * @property {string|null} ["package"] FileDescriptorProto package + * @property {Array.|null} [dependency] FileDescriptorProto dependency + * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency + * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency + * @property {Array.|null} [messageType] FileDescriptorProto messageType + * @property {Array.|null} [enumType] FileDescriptorProto enumType + * @property {Array.|null} [service] FileDescriptorProto service + * @property {Array.|null} [extension] FileDescriptorProto extension + * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options + * @property {google.protobuf.ISourceCodeInfo|null} [sourceCodeInfo] FileDescriptorProto sourceCodeInfo + * @property {string|null} [syntax] FileDescriptorProto syntax + * @property {google.protobuf.Edition|null} [edition] FileDescriptorProto edition + */ + + /** + * Constructs a new FileDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorProto. + * @implements IFileDescriptorProto + * @constructor + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + */ + function FileDescriptorProto(properties) { + this.dependency = []; + this.publicDependency = []; + this.weakDependency = []; + this.messageType = []; + this.enumType = []; + this.service = []; + this.extension = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.name = ""; + + /** + * FileDescriptorProto package. + * @member {string} package + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype["package"] = ""; + + /** + * FileDescriptorProto dependency. + * @member {Array.} dependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.dependency = $util.emptyArray; + + /** + * FileDescriptorProto publicDependency. + * @member {Array.} publicDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.publicDependency = $util.emptyArray; + + /** + * FileDescriptorProto weakDependency. + * @member {Array.} weakDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.weakDependency = $util.emptyArray; + + /** + * FileDescriptorProto messageType. + * @member {Array.} messageType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.messageType = $util.emptyArray; + + /** + * FileDescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * FileDescriptorProto service. + * @member {Array.} service + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.service = $util.emptyArray; + + /** + * FileDescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.extension = $util.emptyArray; + + /** + * FileDescriptorProto options. + * @member {google.protobuf.IFileOptions|null|undefined} options + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.options = null; + + /** + * FileDescriptorProto sourceCodeInfo. + * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.sourceCodeInfo = null; + + /** + * FileDescriptorProto syntax. + * @member {string} syntax + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.syntax = ""; + + /** + * FileDescriptorProto edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.edition = 0; + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance + */ + FileDescriptorProto.create = function create(properties) { + return new FileDescriptorProto(properties); + }; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); + if (message.dependency != null && message.dependency.length) + for (var i = 0; i < message.dependency.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); + if (message.messageType != null && message.messageType.length) + for (var i = 0; i < message.messageType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.service != null && message.service.length) + for (var i = 0; i < message.service.length; ++i) + $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo")) + $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.publicDependency != null && message.publicDependency.length) + for (var i = 0; i < message.publicDependency.length; ++i) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]); + if (message.weakDependency != null && message.weakDependency.length) + for (var i = 0; i < message.weakDependency.length; ++i) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); + if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 14, wireType 0 =*/112).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message["package"] = reader.string(); + break; + } + case 3: { + if (!(message.dependency && message.dependency.length)) + message.dependency = []; + message.dependency.push(reader.string()); + break; + } + case 10: { + if (!(message.publicDependency && message.publicDependency.length)) + message.publicDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.publicDependency.push(reader.int32()); + } else + message.publicDependency.push(reader.int32()); + break; + } + case 11: { + if (!(message.weakDependency && message.weakDependency.length)) + message.weakDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.weakDependency.push(reader.int32()); + } else + message.weakDependency.push(reader.int32()); + break; + } + case 4: { + if (!(message.messageType && message.messageType.length)) + message.messageType = []; + message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.service && message.service.length)) + message.service = []; + message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 7: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 8: { + message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32()); + break; + } + case 12: { + message.syntax = reader.string(); + break; + } + case 14: { + message.edition = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorProto message. + * @function verify + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message["package"] != null && message.hasOwnProperty("package")) + if (!$util.isString(message["package"])) + return "package: string expected"; + if (message.dependency != null && message.hasOwnProperty("dependency")) { + if (!Array.isArray(message.dependency)) + return "dependency: array expected"; + for (var i = 0; i < message.dependency.length; ++i) + if (!$util.isString(message.dependency[i])) + return "dependency: string[] expected"; + } + if (message.publicDependency != null && message.hasOwnProperty("publicDependency")) { + if (!Array.isArray(message.publicDependency)) + return "publicDependency: array expected"; + for (var i = 0; i < message.publicDependency.length; ++i) + if (!$util.isInteger(message.publicDependency[i])) + return "publicDependency: integer[] expected"; + } + if (message.weakDependency != null && message.hasOwnProperty("weakDependency")) { + if (!Array.isArray(message.weakDependency)) + return "weakDependency: array expected"; + for (var i = 0; i < message.weakDependency.length; ++i) + if (!$util.isInteger(message.weakDependency[i])) + return "weakDependency: integer[] expected"; + } + if (message.messageType != null && message.hasOwnProperty("messageType")) { + if (!Array.isArray(message.messageType)) + return "messageType: array expected"; + for (var i = 0; i < message.messageType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.messageType[i]); + if (error) + return "messageType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.service != null && message.hasOwnProperty("service")) { + if (!Array.isArray(message.service)) + return "service: array expected"; + for (var i = 0; i < message.service.length; ++i) { + var error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i]); + if (error) + return "service." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FileOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) { + var error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo); + if (error) + return "sourceCodeInfo." + error; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + if (!$util.isString(message.syntax)) + return "syntax: string expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + return null; + }; + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + */ + FileDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorProto) + return object; + var message = new $root.google.protobuf.FileDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object["package"] != null) + message["package"] = String(object["package"]); + if (object.dependency) { + if (!Array.isArray(object.dependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.dependency: array expected"); + message.dependency = []; + for (var i = 0; i < object.dependency.length; ++i) + message.dependency[i] = String(object.dependency[i]); + } + if (object.publicDependency) { + if (!Array.isArray(object.publicDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.publicDependency: array expected"); + message.publicDependency = []; + for (var i = 0; i < object.publicDependency.length; ++i) + message.publicDependency[i] = object.publicDependency[i] | 0; + } + if (object.weakDependency) { + if (!Array.isArray(object.weakDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.weakDependency: array expected"); + message.weakDependency = []; + for (var i = 0; i < object.weakDependency.length; ++i) + message.weakDependency[i] = object.weakDependency[i] | 0; + } + if (object.messageType) { + if (!Array.isArray(object.messageType)) + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); + message.messageType = []; + for (var i = 0; i < object.messageType.length; ++i) { + if (typeof object.messageType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: object expected"); + message.messageType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.messageType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.service) { + if (!Array.isArray(object.service)) + throw TypeError(".google.protobuf.FileDescriptorProto.service: array expected"); + message.service = []; + for (var i = 0; i < object.service.length; ++i) { + if (typeof object.service[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.service: object expected"); + message.service[i] = $root.google.protobuf.ServiceDescriptorProto.fromObject(object.service[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.FileDescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FileOptions.fromObject(object.options); + } + if (object.sourceCodeInfo != null) { + if (typeof object.sourceCodeInfo !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.sourceCodeInfo: object expected"); + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.fromObject(object.sourceCodeInfo); + } + if (object.syntax != null) + message.syntax = String(object.syntax); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + return message; + }; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.dependency = []; + object.messageType = []; + object.enumType = []; + object.service = []; + object.extension = []; + object.publicDependency = []; + object.weakDependency = []; + } + if (options.defaults) { + object.name = ""; + object["package"] = ""; + object.options = null; + object.sourceCodeInfo = null; + object.syntax = ""; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message["package"] != null && message.hasOwnProperty("package")) + object["package"] = message["package"]; + if (message.dependency && message.dependency.length) { + object.dependency = []; + for (var j = 0; j < message.dependency.length; ++j) + object.dependency[j] = message.dependency[j]; + } + if (message.messageType && message.messageType.length) { + object.messageType = []; + for (var j = 0; j < message.messageType.length; ++j) + object.messageType[j] = $root.google.protobuf.DescriptorProto.toObject(message.messageType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.service && message.service.length) { + object.service = []; + for (var j = 0; j < message.service.length; ++j) + object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FileOptions.toObject(message.options, options); + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) + object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options); + if (message.publicDependency && message.publicDependency.length) { + object.publicDependency = []; + for (var j = 0; j < message.publicDependency.length; ++j) + object.publicDependency[j] = message.publicDependency[j]; + } + if (message.weakDependency && message.weakDependency.length) { + object.weakDependency = []; + for (var j = 0; j < message.weakDependency.length; ++j) + object.weakDependency[j] = message.weakDependency[j]; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + object.syntax = message.syntax; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this FileDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorProto"; + }; + + return FileDescriptorProto; + })(); + + protobuf.DescriptorProto = (function() { + + /** + * Properties of a DescriptorProto. + * @memberof google.protobuf + * @interface IDescriptorProto + * @property {string|null} [name] DescriptorProto name + * @property {Array.|null} [field] DescriptorProto field + * @property {Array.|null} [extension] DescriptorProto extension + * @property {Array.|null} [nestedType] DescriptorProto nestedType + * @property {Array.|null} [enumType] DescriptorProto enumType + * @property {Array.|null} [extensionRange] DescriptorProto extensionRange + * @property {Array.|null} [oneofDecl] DescriptorProto oneofDecl + * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options + * @property {Array.|null} [reservedRange] DescriptorProto reservedRange + * @property {Array.|null} [reservedName] DescriptorProto reservedName + */ + + /** + * Constructs a new DescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a DescriptorProto. + * @implements IDescriptorProto + * @constructor + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + */ + function DescriptorProto(properties) { + this.field = []; + this.extension = []; + this.nestedType = []; + this.enumType = []; + this.extensionRange = []; + this.oneofDecl = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DescriptorProto name. + * @member {string} name + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.name = ""; + + /** + * DescriptorProto field. + * @member {Array.} field + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.field = $util.emptyArray; + + /** + * DescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extension = $util.emptyArray; + + /** + * DescriptorProto nestedType. + * @member {Array.} nestedType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.nestedType = $util.emptyArray; + + /** + * DescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * DescriptorProto extensionRange. + * @member {Array.} extensionRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extensionRange = $util.emptyArray; + + /** + * DescriptorProto oneofDecl. + * @member {Array.} oneofDecl + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.oneofDecl = $util.emptyArray; + + /** + * DescriptorProto options. + * @member {google.protobuf.IMessageOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.options = null; + + /** + * DescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * DescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto} DescriptorProto instance + */ + DescriptorProto.create = function create(properties) { + return new DescriptorProto(properties); + }; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.field != null && message.field.length) + for (var i = 0; i < message.field.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nestedType != null && message.nestedType.length) + for (var i = 0; i < message.nestedType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.nestedType[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.extensionRange != null && message.extensionRange.length) + for (var i = 0; i < message.extensionRange.length; ++i) + $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extensionRange[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.oneofDecl != null && message.oneofDecl.length) + for (var i = 0; i < message.oneofDecl.length; ++i) + $root.google.protobuf.OneofDescriptorProto.encode(message.oneofDecl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.field && message.field.length)) + message.field = []; + message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.nestedType && message.nestedType.length)) + message.nestedType = []; + message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.extensionRange && message.extensionRange.length)) + message.extensionRange = []; + message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32())); + break; + } + case 8: { + if (!(message.oneofDecl && message.oneofDecl.length)) + message.oneofDecl = []; + message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 7: { + message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32())); + break; + } + case 10: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DescriptorProto message. + * @function verify + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.field != null && message.hasOwnProperty("field")) { + if (!Array.isArray(message.field)) + return "field: array expected"; + for (var i = 0; i < message.field.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.field[i]); + if (error) + return "field." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.nestedType != null && message.hasOwnProperty("nestedType")) { + if (!Array.isArray(message.nestedType)) + return "nestedType: array expected"; + for (var i = 0; i < message.nestedType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.nestedType[i]); + if (error) + return "nestedType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.extensionRange != null && message.hasOwnProperty("extensionRange")) { + if (!Array.isArray(message.extensionRange)) + return "extensionRange: array expected"; + for (var i = 0; i < message.extensionRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ExtensionRange.verify(message.extensionRange[i]); + if (error) + return "extensionRange." + error; + } + } + if (message.oneofDecl != null && message.hasOwnProperty("oneofDecl")) { + if (!Array.isArray(message.oneofDecl)) + return "oneofDecl: array expected"; + for (var i = 0; i < message.oneofDecl.length; ++i) { + var error = $root.google.protobuf.OneofDescriptorProto.verify(message.oneofDecl[i]); + if (error) + return "oneofDecl." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MessageOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto} DescriptorProto + */ + DescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto) + return object; + var message = new $root.google.protobuf.DescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.field) { + if (!Array.isArray(object.field)) + throw TypeError(".google.protobuf.DescriptorProto.field: array expected"); + message.field = []; + for (var i = 0; i < object.field.length; ++i) { + if (typeof object.field[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.field: object expected"); + message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.DescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.nestedType) { + if (!Array.isArray(object.nestedType)) + throw TypeError(".google.protobuf.DescriptorProto.nestedType: array expected"); + message.nestedType = []; + for (var i = 0; i < object.nestedType.length; ++i) { + if (typeof object.nestedType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.nestedType: object expected"); + message.nestedType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nestedType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.DescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.extensionRange) { + if (!Array.isArray(object.extensionRange)) + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: array expected"); + message.extensionRange = []; + for (var i = 0; i < object.extensionRange.length; ++i) { + if (typeof object.extensionRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: object expected"); + message.extensionRange[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extensionRange[i]); + } + } + if (object.oneofDecl) { + if (!Array.isArray(object.oneofDecl)) + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: array expected"); + message.oneofDecl = []; + for (var i = 0; i < object.oneofDecl.length; ++i) { + if (typeof object.oneofDecl[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: object expected"); + message.oneofDecl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneofDecl[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MessageOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.DescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.DescriptorProto} message DescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.field = []; + object.nestedType = []; + object.enumType = []; + object.extensionRange = []; + object.extension = []; + object.oneofDecl = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.field && message.field.length) { + object.field = []; + for (var j = 0; j < message.field.length; ++j) + object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options); + } + if (message.nestedType && message.nestedType.length) { + object.nestedType = []; + for (var j = 0; j < message.nestedType.length; ++j) + object.nestedType[j] = $root.google.protobuf.DescriptorProto.toObject(message.nestedType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.extensionRange && message.extensionRange.length) { + object.extensionRange = []; + for (var j = 0; j < message.extensionRange.length; ++j) + object.extensionRange[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extensionRange[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options); + if (message.oneofDecl && message.oneofDecl.length) { + object.oneofDecl = []; + for (var j = 0; j < message.oneofDecl.length; ++j) + object.oneofDecl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneofDecl[j], options); + } + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this DescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto + * @instance + * @returns {Object.} JSON object + */ + DescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto"; + }; + + DescriptorProto.ExtensionRange = (function() { + + /** + * Properties of an ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @interface IExtensionRange + * @property {number|null} [start] ExtensionRange start + * @property {number|null} [end] ExtensionRange end + * @property {google.protobuf.IExtensionRangeOptions|null} [options] ExtensionRange options + */ + + /** + * Constructs a new ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents an ExtensionRange. + * @implements IExtensionRange + * @constructor + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + */ + function ExtensionRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.start = 0; + + /** + * ExtensionRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.end = 0; + + /** + * ExtensionRange options. + * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.options = null; + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance + */ + ExtensionRange.create = function create(properties) { + return new ExtensionRange(properties); + }; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.ExtensionRangeOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ExtensionRangeOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + */ + ExtensionRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange.options: object expected"); + message.options = $root.google.protobuf.ExtensionRangeOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + object.options = null; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ExtensionRangeOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ExtensionRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + * @returns {Object.} JSON object + */ + ExtensionRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtensionRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ExtensionRange"; + }; + + return ExtensionRange; + })(); + + DescriptorProto.ReservedRange = (function() { + + /** + * Properties of a ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @interface IReservedRange + * @property {number|null} [start] ReservedRange start + * @property {number|null} [end] ReservedRange end + */ + + /** + * Constructs a new ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents a ReservedRange. + * @implements IReservedRange + * @constructor + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + */ + function ReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReservedRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.start = 0; + + /** + * ReservedRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.end = 0; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance + */ + ReservedRange.create = function create(properties) { + return new ReservedRange(properties); + }; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReservedRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + */ + ReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this ReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + * @returns {Object.} JSON object + */ + ReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReservedRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ReservedRange"; + }; + + return ReservedRange; + })(); + + return DescriptorProto; + })(); + + protobuf.ExtensionRangeOptions = (function() { + + /** + * Properties of an ExtensionRangeOptions. + * @memberof google.protobuf + * @interface IExtensionRangeOptions + * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption + * @property {Array.|null} [declaration] ExtensionRangeOptions declaration + * @property {google.protobuf.IFeatureSet|null} [features] ExtensionRangeOptions features + * @property {google.protobuf.ExtensionRangeOptions.VerificationState|null} [verification] ExtensionRangeOptions verification + */ + + /** + * Constructs a new ExtensionRangeOptions. + * @memberof google.protobuf + * @classdesc Represents an ExtensionRangeOptions. + * @implements IExtensionRangeOptions + * @constructor + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + */ + function ExtensionRangeOptions(properties) { + this.uninterpretedOption = []; + this.declaration = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRangeOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * ExtensionRangeOptions declaration. + * @member {Array.} declaration + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.declaration = $util.emptyArray; + + /** + * ExtensionRangeOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.features = null; + + /** + * ExtensionRangeOptions verification. + * @member {google.protobuf.ExtensionRangeOptions.VerificationState} verification + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.verification = 1; + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions instance + */ + ExtensionRangeOptions.create = function create(properties) { + return new ExtensionRangeOptions(properties); + }; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.declaration != null && message.declaration.length) + for (var i = 0; i < message.declaration.length; ++i) + $root.google.protobuf.ExtensionRangeOptions.Declaration.encode(message.declaration[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.verification != null && Object.hasOwnProperty.call(message, "verification")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.verification); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.declaration && message.declaration.length)) + message.declaration = []; + message.declaration.push($root.google.protobuf.ExtensionRangeOptions.Declaration.decode(reader, reader.uint32())); + break; + } + case 50: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 3: { + message.verification = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRangeOptions message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRangeOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message.declaration != null && message.hasOwnProperty("declaration")) { + if (!Array.isArray(message.declaration)) + return "declaration: array expected"; + for (var i = 0; i < message.declaration.length; ++i) { + var error = $root.google.protobuf.ExtensionRangeOptions.Declaration.verify(message.declaration[i]); + if (error) + return "declaration." + error; + } + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.verification != null && message.hasOwnProperty("verification")) + switch (message.verification) { + default: + return "verification: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + */ + ExtensionRangeOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions) + return object; + var message = new $root.google.protobuf.ExtensionRangeOptions(); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object.declaration) { + if (!Array.isArray(object.declaration)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: array expected"); + message.declaration = []; + for (var i = 0; i < object.declaration.length; ++i) { + if (typeof object.declaration[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: object expected"); + message.declaration[i] = $root.google.protobuf.ExtensionRangeOptions.Declaration.fromObject(object.declaration[i]); + } + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + switch (object.verification) { + case "DECLARATION": + case 0: + message.verification = 0; + break; + default: + if (typeof object.verification === "number") { + message.verification = object.verification; + break; + } + break; + case "UNVERIFIED": + case 1: + message.verification = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRangeOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.declaration = []; + object.uninterpretedOption = []; + } + if (options.defaults) { + object.verification = options.enums === String ? "UNVERIFIED" : 1; + object.features = null; + } + if (message.declaration && message.declaration.length) { + object.declaration = []; + for (var j = 0; j < message.declaration.length; ++j) + object.declaration[j] = $root.google.protobuf.ExtensionRangeOptions.Declaration.toObject(message.declaration[j], options); + } + if (message.verification != null && message.hasOwnProperty("verification")) + object.verification = options.enums === String ? $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] === undefined ? message.verification : $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] : message.verification; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + * @returns {Object.} JSON object + */ + ExtensionRangeOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @function getTypeUrl + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRangeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions"; + }; + + ExtensionRangeOptions.Declaration = (function() { + + /** + * Properties of a Declaration. + * @memberof google.protobuf.ExtensionRangeOptions + * @interface IDeclaration + * @property {number|null} [number] Declaration number + * @property {string|null} [fullName] Declaration fullName + * @property {string|null} [type] Declaration type + * @property {boolean|null} [reserved] Declaration reserved + * @property {boolean|null} [repeated] Declaration repeated + */ + + /** + * Constructs a new Declaration. + * @memberof google.protobuf.ExtensionRangeOptions + * @classdesc Represents a Declaration. + * @implements IDeclaration + * @constructor + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set + */ + function Declaration(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Declaration number. + * @member {number} number + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.number = 0; + + /** + * Declaration fullName. + * @member {string} fullName + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.fullName = ""; + + /** + * Declaration type. + * @member {string} type + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.type = ""; + + /** + * Declaration reserved. + * @member {boolean} reserved + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.reserved = false; + + /** + * Declaration repeated. + * @member {boolean} repeated + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.repeated = false; + + /** + * Creates a new Declaration instance using the specified properties. + * @function create + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration instance + */ + Declaration.create = function create(properties) { + return new Declaration(properties); + }; + + /** + * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Declaration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.number); + if (message.fullName != null && Object.hasOwnProperty.call(message, "fullName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.fullName); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.type); + if (message.reserved != null && Object.hasOwnProperty.call(message, "reserved")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.reserved); + if (message.repeated != null && Object.hasOwnProperty.call(message, "repeated")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.repeated); + return writer; + }; + + /** + * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Declaration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Declaration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Declaration.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.number = reader.int32(); + break; + } + case 2: { + message.fullName = reader.string(); + break; + } + case 3: { + message.type = reader.string(); + break; + } + case 5: { + message.reserved = reader.bool(); + break; + } + case 6: { + message.repeated = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Declaration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Declaration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Declaration message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Declaration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.fullName != null && message.hasOwnProperty("fullName")) + if (!$util.isString(message.fullName)) + return "fullName: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.reserved != null && message.hasOwnProperty("reserved")) + if (typeof message.reserved !== "boolean") + return "reserved: boolean expected"; + if (message.repeated != null && message.hasOwnProperty("repeated")) + if (typeof message.repeated !== "boolean") + return "repeated: boolean expected"; + return null; + }; + + /** + * Creates a Declaration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + */ + Declaration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions.Declaration) + return object; + var message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); + if (object.number != null) + message.number = object.number | 0; + if (object.fullName != null) + message.fullName = String(object.fullName); + if (object.type != null) + message.type = String(object.type); + if (object.reserved != null) + message.reserved = Boolean(object.reserved); + if (object.repeated != null) + message.repeated = Boolean(object.repeated); + return message; + }; + + /** + * Creates a plain object from a Declaration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.Declaration} message Declaration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Declaration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.number = 0; + object.fullName = ""; + object.type = ""; + object.reserved = false; + object.repeated = false; + } + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.fullName != null && message.hasOwnProperty("fullName")) + object.fullName = message.fullName; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.reserved != null && message.hasOwnProperty("reserved")) + object.reserved = message.reserved; + if (message.repeated != null && message.hasOwnProperty("repeated")) + object.repeated = message.repeated; + return object; + }; + + /** + * Converts this Declaration to JSON. + * @function toJSON + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + * @returns {Object.} JSON object + */ + Declaration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Declaration + * @function getTypeUrl + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Declaration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions.Declaration"; + }; + + return Declaration; + })(); + + /** + * VerificationState enum. + * @name google.protobuf.ExtensionRangeOptions.VerificationState + * @enum {number} + * @property {number} DECLARATION=0 DECLARATION value + * @property {number} UNVERIFIED=1 UNVERIFIED value + */ + ExtensionRangeOptions.VerificationState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DECLARATION"] = 0; + values[valuesById[1] = "UNVERIFIED"] = 1; + return values; + })(); + + return ExtensionRangeOptions; + })(); + + protobuf.FieldDescriptorProto = (function() { + + /** + * Properties of a FieldDescriptorProto. + * @memberof google.protobuf + * @interface IFieldDescriptorProto + * @property {string|null} [name] FieldDescriptorProto name + * @property {number|null} [number] FieldDescriptorProto number + * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label + * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type + * @property {string|null} [typeName] FieldDescriptorProto typeName + * @property {string|null} [extendee] FieldDescriptorProto extendee + * @property {string|null} [defaultValue] FieldDescriptorProto defaultValue + * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex + * @property {string|null} [jsonName] FieldDescriptorProto jsonName + * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options + * @property {boolean|null} [proto3Optional] FieldDescriptorProto proto3Optional + */ + + /** + * Constructs a new FieldDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FieldDescriptorProto. + * @implements IFieldDescriptorProto + * @constructor + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + */ + function FieldDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.name = ""; + + /** + * FieldDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.number = 0; + + /** + * FieldDescriptorProto label. + * @member {google.protobuf.FieldDescriptorProto.Label} label + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.label = 1; + + /** + * FieldDescriptorProto type. + * @member {google.protobuf.FieldDescriptorProto.Type} type + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.type = 1; + + /** + * FieldDescriptorProto typeName. + * @member {string} typeName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.typeName = ""; + + /** + * FieldDescriptorProto extendee. + * @member {string} extendee + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.extendee = ""; + + /** + * FieldDescriptorProto defaultValue. + * @member {string} defaultValue + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.defaultValue = ""; + + /** + * FieldDescriptorProto oneofIndex. + * @member {number} oneofIndex + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.oneofIndex = 0; + + /** + * FieldDescriptorProto jsonName. + * @member {string} jsonName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.jsonName = ""; + + /** + * FieldDescriptorProto options. + * @member {google.protobuf.IFieldOptions|null|undefined} options + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.options = null; + + /** + * FieldDescriptorProto proto3Optional. + * @member {boolean} proto3Optional + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.proto3Optional = false; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance + */ + FieldDescriptorProto.create = function create(properties) { + return new FieldDescriptorProto(properties); + }; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); + if (message.label != null && Object.hasOwnProperty.call(message, "label")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); + if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); + if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); + if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); + if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.proto3Optional); + return writer; + }; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.number = reader.int32(); + break; + } + case 4: { + message.label = reader.int32(); + break; + } + case 5: { + message.type = reader.int32(); + break; + } + case 6: { + message.typeName = reader.string(); + break; + } + case 2: { + message.extendee = reader.string(); + break; + } + case 7: { + message.defaultValue = reader.string(); + break; + } + case 9: { + message.oneofIndex = reader.int32(); + break; + } + case 10: { + message.jsonName = reader.string(); + break; + } + case 8: { + message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); + break; + } + case 17: { + message.proto3Optional = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldDescriptorProto message. + * @function verify + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.label != null && message.hasOwnProperty("label")) + switch (message.label) { + default: + return "label: enum value expected"; + case 1: + case 3: + case 2: + break; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + break; + } + if (message.typeName != null && message.hasOwnProperty("typeName")) + if (!$util.isString(message.typeName)) + return "typeName: string expected"; + if (message.extendee != null && message.hasOwnProperty("extendee")) + if (!$util.isString(message.extendee)) + return "extendee: string expected"; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + if (!$util.isString(message.defaultValue)) + return "defaultValue: string expected"; + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + if (!$util.isInteger(message.oneofIndex)) + return "oneofIndex: integer expected"; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + if (!$util.isString(message.jsonName)) + return "jsonName: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FieldOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + if (typeof message.proto3Optional !== "boolean") + return "proto3Optional: boolean expected"; + return null; + }; + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + */ + FieldDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldDescriptorProto) + return object; + var message = new $root.google.protobuf.FieldDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + switch (object.label) { + default: + if (typeof object.label === "number") { + message.label = object.label; + break; + } + break; + case "LABEL_OPTIONAL": + case 1: + message.label = 1; + break; + case "LABEL_REPEATED": + case 3: + message.label = 3; + break; + case "LABEL_REQUIRED": + case 2: + message.label = 2; + break; + } + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_DOUBLE": + case 1: + message.type = 1; + break; + case "TYPE_FLOAT": + case 2: + message.type = 2; + break; + case "TYPE_INT64": + case 3: + message.type = 3; + break; + case "TYPE_UINT64": + case 4: + message.type = 4; + break; + case "TYPE_INT32": + case 5: + message.type = 5; + break; + case "TYPE_FIXED64": + case 6: + message.type = 6; + break; + case "TYPE_FIXED32": + case 7: + message.type = 7; + break; + case "TYPE_BOOL": + case 8: + message.type = 8; + break; + case "TYPE_STRING": + case 9: + message.type = 9; + break; + case "TYPE_GROUP": + case 10: + message.type = 10; + break; + case "TYPE_MESSAGE": + case 11: + message.type = 11; + break; + case "TYPE_BYTES": + case 12: + message.type = 12; + break; + case "TYPE_UINT32": + case 13: + message.type = 13; + break; + case "TYPE_ENUM": + case 14: + message.type = 14; + break; + case "TYPE_SFIXED32": + case 15: + message.type = 15; + break; + case "TYPE_SFIXED64": + case 16: + message.type = 16; + break; + case "TYPE_SINT32": + case 17: + message.type = 17; + break; + case "TYPE_SINT64": + case 18: + message.type = 18; + break; + } + if (object.typeName != null) + message.typeName = String(object.typeName); + if (object.extendee != null) + message.extendee = String(object.extendee); + if (object.defaultValue != null) + message.defaultValue = String(object.defaultValue); + if (object.oneofIndex != null) + message.oneofIndex = object.oneofIndex | 0; + if (object.jsonName != null) + message.jsonName = String(object.jsonName); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FieldOptions.fromObject(object.options); + } + if (object.proto3Optional != null) + message.proto3Optional = Boolean(object.proto3Optional); + return message; + }; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.extendee = ""; + object.number = 0; + object.label = options.enums === String ? "LABEL_OPTIONAL" : 1; + object.type = options.enums === String ? "TYPE_DOUBLE" : 1; + object.typeName = ""; + object.defaultValue = ""; + object.options = null; + object.oneofIndex = 0; + object.jsonName = ""; + object.proto3Optional = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.extendee != null && message.hasOwnProperty("extendee")) + object.extendee = message.extendee; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.label != null && message.hasOwnProperty("label")) + object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] === undefined ? message.label : $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] === undefined ? message.type : $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; + if (message.typeName != null && message.hasOwnProperty("typeName")) + object.typeName = message.typeName; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + object.defaultValue = message.defaultValue; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options); + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + object.oneofIndex = message.oneofIndex; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + object.jsonName = message.jsonName; + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + object.proto3Optional = message.proto3Optional; + return object; + }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FieldDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FieldDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldDescriptorProto"; + }; + + /** + * Type enum. + * @name google.protobuf.FieldDescriptorProto.Type + * @enum {number} + * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value + * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value + * @property {number} TYPE_INT64=3 TYPE_INT64 value + * @property {number} TYPE_UINT64=4 TYPE_UINT64 value + * @property {number} TYPE_INT32=5 TYPE_INT32 value + * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value + * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value + * @property {number} TYPE_BOOL=8 TYPE_BOOL value + * @property {number} TYPE_STRING=9 TYPE_STRING value + * @property {number} TYPE_GROUP=10 TYPE_GROUP value + * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value + * @property {number} TYPE_BYTES=12 TYPE_BYTES value + * @property {number} TYPE_UINT32=13 TYPE_UINT32 value + * @property {number} TYPE_ENUM=14 TYPE_ENUM value + * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value + * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value + * @property {number} TYPE_SINT32=17 TYPE_SINT32 value + * @property {number} TYPE_SINT64=18 TYPE_SINT64 value + */ + FieldDescriptorProto.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "TYPE_DOUBLE"] = 1; + values[valuesById[2] = "TYPE_FLOAT"] = 2; + values[valuesById[3] = "TYPE_INT64"] = 3; + values[valuesById[4] = "TYPE_UINT64"] = 4; + values[valuesById[5] = "TYPE_INT32"] = 5; + values[valuesById[6] = "TYPE_FIXED64"] = 6; + values[valuesById[7] = "TYPE_FIXED32"] = 7; + values[valuesById[8] = "TYPE_BOOL"] = 8; + values[valuesById[9] = "TYPE_STRING"] = 9; + values[valuesById[10] = "TYPE_GROUP"] = 10; + values[valuesById[11] = "TYPE_MESSAGE"] = 11; + values[valuesById[12] = "TYPE_BYTES"] = 12; + values[valuesById[13] = "TYPE_UINT32"] = 13; + values[valuesById[14] = "TYPE_ENUM"] = 14; + values[valuesById[15] = "TYPE_SFIXED32"] = 15; + values[valuesById[16] = "TYPE_SFIXED64"] = 16; + values[valuesById[17] = "TYPE_SINT32"] = 17; + values[valuesById[18] = "TYPE_SINT64"] = 18; + return values; + })(); + + /** + * Label enum. + * @name google.protobuf.FieldDescriptorProto.Label + * @enum {number} + * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value + * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value + * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value + */ + FieldDescriptorProto.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "LABEL_OPTIONAL"] = 1; + values[valuesById[3] = "LABEL_REPEATED"] = 3; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; + return values; + })(); + + return FieldDescriptorProto; + })(); + + protobuf.OneofDescriptorProto = (function() { + + /** + * Properties of an OneofDescriptorProto. + * @memberof google.protobuf + * @interface IOneofDescriptorProto + * @property {string|null} [name] OneofDescriptorProto name + * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options + */ + + /** + * Constructs a new OneofDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an OneofDescriptorProto. + * @implements IOneofDescriptorProto + * @constructor + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + */ + function OneofDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.name = ""; + + /** + * OneofDescriptorProto options. + * @member {google.protobuf.IOneofOptions|null|undefined} options + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.options = null; + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance + */ + OneofDescriptorProto.create = function create(properties) { + return new OneofDescriptorProto(properties); + }; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofDescriptorProto message. + * @function verify + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.OneofOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + */ + OneofDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofDescriptorProto) + return object; + var message = new $root.google.protobuf.OneofDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.OneofOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.OneofDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + OneofDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OneofDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofDescriptorProto"; + }; + + return OneofDescriptorProto; + })(); + + protobuf.EnumDescriptorProto = (function() { + + /** + * Properties of an EnumDescriptorProto. + * @memberof google.protobuf + * @interface IEnumDescriptorProto + * @property {string|null} [name] EnumDescriptorProto name + * @property {Array.|null} [value] EnumDescriptorProto value + * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options + * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange + * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName + */ + + /** + * Constructs a new EnumDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumDescriptorProto. + * @implements IEnumDescriptorProto + * @constructor + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + */ + function EnumDescriptorProto(properties) { + this.value = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.name = ""; + + /** + * EnumDescriptorProto value. + * @member {Array.} value + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.value = $util.emptyArray; + + /** + * EnumDescriptorProto options. + * @member {google.protobuf.IEnumOptions|null|undefined} options + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.options = null; + + /** + * EnumDescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * EnumDescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance + */ + EnumDescriptorProto.create = function create(properties) { + return new EnumDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.value != null && message.value.length) + for (var i = 0; i < message.value.length; ++i) + $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.value && message.value.length)) + message.value = []; + message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); + break; + } + case 4: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.value != null && message.hasOwnProperty("value")) { + if (!Array.isArray(message.value)) + return "value: array expected"; + for (var i = 0; i < message.value.length; ++i) { + var error = $root.google.protobuf.EnumValueDescriptorProto.verify(message.value[i]); + if (error) + return "value." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + */ + EnumDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.value) { + if (!Array.isArray(object.value)) + throw TypeError(".google.protobuf.EnumDescriptorProto.value: array expected"); + message.value = []; + for (var i = 0; i < object.value.length; ++i) { + if (typeof object.value[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.value: object expected"); + message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.value = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.value && message.value.length) { + object.value = []; + for (var j = 0; j < message.value.length; ++j) + object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options); + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto"; + }; + + EnumDescriptorProto.EnumReservedRange = (function() { + + /** + * Properties of an EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @interface IEnumReservedRange + * @property {number|null} [start] EnumReservedRange start + * @property {number|null} [end] EnumReservedRange end + */ + + /** + * Constructs a new EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @classdesc Represents an EnumReservedRange. + * @implements IEnumReservedRange + * @constructor + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + */ + function EnumReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumReservedRange start. + * @member {number} start + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.start = 0; + + /** + * EnumReservedRange end. + * @member {number} end + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.end = 0; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance + */ + EnumReservedRange.create = function create(properties) { + return new EnumReservedRange(properties); + }; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumReservedRange message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + */ + EnumReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto.EnumReservedRange) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.EnumReservedRange} message EnumReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this EnumReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + * @returns {Object.} JSON object + */ + EnumReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumReservedRange + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto.EnumReservedRange"; + }; + + return EnumReservedRange; + })(); + + return EnumDescriptorProto; + })(); + + protobuf.EnumValueDescriptorProto = (function() { + + /** + * Properties of an EnumValueDescriptorProto. + * @memberof google.protobuf + * @interface IEnumValueDescriptorProto + * @property {string|null} [name] EnumValueDescriptorProto name + * @property {number|null} [number] EnumValueDescriptorProto number + * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options + */ + + /** + * Constructs a new EnumValueDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumValueDescriptorProto. + * @implements IEnumValueDescriptorProto + * @constructor + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + */ + function EnumValueDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.name = ""; + + /** + * EnumValueDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.number = 0; + + /** + * EnumValueDescriptorProto options. + * @member {google.protobuf.IEnumValueOptions|null|undefined} options + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.options = null; + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance + */ + EnumValueDescriptorProto.create = function create(properties) { + return new EnumValueDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.number = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumValueOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + */ + EnumValueDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumValueDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.number = 0; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumValueDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueDescriptorProto"; + }; + + return EnumValueDescriptorProto; + })(); + + protobuf.ServiceDescriptorProto = (function() { + + /** + * Properties of a ServiceDescriptorProto. + * @memberof google.protobuf + * @interface IServiceDescriptorProto + * @property {string|null} [name] ServiceDescriptorProto name + * @property {Array.|null} [method] ServiceDescriptorProto method + * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options + */ + + /** + * Constructs a new ServiceDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a ServiceDescriptorProto. + * @implements IServiceDescriptorProto + * @constructor + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + */ + function ServiceDescriptorProto(properties) { + this.method = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.name = ""; + + /** + * ServiceDescriptorProto method. + * @member {Array.} method + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.method = $util.emptyArray; + + /** + * ServiceDescriptorProto options. + * @member {google.protobuf.IServiceOptions|null|undefined} options + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.options = null; + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance + */ + ServiceDescriptorProto.create = function create(properties) { + return new ServiceDescriptorProto(properties); + }; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.method != null && message.method.length) + for (var i = 0; i < message.method.length; ++i) + $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.method && message.method.length)) + message.method = []; + message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceDescriptorProto message. + * @function verify + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.method != null && message.hasOwnProperty("method")) { + if (!Array.isArray(message.method)) + return "method: array expected"; + for (var i = 0; i < message.method.length; ++i) { + var error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i]); + if (error) + return "method." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ServiceOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + */ + ServiceDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceDescriptorProto) + return object; + var message = new $root.google.protobuf.ServiceDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.method) { + if (!Array.isArray(object.method)) + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: array expected"); + message.method = []; + for (var i = 0; i < object.method.length; ++i) { + if (typeof object.method[i] !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: object expected"); + message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.method = []; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.method && message.method.length) { + object.method = []; + for (var j = 0; j < message.method.length; ++j) + object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + ServiceDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceDescriptorProto"; + }; + + return ServiceDescriptorProto; + })(); + + protobuf.MethodDescriptorProto = (function() { + + /** + * Properties of a MethodDescriptorProto. + * @memberof google.protobuf + * @interface IMethodDescriptorProto + * @property {string|null} [name] MethodDescriptorProto name + * @property {string|null} [inputType] MethodDescriptorProto inputType + * @property {string|null} [outputType] MethodDescriptorProto outputType + * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options + * @property {boolean|null} [clientStreaming] MethodDescriptorProto clientStreaming + * @property {boolean|null} [serverStreaming] MethodDescriptorProto serverStreaming + */ + + /** + * Constructs a new MethodDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a MethodDescriptorProto. + * @implements IMethodDescriptorProto + * @constructor + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + */ + function MethodDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.name = ""; + + /** + * MethodDescriptorProto inputType. + * @member {string} inputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.inputType = ""; + + /** + * MethodDescriptorProto outputType. + * @member {string} outputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.outputType = ""; + + /** + * MethodDescriptorProto options. + * @member {google.protobuf.IMethodOptions|null|undefined} options + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.options = null; + + /** + * MethodDescriptorProto clientStreaming. + * @member {boolean} clientStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.clientStreaming = false; + + /** + * MethodDescriptorProto serverStreaming. + * @member {boolean} serverStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.serverStreaming = false; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance + */ + MethodDescriptorProto.create = function create(properties) { + return new MethodDescriptorProto(properties); + }; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); + if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); + if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); + return writer; + }; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.inputType = reader.string(); + break; + } + case 3: { + message.outputType = reader.string(); + break; + } + case 4: { + message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); + break; + } + case 5: { + message.clientStreaming = reader.bool(); + break; + } + case 6: { + message.serverStreaming = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodDescriptorProto message. + * @function verify + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.inputType != null && message.hasOwnProperty("inputType")) + if (!$util.isString(message.inputType)) + return "inputType: string expected"; + if (message.outputType != null && message.hasOwnProperty("outputType")) + if (!$util.isString(message.outputType)) + return "outputType: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MethodOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + if (typeof message.clientStreaming !== "boolean") + return "clientStreaming: boolean expected"; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + if (typeof message.serverStreaming !== "boolean") + return "serverStreaming: boolean expected"; + return null; + }; + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + */ + MethodDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodDescriptorProto) + return object; + var message = new $root.google.protobuf.MethodDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.inputType != null) + message.inputType = String(object.inputType); + if (object.outputType != null) + message.outputType = String(object.outputType); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MethodOptions.fromObject(object.options); + } + if (object.clientStreaming != null) + message.clientStreaming = Boolean(object.clientStreaming); + if (object.serverStreaming != null) + message.serverStreaming = Boolean(object.serverStreaming); + return message; + }; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.inputType = ""; + object.outputType = ""; + object.options = null; + object.clientStreaming = false; + object.serverStreaming = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.inputType != null && message.hasOwnProperty("inputType")) + object.inputType = message.inputType; + if (message.outputType != null && message.hasOwnProperty("outputType")) + object.outputType = message.outputType; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options); + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + object.clientStreaming = message.clientStreaming; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + object.serverStreaming = message.serverStreaming; + return object; + }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.MethodDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + MethodDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodDescriptorProto"; + }; + + return MethodDescriptorProto; + })(); + + protobuf.FileOptions = (function() { + + /** + * Properties of a FileOptions. + * @memberof google.protobuf + * @interface IFileOptions + * @property {string|null} [javaPackage] FileOptions javaPackage + * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname + * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles + * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash + * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8 + * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor + * @property {string|null} [goPackage] FileOptions goPackage + * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices + * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices + * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices + * @property {boolean|null} [deprecated] FileOptions deprecated + * @property {boolean|null} [ccEnableArenas] FileOptions ccEnableArenas + * @property {string|null} [objcClassPrefix] FileOptions objcClassPrefix + * @property {string|null} [csharpNamespace] FileOptions csharpNamespace + * @property {string|null} [swiftPrefix] FileOptions swiftPrefix + * @property {string|null} [phpClassPrefix] FileOptions phpClassPrefix + * @property {string|null} [phpNamespace] FileOptions phpNamespace + * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace + * @property {string|null} [rubyPackage] FileOptions rubyPackage + * @property {google.protobuf.IFeatureSet|null} [features] FileOptions features + * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption + * @property {Array.|null} [".google.api.resourceDefinition"] FileOptions .google.api.resourceDefinition + */ + + /** + * Constructs a new FileOptions. + * @memberof google.protobuf + * @classdesc Represents a FileOptions. + * @implements IFileOptions + * @constructor + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + */ + function FileOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.resourceDefinition"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileOptions javaPackage. + * @member {string} javaPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaPackage = ""; + + /** + * FileOptions javaOuterClassname. + * @member {string} javaOuterClassname + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaOuterClassname = ""; + + /** + * FileOptions javaMultipleFiles. + * @member {boolean} javaMultipleFiles + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaMultipleFiles = false; + + /** + * FileOptions javaGenerateEqualsAndHash. + * @member {boolean} javaGenerateEqualsAndHash + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenerateEqualsAndHash = false; + + /** + * FileOptions javaStringCheckUtf8. + * @member {boolean} javaStringCheckUtf8 + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaStringCheckUtf8 = false; + + /** + * FileOptions optimizeFor. + * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.optimizeFor = 1; + + /** + * FileOptions goPackage. + * @member {string} goPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.goPackage = ""; + + /** + * FileOptions ccGenericServices. + * @member {boolean} ccGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccGenericServices = false; + + /** + * FileOptions javaGenericServices. + * @member {boolean} javaGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenericServices = false; + + /** + * FileOptions pyGenericServices. + * @member {boolean} pyGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.pyGenericServices = false; + + /** + * FileOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.deprecated = false; + + /** + * FileOptions ccEnableArenas. + * @member {boolean} ccEnableArenas + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccEnableArenas = true; + + /** + * FileOptions objcClassPrefix. + * @member {string} objcClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.objcClassPrefix = ""; + + /** + * FileOptions csharpNamespace. + * @member {string} csharpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.csharpNamespace = ""; + + /** + * FileOptions swiftPrefix. + * @member {string} swiftPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.swiftPrefix = ""; + + /** + * FileOptions phpClassPrefix. + * @member {string} phpClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpClassPrefix = ""; + + /** + * FileOptions phpNamespace. + * @member {string} phpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpNamespace = ""; + + /** + * FileOptions phpMetadataNamespace. + * @member {string} phpMetadataNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpMetadataNamespace = ""; + + /** + * FileOptions rubyPackage. + * @member {string} rubyPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.rubyPackage = ""; + + /** + * FileOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.features = null; + + /** + * FileOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FileOptions .google.api.resourceDefinition. + * @member {Array.} .google.api.resourceDefinition + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray; + + /** + * Creates a new FileOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + * @returns {google.protobuf.FileOptions} FileOptions instance + */ + FileOptions.create = function create(properties) { + return new FileOptions(properties); + }; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); + if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); + if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); + if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); + if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); + if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); + if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); + if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) + writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); + if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) + writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); + if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) + writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); + if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) + writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); + if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) + writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); + if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) + writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); + if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) + writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); + if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) + writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); + if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) + writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); + if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) + writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); + if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) + writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resourceDefinition"] != null && message[".google.api.resourceDefinition"].length) + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resourceDefinition"][i], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.javaPackage = reader.string(); + break; + } + case 8: { + message.javaOuterClassname = reader.string(); + break; + } + case 10: { + message.javaMultipleFiles = reader.bool(); + break; + } + case 20: { + message.javaGenerateEqualsAndHash = reader.bool(); + break; + } + case 27: { + message.javaStringCheckUtf8 = reader.bool(); + break; + } + case 9: { + message.optimizeFor = reader.int32(); + break; + } + case 11: { + message.goPackage = reader.string(); + break; + } + case 16: { + message.ccGenericServices = reader.bool(); + break; + } + case 17: { + message.javaGenericServices = reader.bool(); + break; + } + case 18: { + message.pyGenericServices = reader.bool(); + break; + } + case 23: { + message.deprecated = reader.bool(); + break; + } + case 31: { + message.ccEnableArenas = reader.bool(); + break; + } + case 36: { + message.objcClassPrefix = reader.string(); + break; + } + case 37: { + message.csharpNamespace = reader.string(); + break; + } + case 39: { + message.swiftPrefix = reader.string(); + break; + } + case 40: { + message.phpClassPrefix = reader.string(); + break; + } + case 41: { + message.phpNamespace = reader.string(); + break; + } + case 44: { + message.phpMetadataNamespace = reader.string(); + break; + } + case 45: { + message.rubyPackage = reader.string(); + break; + } + case 50: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1053: { + if (!(message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length)) + message[".google.api.resourceDefinition"] = []; + message[".google.api.resourceDefinition"].push($root.google.api.ResourceDescriptor.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileOptions message. + * @function verify + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + if (!$util.isString(message.javaPackage)) + return "javaPackage: string expected"; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + if (!$util.isString(message.javaOuterClassname)) + return "javaOuterClassname: string expected"; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + if (typeof message.javaMultipleFiles !== "boolean") + return "javaMultipleFiles: boolean expected"; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + if (typeof message.javaGenerateEqualsAndHash !== "boolean") + return "javaGenerateEqualsAndHash: boolean expected"; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + if (typeof message.javaStringCheckUtf8 !== "boolean") + return "javaStringCheckUtf8: boolean expected"; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + switch (message.optimizeFor) { + default: + return "optimizeFor: enum value expected"; + case 1: + case 2: + case 3: + break; + } + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + if (!$util.isString(message.goPackage)) + return "goPackage: string expected"; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + if (typeof message.ccGenericServices !== "boolean") + return "ccGenericServices: boolean expected"; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + if (typeof message.javaGenericServices !== "boolean") + return "javaGenericServices: boolean expected"; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + if (typeof message.pyGenericServices !== "boolean") + return "pyGenericServices: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + if (typeof message.ccEnableArenas !== "boolean") + return "ccEnableArenas: boolean expected"; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + if (!$util.isString(message.objcClassPrefix)) + return "objcClassPrefix: string expected"; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + if (!$util.isString(message.csharpNamespace)) + return "csharpNamespace: string expected"; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + if (!$util.isString(message.swiftPrefix)) + return "swiftPrefix: string expected"; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + if (!$util.isString(message.phpClassPrefix)) + return "phpClassPrefix: string expected"; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + if (!$util.isString(message.phpNamespace)) + return "phpNamespace: string expected"; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + if (!$util.isString(message.phpMetadataNamespace)) + return "phpMetadataNamespace: string expected"; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + if (!$util.isString(message.rubyPackage)) + return "rubyPackage: string expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resourceDefinition"] != null && message.hasOwnProperty(".google.api.resourceDefinition")) { + if (!Array.isArray(message[".google.api.resourceDefinition"])) + return ".google.api.resourceDefinition: array expected"; + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resourceDefinition"][i]); + if (error) + return ".google.api.resourceDefinition." + error; + } + } + return null; + }; + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileOptions} FileOptions + */ + FileOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileOptions) + return object; + var message = new $root.google.protobuf.FileOptions(); + if (object.javaPackage != null) + message.javaPackage = String(object.javaPackage); + if (object.javaOuterClassname != null) + message.javaOuterClassname = String(object.javaOuterClassname); + if (object.javaMultipleFiles != null) + message.javaMultipleFiles = Boolean(object.javaMultipleFiles); + if (object.javaGenerateEqualsAndHash != null) + message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash); + if (object.javaStringCheckUtf8 != null) + message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); + switch (object.optimizeFor) { + default: + if (typeof object.optimizeFor === "number") { + message.optimizeFor = object.optimizeFor; + break; + } + break; + case "SPEED": + case 1: + message.optimizeFor = 1; + break; + case "CODE_SIZE": + case 2: + message.optimizeFor = 2; + break; + case "LITE_RUNTIME": + case 3: + message.optimizeFor = 3; + break; + } + if (object.goPackage != null) + message.goPackage = String(object.goPackage); + if (object.ccGenericServices != null) + message.ccGenericServices = Boolean(object.ccGenericServices); + if (object.javaGenericServices != null) + message.javaGenericServices = Boolean(object.javaGenericServices); + if (object.pyGenericServices != null) + message.pyGenericServices = Boolean(object.pyGenericServices); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.ccEnableArenas != null) + message.ccEnableArenas = Boolean(object.ccEnableArenas); + if (object.objcClassPrefix != null) + message.objcClassPrefix = String(object.objcClassPrefix); + if (object.csharpNamespace != null) + message.csharpNamespace = String(object.csharpNamespace); + if (object.swiftPrefix != null) + message.swiftPrefix = String(object.swiftPrefix); + if (object.phpClassPrefix != null) + message.phpClassPrefix = String(object.phpClassPrefix); + if (object.phpNamespace != null) + message.phpNamespace = String(object.phpNamespace); + if (object.phpMetadataNamespace != null) + message.phpMetadataNamespace = String(object.phpMetadataNamespace); + if (object.rubyPackage != null) + message.rubyPackage = String(object.rubyPackage); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FileOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resourceDefinition"]) { + if (!Array.isArray(object[".google.api.resourceDefinition"])) + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: array expected"); + message[".google.api.resourceDefinition"] = []; + for (var i = 0; i < object[".google.api.resourceDefinition"].length; ++i) { + if (typeof object[".google.api.resourceDefinition"][i] !== "object") + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: object expected"); + message[".google.api.resourceDefinition"][i] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resourceDefinition"][i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.FileOptions} message FileOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.resourceDefinition"] = []; + } + if (options.defaults) { + object.javaPackage = ""; + object.javaOuterClassname = ""; + object.optimizeFor = options.enums === String ? "SPEED" : 1; + object.javaMultipleFiles = false; + object.goPackage = ""; + object.ccGenericServices = false; + object.javaGenericServices = false; + object.pyGenericServices = false; + object.javaGenerateEqualsAndHash = false; + object.deprecated = false; + object.javaStringCheckUtf8 = false; + object.ccEnableArenas = true; + object.objcClassPrefix = ""; + object.csharpNamespace = ""; + object.swiftPrefix = ""; + object.phpClassPrefix = ""; + object.phpNamespace = ""; + object.phpMetadataNamespace = ""; + object.rubyPackage = ""; + object.features = null; + } + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + object.javaPackage = message.javaPackage; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + object.javaOuterClassname = message.javaOuterClassname; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] === undefined ? message.optimizeFor : $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + object.javaMultipleFiles = message.javaMultipleFiles; + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + object.goPackage = message.goPackage; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + object.ccGenericServices = message.ccGenericServices; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + object.javaGenericServices = message.javaGenericServices; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + object.pyGenericServices = message.pyGenericServices; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + object.javaStringCheckUtf8 = message.javaStringCheckUtf8; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + object.ccEnableArenas = message.ccEnableArenas; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + object.objcClassPrefix = message.objcClassPrefix; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + object.csharpNamespace = message.csharpNamespace; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + object.swiftPrefix = message.swiftPrefix; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + object.phpClassPrefix = message.phpClassPrefix; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + object.phpNamespace = message.phpNamespace; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + object.phpMetadataNamespace = message.phpMetadataNamespace; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + object.rubyPackage = message.rubyPackage; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length) { + object[".google.api.resourceDefinition"] = []; + for (var j = 0; j < message[".google.api.resourceDefinition"].length; ++j) + object[".google.api.resourceDefinition"][j] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resourceDefinition"][j], options); + } + return object; + }; + + /** + * Converts this FileOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FileOptions + * @instance + * @returns {Object.} JSON object + */ + FileOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileOptions + * @function getTypeUrl + * @memberof google.protobuf.FileOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileOptions"; + }; + + /** + * OptimizeMode enum. + * @name google.protobuf.FileOptions.OptimizeMode + * @enum {number} + * @property {number} SPEED=1 SPEED value + * @property {number} CODE_SIZE=2 CODE_SIZE value + * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value + */ + FileOptions.OptimizeMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "SPEED"] = 1; + values[valuesById[2] = "CODE_SIZE"] = 2; + values[valuesById[3] = "LITE_RUNTIME"] = 3; + return values; + })(); + + return FileOptions; + })(); + + protobuf.MessageOptions = (function() { + + /** + * Properties of a MessageOptions. + * @memberof google.protobuf + * @interface IMessageOptions + * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat + * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor + * @property {boolean|null} [deprecated] MessageOptions deprecated + * @property {boolean|null} [mapEntry] MessageOptions mapEntry + * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] MessageOptions deprecatedLegacyJsonFieldConflicts + * @property {google.protobuf.IFeatureSet|null} [features] MessageOptions features + * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption + * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource + */ + + /** + * Constructs a new MessageOptions. + * @memberof google.protobuf + * @classdesc Represents a MessageOptions. + * @implements IMessageOptions + * @constructor + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + */ + function MessageOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MessageOptions messageSetWireFormat. + * @member {boolean} messageSetWireFormat + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.messageSetWireFormat = false; + + /** + * MessageOptions noStandardDescriptorAccessor. + * @member {boolean} noStandardDescriptorAccessor + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.noStandardDescriptorAccessor = false; + + /** + * MessageOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecated = false; + + /** + * MessageOptions mapEntry. + * @member {boolean} mapEntry + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.mapEntry = false; + + /** + * MessageOptions deprecatedLegacyJsonFieldConflicts. + * @member {boolean} deprecatedLegacyJsonFieldConflicts + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; + + /** + * MessageOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.features = null; + + /** + * MessageOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MessageOptions .google.api.resource. + * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype[".google.api.resource"] = null; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + * @returns {google.protobuf.MessageOptions} MessageOptions instance + */ + MessageOptions.create = function create(properties) { + return new MessageOptions(properties); + }; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); + if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); + if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.deprecatedLegacyJsonFieldConflicts); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resource"] != null && Object.hasOwnProperty.call(message, ".google.api.resource")) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.messageSetWireFormat = reader.bool(); + break; + } + case 2: { + message.noStandardDescriptorAccessor = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 7: { + message.mapEntry = reader.bool(); + break; + } + case 11: { + message.deprecatedLegacyJsonFieldConflicts = reader.bool(); + break; + } + case 12: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1053: { + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MessageOptions message. + * @function verify + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MessageOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + if (typeof message.messageSetWireFormat !== "boolean") + return "messageSetWireFormat: boolean expected"; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + if (typeof message.noStandardDescriptorAccessor !== "boolean") + return "noStandardDescriptorAccessor: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + if (typeof message.mapEntry !== "boolean") + return "mapEntry: boolean expected"; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") + return "deprecatedLegacyJsonFieldConflicts: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resource"]); + if (error) + return ".google.api.resource." + error; + } + return null; + }; + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MessageOptions} MessageOptions + */ + MessageOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MessageOptions) + return object; + var message = new $root.google.protobuf.MessageOptions(); + if (object.messageSetWireFormat != null) + message.messageSetWireFormat = Boolean(object.messageSetWireFormat); + if (object.noStandardDescriptorAccessor != null) + message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.mapEntry != null) + message.mapEntry = Boolean(object.mapEntry); + if (object.deprecatedLegacyJsonFieldConflicts != null) + message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.MessageOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resource"] != null) { + if (typeof object[".google.api.resource"] !== "object") + throw TypeError(".google.protobuf.MessageOptions..google.api.resource: object expected"); + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resource"]); + } + return message; + }; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.MessageOptions} message MessageOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MessageOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.messageSetWireFormat = false; + object.noStandardDescriptorAccessor = false; + object.deprecated = false; + object.mapEntry = false; + object.deprecatedLegacyJsonFieldConflicts = false; + object.features = null; + object[".google.api.resource"] = null; + } + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + object.messageSetWireFormat = message.messageSetWireFormat; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + object.mapEntry = message.mapEntry; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) + object[".google.api.resource"] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resource"], options); + return object; + }; + + /** + * Converts this MessageOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MessageOptions + * @instance + * @returns {Object.} JSON object + */ + MessageOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MessageOptions + * @function getTypeUrl + * @memberof google.protobuf.MessageOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MessageOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MessageOptions"; + }; + + return MessageOptions; + })(); + + protobuf.FieldOptions = (function() { + + /** + * Properties of a FieldOptions. + * @memberof google.protobuf + * @interface IFieldOptions + * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype + * @property {boolean|null} [packed] FieldOptions packed + * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype + * @property {boolean|null} [lazy] FieldOptions lazy + * @property {boolean|null} [unverifiedLazy] FieldOptions unverifiedLazy + * @property {boolean|null} [deprecated] FieldOptions deprecated + * @property {boolean|null} [weak] FieldOptions weak + * @property {boolean|null} [debugRedact] FieldOptions debugRedact + * @property {google.protobuf.FieldOptions.OptionRetention|null} [retention] FieldOptions retention + * @property {Array.|null} [targets] FieldOptions targets + * @property {Array.|null} [editionDefaults] FieldOptions editionDefaults + * @property {google.protobuf.IFeatureSet|null} [features] FieldOptions features + * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption + * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior + * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference + */ + + /** + * Constructs a new FieldOptions. + * @memberof google.protobuf + * @classdesc Represents a FieldOptions. + * @implements IFieldOptions + * @constructor + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + */ + function FieldOptions(properties) { + this.targets = []; + this.editionDefaults = []; + this.uninterpretedOption = []; + this[".google.api.fieldBehavior"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldOptions ctype. + * @member {google.protobuf.FieldOptions.CType} ctype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.ctype = 0; + + /** + * FieldOptions packed. + * @member {boolean} packed + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.packed = false; + + /** + * FieldOptions jstype. + * @member {google.protobuf.FieldOptions.JSType} jstype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.jstype = 0; + + /** + * FieldOptions lazy. + * @member {boolean} lazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.lazy = false; + + /** + * FieldOptions unverifiedLazy. + * @member {boolean} unverifiedLazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.unverifiedLazy = false; + + /** + * FieldOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.deprecated = false; + + /** + * FieldOptions weak. + * @member {boolean} weak + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.weak = false; + + /** + * FieldOptions debugRedact. + * @member {boolean} debugRedact + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.debugRedact = false; + + /** + * FieldOptions retention. + * @member {google.protobuf.FieldOptions.OptionRetention} retention + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.retention = 0; + + /** + * FieldOptions targets. + * @member {Array.} targets + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.targets = $util.emptyArray; + + /** + * FieldOptions editionDefaults. + * @member {Array.} editionDefaults + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.editionDefaults = $util.emptyArray; + + /** + * FieldOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.features = null; + + /** + * FieldOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FieldOptions .google.api.fieldBehavior. + * @member {Array.} .google.api.fieldBehavior + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; + + /** + * FieldOptions .google.api.resourceReference. + * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.resourceReference"] = null; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions} FieldOptions instance + */ + FieldOptions.create = function create(properties) { + return new FieldOptions(properties); + }; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); + if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); + if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); + if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); + if (message.unverifiedLazy != null && Object.hasOwnProperty.call(message, "unverifiedLazy")) + writer.uint32(/* id 15, wireType 0 =*/120).bool(message.unverifiedLazy); + if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.debugRedact); + if (message.retention != null && Object.hasOwnProperty.call(message, "retention")) + writer.uint32(/* id 17, wireType 0 =*/136).int32(message.retention); + if (message.targets != null && message.targets.length) + for (var i = 0; i < message.targets.length; ++i) + writer.uint32(/* id 19, wireType 0 =*/152).int32(message.targets[i]); + if (message.editionDefaults != null && message.editionDefaults.length) + for (var i = 0; i < message.editionDefaults.length; ++i) + $root.google.protobuf.FieldOptions.EditionDefault.encode(message.editionDefaults[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + writer.uint32(/* id 1052, wireType 0 =*/8416).int32(message[".google.api.fieldBehavior"][i]); + if (message[".google.api.resourceReference"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceReference")) + $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.ctype = reader.int32(); + break; + } + case 2: { + message.packed = reader.bool(); + break; + } + case 6: { + message.jstype = reader.int32(); + break; + } + case 5: { + message.lazy = reader.bool(); + break; + } + case 15: { + message.unverifiedLazy = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 10: { + message.weak = reader.bool(); + break; + } + case 16: { + message.debugRedact = reader.bool(); + break; + } + case 17: { + message.retention = reader.int32(); + break; + } + case 19: { + if (!(message.targets && message.targets.length)) + message.targets = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.targets.push(reader.int32()); + } else + message.targets.push(reader.int32()); + break; + } + case 20: { + if (!(message.editionDefaults && message.editionDefaults.length)) + message.editionDefaults = []; + message.editionDefaults.push($root.google.protobuf.FieldOptions.EditionDefault.decode(reader, reader.uint32())); + break; + } + case 21: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1052: { + if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) + message[".google.api.fieldBehavior"] = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message[".google.api.fieldBehavior"].push(reader.int32()); + } else + message[".google.api.fieldBehavior"].push(reader.int32()); + break; + } + case 1055: { + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldOptions message. + * @function verify + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ctype != null && message.hasOwnProperty("ctype")) + switch (message.ctype) { + default: + return "ctype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.packed != null && message.hasOwnProperty("packed")) + if (typeof message.packed !== "boolean") + return "packed: boolean expected"; + if (message.jstype != null && message.hasOwnProperty("jstype")) + switch (message.jstype) { + default: + return "jstype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.lazy != null && message.hasOwnProperty("lazy")) + if (typeof message.lazy !== "boolean") + return "lazy: boolean expected"; + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + if (typeof message.unverifiedLazy !== "boolean") + return "unverifiedLazy: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.weak != null && message.hasOwnProperty("weak")) + if (typeof message.weak !== "boolean") + return "weak: boolean expected"; + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + if (typeof message.debugRedact !== "boolean") + return "debugRedact: boolean expected"; + if (message.retention != null && message.hasOwnProperty("retention")) + switch (message.retention) { + default: + return "retention: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.targets != null && message.hasOwnProperty("targets")) { + if (!Array.isArray(message.targets)) + return "targets: array expected"; + for (var i = 0; i < message.targets.length; ++i) + switch (message.targets[i]) { + default: + return "targets: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + break; + } + } + if (message.editionDefaults != null && message.hasOwnProperty("editionDefaults")) { + if (!Array.isArray(message.editionDefaults)) + return "editionDefaults: array expected"; + for (var i = 0; i < message.editionDefaults.length; ++i) { + var error = $root.google.protobuf.FieldOptions.EditionDefault.verify(message.editionDefaults[i]); + if (error) + return "editionDefaults." + error; + } + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) { + if (!Array.isArray(message[".google.api.fieldBehavior"])) + return ".google.api.fieldBehavior: array expected"; + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + switch (message[".google.api.fieldBehavior"][i]) { + default: + return ".google.api.fieldBehavior: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + break; + } + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) { + var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"]); + if (error) + return ".google.api.resourceReference." + error; + } + return null; + }; + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions} FieldOptions + */ + FieldOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions) + return object; + var message = new $root.google.protobuf.FieldOptions(); + switch (object.ctype) { + default: + if (typeof object.ctype === "number") { + message.ctype = object.ctype; + break; + } + break; + case "STRING": + case 0: + message.ctype = 0; + break; + case "CORD": + case 1: + message.ctype = 1; + break; + case "STRING_PIECE": + case 2: + message.ctype = 2; + break; + } + if (object.packed != null) + message.packed = Boolean(object.packed); + switch (object.jstype) { + default: + if (typeof object.jstype === "number") { + message.jstype = object.jstype; + break; + } + break; + case "JS_NORMAL": + case 0: + message.jstype = 0; + break; + case "JS_STRING": + case 1: + message.jstype = 1; + break; + case "JS_NUMBER": + case 2: + message.jstype = 2; + break; + } + if (object.lazy != null) + message.lazy = Boolean(object.lazy); + if (object.unverifiedLazy != null) + message.unverifiedLazy = Boolean(object.unverifiedLazy); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.weak != null) + message.weak = Boolean(object.weak); + if (object.debugRedact != null) + message.debugRedact = Boolean(object.debugRedact); + switch (object.retention) { + default: + if (typeof object.retention === "number") { + message.retention = object.retention; + break; + } + break; + case "RETENTION_UNKNOWN": + case 0: + message.retention = 0; + break; + case "RETENTION_RUNTIME": + case 1: + message.retention = 1; + break; + case "RETENTION_SOURCE": + case 2: + message.retention = 2; + break; + } + if (object.targets) { + if (!Array.isArray(object.targets)) + throw TypeError(".google.protobuf.FieldOptions.targets: array expected"); + message.targets = []; + for (var i = 0; i < object.targets.length; ++i) + switch (object.targets[i]) { + default: + if (typeof object.targets[i] === "number") { + message.targets[i] = object.targets[i]; + break; + } + case "TARGET_TYPE_UNKNOWN": + case 0: + message.targets[i] = 0; + break; + case "TARGET_TYPE_FILE": + case 1: + message.targets[i] = 1; + break; + case "TARGET_TYPE_EXTENSION_RANGE": + case 2: + message.targets[i] = 2; + break; + case "TARGET_TYPE_MESSAGE": + case 3: + message.targets[i] = 3; + break; + case "TARGET_TYPE_FIELD": + case 4: + message.targets[i] = 4; + break; + case "TARGET_TYPE_ONEOF": + case 5: + message.targets[i] = 5; + break; + case "TARGET_TYPE_ENUM": + case 6: + message.targets[i] = 6; + break; + case "TARGET_TYPE_ENUM_ENTRY": + case 7: + message.targets[i] = 7; + break; + case "TARGET_TYPE_SERVICE": + case 8: + message.targets[i] = 8; + break; + case "TARGET_TYPE_METHOD": + case 9: + message.targets[i] = 9; + break; + } + } + if (object.editionDefaults) { + if (!Array.isArray(object.editionDefaults)) + throw TypeError(".google.protobuf.FieldOptions.editionDefaults: array expected"); + message.editionDefaults = []; + for (var i = 0; i < object.editionDefaults.length; ++i) { + if (typeof object.editionDefaults[i] !== "object") + throw TypeError(".google.protobuf.FieldOptions.editionDefaults: object expected"); + message.editionDefaults[i] = $root.google.protobuf.FieldOptions.EditionDefault.fromObject(object.editionDefaults[i]); + } + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FieldOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.fieldBehavior"]) { + if (!Array.isArray(object[".google.api.fieldBehavior"])) + throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected"); + message[".google.api.fieldBehavior"] = []; + for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i) + switch (object[".google.api.fieldBehavior"][i]) { + default: + if (typeof object[".google.api.fieldBehavior"][i] === "number") { + message[".google.api.fieldBehavior"][i] = object[".google.api.fieldBehavior"][i]; + break; + } + case "FIELD_BEHAVIOR_UNSPECIFIED": + case 0: + message[".google.api.fieldBehavior"][i] = 0; + break; + case "OPTIONAL": + case 1: + message[".google.api.fieldBehavior"][i] = 1; + break; + case "REQUIRED": + case 2: + message[".google.api.fieldBehavior"][i] = 2; + break; + case "OUTPUT_ONLY": + case 3: + message[".google.api.fieldBehavior"][i] = 3; + break; + case "INPUT_ONLY": + case 4: + message[".google.api.fieldBehavior"][i] = 4; + break; + case "IMMUTABLE": + case 5: + message[".google.api.fieldBehavior"][i] = 5; + break; + case "UNORDERED_LIST": + case 6: + message[".google.api.fieldBehavior"][i] = 6; + break; + case "NON_EMPTY_DEFAULT": + case 7: + message[".google.api.fieldBehavior"][i] = 7; + break; + case "IDENTIFIER": + case 8: + message[".google.api.fieldBehavior"][i] = 8; + break; + } + } + if (object[".google.api.resourceReference"] != null) { + if (typeof object[".google.api.resourceReference"] !== "object") + throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected"); + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"]); + } + return message; + }; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.FieldOptions} message FieldOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.targets = []; + object.editionDefaults = []; + object.uninterpretedOption = []; + object[".google.api.fieldBehavior"] = []; + } + if (options.defaults) { + object.ctype = options.enums === String ? "STRING" : 0; + object.packed = false; + object.deprecated = false; + object.lazy = false; + object.jstype = options.enums === String ? "JS_NORMAL" : 0; + object.weak = false; + object.unverifiedLazy = false; + object.debugRedact = false; + object.retention = options.enums === String ? "RETENTION_UNKNOWN" : 0; + object.features = null; + object[".google.api.resourceReference"] = null; + } + if (message.ctype != null && message.hasOwnProperty("ctype")) + object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] === undefined ? message.ctype : $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; + if (message.packed != null && message.hasOwnProperty("packed")) + object.packed = message.packed; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.lazy != null && message.hasOwnProperty("lazy")) + object.lazy = message.lazy; + if (message.jstype != null && message.hasOwnProperty("jstype")) + object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] === undefined ? message.jstype : $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; + if (message.weak != null && message.hasOwnProperty("weak")) + object.weak = message.weak; + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + object.unverifiedLazy = message.unverifiedLazy; + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + object.debugRedact = message.debugRedact; + if (message.retention != null && message.hasOwnProperty("retention")) + object.retention = options.enums === String ? $root.google.protobuf.FieldOptions.OptionRetention[message.retention] === undefined ? message.retention : $root.google.protobuf.FieldOptions.OptionRetention[message.retention] : message.retention; + if (message.targets && message.targets.length) { + object.targets = []; + for (var j = 0; j < message.targets.length; ++j) + object.targets[j] = options.enums === String ? $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] === undefined ? message.targets[j] : $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] : message.targets[j]; + } + if (message.editionDefaults && message.editionDefaults.length) { + object.editionDefaults = []; + for (var j = 0; j < message.editionDefaults.length; ++j) + object.editionDefaults[j] = $root.google.protobuf.FieldOptions.EditionDefault.toObject(message.editionDefaults[j], options); + } + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length) { + object[".google.api.fieldBehavior"] = []; + for (var j = 0; j < message[".google.api.fieldBehavior"].length; ++j) + object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] === undefined ? message[".google.api.fieldBehavior"][j] : $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) + object[".google.api.resourceReference"] = $root.google.api.ResourceReference.toObject(message[".google.api.resourceReference"], options); + return object; + }; + + /** + * Converts this FieldOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions + * @instance + * @returns {Object.} JSON object + */ + FieldOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldOptions + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions"; + }; + + /** + * CType enum. + * @name google.protobuf.FieldOptions.CType + * @enum {number} + * @property {number} STRING=0 STRING value + * @property {number} CORD=1 CORD value + * @property {number} STRING_PIECE=2 STRING_PIECE value + */ + FieldOptions.CType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STRING"] = 0; + values[valuesById[1] = "CORD"] = 1; + values[valuesById[2] = "STRING_PIECE"] = 2; + return values; + })(); + + /** + * JSType enum. + * @name google.protobuf.FieldOptions.JSType + * @enum {number} + * @property {number} JS_NORMAL=0 JS_NORMAL value + * @property {number} JS_STRING=1 JS_STRING value + * @property {number} JS_NUMBER=2 JS_NUMBER value + */ + FieldOptions.JSType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JS_NORMAL"] = 0; + values[valuesById[1] = "JS_STRING"] = 1; + values[valuesById[2] = "JS_NUMBER"] = 2; + return values; + })(); + + /** + * OptionRetention enum. + * @name google.protobuf.FieldOptions.OptionRetention + * @enum {number} + * @property {number} RETENTION_UNKNOWN=0 RETENTION_UNKNOWN value + * @property {number} RETENTION_RUNTIME=1 RETENTION_RUNTIME value + * @property {number} RETENTION_SOURCE=2 RETENTION_SOURCE value + */ + FieldOptions.OptionRetention = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RETENTION_UNKNOWN"] = 0; + values[valuesById[1] = "RETENTION_RUNTIME"] = 1; + values[valuesById[2] = "RETENTION_SOURCE"] = 2; + return values; + })(); + + /** + * OptionTargetType enum. + * @name google.protobuf.FieldOptions.OptionTargetType + * @enum {number} + * @property {number} TARGET_TYPE_UNKNOWN=0 TARGET_TYPE_UNKNOWN value + * @property {number} TARGET_TYPE_FILE=1 TARGET_TYPE_FILE value + * @property {number} TARGET_TYPE_EXTENSION_RANGE=2 TARGET_TYPE_EXTENSION_RANGE value + * @property {number} TARGET_TYPE_MESSAGE=3 TARGET_TYPE_MESSAGE value + * @property {number} TARGET_TYPE_FIELD=4 TARGET_TYPE_FIELD value + * @property {number} TARGET_TYPE_ONEOF=5 TARGET_TYPE_ONEOF value + * @property {number} TARGET_TYPE_ENUM=6 TARGET_TYPE_ENUM value + * @property {number} TARGET_TYPE_ENUM_ENTRY=7 TARGET_TYPE_ENUM_ENTRY value + * @property {number} TARGET_TYPE_SERVICE=8 TARGET_TYPE_SERVICE value + * @property {number} TARGET_TYPE_METHOD=9 TARGET_TYPE_METHOD value + */ + FieldOptions.OptionTargetType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TARGET_TYPE_UNKNOWN"] = 0; + values[valuesById[1] = "TARGET_TYPE_FILE"] = 1; + values[valuesById[2] = "TARGET_TYPE_EXTENSION_RANGE"] = 2; + values[valuesById[3] = "TARGET_TYPE_MESSAGE"] = 3; + values[valuesById[4] = "TARGET_TYPE_FIELD"] = 4; + values[valuesById[5] = "TARGET_TYPE_ONEOF"] = 5; + values[valuesById[6] = "TARGET_TYPE_ENUM"] = 6; + values[valuesById[7] = "TARGET_TYPE_ENUM_ENTRY"] = 7; + values[valuesById[8] = "TARGET_TYPE_SERVICE"] = 8; + values[valuesById[9] = "TARGET_TYPE_METHOD"] = 9; + return values; + })(); + + FieldOptions.EditionDefault = (function() { + + /** + * Properties of an EditionDefault. + * @memberof google.protobuf.FieldOptions + * @interface IEditionDefault + * @property {google.protobuf.Edition|null} [edition] EditionDefault edition + * @property {string|null} [value] EditionDefault value + */ + + /** + * Constructs a new EditionDefault. + * @memberof google.protobuf.FieldOptions + * @classdesc Represents an EditionDefault. + * @implements IEditionDefault + * @constructor + * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set + */ + function EditionDefault(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EditionDefault edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + */ + EditionDefault.prototype.edition = 0; + + /** + * EditionDefault value. + * @member {string} value + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + */ + EditionDefault.prototype.value = ""; + + /** + * Creates a new EditionDefault instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault instance + */ + EditionDefault.create = function create(properties) { + return new EditionDefault(properties); + }; + + /** + * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EditionDefault.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EditionDefault.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EditionDefault message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EditionDefault.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions.EditionDefault(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.edition = reader.int32(); + break; + } + case 2: { + message.value = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EditionDefault message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EditionDefault.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EditionDefault message. + * @function verify + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EditionDefault.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + */ + EditionDefault.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions.EditionDefault) + return object; + var message = new $root.google.protobuf.FieldOptions.EditionDefault(); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.EditionDefault} message EditionDefault + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EditionDefault.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.value = ""; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this EditionDefault to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + * @returns {Object.} JSON object + */ + EditionDefault.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EditionDefault + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions.EditionDefault"; + }; + + return EditionDefault; + })(); + + return FieldOptions; + })(); + + protobuf.OneofOptions = (function() { + + /** + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @property {google.protobuf.IFeatureSet|null} [features] OneofOptions features + * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption + */ + + /** + * Constructs a new OneofOptions. + * @memberof google.protobuf + * @classdesc Represents an OneofOptions. + * @implements IOneofOptions + * @constructor + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + */ + function OneofOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.features = null; + + /** + * OneofOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + * @returns {google.protobuf.OneofOptions} OneofOptions instance + */ + OneofOptions.create = function create(properties) { + return new OneofOptions(properties); + }; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofOptions message. + * @function verify + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofOptions} OneofOptions + */ + OneofOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofOptions) + return object; + var message = new $root.google.protobuf.OneofOptions(); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.OneofOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.OneofOptions} message OneofOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) + object.features = null; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this OneofOptions to JSON. + * @function toJSON + * @memberof google.protobuf.OneofOptions + * @instance + * @returns {Object.} JSON object + */ + OneofOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OneofOptions + * @function getTypeUrl + * @memberof google.protobuf.OneofOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofOptions"; + }; + + return OneofOptions; + })(); + + protobuf.EnumOptions = (function() { + + /** + * Properties of an EnumOptions. + * @memberof google.protobuf + * @interface IEnumOptions + * @property {boolean|null} [allowAlias] EnumOptions allowAlias + * @property {boolean|null} [deprecated] EnumOptions deprecated + * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] EnumOptions deprecatedLegacyJsonFieldConflicts + * @property {google.protobuf.IFeatureSet|null} [features] EnumOptions features + * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption + */ + + /** + * Constructs a new EnumOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumOptions. + * @implements IEnumOptions + * @constructor + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + */ + function EnumOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumOptions allowAlias. + * @member {boolean} allowAlias + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.allowAlias = false; + + /** + * EnumOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecated = false; + + /** + * EnumOptions deprecatedLegacyJsonFieldConflicts. + * @member {boolean} deprecatedLegacyJsonFieldConflicts + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; + + /** + * EnumOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.features = null; + + /** + * EnumOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumOptions} EnumOptions instance + */ + EnumOptions.create = function create(properties) { + return new EnumOptions(properties); + }; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.deprecatedLegacyJsonFieldConflicts); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.allowAlias = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 6: { + message.deprecatedLegacyJsonFieldConflicts = reader.bool(); + break; + } + case 7: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumOptions message. + * @function verify + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + if (typeof message.allowAlias !== "boolean") + return "allowAlias: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") + return "deprecatedLegacyJsonFieldConflicts: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumOptions} EnumOptions + */ + EnumOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumOptions) + return object; + var message = new $root.google.protobuf.EnumOptions(); + if (object.allowAlias != null) + message.allowAlias = Boolean(object.allowAlias); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.deprecatedLegacyJsonFieldConflicts != null) + message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.EnumOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.EnumOptions} message EnumOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.allowAlias = false; + object.deprecated = false; + object.deprecatedLegacyJsonFieldConflicts = false; + object.features = null; + } + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + object.allowAlias = message.allowAlias; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumOptions + * @instance + * @returns {Object.} JSON object + */ + EnumOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumOptions"; + }; + + return EnumOptions; + })(); + + protobuf.EnumValueOptions = (function() { + + /** + * Properties of an EnumValueOptions. + * @memberof google.protobuf + * @interface IEnumValueOptions + * @property {boolean|null} [deprecated] EnumValueOptions deprecated + * @property {google.protobuf.IFeatureSet|null} [features] EnumValueOptions features + * @property {boolean|null} [debugRedact] EnumValueOptions debugRedact + * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption + */ + + /** + * Constructs a new EnumValueOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumValueOptions. + * @implements IEnumValueOptions + * @constructor + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + */ + function EnumValueOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.deprecated = false; + + /** + * EnumValueOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.features = null; + + /** + * EnumValueOptions debugRedact. + * @member {boolean} debugRedact + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.debugRedact = false; + + /** + * EnumValueOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance + */ + EnumValueOptions.create = function create(properties) { + return new EnumValueOptions(properties); + }; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.debugRedact); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.deprecated = reader.bool(); + break; + } + case 2: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 3: { + message.debugRedact = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueOptions message. + * @function verify + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + if (typeof message.debugRedact !== "boolean") + return "debugRedact: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + */ + EnumValueOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueOptions) + return object; + var message = new $root.google.protobuf.EnumValueOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.debugRedact != null) + message.debugRedact = Boolean(object.debugRedact); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.EnumValueOptions} message EnumValueOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object.features = null; + object.debugRedact = false; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + object.debugRedact = message.debugRedact; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumValueOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueOptions + * @instance + * @returns {Object.} JSON object + */ + EnumValueOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValueOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueOptions"; + }; + + return EnumValueOptions; + })(); + + protobuf.ServiceOptions = (function() { + + /** + * Properties of a ServiceOptions. + * @memberof google.protobuf + * @interface IServiceOptions + * @property {google.protobuf.IFeatureSet|null} [features] ServiceOptions features + * @property {boolean|null} [deprecated] ServiceOptions deprecated + * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption + * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost + * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes + * @property {string|null} [".google.api.apiVersion"] ServiceOptions .google.api.apiVersion + */ + + /** + * Constructs a new ServiceOptions. + * @memberof google.protobuf + * @classdesc Represents a ServiceOptions. + * @implements IServiceOptions + * @constructor + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + */ + function ServiceOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.features = null; + + /** + * ServiceOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.deprecated = false; + + /** + * ServiceOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * ServiceOptions .google.api.defaultHost. + * @member {string} .google.api.defaultHost + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.defaultHost"] = ""; + + /** + * ServiceOptions .google.api.oauthScopes. + * @member {string} .google.api.oauthScopes + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.oauthScopes"] = ""; + + /** + * ServiceOptions .google.api.apiVersion. + * @member {string} .google.api.apiVersion + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.apiVersion"] = ""; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + * @returns {google.protobuf.ServiceOptions} ServiceOptions instance + */ + ServiceOptions.create = function create(properties) { + return new ServiceOptions(properties); + }; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 34, wireType 2 =*/274).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) + writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); + if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) + writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); + if (message[".google.api.apiVersion"] != null && Object.hasOwnProperty.call(message, ".google.api.apiVersion")) + writer.uint32(/* id 525000001, wireType 2 =*/4200000010).string(message[".google.api.apiVersion"]); + return writer; + }; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 34: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 33: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1049: { + message[".google.api.defaultHost"] = reader.string(); + break; + } + case 1050: { + message[".google.api.oauthScopes"] = reader.string(); + break; + } + case 525000001: { + message[".google.api.apiVersion"] = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceOptions message. + * @function verify + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + if (!$util.isString(message[".google.api.defaultHost"])) + return ".google.api.defaultHost: string expected"; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + if (!$util.isString(message[".google.api.oauthScopes"])) + return ".google.api.oauthScopes: string expected"; + if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) + if (!$util.isString(message[".google.api.apiVersion"])) + return ".google.api.apiVersion: string expected"; + return null; + }; + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceOptions} ServiceOptions + */ + ServiceOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceOptions) + return object; + var message = new $root.google.protobuf.ServiceOptions(); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.ServiceOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.defaultHost"] != null) + message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); + if (object[".google.api.oauthScopes"] != null) + message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); + if (object[".google.api.apiVersion"] != null) + message[".google.api.apiVersion"] = String(object[".google.api.apiVersion"]); + return message; + }; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.ServiceOptions} message ServiceOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object.features = null; + object[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + object[".google.api.apiVersion"] = ""; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; + if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) + object[".google.api.apiVersion"] = message[".google.api.apiVersion"]; + return object; + }; + + /** + * Converts this ServiceOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceOptions + * @instance + * @returns {Object.} JSON object + */ + ServiceOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceOptions + * @function getTypeUrl + * @memberof google.protobuf.ServiceOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceOptions"; + }; + + return ServiceOptions; + })(); + + protobuf.MethodOptions = (function() { + + /** + * Properties of a MethodOptions. + * @memberof google.protobuf + * @interface IMethodOptions + * @property {boolean|null} [deprecated] MethodOptions deprecated + * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel + * @property {google.protobuf.IFeatureSet|null} [features] MethodOptions features + * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption + * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http + * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature + * @property {google.longrunning.IOperationInfo|null} [".google.longrunning.operationInfo"] MethodOptions .google.longrunning.operationInfo + */ + + /** + * Constructs a new MethodOptions. + * @memberof google.protobuf + * @classdesc Represents a MethodOptions. + * @implements IMethodOptions + * @constructor + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + */ + function MethodOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.methodSignature"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.deprecated = false; + + /** + * MethodOptions idempotencyLevel. + * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.idempotencyLevel = 0; + + /** + * MethodOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.features = null; + + /** + * MethodOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MethodOptions .google.api.http. + * @member {google.api.IHttpRule|null|undefined} .google.api.http + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.http"] = null; + + /** + * MethodOptions .google.api.methodSignature. + * @member {Array.} .google.api.methodSignature + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; + + /** + * MethodOptions .google.longrunning.operationInfo. + * @member {google.longrunning.IOperationInfo|null|undefined} .google.longrunning.operationInfo + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.longrunning.operationInfo"] = null; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + * @returns {google.protobuf.MethodOptions} MethodOptions instance + */ + MethodOptions.create = function create(properties) { + return new MethodOptions(properties); + }; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel")) + writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 35, wireType 2 =*/282).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.longrunning.operationInfo"] != null && Object.hasOwnProperty.call(message, ".google.longrunning.operationInfo")) + $root.google.longrunning.OperationInfo.encode(message[".google.longrunning.operationInfo"], writer.uint32(/* id 1049, wireType 2 =*/8394).fork()).ldelim(); + if (message[".google.api.methodSignature"] != null && message[".google.api.methodSignature"].length) + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + writer.uint32(/* id 1051, wireType 2 =*/8410).string(message[".google.api.methodSignature"][i]); + if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http")) + $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 33: { + message.deprecated = reader.bool(); + break; + } + case 34: { + message.idempotencyLevel = reader.int32(); + break; + } + case 35: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 72295728: { + message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); + break; + } + case 1051: { + if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) + message[".google.api.methodSignature"] = []; + message[".google.api.methodSignature"].push(reader.string()); + break; + } + case 1049: { + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodOptions message. + * @function verify + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + switch (message.idempotencyLevel) { + default: + return "idempotencyLevel: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) { + var error = $root.google.api.HttpRule.verify(message[".google.api.http"]); + if (error) + return ".google.api.http." + error; + } + if (message[".google.api.methodSignature"] != null && message.hasOwnProperty(".google.api.methodSignature")) { + if (!Array.isArray(message[".google.api.methodSignature"])) + return ".google.api.methodSignature: array expected"; + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + if (!$util.isString(message[".google.api.methodSignature"][i])) + return ".google.api.methodSignature: string[] expected"; + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) { + var error = $root.google.longrunning.OperationInfo.verify(message[".google.longrunning.operationInfo"]); + if (error) + return ".google.longrunning.operationInfo." + error; + } + return null; + }; + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodOptions} MethodOptions + */ + MethodOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodOptions) + return object; + var message = new $root.google.protobuf.MethodOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + switch (object.idempotencyLevel) { + default: + if (typeof object.idempotencyLevel === "number") { + message.idempotencyLevel = object.idempotencyLevel; + break; + } + break; + case "IDEMPOTENCY_UNKNOWN": + case 0: + message.idempotencyLevel = 0; + break; + case "NO_SIDE_EFFECTS": + case 1: + message.idempotencyLevel = 1; + break; + case "IDEMPOTENT": + case 2: + message.idempotencyLevel = 2; + break; + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.MethodOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.http"] != null) { + if (typeof object[".google.api.http"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected"); + message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"]); + } + if (object[".google.api.methodSignature"]) { + if (!Array.isArray(object[".google.api.methodSignature"])) + throw TypeError(".google.protobuf.MethodOptions..google.api.methodSignature: array expected"); + message[".google.api.methodSignature"] = []; + for (var i = 0; i < object[".google.api.methodSignature"].length; ++i) + message[".google.api.methodSignature"][i] = String(object[".google.api.methodSignature"][i]); + } + if (object[".google.longrunning.operationInfo"] != null) { + if (typeof object[".google.longrunning.operationInfo"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.longrunning.operationInfo: object expected"); + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.fromObject(object[".google.longrunning.operationInfo"]); + } + return message; + }; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.MethodOptions} message MethodOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.methodSignature"] = []; + } + if (options.defaults) { + object.deprecated = false; + object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0; + object.features = null; + object[".google.longrunning.operationInfo"] = null; + object[".google.api.http"] = null; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] === undefined ? message.idempotencyLevel : $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) + object[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.toObject(message[".google.longrunning.operationInfo"], options); + if (message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length) { + object[".google.api.methodSignature"] = []; + for (var j = 0; j < message[".google.api.methodSignature"].length; ++j) + object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j]; + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) + object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); + return object; + }; + + /** + * Converts this MethodOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MethodOptions + * @instance + * @returns {Object.} JSON object + */ + MethodOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodOptions + * @function getTypeUrl + * @memberof google.protobuf.MethodOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodOptions"; + }; + + /** + * IdempotencyLevel enum. + * @name google.protobuf.MethodOptions.IdempotencyLevel + * @enum {number} + * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value + * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value + * @property {number} IDEMPOTENT=2 IDEMPOTENT value + */ + MethodOptions.IdempotencyLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0; + values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1; + values[valuesById[2] = "IDEMPOTENT"] = 2; + return values; + })(); + + return MethodOptions; + })(); + + protobuf.UninterpretedOption = (function() { + + /** + * Properties of an UninterpretedOption. + * @memberof google.protobuf + * @interface IUninterpretedOption + * @property {Array.|null} [name] UninterpretedOption name + * @property {string|null} [identifierValue] UninterpretedOption identifierValue + * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue + * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue + * @property {number|null} [doubleValue] UninterpretedOption doubleValue + * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue + * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue + */ + + /** + * Constructs a new UninterpretedOption. + * @memberof google.protobuf + * @classdesc Represents an UninterpretedOption. + * @implements IUninterpretedOption + * @constructor + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + */ + function UninterpretedOption(properties) { + this.name = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UninterpretedOption name. + * @member {Array.} name + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.name = $util.emptyArray; + + /** + * UninterpretedOption identifierValue. + * @member {string} identifierValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.identifierValue = ""; + + /** + * UninterpretedOption positiveIntValue. + * @member {number|Long} positiveIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * UninterpretedOption negativeIntValue. + * @member {number|Long} negativeIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * UninterpretedOption doubleValue. + * @member {number} doubleValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.doubleValue = 0; + + /** + * UninterpretedOption stringValue. + * @member {Uint8Array} stringValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.stringValue = $util.newBuffer([]); + + /** + * UninterpretedOption aggregateValue. + * @member {string} aggregateValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.aggregateValue = ""; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance + */ + UninterpretedOption.create = function create(properties) { + return new UninterpretedOption(properties); + }; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.name.length) + for (var i = 0; i < message.name.length; ++i) + $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); + if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); + if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); + if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) + writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); + if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); + return writer; + }; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + if (!(message.name && message.name.length)) + message.name = []; + message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); + break; + } + case 3: { + message.identifierValue = reader.string(); + break; + } + case 4: { + message.positiveIntValue = reader.uint64(); + break; + } + case 5: { + message.negativeIntValue = reader.int64(); + break; + } + case 6: { + message.doubleValue = reader.double(); + break; + } + case 7: { + message.stringValue = reader.bytes(); + break; + } + case 8: { + message.aggregateValue = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UninterpretedOption message. + * @function verify + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UninterpretedOption.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) { + if (!Array.isArray(message.name)) + return "name: array expected"; + for (var i = 0; i < message.name.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]); + if (error) + return "name." + error; + } + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + if (!$util.isString(message.identifierValue)) + return "identifierValue: string expected"; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high))) + return "positiveIntValue: integer|Long expected"; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high))) + return "negativeIntValue: integer|Long expected"; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + if (typeof message.doubleValue !== "number") + return "doubleValue: number expected"; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue))) + return "stringValue: buffer expected"; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + if (!$util.isString(message.aggregateValue)) + return "aggregateValue: string expected"; + return null; + }; + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + */ + UninterpretedOption.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption) + return object; + var message = new $root.google.protobuf.UninterpretedOption(); + if (object.name) { + if (!Array.isArray(object.name)) + throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); + message.name = []; + for (var i = 0; i < object.name.length; ++i) { + if (typeof object.name[i] !== "object") + throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); + message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); + } + } + if (object.identifierValue != null) + message.identifierValue = String(object.identifierValue); + if (object.positiveIntValue != null) + if ($util.Long) + (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; + else if (typeof object.positiveIntValue === "string") + message.positiveIntValue = parseInt(object.positiveIntValue, 10); + else if (typeof object.positiveIntValue === "number") + message.positiveIntValue = object.positiveIntValue; + else if (typeof object.positiveIntValue === "object") + message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); + if (object.negativeIntValue != null) + if ($util.Long) + (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false; + else if (typeof object.negativeIntValue === "string") + message.negativeIntValue = parseInt(object.negativeIntValue, 10); + else if (typeof object.negativeIntValue === "number") + message.negativeIntValue = object.negativeIntValue; + else if (typeof object.negativeIntValue === "object") + message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); + if (object.doubleValue != null) + message.doubleValue = Number(object.doubleValue); + if (object.stringValue != null) + if (typeof object.stringValue === "string") + $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); + else if (object.stringValue.length >= 0) + message.stringValue = object.stringValue; + if (object.aggregateValue != null) + message.aggregateValue = String(object.aggregateValue); + return message; + }; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.UninterpretedOption} message UninterpretedOption + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UninterpretedOption.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.name = []; + if (options.defaults) { + object.identifierValue = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.positiveIntValue = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.negativeIntValue = options.longs === String ? "0" : 0; + object.doubleValue = 0; + if (options.bytes === String) + object.stringValue = ""; + else { + object.stringValue = []; + if (options.bytes !== Array) + object.stringValue = $util.newBuffer(object.stringValue); + } + object.aggregateValue = ""; + } + if (message.name && message.name.length) { + object.name = []; + for (var j = 0; j < message.name.length; ++j) + object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + object.identifierValue = message.identifierValue; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (typeof message.positiveIntValue === "number") + object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue; + else + object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (typeof message.negativeIntValue === "number") + object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue; + else + object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + object.aggregateValue = message.aggregateValue; + return object; + }; + + /** + * Converts this UninterpretedOption to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption + * @instance + * @returns {Object.} JSON object + */ + UninterpretedOption.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UninterpretedOption + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UninterpretedOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption"; + }; + + UninterpretedOption.NamePart = (function() { + + /** + * Properties of a NamePart. + * @memberof google.protobuf.UninterpretedOption + * @interface INamePart + * @property {string} namePart NamePart namePart + * @property {boolean} isExtension NamePart isExtension + */ + + /** + * Constructs a new NamePart. + * @memberof google.protobuf.UninterpretedOption + * @classdesc Represents a NamePart. + * @implements INamePart + * @constructor + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + */ + function NamePart(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NamePart namePart. + * @member {string} namePart + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.namePart = ""; + + /** + * NamePart isExtension. + * @member {boolean} isExtension + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.isExtension = false; + + /** + * Creates a new NamePart instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance + */ + NamePart.create = function create(properties) { + return new NamePart(properties); + }; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart); + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension); + return writer; + }; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.namePart = reader.string(); + break; + } + case 2: { + message.isExtension = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + if (!message.hasOwnProperty("namePart")) + throw $util.ProtocolError("missing required 'namePart'", { instance: message }); + if (!message.hasOwnProperty("isExtension")) + throw $util.ProtocolError("missing required 'isExtension'", { instance: message }); + return message; + }; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NamePart message. + * @function verify + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NamePart.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (!$util.isString(message.namePart)) + return "namePart: string expected"; + if (typeof message.isExtension !== "boolean") + return "isExtension: boolean expected"; + return null; + }; + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + */ + NamePart.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) + return object; + var message = new $root.google.protobuf.UninterpretedOption.NamePart(); + if (object.namePart != null) + message.namePart = String(object.namePart); + if (object.isExtension != null) + message.isExtension = Boolean(object.isExtension); + return message; + }; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NamePart.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.namePart = ""; + object.isExtension = false; + } + if (message.namePart != null && message.hasOwnProperty("namePart")) + object.namePart = message.namePart; + if (message.isExtension != null && message.hasOwnProperty("isExtension")) + object.isExtension = message.isExtension; + return object; + }; + + /** + * Converts this NamePart to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + * @returns {Object.} JSON object + */ + NamePart.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NamePart + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NamePart.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption.NamePart"; + }; + + return NamePart; + })(); + + return UninterpretedOption; + })(); + + protobuf.FeatureSet = (function() { + + /** + * Properties of a FeatureSet. + * @memberof google.protobuf + * @interface IFeatureSet + * @property {google.protobuf.FeatureSet.FieldPresence|null} [fieldPresence] FeatureSet fieldPresence + * @property {google.protobuf.FeatureSet.EnumType|null} [enumType] FeatureSet enumType + * @property {google.protobuf.FeatureSet.RepeatedFieldEncoding|null} [repeatedFieldEncoding] FeatureSet repeatedFieldEncoding + * @property {google.protobuf.FeatureSet.Utf8Validation|null} [utf8Validation] FeatureSet utf8Validation + * @property {google.protobuf.FeatureSet.MessageEncoding|null} [messageEncoding] FeatureSet messageEncoding + * @property {google.protobuf.FeatureSet.JsonFormat|null} [jsonFormat] FeatureSet jsonFormat + */ + + /** + * Constructs a new FeatureSet. + * @memberof google.protobuf + * @classdesc Represents a FeatureSet. + * @implements IFeatureSet + * @constructor + * @param {google.protobuf.IFeatureSet=} [properties] Properties to set + */ + function FeatureSet(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSet fieldPresence. + * @member {google.protobuf.FeatureSet.FieldPresence} fieldPresence + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.fieldPresence = 0; + + /** + * FeatureSet enumType. + * @member {google.protobuf.FeatureSet.EnumType} enumType + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.enumType = 0; + + /** + * FeatureSet repeatedFieldEncoding. + * @member {google.protobuf.FeatureSet.RepeatedFieldEncoding} repeatedFieldEncoding + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.repeatedFieldEncoding = 0; + + /** + * FeatureSet utf8Validation. + * @member {google.protobuf.FeatureSet.Utf8Validation} utf8Validation + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.utf8Validation = 0; + + /** + * FeatureSet messageEncoding. + * @member {google.protobuf.FeatureSet.MessageEncoding} messageEncoding + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.messageEncoding = 0; + + /** + * FeatureSet jsonFormat. + * @member {google.protobuf.FeatureSet.JsonFormat} jsonFormat + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.jsonFormat = 0; + + /** + * Creates a new FeatureSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet=} [properties] Properties to set + * @returns {google.protobuf.FeatureSet} FeatureSet instance + */ + FeatureSet.create = function create(properties) { + return new FeatureSet(properties); + }; + + /** + * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fieldPresence != null && Object.hasOwnProperty.call(message, "fieldPresence")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.fieldPresence); + if (message.enumType != null && Object.hasOwnProperty.call(message, "enumType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.enumType); + if (message.repeatedFieldEncoding != null && Object.hasOwnProperty.call(message, "repeatedFieldEncoding")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.repeatedFieldEncoding); + if (message.utf8Validation != null && Object.hasOwnProperty.call(message, "utf8Validation")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.utf8Validation); + if (message.messageEncoding != null && Object.hasOwnProperty.call(message, "messageEncoding")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.messageEncoding); + if (message.jsonFormat != null && Object.hasOwnProperty.call(message, "jsonFormat")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jsonFormat); + return writer; + }; + + /** + * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSet} FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSet.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.fieldPresence = reader.int32(); + break; + } + case 2: { + message.enumType = reader.int32(); + break; + } + case 3: { + message.repeatedFieldEncoding = reader.int32(); + break; + } + case 4: { + message.utf8Validation = reader.int32(); + break; + } + case 5: { + message.messageEncoding = reader.int32(); + break; + } + case 6: { + message.jsonFormat = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSet} FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSet message. + * @function verify + * @memberof google.protobuf.FeatureSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) + switch (message.fieldPresence) { + default: + return "fieldPresence: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.enumType != null && message.hasOwnProperty("enumType")) + switch (message.enumType) { + default: + return "enumType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) + switch (message.repeatedFieldEncoding) { + default: + return "repeatedFieldEncoding: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) + switch (message.utf8Validation) { + default: + return "utf8Validation: enum value expected"; + case 0: + case 2: + case 3: + break; + } + if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) + switch (message.messageEncoding) { + default: + return "messageEncoding: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) + switch (message.jsonFormat) { + default: + return "jsonFormat: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSet} FeatureSet + */ + FeatureSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSet) + return object; + var message = new $root.google.protobuf.FeatureSet(); + switch (object.fieldPresence) { + default: + if (typeof object.fieldPresence === "number") { + message.fieldPresence = object.fieldPresence; + break; + } + break; + case "FIELD_PRESENCE_UNKNOWN": + case 0: + message.fieldPresence = 0; + break; + case "EXPLICIT": + case 1: + message.fieldPresence = 1; + break; + case "IMPLICIT": + case 2: + message.fieldPresence = 2; + break; + case "LEGACY_REQUIRED": + case 3: + message.fieldPresence = 3; + break; + } + switch (object.enumType) { + default: + if (typeof object.enumType === "number") { + message.enumType = object.enumType; + break; + } + break; + case "ENUM_TYPE_UNKNOWN": + case 0: + message.enumType = 0; + break; + case "OPEN": + case 1: + message.enumType = 1; + break; + case "CLOSED": + case 2: + message.enumType = 2; + break; + } + switch (object.repeatedFieldEncoding) { + default: + if (typeof object.repeatedFieldEncoding === "number") { + message.repeatedFieldEncoding = object.repeatedFieldEncoding; + break; + } + break; + case "REPEATED_FIELD_ENCODING_UNKNOWN": + case 0: + message.repeatedFieldEncoding = 0; + break; + case "PACKED": + case 1: + message.repeatedFieldEncoding = 1; + break; + case "EXPANDED": + case 2: + message.repeatedFieldEncoding = 2; + break; + } + switch (object.utf8Validation) { + default: + if (typeof object.utf8Validation === "number") { + message.utf8Validation = object.utf8Validation; + break; + } + break; + case "UTF8_VALIDATION_UNKNOWN": + case 0: + message.utf8Validation = 0; + break; + case "VERIFY": + case 2: + message.utf8Validation = 2; + break; + case "NONE": + case 3: + message.utf8Validation = 3; + break; + } + switch (object.messageEncoding) { + default: + if (typeof object.messageEncoding === "number") { + message.messageEncoding = object.messageEncoding; + break; + } + break; + case "MESSAGE_ENCODING_UNKNOWN": + case 0: + message.messageEncoding = 0; + break; + case "LENGTH_PREFIXED": + case 1: + message.messageEncoding = 1; + break; + case "DELIMITED": + case 2: + message.messageEncoding = 2; + break; + } + switch (object.jsonFormat) { + default: + if (typeof object.jsonFormat === "number") { + message.jsonFormat = object.jsonFormat; + break; + } + break; + case "JSON_FORMAT_UNKNOWN": + case 0: + message.jsonFormat = 0; + break; + case "ALLOW": + case 1: + message.jsonFormat = 1; + break; + case "LEGACY_BEST_EFFORT": + case 2: + message.jsonFormat = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.FeatureSet} message FeatureSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.fieldPresence = options.enums === String ? "FIELD_PRESENCE_UNKNOWN" : 0; + object.enumType = options.enums === String ? "ENUM_TYPE_UNKNOWN" : 0; + object.repeatedFieldEncoding = options.enums === String ? "REPEATED_FIELD_ENCODING_UNKNOWN" : 0; + object.utf8Validation = options.enums === String ? "UTF8_VALIDATION_UNKNOWN" : 0; + object.messageEncoding = options.enums === String ? "MESSAGE_ENCODING_UNKNOWN" : 0; + object.jsonFormat = options.enums === String ? "JSON_FORMAT_UNKNOWN" : 0; + } + if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) + object.fieldPresence = options.enums === String ? $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] === undefined ? message.fieldPresence : $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] : message.fieldPresence; + if (message.enumType != null && message.hasOwnProperty("enumType")) + object.enumType = options.enums === String ? $root.google.protobuf.FeatureSet.EnumType[message.enumType] === undefined ? message.enumType : $root.google.protobuf.FeatureSet.EnumType[message.enumType] : message.enumType; + if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) + object.repeatedFieldEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] === undefined ? message.repeatedFieldEncoding : $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] : message.repeatedFieldEncoding; + if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) + object.utf8Validation = options.enums === String ? $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] === undefined ? message.utf8Validation : $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] : message.utf8Validation; + if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) + object.messageEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] === undefined ? message.messageEncoding : $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] : message.messageEncoding; + if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) + object.jsonFormat = options.enums === String ? $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] === undefined ? message.jsonFormat : $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] : message.jsonFormat; + return object; + }; + + /** + * Converts this FeatureSet to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSet + * @instance + * @returns {Object.} JSON object + */ + FeatureSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSet + * @function getTypeUrl + * @memberof google.protobuf.FeatureSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSet"; + }; + + /** + * FieldPresence enum. + * @name google.protobuf.FeatureSet.FieldPresence + * @enum {number} + * @property {number} FIELD_PRESENCE_UNKNOWN=0 FIELD_PRESENCE_UNKNOWN value + * @property {number} EXPLICIT=1 EXPLICIT value + * @property {number} IMPLICIT=2 IMPLICIT value + * @property {number} LEGACY_REQUIRED=3 LEGACY_REQUIRED value + */ + FeatureSet.FieldPresence = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_PRESENCE_UNKNOWN"] = 0; + values[valuesById[1] = "EXPLICIT"] = 1; + values[valuesById[2] = "IMPLICIT"] = 2; + values[valuesById[3] = "LEGACY_REQUIRED"] = 3; + return values; + })(); + + /** + * EnumType enum. + * @name google.protobuf.FeatureSet.EnumType + * @enum {number} + * @property {number} ENUM_TYPE_UNKNOWN=0 ENUM_TYPE_UNKNOWN value + * @property {number} OPEN=1 OPEN value + * @property {number} CLOSED=2 CLOSED value + */ + FeatureSet.EnumType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENUM_TYPE_UNKNOWN"] = 0; + values[valuesById[1] = "OPEN"] = 1; + values[valuesById[2] = "CLOSED"] = 2; + return values; + })(); + + /** + * RepeatedFieldEncoding enum. + * @name google.protobuf.FeatureSet.RepeatedFieldEncoding + * @enum {number} + * @property {number} REPEATED_FIELD_ENCODING_UNKNOWN=0 REPEATED_FIELD_ENCODING_UNKNOWN value + * @property {number} PACKED=1 PACKED value + * @property {number} EXPANDED=2 EXPANDED value + */ + FeatureSet.RepeatedFieldEncoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "REPEATED_FIELD_ENCODING_UNKNOWN"] = 0; + values[valuesById[1] = "PACKED"] = 1; + values[valuesById[2] = "EXPANDED"] = 2; + return values; + })(); + + /** + * Utf8Validation enum. + * @name google.protobuf.FeatureSet.Utf8Validation + * @enum {number} + * @property {number} UTF8_VALIDATION_UNKNOWN=0 UTF8_VALIDATION_UNKNOWN value + * @property {number} VERIFY=2 VERIFY value + * @property {number} NONE=3 NONE value + */ + FeatureSet.Utf8Validation = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UTF8_VALIDATION_UNKNOWN"] = 0; + values[valuesById[2] = "VERIFY"] = 2; + values[valuesById[3] = "NONE"] = 3; + return values; + })(); + + /** + * MessageEncoding enum. + * @name google.protobuf.FeatureSet.MessageEncoding + * @enum {number} + * @property {number} MESSAGE_ENCODING_UNKNOWN=0 MESSAGE_ENCODING_UNKNOWN value + * @property {number} LENGTH_PREFIXED=1 LENGTH_PREFIXED value + * @property {number} DELIMITED=2 DELIMITED value + */ + FeatureSet.MessageEncoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MESSAGE_ENCODING_UNKNOWN"] = 0; + values[valuesById[1] = "LENGTH_PREFIXED"] = 1; + values[valuesById[2] = "DELIMITED"] = 2; + return values; + })(); + + /** + * JsonFormat enum. + * @name google.protobuf.FeatureSet.JsonFormat + * @enum {number} + * @property {number} JSON_FORMAT_UNKNOWN=0 JSON_FORMAT_UNKNOWN value + * @property {number} ALLOW=1 ALLOW value + * @property {number} LEGACY_BEST_EFFORT=2 LEGACY_BEST_EFFORT value + */ + FeatureSet.JsonFormat = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JSON_FORMAT_UNKNOWN"] = 0; + values[valuesById[1] = "ALLOW"] = 1; + values[valuesById[2] = "LEGACY_BEST_EFFORT"] = 2; + return values; + })(); + + return FeatureSet; + })(); + + protobuf.FeatureSetDefaults = (function() { + + /** + * Properties of a FeatureSetDefaults. + * @memberof google.protobuf + * @interface IFeatureSetDefaults + * @property {Array.|null} [defaults] FeatureSetDefaults defaults + * @property {google.protobuf.Edition|null} [minimumEdition] FeatureSetDefaults minimumEdition + * @property {google.protobuf.Edition|null} [maximumEdition] FeatureSetDefaults maximumEdition + */ + + /** + * Constructs a new FeatureSetDefaults. + * @memberof google.protobuf + * @classdesc Represents a FeatureSetDefaults. + * @implements IFeatureSetDefaults + * @constructor + * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set + */ + function FeatureSetDefaults(properties) { + this.defaults = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSetDefaults defaults. + * @member {Array.} defaults + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.defaults = $util.emptyArray; + + /** + * FeatureSetDefaults minimumEdition. + * @member {google.protobuf.Edition} minimumEdition + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.minimumEdition = 0; + + /** + * FeatureSetDefaults maximumEdition. + * @member {google.protobuf.Edition} maximumEdition + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.maximumEdition = 0; + + /** + * Creates a new FeatureSetDefaults instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults instance + */ + FeatureSetDefaults.create = function create(properties) { + return new FeatureSetDefaults(properties); + }; + + /** + * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetDefaults.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.defaults != null && message.defaults.length) + for (var i = 0; i < message.defaults.length; ++i) + $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.encode(message.defaults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.minimumEdition != null && Object.hasOwnProperty.call(message, "minimumEdition")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.minimumEdition); + if (message.maximumEdition != null && Object.hasOwnProperty.call(message, "maximumEdition")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maximumEdition); + return writer; + }; + + /** + * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetDefaults.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetDefaults.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.defaults && message.defaults.length)) + message.defaults = []; + message.defaults.push($root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.decode(reader, reader.uint32())); + break; + } + case 4: { + message.minimumEdition = reader.int32(); + break; + } + case 5: { + message.maximumEdition = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetDefaults.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSetDefaults message. + * @function verify + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSetDefaults.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.defaults != null && message.hasOwnProperty("defaults")) { + if (!Array.isArray(message.defaults)) + return "defaults: array expected"; + for (var i = 0; i < message.defaults.length; ++i) { + var error = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify(message.defaults[i]); + if (error) + return "defaults." + error; + } + } + if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) + switch (message.minimumEdition) { + default: + return "minimumEdition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) + switch (message.maximumEdition) { + default: + return "maximumEdition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + return null; + }; + + /** + * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + */ + FeatureSetDefaults.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSetDefaults) + return object; + var message = new $root.google.protobuf.FeatureSetDefaults(); + if (object.defaults) { + if (!Array.isArray(object.defaults)) + throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: array expected"); + message.defaults = []; + for (var i = 0; i < object.defaults.length; ++i) { + if (typeof object.defaults[i] !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: object expected"); + message.defaults[i] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fromObject(object.defaults[i]); + } + } + switch (object.minimumEdition) { + default: + if (typeof object.minimumEdition === "number") { + message.minimumEdition = object.minimumEdition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.minimumEdition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.minimumEdition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.minimumEdition = 999; + break; + case "EDITION_2023": + case 1000: + message.minimumEdition = 1000; + break; + case "EDITION_2024": + case 1001: + message.minimumEdition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.minimumEdition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.minimumEdition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.minimumEdition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.minimumEdition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.minimumEdition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.minimumEdition = 2147483647; + break; + } + switch (object.maximumEdition) { + default: + if (typeof object.maximumEdition === "number") { + message.maximumEdition = object.maximumEdition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.maximumEdition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.maximumEdition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.maximumEdition = 999; + break; + case "EDITION_2023": + case 1000: + message.maximumEdition = 1000; + break; + case "EDITION_2024": + case 1001: + message.maximumEdition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.maximumEdition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.maximumEdition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.maximumEdition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.maximumEdition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.maximumEdition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.maximumEdition = 2147483647; + break; + } + return message; + }; + + /** + * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.FeatureSetDefaults} message FeatureSetDefaults + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSetDefaults.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.defaults = []; + if (options.defaults) { + object.minimumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.maximumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.defaults && message.defaults.length) { + object.defaults = []; + for (var j = 0; j < message.defaults.length; ++j) + object.defaults[j] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.toObject(message.defaults[j], options); + } + if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) + object.minimumEdition = options.enums === String ? $root.google.protobuf.Edition[message.minimumEdition] === undefined ? message.minimumEdition : $root.google.protobuf.Edition[message.minimumEdition] : message.minimumEdition; + if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) + object.maximumEdition = options.enums === String ? $root.google.protobuf.Edition[message.maximumEdition] === undefined ? message.maximumEdition : $root.google.protobuf.Edition[message.maximumEdition] : message.maximumEdition; + return object; + }; + + /** + * Converts this FeatureSetDefaults to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSetDefaults + * @instance + * @returns {Object.} JSON object + */ + FeatureSetDefaults.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSetDefaults + * @function getTypeUrl + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSetDefaults.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults"; + }; + + FeatureSetDefaults.FeatureSetEditionDefault = (function() { + + /** + * Properties of a FeatureSetEditionDefault. + * @memberof google.protobuf.FeatureSetDefaults + * @interface IFeatureSetEditionDefault + * @property {google.protobuf.Edition|null} [edition] FeatureSetEditionDefault edition + * @property {google.protobuf.IFeatureSet|null} [features] FeatureSetEditionDefault features + */ + + /** + * Constructs a new FeatureSetEditionDefault. + * @memberof google.protobuf.FeatureSetDefaults + * @classdesc Represents a FeatureSetEditionDefault. + * @implements IFeatureSetEditionDefault + * @constructor + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set + */ + function FeatureSetEditionDefault(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSetEditionDefault edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.edition = 0; + + /** + * FeatureSetEditionDefault features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.features = null; + + /** + * Creates a new FeatureSetEditionDefault instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault instance + */ + FeatureSetEditionDefault.create = function create(properties) { + return new FeatureSetEditionDefault(properties); + }; + + /** + * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetEditionDefault.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetEditionDefault.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetEditionDefault.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.edition = reader.int32(); + break; + } + case 2: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetEditionDefault.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSetEditionDefault message. + * @function verify + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSetEditionDefault.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + return null; + }; + + /** + * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + */ + FeatureSetEditionDefault.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault) + return object; + var message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + return message; + }; + + /** + * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} message FeatureSetEditionDefault + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSetEditionDefault.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.features = null; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this FeatureSetEditionDefault to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + * @returns {Object.} JSON object + */ + FeatureSetEditionDefault.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSetEditionDefault + * @function getTypeUrl + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSetEditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault"; + }; + + return FeatureSetEditionDefault; + })(); + + return FeatureSetDefaults; + })(); + + protobuf.SourceCodeInfo = (function() { + + /** + * Properties of a SourceCodeInfo. + * @memberof google.protobuf + * @interface ISourceCodeInfo + * @property {Array.|null} [location] SourceCodeInfo location + */ + + /** + * Constructs a new SourceCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a SourceCodeInfo. + * @implements ISourceCodeInfo + * @constructor + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + */ + function SourceCodeInfo(properties) { + this.location = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SourceCodeInfo location. + * @member {Array.} location + * @memberof google.protobuf.SourceCodeInfo + * @instance + */ + SourceCodeInfo.prototype.location = $util.emptyArray; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance + */ + SourceCodeInfo.create = function create(properties) { + return new SourceCodeInfo(properties); + }; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.location != null && message.location.length) + for (var i = 0; i < message.location.length; ++i) + $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.location && message.location.length)) + message.location = []; + message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SourceCodeInfo message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SourceCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.location != null && message.hasOwnProperty("location")) { + if (!Array.isArray(message.location)) + return "location: array expected"; + for (var i = 0; i < message.location.length; ++i) { + var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]); + if (error) + return "location." + error; + } + } + return null; + }; + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + */ + SourceCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo) + return object; + var message = new $root.google.protobuf.SourceCodeInfo(); + if (object.location) { + if (!Array.isArray(object.location)) + throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); + message.location = []; + for (var i = 0; i < object.location.length; ++i) { + if (typeof object.location[i] !== "object") + throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); + message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SourceCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.location = []; + if (message.location && message.location.length) { + object.location = []; + for (var j = 0; j < message.location.length; ++j) + object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options); + } + return object; + }; + + /** + * Converts this SourceCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo + * @instance + * @returns {Object.} JSON object + */ + SourceCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SourceCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SourceCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo"; + }; + + SourceCodeInfo.Location = (function() { + + /** + * Properties of a Location. + * @memberof google.protobuf.SourceCodeInfo + * @interface ILocation + * @property {Array.|null} [path] Location path + * @property {Array.|null} [span] Location span + * @property {string|null} [leadingComments] Location leadingComments + * @property {string|null} [trailingComments] Location trailingComments + * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments + */ + + /** + * Constructs a new Location. + * @memberof google.protobuf.SourceCodeInfo + * @classdesc Represents a Location. + * @implements ILocation + * @constructor + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + */ + function Location(properties) { + this.path = []; + this.span = []; + this.leadingDetachedComments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Location path. + * @member {Array.} path + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.path = $util.emptyArray; + + /** + * Location span. + * @member {Array.} span + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.span = $util.emptyArray; + + /** + * Location leadingComments. + * @member {string} leadingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingComments = ""; + + /** + * Location trailingComments. + * @member {string} trailingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.trailingComments = ""; + + /** + * Location leadingDetachedComments. + * @member {Array.} leadingDetachedComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingDetachedComments = $util.emptyArray; + + /** + * Creates a new Location instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo.Location} Location instance + */ + Location.create = function create(properties) { + return new Location(properties); + }; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.span != null && message.span.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.span.length; ++i) + writer.int32(message.span[i]); + writer.ldelim(); + } + if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); + if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); + if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); + return writer; + }; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Location message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + if (!(message.span && message.span.length)) + message.span = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.span.push(reader.int32()); + } else + message.span.push(reader.int32()); + break; + } + case 3: { + message.leadingComments = reader.string(); + break; + } + case 4: { + message.trailingComments = reader.string(); + break; + } + case 6: { + if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) + message.leadingDetachedComments = []; + message.leadingDetachedComments.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Location message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Location.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.span != null && message.hasOwnProperty("span")) { + if (!Array.isArray(message.span)) + return "span: array expected"; + for (var i = 0; i < message.span.length; ++i) + if (!$util.isInteger(message.span[i])) + return "span: integer[] expected"; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + if (!$util.isString(message.leadingComments)) + return "leadingComments: string expected"; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + if (!$util.isString(message.trailingComments)) + return "trailingComments: string expected"; + if (message.leadingDetachedComments != null && message.hasOwnProperty("leadingDetachedComments")) { + if (!Array.isArray(message.leadingDetachedComments)) + return "leadingDetachedComments: array expected"; + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + if (!$util.isString(message.leadingDetachedComments[i])) + return "leadingDetachedComments: string[] expected"; + } + return null; + }; + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo.Location} Location + */ + Location.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) + return object; + var message = new $root.google.protobuf.SourceCodeInfo.Location(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.span) { + if (!Array.isArray(object.span)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); + message.span = []; + for (var i = 0; i < object.span.length; ++i) + message.span[i] = object.span[i] | 0; + } + if (object.leadingComments != null) + message.leadingComments = String(object.leadingComments); + if (object.trailingComments != null) + message.trailingComments = String(object.trailingComments); + if (object.leadingDetachedComments) { + if (!Array.isArray(object.leadingDetachedComments)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected"); + message.leadingDetachedComments = []; + for (var i = 0; i < object.leadingDetachedComments.length; ++i) + message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]); + } + return message; + }; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.Location} message Location + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Location.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.path = []; + object.span = []; + object.leadingDetachedComments = []; + } + if (options.defaults) { + object.leadingComments = ""; + object.trailingComments = ""; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.span && message.span.length) { + object.span = []; + for (var j = 0; j < message.span.length; ++j) + object.span[j] = message.span[j]; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + object.leadingComments = message.leadingComments; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + object.trailingComments = message.trailingComments; + if (message.leadingDetachedComments && message.leadingDetachedComments.length) { + object.leadingDetachedComments = []; + for (var j = 0; j < message.leadingDetachedComments.length; ++j) + object.leadingDetachedComments[j] = message.leadingDetachedComments[j]; + } + return object; + }; + + /** + * Converts this Location to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + * @returns {Object.} JSON object + */ + Location.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Location + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Location.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo.Location"; + }; + + return Location; + })(); + + return SourceCodeInfo; + })(); + + protobuf.GeneratedCodeInfo = (function() { + + /** + * Properties of a GeneratedCodeInfo. + * @memberof google.protobuf + * @interface IGeneratedCodeInfo + * @property {Array.|null} [annotation] GeneratedCodeInfo annotation + */ + + /** + * Constructs a new GeneratedCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a GeneratedCodeInfo. + * @implements IGeneratedCodeInfo + * @constructor + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + */ + function GeneratedCodeInfo(properties) { + this.annotation = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GeneratedCodeInfo annotation. + * @member {Array.} annotation + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + */ + GeneratedCodeInfo.prototype.annotation = $util.emptyArray; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance + */ + GeneratedCodeInfo.create = function create(properties) { + return new GeneratedCodeInfo(properties); + }; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotation != null && message.annotation.length) + for (var i = 0; i < message.annotation.length; ++i) + $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.annotation && message.annotation.length)) + message.annotation = []; + message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GeneratedCodeInfo message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GeneratedCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.annotation != null && message.hasOwnProperty("annotation")) { + if (!Array.isArray(message.annotation)) + return "annotation: array expected"; + for (var i = 0; i < message.annotation.length; ++i) { + var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]); + if (error) + return "annotation." + error; + } + } + return null; + }; + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + */ + GeneratedCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo(); + if (object.annotation) { + if (!Array.isArray(object.annotation)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); + message.annotation = []; + for (var i = 0; i < object.annotation.length; ++i) { + if (typeof object.annotation[i] !== "object") + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); + message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GeneratedCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.annotation = []; + if (message.annotation && message.annotation.length) { + object.annotation = []; + for (var j = 0; j < message.annotation.length; ++j) + object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options); + } + return object; + }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + * @returns {Object.} JSON object + */ + GeneratedCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GeneratedCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo"; + }; + + GeneratedCodeInfo.Annotation = (function() { + + /** + * Properties of an Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @interface IAnnotation + * @property {Array.|null} [path] Annotation path + * @property {string|null} [sourceFile] Annotation sourceFile + * @property {number|null} [begin] Annotation begin + * @property {number|null} [end] Annotation end + * @property {google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null} [semantic] Annotation semantic + */ + + /** + * Constructs a new Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @classdesc Represents an Annotation. + * @implements IAnnotation + * @constructor + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + */ + function Annotation(properties) { + this.path = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Annotation path. + * @member {Array.} path + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.path = $util.emptyArray; + + /** + * Annotation sourceFile. + * @member {string} sourceFile + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.sourceFile = ""; + + /** + * Annotation begin. + * @member {number} begin + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.begin = 0; + + /** + * Annotation end. + * @member {number} end + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.end = 0; + + /** + * Annotation semantic. + * @member {google.protobuf.GeneratedCodeInfo.Annotation.Semantic} semantic + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.semantic = 0; + + /** + * Creates a new Annotation instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance + */ + Annotation.create = function create(properties) { + return new Annotation(properties); + }; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); + if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); + if (message.semantic != null && Object.hasOwnProperty.call(message, "semantic")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.semantic); + return writer; + }; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + message.sourceFile = reader.string(); + break; + } + case 3: { + message.begin = reader.int32(); + break; + } + case 4: { + message.end = reader.int32(); + break; + } + case 5: { + message.semantic = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Annotation message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Annotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + if (!$util.isString(message.sourceFile)) + return "sourceFile: string expected"; + if (message.begin != null && message.hasOwnProperty("begin")) + if (!$util.isInteger(message.begin)) + return "begin: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.semantic != null && message.hasOwnProperty("semantic")) + switch (message.semantic) { + default: + return "semantic: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + */ + Annotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.sourceFile != null) + message.sourceFile = String(object.sourceFile); + if (object.begin != null) + message.begin = object.begin | 0; + if (object.end != null) + message.end = object.end | 0; + switch (object.semantic) { + default: + if (typeof object.semantic === "number") { + message.semantic = object.semantic; + break; + } + break; + case "NONE": + case 0: + message.semantic = 0; + break; + case "SET": + case 1: + message.semantic = 1; + break; + case "ALIAS": + case 2: + message.semantic = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Annotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.path = []; + if (options.defaults) { + object.sourceFile = ""; + object.begin = 0; + object.end = 0; + object.semantic = options.enums === String ? "NONE" : 0; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + object.sourceFile = message.sourceFile; + if (message.begin != null && message.hasOwnProperty("begin")) + object.begin = message.begin; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.semantic != null && message.hasOwnProperty("semantic")) + object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] === undefined ? message.semantic : $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic; + return object; + }; + + /** + * Converts this Annotation to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + * @returns {Object.} JSON object + */ + Annotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Annotation + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Annotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo.Annotation"; + }; + + /** + * Semantic enum. + * @name google.protobuf.GeneratedCodeInfo.Annotation.Semantic + * @enum {number} + * @property {number} NONE=0 NONE value + * @property {number} SET=1 SET value + * @property {number} ALIAS=2 ALIAS value + */ + Annotation.Semantic = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "SET"] = 1; + values[valuesById[2] = "ALIAS"] = 2; + return values; + })(); + + return Annotation; + })(); + + return GeneratedCodeInfo; + })(); + + protobuf.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof google.protobuf + * @interface ITimestamp + * @property {number|Long|null} [seconds] Timestamp seconds + * @property {number|null} [nanos] Timestamp nanos + */ + + /** + * Constructs a new Timestamp. + * @memberof google.protobuf + * @classdesc Represents a Timestamp. + * @implements ITimestamp + * @constructor + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + */ + function Timestamp(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Timestamp seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Timestamp nanos. + * @member {number} nanos + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + * @returns {google.protobuf.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Timestamp message. + * @function verify + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Timestamp.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Timestamp} Timestamp + */ + Timestamp.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Timestamp) + return object; + var message = new $root.google.protobuf.Timestamp(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.Timestamp} message Timestamp + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Timestamp.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Timestamp to JSON. + * @function toJSON + * @memberof google.protobuf.Timestamp + * @instance + * @returns {Object.} JSON object + */ + Timestamp.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof google.protobuf.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Timestamp"; + }; + + return Timestamp; + })(); + + protobuf.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof google.protobuf + * @interface IDuration + * @property {number|Long|null} [seconds] Duration seconds + * @property {number|null} [nanos] Duration nanos + */ + + /** + * Constructs a new Duration. + * @memberof google.protobuf + * @classdesc Represents a Duration. + * @implements IDuration + * @constructor + * @param {google.protobuf.IDuration=} [properties] Properties to set + */ + function Duration(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Duration seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Duration nanos. + * @member {number} nanos + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.nanos = 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration=} [properties] Properties to set + * @returns {google.protobuf.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Duration message. + * @function verify + * @memberof google.protobuf.Duration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Duration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Duration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Duration} Duration + */ + Duration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Duration) + return object; + var message = new $root.google.protobuf.Duration(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.Duration} message Duration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Duration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Duration to JSON. + * @function toJSON + * @memberof google.protobuf.Duration + * @instance + * @returns {Object.} JSON object + */ + Duration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof google.protobuf.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Duration"; + }; + + return Duration; + })(); + + protobuf.FieldMask = (function() { + + /** + * Properties of a FieldMask. + * @memberof google.protobuf + * @interface IFieldMask + * @property {Array.|null} [paths] FieldMask paths + */ + + /** + * Constructs a new FieldMask. + * @memberof google.protobuf + * @classdesc Represents a FieldMask. + * @implements IFieldMask + * @constructor + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + */ + function FieldMask(properties) { + this.paths = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldMask paths. + * @member {Array.} paths + * @memberof google.protobuf.FieldMask + * @instance + */ + FieldMask.prototype.paths = $util.emptyArray; + + /** + * Creates a new FieldMask instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + * @returns {google.protobuf.FieldMask} FieldMask instance + */ + FieldMask.create = function create(properties) { + return new FieldMask(properties); + }; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.paths != null && message.paths.length) + for (var i = 0; i < message.paths.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.paths[i]); + return writer; + }; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldMask(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.paths && message.paths.length)) + message.paths = []; + message.paths.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldMask message. + * @function verify + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldMask.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.paths != null && message.hasOwnProperty("paths")) { + if (!Array.isArray(message.paths)) + return "paths: array expected"; + for (var i = 0; i < message.paths.length; ++i) + if (!$util.isString(message.paths[i])) + return "paths: string[] expected"; + } + return null; + }; + + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldMask} FieldMask + */ + FieldMask.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldMask) + return object; + var message = new $root.google.protobuf.FieldMask(); + if (object.paths) { + if (!Array.isArray(object.paths)) + throw TypeError(".google.protobuf.FieldMask.paths: array expected"); + message.paths = []; + for (var i = 0; i < object.paths.length; ++i) + message.paths[i] = String(object.paths[i]); + } + return message; + }; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.FieldMask} message FieldMask + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldMask.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.paths = []; + if (message.paths && message.paths.length) { + object.paths = []; + for (var j = 0; j < message.paths.length; ++j) + object.paths[j] = message.paths[j]; + } + return object; + }; + + /** + * Converts this FieldMask to JSON. + * @function toJSON + * @memberof google.protobuf.FieldMask + * @instance + * @returns {Object.} JSON object + */ + FieldMask.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldMask + * @function getTypeUrl + * @memberof google.protobuf.FieldMask + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldMask.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldMask"; + }; + + return FieldMask; + })(); + + protobuf.Any = (function() { + + /** + * Properties of an Any. + * @memberof google.protobuf + * @interface IAny + * @property {string|null} [type_url] Any type_url + * @property {Uint8Array|null} [value] Any value + */ + + /** + * Constructs a new Any. + * @memberof google.protobuf + * @classdesc Represents an Any. + * @implements IAny + * @constructor + * @param {google.protobuf.IAny=} [properties] Properties to set + */ + function Any(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Any type_url. + * @member {string} type_url + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.type_url = ""; + + /** + * Any value. + * @member {Uint8Array} value + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.value = $util.newBuffer([]); + + /** + * Creates a new Any instance using the specified properties. + * @function create + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny=} [properties] Properties to set + * @returns {google.protobuf.Any} Any instance + */ + Any.create = function create(properties) { + return new Any(properties); + }; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Any message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.type_url = reader.string(); + break; + } + case 2: { + message.value = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Any message. + * @function verify + * @memberof google.protobuf.Any + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Any.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type_url != null && message.hasOwnProperty("type_url")) + if (!$util.isString(message.type_url)) + return "type_url: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Any + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Any} Any + */ + Any.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Any) + return object; + var message = new $root.google.protobuf.Any(); + if (object.type_url != null) + message.type_url = String(object.type_url); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length >= 0) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.Any} message Any + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Any.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type_url = ""; + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + } + if (message.type_url != null && message.hasOwnProperty("type_url")) + object.type_url = message.type_url; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this Any to JSON. + * @function toJSON + * @memberof google.protobuf.Any + * @instance + * @returns {Object.} JSON object + */ + Any.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Any + * @function getTypeUrl + * @memberof google.protobuf.Any + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Any.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Any"; + }; + + return Any; + })(); + + protobuf.Empty = (function() { + + /** + * Properties of an Empty. + * @memberof google.protobuf + * @interface IEmpty + */ + + /** + * Constructs a new Empty. + * @memberof google.protobuf + * @classdesc Represents an Empty. + * @implements IEmpty + * @constructor + * @param {google.protobuf.IEmpty=} [properties] Properties to set + */ + function Empty(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new Empty instance using the specified properties. + * @function create + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty=} [properties] Properties to set + * @returns {google.protobuf.Empty} Empty instance + */ + Empty.create = function create(properties) { + return new Empty(properties); + }; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Empty message. + * @function verify + * @memberof google.protobuf.Empty + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Empty.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Empty + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Empty} Empty + */ + Empty.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Empty) + return object; + return new $root.google.protobuf.Empty(); + }; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.Empty} message Empty + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Empty.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Empty to JSON. + * @function toJSON + * @memberof google.protobuf.Empty + * @instance + * @returns {Object.} JSON object + */ + Empty.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Empty + * @function getTypeUrl + * @memberof google.protobuf.Empty + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Empty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Empty"; + }; + + return Empty; + })(); + + return protobuf; + })(); + + google.iam = (function() { + + /** + * Namespace iam. + * @memberof google + * @namespace + */ + var iam = {}; + + iam.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.iam + * @namespace + */ + var v1 = {}; + + v1.IAMPolicy = (function() { + + /** + * Constructs a new IAMPolicy service. + * @memberof google.iam.v1 + * @classdesc Represents a IAMPolicy + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function IAMPolicy(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (IAMPolicy.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = IAMPolicy; + + /** + * Creates new IAMPolicy service using the specified rpc implementation. + * @function create + * @memberof google.iam.v1.IAMPolicy + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {IAMPolicy} RPC service. Useful where requests and/or responses are streamed. + */ + IAMPolicy.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.iam.v1.IAMPolicy|setIamPolicy}. + * @memberof google.iam.v1.IAMPolicy + * @typedef SetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.iam.v1.IAMPolicy + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @param {google.iam.v1.IAMPolicy.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(IAMPolicy.prototype.setIamPolicy = function setIamPolicy(request, callback) { + return this.rpcCall(setIamPolicy, $root.google.iam.v1.SetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "SetIamPolicy" }); + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.iam.v1.IAMPolicy + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.iam.v1.IAMPolicy|getIamPolicy}. + * @memberof google.iam.v1.IAMPolicy + * @typedef GetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.iam.v1.IAMPolicy + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @param {google.iam.v1.IAMPolicy.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(IAMPolicy.prototype.getIamPolicy = function getIamPolicy(request, callback) { + return this.rpcCall(getIamPolicy, $root.google.iam.v1.GetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "GetIamPolicy" }); + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.iam.v1.IAMPolicy + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.iam.v1.IAMPolicy|testIamPermissions}. + * @memberof google.iam.v1.IAMPolicy + * @typedef TestIamPermissionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.TestIamPermissionsResponse} [response] TestIamPermissionsResponse + */ + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.iam.v1.IAMPolicy + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @param {google.iam.v1.IAMPolicy.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(IAMPolicy.prototype.testIamPermissions = function testIamPermissions(request, callback) { + return this.rpcCall(testIamPermissions, $root.google.iam.v1.TestIamPermissionsRequest, $root.google.iam.v1.TestIamPermissionsResponse, request, callback); + }, "name", { value: "TestIamPermissions" }); + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.iam.v1.IAMPolicy + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return IAMPolicy; + })(); + + v1.SetIamPolicyRequest = (function() { + + /** + * Properties of a SetIamPolicyRequest. + * @memberof google.iam.v1 + * @interface ISetIamPolicyRequest + * @property {string|null} [resource] SetIamPolicyRequest resource + * @property {google.iam.v1.IPolicy|null} [policy] SetIamPolicyRequest policy + * @property {google.protobuf.IFieldMask|null} [updateMask] SetIamPolicyRequest updateMask + */ + + /** + * Constructs a new SetIamPolicyRequest. + * @memberof google.iam.v1 + * @classdesc Represents a SetIamPolicyRequest. + * @implements ISetIamPolicyRequest + * @constructor + * @param {google.iam.v1.ISetIamPolicyRequest=} [properties] Properties to set + */ + function SetIamPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SetIamPolicyRequest resource. + * @member {string} resource + * @memberof google.iam.v1.SetIamPolicyRequest + * @instance + */ + SetIamPolicyRequest.prototype.resource = ""; + + /** + * SetIamPolicyRequest policy. + * @member {google.iam.v1.IPolicy|null|undefined} policy + * @memberof google.iam.v1.SetIamPolicyRequest + * @instance + */ + SetIamPolicyRequest.prototype.policy = null; + + /** + * SetIamPolicyRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.iam.v1.SetIamPolicyRequest + * @instance + */ + SetIamPolicyRequest.prototype.updateMask = null; + + /** + * Creates a new SetIamPolicyRequest instance using the specified properties. + * @function create + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {google.iam.v1.ISetIamPolicyRequest=} [properties] Properties to set + * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest instance + */ + SetIamPolicyRequest.create = function create(properties) { + return new SetIamPolicyRequest(properties); + }; + + /** + * Encodes the specified SetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {google.iam.v1.ISetIamPolicyRequest} message SetIamPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetIamPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); + if (message.policy != null && Object.hasOwnProperty.call(message, "policy")) + $root.google.iam.v1.Policy.encode(message.policy, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {google.iam.v1.ISetIamPolicyRequest} message SetIamPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetIamPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetIamPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetIamPolicyRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.SetIamPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.resource = reader.string(); + break; + } + case 2: { + message.policy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetIamPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetIamPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetIamPolicyRequest message. + * @function verify + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetIamPolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.policy != null && message.hasOwnProperty("policy")) { + var error = $root.google.iam.v1.Policy.verify(message.policy); + if (error) + return "policy." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates a SetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest + */ + SetIamPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.SetIamPolicyRequest) + return object; + var message = new $root.google.iam.v1.SetIamPolicyRequest(); + if (object.resource != null) + message.resource = String(object.resource); + if (object.policy != null) { + if (typeof object.policy !== "object") + throw TypeError(".google.iam.v1.SetIamPolicyRequest.policy: object expected"); + message.policy = $root.google.iam.v1.Policy.fromObject(object.policy); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.iam.v1.SetIamPolicyRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from a SetIamPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {google.iam.v1.SetIamPolicyRequest} message SetIamPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetIamPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.resource = ""; + object.policy = null; + object.updateMask = null; + } + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.policy != null && message.hasOwnProperty("policy")) + object.policy = $root.google.iam.v1.Policy.toObject(message.policy, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this SetIamPolicyRequest to JSON. + * @function toJSON + * @memberof google.iam.v1.SetIamPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + SetIamPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SetIamPolicyRequest + * @function getTypeUrl + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SetIamPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.SetIamPolicyRequest"; + }; + + return SetIamPolicyRequest; + })(); + + v1.GetIamPolicyRequest = (function() { + + /** + * Properties of a GetIamPolicyRequest. + * @memberof google.iam.v1 + * @interface IGetIamPolicyRequest + * @property {string|null} [resource] GetIamPolicyRequest resource + * @property {google.iam.v1.IGetPolicyOptions|null} [options] GetIamPolicyRequest options + */ + + /** + * Constructs a new GetIamPolicyRequest. + * @memberof google.iam.v1 + * @classdesc Represents a GetIamPolicyRequest. + * @implements IGetIamPolicyRequest + * @constructor + * @param {google.iam.v1.IGetIamPolicyRequest=} [properties] Properties to set + */ + function GetIamPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIamPolicyRequest resource. + * @member {string} resource + * @memberof google.iam.v1.GetIamPolicyRequest + * @instance + */ + GetIamPolicyRequest.prototype.resource = ""; + + /** + * GetIamPolicyRequest options. + * @member {google.iam.v1.IGetPolicyOptions|null|undefined} options + * @memberof google.iam.v1.GetIamPolicyRequest + * @instance + */ + GetIamPolicyRequest.prototype.options = null; + + /** + * Creates a new GetIamPolicyRequest instance using the specified properties. + * @function create + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {google.iam.v1.IGetIamPolicyRequest=} [properties] Properties to set + * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest instance + */ + GetIamPolicyRequest.create = function create(properties) { + return new GetIamPolicyRequest(properties); + }; + + /** + * Encodes the specified GetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {google.iam.v1.IGetIamPolicyRequest} message GetIamPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIamPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.iam.v1.GetPolicyOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {google.iam.v1.IGetIamPolicyRequest} message GetIamPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIamPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIamPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIamPolicyRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.GetIamPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.resource = reader.string(); + break; + } + case 2: { + message.options = $root.google.iam.v1.GetPolicyOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIamPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIamPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIamPolicyRequest message. + * @function verify + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIamPolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.iam.v1.GetPolicyOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates a GetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest + */ + GetIamPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.GetIamPolicyRequest) + return object; + var message = new $root.google.iam.v1.GetIamPolicyRequest(); + if (object.resource != null) + message.resource = String(object.resource); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.iam.v1.GetIamPolicyRequest.options: object expected"); + message.options = $root.google.iam.v1.GetPolicyOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from a GetIamPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {google.iam.v1.GetIamPolicyRequest} message GetIamPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIamPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.resource = ""; + object.options = null; + } + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.iam.v1.GetPolicyOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this GetIamPolicyRequest to JSON. + * @function toJSON + * @memberof google.iam.v1.GetIamPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + GetIamPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetIamPolicyRequest + * @function getTypeUrl + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetIamPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.GetIamPolicyRequest"; + }; + + return GetIamPolicyRequest; + })(); + + v1.TestIamPermissionsRequest = (function() { + + /** + * Properties of a TestIamPermissionsRequest. + * @memberof google.iam.v1 + * @interface ITestIamPermissionsRequest + * @property {string|null} [resource] TestIamPermissionsRequest resource + * @property {Array.|null} [permissions] TestIamPermissionsRequest permissions + */ + + /** + * Constructs a new TestIamPermissionsRequest. + * @memberof google.iam.v1 + * @classdesc Represents a TestIamPermissionsRequest. + * @implements ITestIamPermissionsRequest + * @constructor + * @param {google.iam.v1.ITestIamPermissionsRequest=} [properties] Properties to set + */ + function TestIamPermissionsRequest(properties) { + this.permissions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TestIamPermissionsRequest resource. + * @member {string} resource + * @memberof google.iam.v1.TestIamPermissionsRequest + * @instance + */ + TestIamPermissionsRequest.prototype.resource = ""; + + /** + * TestIamPermissionsRequest permissions. + * @member {Array.} permissions + * @memberof google.iam.v1.TestIamPermissionsRequest + * @instance + */ + TestIamPermissionsRequest.prototype.permissions = $util.emptyArray; + + /** + * Creates a new TestIamPermissionsRequest instance using the specified properties. + * @function create + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {google.iam.v1.ITestIamPermissionsRequest=} [properties] Properties to set + * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest instance + */ + TestIamPermissionsRequest.create = function create(properties) { + return new TestIamPermissionsRequest(properties); + }; + + /** + * Encodes the specified TestIamPermissionsRequest message. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {google.iam.v1.ITestIamPermissionsRequest} message TestIamPermissionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestIamPermissionsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); + if (message.permissions != null && message.permissions.length) + for (var i = 0; i < message.permissions.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.permissions[i]); + return writer; + }; + + /** + * Encodes the specified TestIamPermissionsRequest message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {google.iam.v1.ITestIamPermissionsRequest} message TestIamPermissionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestIamPermissionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TestIamPermissionsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestIamPermissionsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.TestIamPermissionsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.resource = reader.string(); + break; + } + case 2: { + if (!(message.permissions && message.permissions.length)) + message.permissions = []; + message.permissions.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TestIamPermissionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestIamPermissionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TestIamPermissionsRequest message. + * @function verify + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TestIamPermissionsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.permissions != null && message.hasOwnProperty("permissions")) { + if (!Array.isArray(message.permissions)) + return "permissions: array expected"; + for (var i = 0; i < message.permissions.length; ++i) + if (!$util.isString(message.permissions[i])) + return "permissions: string[] expected"; + } + return null; + }; + + /** + * Creates a TestIamPermissionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest + */ + TestIamPermissionsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.TestIamPermissionsRequest) + return object; + var message = new $root.google.iam.v1.TestIamPermissionsRequest(); + if (object.resource != null) + message.resource = String(object.resource); + if (object.permissions) { + if (!Array.isArray(object.permissions)) + throw TypeError(".google.iam.v1.TestIamPermissionsRequest.permissions: array expected"); + message.permissions = []; + for (var i = 0; i < object.permissions.length; ++i) + message.permissions[i] = String(object.permissions[i]); + } + return message; + }; + + /** + * Creates a plain object from a TestIamPermissionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {google.iam.v1.TestIamPermissionsRequest} message TestIamPermissionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TestIamPermissionsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.permissions = []; + if (options.defaults) + object.resource = ""; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.permissions && message.permissions.length) { + object.permissions = []; + for (var j = 0; j < message.permissions.length; ++j) + object.permissions[j] = message.permissions[j]; + } + return object; + }; + + /** + * Converts this TestIamPermissionsRequest to JSON. + * @function toJSON + * @memberof google.iam.v1.TestIamPermissionsRequest + * @instance + * @returns {Object.} JSON object + */ + TestIamPermissionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TestIamPermissionsRequest + * @function getTypeUrl + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TestIamPermissionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.TestIamPermissionsRequest"; + }; + + return TestIamPermissionsRequest; + })(); + + v1.TestIamPermissionsResponse = (function() { + + /** + * Properties of a TestIamPermissionsResponse. + * @memberof google.iam.v1 + * @interface ITestIamPermissionsResponse + * @property {Array.|null} [permissions] TestIamPermissionsResponse permissions + */ + + /** + * Constructs a new TestIamPermissionsResponse. + * @memberof google.iam.v1 + * @classdesc Represents a TestIamPermissionsResponse. + * @implements ITestIamPermissionsResponse + * @constructor + * @param {google.iam.v1.ITestIamPermissionsResponse=} [properties] Properties to set + */ + function TestIamPermissionsResponse(properties) { + this.permissions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TestIamPermissionsResponse permissions. + * @member {Array.} permissions + * @memberof google.iam.v1.TestIamPermissionsResponse + * @instance + */ + TestIamPermissionsResponse.prototype.permissions = $util.emptyArray; + + /** + * Creates a new TestIamPermissionsResponse instance using the specified properties. + * @function create + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {google.iam.v1.ITestIamPermissionsResponse=} [properties] Properties to set + * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse instance + */ + TestIamPermissionsResponse.create = function create(properties) { + return new TestIamPermissionsResponse(properties); + }; + + /** + * Encodes the specified TestIamPermissionsResponse message. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {google.iam.v1.ITestIamPermissionsResponse} message TestIamPermissionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestIamPermissionsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.permissions != null && message.permissions.length) + for (var i = 0; i < message.permissions.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.permissions[i]); + return writer; + }; + + /** + * Encodes the specified TestIamPermissionsResponse message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {google.iam.v1.ITestIamPermissionsResponse} message TestIamPermissionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestIamPermissionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TestIamPermissionsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestIamPermissionsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.TestIamPermissionsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.permissions && message.permissions.length)) + message.permissions = []; + message.permissions.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TestIamPermissionsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestIamPermissionsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TestIamPermissionsResponse message. + * @function verify + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TestIamPermissionsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.permissions != null && message.hasOwnProperty("permissions")) { + if (!Array.isArray(message.permissions)) + return "permissions: array expected"; + for (var i = 0; i < message.permissions.length; ++i) + if (!$util.isString(message.permissions[i])) + return "permissions: string[] expected"; + } + return null; + }; + + /** + * Creates a TestIamPermissionsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse + */ + TestIamPermissionsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.TestIamPermissionsResponse) + return object; + var message = new $root.google.iam.v1.TestIamPermissionsResponse(); + if (object.permissions) { + if (!Array.isArray(object.permissions)) + throw TypeError(".google.iam.v1.TestIamPermissionsResponse.permissions: array expected"); + message.permissions = []; + for (var i = 0; i < object.permissions.length; ++i) + message.permissions[i] = String(object.permissions[i]); + } + return message; + }; + + /** + * Creates a plain object from a TestIamPermissionsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {google.iam.v1.TestIamPermissionsResponse} message TestIamPermissionsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TestIamPermissionsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.permissions = []; + if (message.permissions && message.permissions.length) { + object.permissions = []; + for (var j = 0; j < message.permissions.length; ++j) + object.permissions[j] = message.permissions[j]; + } + return object; + }; + + /** + * Converts this TestIamPermissionsResponse to JSON. + * @function toJSON + * @memberof google.iam.v1.TestIamPermissionsResponse + * @instance + * @returns {Object.} JSON object + */ + TestIamPermissionsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TestIamPermissionsResponse + * @function getTypeUrl + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TestIamPermissionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.TestIamPermissionsResponse"; + }; + + return TestIamPermissionsResponse; + })(); + + v1.GetPolicyOptions = (function() { + + /** + * Properties of a GetPolicyOptions. + * @memberof google.iam.v1 + * @interface IGetPolicyOptions + * @property {number|null} [requestedPolicyVersion] GetPolicyOptions requestedPolicyVersion + */ + + /** + * Constructs a new GetPolicyOptions. + * @memberof google.iam.v1 + * @classdesc Represents a GetPolicyOptions. + * @implements IGetPolicyOptions + * @constructor + * @param {google.iam.v1.IGetPolicyOptions=} [properties] Properties to set + */ + function GetPolicyOptions(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetPolicyOptions requestedPolicyVersion. + * @member {number} requestedPolicyVersion + * @memberof google.iam.v1.GetPolicyOptions + * @instance + */ + GetPolicyOptions.prototype.requestedPolicyVersion = 0; + + /** + * Creates a new GetPolicyOptions instance using the specified properties. + * @function create + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {google.iam.v1.IGetPolicyOptions=} [properties] Properties to set + * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions instance + */ + GetPolicyOptions.create = function create(properties) { + return new GetPolicyOptions(properties); + }; + + /** + * Encodes the specified GetPolicyOptions message. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {google.iam.v1.IGetPolicyOptions} message GetPolicyOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPolicyOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestedPolicyVersion != null && Object.hasOwnProperty.call(message, "requestedPolicyVersion")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.requestedPolicyVersion); + return writer; + }; + + /** + * Encodes the specified GetPolicyOptions message, length delimited. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {google.iam.v1.IGetPolicyOptions} message GetPolicyOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPolicyOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetPolicyOptions message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPolicyOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.GetPolicyOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.requestedPolicyVersion = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetPolicyOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPolicyOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetPolicyOptions message. + * @function verify + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetPolicyOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.requestedPolicyVersion != null && message.hasOwnProperty("requestedPolicyVersion")) + if (!$util.isInteger(message.requestedPolicyVersion)) + return "requestedPolicyVersion: integer expected"; + return null; + }; + + /** + * Creates a GetPolicyOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions + */ + GetPolicyOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.GetPolicyOptions) + return object; + var message = new $root.google.iam.v1.GetPolicyOptions(); + if (object.requestedPolicyVersion != null) + message.requestedPolicyVersion = object.requestedPolicyVersion | 0; + return message; + }; + + /** + * Creates a plain object from a GetPolicyOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {google.iam.v1.GetPolicyOptions} message GetPolicyOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetPolicyOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.requestedPolicyVersion = 0; + if (message.requestedPolicyVersion != null && message.hasOwnProperty("requestedPolicyVersion")) + object.requestedPolicyVersion = message.requestedPolicyVersion; + return object; + }; + + /** + * Converts this GetPolicyOptions to JSON. + * @function toJSON + * @memberof google.iam.v1.GetPolicyOptions + * @instance + * @returns {Object.} JSON object + */ + GetPolicyOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetPolicyOptions + * @function getTypeUrl + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetPolicyOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.GetPolicyOptions"; + }; + + return GetPolicyOptions; + })(); + + v1.Policy = (function() { + + /** + * Properties of a Policy. + * @memberof google.iam.v1 + * @interface IPolicy + * @property {number|null} [version] Policy version + * @property {Array.|null} [bindings] Policy bindings + * @property {Array.|null} [auditConfigs] Policy auditConfigs + * @property {Uint8Array|null} [etag] Policy etag + */ + + /** + * Constructs a new Policy. + * @memberof google.iam.v1 + * @classdesc Represents a Policy. + * @implements IPolicy + * @constructor + * @param {google.iam.v1.IPolicy=} [properties] Properties to set + */ + function Policy(properties) { + this.bindings = []; + this.auditConfigs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Policy version. + * @member {number} version + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.version = 0; + + /** + * Policy bindings. + * @member {Array.} bindings + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.bindings = $util.emptyArray; + + /** + * Policy auditConfigs. + * @member {Array.} auditConfigs + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.auditConfigs = $util.emptyArray; + + /** + * Policy etag. + * @member {Uint8Array} etag + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.etag = $util.newBuffer([]); + + /** + * Creates a new Policy instance using the specified properties. + * @function create + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.IPolicy=} [properties] Properties to set + * @returns {google.iam.v1.Policy} Policy instance + */ + Policy.create = function create(properties) { + return new Policy(properties); + }; + + /** + * Encodes the specified Policy message. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.IPolicy} message Policy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Policy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.version); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.etag); + if (message.bindings != null && message.bindings.length) + for (var i = 0; i < message.bindings.length; ++i) + $root.google.iam.v1.Binding.encode(message.bindings[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.auditConfigs != null && message.auditConfigs.length) + for (var i = 0; i < message.auditConfigs.length; ++i) + $root.google.iam.v1.AuditConfig.encode(message.auditConfigs[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Policy message, length delimited. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.IPolicy} message Policy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Policy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Policy message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.Policy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.Policy} Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Policy.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.Policy(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.version = reader.int32(); + break; + } + case 4: { + if (!(message.bindings && message.bindings.length)) + message.bindings = []; + message.bindings.push($root.google.iam.v1.Binding.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.auditConfigs && message.auditConfigs.length)) + message.auditConfigs = []; + message.auditConfigs.push($root.google.iam.v1.AuditConfig.decode(reader, reader.uint32())); + break; + } + case 3: { + message.etag = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Policy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.Policy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.Policy} Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Policy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Policy message. + * @function verify + * @memberof google.iam.v1.Policy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Policy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isInteger(message.version)) + return "version: integer expected"; + if (message.bindings != null && message.hasOwnProperty("bindings")) { + if (!Array.isArray(message.bindings)) + return "bindings: array expected"; + for (var i = 0; i < message.bindings.length; ++i) { + var error = $root.google.iam.v1.Binding.verify(message.bindings[i]); + if (error) + return "bindings." + error; + } + } + if (message.auditConfigs != null && message.hasOwnProperty("auditConfigs")) { + if (!Array.isArray(message.auditConfigs)) + return "auditConfigs: array expected"; + for (var i = 0; i < message.auditConfigs.length; ++i) { + var error = $root.google.iam.v1.AuditConfig.verify(message.auditConfigs[i]); + if (error) + return "auditConfigs." + error; + } + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!(message.etag && typeof message.etag.length === "number" || $util.isString(message.etag))) + return "etag: buffer expected"; + return null; + }; + + /** + * Creates a Policy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.Policy + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.Policy} Policy + */ + Policy.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.Policy) + return object; + var message = new $root.google.iam.v1.Policy(); + if (object.version != null) + message.version = object.version | 0; + if (object.bindings) { + if (!Array.isArray(object.bindings)) + throw TypeError(".google.iam.v1.Policy.bindings: array expected"); + message.bindings = []; + for (var i = 0; i < object.bindings.length; ++i) { + if (typeof object.bindings[i] !== "object") + throw TypeError(".google.iam.v1.Policy.bindings: object expected"); + message.bindings[i] = $root.google.iam.v1.Binding.fromObject(object.bindings[i]); + } + } + if (object.auditConfigs) { + if (!Array.isArray(object.auditConfigs)) + throw TypeError(".google.iam.v1.Policy.auditConfigs: array expected"); + message.auditConfigs = []; + for (var i = 0; i < object.auditConfigs.length; ++i) { + if (typeof object.auditConfigs[i] !== "object") + throw TypeError(".google.iam.v1.Policy.auditConfigs: object expected"); + message.auditConfigs[i] = $root.google.iam.v1.AuditConfig.fromObject(object.auditConfigs[i]); + } + } + if (object.etag != null) + if (typeof object.etag === "string") + $util.base64.decode(object.etag, message.etag = $util.newBuffer($util.base64.length(object.etag)), 0); + else if (object.etag.length >= 0) + message.etag = object.etag; + return message; + }; + + /** + * Creates a plain object from a Policy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.Policy} message Policy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Policy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.bindings = []; + object.auditConfigs = []; + } + if (options.defaults) { + object.version = 0; + if (options.bytes === String) + object.etag = ""; + else { + object.etag = []; + if (options.bytes !== Array) + object.etag = $util.newBuffer(object.etag); + } + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = options.bytes === String ? $util.base64.encode(message.etag, 0, message.etag.length) : options.bytes === Array ? Array.prototype.slice.call(message.etag) : message.etag; + if (message.bindings && message.bindings.length) { + object.bindings = []; + for (var j = 0; j < message.bindings.length; ++j) + object.bindings[j] = $root.google.iam.v1.Binding.toObject(message.bindings[j], options); + } + if (message.auditConfigs && message.auditConfigs.length) { + object.auditConfigs = []; + for (var j = 0; j < message.auditConfigs.length; ++j) + object.auditConfigs[j] = $root.google.iam.v1.AuditConfig.toObject(message.auditConfigs[j], options); + } + return object; + }; + + /** + * Converts this Policy to JSON. + * @function toJSON + * @memberof google.iam.v1.Policy + * @instance + * @returns {Object.} JSON object + */ + Policy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Policy + * @function getTypeUrl + * @memberof google.iam.v1.Policy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Policy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.Policy"; + }; + + return Policy; + })(); + + v1.Binding = (function() { + + /** + * Properties of a Binding. + * @memberof google.iam.v1 + * @interface IBinding + * @property {string|null} [role] Binding role + * @property {Array.|null} [members] Binding members + * @property {google.type.IExpr|null} [condition] Binding condition + */ + + /** + * Constructs a new Binding. + * @memberof google.iam.v1 + * @classdesc Represents a Binding. + * @implements IBinding + * @constructor + * @param {google.iam.v1.IBinding=} [properties] Properties to set + */ + function Binding(properties) { + this.members = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Binding role. + * @member {string} role + * @memberof google.iam.v1.Binding + * @instance + */ + Binding.prototype.role = ""; + + /** + * Binding members. + * @member {Array.} members + * @memberof google.iam.v1.Binding + * @instance + */ + Binding.prototype.members = $util.emptyArray; + + /** + * Binding condition. + * @member {google.type.IExpr|null|undefined} condition + * @memberof google.iam.v1.Binding + * @instance + */ + Binding.prototype.condition = null; + + /** + * Creates a new Binding instance using the specified properties. + * @function create + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.IBinding=} [properties] Properties to set + * @returns {google.iam.v1.Binding} Binding instance + */ + Binding.create = function create(properties) { + return new Binding(properties); + }; + + /** + * Encodes the specified Binding message. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.IBinding} message Binding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Binding.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.role != null && Object.hasOwnProperty.call(message, "role")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.role); + if (message.members != null && message.members.length) + for (var i = 0; i < message.members.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.members[i]); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + $root.google.type.Expr.encode(message.condition, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Binding message, length delimited. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.IBinding} message Binding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Binding.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Binding message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.Binding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.Binding} Binding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Binding.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.Binding(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.role = reader.string(); + break; + } + case 2: { + if (!(message.members && message.members.length)) + message.members = []; + message.members.push(reader.string()); + break; + } + case 3: { + message.condition = $root.google.type.Expr.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Binding message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.Binding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.Binding} Binding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Binding.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Binding message. + * @function verify + * @memberof google.iam.v1.Binding + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Binding.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.role != null && message.hasOwnProperty("role")) + if (!$util.isString(message.role)) + return "role: string expected"; + if (message.members != null && message.hasOwnProperty("members")) { + if (!Array.isArray(message.members)) + return "members: array expected"; + for (var i = 0; i < message.members.length; ++i) + if (!$util.isString(message.members[i])) + return "members: string[] expected"; + } + if (message.condition != null && message.hasOwnProperty("condition")) { + var error = $root.google.type.Expr.verify(message.condition); + if (error) + return "condition." + error; + } + return null; + }; + + /** + * Creates a Binding message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.Binding + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.Binding} Binding + */ + Binding.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.Binding) + return object; + var message = new $root.google.iam.v1.Binding(); + if (object.role != null) + message.role = String(object.role); + if (object.members) { + if (!Array.isArray(object.members)) + throw TypeError(".google.iam.v1.Binding.members: array expected"); + message.members = []; + for (var i = 0; i < object.members.length; ++i) + message.members[i] = String(object.members[i]); + } + if (object.condition != null) { + if (typeof object.condition !== "object") + throw TypeError(".google.iam.v1.Binding.condition: object expected"); + message.condition = $root.google.type.Expr.fromObject(object.condition); + } + return message; + }; + + /** + * Creates a plain object from a Binding message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.Binding} message Binding + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Binding.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.members = []; + if (options.defaults) { + object.role = ""; + object.condition = null; + } + if (message.role != null && message.hasOwnProperty("role")) + object.role = message.role; + if (message.members && message.members.length) { + object.members = []; + for (var j = 0; j < message.members.length; ++j) + object.members[j] = message.members[j]; + } + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = $root.google.type.Expr.toObject(message.condition, options); + return object; + }; + + /** + * Converts this Binding to JSON. + * @function toJSON + * @memberof google.iam.v1.Binding + * @instance + * @returns {Object.} JSON object + */ + Binding.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Binding + * @function getTypeUrl + * @memberof google.iam.v1.Binding + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Binding.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.Binding"; + }; + + return Binding; + })(); + + v1.AuditConfig = (function() { + + /** + * Properties of an AuditConfig. + * @memberof google.iam.v1 + * @interface IAuditConfig + * @property {string|null} [service] AuditConfig service + * @property {Array.|null} [auditLogConfigs] AuditConfig auditLogConfigs + */ + + /** + * Constructs a new AuditConfig. + * @memberof google.iam.v1 + * @classdesc Represents an AuditConfig. + * @implements IAuditConfig + * @constructor + * @param {google.iam.v1.IAuditConfig=} [properties] Properties to set + */ + function AuditConfig(properties) { + this.auditLogConfigs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AuditConfig service. + * @member {string} service + * @memberof google.iam.v1.AuditConfig + * @instance + */ + AuditConfig.prototype.service = ""; + + /** + * AuditConfig auditLogConfigs. + * @member {Array.} auditLogConfigs + * @memberof google.iam.v1.AuditConfig + * @instance + */ + AuditConfig.prototype.auditLogConfigs = $util.emptyArray; + + /** + * Creates a new AuditConfig instance using the specified properties. + * @function create + * @memberof google.iam.v1.AuditConfig + * @static + * @param {google.iam.v1.IAuditConfig=} [properties] Properties to set + * @returns {google.iam.v1.AuditConfig} AuditConfig instance + */ + AuditConfig.create = function create(properties) { + return new AuditConfig(properties); + }; + + /** + * Encodes the specified AuditConfig message. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.AuditConfig + * @static + * @param {google.iam.v1.IAuditConfig} message AuditConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.service != null && Object.hasOwnProperty.call(message, "service")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.service); + if (message.auditLogConfigs != null && message.auditLogConfigs.length) + for (var i = 0; i < message.auditLogConfigs.length; ++i) + $root.google.iam.v1.AuditLogConfig.encode(message.auditLogConfigs[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AuditConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.AuditConfig + * @static + * @param {google.iam.v1.IAuditConfig} message AuditConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuditConfig message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.AuditConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.AuditConfig} AuditConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.AuditConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.service = reader.string(); + break; + } + case 3: { + if (!(message.auditLogConfigs && message.auditLogConfigs.length)) + message.auditLogConfigs = []; + message.auditLogConfigs.push($root.google.iam.v1.AuditLogConfig.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuditConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.AuditConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.AuditConfig} AuditConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuditConfig message. + * @function verify + * @memberof google.iam.v1.AuditConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuditConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.service != null && message.hasOwnProperty("service")) + if (!$util.isString(message.service)) + return "service: string expected"; + if (message.auditLogConfigs != null && message.hasOwnProperty("auditLogConfigs")) { + if (!Array.isArray(message.auditLogConfigs)) + return "auditLogConfigs: array expected"; + for (var i = 0; i < message.auditLogConfigs.length; ++i) { + var error = $root.google.iam.v1.AuditLogConfig.verify(message.auditLogConfigs[i]); + if (error) + return "auditLogConfigs." + error; + } + } + return null; + }; + + /** + * Creates an AuditConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.AuditConfig + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.AuditConfig} AuditConfig + */ + AuditConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.AuditConfig) + return object; + var message = new $root.google.iam.v1.AuditConfig(); + if (object.service != null) + message.service = String(object.service); + if (object.auditLogConfigs) { + if (!Array.isArray(object.auditLogConfigs)) + throw TypeError(".google.iam.v1.AuditConfig.auditLogConfigs: array expected"); + message.auditLogConfigs = []; + for (var i = 0; i < object.auditLogConfigs.length; ++i) { + if (typeof object.auditLogConfigs[i] !== "object") + throw TypeError(".google.iam.v1.AuditConfig.auditLogConfigs: object expected"); + message.auditLogConfigs[i] = $root.google.iam.v1.AuditLogConfig.fromObject(object.auditLogConfigs[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an AuditConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.AuditConfig + * @static + * @param {google.iam.v1.AuditConfig} message AuditConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuditConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.auditLogConfigs = []; + if (options.defaults) + object.service = ""; + if (message.service != null && message.hasOwnProperty("service")) + object.service = message.service; + if (message.auditLogConfigs && message.auditLogConfigs.length) { + object.auditLogConfigs = []; + for (var j = 0; j < message.auditLogConfigs.length; ++j) + object.auditLogConfigs[j] = $root.google.iam.v1.AuditLogConfig.toObject(message.auditLogConfigs[j], options); + } + return object; + }; + + /** + * Converts this AuditConfig to JSON. + * @function toJSON + * @memberof google.iam.v1.AuditConfig + * @instance + * @returns {Object.} JSON object + */ + AuditConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AuditConfig + * @function getTypeUrl + * @memberof google.iam.v1.AuditConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AuditConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.AuditConfig"; + }; + + return AuditConfig; + })(); + + v1.AuditLogConfig = (function() { + + /** + * Properties of an AuditLogConfig. + * @memberof google.iam.v1 + * @interface IAuditLogConfig + * @property {google.iam.v1.AuditLogConfig.LogType|null} [logType] AuditLogConfig logType + * @property {Array.|null} [exemptedMembers] AuditLogConfig exemptedMembers + */ + + /** + * Constructs a new AuditLogConfig. + * @memberof google.iam.v1 + * @classdesc Represents an AuditLogConfig. + * @implements IAuditLogConfig + * @constructor + * @param {google.iam.v1.IAuditLogConfig=} [properties] Properties to set + */ + function AuditLogConfig(properties) { + this.exemptedMembers = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AuditLogConfig logType. + * @member {google.iam.v1.AuditLogConfig.LogType} logType + * @memberof google.iam.v1.AuditLogConfig + * @instance + */ + AuditLogConfig.prototype.logType = 0; + + /** + * AuditLogConfig exemptedMembers. + * @member {Array.} exemptedMembers + * @memberof google.iam.v1.AuditLogConfig + * @instance + */ + AuditLogConfig.prototype.exemptedMembers = $util.emptyArray; + + /** + * Creates a new AuditLogConfig instance using the specified properties. + * @function create + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {google.iam.v1.IAuditLogConfig=} [properties] Properties to set + * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig instance + */ + AuditLogConfig.create = function create(properties) { + return new AuditLogConfig(properties); + }; + + /** + * Encodes the specified AuditLogConfig message. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {google.iam.v1.IAuditLogConfig} message AuditLogConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditLogConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.logType != null && Object.hasOwnProperty.call(message, "logType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.logType); + if (message.exemptedMembers != null && message.exemptedMembers.length) + for (var i = 0; i < message.exemptedMembers.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.exemptedMembers[i]); + return writer; + }; + + /** + * Encodes the specified AuditLogConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {google.iam.v1.IAuditLogConfig} message AuditLogConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditLogConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuditLogConfig message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditLogConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.AuditLogConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.logType = reader.int32(); + break; + } + case 2: { + if (!(message.exemptedMembers && message.exemptedMembers.length)) + message.exemptedMembers = []; + message.exemptedMembers.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuditLogConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditLogConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuditLogConfig message. + * @function verify + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuditLogConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.logType != null && message.hasOwnProperty("logType")) + switch (message.logType) { + default: + return "logType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.exemptedMembers != null && message.hasOwnProperty("exemptedMembers")) { + if (!Array.isArray(message.exemptedMembers)) + return "exemptedMembers: array expected"; + for (var i = 0; i < message.exemptedMembers.length; ++i) + if (!$util.isString(message.exemptedMembers[i])) + return "exemptedMembers: string[] expected"; + } + return null; + }; + + /** + * Creates an AuditLogConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig + */ + AuditLogConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.AuditLogConfig) + return object; + var message = new $root.google.iam.v1.AuditLogConfig(); + switch (object.logType) { + default: + if (typeof object.logType === "number") { + message.logType = object.logType; + break; + } + break; + case "LOG_TYPE_UNSPECIFIED": + case 0: + message.logType = 0; + break; + case "ADMIN_READ": + case 1: + message.logType = 1; + break; + case "DATA_WRITE": + case 2: + message.logType = 2; + break; + case "DATA_READ": + case 3: + message.logType = 3; + break; + } + if (object.exemptedMembers) { + if (!Array.isArray(object.exemptedMembers)) + throw TypeError(".google.iam.v1.AuditLogConfig.exemptedMembers: array expected"); + message.exemptedMembers = []; + for (var i = 0; i < object.exemptedMembers.length; ++i) + message.exemptedMembers[i] = String(object.exemptedMembers[i]); + } + return message; + }; + + /** + * Creates a plain object from an AuditLogConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {google.iam.v1.AuditLogConfig} message AuditLogConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuditLogConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.exemptedMembers = []; + if (options.defaults) + object.logType = options.enums === String ? "LOG_TYPE_UNSPECIFIED" : 0; + if (message.logType != null && message.hasOwnProperty("logType")) + object.logType = options.enums === String ? $root.google.iam.v1.AuditLogConfig.LogType[message.logType] === undefined ? message.logType : $root.google.iam.v1.AuditLogConfig.LogType[message.logType] : message.logType; + if (message.exemptedMembers && message.exemptedMembers.length) { + object.exemptedMembers = []; + for (var j = 0; j < message.exemptedMembers.length; ++j) + object.exemptedMembers[j] = message.exemptedMembers[j]; + } + return object; + }; + + /** + * Converts this AuditLogConfig to JSON. + * @function toJSON + * @memberof google.iam.v1.AuditLogConfig + * @instance + * @returns {Object.} JSON object + */ + AuditLogConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AuditLogConfig + * @function getTypeUrl + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AuditLogConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.AuditLogConfig"; + }; + + /** + * LogType enum. + * @name google.iam.v1.AuditLogConfig.LogType + * @enum {number} + * @property {number} LOG_TYPE_UNSPECIFIED=0 LOG_TYPE_UNSPECIFIED value + * @property {number} ADMIN_READ=1 ADMIN_READ value + * @property {number} DATA_WRITE=2 DATA_WRITE value + * @property {number} DATA_READ=3 DATA_READ value + */ + AuditLogConfig.LogType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LOG_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ADMIN_READ"] = 1; + values[valuesById[2] = "DATA_WRITE"] = 2; + values[valuesById[3] = "DATA_READ"] = 3; + return values; + })(); + + return AuditLogConfig; + })(); + + v1.PolicyDelta = (function() { + + /** + * Properties of a PolicyDelta. + * @memberof google.iam.v1 + * @interface IPolicyDelta + * @property {Array.|null} [bindingDeltas] PolicyDelta bindingDeltas + * @property {Array.|null} [auditConfigDeltas] PolicyDelta auditConfigDeltas + */ + + /** + * Constructs a new PolicyDelta. + * @memberof google.iam.v1 + * @classdesc Represents a PolicyDelta. + * @implements IPolicyDelta + * @constructor + * @param {google.iam.v1.IPolicyDelta=} [properties] Properties to set + */ + function PolicyDelta(properties) { + this.bindingDeltas = []; + this.auditConfigDeltas = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PolicyDelta bindingDeltas. + * @member {Array.} bindingDeltas + * @memberof google.iam.v1.PolicyDelta + * @instance + */ + PolicyDelta.prototype.bindingDeltas = $util.emptyArray; + + /** + * PolicyDelta auditConfigDeltas. + * @member {Array.} auditConfigDeltas + * @memberof google.iam.v1.PolicyDelta + * @instance + */ + PolicyDelta.prototype.auditConfigDeltas = $util.emptyArray; + + /** + * Creates a new PolicyDelta instance using the specified properties. + * @function create + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.IPolicyDelta=} [properties] Properties to set + * @returns {google.iam.v1.PolicyDelta} PolicyDelta instance + */ + PolicyDelta.create = function create(properties) { + return new PolicyDelta(properties); + }; + + /** + * Encodes the specified PolicyDelta message. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.IPolicyDelta} message PolicyDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PolicyDelta.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bindingDeltas != null && message.bindingDeltas.length) + for (var i = 0; i < message.bindingDeltas.length; ++i) + $root.google.iam.v1.BindingDelta.encode(message.bindingDeltas[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.auditConfigDeltas != null && message.auditConfigDeltas.length) + for (var i = 0; i < message.auditConfigDeltas.length; ++i) + $root.google.iam.v1.AuditConfigDelta.encode(message.auditConfigDeltas[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PolicyDelta message, length delimited. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.IPolicyDelta} message PolicyDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PolicyDelta.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PolicyDelta message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.PolicyDelta} PolicyDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PolicyDelta.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.PolicyDelta(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.bindingDeltas && message.bindingDeltas.length)) + message.bindingDeltas = []; + message.bindingDeltas.push($root.google.iam.v1.BindingDelta.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.auditConfigDeltas && message.auditConfigDeltas.length)) + message.auditConfigDeltas = []; + message.auditConfigDeltas.push($root.google.iam.v1.AuditConfigDelta.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PolicyDelta message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.PolicyDelta} PolicyDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PolicyDelta.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PolicyDelta message. + * @function verify + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PolicyDelta.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.bindingDeltas != null && message.hasOwnProperty("bindingDeltas")) { + if (!Array.isArray(message.bindingDeltas)) + return "bindingDeltas: array expected"; + for (var i = 0; i < message.bindingDeltas.length; ++i) { + var error = $root.google.iam.v1.BindingDelta.verify(message.bindingDeltas[i]); + if (error) + return "bindingDeltas." + error; + } + } + if (message.auditConfigDeltas != null && message.hasOwnProperty("auditConfigDeltas")) { + if (!Array.isArray(message.auditConfigDeltas)) + return "auditConfigDeltas: array expected"; + for (var i = 0; i < message.auditConfigDeltas.length; ++i) { + var error = $root.google.iam.v1.AuditConfigDelta.verify(message.auditConfigDeltas[i]); + if (error) + return "auditConfigDeltas." + error; + } + } + return null; + }; + + /** + * Creates a PolicyDelta message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.PolicyDelta} PolicyDelta + */ + PolicyDelta.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.PolicyDelta) + return object; + var message = new $root.google.iam.v1.PolicyDelta(); + if (object.bindingDeltas) { + if (!Array.isArray(object.bindingDeltas)) + throw TypeError(".google.iam.v1.PolicyDelta.bindingDeltas: array expected"); + message.bindingDeltas = []; + for (var i = 0; i < object.bindingDeltas.length; ++i) { + if (typeof object.bindingDeltas[i] !== "object") + throw TypeError(".google.iam.v1.PolicyDelta.bindingDeltas: object expected"); + message.bindingDeltas[i] = $root.google.iam.v1.BindingDelta.fromObject(object.bindingDeltas[i]); + } + } + if (object.auditConfigDeltas) { + if (!Array.isArray(object.auditConfigDeltas)) + throw TypeError(".google.iam.v1.PolicyDelta.auditConfigDeltas: array expected"); + message.auditConfigDeltas = []; + for (var i = 0; i < object.auditConfigDeltas.length; ++i) { + if (typeof object.auditConfigDeltas[i] !== "object") + throw TypeError(".google.iam.v1.PolicyDelta.auditConfigDeltas: object expected"); + message.auditConfigDeltas[i] = $root.google.iam.v1.AuditConfigDelta.fromObject(object.auditConfigDeltas[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a PolicyDelta message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.PolicyDelta} message PolicyDelta + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PolicyDelta.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.bindingDeltas = []; + object.auditConfigDeltas = []; + } + if (message.bindingDeltas && message.bindingDeltas.length) { + object.bindingDeltas = []; + for (var j = 0; j < message.bindingDeltas.length; ++j) + object.bindingDeltas[j] = $root.google.iam.v1.BindingDelta.toObject(message.bindingDeltas[j], options); + } + if (message.auditConfigDeltas && message.auditConfigDeltas.length) { + object.auditConfigDeltas = []; + for (var j = 0; j < message.auditConfigDeltas.length; ++j) + object.auditConfigDeltas[j] = $root.google.iam.v1.AuditConfigDelta.toObject(message.auditConfigDeltas[j], options); + } + return object; + }; + + /** + * Converts this PolicyDelta to JSON. + * @function toJSON + * @memberof google.iam.v1.PolicyDelta + * @instance + * @returns {Object.} JSON object + */ + PolicyDelta.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PolicyDelta + * @function getTypeUrl + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PolicyDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.PolicyDelta"; + }; + + return PolicyDelta; + })(); + + v1.BindingDelta = (function() { + + /** + * Properties of a BindingDelta. + * @memberof google.iam.v1 + * @interface IBindingDelta + * @property {google.iam.v1.BindingDelta.Action|null} [action] BindingDelta action + * @property {string|null} [role] BindingDelta role + * @property {string|null} [member] BindingDelta member + * @property {google.type.IExpr|null} [condition] BindingDelta condition + */ + + /** + * Constructs a new BindingDelta. + * @memberof google.iam.v1 + * @classdesc Represents a BindingDelta. + * @implements IBindingDelta + * @constructor + * @param {google.iam.v1.IBindingDelta=} [properties] Properties to set + */ + function BindingDelta(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BindingDelta action. + * @member {google.iam.v1.BindingDelta.Action} action + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.action = 0; + + /** + * BindingDelta role. + * @member {string} role + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.role = ""; + + /** + * BindingDelta member. + * @member {string} member + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.member = ""; + + /** + * BindingDelta condition. + * @member {google.type.IExpr|null|undefined} condition + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.condition = null; + + /** + * Creates a new BindingDelta instance using the specified properties. + * @function create + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.IBindingDelta=} [properties] Properties to set + * @returns {google.iam.v1.BindingDelta} BindingDelta instance + */ + BindingDelta.create = function create(properties) { + return new BindingDelta(properties); + }; + + /** + * Encodes the specified BindingDelta message. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.IBindingDelta} message BindingDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BindingDelta.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); + if (message.role != null && Object.hasOwnProperty.call(message, "role")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.role); + if (message.member != null && Object.hasOwnProperty.call(message, "member")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.member); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + $root.google.type.Expr.encode(message.condition, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BindingDelta message, length delimited. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.IBindingDelta} message BindingDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BindingDelta.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BindingDelta message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.BindingDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.BindingDelta} BindingDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BindingDelta.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.BindingDelta(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.action = reader.int32(); + break; + } + case 2: { + message.role = reader.string(); + break; + } + case 3: { + message.member = reader.string(); + break; + } + case 4: { + message.condition = $root.google.type.Expr.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BindingDelta message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.BindingDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.BindingDelta} BindingDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BindingDelta.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BindingDelta message. + * @function verify + * @memberof google.iam.v1.BindingDelta + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BindingDelta.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.action != null && message.hasOwnProperty("action")) + switch (message.action) { + default: + return "action: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.role != null && message.hasOwnProperty("role")) + if (!$util.isString(message.role)) + return "role: string expected"; + if (message.member != null && message.hasOwnProperty("member")) + if (!$util.isString(message.member)) + return "member: string expected"; + if (message.condition != null && message.hasOwnProperty("condition")) { + var error = $root.google.type.Expr.verify(message.condition); + if (error) + return "condition." + error; + } + return null; + }; + + /** + * Creates a BindingDelta message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.BindingDelta + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.BindingDelta} BindingDelta + */ + BindingDelta.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.BindingDelta) + return object; + var message = new $root.google.iam.v1.BindingDelta(); + switch (object.action) { + default: + if (typeof object.action === "number") { + message.action = object.action; + break; + } + break; + case "ACTION_UNSPECIFIED": + case 0: + message.action = 0; + break; + case "ADD": + case 1: + message.action = 1; + break; + case "REMOVE": + case 2: + message.action = 2; + break; + } + if (object.role != null) + message.role = String(object.role); + if (object.member != null) + message.member = String(object.member); + if (object.condition != null) { + if (typeof object.condition !== "object") + throw TypeError(".google.iam.v1.BindingDelta.condition: object expected"); + message.condition = $root.google.type.Expr.fromObject(object.condition); + } + return message; + }; + + /** + * Creates a plain object from a BindingDelta message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.BindingDelta} message BindingDelta + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BindingDelta.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.action = options.enums === String ? "ACTION_UNSPECIFIED" : 0; + object.role = ""; + object.member = ""; + object.condition = null; + } + if (message.action != null && message.hasOwnProperty("action")) + object.action = options.enums === String ? $root.google.iam.v1.BindingDelta.Action[message.action] === undefined ? message.action : $root.google.iam.v1.BindingDelta.Action[message.action] : message.action; + if (message.role != null && message.hasOwnProperty("role")) + object.role = message.role; + if (message.member != null && message.hasOwnProperty("member")) + object.member = message.member; + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = $root.google.type.Expr.toObject(message.condition, options); + return object; + }; + + /** + * Converts this BindingDelta to JSON. + * @function toJSON + * @memberof google.iam.v1.BindingDelta + * @instance + * @returns {Object.} JSON object + */ + BindingDelta.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BindingDelta + * @function getTypeUrl + * @memberof google.iam.v1.BindingDelta + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BindingDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.BindingDelta"; + }; + + /** + * Action enum. + * @name google.iam.v1.BindingDelta.Action + * @enum {number} + * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value + * @property {number} ADD=1 ADD value + * @property {number} REMOVE=2 REMOVE value + */ + BindingDelta.Action = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "ADD"] = 1; + values[valuesById[2] = "REMOVE"] = 2; + return values; + })(); + + return BindingDelta; + })(); + + v1.AuditConfigDelta = (function() { + + /** + * Properties of an AuditConfigDelta. + * @memberof google.iam.v1 + * @interface IAuditConfigDelta + * @property {google.iam.v1.AuditConfigDelta.Action|null} [action] AuditConfigDelta action + * @property {string|null} [service] AuditConfigDelta service + * @property {string|null} [exemptedMember] AuditConfigDelta exemptedMember + * @property {string|null} [logType] AuditConfigDelta logType + */ + + /** + * Constructs a new AuditConfigDelta. + * @memberof google.iam.v1 + * @classdesc Represents an AuditConfigDelta. + * @implements IAuditConfigDelta + * @constructor + * @param {google.iam.v1.IAuditConfigDelta=} [properties] Properties to set + */ + function AuditConfigDelta(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AuditConfigDelta action. + * @member {google.iam.v1.AuditConfigDelta.Action} action + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.action = 0; + + /** + * AuditConfigDelta service. + * @member {string} service + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.service = ""; + + /** + * AuditConfigDelta exemptedMember. + * @member {string} exemptedMember + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.exemptedMember = ""; + + /** + * AuditConfigDelta logType. + * @member {string} logType + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.logType = ""; + + /** + * Creates a new AuditConfigDelta instance using the specified properties. + * @function create + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.IAuditConfigDelta=} [properties] Properties to set + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta instance + */ + AuditConfigDelta.create = function create(properties) { + return new AuditConfigDelta(properties); + }; + + /** + * Encodes the specified AuditConfigDelta message. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.IAuditConfigDelta} message AuditConfigDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfigDelta.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); + if (message.service != null && Object.hasOwnProperty.call(message, "service")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.service); + if (message.exemptedMember != null && Object.hasOwnProperty.call(message, "exemptedMember")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.exemptedMember); + if (message.logType != null && Object.hasOwnProperty.call(message, "logType")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.logType); + return writer; + }; + + /** + * Encodes the specified AuditConfigDelta message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.IAuditConfigDelta} message AuditConfigDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfigDelta.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfigDelta.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.AuditConfigDelta(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.action = reader.int32(); + break; + } + case 2: { + message.service = reader.string(); + break; + } + case 3: { + message.exemptedMember = reader.string(); + break; + } + case 4: { + message.logType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfigDelta.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuditConfigDelta message. + * @function verify + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuditConfigDelta.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.action != null && message.hasOwnProperty("action")) + switch (message.action) { + default: + return "action: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.service != null && message.hasOwnProperty("service")) + if (!$util.isString(message.service)) + return "service: string expected"; + if (message.exemptedMember != null && message.hasOwnProperty("exemptedMember")) + if (!$util.isString(message.exemptedMember)) + return "exemptedMember: string expected"; + if (message.logType != null && message.hasOwnProperty("logType")) + if (!$util.isString(message.logType)) + return "logType: string expected"; + return null; + }; + + /** + * Creates an AuditConfigDelta message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta + */ + AuditConfigDelta.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.AuditConfigDelta) + return object; + var message = new $root.google.iam.v1.AuditConfigDelta(); + switch (object.action) { + default: + if (typeof object.action === "number") { + message.action = object.action; + break; + } + break; + case "ACTION_UNSPECIFIED": + case 0: + message.action = 0; + break; + case "ADD": + case 1: + message.action = 1; + break; + case "REMOVE": + case 2: + message.action = 2; + break; + } + if (object.service != null) + message.service = String(object.service); + if (object.exemptedMember != null) + message.exemptedMember = String(object.exemptedMember); + if (object.logType != null) + message.logType = String(object.logType); + return message; + }; + + /** + * Creates a plain object from an AuditConfigDelta message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.AuditConfigDelta} message AuditConfigDelta + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuditConfigDelta.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.action = options.enums === String ? "ACTION_UNSPECIFIED" : 0; + object.service = ""; + object.exemptedMember = ""; + object.logType = ""; + } + if (message.action != null && message.hasOwnProperty("action")) + object.action = options.enums === String ? $root.google.iam.v1.AuditConfigDelta.Action[message.action] === undefined ? message.action : $root.google.iam.v1.AuditConfigDelta.Action[message.action] : message.action; + if (message.service != null && message.hasOwnProperty("service")) + object.service = message.service; + if (message.exemptedMember != null && message.hasOwnProperty("exemptedMember")) + object.exemptedMember = message.exemptedMember; + if (message.logType != null && message.hasOwnProperty("logType")) + object.logType = message.logType; + return object; + }; + + /** + * Converts this AuditConfigDelta to JSON. + * @function toJSON + * @memberof google.iam.v1.AuditConfigDelta + * @instance + * @returns {Object.} JSON object + */ + AuditConfigDelta.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AuditConfigDelta + * @function getTypeUrl + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AuditConfigDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.AuditConfigDelta"; + }; + + /** + * Action enum. + * @name google.iam.v1.AuditConfigDelta.Action + * @enum {number} + * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value + * @property {number} ADD=1 ADD value + * @property {number} REMOVE=2 REMOVE value + */ + AuditConfigDelta.Action = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "ADD"] = 1; + values[valuesById[2] = "REMOVE"] = 2; + return values; + })(); + + return AuditConfigDelta; + })(); + + return v1; + })(); + + return iam; + })(); + + google.type = (function() { + + /** + * Namespace type. + * @memberof google + * @namespace + */ + var type = {}; + + type.Expr = (function() { + + /** + * Properties of an Expr. + * @memberof google.type + * @interface IExpr + * @property {string|null} [expression] Expr expression + * @property {string|null} [title] Expr title + * @property {string|null} [description] Expr description + * @property {string|null} [location] Expr location + */ + + /** + * Constructs a new Expr. + * @memberof google.type + * @classdesc Represents an Expr. + * @implements IExpr + * @constructor + * @param {google.type.IExpr=} [properties] Properties to set + */ + function Expr(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Expr expression. + * @member {string} expression + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.expression = ""; + + /** + * Expr title. + * @member {string} title + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.title = ""; + + /** + * Expr description. + * @member {string} description + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.description = ""; + + /** + * Expr location. + * @member {string} location + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.location = ""; + + /** + * Creates a new Expr instance using the specified properties. + * @function create + * @memberof google.type.Expr + * @static + * @param {google.type.IExpr=} [properties] Properties to set + * @returns {google.type.Expr} Expr instance + */ + Expr.create = function create(properties) { + return new Expr(properties); + }; + + /** + * Encodes the specified Expr message. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @function encode + * @memberof google.type.Expr + * @static + * @param {google.type.IExpr} message Expr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Expr.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.expression != null && Object.hasOwnProperty.call(message, "expression")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.expression); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.title); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.location); + return writer; + }; + + /** + * Encodes the specified Expr message, length delimited. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @function encodeDelimited + * @memberof google.type.Expr + * @static + * @param {google.type.IExpr} message Expr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Expr.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Expr message from the specified reader or buffer. + * @function decode + * @memberof google.type.Expr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.type.Expr} Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Expr.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.Expr(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.expression = reader.string(); + break; + } + case 2: { + message.title = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + message.location = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Expr message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.type.Expr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.type.Expr} Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Expr.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Expr message. + * @function verify + * @memberof google.type.Expr + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Expr.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.expression != null && message.hasOwnProperty("expression")) + if (!$util.isString(message.expression)) + return "expression: string expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + return null; + }; + + /** + * Creates an Expr message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.type.Expr + * @static + * @param {Object.} object Plain object + * @returns {google.type.Expr} Expr + */ + Expr.fromObject = function fromObject(object) { + if (object instanceof $root.google.type.Expr) + return object; + var message = new $root.google.type.Expr(); + if (object.expression != null) + message.expression = String(object.expression); + if (object.title != null) + message.title = String(object.title); + if (object.description != null) + message.description = String(object.description); + if (object.location != null) + message.location = String(object.location); + return message; + }; + + /** + * Creates a plain object from an Expr message. Also converts values to other types if specified. + * @function toObject + * @memberof google.type.Expr + * @static + * @param {google.type.Expr} message Expr + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Expr.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.expression = ""; + object.title = ""; + object.description = ""; + object.location = ""; + } + if (message.expression != null && message.hasOwnProperty("expression")) + object.expression = message.expression; + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this Expr to JSON. + * @function toJSON + * @memberof google.type.Expr + * @instance + * @returns {Object.} JSON object + */ + Expr.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Expr + * @function getTypeUrl + * @memberof google.type.Expr + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Expr.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.type.Expr"; + }; + + return Expr; + })(); + + return type; + })(); + + google.longrunning = (function() { + + /** + * Namespace longrunning. + * @memberof google + * @namespace + */ + var longrunning = {}; + + longrunning.Operations = (function() { + + /** + * Constructs a new Operations service. + * @memberof google.longrunning + * @classdesc Represents an Operations + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Operations(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Operations.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Operations; + + /** + * Creates new Operations service using the specified rpc implementation. + * @function create + * @memberof google.longrunning.Operations + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Operations} RPC service. Useful where requests and/or responses are streamed. + */ + Operations.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.longrunning.Operations|listOperations}. + * @memberof google.longrunning.Operations + * @typedef ListOperationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.ListOperationsResponse} [response] ListOperationsResponse + */ + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @param {google.longrunning.Operations.ListOperationsCallback} callback Node-style callback called with the error, if any, and ListOperationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.listOperations = function listOperations(request, callback) { + return this.rpcCall(listOperations, $root.google.longrunning.ListOperationsRequest, $root.google.longrunning.ListOperationsResponse, request, callback); + }, "name", { value: "ListOperations" }); + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|getOperation}. + * @memberof google.longrunning.Operations + * @typedef GetOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @param {google.longrunning.Operations.GetOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.getOperation = function getOperation(request, callback) { + return this.rpcCall(getOperation, $root.google.longrunning.GetOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "GetOperation" }); + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. + * @memberof google.longrunning.Operations + * @typedef DeleteOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @param {google.longrunning.Operations.DeleteOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.deleteOperation = function deleteOperation(request, callback) { + return this.rpcCall(deleteOperation, $root.google.longrunning.DeleteOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteOperation" }); + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. + * @memberof google.longrunning.Operations + * @typedef CancelOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @param {google.longrunning.Operations.CancelOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.cancelOperation = function cancelOperation(request, callback) { + return this.rpcCall(cancelOperation, $root.google.longrunning.CancelOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "CancelOperation" }); + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|waitOperation}. + * @memberof google.longrunning.Operations + * @typedef WaitOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @param {google.longrunning.Operations.WaitOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.waitOperation = function waitOperation(request, callback) { + return this.rpcCall(waitOperation, $root.google.longrunning.WaitOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "WaitOperation" }); + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Operations; + })(); + + longrunning.Operation = (function() { + + /** + * Properties of an Operation. + * @memberof google.longrunning + * @interface IOperation + * @property {string|null} [name] Operation name + * @property {google.protobuf.IAny|null} [metadata] Operation metadata + * @property {boolean|null} [done] Operation done + * @property {google.rpc.IStatus|null} [error] Operation error + * @property {google.protobuf.IAny|null} [response] Operation response + */ + + /** + * Constructs a new Operation. + * @memberof google.longrunning + * @classdesc Represents an Operation. + * @implements IOperation + * @constructor + * @param {google.longrunning.IOperation=} [properties] Properties to set + */ + function Operation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Operation name. + * @member {string} name + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.name = ""; + + /** + * Operation metadata. + * @member {google.protobuf.IAny|null|undefined} metadata + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.metadata = null; + + /** + * Operation done. + * @member {boolean} done + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.done = false; + + /** + * Operation error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.error = null; + + /** + * Operation response. + * @member {google.protobuf.IAny|null|undefined} response + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.response = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Operation result. + * @member {"error"|"response"|undefined} result + * @memberof google.longrunning.Operation + * @instance + */ + Object.defineProperty(Operation.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["error", "response"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Operation instance using the specified properties. + * @function create + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation=} [properties] Properties to set + * @returns {google.longrunning.Operation} Operation instance + */ + Operation.create = function create(properties) { + return new Operation(properties); + }; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @function encode + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.protobuf.Any.encode(message.metadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.done != null && Object.hasOwnProperty.call(message, "done")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.done); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.response != null && Object.hasOwnProperty.call(message, "response")) + $root.google.protobuf.Any.encode(message.response, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.Operation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.metadata = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } + case 3: { + message.done = reader.bool(); + break; + } + case 4: { + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 5: { + message.response = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Operation message. + * @function verify + * @memberof google.longrunning.Operation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Operation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.protobuf.Any.verify(message.metadata); + if (error) + return "metadata." + error; + } + if (message.done != null && message.hasOwnProperty("done")) + if (typeof message.done !== "boolean") + return "done: boolean expected"; + if (message.error != null && message.hasOwnProperty("error")) { + properties.result = 1; + { + var error = $root.google.rpc.Status.verify(message.error); + if (error) + return "error." + error; + } + } + if (message.response != null && message.hasOwnProperty("response")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.google.protobuf.Any.verify(message.response); + if (error) + return "response." + error; + } + } + return null; + }; + + /** + * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.Operation + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.Operation} Operation + */ + Operation.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.Operation) + return object; + var message = new $root.google.longrunning.Operation(); + if (object.name != null) + message.name = String(object.name); + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.longrunning.Operation.metadata: object expected"); + message.metadata = $root.google.protobuf.Any.fromObject(object.metadata); + } + if (object.done != null) + message.done = Boolean(object.done); + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.longrunning.Operation.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + if (object.response != null) { + if (typeof object.response !== "object") + throw TypeError(".google.longrunning.Operation.response: object expected"); + message.response = $root.google.protobuf.Any.fromObject(object.response); + } + return message; + }; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.Operation} message Operation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Operation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.metadata = null; + object.done = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.protobuf.Any.toObject(message.metadata, options); + if (message.done != null && message.hasOwnProperty("done")) + object.done = message.done; + if (message.error != null && message.hasOwnProperty("error")) { + object.error = $root.google.rpc.Status.toObject(message.error, options); + if (options.oneofs) + object.result = "error"; + } + if (message.response != null && message.hasOwnProperty("response")) { + object.response = $root.google.protobuf.Any.toObject(message.response, options); + if (options.oneofs) + object.result = "response"; + } + return object; + }; + + /** + * Converts this Operation to JSON. + * @function toJSON + * @memberof google.longrunning.Operation + * @instance + * @returns {Object.} JSON object + */ + Operation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Operation + * @function getTypeUrl + * @memberof google.longrunning.Operation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Operation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.Operation"; + }; + + return Operation; + })(); + + longrunning.GetOperationRequest = (function() { + + /** + * Properties of a GetOperationRequest. + * @memberof google.longrunning + * @interface IGetOperationRequest + * @property {string|null} [name] GetOperationRequest name + */ + + /** + * Constructs a new GetOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a GetOperationRequest. + * @implements IGetOperationRequest + * @constructor + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + */ + function GetOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetOperationRequest name. + * @member {string} name + * @memberof google.longrunning.GetOperationRequest + * @instance + */ + GetOperationRequest.prototype.name = ""; + + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest instance + */ + GetOperationRequest.create = function create(properties) { + return new GetOperationRequest(properties); + }; + + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.GetOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetOperationRequest message. + * @function verify + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + */ + GetOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.GetOperationRequest) + return object; + var message = new $root.google.longrunning.GetOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.GetOperationRequest} message GetOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.GetOperationRequest + * @instance + * @returns {Object.} JSON object + */ + GetOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.GetOperationRequest"; + }; + + return GetOperationRequest; + })(); + + longrunning.ListOperationsRequest = (function() { + + /** + * Properties of a ListOperationsRequest. + * @memberof google.longrunning + * @interface IListOperationsRequest + * @property {string|null} [name] ListOperationsRequest name + * @property {string|null} [filter] ListOperationsRequest filter + * @property {number|null} [pageSize] ListOperationsRequest pageSize + * @property {string|null} [pageToken] ListOperationsRequest pageToken + */ + + /** + * Constructs a new ListOperationsRequest. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsRequest. + * @implements IListOperationsRequest + * @constructor + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + */ + function ListOperationsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOperationsRequest name. + * @member {string} name + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.name = ""; + + /** + * ListOperationsRequest filter. + * @member {string} filter + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.filter = ""; + + /** + * ListOperationsRequest pageSize. + * @member {number} pageSize + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageSize = 0; + + /** + * ListOperationsRequest pageToken. + * @member {string} pageToken + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest instance + */ + ListOperationsRequest.create = function create(properties) { + return new ListOperationsRequest(properties); + }; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); + return writer; + }; + + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 4: { + message.name = reader.string(); + break; + } + case 1: { + message.filter = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOperationsRequest message. + * @function verify + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOperationsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + */ + ListOperationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.ListOperationsRequest) + return object; + var message = new $root.google.longrunning.ListOperationsRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.ListOperationsRequest} message ListOperationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOperationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + object.name = ""; + } + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this ListOperationsRequest to JSON. + * @function toJSON + * @memberof google.longrunning.ListOperationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListOperationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOperationsRequest + * @function getTypeUrl + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOperationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.ListOperationsRequest"; + }; + + return ListOperationsRequest; + })(); + + longrunning.ListOperationsResponse = (function() { + + /** + * Properties of a ListOperationsResponse. + * @memberof google.longrunning + * @interface IListOperationsResponse + * @property {Array.|null} [operations] ListOperationsResponse operations + * @property {string|null} [nextPageToken] ListOperationsResponse nextPageToken + */ + + /** + * Constructs a new ListOperationsResponse. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsResponse. + * @implements IListOperationsResponse + * @constructor + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + */ + function ListOperationsResponse(properties) { + this.operations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOperationsResponse operations. + * @member {Array.} operations + * @memberof google.longrunning.ListOperationsResponse + * @instance + */ + ListOperationsResponse.prototype.operations = $util.emptyArray; + + /** + * ListOperationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.longrunning.ListOperationsResponse + * @instance + */ + ListOperationsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @function create + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse instance + */ + ListOperationsResponse.create = function create(properties) { + return new ListOperationsResponse(properties); + }; + + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @function encode + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.operations != null && message.operations.length) + for (var i = 0; i < message.operations.length; ++i) + $root.google.longrunning.Operation.encode(message.operations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.operations && message.operations.length)) + message.operations = []; + message.operations.push($root.google.longrunning.Operation.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOperationsResponse message. + * @function verify + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOperationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.operations != null && message.hasOwnProperty("operations")) { + if (!Array.isArray(message.operations)) + return "operations: array expected"; + for (var i = 0; i < message.operations.length; ++i) { + var error = $root.google.longrunning.Operation.verify(message.operations[i]); + if (error) + return "operations." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + */ + ListOperationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.ListOperationsResponse) + return object; + var message = new $root.google.longrunning.ListOperationsResponse(); + if (object.operations) { + if (!Array.isArray(object.operations)) + throw TypeError(".google.longrunning.ListOperationsResponse.operations: array expected"); + message.operations = []; + for (var i = 0; i < object.operations.length; ++i) { + if (typeof object.operations[i] !== "object") + throw TypeError(".google.longrunning.ListOperationsResponse.operations: object expected"); + message.operations[i] = $root.google.longrunning.Operation.fromObject(object.operations[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.ListOperationsResponse} message ListOperationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOperationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.operations = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.operations && message.operations.length) { + object.operations = []; + for (var j = 0; j < message.operations.length; ++j) + object.operations[j] = $root.google.longrunning.Operation.toObject(message.operations[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListOperationsResponse to JSON. + * @function toJSON + * @memberof google.longrunning.ListOperationsResponse + * @instance + * @returns {Object.} JSON object + */ + ListOperationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOperationsResponse + * @function getTypeUrl + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOperationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.ListOperationsResponse"; + }; + + return ListOperationsResponse; + })(); + + longrunning.CancelOperationRequest = (function() { + + /** + * Properties of a CancelOperationRequest. + * @memberof google.longrunning + * @interface ICancelOperationRequest + * @property {string|null} [name] CancelOperationRequest name + */ + + /** + * Constructs a new CancelOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a CancelOperationRequest. + * @implements ICancelOperationRequest + * @constructor + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + */ + function CancelOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CancelOperationRequest name. + * @member {string} name + * @memberof google.longrunning.CancelOperationRequest + * @instance + */ + CancelOperationRequest.prototype.name = ""; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest instance + */ + CancelOperationRequest.create = function create(properties) { + return new CancelOperationRequest(properties); + }; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelOperationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.CancelOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CancelOperationRequest message. + * @function verify + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CancelOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + */ + CancelOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.CancelOperationRequest) + return object; + var message = new $root.google.longrunning.CancelOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.CancelOperationRequest} message CancelOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CancelOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this CancelOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.CancelOperationRequest + * @instance + * @returns {Object.} JSON object + */ + CancelOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CancelOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CancelOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.CancelOperationRequest"; + }; + + return CancelOperationRequest; + })(); + + longrunning.DeleteOperationRequest = (function() { + + /** + * Properties of a DeleteOperationRequest. + * @memberof google.longrunning + * @interface IDeleteOperationRequest + * @property {string|null} [name] DeleteOperationRequest name + */ + + /** + * Constructs a new DeleteOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a DeleteOperationRequest. + * @implements IDeleteOperationRequest + * @constructor + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set + */ + function DeleteOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteOperationRequest name. + * @member {string} name + * @memberof google.longrunning.DeleteOperationRequest + * @instance + */ + DeleteOperationRequest.prototype.name = ""; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest instance + */ + DeleteOperationRequest.create = function create(properties) { + return new DeleteOperationRequest(properties); + }; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.DeleteOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteOperationRequest message. + * @function verify + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + */ + DeleteOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.DeleteOperationRequest) + return object; + var message = new $root.google.longrunning.DeleteOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.DeleteOperationRequest} message DeleteOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.DeleteOperationRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.DeleteOperationRequest"; + }; + + return DeleteOperationRequest; + })(); + + longrunning.WaitOperationRequest = (function() { + + /** + * Properties of a WaitOperationRequest. + * @memberof google.longrunning + * @interface IWaitOperationRequest + * @property {string|null} [name] WaitOperationRequest name + * @property {google.protobuf.IDuration|null} [timeout] WaitOperationRequest timeout + */ + + /** + * Constructs a new WaitOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a WaitOperationRequest. + * @implements IWaitOperationRequest + * @constructor + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set + */ + function WaitOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WaitOperationRequest name. + * @member {string} name + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.name = ""; + + /** + * WaitOperationRequest timeout. + * @member {google.protobuf.IDuration|null|undefined} timeout + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.timeout = null; + + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest instance + */ + WaitOperationRequest.create = function create(properties) { + return new WaitOperationRequest(properties); + }; + + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) + $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitOperationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.WaitOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WaitOperationRequest message. + * @function verify + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WaitOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.timeout != null && message.hasOwnProperty("timeout")) { + var error = $root.google.protobuf.Duration.verify(message.timeout); + if (error) + return "timeout." + error; + } + return null; + }; + + /** + * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + */ + WaitOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.WaitOperationRequest) + return object; + var message = new $root.google.longrunning.WaitOperationRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.timeout != null) { + if (typeof object.timeout !== "object") + throw TypeError(".google.longrunning.WaitOperationRequest.timeout: object expected"); + message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); + } + return message; + }; + + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.WaitOperationRequest} message WaitOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WaitOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.timeout = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.timeout != null && message.hasOwnProperty("timeout")) + object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); + return object; + }; + + /** + * Converts this WaitOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.WaitOperationRequest + * @instance + * @returns {Object.} JSON object + */ + WaitOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WaitOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WaitOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.WaitOperationRequest"; + }; + + return WaitOperationRequest; + })(); + + longrunning.OperationInfo = (function() { + + /** + * Properties of an OperationInfo. + * @memberof google.longrunning + * @interface IOperationInfo + * @property {string|null} [responseType] OperationInfo responseType + * @property {string|null} [metadataType] OperationInfo metadataType + */ + + /** + * Constructs a new OperationInfo. + * @memberof google.longrunning + * @classdesc Represents an OperationInfo. + * @implements IOperationInfo + * @constructor + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + */ + function OperationInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OperationInfo responseType. + * @member {string} responseType + * @memberof google.longrunning.OperationInfo + * @instance + */ + OperationInfo.prototype.responseType = ""; + + /** + * OperationInfo metadataType. + * @member {string} metadataType + * @memberof google.longrunning.OperationInfo + * @instance + */ + OperationInfo.prototype.metadataType = ""; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @function create + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + * @returns {google.longrunning.OperationInfo} OperationInfo instance + */ + OperationInfo.create = function create(properties) { + return new OperationInfo(properties); + }; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @function encode + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.responseType != null && Object.hasOwnProperty.call(message, "responseType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseType); + if (message.metadataType != null && Object.hasOwnProperty.call(message, "metadataType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.metadataType); + return writer; + }; + + /** + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.OperationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.OperationInfo} OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.OperationInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.responseType = reader.string(); + break; + } + case 2: { + message.metadataType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.OperationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.OperationInfo} OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationInfo message. + * @function verify + * @memberof google.longrunning.OperationInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.responseType != null && message.hasOwnProperty("responseType")) + if (!$util.isString(message.responseType)) + return "responseType: string expected"; + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + if (!$util.isString(message.metadataType)) + return "metadataType: string expected"; + return null; + }; + + /** + * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.OperationInfo + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.OperationInfo} OperationInfo + */ + OperationInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.OperationInfo) + return object; + var message = new $root.google.longrunning.OperationInfo(); + if (object.responseType != null) + message.responseType = String(object.responseType); + if (object.metadataType != null) + message.metadataType = String(object.metadataType); + return message; + }; + + /** + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.OperationInfo} message OperationInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.responseType = ""; + object.metadataType = ""; + } + if (message.responseType != null && message.hasOwnProperty("responseType")) + object.responseType = message.responseType; + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + object.metadataType = message.metadataType; + return object; + }; + + /** + * Converts this OperationInfo to JSON. + * @function toJSON + * @memberof google.longrunning.OperationInfo + * @instance + * @returns {Object.} JSON object + */ + OperationInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OperationInfo + * @function getTypeUrl + * @memberof google.longrunning.OperationInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OperationInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.OperationInfo"; + }; + + return OperationInfo; + })(); + + return longrunning; + })(); + + google.rpc = (function() { + + /** + * Namespace rpc. + * @memberof google + * @namespace + */ + var rpc = {}; + + rpc.Status = (function() { + + /** + * Properties of a Status. + * @memberof google.rpc + * @interface IStatus + * @property {number|null} [code] Status code + * @property {string|null} [message] Status message + * @property {Array.|null} [details] Status details + */ + + /** + * Constructs a new Status. + * @memberof google.rpc + * @classdesc Represents a Status. + * @implements IStatus + * @constructor + * @param {google.rpc.IStatus=} [properties] Properties to set + */ + function Status(properties) { + this.details = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Status code. + * @member {number} code + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.code = 0; + + /** + * Status message. + * @member {string} message + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.message = ""; + + /** + * Status details. + * @member {Array.} details + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.details = $util.emptyArray; + + /** + * Creates a new Status instance using the specified properties. + * @function create + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus=} [properties] Properties to set + * @returns {google.rpc.Status} Status instance + */ + Status.create = function create(properties) { + return new Status(properties); + }; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encode + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); + if (message.details != null && message.details.length) + for (var i = 0; i < message.details.length; ++i) + $root.google.protobuf.Any.encode(message.details[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encodeDelimited + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Status message from the specified reader or buffer. + * @function decode + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.rpc.Status(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.code = reader.int32(); + break; + } + case 2: { + message.message = reader.string(); + break; + } + case 3: { + if (!(message.details && message.details.length)) + message.details = []; + message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Status message. + * @function verify + * @memberof google.rpc.Status + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Status.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + if (!$util.isInteger(message.code)) + return "code: integer expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.details != null && message.hasOwnProperty("details")) { + if (!Array.isArray(message.details)) + return "details: array expected"; + for (var i = 0; i < message.details.length; ++i) { + var error = $root.google.protobuf.Any.verify(message.details[i]); + if (error) + return "details." + error; + } + } + return null; + }; + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.rpc.Status + * @static + * @param {Object.} object Plain object + * @returns {google.rpc.Status} Status + */ + Status.fromObject = function fromObject(object) { + if (object instanceof $root.google.rpc.Status) + return object; + var message = new $root.google.rpc.Status(); + if (object.code != null) + message.code = object.code | 0; + if (object.message != null) + message.message = String(object.message); + if (object.details) { + if (!Array.isArray(object.details)) + throw TypeError(".google.rpc.Status.details: array expected"); + message.details = []; + for (var i = 0; i < object.details.length; ++i) { + if (typeof object.details[i] !== "object") + throw TypeError(".google.rpc.Status.details: object expected"); + message.details[i] = $root.google.protobuf.Any.fromObject(object.details[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @function toObject + * @memberof google.rpc.Status + * @static + * @param {google.rpc.Status} message Status + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Status.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.details = []; + if (options.defaults) { + object.code = 0; + object.message = ""; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = message.code; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.details && message.details.length) { + object.details = []; + for (var j = 0; j < message.details.length; ++j) + object.details[j] = $root.google.protobuf.Any.toObject(message.details[j], options); + } + return object; + }; + + /** + * Converts this Status to JSON. + * @function toJSON + * @memberof google.rpc.Status + * @instance + * @returns {Object.} JSON object + */ + Status.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Status + * @function getTypeUrl + * @memberof google.rpc.Status + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Status.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.rpc.Status"; + }; + + return Status; + })(); + + return rpc; + })(); + + return google; + })(); + + return $root; +}); diff --git a/owl-bot-staging/admin/instance/v1/protos/protos.json b/owl-bot-staging/admin/instance/v1/protos/protos.json new file mode 100644 index 000000000..5baf92e47 --- /dev/null +++ b/owl-bot-staging/admin/instance/v1/protos/protos.json @@ -0,0 +1,4167 @@ +{ + "nested": { + "google": { + "nested": { + "spanner": { + "nested": { + "admin": { + "nested": { + "instance": { + "nested": { + "v1": { + "options": { + "csharp_namespace": "Google.Cloud.Spanner.Admin.Instance.V1", + "go_package": "cloud.google.com/go/spanner/admin/instance/apiv1/instancepb;instancepb", + "java_multiple_files": true, + "java_outer_classname": "SpannerInstanceAdminProto", + "java_package": "com.google.spanner.admin.instance.v1", + "php_namespace": "Google\\Cloud\\Spanner\\Admin\\Instance\\V1", + "ruby_package": "Google::Cloud::Spanner::Admin::Instance::V1" + }, + "nested": { + "OperationProgress": { + "fields": { + "progressPercent": { + "type": "int32", + "id": 1 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + } + } + }, + "FulfillmentPeriod": { + "values": { + "FULFILLMENT_PERIOD_UNSPECIFIED": 0, + "FULFILLMENT_PERIOD_NORMAL": 1, + "FULFILLMENT_PERIOD_EXTENDED": 2 + } + }, + "ReplicaSelection": { + "fields": { + "location": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "InstanceAdmin": { + "options": { + "(google.api.default_host)": "spanner.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/spanner.admin" + }, + "methods": { + "ListInstanceConfigs": { + "requestType": "ListInstanceConfigsRequest", + "responseType": "ListInstanceConfigsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*}/instanceConfigs", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*}/instanceConfigs" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetInstanceConfig": { + "requestType": "GetInstanceConfigRequest", + "responseType": "InstanceConfig", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/instanceConfigs/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/instanceConfigs/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateInstanceConfig": { + "requestType": "CreateInstanceConfigRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*}/instanceConfigs", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent,instance_config,instance_config_id", + "(google.longrunning.operation_info).response_type": "google.spanner.admin.instance.v1.InstanceConfig", + "(google.longrunning.operation_info).metadata_type": "google.spanner.admin.instance.v1.CreateInstanceConfigMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*}/instanceConfigs", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent,instance_config,instance_config_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.spanner.admin.instance.v1.InstanceConfig", + "metadata_type": "google.spanner.admin.instance.v1.CreateInstanceConfigMetadata" + } + } + ] + }, + "UpdateInstanceConfig": { + "requestType": "UpdateInstanceConfigRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{instance_config.name=projects/*/instanceConfigs/*}", + "(google.api.http).body": "*", + "(google.api.method_signature)": "instance_config,update_mask", + "(google.longrunning.operation_info).response_type": "google.spanner.admin.instance.v1.InstanceConfig", + "(google.longrunning.operation_info).metadata_type": "google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{instance_config.name=projects/*/instanceConfigs/*}", + "body": "*" + } + }, + { + "(google.api.method_signature)": "instance_config,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.spanner.admin.instance.v1.InstanceConfig", + "metadata_type": "google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata" + } + } + ] + }, + "DeleteInstanceConfig": { + "requestType": "DeleteInstanceConfigRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/instanceConfigs/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/instanceConfigs/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListInstanceConfigOperations": { + "requestType": "ListInstanceConfigOperationsRequest", + "responseType": "ListInstanceConfigOperationsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*}/instanceConfigOperations", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*}/instanceConfigOperations" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "ListInstances": { + "requestType": "ListInstancesRequest", + "responseType": "ListInstancesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*}/instances", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*}/instances" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "ListInstancePartitions": { + "requestType": "ListInstancePartitionsRequest", + "responseType": "ListInstancePartitionsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/instances/*}/instancePartitions", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/instances/*}/instancePartitions" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetInstance": { + "requestType": "GetInstanceRequest", + "responseType": "Instance", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/instances/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/instances/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateInstance": { + "requestType": "CreateInstanceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*}/instances", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent,instance_id,instance", + "(google.longrunning.operation_info).response_type": "google.spanner.admin.instance.v1.Instance", + "(google.longrunning.operation_info).metadata_type": "google.spanner.admin.instance.v1.CreateInstanceMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*}/instances", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent,instance_id,instance" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.spanner.admin.instance.v1.Instance", + "metadata_type": "google.spanner.admin.instance.v1.CreateInstanceMetadata" + } + } + ] + }, + "UpdateInstance": { + "requestType": "UpdateInstanceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{instance.name=projects/*/instances/*}", + "(google.api.http).body": "*", + "(google.api.method_signature)": "instance,field_mask", + "(google.longrunning.operation_info).response_type": "google.spanner.admin.instance.v1.Instance", + "(google.longrunning.operation_info).metadata_type": "google.spanner.admin.instance.v1.UpdateInstanceMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{instance.name=projects/*/instances/*}", + "body": "*" + } + }, + { + "(google.api.method_signature)": "instance,field_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.spanner.admin.instance.v1.Instance", + "metadata_type": "google.spanner.admin.instance.v1.UpdateInstanceMetadata" + } + } + ] + }, + "DeleteInstance": { + "requestType": "DeleteInstanceRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/instances/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/instances/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "SetIamPolicy": { + "requestType": "google.iam.v1.SetIamPolicyRequest", + "responseType": "google.iam.v1.Policy", + "options": { + "(google.api.http).post": "/v1/{resource=projects/*/instances/*}:setIamPolicy", + "(google.api.http).body": "*", + "(google.api.method_signature)": "resource,policy" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{resource=projects/*/instances/*}:setIamPolicy", + "body": "*" + } + }, + { + "(google.api.method_signature)": "resource,policy" + } + ] + }, + "GetIamPolicy": { + "requestType": "google.iam.v1.GetIamPolicyRequest", + "responseType": "google.iam.v1.Policy", + "options": { + "(google.api.http).post": "/v1/{resource=projects/*/instances/*}:getIamPolicy", + "(google.api.http).body": "*", + "(google.api.method_signature)": "resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{resource=projects/*/instances/*}:getIamPolicy", + "body": "*" + } + }, + { + "(google.api.method_signature)": "resource" + } + ] + }, + "TestIamPermissions": { + "requestType": "google.iam.v1.TestIamPermissionsRequest", + "responseType": "google.iam.v1.TestIamPermissionsResponse", + "options": { + "(google.api.http).post": "/v1/{resource=projects/*/instances/*}:testIamPermissions", + "(google.api.http).body": "*", + "(google.api.method_signature)": "resource,permissions" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{resource=projects/*/instances/*}:testIamPermissions", + "body": "*" + } + }, + { + "(google.api.method_signature)": "resource,permissions" + } + ] + }, + "GetInstancePartition": { + "requestType": "GetInstancePartitionRequest", + "responseType": "InstancePartition", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/instances/*/instancePartitions/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/instances/*/instancePartitions/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateInstancePartition": { + "requestType": "CreateInstancePartitionRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/instances/*}/instancePartitions", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent,instance_partition,instance_partition_id", + "(google.longrunning.operation_info).response_type": "google.spanner.admin.instance.v1.InstancePartition", + "(google.longrunning.operation_info).metadata_type": "google.spanner.admin.instance.v1.CreateInstancePartitionMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/instances/*}/instancePartitions", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent,instance_partition,instance_partition_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.spanner.admin.instance.v1.InstancePartition", + "metadata_type": "google.spanner.admin.instance.v1.CreateInstancePartitionMetadata" + } + } + ] + }, + "DeleteInstancePartition": { + "requestType": "DeleteInstancePartitionRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/instances/*/instancePartitions/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/instances/*/instancePartitions/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateInstancePartition": { + "requestType": "UpdateInstancePartitionRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{instance_partition.name=projects/*/instances/*/instancePartitions/*}", + "(google.api.http).body": "*", + "(google.api.method_signature)": "instance_partition,field_mask", + "(google.longrunning.operation_info).response_type": "google.spanner.admin.instance.v1.InstancePartition", + "(google.longrunning.operation_info).metadata_type": "google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{instance_partition.name=projects/*/instances/*/instancePartitions/*}", + "body": "*" + } + }, + { + "(google.api.method_signature)": "instance_partition,field_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.spanner.admin.instance.v1.InstancePartition", + "metadata_type": "google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata" + } + } + ] + }, + "ListInstancePartitionOperations": { + "requestType": "ListInstancePartitionOperationsRequest", + "responseType": "ListInstancePartitionOperationsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/instances/*}/instancePartitionOperations", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/instances/*}/instancePartitionOperations" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "MoveInstance": { + "requestType": "MoveInstanceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/instances/*}:move", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "google.spanner.admin.instance.v1.MoveInstanceResponse", + "(google.longrunning.operation_info).metadata_type": "google.spanner.admin.instance.v1.MoveInstanceMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/instances/*}:move", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.spanner.admin.instance.v1.MoveInstanceResponse", + "metadata_type": "google.spanner.admin.instance.v1.MoveInstanceMetadata" + } + } + ] + } + } + }, + "ReplicaInfo": { + "fields": { + "location": { + "type": "string", + "id": 1 + }, + "type": { + "type": "ReplicaType", + "id": 2 + }, + "defaultLeaderLocation": { + "type": "bool", + "id": 3 + } + }, + "nested": { + "ReplicaType": { + "values": { + "TYPE_UNSPECIFIED": 0, + "READ_WRITE": 1, + "READ_ONLY": 2, + "WITNESS": 3 + } + } + } + }, + "InstanceConfig": { + "options": { + "(google.api.resource).type": "spanner.googleapis.com/InstanceConfig", + "(google.api.resource).pattern": "projects/{project}/instanceConfigs/{instance_config}", + "(google.api.resource).plural": "instanceConfigs", + "(google.api.resource).singular": "instanceConfig" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2 + }, + "configType": { + "type": "Type", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "replicas": { + "rule": "repeated", + "type": "ReplicaInfo", + "id": 3 + }, + "optionalReplicas": { + "rule": "repeated", + "type": "ReplicaInfo", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "baseConfig": { + "type": "string", + "id": 7, + "options": { + "(google.api.resource_reference).type": "spanner.googleapis.com/InstanceConfig" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 8 + }, + "etag": { + "type": "string", + "id": 9 + }, + "leaderOptions": { + "rule": "repeated", + "type": "string", + "id": 4 + }, + "reconciling": { + "type": "bool", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "State", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "freeInstanceAvailability": { + "type": "FreeInstanceAvailability", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "quorumType": { + "type": "QuorumType", + "id": 18, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "storageLimitPerProcessingUnit": { + "type": "int64", + "id": 19, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "GOOGLE_MANAGED": 1, + "USER_MANAGED": 2 + } + }, + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "CREATING": 1, + "READY": 2 + } + }, + "FreeInstanceAvailability": { + "values": { + "FREE_INSTANCE_AVAILABILITY_UNSPECIFIED": 0, + "AVAILABLE": 1, + "UNSUPPORTED": 2, + "DISABLED": 3, + "QUOTA_EXCEEDED": 4 + } + }, + "QuorumType": { + "values": { + "QUORUM_TYPE_UNSPECIFIED": 0, + "REGION": 1, + "DUAL_REGION": 2, + "MULTI_REGION": 3 + } + } + } + }, + "ReplicaComputeCapacity": { + "oneofs": { + "computeCapacity": { + "oneof": [ + "nodeCount", + "processingUnits" + ] + } + }, + "fields": { + "replicaSelection": { + "type": "ReplicaSelection", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "nodeCount": { + "type": "int32", + "id": 2 + }, + "processingUnits": { + "type": "int32", + "id": 3 + } + } + }, + "AutoscalingConfig": { + "fields": { + "autoscalingLimits": { + "type": "AutoscalingLimits", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "autoscalingTargets": { + "type": "AutoscalingTargets", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "asymmetricAutoscalingOptions": { + "rule": "repeated", + "type": "AsymmetricAutoscalingOption", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "AutoscalingLimits": { + "oneofs": { + "minLimit": { + "oneof": [ + "minNodes", + "minProcessingUnits" + ] + }, + "maxLimit": { + "oneof": [ + "maxNodes", + "maxProcessingUnits" + ] + } + }, + "fields": { + "minNodes": { + "type": "int32", + "id": 1 + }, + "minProcessingUnits": { + "type": "int32", + "id": 2 + }, + "maxNodes": { + "type": "int32", + "id": 3 + }, + "maxProcessingUnits": { + "type": "int32", + "id": 4 + } + } + }, + "AutoscalingTargets": { + "fields": { + "highPriorityCpuUtilizationPercent": { + "type": "int32", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "totalCpuUtilizationPercent": { + "type": "int32", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "storageUtilizationPercent": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "AsymmetricAutoscalingOption": { + "fields": { + "replicaSelection": { + "type": "ReplicaSelection", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "overrides": { + "type": "AutoscalingConfigOverrides", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "AutoscalingConfigOverrides": { + "fields": { + "autoscalingLimits": { + "type": "AutoscalingLimits", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "autoscalingTargetHighPriorityCpuUtilizationPercent": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "autoscalingTargetTotalCpuUtilizationPercent": { + "type": "int32", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "disableHighPriorityCpuAutoscaling": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "disableTotalCpuAutoscaling": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + } + } + }, + "Instance": { + "options": { + "(google.api.resource).type": "spanner.googleapis.com/Instance", + "(google.api.resource).pattern": "projects/{project}/instances/{instance}", + "(google.api.resource).plural": "instances", + "(google.api.resource).singular": "instance" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "config": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/InstanceConfig" + } + }, + "displayName": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "nodeCount": { + "type": "int32", + "id": 5 + }, + "processingUnits": { + "type": "int32", + "id": 9 + }, + "replicaComputeCapacity": { + "rule": "repeated", + "type": "ReplicaComputeCapacity", + "id": 19, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "autoscalingConfig": { + "type": "AutoscalingConfig", + "id": 17, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "state": { + "type": "State", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 7 + }, + "instanceType": { + "type": "InstanceType", + "id": 10 + }, + "endpointUris": { + "rule": "repeated", + "type": "string", + "id": 8 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "freeInstanceMetadata": { + "type": "FreeInstanceMetadata", + "id": 13 + }, + "edition": { + "type": "Edition", + "id": 20, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "defaultBackupScheduleType": { + "type": "DefaultBackupScheduleType", + "id": 23, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "CREATING": 1, + "READY": 2 + } + }, + "InstanceType": { + "values": { + "INSTANCE_TYPE_UNSPECIFIED": 0, + "PROVISIONED": 1, + "FREE_INSTANCE": 2 + } + }, + "Edition": { + "values": { + "EDITION_UNSPECIFIED": 0, + "STANDARD": 1, + "ENTERPRISE": 2, + "ENTERPRISE_PLUS": 3 + } + }, + "DefaultBackupScheduleType": { + "values": { + "DEFAULT_BACKUP_SCHEDULE_TYPE_UNSPECIFIED": 0, + "NONE": 1, + "AUTOMATIC": 2 + } + } + } + }, + "ListInstanceConfigsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListInstanceConfigsResponse": { + "fields": { + "instanceConfigs": { + "rule": "repeated", + "type": "InstanceConfig", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetInstanceConfigRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/InstanceConfig" + } + } + } + }, + "CreateInstanceConfigRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" + } + }, + "instanceConfigId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "instanceConfig": { + "type": "InstanceConfig", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "validateOnly": { + "type": "bool", + "id": 4 + } + } + }, + "UpdateInstanceConfigRequest": { + "fields": { + "instanceConfig": { + "type": "InstanceConfig", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "validateOnly": { + "type": "bool", + "id": 3 + } + } + }, + "DeleteInstanceConfigRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/InstanceConfig" + } + }, + "etag": { + "type": "string", + "id": 2 + }, + "validateOnly": { + "type": "bool", + "id": 3 + } + } + }, + "ListInstanceConfigOperationsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" + } + }, + "filter": { + "type": "string", + "id": 2 + }, + "pageSize": { + "type": "int32", + "id": 3 + }, + "pageToken": { + "type": "string", + "id": 4 + } + } + }, + "ListInstanceConfigOperationsResponse": { + "fields": { + "operations": { + "rule": "repeated", + "type": "google.longrunning.Operation", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetInstanceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/Instance" + } + }, + "fieldMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "CreateInstanceRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" + } + }, + "instanceId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "instance": { + "type": "Instance", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListInstancesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4 + }, + "instanceDeadline": { + "type": "google.protobuf.Timestamp", + "id": 5 + } + } + }, + "ListInstancesResponse": { + "fields": { + "instances": { + "rule": "repeated", + "type": "Instance", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "UpdateInstanceRequest": { + "fields": { + "instance": { + "type": "Instance", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "fieldMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteInstanceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/Instance" + } + } + } + }, + "CreateInstanceMetadata": { + "fields": { + "instance": { + "type": "Instance", + "id": 1 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "cancelTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + }, + "expectedFulfillmentPeriod": { + "type": "FulfillmentPeriod", + "id": 5 + } + } + }, + "UpdateInstanceMetadata": { + "fields": { + "instance": { + "type": "Instance", + "id": 1 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "cancelTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + }, + "expectedFulfillmentPeriod": { + "type": "FulfillmentPeriod", + "id": 5 + } + } + }, + "FreeInstanceMetadata": { + "fields": { + "expireTime": { + "type": "google.protobuf.Timestamp", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "upgradeTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "expireBehavior": { + "type": "ExpireBehavior", + "id": 3 + } + }, + "nested": { + "ExpireBehavior": { + "values": { + "EXPIRE_BEHAVIOR_UNSPECIFIED": 0, + "FREE_TO_PROVISIONED": 1, + "REMOVE_AFTER_GRACE_PERIOD": 2 + } + } + } + }, + "CreateInstanceConfigMetadata": { + "fields": { + "instanceConfig": { + "type": "InstanceConfig", + "id": 1 + }, + "progress": { + "type": "OperationProgress", + "id": 2 + }, + "cancelTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + } + } + }, + "UpdateInstanceConfigMetadata": { + "fields": { + "instanceConfig": { + "type": "InstanceConfig", + "id": 1 + }, + "progress": { + "type": "OperationProgress", + "id": 2 + }, + "cancelTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + } + } + }, + "InstancePartition": { + "options": { + "(google.api.resource).type": "spanner.googleapis.com/InstancePartition", + "(google.api.resource).pattern": "projects/{project}/instances/{instance}/instancePartitions/{instance_partition}", + "(google.api.resource).plural": "instancePartitions", + "(google.api.resource).singular": "instancePartition" + }, + "oneofs": { + "computeCapacity": { + "oneof": [ + "nodeCount", + "processingUnits" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "config": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/InstanceConfig" + } + }, + "displayName": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "nodeCount": { + "type": "int32", + "id": 5 + }, + "processingUnits": { + "type": "int32", + "id": 6 + }, + "autoscalingConfig": { + "type": "AutoscalingConfig", + "id": 13, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "state": { + "type": "State", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "referencingDatabases": { + "rule": "repeated", + "type": "string", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "referencingBackups": { + "rule": "repeated", + "type": "string", + "id": 11, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "etag": { + "type": "string", + "id": 12 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "CREATING": 1, + "READY": 2 + } + } + } + }, + "CreateInstancePartitionMetadata": { + "fields": { + "instancePartition": { + "type": "InstancePartition", + "id": 1 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "cancelTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + } + } + }, + "CreateInstancePartitionRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/Instance" + } + }, + "instancePartitionId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "instancePartition": { + "type": "InstancePartition", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteInstancePartitionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/InstancePartition" + } + }, + "etag": { + "type": "string", + "id": 2 + } + } + }, + "GetInstancePartitionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/InstancePartition" + } + } + } + }, + "UpdateInstancePartitionRequest": { + "fields": { + "instancePartition": { + "type": "InstancePartition", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "fieldMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateInstancePartitionMetadata": { + "fields": { + "instancePartition": { + "type": "InstancePartition", + "id": 1 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "cancelTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + } + } + }, + "ListInstancePartitionsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/Instance" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "instancePartitionDeadline": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListInstancePartitionsResponse": { + "fields": { + "instancePartitions": { + "rule": "repeated", + "type": "InstancePartition", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "ListInstancePartitionOperationsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/Instance" + } + }, + "filter": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageSize": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "instancePartitionDeadline": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListInstancePartitionOperationsResponse": { + "fields": { + "operations": { + "rule": "repeated", + "type": "google.longrunning.Operation", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachableInstancePartitions": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "MoveInstanceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/Instance" + } + }, + "targetConfig": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/InstanceConfig" + } + } + } + }, + "MoveInstanceResponse": { + "fields": {} + }, + "MoveInstanceMetadata": { + "fields": { + "targetConfig": { + "type": "string", + "id": 1 + }, + "progress": { + "type": "OperationProgress", + "id": 2 + }, + "cancelTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + } + } + } + } + } + } + } + } + } + } + }, + "api": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/api;api", + "java_multiple_files": true, + "java_outer_classname": "LaunchStageProto", + "java_package": "com.google.api", + "objc_class_prefix": "GAPI", + "cc_enable_arenas": true + }, + "nested": { + "fieldBehavior": { + "rule": "repeated", + "type": "google.api.FieldBehavior", + "id": 1052, + "extend": "google.protobuf.FieldOptions", + "options": { + "packed": false + } + }, + "FieldBehavior": { + "values": { + "FIELD_BEHAVIOR_UNSPECIFIED": 0, + "OPTIONAL": 1, + "REQUIRED": 2, + "OUTPUT_ONLY": 3, + "INPUT_ONLY": 4, + "IMMUTABLE": 5, + "UNORDERED_LIST": 6, + "NON_EMPTY_DEFAULT": 7, + "IDENTIFIER": 8 + } + }, + "resourceReference": { + "type": "google.api.ResourceReference", + "id": 1055, + "extend": "google.protobuf.FieldOptions" + }, + "resourceDefinition": { + "rule": "repeated", + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.FileOptions" + }, + "resource": { + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.MessageOptions" + }, + "ResourceDescriptor": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "pattern": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "nameField": { + "type": "string", + "id": 3 + }, + "history": { + "type": "History", + "id": 4 + }, + "plural": { + "type": "string", + "id": 5 + }, + "singular": { + "type": "string", + "id": 6 + }, + "style": { + "rule": "repeated", + "type": "Style", + "id": 10 + } + }, + "nested": { + "History": { + "values": { + "HISTORY_UNSPECIFIED": 0, + "ORIGINALLY_SINGLE_PATTERN": 1, + "FUTURE_MULTI_PATTERN": 2 + } + }, + "Style": { + "values": { + "STYLE_UNSPECIFIED": 0, + "DECLARATIVE_FRIENDLY": 1 + } + } + } + }, + "ResourceReference": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "childType": { + "type": "string", + "id": 2 + } + } + }, + "http": { + "type": "HttpRule", + "id": 72295728, + "extend": "google.protobuf.MethodOptions" + }, + "Http": { + "fields": { + "rules": { + "rule": "repeated", + "type": "HttpRule", + "id": 1 + }, + "fullyDecodeReservedExpansion": { + "type": "bool", + "id": 2 + } + } + }, + "HttpRule": { + "oneofs": { + "pattern": { + "oneof": [ + "get", + "put", + "post", + "delete", + "patch", + "custom" + ] + } + }, + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "get": { + "type": "string", + "id": 2 + }, + "put": { + "type": "string", + "id": 3 + }, + "post": { + "type": "string", + "id": 4 + }, + "delete": { + "type": "string", + "id": 5 + }, + "patch": { + "type": "string", + "id": 6 + }, + "custom": { + "type": "CustomHttpPattern", + "id": 8 + }, + "body": { + "type": "string", + "id": 7 + }, + "responseBody": { + "type": "string", + "id": 12 + }, + "additionalBindings": { + "rule": "repeated", + "type": "HttpRule", + "id": 11 + } + } + }, + "CustomHttpPattern": { + "fields": { + "kind": { + "type": "string", + "id": 1 + }, + "path": { + "type": "string", + "id": 2 + } + } + }, + "methodSignature": { + "rule": "repeated", + "type": "string", + "id": 1051, + "extend": "google.protobuf.MethodOptions" + }, + "defaultHost": { + "type": "string", + "id": 1049, + "extend": "google.protobuf.ServiceOptions" + }, + "oauthScopes": { + "type": "string", + "id": 1050, + "extend": "google.protobuf.ServiceOptions" + }, + "apiVersion": { + "type": "string", + "id": 525000001, + "extend": "google.protobuf.ServiceOptions" + }, + "CommonLanguageSettings": { + "fields": { + "referenceDocsUri": { + "type": "string", + "id": 1, + "options": { + "deprecated": true + } + }, + "destinations": { + "rule": "repeated", + "type": "ClientLibraryDestination", + "id": 2 + } + } + }, + "ClientLibrarySettings": { + "fields": { + "version": { + "type": "string", + "id": 1 + }, + "launchStage": { + "type": "LaunchStage", + "id": 2 + }, + "restNumericEnums": { + "type": "bool", + "id": 3 + }, + "javaSettings": { + "type": "JavaSettings", + "id": 21 + }, + "cppSettings": { + "type": "CppSettings", + "id": 22 + }, + "phpSettings": { + "type": "PhpSettings", + "id": 23 + }, + "pythonSettings": { + "type": "PythonSettings", + "id": 24 + }, + "nodeSettings": { + "type": "NodeSettings", + "id": 25 + }, + "dotnetSettings": { + "type": "DotnetSettings", + "id": 26 + }, + "rubySettings": { + "type": "RubySettings", + "id": 27 + }, + "goSettings": { + "type": "GoSettings", + "id": 28 + } + } + }, + "Publishing": { + "fields": { + "methodSettings": { + "rule": "repeated", + "type": "MethodSettings", + "id": 2 + }, + "newIssueUri": { + "type": "string", + "id": 101 + }, + "documentationUri": { + "type": "string", + "id": 102 + }, + "apiShortName": { + "type": "string", + "id": 103 + }, + "githubLabel": { + "type": "string", + "id": 104 + }, + "codeownerGithubTeams": { + "rule": "repeated", + "type": "string", + "id": 105 + }, + "docTagPrefix": { + "type": "string", + "id": 106 + }, + "organization": { + "type": "ClientLibraryOrganization", + "id": 107 + }, + "librarySettings": { + "rule": "repeated", + "type": "ClientLibrarySettings", + "id": 109 + }, + "protoReferenceDocumentationUri": { + "type": "string", + "id": 110 + }, + "restReferenceDocumentationUri": { + "type": "string", + "id": 111 + } + } + }, + "JavaSettings": { + "fields": { + "libraryPackage": { + "type": "string", + "id": 1 + }, + "serviceClassNames": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "common": { + "type": "CommonLanguageSettings", + "id": 3 + } + } + }, + "CppSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "PhpSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "PythonSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "NodeSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "DotnetSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + }, + "renamedServices": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "renamedResources": { + "keyType": "string", + "type": "string", + "id": 3 + }, + "ignoredResources": { + "rule": "repeated", + "type": "string", + "id": 4 + }, + "forcedNamespaceAliases": { + "rule": "repeated", + "type": "string", + "id": 5 + }, + "handwrittenSignatures": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + }, + "RubySettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "GoSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "MethodSettings": { + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "longRunning": { + "type": "LongRunning", + "id": 2 + }, + "autoPopulatedFields": { + "rule": "repeated", + "type": "string", + "id": 3 + } + }, + "nested": { + "LongRunning": { + "fields": { + "initialPollDelay": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "pollDelayMultiplier": { + "type": "float", + "id": 2 + }, + "maxPollDelay": { + "type": "google.protobuf.Duration", + "id": 3 + }, + "totalPollTimeout": { + "type": "google.protobuf.Duration", + "id": 4 + } + } + } + } + }, + "ClientLibraryOrganization": { + "values": { + "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": 0, + "CLOUD": 1, + "ADS": 2, + "PHOTOS": 3, + "STREET_VIEW": 4, + "SHOPPING": 5, + "GEO": 6, + "GENERATIVE_AI": 7 + } + }, + "ClientLibraryDestination": { + "values": { + "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": 0, + "GITHUB": 10, + "PACKAGE_MANAGER": 20 + } + }, + "LaunchStage": { + "values": { + "LAUNCH_STAGE_UNSPECIFIED": 0, + "UNIMPLEMENTED": 6, + "PRELAUNCH": 7, + "EARLY_ACCESS": 1, + "ALPHA": 2, + "BETA": 3, + "GA": 4, + "DEPRECATED": 5 + } + } + } + }, + "protobuf": { + "options": { + "go_package": "google.golang.org/protobuf/types/descriptorpb", + "java_package": "com.google.protobuf", + "java_outer_classname": "DescriptorProtos", + "csharp_namespace": "Google.Protobuf.Reflection", + "objc_class_prefix": "GPB", + "cc_enable_arenas": true, + "optimize_for": "SPEED" + }, + "nested": { + "FileDescriptorSet": { + "edition": "proto2", + "fields": { + "file": { + "rule": "repeated", + "type": "FileDescriptorProto", + "id": 1 + } + } + }, + "Edition": { + "edition": "proto2", + "values": { + "EDITION_UNKNOWN": 0, + "EDITION_PROTO2": 998, + "EDITION_PROTO3": 999, + "EDITION_2023": 1000, + "EDITION_2024": 1001, + "EDITION_1_TEST_ONLY": 1, + "EDITION_2_TEST_ONLY": 2, + "EDITION_99997_TEST_ONLY": 99997, + "EDITION_99998_TEST_ONLY": 99998, + "EDITION_99999_TEST_ONLY": 99999, + "EDITION_MAX": 2147483647 + } + }, + "FileDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "package": { + "type": "string", + "id": 2 + }, + "dependency": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "publicDependency": { + "rule": "repeated", + "type": "int32", + "id": 10 + }, + "weakDependency": { + "rule": "repeated", + "type": "int32", + "id": 11 + }, + "messageType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 4 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 5 + }, + "service": { + "rule": "repeated", + "type": "ServiceDescriptorProto", + "id": 6 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 7 + }, + "options": { + "type": "FileOptions", + "id": 8 + }, + "sourceCodeInfo": { + "type": "SourceCodeInfo", + "id": 9 + }, + "syntax": { + "type": "string", + "id": 12 + }, + "edition": { + "type": "Edition", + "id": 14 + } + } + }, + "DescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "field": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 2 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 6 + }, + "nestedType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 3 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 4 + }, + "extensionRange": { + "rule": "repeated", + "type": "ExtensionRange", + "id": 5 + }, + "oneofDecl": { + "rule": "repeated", + "type": "OneofDescriptorProto", + "id": 8 + }, + "options": { + "type": "MessageOptions", + "id": 7 + }, + "reservedRange": { + "rule": "repeated", + "type": "ReservedRange", + "id": 9 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 10 + } + }, + "nested": { + "ExtensionRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "ExtensionRangeOptions", + "id": 3 + } + } + }, + "ReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "ExtensionRangeOptions": { + "edition": "proto2", + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + }, + "declaration": { + "rule": "repeated", + "type": "Declaration", + "id": 2, + "options": { + "retention": "RETENTION_SOURCE" + } + }, + "features": { + "type": "FeatureSet", + "id": 50 + }, + "verification": { + "type": "VerificationState", + "id": 3, + "options": { + "default": "UNVERIFIED", + "retention": "RETENTION_SOURCE" + } + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "Declaration": { + "fields": { + "number": { + "type": "int32", + "id": 1 + }, + "fullName": { + "type": "string", + "id": 2 + }, + "type": { + "type": "string", + "id": 3 + }, + "reserved": { + "type": "bool", + "id": 5 + }, + "repeated": { + "type": "bool", + "id": 6 + } + }, + "reserved": [ + [ + 4, + 4 + ] + ] + }, + "VerificationState": { + "values": { + "DECLARATION": 0, + "UNVERIFIED": 1 + } + } + } + }, + "FieldDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 3 + }, + "label": { + "type": "Label", + "id": 4 + }, + "type": { + "type": "Type", + "id": 5 + }, + "typeName": { + "type": "string", + "id": 6 + }, + "extendee": { + "type": "string", + "id": 2 + }, + "defaultValue": { + "type": "string", + "id": 7 + }, + "oneofIndex": { + "type": "int32", + "id": 9 + }, + "jsonName": { + "type": "string", + "id": 10 + }, + "options": { + "type": "FieldOptions", + "id": 8 + }, + "proto3Optional": { + "type": "bool", + "id": 17 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_DOUBLE": 1, + "TYPE_FLOAT": 2, + "TYPE_INT64": 3, + "TYPE_UINT64": 4, + "TYPE_INT32": 5, + "TYPE_FIXED64": 6, + "TYPE_FIXED32": 7, + "TYPE_BOOL": 8, + "TYPE_STRING": 9, + "TYPE_GROUP": 10, + "TYPE_MESSAGE": 11, + "TYPE_BYTES": 12, + "TYPE_UINT32": 13, + "TYPE_ENUM": 14, + "TYPE_SFIXED32": 15, + "TYPE_SFIXED64": 16, + "TYPE_SINT32": 17, + "TYPE_SINT64": 18 + } + }, + "Label": { + "values": { + "LABEL_OPTIONAL": 1, + "LABEL_REPEATED": 3, + "LABEL_REQUIRED": 2 + } + } + } + }, + "OneofDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "options": { + "type": "OneofOptions", + "id": 2 + } + } + }, + "EnumDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "value": { + "rule": "repeated", + "type": "EnumValueDescriptorProto", + "id": 2 + }, + "options": { + "type": "EnumOptions", + "id": 3 + }, + "reservedRange": { + "rule": "repeated", + "type": "EnumReservedRange", + "id": 4 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 5 + } + }, + "nested": { + "EnumReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "EnumValueDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "EnumValueOptions", + "id": 3 + } + } + }, + "ServiceDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "method": { + "rule": "repeated", + "type": "MethodDescriptorProto", + "id": 2 + }, + "options": { + "type": "ServiceOptions", + "id": 3 + } + } + }, + "MethodDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "inputType": { + "type": "string", + "id": 2 + }, + "outputType": { + "type": "string", + "id": 3 + }, + "options": { + "type": "MethodOptions", + "id": 4 + }, + "clientStreaming": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "serverStreaming": { + "type": "bool", + "id": 6, + "options": { + "default": false + } + } + } + }, + "FileOptions": { + "edition": "proto2", + "fields": { + "javaPackage": { + "type": "string", + "id": 1 + }, + "javaOuterClassname": { + "type": "string", + "id": 8 + }, + "javaMultipleFiles": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "javaGenerateEqualsAndHash": { + "type": "bool", + "id": 20, + "options": { + "deprecated": true + } + }, + "javaStringCheckUtf8": { + "type": "bool", + "id": 27, + "options": { + "default": false + } + }, + "optimizeFor": { + "type": "OptimizeMode", + "id": 9, + "options": { + "default": "SPEED" + } + }, + "goPackage": { + "type": "string", + "id": 11 + }, + "ccGenericServices": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "javaGenericServices": { + "type": "bool", + "id": 17, + "options": { + "default": false + } + }, + "pyGenericServices": { + "type": "bool", + "id": 18, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 23, + "options": { + "default": false + } + }, + "ccEnableArenas": { + "type": "bool", + "id": 31, + "options": { + "default": true + } + }, + "objcClassPrefix": { + "type": "string", + "id": 36 + }, + "csharpNamespace": { + "type": "string", + "id": 37 + }, + "swiftPrefix": { + "type": "string", + "id": 39 + }, + "phpClassPrefix": { + "type": "string", + "id": 40 + }, + "phpNamespace": { + "type": "string", + "id": 41 + }, + "phpMetadataNamespace": { + "type": "string", + "id": 44 + }, + "rubyPackage": { + "type": "string", + "id": 45 + }, + "features": { + "type": "FeatureSet", + "id": 50 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 42, + 42 + ], + [ + 38, + 38 + ] + ], + "nested": { + "OptimizeMode": { + "values": { + "SPEED": 1, + "CODE_SIZE": 2, + "LITE_RUNTIME": 3 + } + } + } + }, + "MessageOptions": { + "edition": "proto2", + "fields": { + "messageSetWireFormat": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "noStandardDescriptorAccessor": { + "type": "bool", + "id": 2, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "mapEntry": { + "type": "bool", + "id": 7 + }, + "deprecatedLegacyJsonFieldConflicts": { + "type": "bool", + "id": 11, + "options": { + "deprecated": true + } + }, + "features": { + "type": "FeatureSet", + "id": 12 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ], + [ + 5, + 5 + ], + [ + 6, + 6 + ], + [ + 8, + 8 + ], + [ + 9, + 9 + ] + ] + }, + "FieldOptions": { + "edition": "proto2", + "fields": { + "ctype": { + "type": "CType", + "id": 1, + "options": { + "default": "STRING" + } + }, + "packed": { + "type": "bool", + "id": 2 + }, + "jstype": { + "type": "JSType", + "id": 6, + "options": { + "default": "JS_NORMAL" + } + }, + "lazy": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "unverifiedLazy": { + "type": "bool", + "id": 15, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "weak": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "debugRedact": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "retention": { + "type": "OptionRetention", + "id": 17 + }, + "targets": { + "rule": "repeated", + "type": "OptionTargetType", + "id": 19 + }, + "editionDefaults": { + "rule": "repeated", + "type": "EditionDefault", + "id": 20 + }, + "features": { + "type": "FeatureSet", + "id": 21 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ], + [ + 18, + 18 + ] + ], + "nested": { + "CType": { + "values": { + "STRING": 0, + "CORD": 1, + "STRING_PIECE": 2 + } + }, + "JSType": { + "values": { + "JS_NORMAL": 0, + "JS_STRING": 1, + "JS_NUMBER": 2 + } + }, + "OptionRetention": { + "values": { + "RETENTION_UNKNOWN": 0, + "RETENTION_RUNTIME": 1, + "RETENTION_SOURCE": 2 + } + }, + "OptionTargetType": { + "values": { + "TARGET_TYPE_UNKNOWN": 0, + "TARGET_TYPE_FILE": 1, + "TARGET_TYPE_EXTENSION_RANGE": 2, + "TARGET_TYPE_MESSAGE": 3, + "TARGET_TYPE_FIELD": 4, + "TARGET_TYPE_ONEOF": 5, + "TARGET_TYPE_ENUM": 6, + "TARGET_TYPE_ENUM_ENTRY": 7, + "TARGET_TYPE_SERVICE": 8, + "TARGET_TYPE_METHOD": 9 + } + }, + "EditionDefault": { + "fields": { + "edition": { + "type": "Edition", + "id": 3 + }, + "value": { + "type": "string", + "id": 2 + } + } + } + } + }, + "OneofOptions": { + "edition": "proto2", + "fields": { + "features": { + "type": "FeatureSet", + "id": 1 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "EnumOptions": { + "edition": "proto2", + "fields": { + "allowAlias": { + "type": "bool", + "id": 2 + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "deprecatedLegacyJsonFieldConflicts": { + "type": "bool", + "id": 6, + "options": { + "deprecated": true + } + }, + "features": { + "type": "FeatureSet", + "id": 7 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 5, + 5 + ] + ] + }, + "EnumValueOptions": { + "edition": "proto2", + "fields": { + "deprecated": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "features": { + "type": "FeatureSet", + "id": 2 + }, + "debugRedact": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "edition": "proto2", + "fields": { + "features": { + "type": "FeatureSet", + "id": 34 + }, + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "MethodOptions": { + "edition": "proto2", + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "idempotencyLevel": { + "type": "IdempotencyLevel", + "id": 34, + "options": { + "default": "IDEMPOTENCY_UNKNOWN" + } + }, + "features": { + "type": "FeatureSet", + "id": 35 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "IdempotencyLevel": { + "values": { + "IDEMPOTENCY_UNKNOWN": 0, + "NO_SIDE_EFFECTS": 1, + "IDEMPOTENT": 2 + } + } + } + }, + "UninterpretedOption": { + "edition": "proto2", + "fields": { + "name": { + "rule": "repeated", + "type": "NamePart", + "id": 2 + }, + "identifierValue": { + "type": "string", + "id": 3 + }, + "positiveIntValue": { + "type": "uint64", + "id": 4 + }, + "negativeIntValue": { + "type": "int64", + "id": 5 + }, + "doubleValue": { + "type": "double", + "id": 6 + }, + "stringValue": { + "type": "bytes", + "id": 7 + }, + "aggregateValue": { + "type": "string", + "id": 8 + } + }, + "nested": { + "NamePart": { + "fields": { + "namePart": { + "rule": "required", + "type": "string", + "id": 1 + }, + "isExtension": { + "rule": "required", + "type": "bool", + "id": 2 + } + } + } + } + }, + "FeatureSet": { + "edition": "proto2", + "fields": { + "fieldPresence": { + "type": "FieldPresence", + "id": 1, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_2023", + "edition_defaults.value": "EXPLICIT" + } + }, + "enumType": { + "type": "EnumType", + "id": 2, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "OPEN" + } + }, + "repeatedFieldEncoding": { + "type": "RepeatedFieldEncoding", + "id": 3, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "PACKED" + } + }, + "utf8Validation": { + "type": "Utf8Validation", + "id": 4, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "VERIFY" + } + }, + "messageEncoding": { + "type": "MessageEncoding", + "id": 5, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO2", + "edition_defaults.value": "LENGTH_PREFIXED" + } + }, + "jsonFormat": { + "type": "JsonFormat", + "id": 6, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "ALLOW" + } + } + }, + "extensions": [ + [ + 1000, + 1000 + ], + [ + 1001, + 1001 + ], + [ + 1002, + 1002 + ], + [ + 9990, + 9990 + ], + [ + 9995, + 9999 + ], + [ + 10000, + 10000 + ] + ], + "reserved": [ + [ + 999, + 999 + ] + ], + "nested": { + "FieldPresence": { + "values": { + "FIELD_PRESENCE_UNKNOWN": 0, + "EXPLICIT": 1, + "IMPLICIT": 2, + "LEGACY_REQUIRED": 3 + } + }, + "EnumType": { + "values": { + "ENUM_TYPE_UNKNOWN": 0, + "OPEN": 1, + "CLOSED": 2 + } + }, + "RepeatedFieldEncoding": { + "values": { + "REPEATED_FIELD_ENCODING_UNKNOWN": 0, + "PACKED": 1, + "EXPANDED": 2 + } + }, + "Utf8Validation": { + "values": { + "UTF8_VALIDATION_UNKNOWN": 0, + "VERIFY": 2, + "NONE": 3 + } + }, + "MessageEncoding": { + "values": { + "MESSAGE_ENCODING_UNKNOWN": 0, + "LENGTH_PREFIXED": 1, + "DELIMITED": 2 + } + }, + "JsonFormat": { + "values": { + "JSON_FORMAT_UNKNOWN": 0, + "ALLOW": 1, + "LEGACY_BEST_EFFORT": 2 + } + } + } + }, + "FeatureSetDefaults": { + "edition": "proto2", + "fields": { + "defaults": { + "rule": "repeated", + "type": "FeatureSetEditionDefault", + "id": 1 + }, + "minimumEdition": { + "type": "Edition", + "id": 4 + }, + "maximumEdition": { + "type": "Edition", + "id": 5 + } + }, + "nested": { + "FeatureSetEditionDefault": { + "fields": { + "edition": { + "type": "Edition", + "id": 3 + }, + "features": { + "type": "FeatureSet", + "id": 2 + } + } + } + } + }, + "SourceCodeInfo": { + "edition": "proto2", + "fields": { + "location": { + "rule": "repeated", + "type": "Location", + "id": 1 + } + }, + "nested": { + "Location": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1, + "options": { + "packed": true + } + }, + "span": { + "rule": "repeated", + "type": "int32", + "id": 2, + "options": { + "packed": true + } + }, + "leadingComments": { + "type": "string", + "id": 3 + }, + "trailingComments": { + "type": "string", + "id": 4 + }, + "leadingDetachedComments": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + } + } + }, + "GeneratedCodeInfo": { + "edition": "proto2", + "fields": { + "annotation": { + "rule": "repeated", + "type": "Annotation", + "id": 1 + } + }, + "nested": { + "Annotation": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1, + "options": { + "packed": true + } + }, + "sourceFile": { + "type": "string", + "id": 2 + }, + "begin": { + "type": "int32", + "id": 3 + }, + "end": { + "type": "int32", + "id": 4 + }, + "semantic": { + "type": "Semantic", + "id": 5 + } + }, + "nested": { + "Semantic": { + "values": { + "NONE": 0, + "SET": 1, + "ALIAS": 2 + } + } + } + } + } + }, + "Timestamp": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Duration": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "FieldMask": { + "fields": { + "paths": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "Any": { + "fields": { + "type_url": { + "type": "string", + "id": 1 + }, + "value": { + "type": "bytes", + "id": 2 + } + } + }, + "Empty": { + "fields": {} + } + } + }, + "iam": { + "nested": { + "v1": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.Cloud.Iam.V1", + "go_package": "cloud.google.com/go/iam/apiv1/iampb;iampb", + "java_multiple_files": true, + "java_outer_classname": "PolicyProto", + "java_package": "com.google.iam.v1", + "php_namespace": "Google\\Cloud\\Iam\\V1" + }, + "nested": { + "IAMPolicy": { + "options": { + "(google.api.default_host)": "iam-meta-api.googleapis.com" + }, + "methods": { + "SetIamPolicy": { + "requestType": "SetIamPolicyRequest", + "responseType": "Policy", + "options": { + "(google.api.http).post": "/v1/{resource=**}:setIamPolicy", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{resource=**}:setIamPolicy", + "body": "*" + } + } + ] + }, + "GetIamPolicy": { + "requestType": "GetIamPolicyRequest", + "responseType": "Policy", + "options": { + "(google.api.http).post": "/v1/{resource=**}:getIamPolicy", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{resource=**}:getIamPolicy", + "body": "*" + } + } + ] + }, + "TestIamPermissions": { + "requestType": "TestIamPermissionsRequest", + "responseType": "TestIamPermissionsResponse", + "options": { + "(google.api.http).post": "/v1/{resource=**}:testIamPermissions", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{resource=**}:testIamPermissions", + "body": "*" + } + } + ] + } + } + }, + "SetIamPolicyRequest": { + "fields": { + "resource": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "*" + } + }, + "policy": { + "type": "Policy", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 3 + } + } + }, + "GetIamPolicyRequest": { + "fields": { + "resource": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "*" + } + }, + "options": { + "type": "GetPolicyOptions", + "id": 2 + } + } + }, + "TestIamPermissionsRequest": { + "fields": { + "resource": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "*" + } + }, + "permissions": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "TestIamPermissionsResponse": { + "fields": { + "permissions": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "GetPolicyOptions": { + "fields": { + "requestedPolicyVersion": { + "type": "int32", + "id": 1 + } + } + }, + "Policy": { + "fields": { + "version": { + "type": "int32", + "id": 1 + }, + "bindings": { + "rule": "repeated", + "type": "Binding", + "id": 4 + }, + "auditConfigs": { + "rule": "repeated", + "type": "AuditConfig", + "id": 6 + }, + "etag": { + "type": "bytes", + "id": 3 + } + } + }, + "Binding": { + "fields": { + "role": { + "type": "string", + "id": 1 + }, + "members": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "condition": { + "type": "google.type.Expr", + "id": 3 + } + } + }, + "AuditConfig": { + "fields": { + "service": { + "type": "string", + "id": 1 + }, + "auditLogConfigs": { + "rule": "repeated", + "type": "AuditLogConfig", + "id": 3 + } + } + }, + "AuditLogConfig": { + "fields": { + "logType": { + "type": "LogType", + "id": 1 + }, + "exemptedMembers": { + "rule": "repeated", + "type": "string", + "id": 2 + } + }, + "nested": { + "LogType": { + "values": { + "LOG_TYPE_UNSPECIFIED": 0, + "ADMIN_READ": 1, + "DATA_WRITE": 2, + "DATA_READ": 3 + } + } + } + }, + "PolicyDelta": { + "fields": { + "bindingDeltas": { + "rule": "repeated", + "type": "BindingDelta", + "id": 1 + }, + "auditConfigDeltas": { + "rule": "repeated", + "type": "AuditConfigDelta", + "id": 2 + } + } + }, + "BindingDelta": { + "fields": { + "action": { + "type": "Action", + "id": 1 + }, + "role": { + "type": "string", + "id": 2 + }, + "member": { + "type": "string", + "id": 3 + }, + "condition": { + "type": "google.type.Expr", + "id": 4 + } + }, + "nested": { + "Action": { + "values": { + "ACTION_UNSPECIFIED": 0, + "ADD": 1, + "REMOVE": 2 + } + } + } + }, + "AuditConfigDelta": { + "fields": { + "action": { + "type": "Action", + "id": 1 + }, + "service": { + "type": "string", + "id": 2 + }, + "exemptedMember": { + "type": "string", + "id": 3 + }, + "logType": { + "type": "string", + "id": 4 + } + }, + "nested": { + "Action": { + "values": { + "ACTION_UNSPECIFIED": 0, + "ADD": 1, + "REMOVE": 2 + } + } + } + } + } + } + } + }, + "type": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/type/expr;expr", + "java_multiple_files": true, + "java_outer_classname": "ExprProto", + "java_package": "com.google.type", + "objc_class_prefix": "GTP" + }, + "nested": { + "Expr": { + "fields": { + "expression": { + "type": "string", + "id": 1 + }, + "title": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + }, + "location": { + "type": "string", + "id": 4 + } + } + } + } + }, + "longrunning": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.LongRunning", + "go_package": "cloud.google.com/go/longrunning/autogen/longrunningpb;longrunningpb", + "java_multiple_files": true, + "java_outer_classname": "OperationsProto", + "java_package": "com.google.longrunning", + "php_namespace": "Google\\LongRunning" + }, + "nested": { + "operationInfo": { + "type": "google.longrunning.OperationInfo", + "id": 1049, + "extend": "google.protobuf.MethodOptions" + }, + "Operations": { + "options": { + "(google.api.default_host)": "longrunning.googleapis.com" + }, + "methods": { + "ListOperations": { + "requestType": "ListOperationsRequest", + "responseType": "ListOperationsResponse", + "options": { + "(google.api.http).get": "/v1/{name=operations}", + "(google.api.method_signature)": "name,filter" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations}" + } + }, + { + "(google.api.method_signature)": "name,filter" + } + ] + }, + "GetOperation": { + "requestType": "GetOperationRequest", + "responseType": "Operation", + "options": { + "(google.api.http).get": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "DeleteOperation": { + "requestType": "DeleteOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CancelOperation": { + "requestType": "CancelOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).post": "/v1/{name=operations/**}:cancel", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=operations/**}:cancel", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "WaitOperation": { + "requestType": "WaitOperationRequest", + "responseType": "Operation" + } + } + }, + "Operation": { + "oneofs": { + "result": { + "oneof": [ + "error", + "response" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "metadata": { + "type": "google.protobuf.Any", + "id": 2 + }, + "done": { + "type": "bool", + "id": 3 + }, + "error": { + "type": "google.rpc.Status", + "id": 4 + }, + "response": { + "type": "google.protobuf.Any", + "id": 5 + } + } + }, + "GetOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "ListOperationsRequest": { + "fields": { + "name": { + "type": "string", + "id": 4 + }, + "filter": { + "type": "string", + "id": 1 + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListOperationsResponse": { + "fields": { + "operations": { + "rule": "repeated", + "type": "Operation", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CancelOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "DeleteOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "WaitOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "timeout": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + }, + "OperationInfo": { + "fields": { + "responseType": { + "type": "string", + "id": 1 + }, + "metadataType": { + "type": "string", + "id": 2 + } + } + } + } + }, + "rpc": { + "options": { + "cc_enable_arenas": true, + "go_package": "google.golang.org/genproto/googleapis/rpc/status;status", + "java_multiple_files": true, + "java_outer_classname": "StatusProto", + "java_package": "com.google.rpc", + "objc_class_prefix": "RPC" + }, + "nested": { + "Status": { + "fields": { + "code": { + "type": "int32", + "id": 1 + }, + "message": { + "type": "string", + "id": 2 + }, + "details": { + "rule": "repeated", + "type": "google.protobuf.Any", + "id": 3 + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/owl-bot-staging/admin/instance/v1/src/index.ts b/owl-bot-staging/admin/instance/v1/src/index.ts new file mode 100644 index 000000000..52e6684f0 --- /dev/null +++ b/owl-bot-staging/admin/instance/v1/src/index.ts @@ -0,0 +1,25 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as v1 from './v1'; +const InstanceAdminClient = v1.InstanceAdminClient; +type InstanceAdminClient = v1.InstanceAdminClient; +export {v1, InstanceAdminClient}; +export default {v1, InstanceAdminClient}; +import * as protos from '../protos/protos'; +export {protos} diff --git a/owl-bot-staging/admin/instance/v1/src/v1/gapic_metadata.json b/owl-bot-staging/admin/instance/v1/src/v1/gapic_metadata.json new file mode 100644 index 000000000..88f7f07dc --- /dev/null +++ b/owl-bot-staging/admin/instance/v1/src/v1/gapic_metadata.json @@ -0,0 +1,253 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.spanner.admin.instance.v1", + "libraryPackage": "@google-cloud/spanner", + "services": { + "InstanceAdmin": { + "clients": { + "grpc": { + "libraryClient": "InstanceAdminClient", + "rpcs": { + "GetInstanceConfig": { + "methods": [ + "getInstanceConfig" + ] + }, + "DeleteInstanceConfig": { + "methods": [ + "deleteInstanceConfig" + ] + }, + "GetInstance": { + "methods": [ + "getInstance" + ] + }, + "DeleteInstance": { + "methods": [ + "deleteInstance" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "GetInstancePartition": { + "methods": [ + "getInstancePartition" + ] + }, + "DeleteInstancePartition": { + "methods": [ + "deleteInstancePartition" + ] + }, + "CreateInstanceConfig": { + "methods": [ + "createInstanceConfig" + ] + }, + "UpdateInstanceConfig": { + "methods": [ + "updateInstanceConfig" + ] + }, + "CreateInstance": { + "methods": [ + "createInstance" + ] + }, + "UpdateInstance": { + "methods": [ + "updateInstance" + ] + }, + "CreateInstancePartition": { + "methods": [ + "createInstancePartition" + ] + }, + "UpdateInstancePartition": { + "methods": [ + "updateInstancePartition" + ] + }, + "MoveInstance": { + "methods": [ + "moveInstance" + ] + }, + "ListInstanceConfigs": { + "methods": [ + "listInstanceConfigs", + "listInstanceConfigsStream", + "listInstanceConfigsAsync" + ] + }, + "ListInstanceConfigOperations": { + "methods": [ + "listInstanceConfigOperations", + "listInstanceConfigOperationsStream", + "listInstanceConfigOperationsAsync" + ] + }, + "ListInstances": { + "methods": [ + "listInstances", + "listInstancesStream", + "listInstancesAsync" + ] + }, + "ListInstancePartitions": { + "methods": [ + "listInstancePartitions", + "listInstancePartitionsStream", + "listInstancePartitionsAsync" + ] + }, + "ListInstancePartitionOperations": { + "methods": [ + "listInstancePartitionOperations", + "listInstancePartitionOperationsStream", + "listInstancePartitionOperationsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "InstanceAdminClient", + "rpcs": { + "GetInstanceConfig": { + "methods": [ + "getInstanceConfig" + ] + }, + "DeleteInstanceConfig": { + "methods": [ + "deleteInstanceConfig" + ] + }, + "GetInstance": { + "methods": [ + "getInstance" + ] + }, + "DeleteInstance": { + "methods": [ + "deleteInstance" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "GetInstancePartition": { + "methods": [ + "getInstancePartition" + ] + }, + "DeleteInstancePartition": { + "methods": [ + "deleteInstancePartition" + ] + }, + "CreateInstanceConfig": { + "methods": [ + "createInstanceConfig" + ] + }, + "UpdateInstanceConfig": { + "methods": [ + "updateInstanceConfig" + ] + }, + "CreateInstance": { + "methods": [ + "createInstance" + ] + }, + "UpdateInstance": { + "methods": [ + "updateInstance" + ] + }, + "CreateInstancePartition": { + "methods": [ + "createInstancePartition" + ] + }, + "UpdateInstancePartition": { + "methods": [ + "updateInstancePartition" + ] + }, + "MoveInstance": { + "methods": [ + "moveInstance" + ] + }, + "ListInstanceConfigs": { + "methods": [ + "listInstanceConfigs", + "listInstanceConfigsStream", + "listInstanceConfigsAsync" + ] + }, + "ListInstanceConfigOperations": { + "methods": [ + "listInstanceConfigOperations", + "listInstanceConfigOperationsStream", + "listInstanceConfigOperationsAsync" + ] + }, + "ListInstances": { + "methods": [ + "listInstances", + "listInstancesStream", + "listInstancesAsync" + ] + }, + "ListInstancePartitions": { + "methods": [ + "listInstancePartitions", + "listInstancePartitionsStream", + "listInstancePartitionsAsync" + ] + }, + "ListInstancePartitionOperations": { + "methods": [ + "listInstancePartitionOperations", + "listInstancePartitionOperationsStream", + "listInstancePartitionOperationsAsync" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/admin/instance/v1/src/v1/index.ts b/owl-bot-staging/admin/instance/v1/src/v1/index.ts new file mode 100644 index 000000000..2ec13d59f --- /dev/null +++ b/owl-bot-staging/admin/instance/v1/src/v1/index.ts @@ -0,0 +1,19 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +export {InstanceAdminClient} from './instance_admin_client'; diff --git a/owl-bot-staging/admin/instance/v1/src/v1/instance_admin_client.ts b/owl-bot-staging/admin/instance/v1/src/v1/instance_admin_client.ts new file mode 100644 index 000000000..9803a71f5 --- /dev/null +++ b/owl-bot-staging/admin/instance/v1/src/v1/instance_admin_client.ts @@ -0,0 +1,4289 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v1/instance_admin_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './instance_admin_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Cloud Spanner Instance Admin API + * + * The Cloud Spanner Instance Admin API can be used to create, delete, + * modify and list instances. Instances are dedicated Cloud Spanner serving + * and storage resources to be used by Cloud Spanner databases. + * + * Each instance has a "configuration", which dictates where the + * serving resources for the Cloud Spanner instance are located (e.g., + * US-central, Europe). Configurations are created by Google based on + * resource availability. + * + * Cloud Spanner billing is based on the instances that exist and their + * sizes. After an instance exists, there are no additional + * per-database or per-operation charges for use of the instance + * (though there may be additional network bandwidth charges). + * Instances offer isolation: problems with databases in one instance + * will not affect other instances. However, within an instance + * databases can affect each other. For example, if one database in an + * instance receives a lot of requests and consumes most of the + * instance resources, fewer resources are available for other + * databases in that instance, and their performance may suffer. + * @class + * @memberof v1 + */ +export class InstanceAdminClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('spanner'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + instanceAdminStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of InstanceAdminClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new InstanceAdminClient({fallback: true}, gax); + * ``` + */ + constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof InstanceAdminClient; + if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { + throw new Error('Please set either universe_domain or universeDomain, but not both.'); + } + const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; + this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; + this._servicePath = 'spanner.' + this._universeDomain; + const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== this._servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process === 'object' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + instancePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/instances/{instance}' + ), + instanceConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/instanceConfigs/{instance_config}' + ), + instancePartitionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/instances/{instance}/instancePartitions/{instance_partition}' + ), + projectPathTemplate: new this._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 = { + listInstanceConfigs: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'instanceConfigs'), + listInstanceConfigOperations: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'operations'), + listInstances: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'instances'), + listInstancePartitions: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'instancePartitions'), + listInstancePartitionOperations: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'operations') + }; + + const protoFilesRoot = this._gaxModule.protobufFromJSON(jsonProtos); + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }; + if (opts.fallback) { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [{selector: 'google.longrunning.Operations.CancelOperation',post: '/v1/{name=projects/*/instances/*/databases/*/operations/*}:cancel',additional_bindings: [{post: '/v1/{name=projects/*/instances/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/instances/*/backups/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/instances/*/instancePartitions/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/instanceConfigs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/instanceConfigs/*/ssdCaches/*/operations/*}:cancel',}], + },{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/v1/{name=projects/*/instances/*/databases/*/operations/*}',additional_bindings: [{delete: '/v1/{name=projects/*/instances/*/operations/*}',},{delete: '/v1/{name=projects/*/instances/*/backups/*/operations/*}',},{delete: '/v1/{name=projects/*/instances/*/instancePartitions/*/operations/*}',},{delete: '/v1/{name=projects/*/instanceConfigs/*/operations/*}',},{delete: '/v1/{name=projects/*/instanceConfigs/*/ssdCaches/*/operations/*}',}], + },{selector: 'google.longrunning.Operations.GetOperation',get: '/v1/{name=projects/*/instances/*/databases/*/operations/*}',additional_bindings: [{get: '/v1/{name=projects/*/instances/*/operations/*}',},{get: '/v1/{name=projects/*/instances/*/backups/*/operations/*}',},{get: '/v1/{name=projects/*/instances/*/instancePartitions/*/operations/*}',},{get: '/v1/{name=projects/*/instanceConfigs/*/operations/*}',},{get: '/v1/{name=projects/*/instanceConfigs/*/ssdCaches/*/operations/*}',}], + },{selector: 'google.longrunning.Operations.ListOperations',get: '/v1/{name=projects/*/instances/*/databases/*/operations}',additional_bindings: [{get: '/v1/{name=projects/*/instances/*/operations}',},{get: '/v1/{name=projects/*/instances/*/backups/*/operations}',},{get: '/v1/{name=projects/*/instances/*/instancePartitions/*/operations}',},{get: '/v1/{name=projects/*/instanceConfigs/*/operations}',},{get: '/v1/{name=projects/*/instanceConfigs/*/ssdCaches/*/operations}',}], + }]; + } + this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); + const createInstanceConfigResponse = protoFilesRoot.lookup( + '.google.spanner.admin.instance.v1.InstanceConfig') as gax.protobuf.Type; + const createInstanceConfigMetadata = protoFilesRoot.lookup( + '.google.spanner.admin.instance.v1.CreateInstanceConfigMetadata') as gax.protobuf.Type; + const updateInstanceConfigResponse = protoFilesRoot.lookup( + '.google.spanner.admin.instance.v1.InstanceConfig') as gax.protobuf.Type; + const updateInstanceConfigMetadata = protoFilesRoot.lookup( + '.google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata') as gax.protobuf.Type; + const createInstanceResponse = protoFilesRoot.lookup( + '.google.spanner.admin.instance.v1.Instance') as gax.protobuf.Type; + const createInstanceMetadata = protoFilesRoot.lookup( + '.google.spanner.admin.instance.v1.CreateInstanceMetadata') as gax.protobuf.Type; + const updateInstanceResponse = protoFilesRoot.lookup( + '.google.spanner.admin.instance.v1.Instance') as gax.protobuf.Type; + const updateInstanceMetadata = protoFilesRoot.lookup( + '.google.spanner.admin.instance.v1.UpdateInstanceMetadata') as gax.protobuf.Type; + const createInstancePartitionResponse = protoFilesRoot.lookup( + '.google.spanner.admin.instance.v1.InstancePartition') as gax.protobuf.Type; + const createInstancePartitionMetadata = protoFilesRoot.lookup( + '.google.spanner.admin.instance.v1.CreateInstancePartitionMetadata') as gax.protobuf.Type; + const updateInstancePartitionResponse = protoFilesRoot.lookup( + '.google.spanner.admin.instance.v1.InstancePartition') as gax.protobuf.Type; + const updateInstancePartitionMetadata = protoFilesRoot.lookup( + '.google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata') as gax.protobuf.Type; + const moveInstanceResponse = protoFilesRoot.lookup( + '.google.spanner.admin.instance.v1.MoveInstanceResponse') as gax.protobuf.Type; + const moveInstanceMetadata = protoFilesRoot.lookup( + '.google.spanner.admin.instance.v1.MoveInstanceMetadata') as gax.protobuf.Type; + + this.descriptors.longrunning = { + createInstanceConfig: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createInstanceConfigResponse.decode.bind(createInstanceConfigResponse), + createInstanceConfigMetadata.decode.bind(createInstanceConfigMetadata)), + updateInstanceConfig: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateInstanceConfigResponse.decode.bind(updateInstanceConfigResponse), + updateInstanceConfigMetadata.decode.bind(updateInstanceConfigMetadata)), + createInstance: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createInstanceResponse.decode.bind(createInstanceResponse), + createInstanceMetadata.decode.bind(createInstanceMetadata)), + updateInstance: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateInstanceResponse.decode.bind(updateInstanceResponse), + updateInstanceMetadata.decode.bind(updateInstanceMetadata)), + createInstancePartition: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createInstancePartitionResponse.decode.bind(createInstancePartitionResponse), + createInstancePartitionMetadata.decode.bind(createInstancePartitionMetadata)), + updateInstancePartition: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateInstancePartitionResponse.decode.bind(updateInstancePartitionResponse), + updateInstancePartitionMetadata.decode.bind(updateInstancePartitionMetadata)), + moveInstance: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + moveInstanceResponse.decode.bind(moveInstanceResponse), + moveInstanceMetadata.decode.bind(moveInstanceMetadata)) + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.spanner.admin.instance.v1.InstanceAdmin', gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.instanceAdminStub) { + return this.instanceAdminStub; + } + + // Put together the "service stub" for + // google.spanner.admin.instance.v1.InstanceAdmin. + this.instanceAdminStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.spanner.admin.instance.v1.InstanceAdmin') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.spanner.admin.instance.v1.InstanceAdmin, + this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const instanceAdminStubMethods = + ['listInstanceConfigs', 'getInstanceConfig', 'createInstanceConfig', 'updateInstanceConfig', 'deleteInstanceConfig', 'listInstanceConfigOperations', 'listInstances', 'listInstancePartitions', 'getInstance', 'createInstance', 'updateInstance', 'deleteInstance', 'setIamPolicy', 'getIamPolicy', 'testIamPermissions', 'getInstancePartition', 'createInstancePartition', 'deleteInstancePartition', 'updateInstancePartition', 'listInstancePartitionOperations', 'moveInstance']; + for (const methodName of instanceAdminStubMethods) { + const callPromise = this.instanceAdminStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.instanceAdminStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'spanner.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'spanner.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/spanner.admin' + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- +/** + * Gets information about a particular instance configuration. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the requested instance configuration. Values are of + * the form `projects//instanceConfigs/`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.spanner.admin.instance.v1.InstanceConfig|InstanceConfig}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + */ + getInstanceConfig( + request?: protos.google.spanner.admin.instance.v1.IGetInstanceConfigRequest, + options?: CallOptions): + Promise<[ + protos.google.spanner.admin.instance.v1.IInstanceConfig, + protos.google.spanner.admin.instance.v1.IGetInstanceConfigRequest|undefined, {}|undefined + ]>; + getInstanceConfig( + request: protos.google.spanner.admin.instance.v1.IGetInstanceConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.spanner.admin.instance.v1.IInstanceConfig, + protos.google.spanner.admin.instance.v1.IGetInstanceConfigRequest|null|undefined, + {}|null|undefined>): void; + getInstanceConfig( + request: protos.google.spanner.admin.instance.v1.IGetInstanceConfigRequest, + callback: Callback< + protos.google.spanner.admin.instance.v1.IInstanceConfig, + protos.google.spanner.admin.instance.v1.IGetInstanceConfigRequest|null|undefined, + {}|null|undefined>): void; + getInstanceConfig( + request?: protos.google.spanner.admin.instance.v1.IGetInstanceConfigRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.spanner.admin.instance.v1.IInstanceConfig, + protos.google.spanner.admin.instance.v1.IGetInstanceConfigRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.spanner.admin.instance.v1.IInstanceConfig, + protos.google.spanner.admin.instance.v1.IGetInstanceConfigRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.spanner.admin.instance.v1.IInstanceConfig, + protos.google.spanner.admin.instance.v1.IGetInstanceConfigRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getInstanceConfig request %j', request); + const wrappedCallback: Callback< + protos.google.spanner.admin.instance.v1.IInstanceConfig, + protos.google.spanner.admin.instance.v1.IGetInstanceConfigRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getInstanceConfig response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getInstanceConfig(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.spanner.admin.instance.v1.IInstanceConfig, + protos.google.spanner.admin.instance.v1.IGetInstanceConfigRequest|undefined, + {}|undefined + ]) => { + this._log.info('getInstanceConfig response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Deletes the instance configuration. Deletion is only allowed when no + * instances are using the configuration. If any instances are using + * the configuration, returns `FAILED_PRECONDITION`. + * + * Only user-managed configurations can be deleted. + * + * Authorization requires `spanner.instanceConfigs.delete` permission on + * the resource {@link protos.google.spanner.admin.instance.v1.InstanceConfig.name|name}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the instance configuration to be deleted. + * Values are of the form + * `projects//instanceConfigs/` + * @param {string} request.etag + * Used for optimistic concurrency control as a way to help prevent + * simultaneous deletes of an instance configuration from overwriting each + * other. If not empty, the API + * only deletes the instance configuration when the etag provided matches the + * current status of the requested instance configuration. Otherwise, deletes + * the instance configuration without checking the current status of the + * requested instance configuration. + * @param {boolean} request.validateOnly + * An option to validate, but not actually execute, a request, + * and provide the same response. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + */ + deleteInstanceConfig( + request?: protos.google.spanner.admin.instance.v1.IDeleteInstanceConfigRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.spanner.admin.instance.v1.IDeleteInstanceConfigRequest|undefined, {}|undefined + ]>; + deleteInstanceConfig( + request: protos.google.spanner.admin.instance.v1.IDeleteInstanceConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.spanner.admin.instance.v1.IDeleteInstanceConfigRequest|null|undefined, + {}|null|undefined>): void; + deleteInstanceConfig( + request: protos.google.spanner.admin.instance.v1.IDeleteInstanceConfigRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.spanner.admin.instance.v1.IDeleteInstanceConfigRequest|null|undefined, + {}|null|undefined>): void; + deleteInstanceConfig( + request?: protos.google.spanner.admin.instance.v1.IDeleteInstanceConfigRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.spanner.admin.instance.v1.IDeleteInstanceConfigRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.spanner.admin.instance.v1.IDeleteInstanceConfigRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.spanner.admin.instance.v1.IDeleteInstanceConfigRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('deleteInstanceConfig request %j', request); + const wrappedCallback: Callback< + protos.google.protobuf.IEmpty, + protos.google.spanner.admin.instance.v1.IDeleteInstanceConfigRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteInstanceConfig response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.deleteInstanceConfig(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.spanner.admin.instance.v1.IDeleteInstanceConfigRequest|undefined, + {}|undefined + ]) => { + this._log.info('deleteInstanceConfig response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Gets information about a particular instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the requested instance. Values are of the form + * `projects//instances/`. + * @param {google.protobuf.FieldMask} request.fieldMask + * If field_mask is present, specifies the subset of + * {@link protos.google.spanner.admin.instance.v1.Instance|Instance} fields that should be + * returned. If absent, all + * {@link protos.google.spanner.admin.instance.v1.Instance|Instance} fields are returned. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.spanner.admin.instance.v1.Instance|Instance}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + */ + getInstance( + request?: protos.google.spanner.admin.instance.v1.IGetInstanceRequest, + options?: CallOptions): + Promise<[ + protos.google.spanner.admin.instance.v1.IInstance, + protos.google.spanner.admin.instance.v1.IGetInstanceRequest|undefined, {}|undefined + ]>; + getInstance( + request: protos.google.spanner.admin.instance.v1.IGetInstanceRequest, + options: CallOptions, + callback: Callback< + protos.google.spanner.admin.instance.v1.IInstance, + protos.google.spanner.admin.instance.v1.IGetInstanceRequest|null|undefined, + {}|null|undefined>): void; + getInstance( + request: protos.google.spanner.admin.instance.v1.IGetInstanceRequest, + callback: Callback< + protos.google.spanner.admin.instance.v1.IInstance, + protos.google.spanner.admin.instance.v1.IGetInstanceRequest|null|undefined, + {}|null|undefined>): void; + getInstance( + request?: protos.google.spanner.admin.instance.v1.IGetInstanceRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.spanner.admin.instance.v1.IInstance, + protos.google.spanner.admin.instance.v1.IGetInstanceRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.spanner.admin.instance.v1.IInstance, + protos.google.spanner.admin.instance.v1.IGetInstanceRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.spanner.admin.instance.v1.IInstance, + protos.google.spanner.admin.instance.v1.IGetInstanceRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getInstance request %j', request); + const wrappedCallback: Callback< + protos.google.spanner.admin.instance.v1.IInstance, + protos.google.spanner.admin.instance.v1.IGetInstanceRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getInstance response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getInstance(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.spanner.admin.instance.v1.IInstance, + protos.google.spanner.admin.instance.v1.IGetInstanceRequest|undefined, + {}|undefined + ]) => { + this._log.info('getInstance response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Deletes an instance. + * + * Immediately upon completion of the request: + * + * * Billing ceases for all of the instance's reserved resources. + * + * Soon afterward: + * + * * The instance and *all of its databases* immediately and + * irrevocably disappear from the API. All data in the databases + * is permanently deleted. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the instance to be deleted. Values are of the form + * `projects//instances/` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + */ + deleteInstance( + request?: protos.google.spanner.admin.instance.v1.IDeleteInstanceRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.spanner.admin.instance.v1.IDeleteInstanceRequest|undefined, {}|undefined + ]>; + deleteInstance( + request: protos.google.spanner.admin.instance.v1.IDeleteInstanceRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.spanner.admin.instance.v1.IDeleteInstanceRequest|null|undefined, + {}|null|undefined>): void; + deleteInstance( + request: protos.google.spanner.admin.instance.v1.IDeleteInstanceRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.spanner.admin.instance.v1.IDeleteInstanceRequest|null|undefined, + {}|null|undefined>): void; + deleteInstance( + request?: protos.google.spanner.admin.instance.v1.IDeleteInstanceRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.spanner.admin.instance.v1.IDeleteInstanceRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.spanner.admin.instance.v1.IDeleteInstanceRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.spanner.admin.instance.v1.IDeleteInstanceRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('deleteInstance request %j', request); + const wrappedCallback: Callback< + protos.google.protobuf.IEmpty, + protos.google.spanner.admin.instance.v1.IDeleteInstanceRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteInstance response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.deleteInstance(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.spanner.admin.instance.v1.IDeleteInstanceRequest|undefined, + {}|undefined + ]) => { + this._log.info('deleteInstance response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Sets the access control policy on an instance resource. Replaces any + * existing policy. + * + * Authorization requires `spanner.instances.setIamPolicy` on + * {@link protos.google.iam.v1.SetIamPolicyRequest.resource|resource}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being specified. + * See the operation documentation for the appropriate value for this field. + * @param {google.iam.v1.Policy} request.policy + * REQUIRED: The complete policy to be applied to the `resource`. The size of + * the policy is limited to a few 10s of KB. An empty policy is a + * valid policy but certain Cloud Platform services (such as Projects) + * might reject them. + * @param {google.protobuf.FieldMask} request.updateMask + * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + * the fields in the mask will be modified. If no mask is provided, the + * following default mask is used: + * + * `paths: "bindings, etag"` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.iam.v1.Policy|Policy}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + */ + setIamPolicy( + request?: protos.google.iam.v1.ISetIamPolicyRequest, + options?: CallOptions): + Promise<[ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest|undefined, {}|undefined + ]>; + setIamPolicy( + request: protos.google.iam.v1.ISetIamPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, + {}|null|undefined>): void; + setIamPolicy( + request: protos.google.iam.v1.ISetIamPolicyRequest, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, + {}|null|undefined>): void; + setIamPolicy( + request?: protos.google.iam.v1.ISetIamPolicyRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'resource': request.resource ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('setIamPolicy request %j', request); + const wrappedCallback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('setIamPolicy response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.setIamPolicy(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest|undefined, + {}|undefined + ]) => { + this._log.info('setIamPolicy response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Gets the access control policy for an instance resource. Returns an empty + * policy if an instance exists but does not have a policy set. + * + * Authorization requires `spanner.instances.getIamPolicy` on + * {@link protos.google.iam.v1.GetIamPolicyRequest.resource|resource}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {google.iam.v1.GetPolicyOptions} request.options + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.iam.v1.Policy|Policy}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + */ + getIamPolicy( + request?: protos.google.iam.v1.IGetIamPolicyRequest, + options?: CallOptions): + Promise<[ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest|undefined, {}|undefined + ]>; + getIamPolicy( + request: protos.google.iam.v1.IGetIamPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, + {}|null|undefined>): void; + getIamPolicy( + request: protos.google.iam.v1.IGetIamPolicyRequest, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, + {}|null|undefined>): void; + getIamPolicy( + request?: protos.google.iam.v1.IGetIamPolicyRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'resource': request.resource ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getIamPolicy request %j', request); + const wrappedCallback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getIamPolicy response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getIamPolicy(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest|undefined, + {}|undefined + ]) => { + this._log.info('getIamPolicy response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Returns permissions that the caller has on the specified instance resource. + * + * Attempting this RPC on a non-existent Cloud Spanner instance resource will + * result in a NOT_FOUND error if the user has `spanner.instances.list` + * permission on the containing Google Cloud Project. Otherwise returns an + * empty set of permissions. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.iam.v1.TestIamPermissionsResponse|TestIamPermissionsResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + */ + testIamPermissions( + request?: protos.google.iam.v1.ITestIamPermissionsRequest, + options?: CallOptions): + Promise<[ + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest|undefined, {}|undefined + ]>; + testIamPermissions( + request: protos.google.iam.v1.ITestIamPermissionsRequest, + options: CallOptions, + callback: Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, + {}|null|undefined>): void; + testIamPermissions( + request: protos.google.iam.v1.ITestIamPermissionsRequest, + callback: Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, + {}|null|undefined>): void; + testIamPermissions( + request?: protos.google.iam.v1.ITestIamPermissionsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'resource': request.resource ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('testIamPermissions request %j', request); + const wrappedCallback: Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('testIamPermissions response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.testIamPermissions(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest|undefined, + {}|undefined + ]) => { + this._log.info('testIamPermissions response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Gets information about a particular instance partition. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the requested instance partition. Values are of + * the form + * `projects/{project}/instances/{instance}/instancePartitions/{instance_partition}`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.spanner.admin.instance.v1.InstancePartition|InstancePartition}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + */ + getInstancePartition( + request?: protos.google.spanner.admin.instance.v1.IGetInstancePartitionRequest, + options?: CallOptions): + Promise<[ + protos.google.spanner.admin.instance.v1.IInstancePartition, + protos.google.spanner.admin.instance.v1.IGetInstancePartitionRequest|undefined, {}|undefined + ]>; + getInstancePartition( + request: protos.google.spanner.admin.instance.v1.IGetInstancePartitionRequest, + options: CallOptions, + callback: Callback< + protos.google.spanner.admin.instance.v1.IInstancePartition, + protos.google.spanner.admin.instance.v1.IGetInstancePartitionRequest|null|undefined, + {}|null|undefined>): void; + getInstancePartition( + request: protos.google.spanner.admin.instance.v1.IGetInstancePartitionRequest, + callback: Callback< + protos.google.spanner.admin.instance.v1.IInstancePartition, + protos.google.spanner.admin.instance.v1.IGetInstancePartitionRequest|null|undefined, + {}|null|undefined>): void; + getInstancePartition( + request?: protos.google.spanner.admin.instance.v1.IGetInstancePartitionRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.spanner.admin.instance.v1.IInstancePartition, + protos.google.spanner.admin.instance.v1.IGetInstancePartitionRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.spanner.admin.instance.v1.IInstancePartition, + protos.google.spanner.admin.instance.v1.IGetInstancePartitionRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.spanner.admin.instance.v1.IInstancePartition, + protos.google.spanner.admin.instance.v1.IGetInstancePartitionRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getInstancePartition request %j', request); + const wrappedCallback: Callback< + protos.google.spanner.admin.instance.v1.IInstancePartition, + protos.google.spanner.admin.instance.v1.IGetInstancePartitionRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getInstancePartition response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getInstancePartition(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.spanner.admin.instance.v1.IInstancePartition, + protos.google.spanner.admin.instance.v1.IGetInstancePartitionRequest|undefined, + {}|undefined + ]) => { + this._log.info('getInstancePartition response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Deletes an existing instance partition. Requires that the + * instance partition is not used by any database or backup and is not the + * default instance partition of an instance. + * + * Authorization requires `spanner.instancePartitions.delete` permission on + * the resource + * {@link protos.google.spanner.admin.instance.v1.InstancePartition.name|name}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the instance partition to be deleted. + * Values are of the form + * `projects/{project}/instances/{instance}/instancePartitions/{instance_partition}` + * @param {string} request.etag + * Optional. If not empty, the API only deletes the instance partition when + * the etag provided matches the current status of the requested instance + * partition. Otherwise, deletes the instance partition without checking the + * current status of the requested instance partition. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + */ + deleteInstancePartition( + request?: protos.google.spanner.admin.instance.v1.IDeleteInstancePartitionRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.spanner.admin.instance.v1.IDeleteInstancePartitionRequest|undefined, {}|undefined + ]>; + deleteInstancePartition( + request: protos.google.spanner.admin.instance.v1.IDeleteInstancePartitionRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.spanner.admin.instance.v1.IDeleteInstancePartitionRequest|null|undefined, + {}|null|undefined>): void; + deleteInstancePartition( + request: protos.google.spanner.admin.instance.v1.IDeleteInstancePartitionRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.spanner.admin.instance.v1.IDeleteInstancePartitionRequest|null|undefined, + {}|null|undefined>): void; + deleteInstancePartition( + request?: protos.google.spanner.admin.instance.v1.IDeleteInstancePartitionRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.spanner.admin.instance.v1.IDeleteInstancePartitionRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.spanner.admin.instance.v1.IDeleteInstancePartitionRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.spanner.admin.instance.v1.IDeleteInstancePartitionRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('deleteInstancePartition request %j', request); + const wrappedCallback: Callback< + protos.google.protobuf.IEmpty, + protos.google.spanner.admin.instance.v1.IDeleteInstancePartitionRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteInstancePartition response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.deleteInstancePartition(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.spanner.admin.instance.v1.IDeleteInstancePartitionRequest|undefined, + {}|undefined + ]) => { + this._log.info('deleteInstancePartition response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } + +/** + * Creates an instance configuration and begins preparing it to be used. The + * returned long-running operation + * can be used to track the progress of preparing the new + * instance configuration. The instance configuration name is assigned by the + * caller. If the named instance configuration already exists, + * `CreateInstanceConfig` returns `ALREADY_EXISTS`. + * + * Immediately after the request returns: + * + * * The instance configuration is readable via the API, with all requested + * attributes. The instance configuration's + * {@link protos.google.spanner.admin.instance.v1.InstanceConfig.reconciling|reconciling} + * field is set to true. Its state is `CREATING`. + * + * While the operation is pending: + * + * * Cancelling the operation renders the instance configuration immediately + * unreadable via the API. + * * Except for deleting the creating resource, all other attempts to modify + * the instance configuration are rejected. + * + * Upon completion of the returned operation: + * + * * Instances can be created using the instance configuration. + * * The instance configuration's + * {@link protos.google.spanner.admin.instance.v1.InstanceConfig.reconciling|reconciling} + * field becomes false. Its state becomes `READY`. + * + * The returned long-running operation will + * have a name of the format + * `/operations/` and can be used to track + * creation of the instance configuration. The + * metadata field type is + * {@link protos.google.spanner.admin.instance.v1.CreateInstanceConfigMetadata|CreateInstanceConfigMetadata}. + * The response field type is + * {@link protos.google.spanner.admin.instance.v1.InstanceConfig|InstanceConfig}, if + * successful. + * + * Authorization requires `spanner.instanceConfigs.create` permission on + * the resource + * {@link protos.google.spanner.admin.instance.v1.CreateInstanceConfigRequest.parent|parent}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the project in which to create the instance + * configuration. Values are of the form `projects/`. + * @param {string} request.instanceConfigId + * Required. The ID of the instance configuration to create. Valid identifiers + * are of the form `custom-[-a-z0-9]*[a-z0-9]` and must be between 2 and 64 + * characters in length. The `custom-` prefix is required to avoid name + * conflicts with Google-managed configurations. + * @param {google.spanner.admin.instance.v1.InstanceConfig} request.instanceConfig + * Required. The `InstanceConfig` proto of the configuration to create. + * `instance_config.name` must be + * `/instanceConfigs/`. + * `instance_config.base_config` must be a Google-managed configuration name, + * e.g. /instanceConfigs/us-east1, /instanceConfigs/nam3. + * @param {boolean} request.validateOnly + * An option to validate, but not actually execute, a request, + * and provide the same response. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + */ + createInstanceConfig( + request?: protos.google.spanner.admin.instance.v1.ICreateInstanceConfigRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createInstanceConfig( + request: protos.google.spanner.admin.instance.v1.ICreateInstanceConfigRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createInstanceConfig( + request: protos.google.spanner.admin.instance.v1.ICreateInstanceConfigRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createInstanceConfig( + request?: protos.google.spanner.admin.instance.v1.ICreateInstanceConfigRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createInstanceConfig response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createInstanceConfig request %j', request); + return this.innerApiCalls.createInstanceConfig(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('createInstanceConfig response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `createInstanceConfig()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + */ + async checkCreateInstanceConfigProgress(name: string): Promise>{ + this._log.info('createInstanceConfig long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createInstanceConfig, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Updates an instance configuration. The returned + * long-running operation can be used to track + * the progress of updating the instance. If the named instance configuration + * does not exist, returns `NOT_FOUND`. + * + * Only user-managed configurations can be updated. + * + * Immediately after the request returns: + * + * * The instance configuration's + * {@link protos.google.spanner.admin.instance.v1.InstanceConfig.reconciling|reconciling} + * field is set to true. + * + * While the operation is pending: + * + * * Cancelling the operation sets its metadata's + * {@link protos.google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata.cancel_time|cancel_time}. + * The operation is guaranteed to succeed at undoing all changes, after + * which point it terminates with a `CANCELLED` status. + * * All other attempts to modify the instance configuration are rejected. + * * Reading the instance configuration via the API continues to give the + * pre-request values. + * + * Upon completion of the returned operation: + * + * * Creating instances using the instance configuration uses the new + * values. + * * The new values of the instance configuration are readable via the API. + * * The instance configuration's + * {@link protos.google.spanner.admin.instance.v1.InstanceConfig.reconciling|reconciling} + * field becomes false. + * + * The returned long-running operation will + * have a name of the format + * `/operations/` and can be used to track + * the instance configuration modification. The + * metadata field type is + * {@link protos.google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata|UpdateInstanceConfigMetadata}. + * The response field type is + * {@link protos.google.spanner.admin.instance.v1.InstanceConfig|InstanceConfig}, if + * successful. + * + * Authorization requires `spanner.instanceConfigs.update` permission on + * the resource {@link protos.google.spanner.admin.instance.v1.InstanceConfig.name|name}. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.spanner.admin.instance.v1.InstanceConfig} request.instanceConfig + * Required. The user instance configuration to update, which must always + * include the instance configuration name. Otherwise, only fields mentioned + * in + * {@link protos.google.spanner.admin.instance.v1.UpdateInstanceConfigRequest.update_mask|update_mask} + * need be included. To prevent conflicts of concurrent updates, + * {@link protos.google.spanner.admin.instance.v1.InstanceConfig.reconciling|etag} can + * be used. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. A mask specifying which fields in + * {@link protos.google.spanner.admin.instance.v1.InstanceConfig|InstanceConfig} should be + * updated. The field mask must always be specified; this prevents any future + * fields in {@link protos.google.spanner.admin.instance.v1.InstanceConfig|InstanceConfig} + * from being erased accidentally by clients that do not know about them. Only + * display_name and labels can be updated. + * @param {boolean} request.validateOnly + * An option to validate, but not actually execute, a request, + * and provide the same response. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + */ + updateInstanceConfig( + request?: protos.google.spanner.admin.instance.v1.IUpdateInstanceConfigRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + updateInstanceConfig( + request: protos.google.spanner.admin.instance.v1.IUpdateInstanceConfigRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateInstanceConfig( + request: protos.google.spanner.admin.instance.v1.IUpdateInstanceConfigRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateInstanceConfig( + request?: protos.google.spanner.admin.instance.v1.IUpdateInstanceConfigRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'instance_config.name': request.instanceConfig!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateInstanceConfig response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateInstanceConfig request %j', request); + return this.innerApiCalls.updateInstanceConfig(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('updateInstanceConfig response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `updateInstanceConfig()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + */ + async checkUpdateInstanceConfigProgress(name: string): Promise>{ + this._log.info('updateInstanceConfig long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateInstanceConfig, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Creates an instance and begins preparing it to begin serving. The + * returned long-running operation + * can be used to track the progress of preparing the new + * instance. The instance name is assigned by the caller. If the + * named instance already exists, `CreateInstance` returns + * `ALREADY_EXISTS`. + * + * Immediately upon completion of this request: + * + * * The instance is readable via the API, with all requested attributes + * but no allocated resources. Its state is `CREATING`. + * + * Until completion of the returned operation: + * + * * Cancelling the operation renders the instance immediately unreadable + * via the API. + * * The instance can be deleted. + * * All other attempts to modify the instance are rejected. + * + * Upon completion of the returned operation: + * + * * Billing for all successfully-allocated resources begins (some types + * may have lower than the requested levels). + * * Databases can be created in the instance. + * * The instance's allocated resource levels are readable via the API. + * * The instance's state becomes `READY`. + * + * The returned long-running operation will + * have a name of the format `/operations/` and + * can be used to track creation of the instance. The + * metadata field type is + * {@link protos.google.spanner.admin.instance.v1.CreateInstanceMetadata|CreateInstanceMetadata}. + * The response field type is + * {@link protos.google.spanner.admin.instance.v1.Instance|Instance}, if successful. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the project in which to create the instance. Values + * are of the form `projects/`. + * @param {string} request.instanceId + * Required. The ID of the instance to create. Valid identifiers are of the + * form `{@link protos.-a-z0-9|a-z}*[a-z0-9]` and must be between 2 and 64 characters in + * length. + * @param {google.spanner.admin.instance.v1.Instance} request.instance + * Required. The instance to create. The name may be omitted, but if + * specified must be `/instances/`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + */ + createInstance( + request?: protos.google.spanner.admin.instance.v1.ICreateInstanceRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createInstance( + request: protos.google.spanner.admin.instance.v1.ICreateInstanceRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createInstance( + request: protos.google.spanner.admin.instance.v1.ICreateInstanceRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createInstance( + request?: protos.google.spanner.admin.instance.v1.ICreateInstanceRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createInstance response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createInstance request %j', request); + return this.innerApiCalls.createInstance(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('createInstance response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `createInstance()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + */ + async checkCreateInstanceProgress(name: string): Promise>{ + this._log.info('createInstance long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createInstance, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Updates an instance, and begins allocating or releasing resources + * as requested. The returned long-running operation can be used to track the + * progress of updating the instance. If the named instance does not + * exist, returns `NOT_FOUND`. + * + * Immediately upon completion of this request: + * + * * For resource types for which a decrease in the instance's allocation + * has been requested, billing is based on the newly-requested level. + * + * Until completion of the returned operation: + * + * * Cancelling the operation sets its metadata's + * {@link protos.google.spanner.admin.instance.v1.UpdateInstanceMetadata.cancel_time|cancel_time}, + * and begins restoring resources to their pre-request values. The + * operation is guaranteed to succeed at undoing all resource changes, + * after which point it terminates with a `CANCELLED` status. + * * All other attempts to modify the instance are rejected. + * * Reading the instance via the API continues to give the pre-request + * resource levels. + * + * Upon completion of the returned operation: + * + * * Billing begins for all successfully-allocated resources (some types + * may have lower than the requested levels). + * * All newly-reserved resources are available for serving the instance's + * tables. + * * The instance's new resource levels are readable via the API. + * + * The returned long-running operation will + * have a name of the format `/operations/` and + * can be used to track the instance modification. The + * metadata field type is + * {@link protos.google.spanner.admin.instance.v1.UpdateInstanceMetadata|UpdateInstanceMetadata}. + * The response field type is + * {@link protos.google.spanner.admin.instance.v1.Instance|Instance}, if successful. + * + * Authorization requires `spanner.instances.update` permission on + * the resource {@link protos.google.spanner.admin.instance.v1.Instance.name|name}. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.spanner.admin.instance.v1.Instance} request.instance + * Required. The instance to update, which must always include the instance + * name. Otherwise, only fields mentioned in + * {@link protos.google.spanner.admin.instance.v1.UpdateInstanceRequest.field_mask|field_mask} + * need be included. + * @param {google.protobuf.FieldMask} request.fieldMask + * Required. A mask specifying which fields in + * {@link protos.google.spanner.admin.instance.v1.Instance|Instance} should be updated. + * The field mask must always be specified; this prevents any future fields in + * {@link protos.google.spanner.admin.instance.v1.Instance|Instance} from being erased + * accidentally by clients that do not know about them. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + */ + updateInstance( + request?: protos.google.spanner.admin.instance.v1.IUpdateInstanceRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + updateInstance( + request: protos.google.spanner.admin.instance.v1.IUpdateInstanceRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateInstance( + request: protos.google.spanner.admin.instance.v1.IUpdateInstanceRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateInstance( + request?: protos.google.spanner.admin.instance.v1.IUpdateInstanceRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'instance.name': request.instance!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateInstance response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateInstance request %j', request); + return this.innerApiCalls.updateInstance(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('updateInstance response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `updateInstance()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + */ + async checkUpdateInstanceProgress(name: string): Promise>{ + this._log.info('updateInstance long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateInstance, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Creates an instance partition and begins preparing it to be used. The + * returned long-running operation + * can be used to track the progress of preparing the new instance partition. + * The instance partition name is assigned by the caller. If the named + * instance partition already exists, `CreateInstancePartition` returns + * `ALREADY_EXISTS`. + * + * Immediately upon completion of this request: + * + * * The instance partition is readable via the API, with all requested + * attributes but no allocated resources. Its state is `CREATING`. + * + * Until completion of the returned operation: + * + * * Cancelling the operation renders the instance partition immediately + * unreadable via the API. + * * The instance partition can be deleted. + * * All other attempts to modify the instance partition are rejected. + * + * Upon completion of the returned operation: + * + * * Billing for all successfully-allocated resources begins (some types + * may have lower than the requested levels). + * * Databases can start using this instance partition. + * * The instance partition's allocated resource levels are readable via the + * API. + * * The instance partition's state becomes `READY`. + * + * The returned long-running operation will + * have a name of the format + * `/operations/` and can be used to + * track creation of the instance partition. The + * metadata field type is + * {@link protos.google.spanner.admin.instance.v1.CreateInstancePartitionMetadata|CreateInstancePartitionMetadata}. + * The response field type is + * {@link protos.google.spanner.admin.instance.v1.InstancePartition|InstancePartition}, if + * successful. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the instance in which to create the instance + * partition. Values are of the form + * `projects//instances/`. + * @param {string} request.instancePartitionId + * Required. The ID of the instance partition to create. Valid identifiers are + * of the form `{@link protos.-a-z0-9|a-z}*[a-z0-9]` and must be between 2 and 64 + * characters in length. + * @param {google.spanner.admin.instance.v1.InstancePartition} request.instancePartition + * Required. The instance partition to create. The instance_partition.name may + * be omitted, but if specified must be + * `/instancePartitions/`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + */ + createInstancePartition( + request?: protos.google.spanner.admin.instance.v1.ICreateInstancePartitionRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createInstancePartition( + request: protos.google.spanner.admin.instance.v1.ICreateInstancePartitionRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createInstancePartition( + request: protos.google.spanner.admin.instance.v1.ICreateInstancePartitionRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createInstancePartition( + request?: protos.google.spanner.admin.instance.v1.ICreateInstancePartitionRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createInstancePartition response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createInstancePartition request %j', request); + return this.innerApiCalls.createInstancePartition(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('createInstancePartition response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `createInstancePartition()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + */ + async checkCreateInstancePartitionProgress(name: string): Promise>{ + this._log.info('createInstancePartition long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createInstancePartition, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Updates an instance partition, and begins allocating or releasing resources + * as requested. The returned long-running operation can be used to track the + * progress of updating the instance partition. If the named instance + * partition does not exist, returns `NOT_FOUND`. + * + * Immediately upon completion of this request: + * + * * For resource types for which a decrease in the instance partition's + * allocation has been requested, billing is based on the newly-requested + * level. + * + * Until completion of the returned operation: + * + * * Cancelling the operation sets its metadata's + * {@link protos.google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata.cancel_time|cancel_time}, + * and begins restoring resources to their pre-request values. The + * operation is guaranteed to succeed at undoing all resource changes, + * after which point it terminates with a `CANCELLED` status. + * * All other attempts to modify the instance partition are rejected. + * * Reading the instance partition via the API continues to give the + * pre-request resource levels. + * + * Upon completion of the returned operation: + * + * * Billing begins for all successfully-allocated resources (some types + * may have lower than the requested levels). + * * All newly-reserved resources are available for serving the instance + * partition's tables. + * * The instance partition's new resource levels are readable via the API. + * + * The returned long-running operation will + * have a name of the format + * `/operations/` and can be used to + * track the instance partition modification. The + * metadata field type is + * {@link protos.google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata|UpdateInstancePartitionMetadata}. + * The response field type is + * {@link protos.google.spanner.admin.instance.v1.InstancePartition|InstancePartition}, if + * successful. + * + * Authorization requires `spanner.instancePartitions.update` permission on + * the resource + * {@link protos.google.spanner.admin.instance.v1.InstancePartition.name|name}. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.spanner.admin.instance.v1.InstancePartition} request.instancePartition + * Required. The instance partition to update, which must always include the + * instance partition name. Otherwise, only fields mentioned in + * {@link protos.google.spanner.admin.instance.v1.UpdateInstancePartitionRequest.field_mask|field_mask} + * need be included. + * @param {google.protobuf.FieldMask} request.fieldMask + * Required. A mask specifying which fields in + * {@link protos.google.spanner.admin.instance.v1.InstancePartition|InstancePartition} + * should be updated. The field mask must always be specified; this prevents + * any future fields in + * {@link protos.google.spanner.admin.instance.v1.InstancePartition|InstancePartition} + * from being erased accidentally by clients that do not know about them. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + */ + updateInstancePartition( + request?: protos.google.spanner.admin.instance.v1.IUpdateInstancePartitionRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + updateInstancePartition( + request: protos.google.spanner.admin.instance.v1.IUpdateInstancePartitionRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateInstancePartition( + request: protos.google.spanner.admin.instance.v1.IUpdateInstancePartitionRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateInstancePartition( + request?: protos.google.spanner.admin.instance.v1.IUpdateInstancePartitionRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'instance_partition.name': request.instancePartition!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateInstancePartition response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateInstancePartition request %j', request); + return this.innerApiCalls.updateInstancePartition(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('updateInstancePartition response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `updateInstancePartition()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + */ + async checkUpdateInstancePartitionProgress(name: string): Promise>{ + this._log.info('updateInstancePartition long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateInstancePartition, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Moves an instance to the target instance configuration. You can use the + * returned long-running operation to track + * the progress of moving the instance. + * + * `MoveInstance` returns `FAILED_PRECONDITION` if the instance meets any of + * the following criteria: + * + * * Is undergoing a move to a different instance configuration + * * Has backups + * * Has an ongoing update + * * Contains any CMEK-enabled databases + * * Is a free trial instance + * + * While the operation is pending: + * + * * All other attempts to modify the instance, including changes to its + * compute capacity, are rejected. + * * The following database and backup admin operations are rejected: + * + * * `DatabaseAdmin.CreateDatabase` + * * `DatabaseAdmin.UpdateDatabaseDdl` (disabled if default_leader is + * specified in the request.) + * * `DatabaseAdmin.RestoreDatabase` + * * `DatabaseAdmin.CreateBackup` + * * `DatabaseAdmin.CopyBackup` + * + * * Both the source and target instance configurations are subject to + * hourly compute and storage charges. + * * The instance might experience higher read-write latencies and a higher + * transaction abort rate. However, moving an instance doesn't cause any + * downtime. + * + * The returned long-running operation has + * a name of the format + * `/operations/` and can be used to track + * the move instance operation. The + * metadata field type is + * {@link protos.google.spanner.admin.instance.v1.MoveInstanceMetadata|MoveInstanceMetadata}. + * The response field type is + * {@link protos.google.spanner.admin.instance.v1.Instance|Instance}, + * if successful. + * Cancelling the operation sets its metadata's + * {@link protos.google.spanner.admin.instance.v1.MoveInstanceMetadata.cancel_time|cancel_time}. + * Cancellation is not immediate because it involves moving any data + * previously moved to the target instance configuration back to the original + * instance configuration. You can use this operation to track the progress of + * the cancellation. Upon successful completion of the cancellation, the + * operation terminates with `CANCELLED` status. + * + * If not cancelled, upon completion of the returned operation: + * + * * The instance successfully moves to the target instance + * configuration. + * * You are billed for compute and storage in target instance + * configuration. + * + * Authorization requires the `spanner.instances.update` permission on + * the resource {@link protos.google.spanner.admin.instance.v1.Instance|instance}. + * + * For more details, see + * [Move an instance](https://cloud.google.com/spanner/docs/move-instance). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The instance to move. + * Values are of the form `projects//instances/`. + * @param {string} request.targetConfig + * Required. The target instance configuration where to move the instance. + * Values are of the form `projects//instanceConfigs/`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + */ + moveInstance( + request?: protos.google.spanner.admin.instance.v1.IMoveInstanceRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + moveInstance( + request: protos.google.spanner.admin.instance.v1.IMoveInstanceRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + moveInstance( + request: protos.google.spanner.admin.instance.v1.IMoveInstanceRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + moveInstance( + request?: protos.google.spanner.admin.instance.v1.IMoveInstanceRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('moveInstance response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('moveInstance request %j', request); + return this.innerApiCalls.moveInstance(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('moveInstance response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `moveInstance()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + */ + async checkMoveInstanceProgress(name: string): Promise>{ + this._log.info('moveInstance long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.moveInstance, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } + /** + * Lists the supported instance configurations for a given project. + * + * Returns both Google-managed configurations and user-managed + * configurations. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the project for which a list of supported instance + * configurations is requested. Values are of the form + * `projects/`. + * @param {number} request.pageSize + * Number of instance configurations to be returned in the response. If 0 or + * less, defaults to the server's maximum allowed page size. + * @param {string} request.pageToken + * If non-empty, `page_token` should contain a + * {@link protos.google.spanner.admin.instance.v1.ListInstanceConfigsResponse.next_page_token|next_page_token} + * from a previous + * {@link protos.google.spanner.admin.instance.v1.ListInstanceConfigsResponse|ListInstanceConfigsResponse}. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.spanner.admin.instance.v1.InstanceConfig|InstanceConfig}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listInstanceConfigsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listInstanceConfigs( + request?: protos.google.spanner.admin.instance.v1.IListInstanceConfigsRequest, + options?: CallOptions): + Promise<[ + protos.google.spanner.admin.instance.v1.IInstanceConfig[], + protos.google.spanner.admin.instance.v1.IListInstanceConfigsRequest|null, + protos.google.spanner.admin.instance.v1.IListInstanceConfigsResponse + ]>; + listInstanceConfigs( + request: protos.google.spanner.admin.instance.v1.IListInstanceConfigsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.spanner.admin.instance.v1.IListInstanceConfigsRequest, + protos.google.spanner.admin.instance.v1.IListInstanceConfigsResponse|null|undefined, + protos.google.spanner.admin.instance.v1.IInstanceConfig>): void; + listInstanceConfigs( + request: protos.google.spanner.admin.instance.v1.IListInstanceConfigsRequest, + callback: PaginationCallback< + protos.google.spanner.admin.instance.v1.IListInstanceConfigsRequest, + protos.google.spanner.admin.instance.v1.IListInstanceConfigsResponse|null|undefined, + protos.google.spanner.admin.instance.v1.IInstanceConfig>): void; + listInstanceConfigs( + request?: protos.google.spanner.admin.instance.v1.IListInstanceConfigsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.spanner.admin.instance.v1.IListInstanceConfigsRequest, + protos.google.spanner.admin.instance.v1.IListInstanceConfigsResponse|null|undefined, + protos.google.spanner.admin.instance.v1.IInstanceConfig>, + callback?: PaginationCallback< + protos.google.spanner.admin.instance.v1.IListInstanceConfigsRequest, + protos.google.spanner.admin.instance.v1.IListInstanceConfigsResponse|null|undefined, + protos.google.spanner.admin.instance.v1.IInstanceConfig>): + Promise<[ + protos.google.spanner.admin.instance.v1.IInstanceConfig[], + protos.google.spanner.admin.instance.v1.IListInstanceConfigsRequest|null, + protos.google.spanner.admin.instance.v1.IListInstanceConfigsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.spanner.admin.instance.v1.IListInstanceConfigsRequest, + protos.google.spanner.admin.instance.v1.IListInstanceConfigsResponse|null|undefined, + protos.google.spanner.admin.instance.v1.IInstanceConfig>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listInstanceConfigs values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listInstanceConfigs request %j', request); + return this.innerApiCalls + .listInstanceConfigs(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.spanner.admin.instance.v1.IInstanceConfig[], + protos.google.spanner.admin.instance.v1.IListInstanceConfigsRequest|null, + protos.google.spanner.admin.instance.v1.IListInstanceConfigsResponse + ]) => { + this._log.info('listInstanceConfigs values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listInstanceConfigs`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the project for which a list of supported instance + * configurations is requested. Values are of the form + * `projects/`. + * @param {number} request.pageSize + * Number of instance configurations to be returned in the response. If 0 or + * less, defaults to the server's maximum allowed page size. + * @param {string} request.pageToken + * If non-empty, `page_token` should contain a + * {@link protos.google.spanner.admin.instance.v1.ListInstanceConfigsResponse.next_page_token|next_page_token} + * from a previous + * {@link protos.google.spanner.admin.instance.v1.ListInstanceConfigsResponse|ListInstanceConfigsResponse}. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.spanner.admin.instance.v1.InstanceConfig|InstanceConfig} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listInstanceConfigsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listInstanceConfigsStream( + request?: protos.google.spanner.admin.instance.v1.IListInstanceConfigsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listInstanceConfigs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listInstanceConfigs stream %j', request); + return this.descriptors.page.listInstanceConfigs.createStream( + this.innerApiCalls.listInstanceConfigs as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listInstanceConfigs`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the project for which a list of supported instance + * configurations is requested. Values are of the form + * `projects/`. + * @param {number} request.pageSize + * Number of instance configurations to be returned in the response. If 0 or + * less, defaults to the server's maximum allowed page size. + * @param {string} request.pageToken + * If non-empty, `page_token` should contain a + * {@link protos.google.spanner.admin.instance.v1.ListInstanceConfigsResponse.next_page_token|next_page_token} + * from a previous + * {@link protos.google.spanner.admin.instance.v1.ListInstanceConfigsResponse|ListInstanceConfigsResponse}. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.spanner.admin.instance.v1.InstanceConfig|InstanceConfig}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listInstanceConfigsAsync( + request?: protos.google.spanner.admin.instance.v1.IListInstanceConfigsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listInstanceConfigs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listInstanceConfigs iterate %j', request); + return this.descriptors.page.listInstanceConfigs.asyncIterate( + this.innerApiCalls['listInstanceConfigs'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists the user-managed instance configuration long-running + * operations in the given project. An instance + * configuration operation has a name of the form + * `projects//instanceConfigs//operations/`. + * The long-running operation + * metadata field type + * `metadata.type_url` describes the type of the metadata. Operations returned + * include those that have completed/failed/canceled within the last 7 days, + * and pending operations. Operations returned are ordered by + * `operation.metadata.value.start_time` in descending order starting + * from the most recently started operation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project of the instance configuration operations. + * Values are of the form `projects/`. + * @param {string} request.filter + * An expression that filters the list of returned operations. + * + * A filter expression consists of a field name, a + * comparison operator, and a value for filtering. + * The value must be a string, a number, or a boolean. The comparison operator + * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. + * Colon `:` is the contains operator. Filter rules are not case sensitive. + * + * The following fields in the Operation are eligible for filtering: + * + * * `name` - The name of the long-running operation + * * `done` - False if the operation is in progress, else true. + * * `metadata.@type` - the type of metadata. For example, the type string + * for + * {@link protos.google.spanner.admin.instance.v1.CreateInstanceConfigMetadata|CreateInstanceConfigMetadata} + * is + * `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstanceConfigMetadata`. + * * `metadata.` - any field in metadata.value. + * `metadata.@type` must be specified first, if filtering on metadata + * fields. + * * `error` - Error associated with the long-running operation. + * * `response.@type` - the type of response. + * * `response.` - any field in response.value. + * + * You can combine multiple expressions by enclosing each expression in + * parentheses. By default, expressions are combined with AND logic. However, + * you can specify AND, OR, and NOT logic explicitly. + * + * Here are a few examples: + * + * * `done:true` - The operation is complete. + * * `(metadata.@type=` \ + * `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstanceConfigMetadata) + * AND` \ + * `(metadata.instance_config.name:custom-config) AND` \ + * `(metadata.progress.start_time < \"2021-03-28T14:50:00Z\") AND` \ + * `(error:*)` - Return operations where: + * * The operation's metadata type is + * {@link protos.google.spanner.admin.instance.v1.CreateInstanceConfigMetadata|CreateInstanceConfigMetadata}. + * * The instance configuration name contains "custom-config". + * * The operation started before 2021-03-28T14:50:00Z. + * * The operation resulted in an error. + * @param {number} request.pageSize + * Number of operations to be returned in the response. If 0 or + * less, defaults to the server's maximum allowed page size. + * @param {string} request.pageToken + * If non-empty, `page_token` should contain a + * {@link protos.google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse.next_page_token|next_page_token} + * from a previous + * {@link protos.google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse|ListInstanceConfigOperationsResponse} + * to the same `parent` and with the same `filter`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.longrunning.Operation|Operation}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listInstanceConfigOperationsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listInstanceConfigOperations( + request?: protos.google.spanner.admin.instance.v1.IListInstanceConfigOperationsRequest, + options?: CallOptions): + Promise<[ + protos.google.longrunning.IOperation[], + protos.google.spanner.admin.instance.v1.IListInstanceConfigOperationsRequest|null, + protos.google.spanner.admin.instance.v1.IListInstanceConfigOperationsResponse + ]>; + listInstanceConfigOperations( + request: protos.google.spanner.admin.instance.v1.IListInstanceConfigOperationsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.spanner.admin.instance.v1.IListInstanceConfigOperationsRequest, + protos.google.spanner.admin.instance.v1.IListInstanceConfigOperationsResponse|null|undefined, + protos.google.longrunning.IOperation>): void; + listInstanceConfigOperations( + request: protos.google.spanner.admin.instance.v1.IListInstanceConfigOperationsRequest, + callback: PaginationCallback< + protos.google.spanner.admin.instance.v1.IListInstanceConfigOperationsRequest, + protos.google.spanner.admin.instance.v1.IListInstanceConfigOperationsResponse|null|undefined, + protos.google.longrunning.IOperation>): void; + listInstanceConfigOperations( + request?: protos.google.spanner.admin.instance.v1.IListInstanceConfigOperationsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.spanner.admin.instance.v1.IListInstanceConfigOperationsRequest, + protos.google.spanner.admin.instance.v1.IListInstanceConfigOperationsResponse|null|undefined, + protos.google.longrunning.IOperation>, + callback?: PaginationCallback< + protos.google.spanner.admin.instance.v1.IListInstanceConfigOperationsRequest, + protos.google.spanner.admin.instance.v1.IListInstanceConfigOperationsResponse|null|undefined, + protos.google.longrunning.IOperation>): + Promise<[ + protos.google.longrunning.IOperation[], + protos.google.spanner.admin.instance.v1.IListInstanceConfigOperationsRequest|null, + protos.google.spanner.admin.instance.v1.IListInstanceConfigOperationsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.spanner.admin.instance.v1.IListInstanceConfigOperationsRequest, + protos.google.spanner.admin.instance.v1.IListInstanceConfigOperationsResponse|null|undefined, + protos.google.longrunning.IOperation>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listInstanceConfigOperations values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listInstanceConfigOperations request %j', request); + return this.innerApiCalls + .listInstanceConfigOperations(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.longrunning.IOperation[], + protos.google.spanner.admin.instance.v1.IListInstanceConfigOperationsRequest|null, + protos.google.spanner.admin.instance.v1.IListInstanceConfigOperationsResponse + ]) => { + this._log.info('listInstanceConfigOperations values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listInstanceConfigOperations`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project of the instance configuration operations. + * Values are of the form `projects/`. + * @param {string} request.filter + * An expression that filters the list of returned operations. + * + * A filter expression consists of a field name, a + * comparison operator, and a value for filtering. + * The value must be a string, a number, or a boolean. The comparison operator + * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. + * Colon `:` is the contains operator. Filter rules are not case sensitive. + * + * The following fields in the Operation are eligible for filtering: + * + * * `name` - The name of the long-running operation + * * `done` - False if the operation is in progress, else true. + * * `metadata.@type` - the type of metadata. For example, the type string + * for + * {@link protos.google.spanner.admin.instance.v1.CreateInstanceConfigMetadata|CreateInstanceConfigMetadata} + * is + * `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstanceConfigMetadata`. + * * `metadata.` - any field in metadata.value. + * `metadata.@type` must be specified first, if filtering on metadata + * fields. + * * `error` - Error associated with the long-running operation. + * * `response.@type` - the type of response. + * * `response.` - any field in response.value. + * + * You can combine multiple expressions by enclosing each expression in + * parentheses. By default, expressions are combined with AND logic. However, + * you can specify AND, OR, and NOT logic explicitly. + * + * Here are a few examples: + * + * * `done:true` - The operation is complete. + * * `(metadata.@type=` \ + * `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstanceConfigMetadata) + * AND` \ + * `(metadata.instance_config.name:custom-config) AND` \ + * `(metadata.progress.start_time < \"2021-03-28T14:50:00Z\") AND` \ + * `(error:*)` - Return operations where: + * * The operation's metadata type is + * {@link protos.google.spanner.admin.instance.v1.CreateInstanceConfigMetadata|CreateInstanceConfigMetadata}. + * * The instance configuration name contains "custom-config". + * * The operation started before 2021-03-28T14:50:00Z. + * * The operation resulted in an error. + * @param {number} request.pageSize + * Number of operations to be returned in the response. If 0 or + * less, defaults to the server's maximum allowed page size. + * @param {string} request.pageToken + * If non-empty, `page_token` should contain a + * {@link protos.google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse.next_page_token|next_page_token} + * from a previous + * {@link protos.google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse|ListInstanceConfigOperationsResponse} + * to the same `parent` and with the same `filter`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.longrunning.Operation|Operation} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listInstanceConfigOperationsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listInstanceConfigOperationsStream( + request?: protos.google.spanner.admin.instance.v1.IListInstanceConfigOperationsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listInstanceConfigOperations']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listInstanceConfigOperations stream %j', request); + return this.descriptors.page.listInstanceConfigOperations.createStream( + this.innerApiCalls.listInstanceConfigOperations as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listInstanceConfigOperations`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project of the instance configuration operations. + * Values are of the form `projects/`. + * @param {string} request.filter + * An expression that filters the list of returned operations. + * + * A filter expression consists of a field name, a + * comparison operator, and a value for filtering. + * The value must be a string, a number, or a boolean. The comparison operator + * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. + * Colon `:` is the contains operator. Filter rules are not case sensitive. + * + * The following fields in the Operation are eligible for filtering: + * + * * `name` - The name of the long-running operation + * * `done` - False if the operation is in progress, else true. + * * `metadata.@type` - the type of metadata. For example, the type string + * for + * {@link protos.google.spanner.admin.instance.v1.CreateInstanceConfigMetadata|CreateInstanceConfigMetadata} + * is + * `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstanceConfigMetadata`. + * * `metadata.` - any field in metadata.value. + * `metadata.@type` must be specified first, if filtering on metadata + * fields. + * * `error` - Error associated with the long-running operation. + * * `response.@type` - the type of response. + * * `response.` - any field in response.value. + * + * You can combine multiple expressions by enclosing each expression in + * parentheses. By default, expressions are combined with AND logic. However, + * you can specify AND, OR, and NOT logic explicitly. + * + * Here are a few examples: + * + * * `done:true` - The operation is complete. + * * `(metadata.@type=` \ + * `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstanceConfigMetadata) + * AND` \ + * `(metadata.instance_config.name:custom-config) AND` \ + * `(metadata.progress.start_time < \"2021-03-28T14:50:00Z\") AND` \ + * `(error:*)` - Return operations where: + * * The operation's metadata type is + * {@link protos.google.spanner.admin.instance.v1.CreateInstanceConfigMetadata|CreateInstanceConfigMetadata}. + * * The instance configuration name contains "custom-config". + * * The operation started before 2021-03-28T14:50:00Z. + * * The operation resulted in an error. + * @param {number} request.pageSize + * Number of operations to be returned in the response. If 0 or + * less, defaults to the server's maximum allowed page size. + * @param {string} request.pageToken + * If non-empty, `page_token` should contain a + * {@link protos.google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse.next_page_token|next_page_token} + * from a previous + * {@link protos.google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse|ListInstanceConfigOperationsResponse} + * to the same `parent` and with the same `filter`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.longrunning.Operation|Operation}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listInstanceConfigOperationsAsync( + request?: protos.google.spanner.admin.instance.v1.IListInstanceConfigOperationsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listInstanceConfigOperations']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listInstanceConfigOperations iterate %j', request); + return this.descriptors.page.listInstanceConfigOperations.asyncIterate( + this.innerApiCalls['listInstanceConfigOperations'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists all instances in the given project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the project for which a list of instances is + * requested. Values are of the form `projects/`. + * @param {number} request.pageSize + * Number of instances to be returned in the response. If 0 or less, defaults + * to the server's maximum allowed page size. + * @param {string} request.pageToken + * If non-empty, `page_token` should contain a + * {@link protos.google.spanner.admin.instance.v1.ListInstancesResponse.next_page_token|next_page_token} + * from a previous + * {@link protos.google.spanner.admin.instance.v1.ListInstancesResponse|ListInstancesResponse}. + * @param {string} request.filter + * An expression for filtering the results of the request. Filter rules are + * case insensitive. The fields eligible for filtering are: + * + * * `name` + * * `display_name` + * * `labels.key` where key is the name of a label + * + * Some examples of using filters are: + * + * * `name:*` --> The instance has a name. + * * `name:Howl` --> The instance's name contains the string "howl". + * * `name:HOWL` --> Equivalent to above. + * * `NAME:howl` --> Equivalent to above. + * * `labels.env:*` --> The instance has the label "env". + * * `labels.env:dev` --> The instance has the label "env" and the value of + * the label contains the string "dev". + * * `name:howl labels.env:dev` --> The instance's name contains "howl" and + * it has the label "env" with its value + * containing "dev". + * @param {google.protobuf.Timestamp} request.instanceDeadline + * Deadline used while retrieving metadata for instances. + * Instances whose metadata cannot be retrieved within this deadline will be + * added to + * {@link protos.google.spanner.admin.instance.v1.ListInstancesResponse.unreachable|unreachable} + * in + * {@link protos.google.spanner.admin.instance.v1.ListInstancesResponse|ListInstancesResponse}. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.spanner.admin.instance.v1.Instance|Instance}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listInstancesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listInstances( + request?: protos.google.spanner.admin.instance.v1.IListInstancesRequest, + options?: CallOptions): + Promise<[ + protos.google.spanner.admin.instance.v1.IInstance[], + protos.google.spanner.admin.instance.v1.IListInstancesRequest|null, + protos.google.spanner.admin.instance.v1.IListInstancesResponse + ]>; + listInstances( + request: protos.google.spanner.admin.instance.v1.IListInstancesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.spanner.admin.instance.v1.IListInstancesRequest, + protos.google.spanner.admin.instance.v1.IListInstancesResponse|null|undefined, + protos.google.spanner.admin.instance.v1.IInstance>): void; + listInstances( + request: protos.google.spanner.admin.instance.v1.IListInstancesRequest, + callback: PaginationCallback< + protos.google.spanner.admin.instance.v1.IListInstancesRequest, + protos.google.spanner.admin.instance.v1.IListInstancesResponse|null|undefined, + protos.google.spanner.admin.instance.v1.IInstance>): void; + listInstances( + request?: protos.google.spanner.admin.instance.v1.IListInstancesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.spanner.admin.instance.v1.IListInstancesRequest, + protos.google.spanner.admin.instance.v1.IListInstancesResponse|null|undefined, + protos.google.spanner.admin.instance.v1.IInstance>, + callback?: PaginationCallback< + protos.google.spanner.admin.instance.v1.IListInstancesRequest, + protos.google.spanner.admin.instance.v1.IListInstancesResponse|null|undefined, + protos.google.spanner.admin.instance.v1.IInstance>): + Promise<[ + protos.google.spanner.admin.instance.v1.IInstance[], + protos.google.spanner.admin.instance.v1.IListInstancesRequest|null, + protos.google.spanner.admin.instance.v1.IListInstancesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.spanner.admin.instance.v1.IListInstancesRequest, + protos.google.spanner.admin.instance.v1.IListInstancesResponse|null|undefined, + protos.google.spanner.admin.instance.v1.IInstance>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listInstances values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listInstances request %j', request); + return this.innerApiCalls + .listInstances(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.spanner.admin.instance.v1.IInstance[], + protos.google.spanner.admin.instance.v1.IListInstancesRequest|null, + protos.google.spanner.admin.instance.v1.IListInstancesResponse + ]) => { + this._log.info('listInstances values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listInstances`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the project for which a list of instances is + * requested. Values are of the form `projects/`. + * @param {number} request.pageSize + * Number of instances to be returned in the response. If 0 or less, defaults + * to the server's maximum allowed page size. + * @param {string} request.pageToken + * If non-empty, `page_token` should contain a + * {@link protos.google.spanner.admin.instance.v1.ListInstancesResponse.next_page_token|next_page_token} + * from a previous + * {@link protos.google.spanner.admin.instance.v1.ListInstancesResponse|ListInstancesResponse}. + * @param {string} request.filter + * An expression for filtering the results of the request. Filter rules are + * case insensitive. The fields eligible for filtering are: + * + * * `name` + * * `display_name` + * * `labels.key` where key is the name of a label + * + * Some examples of using filters are: + * + * * `name:*` --> The instance has a name. + * * `name:Howl` --> The instance's name contains the string "howl". + * * `name:HOWL` --> Equivalent to above. + * * `NAME:howl` --> Equivalent to above. + * * `labels.env:*` --> The instance has the label "env". + * * `labels.env:dev` --> The instance has the label "env" and the value of + * the label contains the string "dev". + * * `name:howl labels.env:dev` --> The instance's name contains "howl" and + * it has the label "env" with its value + * containing "dev". + * @param {google.protobuf.Timestamp} request.instanceDeadline + * Deadline used while retrieving metadata for instances. + * Instances whose metadata cannot be retrieved within this deadline will be + * added to + * {@link protos.google.spanner.admin.instance.v1.ListInstancesResponse.unreachable|unreachable} + * in + * {@link protos.google.spanner.admin.instance.v1.ListInstancesResponse|ListInstancesResponse}. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.spanner.admin.instance.v1.Instance|Instance} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listInstancesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listInstancesStream( + request?: protos.google.spanner.admin.instance.v1.IListInstancesRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listInstances']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listInstances stream %j', request); + return this.descriptors.page.listInstances.createStream( + this.innerApiCalls.listInstances as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listInstances`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the project for which a list of instances is + * requested. Values are of the form `projects/`. + * @param {number} request.pageSize + * Number of instances to be returned in the response. If 0 or less, defaults + * to the server's maximum allowed page size. + * @param {string} request.pageToken + * If non-empty, `page_token` should contain a + * {@link protos.google.spanner.admin.instance.v1.ListInstancesResponse.next_page_token|next_page_token} + * from a previous + * {@link protos.google.spanner.admin.instance.v1.ListInstancesResponse|ListInstancesResponse}. + * @param {string} request.filter + * An expression for filtering the results of the request. Filter rules are + * case insensitive. The fields eligible for filtering are: + * + * * `name` + * * `display_name` + * * `labels.key` where key is the name of a label + * + * Some examples of using filters are: + * + * * `name:*` --> The instance has a name. + * * `name:Howl` --> The instance's name contains the string "howl". + * * `name:HOWL` --> Equivalent to above. + * * `NAME:howl` --> Equivalent to above. + * * `labels.env:*` --> The instance has the label "env". + * * `labels.env:dev` --> The instance has the label "env" and the value of + * the label contains the string "dev". + * * `name:howl labels.env:dev` --> The instance's name contains "howl" and + * it has the label "env" with its value + * containing "dev". + * @param {google.protobuf.Timestamp} request.instanceDeadline + * Deadline used while retrieving metadata for instances. + * Instances whose metadata cannot be retrieved within this deadline will be + * added to + * {@link protos.google.spanner.admin.instance.v1.ListInstancesResponse.unreachable|unreachable} + * in + * {@link protos.google.spanner.admin.instance.v1.ListInstancesResponse|ListInstancesResponse}. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.spanner.admin.instance.v1.Instance|Instance}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listInstancesAsync( + request?: protos.google.spanner.admin.instance.v1.IListInstancesRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listInstances']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listInstances iterate %j', request); + return this.descriptors.page.listInstances.asyncIterate( + this.innerApiCalls['listInstances'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists all instance partitions for the given instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The instance whose instance partitions should be listed. Values + * are of the form `projects//instances/`. Use `{instance} + * = '-'` to list instance partitions for all Instances in a project, e.g., + * `projects/myproject/instances/-`. + * @param {number} request.pageSize + * Number of instance partitions to be returned in the response. If 0 or less, + * defaults to the server's maximum allowed page size. + * @param {string} request.pageToken + * If non-empty, `page_token` should contain a + * {@link protos.google.spanner.admin.instance.v1.ListInstancePartitionsResponse.next_page_token|next_page_token} + * from a previous + * {@link protos.google.spanner.admin.instance.v1.ListInstancePartitionsResponse|ListInstancePartitionsResponse}. + * @param {google.protobuf.Timestamp} [request.instancePartitionDeadline] + * Optional. Deadline used while retrieving metadata for instance partitions. + * Instance partitions whose metadata cannot be retrieved within this deadline + * will be added to + * {@link protos.google.spanner.admin.instance.v1.ListInstancePartitionsResponse.unreachable|unreachable} + * in + * {@link protos.google.spanner.admin.instance.v1.ListInstancePartitionsResponse|ListInstancePartitionsResponse}. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.spanner.admin.instance.v1.InstancePartition|InstancePartition}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listInstancePartitionsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listInstancePartitions( + request?: protos.google.spanner.admin.instance.v1.IListInstancePartitionsRequest, + options?: CallOptions): + Promise<[ + protos.google.spanner.admin.instance.v1.IInstancePartition[], + protos.google.spanner.admin.instance.v1.IListInstancePartitionsRequest|null, + protos.google.spanner.admin.instance.v1.IListInstancePartitionsResponse + ]>; + listInstancePartitions( + request: protos.google.spanner.admin.instance.v1.IListInstancePartitionsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.spanner.admin.instance.v1.IListInstancePartitionsRequest, + protos.google.spanner.admin.instance.v1.IListInstancePartitionsResponse|null|undefined, + protos.google.spanner.admin.instance.v1.IInstancePartition>): void; + listInstancePartitions( + request: protos.google.spanner.admin.instance.v1.IListInstancePartitionsRequest, + callback: PaginationCallback< + protos.google.spanner.admin.instance.v1.IListInstancePartitionsRequest, + protos.google.spanner.admin.instance.v1.IListInstancePartitionsResponse|null|undefined, + protos.google.spanner.admin.instance.v1.IInstancePartition>): void; + listInstancePartitions( + request?: protos.google.spanner.admin.instance.v1.IListInstancePartitionsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.spanner.admin.instance.v1.IListInstancePartitionsRequest, + protos.google.spanner.admin.instance.v1.IListInstancePartitionsResponse|null|undefined, + protos.google.spanner.admin.instance.v1.IInstancePartition>, + callback?: PaginationCallback< + protos.google.spanner.admin.instance.v1.IListInstancePartitionsRequest, + protos.google.spanner.admin.instance.v1.IListInstancePartitionsResponse|null|undefined, + protos.google.spanner.admin.instance.v1.IInstancePartition>): + Promise<[ + protos.google.spanner.admin.instance.v1.IInstancePartition[], + protos.google.spanner.admin.instance.v1.IListInstancePartitionsRequest|null, + protos.google.spanner.admin.instance.v1.IListInstancePartitionsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.spanner.admin.instance.v1.IListInstancePartitionsRequest, + protos.google.spanner.admin.instance.v1.IListInstancePartitionsResponse|null|undefined, + protos.google.spanner.admin.instance.v1.IInstancePartition>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listInstancePartitions values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listInstancePartitions request %j', request); + return this.innerApiCalls + .listInstancePartitions(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.spanner.admin.instance.v1.IInstancePartition[], + protos.google.spanner.admin.instance.v1.IListInstancePartitionsRequest|null, + protos.google.spanner.admin.instance.v1.IListInstancePartitionsResponse + ]) => { + this._log.info('listInstancePartitions values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listInstancePartitions`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The instance whose instance partitions should be listed. Values + * are of the form `projects//instances/`. Use `{instance} + * = '-'` to list instance partitions for all Instances in a project, e.g., + * `projects/myproject/instances/-`. + * @param {number} request.pageSize + * Number of instance partitions to be returned in the response. If 0 or less, + * defaults to the server's maximum allowed page size. + * @param {string} request.pageToken + * If non-empty, `page_token` should contain a + * {@link protos.google.spanner.admin.instance.v1.ListInstancePartitionsResponse.next_page_token|next_page_token} + * from a previous + * {@link protos.google.spanner.admin.instance.v1.ListInstancePartitionsResponse|ListInstancePartitionsResponse}. + * @param {google.protobuf.Timestamp} [request.instancePartitionDeadline] + * Optional. Deadline used while retrieving metadata for instance partitions. + * Instance partitions whose metadata cannot be retrieved within this deadline + * will be added to + * {@link protos.google.spanner.admin.instance.v1.ListInstancePartitionsResponse.unreachable|unreachable} + * in + * {@link protos.google.spanner.admin.instance.v1.ListInstancePartitionsResponse|ListInstancePartitionsResponse}. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.spanner.admin.instance.v1.InstancePartition|InstancePartition} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listInstancePartitionsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listInstancePartitionsStream( + request?: protos.google.spanner.admin.instance.v1.IListInstancePartitionsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listInstancePartitions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listInstancePartitions stream %j', request); + return this.descriptors.page.listInstancePartitions.createStream( + this.innerApiCalls.listInstancePartitions as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listInstancePartitions`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The instance whose instance partitions should be listed. Values + * are of the form `projects//instances/`. Use `{instance} + * = '-'` to list instance partitions for all Instances in a project, e.g., + * `projects/myproject/instances/-`. + * @param {number} request.pageSize + * Number of instance partitions to be returned in the response. If 0 or less, + * defaults to the server's maximum allowed page size. + * @param {string} request.pageToken + * If non-empty, `page_token` should contain a + * {@link protos.google.spanner.admin.instance.v1.ListInstancePartitionsResponse.next_page_token|next_page_token} + * from a previous + * {@link protos.google.spanner.admin.instance.v1.ListInstancePartitionsResponse|ListInstancePartitionsResponse}. + * @param {google.protobuf.Timestamp} [request.instancePartitionDeadline] + * Optional. Deadline used while retrieving metadata for instance partitions. + * Instance partitions whose metadata cannot be retrieved within this deadline + * will be added to + * {@link protos.google.spanner.admin.instance.v1.ListInstancePartitionsResponse.unreachable|unreachable} + * in + * {@link protos.google.spanner.admin.instance.v1.ListInstancePartitionsResponse|ListInstancePartitionsResponse}. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.spanner.admin.instance.v1.InstancePartition|InstancePartition}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listInstancePartitionsAsync( + request?: protos.google.spanner.admin.instance.v1.IListInstancePartitionsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listInstancePartitions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listInstancePartitions iterate %j', request); + return this.descriptors.page.listInstancePartitions.asyncIterate( + this.innerApiCalls['listInstancePartitions'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists instance partition long-running operations in the given instance. + * An instance partition operation has a name of the form + * `projects//instances//instancePartitions//operations/`. + * The long-running operation + * metadata field type + * `metadata.type_url` describes the type of the metadata. Operations returned + * include those that have completed/failed/canceled within the last 7 days, + * and pending operations. Operations returned are ordered by + * `operation.metadata.value.start_time` in descending order starting from the + * most recently started operation. + * + * Authorization requires `spanner.instancePartitionOperations.list` + * permission on the resource + * {@link protos.google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest.parent|parent}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent instance of the instance partition operations. + * Values are of the form `projects//instances/`. + * @param {string} [request.filter] + * Optional. An expression that filters the list of returned operations. + * + * A filter expression consists of a field name, a + * comparison operator, and a value for filtering. + * The value must be a string, a number, or a boolean. The comparison operator + * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. + * Colon `:` is the contains operator. Filter rules are not case sensitive. + * + * The following fields in the Operation are eligible for filtering: + * + * * `name` - The name of the long-running operation + * * `done` - False if the operation is in progress, else true. + * * `metadata.@type` - the type of metadata. For example, the type string + * for + * {@link protos.google.spanner.admin.instance.v1.CreateInstancePartitionMetadata|CreateInstancePartitionMetadata} + * is + * `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstancePartitionMetadata`. + * * `metadata.` - any field in metadata.value. + * `metadata.@type` must be specified first, if filtering on metadata + * fields. + * * `error` - Error associated with the long-running operation. + * * `response.@type` - the type of response. + * * `response.` - any field in response.value. + * + * You can combine multiple expressions by enclosing each expression in + * parentheses. By default, expressions are combined with AND logic. However, + * you can specify AND, OR, and NOT logic explicitly. + * + * Here are a few examples: + * + * * `done:true` - The operation is complete. + * * `(metadata.@type=` \ + * `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstancePartitionMetadata) + * AND` \ + * `(metadata.instance_partition.name:custom-instance-partition) AND` \ + * `(metadata.start_time < \"2021-03-28T14:50:00Z\") AND` \ + * `(error:*)` - Return operations where: + * * The operation's metadata type is + * {@link protos.google.spanner.admin.instance.v1.CreateInstancePartitionMetadata|CreateInstancePartitionMetadata}. + * * The instance partition name contains "custom-instance-partition". + * * The operation started before 2021-03-28T14:50:00Z. + * * The operation resulted in an error. + * @param {number} [request.pageSize] + * Optional. Number of operations to be returned in the response. If 0 or + * less, defaults to the server's maximum allowed page size. + * @param {string} [request.pageToken] + * Optional. If non-empty, `page_token` should contain a + * {@link protos.google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse.next_page_token|next_page_token} + * from a previous + * {@link protos.google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse|ListInstancePartitionOperationsResponse} + * to the same `parent` and with the same `filter`. + * @param {google.protobuf.Timestamp} [request.instancePartitionDeadline] + * Optional. Deadline used while retrieving metadata for instance partition + * operations. Instance partitions whose operation metadata cannot be + * retrieved within this deadline will be added to + * {@link protos.google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse.unreachable_instance_partitions|unreachable_instance_partitions} + * in + * {@link protos.google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse|ListInstancePartitionOperationsResponse}. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.longrunning.Operation|Operation}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listInstancePartitionOperationsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listInstancePartitionOperations( + request?: protos.google.spanner.admin.instance.v1.IListInstancePartitionOperationsRequest, + options?: CallOptions): + Promise<[ + protos.google.longrunning.IOperation[], + protos.google.spanner.admin.instance.v1.IListInstancePartitionOperationsRequest|null, + protos.google.spanner.admin.instance.v1.IListInstancePartitionOperationsResponse + ]>; + listInstancePartitionOperations( + request: protos.google.spanner.admin.instance.v1.IListInstancePartitionOperationsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.spanner.admin.instance.v1.IListInstancePartitionOperationsRequest, + protos.google.spanner.admin.instance.v1.IListInstancePartitionOperationsResponse|null|undefined, + protos.google.longrunning.IOperation>): void; + listInstancePartitionOperations( + request: protos.google.spanner.admin.instance.v1.IListInstancePartitionOperationsRequest, + callback: PaginationCallback< + protos.google.spanner.admin.instance.v1.IListInstancePartitionOperationsRequest, + protos.google.spanner.admin.instance.v1.IListInstancePartitionOperationsResponse|null|undefined, + protos.google.longrunning.IOperation>): void; + listInstancePartitionOperations( + request?: protos.google.spanner.admin.instance.v1.IListInstancePartitionOperationsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.spanner.admin.instance.v1.IListInstancePartitionOperationsRequest, + protos.google.spanner.admin.instance.v1.IListInstancePartitionOperationsResponse|null|undefined, + protos.google.longrunning.IOperation>, + callback?: PaginationCallback< + protos.google.spanner.admin.instance.v1.IListInstancePartitionOperationsRequest, + protos.google.spanner.admin.instance.v1.IListInstancePartitionOperationsResponse|null|undefined, + protos.google.longrunning.IOperation>): + Promise<[ + protos.google.longrunning.IOperation[], + protos.google.spanner.admin.instance.v1.IListInstancePartitionOperationsRequest|null, + protos.google.spanner.admin.instance.v1.IListInstancePartitionOperationsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.spanner.admin.instance.v1.IListInstancePartitionOperationsRequest, + protos.google.spanner.admin.instance.v1.IListInstancePartitionOperationsResponse|null|undefined, + protos.google.longrunning.IOperation>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listInstancePartitionOperations values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listInstancePartitionOperations request %j', request); + return this.innerApiCalls + .listInstancePartitionOperations(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.longrunning.IOperation[], + protos.google.spanner.admin.instance.v1.IListInstancePartitionOperationsRequest|null, + protos.google.spanner.admin.instance.v1.IListInstancePartitionOperationsResponse + ]) => { + this._log.info('listInstancePartitionOperations values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listInstancePartitionOperations`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent instance of the instance partition operations. + * Values are of the form `projects//instances/`. + * @param {string} [request.filter] + * Optional. An expression that filters the list of returned operations. + * + * A filter expression consists of a field name, a + * comparison operator, and a value for filtering. + * The value must be a string, a number, or a boolean. The comparison operator + * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. + * Colon `:` is the contains operator. Filter rules are not case sensitive. + * + * The following fields in the Operation are eligible for filtering: + * + * * `name` - The name of the long-running operation + * * `done` - False if the operation is in progress, else true. + * * `metadata.@type` - the type of metadata. For example, the type string + * for + * {@link protos.google.spanner.admin.instance.v1.CreateInstancePartitionMetadata|CreateInstancePartitionMetadata} + * is + * `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstancePartitionMetadata`. + * * `metadata.` - any field in metadata.value. + * `metadata.@type` must be specified first, if filtering on metadata + * fields. + * * `error` - Error associated with the long-running operation. + * * `response.@type` - the type of response. + * * `response.` - any field in response.value. + * + * You can combine multiple expressions by enclosing each expression in + * parentheses. By default, expressions are combined with AND logic. However, + * you can specify AND, OR, and NOT logic explicitly. + * + * Here are a few examples: + * + * * `done:true` - The operation is complete. + * * `(metadata.@type=` \ + * `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstancePartitionMetadata) + * AND` \ + * `(metadata.instance_partition.name:custom-instance-partition) AND` \ + * `(metadata.start_time < \"2021-03-28T14:50:00Z\") AND` \ + * `(error:*)` - Return operations where: + * * The operation's metadata type is + * {@link protos.google.spanner.admin.instance.v1.CreateInstancePartitionMetadata|CreateInstancePartitionMetadata}. + * * The instance partition name contains "custom-instance-partition". + * * The operation started before 2021-03-28T14:50:00Z. + * * The operation resulted in an error. + * @param {number} [request.pageSize] + * Optional. Number of operations to be returned in the response. If 0 or + * less, defaults to the server's maximum allowed page size. + * @param {string} [request.pageToken] + * Optional. If non-empty, `page_token` should contain a + * {@link protos.google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse.next_page_token|next_page_token} + * from a previous + * {@link protos.google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse|ListInstancePartitionOperationsResponse} + * to the same `parent` and with the same `filter`. + * @param {google.protobuf.Timestamp} [request.instancePartitionDeadline] + * Optional. Deadline used while retrieving metadata for instance partition + * operations. Instance partitions whose operation metadata cannot be + * retrieved within this deadline will be added to + * {@link protos.google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse.unreachable_instance_partitions|unreachable_instance_partitions} + * in + * {@link protos.google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse|ListInstancePartitionOperationsResponse}. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.longrunning.Operation|Operation} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listInstancePartitionOperationsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listInstancePartitionOperationsStream( + request?: protos.google.spanner.admin.instance.v1.IListInstancePartitionOperationsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listInstancePartitionOperations']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listInstancePartitionOperations stream %j', request); + return this.descriptors.page.listInstancePartitionOperations.createStream( + this.innerApiCalls.listInstancePartitionOperations as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listInstancePartitionOperations`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent instance of the instance partition operations. + * Values are of the form `projects//instances/`. + * @param {string} [request.filter] + * Optional. An expression that filters the list of returned operations. + * + * A filter expression consists of a field name, a + * comparison operator, and a value for filtering. + * The value must be a string, a number, or a boolean. The comparison operator + * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. + * Colon `:` is the contains operator. Filter rules are not case sensitive. + * + * The following fields in the Operation are eligible for filtering: + * + * * `name` - The name of the long-running operation + * * `done` - False if the operation is in progress, else true. + * * `metadata.@type` - the type of metadata. For example, the type string + * for + * {@link protos.google.spanner.admin.instance.v1.CreateInstancePartitionMetadata|CreateInstancePartitionMetadata} + * is + * `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstancePartitionMetadata`. + * * `metadata.` - any field in metadata.value. + * `metadata.@type` must be specified first, if filtering on metadata + * fields. + * * `error` - Error associated with the long-running operation. + * * `response.@type` - the type of response. + * * `response.` - any field in response.value. + * + * You can combine multiple expressions by enclosing each expression in + * parentheses. By default, expressions are combined with AND logic. However, + * you can specify AND, OR, and NOT logic explicitly. + * + * Here are a few examples: + * + * * `done:true` - The operation is complete. + * * `(metadata.@type=` \ + * `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstancePartitionMetadata) + * AND` \ + * `(metadata.instance_partition.name:custom-instance-partition) AND` \ + * `(metadata.start_time < \"2021-03-28T14:50:00Z\") AND` \ + * `(error:*)` - Return operations where: + * * The operation's metadata type is + * {@link protos.google.spanner.admin.instance.v1.CreateInstancePartitionMetadata|CreateInstancePartitionMetadata}. + * * The instance partition name contains "custom-instance-partition". + * * The operation started before 2021-03-28T14:50:00Z. + * * The operation resulted in an error. + * @param {number} [request.pageSize] + * Optional. Number of operations to be returned in the response. If 0 or + * less, defaults to the server's maximum allowed page size. + * @param {string} [request.pageToken] + * Optional. If non-empty, `page_token` should contain a + * {@link protos.google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse.next_page_token|next_page_token} + * from a previous + * {@link protos.google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse|ListInstancePartitionOperationsResponse} + * to the same `parent` and with the same `filter`. + * @param {google.protobuf.Timestamp} [request.instancePartitionDeadline] + * Optional. Deadline used while retrieving metadata for instance partition + * operations. Instance partitions whose operation metadata cannot be + * retrieved within this deadline will be added to + * {@link protos.google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse.unreachable_instance_partitions|unreachable_instance_partitions} + * in + * {@link protos.google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse|ListInstancePartitionOperationsResponse}. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.longrunning.Operation|Operation}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listInstancePartitionOperationsAsync( + request?: protos.google.spanner.admin.instance.v1.IListInstancePartitionOperationsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listInstancePartitionOperations']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listInstancePartitionOperations iterate %j', request); + return this.descriptors.page.listInstancePartitionOperations.asyncIterate( + this.innerApiCalls['listInstancePartitionOperations'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } +/** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * 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 + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + 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'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | iteration protocols}. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + 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'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * for the details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + 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'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified instance resource name string. + * + * @param {string} project + * @param {string} instance + * @returns {string} Resource name string. + */ + instancePath(project:string,instance:string) { + return this.pathTemplates.instancePathTemplate.render({ + project: project, + instance: instance, + }); + } + + /** + * Parse the project from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the project. + */ + matchProjectFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).project; + } + + /** + * Parse the instance from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).instance; + } + + /** + * Return a fully-qualified instanceConfig resource name string. + * + * @param {string} project + * @param {string} instance_config + * @returns {string} Resource name string. + */ + instanceConfigPath(project:string,instanceConfig:string) { + return this.pathTemplates.instanceConfigPathTemplate.render({ + project: project, + instance_config: instanceConfig, + }); + } + + /** + * Parse the project from InstanceConfig resource. + * + * @param {string} instanceConfigName + * A fully-qualified path representing InstanceConfig resource. + * @returns {string} A string representing the project. + */ + matchProjectFromInstanceConfigName(instanceConfigName: string) { + return this.pathTemplates.instanceConfigPathTemplate.match(instanceConfigName).project; + } + + /** + * Parse the instance_config from InstanceConfig resource. + * + * @param {string} instanceConfigName + * A fully-qualified path representing InstanceConfig resource. + * @returns {string} A string representing the instance_config. + */ + matchInstanceConfigFromInstanceConfigName(instanceConfigName: string) { + return this.pathTemplates.instanceConfigPathTemplate.match(instanceConfigName).instance_config; + } + + /** + * Return a fully-qualified instancePartition resource name string. + * + * @param {string} project + * @param {string} instance + * @param {string} instance_partition + * @returns {string} Resource name string. + */ + instancePartitionPath(project:string,instance:string,instancePartition:string) { + return this.pathTemplates.instancePartitionPathTemplate.render({ + project: project, + instance: instance, + instance_partition: instancePartition, + }); + } + + /** + * Parse the project from InstancePartition resource. + * + * @param {string} instancePartitionName + * A fully-qualified path representing InstancePartition resource. + * @returns {string} A string representing the project. + */ + matchProjectFromInstancePartitionName(instancePartitionName: string) { + return this.pathTemplates.instancePartitionPathTemplate.match(instancePartitionName).project; + } + + /** + * Parse the instance from InstancePartition resource. + * + * @param {string} instancePartitionName + * A fully-qualified path representing InstancePartition resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromInstancePartitionName(instancePartitionName: string) { + return this.pathTemplates.instancePartitionPathTemplate.match(instancePartitionName).instance; + } + + /** + * Parse the instance_partition from InstancePartition resource. + * + * @param {string} instancePartitionName + * A fully-qualified path representing InstancePartition resource. + * @returns {string} A string representing the instance_partition. + */ + matchInstancePartitionFromInstancePartitionName(instancePartitionName: string) { + return this.pathTemplates.instancePartitionPathTemplate.match(instancePartitionName).instance_partition; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project:string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.instanceAdminStub && !this._terminated) { + return this.instanceAdminStub.then(stub => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + void this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} \ No newline at end of file diff --git a/owl-bot-staging/admin/instance/v1/src/v1/instance_admin_client_config.json b/owl-bot-staging/admin/instance/v1/src/v1/instance_admin_client_config.json new file mode 100644 index 000000000..cbe3ae620 --- /dev/null +++ b/owl-bot-staging/admin/instance/v1/src/v1/instance_admin_client_config.json @@ -0,0 +1,129 @@ +{ + "interfaces": { + "google.spanner.admin.instance.v1.InstanceAdmin": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + }, + "e9fafda332ce8a1702dc1575de3ca81c4feb4799": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 32000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ListInstanceConfigs": { + "timeout_millis": 3600000, + "retry_codes_name": "idempotent", + "retry_params_name": "e9fafda332ce8a1702dc1575de3ca81c4feb4799" + }, + "GetInstanceConfig": { + "timeout_millis": 3600000, + "retry_codes_name": "idempotent", + "retry_params_name": "e9fafda332ce8a1702dc1575de3ca81c4feb4799" + }, + "CreateInstanceConfig": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateInstanceConfig": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteInstanceConfig": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListInstanceConfigOperations": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListInstances": { + "timeout_millis": 3600000, + "retry_codes_name": "idempotent", + "retry_params_name": "e9fafda332ce8a1702dc1575de3ca81c4feb4799" + }, + "ListInstancePartitions": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetInstance": { + "timeout_millis": 3600000, + "retry_codes_name": "idempotent", + "retry_params_name": "e9fafda332ce8a1702dc1575de3ca81c4feb4799" + }, + "CreateInstance": { + "timeout_millis": 3600000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateInstance": { + "timeout_millis": 3600000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteInstance": { + "timeout_millis": 3600000, + "retry_codes_name": "idempotent", + "retry_params_name": "e9fafda332ce8a1702dc1575de3ca81c4feb4799" + }, + "SetIamPolicy": { + "timeout_millis": 30000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetIamPolicy": { + "timeout_millis": 30000, + "retry_codes_name": "idempotent", + "retry_params_name": "e9fafda332ce8a1702dc1575de3ca81c4feb4799" + }, + "TestIamPermissions": { + "timeout_millis": 30000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetInstancePartition": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateInstancePartition": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteInstancePartition": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateInstancePartition": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListInstancePartitionOperations": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "MoveInstance": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/admin/instance/v1/src/v1/instance_admin_proto_list.json b/owl-bot-staging/admin/instance/v1/src/v1/instance_admin_proto_list.json new file mode 100644 index 000000000..ce2400d42 --- /dev/null +++ b/owl-bot-staging/admin/instance/v1/src/v1/instance_admin_proto_list.json @@ -0,0 +1,4 @@ +[ + "../../protos/google/spanner/admin/instance/v1/common.proto", + "../../protos/google/spanner/admin/instance/v1/spanner_instance_admin.proto" +] diff --git a/owl-bot-staging/admin/instance/v1/test/gapic_instance_admin_v1.ts b/owl-bot-staging/admin/instance/v1/test/gapic_instance_admin_v1.ts new file mode 100644 index 000000000..6da299055 --- /dev/null +++ b/owl-bot-staging/admin/instance/v1/test/gapic_instance_admin_v1.ts @@ -0,0 +1,3974 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as instanceadminModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +} + +function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { mockStream.write({}); }); + } + setImmediate(() => { mockStream.end(); }); + } else { + setImmediate(() => { mockStream.write({}); }); + setImmediate(() => { mockStream.end(); }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + } + }; + } + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1.InstanceAdminClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new instanceadminModule.v1.InstanceAdminClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'spanner.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new instanceadminModule.v1.InstanceAdminClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, "googleapis.com"); + }); + + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = instanceadminModule.v1.InstanceAdminClient.servicePath; + assert.strictEqual(servicePath, 'spanner.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = instanceadminModule.v1.InstanceAdminClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'spanner.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new instanceadminModule.v1.InstanceAdminClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'spanner.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new instanceadminModule.v1.InstanceAdminClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'spanner.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new instanceadminModule.v1.InstanceAdminClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'spanner.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new instanceadminModule.v1.InstanceAdminClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'spanner.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { new instanceadminModule.v1.InstanceAdminClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = instanceadminModule.v1.InstanceAdminClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new instanceadminModule.v1.InstanceAdminClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.instanceAdminStub, undefined); + await client.initialize(); + assert(client.instanceAdminStub); + }); + + it('has close method for the initialized client', done => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize().catch(err => {throw err}); + assert(client.instanceAdminStub); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has close method for the non-initialized client', done => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.instanceAdminStub, undefined); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error|null, projectId?: string|null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + }); + + describe('getInstanceConfig', () => { + it('invokes getInstanceConfig without error', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.instance.v1.GetInstanceConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.instance.v1.GetInstanceConfigRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.spanner.admin.instance.v1.InstanceConfig() + ); + client.innerApiCalls.getInstanceConfig = stubSimpleCall(expectedResponse); + const [response] = await client.getInstanceConfig(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getInstanceConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getInstanceConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getInstanceConfig without error using callback', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.instance.v1.GetInstanceConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.instance.v1.GetInstanceConfigRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.spanner.admin.instance.v1.InstanceConfig() + ); + client.innerApiCalls.getInstanceConfig = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getInstanceConfig( + request, + (err?: Error|null, result?: protos.google.spanner.admin.instance.v1.IInstanceConfig|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getInstanceConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getInstanceConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getInstanceConfig with error', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.instance.v1.GetInstanceConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.instance.v1.GetInstanceConfigRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getInstanceConfig = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getInstanceConfig(request), expectedError); + const actualRequest = (client.innerApiCalls.getInstanceConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getInstanceConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getInstanceConfig with closed client', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.instance.v1.GetInstanceConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.instance.v1.GetInstanceConfigRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getInstanceConfig(request), expectedError); + }); + }); + + describe('deleteInstanceConfig', () => { + it('invokes deleteInstanceConfig without error', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.instance.v1.DeleteInstanceConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.instance.v1.DeleteInstanceConfigRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteInstanceConfig = stubSimpleCall(expectedResponse); + const [response] = await client.deleteInstanceConfig(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteInstanceConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteInstanceConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteInstanceConfig without error using callback', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.instance.v1.DeleteInstanceConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.instance.v1.DeleteInstanceConfigRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteInstanceConfig = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteInstanceConfig( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteInstanceConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteInstanceConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteInstanceConfig with error', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.instance.v1.DeleteInstanceConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.instance.v1.DeleteInstanceConfigRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteInstanceConfig = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteInstanceConfig(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteInstanceConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteInstanceConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteInstanceConfig with closed client', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.instance.v1.DeleteInstanceConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.instance.v1.DeleteInstanceConfigRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.deleteInstanceConfig(request), expectedError); + }); + }); + + describe('getInstance', () => { + it('invokes getInstance without error', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.instance.v1.GetInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.instance.v1.GetInstanceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.spanner.admin.instance.v1.Instance() + ); + client.innerApiCalls.getInstance = stubSimpleCall(expectedResponse); + const [response] = await client.getInstance(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getInstance without error using callback', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.instance.v1.GetInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.instance.v1.GetInstanceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.spanner.admin.instance.v1.Instance() + ); + client.innerApiCalls.getInstance = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getInstance( + request, + (err?: Error|null, result?: protos.google.spanner.admin.instance.v1.IInstance|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getInstance with error', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.instance.v1.GetInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.instance.v1.GetInstanceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getInstance = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getInstance(request), expectedError); + const actualRequest = (client.innerApiCalls.getInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getInstance with closed client', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.instance.v1.GetInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.instance.v1.GetInstanceRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getInstance(request), expectedError); + }); + }); + + describe('deleteInstance', () => { + it('invokes deleteInstance without error', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.instance.v1.DeleteInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.instance.v1.DeleteInstanceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteInstance = stubSimpleCall(expectedResponse); + const [response] = await client.deleteInstance(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteInstance without error using callback', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.instance.v1.DeleteInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.instance.v1.DeleteInstanceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteInstance = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteInstance( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteInstance with error', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.instance.v1.DeleteInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.instance.v1.DeleteInstanceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteInstance = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteInstance(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteInstance with closed client', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.instance.v1.DeleteInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.instance.v1.DeleteInstanceRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.deleteInstance(request), expectedError); + }); + }); + + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.SetIamPolicyRequest', ['resource']); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy() + ); + client.innerApiCalls.setIamPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.setIamPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setIamPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setIamPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setIamPolicy without error using callback', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.SetIamPolicyRequest', ['resource']); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy() + ); + client.innerApiCalls.setIamPolicy = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + (err?: Error|null, result?: protos.google.iam.v1.IPolicy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setIamPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setIamPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setIamPolicy with error', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.SetIamPolicyRequest', ['resource']); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.setIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setIamPolicy(request), expectedError); + const actualRequest = (client.innerApiCalls.setIamPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setIamPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setIamPolicy with closed client', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.SetIamPolicyRequest', ['resource']); + request.resource = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.setIamPolicy(request), expectedError); + }); + }); + + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.GetIamPolicyRequest', ['resource']); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy() + ); + client.innerApiCalls.getIamPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.getIamPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getIamPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getIamPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getIamPolicy without error using callback', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.GetIamPolicyRequest', ['resource']); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy() + ); + client.innerApiCalls.getIamPolicy = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + (err?: Error|null, result?: protos.google.iam.v1.IPolicy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getIamPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getIamPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getIamPolicy with error', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.GetIamPolicyRequest', ['resource']); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getIamPolicy(request), expectedError); + const actualRequest = (client.innerApiCalls.getIamPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getIamPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getIamPolicy with closed client', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.GetIamPolicyRequest', ['resource']); + request.resource = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getIamPolicy(request), expectedError); + }); + }); + + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.TestIamPermissionsRequest', ['resource']); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsResponse() + ); + client.innerApiCalls.testIamPermissions = stubSimpleCall(expectedResponse); + const [response] = await client.testIamPermissions(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes testIamPermissions without error using callback', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.TestIamPermissionsRequest', ['resource']); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsResponse() + ); + client.innerApiCalls.testIamPermissions = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + (err?: Error|null, result?: protos.google.iam.v1.ITestIamPermissionsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes testIamPermissions with error', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.TestIamPermissionsRequest', ['resource']); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.testIamPermissions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.testIamPermissions(request), expectedError); + const actualRequest = (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes testIamPermissions with closed client', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.TestIamPermissionsRequest', ['resource']); + request.resource = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.testIamPermissions(request), expectedError); + }); + }); + + describe('getInstancePartition', () => { + it('invokes getInstancePartition without error', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.instance.v1.GetInstancePartitionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.instance.v1.GetInstancePartitionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.spanner.admin.instance.v1.InstancePartition() + ); + client.innerApiCalls.getInstancePartition = stubSimpleCall(expectedResponse); + const [response] = await client.getInstancePartition(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getInstancePartition as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getInstancePartition as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getInstancePartition without error using callback', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.instance.v1.GetInstancePartitionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.instance.v1.GetInstancePartitionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.spanner.admin.instance.v1.InstancePartition() + ); + client.innerApiCalls.getInstancePartition = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getInstancePartition( + request, + (err?: Error|null, result?: protos.google.spanner.admin.instance.v1.IInstancePartition|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getInstancePartition as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getInstancePartition as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getInstancePartition with error', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.instance.v1.GetInstancePartitionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.instance.v1.GetInstancePartitionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getInstancePartition = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getInstancePartition(request), expectedError); + const actualRequest = (client.innerApiCalls.getInstancePartition as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getInstancePartition as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getInstancePartition with closed client', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.instance.v1.GetInstancePartitionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.instance.v1.GetInstancePartitionRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getInstancePartition(request), expectedError); + }); + }); + + describe('deleteInstancePartition', () => { + it('invokes deleteInstancePartition without error', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.instance.v1.DeleteInstancePartitionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.instance.v1.DeleteInstancePartitionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteInstancePartition = stubSimpleCall(expectedResponse); + const [response] = await client.deleteInstancePartition(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteInstancePartition as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteInstancePartition as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteInstancePartition without error using callback', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.instance.v1.DeleteInstancePartitionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.instance.v1.DeleteInstancePartitionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteInstancePartition = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteInstancePartition( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteInstancePartition as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteInstancePartition as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteInstancePartition with error', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.instance.v1.DeleteInstancePartitionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.instance.v1.DeleteInstancePartitionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteInstancePartition = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteInstancePartition(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteInstancePartition as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteInstancePartition as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteInstancePartition with closed client', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.instance.v1.DeleteInstancePartitionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.instance.v1.DeleteInstancePartitionRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.deleteInstancePartition(request), expectedError); + }); + }); + + describe('createInstanceConfig', () => { + it('invokes createInstanceConfig without error', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.instance.v1.CreateInstanceConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.instance.v1.CreateInstanceConfigRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createInstanceConfig = stubLongRunningCall(expectedResponse); + const [operation] = await client.createInstanceConfig(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createInstanceConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createInstanceConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createInstanceConfig without error using callback', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.instance.v1.CreateInstanceConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.instance.v1.CreateInstanceConfigRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createInstanceConfig = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createInstanceConfig( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createInstanceConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createInstanceConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createInstanceConfig with call error', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.instance.v1.CreateInstanceConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.instance.v1.CreateInstanceConfigRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createInstanceConfig = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createInstanceConfig(request), expectedError); + const actualRequest = (client.innerApiCalls.createInstanceConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createInstanceConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createInstanceConfig with LRO error', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.instance.v1.CreateInstanceConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.instance.v1.CreateInstanceConfigRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createInstanceConfig = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createInstanceConfig(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.createInstanceConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createInstanceConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateInstanceConfigProgress without error', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateInstanceConfigProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateInstanceConfigProgress with error', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkCreateInstanceConfigProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('updateInstanceConfig', () => { + it('invokes updateInstanceConfig without error', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.instance.v1.UpdateInstanceConfigRequest() + ); + request.instanceConfig ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.instance.v1.UpdateInstanceConfigRequest', ['instanceConfig', 'name']); + request.instanceConfig.name = defaultValue1; + const expectedHeaderRequestParams = `instance_config.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateInstanceConfig = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateInstanceConfig(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateInstanceConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateInstanceConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateInstanceConfig without error using callback', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.instance.v1.UpdateInstanceConfigRequest() + ); + request.instanceConfig ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.instance.v1.UpdateInstanceConfigRequest', ['instanceConfig', 'name']); + request.instanceConfig.name = defaultValue1; + const expectedHeaderRequestParams = `instance_config.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateInstanceConfig = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateInstanceConfig( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateInstanceConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateInstanceConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateInstanceConfig with call error', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.instance.v1.UpdateInstanceConfigRequest() + ); + request.instanceConfig ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.instance.v1.UpdateInstanceConfigRequest', ['instanceConfig', 'name']); + request.instanceConfig.name = defaultValue1; + const expectedHeaderRequestParams = `instance_config.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateInstanceConfig = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.updateInstanceConfig(request), expectedError); + const actualRequest = (client.innerApiCalls.updateInstanceConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateInstanceConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateInstanceConfig with LRO error', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.instance.v1.UpdateInstanceConfigRequest() + ); + request.instanceConfig ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.instance.v1.UpdateInstanceConfigRequest', ['instanceConfig', 'name']); + request.instanceConfig.name = defaultValue1; + const expectedHeaderRequestParams = `instance_config.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateInstanceConfig = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.updateInstanceConfig(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.updateInstanceConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateInstanceConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateInstanceConfigProgress without error', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateInstanceConfigProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateInstanceConfigProgress with error', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkUpdateInstanceConfigProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('createInstance', () => { + it('invokes createInstance without error', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.instance.v1.CreateInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.instance.v1.CreateInstanceRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createInstance = stubLongRunningCall(expectedResponse); + const [operation] = await client.createInstance(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createInstance without error using callback', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.instance.v1.CreateInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.instance.v1.CreateInstanceRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createInstance = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createInstance( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createInstance with call error', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.instance.v1.CreateInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.instance.v1.CreateInstanceRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createInstance = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createInstance(request), expectedError); + const actualRequest = (client.innerApiCalls.createInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createInstance with LRO error', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.instance.v1.CreateInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.instance.v1.CreateInstanceRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createInstance = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createInstance(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.createInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateInstanceProgress without error', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateInstanceProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateInstanceProgress with error', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkCreateInstanceProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('updateInstance', () => { + it('invokes updateInstance without error', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.instance.v1.UpdateInstanceRequest() + ); + request.instance ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.instance.v1.UpdateInstanceRequest', ['instance', 'name']); + request.instance.name = defaultValue1; + const expectedHeaderRequestParams = `instance.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateInstance = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateInstance(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateInstance without error using callback', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.instance.v1.UpdateInstanceRequest() + ); + request.instance ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.instance.v1.UpdateInstanceRequest', ['instance', 'name']); + request.instance.name = defaultValue1; + const expectedHeaderRequestParams = `instance.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateInstance = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateInstance( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateInstance with call error', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.instance.v1.UpdateInstanceRequest() + ); + request.instance ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.instance.v1.UpdateInstanceRequest', ['instance', 'name']); + request.instance.name = defaultValue1; + const expectedHeaderRequestParams = `instance.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateInstance = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.updateInstance(request), expectedError); + const actualRequest = (client.innerApiCalls.updateInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateInstance with LRO error', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.instance.v1.UpdateInstanceRequest() + ); + request.instance ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.instance.v1.UpdateInstanceRequest', ['instance', 'name']); + request.instance.name = defaultValue1; + const expectedHeaderRequestParams = `instance.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateInstance = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.updateInstance(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.updateInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateInstanceProgress without error', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateInstanceProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateInstanceProgress with error', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkUpdateInstanceProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('createInstancePartition', () => { + it('invokes createInstancePartition without error', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.instance.v1.CreateInstancePartitionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.instance.v1.CreateInstancePartitionRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createInstancePartition = stubLongRunningCall(expectedResponse); + const [operation] = await client.createInstancePartition(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createInstancePartition as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createInstancePartition as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createInstancePartition without error using callback', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.instance.v1.CreateInstancePartitionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.instance.v1.CreateInstancePartitionRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createInstancePartition = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createInstancePartition( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createInstancePartition as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createInstancePartition as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createInstancePartition with call error', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.instance.v1.CreateInstancePartitionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.instance.v1.CreateInstancePartitionRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createInstancePartition = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createInstancePartition(request), expectedError); + const actualRequest = (client.innerApiCalls.createInstancePartition as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createInstancePartition as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createInstancePartition with LRO error', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.instance.v1.CreateInstancePartitionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.instance.v1.CreateInstancePartitionRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createInstancePartition = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createInstancePartition(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.createInstancePartition as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createInstancePartition as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateInstancePartitionProgress without error', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateInstancePartitionProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateInstancePartitionProgress with error', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkCreateInstancePartitionProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('updateInstancePartition', () => { + it('invokes updateInstancePartition without error', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.instance.v1.UpdateInstancePartitionRequest() + ); + request.instancePartition ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.instance.v1.UpdateInstancePartitionRequest', ['instancePartition', 'name']); + request.instancePartition.name = defaultValue1; + const expectedHeaderRequestParams = `instance_partition.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateInstancePartition = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateInstancePartition(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateInstancePartition as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateInstancePartition as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateInstancePartition without error using callback', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.instance.v1.UpdateInstancePartitionRequest() + ); + request.instancePartition ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.instance.v1.UpdateInstancePartitionRequest', ['instancePartition', 'name']); + request.instancePartition.name = defaultValue1; + const expectedHeaderRequestParams = `instance_partition.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateInstancePartition = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateInstancePartition( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateInstancePartition as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateInstancePartition as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateInstancePartition with call error', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.instance.v1.UpdateInstancePartitionRequest() + ); + request.instancePartition ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.instance.v1.UpdateInstancePartitionRequest', ['instancePartition', 'name']); + request.instancePartition.name = defaultValue1; + const expectedHeaderRequestParams = `instance_partition.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateInstancePartition = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.updateInstancePartition(request), expectedError); + const actualRequest = (client.innerApiCalls.updateInstancePartition as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateInstancePartition as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateInstancePartition with LRO error', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.instance.v1.UpdateInstancePartitionRequest() + ); + request.instancePartition ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.instance.v1.UpdateInstancePartitionRequest', ['instancePartition', 'name']); + request.instancePartition.name = defaultValue1; + const expectedHeaderRequestParams = `instance_partition.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateInstancePartition = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.updateInstancePartition(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.updateInstancePartition as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateInstancePartition as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateInstancePartitionProgress without error', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateInstancePartitionProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateInstancePartitionProgress with error', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkUpdateInstancePartitionProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('moveInstance', () => { + it('invokes moveInstance without error', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.instance.v1.MoveInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.instance.v1.MoveInstanceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.moveInstance = stubLongRunningCall(expectedResponse); + const [operation] = await client.moveInstance(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.moveInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.moveInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes moveInstance without error using callback', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.instance.v1.MoveInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.instance.v1.MoveInstanceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.moveInstance = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.moveInstance( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.moveInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.moveInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes moveInstance with call error', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.instance.v1.MoveInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.instance.v1.MoveInstanceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.moveInstance = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.moveInstance(request), expectedError); + const actualRequest = (client.innerApiCalls.moveInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.moveInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes moveInstance with LRO error', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.instance.v1.MoveInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.instance.v1.MoveInstanceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.moveInstance = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.moveInstance(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.moveInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.moveInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkMoveInstanceProgress without error', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkMoveInstanceProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkMoveInstanceProgress with error', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkMoveInstanceProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('listInstanceConfigs', () => { + it('invokes listInstanceConfigs without error', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.instance.v1.ListInstanceConfigsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.instance.v1.ListInstanceConfigsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.spanner.admin.instance.v1.InstanceConfig()), + generateSampleMessage(new protos.google.spanner.admin.instance.v1.InstanceConfig()), + generateSampleMessage(new protos.google.spanner.admin.instance.v1.InstanceConfig()), + ]; + client.innerApiCalls.listInstanceConfigs = stubSimpleCall(expectedResponse); + const [response] = await client.listInstanceConfigs(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listInstanceConfigs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listInstanceConfigs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listInstanceConfigs without error using callback', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.instance.v1.ListInstanceConfigsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.instance.v1.ListInstanceConfigsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.spanner.admin.instance.v1.InstanceConfig()), + generateSampleMessage(new protos.google.spanner.admin.instance.v1.InstanceConfig()), + generateSampleMessage(new protos.google.spanner.admin.instance.v1.InstanceConfig()), + ]; + client.innerApiCalls.listInstanceConfigs = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listInstanceConfigs( + request, + (err?: Error|null, result?: protos.google.spanner.admin.instance.v1.IInstanceConfig[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listInstanceConfigs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listInstanceConfigs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listInstanceConfigs with error', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.instance.v1.ListInstanceConfigsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.instance.v1.ListInstanceConfigsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listInstanceConfigs = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listInstanceConfigs(request), expectedError); + const actualRequest = (client.innerApiCalls.listInstanceConfigs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listInstanceConfigs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listInstanceConfigsStream without error', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.instance.v1.ListInstanceConfigsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.instance.v1.ListInstanceConfigsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.spanner.admin.instance.v1.InstanceConfig()), + generateSampleMessage(new protos.google.spanner.admin.instance.v1.InstanceConfig()), + generateSampleMessage(new protos.google.spanner.admin.instance.v1.InstanceConfig()), + ]; + client.descriptors.page.listInstanceConfigs.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listInstanceConfigsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.spanner.admin.instance.v1.InstanceConfig[] = []; + stream.on('data', (response: protos.google.spanner.admin.instance.v1.InstanceConfig) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listInstanceConfigs.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listInstanceConfigs, request)); + assert( + (client.descriptors.page.listInstanceConfigs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listInstanceConfigsStream with error', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.instance.v1.ListInstanceConfigsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.instance.v1.ListInstanceConfigsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listInstanceConfigs.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listInstanceConfigsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.spanner.admin.instance.v1.InstanceConfig[] = []; + stream.on('data', (response: protos.google.spanner.admin.instance.v1.InstanceConfig) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listInstanceConfigs.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listInstanceConfigs, request)); + assert( + (client.descriptors.page.listInstanceConfigs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listInstanceConfigs without error', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.instance.v1.ListInstanceConfigsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.instance.v1.ListInstanceConfigsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.spanner.admin.instance.v1.InstanceConfig()), + generateSampleMessage(new protos.google.spanner.admin.instance.v1.InstanceConfig()), + generateSampleMessage(new protos.google.spanner.admin.instance.v1.InstanceConfig()), + ]; + client.descriptors.page.listInstanceConfigs.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.spanner.admin.instance.v1.IInstanceConfig[] = []; + const iterable = client.listInstanceConfigsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listInstanceConfigs.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listInstanceConfigs.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listInstanceConfigs with error', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.instance.v1.ListInstanceConfigsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.instance.v1.ListInstanceConfigsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listInstanceConfigs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listInstanceConfigsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.spanner.admin.instance.v1.IInstanceConfig[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listInstanceConfigs.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listInstanceConfigs.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listInstanceConfigOperations', () => { + it('invokes listInstanceConfigOperations without error', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.longrunning.Operation()), + generateSampleMessage(new protos.google.longrunning.Operation()), + generateSampleMessage(new protos.google.longrunning.Operation()), + ]; + client.innerApiCalls.listInstanceConfigOperations = stubSimpleCall(expectedResponse); + const [response] = await client.listInstanceConfigOperations(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listInstanceConfigOperations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listInstanceConfigOperations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listInstanceConfigOperations without error using callback', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.longrunning.Operation()), + generateSampleMessage(new protos.google.longrunning.Operation()), + generateSampleMessage(new protos.google.longrunning.Operation()), + ]; + client.innerApiCalls.listInstanceConfigOperations = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listInstanceConfigOperations( + request, + (err?: Error|null, result?: protos.google.longrunning.IOperation[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listInstanceConfigOperations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listInstanceConfigOperations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listInstanceConfigOperations with error', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listInstanceConfigOperations = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listInstanceConfigOperations(request), expectedError); + const actualRequest = (client.innerApiCalls.listInstanceConfigOperations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listInstanceConfigOperations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listInstanceConfigOperationsStream without error', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.longrunning.Operation()), + generateSampleMessage(new protos.google.longrunning.Operation()), + generateSampleMessage(new protos.google.longrunning.Operation()), + ]; + client.descriptors.page.listInstanceConfigOperations.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listInstanceConfigOperationsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.longrunning.Operation[] = []; + stream.on('data', (response: protos.google.longrunning.Operation) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listInstanceConfigOperations.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listInstanceConfigOperations, request)); + assert( + (client.descriptors.page.listInstanceConfigOperations.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listInstanceConfigOperationsStream with error', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listInstanceConfigOperations.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listInstanceConfigOperationsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.longrunning.Operation[] = []; + stream.on('data', (response: protos.google.longrunning.Operation) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listInstanceConfigOperations.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listInstanceConfigOperations, request)); + assert( + (client.descriptors.page.listInstanceConfigOperations.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listInstanceConfigOperations without error', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.longrunning.Operation()), + generateSampleMessage(new protos.google.longrunning.Operation()), + generateSampleMessage(new protos.google.longrunning.Operation()), + ]; + client.descriptors.page.listInstanceConfigOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.longrunning.IOperation[] = []; + const iterable = client.listInstanceConfigOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listInstanceConfigOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listInstanceConfigOperations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listInstanceConfigOperations with error', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listInstanceConfigOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listInstanceConfigOperationsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.longrunning.IOperation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listInstanceConfigOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listInstanceConfigOperations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listInstances', () => { + it('invokes listInstances without error', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.instance.v1.ListInstancesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.instance.v1.ListInstancesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.spanner.admin.instance.v1.Instance()), + generateSampleMessage(new protos.google.spanner.admin.instance.v1.Instance()), + generateSampleMessage(new protos.google.spanner.admin.instance.v1.Instance()), + ]; + client.innerApiCalls.listInstances = stubSimpleCall(expectedResponse); + const [response] = await client.listInstances(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listInstances as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listInstances as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listInstances without error using callback', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.instance.v1.ListInstancesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.instance.v1.ListInstancesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.spanner.admin.instance.v1.Instance()), + generateSampleMessage(new protos.google.spanner.admin.instance.v1.Instance()), + generateSampleMessage(new protos.google.spanner.admin.instance.v1.Instance()), + ]; + client.innerApiCalls.listInstances = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listInstances( + request, + (err?: Error|null, result?: protos.google.spanner.admin.instance.v1.IInstance[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listInstances as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listInstances as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listInstances with error', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.instance.v1.ListInstancesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.instance.v1.ListInstancesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listInstances = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listInstances(request), expectedError); + const actualRequest = (client.innerApiCalls.listInstances as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listInstances as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listInstancesStream without error', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.instance.v1.ListInstancesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.instance.v1.ListInstancesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.spanner.admin.instance.v1.Instance()), + generateSampleMessage(new protos.google.spanner.admin.instance.v1.Instance()), + generateSampleMessage(new protos.google.spanner.admin.instance.v1.Instance()), + ]; + client.descriptors.page.listInstances.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listInstancesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.spanner.admin.instance.v1.Instance[] = []; + stream.on('data', (response: protos.google.spanner.admin.instance.v1.Instance) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listInstances.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listInstances, request)); + assert( + (client.descriptors.page.listInstances.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listInstancesStream with error', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.instance.v1.ListInstancesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.instance.v1.ListInstancesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listInstances.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listInstancesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.spanner.admin.instance.v1.Instance[] = []; + stream.on('data', (response: protos.google.spanner.admin.instance.v1.Instance) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listInstances.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listInstances, request)); + assert( + (client.descriptors.page.listInstances.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listInstances without error', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.instance.v1.ListInstancesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.instance.v1.ListInstancesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.spanner.admin.instance.v1.Instance()), + generateSampleMessage(new protos.google.spanner.admin.instance.v1.Instance()), + generateSampleMessage(new protos.google.spanner.admin.instance.v1.Instance()), + ]; + client.descriptors.page.listInstances.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.spanner.admin.instance.v1.IInstance[] = []; + const iterable = client.listInstancesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listInstances.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listInstances.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listInstances with error', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.instance.v1.ListInstancesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.instance.v1.ListInstancesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listInstances.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listInstancesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.spanner.admin.instance.v1.IInstance[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listInstances.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listInstances.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listInstancePartitions', () => { + it('invokes listInstancePartitions without error', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.instance.v1.ListInstancePartitionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.instance.v1.ListInstancePartitionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.spanner.admin.instance.v1.InstancePartition()), + generateSampleMessage(new protos.google.spanner.admin.instance.v1.InstancePartition()), + generateSampleMessage(new protos.google.spanner.admin.instance.v1.InstancePartition()), + ]; + client.innerApiCalls.listInstancePartitions = stubSimpleCall(expectedResponse); + const [response] = await client.listInstancePartitions(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listInstancePartitions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listInstancePartitions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listInstancePartitions without error using callback', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.instance.v1.ListInstancePartitionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.instance.v1.ListInstancePartitionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.spanner.admin.instance.v1.InstancePartition()), + generateSampleMessage(new protos.google.spanner.admin.instance.v1.InstancePartition()), + generateSampleMessage(new protos.google.spanner.admin.instance.v1.InstancePartition()), + ]; + client.innerApiCalls.listInstancePartitions = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listInstancePartitions( + request, + (err?: Error|null, result?: protos.google.spanner.admin.instance.v1.IInstancePartition[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listInstancePartitions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listInstancePartitions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listInstancePartitions with error', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.instance.v1.ListInstancePartitionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.instance.v1.ListInstancePartitionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listInstancePartitions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listInstancePartitions(request), expectedError); + const actualRequest = (client.innerApiCalls.listInstancePartitions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listInstancePartitions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listInstancePartitionsStream without error', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.instance.v1.ListInstancePartitionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.instance.v1.ListInstancePartitionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.spanner.admin.instance.v1.InstancePartition()), + generateSampleMessage(new protos.google.spanner.admin.instance.v1.InstancePartition()), + generateSampleMessage(new protos.google.spanner.admin.instance.v1.InstancePartition()), + ]; + client.descriptors.page.listInstancePartitions.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listInstancePartitionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.spanner.admin.instance.v1.InstancePartition[] = []; + stream.on('data', (response: protos.google.spanner.admin.instance.v1.InstancePartition) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listInstancePartitions.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listInstancePartitions, request)); + assert( + (client.descriptors.page.listInstancePartitions.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listInstancePartitionsStream with error', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.instance.v1.ListInstancePartitionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.instance.v1.ListInstancePartitionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listInstancePartitions.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listInstancePartitionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.spanner.admin.instance.v1.InstancePartition[] = []; + stream.on('data', (response: protos.google.spanner.admin.instance.v1.InstancePartition) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listInstancePartitions.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listInstancePartitions, request)); + assert( + (client.descriptors.page.listInstancePartitions.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listInstancePartitions without error', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.instance.v1.ListInstancePartitionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.instance.v1.ListInstancePartitionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.spanner.admin.instance.v1.InstancePartition()), + generateSampleMessage(new protos.google.spanner.admin.instance.v1.InstancePartition()), + generateSampleMessage(new protos.google.spanner.admin.instance.v1.InstancePartition()), + ]; + client.descriptors.page.listInstancePartitions.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.spanner.admin.instance.v1.IInstancePartition[] = []; + const iterable = client.listInstancePartitionsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listInstancePartitions.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listInstancePartitions.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listInstancePartitions with error', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.instance.v1.ListInstancePartitionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.instance.v1.ListInstancePartitionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listInstancePartitions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listInstancePartitionsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.spanner.admin.instance.v1.IInstancePartition[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listInstancePartitions.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listInstancePartitions.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listInstancePartitionOperations', () => { + it('invokes listInstancePartitionOperations without error', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.longrunning.Operation()), + generateSampleMessage(new protos.google.longrunning.Operation()), + generateSampleMessage(new protos.google.longrunning.Operation()), + ]; + client.innerApiCalls.listInstancePartitionOperations = stubSimpleCall(expectedResponse); + const [response] = await client.listInstancePartitionOperations(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listInstancePartitionOperations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listInstancePartitionOperations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listInstancePartitionOperations without error using callback', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.longrunning.Operation()), + generateSampleMessage(new protos.google.longrunning.Operation()), + generateSampleMessage(new protos.google.longrunning.Operation()), + ]; + client.innerApiCalls.listInstancePartitionOperations = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listInstancePartitionOperations( + request, + (err?: Error|null, result?: protos.google.longrunning.IOperation[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listInstancePartitionOperations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listInstancePartitionOperations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listInstancePartitionOperations with error', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listInstancePartitionOperations = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listInstancePartitionOperations(request), expectedError); + const actualRequest = (client.innerApiCalls.listInstancePartitionOperations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listInstancePartitionOperations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listInstancePartitionOperationsStream without error', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.longrunning.Operation()), + generateSampleMessage(new protos.google.longrunning.Operation()), + generateSampleMessage(new protos.google.longrunning.Operation()), + ]; + client.descriptors.page.listInstancePartitionOperations.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listInstancePartitionOperationsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.longrunning.Operation[] = []; + stream.on('data', (response: protos.google.longrunning.Operation) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listInstancePartitionOperations.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listInstancePartitionOperations, request)); + assert( + (client.descriptors.page.listInstancePartitionOperations.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listInstancePartitionOperationsStream with error', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listInstancePartitionOperations.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listInstancePartitionOperationsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.longrunning.Operation[] = []; + stream.on('data', (response: protos.google.longrunning.Operation) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listInstancePartitionOperations.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listInstancePartitionOperations, request)); + assert( + (client.descriptors.page.listInstancePartitionOperations.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listInstancePartitionOperations without error', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.longrunning.Operation()), + generateSampleMessage(new protos.google.longrunning.Operation()), + generateSampleMessage(new protos.google.longrunning.Operation()), + ]; + client.descriptors.page.listInstancePartitionOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.longrunning.IOperation[] = []; + const iterable = client.listInstancePartitionOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listInstancePartitionOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listInstancePartitionOperations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listInstancePartitionOperations with error', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listInstancePartitionOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listInstancePartitionOperationsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.longrunning.IOperation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listInstancePartitionOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listInstancePartitionOperations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.getOperation(request)}, expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('deleteOperation', () => { + it('invokes deleteOperation without error', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('listOperationsAsync', () => { + it('uses async iteration with listOperations without error', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.IOperation[] = []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.IOperation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + }); + + describe('Path templates', () => { + + describe('instance', async () => { + const fakePath = "/rendered/path/instance"; + const expectedParameters = { + project: "projectValue", + instance: "instanceValue", + }; + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.instancePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.instancePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('instancePath', () => { + const result = client.instancePath("projectValue", "instanceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.instancePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromInstanceName', () => { + const result = client.matchProjectFromInstanceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInstanceFromInstanceName', () => { + const result = client.matchInstanceFromInstanceName(fakePath); + assert.strictEqual(result, "instanceValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('instanceConfig', async () => { + const fakePath = "/rendered/path/instanceConfig"; + const expectedParameters = { + project: "projectValue", + instance_config: "instanceConfigValue", + }; + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.instanceConfigPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.instanceConfigPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('instanceConfigPath', () => { + const result = client.instanceConfigPath("projectValue", "instanceConfigValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.instanceConfigPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromInstanceConfigName', () => { + const result = client.matchProjectFromInstanceConfigName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.instanceConfigPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInstanceConfigFromInstanceConfigName', () => { + const result = client.matchInstanceConfigFromInstanceConfigName(fakePath); + assert.strictEqual(result, "instanceConfigValue"); + assert((client.pathTemplates.instanceConfigPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('instancePartition', async () => { + const fakePath = "/rendered/path/instancePartition"; + const expectedParameters = { + project: "projectValue", + instance: "instanceValue", + instance_partition: "instancePartitionValue", + }; + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.instancePartitionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.instancePartitionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('instancePartitionPath', () => { + const result = client.instancePartitionPath("projectValue", "instanceValue", "instancePartitionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.instancePartitionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromInstancePartitionName', () => { + const result = client.matchProjectFromInstancePartitionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.instancePartitionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInstanceFromInstancePartitionName', () => { + const result = client.matchInstanceFromInstancePartitionName(fakePath); + assert.strictEqual(result, "instanceValue"); + assert((client.pathTemplates.instancePartitionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInstancePartitionFromInstancePartitionName', () => { + const result = client.matchInstancePartitionFromInstancePartitionName(fakePath); + assert.strictEqual(result, "instancePartitionValue"); + assert((client.pathTemplates.instancePartitionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('project', async () => { + const fakePath = "/rendered/path/project"; + const expectedParameters = { + project: "projectValue", + }; + const client = new instanceadminModule.v1.InstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath("projectValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/admin/instance/v1/tsconfig.json b/owl-bot-staging/admin/instance/v1/tsconfig.json new file mode 100644 index 000000000..ca73e7bfc --- /dev/null +++ b/owl-bot-staging/admin/instance/v1/tsconfig.json @@ -0,0 +1,22 @@ +{ + "extends": "./node_modules/gts/tsconfig-google.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "build", + "resolveJsonModule": true, + "lib": [ + "es2023", + "dom" + ] + }, + "include": [ + "src/*.ts", + "src/**/*.ts", + "test/*.ts", + "test/**/*.ts", + "system-test/*.ts", + "src/**/*.json", + "samples/**/*.json", + "protos/protos.json" + ] +} diff --git a/owl-bot-staging/admin/instance/v1/webpack.config.js b/owl-bot-staging/admin/instance/v1/webpack.config.js new file mode 100644 index 000000000..9d3569000 --- /dev/null +++ b/owl-bot-staging/admin/instance/v1/webpack.config.js @@ -0,0 +1,64 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +const path = require('path'); + +module.exports = { + entry: './src/index.ts', + output: { + library: 'InstanceAdmin', + filename: './instance-admin.js', + }, + node: { + child_process: 'empty', + fs: 'empty', + crypto: 'empty', + }, + resolve: { + alias: { + '../../../package.json': path.resolve(__dirname, 'package.json'), + }, + extensions: ['.js', '.json', '.ts'], + }, + module: { + rules: [ + { + test: /\.tsx?$/, + use: 'ts-loader', + exclude: /node_modules/ + }, + { + test: /node_modules[\\/]@grpc[\\/]grpc-js/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]grpc/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]retry-request/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]https?-proxy-agent/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]gtoken/, + use: 'null-loader' + }, + ], + }, + mode: 'production', +}; diff --git a/owl-bot-staging/executor/v1/.OwlBot.yaml b/owl-bot-staging/executor/v1/.OwlBot.yaml new file mode 100644 index 000000000..b80260f10 --- /dev/null +++ b/owl-bot-staging/executor/v1/.OwlBot.yaml @@ -0,0 +1,19 @@ +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +deep-copy-regex: + - source: /google/spanner/executor/google-spanner-executor-nodejs + dest: /owl-bot-staging/google-spanner-executor + +api-name: executor \ No newline at end of file diff --git a/owl-bot-staging/executor/v1/.eslintignore b/owl-bot-staging/executor/v1/.eslintignore new file mode 100644 index 000000000..cfc348ec4 --- /dev/null +++ b/owl-bot-staging/executor/v1/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/.coverage +build/ +docs/ +protos/ +system-test/ +samples/generated/ diff --git a/owl-bot-staging/executor/v1/.eslintrc.json b/owl-bot-staging/executor/v1/.eslintrc.json new file mode 100644 index 000000000..782153495 --- /dev/null +++ b/owl-bot-staging/executor/v1/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/owl-bot-staging/executor/v1/.gitattributes b/owl-bot-staging/executor/v1/.gitattributes new file mode 100644 index 000000000..33739cb74 --- /dev/null +++ b/owl-bot-staging/executor/v1/.gitattributes @@ -0,0 +1,4 @@ +*.ts text eol=lf +*.js text eol=lf +protos/* linguist-generated +**/api-extractor.json linguist-language=JSON-with-Comments diff --git a/owl-bot-staging/executor/v1/.gitignore b/owl-bot-staging/executor/v1/.gitignore new file mode 100644 index 000000000..d4f03a0df --- /dev/null +++ b/owl-bot-staging/executor/v1/.gitignore @@ -0,0 +1,14 @@ +**/*.log +**/node_modules +/.coverage +/coverage +/.nyc_output +/docs/ +/out/ +/build/ +system-test/secrets.js +system-test/*key.json +*.lock +.DS_Store +package-lock.json +__pycache__ diff --git a/owl-bot-staging/executor/v1/.jsdoc.js b/owl-bot-staging/executor/v1/.jsdoc.js new file mode 100644 index 000000000..ca8cf478f --- /dev/null +++ b/owl-bot-staging/executor/v1/.jsdoc.js @@ -0,0 +1,55 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +'use strict'; + +module.exports = { + opts: { + readme: './README.md', + package: './package.json', + template: './node_modules/jsdoc-fresh', + recurse: true, + verbose: true, + destination: './docs/' + }, + plugins: [ + 'plugins/markdown', + 'jsdoc-region-tag' + ], + source: { + excludePattern: '(^|\\/|\\\\)[._]', + include: [ + 'build/src', + 'protos' + ], + includePattern: '\\.js$' + }, + templates: { + copyright: 'Copyright 2026 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/executor', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/owl-bot-staging/executor/v1/.mocharc.js b/owl-bot-staging/executor/v1/.mocharc.js new file mode 100644 index 000000000..5eb34e86c --- /dev/null +++ b/owl-bot-staging/executor/v1/.mocharc.js @@ -0,0 +1,33 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000 +} +if (process.env.MOCHA_THROW_DEPRECATION === 'false') { + delete config['throw-deprecation']; +} +if (process.env.MOCHA_REPORTER) { + config.reporter = process.env.MOCHA_REPORTER; +} +if (process.env.MOCHA_REPORTER_OUTPUT) { + config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; +} +module.exports = config diff --git a/owl-bot-staging/executor/v1/.nycrc b/owl-bot-staging/executor/v1/.nycrc new file mode 100644 index 000000000..81a95fc94 --- /dev/null +++ b/owl-bot-staging/executor/v1/.nycrc @@ -0,0 +1,24 @@ +{ + "report-dir": "./.coverage", + "reporter": ["text", "lcov"], + "exclude": [ + "**/*-test", + "**/.coverage", + "**/apis", + "**/benchmark", + "**/conformance", + "**/docs", + "**/samples", + "**/scripts", + "**/protos", + "**/test", + "**/*.d.ts", + ".jsdoc.js", + "**/.jsdoc.js", + "karma.conf.js", + "webpack-tests.config.js", + "webpack.config.js" + ], + "exclude-after-remap": false, + "all": true +} \ No newline at end of file diff --git a/owl-bot-staging/executor/v1/.prettierignore b/owl-bot-staging/executor/v1/.prettierignore new file mode 100644 index 000000000..9340ad9b8 --- /dev/null +++ b/owl-bot-staging/executor/v1/.prettierignore @@ -0,0 +1,6 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ diff --git a/owl-bot-staging/executor/v1/.prettierrc.js b/owl-bot-staging/executor/v1/.prettierrc.js new file mode 100644 index 000000000..7649ee3c2 --- /dev/null +++ b/owl-bot-staging/executor/v1/.prettierrc.js @@ -0,0 +1,22 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/owl-bot-staging/executor/v1/CODE_OF_CONDUCT.md b/owl-bot-staging/executor/v1/CODE_OF_CONDUCT.md new file mode 100644 index 000000000..2add2547a --- /dev/null +++ b/owl-bot-staging/executor/v1/CODE_OF_CONDUCT.md @@ -0,0 +1,94 @@ + +# Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of +experience, education, socio-economic status, nationality, personal appearance, +race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, or to ban temporarily or permanently any +contributor for other behaviors that they deem inappropriate, threatening, +offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +This Code of Conduct also applies outside the project spaces when the Project +Steward has a reasonable belief that an individual's behavior may have a +negative impact on the project or its community. + +## Conflict Resolution + +We do not believe that all conflict is bad; healthy debate and disagreement +often yield positive results. However, it is never okay to be disrespectful or +to engage in behavior that violates the project’s code of conduct. + +If you see someone violating the code of conduct, you are encouraged to address +the behavior directly with those involved. Many issues can be resolved quickly +and easily, and this gives people more control over the outcome of their +dispute. If you are unable to resolve the matter for any reason, or if the +behavior is threatening or harassing, report it. We are dedicated to providing +an environment where participants feel welcome and safe. + +Reports should be directed to *googleapis-stewards@google.com*, the +Project Steward(s) for *Google Cloud Client Libraries*. It is the Project Steward’s duty to +receive and address reported violations of the code of conduct. They will then +work with a committee consisting of representatives from the Open Source +Programs Office and the Google Open Source Strategy team. If for any reason you +are uncomfortable reaching out to the Project Steward, please email +opensource@google.com. + +We will investigate every complaint, but you may not receive a direct response. +We will use our discretion in determining when and how to follow up on reported +incidents, which may range from not taking action to permanent expulsion from +the project and project-sponsored spaces. We will notify the accused of the +report and provide them an opportunity to discuss it before any action is taken. +The identity of the reporter will be omitted from the details of the report +supplied to the accused. In potentially harmful situations, such as ongoing +harassment or threats to anyone's safety, we may take action without notice. + +## Attribution + +This Code of Conduct is adapted from the Contributor Covenant, version 1.4, +available at +https://www.contributor-covenant.org/version/1/4/code-of-conduct.html \ No newline at end of file diff --git a/owl-bot-staging/executor/v1/CONTRIBUTING.md b/owl-bot-staging/executor/v1/CONTRIBUTING.md new file mode 100644 index 000000000..830ae4e2c --- /dev/null +++ b/owl-bot-staging/executor/v1/CONTRIBUTING.md @@ -0,0 +1,76 @@ +# How to become a contributor and submit your own code + +**Table of contents** + +* [Contributor License Agreements](#contributor-license-agreements) +* [Contributing a patch](#contributing-a-patch) +* [Running the tests](#running-the-tests) +* [Releasing the library](#releasing-the-library) + +## Contributor License Agreements + +We'd love to accept your sample apps and patches! Before we can take them, we +have to jump a couple of legal hurdles. + +Please fill out either the individual or corporate Contributor License Agreement +(CLA). + + * If you are an individual writing original source code and you're sure you + own the intellectual property, then you'll need to sign an [individual CLA](https://developers.google.com/open-source/cla/individual). + * If you work for a company that wants to allow you to contribute your work, + then you'll need to sign a [corporate CLA](https://developers.google.com/open-source/cla/corporate). + +Follow either of the two links above to access the appropriate CLA and +instructions for how to sign and return it. Once we receive it, we'll be able to +accept your pull requests. + +## Contributing A Patch + +1. Submit an issue describing your proposed change to the repo in question. +1. The repo owner will respond to your issue promptly. +1. If your proposed change is accepted, and you haven't already done so, sign a + Contributor License Agreement (see details above). +1. Fork the desired repo, develop and test your code changes. +1. Ensure that your code adheres to the existing style in the code to which + you are contributing. +1. Ensure that your code has an appropriate set of tests which all pass. +1. Title your pull request following [Conventional Commits](https://www.conventionalcommits.org/) styling. +1. Submit a pull request. + +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Executor API][enable_api]. +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + + +## Running the tests + +1. [Prepare your environment for Node.js setup][setup]. + +1. Install dependencies: + + npm install + +1. Run the tests: + + # Run unit tests. + npm test + + # Run sample integration tests. + npm run samples-test + + # Run all system tests. + npm run system-test + +1. Lint (and maybe fix) any changes: + + npm run fix + +[setup]: https://cloud.google.com/nodejs/docs/setup +[projects]: https://console.cloud.google.com/project +[billing]: https://support.google.com/cloud/answer/6293499#enable-billing +[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=spanner-cloud-executor.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/owl-bot-staging/executor/v1/LICENSE b/owl-bot-staging/executor/v1/LICENSE new file mode 100644 index 000000000..d64569567 --- /dev/null +++ b/owl-bot-staging/executor/v1/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/owl-bot-staging/executor/v1/README.md b/owl-bot-staging/executor/v1/README.md new file mode 100644 index 000000000..e9a7f28db --- /dev/null +++ b/owl-bot-staging/executor/v1/README.md @@ -0,0 +1,108 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "The comments you see below are used to generate those parts of the template in later states." +Google Cloud Platform logo + +# [Cloud Spanner Executor test API: Nodejs Client][homepage] + +[//]: # "releaseLevel" + +[![npm version](https://img.shields.io/npm/v/@google-cloud/executor.svg)](https://www.npmjs.org/package/@google-cloud/executor) + +Cloud Spanner Executor test API client for Node.js + +[//]: # "partials.introduction" + +A comprehensive list of changes in each version may be found in +[the CHANGELOG][homepage_changelog]. + +* [Cloud Spanner Executor test API Nodejs Client API Reference](https://cloud.google.com/nodejs/docs/reference/executor/latest) + + +Read more about the client libraries for Cloud APIs, including the older +Google APIs Client Libraries, in [Client Libraries Explained][explained]. + +[explained]: https://cloud.google.com/apis/docs/client-libraries-explained + +**Table of contents:** + +* [Quickstart](#quickstart) + * [Before you begin](#before-you-begin) + * [Installing the client library](#installing-the-client-library) + +* [Versioning](#versioning) +* [Contributing](#contributing) +* [License](#license) + +## Quickstart +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Cloud Spanner Executor test API API][enable_api]. +1. [Set up authentication][auth] so you can access the + API from your local workstation. +### Installing the client library + +```bash +npm install @google-cloud/executor +``` + +[//]: # "partials.body" + +## Samples + +Samples are in the [`samples/`][homepage_samples] directory. Each sample's `README.md` has instructions for running its sample. + +[//]: # "samples" + +## Supported Node.js Versions + +Our client libraries follow the [Node.js release schedule](https://github.com/nodejs/release#release-schedule). +Libraries are compatible with all current _active_ and _maintenance_ versions of +Node.js. +If you are using an end-of-life version of Node.js, we recommend that you update +as soon as possible to an actively supported LTS version. + +Google's client libraries support legacy versions of Node.js runtimes on a +best-efforts basis with the following warnings: + +* Legacy versions are not tested in continuous integration. +* Some security patches and features cannot be backported. +* Dependencies cannot be kept up-to-date. + +Client libraries targeting some end-of-life versions of Node.js are available, and +can be installed through npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). +The dist-tags follow the naming convention `legacy-(version)`. +For example, `npm install @google-cloud/executor@legacy-8` installs client libraries +for versions compatible with Node.js 8. + +## Versioning + +This library follows [Semantic Versioning](http://semver.org/). + +More Information: [Google Cloud Platform Launch Stages][launch_stages] + +[launch_stages]: https://cloud.google.com/terms/launch-stages + +## Contributing + +Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-spanner-executor/CONTRIBUTING.md). + +Please note that this `README.md` +and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) +are generated from a central template. + +## License + +Apache Version 2.0 + +See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-spanner-executor/LICENSE) + +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[projects]: https://console.cloud.google.com/project +[billing]: https://support.google.com/cloud/answer/6293499#enable-billing +[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=spanner-cloud-executor.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/external/set-up-adc-local +[homepage_samples]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-spanner-executor/samples +[homepage_changelog]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-spanner-executor/CHANGELOG.md +[homepage]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-spanner-executor diff --git a/owl-bot-staging/executor/v1/package.json b/owl-bot-staging/executor/v1/package.json new file mode 100644 index 000000000..43dae9117 --- /dev/null +++ b/owl-bot-staging/executor/v1/package.json @@ -0,0 +1,61 @@ +{ + "name": "@google-cloud/executor", + "version": "0.1.0", + "description": "Executor client for Node.js", + "repository": "googleapis/nodejs-executor", + "license": "Apache-2.0", + "author": "Google LLC", + "main": "build/src/index.js", + "files": [ + "build/src", + "build/protos" + ], + "keywords": [ + "google apis client", + "google api client", + "google apis", + "google api", + "google", + "google cloud platform", + "google cloud", + "cloud", + "google executor", + "executor", + "database admin", + "instance admin", + "spanner", + "spanner executor proxy" + ], + "scripts": { + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/ && minifyProtoJson", + "compile-protos": "compileProtos src", + "docs": "jsdoc -c .jsdoc.js", + "fix": "gts fix", + "lint": "gts check", + "prepare": "npm run compile-protos && npm run compile", + "system-test": "c8 mocha build/system-test", + "test": "c8 mocha build/test" + }, + "dependencies": { + "google-gax": "^5.1.1-rc.1" + }, + "devDependencies": { + "@types/mocha": "^10.0.10", + "@types/node": "^22.18.12", + "@types/sinon": "^17.0.4", + "c8": "^10.1.3", + "gapic-tools": "^1.0.3", + "gts": "^6.0.2", + "jsdoc": "^4.0.5", + "jsdoc-fresh": "^5.0.2", + "jsdoc-region-tag": "^4.0.1", + "mocha": "^11.7.4", + "pack-n-play": "^4.2.1", + "typescript": "5.8.3", + "sinon": "^21.0.0" + }, + "engines": { + "node": ">=v18" + } +} diff --git a/owl-bot-staging/executor/v1/protos/google/spanner/admin/database/v1/backup.proto b/owl-bot-staging/executor/v1/protos/google/spanner/admin/database/v1/backup.proto new file mode 100644 index 000000000..6898814c4 --- /dev/null +++ b/owl-bot-staging/executor/v1/protos/google/spanner/admin/database/v1/backup.proto @@ -0,0 +1,773 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.spanner.admin.database.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; +import "google/spanner/admin/database/v1/common.proto"; + +option csharp_namespace = "Google.Cloud.Spanner.Admin.Database.V1"; +option go_package = "cloud.google.com/go/spanner/admin/database/apiv1/databasepb;databasepb"; +option java_multiple_files = true; +option java_outer_classname = "BackupProto"; +option java_package = "com.google.spanner.admin.database.v1"; +option php_namespace = "Google\\Cloud\\Spanner\\Admin\\Database\\V1"; +option ruby_package = "Google::Cloud::Spanner::Admin::Database::V1"; + +// A backup of a Cloud Spanner database. +message Backup { + option (google.api.resource) = { + type: "spanner.googleapis.com/Backup" + pattern: "projects/{project}/instances/{instance}/backups/{backup}" + }; + + // Indicates the current state of the backup. + enum State { + // Not specified. + STATE_UNSPECIFIED = 0; + + // The pending backup is still being created. Operations on the + // backup may fail with `FAILED_PRECONDITION` in this state. + CREATING = 1; + + // The backup is complete and ready for use. + READY = 2; + } + + // Required for the + // [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] + // operation. Name of the database from which this backup was created. This + // needs to be in the same instance as the backup. Values are of the form + // `projects//instances//databases/`. + string database = 2 [(google.api.resource_reference) = { + type: "spanner.googleapis.com/Database" + }]; + + // The backup will contain an externally consistent copy of the database at + // the timestamp specified by `version_time`. If `version_time` is not + // specified, the system will set `version_time` to the `create_time` of the + // backup. + google.protobuf.Timestamp version_time = 9; + + // Required for the + // [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] + // operation. The expiration time of the backup, with microseconds + // granularity that must be at least 6 hours and at most 366 days + // from the time the CreateBackup request is processed. Once the `expire_time` + // has passed, the backup is eligible to be automatically deleted by Cloud + // Spanner to free the resources used by the backup. + google.protobuf.Timestamp expire_time = 3; + + // Output only for the + // [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] + // operation. Required for the + // [UpdateBackup][google.spanner.admin.database.v1.DatabaseAdmin.UpdateBackup] + // operation. + // + // A globally unique identifier for the backup which cannot be + // changed. Values are of the form + // `projects//instances//backups/[a-z][a-z0-9_\-]*[a-z0-9]` + // The final segment of the name must be between 2 and 60 characters + // in length. + // + // The backup is stored in the location(s) specified in the instance + // configuration of the instance containing the backup, identified + // by the prefix of the backup name of the form + // `projects//instances/`. + string name = 1; + + // Output only. The time the + // [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] + // request is received. If the request does not specify `version_time`, the + // `version_time` of the backup will be equivalent to the `create_time`. + google.protobuf.Timestamp create_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Size of the backup in bytes. + int64 size_bytes = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The number of bytes that will be freed by deleting this + // backup. This value will be zero if, for example, this backup is part of an + // incremental backup chain and younger backups in the chain require that we + // keep its data. For backups not in an incremental backup chain, this is + // always the size of the backup. This value may change if backups on the same + // chain get created, deleted or expired. + int64 freeable_size_bytes = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. For a backup in an incremental backup chain, this is the + // storage space needed to keep the data that has changed since the previous + // backup. For all other backups, this is always the size of the backup. This + // value may change if backups on the same chain get deleted or expired. + // + // This field can be used to calculate the total storage space used by a set + // of backups. For example, the total space used by all backups of a database + // can be computed by summing up this field. + int64 exclusive_size_bytes = 16 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The current state of the backup. + State state = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The names of the restored databases that reference the backup. + // The database names are of + // the form `projects//instances//databases/`. + // Referencing databases may exist in different instances. The existence of + // any referencing database prevents the backup from being deleted. When a + // restored database from the backup enters the `READY` state, the reference + // to the backup is removed. + repeated string referencing_databases = 7 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "spanner.googleapis.com/Database" + } + ]; + + // Output only. The encryption information for the backup. + EncryptionInfo encryption_info = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The encryption information for the backup, whether it is + // protected by one or more KMS keys. The information includes all Cloud + // KMS key versions used to encrypt the backup. The `encryption_status' field + // inside of each `EncryptionInfo` is not populated. At least one of the key + // versions must be available for the backup to be restored. If a key version + // is revoked in the middle of a restore, the restore behavior is undefined. + repeated EncryptionInfo encryption_information = 13 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The database dialect information for the backup. + DatabaseDialect database_dialect = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The names of the destination backups being created by copying + // this source backup. The backup names are of the form + // `projects//instances//backups/`. + // Referencing backups may exist in different instances. The existence of + // any referencing backup prevents the backup from being deleted. When the + // copy operation is done (either successfully completed or cancelled or the + // destination backup is deleted), the reference to the backup is removed. + repeated string referencing_backups = 11 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { type: "spanner.googleapis.com/Backup" } + ]; + + // Output only. The max allowed expiration time of the backup, with + // microseconds granularity. A backup's expiration time can be configured in + // multiple APIs: CreateBackup, UpdateBackup, CopyBackup. When updating or + // copying an existing backup, the expiration time specified must be + // less than `Backup.max_expire_time`. + google.protobuf.Timestamp max_expire_time = 12 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. List of backup schedule URIs that are associated with + // creating this backup. This is only applicable for scheduled backups, and + // is empty for on-demand backups. + // + // To optimize for storage, whenever possible, multiple schedules are + // collapsed together to create one backup. In such cases, this field captures + // the list of all backup schedule URIs that are associated with creating + // this backup. If collapsing is not done, then this field captures the + // single backup schedule URI associated with creating this backup. + repeated string backup_schedules = 14 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "spanner.googleapis.com/BackupSchedule" + } + ]; + + // Output only. Populated only for backups in an incremental backup chain. + // Backups share the same chain id if and only if they belong to the same + // incremental backup chain. Use this field to determine which backups are + // part of the same incremental backup chain. The ordering of backups in the + // chain can be determined by ordering the backup `version_time`. + string incremental_backup_chain_id = 17 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Data deleted at a time older than this is guaranteed not to be + // retained in order to support this backup. For a backup in an incremental + // backup chain, this is the version time of the oldest backup that exists or + // ever existed in the chain. For all other backups, this is the version time + // of the backup. This field can be used to understand what data is being + // retained by the backup system. + google.protobuf.Timestamp oldest_version_time = 18 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The instance partition(s) storing the backup. + // + // This is the same as the list of the instance partition(s) that the database + // had footprint in at the backup's `version_time`. + repeated BackupInstancePartition instance_partitions = 19 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The request for +// [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup]. +message CreateBackupRequest { + // Required. The name of the instance in which the backup will be + // created. This must be the same instance that contains the database the + // backup will be created from. The backup will be stored in the + // location(s) specified in the instance configuration of this + // instance. Values are of the form + // `projects//instances/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "spanner.googleapis.com/Instance" + } + ]; + + // Required. The id of the backup to be created. The `backup_id` appended to + // `parent` forms the full backup name of the form + // `projects//instances//backups/`. + string backup_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The backup to create. + Backup backup = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The encryption configuration used to encrypt the backup. If this + // field is not specified, the backup will use the same encryption + // configuration as the database by default, namely + // [encryption_type][google.spanner.admin.database.v1.CreateBackupEncryptionConfig.encryption_type] + // = `USE_DATABASE_ENCRYPTION`. + CreateBackupEncryptionConfig encryption_config = 4 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Metadata type for the operation returned by +// [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup]. +message CreateBackupMetadata { + // The name of the backup being created. + string name = 1 [ + (google.api.resource_reference) = { type: "spanner.googleapis.com/Backup" } + ]; + + // The name of the database the backup is created from. + string database = 2 [(google.api.resource_reference) = { + type: "spanner.googleapis.com/Database" + }]; + + // The progress of the + // [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] + // operation. + OperationProgress progress = 3; + + // The time at which cancellation of this operation was received. + // [Operations.CancelOperation][google.longrunning.Operations.CancelOperation] + // starts asynchronous cancellation on a long-running operation. The server + // makes a best effort to cancel the operation, but success is not guaranteed. + // Clients can use + // [Operations.GetOperation][google.longrunning.Operations.GetOperation] or + // other methods to check whether the cancellation succeeded or whether the + // operation completed despite cancellation. On successful cancellation, + // the operation is not deleted; instead, it becomes an operation with + // an [Operation.error][google.longrunning.Operation.error] value with a + // [google.rpc.Status.code][google.rpc.Status.code] of 1, + // corresponding to `Code.CANCELLED`. + google.protobuf.Timestamp cancel_time = 4; +} + +// The request for +// [CopyBackup][google.spanner.admin.database.v1.DatabaseAdmin.CopyBackup]. +message CopyBackupRequest { + // Required. The name of the destination instance that will contain the backup + // copy. Values are of the form: `projects//instances/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "spanner.googleapis.com/Instance" + } + ]; + + // Required. The id of the backup copy. + // The `backup_id` appended to `parent` forms the full backup_uri of the form + // `projects//instances//backups/`. + string backup_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The source backup to be copied. + // The source backup needs to be in READY state for it to be copied. + // Once CopyBackup is in progress, the source backup cannot be deleted or + // cleaned up on expiration until CopyBackup is finished. + // Values are of the form: + // `projects//instances//backups/`. + string source_backup = 3 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "spanner.googleapis.com/Backup" } + ]; + + // Required. The expiration time of the backup in microsecond granularity. + // The expiration time must be at least 6 hours and at most 366 days + // from the `create_time` of the source backup. Once the `expire_time` has + // passed, the backup is eligible to be automatically deleted by Cloud Spanner + // to free the resources used by the backup. + google.protobuf.Timestamp expire_time = 4 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. The encryption configuration used to encrypt the backup. If this + // field is not specified, the backup will use the same encryption + // configuration as the source backup by default, namely + // [encryption_type][google.spanner.admin.database.v1.CopyBackupEncryptionConfig.encryption_type] + // = `USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION`. + CopyBackupEncryptionConfig encryption_config = 5 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Metadata type for the operation returned by +// [CopyBackup][google.spanner.admin.database.v1.DatabaseAdmin.CopyBackup]. +message CopyBackupMetadata { + // The name of the backup being created through the copy operation. + // Values are of the form + // `projects//instances//backups/`. + string name = 1 [ + (google.api.resource_reference) = { type: "spanner.googleapis.com/Backup" } + ]; + + // The name of the source backup that is being copied. + // Values are of the form + // `projects//instances//backups/`. + string source_backup = 2 [ + (google.api.resource_reference) = { type: "spanner.googleapis.com/Backup" } + ]; + + // The progress of the + // [CopyBackup][google.spanner.admin.database.v1.DatabaseAdmin.CopyBackup] + // operation. + OperationProgress progress = 3; + + // The time at which cancellation of CopyBackup operation was received. + // [Operations.CancelOperation][google.longrunning.Operations.CancelOperation] + // starts asynchronous cancellation on a long-running operation. The server + // makes a best effort to cancel the operation, but success is not guaranteed. + // Clients can use + // [Operations.GetOperation][google.longrunning.Operations.GetOperation] or + // other methods to check whether the cancellation succeeded or whether the + // operation completed despite cancellation. On successful cancellation, + // the operation is not deleted; instead, it becomes an operation with + // an [Operation.error][google.longrunning.Operation.error] value with a + // [google.rpc.Status.code][google.rpc.Status.code] of 1, + // corresponding to `Code.CANCELLED`. + google.protobuf.Timestamp cancel_time = 4; +} + +// The request for +// [UpdateBackup][google.spanner.admin.database.v1.DatabaseAdmin.UpdateBackup]. +message UpdateBackupRequest { + // Required. The backup to update. `backup.name`, and the fields to be updated + // as specified by `update_mask` are required. Other fields are ignored. + // Update is only supported for the following fields: + // * `backup.expire_time`. + Backup backup = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. A mask specifying which fields (e.g. `expire_time`) in the + // Backup resource should be updated. This mask is relative to the Backup + // resource, not to the request message. The field mask must always be + // specified; this prevents any future fields from being erased accidentally + // by clients that do not know about them. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// The request for +// [GetBackup][google.spanner.admin.database.v1.DatabaseAdmin.GetBackup]. +message GetBackupRequest { + // Required. Name of the backup. + // Values are of the form + // `projects//instances//backups/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "spanner.googleapis.com/Backup" } + ]; +} + +// The request for +// [DeleteBackup][google.spanner.admin.database.v1.DatabaseAdmin.DeleteBackup]. +message DeleteBackupRequest { + // Required. Name of the backup to delete. + // Values are of the form + // `projects//instances//backups/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "spanner.googleapis.com/Backup" } + ]; +} + +// The request for +// [ListBackups][google.spanner.admin.database.v1.DatabaseAdmin.ListBackups]. +message ListBackupsRequest { + // Required. The instance to list backups from. Values are of the + // form `projects//instances/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "spanner.googleapis.com/Instance" + } + ]; + + // An expression that filters the list of returned backups. + // + // A filter expression consists of a field name, a comparison operator, and a + // value for filtering. + // The value must be a string, a number, or a boolean. The comparison operator + // must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. + // Colon `:` is the contains operator. Filter rules are not case sensitive. + // + // The following fields in the + // [Backup][google.spanner.admin.database.v1.Backup] are eligible for + // filtering: + // + // * `name` + // * `database` + // * `state` + // * `create_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) + // * `expire_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) + // * `version_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) + // * `size_bytes` + // * `backup_schedules` + // + // You can combine multiple expressions by enclosing each expression in + // parentheses. By default, expressions are combined with AND logic, but + // you can specify AND, OR, and NOT logic explicitly. + // + // Here are a few examples: + // + // * `name:Howl` - The backup's name contains the string "howl". + // * `database:prod` + // - The database's name contains the string "prod". + // * `state:CREATING` - The backup is pending creation. + // * `state:READY` - The backup is fully created and ready for use. + // * `(name:howl) AND (create_time < \"2018-03-28T14:50:00Z\")` + // - The backup name contains the string "howl" and `create_time` + // of the backup is before 2018-03-28T14:50:00Z. + // * `expire_time < \"2018-03-28T14:50:00Z\"` + // - The backup `expire_time` is before 2018-03-28T14:50:00Z. + // * `size_bytes > 10000000000` - The backup's size is greater than 10GB + // * `backup_schedules:daily` + // - The backup is created from a schedule with "daily" in its name. + string filter = 2; + + // Number of backups to be returned in the response. If 0 or + // less, defaults to the server's maximum allowed page size. + int32 page_size = 3; + + // If non-empty, `page_token` should contain a + // [next_page_token][google.spanner.admin.database.v1.ListBackupsResponse.next_page_token] + // from a previous + // [ListBackupsResponse][google.spanner.admin.database.v1.ListBackupsResponse] + // to the same `parent` and with the same `filter`. + string page_token = 4; +} + +// The response for +// [ListBackups][google.spanner.admin.database.v1.DatabaseAdmin.ListBackups]. +message ListBackupsResponse { + // The list of matching backups. Backups returned are ordered by `create_time` + // in descending order, starting from the most recent `create_time`. + repeated Backup backups = 1; + + // `next_page_token` can be sent in a subsequent + // [ListBackups][google.spanner.admin.database.v1.DatabaseAdmin.ListBackups] + // call to fetch more of the matching backups. + string next_page_token = 2; +} + +// The request for +// [ListBackupOperations][google.spanner.admin.database.v1.DatabaseAdmin.ListBackupOperations]. +message ListBackupOperationsRequest { + // Required. The instance of the backup operations. Values are of + // the form `projects//instances/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "spanner.googleapis.com/Instance" + } + ]; + + // An expression that filters the list of returned backup operations. + // + // A filter expression consists of a field name, a + // comparison operator, and a value for filtering. + // The value must be a string, a number, or a boolean. The comparison operator + // must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. + // Colon `:` is the contains operator. Filter rules are not case sensitive. + // + // The following fields in the [operation][google.longrunning.Operation] + // are eligible for filtering: + // + // * `name` - The name of the long-running operation + // * `done` - False if the operation is in progress, else true. + // * `metadata.@type` - the type of metadata. For example, the type string + // for + // [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata] + // is + // `type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata`. + // * `metadata.` - any field in metadata.value. + // `metadata.@type` must be specified first if filtering on metadata + // fields. + // * `error` - Error associated with the long-running operation. + // * `response.@type` - the type of response. + // * `response.` - any field in response.value. + // + // You can combine multiple expressions by enclosing each expression in + // parentheses. By default, expressions are combined with AND logic, but + // you can specify AND, OR, and NOT logic explicitly. + // + // Here are a few examples: + // + // * `done:true` - The operation is complete. + // * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \ + // `metadata.database:prod` - Returns operations where: + // * The operation's metadata type is + // [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. + // * The source database name of backup contains the string "prod". + // * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \ + // `(metadata.name:howl) AND` \ + // `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \ + // `(error:*)` - Returns operations where: + // * The operation's metadata type is + // [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. + // * The backup name contains the string "howl". + // * The operation started before 2018-03-28T14:50:00Z. + // * The operation resulted in an error. + // * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CopyBackupMetadata) AND` \ + // `(metadata.source_backup:test) AND` \ + // `(metadata.progress.start_time < \"2022-01-18T14:50:00Z\") AND` \ + // `(error:*)` - Returns operations where: + // * The operation's metadata type is + // [CopyBackupMetadata][google.spanner.admin.database.v1.CopyBackupMetadata]. + // * The source backup name contains the string "test". + // * The operation started before 2022-01-18T14:50:00Z. + // * The operation resulted in an error. + // * `((metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \ + // `(metadata.database:test_db)) OR` \ + // `((metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CopyBackupMetadata) + // AND` \ + // `(metadata.source_backup:test_bkp)) AND` \ + // `(error:*)` - Returns operations where: + // * The operation's metadata matches either of criteria: + // * The operation's metadata type is + // [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata] + // AND the source database name of the backup contains the string + // "test_db" + // * The operation's metadata type is + // [CopyBackupMetadata][google.spanner.admin.database.v1.CopyBackupMetadata] + // AND the source backup name contains the string "test_bkp" + // * The operation resulted in an error. + string filter = 2; + + // Number of operations to be returned in the response. If 0 or + // less, defaults to the server's maximum allowed page size. + int32 page_size = 3; + + // If non-empty, `page_token` should contain a + // [next_page_token][google.spanner.admin.database.v1.ListBackupOperationsResponse.next_page_token] + // from a previous + // [ListBackupOperationsResponse][google.spanner.admin.database.v1.ListBackupOperationsResponse] + // to the same `parent` and with the same `filter`. + string page_token = 4; +} + +// The response for +// [ListBackupOperations][google.spanner.admin.database.v1.DatabaseAdmin.ListBackupOperations]. +message ListBackupOperationsResponse { + // The list of matching backup [long-running + // operations][google.longrunning.Operation]. Each operation's name will be + // prefixed by the backup's name. The operation's + // [metadata][google.longrunning.Operation.metadata] field type + // `metadata.type_url` describes the type of the metadata. Operations returned + // include those that are pending or have completed/failed/canceled within the + // last 7 days. Operations returned are ordered by + // `operation.metadata.value.progress.start_time` in descending order starting + // from the most recently started operation. + repeated google.longrunning.Operation operations = 1; + + // `next_page_token` can be sent in a subsequent + // [ListBackupOperations][google.spanner.admin.database.v1.DatabaseAdmin.ListBackupOperations] + // call to fetch more of the matching metadata. + string next_page_token = 2; +} + +// Information about a backup. +message BackupInfo { + // Name of the backup. + string backup = 1 [ + (google.api.resource_reference) = { type: "spanner.googleapis.com/Backup" } + ]; + + // The backup contains an externally consistent copy of `source_database` at + // the timestamp specified by `version_time`. If the + // [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] + // request did not specify `version_time`, the `version_time` of the backup is + // equivalent to the `create_time`. + google.protobuf.Timestamp version_time = 4; + + // The time the + // [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] + // request was received. + google.protobuf.Timestamp create_time = 2; + + // Name of the database the backup was created from. + string source_database = 3 [(google.api.resource_reference) = { + type: "spanner.googleapis.com/Database" + }]; +} + +// Encryption configuration for the backup to create. +message CreateBackupEncryptionConfig { + // Encryption types for the backup. + enum EncryptionType { + // Unspecified. Do not use. + ENCRYPTION_TYPE_UNSPECIFIED = 0; + + // Use the same encryption configuration as the database. This is the + // default option when + // [encryption_config][google.spanner.admin.database.v1.CreateBackupEncryptionConfig] + // is empty. For example, if the database is using + // `Customer_Managed_Encryption`, the backup will be using the same Cloud + // KMS key as the database. + USE_DATABASE_ENCRYPTION = 1; + + // Use Google default encryption. + GOOGLE_DEFAULT_ENCRYPTION = 2; + + // Use customer managed encryption. If specified, `kms_key_name` + // must contain a valid Cloud KMS key. + CUSTOMER_MANAGED_ENCRYPTION = 3; + } + + // Required. The encryption type of the backup. + EncryptionType encryption_type = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The Cloud KMS key that will be used to protect the backup. + // This field should be set only when + // [encryption_type][google.spanner.admin.database.v1.CreateBackupEncryptionConfig.encryption_type] + // is `CUSTOMER_MANAGED_ENCRYPTION`. Values are of the form + // `projects//locations//keyRings//cryptoKeys/`. + string kms_key_name = 2 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "cloudkms.googleapis.com/CryptoKey" + } + ]; + + // Optional. Specifies the KMS configuration for the one or more keys used to + // protect the backup. Values are of the form + // `projects//locations//keyRings//cryptoKeys/`. + // + // The keys referenced by kms_key_names must fully cover all + // regions of the backup's instance configuration. Some examples: + // * For single region instance configs, specify a single regional + // location KMS key. + // * For multi-regional instance configs of type GOOGLE_MANAGED, + // either specify a multi-regional location KMS key or multiple regional + // location KMS keys that cover all regions in the instance config. + // * For an instance config of type USER_MANAGED, please specify only + // regional location KMS keys to cover each region in the instance config. + // Multi-regional location KMS keys are not supported for USER_MANAGED + // instance configs. + repeated string kms_key_names = 3 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "cloudkms.googleapis.com/CryptoKey" + } + ]; +} + +// Encryption configuration for the copied backup. +message CopyBackupEncryptionConfig { + // Encryption types for the backup. + enum EncryptionType { + // Unspecified. Do not use. + ENCRYPTION_TYPE_UNSPECIFIED = 0; + + // This is the default option for + // [CopyBackup][google.spanner.admin.database.v1.DatabaseAdmin.CopyBackup] + // when + // [encryption_config][google.spanner.admin.database.v1.CopyBackupEncryptionConfig] + // is not specified. For example, if the source backup is using + // `Customer_Managed_Encryption`, the backup will be using the same Cloud + // KMS key as the source backup. + USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION = 1; + + // Use Google default encryption. + GOOGLE_DEFAULT_ENCRYPTION = 2; + + // Use customer managed encryption. If specified, either `kms_key_name` or + // `kms_key_names` must contain valid Cloud KMS key(s). + CUSTOMER_MANAGED_ENCRYPTION = 3; + } + + // Required. The encryption type of the backup. + EncryptionType encryption_type = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The Cloud KMS key that will be used to protect the backup. + // This field should be set only when + // [encryption_type][google.spanner.admin.database.v1.CopyBackupEncryptionConfig.encryption_type] + // is `CUSTOMER_MANAGED_ENCRYPTION`. Values are of the form + // `projects//locations//keyRings//cryptoKeys/`. + string kms_key_name = 2 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "cloudkms.googleapis.com/CryptoKey" + } + ]; + + // Optional. Specifies the KMS configuration for the one or more keys used to + // protect the backup. Values are of the form + // `projects//locations//keyRings//cryptoKeys/`. + // Kms keys specified can be in any order. + // + // The keys referenced by kms_key_names must fully cover all + // regions of the backup's instance configuration. Some examples: + // * For single region instance configs, specify a single regional + // location KMS key. + // * For multi-regional instance configs of type GOOGLE_MANAGED, + // either specify a multi-regional location KMS key or multiple regional + // location KMS keys that cover all regions in the instance config. + // * For an instance config of type USER_MANAGED, please specify only + // regional location KMS keys to cover each region in the instance config. + // Multi-regional location KMS keys are not supported for USER_MANAGED + // instance configs. + repeated string kms_key_names = 3 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "cloudkms.googleapis.com/CryptoKey" + } + ]; +} + +// The specification for full backups. +// A full backup stores the entire contents of the database at a given +// version time. +message FullBackupSpec {} + +// The specification for incremental backup chains. +// An incremental backup stores the delta of changes between a previous +// backup and the database contents at a given version time. An +// incremental backup chain consists of a full backup and zero or more +// successive incremental backups. The first backup created for an +// incremental backup chain is always a full backup. +message IncrementalBackupSpec {} + +// Instance partition information for the backup. +message BackupInstancePartition { + // A unique identifier for the instance partition. Values are of the form + // `projects//instances//instancePartitions/` + string instance_partition = 1 [(google.api.resource_reference) = { + type: "spanner.googleapis.com/InstancePartition" + }]; +} diff --git a/owl-bot-staging/executor/v1/protos/google/spanner/admin/database/v1/backup_schedule.proto b/owl-bot-staging/executor/v1/protos/google/spanner/admin/database/v1/backup_schedule.proto new file mode 100644 index 000000000..c273516ae --- /dev/null +++ b/owl-bot-staging/executor/v1/protos/google/spanner/admin/database/v1/backup_schedule.proto @@ -0,0 +1,230 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.spanner.admin.database.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; +import "google/spanner/admin/database/v1/backup.proto"; + +option csharp_namespace = "Google.Cloud.Spanner.Admin.Database.V1"; +option go_package = "cloud.google.com/go/spanner/admin/database/apiv1/databasepb;databasepb"; +option java_multiple_files = true; +option java_outer_classname = "BackupScheduleProto"; +option java_package = "com.google.spanner.admin.database.v1"; +option php_namespace = "Google\\Cloud\\Spanner\\Admin\\Database\\V1"; +option ruby_package = "Google::Cloud::Spanner::Admin::Database::V1"; + +// Defines specifications of the backup schedule. +message BackupScheduleSpec { + // Required. + oneof schedule_spec { + // Cron style schedule specification. + CrontabSpec cron_spec = 1; + } +} + +// BackupSchedule expresses the automated backup creation specification for a +// Spanner database. +// Next ID: 10 +message BackupSchedule { + option (google.api.resource) = { + type: "spanner.googleapis.com/BackupSchedule" + pattern: "projects/{project}/instances/{instance}/databases/{database}/backupSchedules/{schedule}" + plural: "backupSchedules" + singular: "backupSchedule" + }; + + // Identifier. Output only for the + // [CreateBackupSchedule][DatabaseAdmin.CreateBackupSchededule] operation. + // Required for the + // [UpdateBackupSchedule][google.spanner.admin.database.v1.DatabaseAdmin.UpdateBackupSchedule] + // operation. A globally unique identifier for the backup schedule which + // cannot be changed. Values are of the form + // `projects//instances//databases//backupSchedules/[a-z][a-z0-9_\-]*[a-z0-9]` + // The final segment of the name must be between 2 and 60 characters in + // length. + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Optional. The schedule specification based on which the backup creations + // are triggered. + BackupScheduleSpec spec = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The retention duration of a backup that must be at least 6 hours + // and at most 366 days. The backup is eligible to be automatically deleted + // once the retention period has elapsed. + google.protobuf.Duration retention_duration = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The encryption configuration that will be used to encrypt the + // backup. If this field is not specified, the backup will use the same + // encryption configuration as the database. + CreateBackupEncryptionConfig encryption_config = 4 + [(google.api.field_behavior) = OPTIONAL]; + + // Required. Backup type spec determines the type of backup that is created by + // the backup schedule. Currently, only full backups are supported. + oneof backup_type_spec { + // The schedule creates only full backups. + FullBackupSpec full_backup_spec = 7; + + // The schedule creates incremental backup chains. + IncrementalBackupSpec incremental_backup_spec = 8; + } + + // Output only. The timestamp at which the schedule was last updated. + // If the schedule has never been updated, this field contains the timestamp + // when the schedule was first created. + google.protobuf.Timestamp update_time = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// CrontabSpec can be used to specify the version time and frequency at +// which the backup should be created. +message CrontabSpec { + // Required. Textual representation of the crontab. User can customize the + // backup frequency and the backup version time using the cron + // expression. The version time must be in UTC timezone. + // + // The backup will contain an externally consistent copy of the + // database at the version time. Allowed frequencies are 12 hour, 1 day, + // 1 week and 1 month. Examples of valid cron specifications: + // * `0 2/12 * * * ` : every 12 hours at (2, 14) hours past midnight in UTC. + // * `0 2,14 * * * ` : every 12 hours at (2,14) hours past midnight in UTC. + // * `0 2 * * * ` : once a day at 2 past midnight in UTC. + // * `0 2 * * 0 ` : once a week every Sunday at 2 past midnight in UTC. + // * `0 2 8 * * ` : once a month on 8th day at 2 past midnight in UTC. + string text = 1 [(google.api.field_behavior) = REQUIRED]; + + // Output only. The time zone of the times in `CrontabSpec.text`. Currently + // only UTC is supported. + string time_zone = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Schedule backups will contain an externally consistent copy + // of the database at the version time specified in + // `schedule_spec.cron_spec`. However, Spanner may not initiate the creation + // of the scheduled backups at that version time. Spanner will initiate + // the creation of scheduled backups within the time window bounded by the + // version_time specified in `schedule_spec.cron_spec` and version_time + + // `creation_window`. + google.protobuf.Duration creation_window = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The request for +// [CreateBackupSchedule][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackupSchedule]. +message CreateBackupScheduleRequest { + // Required. The name of the database that this backup schedule applies to. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "spanner.googleapis.com/Database" + } + ]; + + // Required. The Id to use for the backup schedule. The `backup_schedule_id` + // appended to `parent` forms the full backup schedule name of the form + // `projects//instances//databases//backupSchedules/`. + string backup_schedule_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The backup schedule to create. + BackupSchedule backup_schedule = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// The request for +// [GetBackupSchedule][google.spanner.admin.database.v1.DatabaseAdmin.GetBackupSchedule]. +message GetBackupScheduleRequest { + // Required. The name of the schedule to retrieve. + // Values are of the form + // `projects//instances//databases//backupSchedules/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "spanner.googleapis.com/BackupSchedule" + } + ]; +} + +// The request for +// [DeleteBackupSchedule][google.spanner.admin.database.v1.DatabaseAdmin.DeleteBackupSchedule]. +message DeleteBackupScheduleRequest { + // Required. The name of the schedule to delete. + // Values are of the form + // `projects//instances//databases//backupSchedules/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "spanner.googleapis.com/BackupSchedule" + } + ]; +} + +// The request for +// [ListBackupSchedules][google.spanner.admin.database.v1.DatabaseAdmin.ListBackupSchedules]. +message ListBackupSchedulesRequest { + // Required. Database is the parent resource whose backup schedules should be + // listed. Values are of the form + // projects//instances//databases/ + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "spanner.googleapis.com/Database" + } + ]; + + // Optional. Number of backup schedules to be returned in the response. If 0 + // or less, defaults to the server's maximum allowed page size. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If non-empty, `page_token` should contain a + // [next_page_token][google.spanner.admin.database.v1.ListBackupSchedulesResponse.next_page_token] + // from a previous + // [ListBackupSchedulesResponse][google.spanner.admin.database.v1.ListBackupSchedulesResponse] + // to the same `parent`. + string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// The response for +// [ListBackupSchedules][google.spanner.admin.database.v1.DatabaseAdmin.ListBackupSchedules]. +message ListBackupSchedulesResponse { + // The list of backup schedules for a database. + repeated BackupSchedule backup_schedules = 1; + + // `next_page_token` can be sent in a subsequent + // [ListBackupSchedules][google.spanner.admin.database.v1.DatabaseAdmin.ListBackupSchedules] + // call to fetch more of the schedules. + string next_page_token = 2; +} + +// The request for +// [UpdateBackupScheduleRequest][google.spanner.admin.database.v1.DatabaseAdmin.UpdateBackupSchedule]. +message UpdateBackupScheduleRequest { + // Required. The backup schedule to update. `backup_schedule.name`, and the + // fields to be updated as specified by `update_mask` are required. Other + // fields are ignored. + BackupSchedule backup_schedule = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. A mask specifying which fields in the BackupSchedule resource + // should be updated. This mask is relative to the BackupSchedule resource, + // not to the request message. The field mask must always be + // specified; this prevents any future fields from being erased + // accidentally. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; +} diff --git a/owl-bot-staging/executor/v1/protos/google/spanner/admin/database/v1/common.proto b/owl-bot-staging/executor/v1/protos/google/spanner/admin/database/v1/common.proto new file mode 100644 index 000000000..c494b8cf7 --- /dev/null +++ b/owl-bot-staging/executor/v1/protos/google/spanner/admin/database/v1/common.proto @@ -0,0 +1,132 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.spanner.admin.database.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +option csharp_namespace = "Google.Cloud.Spanner.Admin.Database.V1"; +option go_package = "cloud.google.com/go/spanner/admin/database/apiv1/databasepb;databasepb"; +option java_multiple_files = true; +option java_outer_classname = "CommonProto"; +option java_package = "com.google.spanner.admin.database.v1"; +option php_namespace = "Google\\Cloud\\Spanner\\Admin\\Database\\V1"; +option ruby_package = "Google::Cloud::Spanner::Admin::Database::V1"; +option (google.api.resource_definition) = { + type: "cloudkms.googleapis.com/CryptoKey" + pattern: "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}" +}; +option (google.api.resource_definition) = { + type: "cloudkms.googleapis.com/CryptoKeyVersion" + pattern: "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}" +}; + +// Encapsulates progress related information for a Cloud Spanner long +// running operation. +message OperationProgress { + // Percent completion of the operation. + // Values are between 0 and 100 inclusive. + int32 progress_percent = 1; + + // Time the request was received. + google.protobuf.Timestamp start_time = 2; + + // If set, the time at which this operation failed or was completed + // successfully. + google.protobuf.Timestamp end_time = 3; +} + +// Encryption configuration for a Cloud Spanner database. +message EncryptionConfig { + // The Cloud KMS key to be used for encrypting and decrypting + // the database. Values are of the form + // `projects//locations//keyRings//cryptoKeys/`. + string kms_key_name = 2 [(google.api.resource_reference) = { + type: "cloudkms.googleapis.com/CryptoKey" + }]; + + // Specifies the KMS configuration for the one or more keys used to encrypt + // the database. Values are of the form + // `projects//locations//keyRings//cryptoKeys/`. + // + // The keys referenced by kms_key_names must fully cover all + // regions of the database instance configuration. Some examples: + // * For single region database instance configs, specify a single regional + // location KMS key. + // * For multi-regional database instance configs of type GOOGLE_MANAGED, + // either specify a multi-regional location KMS key or multiple regional + // location KMS keys that cover all regions in the instance config. + // * For a database instance config of type USER_MANAGED, please specify only + // regional location KMS keys to cover each region in the instance config. + // Multi-regional location KMS keys are not supported for USER_MANAGED + // instance configs. + repeated string kms_key_names = 3 [(google.api.resource_reference) = { + type: "cloudkms.googleapis.com/CryptoKey" + }]; +} + +// Encryption information for a Cloud Spanner database or backup. +message EncryptionInfo { + // Possible encryption types. + enum Type { + // Encryption type was not specified, though data at rest remains encrypted. + TYPE_UNSPECIFIED = 0; + + // The data is encrypted at rest with a key that is + // fully managed by Google. No key version or status will be populated. + // This is the default state. + GOOGLE_DEFAULT_ENCRYPTION = 1; + + // The data is encrypted at rest with a key that is + // managed by the customer. The active version of the key. `kms_key_version` + // will be populated, and `encryption_status` may be populated. + CUSTOMER_MANAGED_ENCRYPTION = 2; + } + + // Output only. The type of encryption. + Type encryption_type = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. If present, the status of a recent encrypt/decrypt call on + // underlying data for this database or backup. Regardless of status, data is + // always encrypted at rest. + google.rpc.Status encryption_status = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A Cloud KMS key version that is being used to protect the + // database or backup. + string kms_key_version = 2 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "cloudkms.googleapis.com/CryptoKeyVersion" + } + ]; +} + +// Indicates the dialect type of a database. +enum DatabaseDialect { + // Default value. This value will create a database with the + // GOOGLE_STANDARD_SQL dialect. + DATABASE_DIALECT_UNSPECIFIED = 0; + + // GoogleSQL supported SQL. + GOOGLE_STANDARD_SQL = 1; + + // PostgreSQL supported SQL. + POSTGRESQL = 2; +} diff --git a/owl-bot-staging/executor/v1/protos/google/spanner/admin/database/v1/spanner_database_admin.proto b/owl-bot-staging/executor/v1/protos/google/spanner/admin/database/v1/spanner_database_admin.proto new file mode 100644 index 000000000..d41a4114c --- /dev/null +++ b/owl-bot-staging/executor/v1/protos/google/spanner/admin/database/v1/spanner_database_admin.proto @@ -0,0 +1,1314 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.spanner.admin.database.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/iam/v1/iam_policy.proto"; +import "google/iam/v1/policy.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; +import "google/spanner/admin/database/v1/backup.proto"; +import "google/spanner/admin/database/v1/backup_schedule.proto"; +import "google/spanner/admin/database/v1/common.proto"; + +option csharp_namespace = "Google.Cloud.Spanner.Admin.Database.V1"; +option go_package = "cloud.google.com/go/spanner/admin/database/apiv1/databasepb;databasepb"; +option java_multiple_files = true; +option java_outer_classname = "SpannerDatabaseAdminProto"; +option java_package = "com.google.spanner.admin.database.v1"; +option php_namespace = "Google\\Cloud\\Spanner\\Admin\\Database\\V1"; +option ruby_package = "Google::Cloud::Spanner::Admin::Database::V1"; +option (google.api.resource_definition) = { + type: "spanner.googleapis.com/Instance" + pattern: "projects/{project}/instances/{instance}" +}; +option (google.api.resource_definition) = { + type: "spanner.googleapis.com/InstancePartition" + pattern: "projects/{project}/instances/{instance}/instancePartitions/{instance_partition}" +}; + +// Cloud Spanner Database Admin API +// +// The Cloud Spanner Database Admin API can be used to: +// * create, drop, and list databases +// * update the schema of pre-existing databases +// * create, delete, copy and list backups for a database +// * restore a database from an existing backup +service DatabaseAdmin { + option (google.api.default_host) = "spanner.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/spanner.admin"; + + // Lists Cloud Spanner databases. + rpc ListDatabases(ListDatabasesRequest) returns (ListDatabasesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/instances/*}/databases" + }; + option (google.api.method_signature) = "parent"; + } + + // Creates a new Cloud Spanner database and starts to prepare it for serving. + // The returned [long-running operation][google.longrunning.Operation] will + // have a name of the format `/operations/` and + // can be used to track preparation of the database. The + // [metadata][google.longrunning.Operation.metadata] field type is + // [CreateDatabaseMetadata][google.spanner.admin.database.v1.CreateDatabaseMetadata]. + // The [response][google.longrunning.Operation.response] field type is + // [Database][google.spanner.admin.database.v1.Database], if successful. + rpc CreateDatabase(CreateDatabaseRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/instances/*}/databases" + body: "*" + }; + option (google.api.method_signature) = "parent,create_statement"; + option (google.longrunning.operation_info) = { + response_type: "google.spanner.admin.database.v1.Database" + metadata_type: "google.spanner.admin.database.v1.CreateDatabaseMetadata" + }; + } + + // Gets the state of a Cloud Spanner database. + rpc GetDatabase(GetDatabaseRequest) returns (Database) { + option (google.api.http) = { + get: "/v1/{name=projects/*/instances/*/databases/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates a Cloud Spanner database. The returned + // [long-running operation][google.longrunning.Operation] can be used to track + // the progress of updating the database. If the named database does not + // exist, returns `NOT_FOUND`. + // + // While the operation is pending: + // + // * The database's + // [reconciling][google.spanner.admin.database.v1.Database.reconciling] + // field is set to true. + // * Cancelling the operation is best-effort. If the cancellation succeeds, + // the operation metadata's + // [cancel_time][google.spanner.admin.database.v1.UpdateDatabaseMetadata.cancel_time] + // is set, the updates are reverted, and the operation terminates with a + // `CANCELLED` status. + // * New UpdateDatabase requests will return a `FAILED_PRECONDITION` error + // until the pending operation is done (returns successfully or with + // error). + // * Reading the database via the API continues to give the pre-request + // values. + // + // Upon completion of the returned operation: + // + // * The new values are in effect and readable via the API. + // * The database's + // [reconciling][google.spanner.admin.database.v1.Database.reconciling] + // field becomes false. + // + // The returned [long-running operation][google.longrunning.Operation] will + // have a name of the format + // `projects//instances//databases//operations/` + // and can be used to track the database modification. The + // [metadata][google.longrunning.Operation.metadata] field type is + // [UpdateDatabaseMetadata][google.spanner.admin.database.v1.UpdateDatabaseMetadata]. + // The [response][google.longrunning.Operation.response] field type is + // [Database][google.spanner.admin.database.v1.Database], if successful. + rpc UpdateDatabase(UpdateDatabaseRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{database.name=projects/*/instances/*/databases/*}" + body: "database" + }; + option (google.api.method_signature) = "database,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Database" + metadata_type: "UpdateDatabaseMetadata" + }; + } + + // Updates the schema of a Cloud Spanner database by + // creating/altering/dropping tables, columns, indexes, etc. The returned + // [long-running operation][google.longrunning.Operation] will have a name of + // the format `/operations/` and can be used to + // track execution of the schema change(s). The + // [metadata][google.longrunning.Operation.metadata] field type is + // [UpdateDatabaseDdlMetadata][google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata]. + // The operation has no response. + rpc UpdateDatabaseDdl(UpdateDatabaseDdlRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{database=projects/*/instances/*/databases/*}/ddl" + body: "*" + }; + option (google.api.method_signature) = "database,statements"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata" + }; + } + + // Drops (aka deletes) a Cloud Spanner database. + // Completed backups for the database will be retained according to their + // `expire_time`. + // Note: Cloud Spanner might continue to accept requests for a few seconds + // after the database has been deleted. + rpc DropDatabase(DropDatabaseRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{database=projects/*/instances/*/databases/*}" + }; + option (google.api.method_signature) = "database"; + } + + // Returns the schema of a Cloud Spanner database as a list of formatted + // DDL statements. This method does not show pending schema updates, those may + // be queried using the [Operations][google.longrunning.Operations] API. + rpc GetDatabaseDdl(GetDatabaseDdlRequest) returns (GetDatabaseDdlResponse) { + option (google.api.http) = { + get: "/v1/{database=projects/*/instances/*/databases/*}/ddl" + }; + option (google.api.method_signature) = "database"; + } + + // Sets the access control policy on a database or backup resource. + // Replaces any existing policy. + // + // Authorization requires `spanner.databases.setIamPolicy` + // permission on [resource][google.iam.v1.SetIamPolicyRequest.resource]. + // For backups, authorization requires `spanner.backups.setIamPolicy` + // permission on [resource][google.iam.v1.SetIamPolicyRequest.resource]. + rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) + returns (google.iam.v1.Policy) { + option (google.api.http) = { + post: "/v1/{resource=projects/*/instances/*/databases/*}:setIamPolicy" + body: "*" + additional_bindings { + post: "/v1/{resource=projects/*/instances/*/backups/*}:setIamPolicy" + body: "*" + } + additional_bindings { + post: "/v1/{resource=projects/*/instances/*/databases/*/backupSchedules/*}:setIamPolicy" + body: "*" + } + }; + option (google.api.method_signature) = "resource,policy"; + } + + // Gets the access control policy for a database or backup resource. + // Returns an empty policy if a database or backup exists but does not have a + // policy set. + // + // Authorization requires `spanner.databases.getIamPolicy` permission on + // [resource][google.iam.v1.GetIamPolicyRequest.resource]. + // For backups, authorization requires `spanner.backups.getIamPolicy` + // permission on [resource][google.iam.v1.GetIamPolicyRequest.resource]. + rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) + returns (google.iam.v1.Policy) { + option (google.api.http) = { + post: "/v1/{resource=projects/*/instances/*/databases/*}:getIamPolicy" + body: "*" + additional_bindings { + post: "/v1/{resource=projects/*/instances/*/backups/*}:getIamPolicy" + body: "*" + } + additional_bindings { + post: "/v1/{resource=projects/*/instances/*/databases/*/backupSchedules/*}:getIamPolicy" + body: "*" + } + }; + option (google.api.method_signature) = "resource"; + } + + // Returns permissions that the caller has on the specified database or backup + // resource. + // + // Attempting this RPC on a non-existent Cloud Spanner database will + // result in a NOT_FOUND error if the user has + // `spanner.databases.list` permission on the containing Cloud + // Spanner instance. Otherwise returns an empty set of permissions. + // Calling this method on a backup that does not exist will + // result in a NOT_FOUND error if the user has + // `spanner.backups.list` permission on the containing instance. + rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) + returns (google.iam.v1.TestIamPermissionsResponse) { + option (google.api.http) = { + post: "/v1/{resource=projects/*/instances/*/databases/*}:testIamPermissions" + body: "*" + additional_bindings { + post: "/v1/{resource=projects/*/instances/*/backups/*}:testIamPermissions" + body: "*" + } + additional_bindings { + post: "/v1/{resource=projects/*/instances/*/databases/*/backupSchedules/*}:testIamPermissions" + body: "*" + } + additional_bindings { + post: "/v1/{resource=projects/*/instances/*/databases/*/databaseRoles/*}:testIamPermissions" + body: "*" + } + }; + option (google.api.method_signature) = "resource,permissions"; + } + + // Starts creating a new Cloud Spanner Backup. + // The returned backup [long-running operation][google.longrunning.Operation] + // will have a name of the format + // `projects//instances//backups//operations/` + // and can be used to track creation of the backup. The + // [metadata][google.longrunning.Operation.metadata] field type is + // [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. + // The [response][google.longrunning.Operation.response] field type is + // [Backup][google.spanner.admin.database.v1.Backup], if successful. + // Cancelling the returned operation will stop the creation and delete the + // backup. There can be only one pending backup creation per database. Backup + // creation of different databases can run concurrently. + rpc CreateBackup(CreateBackupRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/instances/*}/backups" + body: "backup" + }; + option (google.api.method_signature) = "parent,backup,backup_id"; + option (google.longrunning.operation_info) = { + response_type: "google.spanner.admin.database.v1.Backup" + metadata_type: "google.spanner.admin.database.v1.CreateBackupMetadata" + }; + } + + // Starts copying a Cloud Spanner Backup. + // The returned backup [long-running operation][google.longrunning.Operation] + // will have a name of the format + // `projects//instances//backups//operations/` + // and can be used to track copying of the backup. The operation is associated + // with the destination backup. + // The [metadata][google.longrunning.Operation.metadata] field type is + // [CopyBackupMetadata][google.spanner.admin.database.v1.CopyBackupMetadata]. + // The [response][google.longrunning.Operation.response] field type is + // [Backup][google.spanner.admin.database.v1.Backup], if successful. + // Cancelling the returned operation will stop the copying and delete the + // destination backup. Concurrent CopyBackup requests can run on the same + // source backup. + rpc CopyBackup(CopyBackupRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/instances/*}/backups:copy" + body: "*" + }; + option (google.api.method_signature) = + "parent,backup_id,source_backup,expire_time"; + option (google.longrunning.operation_info) = { + response_type: "google.spanner.admin.database.v1.Backup" + metadata_type: "google.spanner.admin.database.v1.CopyBackupMetadata" + }; + } + + // Gets metadata on a pending or completed + // [Backup][google.spanner.admin.database.v1.Backup]. + rpc GetBackup(GetBackupRequest) returns (Backup) { + option (google.api.http) = { + get: "/v1/{name=projects/*/instances/*/backups/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates a pending or completed + // [Backup][google.spanner.admin.database.v1.Backup]. + rpc UpdateBackup(UpdateBackupRequest) returns (Backup) { + option (google.api.http) = { + patch: "/v1/{backup.name=projects/*/instances/*/backups/*}" + body: "backup" + }; + option (google.api.method_signature) = "backup,update_mask"; + } + + // Deletes a pending or completed + // [Backup][google.spanner.admin.database.v1.Backup]. + rpc DeleteBackup(DeleteBackupRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/instances/*/backups/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists completed and pending backups. + // Backups returned are ordered by `create_time` in descending order, + // starting from the most recent `create_time`. + rpc ListBackups(ListBackupsRequest) returns (ListBackupsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/instances/*}/backups" + }; + option (google.api.method_signature) = "parent"; + } + + // Create a new database by restoring from a completed backup. The new + // database must be in the same project and in an instance with the same + // instance configuration as the instance containing + // the backup. The returned database [long-running + // operation][google.longrunning.Operation] has a name of the format + // `projects//instances//databases//operations/`, + // and can be used to track the progress of the operation, and to cancel it. + // The [metadata][google.longrunning.Operation.metadata] field type is + // [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata]. + // The [response][google.longrunning.Operation.response] type + // is [Database][google.spanner.admin.database.v1.Database], if + // successful. Cancelling the returned operation will stop the restore and + // delete the database. + // There can be only one database being restored into an instance at a time. + // Once the restore operation completes, a new restore operation can be + // initiated, without waiting for the optimize operation associated with the + // first restore to complete. + rpc RestoreDatabase(RestoreDatabaseRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/instances/*}/databases:restore" + body: "*" + }; + option (google.api.method_signature) = "parent,database_id,backup"; + option (google.longrunning.operation_info) = { + response_type: "google.spanner.admin.database.v1.Database" + metadata_type: "google.spanner.admin.database.v1.RestoreDatabaseMetadata" + }; + } + + // Lists database [longrunning-operations][google.longrunning.Operation]. + // A database operation has a name of the form + // `projects//instances//databases//operations/`. + // The long-running operation + // [metadata][google.longrunning.Operation.metadata] field type + // `metadata.type_url` describes the type of the metadata. Operations returned + // include those that have completed/failed/canceled within the last 7 days, + // and pending operations. + rpc ListDatabaseOperations(ListDatabaseOperationsRequest) + returns (ListDatabaseOperationsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/instances/*}/databaseOperations" + }; + option (google.api.method_signature) = "parent"; + } + + // Lists the backup [long-running operations][google.longrunning.Operation] in + // the given instance. A backup operation has a name of the form + // `projects//instances//backups//operations/`. + // The long-running operation + // [metadata][google.longrunning.Operation.metadata] field type + // `metadata.type_url` describes the type of the metadata. Operations returned + // include those that have completed/failed/canceled within the last 7 days, + // and pending operations. Operations returned are ordered by + // `operation.metadata.value.progress.start_time` in descending order starting + // from the most recently started operation. + rpc ListBackupOperations(ListBackupOperationsRequest) + returns (ListBackupOperationsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/instances/*}/backupOperations" + }; + option (google.api.method_signature) = "parent"; + } + + // Lists Cloud Spanner database roles. + rpc ListDatabaseRoles(ListDatabaseRolesRequest) + returns (ListDatabaseRolesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/instances/*/databases/*}/databaseRoles" + }; + option (google.api.method_signature) = "parent"; + } + + // Adds split points to specified tables, indexes of a database. + rpc AddSplitPoints(AddSplitPointsRequest) returns (AddSplitPointsResponse) { + option (google.api.http) = { + post: "/v1/{database=projects/*/instances/*/databases/*}:addSplitPoints" + body: "*" + }; + option (google.api.method_signature) = "database,split_points"; + } + + // Creates a new backup schedule. + rpc CreateBackupSchedule(CreateBackupScheduleRequest) + returns (BackupSchedule) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/instances/*/databases/*}/backupSchedules" + body: "backup_schedule" + }; + option (google.api.method_signature) = + "parent,backup_schedule,backup_schedule_id"; + } + + // Gets backup schedule for the input schedule name. + rpc GetBackupSchedule(GetBackupScheduleRequest) returns (BackupSchedule) { + option (google.api.http) = { + get: "/v1/{name=projects/*/instances/*/databases/*/backupSchedules/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates a backup schedule. + rpc UpdateBackupSchedule(UpdateBackupScheduleRequest) + returns (BackupSchedule) { + option (google.api.http) = { + patch: "/v1/{backup_schedule.name=projects/*/instances/*/databases/*/backupSchedules/*}" + body: "backup_schedule" + }; + option (google.api.method_signature) = "backup_schedule,update_mask"; + } + + // Deletes a backup schedule. + rpc DeleteBackupSchedule(DeleteBackupScheduleRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/instances/*/databases/*/backupSchedules/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists all the backup schedules for the database. + rpc ListBackupSchedules(ListBackupSchedulesRequest) + returns (ListBackupSchedulesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/instances/*/databases/*}/backupSchedules" + }; + option (google.api.method_signature) = "parent"; + } + + // This is an internal API called by Spanner Graph jobs. You should never need + // to call this API directly. + rpc InternalUpdateGraphOperation(InternalUpdateGraphOperationRequest) + returns (InternalUpdateGraphOperationResponse) { + option (google.api.method_signature) = "database,operation_id"; + } +} + +// Information about the database restore. +message RestoreInfo { + // The type of the restore source. + RestoreSourceType source_type = 1; + + // Information about the source used to restore the database. + oneof source_info { + // Information about the backup used to restore the database. The backup + // may no longer exist. + BackupInfo backup_info = 2; + } +} + +// A Cloud Spanner database. +message Database { + option (google.api.resource) = { + type: "spanner.googleapis.com/Database" + pattern: "projects/{project}/instances/{instance}/databases/{database}" + }; + + // Indicates the current state of the database. + enum State { + // Not specified. + STATE_UNSPECIFIED = 0; + + // The database is still being created. Operations on the database may fail + // with `FAILED_PRECONDITION` in this state. + CREATING = 1; + + // The database is fully created and ready for use. + READY = 2; + + // The database is fully created and ready for use, but is still + // being optimized for performance and cannot handle full load. + // + // In this state, the database still references the backup + // it was restore from, preventing the backup + // from being deleted. When optimizations are complete, the full performance + // of the database will be restored, and the database will transition to + // `READY` state. + READY_OPTIMIZING = 3; + } + + // Required. The name of the database. Values are of the form + // `projects//instances//databases/`, + // where `` is as specified in the `CREATE DATABASE` + // statement. This name can be passed to other API methods to + // identify the database. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Output only. The current database state. + State state = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. If exists, the time at which the database creation started. + google.protobuf.Timestamp create_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Applicable only for restored databases. Contains information + // about the restore source. + RestoreInfo restore_info = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. For databases that are using customer managed encryption, this + // field contains the encryption configuration for the database. + // For databases that are using Google default or other types of encryption, + // this field is empty. + EncryptionConfig encryption_config = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. For databases that are using customer managed encryption, this + // field contains the encryption information for the database, such as + // all Cloud KMS key versions that are in use. The `encryption_status' field + // inside of each `EncryptionInfo` is not populated. + // + // For databases that are using Google default or other types of encryption, + // this field is empty. + // + // This field is propagated lazily from the backend. There might be a delay + // from when a key version is being used and when it appears in this field. + repeated EncryptionInfo encryption_info = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The period in which Cloud Spanner retains all versions of data + // for the database. This is the same as the value of version_retention_period + // database option set using + // [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl]. + // Defaults to 1 hour, if not set. + string version_retention_period = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Earliest timestamp at which older versions of the data can be + // read. This value is continuously updated by Cloud Spanner and becomes stale + // the moment it is queried. If you are using this value to recover data, make + // sure to account for the time from the moment when the value is queried to + // the moment when you initiate the recovery. + google.protobuf.Timestamp earliest_version_time = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The read-write region which contains the database's leader + // replicas. + // + // This is the same as the value of default_leader + // database option set using DatabaseAdmin.CreateDatabase or + // DatabaseAdmin.UpdateDatabaseDdl. If not explicitly set, this is empty. + string default_leader = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The dialect of the Cloud Spanner Database. + DatabaseDialect database_dialect = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Whether drop protection is enabled for this database. Defaults to false, + // if not set. For more details, please see how to [prevent accidental + // database + // deletion](https://cloud.google.com/spanner/docs/prevent-database-deletion). + bool enable_drop_protection = 11; + + // Output only. If true, the database is being updated. If false, there are no + // ongoing update operations for the database. + bool reconciling = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The request for +// [ListDatabases][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabases]. +message ListDatabasesRequest { + // Required. The instance whose databases should be listed. + // Values are of the form `projects//instances/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "spanner.googleapis.com/Instance" + } + ]; + + // Number of databases to be returned in the response. If 0 or less, + // defaults to the server's maximum allowed page size. + int32 page_size = 3; + + // If non-empty, `page_token` should contain a + // [next_page_token][google.spanner.admin.database.v1.ListDatabasesResponse.next_page_token] + // from a previous + // [ListDatabasesResponse][google.spanner.admin.database.v1.ListDatabasesResponse]. + string page_token = 4; +} + +// The response for +// [ListDatabases][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabases]. +message ListDatabasesResponse { + // Databases that matched the request. + repeated Database databases = 1; + + // `next_page_token` can be sent in a subsequent + // [ListDatabases][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabases] + // call to fetch more of the matching databases. + string next_page_token = 2; +} + +// The request for +// [CreateDatabase][google.spanner.admin.database.v1.DatabaseAdmin.CreateDatabase]. +message CreateDatabaseRequest { + // Required. The name of the instance that will serve the new database. + // Values are of the form `projects//instances/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "spanner.googleapis.com/Instance" + } + ]; + + // Required. A `CREATE DATABASE` statement, which specifies the ID of the + // new database. The database ID must conform to the regular expression + // `[a-z][a-z0-9_\-]*[a-z0-9]` and be between 2 and 30 characters in length. + // If the database ID is a reserved word or if it contains a hyphen, the + // database ID must be enclosed in backticks (`` ` ``). + string create_statement = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. A list of DDL statements to run inside the newly created + // database. Statements can create tables, indexes, etc. These + // statements execute atomically with the creation of the database: + // if there is an error in any statement, the database is not created. + repeated string extra_statements = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The encryption configuration for the database. If this field is + // not specified, Cloud Spanner will encrypt/decrypt all data at rest using + // Google default encryption. + EncryptionConfig encryption_config = 4 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The dialect of the Cloud Spanner Database. + DatabaseDialect database_dialect = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Proto descriptors used by CREATE/ALTER PROTO BUNDLE statements in + // 'extra_statements' above. + // Contains a protobuf-serialized + // [google.protobuf.FileDescriptorSet](https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/descriptor.proto). + // To generate it, [install](https://grpc.io/docs/protoc-installation/) and + // run `protoc` with --include_imports and --descriptor_set_out. For example, + // to generate for moon/shot/app.proto, run + // ``` + // $protoc --proto_path=/app_path --proto_path=/lib_path \ + // --include_imports \ + // --descriptor_set_out=descriptors.data \ + // moon/shot/app.proto + // ``` + // For more details, see protobuffer [self + // description](https://developers.google.com/protocol-buffers/docs/techniques#self-description). + bytes proto_descriptors = 6 [(google.api.field_behavior) = OPTIONAL]; +} + +// Metadata type for the operation returned by +// [CreateDatabase][google.spanner.admin.database.v1.DatabaseAdmin.CreateDatabase]. +message CreateDatabaseMetadata { + // The database being created. + string database = 1 [(google.api.resource_reference) = { + type: "spanner.googleapis.com/Database" + }]; +} + +// The request for +// [GetDatabase][google.spanner.admin.database.v1.DatabaseAdmin.GetDatabase]. +message GetDatabaseRequest { + // Required. The name of the requested database. Values are of the form + // `projects//instances//databases/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "spanner.googleapis.com/Database" + } + ]; +} + +// The request for +// [UpdateDatabase][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabase]. +message UpdateDatabaseRequest { + // Required. The database to update. + // The `name` field of the database is of the form + // `projects//instances//databases/`. + Database database = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The list of fields to update. Currently, only + // `enable_drop_protection` field can be updated. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// Metadata type for the operation returned by +// [UpdateDatabase][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabase]. +message UpdateDatabaseMetadata { + // The request for + // [UpdateDatabase][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabase]. + UpdateDatabaseRequest request = 1; + + // The progress of the + // [UpdateDatabase][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabase] + // operation. + OperationProgress progress = 2; + + // The time at which this operation was cancelled. If set, this operation is + // in the process of undoing itself (which is best-effort). + google.protobuf.Timestamp cancel_time = 3; +} + +// Enqueues the given DDL statements to be applied, in order but not +// necessarily all at once, to the database schema at some point (or +// points) in the future. The server checks that the statements +// are executable (syntactically valid, name tables that exist, etc.) +// before enqueueing them, but they may still fail upon +// later execution (e.g., if a statement from another batch of +// statements is applied first and it conflicts in some way, or if +// there is some data-related problem like a `NULL` value in a column to +// which `NOT NULL` would be added). If a statement fails, all +// subsequent statements in the batch are automatically cancelled. +// +// Each batch of statements is assigned a name which can be used with +// the [Operations][google.longrunning.Operations] API to monitor +// progress. See the +// [operation_id][google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.operation_id] +// field for more details. +message UpdateDatabaseDdlRequest { + // Required. The database to update. + string database = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "spanner.googleapis.com/Database" + } + ]; + + // Required. DDL statements to be applied to the database. + repeated string statements = 2 [(google.api.field_behavior) = REQUIRED]; + + // If empty, the new update request is assigned an + // automatically-generated operation ID. Otherwise, `operation_id` + // is used to construct the name of the resulting + // [Operation][google.longrunning.Operation]. + // + // Specifying an explicit operation ID simplifies determining + // whether the statements were executed in the event that the + // [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl] + // call is replayed, or the return value is otherwise lost: the + // [database][google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.database] + // and `operation_id` fields can be combined to form the + // [name][google.longrunning.Operation.name] of the resulting + // [longrunning.Operation][google.longrunning.Operation]: + // `/operations/`. + // + // `operation_id` should be unique within the database, and must be + // a valid identifier: `[a-z][a-z0-9_]*`. Note that + // automatically-generated operation IDs always begin with an + // underscore. If the named operation already exists, + // [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl] + // returns `ALREADY_EXISTS`. + string operation_id = 3; + + // Optional. Proto descriptors used by CREATE/ALTER PROTO BUNDLE statements. + // Contains a protobuf-serialized + // [google.protobuf.FileDescriptorSet](https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/descriptor.proto). + // To generate it, [install](https://grpc.io/docs/protoc-installation/) and + // run `protoc` with --include_imports and --descriptor_set_out. For example, + // to generate for moon/shot/app.proto, run + // ``` + // $protoc --proto_path=/app_path --proto_path=/lib_path \ + // --include_imports \ + // --descriptor_set_out=descriptors.data \ + // moon/shot/app.proto + // ``` + // For more details, see protobuffer [self + // description](https://developers.google.com/protocol-buffers/docs/techniques#self-description). + bytes proto_descriptors = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. This field is exposed to be used by the Spanner Migration Tool. + // For more details, see + // [SMT](https://github.com/GoogleCloudPlatform/spanner-migration-tool). + bool throughput_mode = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Action information extracted from a DDL statement. This proto is used to +// display the brief info of the DDL statement for the operation +// [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl]. +message DdlStatementActionInfo { + // The action for the DDL statement, e.g. CREATE, ALTER, DROP, GRANT, etc. + // This field is a non-empty string. + string action = 1; + + // The entity type for the DDL statement, e.g. TABLE, INDEX, VIEW, etc. + // This field can be empty string for some DDL statement, + // e.g. for statement "ANALYZE", `entity_type` = "". + string entity_type = 2; + + // The entity name(s) being operated on the DDL statement. + // E.g. + // 1. For statement "CREATE TABLE t1(...)", `entity_names` = ["t1"]. + // 2. For statement "GRANT ROLE r1, r2 ...", `entity_names` = ["r1", "r2"]. + // 3. For statement "ANALYZE", `entity_names` = []. + repeated string entity_names = 3; +} + +// Metadata type for the operation returned by +// [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl]. +message UpdateDatabaseDdlMetadata { + // The database being modified. + string database = 1 [(google.api.resource_reference) = { + type: "spanner.googleapis.com/Database" + }]; + + // For an update this list contains all the statements. For an + // individual statement, this list contains only that statement. + repeated string statements = 2; + + // Reports the commit timestamps of all statements that have + // succeeded so far, where `commit_timestamps[i]` is the commit + // timestamp for the statement `statements[i]`. + repeated google.protobuf.Timestamp commit_timestamps = 3; + + // Output only. When true, indicates that the operation is throttled e.g. + // due to resource constraints. When resources become available the operation + // will resume and this field will be false again. + bool throttled = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The progress of the + // [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl] + // operations. All DDL statements will have continuously updating progress, + // and `progress[i]` is the operation progress for `statements[i]`. Also, + // `progress[i]` will have start time and end time populated with commit + // timestamp of operation, as well as a progress of 100% once the operation + // has completed. + repeated OperationProgress progress = 5; + + // The brief action info for the DDL statements. + // `actions[i]` is the brief info for `statements[i]`. + repeated DdlStatementActionInfo actions = 6; +} + +// The request for +// [DropDatabase][google.spanner.admin.database.v1.DatabaseAdmin.DropDatabase]. +message DropDatabaseRequest { + // Required. The database to be dropped. + string database = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "spanner.googleapis.com/Database" + } + ]; +} + +// The request for +// [GetDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.GetDatabaseDdl]. +message GetDatabaseDdlRequest { + // Required. The database whose schema we wish to get. + // Values are of the form + // `projects//instances//databases/` + string database = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "spanner.googleapis.com/Database" + } + ]; +} + +// The response for +// [GetDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.GetDatabaseDdl]. +message GetDatabaseDdlResponse { + // A list of formatted DDL statements defining the schema of the database + // specified in the request. + repeated string statements = 1; + + // Proto descriptors stored in the database. + // Contains a protobuf-serialized + // [google.protobuf.FileDescriptorSet](https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/descriptor.proto). + // For more details, see protobuffer [self + // description](https://developers.google.com/protocol-buffers/docs/techniques#self-description). + bytes proto_descriptors = 2; +} + +// The request for +// [ListDatabaseOperations][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabaseOperations]. +message ListDatabaseOperationsRequest { + // Required. The instance of the database operations. + // Values are of the form `projects//instances/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "spanner.googleapis.com/Instance" + } + ]; + + // An expression that filters the list of returned operations. + // + // A filter expression consists of a field name, a + // comparison operator, and a value for filtering. + // The value must be a string, a number, or a boolean. The comparison operator + // must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. + // Colon `:` is the contains operator. Filter rules are not case sensitive. + // + // The following fields in the [Operation][google.longrunning.Operation] + // are eligible for filtering: + // + // * `name` - The name of the long-running operation + // * `done` - False if the operation is in progress, else true. + // * `metadata.@type` - the type of metadata. For example, the type string + // for + // [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata] + // is + // `type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata`. + // * `metadata.` - any field in metadata.value. + // `metadata.@type` must be specified first, if filtering on metadata + // fields. + // * `error` - Error associated with the long-running operation. + // * `response.@type` - the type of response. + // * `response.` - any field in response.value. + // + // You can combine multiple expressions by enclosing each expression in + // parentheses. By default, expressions are combined with AND logic. However, + // you can specify AND, OR, and NOT logic explicitly. + // + // Here are a few examples: + // + // * `done:true` - The operation is complete. + // * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata) AND` \ + // `(metadata.source_type:BACKUP) AND` \ + // `(metadata.backup_info.backup:backup_howl) AND` \ + // `(metadata.name:restored_howl) AND` \ + // `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \ + // `(error:*)` - Return operations where: + // * The operation's metadata type is + // [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata]. + // * The database is restored from a backup. + // * The backup name contains "backup_howl". + // * The restored database's name contains "restored_howl". + // * The operation started before 2018-03-28T14:50:00Z. + // * The operation resulted in an error. + string filter = 2; + + // Number of operations to be returned in the response. If 0 or + // less, defaults to the server's maximum allowed page size. + int32 page_size = 3; + + // If non-empty, `page_token` should contain a + // [next_page_token][google.spanner.admin.database.v1.ListDatabaseOperationsResponse.next_page_token] + // from a previous + // [ListDatabaseOperationsResponse][google.spanner.admin.database.v1.ListDatabaseOperationsResponse] + // to the same `parent` and with the same `filter`. + string page_token = 4; +} + +// The response for +// [ListDatabaseOperations][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabaseOperations]. +message ListDatabaseOperationsResponse { + // The list of matching database [long-running + // operations][google.longrunning.Operation]. Each operation's name will be + // prefixed by the database's name. The operation's + // [metadata][google.longrunning.Operation.metadata] field type + // `metadata.type_url` describes the type of the metadata. + repeated google.longrunning.Operation operations = 1; + + // `next_page_token` can be sent in a subsequent + // [ListDatabaseOperations][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabaseOperations] + // call to fetch more of the matching metadata. + string next_page_token = 2; +} + +// The request for +// [RestoreDatabase][google.spanner.admin.database.v1.DatabaseAdmin.RestoreDatabase]. +message RestoreDatabaseRequest { + // Required. The name of the instance in which to create the + // restored database. This instance must be in the same project and + // have the same instance configuration as the instance containing + // the source backup. Values are of the form + // `projects//instances/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "spanner.googleapis.com/Instance" + } + ]; + + // Required. The id of the database to create and restore to. This + // database must not already exist. The `database_id` appended to + // `parent` forms the full database name of the form + // `projects//instances//databases/`. + string database_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The source from which to restore. + oneof source { + // Name of the backup from which to restore. Values are of the form + // `projects//instances//backups/`. + string backup = 3 [(google.api.resource_reference) = { + type: "spanner.googleapis.com/Backup" + }]; + } + + // Optional. An encryption configuration describing the encryption type and + // key resources in Cloud KMS used to encrypt/decrypt the database to restore + // to. If this field is not specified, the restored database will use the same + // encryption configuration as the backup by default, namely + // [encryption_type][google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.encryption_type] + // = `USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION`. + RestoreDatabaseEncryptionConfig encryption_config = 4 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Encryption configuration for the restored database. +message RestoreDatabaseEncryptionConfig { + // Encryption types for the database to be restored. + enum EncryptionType { + // Unspecified. Do not use. + ENCRYPTION_TYPE_UNSPECIFIED = 0; + + // This is the default option when + // [encryption_config][google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig] + // is not specified. + USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION = 1; + + // Use Google default encryption. + GOOGLE_DEFAULT_ENCRYPTION = 2; + + // Use customer managed encryption. If specified, `kms_key_name` must + // must contain a valid Cloud KMS key. + CUSTOMER_MANAGED_ENCRYPTION = 3; + } + + // Required. The encryption type of the restored database. + EncryptionType encryption_type = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The Cloud KMS key that will be used to encrypt/decrypt the + // restored database. This field should be set only when + // [encryption_type][google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.encryption_type] + // is `CUSTOMER_MANAGED_ENCRYPTION`. Values are of the form + // `projects//locations//keyRings//cryptoKeys/`. + string kms_key_name = 2 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "cloudkms.googleapis.com/CryptoKey" + } + ]; + + // Optional. Specifies the KMS configuration for the one or more keys used to + // encrypt the database. Values are of the form + // `projects//locations//keyRings//cryptoKeys/`. + // + // The keys referenced by kms_key_names must fully cover all + // regions of the database instance configuration. Some examples: + // * For single region database instance configs, specify a single regional + // location KMS key. + // * For multi-regional database instance configs of type GOOGLE_MANAGED, + // either specify a multi-regional location KMS key or multiple regional + // location KMS keys that cover all regions in the instance config. + // * For a database instance config of type USER_MANAGED, please specify only + // regional location KMS keys to cover each region in the instance config. + // Multi-regional location KMS keys are not supported for USER_MANAGED + // instance configs. + repeated string kms_key_names = 3 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "cloudkms.googleapis.com/CryptoKey" + } + ]; +} + +// Metadata type for the long-running operation returned by +// [RestoreDatabase][google.spanner.admin.database.v1.DatabaseAdmin.RestoreDatabase]. +message RestoreDatabaseMetadata { + // Name of the database being created and restored to. + string name = 1 [(google.api.resource_reference) = { + type: "spanner.googleapis.com/Database" + }]; + + // The type of the restore source. + RestoreSourceType source_type = 2; + + // Information about the source used to restore the database, as specified by + // `source` in + // [RestoreDatabaseRequest][google.spanner.admin.database.v1.RestoreDatabaseRequest]. + oneof source_info { + // Information about the backup used to restore the database. + BackupInfo backup_info = 3; + } + + // The progress of the + // [RestoreDatabase][google.spanner.admin.database.v1.DatabaseAdmin.RestoreDatabase] + // operation. + OperationProgress progress = 4; + + // The time at which cancellation of this operation was received. + // [Operations.CancelOperation][google.longrunning.Operations.CancelOperation] + // starts asynchronous cancellation on a long-running operation. The server + // makes a best effort to cancel the operation, but success is not guaranteed. + // Clients can use + // [Operations.GetOperation][google.longrunning.Operations.GetOperation] or + // other methods to check whether the cancellation succeeded or whether the + // operation completed despite cancellation. On successful cancellation, + // the operation is not deleted; instead, it becomes an operation with + // an [Operation.error][google.longrunning.Operation.error] value with a + // [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + // `Code.CANCELLED`. + google.protobuf.Timestamp cancel_time = 5; + + // If exists, the name of the long-running operation that will be used to + // track the post-restore optimization process to optimize the performance of + // the restored database, and remove the dependency on the restore source. + // The name is of the form + // `projects//instances//databases//operations/` + // where the is the name of database being created and restored to. + // The metadata type of the long-running operation is + // [OptimizeRestoredDatabaseMetadata][google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata]. + // This long-running operation will be automatically created by the system + // after the RestoreDatabase long-running operation completes successfully. + // This operation will not be created if the restore was not successful. + string optimize_database_operation_name = 6; +} + +// Metadata type for the long-running operation used to track the progress +// of optimizations performed on a newly restored database. This long-running +// operation is automatically created by the system after the successful +// completion of a database restore, and cannot be cancelled. +message OptimizeRestoredDatabaseMetadata { + // Name of the restored database being optimized. + string name = 1 [(google.api.resource_reference) = { + type: "spanner.googleapis.com/Database" + }]; + + // The progress of the post-restore optimizations. + OperationProgress progress = 2; +} + +// Indicates the type of the restore source. +enum RestoreSourceType { + // No restore associated. + TYPE_UNSPECIFIED = 0; + + // A backup was used as the source of the restore. + BACKUP = 1; +} + +// A Cloud Spanner database role. +message DatabaseRole { + option (google.api.resource) = { + type: "spanner.googleapis.com/DatabaseRole" + pattern: "projects/{project}/instances/{instance}/databases/{database}/databaseRoles/{role}" + }; + + // Required. The name of the database role. Values are of the form + // `projects//instances//databases//databaseRoles/` + // where `` is as specified in the `CREATE ROLE` DDL statement. + string name = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// The request for +// [ListDatabaseRoles][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabaseRoles]. +message ListDatabaseRolesRequest { + // Required. The database whose roles should be listed. + // Values are of the form + // `projects//instances//databases/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "spanner.googleapis.com/Database" + } + ]; + + // Number of database roles to be returned in the response. If 0 or less, + // defaults to the server's maximum allowed page size. + int32 page_size = 2; + + // If non-empty, `page_token` should contain a + // [next_page_token][google.spanner.admin.database.v1.ListDatabaseRolesResponse.next_page_token] + // from a previous + // [ListDatabaseRolesResponse][google.spanner.admin.database.v1.ListDatabaseRolesResponse]. + string page_token = 3; +} + +// The response for +// [ListDatabaseRoles][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabaseRoles]. +message ListDatabaseRolesResponse { + // Database roles that matched the request. + repeated DatabaseRole database_roles = 1; + + // `next_page_token` can be sent in a subsequent + // [ListDatabaseRoles][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabaseRoles] + // call to fetch more of the matching roles. + string next_page_token = 2; +} + +// The request for +// [AddSplitPoints][google.spanner.admin.database.v1.DatabaseAdmin.AddSplitPoints]. +message AddSplitPointsRequest { + // Required. The database on whose tables/indexes split points are to be + // added. Values are of the form + // `projects//instances//databases/`. + string database = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "spanner.googleapis.com/Database" + } + ]; + + // Required. The split points to add. + repeated SplitPoints split_points = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. A user-supplied tag associated with the split points. + // For example, "intital_data_load", "special_event_1". + // Defaults to "CloudAddSplitPointsAPI" if not specified. + // The length of the tag must not exceed 50 characters,else will be trimmed. + // Only valid UTF8 characters are allowed. + string initiator = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// The response for +// [AddSplitPoints][google.spanner.admin.database.v1.DatabaseAdmin.AddSplitPoints]. +message AddSplitPointsResponse {} + +// The split points of a table/index. +message SplitPoints { + // A split key. + message Key { + // Required. The column values making up the split key. + google.protobuf.ListValue key_parts = 1 + [(google.api.field_behavior) = REQUIRED]; + } + + // The table to split. + string table = 1; + + // The index to split. + // If specified, the `table` field must refer to the index's base table. + string index = 2; + + // Required. The list of split keys, i.e., the split boundaries. + repeated Key keys = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The expiration timestamp of the split points. + // A timestamp in the past means immediate expiration. + // The maximum value can be 30 days in the future. + // Defaults to 10 days in the future if not specified. + google.protobuf.Timestamp expire_time = 5 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Internal request proto, do not use directly. +message InternalUpdateGraphOperationRequest { + // Internal field, do not use directly. + string database = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "spanner.googleapis.com/Database" + } + ]; + // Internal field, do not use directly. + string operation_id = 2 [(google.api.field_behavior) = REQUIRED]; + // Internal field, do not use directly. + string vm_identity_token = 5 [(google.api.field_behavior) = REQUIRED]; + // Internal field, do not use directly. + double progress = 3 [(google.api.field_behavior) = OPTIONAL]; + // Internal field, do not use directly. + google.rpc.Status status = 6 [(google.api.field_behavior) = OPTIONAL]; +} + +// Internal response proto, do not use directly. +message InternalUpdateGraphOperationResponse {} diff --git a/owl-bot-staging/executor/v1/protos/google/spanner/admin/instance/v1/common.proto b/owl-bot-staging/executor/v1/protos/google/spanner/admin/instance/v1/common.proto new file mode 100644 index 000000000..0b5282c7d --- /dev/null +++ b/owl-bot-staging/executor/v1/protos/google/spanner/admin/instance/v1/common.proto @@ -0,0 +1,64 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.spanner.admin.instance.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Spanner.Admin.Instance.V1"; +option go_package = "cloud.google.com/go/spanner/admin/instance/apiv1/instancepb;instancepb"; +option java_multiple_files = true; +option java_outer_classname = "CommonProto"; +option java_package = "com.google.spanner.admin.instance.v1"; +option php_namespace = "Google\\Cloud\\Spanner\\Admin\\Instance\\V1"; +option ruby_package = "Google::Cloud::Spanner::Admin::Instance::V1"; + +// Encapsulates progress related information for a Cloud Spanner long +// running instance operations. +message OperationProgress { + // Percent completion of the operation. + // Values are between 0 and 100 inclusive. + int32 progress_percent = 1; + + // Time the request was received. + google.protobuf.Timestamp start_time = 2; + + // If set, the time at which this operation failed or was completed + // successfully. + google.protobuf.Timestamp end_time = 3; +} + +// Indicates the expected fulfillment period of an operation. +enum FulfillmentPeriod { + // Not specified. + FULFILLMENT_PERIOD_UNSPECIFIED = 0; + + // Normal fulfillment period. The operation is expected to complete within + // minutes. + FULFILLMENT_PERIOD_NORMAL = 1; + + // Extended fulfillment period. It can take up to an hour for the operation + // to complete. + FULFILLMENT_PERIOD_EXTENDED = 2; +} + +// ReplicaSelection identifies replicas with common properties. +message ReplicaSelection { + // Required. Name of the location of the replicas (e.g., "us-central1"). + string location = 1 [(google.api.field_behavior) = REQUIRED]; +} diff --git a/owl-bot-staging/executor/v1/protos/google/spanner/admin/instance/v1/spanner_instance_admin.proto b/owl-bot-staging/executor/v1/protos/google/spanner/admin/instance/v1/spanner_instance_admin.proto new file mode 100644 index 000000000..d16ab2ca5 --- /dev/null +++ b/owl-bot-staging/executor/v1/protos/google/spanner/admin/instance/v1/spanner_instance_admin.proto @@ -0,0 +1,2184 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.spanner.admin.instance.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/iam/v1/iam_policy.proto"; +import "google/iam/v1/policy.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; +import "google/spanner/admin/instance/v1/common.proto"; + +option csharp_namespace = "Google.Cloud.Spanner.Admin.Instance.V1"; +option go_package = "cloud.google.com/go/spanner/admin/instance/apiv1/instancepb;instancepb"; +option java_multiple_files = true; +option java_outer_classname = "SpannerInstanceAdminProto"; +option java_package = "com.google.spanner.admin.instance.v1"; +option php_namespace = "Google\\Cloud\\Spanner\\Admin\\Instance\\V1"; +option ruby_package = "Google::Cloud::Spanner::Admin::Instance::V1"; + +// Cloud Spanner Instance Admin API +// +// The Cloud Spanner Instance Admin API can be used to create, delete, +// modify and list instances. Instances are dedicated Cloud Spanner serving +// and storage resources to be used by Cloud Spanner databases. +// +// Each instance has a "configuration", which dictates where the +// serving resources for the Cloud Spanner instance are located (e.g., +// US-central, Europe). Configurations are created by Google based on +// resource availability. +// +// Cloud Spanner billing is based on the instances that exist and their +// sizes. After an instance exists, there are no additional +// per-database or per-operation charges for use of the instance +// (though there may be additional network bandwidth charges). +// Instances offer isolation: problems with databases in one instance +// will not affect other instances. However, within an instance +// databases can affect each other. For example, if one database in an +// instance receives a lot of requests and consumes most of the +// instance resources, fewer resources are available for other +// databases in that instance, and their performance may suffer. +service InstanceAdmin { + option (google.api.default_host) = "spanner.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/spanner.admin"; + + // Lists the supported instance configurations for a given project. + // + // Returns both Google-managed configurations and user-managed + // configurations. + rpc ListInstanceConfigs(ListInstanceConfigsRequest) + returns (ListInstanceConfigsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*}/instanceConfigs" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets information about a particular instance configuration. + rpc GetInstanceConfig(GetInstanceConfigRequest) returns (InstanceConfig) { + option (google.api.http) = { + get: "/v1/{name=projects/*/instanceConfigs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates an instance configuration and begins preparing it to be used. The + // returned long-running operation + // can be used to track the progress of preparing the new + // instance configuration. The instance configuration name is assigned by the + // caller. If the named instance configuration already exists, + // `CreateInstanceConfig` returns `ALREADY_EXISTS`. + // + // Immediately after the request returns: + // + // * The instance configuration is readable via the API, with all requested + // attributes. The instance configuration's + // [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling] + // field is set to true. Its state is `CREATING`. + // + // While the operation is pending: + // + // * Cancelling the operation renders the instance configuration immediately + // unreadable via the API. + // * Except for deleting the creating resource, all other attempts to modify + // the instance configuration are rejected. + // + // Upon completion of the returned operation: + // + // * Instances can be created using the instance configuration. + // * The instance configuration's + // [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling] + // field becomes false. Its state becomes `READY`. + // + // The returned long-running operation will + // have a name of the format + // `/operations/` and can be used to track + // creation of the instance configuration. The + // metadata field type is + // [CreateInstanceConfigMetadata][google.spanner.admin.instance.v1.CreateInstanceConfigMetadata]. + // The response field type is + // [InstanceConfig][google.spanner.admin.instance.v1.InstanceConfig], if + // successful. + // + // Authorization requires `spanner.instanceConfigs.create` permission on + // the resource + // [parent][google.spanner.admin.instance.v1.CreateInstanceConfigRequest.parent]. + rpc CreateInstanceConfig(CreateInstanceConfigRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*}/instanceConfigs" + body: "*" + }; + option (google.api.method_signature) = + "parent,instance_config,instance_config_id"; + option (google.longrunning.operation_info) = { + response_type: "google.spanner.admin.instance.v1.InstanceConfig" + metadata_type: "google.spanner.admin.instance.v1.CreateInstanceConfigMetadata" + }; + } + + // Updates an instance configuration. The returned + // long-running operation can be used to track + // the progress of updating the instance. If the named instance configuration + // does not exist, returns `NOT_FOUND`. + // + // Only user-managed configurations can be updated. + // + // Immediately after the request returns: + // + // * The instance configuration's + // [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling] + // field is set to true. + // + // While the operation is pending: + // + // * Cancelling the operation sets its metadata's + // [cancel_time][google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata.cancel_time]. + // The operation is guaranteed to succeed at undoing all changes, after + // which point it terminates with a `CANCELLED` status. + // * All other attempts to modify the instance configuration are rejected. + // * Reading the instance configuration via the API continues to give the + // pre-request values. + // + // Upon completion of the returned operation: + // + // * Creating instances using the instance configuration uses the new + // values. + // * The new values of the instance configuration are readable via the API. + // * The instance configuration's + // [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling] + // field becomes false. + // + // The returned long-running operation will + // have a name of the format + // `/operations/` and can be used to track + // the instance configuration modification. The + // metadata field type is + // [UpdateInstanceConfigMetadata][google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata]. + // The response field type is + // [InstanceConfig][google.spanner.admin.instance.v1.InstanceConfig], if + // successful. + // + // Authorization requires `spanner.instanceConfigs.update` permission on + // the resource [name][google.spanner.admin.instance.v1.InstanceConfig.name]. + rpc UpdateInstanceConfig(UpdateInstanceConfigRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{instance_config.name=projects/*/instanceConfigs/*}" + body: "*" + }; + option (google.api.method_signature) = "instance_config,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "google.spanner.admin.instance.v1.InstanceConfig" + metadata_type: "google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata" + }; + } + + // Deletes the instance configuration. Deletion is only allowed when no + // instances are using the configuration. If any instances are using + // the configuration, returns `FAILED_PRECONDITION`. + // + // Only user-managed configurations can be deleted. + // + // Authorization requires `spanner.instanceConfigs.delete` permission on + // the resource [name][google.spanner.admin.instance.v1.InstanceConfig.name]. + rpc DeleteInstanceConfig(DeleteInstanceConfigRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/instanceConfigs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists the user-managed instance configuration long-running + // operations in the given project. An instance + // configuration operation has a name of the form + // `projects//instanceConfigs//operations/`. + // The long-running operation + // metadata field type + // `metadata.type_url` describes the type of the metadata. Operations returned + // include those that have completed/failed/canceled within the last 7 days, + // and pending operations. Operations returned are ordered by + // `operation.metadata.value.start_time` in descending order starting + // from the most recently started operation. + rpc ListInstanceConfigOperations(ListInstanceConfigOperationsRequest) + returns (ListInstanceConfigOperationsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*}/instanceConfigOperations" + }; + option (google.api.method_signature) = "parent"; + } + + // Lists all instances in the given project. + rpc ListInstances(ListInstancesRequest) returns (ListInstancesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*}/instances" + }; + option (google.api.method_signature) = "parent"; + } + + // Lists all instance partitions for the given instance. + rpc ListInstancePartitions(ListInstancePartitionsRequest) + returns (ListInstancePartitionsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/instances/*}/instancePartitions" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets information about a particular instance. + rpc GetInstance(GetInstanceRequest) returns (Instance) { + option (google.api.http) = { + get: "/v1/{name=projects/*/instances/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates an instance and begins preparing it to begin serving. The + // returned long-running operation + // can be used to track the progress of preparing the new + // instance. The instance name is assigned by the caller. If the + // named instance already exists, `CreateInstance` returns + // `ALREADY_EXISTS`. + // + // Immediately upon completion of this request: + // + // * The instance is readable via the API, with all requested attributes + // but no allocated resources. Its state is `CREATING`. + // + // Until completion of the returned operation: + // + // * Cancelling the operation renders the instance immediately unreadable + // via the API. + // * The instance can be deleted. + // * All other attempts to modify the instance are rejected. + // + // Upon completion of the returned operation: + // + // * Billing for all successfully-allocated resources begins (some types + // may have lower than the requested levels). + // * Databases can be created in the instance. + // * The instance's allocated resource levels are readable via the API. + // * The instance's state becomes `READY`. + // + // The returned long-running operation will + // have a name of the format `/operations/` and + // can be used to track creation of the instance. The + // metadata field type is + // [CreateInstanceMetadata][google.spanner.admin.instance.v1.CreateInstanceMetadata]. + // The response field type is + // [Instance][google.spanner.admin.instance.v1.Instance], if successful. + rpc CreateInstance(CreateInstanceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*}/instances" + body: "*" + }; + option (google.api.method_signature) = "parent,instance_id,instance"; + option (google.longrunning.operation_info) = { + response_type: "google.spanner.admin.instance.v1.Instance" + metadata_type: "google.spanner.admin.instance.v1.CreateInstanceMetadata" + }; + } + + // Updates an instance, and begins allocating or releasing resources + // as requested. The returned long-running operation can be used to track the + // progress of updating the instance. If the named instance does not + // exist, returns `NOT_FOUND`. + // + // Immediately upon completion of this request: + // + // * For resource types for which a decrease in the instance's allocation + // has been requested, billing is based on the newly-requested level. + // + // Until completion of the returned operation: + // + // * Cancelling the operation sets its metadata's + // [cancel_time][google.spanner.admin.instance.v1.UpdateInstanceMetadata.cancel_time], + // and begins restoring resources to their pre-request values. The + // operation is guaranteed to succeed at undoing all resource changes, + // after which point it terminates with a `CANCELLED` status. + // * All other attempts to modify the instance are rejected. + // * Reading the instance via the API continues to give the pre-request + // resource levels. + // + // Upon completion of the returned operation: + // + // * Billing begins for all successfully-allocated resources (some types + // may have lower than the requested levels). + // * All newly-reserved resources are available for serving the instance's + // tables. + // * The instance's new resource levels are readable via the API. + // + // The returned long-running operation will + // have a name of the format `/operations/` and + // can be used to track the instance modification. The + // metadata field type is + // [UpdateInstanceMetadata][google.spanner.admin.instance.v1.UpdateInstanceMetadata]. + // The response field type is + // [Instance][google.spanner.admin.instance.v1.Instance], if successful. + // + // Authorization requires `spanner.instances.update` permission on + // the resource [name][google.spanner.admin.instance.v1.Instance.name]. + rpc UpdateInstance(UpdateInstanceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{instance.name=projects/*/instances/*}" + body: "*" + }; + option (google.api.method_signature) = "instance,field_mask"; + option (google.longrunning.operation_info) = { + response_type: "google.spanner.admin.instance.v1.Instance" + metadata_type: "google.spanner.admin.instance.v1.UpdateInstanceMetadata" + }; + } + + // Deletes an instance. + // + // Immediately upon completion of the request: + // + // * Billing ceases for all of the instance's reserved resources. + // + // Soon afterward: + // + // * The instance and *all of its databases* immediately and + // irrevocably disappear from the API. All data in the databases + // is permanently deleted. + rpc DeleteInstance(DeleteInstanceRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/instances/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Sets the access control policy on an instance resource. Replaces any + // existing policy. + // + // Authorization requires `spanner.instances.setIamPolicy` on + // [resource][google.iam.v1.SetIamPolicyRequest.resource]. + rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) + returns (google.iam.v1.Policy) { + option (google.api.http) = { + post: "/v1/{resource=projects/*/instances/*}:setIamPolicy" + body: "*" + }; + option (google.api.method_signature) = "resource,policy"; + } + + // Gets the access control policy for an instance resource. Returns an empty + // policy if an instance exists but does not have a policy set. + // + // Authorization requires `spanner.instances.getIamPolicy` on + // [resource][google.iam.v1.GetIamPolicyRequest.resource]. + rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) + returns (google.iam.v1.Policy) { + option (google.api.http) = { + post: "/v1/{resource=projects/*/instances/*}:getIamPolicy" + body: "*" + }; + option (google.api.method_signature) = "resource"; + } + + // Returns permissions that the caller has on the specified instance resource. + // + // Attempting this RPC on a non-existent Cloud Spanner instance resource will + // result in a NOT_FOUND error if the user has `spanner.instances.list` + // permission on the containing Google Cloud Project. Otherwise returns an + // empty set of permissions. + rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) + returns (google.iam.v1.TestIamPermissionsResponse) { + option (google.api.http) = { + post: "/v1/{resource=projects/*/instances/*}:testIamPermissions" + body: "*" + }; + option (google.api.method_signature) = "resource,permissions"; + } + + // Gets information about a particular instance partition. + rpc GetInstancePartition(GetInstancePartitionRequest) + returns (InstancePartition) { + option (google.api.http) = { + get: "/v1/{name=projects/*/instances/*/instancePartitions/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates an instance partition and begins preparing it to be used. The + // returned long-running operation + // can be used to track the progress of preparing the new instance partition. + // The instance partition name is assigned by the caller. If the named + // instance partition already exists, `CreateInstancePartition` returns + // `ALREADY_EXISTS`. + // + // Immediately upon completion of this request: + // + // * The instance partition is readable via the API, with all requested + // attributes but no allocated resources. Its state is `CREATING`. + // + // Until completion of the returned operation: + // + // * Cancelling the operation renders the instance partition immediately + // unreadable via the API. + // * The instance partition can be deleted. + // * All other attempts to modify the instance partition are rejected. + // + // Upon completion of the returned operation: + // + // * Billing for all successfully-allocated resources begins (some types + // may have lower than the requested levels). + // * Databases can start using this instance partition. + // * The instance partition's allocated resource levels are readable via the + // API. + // * The instance partition's state becomes `READY`. + // + // The returned long-running operation will + // have a name of the format + // `/operations/` and can be used to + // track creation of the instance partition. The + // metadata field type is + // [CreateInstancePartitionMetadata][google.spanner.admin.instance.v1.CreateInstancePartitionMetadata]. + // The response field type is + // [InstancePartition][google.spanner.admin.instance.v1.InstancePartition], if + // successful. + rpc CreateInstancePartition(CreateInstancePartitionRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/instances/*}/instancePartitions" + body: "*" + }; + option (google.api.method_signature) = + "parent,instance_partition,instance_partition_id"; + option (google.longrunning.operation_info) = { + response_type: "google.spanner.admin.instance.v1.InstancePartition" + metadata_type: "google.spanner.admin.instance.v1.CreateInstancePartitionMetadata" + }; + } + + // Deletes an existing instance partition. Requires that the + // instance partition is not used by any database or backup and is not the + // default instance partition of an instance. + // + // Authorization requires `spanner.instancePartitions.delete` permission on + // the resource + // [name][google.spanner.admin.instance.v1.InstancePartition.name]. + rpc DeleteInstancePartition(DeleteInstancePartitionRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/instances/*/instancePartitions/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates an instance partition, and begins allocating or releasing resources + // as requested. The returned long-running operation can be used to track the + // progress of updating the instance partition. If the named instance + // partition does not exist, returns `NOT_FOUND`. + // + // Immediately upon completion of this request: + // + // * For resource types for which a decrease in the instance partition's + // allocation has been requested, billing is based on the newly-requested + // level. + // + // Until completion of the returned operation: + // + // * Cancelling the operation sets its metadata's + // [cancel_time][google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata.cancel_time], + // and begins restoring resources to their pre-request values. The + // operation is guaranteed to succeed at undoing all resource changes, + // after which point it terminates with a `CANCELLED` status. + // * All other attempts to modify the instance partition are rejected. + // * Reading the instance partition via the API continues to give the + // pre-request resource levels. + // + // Upon completion of the returned operation: + // + // * Billing begins for all successfully-allocated resources (some types + // may have lower than the requested levels). + // * All newly-reserved resources are available for serving the instance + // partition's tables. + // * The instance partition's new resource levels are readable via the API. + // + // The returned long-running operation will + // have a name of the format + // `/operations/` and can be used to + // track the instance partition modification. The + // metadata field type is + // [UpdateInstancePartitionMetadata][google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata]. + // The response field type is + // [InstancePartition][google.spanner.admin.instance.v1.InstancePartition], if + // successful. + // + // Authorization requires `spanner.instancePartitions.update` permission on + // the resource + // [name][google.spanner.admin.instance.v1.InstancePartition.name]. + rpc UpdateInstancePartition(UpdateInstancePartitionRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{instance_partition.name=projects/*/instances/*/instancePartitions/*}" + body: "*" + }; + option (google.api.method_signature) = "instance_partition,field_mask"; + option (google.longrunning.operation_info) = { + response_type: "google.spanner.admin.instance.v1.InstancePartition" + metadata_type: "google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata" + }; + } + + // Lists instance partition long-running operations in the given instance. + // An instance partition operation has a name of the form + // `projects//instances//instancePartitions//operations/`. + // The long-running operation + // metadata field type + // `metadata.type_url` describes the type of the metadata. Operations returned + // include those that have completed/failed/canceled within the last 7 days, + // and pending operations. Operations returned are ordered by + // `operation.metadata.value.start_time` in descending order starting from the + // most recently started operation. + // + // Authorization requires `spanner.instancePartitionOperations.list` + // permission on the resource + // [parent][google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest.parent]. + rpc ListInstancePartitionOperations(ListInstancePartitionOperationsRequest) + returns (ListInstancePartitionOperationsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/instances/*}/instancePartitionOperations" + }; + option (google.api.method_signature) = "parent"; + } + + // Moves an instance to the target instance configuration. You can use the + // returned long-running operation to track + // the progress of moving the instance. + // + // `MoveInstance` returns `FAILED_PRECONDITION` if the instance meets any of + // the following criteria: + // + // * Is undergoing a move to a different instance configuration + // * Has backups + // * Has an ongoing update + // * Contains any CMEK-enabled databases + // * Is a free trial instance + // + // While the operation is pending: + // + // * All other attempts to modify the instance, including changes to its + // compute capacity, are rejected. + // * The following database and backup admin operations are rejected: + // + // * `DatabaseAdmin.CreateDatabase` + // * `DatabaseAdmin.UpdateDatabaseDdl` (disabled if default_leader is + // specified in the request.) + // * `DatabaseAdmin.RestoreDatabase` + // * `DatabaseAdmin.CreateBackup` + // * `DatabaseAdmin.CopyBackup` + // + // * Both the source and target instance configurations are subject to + // hourly compute and storage charges. + // * The instance might experience higher read-write latencies and a higher + // transaction abort rate. However, moving an instance doesn't cause any + // downtime. + // + // The returned long-running operation has + // a name of the format + // `/operations/` and can be used to track + // the move instance operation. The + // metadata field type is + // [MoveInstanceMetadata][google.spanner.admin.instance.v1.MoveInstanceMetadata]. + // The response field type is + // [Instance][google.spanner.admin.instance.v1.Instance], + // if successful. + // Cancelling the operation sets its metadata's + // [cancel_time][google.spanner.admin.instance.v1.MoveInstanceMetadata.cancel_time]. + // Cancellation is not immediate because it involves moving any data + // previously moved to the target instance configuration back to the original + // instance configuration. You can use this operation to track the progress of + // the cancellation. Upon successful completion of the cancellation, the + // operation terminates with `CANCELLED` status. + // + // If not cancelled, upon completion of the returned operation: + // + // * The instance successfully moves to the target instance + // configuration. + // * You are billed for compute and storage in target instance + // configuration. + // + // Authorization requires the `spanner.instances.update` permission on + // the resource [instance][google.spanner.admin.instance.v1.Instance]. + // + // For more details, see + // [Move an instance](https://cloud.google.com/spanner/docs/move-instance). + rpc MoveInstance(MoveInstanceRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/instances/*}:move" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "google.spanner.admin.instance.v1.MoveInstanceResponse" + metadata_type: "google.spanner.admin.instance.v1.MoveInstanceMetadata" + }; + } +} + +message ReplicaInfo { + // Indicates the type of replica. See the [replica types + // documentation](https://cloud.google.com/spanner/docs/replication#replica_types) + // for more details. + enum ReplicaType { + // Not specified. + TYPE_UNSPECIFIED = 0; + + // Read-write replicas support both reads and writes. These replicas: + // + // * Maintain a full copy of your data. + // * Serve reads. + // * Can vote whether to commit a write. + // * Participate in leadership election. + // * Are eligible to become a leader. + READ_WRITE = 1; + + // Read-only replicas only support reads (not writes). Read-only replicas: + // + // * Maintain a full copy of your data. + // * Serve reads. + // * Do not participate in voting to commit writes. + // * Are not eligible to become a leader. + READ_ONLY = 2; + + // Witness replicas don't support reads but do participate in voting to + // commit writes. Witness replicas: + // + // * Do not maintain a full copy of data. + // * Do not serve reads. + // * Vote whether to commit writes. + // * Participate in leader election but are not eligible to become leader. + WITNESS = 3; + } + + // The location of the serving resources, e.g., "us-central1". + string location = 1; + + // The type of replica. + ReplicaType type = 2; + + // If true, this location is designated as the default leader location where + // leader replicas are placed. See the [region types + // documentation](https://cloud.google.com/spanner/docs/instances#region_types) + // for more details. + bool default_leader_location = 3; +} + +// A possible configuration for a Cloud Spanner instance. Configurations +// define the geographic placement of nodes and their replication. +message InstanceConfig { + option (google.api.resource) = { + type: "spanner.googleapis.com/InstanceConfig" + pattern: "projects/{project}/instanceConfigs/{instance_config}" + plural: "instanceConfigs" + singular: "instanceConfig" + }; + + // The type of this configuration. + enum Type { + // Unspecified. + TYPE_UNSPECIFIED = 0; + + // Google-managed configuration. + GOOGLE_MANAGED = 1; + + // User-managed configuration. + USER_MANAGED = 2; + } + + // Indicates the current state of the instance configuration. + enum State { + // Not specified. + STATE_UNSPECIFIED = 0; + + // The instance configuration is still being created. + CREATING = 1; + + // The instance configuration is fully created and ready to be used to + // create instances. + READY = 2; + } + + // Describes the availability for free instances to be created in an instance + // configuration. + enum FreeInstanceAvailability { + // Not specified. + FREE_INSTANCE_AVAILABILITY_UNSPECIFIED = 0; + + // Indicates that free instances are available to be created in this + // instance configuration. + AVAILABLE = 1; + + // Indicates that free instances are not supported in this instance + // configuration. + UNSUPPORTED = 2; + + // Indicates that free instances are currently not available to be created + // in this instance configuration. + DISABLED = 3; + + // Indicates that additional free instances cannot be created in this + // instance configuration because the project has reached its limit of free + // instances. + QUOTA_EXCEEDED = 4; + } + + // Indicates the quorum type of this instance configuration. + enum QuorumType { + // Quorum type not specified. + QUORUM_TYPE_UNSPECIFIED = 0; + + // An instance configuration tagged with `REGION` quorum type forms a write + // quorum in a single region. + REGION = 1; + + // An instance configuration tagged with the `DUAL_REGION` quorum type forms + // a write quorum with exactly two read-write regions in a multi-region + // configuration. + // + // This instance configuration requires failover in the event of + // regional failures. + DUAL_REGION = 2; + + // An instance configuration tagged with the `MULTI_REGION` quorum type + // forms a write quorum from replicas that are spread across more than one + // region in a multi-region configuration. + MULTI_REGION = 3; + } + + // A unique identifier for the instance configuration. Values + // are of the form + // `projects//instanceConfigs/[a-z][-a-z0-9]*`. + // + // User instance configuration must start with `custom-`. + string name = 1; + + // The name of this instance configuration as it appears in UIs. + string display_name = 2; + + // Output only. Whether this instance configuration is a Google-managed or + // user-managed configuration. + Type config_type = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The geographic placement of nodes in this instance configuration and their + // replication properties. + // + // To create user-managed configurations, input + // `replicas` must include all replicas in `replicas` of the `base_config` + // and include one or more replicas in the `optional_replicas` of the + // `base_config`. + repeated ReplicaInfo replicas = 3; + + // Output only. The available optional replicas to choose from for + // user-managed configurations. Populated for Google-managed configurations. + repeated ReplicaInfo optional_replicas = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Base configuration name, e.g. projects//instanceConfigs/nam3, + // based on which this configuration is created. Only set for user-managed + // configurations. `base_config` must refer to a configuration of type + // `GOOGLE_MANAGED` in the same project as this configuration. + string base_config = 7 [(google.api.resource_reference) = { + type: "spanner.googleapis.com/InstanceConfig" + }]; + + // Cloud Labels are a flexible and lightweight mechanism for organizing cloud + // resources into groups that reflect a customer's organizational needs and + // deployment strategies. Cloud Labels can be used to filter collections of + // resources. They can be used to control how resource metrics are aggregated. + // And they can be used as arguments to policy management rules (e.g. route, + // firewall, load balancing, etc.). + // + // * Label keys must be between 1 and 63 characters long and must conform to + // the following regular expression: `[a-z][a-z0-9_-]{0,62}`. + // * Label values must be between 0 and 63 characters long and must conform + // to the regular expression `[a-z0-9_-]{0,63}`. + // * No more than 64 labels can be associated with a given resource. + // + // See https://goo.gl/xmQnxf for more information on and examples of labels. + // + // If you plan to use labels in your own code, please note that additional + // characters may be allowed in the future. Therefore, you are advised to use + // an internal label representation, such as JSON, which doesn't rely upon + // specific characters being disallowed. For example, representing labels + // as the string: name + "_" + value would prove problematic if we were to + // allow "_" in a future release. + map labels = 8; + + // etag is used for optimistic concurrency control as a way + // to help prevent simultaneous updates of a instance configuration from + // overwriting each other. It is strongly suggested that systems make use of + // the etag in the read-modify-write cycle to perform instance configuration + // updates in order to avoid race conditions: An etag is returned in the + // response which contains instance configurations, and systems are expected + // to put that etag in the request to update instance configuration to ensure + // that their change is applied to the same version of the instance + // configuration. If no etag is provided in the call to update the instance + // configuration, then the existing instance configuration is overwritten + // blindly. + string etag = 9; + + // Allowed values of the "default_leader" schema option for databases in + // instances that use this instance configuration. + repeated string leader_options = 4; + + // Output only. If true, the instance configuration is being created or + // updated. If false, there are no ongoing operations for the instance + // configuration. + bool reconciling = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The current instance configuration state. Applicable only for + // `USER_MANAGED` configurations. + State state = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Describes whether free instances are available to be created + // in this instance configuration. + FreeInstanceAvailability free_instance_availability = 12 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The `QuorumType` of the instance configuration. + QuorumType quorum_type = 18 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The storage limit in bytes per processing unit. + int64 storage_limit_per_processing_unit = 19 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// ReplicaComputeCapacity describes the amount of server resources that are +// allocated to each replica identified by the replica selection. +message ReplicaComputeCapacity { + // Required. Identifies replicas by specified properties. + // All replicas in the selection have the same amount of compute capacity. + ReplicaSelection replica_selection = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Compute capacity allocated to each replica identified by the specified + // selection. + // The unit is selected based on the unit used to specify the instance size + // for non-autoscaling instances, or the unit used in autoscaling limit for + // autoscaling instances. + oneof compute_capacity { + // The number of nodes allocated to each replica. + // + // This may be zero in API responses for instances that are not yet in + // state `READY`. + int32 node_count = 2; + + // The number of processing units allocated to each replica. + // + // This may be zero in API responses for instances that are not yet in + // state `READY`. + int32 processing_units = 3; + } +} + +// Autoscaling configuration for an instance. +message AutoscalingConfig { + // The autoscaling limits for the instance. Users can define the minimum and + // maximum compute capacity allocated to the instance, and the autoscaler will + // only scale within that range. Users can either use nodes or processing + // units to specify the limits, but should use the same unit to set both the + // min_limit and max_limit. + message AutoscalingLimits { + // The minimum compute capacity for the instance. + oneof min_limit { + // Minimum number of nodes allocated to the instance. If set, this number + // should be greater than or equal to 1. + int32 min_nodes = 1; + + // Minimum number of processing units allocated to the instance. If set, + // this number should be multiples of 1000. + int32 min_processing_units = 2; + } + + // The maximum compute capacity for the instance. The maximum compute + // capacity should be less than or equal to 10X the minimum compute + // capacity. + oneof max_limit { + // Maximum number of nodes allocated to the instance. If set, this number + // should be greater than or equal to min_nodes. + int32 max_nodes = 3; + + // Maximum number of processing units allocated to the instance. If set, + // this number should be multiples of 1000 and be greater than or equal to + // min_processing_units. + int32 max_processing_units = 4; + } + } + + // The autoscaling targets for an instance. + message AutoscalingTargets { + // Optional. The target high priority cpu utilization percentage that the + // autoscaler should be trying to achieve for the instance. This number is + // on a scale from 0 (no utilization) to 100 (full utilization). The valid + // range is [10, 90] inclusive. If not specified or set to 0, the autoscaler + // skips scaling based on high priority CPU utilization. + int32 high_priority_cpu_utilization_percent = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The target total CPU utilization percentage that the autoscaler + // should be trying to achieve for the instance. This number is on a scale + // from 0 (no utilization) to 100 (full utilization). The valid range is + // [10, 90] inclusive. If not specified or set to 0, the autoscaler skips + // scaling based on total CPU utilization. If both + // `high_priority_cpu_utilization_percent` and + // `total_cpu_utilization_percent` are specified, the autoscaler provisions + // the larger of the two required compute capacities to satisfy both + // targets. + int32 total_cpu_utilization_percent = 4 + [(google.api.field_behavior) = OPTIONAL]; + + // Required. The target storage utilization percentage that the autoscaler + // should be trying to achieve for the instance. This number is on a scale + // from 0 (no utilization) to 100 (full utilization). The valid range is + // [10, 99] inclusive. + int32 storage_utilization_percent = 2 + [(google.api.field_behavior) = REQUIRED]; + } + + // AsymmetricAutoscalingOption specifies the scaling of replicas identified by + // the given selection. + message AsymmetricAutoscalingOption { + // Overrides the top-level autoscaling configuration for the replicas + // identified by `replica_selection`. All fields in this message are + // optional. Any unspecified fields will use the corresponding values from + // the top-level autoscaling configuration. + message AutoscalingConfigOverrides { + // Optional. If specified, overrides the min/max limit in the top-level + // autoscaling configuration for the selected replicas. + AutoscalingLimits autoscaling_limits = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If specified, overrides the autoscaling target + // high_priority_cpu_utilization_percent in the top-level autoscaling + // configuration for the selected replicas. + int32 autoscaling_target_high_priority_cpu_utilization_percent = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If specified, overrides the + // autoscaling target `total_cpu_utilization_percent` + // in the top-level autoscaling configuration for the selected replicas. + int32 autoscaling_target_total_cpu_utilization_percent = 4 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If true, disables high priority CPU autoscaling for the + // selected replicas and ignores + // [high_priority_cpu_utilization_percent][google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets.high_priority_cpu_utilization_percent] + // in the top-level autoscaling configuration. + // + // When setting this field to true, setting + // [autoscaling_target_high_priority_cpu_utilization_percent][google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides.autoscaling_target_high_priority_cpu_utilization_percent] + // field to a non-zero value for the same replica is not supported. + // + // If false, the + // [autoscaling_target_high_priority_cpu_utilization_percent][google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides.autoscaling_target_high_priority_cpu_utilization_percent] + // field in the replica will be used if set to a non-zero value. + // Otherwise, the + // [high_priority_cpu_utilization_percent][google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets.high_priority_cpu_utilization_percent] + // field in the top-level autoscaling configuration will be used. + // + // Setting both + // [disable_high_priority_cpu_autoscaling][google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides.disable_high_priority_cpu_autoscaling] + // and + // [disable_total_cpu_autoscaling][google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides.disable_total_cpu_autoscaling] + // to true for the same replica is not supported. + bool disable_high_priority_cpu_autoscaling = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If true, disables total CPU autoscaling for the selected + // replicas and ignores + // [total_cpu_utilization_percent][google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets.total_cpu_utilization_percent] + // in the top-level autoscaling configuration. + // + // When setting this field to true, setting + // [autoscaling_target_total_cpu_utilization_percent][google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides.autoscaling_target_total_cpu_utilization_percent] + // field to a non-zero value for the same replica is not supported. + // + // If false, the + // [autoscaling_target_total_cpu_utilization_percent][google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides.autoscaling_target_total_cpu_utilization_percent] + // field in the replica will be used if set to a non-zero value. + // Otherwise, the + // [total_cpu_utilization_percent][google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets.total_cpu_utilization_percent] + // field in the top-level autoscaling configuration will be used. + // + // Setting both + // [disable_high_priority_cpu_autoscaling][google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides.disable_high_priority_cpu_autoscaling] + // and + // [disable_total_cpu_autoscaling][google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides.disable_total_cpu_autoscaling] + // to true for the same replica is not supported. + bool disable_total_cpu_autoscaling = 6 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Required. Selects the replicas to which this AsymmetricAutoscalingOption + // applies. Only read-only replicas are supported. + ReplicaSelection replica_selection = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. Overrides applied to the top-level autoscaling configuration + // for the selected replicas. + AutoscalingConfigOverrides overrides = 2 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Required. Autoscaling limits for an instance. + AutoscalingLimits autoscaling_limits = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. The autoscaling targets for an instance. + AutoscalingTargets autoscaling_targets = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. Optional asymmetric autoscaling options. + // Replicas matching the replica selection criteria will be autoscaled + // independently from other replicas. The autoscaler will scale the replicas + // based on the utilization of replicas identified by the replica selection. + // Replica selections should not overlap with each other. + // + // Other replicas (those do not match any replica selection) will be + // autoscaled together and will have the same compute capacity allocated to + // them. + repeated AsymmetricAutoscalingOption asymmetric_autoscaling_options = 3 + [(google.api.field_behavior) = OPTIONAL]; +} + +// An isolated set of Cloud Spanner resources on which databases can be hosted. +message Instance { + option (google.api.resource) = { + type: "spanner.googleapis.com/Instance" + pattern: "projects/{project}/instances/{instance}" + plural: "instances" + singular: "instance" + }; + + // Indicates the current state of the instance. + enum State { + // Not specified. + STATE_UNSPECIFIED = 0; + + // The instance is still being created. Resources may not be + // available yet, and operations such as database creation may not + // work. + CREATING = 1; + + // The instance is fully created and ready to do work such as + // creating databases. + READY = 2; + } + + // The type of this instance. The type can be used to distinguish product + // variants, that can affect aspects like: usage restrictions, quotas and + // billing. Currently this is used to distinguish FREE_INSTANCE vs PROVISIONED + // instances. + enum InstanceType { + // Not specified. + INSTANCE_TYPE_UNSPECIFIED = 0; + + // Provisioned instances have dedicated resources, standard usage limits and + // support. + PROVISIONED = 1; + + // Free instances provide no guarantee for dedicated resources, + // [node_count, processing_units] should be 0. They come + // with stricter usage limits and limited support. + FREE_INSTANCE = 2; + } + + // The edition selected for this instance. Different editions provide + // different capabilities at different price points. + enum Edition { + // Edition not specified. + EDITION_UNSPECIFIED = 0; + + // Standard edition. + STANDARD = 1; + + // Enterprise edition. + ENTERPRISE = 2; + + // Enterprise Plus edition. + ENTERPRISE_PLUS = 3; + } + + // Indicates the + // [default backup + // schedule](https://cloud.google.com/spanner/docs/backup#default-backup-schedules) + // behavior for new databases within the instance. + enum DefaultBackupScheduleType { + // Not specified. + DEFAULT_BACKUP_SCHEDULE_TYPE_UNSPECIFIED = 0; + + // A default backup schedule isn't created automatically when a new database + // is created in the instance. + NONE = 1; + + // A default backup schedule is created automatically when a new database + // is created in the instance. The default backup schedule creates a full + // backup every 24 hours. These full backups are retained for 7 days. + // You can edit or delete the default backup schedule once it's created. + AUTOMATIC = 2; + } + + // Required. A unique identifier for the instance, which cannot be changed + // after the instance is created. Values are of the form + // `projects//instances/[a-z][-a-z0-9]*[a-z0-9]`. The final + // segment of the name must be between 2 and 64 characters in length. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The name of the instance's configuration. Values are of the form + // `projects//instanceConfigs/`. See + // also [InstanceConfig][google.spanner.admin.instance.v1.InstanceConfig] and + // [ListInstanceConfigs][google.spanner.admin.instance.v1.InstanceAdmin.ListInstanceConfigs]. + string config = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "spanner.googleapis.com/InstanceConfig" + } + ]; + + // Required. The descriptive name for this instance as it appears in UIs. + // Must be unique per project and between 4 and 30 characters in length. + string display_name = 3 [(google.api.field_behavior) = REQUIRED]; + + // The number of nodes allocated to this instance. At most, one of either + // `node_count` or `processing_units` should be present in the message. + // + // Users can set the `node_count` field to specify the target number of nodes + // allocated to the instance. + // + // If autoscaling is enabled, `node_count` is treated as an `OUTPUT_ONLY` + // field and reflects the current number of nodes allocated to the instance. + // + // This might be zero in API responses for instances that are not yet in the + // `READY` state. + // + // + // For more information, see + // [Compute capacity, nodes, and processing + // units](https://cloud.google.com/spanner/docs/compute-capacity). + int32 node_count = 5; + + // The number of processing units allocated to this instance. At most, one of + // either `processing_units` or `node_count` should be present in the message. + // + // Users can set the `processing_units` field to specify the target number of + // processing units allocated to the instance. + // + // If autoscaling is enabled, `processing_units` is treated as an + // `OUTPUT_ONLY` field and reflects the current number of processing units + // allocated to the instance. + // + // This might be zero in API responses for instances that are not yet in the + // `READY` state. + // + // + // For more information, see + // [Compute capacity, nodes and processing + // units](https://cloud.google.com/spanner/docs/compute-capacity). + int32 processing_units = 9; + + // Output only. Lists the compute capacity per ReplicaSelection. A replica + // selection identifies a set of replicas with common properties. Replicas + // identified by a ReplicaSelection are scaled with the same compute capacity. + repeated ReplicaComputeCapacity replica_compute_capacity = 19 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The autoscaling configuration. Autoscaling is enabled if this + // field is set. When autoscaling is enabled, node_count and processing_units + // are treated as OUTPUT_ONLY fields and reflect the current compute capacity + // allocated to the instance. + AutoscalingConfig autoscaling_config = 17 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The current instance state. For + // [CreateInstance][google.spanner.admin.instance.v1.InstanceAdmin.CreateInstance], + // the state must be either omitted or set to `CREATING`. For + // [UpdateInstance][google.spanner.admin.instance.v1.InstanceAdmin.UpdateInstance], + // the state must be either omitted or set to `READY`. + State state = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Cloud Labels are a flexible and lightweight mechanism for organizing cloud + // resources into groups that reflect a customer's organizational needs and + // deployment strategies. Cloud Labels can be used to filter collections of + // resources. They can be used to control how resource metrics are aggregated. + // And they can be used as arguments to policy management rules (e.g. route, + // firewall, load balancing, etc.). + // + // * Label keys must be between 1 and 63 characters long and must conform to + // the following regular expression: `[a-z][a-z0-9_-]{0,62}`. + // * Label values must be between 0 and 63 characters long and must conform + // to the regular expression `[a-z0-9_-]{0,63}`. + // * No more than 64 labels can be associated with a given resource. + // + // See https://goo.gl/xmQnxf for more information on and examples of labels. + // + // If you plan to use labels in your own code, please note that additional + // characters may be allowed in the future. And so you are advised to use an + // internal label representation, such as JSON, which doesn't rely upon + // specific characters being disallowed. For example, representing labels + // as the string: name + "_" + value would prove problematic if we were to + // allow "_" in a future release. + map labels = 7; + + // The `InstanceType` of the current instance. + InstanceType instance_type = 10; + + // Deprecated. This field is not populated. + repeated string endpoint_uris = 8; + + // Output only. The time at which the instance was created. + google.protobuf.Timestamp create_time = 11 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which the instance was most recently updated. + google.protobuf.Timestamp update_time = 12 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Free instance metadata. Only populated for free instances. + FreeInstanceMetadata free_instance_metadata = 13; + + // Optional. The `Edition` of the current instance. + Edition edition = 20 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Controls the default backup schedule behavior for new databases + // within the instance. By default, a backup schedule is created automatically + // when a new database is created in a new instance. + // + // Note that the `AUTOMATIC` value isn't permitted for free instances, + // as backups and backup schedules aren't supported for free instances. + // + // In the `GetInstance` or `ListInstances` response, if the value of + // `default_backup_schedule_type` isn't set, or set to `NONE`, Spanner doesn't + // create a default backup schedule for new databases in the instance. + DefaultBackupScheduleType default_backup_schedule_type = 23 + [(google.api.field_behavior) = OPTIONAL]; +} + +// The request for +// [ListInstanceConfigs][google.spanner.admin.instance.v1.InstanceAdmin.ListInstanceConfigs]. +message ListInstanceConfigsRequest { + // Required. The name of the project for which a list of supported instance + // configurations is requested. Values are of the form + // `projects/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // Number of instance configurations to be returned in the response. If 0 or + // less, defaults to the server's maximum allowed page size. + int32 page_size = 2; + + // If non-empty, `page_token` should contain a + // [next_page_token][google.spanner.admin.instance.v1.ListInstanceConfigsResponse.next_page_token] + // from a previous + // [ListInstanceConfigsResponse][google.spanner.admin.instance.v1.ListInstanceConfigsResponse]. + string page_token = 3; +} + +// The response for +// [ListInstanceConfigs][google.spanner.admin.instance.v1.InstanceAdmin.ListInstanceConfigs]. +message ListInstanceConfigsResponse { + // The list of requested instance configurations. + repeated InstanceConfig instance_configs = 1; + + // `next_page_token` can be sent in a subsequent + // [ListInstanceConfigs][google.spanner.admin.instance.v1.InstanceAdmin.ListInstanceConfigs] + // call to fetch more of the matching instance configurations. + string next_page_token = 2; +} + +// The request for +// [GetInstanceConfigRequest][google.spanner.admin.instance.v1.InstanceAdmin.GetInstanceConfig]. +message GetInstanceConfigRequest { + // Required. The name of the requested instance configuration. Values are of + // the form `projects//instanceConfigs/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "spanner.googleapis.com/InstanceConfig" + } + ]; +} + +// The request for +// [CreateInstanceConfig][google.spanner.admin.instance.v1.InstanceAdmin.CreateInstanceConfig]. +message CreateInstanceConfigRequest { + // Required. The name of the project in which to create the instance + // configuration. Values are of the form `projects/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // Required. The ID of the instance configuration to create. Valid identifiers + // are of the form `custom-[-a-z0-9]*[a-z0-9]` and must be between 2 and 64 + // characters in length. The `custom-` prefix is required to avoid name + // conflicts with Google-managed configurations. + string instance_config_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The `InstanceConfig` proto of the configuration to create. + // `instance_config.name` must be + // `/instanceConfigs/`. + // `instance_config.base_config` must be a Google-managed configuration name, + // e.g. /instanceConfigs/us-east1, /instanceConfigs/nam3. + InstanceConfig instance_config = 3 [(google.api.field_behavior) = REQUIRED]; + + // An option to validate, but not actually execute, a request, + // and provide the same response. + bool validate_only = 4; +} + +// The request for +// [UpdateInstanceConfig][google.spanner.admin.instance.v1.InstanceAdmin.UpdateInstanceConfig]. +message UpdateInstanceConfigRequest { + // Required. The user instance configuration to update, which must always + // include the instance configuration name. Otherwise, only fields mentioned + // in + // [update_mask][google.spanner.admin.instance.v1.UpdateInstanceConfigRequest.update_mask] + // need be included. To prevent conflicts of concurrent updates, + // [etag][google.spanner.admin.instance.v1.InstanceConfig.reconciling] can + // be used. + InstanceConfig instance_config = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. A mask specifying which fields in + // [InstanceConfig][google.spanner.admin.instance.v1.InstanceConfig] should be + // updated. The field mask must always be specified; this prevents any future + // fields in [InstanceConfig][google.spanner.admin.instance.v1.InstanceConfig] + // from being erased accidentally by clients that do not know about them. Only + // display_name and labels can be updated. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; + + // An option to validate, but not actually execute, a request, + // and provide the same response. + bool validate_only = 3; +} + +// The request for +// [DeleteInstanceConfig][google.spanner.admin.instance.v1.InstanceAdmin.DeleteInstanceConfig]. +message DeleteInstanceConfigRequest { + // Required. The name of the instance configuration to be deleted. + // Values are of the form + // `projects//instanceConfigs/` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "spanner.googleapis.com/InstanceConfig" + } + ]; + + // Used for optimistic concurrency control as a way to help prevent + // simultaneous deletes of an instance configuration from overwriting each + // other. If not empty, the API + // only deletes the instance configuration when the etag provided matches the + // current status of the requested instance configuration. Otherwise, deletes + // the instance configuration without checking the current status of the + // requested instance configuration. + string etag = 2; + + // An option to validate, but not actually execute, a request, + // and provide the same response. + bool validate_only = 3; +} + +// The request for +// [ListInstanceConfigOperations][google.spanner.admin.instance.v1.InstanceAdmin.ListInstanceConfigOperations]. +message ListInstanceConfigOperationsRequest { + // Required. The project of the instance configuration operations. + // Values are of the form `projects/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // An expression that filters the list of returned operations. + // + // A filter expression consists of a field name, a + // comparison operator, and a value for filtering. + // The value must be a string, a number, or a boolean. The comparison operator + // must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. + // Colon `:` is the contains operator. Filter rules are not case sensitive. + // + // The following fields in the Operation are eligible for filtering: + // + // * `name` - The name of the long-running operation + // * `done` - False if the operation is in progress, else true. + // * `metadata.@type` - the type of metadata. For example, the type string + // for + // [CreateInstanceConfigMetadata][google.spanner.admin.instance.v1.CreateInstanceConfigMetadata] + // is + // `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstanceConfigMetadata`. + // * `metadata.` - any field in metadata.value. + // `metadata.@type` must be specified first, if filtering on metadata + // fields. + // * `error` - Error associated with the long-running operation. + // * `response.@type` - the type of response. + // * `response.` - any field in response.value. + // + // You can combine multiple expressions by enclosing each expression in + // parentheses. By default, expressions are combined with AND logic. However, + // you can specify AND, OR, and NOT logic explicitly. + // + // Here are a few examples: + // + // * `done:true` - The operation is complete. + // * `(metadata.@type=` \ + // `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstanceConfigMetadata) + // AND` \ + // `(metadata.instance_config.name:custom-config) AND` \ + // `(metadata.progress.start_time < \"2021-03-28T14:50:00Z\") AND` \ + // `(error:*)` - Return operations where: + // * The operation's metadata type is + // [CreateInstanceConfigMetadata][google.spanner.admin.instance.v1.CreateInstanceConfigMetadata]. + // * The instance configuration name contains "custom-config". + // * The operation started before 2021-03-28T14:50:00Z. + // * The operation resulted in an error. + string filter = 2; + + // Number of operations to be returned in the response. If 0 or + // less, defaults to the server's maximum allowed page size. + int32 page_size = 3; + + // If non-empty, `page_token` should contain a + // [next_page_token][google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse.next_page_token] + // from a previous + // [ListInstanceConfigOperationsResponse][google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse] + // to the same `parent` and with the same `filter`. + string page_token = 4; +} + +// The response for +// [ListInstanceConfigOperations][google.spanner.admin.instance.v1.InstanceAdmin.ListInstanceConfigOperations]. +message ListInstanceConfigOperationsResponse { + // The list of matching instance configuration long-running operations. Each + // operation's name will be + // prefixed by the name of the instance configuration. The operation's + // metadata field type + // `metadata.type_url` describes the type of the metadata. + repeated google.longrunning.Operation operations = 1; + + // `next_page_token` can be sent in a subsequent + // [ListInstanceConfigOperations][google.spanner.admin.instance.v1.InstanceAdmin.ListInstanceConfigOperations] + // call to fetch more of the matching metadata. + string next_page_token = 2; +} + +// The request for +// [GetInstance][google.spanner.admin.instance.v1.InstanceAdmin.GetInstance]. +message GetInstanceRequest { + // Required. The name of the requested instance. Values are of the form + // `projects//instances/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "spanner.googleapis.com/Instance" + } + ]; + + // If field_mask is present, specifies the subset of + // [Instance][google.spanner.admin.instance.v1.Instance] fields that should be + // returned. If absent, all + // [Instance][google.spanner.admin.instance.v1.Instance] fields are returned. + google.protobuf.FieldMask field_mask = 2; +} + +// The request for +// [CreateInstance][google.spanner.admin.instance.v1.InstanceAdmin.CreateInstance]. +message CreateInstanceRequest { + // Required. The name of the project in which to create the instance. Values + // are of the form `projects/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // Required. The ID of the instance to create. Valid identifiers are of the + // form `[a-z][-a-z0-9]*[a-z0-9]` and must be between 2 and 64 characters in + // length. + string instance_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The instance to create. The name may be omitted, but if + // specified must be `/instances/`. + Instance instance = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// The request for +// [ListInstances][google.spanner.admin.instance.v1.InstanceAdmin.ListInstances]. +message ListInstancesRequest { + // Required. The name of the project for which a list of instances is + // requested. Values are of the form `projects/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // Number of instances to be returned in the response. If 0 or less, defaults + // to the server's maximum allowed page size. + int32 page_size = 2; + + // If non-empty, `page_token` should contain a + // [next_page_token][google.spanner.admin.instance.v1.ListInstancesResponse.next_page_token] + // from a previous + // [ListInstancesResponse][google.spanner.admin.instance.v1.ListInstancesResponse]. + string page_token = 3; + + // An expression for filtering the results of the request. Filter rules are + // case insensitive. The fields eligible for filtering are: + // + // * `name` + // * `display_name` + // * `labels.key` where key is the name of a label + // + // Some examples of using filters are: + // + // * `name:*` --> The instance has a name. + // * `name:Howl` --> The instance's name contains the string "howl". + // * `name:HOWL` --> Equivalent to above. + // * `NAME:howl` --> Equivalent to above. + // * `labels.env:*` --> The instance has the label "env". + // * `labels.env:dev` --> The instance has the label "env" and the value of + // the label contains the string "dev". + // * `name:howl labels.env:dev` --> The instance's name contains "howl" and + // it has the label "env" with its value + // containing "dev". + string filter = 4; + + // Deadline used while retrieving metadata for instances. + // Instances whose metadata cannot be retrieved within this deadline will be + // added to + // [unreachable][google.spanner.admin.instance.v1.ListInstancesResponse.unreachable] + // in + // [ListInstancesResponse][google.spanner.admin.instance.v1.ListInstancesResponse]. + google.protobuf.Timestamp instance_deadline = 5; +} + +// The response for +// [ListInstances][google.spanner.admin.instance.v1.InstanceAdmin.ListInstances]. +message ListInstancesResponse { + // The list of requested instances. + repeated Instance instances = 1; + + // `next_page_token` can be sent in a subsequent + // [ListInstances][google.spanner.admin.instance.v1.InstanceAdmin.ListInstances] + // call to fetch more of the matching instances. + string next_page_token = 2; + + // The list of unreachable instances. + // It includes the names of instances whose metadata could not be retrieved + // within + // [instance_deadline][google.spanner.admin.instance.v1.ListInstancesRequest.instance_deadline]. + repeated string unreachable = 3; +} + +// The request for +// [UpdateInstance][google.spanner.admin.instance.v1.InstanceAdmin.UpdateInstance]. +message UpdateInstanceRequest { + // Required. The instance to update, which must always include the instance + // name. Otherwise, only fields mentioned in + // [field_mask][google.spanner.admin.instance.v1.UpdateInstanceRequest.field_mask] + // need be included. + Instance instance = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. A mask specifying which fields in + // [Instance][google.spanner.admin.instance.v1.Instance] should be updated. + // The field mask must always be specified; this prevents any future fields in + // [Instance][google.spanner.admin.instance.v1.Instance] from being erased + // accidentally by clients that do not know about them. + google.protobuf.FieldMask field_mask = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// The request for +// [DeleteInstance][google.spanner.admin.instance.v1.InstanceAdmin.DeleteInstance]. +message DeleteInstanceRequest { + // Required. The name of the instance to be deleted. Values are of the form + // `projects//instances/` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "spanner.googleapis.com/Instance" + } + ]; +} + +// Metadata type for the operation returned by +// [CreateInstance][google.spanner.admin.instance.v1.InstanceAdmin.CreateInstance]. +message CreateInstanceMetadata { + // The instance being created. + Instance instance = 1; + + // The time at which the + // [CreateInstance][google.spanner.admin.instance.v1.InstanceAdmin.CreateInstance] + // request was received. + google.protobuf.Timestamp start_time = 2; + + // The time at which this operation was cancelled. If set, this operation is + // in the process of undoing itself (which is guaranteed to succeed) and + // cannot be cancelled again. + google.protobuf.Timestamp cancel_time = 3; + + // The time at which this operation failed or was completed successfully. + google.protobuf.Timestamp end_time = 4; + + // The expected fulfillment period of this create operation. + FulfillmentPeriod expected_fulfillment_period = 5; +} + +// Metadata type for the operation returned by +// [UpdateInstance][google.spanner.admin.instance.v1.InstanceAdmin.UpdateInstance]. +message UpdateInstanceMetadata { + // The desired end state of the update. + Instance instance = 1; + + // The time at which + // [UpdateInstance][google.spanner.admin.instance.v1.InstanceAdmin.UpdateInstance] + // request was received. + google.protobuf.Timestamp start_time = 2; + + // The time at which this operation was cancelled. If set, this operation is + // in the process of undoing itself (which is guaranteed to succeed) and + // cannot be cancelled again. + google.protobuf.Timestamp cancel_time = 3; + + // The time at which this operation failed or was completed successfully. + google.protobuf.Timestamp end_time = 4; + + // The expected fulfillment period of this update operation. + FulfillmentPeriod expected_fulfillment_period = 5; +} + +// Free instance specific metadata that is kept even after an instance has been +// upgraded for tracking purposes. +message FreeInstanceMetadata { + // Allows users to change behavior when a free instance expires. + enum ExpireBehavior { + // Not specified. + EXPIRE_BEHAVIOR_UNSPECIFIED = 0; + + // When the free instance expires, upgrade the instance to a provisioned + // instance. + FREE_TO_PROVISIONED = 1; + + // When the free instance expires, disable the instance, and delete it + // after the grace period passes if it has not been upgraded. + REMOVE_AFTER_GRACE_PERIOD = 2; + } + + // Output only. Timestamp after which the instance will either be upgraded or + // scheduled for deletion after a grace period. ExpireBehavior is used to + // choose between upgrading or scheduling the free instance for deletion. This + // timestamp is set during the creation of a free instance. + google.protobuf.Timestamp expire_time = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. If present, the timestamp at which the free instance was + // upgraded to a provisioned instance. + google.protobuf.Timestamp upgrade_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Specifies the expiration behavior of a free instance. The default of + // ExpireBehavior is `REMOVE_AFTER_GRACE_PERIOD`. This can be modified during + // or after creation, and before expiration. + ExpireBehavior expire_behavior = 3; +} + +// Metadata type for the operation returned by +// [CreateInstanceConfig][google.spanner.admin.instance.v1.InstanceAdmin.CreateInstanceConfig]. +message CreateInstanceConfigMetadata { + // The target instance configuration end state. + InstanceConfig instance_config = 1; + + // The progress of the + // [CreateInstanceConfig][google.spanner.admin.instance.v1.InstanceAdmin.CreateInstanceConfig] + // operation. + OperationProgress progress = 2; + + // The time at which this operation was cancelled. + google.protobuf.Timestamp cancel_time = 3; +} + +// Metadata type for the operation returned by +// [UpdateInstanceConfig][google.spanner.admin.instance.v1.InstanceAdmin.UpdateInstanceConfig]. +message UpdateInstanceConfigMetadata { + // The desired instance configuration after updating. + InstanceConfig instance_config = 1; + + // The progress of the + // [UpdateInstanceConfig][google.spanner.admin.instance.v1.InstanceAdmin.UpdateInstanceConfig] + // operation. + OperationProgress progress = 2; + + // The time at which this operation was cancelled. + google.protobuf.Timestamp cancel_time = 3; +} + +// An isolated set of Cloud Spanner resources that databases can define +// placements on. +message InstancePartition { + option (google.api.resource) = { + type: "spanner.googleapis.com/InstancePartition" + pattern: "projects/{project}/instances/{instance}/instancePartitions/{instance_partition}" + plural: "instancePartitions" + singular: "instancePartition" + }; + + // Indicates the current state of the instance partition. + enum State { + // Not specified. + STATE_UNSPECIFIED = 0; + + // The instance partition is still being created. Resources may not be + // available yet, and operations such as creating placements using this + // instance partition may not work. + CREATING = 1; + + // The instance partition is fully created and ready to do work such as + // creating placements and using in databases. + READY = 2; + } + + // Required. A unique identifier for the instance partition. Values are of the + // form + // `projects//instances//instancePartitions/[a-z][-a-z0-9]*[a-z0-9]`. + // The final segment of the name must be between 2 and 64 characters in + // length. An instance partition's name cannot be changed after the instance + // partition is created. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The name of the instance partition's configuration. Values are of + // the form `projects//instanceConfigs/`. See also + // [InstanceConfig][google.spanner.admin.instance.v1.InstanceConfig] and + // [ListInstanceConfigs][google.spanner.admin.instance.v1.InstanceAdmin.ListInstanceConfigs]. + string config = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "spanner.googleapis.com/InstanceConfig" + } + ]; + + // Required. The descriptive name for this instance partition as it appears in + // UIs. Must be unique per project and between 4 and 30 characters in length. + string display_name = 3 [(google.api.field_behavior) = REQUIRED]; + + // Compute capacity defines amount of server and storage resources that are + // available to the databases in an instance partition. At most, one of either + // `node_count` or` processing_units` should be present in the message. For + // more information, see + // [Compute capacity, nodes, and processing + // units](https://cloud.google.com/spanner/docs/compute-capacity). + oneof compute_capacity { + // The number of nodes allocated to this instance partition. + // + // Users can set the `node_count` field to specify the target number of + // nodes allocated to the instance partition. + // + // This may be zero in API responses for instance partitions that are not + // yet in state `READY`. + int32 node_count = 5; + + // The number of processing units allocated to this instance partition. + // + // Users can set the `processing_units` field to specify the target number + // of processing units allocated to the instance partition. + // + // This might be zero in API responses for instance partitions that are not + // yet in the `READY` state. + int32 processing_units = 6; + } + + // Optional. The autoscaling configuration. Autoscaling is enabled if this + // field is set. When autoscaling is enabled, fields in compute_capacity are + // treated as OUTPUT_ONLY fields and reflect the current compute capacity + // allocated to the instance partition. + AutoscalingConfig autoscaling_config = 13 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The current instance partition state. + State state = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which the instance partition was created. + google.protobuf.Timestamp create_time = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which the instance partition was most recently + // updated. + google.protobuf.Timestamp update_time = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The names of the databases that reference this + // instance partition. Referencing databases should share the parent instance. + // The existence of any referencing database prevents the instance partition + // from being deleted. + repeated string referencing_databases = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Deprecated: This field is not populated. + // Output only. The names of the backups that reference this instance + // partition. Referencing backups should share the parent instance. The + // existence of any referencing backup prevents the instance partition from + // being deleted. + repeated string referencing_backups = 11 + [deprecated = true, (google.api.field_behavior) = OUTPUT_ONLY]; + + // Used for optimistic concurrency control as a way + // to help prevent simultaneous updates of a instance partition from + // overwriting each other. It is strongly suggested that systems make use of + // the etag in the read-modify-write cycle to perform instance partition + // updates in order to avoid race conditions: An etag is returned in the + // response which contains instance partitions, and systems are expected to + // put that etag in the request to update instance partitions to ensure that + // their change will be applied to the same version of the instance partition. + // If no etag is provided in the call to update instance partition, then the + // existing instance partition is overwritten blindly. + string etag = 12; +} + +// Metadata type for the operation returned by +// [CreateInstancePartition][google.spanner.admin.instance.v1.InstanceAdmin.CreateInstancePartition]. +message CreateInstancePartitionMetadata { + // The instance partition being created. + InstancePartition instance_partition = 1; + + // The time at which the + // [CreateInstancePartition][google.spanner.admin.instance.v1.InstanceAdmin.CreateInstancePartition] + // request was received. + google.protobuf.Timestamp start_time = 2; + + // The time at which this operation was cancelled. If set, this operation is + // in the process of undoing itself (which is guaranteed to succeed) and + // cannot be cancelled again. + google.protobuf.Timestamp cancel_time = 3; + + // The time at which this operation failed or was completed successfully. + google.protobuf.Timestamp end_time = 4; +} + +// The request for +// [CreateInstancePartition][google.spanner.admin.instance.v1.InstanceAdmin.CreateInstancePartition]. +message CreateInstancePartitionRequest { + // Required. The name of the instance in which to create the instance + // partition. Values are of the form + // `projects//instances/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "spanner.googleapis.com/Instance" + } + ]; + + // Required. The ID of the instance partition to create. Valid identifiers are + // of the form `[a-z][-a-z0-9]*[a-z0-9]` and must be between 2 and 64 + // characters in length. + string instance_partition_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The instance partition to create. The instance_partition.name may + // be omitted, but if specified must be + // `/instancePartitions/`. + InstancePartition instance_partition = 3 + [(google.api.field_behavior) = REQUIRED]; +} + +// The request for +// [DeleteInstancePartition][google.spanner.admin.instance.v1.InstanceAdmin.DeleteInstancePartition]. +message DeleteInstancePartitionRequest { + // Required. The name of the instance partition to be deleted. + // Values are of the form + // `projects/{project}/instances/{instance}/instancePartitions/{instance_partition}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "spanner.googleapis.com/InstancePartition" + } + ]; + + // Optional. If not empty, the API only deletes the instance partition when + // the etag provided matches the current status of the requested instance + // partition. Otherwise, deletes the instance partition without checking the + // current status of the requested instance partition. + string etag = 2; +} + +// The request for +// [GetInstancePartition][google.spanner.admin.instance.v1.InstanceAdmin.GetInstancePartition]. +message GetInstancePartitionRequest { + // Required. The name of the requested instance partition. Values are of + // the form + // `projects/{project}/instances/{instance}/instancePartitions/{instance_partition}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "spanner.googleapis.com/InstancePartition" + } + ]; +} + +// The request for +// [UpdateInstancePartition][google.spanner.admin.instance.v1.InstanceAdmin.UpdateInstancePartition]. +message UpdateInstancePartitionRequest { + // Required. The instance partition to update, which must always include the + // instance partition name. Otherwise, only fields mentioned in + // [field_mask][google.spanner.admin.instance.v1.UpdateInstancePartitionRequest.field_mask] + // need be included. + InstancePartition instance_partition = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. A mask specifying which fields in + // [InstancePartition][google.spanner.admin.instance.v1.InstancePartition] + // should be updated. The field mask must always be specified; this prevents + // any future fields in + // [InstancePartition][google.spanner.admin.instance.v1.InstancePartition] + // from being erased accidentally by clients that do not know about them. + google.protobuf.FieldMask field_mask = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// Metadata type for the operation returned by +// [UpdateInstancePartition][google.spanner.admin.instance.v1.InstanceAdmin.UpdateInstancePartition]. +message UpdateInstancePartitionMetadata { + // The desired end state of the update. + InstancePartition instance_partition = 1; + + // The time at which + // [UpdateInstancePartition][google.spanner.admin.instance.v1.InstanceAdmin.UpdateInstancePartition] + // request was received. + google.protobuf.Timestamp start_time = 2; + + // The time at which this operation was cancelled. If set, this operation is + // in the process of undoing itself (which is guaranteed to succeed) and + // cannot be cancelled again. + google.protobuf.Timestamp cancel_time = 3; + + // The time at which this operation failed or was completed successfully. + google.protobuf.Timestamp end_time = 4; +} + +// The request for +// [ListInstancePartitions][google.spanner.admin.instance.v1.InstanceAdmin.ListInstancePartitions]. +message ListInstancePartitionsRequest { + // Required. The instance whose instance partitions should be listed. Values + // are of the form `projects//instances/`. Use `{instance} + // = '-'` to list instance partitions for all Instances in a project, e.g., + // `projects/myproject/instances/-`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "spanner.googleapis.com/Instance" + } + ]; + + // Number of instance partitions to be returned in the response. If 0 or less, + // defaults to the server's maximum allowed page size. + int32 page_size = 2; + + // If non-empty, `page_token` should contain a + // [next_page_token][google.spanner.admin.instance.v1.ListInstancePartitionsResponse.next_page_token] + // from a previous + // [ListInstancePartitionsResponse][google.spanner.admin.instance.v1.ListInstancePartitionsResponse]. + string page_token = 3; + + // Optional. Deadline used while retrieving metadata for instance partitions. + // Instance partitions whose metadata cannot be retrieved within this deadline + // will be added to + // [unreachable][google.spanner.admin.instance.v1.ListInstancePartitionsResponse.unreachable] + // in + // [ListInstancePartitionsResponse][google.spanner.admin.instance.v1.ListInstancePartitionsResponse]. + google.protobuf.Timestamp instance_partition_deadline = 4 + [(google.api.field_behavior) = OPTIONAL]; +} + +// The response for +// [ListInstancePartitions][google.spanner.admin.instance.v1.InstanceAdmin.ListInstancePartitions]. +message ListInstancePartitionsResponse { + // The list of requested instancePartitions. + repeated InstancePartition instance_partitions = 1; + + // `next_page_token` can be sent in a subsequent + // [ListInstancePartitions][google.spanner.admin.instance.v1.InstanceAdmin.ListInstancePartitions] + // call to fetch more of the matching instance partitions. + string next_page_token = 2; + + // The list of unreachable instances or instance partitions. + // It includes the names of instances or instance partitions whose metadata + // could not be retrieved within + // [instance_partition_deadline][google.spanner.admin.instance.v1.ListInstancePartitionsRequest.instance_partition_deadline]. + repeated string unreachable = 3; +} + +// The request for +// [ListInstancePartitionOperations][google.spanner.admin.instance.v1.InstanceAdmin.ListInstancePartitionOperations]. +message ListInstancePartitionOperationsRequest { + // Required. The parent instance of the instance partition operations. + // Values are of the form `projects//instances/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "spanner.googleapis.com/Instance" + } + ]; + + // Optional. An expression that filters the list of returned operations. + // + // A filter expression consists of a field name, a + // comparison operator, and a value for filtering. + // The value must be a string, a number, or a boolean. The comparison operator + // must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. + // Colon `:` is the contains operator. Filter rules are not case sensitive. + // + // The following fields in the Operation are eligible for filtering: + // + // * `name` - The name of the long-running operation + // * `done` - False if the operation is in progress, else true. + // * `metadata.@type` - the type of metadata. For example, the type string + // for + // [CreateInstancePartitionMetadata][google.spanner.admin.instance.v1.CreateInstancePartitionMetadata] + // is + // `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstancePartitionMetadata`. + // * `metadata.` - any field in metadata.value. + // `metadata.@type` must be specified first, if filtering on metadata + // fields. + // * `error` - Error associated with the long-running operation. + // * `response.@type` - the type of response. + // * `response.` - any field in response.value. + // + // You can combine multiple expressions by enclosing each expression in + // parentheses. By default, expressions are combined with AND logic. However, + // you can specify AND, OR, and NOT logic explicitly. + // + // Here are a few examples: + // + // * `done:true` - The operation is complete. + // * `(metadata.@type=` \ + // `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstancePartitionMetadata) + // AND` \ + // `(metadata.instance_partition.name:custom-instance-partition) AND` \ + // `(metadata.start_time < \"2021-03-28T14:50:00Z\") AND` \ + // `(error:*)` - Return operations where: + // * The operation's metadata type is + // [CreateInstancePartitionMetadata][google.spanner.admin.instance.v1.CreateInstancePartitionMetadata]. + // * The instance partition name contains "custom-instance-partition". + // * The operation started before 2021-03-28T14:50:00Z. + // * The operation resulted in an error. + string filter = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Number of operations to be returned in the response. If 0 or + // less, defaults to the server's maximum allowed page size. + int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If non-empty, `page_token` should contain a + // [next_page_token][google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse.next_page_token] + // from a previous + // [ListInstancePartitionOperationsResponse][google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse] + // to the same `parent` and with the same `filter`. + string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Deadline used while retrieving metadata for instance partition + // operations. Instance partitions whose operation metadata cannot be + // retrieved within this deadline will be added to + // [unreachable_instance_partitions][google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse.unreachable_instance_partitions] + // in + // [ListInstancePartitionOperationsResponse][google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse]. + google.protobuf.Timestamp instance_partition_deadline = 5 + [(google.api.field_behavior) = OPTIONAL]; +} + +// The response for +// [ListInstancePartitionOperations][google.spanner.admin.instance.v1.InstanceAdmin.ListInstancePartitionOperations]. +message ListInstancePartitionOperationsResponse { + // The list of matching instance partition long-running operations. Each + // operation's name will be + // prefixed by the instance partition's name. The operation's + // metadata field type + // `metadata.type_url` describes the type of the metadata. + repeated google.longrunning.Operation operations = 1; + + // `next_page_token` can be sent in a subsequent + // [ListInstancePartitionOperations][google.spanner.admin.instance.v1.InstanceAdmin.ListInstancePartitionOperations] + // call to fetch more of the matching metadata. + string next_page_token = 2; + + // The list of unreachable instance partitions. + // It includes the names of instance partitions whose operation metadata could + // not be retrieved within + // [instance_partition_deadline][google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest.instance_partition_deadline]. + repeated string unreachable_instance_partitions = 3; +} + +// The request for +// [MoveInstance][google.spanner.admin.instance.v1.InstanceAdmin.MoveInstance]. +message MoveInstanceRequest { + // Required. The instance to move. + // Values are of the form `projects//instances/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "spanner.googleapis.com/Instance" + } + ]; + + // Required. The target instance configuration where to move the instance. + // Values are of the form `projects//instanceConfigs/`. + string target_config = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "spanner.googleapis.com/InstanceConfig" + } + ]; +} + +// The response for +// [MoveInstance][google.spanner.admin.instance.v1.InstanceAdmin.MoveInstance]. +message MoveInstanceResponse {} + +// Metadata type for the operation returned by +// [MoveInstance][google.spanner.admin.instance.v1.InstanceAdmin.MoveInstance]. +message MoveInstanceMetadata { + // The target instance configuration where to move the instance. + // Values are of the form `projects//instanceConfigs/`. + string target_config = 1; + + // The progress of the + // [MoveInstance][google.spanner.admin.instance.v1.InstanceAdmin.MoveInstance] + // operation. + // [progress_percent][google.spanner.admin.instance.v1.OperationProgress.progress_percent] + // is reset when cancellation is requested. + OperationProgress progress = 2; + + // The time at which this operation was cancelled. + google.protobuf.Timestamp cancel_time = 3; +} diff --git a/owl-bot-staging/executor/v1/protos/google/spanner/executor/v1/cloud_executor.proto b/owl-bot-staging/executor/v1/protos/google/spanner/executor/v1/cloud_executor.proto new file mode 100644 index 000000000..cf68519ef --- /dev/null +++ b/owl-bot-staging/executor/v1/protos/google/spanner/executor/v1/cloud_executor.proto @@ -0,0 +1,1520 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.spanner.executor.v1; + +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; +import "google/spanner/admin/database/v1/backup.proto"; +import "google/spanner/admin/database/v1/common.proto"; +import "google/spanner/admin/database/v1/spanner_database_admin.proto"; +import "google/spanner/admin/instance/v1/spanner_instance_admin.proto"; +import "google/spanner/v1/spanner.proto"; +import "google/spanner/v1/type.proto"; + +option go_package = "cloud.google.com/go/spanner/executor/apiv1/executorpb;executorpb"; +option java_multiple_files = true; +option java_outer_classname = "CloudExecutorProto"; +option java_package = "com.google.spanner.executor.v1"; + +// Service that executes SpannerActions asynchronously. +service SpannerExecutorProxy { + option (google.api.default_host) = "spanner-cloud-executor.googleapis.com"; + + // ExecuteActionAsync is a streaming call that starts executing a new Spanner + // action. + // + // For each request, the server will reply with one or more responses, but + // only the last response will contain status in the outcome. + // + // Responses can be matched to requests by action_id. It is allowed to have + // multiple actions in flight--in that case, actions are be executed in + // parallel. + rpc ExecuteActionAsync(stream SpannerAsyncActionRequest) + returns (stream SpannerAsyncActionResponse) {} +} + +// Request to executor service that start a new Spanner action. +message SpannerAsyncActionRequest { + // Action id to uniquely identify this action request. + int32 action_id = 1; + + // The actual SpannerAction to perform. + SpannerAction action = 2; +} + +// Response from executor service. +message SpannerAsyncActionResponse { + // Action id corresponds to the request. + int32 action_id = 1; + + // If action results are split into multiple responses, only the last response + // can and should contain status. + SpannerActionOutcome outcome = 2; +} + +// SpannerAction defines a primitive action that can be performed against +// Spanner, such as begin or commit a transaction, or perform a read or +// mutation. +message SpannerAction { + // Database against which to perform action. + // In a context where a series of actions take place, an action may omit + // database path if it applies to the same database as the previous action. + string database_path = 1; + + // Configuration options for Spanner backend + SpannerOptions spanner_options = 2; + + // Action represents a spanner action kind, there will only be one action kind + // per SpannerAction. + oneof action { + // Action to start a transaction. + StartTransactionAction start = 10; + + // Action to finish a transaction. + FinishTransactionAction finish = 11; + + // Action to do a normal read. + ReadAction read = 20; + + // Action to do a query. + QueryAction query = 21; + + // Action to buffer a mutation. + MutationAction mutation = 22; + + // Action to a DML. + DmlAction dml = 23; + + // Action to a batch DML. + BatchDmlAction batch_dml = 24; + + // Action to write a mutation. + WriteMutationsAction write = 25; + + // Action to a partitioned update. + PartitionedUpdateAction partitioned_update = 27; + + // Action that contains any administrative operation, like database, + // instance manipulation. + AdminAction admin = 30; + + // Action to start a batch transaction. + StartBatchTransactionAction start_batch_txn = 40; + + // Action to close a batch transaction. + CloseBatchTransactionAction close_batch_txn = 41; + + // Action to generate database partitions for batch read. + GenerateDbPartitionsForReadAction generate_db_partitions_read = 42; + + // Action to generate database partitions for batch query. + GenerateDbPartitionsForQueryAction generate_db_partitions_query = 43; + + // Action to execute batch actions on generated partitions. + ExecutePartitionAction execute_partition = 44; + + // Action to execute change stream query. + ExecuteChangeStreamQuery execute_change_stream_query = 50; + + // Query cancellation action for testing the cancellation of a query. + QueryCancellationAction query_cancellation = 51; + } +} + +// A single read request. +message ReadAction { + // The table to read at. + string table = 1; + + // The index to read at if it's an index read. + optional string index = 2; + + // List of columns must begin with the key columns used for the read. + repeated string column = 3; + + // Keys for performing this read. + KeySet keys = 4; + + // Limit on number of rows to read. If set, must be positive. + int32 limit = 5; +} + +// A SQL query request. +message QueryAction { + // Parameter that bind to placeholders in the SQL string + message Parameter { + // Name of the parameter (with no leading @). + string name = 1; + + // Type of the parameter. + google.spanner.v1.Type type = 2; + + // Value of the parameter. + Value value = 3; + } + + // The SQL string. + string sql = 1; + + // Parameters for the SQL string. + repeated Parameter params = 2; +} + +// A single DML statement. +message DmlAction { + // DML statement. + QueryAction update = 1; + + // Whether to autocommit the transaction after executing the DML statement, + // if the Executor supports autocommit. + optional bool autocommit_if_supported = 2; +} + +// Batch of DML statements invoked using batched execution. +message BatchDmlAction { + // DML statements. + repeated QueryAction updates = 1; +} + +// Value represents a single value that can be read or written to/from +// Spanner. +message Value { + // Exactly one of the following fields will be present. + oneof value_type { + // If is_null is set, then this value is null. + bool is_null = 1; + + // Int type value. It's used for all integer number types, like int32 and + // int64. + int64 int_value = 2; + + // Bool type value. + bool bool_value = 3; + + // Double type value. It's used for all float point types, like float and + // double. + double double_value = 4; + + // Bytes type value, stored in CORD. It's also used for PROTO type value. + bytes bytes_value = 5; + + // String type value, stored in CORD. + string string_value = 6; + + // Struct type value. It contains a ValueList representing the values in + // this struct. + ValueList struct_value = 7; + + // Timestamp type value. + google.protobuf.Timestamp timestamp_value = 8; + + // Date type value. Date is specified as a number of days since Unix epoch. + int32 date_days_value = 9; + + // If set, holds the sentinel value for the transaction CommitTimestamp. + bool is_commit_timestamp = 10; + + // Array type value. The underlying Valuelist should have values that have + // the same type. + ValueList array_value = 11; + } + + // Type of array element. Only set if value is an array. + optional google.spanner.v1.Type array_type = 12; +} + +// KeyRange represents a range of rows in a table or index. +// +// A range has a start key and an end key. These keys can be open or +// closed, indicating if the range includes rows with that key. +// +// Keys are represented by "ValueList", where the ith value in the list +// corresponds to the ith component of the table or index primary key. +message KeyRange { + // Type controls whether "start" and "limit" are open or closed. By default, + // "start" is closed, and "limit" is open. + enum Type { + // "TYPE_UNSPECIFIED" is equivalent to "CLOSED_OPEN". + TYPE_UNSPECIFIED = 0; + + // [start,limit] + CLOSED_CLOSED = 1; + + // [start,limit) + CLOSED_OPEN = 2; + + // (start,limit] + OPEN_CLOSED = 3; + + // (start,limit) + OPEN_OPEN = 4; + } + + // "start" and "limit" must have the same number of key parts, + // though they may name only a prefix of the table or index key. + // The start key of this KeyRange. + ValueList start = 1; + + // The end key of this KeyRange. + ValueList limit = 2; + + // "start" and "limit" type for this KeyRange. + optional Type type = 3; +} + +// KeySet defines a collection of Spanner keys and/or key ranges. All +// the keys are expected to be in the same table. The keys need not be +// sorted in any particular way. +message KeySet { + // A list of specific keys. Entries in "keys" should have exactly as + // many elements as there are columns in the primary or index key + // with which this "KeySet" is used. + repeated ValueList point = 1; + + // A list of key ranges. + repeated KeyRange range = 2; + + // For convenience "all" can be set to "true" to indicate that this + // "KeySet" matches all keys in the table or index. Note that any keys + // specified in "keys" or "ranges" are only yielded once. + bool all = 3; +} + +// List of values. +message ValueList { + // Values contained in this ValueList. + repeated Value value = 1; +} + +// A single mutation request. +message MutationAction { + // Arguments to Insert, InsertOrUpdate, and Replace operations. + message InsertArgs { + // The names of the columns to be written. + repeated string column = 1; + + // Type information for the "values" entries below. + repeated google.spanner.v1.Type type = 2; + + // The values to be written. + repeated ValueList values = 3; + } + + // Arguments to Update. + message UpdateArgs { + // The columns to be updated. Identical to InsertArgs.column. + repeated string column = 1; + + // Type information for "values". Identical to InsertArgs.type. + repeated google.spanner.v1.Type type = 2; + + // The values to be updated. Identical to InsertArgs.values. + repeated ValueList values = 3; + } + + // Mod represents the write action that will be perform to a table. Each mod + // will specify exactly one action, from insert, update, insert_or_update, + // replace and delete. + message Mod { + // The table to write. + string table = 1; + + // Exactly one of the remaining elements may be present. + // Insert new rows into "table". + InsertArgs insert = 2; + + // Update columns stored in existing rows of "table". + UpdateArgs update = 3; + + // Insert or update existing rows of "table". + InsertArgs insert_or_update = 4; + + // Replace existing rows of "table". + InsertArgs replace = 5; + + // Delete rows from "table". + KeySet delete_keys = 6; + } + + // Mods that contained in this mutation. + repeated Mod mod = 1; +} + +// WriteMutationAction defines an action of flushing the mutation so they +// are visible to subsequent operations in the transaction. +message WriteMutationsAction { + // The mutation to write. + MutationAction mutation = 1; +} + +// PartitionedUpdateAction defines an action to execute a partitioned DML +// which runs different partitions in parallel. +message PartitionedUpdateAction { + message ExecutePartitionedUpdateOptions { + // RPC Priority + optional google.spanner.v1.RequestOptions.Priority rpc_priority = 1; + + // Transaction tag + optional string tag = 2; + } + + // Options for partitioned update. + optional ExecutePartitionedUpdateOptions options = 1; + + // Partitioned dml query. + QueryAction update = 2; +} + +// StartTransactionAction defines an action of initializing a transaction. +message StartTransactionAction { + // Concurrency is for read-only transactions and must be omitted for + // read-write transactions. + optional Concurrency concurrency = 1; + + // Metadata about tables and columns that will be involved in this + // transaction. It is to convert values of key parts correctly. + repeated TableMetadata table = 2; + + // Transaction_seed contains workid and op pair for this transaction, used for + // testing. + string transaction_seed = 3; + + // Execution options (e.g., whether transaction is opaque, optimistic). + optional TransactionExecutionOptions execution_options = 4; +} + +// Concurrency for read-only transactions. +message Concurrency { + // Concurrency mode set for read-only transactions, exactly one mode below + // should be set. + oneof concurrency_mode { + // Indicates a read at a consistent timestamp that is specified relative to + // now. That is, if the caller has specified an exact staleness of s + // seconds, we will read at now - s. + double staleness_seconds = 1; + + // Indicates a boundedly stale read that reads at a timestamp >= T. + int64 min_read_timestamp_micros = 2; + + // Indicates a boundedly stale read that is at most N seconds stale. + double max_staleness_seconds = 3; + + // Indicates a read at a consistent timestamp. + int64 exact_timestamp_micros = 4; + + // Indicates a strong read, must only be set to true, or unset. + bool strong = 5; + + // Indicates a batch read, must only be set to true, or unset. + bool batch = 6; + } + + // True if exact_timestamp_micros is set, and the chosen timestamp is that of + // a snapshot epoch. + bool snapshot_epoch_read = 7; + + // If set, this is a snapshot epoch read constrained to read only the + // specified log scope root table, and its children. Will not be set for full + // database epochs. + string snapshot_epoch_root_table = 8; + + // Set only when batch is true. + int64 batch_read_timestamp_micros = 9; +} + +// TableMetadata contains metadata of a single table. +message TableMetadata { + // Table name. + string name = 1; + + // Columns, in the same order as in the schema. + repeated ColumnMetadata column = 2; + + // Keys, in order. Column name is currently not populated. + repeated ColumnMetadata key_column = 3; +} + +// ColumnMetadata represents metadata of a single column. +message ColumnMetadata { + // Column name. + string name = 1; + + // Column type. + google.spanner.v1.Type type = 2; +} + +// Options for executing the transaction. +message TransactionExecutionOptions { + // Whether optimistic concurrency should be used to execute this transaction. + bool optimistic = 1; +} + +// FinishTransactionAction defines an action of finishing a transaction. +message FinishTransactionAction { + // Mode indicates how the transaction should be finished. + enum Mode { + // "MODE_UNSPECIFIED" is equivalent to "COMMIT". + MODE_UNSPECIFIED = 0; + + // Commit the transaction. + COMMIT = 1; + + // Drop the transaction without committing it. + ABANDON = 2; + } + + // Defines how exactly the transaction should be completed, e.g. with + // commit or abortion. + Mode mode = 1; +} + +// AdminAction defines all the cloud spanner admin actions, including +// instance/database admin ops, backup ops and operation actions. +message AdminAction { + // Exactly one of the actions below will be performed in AdminAction. + oneof action { + // Action that creates a user instance config. + CreateUserInstanceConfigAction create_user_instance_config = 1; + + // Action that updates a user instance config. + UpdateUserInstanceConfigAction update_user_instance_config = 2; + + // Action that deletes a user instance config. + DeleteUserInstanceConfigAction delete_user_instance_config = 3; + + // Action that gets a user instance config. + GetCloudInstanceConfigAction get_cloud_instance_config = 4; + + // Action that lists user instance configs. + ListCloudInstanceConfigsAction list_instance_configs = 5; + + // Action that creates a Cloud Spanner instance. + CreateCloudInstanceAction create_cloud_instance = 6; + + // Action that updates a Cloud Spanner instance. + UpdateCloudInstanceAction update_cloud_instance = 7; + + // Action that deletes a Cloud Spanner instance. + DeleteCloudInstanceAction delete_cloud_instance = 8; + + // Action that lists Cloud Spanner instances. + ListCloudInstancesAction list_cloud_instances = 9; + + // Action that retrieves a Cloud Spanner instance. + GetCloudInstanceAction get_cloud_instance = 10; + + // Action that creates a Cloud Spanner database. + CreateCloudDatabaseAction create_cloud_database = 11; + + // Action that updates the schema of a Cloud Spanner database. + UpdateCloudDatabaseDdlAction update_cloud_database_ddl = 12; + + // Action that updates the schema of a Cloud Spanner database. + UpdateCloudDatabaseAction update_cloud_database = 27; + + // Action that drops a Cloud Spanner database. + DropCloudDatabaseAction drop_cloud_database = 13; + + // Action that lists Cloud Spanner databases. + ListCloudDatabasesAction list_cloud_databases = 14; + + // Action that lists Cloud Spanner database operations. + ListCloudDatabaseOperationsAction list_cloud_database_operations = 15; + + // Action that restores a Cloud Spanner database from a backup. + RestoreCloudDatabaseAction restore_cloud_database = 16; + + // Action that gets a Cloud Spanner database. + GetCloudDatabaseAction get_cloud_database = 17; + + // Action that creates a Cloud Spanner database backup. + CreateCloudBackupAction create_cloud_backup = 18; + + // Action that copies a Cloud Spanner database backup. + CopyCloudBackupAction copy_cloud_backup = 19; + + // Action that gets a Cloud Spanner database backup. + GetCloudBackupAction get_cloud_backup = 20; + + // Action that updates a Cloud Spanner database backup. + UpdateCloudBackupAction update_cloud_backup = 21; + + // Action that deletes a Cloud Spanner database backup. + DeleteCloudBackupAction delete_cloud_backup = 22; + + // Action that lists Cloud Spanner database backups. + ListCloudBackupsAction list_cloud_backups = 23; + + // Action that lists Cloud Spanner database backup operations. + ListCloudBackupOperationsAction list_cloud_backup_operations = 24; + + // Action that gets an operation. + GetOperationAction get_operation = 25; + + // Action that cancels an operation. + CancelOperationAction cancel_operation = 26; + + // Action that changes quorum of a Cloud Spanner database. + ChangeQuorumCloudDatabaseAction change_quorum_cloud_database = 28; + } +} + +// Action that creates a user instance config. +message CreateUserInstanceConfigAction { + // User instance config ID (not path), e.g. "custom-config". + string user_config_id = 1; + + // Cloud project ID, e.g. "spanner-cloud-systest". + string project_id = 2; + + // Base config ID, e.g. "test-config". + string base_config_id = 3; + + // Replicas that should be included in the user config. + repeated google.spanner.admin.instance.v1.ReplicaInfo replicas = 4; +} + +// Action that updates a user instance config. +message UpdateUserInstanceConfigAction { + // User instance config ID (not path), e.g. "custom-config". + string user_config_id = 1; + + // Cloud project ID, e.g. "spanner-cloud-systest". + string project_id = 2; + + // The descriptive name for this instance config as it appears in UIs. + optional string display_name = 3; + + // labels. + map labels = 4; +} + +// Action that gets a user instance config. +message GetCloudInstanceConfigAction { + // Instance config ID (not path), e.g. "custom-config". + string instance_config_id = 1; + + // Cloud project ID, e.g. "spanner-cloud-systest". + string project_id = 2; +} + +// Action that deletes a user instance configs. +message DeleteUserInstanceConfigAction { + // User instance config ID (not path), e.g. "custom-config". + string user_config_id = 1; + + // Cloud project ID, e.g. "spanner-cloud-systest". + string project_id = 2; +} + +// Action that lists user instance configs. +message ListCloudInstanceConfigsAction { + // Cloud project ID, e.g. "spanner-cloud-systest". + string project_id = 1; + + // Number of instance configs to be returned in the response. If 0 or + // less, defaults to the server's maximum allowed page size. + optional int32 page_size = 2; + + // If non-empty, "page_token" should contain a next_page_token + // from a previous ListInstanceConfigsResponse to the same "parent". + optional string page_token = 3; +} + +// Action that creates a Cloud Spanner instance. +message CreateCloudInstanceAction { + // Cloud instance ID (not path), e.g. "test-instance". + string instance_id = 1; + + // Cloud project ID, e.g. "spanner-cloud-systest". + string project_id = 2; + + // Instance config ID, e.g. "test-config". + string instance_config_id = 3; + + // Number of nodes (processing_units should not be set or set to 0 if used). + optional int32 node_count = 4; + + // Number of processing units (node_count should be set to 0 if used). + optional int32 processing_units = 6; + + // The autoscaling config for this instance. If non-empty, an autoscaling + // instance will be created (processing_units and node_count should be set to + // 0 if used). + optional google.spanner.admin.instance.v1.AutoscalingConfig + autoscaling_config = 7; + + // labels. + map labels = 5; +} + +// Action that updates a Cloud Spanner instance. +message UpdateCloudInstanceAction { + // Cloud instance ID (not path), e.g. "test-instance". + string instance_id = 1; + + // Cloud project ID, e.g. "spanner-cloud-systest". + string project_id = 2; + + // The descriptive name for this instance as it appears in UIs. + // Must be unique per project and between 4 and 30 characters in length. + optional string display_name = 3; + + // The number of nodes allocated to this instance. At most one of either + // node_count or processing_units should be present in the message. + optional int32 node_count = 4; + + // The number of processing units allocated to this instance. At most one of + // processing_units or node_count should be present in the message. + optional int32 processing_units = 5; + + // The autoscaling config for this instance. If non-empty, this instance is + // using autoscaling (processing_units and node_count should be set to + // 0 if used). + optional google.spanner.admin.instance.v1.AutoscalingConfig + autoscaling_config = 7; + + // labels. + map labels = 6; +} + +// Action that deletes a Cloud Spanner instance. +message DeleteCloudInstanceAction { + // Cloud instance ID (not path), e.g. "test-instance". + string instance_id = 1; + + // Cloud project ID, e.g. "spanner-cloud-systest". + string project_id = 2; +} + +// Action that creates a Cloud Spanner database. +message CreateCloudDatabaseAction { + // Cloud instance ID (not path), e.g. "test-instance". + string instance_id = 1; + + // Cloud project ID, e.g. "spanner-cloud-systest". + string project_id = 2; + + // Cloud database ID (not full path), e.g. "db0". + string database_id = 3; + + // SDL statements to apply to the new database. + repeated string sdl_statement = 4; + + // The KMS key used to encrypt the database to be created if the database + // should be CMEK protected. + google.spanner.admin.database.v1.EncryptionConfig encryption_config = 5; + + // Optional SQL dialect (GOOGLESQL or POSTGRESQL). Default: GOOGLESQL. + optional string dialect = 6; + + optional bytes proto_descriptors = 7; +} + +// Action that updates the schema of a Cloud Spanner database. +message UpdateCloudDatabaseDdlAction { + // Cloud instance ID (not path), e.g. "test-instance". + string instance_id = 1; + + // Cloud project ID, e.g. "spanner-cloud-systest". + string project_id = 2; + + // Cloud database ID (not full path), e.g. "db0". + string database_id = 3; + + // SDL statements to apply to the database. + repeated string sdl_statement = 4; + + // Op ID can be used to track progress of the update. If set, it must be + // unique per database. If not set, Cloud Spanner will generate operation ID + // automatically. + string operation_id = 5; + + optional bytes proto_descriptors = 6; +} + +// Action that updates a Cloud Spanner database. +message UpdateCloudDatabaseAction { + // Cloud instance ID (not path), e.g. "test-instance". + string instance_id = 1; + + // Cloud project ID, e.g. "spanner-cloud-systest". + string project_id = 2; + + // Cloud database name (not full path), e.g. "db0". + string database_name = 3; + + // Updated value of enable_drop_protection, this is the only field that has + // supported to be updated. + bool enable_drop_protection = 4; +} + +// Action that drops a Cloud Spanner database. +message DropCloudDatabaseAction { + // Cloud instance ID (not path), e.g. "test-instance". + string instance_id = 1; + + // Cloud project ID, e.g. "spanner-cloud-systest". + string project_id = 2; + + // Cloud database ID (not full path), e.g. "db0". + string database_id = 3; +} + +// Action that changes quorum of a Cloud Spanner database. +message ChangeQuorumCloudDatabaseAction { + // The fully qualified uri of the database whose quorum has to be changed. + optional string database_uri = 1; + + // The locations of the serving regions, e.g. "asia-south1". + repeated string serving_locations = 2; +} + +// Action that lists Cloud Spanner databases. +message ListCloudDatabasesAction { + // Cloud project ID, e.g. "spanner-cloud-systest". + string project_id = 1; + + // Cloud instance ID (not path) to list databases from, e.g. "test-instance". + string instance_id = 2; + + // Number of databases to be returned in the response. If 0 or + // less, defaults to the server's maximum allowed page size. + int32 page_size = 3; + + // If non-empty, "page_token" should contain a next_page_token + // from a previous ListDatabasesResponse to the same "parent" + // and with the same "filter". + string page_token = 4; +} + +// Action that lists Cloud Spanner databases. +message ListCloudInstancesAction { + // Cloud project ID, e.g. "spanner-cloud-systest". + string project_id = 1; + + // A filter expression that filters what operations are returned in the + // response. + // The expression must specify the field name, a comparison operator, + // and the value that you want to use for filtering. + // Refer spanner_instance_admin.proto.ListInstancesRequest for + // detail. + optional string filter = 2; + + // Number of instances to be returned in the response. If 0 or + // less, defaults to the server's maximum allowed page size. + optional int32 page_size = 3; + + // If non-empty, "page_token" should contain a next_page_token + // from a previous ListInstancesResponse to the same "parent" + // and with the same "filter". + optional string page_token = 4; +} + +// Action that retrieves a Cloud Spanner instance. +message GetCloudInstanceAction { + // Cloud project ID, e.g. "spanner-cloud-systest". + string project_id = 1; + + // Cloud instance ID (not path) to retrieve the instance from, + // e.g. "test-instance". + string instance_id = 2; +} + +// Action that lists Cloud Spanner database operations. +message ListCloudDatabaseOperationsAction { + // Cloud project ID, e.g. "spanner-cloud-systest". + string project_id = 1; + + // Cloud instance ID (not path) to list database operations from, + // e.g. "test-instance". + string instance_id = 2; + + // A filter expression that filters what operations are returned in the + // response. + // The expression must specify the field name, a comparison operator, + // and the value that you want to use for filtering. + // Refer spanner_database_admin.proto.ListDatabaseOperationsRequest for + // detail. + string filter = 3; + + // Number of databases to be returned in the response. If 0 or + // less, defaults to the server's maximum allowed page size. + int32 page_size = 4; + + // If non-empty, "page_token" should contain a next_page_token + // from a previous ListDatabaseOperationsResponse to the same "parent" + // and with the same "filter". + string page_token = 5; +} + +// Action that restores a Cloud Spanner database from a backup. +message RestoreCloudDatabaseAction { + // Cloud project ID, e.g. "spanner-cloud-systest". + string project_id = 1; + + // Cloud instance ID (not path) containing the backup, e.g. "backup-instance". + string backup_instance_id = 2; + + // The id of the backup from which to restore, e.g. "test-backup". + string backup_id = 3; + + // Cloud instance ID (not path) containing the database, e.g. + // "database-instance". + string database_instance_id = 4; + + // The id of the database to create and restore to, e.g. "db0". Note that this + // database must not already exist. + string database_id = 5; + + // The KMS key(s) used to encrypt the restored database to be created if the + // restored database should be CMEK protected. + google.spanner.admin.database.v1.EncryptionConfig encryption_config = 7; +} + +// Action that gets a Cloud Spanner database. +message GetCloudDatabaseAction { + // Cloud project ID, e.g. "spanner-cloud-systest". + string project_id = 1; + + // Cloud instance ID (not path), e.g. "test-instance". + string instance_id = 2; + + // The id of the database to get, e.g. "db0". + string database_id = 3; +} + +// Action that creates a Cloud Spanner database backup. +message CreateCloudBackupAction { + // Cloud project ID, e.g. "spanner-cloud-systest". + string project_id = 1; + + // Cloud instance ID (not path), e.g. "test-instance". + string instance_id = 2; + + // The id of the backup to be created, e.g. "test-backup". + string backup_id = 3; + + // The id of the database from which this backup was + // created, e.g. "db0". Note that this needs to be in the + // same instance as the backup. + string database_id = 4; + + // Output only. The expiration time of the backup, which must be at least 6 + // hours and at most 366 days from the time the request is received. + google.protobuf.Timestamp expire_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The version time of the backup, which must be within the time range of + // [earliest_version_time, NOW], where earliest_version_time is retrieved by + // cloud spanner frontend API (See details: go/cs-pitr-lite-design). + optional google.protobuf.Timestamp version_time = 6; + + // The KMS key(s) used to encrypt the backup to be created if the backup + // should be CMEK protected. + google.spanner.admin.database.v1.EncryptionConfig encryption_config = 7; +} + +// Action that copies a Cloud Spanner database backup. +message CopyCloudBackupAction { + // Cloud project ID, e.g. "spanner-cloud-systest". + string project_id = 1; + + // Cloud instance ID (not path), e.g. "test-instance". + string instance_id = 2; + + // The id of the backup to be created, e.g. "test-backup". + string backup_id = 3; + + // The fully qualified uri of the source backup from which this + // backup was copied. eg. + // "projects//instances//backups/". + string source_backup = 4; + + // Output only. The expiration time of the backup, which must be at least 6 + // hours and at most 366 days from the time the request is received. + google.protobuf.Timestamp expire_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Action that gets a Cloud Spanner database backup. +message GetCloudBackupAction { + // Cloud project ID, e.g. "spanner-cloud-systest". + string project_id = 1; + + // Cloud instance ID (not path), e.g. "test-instance". + string instance_id = 2; + + // The id of the backup to get, e.g. "test-backup". + string backup_id = 3; +} + +// Action that updates a Cloud Spanner database backup. +message UpdateCloudBackupAction { + // Cloud project ID, e.g. "spanner-cloud-systest". + string project_id = 1; + + // Cloud instance ID (not path), e.g. "test-instance". + string instance_id = 2; + + // The id of the backup to update, e.g. "test-backup". + string backup_id = 3; + + // Output only. Updated value of expire_time, this is the only field + // that supported to be updated. + google.protobuf.Timestamp expire_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Action that deletes a Cloud Spanner database backup. +message DeleteCloudBackupAction { + // Cloud project ID, e.g. "spanner-cloud-systest". + string project_id = 1; + + // Cloud instance ID (not path), e.g. "test-instance". + string instance_id = 2; + + // The id of the backup to delete, e.g. "test-backup". + string backup_id = 3; +} + +// Action that lists Cloud Spanner database backups. +message ListCloudBackupsAction { + // Cloud project ID, e.g. "spanner-cloud-systest". + string project_id = 1; + + // Cloud instance ID (not path) to list backups from, e.g. "test-instance". + string instance_id = 2; + + // A filter expression that filters backups listed in the response. + // The expression must specify the field name, a comparison operator, + // and the value that you want to use for filtering. + // Refer backup.proto.ListBackupsRequest for detail. + string filter = 3; + + // Number of backups to be returned in the response. If 0 or + // less, defaults to the server's maximum allowed page size. + int32 page_size = 4; + + // If non-empty, "page_token" should contain a next_page_token + // from a previous ListBackupsResponse to the same "parent" + // and with the same "filter". + string page_token = 5; +} + +// Action that lists Cloud Spanner database backup operations. +message ListCloudBackupOperationsAction { + // Cloud project ID, e.g. "spanner-cloud-systest". + string project_id = 1; + + // Cloud instance ID (not path) to list backup operations from, + // e.g. "test-instance". + string instance_id = 2; + + // A filter expression that filters what operations are returned in the + // response. + // The expression must specify the field name, a comparison operator, + // and the value that you want to use for filtering. + // Refer backup.proto.ListBackupOperationsRequest for detail. + string filter = 3; + + // Number of backups to be returned in the response. If 0 or + // less, defaults to the server's maximum allowed page size. + int32 page_size = 4; + + // If non-empty, "page_token" should contain a next_page_token + // from a previous ListBackupOperationsResponse to the same "parent" + // and with the same "filter". + string page_token = 5; +} + +// Action that gets an operation. +message GetOperationAction { + // The name of the operation resource. + string operation = 1; +} + +// Query cancellation action defines the long running query and the cancel query +// format depening on the Cloud database dialect. +message QueryCancellationAction { + // Long running query. + string long_running_sql = 1; + + // Format of the cancel query for the cloud database dialect. + string cancel_query = 2; +} + +// Action that cancels an operation. +message CancelOperationAction { + // The name of the operation resource to be cancelled. + string operation = 1; +} + +// Starts a batch read-only transaction in executor. Successful outcomes of this +// action will contain batch_txn_id--the identificator that can be used to start +// the same transaction in other Executors to parallelize partition processing. +// +// Example of a batch read flow: +// 1. Start batch transaction with a timestamp (StartBatchTransactionAction) +// 2. Generate database partitions for a read or query +// (GenerateDbPartitionsForReadAction/GenerateDbPartitionsForQueryAction) +// 3. Call ExecutePartitionAction for some or all partitions, process rows +// 4. Clean up the transaction (CloseBatchTransactionAction). +// +// More sophisticated example, with parallel processing: +// 1. Start batch transaction with a timestamp (StartBatchTransactionAction), +// note the returned BatchTransactionId +// 2. Generate database partitions for a read or query +// (GenerateDbPartitionsForReadAction/GenerateDbPartitionsForQueryAction) +// 3. Distribute the partitions over a pool of workers, along with the +// transaction ID. +// +// In each worker: +// 4-1. StartBatchTransactionAction with the given transaction ID +// 4-2. ExecutePartitionAction for each partition it got, process read results +// 4-3. Close (not cleanup) the transaction (CloseBatchTransactionAction). +// +// When all workers are done: +// 5. Cleanup the transaction (CloseBatchTransactionAction). This can be done +// either by the last worker to finish the job, or by the main Executor that +// initialized this transaction in the first place. It is also possible to clean +// it up with a brand new Executor -- just execute StartBatchTransactionAction +// with the ID, then clean it up right away. +// +// Cleaning up is optional, but recommended. +message StartBatchTransactionAction { + // To start a new transaction, specify an exact timestamp. Alternatively, an + // existing batch transaction ID can be used. Either one of two must be + // set. + oneof param { + // The exact timestamp to start the batch transaction. + google.protobuf.Timestamp batch_txn_time = 1; + + // ID of a batch read-only transaction. It can be used to start the same + // batch transaction on multiple executors and parallelize partition + // processing. + bytes tid = 2; + } + + // Database role to assume while performing this action. Setting the + // database_role will enforce additional role-based access checks on this + // action. + string cloud_database_role = 3; +} + +// Closes or cleans up the currently opened batch read-only transaction. +// +// Once a transaction is closed, the Executor can be disposed of or used to +// start start another transaction. Closing a batch transaction in one Executor +// doesn't affect the transaction's state in other Executors that also read from +// it. +// +// When a transaction is cleaned up, it becomes globally invalid. Cleaning up is +// optional, but recommended. +message CloseBatchTransactionAction { + // Indicates whether the transaction needs to be cleaned up. + bool cleanup = 1; +} + +// Generate database partitions for the given read. Successful outcomes will +// contain database partitions in the db_partition field. +message GenerateDbPartitionsForReadAction { + // Read to generate partitions for. + ReadAction read = 1; + + // Metadata related to the tables involved in the read. + repeated TableMetadata table = 2; + + // Desired size of data in each partition. Spanner doesn't guarantee to + // respect this value. + optional int64 desired_bytes_per_partition = 3; + + // If set, the desired max number of partitions. Spanner doesn't guarantee to + // respect this value. + optional int64 max_partition_count = 4; +} + +// Generate database partitions for the given query. Successful outcomes will +// contain database partitions in the db_partition field. +message GenerateDbPartitionsForQueryAction { + // Query to generate partitions for. + QueryAction query = 1; + + // Desired size of data in each partition. Spanner doesn't guarantee to + // respect this value. + optional int64 desired_bytes_per_partition = 2; +} + +// Identifies a database partition generated for a particular read or query. To +// read rows from the partition, use ExecutePartitionAction. +message BatchPartition { + // Serialized Partition instance. + bytes partition = 1; + + // The partition token decrypted from partition. + bytes partition_token = 2; + + // Table name is set iff the partition was generated for a read (as opposed to + // a query). + optional string table = 3; + + // Index name if the partition was generated for an index read. + optional string index = 4; +} + +// Performs a read or query for the given partitions. This action must be +// executed in the context of the same transaction that was used to generate +// given partitions. +message ExecutePartitionAction { + // Batch partition to execute on. + BatchPartition partition = 1; +} + +// Execute a change stream TVF query. +message ExecuteChangeStreamQuery { + // Name for this change stream. + string name = 1; + + // Specifies that records with commit_timestamp greater than or equal to + // start_time should be returned. + google.protobuf.Timestamp start_time = 2; + + // Specifies that records with commit_timestamp less than or equal to + // end_time should be returned. + optional google.protobuf.Timestamp end_time = 3; + + // Specifies which change stream partition to query, based on the content of + // child partitions records. + optional string partition_token = 4; + + // Read options for this change stream query. + repeated string read_options = 5; + + // Determines how frequently a heartbeat ChangeRecord will be returned in case + // there are no transactions committed in this partition, in milliseconds. + optional int32 heartbeat_milliseconds = 6; + + // Deadline for this change stream query, in seconds. + optional int64 deadline_seconds = 7; + + // Database role to assume while performing this action. This should only be + // set for cloud requests. Setting the database role will enforce additional + // role-based access checks on this action. + optional string cloud_database_role = 8; +} + +// SpannerActionOutcome defines a result of execution of a single SpannerAction. +message SpannerActionOutcome { + // If an outcome is split into multiple parts, status will be set only in the + // last part. + optional google.rpc.Status status = 1; + + // Transaction timestamp. It must be set for successful committed actions. + optional google.protobuf.Timestamp commit_time = 2; + + // Result of a ReadAction. This field must be set for ReadActions even if + // no rows were read. + optional ReadResult read_result = 3; + + // Result of a Query. This field must be set for Queries even if no rows were + // read. + optional QueryResult query_result = 4; + + // This bit indicates that Spanner has restarted the current transaction. It + // means that the client should replay all the reads and writes. + // Setting it to true is only valid in the context of a read-write + // transaction, as an outcome of a committing FinishTransactionAction. + optional bool transaction_restarted = 5; + + // In successful StartBatchTransactionAction outcomes, this contains the ID of + // the transaction. + optional bytes batch_txn_id = 6; + + // Generated database partitions (result of a + // GenetageDbPartitionsForReadAction/GenerateDbPartitionsForQueryAction). + repeated BatchPartition db_partition = 7; + + // Result of admin related actions. + optional AdminResult admin_result = 8; + + // Stores rows modified by query in single DML or batch DML action. + // In case of batch DML action, stores 0 as row count of errored DML query. + repeated int64 dml_rows_modified = 9; + + // Change stream records returned by a change stream query. + repeated ChangeStreamRecord change_stream_records = 10; +} + +// AdminResult contains admin action results, for database/backup/operation. +message AdminResult { + // Results of cloud backup related actions. + CloudBackupResponse backup_response = 1; + + // Results of operation related actions. + OperationResponse operation_response = 2; + + // Results of database related actions. + CloudDatabaseResponse database_response = 3; + + // Results of instance related actions. + CloudInstanceResponse instance_response = 4; + + // Results of instance config related actions. + CloudInstanceConfigResponse instance_config_response = 5; +} + +// CloudBackupResponse contains results returned by cloud backup related +// actions. +message CloudBackupResponse { + // List of backups returned by ListCloudBackupsAction. + repeated google.spanner.admin.database.v1.Backup listed_backups = 1; + + // List of operations returned by ListCloudBackupOperationsAction. + repeated google.longrunning.Operation listed_backup_operations = 2; + + // "next_page_token" can be sent in a subsequent list action + // to fetch more of the matching data. + string next_page_token = 3; + + // Backup returned by GetCloudBackupAction/UpdateCloudBackupAction. + google.spanner.admin.database.v1.Backup backup = 4; +} + +// OperationResponse contains results returned by operation related actions. +message OperationResponse { + // List of operations returned by ListOperationsAction. + repeated google.longrunning.Operation listed_operations = 1; + + // "next_page_token" can be sent in a subsequent list action + // to fetch more of the matching data. + string next_page_token = 2; + + // Operation returned by GetOperationAction. + google.longrunning.Operation operation = 3; +} + +// CloudInstanceResponse contains results returned by cloud instance related +// actions. +message CloudInstanceResponse { + // List of instances returned by ListCloudInstancesAction. + repeated google.spanner.admin.instance.v1.Instance listed_instances = 1; + + // "next_page_token" can be sent in a subsequent list action + // to fetch more of the matching data. + string next_page_token = 2; + + // Instance returned by GetCloudInstanceAction + google.spanner.admin.instance.v1.Instance instance = 3; +} + +// CloudInstanceConfigResponse contains results returned by cloud instance +// config related actions. +message CloudInstanceConfigResponse { + // List of instance configs returned by ListCloudInstanceConfigsAction. + repeated google.spanner.admin.instance.v1.InstanceConfig + listed_instance_configs = 1; + + // "next_page_token" can be sent in a subsequent list action + // to fetch more of the matching data. + string next_page_token = 2; + + // Instance config returned by GetCloudInstanceConfigAction. + google.spanner.admin.instance.v1.InstanceConfig instance_config = 3; +} + +// CloudDatabaseResponse contains results returned by cloud database related +// actions. +message CloudDatabaseResponse { + // List of databases returned by ListCloudDatabasesAction. + repeated google.spanner.admin.database.v1.Database listed_databases = 1; + + // List of operations returned by ListCloudDatabaseOperationsAction. + repeated google.longrunning.Operation listed_database_operations = 2; + + // "next_page_token" can be sent in a subsequent list action + // to fetch more of the matching data. + string next_page_token = 3; + + // Database returned by GetCloudDatabaseAction + google.spanner.admin.database.v1.Database database = 4; +} + +// ReadResult contains rows read. +message ReadResult { + // Table name. + string table = 1; + + // Index name, if read from an index. + optional string index = 2; + + // Request index (multiread only). + optional int32 request_index = 3; + + // Rows read. Each row is a struct with multiple fields, one for each column + // in read result. All rows have the same type. + repeated ValueList row = 4; + + // The type of rows read. It must be set if at least one row was read. + optional google.spanner.v1.StructType row_type = 5; +} + +// QueryResult contains result of a Query. +message QueryResult { + // Rows read. Each row is a struct with multiple fields, one for each column + // in read result. All rows have the same type. + repeated ValueList row = 1; + + // The type of rows read. It must be set if at least one row was read. + optional google.spanner.v1.StructType row_type = 2; +} + +// Raw ChangeStream records. +// Encodes one of: DataChangeRecord, HeartbeatRecord, ChildPartitionsRecord +// returned from the ChangeStream API. +message ChangeStreamRecord { + // Record represents one type of the change stream record. + oneof record { + // Data change record. + DataChangeRecord data_change = 1; + + // Child partitions record. + ChildPartitionsRecord child_partition = 2; + + // Heartbeat record. + HeartbeatRecord heartbeat = 3; + } +} + +// ChangeStream data change record. +message DataChangeRecord { + // Column types. + message ColumnType { + // Column name. + string name = 1; + + // Column type in JSON. + string type = 2; + + // Whether the column is a primary key column. + bool is_primary_key = 3; + + // The position of the column as defined in the schema. + int64 ordinal_position = 4; + } + + // Describes the changes that were made. + message Mod { + // The primary key values in JSON. + string keys = 1; + + // The new values of the changed columns in JSON. Only contain the non-key + // columns. + string new_values = 2; + + // The old values of the changed columns in JSON. Only contain the non-key + // columns. + string old_values = 3; + } + + // The timestamp in which the change was committed. + google.protobuf.Timestamp commit_time = 1; + + // The sequence number for the record within the transaction. + string record_sequence = 2; + + // A globally unique string that represents the transaction in which the + // change was committed. + string transaction_id = 3; + + // Indicates whether this is the last record for a transaction in the current + // partition. + bool is_last_record = 4; + + // Name of the table affected by the change. + string table = 5; + + // Column types defined in the schema. + repeated ColumnType column_types = 6; + + // Changes made in the transaction. + repeated Mod mods = 7; + + // Describes the type of change. One of INSERT, UPDATE or DELETE. + string mod_type = 8; + + // One of value capture type: NEW_VALUES, OLD_VALUES, OLD_AND_NEW_VALUES. + string value_capture_type = 9; + + // Number of records in transactions. + int64 record_count = 10; + + // Number of partitions in transactions. + int64 partition_count = 11; + + // Transaction tag info. + string transaction_tag = 12; + + // Whether the transaction is a system transactionn. + bool is_system_transaction = 13; +} + +// ChangeStream child partition record. +message ChildPartitionsRecord { + // A single child partition. + message ChildPartition { + // Partition token string used to identify the child partition in queries. + string token = 1; + + // Parent partition tokens of this child partition. + repeated string parent_partition_tokens = 2; + } + + // Data change records returned from child partitions in this child partitions + // record will have a commit timestamp greater than or equal to start_time. + google.protobuf.Timestamp start_time = 1; + + // A monotonically increasing sequence number that can be used to define the + // ordering of the child partitions record when there are multiple child + // partitions records returned with the same start_time in a particular + // partition. + string record_sequence = 2; + + // A set of child partitions and their associated information. + repeated ChildPartition child_partitions = 3; +} + +// ChangeStream heartbeat record. +message HeartbeatRecord { + // Timestamp for this heartbeat check. + google.protobuf.Timestamp heartbeat_time = 1; +} + +// Options for Cloud Spanner Service. +message SpannerOptions { + // Options for configuring the session pool + SessionPoolOptions session_pool_options = 1; +} + +// Options for the session pool used by the DatabaseClient. +message SessionPoolOptions { + // passing this as true, will make applicable RPCs use multiplexed sessions + // instead of regular sessions + bool use_multiplexed = 1; +} diff --git a/owl-bot-staging/executor/v1/protos/google/spanner/v1/change_stream.proto b/owl-bot-staging/executor/v1/protos/google/spanner/v1/change_stream.proto new file mode 100644 index 000000000..e7d12e608 --- /dev/null +++ b/owl-bot-staging/executor/v1/protos/google/spanner/v1/change_stream.proto @@ -0,0 +1,451 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.spanner.v1; + +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; +import "google/spanner/v1/type.proto"; + +option csharp_namespace = "Google.Cloud.Spanner.V1"; +option go_package = "cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb"; +option java_multiple_files = true; +option java_outer_classname = "ChangeStreamProto"; +option java_package = "com.google.spanner.v1"; +option php_namespace = "Google\\Cloud\\Spanner\\V1"; +option ruby_package = "Google::Cloud::Spanner::V1"; + +// Spanner Change Streams enable customers to capture and stream out changes to +// their Spanner databases in real-time. A change stream +// can be created with option partition_mode='IMMUTABLE_KEY_RANGE' or +// partition_mode='MUTABLE_KEY_RANGE'. +// +// This message is only used in Change Streams created with the option +// partition_mode='MUTABLE_KEY_RANGE'. Spanner automatically creates a special +// Table-Valued Function (TVF) along with each Change Streams. The function +// provides access to the change stream's records. The function is named +// READ_ (where is the +// name of the change stream), and it returns a table with only one column +// called ChangeRecord. +message ChangeStreamRecord { + // A data change record contains a set of changes to a table with the same + // modification type (insert, update, or delete) committed at the same commit + // timestamp in one change stream partition for the same transaction. Multiple + // data change records can be returned for the same transaction across + // multiple change stream partitions. + message DataChangeRecord { + // Metadata for a column. + message ColumnMetadata { + // Name of the column. + string name = 1; + + // Type of the column. + Type type = 2; + + // Indicates whether the column is a primary key column. + bool is_primary_key = 3; + + // Ordinal position of the column based on the original table definition + // in the schema starting with a value of 1. + int64 ordinal_position = 4; + } + + // Returns the value and associated metadata for a particular field of the + // [Mod][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod]. + message ModValue { + // Index within the repeated + // [column_metadata][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.column_metadata] + // field, to obtain the column metadata for the column that was modified. + int32 column_metadata_index = 1; + + // The value of the column. + google.protobuf.Value value = 2; + } + + // A mod describes all data changes in a watched table row. + message Mod { + // Returns the value of the primary key of the modified row. + repeated ModValue keys = 1; + + // Returns the old values before the change for the modified columns. + // Always empty for + // [INSERT][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType.INSERT], + // or if old values are not being captured specified by + // [value_capture_type][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ValueCaptureType]. + repeated ModValue old_values = 2; + + // Returns the new values after the change for the modified columns. + // Always empty for + // [DELETE][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType.DELETE]. + repeated ModValue new_values = 3; + } + + // Mod type describes the type of change Spanner applied to the data. For + // example, if the client submits an INSERT_OR_UPDATE request, Spanner will + // perform an insert if there is no existing row and return ModType INSERT. + // Alternatively, if there is an existing row, Spanner will perform an + // update and return ModType UPDATE. + enum ModType { + // Not specified. + MOD_TYPE_UNSPECIFIED = 0; + + // Indicates data was inserted. + INSERT = 10; + + // Indicates existing data was updated. + UPDATE = 20; + + // Indicates existing data was deleted. + DELETE = 30; + } + + // Value capture type describes which values are recorded in the data + // change record. + enum ValueCaptureType { + // Not specified. + VALUE_CAPTURE_TYPE_UNSPECIFIED = 0; + + // Records both old and new values of the modified watched columns. + OLD_AND_NEW_VALUES = 10; + + // Records only new values of the modified watched columns. + NEW_VALUES = 20; + + // Records new values of all watched columns, including modified and + // unmodified columns. + NEW_ROW = 30; + + // Records the new values of all watched columns, including modified and + // unmodified columns. Also records the old values of the modified + // columns. + NEW_ROW_AND_OLD_VALUES = 40; + } + + // Indicates the timestamp in which the change was committed. + // DataChangeRecord.commit_timestamps, + // PartitionStartRecord.start_timestamps, + // PartitionEventRecord.commit_timestamps, and + // PartitionEndRecord.end_timestamps can have the same value in the same + // partition. + google.protobuf.Timestamp commit_timestamp = 1; + + // Record sequence numbers are unique and monotonically increasing (but not + // necessarily contiguous) for a specific timestamp across record + // types in the same partition. To guarantee ordered processing, the reader + // should process records (of potentially different types) in + // record_sequence order for a specific timestamp in the same partition. + // + // The record sequence number ordering across partitions is only meaningful + // in the context of a specific transaction. Record sequence numbers are + // unique across partitions for a specific transaction. Sort the + // DataChangeRecords for the same + // [server_transaction_id][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.server_transaction_id] + // by + // [record_sequence][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.record_sequence] + // to reconstruct the ordering of the changes within the transaction. + string record_sequence = 2; + + // Provides a globally unique string that represents the transaction in + // which the change was committed. Multiple transactions can have the same + // commit timestamp, but each transaction has a unique + // server_transaction_id. + string server_transaction_id = 3; + + // Indicates whether this is the last record for a transaction in the + // current partition. Clients can use this field to determine when all + // records for a transaction in the current partition have been received. + bool is_last_record_in_transaction_in_partition = 4; + + // Name of the table affected by the change. + string table = 5; + + // Provides metadata describing the columns associated with the + // [mods][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.mods] listed + // below. + repeated ColumnMetadata column_metadata = 6; + + // Describes the changes that were made. + repeated Mod mods = 7; + + // Describes the type of change. + ModType mod_type = 8; + + // Describes the value capture type that was specified in the change stream + // configuration when this change was captured. + ValueCaptureType value_capture_type = 9; + + // Indicates the number of data change records that are part of this + // transaction across all change stream partitions. This value can be used + // to assemble all the records associated with a particular transaction. + int32 number_of_records_in_transaction = 10; + + // Indicates the number of partitions that return data change records for + // this transaction. This value can be helpful in assembling all records + // associated with a particular transaction. + int32 number_of_partitions_in_transaction = 11; + + // Indicates the transaction tag associated with this transaction. + string transaction_tag = 12; + + // Indicates whether the transaction is a system transaction. System + // transactions include those issued by time-to-live (TTL), column backfill, + // etc. + bool is_system_transaction = 13; + } + + // A heartbeat record is returned as a progress indicator, when there are no + // data changes or any other partition record types in the change stream + // partition. + message HeartbeatRecord { + // Indicates the timestamp at which the query has returned all the records + // in the change stream partition with timestamp <= heartbeat timestamp. + // The heartbeat timestamp will not be the same as the timestamps of other + // record types in the same partition. + google.protobuf.Timestamp timestamp = 1; + } + + // A partition start record serves as a notification that the client should + // schedule the partitions to be queried. PartitionStartRecord returns + // information about one or more partitions. + message PartitionStartRecord { + // Start timestamp at which the partitions should be queried to return + // change stream records with timestamps >= start_timestamp. + // DataChangeRecord.commit_timestamps, + // PartitionStartRecord.start_timestamps, + // PartitionEventRecord.commit_timestamps, and + // PartitionEndRecord.end_timestamps can have the same value in the same + // partition. + google.protobuf.Timestamp start_timestamp = 1; + + // Record sequence numbers are unique and monotonically increasing (but not + // necessarily contiguous) for a specific timestamp across record + // types in the same partition. To guarantee ordered processing, the reader + // should process records (of potentially different types) in + // record_sequence order for a specific timestamp in the same partition. + string record_sequence = 2; + + // Unique partition identifiers to be used in queries. + repeated string partition_tokens = 3; + } + + // A partition end record serves as a notification that the client should stop + // reading the partition. No further records are expected to be retrieved on + // it. + message PartitionEndRecord { + // End timestamp at which the change stream partition is terminated. All + // changes generated by this partition will have timestamps <= + // end_timestamp. DataChangeRecord.commit_timestamps, + // PartitionStartRecord.start_timestamps, + // PartitionEventRecord.commit_timestamps, and + // PartitionEndRecord.end_timestamps can have the same value in the same + // partition. PartitionEndRecord is the last record returned for a + // partition. + google.protobuf.Timestamp end_timestamp = 1; + + // Record sequence numbers are unique and monotonically increasing (but not + // necessarily contiguous) for a specific timestamp across record + // types in the same partition. To guarantee ordered processing, the reader + // should process records (of potentially different types) in + // record_sequence order for a specific timestamp in the same partition. + string record_sequence = 2; + + // Unique partition identifier describing the terminated change stream + // partition. + // [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEndRecord.partition_token] + // is equal to the partition token of the change stream partition currently + // queried to return this PartitionEndRecord. + string partition_token = 3; + } + + // A partition event record describes key range changes for a change stream + // partition. The changes to a row defined by its primary key can be captured + // in one change stream partition for a specific time range, and then be + // captured in a different change stream partition for a different time range. + // This movement of key ranges across change stream partitions is a reflection + // of activities, such as Spanner's dynamic splitting and load balancing, etc. + // Processing this event is needed if users want to guarantee processing of + // the changes for any key in timestamp order. If time ordered processing of + // changes for a primary key is not needed, this event can be ignored. + // To guarantee time ordered processing for each primary key, if the event + // describes move-ins, the reader of this partition needs to wait until the + // readers of the source partitions have processed all records with timestamps + // <= this PartitionEventRecord.commit_timestamp, before advancing beyond this + // PartitionEventRecord. If the event describes move-outs, the reader can + // notify the readers of the destination partitions that they can continue + // processing. + message PartitionEventRecord { + // Describes move-in of the key ranges into the change stream partition + // identified by + // [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token]. + // + // To maintain processing the changes for a particular key in timestamp + // order, the query processing the change stream partition identified by + // [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token] + // should not advance beyond the partition event record commit timestamp + // until the queries processing the source change stream partitions have + // processed all change stream records with timestamps <= the partition + // event record commit timestamp. + message MoveInEvent { + // An unique partition identifier describing the source change stream + // partition that recorded changes for the key range that is moving + // into this partition. + string source_partition_token = 1; + } + + // Describes move-out of the key ranges out of the change stream partition + // identified by + // [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token]. + // + // To maintain processing the changes for a particular key in timestamp + // order, the query processing the + // [MoveOutEvent][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent] + // in the partition identified by + // [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token] + // should inform the queries processing the destination partitions that + // they can unblock and proceed processing records past the + // [commit_timestamp][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.commit_timestamp]. + message MoveOutEvent { + // An unique partition identifier describing the destination change + // stream partition that will record changes for the key range that is + // moving out of this partition. + string destination_partition_token = 1; + } + + // Indicates the commit timestamp at which the key range change occurred. + // DataChangeRecord.commit_timestamps, + // PartitionStartRecord.start_timestamps, + // PartitionEventRecord.commit_timestamps, and + // PartitionEndRecord.end_timestamps can have the same value in the same + // partition. + google.protobuf.Timestamp commit_timestamp = 1; + + // Record sequence numbers are unique and monotonically increasing (but not + // necessarily contiguous) for a specific timestamp across record + // types in the same partition. To guarantee ordered processing, the reader + // should process records (of potentially different types) in + // record_sequence order for a specific timestamp in the same partition. + string record_sequence = 2; + + // Unique partition identifier describing the partition this event + // occurred on. + // [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token] + // is equal to the partition token of the change stream partition currently + // queried to return this PartitionEventRecord. + string partition_token = 3; + + // Set when one or more key ranges are moved into the change stream + // partition identified by + // [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token]. + // + // Example: Two key ranges are moved into partition (P1) from partition (P2) + // and partition (P3) in a single transaction at timestamp T. + // + // The PartitionEventRecord returned in P1 will reflect the move as: + // + // PartitionEventRecord { + // commit_timestamp: T + // partition_token: "P1" + // move_in_events { + // source_partition_token: "P2" + // } + // move_in_events { + // source_partition_token: "P3" + // } + // } + // + // The PartitionEventRecord returned in P2 will reflect the move as: + // + // PartitionEventRecord { + // commit_timestamp: T + // partition_token: "P2" + // move_out_events { + // destination_partition_token: "P1" + // } + // } + // + // The PartitionEventRecord returned in P3 will reflect the move as: + // + // PartitionEventRecord { + // commit_timestamp: T + // partition_token: "P3" + // move_out_events { + // destination_partition_token: "P1" + // } + // } + repeated MoveInEvent move_in_events = 4; + + // Set when one or more key ranges are moved out of the change stream + // partition identified by + // [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token]. + // + // Example: Two key ranges are moved out of partition (P1) to partition (P2) + // and partition (P3) in a single transaction at timestamp T. + // + // The PartitionEventRecord returned in P1 will reflect the move as: + // + // PartitionEventRecord { + // commit_timestamp: T + // partition_token: "P1" + // move_out_events { + // destination_partition_token: "P2" + // } + // move_out_events { + // destination_partition_token: "P3" + // } + // } + // + // The PartitionEventRecord returned in P2 will reflect the move as: + // + // PartitionEventRecord { + // commit_timestamp: T + // partition_token: "P2" + // move_in_events { + // source_partition_token: "P1" + // } + // } + // + // The PartitionEventRecord returned in P3 will reflect the move as: + // + // PartitionEventRecord { + // commit_timestamp: T + // partition_token: "P3" + // move_in_events { + // source_partition_token: "P1" + // } + // } + repeated MoveOutEvent move_out_events = 5; + } + + // One of the change stream subrecords. + oneof record { + // Data change record describing a data change for a change stream + // partition. + DataChangeRecord data_change_record = 1; + + // Heartbeat record describing a heartbeat for a change stream partition. + HeartbeatRecord heartbeat_record = 2; + + // Partition start record describing a new change stream partition. + PartitionStartRecord partition_start_record = 3; + + // Partition end record describing a terminated change stream partition. + PartitionEndRecord partition_end_record = 4; + + // Partition event record describing key range changes for a change stream + // partition. + PartitionEventRecord partition_event_record = 5; + } +} diff --git a/owl-bot-staging/executor/v1/protos/google/spanner/v1/commit_response.proto b/owl-bot-staging/executor/v1/protos/google/spanner/v1/commit_response.proto new file mode 100644 index 000000000..6e4459122 --- /dev/null +++ b/owl-bot-staging/executor/v1/protos/google/spanner/v1/commit_response.proto @@ -0,0 +1,64 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.spanner.v1; + +import "google/protobuf/timestamp.proto"; +import "google/spanner/v1/transaction.proto"; + +option csharp_namespace = "Google.Cloud.Spanner.V1"; +option go_package = "cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb"; +option java_multiple_files = true; +option java_outer_classname = "CommitResponseProto"; +option java_package = "com.google.spanner.v1"; +option php_namespace = "Google\\Cloud\\Spanner\\V1"; +option ruby_package = "Google::Cloud::Spanner::V1"; + +// The response for [Commit][google.spanner.v1.Spanner.Commit]. +message CommitResponse { + // Additional statistics about a commit. + message CommitStats { + // The total number of mutations for the transaction. Knowing the + // `mutation_count` value can help you maximize the number of mutations + // in a transaction and minimize the number of API round trips. You can + // also monitor this value to prevent transactions from exceeding the system + // [limit](https://cloud.google.com/spanner/quotas#limits_for_creating_reading_updating_and_deleting_data). + // If the number of mutations exceeds the limit, the server returns + // [INVALID_ARGUMENT](https://cloud.google.com/spanner/docs/reference/rest/v1/Code#ENUM_VALUES.INVALID_ARGUMENT). + int64 mutation_count = 1; + } + + // The Cloud Spanner timestamp at which the transaction committed. + google.protobuf.Timestamp commit_timestamp = 1; + + // The statistics about this `Commit`. Not returned by default. + // For more information, see + // [CommitRequest.return_commit_stats][google.spanner.v1.CommitRequest.return_commit_stats]. + CommitStats commit_stats = 2; + + // You must examine and retry the commit if the following is populated. + oneof MultiplexedSessionRetry { + // If specified, transaction has not committed yet. + // You must retry the commit with the new precommit token. + MultiplexedSessionPrecommitToken precommit_token = 4; + } + + // If `TransactionOptions.isolation_level` is set to + // `IsolationLevel.REPEATABLE_READ`, then the snapshot timestamp is the + // timestamp at which all reads in the transaction ran. This timestamp is + // never returned. + google.protobuf.Timestamp snapshot_timestamp = 5; +} diff --git a/owl-bot-staging/executor/v1/protos/google/spanner/v1/keys.proto b/owl-bot-staging/executor/v1/protos/google/spanner/v1/keys.proto new file mode 100644 index 000000000..5e30e831e --- /dev/null +++ b/owl-bot-staging/executor/v1/protos/google/spanner/v1/keys.proto @@ -0,0 +1,163 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.spanner.v1; + +import "google/protobuf/struct.proto"; + +option csharp_namespace = "Google.Cloud.Spanner.V1"; +option go_package = "cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb"; +option java_multiple_files = true; +option java_outer_classname = "KeysProto"; +option java_package = "com.google.spanner.v1"; +option php_namespace = "Google\\Cloud\\Spanner\\V1"; +option ruby_package = "Google::Cloud::Spanner::V1"; + +// KeyRange represents a range of rows in a table or index. +// +// A range has a start key and an end key. These keys can be open or +// closed, indicating if the range includes rows with that key. +// +// Keys are represented by lists, where the ith value in the list +// corresponds to the ith component of the table or index primary key. +// Individual values are encoded as described +// [here][google.spanner.v1.TypeCode]. +// +// For example, consider the following table definition: +// +// CREATE TABLE UserEvents ( +// UserName STRING(MAX), +// EventDate STRING(10) +// ) PRIMARY KEY(UserName, EventDate); +// +// The following keys name rows in this table: +// +// ["Bob", "2014-09-23"] +// ["Alfred", "2015-06-12"] +// +// Since the `UserEvents` table's `PRIMARY KEY` clause names two +// columns, each `UserEvents` key has two elements; the first is the +// `UserName`, and the second is the `EventDate`. +// +// Key ranges with multiple components are interpreted +// lexicographically by component using the table or index key's declared +// sort order. For example, the following range returns all events for +// user `"Bob"` that occurred in the year 2015: +// +// "start_closed": ["Bob", "2015-01-01"] +// "end_closed": ["Bob", "2015-12-31"] +// +// Start and end keys can omit trailing key components. This affects the +// inclusion and exclusion of rows that exactly match the provided key +// components: if the key is closed, then rows that exactly match the +// provided components are included; if the key is open, then rows +// that exactly match are not included. +// +// For example, the following range includes all events for `"Bob"` that +// occurred during and after the year 2000: +// +// "start_closed": ["Bob", "2000-01-01"] +// "end_closed": ["Bob"] +// +// The next example retrieves all events for `"Bob"`: +// +// "start_closed": ["Bob"] +// "end_closed": ["Bob"] +// +// To retrieve events before the year 2000: +// +// "start_closed": ["Bob"] +// "end_open": ["Bob", "2000-01-01"] +// +// The following range includes all rows in the table: +// +// "start_closed": [] +// "end_closed": [] +// +// This range returns all users whose `UserName` begins with any +// character from A to C: +// +// "start_closed": ["A"] +// "end_open": ["D"] +// +// This range returns all users whose `UserName` begins with B: +// +// "start_closed": ["B"] +// "end_open": ["C"] +// +// Key ranges honor column sort order. For example, suppose a table is +// defined as follows: +// +// CREATE TABLE DescendingSortedTable { +// Key INT64, +// ... +// ) PRIMARY KEY(Key DESC); +// +// The following range retrieves all rows with key values between 1 +// and 100 inclusive: +// +// "start_closed": ["100"] +// "end_closed": ["1"] +// +// Note that 100 is passed as the start, and 1 is passed as the end, +// because `Key` is a descending column in the schema. +message KeyRange { + // The start key must be provided. It can be either closed or open. + oneof start_key_type { + // If the start is closed, then the range includes all rows whose + // first `len(start_closed)` key columns exactly match `start_closed`. + google.protobuf.ListValue start_closed = 1; + + // If the start is open, then the range excludes rows whose first + // `len(start_open)` key columns exactly match `start_open`. + google.protobuf.ListValue start_open = 2; + } + + // The end key must be provided. It can be either closed or open. + oneof end_key_type { + // If the end is closed, then the range includes all rows whose + // first `len(end_closed)` key columns exactly match `end_closed`. + google.protobuf.ListValue end_closed = 3; + + // If the end is open, then the range excludes rows whose first + // `len(end_open)` key columns exactly match `end_open`. + google.protobuf.ListValue end_open = 4; + } +} + +// `KeySet` defines a collection of Cloud Spanner keys and/or key ranges. All +// the keys are expected to be in the same table or index. The keys need +// not be sorted in any particular way. +// +// If the same key is specified multiple times in the set (for example +// if two ranges, two keys, or a key and a range overlap), Cloud Spanner +// behaves as if the key were only specified once. +message KeySet { + // A list of specific keys. Entries in `keys` should have exactly as + // many elements as there are columns in the primary or index key + // with which this `KeySet` is used. Individual key values are + // encoded as described [here][google.spanner.v1.TypeCode]. + repeated google.protobuf.ListValue keys = 1; + + // A list of key ranges. See [KeyRange][google.spanner.v1.KeyRange] for more + // information about key range specifications. + repeated KeyRange ranges = 2; + + // For convenience `all` can be set to `true` to indicate that this + // `KeySet` matches all keys in the table or index. Note that any keys + // specified in `keys` or `ranges` are only yielded once. + bool all = 3; +} diff --git a/owl-bot-staging/executor/v1/protos/google/spanner/v1/location.proto b/owl-bot-staging/executor/v1/protos/google/spanner/v1/location.proto new file mode 100644 index 000000000..870dc0ec0 --- /dev/null +++ b/owl-bot-staging/executor/v1/protos/google/spanner/v1/location.proto @@ -0,0 +1,388 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.spanner.v1; + +import "google/protobuf/struct.proto"; +import "google/spanner/v1/type.proto"; + +option csharp_namespace = "Google.Cloud.Spanner.V1"; +option go_package = "cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb"; +option java_multiple_files = true; +option java_outer_classname = "LocationProto"; +option java_package = "com.google.spanner.v1"; +option php_namespace = "Google\\Cloud\\Spanner\\V1"; +option ruby_package = "Google::Cloud::Spanner::V1"; + +// A `Range` represents a range of keys in a database. The keys themselves +// are encoded in "sortable string format", also known as ssformat. Consult +// Spanner's open source client libraries for details on the encoding. +// +// Each range represents a contiguous range of rows, possibly from multiple +// tables/indexes. Each range is associated with a single paxos group (known as +// a "group" throughout this API), a split (which names the exact range within +// the group), and a generation that can be used to determine whether a given +// `Range` represents a newer or older location for the key range. +message Range { + // The start key of the range, inclusive. Encoded in "sortable string format" + // (ssformat). + bytes start_key = 1; + + // The limit key of the range, exclusive. Encoded in "sortable string format" + // (ssformat). + bytes limit_key = 2; + + // The UID of the paxos group where this range is stored. UIDs are unique + // within the database. References `Group.group_uid`. + uint64 group_uid = 3; + + // A group can store multiple ranges of keys. Each key range is named by an + // ID (the split ID). Within a group, split IDs are unique. The `split_id` + // names the exact split in `group_uid` where this range is stored. + uint64 split_id = 4; + + // `generation` indicates the freshness of the range information contained + // in this proto. Generations can be compared lexicographically; if generation + // A is greater than generation B, then the `Range` corresponding to A is + // newer than the `Range` corresponding to B, and should be used + // preferentially. + bytes generation = 5; +} + +// A `Tablet` represents a single replica of a `Group`. A tablet is served by a +// single server at a time, and can move between servers due to server death or +// simply load balancing. +message Tablet { + // Indicates the role of the tablet. + enum Role { + // Not specified. + ROLE_UNSPECIFIED = 0; + + // The tablet can perform reads and (if elected leader) writes. + READ_WRITE = 1; + + // The tablet can only perform reads. + READ_ONLY = 2; + } + + // The UID of the tablet, unique within the database. Matches the + // `tablet_uids` and `leader_tablet_uid` fields in `Group`. + uint64 tablet_uid = 1; + + // The address of the server that is serving this tablet -- either an IP + // address or DNS hostname and a port number. + string server_address = 2; + + // Where this tablet is located. This is the name of a Google Cloud region, + // such as "us-central1". + string location = 3; + + // The role of the tablet. + Role role = 4; + + // `incarnation` indicates the freshness of the tablet information contained + // in this proto. Incarnations can be compared lexicographically; if + // incarnation A is greater than incarnation B, then the `Tablet` + // corresponding to A is newer than the `Tablet` corresponding to B, and + // should be used preferentially. + bytes incarnation = 5; + + // Distances help the client pick the closest tablet out of the list of + // tablets for a given request. Tablets with lower distances should generally + // be preferred. Tablets with the same distance are approximately equally + // close; the client can choose arbitrarily. + // + // Distances do not correspond precisely to expected latency, geographical + // distance, or anything else. Distances should be compared only between + // tablets of the same group; they are not meaningful between different + // groups. + // + // A value of zero indicates that the tablet may be in the same zone as + // the client, and have minimum network latency. A value less than or equal to + // five indicates that the tablet is thought to be in the same region as the + // client, and may have a few milliseconds of network latency. Values greater + // than five are most likely in a different region, with non-trivial network + // latency. + // + // Clients should use the following algorithm: + // * If the request is using a directed read, eliminate any tablets that + // do not match the directed read's target zone and/or replica type. + // * (Read-write transactions only) Choose leader tablet if it has an + // distance <=5. + // * Group and sort tablets by distance. Choose a random + // tablet with the lowest distance. If the request + // is not a directed read, only consider replicas with distances <=5. + // * Send the request to the fallback endpoint. + // + // The tablet picked by this algorithm may be skipped, either because it is + // marked as `skip` by the server or because the corresponding server is + // unreachable, flow controlled, etc. Skipped tablets should be added to the + // `skipped_tablet_uid` field in `RoutingHint`; the algorithm above should + // then be re-run without including the skipped tablet(s) to pick the next + // best tablet. + uint32 distance = 6; + + // If true, the tablet should not be chosen by the client. Typically, this + // signals that the tablet is unhealthy in some way. Tablets with `skip` + // set to true should be reported back to the server in + // `RoutingHint.skipped_tablet_uid`; this cues the server to send updated + // information for this tablet should it become usable again. + bool skip = 7; +} + +// A `Group` represents a paxos group in a database. A group is a set of +// tablets that are replicated across multiple servers. Groups may have a leader +// tablet. Groups store one (or sometimes more) ranges of keys. +message Group { + // The UID of the paxos group, unique within the database. Matches the + // `group_uid` field in `Range`. + uint64 group_uid = 1; + + // A list of tablets that are part of the group. Note that this list may not + // be exhaustive; it will only include tablets the server considers useful + // to the client. The returned list is ordered ascending by distance. + // + // Tablet UIDs reference `Tablet.tablet_uid`. + repeated Tablet tablets = 2; + + // The last known leader tablet of the group as an index into `tablets`. May + // be negative if the group has no known leader. + int32 leader_index = 3; + + // `generation` indicates the freshness of the group information (including + // leader information) contained in this proto. Generations can be compared + // lexicographically; if generation A is greater than generation B, then the + // `Group` corresponding to A is newer than the `Group` corresponding to B, + // and should be used preferentially. + bytes generation = 4; +} + +// A `KeyRecipe` provides the metadata required to translate reads, mutations, +// and queries into a byte array in "sortable string format" (ssformat)that can +// be used with `Range`s to route requests. Note that the client *must* tolerate +// `KeyRecipe`s that appear to be invalid, since the `KeyRecipe` format may +// change over time. Requests with invalid `KeyRecipe`s should be routed to a +// default server. +message KeyRecipe { + // An ssformat key is composed of a sequence of tag numbers and key column + // values. `Part` represents a single tag or key column value. + message Part { + // The remaining fields encode column values. + enum Order { + // Default value, equivalent to `ASCENDING`. + ORDER_UNSPECIFIED = 0; + + // The key is ascending - corresponds to `ASC` in the schema definition. + ASCENDING = 1; + + // The key is descending - corresponds to `DESC` in the schema definition. + DESCENDING = 2; + } + + // The null order of the key column. This dictates where NULL values sort + // in the sorted order. Note that columns which are `NOT NULL` can have a + // special encoding. + enum NullOrder { + // Default value. This value is unused. + NULL_ORDER_UNSPECIFIED = 0; + + // NULL values sort before any non-NULL values. + NULLS_FIRST = 1; + + // NULL values sort after any non-NULL values. + NULLS_LAST = 2; + + // The column does not support NULL values. + NOT_NULL = 3; + } + + // If non-zero, `tag` is the only field present in this `Part`. The part + // is encoded by appending `tag` to the ssformat key. + uint32 tag = 1; + + // Whether the key column is sorted ascending or descending. Only present + // if `tag` is zero. + Order order = 2; + + // How NULLs are represented in the encoded key part. Only present if `tag` + // is zero. + NullOrder null_order = 3; + + // The type of the key part. Only present if `tag` is zero. + Type type = 4; + + // Only present if `tag` is zero. + oneof value_type { + // `identifier` is the name of the column or query parameter. + string identifier = 5; + + // The constant value of the key part. + // It is present when query uses a constant as a part of the key. + google.protobuf.Value value = 6; + + // If true, the client is responsible to fill in the value randomly. + // It's relevant only for the INT64 type. + bool random = 8; + } + + // It is a repeated field to support fetching key columns from nested + // structs, such as `STRUCT` query parameters. + repeated int32 struct_identifiers = 7; + } + + // A recipe can be associated with a table, index, or query. Tables recipes + // are used to encode read and write keys; index recipes are used for index + // reads, and query recipes are used only for SQL queries. + oneof target { + // A table name, matching the name from the database schema. + string table_name = 1; + + // An index name, matching the name from the database schema. + string index_name = 2; + + // The UID of a query, matching the UID from `RoutingHint`. + uint64 operation_uid = 3; + } + + // Parts are in the order they should appear in the encoded key. + repeated Part part = 4; +} + +// A `RecipeList` contains a list of `KeyRecipe`s, which share the same +// schema generation. +message RecipeList { + // The schema generation of the recipes. To be sent to the server in + // `RoutingHint.schema_generation` whenever one of the recipes is used. + // `schema_generation` values are comparable with each other; if generation A + // compares greater than generation B, then A is a more recent schema than B. + // Clients should in general aim to cache only the latest schema generation, + // and discard more stale recipes. + bytes schema_generation = 1; + + // A list of recipes to be cached. + repeated KeyRecipe recipe = 3; +} + +// A `CacheUpdate` expresses a set of changes the client should incorporate into +// its location cache. These changes may or may not be newer than what the +// client has in its cache, and should be discarded if necessary. `CacheUpdate`s +// can be obtained in response to requests that included a `RoutingHint` +// field, but may also be obtained by explicit location-fetching RPCs which may +// be added in the future. +message CacheUpdate { + // An internal ID for the database. Database names can be reused if a database + // is deleted and re-created. Each time the database is re-created, it will + // get a new database ID, which will never be re-used for any other database. + uint64 database_id = 1; + + // A list of ranges to be cached. + repeated Range range = 2; + + // A list of groups to be cached. + repeated Group group = 3; + + // A list of recipes to be cached. + RecipeList key_recipes = 5; +} + +// `RoutingHint` can be optionally added to location-aware Spanner +// requests. It gives the server hints that can be used to route the request to +// an appropriate server, potentially significantly decreasing latency and +// improving throughput. To achieve improved performance, most fields must be +// filled in with accurate values. +// +// The presence of a valid `RoutingHint` tells the server that the client +// is location-aware. +// +// `RoutingHint` does not change the semantics of the request; it is +// purely a performance hint; the request will perform the same actions on the +// database's data as if `RoutingHint` were not present. However, if +// the `RoutingHint` is incomplete or incorrect, the response may include +// a `CacheUpdate` the client can use to correct its location cache. +message RoutingHint { + // A tablet that was skipped by the client. See `Tablet.tablet_uid` and + // `Tablet.incarnation`. + message SkippedTablet { + // The tablet UID of the tablet that was skipped. See `Tablet.tablet_uid`. + uint64 tablet_uid = 1; + + // The incarnation of the tablet that was skipped. See `Tablet.incarnation`. + bytes incarnation = 2; + } + + // A session-scoped unique ID for the operation, computed client-side. + // Requests with the same `operation_uid` should have a shared 'shape', + // meaning that some fields are expected to be the same, such as the SQL + // query, the target table/columns (for reads) etc. Requests with the same + // `operation_uid` are meant to differ only in fields like keys/key + // ranges/query parameters, transaction IDs, etc. + // + // `operation_uid` must be non-zero for `RoutingHint` to be valid. + uint64 operation_uid = 1; + + // The database ID of the database being accessed, see + // `CacheUpdate.database_id`. Should match the cache entries that were used + // to generate the rest of the fields in this `RoutingHint`. + uint64 database_id = 2; + + // The schema generation of the recipe that was used to generate `key` and + // `limit_key`. See also `RecipeList.schema_generation`. + bytes schema_generation = 3; + + // The key / key range that this request accesses. For operations that + // access a single key, `key` should be set and `limit_key` should be empty. + // For operations that access a key range, `key` and `limit_key` should both + // be set, to the inclusive start and exclusive end of the range respectively. + // + // The keys are encoded in "sortable string format" (ssformat), using a + // `KeyRecipe` that is appropriate for the request. See `KeyRecipe` for more + // details. + bytes key = 4; + + // If this request targets a key range, this is the exclusive end of the + // range. See `key` for more details. + bytes limit_key = 5; + + // The group UID of the group that the client believes serves the range + // defined by `key` and `limit_key`. See `Range.group_uid` for more details. + uint64 group_uid = 6; + + // The split ID of the split that the client believes contains the range + // defined by `key` and `limit_key`. See `Range.split_id` for more details. + uint64 split_id = 7; + + // The tablet UID of the tablet from group `group_uid` that the client + // believes is best to serve this request. See `Group.local_tablet_uids` and + // `Group.leader_tablet_uid`. + uint64 tablet_uid = 8; + + // If the client had multiple options for tablet selection, and some of its + // first choices were unhealthy (e.g., the server is unreachable, or + // `Tablet.skip` is true), this field will contain the tablet UIDs of those + // tablets, with their incarnations. The server may include a `CacheUpdate` + // with new locations for those tablets. + repeated SkippedTablet skipped_tablet_uid = 9; + + // If present, the client's current location. This should be the name of a + // Google Cloud zone or region, such as "us-central1". + // + // If absent, the client's location will be assumed to be the same as the + // location of the server the client ends up connected to. + // + // Locations are primarily valuable for clients that connect from regions + // other than the ones that contain the Spanner database. + string client_location = 10; +} diff --git a/owl-bot-staging/executor/v1/protos/google/spanner/v1/mutation.proto b/owl-bot-staging/executor/v1/protos/google/spanner/v1/mutation.proto new file mode 100644 index 000000000..7e3306a20 --- /dev/null +++ b/owl-bot-staging/executor/v1/protos/google/spanner/v1/mutation.proto @@ -0,0 +1,156 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.spanner.v1; + +import "google/api/field_behavior.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; +import "google/spanner/v1/keys.proto"; + +option csharp_namespace = "Google.Cloud.Spanner.V1"; +option go_package = "cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb"; +option java_multiple_files = true; +option java_outer_classname = "MutationProto"; +option java_package = "com.google.spanner.v1"; +option php_namespace = "Google\\Cloud\\Spanner\\V1"; +option ruby_package = "Google::Cloud::Spanner::V1"; + +// A modification to one or more Cloud Spanner rows. Mutations can be +// applied to a Cloud Spanner database by sending them in a +// [Commit][google.spanner.v1.Spanner.Commit] call. +message Mutation { + // Arguments to [insert][google.spanner.v1.Mutation.insert], + // [update][google.spanner.v1.Mutation.update], + // [insert_or_update][google.spanner.v1.Mutation.insert_or_update], and + // [replace][google.spanner.v1.Mutation.replace] operations. + message Write { + // Required. The table whose rows will be written. + string table = 1 [(google.api.field_behavior) = REQUIRED]; + + // The names of the columns in + // [table][google.spanner.v1.Mutation.Write.table] to be written. + // + // The list of columns must contain enough columns to allow + // Cloud Spanner to derive values for all primary key columns in the + // row(s) to be modified. + repeated string columns = 2; + + // The values to be written. `values` can contain more than one + // list of values. If it does, then multiple rows are written, one + // for each entry in `values`. Each list in `values` must have + // exactly as many entries as there are entries in + // [columns][google.spanner.v1.Mutation.Write.columns] above. Sending + // multiple lists is equivalent to sending multiple `Mutation`s, each + // containing one `values` entry and repeating + // [table][google.spanner.v1.Mutation.Write.table] and + // [columns][google.spanner.v1.Mutation.Write.columns]. Individual values in + // each list are encoded as described [here][google.spanner.v1.TypeCode]. + repeated google.protobuf.ListValue values = 3; + } + + // Arguments to [delete][google.spanner.v1.Mutation.delete] operations. + message Delete { + // Required. The table whose rows will be deleted. + string table = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The primary keys of the rows within + // [table][google.spanner.v1.Mutation.Delete.table] to delete. The primary + // keys must be specified in the order in which they appear in the `PRIMARY + // KEY()` clause of the table's equivalent DDL statement (the DDL statement + // used to create the table). Delete is idempotent. The transaction will + // succeed even if some or all rows do not exist. + KeySet key_set = 2 [(google.api.field_behavior) = REQUIRED]; + } + + // Arguments to [send][google.spanner.v1.Mutation.send] operations. + message Send { + // Required. The queue to which the message will be sent. + string queue = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The primary key of the message to be sent. + google.protobuf.ListValue key = 2 [(google.api.field_behavior) = REQUIRED]; + + // The time at which Spanner will begin attempting to deliver the message. + // If `deliver_time` is not set, Spanner will deliver the message + // immediately. If `deliver_time` is in the past, Spanner will replace it + // with a value closer to the current time. + google.protobuf.Timestamp deliver_time = 3; + + // The payload of the message. + google.protobuf.Value payload = 4; + } + + // Arguments to [ack][google.spanner.v1.Mutation.ack] operations. + message Ack { + // Required. The queue where the message to be acked is stored. + string queue = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The primary key of the message to be acked. + google.protobuf.ListValue key = 2 [(google.api.field_behavior) = REQUIRED]; + + // By default, an attempt to ack a message that does not exist will fail + // with a `NOT_FOUND` error. With `ignore_not_found` set to true, the ack + // will succeed even if the message does not exist. This is useful for + // unconditionally acking a message, even if it is missing or has already + // been acked. + bool ignore_not_found = 3; + } + + // Required. The operation to perform. + oneof operation { + // Insert new rows in a table. If any of the rows already exist, + // the write or transaction fails with error `ALREADY_EXISTS`. + Write insert = 1; + + // Update existing rows in a table. If any of the rows does not + // already exist, the transaction fails with error `NOT_FOUND`. + Write update = 2; + + // Like [insert][google.spanner.v1.Mutation.insert], except that if the row + // already exists, then its column values are overwritten with the ones + // provided. Any column values not explicitly written are preserved. + // + // When using + // [insert_or_update][google.spanner.v1.Mutation.insert_or_update], just as + // when using [insert][google.spanner.v1.Mutation.insert], all `NOT NULL` + // columns in the table must be given a value. This holds true even when the + // row already exists and will therefore actually be updated. + Write insert_or_update = 3; + + // Like [insert][google.spanner.v1.Mutation.insert], except that if the row + // already exists, it is deleted, and the column values provided are + // inserted instead. Unlike + // [insert_or_update][google.spanner.v1.Mutation.insert_or_update], this + // means any values not explicitly written become `NULL`. + // + // In an interleaved table, if you create the child table with the + // `ON DELETE CASCADE` annotation, then replacing a parent row + // also deletes the child rows. Otherwise, you must delete the + // child rows before you replace the parent row. + Write replace = 4; + + // Delete rows from a table. Succeeds whether or not the named + // rows were present. + Delete delete = 5; + + // Send a message to a queue. + Send send = 6; + + // Ack a message from a queue. + Ack ack = 7; + } +} diff --git a/owl-bot-staging/executor/v1/protos/google/spanner/v1/query_plan.proto b/owl-bot-staging/executor/v1/protos/google/spanner/v1/query_plan.proto new file mode 100644 index 000000000..5850ff97f --- /dev/null +++ b/owl-bot-staging/executor/v1/protos/google/spanner/v1/query_plan.proto @@ -0,0 +1,156 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.spanner.v1; + +import "google/api/field_behavior.proto"; +import "google/protobuf/struct.proto"; + +option csharp_namespace = "Google.Cloud.Spanner.V1"; +option go_package = "cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb"; +option java_multiple_files = true; +option java_outer_classname = "QueryPlanProto"; +option java_package = "com.google.spanner.v1"; +option php_namespace = "Google\\Cloud\\Spanner\\V1"; +option ruby_package = "Google::Cloud::Spanner::V1"; + +// Node information for nodes appearing in a +// [QueryPlan.plan_nodes][google.spanner.v1.QueryPlan.plan_nodes]. +message PlanNode { + // The kind of [PlanNode][google.spanner.v1.PlanNode]. Distinguishes between + // the two different kinds of nodes that can appear in a query plan. + enum Kind { + // Not specified. + KIND_UNSPECIFIED = 0; + + // Denotes a Relational operator node in the expression tree. Relational + // operators represent iterative processing of rows during query execution. + // For example, a `TableScan` operation that reads rows from a table. + RELATIONAL = 1; + + // Denotes a Scalar node in the expression tree. Scalar nodes represent + // non-iterable entities in the query plan. For example, constants or + // arithmetic operators appearing inside predicate expressions or references + // to column names. + SCALAR = 2; + } + + // Metadata associated with a parent-child relationship appearing in a + // [PlanNode][google.spanner.v1.PlanNode]. + message ChildLink { + // The node to which the link points. + int32 child_index = 1; + + // The type of the link. For example, in Hash Joins this could be used to + // distinguish between the build child and the probe child, or in the case + // of the child being an output variable, to represent the tag associated + // with the output variable. + string type = 2; + + // Only present if the child node is + // [SCALAR][google.spanner.v1.PlanNode.Kind.SCALAR] and corresponds to an + // output variable of the parent node. The field carries the name of the + // output variable. For example, a `TableScan` operator that reads rows from + // a table will have child links to the `SCALAR` nodes representing the + // output variables created for each column that is read by the operator. + // The corresponding `variable` fields will be set to the variable names + // assigned to the columns. + string variable = 3; + } + + // Condensed representation of a node and its subtree. Only present for + // `SCALAR` [PlanNode(s)][google.spanner.v1.PlanNode]. + message ShortRepresentation { + // A string representation of the expression subtree rooted at this node. + string description = 1; + + // A mapping of (subquery variable name) -> (subquery node id) for cases + // where the `description` string of this node references a `SCALAR` + // subquery contained in the expression subtree rooted at this node. The + // referenced `SCALAR` subquery may not necessarily be a direct child of + // this node. + map subqueries = 2; + } + + // The `PlanNode`'s index in [node + // list][google.spanner.v1.QueryPlan.plan_nodes]. + int32 index = 1; + + // Used to determine the type of node. May be needed for visualizing + // different kinds of nodes differently. For example, If the node is a + // [SCALAR][google.spanner.v1.PlanNode.Kind.SCALAR] node, it will have a + // condensed representation which can be used to directly embed a description + // of the node in its parent. + Kind kind = 2; + + // The display name for the node. + string display_name = 3; + + // List of child node `index`es and their relationship to this parent. + repeated ChildLink child_links = 4; + + // Condensed representation for + // [SCALAR][google.spanner.v1.PlanNode.Kind.SCALAR] nodes. + ShortRepresentation short_representation = 5; + + // Attributes relevant to the node contained in a group of key-value pairs. + // For example, a Parameter Reference node could have the following + // information in its metadata: + // + // { + // "parameter_reference": "param1", + // "parameter_type": "array" + // } + google.protobuf.Struct metadata = 6; + + // The execution statistics associated with the node, contained in a group of + // key-value pairs. Only present if the plan was returned as a result of a + // profile query. For example, number of executions, number of rows/time per + // execution etc. + google.protobuf.Struct execution_stats = 7; +} + +// Output of query advisor analysis. +message QueryAdvisorResult { + // Recommendation to add new indexes to run queries more efficiently. + message IndexAdvice { + // Optional. DDL statements to add new indexes that will improve the query. + repeated string ddl = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Estimated latency improvement factor. For example if the query + // currently takes 500 ms to run and the estimated latency with new indexes + // is 100 ms this field will be 5. + double improvement_factor = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. Index Recommendation for a query. This is an optional field and + // the recommendation will only be available when the recommendation + // guarantees significant improvement in query performance. + repeated IndexAdvice index_advice = 1 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Contains an ordered list of nodes appearing in the query plan. +message QueryPlan { + // The nodes in the query plan. Plan nodes are returned in pre-order starting + // with the plan root. Each [PlanNode][google.spanner.v1.PlanNode]'s `id` + // corresponds to its index in `plan_nodes`. + repeated PlanNode plan_nodes = 1; + + // Optional. The advise/recommendations for a query. Currently this field will + // be serving index recommendations for a query. + QueryAdvisorResult query_advice = 2 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/owl-bot-staging/executor/v1/protos/google/spanner/v1/result_set.proto b/owl-bot-staging/executor/v1/protos/google/spanner/v1/result_set.proto new file mode 100644 index 000000000..3851d688c --- /dev/null +++ b/owl-bot-staging/executor/v1/protos/google/spanner/v1/result_set.proto @@ -0,0 +1,260 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.spanner.v1; + +import "google/api/field_behavior.proto"; +import "google/protobuf/struct.proto"; +import "google/spanner/v1/location.proto"; +import "google/spanner/v1/query_plan.proto"; +import "google/spanner/v1/transaction.proto"; +import "google/spanner/v1/type.proto"; + +option csharp_namespace = "Google.Cloud.Spanner.V1"; +option go_package = "cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb"; +option java_multiple_files = true; +option java_outer_classname = "ResultSetProto"; +option java_package = "com.google.spanner.v1"; +option php_namespace = "Google\\Cloud\\Spanner\\V1"; +option ruby_package = "Google::Cloud::Spanner::V1"; + +// Results from [Read][google.spanner.v1.Spanner.Read] or +// [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql]. +message ResultSet { + // Metadata about the result set, such as row type information. + ResultSetMetadata metadata = 1; + + // Each element in `rows` is a row whose format is defined by + // [metadata.row_type][google.spanner.v1.ResultSetMetadata.row_type]. The ith + // element in each row matches the ith field in + // [metadata.row_type][google.spanner.v1.ResultSetMetadata.row_type]. Elements + // are encoded based on type as described [here][google.spanner.v1.TypeCode]. + repeated google.protobuf.ListValue rows = 2; + + // Query plan and execution statistics for the SQL statement that + // produced this result set. These can be requested by setting + // [ExecuteSqlRequest.query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode]. + // DML statements always produce stats containing the number of rows + // modified, unless executed using the + // [ExecuteSqlRequest.QueryMode.PLAN][google.spanner.v1.ExecuteSqlRequest.QueryMode.PLAN] + // [ExecuteSqlRequest.query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode]. + // Other fields might or might not be populated, based on the + // [ExecuteSqlRequest.query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode]. + ResultSetStats stats = 3; + + // Optional. A precommit token is included if the read-write transaction is on + // a multiplexed session. Pass the precommit token with the highest sequence + // number from this transaction attempt to the + // [Commit][google.spanner.v1.Spanner.Commit] request for this transaction. + MultiplexedSessionPrecommitToken precommit_token = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A cache update expresses a set of changes the client should + // incorporate into its location cache. The client should discard the changes + // if they are older than the data it already has. This data can be obtained + // in response to requests that included a `RoutingHint` field, but may also + // be obtained by explicit location-fetching RPCs which may be added in the + // future. + CacheUpdate cache_update = 6 [(google.api.field_behavior) = OPTIONAL]; +} + +// Partial results from a streaming read or SQL query. Streaming reads and +// SQL queries better tolerate large result sets, large rows, and large +// values, but are a little trickier to consume. +message PartialResultSet { + // Metadata about the result set, such as row type information. + // Only present in the first response. + ResultSetMetadata metadata = 1; + + // A streamed result set consists of a stream of values, which might + // be split into many `PartialResultSet` messages to accommodate + // large rows and/or large values. Every N complete values defines a + // row, where N is equal to the number of entries in + // [metadata.row_type.fields][google.spanner.v1.StructType.fields]. + // + // Most values are encoded based on type as described + // [here][google.spanner.v1.TypeCode]. + // + // It's possible that the last value in values is "chunked", + // meaning that the rest of the value is sent in subsequent + // `PartialResultSet`(s). This is denoted by the + // [chunked_value][google.spanner.v1.PartialResultSet.chunked_value] field. + // Two or more chunked values can be merged to form a complete value as + // follows: + // + // * `bool/number/null`: can't be chunked + // * `string`: concatenate the strings + // * `list`: concatenate the lists. If the last element in a list is a + // `string`, `list`, or `object`, merge it with the first element in + // the next list by applying these rules recursively. + // * `object`: concatenate the (field name, field value) pairs. If a + // field name is duplicated, then apply these rules recursively + // to merge the field values. + // + // Some examples of merging: + // + // Strings are concatenated. + // "foo", "bar" => "foobar" + // + // Lists of non-strings are concatenated. + // [2, 3], [4] => [2, 3, 4] + // + // Lists are concatenated, but the last and first elements are merged + // because they are strings. + // ["a", "b"], ["c", "d"] => ["a", "bc", "d"] + // + // Lists are concatenated, but the last and first elements are merged + // because they are lists. Recursively, the last and first elements + // of the inner lists are merged because they are strings. + // ["a", ["b", "c"]], [["d"], "e"] => ["a", ["b", "cd"], "e"] + // + // Non-overlapping object fields are combined. + // {"a": "1"}, {"b": "2"} => {"a": "1", "b": 2"} + // + // Overlapping object fields are merged. + // {"a": "1"}, {"a": "2"} => {"a": "12"} + // + // Examples of merging objects containing lists of strings. + // {"a": ["1"]}, {"a": ["2"]} => {"a": ["12"]} + // + // For a more complete example, suppose a streaming SQL query is + // yielding a result set whose rows contain a single string + // field. The following `PartialResultSet`s might be yielded: + // + // { + // "metadata": { ... } + // "values": ["Hello", "W"] + // "chunked_value": true + // "resume_token": "Af65..." + // } + // { + // "values": ["orl"] + // "chunked_value": true + // } + // { + // "values": ["d"] + // "resume_token": "Zx1B..." + // } + // + // This sequence of `PartialResultSet`s encodes two rows, one + // containing the field value `"Hello"`, and a second containing the + // field value `"World" = "W" + "orl" + "d"`. + // + // Not all `PartialResultSet`s contain a `resume_token`. Execution can only be + // resumed from a previously yielded `resume_token`. For the above sequence of + // `PartialResultSet`s, resuming the query with `"resume_token": "Af65..."` + // yields results from the `PartialResultSet` with value "orl". + repeated google.protobuf.Value values = 2; + + // If true, then the final value in + // [values][google.spanner.v1.PartialResultSet.values] is chunked, and must be + // combined with more values from subsequent `PartialResultSet`s to obtain a + // complete field value. + bool chunked_value = 3; + + // Streaming calls might be interrupted for a variety of reasons, such + // as TCP connection loss. If this occurs, the stream of results can + // be resumed by re-sending the original request and including + // `resume_token`. Note that executing any other transaction in the + // same session invalidates the token. + bytes resume_token = 4; + + // Query plan and execution statistics for the statement that produced this + // streaming result set. These can be requested by setting + // [ExecuteSqlRequest.query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode] + // and are sent only once with the last response in the stream. This field is + // also present in the last response for DML statements. + ResultSetStats stats = 5; + + // Optional. A precommit token is included if the read-write transaction + // has multiplexed sessions enabled. Pass the precommit token with the highest + // sequence number from this transaction attempt to the + // [Commit][google.spanner.v1.Spanner.Commit] request for this transaction. + MultiplexedSessionPrecommitToken precommit_token = 8 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Indicates whether this is the last `PartialResultSet` in the + // stream. The server might optionally set this field. Clients shouldn't rely + // on this field being set in all cases. + bool last = 9 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A cache update expresses a set of changes the client should + // incorporate into its location cache. The client should discard the changes + // if they are older than the data it already has. This data can be obtained + // in response to requests that included a `RoutingHint` field, but may also + // be obtained by explicit location-fetching RPCs which may be added in the + // future. + CacheUpdate cache_update = 10 [(google.api.field_behavior) = OPTIONAL]; +} + +// Metadata about a [ResultSet][google.spanner.v1.ResultSet] or +// [PartialResultSet][google.spanner.v1.PartialResultSet]. +message ResultSetMetadata { + // Indicates the field names and types for the rows in the result + // set. For example, a SQL query like `"SELECT UserId, UserName FROM + // Users"` could return a `row_type` value like: + // + // "fields": [ + // { "name": "UserId", "type": { "code": "INT64" } }, + // { "name": "UserName", "type": { "code": "STRING" } }, + // ] + StructType row_type = 1; + + // If the read or SQL query began a transaction as a side-effect, the + // information about the new transaction is yielded here. + Transaction transaction = 2; + + // A SQL query can be parameterized. In PLAN mode, these parameters can be + // undeclared. This indicates the field names and types for those undeclared + // parameters in the SQL query. For example, a SQL query like `"SELECT * FROM + // Users where UserId = @userId and UserName = @userName "` could return a + // `undeclared_parameters` value like: + // + // "fields": [ + // { "name": "UserId", "type": { "code": "INT64" } }, + // { "name": "UserName", "type": { "code": "STRING" } }, + // ] + StructType undeclared_parameters = 3; +} + +// Additional statistics about a [ResultSet][google.spanner.v1.ResultSet] or +// [PartialResultSet][google.spanner.v1.PartialResultSet]. +message ResultSetStats { + // [QueryPlan][google.spanner.v1.QueryPlan] for the query associated with this + // result. + QueryPlan query_plan = 1; + + // Aggregated statistics from the execution of the query. Only present when + // the query is profiled. For example, a query could return the statistics as + // follows: + // + // { + // "rows_returned": "3", + // "elapsed_time": "1.22 secs", + // "cpu_time": "1.19 secs" + // } + google.protobuf.Struct query_stats = 2; + + // The number of rows modified by the DML statement. + oneof row_count { + // Standard DML returns an exact count of rows that were modified. + int64 row_count_exact = 3; + + // Partitioned DML doesn't offer exactly-once semantics, so it + // returns a lower bound of the rows modified. + int64 row_count_lower_bound = 4; + } +} diff --git a/owl-bot-staging/executor/v1/protos/google/spanner/v1/spanner.proto b/owl-bot-staging/executor/v1/protos/google/spanner/v1/spanner.proto new file mode 100644 index 000000000..525cc2ba4 --- /dev/null +++ b/owl-bot-staging/executor/v1/protos/google/spanner/v1/spanner.proto @@ -0,0 +1,1419 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.spanner.v1; + +import public "google/spanner/v1/commit_response.proto"; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; +import "google/spanner/v1/keys.proto"; +import "google/spanner/v1/location.proto"; +import "google/spanner/v1/mutation.proto"; +import "google/spanner/v1/result_set.proto"; +import "google/spanner/v1/transaction.proto"; +import "google/spanner/v1/type.proto"; + +option csharp_namespace = "Google.Cloud.Spanner.V1"; +option go_package = "cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb"; +option java_multiple_files = true; +option java_outer_classname = "SpannerProto"; +option java_package = "com.google.spanner.v1"; +option php_namespace = "Google\\Cloud\\Spanner\\V1"; +option ruby_package = "Google::Cloud::Spanner::V1"; +option (google.api.resource_definition) = { + type: "spanner.googleapis.com/Database" + pattern: "projects/{project}/instances/{instance}/databases/{database}" +}; + +// Cloud Spanner API +// +// The Cloud Spanner API can be used to manage sessions and execute +// transactions on data stored in Cloud Spanner databases. +service Spanner { + option (google.api.default_host) = "spanner.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/spanner.data"; + + // Creates a new session. A session can be used to perform + // transactions that read and/or modify data in a Cloud Spanner database. + // Sessions are meant to be reused for many consecutive + // transactions. + // + // Sessions can only execute one transaction at a time. To execute + // multiple concurrent read-write/write-only transactions, create + // multiple sessions. Note that standalone reads and queries use a + // transaction internally, and count toward the one transaction + // limit. + // + // Active sessions use additional server resources, so it's a good idea to + // delete idle and unneeded sessions. + // Aside from explicit deletes, Cloud Spanner can delete sessions when no + // operations are sent for more than an hour. If a session is deleted, + // requests to it return `NOT_FOUND`. + // + // Idle sessions can be kept alive by sending a trivial SQL query + // periodically, for example, `"SELECT 1"`. + rpc CreateSession(CreateSessionRequest) returns (Session) { + option (google.api.http) = { + post: "/v1/{database=projects/*/instances/*/databases/*}/sessions" + body: "*" + }; + option (google.api.method_signature) = "database"; + } + + // Creates multiple new sessions. + // + // This API can be used to initialize a session cache on the clients. + // See https://goo.gl/TgSFN2 for best practices on session cache management. + rpc BatchCreateSessions(BatchCreateSessionsRequest) + returns (BatchCreateSessionsResponse) { + option (google.api.http) = { + post: "/v1/{database=projects/*/instances/*/databases/*}/sessions:batchCreate" + body: "*" + }; + option (google.api.method_signature) = "database,session_count"; + } + + // Gets a session. Returns `NOT_FOUND` if the session doesn't exist. + // This is mainly useful for determining whether a session is still + // alive. + rpc GetSession(GetSessionRequest) returns (Session) { + option (google.api.http) = { + get: "/v1/{name=projects/*/instances/*/databases/*/sessions/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists all sessions in a given database. + rpc ListSessions(ListSessionsRequest) returns (ListSessionsResponse) { + option (google.api.http) = { + get: "/v1/{database=projects/*/instances/*/databases/*}/sessions" + }; + option (google.api.method_signature) = "database"; + } + + // Ends a session, releasing server resources associated with it. This + // asynchronously triggers the cancellation of any operations that are running + // with this session. + rpc DeleteSession(DeleteSessionRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/instances/*/databases/*/sessions/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Executes an SQL statement, returning all results in a single reply. This + // method can't be used to return a result set larger than 10 MiB; + // if the query yields more data than that, the query fails with + // a `FAILED_PRECONDITION` error. + // + // Operations inside read-write transactions might return `ABORTED`. If + // this occurs, the application should restart the transaction from + // the beginning. See [Transaction][google.spanner.v1.Transaction] for more + // details. + // + // Larger result sets can be fetched in streaming fashion by calling + // [ExecuteStreamingSql][google.spanner.v1.Spanner.ExecuteStreamingSql] + // instead. + // + // The query string can be SQL or [Graph Query Language + // (GQL)](https://cloud.google.com/spanner/docs/reference/standard-sql/graph-intro). + rpc ExecuteSql(ExecuteSqlRequest) returns (ResultSet) { + option (google.api.http) = { + post: "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:executeSql" + body: "*" + }; + } + + // Like [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql], except returns the + // result set as a stream. Unlike + // [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql], there is no limit on + // the size of the returned result set. However, no individual row in the + // result set can exceed 100 MiB, and no column value can exceed 10 MiB. + // + // The query string can be SQL or [Graph Query Language + // (GQL)](https://cloud.google.com/spanner/docs/reference/standard-sql/graph-intro). + rpc ExecuteStreamingSql(ExecuteSqlRequest) returns (stream PartialResultSet) { + option (google.api.http) = { + post: "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:executeStreamingSql" + body: "*" + }; + } + + // Executes a batch of SQL DML statements. This method allows many statements + // to be run with lower latency than submitting them sequentially with + // [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql]. + // + // Statements are executed in sequential order. A request can succeed even if + // a statement fails. The + // [ExecuteBatchDmlResponse.status][google.spanner.v1.ExecuteBatchDmlResponse.status] + // field in the response provides information about the statement that failed. + // Clients must inspect this field to determine whether an error occurred. + // + // Execution stops after the first failed statement; the remaining statements + // are not executed. + rpc ExecuteBatchDml(ExecuteBatchDmlRequest) + returns (ExecuteBatchDmlResponse) { + option (google.api.http) = { + post: "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:executeBatchDml" + body: "*" + }; + } + + // Reads rows from the database using key lookups and scans, as a + // simple key/value style alternative to + // [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql]. This method can't be + // used to return a result set larger than 10 MiB; if the read matches more + // data than that, the read fails with a `FAILED_PRECONDITION` + // error. + // + // Reads inside read-write transactions might return `ABORTED`. If + // this occurs, the application should restart the transaction from + // the beginning. See [Transaction][google.spanner.v1.Transaction] for more + // details. + // + // Larger result sets can be yielded in streaming fashion by calling + // [StreamingRead][google.spanner.v1.Spanner.StreamingRead] instead. + rpc Read(ReadRequest) returns (ResultSet) { + option (google.api.http) = { + post: "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:read" + body: "*" + }; + } + + // Like [Read][google.spanner.v1.Spanner.Read], except returns the result set + // as a stream. Unlike [Read][google.spanner.v1.Spanner.Read], there is no + // limit on the size of the returned result set. However, no individual row in + // the result set can exceed 100 MiB, and no column value can exceed + // 10 MiB. + rpc StreamingRead(ReadRequest) returns (stream PartialResultSet) { + option (google.api.http) = { + post: "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:streamingRead" + body: "*" + }; + } + + // Begins a new transaction. This step can often be skipped: + // [Read][google.spanner.v1.Spanner.Read], + // [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql] and + // [Commit][google.spanner.v1.Spanner.Commit] can begin a new transaction as a + // side-effect. + rpc BeginTransaction(BeginTransactionRequest) returns (Transaction) { + option (google.api.http) = { + post: "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:beginTransaction" + body: "*" + }; + option (google.api.method_signature) = "session,options"; + } + + // Commits a transaction. The request includes the mutations to be + // applied to rows in the database. + // + // `Commit` might return an `ABORTED` error. This can occur at any time; + // commonly, the cause is conflicts with concurrent + // transactions. However, it can also happen for a variety of other + // reasons. If `Commit` returns `ABORTED`, the caller should retry + // the transaction from the beginning, reusing the same session. + // + // On very rare occasions, `Commit` might return `UNKNOWN`. This can happen, + // for example, if the client job experiences a 1+ hour networking failure. + // At that point, Cloud Spanner has lost track of the transaction outcome and + // we recommend that you perform another read from the database to see the + // state of things as they are now. + rpc Commit(CommitRequest) returns (CommitResponse) { + option (google.api.http) = { + post: "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:commit" + body: "*" + }; + option (google.api.method_signature) = "session,transaction_id,mutations"; + option (google.api.method_signature) = + "session,single_use_transaction,mutations"; + } + + // Rolls back a transaction, releasing any locks it holds. It's a good + // idea to call this for any transaction that includes one or more + // [Read][google.spanner.v1.Spanner.Read] or + // [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql] requests and ultimately + // decides not to commit. + // + // `Rollback` returns `OK` if it successfully aborts the transaction, the + // transaction was already aborted, or the transaction isn't + // found. `Rollback` never returns `ABORTED`. + rpc Rollback(RollbackRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:rollback" + body: "*" + }; + option (google.api.method_signature) = "session,transaction_id"; + } + + // Creates a set of partition tokens that can be used to execute a query + // operation in parallel. Each of the returned partition tokens can be used + // by [ExecuteStreamingSql][google.spanner.v1.Spanner.ExecuteStreamingSql] to + // specify a subset of the query result to read. The same session and + // read-only transaction must be used by the `PartitionQueryRequest` used to + // create the partition tokens and the `ExecuteSqlRequests` that use the + // partition tokens. + // + // Partition tokens become invalid when the session used to create them + // is deleted, is idle for too long, begins a new transaction, or becomes too + // old. When any of these happen, it isn't possible to resume the query, and + // the whole operation must be restarted from the beginning. + rpc PartitionQuery(PartitionQueryRequest) returns (PartitionResponse) { + option (google.api.http) = { + post: "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:partitionQuery" + body: "*" + }; + } + + // Creates a set of partition tokens that can be used to execute a read + // operation in parallel. Each of the returned partition tokens can be used + // by [StreamingRead][google.spanner.v1.Spanner.StreamingRead] to specify a + // subset of the read result to read. The same session and read-only + // transaction must be used by the `PartitionReadRequest` used to create the + // partition tokens and the `ReadRequests` that use the partition tokens. + // There are no ordering guarantees on rows returned among the returned + // partition tokens, or even within each individual `StreamingRead` call + // issued with a `partition_token`. + // + // Partition tokens become invalid when the session used to create them + // is deleted, is idle for too long, begins a new transaction, or becomes too + // old. When any of these happen, it isn't possible to resume the read, and + // the whole operation must be restarted from the beginning. + rpc PartitionRead(PartitionReadRequest) returns (PartitionResponse) { + option (google.api.http) = { + post: "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:partitionRead" + body: "*" + }; + } + + // Batches the supplied mutation groups in a collection of efficient + // transactions. All mutations in a group are committed atomically. However, + // mutations across groups can be committed non-atomically in an unspecified + // order and thus, they must be independent of each other. Partial failure is + // possible, that is, some groups might have been committed successfully, + // while some might have failed. The results of individual batches are + // streamed into the response as the batches are applied. + // + // `BatchWrite` requests are not replay protected, meaning that each mutation + // group can be applied more than once. Replays of non-idempotent mutations + // can have undesirable effects. For example, replays of an insert mutation + // can produce an already exists error or if you use generated or commit + // timestamp-based keys, it can result in additional rows being added to the + // mutation's table. We recommend structuring your mutation groups to be + // idempotent to avoid this issue. + rpc BatchWrite(BatchWriteRequest) returns (stream BatchWriteResponse) { + option (google.api.http) = { + post: "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:batchWrite" + body: "*" + }; + option (google.api.method_signature) = "session,mutation_groups"; + } +} + +// The request for [CreateSession][google.spanner.v1.Spanner.CreateSession]. +message CreateSessionRequest { + // Required. The database in which the new session is created. + string database = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "spanner.googleapis.com/Database" + } + ]; + + // Required. The session to create. + Session session = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The request for +// [BatchCreateSessions][google.spanner.v1.Spanner.BatchCreateSessions]. +message BatchCreateSessionsRequest { + // Required. The database in which the new sessions are created. + string database = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "spanner.googleapis.com/Database" + } + ]; + + // Parameters to apply to each created session. + Session session_template = 2; + + // Required. The number of sessions to be created in this batch call. At least + // one session is created. The API can return fewer than the requested number + // of sessions. If a specific number of sessions are desired, the client can + // make additional calls to `BatchCreateSessions` (adjusting + // [session_count][google.spanner.v1.BatchCreateSessionsRequest.session_count] + // as necessary). + int32 session_count = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// The response for +// [BatchCreateSessions][google.spanner.v1.Spanner.BatchCreateSessions]. +message BatchCreateSessionsResponse { + // The freshly created sessions. + repeated Session session = 1; +} + +// A session in the Cloud Spanner API. +message Session { + option (google.api.resource) = { + type: "spanner.googleapis.com/Session" + pattern: "projects/{project}/instances/{instance}/databases/{database}/sessions/{session}" + plural: "sessions" + singular: "session" + }; + + // Output only. The name of the session. This is always system-assigned. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The labels for the session. + // + // * Label keys must be between 1 and 63 characters long and must conform to + // the following regular expression: `[a-z]([-a-z0-9]*[a-z0-9])?`. + // * Label values must be between 0 and 63 characters long and must conform + // to the regular expression `([a-z]([-a-z0-9]*[a-z0-9])?)?`. + // * No more than 64 labels can be associated with a given session. + // + // See https://goo.gl/xmQnxf for more information on and examples of labels. + map labels = 2; + + // Output only. The timestamp when the session is created. + google.protobuf.Timestamp create_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The approximate timestamp when the session is last used. It's + // typically earlier than the actual last use time. + google.protobuf.Timestamp approximate_last_use_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The database role which created this session. + string creator_role = 5; + + // Optional. If `true`, specifies a multiplexed session. Use a multiplexed + // session for multiple, concurrent operations including any combination of + // read-only and read-write transactions. Use + // [`sessions.create`][google.spanner.v1.Spanner.CreateSession] to create + // multiplexed sessions. Don't use + // [BatchCreateSessions][google.spanner.v1.Spanner.BatchCreateSessions] to + // create a multiplexed session. You can't delete or list multiplexed + // sessions. + bool multiplexed = 6 [(google.api.field_behavior) = OPTIONAL]; +} + +// The request for [GetSession][google.spanner.v1.Spanner.GetSession]. +message GetSessionRequest { + // Required. The name of the session to retrieve. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "spanner.googleapis.com/Session" } + ]; +} + +// The request for [ListSessions][google.spanner.v1.Spanner.ListSessions]. +message ListSessionsRequest { + // Required. The database in which to list sessions. + string database = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "spanner.googleapis.com/Database" + } + ]; + + // Number of sessions to be returned in the response. If 0 or less, defaults + // to the server's maximum allowed page size. + int32 page_size = 2; + + // If non-empty, `page_token` should contain a + // [next_page_token][google.spanner.v1.ListSessionsResponse.next_page_token] + // from a previous + // [ListSessionsResponse][google.spanner.v1.ListSessionsResponse]. + string page_token = 3; + + // An expression for filtering the results of the request. Filter rules are + // case insensitive. The fields eligible for filtering are: + // + // * `labels.key` where key is the name of a label + // + // Some examples of using filters are: + // + // * `labels.env:*` --> The session has the label "env". + // * `labels.env:dev` --> The session has the label "env" and the value of + // the label contains the string "dev". + string filter = 4; +} + +// The response for [ListSessions][google.spanner.v1.Spanner.ListSessions]. +message ListSessionsResponse { + // The list of requested sessions. + repeated Session sessions = 1; + + // `next_page_token` can be sent in a subsequent + // [ListSessions][google.spanner.v1.Spanner.ListSessions] call to fetch more + // of the matching sessions. + string next_page_token = 2; +} + +// The request for [DeleteSession][google.spanner.v1.Spanner.DeleteSession]. +message DeleteSessionRequest { + // Required. The name of the session to delete. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "spanner.googleapis.com/Session" } + ]; +} + +// Common request options for various APIs. +message RequestOptions { + // The relative priority for requests. Note that priority isn't applicable + // for [BeginTransaction][google.spanner.v1.Spanner.BeginTransaction]. + // + // The priority acts as a hint to the Cloud Spanner scheduler and doesn't + // guarantee priority or order of execution. For example: + // + // * Some parts of a write operation always execute at `PRIORITY_HIGH`, + // regardless of the specified priority. This can cause you to see an + // increase in high priority workload even when executing a low priority + // request. This can also potentially cause a priority inversion where a + // lower priority request is fulfilled ahead of a higher priority + // request. + // * If a transaction contains multiple operations with different priorities, + // Cloud Spanner doesn't guarantee to process the higher priority + // operations first. There might be other constraints to satisfy, such as + // the order of operations. + enum Priority { + // `PRIORITY_UNSPECIFIED` is equivalent to `PRIORITY_HIGH`. + PRIORITY_UNSPECIFIED = 0; + + // This specifies that the request is low priority. + PRIORITY_LOW = 1; + + // This specifies that the request is medium priority. + PRIORITY_MEDIUM = 2; + + // This specifies that the request is high priority. + PRIORITY_HIGH = 3; + } + + // Container for various pieces of client-owned context attached to a request. + message ClientContext { + // Optional. Map of parameter name to value for this request. These values + // will be returned by any SECURE_CONTEXT() calls invoked by this request + // (e.g., by queries against Parameterized Secure Views). + map secure_context = 1 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Priority for the request. + Priority priority = 1; + + // A per-request tag which can be applied to queries or reads, used for + // statistics collection. + // Both `request_tag` and `transaction_tag` can be specified for a read or + // query that belongs to a transaction. + // This field is ignored for requests where it's not applicable (for example, + // `CommitRequest`). + // Legal characters for `request_tag` values are all printable characters + // (ASCII 32 - 126) and the length of a request_tag is limited to 50 + // characters. Values that exceed this limit are truncated. + // Any leading underscore (_) characters are removed from the string. + string request_tag = 2; + + // A tag used for statistics collection about this transaction. + // Both `request_tag` and `transaction_tag` can be specified for a read or + // query that belongs to a transaction. + // To enable tagging on a transaction, `transaction_tag` must be set to the + // same value for all requests belonging to the same transaction, including + // [BeginTransaction][google.spanner.v1.Spanner.BeginTransaction]. + // If this request doesn't belong to any transaction, `transaction_tag` is + // ignored. + // Legal characters for `transaction_tag` values are all printable characters + // (ASCII 32 - 126) and the length of a `transaction_tag` is limited to 50 + // characters. Values that exceed this limit are truncated. + // Any leading underscore (_) characters are removed from the string. + string transaction_tag = 3; + + // Optional. Optional context that may be needed for some requests. + ClientContext client_context = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// The `DirectedReadOptions` can be used to indicate which replicas or regions +// should be used for non-transactional reads or queries. +// +// `DirectedReadOptions` can only be specified for a read-only transaction, +// otherwise the API returns an `INVALID_ARGUMENT` error. +message DirectedReadOptions { + // The directed read replica selector. + // Callers must provide one or more of the following fields for replica + // selection: + // + // * `location` - The location must be one of the regions within the + // multi-region configuration of your database. + // * `type` - The type of the replica. + // + // Some examples of using replica_selectors are: + // + // * `location:us-east1` --> The "us-east1" replica(s) of any available type + // is used to process the request. + // * `type:READ_ONLY` --> The "READ_ONLY" type replica(s) in the nearest + // available location are used to process the + // request. + // * `location:us-east1 type:READ_ONLY` --> The "READ_ONLY" type replica(s) + // in location "us-east1" is used to process + // the request. + message ReplicaSelection { + // Indicates the type of replica. + enum Type { + // Not specified. + TYPE_UNSPECIFIED = 0; + + // Read-write replicas support both reads and writes. + READ_WRITE = 1; + + // Read-only replicas only support reads (not writes). + READ_ONLY = 2; + } + + // The location or region of the serving requests, for example, "us-east1". + string location = 1; + + // The type of replica. + Type type = 2; + } + + // An `IncludeReplicas` contains a repeated set of `ReplicaSelection` which + // indicates the order in which replicas should be considered. + message IncludeReplicas { + // The directed read replica selector. + repeated ReplicaSelection replica_selections = 1; + + // If `true`, Spanner doesn't route requests to a replica outside the + // <`include_replicas` list when all of the specified replicas are + // unavailable or unhealthy. Default value is `false`. + bool auto_failover_disabled = 2; + } + + // An ExcludeReplicas contains a repeated set of ReplicaSelection that should + // be excluded from serving requests. + message ExcludeReplicas { + // The directed read replica selector. + repeated ReplicaSelection replica_selections = 1; + } + + // Required. At most one of either `include_replicas` or `exclude_replicas` + // should be present in the message. + oneof replicas { + // `Include_replicas` indicates the order of replicas (as they appear in + // this list) to process the request. If `auto_failover_disabled` is set to + // `true` and all replicas are exhausted without finding a healthy replica, + // Spanner waits for a replica in the list to become available, requests + // might fail due to `DEADLINE_EXCEEDED` errors. + IncludeReplicas include_replicas = 1; + + // `Exclude_replicas` indicates that specified replicas should be excluded + // from serving requests. Spanner doesn't route requests to the replicas + // in this list. + ExcludeReplicas exclude_replicas = 2; + } +} + +// The request for [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql] and +// [ExecuteStreamingSql][google.spanner.v1.Spanner.ExecuteStreamingSql]. +message ExecuteSqlRequest { + // Mode in which the statement must be processed. + enum QueryMode { + // The default mode. Only the statement results are returned. + NORMAL = 0; + + // This mode returns only the query plan, without any results or + // execution statistics information. + PLAN = 1; + + // This mode returns the query plan, overall execution statistics, + // operator level execution statistics along with the results. This has a + // performance overhead compared to the other modes. It isn't recommended + // to use this mode for production traffic. + PROFILE = 2; + + // This mode returns the overall (but not operator-level) execution + // statistics along with the results. + WITH_STATS = 3; + + // This mode returns the query plan, overall (but not operator-level) + // execution statistics along with the results. + WITH_PLAN_AND_STATS = 4; + } + + // Query optimizer configuration. + message QueryOptions { + // An option to control the selection of optimizer version. + // + // This parameter allows individual queries to pick different query + // optimizer versions. + // + // Specifying `latest` as a value instructs Cloud Spanner to use the + // latest supported query optimizer version. If not specified, Cloud Spanner + // uses the optimizer version set at the database level options. Any other + // positive integer (from the list of supported optimizer versions) + // overrides the default optimizer version for query execution. + // + // The list of supported optimizer versions can be queried from + // `SPANNER_SYS.SUPPORTED_OPTIMIZER_VERSIONS`. + // + // Executing a SQL statement with an invalid optimizer version fails with + // an `INVALID_ARGUMENT` error. + // + // See + // https://cloud.google.com/spanner/docs/query-optimizer/manage-query-optimizer + // for more information on managing the query optimizer. + // + // The `optimizer_version` statement hint has precedence over this setting. + string optimizer_version = 1; + + // An option to control the selection of optimizer statistics package. + // + // This parameter allows individual queries to use a different query + // optimizer statistics package. + // + // Specifying `latest` as a value instructs Cloud Spanner to use the latest + // generated statistics package. If not specified, Cloud Spanner uses + // the statistics package set at the database level options, or the latest + // package if the database option isn't set. + // + // The statistics package requested by the query has to be exempt from + // garbage collection. This can be achieved with the following DDL + // statement: + // + // ```sql + // ALTER STATISTICS SET OPTIONS (allow_gc=false) + // ``` + // + // The list of available statistics packages can be queried from + // `INFORMATION_SCHEMA.SPANNER_STATISTICS`. + // + // Executing a SQL statement with an invalid optimizer statistics package + // or with a statistics package that allows garbage collection fails with + // an `INVALID_ARGUMENT` error. + string optimizer_statistics_package = 2; + } + + // Required. The session in which the SQL query should be performed. + string session = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "spanner.googleapis.com/Session" } + ]; + + // The transaction to use. + // + // For queries, if none is provided, the default is a temporary read-only + // transaction with strong concurrency. + // + // Standard DML statements require a read-write transaction. To protect + // against replays, single-use transactions are not supported. The caller + // must either supply an existing transaction ID or begin a new transaction. + // + // Partitioned DML requires an existing Partitioned DML transaction ID. + TransactionSelector transaction = 2; + + // Required. The SQL string. + string sql = 3 [(google.api.field_behavior) = REQUIRED]; + + // Parameter names and values that bind to placeholders in the SQL string. + // + // A parameter placeholder consists of the `@` character followed by the + // parameter name (for example, `@firstName`). Parameter names must conform + // to the naming requirements of identifiers as specified at + // https://cloud.google.com/spanner/docs/lexical#identifiers. + // + // Parameters can appear anywhere that a literal value is expected. The same + // parameter name can be used more than once, for example: + // + // `"WHERE id > @msg_id AND id < @msg_id + 100"` + // + // It's an error to execute a SQL statement with unbound parameters. + google.protobuf.Struct params = 4; + + // It isn't always possible for Cloud Spanner to infer the right SQL type + // from a JSON value. For example, values of type `BYTES` and values + // of type `STRING` both appear in + // [params][google.spanner.v1.ExecuteSqlRequest.params] as JSON strings. + // + // In these cases, you can use `param_types` to specify the exact + // SQL type for some or all of the SQL statement parameters. See the + // definition of [Type][google.spanner.v1.Type] for more information + // about SQL types. + map param_types = 5; + + // If this request is resuming a previously interrupted SQL statement + // execution, `resume_token` should be copied from the last + // [PartialResultSet][google.spanner.v1.PartialResultSet] yielded before the + // interruption. Doing this enables the new SQL statement execution to resume + // where the last one left off. The rest of the request parameters must + // exactly match the request that yielded this token. + bytes resume_token = 6; + + // Used to control the amount of debugging information returned in + // [ResultSetStats][google.spanner.v1.ResultSetStats]. If + // [partition_token][google.spanner.v1.ExecuteSqlRequest.partition_token] is + // set, [query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode] can only + // be set to + // [QueryMode.NORMAL][google.spanner.v1.ExecuteSqlRequest.QueryMode.NORMAL]. + QueryMode query_mode = 7; + + // If present, results are restricted to the specified partition + // previously created using `PartitionQuery`. There must be an exact + // match for the values of fields common to this message and the + // `PartitionQueryRequest` message used to create this `partition_token`. + bytes partition_token = 8; + + // A per-transaction sequence number used to identify this request. This field + // makes each request idempotent such that if the request is received multiple + // times, at most one succeeds. + // + // The sequence number must be monotonically increasing within the + // transaction. If a request arrives for the first time with an out-of-order + // sequence number, the transaction can be aborted. Replays of previously + // handled requests yield the same response as the first execution. + // + // Required for DML statements. Ignored for queries. + int64 seqno = 9; + + // Query optimizer configuration to use for the given query. + QueryOptions query_options = 10; + + // Common options for this request. + RequestOptions request_options = 11; + + // Directed read options for this request. + DirectedReadOptions directed_read_options = 15; + + // If this is for a partitioned query and this field is set to `true`, the + // request is executed with Spanner Data Boost independent compute resources. + // + // If the field is set to `true` but the request doesn't set + // `partition_token`, the API returns an `INVALID_ARGUMENT` error. + bool data_boost_enabled = 16; + + // Optional. If set to `true`, this statement marks the end of the + // transaction. After this statement executes, you must commit or abort the + // transaction. Attempts to execute any other requests against this + // transaction (including reads and queries) are rejected. + // + // For DML statements, setting this option might cause some error reporting to + // be deferred until commit time (for example, validation of unique + // constraints). Given this, successful execution of a DML statement shouldn't + // be assumed until a subsequent `Commit` call completes successfully. + bool last_statement = 17 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If present, it makes the Spanner requests location-aware. + // + // It gives the server hints that can be used to route the request + // to an appropriate server, potentially significantly decreasing latency and + // improving throughput. To achieve improved performance, most fields must be + // filled in with accurate values. + RoutingHint routing_hint = 18 [(google.api.field_behavior) = OPTIONAL]; +} + +// The request for [ExecuteBatchDml][google.spanner.v1.Spanner.ExecuteBatchDml]. +message ExecuteBatchDmlRequest { + // A single DML statement. + message Statement { + // Required. The DML string. + string sql = 1 [(google.api.field_behavior) = REQUIRED]; + + // Parameter names and values that bind to placeholders in the DML string. + // + // A parameter placeholder consists of the `@` character followed by the + // parameter name (for example, `@firstName`). Parameter names can contain + // letters, numbers, and underscores. + // + // Parameters can appear anywhere that a literal value is expected. The + // same parameter name can be used more than once, for example: + // + // `"WHERE id > @msg_id AND id < @msg_id + 100"` + // + // It's an error to execute a SQL statement with unbound parameters. + google.protobuf.Struct params = 2; + + // It isn't always possible for Cloud Spanner to infer the right SQL type + // from a JSON value. For example, values of type `BYTES` and values + // of type `STRING` both appear in + // [params][google.spanner.v1.ExecuteBatchDmlRequest.Statement.params] as + // JSON strings. + // + // In these cases, `param_types` can be used to specify the exact + // SQL type for some or all of the SQL statement parameters. See the + // definition of [Type][google.spanner.v1.Type] for more information + // about SQL types. + map param_types = 3; + } + + // Required. The session in which the DML statements should be performed. + string session = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "spanner.googleapis.com/Session" } + ]; + + // Required. The transaction to use. Must be a read-write transaction. + // + // To protect against replays, single-use transactions are not supported. The + // caller must either supply an existing transaction ID or begin a new + // transaction. + TransactionSelector transaction = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The list of statements to execute in this batch. Statements are + // executed serially, such that the effects of statement `i` are visible to + // statement `i+1`. Each statement must be a DML statement. Execution stops at + // the first failed statement; the remaining statements are not executed. + // + // Callers must provide at least one statement. + repeated Statement statements = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. A per-transaction sequence number used to identify this request. + // This field makes each request idempotent such that if the request is + // received multiple times, at most one succeeds. + // + // The sequence number must be monotonically increasing within the + // transaction. If a request arrives for the first time with an out-of-order + // sequence number, the transaction might be aborted. Replays of previously + // handled requests yield the same response as the first execution. + int64 seqno = 4 [(google.api.field_behavior) = REQUIRED]; + + // Common options for this request. + RequestOptions request_options = 5; + + // Optional. If set to `true`, this request marks the end of the transaction. + // After these statements execute, you must commit or abort the transaction. + // Attempts to execute any other requests against this transaction + // (including reads and queries) are rejected. + // + // Setting this option might cause some error reporting to be deferred until + // commit time (for example, validation of unique constraints). Given this, + // successful execution of statements shouldn't be assumed until a subsequent + // `Commit` call completes successfully. + bool last_statements = 6 [(google.api.field_behavior) = OPTIONAL]; +} + +// The response for +// [ExecuteBatchDml][google.spanner.v1.Spanner.ExecuteBatchDml]. Contains a list +// of [ResultSet][google.spanner.v1.ResultSet] messages, one for each DML +// statement that has successfully executed, in the same order as the statements +// in the request. If a statement fails, the status in the response body +// identifies the cause of the failure. +// +// To check for DML statements that failed, use the following approach: +// +// 1. Check the status in the response message. The +// [google.rpc.Code][google.rpc.Code] enum +// value `OK` indicates that all statements were executed successfully. +// 2. If the status was not `OK`, check the number of result sets in the +// response. If the response contains `N` +// [ResultSet][google.spanner.v1.ResultSet] messages, then statement `N+1` in +// the request failed. +// +// Example 1: +// +// * Request: 5 DML statements, all executed successfully. +// * Response: 5 [ResultSet][google.spanner.v1.ResultSet] messages, with the +// status `OK`. +// +// Example 2: +// +// * Request: 5 DML statements. The third statement has a syntax error. +// * Response: 2 [ResultSet][google.spanner.v1.ResultSet] messages, and a syntax +// error (`INVALID_ARGUMENT`) +// status. The number of [ResultSet][google.spanner.v1.ResultSet] messages +// indicates that the third statement failed, and the fourth and fifth +// statements were not executed. +message ExecuteBatchDmlResponse { + // One [ResultSet][google.spanner.v1.ResultSet] for each statement in the + // request that ran successfully, in the same order as the statements in the + // request. Each [ResultSet][google.spanner.v1.ResultSet] does not contain any + // rows. The [ResultSetStats][google.spanner.v1.ResultSetStats] in each + // [ResultSet][google.spanner.v1.ResultSet] contain the number of rows + // modified by the statement. + // + // Only the first [ResultSet][google.spanner.v1.ResultSet] in the response + // contains valid [ResultSetMetadata][google.spanner.v1.ResultSetMetadata]. + repeated ResultSet result_sets = 1; + + // If all DML statements are executed successfully, the status is `OK`. + // Otherwise, the error status of the first failed statement. + google.rpc.Status status = 2; + + // Optional. A precommit token is included if the read-write transaction + // is on a multiplexed session. Pass the precommit token with the highest + // sequence number from this transaction attempt should be passed to the + // [Commit][google.spanner.v1.Spanner.Commit] request for this transaction. + MultiplexedSessionPrecommitToken precommit_token = 3 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Options for a `PartitionQueryRequest` and `PartitionReadRequest`. +message PartitionOptions { + // **Note:** This hint is currently ignored by `PartitionQuery` and + // `PartitionRead` requests. + // + // The desired data size for each partition generated. The default for this + // option is currently 1 GiB. This is only a hint. The actual size of each + // partition can be smaller or larger than this size request. + int64 partition_size_bytes = 1; + + // **Note:** This hint is currently ignored by `PartitionQuery` and + // `PartitionRead` requests. + // + // The desired maximum number of partitions to return. For example, this + // might be set to the number of workers available. The default for this + // option is currently 10,000. The maximum value is currently 200,000. This + // is only a hint. The actual number of partitions returned can be smaller or + // larger than this maximum count request. + int64 max_partitions = 2; +} + +// The request for [PartitionQuery][google.spanner.v1.Spanner.PartitionQuery] +message PartitionQueryRequest { + // Required. The session used to create the partitions. + string session = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "spanner.googleapis.com/Session" } + ]; + + // Read-only snapshot transactions are supported, read and write and + // single-use transactions are not. + TransactionSelector transaction = 2; + + // Required. The query request to generate partitions for. The request fails + // if the query isn't root partitionable. For a query to be root + // partitionable, it needs to satisfy a few conditions. For example, if the + // query execution plan contains a distributed union operator, then it must be + // the first operator in the plan. For more information about other + // conditions, see [Read data in + // parallel](https://cloud.google.com/spanner/docs/reads#read_data_in_parallel). + // + // The query request must not contain DML commands, such as `INSERT`, + // `UPDATE`, or `DELETE`. Use + // [`ExecuteStreamingSql`][google.spanner.v1.Spanner.ExecuteStreamingSql] with + // a `PartitionedDml` transaction for large, partition-friendly DML + // operations. + string sql = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Parameter names and values that bind to placeholders in the SQL + // string. + // + // A parameter placeholder consists of the `@` character followed by the + // parameter name (for example, `@firstName`). Parameter names can contain + // letters, numbers, and underscores. + // + // Parameters can appear anywhere that a literal value is expected. The same + // parameter name can be used more than once, for example: + // + // `"WHERE id > @msg_id AND id < @msg_id + 100"` + // + // It's an error to execute a SQL statement with unbound parameters. + google.protobuf.Struct params = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. It isn't always possible for Cloud Spanner to infer the right SQL + // type from a JSON value. For example, values of type `BYTES` and values of + // type `STRING` both appear in + // [params][google.spanner.v1.PartitionQueryRequest.params] as JSON strings. + // + // In these cases, `param_types` can be used to specify the exact + // SQL type for some or all of the SQL query parameters. See the + // definition of [Type][google.spanner.v1.Type] for more information + // about SQL types. + map param_types = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Additional options that affect how many partitions are created. + PartitionOptions partition_options = 6; +} + +// The request for [PartitionRead][google.spanner.v1.Spanner.PartitionRead] +message PartitionReadRequest { + // Required. The session used to create the partitions. + string session = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "spanner.googleapis.com/Session" } + ]; + + // Read only snapshot transactions are supported, read/write and single use + // transactions are not. + TransactionSelector transaction = 2; + + // Required. The name of the table in the database to be read. + string table = 3 [(google.api.field_behavior) = REQUIRED]; + + // If non-empty, the name of an index on + // [table][google.spanner.v1.PartitionReadRequest.table]. This index is used + // instead of the table primary key when interpreting + // [key_set][google.spanner.v1.PartitionReadRequest.key_set] and sorting + // result rows. See [key_set][google.spanner.v1.PartitionReadRequest.key_set] + // for further information. + string index = 4; + + // The columns of [table][google.spanner.v1.PartitionReadRequest.table] to be + // returned for each row matching this request. + repeated string columns = 5; + + // Required. `key_set` identifies the rows to be yielded. `key_set` names the + // primary keys of the rows in + // [table][google.spanner.v1.PartitionReadRequest.table] to be yielded, unless + // [index][google.spanner.v1.PartitionReadRequest.index] is present. If + // [index][google.spanner.v1.PartitionReadRequest.index] is present, then + // [key_set][google.spanner.v1.PartitionReadRequest.key_set] instead names + // index keys in [index][google.spanner.v1.PartitionReadRequest.index]. + // + // It isn't an error for the `key_set` to name rows that don't + // exist in the database. Read yields nothing for nonexistent rows. + KeySet key_set = 6 [(google.api.field_behavior) = REQUIRED]; + + // Additional options that affect how many partitions are created. + PartitionOptions partition_options = 9; +} + +// Information returned for each partition returned in a +// PartitionResponse. +message Partition { + // This token can be passed to `Read`, `StreamingRead`, `ExecuteSql`, or + // `ExecuteStreamingSql` requests to restrict the results to those identified + // by this partition token. + bytes partition_token = 1; +} + +// The response for [PartitionQuery][google.spanner.v1.Spanner.PartitionQuery] +// or [PartitionRead][google.spanner.v1.Spanner.PartitionRead] +message PartitionResponse { + // Partitions created by this request. + repeated Partition partitions = 1; + + // Transaction created by this request. + Transaction transaction = 2; +} + +// The request for [Read][google.spanner.v1.Spanner.Read] and +// [StreamingRead][google.spanner.v1.Spanner.StreamingRead]. +message ReadRequest { + // An option to control the order in which rows are returned from a read. + enum OrderBy { + // Default value. + // + // `ORDER_BY_UNSPECIFIED` is equivalent to `ORDER_BY_PRIMARY_KEY`. + ORDER_BY_UNSPECIFIED = 0; + + // Read rows are returned in primary key order. + // + // In the event that this option is used in conjunction with the + // `partition_token` field, the API returns an `INVALID_ARGUMENT` error. + ORDER_BY_PRIMARY_KEY = 1; + + // Read rows are returned in any order. + ORDER_BY_NO_ORDER = 2; + } + + // A lock hint mechanism for reads done within a transaction. + enum LockHint { + // Default value. + // + // `LOCK_HINT_UNSPECIFIED` is equivalent to `LOCK_HINT_SHARED`. + LOCK_HINT_UNSPECIFIED = 0; + + // Acquire shared locks. + // + // By default when you perform a read as part of a read-write transaction, + // Spanner acquires shared read locks, which allows other reads to still + // access the data until your transaction is ready to commit. When your + // transaction is committing and writes are being applied, the transaction + // attempts to upgrade to an exclusive lock for any data you are writing. + // For more information about locks, see [Lock + // modes](https://cloud.google.com/spanner/docs/introspection/lock-statistics#explain-lock-modes). + LOCK_HINT_SHARED = 1; + + // Acquire exclusive locks. + // + // Requesting exclusive locks is beneficial if you observe high write + // contention, which means you notice that multiple transactions are + // concurrently trying to read and write to the same data, resulting in a + // large number of aborts. This problem occurs when two transactions + // initially acquire shared locks and then both try to upgrade to exclusive + // locks at the same time. In this situation both transactions are waiting + // for the other to give up their lock, resulting in a deadlocked situation. + // Spanner is able to detect this occurring and force one of the + // transactions to abort. However, this is a slow and expensive operation + // and results in lower performance. In this case it makes sense to acquire + // exclusive locks at the start of the transaction because then when + // multiple transactions try to act on the same data, they automatically get + // serialized. Each transaction waits its turn to acquire the lock and + // avoids getting into deadlock situations. + // + // Because the exclusive lock hint is just a hint, it shouldn't be + // considered equivalent to a mutex. In other words, you shouldn't use + // Spanner exclusive locks as a mutual exclusion mechanism for the execution + // of code outside of Spanner. + // + // **Note:** Request exclusive locks judiciously because they block others + // from reading that data for the entire transaction, rather than just when + // the writes are being performed. Unless you observe high write contention, + // you should use the default of shared read locks so you don't prematurely + // block other clients from reading the data that you're writing to. + LOCK_HINT_EXCLUSIVE = 2; + } + + // Required. The session in which the read should be performed. + string session = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "spanner.googleapis.com/Session" } + ]; + + // The transaction to use. If none is provided, the default is a + // temporary read-only transaction with strong concurrency. + TransactionSelector transaction = 2; + + // Required. The name of the table in the database to be read. + string table = 3 [(google.api.field_behavior) = REQUIRED]; + + // If non-empty, the name of an index on + // [table][google.spanner.v1.ReadRequest.table]. This index is used instead of + // the table primary key when interpreting + // [key_set][google.spanner.v1.ReadRequest.key_set] and sorting result rows. + // See [key_set][google.spanner.v1.ReadRequest.key_set] for further + // information. + string index = 4; + + // Required. The columns of [table][google.spanner.v1.ReadRequest.table] to be + // returned for each row matching this request. + repeated string columns = 5 [(google.api.field_behavior) = REQUIRED]; + + // Required. `key_set` identifies the rows to be yielded. `key_set` names the + // primary keys of the rows in [table][google.spanner.v1.ReadRequest.table] to + // be yielded, unless [index][google.spanner.v1.ReadRequest.index] is present. + // If [index][google.spanner.v1.ReadRequest.index] is present, then + // [key_set][google.spanner.v1.ReadRequest.key_set] instead names index keys + // in [index][google.spanner.v1.ReadRequest.index]. + // + // If the [partition_token][google.spanner.v1.ReadRequest.partition_token] + // field is empty, rows are yielded in table primary key order (if + // [index][google.spanner.v1.ReadRequest.index] is empty) or index key order + // (if [index][google.spanner.v1.ReadRequest.index] is non-empty). If the + // [partition_token][google.spanner.v1.ReadRequest.partition_token] field + // isn't empty, rows are yielded in an unspecified order. + // + // It isn't an error for the `key_set` to name rows that don't + // exist in the database. Read yields nothing for nonexistent rows. + KeySet key_set = 6 [(google.api.field_behavior) = REQUIRED]; + + // If greater than zero, only the first `limit` rows are yielded. If `limit` + // is zero, the default is no limit. A limit can't be specified if + // `partition_token` is set. + int64 limit = 8; + + // If this request is resuming a previously interrupted read, + // `resume_token` should be copied from the last + // [PartialResultSet][google.spanner.v1.PartialResultSet] yielded before the + // interruption. Doing this enables the new read to resume where the last read + // left off. The rest of the request parameters must exactly match the request + // that yielded this token. + bytes resume_token = 9; + + // If present, results are restricted to the specified partition + // previously created using `PartitionRead`. There must be an exact + // match for the values of fields common to this message and the + // PartitionReadRequest message used to create this partition_token. + bytes partition_token = 10; + + // Common options for this request. + RequestOptions request_options = 11; + + // Directed read options for this request. + DirectedReadOptions directed_read_options = 14; + + // If this is for a partitioned read and this field is set to `true`, the + // request is executed with Spanner Data Boost independent compute resources. + // + // If the field is set to `true` but the request doesn't set + // `partition_token`, the API returns an `INVALID_ARGUMENT` error. + bool data_boost_enabled = 15; + + // Optional. Order for the returned rows. + // + // By default, Spanner returns result rows in primary key order except for + // PartitionRead requests. For applications that don't require rows to be + // returned in primary key (`ORDER_BY_PRIMARY_KEY`) order, setting + // `ORDER_BY_NO_ORDER` option allows Spanner to optimize row retrieval, + // resulting in lower latencies in certain cases (for example, bulk point + // lookups). + OrderBy order_by = 16 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Lock Hint for the request, it can only be used with read-write + // transactions. + LockHint lock_hint = 17 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If present, it makes the Spanner requests location-aware. + // + // It gives the server hints that can be used to route the request + // to an appropriate server, potentially significantly decreasing latency and + // improving throughput. To achieve improved performance, most fields must be + // filled in with accurate values. + RoutingHint routing_hint = 18 [(google.api.field_behavior) = OPTIONAL]; +} + +// The request for +// [BeginTransaction][google.spanner.v1.Spanner.BeginTransaction]. +message BeginTransactionRequest { + // Required. The session in which the transaction runs. + string session = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "spanner.googleapis.com/Session" } + ]; + + // Required. Options for the new transaction. + TransactionOptions options = 2 [(google.api.field_behavior) = REQUIRED]; + + // Common options for this request. + // Priority is ignored for this request. Setting the priority in this + // `request_options` struct doesn't do anything. To set the priority for a + // transaction, set it on the reads and writes that are part of this + // transaction instead. + RequestOptions request_options = 3; + + // Optional. Required for read-write transactions on a multiplexed session + // that commit mutations but don't perform any reads or queries. You must + // randomly select one of the mutations from the mutation set and send it as a + // part of this request. + Mutation mutation_key = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// The request for [Commit][google.spanner.v1.Spanner.Commit]. +message CommitRequest { + // Required. The session in which the transaction to be committed is running. + string session = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "spanner.googleapis.com/Session" } + ]; + + // Required. The transaction in which to commit. + oneof transaction { + // Commit a previously-started transaction. + bytes transaction_id = 2; + + // Execute mutations in a temporary transaction. Note that unlike + // commit of a previously-started transaction, commit with a + // temporary transaction is non-idempotent. That is, if the + // `CommitRequest` is sent to Cloud Spanner more than once (for + // instance, due to retries in the application, or in the + // transport library), it's possible that the mutations are + // executed more than once. If this is undesirable, use + // [BeginTransaction][google.spanner.v1.Spanner.BeginTransaction] and + // [Commit][google.spanner.v1.Spanner.Commit] instead. + TransactionOptions single_use_transaction = 3; + } + + // The mutations to be executed when this transaction commits. All + // mutations are applied atomically, in the order they appear in + // this list. + repeated Mutation mutations = 4; + + // If `true`, then statistics related to the transaction is included in + // the [CommitResponse][google.spanner.v1.CommitResponse.commit_stats]. + // Default value is `false`. + bool return_commit_stats = 5; + + // Optional. The amount of latency this request is configured to incur in + // order to improve throughput. If this field isn't set, Spanner assumes + // requests are relatively latency sensitive and automatically determines an + // appropriate delay time. You can specify a commit delay value between 0 and + // 500 ms. + google.protobuf.Duration max_commit_delay = 8 + [(google.api.field_behavior) = OPTIONAL]; + + // Common options for this request. + RequestOptions request_options = 6; + + // Optional. If the read-write transaction was executed on a multiplexed + // session, then you must include the precommit token with the highest + // sequence number received in this transaction attempt. Failing to do so + // results in a `FailedPrecondition` error. + MultiplexedSessionPrecommitToken precommit_token = 9 + [(google.api.field_behavior) = OPTIONAL]; +} + +// The request for [Rollback][google.spanner.v1.Spanner.Rollback]. +message RollbackRequest { + // Required. The session in which the transaction to roll back is running. + string session = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "spanner.googleapis.com/Session" } + ]; + + // Required. The transaction to roll back. + bytes transaction_id = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The request for [BatchWrite][google.spanner.v1.Spanner.BatchWrite]. +message BatchWriteRequest { + // A group of mutations to be committed together. Related mutations should be + // placed in a group. For example, two mutations inserting rows with the same + // primary key prefix in both parent and child tables are related. + message MutationGroup { + // Required. The mutations in this group. + repeated Mutation mutations = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // Required. The session in which the batch request is to be run. + string session = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "spanner.googleapis.com/Session" } + ]; + + // Common options for this request. + RequestOptions request_options = 3; + + // Required. The groups of mutations to be applied. + repeated MutationGroup mutation_groups = 4 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. If you don't set the `exclude_txn_from_change_streams` option or + // if it's set to `false`, then any change streams monitoring columns modified + // by transactions will capture the updates made within that transaction. + bool exclude_txn_from_change_streams = 5 + [(google.api.field_behavior) = OPTIONAL]; +} + +// The result of applying a batch of mutations. +message BatchWriteResponse { + // The mutation groups applied in this batch. The values index into the + // `mutation_groups` field in the corresponding `BatchWriteRequest`. + repeated int32 indexes = 1; + + // An `OK` status indicates success. Any other status indicates a failure. + google.rpc.Status status = 2; + + // The commit timestamp of the transaction that applied this batch. + // Present if status is OK and the mutation groups were applied, absent + // otherwise. + // + // For mutation groups with conditions, a status=OK and missing + // commit_timestamp means that the mutation groups were not applied due to the + // condition not being satisfied after evaluation. + google.protobuf.Timestamp commit_timestamp = 3; +} diff --git a/owl-bot-staging/executor/v1/protos/google/spanner/v1/transaction.proto b/owl-bot-staging/executor/v1/protos/google/spanner/v1/transaction.proto new file mode 100644 index 000000000..dfdf3b11a --- /dev/null +++ b/owl-bot-staging/executor/v1/protos/google/spanner/v1/transaction.proto @@ -0,0 +1,309 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.spanner.v1; + +import "google/api/field_behavior.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Spanner.V1"; +option go_package = "cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb"; +option java_multiple_files = true; +option java_outer_classname = "TransactionProto"; +option java_package = "com.google.spanner.v1"; +option php_namespace = "Google\\Cloud\\Spanner\\V1"; +option ruby_package = "Google::Cloud::Spanner::V1"; + +// Options to use for transactions. +message TransactionOptions { + // Message type to initiate a read-write transaction. Currently this + // transaction type has no options. + message ReadWrite { + // `ReadLockMode` is used to set the read lock mode for read-write + // transactions. + enum ReadLockMode { + // Default value. + // + // * If isolation level is + // [REPEATABLE_READ][google.spanner.v1.TransactionOptions.IsolationLevel.REPEATABLE_READ], + // then it is an error to specify `read_lock_mode`. Locking semantics + // default to `OPTIMISTIC`. No validation checks are done for reads, + // except to validate that the data that was served at the snapshot time + // is unchanged at commit time in the following cases: + // 1. reads done as part of queries that use `SELECT FOR UPDATE` + // 2. reads done as part of statements with a `LOCK_SCANNED_RANGES` + // hint + // 3. reads done as part of DML statements + // * At all other isolation levels, if `read_lock_mode` is the default + // value, then pessimistic read locks are used. + READ_LOCK_MODE_UNSPECIFIED = 0; + + // Pessimistic lock mode. + // + // Read locks are acquired immediately on read. + // Semantics described only applies to + // [SERIALIZABLE][google.spanner.v1.TransactionOptions.IsolationLevel.SERIALIZABLE] + // isolation. + PESSIMISTIC = 1; + + // Optimistic lock mode. + // + // Locks for reads within the transaction are not acquired on read. + // Instead the locks are acquired on a commit to validate that + // read/queried data has not changed since the transaction started. + // Semantics described only applies to + // [SERIALIZABLE][google.spanner.v1.TransactionOptions.IsolationLevel.SERIALIZABLE] + // isolation. + OPTIMISTIC = 2; + } + + // Read lock mode for the transaction. + ReadLockMode read_lock_mode = 1; + + // Optional. Clients should pass the transaction ID of the previous + // transaction attempt that was aborted if this transaction is being + // executed on a multiplexed session. + bytes multiplexed_session_previous_transaction_id = 2 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Message type to initiate a Partitioned DML transaction. + message PartitionedDml {} + + // Message type to initiate a read-only transaction. + message ReadOnly { + // How to choose the timestamp for the read-only transaction. + oneof timestamp_bound { + // Read at a timestamp where all previously committed transactions + // are visible. + bool strong = 1; + + // Executes all reads at a timestamp >= `min_read_timestamp`. + // + // This is useful for requesting fresher data than some previous + // read, or data that is fresh enough to observe the effects of some + // previously committed transaction whose timestamp is known. + // + // Note that this option can only be used in single-use transactions. + // + // A timestamp in RFC3339 UTC \"Zulu\" format, accurate to nanoseconds. + // Example: `"2014-10-02T15:01:23.045123456Z"`. + google.protobuf.Timestamp min_read_timestamp = 2; + + // Read data at a timestamp >= `NOW - max_staleness` + // seconds. Guarantees that all writes that have committed more + // than the specified number of seconds ago are visible. Because + // Cloud Spanner chooses the exact timestamp, this mode works even if + // the client's local clock is substantially skewed from Cloud Spanner + // commit timestamps. + // + // Useful for reading the freshest data available at a nearby + // replica, while bounding the possible staleness if the local + // replica has fallen behind. + // + // Note that this option can only be used in single-use + // transactions. + google.protobuf.Duration max_staleness = 3; + + // Executes all reads at the given timestamp. Unlike other modes, + // reads at a specific timestamp are repeatable; the same read at + // the same timestamp always returns the same data. If the + // timestamp is in the future, the read is blocked until the + // specified timestamp, modulo the read's deadline. + // + // Useful for large scale consistent reads such as mapreduces, or + // for coordinating many reads against a consistent snapshot of the + // data. + // + // A timestamp in RFC3339 UTC \"Zulu\" format, accurate to nanoseconds. + // Example: `"2014-10-02T15:01:23.045123456Z"`. + google.protobuf.Timestamp read_timestamp = 4; + + // Executes all reads at a timestamp that is `exact_staleness` + // old. The timestamp is chosen soon after the read is started. + // + // Guarantees that all writes that have committed more than the + // specified number of seconds ago are visible. Because Cloud Spanner + // chooses the exact timestamp, this mode works even if the client's + // local clock is substantially skewed from Cloud Spanner commit + // timestamps. + // + // Useful for reading at nearby replicas without the distributed + // timestamp negotiation overhead of `max_staleness`. + google.protobuf.Duration exact_staleness = 5; + } + + // If true, the Cloud Spanner-selected read timestamp is included in + // the [Transaction][google.spanner.v1.Transaction] message that describes + // the transaction. + bool return_read_timestamp = 6; + } + + // `IsolationLevel` is used when setting the [isolation + // level](https://cloud.google.com/spanner/docs/isolation-levels) for a + // transaction. + enum IsolationLevel { + // Default value. + // + // If the value is not specified, the `SERIALIZABLE` isolation level is + // used. + ISOLATION_LEVEL_UNSPECIFIED = 0; + + // All transactions appear as if they executed in a serial order, even if + // some of the reads, writes, and other operations of distinct transactions + // actually occurred in parallel. Spanner assigns commit timestamps that + // reflect the order of committed transactions to implement this property. + // Spanner offers a stronger guarantee than serializability called external + // consistency. For more information, see + // [TrueTime and external + // consistency](https://cloud.google.com/spanner/docs/true-time-external-consistency#serializability). + SERIALIZABLE = 1; + + // All reads performed during the transaction observe a consistent snapshot + // of the database, and the transaction is only successfully committed in + // the absence of conflicts between its updates and any concurrent updates + // that have occurred since that snapshot. Consequently, in contrast to + // `SERIALIZABLE` transactions, only write-write conflicts are detected in + // snapshot transactions. + // + // This isolation level does not support read-only and partitioned DML + // transactions. + // + // When `REPEATABLE_READ` is specified on a read-write transaction, the + // locking semantics default to `OPTIMISTIC`. + REPEATABLE_READ = 2; + } + + // Required. The type of transaction. + oneof mode { + // Transaction may write. + // + // Authorization to begin a read-write transaction requires + // `spanner.databases.beginOrRollbackReadWriteTransaction` permission + // on the `session` resource. + ReadWrite read_write = 1; + + // Partitioned DML transaction. + // + // Authorization to begin a Partitioned DML transaction requires + // `spanner.databases.beginPartitionedDmlTransaction` permission + // on the `session` resource. + PartitionedDml partitioned_dml = 3; + + // Transaction does not write. + // + // Authorization to begin a read-only transaction requires + // `spanner.databases.beginReadOnlyTransaction` permission + // on the `session` resource. + ReadOnly read_only = 2; + } + + // When `exclude_txn_from_change_streams` is set to `true`, it prevents read + // or write transactions from being tracked in change streams. + // + // * If the DDL option `allow_txn_exclusion` is set to `true`, then the + // updates + // made within this transaction aren't recorded in the change stream. + // + // * If you don't set the DDL option `allow_txn_exclusion` or if it's + // set to `false`, then the updates made within this transaction are + // recorded in the change stream. + // + // When `exclude_txn_from_change_streams` is set to `false` or not set, + // modifications from this transaction are recorded in all change streams + // that are tracking columns modified by these transactions. + // + // The `exclude_txn_from_change_streams` option can only be specified + // for read-write or partitioned DML transactions, otherwise the API returns + // an `INVALID_ARGUMENT` error. + bool exclude_txn_from_change_streams = 5; + + // Isolation level for the transaction. + IsolationLevel isolation_level = 6; +} + +// A transaction. +message Transaction { + // `id` may be used to identify the transaction in subsequent + // [Read][google.spanner.v1.Spanner.Read], + // [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql], + // [Commit][google.spanner.v1.Spanner.Commit], or + // [Rollback][google.spanner.v1.Spanner.Rollback] calls. + // + // Single-use read-only transactions do not have IDs, because + // single-use transactions do not support multiple requests. + bytes id = 1; + + // For snapshot read-only transactions, the read timestamp chosen + // for the transaction. Not returned by default: see + // [TransactionOptions.ReadOnly.return_read_timestamp][google.spanner.v1.TransactionOptions.ReadOnly.return_read_timestamp]. + // + // A timestamp in RFC3339 UTC \"Zulu\" format, accurate to nanoseconds. + // Example: `"2014-10-02T15:01:23.045123456Z"`. + google.protobuf.Timestamp read_timestamp = 2; + + // A precommit token is included in the response of a BeginTransaction + // request if the read-write transaction is on a multiplexed session and + // a mutation_key was specified in the + // [BeginTransaction][google.spanner.v1.BeginTransactionRequest]. + // The precommit token with the highest sequence number from this transaction + // attempt should be passed to the [Commit][google.spanner.v1.Spanner.Commit] + // request for this transaction. + MultiplexedSessionPrecommitToken precommit_token = 3; +} + +// This message is used to select the transaction in which a +// [Read][google.spanner.v1.Spanner.Read] or +// [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql] call runs. +// +// See [TransactionOptions][google.spanner.v1.TransactionOptions] for more +// information about transactions. +message TransactionSelector { + // If no fields are set, the default is a single use transaction + // with strong concurrency. + oneof selector { + // Execute the read or SQL query in a temporary transaction. + // This is the most efficient way to execute a transaction that + // consists of a single SQL query. + TransactionOptions single_use = 1; + + // Execute the read or SQL query in a previously-started transaction. + bytes id = 2; + + // Begin a new transaction and execute this read or SQL query in + // it. The transaction ID of the new transaction is returned in + // [ResultSetMetadata.transaction][google.spanner.v1.ResultSetMetadata.transaction], + // which is a [Transaction][google.spanner.v1.Transaction]. + TransactionOptions begin = 3; + } +} + +// When a read-write transaction is executed on a multiplexed session, +// this precommit token is sent back to the client +// as a part of the [Transaction][google.spanner.v1.Transaction] message in the +// [BeginTransaction][google.spanner.v1.BeginTransactionRequest] response and +// also as a part of the [ResultSet][google.spanner.v1.ResultSet] and +// [PartialResultSet][google.spanner.v1.PartialResultSet] responses. +message MultiplexedSessionPrecommitToken { + // Opaque precommit token. + bytes precommit_token = 1; + + // An incrementing seq number is generated on every precommit token + // that is returned. Clients should remember the precommit token with the + // highest sequence number from the current transaction attempt. + int32 seq_num = 2; +} diff --git a/owl-bot-staging/executor/v1/protos/google/spanner/v1/type.proto b/owl-bot-staging/executor/v1/protos/google/spanner/v1/type.proto new file mode 100644 index 000000000..e3e85a770 --- /dev/null +++ b/owl-bot-staging/executor/v1/protos/google/spanner/v1/type.proto @@ -0,0 +1,214 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.spanner.v1; + +import "google/api/field_behavior.proto"; + +option csharp_namespace = "Google.Cloud.Spanner.V1"; +option go_package = "cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb"; +option java_multiple_files = true; +option java_outer_classname = "TypeProto"; +option java_package = "com.google.spanner.v1"; +option php_namespace = "Google\\Cloud\\Spanner\\V1"; +option ruby_package = "Google::Cloud::Spanner::V1"; + +// `Type` indicates the type of a Cloud Spanner value, as might be stored in a +// table cell or returned from an SQL query. +message Type { + // Required. The [TypeCode][google.spanner.v1.TypeCode] for this type. + TypeCode code = 1 [(google.api.field_behavior) = REQUIRED]; + + // If [code][google.spanner.v1.Type.code] == + // [ARRAY][google.spanner.v1.TypeCode.ARRAY], then `array_element_type` is the + // type of the array elements. + Type array_element_type = 2; + + // If [code][google.spanner.v1.Type.code] == + // [STRUCT][google.spanner.v1.TypeCode.STRUCT], then `struct_type` provides + // type information for the struct's fields. + StructType struct_type = 3; + + // The [TypeAnnotationCode][google.spanner.v1.TypeAnnotationCode] that + // disambiguates SQL type that Spanner will use to represent values of this + // type during query processing. This is necessary for some type codes because + // a single [TypeCode][google.spanner.v1.TypeCode] can be mapped to different + // SQL types depending on the SQL dialect. + // [type_annotation][google.spanner.v1.Type.type_annotation] typically is not + // needed to process the content of a value (it doesn't affect serialization) + // and clients can ignore it on the read path. + TypeAnnotationCode type_annotation = 4; + + // If [code][google.spanner.v1.Type.code] == + // [PROTO][google.spanner.v1.TypeCode.PROTO] or + // [code][google.spanner.v1.Type.code] == + // [ENUM][google.spanner.v1.TypeCode.ENUM], then `proto_type_fqn` is the fully + // qualified name of the proto type representing the proto/enum definition. + string proto_type_fqn = 5; +} + +// `StructType` defines the fields of a +// [STRUCT][google.spanner.v1.TypeCode.STRUCT] type. +message StructType { + // Message representing a single field of a struct. + message Field { + // The name of the field. For reads, this is the column name. For + // SQL queries, it is the column alias (e.g., `"Word"` in the + // query `"SELECT 'hello' AS Word"`), or the column name (e.g., + // `"ColName"` in the query `"SELECT ColName FROM Table"`). Some + // columns might have an empty name (e.g., `"SELECT + // UPPER(ColName)"`). Note that a query result can contain + // multiple fields with the same name. + string name = 1; + + // The type of the field. + Type type = 2; + } + + // The list of fields that make up this struct. Order is + // significant, because values of this struct type are represented as + // lists, where the order of field values matches the order of + // fields in the [StructType][google.spanner.v1.StructType]. In turn, the + // order of fields matches the order of columns in a read request, or the + // order of fields in the `SELECT` clause of a query. + repeated Field fields = 1; +} + +// `TypeCode` is used as part of [Type][google.spanner.v1.Type] to +// indicate the type of a Cloud Spanner value. +// +// Each legal value of a type can be encoded to or decoded from a JSON +// value, using the encodings described below. All Cloud Spanner values can +// be `null`, regardless of type; `null`s are always encoded as a JSON +// `null`. +enum TypeCode { + // Not specified. + TYPE_CODE_UNSPECIFIED = 0; + + // Encoded as JSON `true` or `false`. + BOOL = 1; + + // Encoded as `string`, in decimal format. + INT64 = 2; + + // Encoded as `number`, or the strings `"NaN"`, `"Infinity"`, or + // `"-Infinity"`. + FLOAT64 = 3; + + // Encoded as `number`, or the strings `"NaN"`, `"Infinity"`, or + // `"-Infinity"`. + FLOAT32 = 15; + + // Encoded as `string` in RFC 3339 timestamp format. The time zone + // must be present, and must be `"Z"`. + // + // If the schema has the column option + // `allow_commit_timestamp=true`, the placeholder string + // `"spanner.commit_timestamp()"` can be used to instruct the system + // to insert the commit timestamp associated with the transaction + // commit. + TIMESTAMP = 4; + + // Encoded as `string` in RFC 3339 date format. + DATE = 5; + + // Encoded as `string`. + STRING = 6; + + // Encoded as a base64-encoded `string`, as described in RFC 4648, + // section 4. + BYTES = 7; + + // Encoded as `list`, where the list elements are represented + // according to + // [array_element_type][google.spanner.v1.Type.array_element_type]. + ARRAY = 8; + + // Encoded as `list`, where list element `i` is represented according + // to [struct_type.fields[i]][google.spanner.v1.StructType.fields]. + STRUCT = 9; + + // Encoded as `string`, in decimal format or scientific notation format. + // Decimal format: + // `[+-]Digits[.[Digits]]` or + // `[+-][Digits].Digits` + // + // Scientific notation: + // `[+-]Digits[.[Digits]][ExponentIndicator[+-]Digits]` or + // `[+-][Digits].Digits[ExponentIndicator[+-]Digits]` + // (ExponentIndicator is `"e"` or `"E"`) + NUMERIC = 10; + + // Encoded as a JSON-formatted `string` as described in RFC 7159. The + // following rules are applied when parsing JSON input: + // + // - Whitespace characters are not preserved. + // - If a JSON object has duplicate keys, only the first key is preserved. + // - Members of a JSON object are not guaranteed to have their order + // preserved. + // - JSON array elements will have their order preserved. + JSON = 11; + + // Encoded as a base64-encoded `string`, as described in RFC 4648, + // section 4. + PROTO = 13; + + // Encoded as `string`, in decimal format. + ENUM = 14; + + // Encoded as `string`, in `ISO8601` duration format - + // `P[n]Y[n]M[n]DT[n]H[n]M[n[.fraction]]S` + // where `n` is an integer. + // For example, `P1Y2M3DT4H5M6.5S` represents time duration of 1 year, 2 + // months, 3 days, 4 hours, 5 minutes, and 6.5 seconds. + INTERVAL = 16; + + // Encoded as `string`, in lower-case hexa-decimal format, as described + // in RFC 9562, section 4. + UUID = 17; +} + +// `TypeAnnotationCode` is used as a part of [Type][google.spanner.v1.Type] to +// disambiguate SQL types that should be used for a given Cloud Spanner value. +// Disambiguation is needed because the same Cloud Spanner type can be mapped to +// different SQL types depending on SQL dialect. TypeAnnotationCode doesn't +// affect the way value is serialized. +enum TypeAnnotationCode { + // Not specified. + TYPE_ANNOTATION_CODE_UNSPECIFIED = 0; + + // PostgreSQL compatible NUMERIC type. This annotation needs to be applied to + // [Type][google.spanner.v1.Type] instances having + // [NUMERIC][google.spanner.v1.TypeCode.NUMERIC] type code to specify that + // values of this type should be treated as PostgreSQL NUMERIC values. + // Currently this annotation is always needed for + // [NUMERIC][google.spanner.v1.TypeCode.NUMERIC] when a client interacts with + // PostgreSQL-enabled Spanner databases. + PG_NUMERIC = 2; + + // PostgreSQL compatible JSONB type. This annotation needs to be applied to + // [Type][google.spanner.v1.Type] instances having + // [JSON][google.spanner.v1.TypeCode.JSON] type code to specify that values of + // this type should be treated as PostgreSQL JSONB values. Currently this + // annotation is always needed for [JSON][google.spanner.v1.TypeCode.JSON] + // when a client interacts with PostgreSQL-enabled Spanner databases. + PG_JSONB = 3; + + // PostgreSQL compatible OID type. This annotation can be used by a client + // interacting with PostgreSQL-enabled Spanner database to specify that a + // value should be treated using the semantics of the OID type. + PG_OID = 4; +} diff --git a/owl-bot-staging/executor/v1/protos/protos.d.ts b/owl-bot-staging/executor/v1/protos/protos.d.ts new file mode 100644 index 000000000..c9f7706e2 --- /dev/null +++ b/owl-bot-staging/executor/v1/protos/protos.d.ts @@ -0,0 +1,40265 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import type {protobuf as $protobuf} from "google-gax"; +import Long = require("long"); +/** Namespace google. */ +export namespace google { + + /** Namespace spanner. */ + namespace spanner { + + /** Namespace admin. */ + namespace admin { + + /** Namespace database. */ + namespace database { + + /** Namespace v1. */ + namespace v1 { + + /** Properties of a Backup. */ + interface IBackup { + + /** Backup database */ + database?: (string|null); + + /** Backup versionTime */ + versionTime?: (google.protobuf.ITimestamp|null); + + /** Backup expireTime */ + expireTime?: (google.protobuf.ITimestamp|null); + + /** Backup name */ + name?: (string|null); + + /** Backup createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Backup sizeBytes */ + sizeBytes?: (number|Long|string|null); + + /** Backup freeableSizeBytes */ + freeableSizeBytes?: (number|Long|string|null); + + /** Backup exclusiveSizeBytes */ + exclusiveSizeBytes?: (number|Long|string|null); + + /** Backup state */ + state?: (google.spanner.admin.database.v1.Backup.State|keyof typeof google.spanner.admin.database.v1.Backup.State|null); + + /** Backup referencingDatabases */ + referencingDatabases?: (string[]|null); + + /** Backup encryptionInfo */ + encryptionInfo?: (google.spanner.admin.database.v1.IEncryptionInfo|null); + + /** Backup encryptionInformation */ + encryptionInformation?: (google.spanner.admin.database.v1.IEncryptionInfo[]|null); + + /** Backup databaseDialect */ + databaseDialect?: (google.spanner.admin.database.v1.DatabaseDialect|keyof typeof google.spanner.admin.database.v1.DatabaseDialect|null); + + /** Backup referencingBackups */ + referencingBackups?: (string[]|null); + + /** Backup maxExpireTime */ + maxExpireTime?: (google.protobuf.ITimestamp|null); + + /** Backup backupSchedules */ + backupSchedules?: (string[]|null); + + /** Backup incrementalBackupChainId */ + incrementalBackupChainId?: (string|null); + + /** Backup oldestVersionTime */ + oldestVersionTime?: (google.protobuf.ITimestamp|null); + + /** Backup instancePartitions */ + instancePartitions?: (google.spanner.admin.database.v1.IBackupInstancePartition[]|null); + } + + /** Represents a Backup. */ + class Backup implements IBackup { + + /** + * Constructs a new Backup. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IBackup); + + /** Backup database. */ + public database: string; + + /** Backup versionTime. */ + public versionTime?: (google.protobuf.ITimestamp|null); + + /** Backup expireTime. */ + public expireTime?: (google.protobuf.ITimestamp|null); + + /** Backup name. */ + public name: string; + + /** Backup createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Backup sizeBytes. */ + public sizeBytes: (number|Long|string); + + /** Backup freeableSizeBytes. */ + public freeableSizeBytes: (number|Long|string); + + /** Backup exclusiveSizeBytes. */ + public exclusiveSizeBytes: (number|Long|string); + + /** Backup state. */ + public state: (google.spanner.admin.database.v1.Backup.State|keyof typeof google.spanner.admin.database.v1.Backup.State); + + /** Backup referencingDatabases. */ + public referencingDatabases: string[]; + + /** Backup encryptionInfo. */ + public encryptionInfo?: (google.spanner.admin.database.v1.IEncryptionInfo|null); + + /** Backup encryptionInformation. */ + public encryptionInformation: google.spanner.admin.database.v1.IEncryptionInfo[]; + + /** Backup databaseDialect. */ + public databaseDialect: (google.spanner.admin.database.v1.DatabaseDialect|keyof typeof google.spanner.admin.database.v1.DatabaseDialect); + + /** Backup referencingBackups. */ + public referencingBackups: string[]; + + /** Backup maxExpireTime. */ + public maxExpireTime?: (google.protobuf.ITimestamp|null); + + /** Backup backupSchedules. */ + public backupSchedules: string[]; + + /** Backup incrementalBackupChainId. */ + public incrementalBackupChainId: string; + + /** Backup oldestVersionTime. */ + public oldestVersionTime?: (google.protobuf.ITimestamp|null); + + /** Backup instancePartitions. */ + public instancePartitions: google.spanner.admin.database.v1.IBackupInstancePartition[]; + + /** + * Creates a new Backup instance using the specified properties. + * @param [properties] Properties to set + * @returns Backup instance + */ + public static create(properties?: google.spanner.admin.database.v1.IBackup): google.spanner.admin.database.v1.Backup; + + /** + * Encodes the specified Backup message. Does not implicitly {@link google.spanner.admin.database.v1.Backup.verify|verify} messages. + * @param message Backup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IBackup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Backup message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.Backup.verify|verify} messages. + * @param message Backup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IBackup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Backup message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Backup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.Backup; + + /** + * Decodes a Backup message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Backup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.Backup; + + /** + * Verifies a Backup message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Backup message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Backup + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.Backup; + + /** + * Creates a plain object from a Backup message. Also converts values to other types if specified. + * @param message Backup + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.Backup, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Backup to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Backup + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Backup { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + CREATING = 1, + READY = 2 + } + } + + /** Properties of a CreateBackupRequest. */ + interface ICreateBackupRequest { + + /** CreateBackupRequest parent */ + parent?: (string|null); + + /** CreateBackupRequest backupId */ + backupId?: (string|null); + + /** CreateBackupRequest backup */ + backup?: (google.spanner.admin.database.v1.IBackup|null); + + /** CreateBackupRequest encryptionConfig */ + encryptionConfig?: (google.spanner.admin.database.v1.ICreateBackupEncryptionConfig|null); + } + + /** Represents a CreateBackupRequest. */ + class CreateBackupRequest implements ICreateBackupRequest { + + /** + * Constructs a new CreateBackupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.ICreateBackupRequest); + + /** CreateBackupRequest parent. */ + public parent: string; + + /** CreateBackupRequest backupId. */ + public backupId: string; + + /** CreateBackupRequest backup. */ + public backup?: (google.spanner.admin.database.v1.IBackup|null); + + /** CreateBackupRequest encryptionConfig. */ + public encryptionConfig?: (google.spanner.admin.database.v1.ICreateBackupEncryptionConfig|null); + + /** + * Creates a new CreateBackupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateBackupRequest instance + */ + public static create(properties?: google.spanner.admin.database.v1.ICreateBackupRequest): google.spanner.admin.database.v1.CreateBackupRequest; + + /** + * Encodes the specified CreateBackupRequest message. Does not implicitly {@link google.spanner.admin.database.v1.CreateBackupRequest.verify|verify} messages. + * @param message CreateBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.ICreateBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateBackupRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.CreateBackupRequest.verify|verify} messages. + * @param message CreateBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.ICreateBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateBackupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.CreateBackupRequest; + + /** + * Decodes a CreateBackupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.CreateBackupRequest; + + /** + * Verifies a CreateBackupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateBackupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateBackupRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.CreateBackupRequest; + + /** + * Creates a plain object from a CreateBackupRequest message. Also converts values to other types if specified. + * @param message CreateBackupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.CreateBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateBackupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateBackupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateBackupMetadata. */ + interface ICreateBackupMetadata { + + /** CreateBackupMetadata name */ + name?: (string|null); + + /** CreateBackupMetadata database */ + database?: (string|null); + + /** CreateBackupMetadata progress */ + progress?: (google.spanner.admin.database.v1.IOperationProgress|null); + + /** CreateBackupMetadata cancelTime */ + cancelTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a CreateBackupMetadata. */ + class CreateBackupMetadata implements ICreateBackupMetadata { + + /** + * Constructs a new CreateBackupMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.ICreateBackupMetadata); + + /** CreateBackupMetadata name. */ + public name: string; + + /** CreateBackupMetadata database. */ + public database: string; + + /** CreateBackupMetadata progress. */ + public progress?: (google.spanner.admin.database.v1.IOperationProgress|null); + + /** CreateBackupMetadata cancelTime. */ + public cancelTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new CreateBackupMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateBackupMetadata instance + */ + public static create(properties?: google.spanner.admin.database.v1.ICreateBackupMetadata): google.spanner.admin.database.v1.CreateBackupMetadata; + + /** + * Encodes the specified CreateBackupMetadata message. Does not implicitly {@link google.spanner.admin.database.v1.CreateBackupMetadata.verify|verify} messages. + * @param message CreateBackupMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.ICreateBackupMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateBackupMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.CreateBackupMetadata.verify|verify} messages. + * @param message CreateBackupMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.ICreateBackupMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateBackupMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateBackupMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.CreateBackupMetadata; + + /** + * Decodes a CreateBackupMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateBackupMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.CreateBackupMetadata; + + /** + * Verifies a CreateBackupMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateBackupMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateBackupMetadata + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.CreateBackupMetadata; + + /** + * Creates a plain object from a CreateBackupMetadata message. Also converts values to other types if specified. + * @param message CreateBackupMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.CreateBackupMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateBackupMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateBackupMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CopyBackupRequest. */ + interface ICopyBackupRequest { + + /** CopyBackupRequest parent */ + parent?: (string|null); + + /** CopyBackupRequest backupId */ + backupId?: (string|null); + + /** CopyBackupRequest sourceBackup */ + sourceBackup?: (string|null); + + /** CopyBackupRequest expireTime */ + expireTime?: (google.protobuf.ITimestamp|null); + + /** CopyBackupRequest encryptionConfig */ + encryptionConfig?: (google.spanner.admin.database.v1.ICopyBackupEncryptionConfig|null); + } + + /** Represents a CopyBackupRequest. */ + class CopyBackupRequest implements ICopyBackupRequest { + + /** + * Constructs a new CopyBackupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.ICopyBackupRequest); + + /** CopyBackupRequest parent. */ + public parent: string; + + /** CopyBackupRequest backupId. */ + public backupId: string; + + /** CopyBackupRequest sourceBackup. */ + public sourceBackup: string; + + /** CopyBackupRequest expireTime. */ + public expireTime?: (google.protobuf.ITimestamp|null); + + /** CopyBackupRequest encryptionConfig. */ + public encryptionConfig?: (google.spanner.admin.database.v1.ICopyBackupEncryptionConfig|null); + + /** + * Creates a new CopyBackupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CopyBackupRequest instance + */ + public static create(properties?: google.spanner.admin.database.v1.ICopyBackupRequest): google.spanner.admin.database.v1.CopyBackupRequest; + + /** + * Encodes the specified CopyBackupRequest message. Does not implicitly {@link google.spanner.admin.database.v1.CopyBackupRequest.verify|verify} messages. + * @param message CopyBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.ICopyBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CopyBackupRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.CopyBackupRequest.verify|verify} messages. + * @param message CopyBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.ICopyBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CopyBackupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CopyBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.CopyBackupRequest; + + /** + * Decodes a CopyBackupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CopyBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.CopyBackupRequest; + + /** + * Verifies a CopyBackupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CopyBackupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CopyBackupRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.CopyBackupRequest; + + /** + * Creates a plain object from a CopyBackupRequest message. Also converts values to other types if specified. + * @param message CopyBackupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.CopyBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CopyBackupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CopyBackupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CopyBackupMetadata. */ + interface ICopyBackupMetadata { + + /** CopyBackupMetadata name */ + name?: (string|null); + + /** CopyBackupMetadata sourceBackup */ + sourceBackup?: (string|null); + + /** CopyBackupMetadata progress */ + progress?: (google.spanner.admin.database.v1.IOperationProgress|null); + + /** CopyBackupMetadata cancelTime */ + cancelTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a CopyBackupMetadata. */ + class CopyBackupMetadata implements ICopyBackupMetadata { + + /** + * Constructs a new CopyBackupMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.ICopyBackupMetadata); + + /** CopyBackupMetadata name. */ + public name: string; + + /** CopyBackupMetadata sourceBackup. */ + public sourceBackup: string; + + /** CopyBackupMetadata progress. */ + public progress?: (google.spanner.admin.database.v1.IOperationProgress|null); + + /** CopyBackupMetadata cancelTime. */ + public cancelTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new CopyBackupMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns CopyBackupMetadata instance + */ + public static create(properties?: google.spanner.admin.database.v1.ICopyBackupMetadata): google.spanner.admin.database.v1.CopyBackupMetadata; + + /** + * Encodes the specified CopyBackupMetadata message. Does not implicitly {@link google.spanner.admin.database.v1.CopyBackupMetadata.verify|verify} messages. + * @param message CopyBackupMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.ICopyBackupMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CopyBackupMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.CopyBackupMetadata.verify|verify} messages. + * @param message CopyBackupMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.ICopyBackupMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CopyBackupMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CopyBackupMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.CopyBackupMetadata; + + /** + * Decodes a CopyBackupMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CopyBackupMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.CopyBackupMetadata; + + /** + * Verifies a CopyBackupMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CopyBackupMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CopyBackupMetadata + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.CopyBackupMetadata; + + /** + * Creates a plain object from a CopyBackupMetadata message. Also converts values to other types if specified. + * @param message CopyBackupMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.CopyBackupMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CopyBackupMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CopyBackupMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateBackupRequest. */ + interface IUpdateBackupRequest { + + /** UpdateBackupRequest backup */ + backup?: (google.spanner.admin.database.v1.IBackup|null); + + /** UpdateBackupRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateBackupRequest. */ + class UpdateBackupRequest implements IUpdateBackupRequest { + + /** + * Constructs a new UpdateBackupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IUpdateBackupRequest); + + /** UpdateBackupRequest backup. */ + public backup?: (google.spanner.admin.database.v1.IBackup|null); + + /** UpdateBackupRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateBackupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateBackupRequest instance + */ + public static create(properties?: google.spanner.admin.database.v1.IUpdateBackupRequest): google.spanner.admin.database.v1.UpdateBackupRequest; + + /** + * Encodes the specified UpdateBackupRequest message. Does not implicitly {@link google.spanner.admin.database.v1.UpdateBackupRequest.verify|verify} messages. + * @param message UpdateBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IUpdateBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateBackupRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.UpdateBackupRequest.verify|verify} messages. + * @param message UpdateBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IUpdateBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateBackupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.UpdateBackupRequest; + + /** + * Decodes an UpdateBackupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.UpdateBackupRequest; + + /** + * Verifies an UpdateBackupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateBackupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateBackupRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.UpdateBackupRequest; + + /** + * Creates a plain object from an UpdateBackupRequest message. Also converts values to other types if specified. + * @param message UpdateBackupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.UpdateBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateBackupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateBackupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetBackupRequest. */ + interface IGetBackupRequest { + + /** GetBackupRequest name */ + name?: (string|null); + } + + /** Represents a GetBackupRequest. */ + class GetBackupRequest implements IGetBackupRequest { + + /** + * Constructs a new GetBackupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IGetBackupRequest); + + /** GetBackupRequest name. */ + public name: string; + + /** + * Creates a new GetBackupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetBackupRequest instance + */ + public static create(properties?: google.spanner.admin.database.v1.IGetBackupRequest): google.spanner.admin.database.v1.GetBackupRequest; + + /** + * Encodes the specified GetBackupRequest message. Does not implicitly {@link google.spanner.admin.database.v1.GetBackupRequest.verify|verify} messages. + * @param message GetBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IGetBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetBackupRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.GetBackupRequest.verify|verify} messages. + * @param message GetBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IGetBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetBackupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.GetBackupRequest; + + /** + * Decodes a GetBackupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.GetBackupRequest; + + /** + * Verifies a GetBackupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetBackupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetBackupRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.GetBackupRequest; + + /** + * Creates a plain object from a GetBackupRequest message. Also converts values to other types if specified. + * @param message GetBackupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.GetBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetBackupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetBackupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteBackupRequest. */ + interface IDeleteBackupRequest { + + /** DeleteBackupRequest name */ + name?: (string|null); + } + + /** Represents a DeleteBackupRequest. */ + class DeleteBackupRequest implements IDeleteBackupRequest { + + /** + * Constructs a new DeleteBackupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IDeleteBackupRequest); + + /** DeleteBackupRequest name. */ + public name: string; + + /** + * Creates a new DeleteBackupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteBackupRequest instance + */ + public static create(properties?: google.spanner.admin.database.v1.IDeleteBackupRequest): google.spanner.admin.database.v1.DeleteBackupRequest; + + /** + * Encodes the specified DeleteBackupRequest message. Does not implicitly {@link google.spanner.admin.database.v1.DeleteBackupRequest.verify|verify} messages. + * @param message DeleteBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IDeleteBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteBackupRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.DeleteBackupRequest.verify|verify} messages. + * @param message DeleteBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IDeleteBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteBackupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.DeleteBackupRequest; + + /** + * Decodes a DeleteBackupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.DeleteBackupRequest; + + /** + * Verifies a DeleteBackupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteBackupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteBackupRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.DeleteBackupRequest; + + /** + * Creates a plain object from a DeleteBackupRequest message. Also converts values to other types if specified. + * @param message DeleteBackupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.DeleteBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteBackupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteBackupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListBackupsRequest. */ + interface IListBackupsRequest { + + /** ListBackupsRequest parent */ + parent?: (string|null); + + /** ListBackupsRequest filter */ + filter?: (string|null); + + /** ListBackupsRequest pageSize */ + pageSize?: (number|null); + + /** ListBackupsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListBackupsRequest. */ + class ListBackupsRequest implements IListBackupsRequest { + + /** + * Constructs a new ListBackupsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IListBackupsRequest); + + /** ListBackupsRequest parent. */ + public parent: string; + + /** ListBackupsRequest filter. */ + public filter: string; + + /** ListBackupsRequest pageSize. */ + public pageSize: number; + + /** ListBackupsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListBackupsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListBackupsRequest instance + */ + public static create(properties?: google.spanner.admin.database.v1.IListBackupsRequest): google.spanner.admin.database.v1.ListBackupsRequest; + + /** + * Encodes the specified ListBackupsRequest message. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupsRequest.verify|verify} messages. + * @param message ListBackupsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IListBackupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListBackupsRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupsRequest.verify|verify} messages. + * @param message ListBackupsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IListBackupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListBackupsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListBackupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.ListBackupsRequest; + + /** + * Decodes a ListBackupsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListBackupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.ListBackupsRequest; + + /** + * Verifies a ListBackupsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListBackupsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListBackupsRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.ListBackupsRequest; + + /** + * Creates a plain object from a ListBackupsRequest message. Also converts values to other types if specified. + * @param message ListBackupsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.ListBackupsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListBackupsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListBackupsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListBackupsResponse. */ + interface IListBackupsResponse { + + /** ListBackupsResponse backups */ + backups?: (google.spanner.admin.database.v1.IBackup[]|null); + + /** ListBackupsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListBackupsResponse. */ + class ListBackupsResponse implements IListBackupsResponse { + + /** + * Constructs a new ListBackupsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IListBackupsResponse); + + /** ListBackupsResponse backups. */ + public backups: google.spanner.admin.database.v1.IBackup[]; + + /** ListBackupsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListBackupsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListBackupsResponse instance + */ + public static create(properties?: google.spanner.admin.database.v1.IListBackupsResponse): google.spanner.admin.database.v1.ListBackupsResponse; + + /** + * Encodes the specified ListBackupsResponse message. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupsResponse.verify|verify} messages. + * @param message ListBackupsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IListBackupsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListBackupsResponse message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupsResponse.verify|verify} messages. + * @param message ListBackupsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IListBackupsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListBackupsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListBackupsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.ListBackupsResponse; + + /** + * Decodes a ListBackupsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListBackupsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.ListBackupsResponse; + + /** + * Verifies a ListBackupsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListBackupsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListBackupsResponse + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.ListBackupsResponse; + + /** + * Creates a plain object from a ListBackupsResponse message. Also converts values to other types if specified. + * @param message ListBackupsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.ListBackupsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListBackupsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListBackupsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListBackupOperationsRequest. */ + interface IListBackupOperationsRequest { + + /** ListBackupOperationsRequest parent */ + parent?: (string|null); + + /** ListBackupOperationsRequest filter */ + filter?: (string|null); + + /** ListBackupOperationsRequest pageSize */ + pageSize?: (number|null); + + /** ListBackupOperationsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListBackupOperationsRequest. */ + class ListBackupOperationsRequest implements IListBackupOperationsRequest { + + /** + * Constructs a new ListBackupOperationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IListBackupOperationsRequest); + + /** ListBackupOperationsRequest parent. */ + public parent: string; + + /** ListBackupOperationsRequest filter. */ + public filter: string; + + /** ListBackupOperationsRequest pageSize. */ + public pageSize: number; + + /** ListBackupOperationsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListBackupOperationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListBackupOperationsRequest instance + */ + public static create(properties?: google.spanner.admin.database.v1.IListBackupOperationsRequest): google.spanner.admin.database.v1.ListBackupOperationsRequest; + + /** + * Encodes the specified ListBackupOperationsRequest message. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupOperationsRequest.verify|verify} messages. + * @param message ListBackupOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IListBackupOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListBackupOperationsRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupOperationsRequest.verify|verify} messages. + * @param message ListBackupOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IListBackupOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListBackupOperationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListBackupOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.ListBackupOperationsRequest; + + /** + * Decodes a ListBackupOperationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListBackupOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.ListBackupOperationsRequest; + + /** + * Verifies a ListBackupOperationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListBackupOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListBackupOperationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.ListBackupOperationsRequest; + + /** + * Creates a plain object from a ListBackupOperationsRequest message. Also converts values to other types if specified. + * @param message ListBackupOperationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.ListBackupOperationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListBackupOperationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListBackupOperationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListBackupOperationsResponse. */ + interface IListBackupOperationsResponse { + + /** ListBackupOperationsResponse operations */ + operations?: (google.longrunning.IOperation[]|null); + + /** ListBackupOperationsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListBackupOperationsResponse. */ + class ListBackupOperationsResponse implements IListBackupOperationsResponse { + + /** + * Constructs a new ListBackupOperationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IListBackupOperationsResponse); + + /** ListBackupOperationsResponse operations. */ + public operations: google.longrunning.IOperation[]; + + /** ListBackupOperationsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListBackupOperationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListBackupOperationsResponse instance + */ + public static create(properties?: google.spanner.admin.database.v1.IListBackupOperationsResponse): google.spanner.admin.database.v1.ListBackupOperationsResponse; + + /** + * Encodes the specified ListBackupOperationsResponse message. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupOperationsResponse.verify|verify} messages. + * @param message ListBackupOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IListBackupOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListBackupOperationsResponse message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupOperationsResponse.verify|verify} messages. + * @param message ListBackupOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IListBackupOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListBackupOperationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListBackupOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.ListBackupOperationsResponse; + + /** + * Decodes a ListBackupOperationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListBackupOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.ListBackupOperationsResponse; + + /** + * Verifies a ListBackupOperationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListBackupOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListBackupOperationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.ListBackupOperationsResponse; + + /** + * Creates a plain object from a ListBackupOperationsResponse message. Also converts values to other types if specified. + * @param message ListBackupOperationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.ListBackupOperationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListBackupOperationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListBackupOperationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BackupInfo. */ + interface IBackupInfo { + + /** BackupInfo backup */ + backup?: (string|null); + + /** BackupInfo versionTime */ + versionTime?: (google.protobuf.ITimestamp|null); + + /** BackupInfo createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** BackupInfo sourceDatabase */ + sourceDatabase?: (string|null); + } + + /** Represents a BackupInfo. */ + class BackupInfo implements IBackupInfo { + + /** + * Constructs a new BackupInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IBackupInfo); + + /** BackupInfo backup. */ + public backup: string; + + /** BackupInfo versionTime. */ + public versionTime?: (google.protobuf.ITimestamp|null); + + /** BackupInfo createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** BackupInfo sourceDatabase. */ + public sourceDatabase: string; + + /** + * Creates a new BackupInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns BackupInfo instance + */ + public static create(properties?: google.spanner.admin.database.v1.IBackupInfo): google.spanner.admin.database.v1.BackupInfo; + + /** + * Encodes the specified BackupInfo message. Does not implicitly {@link google.spanner.admin.database.v1.BackupInfo.verify|verify} messages. + * @param message BackupInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IBackupInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BackupInfo message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.BackupInfo.verify|verify} messages. + * @param message BackupInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IBackupInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BackupInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BackupInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.BackupInfo; + + /** + * Decodes a BackupInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BackupInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.BackupInfo; + + /** + * Verifies a BackupInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BackupInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BackupInfo + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.BackupInfo; + + /** + * Creates a plain object from a BackupInfo message. Also converts values to other types if specified. + * @param message BackupInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.BackupInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BackupInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BackupInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateBackupEncryptionConfig. */ + interface ICreateBackupEncryptionConfig { + + /** CreateBackupEncryptionConfig encryptionType */ + encryptionType?: (google.spanner.admin.database.v1.CreateBackupEncryptionConfig.EncryptionType|keyof typeof google.spanner.admin.database.v1.CreateBackupEncryptionConfig.EncryptionType|null); + + /** CreateBackupEncryptionConfig kmsKeyName */ + kmsKeyName?: (string|null); + + /** CreateBackupEncryptionConfig kmsKeyNames */ + kmsKeyNames?: (string[]|null); + } + + /** Represents a CreateBackupEncryptionConfig. */ + class CreateBackupEncryptionConfig implements ICreateBackupEncryptionConfig { + + /** + * Constructs a new CreateBackupEncryptionConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.ICreateBackupEncryptionConfig); + + /** CreateBackupEncryptionConfig encryptionType. */ + public encryptionType: (google.spanner.admin.database.v1.CreateBackupEncryptionConfig.EncryptionType|keyof typeof google.spanner.admin.database.v1.CreateBackupEncryptionConfig.EncryptionType); + + /** CreateBackupEncryptionConfig kmsKeyName. */ + public kmsKeyName: string; + + /** CreateBackupEncryptionConfig kmsKeyNames. */ + public kmsKeyNames: string[]; + + /** + * Creates a new CreateBackupEncryptionConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateBackupEncryptionConfig instance + */ + public static create(properties?: google.spanner.admin.database.v1.ICreateBackupEncryptionConfig): google.spanner.admin.database.v1.CreateBackupEncryptionConfig; + + /** + * Encodes the specified CreateBackupEncryptionConfig message. Does not implicitly {@link google.spanner.admin.database.v1.CreateBackupEncryptionConfig.verify|verify} messages. + * @param message CreateBackupEncryptionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.ICreateBackupEncryptionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateBackupEncryptionConfig message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.CreateBackupEncryptionConfig.verify|verify} messages. + * @param message CreateBackupEncryptionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.ICreateBackupEncryptionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateBackupEncryptionConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateBackupEncryptionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.CreateBackupEncryptionConfig; + + /** + * Decodes a CreateBackupEncryptionConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateBackupEncryptionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.CreateBackupEncryptionConfig; + + /** + * Verifies a CreateBackupEncryptionConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateBackupEncryptionConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateBackupEncryptionConfig + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.CreateBackupEncryptionConfig; + + /** + * Creates a plain object from a CreateBackupEncryptionConfig message. Also converts values to other types if specified. + * @param message CreateBackupEncryptionConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.CreateBackupEncryptionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateBackupEncryptionConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateBackupEncryptionConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace CreateBackupEncryptionConfig { + + /** EncryptionType enum. */ + enum EncryptionType { + ENCRYPTION_TYPE_UNSPECIFIED = 0, + USE_DATABASE_ENCRYPTION = 1, + GOOGLE_DEFAULT_ENCRYPTION = 2, + CUSTOMER_MANAGED_ENCRYPTION = 3 + } + } + + /** Properties of a CopyBackupEncryptionConfig. */ + interface ICopyBackupEncryptionConfig { + + /** CopyBackupEncryptionConfig encryptionType */ + encryptionType?: (google.spanner.admin.database.v1.CopyBackupEncryptionConfig.EncryptionType|keyof typeof google.spanner.admin.database.v1.CopyBackupEncryptionConfig.EncryptionType|null); + + /** CopyBackupEncryptionConfig kmsKeyName */ + kmsKeyName?: (string|null); + + /** CopyBackupEncryptionConfig kmsKeyNames */ + kmsKeyNames?: (string[]|null); + } + + /** Represents a CopyBackupEncryptionConfig. */ + class CopyBackupEncryptionConfig implements ICopyBackupEncryptionConfig { + + /** + * Constructs a new CopyBackupEncryptionConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.ICopyBackupEncryptionConfig); + + /** CopyBackupEncryptionConfig encryptionType. */ + public encryptionType: (google.spanner.admin.database.v1.CopyBackupEncryptionConfig.EncryptionType|keyof typeof google.spanner.admin.database.v1.CopyBackupEncryptionConfig.EncryptionType); + + /** CopyBackupEncryptionConfig kmsKeyName. */ + public kmsKeyName: string; + + /** CopyBackupEncryptionConfig kmsKeyNames. */ + public kmsKeyNames: string[]; + + /** + * Creates a new CopyBackupEncryptionConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns CopyBackupEncryptionConfig instance + */ + public static create(properties?: google.spanner.admin.database.v1.ICopyBackupEncryptionConfig): google.spanner.admin.database.v1.CopyBackupEncryptionConfig; + + /** + * Encodes the specified CopyBackupEncryptionConfig message. Does not implicitly {@link google.spanner.admin.database.v1.CopyBackupEncryptionConfig.verify|verify} messages. + * @param message CopyBackupEncryptionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.ICopyBackupEncryptionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CopyBackupEncryptionConfig message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.CopyBackupEncryptionConfig.verify|verify} messages. + * @param message CopyBackupEncryptionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.ICopyBackupEncryptionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CopyBackupEncryptionConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CopyBackupEncryptionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.CopyBackupEncryptionConfig; + + /** + * Decodes a CopyBackupEncryptionConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CopyBackupEncryptionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.CopyBackupEncryptionConfig; + + /** + * Verifies a CopyBackupEncryptionConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CopyBackupEncryptionConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CopyBackupEncryptionConfig + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.CopyBackupEncryptionConfig; + + /** + * Creates a plain object from a CopyBackupEncryptionConfig message. Also converts values to other types if specified. + * @param message CopyBackupEncryptionConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.CopyBackupEncryptionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CopyBackupEncryptionConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CopyBackupEncryptionConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace CopyBackupEncryptionConfig { + + /** EncryptionType enum. */ + enum EncryptionType { + ENCRYPTION_TYPE_UNSPECIFIED = 0, + USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION = 1, + GOOGLE_DEFAULT_ENCRYPTION = 2, + CUSTOMER_MANAGED_ENCRYPTION = 3 + } + } + + /** Properties of a FullBackupSpec. */ + interface IFullBackupSpec { + } + + /** Represents a FullBackupSpec. */ + class FullBackupSpec implements IFullBackupSpec { + + /** + * Constructs a new FullBackupSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IFullBackupSpec); + + /** + * Creates a new FullBackupSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns FullBackupSpec instance + */ + public static create(properties?: google.spanner.admin.database.v1.IFullBackupSpec): google.spanner.admin.database.v1.FullBackupSpec; + + /** + * Encodes the specified FullBackupSpec message. Does not implicitly {@link google.spanner.admin.database.v1.FullBackupSpec.verify|verify} messages. + * @param message FullBackupSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IFullBackupSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FullBackupSpec message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.FullBackupSpec.verify|verify} messages. + * @param message FullBackupSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IFullBackupSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FullBackupSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FullBackupSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.FullBackupSpec; + + /** + * Decodes a FullBackupSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FullBackupSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.FullBackupSpec; + + /** + * Verifies a FullBackupSpec message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FullBackupSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FullBackupSpec + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.FullBackupSpec; + + /** + * Creates a plain object from a FullBackupSpec message. Also converts values to other types if specified. + * @param message FullBackupSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.FullBackupSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FullBackupSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FullBackupSpec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an IncrementalBackupSpec. */ + interface IIncrementalBackupSpec { + } + + /** Represents an IncrementalBackupSpec. */ + class IncrementalBackupSpec implements IIncrementalBackupSpec { + + /** + * Constructs a new IncrementalBackupSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IIncrementalBackupSpec); + + /** + * Creates a new IncrementalBackupSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns IncrementalBackupSpec instance + */ + public static create(properties?: google.spanner.admin.database.v1.IIncrementalBackupSpec): google.spanner.admin.database.v1.IncrementalBackupSpec; + + /** + * Encodes the specified IncrementalBackupSpec message. Does not implicitly {@link google.spanner.admin.database.v1.IncrementalBackupSpec.verify|verify} messages. + * @param message IncrementalBackupSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IIncrementalBackupSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IncrementalBackupSpec message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.IncrementalBackupSpec.verify|verify} messages. + * @param message IncrementalBackupSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IIncrementalBackupSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IncrementalBackupSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IncrementalBackupSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.IncrementalBackupSpec; + + /** + * Decodes an IncrementalBackupSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IncrementalBackupSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.IncrementalBackupSpec; + + /** + * Verifies an IncrementalBackupSpec message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an IncrementalBackupSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IncrementalBackupSpec + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.IncrementalBackupSpec; + + /** + * Creates a plain object from an IncrementalBackupSpec message. Also converts values to other types if specified. + * @param message IncrementalBackupSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.IncrementalBackupSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IncrementalBackupSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IncrementalBackupSpec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BackupInstancePartition. */ + interface IBackupInstancePartition { + + /** BackupInstancePartition instancePartition */ + instancePartition?: (string|null); + } + + /** Represents a BackupInstancePartition. */ + class BackupInstancePartition implements IBackupInstancePartition { + + /** + * Constructs a new BackupInstancePartition. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IBackupInstancePartition); + + /** BackupInstancePartition instancePartition. */ + public instancePartition: string; + + /** + * Creates a new BackupInstancePartition instance using the specified properties. + * @param [properties] Properties to set + * @returns BackupInstancePartition instance + */ + public static create(properties?: google.spanner.admin.database.v1.IBackupInstancePartition): google.spanner.admin.database.v1.BackupInstancePartition; + + /** + * Encodes the specified BackupInstancePartition message. Does not implicitly {@link google.spanner.admin.database.v1.BackupInstancePartition.verify|verify} messages. + * @param message BackupInstancePartition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IBackupInstancePartition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BackupInstancePartition message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.BackupInstancePartition.verify|verify} messages. + * @param message BackupInstancePartition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IBackupInstancePartition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BackupInstancePartition message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BackupInstancePartition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.BackupInstancePartition; + + /** + * Decodes a BackupInstancePartition message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BackupInstancePartition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.BackupInstancePartition; + + /** + * Verifies a BackupInstancePartition message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BackupInstancePartition message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BackupInstancePartition + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.BackupInstancePartition; + + /** + * Creates a plain object from a BackupInstancePartition message. Also converts values to other types if specified. + * @param message BackupInstancePartition + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.BackupInstancePartition, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BackupInstancePartition to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BackupInstancePartition + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OperationProgress. */ + interface IOperationProgress { + + /** OperationProgress progressPercent */ + progressPercent?: (number|null); + + /** OperationProgress startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** OperationProgress endTime */ + endTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents an OperationProgress. */ + class OperationProgress implements IOperationProgress { + + /** + * Constructs a new OperationProgress. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IOperationProgress); + + /** OperationProgress progressPercent. */ + public progressPercent: number; + + /** OperationProgress startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** OperationProgress endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new OperationProgress instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationProgress instance + */ + public static create(properties?: google.spanner.admin.database.v1.IOperationProgress): google.spanner.admin.database.v1.OperationProgress; + + /** + * Encodes the specified OperationProgress message. Does not implicitly {@link google.spanner.admin.database.v1.OperationProgress.verify|verify} messages. + * @param message OperationProgress message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IOperationProgress, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationProgress message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.OperationProgress.verify|verify} messages. + * @param message OperationProgress message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IOperationProgress, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationProgress message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationProgress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.OperationProgress; + + /** + * Decodes an OperationProgress message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationProgress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.OperationProgress; + + /** + * Verifies an OperationProgress message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OperationProgress message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationProgress + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.OperationProgress; + + /** + * Creates a plain object from an OperationProgress message. Also converts values to other types if specified. + * @param message OperationProgress + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.OperationProgress, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationProgress to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OperationProgress + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EncryptionConfig. */ + interface IEncryptionConfig { + + /** EncryptionConfig kmsKeyName */ + kmsKeyName?: (string|null); + + /** EncryptionConfig kmsKeyNames */ + kmsKeyNames?: (string[]|null); + } + + /** Represents an EncryptionConfig. */ + class EncryptionConfig implements IEncryptionConfig { + + /** + * Constructs a new EncryptionConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IEncryptionConfig); + + /** EncryptionConfig kmsKeyName. */ + public kmsKeyName: string; + + /** EncryptionConfig kmsKeyNames. */ + public kmsKeyNames: string[]; + + /** + * Creates a new EncryptionConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns EncryptionConfig instance + */ + public static create(properties?: google.spanner.admin.database.v1.IEncryptionConfig): google.spanner.admin.database.v1.EncryptionConfig; + + /** + * Encodes the specified EncryptionConfig message. Does not implicitly {@link google.spanner.admin.database.v1.EncryptionConfig.verify|verify} messages. + * @param message EncryptionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IEncryptionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EncryptionConfig message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.EncryptionConfig.verify|verify} messages. + * @param message EncryptionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IEncryptionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EncryptionConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EncryptionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.EncryptionConfig; + + /** + * Decodes an EncryptionConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EncryptionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.EncryptionConfig; + + /** + * Verifies an EncryptionConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EncryptionConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EncryptionConfig + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.EncryptionConfig; + + /** + * Creates a plain object from an EncryptionConfig message. Also converts values to other types if specified. + * @param message EncryptionConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.EncryptionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EncryptionConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EncryptionConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EncryptionInfo. */ + interface IEncryptionInfo { + + /** EncryptionInfo encryptionType */ + encryptionType?: (google.spanner.admin.database.v1.EncryptionInfo.Type|keyof typeof google.spanner.admin.database.v1.EncryptionInfo.Type|null); + + /** EncryptionInfo encryptionStatus */ + encryptionStatus?: (google.rpc.IStatus|null); + + /** EncryptionInfo kmsKeyVersion */ + kmsKeyVersion?: (string|null); + } + + /** Represents an EncryptionInfo. */ + class EncryptionInfo implements IEncryptionInfo { + + /** + * Constructs a new EncryptionInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IEncryptionInfo); + + /** EncryptionInfo encryptionType. */ + public encryptionType: (google.spanner.admin.database.v1.EncryptionInfo.Type|keyof typeof google.spanner.admin.database.v1.EncryptionInfo.Type); + + /** EncryptionInfo encryptionStatus. */ + public encryptionStatus?: (google.rpc.IStatus|null); + + /** EncryptionInfo kmsKeyVersion. */ + public kmsKeyVersion: string; + + /** + * Creates a new EncryptionInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns EncryptionInfo instance + */ + public static create(properties?: google.spanner.admin.database.v1.IEncryptionInfo): google.spanner.admin.database.v1.EncryptionInfo; + + /** + * Encodes the specified EncryptionInfo message. Does not implicitly {@link google.spanner.admin.database.v1.EncryptionInfo.verify|verify} messages. + * @param message EncryptionInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IEncryptionInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EncryptionInfo message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.EncryptionInfo.verify|verify} messages. + * @param message EncryptionInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IEncryptionInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EncryptionInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EncryptionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.EncryptionInfo; + + /** + * Decodes an EncryptionInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EncryptionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.EncryptionInfo; + + /** + * Verifies an EncryptionInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EncryptionInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EncryptionInfo + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.EncryptionInfo; + + /** + * Creates a plain object from an EncryptionInfo message. Also converts values to other types if specified. + * @param message EncryptionInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.EncryptionInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EncryptionInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EncryptionInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EncryptionInfo { + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + GOOGLE_DEFAULT_ENCRYPTION = 1, + CUSTOMER_MANAGED_ENCRYPTION = 2 + } + } + + /** DatabaseDialect enum. */ + enum DatabaseDialect { + DATABASE_DIALECT_UNSPECIFIED = 0, + GOOGLE_STANDARD_SQL = 1, + POSTGRESQL = 2 + } + + /** Properties of a BackupScheduleSpec. */ + interface IBackupScheduleSpec { + + /** BackupScheduleSpec cronSpec */ + cronSpec?: (google.spanner.admin.database.v1.ICrontabSpec|null); + } + + /** Represents a BackupScheduleSpec. */ + class BackupScheduleSpec implements IBackupScheduleSpec { + + /** + * Constructs a new BackupScheduleSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IBackupScheduleSpec); + + /** BackupScheduleSpec cronSpec. */ + public cronSpec?: (google.spanner.admin.database.v1.ICrontabSpec|null); + + /** BackupScheduleSpec scheduleSpec. */ + public scheduleSpec?: "cronSpec"; + + /** + * Creates a new BackupScheduleSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns BackupScheduleSpec instance + */ + public static create(properties?: google.spanner.admin.database.v1.IBackupScheduleSpec): google.spanner.admin.database.v1.BackupScheduleSpec; + + /** + * Encodes the specified BackupScheduleSpec message. Does not implicitly {@link google.spanner.admin.database.v1.BackupScheduleSpec.verify|verify} messages. + * @param message BackupScheduleSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IBackupScheduleSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BackupScheduleSpec message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.BackupScheduleSpec.verify|verify} messages. + * @param message BackupScheduleSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IBackupScheduleSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BackupScheduleSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BackupScheduleSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.BackupScheduleSpec; + + /** + * Decodes a BackupScheduleSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BackupScheduleSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.BackupScheduleSpec; + + /** + * Verifies a BackupScheduleSpec message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BackupScheduleSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BackupScheduleSpec + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.BackupScheduleSpec; + + /** + * Creates a plain object from a BackupScheduleSpec message. Also converts values to other types if specified. + * @param message BackupScheduleSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.BackupScheduleSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BackupScheduleSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BackupScheduleSpec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BackupSchedule. */ + interface IBackupSchedule { + + /** BackupSchedule name */ + name?: (string|null); + + /** BackupSchedule spec */ + spec?: (google.spanner.admin.database.v1.IBackupScheduleSpec|null); + + /** BackupSchedule retentionDuration */ + retentionDuration?: (google.protobuf.IDuration|null); + + /** BackupSchedule encryptionConfig */ + encryptionConfig?: (google.spanner.admin.database.v1.ICreateBackupEncryptionConfig|null); + + /** BackupSchedule fullBackupSpec */ + fullBackupSpec?: (google.spanner.admin.database.v1.IFullBackupSpec|null); + + /** BackupSchedule incrementalBackupSpec */ + incrementalBackupSpec?: (google.spanner.admin.database.v1.IIncrementalBackupSpec|null); + + /** BackupSchedule updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a BackupSchedule. */ + class BackupSchedule implements IBackupSchedule { + + /** + * Constructs a new BackupSchedule. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IBackupSchedule); + + /** BackupSchedule name. */ + public name: string; + + /** BackupSchedule spec. */ + public spec?: (google.spanner.admin.database.v1.IBackupScheduleSpec|null); + + /** BackupSchedule retentionDuration. */ + public retentionDuration?: (google.protobuf.IDuration|null); + + /** BackupSchedule encryptionConfig. */ + public encryptionConfig?: (google.spanner.admin.database.v1.ICreateBackupEncryptionConfig|null); + + /** BackupSchedule fullBackupSpec. */ + public fullBackupSpec?: (google.spanner.admin.database.v1.IFullBackupSpec|null); + + /** BackupSchedule incrementalBackupSpec. */ + public incrementalBackupSpec?: (google.spanner.admin.database.v1.IIncrementalBackupSpec|null); + + /** BackupSchedule updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** BackupSchedule backupTypeSpec. */ + public backupTypeSpec?: ("fullBackupSpec"|"incrementalBackupSpec"); + + /** + * Creates a new BackupSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns BackupSchedule instance + */ + public static create(properties?: google.spanner.admin.database.v1.IBackupSchedule): google.spanner.admin.database.v1.BackupSchedule; + + /** + * Encodes the specified BackupSchedule message. Does not implicitly {@link google.spanner.admin.database.v1.BackupSchedule.verify|verify} messages. + * @param message BackupSchedule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IBackupSchedule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BackupSchedule message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.BackupSchedule.verify|verify} messages. + * @param message BackupSchedule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IBackupSchedule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BackupSchedule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BackupSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.BackupSchedule; + + /** + * Decodes a BackupSchedule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BackupSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.BackupSchedule; + + /** + * Verifies a BackupSchedule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BackupSchedule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BackupSchedule + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.BackupSchedule; + + /** + * Creates a plain object from a BackupSchedule message. Also converts values to other types if specified. + * @param message BackupSchedule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.BackupSchedule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BackupSchedule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BackupSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CrontabSpec. */ + interface ICrontabSpec { + + /** CrontabSpec text */ + text?: (string|null); + + /** CrontabSpec timeZone */ + timeZone?: (string|null); + + /** CrontabSpec creationWindow */ + creationWindow?: (google.protobuf.IDuration|null); + } + + /** Represents a CrontabSpec. */ + class CrontabSpec implements ICrontabSpec { + + /** + * Constructs a new CrontabSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.ICrontabSpec); + + /** CrontabSpec text. */ + public text: string; + + /** CrontabSpec timeZone. */ + public timeZone: string; + + /** CrontabSpec creationWindow. */ + public creationWindow?: (google.protobuf.IDuration|null); + + /** + * Creates a new CrontabSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns CrontabSpec instance + */ + public static create(properties?: google.spanner.admin.database.v1.ICrontabSpec): google.spanner.admin.database.v1.CrontabSpec; + + /** + * Encodes the specified CrontabSpec message. Does not implicitly {@link google.spanner.admin.database.v1.CrontabSpec.verify|verify} messages. + * @param message CrontabSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.ICrontabSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CrontabSpec message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.CrontabSpec.verify|verify} messages. + * @param message CrontabSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.ICrontabSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CrontabSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CrontabSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.CrontabSpec; + + /** + * Decodes a CrontabSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CrontabSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.CrontabSpec; + + /** + * Verifies a CrontabSpec message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CrontabSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CrontabSpec + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.CrontabSpec; + + /** + * Creates a plain object from a CrontabSpec message. Also converts values to other types if specified. + * @param message CrontabSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.CrontabSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CrontabSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CrontabSpec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateBackupScheduleRequest. */ + interface ICreateBackupScheduleRequest { + + /** CreateBackupScheduleRequest parent */ + parent?: (string|null); + + /** CreateBackupScheduleRequest backupScheduleId */ + backupScheduleId?: (string|null); + + /** CreateBackupScheduleRequest backupSchedule */ + backupSchedule?: (google.spanner.admin.database.v1.IBackupSchedule|null); + } + + /** Represents a CreateBackupScheduleRequest. */ + class CreateBackupScheduleRequest implements ICreateBackupScheduleRequest { + + /** + * Constructs a new CreateBackupScheduleRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.ICreateBackupScheduleRequest); + + /** CreateBackupScheduleRequest parent. */ + public parent: string; + + /** CreateBackupScheduleRequest backupScheduleId. */ + public backupScheduleId: string; + + /** CreateBackupScheduleRequest backupSchedule. */ + public backupSchedule?: (google.spanner.admin.database.v1.IBackupSchedule|null); + + /** + * Creates a new CreateBackupScheduleRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateBackupScheduleRequest instance + */ + public static create(properties?: google.spanner.admin.database.v1.ICreateBackupScheduleRequest): google.spanner.admin.database.v1.CreateBackupScheduleRequest; + + /** + * Encodes the specified CreateBackupScheduleRequest message. Does not implicitly {@link google.spanner.admin.database.v1.CreateBackupScheduleRequest.verify|verify} messages. + * @param message CreateBackupScheduleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.ICreateBackupScheduleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateBackupScheduleRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.CreateBackupScheduleRequest.verify|verify} messages. + * @param message CreateBackupScheduleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.ICreateBackupScheduleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateBackupScheduleRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateBackupScheduleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.CreateBackupScheduleRequest; + + /** + * Decodes a CreateBackupScheduleRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateBackupScheduleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.CreateBackupScheduleRequest; + + /** + * Verifies a CreateBackupScheduleRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateBackupScheduleRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateBackupScheduleRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.CreateBackupScheduleRequest; + + /** + * Creates a plain object from a CreateBackupScheduleRequest message. Also converts values to other types if specified. + * @param message CreateBackupScheduleRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.CreateBackupScheduleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateBackupScheduleRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateBackupScheduleRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetBackupScheduleRequest. */ + interface IGetBackupScheduleRequest { + + /** GetBackupScheduleRequest name */ + name?: (string|null); + } + + /** Represents a GetBackupScheduleRequest. */ + class GetBackupScheduleRequest implements IGetBackupScheduleRequest { + + /** + * Constructs a new GetBackupScheduleRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IGetBackupScheduleRequest); + + /** GetBackupScheduleRequest name. */ + public name: string; + + /** + * Creates a new GetBackupScheduleRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetBackupScheduleRequest instance + */ + public static create(properties?: google.spanner.admin.database.v1.IGetBackupScheduleRequest): google.spanner.admin.database.v1.GetBackupScheduleRequest; + + /** + * Encodes the specified GetBackupScheduleRequest message. Does not implicitly {@link google.spanner.admin.database.v1.GetBackupScheduleRequest.verify|verify} messages. + * @param message GetBackupScheduleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IGetBackupScheduleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetBackupScheduleRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.GetBackupScheduleRequest.verify|verify} messages. + * @param message GetBackupScheduleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IGetBackupScheduleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetBackupScheduleRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetBackupScheduleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.GetBackupScheduleRequest; + + /** + * Decodes a GetBackupScheduleRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetBackupScheduleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.GetBackupScheduleRequest; + + /** + * Verifies a GetBackupScheduleRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetBackupScheduleRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetBackupScheduleRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.GetBackupScheduleRequest; + + /** + * Creates a plain object from a GetBackupScheduleRequest message. Also converts values to other types if specified. + * @param message GetBackupScheduleRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.GetBackupScheduleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetBackupScheduleRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetBackupScheduleRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteBackupScheduleRequest. */ + interface IDeleteBackupScheduleRequest { + + /** DeleteBackupScheduleRequest name */ + name?: (string|null); + } + + /** Represents a DeleteBackupScheduleRequest. */ + class DeleteBackupScheduleRequest implements IDeleteBackupScheduleRequest { + + /** + * Constructs a new DeleteBackupScheduleRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IDeleteBackupScheduleRequest); + + /** DeleteBackupScheduleRequest name. */ + public name: string; + + /** + * Creates a new DeleteBackupScheduleRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteBackupScheduleRequest instance + */ + public static create(properties?: google.spanner.admin.database.v1.IDeleteBackupScheduleRequest): google.spanner.admin.database.v1.DeleteBackupScheduleRequest; + + /** + * Encodes the specified DeleteBackupScheduleRequest message. Does not implicitly {@link google.spanner.admin.database.v1.DeleteBackupScheduleRequest.verify|verify} messages. + * @param message DeleteBackupScheduleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IDeleteBackupScheduleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteBackupScheduleRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.DeleteBackupScheduleRequest.verify|verify} messages. + * @param message DeleteBackupScheduleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IDeleteBackupScheduleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteBackupScheduleRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteBackupScheduleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.DeleteBackupScheduleRequest; + + /** + * Decodes a DeleteBackupScheduleRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteBackupScheduleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.DeleteBackupScheduleRequest; + + /** + * Verifies a DeleteBackupScheduleRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteBackupScheduleRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteBackupScheduleRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.DeleteBackupScheduleRequest; + + /** + * Creates a plain object from a DeleteBackupScheduleRequest message. Also converts values to other types if specified. + * @param message DeleteBackupScheduleRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.DeleteBackupScheduleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteBackupScheduleRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteBackupScheduleRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListBackupSchedulesRequest. */ + interface IListBackupSchedulesRequest { + + /** ListBackupSchedulesRequest parent */ + parent?: (string|null); + + /** ListBackupSchedulesRequest pageSize */ + pageSize?: (number|null); + + /** ListBackupSchedulesRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListBackupSchedulesRequest. */ + class ListBackupSchedulesRequest implements IListBackupSchedulesRequest { + + /** + * Constructs a new ListBackupSchedulesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IListBackupSchedulesRequest); + + /** ListBackupSchedulesRequest parent. */ + public parent: string; + + /** ListBackupSchedulesRequest pageSize. */ + public pageSize: number; + + /** ListBackupSchedulesRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListBackupSchedulesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListBackupSchedulesRequest instance + */ + public static create(properties?: google.spanner.admin.database.v1.IListBackupSchedulesRequest): google.spanner.admin.database.v1.ListBackupSchedulesRequest; + + /** + * Encodes the specified ListBackupSchedulesRequest message. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupSchedulesRequest.verify|verify} messages. + * @param message ListBackupSchedulesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IListBackupSchedulesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListBackupSchedulesRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupSchedulesRequest.verify|verify} messages. + * @param message ListBackupSchedulesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IListBackupSchedulesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListBackupSchedulesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListBackupSchedulesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.ListBackupSchedulesRequest; + + /** + * Decodes a ListBackupSchedulesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListBackupSchedulesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.ListBackupSchedulesRequest; + + /** + * Verifies a ListBackupSchedulesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListBackupSchedulesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListBackupSchedulesRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.ListBackupSchedulesRequest; + + /** + * Creates a plain object from a ListBackupSchedulesRequest message. Also converts values to other types if specified. + * @param message ListBackupSchedulesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.ListBackupSchedulesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListBackupSchedulesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListBackupSchedulesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListBackupSchedulesResponse. */ + interface IListBackupSchedulesResponse { + + /** ListBackupSchedulesResponse backupSchedules */ + backupSchedules?: (google.spanner.admin.database.v1.IBackupSchedule[]|null); + + /** ListBackupSchedulesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListBackupSchedulesResponse. */ + class ListBackupSchedulesResponse implements IListBackupSchedulesResponse { + + /** + * Constructs a new ListBackupSchedulesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IListBackupSchedulesResponse); + + /** ListBackupSchedulesResponse backupSchedules. */ + public backupSchedules: google.spanner.admin.database.v1.IBackupSchedule[]; + + /** ListBackupSchedulesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListBackupSchedulesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListBackupSchedulesResponse instance + */ + public static create(properties?: google.spanner.admin.database.v1.IListBackupSchedulesResponse): google.spanner.admin.database.v1.ListBackupSchedulesResponse; + + /** + * Encodes the specified ListBackupSchedulesResponse message. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupSchedulesResponse.verify|verify} messages. + * @param message ListBackupSchedulesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IListBackupSchedulesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListBackupSchedulesResponse message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupSchedulesResponse.verify|verify} messages. + * @param message ListBackupSchedulesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IListBackupSchedulesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListBackupSchedulesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListBackupSchedulesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.ListBackupSchedulesResponse; + + /** + * Decodes a ListBackupSchedulesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListBackupSchedulesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.ListBackupSchedulesResponse; + + /** + * Verifies a ListBackupSchedulesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListBackupSchedulesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListBackupSchedulesResponse + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.ListBackupSchedulesResponse; + + /** + * Creates a plain object from a ListBackupSchedulesResponse message. Also converts values to other types if specified. + * @param message ListBackupSchedulesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.ListBackupSchedulesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListBackupSchedulesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListBackupSchedulesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateBackupScheduleRequest. */ + interface IUpdateBackupScheduleRequest { + + /** UpdateBackupScheduleRequest backupSchedule */ + backupSchedule?: (google.spanner.admin.database.v1.IBackupSchedule|null); + + /** UpdateBackupScheduleRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateBackupScheduleRequest. */ + class UpdateBackupScheduleRequest implements IUpdateBackupScheduleRequest { + + /** + * Constructs a new UpdateBackupScheduleRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IUpdateBackupScheduleRequest); + + /** UpdateBackupScheduleRequest backupSchedule. */ + public backupSchedule?: (google.spanner.admin.database.v1.IBackupSchedule|null); + + /** UpdateBackupScheduleRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateBackupScheduleRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateBackupScheduleRequest instance + */ + public static create(properties?: google.spanner.admin.database.v1.IUpdateBackupScheduleRequest): google.spanner.admin.database.v1.UpdateBackupScheduleRequest; + + /** + * Encodes the specified UpdateBackupScheduleRequest message. Does not implicitly {@link google.spanner.admin.database.v1.UpdateBackupScheduleRequest.verify|verify} messages. + * @param message UpdateBackupScheduleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IUpdateBackupScheduleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateBackupScheduleRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.UpdateBackupScheduleRequest.verify|verify} messages. + * @param message UpdateBackupScheduleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IUpdateBackupScheduleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateBackupScheduleRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateBackupScheduleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.UpdateBackupScheduleRequest; + + /** + * Decodes an UpdateBackupScheduleRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateBackupScheduleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.UpdateBackupScheduleRequest; + + /** + * Verifies an UpdateBackupScheduleRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateBackupScheduleRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateBackupScheduleRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.UpdateBackupScheduleRequest; + + /** + * Creates a plain object from an UpdateBackupScheduleRequest message. Also converts values to other types if specified. + * @param message UpdateBackupScheduleRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.UpdateBackupScheduleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateBackupScheduleRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateBackupScheduleRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a DatabaseAdmin */ + class DatabaseAdmin extends $protobuf.rpc.Service { + + /** + * Constructs a new DatabaseAdmin service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new DatabaseAdmin 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): DatabaseAdmin; + + /** + * Calls ListDatabases. + * @param request ListDatabasesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListDatabasesResponse + */ + public listDatabases(request: google.spanner.admin.database.v1.IListDatabasesRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.ListDatabasesCallback): void; + + /** + * Calls ListDatabases. + * @param request ListDatabasesRequest message or plain object + * @returns Promise + */ + public listDatabases(request: google.spanner.admin.database.v1.IListDatabasesRequest): Promise; + + /** + * Calls CreateDatabase. + * @param request CreateDatabaseRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createDatabase(request: google.spanner.admin.database.v1.ICreateDatabaseRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.CreateDatabaseCallback): void; + + /** + * Calls CreateDatabase. + * @param request CreateDatabaseRequest message or plain object + * @returns Promise + */ + public createDatabase(request: google.spanner.admin.database.v1.ICreateDatabaseRequest): Promise; + + /** + * Calls GetDatabase. + * @param request GetDatabaseRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Database + */ + public getDatabase(request: google.spanner.admin.database.v1.IGetDatabaseRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.GetDatabaseCallback): void; + + /** + * Calls GetDatabase. + * @param request GetDatabaseRequest message or plain object + * @returns Promise + */ + public getDatabase(request: google.spanner.admin.database.v1.IGetDatabaseRequest): Promise; + + /** + * Calls UpdateDatabase. + * @param request UpdateDatabaseRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateDatabase(request: google.spanner.admin.database.v1.IUpdateDatabaseRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseCallback): void; + + /** + * Calls UpdateDatabase. + * @param request UpdateDatabaseRequest message or plain object + * @returns Promise + */ + public updateDatabase(request: google.spanner.admin.database.v1.IUpdateDatabaseRequest): Promise; + + /** + * Calls UpdateDatabaseDdl. + * @param request UpdateDatabaseDdlRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateDatabaseDdl(request: google.spanner.admin.database.v1.IUpdateDatabaseDdlRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdlCallback): void; + + /** + * Calls UpdateDatabaseDdl. + * @param request UpdateDatabaseDdlRequest message or plain object + * @returns Promise + */ + public updateDatabaseDdl(request: google.spanner.admin.database.v1.IUpdateDatabaseDdlRequest): Promise; + + /** + * Calls DropDatabase. + * @param request DropDatabaseRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public dropDatabase(request: google.spanner.admin.database.v1.IDropDatabaseRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.DropDatabaseCallback): void; + + /** + * Calls DropDatabase. + * @param request DropDatabaseRequest message or plain object + * @returns Promise + */ + public dropDatabase(request: google.spanner.admin.database.v1.IDropDatabaseRequest): Promise; + + /** + * Calls GetDatabaseDdl. + * @param request GetDatabaseDdlRequest message or plain object + * @param callback Node-style callback called with the error, if any, and GetDatabaseDdlResponse + */ + public getDatabaseDdl(request: google.spanner.admin.database.v1.IGetDatabaseDdlRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.GetDatabaseDdlCallback): void; + + /** + * Calls GetDatabaseDdl. + * @param request GetDatabaseDdlRequest message or plain object + * @returns Promise + */ + public getDatabaseDdl(request: google.spanner.admin.database.v1.IGetDatabaseDdlRequest): Promise; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.SetIamPolicyCallback): void; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @returns Promise + */ + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest): Promise; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.GetIamPolicyCallback): void; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @returns Promise + */ + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest): Promise; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + */ + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.TestIamPermissionsCallback): void; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @returns Promise + */ + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest): Promise; + + /** + * Calls CreateBackup. + * @param request CreateBackupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createBackup(request: google.spanner.admin.database.v1.ICreateBackupRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.CreateBackupCallback): void; + + /** + * Calls CreateBackup. + * @param request CreateBackupRequest message or plain object + * @returns Promise + */ + public createBackup(request: google.spanner.admin.database.v1.ICreateBackupRequest): Promise; + + /** + * Calls CopyBackup. + * @param request CopyBackupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public copyBackup(request: google.spanner.admin.database.v1.ICopyBackupRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.CopyBackupCallback): void; + + /** + * Calls CopyBackup. + * @param request CopyBackupRequest message or plain object + * @returns Promise + */ + public copyBackup(request: google.spanner.admin.database.v1.ICopyBackupRequest): Promise; + + /** + * Calls GetBackup. + * @param request GetBackupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Backup + */ + public getBackup(request: google.spanner.admin.database.v1.IGetBackupRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.GetBackupCallback): void; + + /** + * Calls GetBackup. + * @param request GetBackupRequest message or plain object + * @returns Promise + */ + public getBackup(request: google.spanner.admin.database.v1.IGetBackupRequest): Promise; + + /** + * Calls UpdateBackup. + * @param request UpdateBackupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Backup + */ + public updateBackup(request: google.spanner.admin.database.v1.IUpdateBackupRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.UpdateBackupCallback): void; + + /** + * Calls UpdateBackup. + * @param request UpdateBackupRequest message or plain object + * @returns Promise + */ + public updateBackup(request: google.spanner.admin.database.v1.IUpdateBackupRequest): Promise; + + /** + * Calls DeleteBackup. + * @param request DeleteBackupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteBackup(request: google.spanner.admin.database.v1.IDeleteBackupRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.DeleteBackupCallback): void; + + /** + * Calls DeleteBackup. + * @param request DeleteBackupRequest message or plain object + * @returns Promise + */ + public deleteBackup(request: google.spanner.admin.database.v1.IDeleteBackupRequest): Promise; + + /** + * Calls ListBackups. + * @param request ListBackupsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListBackupsResponse + */ + public listBackups(request: google.spanner.admin.database.v1.IListBackupsRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.ListBackupsCallback): void; + + /** + * Calls ListBackups. + * @param request ListBackupsRequest message or plain object + * @returns Promise + */ + public listBackups(request: google.spanner.admin.database.v1.IListBackupsRequest): Promise; + + /** + * Calls RestoreDatabase. + * @param request RestoreDatabaseRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public restoreDatabase(request: google.spanner.admin.database.v1.IRestoreDatabaseRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.RestoreDatabaseCallback): void; + + /** + * Calls RestoreDatabase. + * @param request RestoreDatabaseRequest message or plain object + * @returns Promise + */ + public restoreDatabase(request: google.spanner.admin.database.v1.IRestoreDatabaseRequest): Promise; + + /** + * Calls ListDatabaseOperations. + * @param request ListDatabaseOperationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListDatabaseOperationsResponse + */ + public listDatabaseOperations(request: google.spanner.admin.database.v1.IListDatabaseOperationsRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.ListDatabaseOperationsCallback): void; + + /** + * Calls ListDatabaseOperations. + * @param request ListDatabaseOperationsRequest message or plain object + * @returns Promise + */ + public listDatabaseOperations(request: google.spanner.admin.database.v1.IListDatabaseOperationsRequest): Promise; + + /** + * Calls ListBackupOperations. + * @param request ListBackupOperationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListBackupOperationsResponse + */ + public listBackupOperations(request: google.spanner.admin.database.v1.IListBackupOperationsRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.ListBackupOperationsCallback): void; + + /** + * Calls ListBackupOperations. + * @param request ListBackupOperationsRequest message or plain object + * @returns Promise + */ + public listBackupOperations(request: google.spanner.admin.database.v1.IListBackupOperationsRequest): Promise; + + /** + * Calls ListDatabaseRoles. + * @param request ListDatabaseRolesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListDatabaseRolesResponse + */ + public listDatabaseRoles(request: google.spanner.admin.database.v1.IListDatabaseRolesRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.ListDatabaseRolesCallback): void; + + /** + * Calls ListDatabaseRoles. + * @param request ListDatabaseRolesRequest message or plain object + * @returns Promise + */ + public listDatabaseRoles(request: google.spanner.admin.database.v1.IListDatabaseRolesRequest): Promise; + + /** + * Calls AddSplitPoints. + * @param request AddSplitPointsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AddSplitPointsResponse + */ + public addSplitPoints(request: google.spanner.admin.database.v1.IAddSplitPointsRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.AddSplitPointsCallback): void; + + /** + * Calls AddSplitPoints. + * @param request AddSplitPointsRequest message or plain object + * @returns Promise + */ + public addSplitPoints(request: google.spanner.admin.database.v1.IAddSplitPointsRequest): Promise; + + /** + * Calls CreateBackupSchedule. + * @param request CreateBackupScheduleRequest message or plain object + * @param callback Node-style callback called with the error, if any, and BackupSchedule + */ + public createBackupSchedule(request: google.spanner.admin.database.v1.ICreateBackupScheduleRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.CreateBackupScheduleCallback): void; + + /** + * Calls CreateBackupSchedule. + * @param request CreateBackupScheduleRequest message or plain object + * @returns Promise + */ + public createBackupSchedule(request: google.spanner.admin.database.v1.ICreateBackupScheduleRequest): Promise; + + /** + * Calls GetBackupSchedule. + * @param request GetBackupScheduleRequest message or plain object + * @param callback Node-style callback called with the error, if any, and BackupSchedule + */ + public getBackupSchedule(request: google.spanner.admin.database.v1.IGetBackupScheduleRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.GetBackupScheduleCallback): void; + + /** + * Calls GetBackupSchedule. + * @param request GetBackupScheduleRequest message or plain object + * @returns Promise + */ + public getBackupSchedule(request: google.spanner.admin.database.v1.IGetBackupScheduleRequest): Promise; + + /** + * Calls UpdateBackupSchedule. + * @param request UpdateBackupScheduleRequest message or plain object + * @param callback Node-style callback called with the error, if any, and BackupSchedule + */ + public updateBackupSchedule(request: google.spanner.admin.database.v1.IUpdateBackupScheduleRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.UpdateBackupScheduleCallback): void; + + /** + * Calls UpdateBackupSchedule. + * @param request UpdateBackupScheduleRequest message or plain object + * @returns Promise + */ + public updateBackupSchedule(request: google.spanner.admin.database.v1.IUpdateBackupScheduleRequest): Promise; + + /** + * Calls DeleteBackupSchedule. + * @param request DeleteBackupScheduleRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteBackupSchedule(request: google.spanner.admin.database.v1.IDeleteBackupScheduleRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.DeleteBackupScheduleCallback): void; + + /** + * Calls DeleteBackupSchedule. + * @param request DeleteBackupScheduleRequest message or plain object + * @returns Promise + */ + public deleteBackupSchedule(request: google.spanner.admin.database.v1.IDeleteBackupScheduleRequest): Promise; + + /** + * Calls ListBackupSchedules. + * @param request ListBackupSchedulesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListBackupSchedulesResponse + */ + public listBackupSchedules(request: google.spanner.admin.database.v1.IListBackupSchedulesRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.ListBackupSchedulesCallback): void; + + /** + * Calls ListBackupSchedules. + * @param request ListBackupSchedulesRequest message or plain object + * @returns Promise + */ + public listBackupSchedules(request: google.spanner.admin.database.v1.IListBackupSchedulesRequest): Promise; + + /** + * Calls InternalUpdateGraphOperation. + * @param request InternalUpdateGraphOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and InternalUpdateGraphOperationResponse + */ + public internalUpdateGraphOperation(request: google.spanner.admin.database.v1.IInternalUpdateGraphOperationRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.InternalUpdateGraphOperationCallback): void; + + /** + * Calls InternalUpdateGraphOperation. + * @param request InternalUpdateGraphOperationRequest message or plain object + * @returns Promise + */ + public internalUpdateGraphOperation(request: google.spanner.admin.database.v1.IInternalUpdateGraphOperationRequest): Promise; + } + + namespace DatabaseAdmin { + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|listDatabases}. + * @param error Error, if any + * @param [response] ListDatabasesResponse + */ + type ListDatabasesCallback = (error: (Error|null), response?: google.spanner.admin.database.v1.ListDatabasesResponse) => void; + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|createDatabase}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateDatabaseCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|getDatabase}. + * @param error Error, if any + * @param [response] Database + */ + type GetDatabaseCallback = (error: (Error|null), response?: google.spanner.admin.database.v1.Database) => void; + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|updateDatabase}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateDatabaseCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|updateDatabaseDdl}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateDatabaseDdlCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|dropDatabase}. + * @param error Error, if any + * @param [response] Empty + */ + type DropDatabaseCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|getDatabaseDdl}. + * @param error Error, if any + * @param [response] GetDatabaseDdlResponse + */ + type GetDatabaseDdlCallback = (error: (Error|null), response?: google.spanner.admin.database.v1.GetDatabaseDdlResponse) => void; + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|setIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type SetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|getIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type GetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|testIamPermissions}. + * @param error Error, if any + * @param [response] TestIamPermissionsResponse + */ + type TestIamPermissionsCallback = (error: (Error|null), response?: google.iam.v1.TestIamPermissionsResponse) => void; + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|createBackup}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateBackupCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|copyBackup}. + * @param error Error, if any + * @param [response] Operation + */ + type CopyBackupCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|getBackup}. + * @param error Error, if any + * @param [response] Backup + */ + type GetBackupCallback = (error: (Error|null), response?: google.spanner.admin.database.v1.Backup) => void; + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|updateBackup}. + * @param error Error, if any + * @param [response] Backup + */ + type UpdateBackupCallback = (error: (Error|null), response?: google.spanner.admin.database.v1.Backup) => void; + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|deleteBackup}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteBackupCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|listBackups}. + * @param error Error, if any + * @param [response] ListBackupsResponse + */ + type ListBackupsCallback = (error: (Error|null), response?: google.spanner.admin.database.v1.ListBackupsResponse) => void; + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|restoreDatabase}. + * @param error Error, if any + * @param [response] Operation + */ + type RestoreDatabaseCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|listDatabaseOperations}. + * @param error Error, if any + * @param [response] ListDatabaseOperationsResponse + */ + type ListDatabaseOperationsCallback = (error: (Error|null), response?: google.spanner.admin.database.v1.ListDatabaseOperationsResponse) => void; + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|listBackupOperations}. + * @param error Error, if any + * @param [response] ListBackupOperationsResponse + */ + type ListBackupOperationsCallback = (error: (Error|null), response?: google.spanner.admin.database.v1.ListBackupOperationsResponse) => void; + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|listDatabaseRoles}. + * @param error Error, if any + * @param [response] ListDatabaseRolesResponse + */ + type ListDatabaseRolesCallback = (error: (Error|null), response?: google.spanner.admin.database.v1.ListDatabaseRolesResponse) => void; + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|addSplitPoints}. + * @param error Error, if any + * @param [response] AddSplitPointsResponse + */ + type AddSplitPointsCallback = (error: (Error|null), response?: google.spanner.admin.database.v1.AddSplitPointsResponse) => void; + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|createBackupSchedule}. + * @param error Error, if any + * @param [response] BackupSchedule + */ + type CreateBackupScheduleCallback = (error: (Error|null), response?: google.spanner.admin.database.v1.BackupSchedule) => void; + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|getBackupSchedule}. + * @param error Error, if any + * @param [response] BackupSchedule + */ + type GetBackupScheduleCallback = (error: (Error|null), response?: google.spanner.admin.database.v1.BackupSchedule) => void; + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|updateBackupSchedule}. + * @param error Error, if any + * @param [response] BackupSchedule + */ + type UpdateBackupScheduleCallback = (error: (Error|null), response?: google.spanner.admin.database.v1.BackupSchedule) => void; + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|deleteBackupSchedule}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteBackupScheduleCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|listBackupSchedules}. + * @param error Error, if any + * @param [response] ListBackupSchedulesResponse + */ + type ListBackupSchedulesCallback = (error: (Error|null), response?: google.spanner.admin.database.v1.ListBackupSchedulesResponse) => void; + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|internalUpdateGraphOperation}. + * @param error Error, if any + * @param [response] InternalUpdateGraphOperationResponse + */ + type InternalUpdateGraphOperationCallback = (error: (Error|null), response?: google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse) => void; + } + + /** Properties of a RestoreInfo. */ + interface IRestoreInfo { + + /** RestoreInfo sourceType */ + sourceType?: (google.spanner.admin.database.v1.RestoreSourceType|keyof typeof google.spanner.admin.database.v1.RestoreSourceType|null); + + /** RestoreInfo backupInfo */ + backupInfo?: (google.spanner.admin.database.v1.IBackupInfo|null); + } + + /** Represents a RestoreInfo. */ + class RestoreInfo implements IRestoreInfo { + + /** + * Constructs a new RestoreInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IRestoreInfo); + + /** RestoreInfo sourceType. */ + public sourceType: (google.spanner.admin.database.v1.RestoreSourceType|keyof typeof google.spanner.admin.database.v1.RestoreSourceType); + + /** RestoreInfo backupInfo. */ + public backupInfo?: (google.spanner.admin.database.v1.IBackupInfo|null); + + /** RestoreInfo sourceInfo. */ + public sourceInfo?: "backupInfo"; + + /** + * Creates a new RestoreInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns RestoreInfo instance + */ + public static create(properties?: google.spanner.admin.database.v1.IRestoreInfo): google.spanner.admin.database.v1.RestoreInfo; + + /** + * Encodes the specified RestoreInfo message. Does not implicitly {@link google.spanner.admin.database.v1.RestoreInfo.verify|verify} messages. + * @param message RestoreInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IRestoreInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RestoreInfo message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.RestoreInfo.verify|verify} messages. + * @param message RestoreInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IRestoreInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RestoreInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RestoreInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.RestoreInfo; + + /** + * Decodes a RestoreInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RestoreInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.RestoreInfo; + + /** + * Verifies a RestoreInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RestoreInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RestoreInfo + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.RestoreInfo; + + /** + * Creates a plain object from a RestoreInfo message. Also converts values to other types if specified. + * @param message RestoreInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.RestoreInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RestoreInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RestoreInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Database. */ + interface IDatabase { + + /** Database name */ + name?: (string|null); + + /** Database state */ + state?: (google.spanner.admin.database.v1.Database.State|keyof typeof google.spanner.admin.database.v1.Database.State|null); + + /** Database createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Database restoreInfo */ + restoreInfo?: (google.spanner.admin.database.v1.IRestoreInfo|null); + + /** Database encryptionConfig */ + encryptionConfig?: (google.spanner.admin.database.v1.IEncryptionConfig|null); + + /** Database encryptionInfo */ + encryptionInfo?: (google.spanner.admin.database.v1.IEncryptionInfo[]|null); + + /** Database versionRetentionPeriod */ + versionRetentionPeriod?: (string|null); + + /** Database earliestVersionTime */ + earliestVersionTime?: (google.protobuf.ITimestamp|null); + + /** Database defaultLeader */ + defaultLeader?: (string|null); + + /** Database databaseDialect */ + databaseDialect?: (google.spanner.admin.database.v1.DatabaseDialect|keyof typeof google.spanner.admin.database.v1.DatabaseDialect|null); + + /** Database enableDropProtection */ + enableDropProtection?: (boolean|null); + + /** Database reconciling */ + reconciling?: (boolean|null); + } + + /** Represents a Database. */ + class Database implements IDatabase { + + /** + * Constructs a new Database. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IDatabase); + + /** Database name. */ + public name: string; + + /** Database state. */ + public state: (google.spanner.admin.database.v1.Database.State|keyof typeof google.spanner.admin.database.v1.Database.State); + + /** Database createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Database restoreInfo. */ + public restoreInfo?: (google.spanner.admin.database.v1.IRestoreInfo|null); + + /** Database encryptionConfig. */ + public encryptionConfig?: (google.spanner.admin.database.v1.IEncryptionConfig|null); + + /** Database encryptionInfo. */ + public encryptionInfo: google.spanner.admin.database.v1.IEncryptionInfo[]; + + /** Database versionRetentionPeriod. */ + public versionRetentionPeriod: string; + + /** Database earliestVersionTime. */ + public earliestVersionTime?: (google.protobuf.ITimestamp|null); + + /** Database defaultLeader. */ + public defaultLeader: string; + + /** Database databaseDialect. */ + public databaseDialect: (google.spanner.admin.database.v1.DatabaseDialect|keyof typeof google.spanner.admin.database.v1.DatabaseDialect); + + /** Database enableDropProtection. */ + public enableDropProtection: boolean; + + /** Database reconciling. */ + public reconciling: boolean; + + /** + * Creates a new Database instance using the specified properties. + * @param [properties] Properties to set + * @returns Database instance + */ + public static create(properties?: google.spanner.admin.database.v1.IDatabase): google.spanner.admin.database.v1.Database; + + /** + * Encodes the specified Database message. Does not implicitly {@link google.spanner.admin.database.v1.Database.verify|verify} messages. + * @param message Database message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IDatabase, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Database message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.Database.verify|verify} messages. + * @param message Database message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IDatabase, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Database message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Database + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.Database; + + /** + * Decodes a Database message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Database + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.Database; + + /** + * Verifies a Database message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Database message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Database + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.Database; + + /** + * Creates a plain object from a Database message. Also converts values to other types if specified. + * @param message Database + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.Database, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Database to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Database + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Database { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + CREATING = 1, + READY = 2, + READY_OPTIMIZING = 3 + } + } + + /** Properties of a ListDatabasesRequest. */ + interface IListDatabasesRequest { + + /** ListDatabasesRequest parent */ + parent?: (string|null); + + /** ListDatabasesRequest pageSize */ + pageSize?: (number|null); + + /** ListDatabasesRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListDatabasesRequest. */ + class ListDatabasesRequest implements IListDatabasesRequest { + + /** + * Constructs a new ListDatabasesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IListDatabasesRequest); + + /** ListDatabasesRequest parent. */ + public parent: string; + + /** ListDatabasesRequest pageSize. */ + public pageSize: number; + + /** ListDatabasesRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListDatabasesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDatabasesRequest instance + */ + public static create(properties?: google.spanner.admin.database.v1.IListDatabasesRequest): google.spanner.admin.database.v1.ListDatabasesRequest; + + /** + * Encodes the specified ListDatabasesRequest message. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabasesRequest.verify|verify} messages. + * @param message ListDatabasesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IListDatabasesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDatabasesRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabasesRequest.verify|verify} messages. + * @param message ListDatabasesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IListDatabasesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDatabasesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDatabasesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.ListDatabasesRequest; + + /** + * Decodes a ListDatabasesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDatabasesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.ListDatabasesRequest; + + /** + * Verifies a ListDatabasesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDatabasesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDatabasesRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.ListDatabasesRequest; + + /** + * Creates a plain object from a ListDatabasesRequest message. Also converts values to other types if specified. + * @param message ListDatabasesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.ListDatabasesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDatabasesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDatabasesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListDatabasesResponse. */ + interface IListDatabasesResponse { + + /** ListDatabasesResponse databases */ + databases?: (google.spanner.admin.database.v1.IDatabase[]|null); + + /** ListDatabasesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListDatabasesResponse. */ + class ListDatabasesResponse implements IListDatabasesResponse { + + /** + * Constructs a new ListDatabasesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IListDatabasesResponse); + + /** ListDatabasesResponse databases. */ + public databases: google.spanner.admin.database.v1.IDatabase[]; + + /** ListDatabasesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListDatabasesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDatabasesResponse instance + */ + public static create(properties?: google.spanner.admin.database.v1.IListDatabasesResponse): google.spanner.admin.database.v1.ListDatabasesResponse; + + /** + * Encodes the specified ListDatabasesResponse message. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabasesResponse.verify|verify} messages. + * @param message ListDatabasesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IListDatabasesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDatabasesResponse message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabasesResponse.verify|verify} messages. + * @param message ListDatabasesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IListDatabasesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDatabasesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDatabasesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.ListDatabasesResponse; + + /** + * Decodes a ListDatabasesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDatabasesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.ListDatabasesResponse; + + /** + * Verifies a ListDatabasesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDatabasesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDatabasesResponse + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.ListDatabasesResponse; + + /** + * Creates a plain object from a ListDatabasesResponse message. Also converts values to other types if specified. + * @param message ListDatabasesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.ListDatabasesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDatabasesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDatabasesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateDatabaseRequest. */ + interface ICreateDatabaseRequest { + + /** CreateDatabaseRequest parent */ + parent?: (string|null); + + /** CreateDatabaseRequest createStatement */ + createStatement?: (string|null); + + /** CreateDatabaseRequest extraStatements */ + extraStatements?: (string[]|null); + + /** CreateDatabaseRequest encryptionConfig */ + encryptionConfig?: (google.spanner.admin.database.v1.IEncryptionConfig|null); + + /** CreateDatabaseRequest databaseDialect */ + databaseDialect?: (google.spanner.admin.database.v1.DatabaseDialect|keyof typeof google.spanner.admin.database.v1.DatabaseDialect|null); + + /** CreateDatabaseRequest protoDescriptors */ + protoDescriptors?: (Uint8Array|Buffer|string|null); + } + + /** Represents a CreateDatabaseRequest. */ + class CreateDatabaseRequest implements ICreateDatabaseRequest { + + /** + * Constructs a new CreateDatabaseRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.ICreateDatabaseRequest); + + /** CreateDatabaseRequest parent. */ + public parent: string; + + /** CreateDatabaseRequest createStatement. */ + public createStatement: string; + + /** CreateDatabaseRequest extraStatements. */ + public extraStatements: string[]; + + /** CreateDatabaseRequest encryptionConfig. */ + public encryptionConfig?: (google.spanner.admin.database.v1.IEncryptionConfig|null); + + /** CreateDatabaseRequest databaseDialect. */ + public databaseDialect: (google.spanner.admin.database.v1.DatabaseDialect|keyof typeof google.spanner.admin.database.v1.DatabaseDialect); + + /** CreateDatabaseRequest protoDescriptors. */ + public protoDescriptors: (Uint8Array|Buffer|string); + + /** + * Creates a new CreateDatabaseRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateDatabaseRequest instance + */ + public static create(properties?: google.spanner.admin.database.v1.ICreateDatabaseRequest): google.spanner.admin.database.v1.CreateDatabaseRequest; + + /** + * Encodes the specified CreateDatabaseRequest message. Does not implicitly {@link google.spanner.admin.database.v1.CreateDatabaseRequest.verify|verify} messages. + * @param message CreateDatabaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.ICreateDatabaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateDatabaseRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.CreateDatabaseRequest.verify|verify} messages. + * @param message CreateDatabaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.ICreateDatabaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateDatabaseRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateDatabaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.CreateDatabaseRequest; + + /** + * Decodes a CreateDatabaseRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateDatabaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.CreateDatabaseRequest; + + /** + * Verifies a CreateDatabaseRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateDatabaseRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateDatabaseRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.CreateDatabaseRequest; + + /** + * Creates a plain object from a CreateDatabaseRequest message. Also converts values to other types if specified. + * @param message CreateDatabaseRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.CreateDatabaseRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateDatabaseRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateDatabaseRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateDatabaseMetadata. */ + interface ICreateDatabaseMetadata { + + /** CreateDatabaseMetadata database */ + database?: (string|null); + } + + /** Represents a CreateDatabaseMetadata. */ + class CreateDatabaseMetadata implements ICreateDatabaseMetadata { + + /** + * Constructs a new CreateDatabaseMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.ICreateDatabaseMetadata); + + /** CreateDatabaseMetadata database. */ + public database: string; + + /** + * Creates a new CreateDatabaseMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateDatabaseMetadata instance + */ + public static create(properties?: google.spanner.admin.database.v1.ICreateDatabaseMetadata): google.spanner.admin.database.v1.CreateDatabaseMetadata; + + /** + * Encodes the specified CreateDatabaseMetadata message. Does not implicitly {@link google.spanner.admin.database.v1.CreateDatabaseMetadata.verify|verify} messages. + * @param message CreateDatabaseMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.ICreateDatabaseMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateDatabaseMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.CreateDatabaseMetadata.verify|verify} messages. + * @param message CreateDatabaseMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.ICreateDatabaseMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateDatabaseMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateDatabaseMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.CreateDatabaseMetadata; + + /** + * Decodes a CreateDatabaseMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateDatabaseMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.CreateDatabaseMetadata; + + /** + * Verifies a CreateDatabaseMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateDatabaseMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateDatabaseMetadata + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.CreateDatabaseMetadata; + + /** + * Creates a plain object from a CreateDatabaseMetadata message. Also converts values to other types if specified. + * @param message CreateDatabaseMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.CreateDatabaseMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateDatabaseMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateDatabaseMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetDatabaseRequest. */ + interface IGetDatabaseRequest { + + /** GetDatabaseRequest name */ + name?: (string|null); + } + + /** Represents a GetDatabaseRequest. */ + class GetDatabaseRequest implements IGetDatabaseRequest { + + /** + * Constructs a new GetDatabaseRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IGetDatabaseRequest); + + /** GetDatabaseRequest name. */ + public name: string; + + /** + * Creates a new GetDatabaseRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetDatabaseRequest instance + */ + public static create(properties?: google.spanner.admin.database.v1.IGetDatabaseRequest): google.spanner.admin.database.v1.GetDatabaseRequest; + + /** + * Encodes the specified GetDatabaseRequest message. Does not implicitly {@link google.spanner.admin.database.v1.GetDatabaseRequest.verify|verify} messages. + * @param message GetDatabaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IGetDatabaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetDatabaseRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.GetDatabaseRequest.verify|verify} messages. + * @param message GetDatabaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IGetDatabaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetDatabaseRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetDatabaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.GetDatabaseRequest; + + /** + * Decodes a GetDatabaseRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetDatabaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.GetDatabaseRequest; + + /** + * Verifies a GetDatabaseRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetDatabaseRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetDatabaseRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.GetDatabaseRequest; + + /** + * Creates a plain object from a GetDatabaseRequest message. Also converts values to other types if specified. + * @param message GetDatabaseRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.GetDatabaseRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetDatabaseRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetDatabaseRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateDatabaseRequest. */ + interface IUpdateDatabaseRequest { + + /** UpdateDatabaseRequest database */ + database?: (google.spanner.admin.database.v1.IDatabase|null); + + /** UpdateDatabaseRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateDatabaseRequest. */ + class UpdateDatabaseRequest implements IUpdateDatabaseRequest { + + /** + * Constructs a new UpdateDatabaseRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IUpdateDatabaseRequest); + + /** UpdateDatabaseRequest database. */ + public database?: (google.spanner.admin.database.v1.IDatabase|null); + + /** UpdateDatabaseRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateDatabaseRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateDatabaseRequest instance + */ + public static create(properties?: google.spanner.admin.database.v1.IUpdateDatabaseRequest): google.spanner.admin.database.v1.UpdateDatabaseRequest; + + /** + * Encodes the specified UpdateDatabaseRequest message. Does not implicitly {@link google.spanner.admin.database.v1.UpdateDatabaseRequest.verify|verify} messages. + * @param message UpdateDatabaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IUpdateDatabaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateDatabaseRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.UpdateDatabaseRequest.verify|verify} messages. + * @param message UpdateDatabaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IUpdateDatabaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateDatabaseRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateDatabaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.UpdateDatabaseRequest; + + /** + * Decodes an UpdateDatabaseRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateDatabaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.UpdateDatabaseRequest; + + /** + * Verifies an UpdateDatabaseRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateDatabaseRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateDatabaseRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.UpdateDatabaseRequest; + + /** + * Creates a plain object from an UpdateDatabaseRequest message. Also converts values to other types if specified. + * @param message UpdateDatabaseRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.UpdateDatabaseRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateDatabaseRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateDatabaseRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateDatabaseMetadata. */ + interface IUpdateDatabaseMetadata { + + /** UpdateDatabaseMetadata request */ + request?: (google.spanner.admin.database.v1.IUpdateDatabaseRequest|null); + + /** UpdateDatabaseMetadata progress */ + progress?: (google.spanner.admin.database.v1.IOperationProgress|null); + + /** UpdateDatabaseMetadata cancelTime */ + cancelTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents an UpdateDatabaseMetadata. */ + class UpdateDatabaseMetadata implements IUpdateDatabaseMetadata { + + /** + * Constructs a new UpdateDatabaseMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IUpdateDatabaseMetadata); + + /** UpdateDatabaseMetadata request. */ + public request?: (google.spanner.admin.database.v1.IUpdateDatabaseRequest|null); + + /** UpdateDatabaseMetadata progress. */ + public progress?: (google.spanner.admin.database.v1.IOperationProgress|null); + + /** UpdateDatabaseMetadata cancelTime. */ + public cancelTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new UpdateDatabaseMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateDatabaseMetadata instance + */ + public static create(properties?: google.spanner.admin.database.v1.IUpdateDatabaseMetadata): google.spanner.admin.database.v1.UpdateDatabaseMetadata; + + /** + * Encodes the specified UpdateDatabaseMetadata message. Does not implicitly {@link google.spanner.admin.database.v1.UpdateDatabaseMetadata.verify|verify} messages. + * @param message UpdateDatabaseMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IUpdateDatabaseMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateDatabaseMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.UpdateDatabaseMetadata.verify|verify} messages. + * @param message UpdateDatabaseMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IUpdateDatabaseMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateDatabaseMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateDatabaseMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.UpdateDatabaseMetadata; + + /** + * Decodes an UpdateDatabaseMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateDatabaseMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.UpdateDatabaseMetadata; + + /** + * Verifies an UpdateDatabaseMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateDatabaseMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateDatabaseMetadata + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.UpdateDatabaseMetadata; + + /** + * Creates a plain object from an UpdateDatabaseMetadata message. Also converts values to other types if specified. + * @param message UpdateDatabaseMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.UpdateDatabaseMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateDatabaseMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateDatabaseMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateDatabaseDdlRequest. */ + interface IUpdateDatabaseDdlRequest { + + /** UpdateDatabaseDdlRequest database */ + database?: (string|null); + + /** UpdateDatabaseDdlRequest statements */ + statements?: (string[]|null); + + /** UpdateDatabaseDdlRequest operationId */ + operationId?: (string|null); + + /** UpdateDatabaseDdlRequest protoDescriptors */ + protoDescriptors?: (Uint8Array|Buffer|string|null); + + /** UpdateDatabaseDdlRequest throughputMode */ + throughputMode?: (boolean|null); + } + + /** Represents an UpdateDatabaseDdlRequest. */ + class UpdateDatabaseDdlRequest implements IUpdateDatabaseDdlRequest { + + /** + * Constructs a new UpdateDatabaseDdlRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IUpdateDatabaseDdlRequest); + + /** UpdateDatabaseDdlRequest database. */ + public database: string; + + /** UpdateDatabaseDdlRequest statements. */ + public statements: string[]; + + /** UpdateDatabaseDdlRequest operationId. */ + public operationId: string; + + /** UpdateDatabaseDdlRequest protoDescriptors. */ + public protoDescriptors: (Uint8Array|Buffer|string); + + /** UpdateDatabaseDdlRequest throughputMode. */ + public throughputMode: boolean; + + /** + * Creates a new UpdateDatabaseDdlRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateDatabaseDdlRequest instance + */ + public static create(properties?: google.spanner.admin.database.v1.IUpdateDatabaseDdlRequest): google.spanner.admin.database.v1.UpdateDatabaseDdlRequest; + + /** + * Encodes the specified UpdateDatabaseDdlRequest message. Does not implicitly {@link google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.verify|verify} messages. + * @param message UpdateDatabaseDdlRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IUpdateDatabaseDdlRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateDatabaseDdlRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.verify|verify} messages. + * @param message UpdateDatabaseDdlRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IUpdateDatabaseDdlRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateDatabaseDdlRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateDatabaseDdlRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.UpdateDatabaseDdlRequest; + + /** + * Decodes an UpdateDatabaseDdlRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateDatabaseDdlRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.UpdateDatabaseDdlRequest; + + /** + * Verifies an UpdateDatabaseDdlRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateDatabaseDdlRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateDatabaseDdlRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.UpdateDatabaseDdlRequest; + + /** + * Creates a plain object from an UpdateDatabaseDdlRequest message. Also converts values to other types if specified. + * @param message UpdateDatabaseDdlRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.UpdateDatabaseDdlRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateDatabaseDdlRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateDatabaseDdlRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DdlStatementActionInfo. */ + interface IDdlStatementActionInfo { + + /** DdlStatementActionInfo action */ + action?: (string|null); + + /** DdlStatementActionInfo entityType */ + entityType?: (string|null); + + /** DdlStatementActionInfo entityNames */ + entityNames?: (string[]|null); + } + + /** Represents a DdlStatementActionInfo. */ + class DdlStatementActionInfo implements IDdlStatementActionInfo { + + /** + * Constructs a new DdlStatementActionInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IDdlStatementActionInfo); + + /** DdlStatementActionInfo action. */ + public action: string; + + /** DdlStatementActionInfo entityType. */ + public entityType: string; + + /** DdlStatementActionInfo entityNames. */ + public entityNames: string[]; + + /** + * Creates a new DdlStatementActionInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns DdlStatementActionInfo instance + */ + public static create(properties?: google.spanner.admin.database.v1.IDdlStatementActionInfo): google.spanner.admin.database.v1.DdlStatementActionInfo; + + /** + * Encodes the specified DdlStatementActionInfo message. Does not implicitly {@link google.spanner.admin.database.v1.DdlStatementActionInfo.verify|verify} messages. + * @param message DdlStatementActionInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IDdlStatementActionInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DdlStatementActionInfo message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.DdlStatementActionInfo.verify|verify} messages. + * @param message DdlStatementActionInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IDdlStatementActionInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DdlStatementActionInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DdlStatementActionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.DdlStatementActionInfo; + + /** + * Decodes a DdlStatementActionInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DdlStatementActionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.DdlStatementActionInfo; + + /** + * Verifies a DdlStatementActionInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DdlStatementActionInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DdlStatementActionInfo + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.DdlStatementActionInfo; + + /** + * Creates a plain object from a DdlStatementActionInfo message. Also converts values to other types if specified. + * @param message DdlStatementActionInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.DdlStatementActionInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DdlStatementActionInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DdlStatementActionInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateDatabaseDdlMetadata. */ + interface IUpdateDatabaseDdlMetadata { + + /** UpdateDatabaseDdlMetadata database */ + database?: (string|null); + + /** UpdateDatabaseDdlMetadata statements */ + statements?: (string[]|null); + + /** UpdateDatabaseDdlMetadata commitTimestamps */ + commitTimestamps?: (google.protobuf.ITimestamp[]|null); + + /** UpdateDatabaseDdlMetadata throttled */ + throttled?: (boolean|null); + + /** UpdateDatabaseDdlMetadata progress */ + progress?: (google.spanner.admin.database.v1.IOperationProgress[]|null); + + /** UpdateDatabaseDdlMetadata actions */ + actions?: (google.spanner.admin.database.v1.IDdlStatementActionInfo[]|null); + } + + /** Represents an UpdateDatabaseDdlMetadata. */ + class UpdateDatabaseDdlMetadata implements IUpdateDatabaseDdlMetadata { + + /** + * Constructs a new UpdateDatabaseDdlMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IUpdateDatabaseDdlMetadata); + + /** UpdateDatabaseDdlMetadata database. */ + public database: string; + + /** UpdateDatabaseDdlMetadata statements. */ + public statements: string[]; + + /** UpdateDatabaseDdlMetadata commitTimestamps. */ + public commitTimestamps: google.protobuf.ITimestamp[]; + + /** UpdateDatabaseDdlMetadata throttled. */ + public throttled: boolean; + + /** UpdateDatabaseDdlMetadata progress. */ + public progress: google.spanner.admin.database.v1.IOperationProgress[]; + + /** UpdateDatabaseDdlMetadata actions. */ + public actions: google.spanner.admin.database.v1.IDdlStatementActionInfo[]; + + /** + * Creates a new UpdateDatabaseDdlMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateDatabaseDdlMetadata instance + */ + public static create(properties?: google.spanner.admin.database.v1.IUpdateDatabaseDdlMetadata): google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata; + + /** + * Encodes the specified UpdateDatabaseDdlMetadata message. Does not implicitly {@link google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata.verify|verify} messages. + * @param message UpdateDatabaseDdlMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IUpdateDatabaseDdlMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateDatabaseDdlMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata.verify|verify} messages. + * @param message UpdateDatabaseDdlMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IUpdateDatabaseDdlMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateDatabaseDdlMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateDatabaseDdlMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata; + + /** + * Decodes an UpdateDatabaseDdlMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateDatabaseDdlMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata; + + /** + * Verifies an UpdateDatabaseDdlMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateDatabaseDdlMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateDatabaseDdlMetadata + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata; + + /** + * Creates a plain object from an UpdateDatabaseDdlMetadata message. Also converts values to other types if specified. + * @param message UpdateDatabaseDdlMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateDatabaseDdlMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateDatabaseDdlMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DropDatabaseRequest. */ + interface IDropDatabaseRequest { + + /** DropDatabaseRequest database */ + database?: (string|null); + } + + /** Represents a DropDatabaseRequest. */ + class DropDatabaseRequest implements IDropDatabaseRequest { + + /** + * Constructs a new DropDatabaseRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IDropDatabaseRequest); + + /** DropDatabaseRequest database. */ + public database: string; + + /** + * Creates a new DropDatabaseRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DropDatabaseRequest instance + */ + public static create(properties?: google.spanner.admin.database.v1.IDropDatabaseRequest): google.spanner.admin.database.v1.DropDatabaseRequest; + + /** + * Encodes the specified DropDatabaseRequest message. Does not implicitly {@link google.spanner.admin.database.v1.DropDatabaseRequest.verify|verify} messages. + * @param message DropDatabaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IDropDatabaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DropDatabaseRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.DropDatabaseRequest.verify|verify} messages. + * @param message DropDatabaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IDropDatabaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DropDatabaseRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DropDatabaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.DropDatabaseRequest; + + /** + * Decodes a DropDatabaseRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DropDatabaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.DropDatabaseRequest; + + /** + * Verifies a DropDatabaseRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DropDatabaseRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DropDatabaseRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.DropDatabaseRequest; + + /** + * Creates a plain object from a DropDatabaseRequest message. Also converts values to other types if specified. + * @param message DropDatabaseRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.DropDatabaseRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DropDatabaseRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DropDatabaseRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetDatabaseDdlRequest. */ + interface IGetDatabaseDdlRequest { + + /** GetDatabaseDdlRequest database */ + database?: (string|null); + } + + /** Represents a GetDatabaseDdlRequest. */ + class GetDatabaseDdlRequest implements IGetDatabaseDdlRequest { + + /** + * Constructs a new GetDatabaseDdlRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IGetDatabaseDdlRequest); + + /** GetDatabaseDdlRequest database. */ + public database: string; + + /** + * Creates a new GetDatabaseDdlRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetDatabaseDdlRequest instance + */ + public static create(properties?: google.spanner.admin.database.v1.IGetDatabaseDdlRequest): google.spanner.admin.database.v1.GetDatabaseDdlRequest; + + /** + * Encodes the specified GetDatabaseDdlRequest message. Does not implicitly {@link google.spanner.admin.database.v1.GetDatabaseDdlRequest.verify|verify} messages. + * @param message GetDatabaseDdlRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IGetDatabaseDdlRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetDatabaseDdlRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.GetDatabaseDdlRequest.verify|verify} messages. + * @param message GetDatabaseDdlRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IGetDatabaseDdlRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetDatabaseDdlRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetDatabaseDdlRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.GetDatabaseDdlRequest; + + /** + * Decodes a GetDatabaseDdlRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetDatabaseDdlRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.GetDatabaseDdlRequest; + + /** + * Verifies a GetDatabaseDdlRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetDatabaseDdlRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetDatabaseDdlRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.GetDatabaseDdlRequest; + + /** + * Creates a plain object from a GetDatabaseDdlRequest message. Also converts values to other types if specified. + * @param message GetDatabaseDdlRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.GetDatabaseDdlRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetDatabaseDdlRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetDatabaseDdlRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetDatabaseDdlResponse. */ + interface IGetDatabaseDdlResponse { + + /** GetDatabaseDdlResponse statements */ + statements?: (string[]|null); + + /** GetDatabaseDdlResponse protoDescriptors */ + protoDescriptors?: (Uint8Array|Buffer|string|null); + } + + /** Represents a GetDatabaseDdlResponse. */ + class GetDatabaseDdlResponse implements IGetDatabaseDdlResponse { + + /** + * Constructs a new GetDatabaseDdlResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IGetDatabaseDdlResponse); + + /** GetDatabaseDdlResponse statements. */ + public statements: string[]; + + /** GetDatabaseDdlResponse protoDescriptors. */ + public protoDescriptors: (Uint8Array|Buffer|string); + + /** + * Creates a new GetDatabaseDdlResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns GetDatabaseDdlResponse instance + */ + public static create(properties?: google.spanner.admin.database.v1.IGetDatabaseDdlResponse): google.spanner.admin.database.v1.GetDatabaseDdlResponse; + + /** + * Encodes the specified GetDatabaseDdlResponse message. Does not implicitly {@link google.spanner.admin.database.v1.GetDatabaseDdlResponse.verify|verify} messages. + * @param message GetDatabaseDdlResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IGetDatabaseDdlResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetDatabaseDdlResponse message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.GetDatabaseDdlResponse.verify|verify} messages. + * @param message GetDatabaseDdlResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IGetDatabaseDdlResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetDatabaseDdlResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetDatabaseDdlResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.GetDatabaseDdlResponse; + + /** + * Decodes a GetDatabaseDdlResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetDatabaseDdlResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.GetDatabaseDdlResponse; + + /** + * Verifies a GetDatabaseDdlResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetDatabaseDdlResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetDatabaseDdlResponse + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.GetDatabaseDdlResponse; + + /** + * Creates a plain object from a GetDatabaseDdlResponse message. Also converts values to other types if specified. + * @param message GetDatabaseDdlResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.GetDatabaseDdlResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetDatabaseDdlResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetDatabaseDdlResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListDatabaseOperationsRequest. */ + interface IListDatabaseOperationsRequest { + + /** ListDatabaseOperationsRequest parent */ + parent?: (string|null); + + /** ListDatabaseOperationsRequest filter */ + filter?: (string|null); + + /** ListDatabaseOperationsRequest pageSize */ + pageSize?: (number|null); + + /** ListDatabaseOperationsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListDatabaseOperationsRequest. */ + class ListDatabaseOperationsRequest implements IListDatabaseOperationsRequest { + + /** + * Constructs a new ListDatabaseOperationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IListDatabaseOperationsRequest); + + /** ListDatabaseOperationsRequest parent. */ + public parent: string; + + /** ListDatabaseOperationsRequest filter. */ + public filter: string; + + /** ListDatabaseOperationsRequest pageSize. */ + public pageSize: number; + + /** ListDatabaseOperationsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListDatabaseOperationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDatabaseOperationsRequest instance + */ + public static create(properties?: google.spanner.admin.database.v1.IListDatabaseOperationsRequest): google.spanner.admin.database.v1.ListDatabaseOperationsRequest; + + /** + * Encodes the specified ListDatabaseOperationsRequest message. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabaseOperationsRequest.verify|verify} messages. + * @param message ListDatabaseOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IListDatabaseOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDatabaseOperationsRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabaseOperationsRequest.verify|verify} messages. + * @param message ListDatabaseOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IListDatabaseOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDatabaseOperationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDatabaseOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.ListDatabaseOperationsRequest; + + /** + * Decodes a ListDatabaseOperationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDatabaseOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.ListDatabaseOperationsRequest; + + /** + * Verifies a ListDatabaseOperationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDatabaseOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDatabaseOperationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.ListDatabaseOperationsRequest; + + /** + * Creates a plain object from a ListDatabaseOperationsRequest message. Also converts values to other types if specified. + * @param message ListDatabaseOperationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.ListDatabaseOperationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDatabaseOperationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDatabaseOperationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListDatabaseOperationsResponse. */ + interface IListDatabaseOperationsResponse { + + /** ListDatabaseOperationsResponse operations */ + operations?: (google.longrunning.IOperation[]|null); + + /** ListDatabaseOperationsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListDatabaseOperationsResponse. */ + class ListDatabaseOperationsResponse implements IListDatabaseOperationsResponse { + + /** + * Constructs a new ListDatabaseOperationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IListDatabaseOperationsResponse); + + /** ListDatabaseOperationsResponse operations. */ + public operations: google.longrunning.IOperation[]; + + /** ListDatabaseOperationsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListDatabaseOperationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDatabaseOperationsResponse instance + */ + public static create(properties?: google.spanner.admin.database.v1.IListDatabaseOperationsResponse): google.spanner.admin.database.v1.ListDatabaseOperationsResponse; + + /** + * Encodes the specified ListDatabaseOperationsResponse message. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabaseOperationsResponse.verify|verify} messages. + * @param message ListDatabaseOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IListDatabaseOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDatabaseOperationsResponse message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabaseOperationsResponse.verify|verify} messages. + * @param message ListDatabaseOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IListDatabaseOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDatabaseOperationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDatabaseOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.ListDatabaseOperationsResponse; + + /** + * Decodes a ListDatabaseOperationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDatabaseOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.ListDatabaseOperationsResponse; + + /** + * Verifies a ListDatabaseOperationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDatabaseOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDatabaseOperationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.ListDatabaseOperationsResponse; + + /** + * Creates a plain object from a ListDatabaseOperationsResponse message. Also converts values to other types if specified. + * @param message ListDatabaseOperationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.ListDatabaseOperationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDatabaseOperationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDatabaseOperationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RestoreDatabaseRequest. */ + interface IRestoreDatabaseRequest { + + /** RestoreDatabaseRequest parent */ + parent?: (string|null); + + /** RestoreDatabaseRequest databaseId */ + databaseId?: (string|null); + + /** RestoreDatabaseRequest backup */ + backup?: (string|null); + + /** RestoreDatabaseRequest encryptionConfig */ + encryptionConfig?: (google.spanner.admin.database.v1.IRestoreDatabaseEncryptionConfig|null); + } + + /** Represents a RestoreDatabaseRequest. */ + class RestoreDatabaseRequest implements IRestoreDatabaseRequest { + + /** + * Constructs a new RestoreDatabaseRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IRestoreDatabaseRequest); + + /** RestoreDatabaseRequest parent. */ + public parent: string; + + /** RestoreDatabaseRequest databaseId. */ + public databaseId: string; + + /** RestoreDatabaseRequest backup. */ + public backup?: (string|null); + + /** RestoreDatabaseRequest encryptionConfig. */ + public encryptionConfig?: (google.spanner.admin.database.v1.IRestoreDatabaseEncryptionConfig|null); + + /** RestoreDatabaseRequest source. */ + public source?: "backup"; + + /** + * Creates a new RestoreDatabaseRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RestoreDatabaseRequest instance + */ + public static create(properties?: google.spanner.admin.database.v1.IRestoreDatabaseRequest): google.spanner.admin.database.v1.RestoreDatabaseRequest; + + /** + * Encodes the specified RestoreDatabaseRequest message. Does not implicitly {@link google.spanner.admin.database.v1.RestoreDatabaseRequest.verify|verify} messages. + * @param message RestoreDatabaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IRestoreDatabaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RestoreDatabaseRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.RestoreDatabaseRequest.verify|verify} messages. + * @param message RestoreDatabaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IRestoreDatabaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RestoreDatabaseRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RestoreDatabaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.RestoreDatabaseRequest; + + /** + * Decodes a RestoreDatabaseRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RestoreDatabaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.RestoreDatabaseRequest; + + /** + * Verifies a RestoreDatabaseRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RestoreDatabaseRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RestoreDatabaseRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.RestoreDatabaseRequest; + + /** + * Creates a plain object from a RestoreDatabaseRequest message. Also converts values to other types if specified. + * @param message RestoreDatabaseRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.RestoreDatabaseRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RestoreDatabaseRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RestoreDatabaseRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RestoreDatabaseEncryptionConfig. */ + interface IRestoreDatabaseEncryptionConfig { + + /** RestoreDatabaseEncryptionConfig encryptionType */ + encryptionType?: (google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.EncryptionType|keyof typeof google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.EncryptionType|null); + + /** RestoreDatabaseEncryptionConfig kmsKeyName */ + kmsKeyName?: (string|null); + + /** RestoreDatabaseEncryptionConfig kmsKeyNames */ + kmsKeyNames?: (string[]|null); + } + + /** Represents a RestoreDatabaseEncryptionConfig. */ + class RestoreDatabaseEncryptionConfig implements IRestoreDatabaseEncryptionConfig { + + /** + * Constructs a new RestoreDatabaseEncryptionConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IRestoreDatabaseEncryptionConfig); + + /** RestoreDatabaseEncryptionConfig encryptionType. */ + public encryptionType: (google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.EncryptionType|keyof typeof google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.EncryptionType); + + /** RestoreDatabaseEncryptionConfig kmsKeyName. */ + public kmsKeyName: string; + + /** RestoreDatabaseEncryptionConfig kmsKeyNames. */ + public kmsKeyNames: string[]; + + /** + * Creates a new RestoreDatabaseEncryptionConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns RestoreDatabaseEncryptionConfig instance + */ + public static create(properties?: google.spanner.admin.database.v1.IRestoreDatabaseEncryptionConfig): google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig; + + /** + * Encodes the specified RestoreDatabaseEncryptionConfig message. Does not implicitly {@link google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.verify|verify} messages. + * @param message RestoreDatabaseEncryptionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IRestoreDatabaseEncryptionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RestoreDatabaseEncryptionConfig message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.verify|verify} messages. + * @param message RestoreDatabaseEncryptionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IRestoreDatabaseEncryptionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RestoreDatabaseEncryptionConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RestoreDatabaseEncryptionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig; + + /** + * Decodes a RestoreDatabaseEncryptionConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RestoreDatabaseEncryptionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig; + + /** + * Verifies a RestoreDatabaseEncryptionConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RestoreDatabaseEncryptionConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RestoreDatabaseEncryptionConfig + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig; + + /** + * Creates a plain object from a RestoreDatabaseEncryptionConfig message. Also converts values to other types if specified. + * @param message RestoreDatabaseEncryptionConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RestoreDatabaseEncryptionConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RestoreDatabaseEncryptionConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace RestoreDatabaseEncryptionConfig { + + /** EncryptionType enum. */ + enum EncryptionType { + ENCRYPTION_TYPE_UNSPECIFIED = 0, + USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION = 1, + GOOGLE_DEFAULT_ENCRYPTION = 2, + CUSTOMER_MANAGED_ENCRYPTION = 3 + } + } + + /** Properties of a RestoreDatabaseMetadata. */ + interface IRestoreDatabaseMetadata { + + /** RestoreDatabaseMetadata name */ + name?: (string|null); + + /** RestoreDatabaseMetadata sourceType */ + sourceType?: (google.spanner.admin.database.v1.RestoreSourceType|keyof typeof google.spanner.admin.database.v1.RestoreSourceType|null); + + /** RestoreDatabaseMetadata backupInfo */ + backupInfo?: (google.spanner.admin.database.v1.IBackupInfo|null); + + /** RestoreDatabaseMetadata progress */ + progress?: (google.spanner.admin.database.v1.IOperationProgress|null); + + /** RestoreDatabaseMetadata cancelTime */ + cancelTime?: (google.protobuf.ITimestamp|null); + + /** RestoreDatabaseMetadata optimizeDatabaseOperationName */ + optimizeDatabaseOperationName?: (string|null); + } + + /** Represents a RestoreDatabaseMetadata. */ + class RestoreDatabaseMetadata implements IRestoreDatabaseMetadata { + + /** + * Constructs a new RestoreDatabaseMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IRestoreDatabaseMetadata); + + /** RestoreDatabaseMetadata name. */ + public name: string; + + /** RestoreDatabaseMetadata sourceType. */ + public sourceType: (google.spanner.admin.database.v1.RestoreSourceType|keyof typeof google.spanner.admin.database.v1.RestoreSourceType); + + /** RestoreDatabaseMetadata backupInfo. */ + public backupInfo?: (google.spanner.admin.database.v1.IBackupInfo|null); + + /** RestoreDatabaseMetadata progress. */ + public progress?: (google.spanner.admin.database.v1.IOperationProgress|null); + + /** RestoreDatabaseMetadata cancelTime. */ + public cancelTime?: (google.protobuf.ITimestamp|null); + + /** RestoreDatabaseMetadata optimizeDatabaseOperationName. */ + public optimizeDatabaseOperationName: string; + + /** RestoreDatabaseMetadata sourceInfo. */ + public sourceInfo?: "backupInfo"; + + /** + * Creates a new RestoreDatabaseMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns RestoreDatabaseMetadata instance + */ + public static create(properties?: google.spanner.admin.database.v1.IRestoreDatabaseMetadata): google.spanner.admin.database.v1.RestoreDatabaseMetadata; + + /** + * Encodes the specified RestoreDatabaseMetadata message. Does not implicitly {@link google.spanner.admin.database.v1.RestoreDatabaseMetadata.verify|verify} messages. + * @param message RestoreDatabaseMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IRestoreDatabaseMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RestoreDatabaseMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.RestoreDatabaseMetadata.verify|verify} messages. + * @param message RestoreDatabaseMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IRestoreDatabaseMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RestoreDatabaseMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RestoreDatabaseMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.RestoreDatabaseMetadata; + + /** + * Decodes a RestoreDatabaseMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RestoreDatabaseMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.RestoreDatabaseMetadata; + + /** + * Verifies a RestoreDatabaseMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RestoreDatabaseMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RestoreDatabaseMetadata + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.RestoreDatabaseMetadata; + + /** + * Creates a plain object from a RestoreDatabaseMetadata message. Also converts values to other types if specified. + * @param message RestoreDatabaseMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.RestoreDatabaseMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RestoreDatabaseMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RestoreDatabaseMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OptimizeRestoredDatabaseMetadata. */ + interface IOptimizeRestoredDatabaseMetadata { + + /** OptimizeRestoredDatabaseMetadata name */ + name?: (string|null); + + /** OptimizeRestoredDatabaseMetadata progress */ + progress?: (google.spanner.admin.database.v1.IOperationProgress|null); + } + + /** Represents an OptimizeRestoredDatabaseMetadata. */ + class OptimizeRestoredDatabaseMetadata implements IOptimizeRestoredDatabaseMetadata { + + /** + * Constructs a new OptimizeRestoredDatabaseMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IOptimizeRestoredDatabaseMetadata); + + /** OptimizeRestoredDatabaseMetadata name. */ + public name: string; + + /** OptimizeRestoredDatabaseMetadata progress. */ + public progress?: (google.spanner.admin.database.v1.IOperationProgress|null); + + /** + * Creates a new OptimizeRestoredDatabaseMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns OptimizeRestoredDatabaseMetadata instance + */ + public static create(properties?: google.spanner.admin.database.v1.IOptimizeRestoredDatabaseMetadata): google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata; + + /** + * Encodes the specified OptimizeRestoredDatabaseMetadata message. Does not implicitly {@link google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata.verify|verify} messages. + * @param message OptimizeRestoredDatabaseMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IOptimizeRestoredDatabaseMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OptimizeRestoredDatabaseMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata.verify|verify} messages. + * @param message OptimizeRestoredDatabaseMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IOptimizeRestoredDatabaseMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OptimizeRestoredDatabaseMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OptimizeRestoredDatabaseMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata; + + /** + * Decodes an OptimizeRestoredDatabaseMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OptimizeRestoredDatabaseMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata; + + /** + * Verifies an OptimizeRestoredDatabaseMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OptimizeRestoredDatabaseMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OptimizeRestoredDatabaseMetadata + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata; + + /** + * Creates a plain object from an OptimizeRestoredDatabaseMetadata message. Also converts values to other types if specified. + * @param message OptimizeRestoredDatabaseMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OptimizeRestoredDatabaseMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OptimizeRestoredDatabaseMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** RestoreSourceType enum. */ + enum RestoreSourceType { + TYPE_UNSPECIFIED = 0, + BACKUP = 1 + } + + /** Properties of a DatabaseRole. */ + interface IDatabaseRole { + + /** DatabaseRole name */ + name?: (string|null); + } + + /** Represents a DatabaseRole. */ + class DatabaseRole implements IDatabaseRole { + + /** + * Constructs a new DatabaseRole. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IDatabaseRole); + + /** DatabaseRole name. */ + public name: string; + + /** + * Creates a new DatabaseRole instance using the specified properties. + * @param [properties] Properties to set + * @returns DatabaseRole instance + */ + public static create(properties?: google.spanner.admin.database.v1.IDatabaseRole): google.spanner.admin.database.v1.DatabaseRole; + + /** + * Encodes the specified DatabaseRole message. Does not implicitly {@link google.spanner.admin.database.v1.DatabaseRole.verify|verify} messages. + * @param message DatabaseRole message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IDatabaseRole, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DatabaseRole message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.DatabaseRole.verify|verify} messages. + * @param message DatabaseRole message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IDatabaseRole, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DatabaseRole message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DatabaseRole + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.DatabaseRole; + + /** + * Decodes a DatabaseRole message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DatabaseRole + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.DatabaseRole; + + /** + * Verifies a DatabaseRole message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DatabaseRole message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DatabaseRole + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.DatabaseRole; + + /** + * Creates a plain object from a DatabaseRole message. Also converts values to other types if specified. + * @param message DatabaseRole + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.DatabaseRole, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DatabaseRole to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DatabaseRole + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListDatabaseRolesRequest. */ + interface IListDatabaseRolesRequest { + + /** ListDatabaseRolesRequest parent */ + parent?: (string|null); + + /** ListDatabaseRolesRequest pageSize */ + pageSize?: (number|null); + + /** ListDatabaseRolesRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListDatabaseRolesRequest. */ + class ListDatabaseRolesRequest implements IListDatabaseRolesRequest { + + /** + * Constructs a new ListDatabaseRolesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IListDatabaseRolesRequest); + + /** ListDatabaseRolesRequest parent. */ + public parent: string; + + /** ListDatabaseRolesRequest pageSize. */ + public pageSize: number; + + /** ListDatabaseRolesRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListDatabaseRolesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDatabaseRolesRequest instance + */ + public static create(properties?: google.spanner.admin.database.v1.IListDatabaseRolesRequest): google.spanner.admin.database.v1.ListDatabaseRolesRequest; + + /** + * Encodes the specified ListDatabaseRolesRequest message. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabaseRolesRequest.verify|verify} messages. + * @param message ListDatabaseRolesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IListDatabaseRolesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDatabaseRolesRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabaseRolesRequest.verify|verify} messages. + * @param message ListDatabaseRolesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IListDatabaseRolesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDatabaseRolesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDatabaseRolesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.ListDatabaseRolesRequest; + + /** + * Decodes a ListDatabaseRolesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDatabaseRolesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.ListDatabaseRolesRequest; + + /** + * Verifies a ListDatabaseRolesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDatabaseRolesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDatabaseRolesRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.ListDatabaseRolesRequest; + + /** + * Creates a plain object from a ListDatabaseRolesRequest message. Also converts values to other types if specified. + * @param message ListDatabaseRolesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.ListDatabaseRolesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDatabaseRolesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDatabaseRolesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListDatabaseRolesResponse. */ + interface IListDatabaseRolesResponse { + + /** ListDatabaseRolesResponse databaseRoles */ + databaseRoles?: (google.spanner.admin.database.v1.IDatabaseRole[]|null); + + /** ListDatabaseRolesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListDatabaseRolesResponse. */ + class ListDatabaseRolesResponse implements IListDatabaseRolesResponse { + + /** + * Constructs a new ListDatabaseRolesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IListDatabaseRolesResponse); + + /** ListDatabaseRolesResponse databaseRoles. */ + public databaseRoles: google.spanner.admin.database.v1.IDatabaseRole[]; + + /** ListDatabaseRolesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListDatabaseRolesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDatabaseRolesResponse instance + */ + public static create(properties?: google.spanner.admin.database.v1.IListDatabaseRolesResponse): google.spanner.admin.database.v1.ListDatabaseRolesResponse; + + /** + * Encodes the specified ListDatabaseRolesResponse message. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabaseRolesResponse.verify|verify} messages. + * @param message ListDatabaseRolesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IListDatabaseRolesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDatabaseRolesResponse message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabaseRolesResponse.verify|verify} messages. + * @param message ListDatabaseRolesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IListDatabaseRolesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDatabaseRolesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDatabaseRolesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.ListDatabaseRolesResponse; + + /** + * Decodes a ListDatabaseRolesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDatabaseRolesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.ListDatabaseRolesResponse; + + /** + * Verifies a ListDatabaseRolesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDatabaseRolesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDatabaseRolesResponse + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.ListDatabaseRolesResponse; + + /** + * Creates a plain object from a ListDatabaseRolesResponse message. Also converts values to other types if specified. + * @param message ListDatabaseRolesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.ListDatabaseRolesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDatabaseRolesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDatabaseRolesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AddSplitPointsRequest. */ + interface IAddSplitPointsRequest { + + /** AddSplitPointsRequest database */ + database?: (string|null); + + /** AddSplitPointsRequest splitPoints */ + splitPoints?: (google.spanner.admin.database.v1.ISplitPoints[]|null); + + /** AddSplitPointsRequest initiator */ + initiator?: (string|null); + } + + /** Represents an AddSplitPointsRequest. */ + class AddSplitPointsRequest implements IAddSplitPointsRequest { + + /** + * Constructs a new AddSplitPointsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IAddSplitPointsRequest); + + /** AddSplitPointsRequest database. */ + public database: string; + + /** AddSplitPointsRequest splitPoints. */ + public splitPoints: google.spanner.admin.database.v1.ISplitPoints[]; + + /** AddSplitPointsRequest initiator. */ + public initiator: string; + + /** + * Creates a new AddSplitPointsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AddSplitPointsRequest instance + */ + public static create(properties?: google.spanner.admin.database.v1.IAddSplitPointsRequest): google.spanner.admin.database.v1.AddSplitPointsRequest; + + /** + * Encodes the specified AddSplitPointsRequest message. Does not implicitly {@link google.spanner.admin.database.v1.AddSplitPointsRequest.verify|verify} messages. + * @param message AddSplitPointsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IAddSplitPointsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AddSplitPointsRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.AddSplitPointsRequest.verify|verify} messages. + * @param message AddSplitPointsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IAddSplitPointsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AddSplitPointsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AddSplitPointsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.AddSplitPointsRequest; + + /** + * Decodes an AddSplitPointsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AddSplitPointsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.AddSplitPointsRequest; + + /** + * Verifies an AddSplitPointsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AddSplitPointsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AddSplitPointsRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.AddSplitPointsRequest; + + /** + * Creates a plain object from an AddSplitPointsRequest message. Also converts values to other types if specified. + * @param message AddSplitPointsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.AddSplitPointsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AddSplitPointsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AddSplitPointsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AddSplitPointsResponse. */ + interface IAddSplitPointsResponse { + } + + /** Represents an AddSplitPointsResponse. */ + class AddSplitPointsResponse implements IAddSplitPointsResponse { + + /** + * Constructs a new AddSplitPointsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IAddSplitPointsResponse); + + /** + * Creates a new AddSplitPointsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns AddSplitPointsResponse instance + */ + public static create(properties?: google.spanner.admin.database.v1.IAddSplitPointsResponse): google.spanner.admin.database.v1.AddSplitPointsResponse; + + /** + * Encodes the specified AddSplitPointsResponse message. Does not implicitly {@link google.spanner.admin.database.v1.AddSplitPointsResponse.verify|verify} messages. + * @param message AddSplitPointsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IAddSplitPointsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AddSplitPointsResponse message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.AddSplitPointsResponse.verify|verify} messages. + * @param message AddSplitPointsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IAddSplitPointsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AddSplitPointsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AddSplitPointsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.AddSplitPointsResponse; + + /** + * Decodes an AddSplitPointsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AddSplitPointsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.AddSplitPointsResponse; + + /** + * Verifies an AddSplitPointsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AddSplitPointsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AddSplitPointsResponse + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.AddSplitPointsResponse; + + /** + * Creates a plain object from an AddSplitPointsResponse message. Also converts values to other types if specified. + * @param message AddSplitPointsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.AddSplitPointsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AddSplitPointsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AddSplitPointsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SplitPoints. */ + interface ISplitPoints { + + /** SplitPoints table */ + table?: (string|null); + + /** SplitPoints index */ + index?: (string|null); + + /** SplitPoints keys */ + keys?: (google.spanner.admin.database.v1.SplitPoints.IKey[]|null); + + /** SplitPoints expireTime */ + expireTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a SplitPoints. */ + class SplitPoints implements ISplitPoints { + + /** + * Constructs a new SplitPoints. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.ISplitPoints); + + /** SplitPoints table. */ + public table: string; + + /** SplitPoints index. */ + public index: string; + + /** SplitPoints keys. */ + public keys: google.spanner.admin.database.v1.SplitPoints.IKey[]; + + /** SplitPoints expireTime. */ + public expireTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new SplitPoints instance using the specified properties. + * @param [properties] Properties to set + * @returns SplitPoints instance + */ + public static create(properties?: google.spanner.admin.database.v1.ISplitPoints): google.spanner.admin.database.v1.SplitPoints; + + /** + * Encodes the specified SplitPoints message. Does not implicitly {@link google.spanner.admin.database.v1.SplitPoints.verify|verify} messages. + * @param message SplitPoints message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.ISplitPoints, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SplitPoints message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.SplitPoints.verify|verify} messages. + * @param message SplitPoints message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.ISplitPoints, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SplitPoints message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SplitPoints + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.SplitPoints; + + /** + * Decodes a SplitPoints message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SplitPoints + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.SplitPoints; + + /** + * Verifies a SplitPoints message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SplitPoints message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SplitPoints + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.SplitPoints; + + /** + * Creates a plain object from a SplitPoints message. Also converts values to other types if specified. + * @param message SplitPoints + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.SplitPoints, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SplitPoints to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SplitPoints + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SplitPoints { + + /** Properties of a Key. */ + interface IKey { + + /** Key keyParts */ + keyParts?: (google.protobuf.IListValue|null); + } + + /** Represents a Key. */ + class Key implements IKey { + + /** + * Constructs a new Key. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.SplitPoints.IKey); + + /** Key keyParts. */ + public keyParts?: (google.protobuf.IListValue|null); + + /** + * Creates a new Key instance using the specified properties. + * @param [properties] Properties to set + * @returns Key instance + */ + public static create(properties?: google.spanner.admin.database.v1.SplitPoints.IKey): google.spanner.admin.database.v1.SplitPoints.Key; + + /** + * Encodes the specified Key message. Does not implicitly {@link google.spanner.admin.database.v1.SplitPoints.Key.verify|verify} messages. + * @param message Key message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.SplitPoints.IKey, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Key message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.SplitPoints.Key.verify|verify} messages. + * @param message Key message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.SplitPoints.IKey, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Key message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.SplitPoints.Key; + + /** + * Decodes a Key message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.SplitPoints.Key; + + /** + * Verifies a Key message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Key message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Key + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.SplitPoints.Key; + + /** + * Creates a plain object from a Key message. Also converts values to other types if specified. + * @param message Key + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.SplitPoints.Key, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Key to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Key + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an InternalUpdateGraphOperationRequest. */ + interface IInternalUpdateGraphOperationRequest { + + /** InternalUpdateGraphOperationRequest database */ + database?: (string|null); + + /** InternalUpdateGraphOperationRequest operationId */ + operationId?: (string|null); + + /** InternalUpdateGraphOperationRequest vmIdentityToken */ + vmIdentityToken?: (string|null); + + /** InternalUpdateGraphOperationRequest progress */ + progress?: (number|null); + + /** InternalUpdateGraphOperationRequest status */ + status?: (google.rpc.IStatus|null); + } + + /** Represents an InternalUpdateGraphOperationRequest. */ + class InternalUpdateGraphOperationRequest implements IInternalUpdateGraphOperationRequest { + + /** + * Constructs a new InternalUpdateGraphOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IInternalUpdateGraphOperationRequest); + + /** InternalUpdateGraphOperationRequest database. */ + public database: string; + + /** InternalUpdateGraphOperationRequest operationId. */ + public operationId: string; + + /** InternalUpdateGraphOperationRequest vmIdentityToken. */ + public vmIdentityToken: string; + + /** InternalUpdateGraphOperationRequest progress. */ + public progress: number; + + /** InternalUpdateGraphOperationRequest status. */ + public status?: (google.rpc.IStatus|null); + + /** + * Creates a new InternalUpdateGraphOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InternalUpdateGraphOperationRequest instance + */ + public static create(properties?: google.spanner.admin.database.v1.IInternalUpdateGraphOperationRequest): google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest; + + /** + * Encodes the specified InternalUpdateGraphOperationRequest message. Does not implicitly {@link google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest.verify|verify} messages. + * @param message InternalUpdateGraphOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IInternalUpdateGraphOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InternalUpdateGraphOperationRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest.verify|verify} messages. + * @param message InternalUpdateGraphOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IInternalUpdateGraphOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InternalUpdateGraphOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InternalUpdateGraphOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest; + + /** + * Decodes an InternalUpdateGraphOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InternalUpdateGraphOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest; + + /** + * Verifies an InternalUpdateGraphOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InternalUpdateGraphOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InternalUpdateGraphOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest; + + /** + * Creates a plain object from an InternalUpdateGraphOperationRequest message. Also converts values to other types if specified. + * @param message InternalUpdateGraphOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InternalUpdateGraphOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InternalUpdateGraphOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an InternalUpdateGraphOperationResponse. */ + interface IInternalUpdateGraphOperationResponse { + } + + /** Represents an InternalUpdateGraphOperationResponse. */ + class InternalUpdateGraphOperationResponse implements IInternalUpdateGraphOperationResponse { + + /** + * Constructs a new InternalUpdateGraphOperationResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.database.v1.IInternalUpdateGraphOperationResponse); + + /** + * Creates a new InternalUpdateGraphOperationResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns InternalUpdateGraphOperationResponse instance + */ + public static create(properties?: google.spanner.admin.database.v1.IInternalUpdateGraphOperationResponse): google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse; + + /** + * Encodes the specified InternalUpdateGraphOperationResponse message. Does not implicitly {@link google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse.verify|verify} messages. + * @param message InternalUpdateGraphOperationResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.database.v1.IInternalUpdateGraphOperationResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InternalUpdateGraphOperationResponse message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse.verify|verify} messages. + * @param message InternalUpdateGraphOperationResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.database.v1.IInternalUpdateGraphOperationResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InternalUpdateGraphOperationResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InternalUpdateGraphOperationResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse; + + /** + * Decodes an InternalUpdateGraphOperationResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InternalUpdateGraphOperationResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse; + + /** + * Verifies an InternalUpdateGraphOperationResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InternalUpdateGraphOperationResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InternalUpdateGraphOperationResponse + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse; + + /** + * Creates a plain object from an InternalUpdateGraphOperationResponse message. Also converts values to other types if specified. + * @param message InternalUpdateGraphOperationResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InternalUpdateGraphOperationResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InternalUpdateGraphOperationResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Namespace instance. */ + namespace instance { + + /** Namespace v1. */ + namespace v1 { + + /** Properties of an OperationProgress. */ + interface IOperationProgress { + + /** OperationProgress progressPercent */ + progressPercent?: (number|null); + + /** OperationProgress startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** OperationProgress endTime */ + endTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents an OperationProgress. */ + class OperationProgress implements IOperationProgress { + + /** + * Constructs a new OperationProgress. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.instance.v1.IOperationProgress); + + /** OperationProgress progressPercent. */ + public progressPercent: number; + + /** OperationProgress startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** OperationProgress endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new OperationProgress instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationProgress instance + */ + public static create(properties?: google.spanner.admin.instance.v1.IOperationProgress): google.spanner.admin.instance.v1.OperationProgress; + + /** + * Encodes the specified OperationProgress message. Does not implicitly {@link google.spanner.admin.instance.v1.OperationProgress.verify|verify} messages. + * @param message OperationProgress message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.instance.v1.IOperationProgress, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationProgress message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.OperationProgress.verify|verify} messages. + * @param message OperationProgress message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.instance.v1.IOperationProgress, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationProgress message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationProgress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.OperationProgress; + + /** + * Decodes an OperationProgress message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationProgress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.OperationProgress; + + /** + * Verifies an OperationProgress message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OperationProgress message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationProgress + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.OperationProgress; + + /** + * Creates a plain object from an OperationProgress message. Also converts values to other types if specified. + * @param message OperationProgress + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.instance.v1.OperationProgress, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationProgress to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OperationProgress + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** FulfillmentPeriod enum. */ + enum FulfillmentPeriod { + FULFILLMENT_PERIOD_UNSPECIFIED = 0, + FULFILLMENT_PERIOD_NORMAL = 1, + FULFILLMENT_PERIOD_EXTENDED = 2 + } + + /** Properties of a ReplicaSelection. */ + interface IReplicaSelection { + + /** ReplicaSelection location */ + location?: (string|null); + } + + /** Represents a ReplicaSelection. */ + class ReplicaSelection implements IReplicaSelection { + + /** + * Constructs a new ReplicaSelection. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.instance.v1.IReplicaSelection); + + /** ReplicaSelection location. */ + public location: string; + + /** + * Creates a new ReplicaSelection instance using the specified properties. + * @param [properties] Properties to set + * @returns ReplicaSelection instance + */ + public static create(properties?: google.spanner.admin.instance.v1.IReplicaSelection): google.spanner.admin.instance.v1.ReplicaSelection; + + /** + * Encodes the specified ReplicaSelection message. Does not implicitly {@link google.spanner.admin.instance.v1.ReplicaSelection.verify|verify} messages. + * @param message ReplicaSelection message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.instance.v1.IReplicaSelection, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReplicaSelection message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ReplicaSelection.verify|verify} messages. + * @param message ReplicaSelection message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.instance.v1.IReplicaSelection, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReplicaSelection message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReplicaSelection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.ReplicaSelection; + + /** + * Decodes a ReplicaSelection message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReplicaSelection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.ReplicaSelection; + + /** + * Verifies a ReplicaSelection message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReplicaSelection message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReplicaSelection + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.ReplicaSelection; + + /** + * Creates a plain object from a ReplicaSelection message. Also converts values to other types if specified. + * @param message ReplicaSelection + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.instance.v1.ReplicaSelection, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReplicaSelection to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReplicaSelection + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents an InstanceAdmin */ + class InstanceAdmin extends $protobuf.rpc.Service { + + /** + * Constructs a new InstanceAdmin service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new InstanceAdmin 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): InstanceAdmin; + + /** + * Calls ListInstanceConfigs. + * @param request ListInstanceConfigsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListInstanceConfigsResponse + */ + public listInstanceConfigs(request: google.spanner.admin.instance.v1.IListInstanceConfigsRequest, callback: google.spanner.admin.instance.v1.InstanceAdmin.ListInstanceConfigsCallback): void; + + /** + * Calls ListInstanceConfigs. + * @param request ListInstanceConfigsRequest message or plain object + * @returns Promise + */ + public listInstanceConfigs(request: google.spanner.admin.instance.v1.IListInstanceConfigsRequest): Promise; + + /** + * Calls GetInstanceConfig. + * @param request GetInstanceConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and InstanceConfig + */ + public getInstanceConfig(request: google.spanner.admin.instance.v1.IGetInstanceConfigRequest, callback: google.spanner.admin.instance.v1.InstanceAdmin.GetInstanceConfigCallback): void; + + /** + * Calls GetInstanceConfig. + * @param request GetInstanceConfigRequest message or plain object + * @returns Promise + */ + public getInstanceConfig(request: google.spanner.admin.instance.v1.IGetInstanceConfigRequest): Promise; + + /** + * Calls CreateInstanceConfig. + * @param request CreateInstanceConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createInstanceConfig(request: google.spanner.admin.instance.v1.ICreateInstanceConfigRequest, callback: google.spanner.admin.instance.v1.InstanceAdmin.CreateInstanceConfigCallback): void; + + /** + * Calls CreateInstanceConfig. + * @param request CreateInstanceConfigRequest message or plain object + * @returns Promise + */ + public createInstanceConfig(request: google.spanner.admin.instance.v1.ICreateInstanceConfigRequest): Promise; + + /** + * Calls UpdateInstanceConfig. + * @param request UpdateInstanceConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateInstanceConfig(request: google.spanner.admin.instance.v1.IUpdateInstanceConfigRequest, callback: google.spanner.admin.instance.v1.InstanceAdmin.UpdateInstanceConfigCallback): void; + + /** + * Calls UpdateInstanceConfig. + * @param request UpdateInstanceConfigRequest message or plain object + * @returns Promise + */ + public updateInstanceConfig(request: google.spanner.admin.instance.v1.IUpdateInstanceConfigRequest): Promise; + + /** + * Calls DeleteInstanceConfig. + * @param request DeleteInstanceConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteInstanceConfig(request: google.spanner.admin.instance.v1.IDeleteInstanceConfigRequest, callback: google.spanner.admin.instance.v1.InstanceAdmin.DeleteInstanceConfigCallback): void; + + /** + * Calls DeleteInstanceConfig. + * @param request DeleteInstanceConfigRequest message or plain object + * @returns Promise + */ + public deleteInstanceConfig(request: google.spanner.admin.instance.v1.IDeleteInstanceConfigRequest): Promise; + + /** + * Calls ListInstanceConfigOperations. + * @param request ListInstanceConfigOperationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListInstanceConfigOperationsResponse + */ + public listInstanceConfigOperations(request: google.spanner.admin.instance.v1.IListInstanceConfigOperationsRequest, callback: google.spanner.admin.instance.v1.InstanceAdmin.ListInstanceConfigOperationsCallback): void; + + /** + * Calls ListInstanceConfigOperations. + * @param request ListInstanceConfigOperationsRequest message or plain object + * @returns Promise + */ + public listInstanceConfigOperations(request: google.spanner.admin.instance.v1.IListInstanceConfigOperationsRequest): Promise; + + /** + * Calls ListInstances. + * @param request ListInstancesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListInstancesResponse + */ + public listInstances(request: google.spanner.admin.instance.v1.IListInstancesRequest, callback: google.spanner.admin.instance.v1.InstanceAdmin.ListInstancesCallback): void; + + /** + * Calls ListInstances. + * @param request ListInstancesRequest message or plain object + * @returns Promise + */ + public listInstances(request: google.spanner.admin.instance.v1.IListInstancesRequest): Promise; + + /** + * Calls ListInstancePartitions. + * @param request ListInstancePartitionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListInstancePartitionsResponse + */ + public listInstancePartitions(request: google.spanner.admin.instance.v1.IListInstancePartitionsRequest, callback: google.spanner.admin.instance.v1.InstanceAdmin.ListInstancePartitionsCallback): void; + + /** + * Calls ListInstancePartitions. + * @param request ListInstancePartitionsRequest message or plain object + * @returns Promise + */ + public listInstancePartitions(request: google.spanner.admin.instance.v1.IListInstancePartitionsRequest): Promise; + + /** + * Calls GetInstance. + * @param request GetInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Instance + */ + public getInstance(request: google.spanner.admin.instance.v1.IGetInstanceRequest, callback: google.spanner.admin.instance.v1.InstanceAdmin.GetInstanceCallback): void; + + /** + * Calls GetInstance. + * @param request GetInstanceRequest message or plain object + * @returns Promise + */ + public getInstance(request: google.spanner.admin.instance.v1.IGetInstanceRequest): Promise; + + /** + * 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.spanner.admin.instance.v1.ICreateInstanceRequest, callback: google.spanner.admin.instance.v1.InstanceAdmin.CreateInstanceCallback): void; + + /** + * Calls CreateInstance. + * @param request CreateInstanceRequest message or plain object + * @returns Promise + */ + public createInstance(request: google.spanner.admin.instance.v1.ICreateInstanceRequest): Promise; + + /** + * Calls UpdateInstance. + * @param request UpdateInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateInstance(request: google.spanner.admin.instance.v1.IUpdateInstanceRequest, callback: google.spanner.admin.instance.v1.InstanceAdmin.UpdateInstanceCallback): void; + + /** + * Calls UpdateInstance. + * @param request UpdateInstanceRequest message or plain object + * @returns Promise + */ + public updateInstance(request: google.spanner.admin.instance.v1.IUpdateInstanceRequest): Promise; + + /** + * Calls DeleteInstance. + * @param request DeleteInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteInstance(request: google.spanner.admin.instance.v1.IDeleteInstanceRequest, callback: google.spanner.admin.instance.v1.InstanceAdmin.DeleteInstanceCallback): void; + + /** + * Calls DeleteInstance. + * @param request DeleteInstanceRequest message or plain object + * @returns Promise + */ + public deleteInstance(request: google.spanner.admin.instance.v1.IDeleteInstanceRequest): Promise; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest, callback: google.spanner.admin.instance.v1.InstanceAdmin.SetIamPolicyCallback): void; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @returns Promise + */ + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest): Promise; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest, callback: google.spanner.admin.instance.v1.InstanceAdmin.GetIamPolicyCallback): void; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @returns Promise + */ + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest): Promise; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + */ + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest, callback: google.spanner.admin.instance.v1.InstanceAdmin.TestIamPermissionsCallback): void; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @returns Promise + */ + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest): Promise; + + /** + * Calls GetInstancePartition. + * @param request GetInstancePartitionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and InstancePartition + */ + public getInstancePartition(request: google.spanner.admin.instance.v1.IGetInstancePartitionRequest, callback: google.spanner.admin.instance.v1.InstanceAdmin.GetInstancePartitionCallback): void; + + /** + * Calls GetInstancePartition. + * @param request GetInstancePartitionRequest message or plain object + * @returns Promise + */ + public getInstancePartition(request: google.spanner.admin.instance.v1.IGetInstancePartitionRequest): Promise; + + /** + * Calls CreateInstancePartition. + * @param request CreateInstancePartitionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createInstancePartition(request: google.spanner.admin.instance.v1.ICreateInstancePartitionRequest, callback: google.spanner.admin.instance.v1.InstanceAdmin.CreateInstancePartitionCallback): void; + + /** + * Calls CreateInstancePartition. + * @param request CreateInstancePartitionRequest message or plain object + * @returns Promise + */ + public createInstancePartition(request: google.spanner.admin.instance.v1.ICreateInstancePartitionRequest): Promise; + + /** + * Calls DeleteInstancePartition. + * @param request DeleteInstancePartitionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteInstancePartition(request: google.spanner.admin.instance.v1.IDeleteInstancePartitionRequest, callback: google.spanner.admin.instance.v1.InstanceAdmin.DeleteInstancePartitionCallback): void; + + /** + * Calls DeleteInstancePartition. + * @param request DeleteInstancePartitionRequest message or plain object + * @returns Promise + */ + public deleteInstancePartition(request: google.spanner.admin.instance.v1.IDeleteInstancePartitionRequest): Promise; + + /** + * Calls UpdateInstancePartition. + * @param request UpdateInstancePartitionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateInstancePartition(request: google.spanner.admin.instance.v1.IUpdateInstancePartitionRequest, callback: google.spanner.admin.instance.v1.InstanceAdmin.UpdateInstancePartitionCallback): void; + + /** + * Calls UpdateInstancePartition. + * @param request UpdateInstancePartitionRequest message or plain object + * @returns Promise + */ + public updateInstancePartition(request: google.spanner.admin.instance.v1.IUpdateInstancePartitionRequest): Promise; + + /** + * Calls ListInstancePartitionOperations. + * @param request ListInstancePartitionOperationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListInstancePartitionOperationsResponse + */ + public listInstancePartitionOperations(request: google.spanner.admin.instance.v1.IListInstancePartitionOperationsRequest, callback: google.spanner.admin.instance.v1.InstanceAdmin.ListInstancePartitionOperationsCallback): void; + + /** + * Calls ListInstancePartitionOperations. + * @param request ListInstancePartitionOperationsRequest message or plain object + * @returns Promise + */ + public listInstancePartitionOperations(request: google.spanner.admin.instance.v1.IListInstancePartitionOperationsRequest): Promise; + + /** + * Calls MoveInstance. + * @param request MoveInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public moveInstance(request: google.spanner.admin.instance.v1.IMoveInstanceRequest, callback: google.spanner.admin.instance.v1.InstanceAdmin.MoveInstanceCallback): void; + + /** + * Calls MoveInstance. + * @param request MoveInstanceRequest message or plain object + * @returns Promise + */ + public moveInstance(request: google.spanner.admin.instance.v1.IMoveInstanceRequest): Promise; + } + + namespace InstanceAdmin { + + /** + * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|listInstanceConfigs}. + * @param error Error, if any + * @param [response] ListInstanceConfigsResponse + */ + type ListInstanceConfigsCallback = (error: (Error|null), response?: google.spanner.admin.instance.v1.ListInstanceConfigsResponse) => void; + + /** + * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|getInstanceConfig}. + * @param error Error, if any + * @param [response] InstanceConfig + */ + type GetInstanceConfigCallback = (error: (Error|null), response?: google.spanner.admin.instance.v1.InstanceConfig) => void; + + /** + * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|createInstanceConfig}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateInstanceConfigCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|updateInstanceConfig}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateInstanceConfigCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|deleteInstanceConfig}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteInstanceConfigCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|listInstanceConfigOperations}. + * @param error Error, if any + * @param [response] ListInstanceConfigOperationsResponse + */ + type ListInstanceConfigOperationsCallback = (error: (Error|null), response?: google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse) => void; + + /** + * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|listInstances}. + * @param error Error, if any + * @param [response] ListInstancesResponse + */ + type ListInstancesCallback = (error: (Error|null), response?: google.spanner.admin.instance.v1.ListInstancesResponse) => void; + + /** + * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|listInstancePartitions}. + * @param error Error, if any + * @param [response] ListInstancePartitionsResponse + */ + type ListInstancePartitionsCallback = (error: (Error|null), response?: google.spanner.admin.instance.v1.ListInstancePartitionsResponse) => void; + + /** + * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|getInstance}. + * @param error Error, if any + * @param [response] Instance + */ + type GetInstanceCallback = (error: (Error|null), response?: google.spanner.admin.instance.v1.Instance) => void; + + /** + * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|createInstance}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|updateInstance}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|deleteInstance}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteInstanceCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|setIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type SetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + + /** + * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|getIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type GetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + + /** + * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|testIamPermissions}. + * @param error Error, if any + * @param [response] TestIamPermissionsResponse + */ + type TestIamPermissionsCallback = (error: (Error|null), response?: google.iam.v1.TestIamPermissionsResponse) => void; + + /** + * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|getInstancePartition}. + * @param error Error, if any + * @param [response] InstancePartition + */ + type GetInstancePartitionCallback = (error: (Error|null), response?: google.spanner.admin.instance.v1.InstancePartition) => void; + + /** + * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|createInstancePartition}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateInstancePartitionCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|deleteInstancePartition}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteInstancePartitionCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|updateInstancePartition}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateInstancePartitionCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|listInstancePartitionOperations}. + * @param error Error, if any + * @param [response] ListInstancePartitionOperationsResponse + */ + type ListInstancePartitionOperationsCallback = (error: (Error|null), response?: google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse) => void; + + /** + * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|moveInstance}. + * @param error Error, if any + * @param [response] Operation + */ + type MoveInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of a ReplicaInfo. */ + interface IReplicaInfo { + + /** ReplicaInfo location */ + location?: (string|null); + + /** ReplicaInfo type */ + type?: (google.spanner.admin.instance.v1.ReplicaInfo.ReplicaType|keyof typeof google.spanner.admin.instance.v1.ReplicaInfo.ReplicaType|null); + + /** ReplicaInfo defaultLeaderLocation */ + defaultLeaderLocation?: (boolean|null); + } + + /** Represents a ReplicaInfo. */ + class ReplicaInfo implements IReplicaInfo { + + /** + * Constructs a new ReplicaInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.instance.v1.IReplicaInfo); + + /** ReplicaInfo location. */ + public location: string; + + /** ReplicaInfo type. */ + public type: (google.spanner.admin.instance.v1.ReplicaInfo.ReplicaType|keyof typeof google.spanner.admin.instance.v1.ReplicaInfo.ReplicaType); + + /** ReplicaInfo defaultLeaderLocation. */ + public defaultLeaderLocation: boolean; + + /** + * Creates a new ReplicaInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns ReplicaInfo instance + */ + public static create(properties?: google.spanner.admin.instance.v1.IReplicaInfo): google.spanner.admin.instance.v1.ReplicaInfo; + + /** + * Encodes the specified ReplicaInfo message. Does not implicitly {@link google.spanner.admin.instance.v1.ReplicaInfo.verify|verify} messages. + * @param message ReplicaInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.instance.v1.IReplicaInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReplicaInfo message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ReplicaInfo.verify|verify} messages. + * @param message ReplicaInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.instance.v1.IReplicaInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReplicaInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReplicaInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.ReplicaInfo; + + /** + * Decodes a ReplicaInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReplicaInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.ReplicaInfo; + + /** + * Verifies a ReplicaInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReplicaInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReplicaInfo + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.ReplicaInfo; + + /** + * Creates a plain object from a ReplicaInfo message. Also converts values to other types if specified. + * @param message ReplicaInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.instance.v1.ReplicaInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReplicaInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReplicaInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ReplicaInfo { + + /** ReplicaType enum. */ + enum ReplicaType { + TYPE_UNSPECIFIED = 0, + READ_WRITE = 1, + READ_ONLY = 2, + WITNESS = 3 + } + } + + /** Properties of an InstanceConfig. */ + interface IInstanceConfig { + + /** InstanceConfig name */ + name?: (string|null); + + /** InstanceConfig displayName */ + displayName?: (string|null); + + /** InstanceConfig configType */ + configType?: (google.spanner.admin.instance.v1.InstanceConfig.Type|keyof typeof google.spanner.admin.instance.v1.InstanceConfig.Type|null); + + /** InstanceConfig replicas */ + replicas?: (google.spanner.admin.instance.v1.IReplicaInfo[]|null); + + /** InstanceConfig optionalReplicas */ + optionalReplicas?: (google.spanner.admin.instance.v1.IReplicaInfo[]|null); + + /** InstanceConfig baseConfig */ + baseConfig?: (string|null); + + /** InstanceConfig labels */ + labels?: ({ [k: string]: string }|null); + + /** InstanceConfig etag */ + etag?: (string|null); + + /** InstanceConfig leaderOptions */ + leaderOptions?: (string[]|null); + + /** InstanceConfig reconciling */ + reconciling?: (boolean|null); + + /** InstanceConfig state */ + state?: (google.spanner.admin.instance.v1.InstanceConfig.State|keyof typeof google.spanner.admin.instance.v1.InstanceConfig.State|null); + + /** InstanceConfig freeInstanceAvailability */ + freeInstanceAvailability?: (google.spanner.admin.instance.v1.InstanceConfig.FreeInstanceAvailability|keyof typeof google.spanner.admin.instance.v1.InstanceConfig.FreeInstanceAvailability|null); + + /** InstanceConfig quorumType */ + quorumType?: (google.spanner.admin.instance.v1.InstanceConfig.QuorumType|keyof typeof google.spanner.admin.instance.v1.InstanceConfig.QuorumType|null); + + /** InstanceConfig storageLimitPerProcessingUnit */ + storageLimitPerProcessingUnit?: (number|Long|string|null); + } + + /** Represents an InstanceConfig. */ + class InstanceConfig implements IInstanceConfig { + + /** + * Constructs a new InstanceConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.instance.v1.IInstanceConfig); + + /** InstanceConfig name. */ + public name: string; + + /** InstanceConfig displayName. */ + public displayName: string; + + /** InstanceConfig configType. */ + public configType: (google.spanner.admin.instance.v1.InstanceConfig.Type|keyof typeof google.spanner.admin.instance.v1.InstanceConfig.Type); + + /** InstanceConfig replicas. */ + public replicas: google.spanner.admin.instance.v1.IReplicaInfo[]; + + /** InstanceConfig optionalReplicas. */ + public optionalReplicas: google.spanner.admin.instance.v1.IReplicaInfo[]; + + /** InstanceConfig baseConfig. */ + public baseConfig: string; + + /** InstanceConfig labels. */ + public labels: { [k: string]: string }; + + /** InstanceConfig etag. */ + public etag: string; + + /** InstanceConfig leaderOptions. */ + public leaderOptions: string[]; + + /** InstanceConfig reconciling. */ + public reconciling: boolean; + + /** InstanceConfig state. */ + public state: (google.spanner.admin.instance.v1.InstanceConfig.State|keyof typeof google.spanner.admin.instance.v1.InstanceConfig.State); + + /** InstanceConfig freeInstanceAvailability. */ + public freeInstanceAvailability: (google.spanner.admin.instance.v1.InstanceConfig.FreeInstanceAvailability|keyof typeof google.spanner.admin.instance.v1.InstanceConfig.FreeInstanceAvailability); + + /** InstanceConfig quorumType. */ + public quorumType: (google.spanner.admin.instance.v1.InstanceConfig.QuorumType|keyof typeof google.spanner.admin.instance.v1.InstanceConfig.QuorumType); + + /** InstanceConfig storageLimitPerProcessingUnit. */ + public storageLimitPerProcessingUnit: (number|Long|string); + + /** + * Creates a new InstanceConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns InstanceConfig instance + */ + public static create(properties?: google.spanner.admin.instance.v1.IInstanceConfig): google.spanner.admin.instance.v1.InstanceConfig; + + /** + * Encodes the specified InstanceConfig message. Does not implicitly {@link google.spanner.admin.instance.v1.InstanceConfig.verify|verify} messages. + * @param message InstanceConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.instance.v1.IInstanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstanceConfig message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.InstanceConfig.verify|verify} messages. + * @param message InstanceConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.instance.v1.IInstanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstanceConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.InstanceConfig; + + /** + * Decodes an InstanceConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.InstanceConfig; + + /** + * Verifies an InstanceConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstanceConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstanceConfig + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.InstanceConfig; + + /** + * Creates a plain object from an InstanceConfig message. Also converts values to other types if specified. + * @param message InstanceConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.instance.v1.InstanceConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstanceConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InstanceConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace InstanceConfig { + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + GOOGLE_MANAGED = 1, + USER_MANAGED = 2 + } + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + CREATING = 1, + READY = 2 + } + + /** FreeInstanceAvailability enum. */ + enum FreeInstanceAvailability { + FREE_INSTANCE_AVAILABILITY_UNSPECIFIED = 0, + AVAILABLE = 1, + UNSUPPORTED = 2, + DISABLED = 3, + QUOTA_EXCEEDED = 4 + } + + /** QuorumType enum. */ + enum QuorumType { + QUORUM_TYPE_UNSPECIFIED = 0, + REGION = 1, + DUAL_REGION = 2, + MULTI_REGION = 3 + } + } + + /** Properties of a ReplicaComputeCapacity. */ + interface IReplicaComputeCapacity { + + /** ReplicaComputeCapacity replicaSelection */ + replicaSelection?: (google.spanner.admin.instance.v1.IReplicaSelection|null); + + /** ReplicaComputeCapacity nodeCount */ + nodeCount?: (number|null); + + /** ReplicaComputeCapacity processingUnits */ + processingUnits?: (number|null); + } + + /** Represents a ReplicaComputeCapacity. */ + class ReplicaComputeCapacity implements IReplicaComputeCapacity { + + /** + * Constructs a new ReplicaComputeCapacity. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.instance.v1.IReplicaComputeCapacity); + + /** ReplicaComputeCapacity replicaSelection. */ + public replicaSelection?: (google.spanner.admin.instance.v1.IReplicaSelection|null); + + /** ReplicaComputeCapacity nodeCount. */ + public nodeCount?: (number|null); + + /** ReplicaComputeCapacity processingUnits. */ + public processingUnits?: (number|null); + + /** ReplicaComputeCapacity computeCapacity. */ + public computeCapacity?: ("nodeCount"|"processingUnits"); + + /** + * Creates a new ReplicaComputeCapacity instance using the specified properties. + * @param [properties] Properties to set + * @returns ReplicaComputeCapacity instance + */ + public static create(properties?: google.spanner.admin.instance.v1.IReplicaComputeCapacity): google.spanner.admin.instance.v1.ReplicaComputeCapacity; + + /** + * Encodes the specified ReplicaComputeCapacity message. Does not implicitly {@link google.spanner.admin.instance.v1.ReplicaComputeCapacity.verify|verify} messages. + * @param message ReplicaComputeCapacity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.instance.v1.IReplicaComputeCapacity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReplicaComputeCapacity message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ReplicaComputeCapacity.verify|verify} messages. + * @param message ReplicaComputeCapacity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.instance.v1.IReplicaComputeCapacity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReplicaComputeCapacity message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReplicaComputeCapacity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.ReplicaComputeCapacity; + + /** + * Decodes a ReplicaComputeCapacity message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReplicaComputeCapacity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.ReplicaComputeCapacity; + + /** + * Verifies a ReplicaComputeCapacity message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReplicaComputeCapacity message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReplicaComputeCapacity + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.ReplicaComputeCapacity; + + /** + * Creates a plain object from a ReplicaComputeCapacity message. Also converts values to other types if specified. + * @param message ReplicaComputeCapacity + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.instance.v1.ReplicaComputeCapacity, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReplicaComputeCapacity to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReplicaComputeCapacity + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AutoscalingConfig. */ + interface IAutoscalingConfig { + + /** AutoscalingConfig autoscalingLimits */ + autoscalingLimits?: (google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingLimits|null); + + /** AutoscalingConfig autoscalingTargets */ + autoscalingTargets?: (google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingTargets|null); + + /** AutoscalingConfig asymmetricAutoscalingOptions */ + asymmetricAutoscalingOptions?: (google.spanner.admin.instance.v1.AutoscalingConfig.IAsymmetricAutoscalingOption[]|null); + } + + /** Represents an AutoscalingConfig. */ + class AutoscalingConfig implements IAutoscalingConfig { + + /** + * Constructs a new AutoscalingConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.instance.v1.IAutoscalingConfig); + + /** AutoscalingConfig autoscalingLimits. */ + public autoscalingLimits?: (google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingLimits|null); + + /** AutoscalingConfig autoscalingTargets. */ + public autoscalingTargets?: (google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingTargets|null); + + /** AutoscalingConfig asymmetricAutoscalingOptions. */ + public asymmetricAutoscalingOptions: google.spanner.admin.instance.v1.AutoscalingConfig.IAsymmetricAutoscalingOption[]; + + /** + * Creates a new AutoscalingConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AutoscalingConfig instance + */ + public static create(properties?: google.spanner.admin.instance.v1.IAutoscalingConfig): google.spanner.admin.instance.v1.AutoscalingConfig; + + /** + * Encodes the specified AutoscalingConfig message. Does not implicitly {@link google.spanner.admin.instance.v1.AutoscalingConfig.verify|verify} messages. + * @param message AutoscalingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.instance.v1.IAutoscalingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AutoscalingConfig message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.AutoscalingConfig.verify|verify} messages. + * @param message AutoscalingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.instance.v1.IAutoscalingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AutoscalingConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AutoscalingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.AutoscalingConfig; + + /** + * Decodes an AutoscalingConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AutoscalingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.AutoscalingConfig; + + /** + * Verifies an AutoscalingConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AutoscalingConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AutoscalingConfig + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.AutoscalingConfig; + + /** + * Creates a plain object from an AutoscalingConfig message. Also converts values to other types if specified. + * @param message AutoscalingConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.instance.v1.AutoscalingConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AutoscalingConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AutoscalingConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AutoscalingConfig { + + /** Properties of an AutoscalingLimits. */ + interface IAutoscalingLimits { + + /** AutoscalingLimits minNodes */ + minNodes?: (number|null); + + /** AutoscalingLimits minProcessingUnits */ + minProcessingUnits?: (number|null); + + /** AutoscalingLimits maxNodes */ + maxNodes?: (number|null); + + /** AutoscalingLimits maxProcessingUnits */ + maxProcessingUnits?: (number|null); + } + + /** Represents an AutoscalingLimits. */ + class AutoscalingLimits implements IAutoscalingLimits { + + /** + * Constructs a new AutoscalingLimits. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingLimits); + + /** AutoscalingLimits minNodes. */ + public minNodes?: (number|null); + + /** AutoscalingLimits minProcessingUnits. */ + public minProcessingUnits?: (number|null); + + /** AutoscalingLimits maxNodes. */ + public maxNodes?: (number|null); + + /** AutoscalingLimits maxProcessingUnits. */ + public maxProcessingUnits?: (number|null); + + /** AutoscalingLimits minLimit. */ + public minLimit?: ("minNodes"|"minProcessingUnits"); + + /** AutoscalingLimits maxLimit. */ + public maxLimit?: ("maxNodes"|"maxProcessingUnits"); + + /** + * Creates a new AutoscalingLimits instance using the specified properties. + * @param [properties] Properties to set + * @returns AutoscalingLimits instance + */ + public static create(properties?: google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingLimits): google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits; + + /** + * Encodes the specified AutoscalingLimits message. Does not implicitly {@link google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits.verify|verify} messages. + * @param message AutoscalingLimits message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingLimits, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AutoscalingLimits message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits.verify|verify} messages. + * @param message AutoscalingLimits message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingLimits, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AutoscalingLimits message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AutoscalingLimits + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits; + + /** + * Decodes an AutoscalingLimits message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AutoscalingLimits + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits; + + /** + * Verifies an AutoscalingLimits message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AutoscalingLimits message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AutoscalingLimits + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits; + + /** + * Creates a plain object from an AutoscalingLimits message. Also converts values to other types if specified. + * @param message AutoscalingLimits + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AutoscalingLimits to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AutoscalingLimits + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AutoscalingTargets. */ + interface IAutoscalingTargets { + + /** AutoscalingTargets highPriorityCpuUtilizationPercent */ + highPriorityCpuUtilizationPercent?: (number|null); + + /** AutoscalingTargets totalCpuUtilizationPercent */ + totalCpuUtilizationPercent?: (number|null); + + /** AutoscalingTargets storageUtilizationPercent */ + storageUtilizationPercent?: (number|null); + } + + /** Represents an AutoscalingTargets. */ + class AutoscalingTargets implements IAutoscalingTargets { + + /** + * Constructs a new AutoscalingTargets. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingTargets); + + /** AutoscalingTargets highPriorityCpuUtilizationPercent. */ + public highPriorityCpuUtilizationPercent: number; + + /** AutoscalingTargets totalCpuUtilizationPercent. */ + public totalCpuUtilizationPercent: number; + + /** AutoscalingTargets storageUtilizationPercent. */ + public storageUtilizationPercent: number; + + /** + * Creates a new AutoscalingTargets instance using the specified properties. + * @param [properties] Properties to set + * @returns AutoscalingTargets instance + */ + public static create(properties?: google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingTargets): google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets; + + /** + * Encodes the specified AutoscalingTargets message. Does not implicitly {@link google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets.verify|verify} messages. + * @param message AutoscalingTargets message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingTargets, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AutoscalingTargets message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets.verify|verify} messages. + * @param message AutoscalingTargets message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingTargets, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AutoscalingTargets message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AutoscalingTargets + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets; + + /** + * Decodes an AutoscalingTargets message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AutoscalingTargets + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets; + + /** + * Verifies an AutoscalingTargets message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AutoscalingTargets message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AutoscalingTargets + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets; + + /** + * Creates a plain object from an AutoscalingTargets message. Also converts values to other types if specified. + * @param message AutoscalingTargets + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AutoscalingTargets to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AutoscalingTargets + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AsymmetricAutoscalingOption. */ + interface IAsymmetricAutoscalingOption { + + /** AsymmetricAutoscalingOption replicaSelection */ + replicaSelection?: (google.spanner.admin.instance.v1.IReplicaSelection|null); + + /** AsymmetricAutoscalingOption overrides */ + overrides?: (google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.IAutoscalingConfigOverrides|null); + } + + /** Represents an AsymmetricAutoscalingOption. */ + class AsymmetricAutoscalingOption implements IAsymmetricAutoscalingOption { + + /** + * Constructs a new AsymmetricAutoscalingOption. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.instance.v1.AutoscalingConfig.IAsymmetricAutoscalingOption); + + /** AsymmetricAutoscalingOption replicaSelection. */ + public replicaSelection?: (google.spanner.admin.instance.v1.IReplicaSelection|null); + + /** AsymmetricAutoscalingOption overrides. */ + public overrides?: (google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.IAutoscalingConfigOverrides|null); + + /** + * Creates a new AsymmetricAutoscalingOption instance using the specified properties. + * @param [properties] Properties to set + * @returns AsymmetricAutoscalingOption instance + */ + public static create(properties?: google.spanner.admin.instance.v1.AutoscalingConfig.IAsymmetricAutoscalingOption): google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption; + + /** + * Encodes the specified AsymmetricAutoscalingOption message. Does not implicitly {@link google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.verify|verify} messages. + * @param message AsymmetricAutoscalingOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.instance.v1.AutoscalingConfig.IAsymmetricAutoscalingOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AsymmetricAutoscalingOption message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.verify|verify} messages. + * @param message AsymmetricAutoscalingOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.instance.v1.AutoscalingConfig.IAsymmetricAutoscalingOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AsymmetricAutoscalingOption message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AsymmetricAutoscalingOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption; + + /** + * Decodes an AsymmetricAutoscalingOption message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AsymmetricAutoscalingOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption; + + /** + * Verifies an AsymmetricAutoscalingOption message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AsymmetricAutoscalingOption message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AsymmetricAutoscalingOption + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption; + + /** + * Creates a plain object from an AsymmetricAutoscalingOption message. Also converts values to other types if specified. + * @param message AsymmetricAutoscalingOption + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AsymmetricAutoscalingOption to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AsymmetricAutoscalingOption + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AsymmetricAutoscalingOption { + + /** Properties of an AutoscalingConfigOverrides. */ + interface IAutoscalingConfigOverrides { + + /** AutoscalingConfigOverrides autoscalingLimits */ + autoscalingLimits?: (google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingLimits|null); + + /** AutoscalingConfigOverrides autoscalingTargetHighPriorityCpuUtilizationPercent */ + autoscalingTargetHighPriorityCpuUtilizationPercent?: (number|null); + + /** AutoscalingConfigOverrides autoscalingTargetTotalCpuUtilizationPercent */ + autoscalingTargetTotalCpuUtilizationPercent?: (number|null); + + /** AutoscalingConfigOverrides disableHighPriorityCpuAutoscaling */ + disableHighPriorityCpuAutoscaling?: (boolean|null); + + /** AutoscalingConfigOverrides disableTotalCpuAutoscaling */ + disableTotalCpuAutoscaling?: (boolean|null); + } + + /** Represents an AutoscalingConfigOverrides. */ + class AutoscalingConfigOverrides implements IAutoscalingConfigOverrides { + + /** + * Constructs a new AutoscalingConfigOverrides. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.IAutoscalingConfigOverrides); + + /** AutoscalingConfigOverrides autoscalingLimits. */ + public autoscalingLimits?: (google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingLimits|null); + + /** AutoscalingConfigOverrides autoscalingTargetHighPriorityCpuUtilizationPercent. */ + public autoscalingTargetHighPriorityCpuUtilizationPercent: number; + + /** AutoscalingConfigOverrides autoscalingTargetTotalCpuUtilizationPercent. */ + public autoscalingTargetTotalCpuUtilizationPercent: number; + + /** AutoscalingConfigOverrides disableHighPriorityCpuAutoscaling. */ + public disableHighPriorityCpuAutoscaling: boolean; + + /** AutoscalingConfigOverrides disableTotalCpuAutoscaling. */ + public disableTotalCpuAutoscaling: boolean; + + /** + * Creates a new AutoscalingConfigOverrides instance using the specified properties. + * @param [properties] Properties to set + * @returns AutoscalingConfigOverrides instance + */ + public static create(properties?: google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.IAutoscalingConfigOverrides): google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides; + + /** + * Encodes the specified AutoscalingConfigOverrides message. Does not implicitly {@link google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides.verify|verify} messages. + * @param message AutoscalingConfigOverrides message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.IAutoscalingConfigOverrides, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AutoscalingConfigOverrides message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides.verify|verify} messages. + * @param message AutoscalingConfigOverrides message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.IAutoscalingConfigOverrides, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AutoscalingConfigOverrides message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AutoscalingConfigOverrides + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides; + + /** + * Decodes an AutoscalingConfigOverrides message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AutoscalingConfigOverrides + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides; + + /** + * Verifies an AutoscalingConfigOverrides message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AutoscalingConfigOverrides message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AutoscalingConfigOverrides + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides; + + /** + * Creates a plain object from an AutoscalingConfigOverrides message. Also converts values to other types if specified. + * @param message AutoscalingConfigOverrides + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AutoscalingConfigOverrides to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AutoscalingConfigOverrides + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Properties of an Instance. */ + interface IInstance { + + /** Instance name */ + name?: (string|null); + + /** Instance config */ + config?: (string|null); + + /** Instance displayName */ + displayName?: (string|null); + + /** Instance nodeCount */ + nodeCount?: (number|null); + + /** Instance processingUnits */ + processingUnits?: (number|null); + + /** Instance replicaComputeCapacity */ + replicaComputeCapacity?: (google.spanner.admin.instance.v1.IReplicaComputeCapacity[]|null); + + /** Instance autoscalingConfig */ + autoscalingConfig?: (google.spanner.admin.instance.v1.IAutoscalingConfig|null); + + /** Instance state */ + state?: (google.spanner.admin.instance.v1.Instance.State|keyof typeof google.spanner.admin.instance.v1.Instance.State|null); + + /** Instance labels */ + labels?: ({ [k: string]: string }|null); + + /** Instance instanceType */ + instanceType?: (google.spanner.admin.instance.v1.Instance.InstanceType|keyof typeof google.spanner.admin.instance.v1.Instance.InstanceType|null); + + /** Instance endpointUris */ + endpointUris?: (string[]|null); + + /** Instance createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Instance updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Instance freeInstanceMetadata */ + freeInstanceMetadata?: (google.spanner.admin.instance.v1.IFreeInstanceMetadata|null); + + /** Instance edition */ + edition?: (google.spanner.admin.instance.v1.Instance.Edition|keyof typeof google.spanner.admin.instance.v1.Instance.Edition|null); + + /** Instance defaultBackupScheduleType */ + defaultBackupScheduleType?: (google.spanner.admin.instance.v1.Instance.DefaultBackupScheduleType|keyof typeof google.spanner.admin.instance.v1.Instance.DefaultBackupScheduleType|null); + } + + /** Represents an Instance. */ + class Instance implements IInstance { + + /** + * Constructs a new Instance. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.instance.v1.IInstance); + + /** Instance name. */ + public name: string; + + /** Instance config. */ + public config: string; + + /** Instance displayName. */ + public displayName: string; + + /** Instance nodeCount. */ + public nodeCount: number; + + /** Instance processingUnits. */ + public processingUnits: number; + + /** Instance replicaComputeCapacity. */ + public replicaComputeCapacity: google.spanner.admin.instance.v1.IReplicaComputeCapacity[]; + + /** Instance autoscalingConfig. */ + public autoscalingConfig?: (google.spanner.admin.instance.v1.IAutoscalingConfig|null); + + /** Instance state. */ + public state: (google.spanner.admin.instance.v1.Instance.State|keyof typeof google.spanner.admin.instance.v1.Instance.State); + + /** Instance labels. */ + public labels: { [k: string]: string }; + + /** Instance instanceType. */ + public instanceType: (google.spanner.admin.instance.v1.Instance.InstanceType|keyof typeof google.spanner.admin.instance.v1.Instance.InstanceType); + + /** Instance endpointUris. */ + public endpointUris: string[]; + + /** Instance createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Instance updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Instance freeInstanceMetadata. */ + public freeInstanceMetadata?: (google.spanner.admin.instance.v1.IFreeInstanceMetadata|null); + + /** Instance edition. */ + public edition: (google.spanner.admin.instance.v1.Instance.Edition|keyof typeof google.spanner.admin.instance.v1.Instance.Edition); + + /** Instance defaultBackupScheduleType. */ + public defaultBackupScheduleType: (google.spanner.admin.instance.v1.Instance.DefaultBackupScheduleType|keyof typeof google.spanner.admin.instance.v1.Instance.DefaultBackupScheduleType); + + /** + * Creates a new Instance instance using the specified properties. + * @param [properties] Properties to set + * @returns Instance instance + */ + public static create(properties?: google.spanner.admin.instance.v1.IInstance): google.spanner.admin.instance.v1.Instance; + + /** + * Encodes the specified Instance message. Does not implicitly {@link google.spanner.admin.instance.v1.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.spanner.admin.instance.v1.IInstance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Instance message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.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.spanner.admin.instance.v1.IInstance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Instance message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Instance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.Instance; + + /** + * Decodes an Instance message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Instance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.Instance; + + /** + * Verifies an Instance message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Instance message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Instance + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.Instance; + + /** + * Creates a plain object from an Instance message. Also converts values to other types if specified. + * @param message Instance + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.instance.v1.Instance, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Instance to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Instance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Instance { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + CREATING = 1, + READY = 2 + } + + /** InstanceType enum. */ + enum InstanceType { + INSTANCE_TYPE_UNSPECIFIED = 0, + PROVISIONED = 1, + FREE_INSTANCE = 2 + } + + /** Edition enum. */ + enum Edition { + EDITION_UNSPECIFIED = 0, + STANDARD = 1, + ENTERPRISE = 2, + ENTERPRISE_PLUS = 3 + } + + /** DefaultBackupScheduleType enum. */ + enum DefaultBackupScheduleType { + DEFAULT_BACKUP_SCHEDULE_TYPE_UNSPECIFIED = 0, + NONE = 1, + AUTOMATIC = 2 + } + } + + /** Properties of a ListInstanceConfigsRequest. */ + interface IListInstanceConfigsRequest { + + /** ListInstanceConfigsRequest parent */ + parent?: (string|null); + + /** ListInstanceConfigsRequest pageSize */ + pageSize?: (number|null); + + /** ListInstanceConfigsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListInstanceConfigsRequest. */ + class ListInstanceConfigsRequest implements IListInstanceConfigsRequest { + + /** + * Constructs a new ListInstanceConfigsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.instance.v1.IListInstanceConfigsRequest); + + /** ListInstanceConfigsRequest parent. */ + public parent: string; + + /** ListInstanceConfigsRequest pageSize. */ + public pageSize: number; + + /** ListInstanceConfigsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListInstanceConfigsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInstanceConfigsRequest instance + */ + public static create(properties?: google.spanner.admin.instance.v1.IListInstanceConfigsRequest): google.spanner.admin.instance.v1.ListInstanceConfigsRequest; + + /** + * Encodes the specified ListInstanceConfigsRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstanceConfigsRequest.verify|verify} messages. + * @param message ListInstanceConfigsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.instance.v1.IListInstanceConfigsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInstanceConfigsRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstanceConfigsRequest.verify|verify} messages. + * @param message ListInstanceConfigsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.instance.v1.IListInstanceConfigsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListInstanceConfigsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListInstanceConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.ListInstanceConfigsRequest; + + /** + * Decodes a ListInstanceConfigsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListInstanceConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.ListInstanceConfigsRequest; + + /** + * Verifies a ListInstanceConfigsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListInstanceConfigsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListInstanceConfigsRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.ListInstanceConfigsRequest; + + /** + * Creates a plain object from a ListInstanceConfigsRequest message. Also converts values to other types if specified. + * @param message ListInstanceConfigsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.instance.v1.ListInstanceConfigsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListInstanceConfigsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListInstanceConfigsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListInstanceConfigsResponse. */ + interface IListInstanceConfigsResponse { + + /** ListInstanceConfigsResponse instanceConfigs */ + instanceConfigs?: (google.spanner.admin.instance.v1.IInstanceConfig[]|null); + + /** ListInstanceConfigsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListInstanceConfigsResponse. */ + class ListInstanceConfigsResponse implements IListInstanceConfigsResponse { + + /** + * Constructs a new ListInstanceConfigsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.instance.v1.IListInstanceConfigsResponse); + + /** ListInstanceConfigsResponse instanceConfigs. */ + public instanceConfigs: google.spanner.admin.instance.v1.IInstanceConfig[]; + + /** ListInstanceConfigsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListInstanceConfigsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInstanceConfigsResponse instance + */ + public static create(properties?: google.spanner.admin.instance.v1.IListInstanceConfigsResponse): google.spanner.admin.instance.v1.ListInstanceConfigsResponse; + + /** + * Encodes the specified ListInstanceConfigsResponse message. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstanceConfigsResponse.verify|verify} messages. + * @param message ListInstanceConfigsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.instance.v1.IListInstanceConfigsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInstanceConfigsResponse message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstanceConfigsResponse.verify|verify} messages. + * @param message ListInstanceConfigsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.instance.v1.IListInstanceConfigsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListInstanceConfigsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListInstanceConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.ListInstanceConfigsResponse; + + /** + * Decodes a ListInstanceConfigsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListInstanceConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.ListInstanceConfigsResponse; + + /** + * Verifies a ListInstanceConfigsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListInstanceConfigsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListInstanceConfigsResponse + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.ListInstanceConfigsResponse; + + /** + * Creates a plain object from a ListInstanceConfigsResponse message. Also converts values to other types if specified. + * @param message ListInstanceConfigsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.instance.v1.ListInstanceConfigsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListInstanceConfigsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListInstanceConfigsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetInstanceConfigRequest. */ + interface IGetInstanceConfigRequest { + + /** GetInstanceConfigRequest name */ + name?: (string|null); + } + + /** Represents a GetInstanceConfigRequest. */ + class GetInstanceConfigRequest implements IGetInstanceConfigRequest { + + /** + * Constructs a new GetInstanceConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.instance.v1.IGetInstanceConfigRequest); + + /** GetInstanceConfigRequest name. */ + public name: string; + + /** + * Creates a new GetInstanceConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetInstanceConfigRequest instance + */ + public static create(properties?: google.spanner.admin.instance.v1.IGetInstanceConfigRequest): google.spanner.admin.instance.v1.GetInstanceConfigRequest; + + /** + * Encodes the specified GetInstanceConfigRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.GetInstanceConfigRequest.verify|verify} messages. + * @param message GetInstanceConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.instance.v1.IGetInstanceConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetInstanceConfigRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.GetInstanceConfigRequest.verify|verify} messages. + * @param message GetInstanceConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.instance.v1.IGetInstanceConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetInstanceConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetInstanceConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.GetInstanceConfigRequest; + + /** + * Decodes a GetInstanceConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetInstanceConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.GetInstanceConfigRequest; + + /** + * Verifies a GetInstanceConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetInstanceConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetInstanceConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.GetInstanceConfigRequest; + + /** + * Creates a plain object from a GetInstanceConfigRequest message. Also converts values to other types if specified. + * @param message GetInstanceConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.instance.v1.GetInstanceConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetInstanceConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetInstanceConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateInstanceConfigRequest. */ + interface ICreateInstanceConfigRequest { + + /** CreateInstanceConfigRequest parent */ + parent?: (string|null); + + /** CreateInstanceConfigRequest instanceConfigId */ + instanceConfigId?: (string|null); + + /** CreateInstanceConfigRequest instanceConfig */ + instanceConfig?: (google.spanner.admin.instance.v1.IInstanceConfig|null); + + /** CreateInstanceConfigRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents a CreateInstanceConfigRequest. */ + class CreateInstanceConfigRequest implements ICreateInstanceConfigRequest { + + /** + * Constructs a new CreateInstanceConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.instance.v1.ICreateInstanceConfigRequest); + + /** CreateInstanceConfigRequest parent. */ + public parent: string; + + /** CreateInstanceConfigRequest instanceConfigId. */ + public instanceConfigId: string; + + /** CreateInstanceConfigRequest instanceConfig. */ + public instanceConfig?: (google.spanner.admin.instance.v1.IInstanceConfig|null); + + /** CreateInstanceConfigRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new CreateInstanceConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateInstanceConfigRequest instance + */ + public static create(properties?: google.spanner.admin.instance.v1.ICreateInstanceConfigRequest): google.spanner.admin.instance.v1.CreateInstanceConfigRequest; + + /** + * Encodes the specified CreateInstanceConfigRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.CreateInstanceConfigRequest.verify|verify} messages. + * @param message CreateInstanceConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.instance.v1.ICreateInstanceConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateInstanceConfigRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.CreateInstanceConfigRequest.verify|verify} messages. + * @param message CreateInstanceConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.instance.v1.ICreateInstanceConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateInstanceConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateInstanceConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.CreateInstanceConfigRequest; + + /** + * Decodes a CreateInstanceConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateInstanceConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.CreateInstanceConfigRequest; + + /** + * Verifies a CreateInstanceConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateInstanceConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateInstanceConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.CreateInstanceConfigRequest; + + /** + * Creates a plain object from a CreateInstanceConfigRequest message. Also converts values to other types if specified. + * @param message CreateInstanceConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.instance.v1.CreateInstanceConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateInstanceConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateInstanceConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateInstanceConfigRequest. */ + interface IUpdateInstanceConfigRequest { + + /** UpdateInstanceConfigRequest instanceConfig */ + instanceConfig?: (google.spanner.admin.instance.v1.IInstanceConfig|null); + + /** UpdateInstanceConfigRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateInstanceConfigRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents an UpdateInstanceConfigRequest. */ + class UpdateInstanceConfigRequest implements IUpdateInstanceConfigRequest { + + /** + * Constructs a new UpdateInstanceConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.instance.v1.IUpdateInstanceConfigRequest); + + /** UpdateInstanceConfigRequest instanceConfig. */ + public instanceConfig?: (google.spanner.admin.instance.v1.IInstanceConfig|null); + + /** UpdateInstanceConfigRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateInstanceConfigRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new UpdateInstanceConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateInstanceConfigRequest instance + */ + public static create(properties?: google.spanner.admin.instance.v1.IUpdateInstanceConfigRequest): google.spanner.admin.instance.v1.UpdateInstanceConfigRequest; + + /** + * Encodes the specified UpdateInstanceConfigRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.UpdateInstanceConfigRequest.verify|verify} messages. + * @param message UpdateInstanceConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.instance.v1.IUpdateInstanceConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateInstanceConfigRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.UpdateInstanceConfigRequest.verify|verify} messages. + * @param message UpdateInstanceConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.instance.v1.IUpdateInstanceConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateInstanceConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateInstanceConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.UpdateInstanceConfigRequest; + + /** + * Decodes an UpdateInstanceConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateInstanceConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.UpdateInstanceConfigRequest; + + /** + * Verifies an UpdateInstanceConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateInstanceConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateInstanceConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.UpdateInstanceConfigRequest; + + /** + * Creates a plain object from an UpdateInstanceConfigRequest message. Also converts values to other types if specified. + * @param message UpdateInstanceConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.instance.v1.UpdateInstanceConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateInstanceConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateInstanceConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteInstanceConfigRequest. */ + interface IDeleteInstanceConfigRequest { + + /** DeleteInstanceConfigRequest name */ + name?: (string|null); + + /** DeleteInstanceConfigRequest etag */ + etag?: (string|null); + + /** DeleteInstanceConfigRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents a DeleteInstanceConfigRequest. */ + class DeleteInstanceConfigRequest implements IDeleteInstanceConfigRequest { + + /** + * Constructs a new DeleteInstanceConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.instance.v1.IDeleteInstanceConfigRequest); + + /** DeleteInstanceConfigRequest name. */ + public name: string; + + /** DeleteInstanceConfigRequest etag. */ + public etag: string; + + /** DeleteInstanceConfigRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new DeleteInstanceConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteInstanceConfigRequest instance + */ + public static create(properties?: google.spanner.admin.instance.v1.IDeleteInstanceConfigRequest): google.spanner.admin.instance.v1.DeleteInstanceConfigRequest; + + /** + * Encodes the specified DeleteInstanceConfigRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.DeleteInstanceConfigRequest.verify|verify} messages. + * @param message DeleteInstanceConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.instance.v1.IDeleteInstanceConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteInstanceConfigRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.DeleteInstanceConfigRequest.verify|verify} messages. + * @param message DeleteInstanceConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.instance.v1.IDeleteInstanceConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteInstanceConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteInstanceConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.DeleteInstanceConfigRequest; + + /** + * Decodes a DeleteInstanceConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteInstanceConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.DeleteInstanceConfigRequest; + + /** + * Verifies a DeleteInstanceConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteInstanceConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteInstanceConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.DeleteInstanceConfigRequest; + + /** + * Creates a plain object from a DeleteInstanceConfigRequest message. Also converts values to other types if specified. + * @param message DeleteInstanceConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.instance.v1.DeleteInstanceConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteInstanceConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteInstanceConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListInstanceConfigOperationsRequest. */ + interface IListInstanceConfigOperationsRequest { + + /** ListInstanceConfigOperationsRequest parent */ + parent?: (string|null); + + /** ListInstanceConfigOperationsRequest filter */ + filter?: (string|null); + + /** ListInstanceConfigOperationsRequest pageSize */ + pageSize?: (number|null); + + /** ListInstanceConfigOperationsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListInstanceConfigOperationsRequest. */ + class ListInstanceConfigOperationsRequest implements IListInstanceConfigOperationsRequest { + + /** + * Constructs a new ListInstanceConfigOperationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.instance.v1.IListInstanceConfigOperationsRequest); + + /** ListInstanceConfigOperationsRequest parent. */ + public parent: string; + + /** ListInstanceConfigOperationsRequest filter. */ + public filter: string; + + /** ListInstanceConfigOperationsRequest pageSize. */ + public pageSize: number; + + /** ListInstanceConfigOperationsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListInstanceConfigOperationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInstanceConfigOperationsRequest instance + */ + public static create(properties?: google.spanner.admin.instance.v1.IListInstanceConfigOperationsRequest): google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest; + + /** + * Encodes the specified ListInstanceConfigOperationsRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest.verify|verify} messages. + * @param message ListInstanceConfigOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.instance.v1.IListInstanceConfigOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInstanceConfigOperationsRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest.verify|verify} messages. + * @param message ListInstanceConfigOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.instance.v1.IListInstanceConfigOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListInstanceConfigOperationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListInstanceConfigOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest; + + /** + * Decodes a ListInstanceConfigOperationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListInstanceConfigOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest; + + /** + * Verifies a ListInstanceConfigOperationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListInstanceConfigOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListInstanceConfigOperationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest; + + /** + * Creates a plain object from a ListInstanceConfigOperationsRequest message. Also converts values to other types if specified. + * @param message ListInstanceConfigOperationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListInstanceConfigOperationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListInstanceConfigOperationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListInstanceConfigOperationsResponse. */ + interface IListInstanceConfigOperationsResponse { + + /** ListInstanceConfigOperationsResponse operations */ + operations?: (google.longrunning.IOperation[]|null); + + /** ListInstanceConfigOperationsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListInstanceConfigOperationsResponse. */ + class ListInstanceConfigOperationsResponse implements IListInstanceConfigOperationsResponse { + + /** + * Constructs a new ListInstanceConfigOperationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.instance.v1.IListInstanceConfigOperationsResponse); + + /** ListInstanceConfigOperationsResponse operations. */ + public operations: google.longrunning.IOperation[]; + + /** ListInstanceConfigOperationsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListInstanceConfigOperationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInstanceConfigOperationsResponse instance + */ + public static create(properties?: google.spanner.admin.instance.v1.IListInstanceConfigOperationsResponse): google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse; + + /** + * Encodes the specified ListInstanceConfigOperationsResponse message. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse.verify|verify} messages. + * @param message ListInstanceConfigOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.instance.v1.IListInstanceConfigOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInstanceConfigOperationsResponse message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse.verify|verify} messages. + * @param message ListInstanceConfigOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.instance.v1.IListInstanceConfigOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListInstanceConfigOperationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListInstanceConfigOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse; + + /** + * Decodes a ListInstanceConfigOperationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListInstanceConfigOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse; + + /** + * Verifies a ListInstanceConfigOperationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListInstanceConfigOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListInstanceConfigOperationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse; + + /** + * Creates a plain object from a ListInstanceConfigOperationsResponse message. Also converts values to other types if specified. + * @param message ListInstanceConfigOperationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListInstanceConfigOperationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListInstanceConfigOperationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetInstanceRequest. */ + interface IGetInstanceRequest { + + /** GetInstanceRequest name */ + name?: (string|null); + + /** GetInstanceRequest fieldMask */ + fieldMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents a GetInstanceRequest. */ + class GetInstanceRequest implements IGetInstanceRequest { + + /** + * Constructs a new GetInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.instance.v1.IGetInstanceRequest); + + /** GetInstanceRequest name. */ + public name: string; + + /** GetInstanceRequest fieldMask. */ + public fieldMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new GetInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetInstanceRequest instance + */ + public static create(properties?: google.spanner.admin.instance.v1.IGetInstanceRequest): google.spanner.admin.instance.v1.GetInstanceRequest; + + /** + * Encodes the specified GetInstanceRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.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.spanner.admin.instance.v1.IGetInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetInstanceRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.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.spanner.admin.instance.v1.IGetInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.GetInstanceRequest; + + /** + * Decodes a GetInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.GetInstanceRequest; + + /** + * Verifies a GetInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.GetInstanceRequest; + + /** + * Creates a plain object from a GetInstanceRequest message. Also converts values to other types if specified. + * @param message GetInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.instance.v1.GetInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateInstanceRequest. */ + interface ICreateInstanceRequest { + + /** CreateInstanceRequest parent */ + parent?: (string|null); + + /** CreateInstanceRequest instanceId */ + instanceId?: (string|null); + + /** CreateInstanceRequest instance */ + instance?: (google.spanner.admin.instance.v1.IInstance|null); + } + + /** Represents a CreateInstanceRequest. */ + class CreateInstanceRequest implements ICreateInstanceRequest { + + /** + * Constructs a new CreateInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.instance.v1.ICreateInstanceRequest); + + /** CreateInstanceRequest parent. */ + public parent: string; + + /** CreateInstanceRequest instanceId. */ + public instanceId: string; + + /** CreateInstanceRequest instance. */ + public instance?: (google.spanner.admin.instance.v1.IInstance|null); + + /** + * Creates a new CreateInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateInstanceRequest instance + */ + public static create(properties?: google.spanner.admin.instance.v1.ICreateInstanceRequest): google.spanner.admin.instance.v1.CreateInstanceRequest; + + /** + * Encodes the specified CreateInstanceRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.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.spanner.admin.instance.v1.ICreateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateInstanceRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.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.spanner.admin.instance.v1.ICreateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.CreateInstanceRequest; + + /** + * Decodes a CreateInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.CreateInstanceRequest; + + /** + * Verifies a CreateInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.CreateInstanceRequest; + + /** + * Creates a plain object from a CreateInstanceRequest message. Also converts values to other types if specified. + * @param message CreateInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.instance.v1.CreateInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListInstancesRequest. */ + interface IListInstancesRequest { + + /** ListInstancesRequest parent */ + parent?: (string|null); + + /** ListInstancesRequest pageSize */ + pageSize?: (number|null); + + /** ListInstancesRequest pageToken */ + pageToken?: (string|null); + + /** ListInstancesRequest filter */ + filter?: (string|null); + + /** ListInstancesRequest instanceDeadline */ + instanceDeadline?: (google.protobuf.ITimestamp|null); + } + + /** Represents a ListInstancesRequest. */ + class ListInstancesRequest implements IListInstancesRequest { + + /** + * Constructs a new ListInstancesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.instance.v1.IListInstancesRequest); + + /** ListInstancesRequest parent. */ + public parent: string; + + /** ListInstancesRequest pageSize. */ + public pageSize: number; + + /** ListInstancesRequest pageToken. */ + public pageToken: string; + + /** ListInstancesRequest filter. */ + public filter: string; + + /** ListInstancesRequest instanceDeadline. */ + public instanceDeadline?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new ListInstancesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInstancesRequest instance + */ + public static create(properties?: google.spanner.admin.instance.v1.IListInstancesRequest): google.spanner.admin.instance.v1.ListInstancesRequest; + + /** + * Encodes the specified ListInstancesRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancesRequest.verify|verify} messages. + * @param message ListInstancesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.instance.v1.IListInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInstancesRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancesRequest.verify|verify} messages. + * @param message ListInstancesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.instance.v1.IListInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListInstancesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.ListInstancesRequest; + + /** + * Decodes a ListInstancesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.ListInstancesRequest; + + /** + * Verifies a ListInstancesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListInstancesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListInstancesRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.ListInstancesRequest; + + /** + * Creates a plain object from a ListInstancesRequest message. Also converts values to other types if specified. + * @param message ListInstancesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.instance.v1.ListInstancesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListInstancesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListInstancesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListInstancesResponse. */ + interface IListInstancesResponse { + + /** ListInstancesResponse instances */ + instances?: (google.spanner.admin.instance.v1.IInstance[]|null); + + /** ListInstancesResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListInstancesResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListInstancesResponse. */ + class ListInstancesResponse implements IListInstancesResponse { + + /** + * Constructs a new ListInstancesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.instance.v1.IListInstancesResponse); + + /** ListInstancesResponse instances. */ + public instances: google.spanner.admin.instance.v1.IInstance[]; + + /** ListInstancesResponse nextPageToken. */ + public nextPageToken: string; + + /** ListInstancesResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListInstancesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInstancesResponse instance + */ + public static create(properties?: google.spanner.admin.instance.v1.IListInstancesResponse): google.spanner.admin.instance.v1.ListInstancesResponse; + + /** + * Encodes the specified ListInstancesResponse message. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancesResponse.verify|verify} messages. + * @param message ListInstancesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.instance.v1.IListInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInstancesResponse message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancesResponse.verify|verify} messages. + * @param message ListInstancesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.instance.v1.IListInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListInstancesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.ListInstancesResponse; + + /** + * Decodes a ListInstancesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.ListInstancesResponse; + + /** + * Verifies a ListInstancesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListInstancesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListInstancesResponse + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.ListInstancesResponse; + + /** + * Creates a plain object from a ListInstancesResponse message. Also converts values to other types if specified. + * @param message ListInstancesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.instance.v1.ListInstancesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListInstancesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListInstancesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateInstanceRequest. */ + interface IUpdateInstanceRequest { + + /** UpdateInstanceRequest instance */ + instance?: (google.spanner.admin.instance.v1.IInstance|null); + + /** UpdateInstanceRequest fieldMask */ + fieldMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateInstanceRequest. */ + class UpdateInstanceRequest implements IUpdateInstanceRequest { + + /** + * Constructs a new UpdateInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.instance.v1.IUpdateInstanceRequest); + + /** UpdateInstanceRequest instance. */ + public instance?: (google.spanner.admin.instance.v1.IInstance|null); + + /** UpdateInstanceRequest fieldMask. */ + public fieldMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateInstanceRequest instance + */ + public static create(properties?: google.spanner.admin.instance.v1.IUpdateInstanceRequest): google.spanner.admin.instance.v1.UpdateInstanceRequest; + + /** + * Encodes the specified UpdateInstanceRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.UpdateInstanceRequest.verify|verify} messages. + * @param message UpdateInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.instance.v1.IUpdateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateInstanceRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.UpdateInstanceRequest.verify|verify} messages. + * @param message UpdateInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.instance.v1.IUpdateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.UpdateInstanceRequest; + + /** + * Decodes an UpdateInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.UpdateInstanceRequest; + + /** + * Verifies an UpdateInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.UpdateInstanceRequest; + + /** + * Creates a plain object from an UpdateInstanceRequest message. Also converts values to other types if specified. + * @param message UpdateInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.instance.v1.UpdateInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteInstanceRequest. */ + interface IDeleteInstanceRequest { + + /** DeleteInstanceRequest name */ + name?: (string|null); + } + + /** Represents a DeleteInstanceRequest. */ + class DeleteInstanceRequest implements IDeleteInstanceRequest { + + /** + * Constructs a new DeleteInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.instance.v1.IDeleteInstanceRequest); + + /** DeleteInstanceRequest name. */ + public name: string; + + /** + * Creates a new DeleteInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteInstanceRequest instance + */ + public static create(properties?: google.spanner.admin.instance.v1.IDeleteInstanceRequest): google.spanner.admin.instance.v1.DeleteInstanceRequest; + + /** + * Encodes the specified DeleteInstanceRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.DeleteInstanceRequest.verify|verify} messages. + * @param message DeleteInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.instance.v1.IDeleteInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteInstanceRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.DeleteInstanceRequest.verify|verify} messages. + * @param message DeleteInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.instance.v1.IDeleteInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.DeleteInstanceRequest; + + /** + * Decodes a DeleteInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.DeleteInstanceRequest; + + /** + * Verifies a DeleteInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.DeleteInstanceRequest; + + /** + * Creates a plain object from a DeleteInstanceRequest message. Also converts values to other types if specified. + * @param message DeleteInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.instance.v1.DeleteInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateInstanceMetadata. */ + interface ICreateInstanceMetadata { + + /** CreateInstanceMetadata instance */ + instance?: (google.spanner.admin.instance.v1.IInstance|null); + + /** CreateInstanceMetadata startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** CreateInstanceMetadata cancelTime */ + cancelTime?: (google.protobuf.ITimestamp|null); + + /** CreateInstanceMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** CreateInstanceMetadata expectedFulfillmentPeriod */ + expectedFulfillmentPeriod?: (google.spanner.admin.instance.v1.FulfillmentPeriod|keyof typeof google.spanner.admin.instance.v1.FulfillmentPeriod|null); + } + + /** Represents a CreateInstanceMetadata. */ + class CreateInstanceMetadata implements ICreateInstanceMetadata { + + /** + * Constructs a new CreateInstanceMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.instance.v1.ICreateInstanceMetadata); + + /** CreateInstanceMetadata instance. */ + public instance?: (google.spanner.admin.instance.v1.IInstance|null); + + /** CreateInstanceMetadata startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** CreateInstanceMetadata cancelTime. */ + public cancelTime?: (google.protobuf.ITimestamp|null); + + /** CreateInstanceMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** CreateInstanceMetadata expectedFulfillmentPeriod. */ + public expectedFulfillmentPeriod: (google.spanner.admin.instance.v1.FulfillmentPeriod|keyof typeof google.spanner.admin.instance.v1.FulfillmentPeriod); + + /** + * Creates a new CreateInstanceMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateInstanceMetadata instance + */ + public static create(properties?: google.spanner.admin.instance.v1.ICreateInstanceMetadata): google.spanner.admin.instance.v1.CreateInstanceMetadata; + + /** + * Encodes the specified CreateInstanceMetadata message. Does not implicitly {@link google.spanner.admin.instance.v1.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.spanner.admin.instance.v1.ICreateInstanceMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateInstanceMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.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.spanner.admin.instance.v1.ICreateInstanceMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateInstanceMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateInstanceMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.CreateInstanceMetadata; + + /** + * Decodes a CreateInstanceMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateInstanceMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.CreateInstanceMetadata; + + /** + * Verifies a CreateInstanceMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateInstanceMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateInstanceMetadata + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.CreateInstanceMetadata; + + /** + * Creates a plain object from a CreateInstanceMetadata message. Also converts values to other types if specified. + * @param message CreateInstanceMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.instance.v1.CreateInstanceMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateInstanceMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateInstanceMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateInstanceMetadata. */ + interface IUpdateInstanceMetadata { + + /** UpdateInstanceMetadata instance */ + instance?: (google.spanner.admin.instance.v1.IInstance|null); + + /** UpdateInstanceMetadata startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** UpdateInstanceMetadata cancelTime */ + cancelTime?: (google.protobuf.ITimestamp|null); + + /** UpdateInstanceMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** UpdateInstanceMetadata expectedFulfillmentPeriod */ + expectedFulfillmentPeriod?: (google.spanner.admin.instance.v1.FulfillmentPeriod|keyof typeof google.spanner.admin.instance.v1.FulfillmentPeriod|null); + } + + /** Represents an UpdateInstanceMetadata. */ + class UpdateInstanceMetadata implements IUpdateInstanceMetadata { + + /** + * Constructs a new UpdateInstanceMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.instance.v1.IUpdateInstanceMetadata); + + /** UpdateInstanceMetadata instance. */ + public instance?: (google.spanner.admin.instance.v1.IInstance|null); + + /** UpdateInstanceMetadata startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** UpdateInstanceMetadata cancelTime. */ + public cancelTime?: (google.protobuf.ITimestamp|null); + + /** UpdateInstanceMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** UpdateInstanceMetadata expectedFulfillmentPeriod. */ + public expectedFulfillmentPeriod: (google.spanner.admin.instance.v1.FulfillmentPeriod|keyof typeof google.spanner.admin.instance.v1.FulfillmentPeriod); + + /** + * Creates a new UpdateInstanceMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateInstanceMetadata instance + */ + public static create(properties?: google.spanner.admin.instance.v1.IUpdateInstanceMetadata): google.spanner.admin.instance.v1.UpdateInstanceMetadata; + + /** + * Encodes the specified UpdateInstanceMetadata message. Does not implicitly {@link google.spanner.admin.instance.v1.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.spanner.admin.instance.v1.IUpdateInstanceMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateInstanceMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.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.spanner.admin.instance.v1.IUpdateInstanceMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateInstanceMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateInstanceMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.UpdateInstanceMetadata; + + /** + * Decodes an UpdateInstanceMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateInstanceMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.UpdateInstanceMetadata; + + /** + * Verifies an UpdateInstanceMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateInstanceMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateInstanceMetadata + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.UpdateInstanceMetadata; + + /** + * Creates a plain object from an UpdateInstanceMetadata message. Also converts values to other types if specified. + * @param message UpdateInstanceMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.instance.v1.UpdateInstanceMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateInstanceMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateInstanceMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FreeInstanceMetadata. */ + interface IFreeInstanceMetadata { + + /** FreeInstanceMetadata expireTime */ + expireTime?: (google.protobuf.ITimestamp|null); + + /** FreeInstanceMetadata upgradeTime */ + upgradeTime?: (google.protobuf.ITimestamp|null); + + /** FreeInstanceMetadata expireBehavior */ + expireBehavior?: (google.spanner.admin.instance.v1.FreeInstanceMetadata.ExpireBehavior|keyof typeof google.spanner.admin.instance.v1.FreeInstanceMetadata.ExpireBehavior|null); + } + + /** Represents a FreeInstanceMetadata. */ + class FreeInstanceMetadata implements IFreeInstanceMetadata { + + /** + * Constructs a new FreeInstanceMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.instance.v1.IFreeInstanceMetadata); + + /** FreeInstanceMetadata expireTime. */ + public expireTime?: (google.protobuf.ITimestamp|null); + + /** FreeInstanceMetadata upgradeTime. */ + public upgradeTime?: (google.protobuf.ITimestamp|null); + + /** FreeInstanceMetadata expireBehavior. */ + public expireBehavior: (google.spanner.admin.instance.v1.FreeInstanceMetadata.ExpireBehavior|keyof typeof google.spanner.admin.instance.v1.FreeInstanceMetadata.ExpireBehavior); + + /** + * Creates a new FreeInstanceMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns FreeInstanceMetadata instance + */ + public static create(properties?: google.spanner.admin.instance.v1.IFreeInstanceMetadata): google.spanner.admin.instance.v1.FreeInstanceMetadata; + + /** + * Encodes the specified FreeInstanceMetadata message. Does not implicitly {@link google.spanner.admin.instance.v1.FreeInstanceMetadata.verify|verify} messages. + * @param message FreeInstanceMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.instance.v1.IFreeInstanceMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FreeInstanceMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.FreeInstanceMetadata.verify|verify} messages. + * @param message FreeInstanceMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.instance.v1.IFreeInstanceMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FreeInstanceMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FreeInstanceMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.FreeInstanceMetadata; + + /** + * Decodes a FreeInstanceMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FreeInstanceMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.FreeInstanceMetadata; + + /** + * Verifies a FreeInstanceMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FreeInstanceMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FreeInstanceMetadata + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.FreeInstanceMetadata; + + /** + * Creates a plain object from a FreeInstanceMetadata message. Also converts values to other types if specified. + * @param message FreeInstanceMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.instance.v1.FreeInstanceMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FreeInstanceMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FreeInstanceMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FreeInstanceMetadata { + + /** ExpireBehavior enum. */ + enum ExpireBehavior { + EXPIRE_BEHAVIOR_UNSPECIFIED = 0, + FREE_TO_PROVISIONED = 1, + REMOVE_AFTER_GRACE_PERIOD = 2 + } + } + + /** Properties of a CreateInstanceConfigMetadata. */ + interface ICreateInstanceConfigMetadata { + + /** CreateInstanceConfigMetadata instanceConfig */ + instanceConfig?: (google.spanner.admin.instance.v1.IInstanceConfig|null); + + /** CreateInstanceConfigMetadata progress */ + progress?: (google.spanner.admin.instance.v1.IOperationProgress|null); + + /** CreateInstanceConfigMetadata cancelTime */ + cancelTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a CreateInstanceConfigMetadata. */ + class CreateInstanceConfigMetadata implements ICreateInstanceConfigMetadata { + + /** + * Constructs a new CreateInstanceConfigMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.instance.v1.ICreateInstanceConfigMetadata); + + /** CreateInstanceConfigMetadata instanceConfig. */ + public instanceConfig?: (google.spanner.admin.instance.v1.IInstanceConfig|null); + + /** CreateInstanceConfigMetadata progress. */ + public progress?: (google.spanner.admin.instance.v1.IOperationProgress|null); + + /** CreateInstanceConfigMetadata cancelTime. */ + public cancelTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new CreateInstanceConfigMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateInstanceConfigMetadata instance + */ + public static create(properties?: google.spanner.admin.instance.v1.ICreateInstanceConfigMetadata): google.spanner.admin.instance.v1.CreateInstanceConfigMetadata; + + /** + * Encodes the specified CreateInstanceConfigMetadata message. Does not implicitly {@link google.spanner.admin.instance.v1.CreateInstanceConfigMetadata.verify|verify} messages. + * @param message CreateInstanceConfigMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.instance.v1.ICreateInstanceConfigMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateInstanceConfigMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.CreateInstanceConfigMetadata.verify|verify} messages. + * @param message CreateInstanceConfigMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.instance.v1.ICreateInstanceConfigMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateInstanceConfigMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateInstanceConfigMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.CreateInstanceConfigMetadata; + + /** + * Decodes a CreateInstanceConfigMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateInstanceConfigMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.CreateInstanceConfigMetadata; + + /** + * Verifies a CreateInstanceConfigMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateInstanceConfigMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateInstanceConfigMetadata + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.CreateInstanceConfigMetadata; + + /** + * Creates a plain object from a CreateInstanceConfigMetadata message. Also converts values to other types if specified. + * @param message CreateInstanceConfigMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.instance.v1.CreateInstanceConfigMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateInstanceConfigMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateInstanceConfigMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateInstanceConfigMetadata. */ + interface IUpdateInstanceConfigMetadata { + + /** UpdateInstanceConfigMetadata instanceConfig */ + instanceConfig?: (google.spanner.admin.instance.v1.IInstanceConfig|null); + + /** UpdateInstanceConfigMetadata progress */ + progress?: (google.spanner.admin.instance.v1.IOperationProgress|null); + + /** UpdateInstanceConfigMetadata cancelTime */ + cancelTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents an UpdateInstanceConfigMetadata. */ + class UpdateInstanceConfigMetadata implements IUpdateInstanceConfigMetadata { + + /** + * Constructs a new UpdateInstanceConfigMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.instance.v1.IUpdateInstanceConfigMetadata); + + /** UpdateInstanceConfigMetadata instanceConfig. */ + public instanceConfig?: (google.spanner.admin.instance.v1.IInstanceConfig|null); + + /** UpdateInstanceConfigMetadata progress. */ + public progress?: (google.spanner.admin.instance.v1.IOperationProgress|null); + + /** UpdateInstanceConfigMetadata cancelTime. */ + public cancelTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new UpdateInstanceConfigMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateInstanceConfigMetadata instance + */ + public static create(properties?: google.spanner.admin.instance.v1.IUpdateInstanceConfigMetadata): google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata; + + /** + * Encodes the specified UpdateInstanceConfigMetadata message. Does not implicitly {@link google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata.verify|verify} messages. + * @param message UpdateInstanceConfigMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.instance.v1.IUpdateInstanceConfigMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateInstanceConfigMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata.verify|verify} messages. + * @param message UpdateInstanceConfigMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.instance.v1.IUpdateInstanceConfigMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateInstanceConfigMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateInstanceConfigMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata; + + /** + * Decodes an UpdateInstanceConfigMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateInstanceConfigMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata; + + /** + * Verifies an UpdateInstanceConfigMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateInstanceConfigMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateInstanceConfigMetadata + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata; + + /** + * Creates a plain object from an UpdateInstanceConfigMetadata message. Also converts values to other types if specified. + * @param message UpdateInstanceConfigMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateInstanceConfigMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateInstanceConfigMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an InstancePartition. */ + interface IInstancePartition { + + /** InstancePartition name */ + name?: (string|null); + + /** InstancePartition config */ + config?: (string|null); + + /** InstancePartition displayName */ + displayName?: (string|null); + + /** InstancePartition nodeCount */ + nodeCount?: (number|null); + + /** InstancePartition processingUnits */ + processingUnits?: (number|null); + + /** InstancePartition autoscalingConfig */ + autoscalingConfig?: (google.spanner.admin.instance.v1.IAutoscalingConfig|null); + + /** InstancePartition state */ + state?: (google.spanner.admin.instance.v1.InstancePartition.State|keyof typeof google.spanner.admin.instance.v1.InstancePartition.State|null); + + /** InstancePartition createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** InstancePartition updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** InstancePartition referencingDatabases */ + referencingDatabases?: (string[]|null); + + /** InstancePartition referencingBackups */ + referencingBackups?: (string[]|null); + + /** InstancePartition etag */ + etag?: (string|null); + } + + /** Represents an InstancePartition. */ + class InstancePartition implements IInstancePartition { + + /** + * Constructs a new InstancePartition. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.instance.v1.IInstancePartition); + + /** InstancePartition name. */ + public name: string; + + /** InstancePartition config. */ + public config: string; + + /** InstancePartition displayName. */ + public displayName: string; + + /** InstancePartition nodeCount. */ + public nodeCount?: (number|null); + + /** InstancePartition processingUnits. */ + public processingUnits?: (number|null); + + /** InstancePartition autoscalingConfig. */ + public autoscalingConfig?: (google.spanner.admin.instance.v1.IAutoscalingConfig|null); + + /** InstancePartition state. */ + public state: (google.spanner.admin.instance.v1.InstancePartition.State|keyof typeof google.spanner.admin.instance.v1.InstancePartition.State); + + /** InstancePartition createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** InstancePartition updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** InstancePartition referencingDatabases. */ + public referencingDatabases: string[]; + + /** InstancePartition referencingBackups. */ + public referencingBackups: string[]; + + /** InstancePartition etag. */ + public etag: string; + + /** InstancePartition computeCapacity. */ + public computeCapacity?: ("nodeCount"|"processingUnits"); + + /** + * Creates a new InstancePartition instance using the specified properties. + * @param [properties] Properties to set + * @returns InstancePartition instance + */ + public static create(properties?: google.spanner.admin.instance.v1.IInstancePartition): google.spanner.admin.instance.v1.InstancePartition; + + /** + * Encodes the specified InstancePartition message. Does not implicitly {@link google.spanner.admin.instance.v1.InstancePartition.verify|verify} messages. + * @param message InstancePartition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.instance.v1.IInstancePartition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstancePartition message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.InstancePartition.verify|verify} messages. + * @param message InstancePartition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.instance.v1.IInstancePartition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstancePartition message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstancePartition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.InstancePartition; + + /** + * Decodes an InstancePartition message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstancePartition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.InstancePartition; + + /** + * Verifies an InstancePartition message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstancePartition message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstancePartition + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.InstancePartition; + + /** + * Creates a plain object from an InstancePartition message. Also converts values to other types if specified. + * @param message InstancePartition + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.instance.v1.InstancePartition, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstancePartition to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InstancePartition + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace InstancePartition { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + CREATING = 1, + READY = 2 + } + } + + /** Properties of a CreateInstancePartitionMetadata. */ + interface ICreateInstancePartitionMetadata { + + /** CreateInstancePartitionMetadata instancePartition */ + instancePartition?: (google.spanner.admin.instance.v1.IInstancePartition|null); + + /** CreateInstancePartitionMetadata startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** CreateInstancePartitionMetadata cancelTime */ + cancelTime?: (google.protobuf.ITimestamp|null); + + /** CreateInstancePartitionMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a CreateInstancePartitionMetadata. */ + class CreateInstancePartitionMetadata implements ICreateInstancePartitionMetadata { + + /** + * Constructs a new CreateInstancePartitionMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.instance.v1.ICreateInstancePartitionMetadata); + + /** CreateInstancePartitionMetadata instancePartition. */ + public instancePartition?: (google.spanner.admin.instance.v1.IInstancePartition|null); + + /** CreateInstancePartitionMetadata startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** CreateInstancePartitionMetadata cancelTime. */ + public cancelTime?: (google.protobuf.ITimestamp|null); + + /** CreateInstancePartitionMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new CreateInstancePartitionMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateInstancePartitionMetadata instance + */ + public static create(properties?: google.spanner.admin.instance.v1.ICreateInstancePartitionMetadata): google.spanner.admin.instance.v1.CreateInstancePartitionMetadata; + + /** + * Encodes the specified CreateInstancePartitionMetadata message. Does not implicitly {@link google.spanner.admin.instance.v1.CreateInstancePartitionMetadata.verify|verify} messages. + * @param message CreateInstancePartitionMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.instance.v1.ICreateInstancePartitionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateInstancePartitionMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.CreateInstancePartitionMetadata.verify|verify} messages. + * @param message CreateInstancePartitionMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.instance.v1.ICreateInstancePartitionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateInstancePartitionMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateInstancePartitionMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.CreateInstancePartitionMetadata; + + /** + * Decodes a CreateInstancePartitionMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateInstancePartitionMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.CreateInstancePartitionMetadata; + + /** + * Verifies a CreateInstancePartitionMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateInstancePartitionMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateInstancePartitionMetadata + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.CreateInstancePartitionMetadata; + + /** + * Creates a plain object from a CreateInstancePartitionMetadata message. Also converts values to other types if specified. + * @param message CreateInstancePartitionMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.instance.v1.CreateInstancePartitionMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateInstancePartitionMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateInstancePartitionMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateInstancePartitionRequest. */ + interface ICreateInstancePartitionRequest { + + /** CreateInstancePartitionRequest parent */ + parent?: (string|null); + + /** CreateInstancePartitionRequest instancePartitionId */ + instancePartitionId?: (string|null); + + /** CreateInstancePartitionRequest instancePartition */ + instancePartition?: (google.spanner.admin.instance.v1.IInstancePartition|null); + } + + /** Represents a CreateInstancePartitionRequest. */ + class CreateInstancePartitionRequest implements ICreateInstancePartitionRequest { + + /** + * Constructs a new CreateInstancePartitionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.instance.v1.ICreateInstancePartitionRequest); + + /** CreateInstancePartitionRequest parent. */ + public parent: string; + + /** CreateInstancePartitionRequest instancePartitionId. */ + public instancePartitionId: string; + + /** CreateInstancePartitionRequest instancePartition. */ + public instancePartition?: (google.spanner.admin.instance.v1.IInstancePartition|null); + + /** + * Creates a new CreateInstancePartitionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateInstancePartitionRequest instance + */ + public static create(properties?: google.spanner.admin.instance.v1.ICreateInstancePartitionRequest): google.spanner.admin.instance.v1.CreateInstancePartitionRequest; + + /** + * Encodes the specified CreateInstancePartitionRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.CreateInstancePartitionRequest.verify|verify} messages. + * @param message CreateInstancePartitionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.instance.v1.ICreateInstancePartitionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateInstancePartitionRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.CreateInstancePartitionRequest.verify|verify} messages. + * @param message CreateInstancePartitionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.instance.v1.ICreateInstancePartitionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateInstancePartitionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateInstancePartitionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.CreateInstancePartitionRequest; + + /** + * Decodes a CreateInstancePartitionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateInstancePartitionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.CreateInstancePartitionRequest; + + /** + * Verifies a CreateInstancePartitionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateInstancePartitionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateInstancePartitionRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.CreateInstancePartitionRequest; + + /** + * Creates a plain object from a CreateInstancePartitionRequest message. Also converts values to other types if specified. + * @param message CreateInstancePartitionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.instance.v1.CreateInstancePartitionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateInstancePartitionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateInstancePartitionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteInstancePartitionRequest. */ + interface IDeleteInstancePartitionRequest { + + /** DeleteInstancePartitionRequest name */ + name?: (string|null); + + /** DeleteInstancePartitionRequest etag */ + etag?: (string|null); + } + + /** Represents a DeleteInstancePartitionRequest. */ + class DeleteInstancePartitionRequest implements IDeleteInstancePartitionRequest { + + /** + * Constructs a new DeleteInstancePartitionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.instance.v1.IDeleteInstancePartitionRequest); + + /** DeleteInstancePartitionRequest name. */ + public name: string; + + /** DeleteInstancePartitionRequest etag. */ + public etag: string; + + /** + * Creates a new DeleteInstancePartitionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteInstancePartitionRequest instance + */ + public static create(properties?: google.spanner.admin.instance.v1.IDeleteInstancePartitionRequest): google.spanner.admin.instance.v1.DeleteInstancePartitionRequest; + + /** + * Encodes the specified DeleteInstancePartitionRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.DeleteInstancePartitionRequest.verify|verify} messages. + * @param message DeleteInstancePartitionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.instance.v1.IDeleteInstancePartitionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteInstancePartitionRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.DeleteInstancePartitionRequest.verify|verify} messages. + * @param message DeleteInstancePartitionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.instance.v1.IDeleteInstancePartitionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteInstancePartitionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteInstancePartitionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.DeleteInstancePartitionRequest; + + /** + * Decodes a DeleteInstancePartitionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteInstancePartitionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.DeleteInstancePartitionRequest; + + /** + * Verifies a DeleteInstancePartitionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteInstancePartitionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteInstancePartitionRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.DeleteInstancePartitionRequest; + + /** + * Creates a plain object from a DeleteInstancePartitionRequest message. Also converts values to other types if specified. + * @param message DeleteInstancePartitionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.instance.v1.DeleteInstancePartitionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteInstancePartitionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteInstancePartitionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetInstancePartitionRequest. */ + interface IGetInstancePartitionRequest { + + /** GetInstancePartitionRequest name */ + name?: (string|null); + } + + /** Represents a GetInstancePartitionRequest. */ + class GetInstancePartitionRequest implements IGetInstancePartitionRequest { + + /** + * Constructs a new GetInstancePartitionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.instance.v1.IGetInstancePartitionRequest); + + /** GetInstancePartitionRequest name. */ + public name: string; + + /** + * Creates a new GetInstancePartitionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetInstancePartitionRequest instance + */ + public static create(properties?: google.spanner.admin.instance.v1.IGetInstancePartitionRequest): google.spanner.admin.instance.v1.GetInstancePartitionRequest; + + /** + * Encodes the specified GetInstancePartitionRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.GetInstancePartitionRequest.verify|verify} messages. + * @param message GetInstancePartitionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.instance.v1.IGetInstancePartitionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetInstancePartitionRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.GetInstancePartitionRequest.verify|verify} messages. + * @param message GetInstancePartitionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.instance.v1.IGetInstancePartitionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetInstancePartitionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetInstancePartitionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.GetInstancePartitionRequest; + + /** + * Decodes a GetInstancePartitionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetInstancePartitionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.GetInstancePartitionRequest; + + /** + * Verifies a GetInstancePartitionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetInstancePartitionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetInstancePartitionRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.GetInstancePartitionRequest; + + /** + * Creates a plain object from a GetInstancePartitionRequest message. Also converts values to other types if specified. + * @param message GetInstancePartitionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.instance.v1.GetInstancePartitionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetInstancePartitionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetInstancePartitionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateInstancePartitionRequest. */ + interface IUpdateInstancePartitionRequest { + + /** UpdateInstancePartitionRequest instancePartition */ + instancePartition?: (google.spanner.admin.instance.v1.IInstancePartition|null); + + /** UpdateInstancePartitionRequest fieldMask */ + fieldMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateInstancePartitionRequest. */ + class UpdateInstancePartitionRequest implements IUpdateInstancePartitionRequest { + + /** + * Constructs a new UpdateInstancePartitionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.instance.v1.IUpdateInstancePartitionRequest); + + /** UpdateInstancePartitionRequest instancePartition. */ + public instancePartition?: (google.spanner.admin.instance.v1.IInstancePartition|null); + + /** UpdateInstancePartitionRequest fieldMask. */ + public fieldMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateInstancePartitionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateInstancePartitionRequest instance + */ + public static create(properties?: google.spanner.admin.instance.v1.IUpdateInstancePartitionRequest): google.spanner.admin.instance.v1.UpdateInstancePartitionRequest; + + /** + * Encodes the specified UpdateInstancePartitionRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.UpdateInstancePartitionRequest.verify|verify} messages. + * @param message UpdateInstancePartitionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.instance.v1.IUpdateInstancePartitionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateInstancePartitionRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.UpdateInstancePartitionRequest.verify|verify} messages. + * @param message UpdateInstancePartitionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.instance.v1.IUpdateInstancePartitionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateInstancePartitionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateInstancePartitionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.UpdateInstancePartitionRequest; + + /** + * Decodes an UpdateInstancePartitionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateInstancePartitionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.UpdateInstancePartitionRequest; + + /** + * Verifies an UpdateInstancePartitionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateInstancePartitionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateInstancePartitionRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.UpdateInstancePartitionRequest; + + /** + * Creates a plain object from an UpdateInstancePartitionRequest message. Also converts values to other types if specified. + * @param message UpdateInstancePartitionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.instance.v1.UpdateInstancePartitionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateInstancePartitionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateInstancePartitionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateInstancePartitionMetadata. */ + interface IUpdateInstancePartitionMetadata { + + /** UpdateInstancePartitionMetadata instancePartition */ + instancePartition?: (google.spanner.admin.instance.v1.IInstancePartition|null); + + /** UpdateInstancePartitionMetadata startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** UpdateInstancePartitionMetadata cancelTime */ + cancelTime?: (google.protobuf.ITimestamp|null); + + /** UpdateInstancePartitionMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents an UpdateInstancePartitionMetadata. */ + class UpdateInstancePartitionMetadata implements IUpdateInstancePartitionMetadata { + + /** + * Constructs a new UpdateInstancePartitionMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.instance.v1.IUpdateInstancePartitionMetadata); + + /** UpdateInstancePartitionMetadata instancePartition. */ + public instancePartition?: (google.spanner.admin.instance.v1.IInstancePartition|null); + + /** UpdateInstancePartitionMetadata startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** UpdateInstancePartitionMetadata cancelTime. */ + public cancelTime?: (google.protobuf.ITimestamp|null); + + /** UpdateInstancePartitionMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new UpdateInstancePartitionMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateInstancePartitionMetadata instance + */ + public static create(properties?: google.spanner.admin.instance.v1.IUpdateInstancePartitionMetadata): google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata; + + /** + * Encodes the specified UpdateInstancePartitionMetadata message. Does not implicitly {@link google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata.verify|verify} messages. + * @param message UpdateInstancePartitionMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.instance.v1.IUpdateInstancePartitionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateInstancePartitionMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata.verify|verify} messages. + * @param message UpdateInstancePartitionMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.instance.v1.IUpdateInstancePartitionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateInstancePartitionMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateInstancePartitionMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata; + + /** + * Decodes an UpdateInstancePartitionMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateInstancePartitionMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata; + + /** + * Verifies an UpdateInstancePartitionMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateInstancePartitionMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateInstancePartitionMetadata + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata; + + /** + * Creates a plain object from an UpdateInstancePartitionMetadata message. Also converts values to other types if specified. + * @param message UpdateInstancePartitionMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateInstancePartitionMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateInstancePartitionMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListInstancePartitionsRequest. */ + interface IListInstancePartitionsRequest { + + /** ListInstancePartitionsRequest parent */ + parent?: (string|null); + + /** ListInstancePartitionsRequest pageSize */ + pageSize?: (number|null); + + /** ListInstancePartitionsRequest pageToken */ + pageToken?: (string|null); + + /** ListInstancePartitionsRequest instancePartitionDeadline */ + instancePartitionDeadline?: (google.protobuf.ITimestamp|null); + } + + /** Represents a ListInstancePartitionsRequest. */ + class ListInstancePartitionsRequest implements IListInstancePartitionsRequest { + + /** + * Constructs a new ListInstancePartitionsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.instance.v1.IListInstancePartitionsRequest); + + /** ListInstancePartitionsRequest parent. */ + public parent: string; + + /** ListInstancePartitionsRequest pageSize. */ + public pageSize: number; + + /** ListInstancePartitionsRequest pageToken. */ + public pageToken: string; + + /** ListInstancePartitionsRequest instancePartitionDeadline. */ + public instancePartitionDeadline?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new ListInstancePartitionsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInstancePartitionsRequest instance + */ + public static create(properties?: google.spanner.admin.instance.v1.IListInstancePartitionsRequest): google.spanner.admin.instance.v1.ListInstancePartitionsRequest; + + /** + * Encodes the specified ListInstancePartitionsRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancePartitionsRequest.verify|verify} messages. + * @param message ListInstancePartitionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.instance.v1.IListInstancePartitionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInstancePartitionsRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancePartitionsRequest.verify|verify} messages. + * @param message ListInstancePartitionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.instance.v1.IListInstancePartitionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListInstancePartitionsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListInstancePartitionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.ListInstancePartitionsRequest; + + /** + * Decodes a ListInstancePartitionsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListInstancePartitionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.ListInstancePartitionsRequest; + + /** + * Verifies a ListInstancePartitionsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListInstancePartitionsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListInstancePartitionsRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.ListInstancePartitionsRequest; + + /** + * Creates a plain object from a ListInstancePartitionsRequest message. Also converts values to other types if specified. + * @param message ListInstancePartitionsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.instance.v1.ListInstancePartitionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListInstancePartitionsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListInstancePartitionsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListInstancePartitionsResponse. */ + interface IListInstancePartitionsResponse { + + /** ListInstancePartitionsResponse instancePartitions */ + instancePartitions?: (google.spanner.admin.instance.v1.IInstancePartition[]|null); + + /** ListInstancePartitionsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListInstancePartitionsResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListInstancePartitionsResponse. */ + class ListInstancePartitionsResponse implements IListInstancePartitionsResponse { + + /** + * Constructs a new ListInstancePartitionsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.instance.v1.IListInstancePartitionsResponse); + + /** ListInstancePartitionsResponse instancePartitions. */ + public instancePartitions: google.spanner.admin.instance.v1.IInstancePartition[]; + + /** ListInstancePartitionsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListInstancePartitionsResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListInstancePartitionsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInstancePartitionsResponse instance + */ + public static create(properties?: google.spanner.admin.instance.v1.IListInstancePartitionsResponse): google.spanner.admin.instance.v1.ListInstancePartitionsResponse; + + /** + * Encodes the specified ListInstancePartitionsResponse message. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancePartitionsResponse.verify|verify} messages. + * @param message ListInstancePartitionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.instance.v1.IListInstancePartitionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInstancePartitionsResponse message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancePartitionsResponse.verify|verify} messages. + * @param message ListInstancePartitionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.instance.v1.IListInstancePartitionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListInstancePartitionsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListInstancePartitionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.ListInstancePartitionsResponse; + + /** + * Decodes a ListInstancePartitionsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListInstancePartitionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.ListInstancePartitionsResponse; + + /** + * Verifies a ListInstancePartitionsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListInstancePartitionsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListInstancePartitionsResponse + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.ListInstancePartitionsResponse; + + /** + * Creates a plain object from a ListInstancePartitionsResponse message. Also converts values to other types if specified. + * @param message ListInstancePartitionsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.instance.v1.ListInstancePartitionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListInstancePartitionsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListInstancePartitionsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListInstancePartitionOperationsRequest. */ + interface IListInstancePartitionOperationsRequest { + + /** ListInstancePartitionOperationsRequest parent */ + parent?: (string|null); + + /** ListInstancePartitionOperationsRequest filter */ + filter?: (string|null); + + /** ListInstancePartitionOperationsRequest pageSize */ + pageSize?: (number|null); + + /** ListInstancePartitionOperationsRequest pageToken */ + pageToken?: (string|null); + + /** ListInstancePartitionOperationsRequest instancePartitionDeadline */ + instancePartitionDeadline?: (google.protobuf.ITimestamp|null); + } + + /** Represents a ListInstancePartitionOperationsRequest. */ + class ListInstancePartitionOperationsRequest implements IListInstancePartitionOperationsRequest { + + /** + * Constructs a new ListInstancePartitionOperationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.instance.v1.IListInstancePartitionOperationsRequest); + + /** ListInstancePartitionOperationsRequest parent. */ + public parent: string; + + /** ListInstancePartitionOperationsRequest filter. */ + public filter: string; + + /** ListInstancePartitionOperationsRequest pageSize. */ + public pageSize: number; + + /** ListInstancePartitionOperationsRequest pageToken. */ + public pageToken: string; + + /** ListInstancePartitionOperationsRequest instancePartitionDeadline. */ + public instancePartitionDeadline?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new ListInstancePartitionOperationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInstancePartitionOperationsRequest instance + */ + public static create(properties?: google.spanner.admin.instance.v1.IListInstancePartitionOperationsRequest): google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest; + + /** + * Encodes the specified ListInstancePartitionOperationsRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest.verify|verify} messages. + * @param message ListInstancePartitionOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.instance.v1.IListInstancePartitionOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInstancePartitionOperationsRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest.verify|verify} messages. + * @param message ListInstancePartitionOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.instance.v1.IListInstancePartitionOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListInstancePartitionOperationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListInstancePartitionOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest; + + /** + * Decodes a ListInstancePartitionOperationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListInstancePartitionOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest; + + /** + * Verifies a ListInstancePartitionOperationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListInstancePartitionOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListInstancePartitionOperationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest; + + /** + * Creates a plain object from a ListInstancePartitionOperationsRequest message. Also converts values to other types if specified. + * @param message ListInstancePartitionOperationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListInstancePartitionOperationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListInstancePartitionOperationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListInstancePartitionOperationsResponse. */ + interface IListInstancePartitionOperationsResponse { + + /** ListInstancePartitionOperationsResponse operations */ + operations?: (google.longrunning.IOperation[]|null); + + /** ListInstancePartitionOperationsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListInstancePartitionOperationsResponse unreachableInstancePartitions */ + unreachableInstancePartitions?: (string[]|null); + } + + /** Represents a ListInstancePartitionOperationsResponse. */ + class ListInstancePartitionOperationsResponse implements IListInstancePartitionOperationsResponse { + + /** + * Constructs a new ListInstancePartitionOperationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.instance.v1.IListInstancePartitionOperationsResponse); + + /** ListInstancePartitionOperationsResponse operations. */ + public operations: google.longrunning.IOperation[]; + + /** ListInstancePartitionOperationsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListInstancePartitionOperationsResponse unreachableInstancePartitions. */ + public unreachableInstancePartitions: string[]; + + /** + * Creates a new ListInstancePartitionOperationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInstancePartitionOperationsResponse instance + */ + public static create(properties?: google.spanner.admin.instance.v1.IListInstancePartitionOperationsResponse): google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse; + + /** + * Encodes the specified ListInstancePartitionOperationsResponse message. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse.verify|verify} messages. + * @param message ListInstancePartitionOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.instance.v1.IListInstancePartitionOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInstancePartitionOperationsResponse message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse.verify|verify} messages. + * @param message ListInstancePartitionOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.instance.v1.IListInstancePartitionOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListInstancePartitionOperationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListInstancePartitionOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse; + + /** + * Decodes a ListInstancePartitionOperationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListInstancePartitionOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse; + + /** + * Verifies a ListInstancePartitionOperationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListInstancePartitionOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListInstancePartitionOperationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse; + + /** + * Creates a plain object from a ListInstancePartitionOperationsResponse message. Also converts values to other types if specified. + * @param message ListInstancePartitionOperationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListInstancePartitionOperationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListInstancePartitionOperationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MoveInstanceRequest. */ + interface IMoveInstanceRequest { + + /** MoveInstanceRequest name */ + name?: (string|null); + + /** MoveInstanceRequest targetConfig */ + targetConfig?: (string|null); + } + + /** Represents a MoveInstanceRequest. */ + class MoveInstanceRequest implements IMoveInstanceRequest { + + /** + * Constructs a new MoveInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.instance.v1.IMoveInstanceRequest); + + /** MoveInstanceRequest name. */ + public name: string; + + /** MoveInstanceRequest targetConfig. */ + public targetConfig: string; + + /** + * Creates a new MoveInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns MoveInstanceRequest instance + */ + public static create(properties?: google.spanner.admin.instance.v1.IMoveInstanceRequest): google.spanner.admin.instance.v1.MoveInstanceRequest; + + /** + * Encodes the specified MoveInstanceRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.MoveInstanceRequest.verify|verify} messages. + * @param message MoveInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.instance.v1.IMoveInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MoveInstanceRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.MoveInstanceRequest.verify|verify} messages. + * @param message MoveInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.instance.v1.IMoveInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MoveInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MoveInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.MoveInstanceRequest; + + /** + * Decodes a MoveInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MoveInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.MoveInstanceRequest; + + /** + * Verifies a MoveInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MoveInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MoveInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.MoveInstanceRequest; + + /** + * Creates a plain object from a MoveInstanceRequest message. Also converts values to other types if specified. + * @param message MoveInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.instance.v1.MoveInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MoveInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MoveInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MoveInstanceResponse. */ + interface IMoveInstanceResponse { + } + + /** Represents a MoveInstanceResponse. */ + class MoveInstanceResponse implements IMoveInstanceResponse { + + /** + * Constructs a new MoveInstanceResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.instance.v1.IMoveInstanceResponse); + + /** + * Creates a new MoveInstanceResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns MoveInstanceResponse instance + */ + public static create(properties?: google.spanner.admin.instance.v1.IMoveInstanceResponse): google.spanner.admin.instance.v1.MoveInstanceResponse; + + /** + * Encodes the specified MoveInstanceResponse message. Does not implicitly {@link google.spanner.admin.instance.v1.MoveInstanceResponse.verify|verify} messages. + * @param message MoveInstanceResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.instance.v1.IMoveInstanceResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MoveInstanceResponse message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.MoveInstanceResponse.verify|verify} messages. + * @param message MoveInstanceResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.instance.v1.IMoveInstanceResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MoveInstanceResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MoveInstanceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.MoveInstanceResponse; + + /** + * Decodes a MoveInstanceResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MoveInstanceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.MoveInstanceResponse; + + /** + * Verifies a MoveInstanceResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MoveInstanceResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MoveInstanceResponse + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.MoveInstanceResponse; + + /** + * Creates a plain object from a MoveInstanceResponse message. Also converts values to other types if specified. + * @param message MoveInstanceResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.instance.v1.MoveInstanceResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MoveInstanceResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MoveInstanceResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MoveInstanceMetadata. */ + interface IMoveInstanceMetadata { + + /** MoveInstanceMetadata targetConfig */ + targetConfig?: (string|null); + + /** MoveInstanceMetadata progress */ + progress?: (google.spanner.admin.instance.v1.IOperationProgress|null); + + /** MoveInstanceMetadata cancelTime */ + cancelTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a MoveInstanceMetadata. */ + class MoveInstanceMetadata implements IMoveInstanceMetadata { + + /** + * Constructs a new MoveInstanceMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.instance.v1.IMoveInstanceMetadata); + + /** MoveInstanceMetadata targetConfig. */ + public targetConfig: string; + + /** MoveInstanceMetadata progress. */ + public progress?: (google.spanner.admin.instance.v1.IOperationProgress|null); + + /** MoveInstanceMetadata cancelTime. */ + public cancelTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new MoveInstanceMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns MoveInstanceMetadata instance + */ + public static create(properties?: google.spanner.admin.instance.v1.IMoveInstanceMetadata): google.spanner.admin.instance.v1.MoveInstanceMetadata; + + /** + * Encodes the specified MoveInstanceMetadata message. Does not implicitly {@link google.spanner.admin.instance.v1.MoveInstanceMetadata.verify|verify} messages. + * @param message MoveInstanceMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.instance.v1.IMoveInstanceMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MoveInstanceMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.MoveInstanceMetadata.verify|verify} messages. + * @param message MoveInstanceMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.instance.v1.IMoveInstanceMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MoveInstanceMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MoveInstanceMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.MoveInstanceMetadata; + + /** + * Decodes a MoveInstanceMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MoveInstanceMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.MoveInstanceMetadata; + + /** + * Verifies a MoveInstanceMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MoveInstanceMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MoveInstanceMetadata + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.MoveInstanceMetadata; + + /** + * Creates a plain object from a MoveInstanceMetadata message. Also converts values to other types if specified. + * @param message MoveInstanceMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.instance.v1.MoveInstanceMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MoveInstanceMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MoveInstanceMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + } + + /** Namespace executor. */ + namespace executor { + + /** Namespace v1. */ + namespace v1 { + + /** Represents a SpannerExecutorProxy */ + class SpannerExecutorProxy extends $protobuf.rpc.Service { + + /** + * Constructs a new SpannerExecutorProxy service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new SpannerExecutorProxy 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): SpannerExecutorProxy; + + /** + * Calls ExecuteActionAsync. + * @param request SpannerAsyncActionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SpannerAsyncActionResponse + */ + public executeActionAsync(request: google.spanner.executor.v1.ISpannerAsyncActionRequest, callback: google.spanner.executor.v1.SpannerExecutorProxy.ExecuteActionAsyncCallback): void; + + /** + * Calls ExecuteActionAsync. + * @param request SpannerAsyncActionRequest message or plain object + * @returns Promise + */ + public executeActionAsync(request: google.spanner.executor.v1.ISpannerAsyncActionRequest): Promise; + } + + namespace SpannerExecutorProxy { + + /** + * Callback as used by {@link google.spanner.executor.v1.SpannerExecutorProxy|executeActionAsync}. + * @param error Error, if any + * @param [response] SpannerAsyncActionResponse + */ + type ExecuteActionAsyncCallback = (error: (Error|null), response?: google.spanner.executor.v1.SpannerAsyncActionResponse) => void; + } + + /** Properties of a SpannerAsyncActionRequest. */ + interface ISpannerAsyncActionRequest { + + /** SpannerAsyncActionRequest actionId */ + actionId?: (number|null); + + /** SpannerAsyncActionRequest action */ + action?: (google.spanner.executor.v1.ISpannerAction|null); + } + + /** Represents a SpannerAsyncActionRequest. */ + class SpannerAsyncActionRequest implements ISpannerAsyncActionRequest { + + /** + * Constructs a new SpannerAsyncActionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.executor.v1.ISpannerAsyncActionRequest); + + /** SpannerAsyncActionRequest actionId. */ + public actionId: number; + + /** SpannerAsyncActionRequest action. */ + public action?: (google.spanner.executor.v1.ISpannerAction|null); + + /** + * Creates a new SpannerAsyncActionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SpannerAsyncActionRequest instance + */ + public static create(properties?: google.spanner.executor.v1.ISpannerAsyncActionRequest): google.spanner.executor.v1.SpannerAsyncActionRequest; + + /** + * Encodes the specified SpannerAsyncActionRequest message. Does not implicitly {@link google.spanner.executor.v1.SpannerAsyncActionRequest.verify|verify} messages. + * @param message SpannerAsyncActionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.executor.v1.ISpannerAsyncActionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SpannerAsyncActionRequest message, length delimited. Does not implicitly {@link google.spanner.executor.v1.SpannerAsyncActionRequest.verify|verify} messages. + * @param message SpannerAsyncActionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.executor.v1.ISpannerAsyncActionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SpannerAsyncActionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SpannerAsyncActionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.SpannerAsyncActionRequest; + + /** + * Decodes a SpannerAsyncActionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SpannerAsyncActionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.SpannerAsyncActionRequest; + + /** + * Verifies a SpannerAsyncActionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SpannerAsyncActionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SpannerAsyncActionRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.SpannerAsyncActionRequest; + + /** + * Creates a plain object from a SpannerAsyncActionRequest message. Also converts values to other types if specified. + * @param message SpannerAsyncActionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.executor.v1.SpannerAsyncActionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SpannerAsyncActionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SpannerAsyncActionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SpannerAsyncActionResponse. */ + interface ISpannerAsyncActionResponse { + + /** SpannerAsyncActionResponse actionId */ + actionId?: (number|null); + + /** SpannerAsyncActionResponse outcome */ + outcome?: (google.spanner.executor.v1.ISpannerActionOutcome|null); + } + + /** Represents a SpannerAsyncActionResponse. */ + class SpannerAsyncActionResponse implements ISpannerAsyncActionResponse { + + /** + * Constructs a new SpannerAsyncActionResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.executor.v1.ISpannerAsyncActionResponse); + + /** SpannerAsyncActionResponse actionId. */ + public actionId: number; + + /** SpannerAsyncActionResponse outcome. */ + public outcome?: (google.spanner.executor.v1.ISpannerActionOutcome|null); + + /** + * Creates a new SpannerAsyncActionResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns SpannerAsyncActionResponse instance + */ + public static create(properties?: google.spanner.executor.v1.ISpannerAsyncActionResponse): google.spanner.executor.v1.SpannerAsyncActionResponse; + + /** + * Encodes the specified SpannerAsyncActionResponse message. Does not implicitly {@link google.spanner.executor.v1.SpannerAsyncActionResponse.verify|verify} messages. + * @param message SpannerAsyncActionResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.executor.v1.ISpannerAsyncActionResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SpannerAsyncActionResponse message, length delimited. Does not implicitly {@link google.spanner.executor.v1.SpannerAsyncActionResponse.verify|verify} messages. + * @param message SpannerAsyncActionResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.executor.v1.ISpannerAsyncActionResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SpannerAsyncActionResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SpannerAsyncActionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.SpannerAsyncActionResponse; + + /** + * Decodes a SpannerAsyncActionResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SpannerAsyncActionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.SpannerAsyncActionResponse; + + /** + * Verifies a SpannerAsyncActionResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SpannerAsyncActionResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SpannerAsyncActionResponse + */ + public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.SpannerAsyncActionResponse; + + /** + * Creates a plain object from a SpannerAsyncActionResponse message. Also converts values to other types if specified. + * @param message SpannerAsyncActionResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.executor.v1.SpannerAsyncActionResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SpannerAsyncActionResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SpannerAsyncActionResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SpannerAction. */ + interface ISpannerAction { + + /** SpannerAction databasePath */ + databasePath?: (string|null); + + /** SpannerAction spannerOptions */ + spannerOptions?: (google.spanner.executor.v1.ISpannerOptions|null); + + /** SpannerAction start */ + start?: (google.spanner.executor.v1.IStartTransactionAction|null); + + /** SpannerAction finish */ + finish?: (google.spanner.executor.v1.IFinishTransactionAction|null); + + /** SpannerAction read */ + read?: (google.spanner.executor.v1.IReadAction|null); + + /** SpannerAction query */ + query?: (google.spanner.executor.v1.IQueryAction|null); + + /** SpannerAction mutation */ + mutation?: (google.spanner.executor.v1.IMutationAction|null); + + /** SpannerAction dml */ + dml?: (google.spanner.executor.v1.IDmlAction|null); + + /** SpannerAction batchDml */ + batchDml?: (google.spanner.executor.v1.IBatchDmlAction|null); + + /** SpannerAction write */ + write?: (google.spanner.executor.v1.IWriteMutationsAction|null); + + /** SpannerAction partitionedUpdate */ + partitionedUpdate?: (google.spanner.executor.v1.IPartitionedUpdateAction|null); + + /** SpannerAction admin */ + admin?: (google.spanner.executor.v1.IAdminAction|null); + + /** SpannerAction startBatchTxn */ + startBatchTxn?: (google.spanner.executor.v1.IStartBatchTransactionAction|null); + + /** SpannerAction closeBatchTxn */ + closeBatchTxn?: (google.spanner.executor.v1.ICloseBatchTransactionAction|null); + + /** SpannerAction generateDbPartitionsRead */ + generateDbPartitionsRead?: (google.spanner.executor.v1.IGenerateDbPartitionsForReadAction|null); + + /** SpannerAction generateDbPartitionsQuery */ + generateDbPartitionsQuery?: (google.spanner.executor.v1.IGenerateDbPartitionsForQueryAction|null); + + /** SpannerAction executePartition */ + executePartition?: (google.spanner.executor.v1.IExecutePartitionAction|null); + + /** SpannerAction executeChangeStreamQuery */ + executeChangeStreamQuery?: (google.spanner.executor.v1.IExecuteChangeStreamQuery|null); + + /** SpannerAction queryCancellation */ + queryCancellation?: (google.spanner.executor.v1.IQueryCancellationAction|null); + } + + /** Represents a SpannerAction. */ + class SpannerAction implements ISpannerAction { + + /** + * Constructs a new SpannerAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.executor.v1.ISpannerAction); + + /** SpannerAction databasePath. */ + public databasePath: string; + + /** SpannerAction spannerOptions. */ + public spannerOptions?: (google.spanner.executor.v1.ISpannerOptions|null); + + /** SpannerAction start. */ + public start?: (google.spanner.executor.v1.IStartTransactionAction|null); + + /** SpannerAction finish. */ + public finish?: (google.spanner.executor.v1.IFinishTransactionAction|null); + + /** SpannerAction read. */ + public read?: (google.spanner.executor.v1.IReadAction|null); + + /** SpannerAction query. */ + public query?: (google.spanner.executor.v1.IQueryAction|null); + + /** SpannerAction mutation. */ + public mutation?: (google.spanner.executor.v1.IMutationAction|null); + + /** SpannerAction dml. */ + public dml?: (google.spanner.executor.v1.IDmlAction|null); + + /** SpannerAction batchDml. */ + public batchDml?: (google.spanner.executor.v1.IBatchDmlAction|null); + + /** SpannerAction write. */ + public write?: (google.spanner.executor.v1.IWriteMutationsAction|null); + + /** SpannerAction partitionedUpdate. */ + public partitionedUpdate?: (google.spanner.executor.v1.IPartitionedUpdateAction|null); + + /** SpannerAction admin. */ + public admin?: (google.spanner.executor.v1.IAdminAction|null); + + /** SpannerAction startBatchTxn. */ + public startBatchTxn?: (google.spanner.executor.v1.IStartBatchTransactionAction|null); + + /** SpannerAction closeBatchTxn. */ + public closeBatchTxn?: (google.spanner.executor.v1.ICloseBatchTransactionAction|null); + + /** SpannerAction generateDbPartitionsRead. */ + public generateDbPartitionsRead?: (google.spanner.executor.v1.IGenerateDbPartitionsForReadAction|null); + + /** SpannerAction generateDbPartitionsQuery. */ + public generateDbPartitionsQuery?: (google.spanner.executor.v1.IGenerateDbPartitionsForQueryAction|null); + + /** SpannerAction executePartition. */ + public executePartition?: (google.spanner.executor.v1.IExecutePartitionAction|null); + + /** SpannerAction executeChangeStreamQuery. */ + public executeChangeStreamQuery?: (google.spanner.executor.v1.IExecuteChangeStreamQuery|null); + + /** SpannerAction queryCancellation. */ + public queryCancellation?: (google.spanner.executor.v1.IQueryCancellationAction|null); + + /** SpannerAction action. */ + public action?: ("start"|"finish"|"read"|"query"|"mutation"|"dml"|"batchDml"|"write"|"partitionedUpdate"|"admin"|"startBatchTxn"|"closeBatchTxn"|"generateDbPartitionsRead"|"generateDbPartitionsQuery"|"executePartition"|"executeChangeStreamQuery"|"queryCancellation"); + + /** + * Creates a new SpannerAction instance using the specified properties. + * @param [properties] Properties to set + * @returns SpannerAction instance + */ + public static create(properties?: google.spanner.executor.v1.ISpannerAction): google.spanner.executor.v1.SpannerAction; + + /** + * Encodes the specified SpannerAction message. Does not implicitly {@link google.spanner.executor.v1.SpannerAction.verify|verify} messages. + * @param message SpannerAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.executor.v1.ISpannerAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SpannerAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.SpannerAction.verify|verify} messages. + * @param message SpannerAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.executor.v1.ISpannerAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SpannerAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SpannerAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.SpannerAction; + + /** + * Decodes a SpannerAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SpannerAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.SpannerAction; + + /** + * Verifies a SpannerAction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SpannerAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SpannerAction + */ + public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.SpannerAction; + + /** + * Creates a plain object from a SpannerAction message. Also converts values to other types if specified. + * @param message SpannerAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.executor.v1.SpannerAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SpannerAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SpannerAction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReadAction. */ + interface IReadAction { + + /** ReadAction table */ + table?: (string|null); + + /** ReadAction index */ + index?: (string|null); + + /** ReadAction column */ + column?: (string[]|null); + + /** ReadAction keys */ + keys?: (google.spanner.executor.v1.IKeySet|null); + + /** ReadAction limit */ + limit?: (number|null); + } + + /** Represents a ReadAction. */ + class ReadAction implements IReadAction { + + /** + * Constructs a new ReadAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.executor.v1.IReadAction); + + /** ReadAction table. */ + public table: string; + + /** ReadAction index. */ + public index?: (string|null); + + /** ReadAction column. */ + public column: string[]; + + /** ReadAction keys. */ + public keys?: (google.spanner.executor.v1.IKeySet|null); + + /** ReadAction limit. */ + public limit: number; + + /** + * Creates a new ReadAction instance using the specified properties. + * @param [properties] Properties to set + * @returns ReadAction instance + */ + public static create(properties?: google.spanner.executor.v1.IReadAction): google.spanner.executor.v1.ReadAction; + + /** + * Encodes the specified ReadAction message. Does not implicitly {@link google.spanner.executor.v1.ReadAction.verify|verify} messages. + * @param message ReadAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.executor.v1.IReadAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReadAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.ReadAction.verify|verify} messages. + * @param message ReadAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.executor.v1.IReadAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReadAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReadAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.ReadAction; + + /** + * Decodes a ReadAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReadAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.ReadAction; + + /** + * Verifies a ReadAction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReadAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReadAction + */ + public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.ReadAction; + + /** + * Creates a plain object from a ReadAction message. Also converts values to other types if specified. + * @param message ReadAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.executor.v1.ReadAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReadAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReadAction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a QueryAction. */ + interface IQueryAction { + + /** QueryAction sql */ + sql?: (string|null); + + /** QueryAction params */ + params?: (google.spanner.executor.v1.QueryAction.IParameter[]|null); + } + + /** Represents a QueryAction. */ + class QueryAction implements IQueryAction { + + /** + * Constructs a new QueryAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.executor.v1.IQueryAction); + + /** QueryAction sql. */ + public sql: string; + + /** QueryAction params. */ + public params: google.spanner.executor.v1.QueryAction.IParameter[]; + + /** + * Creates a new QueryAction instance using the specified properties. + * @param [properties] Properties to set + * @returns QueryAction instance + */ + public static create(properties?: google.spanner.executor.v1.IQueryAction): google.spanner.executor.v1.QueryAction; + + /** + * Encodes the specified QueryAction message. Does not implicitly {@link google.spanner.executor.v1.QueryAction.verify|verify} messages. + * @param message QueryAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.executor.v1.IQueryAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QueryAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.QueryAction.verify|verify} messages. + * @param message QueryAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.executor.v1.IQueryAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QueryAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QueryAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.QueryAction; + + /** + * Decodes a QueryAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QueryAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.QueryAction; + + /** + * Verifies a QueryAction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a QueryAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QueryAction + */ + public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.QueryAction; + + /** + * Creates a plain object from a QueryAction message. Also converts values to other types if specified. + * @param message QueryAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.executor.v1.QueryAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QueryAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for QueryAction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace QueryAction { + + /** Properties of a Parameter. */ + interface IParameter { + + /** Parameter name */ + name?: (string|null); + + /** Parameter type */ + type?: (google.spanner.v1.IType|null); + + /** Parameter value */ + value?: (google.spanner.executor.v1.IValue|null); + } + + /** Represents a Parameter. */ + class Parameter implements IParameter { + + /** + * Constructs a new Parameter. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.executor.v1.QueryAction.IParameter); + + /** Parameter name. */ + public name: string; + + /** Parameter type. */ + public type?: (google.spanner.v1.IType|null); + + /** Parameter value. */ + public value?: (google.spanner.executor.v1.IValue|null); + + /** + * Creates a new Parameter instance using the specified properties. + * @param [properties] Properties to set + * @returns Parameter instance + */ + public static create(properties?: google.spanner.executor.v1.QueryAction.IParameter): google.spanner.executor.v1.QueryAction.Parameter; + + /** + * Encodes the specified Parameter message. Does not implicitly {@link google.spanner.executor.v1.QueryAction.Parameter.verify|verify} messages. + * @param message Parameter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.executor.v1.QueryAction.IParameter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Parameter message, length delimited. Does not implicitly {@link google.spanner.executor.v1.QueryAction.Parameter.verify|verify} messages. + * @param message Parameter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.executor.v1.QueryAction.IParameter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Parameter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Parameter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.QueryAction.Parameter; + + /** + * Decodes a Parameter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Parameter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.QueryAction.Parameter; + + /** + * Verifies a Parameter message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Parameter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Parameter + */ + public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.QueryAction.Parameter; + + /** + * Creates a plain object from a Parameter message. Also converts values to other types if specified. + * @param message Parameter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.executor.v1.QueryAction.Parameter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Parameter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Parameter + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a DmlAction. */ + interface IDmlAction { + + /** DmlAction update */ + update?: (google.spanner.executor.v1.IQueryAction|null); + + /** DmlAction autocommitIfSupported */ + autocommitIfSupported?: (boolean|null); + } + + /** Represents a DmlAction. */ + class DmlAction implements IDmlAction { + + /** + * Constructs a new DmlAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.executor.v1.IDmlAction); + + /** DmlAction update. */ + public update?: (google.spanner.executor.v1.IQueryAction|null); + + /** DmlAction autocommitIfSupported. */ + public autocommitIfSupported?: (boolean|null); + + /** + * Creates a new DmlAction instance using the specified properties. + * @param [properties] Properties to set + * @returns DmlAction instance + */ + public static create(properties?: google.spanner.executor.v1.IDmlAction): google.spanner.executor.v1.DmlAction; + + /** + * Encodes the specified DmlAction message. Does not implicitly {@link google.spanner.executor.v1.DmlAction.verify|verify} messages. + * @param message DmlAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.executor.v1.IDmlAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DmlAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.DmlAction.verify|verify} messages. + * @param message DmlAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.executor.v1.IDmlAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DmlAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DmlAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.DmlAction; + + /** + * Decodes a DmlAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DmlAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.DmlAction; + + /** + * Verifies a DmlAction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DmlAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DmlAction + */ + public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.DmlAction; + + /** + * Creates a plain object from a DmlAction message. Also converts values to other types if specified. + * @param message DmlAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.executor.v1.DmlAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DmlAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DmlAction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchDmlAction. */ + interface IBatchDmlAction { + + /** BatchDmlAction updates */ + updates?: (google.spanner.executor.v1.IQueryAction[]|null); + } + + /** Represents a BatchDmlAction. */ + class BatchDmlAction implements IBatchDmlAction { + + /** + * Constructs a new BatchDmlAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.executor.v1.IBatchDmlAction); + + /** BatchDmlAction updates. */ + public updates: google.spanner.executor.v1.IQueryAction[]; + + /** + * Creates a new BatchDmlAction instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchDmlAction instance + */ + public static create(properties?: google.spanner.executor.v1.IBatchDmlAction): google.spanner.executor.v1.BatchDmlAction; + + /** + * Encodes the specified BatchDmlAction message. Does not implicitly {@link google.spanner.executor.v1.BatchDmlAction.verify|verify} messages. + * @param message BatchDmlAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.executor.v1.IBatchDmlAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchDmlAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.BatchDmlAction.verify|verify} messages. + * @param message BatchDmlAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.executor.v1.IBatchDmlAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchDmlAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchDmlAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.BatchDmlAction; + + /** + * Decodes a BatchDmlAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchDmlAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.BatchDmlAction; + + /** + * Verifies a BatchDmlAction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchDmlAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchDmlAction + */ + public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.BatchDmlAction; + + /** + * Creates a plain object from a BatchDmlAction message. Also converts values to other types if specified. + * @param message BatchDmlAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.executor.v1.BatchDmlAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchDmlAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchDmlAction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Value. */ + interface IValue { + + /** Value isNull */ + isNull?: (boolean|null); + + /** Value intValue */ + intValue?: (number|Long|string|null); + + /** Value boolValue */ + boolValue?: (boolean|null); + + /** Value doubleValue */ + doubleValue?: (number|null); + + /** Value bytesValue */ + bytesValue?: (Uint8Array|Buffer|string|null); + + /** Value stringValue */ + stringValue?: (string|null); + + /** Value structValue */ + structValue?: (google.spanner.executor.v1.IValueList|null); + + /** Value timestampValue */ + timestampValue?: (google.protobuf.ITimestamp|null); + + /** Value dateDaysValue */ + dateDaysValue?: (number|null); + + /** Value isCommitTimestamp */ + isCommitTimestamp?: (boolean|null); + + /** Value arrayValue */ + arrayValue?: (google.spanner.executor.v1.IValueList|null); + + /** Value arrayType */ + arrayType?: (google.spanner.v1.IType|null); + } + + /** Represents a Value. */ + class Value implements IValue { + + /** + * Constructs a new Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.executor.v1.IValue); + + /** Value isNull. */ + public isNull?: (boolean|null); + + /** Value intValue. */ + public intValue?: (number|Long|string|null); + + /** Value boolValue. */ + public boolValue?: (boolean|null); + + /** Value doubleValue. */ + public doubleValue?: (number|null); + + /** Value bytesValue. */ + public bytesValue?: (Uint8Array|Buffer|string|null); + + /** Value stringValue. */ + public stringValue?: (string|null); + + /** Value structValue. */ + public structValue?: (google.spanner.executor.v1.IValueList|null); + + /** Value timestampValue. */ + public timestampValue?: (google.protobuf.ITimestamp|null); + + /** Value dateDaysValue. */ + public dateDaysValue?: (number|null); + + /** Value isCommitTimestamp. */ + public isCommitTimestamp?: (boolean|null); + + /** Value arrayValue. */ + public arrayValue?: (google.spanner.executor.v1.IValueList|null); + + /** Value arrayType. */ + public arrayType?: (google.spanner.v1.IType|null); + + /** Value valueType. */ + public valueType?: ("isNull"|"intValue"|"boolValue"|"doubleValue"|"bytesValue"|"stringValue"|"structValue"|"timestampValue"|"dateDaysValue"|"isCommitTimestamp"|"arrayValue"); + + /** + * Creates a new Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Value instance + */ + public static create(properties?: google.spanner.executor.v1.IValue): google.spanner.executor.v1.Value; + + /** + * Encodes the specified Value message. Does not implicitly {@link google.spanner.executor.v1.Value.verify|verify} messages. + * @param message Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.executor.v1.IValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Value message, length delimited. Does not implicitly {@link google.spanner.executor.v1.Value.verify|verify} messages. + * @param message Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.executor.v1.IValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.Value; + + /** + * Decodes a Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.Value; + + /** + * Verifies a Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Value + */ + public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.Value; + + /** + * Creates a plain object from a Value message. Also converts values to other types if specified. + * @param message Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.executor.v1.Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a KeyRange. */ + interface IKeyRange { + + /** KeyRange start */ + start?: (google.spanner.executor.v1.IValueList|null); + + /** KeyRange limit */ + limit?: (google.spanner.executor.v1.IValueList|null); + + /** KeyRange type */ + type?: (google.spanner.executor.v1.KeyRange.Type|keyof typeof google.spanner.executor.v1.KeyRange.Type|null); + } + + /** Represents a KeyRange. */ + class KeyRange implements IKeyRange { + + /** + * Constructs a new KeyRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.executor.v1.IKeyRange); + + /** KeyRange start. */ + public start?: (google.spanner.executor.v1.IValueList|null); + + /** KeyRange limit. */ + public limit?: (google.spanner.executor.v1.IValueList|null); + + /** KeyRange type. */ + public type?: (google.spanner.executor.v1.KeyRange.Type|keyof typeof google.spanner.executor.v1.KeyRange.Type|null); + + /** + * Creates a new KeyRange instance using the specified properties. + * @param [properties] Properties to set + * @returns KeyRange instance + */ + public static create(properties?: google.spanner.executor.v1.IKeyRange): google.spanner.executor.v1.KeyRange; + + /** + * Encodes the specified KeyRange message. Does not implicitly {@link google.spanner.executor.v1.KeyRange.verify|verify} messages. + * @param message KeyRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.executor.v1.IKeyRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified KeyRange message, length delimited. Does not implicitly {@link google.spanner.executor.v1.KeyRange.verify|verify} messages. + * @param message KeyRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.executor.v1.IKeyRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KeyRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns KeyRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.KeyRange; + + /** + * Decodes a KeyRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns KeyRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.KeyRange; + + /** + * Verifies a KeyRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a KeyRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns KeyRange + */ + public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.KeyRange; + + /** + * Creates a plain object from a KeyRange message. Also converts values to other types if specified. + * @param message KeyRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.executor.v1.KeyRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this KeyRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for KeyRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace KeyRange { + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + CLOSED_CLOSED = 1, + CLOSED_OPEN = 2, + OPEN_CLOSED = 3, + OPEN_OPEN = 4 + } + } + + /** Properties of a KeySet. */ + interface IKeySet { + + /** KeySet point */ + point?: (google.spanner.executor.v1.IValueList[]|null); + + /** KeySet range */ + range?: (google.spanner.executor.v1.IKeyRange[]|null); + + /** KeySet all */ + all?: (boolean|null); + } + + /** Represents a KeySet. */ + class KeySet implements IKeySet { + + /** + * Constructs a new KeySet. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.executor.v1.IKeySet); + + /** KeySet point. */ + public point: google.spanner.executor.v1.IValueList[]; + + /** KeySet range. */ + public range: google.spanner.executor.v1.IKeyRange[]; + + /** KeySet all. */ + public all: boolean; + + /** + * Creates a new KeySet instance using the specified properties. + * @param [properties] Properties to set + * @returns KeySet instance + */ + public static create(properties?: google.spanner.executor.v1.IKeySet): google.spanner.executor.v1.KeySet; + + /** + * Encodes the specified KeySet message. Does not implicitly {@link google.spanner.executor.v1.KeySet.verify|verify} messages. + * @param message KeySet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.executor.v1.IKeySet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified KeySet message, length delimited. Does not implicitly {@link google.spanner.executor.v1.KeySet.verify|verify} messages. + * @param message KeySet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.executor.v1.IKeySet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KeySet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns KeySet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.KeySet; + + /** + * Decodes a KeySet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns KeySet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.KeySet; + + /** + * Verifies a KeySet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a KeySet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns KeySet + */ + public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.KeySet; + + /** + * Creates a plain object from a KeySet message. Also converts values to other types if specified. + * @param message KeySet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.executor.v1.KeySet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this KeySet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for KeySet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ValueList. */ + interface IValueList { + + /** ValueList value */ + value?: (google.spanner.executor.v1.IValue[]|null); + } + + /** Represents a ValueList. */ + class ValueList implements IValueList { + + /** + * Constructs a new ValueList. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.executor.v1.IValueList); + + /** ValueList value. */ + public value: google.spanner.executor.v1.IValue[]; + + /** + * Creates a new ValueList instance using the specified properties. + * @param [properties] Properties to set + * @returns ValueList instance + */ + public static create(properties?: google.spanner.executor.v1.IValueList): google.spanner.executor.v1.ValueList; + + /** + * Encodes the specified ValueList message. Does not implicitly {@link google.spanner.executor.v1.ValueList.verify|verify} messages. + * @param message ValueList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.executor.v1.IValueList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ValueList message, length delimited. Does not implicitly {@link google.spanner.executor.v1.ValueList.verify|verify} messages. + * @param message ValueList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.executor.v1.IValueList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ValueList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ValueList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.ValueList; + + /** + * Decodes a ValueList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ValueList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.ValueList; + + /** + * Verifies a ValueList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ValueList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ValueList + */ + public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.ValueList; + + /** + * Creates a plain object from a ValueList message. Also converts values to other types if specified. + * @param message ValueList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.executor.v1.ValueList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ValueList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ValueList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MutationAction. */ + interface IMutationAction { + + /** MutationAction mod */ + mod?: (google.spanner.executor.v1.MutationAction.IMod[]|null); + } + + /** Represents a MutationAction. */ + class MutationAction implements IMutationAction { + + /** + * Constructs a new MutationAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.executor.v1.IMutationAction); + + /** MutationAction mod. */ + public mod: google.spanner.executor.v1.MutationAction.IMod[]; + + /** + * Creates a new MutationAction instance using the specified properties. + * @param [properties] Properties to set + * @returns MutationAction instance + */ + public static create(properties?: google.spanner.executor.v1.IMutationAction): google.spanner.executor.v1.MutationAction; + + /** + * Encodes the specified MutationAction message. Does not implicitly {@link google.spanner.executor.v1.MutationAction.verify|verify} messages. + * @param message MutationAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.executor.v1.IMutationAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MutationAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.MutationAction.verify|verify} messages. + * @param message MutationAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.executor.v1.IMutationAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MutationAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MutationAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.MutationAction; + + /** + * Decodes a MutationAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MutationAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.MutationAction; + + /** + * Verifies a MutationAction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MutationAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MutationAction + */ + public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.MutationAction; + + /** + * Creates a plain object from a MutationAction message. Also converts values to other types if specified. + * @param message MutationAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.executor.v1.MutationAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MutationAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MutationAction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MutationAction { + + /** Properties of an InsertArgs. */ + interface IInsertArgs { + + /** InsertArgs column */ + column?: (string[]|null); + + /** InsertArgs type */ + type?: (google.spanner.v1.IType[]|null); + + /** InsertArgs values */ + values?: (google.spanner.executor.v1.IValueList[]|null); + } + + /** Represents an InsertArgs. */ + class InsertArgs implements IInsertArgs { + + /** + * Constructs a new InsertArgs. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.executor.v1.MutationAction.IInsertArgs); + + /** InsertArgs column. */ + public column: string[]; + + /** InsertArgs type. */ + public type: google.spanner.v1.IType[]; + + /** InsertArgs values. */ + public values: google.spanner.executor.v1.IValueList[]; + + /** + * Creates a new InsertArgs instance using the specified properties. + * @param [properties] Properties to set + * @returns InsertArgs instance + */ + public static create(properties?: google.spanner.executor.v1.MutationAction.IInsertArgs): google.spanner.executor.v1.MutationAction.InsertArgs; + + /** + * Encodes the specified InsertArgs message. Does not implicitly {@link google.spanner.executor.v1.MutationAction.InsertArgs.verify|verify} messages. + * @param message InsertArgs message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.executor.v1.MutationAction.IInsertArgs, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InsertArgs message, length delimited. Does not implicitly {@link google.spanner.executor.v1.MutationAction.InsertArgs.verify|verify} messages. + * @param message InsertArgs message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.executor.v1.MutationAction.IInsertArgs, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InsertArgs message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InsertArgs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.MutationAction.InsertArgs; + + /** + * Decodes an InsertArgs message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InsertArgs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.MutationAction.InsertArgs; + + /** + * Verifies an InsertArgs message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InsertArgs message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InsertArgs + */ + public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.MutationAction.InsertArgs; + + /** + * Creates a plain object from an InsertArgs message. Also converts values to other types if specified. + * @param message InsertArgs + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.executor.v1.MutationAction.InsertArgs, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InsertArgs to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InsertArgs + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateArgs. */ + interface IUpdateArgs { + + /** UpdateArgs column */ + column?: (string[]|null); + + /** UpdateArgs type */ + type?: (google.spanner.v1.IType[]|null); + + /** UpdateArgs values */ + values?: (google.spanner.executor.v1.IValueList[]|null); + } + + /** Represents an UpdateArgs. */ + class UpdateArgs implements IUpdateArgs { + + /** + * Constructs a new UpdateArgs. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.executor.v1.MutationAction.IUpdateArgs); + + /** UpdateArgs column. */ + public column: string[]; + + /** UpdateArgs type. */ + public type: google.spanner.v1.IType[]; + + /** UpdateArgs values. */ + public values: google.spanner.executor.v1.IValueList[]; + + /** + * Creates a new UpdateArgs instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateArgs instance + */ + public static create(properties?: google.spanner.executor.v1.MutationAction.IUpdateArgs): google.spanner.executor.v1.MutationAction.UpdateArgs; + + /** + * Encodes the specified UpdateArgs message. Does not implicitly {@link google.spanner.executor.v1.MutationAction.UpdateArgs.verify|verify} messages. + * @param message UpdateArgs message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.executor.v1.MutationAction.IUpdateArgs, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateArgs message, length delimited. Does not implicitly {@link google.spanner.executor.v1.MutationAction.UpdateArgs.verify|verify} messages. + * @param message UpdateArgs message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.executor.v1.MutationAction.IUpdateArgs, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateArgs message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateArgs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.MutationAction.UpdateArgs; + + /** + * Decodes an UpdateArgs message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateArgs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.MutationAction.UpdateArgs; + + /** + * Verifies an UpdateArgs message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateArgs message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateArgs + */ + public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.MutationAction.UpdateArgs; + + /** + * Creates a plain object from an UpdateArgs message. Also converts values to other types if specified. + * @param message UpdateArgs + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.executor.v1.MutationAction.UpdateArgs, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateArgs to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateArgs + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Mod. */ + interface IMod { + + /** Mod table */ + table?: (string|null); + + /** Mod insert */ + insert?: (google.spanner.executor.v1.MutationAction.IInsertArgs|null); + + /** Mod update */ + update?: (google.spanner.executor.v1.MutationAction.IUpdateArgs|null); + + /** Mod insertOrUpdate */ + insertOrUpdate?: (google.spanner.executor.v1.MutationAction.IInsertArgs|null); + + /** Mod replace */ + replace?: (google.spanner.executor.v1.MutationAction.IInsertArgs|null); + + /** Mod deleteKeys */ + deleteKeys?: (google.spanner.executor.v1.IKeySet|null); + } + + /** Represents a Mod. */ + class Mod implements IMod { + + /** + * Constructs a new Mod. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.executor.v1.MutationAction.IMod); + + /** Mod table. */ + public table: string; + + /** Mod insert. */ + public insert?: (google.spanner.executor.v1.MutationAction.IInsertArgs|null); + + /** Mod update. */ + public update?: (google.spanner.executor.v1.MutationAction.IUpdateArgs|null); + + /** Mod insertOrUpdate. */ + public insertOrUpdate?: (google.spanner.executor.v1.MutationAction.IInsertArgs|null); + + /** Mod replace. */ + public replace?: (google.spanner.executor.v1.MutationAction.IInsertArgs|null); + + /** Mod deleteKeys. */ + public deleteKeys?: (google.spanner.executor.v1.IKeySet|null); + + /** + * Creates a new Mod instance using the specified properties. + * @param [properties] Properties to set + * @returns Mod instance + */ + public static create(properties?: google.spanner.executor.v1.MutationAction.IMod): google.spanner.executor.v1.MutationAction.Mod; + + /** + * Encodes the specified Mod message. Does not implicitly {@link google.spanner.executor.v1.MutationAction.Mod.verify|verify} messages. + * @param message Mod message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.executor.v1.MutationAction.IMod, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Mod message, length delimited. Does not implicitly {@link google.spanner.executor.v1.MutationAction.Mod.verify|verify} messages. + * @param message Mod message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.executor.v1.MutationAction.IMod, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Mod message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Mod + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.MutationAction.Mod; + + /** + * Decodes a Mod message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Mod + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.MutationAction.Mod; + + /** + * Verifies a Mod message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Mod message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Mod + */ + public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.MutationAction.Mod; + + /** + * Creates a plain object from a Mod message. Also converts values to other types if specified. + * @param message Mod + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.executor.v1.MutationAction.Mod, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Mod to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Mod + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a WriteMutationsAction. */ + interface IWriteMutationsAction { + + /** WriteMutationsAction mutation */ + mutation?: (google.spanner.executor.v1.IMutationAction|null); + } + + /** Represents a WriteMutationsAction. */ + class WriteMutationsAction implements IWriteMutationsAction { + + /** + * Constructs a new WriteMutationsAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.executor.v1.IWriteMutationsAction); + + /** WriteMutationsAction mutation. */ + public mutation?: (google.spanner.executor.v1.IMutationAction|null); + + /** + * Creates a new WriteMutationsAction instance using the specified properties. + * @param [properties] Properties to set + * @returns WriteMutationsAction instance + */ + public static create(properties?: google.spanner.executor.v1.IWriteMutationsAction): google.spanner.executor.v1.WriteMutationsAction; + + /** + * Encodes the specified WriteMutationsAction message. Does not implicitly {@link google.spanner.executor.v1.WriteMutationsAction.verify|verify} messages. + * @param message WriteMutationsAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.executor.v1.IWriteMutationsAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WriteMutationsAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.WriteMutationsAction.verify|verify} messages. + * @param message WriteMutationsAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.executor.v1.IWriteMutationsAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WriteMutationsAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WriteMutationsAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.WriteMutationsAction; + + /** + * Decodes a WriteMutationsAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WriteMutationsAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.WriteMutationsAction; + + /** + * Verifies a WriteMutationsAction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WriteMutationsAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WriteMutationsAction + */ + public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.WriteMutationsAction; + + /** + * Creates a plain object from a WriteMutationsAction message. Also converts values to other types if specified. + * @param message WriteMutationsAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.executor.v1.WriteMutationsAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WriteMutationsAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WriteMutationsAction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PartitionedUpdateAction. */ + interface IPartitionedUpdateAction { + + /** PartitionedUpdateAction options */ + options?: (google.spanner.executor.v1.PartitionedUpdateAction.IExecutePartitionedUpdateOptions|null); + + /** PartitionedUpdateAction update */ + update?: (google.spanner.executor.v1.IQueryAction|null); + } + + /** Represents a PartitionedUpdateAction. */ + class PartitionedUpdateAction implements IPartitionedUpdateAction { + + /** + * Constructs a new PartitionedUpdateAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.executor.v1.IPartitionedUpdateAction); + + /** PartitionedUpdateAction options. */ + public options?: (google.spanner.executor.v1.PartitionedUpdateAction.IExecutePartitionedUpdateOptions|null); + + /** PartitionedUpdateAction update. */ + public update?: (google.spanner.executor.v1.IQueryAction|null); + + /** + * Creates a new PartitionedUpdateAction instance using the specified properties. + * @param [properties] Properties to set + * @returns PartitionedUpdateAction instance + */ + public static create(properties?: google.spanner.executor.v1.IPartitionedUpdateAction): google.spanner.executor.v1.PartitionedUpdateAction; + + /** + * Encodes the specified PartitionedUpdateAction message. Does not implicitly {@link google.spanner.executor.v1.PartitionedUpdateAction.verify|verify} messages. + * @param message PartitionedUpdateAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.executor.v1.IPartitionedUpdateAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PartitionedUpdateAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.PartitionedUpdateAction.verify|verify} messages. + * @param message PartitionedUpdateAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.executor.v1.IPartitionedUpdateAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PartitionedUpdateAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PartitionedUpdateAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.PartitionedUpdateAction; + + /** + * Decodes a PartitionedUpdateAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PartitionedUpdateAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.PartitionedUpdateAction; + + /** + * Verifies a PartitionedUpdateAction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PartitionedUpdateAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PartitionedUpdateAction + */ + public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.PartitionedUpdateAction; + + /** + * Creates a plain object from a PartitionedUpdateAction message. Also converts values to other types if specified. + * @param message PartitionedUpdateAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.executor.v1.PartitionedUpdateAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PartitionedUpdateAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PartitionedUpdateAction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace PartitionedUpdateAction { + + /** Properties of an ExecutePartitionedUpdateOptions. */ + interface IExecutePartitionedUpdateOptions { + + /** ExecutePartitionedUpdateOptions rpcPriority */ + rpcPriority?: (google.spanner.v1.RequestOptions.Priority|keyof typeof google.spanner.v1.RequestOptions.Priority|null); + + /** ExecutePartitionedUpdateOptions tag */ + tag?: (string|null); + } + + /** Represents an ExecutePartitionedUpdateOptions. */ + class ExecutePartitionedUpdateOptions implements IExecutePartitionedUpdateOptions { + + /** + * Constructs a new ExecutePartitionedUpdateOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.executor.v1.PartitionedUpdateAction.IExecutePartitionedUpdateOptions); + + /** ExecutePartitionedUpdateOptions rpcPriority. */ + public rpcPriority?: (google.spanner.v1.RequestOptions.Priority|keyof typeof google.spanner.v1.RequestOptions.Priority|null); + + /** ExecutePartitionedUpdateOptions tag. */ + public tag?: (string|null); + + /** + * Creates a new ExecutePartitionedUpdateOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ExecutePartitionedUpdateOptions instance + */ + public static create(properties?: google.spanner.executor.v1.PartitionedUpdateAction.IExecutePartitionedUpdateOptions): google.spanner.executor.v1.PartitionedUpdateAction.ExecutePartitionedUpdateOptions; + + /** + * Encodes the specified ExecutePartitionedUpdateOptions message. Does not implicitly {@link google.spanner.executor.v1.PartitionedUpdateAction.ExecutePartitionedUpdateOptions.verify|verify} messages. + * @param message ExecutePartitionedUpdateOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.executor.v1.PartitionedUpdateAction.IExecutePartitionedUpdateOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExecutePartitionedUpdateOptions message, length delimited. Does not implicitly {@link google.spanner.executor.v1.PartitionedUpdateAction.ExecutePartitionedUpdateOptions.verify|verify} messages. + * @param message ExecutePartitionedUpdateOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.executor.v1.PartitionedUpdateAction.IExecutePartitionedUpdateOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExecutePartitionedUpdateOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExecutePartitionedUpdateOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.PartitionedUpdateAction.ExecutePartitionedUpdateOptions; + + /** + * Decodes an ExecutePartitionedUpdateOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExecutePartitionedUpdateOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.PartitionedUpdateAction.ExecutePartitionedUpdateOptions; + + /** + * Verifies an ExecutePartitionedUpdateOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExecutePartitionedUpdateOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExecutePartitionedUpdateOptions + */ + public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.PartitionedUpdateAction.ExecutePartitionedUpdateOptions; + + /** + * Creates a plain object from an ExecutePartitionedUpdateOptions message. Also converts values to other types if specified. + * @param message ExecutePartitionedUpdateOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.executor.v1.PartitionedUpdateAction.ExecutePartitionedUpdateOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExecutePartitionedUpdateOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExecutePartitionedUpdateOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a StartTransactionAction. */ + interface IStartTransactionAction { + + /** StartTransactionAction concurrency */ + concurrency?: (google.spanner.executor.v1.IConcurrency|null); + + /** StartTransactionAction table */ + table?: (google.spanner.executor.v1.ITableMetadata[]|null); + + /** StartTransactionAction transactionSeed */ + transactionSeed?: (string|null); + + /** StartTransactionAction executionOptions */ + executionOptions?: (google.spanner.executor.v1.ITransactionExecutionOptions|null); + } + + /** Represents a StartTransactionAction. */ + class StartTransactionAction implements IStartTransactionAction { + + /** + * Constructs a new StartTransactionAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.executor.v1.IStartTransactionAction); + + /** StartTransactionAction concurrency. */ + public concurrency?: (google.spanner.executor.v1.IConcurrency|null); + + /** StartTransactionAction table. */ + public table: google.spanner.executor.v1.ITableMetadata[]; + + /** StartTransactionAction transactionSeed. */ + public transactionSeed: string; + + /** StartTransactionAction executionOptions. */ + public executionOptions?: (google.spanner.executor.v1.ITransactionExecutionOptions|null); + + /** + * Creates a new StartTransactionAction instance using the specified properties. + * @param [properties] Properties to set + * @returns StartTransactionAction instance + */ + public static create(properties?: google.spanner.executor.v1.IStartTransactionAction): google.spanner.executor.v1.StartTransactionAction; + + /** + * Encodes the specified StartTransactionAction message. Does not implicitly {@link google.spanner.executor.v1.StartTransactionAction.verify|verify} messages. + * @param message StartTransactionAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.executor.v1.IStartTransactionAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StartTransactionAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.StartTransactionAction.verify|verify} messages. + * @param message StartTransactionAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.executor.v1.IStartTransactionAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StartTransactionAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StartTransactionAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.StartTransactionAction; + + /** + * Decodes a StartTransactionAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StartTransactionAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.StartTransactionAction; + + /** + * Verifies a StartTransactionAction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StartTransactionAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StartTransactionAction + */ + public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.StartTransactionAction; + + /** + * Creates a plain object from a StartTransactionAction message. Also converts values to other types if specified. + * @param message StartTransactionAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.executor.v1.StartTransactionAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StartTransactionAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StartTransactionAction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Concurrency. */ + interface IConcurrency { + + /** Concurrency stalenessSeconds */ + stalenessSeconds?: (number|null); + + /** Concurrency minReadTimestampMicros */ + minReadTimestampMicros?: (number|Long|string|null); + + /** Concurrency maxStalenessSeconds */ + maxStalenessSeconds?: (number|null); + + /** Concurrency exactTimestampMicros */ + exactTimestampMicros?: (number|Long|string|null); + + /** Concurrency strong */ + strong?: (boolean|null); + + /** Concurrency batch */ + batch?: (boolean|null); + + /** Concurrency snapshotEpochRead */ + snapshotEpochRead?: (boolean|null); + + /** Concurrency snapshotEpochRootTable */ + snapshotEpochRootTable?: (string|null); + + /** Concurrency batchReadTimestampMicros */ + batchReadTimestampMicros?: (number|Long|string|null); + } + + /** Represents a Concurrency. */ + class Concurrency implements IConcurrency { + + /** + * Constructs a new Concurrency. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.executor.v1.IConcurrency); + + /** Concurrency stalenessSeconds. */ + public stalenessSeconds?: (number|null); + + /** Concurrency minReadTimestampMicros. */ + public minReadTimestampMicros?: (number|Long|string|null); + + /** Concurrency maxStalenessSeconds. */ + public maxStalenessSeconds?: (number|null); + + /** Concurrency exactTimestampMicros. */ + public exactTimestampMicros?: (number|Long|string|null); + + /** Concurrency strong. */ + public strong?: (boolean|null); + + /** Concurrency batch. */ + public batch?: (boolean|null); + + /** Concurrency snapshotEpochRead. */ + public snapshotEpochRead: boolean; + + /** Concurrency snapshotEpochRootTable. */ + public snapshotEpochRootTable: string; + + /** Concurrency batchReadTimestampMicros. */ + public batchReadTimestampMicros: (number|Long|string); + + /** Concurrency concurrencyMode. */ + public concurrencyMode?: ("stalenessSeconds"|"minReadTimestampMicros"|"maxStalenessSeconds"|"exactTimestampMicros"|"strong"|"batch"); + + /** + * Creates a new Concurrency instance using the specified properties. + * @param [properties] Properties to set + * @returns Concurrency instance + */ + public static create(properties?: google.spanner.executor.v1.IConcurrency): google.spanner.executor.v1.Concurrency; + + /** + * Encodes the specified Concurrency message. Does not implicitly {@link google.spanner.executor.v1.Concurrency.verify|verify} messages. + * @param message Concurrency message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.executor.v1.IConcurrency, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Concurrency message, length delimited. Does not implicitly {@link google.spanner.executor.v1.Concurrency.verify|verify} messages. + * @param message Concurrency message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.executor.v1.IConcurrency, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Concurrency message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Concurrency + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.Concurrency; + + /** + * Decodes a Concurrency message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Concurrency + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.Concurrency; + + /** + * Verifies a Concurrency message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Concurrency message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Concurrency + */ + public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.Concurrency; + + /** + * Creates a plain object from a Concurrency message. Also converts values to other types if specified. + * @param message Concurrency + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.executor.v1.Concurrency, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Concurrency to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Concurrency + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TableMetadata. */ + interface ITableMetadata { + + /** TableMetadata name */ + name?: (string|null); + + /** TableMetadata column */ + column?: (google.spanner.executor.v1.IColumnMetadata[]|null); + + /** TableMetadata keyColumn */ + keyColumn?: (google.spanner.executor.v1.IColumnMetadata[]|null); + } + + /** Represents a TableMetadata. */ + class TableMetadata implements ITableMetadata { + + /** + * Constructs a new TableMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.executor.v1.ITableMetadata); + + /** TableMetadata name. */ + public name: string; + + /** TableMetadata column. */ + public column: google.spanner.executor.v1.IColumnMetadata[]; + + /** TableMetadata keyColumn. */ + public keyColumn: google.spanner.executor.v1.IColumnMetadata[]; + + /** + * Creates a new TableMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns TableMetadata instance + */ + public static create(properties?: google.spanner.executor.v1.ITableMetadata): google.spanner.executor.v1.TableMetadata; + + /** + * Encodes the specified TableMetadata message. Does not implicitly {@link google.spanner.executor.v1.TableMetadata.verify|verify} messages. + * @param message TableMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.executor.v1.ITableMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TableMetadata message, length delimited. Does not implicitly {@link google.spanner.executor.v1.TableMetadata.verify|verify} messages. + * @param message TableMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.executor.v1.ITableMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TableMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TableMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.TableMetadata; + + /** + * Decodes a TableMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TableMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.TableMetadata; + + /** + * Verifies a TableMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TableMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TableMetadata + */ + public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.TableMetadata; + + /** + * Creates a plain object from a TableMetadata message. Also converts values to other types if specified. + * @param message TableMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.executor.v1.TableMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TableMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TableMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ColumnMetadata. */ + interface IColumnMetadata { + + /** ColumnMetadata name */ + name?: (string|null); + + /** ColumnMetadata type */ + type?: (google.spanner.v1.IType|null); + } + + /** Represents a ColumnMetadata. */ + class ColumnMetadata implements IColumnMetadata { + + /** + * Constructs a new ColumnMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.executor.v1.IColumnMetadata); + + /** ColumnMetadata name. */ + public name: string; + + /** ColumnMetadata type. */ + public type?: (google.spanner.v1.IType|null); + + /** + * Creates a new ColumnMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ColumnMetadata instance + */ + public static create(properties?: google.spanner.executor.v1.IColumnMetadata): google.spanner.executor.v1.ColumnMetadata; + + /** + * Encodes the specified ColumnMetadata message. Does not implicitly {@link google.spanner.executor.v1.ColumnMetadata.verify|verify} messages. + * @param message ColumnMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.executor.v1.IColumnMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ColumnMetadata message, length delimited. Does not implicitly {@link google.spanner.executor.v1.ColumnMetadata.verify|verify} messages. + * @param message ColumnMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.executor.v1.IColumnMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ColumnMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ColumnMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.ColumnMetadata; + + /** + * Decodes a ColumnMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ColumnMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.ColumnMetadata; + + /** + * Verifies a ColumnMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ColumnMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ColumnMetadata + */ + public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.ColumnMetadata; + + /** + * Creates a plain object from a ColumnMetadata message. Also converts values to other types if specified. + * @param message ColumnMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.executor.v1.ColumnMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ColumnMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ColumnMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionExecutionOptions. */ + interface ITransactionExecutionOptions { + + /** TransactionExecutionOptions optimistic */ + optimistic?: (boolean|null); + } + + /** Represents a TransactionExecutionOptions. */ + class TransactionExecutionOptions implements ITransactionExecutionOptions { + + /** + * Constructs a new TransactionExecutionOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.executor.v1.ITransactionExecutionOptions); + + /** TransactionExecutionOptions optimistic. */ + public optimistic: boolean; + + /** + * Creates a new TransactionExecutionOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionExecutionOptions instance + */ + public static create(properties?: google.spanner.executor.v1.ITransactionExecutionOptions): google.spanner.executor.v1.TransactionExecutionOptions; + + /** + * Encodes the specified TransactionExecutionOptions message. Does not implicitly {@link google.spanner.executor.v1.TransactionExecutionOptions.verify|verify} messages. + * @param message TransactionExecutionOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.executor.v1.ITransactionExecutionOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TransactionExecutionOptions message, length delimited. Does not implicitly {@link google.spanner.executor.v1.TransactionExecutionOptions.verify|verify} messages. + * @param message TransactionExecutionOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.executor.v1.ITransactionExecutionOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionExecutionOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TransactionExecutionOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.TransactionExecutionOptions; + + /** + * Decodes a TransactionExecutionOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TransactionExecutionOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.TransactionExecutionOptions; + + /** + * Verifies a TransactionExecutionOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TransactionExecutionOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TransactionExecutionOptions + */ + public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.TransactionExecutionOptions; + + /** + * Creates a plain object from a TransactionExecutionOptions message. Also converts values to other types if specified. + * @param message TransactionExecutionOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.executor.v1.TransactionExecutionOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TransactionExecutionOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TransactionExecutionOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FinishTransactionAction. */ + interface IFinishTransactionAction { + + /** FinishTransactionAction mode */ + mode?: (google.spanner.executor.v1.FinishTransactionAction.Mode|keyof typeof google.spanner.executor.v1.FinishTransactionAction.Mode|null); + } + + /** Represents a FinishTransactionAction. */ + class FinishTransactionAction implements IFinishTransactionAction { + + /** + * Constructs a new FinishTransactionAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.executor.v1.IFinishTransactionAction); + + /** FinishTransactionAction mode. */ + public mode: (google.spanner.executor.v1.FinishTransactionAction.Mode|keyof typeof google.spanner.executor.v1.FinishTransactionAction.Mode); + + /** + * Creates a new FinishTransactionAction instance using the specified properties. + * @param [properties] Properties to set + * @returns FinishTransactionAction instance + */ + public static create(properties?: google.spanner.executor.v1.IFinishTransactionAction): google.spanner.executor.v1.FinishTransactionAction; + + /** + * Encodes the specified FinishTransactionAction message. Does not implicitly {@link google.spanner.executor.v1.FinishTransactionAction.verify|verify} messages. + * @param message FinishTransactionAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.executor.v1.IFinishTransactionAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FinishTransactionAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.FinishTransactionAction.verify|verify} messages. + * @param message FinishTransactionAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.executor.v1.IFinishTransactionAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FinishTransactionAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FinishTransactionAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.FinishTransactionAction; + + /** + * Decodes a FinishTransactionAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FinishTransactionAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.FinishTransactionAction; + + /** + * Verifies a FinishTransactionAction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FinishTransactionAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FinishTransactionAction + */ + public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.FinishTransactionAction; + + /** + * Creates a plain object from a FinishTransactionAction message. Also converts values to other types if specified. + * @param message FinishTransactionAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.executor.v1.FinishTransactionAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FinishTransactionAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FinishTransactionAction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FinishTransactionAction { + + /** Mode enum. */ + enum Mode { + MODE_UNSPECIFIED = 0, + COMMIT = 1, + ABANDON = 2 + } + } + + /** Properties of an AdminAction. */ + interface IAdminAction { + + /** AdminAction createUserInstanceConfig */ + createUserInstanceConfig?: (google.spanner.executor.v1.ICreateUserInstanceConfigAction|null); + + /** AdminAction updateUserInstanceConfig */ + updateUserInstanceConfig?: (google.spanner.executor.v1.IUpdateUserInstanceConfigAction|null); + + /** AdminAction deleteUserInstanceConfig */ + deleteUserInstanceConfig?: (google.spanner.executor.v1.IDeleteUserInstanceConfigAction|null); + + /** AdminAction getCloudInstanceConfig */ + getCloudInstanceConfig?: (google.spanner.executor.v1.IGetCloudInstanceConfigAction|null); + + /** AdminAction listInstanceConfigs */ + listInstanceConfigs?: (google.spanner.executor.v1.IListCloudInstanceConfigsAction|null); + + /** AdminAction createCloudInstance */ + createCloudInstance?: (google.spanner.executor.v1.ICreateCloudInstanceAction|null); + + /** AdminAction updateCloudInstance */ + updateCloudInstance?: (google.spanner.executor.v1.IUpdateCloudInstanceAction|null); + + /** AdminAction deleteCloudInstance */ + deleteCloudInstance?: (google.spanner.executor.v1.IDeleteCloudInstanceAction|null); + + /** AdminAction listCloudInstances */ + listCloudInstances?: (google.spanner.executor.v1.IListCloudInstancesAction|null); + + /** AdminAction getCloudInstance */ + getCloudInstance?: (google.spanner.executor.v1.IGetCloudInstanceAction|null); + + /** AdminAction createCloudDatabase */ + createCloudDatabase?: (google.spanner.executor.v1.ICreateCloudDatabaseAction|null); + + /** AdminAction updateCloudDatabaseDdl */ + updateCloudDatabaseDdl?: (google.spanner.executor.v1.IUpdateCloudDatabaseDdlAction|null); + + /** AdminAction updateCloudDatabase */ + updateCloudDatabase?: (google.spanner.executor.v1.IUpdateCloudDatabaseAction|null); + + /** AdminAction dropCloudDatabase */ + dropCloudDatabase?: (google.spanner.executor.v1.IDropCloudDatabaseAction|null); + + /** AdminAction listCloudDatabases */ + listCloudDatabases?: (google.spanner.executor.v1.IListCloudDatabasesAction|null); + + /** AdminAction listCloudDatabaseOperations */ + listCloudDatabaseOperations?: (google.spanner.executor.v1.IListCloudDatabaseOperationsAction|null); + + /** AdminAction restoreCloudDatabase */ + restoreCloudDatabase?: (google.spanner.executor.v1.IRestoreCloudDatabaseAction|null); + + /** AdminAction getCloudDatabase */ + getCloudDatabase?: (google.spanner.executor.v1.IGetCloudDatabaseAction|null); + + /** AdminAction createCloudBackup */ + createCloudBackup?: (google.spanner.executor.v1.ICreateCloudBackupAction|null); + + /** AdminAction copyCloudBackup */ + copyCloudBackup?: (google.spanner.executor.v1.ICopyCloudBackupAction|null); + + /** AdminAction getCloudBackup */ + getCloudBackup?: (google.spanner.executor.v1.IGetCloudBackupAction|null); + + /** AdminAction updateCloudBackup */ + updateCloudBackup?: (google.spanner.executor.v1.IUpdateCloudBackupAction|null); + + /** AdminAction deleteCloudBackup */ + deleteCloudBackup?: (google.spanner.executor.v1.IDeleteCloudBackupAction|null); + + /** AdminAction listCloudBackups */ + listCloudBackups?: (google.spanner.executor.v1.IListCloudBackupsAction|null); + + /** AdminAction listCloudBackupOperations */ + listCloudBackupOperations?: (google.spanner.executor.v1.IListCloudBackupOperationsAction|null); + + /** AdminAction getOperation */ + getOperation?: (google.spanner.executor.v1.IGetOperationAction|null); + + /** AdminAction cancelOperation */ + cancelOperation?: (google.spanner.executor.v1.ICancelOperationAction|null); + + /** AdminAction changeQuorumCloudDatabase */ + changeQuorumCloudDatabase?: (google.spanner.executor.v1.IChangeQuorumCloudDatabaseAction|null); + } + + /** Represents an AdminAction. */ + class AdminAction implements IAdminAction { + + /** + * Constructs a new AdminAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.executor.v1.IAdminAction); + + /** AdminAction createUserInstanceConfig. */ + public createUserInstanceConfig?: (google.spanner.executor.v1.ICreateUserInstanceConfigAction|null); + + /** AdminAction updateUserInstanceConfig. */ + public updateUserInstanceConfig?: (google.spanner.executor.v1.IUpdateUserInstanceConfigAction|null); + + /** AdminAction deleteUserInstanceConfig. */ + public deleteUserInstanceConfig?: (google.spanner.executor.v1.IDeleteUserInstanceConfigAction|null); + + /** AdminAction getCloudInstanceConfig. */ + public getCloudInstanceConfig?: (google.spanner.executor.v1.IGetCloudInstanceConfigAction|null); + + /** AdminAction listInstanceConfigs. */ + public listInstanceConfigs?: (google.spanner.executor.v1.IListCloudInstanceConfigsAction|null); + + /** AdminAction createCloudInstance. */ + public createCloudInstance?: (google.spanner.executor.v1.ICreateCloudInstanceAction|null); + + /** AdminAction updateCloudInstance. */ + public updateCloudInstance?: (google.spanner.executor.v1.IUpdateCloudInstanceAction|null); + + /** AdminAction deleteCloudInstance. */ + public deleteCloudInstance?: (google.spanner.executor.v1.IDeleteCloudInstanceAction|null); + + /** AdminAction listCloudInstances. */ + public listCloudInstances?: (google.spanner.executor.v1.IListCloudInstancesAction|null); + + /** AdminAction getCloudInstance. */ + public getCloudInstance?: (google.spanner.executor.v1.IGetCloudInstanceAction|null); + + /** AdminAction createCloudDatabase. */ + public createCloudDatabase?: (google.spanner.executor.v1.ICreateCloudDatabaseAction|null); + + /** AdminAction updateCloudDatabaseDdl. */ + public updateCloudDatabaseDdl?: (google.spanner.executor.v1.IUpdateCloudDatabaseDdlAction|null); + + /** AdminAction updateCloudDatabase. */ + public updateCloudDatabase?: (google.spanner.executor.v1.IUpdateCloudDatabaseAction|null); + + /** AdminAction dropCloudDatabase. */ + public dropCloudDatabase?: (google.spanner.executor.v1.IDropCloudDatabaseAction|null); + + /** AdminAction listCloudDatabases. */ + public listCloudDatabases?: (google.spanner.executor.v1.IListCloudDatabasesAction|null); + + /** AdminAction listCloudDatabaseOperations. */ + public listCloudDatabaseOperations?: (google.spanner.executor.v1.IListCloudDatabaseOperationsAction|null); + + /** AdminAction restoreCloudDatabase. */ + public restoreCloudDatabase?: (google.spanner.executor.v1.IRestoreCloudDatabaseAction|null); + + /** AdminAction getCloudDatabase. */ + public getCloudDatabase?: (google.spanner.executor.v1.IGetCloudDatabaseAction|null); + + /** AdminAction createCloudBackup. */ + public createCloudBackup?: (google.spanner.executor.v1.ICreateCloudBackupAction|null); + + /** AdminAction copyCloudBackup. */ + public copyCloudBackup?: (google.spanner.executor.v1.ICopyCloudBackupAction|null); + + /** AdminAction getCloudBackup. */ + public getCloudBackup?: (google.spanner.executor.v1.IGetCloudBackupAction|null); + + /** AdminAction updateCloudBackup. */ + public updateCloudBackup?: (google.spanner.executor.v1.IUpdateCloudBackupAction|null); + + /** AdminAction deleteCloudBackup. */ + public deleteCloudBackup?: (google.spanner.executor.v1.IDeleteCloudBackupAction|null); + + /** AdminAction listCloudBackups. */ + public listCloudBackups?: (google.spanner.executor.v1.IListCloudBackupsAction|null); + + /** AdminAction listCloudBackupOperations. */ + public listCloudBackupOperations?: (google.spanner.executor.v1.IListCloudBackupOperationsAction|null); + + /** AdminAction getOperation. */ + public getOperation?: (google.spanner.executor.v1.IGetOperationAction|null); + + /** AdminAction cancelOperation. */ + public cancelOperation?: (google.spanner.executor.v1.ICancelOperationAction|null); + + /** AdminAction changeQuorumCloudDatabase. */ + public changeQuorumCloudDatabase?: (google.spanner.executor.v1.IChangeQuorumCloudDatabaseAction|null); + + /** AdminAction action. */ + public action?: ("createUserInstanceConfig"|"updateUserInstanceConfig"|"deleteUserInstanceConfig"|"getCloudInstanceConfig"|"listInstanceConfigs"|"createCloudInstance"|"updateCloudInstance"|"deleteCloudInstance"|"listCloudInstances"|"getCloudInstance"|"createCloudDatabase"|"updateCloudDatabaseDdl"|"updateCloudDatabase"|"dropCloudDatabase"|"listCloudDatabases"|"listCloudDatabaseOperations"|"restoreCloudDatabase"|"getCloudDatabase"|"createCloudBackup"|"copyCloudBackup"|"getCloudBackup"|"updateCloudBackup"|"deleteCloudBackup"|"listCloudBackups"|"listCloudBackupOperations"|"getOperation"|"cancelOperation"|"changeQuorumCloudDatabase"); + + /** + * Creates a new AdminAction instance using the specified properties. + * @param [properties] Properties to set + * @returns AdminAction instance + */ + public static create(properties?: google.spanner.executor.v1.IAdminAction): google.spanner.executor.v1.AdminAction; + + /** + * Encodes the specified AdminAction message. Does not implicitly {@link google.spanner.executor.v1.AdminAction.verify|verify} messages. + * @param message AdminAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.executor.v1.IAdminAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AdminAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.AdminAction.verify|verify} messages. + * @param message AdminAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.executor.v1.IAdminAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AdminAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AdminAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.AdminAction; + + /** + * Decodes an AdminAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AdminAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.AdminAction; + + /** + * Verifies an AdminAction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AdminAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AdminAction + */ + public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.AdminAction; + + /** + * Creates a plain object from an AdminAction message. Also converts values to other types if specified. + * @param message AdminAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.executor.v1.AdminAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AdminAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AdminAction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateUserInstanceConfigAction. */ + interface ICreateUserInstanceConfigAction { + + /** CreateUserInstanceConfigAction userConfigId */ + userConfigId?: (string|null); + + /** CreateUserInstanceConfigAction projectId */ + projectId?: (string|null); + + /** CreateUserInstanceConfigAction baseConfigId */ + baseConfigId?: (string|null); + + /** CreateUserInstanceConfigAction replicas */ + replicas?: (google.spanner.admin.instance.v1.IReplicaInfo[]|null); + } + + /** Represents a CreateUserInstanceConfigAction. */ + class CreateUserInstanceConfigAction implements ICreateUserInstanceConfigAction { + + /** + * Constructs a new CreateUserInstanceConfigAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.executor.v1.ICreateUserInstanceConfigAction); + + /** CreateUserInstanceConfigAction userConfigId. */ + public userConfigId: string; + + /** CreateUserInstanceConfigAction projectId. */ + public projectId: string; + + /** CreateUserInstanceConfigAction baseConfigId. */ + public baseConfigId: string; + + /** CreateUserInstanceConfigAction replicas. */ + public replicas: google.spanner.admin.instance.v1.IReplicaInfo[]; + + /** + * Creates a new CreateUserInstanceConfigAction instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateUserInstanceConfigAction instance + */ + public static create(properties?: google.spanner.executor.v1.ICreateUserInstanceConfigAction): google.spanner.executor.v1.CreateUserInstanceConfigAction; + + /** + * Encodes the specified CreateUserInstanceConfigAction message. Does not implicitly {@link google.spanner.executor.v1.CreateUserInstanceConfigAction.verify|verify} messages. + * @param message CreateUserInstanceConfigAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.executor.v1.ICreateUserInstanceConfigAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateUserInstanceConfigAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.CreateUserInstanceConfigAction.verify|verify} messages. + * @param message CreateUserInstanceConfigAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.executor.v1.ICreateUserInstanceConfigAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateUserInstanceConfigAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateUserInstanceConfigAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.CreateUserInstanceConfigAction; + + /** + * Decodes a CreateUserInstanceConfigAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateUserInstanceConfigAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.CreateUserInstanceConfigAction; + + /** + * Verifies a CreateUserInstanceConfigAction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateUserInstanceConfigAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateUserInstanceConfigAction + */ + public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.CreateUserInstanceConfigAction; + + /** + * Creates a plain object from a CreateUserInstanceConfigAction message. Also converts values to other types if specified. + * @param message CreateUserInstanceConfigAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.executor.v1.CreateUserInstanceConfigAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateUserInstanceConfigAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateUserInstanceConfigAction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateUserInstanceConfigAction. */ + interface IUpdateUserInstanceConfigAction { + + /** UpdateUserInstanceConfigAction userConfigId */ + userConfigId?: (string|null); + + /** UpdateUserInstanceConfigAction projectId */ + projectId?: (string|null); + + /** UpdateUserInstanceConfigAction displayName */ + displayName?: (string|null); + + /** UpdateUserInstanceConfigAction labels */ + labels?: ({ [k: string]: string }|null); + } + + /** Represents an UpdateUserInstanceConfigAction. */ + class UpdateUserInstanceConfigAction implements IUpdateUserInstanceConfigAction { + + /** + * Constructs a new UpdateUserInstanceConfigAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.executor.v1.IUpdateUserInstanceConfigAction); + + /** UpdateUserInstanceConfigAction userConfigId. */ + public userConfigId: string; + + /** UpdateUserInstanceConfigAction projectId. */ + public projectId: string; + + /** UpdateUserInstanceConfigAction displayName. */ + public displayName?: (string|null); + + /** UpdateUserInstanceConfigAction labels. */ + public labels: { [k: string]: string }; + + /** + * Creates a new UpdateUserInstanceConfigAction instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateUserInstanceConfigAction instance + */ + public static create(properties?: google.spanner.executor.v1.IUpdateUserInstanceConfigAction): google.spanner.executor.v1.UpdateUserInstanceConfigAction; + + /** + * Encodes the specified UpdateUserInstanceConfigAction message. Does not implicitly {@link google.spanner.executor.v1.UpdateUserInstanceConfigAction.verify|verify} messages. + * @param message UpdateUserInstanceConfigAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.executor.v1.IUpdateUserInstanceConfigAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateUserInstanceConfigAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.UpdateUserInstanceConfigAction.verify|verify} messages. + * @param message UpdateUserInstanceConfigAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.executor.v1.IUpdateUserInstanceConfigAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateUserInstanceConfigAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateUserInstanceConfigAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.UpdateUserInstanceConfigAction; + + /** + * Decodes an UpdateUserInstanceConfigAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateUserInstanceConfigAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.UpdateUserInstanceConfigAction; + + /** + * Verifies an UpdateUserInstanceConfigAction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateUserInstanceConfigAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateUserInstanceConfigAction + */ + public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.UpdateUserInstanceConfigAction; + + /** + * Creates a plain object from an UpdateUserInstanceConfigAction message. Also converts values to other types if specified. + * @param message UpdateUserInstanceConfigAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.executor.v1.UpdateUserInstanceConfigAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateUserInstanceConfigAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateUserInstanceConfigAction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetCloudInstanceConfigAction. */ + interface IGetCloudInstanceConfigAction { + + /** GetCloudInstanceConfigAction instanceConfigId */ + instanceConfigId?: (string|null); + + /** GetCloudInstanceConfigAction projectId */ + projectId?: (string|null); + } + + /** Represents a GetCloudInstanceConfigAction. */ + class GetCloudInstanceConfigAction implements IGetCloudInstanceConfigAction { + + /** + * Constructs a new GetCloudInstanceConfigAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.executor.v1.IGetCloudInstanceConfigAction); + + /** GetCloudInstanceConfigAction instanceConfigId. */ + public instanceConfigId: string; + + /** GetCloudInstanceConfigAction projectId. */ + public projectId: string; + + /** + * Creates a new GetCloudInstanceConfigAction instance using the specified properties. + * @param [properties] Properties to set + * @returns GetCloudInstanceConfigAction instance + */ + public static create(properties?: google.spanner.executor.v1.IGetCloudInstanceConfigAction): google.spanner.executor.v1.GetCloudInstanceConfigAction; + + /** + * Encodes the specified GetCloudInstanceConfigAction message. Does not implicitly {@link google.spanner.executor.v1.GetCloudInstanceConfigAction.verify|verify} messages. + * @param message GetCloudInstanceConfigAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.executor.v1.IGetCloudInstanceConfigAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetCloudInstanceConfigAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.GetCloudInstanceConfigAction.verify|verify} messages. + * @param message GetCloudInstanceConfigAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.executor.v1.IGetCloudInstanceConfigAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetCloudInstanceConfigAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetCloudInstanceConfigAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.GetCloudInstanceConfigAction; + + /** + * Decodes a GetCloudInstanceConfigAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetCloudInstanceConfigAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.GetCloudInstanceConfigAction; + + /** + * Verifies a GetCloudInstanceConfigAction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetCloudInstanceConfigAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetCloudInstanceConfigAction + */ + public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.GetCloudInstanceConfigAction; + + /** + * Creates a plain object from a GetCloudInstanceConfigAction message. Also converts values to other types if specified. + * @param message GetCloudInstanceConfigAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.executor.v1.GetCloudInstanceConfigAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetCloudInstanceConfigAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetCloudInstanceConfigAction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteUserInstanceConfigAction. */ + interface IDeleteUserInstanceConfigAction { + + /** DeleteUserInstanceConfigAction userConfigId */ + userConfigId?: (string|null); + + /** DeleteUserInstanceConfigAction projectId */ + projectId?: (string|null); + } + + /** Represents a DeleteUserInstanceConfigAction. */ + class DeleteUserInstanceConfigAction implements IDeleteUserInstanceConfigAction { + + /** + * Constructs a new DeleteUserInstanceConfigAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.executor.v1.IDeleteUserInstanceConfigAction); + + /** DeleteUserInstanceConfigAction userConfigId. */ + public userConfigId: string; + + /** DeleteUserInstanceConfigAction projectId. */ + public projectId: string; + + /** + * Creates a new DeleteUserInstanceConfigAction instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteUserInstanceConfigAction instance + */ + public static create(properties?: google.spanner.executor.v1.IDeleteUserInstanceConfigAction): google.spanner.executor.v1.DeleteUserInstanceConfigAction; + + /** + * Encodes the specified DeleteUserInstanceConfigAction message. Does not implicitly {@link google.spanner.executor.v1.DeleteUserInstanceConfigAction.verify|verify} messages. + * @param message DeleteUserInstanceConfigAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.executor.v1.IDeleteUserInstanceConfigAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteUserInstanceConfigAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.DeleteUserInstanceConfigAction.verify|verify} messages. + * @param message DeleteUserInstanceConfigAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.executor.v1.IDeleteUserInstanceConfigAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteUserInstanceConfigAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteUserInstanceConfigAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.DeleteUserInstanceConfigAction; + + /** + * Decodes a DeleteUserInstanceConfigAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteUserInstanceConfigAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.DeleteUserInstanceConfigAction; + + /** + * Verifies a DeleteUserInstanceConfigAction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteUserInstanceConfigAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteUserInstanceConfigAction + */ + public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.DeleteUserInstanceConfigAction; + + /** + * Creates a plain object from a DeleteUserInstanceConfigAction message. Also converts values to other types if specified. + * @param message DeleteUserInstanceConfigAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.executor.v1.DeleteUserInstanceConfigAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteUserInstanceConfigAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteUserInstanceConfigAction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListCloudInstanceConfigsAction. */ + interface IListCloudInstanceConfigsAction { + + /** ListCloudInstanceConfigsAction projectId */ + projectId?: (string|null); + + /** ListCloudInstanceConfigsAction pageSize */ + pageSize?: (number|null); + + /** ListCloudInstanceConfigsAction pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListCloudInstanceConfigsAction. */ + class ListCloudInstanceConfigsAction implements IListCloudInstanceConfigsAction { + + /** + * Constructs a new ListCloudInstanceConfigsAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.executor.v1.IListCloudInstanceConfigsAction); + + /** ListCloudInstanceConfigsAction projectId. */ + public projectId: string; + + /** ListCloudInstanceConfigsAction pageSize. */ + public pageSize?: (number|null); + + /** ListCloudInstanceConfigsAction pageToken. */ + public pageToken?: (string|null); + + /** + * Creates a new ListCloudInstanceConfigsAction instance using the specified properties. + * @param [properties] Properties to set + * @returns ListCloudInstanceConfigsAction instance + */ + public static create(properties?: google.spanner.executor.v1.IListCloudInstanceConfigsAction): google.spanner.executor.v1.ListCloudInstanceConfigsAction; + + /** + * Encodes the specified ListCloudInstanceConfigsAction message. Does not implicitly {@link google.spanner.executor.v1.ListCloudInstanceConfigsAction.verify|verify} messages. + * @param message ListCloudInstanceConfigsAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.executor.v1.IListCloudInstanceConfigsAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListCloudInstanceConfigsAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.ListCloudInstanceConfigsAction.verify|verify} messages. + * @param message ListCloudInstanceConfigsAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.executor.v1.IListCloudInstanceConfigsAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListCloudInstanceConfigsAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListCloudInstanceConfigsAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.ListCloudInstanceConfigsAction; + + /** + * Decodes a ListCloudInstanceConfigsAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListCloudInstanceConfigsAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.ListCloudInstanceConfigsAction; + + /** + * Verifies a ListCloudInstanceConfigsAction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListCloudInstanceConfigsAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListCloudInstanceConfigsAction + */ + public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.ListCloudInstanceConfigsAction; + + /** + * Creates a plain object from a ListCloudInstanceConfigsAction message. Also converts values to other types if specified. + * @param message ListCloudInstanceConfigsAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.executor.v1.ListCloudInstanceConfigsAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListCloudInstanceConfigsAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListCloudInstanceConfigsAction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateCloudInstanceAction. */ + interface ICreateCloudInstanceAction { + + /** CreateCloudInstanceAction instanceId */ + instanceId?: (string|null); + + /** CreateCloudInstanceAction projectId */ + projectId?: (string|null); + + /** CreateCloudInstanceAction instanceConfigId */ + instanceConfigId?: (string|null); + + /** CreateCloudInstanceAction nodeCount */ + nodeCount?: (number|null); + + /** CreateCloudInstanceAction processingUnits */ + processingUnits?: (number|null); + + /** CreateCloudInstanceAction autoscalingConfig */ + autoscalingConfig?: (google.spanner.admin.instance.v1.IAutoscalingConfig|null); + + /** CreateCloudInstanceAction labels */ + labels?: ({ [k: string]: string }|null); + } + + /** Represents a CreateCloudInstanceAction. */ + class CreateCloudInstanceAction implements ICreateCloudInstanceAction { + + /** + * Constructs a new CreateCloudInstanceAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.executor.v1.ICreateCloudInstanceAction); + + /** CreateCloudInstanceAction instanceId. */ + public instanceId: string; + + /** CreateCloudInstanceAction projectId. */ + public projectId: string; + + /** CreateCloudInstanceAction instanceConfigId. */ + public instanceConfigId: string; + + /** CreateCloudInstanceAction nodeCount. */ + public nodeCount?: (number|null); + + /** CreateCloudInstanceAction processingUnits. */ + public processingUnits?: (number|null); + + /** CreateCloudInstanceAction autoscalingConfig. */ + public autoscalingConfig?: (google.spanner.admin.instance.v1.IAutoscalingConfig|null); + + /** CreateCloudInstanceAction labels. */ + public labels: { [k: string]: string }; + + /** + * Creates a new CreateCloudInstanceAction instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateCloudInstanceAction instance + */ + public static create(properties?: google.spanner.executor.v1.ICreateCloudInstanceAction): google.spanner.executor.v1.CreateCloudInstanceAction; + + /** + * Encodes the specified CreateCloudInstanceAction message. Does not implicitly {@link google.spanner.executor.v1.CreateCloudInstanceAction.verify|verify} messages. + * @param message CreateCloudInstanceAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.executor.v1.ICreateCloudInstanceAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateCloudInstanceAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.CreateCloudInstanceAction.verify|verify} messages. + * @param message CreateCloudInstanceAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.executor.v1.ICreateCloudInstanceAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateCloudInstanceAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateCloudInstanceAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.CreateCloudInstanceAction; + + /** + * Decodes a CreateCloudInstanceAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateCloudInstanceAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.CreateCloudInstanceAction; + + /** + * Verifies a CreateCloudInstanceAction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateCloudInstanceAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateCloudInstanceAction + */ + public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.CreateCloudInstanceAction; + + /** + * Creates a plain object from a CreateCloudInstanceAction message. Also converts values to other types if specified. + * @param message CreateCloudInstanceAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.executor.v1.CreateCloudInstanceAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateCloudInstanceAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateCloudInstanceAction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateCloudInstanceAction. */ + interface IUpdateCloudInstanceAction { + + /** UpdateCloudInstanceAction instanceId */ + instanceId?: (string|null); + + /** UpdateCloudInstanceAction projectId */ + projectId?: (string|null); + + /** UpdateCloudInstanceAction displayName */ + displayName?: (string|null); + + /** UpdateCloudInstanceAction nodeCount */ + nodeCount?: (number|null); + + /** UpdateCloudInstanceAction processingUnits */ + processingUnits?: (number|null); + + /** UpdateCloudInstanceAction autoscalingConfig */ + autoscalingConfig?: (google.spanner.admin.instance.v1.IAutoscalingConfig|null); + + /** UpdateCloudInstanceAction labels */ + labels?: ({ [k: string]: string }|null); + } + + /** Represents an UpdateCloudInstanceAction. */ + class UpdateCloudInstanceAction implements IUpdateCloudInstanceAction { + + /** + * Constructs a new UpdateCloudInstanceAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.executor.v1.IUpdateCloudInstanceAction); + + /** UpdateCloudInstanceAction instanceId. */ + public instanceId: string; + + /** UpdateCloudInstanceAction projectId. */ + public projectId: string; + + /** UpdateCloudInstanceAction displayName. */ + public displayName?: (string|null); + + /** UpdateCloudInstanceAction nodeCount. */ + public nodeCount?: (number|null); + + /** UpdateCloudInstanceAction processingUnits. */ + public processingUnits?: (number|null); + + /** UpdateCloudInstanceAction autoscalingConfig. */ + public autoscalingConfig?: (google.spanner.admin.instance.v1.IAutoscalingConfig|null); + + /** UpdateCloudInstanceAction labels. */ + public labels: { [k: string]: string }; + + /** + * Creates a new UpdateCloudInstanceAction instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateCloudInstanceAction instance + */ + public static create(properties?: google.spanner.executor.v1.IUpdateCloudInstanceAction): google.spanner.executor.v1.UpdateCloudInstanceAction; + + /** + * Encodes the specified UpdateCloudInstanceAction message. Does not implicitly {@link google.spanner.executor.v1.UpdateCloudInstanceAction.verify|verify} messages. + * @param message UpdateCloudInstanceAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.executor.v1.IUpdateCloudInstanceAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateCloudInstanceAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.UpdateCloudInstanceAction.verify|verify} messages. + * @param message UpdateCloudInstanceAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.executor.v1.IUpdateCloudInstanceAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateCloudInstanceAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateCloudInstanceAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.UpdateCloudInstanceAction; + + /** + * Decodes an UpdateCloudInstanceAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateCloudInstanceAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.UpdateCloudInstanceAction; + + /** + * Verifies an UpdateCloudInstanceAction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateCloudInstanceAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateCloudInstanceAction + */ + public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.UpdateCloudInstanceAction; + + /** + * Creates a plain object from an UpdateCloudInstanceAction message. Also converts values to other types if specified. + * @param message UpdateCloudInstanceAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.executor.v1.UpdateCloudInstanceAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateCloudInstanceAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateCloudInstanceAction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteCloudInstanceAction. */ + interface IDeleteCloudInstanceAction { + + /** DeleteCloudInstanceAction instanceId */ + instanceId?: (string|null); + + /** DeleteCloudInstanceAction projectId */ + projectId?: (string|null); + } + + /** Represents a DeleteCloudInstanceAction. */ + class DeleteCloudInstanceAction implements IDeleteCloudInstanceAction { + + /** + * Constructs a new DeleteCloudInstanceAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.executor.v1.IDeleteCloudInstanceAction); + + /** DeleteCloudInstanceAction instanceId. */ + public instanceId: string; + + /** DeleteCloudInstanceAction projectId. */ + public projectId: string; + + /** + * Creates a new DeleteCloudInstanceAction instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteCloudInstanceAction instance + */ + public static create(properties?: google.spanner.executor.v1.IDeleteCloudInstanceAction): google.spanner.executor.v1.DeleteCloudInstanceAction; + + /** + * Encodes the specified DeleteCloudInstanceAction message. Does not implicitly {@link google.spanner.executor.v1.DeleteCloudInstanceAction.verify|verify} messages. + * @param message DeleteCloudInstanceAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.executor.v1.IDeleteCloudInstanceAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteCloudInstanceAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.DeleteCloudInstanceAction.verify|verify} messages. + * @param message DeleteCloudInstanceAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.executor.v1.IDeleteCloudInstanceAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteCloudInstanceAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteCloudInstanceAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.DeleteCloudInstanceAction; + + /** + * Decodes a DeleteCloudInstanceAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteCloudInstanceAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.DeleteCloudInstanceAction; + + /** + * Verifies a DeleteCloudInstanceAction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteCloudInstanceAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteCloudInstanceAction + */ + public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.DeleteCloudInstanceAction; + + /** + * Creates a plain object from a DeleteCloudInstanceAction message. Also converts values to other types if specified. + * @param message DeleteCloudInstanceAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.executor.v1.DeleteCloudInstanceAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteCloudInstanceAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteCloudInstanceAction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateCloudDatabaseAction. */ + interface ICreateCloudDatabaseAction { + + /** CreateCloudDatabaseAction instanceId */ + instanceId?: (string|null); + + /** CreateCloudDatabaseAction projectId */ + projectId?: (string|null); + + /** CreateCloudDatabaseAction databaseId */ + databaseId?: (string|null); + + /** CreateCloudDatabaseAction sdlStatement */ + sdlStatement?: (string[]|null); + + /** CreateCloudDatabaseAction encryptionConfig */ + encryptionConfig?: (google.spanner.admin.database.v1.IEncryptionConfig|null); + + /** CreateCloudDatabaseAction dialect */ + dialect?: (string|null); + + /** CreateCloudDatabaseAction protoDescriptors */ + protoDescriptors?: (Uint8Array|Buffer|string|null); + } + + /** Represents a CreateCloudDatabaseAction. */ + class CreateCloudDatabaseAction implements ICreateCloudDatabaseAction { + + /** + * Constructs a new CreateCloudDatabaseAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.executor.v1.ICreateCloudDatabaseAction); + + /** CreateCloudDatabaseAction instanceId. */ + public instanceId: string; + + /** CreateCloudDatabaseAction projectId. */ + public projectId: string; + + /** CreateCloudDatabaseAction databaseId. */ + public databaseId: string; + + /** CreateCloudDatabaseAction sdlStatement. */ + public sdlStatement: string[]; + + /** CreateCloudDatabaseAction encryptionConfig. */ + public encryptionConfig?: (google.spanner.admin.database.v1.IEncryptionConfig|null); + + /** CreateCloudDatabaseAction dialect. */ + public dialect?: (string|null); + + /** CreateCloudDatabaseAction protoDescriptors. */ + public protoDescriptors?: (Uint8Array|Buffer|string|null); + + /** + * Creates a new CreateCloudDatabaseAction instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateCloudDatabaseAction instance + */ + public static create(properties?: google.spanner.executor.v1.ICreateCloudDatabaseAction): google.spanner.executor.v1.CreateCloudDatabaseAction; + + /** + * Encodes the specified CreateCloudDatabaseAction message. Does not implicitly {@link google.spanner.executor.v1.CreateCloudDatabaseAction.verify|verify} messages. + * @param message CreateCloudDatabaseAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.executor.v1.ICreateCloudDatabaseAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateCloudDatabaseAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.CreateCloudDatabaseAction.verify|verify} messages. + * @param message CreateCloudDatabaseAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.executor.v1.ICreateCloudDatabaseAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateCloudDatabaseAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateCloudDatabaseAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.CreateCloudDatabaseAction; + + /** + * Decodes a CreateCloudDatabaseAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateCloudDatabaseAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.CreateCloudDatabaseAction; + + /** + * Verifies a CreateCloudDatabaseAction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateCloudDatabaseAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateCloudDatabaseAction + */ + public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.CreateCloudDatabaseAction; + + /** + * Creates a plain object from a CreateCloudDatabaseAction message. Also converts values to other types if specified. + * @param message CreateCloudDatabaseAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.executor.v1.CreateCloudDatabaseAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateCloudDatabaseAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateCloudDatabaseAction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateCloudDatabaseDdlAction. */ + interface IUpdateCloudDatabaseDdlAction { + + /** UpdateCloudDatabaseDdlAction instanceId */ + instanceId?: (string|null); + + /** UpdateCloudDatabaseDdlAction projectId */ + projectId?: (string|null); + + /** UpdateCloudDatabaseDdlAction databaseId */ + databaseId?: (string|null); + + /** UpdateCloudDatabaseDdlAction sdlStatement */ + sdlStatement?: (string[]|null); + + /** UpdateCloudDatabaseDdlAction operationId */ + operationId?: (string|null); + + /** UpdateCloudDatabaseDdlAction protoDescriptors */ + protoDescriptors?: (Uint8Array|Buffer|string|null); + } + + /** Represents an UpdateCloudDatabaseDdlAction. */ + class UpdateCloudDatabaseDdlAction implements IUpdateCloudDatabaseDdlAction { + + /** + * Constructs a new UpdateCloudDatabaseDdlAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.executor.v1.IUpdateCloudDatabaseDdlAction); + + /** UpdateCloudDatabaseDdlAction instanceId. */ + public instanceId: string; + + /** UpdateCloudDatabaseDdlAction projectId. */ + public projectId: string; + + /** UpdateCloudDatabaseDdlAction databaseId. */ + public databaseId: string; + + /** UpdateCloudDatabaseDdlAction sdlStatement. */ + public sdlStatement: string[]; + + /** UpdateCloudDatabaseDdlAction operationId. */ + public operationId: string; + + /** UpdateCloudDatabaseDdlAction protoDescriptors. */ + public protoDescriptors?: (Uint8Array|Buffer|string|null); + + /** + * Creates a new UpdateCloudDatabaseDdlAction instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateCloudDatabaseDdlAction instance + */ + public static create(properties?: google.spanner.executor.v1.IUpdateCloudDatabaseDdlAction): google.spanner.executor.v1.UpdateCloudDatabaseDdlAction; + + /** + * Encodes the specified UpdateCloudDatabaseDdlAction message. Does not implicitly {@link google.spanner.executor.v1.UpdateCloudDatabaseDdlAction.verify|verify} messages. + * @param message UpdateCloudDatabaseDdlAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.executor.v1.IUpdateCloudDatabaseDdlAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateCloudDatabaseDdlAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.UpdateCloudDatabaseDdlAction.verify|verify} messages. + * @param message UpdateCloudDatabaseDdlAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.executor.v1.IUpdateCloudDatabaseDdlAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateCloudDatabaseDdlAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateCloudDatabaseDdlAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.UpdateCloudDatabaseDdlAction; + + /** + * Decodes an UpdateCloudDatabaseDdlAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateCloudDatabaseDdlAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.UpdateCloudDatabaseDdlAction; + + /** + * Verifies an UpdateCloudDatabaseDdlAction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateCloudDatabaseDdlAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateCloudDatabaseDdlAction + */ + public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.UpdateCloudDatabaseDdlAction; + + /** + * Creates a plain object from an UpdateCloudDatabaseDdlAction message. Also converts values to other types if specified. + * @param message UpdateCloudDatabaseDdlAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.executor.v1.UpdateCloudDatabaseDdlAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateCloudDatabaseDdlAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateCloudDatabaseDdlAction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateCloudDatabaseAction. */ + interface IUpdateCloudDatabaseAction { + + /** UpdateCloudDatabaseAction instanceId */ + instanceId?: (string|null); + + /** UpdateCloudDatabaseAction projectId */ + projectId?: (string|null); + + /** UpdateCloudDatabaseAction databaseName */ + databaseName?: (string|null); + + /** UpdateCloudDatabaseAction enableDropProtection */ + enableDropProtection?: (boolean|null); + } + + /** Represents an UpdateCloudDatabaseAction. */ + class UpdateCloudDatabaseAction implements IUpdateCloudDatabaseAction { + + /** + * Constructs a new UpdateCloudDatabaseAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.executor.v1.IUpdateCloudDatabaseAction); + + /** UpdateCloudDatabaseAction instanceId. */ + public instanceId: string; + + /** UpdateCloudDatabaseAction projectId. */ + public projectId: string; + + /** UpdateCloudDatabaseAction databaseName. */ + public databaseName: string; + + /** UpdateCloudDatabaseAction enableDropProtection. */ + public enableDropProtection: boolean; + + /** + * Creates a new UpdateCloudDatabaseAction instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateCloudDatabaseAction instance + */ + public static create(properties?: google.spanner.executor.v1.IUpdateCloudDatabaseAction): google.spanner.executor.v1.UpdateCloudDatabaseAction; + + /** + * Encodes the specified UpdateCloudDatabaseAction message. Does not implicitly {@link google.spanner.executor.v1.UpdateCloudDatabaseAction.verify|verify} messages. + * @param message UpdateCloudDatabaseAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.executor.v1.IUpdateCloudDatabaseAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateCloudDatabaseAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.UpdateCloudDatabaseAction.verify|verify} messages. + * @param message UpdateCloudDatabaseAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.executor.v1.IUpdateCloudDatabaseAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateCloudDatabaseAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateCloudDatabaseAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.UpdateCloudDatabaseAction; + + /** + * Decodes an UpdateCloudDatabaseAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateCloudDatabaseAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.UpdateCloudDatabaseAction; + + /** + * Verifies an UpdateCloudDatabaseAction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateCloudDatabaseAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateCloudDatabaseAction + */ + public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.UpdateCloudDatabaseAction; + + /** + * Creates a plain object from an UpdateCloudDatabaseAction message. Also converts values to other types if specified. + * @param message UpdateCloudDatabaseAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.executor.v1.UpdateCloudDatabaseAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateCloudDatabaseAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateCloudDatabaseAction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DropCloudDatabaseAction. */ + interface IDropCloudDatabaseAction { + + /** DropCloudDatabaseAction instanceId */ + instanceId?: (string|null); + + /** DropCloudDatabaseAction projectId */ + projectId?: (string|null); + + /** DropCloudDatabaseAction databaseId */ + databaseId?: (string|null); + } + + /** Represents a DropCloudDatabaseAction. */ + class DropCloudDatabaseAction implements IDropCloudDatabaseAction { + + /** + * Constructs a new DropCloudDatabaseAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.executor.v1.IDropCloudDatabaseAction); + + /** DropCloudDatabaseAction instanceId. */ + public instanceId: string; + + /** DropCloudDatabaseAction projectId. */ + public projectId: string; + + /** DropCloudDatabaseAction databaseId. */ + public databaseId: string; + + /** + * Creates a new DropCloudDatabaseAction instance using the specified properties. + * @param [properties] Properties to set + * @returns DropCloudDatabaseAction instance + */ + public static create(properties?: google.spanner.executor.v1.IDropCloudDatabaseAction): google.spanner.executor.v1.DropCloudDatabaseAction; + + /** + * Encodes the specified DropCloudDatabaseAction message. Does not implicitly {@link google.spanner.executor.v1.DropCloudDatabaseAction.verify|verify} messages. + * @param message DropCloudDatabaseAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.executor.v1.IDropCloudDatabaseAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DropCloudDatabaseAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.DropCloudDatabaseAction.verify|verify} messages. + * @param message DropCloudDatabaseAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.executor.v1.IDropCloudDatabaseAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DropCloudDatabaseAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DropCloudDatabaseAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.DropCloudDatabaseAction; + + /** + * Decodes a DropCloudDatabaseAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DropCloudDatabaseAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.DropCloudDatabaseAction; + + /** + * Verifies a DropCloudDatabaseAction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DropCloudDatabaseAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DropCloudDatabaseAction + */ + public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.DropCloudDatabaseAction; + + /** + * Creates a plain object from a DropCloudDatabaseAction message. Also converts values to other types if specified. + * @param message DropCloudDatabaseAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.executor.v1.DropCloudDatabaseAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DropCloudDatabaseAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DropCloudDatabaseAction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ChangeQuorumCloudDatabaseAction. */ + interface IChangeQuorumCloudDatabaseAction { + + /** ChangeQuorumCloudDatabaseAction databaseUri */ + databaseUri?: (string|null); + + /** ChangeQuorumCloudDatabaseAction servingLocations */ + servingLocations?: (string[]|null); + } + + /** Represents a ChangeQuorumCloudDatabaseAction. */ + class ChangeQuorumCloudDatabaseAction implements IChangeQuorumCloudDatabaseAction { + + /** + * Constructs a new ChangeQuorumCloudDatabaseAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.executor.v1.IChangeQuorumCloudDatabaseAction); + + /** ChangeQuorumCloudDatabaseAction databaseUri. */ + public databaseUri?: (string|null); + + /** ChangeQuorumCloudDatabaseAction servingLocations. */ + public servingLocations: string[]; + + /** + * Creates a new ChangeQuorumCloudDatabaseAction instance using the specified properties. + * @param [properties] Properties to set + * @returns ChangeQuorumCloudDatabaseAction instance + */ + public static create(properties?: google.spanner.executor.v1.IChangeQuorumCloudDatabaseAction): google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction; + + /** + * Encodes the specified ChangeQuorumCloudDatabaseAction message. Does not implicitly {@link google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction.verify|verify} messages. + * @param message ChangeQuorumCloudDatabaseAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.executor.v1.IChangeQuorumCloudDatabaseAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ChangeQuorumCloudDatabaseAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction.verify|verify} messages. + * @param message ChangeQuorumCloudDatabaseAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.executor.v1.IChangeQuorumCloudDatabaseAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ChangeQuorumCloudDatabaseAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ChangeQuorumCloudDatabaseAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction; + + /** + * Decodes a ChangeQuorumCloudDatabaseAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ChangeQuorumCloudDatabaseAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction; + + /** + * Verifies a ChangeQuorumCloudDatabaseAction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ChangeQuorumCloudDatabaseAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ChangeQuorumCloudDatabaseAction + */ + public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction; + + /** + * Creates a plain object from a ChangeQuorumCloudDatabaseAction message. Also converts values to other types if specified. + * @param message ChangeQuorumCloudDatabaseAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ChangeQuorumCloudDatabaseAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ChangeQuorumCloudDatabaseAction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListCloudDatabasesAction. */ + interface IListCloudDatabasesAction { + + /** ListCloudDatabasesAction projectId */ + projectId?: (string|null); + + /** ListCloudDatabasesAction instanceId */ + instanceId?: (string|null); + + /** ListCloudDatabasesAction pageSize */ + pageSize?: (number|null); + + /** ListCloudDatabasesAction pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListCloudDatabasesAction. */ + class ListCloudDatabasesAction implements IListCloudDatabasesAction { + + /** + * Constructs a new ListCloudDatabasesAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.executor.v1.IListCloudDatabasesAction); + + /** ListCloudDatabasesAction projectId. */ + public projectId: string; + + /** ListCloudDatabasesAction instanceId. */ + public instanceId: string; + + /** ListCloudDatabasesAction pageSize. */ + public pageSize: number; + + /** ListCloudDatabasesAction pageToken. */ + public pageToken: string; + + /** + * Creates a new ListCloudDatabasesAction instance using the specified properties. + * @param [properties] Properties to set + * @returns ListCloudDatabasesAction instance + */ + public static create(properties?: google.spanner.executor.v1.IListCloudDatabasesAction): google.spanner.executor.v1.ListCloudDatabasesAction; + + /** + * Encodes the specified ListCloudDatabasesAction message. Does not implicitly {@link google.spanner.executor.v1.ListCloudDatabasesAction.verify|verify} messages. + * @param message ListCloudDatabasesAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.executor.v1.IListCloudDatabasesAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListCloudDatabasesAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.ListCloudDatabasesAction.verify|verify} messages. + * @param message ListCloudDatabasesAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.executor.v1.IListCloudDatabasesAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListCloudDatabasesAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListCloudDatabasesAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.ListCloudDatabasesAction; + + /** + * Decodes a ListCloudDatabasesAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListCloudDatabasesAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.ListCloudDatabasesAction; + + /** + * Verifies a ListCloudDatabasesAction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListCloudDatabasesAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListCloudDatabasesAction + */ + public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.ListCloudDatabasesAction; + + /** + * Creates a plain object from a ListCloudDatabasesAction message. Also converts values to other types if specified. + * @param message ListCloudDatabasesAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.executor.v1.ListCloudDatabasesAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListCloudDatabasesAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListCloudDatabasesAction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListCloudInstancesAction. */ + interface IListCloudInstancesAction { + + /** ListCloudInstancesAction projectId */ + projectId?: (string|null); + + /** ListCloudInstancesAction filter */ + filter?: (string|null); + + /** ListCloudInstancesAction pageSize */ + pageSize?: (number|null); + + /** ListCloudInstancesAction pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListCloudInstancesAction. */ + class ListCloudInstancesAction implements IListCloudInstancesAction { + + /** + * Constructs a new ListCloudInstancesAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.executor.v1.IListCloudInstancesAction); + + /** ListCloudInstancesAction projectId. */ + public projectId: string; + + /** ListCloudInstancesAction filter. */ + public filter?: (string|null); + + /** ListCloudInstancesAction pageSize. */ + public pageSize?: (number|null); + + /** ListCloudInstancesAction pageToken. */ + public pageToken?: (string|null); + + /** + * Creates a new ListCloudInstancesAction instance using the specified properties. + * @param [properties] Properties to set + * @returns ListCloudInstancesAction instance + */ + public static create(properties?: google.spanner.executor.v1.IListCloudInstancesAction): google.spanner.executor.v1.ListCloudInstancesAction; + + /** + * Encodes the specified ListCloudInstancesAction message. Does not implicitly {@link google.spanner.executor.v1.ListCloudInstancesAction.verify|verify} messages. + * @param message ListCloudInstancesAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.executor.v1.IListCloudInstancesAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListCloudInstancesAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.ListCloudInstancesAction.verify|verify} messages. + * @param message ListCloudInstancesAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.executor.v1.IListCloudInstancesAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListCloudInstancesAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListCloudInstancesAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.ListCloudInstancesAction; + + /** + * Decodes a ListCloudInstancesAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListCloudInstancesAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.ListCloudInstancesAction; + + /** + * Verifies a ListCloudInstancesAction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListCloudInstancesAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListCloudInstancesAction + */ + public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.ListCloudInstancesAction; + + /** + * Creates a plain object from a ListCloudInstancesAction message. Also converts values to other types if specified. + * @param message ListCloudInstancesAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.executor.v1.ListCloudInstancesAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListCloudInstancesAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListCloudInstancesAction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetCloudInstanceAction. */ + interface IGetCloudInstanceAction { + + /** GetCloudInstanceAction projectId */ + projectId?: (string|null); + + /** GetCloudInstanceAction instanceId */ + instanceId?: (string|null); + } + + /** Represents a GetCloudInstanceAction. */ + class GetCloudInstanceAction implements IGetCloudInstanceAction { + + /** + * Constructs a new GetCloudInstanceAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.executor.v1.IGetCloudInstanceAction); + + /** GetCloudInstanceAction projectId. */ + public projectId: string; + + /** GetCloudInstanceAction instanceId. */ + public instanceId: string; + + /** + * Creates a new GetCloudInstanceAction instance using the specified properties. + * @param [properties] Properties to set + * @returns GetCloudInstanceAction instance + */ + public static create(properties?: google.spanner.executor.v1.IGetCloudInstanceAction): google.spanner.executor.v1.GetCloudInstanceAction; + + /** + * Encodes the specified GetCloudInstanceAction message. Does not implicitly {@link google.spanner.executor.v1.GetCloudInstanceAction.verify|verify} messages. + * @param message GetCloudInstanceAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.executor.v1.IGetCloudInstanceAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetCloudInstanceAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.GetCloudInstanceAction.verify|verify} messages. + * @param message GetCloudInstanceAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.executor.v1.IGetCloudInstanceAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetCloudInstanceAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetCloudInstanceAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.GetCloudInstanceAction; + + /** + * Decodes a GetCloudInstanceAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetCloudInstanceAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.GetCloudInstanceAction; + + /** + * Verifies a GetCloudInstanceAction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetCloudInstanceAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetCloudInstanceAction + */ + public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.GetCloudInstanceAction; + + /** + * Creates a plain object from a GetCloudInstanceAction message. Also converts values to other types if specified. + * @param message GetCloudInstanceAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.executor.v1.GetCloudInstanceAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetCloudInstanceAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetCloudInstanceAction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListCloudDatabaseOperationsAction. */ + interface IListCloudDatabaseOperationsAction { + + /** ListCloudDatabaseOperationsAction projectId */ + projectId?: (string|null); + + /** ListCloudDatabaseOperationsAction instanceId */ + instanceId?: (string|null); + + /** ListCloudDatabaseOperationsAction filter */ + filter?: (string|null); + + /** ListCloudDatabaseOperationsAction pageSize */ + pageSize?: (number|null); + + /** ListCloudDatabaseOperationsAction pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListCloudDatabaseOperationsAction. */ + class ListCloudDatabaseOperationsAction implements IListCloudDatabaseOperationsAction { + + /** + * Constructs a new ListCloudDatabaseOperationsAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.executor.v1.IListCloudDatabaseOperationsAction); + + /** ListCloudDatabaseOperationsAction projectId. */ + public projectId: string; + + /** ListCloudDatabaseOperationsAction instanceId. */ + public instanceId: string; + + /** ListCloudDatabaseOperationsAction filter. */ + public filter: string; + + /** ListCloudDatabaseOperationsAction pageSize. */ + public pageSize: number; + + /** ListCloudDatabaseOperationsAction pageToken. */ + public pageToken: string; + + /** + * Creates a new ListCloudDatabaseOperationsAction instance using the specified properties. + * @param [properties] Properties to set + * @returns ListCloudDatabaseOperationsAction instance + */ + public static create(properties?: google.spanner.executor.v1.IListCloudDatabaseOperationsAction): google.spanner.executor.v1.ListCloudDatabaseOperationsAction; + + /** + * Encodes the specified ListCloudDatabaseOperationsAction message. Does not implicitly {@link google.spanner.executor.v1.ListCloudDatabaseOperationsAction.verify|verify} messages. + * @param message ListCloudDatabaseOperationsAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.executor.v1.IListCloudDatabaseOperationsAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListCloudDatabaseOperationsAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.ListCloudDatabaseOperationsAction.verify|verify} messages. + * @param message ListCloudDatabaseOperationsAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.executor.v1.IListCloudDatabaseOperationsAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListCloudDatabaseOperationsAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListCloudDatabaseOperationsAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.ListCloudDatabaseOperationsAction; + + /** + * Decodes a ListCloudDatabaseOperationsAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListCloudDatabaseOperationsAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.ListCloudDatabaseOperationsAction; + + /** + * Verifies a ListCloudDatabaseOperationsAction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListCloudDatabaseOperationsAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListCloudDatabaseOperationsAction + */ + public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.ListCloudDatabaseOperationsAction; + + /** + * Creates a plain object from a ListCloudDatabaseOperationsAction message. Also converts values to other types if specified. + * @param message ListCloudDatabaseOperationsAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.executor.v1.ListCloudDatabaseOperationsAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListCloudDatabaseOperationsAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListCloudDatabaseOperationsAction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RestoreCloudDatabaseAction. */ + interface IRestoreCloudDatabaseAction { + + /** RestoreCloudDatabaseAction projectId */ + projectId?: (string|null); + + /** RestoreCloudDatabaseAction backupInstanceId */ + backupInstanceId?: (string|null); + + /** RestoreCloudDatabaseAction backupId */ + backupId?: (string|null); + + /** RestoreCloudDatabaseAction databaseInstanceId */ + databaseInstanceId?: (string|null); + + /** RestoreCloudDatabaseAction databaseId */ + databaseId?: (string|null); + + /** RestoreCloudDatabaseAction encryptionConfig */ + encryptionConfig?: (google.spanner.admin.database.v1.IEncryptionConfig|null); + } + + /** Represents a RestoreCloudDatabaseAction. */ + class RestoreCloudDatabaseAction implements IRestoreCloudDatabaseAction { + + /** + * Constructs a new RestoreCloudDatabaseAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.executor.v1.IRestoreCloudDatabaseAction); + + /** RestoreCloudDatabaseAction projectId. */ + public projectId: string; + + /** RestoreCloudDatabaseAction backupInstanceId. */ + public backupInstanceId: string; + + /** RestoreCloudDatabaseAction backupId. */ + public backupId: string; + + /** RestoreCloudDatabaseAction databaseInstanceId. */ + public databaseInstanceId: string; + + /** RestoreCloudDatabaseAction databaseId. */ + public databaseId: string; + + /** RestoreCloudDatabaseAction encryptionConfig. */ + public encryptionConfig?: (google.spanner.admin.database.v1.IEncryptionConfig|null); + + /** + * Creates a new RestoreCloudDatabaseAction instance using the specified properties. + * @param [properties] Properties to set + * @returns RestoreCloudDatabaseAction instance + */ + public static create(properties?: google.spanner.executor.v1.IRestoreCloudDatabaseAction): google.spanner.executor.v1.RestoreCloudDatabaseAction; + + /** + * Encodes the specified RestoreCloudDatabaseAction message. Does not implicitly {@link google.spanner.executor.v1.RestoreCloudDatabaseAction.verify|verify} messages. + * @param message RestoreCloudDatabaseAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.executor.v1.IRestoreCloudDatabaseAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RestoreCloudDatabaseAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.RestoreCloudDatabaseAction.verify|verify} messages. + * @param message RestoreCloudDatabaseAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.executor.v1.IRestoreCloudDatabaseAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RestoreCloudDatabaseAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RestoreCloudDatabaseAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.RestoreCloudDatabaseAction; + + /** + * Decodes a RestoreCloudDatabaseAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RestoreCloudDatabaseAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.RestoreCloudDatabaseAction; + + /** + * Verifies a RestoreCloudDatabaseAction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RestoreCloudDatabaseAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RestoreCloudDatabaseAction + */ + public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.RestoreCloudDatabaseAction; + + /** + * Creates a plain object from a RestoreCloudDatabaseAction message. Also converts values to other types if specified. + * @param message RestoreCloudDatabaseAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.executor.v1.RestoreCloudDatabaseAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RestoreCloudDatabaseAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RestoreCloudDatabaseAction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetCloudDatabaseAction. */ + interface IGetCloudDatabaseAction { + + /** GetCloudDatabaseAction projectId */ + projectId?: (string|null); + + /** GetCloudDatabaseAction instanceId */ + instanceId?: (string|null); + + /** GetCloudDatabaseAction databaseId */ + databaseId?: (string|null); + } + + /** Represents a GetCloudDatabaseAction. */ + class GetCloudDatabaseAction implements IGetCloudDatabaseAction { + + /** + * Constructs a new GetCloudDatabaseAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.executor.v1.IGetCloudDatabaseAction); + + /** GetCloudDatabaseAction projectId. */ + public projectId: string; + + /** GetCloudDatabaseAction instanceId. */ + public instanceId: string; + + /** GetCloudDatabaseAction databaseId. */ + public databaseId: string; + + /** + * Creates a new GetCloudDatabaseAction instance using the specified properties. + * @param [properties] Properties to set + * @returns GetCloudDatabaseAction instance + */ + public static create(properties?: google.spanner.executor.v1.IGetCloudDatabaseAction): google.spanner.executor.v1.GetCloudDatabaseAction; + + /** + * Encodes the specified GetCloudDatabaseAction message. Does not implicitly {@link google.spanner.executor.v1.GetCloudDatabaseAction.verify|verify} messages. + * @param message GetCloudDatabaseAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.executor.v1.IGetCloudDatabaseAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetCloudDatabaseAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.GetCloudDatabaseAction.verify|verify} messages. + * @param message GetCloudDatabaseAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.executor.v1.IGetCloudDatabaseAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetCloudDatabaseAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetCloudDatabaseAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.GetCloudDatabaseAction; + + /** + * Decodes a GetCloudDatabaseAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetCloudDatabaseAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.GetCloudDatabaseAction; + + /** + * Verifies a GetCloudDatabaseAction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetCloudDatabaseAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetCloudDatabaseAction + */ + public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.GetCloudDatabaseAction; + + /** + * Creates a plain object from a GetCloudDatabaseAction message. Also converts values to other types if specified. + * @param message GetCloudDatabaseAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.executor.v1.GetCloudDatabaseAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetCloudDatabaseAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetCloudDatabaseAction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateCloudBackupAction. */ + interface ICreateCloudBackupAction { + + /** CreateCloudBackupAction projectId */ + projectId?: (string|null); + + /** CreateCloudBackupAction instanceId */ + instanceId?: (string|null); + + /** CreateCloudBackupAction backupId */ + backupId?: (string|null); + + /** CreateCloudBackupAction databaseId */ + databaseId?: (string|null); + + /** CreateCloudBackupAction expireTime */ + expireTime?: (google.protobuf.ITimestamp|null); + + /** CreateCloudBackupAction versionTime */ + versionTime?: (google.protobuf.ITimestamp|null); + + /** CreateCloudBackupAction encryptionConfig */ + encryptionConfig?: (google.spanner.admin.database.v1.IEncryptionConfig|null); + } + + /** Represents a CreateCloudBackupAction. */ + class CreateCloudBackupAction implements ICreateCloudBackupAction { + + /** + * Constructs a new CreateCloudBackupAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.executor.v1.ICreateCloudBackupAction); + + /** CreateCloudBackupAction projectId. */ + public projectId: string; + + /** CreateCloudBackupAction instanceId. */ + public instanceId: string; + + /** CreateCloudBackupAction backupId. */ + public backupId: string; + + /** CreateCloudBackupAction databaseId. */ + public databaseId: string; + + /** CreateCloudBackupAction expireTime. */ + public expireTime?: (google.protobuf.ITimestamp|null); + + /** CreateCloudBackupAction versionTime. */ + public versionTime?: (google.protobuf.ITimestamp|null); + + /** CreateCloudBackupAction encryptionConfig. */ + public encryptionConfig?: (google.spanner.admin.database.v1.IEncryptionConfig|null); + + /** + * Creates a new CreateCloudBackupAction instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateCloudBackupAction instance + */ + public static create(properties?: google.spanner.executor.v1.ICreateCloudBackupAction): google.spanner.executor.v1.CreateCloudBackupAction; + + /** + * Encodes the specified CreateCloudBackupAction message. Does not implicitly {@link google.spanner.executor.v1.CreateCloudBackupAction.verify|verify} messages. + * @param message CreateCloudBackupAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.executor.v1.ICreateCloudBackupAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateCloudBackupAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.CreateCloudBackupAction.verify|verify} messages. + * @param message CreateCloudBackupAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.executor.v1.ICreateCloudBackupAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateCloudBackupAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateCloudBackupAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.CreateCloudBackupAction; + + /** + * Decodes a CreateCloudBackupAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateCloudBackupAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.CreateCloudBackupAction; + + /** + * Verifies a CreateCloudBackupAction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateCloudBackupAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateCloudBackupAction + */ + public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.CreateCloudBackupAction; + + /** + * Creates a plain object from a CreateCloudBackupAction message. Also converts values to other types if specified. + * @param message CreateCloudBackupAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.executor.v1.CreateCloudBackupAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateCloudBackupAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateCloudBackupAction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CopyCloudBackupAction. */ + interface ICopyCloudBackupAction { + + /** CopyCloudBackupAction projectId */ + projectId?: (string|null); + + /** CopyCloudBackupAction instanceId */ + instanceId?: (string|null); + + /** CopyCloudBackupAction backupId */ + backupId?: (string|null); + + /** CopyCloudBackupAction sourceBackup */ + sourceBackup?: (string|null); + + /** CopyCloudBackupAction expireTime */ + expireTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a CopyCloudBackupAction. */ + class CopyCloudBackupAction implements ICopyCloudBackupAction { + + /** + * Constructs a new CopyCloudBackupAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.executor.v1.ICopyCloudBackupAction); + + /** CopyCloudBackupAction projectId. */ + public projectId: string; + + /** CopyCloudBackupAction instanceId. */ + public instanceId: string; + + /** CopyCloudBackupAction backupId. */ + public backupId: string; + + /** CopyCloudBackupAction sourceBackup. */ + public sourceBackup: string; + + /** CopyCloudBackupAction expireTime. */ + public expireTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new CopyCloudBackupAction instance using the specified properties. + * @param [properties] Properties to set + * @returns CopyCloudBackupAction instance + */ + public static create(properties?: google.spanner.executor.v1.ICopyCloudBackupAction): google.spanner.executor.v1.CopyCloudBackupAction; + + /** + * Encodes the specified CopyCloudBackupAction message. Does not implicitly {@link google.spanner.executor.v1.CopyCloudBackupAction.verify|verify} messages. + * @param message CopyCloudBackupAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.executor.v1.ICopyCloudBackupAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CopyCloudBackupAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.CopyCloudBackupAction.verify|verify} messages. + * @param message CopyCloudBackupAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.executor.v1.ICopyCloudBackupAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CopyCloudBackupAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CopyCloudBackupAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.CopyCloudBackupAction; + + /** + * Decodes a CopyCloudBackupAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CopyCloudBackupAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.CopyCloudBackupAction; + + /** + * Verifies a CopyCloudBackupAction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CopyCloudBackupAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CopyCloudBackupAction + */ + public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.CopyCloudBackupAction; + + /** + * Creates a plain object from a CopyCloudBackupAction message. Also converts values to other types if specified. + * @param message CopyCloudBackupAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.executor.v1.CopyCloudBackupAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CopyCloudBackupAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CopyCloudBackupAction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetCloudBackupAction. */ + interface IGetCloudBackupAction { + + /** GetCloudBackupAction projectId */ + projectId?: (string|null); + + /** GetCloudBackupAction instanceId */ + instanceId?: (string|null); + + /** GetCloudBackupAction backupId */ + backupId?: (string|null); + } + + /** Represents a GetCloudBackupAction. */ + class GetCloudBackupAction implements IGetCloudBackupAction { + + /** + * Constructs a new GetCloudBackupAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.executor.v1.IGetCloudBackupAction); + + /** GetCloudBackupAction projectId. */ + public projectId: string; + + /** GetCloudBackupAction instanceId. */ + public instanceId: string; + + /** GetCloudBackupAction backupId. */ + public backupId: string; + + /** + * Creates a new GetCloudBackupAction instance using the specified properties. + * @param [properties] Properties to set + * @returns GetCloudBackupAction instance + */ + public static create(properties?: google.spanner.executor.v1.IGetCloudBackupAction): google.spanner.executor.v1.GetCloudBackupAction; + + /** + * Encodes the specified GetCloudBackupAction message. Does not implicitly {@link google.spanner.executor.v1.GetCloudBackupAction.verify|verify} messages. + * @param message GetCloudBackupAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.executor.v1.IGetCloudBackupAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetCloudBackupAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.GetCloudBackupAction.verify|verify} messages. + * @param message GetCloudBackupAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.executor.v1.IGetCloudBackupAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetCloudBackupAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetCloudBackupAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.GetCloudBackupAction; + + /** + * Decodes a GetCloudBackupAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetCloudBackupAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.GetCloudBackupAction; + + /** + * Verifies a GetCloudBackupAction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetCloudBackupAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetCloudBackupAction + */ + public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.GetCloudBackupAction; + + /** + * Creates a plain object from a GetCloudBackupAction message. Also converts values to other types if specified. + * @param message GetCloudBackupAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.executor.v1.GetCloudBackupAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetCloudBackupAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetCloudBackupAction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateCloudBackupAction. */ + interface IUpdateCloudBackupAction { + + /** UpdateCloudBackupAction projectId */ + projectId?: (string|null); + + /** UpdateCloudBackupAction instanceId */ + instanceId?: (string|null); + + /** UpdateCloudBackupAction backupId */ + backupId?: (string|null); + + /** UpdateCloudBackupAction expireTime */ + expireTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents an UpdateCloudBackupAction. */ + class UpdateCloudBackupAction implements IUpdateCloudBackupAction { + + /** + * Constructs a new UpdateCloudBackupAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.executor.v1.IUpdateCloudBackupAction); + + /** UpdateCloudBackupAction projectId. */ + public projectId: string; + + /** UpdateCloudBackupAction instanceId. */ + public instanceId: string; + + /** UpdateCloudBackupAction backupId. */ + public backupId: string; + + /** UpdateCloudBackupAction expireTime. */ + public expireTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new UpdateCloudBackupAction instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateCloudBackupAction instance + */ + public static create(properties?: google.spanner.executor.v1.IUpdateCloudBackupAction): google.spanner.executor.v1.UpdateCloudBackupAction; + + /** + * Encodes the specified UpdateCloudBackupAction message. Does not implicitly {@link google.spanner.executor.v1.UpdateCloudBackupAction.verify|verify} messages. + * @param message UpdateCloudBackupAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.executor.v1.IUpdateCloudBackupAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateCloudBackupAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.UpdateCloudBackupAction.verify|verify} messages. + * @param message UpdateCloudBackupAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.executor.v1.IUpdateCloudBackupAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateCloudBackupAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateCloudBackupAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.UpdateCloudBackupAction; + + /** + * Decodes an UpdateCloudBackupAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateCloudBackupAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.UpdateCloudBackupAction; + + /** + * Verifies an UpdateCloudBackupAction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateCloudBackupAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateCloudBackupAction + */ + public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.UpdateCloudBackupAction; + + /** + * Creates a plain object from an UpdateCloudBackupAction message. Also converts values to other types if specified. + * @param message UpdateCloudBackupAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.executor.v1.UpdateCloudBackupAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateCloudBackupAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateCloudBackupAction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteCloudBackupAction. */ + interface IDeleteCloudBackupAction { + + /** DeleteCloudBackupAction projectId */ + projectId?: (string|null); + + /** DeleteCloudBackupAction instanceId */ + instanceId?: (string|null); + + /** DeleteCloudBackupAction backupId */ + backupId?: (string|null); + } + + /** Represents a DeleteCloudBackupAction. */ + class DeleteCloudBackupAction implements IDeleteCloudBackupAction { + + /** + * Constructs a new DeleteCloudBackupAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.executor.v1.IDeleteCloudBackupAction); + + /** DeleteCloudBackupAction projectId. */ + public projectId: string; + + /** DeleteCloudBackupAction instanceId. */ + public instanceId: string; + + /** DeleteCloudBackupAction backupId. */ + public backupId: string; + + /** + * Creates a new DeleteCloudBackupAction instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteCloudBackupAction instance + */ + public static create(properties?: google.spanner.executor.v1.IDeleteCloudBackupAction): google.spanner.executor.v1.DeleteCloudBackupAction; + + /** + * Encodes the specified DeleteCloudBackupAction message. Does not implicitly {@link google.spanner.executor.v1.DeleteCloudBackupAction.verify|verify} messages. + * @param message DeleteCloudBackupAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.executor.v1.IDeleteCloudBackupAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteCloudBackupAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.DeleteCloudBackupAction.verify|verify} messages. + * @param message DeleteCloudBackupAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.executor.v1.IDeleteCloudBackupAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteCloudBackupAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteCloudBackupAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.DeleteCloudBackupAction; + + /** + * Decodes a DeleteCloudBackupAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteCloudBackupAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.DeleteCloudBackupAction; + + /** + * Verifies a DeleteCloudBackupAction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteCloudBackupAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteCloudBackupAction + */ + public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.DeleteCloudBackupAction; + + /** + * Creates a plain object from a DeleteCloudBackupAction message. Also converts values to other types if specified. + * @param message DeleteCloudBackupAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.executor.v1.DeleteCloudBackupAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteCloudBackupAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteCloudBackupAction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListCloudBackupsAction. */ + interface IListCloudBackupsAction { + + /** ListCloudBackupsAction projectId */ + projectId?: (string|null); + + /** ListCloudBackupsAction instanceId */ + instanceId?: (string|null); + + /** ListCloudBackupsAction filter */ + filter?: (string|null); + + /** ListCloudBackupsAction pageSize */ + pageSize?: (number|null); + + /** ListCloudBackupsAction pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListCloudBackupsAction. */ + class ListCloudBackupsAction implements IListCloudBackupsAction { + + /** + * Constructs a new ListCloudBackupsAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.executor.v1.IListCloudBackupsAction); + + /** ListCloudBackupsAction projectId. */ + public projectId: string; + + /** ListCloudBackupsAction instanceId. */ + public instanceId: string; + + /** ListCloudBackupsAction filter. */ + public filter: string; + + /** ListCloudBackupsAction pageSize. */ + public pageSize: number; + + /** ListCloudBackupsAction pageToken. */ + public pageToken: string; + + /** + * Creates a new ListCloudBackupsAction instance using the specified properties. + * @param [properties] Properties to set + * @returns ListCloudBackupsAction instance + */ + public static create(properties?: google.spanner.executor.v1.IListCloudBackupsAction): google.spanner.executor.v1.ListCloudBackupsAction; + + /** + * Encodes the specified ListCloudBackupsAction message. Does not implicitly {@link google.spanner.executor.v1.ListCloudBackupsAction.verify|verify} messages. + * @param message ListCloudBackupsAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.executor.v1.IListCloudBackupsAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListCloudBackupsAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.ListCloudBackupsAction.verify|verify} messages. + * @param message ListCloudBackupsAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.executor.v1.IListCloudBackupsAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListCloudBackupsAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListCloudBackupsAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.ListCloudBackupsAction; + + /** + * Decodes a ListCloudBackupsAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListCloudBackupsAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.ListCloudBackupsAction; + + /** + * Verifies a ListCloudBackupsAction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListCloudBackupsAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListCloudBackupsAction + */ + public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.ListCloudBackupsAction; + + /** + * Creates a plain object from a ListCloudBackupsAction message. Also converts values to other types if specified. + * @param message ListCloudBackupsAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.executor.v1.ListCloudBackupsAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListCloudBackupsAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListCloudBackupsAction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListCloudBackupOperationsAction. */ + interface IListCloudBackupOperationsAction { + + /** ListCloudBackupOperationsAction projectId */ + projectId?: (string|null); + + /** ListCloudBackupOperationsAction instanceId */ + instanceId?: (string|null); + + /** ListCloudBackupOperationsAction filter */ + filter?: (string|null); + + /** ListCloudBackupOperationsAction pageSize */ + pageSize?: (number|null); + + /** ListCloudBackupOperationsAction pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListCloudBackupOperationsAction. */ + class ListCloudBackupOperationsAction implements IListCloudBackupOperationsAction { + + /** + * Constructs a new ListCloudBackupOperationsAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.executor.v1.IListCloudBackupOperationsAction); + + /** ListCloudBackupOperationsAction projectId. */ + public projectId: string; + + /** ListCloudBackupOperationsAction instanceId. */ + public instanceId: string; + + /** ListCloudBackupOperationsAction filter. */ + public filter: string; + + /** ListCloudBackupOperationsAction pageSize. */ + public pageSize: number; + + /** ListCloudBackupOperationsAction pageToken. */ + public pageToken: string; + + /** + * Creates a new ListCloudBackupOperationsAction instance using the specified properties. + * @param [properties] Properties to set + * @returns ListCloudBackupOperationsAction instance + */ + public static create(properties?: google.spanner.executor.v1.IListCloudBackupOperationsAction): google.spanner.executor.v1.ListCloudBackupOperationsAction; + + /** + * Encodes the specified ListCloudBackupOperationsAction message. Does not implicitly {@link google.spanner.executor.v1.ListCloudBackupOperationsAction.verify|verify} messages. + * @param message ListCloudBackupOperationsAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.executor.v1.IListCloudBackupOperationsAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListCloudBackupOperationsAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.ListCloudBackupOperationsAction.verify|verify} messages. + * @param message ListCloudBackupOperationsAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.executor.v1.IListCloudBackupOperationsAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListCloudBackupOperationsAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListCloudBackupOperationsAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.ListCloudBackupOperationsAction; + + /** + * Decodes a ListCloudBackupOperationsAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListCloudBackupOperationsAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.ListCloudBackupOperationsAction; + + /** + * Verifies a ListCloudBackupOperationsAction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListCloudBackupOperationsAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListCloudBackupOperationsAction + */ + public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.ListCloudBackupOperationsAction; + + /** + * Creates a plain object from a ListCloudBackupOperationsAction message. Also converts values to other types if specified. + * @param message ListCloudBackupOperationsAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.executor.v1.ListCloudBackupOperationsAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListCloudBackupOperationsAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListCloudBackupOperationsAction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetOperationAction. */ + interface IGetOperationAction { + + /** GetOperationAction operation */ + operation?: (string|null); + } + + /** Represents a GetOperationAction. */ + class GetOperationAction implements IGetOperationAction { + + /** + * Constructs a new GetOperationAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.executor.v1.IGetOperationAction); + + /** GetOperationAction operation. */ + public operation: string; + + /** + * Creates a new GetOperationAction instance using the specified properties. + * @param [properties] Properties to set + * @returns GetOperationAction instance + */ + public static create(properties?: google.spanner.executor.v1.IGetOperationAction): google.spanner.executor.v1.GetOperationAction; + + /** + * Encodes the specified GetOperationAction message. Does not implicitly {@link google.spanner.executor.v1.GetOperationAction.verify|verify} messages. + * @param message GetOperationAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.executor.v1.IGetOperationAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetOperationAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.GetOperationAction.verify|verify} messages. + * @param message GetOperationAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.executor.v1.IGetOperationAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetOperationAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetOperationAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.GetOperationAction; + + /** + * Decodes a GetOperationAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetOperationAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.GetOperationAction; + + /** + * Verifies a GetOperationAction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetOperationAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetOperationAction + */ + public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.GetOperationAction; + + /** + * Creates a plain object from a GetOperationAction message. Also converts values to other types if specified. + * @param message GetOperationAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.executor.v1.GetOperationAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetOperationAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetOperationAction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a QueryCancellationAction. */ + interface IQueryCancellationAction { + + /** QueryCancellationAction longRunningSql */ + longRunningSql?: (string|null); + + /** QueryCancellationAction cancelQuery */ + cancelQuery?: (string|null); + } + + /** Represents a QueryCancellationAction. */ + class QueryCancellationAction implements IQueryCancellationAction { + + /** + * Constructs a new QueryCancellationAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.executor.v1.IQueryCancellationAction); + + /** QueryCancellationAction longRunningSql. */ + public longRunningSql: string; + + /** QueryCancellationAction cancelQuery. */ + public cancelQuery: string; + + /** + * Creates a new QueryCancellationAction instance using the specified properties. + * @param [properties] Properties to set + * @returns QueryCancellationAction instance + */ + public static create(properties?: google.spanner.executor.v1.IQueryCancellationAction): google.spanner.executor.v1.QueryCancellationAction; + + /** + * Encodes the specified QueryCancellationAction message. Does not implicitly {@link google.spanner.executor.v1.QueryCancellationAction.verify|verify} messages. + * @param message QueryCancellationAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.executor.v1.IQueryCancellationAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QueryCancellationAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.QueryCancellationAction.verify|verify} messages. + * @param message QueryCancellationAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.executor.v1.IQueryCancellationAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QueryCancellationAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QueryCancellationAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.QueryCancellationAction; + + /** + * Decodes a QueryCancellationAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QueryCancellationAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.QueryCancellationAction; + + /** + * Verifies a QueryCancellationAction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a QueryCancellationAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QueryCancellationAction + */ + public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.QueryCancellationAction; + + /** + * Creates a plain object from a QueryCancellationAction message. Also converts values to other types if specified. + * @param message QueryCancellationAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.executor.v1.QueryCancellationAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QueryCancellationAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for QueryCancellationAction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CancelOperationAction. */ + interface ICancelOperationAction { + + /** CancelOperationAction operation */ + operation?: (string|null); + } + + /** Represents a CancelOperationAction. */ + class CancelOperationAction implements ICancelOperationAction { + + /** + * Constructs a new CancelOperationAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.executor.v1.ICancelOperationAction); + + /** CancelOperationAction operation. */ + public operation: string; + + /** + * Creates a new CancelOperationAction instance using the specified properties. + * @param [properties] Properties to set + * @returns CancelOperationAction instance + */ + public static create(properties?: google.spanner.executor.v1.ICancelOperationAction): google.spanner.executor.v1.CancelOperationAction; + + /** + * Encodes the specified CancelOperationAction message. Does not implicitly {@link google.spanner.executor.v1.CancelOperationAction.verify|verify} messages. + * @param message CancelOperationAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.executor.v1.ICancelOperationAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CancelOperationAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.CancelOperationAction.verify|verify} messages. + * @param message CancelOperationAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.executor.v1.ICancelOperationAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CancelOperationAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CancelOperationAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.CancelOperationAction; + + /** + * Decodes a CancelOperationAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CancelOperationAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.CancelOperationAction; + + /** + * Verifies a CancelOperationAction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CancelOperationAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CancelOperationAction + */ + public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.CancelOperationAction; + + /** + * Creates a plain object from a CancelOperationAction message. Also converts values to other types if specified. + * @param message CancelOperationAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.executor.v1.CancelOperationAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CancelOperationAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CancelOperationAction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StartBatchTransactionAction. */ + interface IStartBatchTransactionAction { + + /** StartBatchTransactionAction batchTxnTime */ + batchTxnTime?: (google.protobuf.ITimestamp|null); + + /** StartBatchTransactionAction tid */ + tid?: (Uint8Array|Buffer|string|null); + + /** StartBatchTransactionAction cloudDatabaseRole */ + cloudDatabaseRole?: (string|null); + } + + /** Represents a StartBatchTransactionAction. */ + class StartBatchTransactionAction implements IStartBatchTransactionAction { + + /** + * Constructs a new StartBatchTransactionAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.executor.v1.IStartBatchTransactionAction); + + /** StartBatchTransactionAction batchTxnTime. */ + public batchTxnTime?: (google.protobuf.ITimestamp|null); + + /** StartBatchTransactionAction tid. */ + public tid?: (Uint8Array|Buffer|string|null); + + /** StartBatchTransactionAction cloudDatabaseRole. */ + public cloudDatabaseRole: string; + + /** StartBatchTransactionAction param. */ + public param?: ("batchTxnTime"|"tid"); + + /** + * Creates a new StartBatchTransactionAction instance using the specified properties. + * @param [properties] Properties to set + * @returns StartBatchTransactionAction instance + */ + public static create(properties?: google.spanner.executor.v1.IStartBatchTransactionAction): google.spanner.executor.v1.StartBatchTransactionAction; + + /** + * Encodes the specified StartBatchTransactionAction message. Does not implicitly {@link google.spanner.executor.v1.StartBatchTransactionAction.verify|verify} messages. + * @param message StartBatchTransactionAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.executor.v1.IStartBatchTransactionAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StartBatchTransactionAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.StartBatchTransactionAction.verify|verify} messages. + * @param message StartBatchTransactionAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.executor.v1.IStartBatchTransactionAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StartBatchTransactionAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StartBatchTransactionAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.StartBatchTransactionAction; + + /** + * Decodes a StartBatchTransactionAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StartBatchTransactionAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.StartBatchTransactionAction; + + /** + * Verifies a StartBatchTransactionAction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StartBatchTransactionAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StartBatchTransactionAction + */ + public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.StartBatchTransactionAction; + + /** + * Creates a plain object from a StartBatchTransactionAction message. Also converts values to other types if specified. + * @param message StartBatchTransactionAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.executor.v1.StartBatchTransactionAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StartBatchTransactionAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StartBatchTransactionAction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CloseBatchTransactionAction. */ + interface ICloseBatchTransactionAction { + + /** CloseBatchTransactionAction cleanup */ + cleanup?: (boolean|null); + } + + /** Represents a CloseBatchTransactionAction. */ + class CloseBatchTransactionAction implements ICloseBatchTransactionAction { + + /** + * Constructs a new CloseBatchTransactionAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.executor.v1.ICloseBatchTransactionAction); + + /** CloseBatchTransactionAction cleanup. */ + public cleanup: boolean; + + /** + * Creates a new CloseBatchTransactionAction instance using the specified properties. + * @param [properties] Properties to set + * @returns CloseBatchTransactionAction instance + */ + public static create(properties?: google.spanner.executor.v1.ICloseBatchTransactionAction): google.spanner.executor.v1.CloseBatchTransactionAction; + + /** + * Encodes the specified CloseBatchTransactionAction message. Does not implicitly {@link google.spanner.executor.v1.CloseBatchTransactionAction.verify|verify} messages. + * @param message CloseBatchTransactionAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.executor.v1.ICloseBatchTransactionAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CloseBatchTransactionAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.CloseBatchTransactionAction.verify|verify} messages. + * @param message CloseBatchTransactionAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.executor.v1.ICloseBatchTransactionAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CloseBatchTransactionAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CloseBatchTransactionAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.CloseBatchTransactionAction; + + /** + * Decodes a CloseBatchTransactionAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CloseBatchTransactionAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.CloseBatchTransactionAction; + + /** + * Verifies a CloseBatchTransactionAction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CloseBatchTransactionAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CloseBatchTransactionAction + */ + public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.CloseBatchTransactionAction; + + /** + * Creates a plain object from a CloseBatchTransactionAction message. Also converts values to other types if specified. + * @param message CloseBatchTransactionAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.executor.v1.CloseBatchTransactionAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CloseBatchTransactionAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CloseBatchTransactionAction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GenerateDbPartitionsForReadAction. */ + interface IGenerateDbPartitionsForReadAction { + + /** GenerateDbPartitionsForReadAction read */ + read?: (google.spanner.executor.v1.IReadAction|null); + + /** GenerateDbPartitionsForReadAction table */ + table?: (google.spanner.executor.v1.ITableMetadata[]|null); + + /** GenerateDbPartitionsForReadAction desiredBytesPerPartition */ + desiredBytesPerPartition?: (number|Long|string|null); + + /** GenerateDbPartitionsForReadAction maxPartitionCount */ + maxPartitionCount?: (number|Long|string|null); + } + + /** Represents a GenerateDbPartitionsForReadAction. */ + class GenerateDbPartitionsForReadAction implements IGenerateDbPartitionsForReadAction { + + /** + * Constructs a new GenerateDbPartitionsForReadAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.executor.v1.IGenerateDbPartitionsForReadAction); + + /** GenerateDbPartitionsForReadAction read. */ + public read?: (google.spanner.executor.v1.IReadAction|null); + + /** GenerateDbPartitionsForReadAction table. */ + public table: google.spanner.executor.v1.ITableMetadata[]; + + /** GenerateDbPartitionsForReadAction desiredBytesPerPartition. */ + public desiredBytesPerPartition?: (number|Long|string|null); + + /** GenerateDbPartitionsForReadAction maxPartitionCount. */ + public maxPartitionCount?: (number|Long|string|null); + + /** + * Creates a new GenerateDbPartitionsForReadAction instance using the specified properties. + * @param [properties] Properties to set + * @returns GenerateDbPartitionsForReadAction instance + */ + public static create(properties?: google.spanner.executor.v1.IGenerateDbPartitionsForReadAction): google.spanner.executor.v1.GenerateDbPartitionsForReadAction; + + /** + * Encodes the specified GenerateDbPartitionsForReadAction message. Does not implicitly {@link google.spanner.executor.v1.GenerateDbPartitionsForReadAction.verify|verify} messages. + * @param message GenerateDbPartitionsForReadAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.executor.v1.IGenerateDbPartitionsForReadAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GenerateDbPartitionsForReadAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.GenerateDbPartitionsForReadAction.verify|verify} messages. + * @param message GenerateDbPartitionsForReadAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.executor.v1.IGenerateDbPartitionsForReadAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GenerateDbPartitionsForReadAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GenerateDbPartitionsForReadAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.GenerateDbPartitionsForReadAction; + + /** + * Decodes a GenerateDbPartitionsForReadAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GenerateDbPartitionsForReadAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.GenerateDbPartitionsForReadAction; + + /** + * Verifies a GenerateDbPartitionsForReadAction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GenerateDbPartitionsForReadAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GenerateDbPartitionsForReadAction + */ + public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.GenerateDbPartitionsForReadAction; + + /** + * Creates a plain object from a GenerateDbPartitionsForReadAction message. Also converts values to other types if specified. + * @param message GenerateDbPartitionsForReadAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.executor.v1.GenerateDbPartitionsForReadAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GenerateDbPartitionsForReadAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GenerateDbPartitionsForReadAction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GenerateDbPartitionsForQueryAction. */ + interface IGenerateDbPartitionsForQueryAction { + + /** GenerateDbPartitionsForQueryAction query */ + query?: (google.spanner.executor.v1.IQueryAction|null); + + /** GenerateDbPartitionsForQueryAction desiredBytesPerPartition */ + desiredBytesPerPartition?: (number|Long|string|null); + } + + /** Represents a GenerateDbPartitionsForQueryAction. */ + class GenerateDbPartitionsForQueryAction implements IGenerateDbPartitionsForQueryAction { + + /** + * Constructs a new GenerateDbPartitionsForQueryAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.executor.v1.IGenerateDbPartitionsForQueryAction); + + /** GenerateDbPartitionsForQueryAction query. */ + public query?: (google.spanner.executor.v1.IQueryAction|null); + + /** GenerateDbPartitionsForQueryAction desiredBytesPerPartition. */ + public desiredBytesPerPartition?: (number|Long|string|null); + + /** + * Creates a new GenerateDbPartitionsForQueryAction instance using the specified properties. + * @param [properties] Properties to set + * @returns GenerateDbPartitionsForQueryAction instance + */ + public static create(properties?: google.spanner.executor.v1.IGenerateDbPartitionsForQueryAction): google.spanner.executor.v1.GenerateDbPartitionsForQueryAction; + + /** + * Encodes the specified GenerateDbPartitionsForQueryAction message. Does not implicitly {@link google.spanner.executor.v1.GenerateDbPartitionsForQueryAction.verify|verify} messages. + * @param message GenerateDbPartitionsForQueryAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.executor.v1.IGenerateDbPartitionsForQueryAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GenerateDbPartitionsForQueryAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.GenerateDbPartitionsForQueryAction.verify|verify} messages. + * @param message GenerateDbPartitionsForQueryAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.executor.v1.IGenerateDbPartitionsForQueryAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GenerateDbPartitionsForQueryAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GenerateDbPartitionsForQueryAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.GenerateDbPartitionsForQueryAction; + + /** + * Decodes a GenerateDbPartitionsForQueryAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GenerateDbPartitionsForQueryAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.GenerateDbPartitionsForQueryAction; + + /** + * Verifies a GenerateDbPartitionsForQueryAction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GenerateDbPartitionsForQueryAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GenerateDbPartitionsForQueryAction + */ + public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.GenerateDbPartitionsForQueryAction; + + /** + * Creates a plain object from a GenerateDbPartitionsForQueryAction message. Also converts values to other types if specified. + * @param message GenerateDbPartitionsForQueryAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.executor.v1.GenerateDbPartitionsForQueryAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GenerateDbPartitionsForQueryAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GenerateDbPartitionsForQueryAction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchPartition. */ + interface IBatchPartition { + + /** BatchPartition partition */ + partition?: (Uint8Array|Buffer|string|null); + + /** BatchPartition partitionToken */ + partitionToken?: (Uint8Array|Buffer|string|null); + + /** BatchPartition table */ + table?: (string|null); + + /** BatchPartition index */ + index?: (string|null); + } + + /** Represents a BatchPartition. */ + class BatchPartition implements IBatchPartition { + + /** + * Constructs a new BatchPartition. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.executor.v1.IBatchPartition); + + /** BatchPartition partition. */ + public partition: (Uint8Array|Buffer|string); + + /** BatchPartition partitionToken. */ + public partitionToken: (Uint8Array|Buffer|string); + + /** BatchPartition table. */ + public table?: (string|null); + + /** BatchPartition index. */ + public index?: (string|null); + + /** + * Creates a new BatchPartition instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchPartition instance + */ + public static create(properties?: google.spanner.executor.v1.IBatchPartition): google.spanner.executor.v1.BatchPartition; + + /** + * Encodes the specified BatchPartition message. Does not implicitly {@link google.spanner.executor.v1.BatchPartition.verify|verify} messages. + * @param message BatchPartition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.executor.v1.IBatchPartition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchPartition message, length delimited. Does not implicitly {@link google.spanner.executor.v1.BatchPartition.verify|verify} messages. + * @param message BatchPartition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.executor.v1.IBatchPartition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchPartition message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchPartition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.BatchPartition; + + /** + * Decodes a BatchPartition message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchPartition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.BatchPartition; + + /** + * Verifies a BatchPartition message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchPartition message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchPartition + */ + public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.BatchPartition; + + /** + * Creates a plain object from a BatchPartition message. Also converts values to other types if specified. + * @param message BatchPartition + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.executor.v1.BatchPartition, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchPartition to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchPartition + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExecutePartitionAction. */ + interface IExecutePartitionAction { + + /** ExecutePartitionAction partition */ + partition?: (google.spanner.executor.v1.IBatchPartition|null); + } + + /** Represents an ExecutePartitionAction. */ + class ExecutePartitionAction implements IExecutePartitionAction { + + /** + * Constructs a new ExecutePartitionAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.executor.v1.IExecutePartitionAction); + + /** ExecutePartitionAction partition. */ + public partition?: (google.spanner.executor.v1.IBatchPartition|null); + + /** + * Creates a new ExecutePartitionAction instance using the specified properties. + * @param [properties] Properties to set + * @returns ExecutePartitionAction instance + */ + public static create(properties?: google.spanner.executor.v1.IExecutePartitionAction): google.spanner.executor.v1.ExecutePartitionAction; + + /** + * Encodes the specified ExecutePartitionAction message. Does not implicitly {@link google.spanner.executor.v1.ExecutePartitionAction.verify|verify} messages. + * @param message ExecutePartitionAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.executor.v1.IExecutePartitionAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExecutePartitionAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.ExecutePartitionAction.verify|verify} messages. + * @param message ExecutePartitionAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.executor.v1.IExecutePartitionAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExecutePartitionAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExecutePartitionAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.ExecutePartitionAction; + + /** + * Decodes an ExecutePartitionAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExecutePartitionAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.ExecutePartitionAction; + + /** + * Verifies an ExecutePartitionAction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExecutePartitionAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExecutePartitionAction + */ + public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.ExecutePartitionAction; + + /** + * Creates a plain object from an ExecutePartitionAction message. Also converts values to other types if specified. + * @param message ExecutePartitionAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.executor.v1.ExecutePartitionAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExecutePartitionAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExecutePartitionAction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExecuteChangeStreamQuery. */ + interface IExecuteChangeStreamQuery { + + /** ExecuteChangeStreamQuery name */ + name?: (string|null); + + /** ExecuteChangeStreamQuery startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** ExecuteChangeStreamQuery endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** ExecuteChangeStreamQuery partitionToken */ + partitionToken?: (string|null); + + /** ExecuteChangeStreamQuery readOptions */ + readOptions?: (string[]|null); + + /** ExecuteChangeStreamQuery heartbeatMilliseconds */ + heartbeatMilliseconds?: (number|null); + + /** ExecuteChangeStreamQuery deadlineSeconds */ + deadlineSeconds?: (number|Long|string|null); + + /** ExecuteChangeStreamQuery cloudDatabaseRole */ + cloudDatabaseRole?: (string|null); + } + + /** Represents an ExecuteChangeStreamQuery. */ + class ExecuteChangeStreamQuery implements IExecuteChangeStreamQuery { + + /** + * Constructs a new ExecuteChangeStreamQuery. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.executor.v1.IExecuteChangeStreamQuery); + + /** ExecuteChangeStreamQuery name. */ + public name: string; + + /** ExecuteChangeStreamQuery startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** ExecuteChangeStreamQuery endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** ExecuteChangeStreamQuery partitionToken. */ + public partitionToken?: (string|null); + + /** ExecuteChangeStreamQuery readOptions. */ + public readOptions: string[]; + + /** ExecuteChangeStreamQuery heartbeatMilliseconds. */ + public heartbeatMilliseconds?: (number|null); + + /** ExecuteChangeStreamQuery deadlineSeconds. */ + public deadlineSeconds?: (number|Long|string|null); + + /** ExecuteChangeStreamQuery cloudDatabaseRole. */ + public cloudDatabaseRole?: (string|null); + + /** + * Creates a new ExecuteChangeStreamQuery instance using the specified properties. + * @param [properties] Properties to set + * @returns ExecuteChangeStreamQuery instance + */ + public static create(properties?: google.spanner.executor.v1.IExecuteChangeStreamQuery): google.spanner.executor.v1.ExecuteChangeStreamQuery; + + /** + * Encodes the specified ExecuteChangeStreamQuery message. Does not implicitly {@link google.spanner.executor.v1.ExecuteChangeStreamQuery.verify|verify} messages. + * @param message ExecuteChangeStreamQuery message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.executor.v1.IExecuteChangeStreamQuery, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExecuteChangeStreamQuery message, length delimited. Does not implicitly {@link google.spanner.executor.v1.ExecuteChangeStreamQuery.verify|verify} messages. + * @param message ExecuteChangeStreamQuery message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.executor.v1.IExecuteChangeStreamQuery, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExecuteChangeStreamQuery message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExecuteChangeStreamQuery + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.ExecuteChangeStreamQuery; + + /** + * Decodes an ExecuteChangeStreamQuery message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExecuteChangeStreamQuery + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.ExecuteChangeStreamQuery; + + /** + * Verifies an ExecuteChangeStreamQuery message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExecuteChangeStreamQuery message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExecuteChangeStreamQuery + */ + public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.ExecuteChangeStreamQuery; + + /** + * Creates a plain object from an ExecuteChangeStreamQuery message. Also converts values to other types if specified. + * @param message ExecuteChangeStreamQuery + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.executor.v1.ExecuteChangeStreamQuery, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExecuteChangeStreamQuery to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExecuteChangeStreamQuery + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SpannerActionOutcome. */ + interface ISpannerActionOutcome { + + /** SpannerActionOutcome status */ + status?: (google.rpc.IStatus|null); + + /** SpannerActionOutcome commitTime */ + commitTime?: (google.protobuf.ITimestamp|null); + + /** SpannerActionOutcome readResult */ + readResult?: (google.spanner.executor.v1.IReadResult|null); + + /** SpannerActionOutcome queryResult */ + queryResult?: (google.spanner.executor.v1.IQueryResult|null); + + /** SpannerActionOutcome transactionRestarted */ + transactionRestarted?: (boolean|null); + + /** SpannerActionOutcome batchTxnId */ + batchTxnId?: (Uint8Array|Buffer|string|null); + + /** SpannerActionOutcome dbPartition */ + dbPartition?: (google.spanner.executor.v1.IBatchPartition[]|null); + + /** SpannerActionOutcome adminResult */ + adminResult?: (google.spanner.executor.v1.IAdminResult|null); + + /** SpannerActionOutcome dmlRowsModified */ + dmlRowsModified?: ((number|Long|string)[]|null); + + /** SpannerActionOutcome changeStreamRecords */ + changeStreamRecords?: (google.spanner.executor.v1.IChangeStreamRecord[]|null); + } + + /** Represents a SpannerActionOutcome. */ + class SpannerActionOutcome implements ISpannerActionOutcome { + + /** + * Constructs a new SpannerActionOutcome. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.executor.v1.ISpannerActionOutcome); + + /** SpannerActionOutcome status. */ + public status?: (google.rpc.IStatus|null); + + /** SpannerActionOutcome commitTime. */ + public commitTime?: (google.protobuf.ITimestamp|null); + + /** SpannerActionOutcome readResult. */ + public readResult?: (google.spanner.executor.v1.IReadResult|null); + + /** SpannerActionOutcome queryResult. */ + public queryResult?: (google.spanner.executor.v1.IQueryResult|null); + + /** SpannerActionOutcome transactionRestarted. */ + public transactionRestarted?: (boolean|null); + + /** SpannerActionOutcome batchTxnId. */ + public batchTxnId?: (Uint8Array|Buffer|string|null); + + /** SpannerActionOutcome dbPartition. */ + public dbPartition: google.spanner.executor.v1.IBatchPartition[]; + + /** SpannerActionOutcome adminResult. */ + public adminResult?: (google.spanner.executor.v1.IAdminResult|null); + + /** SpannerActionOutcome dmlRowsModified. */ + public dmlRowsModified: (number|Long|string)[]; + + /** SpannerActionOutcome changeStreamRecords. */ + public changeStreamRecords: google.spanner.executor.v1.IChangeStreamRecord[]; + + /** + * Creates a new SpannerActionOutcome instance using the specified properties. + * @param [properties] Properties to set + * @returns SpannerActionOutcome instance + */ + public static create(properties?: google.spanner.executor.v1.ISpannerActionOutcome): google.spanner.executor.v1.SpannerActionOutcome; + + /** + * Encodes the specified SpannerActionOutcome message. Does not implicitly {@link google.spanner.executor.v1.SpannerActionOutcome.verify|verify} messages. + * @param message SpannerActionOutcome message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.executor.v1.ISpannerActionOutcome, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SpannerActionOutcome message, length delimited. Does not implicitly {@link google.spanner.executor.v1.SpannerActionOutcome.verify|verify} messages. + * @param message SpannerActionOutcome message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.executor.v1.ISpannerActionOutcome, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SpannerActionOutcome message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SpannerActionOutcome + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.SpannerActionOutcome; + + /** + * Decodes a SpannerActionOutcome message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SpannerActionOutcome + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.SpannerActionOutcome; + + /** + * Verifies a SpannerActionOutcome message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SpannerActionOutcome message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SpannerActionOutcome + */ + public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.SpannerActionOutcome; + + /** + * Creates a plain object from a SpannerActionOutcome message. Also converts values to other types if specified. + * @param message SpannerActionOutcome + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.executor.v1.SpannerActionOutcome, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SpannerActionOutcome to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SpannerActionOutcome + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AdminResult. */ + interface IAdminResult { + + /** AdminResult backupResponse */ + backupResponse?: (google.spanner.executor.v1.ICloudBackupResponse|null); + + /** AdminResult operationResponse */ + operationResponse?: (google.spanner.executor.v1.IOperationResponse|null); + + /** AdminResult databaseResponse */ + databaseResponse?: (google.spanner.executor.v1.ICloudDatabaseResponse|null); + + /** AdminResult instanceResponse */ + instanceResponse?: (google.spanner.executor.v1.ICloudInstanceResponse|null); + + /** AdminResult instanceConfigResponse */ + instanceConfigResponse?: (google.spanner.executor.v1.ICloudInstanceConfigResponse|null); + } + + /** Represents an AdminResult. */ + class AdminResult implements IAdminResult { + + /** + * Constructs a new AdminResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.executor.v1.IAdminResult); + + /** AdminResult backupResponse. */ + public backupResponse?: (google.spanner.executor.v1.ICloudBackupResponse|null); + + /** AdminResult operationResponse. */ + public operationResponse?: (google.spanner.executor.v1.IOperationResponse|null); + + /** AdminResult databaseResponse. */ + public databaseResponse?: (google.spanner.executor.v1.ICloudDatabaseResponse|null); + + /** AdminResult instanceResponse. */ + public instanceResponse?: (google.spanner.executor.v1.ICloudInstanceResponse|null); + + /** AdminResult instanceConfigResponse. */ + public instanceConfigResponse?: (google.spanner.executor.v1.ICloudInstanceConfigResponse|null); + + /** + * Creates a new AdminResult instance using the specified properties. + * @param [properties] Properties to set + * @returns AdminResult instance + */ + public static create(properties?: google.spanner.executor.v1.IAdminResult): google.spanner.executor.v1.AdminResult; + + /** + * Encodes the specified AdminResult message. Does not implicitly {@link google.spanner.executor.v1.AdminResult.verify|verify} messages. + * @param message AdminResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.executor.v1.IAdminResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AdminResult message, length delimited. Does not implicitly {@link google.spanner.executor.v1.AdminResult.verify|verify} messages. + * @param message AdminResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.executor.v1.IAdminResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AdminResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AdminResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.AdminResult; + + /** + * Decodes an AdminResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AdminResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.AdminResult; + + /** + * Verifies an AdminResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AdminResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AdminResult + */ + public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.AdminResult; + + /** + * Creates a plain object from an AdminResult message. Also converts values to other types if specified. + * @param message AdminResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.executor.v1.AdminResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AdminResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AdminResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CloudBackupResponse. */ + interface ICloudBackupResponse { + + /** CloudBackupResponse listedBackups */ + listedBackups?: (google.spanner.admin.database.v1.IBackup[]|null); + + /** CloudBackupResponse listedBackupOperations */ + listedBackupOperations?: (google.longrunning.IOperation[]|null); + + /** CloudBackupResponse nextPageToken */ + nextPageToken?: (string|null); + + /** CloudBackupResponse backup */ + backup?: (google.spanner.admin.database.v1.IBackup|null); + } + + /** Represents a CloudBackupResponse. */ + class CloudBackupResponse implements ICloudBackupResponse { + + /** + * Constructs a new CloudBackupResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.executor.v1.ICloudBackupResponse); + + /** CloudBackupResponse listedBackups. */ + public listedBackups: google.spanner.admin.database.v1.IBackup[]; + + /** CloudBackupResponse listedBackupOperations. */ + public listedBackupOperations: google.longrunning.IOperation[]; + + /** CloudBackupResponse nextPageToken. */ + public nextPageToken: string; + + /** CloudBackupResponse backup. */ + public backup?: (google.spanner.admin.database.v1.IBackup|null); + + /** + * Creates a new CloudBackupResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns CloudBackupResponse instance + */ + public static create(properties?: google.spanner.executor.v1.ICloudBackupResponse): google.spanner.executor.v1.CloudBackupResponse; + + /** + * Encodes the specified CloudBackupResponse message. Does not implicitly {@link google.spanner.executor.v1.CloudBackupResponse.verify|verify} messages. + * @param message CloudBackupResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.executor.v1.ICloudBackupResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CloudBackupResponse message, length delimited. Does not implicitly {@link google.spanner.executor.v1.CloudBackupResponse.verify|verify} messages. + * @param message CloudBackupResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.executor.v1.ICloudBackupResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CloudBackupResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CloudBackupResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.CloudBackupResponse; + + /** + * Decodes a CloudBackupResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CloudBackupResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.CloudBackupResponse; + + /** + * Verifies a CloudBackupResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CloudBackupResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CloudBackupResponse + */ + public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.CloudBackupResponse; + + /** + * Creates a plain object from a CloudBackupResponse message. Also converts values to other types if specified. + * @param message CloudBackupResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.executor.v1.CloudBackupResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CloudBackupResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CloudBackupResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OperationResponse. */ + interface IOperationResponse { + + /** OperationResponse listedOperations */ + listedOperations?: (google.longrunning.IOperation[]|null); + + /** OperationResponse nextPageToken */ + nextPageToken?: (string|null); + + /** OperationResponse operation */ + operation?: (google.longrunning.IOperation|null); + } + + /** Represents an OperationResponse. */ + class OperationResponse implements IOperationResponse { + + /** + * Constructs a new OperationResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.executor.v1.IOperationResponse); + + /** OperationResponse listedOperations. */ + public listedOperations: google.longrunning.IOperation[]; + + /** OperationResponse nextPageToken. */ + public nextPageToken: string; + + /** OperationResponse operation. */ + public operation?: (google.longrunning.IOperation|null); + + /** + * Creates a new OperationResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationResponse instance + */ + public static create(properties?: google.spanner.executor.v1.IOperationResponse): google.spanner.executor.v1.OperationResponse; + + /** + * Encodes the specified OperationResponse message. Does not implicitly {@link google.spanner.executor.v1.OperationResponse.verify|verify} messages. + * @param message OperationResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.executor.v1.IOperationResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationResponse message, length delimited. Does not implicitly {@link google.spanner.executor.v1.OperationResponse.verify|verify} messages. + * @param message OperationResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.executor.v1.IOperationResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.OperationResponse; + + /** + * Decodes an OperationResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.OperationResponse; + + /** + * Verifies an OperationResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OperationResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationResponse + */ + public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.OperationResponse; + + /** + * Creates a plain object from an OperationResponse message. Also converts values to other types if specified. + * @param message OperationResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.executor.v1.OperationResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OperationResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CloudInstanceResponse. */ + interface ICloudInstanceResponse { + + /** CloudInstanceResponse listedInstances */ + listedInstances?: (google.spanner.admin.instance.v1.IInstance[]|null); + + /** CloudInstanceResponse nextPageToken */ + nextPageToken?: (string|null); + + /** CloudInstanceResponse instance */ + instance?: (google.spanner.admin.instance.v1.IInstance|null); + } + + /** Represents a CloudInstanceResponse. */ + class CloudInstanceResponse implements ICloudInstanceResponse { + + /** + * Constructs a new CloudInstanceResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.executor.v1.ICloudInstanceResponse); + + /** CloudInstanceResponse listedInstances. */ + public listedInstances: google.spanner.admin.instance.v1.IInstance[]; + + /** CloudInstanceResponse nextPageToken. */ + public nextPageToken: string; + + /** CloudInstanceResponse instance. */ + public instance?: (google.spanner.admin.instance.v1.IInstance|null); + + /** + * Creates a new CloudInstanceResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns CloudInstanceResponse instance + */ + public static create(properties?: google.spanner.executor.v1.ICloudInstanceResponse): google.spanner.executor.v1.CloudInstanceResponse; + + /** + * Encodes the specified CloudInstanceResponse message. Does not implicitly {@link google.spanner.executor.v1.CloudInstanceResponse.verify|verify} messages. + * @param message CloudInstanceResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.executor.v1.ICloudInstanceResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CloudInstanceResponse message, length delimited. Does not implicitly {@link google.spanner.executor.v1.CloudInstanceResponse.verify|verify} messages. + * @param message CloudInstanceResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.executor.v1.ICloudInstanceResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CloudInstanceResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CloudInstanceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.CloudInstanceResponse; + + /** + * Decodes a CloudInstanceResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CloudInstanceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.CloudInstanceResponse; + + /** + * Verifies a CloudInstanceResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CloudInstanceResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CloudInstanceResponse + */ + public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.CloudInstanceResponse; + + /** + * Creates a plain object from a CloudInstanceResponse message. Also converts values to other types if specified. + * @param message CloudInstanceResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.executor.v1.CloudInstanceResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CloudInstanceResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CloudInstanceResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CloudInstanceConfigResponse. */ + interface ICloudInstanceConfigResponse { + + /** CloudInstanceConfigResponse listedInstanceConfigs */ + listedInstanceConfigs?: (google.spanner.admin.instance.v1.IInstanceConfig[]|null); + + /** CloudInstanceConfigResponse nextPageToken */ + nextPageToken?: (string|null); + + /** CloudInstanceConfigResponse instanceConfig */ + instanceConfig?: (google.spanner.admin.instance.v1.IInstanceConfig|null); + } + + /** Represents a CloudInstanceConfigResponse. */ + class CloudInstanceConfigResponse implements ICloudInstanceConfigResponse { + + /** + * Constructs a new CloudInstanceConfigResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.executor.v1.ICloudInstanceConfigResponse); + + /** CloudInstanceConfigResponse listedInstanceConfigs. */ + public listedInstanceConfigs: google.spanner.admin.instance.v1.IInstanceConfig[]; + + /** CloudInstanceConfigResponse nextPageToken. */ + public nextPageToken: string; + + /** CloudInstanceConfigResponse instanceConfig. */ + public instanceConfig?: (google.spanner.admin.instance.v1.IInstanceConfig|null); + + /** + * Creates a new CloudInstanceConfigResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns CloudInstanceConfigResponse instance + */ + public static create(properties?: google.spanner.executor.v1.ICloudInstanceConfigResponse): google.spanner.executor.v1.CloudInstanceConfigResponse; + + /** + * Encodes the specified CloudInstanceConfigResponse message. Does not implicitly {@link google.spanner.executor.v1.CloudInstanceConfigResponse.verify|verify} messages. + * @param message CloudInstanceConfigResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.executor.v1.ICloudInstanceConfigResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CloudInstanceConfigResponse message, length delimited. Does not implicitly {@link google.spanner.executor.v1.CloudInstanceConfigResponse.verify|verify} messages. + * @param message CloudInstanceConfigResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.executor.v1.ICloudInstanceConfigResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CloudInstanceConfigResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CloudInstanceConfigResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.CloudInstanceConfigResponse; + + /** + * Decodes a CloudInstanceConfigResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CloudInstanceConfigResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.CloudInstanceConfigResponse; + + /** + * Verifies a CloudInstanceConfigResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CloudInstanceConfigResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CloudInstanceConfigResponse + */ + public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.CloudInstanceConfigResponse; + + /** + * Creates a plain object from a CloudInstanceConfigResponse message. Also converts values to other types if specified. + * @param message CloudInstanceConfigResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.executor.v1.CloudInstanceConfigResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CloudInstanceConfigResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CloudInstanceConfigResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CloudDatabaseResponse. */ + interface ICloudDatabaseResponse { + + /** CloudDatabaseResponse listedDatabases */ + listedDatabases?: (google.spanner.admin.database.v1.IDatabase[]|null); + + /** CloudDatabaseResponse listedDatabaseOperations */ + listedDatabaseOperations?: (google.longrunning.IOperation[]|null); + + /** CloudDatabaseResponse nextPageToken */ + nextPageToken?: (string|null); + + /** CloudDatabaseResponse database */ + database?: (google.spanner.admin.database.v1.IDatabase|null); + } + + /** Represents a CloudDatabaseResponse. */ + class CloudDatabaseResponse implements ICloudDatabaseResponse { + + /** + * Constructs a new CloudDatabaseResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.executor.v1.ICloudDatabaseResponse); + + /** CloudDatabaseResponse listedDatabases. */ + public listedDatabases: google.spanner.admin.database.v1.IDatabase[]; + + /** CloudDatabaseResponse listedDatabaseOperations. */ + public listedDatabaseOperations: google.longrunning.IOperation[]; + + /** CloudDatabaseResponse nextPageToken. */ + public nextPageToken: string; + + /** CloudDatabaseResponse database. */ + public database?: (google.spanner.admin.database.v1.IDatabase|null); + + /** + * Creates a new CloudDatabaseResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns CloudDatabaseResponse instance + */ + public static create(properties?: google.spanner.executor.v1.ICloudDatabaseResponse): google.spanner.executor.v1.CloudDatabaseResponse; + + /** + * Encodes the specified CloudDatabaseResponse message. Does not implicitly {@link google.spanner.executor.v1.CloudDatabaseResponse.verify|verify} messages. + * @param message CloudDatabaseResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.executor.v1.ICloudDatabaseResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CloudDatabaseResponse message, length delimited. Does not implicitly {@link google.spanner.executor.v1.CloudDatabaseResponse.verify|verify} messages. + * @param message CloudDatabaseResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.executor.v1.ICloudDatabaseResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CloudDatabaseResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CloudDatabaseResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.CloudDatabaseResponse; + + /** + * Decodes a CloudDatabaseResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CloudDatabaseResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.CloudDatabaseResponse; + + /** + * Verifies a CloudDatabaseResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CloudDatabaseResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CloudDatabaseResponse + */ + public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.CloudDatabaseResponse; + + /** + * Creates a plain object from a CloudDatabaseResponse message. Also converts values to other types if specified. + * @param message CloudDatabaseResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.executor.v1.CloudDatabaseResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CloudDatabaseResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CloudDatabaseResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReadResult. */ + interface IReadResult { + + /** ReadResult table */ + table?: (string|null); + + /** ReadResult index */ + index?: (string|null); + + /** ReadResult requestIndex */ + requestIndex?: (number|null); + + /** ReadResult row */ + row?: (google.spanner.executor.v1.IValueList[]|null); + + /** ReadResult rowType */ + rowType?: (google.spanner.v1.IStructType|null); + } + + /** Represents a ReadResult. */ + class ReadResult implements IReadResult { + + /** + * Constructs a new ReadResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.executor.v1.IReadResult); + + /** ReadResult table. */ + public table: string; + + /** ReadResult index. */ + public index?: (string|null); + + /** ReadResult requestIndex. */ + public requestIndex?: (number|null); + + /** ReadResult row. */ + public row: google.spanner.executor.v1.IValueList[]; + + /** ReadResult rowType. */ + public rowType?: (google.spanner.v1.IStructType|null); + + /** + * Creates a new ReadResult instance using the specified properties. + * @param [properties] Properties to set + * @returns ReadResult instance + */ + public static create(properties?: google.spanner.executor.v1.IReadResult): google.spanner.executor.v1.ReadResult; + + /** + * Encodes the specified ReadResult message. Does not implicitly {@link google.spanner.executor.v1.ReadResult.verify|verify} messages. + * @param message ReadResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.executor.v1.IReadResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReadResult message, length delimited. Does not implicitly {@link google.spanner.executor.v1.ReadResult.verify|verify} messages. + * @param message ReadResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.executor.v1.IReadResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReadResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReadResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.ReadResult; + + /** + * Decodes a ReadResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReadResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.ReadResult; + + /** + * Verifies a ReadResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReadResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReadResult + */ + public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.ReadResult; + + /** + * Creates a plain object from a ReadResult message. Also converts values to other types if specified. + * @param message ReadResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.executor.v1.ReadResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReadResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReadResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a QueryResult. */ + interface IQueryResult { + + /** QueryResult row */ + row?: (google.spanner.executor.v1.IValueList[]|null); + + /** QueryResult rowType */ + rowType?: (google.spanner.v1.IStructType|null); + } + + /** Represents a QueryResult. */ + class QueryResult implements IQueryResult { + + /** + * Constructs a new QueryResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.executor.v1.IQueryResult); + + /** QueryResult row. */ + public row: google.spanner.executor.v1.IValueList[]; + + /** QueryResult rowType. */ + public rowType?: (google.spanner.v1.IStructType|null); + + /** + * Creates a new QueryResult instance using the specified properties. + * @param [properties] Properties to set + * @returns QueryResult instance + */ + public static create(properties?: google.spanner.executor.v1.IQueryResult): google.spanner.executor.v1.QueryResult; + + /** + * Encodes the specified QueryResult message. Does not implicitly {@link google.spanner.executor.v1.QueryResult.verify|verify} messages. + * @param message QueryResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.executor.v1.IQueryResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QueryResult message, length delimited. Does not implicitly {@link google.spanner.executor.v1.QueryResult.verify|verify} messages. + * @param message QueryResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.executor.v1.IQueryResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QueryResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QueryResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.QueryResult; + + /** + * Decodes a QueryResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QueryResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.QueryResult; + + /** + * Verifies a QueryResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a QueryResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QueryResult + */ + public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.QueryResult; + + /** + * Creates a plain object from a QueryResult message. Also converts values to other types if specified. + * @param message QueryResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.executor.v1.QueryResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QueryResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for QueryResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ChangeStreamRecord. */ + interface IChangeStreamRecord { + + /** ChangeStreamRecord dataChange */ + dataChange?: (google.spanner.executor.v1.IDataChangeRecord|null); + + /** ChangeStreamRecord childPartition */ + childPartition?: (google.spanner.executor.v1.IChildPartitionsRecord|null); + + /** ChangeStreamRecord heartbeat */ + heartbeat?: (google.spanner.executor.v1.IHeartbeatRecord|null); + } + + /** Represents a ChangeStreamRecord. */ + class ChangeStreamRecord implements IChangeStreamRecord { + + /** + * Constructs a new ChangeStreamRecord. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.executor.v1.IChangeStreamRecord); + + /** ChangeStreamRecord dataChange. */ + public dataChange?: (google.spanner.executor.v1.IDataChangeRecord|null); + + /** ChangeStreamRecord childPartition. */ + public childPartition?: (google.spanner.executor.v1.IChildPartitionsRecord|null); + + /** ChangeStreamRecord heartbeat. */ + public heartbeat?: (google.spanner.executor.v1.IHeartbeatRecord|null); + + /** ChangeStreamRecord record. */ + public record?: ("dataChange"|"childPartition"|"heartbeat"); + + /** + * Creates a new ChangeStreamRecord instance using the specified properties. + * @param [properties] Properties to set + * @returns ChangeStreamRecord instance + */ + public static create(properties?: google.spanner.executor.v1.IChangeStreamRecord): google.spanner.executor.v1.ChangeStreamRecord; + + /** + * Encodes the specified ChangeStreamRecord message. Does not implicitly {@link google.spanner.executor.v1.ChangeStreamRecord.verify|verify} messages. + * @param message ChangeStreamRecord message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.executor.v1.IChangeStreamRecord, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ChangeStreamRecord message, length delimited. Does not implicitly {@link google.spanner.executor.v1.ChangeStreamRecord.verify|verify} messages. + * @param message ChangeStreamRecord message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.executor.v1.IChangeStreamRecord, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ChangeStreamRecord message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ChangeStreamRecord + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.ChangeStreamRecord; + + /** + * Decodes a ChangeStreamRecord message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ChangeStreamRecord + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.ChangeStreamRecord; + + /** + * Verifies a ChangeStreamRecord message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ChangeStreamRecord message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ChangeStreamRecord + */ + public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.ChangeStreamRecord; + + /** + * Creates a plain object from a ChangeStreamRecord message. Also converts values to other types if specified. + * @param message ChangeStreamRecord + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.executor.v1.ChangeStreamRecord, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ChangeStreamRecord to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ChangeStreamRecord + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DataChangeRecord. */ + interface IDataChangeRecord { + + /** DataChangeRecord commitTime */ + commitTime?: (google.protobuf.ITimestamp|null); + + /** DataChangeRecord recordSequence */ + recordSequence?: (string|null); + + /** DataChangeRecord transactionId */ + transactionId?: (string|null); + + /** DataChangeRecord isLastRecord */ + isLastRecord?: (boolean|null); + + /** DataChangeRecord table */ + table?: (string|null); + + /** DataChangeRecord columnTypes */ + columnTypes?: (google.spanner.executor.v1.DataChangeRecord.IColumnType[]|null); + + /** DataChangeRecord mods */ + mods?: (google.spanner.executor.v1.DataChangeRecord.IMod[]|null); + + /** DataChangeRecord modType */ + modType?: (string|null); + + /** DataChangeRecord valueCaptureType */ + valueCaptureType?: (string|null); + + /** DataChangeRecord recordCount */ + recordCount?: (number|Long|string|null); + + /** DataChangeRecord partitionCount */ + partitionCount?: (number|Long|string|null); + + /** DataChangeRecord transactionTag */ + transactionTag?: (string|null); + + /** DataChangeRecord isSystemTransaction */ + isSystemTransaction?: (boolean|null); + } + + /** Represents a DataChangeRecord. */ + class DataChangeRecord implements IDataChangeRecord { + + /** + * Constructs a new DataChangeRecord. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.executor.v1.IDataChangeRecord); + + /** DataChangeRecord commitTime. */ + public commitTime?: (google.protobuf.ITimestamp|null); + + /** DataChangeRecord recordSequence. */ + public recordSequence: string; + + /** DataChangeRecord transactionId. */ + public transactionId: string; + + /** DataChangeRecord isLastRecord. */ + public isLastRecord: boolean; + + /** DataChangeRecord table. */ + public table: string; + + /** DataChangeRecord columnTypes. */ + public columnTypes: google.spanner.executor.v1.DataChangeRecord.IColumnType[]; + + /** DataChangeRecord mods. */ + public mods: google.spanner.executor.v1.DataChangeRecord.IMod[]; + + /** DataChangeRecord modType. */ + public modType: string; + + /** DataChangeRecord valueCaptureType. */ + public valueCaptureType: string; + + /** DataChangeRecord recordCount. */ + public recordCount: (number|Long|string); + + /** DataChangeRecord partitionCount. */ + public partitionCount: (number|Long|string); + + /** DataChangeRecord transactionTag. */ + public transactionTag: string; + + /** DataChangeRecord isSystemTransaction. */ + public isSystemTransaction: boolean; + + /** + * Creates a new DataChangeRecord instance using the specified properties. + * @param [properties] Properties to set + * @returns DataChangeRecord instance + */ + public static create(properties?: google.spanner.executor.v1.IDataChangeRecord): google.spanner.executor.v1.DataChangeRecord; + + /** + * Encodes the specified DataChangeRecord message. Does not implicitly {@link google.spanner.executor.v1.DataChangeRecord.verify|verify} messages. + * @param message DataChangeRecord message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.executor.v1.IDataChangeRecord, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DataChangeRecord message, length delimited. Does not implicitly {@link google.spanner.executor.v1.DataChangeRecord.verify|verify} messages. + * @param message DataChangeRecord message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.executor.v1.IDataChangeRecord, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DataChangeRecord message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DataChangeRecord + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.DataChangeRecord; + + /** + * Decodes a DataChangeRecord message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DataChangeRecord + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.DataChangeRecord; + + /** + * Verifies a DataChangeRecord message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DataChangeRecord message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DataChangeRecord + */ + public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.DataChangeRecord; + + /** + * Creates a plain object from a DataChangeRecord message. Also converts values to other types if specified. + * @param message DataChangeRecord + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.executor.v1.DataChangeRecord, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DataChangeRecord to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DataChangeRecord + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DataChangeRecord { + + /** Properties of a ColumnType. */ + interface IColumnType { + + /** ColumnType name */ + name?: (string|null); + + /** ColumnType type */ + type?: (string|null); + + /** ColumnType isPrimaryKey */ + isPrimaryKey?: (boolean|null); + + /** ColumnType ordinalPosition */ + ordinalPosition?: (number|Long|string|null); + } + + /** Represents a ColumnType. */ + class ColumnType implements IColumnType { + + /** + * Constructs a new ColumnType. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.executor.v1.DataChangeRecord.IColumnType); + + /** ColumnType name. */ + public name: string; + + /** ColumnType type. */ + public type: string; + + /** ColumnType isPrimaryKey. */ + public isPrimaryKey: boolean; + + /** ColumnType ordinalPosition. */ + public ordinalPosition: (number|Long|string); + + /** + * Creates a new ColumnType instance using the specified properties. + * @param [properties] Properties to set + * @returns ColumnType instance + */ + public static create(properties?: google.spanner.executor.v1.DataChangeRecord.IColumnType): google.spanner.executor.v1.DataChangeRecord.ColumnType; + + /** + * Encodes the specified ColumnType message. Does not implicitly {@link google.spanner.executor.v1.DataChangeRecord.ColumnType.verify|verify} messages. + * @param message ColumnType message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.executor.v1.DataChangeRecord.IColumnType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ColumnType message, length delimited. Does not implicitly {@link google.spanner.executor.v1.DataChangeRecord.ColumnType.verify|verify} messages. + * @param message ColumnType message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.executor.v1.DataChangeRecord.IColumnType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ColumnType message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ColumnType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.DataChangeRecord.ColumnType; + + /** + * Decodes a ColumnType message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ColumnType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.DataChangeRecord.ColumnType; + + /** + * Verifies a ColumnType message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ColumnType message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ColumnType + */ + public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.DataChangeRecord.ColumnType; + + /** + * Creates a plain object from a ColumnType message. Also converts values to other types if specified. + * @param message ColumnType + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.executor.v1.DataChangeRecord.ColumnType, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ColumnType to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ColumnType + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Mod. */ + interface IMod { + + /** Mod keys */ + keys?: (string|null); + + /** Mod newValues */ + newValues?: (string|null); + + /** Mod oldValues */ + oldValues?: (string|null); + } + + /** Represents a Mod. */ + class Mod implements IMod { + + /** + * Constructs a new Mod. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.executor.v1.DataChangeRecord.IMod); + + /** Mod keys. */ + public keys: string; + + /** Mod newValues. */ + public newValues: string; + + /** Mod oldValues. */ + public oldValues: string; + + /** + * Creates a new Mod instance using the specified properties. + * @param [properties] Properties to set + * @returns Mod instance + */ + public static create(properties?: google.spanner.executor.v1.DataChangeRecord.IMod): google.spanner.executor.v1.DataChangeRecord.Mod; + + /** + * Encodes the specified Mod message. Does not implicitly {@link google.spanner.executor.v1.DataChangeRecord.Mod.verify|verify} messages. + * @param message Mod message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.executor.v1.DataChangeRecord.IMod, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Mod message, length delimited. Does not implicitly {@link google.spanner.executor.v1.DataChangeRecord.Mod.verify|verify} messages. + * @param message Mod message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.executor.v1.DataChangeRecord.IMod, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Mod message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Mod + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.DataChangeRecord.Mod; + + /** + * Decodes a Mod message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Mod + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.DataChangeRecord.Mod; + + /** + * Verifies a Mod message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Mod message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Mod + */ + public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.DataChangeRecord.Mod; + + /** + * Creates a plain object from a Mod message. Also converts values to other types if specified. + * @param message Mod + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.executor.v1.DataChangeRecord.Mod, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Mod to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Mod + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a ChildPartitionsRecord. */ + interface IChildPartitionsRecord { + + /** ChildPartitionsRecord startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** ChildPartitionsRecord recordSequence */ + recordSequence?: (string|null); + + /** ChildPartitionsRecord childPartitions */ + childPartitions?: (google.spanner.executor.v1.ChildPartitionsRecord.IChildPartition[]|null); + } + + /** Represents a ChildPartitionsRecord. */ + class ChildPartitionsRecord implements IChildPartitionsRecord { + + /** + * Constructs a new ChildPartitionsRecord. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.executor.v1.IChildPartitionsRecord); + + /** ChildPartitionsRecord startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** ChildPartitionsRecord recordSequence. */ + public recordSequence: string; + + /** ChildPartitionsRecord childPartitions. */ + public childPartitions: google.spanner.executor.v1.ChildPartitionsRecord.IChildPartition[]; + + /** + * Creates a new ChildPartitionsRecord instance using the specified properties. + * @param [properties] Properties to set + * @returns ChildPartitionsRecord instance + */ + public static create(properties?: google.spanner.executor.v1.IChildPartitionsRecord): google.spanner.executor.v1.ChildPartitionsRecord; + + /** + * Encodes the specified ChildPartitionsRecord message. Does not implicitly {@link google.spanner.executor.v1.ChildPartitionsRecord.verify|verify} messages. + * @param message ChildPartitionsRecord message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.executor.v1.IChildPartitionsRecord, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ChildPartitionsRecord message, length delimited. Does not implicitly {@link google.spanner.executor.v1.ChildPartitionsRecord.verify|verify} messages. + * @param message ChildPartitionsRecord message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.executor.v1.IChildPartitionsRecord, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ChildPartitionsRecord message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ChildPartitionsRecord + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.ChildPartitionsRecord; + + /** + * Decodes a ChildPartitionsRecord message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ChildPartitionsRecord + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.ChildPartitionsRecord; + + /** + * Verifies a ChildPartitionsRecord message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ChildPartitionsRecord message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ChildPartitionsRecord + */ + public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.ChildPartitionsRecord; + + /** + * Creates a plain object from a ChildPartitionsRecord message. Also converts values to other types if specified. + * @param message ChildPartitionsRecord + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.executor.v1.ChildPartitionsRecord, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ChildPartitionsRecord to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ChildPartitionsRecord + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ChildPartitionsRecord { + + /** Properties of a ChildPartition. */ + interface IChildPartition { + + /** ChildPartition token */ + token?: (string|null); + + /** ChildPartition parentPartitionTokens */ + parentPartitionTokens?: (string[]|null); + } + + /** Represents a ChildPartition. */ + class ChildPartition implements IChildPartition { + + /** + * Constructs a new ChildPartition. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.executor.v1.ChildPartitionsRecord.IChildPartition); + + /** ChildPartition token. */ + public token: string; + + /** ChildPartition parentPartitionTokens. */ + public parentPartitionTokens: string[]; + + /** + * Creates a new ChildPartition instance using the specified properties. + * @param [properties] Properties to set + * @returns ChildPartition instance + */ + public static create(properties?: google.spanner.executor.v1.ChildPartitionsRecord.IChildPartition): google.spanner.executor.v1.ChildPartitionsRecord.ChildPartition; + + /** + * Encodes the specified ChildPartition message. Does not implicitly {@link google.spanner.executor.v1.ChildPartitionsRecord.ChildPartition.verify|verify} messages. + * @param message ChildPartition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.executor.v1.ChildPartitionsRecord.IChildPartition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ChildPartition message, length delimited. Does not implicitly {@link google.spanner.executor.v1.ChildPartitionsRecord.ChildPartition.verify|verify} messages. + * @param message ChildPartition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.executor.v1.ChildPartitionsRecord.IChildPartition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ChildPartition message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ChildPartition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.ChildPartitionsRecord.ChildPartition; + + /** + * Decodes a ChildPartition message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ChildPartition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.ChildPartitionsRecord.ChildPartition; + + /** + * Verifies a ChildPartition message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ChildPartition message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ChildPartition + */ + public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.ChildPartitionsRecord.ChildPartition; + + /** + * Creates a plain object from a ChildPartition message. Also converts values to other types if specified. + * @param message ChildPartition + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.executor.v1.ChildPartitionsRecord.ChildPartition, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ChildPartition to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ChildPartition + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a HeartbeatRecord. */ + interface IHeartbeatRecord { + + /** HeartbeatRecord heartbeatTime */ + heartbeatTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a HeartbeatRecord. */ + class HeartbeatRecord implements IHeartbeatRecord { + + /** + * Constructs a new HeartbeatRecord. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.executor.v1.IHeartbeatRecord); + + /** HeartbeatRecord heartbeatTime. */ + public heartbeatTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new HeartbeatRecord instance using the specified properties. + * @param [properties] Properties to set + * @returns HeartbeatRecord instance + */ + public static create(properties?: google.spanner.executor.v1.IHeartbeatRecord): google.spanner.executor.v1.HeartbeatRecord; + + /** + * Encodes the specified HeartbeatRecord message. Does not implicitly {@link google.spanner.executor.v1.HeartbeatRecord.verify|verify} messages. + * @param message HeartbeatRecord message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.executor.v1.IHeartbeatRecord, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HeartbeatRecord message, length delimited. Does not implicitly {@link google.spanner.executor.v1.HeartbeatRecord.verify|verify} messages. + * @param message HeartbeatRecord message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.executor.v1.IHeartbeatRecord, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HeartbeatRecord message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HeartbeatRecord + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.HeartbeatRecord; + + /** + * Decodes a HeartbeatRecord message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HeartbeatRecord + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.HeartbeatRecord; + + /** + * Verifies a HeartbeatRecord message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HeartbeatRecord message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HeartbeatRecord + */ + public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.HeartbeatRecord; + + /** + * Creates a plain object from a HeartbeatRecord message. Also converts values to other types if specified. + * @param message HeartbeatRecord + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.executor.v1.HeartbeatRecord, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HeartbeatRecord to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HeartbeatRecord + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SpannerOptions. */ + interface ISpannerOptions { + + /** SpannerOptions sessionPoolOptions */ + sessionPoolOptions?: (google.spanner.executor.v1.ISessionPoolOptions|null); + } + + /** Represents a SpannerOptions. */ + class SpannerOptions implements ISpannerOptions { + + /** + * Constructs a new SpannerOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.executor.v1.ISpannerOptions); + + /** SpannerOptions sessionPoolOptions. */ + public sessionPoolOptions?: (google.spanner.executor.v1.ISessionPoolOptions|null); + + /** + * Creates a new SpannerOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns SpannerOptions instance + */ + public static create(properties?: google.spanner.executor.v1.ISpannerOptions): google.spanner.executor.v1.SpannerOptions; + + /** + * Encodes the specified SpannerOptions message. Does not implicitly {@link google.spanner.executor.v1.SpannerOptions.verify|verify} messages. + * @param message SpannerOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.executor.v1.ISpannerOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SpannerOptions message, length delimited. Does not implicitly {@link google.spanner.executor.v1.SpannerOptions.verify|verify} messages. + * @param message SpannerOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.executor.v1.ISpannerOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SpannerOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SpannerOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.SpannerOptions; + + /** + * Decodes a SpannerOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SpannerOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.SpannerOptions; + + /** + * Verifies a SpannerOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SpannerOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SpannerOptions + */ + public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.SpannerOptions; + + /** + * Creates a plain object from a SpannerOptions message. Also converts values to other types if specified. + * @param message SpannerOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.executor.v1.SpannerOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SpannerOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SpannerOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SessionPoolOptions. */ + interface ISessionPoolOptions { + + /** SessionPoolOptions useMultiplexed */ + useMultiplexed?: (boolean|null); + } + + /** Represents a SessionPoolOptions. */ + class SessionPoolOptions implements ISessionPoolOptions { + + /** + * Constructs a new SessionPoolOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.executor.v1.ISessionPoolOptions); + + /** SessionPoolOptions useMultiplexed. */ + public useMultiplexed: boolean; + + /** + * Creates a new SessionPoolOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns SessionPoolOptions instance + */ + public static create(properties?: google.spanner.executor.v1.ISessionPoolOptions): google.spanner.executor.v1.SessionPoolOptions; + + /** + * Encodes the specified SessionPoolOptions message. Does not implicitly {@link google.spanner.executor.v1.SessionPoolOptions.verify|verify} messages. + * @param message SessionPoolOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.executor.v1.ISessionPoolOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SessionPoolOptions message, length delimited. Does not implicitly {@link google.spanner.executor.v1.SessionPoolOptions.verify|verify} messages. + * @param message SessionPoolOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.executor.v1.ISessionPoolOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SessionPoolOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SessionPoolOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.SessionPoolOptions; + + /** + * Decodes a SessionPoolOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SessionPoolOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.SessionPoolOptions; + + /** + * Verifies a SessionPoolOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SessionPoolOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SessionPoolOptions + */ + public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.SessionPoolOptions; + + /** + * Creates a plain object from a SessionPoolOptions message. Also converts values to other types if specified. + * @param message SessionPoolOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.executor.v1.SessionPoolOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SessionPoolOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SessionPoolOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Namespace v1. */ + namespace v1 { + + /** Represents a Spanner */ + class Spanner extends $protobuf.rpc.Service { + + /** + * Constructs a new Spanner service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Spanner 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): Spanner; + + /** + * Calls CreateSession. + * @param request CreateSessionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Session + */ + public createSession(request: google.spanner.v1.ICreateSessionRequest, callback: google.spanner.v1.Spanner.CreateSessionCallback): void; + + /** + * Calls CreateSession. + * @param request CreateSessionRequest message or plain object + * @returns Promise + */ + public createSession(request: google.spanner.v1.ICreateSessionRequest): Promise; + + /** + * Calls BatchCreateSessions. + * @param request BatchCreateSessionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and BatchCreateSessionsResponse + */ + public batchCreateSessions(request: google.spanner.v1.IBatchCreateSessionsRequest, callback: google.spanner.v1.Spanner.BatchCreateSessionsCallback): void; + + /** + * Calls BatchCreateSessions. + * @param request BatchCreateSessionsRequest message or plain object + * @returns Promise + */ + public batchCreateSessions(request: google.spanner.v1.IBatchCreateSessionsRequest): Promise; + + /** + * Calls GetSession. + * @param request GetSessionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Session + */ + public getSession(request: google.spanner.v1.IGetSessionRequest, callback: google.spanner.v1.Spanner.GetSessionCallback): void; + + /** + * Calls GetSession. + * @param request GetSessionRequest message or plain object + * @returns Promise + */ + public getSession(request: google.spanner.v1.IGetSessionRequest): Promise; + + /** + * Calls ListSessions. + * @param request ListSessionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListSessionsResponse + */ + public listSessions(request: google.spanner.v1.IListSessionsRequest, callback: google.spanner.v1.Spanner.ListSessionsCallback): void; + + /** + * Calls ListSessions. + * @param request ListSessionsRequest message or plain object + * @returns Promise + */ + public listSessions(request: google.spanner.v1.IListSessionsRequest): Promise; + + /** + * Calls DeleteSession. + * @param request DeleteSessionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteSession(request: google.spanner.v1.IDeleteSessionRequest, callback: google.spanner.v1.Spanner.DeleteSessionCallback): void; + + /** + * Calls DeleteSession. + * @param request DeleteSessionRequest message or plain object + * @returns Promise + */ + public deleteSession(request: google.spanner.v1.IDeleteSessionRequest): Promise; + + /** + * Calls ExecuteSql. + * @param request ExecuteSqlRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ResultSet + */ + public executeSql(request: google.spanner.v1.IExecuteSqlRequest, callback: google.spanner.v1.Spanner.ExecuteSqlCallback): void; + + /** + * Calls ExecuteSql. + * @param request ExecuteSqlRequest message or plain object + * @returns Promise + */ + public executeSql(request: google.spanner.v1.IExecuteSqlRequest): Promise; + + /** + * Calls ExecuteStreamingSql. + * @param request ExecuteSqlRequest message or plain object + * @param callback Node-style callback called with the error, if any, and PartialResultSet + */ + public executeStreamingSql(request: google.spanner.v1.IExecuteSqlRequest, callback: google.spanner.v1.Spanner.ExecuteStreamingSqlCallback): void; + + /** + * Calls ExecuteStreamingSql. + * @param request ExecuteSqlRequest message or plain object + * @returns Promise + */ + public executeStreamingSql(request: google.spanner.v1.IExecuteSqlRequest): Promise; + + /** + * Calls ExecuteBatchDml. + * @param request ExecuteBatchDmlRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ExecuteBatchDmlResponse + */ + public executeBatchDml(request: google.spanner.v1.IExecuteBatchDmlRequest, callback: google.spanner.v1.Spanner.ExecuteBatchDmlCallback): void; + + /** + * Calls ExecuteBatchDml. + * @param request ExecuteBatchDmlRequest message or plain object + * @returns Promise + */ + public executeBatchDml(request: google.spanner.v1.IExecuteBatchDmlRequest): Promise; + + /** + * Calls Read. + * @param request ReadRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ResultSet + */ + public read(request: google.spanner.v1.IReadRequest, callback: google.spanner.v1.Spanner.ReadCallback): void; + + /** + * Calls Read. + * @param request ReadRequest message or plain object + * @returns Promise + */ + public read(request: google.spanner.v1.IReadRequest): Promise; + + /** + * Calls StreamingRead. + * @param request ReadRequest message or plain object + * @param callback Node-style callback called with the error, if any, and PartialResultSet + */ + public streamingRead(request: google.spanner.v1.IReadRequest, callback: google.spanner.v1.Spanner.StreamingReadCallback): void; + + /** + * Calls StreamingRead. + * @param request ReadRequest message or plain object + * @returns Promise + */ + public streamingRead(request: google.spanner.v1.IReadRequest): Promise; + + /** + * Calls BeginTransaction. + * @param request BeginTransactionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Transaction + */ + public beginTransaction(request: google.spanner.v1.IBeginTransactionRequest, callback: google.spanner.v1.Spanner.BeginTransactionCallback): void; + + /** + * Calls BeginTransaction. + * @param request BeginTransactionRequest message or plain object + * @returns Promise + */ + public beginTransaction(request: google.spanner.v1.IBeginTransactionRequest): Promise; + + /** + * Calls Commit. + * @param request CommitRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CommitResponse + */ + public commit(request: google.spanner.v1.ICommitRequest, callback: google.spanner.v1.Spanner.CommitCallback): void; + + /** + * Calls Commit. + * @param request CommitRequest message or plain object + * @returns Promise + */ + public commit(request: google.spanner.v1.ICommitRequest): Promise; + + /** + * Calls Rollback. + * @param request RollbackRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public rollback(request: google.spanner.v1.IRollbackRequest, callback: google.spanner.v1.Spanner.RollbackCallback): void; + + /** + * Calls Rollback. + * @param request RollbackRequest message or plain object + * @returns Promise + */ + public rollback(request: google.spanner.v1.IRollbackRequest): Promise; + + /** + * Calls PartitionQuery. + * @param request PartitionQueryRequest message or plain object + * @param callback Node-style callback called with the error, if any, and PartitionResponse + */ + public partitionQuery(request: google.spanner.v1.IPartitionQueryRequest, callback: google.spanner.v1.Spanner.PartitionQueryCallback): void; + + /** + * Calls PartitionQuery. + * @param request PartitionQueryRequest message or plain object + * @returns Promise + */ + public partitionQuery(request: google.spanner.v1.IPartitionQueryRequest): Promise; + + /** + * Calls PartitionRead. + * @param request PartitionReadRequest message or plain object + * @param callback Node-style callback called with the error, if any, and PartitionResponse + */ + public partitionRead(request: google.spanner.v1.IPartitionReadRequest, callback: google.spanner.v1.Spanner.PartitionReadCallback): void; + + /** + * Calls PartitionRead. + * @param request PartitionReadRequest message or plain object + * @returns Promise + */ + public partitionRead(request: google.spanner.v1.IPartitionReadRequest): Promise; + + /** + * Calls BatchWrite. + * @param request BatchWriteRequest message or plain object + * @param callback Node-style callback called with the error, if any, and BatchWriteResponse + */ + public batchWrite(request: google.spanner.v1.IBatchWriteRequest, callback: google.spanner.v1.Spanner.BatchWriteCallback): void; + + /** + * Calls BatchWrite. + * @param request BatchWriteRequest message or plain object + * @returns Promise + */ + public batchWrite(request: google.spanner.v1.IBatchWriteRequest): Promise; + } + + namespace Spanner { + + /** + * Callback as used by {@link google.spanner.v1.Spanner|createSession}. + * @param error Error, if any + * @param [response] Session + */ + type CreateSessionCallback = (error: (Error|null), response?: google.spanner.v1.Session) => void; + + /** + * Callback as used by {@link google.spanner.v1.Spanner|batchCreateSessions}. + * @param error Error, if any + * @param [response] BatchCreateSessionsResponse + */ + type BatchCreateSessionsCallback = (error: (Error|null), response?: google.spanner.v1.BatchCreateSessionsResponse) => void; + + /** + * Callback as used by {@link google.spanner.v1.Spanner|getSession}. + * @param error Error, if any + * @param [response] Session + */ + type GetSessionCallback = (error: (Error|null), response?: google.spanner.v1.Session) => void; + + /** + * Callback as used by {@link google.spanner.v1.Spanner|listSessions}. + * @param error Error, if any + * @param [response] ListSessionsResponse + */ + type ListSessionsCallback = (error: (Error|null), response?: google.spanner.v1.ListSessionsResponse) => void; + + /** + * Callback as used by {@link google.spanner.v1.Spanner|deleteSession}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteSessionCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.spanner.v1.Spanner|executeSql}. + * @param error Error, if any + * @param [response] ResultSet + */ + type ExecuteSqlCallback = (error: (Error|null), response?: google.spanner.v1.ResultSet) => void; + + /** + * Callback as used by {@link google.spanner.v1.Spanner|executeStreamingSql}. + * @param error Error, if any + * @param [response] PartialResultSet + */ + type ExecuteStreamingSqlCallback = (error: (Error|null), response?: google.spanner.v1.PartialResultSet) => void; + + /** + * Callback as used by {@link google.spanner.v1.Spanner|executeBatchDml}. + * @param error Error, if any + * @param [response] ExecuteBatchDmlResponse + */ + type ExecuteBatchDmlCallback = (error: (Error|null), response?: google.spanner.v1.ExecuteBatchDmlResponse) => void; + + /** + * Callback as used by {@link google.spanner.v1.Spanner|read}. + * @param error Error, if any + * @param [response] ResultSet + */ + type ReadCallback = (error: (Error|null), response?: google.spanner.v1.ResultSet) => void; + + /** + * Callback as used by {@link google.spanner.v1.Spanner|streamingRead}. + * @param error Error, if any + * @param [response] PartialResultSet + */ + type StreamingReadCallback = (error: (Error|null), response?: google.spanner.v1.PartialResultSet) => void; + + /** + * Callback as used by {@link google.spanner.v1.Spanner|beginTransaction}. + * @param error Error, if any + * @param [response] Transaction + */ + type BeginTransactionCallback = (error: (Error|null), response?: google.spanner.v1.Transaction) => void; + + /** + * Callback as used by {@link google.spanner.v1.Spanner|commit}. + * @param error Error, if any + * @param [response] CommitResponse + */ + type CommitCallback = (error: (Error|null), response?: google.spanner.v1.CommitResponse) => void; + + /** + * Callback as used by {@link google.spanner.v1.Spanner|rollback}. + * @param error Error, if any + * @param [response] Empty + */ + type RollbackCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.spanner.v1.Spanner|partitionQuery}. + * @param error Error, if any + * @param [response] PartitionResponse + */ + type PartitionQueryCallback = (error: (Error|null), response?: google.spanner.v1.PartitionResponse) => void; + + /** + * Callback as used by {@link google.spanner.v1.Spanner|partitionRead}. + * @param error Error, if any + * @param [response] PartitionResponse + */ + type PartitionReadCallback = (error: (Error|null), response?: google.spanner.v1.PartitionResponse) => void; + + /** + * Callback as used by {@link google.spanner.v1.Spanner|batchWrite}. + * @param error Error, if any + * @param [response] BatchWriteResponse + */ + type BatchWriteCallback = (error: (Error|null), response?: google.spanner.v1.BatchWriteResponse) => void; + } + + /** Properties of a CreateSessionRequest. */ + interface ICreateSessionRequest { + + /** CreateSessionRequest database */ + database?: (string|null); + + /** CreateSessionRequest session */ + session?: (google.spanner.v1.ISession|null); + } + + /** Represents a CreateSessionRequest. */ + class CreateSessionRequest implements ICreateSessionRequest { + + /** + * Constructs a new CreateSessionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.ICreateSessionRequest); + + /** CreateSessionRequest database. */ + public database: string; + + /** CreateSessionRequest session. */ + public session?: (google.spanner.v1.ISession|null); + + /** + * Creates a new CreateSessionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateSessionRequest instance + */ + public static create(properties?: google.spanner.v1.ICreateSessionRequest): google.spanner.v1.CreateSessionRequest; + + /** + * Encodes the specified CreateSessionRequest message. Does not implicitly {@link google.spanner.v1.CreateSessionRequest.verify|verify} messages. + * @param message CreateSessionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.ICreateSessionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateSessionRequest message, length delimited. Does not implicitly {@link google.spanner.v1.CreateSessionRequest.verify|verify} messages. + * @param message CreateSessionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.ICreateSessionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateSessionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateSessionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.CreateSessionRequest; + + /** + * Decodes a CreateSessionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateSessionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.CreateSessionRequest; + + /** + * Verifies a CreateSessionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateSessionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateSessionRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.CreateSessionRequest; + + /** + * Creates a plain object from a CreateSessionRequest message. Also converts values to other types if specified. + * @param message CreateSessionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.CreateSessionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateSessionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateSessionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchCreateSessionsRequest. */ + interface IBatchCreateSessionsRequest { + + /** BatchCreateSessionsRequest database */ + database?: (string|null); + + /** BatchCreateSessionsRequest sessionTemplate */ + sessionTemplate?: (google.spanner.v1.ISession|null); + + /** BatchCreateSessionsRequest sessionCount */ + sessionCount?: (number|null); + } + + /** Represents a BatchCreateSessionsRequest. */ + class BatchCreateSessionsRequest implements IBatchCreateSessionsRequest { + + /** + * Constructs a new BatchCreateSessionsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.IBatchCreateSessionsRequest); + + /** BatchCreateSessionsRequest database. */ + public database: string; + + /** BatchCreateSessionsRequest sessionTemplate. */ + public sessionTemplate?: (google.spanner.v1.ISession|null); + + /** BatchCreateSessionsRequest sessionCount. */ + public sessionCount: number; + + /** + * Creates a new BatchCreateSessionsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchCreateSessionsRequest instance + */ + public static create(properties?: google.spanner.v1.IBatchCreateSessionsRequest): google.spanner.v1.BatchCreateSessionsRequest; + + /** + * Encodes the specified BatchCreateSessionsRequest message. Does not implicitly {@link google.spanner.v1.BatchCreateSessionsRequest.verify|verify} messages. + * @param message BatchCreateSessionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.IBatchCreateSessionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchCreateSessionsRequest message, length delimited. Does not implicitly {@link google.spanner.v1.BatchCreateSessionsRequest.verify|verify} messages. + * @param message BatchCreateSessionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.IBatchCreateSessionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchCreateSessionsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchCreateSessionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.BatchCreateSessionsRequest; + + /** + * Decodes a BatchCreateSessionsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchCreateSessionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.BatchCreateSessionsRequest; + + /** + * Verifies a BatchCreateSessionsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchCreateSessionsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchCreateSessionsRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.BatchCreateSessionsRequest; + + /** + * Creates a plain object from a BatchCreateSessionsRequest message. Also converts values to other types if specified. + * @param message BatchCreateSessionsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.BatchCreateSessionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchCreateSessionsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchCreateSessionsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchCreateSessionsResponse. */ + interface IBatchCreateSessionsResponse { + + /** BatchCreateSessionsResponse session */ + session?: (google.spanner.v1.ISession[]|null); + } + + /** Represents a BatchCreateSessionsResponse. */ + class BatchCreateSessionsResponse implements IBatchCreateSessionsResponse { + + /** + * Constructs a new BatchCreateSessionsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.IBatchCreateSessionsResponse); + + /** BatchCreateSessionsResponse session. */ + public session: google.spanner.v1.ISession[]; + + /** + * Creates a new BatchCreateSessionsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchCreateSessionsResponse instance + */ + public static create(properties?: google.spanner.v1.IBatchCreateSessionsResponse): google.spanner.v1.BatchCreateSessionsResponse; + + /** + * Encodes the specified BatchCreateSessionsResponse message. Does not implicitly {@link google.spanner.v1.BatchCreateSessionsResponse.verify|verify} messages. + * @param message BatchCreateSessionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.IBatchCreateSessionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchCreateSessionsResponse message, length delimited. Does not implicitly {@link google.spanner.v1.BatchCreateSessionsResponse.verify|verify} messages. + * @param message BatchCreateSessionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.IBatchCreateSessionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchCreateSessionsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchCreateSessionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.BatchCreateSessionsResponse; + + /** + * Decodes a BatchCreateSessionsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchCreateSessionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.BatchCreateSessionsResponse; + + /** + * Verifies a BatchCreateSessionsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchCreateSessionsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchCreateSessionsResponse + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.BatchCreateSessionsResponse; + + /** + * Creates a plain object from a BatchCreateSessionsResponse message. Also converts values to other types if specified. + * @param message BatchCreateSessionsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.BatchCreateSessionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchCreateSessionsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchCreateSessionsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Session. */ + interface ISession { + + /** Session name */ + name?: (string|null); + + /** Session labels */ + labels?: ({ [k: string]: string }|null); + + /** Session createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Session approximateLastUseTime */ + approximateLastUseTime?: (google.protobuf.ITimestamp|null); + + /** Session creatorRole */ + creatorRole?: (string|null); + + /** Session multiplexed */ + multiplexed?: (boolean|null); + } + + /** Represents a Session. */ + class Session implements ISession { + + /** + * Constructs a new Session. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.ISession); + + /** Session name. */ + public name: string; + + /** Session labels. */ + public labels: { [k: string]: string }; + + /** Session createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Session approximateLastUseTime. */ + public approximateLastUseTime?: (google.protobuf.ITimestamp|null); + + /** Session creatorRole. */ + public creatorRole: string; + + /** Session multiplexed. */ + public multiplexed: boolean; + + /** + * Creates a new Session instance using the specified properties. + * @param [properties] Properties to set + * @returns Session instance + */ + public static create(properties?: google.spanner.v1.ISession): google.spanner.v1.Session; + + /** + * Encodes the specified Session message. Does not implicitly {@link google.spanner.v1.Session.verify|verify} messages. + * @param message Session message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.ISession, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Session message, length delimited. Does not implicitly {@link google.spanner.v1.Session.verify|verify} messages. + * @param message Session message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.ISession, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Session message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Session + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.Session; + + /** + * Decodes a Session message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Session + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.Session; + + /** + * Verifies a Session message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Session message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Session + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.Session; + + /** + * Creates a plain object from a Session message. Also converts values to other types if specified. + * @param message Session + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.Session, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Session to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Session + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetSessionRequest. */ + interface IGetSessionRequest { + + /** GetSessionRequest name */ + name?: (string|null); + } + + /** Represents a GetSessionRequest. */ + class GetSessionRequest implements IGetSessionRequest { + + /** + * Constructs a new GetSessionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.IGetSessionRequest); + + /** GetSessionRequest name. */ + public name: string; + + /** + * Creates a new GetSessionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetSessionRequest instance + */ + public static create(properties?: google.spanner.v1.IGetSessionRequest): google.spanner.v1.GetSessionRequest; + + /** + * Encodes the specified GetSessionRequest message. Does not implicitly {@link google.spanner.v1.GetSessionRequest.verify|verify} messages. + * @param message GetSessionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.IGetSessionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetSessionRequest message, length delimited. Does not implicitly {@link google.spanner.v1.GetSessionRequest.verify|verify} messages. + * @param message GetSessionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.IGetSessionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetSessionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetSessionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.GetSessionRequest; + + /** + * Decodes a GetSessionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetSessionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.GetSessionRequest; + + /** + * Verifies a GetSessionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetSessionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetSessionRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.GetSessionRequest; + + /** + * Creates a plain object from a GetSessionRequest message. Also converts values to other types if specified. + * @param message GetSessionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.GetSessionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetSessionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetSessionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListSessionsRequest. */ + interface IListSessionsRequest { + + /** ListSessionsRequest database */ + database?: (string|null); + + /** ListSessionsRequest pageSize */ + pageSize?: (number|null); + + /** ListSessionsRequest pageToken */ + pageToken?: (string|null); + + /** ListSessionsRequest filter */ + filter?: (string|null); + } + + /** Represents a ListSessionsRequest. */ + class ListSessionsRequest implements IListSessionsRequest { + + /** + * Constructs a new ListSessionsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.IListSessionsRequest); + + /** ListSessionsRequest database. */ + public database: string; + + /** ListSessionsRequest pageSize. */ + public pageSize: number; + + /** ListSessionsRequest pageToken. */ + public pageToken: string; + + /** ListSessionsRequest filter. */ + public filter: string; + + /** + * Creates a new ListSessionsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSessionsRequest instance + */ + public static create(properties?: google.spanner.v1.IListSessionsRequest): google.spanner.v1.ListSessionsRequest; + + /** + * Encodes the specified ListSessionsRequest message. Does not implicitly {@link google.spanner.v1.ListSessionsRequest.verify|verify} messages. + * @param message ListSessionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.IListSessionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSessionsRequest message, length delimited. Does not implicitly {@link google.spanner.v1.ListSessionsRequest.verify|verify} messages. + * @param message ListSessionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.IListSessionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSessionsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSessionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.ListSessionsRequest; + + /** + * Decodes a ListSessionsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSessionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.ListSessionsRequest; + + /** + * Verifies a ListSessionsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListSessionsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSessionsRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.ListSessionsRequest; + + /** + * Creates a plain object from a ListSessionsRequest message. Also converts values to other types if specified. + * @param message ListSessionsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.ListSessionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSessionsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSessionsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListSessionsResponse. */ + interface IListSessionsResponse { + + /** ListSessionsResponse sessions */ + sessions?: (google.spanner.v1.ISession[]|null); + + /** ListSessionsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListSessionsResponse. */ + class ListSessionsResponse implements IListSessionsResponse { + + /** + * Constructs a new ListSessionsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.IListSessionsResponse); + + /** ListSessionsResponse sessions. */ + public sessions: google.spanner.v1.ISession[]; + + /** ListSessionsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListSessionsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSessionsResponse instance + */ + public static create(properties?: google.spanner.v1.IListSessionsResponse): google.spanner.v1.ListSessionsResponse; + + /** + * Encodes the specified ListSessionsResponse message. Does not implicitly {@link google.spanner.v1.ListSessionsResponse.verify|verify} messages. + * @param message ListSessionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.IListSessionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSessionsResponse message, length delimited. Does not implicitly {@link google.spanner.v1.ListSessionsResponse.verify|verify} messages. + * @param message ListSessionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.IListSessionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSessionsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSessionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.ListSessionsResponse; + + /** + * Decodes a ListSessionsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSessionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.ListSessionsResponse; + + /** + * Verifies a ListSessionsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListSessionsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSessionsResponse + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.ListSessionsResponse; + + /** + * Creates a plain object from a ListSessionsResponse message. Also converts values to other types if specified. + * @param message ListSessionsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.ListSessionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSessionsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSessionsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteSessionRequest. */ + interface IDeleteSessionRequest { + + /** DeleteSessionRequest name */ + name?: (string|null); + } + + /** Represents a DeleteSessionRequest. */ + class DeleteSessionRequest implements IDeleteSessionRequest { + + /** + * Constructs a new DeleteSessionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.IDeleteSessionRequest); + + /** DeleteSessionRequest name. */ + public name: string; + + /** + * Creates a new DeleteSessionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteSessionRequest instance + */ + public static create(properties?: google.spanner.v1.IDeleteSessionRequest): google.spanner.v1.DeleteSessionRequest; + + /** + * Encodes the specified DeleteSessionRequest message. Does not implicitly {@link google.spanner.v1.DeleteSessionRequest.verify|verify} messages. + * @param message DeleteSessionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.IDeleteSessionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteSessionRequest message, length delimited. Does not implicitly {@link google.spanner.v1.DeleteSessionRequest.verify|verify} messages. + * @param message DeleteSessionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.IDeleteSessionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteSessionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteSessionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.DeleteSessionRequest; + + /** + * Decodes a DeleteSessionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteSessionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.DeleteSessionRequest; + + /** + * Verifies a DeleteSessionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteSessionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteSessionRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.DeleteSessionRequest; + + /** + * Creates a plain object from a DeleteSessionRequest message. Also converts values to other types if specified. + * @param message DeleteSessionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.DeleteSessionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteSessionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteSessionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RequestOptions. */ + interface IRequestOptions { + + /** RequestOptions priority */ + priority?: (google.spanner.v1.RequestOptions.Priority|keyof typeof google.spanner.v1.RequestOptions.Priority|null); + + /** RequestOptions requestTag */ + requestTag?: (string|null); + + /** RequestOptions transactionTag */ + transactionTag?: (string|null); + + /** RequestOptions clientContext */ + clientContext?: (google.spanner.v1.RequestOptions.IClientContext|null); + } + + /** Represents a RequestOptions. */ + class RequestOptions implements IRequestOptions { + + /** + * Constructs a new RequestOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.IRequestOptions); + + /** RequestOptions priority. */ + public priority: (google.spanner.v1.RequestOptions.Priority|keyof typeof google.spanner.v1.RequestOptions.Priority); + + /** RequestOptions requestTag. */ + public requestTag: string; + + /** RequestOptions transactionTag. */ + public transactionTag: string; + + /** RequestOptions clientContext. */ + public clientContext?: (google.spanner.v1.RequestOptions.IClientContext|null); + + /** + * Creates a new RequestOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns RequestOptions instance + */ + public static create(properties?: google.spanner.v1.IRequestOptions): google.spanner.v1.RequestOptions; + + /** + * Encodes the specified RequestOptions message. Does not implicitly {@link google.spanner.v1.RequestOptions.verify|verify} messages. + * @param message RequestOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.IRequestOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RequestOptions message, length delimited. Does not implicitly {@link google.spanner.v1.RequestOptions.verify|verify} messages. + * @param message RequestOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.IRequestOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RequestOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RequestOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.RequestOptions; + + /** + * Decodes a RequestOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RequestOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.RequestOptions; + + /** + * Verifies a RequestOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RequestOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RequestOptions + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.RequestOptions; + + /** + * Creates a plain object from a RequestOptions message. Also converts values to other types if specified. + * @param message RequestOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.RequestOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RequestOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RequestOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace RequestOptions { + + /** Priority enum. */ + enum Priority { + PRIORITY_UNSPECIFIED = 0, + PRIORITY_LOW = 1, + PRIORITY_MEDIUM = 2, + PRIORITY_HIGH = 3 + } + + /** Properties of a ClientContext. */ + interface IClientContext { + + /** ClientContext secureContext */ + secureContext?: ({ [k: string]: google.protobuf.IValue }|null); + } + + /** Represents a ClientContext. */ + class ClientContext implements IClientContext { + + /** + * Constructs a new ClientContext. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.RequestOptions.IClientContext); + + /** ClientContext secureContext. */ + public secureContext: { [k: string]: google.protobuf.IValue }; + + /** + * Creates a new ClientContext instance using the specified properties. + * @param [properties] Properties to set + * @returns ClientContext instance + */ + public static create(properties?: google.spanner.v1.RequestOptions.IClientContext): google.spanner.v1.RequestOptions.ClientContext; + + /** + * Encodes the specified ClientContext message. Does not implicitly {@link google.spanner.v1.RequestOptions.ClientContext.verify|verify} messages. + * @param message ClientContext message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.RequestOptions.IClientContext, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClientContext message, length delimited. Does not implicitly {@link google.spanner.v1.RequestOptions.ClientContext.verify|verify} messages. + * @param message ClientContext message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.RequestOptions.IClientContext, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClientContext message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClientContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.RequestOptions.ClientContext; + + /** + * Decodes a ClientContext message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClientContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.RequestOptions.ClientContext; + + /** + * Verifies a ClientContext message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ClientContext message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClientContext + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.RequestOptions.ClientContext; + + /** + * Creates a plain object from a ClientContext message. Also converts values to other types if specified. + * @param message ClientContext + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.RequestOptions.ClientContext, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClientContext to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClientContext + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a DirectedReadOptions. */ + interface IDirectedReadOptions { + + /** DirectedReadOptions includeReplicas */ + includeReplicas?: (google.spanner.v1.DirectedReadOptions.IIncludeReplicas|null); + + /** DirectedReadOptions excludeReplicas */ + excludeReplicas?: (google.spanner.v1.DirectedReadOptions.IExcludeReplicas|null); + } + + /** Represents a DirectedReadOptions. */ + class DirectedReadOptions implements IDirectedReadOptions { + + /** + * Constructs a new DirectedReadOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.IDirectedReadOptions); + + /** DirectedReadOptions includeReplicas. */ + public includeReplicas?: (google.spanner.v1.DirectedReadOptions.IIncludeReplicas|null); + + /** DirectedReadOptions excludeReplicas. */ + public excludeReplicas?: (google.spanner.v1.DirectedReadOptions.IExcludeReplicas|null); + + /** DirectedReadOptions replicas. */ + public replicas?: ("includeReplicas"|"excludeReplicas"); + + /** + * Creates a new DirectedReadOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns DirectedReadOptions instance + */ + public static create(properties?: google.spanner.v1.IDirectedReadOptions): google.spanner.v1.DirectedReadOptions; + + /** + * Encodes the specified DirectedReadOptions message. Does not implicitly {@link google.spanner.v1.DirectedReadOptions.verify|verify} messages. + * @param message DirectedReadOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.IDirectedReadOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DirectedReadOptions message, length delimited. Does not implicitly {@link google.spanner.v1.DirectedReadOptions.verify|verify} messages. + * @param message DirectedReadOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.IDirectedReadOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DirectedReadOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DirectedReadOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.DirectedReadOptions; + + /** + * Decodes a DirectedReadOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DirectedReadOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.DirectedReadOptions; + + /** + * Verifies a DirectedReadOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DirectedReadOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DirectedReadOptions + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.DirectedReadOptions; + + /** + * Creates a plain object from a DirectedReadOptions message. Also converts values to other types if specified. + * @param message DirectedReadOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.DirectedReadOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DirectedReadOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DirectedReadOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DirectedReadOptions { + + /** Properties of a ReplicaSelection. */ + interface IReplicaSelection { + + /** ReplicaSelection location */ + location?: (string|null); + + /** ReplicaSelection type */ + type?: (google.spanner.v1.DirectedReadOptions.ReplicaSelection.Type|keyof typeof google.spanner.v1.DirectedReadOptions.ReplicaSelection.Type|null); + } + + /** Represents a ReplicaSelection. */ + class ReplicaSelection implements IReplicaSelection { + + /** + * Constructs a new ReplicaSelection. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.DirectedReadOptions.IReplicaSelection); + + /** ReplicaSelection location. */ + public location: string; + + /** ReplicaSelection type. */ + public type: (google.spanner.v1.DirectedReadOptions.ReplicaSelection.Type|keyof typeof google.spanner.v1.DirectedReadOptions.ReplicaSelection.Type); + + /** + * Creates a new ReplicaSelection instance using the specified properties. + * @param [properties] Properties to set + * @returns ReplicaSelection instance + */ + public static create(properties?: google.spanner.v1.DirectedReadOptions.IReplicaSelection): google.spanner.v1.DirectedReadOptions.ReplicaSelection; + + /** + * Encodes the specified ReplicaSelection message. Does not implicitly {@link google.spanner.v1.DirectedReadOptions.ReplicaSelection.verify|verify} messages. + * @param message ReplicaSelection message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.DirectedReadOptions.IReplicaSelection, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReplicaSelection message, length delimited. Does not implicitly {@link google.spanner.v1.DirectedReadOptions.ReplicaSelection.verify|verify} messages. + * @param message ReplicaSelection message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.DirectedReadOptions.IReplicaSelection, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReplicaSelection message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReplicaSelection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.DirectedReadOptions.ReplicaSelection; + + /** + * Decodes a ReplicaSelection message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReplicaSelection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.DirectedReadOptions.ReplicaSelection; + + /** + * Verifies a ReplicaSelection message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReplicaSelection message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReplicaSelection + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.DirectedReadOptions.ReplicaSelection; + + /** + * Creates a plain object from a ReplicaSelection message. Also converts values to other types if specified. + * @param message ReplicaSelection + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.DirectedReadOptions.ReplicaSelection, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReplicaSelection to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReplicaSelection + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ReplicaSelection { + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + READ_WRITE = 1, + READ_ONLY = 2 + } + } + + /** Properties of an IncludeReplicas. */ + interface IIncludeReplicas { + + /** IncludeReplicas replicaSelections */ + replicaSelections?: (google.spanner.v1.DirectedReadOptions.IReplicaSelection[]|null); + + /** IncludeReplicas autoFailoverDisabled */ + autoFailoverDisabled?: (boolean|null); + } + + /** Represents an IncludeReplicas. */ + class IncludeReplicas implements IIncludeReplicas { + + /** + * Constructs a new IncludeReplicas. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.DirectedReadOptions.IIncludeReplicas); + + /** IncludeReplicas replicaSelections. */ + public replicaSelections: google.spanner.v1.DirectedReadOptions.IReplicaSelection[]; + + /** IncludeReplicas autoFailoverDisabled. */ + public autoFailoverDisabled: boolean; + + /** + * Creates a new IncludeReplicas instance using the specified properties. + * @param [properties] Properties to set + * @returns IncludeReplicas instance + */ + public static create(properties?: google.spanner.v1.DirectedReadOptions.IIncludeReplicas): google.spanner.v1.DirectedReadOptions.IncludeReplicas; + + /** + * Encodes the specified IncludeReplicas message. Does not implicitly {@link google.spanner.v1.DirectedReadOptions.IncludeReplicas.verify|verify} messages. + * @param message IncludeReplicas message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.DirectedReadOptions.IIncludeReplicas, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IncludeReplicas message, length delimited. Does not implicitly {@link google.spanner.v1.DirectedReadOptions.IncludeReplicas.verify|verify} messages. + * @param message IncludeReplicas message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.DirectedReadOptions.IIncludeReplicas, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IncludeReplicas message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IncludeReplicas + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.DirectedReadOptions.IncludeReplicas; + + /** + * Decodes an IncludeReplicas message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IncludeReplicas + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.DirectedReadOptions.IncludeReplicas; + + /** + * Verifies an IncludeReplicas message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an IncludeReplicas message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IncludeReplicas + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.DirectedReadOptions.IncludeReplicas; + + /** + * Creates a plain object from an IncludeReplicas message. Also converts values to other types if specified. + * @param message IncludeReplicas + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.DirectedReadOptions.IncludeReplicas, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IncludeReplicas to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IncludeReplicas + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExcludeReplicas. */ + interface IExcludeReplicas { + + /** ExcludeReplicas replicaSelections */ + replicaSelections?: (google.spanner.v1.DirectedReadOptions.IReplicaSelection[]|null); + } + + /** Represents an ExcludeReplicas. */ + class ExcludeReplicas implements IExcludeReplicas { + + /** + * Constructs a new ExcludeReplicas. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.DirectedReadOptions.IExcludeReplicas); + + /** ExcludeReplicas replicaSelections. */ + public replicaSelections: google.spanner.v1.DirectedReadOptions.IReplicaSelection[]; + + /** + * Creates a new ExcludeReplicas instance using the specified properties. + * @param [properties] Properties to set + * @returns ExcludeReplicas instance + */ + public static create(properties?: google.spanner.v1.DirectedReadOptions.IExcludeReplicas): google.spanner.v1.DirectedReadOptions.ExcludeReplicas; + + /** + * Encodes the specified ExcludeReplicas message. Does not implicitly {@link google.spanner.v1.DirectedReadOptions.ExcludeReplicas.verify|verify} messages. + * @param message ExcludeReplicas message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.DirectedReadOptions.IExcludeReplicas, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExcludeReplicas message, length delimited. Does not implicitly {@link google.spanner.v1.DirectedReadOptions.ExcludeReplicas.verify|verify} messages. + * @param message ExcludeReplicas message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.DirectedReadOptions.IExcludeReplicas, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExcludeReplicas message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExcludeReplicas + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.DirectedReadOptions.ExcludeReplicas; + + /** + * Decodes an ExcludeReplicas message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExcludeReplicas + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.DirectedReadOptions.ExcludeReplicas; + + /** + * Verifies an ExcludeReplicas message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExcludeReplicas message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExcludeReplicas + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.DirectedReadOptions.ExcludeReplicas; + + /** + * Creates a plain object from an ExcludeReplicas message. Also converts values to other types if specified. + * @param message ExcludeReplicas + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.DirectedReadOptions.ExcludeReplicas, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExcludeReplicas to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExcludeReplicas + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ExecuteSqlRequest. */ + interface IExecuteSqlRequest { + + /** ExecuteSqlRequest session */ + session?: (string|null); + + /** ExecuteSqlRequest transaction */ + transaction?: (google.spanner.v1.ITransactionSelector|null); + + /** ExecuteSqlRequest sql */ + sql?: (string|null); + + /** ExecuteSqlRequest params */ + params?: (google.protobuf.IStruct|null); + + /** ExecuteSqlRequest paramTypes */ + paramTypes?: ({ [k: string]: google.spanner.v1.IType }|null); + + /** ExecuteSqlRequest resumeToken */ + resumeToken?: (Uint8Array|Buffer|string|null); + + /** ExecuteSqlRequest queryMode */ + queryMode?: (google.spanner.v1.ExecuteSqlRequest.QueryMode|keyof typeof google.spanner.v1.ExecuteSqlRequest.QueryMode|null); + + /** ExecuteSqlRequest partitionToken */ + partitionToken?: (Uint8Array|Buffer|string|null); + + /** ExecuteSqlRequest seqno */ + seqno?: (number|Long|string|null); + + /** ExecuteSqlRequest queryOptions */ + queryOptions?: (google.spanner.v1.ExecuteSqlRequest.IQueryOptions|null); + + /** ExecuteSqlRequest requestOptions */ + requestOptions?: (google.spanner.v1.IRequestOptions|null); + + /** ExecuteSqlRequest directedReadOptions */ + directedReadOptions?: (google.spanner.v1.IDirectedReadOptions|null); + + /** ExecuteSqlRequest dataBoostEnabled */ + dataBoostEnabled?: (boolean|null); + + /** ExecuteSqlRequest lastStatement */ + lastStatement?: (boolean|null); + + /** ExecuteSqlRequest routingHint */ + routingHint?: (google.spanner.v1.IRoutingHint|null); + } + + /** Represents an ExecuteSqlRequest. */ + class ExecuteSqlRequest implements IExecuteSqlRequest { + + /** + * Constructs a new ExecuteSqlRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.IExecuteSqlRequest); + + /** ExecuteSqlRequest session. */ + public session: string; + + /** ExecuteSqlRequest transaction. */ + public transaction?: (google.spanner.v1.ITransactionSelector|null); + + /** ExecuteSqlRequest sql. */ + public sql: string; + + /** ExecuteSqlRequest params. */ + public params?: (google.protobuf.IStruct|null); + + /** ExecuteSqlRequest paramTypes. */ + public paramTypes: { [k: string]: google.spanner.v1.IType }; + + /** ExecuteSqlRequest resumeToken. */ + public resumeToken: (Uint8Array|Buffer|string); + + /** ExecuteSqlRequest queryMode. */ + public queryMode: (google.spanner.v1.ExecuteSqlRequest.QueryMode|keyof typeof google.spanner.v1.ExecuteSqlRequest.QueryMode); + + /** ExecuteSqlRequest partitionToken. */ + public partitionToken: (Uint8Array|Buffer|string); + + /** ExecuteSqlRequest seqno. */ + public seqno: (number|Long|string); + + /** ExecuteSqlRequest queryOptions. */ + public queryOptions?: (google.spanner.v1.ExecuteSqlRequest.IQueryOptions|null); + + /** ExecuteSqlRequest requestOptions. */ + public requestOptions?: (google.spanner.v1.IRequestOptions|null); + + /** ExecuteSqlRequest directedReadOptions. */ + public directedReadOptions?: (google.spanner.v1.IDirectedReadOptions|null); + + /** ExecuteSqlRequest dataBoostEnabled. */ + public dataBoostEnabled: boolean; + + /** ExecuteSqlRequest lastStatement. */ + public lastStatement: boolean; + + /** ExecuteSqlRequest routingHint. */ + public routingHint?: (google.spanner.v1.IRoutingHint|null); + + /** + * Creates a new ExecuteSqlRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ExecuteSqlRequest instance + */ + public static create(properties?: google.spanner.v1.IExecuteSqlRequest): google.spanner.v1.ExecuteSqlRequest; + + /** + * Encodes the specified ExecuteSqlRequest message. Does not implicitly {@link google.spanner.v1.ExecuteSqlRequest.verify|verify} messages. + * @param message ExecuteSqlRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.IExecuteSqlRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExecuteSqlRequest message, length delimited. Does not implicitly {@link google.spanner.v1.ExecuteSqlRequest.verify|verify} messages. + * @param message ExecuteSqlRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.IExecuteSqlRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExecuteSqlRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExecuteSqlRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.ExecuteSqlRequest; + + /** + * Decodes an ExecuteSqlRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExecuteSqlRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.ExecuteSqlRequest; + + /** + * Verifies an ExecuteSqlRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExecuteSqlRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExecuteSqlRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.ExecuteSqlRequest; + + /** + * Creates a plain object from an ExecuteSqlRequest message. Also converts values to other types if specified. + * @param message ExecuteSqlRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.ExecuteSqlRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExecuteSqlRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExecuteSqlRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ExecuteSqlRequest { + + /** QueryMode enum. */ + enum QueryMode { + NORMAL = 0, + PLAN = 1, + PROFILE = 2, + WITH_STATS = 3, + WITH_PLAN_AND_STATS = 4 + } + + /** Properties of a QueryOptions. */ + interface IQueryOptions { + + /** QueryOptions optimizerVersion */ + optimizerVersion?: (string|null); + + /** QueryOptions optimizerStatisticsPackage */ + optimizerStatisticsPackage?: (string|null); + } + + /** Represents a QueryOptions. */ + class QueryOptions implements IQueryOptions { + + /** + * Constructs a new QueryOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.ExecuteSqlRequest.IQueryOptions); + + /** QueryOptions optimizerVersion. */ + public optimizerVersion: string; + + /** QueryOptions optimizerStatisticsPackage. */ + public optimizerStatisticsPackage: string; + + /** + * Creates a new QueryOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns QueryOptions instance + */ + public static create(properties?: google.spanner.v1.ExecuteSqlRequest.IQueryOptions): google.spanner.v1.ExecuteSqlRequest.QueryOptions; + + /** + * Encodes the specified QueryOptions message. Does not implicitly {@link google.spanner.v1.ExecuteSqlRequest.QueryOptions.verify|verify} messages. + * @param message QueryOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.ExecuteSqlRequest.IQueryOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QueryOptions message, length delimited. Does not implicitly {@link google.spanner.v1.ExecuteSqlRequest.QueryOptions.verify|verify} messages. + * @param message QueryOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.ExecuteSqlRequest.IQueryOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QueryOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QueryOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.ExecuteSqlRequest.QueryOptions; + + /** + * Decodes a QueryOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QueryOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.ExecuteSqlRequest.QueryOptions; + + /** + * Verifies a QueryOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a QueryOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QueryOptions + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.ExecuteSqlRequest.QueryOptions; + + /** + * Creates a plain object from a QueryOptions message. Also converts values to other types if specified. + * @param message QueryOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.ExecuteSqlRequest.QueryOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QueryOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for QueryOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ExecuteBatchDmlRequest. */ + interface IExecuteBatchDmlRequest { + + /** ExecuteBatchDmlRequest session */ + session?: (string|null); + + /** ExecuteBatchDmlRequest transaction */ + transaction?: (google.spanner.v1.ITransactionSelector|null); + + /** ExecuteBatchDmlRequest statements */ + statements?: (google.spanner.v1.ExecuteBatchDmlRequest.IStatement[]|null); + + /** ExecuteBatchDmlRequest seqno */ + seqno?: (number|Long|string|null); + + /** ExecuteBatchDmlRequest requestOptions */ + requestOptions?: (google.spanner.v1.IRequestOptions|null); + + /** ExecuteBatchDmlRequest lastStatements */ + lastStatements?: (boolean|null); + } + + /** Represents an ExecuteBatchDmlRequest. */ + class ExecuteBatchDmlRequest implements IExecuteBatchDmlRequest { + + /** + * Constructs a new ExecuteBatchDmlRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.IExecuteBatchDmlRequest); + + /** ExecuteBatchDmlRequest session. */ + public session: string; + + /** ExecuteBatchDmlRequest transaction. */ + public transaction?: (google.spanner.v1.ITransactionSelector|null); + + /** ExecuteBatchDmlRequest statements. */ + public statements: google.spanner.v1.ExecuteBatchDmlRequest.IStatement[]; + + /** ExecuteBatchDmlRequest seqno. */ + public seqno: (number|Long|string); + + /** ExecuteBatchDmlRequest requestOptions. */ + public requestOptions?: (google.spanner.v1.IRequestOptions|null); + + /** ExecuteBatchDmlRequest lastStatements. */ + public lastStatements: boolean; + + /** + * Creates a new ExecuteBatchDmlRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ExecuteBatchDmlRequest instance + */ + public static create(properties?: google.spanner.v1.IExecuteBatchDmlRequest): google.spanner.v1.ExecuteBatchDmlRequest; + + /** + * Encodes the specified ExecuteBatchDmlRequest message. Does not implicitly {@link google.spanner.v1.ExecuteBatchDmlRequest.verify|verify} messages. + * @param message ExecuteBatchDmlRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.IExecuteBatchDmlRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExecuteBatchDmlRequest message, length delimited. Does not implicitly {@link google.spanner.v1.ExecuteBatchDmlRequest.verify|verify} messages. + * @param message ExecuteBatchDmlRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.IExecuteBatchDmlRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExecuteBatchDmlRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExecuteBatchDmlRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.ExecuteBatchDmlRequest; + + /** + * Decodes an ExecuteBatchDmlRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExecuteBatchDmlRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.ExecuteBatchDmlRequest; + + /** + * Verifies an ExecuteBatchDmlRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExecuteBatchDmlRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExecuteBatchDmlRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.ExecuteBatchDmlRequest; + + /** + * Creates a plain object from an ExecuteBatchDmlRequest message. Also converts values to other types if specified. + * @param message ExecuteBatchDmlRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.ExecuteBatchDmlRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExecuteBatchDmlRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExecuteBatchDmlRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ExecuteBatchDmlRequest { + + /** Properties of a Statement. */ + interface IStatement { + + /** Statement sql */ + sql?: (string|null); + + /** Statement params */ + params?: (google.protobuf.IStruct|null); + + /** Statement paramTypes */ + paramTypes?: ({ [k: string]: google.spanner.v1.IType }|null); + } + + /** Represents a Statement. */ + class Statement implements IStatement { + + /** + * Constructs a new Statement. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.ExecuteBatchDmlRequest.IStatement); + + /** Statement sql. */ + public sql: string; + + /** Statement params. */ + public params?: (google.protobuf.IStruct|null); + + /** Statement paramTypes. */ + public paramTypes: { [k: string]: google.spanner.v1.IType }; + + /** + * Creates a new Statement instance using the specified properties. + * @param [properties] Properties to set + * @returns Statement instance + */ + public static create(properties?: google.spanner.v1.ExecuteBatchDmlRequest.IStatement): google.spanner.v1.ExecuteBatchDmlRequest.Statement; + + /** + * Encodes the specified Statement message. Does not implicitly {@link google.spanner.v1.ExecuteBatchDmlRequest.Statement.verify|verify} messages. + * @param message Statement message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.ExecuteBatchDmlRequest.IStatement, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Statement message, length delimited. Does not implicitly {@link google.spanner.v1.ExecuteBatchDmlRequest.Statement.verify|verify} messages. + * @param message Statement message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.ExecuteBatchDmlRequest.IStatement, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Statement message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Statement + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.ExecuteBatchDmlRequest.Statement; + + /** + * Decodes a Statement message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Statement + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.ExecuteBatchDmlRequest.Statement; + + /** + * Verifies a Statement message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Statement message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Statement + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.ExecuteBatchDmlRequest.Statement; + + /** + * Creates a plain object from a Statement message. Also converts values to other types if specified. + * @param message Statement + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.ExecuteBatchDmlRequest.Statement, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Statement to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Statement + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ExecuteBatchDmlResponse. */ + interface IExecuteBatchDmlResponse { + + /** ExecuteBatchDmlResponse resultSets */ + resultSets?: (google.spanner.v1.IResultSet[]|null); + + /** ExecuteBatchDmlResponse status */ + status?: (google.rpc.IStatus|null); + + /** ExecuteBatchDmlResponse precommitToken */ + precommitToken?: (google.spanner.v1.IMultiplexedSessionPrecommitToken|null); + } + + /** Represents an ExecuteBatchDmlResponse. */ + class ExecuteBatchDmlResponse implements IExecuteBatchDmlResponse { + + /** + * Constructs a new ExecuteBatchDmlResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.IExecuteBatchDmlResponse); + + /** ExecuteBatchDmlResponse resultSets. */ + public resultSets: google.spanner.v1.IResultSet[]; + + /** ExecuteBatchDmlResponse status. */ + public status?: (google.rpc.IStatus|null); + + /** ExecuteBatchDmlResponse precommitToken. */ + public precommitToken?: (google.spanner.v1.IMultiplexedSessionPrecommitToken|null); + + /** + * Creates a new ExecuteBatchDmlResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ExecuteBatchDmlResponse instance + */ + public static create(properties?: google.spanner.v1.IExecuteBatchDmlResponse): google.spanner.v1.ExecuteBatchDmlResponse; + + /** + * Encodes the specified ExecuteBatchDmlResponse message. Does not implicitly {@link google.spanner.v1.ExecuteBatchDmlResponse.verify|verify} messages. + * @param message ExecuteBatchDmlResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.IExecuteBatchDmlResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExecuteBatchDmlResponse message, length delimited. Does not implicitly {@link google.spanner.v1.ExecuteBatchDmlResponse.verify|verify} messages. + * @param message ExecuteBatchDmlResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.IExecuteBatchDmlResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExecuteBatchDmlResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExecuteBatchDmlResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.ExecuteBatchDmlResponse; + + /** + * Decodes an ExecuteBatchDmlResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExecuteBatchDmlResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.ExecuteBatchDmlResponse; + + /** + * Verifies an ExecuteBatchDmlResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExecuteBatchDmlResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExecuteBatchDmlResponse + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.ExecuteBatchDmlResponse; + + /** + * Creates a plain object from an ExecuteBatchDmlResponse message. Also converts values to other types if specified. + * @param message ExecuteBatchDmlResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.ExecuteBatchDmlResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExecuteBatchDmlResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExecuteBatchDmlResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PartitionOptions. */ + interface IPartitionOptions { + + /** PartitionOptions partitionSizeBytes */ + partitionSizeBytes?: (number|Long|string|null); + + /** PartitionOptions maxPartitions */ + maxPartitions?: (number|Long|string|null); + } + + /** Represents a PartitionOptions. */ + class PartitionOptions implements IPartitionOptions { + + /** + * Constructs a new PartitionOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.IPartitionOptions); + + /** PartitionOptions partitionSizeBytes. */ + public partitionSizeBytes: (number|Long|string); + + /** PartitionOptions maxPartitions. */ + public maxPartitions: (number|Long|string); + + /** + * Creates a new PartitionOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns PartitionOptions instance + */ + public static create(properties?: google.spanner.v1.IPartitionOptions): google.spanner.v1.PartitionOptions; + + /** + * Encodes the specified PartitionOptions message. Does not implicitly {@link google.spanner.v1.PartitionOptions.verify|verify} messages. + * @param message PartitionOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.IPartitionOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PartitionOptions message, length delimited. Does not implicitly {@link google.spanner.v1.PartitionOptions.verify|verify} messages. + * @param message PartitionOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.IPartitionOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PartitionOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PartitionOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.PartitionOptions; + + /** + * Decodes a PartitionOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PartitionOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.PartitionOptions; + + /** + * Verifies a PartitionOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PartitionOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PartitionOptions + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.PartitionOptions; + + /** + * Creates a plain object from a PartitionOptions message. Also converts values to other types if specified. + * @param message PartitionOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.PartitionOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PartitionOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PartitionOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PartitionQueryRequest. */ + interface IPartitionQueryRequest { + + /** PartitionQueryRequest session */ + session?: (string|null); + + /** PartitionQueryRequest transaction */ + transaction?: (google.spanner.v1.ITransactionSelector|null); + + /** PartitionQueryRequest sql */ + sql?: (string|null); + + /** PartitionQueryRequest params */ + params?: (google.protobuf.IStruct|null); + + /** PartitionQueryRequest paramTypes */ + paramTypes?: ({ [k: string]: google.spanner.v1.IType }|null); + + /** PartitionQueryRequest partitionOptions */ + partitionOptions?: (google.spanner.v1.IPartitionOptions|null); + } + + /** Represents a PartitionQueryRequest. */ + class PartitionQueryRequest implements IPartitionQueryRequest { + + /** + * Constructs a new PartitionQueryRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.IPartitionQueryRequest); + + /** PartitionQueryRequest session. */ + public session: string; + + /** PartitionQueryRequest transaction. */ + public transaction?: (google.spanner.v1.ITransactionSelector|null); + + /** PartitionQueryRequest sql. */ + public sql: string; + + /** PartitionQueryRequest params. */ + public params?: (google.protobuf.IStruct|null); + + /** PartitionQueryRequest paramTypes. */ + public paramTypes: { [k: string]: google.spanner.v1.IType }; + + /** PartitionQueryRequest partitionOptions. */ + public partitionOptions?: (google.spanner.v1.IPartitionOptions|null); + + /** + * Creates a new PartitionQueryRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns PartitionQueryRequest instance + */ + public static create(properties?: google.spanner.v1.IPartitionQueryRequest): google.spanner.v1.PartitionQueryRequest; + + /** + * Encodes the specified PartitionQueryRequest message. Does not implicitly {@link google.spanner.v1.PartitionQueryRequest.verify|verify} messages. + * @param message PartitionQueryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.IPartitionQueryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PartitionQueryRequest message, length delimited. Does not implicitly {@link google.spanner.v1.PartitionQueryRequest.verify|verify} messages. + * @param message PartitionQueryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.IPartitionQueryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PartitionQueryRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PartitionQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.PartitionQueryRequest; + + /** + * Decodes a PartitionQueryRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PartitionQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.PartitionQueryRequest; + + /** + * Verifies a PartitionQueryRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PartitionQueryRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PartitionQueryRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.PartitionQueryRequest; + + /** + * Creates a plain object from a PartitionQueryRequest message. Also converts values to other types if specified. + * @param message PartitionQueryRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.PartitionQueryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PartitionQueryRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PartitionQueryRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PartitionReadRequest. */ + interface IPartitionReadRequest { + + /** PartitionReadRequest session */ + session?: (string|null); + + /** PartitionReadRequest transaction */ + transaction?: (google.spanner.v1.ITransactionSelector|null); + + /** PartitionReadRequest table */ + table?: (string|null); + + /** PartitionReadRequest index */ + index?: (string|null); + + /** PartitionReadRequest columns */ + columns?: (string[]|null); + + /** PartitionReadRequest keySet */ + keySet?: (google.spanner.v1.IKeySet|null); + + /** PartitionReadRequest partitionOptions */ + partitionOptions?: (google.spanner.v1.IPartitionOptions|null); + } + + /** Represents a PartitionReadRequest. */ + class PartitionReadRequest implements IPartitionReadRequest { + + /** + * Constructs a new PartitionReadRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.IPartitionReadRequest); + + /** PartitionReadRequest session. */ + public session: string; + + /** PartitionReadRequest transaction. */ + public transaction?: (google.spanner.v1.ITransactionSelector|null); + + /** PartitionReadRequest table. */ + public table: string; + + /** PartitionReadRequest index. */ + public index: string; + + /** PartitionReadRequest columns. */ + public columns: string[]; + + /** PartitionReadRequest keySet. */ + public keySet?: (google.spanner.v1.IKeySet|null); + + /** PartitionReadRequest partitionOptions. */ + public partitionOptions?: (google.spanner.v1.IPartitionOptions|null); + + /** + * Creates a new PartitionReadRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns PartitionReadRequest instance + */ + public static create(properties?: google.spanner.v1.IPartitionReadRequest): google.spanner.v1.PartitionReadRequest; + + /** + * Encodes the specified PartitionReadRequest message. Does not implicitly {@link google.spanner.v1.PartitionReadRequest.verify|verify} messages. + * @param message PartitionReadRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.IPartitionReadRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PartitionReadRequest message, length delimited. Does not implicitly {@link google.spanner.v1.PartitionReadRequest.verify|verify} messages. + * @param message PartitionReadRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.IPartitionReadRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PartitionReadRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PartitionReadRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.PartitionReadRequest; + + /** + * Decodes a PartitionReadRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PartitionReadRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.PartitionReadRequest; + + /** + * Verifies a PartitionReadRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PartitionReadRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PartitionReadRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.PartitionReadRequest; + + /** + * Creates a plain object from a PartitionReadRequest message. Also converts values to other types if specified. + * @param message PartitionReadRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.PartitionReadRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PartitionReadRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PartitionReadRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Partition. */ + interface IPartition { + + /** Partition partitionToken */ + partitionToken?: (Uint8Array|Buffer|string|null); + } + + /** Represents a Partition. */ + class Partition implements IPartition { + + /** + * Constructs a new Partition. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.IPartition); + + /** Partition partitionToken. */ + public partitionToken: (Uint8Array|Buffer|string); + + /** + * Creates a new Partition instance using the specified properties. + * @param [properties] Properties to set + * @returns Partition instance + */ + public static create(properties?: google.spanner.v1.IPartition): google.spanner.v1.Partition; + + /** + * Encodes the specified Partition message. Does not implicitly {@link google.spanner.v1.Partition.verify|verify} messages. + * @param message Partition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.IPartition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Partition message, length delimited. Does not implicitly {@link google.spanner.v1.Partition.verify|verify} messages. + * @param message Partition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.IPartition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Partition message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Partition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.Partition; + + /** + * Decodes a Partition message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Partition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.Partition; + + /** + * Verifies a Partition message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Partition message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Partition + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.Partition; + + /** + * Creates a plain object from a Partition message. Also converts values to other types if specified. + * @param message Partition + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.Partition, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Partition to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Partition + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PartitionResponse. */ + interface IPartitionResponse { + + /** PartitionResponse partitions */ + partitions?: (google.spanner.v1.IPartition[]|null); + + /** PartitionResponse transaction */ + transaction?: (google.spanner.v1.ITransaction|null); + } + + /** Represents a PartitionResponse. */ + class PartitionResponse implements IPartitionResponse { + + /** + * Constructs a new PartitionResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.IPartitionResponse); + + /** PartitionResponse partitions. */ + public partitions: google.spanner.v1.IPartition[]; + + /** PartitionResponse transaction. */ + public transaction?: (google.spanner.v1.ITransaction|null); + + /** + * Creates a new PartitionResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns PartitionResponse instance + */ + public static create(properties?: google.spanner.v1.IPartitionResponse): google.spanner.v1.PartitionResponse; + + /** + * Encodes the specified PartitionResponse message. Does not implicitly {@link google.spanner.v1.PartitionResponse.verify|verify} messages. + * @param message PartitionResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.IPartitionResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PartitionResponse message, length delimited. Does not implicitly {@link google.spanner.v1.PartitionResponse.verify|verify} messages. + * @param message PartitionResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.IPartitionResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PartitionResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PartitionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.PartitionResponse; + + /** + * Decodes a PartitionResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PartitionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.PartitionResponse; + + /** + * Verifies a PartitionResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PartitionResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PartitionResponse + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.PartitionResponse; + + /** + * Creates a plain object from a PartitionResponse message. Also converts values to other types if specified. + * @param message PartitionResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.PartitionResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PartitionResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PartitionResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReadRequest. */ + interface IReadRequest { + + /** ReadRequest session */ + session?: (string|null); + + /** ReadRequest transaction */ + transaction?: (google.spanner.v1.ITransactionSelector|null); + + /** ReadRequest table */ + table?: (string|null); + + /** ReadRequest index */ + index?: (string|null); + + /** ReadRequest columns */ + columns?: (string[]|null); + + /** ReadRequest keySet */ + keySet?: (google.spanner.v1.IKeySet|null); + + /** ReadRequest limit */ + limit?: (number|Long|string|null); + + /** ReadRequest resumeToken */ + resumeToken?: (Uint8Array|Buffer|string|null); + + /** ReadRequest partitionToken */ + partitionToken?: (Uint8Array|Buffer|string|null); + + /** ReadRequest requestOptions */ + requestOptions?: (google.spanner.v1.IRequestOptions|null); + + /** ReadRequest directedReadOptions */ + directedReadOptions?: (google.spanner.v1.IDirectedReadOptions|null); + + /** ReadRequest dataBoostEnabled */ + dataBoostEnabled?: (boolean|null); + + /** ReadRequest orderBy */ + orderBy?: (google.spanner.v1.ReadRequest.OrderBy|keyof typeof google.spanner.v1.ReadRequest.OrderBy|null); + + /** ReadRequest lockHint */ + lockHint?: (google.spanner.v1.ReadRequest.LockHint|keyof typeof google.spanner.v1.ReadRequest.LockHint|null); + + /** ReadRequest routingHint */ + routingHint?: (google.spanner.v1.IRoutingHint|null); + } + + /** Represents a ReadRequest. */ + class ReadRequest implements IReadRequest { + + /** + * Constructs a new ReadRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.IReadRequest); + + /** ReadRequest session. */ + public session: string; + + /** ReadRequest transaction. */ + public transaction?: (google.spanner.v1.ITransactionSelector|null); + + /** ReadRequest table. */ + public table: string; + + /** ReadRequest index. */ + public index: string; + + /** ReadRequest columns. */ + public columns: string[]; + + /** ReadRequest keySet. */ + public keySet?: (google.spanner.v1.IKeySet|null); + + /** ReadRequest limit. */ + public limit: (number|Long|string); + + /** ReadRequest resumeToken. */ + public resumeToken: (Uint8Array|Buffer|string); + + /** ReadRequest partitionToken. */ + public partitionToken: (Uint8Array|Buffer|string); + + /** ReadRequest requestOptions. */ + public requestOptions?: (google.spanner.v1.IRequestOptions|null); + + /** ReadRequest directedReadOptions. */ + public directedReadOptions?: (google.spanner.v1.IDirectedReadOptions|null); + + /** ReadRequest dataBoostEnabled. */ + public dataBoostEnabled: boolean; + + /** ReadRequest orderBy. */ + public orderBy: (google.spanner.v1.ReadRequest.OrderBy|keyof typeof google.spanner.v1.ReadRequest.OrderBy); + + /** ReadRequest lockHint. */ + public lockHint: (google.spanner.v1.ReadRequest.LockHint|keyof typeof google.spanner.v1.ReadRequest.LockHint); + + /** ReadRequest routingHint. */ + public routingHint?: (google.spanner.v1.IRoutingHint|null); + + /** + * Creates a new ReadRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ReadRequest instance + */ + public static create(properties?: google.spanner.v1.IReadRequest): google.spanner.v1.ReadRequest; + + /** + * Encodes the specified ReadRequest message. Does not implicitly {@link google.spanner.v1.ReadRequest.verify|verify} messages. + * @param message ReadRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.IReadRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReadRequest message, length delimited. Does not implicitly {@link google.spanner.v1.ReadRequest.verify|verify} messages. + * @param message ReadRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.IReadRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReadRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReadRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.ReadRequest; + + /** + * Decodes a ReadRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReadRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.ReadRequest; + + /** + * Verifies a ReadRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReadRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReadRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.ReadRequest; + + /** + * Creates a plain object from a ReadRequest message. Also converts values to other types if specified. + * @param message ReadRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.ReadRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReadRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReadRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ReadRequest { + + /** OrderBy enum. */ + enum OrderBy { + ORDER_BY_UNSPECIFIED = 0, + ORDER_BY_PRIMARY_KEY = 1, + ORDER_BY_NO_ORDER = 2 + } + + /** LockHint enum. */ + enum LockHint { + LOCK_HINT_UNSPECIFIED = 0, + LOCK_HINT_SHARED = 1, + LOCK_HINT_EXCLUSIVE = 2 + } + } + + /** Properties of a BeginTransactionRequest. */ + interface IBeginTransactionRequest { + + /** BeginTransactionRequest session */ + session?: (string|null); + + /** BeginTransactionRequest options */ + options?: (google.spanner.v1.ITransactionOptions|null); + + /** BeginTransactionRequest requestOptions */ + requestOptions?: (google.spanner.v1.IRequestOptions|null); + + /** BeginTransactionRequest mutationKey */ + mutationKey?: (google.spanner.v1.IMutation|null); + } + + /** Represents a BeginTransactionRequest. */ + class BeginTransactionRequest implements IBeginTransactionRequest { + + /** + * Constructs a new BeginTransactionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.IBeginTransactionRequest); + + /** BeginTransactionRequest session. */ + public session: string; + + /** BeginTransactionRequest options. */ + public options?: (google.spanner.v1.ITransactionOptions|null); + + /** BeginTransactionRequest requestOptions. */ + public requestOptions?: (google.spanner.v1.IRequestOptions|null); + + /** BeginTransactionRequest mutationKey. */ + public mutationKey?: (google.spanner.v1.IMutation|null); + + /** + * Creates a new BeginTransactionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns BeginTransactionRequest instance + */ + public static create(properties?: google.spanner.v1.IBeginTransactionRequest): google.spanner.v1.BeginTransactionRequest; + + /** + * Encodes the specified BeginTransactionRequest message. Does not implicitly {@link google.spanner.v1.BeginTransactionRequest.verify|verify} messages. + * @param message BeginTransactionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.IBeginTransactionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BeginTransactionRequest message, length delimited. Does not implicitly {@link google.spanner.v1.BeginTransactionRequest.verify|verify} messages. + * @param message BeginTransactionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.IBeginTransactionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BeginTransactionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BeginTransactionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.BeginTransactionRequest; + + /** + * Decodes a BeginTransactionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BeginTransactionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.BeginTransactionRequest; + + /** + * Verifies a BeginTransactionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BeginTransactionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BeginTransactionRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.BeginTransactionRequest; + + /** + * Creates a plain object from a BeginTransactionRequest message. Also converts values to other types if specified. + * @param message BeginTransactionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.BeginTransactionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BeginTransactionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BeginTransactionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CommitRequest. */ + interface ICommitRequest { + + /** CommitRequest session */ + session?: (string|null); + + /** CommitRequest transactionId */ + transactionId?: (Uint8Array|Buffer|string|null); + + /** CommitRequest singleUseTransaction */ + singleUseTransaction?: (google.spanner.v1.ITransactionOptions|null); + + /** CommitRequest mutations */ + mutations?: (google.spanner.v1.IMutation[]|null); + + /** CommitRequest returnCommitStats */ + returnCommitStats?: (boolean|null); + + /** CommitRequest maxCommitDelay */ + maxCommitDelay?: (google.protobuf.IDuration|null); + + /** CommitRequest requestOptions */ + requestOptions?: (google.spanner.v1.IRequestOptions|null); + + /** CommitRequest precommitToken */ + precommitToken?: (google.spanner.v1.IMultiplexedSessionPrecommitToken|null); + } + + /** Represents a CommitRequest. */ + class CommitRequest implements ICommitRequest { + + /** + * Constructs a new CommitRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.ICommitRequest); + + /** CommitRequest session. */ + public session: string; + + /** CommitRequest transactionId. */ + public transactionId?: (Uint8Array|Buffer|string|null); + + /** CommitRequest singleUseTransaction. */ + public singleUseTransaction?: (google.spanner.v1.ITransactionOptions|null); + + /** CommitRequest mutations. */ + public mutations: google.spanner.v1.IMutation[]; + + /** CommitRequest returnCommitStats. */ + public returnCommitStats: boolean; + + /** CommitRequest maxCommitDelay. */ + public maxCommitDelay?: (google.protobuf.IDuration|null); + + /** CommitRequest requestOptions. */ + public requestOptions?: (google.spanner.v1.IRequestOptions|null); + + /** CommitRequest precommitToken. */ + public precommitToken?: (google.spanner.v1.IMultiplexedSessionPrecommitToken|null); + + /** CommitRequest transaction. */ + public transaction?: ("transactionId"|"singleUseTransaction"); + + /** + * Creates a new CommitRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CommitRequest instance + */ + public static create(properties?: google.spanner.v1.ICommitRequest): google.spanner.v1.CommitRequest; + + /** + * Encodes the specified CommitRequest message. Does not implicitly {@link google.spanner.v1.CommitRequest.verify|verify} messages. + * @param message CommitRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.ICommitRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CommitRequest message, length delimited. Does not implicitly {@link google.spanner.v1.CommitRequest.verify|verify} messages. + * @param message CommitRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.ICommitRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CommitRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CommitRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.CommitRequest; + + /** + * Decodes a CommitRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CommitRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.CommitRequest; + + /** + * Verifies a CommitRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CommitRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CommitRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.CommitRequest; + + /** + * Creates a plain object from a CommitRequest message. Also converts values to other types if specified. + * @param message CommitRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.CommitRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CommitRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CommitRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RollbackRequest. */ + interface IRollbackRequest { + + /** RollbackRequest session */ + session?: (string|null); + + /** RollbackRequest transactionId */ + transactionId?: (Uint8Array|Buffer|string|null); + } + + /** Represents a RollbackRequest. */ + class RollbackRequest implements IRollbackRequest { + + /** + * Constructs a new RollbackRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.IRollbackRequest); + + /** RollbackRequest session. */ + public session: string; + + /** RollbackRequest transactionId. */ + public transactionId: (Uint8Array|Buffer|string); + + /** + * Creates a new RollbackRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RollbackRequest instance + */ + public static create(properties?: google.spanner.v1.IRollbackRequest): google.spanner.v1.RollbackRequest; + + /** + * Encodes the specified RollbackRequest message. Does not implicitly {@link google.spanner.v1.RollbackRequest.verify|verify} messages. + * @param message RollbackRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.IRollbackRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RollbackRequest message, length delimited. Does not implicitly {@link google.spanner.v1.RollbackRequest.verify|verify} messages. + * @param message RollbackRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.IRollbackRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RollbackRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RollbackRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.RollbackRequest; + + /** + * Decodes a RollbackRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RollbackRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.RollbackRequest; + + /** + * Verifies a RollbackRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RollbackRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RollbackRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.RollbackRequest; + + /** + * Creates a plain object from a RollbackRequest message. Also converts values to other types if specified. + * @param message RollbackRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.RollbackRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RollbackRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RollbackRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchWriteRequest. */ + interface IBatchWriteRequest { + + /** BatchWriteRequest session */ + session?: (string|null); + + /** BatchWriteRequest requestOptions */ + requestOptions?: (google.spanner.v1.IRequestOptions|null); + + /** BatchWriteRequest mutationGroups */ + mutationGroups?: (google.spanner.v1.BatchWriteRequest.IMutationGroup[]|null); + + /** BatchWriteRequest excludeTxnFromChangeStreams */ + excludeTxnFromChangeStreams?: (boolean|null); + } + + /** Represents a BatchWriteRequest. */ + class BatchWriteRequest implements IBatchWriteRequest { + + /** + * Constructs a new BatchWriteRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.IBatchWriteRequest); + + /** BatchWriteRequest session. */ + public session: string; + + /** BatchWriteRequest requestOptions. */ + public requestOptions?: (google.spanner.v1.IRequestOptions|null); + + /** BatchWriteRequest mutationGroups. */ + public mutationGroups: google.spanner.v1.BatchWriteRequest.IMutationGroup[]; + + /** BatchWriteRequest excludeTxnFromChangeStreams. */ + public excludeTxnFromChangeStreams: boolean; + + /** + * Creates a new BatchWriteRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchWriteRequest instance + */ + public static create(properties?: google.spanner.v1.IBatchWriteRequest): google.spanner.v1.BatchWriteRequest; + + /** + * Encodes the specified BatchWriteRequest message. Does not implicitly {@link google.spanner.v1.BatchWriteRequest.verify|verify} messages. + * @param message BatchWriteRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.IBatchWriteRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchWriteRequest message, length delimited. Does not implicitly {@link google.spanner.v1.BatchWriteRequest.verify|verify} messages. + * @param message BatchWriteRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.IBatchWriteRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchWriteRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchWriteRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.BatchWriteRequest; + + /** + * Decodes a BatchWriteRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchWriteRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.BatchWriteRequest; + + /** + * Verifies a BatchWriteRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchWriteRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchWriteRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.BatchWriteRequest; + + /** + * Creates a plain object from a BatchWriteRequest message. Also converts values to other types if specified. + * @param message BatchWriteRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.BatchWriteRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchWriteRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchWriteRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BatchWriteRequest { + + /** Properties of a MutationGroup. */ + interface IMutationGroup { + + /** MutationGroup mutations */ + mutations?: (google.spanner.v1.IMutation[]|null); + } + + /** Represents a MutationGroup. */ + class MutationGroup implements IMutationGroup { + + /** + * Constructs a new MutationGroup. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.BatchWriteRequest.IMutationGroup); + + /** MutationGroup mutations. */ + public mutations: google.spanner.v1.IMutation[]; + + /** + * Creates a new MutationGroup instance using the specified properties. + * @param [properties] Properties to set + * @returns MutationGroup instance + */ + public static create(properties?: google.spanner.v1.BatchWriteRequest.IMutationGroup): google.spanner.v1.BatchWriteRequest.MutationGroup; + + /** + * Encodes the specified MutationGroup message. Does not implicitly {@link google.spanner.v1.BatchWriteRequest.MutationGroup.verify|verify} messages. + * @param message MutationGroup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.BatchWriteRequest.IMutationGroup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MutationGroup message, length delimited. Does not implicitly {@link google.spanner.v1.BatchWriteRequest.MutationGroup.verify|verify} messages. + * @param message MutationGroup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.BatchWriteRequest.IMutationGroup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MutationGroup message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MutationGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.BatchWriteRequest.MutationGroup; + + /** + * Decodes a MutationGroup message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MutationGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.BatchWriteRequest.MutationGroup; + + /** + * Verifies a MutationGroup message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MutationGroup message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MutationGroup + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.BatchWriteRequest.MutationGroup; + + /** + * Creates a plain object from a MutationGroup message. Also converts values to other types if specified. + * @param message MutationGroup + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.BatchWriteRequest.MutationGroup, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MutationGroup to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MutationGroup + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a BatchWriteResponse. */ + interface IBatchWriteResponse { + + /** BatchWriteResponse indexes */ + indexes?: (number[]|null); + + /** BatchWriteResponse status */ + status?: (google.rpc.IStatus|null); + + /** BatchWriteResponse commitTimestamp */ + commitTimestamp?: (google.protobuf.ITimestamp|null); + } + + /** Represents a BatchWriteResponse. */ + class BatchWriteResponse implements IBatchWriteResponse { + + /** + * Constructs a new BatchWriteResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.IBatchWriteResponse); + + /** BatchWriteResponse indexes. */ + public indexes: number[]; + + /** BatchWriteResponse status. */ + public status?: (google.rpc.IStatus|null); + + /** BatchWriteResponse commitTimestamp. */ + public commitTimestamp?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new BatchWriteResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchWriteResponse instance + */ + public static create(properties?: google.spanner.v1.IBatchWriteResponse): google.spanner.v1.BatchWriteResponse; + + /** + * Encodes the specified BatchWriteResponse message. Does not implicitly {@link google.spanner.v1.BatchWriteResponse.verify|verify} messages. + * @param message BatchWriteResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.IBatchWriteResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchWriteResponse message, length delimited. Does not implicitly {@link google.spanner.v1.BatchWriteResponse.verify|verify} messages. + * @param message BatchWriteResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.IBatchWriteResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchWriteResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchWriteResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.BatchWriteResponse; + + /** + * Decodes a BatchWriteResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchWriteResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.BatchWriteResponse; + + /** + * Verifies a BatchWriteResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchWriteResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchWriteResponse + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.BatchWriteResponse; + + /** + * Creates a plain object from a BatchWriteResponse message. Also converts values to other types if specified. + * @param message BatchWriteResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.BatchWriteResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchWriteResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchWriteResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CommitResponse. */ + interface ICommitResponse { + + /** CommitResponse commitTimestamp */ + commitTimestamp?: (google.protobuf.ITimestamp|null); + + /** CommitResponse commitStats */ + commitStats?: (google.spanner.v1.CommitResponse.ICommitStats|null); + + /** CommitResponse precommitToken */ + precommitToken?: (google.spanner.v1.IMultiplexedSessionPrecommitToken|null); + + /** CommitResponse snapshotTimestamp */ + snapshotTimestamp?: (google.protobuf.ITimestamp|null); + } + + /** Represents a CommitResponse. */ + class CommitResponse implements ICommitResponse { + + /** + * Constructs a new CommitResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.ICommitResponse); + + /** CommitResponse commitTimestamp. */ + public commitTimestamp?: (google.protobuf.ITimestamp|null); + + /** CommitResponse commitStats. */ + public commitStats?: (google.spanner.v1.CommitResponse.ICommitStats|null); + + /** CommitResponse precommitToken. */ + public precommitToken?: (google.spanner.v1.IMultiplexedSessionPrecommitToken|null); + + /** CommitResponse snapshotTimestamp. */ + public snapshotTimestamp?: (google.protobuf.ITimestamp|null); + + /** CommitResponse MultiplexedSessionRetry. */ + public MultiplexedSessionRetry?: "precommitToken"; + + /** + * Creates a new CommitResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns CommitResponse instance + */ + public static create(properties?: google.spanner.v1.ICommitResponse): google.spanner.v1.CommitResponse; + + /** + * Encodes the specified CommitResponse message. Does not implicitly {@link google.spanner.v1.CommitResponse.verify|verify} messages. + * @param message CommitResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.ICommitResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CommitResponse message, length delimited. Does not implicitly {@link google.spanner.v1.CommitResponse.verify|verify} messages. + * @param message CommitResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.ICommitResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CommitResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CommitResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.CommitResponse; + + /** + * Decodes a CommitResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CommitResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.CommitResponse; + + /** + * Verifies a CommitResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CommitResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CommitResponse + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.CommitResponse; + + /** + * Creates a plain object from a CommitResponse message. Also converts values to other types if specified. + * @param message CommitResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.CommitResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CommitResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CommitResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace CommitResponse { + + /** Properties of a CommitStats. */ + interface ICommitStats { + + /** CommitStats mutationCount */ + mutationCount?: (number|Long|string|null); + } + + /** Represents a CommitStats. */ + class CommitStats implements ICommitStats { + + /** + * Constructs a new CommitStats. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.CommitResponse.ICommitStats); + + /** CommitStats mutationCount. */ + public mutationCount: (number|Long|string); + + /** + * Creates a new CommitStats instance using the specified properties. + * @param [properties] Properties to set + * @returns CommitStats instance + */ + public static create(properties?: google.spanner.v1.CommitResponse.ICommitStats): google.spanner.v1.CommitResponse.CommitStats; + + /** + * Encodes the specified CommitStats message. Does not implicitly {@link google.spanner.v1.CommitResponse.CommitStats.verify|verify} messages. + * @param message CommitStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.CommitResponse.ICommitStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CommitStats message, length delimited. Does not implicitly {@link google.spanner.v1.CommitResponse.CommitStats.verify|verify} messages. + * @param message CommitStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.CommitResponse.ICommitStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CommitStats message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CommitStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.CommitResponse.CommitStats; + + /** + * Decodes a CommitStats message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CommitStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.CommitResponse.CommitStats; + + /** + * Verifies a CommitStats message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CommitStats message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CommitStats + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.CommitResponse.CommitStats; + + /** + * Creates a plain object from a CommitStats message. Also converts values to other types if specified. + * @param message CommitStats + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.CommitResponse.CommitStats, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CommitStats to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CommitStats + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a TransactionOptions. */ + interface ITransactionOptions { + + /** TransactionOptions readWrite */ + readWrite?: (google.spanner.v1.TransactionOptions.IReadWrite|null); + + /** TransactionOptions partitionedDml */ + partitionedDml?: (google.spanner.v1.TransactionOptions.IPartitionedDml|null); + + /** TransactionOptions readOnly */ + readOnly?: (google.spanner.v1.TransactionOptions.IReadOnly|null); + + /** TransactionOptions excludeTxnFromChangeStreams */ + excludeTxnFromChangeStreams?: (boolean|null); + + /** TransactionOptions isolationLevel */ + isolationLevel?: (google.spanner.v1.TransactionOptions.IsolationLevel|keyof typeof google.spanner.v1.TransactionOptions.IsolationLevel|null); + } + + /** Represents a TransactionOptions. */ + class TransactionOptions implements ITransactionOptions { + + /** + * Constructs a new TransactionOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.ITransactionOptions); + + /** TransactionOptions readWrite. */ + public readWrite?: (google.spanner.v1.TransactionOptions.IReadWrite|null); + + /** TransactionOptions partitionedDml. */ + public partitionedDml?: (google.spanner.v1.TransactionOptions.IPartitionedDml|null); + + /** TransactionOptions readOnly. */ + public readOnly?: (google.spanner.v1.TransactionOptions.IReadOnly|null); + + /** TransactionOptions excludeTxnFromChangeStreams. */ + public excludeTxnFromChangeStreams: boolean; + + /** TransactionOptions isolationLevel. */ + public isolationLevel: (google.spanner.v1.TransactionOptions.IsolationLevel|keyof typeof google.spanner.v1.TransactionOptions.IsolationLevel); + + /** TransactionOptions mode. */ + public mode?: ("readWrite"|"partitionedDml"|"readOnly"); + + /** + * Creates a new TransactionOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionOptions instance + */ + public static create(properties?: google.spanner.v1.ITransactionOptions): google.spanner.v1.TransactionOptions; + + /** + * Encodes the specified TransactionOptions message. Does not implicitly {@link google.spanner.v1.TransactionOptions.verify|verify} messages. + * @param message TransactionOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.ITransactionOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TransactionOptions message, length delimited. Does not implicitly {@link google.spanner.v1.TransactionOptions.verify|verify} messages. + * @param message TransactionOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.ITransactionOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TransactionOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.TransactionOptions; + + /** + * Decodes a TransactionOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TransactionOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.TransactionOptions; + + /** + * Verifies a TransactionOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TransactionOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TransactionOptions + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.TransactionOptions; + + /** + * Creates a plain object from a TransactionOptions message. Also converts values to other types if specified. + * @param message TransactionOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.TransactionOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TransactionOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TransactionOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace TransactionOptions { + + /** Properties of a ReadWrite. */ + interface IReadWrite { + + /** ReadWrite readLockMode */ + readLockMode?: (google.spanner.v1.TransactionOptions.ReadWrite.ReadLockMode|keyof typeof google.spanner.v1.TransactionOptions.ReadWrite.ReadLockMode|null); + + /** ReadWrite multiplexedSessionPreviousTransactionId */ + multiplexedSessionPreviousTransactionId?: (Uint8Array|Buffer|string|null); + } + + /** Represents a ReadWrite. */ + class ReadWrite implements IReadWrite { + + /** + * Constructs a new ReadWrite. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.TransactionOptions.IReadWrite); + + /** ReadWrite readLockMode. */ + public readLockMode: (google.spanner.v1.TransactionOptions.ReadWrite.ReadLockMode|keyof typeof google.spanner.v1.TransactionOptions.ReadWrite.ReadLockMode); + + /** ReadWrite multiplexedSessionPreviousTransactionId. */ + public multiplexedSessionPreviousTransactionId: (Uint8Array|Buffer|string); + + /** + * Creates a new ReadWrite instance using the specified properties. + * @param [properties] Properties to set + * @returns ReadWrite instance + */ + public static create(properties?: google.spanner.v1.TransactionOptions.IReadWrite): google.spanner.v1.TransactionOptions.ReadWrite; + + /** + * Encodes the specified ReadWrite message. Does not implicitly {@link google.spanner.v1.TransactionOptions.ReadWrite.verify|verify} messages. + * @param message ReadWrite message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.TransactionOptions.IReadWrite, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReadWrite message, length delimited. Does not implicitly {@link google.spanner.v1.TransactionOptions.ReadWrite.verify|verify} messages. + * @param message ReadWrite message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.TransactionOptions.IReadWrite, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReadWrite message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReadWrite + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.TransactionOptions.ReadWrite; + + /** + * Decodes a ReadWrite message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReadWrite + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.TransactionOptions.ReadWrite; + + /** + * Verifies a ReadWrite message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReadWrite message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReadWrite + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.TransactionOptions.ReadWrite; + + /** + * Creates a plain object from a ReadWrite message. Also converts values to other types if specified. + * @param message ReadWrite + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.TransactionOptions.ReadWrite, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReadWrite to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReadWrite + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ReadWrite { + + /** ReadLockMode enum. */ + enum ReadLockMode { + READ_LOCK_MODE_UNSPECIFIED = 0, + PESSIMISTIC = 1, + OPTIMISTIC = 2 + } + } + + /** Properties of a PartitionedDml. */ + interface IPartitionedDml { + } + + /** Represents a PartitionedDml. */ + class PartitionedDml implements IPartitionedDml { + + /** + * Constructs a new PartitionedDml. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.TransactionOptions.IPartitionedDml); + + /** + * Creates a new PartitionedDml instance using the specified properties. + * @param [properties] Properties to set + * @returns PartitionedDml instance + */ + public static create(properties?: google.spanner.v1.TransactionOptions.IPartitionedDml): google.spanner.v1.TransactionOptions.PartitionedDml; + + /** + * Encodes the specified PartitionedDml message. Does not implicitly {@link google.spanner.v1.TransactionOptions.PartitionedDml.verify|verify} messages. + * @param message PartitionedDml message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.TransactionOptions.IPartitionedDml, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PartitionedDml message, length delimited. Does not implicitly {@link google.spanner.v1.TransactionOptions.PartitionedDml.verify|verify} messages. + * @param message PartitionedDml message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.TransactionOptions.IPartitionedDml, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PartitionedDml message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PartitionedDml + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.TransactionOptions.PartitionedDml; + + /** + * Decodes a PartitionedDml message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PartitionedDml + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.TransactionOptions.PartitionedDml; + + /** + * Verifies a PartitionedDml message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PartitionedDml message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PartitionedDml + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.TransactionOptions.PartitionedDml; + + /** + * Creates a plain object from a PartitionedDml message. Also converts values to other types if specified. + * @param message PartitionedDml + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.TransactionOptions.PartitionedDml, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PartitionedDml to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PartitionedDml + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReadOnly. */ + interface IReadOnly { + + /** ReadOnly strong */ + strong?: (boolean|null); + + /** ReadOnly minReadTimestamp */ + minReadTimestamp?: (google.protobuf.ITimestamp|null); + + /** ReadOnly maxStaleness */ + maxStaleness?: (google.protobuf.IDuration|null); + + /** ReadOnly readTimestamp */ + readTimestamp?: (google.protobuf.ITimestamp|null); + + /** ReadOnly exactStaleness */ + exactStaleness?: (google.protobuf.IDuration|null); + + /** ReadOnly returnReadTimestamp */ + returnReadTimestamp?: (boolean|null); + } + + /** Represents a ReadOnly. */ + class ReadOnly implements IReadOnly { + + /** + * Constructs a new ReadOnly. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.TransactionOptions.IReadOnly); + + /** ReadOnly strong. */ + public strong?: (boolean|null); + + /** ReadOnly minReadTimestamp. */ + public minReadTimestamp?: (google.protobuf.ITimestamp|null); + + /** ReadOnly maxStaleness. */ + public maxStaleness?: (google.protobuf.IDuration|null); + + /** ReadOnly readTimestamp. */ + public readTimestamp?: (google.protobuf.ITimestamp|null); + + /** ReadOnly exactStaleness. */ + public exactStaleness?: (google.protobuf.IDuration|null); + + /** ReadOnly returnReadTimestamp. */ + public returnReadTimestamp: boolean; + + /** ReadOnly timestampBound. */ + public timestampBound?: ("strong"|"minReadTimestamp"|"maxStaleness"|"readTimestamp"|"exactStaleness"); + + /** + * Creates a new ReadOnly instance using the specified properties. + * @param [properties] Properties to set + * @returns ReadOnly instance + */ + public static create(properties?: google.spanner.v1.TransactionOptions.IReadOnly): google.spanner.v1.TransactionOptions.ReadOnly; + + /** + * Encodes the specified ReadOnly message. Does not implicitly {@link google.spanner.v1.TransactionOptions.ReadOnly.verify|verify} messages. + * @param message ReadOnly message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.TransactionOptions.IReadOnly, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReadOnly message, length delimited. Does not implicitly {@link google.spanner.v1.TransactionOptions.ReadOnly.verify|verify} messages. + * @param message ReadOnly message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.TransactionOptions.IReadOnly, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReadOnly message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReadOnly + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.TransactionOptions.ReadOnly; + + /** + * Decodes a ReadOnly message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReadOnly + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.TransactionOptions.ReadOnly; + + /** + * Verifies a ReadOnly message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReadOnly message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReadOnly + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.TransactionOptions.ReadOnly; + + /** + * Creates a plain object from a ReadOnly message. Also converts values to other types if specified. + * @param message ReadOnly + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.TransactionOptions.ReadOnly, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReadOnly to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReadOnly + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** IsolationLevel enum. */ + enum IsolationLevel { + ISOLATION_LEVEL_UNSPECIFIED = 0, + SERIALIZABLE = 1, + REPEATABLE_READ = 2 + } + } + + /** Properties of a Transaction. */ + interface ITransaction { + + /** Transaction id */ + id?: (Uint8Array|Buffer|string|null); + + /** Transaction readTimestamp */ + readTimestamp?: (google.protobuf.ITimestamp|null); + + /** Transaction precommitToken */ + precommitToken?: (google.spanner.v1.IMultiplexedSessionPrecommitToken|null); + } + + /** Represents a Transaction. */ + class Transaction implements ITransaction { + + /** + * Constructs a new Transaction. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.ITransaction); + + /** Transaction id. */ + public id: (Uint8Array|Buffer|string); + + /** Transaction readTimestamp. */ + public readTimestamp?: (google.protobuf.ITimestamp|null); + + /** Transaction precommitToken. */ + public precommitToken?: (google.spanner.v1.IMultiplexedSessionPrecommitToken|null); + + /** + * Creates a new Transaction instance using the specified properties. + * @param [properties] Properties to set + * @returns Transaction instance + */ + public static create(properties?: google.spanner.v1.ITransaction): google.spanner.v1.Transaction; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link google.spanner.v1.Transaction.verify|verify} messages. + * @param message Transaction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.ITransaction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Transaction message, length delimited. Does not implicitly {@link google.spanner.v1.Transaction.verify|verify} messages. + * @param message Transaction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.ITransaction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.Transaction; + + /** + * Decodes a Transaction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.Transaction; + + /** + * Verifies a Transaction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Transaction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Transaction + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.Transaction; + + /** + * Creates a plain object from a Transaction message. Also converts values to other types if specified. + * @param message Transaction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.Transaction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Transaction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Transaction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionSelector. */ + interface ITransactionSelector { + + /** TransactionSelector singleUse */ + singleUse?: (google.spanner.v1.ITransactionOptions|null); + + /** TransactionSelector id */ + id?: (Uint8Array|Buffer|string|null); + + /** TransactionSelector begin */ + begin?: (google.spanner.v1.ITransactionOptions|null); + } + + /** Represents a TransactionSelector. */ + class TransactionSelector implements ITransactionSelector { + + /** + * Constructs a new TransactionSelector. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.ITransactionSelector); + + /** TransactionSelector singleUse. */ + public singleUse?: (google.spanner.v1.ITransactionOptions|null); + + /** TransactionSelector id. */ + public id?: (Uint8Array|Buffer|string|null); + + /** TransactionSelector begin. */ + public begin?: (google.spanner.v1.ITransactionOptions|null); + + /** TransactionSelector selector. */ + public selector?: ("singleUse"|"id"|"begin"); + + /** + * Creates a new TransactionSelector instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionSelector instance + */ + public static create(properties?: google.spanner.v1.ITransactionSelector): google.spanner.v1.TransactionSelector; + + /** + * Encodes the specified TransactionSelector message. Does not implicitly {@link google.spanner.v1.TransactionSelector.verify|verify} messages. + * @param message TransactionSelector message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.ITransactionSelector, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TransactionSelector message, length delimited. Does not implicitly {@link google.spanner.v1.TransactionSelector.verify|verify} messages. + * @param message TransactionSelector message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.ITransactionSelector, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionSelector message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TransactionSelector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.TransactionSelector; + + /** + * Decodes a TransactionSelector message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TransactionSelector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.TransactionSelector; + + /** + * Verifies a TransactionSelector message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TransactionSelector message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TransactionSelector + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.TransactionSelector; + + /** + * Creates a plain object from a TransactionSelector message. Also converts values to other types if specified. + * @param message TransactionSelector + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.TransactionSelector, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TransactionSelector to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TransactionSelector + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MultiplexedSessionPrecommitToken. */ + interface IMultiplexedSessionPrecommitToken { + + /** MultiplexedSessionPrecommitToken precommitToken */ + precommitToken?: (Uint8Array|Buffer|string|null); + + /** MultiplexedSessionPrecommitToken seqNum */ + seqNum?: (number|null); + } + + /** Represents a MultiplexedSessionPrecommitToken. */ + class MultiplexedSessionPrecommitToken implements IMultiplexedSessionPrecommitToken { + + /** + * Constructs a new MultiplexedSessionPrecommitToken. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.IMultiplexedSessionPrecommitToken); + + /** MultiplexedSessionPrecommitToken precommitToken. */ + public precommitToken: (Uint8Array|Buffer|string); + + /** MultiplexedSessionPrecommitToken seqNum. */ + public seqNum: number; + + /** + * Creates a new MultiplexedSessionPrecommitToken instance using the specified properties. + * @param [properties] Properties to set + * @returns MultiplexedSessionPrecommitToken instance + */ + public static create(properties?: google.spanner.v1.IMultiplexedSessionPrecommitToken): google.spanner.v1.MultiplexedSessionPrecommitToken; + + /** + * Encodes the specified MultiplexedSessionPrecommitToken message. Does not implicitly {@link google.spanner.v1.MultiplexedSessionPrecommitToken.verify|verify} messages. + * @param message MultiplexedSessionPrecommitToken message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.IMultiplexedSessionPrecommitToken, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MultiplexedSessionPrecommitToken message, length delimited. Does not implicitly {@link google.spanner.v1.MultiplexedSessionPrecommitToken.verify|verify} messages. + * @param message MultiplexedSessionPrecommitToken message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.IMultiplexedSessionPrecommitToken, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MultiplexedSessionPrecommitToken message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MultiplexedSessionPrecommitToken + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.MultiplexedSessionPrecommitToken; + + /** + * Decodes a MultiplexedSessionPrecommitToken message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MultiplexedSessionPrecommitToken + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.MultiplexedSessionPrecommitToken; + + /** + * Verifies a MultiplexedSessionPrecommitToken message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MultiplexedSessionPrecommitToken message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MultiplexedSessionPrecommitToken + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.MultiplexedSessionPrecommitToken; + + /** + * Creates a plain object from a MultiplexedSessionPrecommitToken message. Also converts values to other types if specified. + * @param message MultiplexedSessionPrecommitToken + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.MultiplexedSessionPrecommitToken, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MultiplexedSessionPrecommitToken to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MultiplexedSessionPrecommitToken + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a KeyRange. */ + interface IKeyRange { + + /** KeyRange startClosed */ + startClosed?: (google.protobuf.IListValue|null); + + /** KeyRange startOpen */ + startOpen?: (google.protobuf.IListValue|null); + + /** KeyRange endClosed */ + endClosed?: (google.protobuf.IListValue|null); + + /** KeyRange endOpen */ + endOpen?: (google.protobuf.IListValue|null); + } + + /** Represents a KeyRange. */ + class KeyRange implements IKeyRange { + + /** + * Constructs a new KeyRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.IKeyRange); + + /** KeyRange startClosed. */ + public startClosed?: (google.protobuf.IListValue|null); + + /** KeyRange startOpen. */ + public startOpen?: (google.protobuf.IListValue|null); + + /** KeyRange endClosed. */ + public endClosed?: (google.protobuf.IListValue|null); + + /** KeyRange endOpen. */ + public endOpen?: (google.protobuf.IListValue|null); + + /** KeyRange startKeyType. */ + public startKeyType?: ("startClosed"|"startOpen"); + + /** KeyRange endKeyType. */ + public endKeyType?: ("endClosed"|"endOpen"); + + /** + * Creates a new KeyRange instance using the specified properties. + * @param [properties] Properties to set + * @returns KeyRange instance + */ + public static create(properties?: google.spanner.v1.IKeyRange): google.spanner.v1.KeyRange; + + /** + * Encodes the specified KeyRange message. Does not implicitly {@link google.spanner.v1.KeyRange.verify|verify} messages. + * @param message KeyRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.IKeyRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified KeyRange message, length delimited. Does not implicitly {@link google.spanner.v1.KeyRange.verify|verify} messages. + * @param message KeyRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.IKeyRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KeyRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns KeyRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.KeyRange; + + /** + * Decodes a KeyRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns KeyRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.KeyRange; + + /** + * Verifies a KeyRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a KeyRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns KeyRange + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.KeyRange; + + /** + * Creates a plain object from a KeyRange message. Also converts values to other types if specified. + * @param message KeyRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.KeyRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this KeyRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for KeyRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a KeySet. */ + interface IKeySet { + + /** KeySet keys */ + keys?: (google.protobuf.IListValue[]|null); + + /** KeySet ranges */ + ranges?: (google.spanner.v1.IKeyRange[]|null); + + /** KeySet all */ + all?: (boolean|null); + } + + /** Represents a KeySet. */ + class KeySet implements IKeySet { + + /** + * Constructs a new KeySet. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.IKeySet); + + /** KeySet keys. */ + public keys: google.protobuf.IListValue[]; + + /** KeySet ranges. */ + public ranges: google.spanner.v1.IKeyRange[]; + + /** KeySet all. */ + public all: boolean; + + /** + * Creates a new KeySet instance using the specified properties. + * @param [properties] Properties to set + * @returns KeySet instance + */ + public static create(properties?: google.spanner.v1.IKeySet): google.spanner.v1.KeySet; + + /** + * Encodes the specified KeySet message. Does not implicitly {@link google.spanner.v1.KeySet.verify|verify} messages. + * @param message KeySet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.IKeySet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified KeySet message, length delimited. Does not implicitly {@link google.spanner.v1.KeySet.verify|verify} messages. + * @param message KeySet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.IKeySet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KeySet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns KeySet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.KeySet; + + /** + * Decodes a KeySet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns KeySet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.KeySet; + + /** + * Verifies a KeySet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a KeySet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns KeySet + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.KeySet; + + /** + * Creates a plain object from a KeySet message. Also converts values to other types if specified. + * @param message KeySet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.KeySet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this KeySet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for KeySet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Range. */ + interface IRange { + + /** Range startKey */ + startKey?: (Uint8Array|Buffer|string|null); + + /** Range limitKey */ + limitKey?: (Uint8Array|Buffer|string|null); + + /** Range groupUid */ + groupUid?: (number|Long|string|null); + + /** Range splitId */ + splitId?: (number|Long|string|null); + + /** Range generation */ + generation?: (Uint8Array|Buffer|string|null); + } + + /** Represents a Range. */ + class Range implements IRange { + + /** + * Constructs a new Range. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.IRange); + + /** Range startKey. */ + public startKey: (Uint8Array|Buffer|string); + + /** Range limitKey. */ + public limitKey: (Uint8Array|Buffer|string); + + /** Range groupUid. */ + public groupUid: (number|Long|string); + + /** Range splitId. */ + public splitId: (number|Long|string); + + /** Range generation. */ + public generation: (Uint8Array|Buffer|string); + + /** + * Creates a new Range instance using the specified properties. + * @param [properties] Properties to set + * @returns Range instance + */ + public static create(properties?: google.spanner.v1.IRange): google.spanner.v1.Range; + + /** + * Encodes the specified Range message. Does not implicitly {@link google.spanner.v1.Range.verify|verify} messages. + * @param message Range message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.IRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Range message, length delimited. Does not implicitly {@link google.spanner.v1.Range.verify|verify} messages. + * @param message Range message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.IRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Range message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Range + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.Range; + + /** + * Decodes a Range message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Range + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.Range; + + /** + * Verifies a Range message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Range message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Range + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.Range; + + /** + * Creates a plain object from a Range message. Also converts values to other types if specified. + * @param message Range + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.Range, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Range to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Range + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Tablet. */ + interface ITablet { + + /** Tablet tabletUid */ + tabletUid?: (number|Long|string|null); + + /** Tablet serverAddress */ + serverAddress?: (string|null); + + /** Tablet location */ + location?: (string|null); + + /** Tablet role */ + role?: (google.spanner.v1.Tablet.Role|keyof typeof google.spanner.v1.Tablet.Role|null); + + /** Tablet incarnation */ + incarnation?: (Uint8Array|Buffer|string|null); + + /** Tablet distance */ + distance?: (number|null); + + /** Tablet skip */ + skip?: (boolean|null); + } + + /** Represents a Tablet. */ + class Tablet implements ITablet { + + /** + * Constructs a new Tablet. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.ITablet); + + /** Tablet tabletUid. */ + public tabletUid: (number|Long|string); + + /** Tablet serverAddress. */ + public serverAddress: string; + + /** Tablet location. */ + public location: string; + + /** Tablet role. */ + public role: (google.spanner.v1.Tablet.Role|keyof typeof google.spanner.v1.Tablet.Role); + + /** Tablet incarnation. */ + public incarnation: (Uint8Array|Buffer|string); + + /** Tablet distance. */ + public distance: number; + + /** Tablet skip. */ + public skip: boolean; + + /** + * Creates a new Tablet instance using the specified properties. + * @param [properties] Properties to set + * @returns Tablet instance + */ + public static create(properties?: google.spanner.v1.ITablet): google.spanner.v1.Tablet; + + /** + * Encodes the specified Tablet message. Does not implicitly {@link google.spanner.v1.Tablet.verify|verify} messages. + * @param message Tablet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.ITablet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Tablet message, length delimited. Does not implicitly {@link google.spanner.v1.Tablet.verify|verify} messages. + * @param message Tablet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.ITablet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Tablet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Tablet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.Tablet; + + /** + * Decodes a Tablet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Tablet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.Tablet; + + /** + * Verifies a Tablet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Tablet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Tablet + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.Tablet; + + /** + * Creates a plain object from a Tablet message. Also converts values to other types if specified. + * @param message Tablet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.Tablet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Tablet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Tablet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Tablet { + + /** Role enum. */ + enum Role { + ROLE_UNSPECIFIED = 0, + READ_WRITE = 1, + READ_ONLY = 2 + } + } + + /** Properties of a Group. */ + interface IGroup { + + /** Group groupUid */ + groupUid?: (number|Long|string|null); + + /** Group tablets */ + tablets?: (google.spanner.v1.ITablet[]|null); + + /** Group leaderIndex */ + leaderIndex?: (number|null); + + /** Group generation */ + generation?: (Uint8Array|Buffer|string|null); + } + + /** Represents a Group. */ + class Group implements IGroup { + + /** + * Constructs a new Group. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.IGroup); + + /** Group groupUid. */ + public groupUid: (number|Long|string); + + /** Group tablets. */ + public tablets: google.spanner.v1.ITablet[]; + + /** Group leaderIndex. */ + public leaderIndex: number; + + /** Group generation. */ + public generation: (Uint8Array|Buffer|string); + + /** + * Creates a new Group instance using the specified properties. + * @param [properties] Properties to set + * @returns Group instance + */ + public static create(properties?: google.spanner.v1.IGroup): google.spanner.v1.Group; + + /** + * Encodes the specified Group message. Does not implicitly {@link google.spanner.v1.Group.verify|verify} messages. + * @param message Group message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.IGroup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Group message, length delimited. Does not implicitly {@link google.spanner.v1.Group.verify|verify} messages. + * @param message Group message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.IGroup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Group message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Group + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.Group; + + /** + * Decodes a Group message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Group + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.Group; + + /** + * Verifies a Group message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Group message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Group + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.Group; + + /** + * Creates a plain object from a Group message. Also converts values to other types if specified. + * @param message Group + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.Group, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Group to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Group + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a KeyRecipe. */ + interface IKeyRecipe { + + /** KeyRecipe tableName */ + tableName?: (string|null); + + /** KeyRecipe indexName */ + indexName?: (string|null); + + /** KeyRecipe operationUid */ + operationUid?: (number|Long|string|null); + + /** KeyRecipe part */ + part?: (google.spanner.v1.KeyRecipe.IPart[]|null); + } + + /** Represents a KeyRecipe. */ + class KeyRecipe implements IKeyRecipe { + + /** + * Constructs a new KeyRecipe. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.IKeyRecipe); + + /** KeyRecipe tableName. */ + public tableName?: (string|null); + + /** KeyRecipe indexName. */ + public indexName?: (string|null); + + /** KeyRecipe operationUid. */ + public operationUid?: (number|Long|string|null); + + /** KeyRecipe part. */ + public part: google.spanner.v1.KeyRecipe.IPart[]; + + /** KeyRecipe target. */ + public target?: ("tableName"|"indexName"|"operationUid"); + + /** + * Creates a new KeyRecipe instance using the specified properties. + * @param [properties] Properties to set + * @returns KeyRecipe instance + */ + public static create(properties?: google.spanner.v1.IKeyRecipe): google.spanner.v1.KeyRecipe; + + /** + * Encodes the specified KeyRecipe message. Does not implicitly {@link google.spanner.v1.KeyRecipe.verify|verify} messages. + * @param message KeyRecipe message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.IKeyRecipe, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified KeyRecipe message, length delimited. Does not implicitly {@link google.spanner.v1.KeyRecipe.verify|verify} messages. + * @param message KeyRecipe message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.IKeyRecipe, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KeyRecipe message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns KeyRecipe + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.KeyRecipe; + + /** + * Decodes a KeyRecipe message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns KeyRecipe + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.KeyRecipe; + + /** + * Verifies a KeyRecipe message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a KeyRecipe message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns KeyRecipe + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.KeyRecipe; + + /** + * Creates a plain object from a KeyRecipe message. Also converts values to other types if specified. + * @param message KeyRecipe + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.KeyRecipe, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this KeyRecipe to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for KeyRecipe + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace KeyRecipe { + + /** Properties of a Part. */ + interface IPart { + + /** Part tag */ + tag?: (number|null); + + /** Part order */ + order?: (google.spanner.v1.KeyRecipe.Part.Order|keyof typeof google.spanner.v1.KeyRecipe.Part.Order|null); + + /** Part nullOrder */ + nullOrder?: (google.spanner.v1.KeyRecipe.Part.NullOrder|keyof typeof google.spanner.v1.KeyRecipe.Part.NullOrder|null); + + /** Part type */ + type?: (google.spanner.v1.IType|null); + + /** Part identifier */ + identifier?: (string|null); + + /** Part value */ + value?: (google.protobuf.IValue|null); + + /** Part random */ + random?: (boolean|null); + + /** Part structIdentifiers */ + structIdentifiers?: (number[]|null); + } + + /** Represents a Part. */ + class Part implements IPart { + + /** + * Constructs a new Part. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.KeyRecipe.IPart); + + /** Part tag. */ + public tag: number; + + /** Part order. */ + public order: (google.spanner.v1.KeyRecipe.Part.Order|keyof typeof google.spanner.v1.KeyRecipe.Part.Order); + + /** Part nullOrder. */ + public nullOrder: (google.spanner.v1.KeyRecipe.Part.NullOrder|keyof typeof google.spanner.v1.KeyRecipe.Part.NullOrder); + + /** Part type. */ + public type?: (google.spanner.v1.IType|null); + + /** Part identifier. */ + public identifier?: (string|null); + + /** Part value. */ + public value?: (google.protobuf.IValue|null); + + /** Part random. */ + public random?: (boolean|null); + + /** Part structIdentifiers. */ + public structIdentifiers: number[]; + + /** Part valueType. */ + public valueType?: ("identifier"|"value"|"random"); + + /** + * Creates a new Part instance using the specified properties. + * @param [properties] Properties to set + * @returns Part instance + */ + public static create(properties?: google.spanner.v1.KeyRecipe.IPart): google.spanner.v1.KeyRecipe.Part; + + /** + * Encodes the specified Part message. Does not implicitly {@link google.spanner.v1.KeyRecipe.Part.verify|verify} messages. + * @param message Part message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.KeyRecipe.IPart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Part message, length delimited. Does not implicitly {@link google.spanner.v1.KeyRecipe.Part.verify|verify} messages. + * @param message Part message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.KeyRecipe.IPart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Part message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Part + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.KeyRecipe.Part; + + /** + * Decodes a Part message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Part + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.KeyRecipe.Part; + + /** + * Verifies a Part message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Part message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Part + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.KeyRecipe.Part; + + /** + * Creates a plain object from a Part message. Also converts values to other types if specified. + * @param message Part + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.KeyRecipe.Part, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Part to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Part + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Part { + + /** Order enum. */ + enum Order { + ORDER_UNSPECIFIED = 0, + ASCENDING = 1, + DESCENDING = 2 + } + + /** NullOrder enum. */ + enum NullOrder { + NULL_ORDER_UNSPECIFIED = 0, + NULLS_FIRST = 1, + NULLS_LAST = 2, + NOT_NULL = 3 + } + } + } + + /** Properties of a RecipeList. */ + interface IRecipeList { + + /** RecipeList schemaGeneration */ + schemaGeneration?: (Uint8Array|Buffer|string|null); + + /** RecipeList recipe */ + recipe?: (google.spanner.v1.IKeyRecipe[]|null); + } + + /** Represents a RecipeList. */ + class RecipeList implements IRecipeList { + + /** + * Constructs a new RecipeList. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.IRecipeList); + + /** RecipeList schemaGeneration. */ + public schemaGeneration: (Uint8Array|Buffer|string); + + /** RecipeList recipe. */ + public recipe: google.spanner.v1.IKeyRecipe[]; + + /** + * Creates a new RecipeList instance using the specified properties. + * @param [properties] Properties to set + * @returns RecipeList instance + */ + public static create(properties?: google.spanner.v1.IRecipeList): google.spanner.v1.RecipeList; + + /** + * Encodes the specified RecipeList message. Does not implicitly {@link google.spanner.v1.RecipeList.verify|verify} messages. + * @param message RecipeList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.IRecipeList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RecipeList message, length delimited. Does not implicitly {@link google.spanner.v1.RecipeList.verify|verify} messages. + * @param message RecipeList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.IRecipeList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RecipeList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RecipeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.RecipeList; + + /** + * Decodes a RecipeList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RecipeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.RecipeList; + + /** + * Verifies a RecipeList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RecipeList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RecipeList + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.RecipeList; + + /** + * Creates a plain object from a RecipeList message. Also converts values to other types if specified. + * @param message RecipeList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.RecipeList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RecipeList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RecipeList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CacheUpdate. */ + interface ICacheUpdate { + + /** CacheUpdate databaseId */ + databaseId?: (number|Long|string|null); + + /** CacheUpdate range */ + range?: (google.spanner.v1.IRange[]|null); + + /** CacheUpdate group */ + group?: (google.spanner.v1.IGroup[]|null); + + /** CacheUpdate keyRecipes */ + keyRecipes?: (google.spanner.v1.IRecipeList|null); + } + + /** Represents a CacheUpdate. */ + class CacheUpdate implements ICacheUpdate { + + /** + * Constructs a new CacheUpdate. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.ICacheUpdate); + + /** CacheUpdate databaseId. */ + public databaseId: (number|Long|string); + + /** CacheUpdate range. */ + public range: google.spanner.v1.IRange[]; + + /** CacheUpdate group. */ + public group: google.spanner.v1.IGroup[]; + + /** CacheUpdate keyRecipes. */ + public keyRecipes?: (google.spanner.v1.IRecipeList|null); + + /** + * Creates a new CacheUpdate instance using the specified properties. + * @param [properties] Properties to set + * @returns CacheUpdate instance + */ + public static create(properties?: google.spanner.v1.ICacheUpdate): google.spanner.v1.CacheUpdate; + + /** + * Encodes the specified CacheUpdate message. Does not implicitly {@link google.spanner.v1.CacheUpdate.verify|verify} messages. + * @param message CacheUpdate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.ICacheUpdate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CacheUpdate message, length delimited. Does not implicitly {@link google.spanner.v1.CacheUpdate.verify|verify} messages. + * @param message CacheUpdate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.ICacheUpdate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CacheUpdate message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CacheUpdate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.CacheUpdate; + + /** + * Decodes a CacheUpdate message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CacheUpdate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.CacheUpdate; + + /** + * Verifies a CacheUpdate message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CacheUpdate message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CacheUpdate + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.CacheUpdate; + + /** + * Creates a plain object from a CacheUpdate message. Also converts values to other types if specified. + * @param message CacheUpdate + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.CacheUpdate, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CacheUpdate to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CacheUpdate + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RoutingHint. */ + interface IRoutingHint { + + /** RoutingHint operationUid */ + operationUid?: (number|Long|string|null); + + /** RoutingHint databaseId */ + databaseId?: (number|Long|string|null); + + /** RoutingHint schemaGeneration */ + schemaGeneration?: (Uint8Array|Buffer|string|null); + + /** RoutingHint key */ + key?: (Uint8Array|Buffer|string|null); + + /** RoutingHint limitKey */ + limitKey?: (Uint8Array|Buffer|string|null); + + /** RoutingHint groupUid */ + groupUid?: (number|Long|string|null); + + /** RoutingHint splitId */ + splitId?: (number|Long|string|null); + + /** RoutingHint tabletUid */ + tabletUid?: (number|Long|string|null); + + /** RoutingHint skippedTabletUid */ + skippedTabletUid?: (google.spanner.v1.RoutingHint.ISkippedTablet[]|null); + + /** RoutingHint clientLocation */ + clientLocation?: (string|null); + } + + /** Represents a RoutingHint. */ + class RoutingHint implements IRoutingHint { + + /** + * Constructs a new RoutingHint. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.IRoutingHint); + + /** RoutingHint operationUid. */ + public operationUid: (number|Long|string); + + /** RoutingHint databaseId. */ + public databaseId: (number|Long|string); + + /** RoutingHint schemaGeneration. */ + public schemaGeneration: (Uint8Array|Buffer|string); + + /** RoutingHint key. */ + public key: (Uint8Array|Buffer|string); + + /** RoutingHint limitKey. */ + public limitKey: (Uint8Array|Buffer|string); + + /** RoutingHint groupUid. */ + public groupUid: (number|Long|string); + + /** RoutingHint splitId. */ + public splitId: (number|Long|string); + + /** RoutingHint tabletUid. */ + public tabletUid: (number|Long|string); + + /** RoutingHint skippedTabletUid. */ + public skippedTabletUid: google.spanner.v1.RoutingHint.ISkippedTablet[]; + + /** RoutingHint clientLocation. */ + public clientLocation: string; + + /** + * Creates a new RoutingHint instance using the specified properties. + * @param [properties] Properties to set + * @returns RoutingHint instance + */ + public static create(properties?: google.spanner.v1.IRoutingHint): google.spanner.v1.RoutingHint; + + /** + * Encodes the specified RoutingHint message. Does not implicitly {@link google.spanner.v1.RoutingHint.verify|verify} messages. + * @param message RoutingHint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.IRoutingHint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RoutingHint message, length delimited. Does not implicitly {@link google.spanner.v1.RoutingHint.verify|verify} messages. + * @param message RoutingHint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.IRoutingHint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RoutingHint message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RoutingHint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.RoutingHint; + + /** + * Decodes a RoutingHint message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RoutingHint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.RoutingHint; + + /** + * Verifies a RoutingHint message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RoutingHint message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RoutingHint + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.RoutingHint; + + /** + * Creates a plain object from a RoutingHint message. Also converts values to other types if specified. + * @param message RoutingHint + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.RoutingHint, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RoutingHint to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RoutingHint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace RoutingHint { + + /** Properties of a SkippedTablet. */ + interface ISkippedTablet { + + /** SkippedTablet tabletUid */ + tabletUid?: (number|Long|string|null); + + /** SkippedTablet incarnation */ + incarnation?: (Uint8Array|Buffer|string|null); + } + + /** Represents a SkippedTablet. */ + class SkippedTablet implements ISkippedTablet { + + /** + * Constructs a new SkippedTablet. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.RoutingHint.ISkippedTablet); + + /** SkippedTablet tabletUid. */ + public tabletUid: (number|Long|string); + + /** SkippedTablet incarnation. */ + public incarnation: (Uint8Array|Buffer|string); + + /** + * Creates a new SkippedTablet instance using the specified properties. + * @param [properties] Properties to set + * @returns SkippedTablet instance + */ + public static create(properties?: google.spanner.v1.RoutingHint.ISkippedTablet): google.spanner.v1.RoutingHint.SkippedTablet; + + /** + * Encodes the specified SkippedTablet message. Does not implicitly {@link google.spanner.v1.RoutingHint.SkippedTablet.verify|verify} messages. + * @param message SkippedTablet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.RoutingHint.ISkippedTablet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SkippedTablet message, length delimited. Does not implicitly {@link google.spanner.v1.RoutingHint.SkippedTablet.verify|verify} messages. + * @param message SkippedTablet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.RoutingHint.ISkippedTablet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SkippedTablet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SkippedTablet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.RoutingHint.SkippedTablet; + + /** + * Decodes a SkippedTablet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SkippedTablet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.RoutingHint.SkippedTablet; + + /** + * Verifies a SkippedTablet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SkippedTablet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SkippedTablet + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.RoutingHint.SkippedTablet; + + /** + * Creates a plain object from a SkippedTablet message. Also converts values to other types if specified. + * @param message SkippedTablet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.RoutingHint.SkippedTablet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SkippedTablet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SkippedTablet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a Type. */ + interface IType { + + /** Type code */ + code?: (google.spanner.v1.TypeCode|keyof typeof google.spanner.v1.TypeCode|null); + + /** Type arrayElementType */ + arrayElementType?: (google.spanner.v1.IType|null); + + /** Type structType */ + structType?: (google.spanner.v1.IStructType|null); + + /** Type typeAnnotation */ + typeAnnotation?: (google.spanner.v1.TypeAnnotationCode|keyof typeof google.spanner.v1.TypeAnnotationCode|null); + + /** Type protoTypeFqn */ + protoTypeFqn?: (string|null); + } + + /** Represents a Type. */ + class Type implements IType { + + /** + * Constructs a new Type. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.IType); + + /** Type code. */ + public code: (google.spanner.v1.TypeCode|keyof typeof google.spanner.v1.TypeCode); + + /** Type arrayElementType. */ + public arrayElementType?: (google.spanner.v1.IType|null); + + /** Type structType. */ + public structType?: (google.spanner.v1.IStructType|null); + + /** Type typeAnnotation. */ + public typeAnnotation: (google.spanner.v1.TypeAnnotationCode|keyof typeof google.spanner.v1.TypeAnnotationCode); + + /** Type protoTypeFqn. */ + public protoTypeFqn: string; + + /** + * Creates a new Type instance using the specified properties. + * @param [properties] Properties to set + * @returns Type instance + */ + public static create(properties?: google.spanner.v1.IType): google.spanner.v1.Type; + + /** + * Encodes the specified Type message. Does not implicitly {@link google.spanner.v1.Type.verify|verify} messages. + * @param message Type message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.IType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Type message, length delimited. Does not implicitly {@link google.spanner.v1.Type.verify|verify} messages. + * @param message Type message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.IType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Type message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Type + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.Type; + + /** + * Decodes a Type message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Type + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.Type; + + /** + * Verifies a Type message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Type message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Type + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.Type; + + /** + * Creates a plain object from a Type message. Also converts values to other types if specified. + * @param message Type + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.Type, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Type to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Type + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StructType. */ + interface IStructType { + + /** StructType fields */ + fields?: (google.spanner.v1.StructType.IField[]|null); + } + + /** Represents a StructType. */ + class StructType implements IStructType { + + /** + * Constructs a new StructType. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.IStructType); + + /** StructType fields. */ + public fields: google.spanner.v1.StructType.IField[]; + + /** + * Creates a new StructType instance using the specified properties. + * @param [properties] Properties to set + * @returns StructType instance + */ + public static create(properties?: google.spanner.v1.IStructType): google.spanner.v1.StructType; + + /** + * Encodes the specified StructType message. Does not implicitly {@link google.spanner.v1.StructType.verify|verify} messages. + * @param message StructType message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.IStructType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StructType message, length delimited. Does not implicitly {@link google.spanner.v1.StructType.verify|verify} messages. + * @param message StructType message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.IStructType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StructType message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StructType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.StructType; + + /** + * Decodes a StructType message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StructType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.StructType; + + /** + * Verifies a StructType message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StructType message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StructType + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.StructType; + + /** + * Creates a plain object from a StructType message. Also converts values to other types if specified. + * @param message StructType + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.StructType, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StructType to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StructType + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace StructType { + + /** Properties of a Field. */ + interface IField { + + /** Field name */ + name?: (string|null); + + /** Field type */ + type?: (google.spanner.v1.IType|null); + } + + /** Represents a Field. */ + class Field implements IField { + + /** + * Constructs a new Field. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.StructType.IField); + + /** Field name. */ + public name: string; + + /** Field type. */ + public type?: (google.spanner.v1.IType|null); + + /** + * Creates a new Field instance using the specified properties. + * @param [properties] Properties to set + * @returns Field instance + */ + public static create(properties?: google.spanner.v1.StructType.IField): google.spanner.v1.StructType.Field; + + /** + * Encodes the specified Field message. Does not implicitly {@link google.spanner.v1.StructType.Field.verify|verify} messages. + * @param message Field message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.StructType.IField, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Field message, length delimited. Does not implicitly {@link google.spanner.v1.StructType.Field.verify|verify} messages. + * @param message Field message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.StructType.IField, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Field message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Field + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.StructType.Field; + + /** + * Decodes a Field message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Field + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.StructType.Field; + + /** + * Verifies a Field message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Field message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Field + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.StructType.Field; + + /** + * Creates a plain object from a Field message. Also converts values to other types if specified. + * @param message Field + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.StructType.Field, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Field to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Field + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** TypeCode enum. */ + enum TypeCode { + TYPE_CODE_UNSPECIFIED = 0, + BOOL = 1, + INT64 = 2, + FLOAT64 = 3, + FLOAT32 = 15, + TIMESTAMP = 4, + DATE = 5, + STRING = 6, + BYTES = 7, + ARRAY = 8, + STRUCT = 9, + NUMERIC = 10, + JSON = 11, + PROTO = 13, + ENUM = 14, + INTERVAL = 16, + UUID = 17 + } + + /** TypeAnnotationCode enum. */ + enum TypeAnnotationCode { + TYPE_ANNOTATION_CODE_UNSPECIFIED = 0, + PG_NUMERIC = 2, + PG_JSONB = 3, + PG_OID = 4 + } + + /** Properties of a Mutation. */ + interface IMutation { + + /** Mutation insert */ + insert?: (google.spanner.v1.Mutation.IWrite|null); + + /** Mutation update */ + update?: (google.spanner.v1.Mutation.IWrite|null); + + /** Mutation insertOrUpdate */ + insertOrUpdate?: (google.spanner.v1.Mutation.IWrite|null); + + /** Mutation replace */ + replace?: (google.spanner.v1.Mutation.IWrite|null); + + /** Mutation delete */ + "delete"?: (google.spanner.v1.Mutation.IDelete|null); + + /** Mutation send */ + send?: (google.spanner.v1.Mutation.ISend|null); + + /** Mutation ack */ + ack?: (google.spanner.v1.Mutation.IAck|null); + } + + /** Represents a Mutation. */ + class Mutation implements IMutation { + + /** + * Constructs a new Mutation. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.IMutation); + + /** Mutation insert. */ + public insert?: (google.spanner.v1.Mutation.IWrite|null); + + /** Mutation update. */ + public update?: (google.spanner.v1.Mutation.IWrite|null); + + /** Mutation insertOrUpdate. */ + public insertOrUpdate?: (google.spanner.v1.Mutation.IWrite|null); + + /** Mutation replace. */ + public replace?: (google.spanner.v1.Mutation.IWrite|null); + + /** Mutation delete. */ + public delete?: (google.spanner.v1.Mutation.IDelete|null); + + /** Mutation send. */ + public send?: (google.spanner.v1.Mutation.ISend|null); + + /** Mutation ack. */ + public ack?: (google.spanner.v1.Mutation.IAck|null); + + /** Mutation operation. */ + public operation?: ("insert"|"update"|"insertOrUpdate"|"replace"|"delete"|"send"|"ack"); + + /** + * Creates a new Mutation instance using the specified properties. + * @param [properties] Properties to set + * @returns Mutation instance + */ + public static create(properties?: google.spanner.v1.IMutation): google.spanner.v1.Mutation; + + /** + * Encodes the specified Mutation message. Does not implicitly {@link google.spanner.v1.Mutation.verify|verify} messages. + * @param message Mutation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.IMutation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Mutation message, length delimited. Does not implicitly {@link google.spanner.v1.Mutation.verify|verify} messages. + * @param message Mutation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.IMutation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Mutation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Mutation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.Mutation; + + /** + * Decodes a Mutation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Mutation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.Mutation; + + /** + * Verifies a Mutation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Mutation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Mutation + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.Mutation; + + /** + * Creates a plain object from a Mutation message. Also converts values to other types if specified. + * @param message Mutation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.Mutation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Mutation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Mutation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Mutation { + + /** Properties of a Write. */ + interface IWrite { + + /** Write table */ + table?: (string|null); + + /** Write columns */ + columns?: (string[]|null); + + /** Write values */ + values?: (google.protobuf.IListValue[]|null); + } + + /** Represents a Write. */ + class Write implements IWrite { + + /** + * Constructs a new Write. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.Mutation.IWrite); + + /** Write table. */ + public table: string; + + /** Write columns. */ + public columns: string[]; + + /** Write values. */ + public values: google.protobuf.IListValue[]; + + /** + * Creates a new Write instance using the specified properties. + * @param [properties] Properties to set + * @returns Write instance + */ + public static create(properties?: google.spanner.v1.Mutation.IWrite): google.spanner.v1.Mutation.Write; + + /** + * Encodes the specified Write message. Does not implicitly {@link google.spanner.v1.Mutation.Write.verify|verify} messages. + * @param message Write message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.Mutation.IWrite, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Write message, length delimited. Does not implicitly {@link google.spanner.v1.Mutation.Write.verify|verify} messages. + * @param message Write message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.Mutation.IWrite, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Write message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Write + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.Mutation.Write; + + /** + * Decodes a Write message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Write + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.Mutation.Write; + + /** + * Verifies a Write message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Write message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Write + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.Mutation.Write; + + /** + * Creates a plain object from a Write message. Also converts values to other types if specified. + * @param message Write + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.Mutation.Write, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Write to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Write + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Delete. */ + interface IDelete { + + /** Delete table */ + table?: (string|null); + + /** Delete keySet */ + keySet?: (google.spanner.v1.IKeySet|null); + } + + /** Represents a Delete. */ + class Delete implements IDelete { + + /** + * Constructs a new Delete. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.Mutation.IDelete); + + /** Delete table. */ + public table: string; + + /** Delete keySet. */ + public keySet?: (google.spanner.v1.IKeySet|null); + + /** + * Creates a new Delete instance using the specified properties. + * @param [properties] Properties to set + * @returns Delete instance + */ + public static create(properties?: google.spanner.v1.Mutation.IDelete): google.spanner.v1.Mutation.Delete; + + /** + * Encodes the specified Delete message. Does not implicitly {@link google.spanner.v1.Mutation.Delete.verify|verify} messages. + * @param message Delete message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.Mutation.IDelete, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Delete message, length delimited. Does not implicitly {@link google.spanner.v1.Mutation.Delete.verify|verify} messages. + * @param message Delete message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.Mutation.IDelete, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Delete message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Delete + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.Mutation.Delete; + + /** + * Decodes a Delete message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Delete + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.Mutation.Delete; + + /** + * Verifies a Delete message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Delete message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Delete + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.Mutation.Delete; + + /** + * Creates a plain object from a Delete message. Also converts values to other types if specified. + * @param message Delete + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.Mutation.Delete, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Delete to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Delete + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Send. */ + interface ISend { + + /** Send queue */ + queue?: (string|null); + + /** Send key */ + key?: (google.protobuf.IListValue|null); + + /** Send deliverTime */ + deliverTime?: (google.protobuf.ITimestamp|null); + + /** Send payload */ + payload?: (google.protobuf.IValue|null); + } + + /** Represents a Send. */ + class Send implements ISend { + + /** + * Constructs a new Send. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.Mutation.ISend); + + /** Send queue. */ + public queue: string; + + /** Send key. */ + public key?: (google.protobuf.IListValue|null); + + /** Send deliverTime. */ + public deliverTime?: (google.protobuf.ITimestamp|null); + + /** Send payload. */ + public payload?: (google.protobuf.IValue|null); + + /** + * Creates a new Send instance using the specified properties. + * @param [properties] Properties to set + * @returns Send instance + */ + public static create(properties?: google.spanner.v1.Mutation.ISend): google.spanner.v1.Mutation.Send; + + /** + * Encodes the specified Send message. Does not implicitly {@link google.spanner.v1.Mutation.Send.verify|verify} messages. + * @param message Send message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.Mutation.ISend, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Send message, length delimited. Does not implicitly {@link google.spanner.v1.Mutation.Send.verify|verify} messages. + * @param message Send message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.Mutation.ISend, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Send message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Send + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.Mutation.Send; + + /** + * Decodes a Send message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Send + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.Mutation.Send; + + /** + * Verifies a Send message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Send message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Send + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.Mutation.Send; + + /** + * Creates a plain object from a Send message. Also converts values to other types if specified. + * @param message Send + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.Mutation.Send, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Send to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Send + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Ack. */ + interface IAck { + + /** Ack queue */ + queue?: (string|null); + + /** Ack key */ + key?: (google.protobuf.IListValue|null); + + /** Ack ignoreNotFound */ + ignoreNotFound?: (boolean|null); + } + + /** Represents an Ack. */ + class Ack implements IAck { + + /** + * Constructs a new Ack. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.Mutation.IAck); + + /** Ack queue. */ + public queue: string; + + /** Ack key. */ + public key?: (google.protobuf.IListValue|null); + + /** Ack ignoreNotFound. */ + public ignoreNotFound: boolean; + + /** + * Creates a new Ack instance using the specified properties. + * @param [properties] Properties to set + * @returns Ack instance + */ + public static create(properties?: google.spanner.v1.Mutation.IAck): google.spanner.v1.Mutation.Ack; + + /** + * Encodes the specified Ack message. Does not implicitly {@link google.spanner.v1.Mutation.Ack.verify|verify} messages. + * @param message Ack message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.Mutation.IAck, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Ack message, length delimited. Does not implicitly {@link google.spanner.v1.Mutation.Ack.verify|verify} messages. + * @param message Ack message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.Mutation.IAck, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Ack message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Ack + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.Mutation.Ack; + + /** + * Decodes an Ack message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Ack + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.Mutation.Ack; + + /** + * Verifies an Ack message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Ack message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Ack + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.Mutation.Ack; + + /** + * Creates a plain object from an Ack message. Also converts values to other types if specified. + * @param message Ack + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.Mutation.Ack, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Ack to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Ack + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a ResultSet. */ + interface IResultSet { + + /** ResultSet metadata */ + metadata?: (google.spanner.v1.IResultSetMetadata|null); + + /** ResultSet rows */ + rows?: (google.protobuf.IListValue[]|null); + + /** ResultSet stats */ + stats?: (google.spanner.v1.IResultSetStats|null); + + /** ResultSet precommitToken */ + precommitToken?: (google.spanner.v1.IMultiplexedSessionPrecommitToken|null); + + /** ResultSet cacheUpdate */ + cacheUpdate?: (google.spanner.v1.ICacheUpdate|null); + } + + /** Represents a ResultSet. */ + class ResultSet implements IResultSet { + + /** + * Constructs a new ResultSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.IResultSet); + + /** ResultSet metadata. */ + public metadata?: (google.spanner.v1.IResultSetMetadata|null); + + /** ResultSet rows. */ + public rows: google.protobuf.IListValue[]; + + /** ResultSet stats. */ + public stats?: (google.spanner.v1.IResultSetStats|null); + + /** ResultSet precommitToken. */ + public precommitToken?: (google.spanner.v1.IMultiplexedSessionPrecommitToken|null); + + /** ResultSet cacheUpdate. */ + public cacheUpdate?: (google.spanner.v1.ICacheUpdate|null); + + /** + * Creates a new ResultSet instance using the specified properties. + * @param [properties] Properties to set + * @returns ResultSet instance + */ + public static create(properties?: google.spanner.v1.IResultSet): google.spanner.v1.ResultSet; + + /** + * Encodes the specified ResultSet message. Does not implicitly {@link google.spanner.v1.ResultSet.verify|verify} messages. + * @param message ResultSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.IResultSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResultSet message, length delimited. Does not implicitly {@link google.spanner.v1.ResultSet.verify|verify} messages. + * @param message ResultSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.IResultSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResultSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResultSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.ResultSet; + + /** + * Decodes a ResultSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResultSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.ResultSet; + + /** + * Verifies a ResultSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResultSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResultSet + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.ResultSet; + + /** + * Creates a plain object from a ResultSet message. Also converts values to other types if specified. + * @param message ResultSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.ResultSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResultSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResultSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PartialResultSet. */ + interface IPartialResultSet { + + /** PartialResultSet metadata */ + metadata?: (google.spanner.v1.IResultSetMetadata|null); + + /** PartialResultSet values */ + values?: (google.protobuf.IValue[]|null); + + /** PartialResultSet chunkedValue */ + chunkedValue?: (boolean|null); + + /** PartialResultSet resumeToken */ + resumeToken?: (Uint8Array|Buffer|string|null); + + /** PartialResultSet stats */ + stats?: (google.spanner.v1.IResultSetStats|null); + + /** PartialResultSet precommitToken */ + precommitToken?: (google.spanner.v1.IMultiplexedSessionPrecommitToken|null); + + /** PartialResultSet last */ + last?: (boolean|null); + + /** PartialResultSet cacheUpdate */ + cacheUpdate?: (google.spanner.v1.ICacheUpdate|null); + } + + /** Represents a PartialResultSet. */ + class PartialResultSet implements IPartialResultSet { + + /** + * Constructs a new PartialResultSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.IPartialResultSet); + + /** PartialResultSet metadata. */ + public metadata?: (google.spanner.v1.IResultSetMetadata|null); + + /** PartialResultSet values. */ + public values: google.protobuf.IValue[]; + + /** PartialResultSet chunkedValue. */ + public chunkedValue: boolean; + + /** PartialResultSet resumeToken. */ + public resumeToken: (Uint8Array|Buffer|string); + + /** PartialResultSet stats. */ + public stats?: (google.spanner.v1.IResultSetStats|null); + + /** PartialResultSet precommitToken. */ + public precommitToken?: (google.spanner.v1.IMultiplexedSessionPrecommitToken|null); + + /** PartialResultSet last. */ + public last: boolean; + + /** PartialResultSet cacheUpdate. */ + public cacheUpdate?: (google.spanner.v1.ICacheUpdate|null); + + /** + * Creates a new PartialResultSet instance using the specified properties. + * @param [properties] Properties to set + * @returns PartialResultSet instance + */ + public static create(properties?: google.spanner.v1.IPartialResultSet): google.spanner.v1.PartialResultSet; + + /** + * Encodes the specified PartialResultSet message. Does not implicitly {@link google.spanner.v1.PartialResultSet.verify|verify} messages. + * @param message PartialResultSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.IPartialResultSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PartialResultSet message, length delimited. Does not implicitly {@link google.spanner.v1.PartialResultSet.verify|verify} messages. + * @param message PartialResultSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.IPartialResultSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PartialResultSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PartialResultSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.PartialResultSet; + + /** + * Decodes a PartialResultSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PartialResultSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.PartialResultSet; + + /** + * Verifies a PartialResultSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PartialResultSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PartialResultSet + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.PartialResultSet; + + /** + * Creates a plain object from a PartialResultSet message. Also converts values to other types if specified. + * @param message PartialResultSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.PartialResultSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PartialResultSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PartialResultSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ResultSetMetadata. */ + interface IResultSetMetadata { + + /** ResultSetMetadata rowType */ + rowType?: (google.spanner.v1.IStructType|null); + + /** ResultSetMetadata transaction */ + transaction?: (google.spanner.v1.ITransaction|null); + + /** ResultSetMetadata undeclaredParameters */ + undeclaredParameters?: (google.spanner.v1.IStructType|null); + } + + /** Represents a ResultSetMetadata. */ + class ResultSetMetadata implements IResultSetMetadata { + + /** + * Constructs a new ResultSetMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.IResultSetMetadata); + + /** ResultSetMetadata rowType. */ + public rowType?: (google.spanner.v1.IStructType|null); + + /** ResultSetMetadata transaction. */ + public transaction?: (google.spanner.v1.ITransaction|null); + + /** ResultSetMetadata undeclaredParameters. */ + public undeclaredParameters?: (google.spanner.v1.IStructType|null); + + /** + * Creates a new ResultSetMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ResultSetMetadata instance + */ + public static create(properties?: google.spanner.v1.IResultSetMetadata): google.spanner.v1.ResultSetMetadata; + + /** + * Encodes the specified ResultSetMetadata message. Does not implicitly {@link google.spanner.v1.ResultSetMetadata.verify|verify} messages. + * @param message ResultSetMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.IResultSetMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResultSetMetadata message, length delimited. Does not implicitly {@link google.spanner.v1.ResultSetMetadata.verify|verify} messages. + * @param message ResultSetMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.IResultSetMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResultSetMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResultSetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.ResultSetMetadata; + + /** + * Decodes a ResultSetMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResultSetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.ResultSetMetadata; + + /** + * Verifies a ResultSetMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResultSetMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResultSetMetadata + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.ResultSetMetadata; + + /** + * Creates a plain object from a ResultSetMetadata message. Also converts values to other types if specified. + * @param message ResultSetMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.ResultSetMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResultSetMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResultSetMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ResultSetStats. */ + interface IResultSetStats { + + /** ResultSetStats queryPlan */ + queryPlan?: (google.spanner.v1.IQueryPlan|null); + + /** ResultSetStats queryStats */ + queryStats?: (google.protobuf.IStruct|null); + + /** ResultSetStats rowCountExact */ + rowCountExact?: (number|Long|string|null); + + /** ResultSetStats rowCountLowerBound */ + rowCountLowerBound?: (number|Long|string|null); + } + + /** Represents a ResultSetStats. */ + class ResultSetStats implements IResultSetStats { + + /** + * Constructs a new ResultSetStats. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.IResultSetStats); + + /** ResultSetStats queryPlan. */ + public queryPlan?: (google.spanner.v1.IQueryPlan|null); + + /** ResultSetStats queryStats. */ + public queryStats?: (google.protobuf.IStruct|null); + + /** ResultSetStats rowCountExact. */ + public rowCountExact?: (number|Long|string|null); + + /** ResultSetStats rowCountLowerBound. */ + public rowCountLowerBound?: (number|Long|string|null); + + /** ResultSetStats rowCount. */ + public rowCount?: ("rowCountExact"|"rowCountLowerBound"); + + /** + * Creates a new ResultSetStats instance using the specified properties. + * @param [properties] Properties to set + * @returns ResultSetStats instance + */ + public static create(properties?: google.spanner.v1.IResultSetStats): google.spanner.v1.ResultSetStats; + + /** + * Encodes the specified ResultSetStats message. Does not implicitly {@link google.spanner.v1.ResultSetStats.verify|verify} messages. + * @param message ResultSetStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.IResultSetStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResultSetStats message, length delimited. Does not implicitly {@link google.spanner.v1.ResultSetStats.verify|verify} messages. + * @param message ResultSetStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.IResultSetStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResultSetStats message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResultSetStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.ResultSetStats; + + /** + * Decodes a ResultSetStats message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResultSetStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.ResultSetStats; + + /** + * Verifies a ResultSetStats message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResultSetStats message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResultSetStats + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.ResultSetStats; + + /** + * Creates a plain object from a ResultSetStats message. Also converts values to other types if specified. + * @param message ResultSetStats + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.ResultSetStats, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResultSetStats to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResultSetStats + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PlanNode. */ + interface IPlanNode { + + /** PlanNode index */ + index?: (number|null); + + /** PlanNode kind */ + kind?: (google.spanner.v1.PlanNode.Kind|keyof typeof google.spanner.v1.PlanNode.Kind|null); + + /** PlanNode displayName */ + displayName?: (string|null); + + /** PlanNode childLinks */ + childLinks?: (google.spanner.v1.PlanNode.IChildLink[]|null); + + /** PlanNode shortRepresentation */ + shortRepresentation?: (google.spanner.v1.PlanNode.IShortRepresentation|null); + + /** PlanNode metadata */ + metadata?: (google.protobuf.IStruct|null); + + /** PlanNode executionStats */ + executionStats?: (google.protobuf.IStruct|null); + } + + /** Represents a PlanNode. */ + class PlanNode implements IPlanNode { + + /** + * Constructs a new PlanNode. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.IPlanNode); + + /** PlanNode index. */ + public index: number; + + /** PlanNode kind. */ + public kind: (google.spanner.v1.PlanNode.Kind|keyof typeof google.spanner.v1.PlanNode.Kind); + + /** PlanNode displayName. */ + public displayName: string; + + /** PlanNode childLinks. */ + public childLinks: google.spanner.v1.PlanNode.IChildLink[]; + + /** PlanNode shortRepresentation. */ + public shortRepresentation?: (google.spanner.v1.PlanNode.IShortRepresentation|null); + + /** PlanNode metadata. */ + public metadata?: (google.protobuf.IStruct|null); + + /** PlanNode executionStats. */ + public executionStats?: (google.protobuf.IStruct|null); + + /** + * Creates a new PlanNode instance using the specified properties. + * @param [properties] Properties to set + * @returns PlanNode instance + */ + public static create(properties?: google.spanner.v1.IPlanNode): google.spanner.v1.PlanNode; + + /** + * Encodes the specified PlanNode message. Does not implicitly {@link google.spanner.v1.PlanNode.verify|verify} messages. + * @param message PlanNode message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.IPlanNode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PlanNode message, length delimited. Does not implicitly {@link google.spanner.v1.PlanNode.verify|verify} messages. + * @param message PlanNode message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.IPlanNode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PlanNode message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PlanNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.PlanNode; + + /** + * Decodes a PlanNode message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PlanNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.PlanNode; + + /** + * Verifies a PlanNode message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PlanNode message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PlanNode + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.PlanNode; + + /** + * Creates a plain object from a PlanNode message. Also converts values to other types if specified. + * @param message PlanNode + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.PlanNode, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PlanNode to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PlanNode + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace PlanNode { + + /** Kind enum. */ + enum Kind { + KIND_UNSPECIFIED = 0, + RELATIONAL = 1, + SCALAR = 2 + } + + /** Properties of a ChildLink. */ + interface IChildLink { + + /** ChildLink childIndex */ + childIndex?: (number|null); + + /** ChildLink type */ + type?: (string|null); + + /** ChildLink variable */ + variable?: (string|null); + } + + /** Represents a ChildLink. */ + class ChildLink implements IChildLink { + + /** + * Constructs a new ChildLink. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.PlanNode.IChildLink); + + /** ChildLink childIndex. */ + public childIndex: number; + + /** ChildLink type. */ + public type: string; + + /** ChildLink variable. */ + public variable: string; + + /** + * Creates a new ChildLink instance using the specified properties. + * @param [properties] Properties to set + * @returns ChildLink instance + */ + public static create(properties?: google.spanner.v1.PlanNode.IChildLink): google.spanner.v1.PlanNode.ChildLink; + + /** + * Encodes the specified ChildLink message. Does not implicitly {@link google.spanner.v1.PlanNode.ChildLink.verify|verify} messages. + * @param message ChildLink message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.PlanNode.IChildLink, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ChildLink message, length delimited. Does not implicitly {@link google.spanner.v1.PlanNode.ChildLink.verify|verify} messages. + * @param message ChildLink message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.PlanNode.IChildLink, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ChildLink message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ChildLink + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.PlanNode.ChildLink; + + /** + * Decodes a ChildLink message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ChildLink + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.PlanNode.ChildLink; + + /** + * Verifies a ChildLink message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ChildLink message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ChildLink + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.PlanNode.ChildLink; + + /** + * Creates a plain object from a ChildLink message. Also converts values to other types if specified. + * @param message ChildLink + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.PlanNode.ChildLink, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ChildLink to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ChildLink + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ShortRepresentation. */ + interface IShortRepresentation { + + /** ShortRepresentation description */ + description?: (string|null); + + /** ShortRepresentation subqueries */ + subqueries?: ({ [k: string]: number }|null); + } + + /** Represents a ShortRepresentation. */ + class ShortRepresentation implements IShortRepresentation { + + /** + * Constructs a new ShortRepresentation. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.PlanNode.IShortRepresentation); + + /** ShortRepresentation description. */ + public description: string; + + /** ShortRepresentation subqueries. */ + public subqueries: { [k: string]: number }; + + /** + * Creates a new ShortRepresentation instance using the specified properties. + * @param [properties] Properties to set + * @returns ShortRepresentation instance + */ + public static create(properties?: google.spanner.v1.PlanNode.IShortRepresentation): google.spanner.v1.PlanNode.ShortRepresentation; + + /** + * Encodes the specified ShortRepresentation message. Does not implicitly {@link google.spanner.v1.PlanNode.ShortRepresentation.verify|verify} messages. + * @param message ShortRepresentation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.PlanNode.IShortRepresentation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ShortRepresentation message, length delimited. Does not implicitly {@link google.spanner.v1.PlanNode.ShortRepresentation.verify|verify} messages. + * @param message ShortRepresentation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.PlanNode.IShortRepresentation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ShortRepresentation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ShortRepresentation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.PlanNode.ShortRepresentation; + + /** + * Decodes a ShortRepresentation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ShortRepresentation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.PlanNode.ShortRepresentation; + + /** + * Verifies a ShortRepresentation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ShortRepresentation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ShortRepresentation + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.PlanNode.ShortRepresentation; + + /** + * Creates a plain object from a ShortRepresentation message. Also converts values to other types if specified. + * @param message ShortRepresentation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.PlanNode.ShortRepresentation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ShortRepresentation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ShortRepresentation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a QueryAdvisorResult. */ + interface IQueryAdvisorResult { + + /** QueryAdvisorResult indexAdvice */ + indexAdvice?: (google.spanner.v1.QueryAdvisorResult.IIndexAdvice[]|null); + } + + /** Represents a QueryAdvisorResult. */ + class QueryAdvisorResult implements IQueryAdvisorResult { + + /** + * Constructs a new QueryAdvisorResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.IQueryAdvisorResult); + + /** QueryAdvisorResult indexAdvice. */ + public indexAdvice: google.spanner.v1.QueryAdvisorResult.IIndexAdvice[]; + + /** + * Creates a new QueryAdvisorResult instance using the specified properties. + * @param [properties] Properties to set + * @returns QueryAdvisorResult instance + */ + public static create(properties?: google.spanner.v1.IQueryAdvisorResult): google.spanner.v1.QueryAdvisorResult; + + /** + * Encodes the specified QueryAdvisorResult message. Does not implicitly {@link google.spanner.v1.QueryAdvisorResult.verify|verify} messages. + * @param message QueryAdvisorResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.IQueryAdvisorResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QueryAdvisorResult message, length delimited. Does not implicitly {@link google.spanner.v1.QueryAdvisorResult.verify|verify} messages. + * @param message QueryAdvisorResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.IQueryAdvisorResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QueryAdvisorResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QueryAdvisorResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.QueryAdvisorResult; + + /** + * Decodes a QueryAdvisorResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QueryAdvisorResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.QueryAdvisorResult; + + /** + * Verifies a QueryAdvisorResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a QueryAdvisorResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QueryAdvisorResult + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.QueryAdvisorResult; + + /** + * Creates a plain object from a QueryAdvisorResult message. Also converts values to other types if specified. + * @param message QueryAdvisorResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.QueryAdvisorResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QueryAdvisorResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for QueryAdvisorResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace QueryAdvisorResult { + + /** Properties of an IndexAdvice. */ + interface IIndexAdvice { + + /** IndexAdvice ddl */ + ddl?: (string[]|null); + + /** IndexAdvice improvementFactor */ + improvementFactor?: (number|null); + } + + /** Represents an IndexAdvice. */ + class IndexAdvice implements IIndexAdvice { + + /** + * Constructs a new IndexAdvice. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.QueryAdvisorResult.IIndexAdvice); + + /** IndexAdvice ddl. */ + public ddl: string[]; + + /** IndexAdvice improvementFactor. */ + public improvementFactor: number; + + /** + * Creates a new IndexAdvice instance using the specified properties. + * @param [properties] Properties to set + * @returns IndexAdvice instance + */ + public static create(properties?: google.spanner.v1.QueryAdvisorResult.IIndexAdvice): google.spanner.v1.QueryAdvisorResult.IndexAdvice; + + /** + * Encodes the specified IndexAdvice message. Does not implicitly {@link google.spanner.v1.QueryAdvisorResult.IndexAdvice.verify|verify} messages. + * @param message IndexAdvice message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.QueryAdvisorResult.IIndexAdvice, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IndexAdvice message, length delimited. Does not implicitly {@link google.spanner.v1.QueryAdvisorResult.IndexAdvice.verify|verify} messages. + * @param message IndexAdvice message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.QueryAdvisorResult.IIndexAdvice, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IndexAdvice message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IndexAdvice + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.QueryAdvisorResult.IndexAdvice; + + /** + * Decodes an IndexAdvice message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IndexAdvice + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.QueryAdvisorResult.IndexAdvice; + + /** + * Verifies an IndexAdvice message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an IndexAdvice message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IndexAdvice + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.QueryAdvisorResult.IndexAdvice; + + /** + * Creates a plain object from an IndexAdvice message. Also converts values to other types if specified. + * @param message IndexAdvice + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.QueryAdvisorResult.IndexAdvice, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IndexAdvice to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IndexAdvice + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a QueryPlan. */ + interface IQueryPlan { + + /** QueryPlan planNodes */ + planNodes?: (google.spanner.v1.IPlanNode[]|null); + + /** QueryPlan queryAdvice */ + queryAdvice?: (google.spanner.v1.IQueryAdvisorResult|null); + } + + /** Represents a QueryPlan. */ + class QueryPlan implements IQueryPlan { + + /** + * Constructs a new QueryPlan. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.IQueryPlan); + + /** QueryPlan planNodes. */ + public planNodes: google.spanner.v1.IPlanNode[]; + + /** QueryPlan queryAdvice. */ + public queryAdvice?: (google.spanner.v1.IQueryAdvisorResult|null); + + /** + * Creates a new QueryPlan instance using the specified properties. + * @param [properties] Properties to set + * @returns QueryPlan instance + */ + public static create(properties?: google.spanner.v1.IQueryPlan): google.spanner.v1.QueryPlan; + + /** + * Encodes the specified QueryPlan message. Does not implicitly {@link google.spanner.v1.QueryPlan.verify|verify} messages. + * @param message QueryPlan message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.IQueryPlan, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QueryPlan message, length delimited. Does not implicitly {@link google.spanner.v1.QueryPlan.verify|verify} messages. + * @param message QueryPlan message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.IQueryPlan, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QueryPlan message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QueryPlan + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.QueryPlan; + + /** + * Decodes a QueryPlan message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QueryPlan + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.QueryPlan; + + /** + * Verifies a QueryPlan message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a QueryPlan message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QueryPlan + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.QueryPlan; + + /** + * Creates a plain object from a QueryPlan message. Also converts values to other types if specified. + * @param message QueryPlan + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.QueryPlan, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QueryPlan to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for QueryPlan + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Namespace api. */ + namespace api { + + /** FieldBehavior enum. */ + enum FieldBehavior { + FIELD_BEHAVIOR_UNSPECIFIED = 0, + OPTIONAL = 1, + REQUIRED = 2, + OUTPUT_ONLY = 3, + INPUT_ONLY = 4, + IMMUTABLE = 5, + UNORDERED_LIST = 6, + NON_EMPTY_DEFAULT = 7, + IDENTIFIER = 8 + } + + /** Properties of a ResourceDescriptor. */ + interface IResourceDescriptor { + + /** ResourceDescriptor type */ + type?: (string|null); + + /** ResourceDescriptor pattern */ + pattern?: (string[]|null); + + /** ResourceDescriptor nameField */ + nameField?: (string|null); + + /** ResourceDescriptor history */ + history?: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History|null); + + /** ResourceDescriptor plural */ + plural?: (string|null); + + /** ResourceDescriptor singular */ + singular?: (string|null); + + /** ResourceDescriptor style */ + style?: (google.api.ResourceDescriptor.Style[]|null); + } + + /** Represents a ResourceDescriptor. */ + class ResourceDescriptor implements IResourceDescriptor { + + /** + * Constructs a new ResourceDescriptor. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceDescriptor); + + /** ResourceDescriptor type. */ + public type: string; + + /** ResourceDescriptor pattern. */ + public pattern: string[]; + + /** ResourceDescriptor nameField. */ + public nameField: string; + + /** ResourceDescriptor history. */ + public history: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History); + + /** ResourceDescriptor plural. */ + public plural: string; + + /** ResourceDescriptor singular. */ + public singular: string; + + /** ResourceDescriptor style. */ + public style: google.api.ResourceDescriptor.Style[]; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceDescriptor instance + */ + public static create(properties?: google.api.IResourceDescriptor): google.api.ResourceDescriptor; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceDescriptor; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceDescriptor; + + /** + * Verifies a ResourceDescriptor message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceDescriptor + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceDescriptor; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @param message ResourceDescriptor + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceDescriptor to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceDescriptor + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ResourceDescriptor { + + /** History enum. */ + enum History { + HISTORY_UNSPECIFIED = 0, + ORIGINALLY_SINGLE_PATTERN = 1, + FUTURE_MULTI_PATTERN = 2 + } + + /** Style enum. */ + enum Style { + STYLE_UNSPECIFIED = 0, + DECLARATIVE_FRIENDLY = 1 + } + } + + /** Properties of a ResourceReference. */ + interface IResourceReference { + + /** ResourceReference type */ + type?: (string|null); + + /** ResourceReference childType */ + childType?: (string|null); + } + + /** Represents a ResourceReference. */ + class ResourceReference implements IResourceReference { + + /** + * Constructs a new ResourceReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceReference); + + /** ResourceReference type. */ + public type: string; + + /** ResourceReference childType. */ + public childType: string; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceReference instance + */ + public static create(properties?: google.api.IResourceReference): google.api.ResourceReference; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceReference; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceReference; + + /** + * Verifies a ResourceReference message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceReference + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceReference; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @param message ResourceReference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceReference + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Http. */ + interface IHttp { + + /** Http rules */ + rules?: (google.api.IHttpRule[]|null); + + /** Http fullyDecodeReservedExpansion */ + fullyDecodeReservedExpansion?: (boolean|null); + } + + /** Represents a Http. */ + class Http implements IHttp { + + /** + * Constructs a new Http. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttp); + + /** Http rules. */ + public rules: google.api.IHttpRule[]; + + /** Http fullyDecodeReservedExpansion. */ + public fullyDecodeReservedExpansion: boolean; + + /** + * Creates a new Http instance using the specified properties. + * @param [properties] Properties to set + * @returns Http instance + */ + public static create(properties?: google.api.IHttp): google.api.Http; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Http message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Http; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Http; + + /** + * Verifies a Http message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Http + */ + public static fromObject(object: { [k: string]: any }): google.api.Http; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @param message Http + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Http to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Http + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a HttpRule. */ + interface IHttpRule { + + /** HttpRule selector */ + selector?: (string|null); + + /** HttpRule get */ + get?: (string|null); + + /** HttpRule put */ + put?: (string|null); + + /** HttpRule post */ + post?: (string|null); + + /** HttpRule delete */ + "delete"?: (string|null); + + /** HttpRule patch */ + patch?: (string|null); + + /** HttpRule custom */ + custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body */ + body?: (string|null); + + /** HttpRule responseBody */ + responseBody?: (string|null); + + /** HttpRule additionalBindings */ + additionalBindings?: (google.api.IHttpRule[]|null); + } + + /** Represents a HttpRule. */ + class HttpRule implements IHttpRule { + + /** + * Constructs a new HttpRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttpRule); + + /** HttpRule selector. */ + public selector: string; + + /** HttpRule get. */ + public get?: (string|null); + + /** HttpRule put. */ + public put?: (string|null); + + /** HttpRule post. */ + public post?: (string|null); + + /** HttpRule delete. */ + public delete?: (string|null); + + /** HttpRule patch. */ + public patch?: (string|null); + + /** HttpRule custom. */ + public custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body. */ + public body: string; + + /** HttpRule responseBody. */ + public responseBody: string; + + /** HttpRule additionalBindings. */ + public additionalBindings: google.api.IHttpRule[]; + + /** HttpRule pattern. */ + public pattern?: ("get"|"put"|"post"|"delete"|"patch"|"custom"); + + /** + * Creates a new HttpRule instance using the specified properties. + * @param [properties] Properties to set + * @returns HttpRule instance + */ + public static create(properties?: google.api.IHttpRule): google.api.HttpRule; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.HttpRule; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.HttpRule; + + /** + * Verifies a HttpRule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HttpRule + */ + public static fromObject(object: { [k: string]: any }): google.api.HttpRule; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @param message HttpRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.HttpRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HttpRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HttpRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomHttpPattern. */ + interface ICustomHttpPattern { + + /** CustomHttpPattern kind */ + kind?: (string|null); + + /** CustomHttpPattern path */ + path?: (string|null); + } + + /** Represents a CustomHttpPattern. */ + class CustomHttpPattern implements ICustomHttpPattern { + + /** + * Constructs a new CustomHttpPattern. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICustomHttpPattern); + + /** CustomHttpPattern kind. */ + public kind: string; + + /** CustomHttpPattern path. */ + public path: string; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomHttpPattern instance + */ + public static create(properties?: google.api.ICustomHttpPattern): google.api.CustomHttpPattern; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CustomHttpPattern; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CustomHttpPattern; + + /** + * Verifies a CustomHttpPattern message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomHttpPattern + */ + public static fromObject(object: { [k: string]: any }): google.api.CustomHttpPattern; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @param message CustomHttpPattern + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CustomHttpPattern, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomHttpPattern to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomHttpPattern + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CommonLanguageSettings. */ + interface ICommonLanguageSettings { + + /** CommonLanguageSettings referenceDocsUri */ + referenceDocsUri?: (string|null); + + /** CommonLanguageSettings destinations */ + destinations?: (google.api.ClientLibraryDestination[]|null); + } + + /** Represents a CommonLanguageSettings. */ + class CommonLanguageSettings implements ICommonLanguageSettings { + + /** + * Constructs a new CommonLanguageSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICommonLanguageSettings); + + /** CommonLanguageSettings referenceDocsUri. */ + public referenceDocsUri: string; + + /** CommonLanguageSettings destinations. */ + public destinations: google.api.ClientLibraryDestination[]; + + /** + * Creates a new CommonLanguageSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns CommonLanguageSettings instance + */ + public static create(properties?: google.api.ICommonLanguageSettings): google.api.CommonLanguageSettings; + + /** + * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @param message CommonLanguageSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @param message CommonLanguageSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CommonLanguageSettings; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CommonLanguageSettings; + + /** + * Verifies a CommonLanguageSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CommonLanguageSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.CommonLanguageSettings; + + /** + * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. + * @param message CommonLanguageSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CommonLanguageSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CommonLanguageSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CommonLanguageSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ClientLibrarySettings. */ + interface IClientLibrarySettings { + + /** ClientLibrarySettings version */ + version?: (string|null); + + /** ClientLibrarySettings launchStage */ + launchStage?: (google.api.LaunchStage|keyof typeof google.api.LaunchStage|null); + + /** ClientLibrarySettings restNumericEnums */ + restNumericEnums?: (boolean|null); + + /** ClientLibrarySettings javaSettings */ + javaSettings?: (google.api.IJavaSettings|null); + + /** ClientLibrarySettings cppSettings */ + cppSettings?: (google.api.ICppSettings|null); + + /** ClientLibrarySettings phpSettings */ + phpSettings?: (google.api.IPhpSettings|null); + + /** ClientLibrarySettings pythonSettings */ + pythonSettings?: (google.api.IPythonSettings|null); + + /** ClientLibrarySettings nodeSettings */ + nodeSettings?: (google.api.INodeSettings|null); + + /** ClientLibrarySettings dotnetSettings */ + dotnetSettings?: (google.api.IDotnetSettings|null); + + /** ClientLibrarySettings rubySettings */ + rubySettings?: (google.api.IRubySettings|null); + + /** ClientLibrarySettings goSettings */ + goSettings?: (google.api.IGoSettings|null); + } + + /** Represents a ClientLibrarySettings. */ + class ClientLibrarySettings implements IClientLibrarySettings { + + /** + * Constructs a new ClientLibrarySettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IClientLibrarySettings); + + /** ClientLibrarySettings version. */ + public version: string; + + /** ClientLibrarySettings launchStage. */ + public launchStage: (google.api.LaunchStage|keyof typeof google.api.LaunchStage); + + /** ClientLibrarySettings restNumericEnums. */ + public restNumericEnums: boolean; + + /** ClientLibrarySettings javaSettings. */ + public javaSettings?: (google.api.IJavaSettings|null); + + /** ClientLibrarySettings cppSettings. */ + public cppSettings?: (google.api.ICppSettings|null); + + /** ClientLibrarySettings phpSettings. */ + public phpSettings?: (google.api.IPhpSettings|null); + + /** ClientLibrarySettings pythonSettings. */ + public pythonSettings?: (google.api.IPythonSettings|null); + + /** ClientLibrarySettings nodeSettings. */ + public nodeSettings?: (google.api.INodeSettings|null); + + /** ClientLibrarySettings dotnetSettings. */ + public dotnetSettings?: (google.api.IDotnetSettings|null); + + /** ClientLibrarySettings rubySettings. */ + public rubySettings?: (google.api.IRubySettings|null); + + /** ClientLibrarySettings goSettings. */ + public goSettings?: (google.api.IGoSettings|null); + + /** + * Creates a new ClientLibrarySettings instance using the specified properties. + * @param [properties] Properties to set + * @returns ClientLibrarySettings instance + */ + public static create(properties?: google.api.IClientLibrarySettings): google.api.ClientLibrarySettings; + + /** + * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @param message ClientLibrarySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @param message ClientLibrarySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ClientLibrarySettings; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ClientLibrarySettings; + + /** + * Verifies a ClientLibrarySettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClientLibrarySettings + */ + public static fromObject(object: { [k: string]: any }): google.api.ClientLibrarySettings; + + /** + * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. + * @param message ClientLibrarySettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ClientLibrarySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClientLibrarySettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClientLibrarySettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Publishing. */ + interface IPublishing { + + /** Publishing methodSettings */ + methodSettings?: (google.api.IMethodSettings[]|null); + + /** Publishing newIssueUri */ + newIssueUri?: (string|null); + + /** Publishing documentationUri */ + documentationUri?: (string|null); + + /** Publishing apiShortName */ + apiShortName?: (string|null); + + /** Publishing githubLabel */ + githubLabel?: (string|null); + + /** Publishing codeownerGithubTeams */ + codeownerGithubTeams?: (string[]|null); + + /** Publishing docTagPrefix */ + docTagPrefix?: (string|null); + + /** Publishing organization */ + organization?: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization|null); + + /** Publishing librarySettings */ + librarySettings?: (google.api.IClientLibrarySettings[]|null); + + /** Publishing protoReferenceDocumentationUri */ + protoReferenceDocumentationUri?: (string|null); + + /** Publishing restReferenceDocumentationUri */ + restReferenceDocumentationUri?: (string|null); + } + + /** Represents a Publishing. */ + class Publishing implements IPublishing { + + /** + * Constructs a new Publishing. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPublishing); + + /** Publishing methodSettings. */ + public methodSettings: google.api.IMethodSettings[]; + + /** Publishing newIssueUri. */ + public newIssueUri: string; + + /** Publishing documentationUri. */ + public documentationUri: string; + + /** Publishing apiShortName. */ + public apiShortName: string; + + /** Publishing githubLabel. */ + public githubLabel: string; + + /** Publishing codeownerGithubTeams. */ + public codeownerGithubTeams: string[]; + + /** Publishing docTagPrefix. */ + public docTagPrefix: string; + + /** Publishing organization. */ + public organization: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization); + + /** Publishing librarySettings. */ + public librarySettings: google.api.IClientLibrarySettings[]; + + /** Publishing protoReferenceDocumentationUri. */ + public protoReferenceDocumentationUri: string; + + /** Publishing restReferenceDocumentationUri. */ + public restReferenceDocumentationUri: string; + + /** + * Creates a new Publishing instance using the specified properties. + * @param [properties] Properties to set + * @returns Publishing instance + */ + public static create(properties?: google.api.IPublishing): google.api.Publishing; + + /** + * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @param message Publishing message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @param message Publishing message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Publishing message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Publishing; + + /** + * Decodes a Publishing message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Publishing; + + /** + * Verifies a Publishing message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Publishing message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Publishing + */ + public static fromObject(object: { [k: string]: any }): google.api.Publishing; + + /** + * Creates a plain object from a Publishing message. Also converts values to other types if specified. + * @param message Publishing + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Publishing, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Publishing to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Publishing + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a JavaSettings. */ + interface IJavaSettings { + + /** JavaSettings libraryPackage */ + libraryPackage?: (string|null); + + /** JavaSettings serviceClassNames */ + serviceClassNames?: ({ [k: string]: string }|null); + + /** JavaSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a JavaSettings. */ + class JavaSettings implements IJavaSettings { + + /** + * Constructs a new JavaSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IJavaSettings); + + /** JavaSettings libraryPackage. */ + public libraryPackage: string; + + /** JavaSettings serviceClassNames. */ + public serviceClassNames: { [k: string]: string }; + + /** JavaSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new JavaSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns JavaSettings instance + */ + public static create(properties?: google.api.IJavaSettings): google.api.JavaSettings; + + /** + * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @param message JavaSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @param message JavaSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JavaSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.JavaSettings; + + /** + * Decodes a JavaSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.JavaSettings; + + /** + * Verifies a JavaSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JavaSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.JavaSettings; + + /** + * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. + * @param message JavaSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.JavaSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JavaSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JavaSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CppSettings. */ + interface ICppSettings { + + /** CppSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a CppSettings. */ + class CppSettings implements ICppSettings { + + /** + * Constructs a new CppSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICppSettings); + + /** CppSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new CppSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns CppSettings instance + */ + public static create(properties?: google.api.ICppSettings): google.api.CppSettings; + + /** + * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @param message CppSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @param message CppSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CppSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CppSettings; + + /** + * Decodes a CppSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CppSettings; + + /** + * Verifies a CppSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CppSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.CppSettings; + + /** + * Creates a plain object from a CppSettings message. Also converts values to other types if specified. + * @param message CppSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CppSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CppSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CppSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PhpSettings. */ + interface IPhpSettings { + + /** PhpSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a PhpSettings. */ + class PhpSettings implements IPhpSettings { + + /** + * Constructs a new PhpSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPhpSettings); + + /** PhpSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new PhpSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns PhpSettings instance + */ + public static create(properties?: google.api.IPhpSettings): google.api.PhpSettings; + + /** + * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @param message PhpSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @param message PhpSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PhpSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PhpSettings; + + /** + * Decodes a PhpSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PhpSettings; + + /** + * Verifies a PhpSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PhpSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.PhpSettings; + + /** + * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. + * @param message PhpSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PhpSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PhpSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PhpSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PythonSettings. */ + interface IPythonSettings { + + /** PythonSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a PythonSettings. */ + class PythonSettings implements IPythonSettings { + + /** + * Constructs a new PythonSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPythonSettings); + + /** PythonSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new PythonSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns PythonSettings instance + */ + public static create(properties?: google.api.IPythonSettings): google.api.PythonSettings; + + /** + * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @param message PythonSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @param message PythonSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PythonSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PythonSettings; + + /** + * Decodes a PythonSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PythonSettings; + + /** + * Verifies a PythonSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PythonSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.PythonSettings; + + /** + * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. + * @param message PythonSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PythonSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PythonSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PythonSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeSettings. */ + interface INodeSettings { + + /** NodeSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a NodeSettings. */ + class NodeSettings implements INodeSettings { + + /** + * Constructs a new NodeSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.INodeSettings); + + /** NodeSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new NodeSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeSettings instance + */ + public static create(properties?: google.api.INodeSettings): google.api.NodeSettings; + + /** + * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @param message NodeSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @param message NodeSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.NodeSettings; + + /** + * Decodes a NodeSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.NodeSettings; + + /** + * Verifies a NodeSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NodeSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.NodeSettings; + + /** + * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. + * @param message NodeSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.NodeSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NodeSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NodeSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DotnetSettings. */ + interface IDotnetSettings { + + /** DotnetSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + + /** DotnetSettings renamedServices */ + renamedServices?: ({ [k: string]: string }|null); + + /** DotnetSettings renamedResources */ + renamedResources?: ({ [k: string]: string }|null); + + /** DotnetSettings ignoredResources */ + ignoredResources?: (string[]|null); + + /** DotnetSettings forcedNamespaceAliases */ + forcedNamespaceAliases?: (string[]|null); + + /** DotnetSettings handwrittenSignatures */ + handwrittenSignatures?: (string[]|null); + } + + /** Represents a DotnetSettings. */ + class DotnetSettings implements IDotnetSettings { + + /** + * Constructs a new DotnetSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IDotnetSettings); + + /** DotnetSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** DotnetSettings renamedServices. */ + public renamedServices: { [k: string]: string }; + + /** DotnetSettings renamedResources. */ + public renamedResources: { [k: string]: string }; + + /** DotnetSettings ignoredResources. */ + public ignoredResources: string[]; + + /** DotnetSettings forcedNamespaceAliases. */ + public forcedNamespaceAliases: string[]; + + /** DotnetSettings handwrittenSignatures. */ + public handwrittenSignatures: string[]; + + /** + * Creates a new DotnetSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns DotnetSettings instance + */ + public static create(properties?: google.api.IDotnetSettings): google.api.DotnetSettings; + + /** + * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @param message DotnetSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @param message DotnetSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.DotnetSettings; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.DotnetSettings; + + /** + * Verifies a DotnetSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DotnetSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.DotnetSettings; + + /** + * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. + * @param message DotnetSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.DotnetSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DotnetSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DotnetSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RubySettings. */ + interface IRubySettings { + + /** RubySettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a RubySettings. */ + class RubySettings implements IRubySettings { + + /** + * Constructs a new RubySettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IRubySettings); + + /** RubySettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new RubySettings instance using the specified properties. + * @param [properties] Properties to set + * @returns RubySettings instance + */ + public static create(properties?: google.api.IRubySettings): google.api.RubySettings; + + /** + * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @param message RubySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @param message RubySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RubySettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.RubySettings; + + /** + * Decodes a RubySettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.RubySettings; + + /** + * Verifies a RubySettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RubySettings + */ + public static fromObject(object: { [k: string]: any }): google.api.RubySettings; + + /** + * Creates a plain object from a RubySettings message. Also converts values to other types if specified. + * @param message RubySettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.RubySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RubySettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RubySettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GoSettings. */ + interface IGoSettings { + + /** GoSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a GoSettings. */ + class GoSettings implements IGoSettings { + + /** + * Constructs a new GoSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IGoSettings); + + /** GoSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new GoSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns GoSettings instance + */ + public static create(properties?: google.api.IGoSettings): google.api.GoSettings; + + /** + * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @param message GoSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @param message GoSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GoSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.GoSettings; + + /** + * Decodes a GoSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.GoSettings; + + /** + * Verifies a GoSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GoSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.GoSettings; + + /** + * Creates a plain object from a GoSettings message. Also converts values to other types if specified. + * @param message GoSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.GoSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GoSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GoSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodSettings. */ + interface IMethodSettings { + + /** MethodSettings selector */ + selector?: (string|null); + + /** MethodSettings longRunning */ + longRunning?: (google.api.MethodSettings.ILongRunning|null); + + /** MethodSettings autoPopulatedFields */ + autoPopulatedFields?: (string[]|null); + } + + /** Represents a MethodSettings. */ + class MethodSettings implements IMethodSettings { + + /** + * Constructs a new MethodSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IMethodSettings); + + /** MethodSettings selector. */ + public selector: string; + + /** MethodSettings longRunning. */ + public longRunning?: (google.api.MethodSettings.ILongRunning|null); + + /** MethodSettings autoPopulatedFields. */ + public autoPopulatedFields: string[]; + + /** + * Creates a new MethodSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodSettings instance + */ + public static create(properties?: google.api.IMethodSettings): google.api.MethodSettings; + + /** + * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @param message MethodSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @param message MethodSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.MethodSettings; + + /** + * Decodes a MethodSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.MethodSettings; + + /** + * Verifies a MethodSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.MethodSettings; + + /** + * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. + * @param message MethodSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.MethodSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MethodSettings { + + /** Properties of a LongRunning. */ + interface ILongRunning { + + /** LongRunning initialPollDelay */ + initialPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning pollDelayMultiplier */ + pollDelayMultiplier?: (number|null); + + /** LongRunning maxPollDelay */ + maxPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning totalPollTimeout */ + totalPollTimeout?: (google.protobuf.IDuration|null); + } + + /** Represents a LongRunning. */ + class LongRunning implements ILongRunning { + + /** + * Constructs a new LongRunning. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.MethodSettings.ILongRunning); + + /** LongRunning initialPollDelay. */ + public initialPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning pollDelayMultiplier. */ + public pollDelayMultiplier: number; + + /** LongRunning maxPollDelay. */ + public maxPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning totalPollTimeout. */ + public totalPollTimeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new LongRunning instance using the specified properties. + * @param [properties] Properties to set + * @returns LongRunning instance + */ + public static create(properties?: google.api.MethodSettings.ILongRunning): google.api.MethodSettings.LongRunning; + + /** + * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @param message LongRunning message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @param message LongRunning message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LongRunning message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.MethodSettings.LongRunning; + + /** + * Decodes a LongRunning message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.MethodSettings.LongRunning; + + /** + * Verifies a LongRunning message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LongRunning + */ + public static fromObject(object: { [k: string]: any }): google.api.MethodSettings.LongRunning; + + /** + * Creates a plain object from a LongRunning message. Also converts values to other types if specified. + * @param message LongRunning + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.MethodSettings.LongRunning, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LongRunning to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LongRunning + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** ClientLibraryOrganization enum. */ + enum ClientLibraryOrganization { + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0, + CLOUD = 1, + ADS = 2, + PHOTOS = 3, + STREET_VIEW = 4, + SHOPPING = 5, + GEO = 6, + GENERATIVE_AI = 7 + } + + /** ClientLibraryDestination enum. */ + enum ClientLibraryDestination { + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0, + GITHUB = 10, + PACKAGE_MANAGER = 20 + } + + /** LaunchStage enum. */ + enum LaunchStage { + LAUNCH_STAGE_UNSPECIFIED = 0, + UNIMPLEMENTED = 6, + PRELAUNCH = 7, + EARLY_ACCESS = 1, + ALPHA = 2, + BETA = 3, + GA = 4, + DEPRECATED = 5 + } + } + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a FileDescriptorSet. */ + interface IFileDescriptorSet { + + /** FileDescriptorSet file */ + file?: (google.protobuf.IFileDescriptorProto[]|null); + } + + /** Represents a FileDescriptorSet. */ + class FileDescriptorSet implements IFileDescriptorSet { + + /** + * Constructs a new FileDescriptorSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorSet); + + /** FileDescriptorSet file. */ + public file: google.protobuf.IFileDescriptorProto[]; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorSet instance + */ + public static create(properties?: google.protobuf.IFileDescriptorSet): google.protobuf.FileDescriptorSet; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorSet; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorSet; + + /** + * Verifies a FileDescriptorSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorSet + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorSet; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @param message FileDescriptorSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileDescriptorSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Edition enum. */ + enum Edition { + EDITION_UNKNOWN = 0, + EDITION_PROTO2 = 998, + EDITION_PROTO3 = 999, + EDITION_2023 = 1000, + EDITION_2024 = 1001, + EDITION_1_TEST_ONLY = 1, + EDITION_2_TEST_ONLY = 2, + EDITION_99997_TEST_ONLY = 99997, + EDITION_99998_TEST_ONLY = 99998, + EDITION_99999_TEST_ONLY = 99999, + EDITION_MAX = 2147483647 + } + + /** Properties of a FileDescriptorProto. */ + interface IFileDescriptorProto { + + /** FileDescriptorProto name */ + name?: (string|null); + + /** FileDescriptorProto package */ + "package"?: (string|null); + + /** FileDescriptorProto dependency */ + dependency?: (string[]|null); + + /** FileDescriptorProto publicDependency */ + publicDependency?: (number[]|null); + + /** FileDescriptorProto weakDependency */ + weakDependency?: (number[]|null); + + /** FileDescriptorProto messageType */ + messageType?: (google.protobuf.IDescriptorProto[]|null); + + /** FileDescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** FileDescriptorProto service */ + service?: (google.protobuf.IServiceDescriptorProto[]|null); + + /** FileDescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** FileDescriptorProto options */ + options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo */ + sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax */ + syntax?: (string|null); + + /** FileDescriptorProto edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + } + + /** Represents a FileDescriptorProto. */ + class FileDescriptorProto implements IFileDescriptorProto { + + /** + * Constructs a new FileDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorProto); + + /** FileDescriptorProto name. */ + public name: string; + + /** FileDescriptorProto package. */ + public package: string; + + /** FileDescriptorProto dependency. */ + public dependency: string[]; + + /** FileDescriptorProto publicDependency. */ + public publicDependency: number[]; + + /** FileDescriptorProto weakDependency. */ + public weakDependency: number[]; + + /** FileDescriptorProto messageType. */ + public messageType: google.protobuf.IDescriptorProto[]; + + /** FileDescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** FileDescriptorProto service. */ + public service: google.protobuf.IServiceDescriptorProto[]; + + /** FileDescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** FileDescriptorProto options. */ + public options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo. */ + public sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax. */ + public syntax: string; + + /** FileDescriptorProto edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFileDescriptorProto): google.protobuf.FileDescriptorProto; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorProto; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorProto; + + /** + * Verifies a FileDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorProto; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @param message FileDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DescriptorProto. */ + interface IDescriptorProto { + + /** DescriptorProto name */ + name?: (string|null); + + /** DescriptorProto field */ + field?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto nestedType */ + nestedType?: (google.protobuf.IDescriptorProto[]|null); + + /** DescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** DescriptorProto extensionRange */ + extensionRange?: (google.protobuf.DescriptorProto.IExtensionRange[]|null); + + /** DescriptorProto oneofDecl */ + oneofDecl?: (google.protobuf.IOneofDescriptorProto[]|null); + + /** DescriptorProto options */ + options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange */ + reservedRange?: (google.protobuf.DescriptorProto.IReservedRange[]|null); + + /** DescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents a DescriptorProto. */ + class DescriptorProto implements IDescriptorProto { + + /** + * Constructs a new DescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDescriptorProto); + + /** DescriptorProto name. */ + public name: string; + + /** DescriptorProto field. */ + public field: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto nestedType. */ + public nestedType: google.protobuf.IDescriptorProto[]; + + /** DescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** DescriptorProto extensionRange. */ + public extensionRange: google.protobuf.DescriptorProto.IExtensionRange[]; + + /** DescriptorProto oneofDecl. */ + public oneofDecl: google.protobuf.IOneofDescriptorProto[]; + + /** DescriptorProto options. */ + public options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange. */ + public reservedRange: google.protobuf.DescriptorProto.IReservedRange[]; + + /** DescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns DescriptorProto instance + */ + public static create(properties?: google.protobuf.IDescriptorProto): google.protobuf.DescriptorProto; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto; + + /** + * Verifies a DescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @param message DescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DescriptorProto { + + /** Properties of an ExtensionRange. */ + interface IExtensionRange { + + /** ExtensionRange start */ + start?: (number|null); + + /** ExtensionRange end */ + end?: (number|null); + + /** ExtensionRange options */ + options?: (google.protobuf.IExtensionRangeOptions|null); + } + + /** Represents an ExtensionRange. */ + class ExtensionRange implements IExtensionRange { + + /** + * Constructs a new ExtensionRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange); + + /** ExtensionRange start. */ + public start: number; + + /** ExtensionRange end. */ + public end: number; + + /** ExtensionRange options. */ + public options?: (google.protobuf.IExtensionRangeOptions|null); + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IExtensionRange): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Verifies an ExtensionRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @param message ExtensionRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ExtensionRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtensionRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReservedRange. */ + interface IReservedRange { + + /** ReservedRange start */ + start?: (number|null); + + /** ReservedRange end */ + end?: (number|null); + } + + /** Represents a ReservedRange. */ + class ReservedRange implements IReservedRange { + + /** + * Constructs a new ReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IReservedRange); + + /** ReservedRange start. */ + public start: number; + + /** ReservedRange end. */ + public end: number; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ReservedRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IReservedRange): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Verifies a ReservedRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @param message ReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ExtensionRangeOptions. */ + interface IExtensionRangeOptions { + + /** ExtensionRangeOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** ExtensionRangeOptions declaration */ + declaration?: (google.protobuf.ExtensionRangeOptions.IDeclaration[]|null); + + /** ExtensionRangeOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** ExtensionRangeOptions verification */ + verification?: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState|null); + } + + /** Represents an ExtensionRangeOptions. */ + class ExtensionRangeOptions implements IExtensionRangeOptions { + + /** + * Constructs a new ExtensionRangeOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IExtensionRangeOptions); + + /** ExtensionRangeOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** ExtensionRangeOptions declaration. */ + public declaration: google.protobuf.ExtensionRangeOptions.IDeclaration[]; + + /** ExtensionRangeOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** ExtensionRangeOptions verification. */ + public verification: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState); + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRangeOptions instance + */ + public static create(properties?: google.protobuf.IExtensionRangeOptions): google.protobuf.ExtensionRangeOptions; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions; + + /** + * Verifies an ExtensionRangeOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRangeOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @param message ExtensionRangeOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ExtensionRangeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ExtensionRangeOptions { + + /** Properties of a Declaration. */ + interface IDeclaration { + + /** Declaration number */ + number?: (number|null); + + /** Declaration fullName */ + fullName?: (string|null); + + /** Declaration type */ + type?: (string|null); + + /** Declaration reserved */ + reserved?: (boolean|null); + + /** Declaration repeated */ + repeated?: (boolean|null); + } + + /** Represents a Declaration. */ + class Declaration implements IDeclaration { + + /** + * Constructs a new Declaration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration); + + /** Declaration number. */ + public number: number; + + /** Declaration fullName. */ + public fullName: string; + + /** Declaration type. */ + public type: string; + + /** Declaration reserved. */ + public reserved: boolean; + + /** Declaration repeated. */ + public repeated: boolean; + + /** + * Creates a new Declaration instance using the specified properties. + * @param [properties] Properties to set + * @returns Declaration instance + */ + public static create(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @param message Declaration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @param message Declaration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Declaration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Decodes a Declaration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Verifies a Declaration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Declaration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Declaration + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Creates a plain object from a Declaration message. Also converts values to other types if specified. + * @param message Declaration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ExtensionRangeOptions.Declaration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Declaration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Declaration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** VerificationState enum. */ + enum VerificationState { + DECLARATION = 0, + UNVERIFIED = 1 + } + } + + /** Properties of a FieldDescriptorProto. */ + interface IFieldDescriptorProto { + + /** FieldDescriptorProto name */ + name?: (string|null); + + /** FieldDescriptorProto number */ + number?: (number|null); + + /** FieldDescriptorProto label */ + label?: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label|null); + + /** FieldDescriptorProto type */ + type?: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type|null); + + /** FieldDescriptorProto typeName */ + typeName?: (string|null); + + /** FieldDescriptorProto extendee */ + extendee?: (string|null); + + /** FieldDescriptorProto defaultValue */ + defaultValue?: (string|null); + + /** FieldDescriptorProto oneofIndex */ + oneofIndex?: (number|null); + + /** FieldDescriptorProto jsonName */ + jsonName?: (string|null); + + /** FieldDescriptorProto options */ + options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional */ + proto3Optional?: (boolean|null); + } + + /** Represents a FieldDescriptorProto. */ + class FieldDescriptorProto implements IFieldDescriptorProto { + + /** + * Constructs a new FieldDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldDescriptorProto); + + /** FieldDescriptorProto name. */ + public name: string; + + /** FieldDescriptorProto number. */ + public number: number; + + /** FieldDescriptorProto label. */ + public label: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label); + + /** FieldDescriptorProto type. */ + public type: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type); + + /** FieldDescriptorProto typeName. */ + public typeName: string; + + /** FieldDescriptorProto extendee. */ + public extendee: string; + + /** FieldDescriptorProto defaultValue. */ + public defaultValue: string; + + /** FieldDescriptorProto oneofIndex. */ + public oneofIndex: number; + + /** FieldDescriptorProto jsonName. */ + public jsonName: string; + + /** FieldDescriptorProto options. */ + public options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional. */ + public proto3Optional: boolean; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFieldDescriptorProto): google.protobuf.FieldDescriptorProto; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldDescriptorProto; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldDescriptorProto; + + /** + * Verifies a FieldDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @param message FieldDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldDescriptorProto { + + /** Type enum. */ + enum Type { + TYPE_DOUBLE = 1, + TYPE_FLOAT = 2, + TYPE_INT64 = 3, + TYPE_UINT64 = 4, + TYPE_INT32 = 5, + TYPE_FIXED64 = 6, + TYPE_FIXED32 = 7, + TYPE_BOOL = 8, + TYPE_STRING = 9, + TYPE_GROUP = 10, + TYPE_MESSAGE = 11, + TYPE_BYTES = 12, + TYPE_UINT32 = 13, + TYPE_ENUM = 14, + TYPE_SFIXED32 = 15, + TYPE_SFIXED64 = 16, + TYPE_SINT32 = 17, + TYPE_SINT64 = 18 + } + + /** Label enum. */ + enum Label { + LABEL_OPTIONAL = 1, + LABEL_REPEATED = 3, + LABEL_REQUIRED = 2 + } + } + + /** Properties of an OneofDescriptorProto. */ + interface IOneofDescriptorProto { + + /** OneofDescriptorProto name */ + name?: (string|null); + + /** OneofDescriptorProto options */ + options?: (google.protobuf.IOneofOptions|null); + } + + /** Represents an OneofDescriptorProto. */ + class OneofDescriptorProto implements IOneofDescriptorProto { + + /** + * Constructs a new OneofDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofDescriptorProto); + + /** OneofDescriptorProto name. */ + public name: string; + + /** OneofDescriptorProto options. */ + public options?: (google.protobuf.IOneofOptions|null); + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofDescriptorProto instance + */ + public static create(properties?: google.protobuf.IOneofDescriptorProto): google.protobuf.OneofDescriptorProto; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofDescriptorProto; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofDescriptorProto; + + /** + * Verifies an OneofDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofDescriptorProto; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @param message OneofDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneofDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumDescriptorProto. */ + interface IEnumDescriptorProto { + + /** EnumDescriptorProto name */ + name?: (string|null); + + /** EnumDescriptorProto value */ + value?: (google.protobuf.IEnumValueDescriptorProto[]|null); + + /** EnumDescriptorProto options */ + options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange */ + reservedRange?: (google.protobuf.EnumDescriptorProto.IEnumReservedRange[]|null); + + /** EnumDescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents an EnumDescriptorProto. */ + class EnumDescriptorProto implements IEnumDescriptorProto { + + /** + * Constructs a new EnumDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumDescriptorProto); + + /** EnumDescriptorProto name. */ + public name: string; + + /** EnumDescriptorProto value. */ + public value: google.protobuf.IEnumValueDescriptorProto[]; + + /** EnumDescriptorProto options. */ + public options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange. */ + public reservedRange: google.protobuf.EnumDescriptorProto.IEnumReservedRange[]; + + /** EnumDescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumDescriptorProto): google.protobuf.EnumDescriptorProto; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto; + + /** + * Verifies an EnumDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @param message EnumDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EnumDescriptorProto { + + /** Properties of an EnumReservedRange. */ + interface IEnumReservedRange { + + /** EnumReservedRange start */ + start?: (number|null); + + /** EnumReservedRange end */ + end?: (number|null); + } + + /** Represents an EnumReservedRange. */ + class EnumReservedRange implements IEnumReservedRange { + + /** + * Constructs a new EnumReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange); + + /** EnumReservedRange start. */ + public start: number; + + /** EnumReservedRange end. */ + public end: number; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumReservedRange instance + */ + public static create(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Verifies an EnumReservedRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @param message EnumReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto.EnumReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an EnumValueDescriptorProto. */ + interface IEnumValueDescriptorProto { + + /** EnumValueDescriptorProto name */ + name?: (string|null); + + /** EnumValueDescriptorProto number */ + number?: (number|null); + + /** EnumValueDescriptorProto options */ + options?: (google.protobuf.IEnumValueOptions|null); + } + + /** Represents an EnumValueDescriptorProto. */ + class EnumValueDescriptorProto implements IEnumValueDescriptorProto { + + /** + * Constructs a new EnumValueDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueDescriptorProto); + + /** EnumValueDescriptorProto name. */ + public name: string; + + /** EnumValueDescriptorProto number. */ + public number: number; + + /** EnumValueDescriptorProto options. */ + public options?: (google.protobuf.IEnumValueOptions|null); + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumValueDescriptorProto): google.protobuf.EnumValueDescriptorProto; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueDescriptorProto; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueDescriptorProto; + + /** + * Verifies an EnumValueDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueDescriptorProto; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @param message EnumValueDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceDescriptorProto. */ + interface IServiceDescriptorProto { + + /** ServiceDescriptorProto name */ + name?: (string|null); + + /** ServiceDescriptorProto method */ + method?: (google.protobuf.IMethodDescriptorProto[]|null); + + /** ServiceDescriptorProto options */ + options?: (google.protobuf.IServiceOptions|null); + } + + /** Represents a ServiceDescriptorProto. */ + class ServiceDescriptorProto implements IServiceDescriptorProto { + + /** + * Constructs a new ServiceDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceDescriptorProto); + + /** ServiceDescriptorProto name. */ + public name: string; + + /** ServiceDescriptorProto method. */ + public method: google.protobuf.IMethodDescriptorProto[]; + + /** ServiceDescriptorProto options. */ + public options?: (google.protobuf.IServiceOptions|null); + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceDescriptorProto instance + */ + public static create(properties?: google.protobuf.IServiceDescriptorProto): google.protobuf.ServiceDescriptorProto; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceDescriptorProto; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceDescriptorProto; + + /** + * Verifies a ServiceDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceDescriptorProto; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @param message ServiceDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodDescriptorProto. */ + interface IMethodDescriptorProto { + + /** MethodDescriptorProto name */ + name?: (string|null); + + /** MethodDescriptorProto inputType */ + inputType?: (string|null); + + /** MethodDescriptorProto outputType */ + outputType?: (string|null); + + /** MethodDescriptorProto options */ + options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming */ + clientStreaming?: (boolean|null); + + /** MethodDescriptorProto serverStreaming */ + serverStreaming?: (boolean|null); + } + + /** Represents a MethodDescriptorProto. */ + class MethodDescriptorProto implements IMethodDescriptorProto { + + /** + * Constructs a new MethodDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodDescriptorProto); + + /** MethodDescriptorProto name. */ + public name: string; + + /** MethodDescriptorProto inputType. */ + public inputType: string; + + /** MethodDescriptorProto outputType. */ + public outputType: string; + + /** MethodDescriptorProto options. */ + public options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming. */ + public clientStreaming: boolean; + + /** MethodDescriptorProto serverStreaming. */ + public serverStreaming: boolean; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodDescriptorProto instance + */ + public static create(properties?: google.protobuf.IMethodDescriptorProto): google.protobuf.MethodDescriptorProto; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodDescriptorProto; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodDescriptorProto; + + /** + * Verifies a MethodDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodDescriptorProto; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @param message MethodDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileOptions. */ + interface IFileOptions { + + /** FileOptions javaPackage */ + javaPackage?: (string|null); + + /** FileOptions javaOuterClassname */ + javaOuterClassname?: (string|null); + + /** FileOptions javaMultipleFiles */ + javaMultipleFiles?: (boolean|null); + + /** FileOptions javaGenerateEqualsAndHash */ + javaGenerateEqualsAndHash?: (boolean|null); + + /** FileOptions javaStringCheckUtf8 */ + javaStringCheckUtf8?: (boolean|null); + + /** FileOptions optimizeFor */ + optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode|null); + + /** FileOptions goPackage */ + goPackage?: (string|null); + + /** FileOptions ccGenericServices */ + ccGenericServices?: (boolean|null); + + /** FileOptions javaGenericServices */ + javaGenericServices?: (boolean|null); + + /** FileOptions pyGenericServices */ + pyGenericServices?: (boolean|null); + + /** FileOptions deprecated */ + deprecated?: (boolean|null); + + /** FileOptions ccEnableArenas */ + ccEnableArenas?: (boolean|null); + + /** FileOptions objcClassPrefix */ + objcClassPrefix?: (string|null); + + /** FileOptions csharpNamespace */ + csharpNamespace?: (string|null); + + /** FileOptions swiftPrefix */ + swiftPrefix?: (string|null); + + /** FileOptions phpClassPrefix */ + phpClassPrefix?: (string|null); + + /** FileOptions phpNamespace */ + phpNamespace?: (string|null); + + /** FileOptions phpMetadataNamespace */ + phpMetadataNamespace?: (string|null); + + /** FileOptions rubyPackage */ + rubyPackage?: (string|null); + + /** FileOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** FileOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FileOptions .google.api.resourceDefinition */ + ".google.api.resourceDefinition"?: (google.api.IResourceDescriptor[]|null); + } + + /** Represents a FileOptions. */ + class FileOptions implements IFileOptions { + + /** + * Constructs a new FileOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileOptions); + + /** FileOptions javaPackage. */ + public javaPackage: string; + + /** FileOptions javaOuterClassname. */ + public javaOuterClassname: string; + + /** FileOptions javaMultipleFiles. */ + public javaMultipleFiles: boolean; + + /** FileOptions javaGenerateEqualsAndHash. */ + public javaGenerateEqualsAndHash: boolean; + + /** FileOptions javaStringCheckUtf8. */ + public javaStringCheckUtf8: boolean; + + /** FileOptions optimizeFor. */ + public optimizeFor: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode); + + /** FileOptions goPackage. */ + public goPackage: string; + + /** FileOptions ccGenericServices. */ + public ccGenericServices: boolean; + + /** FileOptions javaGenericServices. */ + public javaGenericServices: boolean; + + /** FileOptions pyGenericServices. */ + public pyGenericServices: boolean; + + /** FileOptions deprecated. */ + public deprecated: boolean; + + /** FileOptions ccEnableArenas. */ + public ccEnableArenas: boolean; + + /** FileOptions objcClassPrefix. */ + public objcClassPrefix: string; + + /** FileOptions csharpNamespace. */ + public csharpNamespace: string; + + /** FileOptions swiftPrefix. */ + public swiftPrefix: string; + + /** FileOptions phpClassPrefix. */ + public phpClassPrefix: string; + + /** FileOptions phpNamespace. */ + public phpNamespace: string; + + /** FileOptions phpMetadataNamespace. */ + public phpMetadataNamespace: string; + + /** FileOptions rubyPackage. */ + public rubyPackage: string; + + /** FileOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** FileOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FileOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FileOptions instance + */ + public static create(properties?: google.protobuf.IFileOptions): google.protobuf.FileOptions; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileOptions; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileOptions; + + /** + * Verifies a FileOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileOptions; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @param message FileOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FileOptions { + + /** OptimizeMode enum. */ + enum OptimizeMode { + SPEED = 1, + CODE_SIZE = 2, + LITE_RUNTIME = 3 + } + } + + /** Properties of a MessageOptions. */ + interface IMessageOptions { + + /** MessageOptions messageSetWireFormat */ + messageSetWireFormat?: (boolean|null); + + /** MessageOptions noStandardDescriptorAccessor */ + noStandardDescriptorAccessor?: (boolean|null); + + /** MessageOptions deprecated */ + deprecated?: (boolean|null); + + /** MessageOptions mapEntry */ + mapEntry?: (boolean|null); + + /** MessageOptions deprecatedLegacyJsonFieldConflicts */ + deprecatedLegacyJsonFieldConflicts?: (boolean|null); + + /** MessageOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** MessageOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MessageOptions .google.api.resource */ + ".google.api.resource"?: (google.api.IResourceDescriptor|null); + } + + /** Represents a MessageOptions. */ + class MessageOptions implements IMessageOptions { + + /** + * Constructs a new MessageOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMessageOptions); + + /** MessageOptions messageSetWireFormat. */ + public messageSetWireFormat: boolean; + + /** MessageOptions noStandardDescriptorAccessor. */ + public noStandardDescriptorAccessor: boolean; + + /** MessageOptions deprecated. */ + public deprecated: boolean; + + /** MessageOptions mapEntry. */ + public mapEntry: boolean; + + /** MessageOptions deprecatedLegacyJsonFieldConflicts. */ + public deprecatedLegacyJsonFieldConflicts: boolean; + + /** MessageOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** MessageOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MessageOptions instance + */ + public static create(properties?: google.protobuf.IMessageOptions): google.protobuf.MessageOptions; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MessageOptions; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MessageOptions; + + /** + * Verifies a MessageOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MessageOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MessageOptions; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @param message MessageOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MessageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MessageOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MessageOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldOptions. */ + interface IFieldOptions { + + /** FieldOptions ctype */ + ctype?: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType|null); + + /** FieldOptions packed */ + packed?: (boolean|null); + + /** FieldOptions jstype */ + jstype?: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType|null); + + /** FieldOptions lazy */ + lazy?: (boolean|null); + + /** FieldOptions unverifiedLazy */ + unverifiedLazy?: (boolean|null); + + /** FieldOptions deprecated */ + deprecated?: (boolean|null); + + /** FieldOptions weak */ + weak?: (boolean|null); + + /** FieldOptions debugRedact */ + debugRedact?: (boolean|null); + + /** FieldOptions retention */ + retention?: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention|null); + + /** FieldOptions targets */ + targets?: (google.protobuf.FieldOptions.OptionTargetType[]|null); + + /** FieldOptions editionDefaults */ + editionDefaults?: (google.protobuf.FieldOptions.IEditionDefault[]|null); + + /** FieldOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** FieldOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FieldOptions .google.api.fieldBehavior */ + ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); + + /** FieldOptions .google.api.resourceReference */ + ".google.api.resourceReference"?: (google.api.IResourceReference|null); + } + + /** Represents a FieldOptions. */ + class FieldOptions implements IFieldOptions { + + /** + * Constructs a new FieldOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldOptions); + + /** FieldOptions ctype. */ + public ctype: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType); + + /** FieldOptions packed. */ + public packed: boolean; + + /** FieldOptions jstype. */ + public jstype: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType); + + /** FieldOptions lazy. */ + public lazy: boolean; + + /** FieldOptions unverifiedLazy. */ + public unverifiedLazy: boolean; + + /** FieldOptions deprecated. */ + public deprecated: boolean; + + /** FieldOptions weak. */ + public weak: boolean; + + /** FieldOptions debugRedact. */ + public debugRedact: boolean; + + /** FieldOptions retention. */ + public retention: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention); + + /** FieldOptions targets. */ + public targets: google.protobuf.FieldOptions.OptionTargetType[]; + + /** FieldOptions editionDefaults. */ + public editionDefaults: google.protobuf.FieldOptions.IEditionDefault[]; + + /** FieldOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** FieldOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldOptions instance + */ + public static create(properties?: google.protobuf.IFieldOptions): google.protobuf.FieldOptions; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions; + + /** + * Verifies a FieldOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @param message FieldOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldOptions { + + /** CType enum. */ + enum CType { + STRING = 0, + CORD = 1, + STRING_PIECE = 2 + } + + /** JSType enum. */ + enum JSType { + JS_NORMAL = 0, + JS_STRING = 1, + JS_NUMBER = 2 + } + + /** OptionRetention enum. */ + enum OptionRetention { + RETENTION_UNKNOWN = 0, + RETENTION_RUNTIME = 1, + RETENTION_SOURCE = 2 + } + + /** OptionTargetType enum. */ + enum OptionTargetType { + TARGET_TYPE_UNKNOWN = 0, + TARGET_TYPE_FILE = 1, + TARGET_TYPE_EXTENSION_RANGE = 2, + TARGET_TYPE_MESSAGE = 3, + TARGET_TYPE_FIELD = 4, + TARGET_TYPE_ONEOF = 5, + TARGET_TYPE_ENUM = 6, + TARGET_TYPE_ENUM_ENTRY = 7, + TARGET_TYPE_SERVICE = 8, + TARGET_TYPE_METHOD = 9 + } + + /** Properties of an EditionDefault. */ + interface IEditionDefault { + + /** EditionDefault edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** EditionDefault value */ + value?: (string|null); + } + + /** Represents an EditionDefault. */ + class EditionDefault implements IEditionDefault { + + /** + * Constructs a new EditionDefault. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FieldOptions.IEditionDefault); + + /** EditionDefault edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** EditionDefault value. */ + public value: string; + + /** + * Creates a new EditionDefault instance using the specified properties. + * @param [properties] Properties to set + * @returns EditionDefault instance + */ + public static create(properties?: google.protobuf.FieldOptions.IEditionDefault): google.protobuf.FieldOptions.EditionDefault; + + /** + * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @param message EditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @param message EditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EditionDefault message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions.EditionDefault; + + /** + * Decodes an EditionDefault message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions.EditionDefault; + + /** + * Verifies an EditionDefault message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EditionDefault + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions.EditionDefault; + + /** + * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. + * @param message EditionDefault + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions.EditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EditionDefault to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EditionDefault + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an OneofOptions. */ + interface IOneofOptions { + + /** OneofOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** OneofOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an OneofOptions. */ + class OneofOptions implements IOneofOptions { + + /** + * Constructs a new OneofOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofOptions); + + /** OneofOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** OneofOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofOptions instance + */ + public static create(properties?: google.protobuf.IOneofOptions): google.protobuf.OneofOptions; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofOptions; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofOptions; + + /** + * Verifies an OneofOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofOptions; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @param message OneofOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneofOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumOptions. */ + interface IEnumOptions { + + /** EnumOptions allowAlias */ + allowAlias?: (boolean|null); + + /** EnumOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumOptions deprecatedLegacyJsonFieldConflicts */ + deprecatedLegacyJsonFieldConflicts?: (boolean|null); + + /** EnumOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** EnumOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumOptions. */ + class EnumOptions implements IEnumOptions { + + /** + * Constructs a new EnumOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumOptions); + + /** EnumOptions allowAlias. */ + public allowAlias: boolean; + + /** EnumOptions deprecated. */ + public deprecated: boolean; + + /** EnumOptions deprecatedLegacyJsonFieldConflicts. */ + public deprecatedLegacyJsonFieldConflicts: boolean; + + /** EnumOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** EnumOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumOptions instance + */ + public static create(properties?: google.protobuf.IEnumOptions): google.protobuf.EnumOptions; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumOptions; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumOptions; + + /** + * Verifies an EnumOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumOptions; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @param message EnumOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumValueOptions. */ + interface IEnumValueOptions { + + /** EnumValueOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumValueOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** EnumValueOptions debugRedact */ + debugRedact?: (boolean|null); + + /** EnumValueOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumValueOptions. */ + class EnumValueOptions implements IEnumValueOptions { + + /** + * Constructs a new EnumValueOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueOptions); + + /** EnumValueOptions deprecated. */ + public deprecated: boolean; + + /** EnumValueOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** EnumValueOptions debugRedact. */ + public debugRedact: boolean; + + /** EnumValueOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueOptions instance + */ + public static create(properties?: google.protobuf.IEnumValueOptions): google.protobuf.EnumValueOptions; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueOptions; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueOptions; + + /** + * Verifies an EnumValueOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueOptions; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @param message EnumValueOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceOptions. */ + interface IServiceOptions { + + /** ServiceOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** ServiceOptions deprecated */ + deprecated?: (boolean|null); + + /** ServiceOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** ServiceOptions .google.api.defaultHost */ + ".google.api.defaultHost"?: (string|null); + + /** ServiceOptions .google.api.oauthScopes */ + ".google.api.oauthScopes"?: (string|null); + + /** ServiceOptions .google.api.apiVersion */ + ".google.api.apiVersion"?: (string|null); + } + + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { + + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceOptions); + + /** ServiceOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** ServiceOptions deprecated. */ + public deprecated: boolean; + + /** ServiceOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceOptions instance + */ + public static create(properties?: google.protobuf.IServiceOptions): google.protobuf.ServiceOptions; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceOptions; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceOptions; + + /** + * Verifies a ServiceOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @param message ServiceOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodOptions. */ + interface IMethodOptions { + + /** MethodOptions deprecated */ + deprecated?: (boolean|null); + + /** MethodOptions idempotencyLevel */ + idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); + + /** MethodOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** MethodOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MethodOptions .google.api.http */ + ".google.api.http"?: (google.api.IHttpRule|null); + + /** MethodOptions .google.api.methodSignature */ + ".google.api.methodSignature"?: (string[]|null); + + /** MethodOptions .google.longrunning.operationInfo */ + ".google.longrunning.operationInfo"?: (google.longrunning.IOperationInfo|null); + } + + /** Represents a MethodOptions. */ + class MethodOptions implements IMethodOptions { + + /** + * Constructs a new MethodOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodOptions); + + /** MethodOptions deprecated. */ + public deprecated: boolean; + + /** MethodOptions idempotencyLevel. */ + public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); + + /** MethodOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** MethodOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodOptions instance + */ + public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodOptions; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodOptions; + + /** + * Verifies a MethodOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @param message MethodOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MethodOptions { + + /** IdempotencyLevel enum. */ + enum IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0, + NO_SIDE_EFFECTS = 1, + IDEMPOTENT = 2 + } + } + + /** Properties of an UninterpretedOption. */ + interface IUninterpretedOption { + + /** UninterpretedOption name */ + name?: (google.protobuf.UninterpretedOption.INamePart[]|null); + + /** UninterpretedOption identifierValue */ + identifierValue?: (string|null); + + /** UninterpretedOption positiveIntValue */ + positiveIntValue?: (number|Long|string|null); + + /** UninterpretedOption negativeIntValue */ + negativeIntValue?: (number|Long|string|null); + + /** UninterpretedOption doubleValue */ + doubleValue?: (number|null); + + /** UninterpretedOption stringValue */ + stringValue?: (Uint8Array|Buffer|string|null); + + /** UninterpretedOption aggregateValue */ + aggregateValue?: (string|null); + } + + /** Represents an UninterpretedOption. */ + class UninterpretedOption implements IUninterpretedOption { + + /** + * Constructs a new UninterpretedOption. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUninterpretedOption); + + /** UninterpretedOption name. */ + public name: google.protobuf.UninterpretedOption.INamePart[]; + + /** UninterpretedOption identifierValue. */ + public identifierValue: string; + + /** UninterpretedOption positiveIntValue. */ + public positiveIntValue: (number|Long|string); + + /** UninterpretedOption negativeIntValue. */ + public negativeIntValue: (number|Long|string); + + /** UninterpretedOption doubleValue. */ + public doubleValue: number; + + /** UninterpretedOption stringValue. */ + public stringValue: (Uint8Array|Buffer|string); + + /** UninterpretedOption aggregateValue. */ + public aggregateValue: string; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @param [properties] Properties to set + * @returns UninterpretedOption instance + */ + public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption; + + /** + * Verifies an UninterpretedOption message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UninterpretedOption + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @param message UninterpretedOption + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UninterpretedOption to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UninterpretedOption + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace UninterpretedOption { + + /** Properties of a NamePart. */ + interface INamePart { + + /** NamePart namePart */ + namePart: string; + + /** NamePart isExtension */ + isExtension: boolean; + } + + /** Represents a NamePart. */ + class NamePart implements INamePart { + + /** + * Constructs a new NamePart. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.UninterpretedOption.INamePart); + + /** NamePart namePart. */ + public namePart: string; + + /** NamePart isExtension. */ + public isExtension: boolean; + + /** + * Creates a new NamePart instance using the specified properties. + * @param [properties] Properties to set + * @returns NamePart instance + */ + public static create(properties?: google.protobuf.UninterpretedOption.INamePart): google.protobuf.UninterpretedOption.NamePart; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption.NamePart; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption.NamePart; + + /** + * Verifies a NamePart message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NamePart + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @param message NamePart + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NamePart to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NamePart + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a FeatureSet. */ + interface IFeatureSet { + + /** FeatureSet fieldPresence */ + fieldPresence?: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence|null); + + /** FeatureSet enumType */ + enumType?: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType|null); + + /** FeatureSet repeatedFieldEncoding */ + repeatedFieldEncoding?: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding|null); + + /** FeatureSet utf8Validation */ + utf8Validation?: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation|null); + + /** FeatureSet messageEncoding */ + messageEncoding?: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding|null); + + /** FeatureSet jsonFormat */ + jsonFormat?: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat|null); + } + + /** Represents a FeatureSet. */ + class FeatureSet implements IFeatureSet { + + /** + * Constructs a new FeatureSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFeatureSet); + + /** FeatureSet fieldPresence. */ + public fieldPresence: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence); + + /** FeatureSet enumType. */ + public enumType: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType); + + /** FeatureSet repeatedFieldEncoding. */ + public repeatedFieldEncoding: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding); + + /** FeatureSet utf8Validation. */ + public utf8Validation: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation); + + /** FeatureSet messageEncoding. */ + public messageEncoding: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding); + + /** FeatureSet jsonFormat. */ + public jsonFormat: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat); + + /** + * Creates a new FeatureSet instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSet instance + */ + public static create(properties?: google.protobuf.IFeatureSet): google.protobuf.FeatureSet; + + /** + * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @param message FeatureSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @param message FeatureSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSet; + + /** + * Decodes a FeatureSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSet; + + /** + * Verifies a FeatureSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSet + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSet; + + /** + * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. + * @param message FeatureSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FeatureSet { + + /** FieldPresence enum. */ + enum FieldPresence { + FIELD_PRESENCE_UNKNOWN = 0, + EXPLICIT = 1, + IMPLICIT = 2, + LEGACY_REQUIRED = 3 + } + + /** EnumType enum. */ + enum EnumType { + ENUM_TYPE_UNKNOWN = 0, + OPEN = 1, + CLOSED = 2 + } + + /** RepeatedFieldEncoding enum. */ + enum RepeatedFieldEncoding { + REPEATED_FIELD_ENCODING_UNKNOWN = 0, + PACKED = 1, + EXPANDED = 2 + } + + /** Utf8Validation enum. */ + enum Utf8Validation { + UTF8_VALIDATION_UNKNOWN = 0, + VERIFY = 2, + NONE = 3 + } + + /** MessageEncoding enum. */ + enum MessageEncoding { + MESSAGE_ENCODING_UNKNOWN = 0, + LENGTH_PREFIXED = 1, + DELIMITED = 2 + } + + /** JsonFormat enum. */ + enum JsonFormat { + JSON_FORMAT_UNKNOWN = 0, + ALLOW = 1, + LEGACY_BEST_EFFORT = 2 + } + } + + /** Properties of a FeatureSetDefaults. */ + interface IFeatureSetDefaults { + + /** FeatureSetDefaults defaults */ + defaults?: (google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]|null); + + /** FeatureSetDefaults minimumEdition */ + minimumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSetDefaults maximumEdition */ + maximumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + } + + /** Represents a FeatureSetDefaults. */ + class FeatureSetDefaults implements IFeatureSetDefaults { + + /** + * Constructs a new FeatureSetDefaults. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFeatureSetDefaults); + + /** FeatureSetDefaults defaults. */ + public defaults: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]; + + /** FeatureSetDefaults minimumEdition. */ + public minimumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSetDefaults maximumEdition. */ + public maximumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** + * Creates a new FeatureSetDefaults instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSetDefaults instance + */ + public static create(properties?: google.protobuf.IFeatureSetDefaults): google.protobuf.FeatureSetDefaults; + + /** + * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @param message FeatureSetDefaults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @param message FeatureSetDefaults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSetDefaults; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSetDefaults; + + /** + * Verifies a FeatureSetDefaults message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSetDefaults + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults; + + /** + * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. + * @param message FeatureSetDefaults + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSetDefaults, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSetDefaults to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSetDefaults + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FeatureSetDefaults { + + /** Properties of a FeatureSetEditionDefault. */ + interface IFeatureSetEditionDefault { + + /** FeatureSetEditionDefault edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSetEditionDefault features */ + features?: (google.protobuf.IFeatureSet|null); + } + + /** Represents a FeatureSetEditionDefault. */ + class FeatureSetEditionDefault implements IFeatureSetEditionDefault { + + /** + * Constructs a new FeatureSetEditionDefault. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault); + + /** FeatureSetEditionDefault edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSetEditionDefault features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** + * Creates a new FeatureSetEditionDefault instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSetEditionDefault instance + */ + public static create(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @param message FeatureSetEditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @param message FeatureSetEditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Verifies a FeatureSetEditionDefault message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSetEditionDefault + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. + * @param message FeatureSetEditionDefault + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSetEditionDefault to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSetEditionDefault + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a SourceCodeInfo. */ + interface ISourceCodeInfo { + + /** SourceCodeInfo location */ + location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); + } + + /** Represents a SourceCodeInfo. */ + class SourceCodeInfo implements ISourceCodeInfo { + + /** + * Constructs a new SourceCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ISourceCodeInfo); + + /** SourceCodeInfo location. */ + public location: google.protobuf.SourceCodeInfo.ILocation[]; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns SourceCodeInfo instance + */ + public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo; + + /** + * Verifies a SourceCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SourceCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @param message SourceCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SourceCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SourceCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SourceCodeInfo { + + /** Properties of a Location. */ + interface ILocation { + + /** Location path */ + path?: (number[]|null); + + /** Location span */ + span?: (number[]|null); + + /** Location leadingComments */ + leadingComments?: (string|null); + + /** Location trailingComments */ + trailingComments?: (string|null); + + /** Location leadingDetachedComments */ + leadingDetachedComments?: (string[]|null); + } + + /** Represents a Location. */ + class Location implements ILocation { + + /** + * Constructs a new Location. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); + + /** Location path. */ + public path: number[]; + + /** Location span. */ + public span: number[]; + + /** Location leadingComments. */ + public leadingComments: string; + + /** Location trailingComments. */ + public trailingComments: string; + + /** Location leadingDetachedComments. */ + public leadingDetachedComments: string[]; + + /** + * Creates a new Location instance using the specified properties. + * @param [properties] Properties to set + * @returns Location instance + */ + public static create(properties?: google.protobuf.SourceCodeInfo.ILocation): google.protobuf.SourceCodeInfo.Location; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Location message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo.Location; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo.Location; + + /** + * Verifies a Location message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Location + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @param message Location + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Location to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Location + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a GeneratedCodeInfo. */ + interface IGeneratedCodeInfo { + + /** GeneratedCodeInfo annotation */ + annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); + } + + /** Represents a GeneratedCodeInfo. */ + class GeneratedCodeInfo implements IGeneratedCodeInfo { + + /** + * Constructs a new GeneratedCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IGeneratedCodeInfo); + + /** GeneratedCodeInfo annotation. */ + public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns GeneratedCodeInfo instance + */ + public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo; + + /** + * Verifies a GeneratedCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GeneratedCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @param message GeneratedCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GeneratedCodeInfo { + + /** Properties of an Annotation. */ + interface IAnnotation { + + /** Annotation path */ + path?: (number[]|null); + + /** Annotation sourceFile */ + sourceFile?: (string|null); + + /** Annotation begin */ + begin?: (number|null); + + /** Annotation end */ + end?: (number|null); + + /** Annotation semantic */ + semantic?: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null); + } + + /** Represents an Annotation. */ + class Annotation implements IAnnotation { + + /** + * Constructs a new Annotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); + + /** Annotation path. */ + public path: number[]; + + /** Annotation sourceFile. */ + public sourceFile: string; + + /** Annotation begin. */ + public begin: number; + + /** Annotation end. */ + public end: number; + + /** Annotation semantic. */ + public semantic: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic); + + /** + * Creates a new Annotation instance using the specified properties. + * @param [properties] Properties to set + * @returns Annotation instance + */ + public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Verifies an Annotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Annotation + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @param message Annotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Annotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Annotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Annotation { + + /** Semantic enum. */ + enum Semantic { + NONE = 0, + SET = 1, + ALIAS = 2 + } + } + } + + /** Properties of a Duration. */ + interface IDuration { + + /** Duration seconds */ + seconds?: (number|Long|string|null); + + /** Duration nanos */ + nanos?: (number|null); + } + + /** Represents a Duration. */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDuration); + + /** Duration seconds. */ + public seconds: (number|Long|string); + + /** Duration nanos. */ + public nanos: number; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: google.protobuf.IDuration): google.protobuf.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Duration; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Duration; + + /** + * Verifies a Duration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Duration + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @param message Duration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Duration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Any. */ + interface IAny { + + /** Any type_url */ + type_url?: (string|null); + + /** Any value */ + value?: (Uint8Array|Buffer|string|null); + } + + /** Represents an Any. */ + class Any implements IAny { + + /** + * Constructs a new Any. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IAny); + + /** Any type_url. */ + public type_url: string; + + /** Any value. */ + public value: (Uint8Array|Buffer|string); + + /** + * Creates a new Any instance using the specified properties. + * @param [properties] Properties to set + * @returns Any instance + */ + public static create(properties?: google.protobuf.IAny): google.protobuf.Any; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Any message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Any; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Any; + + /** + * Verifies an Any message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Any + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Any; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @param message Any + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Any, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Any to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Any + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Empty. */ + interface IEmpty { + } + + /** Represents an Empty. */ + class Empty implements IEmpty { + + /** + * Constructs a new Empty. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEmpty); + + /** + * Creates a new Empty instance using the specified properties. + * @param [properties] Properties to set + * @returns Empty instance + */ + public static create(properties?: google.protobuf.IEmpty): google.protobuf.Empty; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Empty; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Empty; + + /** + * Verifies an Empty message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Empty + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Empty; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @param message Empty + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Empty to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Empty + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldMask. */ + interface IFieldMask { + + /** FieldMask paths */ + paths?: (string[]|null); + } + + /** Represents a FieldMask. */ + class FieldMask implements IFieldMask { + + /** + * Constructs a new FieldMask. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldMask); + + /** FieldMask paths. */ + public paths: string[]; + + /** + * Creates a new FieldMask instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldMask instance + */ + public static create(properties?: google.protobuf.IFieldMask): google.protobuf.FieldMask; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldMask; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldMask; + + /** + * Verifies a FieldMask message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldMask + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldMask; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @param message FieldMask + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldMask, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldMask to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldMask + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** Timestamp seconds */ + seconds?: (number|Long|string|null); + + /** Timestamp nanos */ + nanos?: (number|null); + } + + /** Represents a Timestamp. */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ITimestamp); + + /** Timestamp seconds. */ + public seconds: (number|Long|string); + + /** Timestamp nanos. */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Timestamp; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Timestamp; + + /** + * Verifies a Timestamp message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Timestamp + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @param message Timestamp + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Timestamp to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Struct. */ + interface IStruct { + + /** Struct fields */ + fields?: ({ [k: string]: google.protobuf.IValue }|null); + } + + /** Represents a Struct. */ + class Struct implements IStruct { + + /** + * Constructs a new Struct. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IStruct); + + /** Struct fields. */ + public fields: { [k: string]: google.protobuf.IValue }; + + /** + * Creates a new Struct instance using the specified properties. + * @param [properties] Properties to set + * @returns Struct instance + */ + public static create(properties?: google.protobuf.IStruct): google.protobuf.Struct; + + /** + * Encodes the specified Struct message. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @param message Struct message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IStruct, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Struct message, length delimited. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @param message Struct message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IStruct, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Struct message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Struct; + + /** + * Decodes a Struct message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Struct; + + /** + * Verifies a Struct message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Struct message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Struct + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Struct; + + /** + * Creates a plain object from a Struct message. Also converts values to other types if specified. + * @param message Struct + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Struct, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Struct to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Struct + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Value. */ + interface IValue { + + /** Value nullValue */ + nullValue?: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue|null); + + /** Value numberValue */ + numberValue?: (number|null); + + /** Value stringValue */ + stringValue?: (string|null); + + /** Value boolValue */ + boolValue?: (boolean|null); + + /** Value structValue */ + structValue?: (google.protobuf.IStruct|null); + + /** Value listValue */ + listValue?: (google.protobuf.IListValue|null); + } + + /** Represents a Value. */ + class Value implements IValue { + + /** + * Constructs a new Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IValue); + + /** Value nullValue. */ + public nullValue?: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue|null); + + /** Value numberValue. */ + public numberValue?: (number|null); + + /** Value stringValue. */ + public stringValue?: (string|null); + + /** Value boolValue. */ + public boolValue?: (boolean|null); + + /** Value structValue. */ + public structValue?: (google.protobuf.IStruct|null); + + /** Value listValue. */ + public listValue?: (google.protobuf.IListValue|null); + + /** Value kind. */ + public kind?: ("nullValue"|"numberValue"|"stringValue"|"boolValue"|"structValue"|"listValue"); + + /** + * Creates a new Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Value instance + */ + public static create(properties?: google.protobuf.IValue): google.protobuf.Value; + + /** + * Encodes the specified Value message. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @param message Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Value message, length delimited. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @param message Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Value; + + /** + * Decodes a Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Value; + + /** + * Verifies a Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Value; + + /** + * Creates a plain object from a Value message. Also converts values to other types if specified. + * @param message Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** NullValue enum. */ + enum NullValue { + NULL_VALUE = 0 + } + + /** Properties of a ListValue. */ + interface IListValue { + + /** ListValue values */ + values?: (google.protobuf.IValue[]|null); + } + + /** Represents a ListValue. */ + class ListValue implements IListValue { + + /** + * Constructs a new ListValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IListValue); + + /** ListValue values. */ + public values: google.protobuf.IValue[]; + + /** + * Creates a new ListValue instance using the specified properties. + * @param [properties] Properties to set + * @returns ListValue instance + */ + public static create(properties?: google.protobuf.IListValue): google.protobuf.ListValue; + + /** + * Encodes the specified ListValue message. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @param message ListValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IListValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListValue message, length delimited. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @param message ListValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IListValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListValue + * @throws {Error} If the payload is not 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.ListValue; + + /** + * Decodes a ListValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListValue + * @throws {Error} If the payload 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.ListValue; + + /** + * Verifies a ListValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ListValue; + + /** + * Creates a plain object from a ListValue message. Also converts values to other types if specified. + * @param message ListValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ListValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace longrunning. */ + namespace longrunning { + + /** Represents an Operations */ + class Operations extends $protobuf.rpc.Service { + + /** + * Constructs a new Operations service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Operations service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Operations; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListOperationsResponse + */ + public listOperations(request: google.longrunning.IListOperationsRequest, callback: google.longrunning.Operations.ListOperationsCallback): void; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @returns Promise + */ + public listOperations(request: google.longrunning.IListOperationsRequest): Promise; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public getOperation(request: google.longrunning.IGetOperationRequest, callback: google.longrunning.Operations.GetOperationCallback): void; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @returns Promise + */ + public getOperation(request: google.longrunning.IGetOperationRequest): Promise; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest, callback: google.longrunning.Operations.DeleteOperationCallback): void; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @returns Promise + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest): Promise; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest, callback: google.longrunning.Operations.CancelOperationCallback): void; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @returns Promise + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest): Promise; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest, callback: google.longrunning.Operations.WaitOperationCallback): void; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @returns Promise + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest): Promise; + } + + namespace Operations { + + /** + * Callback as used by {@link google.longrunning.Operations|listOperations}. + * @param error Error, if any + * @param [response] ListOperationsResponse + */ + type ListOperationsCallback = (error: (Error|null), response?: google.longrunning.ListOperationsResponse) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|getOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type GetOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type CancelOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|waitOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type WaitOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of an Operation. */ + interface IOperation { + + /** Operation name */ + name?: (string|null); + + /** Operation metadata */ + metadata?: (google.protobuf.IAny|null); + + /** Operation done */ + done?: (boolean|null); + + /** Operation error */ + error?: (google.rpc.IStatus|null); + + /** Operation response */ + response?: (google.protobuf.IAny|null); + } + + /** Represents an Operation. */ + class Operation implements IOperation { + + /** + * Constructs a new Operation. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperation); + + /** Operation name. */ + public name: string; + + /** Operation metadata. */ + public metadata?: (google.protobuf.IAny|null); + + /** Operation done. */ + public done: boolean; + + /** Operation error. */ + public error?: (google.rpc.IStatus|null); + + /** Operation response. */ + public response?: (google.protobuf.IAny|null); + + /** Operation result. */ + public result?: ("error"|"response"); + + /** + * Creates a new Operation instance using the specified properties. + * @param [properties] Properties to set + * @returns Operation instance + */ + public static create(properties?: google.longrunning.IOperation): google.longrunning.Operation; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.Operation; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.Operation; + + /** + * Verifies an Operation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Operation + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.Operation; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @param message Operation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.Operation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Operation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Operation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetOperationRequest. */ + interface IGetOperationRequest { + + /** GetOperationRequest name */ + name?: (string|null); + } + + /** Represents a GetOperationRequest. */ + class GetOperationRequest implements IGetOperationRequest { + + /** + * Constructs a new GetOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IGetOperationRequest); + + /** GetOperationRequest name. */ + public name: string; + + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetOperationRequest instance + */ + public static create(properties?: google.longrunning.IGetOperationRequest): google.longrunning.GetOperationRequest; + + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.GetOperationRequest; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.GetOperationRequest; + + /** + * Verifies a GetOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.GetOperationRequest; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @param message GetOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.GetOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOperationsRequest. */ + interface IListOperationsRequest { + + /** ListOperationsRequest name */ + name?: (string|null); + + /** ListOperationsRequest filter */ + filter?: (string|null); + + /** ListOperationsRequest pageSize */ + pageSize?: (number|null); + + /** ListOperationsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListOperationsRequest. */ + class ListOperationsRequest implements IListOperationsRequest { + + /** + * Constructs a new ListOperationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsRequest); + + /** ListOperationsRequest name. */ + public name: string; + + /** ListOperationsRequest filter. */ + public filter: string; + + /** ListOperationsRequest pageSize. */ + public pageSize: number; + + /** ListOperationsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsRequest instance + */ + public static create(properties?: google.longrunning.IListOperationsRequest): google.longrunning.ListOperationsRequest; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsRequest; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsRequest; + + /** + * Verifies a ListOperationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsRequest; + + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @param message ListOperationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOperationsResponse. */ + interface IListOperationsResponse { + + /** ListOperationsResponse operations */ + operations?: (google.longrunning.IOperation[]|null); + + /** ListOperationsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListOperationsResponse. */ + class ListOperationsResponse implements IListOperationsResponse { + + /** + * Constructs a new ListOperationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsResponse); + + /** ListOperationsResponse operations. */ + public operations: google.longrunning.IOperation[]; + + /** ListOperationsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsResponse instance + */ + public static create(properties?: google.longrunning.IListOperationsResponse): google.longrunning.ListOperationsResponse; + + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsResponse; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsResponse; + + /** + * Verifies a ListOperationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsResponse; + + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @param message ListOperationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CancelOperationRequest. */ + interface ICancelOperationRequest { + + /** CancelOperationRequest name */ + name?: (string|null); + } + + /** Represents a CancelOperationRequest. */ + class CancelOperationRequest implements ICancelOperationRequest { + + /** + * Constructs a new CancelOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.ICancelOperationRequest); + + /** CancelOperationRequest name. */ + public name: string; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CancelOperationRequest instance + */ + public static create(properties?: google.longrunning.ICancelOperationRequest): google.longrunning.CancelOperationRequest; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.CancelOperationRequest; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.CancelOperationRequest; + + /** + * Verifies a CancelOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CancelOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.CancelOperationRequest; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @param message CancelOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.CancelOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CancelOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CancelOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteOperationRequest. */ + interface IDeleteOperationRequest { + + /** DeleteOperationRequest name */ + name?: (string|null); + } + + /** Represents a DeleteOperationRequest. */ + class DeleteOperationRequest implements IDeleteOperationRequest { + + /** + * Constructs a new DeleteOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IDeleteOperationRequest); + + /** DeleteOperationRequest name. */ + public name: string; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteOperationRequest instance + */ + public static create(properties?: google.longrunning.IDeleteOperationRequest): google.longrunning.DeleteOperationRequest; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.DeleteOperationRequest; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.DeleteOperationRequest; + + /** + * Verifies a DeleteOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.DeleteOperationRequest; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @param message DeleteOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.DeleteOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WaitOperationRequest. */ + interface IWaitOperationRequest { + + /** WaitOperationRequest name */ + name?: (string|null); + + /** WaitOperationRequest timeout */ + timeout?: (google.protobuf.IDuration|null); + } + + /** Represents a WaitOperationRequest. */ + class WaitOperationRequest implements IWaitOperationRequest { + + /** + * Constructs a new WaitOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IWaitOperationRequest); + + /** WaitOperationRequest name. */ + public name: string; + + /** WaitOperationRequest timeout. */ + public timeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns WaitOperationRequest instance + */ + public static create(properties?: google.longrunning.IWaitOperationRequest): google.longrunning.WaitOperationRequest; + + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.WaitOperationRequest; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.WaitOperationRequest; + + /** + * Verifies a WaitOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WaitOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.WaitOperationRequest; + + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @param message WaitOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.WaitOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WaitOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WaitOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OperationInfo. */ + interface IOperationInfo { + + /** OperationInfo responseType */ + responseType?: (string|null); + + /** OperationInfo metadataType */ + metadataType?: (string|null); + } + + /** Represents an OperationInfo. */ + class OperationInfo implements IOperationInfo { + + /** + * Constructs a new OperationInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperationInfo); + + /** OperationInfo responseType. */ + public responseType: string; + + /** OperationInfo metadataType. */ + public metadataType: string; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationInfo instance + */ + public static create(properties?: google.longrunning.IOperationInfo): google.longrunning.OperationInfo; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.OperationInfo; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.OperationInfo; + + /** + * Verifies an OperationInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationInfo + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.OperationInfo; + + /** + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @param message OperationInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.OperationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OperationInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace rpc. */ + namespace rpc { + + /** Properties of a Status. */ + interface IStatus { + + /** Status code */ + code?: (number|null); + + /** Status message */ + message?: (string|null); + + /** Status details */ + details?: (google.protobuf.IAny[]|null); + } + + /** Represents a Status. */ + class Status implements IStatus { + + /** + * Constructs a new Status. + * @param [properties] Properties to set + */ + constructor(properties?: google.rpc.IStatus); + + /** Status code. */ + public code: number; + + /** Status message. */ + public message: string; + + /** Status details. */ + public details: google.protobuf.IAny[]; + + /** + * Creates a new Status instance using the specified properties. + * @param [properties] Properties to set + * @returns Status instance + */ + public static create(properties?: google.rpc.IStatus): google.rpc.Status; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Status message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.rpc.Status; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.rpc.Status; + + /** + * Verifies a Status message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Status + */ + public static fromObject(object: { [k: string]: any }): google.rpc.Status; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @param message Status + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.rpc.Status, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Status to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Status + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace iam. */ + namespace iam { + + /** Namespace v1. */ + namespace v1 { + + /** Represents a IAMPolicy */ + class IAMPolicy extends $protobuf.rpc.Service { + + /** + * Constructs a new IAMPolicy service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new IAMPolicy service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): IAMPolicy; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest, callback: google.iam.v1.IAMPolicy.SetIamPolicyCallback): void; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @returns Promise + */ + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest): Promise; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest, callback: google.iam.v1.IAMPolicy.GetIamPolicyCallback): void; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @returns Promise + */ + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest): Promise; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + */ + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest, callback: google.iam.v1.IAMPolicy.TestIamPermissionsCallback): void; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @returns Promise + */ + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest): Promise; + } + + namespace IAMPolicy { + + /** + * Callback as used by {@link google.iam.v1.IAMPolicy|setIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type SetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + + /** + * Callback as used by {@link google.iam.v1.IAMPolicy|getIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type GetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + + /** + * Callback as used by {@link google.iam.v1.IAMPolicy|testIamPermissions}. + * @param error Error, if any + * @param [response] TestIamPermissionsResponse + */ + type TestIamPermissionsCallback = (error: (Error|null), response?: google.iam.v1.TestIamPermissionsResponse) => void; + } + + /** Properties of a SetIamPolicyRequest. */ + interface ISetIamPolicyRequest { + + /** SetIamPolicyRequest resource */ + resource?: (string|null); + + /** SetIamPolicyRequest policy */ + policy?: (google.iam.v1.IPolicy|null); + + /** SetIamPolicyRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents a SetIamPolicyRequest. */ + class SetIamPolicyRequest implements ISetIamPolicyRequest { + + /** + * Constructs a new SetIamPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.ISetIamPolicyRequest); + + /** SetIamPolicyRequest resource. */ + public resource: string; + + /** SetIamPolicyRequest policy. */ + public policy?: (google.iam.v1.IPolicy|null); + + /** SetIamPolicyRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new SetIamPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SetIamPolicyRequest instance + */ + public static create(properties?: google.iam.v1.ISetIamPolicyRequest): google.iam.v1.SetIamPolicyRequest; + + /** + * Encodes the specified SetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. + * @param message SetIamPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.ISetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. + * @param message SetIamPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.ISetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetIamPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.SetIamPolicyRequest; + + /** + * Decodes a SetIamPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.SetIamPolicyRequest; + + /** + * Verifies a SetIamPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetIamPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.SetIamPolicyRequest; + + /** + * Creates a plain object from a SetIamPolicyRequest message. Also converts values to other types if specified. + * @param message SetIamPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.SetIamPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetIamPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SetIamPolicyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetIamPolicyRequest. */ + interface IGetIamPolicyRequest { + + /** GetIamPolicyRequest resource */ + resource?: (string|null); + + /** GetIamPolicyRequest options */ + options?: (google.iam.v1.IGetPolicyOptions|null); + } + + /** Represents a GetIamPolicyRequest. */ + class GetIamPolicyRequest implements IGetIamPolicyRequest { + + /** + * Constructs a new GetIamPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IGetIamPolicyRequest); + + /** GetIamPolicyRequest resource. */ + public resource: string; + + /** GetIamPolicyRequest options. */ + public options?: (google.iam.v1.IGetPolicyOptions|null); + + /** + * Creates a new GetIamPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetIamPolicyRequest instance + */ + public static create(properties?: google.iam.v1.IGetIamPolicyRequest): google.iam.v1.GetIamPolicyRequest; + + /** + * Encodes the specified GetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. + * @param message GetIamPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IGetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. + * @param message GetIamPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IGetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetIamPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.GetIamPolicyRequest; + + /** + * Decodes a GetIamPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.GetIamPolicyRequest; + + /** + * Verifies a GetIamPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetIamPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.GetIamPolicyRequest; + + /** + * Creates a plain object from a GetIamPolicyRequest message. Also converts values to other types if specified. + * @param message GetIamPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.GetIamPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetIamPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetIamPolicyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TestIamPermissionsRequest. */ + interface ITestIamPermissionsRequest { + + /** TestIamPermissionsRequest resource */ + resource?: (string|null); + + /** TestIamPermissionsRequest permissions */ + permissions?: (string[]|null); + } + + /** Represents a TestIamPermissionsRequest. */ + class TestIamPermissionsRequest implements ITestIamPermissionsRequest { + + /** + * Constructs a new TestIamPermissionsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.ITestIamPermissionsRequest); + + /** TestIamPermissionsRequest resource. */ + public resource: string; + + /** TestIamPermissionsRequest permissions. */ + public permissions: string[]; + + /** + * Creates a new TestIamPermissionsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns TestIamPermissionsRequest instance + */ + public static create(properties?: google.iam.v1.ITestIamPermissionsRequest): google.iam.v1.TestIamPermissionsRequest; + + /** + * Encodes the specified TestIamPermissionsRequest message. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. + * @param message TestIamPermissionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.ITestIamPermissionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TestIamPermissionsRequest message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. + * @param message TestIamPermissionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.ITestIamPermissionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TestIamPermissionsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TestIamPermissionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.TestIamPermissionsRequest; + + /** + * Decodes a TestIamPermissionsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TestIamPermissionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.TestIamPermissionsRequest; + + /** + * Verifies a TestIamPermissionsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TestIamPermissionsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TestIamPermissionsRequest + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.TestIamPermissionsRequest; + + /** + * Creates a plain object from a TestIamPermissionsRequest message. Also converts values to other types if specified. + * @param message TestIamPermissionsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.TestIamPermissionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TestIamPermissionsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TestIamPermissionsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TestIamPermissionsResponse. */ + interface ITestIamPermissionsResponse { + + /** TestIamPermissionsResponse permissions */ + permissions?: (string[]|null); + } + + /** Represents a TestIamPermissionsResponse. */ + class TestIamPermissionsResponse implements ITestIamPermissionsResponse { + + /** + * Constructs a new TestIamPermissionsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.ITestIamPermissionsResponse); + + /** TestIamPermissionsResponse permissions. */ + public permissions: string[]; + + /** + * Creates a new TestIamPermissionsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns TestIamPermissionsResponse instance + */ + public static create(properties?: google.iam.v1.ITestIamPermissionsResponse): google.iam.v1.TestIamPermissionsResponse; + + /** + * Encodes the specified TestIamPermissionsResponse message. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. + * @param message TestIamPermissionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.ITestIamPermissionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TestIamPermissionsResponse message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. + * @param message TestIamPermissionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.ITestIamPermissionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TestIamPermissionsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TestIamPermissionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.TestIamPermissionsResponse; + + /** + * Decodes a TestIamPermissionsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TestIamPermissionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.TestIamPermissionsResponse; + + /** + * Verifies a TestIamPermissionsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TestIamPermissionsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TestIamPermissionsResponse + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.TestIamPermissionsResponse; + + /** + * Creates a plain object from a TestIamPermissionsResponse message. Also converts values to other types if specified. + * @param message TestIamPermissionsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.TestIamPermissionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TestIamPermissionsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TestIamPermissionsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetPolicyOptions. */ + interface IGetPolicyOptions { + + /** GetPolicyOptions requestedPolicyVersion */ + requestedPolicyVersion?: (number|null); + } + + /** Represents a GetPolicyOptions. */ + class GetPolicyOptions implements IGetPolicyOptions { + + /** + * Constructs a new GetPolicyOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IGetPolicyOptions); + + /** GetPolicyOptions requestedPolicyVersion. */ + public requestedPolicyVersion: number; + + /** + * Creates a new GetPolicyOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns GetPolicyOptions instance + */ + public static create(properties?: google.iam.v1.IGetPolicyOptions): google.iam.v1.GetPolicyOptions; + + /** + * Encodes the specified GetPolicyOptions message. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages. + * @param message GetPolicyOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IGetPolicyOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetPolicyOptions message, length delimited. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages. + * @param message GetPolicyOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IGetPolicyOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetPolicyOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetPolicyOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.GetPolicyOptions; + + /** + * Decodes a GetPolicyOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetPolicyOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.GetPolicyOptions; + + /** + * Verifies a GetPolicyOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetPolicyOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetPolicyOptions + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.GetPolicyOptions; + + /** + * Creates a plain object from a GetPolicyOptions message. Also converts values to other types if specified. + * @param message GetPolicyOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.GetPolicyOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetPolicyOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetPolicyOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Policy. */ + interface IPolicy { + + /** Policy version */ + version?: (number|null); + + /** Policy bindings */ + bindings?: (google.iam.v1.IBinding[]|null); + + /** Policy auditConfigs */ + auditConfigs?: (google.iam.v1.IAuditConfig[]|null); + + /** Policy etag */ + etag?: (Uint8Array|Buffer|string|null); + } + + /** Represents a Policy. */ + class Policy implements IPolicy { + + /** + * Constructs a new Policy. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IPolicy); + + /** Policy version. */ + public version: number; + + /** Policy bindings. */ + public bindings: google.iam.v1.IBinding[]; + + /** Policy auditConfigs. */ + public auditConfigs: google.iam.v1.IAuditConfig[]; + + /** Policy etag. */ + public etag: (Uint8Array|Buffer|string); + + /** + * Creates a new Policy instance using the specified properties. + * @param [properties] Properties to set + * @returns Policy instance + */ + public static create(properties?: google.iam.v1.IPolicy): google.iam.v1.Policy; + + /** + * Encodes the specified Policy message. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @param message Policy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Policy message, length delimited. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @param message Policy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Policy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.Policy; + + /** + * Decodes a Policy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.Policy; + + /** + * Verifies a Policy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Policy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Policy + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.Policy; + + /** + * Creates a plain object from a Policy message. Also converts values to other types if specified. + * @param message Policy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.Policy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Policy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Policy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Binding. */ + interface IBinding { + + /** Binding role */ + role?: (string|null); + + /** Binding members */ + members?: (string[]|null); + + /** Binding condition */ + condition?: (google.type.IExpr|null); + } + + /** Represents a Binding. */ + class Binding implements IBinding { + + /** + * Constructs a new Binding. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IBinding); + + /** Binding role. */ + public role: string; + + /** Binding members. */ + public members: string[]; + + /** Binding condition. */ + public condition?: (google.type.IExpr|null); + + /** + * Creates a new Binding instance using the specified properties. + * @param [properties] Properties to set + * @returns Binding instance + */ + public static create(properties?: google.iam.v1.IBinding): google.iam.v1.Binding; + + /** + * Encodes the specified Binding message. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @param message Binding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IBinding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Binding message, length delimited. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @param message Binding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IBinding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Binding message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Binding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.Binding; + + /** + * Decodes a Binding message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Binding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.Binding; + + /** + * Verifies a Binding message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Binding message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Binding + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.Binding; + + /** + * Creates a plain object from a Binding message. Also converts values to other types if specified. + * @param message Binding + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.Binding, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Binding to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Binding + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AuditConfig. */ + interface IAuditConfig { + + /** AuditConfig service */ + service?: (string|null); + + /** AuditConfig auditLogConfigs */ + auditLogConfigs?: (google.iam.v1.IAuditLogConfig[]|null); + } + + /** Represents an AuditConfig. */ + class AuditConfig implements IAuditConfig { + + /** + * Constructs a new AuditConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IAuditConfig); + + /** AuditConfig service. */ + public service: string; + + /** AuditConfig auditLogConfigs. */ + public auditLogConfigs: google.iam.v1.IAuditLogConfig[]; + + /** + * Creates a new AuditConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AuditConfig instance + */ + public static create(properties?: google.iam.v1.IAuditConfig): google.iam.v1.AuditConfig; + + /** + * Encodes the specified AuditConfig message. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. + * @param message AuditConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IAuditConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuditConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. + * @param message AuditConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IAuditConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuditConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuditConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.AuditConfig; + + /** + * Decodes an AuditConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuditConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.AuditConfig; + + /** + * Verifies an AuditConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AuditConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuditConfig + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditConfig; + + /** + * Creates a plain object from an AuditConfig message. Also converts values to other types if specified. + * @param message AuditConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.AuditConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuditConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AuditConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AuditLogConfig. */ + interface IAuditLogConfig { + + /** AuditLogConfig logType */ + logType?: (google.iam.v1.AuditLogConfig.LogType|keyof typeof google.iam.v1.AuditLogConfig.LogType|null); + + /** AuditLogConfig exemptedMembers */ + exemptedMembers?: (string[]|null); + } + + /** Represents an AuditLogConfig. */ + class AuditLogConfig implements IAuditLogConfig { + + /** + * Constructs a new AuditLogConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IAuditLogConfig); + + /** AuditLogConfig logType. */ + public logType: (google.iam.v1.AuditLogConfig.LogType|keyof typeof google.iam.v1.AuditLogConfig.LogType); + + /** AuditLogConfig exemptedMembers. */ + public exemptedMembers: string[]; + + /** + * Creates a new AuditLogConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AuditLogConfig instance + */ + public static create(properties?: google.iam.v1.IAuditLogConfig): google.iam.v1.AuditLogConfig; + + /** + * Encodes the specified AuditLogConfig message. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. + * @param message AuditLogConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IAuditLogConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuditLogConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. + * @param message AuditLogConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IAuditLogConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuditLogConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuditLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.AuditLogConfig; + + /** + * Decodes an AuditLogConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuditLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.AuditLogConfig; + + /** + * Verifies an AuditLogConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AuditLogConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuditLogConfig + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditLogConfig; + + /** + * Creates a plain object from an AuditLogConfig message. Also converts values to other types if specified. + * @param message AuditLogConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.AuditLogConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuditLogConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AuditLogConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AuditLogConfig { + + /** LogType enum. */ + enum LogType { + LOG_TYPE_UNSPECIFIED = 0, + ADMIN_READ = 1, + DATA_WRITE = 2, + DATA_READ = 3 + } + } + + /** Properties of a PolicyDelta. */ + interface IPolicyDelta { + + /** PolicyDelta bindingDeltas */ + bindingDeltas?: (google.iam.v1.IBindingDelta[]|null); + + /** PolicyDelta auditConfigDeltas */ + auditConfigDeltas?: (google.iam.v1.IAuditConfigDelta[]|null); + } + + /** Represents a PolicyDelta. */ + class PolicyDelta implements IPolicyDelta { + + /** + * Constructs a new PolicyDelta. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IPolicyDelta); + + /** PolicyDelta bindingDeltas. */ + public bindingDeltas: google.iam.v1.IBindingDelta[]; + + /** PolicyDelta auditConfigDeltas. */ + public auditConfigDeltas: google.iam.v1.IAuditConfigDelta[]; + + /** + * Creates a new PolicyDelta instance using the specified properties. + * @param [properties] Properties to set + * @returns PolicyDelta instance + */ + public static create(properties?: google.iam.v1.IPolicyDelta): google.iam.v1.PolicyDelta; + + /** + * Encodes the specified PolicyDelta message. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @param message PolicyDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IPolicyDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PolicyDelta message, length delimited. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @param message PolicyDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IPolicyDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PolicyDelta message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PolicyDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.PolicyDelta; + + /** + * Decodes a PolicyDelta message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PolicyDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.PolicyDelta; + + /** + * Verifies a PolicyDelta message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PolicyDelta message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PolicyDelta + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.PolicyDelta; + + /** + * Creates a plain object from a PolicyDelta message. Also converts values to other types if specified. + * @param message PolicyDelta + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.PolicyDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PolicyDelta to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PolicyDelta + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BindingDelta. */ + interface IBindingDelta { + + /** BindingDelta action */ + action?: (google.iam.v1.BindingDelta.Action|keyof typeof google.iam.v1.BindingDelta.Action|null); + + /** BindingDelta role */ + role?: (string|null); + + /** BindingDelta member */ + member?: (string|null); + + /** BindingDelta condition */ + condition?: (google.type.IExpr|null); + } + + /** Represents a BindingDelta. */ + class BindingDelta implements IBindingDelta { + + /** + * Constructs a new BindingDelta. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IBindingDelta); + + /** BindingDelta action. */ + public action: (google.iam.v1.BindingDelta.Action|keyof typeof google.iam.v1.BindingDelta.Action); + + /** BindingDelta role. */ + public role: string; + + /** BindingDelta member. */ + public member: string; + + /** BindingDelta condition. */ + public condition?: (google.type.IExpr|null); + + /** + * Creates a new BindingDelta instance using the specified properties. + * @param [properties] Properties to set + * @returns BindingDelta instance + */ + public static create(properties?: google.iam.v1.IBindingDelta): google.iam.v1.BindingDelta; + + /** + * Encodes the specified BindingDelta message. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @param message BindingDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IBindingDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BindingDelta message, length delimited. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @param message BindingDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IBindingDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BindingDelta message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BindingDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.BindingDelta; + + /** + * Decodes a BindingDelta message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BindingDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.BindingDelta; + + /** + * Verifies a BindingDelta message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BindingDelta message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BindingDelta + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.BindingDelta; + + /** + * Creates a plain object from a BindingDelta message. Also converts values to other types if specified. + * @param message BindingDelta + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.BindingDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BindingDelta to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BindingDelta + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BindingDelta { + + /** Action enum. */ + enum Action { + ACTION_UNSPECIFIED = 0, + ADD = 1, + REMOVE = 2 + } + } + + /** Properties of an AuditConfigDelta. */ + interface IAuditConfigDelta { + + /** AuditConfigDelta action */ + action?: (google.iam.v1.AuditConfigDelta.Action|keyof typeof google.iam.v1.AuditConfigDelta.Action|null); + + /** AuditConfigDelta service */ + service?: (string|null); + + /** AuditConfigDelta exemptedMember */ + exemptedMember?: (string|null); + + /** AuditConfigDelta logType */ + logType?: (string|null); + } + + /** Represents an AuditConfigDelta. */ + class AuditConfigDelta implements IAuditConfigDelta { + + /** + * Constructs a new AuditConfigDelta. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IAuditConfigDelta); + + /** AuditConfigDelta action. */ + public action: (google.iam.v1.AuditConfigDelta.Action|keyof typeof google.iam.v1.AuditConfigDelta.Action); + + /** AuditConfigDelta service. */ + public service: string; + + /** AuditConfigDelta exemptedMember. */ + public exemptedMember: string; + + /** AuditConfigDelta logType. */ + public logType: string; + + /** + * Creates a new AuditConfigDelta instance using the specified properties. + * @param [properties] Properties to set + * @returns AuditConfigDelta instance + */ + public static create(properties?: google.iam.v1.IAuditConfigDelta): google.iam.v1.AuditConfigDelta; + + /** + * Encodes the specified AuditConfigDelta message. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @param message AuditConfigDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IAuditConfigDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuditConfigDelta message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @param message AuditConfigDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IAuditConfigDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuditConfigDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.AuditConfigDelta; + + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuditConfigDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.AuditConfigDelta; + + /** + * Verifies an AuditConfigDelta message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AuditConfigDelta message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuditConfigDelta + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditConfigDelta; + + /** + * Creates a plain object from an AuditConfigDelta message. Also converts values to other types if specified. + * @param message AuditConfigDelta + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.AuditConfigDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuditConfigDelta to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AuditConfigDelta + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AuditConfigDelta { + + /** Action enum. */ + enum Action { + ACTION_UNSPECIFIED = 0, + ADD = 1, + REMOVE = 2 + } + } + } + } + + /** Namespace type. */ + namespace type { + + /** Properties of an Expr. */ + interface IExpr { + + /** Expr expression */ + expression?: (string|null); + + /** Expr title */ + title?: (string|null); + + /** Expr description */ + description?: (string|null); + + /** Expr location */ + location?: (string|null); + } + + /** Represents an Expr. */ + class Expr implements IExpr { + + /** + * Constructs a new Expr. + * @param [properties] Properties to set + */ + constructor(properties?: google.type.IExpr); + + /** Expr expression. */ + public expression: string; + + /** Expr title. */ + public title: string; + + /** Expr description. */ + public description: string; + + /** Expr location. */ + public location: string; + + /** + * Creates a new Expr instance using the specified properties. + * @param [properties] Properties to set + * @returns Expr instance + */ + public static create(properties?: google.type.IExpr): google.type.Expr; + + /** + * Encodes the specified Expr message. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @param message Expr message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.type.IExpr, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Expr message, length delimited. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @param message Expr message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.type.IExpr, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Expr message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.type.Expr; + + /** + * Decodes an Expr message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.type.Expr; + + /** + * Verifies an Expr message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Expr message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Expr + */ + public static fromObject(object: { [k: string]: any }): google.type.Expr; + + /** + * Creates a plain object from an Expr message. Also converts values to other types if specified. + * @param message Expr + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.type.Expr, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Expr to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Expr + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } +} diff --git a/owl-bot-staging/executor/v1/protos/protos.js b/owl-bot-staging/executor/v1/protos/protos.js new file mode 100644 index 000000000..15055efd6 --- /dev/null +++ b/owl-bot-staging/executor/v1/protos/protos.js @@ -0,0 +1,104291 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +(function(global, factory) { /* global define, require, module */ + + /* AMD */ if (typeof define === 'function' && define.amd) + define(["protobufjs/minimal"], factory); + + /* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports) + module.exports = factory(require("google-gax/build/src/protobuf").protobufMinimal); + +})(this, function($protobuf) { + "use strict"; + + // Common aliases + var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + + // Exported root namespace + var $root = $protobuf.roots._google_cloud_executor_protos || ($protobuf.roots._google_cloud_executor_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.spanner = (function() { + + /** + * Namespace spanner. + * @memberof google + * @namespace + */ + var spanner = {}; + + spanner.admin = (function() { + + /** + * Namespace admin. + * @memberof google.spanner + * @namespace + */ + var admin = {}; + + admin.database = (function() { + + /** + * Namespace database. + * @memberof google.spanner.admin + * @namespace + */ + var database = {}; + + database.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.spanner.admin.database + * @namespace + */ + var v1 = {}; + + v1.Backup = (function() { + + /** + * Properties of a Backup. + * @memberof google.spanner.admin.database.v1 + * @interface IBackup + * @property {string|null} [database] Backup database + * @property {google.protobuf.ITimestamp|null} [versionTime] Backup versionTime + * @property {google.protobuf.ITimestamp|null} [expireTime] Backup expireTime + * @property {string|null} [name] Backup name + * @property {google.protobuf.ITimestamp|null} [createTime] Backup createTime + * @property {number|Long|null} [sizeBytes] Backup sizeBytes + * @property {number|Long|null} [freeableSizeBytes] Backup freeableSizeBytes + * @property {number|Long|null} [exclusiveSizeBytes] Backup exclusiveSizeBytes + * @property {google.spanner.admin.database.v1.Backup.State|null} [state] Backup state + * @property {Array.|null} [referencingDatabases] Backup referencingDatabases + * @property {google.spanner.admin.database.v1.IEncryptionInfo|null} [encryptionInfo] Backup encryptionInfo + * @property {Array.|null} [encryptionInformation] Backup encryptionInformation + * @property {google.spanner.admin.database.v1.DatabaseDialect|null} [databaseDialect] Backup databaseDialect + * @property {Array.|null} [referencingBackups] Backup referencingBackups + * @property {google.protobuf.ITimestamp|null} [maxExpireTime] Backup maxExpireTime + * @property {Array.|null} [backupSchedules] Backup backupSchedules + * @property {string|null} [incrementalBackupChainId] Backup incrementalBackupChainId + * @property {google.protobuf.ITimestamp|null} [oldestVersionTime] Backup oldestVersionTime + * @property {Array.|null} [instancePartitions] Backup instancePartitions + */ + + /** + * Constructs a new Backup. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents a Backup. + * @implements IBackup + * @constructor + * @param {google.spanner.admin.database.v1.IBackup=} [properties] Properties to set + */ + function Backup(properties) { + this.referencingDatabases = []; + this.encryptionInformation = []; + this.referencingBackups = []; + this.backupSchedules = []; + this.instancePartitions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Backup database. + * @member {string} database + * @memberof google.spanner.admin.database.v1.Backup + * @instance + */ + Backup.prototype.database = ""; + + /** + * Backup versionTime. + * @member {google.protobuf.ITimestamp|null|undefined} versionTime + * @memberof google.spanner.admin.database.v1.Backup + * @instance + */ + Backup.prototype.versionTime = null; + + /** + * Backup expireTime. + * @member {google.protobuf.ITimestamp|null|undefined} expireTime + * @memberof google.spanner.admin.database.v1.Backup + * @instance + */ + Backup.prototype.expireTime = null; + + /** + * Backup name. + * @member {string} name + * @memberof google.spanner.admin.database.v1.Backup + * @instance + */ + Backup.prototype.name = ""; + + /** + * Backup createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.spanner.admin.database.v1.Backup + * @instance + */ + Backup.prototype.createTime = null; + + /** + * Backup sizeBytes. + * @member {number|Long} sizeBytes + * @memberof google.spanner.admin.database.v1.Backup + * @instance + */ + Backup.prototype.sizeBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Backup freeableSizeBytes. + * @member {number|Long} freeableSizeBytes + * @memberof google.spanner.admin.database.v1.Backup + * @instance + */ + Backup.prototype.freeableSizeBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Backup exclusiveSizeBytes. + * @member {number|Long} exclusiveSizeBytes + * @memberof google.spanner.admin.database.v1.Backup + * @instance + */ + Backup.prototype.exclusiveSizeBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Backup state. + * @member {google.spanner.admin.database.v1.Backup.State} state + * @memberof google.spanner.admin.database.v1.Backup + * @instance + */ + Backup.prototype.state = 0; + + /** + * Backup referencingDatabases. + * @member {Array.} referencingDatabases + * @memberof google.spanner.admin.database.v1.Backup + * @instance + */ + Backup.prototype.referencingDatabases = $util.emptyArray; + + /** + * Backup encryptionInfo. + * @member {google.spanner.admin.database.v1.IEncryptionInfo|null|undefined} encryptionInfo + * @memberof google.spanner.admin.database.v1.Backup + * @instance + */ + Backup.prototype.encryptionInfo = null; + + /** + * Backup encryptionInformation. + * @member {Array.} encryptionInformation + * @memberof google.spanner.admin.database.v1.Backup + * @instance + */ + Backup.prototype.encryptionInformation = $util.emptyArray; + + /** + * Backup databaseDialect. + * @member {google.spanner.admin.database.v1.DatabaseDialect} databaseDialect + * @memberof google.spanner.admin.database.v1.Backup + * @instance + */ + Backup.prototype.databaseDialect = 0; + + /** + * Backup referencingBackups. + * @member {Array.} referencingBackups + * @memberof google.spanner.admin.database.v1.Backup + * @instance + */ + Backup.prototype.referencingBackups = $util.emptyArray; + + /** + * Backup maxExpireTime. + * @member {google.protobuf.ITimestamp|null|undefined} maxExpireTime + * @memberof google.spanner.admin.database.v1.Backup + * @instance + */ + Backup.prototype.maxExpireTime = null; + + /** + * Backup backupSchedules. + * @member {Array.} backupSchedules + * @memberof google.spanner.admin.database.v1.Backup + * @instance + */ + Backup.prototype.backupSchedules = $util.emptyArray; + + /** + * Backup incrementalBackupChainId. + * @member {string} incrementalBackupChainId + * @memberof google.spanner.admin.database.v1.Backup + * @instance + */ + Backup.prototype.incrementalBackupChainId = ""; + + /** + * Backup oldestVersionTime. + * @member {google.protobuf.ITimestamp|null|undefined} oldestVersionTime + * @memberof google.spanner.admin.database.v1.Backup + * @instance + */ + Backup.prototype.oldestVersionTime = null; + + /** + * Backup instancePartitions. + * @member {Array.} instancePartitions + * @memberof google.spanner.admin.database.v1.Backup + * @instance + */ + Backup.prototype.instancePartitions = $util.emptyArray; + + /** + * Creates a new Backup instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.Backup + * @static + * @param {google.spanner.admin.database.v1.IBackup=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.Backup} Backup instance + */ + Backup.create = function create(properties) { + return new Backup(properties); + }; + + /** + * Encodes the specified Backup message. Does not implicitly {@link google.spanner.admin.database.v1.Backup.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.Backup + * @static + * @param {google.spanner.admin.database.v1.IBackup} message Backup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Backup.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.database != null && Object.hasOwnProperty.call(message, "database")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.database); + if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) + $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.sizeBytes != null && Object.hasOwnProperty.call(message, "sizeBytes")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.sizeBytes); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.state); + if (message.referencingDatabases != null && message.referencingDatabases.length) + for (var i = 0; i < message.referencingDatabases.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.referencingDatabases[i]); + if (message.encryptionInfo != null && Object.hasOwnProperty.call(message, "encryptionInfo")) + $root.google.spanner.admin.database.v1.EncryptionInfo.encode(message.encryptionInfo, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.versionTime != null && Object.hasOwnProperty.call(message, "versionTime")) + $root.google.protobuf.Timestamp.encode(message.versionTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.databaseDialect != null && Object.hasOwnProperty.call(message, "databaseDialect")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.databaseDialect); + if (message.referencingBackups != null && message.referencingBackups.length) + for (var i = 0; i < message.referencingBackups.length; ++i) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.referencingBackups[i]); + if (message.maxExpireTime != null && Object.hasOwnProperty.call(message, "maxExpireTime")) + $root.google.protobuf.Timestamp.encode(message.maxExpireTime, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.encryptionInformation != null && message.encryptionInformation.length) + for (var i = 0; i < message.encryptionInformation.length; ++i) + $root.google.spanner.admin.database.v1.EncryptionInfo.encode(message.encryptionInformation[i], writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.backupSchedules != null && message.backupSchedules.length) + for (var i = 0; i < message.backupSchedules.length; ++i) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.backupSchedules[i]); + if (message.freeableSizeBytes != null && Object.hasOwnProperty.call(message, "freeableSizeBytes")) + writer.uint32(/* id 15, wireType 0 =*/120).int64(message.freeableSizeBytes); + if (message.exclusiveSizeBytes != null && Object.hasOwnProperty.call(message, "exclusiveSizeBytes")) + writer.uint32(/* id 16, wireType 0 =*/128).int64(message.exclusiveSizeBytes); + if (message.incrementalBackupChainId != null && Object.hasOwnProperty.call(message, "incrementalBackupChainId")) + writer.uint32(/* id 17, wireType 2 =*/138).string(message.incrementalBackupChainId); + if (message.oldestVersionTime != null && Object.hasOwnProperty.call(message, "oldestVersionTime")) + $root.google.protobuf.Timestamp.encode(message.oldestVersionTime, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.instancePartitions != null && message.instancePartitions.length) + for (var i = 0; i < message.instancePartitions.length; ++i) + $root.google.spanner.admin.database.v1.BackupInstancePartition.encode(message.instancePartitions[i], writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Backup message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.Backup.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.Backup + * @static + * @param {google.spanner.admin.database.v1.IBackup} message Backup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Backup.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Backup message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.Backup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.Backup} Backup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Backup.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.Backup(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.database = reader.string(); + break; + } + case 9: { + message.versionTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 1: { + message.name = reader.string(); + break; + } + case 4: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.sizeBytes = reader.int64(); + break; + } + case 15: { + message.freeableSizeBytes = reader.int64(); + break; + } + case 16: { + message.exclusiveSizeBytes = reader.int64(); + break; + } + case 6: { + message.state = reader.int32(); + break; + } + case 7: { + if (!(message.referencingDatabases && message.referencingDatabases.length)) + message.referencingDatabases = []; + message.referencingDatabases.push(reader.string()); + break; + } + case 8: { + message.encryptionInfo = $root.google.spanner.admin.database.v1.EncryptionInfo.decode(reader, reader.uint32()); + break; + } + case 13: { + if (!(message.encryptionInformation && message.encryptionInformation.length)) + message.encryptionInformation = []; + message.encryptionInformation.push($root.google.spanner.admin.database.v1.EncryptionInfo.decode(reader, reader.uint32())); + break; + } + case 10: { + message.databaseDialect = reader.int32(); + break; + } + case 11: { + if (!(message.referencingBackups && message.referencingBackups.length)) + message.referencingBackups = []; + message.referencingBackups.push(reader.string()); + break; + } + case 12: { + message.maxExpireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 14: { + if (!(message.backupSchedules && message.backupSchedules.length)) + message.backupSchedules = []; + message.backupSchedules.push(reader.string()); + break; + } + case 17: { + message.incrementalBackupChainId = reader.string(); + break; + } + case 18: { + message.oldestVersionTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 19: { + if (!(message.instancePartitions && message.instancePartitions.length)) + message.instancePartitions = []; + message.instancePartitions.push($root.google.spanner.admin.database.v1.BackupInstancePartition.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Backup message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.Backup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.Backup} Backup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Backup.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Backup message. + * @function verify + * @memberof google.spanner.admin.database.v1.Backup + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Backup.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.database != null && message.hasOwnProperty("database")) + if (!$util.isString(message.database)) + return "database: string expected"; + if (message.versionTime != null && message.hasOwnProperty("versionTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.versionTime); + if (error) + return "versionTime." + error; + } + if (message.expireTime != null && message.hasOwnProperty("expireTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.expireTime); + if (error) + return "expireTime." + error; + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.sizeBytes != null && message.hasOwnProperty("sizeBytes")) + if (!$util.isInteger(message.sizeBytes) && !(message.sizeBytes && $util.isInteger(message.sizeBytes.low) && $util.isInteger(message.sizeBytes.high))) + return "sizeBytes: integer|Long expected"; + if (message.freeableSizeBytes != null && message.hasOwnProperty("freeableSizeBytes")) + if (!$util.isInteger(message.freeableSizeBytes) && !(message.freeableSizeBytes && $util.isInteger(message.freeableSizeBytes.low) && $util.isInteger(message.freeableSizeBytes.high))) + return "freeableSizeBytes: integer|Long expected"; + if (message.exclusiveSizeBytes != null && message.hasOwnProperty("exclusiveSizeBytes")) + if (!$util.isInteger(message.exclusiveSizeBytes) && !(message.exclusiveSizeBytes && $util.isInteger(message.exclusiveSizeBytes.low) && $util.isInteger(message.exclusiveSizeBytes.high))) + return "exclusiveSizeBytes: integer|Long expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.referencingDatabases != null && message.hasOwnProperty("referencingDatabases")) { + if (!Array.isArray(message.referencingDatabases)) + return "referencingDatabases: array expected"; + for (var i = 0; i < message.referencingDatabases.length; ++i) + if (!$util.isString(message.referencingDatabases[i])) + return "referencingDatabases: string[] expected"; + } + if (message.encryptionInfo != null && message.hasOwnProperty("encryptionInfo")) { + var error = $root.google.spanner.admin.database.v1.EncryptionInfo.verify(message.encryptionInfo); + if (error) + return "encryptionInfo." + error; + } + if (message.encryptionInformation != null && message.hasOwnProperty("encryptionInformation")) { + if (!Array.isArray(message.encryptionInformation)) + return "encryptionInformation: array expected"; + for (var i = 0; i < message.encryptionInformation.length; ++i) { + var error = $root.google.spanner.admin.database.v1.EncryptionInfo.verify(message.encryptionInformation[i]); + if (error) + return "encryptionInformation." + error; + } + } + if (message.databaseDialect != null && message.hasOwnProperty("databaseDialect")) + switch (message.databaseDialect) { + default: + return "databaseDialect: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.referencingBackups != null && message.hasOwnProperty("referencingBackups")) { + if (!Array.isArray(message.referencingBackups)) + return "referencingBackups: array expected"; + for (var i = 0; i < message.referencingBackups.length; ++i) + if (!$util.isString(message.referencingBackups[i])) + return "referencingBackups: string[] expected"; + } + if (message.maxExpireTime != null && message.hasOwnProperty("maxExpireTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.maxExpireTime); + if (error) + return "maxExpireTime." + error; + } + if (message.backupSchedules != null && message.hasOwnProperty("backupSchedules")) { + if (!Array.isArray(message.backupSchedules)) + return "backupSchedules: array expected"; + for (var i = 0; i < message.backupSchedules.length; ++i) + if (!$util.isString(message.backupSchedules[i])) + return "backupSchedules: string[] expected"; + } + if (message.incrementalBackupChainId != null && message.hasOwnProperty("incrementalBackupChainId")) + if (!$util.isString(message.incrementalBackupChainId)) + return "incrementalBackupChainId: string expected"; + if (message.oldestVersionTime != null && message.hasOwnProperty("oldestVersionTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.oldestVersionTime); + if (error) + return "oldestVersionTime." + error; + } + if (message.instancePartitions != null && message.hasOwnProperty("instancePartitions")) { + if (!Array.isArray(message.instancePartitions)) + return "instancePartitions: array expected"; + for (var i = 0; i < message.instancePartitions.length; ++i) { + var error = $root.google.spanner.admin.database.v1.BackupInstancePartition.verify(message.instancePartitions[i]); + if (error) + return "instancePartitions." + error; + } + } + return null; + }; + + /** + * Creates a Backup message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.Backup + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.Backup} Backup + */ + Backup.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.Backup) + return object; + var message = new $root.google.spanner.admin.database.v1.Backup(); + if (object.database != null) + message.database = String(object.database); + if (object.versionTime != null) { + if (typeof object.versionTime !== "object") + throw TypeError(".google.spanner.admin.database.v1.Backup.versionTime: object expected"); + message.versionTime = $root.google.protobuf.Timestamp.fromObject(object.versionTime); + } + if (object.expireTime != null) { + if (typeof object.expireTime !== "object") + throw TypeError(".google.spanner.admin.database.v1.Backup.expireTime: object expected"); + message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); + } + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.spanner.admin.database.v1.Backup.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.sizeBytes != null) + if ($util.Long) + (message.sizeBytes = $util.Long.fromValue(object.sizeBytes)).unsigned = false; + else if (typeof object.sizeBytes === "string") + message.sizeBytes = parseInt(object.sizeBytes, 10); + else if (typeof object.sizeBytes === "number") + message.sizeBytes = object.sizeBytes; + else if (typeof object.sizeBytes === "object") + message.sizeBytes = new $util.LongBits(object.sizeBytes.low >>> 0, object.sizeBytes.high >>> 0).toNumber(); + if (object.freeableSizeBytes != null) + if ($util.Long) + (message.freeableSizeBytes = $util.Long.fromValue(object.freeableSizeBytes)).unsigned = false; + else if (typeof object.freeableSizeBytes === "string") + message.freeableSizeBytes = parseInt(object.freeableSizeBytes, 10); + else if (typeof object.freeableSizeBytes === "number") + message.freeableSizeBytes = object.freeableSizeBytes; + else if (typeof object.freeableSizeBytes === "object") + message.freeableSizeBytes = new $util.LongBits(object.freeableSizeBytes.low >>> 0, object.freeableSizeBytes.high >>> 0).toNumber(); + if (object.exclusiveSizeBytes != null) + if ($util.Long) + (message.exclusiveSizeBytes = $util.Long.fromValue(object.exclusiveSizeBytes)).unsigned = false; + else if (typeof object.exclusiveSizeBytes === "string") + message.exclusiveSizeBytes = parseInt(object.exclusiveSizeBytes, 10); + else if (typeof object.exclusiveSizeBytes === "number") + message.exclusiveSizeBytes = object.exclusiveSizeBytes; + else if (typeof object.exclusiveSizeBytes === "object") + message.exclusiveSizeBytes = new $util.LongBits(object.exclusiveSizeBytes.low >>> 0, object.exclusiveSizeBytes.high >>> 0).toNumber(); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "CREATING": + case 1: + message.state = 1; + break; + case "READY": + case 2: + message.state = 2; + break; + } + if (object.referencingDatabases) { + if (!Array.isArray(object.referencingDatabases)) + throw TypeError(".google.spanner.admin.database.v1.Backup.referencingDatabases: array expected"); + message.referencingDatabases = []; + for (var i = 0; i < object.referencingDatabases.length; ++i) + message.referencingDatabases[i] = String(object.referencingDatabases[i]); + } + if (object.encryptionInfo != null) { + if (typeof object.encryptionInfo !== "object") + throw TypeError(".google.spanner.admin.database.v1.Backup.encryptionInfo: object expected"); + message.encryptionInfo = $root.google.spanner.admin.database.v1.EncryptionInfo.fromObject(object.encryptionInfo); + } + if (object.encryptionInformation) { + if (!Array.isArray(object.encryptionInformation)) + throw TypeError(".google.spanner.admin.database.v1.Backup.encryptionInformation: array expected"); + message.encryptionInformation = []; + for (var i = 0; i < object.encryptionInformation.length; ++i) { + if (typeof object.encryptionInformation[i] !== "object") + throw TypeError(".google.spanner.admin.database.v1.Backup.encryptionInformation: object expected"); + message.encryptionInformation[i] = $root.google.spanner.admin.database.v1.EncryptionInfo.fromObject(object.encryptionInformation[i]); + } + } + switch (object.databaseDialect) { + default: + if (typeof object.databaseDialect === "number") { + message.databaseDialect = object.databaseDialect; + break; + } + break; + case "DATABASE_DIALECT_UNSPECIFIED": + case 0: + message.databaseDialect = 0; + break; + case "GOOGLE_STANDARD_SQL": + case 1: + message.databaseDialect = 1; + break; + case "POSTGRESQL": + case 2: + message.databaseDialect = 2; + break; + } + if (object.referencingBackups) { + if (!Array.isArray(object.referencingBackups)) + throw TypeError(".google.spanner.admin.database.v1.Backup.referencingBackups: array expected"); + message.referencingBackups = []; + for (var i = 0; i < object.referencingBackups.length; ++i) + message.referencingBackups[i] = String(object.referencingBackups[i]); + } + if (object.maxExpireTime != null) { + if (typeof object.maxExpireTime !== "object") + throw TypeError(".google.spanner.admin.database.v1.Backup.maxExpireTime: object expected"); + message.maxExpireTime = $root.google.protobuf.Timestamp.fromObject(object.maxExpireTime); + } + if (object.backupSchedules) { + if (!Array.isArray(object.backupSchedules)) + throw TypeError(".google.spanner.admin.database.v1.Backup.backupSchedules: array expected"); + message.backupSchedules = []; + for (var i = 0; i < object.backupSchedules.length; ++i) + message.backupSchedules[i] = String(object.backupSchedules[i]); + } + if (object.incrementalBackupChainId != null) + message.incrementalBackupChainId = String(object.incrementalBackupChainId); + if (object.oldestVersionTime != null) { + if (typeof object.oldestVersionTime !== "object") + throw TypeError(".google.spanner.admin.database.v1.Backup.oldestVersionTime: object expected"); + message.oldestVersionTime = $root.google.protobuf.Timestamp.fromObject(object.oldestVersionTime); + } + if (object.instancePartitions) { + if (!Array.isArray(object.instancePartitions)) + throw TypeError(".google.spanner.admin.database.v1.Backup.instancePartitions: array expected"); + message.instancePartitions = []; + for (var i = 0; i < object.instancePartitions.length; ++i) { + if (typeof object.instancePartitions[i] !== "object") + throw TypeError(".google.spanner.admin.database.v1.Backup.instancePartitions: object expected"); + message.instancePartitions[i] = $root.google.spanner.admin.database.v1.BackupInstancePartition.fromObject(object.instancePartitions[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Backup message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.Backup + * @static + * @param {google.spanner.admin.database.v1.Backup} message Backup + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Backup.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.referencingDatabases = []; + object.referencingBackups = []; + object.encryptionInformation = []; + object.backupSchedules = []; + object.instancePartitions = []; + } + if (options.defaults) { + object.name = ""; + object.database = ""; + object.expireTime = null; + object.createTime = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.sizeBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.sizeBytes = options.longs === String ? "0" : 0; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.encryptionInfo = null; + object.versionTime = null; + object.databaseDialect = options.enums === String ? "DATABASE_DIALECT_UNSPECIFIED" : 0; + object.maxExpireTime = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.freeableSizeBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.freeableSizeBytes = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.exclusiveSizeBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.exclusiveSizeBytes = options.longs === String ? "0" : 0; + object.incrementalBackupChainId = ""; + object.oldestVersionTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.database != null && message.hasOwnProperty("database")) + object.database = message.database; + if (message.expireTime != null && message.hasOwnProperty("expireTime")) + object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.sizeBytes != null && message.hasOwnProperty("sizeBytes")) + if (typeof message.sizeBytes === "number") + object.sizeBytes = options.longs === String ? String(message.sizeBytes) : message.sizeBytes; + else + object.sizeBytes = options.longs === String ? $util.Long.prototype.toString.call(message.sizeBytes) : options.longs === Number ? new $util.LongBits(message.sizeBytes.low >>> 0, message.sizeBytes.high >>> 0).toNumber() : message.sizeBytes; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.spanner.admin.database.v1.Backup.State[message.state] === undefined ? message.state : $root.google.spanner.admin.database.v1.Backup.State[message.state] : message.state; + if (message.referencingDatabases && message.referencingDatabases.length) { + object.referencingDatabases = []; + for (var j = 0; j < message.referencingDatabases.length; ++j) + object.referencingDatabases[j] = message.referencingDatabases[j]; + } + if (message.encryptionInfo != null && message.hasOwnProperty("encryptionInfo")) + object.encryptionInfo = $root.google.spanner.admin.database.v1.EncryptionInfo.toObject(message.encryptionInfo, options); + if (message.versionTime != null && message.hasOwnProperty("versionTime")) + object.versionTime = $root.google.protobuf.Timestamp.toObject(message.versionTime, options); + if (message.databaseDialect != null && message.hasOwnProperty("databaseDialect")) + object.databaseDialect = options.enums === String ? $root.google.spanner.admin.database.v1.DatabaseDialect[message.databaseDialect] === undefined ? message.databaseDialect : $root.google.spanner.admin.database.v1.DatabaseDialect[message.databaseDialect] : message.databaseDialect; + if (message.referencingBackups && message.referencingBackups.length) { + object.referencingBackups = []; + for (var j = 0; j < message.referencingBackups.length; ++j) + object.referencingBackups[j] = message.referencingBackups[j]; + } + if (message.maxExpireTime != null && message.hasOwnProperty("maxExpireTime")) + object.maxExpireTime = $root.google.protobuf.Timestamp.toObject(message.maxExpireTime, options); + if (message.encryptionInformation && message.encryptionInformation.length) { + object.encryptionInformation = []; + for (var j = 0; j < message.encryptionInformation.length; ++j) + object.encryptionInformation[j] = $root.google.spanner.admin.database.v1.EncryptionInfo.toObject(message.encryptionInformation[j], options); + } + if (message.backupSchedules && message.backupSchedules.length) { + object.backupSchedules = []; + for (var j = 0; j < message.backupSchedules.length; ++j) + object.backupSchedules[j] = message.backupSchedules[j]; + } + if (message.freeableSizeBytes != null && message.hasOwnProperty("freeableSizeBytes")) + if (typeof message.freeableSizeBytes === "number") + object.freeableSizeBytes = options.longs === String ? String(message.freeableSizeBytes) : message.freeableSizeBytes; + else + object.freeableSizeBytes = options.longs === String ? $util.Long.prototype.toString.call(message.freeableSizeBytes) : options.longs === Number ? new $util.LongBits(message.freeableSizeBytes.low >>> 0, message.freeableSizeBytes.high >>> 0).toNumber() : message.freeableSizeBytes; + if (message.exclusiveSizeBytes != null && message.hasOwnProperty("exclusiveSizeBytes")) + if (typeof message.exclusiveSizeBytes === "number") + object.exclusiveSizeBytes = options.longs === String ? String(message.exclusiveSizeBytes) : message.exclusiveSizeBytes; + else + object.exclusiveSizeBytes = options.longs === String ? $util.Long.prototype.toString.call(message.exclusiveSizeBytes) : options.longs === Number ? new $util.LongBits(message.exclusiveSizeBytes.low >>> 0, message.exclusiveSizeBytes.high >>> 0).toNumber() : message.exclusiveSizeBytes; + if (message.incrementalBackupChainId != null && message.hasOwnProperty("incrementalBackupChainId")) + object.incrementalBackupChainId = message.incrementalBackupChainId; + if (message.oldestVersionTime != null && message.hasOwnProperty("oldestVersionTime")) + object.oldestVersionTime = $root.google.protobuf.Timestamp.toObject(message.oldestVersionTime, options); + if (message.instancePartitions && message.instancePartitions.length) { + object.instancePartitions = []; + for (var j = 0; j < message.instancePartitions.length; ++j) + object.instancePartitions[j] = $root.google.spanner.admin.database.v1.BackupInstancePartition.toObject(message.instancePartitions[j], options); + } + return object; + }; + + /** + * Converts this Backup to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.Backup + * @instance + * @returns {Object.} JSON object + */ + Backup.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Backup + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.Backup + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Backup.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.Backup"; + }; + + /** + * State enum. + * @name google.spanner.admin.database.v1.Backup.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} CREATING=1 CREATING value + * @property {number} READY=2 READY value + */ + Backup.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CREATING"] = 1; + values[valuesById[2] = "READY"] = 2; + return values; + })(); + + return Backup; + })(); + + v1.CreateBackupRequest = (function() { + + /** + * Properties of a CreateBackupRequest. + * @memberof google.spanner.admin.database.v1 + * @interface ICreateBackupRequest + * @property {string|null} [parent] CreateBackupRequest parent + * @property {string|null} [backupId] CreateBackupRequest backupId + * @property {google.spanner.admin.database.v1.IBackup|null} [backup] CreateBackupRequest backup + * @property {google.spanner.admin.database.v1.ICreateBackupEncryptionConfig|null} [encryptionConfig] CreateBackupRequest encryptionConfig + */ + + /** + * Constructs a new CreateBackupRequest. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents a CreateBackupRequest. + * @implements ICreateBackupRequest + * @constructor + * @param {google.spanner.admin.database.v1.ICreateBackupRequest=} [properties] Properties to set + */ + function CreateBackupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateBackupRequest parent. + * @member {string} parent + * @memberof google.spanner.admin.database.v1.CreateBackupRequest + * @instance + */ + CreateBackupRequest.prototype.parent = ""; + + /** + * CreateBackupRequest backupId. + * @member {string} backupId + * @memberof google.spanner.admin.database.v1.CreateBackupRequest + * @instance + */ + CreateBackupRequest.prototype.backupId = ""; + + /** + * CreateBackupRequest backup. + * @member {google.spanner.admin.database.v1.IBackup|null|undefined} backup + * @memberof google.spanner.admin.database.v1.CreateBackupRequest + * @instance + */ + CreateBackupRequest.prototype.backup = null; + + /** + * CreateBackupRequest encryptionConfig. + * @member {google.spanner.admin.database.v1.ICreateBackupEncryptionConfig|null|undefined} encryptionConfig + * @memberof google.spanner.admin.database.v1.CreateBackupRequest + * @instance + */ + CreateBackupRequest.prototype.encryptionConfig = null; + + /** + * Creates a new CreateBackupRequest instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.CreateBackupRequest + * @static + * @param {google.spanner.admin.database.v1.ICreateBackupRequest=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.CreateBackupRequest} CreateBackupRequest instance + */ + CreateBackupRequest.create = function create(properties) { + return new CreateBackupRequest(properties); + }; + + /** + * Encodes the specified CreateBackupRequest message. Does not implicitly {@link google.spanner.admin.database.v1.CreateBackupRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.CreateBackupRequest + * @static + * @param {google.spanner.admin.database.v1.ICreateBackupRequest} message CreateBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateBackupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.backupId != null && Object.hasOwnProperty.call(message, "backupId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.backupId); + if (message.backup != null && Object.hasOwnProperty.call(message, "backup")) + $root.google.spanner.admin.database.v1.Backup.encode(message.backup, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) + $root.google.spanner.admin.database.v1.CreateBackupEncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateBackupRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.CreateBackupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.CreateBackupRequest + * @static + * @param {google.spanner.admin.database.v1.ICreateBackupRequest} message CreateBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateBackupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.CreateBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.CreateBackupRequest} CreateBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateBackupRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.CreateBackupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.backupId = reader.string(); + break; + } + case 3: { + message.backup = $root.google.spanner.admin.database.v1.Backup.decode(reader, reader.uint32()); + break; + } + case 4: { + message.encryptionConfig = $root.google.spanner.admin.database.v1.CreateBackupEncryptionConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateBackupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.CreateBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.CreateBackupRequest} CreateBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateBackupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateBackupRequest message. + * @function verify + * @memberof google.spanner.admin.database.v1.CreateBackupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateBackupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.backupId != null && message.hasOwnProperty("backupId")) + if (!$util.isString(message.backupId)) + return "backupId: string expected"; + if (message.backup != null && message.hasOwnProperty("backup")) { + var error = $root.google.spanner.admin.database.v1.Backup.verify(message.backup); + if (error) + return "backup." + error; + } + if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { + var error = $root.google.spanner.admin.database.v1.CreateBackupEncryptionConfig.verify(message.encryptionConfig); + if (error) + return "encryptionConfig." + error; + } + return null; + }; + + /** + * Creates a CreateBackupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.CreateBackupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.CreateBackupRequest} CreateBackupRequest + */ + CreateBackupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.CreateBackupRequest) + return object; + var message = new $root.google.spanner.admin.database.v1.CreateBackupRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.backupId != null) + message.backupId = String(object.backupId); + if (object.backup != null) { + if (typeof object.backup !== "object") + throw TypeError(".google.spanner.admin.database.v1.CreateBackupRequest.backup: object expected"); + message.backup = $root.google.spanner.admin.database.v1.Backup.fromObject(object.backup); + } + if (object.encryptionConfig != null) { + if (typeof object.encryptionConfig !== "object") + throw TypeError(".google.spanner.admin.database.v1.CreateBackupRequest.encryptionConfig: object expected"); + message.encryptionConfig = $root.google.spanner.admin.database.v1.CreateBackupEncryptionConfig.fromObject(object.encryptionConfig); + } + return message; + }; + + /** + * Creates a plain object from a CreateBackupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.CreateBackupRequest + * @static + * @param {google.spanner.admin.database.v1.CreateBackupRequest} message CreateBackupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateBackupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.backupId = ""; + object.backup = null; + object.encryptionConfig = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.backupId != null && message.hasOwnProperty("backupId")) + object.backupId = message.backupId; + if (message.backup != null && message.hasOwnProperty("backup")) + object.backup = $root.google.spanner.admin.database.v1.Backup.toObject(message.backup, options); + if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) + object.encryptionConfig = $root.google.spanner.admin.database.v1.CreateBackupEncryptionConfig.toObject(message.encryptionConfig, options); + return object; + }; + + /** + * Converts this CreateBackupRequest to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.CreateBackupRequest + * @instance + * @returns {Object.} JSON object + */ + CreateBackupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateBackupRequest + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.CreateBackupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.CreateBackupRequest"; + }; + + return CreateBackupRequest; + })(); + + v1.CreateBackupMetadata = (function() { + + /** + * Properties of a CreateBackupMetadata. + * @memberof google.spanner.admin.database.v1 + * @interface ICreateBackupMetadata + * @property {string|null} [name] CreateBackupMetadata name + * @property {string|null} [database] CreateBackupMetadata database + * @property {google.spanner.admin.database.v1.IOperationProgress|null} [progress] CreateBackupMetadata progress + * @property {google.protobuf.ITimestamp|null} [cancelTime] CreateBackupMetadata cancelTime + */ + + /** + * Constructs a new CreateBackupMetadata. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents a CreateBackupMetadata. + * @implements ICreateBackupMetadata + * @constructor + * @param {google.spanner.admin.database.v1.ICreateBackupMetadata=} [properties] Properties to set + */ + function CreateBackupMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateBackupMetadata name. + * @member {string} name + * @memberof google.spanner.admin.database.v1.CreateBackupMetadata + * @instance + */ + CreateBackupMetadata.prototype.name = ""; + + /** + * CreateBackupMetadata database. + * @member {string} database + * @memberof google.spanner.admin.database.v1.CreateBackupMetadata + * @instance + */ + CreateBackupMetadata.prototype.database = ""; + + /** + * CreateBackupMetadata progress. + * @member {google.spanner.admin.database.v1.IOperationProgress|null|undefined} progress + * @memberof google.spanner.admin.database.v1.CreateBackupMetadata + * @instance + */ + CreateBackupMetadata.prototype.progress = null; + + /** + * CreateBackupMetadata cancelTime. + * @member {google.protobuf.ITimestamp|null|undefined} cancelTime + * @memberof google.spanner.admin.database.v1.CreateBackupMetadata + * @instance + */ + CreateBackupMetadata.prototype.cancelTime = null; + + /** + * Creates a new CreateBackupMetadata instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.CreateBackupMetadata + * @static + * @param {google.spanner.admin.database.v1.ICreateBackupMetadata=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.CreateBackupMetadata} CreateBackupMetadata instance + */ + CreateBackupMetadata.create = function create(properties) { + return new CreateBackupMetadata(properties); + }; + + /** + * Encodes the specified CreateBackupMetadata message. Does not implicitly {@link google.spanner.admin.database.v1.CreateBackupMetadata.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.CreateBackupMetadata + * @static + * @param {google.spanner.admin.database.v1.ICreateBackupMetadata} message CreateBackupMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateBackupMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.database != null && Object.hasOwnProperty.call(message, "database")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.database); + if (message.progress != null && Object.hasOwnProperty.call(message, "progress")) + $root.google.spanner.admin.database.v1.OperationProgress.encode(message.progress, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.cancelTime != null && Object.hasOwnProperty.call(message, "cancelTime")) + $root.google.protobuf.Timestamp.encode(message.cancelTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateBackupMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.CreateBackupMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.CreateBackupMetadata + * @static + * @param {google.spanner.admin.database.v1.ICreateBackupMetadata} message CreateBackupMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateBackupMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateBackupMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.CreateBackupMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.CreateBackupMetadata} CreateBackupMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateBackupMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.CreateBackupMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.database = reader.string(); + break; + } + case 3: { + message.progress = $root.google.spanner.admin.database.v1.OperationProgress.decode(reader, reader.uint32()); + break; + } + case 4: { + message.cancelTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateBackupMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.CreateBackupMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.CreateBackupMetadata} CreateBackupMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateBackupMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateBackupMetadata message. + * @function verify + * @memberof google.spanner.admin.database.v1.CreateBackupMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateBackupMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.database != null && message.hasOwnProperty("database")) + if (!$util.isString(message.database)) + return "database: string expected"; + if (message.progress != null && message.hasOwnProperty("progress")) { + var error = $root.google.spanner.admin.database.v1.OperationProgress.verify(message.progress); + if (error) + return "progress." + error; + } + if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.cancelTime); + if (error) + return "cancelTime." + error; + } + return null; + }; + + /** + * Creates a CreateBackupMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.CreateBackupMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.CreateBackupMetadata} CreateBackupMetadata + */ + CreateBackupMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.CreateBackupMetadata) + return object; + var message = new $root.google.spanner.admin.database.v1.CreateBackupMetadata(); + if (object.name != null) + message.name = String(object.name); + if (object.database != null) + message.database = String(object.database); + if (object.progress != null) { + if (typeof object.progress !== "object") + throw TypeError(".google.spanner.admin.database.v1.CreateBackupMetadata.progress: object expected"); + message.progress = $root.google.spanner.admin.database.v1.OperationProgress.fromObject(object.progress); + } + if (object.cancelTime != null) { + if (typeof object.cancelTime !== "object") + throw TypeError(".google.spanner.admin.database.v1.CreateBackupMetadata.cancelTime: object expected"); + message.cancelTime = $root.google.protobuf.Timestamp.fromObject(object.cancelTime); + } + return message; + }; + + /** + * Creates a plain object from a CreateBackupMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.CreateBackupMetadata + * @static + * @param {google.spanner.admin.database.v1.CreateBackupMetadata} message CreateBackupMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateBackupMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.database = ""; + object.progress = null; + object.cancelTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.database != null && message.hasOwnProperty("database")) + object.database = message.database; + if (message.progress != null && message.hasOwnProperty("progress")) + object.progress = $root.google.spanner.admin.database.v1.OperationProgress.toObject(message.progress, options); + if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) + object.cancelTime = $root.google.protobuf.Timestamp.toObject(message.cancelTime, options); + return object; + }; + + /** + * Converts this CreateBackupMetadata to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.CreateBackupMetadata + * @instance + * @returns {Object.} JSON object + */ + CreateBackupMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateBackupMetadata + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.CreateBackupMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateBackupMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.CreateBackupMetadata"; + }; + + return CreateBackupMetadata; + })(); + + v1.CopyBackupRequest = (function() { + + /** + * Properties of a CopyBackupRequest. + * @memberof google.spanner.admin.database.v1 + * @interface ICopyBackupRequest + * @property {string|null} [parent] CopyBackupRequest parent + * @property {string|null} [backupId] CopyBackupRequest backupId + * @property {string|null} [sourceBackup] CopyBackupRequest sourceBackup + * @property {google.protobuf.ITimestamp|null} [expireTime] CopyBackupRequest expireTime + * @property {google.spanner.admin.database.v1.ICopyBackupEncryptionConfig|null} [encryptionConfig] CopyBackupRequest encryptionConfig + */ + + /** + * Constructs a new CopyBackupRequest. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents a CopyBackupRequest. + * @implements ICopyBackupRequest + * @constructor + * @param {google.spanner.admin.database.v1.ICopyBackupRequest=} [properties] Properties to set + */ + function CopyBackupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CopyBackupRequest parent. + * @member {string} parent + * @memberof google.spanner.admin.database.v1.CopyBackupRequest + * @instance + */ + CopyBackupRequest.prototype.parent = ""; + + /** + * CopyBackupRequest backupId. + * @member {string} backupId + * @memberof google.spanner.admin.database.v1.CopyBackupRequest + * @instance + */ + CopyBackupRequest.prototype.backupId = ""; + + /** + * CopyBackupRequest sourceBackup. + * @member {string} sourceBackup + * @memberof google.spanner.admin.database.v1.CopyBackupRequest + * @instance + */ + CopyBackupRequest.prototype.sourceBackup = ""; + + /** + * CopyBackupRequest expireTime. + * @member {google.protobuf.ITimestamp|null|undefined} expireTime + * @memberof google.spanner.admin.database.v1.CopyBackupRequest + * @instance + */ + CopyBackupRequest.prototype.expireTime = null; + + /** + * CopyBackupRequest encryptionConfig. + * @member {google.spanner.admin.database.v1.ICopyBackupEncryptionConfig|null|undefined} encryptionConfig + * @memberof google.spanner.admin.database.v1.CopyBackupRequest + * @instance + */ + CopyBackupRequest.prototype.encryptionConfig = null; + + /** + * Creates a new CopyBackupRequest instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.CopyBackupRequest + * @static + * @param {google.spanner.admin.database.v1.ICopyBackupRequest=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.CopyBackupRequest} CopyBackupRequest instance + */ + CopyBackupRequest.create = function create(properties) { + return new CopyBackupRequest(properties); + }; + + /** + * Encodes the specified CopyBackupRequest message. Does not implicitly {@link google.spanner.admin.database.v1.CopyBackupRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.CopyBackupRequest + * @static + * @param {google.spanner.admin.database.v1.ICopyBackupRequest} message CopyBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CopyBackupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.backupId != null && Object.hasOwnProperty.call(message, "backupId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.backupId); + if (message.sourceBackup != null && Object.hasOwnProperty.call(message, "sourceBackup")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.sourceBackup); + if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) + $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) + $root.google.spanner.admin.database.v1.CopyBackupEncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CopyBackupRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.CopyBackupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.CopyBackupRequest + * @static + * @param {google.spanner.admin.database.v1.ICopyBackupRequest} message CopyBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CopyBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CopyBackupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.CopyBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.CopyBackupRequest} CopyBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CopyBackupRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.CopyBackupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.backupId = reader.string(); + break; + } + case 3: { + message.sourceBackup = reader.string(); + break; + } + case 4: { + message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.encryptionConfig = $root.google.spanner.admin.database.v1.CopyBackupEncryptionConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CopyBackupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.CopyBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.CopyBackupRequest} CopyBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CopyBackupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CopyBackupRequest message. + * @function verify + * @memberof google.spanner.admin.database.v1.CopyBackupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CopyBackupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.backupId != null && message.hasOwnProperty("backupId")) + if (!$util.isString(message.backupId)) + return "backupId: string expected"; + if (message.sourceBackup != null && message.hasOwnProperty("sourceBackup")) + if (!$util.isString(message.sourceBackup)) + return "sourceBackup: string expected"; + if (message.expireTime != null && message.hasOwnProperty("expireTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.expireTime); + if (error) + return "expireTime." + error; + } + if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { + var error = $root.google.spanner.admin.database.v1.CopyBackupEncryptionConfig.verify(message.encryptionConfig); + if (error) + return "encryptionConfig." + error; + } + return null; + }; + + /** + * Creates a CopyBackupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.CopyBackupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.CopyBackupRequest} CopyBackupRequest + */ + CopyBackupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.CopyBackupRequest) + return object; + var message = new $root.google.spanner.admin.database.v1.CopyBackupRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.backupId != null) + message.backupId = String(object.backupId); + if (object.sourceBackup != null) + message.sourceBackup = String(object.sourceBackup); + if (object.expireTime != null) { + if (typeof object.expireTime !== "object") + throw TypeError(".google.spanner.admin.database.v1.CopyBackupRequest.expireTime: object expected"); + message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); + } + if (object.encryptionConfig != null) { + if (typeof object.encryptionConfig !== "object") + throw TypeError(".google.spanner.admin.database.v1.CopyBackupRequest.encryptionConfig: object expected"); + message.encryptionConfig = $root.google.spanner.admin.database.v1.CopyBackupEncryptionConfig.fromObject(object.encryptionConfig); + } + return message; + }; + + /** + * Creates a plain object from a CopyBackupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.CopyBackupRequest + * @static + * @param {google.spanner.admin.database.v1.CopyBackupRequest} message CopyBackupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CopyBackupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.backupId = ""; + object.sourceBackup = ""; + object.expireTime = null; + object.encryptionConfig = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.backupId != null && message.hasOwnProperty("backupId")) + object.backupId = message.backupId; + if (message.sourceBackup != null && message.hasOwnProperty("sourceBackup")) + object.sourceBackup = message.sourceBackup; + if (message.expireTime != null && message.hasOwnProperty("expireTime")) + object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); + if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) + object.encryptionConfig = $root.google.spanner.admin.database.v1.CopyBackupEncryptionConfig.toObject(message.encryptionConfig, options); + return object; + }; + + /** + * Converts this CopyBackupRequest to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.CopyBackupRequest + * @instance + * @returns {Object.} JSON object + */ + CopyBackupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CopyBackupRequest + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.CopyBackupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CopyBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.CopyBackupRequest"; + }; + + return CopyBackupRequest; + })(); + + v1.CopyBackupMetadata = (function() { + + /** + * Properties of a CopyBackupMetadata. + * @memberof google.spanner.admin.database.v1 + * @interface ICopyBackupMetadata + * @property {string|null} [name] CopyBackupMetadata name + * @property {string|null} [sourceBackup] CopyBackupMetadata sourceBackup + * @property {google.spanner.admin.database.v1.IOperationProgress|null} [progress] CopyBackupMetadata progress + * @property {google.protobuf.ITimestamp|null} [cancelTime] CopyBackupMetadata cancelTime + */ + + /** + * Constructs a new CopyBackupMetadata. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents a CopyBackupMetadata. + * @implements ICopyBackupMetadata + * @constructor + * @param {google.spanner.admin.database.v1.ICopyBackupMetadata=} [properties] Properties to set + */ + function CopyBackupMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CopyBackupMetadata name. + * @member {string} name + * @memberof google.spanner.admin.database.v1.CopyBackupMetadata + * @instance + */ + CopyBackupMetadata.prototype.name = ""; + + /** + * CopyBackupMetadata sourceBackup. + * @member {string} sourceBackup + * @memberof google.spanner.admin.database.v1.CopyBackupMetadata + * @instance + */ + CopyBackupMetadata.prototype.sourceBackup = ""; + + /** + * CopyBackupMetadata progress. + * @member {google.spanner.admin.database.v1.IOperationProgress|null|undefined} progress + * @memberof google.spanner.admin.database.v1.CopyBackupMetadata + * @instance + */ + CopyBackupMetadata.prototype.progress = null; + + /** + * CopyBackupMetadata cancelTime. + * @member {google.protobuf.ITimestamp|null|undefined} cancelTime + * @memberof google.spanner.admin.database.v1.CopyBackupMetadata + * @instance + */ + CopyBackupMetadata.prototype.cancelTime = null; + + /** + * Creates a new CopyBackupMetadata instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.CopyBackupMetadata + * @static + * @param {google.spanner.admin.database.v1.ICopyBackupMetadata=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.CopyBackupMetadata} CopyBackupMetadata instance + */ + CopyBackupMetadata.create = function create(properties) { + return new CopyBackupMetadata(properties); + }; + + /** + * Encodes the specified CopyBackupMetadata message. Does not implicitly {@link google.spanner.admin.database.v1.CopyBackupMetadata.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.CopyBackupMetadata + * @static + * @param {google.spanner.admin.database.v1.ICopyBackupMetadata} message CopyBackupMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CopyBackupMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.sourceBackup != null && Object.hasOwnProperty.call(message, "sourceBackup")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceBackup); + if (message.progress != null && Object.hasOwnProperty.call(message, "progress")) + $root.google.spanner.admin.database.v1.OperationProgress.encode(message.progress, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.cancelTime != null && Object.hasOwnProperty.call(message, "cancelTime")) + $root.google.protobuf.Timestamp.encode(message.cancelTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CopyBackupMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.CopyBackupMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.CopyBackupMetadata + * @static + * @param {google.spanner.admin.database.v1.ICopyBackupMetadata} message CopyBackupMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CopyBackupMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CopyBackupMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.CopyBackupMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.CopyBackupMetadata} CopyBackupMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CopyBackupMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.CopyBackupMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.sourceBackup = reader.string(); + break; + } + case 3: { + message.progress = $root.google.spanner.admin.database.v1.OperationProgress.decode(reader, reader.uint32()); + break; + } + case 4: { + message.cancelTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CopyBackupMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.CopyBackupMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.CopyBackupMetadata} CopyBackupMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CopyBackupMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CopyBackupMetadata message. + * @function verify + * @memberof google.spanner.admin.database.v1.CopyBackupMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CopyBackupMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.sourceBackup != null && message.hasOwnProperty("sourceBackup")) + if (!$util.isString(message.sourceBackup)) + return "sourceBackup: string expected"; + if (message.progress != null && message.hasOwnProperty("progress")) { + var error = $root.google.spanner.admin.database.v1.OperationProgress.verify(message.progress); + if (error) + return "progress." + error; + } + if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.cancelTime); + if (error) + return "cancelTime." + error; + } + return null; + }; + + /** + * Creates a CopyBackupMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.CopyBackupMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.CopyBackupMetadata} CopyBackupMetadata + */ + CopyBackupMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.CopyBackupMetadata) + return object; + var message = new $root.google.spanner.admin.database.v1.CopyBackupMetadata(); + if (object.name != null) + message.name = String(object.name); + if (object.sourceBackup != null) + message.sourceBackup = String(object.sourceBackup); + if (object.progress != null) { + if (typeof object.progress !== "object") + throw TypeError(".google.spanner.admin.database.v1.CopyBackupMetadata.progress: object expected"); + message.progress = $root.google.spanner.admin.database.v1.OperationProgress.fromObject(object.progress); + } + if (object.cancelTime != null) { + if (typeof object.cancelTime !== "object") + throw TypeError(".google.spanner.admin.database.v1.CopyBackupMetadata.cancelTime: object expected"); + message.cancelTime = $root.google.protobuf.Timestamp.fromObject(object.cancelTime); + } + return message; + }; + + /** + * Creates a plain object from a CopyBackupMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.CopyBackupMetadata + * @static + * @param {google.spanner.admin.database.v1.CopyBackupMetadata} message CopyBackupMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CopyBackupMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.sourceBackup = ""; + object.progress = null; + object.cancelTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.sourceBackup != null && message.hasOwnProperty("sourceBackup")) + object.sourceBackup = message.sourceBackup; + if (message.progress != null && message.hasOwnProperty("progress")) + object.progress = $root.google.spanner.admin.database.v1.OperationProgress.toObject(message.progress, options); + if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) + object.cancelTime = $root.google.protobuf.Timestamp.toObject(message.cancelTime, options); + return object; + }; + + /** + * Converts this CopyBackupMetadata to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.CopyBackupMetadata + * @instance + * @returns {Object.} JSON object + */ + CopyBackupMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CopyBackupMetadata + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.CopyBackupMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CopyBackupMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.CopyBackupMetadata"; + }; + + return CopyBackupMetadata; + })(); + + v1.UpdateBackupRequest = (function() { + + /** + * Properties of an UpdateBackupRequest. + * @memberof google.spanner.admin.database.v1 + * @interface IUpdateBackupRequest + * @property {google.spanner.admin.database.v1.IBackup|null} [backup] UpdateBackupRequest backup + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateBackupRequest updateMask + */ + + /** + * Constructs a new UpdateBackupRequest. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents an UpdateBackupRequest. + * @implements IUpdateBackupRequest + * @constructor + * @param {google.spanner.admin.database.v1.IUpdateBackupRequest=} [properties] Properties to set + */ + function UpdateBackupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateBackupRequest backup. + * @member {google.spanner.admin.database.v1.IBackup|null|undefined} backup + * @memberof google.spanner.admin.database.v1.UpdateBackupRequest + * @instance + */ + UpdateBackupRequest.prototype.backup = null; + + /** + * UpdateBackupRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.spanner.admin.database.v1.UpdateBackupRequest + * @instance + */ + UpdateBackupRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateBackupRequest instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.UpdateBackupRequest + * @static + * @param {google.spanner.admin.database.v1.IUpdateBackupRequest=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.UpdateBackupRequest} UpdateBackupRequest instance + */ + UpdateBackupRequest.create = function create(properties) { + return new UpdateBackupRequest(properties); + }; + + /** + * Encodes the specified UpdateBackupRequest message. Does not implicitly {@link google.spanner.admin.database.v1.UpdateBackupRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.UpdateBackupRequest + * @static + * @param {google.spanner.admin.database.v1.IUpdateBackupRequest} message UpdateBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateBackupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.backup != null && Object.hasOwnProperty.call(message, "backup")) + $root.google.spanner.admin.database.v1.Backup.encode(message.backup, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateBackupRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.UpdateBackupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.UpdateBackupRequest + * @static + * @param {google.spanner.admin.database.v1.IUpdateBackupRequest} message UpdateBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateBackupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.UpdateBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.UpdateBackupRequest} UpdateBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateBackupRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.UpdateBackupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.backup = $root.google.spanner.admin.database.v1.Backup.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateBackupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.UpdateBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.UpdateBackupRequest} UpdateBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateBackupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateBackupRequest message. + * @function verify + * @memberof google.spanner.admin.database.v1.UpdateBackupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateBackupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.backup != null && message.hasOwnProperty("backup")) { + var error = $root.google.spanner.admin.database.v1.Backup.verify(message.backup); + if (error) + return "backup." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateBackupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.UpdateBackupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.UpdateBackupRequest} UpdateBackupRequest + */ + UpdateBackupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.UpdateBackupRequest) + return object; + var message = new $root.google.spanner.admin.database.v1.UpdateBackupRequest(); + if (object.backup != null) { + if (typeof object.backup !== "object") + throw TypeError(".google.spanner.admin.database.v1.UpdateBackupRequest.backup: object expected"); + message.backup = $root.google.spanner.admin.database.v1.Backup.fromObject(object.backup); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.spanner.admin.database.v1.UpdateBackupRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateBackupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.UpdateBackupRequest + * @static + * @param {google.spanner.admin.database.v1.UpdateBackupRequest} message UpdateBackupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateBackupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.backup = null; + object.updateMask = null; + } + if (message.backup != null && message.hasOwnProperty("backup")) + object.backup = $root.google.spanner.admin.database.v1.Backup.toObject(message.backup, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateBackupRequest to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.UpdateBackupRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateBackupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateBackupRequest + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.UpdateBackupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.UpdateBackupRequest"; + }; + + return UpdateBackupRequest; + })(); + + v1.GetBackupRequest = (function() { + + /** + * Properties of a GetBackupRequest. + * @memberof google.spanner.admin.database.v1 + * @interface IGetBackupRequest + * @property {string|null} [name] GetBackupRequest name + */ + + /** + * Constructs a new GetBackupRequest. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents a GetBackupRequest. + * @implements IGetBackupRequest + * @constructor + * @param {google.spanner.admin.database.v1.IGetBackupRequest=} [properties] Properties to set + */ + function GetBackupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetBackupRequest name. + * @member {string} name + * @memberof google.spanner.admin.database.v1.GetBackupRequest + * @instance + */ + GetBackupRequest.prototype.name = ""; + + /** + * Creates a new GetBackupRequest instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.GetBackupRequest + * @static + * @param {google.spanner.admin.database.v1.IGetBackupRequest=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.GetBackupRequest} GetBackupRequest instance + */ + GetBackupRequest.create = function create(properties) { + return new GetBackupRequest(properties); + }; + + /** + * Encodes the specified GetBackupRequest message. Does not implicitly {@link google.spanner.admin.database.v1.GetBackupRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.GetBackupRequest + * @static + * @param {google.spanner.admin.database.v1.IGetBackupRequest} message GetBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBackupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetBackupRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.GetBackupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.GetBackupRequest + * @static + * @param {google.spanner.admin.database.v1.IGetBackupRequest} message GetBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetBackupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.GetBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.GetBackupRequest} GetBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBackupRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.GetBackupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetBackupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.GetBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.GetBackupRequest} GetBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBackupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetBackupRequest message. + * @function verify + * @memberof google.spanner.admin.database.v1.GetBackupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetBackupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetBackupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.GetBackupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.GetBackupRequest} GetBackupRequest + */ + GetBackupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.GetBackupRequest) + return object; + var message = new $root.google.spanner.admin.database.v1.GetBackupRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetBackupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.GetBackupRequest + * @static + * @param {google.spanner.admin.database.v1.GetBackupRequest} message GetBackupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetBackupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetBackupRequest to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.GetBackupRequest + * @instance + * @returns {Object.} JSON object + */ + GetBackupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetBackupRequest + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.GetBackupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.GetBackupRequest"; + }; + + return GetBackupRequest; + })(); + + v1.DeleteBackupRequest = (function() { + + /** + * Properties of a DeleteBackupRequest. + * @memberof google.spanner.admin.database.v1 + * @interface IDeleteBackupRequest + * @property {string|null} [name] DeleteBackupRequest name + */ + + /** + * Constructs a new DeleteBackupRequest. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents a DeleteBackupRequest. + * @implements IDeleteBackupRequest + * @constructor + * @param {google.spanner.admin.database.v1.IDeleteBackupRequest=} [properties] Properties to set + */ + function DeleteBackupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteBackupRequest name. + * @member {string} name + * @memberof google.spanner.admin.database.v1.DeleteBackupRequest + * @instance + */ + DeleteBackupRequest.prototype.name = ""; + + /** + * Creates a new DeleteBackupRequest instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.DeleteBackupRequest + * @static + * @param {google.spanner.admin.database.v1.IDeleteBackupRequest=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.DeleteBackupRequest} DeleteBackupRequest instance + */ + DeleteBackupRequest.create = function create(properties) { + return new DeleteBackupRequest(properties); + }; + + /** + * Encodes the specified DeleteBackupRequest message. Does not implicitly {@link google.spanner.admin.database.v1.DeleteBackupRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.DeleteBackupRequest + * @static + * @param {google.spanner.admin.database.v1.IDeleteBackupRequest} message DeleteBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteBackupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteBackupRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.DeleteBackupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.DeleteBackupRequest + * @static + * @param {google.spanner.admin.database.v1.IDeleteBackupRequest} message DeleteBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteBackupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.DeleteBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.DeleteBackupRequest} DeleteBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteBackupRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.DeleteBackupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteBackupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.DeleteBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.DeleteBackupRequest} DeleteBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteBackupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteBackupRequest message. + * @function verify + * @memberof google.spanner.admin.database.v1.DeleteBackupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteBackupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteBackupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.DeleteBackupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.DeleteBackupRequest} DeleteBackupRequest + */ + DeleteBackupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.DeleteBackupRequest) + return object; + var message = new $root.google.spanner.admin.database.v1.DeleteBackupRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteBackupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.DeleteBackupRequest + * @static + * @param {google.spanner.admin.database.v1.DeleteBackupRequest} message DeleteBackupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteBackupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteBackupRequest to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.DeleteBackupRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteBackupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteBackupRequest + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.DeleteBackupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.DeleteBackupRequest"; + }; + + return DeleteBackupRequest; + })(); + + v1.ListBackupsRequest = (function() { + + /** + * Properties of a ListBackupsRequest. + * @memberof google.spanner.admin.database.v1 + * @interface IListBackupsRequest + * @property {string|null} [parent] ListBackupsRequest parent + * @property {string|null} [filter] ListBackupsRequest filter + * @property {number|null} [pageSize] ListBackupsRequest pageSize + * @property {string|null} [pageToken] ListBackupsRequest pageToken + */ + + /** + * Constructs a new ListBackupsRequest. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents a ListBackupsRequest. + * @implements IListBackupsRequest + * @constructor + * @param {google.spanner.admin.database.v1.IListBackupsRequest=} [properties] Properties to set + */ + function ListBackupsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListBackupsRequest parent. + * @member {string} parent + * @memberof google.spanner.admin.database.v1.ListBackupsRequest + * @instance + */ + ListBackupsRequest.prototype.parent = ""; + + /** + * ListBackupsRequest filter. + * @member {string} filter + * @memberof google.spanner.admin.database.v1.ListBackupsRequest + * @instance + */ + ListBackupsRequest.prototype.filter = ""; + + /** + * ListBackupsRequest pageSize. + * @member {number} pageSize + * @memberof google.spanner.admin.database.v1.ListBackupsRequest + * @instance + */ + ListBackupsRequest.prototype.pageSize = 0; + + /** + * ListBackupsRequest pageToken. + * @member {string} pageToken + * @memberof google.spanner.admin.database.v1.ListBackupsRequest + * @instance + */ + ListBackupsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListBackupsRequest instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.ListBackupsRequest + * @static + * @param {google.spanner.admin.database.v1.IListBackupsRequest=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.ListBackupsRequest} ListBackupsRequest instance + */ + ListBackupsRequest.create = function create(properties) { + return new ListBackupsRequest(properties); + }; + + /** + * Encodes the specified ListBackupsRequest message. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupsRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.ListBackupsRequest + * @static + * @param {google.spanner.admin.database.v1.IListBackupsRequest} message ListBackupsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListBackupsRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.ListBackupsRequest + * @static + * @param {google.spanner.admin.database.v1.IListBackupsRequest} message ListBackupsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListBackupsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.ListBackupsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.ListBackupsRequest} ListBackupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.ListBackupsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.filter = reader.string(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListBackupsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.ListBackupsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.ListBackupsRequest} ListBackupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListBackupsRequest message. + * @function verify + * @memberof google.spanner.admin.database.v1.ListBackupsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListBackupsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListBackupsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.ListBackupsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.ListBackupsRequest} ListBackupsRequest + */ + ListBackupsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.ListBackupsRequest) + return object; + var message = new $root.google.spanner.admin.database.v1.ListBackupsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListBackupsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.ListBackupsRequest + * @static + * @param {google.spanner.admin.database.v1.ListBackupsRequest} message ListBackupsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListBackupsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListBackupsRequest to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.ListBackupsRequest + * @instance + * @returns {Object.} JSON object + */ + ListBackupsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListBackupsRequest + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.ListBackupsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListBackupsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.ListBackupsRequest"; + }; + + return ListBackupsRequest; + })(); + + v1.ListBackupsResponse = (function() { + + /** + * Properties of a ListBackupsResponse. + * @memberof google.spanner.admin.database.v1 + * @interface IListBackupsResponse + * @property {Array.|null} [backups] ListBackupsResponse backups + * @property {string|null} [nextPageToken] ListBackupsResponse nextPageToken + */ + + /** + * Constructs a new ListBackupsResponse. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents a ListBackupsResponse. + * @implements IListBackupsResponse + * @constructor + * @param {google.spanner.admin.database.v1.IListBackupsResponse=} [properties] Properties to set + */ + function ListBackupsResponse(properties) { + this.backups = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListBackupsResponse backups. + * @member {Array.} backups + * @memberof google.spanner.admin.database.v1.ListBackupsResponse + * @instance + */ + ListBackupsResponse.prototype.backups = $util.emptyArray; + + /** + * ListBackupsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.spanner.admin.database.v1.ListBackupsResponse + * @instance + */ + ListBackupsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListBackupsResponse instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.ListBackupsResponse + * @static + * @param {google.spanner.admin.database.v1.IListBackupsResponse=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.ListBackupsResponse} ListBackupsResponse instance + */ + ListBackupsResponse.create = function create(properties) { + return new ListBackupsResponse(properties); + }; + + /** + * Encodes the specified ListBackupsResponse message. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupsResponse.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.ListBackupsResponse + * @static + * @param {google.spanner.admin.database.v1.IListBackupsResponse} message ListBackupsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.backups != null && message.backups.length) + for (var i = 0; i < message.backups.length; ++i) + $root.google.spanner.admin.database.v1.Backup.encode(message.backups[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListBackupsResponse message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.ListBackupsResponse + * @static + * @param {google.spanner.admin.database.v1.IListBackupsResponse} message ListBackupsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListBackupsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.ListBackupsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.ListBackupsResponse} ListBackupsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.ListBackupsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.backups && message.backups.length)) + message.backups = []; + message.backups.push($root.google.spanner.admin.database.v1.Backup.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListBackupsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.ListBackupsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.ListBackupsResponse} ListBackupsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListBackupsResponse message. + * @function verify + * @memberof google.spanner.admin.database.v1.ListBackupsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListBackupsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.backups != null && message.hasOwnProperty("backups")) { + if (!Array.isArray(message.backups)) + return "backups: array expected"; + for (var i = 0; i < message.backups.length; ++i) { + var error = $root.google.spanner.admin.database.v1.Backup.verify(message.backups[i]); + if (error) + return "backups." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListBackupsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.ListBackupsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.ListBackupsResponse} ListBackupsResponse + */ + ListBackupsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.ListBackupsResponse) + return object; + var message = new $root.google.spanner.admin.database.v1.ListBackupsResponse(); + if (object.backups) { + if (!Array.isArray(object.backups)) + throw TypeError(".google.spanner.admin.database.v1.ListBackupsResponse.backups: array expected"); + message.backups = []; + for (var i = 0; i < object.backups.length; ++i) { + if (typeof object.backups[i] !== "object") + throw TypeError(".google.spanner.admin.database.v1.ListBackupsResponse.backups: object expected"); + message.backups[i] = $root.google.spanner.admin.database.v1.Backup.fromObject(object.backups[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListBackupsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.ListBackupsResponse + * @static + * @param {google.spanner.admin.database.v1.ListBackupsResponse} message ListBackupsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListBackupsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.backups = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.backups && message.backups.length) { + object.backups = []; + for (var j = 0; j < message.backups.length; ++j) + object.backups[j] = $root.google.spanner.admin.database.v1.Backup.toObject(message.backups[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListBackupsResponse to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.ListBackupsResponse + * @instance + * @returns {Object.} JSON object + */ + ListBackupsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListBackupsResponse + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.ListBackupsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListBackupsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.ListBackupsResponse"; + }; + + return ListBackupsResponse; + })(); + + v1.ListBackupOperationsRequest = (function() { + + /** + * Properties of a ListBackupOperationsRequest. + * @memberof google.spanner.admin.database.v1 + * @interface IListBackupOperationsRequest + * @property {string|null} [parent] ListBackupOperationsRequest parent + * @property {string|null} [filter] ListBackupOperationsRequest filter + * @property {number|null} [pageSize] ListBackupOperationsRequest pageSize + * @property {string|null} [pageToken] ListBackupOperationsRequest pageToken + */ + + /** + * Constructs a new ListBackupOperationsRequest. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents a ListBackupOperationsRequest. + * @implements IListBackupOperationsRequest + * @constructor + * @param {google.spanner.admin.database.v1.IListBackupOperationsRequest=} [properties] Properties to set + */ + function ListBackupOperationsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListBackupOperationsRequest parent. + * @member {string} parent + * @memberof google.spanner.admin.database.v1.ListBackupOperationsRequest + * @instance + */ + ListBackupOperationsRequest.prototype.parent = ""; + + /** + * ListBackupOperationsRequest filter. + * @member {string} filter + * @memberof google.spanner.admin.database.v1.ListBackupOperationsRequest + * @instance + */ + ListBackupOperationsRequest.prototype.filter = ""; + + /** + * ListBackupOperationsRequest pageSize. + * @member {number} pageSize + * @memberof google.spanner.admin.database.v1.ListBackupOperationsRequest + * @instance + */ + ListBackupOperationsRequest.prototype.pageSize = 0; + + /** + * ListBackupOperationsRequest pageToken. + * @member {string} pageToken + * @memberof google.spanner.admin.database.v1.ListBackupOperationsRequest + * @instance + */ + ListBackupOperationsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListBackupOperationsRequest instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.ListBackupOperationsRequest + * @static + * @param {google.spanner.admin.database.v1.IListBackupOperationsRequest=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.ListBackupOperationsRequest} ListBackupOperationsRequest instance + */ + ListBackupOperationsRequest.create = function create(properties) { + return new ListBackupOperationsRequest(properties); + }; + + /** + * Encodes the specified ListBackupOperationsRequest message. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupOperationsRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.ListBackupOperationsRequest + * @static + * @param {google.spanner.admin.database.v1.IListBackupOperationsRequest} message ListBackupOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupOperationsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListBackupOperationsRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupOperationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.ListBackupOperationsRequest + * @static + * @param {google.spanner.admin.database.v1.IListBackupOperationsRequest} message ListBackupOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListBackupOperationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.ListBackupOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.ListBackupOperationsRequest} ListBackupOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupOperationsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.ListBackupOperationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.filter = reader.string(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListBackupOperationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.ListBackupOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.ListBackupOperationsRequest} ListBackupOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupOperationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListBackupOperationsRequest message. + * @function verify + * @memberof google.spanner.admin.database.v1.ListBackupOperationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListBackupOperationsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.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 ListBackupOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.ListBackupOperationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.ListBackupOperationsRequest} ListBackupOperationsRequest + */ + ListBackupOperationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.ListBackupOperationsRequest) + return object; + var message = new $root.google.spanner.admin.database.v1.ListBackupOperationsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListBackupOperationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.ListBackupOperationsRequest + * @static + * @param {google.spanner.admin.database.v1.ListBackupOperationsRequest} message ListBackupOperationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListBackupOperationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListBackupOperationsRequest to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.ListBackupOperationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListBackupOperationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListBackupOperationsRequest + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.ListBackupOperationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListBackupOperationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.ListBackupOperationsRequest"; + }; + + return ListBackupOperationsRequest; + })(); + + v1.ListBackupOperationsResponse = (function() { + + /** + * Properties of a ListBackupOperationsResponse. + * @memberof google.spanner.admin.database.v1 + * @interface IListBackupOperationsResponse + * @property {Array.|null} [operations] ListBackupOperationsResponse operations + * @property {string|null} [nextPageToken] ListBackupOperationsResponse nextPageToken + */ + + /** + * Constructs a new ListBackupOperationsResponse. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents a ListBackupOperationsResponse. + * @implements IListBackupOperationsResponse + * @constructor + * @param {google.spanner.admin.database.v1.IListBackupOperationsResponse=} [properties] Properties to set + */ + function ListBackupOperationsResponse(properties) { + this.operations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListBackupOperationsResponse operations. + * @member {Array.} operations + * @memberof google.spanner.admin.database.v1.ListBackupOperationsResponse + * @instance + */ + ListBackupOperationsResponse.prototype.operations = $util.emptyArray; + + /** + * ListBackupOperationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.spanner.admin.database.v1.ListBackupOperationsResponse + * @instance + */ + ListBackupOperationsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListBackupOperationsResponse instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.ListBackupOperationsResponse + * @static + * @param {google.spanner.admin.database.v1.IListBackupOperationsResponse=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.ListBackupOperationsResponse} ListBackupOperationsResponse instance + */ + ListBackupOperationsResponse.create = function create(properties) { + return new ListBackupOperationsResponse(properties); + }; + + /** + * Encodes the specified ListBackupOperationsResponse message. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupOperationsResponse.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.ListBackupOperationsResponse + * @static + * @param {google.spanner.admin.database.v1.IListBackupOperationsResponse} message ListBackupOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupOperationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.operations != null && message.operations.length) + for (var i = 0; i < message.operations.length; ++i) + $root.google.longrunning.Operation.encode(message.operations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListBackupOperationsResponse message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupOperationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.ListBackupOperationsResponse + * @static + * @param {google.spanner.admin.database.v1.IListBackupOperationsResponse} message ListBackupOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupOperationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListBackupOperationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.ListBackupOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.ListBackupOperationsResponse} ListBackupOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupOperationsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.ListBackupOperationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.operations && message.operations.length)) + message.operations = []; + message.operations.push($root.google.longrunning.Operation.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListBackupOperationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.ListBackupOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.ListBackupOperationsResponse} ListBackupOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupOperationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListBackupOperationsResponse message. + * @function verify + * @memberof google.spanner.admin.database.v1.ListBackupOperationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListBackupOperationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.operations != null && message.hasOwnProperty("operations")) { + if (!Array.isArray(message.operations)) + return "operations: array expected"; + for (var i = 0; i < message.operations.length; ++i) { + var error = $root.google.longrunning.Operation.verify(message.operations[i]); + if (error) + return "operations." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListBackupOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.ListBackupOperationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.ListBackupOperationsResponse} ListBackupOperationsResponse + */ + ListBackupOperationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.ListBackupOperationsResponse) + return object; + var message = new $root.google.spanner.admin.database.v1.ListBackupOperationsResponse(); + if (object.operations) { + if (!Array.isArray(object.operations)) + throw TypeError(".google.spanner.admin.database.v1.ListBackupOperationsResponse.operations: array expected"); + message.operations = []; + for (var i = 0; i < object.operations.length; ++i) { + if (typeof object.operations[i] !== "object") + throw TypeError(".google.spanner.admin.database.v1.ListBackupOperationsResponse.operations: object expected"); + message.operations[i] = $root.google.longrunning.Operation.fromObject(object.operations[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListBackupOperationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.ListBackupOperationsResponse + * @static + * @param {google.spanner.admin.database.v1.ListBackupOperationsResponse} message ListBackupOperationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListBackupOperationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.operations = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.operations && message.operations.length) { + object.operations = []; + for (var j = 0; j < message.operations.length; ++j) + object.operations[j] = $root.google.longrunning.Operation.toObject(message.operations[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListBackupOperationsResponse to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.ListBackupOperationsResponse + * @instance + * @returns {Object.} JSON object + */ + ListBackupOperationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListBackupOperationsResponse + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.ListBackupOperationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListBackupOperationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.ListBackupOperationsResponse"; + }; + + return ListBackupOperationsResponse; + })(); + + v1.BackupInfo = (function() { + + /** + * Properties of a BackupInfo. + * @memberof google.spanner.admin.database.v1 + * @interface IBackupInfo + * @property {string|null} [backup] BackupInfo backup + * @property {google.protobuf.ITimestamp|null} [versionTime] BackupInfo versionTime + * @property {google.protobuf.ITimestamp|null} [createTime] BackupInfo createTime + * @property {string|null} [sourceDatabase] BackupInfo sourceDatabase + */ + + /** + * Constructs a new BackupInfo. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents a BackupInfo. + * @implements IBackupInfo + * @constructor + * @param {google.spanner.admin.database.v1.IBackupInfo=} [properties] Properties to set + */ + function BackupInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BackupInfo backup. + * @member {string} backup + * @memberof google.spanner.admin.database.v1.BackupInfo + * @instance + */ + BackupInfo.prototype.backup = ""; + + /** + * BackupInfo versionTime. + * @member {google.protobuf.ITimestamp|null|undefined} versionTime + * @memberof google.spanner.admin.database.v1.BackupInfo + * @instance + */ + BackupInfo.prototype.versionTime = null; + + /** + * BackupInfo createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.spanner.admin.database.v1.BackupInfo + * @instance + */ + BackupInfo.prototype.createTime = null; + + /** + * BackupInfo sourceDatabase. + * @member {string} sourceDatabase + * @memberof google.spanner.admin.database.v1.BackupInfo + * @instance + */ + BackupInfo.prototype.sourceDatabase = ""; + + /** + * Creates a new BackupInfo instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.BackupInfo + * @static + * @param {google.spanner.admin.database.v1.IBackupInfo=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.BackupInfo} BackupInfo instance + */ + BackupInfo.create = function create(properties) { + return new BackupInfo(properties); + }; + + /** + * Encodes the specified BackupInfo message. Does not implicitly {@link google.spanner.admin.database.v1.BackupInfo.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.BackupInfo + * @static + * @param {google.spanner.admin.database.v1.IBackupInfo} message BackupInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.backup != null && Object.hasOwnProperty.call(message, "backup")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.backup); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.sourceDatabase != null && Object.hasOwnProperty.call(message, "sourceDatabase")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.sourceDatabase); + if (message.versionTime != null && Object.hasOwnProperty.call(message, "versionTime")) + $root.google.protobuf.Timestamp.encode(message.versionTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BackupInfo message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.BackupInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.BackupInfo + * @static + * @param {google.spanner.admin.database.v1.IBackupInfo} message BackupInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BackupInfo message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.BackupInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.BackupInfo} BackupInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.BackupInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.backup = reader.string(); + break; + } + case 4: { + message.versionTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.sourceDatabase = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BackupInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.BackupInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.BackupInfo} BackupInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BackupInfo message. + * @function verify + * @memberof google.spanner.admin.database.v1.BackupInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BackupInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.backup != null && message.hasOwnProperty("backup")) + if (!$util.isString(message.backup)) + return "backup: string expected"; + if (message.versionTime != null && message.hasOwnProperty("versionTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.versionTime); + if (error) + return "versionTime." + error; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.sourceDatabase != null && message.hasOwnProperty("sourceDatabase")) + if (!$util.isString(message.sourceDatabase)) + return "sourceDatabase: string expected"; + return null; + }; + + /** + * Creates a BackupInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.BackupInfo + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.BackupInfo} BackupInfo + */ + BackupInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.BackupInfo) + return object; + var message = new $root.google.spanner.admin.database.v1.BackupInfo(); + if (object.backup != null) + message.backup = String(object.backup); + if (object.versionTime != null) { + if (typeof object.versionTime !== "object") + throw TypeError(".google.spanner.admin.database.v1.BackupInfo.versionTime: object expected"); + message.versionTime = $root.google.protobuf.Timestamp.fromObject(object.versionTime); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.spanner.admin.database.v1.BackupInfo.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.sourceDatabase != null) + message.sourceDatabase = String(object.sourceDatabase); + return message; + }; + + /** + * Creates a plain object from a BackupInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.BackupInfo + * @static + * @param {google.spanner.admin.database.v1.BackupInfo} message BackupInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BackupInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.backup = ""; + object.createTime = null; + object.sourceDatabase = ""; + object.versionTime = null; + } + if (message.backup != null && message.hasOwnProperty("backup")) + object.backup = message.backup; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.sourceDatabase != null && message.hasOwnProperty("sourceDatabase")) + object.sourceDatabase = message.sourceDatabase; + if (message.versionTime != null && message.hasOwnProperty("versionTime")) + object.versionTime = $root.google.protobuf.Timestamp.toObject(message.versionTime, options); + return object; + }; + + /** + * Converts this BackupInfo to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.BackupInfo + * @instance + * @returns {Object.} JSON object + */ + BackupInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BackupInfo + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.BackupInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BackupInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.BackupInfo"; + }; + + return BackupInfo; + })(); + + v1.CreateBackupEncryptionConfig = (function() { + + /** + * Properties of a CreateBackupEncryptionConfig. + * @memberof google.spanner.admin.database.v1 + * @interface ICreateBackupEncryptionConfig + * @property {google.spanner.admin.database.v1.CreateBackupEncryptionConfig.EncryptionType|null} [encryptionType] CreateBackupEncryptionConfig encryptionType + * @property {string|null} [kmsKeyName] CreateBackupEncryptionConfig kmsKeyName + * @property {Array.|null} [kmsKeyNames] CreateBackupEncryptionConfig kmsKeyNames + */ + + /** + * Constructs a new CreateBackupEncryptionConfig. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents a CreateBackupEncryptionConfig. + * @implements ICreateBackupEncryptionConfig + * @constructor + * @param {google.spanner.admin.database.v1.ICreateBackupEncryptionConfig=} [properties] Properties to set + */ + function CreateBackupEncryptionConfig(properties) { + this.kmsKeyNames = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateBackupEncryptionConfig encryptionType. + * @member {google.spanner.admin.database.v1.CreateBackupEncryptionConfig.EncryptionType} encryptionType + * @memberof google.spanner.admin.database.v1.CreateBackupEncryptionConfig + * @instance + */ + CreateBackupEncryptionConfig.prototype.encryptionType = 0; + + /** + * CreateBackupEncryptionConfig kmsKeyName. + * @member {string} kmsKeyName + * @memberof google.spanner.admin.database.v1.CreateBackupEncryptionConfig + * @instance + */ + CreateBackupEncryptionConfig.prototype.kmsKeyName = ""; + + /** + * CreateBackupEncryptionConfig kmsKeyNames. + * @member {Array.} kmsKeyNames + * @memberof google.spanner.admin.database.v1.CreateBackupEncryptionConfig + * @instance + */ + CreateBackupEncryptionConfig.prototype.kmsKeyNames = $util.emptyArray; + + /** + * Creates a new CreateBackupEncryptionConfig instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.CreateBackupEncryptionConfig + * @static + * @param {google.spanner.admin.database.v1.ICreateBackupEncryptionConfig=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.CreateBackupEncryptionConfig} CreateBackupEncryptionConfig instance + */ + CreateBackupEncryptionConfig.create = function create(properties) { + return new CreateBackupEncryptionConfig(properties); + }; + + /** + * Encodes the specified CreateBackupEncryptionConfig message. Does not implicitly {@link google.spanner.admin.database.v1.CreateBackupEncryptionConfig.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.CreateBackupEncryptionConfig + * @static + * @param {google.spanner.admin.database.v1.ICreateBackupEncryptionConfig} message CreateBackupEncryptionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateBackupEncryptionConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.encryptionType != null && Object.hasOwnProperty.call(message, "encryptionType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.encryptionType); + if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.kmsKeyName); + if (message.kmsKeyNames != null && message.kmsKeyNames.length) + for (var i = 0; i < message.kmsKeyNames.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.kmsKeyNames[i]); + return writer; + }; + + /** + * Encodes the specified CreateBackupEncryptionConfig message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.CreateBackupEncryptionConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.CreateBackupEncryptionConfig + * @static + * @param {google.spanner.admin.database.v1.ICreateBackupEncryptionConfig} message CreateBackupEncryptionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateBackupEncryptionConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateBackupEncryptionConfig message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.CreateBackupEncryptionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.CreateBackupEncryptionConfig} CreateBackupEncryptionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateBackupEncryptionConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.CreateBackupEncryptionConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.encryptionType = reader.int32(); + break; + } + case 2: { + message.kmsKeyName = reader.string(); + break; + } + case 3: { + if (!(message.kmsKeyNames && message.kmsKeyNames.length)) + message.kmsKeyNames = []; + message.kmsKeyNames.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateBackupEncryptionConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.CreateBackupEncryptionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.CreateBackupEncryptionConfig} CreateBackupEncryptionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateBackupEncryptionConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateBackupEncryptionConfig message. + * @function verify + * @memberof google.spanner.admin.database.v1.CreateBackupEncryptionConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateBackupEncryptionConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.encryptionType != null && message.hasOwnProperty("encryptionType")) + switch (message.encryptionType) { + default: + return "encryptionType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + if (!$util.isString(message.kmsKeyName)) + return "kmsKeyName: string expected"; + if (message.kmsKeyNames != null && message.hasOwnProperty("kmsKeyNames")) { + if (!Array.isArray(message.kmsKeyNames)) + return "kmsKeyNames: array expected"; + for (var i = 0; i < message.kmsKeyNames.length; ++i) + if (!$util.isString(message.kmsKeyNames[i])) + return "kmsKeyNames: string[] expected"; + } + return null; + }; + + /** + * Creates a CreateBackupEncryptionConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.CreateBackupEncryptionConfig + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.CreateBackupEncryptionConfig} CreateBackupEncryptionConfig + */ + CreateBackupEncryptionConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.CreateBackupEncryptionConfig) + return object; + var message = new $root.google.spanner.admin.database.v1.CreateBackupEncryptionConfig(); + switch (object.encryptionType) { + default: + if (typeof object.encryptionType === "number") { + message.encryptionType = object.encryptionType; + break; + } + break; + case "ENCRYPTION_TYPE_UNSPECIFIED": + case 0: + message.encryptionType = 0; + break; + case "USE_DATABASE_ENCRYPTION": + case 1: + message.encryptionType = 1; + break; + case "GOOGLE_DEFAULT_ENCRYPTION": + case 2: + message.encryptionType = 2; + break; + case "CUSTOMER_MANAGED_ENCRYPTION": + case 3: + message.encryptionType = 3; + break; + } + if (object.kmsKeyName != null) + message.kmsKeyName = String(object.kmsKeyName); + if (object.kmsKeyNames) { + if (!Array.isArray(object.kmsKeyNames)) + throw TypeError(".google.spanner.admin.database.v1.CreateBackupEncryptionConfig.kmsKeyNames: array expected"); + message.kmsKeyNames = []; + for (var i = 0; i < object.kmsKeyNames.length; ++i) + message.kmsKeyNames[i] = String(object.kmsKeyNames[i]); + } + return message; + }; + + /** + * Creates a plain object from a CreateBackupEncryptionConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.CreateBackupEncryptionConfig + * @static + * @param {google.spanner.admin.database.v1.CreateBackupEncryptionConfig} message CreateBackupEncryptionConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateBackupEncryptionConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.kmsKeyNames = []; + if (options.defaults) { + object.encryptionType = options.enums === String ? "ENCRYPTION_TYPE_UNSPECIFIED" : 0; + object.kmsKeyName = ""; + } + if (message.encryptionType != null && message.hasOwnProperty("encryptionType")) + object.encryptionType = options.enums === String ? $root.google.spanner.admin.database.v1.CreateBackupEncryptionConfig.EncryptionType[message.encryptionType] === undefined ? message.encryptionType : $root.google.spanner.admin.database.v1.CreateBackupEncryptionConfig.EncryptionType[message.encryptionType] : message.encryptionType; + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + object.kmsKeyName = message.kmsKeyName; + if (message.kmsKeyNames && message.kmsKeyNames.length) { + object.kmsKeyNames = []; + for (var j = 0; j < message.kmsKeyNames.length; ++j) + object.kmsKeyNames[j] = message.kmsKeyNames[j]; + } + return object; + }; + + /** + * Converts this CreateBackupEncryptionConfig to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.CreateBackupEncryptionConfig + * @instance + * @returns {Object.} JSON object + */ + CreateBackupEncryptionConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateBackupEncryptionConfig + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.CreateBackupEncryptionConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateBackupEncryptionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.CreateBackupEncryptionConfig"; + }; + + /** + * EncryptionType enum. + * @name google.spanner.admin.database.v1.CreateBackupEncryptionConfig.EncryptionType + * @enum {number} + * @property {number} ENCRYPTION_TYPE_UNSPECIFIED=0 ENCRYPTION_TYPE_UNSPECIFIED value + * @property {number} USE_DATABASE_ENCRYPTION=1 USE_DATABASE_ENCRYPTION value + * @property {number} GOOGLE_DEFAULT_ENCRYPTION=2 GOOGLE_DEFAULT_ENCRYPTION value + * @property {number} CUSTOMER_MANAGED_ENCRYPTION=3 CUSTOMER_MANAGED_ENCRYPTION value + */ + CreateBackupEncryptionConfig.EncryptionType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENCRYPTION_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "USE_DATABASE_ENCRYPTION"] = 1; + values[valuesById[2] = "GOOGLE_DEFAULT_ENCRYPTION"] = 2; + values[valuesById[3] = "CUSTOMER_MANAGED_ENCRYPTION"] = 3; + return values; + })(); + + return CreateBackupEncryptionConfig; + })(); + + v1.CopyBackupEncryptionConfig = (function() { + + /** + * Properties of a CopyBackupEncryptionConfig. + * @memberof google.spanner.admin.database.v1 + * @interface ICopyBackupEncryptionConfig + * @property {google.spanner.admin.database.v1.CopyBackupEncryptionConfig.EncryptionType|null} [encryptionType] CopyBackupEncryptionConfig encryptionType + * @property {string|null} [kmsKeyName] CopyBackupEncryptionConfig kmsKeyName + * @property {Array.|null} [kmsKeyNames] CopyBackupEncryptionConfig kmsKeyNames + */ + + /** + * Constructs a new CopyBackupEncryptionConfig. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents a CopyBackupEncryptionConfig. + * @implements ICopyBackupEncryptionConfig + * @constructor + * @param {google.spanner.admin.database.v1.ICopyBackupEncryptionConfig=} [properties] Properties to set + */ + function CopyBackupEncryptionConfig(properties) { + this.kmsKeyNames = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CopyBackupEncryptionConfig encryptionType. + * @member {google.spanner.admin.database.v1.CopyBackupEncryptionConfig.EncryptionType} encryptionType + * @memberof google.spanner.admin.database.v1.CopyBackupEncryptionConfig + * @instance + */ + CopyBackupEncryptionConfig.prototype.encryptionType = 0; + + /** + * CopyBackupEncryptionConfig kmsKeyName. + * @member {string} kmsKeyName + * @memberof google.spanner.admin.database.v1.CopyBackupEncryptionConfig + * @instance + */ + CopyBackupEncryptionConfig.prototype.kmsKeyName = ""; + + /** + * CopyBackupEncryptionConfig kmsKeyNames. + * @member {Array.} kmsKeyNames + * @memberof google.spanner.admin.database.v1.CopyBackupEncryptionConfig + * @instance + */ + CopyBackupEncryptionConfig.prototype.kmsKeyNames = $util.emptyArray; + + /** + * Creates a new CopyBackupEncryptionConfig instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.CopyBackupEncryptionConfig + * @static + * @param {google.spanner.admin.database.v1.ICopyBackupEncryptionConfig=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.CopyBackupEncryptionConfig} CopyBackupEncryptionConfig instance + */ + CopyBackupEncryptionConfig.create = function create(properties) { + return new CopyBackupEncryptionConfig(properties); + }; + + /** + * Encodes the specified CopyBackupEncryptionConfig message. Does not implicitly {@link google.spanner.admin.database.v1.CopyBackupEncryptionConfig.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.CopyBackupEncryptionConfig + * @static + * @param {google.spanner.admin.database.v1.ICopyBackupEncryptionConfig} message CopyBackupEncryptionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CopyBackupEncryptionConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.encryptionType != null && Object.hasOwnProperty.call(message, "encryptionType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.encryptionType); + if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.kmsKeyName); + if (message.kmsKeyNames != null && message.kmsKeyNames.length) + for (var i = 0; i < message.kmsKeyNames.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.kmsKeyNames[i]); + return writer; + }; + + /** + * Encodes the specified CopyBackupEncryptionConfig message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.CopyBackupEncryptionConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.CopyBackupEncryptionConfig + * @static + * @param {google.spanner.admin.database.v1.ICopyBackupEncryptionConfig} message CopyBackupEncryptionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CopyBackupEncryptionConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CopyBackupEncryptionConfig message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.CopyBackupEncryptionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.CopyBackupEncryptionConfig} CopyBackupEncryptionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CopyBackupEncryptionConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.CopyBackupEncryptionConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.encryptionType = reader.int32(); + break; + } + case 2: { + message.kmsKeyName = reader.string(); + break; + } + case 3: { + if (!(message.kmsKeyNames && message.kmsKeyNames.length)) + message.kmsKeyNames = []; + message.kmsKeyNames.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CopyBackupEncryptionConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.CopyBackupEncryptionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.CopyBackupEncryptionConfig} CopyBackupEncryptionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CopyBackupEncryptionConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CopyBackupEncryptionConfig message. + * @function verify + * @memberof google.spanner.admin.database.v1.CopyBackupEncryptionConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CopyBackupEncryptionConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.encryptionType != null && message.hasOwnProperty("encryptionType")) + switch (message.encryptionType) { + default: + return "encryptionType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + if (!$util.isString(message.kmsKeyName)) + return "kmsKeyName: string expected"; + if (message.kmsKeyNames != null && message.hasOwnProperty("kmsKeyNames")) { + if (!Array.isArray(message.kmsKeyNames)) + return "kmsKeyNames: array expected"; + for (var i = 0; i < message.kmsKeyNames.length; ++i) + if (!$util.isString(message.kmsKeyNames[i])) + return "kmsKeyNames: string[] expected"; + } + return null; + }; + + /** + * Creates a CopyBackupEncryptionConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.CopyBackupEncryptionConfig + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.CopyBackupEncryptionConfig} CopyBackupEncryptionConfig + */ + CopyBackupEncryptionConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.CopyBackupEncryptionConfig) + return object; + var message = new $root.google.spanner.admin.database.v1.CopyBackupEncryptionConfig(); + switch (object.encryptionType) { + default: + if (typeof object.encryptionType === "number") { + message.encryptionType = object.encryptionType; + break; + } + break; + case "ENCRYPTION_TYPE_UNSPECIFIED": + case 0: + message.encryptionType = 0; + break; + case "USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION": + case 1: + message.encryptionType = 1; + break; + case "GOOGLE_DEFAULT_ENCRYPTION": + case 2: + message.encryptionType = 2; + break; + case "CUSTOMER_MANAGED_ENCRYPTION": + case 3: + message.encryptionType = 3; + break; + } + if (object.kmsKeyName != null) + message.kmsKeyName = String(object.kmsKeyName); + if (object.kmsKeyNames) { + if (!Array.isArray(object.kmsKeyNames)) + throw TypeError(".google.spanner.admin.database.v1.CopyBackupEncryptionConfig.kmsKeyNames: array expected"); + message.kmsKeyNames = []; + for (var i = 0; i < object.kmsKeyNames.length; ++i) + message.kmsKeyNames[i] = String(object.kmsKeyNames[i]); + } + return message; + }; + + /** + * Creates a plain object from a CopyBackupEncryptionConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.CopyBackupEncryptionConfig + * @static + * @param {google.spanner.admin.database.v1.CopyBackupEncryptionConfig} message CopyBackupEncryptionConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CopyBackupEncryptionConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.kmsKeyNames = []; + if (options.defaults) { + object.encryptionType = options.enums === String ? "ENCRYPTION_TYPE_UNSPECIFIED" : 0; + object.kmsKeyName = ""; + } + if (message.encryptionType != null && message.hasOwnProperty("encryptionType")) + object.encryptionType = options.enums === String ? $root.google.spanner.admin.database.v1.CopyBackupEncryptionConfig.EncryptionType[message.encryptionType] === undefined ? message.encryptionType : $root.google.spanner.admin.database.v1.CopyBackupEncryptionConfig.EncryptionType[message.encryptionType] : message.encryptionType; + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + object.kmsKeyName = message.kmsKeyName; + if (message.kmsKeyNames && message.kmsKeyNames.length) { + object.kmsKeyNames = []; + for (var j = 0; j < message.kmsKeyNames.length; ++j) + object.kmsKeyNames[j] = message.kmsKeyNames[j]; + } + return object; + }; + + /** + * Converts this CopyBackupEncryptionConfig to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.CopyBackupEncryptionConfig + * @instance + * @returns {Object.} JSON object + */ + CopyBackupEncryptionConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CopyBackupEncryptionConfig + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.CopyBackupEncryptionConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CopyBackupEncryptionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.CopyBackupEncryptionConfig"; + }; + + /** + * EncryptionType enum. + * @name google.spanner.admin.database.v1.CopyBackupEncryptionConfig.EncryptionType + * @enum {number} + * @property {number} ENCRYPTION_TYPE_UNSPECIFIED=0 ENCRYPTION_TYPE_UNSPECIFIED value + * @property {number} USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION=1 USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION value + * @property {number} GOOGLE_DEFAULT_ENCRYPTION=2 GOOGLE_DEFAULT_ENCRYPTION value + * @property {number} CUSTOMER_MANAGED_ENCRYPTION=3 CUSTOMER_MANAGED_ENCRYPTION value + */ + CopyBackupEncryptionConfig.EncryptionType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENCRYPTION_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION"] = 1; + values[valuesById[2] = "GOOGLE_DEFAULT_ENCRYPTION"] = 2; + values[valuesById[3] = "CUSTOMER_MANAGED_ENCRYPTION"] = 3; + return values; + })(); + + return CopyBackupEncryptionConfig; + })(); + + v1.FullBackupSpec = (function() { + + /** + * Properties of a FullBackupSpec. + * @memberof google.spanner.admin.database.v1 + * @interface IFullBackupSpec + */ + + /** + * Constructs a new FullBackupSpec. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents a FullBackupSpec. + * @implements IFullBackupSpec + * @constructor + * @param {google.spanner.admin.database.v1.IFullBackupSpec=} [properties] Properties to set + */ + function FullBackupSpec(properties) { + if (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 FullBackupSpec instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.FullBackupSpec + * @static + * @param {google.spanner.admin.database.v1.IFullBackupSpec=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.FullBackupSpec} FullBackupSpec instance + */ + FullBackupSpec.create = function create(properties) { + return new FullBackupSpec(properties); + }; + + /** + * Encodes the specified FullBackupSpec message. Does not implicitly {@link google.spanner.admin.database.v1.FullBackupSpec.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.FullBackupSpec + * @static + * @param {google.spanner.admin.database.v1.IFullBackupSpec} message FullBackupSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FullBackupSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified FullBackupSpec message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.FullBackupSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.FullBackupSpec + * @static + * @param {google.spanner.admin.database.v1.IFullBackupSpec} message FullBackupSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FullBackupSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FullBackupSpec message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.FullBackupSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.FullBackupSpec} FullBackupSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FullBackupSpec.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.FullBackupSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FullBackupSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.FullBackupSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.FullBackupSpec} FullBackupSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FullBackupSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FullBackupSpec message. + * @function verify + * @memberof google.spanner.admin.database.v1.FullBackupSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FullBackupSpec.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a FullBackupSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.FullBackupSpec + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.FullBackupSpec} FullBackupSpec + */ + FullBackupSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.FullBackupSpec) + return object; + return new $root.google.spanner.admin.database.v1.FullBackupSpec(); + }; + + /** + * Creates a plain object from a FullBackupSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.FullBackupSpec + * @static + * @param {google.spanner.admin.database.v1.FullBackupSpec} message FullBackupSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FullBackupSpec.toObject = function toObject() { + return {}; + }; + + /** + * Converts this FullBackupSpec to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.FullBackupSpec + * @instance + * @returns {Object.} JSON object + */ + FullBackupSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FullBackupSpec + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.FullBackupSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FullBackupSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.FullBackupSpec"; + }; + + return FullBackupSpec; + })(); + + v1.IncrementalBackupSpec = (function() { + + /** + * Properties of an IncrementalBackupSpec. + * @memberof google.spanner.admin.database.v1 + * @interface IIncrementalBackupSpec + */ + + /** + * Constructs a new IncrementalBackupSpec. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents an IncrementalBackupSpec. + * @implements IIncrementalBackupSpec + * @constructor + * @param {google.spanner.admin.database.v1.IIncrementalBackupSpec=} [properties] Properties to set + */ + function IncrementalBackupSpec(properties) { + if (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 IncrementalBackupSpec instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.IncrementalBackupSpec + * @static + * @param {google.spanner.admin.database.v1.IIncrementalBackupSpec=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.IncrementalBackupSpec} IncrementalBackupSpec instance + */ + IncrementalBackupSpec.create = function create(properties) { + return new IncrementalBackupSpec(properties); + }; + + /** + * Encodes the specified IncrementalBackupSpec message. Does not implicitly {@link google.spanner.admin.database.v1.IncrementalBackupSpec.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.IncrementalBackupSpec + * @static + * @param {google.spanner.admin.database.v1.IIncrementalBackupSpec} message IncrementalBackupSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IncrementalBackupSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified IncrementalBackupSpec message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.IncrementalBackupSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.IncrementalBackupSpec + * @static + * @param {google.spanner.admin.database.v1.IIncrementalBackupSpec} message IncrementalBackupSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IncrementalBackupSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IncrementalBackupSpec message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.IncrementalBackupSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.IncrementalBackupSpec} IncrementalBackupSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IncrementalBackupSpec.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.IncrementalBackupSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IncrementalBackupSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.IncrementalBackupSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.IncrementalBackupSpec} IncrementalBackupSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IncrementalBackupSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IncrementalBackupSpec message. + * @function verify + * @memberof google.spanner.admin.database.v1.IncrementalBackupSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IncrementalBackupSpec.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an IncrementalBackupSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.IncrementalBackupSpec + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.IncrementalBackupSpec} IncrementalBackupSpec + */ + IncrementalBackupSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.IncrementalBackupSpec) + return object; + return new $root.google.spanner.admin.database.v1.IncrementalBackupSpec(); + }; + + /** + * Creates a plain object from an IncrementalBackupSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.IncrementalBackupSpec + * @static + * @param {google.spanner.admin.database.v1.IncrementalBackupSpec} message IncrementalBackupSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IncrementalBackupSpec.toObject = function toObject() { + return {}; + }; + + /** + * Converts this IncrementalBackupSpec to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.IncrementalBackupSpec + * @instance + * @returns {Object.} JSON object + */ + IncrementalBackupSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IncrementalBackupSpec + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.IncrementalBackupSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IncrementalBackupSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.IncrementalBackupSpec"; + }; + + return IncrementalBackupSpec; + })(); + + v1.BackupInstancePartition = (function() { + + /** + * Properties of a BackupInstancePartition. + * @memberof google.spanner.admin.database.v1 + * @interface IBackupInstancePartition + * @property {string|null} [instancePartition] BackupInstancePartition instancePartition + */ + + /** + * Constructs a new BackupInstancePartition. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents a BackupInstancePartition. + * @implements IBackupInstancePartition + * @constructor + * @param {google.spanner.admin.database.v1.IBackupInstancePartition=} [properties] Properties to set + */ + function BackupInstancePartition(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BackupInstancePartition instancePartition. + * @member {string} instancePartition + * @memberof google.spanner.admin.database.v1.BackupInstancePartition + * @instance + */ + BackupInstancePartition.prototype.instancePartition = ""; + + /** + * Creates a new BackupInstancePartition instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.BackupInstancePartition + * @static + * @param {google.spanner.admin.database.v1.IBackupInstancePartition=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.BackupInstancePartition} BackupInstancePartition instance + */ + BackupInstancePartition.create = function create(properties) { + return new BackupInstancePartition(properties); + }; + + /** + * Encodes the specified BackupInstancePartition message. Does not implicitly {@link google.spanner.admin.database.v1.BackupInstancePartition.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.BackupInstancePartition + * @static + * @param {google.spanner.admin.database.v1.IBackupInstancePartition} message BackupInstancePartition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupInstancePartition.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.instancePartition != null && Object.hasOwnProperty.call(message, "instancePartition")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.instancePartition); + return writer; + }; + + /** + * Encodes the specified BackupInstancePartition message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.BackupInstancePartition.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.BackupInstancePartition + * @static + * @param {google.spanner.admin.database.v1.IBackupInstancePartition} message BackupInstancePartition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupInstancePartition.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BackupInstancePartition message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.BackupInstancePartition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.BackupInstancePartition} BackupInstancePartition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupInstancePartition.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.BackupInstancePartition(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.instancePartition = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BackupInstancePartition message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.BackupInstancePartition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.BackupInstancePartition} BackupInstancePartition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupInstancePartition.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BackupInstancePartition message. + * @function verify + * @memberof google.spanner.admin.database.v1.BackupInstancePartition + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BackupInstancePartition.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.instancePartition != null && message.hasOwnProperty("instancePartition")) + if (!$util.isString(message.instancePartition)) + return "instancePartition: string expected"; + return null; + }; + + /** + * Creates a BackupInstancePartition message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.BackupInstancePartition + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.BackupInstancePartition} BackupInstancePartition + */ + BackupInstancePartition.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.BackupInstancePartition) + return object; + var message = new $root.google.spanner.admin.database.v1.BackupInstancePartition(); + if (object.instancePartition != null) + message.instancePartition = String(object.instancePartition); + return message; + }; + + /** + * Creates a plain object from a BackupInstancePartition message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.BackupInstancePartition + * @static + * @param {google.spanner.admin.database.v1.BackupInstancePartition} message BackupInstancePartition + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BackupInstancePartition.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.instancePartition = ""; + if (message.instancePartition != null && message.hasOwnProperty("instancePartition")) + object.instancePartition = message.instancePartition; + return object; + }; + + /** + * Converts this BackupInstancePartition to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.BackupInstancePartition + * @instance + * @returns {Object.} JSON object + */ + BackupInstancePartition.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BackupInstancePartition + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.BackupInstancePartition + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BackupInstancePartition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.BackupInstancePartition"; + }; + + return BackupInstancePartition; + })(); + + v1.OperationProgress = (function() { + + /** + * Properties of an OperationProgress. + * @memberof google.spanner.admin.database.v1 + * @interface IOperationProgress + * @property {number|null} [progressPercent] OperationProgress progressPercent + * @property {google.protobuf.ITimestamp|null} [startTime] OperationProgress startTime + * @property {google.protobuf.ITimestamp|null} [endTime] OperationProgress endTime + */ + + /** + * Constructs a new OperationProgress. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents an OperationProgress. + * @implements IOperationProgress + * @constructor + * @param {google.spanner.admin.database.v1.IOperationProgress=} [properties] Properties to set + */ + function OperationProgress(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OperationProgress progressPercent. + * @member {number} progressPercent + * @memberof google.spanner.admin.database.v1.OperationProgress + * @instance + */ + OperationProgress.prototype.progressPercent = 0; + + /** + * OperationProgress startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.spanner.admin.database.v1.OperationProgress + * @instance + */ + OperationProgress.prototype.startTime = null; + + /** + * OperationProgress endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.spanner.admin.database.v1.OperationProgress + * @instance + */ + OperationProgress.prototype.endTime = null; + + /** + * Creates a new OperationProgress instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.OperationProgress + * @static + * @param {google.spanner.admin.database.v1.IOperationProgress=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.OperationProgress} OperationProgress instance + */ + OperationProgress.create = function create(properties) { + return new OperationProgress(properties); + }; + + /** + * Encodes the specified OperationProgress message. Does not implicitly {@link google.spanner.admin.database.v1.OperationProgress.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.OperationProgress + * @static + * @param {google.spanner.admin.database.v1.IOperationProgress} message OperationProgress message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationProgress.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.progressPercent != null && Object.hasOwnProperty.call(message, "progressPercent")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.progressPercent); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OperationProgress message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.OperationProgress.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.OperationProgress + * @static + * @param {google.spanner.admin.database.v1.IOperationProgress} message OperationProgress message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationProgress.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationProgress message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.OperationProgress + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.OperationProgress} OperationProgress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationProgress.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.OperationProgress(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.progressPercent = reader.int32(); + break; + } + case 2: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationProgress message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.OperationProgress + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.OperationProgress} OperationProgress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationProgress.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationProgress message. + * @function verify + * @memberof google.spanner.admin.database.v1.OperationProgress + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationProgress.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.progressPercent != null && message.hasOwnProperty("progressPercent")) + if (!$util.isInteger(message.progressPercent)) + return "progressPercent: integer expected"; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + return null; + }; + + /** + * Creates an OperationProgress message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.OperationProgress + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.OperationProgress} OperationProgress + */ + OperationProgress.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.OperationProgress) + return object; + var message = new $root.google.spanner.admin.database.v1.OperationProgress(); + if (object.progressPercent != null) + message.progressPercent = object.progressPercent | 0; + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.spanner.admin.database.v1.OperationProgress.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.spanner.admin.database.v1.OperationProgress.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + return message; + }; + + /** + * Creates a plain object from an OperationProgress message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.OperationProgress + * @static + * @param {google.spanner.admin.database.v1.OperationProgress} message OperationProgress + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationProgress.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.progressPercent = 0; + object.startTime = null; + object.endTime = null; + } + if (message.progressPercent != null && message.hasOwnProperty("progressPercent")) + object.progressPercent = message.progressPercent; + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + return object; + }; + + /** + * Converts this OperationProgress to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.OperationProgress + * @instance + * @returns {Object.} JSON object + */ + OperationProgress.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OperationProgress + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.OperationProgress + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OperationProgress.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.OperationProgress"; + }; + + return OperationProgress; + })(); + + v1.EncryptionConfig = (function() { + + /** + * Properties of an EncryptionConfig. + * @memberof google.spanner.admin.database.v1 + * @interface IEncryptionConfig + * @property {string|null} [kmsKeyName] EncryptionConfig kmsKeyName + * @property {Array.|null} [kmsKeyNames] EncryptionConfig kmsKeyNames + */ + + /** + * Constructs a new EncryptionConfig. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents an EncryptionConfig. + * @implements IEncryptionConfig + * @constructor + * @param {google.spanner.admin.database.v1.IEncryptionConfig=} [properties] Properties to set + */ + function EncryptionConfig(properties) { + this.kmsKeyNames = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EncryptionConfig kmsKeyName. + * @member {string} kmsKeyName + * @memberof google.spanner.admin.database.v1.EncryptionConfig + * @instance + */ + EncryptionConfig.prototype.kmsKeyName = ""; + + /** + * EncryptionConfig kmsKeyNames. + * @member {Array.} kmsKeyNames + * @memberof google.spanner.admin.database.v1.EncryptionConfig + * @instance + */ + EncryptionConfig.prototype.kmsKeyNames = $util.emptyArray; + + /** + * Creates a new EncryptionConfig instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.EncryptionConfig + * @static + * @param {google.spanner.admin.database.v1.IEncryptionConfig=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.EncryptionConfig} EncryptionConfig instance + */ + EncryptionConfig.create = function create(properties) { + return new EncryptionConfig(properties); + }; + + /** + * Encodes the specified EncryptionConfig message. Does not implicitly {@link google.spanner.admin.database.v1.EncryptionConfig.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.EncryptionConfig + * @static + * @param {google.spanner.admin.database.v1.IEncryptionConfig} message EncryptionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EncryptionConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.kmsKeyName); + if (message.kmsKeyNames != null && message.kmsKeyNames.length) + for (var i = 0; i < message.kmsKeyNames.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.kmsKeyNames[i]); + return writer; + }; + + /** + * Encodes the specified EncryptionConfig message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.EncryptionConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.EncryptionConfig + * @static + * @param {google.spanner.admin.database.v1.IEncryptionConfig} message EncryptionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EncryptionConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EncryptionConfig message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.EncryptionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.EncryptionConfig} EncryptionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EncryptionConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.EncryptionConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.kmsKeyName = reader.string(); + break; + } + case 3: { + if (!(message.kmsKeyNames && message.kmsKeyNames.length)) + message.kmsKeyNames = []; + message.kmsKeyNames.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EncryptionConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.EncryptionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.EncryptionConfig} EncryptionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EncryptionConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EncryptionConfig message. + * @function verify + * @memberof google.spanner.admin.database.v1.EncryptionConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EncryptionConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + if (!$util.isString(message.kmsKeyName)) + return "kmsKeyName: string expected"; + if (message.kmsKeyNames != null && message.hasOwnProperty("kmsKeyNames")) { + if (!Array.isArray(message.kmsKeyNames)) + return "kmsKeyNames: array expected"; + for (var i = 0; i < message.kmsKeyNames.length; ++i) + if (!$util.isString(message.kmsKeyNames[i])) + return "kmsKeyNames: string[] expected"; + } + return null; + }; + + /** + * Creates an EncryptionConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.EncryptionConfig + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.EncryptionConfig} EncryptionConfig + */ + EncryptionConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.EncryptionConfig) + return object; + var message = new $root.google.spanner.admin.database.v1.EncryptionConfig(); + if (object.kmsKeyName != null) + message.kmsKeyName = String(object.kmsKeyName); + if (object.kmsKeyNames) { + if (!Array.isArray(object.kmsKeyNames)) + throw TypeError(".google.spanner.admin.database.v1.EncryptionConfig.kmsKeyNames: array expected"); + message.kmsKeyNames = []; + for (var i = 0; i < object.kmsKeyNames.length; ++i) + message.kmsKeyNames[i] = String(object.kmsKeyNames[i]); + } + return message; + }; + + /** + * Creates a plain object from an EncryptionConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.EncryptionConfig + * @static + * @param {google.spanner.admin.database.v1.EncryptionConfig} message EncryptionConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EncryptionConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.kmsKeyNames = []; + if (options.defaults) + object.kmsKeyName = ""; + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + object.kmsKeyName = message.kmsKeyName; + if (message.kmsKeyNames && message.kmsKeyNames.length) { + object.kmsKeyNames = []; + for (var j = 0; j < message.kmsKeyNames.length; ++j) + object.kmsKeyNames[j] = message.kmsKeyNames[j]; + } + return object; + }; + + /** + * Converts this EncryptionConfig to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.EncryptionConfig + * @instance + * @returns {Object.} JSON object + */ + EncryptionConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EncryptionConfig + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.EncryptionConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EncryptionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.EncryptionConfig"; + }; + + return EncryptionConfig; + })(); + + v1.EncryptionInfo = (function() { + + /** + * Properties of an EncryptionInfo. + * @memberof google.spanner.admin.database.v1 + * @interface IEncryptionInfo + * @property {google.spanner.admin.database.v1.EncryptionInfo.Type|null} [encryptionType] EncryptionInfo encryptionType + * @property {google.rpc.IStatus|null} [encryptionStatus] EncryptionInfo encryptionStatus + * @property {string|null} [kmsKeyVersion] EncryptionInfo kmsKeyVersion + */ + + /** + * Constructs a new EncryptionInfo. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents an EncryptionInfo. + * @implements IEncryptionInfo + * @constructor + * @param {google.spanner.admin.database.v1.IEncryptionInfo=} [properties] Properties to set + */ + function EncryptionInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EncryptionInfo encryptionType. + * @member {google.spanner.admin.database.v1.EncryptionInfo.Type} encryptionType + * @memberof google.spanner.admin.database.v1.EncryptionInfo + * @instance + */ + EncryptionInfo.prototype.encryptionType = 0; + + /** + * EncryptionInfo encryptionStatus. + * @member {google.rpc.IStatus|null|undefined} encryptionStatus + * @memberof google.spanner.admin.database.v1.EncryptionInfo + * @instance + */ + EncryptionInfo.prototype.encryptionStatus = null; + + /** + * EncryptionInfo kmsKeyVersion. + * @member {string} kmsKeyVersion + * @memberof google.spanner.admin.database.v1.EncryptionInfo + * @instance + */ + EncryptionInfo.prototype.kmsKeyVersion = ""; + + /** + * Creates a new EncryptionInfo instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.EncryptionInfo + * @static + * @param {google.spanner.admin.database.v1.IEncryptionInfo=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.EncryptionInfo} EncryptionInfo instance + */ + EncryptionInfo.create = function create(properties) { + return new EncryptionInfo(properties); + }; + + /** + * Encodes the specified EncryptionInfo message. Does not implicitly {@link google.spanner.admin.database.v1.EncryptionInfo.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.EncryptionInfo + * @static + * @param {google.spanner.admin.database.v1.IEncryptionInfo} message EncryptionInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EncryptionInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kmsKeyVersion != null && Object.hasOwnProperty.call(message, "kmsKeyVersion")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.kmsKeyVersion); + if (message.encryptionType != null && Object.hasOwnProperty.call(message, "encryptionType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.encryptionType); + if (message.encryptionStatus != null && Object.hasOwnProperty.call(message, "encryptionStatus")) + $root.google.rpc.Status.encode(message.encryptionStatus, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EncryptionInfo message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.EncryptionInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.EncryptionInfo + * @static + * @param {google.spanner.admin.database.v1.IEncryptionInfo} message EncryptionInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EncryptionInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EncryptionInfo message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.EncryptionInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.EncryptionInfo} EncryptionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EncryptionInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.EncryptionInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.encryptionType = reader.int32(); + break; + } + case 4: { + message.encryptionStatus = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 2: { + message.kmsKeyVersion = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EncryptionInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.EncryptionInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.EncryptionInfo} EncryptionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EncryptionInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EncryptionInfo message. + * @function verify + * @memberof google.spanner.admin.database.v1.EncryptionInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EncryptionInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.encryptionType != null && message.hasOwnProperty("encryptionType")) + switch (message.encryptionType) { + default: + return "encryptionType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.encryptionStatus != null && message.hasOwnProperty("encryptionStatus")) { + var error = $root.google.rpc.Status.verify(message.encryptionStatus); + if (error) + return "encryptionStatus." + error; + } + if (message.kmsKeyVersion != null && message.hasOwnProperty("kmsKeyVersion")) + if (!$util.isString(message.kmsKeyVersion)) + return "kmsKeyVersion: string expected"; + return null; + }; + + /** + * Creates an EncryptionInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.EncryptionInfo + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.EncryptionInfo} EncryptionInfo + */ + EncryptionInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.EncryptionInfo) + return object; + var message = new $root.google.spanner.admin.database.v1.EncryptionInfo(); + switch (object.encryptionType) { + default: + if (typeof object.encryptionType === "number") { + message.encryptionType = object.encryptionType; + break; + } + break; + case "TYPE_UNSPECIFIED": + case 0: + message.encryptionType = 0; + break; + case "GOOGLE_DEFAULT_ENCRYPTION": + case 1: + message.encryptionType = 1; + break; + case "CUSTOMER_MANAGED_ENCRYPTION": + case 2: + message.encryptionType = 2; + break; + } + if (object.encryptionStatus != null) { + if (typeof object.encryptionStatus !== "object") + throw TypeError(".google.spanner.admin.database.v1.EncryptionInfo.encryptionStatus: object expected"); + message.encryptionStatus = $root.google.rpc.Status.fromObject(object.encryptionStatus); + } + if (object.kmsKeyVersion != null) + message.kmsKeyVersion = String(object.kmsKeyVersion); + return message; + }; + + /** + * Creates a plain object from an EncryptionInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.EncryptionInfo + * @static + * @param {google.spanner.admin.database.v1.EncryptionInfo} message EncryptionInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EncryptionInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.kmsKeyVersion = ""; + object.encryptionType = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.encryptionStatus = null; + } + if (message.kmsKeyVersion != null && message.hasOwnProperty("kmsKeyVersion")) + object.kmsKeyVersion = message.kmsKeyVersion; + if (message.encryptionType != null && message.hasOwnProperty("encryptionType")) + object.encryptionType = options.enums === String ? $root.google.spanner.admin.database.v1.EncryptionInfo.Type[message.encryptionType] === undefined ? message.encryptionType : $root.google.spanner.admin.database.v1.EncryptionInfo.Type[message.encryptionType] : message.encryptionType; + if (message.encryptionStatus != null && message.hasOwnProperty("encryptionStatus")) + object.encryptionStatus = $root.google.rpc.Status.toObject(message.encryptionStatus, options); + return object; + }; + + /** + * Converts this EncryptionInfo to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.EncryptionInfo + * @instance + * @returns {Object.} JSON object + */ + EncryptionInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EncryptionInfo + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.EncryptionInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EncryptionInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.EncryptionInfo"; + }; + + /** + * Type enum. + * @name google.spanner.admin.database.v1.EncryptionInfo.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} GOOGLE_DEFAULT_ENCRYPTION=1 GOOGLE_DEFAULT_ENCRYPTION value + * @property {number} CUSTOMER_MANAGED_ENCRYPTION=2 CUSTOMER_MANAGED_ENCRYPTION value + */ + EncryptionInfo.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "GOOGLE_DEFAULT_ENCRYPTION"] = 1; + values[valuesById[2] = "CUSTOMER_MANAGED_ENCRYPTION"] = 2; + return values; + })(); + + return EncryptionInfo; + })(); + + /** + * DatabaseDialect enum. + * @name google.spanner.admin.database.v1.DatabaseDialect + * @enum {number} + * @property {number} DATABASE_DIALECT_UNSPECIFIED=0 DATABASE_DIALECT_UNSPECIFIED value + * @property {number} GOOGLE_STANDARD_SQL=1 GOOGLE_STANDARD_SQL value + * @property {number} POSTGRESQL=2 POSTGRESQL value + */ + v1.DatabaseDialect = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DATABASE_DIALECT_UNSPECIFIED"] = 0; + values[valuesById[1] = "GOOGLE_STANDARD_SQL"] = 1; + values[valuesById[2] = "POSTGRESQL"] = 2; + return values; + })(); + + v1.BackupScheduleSpec = (function() { + + /** + * Properties of a BackupScheduleSpec. + * @memberof google.spanner.admin.database.v1 + * @interface IBackupScheduleSpec + * @property {google.spanner.admin.database.v1.ICrontabSpec|null} [cronSpec] BackupScheduleSpec cronSpec + */ + + /** + * Constructs a new BackupScheduleSpec. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents a BackupScheduleSpec. + * @implements IBackupScheduleSpec + * @constructor + * @param {google.spanner.admin.database.v1.IBackupScheduleSpec=} [properties] Properties to set + */ + function BackupScheduleSpec(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BackupScheduleSpec cronSpec. + * @member {google.spanner.admin.database.v1.ICrontabSpec|null|undefined} cronSpec + * @memberof google.spanner.admin.database.v1.BackupScheduleSpec + * @instance + */ + BackupScheduleSpec.prototype.cronSpec = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BackupScheduleSpec scheduleSpec. + * @member {"cronSpec"|undefined} scheduleSpec + * @memberof google.spanner.admin.database.v1.BackupScheduleSpec + * @instance + */ + Object.defineProperty(BackupScheduleSpec.prototype, "scheduleSpec", { + get: $util.oneOfGetter($oneOfFields = ["cronSpec"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BackupScheduleSpec instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.BackupScheduleSpec + * @static + * @param {google.spanner.admin.database.v1.IBackupScheduleSpec=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.BackupScheduleSpec} BackupScheduleSpec instance + */ + BackupScheduleSpec.create = function create(properties) { + return new BackupScheduleSpec(properties); + }; + + /** + * Encodes the specified BackupScheduleSpec message. Does not implicitly {@link google.spanner.admin.database.v1.BackupScheduleSpec.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.BackupScheduleSpec + * @static + * @param {google.spanner.admin.database.v1.IBackupScheduleSpec} message BackupScheduleSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupScheduleSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cronSpec != null && Object.hasOwnProperty.call(message, "cronSpec")) + $root.google.spanner.admin.database.v1.CrontabSpec.encode(message.cronSpec, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BackupScheduleSpec message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.BackupScheduleSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.BackupScheduleSpec + * @static + * @param {google.spanner.admin.database.v1.IBackupScheduleSpec} message BackupScheduleSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupScheduleSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BackupScheduleSpec message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.BackupScheduleSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.BackupScheduleSpec} BackupScheduleSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupScheduleSpec.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.BackupScheduleSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.cronSpec = $root.google.spanner.admin.database.v1.CrontabSpec.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BackupScheduleSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.BackupScheduleSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.BackupScheduleSpec} BackupScheduleSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupScheduleSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BackupScheduleSpec message. + * @function verify + * @memberof google.spanner.admin.database.v1.BackupScheduleSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BackupScheduleSpec.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.cronSpec != null && message.hasOwnProperty("cronSpec")) { + properties.scheduleSpec = 1; + { + var error = $root.google.spanner.admin.database.v1.CrontabSpec.verify(message.cronSpec); + if (error) + return "cronSpec." + error; + } + } + return null; + }; + + /** + * Creates a BackupScheduleSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.BackupScheduleSpec + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.BackupScheduleSpec} BackupScheduleSpec + */ + BackupScheduleSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.BackupScheduleSpec) + return object; + var message = new $root.google.spanner.admin.database.v1.BackupScheduleSpec(); + if (object.cronSpec != null) { + if (typeof object.cronSpec !== "object") + throw TypeError(".google.spanner.admin.database.v1.BackupScheduleSpec.cronSpec: object expected"); + message.cronSpec = $root.google.spanner.admin.database.v1.CrontabSpec.fromObject(object.cronSpec); + } + return message; + }; + + /** + * Creates a plain object from a BackupScheduleSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.BackupScheduleSpec + * @static + * @param {google.spanner.admin.database.v1.BackupScheduleSpec} message BackupScheduleSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BackupScheduleSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.cronSpec != null && message.hasOwnProperty("cronSpec")) { + object.cronSpec = $root.google.spanner.admin.database.v1.CrontabSpec.toObject(message.cronSpec, options); + if (options.oneofs) + object.scheduleSpec = "cronSpec"; + } + return object; + }; + + /** + * Converts this BackupScheduleSpec to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.BackupScheduleSpec + * @instance + * @returns {Object.} JSON object + */ + BackupScheduleSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BackupScheduleSpec + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.BackupScheduleSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BackupScheduleSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.BackupScheduleSpec"; + }; + + return BackupScheduleSpec; + })(); + + v1.BackupSchedule = (function() { + + /** + * Properties of a BackupSchedule. + * @memberof google.spanner.admin.database.v1 + * @interface IBackupSchedule + * @property {string|null} [name] BackupSchedule name + * @property {google.spanner.admin.database.v1.IBackupScheduleSpec|null} [spec] BackupSchedule spec + * @property {google.protobuf.IDuration|null} [retentionDuration] BackupSchedule retentionDuration + * @property {google.spanner.admin.database.v1.ICreateBackupEncryptionConfig|null} [encryptionConfig] BackupSchedule encryptionConfig + * @property {google.spanner.admin.database.v1.IFullBackupSpec|null} [fullBackupSpec] BackupSchedule fullBackupSpec + * @property {google.spanner.admin.database.v1.IIncrementalBackupSpec|null} [incrementalBackupSpec] BackupSchedule incrementalBackupSpec + * @property {google.protobuf.ITimestamp|null} [updateTime] BackupSchedule updateTime + */ + + /** + * Constructs a new BackupSchedule. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents a BackupSchedule. + * @implements IBackupSchedule + * @constructor + * @param {google.spanner.admin.database.v1.IBackupSchedule=} [properties] Properties to set + */ + function BackupSchedule(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BackupSchedule name. + * @member {string} name + * @memberof google.spanner.admin.database.v1.BackupSchedule + * @instance + */ + BackupSchedule.prototype.name = ""; + + /** + * BackupSchedule spec. + * @member {google.spanner.admin.database.v1.IBackupScheduleSpec|null|undefined} spec + * @memberof google.spanner.admin.database.v1.BackupSchedule + * @instance + */ + BackupSchedule.prototype.spec = null; + + /** + * BackupSchedule retentionDuration. + * @member {google.protobuf.IDuration|null|undefined} retentionDuration + * @memberof google.spanner.admin.database.v1.BackupSchedule + * @instance + */ + BackupSchedule.prototype.retentionDuration = null; + + /** + * BackupSchedule encryptionConfig. + * @member {google.spanner.admin.database.v1.ICreateBackupEncryptionConfig|null|undefined} encryptionConfig + * @memberof google.spanner.admin.database.v1.BackupSchedule + * @instance + */ + BackupSchedule.prototype.encryptionConfig = null; + + /** + * BackupSchedule fullBackupSpec. + * @member {google.spanner.admin.database.v1.IFullBackupSpec|null|undefined} fullBackupSpec + * @memberof google.spanner.admin.database.v1.BackupSchedule + * @instance + */ + BackupSchedule.prototype.fullBackupSpec = null; + + /** + * BackupSchedule incrementalBackupSpec. + * @member {google.spanner.admin.database.v1.IIncrementalBackupSpec|null|undefined} incrementalBackupSpec + * @memberof google.spanner.admin.database.v1.BackupSchedule + * @instance + */ + BackupSchedule.prototype.incrementalBackupSpec = null; + + /** + * BackupSchedule updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.spanner.admin.database.v1.BackupSchedule + * @instance + */ + BackupSchedule.prototype.updateTime = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BackupSchedule backupTypeSpec. + * @member {"fullBackupSpec"|"incrementalBackupSpec"|undefined} backupTypeSpec + * @memberof google.spanner.admin.database.v1.BackupSchedule + * @instance + */ + Object.defineProperty(BackupSchedule.prototype, "backupTypeSpec", { + get: $util.oneOfGetter($oneOfFields = ["fullBackupSpec", "incrementalBackupSpec"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BackupSchedule instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.BackupSchedule + * @static + * @param {google.spanner.admin.database.v1.IBackupSchedule=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.BackupSchedule} BackupSchedule instance + */ + BackupSchedule.create = function create(properties) { + return new BackupSchedule(properties); + }; + + /** + * Encodes the specified BackupSchedule message. Does not implicitly {@link google.spanner.admin.database.v1.BackupSchedule.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.BackupSchedule + * @static + * @param {google.spanner.admin.database.v1.IBackupSchedule} message BackupSchedule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupSchedule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.retentionDuration != null && Object.hasOwnProperty.call(message, "retentionDuration")) + $root.google.protobuf.Duration.encode(message.retentionDuration, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) + $root.google.spanner.admin.database.v1.CreateBackupEncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.spec != null && Object.hasOwnProperty.call(message, "spec")) + $root.google.spanner.admin.database.v1.BackupScheduleSpec.encode(message.spec, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.fullBackupSpec != null && Object.hasOwnProperty.call(message, "fullBackupSpec")) + $root.google.spanner.admin.database.v1.FullBackupSpec.encode(message.fullBackupSpec, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.incrementalBackupSpec != null && Object.hasOwnProperty.call(message, "incrementalBackupSpec")) + $root.google.spanner.admin.database.v1.IncrementalBackupSpec.encode(message.incrementalBackupSpec, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BackupSchedule message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.BackupSchedule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.BackupSchedule + * @static + * @param {google.spanner.admin.database.v1.IBackupSchedule} message BackupSchedule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupSchedule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BackupSchedule message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.BackupSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.BackupSchedule} BackupSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupSchedule.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.BackupSchedule(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 6: { + message.spec = $root.google.spanner.admin.database.v1.BackupScheduleSpec.decode(reader, reader.uint32()); + break; + } + case 3: { + message.retentionDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 4: { + message.encryptionConfig = $root.google.spanner.admin.database.v1.CreateBackupEncryptionConfig.decode(reader, reader.uint32()); + break; + } + case 7: { + message.fullBackupSpec = $root.google.spanner.admin.database.v1.FullBackupSpec.decode(reader, reader.uint32()); + break; + } + case 8: { + message.incrementalBackupSpec = $root.google.spanner.admin.database.v1.IncrementalBackupSpec.decode(reader, reader.uint32()); + break; + } + case 9: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BackupSchedule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.BackupSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.BackupSchedule} BackupSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupSchedule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BackupSchedule message. + * @function verify + * @memberof google.spanner.admin.database.v1.BackupSchedule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BackupSchedule.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.spec != null && message.hasOwnProperty("spec")) { + var error = $root.google.spanner.admin.database.v1.BackupScheduleSpec.verify(message.spec); + if (error) + return "spec." + error; + } + if (message.retentionDuration != null && message.hasOwnProperty("retentionDuration")) { + var error = $root.google.protobuf.Duration.verify(message.retentionDuration); + if (error) + return "retentionDuration." + error; + } + if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { + var error = $root.google.spanner.admin.database.v1.CreateBackupEncryptionConfig.verify(message.encryptionConfig); + if (error) + return "encryptionConfig." + error; + } + if (message.fullBackupSpec != null && message.hasOwnProperty("fullBackupSpec")) { + properties.backupTypeSpec = 1; + { + var error = $root.google.spanner.admin.database.v1.FullBackupSpec.verify(message.fullBackupSpec); + if (error) + return "fullBackupSpec." + error; + } + } + if (message.incrementalBackupSpec != null && message.hasOwnProperty("incrementalBackupSpec")) { + if (properties.backupTypeSpec === 1) + return "backupTypeSpec: multiple values"; + properties.backupTypeSpec = 1; + { + var error = $root.google.spanner.admin.database.v1.IncrementalBackupSpec.verify(message.incrementalBackupSpec); + if (error) + return "incrementalBackupSpec." + error; + } + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + return null; + }; + + /** + * Creates a BackupSchedule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.BackupSchedule + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.BackupSchedule} BackupSchedule + */ + BackupSchedule.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.BackupSchedule) + return object; + var message = new $root.google.spanner.admin.database.v1.BackupSchedule(); + if (object.name != null) + message.name = String(object.name); + if (object.spec != null) { + if (typeof object.spec !== "object") + throw TypeError(".google.spanner.admin.database.v1.BackupSchedule.spec: object expected"); + message.spec = $root.google.spanner.admin.database.v1.BackupScheduleSpec.fromObject(object.spec); + } + if (object.retentionDuration != null) { + if (typeof object.retentionDuration !== "object") + throw TypeError(".google.spanner.admin.database.v1.BackupSchedule.retentionDuration: object expected"); + message.retentionDuration = $root.google.protobuf.Duration.fromObject(object.retentionDuration); + } + if (object.encryptionConfig != null) { + if (typeof object.encryptionConfig !== "object") + throw TypeError(".google.spanner.admin.database.v1.BackupSchedule.encryptionConfig: object expected"); + message.encryptionConfig = $root.google.spanner.admin.database.v1.CreateBackupEncryptionConfig.fromObject(object.encryptionConfig); + } + if (object.fullBackupSpec != null) { + if (typeof object.fullBackupSpec !== "object") + throw TypeError(".google.spanner.admin.database.v1.BackupSchedule.fullBackupSpec: object expected"); + message.fullBackupSpec = $root.google.spanner.admin.database.v1.FullBackupSpec.fromObject(object.fullBackupSpec); + } + if (object.incrementalBackupSpec != null) { + if (typeof object.incrementalBackupSpec !== "object") + throw TypeError(".google.spanner.admin.database.v1.BackupSchedule.incrementalBackupSpec: object expected"); + message.incrementalBackupSpec = $root.google.spanner.admin.database.v1.IncrementalBackupSpec.fromObject(object.incrementalBackupSpec); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.spanner.admin.database.v1.BackupSchedule.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + return message; + }; + + /** + * Creates a plain object from a BackupSchedule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.BackupSchedule + * @static + * @param {google.spanner.admin.database.v1.BackupSchedule} message BackupSchedule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BackupSchedule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.retentionDuration = null; + object.encryptionConfig = null; + object.spec = null; + object.updateTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.retentionDuration != null && message.hasOwnProperty("retentionDuration")) + object.retentionDuration = $root.google.protobuf.Duration.toObject(message.retentionDuration, options); + if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) + object.encryptionConfig = $root.google.spanner.admin.database.v1.CreateBackupEncryptionConfig.toObject(message.encryptionConfig, options); + if (message.spec != null && message.hasOwnProperty("spec")) + object.spec = $root.google.spanner.admin.database.v1.BackupScheduleSpec.toObject(message.spec, options); + if (message.fullBackupSpec != null && message.hasOwnProperty("fullBackupSpec")) { + object.fullBackupSpec = $root.google.spanner.admin.database.v1.FullBackupSpec.toObject(message.fullBackupSpec, options); + if (options.oneofs) + object.backupTypeSpec = "fullBackupSpec"; + } + if (message.incrementalBackupSpec != null && message.hasOwnProperty("incrementalBackupSpec")) { + object.incrementalBackupSpec = $root.google.spanner.admin.database.v1.IncrementalBackupSpec.toObject(message.incrementalBackupSpec, options); + if (options.oneofs) + object.backupTypeSpec = "incrementalBackupSpec"; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + return object; + }; + + /** + * Converts this BackupSchedule to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.BackupSchedule + * @instance + * @returns {Object.} JSON object + */ + BackupSchedule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BackupSchedule + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.BackupSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BackupSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.BackupSchedule"; + }; + + return BackupSchedule; + })(); + + v1.CrontabSpec = (function() { + + /** + * Properties of a CrontabSpec. + * @memberof google.spanner.admin.database.v1 + * @interface ICrontabSpec + * @property {string|null} [text] CrontabSpec text + * @property {string|null} [timeZone] CrontabSpec timeZone + * @property {google.protobuf.IDuration|null} [creationWindow] CrontabSpec creationWindow + */ + + /** + * Constructs a new CrontabSpec. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents a CrontabSpec. + * @implements ICrontabSpec + * @constructor + * @param {google.spanner.admin.database.v1.ICrontabSpec=} [properties] Properties to set + */ + function CrontabSpec(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CrontabSpec text. + * @member {string} text + * @memberof google.spanner.admin.database.v1.CrontabSpec + * @instance + */ + CrontabSpec.prototype.text = ""; + + /** + * CrontabSpec timeZone. + * @member {string} timeZone + * @memberof google.spanner.admin.database.v1.CrontabSpec + * @instance + */ + CrontabSpec.prototype.timeZone = ""; + + /** + * CrontabSpec creationWindow. + * @member {google.protobuf.IDuration|null|undefined} creationWindow + * @memberof google.spanner.admin.database.v1.CrontabSpec + * @instance + */ + CrontabSpec.prototype.creationWindow = null; + + /** + * Creates a new CrontabSpec instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.CrontabSpec + * @static + * @param {google.spanner.admin.database.v1.ICrontabSpec=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.CrontabSpec} CrontabSpec instance + */ + CrontabSpec.create = function create(properties) { + return new CrontabSpec(properties); + }; + + /** + * Encodes the specified CrontabSpec message. Does not implicitly {@link google.spanner.admin.database.v1.CrontabSpec.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.CrontabSpec + * @static + * @param {google.spanner.admin.database.v1.ICrontabSpec} message CrontabSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CrontabSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); + if (message.timeZone != null && Object.hasOwnProperty.call(message, "timeZone")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.timeZone); + if (message.creationWindow != null && Object.hasOwnProperty.call(message, "creationWindow")) + $root.google.protobuf.Duration.encode(message.creationWindow, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CrontabSpec message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.CrontabSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.CrontabSpec + * @static + * @param {google.spanner.admin.database.v1.ICrontabSpec} message CrontabSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CrontabSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CrontabSpec message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.CrontabSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.CrontabSpec} CrontabSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CrontabSpec.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.CrontabSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.text = reader.string(); + break; + } + case 2: { + message.timeZone = reader.string(); + break; + } + case 3: { + message.creationWindow = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CrontabSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.CrontabSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.CrontabSpec} CrontabSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CrontabSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CrontabSpec message. + * @function verify + * @memberof google.spanner.admin.database.v1.CrontabSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CrontabSpec.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.text != null && message.hasOwnProperty("text")) + if (!$util.isString(message.text)) + return "text: string expected"; + if (message.timeZone != null && message.hasOwnProperty("timeZone")) + if (!$util.isString(message.timeZone)) + return "timeZone: string expected"; + if (message.creationWindow != null && message.hasOwnProperty("creationWindow")) { + var error = $root.google.protobuf.Duration.verify(message.creationWindow); + if (error) + return "creationWindow." + error; + } + return null; + }; + + /** + * Creates a CrontabSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.CrontabSpec + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.CrontabSpec} CrontabSpec + */ + CrontabSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.CrontabSpec) + return object; + var message = new $root.google.spanner.admin.database.v1.CrontabSpec(); + if (object.text != null) + message.text = String(object.text); + if (object.timeZone != null) + message.timeZone = String(object.timeZone); + if (object.creationWindow != null) { + if (typeof object.creationWindow !== "object") + throw TypeError(".google.spanner.admin.database.v1.CrontabSpec.creationWindow: object expected"); + message.creationWindow = $root.google.protobuf.Duration.fromObject(object.creationWindow); + } + return message; + }; + + /** + * Creates a plain object from a CrontabSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.CrontabSpec + * @static + * @param {google.spanner.admin.database.v1.CrontabSpec} message CrontabSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CrontabSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.text = ""; + object.timeZone = ""; + object.creationWindow = null; + } + if (message.text != null && message.hasOwnProperty("text")) + object.text = message.text; + if (message.timeZone != null && message.hasOwnProperty("timeZone")) + object.timeZone = message.timeZone; + if (message.creationWindow != null && message.hasOwnProperty("creationWindow")) + object.creationWindow = $root.google.protobuf.Duration.toObject(message.creationWindow, options); + return object; + }; + + /** + * Converts this CrontabSpec to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.CrontabSpec + * @instance + * @returns {Object.} JSON object + */ + CrontabSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CrontabSpec + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.CrontabSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CrontabSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.CrontabSpec"; + }; + + return CrontabSpec; + })(); + + v1.CreateBackupScheduleRequest = (function() { + + /** + * Properties of a CreateBackupScheduleRequest. + * @memberof google.spanner.admin.database.v1 + * @interface ICreateBackupScheduleRequest + * @property {string|null} [parent] CreateBackupScheduleRequest parent + * @property {string|null} [backupScheduleId] CreateBackupScheduleRequest backupScheduleId + * @property {google.spanner.admin.database.v1.IBackupSchedule|null} [backupSchedule] CreateBackupScheduleRequest backupSchedule + */ + + /** + * Constructs a new CreateBackupScheduleRequest. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents a CreateBackupScheduleRequest. + * @implements ICreateBackupScheduleRequest + * @constructor + * @param {google.spanner.admin.database.v1.ICreateBackupScheduleRequest=} [properties] Properties to set + */ + function CreateBackupScheduleRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateBackupScheduleRequest parent. + * @member {string} parent + * @memberof google.spanner.admin.database.v1.CreateBackupScheduleRequest + * @instance + */ + CreateBackupScheduleRequest.prototype.parent = ""; + + /** + * CreateBackupScheduleRequest backupScheduleId. + * @member {string} backupScheduleId + * @memberof google.spanner.admin.database.v1.CreateBackupScheduleRequest + * @instance + */ + CreateBackupScheduleRequest.prototype.backupScheduleId = ""; + + /** + * CreateBackupScheduleRequest backupSchedule. + * @member {google.spanner.admin.database.v1.IBackupSchedule|null|undefined} backupSchedule + * @memberof google.spanner.admin.database.v1.CreateBackupScheduleRequest + * @instance + */ + CreateBackupScheduleRequest.prototype.backupSchedule = null; + + /** + * Creates a new CreateBackupScheduleRequest instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.CreateBackupScheduleRequest + * @static + * @param {google.spanner.admin.database.v1.ICreateBackupScheduleRequest=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.CreateBackupScheduleRequest} CreateBackupScheduleRequest instance + */ + CreateBackupScheduleRequest.create = function create(properties) { + return new CreateBackupScheduleRequest(properties); + }; + + /** + * Encodes the specified CreateBackupScheduleRequest message. Does not implicitly {@link google.spanner.admin.database.v1.CreateBackupScheduleRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.CreateBackupScheduleRequest + * @static + * @param {google.spanner.admin.database.v1.ICreateBackupScheduleRequest} message CreateBackupScheduleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateBackupScheduleRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.backupScheduleId != null && Object.hasOwnProperty.call(message, "backupScheduleId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.backupScheduleId); + if (message.backupSchedule != null && Object.hasOwnProperty.call(message, "backupSchedule")) + $root.google.spanner.admin.database.v1.BackupSchedule.encode(message.backupSchedule, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateBackupScheduleRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.CreateBackupScheduleRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.CreateBackupScheduleRequest + * @static + * @param {google.spanner.admin.database.v1.ICreateBackupScheduleRequest} message CreateBackupScheduleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateBackupScheduleRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateBackupScheduleRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.CreateBackupScheduleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.CreateBackupScheduleRequest} CreateBackupScheduleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateBackupScheduleRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.CreateBackupScheduleRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.backupScheduleId = reader.string(); + break; + } + case 3: { + message.backupSchedule = $root.google.spanner.admin.database.v1.BackupSchedule.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateBackupScheduleRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.CreateBackupScheduleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.CreateBackupScheduleRequest} CreateBackupScheduleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateBackupScheduleRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateBackupScheduleRequest message. + * @function verify + * @memberof google.spanner.admin.database.v1.CreateBackupScheduleRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateBackupScheduleRequest.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.backupScheduleId != null && message.hasOwnProperty("backupScheduleId")) + if (!$util.isString(message.backupScheduleId)) + return "backupScheduleId: string expected"; + if (message.backupSchedule != null && message.hasOwnProperty("backupSchedule")) { + var error = $root.google.spanner.admin.database.v1.BackupSchedule.verify(message.backupSchedule); + if (error) + return "backupSchedule." + error; + } + return null; + }; + + /** + * Creates a CreateBackupScheduleRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.CreateBackupScheduleRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.CreateBackupScheduleRequest} CreateBackupScheduleRequest + */ + CreateBackupScheduleRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.CreateBackupScheduleRequest) + return object; + var message = new $root.google.spanner.admin.database.v1.CreateBackupScheduleRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.backupScheduleId != null) + message.backupScheduleId = String(object.backupScheduleId); + if (object.backupSchedule != null) { + if (typeof object.backupSchedule !== "object") + throw TypeError(".google.spanner.admin.database.v1.CreateBackupScheduleRequest.backupSchedule: object expected"); + message.backupSchedule = $root.google.spanner.admin.database.v1.BackupSchedule.fromObject(object.backupSchedule); + } + return message; + }; + + /** + * Creates a plain object from a CreateBackupScheduleRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.CreateBackupScheduleRequest + * @static + * @param {google.spanner.admin.database.v1.CreateBackupScheduleRequest} message CreateBackupScheduleRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateBackupScheduleRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.backupScheduleId = ""; + object.backupSchedule = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.backupScheduleId != null && message.hasOwnProperty("backupScheduleId")) + object.backupScheduleId = message.backupScheduleId; + if (message.backupSchedule != null && message.hasOwnProperty("backupSchedule")) + object.backupSchedule = $root.google.spanner.admin.database.v1.BackupSchedule.toObject(message.backupSchedule, options); + return object; + }; + + /** + * Converts this CreateBackupScheduleRequest to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.CreateBackupScheduleRequest + * @instance + * @returns {Object.} JSON object + */ + CreateBackupScheduleRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateBackupScheduleRequest + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.CreateBackupScheduleRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateBackupScheduleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.CreateBackupScheduleRequest"; + }; + + return CreateBackupScheduleRequest; + })(); + + v1.GetBackupScheduleRequest = (function() { + + /** + * Properties of a GetBackupScheduleRequest. + * @memberof google.spanner.admin.database.v1 + * @interface IGetBackupScheduleRequest + * @property {string|null} [name] GetBackupScheduleRequest name + */ + + /** + * Constructs a new GetBackupScheduleRequest. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents a GetBackupScheduleRequest. + * @implements IGetBackupScheduleRequest + * @constructor + * @param {google.spanner.admin.database.v1.IGetBackupScheduleRequest=} [properties] Properties to set + */ + function GetBackupScheduleRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetBackupScheduleRequest name. + * @member {string} name + * @memberof google.spanner.admin.database.v1.GetBackupScheduleRequest + * @instance + */ + GetBackupScheduleRequest.prototype.name = ""; + + /** + * Creates a new GetBackupScheduleRequest instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.GetBackupScheduleRequest + * @static + * @param {google.spanner.admin.database.v1.IGetBackupScheduleRequest=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.GetBackupScheduleRequest} GetBackupScheduleRequest instance + */ + GetBackupScheduleRequest.create = function create(properties) { + return new GetBackupScheduleRequest(properties); + }; + + /** + * Encodes the specified GetBackupScheduleRequest message. Does not implicitly {@link google.spanner.admin.database.v1.GetBackupScheduleRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.GetBackupScheduleRequest + * @static + * @param {google.spanner.admin.database.v1.IGetBackupScheduleRequest} message GetBackupScheduleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBackupScheduleRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetBackupScheduleRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.GetBackupScheduleRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.GetBackupScheduleRequest + * @static + * @param {google.spanner.admin.database.v1.IGetBackupScheduleRequest} message GetBackupScheduleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBackupScheduleRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetBackupScheduleRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.GetBackupScheduleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.GetBackupScheduleRequest} GetBackupScheduleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBackupScheduleRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.GetBackupScheduleRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetBackupScheduleRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.GetBackupScheduleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.GetBackupScheduleRequest} GetBackupScheduleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBackupScheduleRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetBackupScheduleRequest message. + * @function verify + * @memberof google.spanner.admin.database.v1.GetBackupScheduleRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetBackupScheduleRequest.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 GetBackupScheduleRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.GetBackupScheduleRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.GetBackupScheduleRequest} GetBackupScheduleRequest + */ + GetBackupScheduleRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.GetBackupScheduleRequest) + return object; + var message = new $root.google.spanner.admin.database.v1.GetBackupScheduleRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetBackupScheduleRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.GetBackupScheduleRequest + * @static + * @param {google.spanner.admin.database.v1.GetBackupScheduleRequest} message GetBackupScheduleRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetBackupScheduleRequest.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 GetBackupScheduleRequest to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.GetBackupScheduleRequest + * @instance + * @returns {Object.} JSON object + */ + GetBackupScheduleRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetBackupScheduleRequest + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.GetBackupScheduleRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetBackupScheduleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.GetBackupScheduleRequest"; + }; + + return GetBackupScheduleRequest; + })(); + + v1.DeleteBackupScheduleRequest = (function() { + + /** + * Properties of a DeleteBackupScheduleRequest. + * @memberof google.spanner.admin.database.v1 + * @interface IDeleteBackupScheduleRequest + * @property {string|null} [name] DeleteBackupScheduleRequest name + */ + + /** + * Constructs a new DeleteBackupScheduleRequest. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents a DeleteBackupScheduleRequest. + * @implements IDeleteBackupScheduleRequest + * @constructor + * @param {google.spanner.admin.database.v1.IDeleteBackupScheduleRequest=} [properties] Properties to set + */ + function DeleteBackupScheduleRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteBackupScheduleRequest name. + * @member {string} name + * @memberof google.spanner.admin.database.v1.DeleteBackupScheduleRequest + * @instance + */ + DeleteBackupScheduleRequest.prototype.name = ""; + + /** + * Creates a new DeleteBackupScheduleRequest instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.DeleteBackupScheduleRequest + * @static + * @param {google.spanner.admin.database.v1.IDeleteBackupScheduleRequest=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.DeleteBackupScheduleRequest} DeleteBackupScheduleRequest instance + */ + DeleteBackupScheduleRequest.create = function create(properties) { + return new DeleteBackupScheduleRequest(properties); + }; + + /** + * Encodes the specified DeleteBackupScheduleRequest message. Does not implicitly {@link google.spanner.admin.database.v1.DeleteBackupScheduleRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.DeleteBackupScheduleRequest + * @static + * @param {google.spanner.admin.database.v1.IDeleteBackupScheduleRequest} message DeleteBackupScheduleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteBackupScheduleRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteBackupScheduleRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.DeleteBackupScheduleRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.DeleteBackupScheduleRequest + * @static + * @param {google.spanner.admin.database.v1.IDeleteBackupScheduleRequest} message DeleteBackupScheduleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteBackupScheduleRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteBackupScheduleRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.DeleteBackupScheduleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.DeleteBackupScheduleRequest} DeleteBackupScheduleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteBackupScheduleRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.DeleteBackupScheduleRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteBackupScheduleRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.DeleteBackupScheduleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.DeleteBackupScheduleRequest} DeleteBackupScheduleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteBackupScheduleRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteBackupScheduleRequest message. + * @function verify + * @memberof google.spanner.admin.database.v1.DeleteBackupScheduleRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteBackupScheduleRequest.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 DeleteBackupScheduleRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.DeleteBackupScheduleRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.DeleteBackupScheduleRequest} DeleteBackupScheduleRequest + */ + DeleteBackupScheduleRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.DeleteBackupScheduleRequest) + return object; + var message = new $root.google.spanner.admin.database.v1.DeleteBackupScheduleRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteBackupScheduleRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.DeleteBackupScheduleRequest + * @static + * @param {google.spanner.admin.database.v1.DeleteBackupScheduleRequest} message DeleteBackupScheduleRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteBackupScheduleRequest.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 DeleteBackupScheduleRequest to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.DeleteBackupScheduleRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteBackupScheduleRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteBackupScheduleRequest + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.DeleteBackupScheduleRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteBackupScheduleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.DeleteBackupScheduleRequest"; + }; + + return DeleteBackupScheduleRequest; + })(); + + v1.ListBackupSchedulesRequest = (function() { + + /** + * Properties of a ListBackupSchedulesRequest. + * @memberof google.spanner.admin.database.v1 + * @interface IListBackupSchedulesRequest + * @property {string|null} [parent] ListBackupSchedulesRequest parent + * @property {number|null} [pageSize] ListBackupSchedulesRequest pageSize + * @property {string|null} [pageToken] ListBackupSchedulesRequest pageToken + */ + + /** + * Constructs a new ListBackupSchedulesRequest. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents a ListBackupSchedulesRequest. + * @implements IListBackupSchedulesRequest + * @constructor + * @param {google.spanner.admin.database.v1.IListBackupSchedulesRequest=} [properties] Properties to set + */ + function ListBackupSchedulesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListBackupSchedulesRequest parent. + * @member {string} parent + * @memberof google.spanner.admin.database.v1.ListBackupSchedulesRequest + * @instance + */ + ListBackupSchedulesRequest.prototype.parent = ""; + + /** + * ListBackupSchedulesRequest pageSize. + * @member {number} pageSize + * @memberof google.spanner.admin.database.v1.ListBackupSchedulesRequest + * @instance + */ + ListBackupSchedulesRequest.prototype.pageSize = 0; + + /** + * ListBackupSchedulesRequest pageToken. + * @member {string} pageToken + * @memberof google.spanner.admin.database.v1.ListBackupSchedulesRequest + * @instance + */ + ListBackupSchedulesRequest.prototype.pageToken = ""; + + /** + * Creates a new ListBackupSchedulesRequest instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.ListBackupSchedulesRequest + * @static + * @param {google.spanner.admin.database.v1.IListBackupSchedulesRequest=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.ListBackupSchedulesRequest} ListBackupSchedulesRequest instance + */ + ListBackupSchedulesRequest.create = function create(properties) { + return new ListBackupSchedulesRequest(properties); + }; + + /** + * Encodes the specified ListBackupSchedulesRequest message. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupSchedulesRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.ListBackupSchedulesRequest + * @static + * @param {google.spanner.admin.database.v1.IListBackupSchedulesRequest} message ListBackupSchedulesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupSchedulesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListBackupSchedulesRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupSchedulesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.ListBackupSchedulesRequest + * @static + * @param {google.spanner.admin.database.v1.IListBackupSchedulesRequest} message ListBackupSchedulesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupSchedulesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListBackupSchedulesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.ListBackupSchedulesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.ListBackupSchedulesRequest} ListBackupSchedulesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupSchedulesRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.ListBackupSchedulesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListBackupSchedulesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.ListBackupSchedulesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.ListBackupSchedulesRequest} ListBackupSchedulesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupSchedulesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListBackupSchedulesRequest message. + * @function verify + * @memberof google.spanner.admin.database.v1.ListBackupSchedulesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListBackupSchedulesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListBackupSchedulesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.ListBackupSchedulesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.ListBackupSchedulesRequest} ListBackupSchedulesRequest + */ + ListBackupSchedulesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.ListBackupSchedulesRequest) + return object; + var message = new $root.google.spanner.admin.database.v1.ListBackupSchedulesRequest(); + 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 ListBackupSchedulesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.ListBackupSchedulesRequest + * @static + * @param {google.spanner.admin.database.v1.ListBackupSchedulesRequest} message ListBackupSchedulesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListBackupSchedulesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListBackupSchedulesRequest to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.ListBackupSchedulesRequest + * @instance + * @returns {Object.} JSON object + */ + ListBackupSchedulesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListBackupSchedulesRequest + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.ListBackupSchedulesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListBackupSchedulesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.ListBackupSchedulesRequest"; + }; + + return ListBackupSchedulesRequest; + })(); + + v1.ListBackupSchedulesResponse = (function() { + + /** + * Properties of a ListBackupSchedulesResponse. + * @memberof google.spanner.admin.database.v1 + * @interface IListBackupSchedulesResponse + * @property {Array.|null} [backupSchedules] ListBackupSchedulesResponse backupSchedules + * @property {string|null} [nextPageToken] ListBackupSchedulesResponse nextPageToken + */ + + /** + * Constructs a new ListBackupSchedulesResponse. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents a ListBackupSchedulesResponse. + * @implements IListBackupSchedulesResponse + * @constructor + * @param {google.spanner.admin.database.v1.IListBackupSchedulesResponse=} [properties] Properties to set + */ + function ListBackupSchedulesResponse(properties) { + this.backupSchedules = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListBackupSchedulesResponse backupSchedules. + * @member {Array.} backupSchedules + * @memberof google.spanner.admin.database.v1.ListBackupSchedulesResponse + * @instance + */ + ListBackupSchedulesResponse.prototype.backupSchedules = $util.emptyArray; + + /** + * ListBackupSchedulesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.spanner.admin.database.v1.ListBackupSchedulesResponse + * @instance + */ + ListBackupSchedulesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListBackupSchedulesResponse instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.ListBackupSchedulesResponse + * @static + * @param {google.spanner.admin.database.v1.IListBackupSchedulesResponse=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.ListBackupSchedulesResponse} ListBackupSchedulesResponse instance + */ + ListBackupSchedulesResponse.create = function create(properties) { + return new ListBackupSchedulesResponse(properties); + }; + + /** + * Encodes the specified ListBackupSchedulesResponse message. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupSchedulesResponse.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.ListBackupSchedulesResponse + * @static + * @param {google.spanner.admin.database.v1.IListBackupSchedulesResponse} message ListBackupSchedulesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupSchedulesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.backupSchedules != null && message.backupSchedules.length) + for (var i = 0; i < message.backupSchedules.length; ++i) + $root.google.spanner.admin.database.v1.BackupSchedule.encode(message.backupSchedules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListBackupSchedulesResponse message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupSchedulesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.ListBackupSchedulesResponse + * @static + * @param {google.spanner.admin.database.v1.IListBackupSchedulesResponse} message ListBackupSchedulesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupSchedulesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListBackupSchedulesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.ListBackupSchedulesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.ListBackupSchedulesResponse} ListBackupSchedulesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupSchedulesResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.ListBackupSchedulesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.backupSchedules && message.backupSchedules.length)) + message.backupSchedules = []; + message.backupSchedules.push($root.google.spanner.admin.database.v1.BackupSchedule.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListBackupSchedulesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.ListBackupSchedulesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.ListBackupSchedulesResponse} ListBackupSchedulesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupSchedulesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListBackupSchedulesResponse message. + * @function verify + * @memberof google.spanner.admin.database.v1.ListBackupSchedulesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListBackupSchedulesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.backupSchedules != null && message.hasOwnProperty("backupSchedules")) { + if (!Array.isArray(message.backupSchedules)) + return "backupSchedules: array expected"; + for (var i = 0; i < message.backupSchedules.length; ++i) { + var error = $root.google.spanner.admin.database.v1.BackupSchedule.verify(message.backupSchedules[i]); + if (error) + return "backupSchedules." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListBackupSchedulesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.ListBackupSchedulesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.ListBackupSchedulesResponse} ListBackupSchedulesResponse + */ + ListBackupSchedulesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.ListBackupSchedulesResponse) + return object; + var message = new $root.google.spanner.admin.database.v1.ListBackupSchedulesResponse(); + if (object.backupSchedules) { + if (!Array.isArray(object.backupSchedules)) + throw TypeError(".google.spanner.admin.database.v1.ListBackupSchedulesResponse.backupSchedules: array expected"); + message.backupSchedules = []; + for (var i = 0; i < object.backupSchedules.length; ++i) { + if (typeof object.backupSchedules[i] !== "object") + throw TypeError(".google.spanner.admin.database.v1.ListBackupSchedulesResponse.backupSchedules: object expected"); + message.backupSchedules[i] = $root.google.spanner.admin.database.v1.BackupSchedule.fromObject(object.backupSchedules[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListBackupSchedulesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.ListBackupSchedulesResponse + * @static + * @param {google.spanner.admin.database.v1.ListBackupSchedulesResponse} message ListBackupSchedulesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListBackupSchedulesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.backupSchedules = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.backupSchedules && message.backupSchedules.length) { + object.backupSchedules = []; + for (var j = 0; j < message.backupSchedules.length; ++j) + object.backupSchedules[j] = $root.google.spanner.admin.database.v1.BackupSchedule.toObject(message.backupSchedules[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListBackupSchedulesResponse to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.ListBackupSchedulesResponse + * @instance + * @returns {Object.} JSON object + */ + ListBackupSchedulesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListBackupSchedulesResponse + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.ListBackupSchedulesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListBackupSchedulesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.ListBackupSchedulesResponse"; + }; + + return ListBackupSchedulesResponse; + })(); + + v1.UpdateBackupScheduleRequest = (function() { + + /** + * Properties of an UpdateBackupScheduleRequest. + * @memberof google.spanner.admin.database.v1 + * @interface IUpdateBackupScheduleRequest + * @property {google.spanner.admin.database.v1.IBackupSchedule|null} [backupSchedule] UpdateBackupScheduleRequest backupSchedule + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateBackupScheduleRequest updateMask + */ + + /** + * Constructs a new UpdateBackupScheduleRequest. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents an UpdateBackupScheduleRequest. + * @implements IUpdateBackupScheduleRequest + * @constructor + * @param {google.spanner.admin.database.v1.IUpdateBackupScheduleRequest=} [properties] Properties to set + */ + function UpdateBackupScheduleRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateBackupScheduleRequest backupSchedule. + * @member {google.spanner.admin.database.v1.IBackupSchedule|null|undefined} backupSchedule + * @memberof google.spanner.admin.database.v1.UpdateBackupScheduleRequest + * @instance + */ + UpdateBackupScheduleRequest.prototype.backupSchedule = null; + + /** + * UpdateBackupScheduleRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.spanner.admin.database.v1.UpdateBackupScheduleRequest + * @instance + */ + UpdateBackupScheduleRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateBackupScheduleRequest instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.UpdateBackupScheduleRequest + * @static + * @param {google.spanner.admin.database.v1.IUpdateBackupScheduleRequest=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.UpdateBackupScheduleRequest} UpdateBackupScheduleRequest instance + */ + UpdateBackupScheduleRequest.create = function create(properties) { + return new UpdateBackupScheduleRequest(properties); + }; + + /** + * Encodes the specified UpdateBackupScheduleRequest message. Does not implicitly {@link google.spanner.admin.database.v1.UpdateBackupScheduleRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.UpdateBackupScheduleRequest + * @static + * @param {google.spanner.admin.database.v1.IUpdateBackupScheduleRequest} message UpdateBackupScheduleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateBackupScheduleRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.backupSchedule != null && Object.hasOwnProperty.call(message, "backupSchedule")) + $root.google.spanner.admin.database.v1.BackupSchedule.encode(message.backupSchedule, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateBackupScheduleRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.UpdateBackupScheduleRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.UpdateBackupScheduleRequest + * @static + * @param {google.spanner.admin.database.v1.IUpdateBackupScheduleRequest} message UpdateBackupScheduleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateBackupScheduleRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateBackupScheduleRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.UpdateBackupScheduleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.UpdateBackupScheduleRequest} UpdateBackupScheduleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateBackupScheduleRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.UpdateBackupScheduleRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.backupSchedule = $root.google.spanner.admin.database.v1.BackupSchedule.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateBackupScheduleRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.UpdateBackupScheduleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.UpdateBackupScheduleRequest} UpdateBackupScheduleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateBackupScheduleRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateBackupScheduleRequest message. + * @function verify + * @memberof google.spanner.admin.database.v1.UpdateBackupScheduleRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateBackupScheduleRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.backupSchedule != null && message.hasOwnProperty("backupSchedule")) { + var error = $root.google.spanner.admin.database.v1.BackupSchedule.verify(message.backupSchedule); + if (error) + return "backupSchedule." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateBackupScheduleRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.UpdateBackupScheduleRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.UpdateBackupScheduleRequest} UpdateBackupScheduleRequest + */ + UpdateBackupScheduleRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.UpdateBackupScheduleRequest) + return object; + var message = new $root.google.spanner.admin.database.v1.UpdateBackupScheduleRequest(); + if (object.backupSchedule != null) { + if (typeof object.backupSchedule !== "object") + throw TypeError(".google.spanner.admin.database.v1.UpdateBackupScheduleRequest.backupSchedule: object expected"); + message.backupSchedule = $root.google.spanner.admin.database.v1.BackupSchedule.fromObject(object.backupSchedule); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.spanner.admin.database.v1.UpdateBackupScheduleRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateBackupScheduleRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.UpdateBackupScheduleRequest + * @static + * @param {google.spanner.admin.database.v1.UpdateBackupScheduleRequest} message UpdateBackupScheduleRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateBackupScheduleRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.backupSchedule = null; + object.updateMask = null; + } + if (message.backupSchedule != null && message.hasOwnProperty("backupSchedule")) + object.backupSchedule = $root.google.spanner.admin.database.v1.BackupSchedule.toObject(message.backupSchedule, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateBackupScheduleRequest to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.UpdateBackupScheduleRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateBackupScheduleRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateBackupScheduleRequest + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.UpdateBackupScheduleRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateBackupScheduleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.UpdateBackupScheduleRequest"; + }; + + return UpdateBackupScheduleRequest; + })(); + + v1.DatabaseAdmin = (function() { + + /** + * Constructs a new DatabaseAdmin service. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents a DatabaseAdmin + * @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 DatabaseAdmin(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (DatabaseAdmin.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = DatabaseAdmin; + + /** + * Creates new DatabaseAdmin service using the specified rpc implementation. + * @function create + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @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 {DatabaseAdmin} RPC service. Useful where requests and/or responses are streamed. + */ + DatabaseAdmin.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|listDatabases}. + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @typedef ListDatabasesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.spanner.admin.database.v1.ListDatabasesResponse} [response] ListDatabasesResponse + */ + + /** + * Calls ListDatabases. + * @function listDatabases + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.IListDatabasesRequest} request ListDatabasesRequest message or plain object + * @param {google.spanner.admin.database.v1.DatabaseAdmin.ListDatabasesCallback} callback Node-style callback called with the error, if any, and ListDatabasesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DatabaseAdmin.prototype.listDatabases = function listDatabases(request, callback) { + return this.rpcCall(listDatabases, $root.google.spanner.admin.database.v1.ListDatabasesRequest, $root.google.spanner.admin.database.v1.ListDatabasesResponse, request, callback); + }, "name", { value: "ListDatabases" }); + + /** + * Calls ListDatabases. + * @function listDatabases + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.IListDatabasesRequest} request ListDatabasesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|createDatabase}. + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @typedef CreateDatabaseCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateDatabase. + * @function createDatabase + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.ICreateDatabaseRequest} request CreateDatabaseRequest message or plain object + * @param {google.spanner.admin.database.v1.DatabaseAdmin.CreateDatabaseCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DatabaseAdmin.prototype.createDatabase = function createDatabase(request, callback) { + return this.rpcCall(createDatabase, $root.google.spanner.admin.database.v1.CreateDatabaseRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateDatabase" }); + + /** + * Calls CreateDatabase. + * @function createDatabase + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.ICreateDatabaseRequest} request CreateDatabaseRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|getDatabase}. + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @typedef GetDatabaseCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.spanner.admin.database.v1.Database} [response] Database + */ + + /** + * Calls GetDatabase. + * @function getDatabase + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.IGetDatabaseRequest} request GetDatabaseRequest message or plain object + * @param {google.spanner.admin.database.v1.DatabaseAdmin.GetDatabaseCallback} callback Node-style callback called with the error, if any, and Database + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DatabaseAdmin.prototype.getDatabase = function getDatabase(request, callback) { + return this.rpcCall(getDatabase, $root.google.spanner.admin.database.v1.GetDatabaseRequest, $root.google.spanner.admin.database.v1.Database, request, callback); + }, "name", { value: "GetDatabase" }); + + /** + * Calls GetDatabase. + * @function getDatabase + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.IGetDatabaseRequest} request GetDatabaseRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|updateDatabase}. + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @typedef UpdateDatabaseCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateDatabase. + * @function updateDatabase + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.IUpdateDatabaseRequest} request UpdateDatabaseRequest message or plain object + * @param {google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DatabaseAdmin.prototype.updateDatabase = function updateDatabase(request, callback) { + return this.rpcCall(updateDatabase, $root.google.spanner.admin.database.v1.UpdateDatabaseRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateDatabase" }); + + /** + * Calls UpdateDatabase. + * @function updateDatabase + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.IUpdateDatabaseRequest} request UpdateDatabaseRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|updateDatabaseDdl}. + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @typedef UpdateDatabaseDdlCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateDatabaseDdl. + * @function updateDatabaseDdl + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.IUpdateDatabaseDdlRequest} request UpdateDatabaseDdlRequest message or plain object + * @param {google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdlCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DatabaseAdmin.prototype.updateDatabaseDdl = function updateDatabaseDdl(request, callback) { + return this.rpcCall(updateDatabaseDdl, $root.google.spanner.admin.database.v1.UpdateDatabaseDdlRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateDatabaseDdl" }); + + /** + * Calls UpdateDatabaseDdl. + * @function updateDatabaseDdl + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.IUpdateDatabaseDdlRequest} request UpdateDatabaseDdlRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|dropDatabase}. + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @typedef DropDatabaseCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DropDatabase. + * @function dropDatabase + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.IDropDatabaseRequest} request DropDatabaseRequest message or plain object + * @param {google.spanner.admin.database.v1.DatabaseAdmin.DropDatabaseCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DatabaseAdmin.prototype.dropDatabase = function dropDatabase(request, callback) { + return this.rpcCall(dropDatabase, $root.google.spanner.admin.database.v1.DropDatabaseRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DropDatabase" }); + + /** + * Calls DropDatabase. + * @function dropDatabase + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.IDropDatabaseRequest} request DropDatabaseRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|getDatabaseDdl}. + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @typedef GetDatabaseDdlCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.spanner.admin.database.v1.GetDatabaseDdlResponse} [response] GetDatabaseDdlResponse + */ + + /** + * Calls GetDatabaseDdl. + * @function getDatabaseDdl + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.IGetDatabaseDdlRequest} request GetDatabaseDdlRequest message or plain object + * @param {google.spanner.admin.database.v1.DatabaseAdmin.GetDatabaseDdlCallback} callback Node-style callback called with the error, if any, and GetDatabaseDdlResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DatabaseAdmin.prototype.getDatabaseDdl = function getDatabaseDdl(request, callback) { + return this.rpcCall(getDatabaseDdl, $root.google.spanner.admin.database.v1.GetDatabaseDdlRequest, $root.google.spanner.admin.database.v1.GetDatabaseDdlResponse, request, callback); + }, "name", { value: "GetDatabaseDdl" }); + + /** + * Calls GetDatabaseDdl. + * @function getDatabaseDdl + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.IGetDatabaseDdlRequest} request GetDatabaseDdlRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|setIamPolicy}. + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @typedef SetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @param {google.spanner.admin.database.v1.DatabaseAdmin.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DatabaseAdmin.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.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|getIamPolicy}. + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @typedef GetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @param {google.spanner.admin.database.v1.DatabaseAdmin.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DatabaseAdmin.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.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|testIamPermissions}. + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @typedef TestIamPermissionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.TestIamPermissionsResponse} [response] TestIamPermissionsResponse + */ + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @param {google.spanner.admin.database.v1.DatabaseAdmin.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DatabaseAdmin.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.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|createBackup}. + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @typedef CreateBackupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateBackup. + * @function createBackup + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.ICreateBackupRequest} request CreateBackupRequest message or plain object + * @param {google.spanner.admin.database.v1.DatabaseAdmin.CreateBackupCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DatabaseAdmin.prototype.createBackup = function createBackup(request, callback) { + return this.rpcCall(createBackup, $root.google.spanner.admin.database.v1.CreateBackupRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateBackup" }); + + /** + * Calls CreateBackup. + * @function createBackup + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.ICreateBackupRequest} request CreateBackupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|copyBackup}. + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @typedef CopyBackupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CopyBackup. + * @function copyBackup + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.ICopyBackupRequest} request CopyBackupRequest message or plain object + * @param {google.spanner.admin.database.v1.DatabaseAdmin.CopyBackupCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DatabaseAdmin.prototype.copyBackup = function copyBackup(request, callback) { + return this.rpcCall(copyBackup, $root.google.spanner.admin.database.v1.CopyBackupRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CopyBackup" }); + + /** + * Calls CopyBackup. + * @function copyBackup + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.ICopyBackupRequest} request CopyBackupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|getBackup}. + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @typedef GetBackupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.spanner.admin.database.v1.Backup} [response] Backup + */ + + /** + * Calls GetBackup. + * @function getBackup + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.IGetBackupRequest} request GetBackupRequest message or plain object + * @param {google.spanner.admin.database.v1.DatabaseAdmin.GetBackupCallback} callback Node-style callback called with the error, if any, and Backup + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DatabaseAdmin.prototype.getBackup = function getBackup(request, callback) { + return this.rpcCall(getBackup, $root.google.spanner.admin.database.v1.GetBackupRequest, $root.google.spanner.admin.database.v1.Backup, request, callback); + }, "name", { value: "GetBackup" }); + + /** + * Calls GetBackup. + * @function getBackup + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.IGetBackupRequest} request GetBackupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|updateBackup}. + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @typedef UpdateBackupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.spanner.admin.database.v1.Backup} [response] Backup + */ + + /** + * Calls UpdateBackup. + * @function updateBackup + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.IUpdateBackupRequest} request UpdateBackupRequest message or plain object + * @param {google.spanner.admin.database.v1.DatabaseAdmin.UpdateBackupCallback} callback Node-style callback called with the error, if any, and Backup + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DatabaseAdmin.prototype.updateBackup = function updateBackup(request, callback) { + return this.rpcCall(updateBackup, $root.google.spanner.admin.database.v1.UpdateBackupRequest, $root.google.spanner.admin.database.v1.Backup, request, callback); + }, "name", { value: "UpdateBackup" }); + + /** + * Calls UpdateBackup. + * @function updateBackup + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.IUpdateBackupRequest} request UpdateBackupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|deleteBackup}. + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @typedef DeleteBackupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteBackup. + * @function deleteBackup + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.IDeleteBackupRequest} request DeleteBackupRequest message or plain object + * @param {google.spanner.admin.database.v1.DatabaseAdmin.DeleteBackupCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DatabaseAdmin.prototype.deleteBackup = function deleteBackup(request, callback) { + return this.rpcCall(deleteBackup, $root.google.spanner.admin.database.v1.DeleteBackupRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteBackup" }); + + /** + * Calls DeleteBackup. + * @function deleteBackup + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.IDeleteBackupRequest} request DeleteBackupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|listBackups}. + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @typedef ListBackupsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.spanner.admin.database.v1.ListBackupsResponse} [response] ListBackupsResponse + */ + + /** + * Calls ListBackups. + * @function listBackups + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.IListBackupsRequest} request ListBackupsRequest message or plain object + * @param {google.spanner.admin.database.v1.DatabaseAdmin.ListBackupsCallback} callback Node-style callback called with the error, if any, and ListBackupsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DatabaseAdmin.prototype.listBackups = function listBackups(request, callback) { + return this.rpcCall(listBackups, $root.google.spanner.admin.database.v1.ListBackupsRequest, $root.google.spanner.admin.database.v1.ListBackupsResponse, request, callback); + }, "name", { value: "ListBackups" }); + + /** + * Calls ListBackups. + * @function listBackups + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.IListBackupsRequest} request ListBackupsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|restoreDatabase}. + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @typedef RestoreDatabaseCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls RestoreDatabase. + * @function restoreDatabase + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.IRestoreDatabaseRequest} request RestoreDatabaseRequest message or plain object + * @param {google.spanner.admin.database.v1.DatabaseAdmin.RestoreDatabaseCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DatabaseAdmin.prototype.restoreDatabase = function restoreDatabase(request, callback) { + return this.rpcCall(restoreDatabase, $root.google.spanner.admin.database.v1.RestoreDatabaseRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "RestoreDatabase" }); + + /** + * Calls RestoreDatabase. + * @function restoreDatabase + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.IRestoreDatabaseRequest} request RestoreDatabaseRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|listDatabaseOperations}. + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @typedef ListDatabaseOperationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.spanner.admin.database.v1.ListDatabaseOperationsResponse} [response] ListDatabaseOperationsResponse + */ + + /** + * Calls ListDatabaseOperations. + * @function listDatabaseOperations + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.IListDatabaseOperationsRequest} request ListDatabaseOperationsRequest message or plain object + * @param {google.spanner.admin.database.v1.DatabaseAdmin.ListDatabaseOperationsCallback} callback Node-style callback called with the error, if any, and ListDatabaseOperationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DatabaseAdmin.prototype.listDatabaseOperations = function listDatabaseOperations(request, callback) { + return this.rpcCall(listDatabaseOperations, $root.google.spanner.admin.database.v1.ListDatabaseOperationsRequest, $root.google.spanner.admin.database.v1.ListDatabaseOperationsResponse, request, callback); + }, "name", { value: "ListDatabaseOperations" }); + + /** + * Calls ListDatabaseOperations. + * @function listDatabaseOperations + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.IListDatabaseOperationsRequest} request ListDatabaseOperationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|listBackupOperations}. + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @typedef ListBackupOperationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.spanner.admin.database.v1.ListBackupOperationsResponse} [response] ListBackupOperationsResponse + */ + + /** + * Calls ListBackupOperations. + * @function listBackupOperations + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.IListBackupOperationsRequest} request ListBackupOperationsRequest message or plain object + * @param {google.spanner.admin.database.v1.DatabaseAdmin.ListBackupOperationsCallback} callback Node-style callback called with the error, if any, and ListBackupOperationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DatabaseAdmin.prototype.listBackupOperations = function listBackupOperations(request, callback) { + return this.rpcCall(listBackupOperations, $root.google.spanner.admin.database.v1.ListBackupOperationsRequest, $root.google.spanner.admin.database.v1.ListBackupOperationsResponse, request, callback); + }, "name", { value: "ListBackupOperations" }); + + /** + * Calls ListBackupOperations. + * @function listBackupOperations + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.IListBackupOperationsRequest} request ListBackupOperationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|listDatabaseRoles}. + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @typedef ListDatabaseRolesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.spanner.admin.database.v1.ListDatabaseRolesResponse} [response] ListDatabaseRolesResponse + */ + + /** + * Calls ListDatabaseRoles. + * @function listDatabaseRoles + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.IListDatabaseRolesRequest} request ListDatabaseRolesRequest message or plain object + * @param {google.spanner.admin.database.v1.DatabaseAdmin.ListDatabaseRolesCallback} callback Node-style callback called with the error, if any, and ListDatabaseRolesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DatabaseAdmin.prototype.listDatabaseRoles = function listDatabaseRoles(request, callback) { + return this.rpcCall(listDatabaseRoles, $root.google.spanner.admin.database.v1.ListDatabaseRolesRequest, $root.google.spanner.admin.database.v1.ListDatabaseRolesResponse, request, callback); + }, "name", { value: "ListDatabaseRoles" }); + + /** + * Calls ListDatabaseRoles. + * @function listDatabaseRoles + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.IListDatabaseRolesRequest} request ListDatabaseRolesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|addSplitPoints}. + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @typedef AddSplitPointsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.spanner.admin.database.v1.AddSplitPointsResponse} [response] AddSplitPointsResponse + */ + + /** + * Calls AddSplitPoints. + * @function addSplitPoints + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.IAddSplitPointsRequest} request AddSplitPointsRequest message or plain object + * @param {google.spanner.admin.database.v1.DatabaseAdmin.AddSplitPointsCallback} callback Node-style callback called with the error, if any, and AddSplitPointsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DatabaseAdmin.prototype.addSplitPoints = function addSplitPoints(request, callback) { + return this.rpcCall(addSplitPoints, $root.google.spanner.admin.database.v1.AddSplitPointsRequest, $root.google.spanner.admin.database.v1.AddSplitPointsResponse, request, callback); + }, "name", { value: "AddSplitPoints" }); + + /** + * Calls AddSplitPoints. + * @function addSplitPoints + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.IAddSplitPointsRequest} request AddSplitPointsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|createBackupSchedule}. + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @typedef CreateBackupScheduleCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.spanner.admin.database.v1.BackupSchedule} [response] BackupSchedule + */ + + /** + * Calls CreateBackupSchedule. + * @function createBackupSchedule + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.ICreateBackupScheduleRequest} request CreateBackupScheduleRequest message or plain object + * @param {google.spanner.admin.database.v1.DatabaseAdmin.CreateBackupScheduleCallback} callback Node-style callback called with the error, if any, and BackupSchedule + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DatabaseAdmin.prototype.createBackupSchedule = function createBackupSchedule(request, callback) { + return this.rpcCall(createBackupSchedule, $root.google.spanner.admin.database.v1.CreateBackupScheduleRequest, $root.google.spanner.admin.database.v1.BackupSchedule, request, callback); + }, "name", { value: "CreateBackupSchedule" }); + + /** + * Calls CreateBackupSchedule. + * @function createBackupSchedule + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.ICreateBackupScheduleRequest} request CreateBackupScheduleRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|getBackupSchedule}. + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @typedef GetBackupScheduleCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.spanner.admin.database.v1.BackupSchedule} [response] BackupSchedule + */ + + /** + * Calls GetBackupSchedule. + * @function getBackupSchedule + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.IGetBackupScheduleRequest} request GetBackupScheduleRequest message or plain object + * @param {google.spanner.admin.database.v1.DatabaseAdmin.GetBackupScheduleCallback} callback Node-style callback called with the error, if any, and BackupSchedule + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DatabaseAdmin.prototype.getBackupSchedule = function getBackupSchedule(request, callback) { + return this.rpcCall(getBackupSchedule, $root.google.spanner.admin.database.v1.GetBackupScheduleRequest, $root.google.spanner.admin.database.v1.BackupSchedule, request, callback); + }, "name", { value: "GetBackupSchedule" }); + + /** + * Calls GetBackupSchedule. + * @function getBackupSchedule + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.IGetBackupScheduleRequest} request GetBackupScheduleRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|updateBackupSchedule}. + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @typedef UpdateBackupScheduleCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.spanner.admin.database.v1.BackupSchedule} [response] BackupSchedule + */ + + /** + * Calls UpdateBackupSchedule. + * @function updateBackupSchedule + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.IUpdateBackupScheduleRequest} request UpdateBackupScheduleRequest message or plain object + * @param {google.spanner.admin.database.v1.DatabaseAdmin.UpdateBackupScheduleCallback} callback Node-style callback called with the error, if any, and BackupSchedule + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DatabaseAdmin.prototype.updateBackupSchedule = function updateBackupSchedule(request, callback) { + return this.rpcCall(updateBackupSchedule, $root.google.spanner.admin.database.v1.UpdateBackupScheduleRequest, $root.google.spanner.admin.database.v1.BackupSchedule, request, callback); + }, "name", { value: "UpdateBackupSchedule" }); + + /** + * Calls UpdateBackupSchedule. + * @function updateBackupSchedule + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.IUpdateBackupScheduleRequest} request UpdateBackupScheduleRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|deleteBackupSchedule}. + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @typedef DeleteBackupScheduleCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteBackupSchedule. + * @function deleteBackupSchedule + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.IDeleteBackupScheduleRequest} request DeleteBackupScheduleRequest message or plain object + * @param {google.spanner.admin.database.v1.DatabaseAdmin.DeleteBackupScheduleCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DatabaseAdmin.prototype.deleteBackupSchedule = function deleteBackupSchedule(request, callback) { + return this.rpcCall(deleteBackupSchedule, $root.google.spanner.admin.database.v1.DeleteBackupScheduleRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteBackupSchedule" }); + + /** + * Calls DeleteBackupSchedule. + * @function deleteBackupSchedule + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.IDeleteBackupScheduleRequest} request DeleteBackupScheduleRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|listBackupSchedules}. + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @typedef ListBackupSchedulesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.spanner.admin.database.v1.ListBackupSchedulesResponse} [response] ListBackupSchedulesResponse + */ + + /** + * Calls ListBackupSchedules. + * @function listBackupSchedules + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.IListBackupSchedulesRequest} request ListBackupSchedulesRequest message or plain object + * @param {google.spanner.admin.database.v1.DatabaseAdmin.ListBackupSchedulesCallback} callback Node-style callback called with the error, if any, and ListBackupSchedulesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DatabaseAdmin.prototype.listBackupSchedules = function listBackupSchedules(request, callback) { + return this.rpcCall(listBackupSchedules, $root.google.spanner.admin.database.v1.ListBackupSchedulesRequest, $root.google.spanner.admin.database.v1.ListBackupSchedulesResponse, request, callback); + }, "name", { value: "ListBackupSchedules" }); + + /** + * Calls ListBackupSchedules. + * @function listBackupSchedules + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.IListBackupSchedulesRequest} request ListBackupSchedulesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|internalUpdateGraphOperation}. + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @typedef InternalUpdateGraphOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse} [response] InternalUpdateGraphOperationResponse + */ + + /** + * Calls InternalUpdateGraphOperation. + * @function internalUpdateGraphOperation + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.IInternalUpdateGraphOperationRequest} request InternalUpdateGraphOperationRequest message or plain object + * @param {google.spanner.admin.database.v1.DatabaseAdmin.InternalUpdateGraphOperationCallback} callback Node-style callback called with the error, if any, and InternalUpdateGraphOperationResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DatabaseAdmin.prototype.internalUpdateGraphOperation = function internalUpdateGraphOperation(request, callback) { + return this.rpcCall(internalUpdateGraphOperation, $root.google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest, $root.google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse, request, callback); + }, "name", { value: "InternalUpdateGraphOperation" }); + + /** + * Calls InternalUpdateGraphOperation. + * @function internalUpdateGraphOperation + * @memberof google.spanner.admin.database.v1.DatabaseAdmin + * @instance + * @param {google.spanner.admin.database.v1.IInternalUpdateGraphOperationRequest} request InternalUpdateGraphOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return DatabaseAdmin; + })(); + + v1.RestoreInfo = (function() { + + /** + * Properties of a RestoreInfo. + * @memberof google.spanner.admin.database.v1 + * @interface IRestoreInfo + * @property {google.spanner.admin.database.v1.RestoreSourceType|null} [sourceType] RestoreInfo sourceType + * @property {google.spanner.admin.database.v1.IBackupInfo|null} [backupInfo] RestoreInfo backupInfo + */ + + /** + * Constructs a new RestoreInfo. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents a RestoreInfo. + * @implements IRestoreInfo + * @constructor + * @param {google.spanner.admin.database.v1.IRestoreInfo=} [properties] Properties to set + */ + function RestoreInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RestoreInfo sourceType. + * @member {google.spanner.admin.database.v1.RestoreSourceType} sourceType + * @memberof google.spanner.admin.database.v1.RestoreInfo + * @instance + */ + RestoreInfo.prototype.sourceType = 0; + + /** + * RestoreInfo backupInfo. + * @member {google.spanner.admin.database.v1.IBackupInfo|null|undefined} backupInfo + * @memberof google.spanner.admin.database.v1.RestoreInfo + * @instance + */ + RestoreInfo.prototype.backupInfo = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RestoreInfo sourceInfo. + * @member {"backupInfo"|undefined} sourceInfo + * @memberof google.spanner.admin.database.v1.RestoreInfo + * @instance + */ + Object.defineProperty(RestoreInfo.prototype, "sourceInfo", { + get: $util.oneOfGetter($oneOfFields = ["backupInfo"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RestoreInfo instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.RestoreInfo + * @static + * @param {google.spanner.admin.database.v1.IRestoreInfo=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.RestoreInfo} RestoreInfo instance + */ + RestoreInfo.create = function create(properties) { + return new RestoreInfo(properties); + }; + + /** + * Encodes the specified RestoreInfo message. Does not implicitly {@link google.spanner.admin.database.v1.RestoreInfo.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.RestoreInfo + * @static + * @param {google.spanner.admin.database.v1.IRestoreInfo} message RestoreInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sourceType != null && Object.hasOwnProperty.call(message, "sourceType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.sourceType); + if (message.backupInfo != null && Object.hasOwnProperty.call(message, "backupInfo")) + $root.google.spanner.admin.database.v1.BackupInfo.encode(message.backupInfo, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RestoreInfo message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.RestoreInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.RestoreInfo + * @static + * @param {google.spanner.admin.database.v1.IRestoreInfo} message RestoreInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RestoreInfo message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.RestoreInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.RestoreInfo} RestoreInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.RestoreInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.sourceType = reader.int32(); + break; + } + case 2: { + message.backupInfo = $root.google.spanner.admin.database.v1.BackupInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RestoreInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.RestoreInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.RestoreInfo} RestoreInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RestoreInfo message. + * @function verify + * @memberof google.spanner.admin.database.v1.RestoreInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RestoreInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.sourceType != null && message.hasOwnProperty("sourceType")) + switch (message.sourceType) { + default: + return "sourceType: enum value expected"; + case 0: + case 1: + break; + } + if (message.backupInfo != null && message.hasOwnProperty("backupInfo")) { + properties.sourceInfo = 1; + { + var error = $root.google.spanner.admin.database.v1.BackupInfo.verify(message.backupInfo); + if (error) + return "backupInfo." + error; + } + } + return null; + }; + + /** + * Creates a RestoreInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.RestoreInfo + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.RestoreInfo} RestoreInfo + */ + RestoreInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.RestoreInfo) + return object; + var message = new $root.google.spanner.admin.database.v1.RestoreInfo(); + switch (object.sourceType) { + default: + if (typeof object.sourceType === "number") { + message.sourceType = object.sourceType; + break; + } + break; + case "TYPE_UNSPECIFIED": + case 0: + message.sourceType = 0; + break; + case "BACKUP": + case 1: + message.sourceType = 1; + break; + } + if (object.backupInfo != null) { + if (typeof object.backupInfo !== "object") + throw TypeError(".google.spanner.admin.database.v1.RestoreInfo.backupInfo: object expected"); + message.backupInfo = $root.google.spanner.admin.database.v1.BackupInfo.fromObject(object.backupInfo); + } + return message; + }; + + /** + * Creates a plain object from a RestoreInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.RestoreInfo + * @static + * @param {google.spanner.admin.database.v1.RestoreInfo} message RestoreInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RestoreInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.sourceType = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + if (message.sourceType != null && message.hasOwnProperty("sourceType")) + object.sourceType = options.enums === String ? $root.google.spanner.admin.database.v1.RestoreSourceType[message.sourceType] === undefined ? message.sourceType : $root.google.spanner.admin.database.v1.RestoreSourceType[message.sourceType] : message.sourceType; + if (message.backupInfo != null && message.hasOwnProperty("backupInfo")) { + object.backupInfo = $root.google.spanner.admin.database.v1.BackupInfo.toObject(message.backupInfo, options); + if (options.oneofs) + object.sourceInfo = "backupInfo"; + } + return object; + }; + + /** + * Converts this RestoreInfo to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.RestoreInfo + * @instance + * @returns {Object.} JSON object + */ + RestoreInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RestoreInfo + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.RestoreInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RestoreInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.RestoreInfo"; + }; + + return RestoreInfo; + })(); + + v1.Database = (function() { + + /** + * Properties of a Database. + * @memberof google.spanner.admin.database.v1 + * @interface IDatabase + * @property {string|null} [name] Database name + * @property {google.spanner.admin.database.v1.Database.State|null} [state] Database state + * @property {google.protobuf.ITimestamp|null} [createTime] Database createTime + * @property {google.spanner.admin.database.v1.IRestoreInfo|null} [restoreInfo] Database restoreInfo + * @property {google.spanner.admin.database.v1.IEncryptionConfig|null} [encryptionConfig] Database encryptionConfig + * @property {Array.|null} [encryptionInfo] Database encryptionInfo + * @property {string|null} [versionRetentionPeriod] Database versionRetentionPeriod + * @property {google.protobuf.ITimestamp|null} [earliestVersionTime] Database earliestVersionTime + * @property {string|null} [defaultLeader] Database defaultLeader + * @property {google.spanner.admin.database.v1.DatabaseDialect|null} [databaseDialect] Database databaseDialect + * @property {boolean|null} [enableDropProtection] Database enableDropProtection + * @property {boolean|null} [reconciling] Database reconciling + */ + + /** + * Constructs a new Database. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents a Database. + * @implements IDatabase + * @constructor + * @param {google.spanner.admin.database.v1.IDatabase=} [properties] Properties to set + */ + function Database(properties) { + this.encryptionInfo = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Database name. + * @member {string} name + * @memberof google.spanner.admin.database.v1.Database + * @instance + */ + Database.prototype.name = ""; + + /** + * Database state. + * @member {google.spanner.admin.database.v1.Database.State} state + * @memberof google.spanner.admin.database.v1.Database + * @instance + */ + Database.prototype.state = 0; + + /** + * Database createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.spanner.admin.database.v1.Database + * @instance + */ + Database.prototype.createTime = null; + + /** + * Database restoreInfo. + * @member {google.spanner.admin.database.v1.IRestoreInfo|null|undefined} restoreInfo + * @memberof google.spanner.admin.database.v1.Database + * @instance + */ + Database.prototype.restoreInfo = null; + + /** + * Database encryptionConfig. + * @member {google.spanner.admin.database.v1.IEncryptionConfig|null|undefined} encryptionConfig + * @memberof google.spanner.admin.database.v1.Database + * @instance + */ + Database.prototype.encryptionConfig = null; + + /** + * Database encryptionInfo. + * @member {Array.} encryptionInfo + * @memberof google.spanner.admin.database.v1.Database + * @instance + */ + Database.prototype.encryptionInfo = $util.emptyArray; + + /** + * Database versionRetentionPeriod. + * @member {string} versionRetentionPeriod + * @memberof google.spanner.admin.database.v1.Database + * @instance + */ + Database.prototype.versionRetentionPeriod = ""; + + /** + * Database earliestVersionTime. + * @member {google.protobuf.ITimestamp|null|undefined} earliestVersionTime + * @memberof google.spanner.admin.database.v1.Database + * @instance + */ + Database.prototype.earliestVersionTime = null; + + /** + * Database defaultLeader. + * @member {string} defaultLeader + * @memberof google.spanner.admin.database.v1.Database + * @instance + */ + Database.prototype.defaultLeader = ""; + + /** + * Database databaseDialect. + * @member {google.spanner.admin.database.v1.DatabaseDialect} databaseDialect + * @memberof google.spanner.admin.database.v1.Database + * @instance + */ + Database.prototype.databaseDialect = 0; + + /** + * Database enableDropProtection. + * @member {boolean} enableDropProtection + * @memberof google.spanner.admin.database.v1.Database + * @instance + */ + Database.prototype.enableDropProtection = false; + + /** + * Database reconciling. + * @member {boolean} reconciling + * @memberof google.spanner.admin.database.v1.Database + * @instance + */ + Database.prototype.reconciling = false; + + /** + * Creates a new Database instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.Database + * @static + * @param {google.spanner.admin.database.v1.IDatabase=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.Database} Database instance + */ + Database.create = function create(properties) { + return new Database(properties); + }; + + /** + * Encodes the specified Database message. Does not implicitly {@link google.spanner.admin.database.v1.Database.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.Database + * @static + * @param {google.spanner.admin.database.v1.IDatabase} message Database message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Database.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.restoreInfo != null && Object.hasOwnProperty.call(message, "restoreInfo")) + $root.google.spanner.admin.database.v1.RestoreInfo.encode(message.restoreInfo, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) + $root.google.spanner.admin.database.v1.EncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.versionRetentionPeriod != null && Object.hasOwnProperty.call(message, "versionRetentionPeriod")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.versionRetentionPeriod); + if (message.earliestVersionTime != null && Object.hasOwnProperty.call(message, "earliestVersionTime")) + $root.google.protobuf.Timestamp.encode(message.earliestVersionTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.encryptionInfo != null && message.encryptionInfo.length) + for (var i = 0; i < message.encryptionInfo.length; ++i) + $root.google.spanner.admin.database.v1.EncryptionInfo.encode(message.encryptionInfo[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.defaultLeader != null && Object.hasOwnProperty.call(message, "defaultLeader")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.defaultLeader); + if (message.databaseDialect != null && Object.hasOwnProperty.call(message, "databaseDialect")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.databaseDialect); + if (message.enableDropProtection != null && Object.hasOwnProperty.call(message, "enableDropProtection")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.enableDropProtection); + if (message.reconciling != null && Object.hasOwnProperty.call(message, "reconciling")) + writer.uint32(/* id 12, wireType 0 =*/96).bool(message.reconciling); + return writer; + }; + + /** + * Encodes the specified Database message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.Database.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.Database + * @static + * @param {google.spanner.admin.database.v1.IDatabase} message Database message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Database.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Database message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.Database + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.Database} Database + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Database.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.Database(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.state = reader.int32(); + break; + } + case 3: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.restoreInfo = $root.google.spanner.admin.database.v1.RestoreInfo.decode(reader, reader.uint32()); + break; + } + case 5: { + message.encryptionConfig = $root.google.spanner.admin.database.v1.EncryptionConfig.decode(reader, reader.uint32()); + break; + } + case 8: { + if (!(message.encryptionInfo && message.encryptionInfo.length)) + message.encryptionInfo = []; + message.encryptionInfo.push($root.google.spanner.admin.database.v1.EncryptionInfo.decode(reader, reader.uint32())); + break; + } + case 6: { + message.versionRetentionPeriod = reader.string(); + break; + } + case 7: { + message.earliestVersionTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 9: { + message.defaultLeader = reader.string(); + break; + } + case 10: { + message.databaseDialect = reader.int32(); + break; + } + case 11: { + message.enableDropProtection = reader.bool(); + break; + } + case 12: { + message.reconciling = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Database message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.Database + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.Database} Database + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Database.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Database message. + * @function verify + * @memberof google.spanner.admin.database.v1.Database + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Database.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.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.restoreInfo != null && message.hasOwnProperty("restoreInfo")) { + var error = $root.google.spanner.admin.database.v1.RestoreInfo.verify(message.restoreInfo); + if (error) + return "restoreInfo." + error; + } + if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { + var error = $root.google.spanner.admin.database.v1.EncryptionConfig.verify(message.encryptionConfig); + if (error) + return "encryptionConfig." + error; + } + if (message.encryptionInfo != null && message.hasOwnProperty("encryptionInfo")) { + if (!Array.isArray(message.encryptionInfo)) + return "encryptionInfo: array expected"; + for (var i = 0; i < message.encryptionInfo.length; ++i) { + var error = $root.google.spanner.admin.database.v1.EncryptionInfo.verify(message.encryptionInfo[i]); + if (error) + return "encryptionInfo." + error; + } + } + if (message.versionRetentionPeriod != null && message.hasOwnProperty("versionRetentionPeriod")) + if (!$util.isString(message.versionRetentionPeriod)) + return "versionRetentionPeriod: string expected"; + if (message.earliestVersionTime != null && message.hasOwnProperty("earliestVersionTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.earliestVersionTime); + if (error) + return "earliestVersionTime." + error; + } + if (message.defaultLeader != null && message.hasOwnProperty("defaultLeader")) + if (!$util.isString(message.defaultLeader)) + return "defaultLeader: string expected"; + if (message.databaseDialect != null && message.hasOwnProperty("databaseDialect")) + switch (message.databaseDialect) { + default: + return "databaseDialect: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.enableDropProtection != null && message.hasOwnProperty("enableDropProtection")) + if (typeof message.enableDropProtection !== "boolean") + return "enableDropProtection: boolean expected"; + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + if (typeof message.reconciling !== "boolean") + return "reconciling: boolean expected"; + return null; + }; + + /** + * Creates a Database message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.Database + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.Database} Database + */ + Database.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.Database) + return object; + var message = new $root.google.spanner.admin.database.v1.Database(); + if (object.name != null) + message.name = String(object.name); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "CREATING": + case 1: + message.state = 1; + break; + case "READY": + case 2: + message.state = 2; + break; + case "READY_OPTIMIZING": + case 3: + message.state = 3; + break; + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.spanner.admin.database.v1.Database.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.restoreInfo != null) { + if (typeof object.restoreInfo !== "object") + throw TypeError(".google.spanner.admin.database.v1.Database.restoreInfo: object expected"); + message.restoreInfo = $root.google.spanner.admin.database.v1.RestoreInfo.fromObject(object.restoreInfo); + } + if (object.encryptionConfig != null) { + if (typeof object.encryptionConfig !== "object") + throw TypeError(".google.spanner.admin.database.v1.Database.encryptionConfig: object expected"); + message.encryptionConfig = $root.google.spanner.admin.database.v1.EncryptionConfig.fromObject(object.encryptionConfig); + } + if (object.encryptionInfo) { + if (!Array.isArray(object.encryptionInfo)) + throw TypeError(".google.spanner.admin.database.v1.Database.encryptionInfo: array expected"); + message.encryptionInfo = []; + for (var i = 0; i < object.encryptionInfo.length; ++i) { + if (typeof object.encryptionInfo[i] !== "object") + throw TypeError(".google.spanner.admin.database.v1.Database.encryptionInfo: object expected"); + message.encryptionInfo[i] = $root.google.spanner.admin.database.v1.EncryptionInfo.fromObject(object.encryptionInfo[i]); + } + } + if (object.versionRetentionPeriod != null) + message.versionRetentionPeriod = String(object.versionRetentionPeriod); + if (object.earliestVersionTime != null) { + if (typeof object.earliestVersionTime !== "object") + throw TypeError(".google.spanner.admin.database.v1.Database.earliestVersionTime: object expected"); + message.earliestVersionTime = $root.google.protobuf.Timestamp.fromObject(object.earliestVersionTime); + } + if (object.defaultLeader != null) + message.defaultLeader = String(object.defaultLeader); + switch (object.databaseDialect) { + default: + if (typeof object.databaseDialect === "number") { + message.databaseDialect = object.databaseDialect; + break; + } + break; + case "DATABASE_DIALECT_UNSPECIFIED": + case 0: + message.databaseDialect = 0; + break; + case "GOOGLE_STANDARD_SQL": + case 1: + message.databaseDialect = 1; + break; + case "POSTGRESQL": + case 2: + message.databaseDialect = 2; + break; + } + if (object.enableDropProtection != null) + message.enableDropProtection = Boolean(object.enableDropProtection); + if (object.reconciling != null) + message.reconciling = Boolean(object.reconciling); + return message; + }; + + /** + * Creates a plain object from a Database message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.Database + * @static + * @param {google.spanner.admin.database.v1.Database} message Database + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Database.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.encryptionInfo = []; + if (options.defaults) { + object.name = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.createTime = null; + object.restoreInfo = null; + object.encryptionConfig = null; + object.versionRetentionPeriod = ""; + object.earliestVersionTime = null; + object.defaultLeader = ""; + object.databaseDialect = options.enums === String ? "DATABASE_DIALECT_UNSPECIFIED" : 0; + object.enableDropProtection = false; + object.reconciling = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.spanner.admin.database.v1.Database.State[message.state] === undefined ? message.state : $root.google.spanner.admin.database.v1.Database.State[message.state] : message.state; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.restoreInfo != null && message.hasOwnProperty("restoreInfo")) + object.restoreInfo = $root.google.spanner.admin.database.v1.RestoreInfo.toObject(message.restoreInfo, options); + if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) + object.encryptionConfig = $root.google.spanner.admin.database.v1.EncryptionConfig.toObject(message.encryptionConfig, options); + if (message.versionRetentionPeriod != null && message.hasOwnProperty("versionRetentionPeriod")) + object.versionRetentionPeriod = message.versionRetentionPeriod; + if (message.earliestVersionTime != null && message.hasOwnProperty("earliestVersionTime")) + object.earliestVersionTime = $root.google.protobuf.Timestamp.toObject(message.earliestVersionTime, options); + if (message.encryptionInfo && message.encryptionInfo.length) { + object.encryptionInfo = []; + for (var j = 0; j < message.encryptionInfo.length; ++j) + object.encryptionInfo[j] = $root.google.spanner.admin.database.v1.EncryptionInfo.toObject(message.encryptionInfo[j], options); + } + if (message.defaultLeader != null && message.hasOwnProperty("defaultLeader")) + object.defaultLeader = message.defaultLeader; + if (message.databaseDialect != null && message.hasOwnProperty("databaseDialect")) + object.databaseDialect = options.enums === String ? $root.google.spanner.admin.database.v1.DatabaseDialect[message.databaseDialect] === undefined ? message.databaseDialect : $root.google.spanner.admin.database.v1.DatabaseDialect[message.databaseDialect] : message.databaseDialect; + if (message.enableDropProtection != null && message.hasOwnProperty("enableDropProtection")) + object.enableDropProtection = message.enableDropProtection; + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + object.reconciling = message.reconciling; + return object; + }; + + /** + * Converts this Database to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.Database + * @instance + * @returns {Object.} JSON object + */ + Database.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Database + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.Database + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Database.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.Database"; + }; + + /** + * State enum. + * @name google.spanner.admin.database.v1.Database.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} CREATING=1 CREATING value + * @property {number} READY=2 READY value + * @property {number} READY_OPTIMIZING=3 READY_OPTIMIZING value + */ + Database.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CREATING"] = 1; + values[valuesById[2] = "READY"] = 2; + values[valuesById[3] = "READY_OPTIMIZING"] = 3; + return values; + })(); + + return Database; + })(); + + v1.ListDatabasesRequest = (function() { + + /** + * Properties of a ListDatabasesRequest. + * @memberof google.spanner.admin.database.v1 + * @interface IListDatabasesRequest + * @property {string|null} [parent] ListDatabasesRequest parent + * @property {number|null} [pageSize] ListDatabasesRequest pageSize + * @property {string|null} [pageToken] ListDatabasesRequest pageToken + */ + + /** + * Constructs a new ListDatabasesRequest. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents a ListDatabasesRequest. + * @implements IListDatabasesRequest + * @constructor + * @param {google.spanner.admin.database.v1.IListDatabasesRequest=} [properties] Properties to set + */ + function ListDatabasesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListDatabasesRequest parent. + * @member {string} parent + * @memberof google.spanner.admin.database.v1.ListDatabasesRequest + * @instance + */ + ListDatabasesRequest.prototype.parent = ""; + + /** + * ListDatabasesRequest pageSize. + * @member {number} pageSize + * @memberof google.spanner.admin.database.v1.ListDatabasesRequest + * @instance + */ + ListDatabasesRequest.prototype.pageSize = 0; + + /** + * ListDatabasesRequest pageToken. + * @member {string} pageToken + * @memberof google.spanner.admin.database.v1.ListDatabasesRequest + * @instance + */ + ListDatabasesRequest.prototype.pageToken = ""; + + /** + * Creates a new ListDatabasesRequest instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.ListDatabasesRequest + * @static + * @param {google.spanner.admin.database.v1.IListDatabasesRequest=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.ListDatabasesRequest} ListDatabasesRequest instance + */ + ListDatabasesRequest.create = function create(properties) { + return new ListDatabasesRequest(properties); + }; + + /** + * Encodes the specified ListDatabasesRequest message. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabasesRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.ListDatabasesRequest + * @static + * @param {google.spanner.admin.database.v1.IListDatabasesRequest} message ListDatabasesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDatabasesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListDatabasesRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabasesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.ListDatabasesRequest + * @static + * @param {google.spanner.admin.database.v1.IListDatabasesRequest} message ListDatabasesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDatabasesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDatabasesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.ListDatabasesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.ListDatabasesRequest} ListDatabasesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDatabasesRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.ListDatabasesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListDatabasesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.ListDatabasesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.ListDatabasesRequest} ListDatabasesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDatabasesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDatabasesRequest message. + * @function verify + * @memberof google.spanner.admin.database.v1.ListDatabasesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDatabasesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListDatabasesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.ListDatabasesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.ListDatabasesRequest} ListDatabasesRequest + */ + ListDatabasesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.ListDatabasesRequest) + return object; + var message = new $root.google.spanner.admin.database.v1.ListDatabasesRequest(); + 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 ListDatabasesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.ListDatabasesRequest + * @static + * @param {google.spanner.admin.database.v1.ListDatabasesRequest} message ListDatabasesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDatabasesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListDatabasesRequest to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.ListDatabasesRequest + * @instance + * @returns {Object.} JSON object + */ + ListDatabasesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDatabasesRequest + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.ListDatabasesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDatabasesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.ListDatabasesRequest"; + }; + + return ListDatabasesRequest; + })(); + + v1.ListDatabasesResponse = (function() { + + /** + * Properties of a ListDatabasesResponse. + * @memberof google.spanner.admin.database.v1 + * @interface IListDatabasesResponse + * @property {Array.|null} [databases] ListDatabasesResponse databases + * @property {string|null} [nextPageToken] ListDatabasesResponse nextPageToken + */ + + /** + * Constructs a new ListDatabasesResponse. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents a ListDatabasesResponse. + * @implements IListDatabasesResponse + * @constructor + * @param {google.spanner.admin.database.v1.IListDatabasesResponse=} [properties] Properties to set + */ + function ListDatabasesResponse(properties) { + this.databases = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListDatabasesResponse databases. + * @member {Array.} databases + * @memberof google.spanner.admin.database.v1.ListDatabasesResponse + * @instance + */ + ListDatabasesResponse.prototype.databases = $util.emptyArray; + + /** + * ListDatabasesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.spanner.admin.database.v1.ListDatabasesResponse + * @instance + */ + ListDatabasesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListDatabasesResponse instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.ListDatabasesResponse + * @static + * @param {google.spanner.admin.database.v1.IListDatabasesResponse=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.ListDatabasesResponse} ListDatabasesResponse instance + */ + ListDatabasesResponse.create = function create(properties) { + return new ListDatabasesResponse(properties); + }; + + /** + * Encodes the specified ListDatabasesResponse message. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabasesResponse.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.ListDatabasesResponse + * @static + * @param {google.spanner.admin.database.v1.IListDatabasesResponse} message ListDatabasesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDatabasesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.databases != null && message.databases.length) + for (var i = 0; i < message.databases.length; ++i) + $root.google.spanner.admin.database.v1.Database.encode(message.databases[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListDatabasesResponse message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabasesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.ListDatabasesResponse + * @static + * @param {google.spanner.admin.database.v1.IListDatabasesResponse} message ListDatabasesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDatabasesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDatabasesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.ListDatabasesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.ListDatabasesResponse} ListDatabasesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDatabasesResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.ListDatabasesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.databases && message.databases.length)) + message.databases = []; + message.databases.push($root.google.spanner.admin.database.v1.Database.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListDatabasesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.ListDatabasesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.ListDatabasesResponse} ListDatabasesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDatabasesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDatabasesResponse message. + * @function verify + * @memberof google.spanner.admin.database.v1.ListDatabasesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDatabasesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.databases != null && message.hasOwnProperty("databases")) { + if (!Array.isArray(message.databases)) + return "databases: array expected"; + for (var i = 0; i < message.databases.length; ++i) { + var error = $root.google.spanner.admin.database.v1.Database.verify(message.databases[i]); + if (error) + return "databases." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListDatabasesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.ListDatabasesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.ListDatabasesResponse} ListDatabasesResponse + */ + ListDatabasesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.ListDatabasesResponse) + return object; + var message = new $root.google.spanner.admin.database.v1.ListDatabasesResponse(); + if (object.databases) { + if (!Array.isArray(object.databases)) + throw TypeError(".google.spanner.admin.database.v1.ListDatabasesResponse.databases: array expected"); + message.databases = []; + for (var i = 0; i < object.databases.length; ++i) { + if (typeof object.databases[i] !== "object") + throw TypeError(".google.spanner.admin.database.v1.ListDatabasesResponse.databases: object expected"); + message.databases[i] = $root.google.spanner.admin.database.v1.Database.fromObject(object.databases[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListDatabasesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.ListDatabasesResponse + * @static + * @param {google.spanner.admin.database.v1.ListDatabasesResponse} message ListDatabasesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDatabasesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.databases = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.databases && message.databases.length) { + object.databases = []; + for (var j = 0; j < message.databases.length; ++j) + object.databases[j] = $root.google.spanner.admin.database.v1.Database.toObject(message.databases[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListDatabasesResponse to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.ListDatabasesResponse + * @instance + * @returns {Object.} JSON object + */ + ListDatabasesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDatabasesResponse + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.ListDatabasesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDatabasesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.ListDatabasesResponse"; + }; + + return ListDatabasesResponse; + })(); + + v1.CreateDatabaseRequest = (function() { + + /** + * Properties of a CreateDatabaseRequest. + * @memberof google.spanner.admin.database.v1 + * @interface ICreateDatabaseRequest + * @property {string|null} [parent] CreateDatabaseRequest parent + * @property {string|null} [createStatement] CreateDatabaseRequest createStatement + * @property {Array.|null} [extraStatements] CreateDatabaseRequest extraStatements + * @property {google.spanner.admin.database.v1.IEncryptionConfig|null} [encryptionConfig] CreateDatabaseRequest encryptionConfig + * @property {google.spanner.admin.database.v1.DatabaseDialect|null} [databaseDialect] CreateDatabaseRequest databaseDialect + * @property {Uint8Array|null} [protoDescriptors] CreateDatabaseRequest protoDescriptors + */ + + /** + * Constructs a new CreateDatabaseRequest. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents a CreateDatabaseRequest. + * @implements ICreateDatabaseRequest + * @constructor + * @param {google.spanner.admin.database.v1.ICreateDatabaseRequest=} [properties] Properties to set + */ + function CreateDatabaseRequest(properties) { + this.extraStatements = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateDatabaseRequest parent. + * @member {string} parent + * @memberof google.spanner.admin.database.v1.CreateDatabaseRequest + * @instance + */ + CreateDatabaseRequest.prototype.parent = ""; + + /** + * CreateDatabaseRequest createStatement. + * @member {string} createStatement + * @memberof google.spanner.admin.database.v1.CreateDatabaseRequest + * @instance + */ + CreateDatabaseRequest.prototype.createStatement = ""; + + /** + * CreateDatabaseRequest extraStatements. + * @member {Array.} extraStatements + * @memberof google.spanner.admin.database.v1.CreateDatabaseRequest + * @instance + */ + CreateDatabaseRequest.prototype.extraStatements = $util.emptyArray; + + /** + * CreateDatabaseRequest encryptionConfig. + * @member {google.spanner.admin.database.v1.IEncryptionConfig|null|undefined} encryptionConfig + * @memberof google.spanner.admin.database.v1.CreateDatabaseRequest + * @instance + */ + CreateDatabaseRequest.prototype.encryptionConfig = null; + + /** + * CreateDatabaseRequest databaseDialect. + * @member {google.spanner.admin.database.v1.DatabaseDialect} databaseDialect + * @memberof google.spanner.admin.database.v1.CreateDatabaseRequest + * @instance + */ + CreateDatabaseRequest.prototype.databaseDialect = 0; + + /** + * CreateDatabaseRequest protoDescriptors. + * @member {Uint8Array} protoDescriptors + * @memberof google.spanner.admin.database.v1.CreateDatabaseRequest + * @instance + */ + CreateDatabaseRequest.prototype.protoDescriptors = $util.newBuffer([]); + + /** + * Creates a new CreateDatabaseRequest instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.CreateDatabaseRequest + * @static + * @param {google.spanner.admin.database.v1.ICreateDatabaseRequest=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.CreateDatabaseRequest} CreateDatabaseRequest instance + */ + CreateDatabaseRequest.create = function create(properties) { + return new CreateDatabaseRequest(properties); + }; + + /** + * Encodes the specified CreateDatabaseRequest message. Does not implicitly {@link google.spanner.admin.database.v1.CreateDatabaseRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.CreateDatabaseRequest + * @static + * @param {google.spanner.admin.database.v1.ICreateDatabaseRequest} message CreateDatabaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateDatabaseRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.createStatement != null && Object.hasOwnProperty.call(message, "createStatement")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.createStatement); + if (message.extraStatements != null && message.extraStatements.length) + for (var i = 0; i < message.extraStatements.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.extraStatements[i]); + if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) + $root.google.spanner.admin.database.v1.EncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.databaseDialect != null && Object.hasOwnProperty.call(message, "databaseDialect")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.databaseDialect); + if (message.protoDescriptors != null && Object.hasOwnProperty.call(message, "protoDescriptors")) + writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.protoDescriptors); + return writer; + }; + + /** + * Encodes the specified CreateDatabaseRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.CreateDatabaseRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.CreateDatabaseRequest + * @static + * @param {google.spanner.admin.database.v1.ICreateDatabaseRequest} message CreateDatabaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateDatabaseRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateDatabaseRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.CreateDatabaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.CreateDatabaseRequest} CreateDatabaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateDatabaseRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.CreateDatabaseRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.createStatement = reader.string(); + break; + } + case 3: { + if (!(message.extraStatements && message.extraStatements.length)) + message.extraStatements = []; + message.extraStatements.push(reader.string()); + break; + } + case 4: { + message.encryptionConfig = $root.google.spanner.admin.database.v1.EncryptionConfig.decode(reader, reader.uint32()); + break; + } + case 5: { + message.databaseDialect = reader.int32(); + break; + } + case 6: { + message.protoDescriptors = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateDatabaseRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.CreateDatabaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.CreateDatabaseRequest} CreateDatabaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateDatabaseRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateDatabaseRequest message. + * @function verify + * @memberof google.spanner.admin.database.v1.CreateDatabaseRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateDatabaseRequest.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.createStatement != null && message.hasOwnProperty("createStatement")) + if (!$util.isString(message.createStatement)) + return "createStatement: string expected"; + if (message.extraStatements != null && message.hasOwnProperty("extraStatements")) { + if (!Array.isArray(message.extraStatements)) + return "extraStatements: array expected"; + for (var i = 0; i < message.extraStatements.length; ++i) + if (!$util.isString(message.extraStatements[i])) + return "extraStatements: string[] expected"; + } + if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { + var error = $root.google.spanner.admin.database.v1.EncryptionConfig.verify(message.encryptionConfig); + if (error) + return "encryptionConfig." + error; + } + if (message.databaseDialect != null && message.hasOwnProperty("databaseDialect")) + switch (message.databaseDialect) { + default: + return "databaseDialect: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.protoDescriptors != null && message.hasOwnProperty("protoDescriptors")) + if (!(message.protoDescriptors && typeof message.protoDescriptors.length === "number" || $util.isString(message.protoDescriptors))) + return "protoDescriptors: buffer expected"; + return null; + }; + + /** + * Creates a CreateDatabaseRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.CreateDatabaseRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.CreateDatabaseRequest} CreateDatabaseRequest + */ + CreateDatabaseRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.CreateDatabaseRequest) + return object; + var message = new $root.google.spanner.admin.database.v1.CreateDatabaseRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.createStatement != null) + message.createStatement = String(object.createStatement); + if (object.extraStatements) { + if (!Array.isArray(object.extraStatements)) + throw TypeError(".google.spanner.admin.database.v1.CreateDatabaseRequest.extraStatements: array expected"); + message.extraStatements = []; + for (var i = 0; i < object.extraStatements.length; ++i) + message.extraStatements[i] = String(object.extraStatements[i]); + } + if (object.encryptionConfig != null) { + if (typeof object.encryptionConfig !== "object") + throw TypeError(".google.spanner.admin.database.v1.CreateDatabaseRequest.encryptionConfig: object expected"); + message.encryptionConfig = $root.google.spanner.admin.database.v1.EncryptionConfig.fromObject(object.encryptionConfig); + } + switch (object.databaseDialect) { + default: + if (typeof object.databaseDialect === "number") { + message.databaseDialect = object.databaseDialect; + break; + } + break; + case "DATABASE_DIALECT_UNSPECIFIED": + case 0: + message.databaseDialect = 0; + break; + case "GOOGLE_STANDARD_SQL": + case 1: + message.databaseDialect = 1; + break; + case "POSTGRESQL": + case 2: + message.databaseDialect = 2; + break; + } + if (object.protoDescriptors != null) + if (typeof object.protoDescriptors === "string") + $util.base64.decode(object.protoDescriptors, message.protoDescriptors = $util.newBuffer($util.base64.length(object.protoDescriptors)), 0); + else if (object.protoDescriptors.length >= 0) + message.protoDescriptors = object.protoDescriptors; + return message; + }; + + /** + * Creates a plain object from a CreateDatabaseRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.CreateDatabaseRequest + * @static + * @param {google.spanner.admin.database.v1.CreateDatabaseRequest} message CreateDatabaseRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateDatabaseRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.extraStatements = []; + if (options.defaults) { + object.parent = ""; + object.createStatement = ""; + object.encryptionConfig = null; + object.databaseDialect = options.enums === String ? "DATABASE_DIALECT_UNSPECIFIED" : 0; + if (options.bytes === String) + object.protoDescriptors = ""; + else { + object.protoDescriptors = []; + if (options.bytes !== Array) + object.protoDescriptors = $util.newBuffer(object.protoDescriptors); + } + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.createStatement != null && message.hasOwnProperty("createStatement")) + object.createStatement = message.createStatement; + if (message.extraStatements && message.extraStatements.length) { + object.extraStatements = []; + for (var j = 0; j < message.extraStatements.length; ++j) + object.extraStatements[j] = message.extraStatements[j]; + } + if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) + object.encryptionConfig = $root.google.spanner.admin.database.v1.EncryptionConfig.toObject(message.encryptionConfig, options); + if (message.databaseDialect != null && message.hasOwnProperty("databaseDialect")) + object.databaseDialect = options.enums === String ? $root.google.spanner.admin.database.v1.DatabaseDialect[message.databaseDialect] === undefined ? message.databaseDialect : $root.google.spanner.admin.database.v1.DatabaseDialect[message.databaseDialect] : message.databaseDialect; + if (message.protoDescriptors != null && message.hasOwnProperty("protoDescriptors")) + object.protoDescriptors = options.bytes === String ? $util.base64.encode(message.protoDescriptors, 0, message.protoDescriptors.length) : options.bytes === Array ? Array.prototype.slice.call(message.protoDescriptors) : message.protoDescriptors; + return object; + }; + + /** + * Converts this CreateDatabaseRequest to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.CreateDatabaseRequest + * @instance + * @returns {Object.} JSON object + */ + CreateDatabaseRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateDatabaseRequest + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.CreateDatabaseRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateDatabaseRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.CreateDatabaseRequest"; + }; + + return CreateDatabaseRequest; + })(); + + v1.CreateDatabaseMetadata = (function() { + + /** + * Properties of a CreateDatabaseMetadata. + * @memberof google.spanner.admin.database.v1 + * @interface ICreateDatabaseMetadata + * @property {string|null} [database] CreateDatabaseMetadata database + */ + + /** + * Constructs a new CreateDatabaseMetadata. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents a CreateDatabaseMetadata. + * @implements ICreateDatabaseMetadata + * @constructor + * @param {google.spanner.admin.database.v1.ICreateDatabaseMetadata=} [properties] Properties to set + */ + function CreateDatabaseMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateDatabaseMetadata database. + * @member {string} database + * @memberof google.spanner.admin.database.v1.CreateDatabaseMetadata + * @instance + */ + CreateDatabaseMetadata.prototype.database = ""; + + /** + * Creates a new CreateDatabaseMetadata instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.CreateDatabaseMetadata + * @static + * @param {google.spanner.admin.database.v1.ICreateDatabaseMetadata=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.CreateDatabaseMetadata} CreateDatabaseMetadata instance + */ + CreateDatabaseMetadata.create = function create(properties) { + return new CreateDatabaseMetadata(properties); + }; + + /** + * Encodes the specified CreateDatabaseMetadata message. Does not implicitly {@link google.spanner.admin.database.v1.CreateDatabaseMetadata.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.CreateDatabaseMetadata + * @static + * @param {google.spanner.admin.database.v1.ICreateDatabaseMetadata} message CreateDatabaseMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateDatabaseMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.database != null && Object.hasOwnProperty.call(message, "database")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.database); + return writer; + }; + + /** + * Encodes the specified CreateDatabaseMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.CreateDatabaseMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.CreateDatabaseMetadata + * @static + * @param {google.spanner.admin.database.v1.ICreateDatabaseMetadata} message CreateDatabaseMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateDatabaseMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateDatabaseMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.CreateDatabaseMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.CreateDatabaseMetadata} CreateDatabaseMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateDatabaseMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.CreateDatabaseMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.database = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateDatabaseMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.CreateDatabaseMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.CreateDatabaseMetadata} CreateDatabaseMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateDatabaseMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateDatabaseMetadata message. + * @function verify + * @memberof google.spanner.admin.database.v1.CreateDatabaseMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateDatabaseMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.database != null && message.hasOwnProperty("database")) + if (!$util.isString(message.database)) + return "database: string expected"; + return null; + }; + + /** + * Creates a CreateDatabaseMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.CreateDatabaseMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.CreateDatabaseMetadata} CreateDatabaseMetadata + */ + CreateDatabaseMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.CreateDatabaseMetadata) + return object; + var message = new $root.google.spanner.admin.database.v1.CreateDatabaseMetadata(); + if (object.database != null) + message.database = String(object.database); + return message; + }; + + /** + * Creates a plain object from a CreateDatabaseMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.CreateDatabaseMetadata + * @static + * @param {google.spanner.admin.database.v1.CreateDatabaseMetadata} message CreateDatabaseMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateDatabaseMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.database = ""; + if (message.database != null && message.hasOwnProperty("database")) + object.database = message.database; + return object; + }; + + /** + * Converts this CreateDatabaseMetadata to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.CreateDatabaseMetadata + * @instance + * @returns {Object.} JSON object + */ + CreateDatabaseMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateDatabaseMetadata + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.CreateDatabaseMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateDatabaseMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.CreateDatabaseMetadata"; + }; + + return CreateDatabaseMetadata; + })(); + + v1.GetDatabaseRequest = (function() { + + /** + * Properties of a GetDatabaseRequest. + * @memberof google.spanner.admin.database.v1 + * @interface IGetDatabaseRequest + * @property {string|null} [name] GetDatabaseRequest name + */ + + /** + * Constructs a new GetDatabaseRequest. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents a GetDatabaseRequest. + * @implements IGetDatabaseRequest + * @constructor + * @param {google.spanner.admin.database.v1.IGetDatabaseRequest=} [properties] Properties to set + */ + function GetDatabaseRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetDatabaseRequest name. + * @member {string} name + * @memberof google.spanner.admin.database.v1.GetDatabaseRequest + * @instance + */ + GetDatabaseRequest.prototype.name = ""; + + /** + * Creates a new GetDatabaseRequest instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.GetDatabaseRequest + * @static + * @param {google.spanner.admin.database.v1.IGetDatabaseRequest=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.GetDatabaseRequest} GetDatabaseRequest instance + */ + GetDatabaseRequest.create = function create(properties) { + return new GetDatabaseRequest(properties); + }; + + /** + * Encodes the specified GetDatabaseRequest message. Does not implicitly {@link google.spanner.admin.database.v1.GetDatabaseRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.GetDatabaseRequest + * @static + * @param {google.spanner.admin.database.v1.IGetDatabaseRequest} message GetDatabaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDatabaseRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetDatabaseRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.GetDatabaseRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.GetDatabaseRequest + * @static + * @param {google.spanner.admin.database.v1.IGetDatabaseRequest} message GetDatabaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDatabaseRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDatabaseRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.GetDatabaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.GetDatabaseRequest} GetDatabaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDatabaseRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.GetDatabaseRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetDatabaseRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.GetDatabaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.GetDatabaseRequest} GetDatabaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDatabaseRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDatabaseRequest message. + * @function verify + * @memberof google.spanner.admin.database.v1.GetDatabaseRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDatabaseRequest.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 GetDatabaseRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.GetDatabaseRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.GetDatabaseRequest} GetDatabaseRequest + */ + GetDatabaseRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.GetDatabaseRequest) + return object; + var message = new $root.google.spanner.admin.database.v1.GetDatabaseRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetDatabaseRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.GetDatabaseRequest + * @static + * @param {google.spanner.admin.database.v1.GetDatabaseRequest} message GetDatabaseRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDatabaseRequest.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 GetDatabaseRequest to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.GetDatabaseRequest + * @instance + * @returns {Object.} JSON object + */ + GetDatabaseRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetDatabaseRequest + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.GetDatabaseRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetDatabaseRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.GetDatabaseRequest"; + }; + + return GetDatabaseRequest; + })(); + + v1.UpdateDatabaseRequest = (function() { + + /** + * Properties of an UpdateDatabaseRequest. + * @memberof google.spanner.admin.database.v1 + * @interface IUpdateDatabaseRequest + * @property {google.spanner.admin.database.v1.IDatabase|null} [database] UpdateDatabaseRequest database + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateDatabaseRequest updateMask + */ + + /** + * Constructs a new UpdateDatabaseRequest. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents an UpdateDatabaseRequest. + * @implements IUpdateDatabaseRequest + * @constructor + * @param {google.spanner.admin.database.v1.IUpdateDatabaseRequest=} [properties] Properties to set + */ + function UpdateDatabaseRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateDatabaseRequest database. + * @member {google.spanner.admin.database.v1.IDatabase|null|undefined} database + * @memberof google.spanner.admin.database.v1.UpdateDatabaseRequest + * @instance + */ + UpdateDatabaseRequest.prototype.database = null; + + /** + * UpdateDatabaseRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.spanner.admin.database.v1.UpdateDatabaseRequest + * @instance + */ + UpdateDatabaseRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateDatabaseRequest instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.UpdateDatabaseRequest + * @static + * @param {google.spanner.admin.database.v1.IUpdateDatabaseRequest=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.UpdateDatabaseRequest} UpdateDatabaseRequest instance + */ + UpdateDatabaseRequest.create = function create(properties) { + return new UpdateDatabaseRequest(properties); + }; + + /** + * Encodes the specified UpdateDatabaseRequest message. Does not implicitly {@link google.spanner.admin.database.v1.UpdateDatabaseRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.UpdateDatabaseRequest + * @static + * @param {google.spanner.admin.database.v1.IUpdateDatabaseRequest} message UpdateDatabaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDatabaseRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.database != null && Object.hasOwnProperty.call(message, "database")) + $root.google.spanner.admin.database.v1.Database.encode(message.database, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateDatabaseRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.UpdateDatabaseRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.UpdateDatabaseRequest + * @static + * @param {google.spanner.admin.database.v1.IUpdateDatabaseRequest} message UpdateDatabaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDatabaseRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateDatabaseRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.UpdateDatabaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.UpdateDatabaseRequest} UpdateDatabaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDatabaseRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.UpdateDatabaseRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.database = $root.google.spanner.admin.database.v1.Database.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateDatabaseRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.UpdateDatabaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.UpdateDatabaseRequest} UpdateDatabaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDatabaseRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateDatabaseRequest message. + * @function verify + * @memberof google.spanner.admin.database.v1.UpdateDatabaseRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateDatabaseRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.database != null && message.hasOwnProperty("database")) { + var error = $root.google.spanner.admin.database.v1.Database.verify(message.database); + if (error) + return "database." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateDatabaseRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.UpdateDatabaseRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.UpdateDatabaseRequest} UpdateDatabaseRequest + */ + UpdateDatabaseRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.UpdateDatabaseRequest) + return object; + var message = new $root.google.spanner.admin.database.v1.UpdateDatabaseRequest(); + if (object.database != null) { + if (typeof object.database !== "object") + throw TypeError(".google.spanner.admin.database.v1.UpdateDatabaseRequest.database: object expected"); + message.database = $root.google.spanner.admin.database.v1.Database.fromObject(object.database); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.spanner.admin.database.v1.UpdateDatabaseRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateDatabaseRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.UpdateDatabaseRequest + * @static + * @param {google.spanner.admin.database.v1.UpdateDatabaseRequest} message UpdateDatabaseRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateDatabaseRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.database = null; + object.updateMask = null; + } + if (message.database != null && message.hasOwnProperty("database")) + object.database = $root.google.spanner.admin.database.v1.Database.toObject(message.database, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateDatabaseRequest to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.UpdateDatabaseRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateDatabaseRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateDatabaseRequest + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.UpdateDatabaseRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateDatabaseRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.UpdateDatabaseRequest"; + }; + + return UpdateDatabaseRequest; + })(); + + v1.UpdateDatabaseMetadata = (function() { + + /** + * Properties of an UpdateDatabaseMetadata. + * @memberof google.spanner.admin.database.v1 + * @interface IUpdateDatabaseMetadata + * @property {google.spanner.admin.database.v1.IUpdateDatabaseRequest|null} [request] UpdateDatabaseMetadata request + * @property {google.spanner.admin.database.v1.IOperationProgress|null} [progress] UpdateDatabaseMetadata progress + * @property {google.protobuf.ITimestamp|null} [cancelTime] UpdateDatabaseMetadata cancelTime + */ + + /** + * Constructs a new UpdateDatabaseMetadata. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents an UpdateDatabaseMetadata. + * @implements IUpdateDatabaseMetadata + * @constructor + * @param {google.spanner.admin.database.v1.IUpdateDatabaseMetadata=} [properties] Properties to set + */ + function UpdateDatabaseMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateDatabaseMetadata request. + * @member {google.spanner.admin.database.v1.IUpdateDatabaseRequest|null|undefined} request + * @memberof google.spanner.admin.database.v1.UpdateDatabaseMetadata + * @instance + */ + UpdateDatabaseMetadata.prototype.request = null; + + /** + * UpdateDatabaseMetadata progress. + * @member {google.spanner.admin.database.v1.IOperationProgress|null|undefined} progress + * @memberof google.spanner.admin.database.v1.UpdateDatabaseMetadata + * @instance + */ + UpdateDatabaseMetadata.prototype.progress = null; + + /** + * UpdateDatabaseMetadata cancelTime. + * @member {google.protobuf.ITimestamp|null|undefined} cancelTime + * @memberof google.spanner.admin.database.v1.UpdateDatabaseMetadata + * @instance + */ + UpdateDatabaseMetadata.prototype.cancelTime = null; + + /** + * Creates a new UpdateDatabaseMetadata instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.UpdateDatabaseMetadata + * @static + * @param {google.spanner.admin.database.v1.IUpdateDatabaseMetadata=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.UpdateDatabaseMetadata} UpdateDatabaseMetadata instance + */ + UpdateDatabaseMetadata.create = function create(properties) { + return new UpdateDatabaseMetadata(properties); + }; + + /** + * Encodes the specified UpdateDatabaseMetadata message. Does not implicitly {@link google.spanner.admin.database.v1.UpdateDatabaseMetadata.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.UpdateDatabaseMetadata + * @static + * @param {google.spanner.admin.database.v1.IUpdateDatabaseMetadata} message UpdateDatabaseMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDatabaseMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.request != null && Object.hasOwnProperty.call(message, "request")) + $root.google.spanner.admin.database.v1.UpdateDatabaseRequest.encode(message.request, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.progress != null && Object.hasOwnProperty.call(message, "progress")) + $root.google.spanner.admin.database.v1.OperationProgress.encode(message.progress, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.cancelTime != null && Object.hasOwnProperty.call(message, "cancelTime")) + $root.google.protobuf.Timestamp.encode(message.cancelTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateDatabaseMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.UpdateDatabaseMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.UpdateDatabaseMetadata + * @static + * @param {google.spanner.admin.database.v1.IUpdateDatabaseMetadata} message UpdateDatabaseMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDatabaseMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateDatabaseMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.UpdateDatabaseMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.UpdateDatabaseMetadata} UpdateDatabaseMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDatabaseMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.UpdateDatabaseMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.request = $root.google.spanner.admin.database.v1.UpdateDatabaseRequest.decode(reader, reader.uint32()); + break; + } + case 2: { + message.progress = $root.google.spanner.admin.database.v1.OperationProgress.decode(reader, reader.uint32()); + break; + } + case 3: { + message.cancelTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateDatabaseMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.UpdateDatabaseMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.UpdateDatabaseMetadata} UpdateDatabaseMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDatabaseMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateDatabaseMetadata message. + * @function verify + * @memberof google.spanner.admin.database.v1.UpdateDatabaseMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateDatabaseMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.request != null && message.hasOwnProperty("request")) { + var error = $root.google.spanner.admin.database.v1.UpdateDatabaseRequest.verify(message.request); + if (error) + return "request." + error; + } + if (message.progress != null && message.hasOwnProperty("progress")) { + var error = $root.google.spanner.admin.database.v1.OperationProgress.verify(message.progress); + if (error) + return "progress." + error; + } + if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.cancelTime); + if (error) + return "cancelTime." + error; + } + return null; + }; + + /** + * Creates an UpdateDatabaseMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.UpdateDatabaseMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.UpdateDatabaseMetadata} UpdateDatabaseMetadata + */ + UpdateDatabaseMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.UpdateDatabaseMetadata) + return object; + var message = new $root.google.spanner.admin.database.v1.UpdateDatabaseMetadata(); + if (object.request != null) { + if (typeof object.request !== "object") + throw TypeError(".google.spanner.admin.database.v1.UpdateDatabaseMetadata.request: object expected"); + message.request = $root.google.spanner.admin.database.v1.UpdateDatabaseRequest.fromObject(object.request); + } + if (object.progress != null) { + if (typeof object.progress !== "object") + throw TypeError(".google.spanner.admin.database.v1.UpdateDatabaseMetadata.progress: object expected"); + message.progress = $root.google.spanner.admin.database.v1.OperationProgress.fromObject(object.progress); + } + if (object.cancelTime != null) { + if (typeof object.cancelTime !== "object") + throw TypeError(".google.spanner.admin.database.v1.UpdateDatabaseMetadata.cancelTime: object expected"); + message.cancelTime = $root.google.protobuf.Timestamp.fromObject(object.cancelTime); + } + return message; + }; + + /** + * Creates a plain object from an UpdateDatabaseMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.UpdateDatabaseMetadata + * @static + * @param {google.spanner.admin.database.v1.UpdateDatabaseMetadata} message UpdateDatabaseMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateDatabaseMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.request = null; + object.progress = null; + object.cancelTime = null; + } + if (message.request != null && message.hasOwnProperty("request")) + object.request = $root.google.spanner.admin.database.v1.UpdateDatabaseRequest.toObject(message.request, options); + if (message.progress != null && message.hasOwnProperty("progress")) + object.progress = $root.google.spanner.admin.database.v1.OperationProgress.toObject(message.progress, options); + if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) + object.cancelTime = $root.google.protobuf.Timestamp.toObject(message.cancelTime, options); + return object; + }; + + /** + * Converts this UpdateDatabaseMetadata to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.UpdateDatabaseMetadata + * @instance + * @returns {Object.} JSON object + */ + UpdateDatabaseMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateDatabaseMetadata + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.UpdateDatabaseMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateDatabaseMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.UpdateDatabaseMetadata"; + }; + + return UpdateDatabaseMetadata; + })(); + + v1.UpdateDatabaseDdlRequest = (function() { + + /** + * Properties of an UpdateDatabaseDdlRequest. + * @memberof google.spanner.admin.database.v1 + * @interface IUpdateDatabaseDdlRequest + * @property {string|null} [database] UpdateDatabaseDdlRequest database + * @property {Array.|null} [statements] UpdateDatabaseDdlRequest statements + * @property {string|null} [operationId] UpdateDatabaseDdlRequest operationId + * @property {Uint8Array|null} [protoDescriptors] UpdateDatabaseDdlRequest protoDescriptors + * @property {boolean|null} [throughputMode] UpdateDatabaseDdlRequest throughputMode + */ + + /** + * Constructs a new UpdateDatabaseDdlRequest. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents an UpdateDatabaseDdlRequest. + * @implements IUpdateDatabaseDdlRequest + * @constructor + * @param {google.spanner.admin.database.v1.IUpdateDatabaseDdlRequest=} [properties] Properties to set + */ + function UpdateDatabaseDdlRequest(properties) { + this.statements = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateDatabaseDdlRequest database. + * @member {string} database + * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlRequest + * @instance + */ + UpdateDatabaseDdlRequest.prototype.database = ""; + + /** + * UpdateDatabaseDdlRequest statements. + * @member {Array.} statements + * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlRequest + * @instance + */ + UpdateDatabaseDdlRequest.prototype.statements = $util.emptyArray; + + /** + * UpdateDatabaseDdlRequest operationId. + * @member {string} operationId + * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlRequest + * @instance + */ + UpdateDatabaseDdlRequest.prototype.operationId = ""; + + /** + * UpdateDatabaseDdlRequest protoDescriptors. + * @member {Uint8Array} protoDescriptors + * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlRequest + * @instance + */ + UpdateDatabaseDdlRequest.prototype.protoDescriptors = $util.newBuffer([]); + + /** + * UpdateDatabaseDdlRequest throughputMode. + * @member {boolean} throughputMode + * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlRequest + * @instance + */ + UpdateDatabaseDdlRequest.prototype.throughputMode = false; + + /** + * Creates a new UpdateDatabaseDdlRequest instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlRequest + * @static + * @param {google.spanner.admin.database.v1.IUpdateDatabaseDdlRequest=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.UpdateDatabaseDdlRequest} UpdateDatabaseDdlRequest instance + */ + UpdateDatabaseDdlRequest.create = function create(properties) { + return new UpdateDatabaseDdlRequest(properties); + }; + + /** + * Encodes the specified UpdateDatabaseDdlRequest message. Does not implicitly {@link google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlRequest + * @static + * @param {google.spanner.admin.database.v1.IUpdateDatabaseDdlRequest} message UpdateDatabaseDdlRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDatabaseDdlRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.database != null && Object.hasOwnProperty.call(message, "database")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.database); + if (message.statements != null && message.statements.length) + for (var i = 0; i < message.statements.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.statements[i]); + if (message.operationId != null && Object.hasOwnProperty.call(message, "operationId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.operationId); + if (message.protoDescriptors != null && Object.hasOwnProperty.call(message, "protoDescriptors")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.protoDescriptors); + if (message.throughputMode != null && Object.hasOwnProperty.call(message, "throughputMode")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.throughputMode); + return writer; + }; + + /** + * Encodes the specified UpdateDatabaseDdlRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlRequest + * @static + * @param {google.spanner.admin.database.v1.IUpdateDatabaseDdlRequest} message UpdateDatabaseDdlRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDatabaseDdlRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateDatabaseDdlRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.UpdateDatabaseDdlRequest} UpdateDatabaseDdlRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDatabaseDdlRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.UpdateDatabaseDdlRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.database = reader.string(); + break; + } + case 2: { + if (!(message.statements && message.statements.length)) + message.statements = []; + message.statements.push(reader.string()); + break; + } + case 3: { + message.operationId = reader.string(); + break; + } + case 4: { + message.protoDescriptors = reader.bytes(); + break; + } + case 5: { + message.throughputMode = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateDatabaseDdlRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.UpdateDatabaseDdlRequest} UpdateDatabaseDdlRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDatabaseDdlRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateDatabaseDdlRequest message. + * @function verify + * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateDatabaseDdlRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.database != null && message.hasOwnProperty("database")) + if (!$util.isString(message.database)) + return "database: string expected"; + if (message.statements != null && message.hasOwnProperty("statements")) { + if (!Array.isArray(message.statements)) + return "statements: array expected"; + for (var i = 0; i < message.statements.length; ++i) + if (!$util.isString(message.statements[i])) + return "statements: string[] expected"; + } + if (message.operationId != null && message.hasOwnProperty("operationId")) + if (!$util.isString(message.operationId)) + return "operationId: string expected"; + if (message.protoDescriptors != null && message.hasOwnProperty("protoDescriptors")) + if (!(message.protoDescriptors && typeof message.protoDescriptors.length === "number" || $util.isString(message.protoDescriptors))) + return "protoDescriptors: buffer expected"; + if (message.throughputMode != null && message.hasOwnProperty("throughputMode")) + if (typeof message.throughputMode !== "boolean") + return "throughputMode: boolean expected"; + return null; + }; + + /** + * Creates an UpdateDatabaseDdlRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.UpdateDatabaseDdlRequest} UpdateDatabaseDdlRequest + */ + UpdateDatabaseDdlRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.UpdateDatabaseDdlRequest) + return object; + var message = new $root.google.spanner.admin.database.v1.UpdateDatabaseDdlRequest(); + if (object.database != null) + message.database = String(object.database); + if (object.statements) { + if (!Array.isArray(object.statements)) + throw TypeError(".google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.statements: array expected"); + message.statements = []; + for (var i = 0; i < object.statements.length; ++i) + message.statements[i] = String(object.statements[i]); + } + if (object.operationId != null) + message.operationId = String(object.operationId); + if (object.protoDescriptors != null) + if (typeof object.protoDescriptors === "string") + $util.base64.decode(object.protoDescriptors, message.protoDescriptors = $util.newBuffer($util.base64.length(object.protoDescriptors)), 0); + else if (object.protoDescriptors.length >= 0) + message.protoDescriptors = object.protoDescriptors; + if (object.throughputMode != null) + message.throughputMode = Boolean(object.throughputMode); + return message; + }; + + /** + * Creates a plain object from an UpdateDatabaseDdlRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlRequest + * @static + * @param {google.spanner.admin.database.v1.UpdateDatabaseDdlRequest} message UpdateDatabaseDdlRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateDatabaseDdlRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.statements = []; + if (options.defaults) { + object.database = ""; + object.operationId = ""; + if (options.bytes === String) + object.protoDescriptors = ""; + else { + object.protoDescriptors = []; + if (options.bytes !== Array) + object.protoDescriptors = $util.newBuffer(object.protoDescriptors); + } + object.throughputMode = false; + } + if (message.database != null && message.hasOwnProperty("database")) + object.database = message.database; + if (message.statements && message.statements.length) { + object.statements = []; + for (var j = 0; j < message.statements.length; ++j) + object.statements[j] = message.statements[j]; + } + if (message.operationId != null && message.hasOwnProperty("operationId")) + object.operationId = message.operationId; + if (message.protoDescriptors != null && message.hasOwnProperty("protoDescriptors")) + object.protoDescriptors = options.bytes === String ? $util.base64.encode(message.protoDescriptors, 0, message.protoDescriptors.length) : options.bytes === Array ? Array.prototype.slice.call(message.protoDescriptors) : message.protoDescriptors; + if (message.throughputMode != null && message.hasOwnProperty("throughputMode")) + object.throughputMode = message.throughputMode; + return object; + }; + + /** + * Converts this UpdateDatabaseDdlRequest to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateDatabaseDdlRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateDatabaseDdlRequest + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateDatabaseDdlRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.UpdateDatabaseDdlRequest"; + }; + + return UpdateDatabaseDdlRequest; + })(); + + v1.DdlStatementActionInfo = (function() { + + /** + * Properties of a DdlStatementActionInfo. + * @memberof google.spanner.admin.database.v1 + * @interface IDdlStatementActionInfo + * @property {string|null} [action] DdlStatementActionInfo action + * @property {string|null} [entityType] DdlStatementActionInfo entityType + * @property {Array.|null} [entityNames] DdlStatementActionInfo entityNames + */ + + /** + * Constructs a new DdlStatementActionInfo. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents a DdlStatementActionInfo. + * @implements IDdlStatementActionInfo + * @constructor + * @param {google.spanner.admin.database.v1.IDdlStatementActionInfo=} [properties] Properties to set + */ + function DdlStatementActionInfo(properties) { + this.entityNames = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DdlStatementActionInfo action. + * @member {string} action + * @memberof google.spanner.admin.database.v1.DdlStatementActionInfo + * @instance + */ + DdlStatementActionInfo.prototype.action = ""; + + /** + * DdlStatementActionInfo entityType. + * @member {string} entityType + * @memberof google.spanner.admin.database.v1.DdlStatementActionInfo + * @instance + */ + DdlStatementActionInfo.prototype.entityType = ""; + + /** + * DdlStatementActionInfo entityNames. + * @member {Array.} entityNames + * @memberof google.spanner.admin.database.v1.DdlStatementActionInfo + * @instance + */ + DdlStatementActionInfo.prototype.entityNames = $util.emptyArray; + + /** + * Creates a new DdlStatementActionInfo instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.DdlStatementActionInfo + * @static + * @param {google.spanner.admin.database.v1.IDdlStatementActionInfo=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.DdlStatementActionInfo} DdlStatementActionInfo instance + */ + DdlStatementActionInfo.create = function create(properties) { + return new DdlStatementActionInfo(properties); + }; + + /** + * Encodes the specified DdlStatementActionInfo message. Does not implicitly {@link google.spanner.admin.database.v1.DdlStatementActionInfo.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.DdlStatementActionInfo + * @static + * @param {google.spanner.admin.database.v1.IDdlStatementActionInfo} message DdlStatementActionInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DdlStatementActionInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.action); + if (message.entityType != null && Object.hasOwnProperty.call(message, "entityType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.entityType); + if (message.entityNames != null && message.entityNames.length) + for (var i = 0; i < message.entityNames.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.entityNames[i]); + return writer; + }; + + /** + * Encodes the specified DdlStatementActionInfo message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.DdlStatementActionInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.DdlStatementActionInfo + * @static + * @param {google.spanner.admin.database.v1.IDdlStatementActionInfo} message DdlStatementActionInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DdlStatementActionInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DdlStatementActionInfo message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.DdlStatementActionInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.DdlStatementActionInfo} DdlStatementActionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DdlStatementActionInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.DdlStatementActionInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.action = reader.string(); + break; + } + case 2: { + message.entityType = reader.string(); + break; + } + case 3: { + if (!(message.entityNames && message.entityNames.length)) + message.entityNames = []; + message.entityNames.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DdlStatementActionInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.DdlStatementActionInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.DdlStatementActionInfo} DdlStatementActionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DdlStatementActionInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DdlStatementActionInfo message. + * @function verify + * @memberof google.spanner.admin.database.v1.DdlStatementActionInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DdlStatementActionInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.action != null && message.hasOwnProperty("action")) + if (!$util.isString(message.action)) + return "action: string expected"; + if (message.entityType != null && message.hasOwnProperty("entityType")) + if (!$util.isString(message.entityType)) + return "entityType: string expected"; + if (message.entityNames != null && message.hasOwnProperty("entityNames")) { + if (!Array.isArray(message.entityNames)) + return "entityNames: array expected"; + for (var i = 0; i < message.entityNames.length; ++i) + if (!$util.isString(message.entityNames[i])) + return "entityNames: string[] expected"; + } + return null; + }; + + /** + * Creates a DdlStatementActionInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.DdlStatementActionInfo + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.DdlStatementActionInfo} DdlStatementActionInfo + */ + DdlStatementActionInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.DdlStatementActionInfo) + return object; + var message = new $root.google.spanner.admin.database.v1.DdlStatementActionInfo(); + if (object.action != null) + message.action = String(object.action); + if (object.entityType != null) + message.entityType = String(object.entityType); + if (object.entityNames) { + if (!Array.isArray(object.entityNames)) + throw TypeError(".google.spanner.admin.database.v1.DdlStatementActionInfo.entityNames: array expected"); + message.entityNames = []; + for (var i = 0; i < object.entityNames.length; ++i) + message.entityNames[i] = String(object.entityNames[i]); + } + return message; + }; + + /** + * Creates a plain object from a DdlStatementActionInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.DdlStatementActionInfo + * @static + * @param {google.spanner.admin.database.v1.DdlStatementActionInfo} message DdlStatementActionInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DdlStatementActionInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.entityNames = []; + if (options.defaults) { + object.action = ""; + object.entityType = ""; + } + if (message.action != null && message.hasOwnProperty("action")) + object.action = message.action; + if (message.entityType != null && message.hasOwnProperty("entityType")) + object.entityType = message.entityType; + if (message.entityNames && message.entityNames.length) { + object.entityNames = []; + for (var j = 0; j < message.entityNames.length; ++j) + object.entityNames[j] = message.entityNames[j]; + } + return object; + }; + + /** + * Converts this DdlStatementActionInfo to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.DdlStatementActionInfo + * @instance + * @returns {Object.} JSON object + */ + DdlStatementActionInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DdlStatementActionInfo + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.DdlStatementActionInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DdlStatementActionInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.DdlStatementActionInfo"; + }; + + return DdlStatementActionInfo; + })(); + + v1.UpdateDatabaseDdlMetadata = (function() { + + /** + * Properties of an UpdateDatabaseDdlMetadata. + * @memberof google.spanner.admin.database.v1 + * @interface IUpdateDatabaseDdlMetadata + * @property {string|null} [database] UpdateDatabaseDdlMetadata database + * @property {Array.|null} [statements] UpdateDatabaseDdlMetadata statements + * @property {Array.|null} [commitTimestamps] UpdateDatabaseDdlMetadata commitTimestamps + * @property {boolean|null} [throttled] UpdateDatabaseDdlMetadata throttled + * @property {Array.|null} [progress] UpdateDatabaseDdlMetadata progress + * @property {Array.|null} [actions] UpdateDatabaseDdlMetadata actions + */ + + /** + * Constructs a new UpdateDatabaseDdlMetadata. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents an UpdateDatabaseDdlMetadata. + * @implements IUpdateDatabaseDdlMetadata + * @constructor + * @param {google.spanner.admin.database.v1.IUpdateDatabaseDdlMetadata=} [properties] Properties to set + */ + function UpdateDatabaseDdlMetadata(properties) { + this.statements = []; + this.commitTimestamps = []; + this.progress = []; + this.actions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateDatabaseDdlMetadata database. + * @member {string} database + * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata + * @instance + */ + UpdateDatabaseDdlMetadata.prototype.database = ""; + + /** + * UpdateDatabaseDdlMetadata statements. + * @member {Array.} statements + * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata + * @instance + */ + UpdateDatabaseDdlMetadata.prototype.statements = $util.emptyArray; + + /** + * UpdateDatabaseDdlMetadata commitTimestamps. + * @member {Array.} commitTimestamps + * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata + * @instance + */ + UpdateDatabaseDdlMetadata.prototype.commitTimestamps = $util.emptyArray; + + /** + * UpdateDatabaseDdlMetadata throttled. + * @member {boolean} throttled + * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata + * @instance + */ + UpdateDatabaseDdlMetadata.prototype.throttled = false; + + /** + * UpdateDatabaseDdlMetadata progress. + * @member {Array.} progress + * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata + * @instance + */ + UpdateDatabaseDdlMetadata.prototype.progress = $util.emptyArray; + + /** + * UpdateDatabaseDdlMetadata actions. + * @member {Array.} actions + * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata + * @instance + */ + UpdateDatabaseDdlMetadata.prototype.actions = $util.emptyArray; + + /** + * Creates a new UpdateDatabaseDdlMetadata instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata + * @static + * @param {google.spanner.admin.database.v1.IUpdateDatabaseDdlMetadata=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata} UpdateDatabaseDdlMetadata instance + */ + UpdateDatabaseDdlMetadata.create = function create(properties) { + return new UpdateDatabaseDdlMetadata(properties); + }; + + /** + * Encodes the specified UpdateDatabaseDdlMetadata message. Does not implicitly {@link google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata + * @static + * @param {google.spanner.admin.database.v1.IUpdateDatabaseDdlMetadata} message UpdateDatabaseDdlMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDatabaseDdlMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.database != null && Object.hasOwnProperty.call(message, "database")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.database); + if (message.statements != null && message.statements.length) + for (var i = 0; i < message.statements.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.statements[i]); + if (message.commitTimestamps != null && message.commitTimestamps.length) + for (var i = 0; i < message.commitTimestamps.length; ++i) + $root.google.protobuf.Timestamp.encode(message.commitTimestamps[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.throttled != null && Object.hasOwnProperty.call(message, "throttled")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.throttled); + if (message.progress != null && message.progress.length) + for (var i = 0; i < message.progress.length; ++i) + $root.google.spanner.admin.database.v1.OperationProgress.encode(message.progress[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.actions != null && message.actions.length) + for (var i = 0; i < message.actions.length; ++i) + $root.google.spanner.admin.database.v1.DdlStatementActionInfo.encode(message.actions[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateDatabaseDdlMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata + * @static + * @param {google.spanner.admin.database.v1.IUpdateDatabaseDdlMetadata} message UpdateDatabaseDdlMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDatabaseDdlMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateDatabaseDdlMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata} UpdateDatabaseDdlMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDatabaseDdlMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.database = reader.string(); + break; + } + case 2: { + if (!(message.statements && message.statements.length)) + message.statements = []; + message.statements.push(reader.string()); + break; + } + case 3: { + if (!(message.commitTimestamps && message.commitTimestamps.length)) + message.commitTimestamps = []; + message.commitTimestamps.push($root.google.protobuf.Timestamp.decode(reader, reader.uint32())); + break; + } + case 4: { + message.throttled = reader.bool(); + break; + } + case 5: { + if (!(message.progress && message.progress.length)) + message.progress = []; + message.progress.push($root.google.spanner.admin.database.v1.OperationProgress.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.actions && message.actions.length)) + message.actions = []; + message.actions.push($root.google.spanner.admin.database.v1.DdlStatementActionInfo.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateDatabaseDdlMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata} UpdateDatabaseDdlMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDatabaseDdlMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateDatabaseDdlMetadata message. + * @function verify + * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateDatabaseDdlMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.database != null && message.hasOwnProperty("database")) + if (!$util.isString(message.database)) + return "database: string expected"; + if (message.statements != null && message.hasOwnProperty("statements")) { + if (!Array.isArray(message.statements)) + return "statements: array expected"; + for (var i = 0; i < message.statements.length; ++i) + if (!$util.isString(message.statements[i])) + return "statements: string[] expected"; + } + if (message.commitTimestamps != null && message.hasOwnProperty("commitTimestamps")) { + if (!Array.isArray(message.commitTimestamps)) + return "commitTimestamps: array expected"; + for (var i = 0; i < message.commitTimestamps.length; ++i) { + var error = $root.google.protobuf.Timestamp.verify(message.commitTimestamps[i]); + if (error) + return "commitTimestamps." + error; + } + } + if (message.throttled != null && message.hasOwnProperty("throttled")) + if (typeof message.throttled !== "boolean") + return "throttled: boolean expected"; + if (message.progress != null && message.hasOwnProperty("progress")) { + if (!Array.isArray(message.progress)) + return "progress: array expected"; + for (var i = 0; i < message.progress.length; ++i) { + var error = $root.google.spanner.admin.database.v1.OperationProgress.verify(message.progress[i]); + if (error) + return "progress." + error; + } + } + if (message.actions != null && message.hasOwnProperty("actions")) { + if (!Array.isArray(message.actions)) + return "actions: array expected"; + for (var i = 0; i < message.actions.length; ++i) { + var error = $root.google.spanner.admin.database.v1.DdlStatementActionInfo.verify(message.actions[i]); + if (error) + return "actions." + error; + } + } + return null; + }; + + /** + * Creates an UpdateDatabaseDdlMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata} UpdateDatabaseDdlMetadata + */ + UpdateDatabaseDdlMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata) + return object; + var message = new $root.google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata(); + if (object.database != null) + message.database = String(object.database); + if (object.statements) { + if (!Array.isArray(object.statements)) + throw TypeError(".google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata.statements: array expected"); + message.statements = []; + for (var i = 0; i < object.statements.length; ++i) + message.statements[i] = String(object.statements[i]); + } + if (object.commitTimestamps) { + if (!Array.isArray(object.commitTimestamps)) + throw TypeError(".google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata.commitTimestamps: array expected"); + message.commitTimestamps = []; + for (var i = 0; i < object.commitTimestamps.length; ++i) { + if (typeof object.commitTimestamps[i] !== "object") + throw TypeError(".google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata.commitTimestamps: object expected"); + message.commitTimestamps[i] = $root.google.protobuf.Timestamp.fromObject(object.commitTimestamps[i]); + } + } + if (object.throttled != null) + message.throttled = Boolean(object.throttled); + if (object.progress) { + if (!Array.isArray(object.progress)) + throw TypeError(".google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata.progress: array expected"); + message.progress = []; + for (var i = 0; i < object.progress.length; ++i) { + if (typeof object.progress[i] !== "object") + throw TypeError(".google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata.progress: object expected"); + message.progress[i] = $root.google.spanner.admin.database.v1.OperationProgress.fromObject(object.progress[i]); + } + } + if (object.actions) { + if (!Array.isArray(object.actions)) + throw TypeError(".google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata.actions: array expected"); + message.actions = []; + for (var i = 0; i < object.actions.length; ++i) { + if (typeof object.actions[i] !== "object") + throw TypeError(".google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata.actions: object expected"); + message.actions[i] = $root.google.spanner.admin.database.v1.DdlStatementActionInfo.fromObject(object.actions[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an UpdateDatabaseDdlMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata + * @static + * @param {google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata} message UpdateDatabaseDdlMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateDatabaseDdlMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.statements = []; + object.commitTimestamps = []; + object.progress = []; + object.actions = []; + } + if (options.defaults) { + object.database = ""; + object.throttled = false; + } + if (message.database != null && message.hasOwnProperty("database")) + object.database = message.database; + if (message.statements && message.statements.length) { + object.statements = []; + for (var j = 0; j < message.statements.length; ++j) + object.statements[j] = message.statements[j]; + } + if (message.commitTimestamps && message.commitTimestamps.length) { + object.commitTimestamps = []; + for (var j = 0; j < message.commitTimestamps.length; ++j) + object.commitTimestamps[j] = $root.google.protobuf.Timestamp.toObject(message.commitTimestamps[j], options); + } + if (message.throttled != null && message.hasOwnProperty("throttled")) + object.throttled = message.throttled; + if (message.progress && message.progress.length) { + object.progress = []; + for (var j = 0; j < message.progress.length; ++j) + object.progress[j] = $root.google.spanner.admin.database.v1.OperationProgress.toObject(message.progress[j], options); + } + if (message.actions && message.actions.length) { + object.actions = []; + for (var j = 0; j < message.actions.length; ++j) + object.actions[j] = $root.google.spanner.admin.database.v1.DdlStatementActionInfo.toObject(message.actions[j], options); + } + return object; + }; + + /** + * Converts this UpdateDatabaseDdlMetadata to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata + * @instance + * @returns {Object.} JSON object + */ + UpdateDatabaseDdlMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateDatabaseDdlMetadata + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateDatabaseDdlMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata"; + }; + + return UpdateDatabaseDdlMetadata; + })(); + + v1.DropDatabaseRequest = (function() { + + /** + * Properties of a DropDatabaseRequest. + * @memberof google.spanner.admin.database.v1 + * @interface IDropDatabaseRequest + * @property {string|null} [database] DropDatabaseRequest database + */ + + /** + * Constructs a new DropDatabaseRequest. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents a DropDatabaseRequest. + * @implements IDropDatabaseRequest + * @constructor + * @param {google.spanner.admin.database.v1.IDropDatabaseRequest=} [properties] Properties to set + */ + function DropDatabaseRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DropDatabaseRequest database. + * @member {string} database + * @memberof google.spanner.admin.database.v1.DropDatabaseRequest + * @instance + */ + DropDatabaseRequest.prototype.database = ""; + + /** + * Creates a new DropDatabaseRequest instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.DropDatabaseRequest + * @static + * @param {google.spanner.admin.database.v1.IDropDatabaseRequest=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.DropDatabaseRequest} DropDatabaseRequest instance + */ + DropDatabaseRequest.create = function create(properties) { + return new DropDatabaseRequest(properties); + }; + + /** + * Encodes the specified DropDatabaseRequest message. Does not implicitly {@link google.spanner.admin.database.v1.DropDatabaseRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.DropDatabaseRequest + * @static + * @param {google.spanner.admin.database.v1.IDropDatabaseRequest} message DropDatabaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DropDatabaseRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.database != null && Object.hasOwnProperty.call(message, "database")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.database); + return writer; + }; + + /** + * Encodes the specified DropDatabaseRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.DropDatabaseRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.DropDatabaseRequest + * @static + * @param {google.spanner.admin.database.v1.IDropDatabaseRequest} message DropDatabaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DropDatabaseRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DropDatabaseRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.DropDatabaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.DropDatabaseRequest} DropDatabaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DropDatabaseRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.DropDatabaseRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.database = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DropDatabaseRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.DropDatabaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.DropDatabaseRequest} DropDatabaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DropDatabaseRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DropDatabaseRequest message. + * @function verify + * @memberof google.spanner.admin.database.v1.DropDatabaseRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DropDatabaseRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.database != null && message.hasOwnProperty("database")) + if (!$util.isString(message.database)) + return "database: string expected"; + return null; + }; + + /** + * Creates a DropDatabaseRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.DropDatabaseRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.DropDatabaseRequest} DropDatabaseRequest + */ + DropDatabaseRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.DropDatabaseRequest) + return object; + var message = new $root.google.spanner.admin.database.v1.DropDatabaseRequest(); + if (object.database != null) + message.database = String(object.database); + return message; + }; + + /** + * Creates a plain object from a DropDatabaseRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.DropDatabaseRequest + * @static + * @param {google.spanner.admin.database.v1.DropDatabaseRequest} message DropDatabaseRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DropDatabaseRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.database = ""; + if (message.database != null && message.hasOwnProperty("database")) + object.database = message.database; + return object; + }; + + /** + * Converts this DropDatabaseRequest to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.DropDatabaseRequest + * @instance + * @returns {Object.} JSON object + */ + DropDatabaseRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DropDatabaseRequest + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.DropDatabaseRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DropDatabaseRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.DropDatabaseRequest"; + }; + + return DropDatabaseRequest; + })(); + + v1.GetDatabaseDdlRequest = (function() { + + /** + * Properties of a GetDatabaseDdlRequest. + * @memberof google.spanner.admin.database.v1 + * @interface IGetDatabaseDdlRequest + * @property {string|null} [database] GetDatabaseDdlRequest database + */ + + /** + * Constructs a new GetDatabaseDdlRequest. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents a GetDatabaseDdlRequest. + * @implements IGetDatabaseDdlRequest + * @constructor + * @param {google.spanner.admin.database.v1.IGetDatabaseDdlRequest=} [properties] Properties to set + */ + function GetDatabaseDdlRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetDatabaseDdlRequest database. + * @member {string} database + * @memberof google.spanner.admin.database.v1.GetDatabaseDdlRequest + * @instance + */ + GetDatabaseDdlRequest.prototype.database = ""; + + /** + * Creates a new GetDatabaseDdlRequest instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.GetDatabaseDdlRequest + * @static + * @param {google.spanner.admin.database.v1.IGetDatabaseDdlRequest=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.GetDatabaseDdlRequest} GetDatabaseDdlRequest instance + */ + GetDatabaseDdlRequest.create = function create(properties) { + return new GetDatabaseDdlRequest(properties); + }; + + /** + * Encodes the specified GetDatabaseDdlRequest message. Does not implicitly {@link google.spanner.admin.database.v1.GetDatabaseDdlRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.GetDatabaseDdlRequest + * @static + * @param {google.spanner.admin.database.v1.IGetDatabaseDdlRequest} message GetDatabaseDdlRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDatabaseDdlRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.database != null && Object.hasOwnProperty.call(message, "database")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.database); + return writer; + }; + + /** + * Encodes the specified GetDatabaseDdlRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.GetDatabaseDdlRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.GetDatabaseDdlRequest + * @static + * @param {google.spanner.admin.database.v1.IGetDatabaseDdlRequest} message GetDatabaseDdlRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDatabaseDdlRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDatabaseDdlRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.GetDatabaseDdlRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.GetDatabaseDdlRequest} GetDatabaseDdlRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDatabaseDdlRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.GetDatabaseDdlRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.database = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetDatabaseDdlRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.GetDatabaseDdlRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.GetDatabaseDdlRequest} GetDatabaseDdlRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDatabaseDdlRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDatabaseDdlRequest message. + * @function verify + * @memberof google.spanner.admin.database.v1.GetDatabaseDdlRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDatabaseDdlRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.database != null && message.hasOwnProperty("database")) + if (!$util.isString(message.database)) + return "database: string expected"; + return null; + }; + + /** + * Creates a GetDatabaseDdlRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.GetDatabaseDdlRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.GetDatabaseDdlRequest} GetDatabaseDdlRequest + */ + GetDatabaseDdlRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.GetDatabaseDdlRequest) + return object; + var message = new $root.google.spanner.admin.database.v1.GetDatabaseDdlRequest(); + if (object.database != null) + message.database = String(object.database); + return message; + }; + + /** + * Creates a plain object from a GetDatabaseDdlRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.GetDatabaseDdlRequest + * @static + * @param {google.spanner.admin.database.v1.GetDatabaseDdlRequest} message GetDatabaseDdlRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDatabaseDdlRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.database = ""; + if (message.database != null && message.hasOwnProperty("database")) + object.database = message.database; + return object; + }; + + /** + * Converts this GetDatabaseDdlRequest to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.GetDatabaseDdlRequest + * @instance + * @returns {Object.} JSON object + */ + GetDatabaseDdlRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetDatabaseDdlRequest + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.GetDatabaseDdlRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetDatabaseDdlRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.GetDatabaseDdlRequest"; + }; + + return GetDatabaseDdlRequest; + })(); + + v1.GetDatabaseDdlResponse = (function() { + + /** + * Properties of a GetDatabaseDdlResponse. + * @memberof google.spanner.admin.database.v1 + * @interface IGetDatabaseDdlResponse + * @property {Array.|null} [statements] GetDatabaseDdlResponse statements + * @property {Uint8Array|null} [protoDescriptors] GetDatabaseDdlResponse protoDescriptors + */ + + /** + * Constructs a new GetDatabaseDdlResponse. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents a GetDatabaseDdlResponse. + * @implements IGetDatabaseDdlResponse + * @constructor + * @param {google.spanner.admin.database.v1.IGetDatabaseDdlResponse=} [properties] Properties to set + */ + function GetDatabaseDdlResponse(properties) { + this.statements = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetDatabaseDdlResponse statements. + * @member {Array.} statements + * @memberof google.spanner.admin.database.v1.GetDatabaseDdlResponse + * @instance + */ + GetDatabaseDdlResponse.prototype.statements = $util.emptyArray; + + /** + * GetDatabaseDdlResponse protoDescriptors. + * @member {Uint8Array} protoDescriptors + * @memberof google.spanner.admin.database.v1.GetDatabaseDdlResponse + * @instance + */ + GetDatabaseDdlResponse.prototype.protoDescriptors = $util.newBuffer([]); + + /** + * Creates a new GetDatabaseDdlResponse instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.GetDatabaseDdlResponse + * @static + * @param {google.spanner.admin.database.v1.IGetDatabaseDdlResponse=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.GetDatabaseDdlResponse} GetDatabaseDdlResponse instance + */ + GetDatabaseDdlResponse.create = function create(properties) { + return new GetDatabaseDdlResponse(properties); + }; + + /** + * Encodes the specified GetDatabaseDdlResponse message. Does not implicitly {@link google.spanner.admin.database.v1.GetDatabaseDdlResponse.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.GetDatabaseDdlResponse + * @static + * @param {google.spanner.admin.database.v1.IGetDatabaseDdlResponse} message GetDatabaseDdlResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDatabaseDdlResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.statements != null && message.statements.length) + for (var i = 0; i < message.statements.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.statements[i]); + if (message.protoDescriptors != null && Object.hasOwnProperty.call(message, "protoDescriptors")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.protoDescriptors); + return writer; + }; + + /** + * Encodes the specified GetDatabaseDdlResponse message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.GetDatabaseDdlResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.GetDatabaseDdlResponse + * @static + * @param {google.spanner.admin.database.v1.IGetDatabaseDdlResponse} message GetDatabaseDdlResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDatabaseDdlResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDatabaseDdlResponse message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.GetDatabaseDdlResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.GetDatabaseDdlResponse} GetDatabaseDdlResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDatabaseDdlResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.GetDatabaseDdlResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.statements && message.statements.length)) + message.statements = []; + message.statements.push(reader.string()); + break; + } + case 2: { + message.protoDescriptors = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetDatabaseDdlResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.GetDatabaseDdlResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.GetDatabaseDdlResponse} GetDatabaseDdlResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDatabaseDdlResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDatabaseDdlResponse message. + * @function verify + * @memberof google.spanner.admin.database.v1.GetDatabaseDdlResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDatabaseDdlResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.statements != null && message.hasOwnProperty("statements")) { + if (!Array.isArray(message.statements)) + return "statements: array expected"; + for (var i = 0; i < message.statements.length; ++i) + if (!$util.isString(message.statements[i])) + return "statements: string[] expected"; + } + if (message.protoDescriptors != null && message.hasOwnProperty("protoDescriptors")) + if (!(message.protoDescriptors && typeof message.protoDescriptors.length === "number" || $util.isString(message.protoDescriptors))) + return "protoDescriptors: buffer expected"; + return null; + }; + + /** + * Creates a GetDatabaseDdlResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.GetDatabaseDdlResponse + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.GetDatabaseDdlResponse} GetDatabaseDdlResponse + */ + GetDatabaseDdlResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.GetDatabaseDdlResponse) + return object; + var message = new $root.google.spanner.admin.database.v1.GetDatabaseDdlResponse(); + if (object.statements) { + if (!Array.isArray(object.statements)) + throw TypeError(".google.spanner.admin.database.v1.GetDatabaseDdlResponse.statements: array expected"); + message.statements = []; + for (var i = 0; i < object.statements.length; ++i) + message.statements[i] = String(object.statements[i]); + } + if (object.protoDescriptors != null) + if (typeof object.protoDescriptors === "string") + $util.base64.decode(object.protoDescriptors, message.protoDescriptors = $util.newBuffer($util.base64.length(object.protoDescriptors)), 0); + else if (object.protoDescriptors.length >= 0) + message.protoDescriptors = object.protoDescriptors; + return message; + }; + + /** + * Creates a plain object from a GetDatabaseDdlResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.GetDatabaseDdlResponse + * @static + * @param {google.spanner.admin.database.v1.GetDatabaseDdlResponse} message GetDatabaseDdlResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDatabaseDdlResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.statements = []; + if (options.defaults) + if (options.bytes === String) + object.protoDescriptors = ""; + else { + object.protoDescriptors = []; + if (options.bytes !== Array) + object.protoDescriptors = $util.newBuffer(object.protoDescriptors); + } + if (message.statements && message.statements.length) { + object.statements = []; + for (var j = 0; j < message.statements.length; ++j) + object.statements[j] = message.statements[j]; + } + if (message.protoDescriptors != null && message.hasOwnProperty("protoDescriptors")) + object.protoDescriptors = options.bytes === String ? $util.base64.encode(message.protoDescriptors, 0, message.protoDescriptors.length) : options.bytes === Array ? Array.prototype.slice.call(message.protoDescriptors) : message.protoDescriptors; + return object; + }; + + /** + * Converts this GetDatabaseDdlResponse to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.GetDatabaseDdlResponse + * @instance + * @returns {Object.} JSON object + */ + GetDatabaseDdlResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetDatabaseDdlResponse + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.GetDatabaseDdlResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetDatabaseDdlResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.GetDatabaseDdlResponse"; + }; + + return GetDatabaseDdlResponse; + })(); + + v1.ListDatabaseOperationsRequest = (function() { + + /** + * Properties of a ListDatabaseOperationsRequest. + * @memberof google.spanner.admin.database.v1 + * @interface IListDatabaseOperationsRequest + * @property {string|null} [parent] ListDatabaseOperationsRequest parent + * @property {string|null} [filter] ListDatabaseOperationsRequest filter + * @property {number|null} [pageSize] ListDatabaseOperationsRequest pageSize + * @property {string|null} [pageToken] ListDatabaseOperationsRequest pageToken + */ + + /** + * Constructs a new ListDatabaseOperationsRequest. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents a ListDatabaseOperationsRequest. + * @implements IListDatabaseOperationsRequest + * @constructor + * @param {google.spanner.admin.database.v1.IListDatabaseOperationsRequest=} [properties] Properties to set + */ + function ListDatabaseOperationsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListDatabaseOperationsRequest parent. + * @member {string} parent + * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsRequest + * @instance + */ + ListDatabaseOperationsRequest.prototype.parent = ""; + + /** + * ListDatabaseOperationsRequest filter. + * @member {string} filter + * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsRequest + * @instance + */ + ListDatabaseOperationsRequest.prototype.filter = ""; + + /** + * ListDatabaseOperationsRequest pageSize. + * @member {number} pageSize + * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsRequest + * @instance + */ + ListDatabaseOperationsRequest.prototype.pageSize = 0; + + /** + * ListDatabaseOperationsRequest pageToken. + * @member {string} pageToken + * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsRequest + * @instance + */ + ListDatabaseOperationsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListDatabaseOperationsRequest instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsRequest + * @static + * @param {google.spanner.admin.database.v1.IListDatabaseOperationsRequest=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.ListDatabaseOperationsRequest} ListDatabaseOperationsRequest instance + */ + ListDatabaseOperationsRequest.create = function create(properties) { + return new ListDatabaseOperationsRequest(properties); + }; + + /** + * Encodes the specified ListDatabaseOperationsRequest message. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabaseOperationsRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsRequest + * @static + * @param {google.spanner.admin.database.v1.IListDatabaseOperationsRequest} message ListDatabaseOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDatabaseOperationsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListDatabaseOperationsRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabaseOperationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsRequest + * @static + * @param {google.spanner.admin.database.v1.IListDatabaseOperationsRequest} message ListDatabaseOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDatabaseOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDatabaseOperationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.ListDatabaseOperationsRequest} ListDatabaseOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDatabaseOperationsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.ListDatabaseOperationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.filter = reader.string(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListDatabaseOperationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.ListDatabaseOperationsRequest} ListDatabaseOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDatabaseOperationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDatabaseOperationsRequest message. + * @function verify + * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDatabaseOperationsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.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 ListDatabaseOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.ListDatabaseOperationsRequest} ListDatabaseOperationsRequest + */ + ListDatabaseOperationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.ListDatabaseOperationsRequest) + return object; + var message = new $root.google.spanner.admin.database.v1.ListDatabaseOperationsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListDatabaseOperationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsRequest + * @static + * @param {google.spanner.admin.database.v1.ListDatabaseOperationsRequest} message ListDatabaseOperationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDatabaseOperationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListDatabaseOperationsRequest to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListDatabaseOperationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDatabaseOperationsRequest + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDatabaseOperationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.ListDatabaseOperationsRequest"; + }; + + return ListDatabaseOperationsRequest; + })(); + + v1.ListDatabaseOperationsResponse = (function() { + + /** + * Properties of a ListDatabaseOperationsResponse. + * @memberof google.spanner.admin.database.v1 + * @interface IListDatabaseOperationsResponse + * @property {Array.|null} [operations] ListDatabaseOperationsResponse operations + * @property {string|null} [nextPageToken] ListDatabaseOperationsResponse nextPageToken + */ + + /** + * Constructs a new ListDatabaseOperationsResponse. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents a ListDatabaseOperationsResponse. + * @implements IListDatabaseOperationsResponse + * @constructor + * @param {google.spanner.admin.database.v1.IListDatabaseOperationsResponse=} [properties] Properties to set + */ + function ListDatabaseOperationsResponse(properties) { + this.operations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListDatabaseOperationsResponse operations. + * @member {Array.} operations + * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsResponse + * @instance + */ + ListDatabaseOperationsResponse.prototype.operations = $util.emptyArray; + + /** + * ListDatabaseOperationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsResponse + * @instance + */ + ListDatabaseOperationsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListDatabaseOperationsResponse instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsResponse + * @static + * @param {google.spanner.admin.database.v1.IListDatabaseOperationsResponse=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.ListDatabaseOperationsResponse} ListDatabaseOperationsResponse instance + */ + ListDatabaseOperationsResponse.create = function create(properties) { + return new ListDatabaseOperationsResponse(properties); + }; + + /** + * Encodes the specified ListDatabaseOperationsResponse message. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabaseOperationsResponse.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsResponse + * @static + * @param {google.spanner.admin.database.v1.IListDatabaseOperationsResponse} message ListDatabaseOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDatabaseOperationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.operations != null && message.operations.length) + for (var i = 0; i < message.operations.length; ++i) + $root.google.longrunning.Operation.encode(message.operations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListDatabaseOperationsResponse message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabaseOperationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsResponse + * @static + * @param {google.spanner.admin.database.v1.IListDatabaseOperationsResponse} message ListDatabaseOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDatabaseOperationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDatabaseOperationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.ListDatabaseOperationsResponse} ListDatabaseOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDatabaseOperationsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.ListDatabaseOperationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.operations && message.operations.length)) + message.operations = []; + message.operations.push($root.google.longrunning.Operation.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListDatabaseOperationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.ListDatabaseOperationsResponse} ListDatabaseOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDatabaseOperationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDatabaseOperationsResponse message. + * @function verify + * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDatabaseOperationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.operations != null && message.hasOwnProperty("operations")) { + if (!Array.isArray(message.operations)) + return "operations: array expected"; + for (var i = 0; i < message.operations.length; ++i) { + var error = $root.google.longrunning.Operation.verify(message.operations[i]); + if (error) + return "operations." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListDatabaseOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.ListDatabaseOperationsResponse} ListDatabaseOperationsResponse + */ + ListDatabaseOperationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.ListDatabaseOperationsResponse) + return object; + var message = new $root.google.spanner.admin.database.v1.ListDatabaseOperationsResponse(); + if (object.operations) { + if (!Array.isArray(object.operations)) + throw TypeError(".google.spanner.admin.database.v1.ListDatabaseOperationsResponse.operations: array expected"); + message.operations = []; + for (var i = 0; i < object.operations.length; ++i) { + if (typeof object.operations[i] !== "object") + throw TypeError(".google.spanner.admin.database.v1.ListDatabaseOperationsResponse.operations: object expected"); + message.operations[i] = $root.google.longrunning.Operation.fromObject(object.operations[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListDatabaseOperationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsResponse + * @static + * @param {google.spanner.admin.database.v1.ListDatabaseOperationsResponse} message ListDatabaseOperationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDatabaseOperationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.operations = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.operations && message.operations.length) { + object.operations = []; + for (var j = 0; j < message.operations.length; ++j) + object.operations[j] = $root.google.longrunning.Operation.toObject(message.operations[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListDatabaseOperationsResponse to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsResponse + * @instance + * @returns {Object.} JSON object + */ + ListDatabaseOperationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDatabaseOperationsResponse + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDatabaseOperationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.ListDatabaseOperationsResponse"; + }; + + return ListDatabaseOperationsResponse; + })(); + + v1.RestoreDatabaseRequest = (function() { + + /** + * Properties of a RestoreDatabaseRequest. + * @memberof google.spanner.admin.database.v1 + * @interface IRestoreDatabaseRequest + * @property {string|null} [parent] RestoreDatabaseRequest parent + * @property {string|null} [databaseId] RestoreDatabaseRequest databaseId + * @property {string|null} [backup] RestoreDatabaseRequest backup + * @property {google.spanner.admin.database.v1.IRestoreDatabaseEncryptionConfig|null} [encryptionConfig] RestoreDatabaseRequest encryptionConfig + */ + + /** + * Constructs a new RestoreDatabaseRequest. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents a RestoreDatabaseRequest. + * @implements IRestoreDatabaseRequest + * @constructor + * @param {google.spanner.admin.database.v1.IRestoreDatabaseRequest=} [properties] Properties to set + */ + function RestoreDatabaseRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RestoreDatabaseRequest parent. + * @member {string} parent + * @memberof google.spanner.admin.database.v1.RestoreDatabaseRequest + * @instance + */ + RestoreDatabaseRequest.prototype.parent = ""; + + /** + * RestoreDatabaseRequest databaseId. + * @member {string} databaseId + * @memberof google.spanner.admin.database.v1.RestoreDatabaseRequest + * @instance + */ + RestoreDatabaseRequest.prototype.databaseId = ""; + + /** + * RestoreDatabaseRequest backup. + * @member {string|null|undefined} backup + * @memberof google.spanner.admin.database.v1.RestoreDatabaseRequest + * @instance + */ + RestoreDatabaseRequest.prototype.backup = null; + + /** + * RestoreDatabaseRequest encryptionConfig. + * @member {google.spanner.admin.database.v1.IRestoreDatabaseEncryptionConfig|null|undefined} encryptionConfig + * @memberof google.spanner.admin.database.v1.RestoreDatabaseRequest + * @instance + */ + RestoreDatabaseRequest.prototype.encryptionConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RestoreDatabaseRequest source. + * @member {"backup"|undefined} source + * @memberof google.spanner.admin.database.v1.RestoreDatabaseRequest + * @instance + */ + Object.defineProperty(RestoreDatabaseRequest.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["backup"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RestoreDatabaseRequest instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.RestoreDatabaseRequest + * @static + * @param {google.spanner.admin.database.v1.IRestoreDatabaseRequest=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.RestoreDatabaseRequest} RestoreDatabaseRequest instance + */ + RestoreDatabaseRequest.create = function create(properties) { + return new RestoreDatabaseRequest(properties); + }; + + /** + * Encodes the specified RestoreDatabaseRequest message. Does not implicitly {@link google.spanner.admin.database.v1.RestoreDatabaseRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.RestoreDatabaseRequest + * @static + * @param {google.spanner.admin.database.v1.IRestoreDatabaseRequest} message RestoreDatabaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreDatabaseRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.databaseId != null && Object.hasOwnProperty.call(message, "databaseId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.databaseId); + if (message.backup != null && Object.hasOwnProperty.call(message, "backup")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.backup); + if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) + $root.google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RestoreDatabaseRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.RestoreDatabaseRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.RestoreDatabaseRequest + * @static + * @param {google.spanner.admin.database.v1.IRestoreDatabaseRequest} message RestoreDatabaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreDatabaseRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RestoreDatabaseRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.RestoreDatabaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.RestoreDatabaseRequest} RestoreDatabaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreDatabaseRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.RestoreDatabaseRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.databaseId = reader.string(); + break; + } + case 3: { + message.backup = reader.string(); + break; + } + case 4: { + message.encryptionConfig = $root.google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RestoreDatabaseRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.RestoreDatabaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.RestoreDatabaseRequest} RestoreDatabaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreDatabaseRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RestoreDatabaseRequest message. + * @function verify + * @memberof google.spanner.admin.database.v1.RestoreDatabaseRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RestoreDatabaseRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.databaseId != null && message.hasOwnProperty("databaseId")) + if (!$util.isString(message.databaseId)) + return "databaseId: string expected"; + if (message.backup != null && message.hasOwnProperty("backup")) { + properties.source = 1; + if (!$util.isString(message.backup)) + return "backup: string expected"; + } + if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { + var error = $root.google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.verify(message.encryptionConfig); + if (error) + return "encryptionConfig." + error; + } + return null; + }; + + /** + * Creates a RestoreDatabaseRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.RestoreDatabaseRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.RestoreDatabaseRequest} RestoreDatabaseRequest + */ + RestoreDatabaseRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.RestoreDatabaseRequest) + return object; + var message = new $root.google.spanner.admin.database.v1.RestoreDatabaseRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.databaseId != null) + message.databaseId = String(object.databaseId); + if (object.backup != null) + message.backup = String(object.backup); + if (object.encryptionConfig != null) { + if (typeof object.encryptionConfig !== "object") + throw TypeError(".google.spanner.admin.database.v1.RestoreDatabaseRequest.encryptionConfig: object expected"); + message.encryptionConfig = $root.google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.fromObject(object.encryptionConfig); + } + return message; + }; + + /** + * Creates a plain object from a RestoreDatabaseRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.RestoreDatabaseRequest + * @static + * @param {google.spanner.admin.database.v1.RestoreDatabaseRequest} message RestoreDatabaseRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RestoreDatabaseRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.databaseId = ""; + object.encryptionConfig = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.databaseId != null && message.hasOwnProperty("databaseId")) + object.databaseId = message.databaseId; + if (message.backup != null && message.hasOwnProperty("backup")) { + object.backup = message.backup; + if (options.oneofs) + object.source = "backup"; + } + if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) + object.encryptionConfig = $root.google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.toObject(message.encryptionConfig, options); + return object; + }; + + /** + * Converts this RestoreDatabaseRequest to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.RestoreDatabaseRequest + * @instance + * @returns {Object.} JSON object + */ + RestoreDatabaseRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RestoreDatabaseRequest + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.RestoreDatabaseRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RestoreDatabaseRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.RestoreDatabaseRequest"; + }; + + return RestoreDatabaseRequest; + })(); + + v1.RestoreDatabaseEncryptionConfig = (function() { + + /** + * Properties of a RestoreDatabaseEncryptionConfig. + * @memberof google.spanner.admin.database.v1 + * @interface IRestoreDatabaseEncryptionConfig + * @property {google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.EncryptionType|null} [encryptionType] RestoreDatabaseEncryptionConfig encryptionType + * @property {string|null} [kmsKeyName] RestoreDatabaseEncryptionConfig kmsKeyName + * @property {Array.|null} [kmsKeyNames] RestoreDatabaseEncryptionConfig kmsKeyNames + */ + + /** + * Constructs a new RestoreDatabaseEncryptionConfig. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents a RestoreDatabaseEncryptionConfig. + * @implements IRestoreDatabaseEncryptionConfig + * @constructor + * @param {google.spanner.admin.database.v1.IRestoreDatabaseEncryptionConfig=} [properties] Properties to set + */ + function RestoreDatabaseEncryptionConfig(properties) { + this.kmsKeyNames = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RestoreDatabaseEncryptionConfig encryptionType. + * @member {google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.EncryptionType} encryptionType + * @memberof google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig + * @instance + */ + RestoreDatabaseEncryptionConfig.prototype.encryptionType = 0; + + /** + * RestoreDatabaseEncryptionConfig kmsKeyName. + * @member {string} kmsKeyName + * @memberof google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig + * @instance + */ + RestoreDatabaseEncryptionConfig.prototype.kmsKeyName = ""; + + /** + * RestoreDatabaseEncryptionConfig kmsKeyNames. + * @member {Array.} kmsKeyNames + * @memberof google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig + * @instance + */ + RestoreDatabaseEncryptionConfig.prototype.kmsKeyNames = $util.emptyArray; + + /** + * Creates a new RestoreDatabaseEncryptionConfig instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig + * @static + * @param {google.spanner.admin.database.v1.IRestoreDatabaseEncryptionConfig=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig} RestoreDatabaseEncryptionConfig instance + */ + RestoreDatabaseEncryptionConfig.create = function create(properties) { + return new RestoreDatabaseEncryptionConfig(properties); + }; + + /** + * Encodes the specified RestoreDatabaseEncryptionConfig message. Does not implicitly {@link google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig + * @static + * @param {google.spanner.admin.database.v1.IRestoreDatabaseEncryptionConfig} message RestoreDatabaseEncryptionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreDatabaseEncryptionConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.encryptionType != null && Object.hasOwnProperty.call(message, "encryptionType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.encryptionType); + if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.kmsKeyName); + if (message.kmsKeyNames != null && message.kmsKeyNames.length) + for (var i = 0; i < message.kmsKeyNames.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.kmsKeyNames[i]); + return writer; + }; + + /** + * Encodes the specified RestoreDatabaseEncryptionConfig message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig + * @static + * @param {google.spanner.admin.database.v1.IRestoreDatabaseEncryptionConfig} message RestoreDatabaseEncryptionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreDatabaseEncryptionConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RestoreDatabaseEncryptionConfig message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig} RestoreDatabaseEncryptionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreDatabaseEncryptionConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.encryptionType = reader.int32(); + break; + } + case 2: { + message.kmsKeyName = reader.string(); + break; + } + case 3: { + if (!(message.kmsKeyNames && message.kmsKeyNames.length)) + message.kmsKeyNames = []; + message.kmsKeyNames.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RestoreDatabaseEncryptionConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig} RestoreDatabaseEncryptionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreDatabaseEncryptionConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RestoreDatabaseEncryptionConfig message. + * @function verify + * @memberof google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RestoreDatabaseEncryptionConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.encryptionType != null && message.hasOwnProperty("encryptionType")) + switch (message.encryptionType) { + default: + return "encryptionType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + if (!$util.isString(message.kmsKeyName)) + return "kmsKeyName: string expected"; + if (message.kmsKeyNames != null && message.hasOwnProperty("kmsKeyNames")) { + if (!Array.isArray(message.kmsKeyNames)) + return "kmsKeyNames: array expected"; + for (var i = 0; i < message.kmsKeyNames.length; ++i) + if (!$util.isString(message.kmsKeyNames[i])) + return "kmsKeyNames: string[] expected"; + } + return null; + }; + + /** + * Creates a RestoreDatabaseEncryptionConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig} RestoreDatabaseEncryptionConfig + */ + RestoreDatabaseEncryptionConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig) + return object; + var message = new $root.google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig(); + switch (object.encryptionType) { + default: + if (typeof object.encryptionType === "number") { + message.encryptionType = object.encryptionType; + break; + } + break; + case "ENCRYPTION_TYPE_UNSPECIFIED": + case 0: + message.encryptionType = 0; + break; + case "USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION": + case 1: + message.encryptionType = 1; + break; + case "GOOGLE_DEFAULT_ENCRYPTION": + case 2: + message.encryptionType = 2; + break; + case "CUSTOMER_MANAGED_ENCRYPTION": + case 3: + message.encryptionType = 3; + break; + } + if (object.kmsKeyName != null) + message.kmsKeyName = String(object.kmsKeyName); + if (object.kmsKeyNames) { + if (!Array.isArray(object.kmsKeyNames)) + throw TypeError(".google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.kmsKeyNames: array expected"); + message.kmsKeyNames = []; + for (var i = 0; i < object.kmsKeyNames.length; ++i) + message.kmsKeyNames[i] = String(object.kmsKeyNames[i]); + } + return message; + }; + + /** + * Creates a plain object from a RestoreDatabaseEncryptionConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig + * @static + * @param {google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig} message RestoreDatabaseEncryptionConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RestoreDatabaseEncryptionConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.kmsKeyNames = []; + if (options.defaults) { + object.encryptionType = options.enums === String ? "ENCRYPTION_TYPE_UNSPECIFIED" : 0; + object.kmsKeyName = ""; + } + if (message.encryptionType != null && message.hasOwnProperty("encryptionType")) + object.encryptionType = options.enums === String ? $root.google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.EncryptionType[message.encryptionType] === undefined ? message.encryptionType : $root.google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.EncryptionType[message.encryptionType] : message.encryptionType; + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + object.kmsKeyName = message.kmsKeyName; + if (message.kmsKeyNames && message.kmsKeyNames.length) { + object.kmsKeyNames = []; + for (var j = 0; j < message.kmsKeyNames.length; ++j) + object.kmsKeyNames[j] = message.kmsKeyNames[j]; + } + return object; + }; + + /** + * Converts this RestoreDatabaseEncryptionConfig to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig + * @instance + * @returns {Object.} JSON object + */ + RestoreDatabaseEncryptionConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RestoreDatabaseEncryptionConfig + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RestoreDatabaseEncryptionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig"; + }; + + /** + * EncryptionType enum. + * @name google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.EncryptionType + * @enum {number} + * @property {number} ENCRYPTION_TYPE_UNSPECIFIED=0 ENCRYPTION_TYPE_UNSPECIFIED value + * @property {number} USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION=1 USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION value + * @property {number} GOOGLE_DEFAULT_ENCRYPTION=2 GOOGLE_DEFAULT_ENCRYPTION value + * @property {number} CUSTOMER_MANAGED_ENCRYPTION=3 CUSTOMER_MANAGED_ENCRYPTION value + */ + RestoreDatabaseEncryptionConfig.EncryptionType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENCRYPTION_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION"] = 1; + values[valuesById[2] = "GOOGLE_DEFAULT_ENCRYPTION"] = 2; + values[valuesById[3] = "CUSTOMER_MANAGED_ENCRYPTION"] = 3; + return values; + })(); + + return RestoreDatabaseEncryptionConfig; + })(); + + v1.RestoreDatabaseMetadata = (function() { + + /** + * Properties of a RestoreDatabaseMetadata. + * @memberof google.spanner.admin.database.v1 + * @interface IRestoreDatabaseMetadata + * @property {string|null} [name] RestoreDatabaseMetadata name + * @property {google.spanner.admin.database.v1.RestoreSourceType|null} [sourceType] RestoreDatabaseMetadata sourceType + * @property {google.spanner.admin.database.v1.IBackupInfo|null} [backupInfo] RestoreDatabaseMetadata backupInfo + * @property {google.spanner.admin.database.v1.IOperationProgress|null} [progress] RestoreDatabaseMetadata progress + * @property {google.protobuf.ITimestamp|null} [cancelTime] RestoreDatabaseMetadata cancelTime + * @property {string|null} [optimizeDatabaseOperationName] RestoreDatabaseMetadata optimizeDatabaseOperationName + */ + + /** + * Constructs a new RestoreDatabaseMetadata. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents a RestoreDatabaseMetadata. + * @implements IRestoreDatabaseMetadata + * @constructor + * @param {google.spanner.admin.database.v1.IRestoreDatabaseMetadata=} [properties] Properties to set + */ + function RestoreDatabaseMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RestoreDatabaseMetadata name. + * @member {string} name + * @memberof google.spanner.admin.database.v1.RestoreDatabaseMetadata + * @instance + */ + RestoreDatabaseMetadata.prototype.name = ""; + + /** + * RestoreDatabaseMetadata sourceType. + * @member {google.spanner.admin.database.v1.RestoreSourceType} sourceType + * @memberof google.spanner.admin.database.v1.RestoreDatabaseMetadata + * @instance + */ + RestoreDatabaseMetadata.prototype.sourceType = 0; + + /** + * RestoreDatabaseMetadata backupInfo. + * @member {google.spanner.admin.database.v1.IBackupInfo|null|undefined} backupInfo + * @memberof google.spanner.admin.database.v1.RestoreDatabaseMetadata + * @instance + */ + RestoreDatabaseMetadata.prototype.backupInfo = null; + + /** + * RestoreDatabaseMetadata progress. + * @member {google.spanner.admin.database.v1.IOperationProgress|null|undefined} progress + * @memberof google.spanner.admin.database.v1.RestoreDatabaseMetadata + * @instance + */ + RestoreDatabaseMetadata.prototype.progress = null; + + /** + * RestoreDatabaseMetadata cancelTime. + * @member {google.protobuf.ITimestamp|null|undefined} cancelTime + * @memberof google.spanner.admin.database.v1.RestoreDatabaseMetadata + * @instance + */ + RestoreDatabaseMetadata.prototype.cancelTime = null; + + /** + * RestoreDatabaseMetadata optimizeDatabaseOperationName. + * @member {string} optimizeDatabaseOperationName + * @memberof google.spanner.admin.database.v1.RestoreDatabaseMetadata + * @instance + */ + RestoreDatabaseMetadata.prototype.optimizeDatabaseOperationName = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RestoreDatabaseMetadata sourceInfo. + * @member {"backupInfo"|undefined} sourceInfo + * @memberof google.spanner.admin.database.v1.RestoreDatabaseMetadata + * @instance + */ + Object.defineProperty(RestoreDatabaseMetadata.prototype, "sourceInfo", { + get: $util.oneOfGetter($oneOfFields = ["backupInfo"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RestoreDatabaseMetadata instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.RestoreDatabaseMetadata + * @static + * @param {google.spanner.admin.database.v1.IRestoreDatabaseMetadata=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.RestoreDatabaseMetadata} RestoreDatabaseMetadata instance + */ + RestoreDatabaseMetadata.create = function create(properties) { + return new RestoreDatabaseMetadata(properties); + }; + + /** + * Encodes the specified RestoreDatabaseMetadata message. Does not implicitly {@link google.spanner.admin.database.v1.RestoreDatabaseMetadata.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.RestoreDatabaseMetadata + * @static + * @param {google.spanner.admin.database.v1.IRestoreDatabaseMetadata} message RestoreDatabaseMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreDatabaseMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.sourceType != null && Object.hasOwnProperty.call(message, "sourceType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.sourceType); + if (message.backupInfo != null && Object.hasOwnProperty.call(message, "backupInfo")) + $root.google.spanner.admin.database.v1.BackupInfo.encode(message.backupInfo, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.progress != null && Object.hasOwnProperty.call(message, "progress")) + $root.google.spanner.admin.database.v1.OperationProgress.encode(message.progress, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.cancelTime != null && Object.hasOwnProperty.call(message, "cancelTime")) + $root.google.protobuf.Timestamp.encode(message.cancelTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.optimizeDatabaseOperationName != null && Object.hasOwnProperty.call(message, "optimizeDatabaseOperationName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.optimizeDatabaseOperationName); + return writer; + }; + + /** + * Encodes the specified RestoreDatabaseMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.RestoreDatabaseMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.RestoreDatabaseMetadata + * @static + * @param {google.spanner.admin.database.v1.IRestoreDatabaseMetadata} message RestoreDatabaseMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreDatabaseMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RestoreDatabaseMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.RestoreDatabaseMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.RestoreDatabaseMetadata} RestoreDatabaseMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreDatabaseMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.RestoreDatabaseMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.sourceType = reader.int32(); + break; + } + case 3: { + message.backupInfo = $root.google.spanner.admin.database.v1.BackupInfo.decode(reader, reader.uint32()); + break; + } + case 4: { + message.progress = $root.google.spanner.admin.database.v1.OperationProgress.decode(reader, reader.uint32()); + break; + } + case 5: { + message.cancelTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.optimizeDatabaseOperationName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RestoreDatabaseMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.RestoreDatabaseMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.RestoreDatabaseMetadata} RestoreDatabaseMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreDatabaseMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RestoreDatabaseMetadata message. + * @function verify + * @memberof google.spanner.admin.database.v1.RestoreDatabaseMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RestoreDatabaseMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.sourceType != null && message.hasOwnProperty("sourceType")) + switch (message.sourceType) { + default: + return "sourceType: enum value expected"; + case 0: + case 1: + break; + } + if (message.backupInfo != null && message.hasOwnProperty("backupInfo")) { + properties.sourceInfo = 1; + { + var error = $root.google.spanner.admin.database.v1.BackupInfo.verify(message.backupInfo); + if (error) + return "backupInfo." + error; + } + } + if (message.progress != null && message.hasOwnProperty("progress")) { + var error = $root.google.spanner.admin.database.v1.OperationProgress.verify(message.progress); + if (error) + return "progress." + error; + } + if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.cancelTime); + if (error) + return "cancelTime." + error; + } + if (message.optimizeDatabaseOperationName != null && message.hasOwnProperty("optimizeDatabaseOperationName")) + if (!$util.isString(message.optimizeDatabaseOperationName)) + return "optimizeDatabaseOperationName: string expected"; + return null; + }; + + /** + * Creates a RestoreDatabaseMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.RestoreDatabaseMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.RestoreDatabaseMetadata} RestoreDatabaseMetadata + */ + RestoreDatabaseMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.RestoreDatabaseMetadata) + return object; + var message = new $root.google.spanner.admin.database.v1.RestoreDatabaseMetadata(); + if (object.name != null) + message.name = String(object.name); + switch (object.sourceType) { + default: + if (typeof object.sourceType === "number") { + message.sourceType = object.sourceType; + break; + } + break; + case "TYPE_UNSPECIFIED": + case 0: + message.sourceType = 0; + break; + case "BACKUP": + case 1: + message.sourceType = 1; + break; + } + if (object.backupInfo != null) { + if (typeof object.backupInfo !== "object") + throw TypeError(".google.spanner.admin.database.v1.RestoreDatabaseMetadata.backupInfo: object expected"); + message.backupInfo = $root.google.spanner.admin.database.v1.BackupInfo.fromObject(object.backupInfo); + } + if (object.progress != null) { + if (typeof object.progress !== "object") + throw TypeError(".google.spanner.admin.database.v1.RestoreDatabaseMetadata.progress: object expected"); + message.progress = $root.google.spanner.admin.database.v1.OperationProgress.fromObject(object.progress); + } + if (object.cancelTime != null) { + if (typeof object.cancelTime !== "object") + throw TypeError(".google.spanner.admin.database.v1.RestoreDatabaseMetadata.cancelTime: object expected"); + message.cancelTime = $root.google.protobuf.Timestamp.fromObject(object.cancelTime); + } + if (object.optimizeDatabaseOperationName != null) + message.optimizeDatabaseOperationName = String(object.optimizeDatabaseOperationName); + return message; + }; + + /** + * Creates a plain object from a RestoreDatabaseMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.RestoreDatabaseMetadata + * @static + * @param {google.spanner.admin.database.v1.RestoreDatabaseMetadata} message RestoreDatabaseMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RestoreDatabaseMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.sourceType = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.progress = null; + object.cancelTime = null; + object.optimizeDatabaseOperationName = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.sourceType != null && message.hasOwnProperty("sourceType")) + object.sourceType = options.enums === String ? $root.google.spanner.admin.database.v1.RestoreSourceType[message.sourceType] === undefined ? message.sourceType : $root.google.spanner.admin.database.v1.RestoreSourceType[message.sourceType] : message.sourceType; + if (message.backupInfo != null && message.hasOwnProperty("backupInfo")) { + object.backupInfo = $root.google.spanner.admin.database.v1.BackupInfo.toObject(message.backupInfo, options); + if (options.oneofs) + object.sourceInfo = "backupInfo"; + } + if (message.progress != null && message.hasOwnProperty("progress")) + object.progress = $root.google.spanner.admin.database.v1.OperationProgress.toObject(message.progress, options); + if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) + object.cancelTime = $root.google.protobuf.Timestamp.toObject(message.cancelTime, options); + if (message.optimizeDatabaseOperationName != null && message.hasOwnProperty("optimizeDatabaseOperationName")) + object.optimizeDatabaseOperationName = message.optimizeDatabaseOperationName; + return object; + }; + + /** + * Converts this RestoreDatabaseMetadata to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.RestoreDatabaseMetadata + * @instance + * @returns {Object.} JSON object + */ + RestoreDatabaseMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RestoreDatabaseMetadata + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.RestoreDatabaseMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RestoreDatabaseMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.RestoreDatabaseMetadata"; + }; + + return RestoreDatabaseMetadata; + })(); + + v1.OptimizeRestoredDatabaseMetadata = (function() { + + /** + * Properties of an OptimizeRestoredDatabaseMetadata. + * @memberof google.spanner.admin.database.v1 + * @interface IOptimizeRestoredDatabaseMetadata + * @property {string|null} [name] OptimizeRestoredDatabaseMetadata name + * @property {google.spanner.admin.database.v1.IOperationProgress|null} [progress] OptimizeRestoredDatabaseMetadata progress + */ + + /** + * Constructs a new OptimizeRestoredDatabaseMetadata. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents an OptimizeRestoredDatabaseMetadata. + * @implements IOptimizeRestoredDatabaseMetadata + * @constructor + * @param {google.spanner.admin.database.v1.IOptimizeRestoredDatabaseMetadata=} [properties] Properties to set + */ + function OptimizeRestoredDatabaseMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OptimizeRestoredDatabaseMetadata name. + * @member {string} name + * @memberof google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata + * @instance + */ + OptimizeRestoredDatabaseMetadata.prototype.name = ""; + + /** + * OptimizeRestoredDatabaseMetadata progress. + * @member {google.spanner.admin.database.v1.IOperationProgress|null|undefined} progress + * @memberof google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata + * @instance + */ + OptimizeRestoredDatabaseMetadata.prototype.progress = null; + + /** + * Creates a new OptimizeRestoredDatabaseMetadata instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata + * @static + * @param {google.spanner.admin.database.v1.IOptimizeRestoredDatabaseMetadata=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata} OptimizeRestoredDatabaseMetadata instance + */ + OptimizeRestoredDatabaseMetadata.create = function create(properties) { + return new OptimizeRestoredDatabaseMetadata(properties); + }; + + /** + * Encodes the specified OptimizeRestoredDatabaseMetadata message. Does not implicitly {@link google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata + * @static + * @param {google.spanner.admin.database.v1.IOptimizeRestoredDatabaseMetadata} message OptimizeRestoredDatabaseMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OptimizeRestoredDatabaseMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.progress != null && Object.hasOwnProperty.call(message, "progress")) + $root.google.spanner.admin.database.v1.OperationProgress.encode(message.progress, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OptimizeRestoredDatabaseMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata + * @static + * @param {google.spanner.admin.database.v1.IOptimizeRestoredDatabaseMetadata} message OptimizeRestoredDatabaseMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OptimizeRestoredDatabaseMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OptimizeRestoredDatabaseMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata} OptimizeRestoredDatabaseMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OptimizeRestoredDatabaseMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.progress = $root.google.spanner.admin.database.v1.OperationProgress.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OptimizeRestoredDatabaseMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata} OptimizeRestoredDatabaseMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OptimizeRestoredDatabaseMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OptimizeRestoredDatabaseMetadata message. + * @function verify + * @memberof google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OptimizeRestoredDatabaseMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.progress != null && message.hasOwnProperty("progress")) { + var error = $root.google.spanner.admin.database.v1.OperationProgress.verify(message.progress); + if (error) + return "progress." + error; + } + return null; + }; + + /** + * Creates an OptimizeRestoredDatabaseMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata} OptimizeRestoredDatabaseMetadata + */ + OptimizeRestoredDatabaseMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata) + return object; + var message = new $root.google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata(); + if (object.name != null) + message.name = String(object.name); + if (object.progress != null) { + if (typeof object.progress !== "object") + throw TypeError(".google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata.progress: object expected"); + message.progress = $root.google.spanner.admin.database.v1.OperationProgress.fromObject(object.progress); + } + return message; + }; + + /** + * Creates a plain object from an OptimizeRestoredDatabaseMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata + * @static + * @param {google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata} message OptimizeRestoredDatabaseMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OptimizeRestoredDatabaseMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.progress = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.progress != null && message.hasOwnProperty("progress")) + object.progress = $root.google.spanner.admin.database.v1.OperationProgress.toObject(message.progress, options); + return object; + }; + + /** + * Converts this OptimizeRestoredDatabaseMetadata to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata + * @instance + * @returns {Object.} JSON object + */ + OptimizeRestoredDatabaseMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OptimizeRestoredDatabaseMetadata + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OptimizeRestoredDatabaseMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata"; + }; + + return OptimizeRestoredDatabaseMetadata; + })(); + + /** + * RestoreSourceType enum. + * @name google.spanner.admin.database.v1.RestoreSourceType + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} BACKUP=1 BACKUP value + */ + v1.RestoreSourceType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "BACKUP"] = 1; + return values; + })(); + + v1.DatabaseRole = (function() { + + /** + * Properties of a DatabaseRole. + * @memberof google.spanner.admin.database.v1 + * @interface IDatabaseRole + * @property {string|null} [name] DatabaseRole name + */ + + /** + * Constructs a new DatabaseRole. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents a DatabaseRole. + * @implements IDatabaseRole + * @constructor + * @param {google.spanner.admin.database.v1.IDatabaseRole=} [properties] Properties to set + */ + function DatabaseRole(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DatabaseRole name. + * @member {string} name + * @memberof google.spanner.admin.database.v1.DatabaseRole + * @instance + */ + DatabaseRole.prototype.name = ""; + + /** + * Creates a new DatabaseRole instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.DatabaseRole + * @static + * @param {google.spanner.admin.database.v1.IDatabaseRole=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.DatabaseRole} DatabaseRole instance + */ + DatabaseRole.create = function create(properties) { + return new DatabaseRole(properties); + }; + + /** + * Encodes the specified DatabaseRole message. Does not implicitly {@link google.spanner.admin.database.v1.DatabaseRole.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.DatabaseRole + * @static + * @param {google.spanner.admin.database.v1.IDatabaseRole} message DatabaseRole message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DatabaseRole.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DatabaseRole message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.DatabaseRole.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.DatabaseRole + * @static + * @param {google.spanner.admin.database.v1.IDatabaseRole} message DatabaseRole message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DatabaseRole.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DatabaseRole message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.DatabaseRole + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.DatabaseRole} DatabaseRole + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DatabaseRole.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.DatabaseRole(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DatabaseRole message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.DatabaseRole + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.DatabaseRole} DatabaseRole + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DatabaseRole.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DatabaseRole message. + * @function verify + * @memberof google.spanner.admin.database.v1.DatabaseRole + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DatabaseRole.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 DatabaseRole message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.DatabaseRole + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.DatabaseRole} DatabaseRole + */ + DatabaseRole.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.DatabaseRole) + return object; + var message = new $root.google.spanner.admin.database.v1.DatabaseRole(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DatabaseRole message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.DatabaseRole + * @static + * @param {google.spanner.admin.database.v1.DatabaseRole} message DatabaseRole + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DatabaseRole.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 DatabaseRole to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.DatabaseRole + * @instance + * @returns {Object.} JSON object + */ + DatabaseRole.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DatabaseRole + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.DatabaseRole + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DatabaseRole.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.DatabaseRole"; + }; + + return DatabaseRole; + })(); + + v1.ListDatabaseRolesRequest = (function() { + + /** + * Properties of a ListDatabaseRolesRequest. + * @memberof google.spanner.admin.database.v1 + * @interface IListDatabaseRolesRequest + * @property {string|null} [parent] ListDatabaseRolesRequest parent + * @property {number|null} [pageSize] ListDatabaseRolesRequest pageSize + * @property {string|null} [pageToken] ListDatabaseRolesRequest pageToken + */ + + /** + * Constructs a new ListDatabaseRolesRequest. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents a ListDatabaseRolesRequest. + * @implements IListDatabaseRolesRequest + * @constructor + * @param {google.spanner.admin.database.v1.IListDatabaseRolesRequest=} [properties] Properties to set + */ + function ListDatabaseRolesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListDatabaseRolesRequest parent. + * @member {string} parent + * @memberof google.spanner.admin.database.v1.ListDatabaseRolesRequest + * @instance + */ + ListDatabaseRolesRequest.prototype.parent = ""; + + /** + * ListDatabaseRolesRequest pageSize. + * @member {number} pageSize + * @memberof google.spanner.admin.database.v1.ListDatabaseRolesRequest + * @instance + */ + ListDatabaseRolesRequest.prototype.pageSize = 0; + + /** + * ListDatabaseRolesRequest pageToken. + * @member {string} pageToken + * @memberof google.spanner.admin.database.v1.ListDatabaseRolesRequest + * @instance + */ + ListDatabaseRolesRequest.prototype.pageToken = ""; + + /** + * Creates a new ListDatabaseRolesRequest instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.ListDatabaseRolesRequest + * @static + * @param {google.spanner.admin.database.v1.IListDatabaseRolesRequest=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.ListDatabaseRolesRequest} ListDatabaseRolesRequest instance + */ + ListDatabaseRolesRequest.create = function create(properties) { + return new ListDatabaseRolesRequest(properties); + }; + + /** + * Encodes the specified ListDatabaseRolesRequest message. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabaseRolesRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.ListDatabaseRolesRequest + * @static + * @param {google.spanner.admin.database.v1.IListDatabaseRolesRequest} message ListDatabaseRolesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDatabaseRolesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListDatabaseRolesRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabaseRolesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.ListDatabaseRolesRequest + * @static + * @param {google.spanner.admin.database.v1.IListDatabaseRolesRequest} message ListDatabaseRolesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDatabaseRolesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDatabaseRolesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.ListDatabaseRolesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.ListDatabaseRolesRequest} ListDatabaseRolesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDatabaseRolesRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.ListDatabaseRolesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListDatabaseRolesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.ListDatabaseRolesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.ListDatabaseRolesRequest} ListDatabaseRolesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDatabaseRolesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDatabaseRolesRequest message. + * @function verify + * @memberof google.spanner.admin.database.v1.ListDatabaseRolesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDatabaseRolesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListDatabaseRolesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.ListDatabaseRolesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.ListDatabaseRolesRequest} ListDatabaseRolesRequest + */ + ListDatabaseRolesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.ListDatabaseRolesRequest) + return object; + var message = new $root.google.spanner.admin.database.v1.ListDatabaseRolesRequest(); + 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 ListDatabaseRolesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.ListDatabaseRolesRequest + * @static + * @param {google.spanner.admin.database.v1.ListDatabaseRolesRequest} message ListDatabaseRolesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDatabaseRolesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListDatabaseRolesRequest to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.ListDatabaseRolesRequest + * @instance + * @returns {Object.} JSON object + */ + ListDatabaseRolesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDatabaseRolesRequest + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.ListDatabaseRolesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDatabaseRolesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.ListDatabaseRolesRequest"; + }; + + return ListDatabaseRolesRequest; + })(); + + v1.ListDatabaseRolesResponse = (function() { + + /** + * Properties of a ListDatabaseRolesResponse. + * @memberof google.spanner.admin.database.v1 + * @interface IListDatabaseRolesResponse + * @property {Array.|null} [databaseRoles] ListDatabaseRolesResponse databaseRoles + * @property {string|null} [nextPageToken] ListDatabaseRolesResponse nextPageToken + */ + + /** + * Constructs a new ListDatabaseRolesResponse. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents a ListDatabaseRolesResponse. + * @implements IListDatabaseRolesResponse + * @constructor + * @param {google.spanner.admin.database.v1.IListDatabaseRolesResponse=} [properties] Properties to set + */ + function ListDatabaseRolesResponse(properties) { + this.databaseRoles = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListDatabaseRolesResponse databaseRoles. + * @member {Array.} databaseRoles + * @memberof google.spanner.admin.database.v1.ListDatabaseRolesResponse + * @instance + */ + ListDatabaseRolesResponse.prototype.databaseRoles = $util.emptyArray; + + /** + * ListDatabaseRolesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.spanner.admin.database.v1.ListDatabaseRolesResponse + * @instance + */ + ListDatabaseRolesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListDatabaseRolesResponse instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.ListDatabaseRolesResponse + * @static + * @param {google.spanner.admin.database.v1.IListDatabaseRolesResponse=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.ListDatabaseRolesResponse} ListDatabaseRolesResponse instance + */ + ListDatabaseRolesResponse.create = function create(properties) { + return new ListDatabaseRolesResponse(properties); + }; + + /** + * Encodes the specified ListDatabaseRolesResponse message. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabaseRolesResponse.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.ListDatabaseRolesResponse + * @static + * @param {google.spanner.admin.database.v1.IListDatabaseRolesResponse} message ListDatabaseRolesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDatabaseRolesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.databaseRoles != null && message.databaseRoles.length) + for (var i = 0; i < message.databaseRoles.length; ++i) + $root.google.spanner.admin.database.v1.DatabaseRole.encode(message.databaseRoles[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListDatabaseRolesResponse message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabaseRolesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.ListDatabaseRolesResponse + * @static + * @param {google.spanner.admin.database.v1.IListDatabaseRolesResponse} message ListDatabaseRolesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDatabaseRolesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDatabaseRolesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.ListDatabaseRolesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.ListDatabaseRolesResponse} ListDatabaseRolesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDatabaseRolesResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.ListDatabaseRolesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.databaseRoles && message.databaseRoles.length)) + message.databaseRoles = []; + message.databaseRoles.push($root.google.spanner.admin.database.v1.DatabaseRole.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListDatabaseRolesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.ListDatabaseRolesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.ListDatabaseRolesResponse} ListDatabaseRolesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDatabaseRolesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDatabaseRolesResponse message. + * @function verify + * @memberof google.spanner.admin.database.v1.ListDatabaseRolesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDatabaseRolesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.databaseRoles != null && message.hasOwnProperty("databaseRoles")) { + if (!Array.isArray(message.databaseRoles)) + return "databaseRoles: array expected"; + for (var i = 0; i < message.databaseRoles.length; ++i) { + var error = $root.google.spanner.admin.database.v1.DatabaseRole.verify(message.databaseRoles[i]); + if (error) + return "databaseRoles." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListDatabaseRolesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.ListDatabaseRolesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.ListDatabaseRolesResponse} ListDatabaseRolesResponse + */ + ListDatabaseRolesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.ListDatabaseRolesResponse) + return object; + var message = new $root.google.spanner.admin.database.v1.ListDatabaseRolesResponse(); + if (object.databaseRoles) { + if (!Array.isArray(object.databaseRoles)) + throw TypeError(".google.spanner.admin.database.v1.ListDatabaseRolesResponse.databaseRoles: array expected"); + message.databaseRoles = []; + for (var i = 0; i < object.databaseRoles.length; ++i) { + if (typeof object.databaseRoles[i] !== "object") + throw TypeError(".google.spanner.admin.database.v1.ListDatabaseRolesResponse.databaseRoles: object expected"); + message.databaseRoles[i] = $root.google.spanner.admin.database.v1.DatabaseRole.fromObject(object.databaseRoles[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListDatabaseRolesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.ListDatabaseRolesResponse + * @static + * @param {google.spanner.admin.database.v1.ListDatabaseRolesResponse} message ListDatabaseRolesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDatabaseRolesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.databaseRoles = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.databaseRoles && message.databaseRoles.length) { + object.databaseRoles = []; + for (var j = 0; j < message.databaseRoles.length; ++j) + object.databaseRoles[j] = $root.google.spanner.admin.database.v1.DatabaseRole.toObject(message.databaseRoles[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListDatabaseRolesResponse to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.ListDatabaseRolesResponse + * @instance + * @returns {Object.} JSON object + */ + ListDatabaseRolesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDatabaseRolesResponse + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.ListDatabaseRolesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDatabaseRolesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.ListDatabaseRolesResponse"; + }; + + return ListDatabaseRolesResponse; + })(); + + v1.AddSplitPointsRequest = (function() { + + /** + * Properties of an AddSplitPointsRequest. + * @memberof google.spanner.admin.database.v1 + * @interface IAddSplitPointsRequest + * @property {string|null} [database] AddSplitPointsRequest database + * @property {Array.|null} [splitPoints] AddSplitPointsRequest splitPoints + * @property {string|null} [initiator] AddSplitPointsRequest initiator + */ + + /** + * Constructs a new AddSplitPointsRequest. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents an AddSplitPointsRequest. + * @implements IAddSplitPointsRequest + * @constructor + * @param {google.spanner.admin.database.v1.IAddSplitPointsRequest=} [properties] Properties to set + */ + function AddSplitPointsRequest(properties) { + this.splitPoints = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AddSplitPointsRequest database. + * @member {string} database + * @memberof google.spanner.admin.database.v1.AddSplitPointsRequest + * @instance + */ + AddSplitPointsRequest.prototype.database = ""; + + /** + * AddSplitPointsRequest splitPoints. + * @member {Array.} splitPoints + * @memberof google.spanner.admin.database.v1.AddSplitPointsRequest + * @instance + */ + AddSplitPointsRequest.prototype.splitPoints = $util.emptyArray; + + /** + * AddSplitPointsRequest initiator. + * @member {string} initiator + * @memberof google.spanner.admin.database.v1.AddSplitPointsRequest + * @instance + */ + AddSplitPointsRequest.prototype.initiator = ""; + + /** + * Creates a new AddSplitPointsRequest instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.AddSplitPointsRequest + * @static + * @param {google.spanner.admin.database.v1.IAddSplitPointsRequest=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.AddSplitPointsRequest} AddSplitPointsRequest instance + */ + AddSplitPointsRequest.create = function create(properties) { + return new AddSplitPointsRequest(properties); + }; + + /** + * Encodes the specified AddSplitPointsRequest message. Does not implicitly {@link google.spanner.admin.database.v1.AddSplitPointsRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.AddSplitPointsRequest + * @static + * @param {google.spanner.admin.database.v1.IAddSplitPointsRequest} message AddSplitPointsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AddSplitPointsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.database != null && Object.hasOwnProperty.call(message, "database")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.database); + if (message.splitPoints != null && message.splitPoints.length) + for (var i = 0; i < message.splitPoints.length; ++i) + $root.google.spanner.admin.database.v1.SplitPoints.encode(message.splitPoints[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.initiator != null && Object.hasOwnProperty.call(message, "initiator")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.initiator); + return writer; + }; + + /** + * Encodes the specified AddSplitPointsRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.AddSplitPointsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.AddSplitPointsRequest + * @static + * @param {google.spanner.admin.database.v1.IAddSplitPointsRequest} message AddSplitPointsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AddSplitPointsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AddSplitPointsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.AddSplitPointsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.AddSplitPointsRequest} AddSplitPointsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AddSplitPointsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.AddSplitPointsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.database = reader.string(); + break; + } + case 2: { + if (!(message.splitPoints && message.splitPoints.length)) + message.splitPoints = []; + message.splitPoints.push($root.google.spanner.admin.database.v1.SplitPoints.decode(reader, reader.uint32())); + break; + } + case 3: { + message.initiator = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AddSplitPointsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.AddSplitPointsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.AddSplitPointsRequest} AddSplitPointsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AddSplitPointsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AddSplitPointsRequest message. + * @function verify + * @memberof google.spanner.admin.database.v1.AddSplitPointsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AddSplitPointsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.database != null && message.hasOwnProperty("database")) + if (!$util.isString(message.database)) + return "database: string expected"; + if (message.splitPoints != null && message.hasOwnProperty("splitPoints")) { + if (!Array.isArray(message.splitPoints)) + return "splitPoints: array expected"; + for (var i = 0; i < message.splitPoints.length; ++i) { + var error = $root.google.spanner.admin.database.v1.SplitPoints.verify(message.splitPoints[i]); + if (error) + return "splitPoints." + error; + } + } + if (message.initiator != null && message.hasOwnProperty("initiator")) + if (!$util.isString(message.initiator)) + return "initiator: string expected"; + return null; + }; + + /** + * Creates an AddSplitPointsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.AddSplitPointsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.AddSplitPointsRequest} AddSplitPointsRequest + */ + AddSplitPointsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.AddSplitPointsRequest) + return object; + var message = new $root.google.spanner.admin.database.v1.AddSplitPointsRequest(); + if (object.database != null) + message.database = String(object.database); + if (object.splitPoints) { + if (!Array.isArray(object.splitPoints)) + throw TypeError(".google.spanner.admin.database.v1.AddSplitPointsRequest.splitPoints: array expected"); + message.splitPoints = []; + for (var i = 0; i < object.splitPoints.length; ++i) { + if (typeof object.splitPoints[i] !== "object") + throw TypeError(".google.spanner.admin.database.v1.AddSplitPointsRequest.splitPoints: object expected"); + message.splitPoints[i] = $root.google.spanner.admin.database.v1.SplitPoints.fromObject(object.splitPoints[i]); + } + } + if (object.initiator != null) + message.initiator = String(object.initiator); + return message; + }; + + /** + * Creates a plain object from an AddSplitPointsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.AddSplitPointsRequest + * @static + * @param {google.spanner.admin.database.v1.AddSplitPointsRequest} message AddSplitPointsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AddSplitPointsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.splitPoints = []; + if (options.defaults) { + object.database = ""; + object.initiator = ""; + } + if (message.database != null && message.hasOwnProperty("database")) + object.database = message.database; + if (message.splitPoints && message.splitPoints.length) { + object.splitPoints = []; + for (var j = 0; j < message.splitPoints.length; ++j) + object.splitPoints[j] = $root.google.spanner.admin.database.v1.SplitPoints.toObject(message.splitPoints[j], options); + } + if (message.initiator != null && message.hasOwnProperty("initiator")) + object.initiator = message.initiator; + return object; + }; + + /** + * Converts this AddSplitPointsRequest to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.AddSplitPointsRequest + * @instance + * @returns {Object.} JSON object + */ + AddSplitPointsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AddSplitPointsRequest + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.AddSplitPointsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AddSplitPointsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.AddSplitPointsRequest"; + }; + + return AddSplitPointsRequest; + })(); + + v1.AddSplitPointsResponse = (function() { + + /** + * Properties of an AddSplitPointsResponse. + * @memberof google.spanner.admin.database.v1 + * @interface IAddSplitPointsResponse + */ + + /** + * Constructs a new AddSplitPointsResponse. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents an AddSplitPointsResponse. + * @implements IAddSplitPointsResponse + * @constructor + * @param {google.spanner.admin.database.v1.IAddSplitPointsResponse=} [properties] Properties to set + */ + function AddSplitPointsResponse(properties) { + if (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 AddSplitPointsResponse instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.AddSplitPointsResponse + * @static + * @param {google.spanner.admin.database.v1.IAddSplitPointsResponse=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.AddSplitPointsResponse} AddSplitPointsResponse instance + */ + AddSplitPointsResponse.create = function create(properties) { + return new AddSplitPointsResponse(properties); + }; + + /** + * Encodes the specified AddSplitPointsResponse message. Does not implicitly {@link google.spanner.admin.database.v1.AddSplitPointsResponse.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.AddSplitPointsResponse + * @static + * @param {google.spanner.admin.database.v1.IAddSplitPointsResponse} message AddSplitPointsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AddSplitPointsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified AddSplitPointsResponse message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.AddSplitPointsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.AddSplitPointsResponse + * @static + * @param {google.spanner.admin.database.v1.IAddSplitPointsResponse} message AddSplitPointsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AddSplitPointsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AddSplitPointsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.AddSplitPointsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.AddSplitPointsResponse} AddSplitPointsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AddSplitPointsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.AddSplitPointsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AddSplitPointsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.AddSplitPointsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.AddSplitPointsResponse} AddSplitPointsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AddSplitPointsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AddSplitPointsResponse message. + * @function verify + * @memberof google.spanner.admin.database.v1.AddSplitPointsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AddSplitPointsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an AddSplitPointsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.AddSplitPointsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.AddSplitPointsResponse} AddSplitPointsResponse + */ + AddSplitPointsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.AddSplitPointsResponse) + return object; + return new $root.google.spanner.admin.database.v1.AddSplitPointsResponse(); + }; + + /** + * Creates a plain object from an AddSplitPointsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.AddSplitPointsResponse + * @static + * @param {google.spanner.admin.database.v1.AddSplitPointsResponse} message AddSplitPointsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AddSplitPointsResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this AddSplitPointsResponse to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.AddSplitPointsResponse + * @instance + * @returns {Object.} JSON object + */ + AddSplitPointsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AddSplitPointsResponse + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.AddSplitPointsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AddSplitPointsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.AddSplitPointsResponse"; + }; + + return AddSplitPointsResponse; + })(); + + v1.SplitPoints = (function() { + + /** + * Properties of a SplitPoints. + * @memberof google.spanner.admin.database.v1 + * @interface ISplitPoints + * @property {string|null} [table] SplitPoints table + * @property {string|null} [index] SplitPoints index + * @property {Array.|null} [keys] SplitPoints keys + * @property {google.protobuf.ITimestamp|null} [expireTime] SplitPoints expireTime + */ + + /** + * Constructs a new SplitPoints. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents a SplitPoints. + * @implements ISplitPoints + * @constructor + * @param {google.spanner.admin.database.v1.ISplitPoints=} [properties] Properties to set + */ + function SplitPoints(properties) { + this.keys = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SplitPoints table. + * @member {string} table + * @memberof google.spanner.admin.database.v1.SplitPoints + * @instance + */ + SplitPoints.prototype.table = ""; + + /** + * SplitPoints index. + * @member {string} index + * @memberof google.spanner.admin.database.v1.SplitPoints + * @instance + */ + SplitPoints.prototype.index = ""; + + /** + * SplitPoints keys. + * @member {Array.} keys + * @memberof google.spanner.admin.database.v1.SplitPoints + * @instance + */ + SplitPoints.prototype.keys = $util.emptyArray; + + /** + * SplitPoints expireTime. + * @member {google.protobuf.ITimestamp|null|undefined} expireTime + * @memberof google.spanner.admin.database.v1.SplitPoints + * @instance + */ + SplitPoints.prototype.expireTime = null; + + /** + * Creates a new SplitPoints instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.SplitPoints + * @static + * @param {google.spanner.admin.database.v1.ISplitPoints=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.SplitPoints} SplitPoints instance + */ + SplitPoints.create = function create(properties) { + return new SplitPoints(properties); + }; + + /** + * Encodes the specified SplitPoints message. Does not implicitly {@link google.spanner.admin.database.v1.SplitPoints.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.SplitPoints + * @static + * @param {google.spanner.admin.database.v1.ISplitPoints} message SplitPoints message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SplitPoints.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.table != null && Object.hasOwnProperty.call(message, "table")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.table); + if (message.index != null && Object.hasOwnProperty.call(message, "index")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.index); + if (message.keys != null && message.keys.length) + for (var i = 0; i < message.keys.length; ++i) + $root.google.spanner.admin.database.v1.SplitPoints.Key.encode(message.keys[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) + $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SplitPoints message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.SplitPoints.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.SplitPoints + * @static + * @param {google.spanner.admin.database.v1.ISplitPoints} message SplitPoints message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SplitPoints.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SplitPoints message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.SplitPoints + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.SplitPoints} SplitPoints + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SplitPoints.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.SplitPoints(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.table = reader.string(); + break; + } + case 2: { + message.index = reader.string(); + break; + } + case 3: { + if (!(message.keys && message.keys.length)) + message.keys = []; + message.keys.push($root.google.spanner.admin.database.v1.SplitPoints.Key.decode(reader, reader.uint32())); + break; + } + case 5: { + message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SplitPoints message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.SplitPoints + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.SplitPoints} SplitPoints + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SplitPoints.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SplitPoints message. + * @function verify + * @memberof google.spanner.admin.database.v1.SplitPoints + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SplitPoints.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.table != null && message.hasOwnProperty("table")) + if (!$util.isString(message.table)) + return "table: string expected"; + if (message.index != null && message.hasOwnProperty("index")) + if (!$util.isString(message.index)) + return "index: string expected"; + if (message.keys != null && message.hasOwnProperty("keys")) { + if (!Array.isArray(message.keys)) + return "keys: array expected"; + for (var i = 0; i < message.keys.length; ++i) { + var error = $root.google.spanner.admin.database.v1.SplitPoints.Key.verify(message.keys[i]); + if (error) + return "keys." + error; + } + } + if (message.expireTime != null && message.hasOwnProperty("expireTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.expireTime); + if (error) + return "expireTime." + error; + } + return null; + }; + + /** + * Creates a SplitPoints message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.SplitPoints + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.SplitPoints} SplitPoints + */ + SplitPoints.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.SplitPoints) + return object; + var message = new $root.google.spanner.admin.database.v1.SplitPoints(); + if (object.table != null) + message.table = String(object.table); + if (object.index != null) + message.index = String(object.index); + if (object.keys) { + if (!Array.isArray(object.keys)) + throw TypeError(".google.spanner.admin.database.v1.SplitPoints.keys: array expected"); + message.keys = []; + for (var i = 0; i < object.keys.length; ++i) { + if (typeof object.keys[i] !== "object") + throw TypeError(".google.spanner.admin.database.v1.SplitPoints.keys: object expected"); + message.keys[i] = $root.google.spanner.admin.database.v1.SplitPoints.Key.fromObject(object.keys[i]); + } + } + if (object.expireTime != null) { + if (typeof object.expireTime !== "object") + throw TypeError(".google.spanner.admin.database.v1.SplitPoints.expireTime: object expected"); + message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); + } + return message; + }; + + /** + * Creates a plain object from a SplitPoints message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.SplitPoints + * @static + * @param {google.spanner.admin.database.v1.SplitPoints} message SplitPoints + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SplitPoints.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.keys = []; + if (options.defaults) { + object.table = ""; + object.index = ""; + object.expireTime = null; + } + if (message.table != null && message.hasOwnProperty("table")) + object.table = message.table; + if (message.index != null && message.hasOwnProperty("index")) + object.index = message.index; + if (message.keys && message.keys.length) { + object.keys = []; + for (var j = 0; j < message.keys.length; ++j) + object.keys[j] = $root.google.spanner.admin.database.v1.SplitPoints.Key.toObject(message.keys[j], options); + } + if (message.expireTime != null && message.hasOwnProperty("expireTime")) + object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); + return object; + }; + + /** + * Converts this SplitPoints to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.SplitPoints + * @instance + * @returns {Object.} JSON object + */ + SplitPoints.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SplitPoints + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.SplitPoints + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SplitPoints.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.SplitPoints"; + }; + + SplitPoints.Key = (function() { + + /** + * Properties of a Key. + * @memberof google.spanner.admin.database.v1.SplitPoints + * @interface IKey + * @property {google.protobuf.IListValue|null} [keyParts] Key keyParts + */ + + /** + * Constructs a new Key. + * @memberof google.spanner.admin.database.v1.SplitPoints + * @classdesc Represents a Key. + * @implements IKey + * @constructor + * @param {google.spanner.admin.database.v1.SplitPoints.IKey=} [properties] Properties to set + */ + function Key(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Key keyParts. + * @member {google.protobuf.IListValue|null|undefined} keyParts + * @memberof google.spanner.admin.database.v1.SplitPoints.Key + * @instance + */ + Key.prototype.keyParts = null; + + /** + * Creates a new Key instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.SplitPoints.Key + * @static + * @param {google.spanner.admin.database.v1.SplitPoints.IKey=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.SplitPoints.Key} Key instance + */ + Key.create = function create(properties) { + return new Key(properties); + }; + + /** + * Encodes the specified Key message. Does not implicitly {@link google.spanner.admin.database.v1.SplitPoints.Key.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.SplitPoints.Key + * @static + * @param {google.spanner.admin.database.v1.SplitPoints.IKey} message Key message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Key.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.keyParts != null && Object.hasOwnProperty.call(message, "keyParts")) + $root.google.protobuf.ListValue.encode(message.keyParts, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Key message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.SplitPoints.Key.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.SplitPoints.Key + * @static + * @param {google.spanner.admin.database.v1.SplitPoints.IKey} message Key message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Key.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Key message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.SplitPoints.Key + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.SplitPoints.Key} Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Key.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.SplitPoints.Key(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.keyParts = $root.google.protobuf.ListValue.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Key message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.SplitPoints.Key + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.SplitPoints.Key} Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Key.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Key message. + * @function verify + * @memberof google.spanner.admin.database.v1.SplitPoints.Key + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Key.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.keyParts != null && message.hasOwnProperty("keyParts")) { + var error = $root.google.protobuf.ListValue.verify(message.keyParts); + if (error) + return "keyParts." + error; + } + return null; + }; + + /** + * Creates a Key message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.SplitPoints.Key + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.SplitPoints.Key} Key + */ + Key.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.SplitPoints.Key) + return object; + var message = new $root.google.spanner.admin.database.v1.SplitPoints.Key(); + if (object.keyParts != null) { + if (typeof object.keyParts !== "object") + throw TypeError(".google.spanner.admin.database.v1.SplitPoints.Key.keyParts: object expected"); + message.keyParts = $root.google.protobuf.ListValue.fromObject(object.keyParts); + } + return message; + }; + + /** + * Creates a plain object from a Key message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.SplitPoints.Key + * @static + * @param {google.spanner.admin.database.v1.SplitPoints.Key} message Key + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Key.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.keyParts = null; + if (message.keyParts != null && message.hasOwnProperty("keyParts")) + object.keyParts = $root.google.protobuf.ListValue.toObject(message.keyParts, options); + return object; + }; + + /** + * Converts this Key to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.SplitPoints.Key + * @instance + * @returns {Object.} JSON object + */ + Key.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Key + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.SplitPoints.Key + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Key.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.SplitPoints.Key"; + }; + + return Key; + })(); + + return SplitPoints; + })(); + + v1.InternalUpdateGraphOperationRequest = (function() { + + /** + * Properties of an InternalUpdateGraphOperationRequest. + * @memberof google.spanner.admin.database.v1 + * @interface IInternalUpdateGraphOperationRequest + * @property {string|null} [database] InternalUpdateGraphOperationRequest database + * @property {string|null} [operationId] InternalUpdateGraphOperationRequest operationId + * @property {string|null} [vmIdentityToken] InternalUpdateGraphOperationRequest vmIdentityToken + * @property {number|null} [progress] InternalUpdateGraphOperationRequest progress + * @property {google.rpc.IStatus|null} [status] InternalUpdateGraphOperationRequest status + */ + + /** + * Constructs a new InternalUpdateGraphOperationRequest. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents an InternalUpdateGraphOperationRequest. + * @implements IInternalUpdateGraphOperationRequest + * @constructor + * @param {google.spanner.admin.database.v1.IInternalUpdateGraphOperationRequest=} [properties] Properties to set + */ + function InternalUpdateGraphOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InternalUpdateGraphOperationRequest database. + * @member {string} database + * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest + * @instance + */ + InternalUpdateGraphOperationRequest.prototype.database = ""; + + /** + * InternalUpdateGraphOperationRequest operationId. + * @member {string} operationId + * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest + * @instance + */ + InternalUpdateGraphOperationRequest.prototype.operationId = ""; + + /** + * InternalUpdateGraphOperationRequest vmIdentityToken. + * @member {string} vmIdentityToken + * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest + * @instance + */ + InternalUpdateGraphOperationRequest.prototype.vmIdentityToken = ""; + + /** + * InternalUpdateGraphOperationRequest progress. + * @member {number} progress + * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest + * @instance + */ + InternalUpdateGraphOperationRequest.prototype.progress = 0; + + /** + * InternalUpdateGraphOperationRequest status. + * @member {google.rpc.IStatus|null|undefined} status + * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest + * @instance + */ + InternalUpdateGraphOperationRequest.prototype.status = null; + + /** + * Creates a new InternalUpdateGraphOperationRequest instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest + * @static + * @param {google.spanner.admin.database.v1.IInternalUpdateGraphOperationRequest=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest} InternalUpdateGraphOperationRequest instance + */ + InternalUpdateGraphOperationRequest.create = function create(properties) { + return new InternalUpdateGraphOperationRequest(properties); + }; + + /** + * Encodes the specified InternalUpdateGraphOperationRequest message. Does not implicitly {@link google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest + * @static + * @param {google.spanner.admin.database.v1.IInternalUpdateGraphOperationRequest} message InternalUpdateGraphOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InternalUpdateGraphOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.database != null && Object.hasOwnProperty.call(message, "database")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.database); + if (message.operationId != null && Object.hasOwnProperty.call(message, "operationId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.operationId); + if (message.progress != null && Object.hasOwnProperty.call(message, "progress")) + writer.uint32(/* id 3, wireType 1 =*/25).double(message.progress); + if (message.vmIdentityToken != null && Object.hasOwnProperty.call(message, "vmIdentityToken")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.vmIdentityToken); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + $root.google.rpc.Status.encode(message.status, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InternalUpdateGraphOperationRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest + * @static + * @param {google.spanner.admin.database.v1.IInternalUpdateGraphOperationRequest} message InternalUpdateGraphOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InternalUpdateGraphOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InternalUpdateGraphOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest} InternalUpdateGraphOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InternalUpdateGraphOperationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.database = reader.string(); + break; + } + case 2: { + message.operationId = reader.string(); + break; + } + case 5: { + message.vmIdentityToken = reader.string(); + break; + } + case 3: { + message.progress = reader.double(); + break; + } + case 6: { + message.status = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InternalUpdateGraphOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest} InternalUpdateGraphOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InternalUpdateGraphOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InternalUpdateGraphOperationRequest message. + * @function verify + * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InternalUpdateGraphOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.database != null && message.hasOwnProperty("database")) + if (!$util.isString(message.database)) + return "database: string expected"; + if (message.operationId != null && message.hasOwnProperty("operationId")) + if (!$util.isString(message.operationId)) + return "operationId: string expected"; + if (message.vmIdentityToken != null && message.hasOwnProperty("vmIdentityToken")) + if (!$util.isString(message.vmIdentityToken)) + return "vmIdentityToken: string expected"; + if (message.progress != null && message.hasOwnProperty("progress")) + if (typeof message.progress !== "number") + return "progress: number expected"; + if (message.status != null && message.hasOwnProperty("status")) { + var error = $root.google.rpc.Status.verify(message.status); + if (error) + return "status." + error; + } + return null; + }; + + /** + * Creates an InternalUpdateGraphOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest} InternalUpdateGraphOperationRequest + */ + InternalUpdateGraphOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest) + return object; + var message = new $root.google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest(); + if (object.database != null) + message.database = String(object.database); + if (object.operationId != null) + message.operationId = String(object.operationId); + if (object.vmIdentityToken != null) + message.vmIdentityToken = String(object.vmIdentityToken); + if (object.progress != null) + message.progress = Number(object.progress); + if (object.status != null) { + if (typeof object.status !== "object") + throw TypeError(".google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest.status: object expected"); + message.status = $root.google.rpc.Status.fromObject(object.status); + } + return message; + }; + + /** + * Creates a plain object from an InternalUpdateGraphOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest + * @static + * @param {google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest} message InternalUpdateGraphOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InternalUpdateGraphOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.database = ""; + object.operationId = ""; + object.progress = 0; + object.vmIdentityToken = ""; + object.status = null; + } + if (message.database != null && message.hasOwnProperty("database")) + object.database = message.database; + if (message.operationId != null && message.hasOwnProperty("operationId")) + object.operationId = message.operationId; + if (message.progress != null && message.hasOwnProperty("progress")) + object.progress = options.json && !isFinite(message.progress) ? String(message.progress) : message.progress; + if (message.vmIdentityToken != null && message.hasOwnProperty("vmIdentityToken")) + object.vmIdentityToken = message.vmIdentityToken; + if (message.status != null && message.hasOwnProperty("status")) + object.status = $root.google.rpc.Status.toObject(message.status, options); + return object; + }; + + /** + * Converts this InternalUpdateGraphOperationRequest to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest + * @instance + * @returns {Object.} JSON object + */ + InternalUpdateGraphOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InternalUpdateGraphOperationRequest + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InternalUpdateGraphOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest"; + }; + + return InternalUpdateGraphOperationRequest; + })(); + + v1.InternalUpdateGraphOperationResponse = (function() { + + /** + * Properties of an InternalUpdateGraphOperationResponse. + * @memberof google.spanner.admin.database.v1 + * @interface IInternalUpdateGraphOperationResponse + */ + + /** + * Constructs a new InternalUpdateGraphOperationResponse. + * @memberof google.spanner.admin.database.v1 + * @classdesc Represents an InternalUpdateGraphOperationResponse. + * @implements IInternalUpdateGraphOperationResponse + * @constructor + * @param {google.spanner.admin.database.v1.IInternalUpdateGraphOperationResponse=} [properties] Properties to set + */ + function InternalUpdateGraphOperationResponse(properties) { + if (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 InternalUpdateGraphOperationResponse instance using the specified properties. + * @function create + * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse + * @static + * @param {google.spanner.admin.database.v1.IInternalUpdateGraphOperationResponse=} [properties] Properties to set + * @returns {google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse} InternalUpdateGraphOperationResponse instance + */ + InternalUpdateGraphOperationResponse.create = function create(properties) { + return new InternalUpdateGraphOperationResponse(properties); + }; + + /** + * Encodes the specified InternalUpdateGraphOperationResponse message. Does not implicitly {@link google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse + * @static + * @param {google.spanner.admin.database.v1.IInternalUpdateGraphOperationResponse} message InternalUpdateGraphOperationResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InternalUpdateGraphOperationResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified InternalUpdateGraphOperationResponse message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse + * @static + * @param {google.spanner.admin.database.v1.IInternalUpdateGraphOperationResponse} message InternalUpdateGraphOperationResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InternalUpdateGraphOperationResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InternalUpdateGraphOperationResponse message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse} InternalUpdateGraphOperationResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InternalUpdateGraphOperationResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InternalUpdateGraphOperationResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse} InternalUpdateGraphOperationResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InternalUpdateGraphOperationResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InternalUpdateGraphOperationResponse message. + * @function verify + * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InternalUpdateGraphOperationResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an InternalUpdateGraphOperationResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse} InternalUpdateGraphOperationResponse + */ + InternalUpdateGraphOperationResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse) + return object; + return new $root.google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse(); + }; + + /** + * Creates a plain object from an InternalUpdateGraphOperationResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse + * @static + * @param {google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse} message InternalUpdateGraphOperationResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InternalUpdateGraphOperationResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this InternalUpdateGraphOperationResponse to JSON. + * @function toJSON + * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse + * @instance + * @returns {Object.} JSON object + */ + InternalUpdateGraphOperationResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InternalUpdateGraphOperationResponse + * @function getTypeUrl + * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InternalUpdateGraphOperationResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse"; + }; + + return InternalUpdateGraphOperationResponse; + })(); + + return v1; + })(); + + return database; + })(); + + admin.instance = (function() { + + /** + * Namespace instance. + * @memberof google.spanner.admin + * @namespace + */ + var instance = {}; + + instance.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.spanner.admin.instance + * @namespace + */ + var v1 = {}; + + v1.OperationProgress = (function() { + + /** + * Properties of an OperationProgress. + * @memberof google.spanner.admin.instance.v1 + * @interface IOperationProgress + * @property {number|null} [progressPercent] OperationProgress progressPercent + * @property {google.protobuf.ITimestamp|null} [startTime] OperationProgress startTime + * @property {google.protobuf.ITimestamp|null} [endTime] OperationProgress endTime + */ + + /** + * Constructs a new OperationProgress. + * @memberof google.spanner.admin.instance.v1 + * @classdesc Represents an OperationProgress. + * @implements IOperationProgress + * @constructor + * @param {google.spanner.admin.instance.v1.IOperationProgress=} [properties] Properties to set + */ + function OperationProgress(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OperationProgress progressPercent. + * @member {number} progressPercent + * @memberof google.spanner.admin.instance.v1.OperationProgress + * @instance + */ + OperationProgress.prototype.progressPercent = 0; + + /** + * OperationProgress startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.spanner.admin.instance.v1.OperationProgress + * @instance + */ + OperationProgress.prototype.startTime = null; + + /** + * OperationProgress endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.spanner.admin.instance.v1.OperationProgress + * @instance + */ + OperationProgress.prototype.endTime = null; + + /** + * Creates a new OperationProgress instance using the specified properties. + * @function create + * @memberof google.spanner.admin.instance.v1.OperationProgress + * @static + * @param {google.spanner.admin.instance.v1.IOperationProgress=} [properties] Properties to set + * @returns {google.spanner.admin.instance.v1.OperationProgress} OperationProgress instance + */ + OperationProgress.create = function create(properties) { + return new OperationProgress(properties); + }; + + /** + * Encodes the specified OperationProgress message. Does not implicitly {@link google.spanner.admin.instance.v1.OperationProgress.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.instance.v1.OperationProgress + * @static + * @param {google.spanner.admin.instance.v1.IOperationProgress} message OperationProgress message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationProgress.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.progressPercent != null && Object.hasOwnProperty.call(message, "progressPercent")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.progressPercent); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OperationProgress message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.OperationProgress.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.instance.v1.OperationProgress + * @static + * @param {google.spanner.admin.instance.v1.IOperationProgress} message OperationProgress message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationProgress.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationProgress message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.instance.v1.OperationProgress + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.instance.v1.OperationProgress} OperationProgress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationProgress.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.OperationProgress(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.progressPercent = reader.int32(); + break; + } + case 2: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationProgress message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.instance.v1.OperationProgress + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.instance.v1.OperationProgress} OperationProgress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationProgress.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationProgress message. + * @function verify + * @memberof google.spanner.admin.instance.v1.OperationProgress + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationProgress.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.progressPercent != null && message.hasOwnProperty("progressPercent")) + if (!$util.isInteger(message.progressPercent)) + return "progressPercent: integer expected"; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + return null; + }; + + /** + * Creates an OperationProgress message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.instance.v1.OperationProgress + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.instance.v1.OperationProgress} OperationProgress + */ + OperationProgress.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.instance.v1.OperationProgress) + return object; + var message = new $root.google.spanner.admin.instance.v1.OperationProgress(); + if (object.progressPercent != null) + message.progressPercent = object.progressPercent | 0; + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.spanner.admin.instance.v1.OperationProgress.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.spanner.admin.instance.v1.OperationProgress.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + return message; + }; + + /** + * Creates a plain object from an OperationProgress message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.instance.v1.OperationProgress + * @static + * @param {google.spanner.admin.instance.v1.OperationProgress} message OperationProgress + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationProgress.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.progressPercent = 0; + object.startTime = null; + object.endTime = null; + } + if (message.progressPercent != null && message.hasOwnProperty("progressPercent")) + object.progressPercent = message.progressPercent; + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + return object; + }; + + /** + * Converts this OperationProgress to JSON. + * @function toJSON + * @memberof google.spanner.admin.instance.v1.OperationProgress + * @instance + * @returns {Object.} JSON object + */ + OperationProgress.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OperationProgress + * @function getTypeUrl + * @memberof google.spanner.admin.instance.v1.OperationProgress + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OperationProgress.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.instance.v1.OperationProgress"; + }; + + return OperationProgress; + })(); + + /** + * FulfillmentPeriod enum. + * @name google.spanner.admin.instance.v1.FulfillmentPeriod + * @enum {number} + * @property {number} FULFILLMENT_PERIOD_UNSPECIFIED=0 FULFILLMENT_PERIOD_UNSPECIFIED value + * @property {number} FULFILLMENT_PERIOD_NORMAL=1 FULFILLMENT_PERIOD_NORMAL value + * @property {number} FULFILLMENT_PERIOD_EXTENDED=2 FULFILLMENT_PERIOD_EXTENDED value + */ + v1.FulfillmentPeriod = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FULFILLMENT_PERIOD_UNSPECIFIED"] = 0; + values[valuesById[1] = "FULFILLMENT_PERIOD_NORMAL"] = 1; + values[valuesById[2] = "FULFILLMENT_PERIOD_EXTENDED"] = 2; + return values; + })(); + + v1.ReplicaSelection = (function() { + + /** + * Properties of a ReplicaSelection. + * @memberof google.spanner.admin.instance.v1 + * @interface IReplicaSelection + * @property {string|null} [location] ReplicaSelection location + */ + + /** + * Constructs a new ReplicaSelection. + * @memberof google.spanner.admin.instance.v1 + * @classdesc Represents a ReplicaSelection. + * @implements IReplicaSelection + * @constructor + * @param {google.spanner.admin.instance.v1.IReplicaSelection=} [properties] Properties to set + */ + function ReplicaSelection(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReplicaSelection location. + * @member {string} location + * @memberof google.spanner.admin.instance.v1.ReplicaSelection + * @instance + */ + ReplicaSelection.prototype.location = ""; + + /** + * Creates a new ReplicaSelection instance using the specified properties. + * @function create + * @memberof google.spanner.admin.instance.v1.ReplicaSelection + * @static + * @param {google.spanner.admin.instance.v1.IReplicaSelection=} [properties] Properties to set + * @returns {google.spanner.admin.instance.v1.ReplicaSelection} ReplicaSelection instance + */ + ReplicaSelection.create = function create(properties) { + return new ReplicaSelection(properties); + }; + + /** + * Encodes the specified ReplicaSelection message. Does not implicitly {@link google.spanner.admin.instance.v1.ReplicaSelection.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.instance.v1.ReplicaSelection + * @static + * @param {google.spanner.admin.instance.v1.IReplicaSelection} message ReplicaSelection message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReplicaSelection.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.location); + return writer; + }; + + /** + * Encodes the specified ReplicaSelection message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ReplicaSelection.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.instance.v1.ReplicaSelection + * @static + * @param {google.spanner.admin.instance.v1.IReplicaSelection} message ReplicaSelection message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReplicaSelection.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReplicaSelection message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.instance.v1.ReplicaSelection + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.instance.v1.ReplicaSelection} ReplicaSelection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReplicaSelection.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.ReplicaSelection(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.location = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReplicaSelection message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.instance.v1.ReplicaSelection + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.instance.v1.ReplicaSelection} ReplicaSelection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReplicaSelection.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReplicaSelection message. + * @function verify + * @memberof google.spanner.admin.instance.v1.ReplicaSelection + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReplicaSelection.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + return null; + }; + + /** + * Creates a ReplicaSelection message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.instance.v1.ReplicaSelection + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.instance.v1.ReplicaSelection} ReplicaSelection + */ + ReplicaSelection.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.instance.v1.ReplicaSelection) + return object; + var message = new $root.google.spanner.admin.instance.v1.ReplicaSelection(); + if (object.location != null) + message.location = String(object.location); + return message; + }; + + /** + * Creates a plain object from a ReplicaSelection message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.instance.v1.ReplicaSelection + * @static + * @param {google.spanner.admin.instance.v1.ReplicaSelection} message ReplicaSelection + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReplicaSelection.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.location = ""; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this ReplicaSelection to JSON. + * @function toJSON + * @memberof google.spanner.admin.instance.v1.ReplicaSelection + * @instance + * @returns {Object.} JSON object + */ + ReplicaSelection.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReplicaSelection + * @function getTypeUrl + * @memberof google.spanner.admin.instance.v1.ReplicaSelection + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReplicaSelection.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.instance.v1.ReplicaSelection"; + }; + + return ReplicaSelection; + })(); + + v1.InstanceAdmin = (function() { + + /** + * Constructs a new InstanceAdmin service. + * @memberof google.spanner.admin.instance.v1 + * @classdesc Represents an InstanceAdmin + * @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 InstanceAdmin(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (InstanceAdmin.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = InstanceAdmin; + + /** + * Creates new InstanceAdmin service using the specified rpc implementation. + * @function create + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @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 {InstanceAdmin} RPC service. Useful where requests and/or responses are streamed. + */ + InstanceAdmin.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|listInstanceConfigs}. + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @typedef ListInstanceConfigsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.spanner.admin.instance.v1.ListInstanceConfigsResponse} [response] ListInstanceConfigsResponse + */ + + /** + * Calls ListInstanceConfigs. + * @function listInstanceConfigs + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @instance + * @param {google.spanner.admin.instance.v1.IListInstanceConfigsRequest} request ListInstanceConfigsRequest message or plain object + * @param {google.spanner.admin.instance.v1.InstanceAdmin.ListInstanceConfigsCallback} callback Node-style callback called with the error, if any, and ListInstanceConfigsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(InstanceAdmin.prototype.listInstanceConfigs = function listInstanceConfigs(request, callback) { + return this.rpcCall(listInstanceConfigs, $root.google.spanner.admin.instance.v1.ListInstanceConfigsRequest, $root.google.spanner.admin.instance.v1.ListInstanceConfigsResponse, request, callback); + }, "name", { value: "ListInstanceConfigs" }); + + /** + * Calls ListInstanceConfigs. + * @function listInstanceConfigs + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @instance + * @param {google.spanner.admin.instance.v1.IListInstanceConfigsRequest} request ListInstanceConfigsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|getInstanceConfig}. + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @typedef GetInstanceConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.spanner.admin.instance.v1.InstanceConfig} [response] InstanceConfig + */ + + /** + * Calls GetInstanceConfig. + * @function getInstanceConfig + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @instance + * @param {google.spanner.admin.instance.v1.IGetInstanceConfigRequest} request GetInstanceConfigRequest message or plain object + * @param {google.spanner.admin.instance.v1.InstanceAdmin.GetInstanceConfigCallback} callback Node-style callback called with the error, if any, and InstanceConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(InstanceAdmin.prototype.getInstanceConfig = function getInstanceConfig(request, callback) { + return this.rpcCall(getInstanceConfig, $root.google.spanner.admin.instance.v1.GetInstanceConfigRequest, $root.google.spanner.admin.instance.v1.InstanceConfig, request, callback); + }, "name", { value: "GetInstanceConfig" }); + + /** + * Calls GetInstanceConfig. + * @function getInstanceConfig + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @instance + * @param {google.spanner.admin.instance.v1.IGetInstanceConfigRequest} request GetInstanceConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|createInstanceConfig}. + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @typedef CreateInstanceConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateInstanceConfig. + * @function createInstanceConfig + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @instance + * @param {google.spanner.admin.instance.v1.ICreateInstanceConfigRequest} request CreateInstanceConfigRequest message or plain object + * @param {google.spanner.admin.instance.v1.InstanceAdmin.CreateInstanceConfigCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(InstanceAdmin.prototype.createInstanceConfig = function createInstanceConfig(request, callback) { + return this.rpcCall(createInstanceConfig, $root.google.spanner.admin.instance.v1.CreateInstanceConfigRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateInstanceConfig" }); + + /** + * Calls CreateInstanceConfig. + * @function createInstanceConfig + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @instance + * @param {google.spanner.admin.instance.v1.ICreateInstanceConfigRequest} request CreateInstanceConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|updateInstanceConfig}. + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @typedef UpdateInstanceConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateInstanceConfig. + * @function updateInstanceConfig + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @instance + * @param {google.spanner.admin.instance.v1.IUpdateInstanceConfigRequest} request UpdateInstanceConfigRequest message or plain object + * @param {google.spanner.admin.instance.v1.InstanceAdmin.UpdateInstanceConfigCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(InstanceAdmin.prototype.updateInstanceConfig = function updateInstanceConfig(request, callback) { + return this.rpcCall(updateInstanceConfig, $root.google.spanner.admin.instance.v1.UpdateInstanceConfigRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateInstanceConfig" }); + + /** + * Calls UpdateInstanceConfig. + * @function updateInstanceConfig + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @instance + * @param {google.spanner.admin.instance.v1.IUpdateInstanceConfigRequest} request UpdateInstanceConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|deleteInstanceConfig}. + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @typedef DeleteInstanceConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteInstanceConfig. + * @function deleteInstanceConfig + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @instance + * @param {google.spanner.admin.instance.v1.IDeleteInstanceConfigRequest} request DeleteInstanceConfigRequest message or plain object + * @param {google.spanner.admin.instance.v1.InstanceAdmin.DeleteInstanceConfigCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(InstanceAdmin.prototype.deleteInstanceConfig = function deleteInstanceConfig(request, callback) { + return this.rpcCall(deleteInstanceConfig, $root.google.spanner.admin.instance.v1.DeleteInstanceConfigRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteInstanceConfig" }); + + /** + * Calls DeleteInstanceConfig. + * @function deleteInstanceConfig + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @instance + * @param {google.spanner.admin.instance.v1.IDeleteInstanceConfigRequest} request DeleteInstanceConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|listInstanceConfigOperations}. + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @typedef ListInstanceConfigOperationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse} [response] ListInstanceConfigOperationsResponse + */ + + /** + * Calls ListInstanceConfigOperations. + * @function listInstanceConfigOperations + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @instance + * @param {google.spanner.admin.instance.v1.IListInstanceConfigOperationsRequest} request ListInstanceConfigOperationsRequest message or plain object + * @param {google.spanner.admin.instance.v1.InstanceAdmin.ListInstanceConfigOperationsCallback} callback Node-style callback called with the error, if any, and ListInstanceConfigOperationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(InstanceAdmin.prototype.listInstanceConfigOperations = function listInstanceConfigOperations(request, callback) { + return this.rpcCall(listInstanceConfigOperations, $root.google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest, $root.google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse, request, callback); + }, "name", { value: "ListInstanceConfigOperations" }); + + /** + * Calls ListInstanceConfigOperations. + * @function listInstanceConfigOperations + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @instance + * @param {google.spanner.admin.instance.v1.IListInstanceConfigOperationsRequest} request ListInstanceConfigOperationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|listInstances}. + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @typedef ListInstancesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.spanner.admin.instance.v1.ListInstancesResponse} [response] ListInstancesResponse + */ + + /** + * Calls ListInstances. + * @function listInstances + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @instance + * @param {google.spanner.admin.instance.v1.IListInstancesRequest} request ListInstancesRequest message or plain object + * @param {google.spanner.admin.instance.v1.InstanceAdmin.ListInstancesCallback} callback Node-style callback called with the error, if any, and ListInstancesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(InstanceAdmin.prototype.listInstances = function listInstances(request, callback) { + return this.rpcCall(listInstances, $root.google.spanner.admin.instance.v1.ListInstancesRequest, $root.google.spanner.admin.instance.v1.ListInstancesResponse, request, callback); + }, "name", { value: "ListInstances" }); + + /** + * Calls ListInstances. + * @function listInstances + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @instance + * @param {google.spanner.admin.instance.v1.IListInstancesRequest} request ListInstancesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|listInstancePartitions}. + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @typedef ListInstancePartitionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.spanner.admin.instance.v1.ListInstancePartitionsResponse} [response] ListInstancePartitionsResponse + */ + + /** + * Calls ListInstancePartitions. + * @function listInstancePartitions + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @instance + * @param {google.spanner.admin.instance.v1.IListInstancePartitionsRequest} request ListInstancePartitionsRequest message or plain object + * @param {google.spanner.admin.instance.v1.InstanceAdmin.ListInstancePartitionsCallback} callback Node-style callback called with the error, if any, and ListInstancePartitionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(InstanceAdmin.prototype.listInstancePartitions = function listInstancePartitions(request, callback) { + return this.rpcCall(listInstancePartitions, $root.google.spanner.admin.instance.v1.ListInstancePartitionsRequest, $root.google.spanner.admin.instance.v1.ListInstancePartitionsResponse, request, callback); + }, "name", { value: "ListInstancePartitions" }); + + /** + * Calls ListInstancePartitions. + * @function listInstancePartitions + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @instance + * @param {google.spanner.admin.instance.v1.IListInstancePartitionsRequest} request ListInstancePartitionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|getInstance}. + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @typedef GetInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.spanner.admin.instance.v1.Instance} [response] Instance + */ + + /** + * Calls GetInstance. + * @function getInstance + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @instance + * @param {google.spanner.admin.instance.v1.IGetInstanceRequest} request GetInstanceRequest message or plain object + * @param {google.spanner.admin.instance.v1.InstanceAdmin.GetInstanceCallback} callback Node-style callback called with the error, if any, and Instance + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(InstanceAdmin.prototype.getInstance = function getInstance(request, callback) { + return this.rpcCall(getInstance, $root.google.spanner.admin.instance.v1.GetInstanceRequest, $root.google.spanner.admin.instance.v1.Instance, request, callback); + }, "name", { value: "GetInstance" }); + + /** + * Calls GetInstance. + * @function getInstance + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @instance + * @param {google.spanner.admin.instance.v1.IGetInstanceRequest} request GetInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|createInstance}. + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @typedef CreateInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateInstance. + * @function createInstance + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @instance + * @param {google.spanner.admin.instance.v1.ICreateInstanceRequest} request CreateInstanceRequest message or plain object + * @param {google.spanner.admin.instance.v1.InstanceAdmin.CreateInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(InstanceAdmin.prototype.createInstance = function createInstance(request, callback) { + return this.rpcCall(createInstance, $root.google.spanner.admin.instance.v1.CreateInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateInstance" }); + + /** + * Calls CreateInstance. + * @function createInstance + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @instance + * @param {google.spanner.admin.instance.v1.ICreateInstanceRequest} request CreateInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|updateInstance}. + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @typedef UpdateInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateInstance. + * @function updateInstance + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @instance + * @param {google.spanner.admin.instance.v1.IUpdateInstanceRequest} request UpdateInstanceRequest message or plain object + * @param {google.spanner.admin.instance.v1.InstanceAdmin.UpdateInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(InstanceAdmin.prototype.updateInstance = function updateInstance(request, callback) { + return this.rpcCall(updateInstance, $root.google.spanner.admin.instance.v1.UpdateInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateInstance" }); + + /** + * Calls UpdateInstance. + * @function updateInstance + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @instance + * @param {google.spanner.admin.instance.v1.IUpdateInstanceRequest} request UpdateInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|deleteInstance}. + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @typedef DeleteInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteInstance. + * @function deleteInstance + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @instance + * @param {google.spanner.admin.instance.v1.IDeleteInstanceRequest} request DeleteInstanceRequest message or plain object + * @param {google.spanner.admin.instance.v1.InstanceAdmin.DeleteInstanceCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(InstanceAdmin.prototype.deleteInstance = function deleteInstance(request, callback) { + return this.rpcCall(deleteInstance, $root.google.spanner.admin.instance.v1.DeleteInstanceRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteInstance" }); + + /** + * Calls DeleteInstance. + * @function deleteInstance + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @instance + * @param {google.spanner.admin.instance.v1.IDeleteInstanceRequest} request DeleteInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|setIamPolicy}. + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @typedef SetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @param {google.spanner.admin.instance.v1.InstanceAdmin.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(InstanceAdmin.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.spanner.admin.instance.v1.InstanceAdmin + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|getIamPolicy}. + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @typedef GetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @param {google.spanner.admin.instance.v1.InstanceAdmin.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(InstanceAdmin.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.spanner.admin.instance.v1.InstanceAdmin + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|testIamPermissions}. + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @typedef TestIamPermissionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.TestIamPermissionsResponse} [response] TestIamPermissionsResponse + */ + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @param {google.spanner.admin.instance.v1.InstanceAdmin.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(InstanceAdmin.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.spanner.admin.instance.v1.InstanceAdmin + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|getInstancePartition}. + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @typedef GetInstancePartitionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.spanner.admin.instance.v1.InstancePartition} [response] InstancePartition + */ + + /** + * Calls GetInstancePartition. + * @function getInstancePartition + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @instance + * @param {google.spanner.admin.instance.v1.IGetInstancePartitionRequest} request GetInstancePartitionRequest message or plain object + * @param {google.spanner.admin.instance.v1.InstanceAdmin.GetInstancePartitionCallback} callback Node-style callback called with the error, if any, and InstancePartition + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(InstanceAdmin.prototype.getInstancePartition = function getInstancePartition(request, callback) { + return this.rpcCall(getInstancePartition, $root.google.spanner.admin.instance.v1.GetInstancePartitionRequest, $root.google.spanner.admin.instance.v1.InstancePartition, request, callback); + }, "name", { value: "GetInstancePartition" }); + + /** + * Calls GetInstancePartition. + * @function getInstancePartition + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @instance + * @param {google.spanner.admin.instance.v1.IGetInstancePartitionRequest} request GetInstancePartitionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|createInstancePartition}. + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @typedef CreateInstancePartitionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateInstancePartition. + * @function createInstancePartition + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @instance + * @param {google.spanner.admin.instance.v1.ICreateInstancePartitionRequest} request CreateInstancePartitionRequest message or plain object + * @param {google.spanner.admin.instance.v1.InstanceAdmin.CreateInstancePartitionCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(InstanceAdmin.prototype.createInstancePartition = function createInstancePartition(request, callback) { + return this.rpcCall(createInstancePartition, $root.google.spanner.admin.instance.v1.CreateInstancePartitionRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateInstancePartition" }); + + /** + * Calls CreateInstancePartition. + * @function createInstancePartition + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @instance + * @param {google.spanner.admin.instance.v1.ICreateInstancePartitionRequest} request CreateInstancePartitionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|deleteInstancePartition}. + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @typedef DeleteInstancePartitionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteInstancePartition. + * @function deleteInstancePartition + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @instance + * @param {google.spanner.admin.instance.v1.IDeleteInstancePartitionRequest} request DeleteInstancePartitionRequest message or plain object + * @param {google.spanner.admin.instance.v1.InstanceAdmin.DeleteInstancePartitionCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(InstanceAdmin.prototype.deleteInstancePartition = function deleteInstancePartition(request, callback) { + return this.rpcCall(deleteInstancePartition, $root.google.spanner.admin.instance.v1.DeleteInstancePartitionRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteInstancePartition" }); + + /** + * Calls DeleteInstancePartition. + * @function deleteInstancePartition + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @instance + * @param {google.spanner.admin.instance.v1.IDeleteInstancePartitionRequest} request DeleteInstancePartitionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|updateInstancePartition}. + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @typedef UpdateInstancePartitionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateInstancePartition. + * @function updateInstancePartition + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @instance + * @param {google.spanner.admin.instance.v1.IUpdateInstancePartitionRequest} request UpdateInstancePartitionRequest message or plain object + * @param {google.spanner.admin.instance.v1.InstanceAdmin.UpdateInstancePartitionCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(InstanceAdmin.prototype.updateInstancePartition = function updateInstancePartition(request, callback) { + return this.rpcCall(updateInstancePartition, $root.google.spanner.admin.instance.v1.UpdateInstancePartitionRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateInstancePartition" }); + + /** + * Calls UpdateInstancePartition. + * @function updateInstancePartition + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @instance + * @param {google.spanner.admin.instance.v1.IUpdateInstancePartitionRequest} request UpdateInstancePartitionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|listInstancePartitionOperations}. + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @typedef ListInstancePartitionOperationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse} [response] ListInstancePartitionOperationsResponse + */ + + /** + * Calls ListInstancePartitionOperations. + * @function listInstancePartitionOperations + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @instance + * @param {google.spanner.admin.instance.v1.IListInstancePartitionOperationsRequest} request ListInstancePartitionOperationsRequest message or plain object + * @param {google.spanner.admin.instance.v1.InstanceAdmin.ListInstancePartitionOperationsCallback} callback Node-style callback called with the error, if any, and ListInstancePartitionOperationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(InstanceAdmin.prototype.listInstancePartitionOperations = function listInstancePartitionOperations(request, callback) { + return this.rpcCall(listInstancePartitionOperations, $root.google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest, $root.google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse, request, callback); + }, "name", { value: "ListInstancePartitionOperations" }); + + /** + * Calls ListInstancePartitionOperations. + * @function listInstancePartitionOperations + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @instance + * @param {google.spanner.admin.instance.v1.IListInstancePartitionOperationsRequest} request ListInstancePartitionOperationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|moveInstance}. + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @typedef MoveInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls MoveInstance. + * @function moveInstance + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @instance + * @param {google.spanner.admin.instance.v1.IMoveInstanceRequest} request MoveInstanceRequest message or plain object + * @param {google.spanner.admin.instance.v1.InstanceAdmin.MoveInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(InstanceAdmin.prototype.moveInstance = function moveInstance(request, callback) { + return this.rpcCall(moveInstance, $root.google.spanner.admin.instance.v1.MoveInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "MoveInstance" }); + + /** + * Calls MoveInstance. + * @function moveInstance + * @memberof google.spanner.admin.instance.v1.InstanceAdmin + * @instance + * @param {google.spanner.admin.instance.v1.IMoveInstanceRequest} request MoveInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return InstanceAdmin; + })(); + + v1.ReplicaInfo = (function() { + + /** + * Properties of a ReplicaInfo. + * @memberof google.spanner.admin.instance.v1 + * @interface IReplicaInfo + * @property {string|null} [location] ReplicaInfo location + * @property {google.spanner.admin.instance.v1.ReplicaInfo.ReplicaType|null} [type] ReplicaInfo type + * @property {boolean|null} [defaultLeaderLocation] ReplicaInfo defaultLeaderLocation + */ + + /** + * Constructs a new ReplicaInfo. + * @memberof google.spanner.admin.instance.v1 + * @classdesc Represents a ReplicaInfo. + * @implements IReplicaInfo + * @constructor + * @param {google.spanner.admin.instance.v1.IReplicaInfo=} [properties] Properties to set + */ + function ReplicaInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReplicaInfo location. + * @member {string} location + * @memberof google.spanner.admin.instance.v1.ReplicaInfo + * @instance + */ + ReplicaInfo.prototype.location = ""; + + /** + * ReplicaInfo type. + * @member {google.spanner.admin.instance.v1.ReplicaInfo.ReplicaType} type + * @memberof google.spanner.admin.instance.v1.ReplicaInfo + * @instance + */ + ReplicaInfo.prototype.type = 0; + + /** + * ReplicaInfo defaultLeaderLocation. + * @member {boolean} defaultLeaderLocation + * @memberof google.spanner.admin.instance.v1.ReplicaInfo + * @instance + */ + ReplicaInfo.prototype.defaultLeaderLocation = false; + + /** + * Creates a new ReplicaInfo instance using the specified properties. + * @function create + * @memberof google.spanner.admin.instance.v1.ReplicaInfo + * @static + * @param {google.spanner.admin.instance.v1.IReplicaInfo=} [properties] Properties to set + * @returns {google.spanner.admin.instance.v1.ReplicaInfo} ReplicaInfo instance + */ + ReplicaInfo.create = function create(properties) { + return new ReplicaInfo(properties); + }; + + /** + * Encodes the specified ReplicaInfo message. Does not implicitly {@link google.spanner.admin.instance.v1.ReplicaInfo.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.instance.v1.ReplicaInfo + * @static + * @param {google.spanner.admin.instance.v1.IReplicaInfo} message ReplicaInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReplicaInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.location); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.type); + if (message.defaultLeaderLocation != null && Object.hasOwnProperty.call(message, "defaultLeaderLocation")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.defaultLeaderLocation); + return writer; + }; + + /** + * Encodes the specified ReplicaInfo message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ReplicaInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.instance.v1.ReplicaInfo + * @static + * @param {google.spanner.admin.instance.v1.IReplicaInfo} message ReplicaInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReplicaInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReplicaInfo message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.instance.v1.ReplicaInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.instance.v1.ReplicaInfo} ReplicaInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReplicaInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.ReplicaInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.location = reader.string(); + break; + } + case 2: { + message.type = reader.int32(); + break; + } + case 3: { + message.defaultLeaderLocation = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReplicaInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.instance.v1.ReplicaInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.instance.v1.ReplicaInfo} ReplicaInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReplicaInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReplicaInfo message. + * @function verify + * @memberof google.spanner.admin.instance.v1.ReplicaInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReplicaInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.defaultLeaderLocation != null && message.hasOwnProperty("defaultLeaderLocation")) + if (typeof message.defaultLeaderLocation !== "boolean") + return "defaultLeaderLocation: boolean expected"; + return null; + }; + + /** + * Creates a ReplicaInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.instance.v1.ReplicaInfo + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.instance.v1.ReplicaInfo} ReplicaInfo + */ + ReplicaInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.instance.v1.ReplicaInfo) + return object; + var message = new $root.google.spanner.admin.instance.v1.ReplicaInfo(); + if (object.location != null) + message.location = String(object.location); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "READ_WRITE": + case 1: + message.type = 1; + break; + case "READ_ONLY": + case 2: + message.type = 2; + break; + case "WITNESS": + case 3: + message.type = 3; + break; + } + if (object.defaultLeaderLocation != null) + message.defaultLeaderLocation = Boolean(object.defaultLeaderLocation); + return message; + }; + + /** + * Creates a plain object from a ReplicaInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.instance.v1.ReplicaInfo + * @static + * @param {google.spanner.admin.instance.v1.ReplicaInfo} message ReplicaInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReplicaInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.location = ""; + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.defaultLeaderLocation = false; + } + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.spanner.admin.instance.v1.ReplicaInfo.ReplicaType[message.type] === undefined ? message.type : $root.google.spanner.admin.instance.v1.ReplicaInfo.ReplicaType[message.type] : message.type; + if (message.defaultLeaderLocation != null && message.hasOwnProperty("defaultLeaderLocation")) + object.defaultLeaderLocation = message.defaultLeaderLocation; + return object; + }; + + /** + * Converts this ReplicaInfo to JSON. + * @function toJSON + * @memberof google.spanner.admin.instance.v1.ReplicaInfo + * @instance + * @returns {Object.} JSON object + */ + ReplicaInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReplicaInfo + * @function getTypeUrl + * @memberof google.spanner.admin.instance.v1.ReplicaInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReplicaInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.instance.v1.ReplicaInfo"; + }; + + /** + * ReplicaType enum. + * @name google.spanner.admin.instance.v1.ReplicaInfo.ReplicaType + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} READ_WRITE=1 READ_WRITE value + * @property {number} READ_ONLY=2 READ_ONLY value + * @property {number} WITNESS=3 WITNESS value + */ + ReplicaInfo.ReplicaType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "READ_WRITE"] = 1; + values[valuesById[2] = "READ_ONLY"] = 2; + values[valuesById[3] = "WITNESS"] = 3; + return values; + })(); + + return ReplicaInfo; + })(); + + v1.InstanceConfig = (function() { + + /** + * Properties of an InstanceConfig. + * @memberof google.spanner.admin.instance.v1 + * @interface IInstanceConfig + * @property {string|null} [name] InstanceConfig name + * @property {string|null} [displayName] InstanceConfig displayName + * @property {google.spanner.admin.instance.v1.InstanceConfig.Type|null} [configType] InstanceConfig configType + * @property {Array.|null} [replicas] InstanceConfig replicas + * @property {Array.|null} [optionalReplicas] InstanceConfig optionalReplicas + * @property {string|null} [baseConfig] InstanceConfig baseConfig + * @property {Object.|null} [labels] InstanceConfig labels + * @property {string|null} [etag] InstanceConfig etag + * @property {Array.|null} [leaderOptions] InstanceConfig leaderOptions + * @property {boolean|null} [reconciling] InstanceConfig reconciling + * @property {google.spanner.admin.instance.v1.InstanceConfig.State|null} [state] InstanceConfig state + * @property {google.spanner.admin.instance.v1.InstanceConfig.FreeInstanceAvailability|null} [freeInstanceAvailability] InstanceConfig freeInstanceAvailability + * @property {google.spanner.admin.instance.v1.InstanceConfig.QuorumType|null} [quorumType] InstanceConfig quorumType + * @property {number|Long|null} [storageLimitPerProcessingUnit] InstanceConfig storageLimitPerProcessingUnit + */ + + /** + * Constructs a new InstanceConfig. + * @memberof google.spanner.admin.instance.v1 + * @classdesc Represents an InstanceConfig. + * @implements IInstanceConfig + * @constructor + * @param {google.spanner.admin.instance.v1.IInstanceConfig=} [properties] Properties to set + */ + function InstanceConfig(properties) { + this.replicas = []; + this.optionalReplicas = []; + this.labels = {}; + this.leaderOptions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstanceConfig name. + * @member {string} name + * @memberof google.spanner.admin.instance.v1.InstanceConfig + * @instance + */ + InstanceConfig.prototype.name = ""; + + /** + * InstanceConfig displayName. + * @member {string} displayName + * @memberof google.spanner.admin.instance.v1.InstanceConfig + * @instance + */ + InstanceConfig.prototype.displayName = ""; + + /** + * InstanceConfig configType. + * @member {google.spanner.admin.instance.v1.InstanceConfig.Type} configType + * @memberof google.spanner.admin.instance.v1.InstanceConfig + * @instance + */ + InstanceConfig.prototype.configType = 0; + + /** + * InstanceConfig replicas. + * @member {Array.} replicas + * @memberof google.spanner.admin.instance.v1.InstanceConfig + * @instance + */ + InstanceConfig.prototype.replicas = $util.emptyArray; + + /** + * InstanceConfig optionalReplicas. + * @member {Array.} optionalReplicas + * @memberof google.spanner.admin.instance.v1.InstanceConfig + * @instance + */ + InstanceConfig.prototype.optionalReplicas = $util.emptyArray; + + /** + * InstanceConfig baseConfig. + * @member {string} baseConfig + * @memberof google.spanner.admin.instance.v1.InstanceConfig + * @instance + */ + InstanceConfig.prototype.baseConfig = ""; + + /** + * InstanceConfig labels. + * @member {Object.} labels + * @memberof google.spanner.admin.instance.v1.InstanceConfig + * @instance + */ + InstanceConfig.prototype.labels = $util.emptyObject; + + /** + * InstanceConfig etag. + * @member {string} etag + * @memberof google.spanner.admin.instance.v1.InstanceConfig + * @instance + */ + InstanceConfig.prototype.etag = ""; + + /** + * InstanceConfig leaderOptions. + * @member {Array.} leaderOptions + * @memberof google.spanner.admin.instance.v1.InstanceConfig + * @instance + */ + InstanceConfig.prototype.leaderOptions = $util.emptyArray; + + /** + * InstanceConfig reconciling. + * @member {boolean} reconciling + * @memberof google.spanner.admin.instance.v1.InstanceConfig + * @instance + */ + InstanceConfig.prototype.reconciling = false; + + /** + * InstanceConfig state. + * @member {google.spanner.admin.instance.v1.InstanceConfig.State} state + * @memberof google.spanner.admin.instance.v1.InstanceConfig + * @instance + */ + InstanceConfig.prototype.state = 0; + + /** + * InstanceConfig freeInstanceAvailability. + * @member {google.spanner.admin.instance.v1.InstanceConfig.FreeInstanceAvailability} freeInstanceAvailability + * @memberof google.spanner.admin.instance.v1.InstanceConfig + * @instance + */ + InstanceConfig.prototype.freeInstanceAvailability = 0; + + /** + * InstanceConfig quorumType. + * @member {google.spanner.admin.instance.v1.InstanceConfig.QuorumType} quorumType + * @memberof google.spanner.admin.instance.v1.InstanceConfig + * @instance + */ + InstanceConfig.prototype.quorumType = 0; + + /** + * InstanceConfig storageLimitPerProcessingUnit. + * @member {number|Long} storageLimitPerProcessingUnit + * @memberof google.spanner.admin.instance.v1.InstanceConfig + * @instance + */ + InstanceConfig.prototype.storageLimitPerProcessingUnit = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new InstanceConfig instance using the specified properties. + * @function create + * @memberof google.spanner.admin.instance.v1.InstanceConfig + * @static + * @param {google.spanner.admin.instance.v1.IInstanceConfig=} [properties] Properties to set + * @returns {google.spanner.admin.instance.v1.InstanceConfig} InstanceConfig instance + */ + InstanceConfig.create = function create(properties) { + return new InstanceConfig(properties); + }; + + /** + * Encodes the specified InstanceConfig message. Does not implicitly {@link google.spanner.admin.instance.v1.InstanceConfig.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.instance.v1.InstanceConfig + * @static + * @param {google.spanner.admin.instance.v1.IInstanceConfig} message InstanceConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.replicas != null && message.replicas.length) + for (var i = 0; i < message.replicas.length; ++i) + $root.google.spanner.admin.instance.v1.ReplicaInfo.encode(message.replicas[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.leaderOptions != null && message.leaderOptions.length) + for (var i = 0; i < message.leaderOptions.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.leaderOptions[i]); + if (message.configType != null && Object.hasOwnProperty.call(message, "configType")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.configType); + if (message.optionalReplicas != null && message.optionalReplicas.length) + for (var i = 0; i < message.optionalReplicas.length; ++i) + $root.google.spanner.admin.instance.v1.ReplicaInfo.encode(message.optionalReplicas[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.baseConfig != null && Object.hasOwnProperty.call(message, "baseConfig")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.baseConfig); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 8, wireType 2 =*/66).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.etag); + if (message.reconciling != null && Object.hasOwnProperty.call(message, "reconciling")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.reconciling); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.state); + if (message.freeInstanceAvailability != null && Object.hasOwnProperty.call(message, "freeInstanceAvailability")) + writer.uint32(/* id 12, wireType 0 =*/96).int32(message.freeInstanceAvailability); + if (message.quorumType != null && Object.hasOwnProperty.call(message, "quorumType")) + writer.uint32(/* id 18, wireType 0 =*/144).int32(message.quorumType); + if (message.storageLimitPerProcessingUnit != null && Object.hasOwnProperty.call(message, "storageLimitPerProcessingUnit")) + writer.uint32(/* id 19, wireType 0 =*/152).int64(message.storageLimitPerProcessingUnit); + return writer; + }; + + /** + * Encodes the specified InstanceConfig message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.InstanceConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.instance.v1.InstanceConfig + * @static + * @param {google.spanner.admin.instance.v1.IInstanceConfig} message InstanceConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstanceConfig message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.instance.v1.InstanceConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.instance.v1.InstanceConfig} InstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.InstanceConfig(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 5: { + message.configType = reader.int32(); + break; + } + case 3: { + if (!(message.replicas && message.replicas.length)) + message.replicas = []; + message.replicas.push($root.google.spanner.admin.instance.v1.ReplicaInfo.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.optionalReplicas && message.optionalReplicas.length)) + message.optionalReplicas = []; + message.optionalReplicas.push($root.google.spanner.admin.instance.v1.ReplicaInfo.decode(reader, reader.uint32())); + break; + } + case 7: { + message.baseConfig = reader.string(); + break; + } + case 8: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 9: { + message.etag = reader.string(); + break; + } + case 4: { + if (!(message.leaderOptions && message.leaderOptions.length)) + message.leaderOptions = []; + message.leaderOptions.push(reader.string()); + break; + } + case 10: { + message.reconciling = reader.bool(); + break; + } + case 11: { + message.state = reader.int32(); + break; + } + case 12: { + message.freeInstanceAvailability = reader.int32(); + break; + } + case 18: { + message.quorumType = reader.int32(); + break; + } + case 19: { + message.storageLimitPerProcessingUnit = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstanceConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.instance.v1.InstanceConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.instance.v1.InstanceConfig} InstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstanceConfig message. + * @function verify + * @memberof google.spanner.admin.instance.v1.InstanceConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstanceConfig.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.configType != null && message.hasOwnProperty("configType")) + switch (message.configType) { + default: + return "configType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.replicas != null && message.hasOwnProperty("replicas")) { + if (!Array.isArray(message.replicas)) + return "replicas: array expected"; + for (var i = 0; i < message.replicas.length; ++i) { + var error = $root.google.spanner.admin.instance.v1.ReplicaInfo.verify(message.replicas[i]); + if (error) + return "replicas." + error; + } + } + if (message.optionalReplicas != null && message.hasOwnProperty("optionalReplicas")) { + if (!Array.isArray(message.optionalReplicas)) + return "optionalReplicas: array expected"; + for (var i = 0; i < message.optionalReplicas.length; ++i) { + var error = $root.google.spanner.admin.instance.v1.ReplicaInfo.verify(message.optionalReplicas[i]); + if (error) + return "optionalReplicas." + error; + } + } + if (message.baseConfig != null && message.hasOwnProperty("baseConfig")) + if (!$util.isString(message.baseConfig)) + return "baseConfig: string expected"; + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.leaderOptions != null && message.hasOwnProperty("leaderOptions")) { + if (!Array.isArray(message.leaderOptions)) + return "leaderOptions: array expected"; + for (var i = 0; i < message.leaderOptions.length; ++i) + if (!$util.isString(message.leaderOptions[i])) + return "leaderOptions: string[] expected"; + } + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + if (typeof message.reconciling !== "boolean") + return "reconciling: boolean 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.freeInstanceAvailability != null && message.hasOwnProperty("freeInstanceAvailability")) + switch (message.freeInstanceAvailability) { + default: + return "freeInstanceAvailability: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.quorumType != null && message.hasOwnProperty("quorumType")) + switch (message.quorumType) { + default: + return "quorumType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.storageLimitPerProcessingUnit != null && message.hasOwnProperty("storageLimitPerProcessingUnit")) + if (!$util.isInteger(message.storageLimitPerProcessingUnit) && !(message.storageLimitPerProcessingUnit && $util.isInteger(message.storageLimitPerProcessingUnit.low) && $util.isInteger(message.storageLimitPerProcessingUnit.high))) + return "storageLimitPerProcessingUnit: integer|Long expected"; + return null; + }; + + /** + * Creates an InstanceConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.instance.v1.InstanceConfig + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.instance.v1.InstanceConfig} InstanceConfig + */ + InstanceConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.instance.v1.InstanceConfig) + return object; + var message = new $root.google.spanner.admin.instance.v1.InstanceConfig(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + switch (object.configType) { + default: + if (typeof object.configType === "number") { + message.configType = object.configType; + break; + } + break; + case "TYPE_UNSPECIFIED": + case 0: + message.configType = 0; + break; + case "GOOGLE_MANAGED": + case 1: + message.configType = 1; + break; + case "USER_MANAGED": + case 2: + message.configType = 2; + break; + } + if (object.replicas) { + if (!Array.isArray(object.replicas)) + throw TypeError(".google.spanner.admin.instance.v1.InstanceConfig.replicas: array expected"); + message.replicas = []; + for (var i = 0; i < object.replicas.length; ++i) { + if (typeof object.replicas[i] !== "object") + throw TypeError(".google.spanner.admin.instance.v1.InstanceConfig.replicas: object expected"); + message.replicas[i] = $root.google.spanner.admin.instance.v1.ReplicaInfo.fromObject(object.replicas[i]); + } + } + if (object.optionalReplicas) { + if (!Array.isArray(object.optionalReplicas)) + throw TypeError(".google.spanner.admin.instance.v1.InstanceConfig.optionalReplicas: array expected"); + message.optionalReplicas = []; + for (var i = 0; i < object.optionalReplicas.length; ++i) { + if (typeof object.optionalReplicas[i] !== "object") + throw TypeError(".google.spanner.admin.instance.v1.InstanceConfig.optionalReplicas: object expected"); + message.optionalReplicas[i] = $root.google.spanner.admin.instance.v1.ReplicaInfo.fromObject(object.optionalReplicas[i]); + } + } + if (object.baseConfig != null) + message.baseConfig = String(object.baseConfig); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.spanner.admin.instance.v1.InstanceConfig.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.etag != null) + message.etag = String(object.etag); + if (object.leaderOptions) { + if (!Array.isArray(object.leaderOptions)) + throw TypeError(".google.spanner.admin.instance.v1.InstanceConfig.leaderOptions: array expected"); + message.leaderOptions = []; + for (var i = 0; i < object.leaderOptions.length; ++i) + message.leaderOptions[i] = String(object.leaderOptions[i]); + } + if (object.reconciling != null) + message.reconciling = Boolean(object.reconciling); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "CREATING": + case 1: + message.state = 1; + break; + case "READY": + case 2: + message.state = 2; + break; + } + switch (object.freeInstanceAvailability) { + default: + if (typeof object.freeInstanceAvailability === "number") { + message.freeInstanceAvailability = object.freeInstanceAvailability; + break; + } + break; + case "FREE_INSTANCE_AVAILABILITY_UNSPECIFIED": + case 0: + message.freeInstanceAvailability = 0; + break; + case "AVAILABLE": + case 1: + message.freeInstanceAvailability = 1; + break; + case "UNSUPPORTED": + case 2: + message.freeInstanceAvailability = 2; + break; + case "DISABLED": + case 3: + message.freeInstanceAvailability = 3; + break; + case "QUOTA_EXCEEDED": + case 4: + message.freeInstanceAvailability = 4; + break; + } + switch (object.quorumType) { + default: + if (typeof object.quorumType === "number") { + message.quorumType = object.quorumType; + break; + } + break; + case "QUORUM_TYPE_UNSPECIFIED": + case 0: + message.quorumType = 0; + break; + case "REGION": + case 1: + message.quorumType = 1; + break; + case "DUAL_REGION": + case 2: + message.quorumType = 2; + break; + case "MULTI_REGION": + case 3: + message.quorumType = 3; + break; + } + if (object.storageLimitPerProcessingUnit != null) + if ($util.Long) + (message.storageLimitPerProcessingUnit = $util.Long.fromValue(object.storageLimitPerProcessingUnit)).unsigned = false; + else if (typeof object.storageLimitPerProcessingUnit === "string") + message.storageLimitPerProcessingUnit = parseInt(object.storageLimitPerProcessingUnit, 10); + else if (typeof object.storageLimitPerProcessingUnit === "number") + message.storageLimitPerProcessingUnit = object.storageLimitPerProcessingUnit; + else if (typeof object.storageLimitPerProcessingUnit === "object") + message.storageLimitPerProcessingUnit = new $util.LongBits(object.storageLimitPerProcessingUnit.low >>> 0, object.storageLimitPerProcessingUnit.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from an InstanceConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.instance.v1.InstanceConfig + * @static + * @param {google.spanner.admin.instance.v1.InstanceConfig} message InstanceConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstanceConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.replicas = []; + object.leaderOptions = []; + object.optionalReplicas = []; + } + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.configType = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.baseConfig = ""; + object.etag = ""; + object.reconciling = false; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.freeInstanceAvailability = options.enums === String ? "FREE_INSTANCE_AVAILABILITY_UNSPECIFIED" : 0; + object.quorumType = options.enums === String ? "QUORUM_TYPE_UNSPECIFIED" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.storageLimitPerProcessingUnit = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.storageLimitPerProcessingUnit = options.longs === String ? "0" : 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.replicas && message.replicas.length) { + object.replicas = []; + for (var j = 0; j < message.replicas.length; ++j) + object.replicas[j] = $root.google.spanner.admin.instance.v1.ReplicaInfo.toObject(message.replicas[j], options); + } + if (message.leaderOptions && message.leaderOptions.length) { + object.leaderOptions = []; + for (var j = 0; j < message.leaderOptions.length; ++j) + object.leaderOptions[j] = message.leaderOptions[j]; + } + if (message.configType != null && message.hasOwnProperty("configType")) + object.configType = options.enums === String ? $root.google.spanner.admin.instance.v1.InstanceConfig.Type[message.configType] === undefined ? message.configType : $root.google.spanner.admin.instance.v1.InstanceConfig.Type[message.configType] : message.configType; + if (message.optionalReplicas && message.optionalReplicas.length) { + object.optionalReplicas = []; + for (var j = 0; j < message.optionalReplicas.length; ++j) + object.optionalReplicas[j] = $root.google.spanner.admin.instance.v1.ReplicaInfo.toObject(message.optionalReplicas[j], options); + } + if (message.baseConfig != null && message.hasOwnProperty("baseConfig")) + object.baseConfig = message.baseConfig; + 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.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + object.reconciling = message.reconciling; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.spanner.admin.instance.v1.InstanceConfig.State[message.state] === undefined ? message.state : $root.google.spanner.admin.instance.v1.InstanceConfig.State[message.state] : message.state; + if (message.freeInstanceAvailability != null && message.hasOwnProperty("freeInstanceAvailability")) + object.freeInstanceAvailability = options.enums === String ? $root.google.spanner.admin.instance.v1.InstanceConfig.FreeInstanceAvailability[message.freeInstanceAvailability] === undefined ? message.freeInstanceAvailability : $root.google.spanner.admin.instance.v1.InstanceConfig.FreeInstanceAvailability[message.freeInstanceAvailability] : message.freeInstanceAvailability; + if (message.quorumType != null && message.hasOwnProperty("quorumType")) + object.quorumType = options.enums === String ? $root.google.spanner.admin.instance.v1.InstanceConfig.QuorumType[message.quorumType] === undefined ? message.quorumType : $root.google.spanner.admin.instance.v1.InstanceConfig.QuorumType[message.quorumType] : message.quorumType; + if (message.storageLimitPerProcessingUnit != null && message.hasOwnProperty("storageLimitPerProcessingUnit")) + if (typeof message.storageLimitPerProcessingUnit === "number") + object.storageLimitPerProcessingUnit = options.longs === String ? String(message.storageLimitPerProcessingUnit) : message.storageLimitPerProcessingUnit; + else + object.storageLimitPerProcessingUnit = options.longs === String ? $util.Long.prototype.toString.call(message.storageLimitPerProcessingUnit) : options.longs === Number ? new $util.LongBits(message.storageLimitPerProcessingUnit.low >>> 0, message.storageLimitPerProcessingUnit.high >>> 0).toNumber() : message.storageLimitPerProcessingUnit; + return object; + }; + + /** + * Converts this InstanceConfig to JSON. + * @function toJSON + * @memberof google.spanner.admin.instance.v1.InstanceConfig + * @instance + * @returns {Object.} JSON object + */ + InstanceConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InstanceConfig + * @function getTypeUrl + * @memberof google.spanner.admin.instance.v1.InstanceConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InstanceConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.instance.v1.InstanceConfig"; + }; + + /** + * Type enum. + * @name google.spanner.admin.instance.v1.InstanceConfig.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} GOOGLE_MANAGED=1 GOOGLE_MANAGED value + * @property {number} USER_MANAGED=2 USER_MANAGED value + */ + InstanceConfig.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "GOOGLE_MANAGED"] = 1; + values[valuesById[2] = "USER_MANAGED"] = 2; + return values; + })(); + + /** + * State enum. + * @name google.spanner.admin.instance.v1.InstanceConfig.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} CREATING=1 CREATING value + * @property {number} READY=2 READY value + */ + InstanceConfig.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CREATING"] = 1; + values[valuesById[2] = "READY"] = 2; + return values; + })(); + + /** + * FreeInstanceAvailability enum. + * @name google.spanner.admin.instance.v1.InstanceConfig.FreeInstanceAvailability + * @enum {number} + * @property {number} FREE_INSTANCE_AVAILABILITY_UNSPECIFIED=0 FREE_INSTANCE_AVAILABILITY_UNSPECIFIED value + * @property {number} AVAILABLE=1 AVAILABLE value + * @property {number} UNSUPPORTED=2 UNSUPPORTED value + * @property {number} DISABLED=3 DISABLED value + * @property {number} QUOTA_EXCEEDED=4 QUOTA_EXCEEDED value + */ + InstanceConfig.FreeInstanceAvailability = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FREE_INSTANCE_AVAILABILITY_UNSPECIFIED"] = 0; + values[valuesById[1] = "AVAILABLE"] = 1; + values[valuesById[2] = "UNSUPPORTED"] = 2; + values[valuesById[3] = "DISABLED"] = 3; + values[valuesById[4] = "QUOTA_EXCEEDED"] = 4; + return values; + })(); + + /** + * QuorumType enum. + * @name google.spanner.admin.instance.v1.InstanceConfig.QuorumType + * @enum {number} + * @property {number} QUORUM_TYPE_UNSPECIFIED=0 QUORUM_TYPE_UNSPECIFIED value + * @property {number} REGION=1 REGION value + * @property {number} DUAL_REGION=2 DUAL_REGION value + * @property {number} MULTI_REGION=3 MULTI_REGION value + */ + InstanceConfig.QuorumType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "QUORUM_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "REGION"] = 1; + values[valuesById[2] = "DUAL_REGION"] = 2; + values[valuesById[3] = "MULTI_REGION"] = 3; + return values; + })(); + + return InstanceConfig; + })(); + + v1.ReplicaComputeCapacity = (function() { + + /** + * Properties of a ReplicaComputeCapacity. + * @memberof google.spanner.admin.instance.v1 + * @interface IReplicaComputeCapacity + * @property {google.spanner.admin.instance.v1.IReplicaSelection|null} [replicaSelection] ReplicaComputeCapacity replicaSelection + * @property {number|null} [nodeCount] ReplicaComputeCapacity nodeCount + * @property {number|null} [processingUnits] ReplicaComputeCapacity processingUnits + */ + + /** + * Constructs a new ReplicaComputeCapacity. + * @memberof google.spanner.admin.instance.v1 + * @classdesc Represents a ReplicaComputeCapacity. + * @implements IReplicaComputeCapacity + * @constructor + * @param {google.spanner.admin.instance.v1.IReplicaComputeCapacity=} [properties] Properties to set + */ + function ReplicaComputeCapacity(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReplicaComputeCapacity replicaSelection. + * @member {google.spanner.admin.instance.v1.IReplicaSelection|null|undefined} replicaSelection + * @memberof google.spanner.admin.instance.v1.ReplicaComputeCapacity + * @instance + */ + ReplicaComputeCapacity.prototype.replicaSelection = null; + + /** + * ReplicaComputeCapacity nodeCount. + * @member {number|null|undefined} nodeCount + * @memberof google.spanner.admin.instance.v1.ReplicaComputeCapacity + * @instance + */ + ReplicaComputeCapacity.prototype.nodeCount = null; + + /** + * ReplicaComputeCapacity processingUnits. + * @member {number|null|undefined} processingUnits + * @memberof google.spanner.admin.instance.v1.ReplicaComputeCapacity + * @instance + */ + ReplicaComputeCapacity.prototype.processingUnits = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ReplicaComputeCapacity computeCapacity. + * @member {"nodeCount"|"processingUnits"|undefined} computeCapacity + * @memberof google.spanner.admin.instance.v1.ReplicaComputeCapacity + * @instance + */ + Object.defineProperty(ReplicaComputeCapacity.prototype, "computeCapacity", { + get: $util.oneOfGetter($oneOfFields = ["nodeCount", "processingUnits"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ReplicaComputeCapacity instance using the specified properties. + * @function create + * @memberof google.spanner.admin.instance.v1.ReplicaComputeCapacity + * @static + * @param {google.spanner.admin.instance.v1.IReplicaComputeCapacity=} [properties] Properties to set + * @returns {google.spanner.admin.instance.v1.ReplicaComputeCapacity} ReplicaComputeCapacity instance + */ + ReplicaComputeCapacity.create = function create(properties) { + return new ReplicaComputeCapacity(properties); + }; + + /** + * Encodes the specified ReplicaComputeCapacity message. Does not implicitly {@link google.spanner.admin.instance.v1.ReplicaComputeCapacity.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.instance.v1.ReplicaComputeCapacity + * @static + * @param {google.spanner.admin.instance.v1.IReplicaComputeCapacity} message ReplicaComputeCapacity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReplicaComputeCapacity.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.replicaSelection != null && Object.hasOwnProperty.call(message, "replicaSelection")) + $root.google.spanner.admin.instance.v1.ReplicaSelection.encode(message.replicaSelection, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nodeCount != null && Object.hasOwnProperty.call(message, "nodeCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nodeCount); + if (message.processingUnits != null && Object.hasOwnProperty.call(message, "processingUnits")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.processingUnits); + return writer; + }; + + /** + * Encodes the specified ReplicaComputeCapacity message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ReplicaComputeCapacity.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.instance.v1.ReplicaComputeCapacity + * @static + * @param {google.spanner.admin.instance.v1.IReplicaComputeCapacity} message ReplicaComputeCapacity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReplicaComputeCapacity.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReplicaComputeCapacity message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.instance.v1.ReplicaComputeCapacity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.instance.v1.ReplicaComputeCapacity} ReplicaComputeCapacity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReplicaComputeCapacity.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.ReplicaComputeCapacity(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.replicaSelection = $root.google.spanner.admin.instance.v1.ReplicaSelection.decode(reader, reader.uint32()); + break; + } + case 2: { + message.nodeCount = reader.int32(); + break; + } + case 3: { + message.processingUnits = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReplicaComputeCapacity message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.instance.v1.ReplicaComputeCapacity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.instance.v1.ReplicaComputeCapacity} ReplicaComputeCapacity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReplicaComputeCapacity.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReplicaComputeCapacity message. + * @function verify + * @memberof google.spanner.admin.instance.v1.ReplicaComputeCapacity + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReplicaComputeCapacity.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.replicaSelection != null && message.hasOwnProperty("replicaSelection")) { + var error = $root.google.spanner.admin.instance.v1.ReplicaSelection.verify(message.replicaSelection); + if (error) + return "replicaSelection." + error; + } + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) { + properties.computeCapacity = 1; + if (!$util.isInteger(message.nodeCount)) + return "nodeCount: integer expected"; + } + if (message.processingUnits != null && message.hasOwnProperty("processingUnits")) { + if (properties.computeCapacity === 1) + return "computeCapacity: multiple values"; + properties.computeCapacity = 1; + if (!$util.isInteger(message.processingUnits)) + return "processingUnits: integer expected"; + } + return null; + }; + + /** + * Creates a ReplicaComputeCapacity message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.instance.v1.ReplicaComputeCapacity + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.instance.v1.ReplicaComputeCapacity} ReplicaComputeCapacity + */ + ReplicaComputeCapacity.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.instance.v1.ReplicaComputeCapacity) + return object; + var message = new $root.google.spanner.admin.instance.v1.ReplicaComputeCapacity(); + if (object.replicaSelection != null) { + if (typeof object.replicaSelection !== "object") + throw TypeError(".google.spanner.admin.instance.v1.ReplicaComputeCapacity.replicaSelection: object expected"); + message.replicaSelection = $root.google.spanner.admin.instance.v1.ReplicaSelection.fromObject(object.replicaSelection); + } + if (object.nodeCount != null) + message.nodeCount = object.nodeCount | 0; + if (object.processingUnits != null) + message.processingUnits = object.processingUnits | 0; + return message; + }; + + /** + * Creates a plain object from a ReplicaComputeCapacity message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.instance.v1.ReplicaComputeCapacity + * @static + * @param {google.spanner.admin.instance.v1.ReplicaComputeCapacity} message ReplicaComputeCapacity + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReplicaComputeCapacity.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.replicaSelection = null; + if (message.replicaSelection != null && message.hasOwnProperty("replicaSelection")) + object.replicaSelection = $root.google.spanner.admin.instance.v1.ReplicaSelection.toObject(message.replicaSelection, options); + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) { + object.nodeCount = message.nodeCount; + if (options.oneofs) + object.computeCapacity = "nodeCount"; + } + if (message.processingUnits != null && message.hasOwnProperty("processingUnits")) { + object.processingUnits = message.processingUnits; + if (options.oneofs) + object.computeCapacity = "processingUnits"; + } + return object; + }; + + /** + * Converts this ReplicaComputeCapacity to JSON. + * @function toJSON + * @memberof google.spanner.admin.instance.v1.ReplicaComputeCapacity + * @instance + * @returns {Object.} JSON object + */ + ReplicaComputeCapacity.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReplicaComputeCapacity + * @function getTypeUrl + * @memberof google.spanner.admin.instance.v1.ReplicaComputeCapacity + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReplicaComputeCapacity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.instance.v1.ReplicaComputeCapacity"; + }; + + return ReplicaComputeCapacity; + })(); + + v1.AutoscalingConfig = (function() { + + /** + * Properties of an AutoscalingConfig. + * @memberof google.spanner.admin.instance.v1 + * @interface IAutoscalingConfig + * @property {google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingLimits|null} [autoscalingLimits] AutoscalingConfig autoscalingLimits + * @property {google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingTargets|null} [autoscalingTargets] AutoscalingConfig autoscalingTargets + * @property {Array.|null} [asymmetricAutoscalingOptions] AutoscalingConfig asymmetricAutoscalingOptions + */ + + /** + * Constructs a new AutoscalingConfig. + * @memberof google.spanner.admin.instance.v1 + * @classdesc Represents an AutoscalingConfig. + * @implements IAutoscalingConfig + * @constructor + * @param {google.spanner.admin.instance.v1.IAutoscalingConfig=} [properties] Properties to set + */ + function AutoscalingConfig(properties) { + this.asymmetricAutoscalingOptions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AutoscalingConfig autoscalingLimits. + * @member {google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingLimits|null|undefined} autoscalingLimits + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig + * @instance + */ + AutoscalingConfig.prototype.autoscalingLimits = null; + + /** + * AutoscalingConfig autoscalingTargets. + * @member {google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingTargets|null|undefined} autoscalingTargets + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig + * @instance + */ + AutoscalingConfig.prototype.autoscalingTargets = null; + + /** + * AutoscalingConfig asymmetricAutoscalingOptions. + * @member {Array.} asymmetricAutoscalingOptions + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig + * @instance + */ + AutoscalingConfig.prototype.asymmetricAutoscalingOptions = $util.emptyArray; + + /** + * Creates a new AutoscalingConfig instance using the specified properties. + * @function create + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig + * @static + * @param {google.spanner.admin.instance.v1.IAutoscalingConfig=} [properties] Properties to set + * @returns {google.spanner.admin.instance.v1.AutoscalingConfig} AutoscalingConfig instance + */ + AutoscalingConfig.create = function create(properties) { + return new AutoscalingConfig(properties); + }; + + /** + * Encodes the specified AutoscalingConfig message. Does not implicitly {@link google.spanner.admin.instance.v1.AutoscalingConfig.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig + * @static + * @param {google.spanner.admin.instance.v1.IAutoscalingConfig} message AutoscalingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutoscalingConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.autoscalingLimits != null && Object.hasOwnProperty.call(message, "autoscalingLimits")) + $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits.encode(message.autoscalingLimits, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.autoscalingTargets != null && Object.hasOwnProperty.call(message, "autoscalingTargets")) + $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets.encode(message.autoscalingTargets, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.asymmetricAutoscalingOptions != null && message.asymmetricAutoscalingOptions.length) + for (var i = 0; i < message.asymmetricAutoscalingOptions.length; ++i) + $root.google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.encode(message.asymmetricAutoscalingOptions[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AutoscalingConfig message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.AutoscalingConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig + * @static + * @param {google.spanner.admin.instance.v1.IAutoscalingConfig} message AutoscalingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutoscalingConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AutoscalingConfig message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.instance.v1.AutoscalingConfig} AutoscalingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutoscalingConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.AutoscalingConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.autoscalingLimits = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits.decode(reader, reader.uint32()); + break; + } + case 2: { + message.autoscalingTargets = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.asymmetricAutoscalingOptions && message.asymmetricAutoscalingOptions.length)) + message.asymmetricAutoscalingOptions = []; + message.asymmetricAutoscalingOptions.push($root.google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AutoscalingConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.instance.v1.AutoscalingConfig} AutoscalingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutoscalingConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AutoscalingConfig message. + * @function verify + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AutoscalingConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.autoscalingLimits != null && message.hasOwnProperty("autoscalingLimits")) { + var error = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits.verify(message.autoscalingLimits); + if (error) + return "autoscalingLimits." + error; + } + if (message.autoscalingTargets != null && message.hasOwnProperty("autoscalingTargets")) { + var error = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets.verify(message.autoscalingTargets); + if (error) + return "autoscalingTargets." + error; + } + if (message.asymmetricAutoscalingOptions != null && message.hasOwnProperty("asymmetricAutoscalingOptions")) { + if (!Array.isArray(message.asymmetricAutoscalingOptions)) + return "asymmetricAutoscalingOptions: array expected"; + for (var i = 0; i < message.asymmetricAutoscalingOptions.length; ++i) { + var error = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.verify(message.asymmetricAutoscalingOptions[i]); + if (error) + return "asymmetricAutoscalingOptions." + error; + } + } + return null; + }; + + /** + * Creates an AutoscalingConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.instance.v1.AutoscalingConfig} AutoscalingConfig + */ + AutoscalingConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.instance.v1.AutoscalingConfig) + return object; + var message = new $root.google.spanner.admin.instance.v1.AutoscalingConfig(); + if (object.autoscalingLimits != null) { + if (typeof object.autoscalingLimits !== "object") + throw TypeError(".google.spanner.admin.instance.v1.AutoscalingConfig.autoscalingLimits: object expected"); + message.autoscalingLimits = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits.fromObject(object.autoscalingLimits); + } + if (object.autoscalingTargets != null) { + if (typeof object.autoscalingTargets !== "object") + throw TypeError(".google.spanner.admin.instance.v1.AutoscalingConfig.autoscalingTargets: object expected"); + message.autoscalingTargets = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets.fromObject(object.autoscalingTargets); + } + if (object.asymmetricAutoscalingOptions) { + if (!Array.isArray(object.asymmetricAutoscalingOptions)) + throw TypeError(".google.spanner.admin.instance.v1.AutoscalingConfig.asymmetricAutoscalingOptions: array expected"); + message.asymmetricAutoscalingOptions = []; + for (var i = 0; i < object.asymmetricAutoscalingOptions.length; ++i) { + if (typeof object.asymmetricAutoscalingOptions[i] !== "object") + throw TypeError(".google.spanner.admin.instance.v1.AutoscalingConfig.asymmetricAutoscalingOptions: object expected"); + message.asymmetricAutoscalingOptions[i] = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.fromObject(object.asymmetricAutoscalingOptions[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an AutoscalingConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig + * @static + * @param {google.spanner.admin.instance.v1.AutoscalingConfig} message AutoscalingConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AutoscalingConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.asymmetricAutoscalingOptions = []; + if (options.defaults) { + object.autoscalingLimits = null; + object.autoscalingTargets = null; + } + if (message.autoscalingLimits != null && message.hasOwnProperty("autoscalingLimits")) + object.autoscalingLimits = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits.toObject(message.autoscalingLimits, options); + if (message.autoscalingTargets != null && message.hasOwnProperty("autoscalingTargets")) + object.autoscalingTargets = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets.toObject(message.autoscalingTargets, options); + if (message.asymmetricAutoscalingOptions && message.asymmetricAutoscalingOptions.length) { + object.asymmetricAutoscalingOptions = []; + for (var j = 0; j < message.asymmetricAutoscalingOptions.length; ++j) + object.asymmetricAutoscalingOptions[j] = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.toObject(message.asymmetricAutoscalingOptions[j], options); + } + return object; + }; + + /** + * Converts this AutoscalingConfig to JSON. + * @function toJSON + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig + * @instance + * @returns {Object.} JSON object + */ + AutoscalingConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AutoscalingConfig + * @function getTypeUrl + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AutoscalingConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.instance.v1.AutoscalingConfig"; + }; + + AutoscalingConfig.AutoscalingLimits = (function() { + + /** + * Properties of an AutoscalingLimits. + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig + * @interface IAutoscalingLimits + * @property {number|null} [minNodes] AutoscalingLimits minNodes + * @property {number|null} [minProcessingUnits] AutoscalingLimits minProcessingUnits + * @property {number|null} [maxNodes] AutoscalingLimits maxNodes + * @property {number|null} [maxProcessingUnits] AutoscalingLimits maxProcessingUnits + */ + + /** + * Constructs a new AutoscalingLimits. + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig + * @classdesc Represents an AutoscalingLimits. + * @implements IAutoscalingLimits + * @constructor + * @param {google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingLimits=} [properties] Properties to set + */ + function AutoscalingLimits(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AutoscalingLimits minNodes. + * @member {number|null|undefined} minNodes + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits + * @instance + */ + AutoscalingLimits.prototype.minNodes = null; + + /** + * AutoscalingLimits minProcessingUnits. + * @member {number|null|undefined} minProcessingUnits + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits + * @instance + */ + AutoscalingLimits.prototype.minProcessingUnits = null; + + /** + * AutoscalingLimits maxNodes. + * @member {number|null|undefined} maxNodes + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits + * @instance + */ + AutoscalingLimits.prototype.maxNodes = null; + + /** + * AutoscalingLimits maxProcessingUnits. + * @member {number|null|undefined} maxProcessingUnits + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits + * @instance + */ + AutoscalingLimits.prototype.maxProcessingUnits = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AutoscalingLimits minLimit. + * @member {"minNodes"|"minProcessingUnits"|undefined} minLimit + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits + * @instance + */ + Object.defineProperty(AutoscalingLimits.prototype, "minLimit", { + get: $util.oneOfGetter($oneOfFields = ["minNodes", "minProcessingUnits"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AutoscalingLimits maxLimit. + * @member {"maxNodes"|"maxProcessingUnits"|undefined} maxLimit + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits + * @instance + */ + Object.defineProperty(AutoscalingLimits.prototype, "maxLimit", { + get: $util.oneOfGetter($oneOfFields = ["maxNodes", "maxProcessingUnits"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AutoscalingLimits instance using the specified properties. + * @function create + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits + * @static + * @param {google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingLimits=} [properties] Properties to set + * @returns {google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits} AutoscalingLimits instance + */ + AutoscalingLimits.create = function create(properties) { + return new AutoscalingLimits(properties); + }; + + /** + * Encodes the specified AutoscalingLimits message. Does not implicitly {@link google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits + * @static + * @param {google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingLimits} message AutoscalingLimits message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutoscalingLimits.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.minNodes != null && Object.hasOwnProperty.call(message, "minNodes")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.minNodes); + if (message.minProcessingUnits != null && Object.hasOwnProperty.call(message, "minProcessingUnits")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.minProcessingUnits); + if (message.maxNodes != null && Object.hasOwnProperty.call(message, "maxNodes")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.maxNodes); + if (message.maxProcessingUnits != null && Object.hasOwnProperty.call(message, "maxProcessingUnits")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.maxProcessingUnits); + return writer; + }; + + /** + * Encodes the specified AutoscalingLimits message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits + * @static + * @param {google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingLimits} message AutoscalingLimits message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutoscalingLimits.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AutoscalingLimits message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits} AutoscalingLimits + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutoscalingLimits.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.minNodes = reader.int32(); + break; + } + case 2: { + message.minProcessingUnits = reader.int32(); + break; + } + case 3: { + message.maxNodes = reader.int32(); + break; + } + case 4: { + message.maxProcessingUnits = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AutoscalingLimits message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits} AutoscalingLimits + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutoscalingLimits.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AutoscalingLimits message. + * @function verify + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AutoscalingLimits.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.minNodes != null && message.hasOwnProperty("minNodes")) { + properties.minLimit = 1; + if (!$util.isInteger(message.minNodes)) + return "minNodes: integer expected"; + } + if (message.minProcessingUnits != null && message.hasOwnProperty("minProcessingUnits")) { + if (properties.minLimit === 1) + return "minLimit: multiple values"; + properties.minLimit = 1; + if (!$util.isInteger(message.minProcessingUnits)) + return "minProcessingUnits: integer expected"; + } + if (message.maxNodes != null && message.hasOwnProperty("maxNodes")) { + properties.maxLimit = 1; + if (!$util.isInteger(message.maxNodes)) + return "maxNodes: integer expected"; + } + if (message.maxProcessingUnits != null && message.hasOwnProperty("maxProcessingUnits")) { + if (properties.maxLimit === 1) + return "maxLimit: multiple values"; + properties.maxLimit = 1; + if (!$util.isInteger(message.maxProcessingUnits)) + return "maxProcessingUnits: integer expected"; + } + return null; + }; + + /** + * Creates an AutoscalingLimits message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits} AutoscalingLimits + */ + AutoscalingLimits.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits) + return object; + var message = new $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits(); + if (object.minNodes != null) + message.minNodes = object.minNodes | 0; + if (object.minProcessingUnits != null) + message.minProcessingUnits = object.minProcessingUnits | 0; + if (object.maxNodes != null) + message.maxNodes = object.maxNodes | 0; + if (object.maxProcessingUnits != null) + message.maxProcessingUnits = object.maxProcessingUnits | 0; + return message; + }; + + /** + * Creates a plain object from an AutoscalingLimits message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits + * @static + * @param {google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits} message AutoscalingLimits + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AutoscalingLimits.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.minNodes != null && message.hasOwnProperty("minNodes")) { + object.minNodes = message.minNodes; + if (options.oneofs) + object.minLimit = "minNodes"; + } + if (message.minProcessingUnits != null && message.hasOwnProperty("minProcessingUnits")) { + object.minProcessingUnits = message.minProcessingUnits; + if (options.oneofs) + object.minLimit = "minProcessingUnits"; + } + if (message.maxNodes != null && message.hasOwnProperty("maxNodes")) { + object.maxNodes = message.maxNodes; + if (options.oneofs) + object.maxLimit = "maxNodes"; + } + if (message.maxProcessingUnits != null && message.hasOwnProperty("maxProcessingUnits")) { + object.maxProcessingUnits = message.maxProcessingUnits; + if (options.oneofs) + object.maxLimit = "maxProcessingUnits"; + } + return object; + }; + + /** + * Converts this AutoscalingLimits to JSON. + * @function toJSON + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits + * @instance + * @returns {Object.} JSON object + */ + AutoscalingLimits.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AutoscalingLimits + * @function getTypeUrl + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AutoscalingLimits.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits"; + }; + + return AutoscalingLimits; + })(); + + AutoscalingConfig.AutoscalingTargets = (function() { + + /** + * Properties of an AutoscalingTargets. + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig + * @interface IAutoscalingTargets + * @property {number|null} [highPriorityCpuUtilizationPercent] AutoscalingTargets highPriorityCpuUtilizationPercent + * @property {number|null} [totalCpuUtilizationPercent] AutoscalingTargets totalCpuUtilizationPercent + * @property {number|null} [storageUtilizationPercent] AutoscalingTargets storageUtilizationPercent + */ + + /** + * Constructs a new AutoscalingTargets. + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig + * @classdesc Represents an AutoscalingTargets. + * @implements IAutoscalingTargets + * @constructor + * @param {google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingTargets=} [properties] Properties to set + */ + function AutoscalingTargets(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AutoscalingTargets highPriorityCpuUtilizationPercent. + * @member {number} highPriorityCpuUtilizationPercent + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets + * @instance + */ + AutoscalingTargets.prototype.highPriorityCpuUtilizationPercent = 0; + + /** + * AutoscalingTargets totalCpuUtilizationPercent. + * @member {number} totalCpuUtilizationPercent + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets + * @instance + */ + AutoscalingTargets.prototype.totalCpuUtilizationPercent = 0; + + /** + * AutoscalingTargets storageUtilizationPercent. + * @member {number} storageUtilizationPercent + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets + * @instance + */ + AutoscalingTargets.prototype.storageUtilizationPercent = 0; + + /** + * Creates a new AutoscalingTargets instance using the specified properties. + * @function create + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets + * @static + * @param {google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingTargets=} [properties] Properties to set + * @returns {google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets} AutoscalingTargets instance + */ + AutoscalingTargets.create = function create(properties) { + return new AutoscalingTargets(properties); + }; + + /** + * Encodes the specified AutoscalingTargets message. Does not implicitly {@link google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets + * @static + * @param {google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingTargets} message AutoscalingTargets message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutoscalingTargets.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.highPriorityCpuUtilizationPercent != null && Object.hasOwnProperty.call(message, "highPriorityCpuUtilizationPercent")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.highPriorityCpuUtilizationPercent); + if (message.storageUtilizationPercent != null && Object.hasOwnProperty.call(message, "storageUtilizationPercent")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.storageUtilizationPercent); + if (message.totalCpuUtilizationPercent != null && Object.hasOwnProperty.call(message, "totalCpuUtilizationPercent")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.totalCpuUtilizationPercent); + return writer; + }; + + /** + * Encodes the specified AutoscalingTargets message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets + * @static + * @param {google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingTargets} message AutoscalingTargets message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutoscalingTargets.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AutoscalingTargets message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets} AutoscalingTargets + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutoscalingTargets.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.highPriorityCpuUtilizationPercent = reader.int32(); + break; + } + case 4: { + message.totalCpuUtilizationPercent = reader.int32(); + break; + } + case 2: { + message.storageUtilizationPercent = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AutoscalingTargets message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets} AutoscalingTargets + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutoscalingTargets.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AutoscalingTargets message. + * @function verify + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AutoscalingTargets.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.highPriorityCpuUtilizationPercent != null && message.hasOwnProperty("highPriorityCpuUtilizationPercent")) + if (!$util.isInteger(message.highPriorityCpuUtilizationPercent)) + return "highPriorityCpuUtilizationPercent: integer expected"; + if (message.totalCpuUtilizationPercent != null && message.hasOwnProperty("totalCpuUtilizationPercent")) + if (!$util.isInteger(message.totalCpuUtilizationPercent)) + return "totalCpuUtilizationPercent: integer expected"; + if (message.storageUtilizationPercent != null && message.hasOwnProperty("storageUtilizationPercent")) + if (!$util.isInteger(message.storageUtilizationPercent)) + return "storageUtilizationPercent: integer expected"; + return null; + }; + + /** + * Creates an AutoscalingTargets message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets} AutoscalingTargets + */ + AutoscalingTargets.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets) + return object; + var message = new $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets(); + if (object.highPriorityCpuUtilizationPercent != null) + message.highPriorityCpuUtilizationPercent = object.highPriorityCpuUtilizationPercent | 0; + if (object.totalCpuUtilizationPercent != null) + message.totalCpuUtilizationPercent = object.totalCpuUtilizationPercent | 0; + if (object.storageUtilizationPercent != null) + message.storageUtilizationPercent = object.storageUtilizationPercent | 0; + return message; + }; + + /** + * Creates a plain object from an AutoscalingTargets message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets + * @static + * @param {google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets} message AutoscalingTargets + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AutoscalingTargets.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.highPriorityCpuUtilizationPercent = 0; + object.storageUtilizationPercent = 0; + object.totalCpuUtilizationPercent = 0; + } + if (message.highPriorityCpuUtilizationPercent != null && message.hasOwnProperty("highPriorityCpuUtilizationPercent")) + object.highPriorityCpuUtilizationPercent = message.highPriorityCpuUtilizationPercent; + if (message.storageUtilizationPercent != null && message.hasOwnProperty("storageUtilizationPercent")) + object.storageUtilizationPercent = message.storageUtilizationPercent; + if (message.totalCpuUtilizationPercent != null && message.hasOwnProperty("totalCpuUtilizationPercent")) + object.totalCpuUtilizationPercent = message.totalCpuUtilizationPercent; + return object; + }; + + /** + * Converts this AutoscalingTargets to JSON. + * @function toJSON + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets + * @instance + * @returns {Object.} JSON object + */ + AutoscalingTargets.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AutoscalingTargets + * @function getTypeUrl + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AutoscalingTargets.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets"; + }; + + return AutoscalingTargets; + })(); + + AutoscalingConfig.AsymmetricAutoscalingOption = (function() { + + /** + * Properties of an AsymmetricAutoscalingOption. + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig + * @interface IAsymmetricAutoscalingOption + * @property {google.spanner.admin.instance.v1.IReplicaSelection|null} [replicaSelection] AsymmetricAutoscalingOption replicaSelection + * @property {google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.IAutoscalingConfigOverrides|null} [overrides] AsymmetricAutoscalingOption overrides + */ + + /** + * Constructs a new AsymmetricAutoscalingOption. + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig + * @classdesc Represents an AsymmetricAutoscalingOption. + * @implements IAsymmetricAutoscalingOption + * @constructor + * @param {google.spanner.admin.instance.v1.AutoscalingConfig.IAsymmetricAutoscalingOption=} [properties] Properties to set + */ + function AsymmetricAutoscalingOption(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AsymmetricAutoscalingOption replicaSelection. + * @member {google.spanner.admin.instance.v1.IReplicaSelection|null|undefined} replicaSelection + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption + * @instance + */ + AsymmetricAutoscalingOption.prototype.replicaSelection = null; + + /** + * AsymmetricAutoscalingOption overrides. + * @member {google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.IAutoscalingConfigOverrides|null|undefined} overrides + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption + * @instance + */ + AsymmetricAutoscalingOption.prototype.overrides = null; + + /** + * Creates a new AsymmetricAutoscalingOption instance using the specified properties. + * @function create + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption + * @static + * @param {google.spanner.admin.instance.v1.AutoscalingConfig.IAsymmetricAutoscalingOption=} [properties] Properties to set + * @returns {google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption} AsymmetricAutoscalingOption instance + */ + AsymmetricAutoscalingOption.create = function create(properties) { + return new AsymmetricAutoscalingOption(properties); + }; + + /** + * Encodes the specified AsymmetricAutoscalingOption message. Does not implicitly {@link google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption + * @static + * @param {google.spanner.admin.instance.v1.AutoscalingConfig.IAsymmetricAutoscalingOption} message AsymmetricAutoscalingOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AsymmetricAutoscalingOption.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.replicaSelection != null && Object.hasOwnProperty.call(message, "replicaSelection")) + $root.google.spanner.admin.instance.v1.ReplicaSelection.encode(message.replicaSelection, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.overrides != null && Object.hasOwnProperty.call(message, "overrides")) + $root.google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides.encode(message.overrides, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AsymmetricAutoscalingOption message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption + * @static + * @param {google.spanner.admin.instance.v1.AutoscalingConfig.IAsymmetricAutoscalingOption} message AsymmetricAutoscalingOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AsymmetricAutoscalingOption.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AsymmetricAutoscalingOption message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption} AsymmetricAutoscalingOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AsymmetricAutoscalingOption.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.replicaSelection = $root.google.spanner.admin.instance.v1.ReplicaSelection.decode(reader, reader.uint32()); + break; + } + case 2: { + message.overrides = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AsymmetricAutoscalingOption message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption} AsymmetricAutoscalingOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AsymmetricAutoscalingOption.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AsymmetricAutoscalingOption message. + * @function verify + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AsymmetricAutoscalingOption.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.replicaSelection != null && message.hasOwnProperty("replicaSelection")) { + var error = $root.google.spanner.admin.instance.v1.ReplicaSelection.verify(message.replicaSelection); + if (error) + return "replicaSelection." + error; + } + if (message.overrides != null && message.hasOwnProperty("overrides")) { + var error = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides.verify(message.overrides); + if (error) + return "overrides." + error; + } + return null; + }; + + /** + * Creates an AsymmetricAutoscalingOption message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption} AsymmetricAutoscalingOption + */ + AsymmetricAutoscalingOption.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption) + return object; + var message = new $root.google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption(); + if (object.replicaSelection != null) { + if (typeof object.replicaSelection !== "object") + throw TypeError(".google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.replicaSelection: object expected"); + message.replicaSelection = $root.google.spanner.admin.instance.v1.ReplicaSelection.fromObject(object.replicaSelection); + } + if (object.overrides != null) { + if (typeof object.overrides !== "object") + throw TypeError(".google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.overrides: object expected"); + message.overrides = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides.fromObject(object.overrides); + } + return message; + }; + + /** + * Creates a plain object from an AsymmetricAutoscalingOption message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption + * @static + * @param {google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption} message AsymmetricAutoscalingOption + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AsymmetricAutoscalingOption.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.replicaSelection = null; + object.overrides = null; + } + if (message.replicaSelection != null && message.hasOwnProperty("replicaSelection")) + object.replicaSelection = $root.google.spanner.admin.instance.v1.ReplicaSelection.toObject(message.replicaSelection, options); + if (message.overrides != null && message.hasOwnProperty("overrides")) + object.overrides = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides.toObject(message.overrides, options); + return object; + }; + + /** + * Converts this AsymmetricAutoscalingOption to JSON. + * @function toJSON + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption + * @instance + * @returns {Object.} JSON object + */ + AsymmetricAutoscalingOption.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AsymmetricAutoscalingOption + * @function getTypeUrl + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AsymmetricAutoscalingOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption"; + }; + + AsymmetricAutoscalingOption.AutoscalingConfigOverrides = (function() { + + /** + * Properties of an AutoscalingConfigOverrides. + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption + * @interface IAutoscalingConfigOverrides + * @property {google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingLimits|null} [autoscalingLimits] AutoscalingConfigOverrides autoscalingLimits + * @property {number|null} [autoscalingTargetHighPriorityCpuUtilizationPercent] AutoscalingConfigOverrides autoscalingTargetHighPriorityCpuUtilizationPercent + * @property {number|null} [autoscalingTargetTotalCpuUtilizationPercent] AutoscalingConfigOverrides autoscalingTargetTotalCpuUtilizationPercent + * @property {boolean|null} [disableHighPriorityCpuAutoscaling] AutoscalingConfigOverrides disableHighPriorityCpuAutoscaling + * @property {boolean|null} [disableTotalCpuAutoscaling] AutoscalingConfigOverrides disableTotalCpuAutoscaling + */ + + /** + * Constructs a new AutoscalingConfigOverrides. + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption + * @classdesc Represents an AutoscalingConfigOverrides. + * @implements IAutoscalingConfigOverrides + * @constructor + * @param {google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.IAutoscalingConfigOverrides=} [properties] Properties to set + */ + function AutoscalingConfigOverrides(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AutoscalingConfigOverrides autoscalingLimits. + * @member {google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingLimits|null|undefined} autoscalingLimits + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides + * @instance + */ + AutoscalingConfigOverrides.prototype.autoscalingLimits = null; + + /** + * AutoscalingConfigOverrides autoscalingTargetHighPriorityCpuUtilizationPercent. + * @member {number} autoscalingTargetHighPriorityCpuUtilizationPercent + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides + * @instance + */ + AutoscalingConfigOverrides.prototype.autoscalingTargetHighPriorityCpuUtilizationPercent = 0; + + /** + * AutoscalingConfigOverrides autoscalingTargetTotalCpuUtilizationPercent. + * @member {number} autoscalingTargetTotalCpuUtilizationPercent + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides + * @instance + */ + AutoscalingConfigOverrides.prototype.autoscalingTargetTotalCpuUtilizationPercent = 0; + + /** + * AutoscalingConfigOverrides disableHighPriorityCpuAutoscaling. + * @member {boolean} disableHighPriorityCpuAutoscaling + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides + * @instance + */ + AutoscalingConfigOverrides.prototype.disableHighPriorityCpuAutoscaling = false; + + /** + * AutoscalingConfigOverrides disableTotalCpuAutoscaling. + * @member {boolean} disableTotalCpuAutoscaling + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides + * @instance + */ + AutoscalingConfigOverrides.prototype.disableTotalCpuAutoscaling = false; + + /** + * Creates a new AutoscalingConfigOverrides instance using the specified properties. + * @function create + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides + * @static + * @param {google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.IAutoscalingConfigOverrides=} [properties] Properties to set + * @returns {google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides} AutoscalingConfigOverrides instance + */ + AutoscalingConfigOverrides.create = function create(properties) { + return new AutoscalingConfigOverrides(properties); + }; + + /** + * Encodes the specified AutoscalingConfigOverrides message. Does not implicitly {@link google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides + * @static + * @param {google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.IAutoscalingConfigOverrides} message AutoscalingConfigOverrides message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutoscalingConfigOverrides.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.autoscalingLimits != null && Object.hasOwnProperty.call(message, "autoscalingLimits")) + $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits.encode(message.autoscalingLimits, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.autoscalingTargetHighPriorityCpuUtilizationPercent != null && Object.hasOwnProperty.call(message, "autoscalingTargetHighPriorityCpuUtilizationPercent")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.autoscalingTargetHighPriorityCpuUtilizationPercent); + if (message.autoscalingTargetTotalCpuUtilizationPercent != null && Object.hasOwnProperty.call(message, "autoscalingTargetTotalCpuUtilizationPercent")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.autoscalingTargetTotalCpuUtilizationPercent); + if (message.disableHighPriorityCpuAutoscaling != null && Object.hasOwnProperty.call(message, "disableHighPriorityCpuAutoscaling")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.disableHighPriorityCpuAutoscaling); + if (message.disableTotalCpuAutoscaling != null && Object.hasOwnProperty.call(message, "disableTotalCpuAutoscaling")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.disableTotalCpuAutoscaling); + return writer; + }; + + /** + * Encodes the specified AutoscalingConfigOverrides message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides + * @static + * @param {google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.IAutoscalingConfigOverrides} message AutoscalingConfigOverrides message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutoscalingConfigOverrides.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AutoscalingConfigOverrides message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides} AutoscalingConfigOverrides + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutoscalingConfigOverrides.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.autoscalingLimits = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits.decode(reader, reader.uint32()); + break; + } + case 2: { + message.autoscalingTargetHighPriorityCpuUtilizationPercent = reader.int32(); + break; + } + case 4: { + message.autoscalingTargetTotalCpuUtilizationPercent = reader.int32(); + break; + } + case 5: { + message.disableHighPriorityCpuAutoscaling = reader.bool(); + break; + } + case 6: { + message.disableTotalCpuAutoscaling = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AutoscalingConfigOverrides message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides} AutoscalingConfigOverrides + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutoscalingConfigOverrides.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AutoscalingConfigOverrides message. + * @function verify + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AutoscalingConfigOverrides.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.autoscalingLimits != null && message.hasOwnProperty("autoscalingLimits")) { + var error = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits.verify(message.autoscalingLimits); + if (error) + return "autoscalingLimits." + error; + } + if (message.autoscalingTargetHighPriorityCpuUtilizationPercent != null && message.hasOwnProperty("autoscalingTargetHighPriorityCpuUtilizationPercent")) + if (!$util.isInteger(message.autoscalingTargetHighPriorityCpuUtilizationPercent)) + return "autoscalingTargetHighPriorityCpuUtilizationPercent: integer expected"; + if (message.autoscalingTargetTotalCpuUtilizationPercent != null && message.hasOwnProperty("autoscalingTargetTotalCpuUtilizationPercent")) + if (!$util.isInteger(message.autoscalingTargetTotalCpuUtilizationPercent)) + return "autoscalingTargetTotalCpuUtilizationPercent: integer expected"; + if (message.disableHighPriorityCpuAutoscaling != null && message.hasOwnProperty("disableHighPriorityCpuAutoscaling")) + if (typeof message.disableHighPriorityCpuAutoscaling !== "boolean") + return "disableHighPriorityCpuAutoscaling: boolean expected"; + if (message.disableTotalCpuAutoscaling != null && message.hasOwnProperty("disableTotalCpuAutoscaling")) + if (typeof message.disableTotalCpuAutoscaling !== "boolean") + return "disableTotalCpuAutoscaling: boolean expected"; + return null; + }; + + /** + * Creates an AutoscalingConfigOverrides message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides} AutoscalingConfigOverrides + */ + AutoscalingConfigOverrides.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides) + return object; + var message = new $root.google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides(); + if (object.autoscalingLimits != null) { + if (typeof object.autoscalingLimits !== "object") + throw TypeError(".google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides.autoscalingLimits: object expected"); + message.autoscalingLimits = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits.fromObject(object.autoscalingLimits); + } + if (object.autoscalingTargetHighPriorityCpuUtilizationPercent != null) + message.autoscalingTargetHighPriorityCpuUtilizationPercent = object.autoscalingTargetHighPriorityCpuUtilizationPercent | 0; + if (object.autoscalingTargetTotalCpuUtilizationPercent != null) + message.autoscalingTargetTotalCpuUtilizationPercent = object.autoscalingTargetTotalCpuUtilizationPercent | 0; + if (object.disableHighPriorityCpuAutoscaling != null) + message.disableHighPriorityCpuAutoscaling = Boolean(object.disableHighPriorityCpuAutoscaling); + if (object.disableTotalCpuAutoscaling != null) + message.disableTotalCpuAutoscaling = Boolean(object.disableTotalCpuAutoscaling); + return message; + }; + + /** + * Creates a plain object from an AutoscalingConfigOverrides message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides + * @static + * @param {google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides} message AutoscalingConfigOverrides + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AutoscalingConfigOverrides.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.autoscalingLimits = null; + object.autoscalingTargetHighPriorityCpuUtilizationPercent = 0; + object.autoscalingTargetTotalCpuUtilizationPercent = 0; + object.disableHighPriorityCpuAutoscaling = false; + object.disableTotalCpuAutoscaling = false; + } + if (message.autoscalingLimits != null && message.hasOwnProperty("autoscalingLimits")) + object.autoscalingLimits = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits.toObject(message.autoscalingLimits, options); + if (message.autoscalingTargetHighPriorityCpuUtilizationPercent != null && message.hasOwnProperty("autoscalingTargetHighPriorityCpuUtilizationPercent")) + object.autoscalingTargetHighPriorityCpuUtilizationPercent = message.autoscalingTargetHighPriorityCpuUtilizationPercent; + if (message.autoscalingTargetTotalCpuUtilizationPercent != null && message.hasOwnProperty("autoscalingTargetTotalCpuUtilizationPercent")) + object.autoscalingTargetTotalCpuUtilizationPercent = message.autoscalingTargetTotalCpuUtilizationPercent; + if (message.disableHighPriorityCpuAutoscaling != null && message.hasOwnProperty("disableHighPriorityCpuAutoscaling")) + object.disableHighPriorityCpuAutoscaling = message.disableHighPriorityCpuAutoscaling; + if (message.disableTotalCpuAutoscaling != null && message.hasOwnProperty("disableTotalCpuAutoscaling")) + object.disableTotalCpuAutoscaling = message.disableTotalCpuAutoscaling; + return object; + }; + + /** + * Converts this AutoscalingConfigOverrides to JSON. + * @function toJSON + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides + * @instance + * @returns {Object.} JSON object + */ + AutoscalingConfigOverrides.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AutoscalingConfigOverrides + * @function getTypeUrl + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AutoscalingConfigOverrides.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides"; + }; + + return AutoscalingConfigOverrides; + })(); + + return AsymmetricAutoscalingOption; + })(); + + return AutoscalingConfig; + })(); + + v1.Instance = (function() { + + /** + * Properties of an Instance. + * @memberof google.spanner.admin.instance.v1 + * @interface IInstance + * @property {string|null} [name] Instance name + * @property {string|null} [config] Instance config + * @property {string|null} [displayName] Instance displayName + * @property {number|null} [nodeCount] Instance nodeCount + * @property {number|null} [processingUnits] Instance processingUnits + * @property {Array.|null} [replicaComputeCapacity] Instance replicaComputeCapacity + * @property {google.spanner.admin.instance.v1.IAutoscalingConfig|null} [autoscalingConfig] Instance autoscalingConfig + * @property {google.spanner.admin.instance.v1.Instance.State|null} [state] Instance state + * @property {Object.|null} [labels] Instance labels + * @property {google.spanner.admin.instance.v1.Instance.InstanceType|null} [instanceType] Instance instanceType + * @property {Array.|null} [endpointUris] Instance endpointUris + * @property {google.protobuf.ITimestamp|null} [createTime] Instance createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Instance updateTime + * @property {google.spanner.admin.instance.v1.IFreeInstanceMetadata|null} [freeInstanceMetadata] Instance freeInstanceMetadata + * @property {google.spanner.admin.instance.v1.Instance.Edition|null} [edition] Instance edition + * @property {google.spanner.admin.instance.v1.Instance.DefaultBackupScheduleType|null} [defaultBackupScheduleType] Instance defaultBackupScheduleType + */ + + /** + * Constructs a new Instance. + * @memberof google.spanner.admin.instance.v1 + * @classdesc Represents an Instance. + * @implements IInstance + * @constructor + * @param {google.spanner.admin.instance.v1.IInstance=} [properties] Properties to set + */ + function Instance(properties) { + this.replicaComputeCapacity = []; + this.labels = {}; + this.endpointUris = []; + if (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.spanner.admin.instance.v1.Instance + * @instance + */ + Instance.prototype.name = ""; + + /** + * Instance config. + * @member {string} config + * @memberof google.spanner.admin.instance.v1.Instance + * @instance + */ + Instance.prototype.config = ""; + + /** + * Instance displayName. + * @member {string} displayName + * @memberof google.spanner.admin.instance.v1.Instance + * @instance + */ + Instance.prototype.displayName = ""; + + /** + * Instance nodeCount. + * @member {number} nodeCount + * @memberof google.spanner.admin.instance.v1.Instance + * @instance + */ + Instance.prototype.nodeCount = 0; + + /** + * Instance processingUnits. + * @member {number} processingUnits + * @memberof google.spanner.admin.instance.v1.Instance + * @instance + */ + Instance.prototype.processingUnits = 0; + + /** + * Instance replicaComputeCapacity. + * @member {Array.} replicaComputeCapacity + * @memberof google.spanner.admin.instance.v1.Instance + * @instance + */ + Instance.prototype.replicaComputeCapacity = $util.emptyArray; + + /** + * Instance autoscalingConfig. + * @member {google.spanner.admin.instance.v1.IAutoscalingConfig|null|undefined} autoscalingConfig + * @memberof google.spanner.admin.instance.v1.Instance + * @instance + */ + Instance.prototype.autoscalingConfig = null; + + /** + * Instance state. + * @member {google.spanner.admin.instance.v1.Instance.State} state + * @memberof google.spanner.admin.instance.v1.Instance + * @instance + */ + Instance.prototype.state = 0; + + /** + * Instance labels. + * @member {Object.} labels + * @memberof google.spanner.admin.instance.v1.Instance + * @instance + */ + Instance.prototype.labels = $util.emptyObject; + + /** + * Instance instanceType. + * @member {google.spanner.admin.instance.v1.Instance.InstanceType} instanceType + * @memberof google.spanner.admin.instance.v1.Instance + * @instance + */ + Instance.prototype.instanceType = 0; + + /** + * Instance endpointUris. + * @member {Array.} endpointUris + * @memberof google.spanner.admin.instance.v1.Instance + * @instance + */ + Instance.prototype.endpointUris = $util.emptyArray; + + /** + * Instance createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.spanner.admin.instance.v1.Instance + * @instance + */ + Instance.prototype.createTime = null; + + /** + * Instance updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.spanner.admin.instance.v1.Instance + * @instance + */ + Instance.prototype.updateTime = null; + + /** + * Instance freeInstanceMetadata. + * @member {google.spanner.admin.instance.v1.IFreeInstanceMetadata|null|undefined} freeInstanceMetadata + * @memberof google.spanner.admin.instance.v1.Instance + * @instance + */ + Instance.prototype.freeInstanceMetadata = null; + + /** + * Instance edition. + * @member {google.spanner.admin.instance.v1.Instance.Edition} edition + * @memberof google.spanner.admin.instance.v1.Instance + * @instance + */ + Instance.prototype.edition = 0; + + /** + * Instance defaultBackupScheduleType. + * @member {google.spanner.admin.instance.v1.Instance.DefaultBackupScheduleType} defaultBackupScheduleType + * @memberof google.spanner.admin.instance.v1.Instance + * @instance + */ + Instance.prototype.defaultBackupScheduleType = 0; + + /** + * Creates a new Instance instance using the specified properties. + * @function create + * @memberof google.spanner.admin.instance.v1.Instance + * @static + * @param {google.spanner.admin.instance.v1.IInstance=} [properties] Properties to set + * @returns {google.spanner.admin.instance.v1.Instance} Instance instance + */ + Instance.create = function create(properties) { + return new Instance(properties); + }; + + /** + * Encodes the specified Instance message. Does not implicitly {@link google.spanner.admin.instance.v1.Instance.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.instance.v1.Instance + * @static + * @param {google.spanner.admin.instance.v1.IInstance} message Instance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Instance.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.config != null && Object.hasOwnProperty.call(message, "config")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.config); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.displayName); + if (message.nodeCount != null && Object.hasOwnProperty.call(message, "nodeCount")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.nodeCount); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.state); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.endpointUris != null && message.endpointUris.length) + for (var i = 0; i < message.endpointUris.length; ++i) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.endpointUris[i]); + if (message.processingUnits != null && Object.hasOwnProperty.call(message, "processingUnits")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.processingUnits); + if (message.instanceType != null && Object.hasOwnProperty.call(message, "instanceType")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.instanceType); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.freeInstanceMetadata != null && Object.hasOwnProperty.call(message, "freeInstanceMetadata")) + $root.google.spanner.admin.instance.v1.FreeInstanceMetadata.encode(message.freeInstanceMetadata, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.autoscalingConfig != null && Object.hasOwnProperty.call(message, "autoscalingConfig")) + $root.google.spanner.admin.instance.v1.AutoscalingConfig.encode(message.autoscalingConfig, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.replicaComputeCapacity != null && message.replicaComputeCapacity.length) + for (var i = 0; i < message.replicaComputeCapacity.length; ++i) + $root.google.spanner.admin.instance.v1.ReplicaComputeCapacity.encode(message.replicaComputeCapacity[i], writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 20, wireType 0 =*/160).int32(message.edition); + if (message.defaultBackupScheduleType != null && Object.hasOwnProperty.call(message, "defaultBackupScheduleType")) + writer.uint32(/* id 23, wireType 0 =*/184).int32(message.defaultBackupScheduleType); + return writer; + }; + + /** + * Encodes the specified Instance message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.Instance.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.instance.v1.Instance + * @static + * @param {google.spanner.admin.instance.v1.IInstance} message Instance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Instance.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Instance message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.instance.v1.Instance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.instance.v1.Instance} Instance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Instance.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.Instance(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.config = reader.string(); + break; + } + case 3: { + message.displayName = reader.string(); + break; + } + case 5: { + message.nodeCount = reader.int32(); + break; + } + case 9: { + message.processingUnits = reader.int32(); + break; + } + case 19: { + if (!(message.replicaComputeCapacity && message.replicaComputeCapacity.length)) + message.replicaComputeCapacity = []; + message.replicaComputeCapacity.push($root.google.spanner.admin.instance.v1.ReplicaComputeCapacity.decode(reader, reader.uint32())); + break; + } + case 17: { + message.autoscalingConfig = $root.google.spanner.admin.instance.v1.AutoscalingConfig.decode(reader, reader.uint32()); + break; + } + case 6: { + message.state = reader.int32(); + break; + } + case 7: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 10: { + message.instanceType = reader.int32(); + break; + } + case 8: { + if (!(message.endpointUris && message.endpointUris.length)) + message.endpointUris = []; + message.endpointUris.push(reader.string()); + break; + } + case 11: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 12: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 13: { + message.freeInstanceMetadata = $root.google.spanner.admin.instance.v1.FreeInstanceMetadata.decode(reader, reader.uint32()); + break; + } + case 20: { + message.edition = reader.int32(); + break; + } + case 23: { + message.defaultBackupScheduleType = reader.int32(); + 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.spanner.admin.instance.v1.Instance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.instance.v1.Instance} Instance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Instance.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Instance message. + * @function verify + * @memberof google.spanner.admin.instance.v1.Instance + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Instance.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.config != null && message.hasOwnProperty("config")) + if (!$util.isString(message.config)) + return "config: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + if (!$util.isInteger(message.nodeCount)) + return "nodeCount: integer expected"; + if (message.processingUnits != null && message.hasOwnProperty("processingUnits")) + if (!$util.isInteger(message.processingUnits)) + return "processingUnits: integer expected"; + if (message.replicaComputeCapacity != null && message.hasOwnProperty("replicaComputeCapacity")) { + if (!Array.isArray(message.replicaComputeCapacity)) + return "replicaComputeCapacity: array expected"; + for (var i = 0; i < message.replicaComputeCapacity.length; ++i) { + var error = $root.google.spanner.admin.instance.v1.ReplicaComputeCapacity.verify(message.replicaComputeCapacity[i]); + if (error) + return "replicaComputeCapacity." + error; + } + } + if (message.autoscalingConfig != null && message.hasOwnProperty("autoscalingConfig")) { + var error = $root.google.spanner.admin.instance.v1.AutoscalingConfig.verify(message.autoscalingConfig); + if (error) + return "autoscalingConfig." + 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.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.instanceType != null && message.hasOwnProperty("instanceType")) + switch (message.instanceType) { + default: + return "instanceType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.endpointUris != null && message.hasOwnProperty("endpointUris")) { + if (!Array.isArray(message.endpointUris)) + return "endpointUris: array expected"; + for (var i = 0; i < message.endpointUris.length; ++i) + if (!$util.isString(message.endpointUris[i])) + return "endpointUris: string[] expected"; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.freeInstanceMetadata != null && message.hasOwnProperty("freeInstanceMetadata")) { + var error = $root.google.spanner.admin.instance.v1.FreeInstanceMetadata.verify(message.freeInstanceMetadata); + if (error) + return "freeInstanceMetadata." + error; + } + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.defaultBackupScheduleType != null && message.hasOwnProperty("defaultBackupScheduleType")) + switch (message.defaultBackupScheduleType) { + default: + return "defaultBackupScheduleType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an Instance message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.instance.v1.Instance + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.instance.v1.Instance} Instance + */ + Instance.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.instance.v1.Instance) + return object; + var message = new $root.google.spanner.admin.instance.v1.Instance(); + if (object.name != null) + message.name = String(object.name); + if (object.config != null) + message.config = String(object.config); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.nodeCount != null) + message.nodeCount = object.nodeCount | 0; + if (object.processingUnits != null) + message.processingUnits = object.processingUnits | 0; + if (object.replicaComputeCapacity) { + if (!Array.isArray(object.replicaComputeCapacity)) + throw TypeError(".google.spanner.admin.instance.v1.Instance.replicaComputeCapacity: array expected"); + message.replicaComputeCapacity = []; + for (var i = 0; i < object.replicaComputeCapacity.length; ++i) { + if (typeof object.replicaComputeCapacity[i] !== "object") + throw TypeError(".google.spanner.admin.instance.v1.Instance.replicaComputeCapacity: object expected"); + message.replicaComputeCapacity[i] = $root.google.spanner.admin.instance.v1.ReplicaComputeCapacity.fromObject(object.replicaComputeCapacity[i]); + } + } + if (object.autoscalingConfig != null) { + if (typeof object.autoscalingConfig !== "object") + throw TypeError(".google.spanner.admin.instance.v1.Instance.autoscalingConfig: object expected"); + message.autoscalingConfig = $root.google.spanner.admin.instance.v1.AutoscalingConfig.fromObject(object.autoscalingConfig); + } + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "CREATING": + case 1: + message.state = 1; + break; + case "READY": + case 2: + message.state = 2; + break; + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.spanner.admin.instance.v1.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]]); + } + switch (object.instanceType) { + default: + if (typeof object.instanceType === "number") { + message.instanceType = object.instanceType; + break; + } + break; + case "INSTANCE_TYPE_UNSPECIFIED": + case 0: + message.instanceType = 0; + break; + case "PROVISIONED": + case 1: + message.instanceType = 1; + break; + case "FREE_INSTANCE": + case 2: + message.instanceType = 2; + break; + } + if (object.endpointUris) { + if (!Array.isArray(object.endpointUris)) + throw TypeError(".google.spanner.admin.instance.v1.Instance.endpointUris: array expected"); + message.endpointUris = []; + for (var i = 0; i < object.endpointUris.length; ++i) + message.endpointUris[i] = String(object.endpointUris[i]); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.spanner.admin.instance.v1.Instance.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.spanner.admin.instance.v1.Instance.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.freeInstanceMetadata != null) { + if (typeof object.freeInstanceMetadata !== "object") + throw TypeError(".google.spanner.admin.instance.v1.Instance.freeInstanceMetadata: object expected"); + message.freeInstanceMetadata = $root.google.spanner.admin.instance.v1.FreeInstanceMetadata.fromObject(object.freeInstanceMetadata); + } + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNSPECIFIED": + case 0: + message.edition = 0; + break; + case "STANDARD": + case 1: + message.edition = 1; + break; + case "ENTERPRISE": + case 2: + message.edition = 2; + break; + case "ENTERPRISE_PLUS": + case 3: + message.edition = 3; + break; + } + switch (object.defaultBackupScheduleType) { + default: + if (typeof object.defaultBackupScheduleType === "number") { + message.defaultBackupScheduleType = object.defaultBackupScheduleType; + break; + } + break; + case "DEFAULT_BACKUP_SCHEDULE_TYPE_UNSPECIFIED": + case 0: + message.defaultBackupScheduleType = 0; + break; + case "NONE": + case 1: + message.defaultBackupScheduleType = 1; + break; + case "AUTOMATIC": + case 2: + message.defaultBackupScheduleType = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an Instance message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.instance.v1.Instance + * @static + * @param {google.spanner.admin.instance.v1.Instance} message Instance + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Instance.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.endpointUris = []; + object.replicaComputeCapacity = []; + } + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.config = ""; + object.displayName = ""; + object.nodeCount = 0; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.processingUnits = 0; + object.instanceType = options.enums === String ? "INSTANCE_TYPE_UNSPECIFIED" : 0; + object.createTime = null; + object.updateTime = null; + object.freeInstanceMetadata = null; + object.autoscalingConfig = null; + object.edition = options.enums === String ? "EDITION_UNSPECIFIED" : 0; + object.defaultBackupScheduleType = options.enums === String ? "DEFAULT_BACKUP_SCHEDULE_TYPE_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.config != null && message.hasOwnProperty("config")) + object.config = message.config; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + object.nodeCount = message.nodeCount; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.spanner.admin.instance.v1.Instance.State[message.state] === undefined ? message.state : $root.google.spanner.admin.instance.v1.Instance.State[message.state] : message.state; + 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.endpointUris && message.endpointUris.length) { + object.endpointUris = []; + for (var j = 0; j < message.endpointUris.length; ++j) + object.endpointUris[j] = message.endpointUris[j]; + } + if (message.processingUnits != null && message.hasOwnProperty("processingUnits")) + object.processingUnits = message.processingUnits; + if (message.instanceType != null && message.hasOwnProperty("instanceType")) + object.instanceType = options.enums === String ? $root.google.spanner.admin.instance.v1.Instance.InstanceType[message.instanceType] === undefined ? message.instanceType : $root.google.spanner.admin.instance.v1.Instance.InstanceType[message.instanceType] : message.instanceType; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.freeInstanceMetadata != null && message.hasOwnProperty("freeInstanceMetadata")) + object.freeInstanceMetadata = $root.google.spanner.admin.instance.v1.FreeInstanceMetadata.toObject(message.freeInstanceMetadata, options); + if (message.autoscalingConfig != null && message.hasOwnProperty("autoscalingConfig")) + object.autoscalingConfig = $root.google.spanner.admin.instance.v1.AutoscalingConfig.toObject(message.autoscalingConfig, options); + if (message.replicaComputeCapacity && message.replicaComputeCapacity.length) { + object.replicaComputeCapacity = []; + for (var j = 0; j < message.replicaComputeCapacity.length; ++j) + object.replicaComputeCapacity[j] = $root.google.spanner.admin.instance.v1.ReplicaComputeCapacity.toObject(message.replicaComputeCapacity[j], options); + } + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.spanner.admin.instance.v1.Instance.Edition[message.edition] === undefined ? message.edition : $root.google.spanner.admin.instance.v1.Instance.Edition[message.edition] : message.edition; + if (message.defaultBackupScheduleType != null && message.hasOwnProperty("defaultBackupScheduleType")) + object.defaultBackupScheduleType = options.enums === String ? $root.google.spanner.admin.instance.v1.Instance.DefaultBackupScheduleType[message.defaultBackupScheduleType] === undefined ? message.defaultBackupScheduleType : $root.google.spanner.admin.instance.v1.Instance.DefaultBackupScheduleType[message.defaultBackupScheduleType] : message.defaultBackupScheduleType; + return object; + }; + + /** + * Converts this Instance to JSON. + * @function toJSON + * @memberof google.spanner.admin.instance.v1.Instance + * @instance + * @returns {Object.} JSON object + */ + Instance.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Instance + * @function getTypeUrl + * @memberof google.spanner.admin.instance.v1.Instance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Instance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.instance.v1.Instance"; + }; + + /** + * State enum. + * @name google.spanner.admin.instance.v1.Instance.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} CREATING=1 CREATING value + * @property {number} READY=2 READY value + */ + Instance.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CREATING"] = 1; + values[valuesById[2] = "READY"] = 2; + return values; + })(); + + /** + * InstanceType enum. + * @name google.spanner.admin.instance.v1.Instance.InstanceType + * @enum {number} + * @property {number} INSTANCE_TYPE_UNSPECIFIED=0 INSTANCE_TYPE_UNSPECIFIED value + * @property {number} PROVISIONED=1 PROVISIONED value + * @property {number} FREE_INSTANCE=2 FREE_INSTANCE value + */ + Instance.InstanceType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INSTANCE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PROVISIONED"] = 1; + values[valuesById[2] = "FREE_INSTANCE"] = 2; + return values; + })(); + + /** + * Edition enum. + * @name google.spanner.admin.instance.v1.Instance.Edition + * @enum {number} + * @property {number} EDITION_UNSPECIFIED=0 EDITION_UNSPECIFIED value + * @property {number} STANDARD=1 STANDARD value + * @property {number} ENTERPRISE=2 ENTERPRISE value + * @property {number} ENTERPRISE_PLUS=3 ENTERPRISE_PLUS value + */ + Instance.Edition = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EDITION_UNSPECIFIED"] = 0; + values[valuesById[1] = "STANDARD"] = 1; + values[valuesById[2] = "ENTERPRISE"] = 2; + values[valuesById[3] = "ENTERPRISE_PLUS"] = 3; + return values; + })(); + + /** + * DefaultBackupScheduleType enum. + * @name google.spanner.admin.instance.v1.Instance.DefaultBackupScheduleType + * @enum {number} + * @property {number} DEFAULT_BACKUP_SCHEDULE_TYPE_UNSPECIFIED=0 DEFAULT_BACKUP_SCHEDULE_TYPE_UNSPECIFIED value + * @property {number} NONE=1 NONE value + * @property {number} AUTOMATIC=2 AUTOMATIC value + */ + Instance.DefaultBackupScheduleType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEFAULT_BACKUP_SCHEDULE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "NONE"] = 1; + values[valuesById[2] = "AUTOMATIC"] = 2; + return values; + })(); + + return Instance; + })(); + + v1.ListInstanceConfigsRequest = (function() { + + /** + * Properties of a ListInstanceConfigsRequest. + * @memberof google.spanner.admin.instance.v1 + * @interface IListInstanceConfigsRequest + * @property {string|null} [parent] ListInstanceConfigsRequest parent + * @property {number|null} [pageSize] ListInstanceConfigsRequest pageSize + * @property {string|null} [pageToken] ListInstanceConfigsRequest pageToken + */ + + /** + * Constructs a new ListInstanceConfigsRequest. + * @memberof google.spanner.admin.instance.v1 + * @classdesc Represents a ListInstanceConfigsRequest. + * @implements IListInstanceConfigsRequest + * @constructor + * @param {google.spanner.admin.instance.v1.IListInstanceConfigsRequest=} [properties] Properties to set + */ + function ListInstanceConfigsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListInstanceConfigsRequest parent. + * @member {string} parent + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsRequest + * @instance + */ + ListInstanceConfigsRequest.prototype.parent = ""; + + /** + * ListInstanceConfigsRequest pageSize. + * @member {number} pageSize + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsRequest + * @instance + */ + ListInstanceConfigsRequest.prototype.pageSize = 0; + + /** + * ListInstanceConfigsRequest pageToken. + * @member {string} pageToken + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsRequest + * @instance + */ + ListInstanceConfigsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListInstanceConfigsRequest instance using the specified properties. + * @function create + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsRequest + * @static + * @param {google.spanner.admin.instance.v1.IListInstanceConfigsRequest=} [properties] Properties to set + * @returns {google.spanner.admin.instance.v1.ListInstanceConfigsRequest} ListInstanceConfigsRequest instance + */ + ListInstanceConfigsRequest.create = function create(properties) { + return new ListInstanceConfigsRequest(properties); + }; + + /** + * Encodes the specified ListInstanceConfigsRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstanceConfigsRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsRequest + * @static + * @param {google.spanner.admin.instance.v1.IListInstanceConfigsRequest} message ListInstanceConfigsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstanceConfigsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListInstanceConfigsRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstanceConfigsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsRequest + * @static + * @param {google.spanner.admin.instance.v1.IListInstanceConfigsRequest} message ListInstanceConfigsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstanceConfigsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListInstanceConfigsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.instance.v1.ListInstanceConfigsRequest} ListInstanceConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstanceConfigsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.ListInstanceConfigsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListInstanceConfigsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.instance.v1.ListInstanceConfigsRequest} ListInstanceConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstanceConfigsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListInstanceConfigsRequest message. + * @function verify + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListInstanceConfigsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListInstanceConfigsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.instance.v1.ListInstanceConfigsRequest} ListInstanceConfigsRequest + */ + ListInstanceConfigsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.instance.v1.ListInstanceConfigsRequest) + return object; + var message = new $root.google.spanner.admin.instance.v1.ListInstanceConfigsRequest(); + 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 ListInstanceConfigsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsRequest + * @static + * @param {google.spanner.admin.instance.v1.ListInstanceConfigsRequest} message ListInstanceConfigsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListInstanceConfigsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListInstanceConfigsRequest to JSON. + * @function toJSON + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsRequest + * @instance + * @returns {Object.} JSON object + */ + ListInstanceConfigsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListInstanceConfigsRequest + * @function getTypeUrl + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListInstanceConfigsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.instance.v1.ListInstanceConfigsRequest"; + }; + + return ListInstanceConfigsRequest; + })(); + + v1.ListInstanceConfigsResponse = (function() { + + /** + * Properties of a ListInstanceConfigsResponse. + * @memberof google.spanner.admin.instance.v1 + * @interface IListInstanceConfigsResponse + * @property {Array.|null} [instanceConfigs] ListInstanceConfigsResponse instanceConfigs + * @property {string|null} [nextPageToken] ListInstanceConfigsResponse nextPageToken + */ + + /** + * Constructs a new ListInstanceConfigsResponse. + * @memberof google.spanner.admin.instance.v1 + * @classdesc Represents a ListInstanceConfigsResponse. + * @implements IListInstanceConfigsResponse + * @constructor + * @param {google.spanner.admin.instance.v1.IListInstanceConfigsResponse=} [properties] Properties to set + */ + function ListInstanceConfigsResponse(properties) { + this.instanceConfigs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListInstanceConfigsResponse instanceConfigs. + * @member {Array.} instanceConfigs + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsResponse + * @instance + */ + ListInstanceConfigsResponse.prototype.instanceConfigs = $util.emptyArray; + + /** + * ListInstanceConfigsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsResponse + * @instance + */ + ListInstanceConfigsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListInstanceConfigsResponse instance using the specified properties. + * @function create + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsResponse + * @static + * @param {google.spanner.admin.instance.v1.IListInstanceConfigsResponse=} [properties] Properties to set + * @returns {google.spanner.admin.instance.v1.ListInstanceConfigsResponse} ListInstanceConfigsResponse instance + */ + ListInstanceConfigsResponse.create = function create(properties) { + return new ListInstanceConfigsResponse(properties); + }; + + /** + * Encodes the specified ListInstanceConfigsResponse message. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstanceConfigsResponse.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsResponse + * @static + * @param {google.spanner.admin.instance.v1.IListInstanceConfigsResponse} message ListInstanceConfigsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstanceConfigsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.instanceConfigs != null && message.instanceConfigs.length) + for (var i = 0; i < message.instanceConfigs.length; ++i) + $root.google.spanner.admin.instance.v1.InstanceConfig.encode(message.instanceConfigs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListInstanceConfigsResponse message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstanceConfigsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsResponse + * @static + * @param {google.spanner.admin.instance.v1.IListInstanceConfigsResponse} message ListInstanceConfigsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstanceConfigsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListInstanceConfigsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.instance.v1.ListInstanceConfigsResponse} ListInstanceConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstanceConfigsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.ListInstanceConfigsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.instanceConfigs && message.instanceConfigs.length)) + message.instanceConfigs = []; + message.instanceConfigs.push($root.google.spanner.admin.instance.v1.InstanceConfig.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListInstanceConfigsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.instance.v1.ListInstanceConfigsResponse} ListInstanceConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstanceConfigsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListInstanceConfigsResponse message. + * @function verify + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListInstanceConfigsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.instanceConfigs != null && message.hasOwnProperty("instanceConfigs")) { + if (!Array.isArray(message.instanceConfigs)) + return "instanceConfigs: array expected"; + for (var i = 0; i < message.instanceConfigs.length; ++i) { + var error = $root.google.spanner.admin.instance.v1.InstanceConfig.verify(message.instanceConfigs[i]); + if (error) + return "instanceConfigs." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListInstanceConfigsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.instance.v1.ListInstanceConfigsResponse} ListInstanceConfigsResponse + */ + ListInstanceConfigsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.instance.v1.ListInstanceConfigsResponse) + return object; + var message = new $root.google.spanner.admin.instance.v1.ListInstanceConfigsResponse(); + if (object.instanceConfigs) { + if (!Array.isArray(object.instanceConfigs)) + throw TypeError(".google.spanner.admin.instance.v1.ListInstanceConfigsResponse.instanceConfigs: array expected"); + message.instanceConfigs = []; + for (var i = 0; i < object.instanceConfigs.length; ++i) { + if (typeof object.instanceConfigs[i] !== "object") + throw TypeError(".google.spanner.admin.instance.v1.ListInstanceConfigsResponse.instanceConfigs: object expected"); + message.instanceConfigs[i] = $root.google.spanner.admin.instance.v1.InstanceConfig.fromObject(object.instanceConfigs[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListInstanceConfigsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsResponse + * @static + * @param {google.spanner.admin.instance.v1.ListInstanceConfigsResponse} message ListInstanceConfigsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListInstanceConfigsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.instanceConfigs = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.instanceConfigs && message.instanceConfigs.length) { + object.instanceConfigs = []; + for (var j = 0; j < message.instanceConfigs.length; ++j) + object.instanceConfigs[j] = $root.google.spanner.admin.instance.v1.InstanceConfig.toObject(message.instanceConfigs[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListInstanceConfigsResponse to JSON. + * @function toJSON + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsResponse + * @instance + * @returns {Object.} JSON object + */ + ListInstanceConfigsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListInstanceConfigsResponse + * @function getTypeUrl + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListInstanceConfigsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.instance.v1.ListInstanceConfigsResponse"; + }; + + return ListInstanceConfigsResponse; + })(); + + v1.GetInstanceConfigRequest = (function() { + + /** + * Properties of a GetInstanceConfigRequest. + * @memberof google.spanner.admin.instance.v1 + * @interface IGetInstanceConfigRequest + * @property {string|null} [name] GetInstanceConfigRequest name + */ + + /** + * Constructs a new GetInstanceConfigRequest. + * @memberof google.spanner.admin.instance.v1 + * @classdesc Represents a GetInstanceConfigRequest. + * @implements IGetInstanceConfigRequest + * @constructor + * @param {google.spanner.admin.instance.v1.IGetInstanceConfigRequest=} [properties] Properties to set + */ + function GetInstanceConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetInstanceConfigRequest name. + * @member {string} name + * @memberof google.spanner.admin.instance.v1.GetInstanceConfigRequest + * @instance + */ + GetInstanceConfigRequest.prototype.name = ""; + + /** + * Creates a new GetInstanceConfigRequest instance using the specified properties. + * @function create + * @memberof google.spanner.admin.instance.v1.GetInstanceConfigRequest + * @static + * @param {google.spanner.admin.instance.v1.IGetInstanceConfigRequest=} [properties] Properties to set + * @returns {google.spanner.admin.instance.v1.GetInstanceConfigRequest} GetInstanceConfigRequest instance + */ + GetInstanceConfigRequest.create = function create(properties) { + return new GetInstanceConfigRequest(properties); + }; + + /** + * Encodes the specified GetInstanceConfigRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.GetInstanceConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.instance.v1.GetInstanceConfigRequest + * @static + * @param {google.spanner.admin.instance.v1.IGetInstanceConfigRequest} message GetInstanceConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetInstanceConfigRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetInstanceConfigRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.GetInstanceConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.instance.v1.GetInstanceConfigRequest + * @static + * @param {google.spanner.admin.instance.v1.IGetInstanceConfigRequest} message GetInstanceConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetInstanceConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetInstanceConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.instance.v1.GetInstanceConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.instance.v1.GetInstanceConfigRequest} GetInstanceConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetInstanceConfigRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.GetInstanceConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetInstanceConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.instance.v1.GetInstanceConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.instance.v1.GetInstanceConfigRequest} GetInstanceConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetInstanceConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetInstanceConfigRequest message. + * @function verify + * @memberof google.spanner.admin.instance.v1.GetInstanceConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetInstanceConfigRequest.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 GetInstanceConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.instance.v1.GetInstanceConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.instance.v1.GetInstanceConfigRequest} GetInstanceConfigRequest + */ + GetInstanceConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.instance.v1.GetInstanceConfigRequest) + return object; + var message = new $root.google.spanner.admin.instance.v1.GetInstanceConfigRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetInstanceConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.instance.v1.GetInstanceConfigRequest + * @static + * @param {google.spanner.admin.instance.v1.GetInstanceConfigRequest} message GetInstanceConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetInstanceConfigRequest.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 GetInstanceConfigRequest to JSON. + * @function toJSON + * @memberof google.spanner.admin.instance.v1.GetInstanceConfigRequest + * @instance + * @returns {Object.} JSON object + */ + GetInstanceConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetInstanceConfigRequest + * @function getTypeUrl + * @memberof google.spanner.admin.instance.v1.GetInstanceConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetInstanceConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.instance.v1.GetInstanceConfigRequest"; + }; + + return GetInstanceConfigRequest; + })(); + + v1.CreateInstanceConfigRequest = (function() { + + /** + * Properties of a CreateInstanceConfigRequest. + * @memberof google.spanner.admin.instance.v1 + * @interface ICreateInstanceConfigRequest + * @property {string|null} [parent] CreateInstanceConfigRequest parent + * @property {string|null} [instanceConfigId] CreateInstanceConfigRequest instanceConfigId + * @property {google.spanner.admin.instance.v1.IInstanceConfig|null} [instanceConfig] CreateInstanceConfigRequest instanceConfig + * @property {boolean|null} [validateOnly] CreateInstanceConfigRequest validateOnly + */ + + /** + * Constructs a new CreateInstanceConfigRequest. + * @memberof google.spanner.admin.instance.v1 + * @classdesc Represents a CreateInstanceConfigRequest. + * @implements ICreateInstanceConfigRequest + * @constructor + * @param {google.spanner.admin.instance.v1.ICreateInstanceConfigRequest=} [properties] Properties to set + */ + function CreateInstanceConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateInstanceConfigRequest parent. + * @member {string} parent + * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigRequest + * @instance + */ + CreateInstanceConfigRequest.prototype.parent = ""; + + /** + * CreateInstanceConfigRequest instanceConfigId. + * @member {string} instanceConfigId + * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigRequest + * @instance + */ + CreateInstanceConfigRequest.prototype.instanceConfigId = ""; + + /** + * CreateInstanceConfigRequest instanceConfig. + * @member {google.spanner.admin.instance.v1.IInstanceConfig|null|undefined} instanceConfig + * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigRequest + * @instance + */ + CreateInstanceConfigRequest.prototype.instanceConfig = null; + + /** + * CreateInstanceConfigRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigRequest + * @instance + */ + CreateInstanceConfigRequest.prototype.validateOnly = false; + + /** + * Creates a new CreateInstanceConfigRequest instance using the specified properties. + * @function create + * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigRequest + * @static + * @param {google.spanner.admin.instance.v1.ICreateInstanceConfigRequest=} [properties] Properties to set + * @returns {google.spanner.admin.instance.v1.CreateInstanceConfigRequest} CreateInstanceConfigRequest instance + */ + CreateInstanceConfigRequest.create = function create(properties) { + return new CreateInstanceConfigRequest(properties); + }; + + /** + * Encodes the specified CreateInstanceConfigRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.CreateInstanceConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigRequest + * @static + * @param {google.spanner.admin.instance.v1.ICreateInstanceConfigRequest} message CreateInstanceConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateInstanceConfigRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.instanceConfigId != null && Object.hasOwnProperty.call(message, "instanceConfigId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.instanceConfigId); + if (message.instanceConfig != null && Object.hasOwnProperty.call(message, "instanceConfig")) + $root.google.spanner.admin.instance.v1.InstanceConfig.encode(message.instanceConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified CreateInstanceConfigRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.CreateInstanceConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigRequest + * @static + * @param {google.spanner.admin.instance.v1.ICreateInstanceConfigRequest} message CreateInstanceConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateInstanceConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateInstanceConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.instance.v1.CreateInstanceConfigRequest} CreateInstanceConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateInstanceConfigRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.CreateInstanceConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.instanceConfigId = reader.string(); + break; + } + case 3: { + message.instanceConfig = $root.google.spanner.admin.instance.v1.InstanceConfig.decode(reader, reader.uint32()); + break; + } + case 4: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateInstanceConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.instance.v1.CreateInstanceConfigRequest} CreateInstanceConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateInstanceConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateInstanceConfigRequest message. + * @function verify + * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateInstanceConfigRequest.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.instanceConfigId != null && message.hasOwnProperty("instanceConfigId")) + if (!$util.isString(message.instanceConfigId)) + return "instanceConfigId: string expected"; + if (message.instanceConfig != null && message.hasOwnProperty("instanceConfig")) { + var error = $root.google.spanner.admin.instance.v1.InstanceConfig.verify(message.instanceConfig); + if (error) + return "instanceConfig." + error; + } + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates a CreateInstanceConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.instance.v1.CreateInstanceConfigRequest} CreateInstanceConfigRequest + */ + CreateInstanceConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.instance.v1.CreateInstanceConfigRequest) + return object; + var message = new $root.google.spanner.admin.instance.v1.CreateInstanceConfigRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.instanceConfigId != null) + message.instanceConfigId = String(object.instanceConfigId); + if (object.instanceConfig != null) { + if (typeof object.instanceConfig !== "object") + throw TypeError(".google.spanner.admin.instance.v1.CreateInstanceConfigRequest.instanceConfig: object expected"); + message.instanceConfig = $root.google.spanner.admin.instance.v1.InstanceConfig.fromObject(object.instanceConfig); + } + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from a CreateInstanceConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigRequest + * @static + * @param {google.spanner.admin.instance.v1.CreateInstanceConfigRequest} message CreateInstanceConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateInstanceConfigRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.instanceConfigId = ""; + object.instanceConfig = null; + object.validateOnly = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.instanceConfigId != null && message.hasOwnProperty("instanceConfigId")) + object.instanceConfigId = message.instanceConfigId; + if (message.instanceConfig != null && message.hasOwnProperty("instanceConfig")) + object.instanceConfig = $root.google.spanner.admin.instance.v1.InstanceConfig.toObject(message.instanceConfig, options); + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this CreateInstanceConfigRequest to JSON. + * @function toJSON + * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigRequest + * @instance + * @returns {Object.} JSON object + */ + CreateInstanceConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateInstanceConfigRequest + * @function getTypeUrl + * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateInstanceConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.instance.v1.CreateInstanceConfigRequest"; + }; + + return CreateInstanceConfigRequest; + })(); + + v1.UpdateInstanceConfigRequest = (function() { + + /** + * Properties of an UpdateInstanceConfigRequest. + * @memberof google.spanner.admin.instance.v1 + * @interface IUpdateInstanceConfigRequest + * @property {google.spanner.admin.instance.v1.IInstanceConfig|null} [instanceConfig] UpdateInstanceConfigRequest instanceConfig + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateInstanceConfigRequest updateMask + * @property {boolean|null} [validateOnly] UpdateInstanceConfigRequest validateOnly + */ + + /** + * Constructs a new UpdateInstanceConfigRequest. + * @memberof google.spanner.admin.instance.v1 + * @classdesc Represents an UpdateInstanceConfigRequest. + * @implements IUpdateInstanceConfigRequest + * @constructor + * @param {google.spanner.admin.instance.v1.IUpdateInstanceConfigRequest=} [properties] Properties to set + */ + function UpdateInstanceConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateInstanceConfigRequest instanceConfig. + * @member {google.spanner.admin.instance.v1.IInstanceConfig|null|undefined} instanceConfig + * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigRequest + * @instance + */ + UpdateInstanceConfigRequest.prototype.instanceConfig = null; + + /** + * UpdateInstanceConfigRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigRequest + * @instance + */ + UpdateInstanceConfigRequest.prototype.updateMask = null; + + /** + * UpdateInstanceConfigRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigRequest + * @instance + */ + UpdateInstanceConfigRequest.prototype.validateOnly = false; + + /** + * Creates a new UpdateInstanceConfigRequest instance using the specified properties. + * @function create + * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigRequest + * @static + * @param {google.spanner.admin.instance.v1.IUpdateInstanceConfigRequest=} [properties] Properties to set + * @returns {google.spanner.admin.instance.v1.UpdateInstanceConfigRequest} UpdateInstanceConfigRequest instance + */ + UpdateInstanceConfigRequest.create = function create(properties) { + return new UpdateInstanceConfigRequest(properties); + }; + + /** + * Encodes the specified UpdateInstanceConfigRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.UpdateInstanceConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigRequest + * @static + * @param {google.spanner.admin.instance.v1.IUpdateInstanceConfigRequest} message UpdateInstanceConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateInstanceConfigRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.instanceConfig != null && Object.hasOwnProperty.call(message, "instanceConfig")) + $root.google.spanner.admin.instance.v1.InstanceConfig.encode(message.instanceConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified UpdateInstanceConfigRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.UpdateInstanceConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigRequest + * @static + * @param {google.spanner.admin.instance.v1.IUpdateInstanceConfigRequest} message UpdateInstanceConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateInstanceConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateInstanceConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.instance.v1.UpdateInstanceConfigRequest} UpdateInstanceConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateInstanceConfigRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.UpdateInstanceConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.instanceConfig = $root.google.spanner.admin.instance.v1.InstanceConfig.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 3: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateInstanceConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.instance.v1.UpdateInstanceConfigRequest} UpdateInstanceConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateInstanceConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateInstanceConfigRequest message. + * @function verify + * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateInstanceConfigRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.instanceConfig != null && message.hasOwnProperty("instanceConfig")) { + var error = $root.google.spanner.admin.instance.v1.InstanceConfig.verify(message.instanceConfig); + if (error) + return "instanceConfig." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates an UpdateInstanceConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.instance.v1.UpdateInstanceConfigRequest} UpdateInstanceConfigRequest + */ + UpdateInstanceConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.instance.v1.UpdateInstanceConfigRequest) + return object; + var message = new $root.google.spanner.admin.instance.v1.UpdateInstanceConfigRequest(); + if (object.instanceConfig != null) { + if (typeof object.instanceConfig !== "object") + throw TypeError(".google.spanner.admin.instance.v1.UpdateInstanceConfigRequest.instanceConfig: object expected"); + message.instanceConfig = $root.google.spanner.admin.instance.v1.InstanceConfig.fromObject(object.instanceConfig); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.spanner.admin.instance.v1.UpdateInstanceConfigRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from an UpdateInstanceConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigRequest + * @static + * @param {google.spanner.admin.instance.v1.UpdateInstanceConfigRequest} message UpdateInstanceConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateInstanceConfigRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.instanceConfig = null; + object.updateMask = null; + object.validateOnly = false; + } + if (message.instanceConfig != null && message.hasOwnProperty("instanceConfig")) + object.instanceConfig = $root.google.spanner.admin.instance.v1.InstanceConfig.toObject(message.instanceConfig, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this UpdateInstanceConfigRequest to JSON. + * @function toJSON + * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateInstanceConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateInstanceConfigRequest + * @function getTypeUrl + * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateInstanceConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.instance.v1.UpdateInstanceConfigRequest"; + }; + + return UpdateInstanceConfigRequest; + })(); + + v1.DeleteInstanceConfigRequest = (function() { + + /** + * Properties of a DeleteInstanceConfigRequest. + * @memberof google.spanner.admin.instance.v1 + * @interface IDeleteInstanceConfigRequest + * @property {string|null} [name] DeleteInstanceConfigRequest name + * @property {string|null} [etag] DeleteInstanceConfigRequest etag + * @property {boolean|null} [validateOnly] DeleteInstanceConfigRequest validateOnly + */ + + /** + * Constructs a new DeleteInstanceConfigRequest. + * @memberof google.spanner.admin.instance.v1 + * @classdesc Represents a DeleteInstanceConfigRequest. + * @implements IDeleteInstanceConfigRequest + * @constructor + * @param {google.spanner.admin.instance.v1.IDeleteInstanceConfigRequest=} [properties] Properties to set + */ + function DeleteInstanceConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteInstanceConfigRequest name. + * @member {string} name + * @memberof google.spanner.admin.instance.v1.DeleteInstanceConfigRequest + * @instance + */ + DeleteInstanceConfigRequest.prototype.name = ""; + + /** + * DeleteInstanceConfigRequest etag. + * @member {string} etag + * @memberof google.spanner.admin.instance.v1.DeleteInstanceConfigRequest + * @instance + */ + DeleteInstanceConfigRequest.prototype.etag = ""; + + /** + * DeleteInstanceConfigRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.spanner.admin.instance.v1.DeleteInstanceConfigRequest + * @instance + */ + DeleteInstanceConfigRequest.prototype.validateOnly = false; + + /** + * Creates a new DeleteInstanceConfigRequest instance using the specified properties. + * @function create + * @memberof google.spanner.admin.instance.v1.DeleteInstanceConfigRequest + * @static + * @param {google.spanner.admin.instance.v1.IDeleteInstanceConfigRequest=} [properties] Properties to set + * @returns {google.spanner.admin.instance.v1.DeleteInstanceConfigRequest} DeleteInstanceConfigRequest instance + */ + DeleteInstanceConfigRequest.create = function create(properties) { + return new DeleteInstanceConfigRequest(properties); + }; + + /** + * Encodes the specified DeleteInstanceConfigRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.DeleteInstanceConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.instance.v1.DeleteInstanceConfigRequest + * @static + * @param {google.spanner.admin.instance.v1.IDeleteInstanceConfigRequest} message DeleteInstanceConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteInstanceConfigRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.etag); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified DeleteInstanceConfigRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.DeleteInstanceConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.instance.v1.DeleteInstanceConfigRequest + * @static + * @param {google.spanner.admin.instance.v1.IDeleteInstanceConfigRequest} message DeleteInstanceConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteInstanceConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteInstanceConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.instance.v1.DeleteInstanceConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.instance.v1.DeleteInstanceConfigRequest} DeleteInstanceConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteInstanceConfigRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.DeleteInstanceConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.etag = reader.string(); + break; + } + case 3: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteInstanceConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.instance.v1.DeleteInstanceConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.instance.v1.DeleteInstanceConfigRequest} DeleteInstanceConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteInstanceConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteInstanceConfigRequest message. + * @function verify + * @memberof google.spanner.admin.instance.v1.DeleteInstanceConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteInstanceConfigRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates a DeleteInstanceConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.instance.v1.DeleteInstanceConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.instance.v1.DeleteInstanceConfigRequest} DeleteInstanceConfigRequest + */ + DeleteInstanceConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.instance.v1.DeleteInstanceConfigRequest) + return object; + var message = new $root.google.spanner.admin.instance.v1.DeleteInstanceConfigRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.etag != null) + message.etag = String(object.etag); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from a DeleteInstanceConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.instance.v1.DeleteInstanceConfigRequest + * @static + * @param {google.spanner.admin.instance.v1.DeleteInstanceConfigRequest} message DeleteInstanceConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteInstanceConfigRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.etag = ""; + object.validateOnly = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this DeleteInstanceConfigRequest to JSON. + * @function toJSON + * @memberof google.spanner.admin.instance.v1.DeleteInstanceConfigRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteInstanceConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteInstanceConfigRequest + * @function getTypeUrl + * @memberof google.spanner.admin.instance.v1.DeleteInstanceConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteInstanceConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.instance.v1.DeleteInstanceConfigRequest"; + }; + + return DeleteInstanceConfigRequest; + })(); + + v1.ListInstanceConfigOperationsRequest = (function() { + + /** + * Properties of a ListInstanceConfigOperationsRequest. + * @memberof google.spanner.admin.instance.v1 + * @interface IListInstanceConfigOperationsRequest + * @property {string|null} [parent] ListInstanceConfigOperationsRequest parent + * @property {string|null} [filter] ListInstanceConfigOperationsRequest filter + * @property {number|null} [pageSize] ListInstanceConfigOperationsRequest pageSize + * @property {string|null} [pageToken] ListInstanceConfigOperationsRequest pageToken + */ + + /** + * Constructs a new ListInstanceConfigOperationsRequest. + * @memberof google.spanner.admin.instance.v1 + * @classdesc Represents a ListInstanceConfigOperationsRequest. + * @implements IListInstanceConfigOperationsRequest + * @constructor + * @param {google.spanner.admin.instance.v1.IListInstanceConfigOperationsRequest=} [properties] Properties to set + */ + function ListInstanceConfigOperationsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListInstanceConfigOperationsRequest parent. + * @member {string} parent + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest + * @instance + */ + ListInstanceConfigOperationsRequest.prototype.parent = ""; + + /** + * ListInstanceConfigOperationsRequest filter. + * @member {string} filter + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest + * @instance + */ + ListInstanceConfigOperationsRequest.prototype.filter = ""; + + /** + * ListInstanceConfigOperationsRequest pageSize. + * @member {number} pageSize + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest + * @instance + */ + ListInstanceConfigOperationsRequest.prototype.pageSize = 0; + + /** + * ListInstanceConfigOperationsRequest pageToken. + * @member {string} pageToken + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest + * @instance + */ + ListInstanceConfigOperationsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListInstanceConfigOperationsRequest instance using the specified properties. + * @function create + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest + * @static + * @param {google.spanner.admin.instance.v1.IListInstanceConfigOperationsRequest=} [properties] Properties to set + * @returns {google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest} ListInstanceConfigOperationsRequest instance + */ + ListInstanceConfigOperationsRequest.create = function create(properties) { + return new ListInstanceConfigOperationsRequest(properties); + }; + + /** + * Encodes the specified ListInstanceConfigOperationsRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest + * @static + * @param {google.spanner.admin.instance.v1.IListInstanceConfigOperationsRequest} message ListInstanceConfigOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstanceConfigOperationsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListInstanceConfigOperationsRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest + * @static + * @param {google.spanner.admin.instance.v1.IListInstanceConfigOperationsRequest} message ListInstanceConfigOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstanceConfigOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListInstanceConfigOperationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest} ListInstanceConfigOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstanceConfigOperationsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.filter = reader.string(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListInstanceConfigOperationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest} ListInstanceConfigOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstanceConfigOperationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListInstanceConfigOperationsRequest message. + * @function verify + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListInstanceConfigOperationsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.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 ListInstanceConfigOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest} ListInstanceConfigOperationsRequest + */ + ListInstanceConfigOperationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest) + return object; + var message = new $root.google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListInstanceConfigOperationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest + * @static + * @param {google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest} message ListInstanceConfigOperationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListInstanceConfigOperationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListInstanceConfigOperationsRequest to JSON. + * @function toJSON + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListInstanceConfigOperationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListInstanceConfigOperationsRequest + * @function getTypeUrl + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListInstanceConfigOperationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest"; + }; + + return ListInstanceConfigOperationsRequest; + })(); + + v1.ListInstanceConfigOperationsResponse = (function() { + + /** + * Properties of a ListInstanceConfigOperationsResponse. + * @memberof google.spanner.admin.instance.v1 + * @interface IListInstanceConfigOperationsResponse + * @property {Array.|null} [operations] ListInstanceConfigOperationsResponse operations + * @property {string|null} [nextPageToken] ListInstanceConfigOperationsResponse nextPageToken + */ + + /** + * Constructs a new ListInstanceConfigOperationsResponse. + * @memberof google.spanner.admin.instance.v1 + * @classdesc Represents a ListInstanceConfigOperationsResponse. + * @implements IListInstanceConfigOperationsResponse + * @constructor + * @param {google.spanner.admin.instance.v1.IListInstanceConfigOperationsResponse=} [properties] Properties to set + */ + function ListInstanceConfigOperationsResponse(properties) { + this.operations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListInstanceConfigOperationsResponse operations. + * @member {Array.} operations + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse + * @instance + */ + ListInstanceConfigOperationsResponse.prototype.operations = $util.emptyArray; + + /** + * ListInstanceConfigOperationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse + * @instance + */ + ListInstanceConfigOperationsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListInstanceConfigOperationsResponse instance using the specified properties. + * @function create + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse + * @static + * @param {google.spanner.admin.instance.v1.IListInstanceConfigOperationsResponse=} [properties] Properties to set + * @returns {google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse} ListInstanceConfigOperationsResponse instance + */ + ListInstanceConfigOperationsResponse.create = function create(properties) { + return new ListInstanceConfigOperationsResponse(properties); + }; + + /** + * Encodes the specified ListInstanceConfigOperationsResponse message. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse + * @static + * @param {google.spanner.admin.instance.v1.IListInstanceConfigOperationsResponse} message ListInstanceConfigOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstanceConfigOperationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.operations != null && message.operations.length) + for (var i = 0; i < message.operations.length; ++i) + $root.google.longrunning.Operation.encode(message.operations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListInstanceConfigOperationsResponse message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse + * @static + * @param {google.spanner.admin.instance.v1.IListInstanceConfigOperationsResponse} message ListInstanceConfigOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstanceConfigOperationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListInstanceConfigOperationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse} ListInstanceConfigOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstanceConfigOperationsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.operations && message.operations.length)) + message.operations = []; + message.operations.push($root.google.longrunning.Operation.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListInstanceConfigOperationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse} ListInstanceConfigOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstanceConfigOperationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListInstanceConfigOperationsResponse message. + * @function verify + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListInstanceConfigOperationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.operations != null && message.hasOwnProperty("operations")) { + if (!Array.isArray(message.operations)) + return "operations: array expected"; + for (var i = 0; i < message.operations.length; ++i) { + var error = $root.google.longrunning.Operation.verify(message.operations[i]); + if (error) + return "operations." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListInstanceConfigOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse} ListInstanceConfigOperationsResponse + */ + ListInstanceConfigOperationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse) + return object; + var message = new $root.google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse(); + if (object.operations) { + if (!Array.isArray(object.operations)) + throw TypeError(".google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse.operations: array expected"); + message.operations = []; + for (var i = 0; i < object.operations.length; ++i) { + if (typeof object.operations[i] !== "object") + throw TypeError(".google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse.operations: object expected"); + message.operations[i] = $root.google.longrunning.Operation.fromObject(object.operations[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListInstanceConfigOperationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse + * @static + * @param {google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse} message ListInstanceConfigOperationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListInstanceConfigOperationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.operations = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.operations && message.operations.length) { + object.operations = []; + for (var j = 0; j < message.operations.length; ++j) + object.operations[j] = $root.google.longrunning.Operation.toObject(message.operations[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListInstanceConfigOperationsResponse to JSON. + * @function toJSON + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse + * @instance + * @returns {Object.} JSON object + */ + ListInstanceConfigOperationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListInstanceConfigOperationsResponse + * @function getTypeUrl + * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListInstanceConfigOperationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse"; + }; + + return ListInstanceConfigOperationsResponse; + })(); + + v1.GetInstanceRequest = (function() { + + /** + * Properties of a GetInstanceRequest. + * @memberof google.spanner.admin.instance.v1 + * @interface IGetInstanceRequest + * @property {string|null} [name] GetInstanceRequest name + * @property {google.protobuf.IFieldMask|null} [fieldMask] GetInstanceRequest fieldMask + */ + + /** + * Constructs a new GetInstanceRequest. + * @memberof google.spanner.admin.instance.v1 + * @classdesc Represents a GetInstanceRequest. + * @implements IGetInstanceRequest + * @constructor + * @param {google.spanner.admin.instance.v1.IGetInstanceRequest=} [properties] Properties to set + */ + function GetInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetInstanceRequest name. + * @member {string} name + * @memberof google.spanner.admin.instance.v1.GetInstanceRequest + * @instance + */ + GetInstanceRequest.prototype.name = ""; + + /** + * GetInstanceRequest fieldMask. + * @member {google.protobuf.IFieldMask|null|undefined} fieldMask + * @memberof google.spanner.admin.instance.v1.GetInstanceRequest + * @instance + */ + GetInstanceRequest.prototype.fieldMask = null; + + /** + * Creates a new GetInstanceRequest instance using the specified properties. + * @function create + * @memberof google.spanner.admin.instance.v1.GetInstanceRequest + * @static + * @param {google.spanner.admin.instance.v1.IGetInstanceRequest=} [properties] Properties to set + * @returns {google.spanner.admin.instance.v1.GetInstanceRequest} GetInstanceRequest instance + */ + GetInstanceRequest.create = function create(properties) { + return new GetInstanceRequest(properties); + }; + + /** + * Encodes the specified GetInstanceRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.GetInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.instance.v1.GetInstanceRequest + * @static + * @param {google.spanner.admin.instance.v1.IGetInstanceRequest} message GetInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.fieldMask != null && Object.hasOwnProperty.call(message, "fieldMask")) + $root.google.protobuf.FieldMask.encode(message.fieldMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetInstanceRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.GetInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.instance.v1.GetInstanceRequest + * @static + * @param {google.spanner.admin.instance.v1.IGetInstanceRequest} message GetInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.instance.v1.GetInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.instance.v1.GetInstanceRequest} GetInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetInstanceRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.GetInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.fieldMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + 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.spanner.admin.instance.v1.GetInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.instance.v1.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.spanner.admin.instance.v1.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"; + if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.fieldMask); + if (error) + return "fieldMask." + error; + } + return null; + }; + + /** + * Creates a GetInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.instance.v1.GetInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.instance.v1.GetInstanceRequest} GetInstanceRequest + */ + GetInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.instance.v1.GetInstanceRequest) + return object; + var message = new $root.google.spanner.admin.instance.v1.GetInstanceRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.fieldMask != null) { + if (typeof object.fieldMask !== "object") + throw TypeError(".google.spanner.admin.instance.v1.GetInstanceRequest.fieldMask: object expected"); + message.fieldMask = $root.google.protobuf.FieldMask.fromObject(object.fieldMask); + } + return message; + }; + + /** + * Creates a plain object from a GetInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.instance.v1.GetInstanceRequest + * @static + * @param {google.spanner.admin.instance.v1.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 = ""; + object.fieldMask = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) + object.fieldMask = $root.google.protobuf.FieldMask.toObject(message.fieldMask, options); + return object; + }; + + /** + * Converts this GetInstanceRequest to JSON. + * @function toJSON + * @memberof google.spanner.admin.instance.v1.GetInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + GetInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetInstanceRequest + * @function getTypeUrl + * @memberof google.spanner.admin.instance.v1.GetInstanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.instance.v1.GetInstanceRequest"; + }; + + return GetInstanceRequest; + })(); + + v1.CreateInstanceRequest = (function() { + + /** + * Properties of a CreateInstanceRequest. + * @memberof google.spanner.admin.instance.v1 + * @interface ICreateInstanceRequest + * @property {string|null} [parent] CreateInstanceRequest parent + * @property {string|null} [instanceId] CreateInstanceRequest instanceId + * @property {google.spanner.admin.instance.v1.IInstance|null} [instance] CreateInstanceRequest instance + */ + + /** + * Constructs a new CreateInstanceRequest. + * @memberof google.spanner.admin.instance.v1 + * @classdesc Represents a CreateInstanceRequest. + * @implements ICreateInstanceRequest + * @constructor + * @param {google.spanner.admin.instance.v1.ICreateInstanceRequest=} [properties] Properties to set + */ + function CreateInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateInstanceRequest parent. + * @member {string} parent + * @memberof google.spanner.admin.instance.v1.CreateInstanceRequest + * @instance + */ + CreateInstanceRequest.prototype.parent = ""; + + /** + * CreateInstanceRequest instanceId. + * @member {string} instanceId + * @memberof google.spanner.admin.instance.v1.CreateInstanceRequest + * @instance + */ + CreateInstanceRequest.prototype.instanceId = ""; + + /** + * CreateInstanceRequest instance. + * @member {google.spanner.admin.instance.v1.IInstance|null|undefined} instance + * @memberof google.spanner.admin.instance.v1.CreateInstanceRequest + * @instance + */ + CreateInstanceRequest.prototype.instance = null; + + /** + * Creates a new CreateInstanceRequest instance using the specified properties. + * @function create + * @memberof google.spanner.admin.instance.v1.CreateInstanceRequest + * @static + * @param {google.spanner.admin.instance.v1.ICreateInstanceRequest=} [properties] Properties to set + * @returns {google.spanner.admin.instance.v1.CreateInstanceRequest} CreateInstanceRequest instance + */ + CreateInstanceRequest.create = function create(properties) { + return new CreateInstanceRequest(properties); + }; + + /** + * Encodes the specified CreateInstanceRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.CreateInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.instance.v1.CreateInstanceRequest + * @static + * @param {google.spanner.admin.instance.v1.ICreateInstanceRequest} message CreateInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.instanceId); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + $root.google.spanner.admin.instance.v1.Instance.encode(message.instance, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateInstanceRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.CreateInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.instance.v1.CreateInstanceRequest + * @static + * @param {google.spanner.admin.instance.v1.ICreateInstanceRequest} message CreateInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.instance.v1.CreateInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.instance.v1.CreateInstanceRequest} CreateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateInstanceRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.CreateInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.instanceId = reader.string(); + break; + } + case 3: { + message.instance = $root.google.spanner.admin.instance.v1.Instance.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.instance.v1.CreateInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.instance.v1.CreateInstanceRequest} CreateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateInstanceRequest message. + * @function verify + * @memberof google.spanner.admin.instance.v1.CreateInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateInstanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + if (!$util.isString(message.instanceId)) + return "instanceId: string expected"; + if (message.instance != null && message.hasOwnProperty("instance")) { + var error = $root.google.spanner.admin.instance.v1.Instance.verify(message.instance); + if (error) + return "instance." + error; + } + return null; + }; + + /** + * Creates a CreateInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.instance.v1.CreateInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.instance.v1.CreateInstanceRequest} CreateInstanceRequest + */ + CreateInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.instance.v1.CreateInstanceRequest) + return object; + var message = new $root.google.spanner.admin.instance.v1.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.spanner.admin.instance.v1.CreateInstanceRequest.instance: object expected"); + message.instance = $root.google.spanner.admin.instance.v1.Instance.fromObject(object.instance); + } + return message; + }; + + /** + * Creates a plain object from a CreateInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.instance.v1.CreateInstanceRequest + * @static + * @param {google.spanner.admin.instance.v1.CreateInstanceRequest} message CreateInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.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.spanner.admin.instance.v1.Instance.toObject(message.instance, options); + return object; + }; + + /** + * Converts this CreateInstanceRequest to JSON. + * @function toJSON + * @memberof google.spanner.admin.instance.v1.CreateInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + CreateInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateInstanceRequest + * @function getTypeUrl + * @memberof google.spanner.admin.instance.v1.CreateInstanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.instance.v1.CreateInstanceRequest"; + }; + + return CreateInstanceRequest; + })(); + + v1.ListInstancesRequest = (function() { + + /** + * Properties of a ListInstancesRequest. + * @memberof google.spanner.admin.instance.v1 + * @interface IListInstancesRequest + * @property {string|null} [parent] ListInstancesRequest parent + * @property {number|null} [pageSize] ListInstancesRequest pageSize + * @property {string|null} [pageToken] ListInstancesRequest pageToken + * @property {string|null} [filter] ListInstancesRequest filter + * @property {google.protobuf.ITimestamp|null} [instanceDeadline] ListInstancesRequest instanceDeadline + */ + + /** + * Constructs a new ListInstancesRequest. + * @memberof google.spanner.admin.instance.v1 + * @classdesc Represents a ListInstancesRequest. + * @implements IListInstancesRequest + * @constructor + * @param {google.spanner.admin.instance.v1.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.spanner.admin.instance.v1.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.parent = ""; + + /** + * ListInstancesRequest pageSize. + * @member {number} pageSize + * @memberof google.spanner.admin.instance.v1.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.pageSize = 0; + + /** + * ListInstancesRequest pageToken. + * @member {string} pageToken + * @memberof google.spanner.admin.instance.v1.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.pageToken = ""; + + /** + * ListInstancesRequest filter. + * @member {string} filter + * @memberof google.spanner.admin.instance.v1.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.filter = ""; + + /** + * ListInstancesRequest instanceDeadline. + * @member {google.protobuf.ITimestamp|null|undefined} instanceDeadline + * @memberof google.spanner.admin.instance.v1.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.instanceDeadline = null; + + /** + * Creates a new ListInstancesRequest instance using the specified properties. + * @function create + * @memberof google.spanner.admin.instance.v1.ListInstancesRequest + * @static + * @param {google.spanner.admin.instance.v1.IListInstancesRequest=} [properties] Properties to set + * @returns {google.spanner.admin.instance.v1.ListInstancesRequest} ListInstancesRequest instance + */ + ListInstancesRequest.create = function create(properties) { + return new ListInstancesRequest(properties); + }; + + /** + * Encodes the specified ListInstancesRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancesRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.instance.v1.ListInstancesRequest + * @static + * @param {google.spanner.admin.instance.v1.IListInstancesRequest} message ListInstancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstancesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.instanceDeadline != null && Object.hasOwnProperty.call(message, "instanceDeadline")) + $root.google.protobuf.Timestamp.encode(message.instanceDeadline, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ListInstancesRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.instance.v1.ListInstancesRequest + * @static + * @param {google.spanner.admin.instance.v1.IListInstancesRequest} message ListInstancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstancesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListInstancesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.instance.v1.ListInstancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.instance.v1.ListInstancesRequest} ListInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstancesRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.ListInstancesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.instanceDeadline = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListInstancesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.instance.v1.ListInstancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.instance.v1.ListInstancesRequest} ListInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstancesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListInstancesRequest message. + * @function verify + * @memberof google.spanner.admin.instance.v1.ListInstancesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListInstancesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.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.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.instanceDeadline != null && message.hasOwnProperty("instanceDeadline")) { + var error = $root.google.protobuf.Timestamp.verify(message.instanceDeadline); + if (error) + return "instanceDeadline." + error; + } + return null; + }; + + /** + * Creates a ListInstancesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.instance.v1.ListInstancesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.instance.v1.ListInstancesRequest} ListInstancesRequest + */ + ListInstancesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.instance.v1.ListInstancesRequest) + return object; + var message = new $root.google.spanner.admin.instance.v1.ListInstancesRequest(); + 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); + if (object.filter != null) + message.filter = String(object.filter); + if (object.instanceDeadline != null) { + if (typeof object.instanceDeadline !== "object") + throw TypeError(".google.spanner.admin.instance.v1.ListInstancesRequest.instanceDeadline: object expected"); + message.instanceDeadline = $root.google.protobuf.Timestamp.fromObject(object.instanceDeadline); + } + return message; + }; + + /** + * Creates a plain object from a ListInstancesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.instance.v1.ListInstancesRequest + * @static + * @param {google.spanner.admin.instance.v1.ListInstancesRequest} message ListInstancesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListInstancesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.instanceDeadline = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.instanceDeadline != null && message.hasOwnProperty("instanceDeadline")) + object.instanceDeadline = $root.google.protobuf.Timestamp.toObject(message.instanceDeadline, options); + return object; + }; + + /** + * Converts this ListInstancesRequest to JSON. + * @function toJSON + * @memberof google.spanner.admin.instance.v1.ListInstancesRequest + * @instance + * @returns {Object.} JSON object + */ + ListInstancesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListInstancesRequest + * @function getTypeUrl + * @memberof google.spanner.admin.instance.v1.ListInstancesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListInstancesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.instance.v1.ListInstancesRequest"; + }; + + return ListInstancesRequest; + })(); + + v1.ListInstancesResponse = (function() { + + /** + * Properties of a ListInstancesResponse. + * @memberof google.spanner.admin.instance.v1 + * @interface IListInstancesResponse + * @property {Array.|null} [instances] ListInstancesResponse instances + * @property {string|null} [nextPageToken] ListInstancesResponse nextPageToken + * @property {Array.|null} [unreachable] ListInstancesResponse unreachable + */ + + /** + * Constructs a new ListInstancesResponse. + * @memberof google.spanner.admin.instance.v1 + * @classdesc Represents a ListInstancesResponse. + * @implements IListInstancesResponse + * @constructor + * @param {google.spanner.admin.instance.v1.IListInstancesResponse=} [properties] Properties to set + */ + function ListInstancesResponse(properties) { + this.instances = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListInstancesResponse instances. + * @member {Array.} instances + * @memberof google.spanner.admin.instance.v1.ListInstancesResponse + * @instance + */ + ListInstancesResponse.prototype.instances = $util.emptyArray; + + /** + * ListInstancesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.spanner.admin.instance.v1.ListInstancesResponse + * @instance + */ + ListInstancesResponse.prototype.nextPageToken = ""; + + /** + * ListInstancesResponse unreachable. + * @member {Array.} unreachable + * @memberof google.spanner.admin.instance.v1.ListInstancesResponse + * @instance + */ + ListInstancesResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListInstancesResponse instance using the specified properties. + * @function create + * @memberof google.spanner.admin.instance.v1.ListInstancesResponse + * @static + * @param {google.spanner.admin.instance.v1.IListInstancesResponse=} [properties] Properties to set + * @returns {google.spanner.admin.instance.v1.ListInstancesResponse} ListInstancesResponse instance + */ + ListInstancesResponse.create = function create(properties) { + return new ListInstancesResponse(properties); + }; + + /** + * Encodes the specified ListInstancesResponse message. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancesResponse.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.instance.v1.ListInstancesResponse + * @static + * @param {google.spanner.admin.instance.v1.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.spanner.admin.instance.v1.Instance.encode(message.instances[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListInstancesResponse message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.instance.v1.ListInstancesResponse + * @static + * @param {google.spanner.admin.instance.v1.IListInstancesResponse} message ListInstancesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstancesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListInstancesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.instance.v1.ListInstancesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.instance.v1.ListInstancesResponse} ListInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstancesResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.ListInstancesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.instances && message.instances.length)) + message.instances = []; + message.instances.push($root.google.spanner.admin.instance.v1.Instance.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListInstancesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.instance.v1.ListInstancesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.instance.v1.ListInstancesResponse} ListInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstancesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListInstancesResponse message. + * @function verify + * @memberof google.spanner.admin.instance.v1.ListInstancesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListInstancesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.instances != null && message.hasOwnProperty("instances")) { + if (!Array.isArray(message.instances)) + return "instances: array expected"; + for (var i = 0; i < message.instances.length; ++i) { + var error = $root.google.spanner.admin.instance.v1.Instance.verify(message.instances[i]); + if (error) + return "instances." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListInstancesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.instance.v1.ListInstancesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.instance.v1.ListInstancesResponse} ListInstancesResponse + */ + ListInstancesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.instance.v1.ListInstancesResponse) + return object; + var message = new $root.google.spanner.admin.instance.v1.ListInstancesResponse(); + if (object.instances) { + if (!Array.isArray(object.instances)) + throw TypeError(".google.spanner.admin.instance.v1.ListInstancesResponse.instances: array expected"); + message.instances = []; + for (var i = 0; i < object.instances.length; ++i) { + if (typeof object.instances[i] !== "object") + throw TypeError(".google.spanner.admin.instance.v1.ListInstancesResponse.instances: object expected"); + message.instances[i] = $root.google.spanner.admin.instance.v1.Instance.fromObject(object.instances[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.spanner.admin.instance.v1.ListInstancesResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListInstancesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.instance.v1.ListInstancesResponse + * @static + * @param {google.spanner.admin.instance.v1.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.unreachable = []; + } + 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.spanner.admin.instance.v1.Instance.toObject(message.instances[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListInstancesResponse to JSON. + * @function toJSON + * @memberof google.spanner.admin.instance.v1.ListInstancesResponse + * @instance + * @returns {Object.} JSON object + */ + ListInstancesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListInstancesResponse + * @function getTypeUrl + * @memberof google.spanner.admin.instance.v1.ListInstancesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListInstancesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.instance.v1.ListInstancesResponse"; + }; + + return ListInstancesResponse; + })(); + + v1.UpdateInstanceRequest = (function() { + + /** + * Properties of an UpdateInstanceRequest. + * @memberof google.spanner.admin.instance.v1 + * @interface IUpdateInstanceRequest + * @property {google.spanner.admin.instance.v1.IInstance|null} [instance] UpdateInstanceRequest instance + * @property {google.protobuf.IFieldMask|null} [fieldMask] UpdateInstanceRequest fieldMask + */ + + /** + * Constructs a new UpdateInstanceRequest. + * @memberof google.spanner.admin.instance.v1 + * @classdesc Represents an UpdateInstanceRequest. + * @implements IUpdateInstanceRequest + * @constructor + * @param {google.spanner.admin.instance.v1.IUpdateInstanceRequest=} [properties] Properties to set + */ + function UpdateInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateInstanceRequest instance. + * @member {google.spanner.admin.instance.v1.IInstance|null|undefined} instance + * @memberof google.spanner.admin.instance.v1.UpdateInstanceRequest + * @instance + */ + UpdateInstanceRequest.prototype.instance = null; + + /** + * UpdateInstanceRequest fieldMask. + * @member {google.protobuf.IFieldMask|null|undefined} fieldMask + * @memberof google.spanner.admin.instance.v1.UpdateInstanceRequest + * @instance + */ + UpdateInstanceRequest.prototype.fieldMask = null; + + /** + * Creates a new UpdateInstanceRequest instance using the specified properties. + * @function create + * @memberof google.spanner.admin.instance.v1.UpdateInstanceRequest + * @static + * @param {google.spanner.admin.instance.v1.IUpdateInstanceRequest=} [properties] Properties to set + * @returns {google.spanner.admin.instance.v1.UpdateInstanceRequest} UpdateInstanceRequest instance + */ + UpdateInstanceRequest.create = function create(properties) { + return new UpdateInstanceRequest(properties); + }; + + /** + * Encodes the specified UpdateInstanceRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.UpdateInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.instance.v1.UpdateInstanceRequest + * @static + * @param {google.spanner.admin.instance.v1.IUpdateInstanceRequest} message UpdateInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + $root.google.spanner.admin.instance.v1.Instance.encode(message.instance, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fieldMask != null && Object.hasOwnProperty.call(message, "fieldMask")) + $root.google.protobuf.FieldMask.encode(message.fieldMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateInstanceRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.UpdateInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.instance.v1.UpdateInstanceRequest + * @static + * @param {google.spanner.admin.instance.v1.IUpdateInstanceRequest} message UpdateInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.instance.v1.UpdateInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.instance.v1.UpdateInstanceRequest} UpdateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateInstanceRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.UpdateInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.instance = $root.google.spanner.admin.instance.v1.Instance.decode(reader, reader.uint32()); + break; + } + case 2: { + message.fieldMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.instance.v1.UpdateInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.instance.v1.UpdateInstanceRequest} UpdateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateInstanceRequest message. + * @function verify + * @memberof google.spanner.admin.instance.v1.UpdateInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateInstanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.instance != null && message.hasOwnProperty("instance")) { + var error = $root.google.spanner.admin.instance.v1.Instance.verify(message.instance); + if (error) + return "instance." + error; + } + if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.fieldMask); + if (error) + return "fieldMask." + error; + } + return null; + }; + + /** + * Creates an UpdateInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.instance.v1.UpdateInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.instance.v1.UpdateInstanceRequest} UpdateInstanceRequest + */ + UpdateInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.instance.v1.UpdateInstanceRequest) + return object; + var message = new $root.google.spanner.admin.instance.v1.UpdateInstanceRequest(); + if (object.instance != null) { + if (typeof object.instance !== "object") + throw TypeError(".google.spanner.admin.instance.v1.UpdateInstanceRequest.instance: object expected"); + message.instance = $root.google.spanner.admin.instance.v1.Instance.fromObject(object.instance); + } + if (object.fieldMask != null) { + if (typeof object.fieldMask !== "object") + throw TypeError(".google.spanner.admin.instance.v1.UpdateInstanceRequest.fieldMask: object expected"); + message.fieldMask = $root.google.protobuf.FieldMask.fromObject(object.fieldMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.instance.v1.UpdateInstanceRequest + * @static + * @param {google.spanner.admin.instance.v1.UpdateInstanceRequest} message UpdateInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.instance = null; + object.fieldMask = null; + } + if (message.instance != null && message.hasOwnProperty("instance")) + object.instance = $root.google.spanner.admin.instance.v1.Instance.toObject(message.instance, options); + if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) + object.fieldMask = $root.google.protobuf.FieldMask.toObject(message.fieldMask, options); + return object; + }; + + /** + * Converts this UpdateInstanceRequest to JSON. + * @function toJSON + * @memberof google.spanner.admin.instance.v1.UpdateInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateInstanceRequest + * @function getTypeUrl + * @memberof google.spanner.admin.instance.v1.UpdateInstanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.instance.v1.UpdateInstanceRequest"; + }; + + return UpdateInstanceRequest; + })(); + + v1.DeleteInstanceRequest = (function() { + + /** + * Properties of a DeleteInstanceRequest. + * @memberof google.spanner.admin.instance.v1 + * @interface IDeleteInstanceRequest + * @property {string|null} [name] DeleteInstanceRequest name + */ + + /** + * Constructs a new DeleteInstanceRequest. + * @memberof google.spanner.admin.instance.v1 + * @classdesc Represents a DeleteInstanceRequest. + * @implements IDeleteInstanceRequest + * @constructor + * @param {google.spanner.admin.instance.v1.IDeleteInstanceRequest=} [properties] Properties to set + */ + function DeleteInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteInstanceRequest name. + * @member {string} name + * @memberof google.spanner.admin.instance.v1.DeleteInstanceRequest + * @instance + */ + DeleteInstanceRequest.prototype.name = ""; + + /** + * Creates a new DeleteInstanceRequest instance using the specified properties. + * @function create + * @memberof google.spanner.admin.instance.v1.DeleteInstanceRequest + * @static + * @param {google.spanner.admin.instance.v1.IDeleteInstanceRequest=} [properties] Properties to set + * @returns {google.spanner.admin.instance.v1.DeleteInstanceRequest} DeleteInstanceRequest instance + */ + DeleteInstanceRequest.create = function create(properties) { + return new DeleteInstanceRequest(properties); + }; + + /** + * Encodes the specified DeleteInstanceRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.DeleteInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.instance.v1.DeleteInstanceRequest + * @static + * @param {google.spanner.admin.instance.v1.IDeleteInstanceRequest} message DeleteInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteInstanceRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.DeleteInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.instance.v1.DeleteInstanceRequest + * @static + * @param {google.spanner.admin.instance.v1.IDeleteInstanceRequest} message DeleteInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.instance.v1.DeleteInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.instance.v1.DeleteInstanceRequest} DeleteInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteInstanceRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.DeleteInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.instance.v1.DeleteInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.instance.v1.DeleteInstanceRequest} DeleteInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteInstanceRequest message. + * @function verify + * @memberof google.spanner.admin.instance.v1.DeleteInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteInstanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.instance.v1.DeleteInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.instance.v1.DeleteInstanceRequest} DeleteInstanceRequest + */ + DeleteInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.instance.v1.DeleteInstanceRequest) + return object; + var message = new $root.google.spanner.admin.instance.v1.DeleteInstanceRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.instance.v1.DeleteInstanceRequest + * @static + * @param {google.spanner.admin.instance.v1.DeleteInstanceRequest} message DeleteInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteInstanceRequest to JSON. + * @function toJSON + * @memberof google.spanner.admin.instance.v1.DeleteInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteInstanceRequest + * @function getTypeUrl + * @memberof google.spanner.admin.instance.v1.DeleteInstanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.instance.v1.DeleteInstanceRequest"; + }; + + return DeleteInstanceRequest; + })(); + + v1.CreateInstanceMetadata = (function() { + + /** + * Properties of a CreateInstanceMetadata. + * @memberof google.spanner.admin.instance.v1 + * @interface ICreateInstanceMetadata + * @property {google.spanner.admin.instance.v1.IInstance|null} [instance] CreateInstanceMetadata instance + * @property {google.protobuf.ITimestamp|null} [startTime] CreateInstanceMetadata startTime + * @property {google.protobuf.ITimestamp|null} [cancelTime] CreateInstanceMetadata cancelTime + * @property {google.protobuf.ITimestamp|null} [endTime] CreateInstanceMetadata endTime + * @property {google.spanner.admin.instance.v1.FulfillmentPeriod|null} [expectedFulfillmentPeriod] CreateInstanceMetadata expectedFulfillmentPeriod + */ + + /** + * Constructs a new CreateInstanceMetadata. + * @memberof google.spanner.admin.instance.v1 + * @classdesc Represents a CreateInstanceMetadata. + * @implements ICreateInstanceMetadata + * @constructor + * @param {google.spanner.admin.instance.v1.ICreateInstanceMetadata=} [properties] Properties to set + */ + function CreateInstanceMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateInstanceMetadata instance. + * @member {google.spanner.admin.instance.v1.IInstance|null|undefined} instance + * @memberof google.spanner.admin.instance.v1.CreateInstanceMetadata + * @instance + */ + CreateInstanceMetadata.prototype.instance = null; + + /** + * CreateInstanceMetadata startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.spanner.admin.instance.v1.CreateInstanceMetadata + * @instance + */ + CreateInstanceMetadata.prototype.startTime = null; + + /** + * CreateInstanceMetadata cancelTime. + * @member {google.protobuf.ITimestamp|null|undefined} cancelTime + * @memberof google.spanner.admin.instance.v1.CreateInstanceMetadata + * @instance + */ + CreateInstanceMetadata.prototype.cancelTime = null; + + /** + * CreateInstanceMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.spanner.admin.instance.v1.CreateInstanceMetadata + * @instance + */ + CreateInstanceMetadata.prototype.endTime = null; + + /** + * CreateInstanceMetadata expectedFulfillmentPeriod. + * @member {google.spanner.admin.instance.v1.FulfillmentPeriod} expectedFulfillmentPeriod + * @memberof google.spanner.admin.instance.v1.CreateInstanceMetadata + * @instance + */ + CreateInstanceMetadata.prototype.expectedFulfillmentPeriod = 0; + + /** + * Creates a new CreateInstanceMetadata instance using the specified properties. + * @function create + * @memberof google.spanner.admin.instance.v1.CreateInstanceMetadata + * @static + * @param {google.spanner.admin.instance.v1.ICreateInstanceMetadata=} [properties] Properties to set + * @returns {google.spanner.admin.instance.v1.CreateInstanceMetadata} CreateInstanceMetadata instance + */ + CreateInstanceMetadata.create = function create(properties) { + return new CreateInstanceMetadata(properties); + }; + + /** + * Encodes the specified CreateInstanceMetadata message. Does not implicitly {@link google.spanner.admin.instance.v1.CreateInstanceMetadata.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.instance.v1.CreateInstanceMetadata + * @static + * @param {google.spanner.admin.instance.v1.ICreateInstanceMetadata} message CreateInstanceMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateInstanceMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + $root.google.spanner.admin.instance.v1.Instance.encode(message.instance, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.cancelTime != null && Object.hasOwnProperty.call(message, "cancelTime")) + $root.google.protobuf.Timestamp.encode(message.cancelTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.expectedFulfillmentPeriod != null && Object.hasOwnProperty.call(message, "expectedFulfillmentPeriod")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.expectedFulfillmentPeriod); + return writer; + }; + + /** + * Encodes the specified CreateInstanceMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.CreateInstanceMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.instance.v1.CreateInstanceMetadata + * @static + * @param {google.spanner.admin.instance.v1.ICreateInstanceMetadata} message CreateInstanceMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateInstanceMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateInstanceMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.instance.v1.CreateInstanceMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.instance.v1.CreateInstanceMetadata} CreateInstanceMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateInstanceMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.CreateInstanceMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.instance = $root.google.spanner.admin.instance.v1.Instance.decode(reader, reader.uint32()); + break; + } + case 2: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.cancelTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.expectedFulfillmentPeriod = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateInstanceMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.instance.v1.CreateInstanceMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.instance.v1.CreateInstanceMetadata} CreateInstanceMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateInstanceMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateInstanceMetadata message. + * @function verify + * @memberof google.spanner.admin.instance.v1.CreateInstanceMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateInstanceMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.instance != null && message.hasOwnProperty("instance")) { + var error = $root.google.spanner.admin.instance.v1.Instance.verify(message.instance); + if (error) + return "instance." + error; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.cancelTime); + if (error) + return "cancelTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.expectedFulfillmentPeriod != null && message.hasOwnProperty("expectedFulfillmentPeriod")) + switch (message.expectedFulfillmentPeriod) { + default: + return "expectedFulfillmentPeriod: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a CreateInstanceMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.instance.v1.CreateInstanceMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.instance.v1.CreateInstanceMetadata} CreateInstanceMetadata + */ + CreateInstanceMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.instance.v1.CreateInstanceMetadata) + return object; + var message = new $root.google.spanner.admin.instance.v1.CreateInstanceMetadata(); + if (object.instance != null) { + if (typeof object.instance !== "object") + throw TypeError(".google.spanner.admin.instance.v1.CreateInstanceMetadata.instance: object expected"); + message.instance = $root.google.spanner.admin.instance.v1.Instance.fromObject(object.instance); + } + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.spanner.admin.instance.v1.CreateInstanceMetadata.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.cancelTime != null) { + if (typeof object.cancelTime !== "object") + throw TypeError(".google.spanner.admin.instance.v1.CreateInstanceMetadata.cancelTime: object expected"); + message.cancelTime = $root.google.protobuf.Timestamp.fromObject(object.cancelTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.spanner.admin.instance.v1.CreateInstanceMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + switch (object.expectedFulfillmentPeriod) { + default: + if (typeof object.expectedFulfillmentPeriod === "number") { + message.expectedFulfillmentPeriod = object.expectedFulfillmentPeriod; + break; + } + break; + case "FULFILLMENT_PERIOD_UNSPECIFIED": + case 0: + message.expectedFulfillmentPeriod = 0; + break; + case "FULFILLMENT_PERIOD_NORMAL": + case 1: + message.expectedFulfillmentPeriod = 1; + break; + case "FULFILLMENT_PERIOD_EXTENDED": + case 2: + message.expectedFulfillmentPeriod = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a CreateInstanceMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.instance.v1.CreateInstanceMetadata + * @static + * @param {google.spanner.admin.instance.v1.CreateInstanceMetadata} message CreateInstanceMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateInstanceMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.instance = null; + object.startTime = null; + object.cancelTime = null; + object.endTime = null; + object.expectedFulfillmentPeriod = options.enums === String ? "FULFILLMENT_PERIOD_UNSPECIFIED" : 0; + } + if (message.instance != null && message.hasOwnProperty("instance")) + object.instance = $root.google.spanner.admin.instance.v1.Instance.toObject(message.instance, options); + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) + object.cancelTime = $root.google.protobuf.Timestamp.toObject(message.cancelTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.expectedFulfillmentPeriod != null && message.hasOwnProperty("expectedFulfillmentPeriod")) + object.expectedFulfillmentPeriod = options.enums === String ? $root.google.spanner.admin.instance.v1.FulfillmentPeriod[message.expectedFulfillmentPeriod] === undefined ? message.expectedFulfillmentPeriod : $root.google.spanner.admin.instance.v1.FulfillmentPeriod[message.expectedFulfillmentPeriod] : message.expectedFulfillmentPeriod; + return object; + }; + + /** + * Converts this CreateInstanceMetadata to JSON. + * @function toJSON + * @memberof google.spanner.admin.instance.v1.CreateInstanceMetadata + * @instance + * @returns {Object.} JSON object + */ + CreateInstanceMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateInstanceMetadata + * @function getTypeUrl + * @memberof google.spanner.admin.instance.v1.CreateInstanceMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateInstanceMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.instance.v1.CreateInstanceMetadata"; + }; + + return CreateInstanceMetadata; + })(); + + v1.UpdateInstanceMetadata = (function() { + + /** + * Properties of an UpdateInstanceMetadata. + * @memberof google.spanner.admin.instance.v1 + * @interface IUpdateInstanceMetadata + * @property {google.spanner.admin.instance.v1.IInstance|null} [instance] UpdateInstanceMetadata instance + * @property {google.protobuf.ITimestamp|null} [startTime] UpdateInstanceMetadata startTime + * @property {google.protobuf.ITimestamp|null} [cancelTime] UpdateInstanceMetadata cancelTime + * @property {google.protobuf.ITimestamp|null} [endTime] UpdateInstanceMetadata endTime + * @property {google.spanner.admin.instance.v1.FulfillmentPeriod|null} [expectedFulfillmentPeriod] UpdateInstanceMetadata expectedFulfillmentPeriod + */ + + /** + * Constructs a new UpdateInstanceMetadata. + * @memberof google.spanner.admin.instance.v1 + * @classdesc Represents an UpdateInstanceMetadata. + * @implements IUpdateInstanceMetadata + * @constructor + * @param {google.spanner.admin.instance.v1.IUpdateInstanceMetadata=} [properties] Properties to set + */ + function UpdateInstanceMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateInstanceMetadata instance. + * @member {google.spanner.admin.instance.v1.IInstance|null|undefined} instance + * @memberof google.spanner.admin.instance.v1.UpdateInstanceMetadata + * @instance + */ + UpdateInstanceMetadata.prototype.instance = null; + + /** + * UpdateInstanceMetadata startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.spanner.admin.instance.v1.UpdateInstanceMetadata + * @instance + */ + UpdateInstanceMetadata.prototype.startTime = null; + + /** + * UpdateInstanceMetadata cancelTime. + * @member {google.protobuf.ITimestamp|null|undefined} cancelTime + * @memberof google.spanner.admin.instance.v1.UpdateInstanceMetadata + * @instance + */ + UpdateInstanceMetadata.prototype.cancelTime = null; + + /** + * UpdateInstanceMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.spanner.admin.instance.v1.UpdateInstanceMetadata + * @instance + */ + UpdateInstanceMetadata.prototype.endTime = null; + + /** + * UpdateInstanceMetadata expectedFulfillmentPeriod. + * @member {google.spanner.admin.instance.v1.FulfillmentPeriod} expectedFulfillmentPeriod + * @memberof google.spanner.admin.instance.v1.UpdateInstanceMetadata + * @instance + */ + UpdateInstanceMetadata.prototype.expectedFulfillmentPeriod = 0; + + /** + * Creates a new UpdateInstanceMetadata instance using the specified properties. + * @function create + * @memberof google.spanner.admin.instance.v1.UpdateInstanceMetadata + * @static + * @param {google.spanner.admin.instance.v1.IUpdateInstanceMetadata=} [properties] Properties to set + * @returns {google.spanner.admin.instance.v1.UpdateInstanceMetadata} UpdateInstanceMetadata instance + */ + UpdateInstanceMetadata.create = function create(properties) { + return new UpdateInstanceMetadata(properties); + }; + + /** + * Encodes the specified UpdateInstanceMetadata message. Does not implicitly {@link google.spanner.admin.instance.v1.UpdateInstanceMetadata.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.instance.v1.UpdateInstanceMetadata + * @static + * @param {google.spanner.admin.instance.v1.IUpdateInstanceMetadata} message UpdateInstanceMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateInstanceMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + $root.google.spanner.admin.instance.v1.Instance.encode(message.instance, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.cancelTime != null && Object.hasOwnProperty.call(message, "cancelTime")) + $root.google.protobuf.Timestamp.encode(message.cancelTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.expectedFulfillmentPeriod != null && Object.hasOwnProperty.call(message, "expectedFulfillmentPeriod")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.expectedFulfillmentPeriod); + return writer; + }; + + /** + * Encodes the specified UpdateInstanceMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.UpdateInstanceMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.instance.v1.UpdateInstanceMetadata + * @static + * @param {google.spanner.admin.instance.v1.IUpdateInstanceMetadata} message UpdateInstanceMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateInstanceMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateInstanceMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.instance.v1.UpdateInstanceMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.instance.v1.UpdateInstanceMetadata} UpdateInstanceMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateInstanceMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.UpdateInstanceMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.instance = $root.google.spanner.admin.instance.v1.Instance.decode(reader, reader.uint32()); + break; + } + case 2: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.cancelTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.expectedFulfillmentPeriod = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateInstanceMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.instance.v1.UpdateInstanceMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.instance.v1.UpdateInstanceMetadata} UpdateInstanceMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateInstanceMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateInstanceMetadata message. + * @function verify + * @memberof google.spanner.admin.instance.v1.UpdateInstanceMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateInstanceMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.instance != null && message.hasOwnProperty("instance")) { + var error = $root.google.spanner.admin.instance.v1.Instance.verify(message.instance); + if (error) + return "instance." + error; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.cancelTime); + if (error) + return "cancelTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.expectedFulfillmentPeriod != null && message.hasOwnProperty("expectedFulfillmentPeriod")) + switch (message.expectedFulfillmentPeriod) { + default: + return "expectedFulfillmentPeriod: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an UpdateInstanceMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.instance.v1.UpdateInstanceMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.instance.v1.UpdateInstanceMetadata} UpdateInstanceMetadata + */ + UpdateInstanceMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.instance.v1.UpdateInstanceMetadata) + return object; + var message = new $root.google.spanner.admin.instance.v1.UpdateInstanceMetadata(); + if (object.instance != null) { + if (typeof object.instance !== "object") + throw TypeError(".google.spanner.admin.instance.v1.UpdateInstanceMetadata.instance: object expected"); + message.instance = $root.google.spanner.admin.instance.v1.Instance.fromObject(object.instance); + } + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.spanner.admin.instance.v1.UpdateInstanceMetadata.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.cancelTime != null) { + if (typeof object.cancelTime !== "object") + throw TypeError(".google.spanner.admin.instance.v1.UpdateInstanceMetadata.cancelTime: object expected"); + message.cancelTime = $root.google.protobuf.Timestamp.fromObject(object.cancelTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.spanner.admin.instance.v1.UpdateInstanceMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + switch (object.expectedFulfillmentPeriod) { + default: + if (typeof object.expectedFulfillmentPeriod === "number") { + message.expectedFulfillmentPeriod = object.expectedFulfillmentPeriod; + break; + } + break; + case "FULFILLMENT_PERIOD_UNSPECIFIED": + case 0: + message.expectedFulfillmentPeriod = 0; + break; + case "FULFILLMENT_PERIOD_NORMAL": + case 1: + message.expectedFulfillmentPeriod = 1; + break; + case "FULFILLMENT_PERIOD_EXTENDED": + case 2: + message.expectedFulfillmentPeriod = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an UpdateInstanceMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.instance.v1.UpdateInstanceMetadata + * @static + * @param {google.spanner.admin.instance.v1.UpdateInstanceMetadata} message UpdateInstanceMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateInstanceMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.instance = null; + object.startTime = null; + object.cancelTime = null; + object.endTime = null; + object.expectedFulfillmentPeriod = options.enums === String ? "FULFILLMENT_PERIOD_UNSPECIFIED" : 0; + } + if (message.instance != null && message.hasOwnProperty("instance")) + object.instance = $root.google.spanner.admin.instance.v1.Instance.toObject(message.instance, options); + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) + object.cancelTime = $root.google.protobuf.Timestamp.toObject(message.cancelTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.expectedFulfillmentPeriod != null && message.hasOwnProperty("expectedFulfillmentPeriod")) + object.expectedFulfillmentPeriod = options.enums === String ? $root.google.spanner.admin.instance.v1.FulfillmentPeriod[message.expectedFulfillmentPeriod] === undefined ? message.expectedFulfillmentPeriod : $root.google.spanner.admin.instance.v1.FulfillmentPeriod[message.expectedFulfillmentPeriod] : message.expectedFulfillmentPeriod; + return object; + }; + + /** + * Converts this UpdateInstanceMetadata to JSON. + * @function toJSON + * @memberof google.spanner.admin.instance.v1.UpdateInstanceMetadata + * @instance + * @returns {Object.} JSON object + */ + UpdateInstanceMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateInstanceMetadata + * @function getTypeUrl + * @memberof google.spanner.admin.instance.v1.UpdateInstanceMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateInstanceMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.instance.v1.UpdateInstanceMetadata"; + }; + + return UpdateInstanceMetadata; + })(); + + v1.FreeInstanceMetadata = (function() { + + /** + * Properties of a FreeInstanceMetadata. + * @memberof google.spanner.admin.instance.v1 + * @interface IFreeInstanceMetadata + * @property {google.protobuf.ITimestamp|null} [expireTime] FreeInstanceMetadata expireTime + * @property {google.protobuf.ITimestamp|null} [upgradeTime] FreeInstanceMetadata upgradeTime + * @property {google.spanner.admin.instance.v1.FreeInstanceMetadata.ExpireBehavior|null} [expireBehavior] FreeInstanceMetadata expireBehavior + */ + + /** + * Constructs a new FreeInstanceMetadata. + * @memberof google.spanner.admin.instance.v1 + * @classdesc Represents a FreeInstanceMetadata. + * @implements IFreeInstanceMetadata + * @constructor + * @param {google.spanner.admin.instance.v1.IFreeInstanceMetadata=} [properties] Properties to set + */ + function FreeInstanceMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FreeInstanceMetadata expireTime. + * @member {google.protobuf.ITimestamp|null|undefined} expireTime + * @memberof google.spanner.admin.instance.v1.FreeInstanceMetadata + * @instance + */ + FreeInstanceMetadata.prototype.expireTime = null; + + /** + * FreeInstanceMetadata upgradeTime. + * @member {google.protobuf.ITimestamp|null|undefined} upgradeTime + * @memberof google.spanner.admin.instance.v1.FreeInstanceMetadata + * @instance + */ + FreeInstanceMetadata.prototype.upgradeTime = null; + + /** + * FreeInstanceMetadata expireBehavior. + * @member {google.spanner.admin.instance.v1.FreeInstanceMetadata.ExpireBehavior} expireBehavior + * @memberof google.spanner.admin.instance.v1.FreeInstanceMetadata + * @instance + */ + FreeInstanceMetadata.prototype.expireBehavior = 0; + + /** + * Creates a new FreeInstanceMetadata instance using the specified properties. + * @function create + * @memberof google.spanner.admin.instance.v1.FreeInstanceMetadata + * @static + * @param {google.spanner.admin.instance.v1.IFreeInstanceMetadata=} [properties] Properties to set + * @returns {google.spanner.admin.instance.v1.FreeInstanceMetadata} FreeInstanceMetadata instance + */ + FreeInstanceMetadata.create = function create(properties) { + return new FreeInstanceMetadata(properties); + }; + + /** + * Encodes the specified FreeInstanceMetadata message. Does not implicitly {@link google.spanner.admin.instance.v1.FreeInstanceMetadata.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.instance.v1.FreeInstanceMetadata + * @static + * @param {google.spanner.admin.instance.v1.IFreeInstanceMetadata} message FreeInstanceMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FreeInstanceMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) + $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.upgradeTime != null && Object.hasOwnProperty.call(message, "upgradeTime")) + $root.google.protobuf.Timestamp.encode(message.upgradeTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.expireBehavior != null && Object.hasOwnProperty.call(message, "expireBehavior")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.expireBehavior); + return writer; + }; + + /** + * Encodes the specified FreeInstanceMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.FreeInstanceMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.instance.v1.FreeInstanceMetadata + * @static + * @param {google.spanner.admin.instance.v1.IFreeInstanceMetadata} message FreeInstanceMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FreeInstanceMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FreeInstanceMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.instance.v1.FreeInstanceMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.instance.v1.FreeInstanceMetadata} FreeInstanceMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FreeInstanceMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.FreeInstanceMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.upgradeTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.expireBehavior = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FreeInstanceMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.instance.v1.FreeInstanceMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.instance.v1.FreeInstanceMetadata} FreeInstanceMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FreeInstanceMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FreeInstanceMetadata message. + * @function verify + * @memberof google.spanner.admin.instance.v1.FreeInstanceMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FreeInstanceMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.expireTime != null && message.hasOwnProperty("expireTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.expireTime); + if (error) + return "expireTime." + error; + } + if (message.upgradeTime != null && message.hasOwnProperty("upgradeTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.upgradeTime); + if (error) + return "upgradeTime." + error; + } + if (message.expireBehavior != null && message.hasOwnProperty("expireBehavior")) + switch (message.expireBehavior) { + default: + return "expireBehavior: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a FreeInstanceMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.instance.v1.FreeInstanceMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.instance.v1.FreeInstanceMetadata} FreeInstanceMetadata + */ + FreeInstanceMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.instance.v1.FreeInstanceMetadata) + return object; + var message = new $root.google.spanner.admin.instance.v1.FreeInstanceMetadata(); + if (object.expireTime != null) { + if (typeof object.expireTime !== "object") + throw TypeError(".google.spanner.admin.instance.v1.FreeInstanceMetadata.expireTime: object expected"); + message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); + } + if (object.upgradeTime != null) { + if (typeof object.upgradeTime !== "object") + throw TypeError(".google.spanner.admin.instance.v1.FreeInstanceMetadata.upgradeTime: object expected"); + message.upgradeTime = $root.google.protobuf.Timestamp.fromObject(object.upgradeTime); + } + switch (object.expireBehavior) { + default: + if (typeof object.expireBehavior === "number") { + message.expireBehavior = object.expireBehavior; + break; + } + break; + case "EXPIRE_BEHAVIOR_UNSPECIFIED": + case 0: + message.expireBehavior = 0; + break; + case "FREE_TO_PROVISIONED": + case 1: + message.expireBehavior = 1; + break; + case "REMOVE_AFTER_GRACE_PERIOD": + case 2: + message.expireBehavior = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a FreeInstanceMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.instance.v1.FreeInstanceMetadata + * @static + * @param {google.spanner.admin.instance.v1.FreeInstanceMetadata} message FreeInstanceMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FreeInstanceMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.expireTime = null; + object.upgradeTime = null; + object.expireBehavior = options.enums === String ? "EXPIRE_BEHAVIOR_UNSPECIFIED" : 0; + } + if (message.expireTime != null && message.hasOwnProperty("expireTime")) + object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); + if (message.upgradeTime != null && message.hasOwnProperty("upgradeTime")) + object.upgradeTime = $root.google.protobuf.Timestamp.toObject(message.upgradeTime, options); + if (message.expireBehavior != null && message.hasOwnProperty("expireBehavior")) + object.expireBehavior = options.enums === String ? $root.google.spanner.admin.instance.v1.FreeInstanceMetadata.ExpireBehavior[message.expireBehavior] === undefined ? message.expireBehavior : $root.google.spanner.admin.instance.v1.FreeInstanceMetadata.ExpireBehavior[message.expireBehavior] : message.expireBehavior; + return object; + }; + + /** + * Converts this FreeInstanceMetadata to JSON. + * @function toJSON + * @memberof google.spanner.admin.instance.v1.FreeInstanceMetadata + * @instance + * @returns {Object.} JSON object + */ + FreeInstanceMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FreeInstanceMetadata + * @function getTypeUrl + * @memberof google.spanner.admin.instance.v1.FreeInstanceMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FreeInstanceMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.instance.v1.FreeInstanceMetadata"; + }; + + /** + * ExpireBehavior enum. + * @name google.spanner.admin.instance.v1.FreeInstanceMetadata.ExpireBehavior + * @enum {number} + * @property {number} EXPIRE_BEHAVIOR_UNSPECIFIED=0 EXPIRE_BEHAVIOR_UNSPECIFIED value + * @property {number} FREE_TO_PROVISIONED=1 FREE_TO_PROVISIONED value + * @property {number} REMOVE_AFTER_GRACE_PERIOD=2 REMOVE_AFTER_GRACE_PERIOD value + */ + FreeInstanceMetadata.ExpireBehavior = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EXPIRE_BEHAVIOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "FREE_TO_PROVISIONED"] = 1; + values[valuesById[2] = "REMOVE_AFTER_GRACE_PERIOD"] = 2; + return values; + })(); + + return FreeInstanceMetadata; + })(); + + v1.CreateInstanceConfigMetadata = (function() { + + /** + * Properties of a CreateInstanceConfigMetadata. + * @memberof google.spanner.admin.instance.v1 + * @interface ICreateInstanceConfigMetadata + * @property {google.spanner.admin.instance.v1.IInstanceConfig|null} [instanceConfig] CreateInstanceConfigMetadata instanceConfig + * @property {google.spanner.admin.instance.v1.IOperationProgress|null} [progress] CreateInstanceConfigMetadata progress + * @property {google.protobuf.ITimestamp|null} [cancelTime] CreateInstanceConfigMetadata cancelTime + */ + + /** + * Constructs a new CreateInstanceConfigMetadata. + * @memberof google.spanner.admin.instance.v1 + * @classdesc Represents a CreateInstanceConfigMetadata. + * @implements ICreateInstanceConfigMetadata + * @constructor + * @param {google.spanner.admin.instance.v1.ICreateInstanceConfigMetadata=} [properties] Properties to set + */ + function CreateInstanceConfigMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateInstanceConfigMetadata instanceConfig. + * @member {google.spanner.admin.instance.v1.IInstanceConfig|null|undefined} instanceConfig + * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigMetadata + * @instance + */ + CreateInstanceConfigMetadata.prototype.instanceConfig = null; + + /** + * CreateInstanceConfigMetadata progress. + * @member {google.spanner.admin.instance.v1.IOperationProgress|null|undefined} progress + * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigMetadata + * @instance + */ + CreateInstanceConfigMetadata.prototype.progress = null; + + /** + * CreateInstanceConfigMetadata cancelTime. + * @member {google.protobuf.ITimestamp|null|undefined} cancelTime + * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigMetadata + * @instance + */ + CreateInstanceConfigMetadata.prototype.cancelTime = null; + + /** + * Creates a new CreateInstanceConfigMetadata instance using the specified properties. + * @function create + * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigMetadata + * @static + * @param {google.spanner.admin.instance.v1.ICreateInstanceConfigMetadata=} [properties] Properties to set + * @returns {google.spanner.admin.instance.v1.CreateInstanceConfigMetadata} CreateInstanceConfigMetadata instance + */ + CreateInstanceConfigMetadata.create = function create(properties) { + return new CreateInstanceConfigMetadata(properties); + }; + + /** + * Encodes the specified CreateInstanceConfigMetadata message. Does not implicitly {@link google.spanner.admin.instance.v1.CreateInstanceConfigMetadata.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigMetadata + * @static + * @param {google.spanner.admin.instance.v1.ICreateInstanceConfigMetadata} message CreateInstanceConfigMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateInstanceConfigMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.instanceConfig != null && Object.hasOwnProperty.call(message, "instanceConfig")) + $root.google.spanner.admin.instance.v1.InstanceConfig.encode(message.instanceConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.progress != null && Object.hasOwnProperty.call(message, "progress")) + $root.google.spanner.admin.instance.v1.OperationProgress.encode(message.progress, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.cancelTime != null && Object.hasOwnProperty.call(message, "cancelTime")) + $root.google.protobuf.Timestamp.encode(message.cancelTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateInstanceConfigMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.CreateInstanceConfigMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigMetadata + * @static + * @param {google.spanner.admin.instance.v1.ICreateInstanceConfigMetadata} message CreateInstanceConfigMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateInstanceConfigMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateInstanceConfigMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.instance.v1.CreateInstanceConfigMetadata} CreateInstanceConfigMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateInstanceConfigMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.CreateInstanceConfigMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.instanceConfig = $root.google.spanner.admin.instance.v1.InstanceConfig.decode(reader, reader.uint32()); + break; + } + case 2: { + message.progress = $root.google.spanner.admin.instance.v1.OperationProgress.decode(reader, reader.uint32()); + break; + } + case 3: { + message.cancelTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateInstanceConfigMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.instance.v1.CreateInstanceConfigMetadata} CreateInstanceConfigMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateInstanceConfigMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateInstanceConfigMetadata message. + * @function verify + * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateInstanceConfigMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.instanceConfig != null && message.hasOwnProperty("instanceConfig")) { + var error = $root.google.spanner.admin.instance.v1.InstanceConfig.verify(message.instanceConfig); + if (error) + return "instanceConfig." + error; + } + if (message.progress != null && message.hasOwnProperty("progress")) { + var error = $root.google.spanner.admin.instance.v1.OperationProgress.verify(message.progress); + if (error) + return "progress." + error; + } + if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.cancelTime); + if (error) + return "cancelTime." + error; + } + return null; + }; + + /** + * Creates a CreateInstanceConfigMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.instance.v1.CreateInstanceConfigMetadata} CreateInstanceConfigMetadata + */ + CreateInstanceConfigMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.instance.v1.CreateInstanceConfigMetadata) + return object; + var message = new $root.google.spanner.admin.instance.v1.CreateInstanceConfigMetadata(); + if (object.instanceConfig != null) { + if (typeof object.instanceConfig !== "object") + throw TypeError(".google.spanner.admin.instance.v1.CreateInstanceConfigMetadata.instanceConfig: object expected"); + message.instanceConfig = $root.google.spanner.admin.instance.v1.InstanceConfig.fromObject(object.instanceConfig); + } + if (object.progress != null) { + if (typeof object.progress !== "object") + throw TypeError(".google.spanner.admin.instance.v1.CreateInstanceConfigMetadata.progress: object expected"); + message.progress = $root.google.spanner.admin.instance.v1.OperationProgress.fromObject(object.progress); + } + if (object.cancelTime != null) { + if (typeof object.cancelTime !== "object") + throw TypeError(".google.spanner.admin.instance.v1.CreateInstanceConfigMetadata.cancelTime: object expected"); + message.cancelTime = $root.google.protobuf.Timestamp.fromObject(object.cancelTime); + } + return message; + }; + + /** + * Creates a plain object from a CreateInstanceConfigMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigMetadata + * @static + * @param {google.spanner.admin.instance.v1.CreateInstanceConfigMetadata} message CreateInstanceConfigMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateInstanceConfigMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.instanceConfig = null; + object.progress = null; + object.cancelTime = null; + } + if (message.instanceConfig != null && message.hasOwnProperty("instanceConfig")) + object.instanceConfig = $root.google.spanner.admin.instance.v1.InstanceConfig.toObject(message.instanceConfig, options); + if (message.progress != null && message.hasOwnProperty("progress")) + object.progress = $root.google.spanner.admin.instance.v1.OperationProgress.toObject(message.progress, options); + if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) + object.cancelTime = $root.google.protobuf.Timestamp.toObject(message.cancelTime, options); + return object; + }; + + /** + * Converts this CreateInstanceConfigMetadata to JSON. + * @function toJSON + * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigMetadata + * @instance + * @returns {Object.} JSON object + */ + CreateInstanceConfigMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateInstanceConfigMetadata + * @function getTypeUrl + * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateInstanceConfigMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.instance.v1.CreateInstanceConfigMetadata"; + }; + + return CreateInstanceConfigMetadata; + })(); + + v1.UpdateInstanceConfigMetadata = (function() { + + /** + * Properties of an UpdateInstanceConfigMetadata. + * @memberof google.spanner.admin.instance.v1 + * @interface IUpdateInstanceConfigMetadata + * @property {google.spanner.admin.instance.v1.IInstanceConfig|null} [instanceConfig] UpdateInstanceConfigMetadata instanceConfig + * @property {google.spanner.admin.instance.v1.IOperationProgress|null} [progress] UpdateInstanceConfigMetadata progress + * @property {google.protobuf.ITimestamp|null} [cancelTime] UpdateInstanceConfigMetadata cancelTime + */ + + /** + * Constructs a new UpdateInstanceConfigMetadata. + * @memberof google.spanner.admin.instance.v1 + * @classdesc Represents an UpdateInstanceConfigMetadata. + * @implements IUpdateInstanceConfigMetadata + * @constructor + * @param {google.spanner.admin.instance.v1.IUpdateInstanceConfigMetadata=} [properties] Properties to set + */ + function UpdateInstanceConfigMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateInstanceConfigMetadata instanceConfig. + * @member {google.spanner.admin.instance.v1.IInstanceConfig|null|undefined} instanceConfig + * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata + * @instance + */ + UpdateInstanceConfigMetadata.prototype.instanceConfig = null; + + /** + * UpdateInstanceConfigMetadata progress. + * @member {google.spanner.admin.instance.v1.IOperationProgress|null|undefined} progress + * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata + * @instance + */ + UpdateInstanceConfigMetadata.prototype.progress = null; + + /** + * UpdateInstanceConfigMetadata cancelTime. + * @member {google.protobuf.ITimestamp|null|undefined} cancelTime + * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata + * @instance + */ + UpdateInstanceConfigMetadata.prototype.cancelTime = null; + + /** + * Creates a new UpdateInstanceConfigMetadata instance using the specified properties. + * @function create + * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata + * @static + * @param {google.spanner.admin.instance.v1.IUpdateInstanceConfigMetadata=} [properties] Properties to set + * @returns {google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata} UpdateInstanceConfigMetadata instance + */ + UpdateInstanceConfigMetadata.create = function create(properties) { + return new UpdateInstanceConfigMetadata(properties); + }; + + /** + * Encodes the specified UpdateInstanceConfigMetadata message. Does not implicitly {@link google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata + * @static + * @param {google.spanner.admin.instance.v1.IUpdateInstanceConfigMetadata} message UpdateInstanceConfigMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateInstanceConfigMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.instanceConfig != null && Object.hasOwnProperty.call(message, "instanceConfig")) + $root.google.spanner.admin.instance.v1.InstanceConfig.encode(message.instanceConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.progress != null && Object.hasOwnProperty.call(message, "progress")) + $root.google.spanner.admin.instance.v1.OperationProgress.encode(message.progress, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.cancelTime != null && Object.hasOwnProperty.call(message, "cancelTime")) + $root.google.protobuf.Timestamp.encode(message.cancelTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateInstanceConfigMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata + * @static + * @param {google.spanner.admin.instance.v1.IUpdateInstanceConfigMetadata} message UpdateInstanceConfigMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateInstanceConfigMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateInstanceConfigMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata} UpdateInstanceConfigMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateInstanceConfigMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.instanceConfig = $root.google.spanner.admin.instance.v1.InstanceConfig.decode(reader, reader.uint32()); + break; + } + case 2: { + message.progress = $root.google.spanner.admin.instance.v1.OperationProgress.decode(reader, reader.uint32()); + break; + } + case 3: { + message.cancelTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateInstanceConfigMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata} UpdateInstanceConfigMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateInstanceConfigMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateInstanceConfigMetadata message. + * @function verify + * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateInstanceConfigMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.instanceConfig != null && message.hasOwnProperty("instanceConfig")) { + var error = $root.google.spanner.admin.instance.v1.InstanceConfig.verify(message.instanceConfig); + if (error) + return "instanceConfig." + error; + } + if (message.progress != null && message.hasOwnProperty("progress")) { + var error = $root.google.spanner.admin.instance.v1.OperationProgress.verify(message.progress); + if (error) + return "progress." + error; + } + if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.cancelTime); + if (error) + return "cancelTime." + error; + } + return null; + }; + + /** + * Creates an UpdateInstanceConfigMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata} UpdateInstanceConfigMetadata + */ + UpdateInstanceConfigMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata) + return object; + var message = new $root.google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata(); + if (object.instanceConfig != null) { + if (typeof object.instanceConfig !== "object") + throw TypeError(".google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata.instanceConfig: object expected"); + message.instanceConfig = $root.google.spanner.admin.instance.v1.InstanceConfig.fromObject(object.instanceConfig); + } + if (object.progress != null) { + if (typeof object.progress !== "object") + throw TypeError(".google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata.progress: object expected"); + message.progress = $root.google.spanner.admin.instance.v1.OperationProgress.fromObject(object.progress); + } + if (object.cancelTime != null) { + if (typeof object.cancelTime !== "object") + throw TypeError(".google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata.cancelTime: object expected"); + message.cancelTime = $root.google.protobuf.Timestamp.fromObject(object.cancelTime); + } + return message; + }; + + /** + * Creates a plain object from an UpdateInstanceConfigMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata + * @static + * @param {google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata} message UpdateInstanceConfigMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateInstanceConfigMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.instanceConfig = null; + object.progress = null; + object.cancelTime = null; + } + if (message.instanceConfig != null && message.hasOwnProperty("instanceConfig")) + object.instanceConfig = $root.google.spanner.admin.instance.v1.InstanceConfig.toObject(message.instanceConfig, options); + if (message.progress != null && message.hasOwnProperty("progress")) + object.progress = $root.google.spanner.admin.instance.v1.OperationProgress.toObject(message.progress, options); + if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) + object.cancelTime = $root.google.protobuf.Timestamp.toObject(message.cancelTime, options); + return object; + }; + + /** + * Converts this UpdateInstanceConfigMetadata to JSON. + * @function toJSON + * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata + * @instance + * @returns {Object.} JSON object + */ + UpdateInstanceConfigMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateInstanceConfigMetadata + * @function getTypeUrl + * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateInstanceConfigMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata"; + }; + + return UpdateInstanceConfigMetadata; + })(); + + v1.InstancePartition = (function() { + + /** + * Properties of an InstancePartition. + * @memberof google.spanner.admin.instance.v1 + * @interface IInstancePartition + * @property {string|null} [name] InstancePartition name + * @property {string|null} [config] InstancePartition config + * @property {string|null} [displayName] InstancePartition displayName + * @property {number|null} [nodeCount] InstancePartition nodeCount + * @property {number|null} [processingUnits] InstancePartition processingUnits + * @property {google.spanner.admin.instance.v1.IAutoscalingConfig|null} [autoscalingConfig] InstancePartition autoscalingConfig + * @property {google.spanner.admin.instance.v1.InstancePartition.State|null} [state] InstancePartition state + * @property {google.protobuf.ITimestamp|null} [createTime] InstancePartition createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] InstancePartition updateTime + * @property {Array.|null} [referencingDatabases] InstancePartition referencingDatabases + * @property {Array.|null} [referencingBackups] InstancePartition referencingBackups + * @property {string|null} [etag] InstancePartition etag + */ + + /** + * Constructs a new InstancePartition. + * @memberof google.spanner.admin.instance.v1 + * @classdesc Represents an InstancePartition. + * @implements IInstancePartition + * @constructor + * @param {google.spanner.admin.instance.v1.IInstancePartition=} [properties] Properties to set + */ + function InstancePartition(properties) { + this.referencingDatabases = []; + this.referencingBackups = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstancePartition name. + * @member {string} name + * @memberof google.spanner.admin.instance.v1.InstancePartition + * @instance + */ + InstancePartition.prototype.name = ""; + + /** + * InstancePartition config. + * @member {string} config + * @memberof google.spanner.admin.instance.v1.InstancePartition + * @instance + */ + InstancePartition.prototype.config = ""; + + /** + * InstancePartition displayName. + * @member {string} displayName + * @memberof google.spanner.admin.instance.v1.InstancePartition + * @instance + */ + InstancePartition.prototype.displayName = ""; + + /** + * InstancePartition nodeCount. + * @member {number|null|undefined} nodeCount + * @memberof google.spanner.admin.instance.v1.InstancePartition + * @instance + */ + InstancePartition.prototype.nodeCount = null; + + /** + * InstancePartition processingUnits. + * @member {number|null|undefined} processingUnits + * @memberof google.spanner.admin.instance.v1.InstancePartition + * @instance + */ + InstancePartition.prototype.processingUnits = null; + + /** + * InstancePartition autoscalingConfig. + * @member {google.spanner.admin.instance.v1.IAutoscalingConfig|null|undefined} autoscalingConfig + * @memberof google.spanner.admin.instance.v1.InstancePartition + * @instance + */ + InstancePartition.prototype.autoscalingConfig = null; + + /** + * InstancePartition state. + * @member {google.spanner.admin.instance.v1.InstancePartition.State} state + * @memberof google.spanner.admin.instance.v1.InstancePartition + * @instance + */ + InstancePartition.prototype.state = 0; + + /** + * InstancePartition createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.spanner.admin.instance.v1.InstancePartition + * @instance + */ + InstancePartition.prototype.createTime = null; + + /** + * InstancePartition updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.spanner.admin.instance.v1.InstancePartition + * @instance + */ + InstancePartition.prototype.updateTime = null; + + /** + * InstancePartition referencingDatabases. + * @member {Array.} referencingDatabases + * @memberof google.spanner.admin.instance.v1.InstancePartition + * @instance + */ + InstancePartition.prototype.referencingDatabases = $util.emptyArray; + + /** + * InstancePartition referencingBackups. + * @member {Array.} referencingBackups + * @memberof google.spanner.admin.instance.v1.InstancePartition + * @instance + */ + InstancePartition.prototype.referencingBackups = $util.emptyArray; + + /** + * InstancePartition etag. + * @member {string} etag + * @memberof google.spanner.admin.instance.v1.InstancePartition + * @instance + */ + InstancePartition.prototype.etag = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InstancePartition computeCapacity. + * @member {"nodeCount"|"processingUnits"|undefined} computeCapacity + * @memberof google.spanner.admin.instance.v1.InstancePartition + * @instance + */ + Object.defineProperty(InstancePartition.prototype, "computeCapacity", { + get: $util.oneOfGetter($oneOfFields = ["nodeCount", "processingUnits"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InstancePartition instance using the specified properties. + * @function create + * @memberof google.spanner.admin.instance.v1.InstancePartition + * @static + * @param {google.spanner.admin.instance.v1.IInstancePartition=} [properties] Properties to set + * @returns {google.spanner.admin.instance.v1.InstancePartition} InstancePartition instance + */ + InstancePartition.create = function create(properties) { + return new InstancePartition(properties); + }; + + /** + * Encodes the specified InstancePartition message. Does not implicitly {@link google.spanner.admin.instance.v1.InstancePartition.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.instance.v1.InstancePartition + * @static + * @param {google.spanner.admin.instance.v1.IInstancePartition} message InstancePartition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstancePartition.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.config != null && Object.hasOwnProperty.call(message, "config")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.config); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.displayName); + if (message.nodeCount != null && Object.hasOwnProperty.call(message, "nodeCount")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.nodeCount); + if (message.processingUnits != null && Object.hasOwnProperty.call(message, "processingUnits")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.processingUnits); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.state); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.referencingDatabases != null && message.referencingDatabases.length) + for (var i = 0; i < message.referencingDatabases.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.referencingDatabases[i]); + if (message.referencingBackups != null && message.referencingBackups.length) + for (var i = 0; i < message.referencingBackups.length; ++i) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.referencingBackups[i]); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.etag); + if (message.autoscalingConfig != null && Object.hasOwnProperty.call(message, "autoscalingConfig")) + $root.google.spanner.admin.instance.v1.AutoscalingConfig.encode(message.autoscalingConfig, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InstancePartition message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.InstancePartition.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.instance.v1.InstancePartition + * @static + * @param {google.spanner.admin.instance.v1.IInstancePartition} message InstancePartition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstancePartition.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstancePartition message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.instance.v1.InstancePartition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.instance.v1.InstancePartition} InstancePartition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstancePartition.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.InstancePartition(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.config = reader.string(); + break; + } + case 3: { + message.displayName = reader.string(); + break; + } + case 5: { + message.nodeCount = reader.int32(); + break; + } + case 6: { + message.processingUnits = reader.int32(); + break; + } + case 13: { + message.autoscalingConfig = $root.google.spanner.admin.instance.v1.AutoscalingConfig.decode(reader, reader.uint32()); + break; + } + case 7: { + message.state = reader.int32(); + break; + } + case 8: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 9: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 10: { + if (!(message.referencingDatabases && message.referencingDatabases.length)) + message.referencingDatabases = []; + message.referencingDatabases.push(reader.string()); + break; + } + case 11: { + if (!(message.referencingBackups && message.referencingBackups.length)) + message.referencingBackups = []; + message.referencingBackups.push(reader.string()); + break; + } + case 12: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstancePartition message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.instance.v1.InstancePartition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.instance.v1.InstancePartition} InstancePartition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstancePartition.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstancePartition message. + * @function verify + * @memberof google.spanner.admin.instance.v1.InstancePartition + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstancePartition.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.config != null && message.hasOwnProperty("config")) + if (!$util.isString(message.config)) + return "config: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) { + properties.computeCapacity = 1; + if (!$util.isInteger(message.nodeCount)) + return "nodeCount: integer expected"; + } + if (message.processingUnits != null && message.hasOwnProperty("processingUnits")) { + if (properties.computeCapacity === 1) + return "computeCapacity: multiple values"; + properties.computeCapacity = 1; + if (!$util.isInteger(message.processingUnits)) + return "processingUnits: integer expected"; + } + if (message.autoscalingConfig != null && message.hasOwnProperty("autoscalingConfig")) { + var error = $root.google.spanner.admin.instance.v1.AutoscalingConfig.verify(message.autoscalingConfig); + if (error) + return "autoscalingConfig." + 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.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.referencingDatabases != null && message.hasOwnProperty("referencingDatabases")) { + if (!Array.isArray(message.referencingDatabases)) + return "referencingDatabases: array expected"; + for (var i = 0; i < message.referencingDatabases.length; ++i) + if (!$util.isString(message.referencingDatabases[i])) + return "referencingDatabases: string[] expected"; + } + if (message.referencingBackups != null && message.hasOwnProperty("referencingBackups")) { + if (!Array.isArray(message.referencingBackups)) + return "referencingBackups: array expected"; + for (var i = 0; i < message.referencingBackups.length; ++i) + if (!$util.isString(message.referencingBackups[i])) + return "referencingBackups: string[] expected"; + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates an InstancePartition message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.instance.v1.InstancePartition + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.instance.v1.InstancePartition} InstancePartition + */ + InstancePartition.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.instance.v1.InstancePartition) + return object; + var message = new $root.google.spanner.admin.instance.v1.InstancePartition(); + if (object.name != null) + message.name = String(object.name); + if (object.config != null) + message.config = String(object.config); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.nodeCount != null) + message.nodeCount = object.nodeCount | 0; + if (object.processingUnits != null) + message.processingUnits = object.processingUnits | 0; + if (object.autoscalingConfig != null) { + if (typeof object.autoscalingConfig !== "object") + throw TypeError(".google.spanner.admin.instance.v1.InstancePartition.autoscalingConfig: object expected"); + message.autoscalingConfig = $root.google.spanner.admin.instance.v1.AutoscalingConfig.fromObject(object.autoscalingConfig); + } + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "CREATING": + case 1: + message.state = 1; + break; + case "READY": + case 2: + message.state = 2; + break; + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.spanner.admin.instance.v1.InstancePartition.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.spanner.admin.instance.v1.InstancePartition.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.referencingDatabases) { + if (!Array.isArray(object.referencingDatabases)) + throw TypeError(".google.spanner.admin.instance.v1.InstancePartition.referencingDatabases: array expected"); + message.referencingDatabases = []; + for (var i = 0; i < object.referencingDatabases.length; ++i) + message.referencingDatabases[i] = String(object.referencingDatabases[i]); + } + if (object.referencingBackups) { + if (!Array.isArray(object.referencingBackups)) + throw TypeError(".google.spanner.admin.instance.v1.InstancePartition.referencingBackups: array expected"); + message.referencingBackups = []; + for (var i = 0; i < object.referencingBackups.length; ++i) + message.referencingBackups[i] = String(object.referencingBackups[i]); + } + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from an InstancePartition message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.instance.v1.InstancePartition + * @static + * @param {google.spanner.admin.instance.v1.InstancePartition} message InstancePartition + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstancePartition.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.referencingDatabases = []; + object.referencingBackups = []; + } + if (options.defaults) { + object.name = ""; + object.config = ""; + object.displayName = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.createTime = null; + object.updateTime = null; + object.etag = ""; + object.autoscalingConfig = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.config != null && message.hasOwnProperty("config")) + object.config = message.config; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) { + object.nodeCount = message.nodeCount; + if (options.oneofs) + object.computeCapacity = "nodeCount"; + } + if (message.processingUnits != null && message.hasOwnProperty("processingUnits")) { + object.processingUnits = message.processingUnits; + if (options.oneofs) + object.computeCapacity = "processingUnits"; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.spanner.admin.instance.v1.InstancePartition.State[message.state] === undefined ? message.state : $root.google.spanner.admin.instance.v1.InstancePartition.State[message.state] : message.state; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.referencingDatabases && message.referencingDatabases.length) { + object.referencingDatabases = []; + for (var j = 0; j < message.referencingDatabases.length; ++j) + object.referencingDatabases[j] = message.referencingDatabases[j]; + } + if (message.referencingBackups && message.referencingBackups.length) { + object.referencingBackups = []; + for (var j = 0; j < message.referencingBackups.length; ++j) + object.referencingBackups[j] = message.referencingBackups[j]; + } + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.autoscalingConfig != null && message.hasOwnProperty("autoscalingConfig")) + object.autoscalingConfig = $root.google.spanner.admin.instance.v1.AutoscalingConfig.toObject(message.autoscalingConfig, options); + return object; + }; + + /** + * Converts this InstancePartition to JSON. + * @function toJSON + * @memberof google.spanner.admin.instance.v1.InstancePartition + * @instance + * @returns {Object.} JSON object + */ + InstancePartition.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InstancePartition + * @function getTypeUrl + * @memberof google.spanner.admin.instance.v1.InstancePartition + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InstancePartition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.instance.v1.InstancePartition"; + }; + + /** + * State enum. + * @name google.spanner.admin.instance.v1.InstancePartition.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} CREATING=1 CREATING value + * @property {number} READY=2 READY value + */ + InstancePartition.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CREATING"] = 1; + values[valuesById[2] = "READY"] = 2; + return values; + })(); + + return InstancePartition; + })(); + + v1.CreateInstancePartitionMetadata = (function() { + + /** + * Properties of a CreateInstancePartitionMetadata. + * @memberof google.spanner.admin.instance.v1 + * @interface ICreateInstancePartitionMetadata + * @property {google.spanner.admin.instance.v1.IInstancePartition|null} [instancePartition] CreateInstancePartitionMetadata instancePartition + * @property {google.protobuf.ITimestamp|null} [startTime] CreateInstancePartitionMetadata startTime + * @property {google.protobuf.ITimestamp|null} [cancelTime] CreateInstancePartitionMetadata cancelTime + * @property {google.protobuf.ITimestamp|null} [endTime] CreateInstancePartitionMetadata endTime + */ + + /** + * Constructs a new CreateInstancePartitionMetadata. + * @memberof google.spanner.admin.instance.v1 + * @classdesc Represents a CreateInstancePartitionMetadata. + * @implements ICreateInstancePartitionMetadata + * @constructor + * @param {google.spanner.admin.instance.v1.ICreateInstancePartitionMetadata=} [properties] Properties to set + */ + function CreateInstancePartitionMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateInstancePartitionMetadata instancePartition. + * @member {google.spanner.admin.instance.v1.IInstancePartition|null|undefined} instancePartition + * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionMetadata + * @instance + */ + CreateInstancePartitionMetadata.prototype.instancePartition = null; + + /** + * CreateInstancePartitionMetadata startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionMetadata + * @instance + */ + CreateInstancePartitionMetadata.prototype.startTime = null; + + /** + * CreateInstancePartitionMetadata cancelTime. + * @member {google.protobuf.ITimestamp|null|undefined} cancelTime + * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionMetadata + * @instance + */ + CreateInstancePartitionMetadata.prototype.cancelTime = null; + + /** + * CreateInstancePartitionMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionMetadata + * @instance + */ + CreateInstancePartitionMetadata.prototype.endTime = null; + + /** + * Creates a new CreateInstancePartitionMetadata instance using the specified properties. + * @function create + * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionMetadata + * @static + * @param {google.spanner.admin.instance.v1.ICreateInstancePartitionMetadata=} [properties] Properties to set + * @returns {google.spanner.admin.instance.v1.CreateInstancePartitionMetadata} CreateInstancePartitionMetadata instance + */ + CreateInstancePartitionMetadata.create = function create(properties) { + return new CreateInstancePartitionMetadata(properties); + }; + + /** + * Encodes the specified CreateInstancePartitionMetadata message. Does not implicitly {@link google.spanner.admin.instance.v1.CreateInstancePartitionMetadata.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionMetadata + * @static + * @param {google.spanner.admin.instance.v1.ICreateInstancePartitionMetadata} message CreateInstancePartitionMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateInstancePartitionMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.instancePartition != null && Object.hasOwnProperty.call(message, "instancePartition")) + $root.google.spanner.admin.instance.v1.InstancePartition.encode(message.instancePartition, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.cancelTime != null && Object.hasOwnProperty.call(message, "cancelTime")) + $root.google.protobuf.Timestamp.encode(message.cancelTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateInstancePartitionMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.CreateInstancePartitionMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionMetadata + * @static + * @param {google.spanner.admin.instance.v1.ICreateInstancePartitionMetadata} message CreateInstancePartitionMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateInstancePartitionMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateInstancePartitionMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.instance.v1.CreateInstancePartitionMetadata} CreateInstancePartitionMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateInstancePartitionMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.CreateInstancePartitionMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.instancePartition = $root.google.spanner.admin.instance.v1.InstancePartition.decode(reader, reader.uint32()); + break; + } + case 2: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.cancelTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateInstancePartitionMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.instance.v1.CreateInstancePartitionMetadata} CreateInstancePartitionMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateInstancePartitionMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateInstancePartitionMetadata message. + * @function verify + * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateInstancePartitionMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.instancePartition != null && message.hasOwnProperty("instancePartition")) { + var error = $root.google.spanner.admin.instance.v1.InstancePartition.verify(message.instancePartition); + if (error) + return "instancePartition." + error; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.cancelTime); + if (error) + return "cancelTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + return null; + }; + + /** + * Creates a CreateInstancePartitionMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.instance.v1.CreateInstancePartitionMetadata} CreateInstancePartitionMetadata + */ + CreateInstancePartitionMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.instance.v1.CreateInstancePartitionMetadata) + return object; + var message = new $root.google.spanner.admin.instance.v1.CreateInstancePartitionMetadata(); + if (object.instancePartition != null) { + if (typeof object.instancePartition !== "object") + throw TypeError(".google.spanner.admin.instance.v1.CreateInstancePartitionMetadata.instancePartition: object expected"); + message.instancePartition = $root.google.spanner.admin.instance.v1.InstancePartition.fromObject(object.instancePartition); + } + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.spanner.admin.instance.v1.CreateInstancePartitionMetadata.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.cancelTime != null) { + if (typeof object.cancelTime !== "object") + throw TypeError(".google.spanner.admin.instance.v1.CreateInstancePartitionMetadata.cancelTime: object expected"); + message.cancelTime = $root.google.protobuf.Timestamp.fromObject(object.cancelTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.spanner.admin.instance.v1.CreateInstancePartitionMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + return message; + }; + + /** + * Creates a plain object from a CreateInstancePartitionMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionMetadata + * @static + * @param {google.spanner.admin.instance.v1.CreateInstancePartitionMetadata} message CreateInstancePartitionMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateInstancePartitionMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.instancePartition = null; + object.startTime = null; + object.cancelTime = null; + object.endTime = null; + } + if (message.instancePartition != null && message.hasOwnProperty("instancePartition")) + object.instancePartition = $root.google.spanner.admin.instance.v1.InstancePartition.toObject(message.instancePartition, options); + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) + object.cancelTime = $root.google.protobuf.Timestamp.toObject(message.cancelTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + return object; + }; + + /** + * Converts this CreateInstancePartitionMetadata to JSON. + * @function toJSON + * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionMetadata + * @instance + * @returns {Object.} JSON object + */ + CreateInstancePartitionMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateInstancePartitionMetadata + * @function getTypeUrl + * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateInstancePartitionMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.instance.v1.CreateInstancePartitionMetadata"; + }; + + return CreateInstancePartitionMetadata; + })(); + + v1.CreateInstancePartitionRequest = (function() { + + /** + * Properties of a CreateInstancePartitionRequest. + * @memberof google.spanner.admin.instance.v1 + * @interface ICreateInstancePartitionRequest + * @property {string|null} [parent] CreateInstancePartitionRequest parent + * @property {string|null} [instancePartitionId] CreateInstancePartitionRequest instancePartitionId + * @property {google.spanner.admin.instance.v1.IInstancePartition|null} [instancePartition] CreateInstancePartitionRequest instancePartition + */ + + /** + * Constructs a new CreateInstancePartitionRequest. + * @memberof google.spanner.admin.instance.v1 + * @classdesc Represents a CreateInstancePartitionRequest. + * @implements ICreateInstancePartitionRequest + * @constructor + * @param {google.spanner.admin.instance.v1.ICreateInstancePartitionRequest=} [properties] Properties to set + */ + function CreateInstancePartitionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateInstancePartitionRequest parent. + * @member {string} parent + * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionRequest + * @instance + */ + CreateInstancePartitionRequest.prototype.parent = ""; + + /** + * CreateInstancePartitionRequest instancePartitionId. + * @member {string} instancePartitionId + * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionRequest + * @instance + */ + CreateInstancePartitionRequest.prototype.instancePartitionId = ""; + + /** + * CreateInstancePartitionRequest instancePartition. + * @member {google.spanner.admin.instance.v1.IInstancePartition|null|undefined} instancePartition + * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionRequest + * @instance + */ + CreateInstancePartitionRequest.prototype.instancePartition = null; + + /** + * Creates a new CreateInstancePartitionRequest instance using the specified properties. + * @function create + * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionRequest + * @static + * @param {google.spanner.admin.instance.v1.ICreateInstancePartitionRequest=} [properties] Properties to set + * @returns {google.spanner.admin.instance.v1.CreateInstancePartitionRequest} CreateInstancePartitionRequest instance + */ + CreateInstancePartitionRequest.create = function create(properties) { + return new CreateInstancePartitionRequest(properties); + }; + + /** + * Encodes the specified CreateInstancePartitionRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.CreateInstancePartitionRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionRequest + * @static + * @param {google.spanner.admin.instance.v1.ICreateInstancePartitionRequest} message CreateInstancePartitionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateInstancePartitionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.instancePartitionId != null && Object.hasOwnProperty.call(message, "instancePartitionId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.instancePartitionId); + if (message.instancePartition != null && Object.hasOwnProperty.call(message, "instancePartition")) + $root.google.spanner.admin.instance.v1.InstancePartition.encode(message.instancePartition, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateInstancePartitionRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.CreateInstancePartitionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionRequest + * @static + * @param {google.spanner.admin.instance.v1.ICreateInstancePartitionRequest} message CreateInstancePartitionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateInstancePartitionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateInstancePartitionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.instance.v1.CreateInstancePartitionRequest} CreateInstancePartitionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateInstancePartitionRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.CreateInstancePartitionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.instancePartitionId = reader.string(); + break; + } + case 3: { + message.instancePartition = $root.google.spanner.admin.instance.v1.InstancePartition.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateInstancePartitionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.instance.v1.CreateInstancePartitionRequest} CreateInstancePartitionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateInstancePartitionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateInstancePartitionRequest message. + * @function verify + * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateInstancePartitionRequest.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.instancePartitionId != null && message.hasOwnProperty("instancePartitionId")) + if (!$util.isString(message.instancePartitionId)) + return "instancePartitionId: string expected"; + if (message.instancePartition != null && message.hasOwnProperty("instancePartition")) { + var error = $root.google.spanner.admin.instance.v1.InstancePartition.verify(message.instancePartition); + if (error) + return "instancePartition." + error; + } + return null; + }; + + /** + * Creates a CreateInstancePartitionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.instance.v1.CreateInstancePartitionRequest} CreateInstancePartitionRequest + */ + CreateInstancePartitionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.instance.v1.CreateInstancePartitionRequest) + return object; + var message = new $root.google.spanner.admin.instance.v1.CreateInstancePartitionRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.instancePartitionId != null) + message.instancePartitionId = String(object.instancePartitionId); + if (object.instancePartition != null) { + if (typeof object.instancePartition !== "object") + throw TypeError(".google.spanner.admin.instance.v1.CreateInstancePartitionRequest.instancePartition: object expected"); + message.instancePartition = $root.google.spanner.admin.instance.v1.InstancePartition.fromObject(object.instancePartition); + } + return message; + }; + + /** + * Creates a plain object from a CreateInstancePartitionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionRequest + * @static + * @param {google.spanner.admin.instance.v1.CreateInstancePartitionRequest} message CreateInstancePartitionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateInstancePartitionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.instancePartitionId = ""; + object.instancePartition = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.instancePartitionId != null && message.hasOwnProperty("instancePartitionId")) + object.instancePartitionId = message.instancePartitionId; + if (message.instancePartition != null && message.hasOwnProperty("instancePartition")) + object.instancePartition = $root.google.spanner.admin.instance.v1.InstancePartition.toObject(message.instancePartition, options); + return object; + }; + + /** + * Converts this CreateInstancePartitionRequest to JSON. + * @function toJSON + * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionRequest + * @instance + * @returns {Object.} JSON object + */ + CreateInstancePartitionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateInstancePartitionRequest + * @function getTypeUrl + * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateInstancePartitionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.instance.v1.CreateInstancePartitionRequest"; + }; + + return CreateInstancePartitionRequest; + })(); + + v1.DeleteInstancePartitionRequest = (function() { + + /** + * Properties of a DeleteInstancePartitionRequest. + * @memberof google.spanner.admin.instance.v1 + * @interface IDeleteInstancePartitionRequest + * @property {string|null} [name] DeleteInstancePartitionRequest name + * @property {string|null} [etag] DeleteInstancePartitionRequest etag + */ + + /** + * Constructs a new DeleteInstancePartitionRequest. + * @memberof google.spanner.admin.instance.v1 + * @classdesc Represents a DeleteInstancePartitionRequest. + * @implements IDeleteInstancePartitionRequest + * @constructor + * @param {google.spanner.admin.instance.v1.IDeleteInstancePartitionRequest=} [properties] Properties to set + */ + function DeleteInstancePartitionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteInstancePartitionRequest name. + * @member {string} name + * @memberof google.spanner.admin.instance.v1.DeleteInstancePartitionRequest + * @instance + */ + DeleteInstancePartitionRequest.prototype.name = ""; + + /** + * DeleteInstancePartitionRequest etag. + * @member {string} etag + * @memberof google.spanner.admin.instance.v1.DeleteInstancePartitionRequest + * @instance + */ + DeleteInstancePartitionRequest.prototype.etag = ""; + + /** + * Creates a new DeleteInstancePartitionRequest instance using the specified properties. + * @function create + * @memberof google.spanner.admin.instance.v1.DeleteInstancePartitionRequest + * @static + * @param {google.spanner.admin.instance.v1.IDeleteInstancePartitionRequest=} [properties] Properties to set + * @returns {google.spanner.admin.instance.v1.DeleteInstancePartitionRequest} DeleteInstancePartitionRequest instance + */ + DeleteInstancePartitionRequest.create = function create(properties) { + return new DeleteInstancePartitionRequest(properties); + }; + + /** + * Encodes the specified DeleteInstancePartitionRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.DeleteInstancePartitionRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.instance.v1.DeleteInstancePartitionRequest + * @static + * @param {google.spanner.admin.instance.v1.IDeleteInstancePartitionRequest} message DeleteInstancePartitionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteInstancePartitionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.etag); + return writer; + }; + + /** + * Encodes the specified DeleteInstancePartitionRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.DeleteInstancePartitionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.instance.v1.DeleteInstancePartitionRequest + * @static + * @param {google.spanner.admin.instance.v1.IDeleteInstancePartitionRequest} message DeleteInstancePartitionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteInstancePartitionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteInstancePartitionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.instance.v1.DeleteInstancePartitionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.instance.v1.DeleteInstancePartitionRequest} DeleteInstancePartitionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteInstancePartitionRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.DeleteInstancePartitionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteInstancePartitionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.instance.v1.DeleteInstancePartitionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.instance.v1.DeleteInstancePartitionRequest} DeleteInstancePartitionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteInstancePartitionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteInstancePartitionRequest message. + * @function verify + * @memberof google.spanner.admin.instance.v1.DeleteInstancePartitionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteInstancePartitionRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a DeleteInstancePartitionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.instance.v1.DeleteInstancePartitionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.instance.v1.DeleteInstancePartitionRequest} DeleteInstancePartitionRequest + */ + DeleteInstancePartitionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.instance.v1.DeleteInstancePartitionRequest) + return object; + var message = new $root.google.spanner.admin.instance.v1.DeleteInstancePartitionRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a DeleteInstancePartitionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.instance.v1.DeleteInstancePartitionRequest + * @static + * @param {google.spanner.admin.instance.v1.DeleteInstancePartitionRequest} message DeleteInstancePartitionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteInstancePartitionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this DeleteInstancePartitionRequest to JSON. + * @function toJSON + * @memberof google.spanner.admin.instance.v1.DeleteInstancePartitionRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteInstancePartitionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteInstancePartitionRequest + * @function getTypeUrl + * @memberof google.spanner.admin.instance.v1.DeleteInstancePartitionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteInstancePartitionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.instance.v1.DeleteInstancePartitionRequest"; + }; + + return DeleteInstancePartitionRequest; + })(); + + v1.GetInstancePartitionRequest = (function() { + + /** + * Properties of a GetInstancePartitionRequest. + * @memberof google.spanner.admin.instance.v1 + * @interface IGetInstancePartitionRequest + * @property {string|null} [name] GetInstancePartitionRequest name + */ + + /** + * Constructs a new GetInstancePartitionRequest. + * @memberof google.spanner.admin.instance.v1 + * @classdesc Represents a GetInstancePartitionRequest. + * @implements IGetInstancePartitionRequest + * @constructor + * @param {google.spanner.admin.instance.v1.IGetInstancePartitionRequest=} [properties] Properties to set + */ + function GetInstancePartitionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetInstancePartitionRequest name. + * @member {string} name + * @memberof google.spanner.admin.instance.v1.GetInstancePartitionRequest + * @instance + */ + GetInstancePartitionRequest.prototype.name = ""; + + /** + * Creates a new GetInstancePartitionRequest instance using the specified properties. + * @function create + * @memberof google.spanner.admin.instance.v1.GetInstancePartitionRequest + * @static + * @param {google.spanner.admin.instance.v1.IGetInstancePartitionRequest=} [properties] Properties to set + * @returns {google.spanner.admin.instance.v1.GetInstancePartitionRequest} GetInstancePartitionRequest instance + */ + GetInstancePartitionRequest.create = function create(properties) { + return new GetInstancePartitionRequest(properties); + }; + + /** + * Encodes the specified GetInstancePartitionRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.GetInstancePartitionRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.instance.v1.GetInstancePartitionRequest + * @static + * @param {google.spanner.admin.instance.v1.IGetInstancePartitionRequest} message GetInstancePartitionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetInstancePartitionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetInstancePartitionRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.GetInstancePartitionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.instance.v1.GetInstancePartitionRequest + * @static + * @param {google.spanner.admin.instance.v1.IGetInstancePartitionRequest} message GetInstancePartitionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetInstancePartitionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetInstancePartitionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.instance.v1.GetInstancePartitionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.instance.v1.GetInstancePartitionRequest} GetInstancePartitionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetInstancePartitionRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.GetInstancePartitionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetInstancePartitionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.instance.v1.GetInstancePartitionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.instance.v1.GetInstancePartitionRequest} GetInstancePartitionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetInstancePartitionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetInstancePartitionRequest message. + * @function verify + * @memberof google.spanner.admin.instance.v1.GetInstancePartitionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetInstancePartitionRequest.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 GetInstancePartitionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.instance.v1.GetInstancePartitionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.instance.v1.GetInstancePartitionRequest} GetInstancePartitionRequest + */ + GetInstancePartitionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.instance.v1.GetInstancePartitionRequest) + return object; + var message = new $root.google.spanner.admin.instance.v1.GetInstancePartitionRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetInstancePartitionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.instance.v1.GetInstancePartitionRequest + * @static + * @param {google.spanner.admin.instance.v1.GetInstancePartitionRequest} message GetInstancePartitionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetInstancePartitionRequest.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 GetInstancePartitionRequest to JSON. + * @function toJSON + * @memberof google.spanner.admin.instance.v1.GetInstancePartitionRequest + * @instance + * @returns {Object.} JSON object + */ + GetInstancePartitionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetInstancePartitionRequest + * @function getTypeUrl + * @memberof google.spanner.admin.instance.v1.GetInstancePartitionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetInstancePartitionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.instance.v1.GetInstancePartitionRequest"; + }; + + return GetInstancePartitionRequest; + })(); + + v1.UpdateInstancePartitionRequest = (function() { + + /** + * Properties of an UpdateInstancePartitionRequest. + * @memberof google.spanner.admin.instance.v1 + * @interface IUpdateInstancePartitionRequest + * @property {google.spanner.admin.instance.v1.IInstancePartition|null} [instancePartition] UpdateInstancePartitionRequest instancePartition + * @property {google.protobuf.IFieldMask|null} [fieldMask] UpdateInstancePartitionRequest fieldMask + */ + + /** + * Constructs a new UpdateInstancePartitionRequest. + * @memberof google.spanner.admin.instance.v1 + * @classdesc Represents an UpdateInstancePartitionRequest. + * @implements IUpdateInstancePartitionRequest + * @constructor + * @param {google.spanner.admin.instance.v1.IUpdateInstancePartitionRequest=} [properties] Properties to set + */ + function UpdateInstancePartitionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateInstancePartitionRequest instancePartition. + * @member {google.spanner.admin.instance.v1.IInstancePartition|null|undefined} instancePartition + * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionRequest + * @instance + */ + UpdateInstancePartitionRequest.prototype.instancePartition = null; + + /** + * UpdateInstancePartitionRequest fieldMask. + * @member {google.protobuf.IFieldMask|null|undefined} fieldMask + * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionRequest + * @instance + */ + UpdateInstancePartitionRequest.prototype.fieldMask = null; + + /** + * Creates a new UpdateInstancePartitionRequest instance using the specified properties. + * @function create + * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionRequest + * @static + * @param {google.spanner.admin.instance.v1.IUpdateInstancePartitionRequest=} [properties] Properties to set + * @returns {google.spanner.admin.instance.v1.UpdateInstancePartitionRequest} UpdateInstancePartitionRequest instance + */ + UpdateInstancePartitionRequest.create = function create(properties) { + return new UpdateInstancePartitionRequest(properties); + }; + + /** + * Encodes the specified UpdateInstancePartitionRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.UpdateInstancePartitionRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionRequest + * @static + * @param {google.spanner.admin.instance.v1.IUpdateInstancePartitionRequest} message UpdateInstancePartitionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateInstancePartitionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.instancePartition != null && Object.hasOwnProperty.call(message, "instancePartition")) + $root.google.spanner.admin.instance.v1.InstancePartition.encode(message.instancePartition, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fieldMask != null && Object.hasOwnProperty.call(message, "fieldMask")) + $root.google.protobuf.FieldMask.encode(message.fieldMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateInstancePartitionRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.UpdateInstancePartitionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionRequest + * @static + * @param {google.spanner.admin.instance.v1.IUpdateInstancePartitionRequest} message UpdateInstancePartitionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateInstancePartitionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateInstancePartitionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.instance.v1.UpdateInstancePartitionRequest} UpdateInstancePartitionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateInstancePartitionRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.UpdateInstancePartitionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.instancePartition = $root.google.spanner.admin.instance.v1.InstancePartition.decode(reader, reader.uint32()); + break; + } + case 2: { + message.fieldMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateInstancePartitionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.instance.v1.UpdateInstancePartitionRequest} UpdateInstancePartitionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateInstancePartitionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateInstancePartitionRequest message. + * @function verify + * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateInstancePartitionRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.instancePartition != null && message.hasOwnProperty("instancePartition")) { + var error = $root.google.spanner.admin.instance.v1.InstancePartition.verify(message.instancePartition); + if (error) + return "instancePartition." + error; + } + if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.fieldMask); + if (error) + return "fieldMask." + error; + } + return null; + }; + + /** + * Creates an UpdateInstancePartitionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.instance.v1.UpdateInstancePartitionRequest} UpdateInstancePartitionRequest + */ + UpdateInstancePartitionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.instance.v1.UpdateInstancePartitionRequest) + return object; + var message = new $root.google.spanner.admin.instance.v1.UpdateInstancePartitionRequest(); + if (object.instancePartition != null) { + if (typeof object.instancePartition !== "object") + throw TypeError(".google.spanner.admin.instance.v1.UpdateInstancePartitionRequest.instancePartition: object expected"); + message.instancePartition = $root.google.spanner.admin.instance.v1.InstancePartition.fromObject(object.instancePartition); + } + if (object.fieldMask != null) { + if (typeof object.fieldMask !== "object") + throw TypeError(".google.spanner.admin.instance.v1.UpdateInstancePartitionRequest.fieldMask: object expected"); + message.fieldMask = $root.google.protobuf.FieldMask.fromObject(object.fieldMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateInstancePartitionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionRequest + * @static + * @param {google.spanner.admin.instance.v1.UpdateInstancePartitionRequest} message UpdateInstancePartitionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateInstancePartitionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.instancePartition = null; + object.fieldMask = null; + } + if (message.instancePartition != null && message.hasOwnProperty("instancePartition")) + object.instancePartition = $root.google.spanner.admin.instance.v1.InstancePartition.toObject(message.instancePartition, options); + if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) + object.fieldMask = $root.google.protobuf.FieldMask.toObject(message.fieldMask, options); + return object; + }; + + /** + * Converts this UpdateInstancePartitionRequest to JSON. + * @function toJSON + * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateInstancePartitionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateInstancePartitionRequest + * @function getTypeUrl + * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateInstancePartitionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.instance.v1.UpdateInstancePartitionRequest"; + }; + + return UpdateInstancePartitionRequest; + })(); + + v1.UpdateInstancePartitionMetadata = (function() { + + /** + * Properties of an UpdateInstancePartitionMetadata. + * @memberof google.spanner.admin.instance.v1 + * @interface IUpdateInstancePartitionMetadata + * @property {google.spanner.admin.instance.v1.IInstancePartition|null} [instancePartition] UpdateInstancePartitionMetadata instancePartition + * @property {google.protobuf.ITimestamp|null} [startTime] UpdateInstancePartitionMetadata startTime + * @property {google.protobuf.ITimestamp|null} [cancelTime] UpdateInstancePartitionMetadata cancelTime + * @property {google.protobuf.ITimestamp|null} [endTime] UpdateInstancePartitionMetadata endTime + */ + + /** + * Constructs a new UpdateInstancePartitionMetadata. + * @memberof google.spanner.admin.instance.v1 + * @classdesc Represents an UpdateInstancePartitionMetadata. + * @implements IUpdateInstancePartitionMetadata + * @constructor + * @param {google.spanner.admin.instance.v1.IUpdateInstancePartitionMetadata=} [properties] Properties to set + */ + function UpdateInstancePartitionMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateInstancePartitionMetadata instancePartition. + * @member {google.spanner.admin.instance.v1.IInstancePartition|null|undefined} instancePartition + * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata + * @instance + */ + UpdateInstancePartitionMetadata.prototype.instancePartition = null; + + /** + * UpdateInstancePartitionMetadata startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata + * @instance + */ + UpdateInstancePartitionMetadata.prototype.startTime = null; + + /** + * UpdateInstancePartitionMetadata cancelTime. + * @member {google.protobuf.ITimestamp|null|undefined} cancelTime + * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata + * @instance + */ + UpdateInstancePartitionMetadata.prototype.cancelTime = null; + + /** + * UpdateInstancePartitionMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata + * @instance + */ + UpdateInstancePartitionMetadata.prototype.endTime = null; + + /** + * Creates a new UpdateInstancePartitionMetadata instance using the specified properties. + * @function create + * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata + * @static + * @param {google.spanner.admin.instance.v1.IUpdateInstancePartitionMetadata=} [properties] Properties to set + * @returns {google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata} UpdateInstancePartitionMetadata instance + */ + UpdateInstancePartitionMetadata.create = function create(properties) { + return new UpdateInstancePartitionMetadata(properties); + }; + + /** + * Encodes the specified UpdateInstancePartitionMetadata message. Does not implicitly {@link google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata + * @static + * @param {google.spanner.admin.instance.v1.IUpdateInstancePartitionMetadata} message UpdateInstancePartitionMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateInstancePartitionMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.instancePartition != null && Object.hasOwnProperty.call(message, "instancePartition")) + $root.google.spanner.admin.instance.v1.InstancePartition.encode(message.instancePartition, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.cancelTime != null && Object.hasOwnProperty.call(message, "cancelTime")) + $root.google.protobuf.Timestamp.encode(message.cancelTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateInstancePartitionMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata + * @static + * @param {google.spanner.admin.instance.v1.IUpdateInstancePartitionMetadata} message UpdateInstancePartitionMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateInstancePartitionMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateInstancePartitionMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata} UpdateInstancePartitionMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateInstancePartitionMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.instancePartition = $root.google.spanner.admin.instance.v1.InstancePartition.decode(reader, reader.uint32()); + break; + } + case 2: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.cancelTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateInstancePartitionMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata} UpdateInstancePartitionMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateInstancePartitionMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateInstancePartitionMetadata message. + * @function verify + * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateInstancePartitionMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.instancePartition != null && message.hasOwnProperty("instancePartition")) { + var error = $root.google.spanner.admin.instance.v1.InstancePartition.verify(message.instancePartition); + if (error) + return "instancePartition." + error; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.cancelTime); + if (error) + return "cancelTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + return null; + }; + + /** + * Creates an UpdateInstancePartitionMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata} UpdateInstancePartitionMetadata + */ + UpdateInstancePartitionMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata) + return object; + var message = new $root.google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata(); + if (object.instancePartition != null) { + if (typeof object.instancePartition !== "object") + throw TypeError(".google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata.instancePartition: object expected"); + message.instancePartition = $root.google.spanner.admin.instance.v1.InstancePartition.fromObject(object.instancePartition); + } + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.cancelTime != null) { + if (typeof object.cancelTime !== "object") + throw TypeError(".google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata.cancelTime: object expected"); + message.cancelTime = $root.google.protobuf.Timestamp.fromObject(object.cancelTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + return message; + }; + + /** + * Creates a plain object from an UpdateInstancePartitionMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata + * @static + * @param {google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata} message UpdateInstancePartitionMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateInstancePartitionMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.instancePartition = null; + object.startTime = null; + object.cancelTime = null; + object.endTime = null; + } + if (message.instancePartition != null && message.hasOwnProperty("instancePartition")) + object.instancePartition = $root.google.spanner.admin.instance.v1.InstancePartition.toObject(message.instancePartition, options); + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) + object.cancelTime = $root.google.protobuf.Timestamp.toObject(message.cancelTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + return object; + }; + + /** + * Converts this UpdateInstancePartitionMetadata to JSON. + * @function toJSON + * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata + * @instance + * @returns {Object.} JSON object + */ + UpdateInstancePartitionMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateInstancePartitionMetadata + * @function getTypeUrl + * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateInstancePartitionMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata"; + }; + + return UpdateInstancePartitionMetadata; + })(); + + v1.ListInstancePartitionsRequest = (function() { + + /** + * Properties of a ListInstancePartitionsRequest. + * @memberof google.spanner.admin.instance.v1 + * @interface IListInstancePartitionsRequest + * @property {string|null} [parent] ListInstancePartitionsRequest parent + * @property {number|null} [pageSize] ListInstancePartitionsRequest pageSize + * @property {string|null} [pageToken] ListInstancePartitionsRequest pageToken + * @property {google.protobuf.ITimestamp|null} [instancePartitionDeadline] ListInstancePartitionsRequest instancePartitionDeadline + */ + + /** + * Constructs a new ListInstancePartitionsRequest. + * @memberof google.spanner.admin.instance.v1 + * @classdesc Represents a ListInstancePartitionsRequest. + * @implements IListInstancePartitionsRequest + * @constructor + * @param {google.spanner.admin.instance.v1.IListInstancePartitionsRequest=} [properties] Properties to set + */ + function ListInstancePartitionsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListInstancePartitionsRequest parent. + * @member {string} parent + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsRequest + * @instance + */ + ListInstancePartitionsRequest.prototype.parent = ""; + + /** + * ListInstancePartitionsRequest pageSize. + * @member {number} pageSize + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsRequest + * @instance + */ + ListInstancePartitionsRequest.prototype.pageSize = 0; + + /** + * ListInstancePartitionsRequest pageToken. + * @member {string} pageToken + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsRequest + * @instance + */ + ListInstancePartitionsRequest.prototype.pageToken = ""; + + /** + * ListInstancePartitionsRequest instancePartitionDeadline. + * @member {google.protobuf.ITimestamp|null|undefined} instancePartitionDeadline + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsRequest + * @instance + */ + ListInstancePartitionsRequest.prototype.instancePartitionDeadline = null; + + /** + * Creates a new ListInstancePartitionsRequest instance using the specified properties. + * @function create + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsRequest + * @static + * @param {google.spanner.admin.instance.v1.IListInstancePartitionsRequest=} [properties] Properties to set + * @returns {google.spanner.admin.instance.v1.ListInstancePartitionsRequest} ListInstancePartitionsRequest instance + */ + ListInstancePartitionsRequest.create = function create(properties) { + return new ListInstancePartitionsRequest(properties); + }; + + /** + * Encodes the specified ListInstancePartitionsRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancePartitionsRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsRequest + * @static + * @param {google.spanner.admin.instance.v1.IListInstancePartitionsRequest} message ListInstancePartitionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstancePartitionsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.instancePartitionDeadline != null && Object.hasOwnProperty.call(message, "instancePartitionDeadline")) + $root.google.protobuf.Timestamp.encode(message.instancePartitionDeadline, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ListInstancePartitionsRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancePartitionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsRequest + * @static + * @param {google.spanner.admin.instance.v1.IListInstancePartitionsRequest} message ListInstancePartitionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstancePartitionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListInstancePartitionsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.instance.v1.ListInstancePartitionsRequest} ListInstancePartitionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstancePartitionsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.ListInstancePartitionsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.instancePartitionDeadline = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListInstancePartitionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.instance.v1.ListInstancePartitionsRequest} ListInstancePartitionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstancePartitionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListInstancePartitionsRequest message. + * @function verify + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListInstancePartitionsRequest.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.instancePartitionDeadline != null && message.hasOwnProperty("instancePartitionDeadline")) { + var error = $root.google.protobuf.Timestamp.verify(message.instancePartitionDeadline); + if (error) + return "instancePartitionDeadline." + error; + } + return null; + }; + + /** + * Creates a ListInstancePartitionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.instance.v1.ListInstancePartitionsRequest} ListInstancePartitionsRequest + */ + ListInstancePartitionsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.instance.v1.ListInstancePartitionsRequest) + return object; + var message = new $root.google.spanner.admin.instance.v1.ListInstancePartitionsRequest(); + 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); + if (object.instancePartitionDeadline != null) { + if (typeof object.instancePartitionDeadline !== "object") + throw TypeError(".google.spanner.admin.instance.v1.ListInstancePartitionsRequest.instancePartitionDeadline: object expected"); + message.instancePartitionDeadline = $root.google.protobuf.Timestamp.fromObject(object.instancePartitionDeadline); + } + return message; + }; + + /** + * Creates a plain object from a ListInstancePartitionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsRequest + * @static + * @param {google.spanner.admin.instance.v1.ListInstancePartitionsRequest} message ListInstancePartitionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListInstancePartitionsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.instancePartitionDeadline = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.instancePartitionDeadline != null && message.hasOwnProperty("instancePartitionDeadline")) + object.instancePartitionDeadline = $root.google.protobuf.Timestamp.toObject(message.instancePartitionDeadline, options); + return object; + }; + + /** + * Converts this ListInstancePartitionsRequest to JSON. + * @function toJSON + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsRequest + * @instance + * @returns {Object.} JSON object + */ + ListInstancePartitionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListInstancePartitionsRequest + * @function getTypeUrl + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListInstancePartitionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.instance.v1.ListInstancePartitionsRequest"; + }; + + return ListInstancePartitionsRequest; + })(); + + v1.ListInstancePartitionsResponse = (function() { + + /** + * Properties of a ListInstancePartitionsResponse. + * @memberof google.spanner.admin.instance.v1 + * @interface IListInstancePartitionsResponse + * @property {Array.|null} [instancePartitions] ListInstancePartitionsResponse instancePartitions + * @property {string|null} [nextPageToken] ListInstancePartitionsResponse nextPageToken + * @property {Array.|null} [unreachable] ListInstancePartitionsResponse unreachable + */ + + /** + * Constructs a new ListInstancePartitionsResponse. + * @memberof google.spanner.admin.instance.v1 + * @classdesc Represents a ListInstancePartitionsResponse. + * @implements IListInstancePartitionsResponse + * @constructor + * @param {google.spanner.admin.instance.v1.IListInstancePartitionsResponse=} [properties] Properties to set + */ + function ListInstancePartitionsResponse(properties) { + this.instancePartitions = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListInstancePartitionsResponse instancePartitions. + * @member {Array.} instancePartitions + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsResponse + * @instance + */ + ListInstancePartitionsResponse.prototype.instancePartitions = $util.emptyArray; + + /** + * ListInstancePartitionsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsResponse + * @instance + */ + ListInstancePartitionsResponse.prototype.nextPageToken = ""; + + /** + * ListInstancePartitionsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsResponse + * @instance + */ + ListInstancePartitionsResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListInstancePartitionsResponse instance using the specified properties. + * @function create + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsResponse + * @static + * @param {google.spanner.admin.instance.v1.IListInstancePartitionsResponse=} [properties] Properties to set + * @returns {google.spanner.admin.instance.v1.ListInstancePartitionsResponse} ListInstancePartitionsResponse instance + */ + ListInstancePartitionsResponse.create = function create(properties) { + return new ListInstancePartitionsResponse(properties); + }; + + /** + * Encodes the specified ListInstancePartitionsResponse message. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancePartitionsResponse.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsResponse + * @static + * @param {google.spanner.admin.instance.v1.IListInstancePartitionsResponse} message ListInstancePartitionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstancePartitionsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.instancePartitions != null && message.instancePartitions.length) + for (var i = 0; i < message.instancePartitions.length; ++i) + $root.google.spanner.admin.instance.v1.InstancePartition.encode(message.instancePartitions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListInstancePartitionsResponse message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancePartitionsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsResponse + * @static + * @param {google.spanner.admin.instance.v1.IListInstancePartitionsResponse} message ListInstancePartitionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstancePartitionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListInstancePartitionsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.instance.v1.ListInstancePartitionsResponse} ListInstancePartitionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstancePartitionsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.ListInstancePartitionsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.instancePartitions && message.instancePartitions.length)) + message.instancePartitions = []; + message.instancePartitions.push($root.google.spanner.admin.instance.v1.InstancePartition.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListInstancePartitionsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.instance.v1.ListInstancePartitionsResponse} ListInstancePartitionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstancePartitionsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListInstancePartitionsResponse message. + * @function verify + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListInstancePartitionsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.instancePartitions != null && message.hasOwnProperty("instancePartitions")) { + if (!Array.isArray(message.instancePartitions)) + return "instancePartitions: array expected"; + for (var i = 0; i < message.instancePartitions.length; ++i) { + var error = $root.google.spanner.admin.instance.v1.InstancePartition.verify(message.instancePartitions[i]); + if (error) + return "instancePartitions." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListInstancePartitionsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.instance.v1.ListInstancePartitionsResponse} ListInstancePartitionsResponse + */ + ListInstancePartitionsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.instance.v1.ListInstancePartitionsResponse) + return object; + var message = new $root.google.spanner.admin.instance.v1.ListInstancePartitionsResponse(); + if (object.instancePartitions) { + if (!Array.isArray(object.instancePartitions)) + throw TypeError(".google.spanner.admin.instance.v1.ListInstancePartitionsResponse.instancePartitions: array expected"); + message.instancePartitions = []; + for (var i = 0; i < object.instancePartitions.length; ++i) { + if (typeof object.instancePartitions[i] !== "object") + throw TypeError(".google.spanner.admin.instance.v1.ListInstancePartitionsResponse.instancePartitions: object expected"); + message.instancePartitions[i] = $root.google.spanner.admin.instance.v1.InstancePartition.fromObject(object.instancePartitions[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.spanner.admin.instance.v1.ListInstancePartitionsResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListInstancePartitionsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsResponse + * @static + * @param {google.spanner.admin.instance.v1.ListInstancePartitionsResponse} message ListInstancePartitionsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListInstancePartitionsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.instancePartitions = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.instancePartitions && message.instancePartitions.length) { + object.instancePartitions = []; + for (var j = 0; j < message.instancePartitions.length; ++j) + object.instancePartitions[j] = $root.google.spanner.admin.instance.v1.InstancePartition.toObject(message.instancePartitions[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListInstancePartitionsResponse to JSON. + * @function toJSON + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsResponse + * @instance + * @returns {Object.} JSON object + */ + ListInstancePartitionsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListInstancePartitionsResponse + * @function getTypeUrl + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListInstancePartitionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.instance.v1.ListInstancePartitionsResponse"; + }; + + return ListInstancePartitionsResponse; + })(); + + v1.ListInstancePartitionOperationsRequest = (function() { + + /** + * Properties of a ListInstancePartitionOperationsRequest. + * @memberof google.spanner.admin.instance.v1 + * @interface IListInstancePartitionOperationsRequest + * @property {string|null} [parent] ListInstancePartitionOperationsRequest parent + * @property {string|null} [filter] ListInstancePartitionOperationsRequest filter + * @property {number|null} [pageSize] ListInstancePartitionOperationsRequest pageSize + * @property {string|null} [pageToken] ListInstancePartitionOperationsRequest pageToken + * @property {google.protobuf.ITimestamp|null} [instancePartitionDeadline] ListInstancePartitionOperationsRequest instancePartitionDeadline + */ + + /** + * Constructs a new ListInstancePartitionOperationsRequest. + * @memberof google.spanner.admin.instance.v1 + * @classdesc Represents a ListInstancePartitionOperationsRequest. + * @implements IListInstancePartitionOperationsRequest + * @constructor + * @param {google.spanner.admin.instance.v1.IListInstancePartitionOperationsRequest=} [properties] Properties to set + */ + function ListInstancePartitionOperationsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListInstancePartitionOperationsRequest parent. + * @member {string} parent + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest + * @instance + */ + ListInstancePartitionOperationsRequest.prototype.parent = ""; + + /** + * ListInstancePartitionOperationsRequest filter. + * @member {string} filter + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest + * @instance + */ + ListInstancePartitionOperationsRequest.prototype.filter = ""; + + /** + * ListInstancePartitionOperationsRequest pageSize. + * @member {number} pageSize + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest + * @instance + */ + ListInstancePartitionOperationsRequest.prototype.pageSize = 0; + + /** + * ListInstancePartitionOperationsRequest pageToken. + * @member {string} pageToken + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest + * @instance + */ + ListInstancePartitionOperationsRequest.prototype.pageToken = ""; + + /** + * ListInstancePartitionOperationsRequest instancePartitionDeadline. + * @member {google.protobuf.ITimestamp|null|undefined} instancePartitionDeadline + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest + * @instance + */ + ListInstancePartitionOperationsRequest.prototype.instancePartitionDeadline = null; + + /** + * Creates a new ListInstancePartitionOperationsRequest instance using the specified properties. + * @function create + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest + * @static + * @param {google.spanner.admin.instance.v1.IListInstancePartitionOperationsRequest=} [properties] Properties to set + * @returns {google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest} ListInstancePartitionOperationsRequest instance + */ + ListInstancePartitionOperationsRequest.create = function create(properties) { + return new ListInstancePartitionOperationsRequest(properties); + }; + + /** + * Encodes the specified ListInstancePartitionOperationsRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest + * @static + * @param {google.spanner.admin.instance.v1.IListInstancePartitionOperationsRequest} message ListInstancePartitionOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstancePartitionOperationsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + if (message.instancePartitionDeadline != null && Object.hasOwnProperty.call(message, "instancePartitionDeadline")) + $root.google.protobuf.Timestamp.encode(message.instancePartitionDeadline, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ListInstancePartitionOperationsRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest + * @static + * @param {google.spanner.admin.instance.v1.IListInstancePartitionOperationsRequest} message ListInstancePartitionOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstancePartitionOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListInstancePartitionOperationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest} ListInstancePartitionOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstancePartitionOperationsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.filter = reader.string(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } + case 5: { + message.instancePartitionDeadline = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListInstancePartitionOperationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest} ListInstancePartitionOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstancePartitionOperationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListInstancePartitionOperationsRequest message. + * @function verify + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListInstancePartitionOperationsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.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.instancePartitionDeadline != null && message.hasOwnProperty("instancePartitionDeadline")) { + var error = $root.google.protobuf.Timestamp.verify(message.instancePartitionDeadline); + if (error) + return "instancePartitionDeadline." + error; + } + return null; + }; + + /** + * Creates a ListInstancePartitionOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest} ListInstancePartitionOperationsRequest + */ + ListInstancePartitionOperationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest) + return object; + var message = new $root.google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.instancePartitionDeadline != null) { + if (typeof object.instancePartitionDeadline !== "object") + throw TypeError(".google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest.instancePartitionDeadline: object expected"); + message.instancePartitionDeadline = $root.google.protobuf.Timestamp.fromObject(object.instancePartitionDeadline); + } + return message; + }; + + /** + * Creates a plain object from a ListInstancePartitionOperationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest + * @static + * @param {google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest} message ListInstancePartitionOperationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListInstancePartitionOperationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + object.instancePartitionDeadline = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.instancePartitionDeadline != null && message.hasOwnProperty("instancePartitionDeadline")) + object.instancePartitionDeadline = $root.google.protobuf.Timestamp.toObject(message.instancePartitionDeadline, options); + return object; + }; + + /** + * Converts this ListInstancePartitionOperationsRequest to JSON. + * @function toJSON + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListInstancePartitionOperationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListInstancePartitionOperationsRequest + * @function getTypeUrl + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListInstancePartitionOperationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest"; + }; + + return ListInstancePartitionOperationsRequest; + })(); + + v1.ListInstancePartitionOperationsResponse = (function() { + + /** + * Properties of a ListInstancePartitionOperationsResponse. + * @memberof google.spanner.admin.instance.v1 + * @interface IListInstancePartitionOperationsResponse + * @property {Array.|null} [operations] ListInstancePartitionOperationsResponse operations + * @property {string|null} [nextPageToken] ListInstancePartitionOperationsResponse nextPageToken + * @property {Array.|null} [unreachableInstancePartitions] ListInstancePartitionOperationsResponse unreachableInstancePartitions + */ + + /** + * Constructs a new ListInstancePartitionOperationsResponse. + * @memberof google.spanner.admin.instance.v1 + * @classdesc Represents a ListInstancePartitionOperationsResponse. + * @implements IListInstancePartitionOperationsResponse + * @constructor + * @param {google.spanner.admin.instance.v1.IListInstancePartitionOperationsResponse=} [properties] Properties to set + */ + function ListInstancePartitionOperationsResponse(properties) { + this.operations = []; + this.unreachableInstancePartitions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListInstancePartitionOperationsResponse operations. + * @member {Array.} operations + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse + * @instance + */ + ListInstancePartitionOperationsResponse.prototype.operations = $util.emptyArray; + + /** + * ListInstancePartitionOperationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse + * @instance + */ + ListInstancePartitionOperationsResponse.prototype.nextPageToken = ""; + + /** + * ListInstancePartitionOperationsResponse unreachableInstancePartitions. + * @member {Array.} unreachableInstancePartitions + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse + * @instance + */ + ListInstancePartitionOperationsResponse.prototype.unreachableInstancePartitions = $util.emptyArray; + + /** + * Creates a new ListInstancePartitionOperationsResponse instance using the specified properties. + * @function create + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse + * @static + * @param {google.spanner.admin.instance.v1.IListInstancePartitionOperationsResponse=} [properties] Properties to set + * @returns {google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse} ListInstancePartitionOperationsResponse instance + */ + ListInstancePartitionOperationsResponse.create = function create(properties) { + return new ListInstancePartitionOperationsResponse(properties); + }; + + /** + * Encodes the specified ListInstancePartitionOperationsResponse message. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse + * @static + * @param {google.spanner.admin.instance.v1.IListInstancePartitionOperationsResponse} message ListInstancePartitionOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstancePartitionOperationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.operations != null && message.operations.length) + for (var i = 0; i < message.operations.length; ++i) + $root.google.longrunning.Operation.encode(message.operations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachableInstancePartitions != null && message.unreachableInstancePartitions.length) + for (var i = 0; i < message.unreachableInstancePartitions.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachableInstancePartitions[i]); + return writer; + }; + + /** + * Encodes the specified ListInstancePartitionOperationsResponse message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse + * @static + * @param {google.spanner.admin.instance.v1.IListInstancePartitionOperationsResponse} message ListInstancePartitionOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstancePartitionOperationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListInstancePartitionOperationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse} ListInstancePartitionOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstancePartitionOperationsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.operations && message.operations.length)) + message.operations = []; + message.operations.push($root.google.longrunning.Operation.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachableInstancePartitions && message.unreachableInstancePartitions.length)) + message.unreachableInstancePartitions = []; + message.unreachableInstancePartitions.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListInstancePartitionOperationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse} ListInstancePartitionOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstancePartitionOperationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListInstancePartitionOperationsResponse message. + * @function verify + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListInstancePartitionOperationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.operations != null && message.hasOwnProperty("operations")) { + if (!Array.isArray(message.operations)) + return "operations: array expected"; + for (var i = 0; i < message.operations.length; ++i) { + var error = $root.google.longrunning.Operation.verify(message.operations[i]); + if (error) + return "operations." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachableInstancePartitions != null && message.hasOwnProperty("unreachableInstancePartitions")) { + if (!Array.isArray(message.unreachableInstancePartitions)) + return "unreachableInstancePartitions: array expected"; + for (var i = 0; i < message.unreachableInstancePartitions.length; ++i) + if (!$util.isString(message.unreachableInstancePartitions[i])) + return "unreachableInstancePartitions: string[] expected"; + } + return null; + }; + + /** + * Creates a ListInstancePartitionOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse} ListInstancePartitionOperationsResponse + */ + ListInstancePartitionOperationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse) + return object; + var message = new $root.google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse(); + if (object.operations) { + if (!Array.isArray(object.operations)) + throw TypeError(".google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse.operations: array expected"); + message.operations = []; + for (var i = 0; i < object.operations.length; ++i) { + if (typeof object.operations[i] !== "object") + throw TypeError(".google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse.operations: object expected"); + message.operations[i] = $root.google.longrunning.Operation.fromObject(object.operations[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachableInstancePartitions) { + if (!Array.isArray(object.unreachableInstancePartitions)) + throw TypeError(".google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse.unreachableInstancePartitions: array expected"); + message.unreachableInstancePartitions = []; + for (var i = 0; i < object.unreachableInstancePartitions.length; ++i) + message.unreachableInstancePartitions[i] = String(object.unreachableInstancePartitions[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListInstancePartitionOperationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse + * @static + * @param {google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse} message ListInstancePartitionOperationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListInstancePartitionOperationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.operations = []; + object.unreachableInstancePartitions = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.operations && message.operations.length) { + object.operations = []; + for (var j = 0; j < message.operations.length; ++j) + object.operations[j] = $root.google.longrunning.Operation.toObject(message.operations[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachableInstancePartitions && message.unreachableInstancePartitions.length) { + object.unreachableInstancePartitions = []; + for (var j = 0; j < message.unreachableInstancePartitions.length; ++j) + object.unreachableInstancePartitions[j] = message.unreachableInstancePartitions[j]; + } + return object; + }; + + /** + * Converts this ListInstancePartitionOperationsResponse to JSON. + * @function toJSON + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse + * @instance + * @returns {Object.} JSON object + */ + ListInstancePartitionOperationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListInstancePartitionOperationsResponse + * @function getTypeUrl + * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListInstancePartitionOperationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse"; + }; + + return ListInstancePartitionOperationsResponse; + })(); + + v1.MoveInstanceRequest = (function() { + + /** + * Properties of a MoveInstanceRequest. + * @memberof google.spanner.admin.instance.v1 + * @interface IMoveInstanceRequest + * @property {string|null} [name] MoveInstanceRequest name + * @property {string|null} [targetConfig] MoveInstanceRequest targetConfig + */ + + /** + * Constructs a new MoveInstanceRequest. + * @memberof google.spanner.admin.instance.v1 + * @classdesc Represents a MoveInstanceRequest. + * @implements IMoveInstanceRequest + * @constructor + * @param {google.spanner.admin.instance.v1.IMoveInstanceRequest=} [properties] Properties to set + */ + function MoveInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MoveInstanceRequest name. + * @member {string} name + * @memberof google.spanner.admin.instance.v1.MoveInstanceRequest + * @instance + */ + MoveInstanceRequest.prototype.name = ""; + + /** + * MoveInstanceRequest targetConfig. + * @member {string} targetConfig + * @memberof google.spanner.admin.instance.v1.MoveInstanceRequest + * @instance + */ + MoveInstanceRequest.prototype.targetConfig = ""; + + /** + * Creates a new MoveInstanceRequest instance using the specified properties. + * @function create + * @memberof google.spanner.admin.instance.v1.MoveInstanceRequest + * @static + * @param {google.spanner.admin.instance.v1.IMoveInstanceRequest=} [properties] Properties to set + * @returns {google.spanner.admin.instance.v1.MoveInstanceRequest} MoveInstanceRequest instance + */ + MoveInstanceRequest.create = function create(properties) { + return new MoveInstanceRequest(properties); + }; + + /** + * Encodes the specified MoveInstanceRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.MoveInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.instance.v1.MoveInstanceRequest + * @static + * @param {google.spanner.admin.instance.v1.IMoveInstanceRequest} message MoveInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MoveInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.targetConfig != null && Object.hasOwnProperty.call(message, "targetConfig")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.targetConfig); + return writer; + }; + + /** + * Encodes the specified MoveInstanceRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.MoveInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.instance.v1.MoveInstanceRequest + * @static + * @param {google.spanner.admin.instance.v1.IMoveInstanceRequest} message MoveInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MoveInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MoveInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.instance.v1.MoveInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.instance.v1.MoveInstanceRequest} MoveInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MoveInstanceRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.MoveInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.targetConfig = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MoveInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.instance.v1.MoveInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.instance.v1.MoveInstanceRequest} MoveInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MoveInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MoveInstanceRequest message. + * @function verify + * @memberof google.spanner.admin.instance.v1.MoveInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MoveInstanceRequest.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.targetConfig != null && message.hasOwnProperty("targetConfig")) + if (!$util.isString(message.targetConfig)) + return "targetConfig: string expected"; + return null; + }; + + /** + * Creates a MoveInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.instance.v1.MoveInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.instance.v1.MoveInstanceRequest} MoveInstanceRequest + */ + MoveInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.instance.v1.MoveInstanceRequest) + return object; + var message = new $root.google.spanner.admin.instance.v1.MoveInstanceRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.targetConfig != null) + message.targetConfig = String(object.targetConfig); + return message; + }; + + /** + * Creates a plain object from a MoveInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.instance.v1.MoveInstanceRequest + * @static + * @param {google.spanner.admin.instance.v1.MoveInstanceRequest} message MoveInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MoveInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.targetConfig = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.targetConfig != null && message.hasOwnProperty("targetConfig")) + object.targetConfig = message.targetConfig; + return object; + }; + + /** + * Converts this MoveInstanceRequest to JSON. + * @function toJSON + * @memberof google.spanner.admin.instance.v1.MoveInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + MoveInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MoveInstanceRequest + * @function getTypeUrl + * @memberof google.spanner.admin.instance.v1.MoveInstanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MoveInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.instance.v1.MoveInstanceRequest"; + }; + + return MoveInstanceRequest; + })(); + + v1.MoveInstanceResponse = (function() { + + /** + * Properties of a MoveInstanceResponse. + * @memberof google.spanner.admin.instance.v1 + * @interface IMoveInstanceResponse + */ + + /** + * Constructs a new MoveInstanceResponse. + * @memberof google.spanner.admin.instance.v1 + * @classdesc Represents a MoveInstanceResponse. + * @implements IMoveInstanceResponse + * @constructor + * @param {google.spanner.admin.instance.v1.IMoveInstanceResponse=} [properties] Properties to set + */ + function MoveInstanceResponse(properties) { + if (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 MoveInstanceResponse instance using the specified properties. + * @function create + * @memberof google.spanner.admin.instance.v1.MoveInstanceResponse + * @static + * @param {google.spanner.admin.instance.v1.IMoveInstanceResponse=} [properties] Properties to set + * @returns {google.spanner.admin.instance.v1.MoveInstanceResponse} MoveInstanceResponse instance + */ + MoveInstanceResponse.create = function create(properties) { + return new MoveInstanceResponse(properties); + }; + + /** + * Encodes the specified MoveInstanceResponse message. Does not implicitly {@link google.spanner.admin.instance.v1.MoveInstanceResponse.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.instance.v1.MoveInstanceResponse + * @static + * @param {google.spanner.admin.instance.v1.IMoveInstanceResponse} message MoveInstanceResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MoveInstanceResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified MoveInstanceResponse message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.MoveInstanceResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.instance.v1.MoveInstanceResponse + * @static + * @param {google.spanner.admin.instance.v1.IMoveInstanceResponse} message MoveInstanceResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MoveInstanceResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MoveInstanceResponse message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.instance.v1.MoveInstanceResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.instance.v1.MoveInstanceResponse} MoveInstanceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MoveInstanceResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.MoveInstanceResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MoveInstanceResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.instance.v1.MoveInstanceResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.instance.v1.MoveInstanceResponse} MoveInstanceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MoveInstanceResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MoveInstanceResponse message. + * @function verify + * @memberof google.spanner.admin.instance.v1.MoveInstanceResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MoveInstanceResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a MoveInstanceResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.instance.v1.MoveInstanceResponse + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.instance.v1.MoveInstanceResponse} MoveInstanceResponse + */ + MoveInstanceResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.instance.v1.MoveInstanceResponse) + return object; + return new $root.google.spanner.admin.instance.v1.MoveInstanceResponse(); + }; + + /** + * Creates a plain object from a MoveInstanceResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.instance.v1.MoveInstanceResponse + * @static + * @param {google.spanner.admin.instance.v1.MoveInstanceResponse} message MoveInstanceResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MoveInstanceResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this MoveInstanceResponse to JSON. + * @function toJSON + * @memberof google.spanner.admin.instance.v1.MoveInstanceResponse + * @instance + * @returns {Object.} JSON object + */ + MoveInstanceResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MoveInstanceResponse + * @function getTypeUrl + * @memberof google.spanner.admin.instance.v1.MoveInstanceResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MoveInstanceResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.instance.v1.MoveInstanceResponse"; + }; + + return MoveInstanceResponse; + })(); + + v1.MoveInstanceMetadata = (function() { + + /** + * Properties of a MoveInstanceMetadata. + * @memberof google.spanner.admin.instance.v1 + * @interface IMoveInstanceMetadata + * @property {string|null} [targetConfig] MoveInstanceMetadata targetConfig + * @property {google.spanner.admin.instance.v1.IOperationProgress|null} [progress] MoveInstanceMetadata progress + * @property {google.protobuf.ITimestamp|null} [cancelTime] MoveInstanceMetadata cancelTime + */ + + /** + * Constructs a new MoveInstanceMetadata. + * @memberof google.spanner.admin.instance.v1 + * @classdesc Represents a MoveInstanceMetadata. + * @implements IMoveInstanceMetadata + * @constructor + * @param {google.spanner.admin.instance.v1.IMoveInstanceMetadata=} [properties] Properties to set + */ + function MoveInstanceMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MoveInstanceMetadata targetConfig. + * @member {string} targetConfig + * @memberof google.spanner.admin.instance.v1.MoveInstanceMetadata + * @instance + */ + MoveInstanceMetadata.prototype.targetConfig = ""; + + /** + * MoveInstanceMetadata progress. + * @member {google.spanner.admin.instance.v1.IOperationProgress|null|undefined} progress + * @memberof google.spanner.admin.instance.v1.MoveInstanceMetadata + * @instance + */ + MoveInstanceMetadata.prototype.progress = null; + + /** + * MoveInstanceMetadata cancelTime. + * @member {google.protobuf.ITimestamp|null|undefined} cancelTime + * @memberof google.spanner.admin.instance.v1.MoveInstanceMetadata + * @instance + */ + MoveInstanceMetadata.prototype.cancelTime = null; + + /** + * Creates a new MoveInstanceMetadata instance using the specified properties. + * @function create + * @memberof google.spanner.admin.instance.v1.MoveInstanceMetadata + * @static + * @param {google.spanner.admin.instance.v1.IMoveInstanceMetadata=} [properties] Properties to set + * @returns {google.spanner.admin.instance.v1.MoveInstanceMetadata} MoveInstanceMetadata instance + */ + MoveInstanceMetadata.create = function create(properties) { + return new MoveInstanceMetadata(properties); + }; + + /** + * Encodes the specified MoveInstanceMetadata message. Does not implicitly {@link google.spanner.admin.instance.v1.MoveInstanceMetadata.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.instance.v1.MoveInstanceMetadata + * @static + * @param {google.spanner.admin.instance.v1.IMoveInstanceMetadata} message MoveInstanceMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MoveInstanceMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.targetConfig != null && Object.hasOwnProperty.call(message, "targetConfig")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.targetConfig); + if (message.progress != null && Object.hasOwnProperty.call(message, "progress")) + $root.google.spanner.admin.instance.v1.OperationProgress.encode(message.progress, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.cancelTime != null && Object.hasOwnProperty.call(message, "cancelTime")) + $root.google.protobuf.Timestamp.encode(message.cancelTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MoveInstanceMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.MoveInstanceMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.instance.v1.MoveInstanceMetadata + * @static + * @param {google.spanner.admin.instance.v1.IMoveInstanceMetadata} message MoveInstanceMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MoveInstanceMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MoveInstanceMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.instance.v1.MoveInstanceMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.instance.v1.MoveInstanceMetadata} MoveInstanceMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MoveInstanceMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.MoveInstanceMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.targetConfig = reader.string(); + break; + } + case 2: { + message.progress = $root.google.spanner.admin.instance.v1.OperationProgress.decode(reader, reader.uint32()); + break; + } + case 3: { + message.cancelTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MoveInstanceMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.instance.v1.MoveInstanceMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.instance.v1.MoveInstanceMetadata} MoveInstanceMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MoveInstanceMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MoveInstanceMetadata message. + * @function verify + * @memberof google.spanner.admin.instance.v1.MoveInstanceMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MoveInstanceMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.targetConfig != null && message.hasOwnProperty("targetConfig")) + if (!$util.isString(message.targetConfig)) + return "targetConfig: string expected"; + if (message.progress != null && message.hasOwnProperty("progress")) { + var error = $root.google.spanner.admin.instance.v1.OperationProgress.verify(message.progress); + if (error) + return "progress." + error; + } + if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.cancelTime); + if (error) + return "cancelTime." + error; + } + return null; + }; + + /** + * Creates a MoveInstanceMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.instance.v1.MoveInstanceMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.instance.v1.MoveInstanceMetadata} MoveInstanceMetadata + */ + MoveInstanceMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.instance.v1.MoveInstanceMetadata) + return object; + var message = new $root.google.spanner.admin.instance.v1.MoveInstanceMetadata(); + if (object.targetConfig != null) + message.targetConfig = String(object.targetConfig); + if (object.progress != null) { + if (typeof object.progress !== "object") + throw TypeError(".google.spanner.admin.instance.v1.MoveInstanceMetadata.progress: object expected"); + message.progress = $root.google.spanner.admin.instance.v1.OperationProgress.fromObject(object.progress); + } + if (object.cancelTime != null) { + if (typeof object.cancelTime !== "object") + throw TypeError(".google.spanner.admin.instance.v1.MoveInstanceMetadata.cancelTime: object expected"); + message.cancelTime = $root.google.protobuf.Timestamp.fromObject(object.cancelTime); + } + return message; + }; + + /** + * Creates a plain object from a MoveInstanceMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.instance.v1.MoveInstanceMetadata + * @static + * @param {google.spanner.admin.instance.v1.MoveInstanceMetadata} message MoveInstanceMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MoveInstanceMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.targetConfig = ""; + object.progress = null; + object.cancelTime = null; + } + if (message.targetConfig != null && message.hasOwnProperty("targetConfig")) + object.targetConfig = message.targetConfig; + if (message.progress != null && message.hasOwnProperty("progress")) + object.progress = $root.google.spanner.admin.instance.v1.OperationProgress.toObject(message.progress, options); + if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) + object.cancelTime = $root.google.protobuf.Timestamp.toObject(message.cancelTime, options); + return object; + }; + + /** + * Converts this MoveInstanceMetadata to JSON. + * @function toJSON + * @memberof google.spanner.admin.instance.v1.MoveInstanceMetadata + * @instance + * @returns {Object.} JSON object + */ + MoveInstanceMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MoveInstanceMetadata + * @function getTypeUrl + * @memberof google.spanner.admin.instance.v1.MoveInstanceMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MoveInstanceMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.instance.v1.MoveInstanceMetadata"; + }; + + return MoveInstanceMetadata; + })(); + + return v1; + })(); + + return instance; + })(); + + return admin; + })(); + + spanner.executor = (function() { + + /** + * Namespace executor. + * @memberof google.spanner + * @namespace + */ + var executor = {}; + + executor.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.spanner.executor + * @namespace + */ + var v1 = {}; + + v1.SpannerExecutorProxy = (function() { + + /** + * Constructs a new SpannerExecutorProxy service. + * @memberof google.spanner.executor.v1 + * @classdesc Represents a SpannerExecutorProxy + * @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 SpannerExecutorProxy(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (SpannerExecutorProxy.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = SpannerExecutorProxy; + + /** + * Creates new SpannerExecutorProxy service using the specified rpc implementation. + * @function create + * @memberof google.spanner.executor.v1.SpannerExecutorProxy + * @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 {SpannerExecutorProxy} RPC service. Useful where requests and/or responses are streamed. + */ + SpannerExecutorProxy.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.spanner.executor.v1.SpannerExecutorProxy|executeActionAsync}. + * @memberof google.spanner.executor.v1.SpannerExecutorProxy + * @typedef ExecuteActionAsyncCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.spanner.executor.v1.SpannerAsyncActionResponse} [response] SpannerAsyncActionResponse + */ + + /** + * Calls ExecuteActionAsync. + * @function executeActionAsync + * @memberof google.spanner.executor.v1.SpannerExecutorProxy + * @instance + * @param {google.spanner.executor.v1.ISpannerAsyncActionRequest} request SpannerAsyncActionRequest message or plain object + * @param {google.spanner.executor.v1.SpannerExecutorProxy.ExecuteActionAsyncCallback} callback Node-style callback called with the error, if any, and SpannerAsyncActionResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SpannerExecutorProxy.prototype.executeActionAsync = function executeActionAsync(request, callback) { + return this.rpcCall(executeActionAsync, $root.google.spanner.executor.v1.SpannerAsyncActionRequest, $root.google.spanner.executor.v1.SpannerAsyncActionResponse, request, callback); + }, "name", { value: "ExecuteActionAsync" }); + + /** + * Calls ExecuteActionAsync. + * @function executeActionAsync + * @memberof google.spanner.executor.v1.SpannerExecutorProxy + * @instance + * @param {google.spanner.executor.v1.ISpannerAsyncActionRequest} request SpannerAsyncActionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return SpannerExecutorProxy; + })(); + + v1.SpannerAsyncActionRequest = (function() { + + /** + * Properties of a SpannerAsyncActionRequest. + * @memberof google.spanner.executor.v1 + * @interface ISpannerAsyncActionRequest + * @property {number|null} [actionId] SpannerAsyncActionRequest actionId + * @property {google.spanner.executor.v1.ISpannerAction|null} [action] SpannerAsyncActionRequest action + */ + + /** + * Constructs a new SpannerAsyncActionRequest. + * @memberof google.spanner.executor.v1 + * @classdesc Represents a SpannerAsyncActionRequest. + * @implements ISpannerAsyncActionRequest + * @constructor + * @param {google.spanner.executor.v1.ISpannerAsyncActionRequest=} [properties] Properties to set + */ + function SpannerAsyncActionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SpannerAsyncActionRequest actionId. + * @member {number} actionId + * @memberof google.spanner.executor.v1.SpannerAsyncActionRequest + * @instance + */ + SpannerAsyncActionRequest.prototype.actionId = 0; + + /** + * SpannerAsyncActionRequest action. + * @member {google.spanner.executor.v1.ISpannerAction|null|undefined} action + * @memberof google.spanner.executor.v1.SpannerAsyncActionRequest + * @instance + */ + SpannerAsyncActionRequest.prototype.action = null; + + /** + * Creates a new SpannerAsyncActionRequest instance using the specified properties. + * @function create + * @memberof google.spanner.executor.v1.SpannerAsyncActionRequest + * @static + * @param {google.spanner.executor.v1.ISpannerAsyncActionRequest=} [properties] Properties to set + * @returns {google.spanner.executor.v1.SpannerAsyncActionRequest} SpannerAsyncActionRequest instance + */ + SpannerAsyncActionRequest.create = function create(properties) { + return new SpannerAsyncActionRequest(properties); + }; + + /** + * Encodes the specified SpannerAsyncActionRequest message. Does not implicitly {@link google.spanner.executor.v1.SpannerAsyncActionRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.executor.v1.SpannerAsyncActionRequest + * @static + * @param {google.spanner.executor.v1.ISpannerAsyncActionRequest} message SpannerAsyncActionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpannerAsyncActionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.actionId != null && Object.hasOwnProperty.call(message, "actionId")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.actionId); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + $root.google.spanner.executor.v1.SpannerAction.encode(message.action, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SpannerAsyncActionRequest message, length delimited. Does not implicitly {@link google.spanner.executor.v1.SpannerAsyncActionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.executor.v1.SpannerAsyncActionRequest + * @static + * @param {google.spanner.executor.v1.ISpannerAsyncActionRequest} message SpannerAsyncActionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpannerAsyncActionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SpannerAsyncActionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.executor.v1.SpannerAsyncActionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.executor.v1.SpannerAsyncActionRequest} SpannerAsyncActionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpannerAsyncActionRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.SpannerAsyncActionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.actionId = reader.int32(); + break; + } + case 2: { + message.action = $root.google.spanner.executor.v1.SpannerAction.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SpannerAsyncActionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.executor.v1.SpannerAsyncActionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.executor.v1.SpannerAsyncActionRequest} SpannerAsyncActionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpannerAsyncActionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SpannerAsyncActionRequest message. + * @function verify + * @memberof google.spanner.executor.v1.SpannerAsyncActionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SpannerAsyncActionRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.actionId != null && message.hasOwnProperty("actionId")) + if (!$util.isInteger(message.actionId)) + return "actionId: integer expected"; + if (message.action != null && message.hasOwnProperty("action")) { + var error = $root.google.spanner.executor.v1.SpannerAction.verify(message.action); + if (error) + return "action." + error; + } + return null; + }; + + /** + * Creates a SpannerAsyncActionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.executor.v1.SpannerAsyncActionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.executor.v1.SpannerAsyncActionRequest} SpannerAsyncActionRequest + */ + SpannerAsyncActionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.executor.v1.SpannerAsyncActionRequest) + return object; + var message = new $root.google.spanner.executor.v1.SpannerAsyncActionRequest(); + if (object.actionId != null) + message.actionId = object.actionId | 0; + if (object.action != null) { + if (typeof object.action !== "object") + throw TypeError(".google.spanner.executor.v1.SpannerAsyncActionRequest.action: object expected"); + message.action = $root.google.spanner.executor.v1.SpannerAction.fromObject(object.action); + } + return message; + }; + + /** + * Creates a plain object from a SpannerAsyncActionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.executor.v1.SpannerAsyncActionRequest + * @static + * @param {google.spanner.executor.v1.SpannerAsyncActionRequest} message SpannerAsyncActionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpannerAsyncActionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.actionId = 0; + object.action = null; + } + if (message.actionId != null && message.hasOwnProperty("actionId")) + object.actionId = message.actionId; + if (message.action != null && message.hasOwnProperty("action")) + object.action = $root.google.spanner.executor.v1.SpannerAction.toObject(message.action, options); + return object; + }; + + /** + * Converts this SpannerAsyncActionRequest to JSON. + * @function toJSON + * @memberof google.spanner.executor.v1.SpannerAsyncActionRequest + * @instance + * @returns {Object.} JSON object + */ + SpannerAsyncActionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SpannerAsyncActionRequest + * @function getTypeUrl + * @memberof google.spanner.executor.v1.SpannerAsyncActionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SpannerAsyncActionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.executor.v1.SpannerAsyncActionRequest"; + }; + + return SpannerAsyncActionRequest; + })(); + + v1.SpannerAsyncActionResponse = (function() { + + /** + * Properties of a SpannerAsyncActionResponse. + * @memberof google.spanner.executor.v1 + * @interface ISpannerAsyncActionResponse + * @property {number|null} [actionId] SpannerAsyncActionResponse actionId + * @property {google.spanner.executor.v1.ISpannerActionOutcome|null} [outcome] SpannerAsyncActionResponse outcome + */ + + /** + * Constructs a new SpannerAsyncActionResponse. + * @memberof google.spanner.executor.v1 + * @classdesc Represents a SpannerAsyncActionResponse. + * @implements ISpannerAsyncActionResponse + * @constructor + * @param {google.spanner.executor.v1.ISpannerAsyncActionResponse=} [properties] Properties to set + */ + function SpannerAsyncActionResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SpannerAsyncActionResponse actionId. + * @member {number} actionId + * @memberof google.spanner.executor.v1.SpannerAsyncActionResponse + * @instance + */ + SpannerAsyncActionResponse.prototype.actionId = 0; + + /** + * SpannerAsyncActionResponse outcome. + * @member {google.spanner.executor.v1.ISpannerActionOutcome|null|undefined} outcome + * @memberof google.spanner.executor.v1.SpannerAsyncActionResponse + * @instance + */ + SpannerAsyncActionResponse.prototype.outcome = null; + + /** + * Creates a new SpannerAsyncActionResponse instance using the specified properties. + * @function create + * @memberof google.spanner.executor.v1.SpannerAsyncActionResponse + * @static + * @param {google.spanner.executor.v1.ISpannerAsyncActionResponse=} [properties] Properties to set + * @returns {google.spanner.executor.v1.SpannerAsyncActionResponse} SpannerAsyncActionResponse instance + */ + SpannerAsyncActionResponse.create = function create(properties) { + return new SpannerAsyncActionResponse(properties); + }; + + /** + * Encodes the specified SpannerAsyncActionResponse message. Does not implicitly {@link google.spanner.executor.v1.SpannerAsyncActionResponse.verify|verify} messages. + * @function encode + * @memberof google.spanner.executor.v1.SpannerAsyncActionResponse + * @static + * @param {google.spanner.executor.v1.ISpannerAsyncActionResponse} message SpannerAsyncActionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpannerAsyncActionResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.actionId != null && Object.hasOwnProperty.call(message, "actionId")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.actionId); + if (message.outcome != null && Object.hasOwnProperty.call(message, "outcome")) + $root.google.spanner.executor.v1.SpannerActionOutcome.encode(message.outcome, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SpannerAsyncActionResponse message, length delimited. Does not implicitly {@link google.spanner.executor.v1.SpannerAsyncActionResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.executor.v1.SpannerAsyncActionResponse + * @static + * @param {google.spanner.executor.v1.ISpannerAsyncActionResponse} message SpannerAsyncActionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpannerAsyncActionResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SpannerAsyncActionResponse message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.executor.v1.SpannerAsyncActionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.executor.v1.SpannerAsyncActionResponse} SpannerAsyncActionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpannerAsyncActionResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.SpannerAsyncActionResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.actionId = reader.int32(); + break; + } + case 2: { + message.outcome = $root.google.spanner.executor.v1.SpannerActionOutcome.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SpannerAsyncActionResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.executor.v1.SpannerAsyncActionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.executor.v1.SpannerAsyncActionResponse} SpannerAsyncActionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpannerAsyncActionResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SpannerAsyncActionResponse message. + * @function verify + * @memberof google.spanner.executor.v1.SpannerAsyncActionResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SpannerAsyncActionResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.actionId != null && message.hasOwnProperty("actionId")) + if (!$util.isInteger(message.actionId)) + return "actionId: integer expected"; + if (message.outcome != null && message.hasOwnProperty("outcome")) { + var error = $root.google.spanner.executor.v1.SpannerActionOutcome.verify(message.outcome); + if (error) + return "outcome." + error; + } + return null; + }; + + /** + * Creates a SpannerAsyncActionResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.executor.v1.SpannerAsyncActionResponse + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.executor.v1.SpannerAsyncActionResponse} SpannerAsyncActionResponse + */ + SpannerAsyncActionResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.executor.v1.SpannerAsyncActionResponse) + return object; + var message = new $root.google.spanner.executor.v1.SpannerAsyncActionResponse(); + if (object.actionId != null) + message.actionId = object.actionId | 0; + if (object.outcome != null) { + if (typeof object.outcome !== "object") + throw TypeError(".google.spanner.executor.v1.SpannerAsyncActionResponse.outcome: object expected"); + message.outcome = $root.google.spanner.executor.v1.SpannerActionOutcome.fromObject(object.outcome); + } + return message; + }; + + /** + * Creates a plain object from a SpannerAsyncActionResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.executor.v1.SpannerAsyncActionResponse + * @static + * @param {google.spanner.executor.v1.SpannerAsyncActionResponse} message SpannerAsyncActionResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpannerAsyncActionResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.actionId = 0; + object.outcome = null; + } + if (message.actionId != null && message.hasOwnProperty("actionId")) + object.actionId = message.actionId; + if (message.outcome != null && message.hasOwnProperty("outcome")) + object.outcome = $root.google.spanner.executor.v1.SpannerActionOutcome.toObject(message.outcome, options); + return object; + }; + + /** + * Converts this SpannerAsyncActionResponse to JSON. + * @function toJSON + * @memberof google.spanner.executor.v1.SpannerAsyncActionResponse + * @instance + * @returns {Object.} JSON object + */ + SpannerAsyncActionResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SpannerAsyncActionResponse + * @function getTypeUrl + * @memberof google.spanner.executor.v1.SpannerAsyncActionResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SpannerAsyncActionResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.executor.v1.SpannerAsyncActionResponse"; + }; + + return SpannerAsyncActionResponse; + })(); + + v1.SpannerAction = (function() { + + /** + * Properties of a SpannerAction. + * @memberof google.spanner.executor.v1 + * @interface ISpannerAction + * @property {string|null} [databasePath] SpannerAction databasePath + * @property {google.spanner.executor.v1.ISpannerOptions|null} [spannerOptions] SpannerAction spannerOptions + * @property {google.spanner.executor.v1.IStartTransactionAction|null} [start] SpannerAction start + * @property {google.spanner.executor.v1.IFinishTransactionAction|null} [finish] SpannerAction finish + * @property {google.spanner.executor.v1.IReadAction|null} [read] SpannerAction read + * @property {google.spanner.executor.v1.IQueryAction|null} [query] SpannerAction query + * @property {google.spanner.executor.v1.IMutationAction|null} [mutation] SpannerAction mutation + * @property {google.spanner.executor.v1.IDmlAction|null} [dml] SpannerAction dml + * @property {google.spanner.executor.v1.IBatchDmlAction|null} [batchDml] SpannerAction batchDml + * @property {google.spanner.executor.v1.IWriteMutationsAction|null} [write] SpannerAction write + * @property {google.spanner.executor.v1.IPartitionedUpdateAction|null} [partitionedUpdate] SpannerAction partitionedUpdate + * @property {google.spanner.executor.v1.IAdminAction|null} [admin] SpannerAction admin + * @property {google.spanner.executor.v1.IStartBatchTransactionAction|null} [startBatchTxn] SpannerAction startBatchTxn + * @property {google.spanner.executor.v1.ICloseBatchTransactionAction|null} [closeBatchTxn] SpannerAction closeBatchTxn + * @property {google.spanner.executor.v1.IGenerateDbPartitionsForReadAction|null} [generateDbPartitionsRead] SpannerAction generateDbPartitionsRead + * @property {google.spanner.executor.v1.IGenerateDbPartitionsForQueryAction|null} [generateDbPartitionsQuery] SpannerAction generateDbPartitionsQuery + * @property {google.spanner.executor.v1.IExecutePartitionAction|null} [executePartition] SpannerAction executePartition + * @property {google.spanner.executor.v1.IExecuteChangeStreamQuery|null} [executeChangeStreamQuery] SpannerAction executeChangeStreamQuery + * @property {google.spanner.executor.v1.IQueryCancellationAction|null} [queryCancellation] SpannerAction queryCancellation + */ + + /** + * Constructs a new SpannerAction. + * @memberof google.spanner.executor.v1 + * @classdesc Represents a SpannerAction. + * @implements ISpannerAction + * @constructor + * @param {google.spanner.executor.v1.ISpannerAction=} [properties] Properties to set + */ + function SpannerAction(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SpannerAction databasePath. + * @member {string} databasePath + * @memberof google.spanner.executor.v1.SpannerAction + * @instance + */ + SpannerAction.prototype.databasePath = ""; + + /** + * SpannerAction spannerOptions. + * @member {google.spanner.executor.v1.ISpannerOptions|null|undefined} spannerOptions + * @memberof google.spanner.executor.v1.SpannerAction + * @instance + */ + SpannerAction.prototype.spannerOptions = null; + + /** + * SpannerAction start. + * @member {google.spanner.executor.v1.IStartTransactionAction|null|undefined} start + * @memberof google.spanner.executor.v1.SpannerAction + * @instance + */ + SpannerAction.prototype.start = null; + + /** + * SpannerAction finish. + * @member {google.spanner.executor.v1.IFinishTransactionAction|null|undefined} finish + * @memberof google.spanner.executor.v1.SpannerAction + * @instance + */ + SpannerAction.prototype.finish = null; + + /** + * SpannerAction read. + * @member {google.spanner.executor.v1.IReadAction|null|undefined} read + * @memberof google.spanner.executor.v1.SpannerAction + * @instance + */ + SpannerAction.prototype.read = null; + + /** + * SpannerAction query. + * @member {google.spanner.executor.v1.IQueryAction|null|undefined} query + * @memberof google.spanner.executor.v1.SpannerAction + * @instance + */ + SpannerAction.prototype.query = null; + + /** + * SpannerAction mutation. + * @member {google.spanner.executor.v1.IMutationAction|null|undefined} mutation + * @memberof google.spanner.executor.v1.SpannerAction + * @instance + */ + SpannerAction.prototype.mutation = null; + + /** + * SpannerAction dml. + * @member {google.spanner.executor.v1.IDmlAction|null|undefined} dml + * @memberof google.spanner.executor.v1.SpannerAction + * @instance + */ + SpannerAction.prototype.dml = null; + + /** + * SpannerAction batchDml. + * @member {google.spanner.executor.v1.IBatchDmlAction|null|undefined} batchDml + * @memberof google.spanner.executor.v1.SpannerAction + * @instance + */ + SpannerAction.prototype.batchDml = null; + + /** + * SpannerAction write. + * @member {google.spanner.executor.v1.IWriteMutationsAction|null|undefined} write + * @memberof google.spanner.executor.v1.SpannerAction + * @instance + */ + SpannerAction.prototype.write = null; + + /** + * SpannerAction partitionedUpdate. + * @member {google.spanner.executor.v1.IPartitionedUpdateAction|null|undefined} partitionedUpdate + * @memberof google.spanner.executor.v1.SpannerAction + * @instance + */ + SpannerAction.prototype.partitionedUpdate = null; + + /** + * SpannerAction admin. + * @member {google.spanner.executor.v1.IAdminAction|null|undefined} admin + * @memberof google.spanner.executor.v1.SpannerAction + * @instance + */ + SpannerAction.prototype.admin = null; + + /** + * SpannerAction startBatchTxn. + * @member {google.spanner.executor.v1.IStartBatchTransactionAction|null|undefined} startBatchTxn + * @memberof google.spanner.executor.v1.SpannerAction + * @instance + */ + SpannerAction.prototype.startBatchTxn = null; + + /** + * SpannerAction closeBatchTxn. + * @member {google.spanner.executor.v1.ICloseBatchTransactionAction|null|undefined} closeBatchTxn + * @memberof google.spanner.executor.v1.SpannerAction + * @instance + */ + SpannerAction.prototype.closeBatchTxn = null; + + /** + * SpannerAction generateDbPartitionsRead. + * @member {google.spanner.executor.v1.IGenerateDbPartitionsForReadAction|null|undefined} generateDbPartitionsRead + * @memberof google.spanner.executor.v1.SpannerAction + * @instance + */ + SpannerAction.prototype.generateDbPartitionsRead = null; + + /** + * SpannerAction generateDbPartitionsQuery. + * @member {google.spanner.executor.v1.IGenerateDbPartitionsForQueryAction|null|undefined} generateDbPartitionsQuery + * @memberof google.spanner.executor.v1.SpannerAction + * @instance + */ + SpannerAction.prototype.generateDbPartitionsQuery = null; + + /** + * SpannerAction executePartition. + * @member {google.spanner.executor.v1.IExecutePartitionAction|null|undefined} executePartition + * @memberof google.spanner.executor.v1.SpannerAction + * @instance + */ + SpannerAction.prototype.executePartition = null; + + /** + * SpannerAction executeChangeStreamQuery. + * @member {google.spanner.executor.v1.IExecuteChangeStreamQuery|null|undefined} executeChangeStreamQuery + * @memberof google.spanner.executor.v1.SpannerAction + * @instance + */ + SpannerAction.prototype.executeChangeStreamQuery = null; + + /** + * SpannerAction queryCancellation. + * @member {google.spanner.executor.v1.IQueryCancellationAction|null|undefined} queryCancellation + * @memberof google.spanner.executor.v1.SpannerAction + * @instance + */ + SpannerAction.prototype.queryCancellation = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SpannerAction action. + * @member {"start"|"finish"|"read"|"query"|"mutation"|"dml"|"batchDml"|"write"|"partitionedUpdate"|"admin"|"startBatchTxn"|"closeBatchTxn"|"generateDbPartitionsRead"|"generateDbPartitionsQuery"|"executePartition"|"executeChangeStreamQuery"|"queryCancellation"|undefined} action + * @memberof google.spanner.executor.v1.SpannerAction + * @instance + */ + Object.defineProperty(SpannerAction.prototype, "action", { + get: $util.oneOfGetter($oneOfFields = ["start", "finish", "read", "query", "mutation", "dml", "batchDml", "write", "partitionedUpdate", "admin", "startBatchTxn", "closeBatchTxn", "generateDbPartitionsRead", "generateDbPartitionsQuery", "executePartition", "executeChangeStreamQuery", "queryCancellation"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SpannerAction instance using the specified properties. + * @function create + * @memberof google.spanner.executor.v1.SpannerAction + * @static + * @param {google.spanner.executor.v1.ISpannerAction=} [properties] Properties to set + * @returns {google.spanner.executor.v1.SpannerAction} SpannerAction instance + */ + SpannerAction.create = function create(properties) { + return new SpannerAction(properties); + }; + + /** + * Encodes the specified SpannerAction message. Does not implicitly {@link google.spanner.executor.v1.SpannerAction.verify|verify} messages. + * @function encode + * @memberof google.spanner.executor.v1.SpannerAction + * @static + * @param {google.spanner.executor.v1.ISpannerAction} message SpannerAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpannerAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.databasePath != null && Object.hasOwnProperty.call(message, "databasePath")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.databasePath); + if (message.spannerOptions != null && Object.hasOwnProperty.call(message, "spannerOptions")) + $root.google.spanner.executor.v1.SpannerOptions.encode(message.spannerOptions, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + $root.google.spanner.executor.v1.StartTransactionAction.encode(message.start, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.finish != null && Object.hasOwnProperty.call(message, "finish")) + $root.google.spanner.executor.v1.FinishTransactionAction.encode(message.finish, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.read != null && Object.hasOwnProperty.call(message, "read")) + $root.google.spanner.executor.v1.ReadAction.encode(message.read, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + $root.google.spanner.executor.v1.QueryAction.encode(message.query, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.mutation != null && Object.hasOwnProperty.call(message, "mutation")) + $root.google.spanner.executor.v1.MutationAction.encode(message.mutation, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.dml != null && Object.hasOwnProperty.call(message, "dml")) + $root.google.spanner.executor.v1.DmlAction.encode(message.dml, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.batchDml != null && Object.hasOwnProperty.call(message, "batchDml")) + $root.google.spanner.executor.v1.BatchDmlAction.encode(message.batchDml, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + if (message.write != null && Object.hasOwnProperty.call(message, "write")) + $root.google.spanner.executor.v1.WriteMutationsAction.encode(message.write, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); + if (message.partitionedUpdate != null && Object.hasOwnProperty.call(message, "partitionedUpdate")) + $root.google.spanner.executor.v1.PartitionedUpdateAction.encode(message.partitionedUpdate, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); + if (message.admin != null && Object.hasOwnProperty.call(message, "admin")) + $root.google.spanner.executor.v1.AdminAction.encode(message.admin, writer.uint32(/* id 30, wireType 2 =*/242).fork()).ldelim(); + if (message.startBatchTxn != null && Object.hasOwnProperty.call(message, "startBatchTxn")) + $root.google.spanner.executor.v1.StartBatchTransactionAction.encode(message.startBatchTxn, writer.uint32(/* id 40, wireType 2 =*/322).fork()).ldelim(); + if (message.closeBatchTxn != null && Object.hasOwnProperty.call(message, "closeBatchTxn")) + $root.google.spanner.executor.v1.CloseBatchTransactionAction.encode(message.closeBatchTxn, writer.uint32(/* id 41, wireType 2 =*/330).fork()).ldelim(); + if (message.generateDbPartitionsRead != null && Object.hasOwnProperty.call(message, "generateDbPartitionsRead")) + $root.google.spanner.executor.v1.GenerateDbPartitionsForReadAction.encode(message.generateDbPartitionsRead, writer.uint32(/* id 42, wireType 2 =*/338).fork()).ldelim(); + if (message.generateDbPartitionsQuery != null && Object.hasOwnProperty.call(message, "generateDbPartitionsQuery")) + $root.google.spanner.executor.v1.GenerateDbPartitionsForQueryAction.encode(message.generateDbPartitionsQuery, writer.uint32(/* id 43, wireType 2 =*/346).fork()).ldelim(); + if (message.executePartition != null && Object.hasOwnProperty.call(message, "executePartition")) + $root.google.spanner.executor.v1.ExecutePartitionAction.encode(message.executePartition, writer.uint32(/* id 44, wireType 2 =*/354).fork()).ldelim(); + if (message.executeChangeStreamQuery != null && Object.hasOwnProperty.call(message, "executeChangeStreamQuery")) + $root.google.spanner.executor.v1.ExecuteChangeStreamQuery.encode(message.executeChangeStreamQuery, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); + if (message.queryCancellation != null && Object.hasOwnProperty.call(message, "queryCancellation")) + $root.google.spanner.executor.v1.QueryCancellationAction.encode(message.queryCancellation, writer.uint32(/* id 51, wireType 2 =*/410).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SpannerAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.SpannerAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.executor.v1.SpannerAction + * @static + * @param {google.spanner.executor.v1.ISpannerAction} message SpannerAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpannerAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SpannerAction message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.executor.v1.SpannerAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.executor.v1.SpannerAction} SpannerAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpannerAction.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.SpannerAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.databasePath = reader.string(); + break; + } + case 2: { + message.spannerOptions = $root.google.spanner.executor.v1.SpannerOptions.decode(reader, reader.uint32()); + break; + } + case 10: { + message.start = $root.google.spanner.executor.v1.StartTransactionAction.decode(reader, reader.uint32()); + break; + } + case 11: { + message.finish = $root.google.spanner.executor.v1.FinishTransactionAction.decode(reader, reader.uint32()); + break; + } + case 20: { + message.read = $root.google.spanner.executor.v1.ReadAction.decode(reader, reader.uint32()); + break; + } + case 21: { + message.query = $root.google.spanner.executor.v1.QueryAction.decode(reader, reader.uint32()); + break; + } + case 22: { + message.mutation = $root.google.spanner.executor.v1.MutationAction.decode(reader, reader.uint32()); + break; + } + case 23: { + message.dml = $root.google.spanner.executor.v1.DmlAction.decode(reader, reader.uint32()); + break; + } + case 24: { + message.batchDml = $root.google.spanner.executor.v1.BatchDmlAction.decode(reader, reader.uint32()); + break; + } + case 25: { + message.write = $root.google.spanner.executor.v1.WriteMutationsAction.decode(reader, reader.uint32()); + break; + } + case 27: { + message.partitionedUpdate = $root.google.spanner.executor.v1.PartitionedUpdateAction.decode(reader, reader.uint32()); + break; + } + case 30: { + message.admin = $root.google.spanner.executor.v1.AdminAction.decode(reader, reader.uint32()); + break; + } + case 40: { + message.startBatchTxn = $root.google.spanner.executor.v1.StartBatchTransactionAction.decode(reader, reader.uint32()); + break; + } + case 41: { + message.closeBatchTxn = $root.google.spanner.executor.v1.CloseBatchTransactionAction.decode(reader, reader.uint32()); + break; + } + case 42: { + message.generateDbPartitionsRead = $root.google.spanner.executor.v1.GenerateDbPartitionsForReadAction.decode(reader, reader.uint32()); + break; + } + case 43: { + message.generateDbPartitionsQuery = $root.google.spanner.executor.v1.GenerateDbPartitionsForQueryAction.decode(reader, reader.uint32()); + break; + } + case 44: { + message.executePartition = $root.google.spanner.executor.v1.ExecutePartitionAction.decode(reader, reader.uint32()); + break; + } + case 50: { + message.executeChangeStreamQuery = $root.google.spanner.executor.v1.ExecuteChangeStreamQuery.decode(reader, reader.uint32()); + break; + } + case 51: { + message.queryCancellation = $root.google.spanner.executor.v1.QueryCancellationAction.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SpannerAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.executor.v1.SpannerAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.executor.v1.SpannerAction} SpannerAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpannerAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SpannerAction message. + * @function verify + * @memberof google.spanner.executor.v1.SpannerAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SpannerAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.databasePath != null && message.hasOwnProperty("databasePath")) + if (!$util.isString(message.databasePath)) + return "databasePath: string expected"; + if (message.spannerOptions != null && message.hasOwnProperty("spannerOptions")) { + var error = $root.google.spanner.executor.v1.SpannerOptions.verify(message.spannerOptions); + if (error) + return "spannerOptions." + error; + } + if (message.start != null && message.hasOwnProperty("start")) { + properties.action = 1; + { + var error = $root.google.spanner.executor.v1.StartTransactionAction.verify(message.start); + if (error) + return "start." + error; + } + } + if (message.finish != null && message.hasOwnProperty("finish")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.spanner.executor.v1.FinishTransactionAction.verify(message.finish); + if (error) + return "finish." + error; + } + } + if (message.read != null && message.hasOwnProperty("read")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.spanner.executor.v1.ReadAction.verify(message.read); + if (error) + return "read." + error; + } + } + if (message.query != null && message.hasOwnProperty("query")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.spanner.executor.v1.QueryAction.verify(message.query); + if (error) + return "query." + error; + } + } + if (message.mutation != null && message.hasOwnProperty("mutation")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.spanner.executor.v1.MutationAction.verify(message.mutation); + if (error) + return "mutation." + error; + } + } + if (message.dml != null && message.hasOwnProperty("dml")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.spanner.executor.v1.DmlAction.verify(message.dml); + if (error) + return "dml." + error; + } + } + if (message.batchDml != null && message.hasOwnProperty("batchDml")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.spanner.executor.v1.BatchDmlAction.verify(message.batchDml); + if (error) + return "batchDml." + error; + } + } + if (message.write != null && message.hasOwnProperty("write")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.spanner.executor.v1.WriteMutationsAction.verify(message.write); + if (error) + return "write." + error; + } + } + if (message.partitionedUpdate != null && message.hasOwnProperty("partitionedUpdate")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.spanner.executor.v1.PartitionedUpdateAction.verify(message.partitionedUpdate); + if (error) + return "partitionedUpdate." + error; + } + } + if (message.admin != null && message.hasOwnProperty("admin")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.spanner.executor.v1.AdminAction.verify(message.admin); + if (error) + return "admin." + error; + } + } + if (message.startBatchTxn != null && message.hasOwnProperty("startBatchTxn")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.spanner.executor.v1.StartBatchTransactionAction.verify(message.startBatchTxn); + if (error) + return "startBatchTxn." + error; + } + } + if (message.closeBatchTxn != null && message.hasOwnProperty("closeBatchTxn")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.spanner.executor.v1.CloseBatchTransactionAction.verify(message.closeBatchTxn); + if (error) + return "closeBatchTxn." + error; + } + } + if (message.generateDbPartitionsRead != null && message.hasOwnProperty("generateDbPartitionsRead")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.spanner.executor.v1.GenerateDbPartitionsForReadAction.verify(message.generateDbPartitionsRead); + if (error) + return "generateDbPartitionsRead." + error; + } + } + if (message.generateDbPartitionsQuery != null && message.hasOwnProperty("generateDbPartitionsQuery")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.spanner.executor.v1.GenerateDbPartitionsForQueryAction.verify(message.generateDbPartitionsQuery); + if (error) + return "generateDbPartitionsQuery." + error; + } + } + if (message.executePartition != null && message.hasOwnProperty("executePartition")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.spanner.executor.v1.ExecutePartitionAction.verify(message.executePartition); + if (error) + return "executePartition." + error; + } + } + if (message.executeChangeStreamQuery != null && message.hasOwnProperty("executeChangeStreamQuery")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.spanner.executor.v1.ExecuteChangeStreamQuery.verify(message.executeChangeStreamQuery); + if (error) + return "executeChangeStreamQuery." + error; + } + } + if (message.queryCancellation != null && message.hasOwnProperty("queryCancellation")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.spanner.executor.v1.QueryCancellationAction.verify(message.queryCancellation); + if (error) + return "queryCancellation." + error; + } + } + return null; + }; + + /** + * Creates a SpannerAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.executor.v1.SpannerAction + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.executor.v1.SpannerAction} SpannerAction + */ + SpannerAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.executor.v1.SpannerAction) + return object; + var message = new $root.google.spanner.executor.v1.SpannerAction(); + if (object.databasePath != null) + message.databasePath = String(object.databasePath); + if (object.spannerOptions != null) { + if (typeof object.spannerOptions !== "object") + throw TypeError(".google.spanner.executor.v1.SpannerAction.spannerOptions: object expected"); + message.spannerOptions = $root.google.spanner.executor.v1.SpannerOptions.fromObject(object.spannerOptions); + } + if (object.start != null) { + if (typeof object.start !== "object") + throw TypeError(".google.spanner.executor.v1.SpannerAction.start: object expected"); + message.start = $root.google.spanner.executor.v1.StartTransactionAction.fromObject(object.start); + } + if (object.finish != null) { + if (typeof object.finish !== "object") + throw TypeError(".google.spanner.executor.v1.SpannerAction.finish: object expected"); + message.finish = $root.google.spanner.executor.v1.FinishTransactionAction.fromObject(object.finish); + } + if (object.read != null) { + if (typeof object.read !== "object") + throw TypeError(".google.spanner.executor.v1.SpannerAction.read: object expected"); + message.read = $root.google.spanner.executor.v1.ReadAction.fromObject(object.read); + } + if (object.query != null) { + if (typeof object.query !== "object") + throw TypeError(".google.spanner.executor.v1.SpannerAction.query: object expected"); + message.query = $root.google.spanner.executor.v1.QueryAction.fromObject(object.query); + } + if (object.mutation != null) { + if (typeof object.mutation !== "object") + throw TypeError(".google.spanner.executor.v1.SpannerAction.mutation: object expected"); + message.mutation = $root.google.spanner.executor.v1.MutationAction.fromObject(object.mutation); + } + if (object.dml != null) { + if (typeof object.dml !== "object") + throw TypeError(".google.spanner.executor.v1.SpannerAction.dml: object expected"); + message.dml = $root.google.spanner.executor.v1.DmlAction.fromObject(object.dml); + } + if (object.batchDml != null) { + if (typeof object.batchDml !== "object") + throw TypeError(".google.spanner.executor.v1.SpannerAction.batchDml: object expected"); + message.batchDml = $root.google.spanner.executor.v1.BatchDmlAction.fromObject(object.batchDml); + } + if (object.write != null) { + if (typeof object.write !== "object") + throw TypeError(".google.spanner.executor.v1.SpannerAction.write: object expected"); + message.write = $root.google.spanner.executor.v1.WriteMutationsAction.fromObject(object.write); + } + if (object.partitionedUpdate != null) { + if (typeof object.partitionedUpdate !== "object") + throw TypeError(".google.spanner.executor.v1.SpannerAction.partitionedUpdate: object expected"); + message.partitionedUpdate = $root.google.spanner.executor.v1.PartitionedUpdateAction.fromObject(object.partitionedUpdate); + } + if (object.admin != null) { + if (typeof object.admin !== "object") + throw TypeError(".google.spanner.executor.v1.SpannerAction.admin: object expected"); + message.admin = $root.google.spanner.executor.v1.AdminAction.fromObject(object.admin); + } + if (object.startBatchTxn != null) { + if (typeof object.startBatchTxn !== "object") + throw TypeError(".google.spanner.executor.v1.SpannerAction.startBatchTxn: object expected"); + message.startBatchTxn = $root.google.spanner.executor.v1.StartBatchTransactionAction.fromObject(object.startBatchTxn); + } + if (object.closeBatchTxn != null) { + if (typeof object.closeBatchTxn !== "object") + throw TypeError(".google.spanner.executor.v1.SpannerAction.closeBatchTxn: object expected"); + message.closeBatchTxn = $root.google.spanner.executor.v1.CloseBatchTransactionAction.fromObject(object.closeBatchTxn); + } + if (object.generateDbPartitionsRead != null) { + if (typeof object.generateDbPartitionsRead !== "object") + throw TypeError(".google.spanner.executor.v1.SpannerAction.generateDbPartitionsRead: object expected"); + message.generateDbPartitionsRead = $root.google.spanner.executor.v1.GenerateDbPartitionsForReadAction.fromObject(object.generateDbPartitionsRead); + } + if (object.generateDbPartitionsQuery != null) { + if (typeof object.generateDbPartitionsQuery !== "object") + throw TypeError(".google.spanner.executor.v1.SpannerAction.generateDbPartitionsQuery: object expected"); + message.generateDbPartitionsQuery = $root.google.spanner.executor.v1.GenerateDbPartitionsForQueryAction.fromObject(object.generateDbPartitionsQuery); + } + if (object.executePartition != null) { + if (typeof object.executePartition !== "object") + throw TypeError(".google.spanner.executor.v1.SpannerAction.executePartition: object expected"); + message.executePartition = $root.google.spanner.executor.v1.ExecutePartitionAction.fromObject(object.executePartition); + } + if (object.executeChangeStreamQuery != null) { + if (typeof object.executeChangeStreamQuery !== "object") + throw TypeError(".google.spanner.executor.v1.SpannerAction.executeChangeStreamQuery: object expected"); + message.executeChangeStreamQuery = $root.google.spanner.executor.v1.ExecuteChangeStreamQuery.fromObject(object.executeChangeStreamQuery); + } + if (object.queryCancellation != null) { + if (typeof object.queryCancellation !== "object") + throw TypeError(".google.spanner.executor.v1.SpannerAction.queryCancellation: object expected"); + message.queryCancellation = $root.google.spanner.executor.v1.QueryCancellationAction.fromObject(object.queryCancellation); + } + return message; + }; + + /** + * Creates a plain object from a SpannerAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.executor.v1.SpannerAction + * @static + * @param {google.spanner.executor.v1.SpannerAction} message SpannerAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpannerAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.databasePath = ""; + object.spannerOptions = null; + } + if (message.databasePath != null && message.hasOwnProperty("databasePath")) + object.databasePath = message.databasePath; + if (message.spannerOptions != null && message.hasOwnProperty("spannerOptions")) + object.spannerOptions = $root.google.spanner.executor.v1.SpannerOptions.toObject(message.spannerOptions, options); + if (message.start != null && message.hasOwnProperty("start")) { + object.start = $root.google.spanner.executor.v1.StartTransactionAction.toObject(message.start, options); + if (options.oneofs) + object.action = "start"; + } + if (message.finish != null && message.hasOwnProperty("finish")) { + object.finish = $root.google.spanner.executor.v1.FinishTransactionAction.toObject(message.finish, options); + if (options.oneofs) + object.action = "finish"; + } + if (message.read != null && message.hasOwnProperty("read")) { + object.read = $root.google.spanner.executor.v1.ReadAction.toObject(message.read, options); + if (options.oneofs) + object.action = "read"; + } + if (message.query != null && message.hasOwnProperty("query")) { + object.query = $root.google.spanner.executor.v1.QueryAction.toObject(message.query, options); + if (options.oneofs) + object.action = "query"; + } + if (message.mutation != null && message.hasOwnProperty("mutation")) { + object.mutation = $root.google.spanner.executor.v1.MutationAction.toObject(message.mutation, options); + if (options.oneofs) + object.action = "mutation"; + } + if (message.dml != null && message.hasOwnProperty("dml")) { + object.dml = $root.google.spanner.executor.v1.DmlAction.toObject(message.dml, options); + if (options.oneofs) + object.action = "dml"; + } + if (message.batchDml != null && message.hasOwnProperty("batchDml")) { + object.batchDml = $root.google.spanner.executor.v1.BatchDmlAction.toObject(message.batchDml, options); + if (options.oneofs) + object.action = "batchDml"; + } + if (message.write != null && message.hasOwnProperty("write")) { + object.write = $root.google.spanner.executor.v1.WriteMutationsAction.toObject(message.write, options); + if (options.oneofs) + object.action = "write"; + } + if (message.partitionedUpdate != null && message.hasOwnProperty("partitionedUpdate")) { + object.partitionedUpdate = $root.google.spanner.executor.v1.PartitionedUpdateAction.toObject(message.partitionedUpdate, options); + if (options.oneofs) + object.action = "partitionedUpdate"; + } + if (message.admin != null && message.hasOwnProperty("admin")) { + object.admin = $root.google.spanner.executor.v1.AdminAction.toObject(message.admin, options); + if (options.oneofs) + object.action = "admin"; + } + if (message.startBatchTxn != null && message.hasOwnProperty("startBatchTxn")) { + object.startBatchTxn = $root.google.spanner.executor.v1.StartBatchTransactionAction.toObject(message.startBatchTxn, options); + if (options.oneofs) + object.action = "startBatchTxn"; + } + if (message.closeBatchTxn != null && message.hasOwnProperty("closeBatchTxn")) { + object.closeBatchTxn = $root.google.spanner.executor.v1.CloseBatchTransactionAction.toObject(message.closeBatchTxn, options); + if (options.oneofs) + object.action = "closeBatchTxn"; + } + if (message.generateDbPartitionsRead != null && message.hasOwnProperty("generateDbPartitionsRead")) { + object.generateDbPartitionsRead = $root.google.spanner.executor.v1.GenerateDbPartitionsForReadAction.toObject(message.generateDbPartitionsRead, options); + if (options.oneofs) + object.action = "generateDbPartitionsRead"; + } + if (message.generateDbPartitionsQuery != null && message.hasOwnProperty("generateDbPartitionsQuery")) { + object.generateDbPartitionsQuery = $root.google.spanner.executor.v1.GenerateDbPartitionsForQueryAction.toObject(message.generateDbPartitionsQuery, options); + if (options.oneofs) + object.action = "generateDbPartitionsQuery"; + } + if (message.executePartition != null && message.hasOwnProperty("executePartition")) { + object.executePartition = $root.google.spanner.executor.v1.ExecutePartitionAction.toObject(message.executePartition, options); + if (options.oneofs) + object.action = "executePartition"; + } + if (message.executeChangeStreamQuery != null && message.hasOwnProperty("executeChangeStreamQuery")) { + object.executeChangeStreamQuery = $root.google.spanner.executor.v1.ExecuteChangeStreamQuery.toObject(message.executeChangeStreamQuery, options); + if (options.oneofs) + object.action = "executeChangeStreamQuery"; + } + if (message.queryCancellation != null && message.hasOwnProperty("queryCancellation")) { + object.queryCancellation = $root.google.spanner.executor.v1.QueryCancellationAction.toObject(message.queryCancellation, options); + if (options.oneofs) + object.action = "queryCancellation"; + } + return object; + }; + + /** + * Converts this SpannerAction to JSON. + * @function toJSON + * @memberof google.spanner.executor.v1.SpannerAction + * @instance + * @returns {Object.} JSON object + */ + SpannerAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SpannerAction + * @function getTypeUrl + * @memberof google.spanner.executor.v1.SpannerAction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SpannerAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.executor.v1.SpannerAction"; + }; + + return SpannerAction; + })(); + + v1.ReadAction = (function() { + + /** + * Properties of a ReadAction. + * @memberof google.spanner.executor.v1 + * @interface IReadAction + * @property {string|null} [table] ReadAction table + * @property {string|null} [index] ReadAction index + * @property {Array.|null} [column] ReadAction column + * @property {google.spanner.executor.v1.IKeySet|null} [keys] ReadAction keys + * @property {number|null} [limit] ReadAction limit + */ + + /** + * Constructs a new ReadAction. + * @memberof google.spanner.executor.v1 + * @classdesc Represents a ReadAction. + * @implements IReadAction + * @constructor + * @param {google.spanner.executor.v1.IReadAction=} [properties] Properties to set + */ + function ReadAction(properties) { + this.column = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReadAction table. + * @member {string} table + * @memberof google.spanner.executor.v1.ReadAction + * @instance + */ + ReadAction.prototype.table = ""; + + /** + * ReadAction index. + * @member {string|null|undefined} index + * @memberof google.spanner.executor.v1.ReadAction + * @instance + */ + ReadAction.prototype.index = null; + + /** + * ReadAction column. + * @member {Array.} column + * @memberof google.spanner.executor.v1.ReadAction + * @instance + */ + ReadAction.prototype.column = $util.emptyArray; + + /** + * ReadAction keys. + * @member {google.spanner.executor.v1.IKeySet|null|undefined} keys + * @memberof google.spanner.executor.v1.ReadAction + * @instance + */ + ReadAction.prototype.keys = null; + + /** + * ReadAction limit. + * @member {number} limit + * @memberof google.spanner.executor.v1.ReadAction + * @instance + */ + ReadAction.prototype.limit = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ReadAction.prototype, "_index", { + get: $util.oneOfGetter($oneOfFields = ["index"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ReadAction instance using the specified properties. + * @function create + * @memberof google.spanner.executor.v1.ReadAction + * @static + * @param {google.spanner.executor.v1.IReadAction=} [properties] Properties to set + * @returns {google.spanner.executor.v1.ReadAction} ReadAction instance + */ + ReadAction.create = function create(properties) { + return new ReadAction(properties); + }; + + /** + * Encodes the specified ReadAction message. Does not implicitly {@link google.spanner.executor.v1.ReadAction.verify|verify} messages. + * @function encode + * @memberof google.spanner.executor.v1.ReadAction + * @static + * @param {google.spanner.executor.v1.IReadAction} message ReadAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.table != null && Object.hasOwnProperty.call(message, "table")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.table); + if (message.index != null && Object.hasOwnProperty.call(message, "index")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.index); + if (message.column != null && message.column.length) + for (var i = 0; i < message.column.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.column[i]); + if (message.keys != null && Object.hasOwnProperty.call(message, "keys")) + $root.google.spanner.executor.v1.KeySet.encode(message.keys, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.limit); + return writer; + }; + + /** + * Encodes the specified ReadAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.ReadAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.executor.v1.ReadAction + * @static + * @param {google.spanner.executor.v1.IReadAction} message ReadAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReadAction message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.executor.v1.ReadAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.executor.v1.ReadAction} ReadAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadAction.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.ReadAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.table = reader.string(); + break; + } + case 2: { + message.index = reader.string(); + break; + } + case 3: { + if (!(message.column && message.column.length)) + message.column = []; + message.column.push(reader.string()); + break; + } + case 4: { + message.keys = $root.google.spanner.executor.v1.KeySet.decode(reader, reader.uint32()); + break; + } + case 5: { + message.limit = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReadAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.executor.v1.ReadAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.executor.v1.ReadAction} ReadAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReadAction message. + * @function verify + * @memberof google.spanner.executor.v1.ReadAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReadAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.table != null && message.hasOwnProperty("table")) + if (!$util.isString(message.table)) + return "table: string expected"; + if (message.index != null && message.hasOwnProperty("index")) { + properties._index = 1; + if (!$util.isString(message.index)) + return "index: string expected"; + } + if (message.column != null && message.hasOwnProperty("column")) { + if (!Array.isArray(message.column)) + return "column: array expected"; + for (var i = 0; i < message.column.length; ++i) + if (!$util.isString(message.column[i])) + return "column: string[] expected"; + } + if (message.keys != null && message.hasOwnProperty("keys")) { + var error = $root.google.spanner.executor.v1.KeySet.verify(message.keys); + if (error) + return "keys." + error; + } + if (message.limit != null && message.hasOwnProperty("limit")) + if (!$util.isInteger(message.limit)) + return "limit: integer expected"; + return null; + }; + + /** + * Creates a ReadAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.executor.v1.ReadAction + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.executor.v1.ReadAction} ReadAction + */ + ReadAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.executor.v1.ReadAction) + return object; + var message = new $root.google.spanner.executor.v1.ReadAction(); + if (object.table != null) + message.table = String(object.table); + if (object.index != null) + message.index = String(object.index); + if (object.column) { + if (!Array.isArray(object.column)) + throw TypeError(".google.spanner.executor.v1.ReadAction.column: array expected"); + message.column = []; + for (var i = 0; i < object.column.length; ++i) + message.column[i] = String(object.column[i]); + } + if (object.keys != null) { + if (typeof object.keys !== "object") + throw TypeError(".google.spanner.executor.v1.ReadAction.keys: object expected"); + message.keys = $root.google.spanner.executor.v1.KeySet.fromObject(object.keys); + } + if (object.limit != null) + message.limit = object.limit | 0; + return message; + }; + + /** + * Creates a plain object from a ReadAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.executor.v1.ReadAction + * @static + * @param {google.spanner.executor.v1.ReadAction} message ReadAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReadAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.column = []; + if (options.defaults) { + object.table = ""; + object.keys = null; + object.limit = 0; + } + if (message.table != null && message.hasOwnProperty("table")) + object.table = message.table; + if (message.index != null && message.hasOwnProperty("index")) { + object.index = message.index; + if (options.oneofs) + object._index = "index"; + } + if (message.column && message.column.length) { + object.column = []; + for (var j = 0; j < message.column.length; ++j) + object.column[j] = message.column[j]; + } + if (message.keys != null && message.hasOwnProperty("keys")) + object.keys = $root.google.spanner.executor.v1.KeySet.toObject(message.keys, options); + if (message.limit != null && message.hasOwnProperty("limit")) + object.limit = message.limit; + return object; + }; + + /** + * Converts this ReadAction to JSON. + * @function toJSON + * @memberof google.spanner.executor.v1.ReadAction + * @instance + * @returns {Object.} JSON object + */ + ReadAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReadAction + * @function getTypeUrl + * @memberof google.spanner.executor.v1.ReadAction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReadAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.executor.v1.ReadAction"; + }; + + return ReadAction; + })(); + + v1.QueryAction = (function() { + + /** + * Properties of a QueryAction. + * @memberof google.spanner.executor.v1 + * @interface IQueryAction + * @property {string|null} [sql] QueryAction sql + * @property {Array.|null} [params] QueryAction params + */ + + /** + * Constructs a new QueryAction. + * @memberof google.spanner.executor.v1 + * @classdesc Represents a QueryAction. + * @implements IQueryAction + * @constructor + * @param {google.spanner.executor.v1.IQueryAction=} [properties] Properties to set + */ + function QueryAction(properties) { + this.params = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryAction sql. + * @member {string} sql + * @memberof google.spanner.executor.v1.QueryAction + * @instance + */ + QueryAction.prototype.sql = ""; + + /** + * QueryAction params. + * @member {Array.} params + * @memberof google.spanner.executor.v1.QueryAction + * @instance + */ + QueryAction.prototype.params = $util.emptyArray; + + /** + * Creates a new QueryAction instance using the specified properties. + * @function create + * @memberof google.spanner.executor.v1.QueryAction + * @static + * @param {google.spanner.executor.v1.IQueryAction=} [properties] Properties to set + * @returns {google.spanner.executor.v1.QueryAction} QueryAction instance + */ + QueryAction.create = function create(properties) { + return new QueryAction(properties); + }; + + /** + * Encodes the specified QueryAction message. Does not implicitly {@link google.spanner.executor.v1.QueryAction.verify|verify} messages. + * @function encode + * @memberof google.spanner.executor.v1.QueryAction + * @static + * @param {google.spanner.executor.v1.IQueryAction} message QueryAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sql != null && Object.hasOwnProperty.call(message, "sql")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.sql); + if (message.params != null && message.params.length) + for (var i = 0; i < message.params.length; ++i) + $root.google.spanner.executor.v1.QueryAction.Parameter.encode(message.params[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.QueryAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.executor.v1.QueryAction + * @static + * @param {google.spanner.executor.v1.IQueryAction} message QueryAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryAction message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.executor.v1.QueryAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.executor.v1.QueryAction} QueryAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryAction.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.QueryAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.sql = reader.string(); + break; + } + case 2: { + if (!(message.params && message.params.length)) + message.params = []; + message.params.push($root.google.spanner.executor.v1.QueryAction.Parameter.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.executor.v1.QueryAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.executor.v1.QueryAction} QueryAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryAction message. + * @function verify + * @memberof google.spanner.executor.v1.QueryAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sql != null && message.hasOwnProperty("sql")) + if (!$util.isString(message.sql)) + return "sql: string expected"; + if (message.params != null && message.hasOwnProperty("params")) { + if (!Array.isArray(message.params)) + return "params: array expected"; + for (var i = 0; i < message.params.length; ++i) { + var error = $root.google.spanner.executor.v1.QueryAction.Parameter.verify(message.params[i]); + if (error) + return "params." + error; + } + } + return null; + }; + + /** + * Creates a QueryAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.executor.v1.QueryAction + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.executor.v1.QueryAction} QueryAction + */ + QueryAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.executor.v1.QueryAction) + return object; + var message = new $root.google.spanner.executor.v1.QueryAction(); + if (object.sql != null) + message.sql = String(object.sql); + if (object.params) { + if (!Array.isArray(object.params)) + throw TypeError(".google.spanner.executor.v1.QueryAction.params: array expected"); + message.params = []; + for (var i = 0; i < object.params.length; ++i) { + if (typeof object.params[i] !== "object") + throw TypeError(".google.spanner.executor.v1.QueryAction.params: object expected"); + message.params[i] = $root.google.spanner.executor.v1.QueryAction.Parameter.fromObject(object.params[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a QueryAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.executor.v1.QueryAction + * @static + * @param {google.spanner.executor.v1.QueryAction} message QueryAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.params = []; + if (options.defaults) + object.sql = ""; + if (message.sql != null && message.hasOwnProperty("sql")) + object.sql = message.sql; + if (message.params && message.params.length) { + object.params = []; + for (var j = 0; j < message.params.length; ++j) + object.params[j] = $root.google.spanner.executor.v1.QueryAction.Parameter.toObject(message.params[j], options); + } + return object; + }; + + /** + * Converts this QueryAction to JSON. + * @function toJSON + * @memberof google.spanner.executor.v1.QueryAction + * @instance + * @returns {Object.} JSON object + */ + QueryAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for QueryAction + * @function getTypeUrl + * @memberof google.spanner.executor.v1.QueryAction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + QueryAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.executor.v1.QueryAction"; + }; + + QueryAction.Parameter = (function() { + + /** + * Properties of a Parameter. + * @memberof google.spanner.executor.v1.QueryAction + * @interface IParameter + * @property {string|null} [name] Parameter name + * @property {google.spanner.v1.IType|null} [type] Parameter type + * @property {google.spanner.executor.v1.IValue|null} [value] Parameter value + */ + + /** + * Constructs a new Parameter. + * @memberof google.spanner.executor.v1.QueryAction + * @classdesc Represents a Parameter. + * @implements IParameter + * @constructor + * @param {google.spanner.executor.v1.QueryAction.IParameter=} [properties] Properties to set + */ + function Parameter(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Parameter name. + * @member {string} name + * @memberof google.spanner.executor.v1.QueryAction.Parameter + * @instance + */ + Parameter.prototype.name = ""; + + /** + * Parameter type. + * @member {google.spanner.v1.IType|null|undefined} type + * @memberof google.spanner.executor.v1.QueryAction.Parameter + * @instance + */ + Parameter.prototype.type = null; + + /** + * Parameter value. + * @member {google.spanner.executor.v1.IValue|null|undefined} value + * @memberof google.spanner.executor.v1.QueryAction.Parameter + * @instance + */ + Parameter.prototype.value = null; + + /** + * Creates a new Parameter instance using the specified properties. + * @function create + * @memberof google.spanner.executor.v1.QueryAction.Parameter + * @static + * @param {google.spanner.executor.v1.QueryAction.IParameter=} [properties] Properties to set + * @returns {google.spanner.executor.v1.QueryAction.Parameter} Parameter instance + */ + Parameter.create = function create(properties) { + return new Parameter(properties); + }; + + /** + * Encodes the specified Parameter message. Does not implicitly {@link google.spanner.executor.v1.QueryAction.Parameter.verify|verify} messages. + * @function encode + * @memberof google.spanner.executor.v1.QueryAction.Parameter + * @static + * @param {google.spanner.executor.v1.QueryAction.IParameter} message Parameter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Parameter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + $root.google.spanner.v1.Type.encode(message.type, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + $root.google.spanner.executor.v1.Value.encode(message.value, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Parameter message, length delimited. Does not implicitly {@link google.spanner.executor.v1.QueryAction.Parameter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.executor.v1.QueryAction.Parameter + * @static + * @param {google.spanner.executor.v1.QueryAction.IParameter} message Parameter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Parameter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Parameter message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.executor.v1.QueryAction.Parameter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.executor.v1.QueryAction.Parameter} Parameter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Parameter.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.QueryAction.Parameter(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.type = $root.google.spanner.v1.Type.decode(reader, reader.uint32()); + break; + } + case 3: { + message.value = $root.google.spanner.executor.v1.Value.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Parameter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.executor.v1.QueryAction.Parameter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.executor.v1.QueryAction.Parameter} Parameter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Parameter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Parameter message. + * @function verify + * @memberof google.spanner.executor.v1.QueryAction.Parameter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Parameter.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.type != null && message.hasOwnProperty("type")) { + var error = $root.google.spanner.v1.Type.verify(message.type); + if (error) + return "type." + error; + } + if (message.value != null && message.hasOwnProperty("value")) { + var error = $root.google.spanner.executor.v1.Value.verify(message.value); + if (error) + return "value." + error; + } + return null; + }; + + /** + * Creates a Parameter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.executor.v1.QueryAction.Parameter + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.executor.v1.QueryAction.Parameter} Parameter + */ + Parameter.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.executor.v1.QueryAction.Parameter) + return object; + var message = new $root.google.spanner.executor.v1.QueryAction.Parameter(); + if (object.name != null) + message.name = String(object.name); + if (object.type != null) { + if (typeof object.type !== "object") + throw TypeError(".google.spanner.executor.v1.QueryAction.Parameter.type: object expected"); + message.type = $root.google.spanner.v1.Type.fromObject(object.type); + } + if (object.value != null) { + if (typeof object.value !== "object") + throw TypeError(".google.spanner.executor.v1.QueryAction.Parameter.value: object expected"); + message.value = $root.google.spanner.executor.v1.Value.fromObject(object.value); + } + return message; + }; + + /** + * Creates a plain object from a Parameter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.executor.v1.QueryAction.Parameter + * @static + * @param {google.spanner.executor.v1.QueryAction.Parameter} message Parameter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Parameter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.type = null; + object.value = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.type != null && message.hasOwnProperty("type")) + object.type = $root.google.spanner.v1.Type.toObject(message.type, options); + if (message.value != null && message.hasOwnProperty("value")) + object.value = $root.google.spanner.executor.v1.Value.toObject(message.value, options); + return object; + }; + + /** + * Converts this Parameter to JSON. + * @function toJSON + * @memberof google.spanner.executor.v1.QueryAction.Parameter + * @instance + * @returns {Object.} JSON object + */ + Parameter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Parameter + * @function getTypeUrl + * @memberof google.spanner.executor.v1.QueryAction.Parameter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Parameter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.executor.v1.QueryAction.Parameter"; + }; + + return Parameter; + })(); + + return QueryAction; + })(); + + v1.DmlAction = (function() { + + /** + * Properties of a DmlAction. + * @memberof google.spanner.executor.v1 + * @interface IDmlAction + * @property {google.spanner.executor.v1.IQueryAction|null} [update] DmlAction update + * @property {boolean|null} [autocommitIfSupported] DmlAction autocommitIfSupported + */ + + /** + * Constructs a new DmlAction. + * @memberof google.spanner.executor.v1 + * @classdesc Represents a DmlAction. + * @implements IDmlAction + * @constructor + * @param {google.spanner.executor.v1.IDmlAction=} [properties] Properties to set + */ + function DmlAction(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DmlAction update. + * @member {google.spanner.executor.v1.IQueryAction|null|undefined} update + * @memberof google.spanner.executor.v1.DmlAction + * @instance + */ + DmlAction.prototype.update = null; + + /** + * DmlAction autocommitIfSupported. + * @member {boolean|null|undefined} autocommitIfSupported + * @memberof google.spanner.executor.v1.DmlAction + * @instance + */ + DmlAction.prototype.autocommitIfSupported = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DmlAction.prototype, "_autocommitIfSupported", { + get: $util.oneOfGetter($oneOfFields = ["autocommitIfSupported"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DmlAction instance using the specified properties. + * @function create + * @memberof google.spanner.executor.v1.DmlAction + * @static + * @param {google.spanner.executor.v1.IDmlAction=} [properties] Properties to set + * @returns {google.spanner.executor.v1.DmlAction} DmlAction instance + */ + DmlAction.create = function create(properties) { + return new DmlAction(properties); + }; + + /** + * Encodes the specified DmlAction message. Does not implicitly {@link google.spanner.executor.v1.DmlAction.verify|verify} messages. + * @function encode + * @memberof google.spanner.executor.v1.DmlAction + * @static + * @param {google.spanner.executor.v1.IDmlAction} message DmlAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DmlAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.update != null && Object.hasOwnProperty.call(message, "update")) + $root.google.spanner.executor.v1.QueryAction.encode(message.update, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.autocommitIfSupported != null && Object.hasOwnProperty.call(message, "autocommitIfSupported")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.autocommitIfSupported); + return writer; + }; + + /** + * Encodes the specified DmlAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.DmlAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.executor.v1.DmlAction + * @static + * @param {google.spanner.executor.v1.IDmlAction} message DmlAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DmlAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DmlAction message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.executor.v1.DmlAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.executor.v1.DmlAction} DmlAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DmlAction.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.DmlAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.update = $root.google.spanner.executor.v1.QueryAction.decode(reader, reader.uint32()); + break; + } + case 2: { + message.autocommitIfSupported = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DmlAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.executor.v1.DmlAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.executor.v1.DmlAction} DmlAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DmlAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DmlAction message. + * @function verify + * @memberof google.spanner.executor.v1.DmlAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DmlAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.update != null && message.hasOwnProperty("update")) { + var error = $root.google.spanner.executor.v1.QueryAction.verify(message.update); + if (error) + return "update." + error; + } + if (message.autocommitIfSupported != null && message.hasOwnProperty("autocommitIfSupported")) { + properties._autocommitIfSupported = 1; + if (typeof message.autocommitIfSupported !== "boolean") + return "autocommitIfSupported: boolean expected"; + } + return null; + }; + + /** + * Creates a DmlAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.executor.v1.DmlAction + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.executor.v1.DmlAction} DmlAction + */ + DmlAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.executor.v1.DmlAction) + return object; + var message = new $root.google.spanner.executor.v1.DmlAction(); + if (object.update != null) { + if (typeof object.update !== "object") + throw TypeError(".google.spanner.executor.v1.DmlAction.update: object expected"); + message.update = $root.google.spanner.executor.v1.QueryAction.fromObject(object.update); + } + if (object.autocommitIfSupported != null) + message.autocommitIfSupported = Boolean(object.autocommitIfSupported); + return message; + }; + + /** + * Creates a plain object from a DmlAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.executor.v1.DmlAction + * @static + * @param {google.spanner.executor.v1.DmlAction} message DmlAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DmlAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.update = null; + if (message.update != null && message.hasOwnProperty("update")) + object.update = $root.google.spanner.executor.v1.QueryAction.toObject(message.update, options); + if (message.autocommitIfSupported != null && message.hasOwnProperty("autocommitIfSupported")) { + object.autocommitIfSupported = message.autocommitIfSupported; + if (options.oneofs) + object._autocommitIfSupported = "autocommitIfSupported"; + } + return object; + }; + + /** + * Converts this DmlAction to JSON. + * @function toJSON + * @memberof google.spanner.executor.v1.DmlAction + * @instance + * @returns {Object.} JSON object + */ + DmlAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DmlAction + * @function getTypeUrl + * @memberof google.spanner.executor.v1.DmlAction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DmlAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.executor.v1.DmlAction"; + }; + + return DmlAction; + })(); + + v1.BatchDmlAction = (function() { + + /** + * Properties of a BatchDmlAction. + * @memberof google.spanner.executor.v1 + * @interface IBatchDmlAction + * @property {Array.|null} [updates] BatchDmlAction updates + */ + + /** + * Constructs a new BatchDmlAction. + * @memberof google.spanner.executor.v1 + * @classdesc Represents a BatchDmlAction. + * @implements IBatchDmlAction + * @constructor + * @param {google.spanner.executor.v1.IBatchDmlAction=} [properties] Properties to set + */ + function BatchDmlAction(properties) { + this.updates = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchDmlAction updates. + * @member {Array.} updates + * @memberof google.spanner.executor.v1.BatchDmlAction + * @instance + */ + BatchDmlAction.prototype.updates = $util.emptyArray; + + /** + * Creates a new BatchDmlAction instance using the specified properties. + * @function create + * @memberof google.spanner.executor.v1.BatchDmlAction + * @static + * @param {google.spanner.executor.v1.IBatchDmlAction=} [properties] Properties to set + * @returns {google.spanner.executor.v1.BatchDmlAction} BatchDmlAction instance + */ + BatchDmlAction.create = function create(properties) { + return new BatchDmlAction(properties); + }; + + /** + * Encodes the specified BatchDmlAction message. Does not implicitly {@link google.spanner.executor.v1.BatchDmlAction.verify|verify} messages. + * @function encode + * @memberof google.spanner.executor.v1.BatchDmlAction + * @static + * @param {google.spanner.executor.v1.IBatchDmlAction} message BatchDmlAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchDmlAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updates != null && message.updates.length) + for (var i = 0; i < message.updates.length; ++i) + $root.google.spanner.executor.v1.QueryAction.encode(message.updates[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchDmlAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.BatchDmlAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.executor.v1.BatchDmlAction + * @static + * @param {google.spanner.executor.v1.IBatchDmlAction} message BatchDmlAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchDmlAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchDmlAction message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.executor.v1.BatchDmlAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.executor.v1.BatchDmlAction} BatchDmlAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchDmlAction.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.BatchDmlAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.updates && message.updates.length)) + message.updates = []; + message.updates.push($root.google.spanner.executor.v1.QueryAction.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchDmlAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.executor.v1.BatchDmlAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.executor.v1.BatchDmlAction} BatchDmlAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchDmlAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchDmlAction message. + * @function verify + * @memberof google.spanner.executor.v1.BatchDmlAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchDmlAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.updates != null && message.hasOwnProperty("updates")) { + if (!Array.isArray(message.updates)) + return "updates: array expected"; + for (var i = 0; i < message.updates.length; ++i) { + var error = $root.google.spanner.executor.v1.QueryAction.verify(message.updates[i]); + if (error) + return "updates." + error; + } + } + return null; + }; + + /** + * Creates a BatchDmlAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.executor.v1.BatchDmlAction + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.executor.v1.BatchDmlAction} BatchDmlAction + */ + BatchDmlAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.executor.v1.BatchDmlAction) + return object; + var message = new $root.google.spanner.executor.v1.BatchDmlAction(); + if (object.updates) { + if (!Array.isArray(object.updates)) + throw TypeError(".google.spanner.executor.v1.BatchDmlAction.updates: array expected"); + message.updates = []; + for (var i = 0; i < object.updates.length; ++i) { + if (typeof object.updates[i] !== "object") + throw TypeError(".google.spanner.executor.v1.BatchDmlAction.updates: object expected"); + message.updates[i] = $root.google.spanner.executor.v1.QueryAction.fromObject(object.updates[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BatchDmlAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.executor.v1.BatchDmlAction + * @static + * @param {google.spanner.executor.v1.BatchDmlAction} message BatchDmlAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchDmlAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.updates = []; + if (message.updates && message.updates.length) { + object.updates = []; + for (var j = 0; j < message.updates.length; ++j) + object.updates[j] = $root.google.spanner.executor.v1.QueryAction.toObject(message.updates[j], options); + } + return object; + }; + + /** + * Converts this BatchDmlAction to JSON. + * @function toJSON + * @memberof google.spanner.executor.v1.BatchDmlAction + * @instance + * @returns {Object.} JSON object + */ + BatchDmlAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchDmlAction + * @function getTypeUrl + * @memberof google.spanner.executor.v1.BatchDmlAction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchDmlAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.executor.v1.BatchDmlAction"; + }; + + return BatchDmlAction; + })(); + + v1.Value = (function() { + + /** + * Properties of a Value. + * @memberof google.spanner.executor.v1 + * @interface IValue + * @property {boolean|null} [isNull] Value isNull + * @property {number|Long|null} [intValue] Value intValue + * @property {boolean|null} [boolValue] Value boolValue + * @property {number|null} [doubleValue] Value doubleValue + * @property {Uint8Array|null} [bytesValue] Value bytesValue + * @property {string|null} [stringValue] Value stringValue + * @property {google.spanner.executor.v1.IValueList|null} [structValue] Value structValue + * @property {google.protobuf.ITimestamp|null} [timestampValue] Value timestampValue + * @property {number|null} [dateDaysValue] Value dateDaysValue + * @property {boolean|null} [isCommitTimestamp] Value isCommitTimestamp + * @property {google.spanner.executor.v1.IValueList|null} [arrayValue] Value arrayValue + * @property {google.spanner.v1.IType|null} [arrayType] Value arrayType + */ + + /** + * Constructs a new Value. + * @memberof google.spanner.executor.v1 + * @classdesc Represents a Value. + * @implements IValue + * @constructor + * @param {google.spanner.executor.v1.IValue=} [properties] Properties to set + */ + function Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Value isNull. + * @member {boolean|null|undefined} isNull + * @memberof google.spanner.executor.v1.Value + * @instance + */ + Value.prototype.isNull = null; + + /** + * Value intValue. + * @member {number|Long|null|undefined} intValue + * @memberof google.spanner.executor.v1.Value + * @instance + */ + Value.prototype.intValue = null; + + /** + * Value boolValue. + * @member {boolean|null|undefined} boolValue + * @memberof google.spanner.executor.v1.Value + * @instance + */ + Value.prototype.boolValue = null; + + /** + * Value doubleValue. + * @member {number|null|undefined} doubleValue + * @memberof google.spanner.executor.v1.Value + * @instance + */ + Value.prototype.doubleValue = null; + + /** + * Value bytesValue. + * @member {Uint8Array|null|undefined} bytesValue + * @memberof google.spanner.executor.v1.Value + * @instance + */ + Value.prototype.bytesValue = null; + + /** + * Value stringValue. + * @member {string|null|undefined} stringValue + * @memberof google.spanner.executor.v1.Value + * @instance + */ + Value.prototype.stringValue = null; + + /** + * Value structValue. + * @member {google.spanner.executor.v1.IValueList|null|undefined} structValue + * @memberof google.spanner.executor.v1.Value + * @instance + */ + Value.prototype.structValue = null; + + /** + * Value timestampValue. + * @member {google.protobuf.ITimestamp|null|undefined} timestampValue + * @memberof google.spanner.executor.v1.Value + * @instance + */ + Value.prototype.timestampValue = null; + + /** + * Value dateDaysValue. + * @member {number|null|undefined} dateDaysValue + * @memberof google.spanner.executor.v1.Value + * @instance + */ + Value.prototype.dateDaysValue = null; + + /** + * Value isCommitTimestamp. + * @member {boolean|null|undefined} isCommitTimestamp + * @memberof google.spanner.executor.v1.Value + * @instance + */ + Value.prototype.isCommitTimestamp = null; + + /** + * Value arrayValue. + * @member {google.spanner.executor.v1.IValueList|null|undefined} arrayValue + * @memberof google.spanner.executor.v1.Value + * @instance + */ + Value.prototype.arrayValue = null; + + /** + * Value arrayType. + * @member {google.spanner.v1.IType|null|undefined} arrayType + * @memberof google.spanner.executor.v1.Value + * @instance + */ + Value.prototype.arrayType = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Value valueType. + * @member {"isNull"|"intValue"|"boolValue"|"doubleValue"|"bytesValue"|"stringValue"|"structValue"|"timestampValue"|"dateDaysValue"|"isCommitTimestamp"|"arrayValue"|undefined} valueType + * @memberof google.spanner.executor.v1.Value + * @instance + */ + Object.defineProperty(Value.prototype, "valueType", { + get: $util.oneOfGetter($oneOfFields = ["isNull", "intValue", "boolValue", "doubleValue", "bytesValue", "stringValue", "structValue", "timestampValue", "dateDaysValue", "isCommitTimestamp", "arrayValue"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Value.prototype, "_arrayType", { + get: $util.oneOfGetter($oneOfFields = ["arrayType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Value instance using the specified properties. + * @function create + * @memberof google.spanner.executor.v1.Value + * @static + * @param {google.spanner.executor.v1.IValue=} [properties] Properties to set + * @returns {google.spanner.executor.v1.Value} Value instance + */ + Value.create = function create(properties) { + return new Value(properties); + }; + + /** + * Encodes the specified Value message. Does not implicitly {@link google.spanner.executor.v1.Value.verify|verify} messages. + * @function encode + * @memberof google.spanner.executor.v1.Value + * @static + * @param {google.spanner.executor.v1.IValue} message Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.isNull != null && Object.hasOwnProperty.call(message, "isNull")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.isNull); + if (message.intValue != null && Object.hasOwnProperty.call(message, "intValue")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.intValue); + if (message.boolValue != null && Object.hasOwnProperty.call(message, "boolValue")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.boolValue); + if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) + writer.uint32(/* id 4, wireType 1 =*/33).double(message.doubleValue); + if (message.bytesValue != null && Object.hasOwnProperty.call(message, "bytesValue")) + writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.bytesValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.stringValue); + if (message.structValue != null && Object.hasOwnProperty.call(message, "structValue")) + $root.google.spanner.executor.v1.ValueList.encode(message.structValue, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.timestampValue != null && Object.hasOwnProperty.call(message, "timestampValue")) + $root.google.protobuf.Timestamp.encode(message.timestampValue, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.dateDaysValue != null && Object.hasOwnProperty.call(message, "dateDaysValue")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.dateDaysValue); + if (message.isCommitTimestamp != null && Object.hasOwnProperty.call(message, "isCommitTimestamp")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.isCommitTimestamp); + if (message.arrayValue != null && Object.hasOwnProperty.call(message, "arrayValue")) + $root.google.spanner.executor.v1.ValueList.encode(message.arrayValue, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.arrayType != null && Object.hasOwnProperty.call(message, "arrayType")) + $root.google.spanner.v1.Type.encode(message.arrayType, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Value message, length delimited. Does not implicitly {@link google.spanner.executor.v1.Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.executor.v1.Value + * @static + * @param {google.spanner.executor.v1.IValue} message Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Value message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.executor.v1.Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.executor.v1.Value} Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Value.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.isNull = reader.bool(); + break; + } + case 2: { + message.intValue = reader.int64(); + break; + } + case 3: { + message.boolValue = reader.bool(); + break; + } + case 4: { + message.doubleValue = reader.double(); + break; + } + case 5: { + message.bytesValue = reader.bytes(); + break; + } + case 6: { + message.stringValue = reader.string(); + break; + } + case 7: { + message.structValue = $root.google.spanner.executor.v1.ValueList.decode(reader, reader.uint32()); + break; + } + case 8: { + message.timestampValue = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 9: { + message.dateDaysValue = reader.int32(); + break; + } + case 10: { + message.isCommitTimestamp = reader.bool(); + break; + } + case 11: { + message.arrayValue = $root.google.spanner.executor.v1.ValueList.decode(reader, reader.uint32()); + break; + } + case 12: { + message.arrayType = $root.google.spanner.v1.Type.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.executor.v1.Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.executor.v1.Value} Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Value message. + * @function verify + * @memberof google.spanner.executor.v1.Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.isNull != null && message.hasOwnProperty("isNull")) { + properties.valueType = 1; + if (typeof message.isNull !== "boolean") + return "isNull: boolean expected"; + } + if (message.intValue != null && message.hasOwnProperty("intValue")) { + if (properties.valueType === 1) + return "valueType: multiple values"; + properties.valueType = 1; + if (!$util.isInteger(message.intValue) && !(message.intValue && $util.isInteger(message.intValue.low) && $util.isInteger(message.intValue.high))) + return "intValue: integer|Long expected"; + } + if (message.boolValue != null && message.hasOwnProperty("boolValue")) { + if (properties.valueType === 1) + return "valueType: multiple values"; + properties.valueType = 1; + if (typeof message.boolValue !== "boolean") + return "boolValue: boolean expected"; + } + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) { + if (properties.valueType === 1) + return "valueType: multiple values"; + properties.valueType = 1; + if (typeof message.doubleValue !== "number") + return "doubleValue: number expected"; + } + if (message.bytesValue != null && message.hasOwnProperty("bytesValue")) { + if (properties.valueType === 1) + return "valueType: multiple values"; + properties.valueType = 1; + if (!(message.bytesValue && typeof message.bytesValue.length === "number" || $util.isString(message.bytesValue))) + return "bytesValue: buffer expected"; + } + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + if (properties.valueType === 1) + return "valueType: multiple values"; + properties.valueType = 1; + if (!$util.isString(message.stringValue)) + return "stringValue: string expected"; + } + if (message.structValue != null && message.hasOwnProperty("structValue")) { + if (properties.valueType === 1) + return "valueType: multiple values"; + properties.valueType = 1; + { + var error = $root.google.spanner.executor.v1.ValueList.verify(message.structValue); + if (error) + return "structValue." + error; + } + } + if (message.timestampValue != null && message.hasOwnProperty("timestampValue")) { + if (properties.valueType === 1) + return "valueType: multiple values"; + properties.valueType = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.timestampValue); + if (error) + return "timestampValue." + error; + } + } + if (message.dateDaysValue != null && message.hasOwnProperty("dateDaysValue")) { + if (properties.valueType === 1) + return "valueType: multiple values"; + properties.valueType = 1; + if (!$util.isInteger(message.dateDaysValue)) + return "dateDaysValue: integer expected"; + } + if (message.isCommitTimestamp != null && message.hasOwnProperty("isCommitTimestamp")) { + if (properties.valueType === 1) + return "valueType: multiple values"; + properties.valueType = 1; + if (typeof message.isCommitTimestamp !== "boolean") + return "isCommitTimestamp: boolean expected"; + } + if (message.arrayValue != null && message.hasOwnProperty("arrayValue")) { + if (properties.valueType === 1) + return "valueType: multiple values"; + properties.valueType = 1; + { + var error = $root.google.spanner.executor.v1.ValueList.verify(message.arrayValue); + if (error) + return "arrayValue." + error; + } + } + if (message.arrayType != null && message.hasOwnProperty("arrayType")) { + properties._arrayType = 1; + { + var error = $root.google.spanner.v1.Type.verify(message.arrayType); + if (error) + return "arrayType." + error; + } + } + return null; + }; + + /** + * Creates a Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.executor.v1.Value + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.executor.v1.Value} Value + */ + Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.executor.v1.Value) + return object; + var message = new $root.google.spanner.executor.v1.Value(); + if (object.isNull != null) + message.isNull = Boolean(object.isNull); + if (object.intValue != null) + if ($util.Long) + (message.intValue = $util.Long.fromValue(object.intValue)).unsigned = false; + else if (typeof object.intValue === "string") + message.intValue = parseInt(object.intValue, 10); + else if (typeof object.intValue === "number") + message.intValue = object.intValue; + else if (typeof object.intValue === "object") + message.intValue = new $util.LongBits(object.intValue.low >>> 0, object.intValue.high >>> 0).toNumber(); + if (object.boolValue != null) + message.boolValue = Boolean(object.boolValue); + if (object.doubleValue != null) + message.doubleValue = Number(object.doubleValue); + if (object.bytesValue != null) + if (typeof object.bytesValue === "string") + $util.base64.decode(object.bytesValue, message.bytesValue = $util.newBuffer($util.base64.length(object.bytesValue)), 0); + else if (object.bytesValue.length >= 0) + message.bytesValue = object.bytesValue; + if (object.stringValue != null) + message.stringValue = String(object.stringValue); + if (object.structValue != null) { + if (typeof object.structValue !== "object") + throw TypeError(".google.spanner.executor.v1.Value.structValue: object expected"); + message.structValue = $root.google.spanner.executor.v1.ValueList.fromObject(object.structValue); + } + if (object.timestampValue != null) { + if (typeof object.timestampValue !== "object") + throw TypeError(".google.spanner.executor.v1.Value.timestampValue: object expected"); + message.timestampValue = $root.google.protobuf.Timestamp.fromObject(object.timestampValue); + } + if (object.dateDaysValue != null) + message.dateDaysValue = object.dateDaysValue | 0; + if (object.isCommitTimestamp != null) + message.isCommitTimestamp = Boolean(object.isCommitTimestamp); + if (object.arrayValue != null) { + if (typeof object.arrayValue !== "object") + throw TypeError(".google.spanner.executor.v1.Value.arrayValue: object expected"); + message.arrayValue = $root.google.spanner.executor.v1.ValueList.fromObject(object.arrayValue); + } + if (object.arrayType != null) { + if (typeof object.arrayType !== "object") + throw TypeError(".google.spanner.executor.v1.Value.arrayType: object expected"); + message.arrayType = $root.google.spanner.v1.Type.fromObject(object.arrayType); + } + return message; + }; + + /** + * Creates a plain object from a Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.executor.v1.Value + * @static + * @param {google.spanner.executor.v1.Value} message Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.isNull != null && message.hasOwnProperty("isNull")) { + object.isNull = message.isNull; + if (options.oneofs) + object.valueType = "isNull"; + } + if (message.intValue != null && message.hasOwnProperty("intValue")) { + if (typeof message.intValue === "number") + object.intValue = options.longs === String ? String(message.intValue) : message.intValue; + else + object.intValue = options.longs === String ? $util.Long.prototype.toString.call(message.intValue) : options.longs === Number ? new $util.LongBits(message.intValue.low >>> 0, message.intValue.high >>> 0).toNumber() : message.intValue; + if (options.oneofs) + object.valueType = "intValue"; + } + if (message.boolValue != null && message.hasOwnProperty("boolValue")) { + object.boolValue = message.boolValue; + if (options.oneofs) + object.valueType = "boolValue"; + } + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) { + object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; + if (options.oneofs) + object.valueType = "doubleValue"; + } + if (message.bytesValue != null && message.hasOwnProperty("bytesValue")) { + object.bytesValue = options.bytes === String ? $util.base64.encode(message.bytesValue, 0, message.bytesValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.bytesValue) : message.bytesValue; + if (options.oneofs) + object.valueType = "bytesValue"; + } + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + object.stringValue = message.stringValue; + if (options.oneofs) + object.valueType = "stringValue"; + } + if (message.structValue != null && message.hasOwnProperty("structValue")) { + object.structValue = $root.google.spanner.executor.v1.ValueList.toObject(message.structValue, options); + if (options.oneofs) + object.valueType = "structValue"; + } + if (message.timestampValue != null && message.hasOwnProperty("timestampValue")) { + object.timestampValue = $root.google.protobuf.Timestamp.toObject(message.timestampValue, options); + if (options.oneofs) + object.valueType = "timestampValue"; + } + if (message.dateDaysValue != null && message.hasOwnProperty("dateDaysValue")) { + object.dateDaysValue = message.dateDaysValue; + if (options.oneofs) + object.valueType = "dateDaysValue"; + } + if (message.isCommitTimestamp != null && message.hasOwnProperty("isCommitTimestamp")) { + object.isCommitTimestamp = message.isCommitTimestamp; + if (options.oneofs) + object.valueType = "isCommitTimestamp"; + } + if (message.arrayValue != null && message.hasOwnProperty("arrayValue")) { + object.arrayValue = $root.google.spanner.executor.v1.ValueList.toObject(message.arrayValue, options); + if (options.oneofs) + object.valueType = "arrayValue"; + } + if (message.arrayType != null && message.hasOwnProperty("arrayType")) { + object.arrayType = $root.google.spanner.v1.Type.toObject(message.arrayType, options); + if (options.oneofs) + object._arrayType = "arrayType"; + } + return object; + }; + + /** + * Converts this Value to JSON. + * @function toJSON + * @memberof google.spanner.executor.v1.Value + * @instance + * @returns {Object.} JSON object + */ + Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Value + * @function getTypeUrl + * @memberof google.spanner.executor.v1.Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.executor.v1.Value"; + }; + + return Value; + })(); + + v1.KeyRange = (function() { + + /** + * Properties of a KeyRange. + * @memberof google.spanner.executor.v1 + * @interface IKeyRange + * @property {google.spanner.executor.v1.IValueList|null} [start] KeyRange start + * @property {google.spanner.executor.v1.IValueList|null} [limit] KeyRange limit + * @property {google.spanner.executor.v1.KeyRange.Type|null} [type] KeyRange type + */ + + /** + * Constructs a new KeyRange. + * @memberof google.spanner.executor.v1 + * @classdesc Represents a KeyRange. + * @implements IKeyRange + * @constructor + * @param {google.spanner.executor.v1.IKeyRange=} [properties] Properties to set + */ + function KeyRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * KeyRange start. + * @member {google.spanner.executor.v1.IValueList|null|undefined} start + * @memberof google.spanner.executor.v1.KeyRange + * @instance + */ + KeyRange.prototype.start = null; + + /** + * KeyRange limit. + * @member {google.spanner.executor.v1.IValueList|null|undefined} limit + * @memberof google.spanner.executor.v1.KeyRange + * @instance + */ + KeyRange.prototype.limit = null; + + /** + * KeyRange type. + * @member {google.spanner.executor.v1.KeyRange.Type|null|undefined} type + * @memberof google.spanner.executor.v1.KeyRange + * @instance + */ + KeyRange.prototype.type = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(KeyRange.prototype, "_type", { + get: $util.oneOfGetter($oneOfFields = ["type"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new KeyRange instance using the specified properties. + * @function create + * @memberof google.spanner.executor.v1.KeyRange + * @static + * @param {google.spanner.executor.v1.IKeyRange=} [properties] Properties to set + * @returns {google.spanner.executor.v1.KeyRange} KeyRange instance + */ + KeyRange.create = function create(properties) { + return new KeyRange(properties); + }; + + /** + * Encodes the specified KeyRange message. Does not implicitly {@link google.spanner.executor.v1.KeyRange.verify|verify} messages. + * @function encode + * @memberof google.spanner.executor.v1.KeyRange + * @static + * @param {google.spanner.executor.v1.IKeyRange} message KeyRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + $root.google.spanner.executor.v1.ValueList.encode(message.start, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) + $root.google.spanner.executor.v1.ValueList.encode(message.limit, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.type); + return writer; + }; + + /** + * Encodes the specified KeyRange message, length delimited. Does not implicitly {@link google.spanner.executor.v1.KeyRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.executor.v1.KeyRange + * @static + * @param {google.spanner.executor.v1.IKeyRange} message KeyRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a KeyRange message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.executor.v1.KeyRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.executor.v1.KeyRange} KeyRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyRange.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.KeyRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.start = $root.google.spanner.executor.v1.ValueList.decode(reader, reader.uint32()); + break; + } + case 2: { + message.limit = $root.google.spanner.executor.v1.ValueList.decode(reader, reader.uint32()); + break; + } + case 3: { + message.type = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a KeyRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.executor.v1.KeyRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.executor.v1.KeyRange} KeyRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a KeyRange message. + * @function verify + * @memberof google.spanner.executor.v1.KeyRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + KeyRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.start != null && message.hasOwnProperty("start")) { + var error = $root.google.spanner.executor.v1.ValueList.verify(message.start); + if (error) + return "start." + error; + } + if (message.limit != null && message.hasOwnProperty("limit")) { + var error = $root.google.spanner.executor.v1.ValueList.verify(message.limit); + if (error) + return "limit." + error; + } + if (message.type != null && message.hasOwnProperty("type")) { + properties._type = 1; + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + } + return null; + }; + + /** + * Creates a KeyRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.executor.v1.KeyRange + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.executor.v1.KeyRange} KeyRange + */ + KeyRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.executor.v1.KeyRange) + return object; + var message = new $root.google.spanner.executor.v1.KeyRange(); + if (object.start != null) { + if (typeof object.start !== "object") + throw TypeError(".google.spanner.executor.v1.KeyRange.start: object expected"); + message.start = $root.google.spanner.executor.v1.ValueList.fromObject(object.start); + } + if (object.limit != null) { + if (typeof object.limit !== "object") + throw TypeError(".google.spanner.executor.v1.KeyRange.limit: object expected"); + message.limit = $root.google.spanner.executor.v1.ValueList.fromObject(object.limit); + } + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "CLOSED_CLOSED": + case 1: + message.type = 1; + break; + case "CLOSED_OPEN": + case 2: + message.type = 2; + break; + case "OPEN_CLOSED": + case 3: + message.type = 3; + break; + case "OPEN_OPEN": + case 4: + message.type = 4; + break; + } + return message; + }; + + /** + * Creates a plain object from a KeyRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.executor.v1.KeyRange + * @static + * @param {google.spanner.executor.v1.KeyRange} message KeyRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + KeyRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = null; + object.limit = null; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = $root.google.spanner.executor.v1.ValueList.toObject(message.start, options); + if (message.limit != null && message.hasOwnProperty("limit")) + object.limit = $root.google.spanner.executor.v1.ValueList.toObject(message.limit, options); + if (message.type != null && message.hasOwnProperty("type")) { + object.type = options.enums === String ? $root.google.spanner.executor.v1.KeyRange.Type[message.type] === undefined ? message.type : $root.google.spanner.executor.v1.KeyRange.Type[message.type] : message.type; + if (options.oneofs) + object._type = "type"; + } + return object; + }; + + /** + * Converts this KeyRange to JSON. + * @function toJSON + * @memberof google.spanner.executor.v1.KeyRange + * @instance + * @returns {Object.} JSON object + */ + KeyRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for KeyRange + * @function getTypeUrl + * @memberof google.spanner.executor.v1.KeyRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + KeyRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.executor.v1.KeyRange"; + }; + + /** + * Type enum. + * @name google.spanner.executor.v1.KeyRange.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} CLOSED_CLOSED=1 CLOSED_CLOSED value + * @property {number} CLOSED_OPEN=2 CLOSED_OPEN value + * @property {number} OPEN_CLOSED=3 OPEN_CLOSED value + * @property {number} OPEN_OPEN=4 OPEN_OPEN value + */ + KeyRange.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CLOSED_CLOSED"] = 1; + values[valuesById[2] = "CLOSED_OPEN"] = 2; + values[valuesById[3] = "OPEN_CLOSED"] = 3; + values[valuesById[4] = "OPEN_OPEN"] = 4; + return values; + })(); + + return KeyRange; + })(); + + v1.KeySet = (function() { + + /** + * Properties of a KeySet. + * @memberof google.spanner.executor.v1 + * @interface IKeySet + * @property {Array.|null} [point] KeySet point + * @property {Array.|null} [range] KeySet range + * @property {boolean|null} [all] KeySet all + */ + + /** + * Constructs a new KeySet. + * @memberof google.spanner.executor.v1 + * @classdesc Represents a KeySet. + * @implements IKeySet + * @constructor + * @param {google.spanner.executor.v1.IKeySet=} [properties] Properties to set + */ + function KeySet(properties) { + this.point = []; + this.range = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * KeySet point. + * @member {Array.} point + * @memberof google.spanner.executor.v1.KeySet + * @instance + */ + KeySet.prototype.point = $util.emptyArray; + + /** + * KeySet range. + * @member {Array.} range + * @memberof google.spanner.executor.v1.KeySet + * @instance + */ + KeySet.prototype.range = $util.emptyArray; + + /** + * KeySet all. + * @member {boolean} all + * @memberof google.spanner.executor.v1.KeySet + * @instance + */ + KeySet.prototype.all = false; + + /** + * Creates a new KeySet instance using the specified properties. + * @function create + * @memberof google.spanner.executor.v1.KeySet + * @static + * @param {google.spanner.executor.v1.IKeySet=} [properties] Properties to set + * @returns {google.spanner.executor.v1.KeySet} KeySet instance + */ + KeySet.create = function create(properties) { + return new KeySet(properties); + }; + + /** + * Encodes the specified KeySet message. Does not implicitly {@link google.spanner.executor.v1.KeySet.verify|verify} messages. + * @function encode + * @memberof google.spanner.executor.v1.KeySet + * @static + * @param {google.spanner.executor.v1.IKeySet} message KeySet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeySet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.point != null && message.point.length) + for (var i = 0; i < message.point.length; ++i) + $root.google.spanner.executor.v1.ValueList.encode(message.point[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.range != null && message.range.length) + for (var i = 0; i < message.range.length; ++i) + $root.google.spanner.executor.v1.KeyRange.encode(message.range[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.all != null && Object.hasOwnProperty.call(message, "all")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.all); + return writer; + }; + + /** + * Encodes the specified KeySet message, length delimited. Does not implicitly {@link google.spanner.executor.v1.KeySet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.executor.v1.KeySet + * @static + * @param {google.spanner.executor.v1.IKeySet} message KeySet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeySet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a KeySet message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.executor.v1.KeySet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.executor.v1.KeySet} KeySet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeySet.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.KeySet(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.point && message.point.length)) + message.point = []; + message.point.push($root.google.spanner.executor.v1.ValueList.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.range && message.range.length)) + message.range = []; + message.range.push($root.google.spanner.executor.v1.KeyRange.decode(reader, reader.uint32())); + break; + } + case 3: { + message.all = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a KeySet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.executor.v1.KeySet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.executor.v1.KeySet} KeySet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeySet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a KeySet message. + * @function verify + * @memberof google.spanner.executor.v1.KeySet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + KeySet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.point != null && message.hasOwnProperty("point")) { + if (!Array.isArray(message.point)) + return "point: array expected"; + for (var i = 0; i < message.point.length; ++i) { + var error = $root.google.spanner.executor.v1.ValueList.verify(message.point[i]); + if (error) + return "point." + error; + } + } + if (message.range != null && message.hasOwnProperty("range")) { + if (!Array.isArray(message.range)) + return "range: array expected"; + for (var i = 0; i < message.range.length; ++i) { + var error = $root.google.spanner.executor.v1.KeyRange.verify(message.range[i]); + if (error) + return "range." + error; + } + } + if (message.all != null && message.hasOwnProperty("all")) + if (typeof message.all !== "boolean") + return "all: boolean expected"; + return null; + }; + + /** + * Creates a KeySet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.executor.v1.KeySet + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.executor.v1.KeySet} KeySet + */ + KeySet.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.executor.v1.KeySet) + return object; + var message = new $root.google.spanner.executor.v1.KeySet(); + if (object.point) { + if (!Array.isArray(object.point)) + throw TypeError(".google.spanner.executor.v1.KeySet.point: array expected"); + message.point = []; + for (var i = 0; i < object.point.length; ++i) { + if (typeof object.point[i] !== "object") + throw TypeError(".google.spanner.executor.v1.KeySet.point: object expected"); + message.point[i] = $root.google.spanner.executor.v1.ValueList.fromObject(object.point[i]); + } + } + if (object.range) { + if (!Array.isArray(object.range)) + throw TypeError(".google.spanner.executor.v1.KeySet.range: array expected"); + message.range = []; + for (var i = 0; i < object.range.length; ++i) { + if (typeof object.range[i] !== "object") + throw TypeError(".google.spanner.executor.v1.KeySet.range: object expected"); + message.range[i] = $root.google.spanner.executor.v1.KeyRange.fromObject(object.range[i]); + } + } + if (object.all != null) + message.all = Boolean(object.all); + return message; + }; + + /** + * Creates a plain object from a KeySet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.executor.v1.KeySet + * @static + * @param {google.spanner.executor.v1.KeySet} message KeySet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + KeySet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.point = []; + object.range = []; + } + if (options.defaults) + object.all = false; + if (message.point && message.point.length) { + object.point = []; + for (var j = 0; j < message.point.length; ++j) + object.point[j] = $root.google.spanner.executor.v1.ValueList.toObject(message.point[j], options); + } + if (message.range && message.range.length) { + object.range = []; + for (var j = 0; j < message.range.length; ++j) + object.range[j] = $root.google.spanner.executor.v1.KeyRange.toObject(message.range[j], options); + } + if (message.all != null && message.hasOwnProperty("all")) + object.all = message.all; + return object; + }; + + /** + * Converts this KeySet to JSON. + * @function toJSON + * @memberof google.spanner.executor.v1.KeySet + * @instance + * @returns {Object.} JSON object + */ + KeySet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for KeySet + * @function getTypeUrl + * @memberof google.spanner.executor.v1.KeySet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + KeySet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.executor.v1.KeySet"; + }; + + return KeySet; + })(); + + v1.ValueList = (function() { + + /** + * Properties of a ValueList. + * @memberof google.spanner.executor.v1 + * @interface IValueList + * @property {Array.|null} [value] ValueList value + */ + + /** + * Constructs a new ValueList. + * @memberof google.spanner.executor.v1 + * @classdesc Represents a ValueList. + * @implements IValueList + * @constructor + * @param {google.spanner.executor.v1.IValueList=} [properties] Properties to set + */ + function ValueList(properties) { + this.value = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ValueList value. + * @member {Array.} value + * @memberof google.spanner.executor.v1.ValueList + * @instance + */ + ValueList.prototype.value = $util.emptyArray; + + /** + * Creates a new ValueList instance using the specified properties. + * @function create + * @memberof google.spanner.executor.v1.ValueList + * @static + * @param {google.spanner.executor.v1.IValueList=} [properties] Properties to set + * @returns {google.spanner.executor.v1.ValueList} ValueList instance + */ + ValueList.create = function create(properties) { + return new ValueList(properties); + }; + + /** + * Encodes the specified ValueList message. Does not implicitly {@link google.spanner.executor.v1.ValueList.verify|verify} messages. + * @function encode + * @memberof google.spanner.executor.v1.ValueList + * @static + * @param {google.spanner.executor.v1.IValueList} message ValueList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValueList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && message.value.length) + for (var i = 0; i < message.value.length; ++i) + $root.google.spanner.executor.v1.Value.encode(message.value[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ValueList message, length delimited. Does not implicitly {@link google.spanner.executor.v1.ValueList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.executor.v1.ValueList + * @static + * @param {google.spanner.executor.v1.IValueList} message ValueList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValueList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ValueList message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.executor.v1.ValueList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.executor.v1.ValueList} ValueList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValueList.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.ValueList(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.value && message.value.length)) + message.value = []; + message.value.push($root.google.spanner.executor.v1.Value.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ValueList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.executor.v1.ValueList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.executor.v1.ValueList} ValueList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValueList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ValueList message. + * @function verify + * @memberof google.spanner.executor.v1.ValueList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ValueList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) { + if (!Array.isArray(message.value)) + return "value: array expected"; + for (var i = 0; i < message.value.length; ++i) { + var error = $root.google.spanner.executor.v1.Value.verify(message.value[i]); + if (error) + return "value." + error; + } + } + return null; + }; + + /** + * Creates a ValueList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.executor.v1.ValueList + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.executor.v1.ValueList} ValueList + */ + ValueList.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.executor.v1.ValueList) + return object; + var message = new $root.google.spanner.executor.v1.ValueList(); + if (object.value) { + if (!Array.isArray(object.value)) + throw TypeError(".google.spanner.executor.v1.ValueList.value: array expected"); + message.value = []; + for (var i = 0; i < object.value.length; ++i) { + if (typeof object.value[i] !== "object") + throw TypeError(".google.spanner.executor.v1.ValueList.value: object expected"); + message.value[i] = $root.google.spanner.executor.v1.Value.fromObject(object.value[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ValueList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.executor.v1.ValueList + * @static + * @param {google.spanner.executor.v1.ValueList} message ValueList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ValueList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.value = []; + if (message.value && message.value.length) { + object.value = []; + for (var j = 0; j < message.value.length; ++j) + object.value[j] = $root.google.spanner.executor.v1.Value.toObject(message.value[j], options); + } + return object; + }; + + /** + * Converts this ValueList to JSON. + * @function toJSON + * @memberof google.spanner.executor.v1.ValueList + * @instance + * @returns {Object.} JSON object + */ + ValueList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ValueList + * @function getTypeUrl + * @memberof google.spanner.executor.v1.ValueList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ValueList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.executor.v1.ValueList"; + }; + + return ValueList; + })(); + + v1.MutationAction = (function() { + + /** + * Properties of a MutationAction. + * @memberof google.spanner.executor.v1 + * @interface IMutationAction + * @property {Array.|null} [mod] MutationAction mod + */ + + /** + * Constructs a new MutationAction. + * @memberof google.spanner.executor.v1 + * @classdesc Represents a MutationAction. + * @implements IMutationAction + * @constructor + * @param {google.spanner.executor.v1.IMutationAction=} [properties] Properties to set + */ + function MutationAction(properties) { + this.mod = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MutationAction mod. + * @member {Array.} mod + * @memberof google.spanner.executor.v1.MutationAction + * @instance + */ + MutationAction.prototype.mod = $util.emptyArray; + + /** + * Creates a new MutationAction instance using the specified properties. + * @function create + * @memberof google.spanner.executor.v1.MutationAction + * @static + * @param {google.spanner.executor.v1.IMutationAction=} [properties] Properties to set + * @returns {google.spanner.executor.v1.MutationAction} MutationAction instance + */ + MutationAction.create = function create(properties) { + return new MutationAction(properties); + }; + + /** + * Encodes the specified MutationAction message. Does not implicitly {@link google.spanner.executor.v1.MutationAction.verify|verify} messages. + * @function encode + * @memberof google.spanner.executor.v1.MutationAction + * @static + * @param {google.spanner.executor.v1.IMutationAction} message MutationAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MutationAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mod != null && message.mod.length) + for (var i = 0; i < message.mod.length; ++i) + $root.google.spanner.executor.v1.MutationAction.Mod.encode(message.mod[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MutationAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.MutationAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.executor.v1.MutationAction + * @static + * @param {google.spanner.executor.v1.IMutationAction} message MutationAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MutationAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MutationAction message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.executor.v1.MutationAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.executor.v1.MutationAction} MutationAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MutationAction.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.MutationAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.mod && message.mod.length)) + message.mod = []; + message.mod.push($root.google.spanner.executor.v1.MutationAction.Mod.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MutationAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.executor.v1.MutationAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.executor.v1.MutationAction} MutationAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MutationAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MutationAction message. + * @function verify + * @memberof google.spanner.executor.v1.MutationAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MutationAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.mod != null && message.hasOwnProperty("mod")) { + if (!Array.isArray(message.mod)) + return "mod: array expected"; + for (var i = 0; i < message.mod.length; ++i) { + var error = $root.google.spanner.executor.v1.MutationAction.Mod.verify(message.mod[i]); + if (error) + return "mod." + error; + } + } + return null; + }; + + /** + * Creates a MutationAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.executor.v1.MutationAction + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.executor.v1.MutationAction} MutationAction + */ + MutationAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.executor.v1.MutationAction) + return object; + var message = new $root.google.spanner.executor.v1.MutationAction(); + if (object.mod) { + if (!Array.isArray(object.mod)) + throw TypeError(".google.spanner.executor.v1.MutationAction.mod: array expected"); + message.mod = []; + for (var i = 0; i < object.mod.length; ++i) { + if (typeof object.mod[i] !== "object") + throw TypeError(".google.spanner.executor.v1.MutationAction.mod: object expected"); + message.mod[i] = $root.google.spanner.executor.v1.MutationAction.Mod.fromObject(object.mod[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a MutationAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.executor.v1.MutationAction + * @static + * @param {google.spanner.executor.v1.MutationAction} message MutationAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MutationAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.mod = []; + if (message.mod && message.mod.length) { + object.mod = []; + for (var j = 0; j < message.mod.length; ++j) + object.mod[j] = $root.google.spanner.executor.v1.MutationAction.Mod.toObject(message.mod[j], options); + } + return object; + }; + + /** + * Converts this MutationAction to JSON. + * @function toJSON + * @memberof google.spanner.executor.v1.MutationAction + * @instance + * @returns {Object.} JSON object + */ + MutationAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MutationAction + * @function getTypeUrl + * @memberof google.spanner.executor.v1.MutationAction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MutationAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.executor.v1.MutationAction"; + }; + + MutationAction.InsertArgs = (function() { + + /** + * Properties of an InsertArgs. + * @memberof google.spanner.executor.v1.MutationAction + * @interface IInsertArgs + * @property {Array.|null} [column] InsertArgs column + * @property {Array.|null} [type] InsertArgs type + * @property {Array.|null} [values] InsertArgs values + */ + + /** + * Constructs a new InsertArgs. + * @memberof google.spanner.executor.v1.MutationAction + * @classdesc Represents an InsertArgs. + * @implements IInsertArgs + * @constructor + * @param {google.spanner.executor.v1.MutationAction.IInsertArgs=} [properties] Properties to set + */ + function InsertArgs(properties) { + this.column = []; + this.type = []; + this.values = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InsertArgs column. + * @member {Array.} column + * @memberof google.spanner.executor.v1.MutationAction.InsertArgs + * @instance + */ + InsertArgs.prototype.column = $util.emptyArray; + + /** + * InsertArgs type. + * @member {Array.} type + * @memberof google.spanner.executor.v1.MutationAction.InsertArgs + * @instance + */ + InsertArgs.prototype.type = $util.emptyArray; + + /** + * InsertArgs values. + * @member {Array.} values + * @memberof google.spanner.executor.v1.MutationAction.InsertArgs + * @instance + */ + InsertArgs.prototype.values = $util.emptyArray; + + /** + * Creates a new InsertArgs instance using the specified properties. + * @function create + * @memberof google.spanner.executor.v1.MutationAction.InsertArgs + * @static + * @param {google.spanner.executor.v1.MutationAction.IInsertArgs=} [properties] Properties to set + * @returns {google.spanner.executor.v1.MutationAction.InsertArgs} InsertArgs instance + */ + InsertArgs.create = function create(properties) { + return new InsertArgs(properties); + }; + + /** + * Encodes the specified InsertArgs message. Does not implicitly {@link google.spanner.executor.v1.MutationAction.InsertArgs.verify|verify} messages. + * @function encode + * @memberof google.spanner.executor.v1.MutationAction.InsertArgs + * @static + * @param {google.spanner.executor.v1.MutationAction.IInsertArgs} message InsertArgs message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertArgs.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.column != null && message.column.length) + for (var i = 0; i < message.column.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.column[i]); + if (message.type != null && message.type.length) + for (var i = 0; i < message.type.length; ++i) + $root.google.spanner.v1.Type.encode(message.type[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.values != null && message.values.length) + for (var i = 0; i < message.values.length; ++i) + $root.google.spanner.executor.v1.ValueList.encode(message.values[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InsertArgs message, length delimited. Does not implicitly {@link google.spanner.executor.v1.MutationAction.InsertArgs.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.executor.v1.MutationAction.InsertArgs + * @static + * @param {google.spanner.executor.v1.MutationAction.IInsertArgs} message InsertArgs message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertArgs.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InsertArgs message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.executor.v1.MutationAction.InsertArgs + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.executor.v1.MutationAction.InsertArgs} InsertArgs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertArgs.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.MutationAction.InsertArgs(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.column && message.column.length)) + message.column = []; + message.column.push(reader.string()); + break; + } + case 2: { + if (!(message.type && message.type.length)) + message.type = []; + message.type.push($root.google.spanner.v1.Type.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.values && message.values.length)) + message.values = []; + message.values.push($root.google.spanner.executor.v1.ValueList.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InsertArgs message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.executor.v1.MutationAction.InsertArgs + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.executor.v1.MutationAction.InsertArgs} InsertArgs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertArgs.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InsertArgs message. + * @function verify + * @memberof google.spanner.executor.v1.MutationAction.InsertArgs + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InsertArgs.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.column != null && message.hasOwnProperty("column")) { + if (!Array.isArray(message.column)) + return "column: array expected"; + for (var i = 0; i < message.column.length; ++i) + if (!$util.isString(message.column[i])) + return "column: string[] expected"; + } + if (message.type != null && message.hasOwnProperty("type")) { + if (!Array.isArray(message.type)) + return "type: array expected"; + for (var i = 0; i < message.type.length; ++i) { + var error = $root.google.spanner.v1.Type.verify(message.type[i]); + if (error) + return "type." + error; + } + } + if (message.values != null && message.hasOwnProperty("values")) { + if (!Array.isArray(message.values)) + return "values: array expected"; + for (var i = 0; i < message.values.length; ++i) { + var error = $root.google.spanner.executor.v1.ValueList.verify(message.values[i]); + if (error) + return "values." + error; + } + } + return null; + }; + + /** + * Creates an InsertArgs message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.executor.v1.MutationAction.InsertArgs + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.executor.v1.MutationAction.InsertArgs} InsertArgs + */ + InsertArgs.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.executor.v1.MutationAction.InsertArgs) + return object; + var message = new $root.google.spanner.executor.v1.MutationAction.InsertArgs(); + if (object.column) { + if (!Array.isArray(object.column)) + throw TypeError(".google.spanner.executor.v1.MutationAction.InsertArgs.column: array expected"); + message.column = []; + for (var i = 0; i < object.column.length; ++i) + message.column[i] = String(object.column[i]); + } + if (object.type) { + if (!Array.isArray(object.type)) + throw TypeError(".google.spanner.executor.v1.MutationAction.InsertArgs.type: array expected"); + message.type = []; + for (var i = 0; i < object.type.length; ++i) { + if (typeof object.type[i] !== "object") + throw TypeError(".google.spanner.executor.v1.MutationAction.InsertArgs.type: object expected"); + message.type[i] = $root.google.spanner.v1.Type.fromObject(object.type[i]); + } + } + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.spanner.executor.v1.MutationAction.InsertArgs.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) { + if (typeof object.values[i] !== "object") + throw TypeError(".google.spanner.executor.v1.MutationAction.InsertArgs.values: object expected"); + message.values[i] = $root.google.spanner.executor.v1.ValueList.fromObject(object.values[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an InsertArgs message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.executor.v1.MutationAction.InsertArgs + * @static + * @param {google.spanner.executor.v1.MutationAction.InsertArgs} message InsertArgs + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InsertArgs.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.column = []; + object.type = []; + object.values = []; + } + if (message.column && message.column.length) { + object.column = []; + for (var j = 0; j < message.column.length; ++j) + object.column[j] = message.column[j]; + } + if (message.type && message.type.length) { + object.type = []; + for (var j = 0; j < message.type.length; ++j) + object.type[j] = $root.google.spanner.v1.Type.toObject(message.type[j], options); + } + if (message.values && message.values.length) { + object.values = []; + for (var j = 0; j < message.values.length; ++j) + object.values[j] = $root.google.spanner.executor.v1.ValueList.toObject(message.values[j], options); + } + return object; + }; + + /** + * Converts this InsertArgs to JSON. + * @function toJSON + * @memberof google.spanner.executor.v1.MutationAction.InsertArgs + * @instance + * @returns {Object.} JSON object + */ + InsertArgs.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InsertArgs + * @function getTypeUrl + * @memberof google.spanner.executor.v1.MutationAction.InsertArgs + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InsertArgs.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.executor.v1.MutationAction.InsertArgs"; + }; + + return InsertArgs; + })(); + + MutationAction.UpdateArgs = (function() { + + /** + * Properties of an UpdateArgs. + * @memberof google.spanner.executor.v1.MutationAction + * @interface IUpdateArgs + * @property {Array.|null} [column] UpdateArgs column + * @property {Array.|null} [type] UpdateArgs type + * @property {Array.|null} [values] UpdateArgs values + */ + + /** + * Constructs a new UpdateArgs. + * @memberof google.spanner.executor.v1.MutationAction + * @classdesc Represents an UpdateArgs. + * @implements IUpdateArgs + * @constructor + * @param {google.spanner.executor.v1.MutationAction.IUpdateArgs=} [properties] Properties to set + */ + function UpdateArgs(properties) { + this.column = []; + this.type = []; + this.values = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateArgs column. + * @member {Array.} column + * @memberof google.spanner.executor.v1.MutationAction.UpdateArgs + * @instance + */ + UpdateArgs.prototype.column = $util.emptyArray; + + /** + * UpdateArgs type. + * @member {Array.} type + * @memberof google.spanner.executor.v1.MutationAction.UpdateArgs + * @instance + */ + UpdateArgs.prototype.type = $util.emptyArray; + + /** + * UpdateArgs values. + * @member {Array.} values + * @memberof google.spanner.executor.v1.MutationAction.UpdateArgs + * @instance + */ + UpdateArgs.prototype.values = $util.emptyArray; + + /** + * Creates a new UpdateArgs instance using the specified properties. + * @function create + * @memberof google.spanner.executor.v1.MutationAction.UpdateArgs + * @static + * @param {google.spanner.executor.v1.MutationAction.IUpdateArgs=} [properties] Properties to set + * @returns {google.spanner.executor.v1.MutationAction.UpdateArgs} UpdateArgs instance + */ + UpdateArgs.create = function create(properties) { + return new UpdateArgs(properties); + }; + + /** + * Encodes the specified UpdateArgs message. Does not implicitly {@link google.spanner.executor.v1.MutationAction.UpdateArgs.verify|verify} messages. + * @function encode + * @memberof google.spanner.executor.v1.MutationAction.UpdateArgs + * @static + * @param {google.spanner.executor.v1.MutationAction.IUpdateArgs} message UpdateArgs message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateArgs.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.column != null && message.column.length) + for (var i = 0; i < message.column.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.column[i]); + if (message.type != null && message.type.length) + for (var i = 0; i < message.type.length; ++i) + $root.google.spanner.v1.Type.encode(message.type[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.values != null && message.values.length) + for (var i = 0; i < message.values.length; ++i) + $root.google.spanner.executor.v1.ValueList.encode(message.values[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateArgs message, length delimited. Does not implicitly {@link google.spanner.executor.v1.MutationAction.UpdateArgs.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.executor.v1.MutationAction.UpdateArgs + * @static + * @param {google.spanner.executor.v1.MutationAction.IUpdateArgs} message UpdateArgs message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateArgs.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateArgs message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.executor.v1.MutationAction.UpdateArgs + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.executor.v1.MutationAction.UpdateArgs} UpdateArgs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateArgs.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.MutationAction.UpdateArgs(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.column && message.column.length)) + message.column = []; + message.column.push(reader.string()); + break; + } + case 2: { + if (!(message.type && message.type.length)) + message.type = []; + message.type.push($root.google.spanner.v1.Type.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.values && message.values.length)) + message.values = []; + message.values.push($root.google.spanner.executor.v1.ValueList.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateArgs message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.executor.v1.MutationAction.UpdateArgs + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.executor.v1.MutationAction.UpdateArgs} UpdateArgs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateArgs.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateArgs message. + * @function verify + * @memberof google.spanner.executor.v1.MutationAction.UpdateArgs + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateArgs.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.column != null && message.hasOwnProperty("column")) { + if (!Array.isArray(message.column)) + return "column: array expected"; + for (var i = 0; i < message.column.length; ++i) + if (!$util.isString(message.column[i])) + return "column: string[] expected"; + } + if (message.type != null && message.hasOwnProperty("type")) { + if (!Array.isArray(message.type)) + return "type: array expected"; + for (var i = 0; i < message.type.length; ++i) { + var error = $root.google.spanner.v1.Type.verify(message.type[i]); + if (error) + return "type." + error; + } + } + if (message.values != null && message.hasOwnProperty("values")) { + if (!Array.isArray(message.values)) + return "values: array expected"; + for (var i = 0; i < message.values.length; ++i) { + var error = $root.google.spanner.executor.v1.ValueList.verify(message.values[i]); + if (error) + return "values." + error; + } + } + return null; + }; + + /** + * Creates an UpdateArgs message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.executor.v1.MutationAction.UpdateArgs + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.executor.v1.MutationAction.UpdateArgs} UpdateArgs + */ + UpdateArgs.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.executor.v1.MutationAction.UpdateArgs) + return object; + var message = new $root.google.spanner.executor.v1.MutationAction.UpdateArgs(); + if (object.column) { + if (!Array.isArray(object.column)) + throw TypeError(".google.spanner.executor.v1.MutationAction.UpdateArgs.column: array expected"); + message.column = []; + for (var i = 0; i < object.column.length; ++i) + message.column[i] = String(object.column[i]); + } + if (object.type) { + if (!Array.isArray(object.type)) + throw TypeError(".google.spanner.executor.v1.MutationAction.UpdateArgs.type: array expected"); + message.type = []; + for (var i = 0; i < object.type.length; ++i) { + if (typeof object.type[i] !== "object") + throw TypeError(".google.spanner.executor.v1.MutationAction.UpdateArgs.type: object expected"); + message.type[i] = $root.google.spanner.v1.Type.fromObject(object.type[i]); + } + } + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.spanner.executor.v1.MutationAction.UpdateArgs.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) { + if (typeof object.values[i] !== "object") + throw TypeError(".google.spanner.executor.v1.MutationAction.UpdateArgs.values: object expected"); + message.values[i] = $root.google.spanner.executor.v1.ValueList.fromObject(object.values[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an UpdateArgs message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.executor.v1.MutationAction.UpdateArgs + * @static + * @param {google.spanner.executor.v1.MutationAction.UpdateArgs} message UpdateArgs + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateArgs.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.column = []; + object.type = []; + object.values = []; + } + if (message.column && message.column.length) { + object.column = []; + for (var j = 0; j < message.column.length; ++j) + object.column[j] = message.column[j]; + } + if (message.type && message.type.length) { + object.type = []; + for (var j = 0; j < message.type.length; ++j) + object.type[j] = $root.google.spanner.v1.Type.toObject(message.type[j], options); + } + if (message.values && message.values.length) { + object.values = []; + for (var j = 0; j < message.values.length; ++j) + object.values[j] = $root.google.spanner.executor.v1.ValueList.toObject(message.values[j], options); + } + return object; + }; + + /** + * Converts this UpdateArgs to JSON. + * @function toJSON + * @memberof google.spanner.executor.v1.MutationAction.UpdateArgs + * @instance + * @returns {Object.} JSON object + */ + UpdateArgs.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateArgs + * @function getTypeUrl + * @memberof google.spanner.executor.v1.MutationAction.UpdateArgs + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateArgs.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.executor.v1.MutationAction.UpdateArgs"; + }; + + return UpdateArgs; + })(); + + MutationAction.Mod = (function() { + + /** + * Properties of a Mod. + * @memberof google.spanner.executor.v1.MutationAction + * @interface IMod + * @property {string|null} [table] Mod table + * @property {google.spanner.executor.v1.MutationAction.IInsertArgs|null} [insert] Mod insert + * @property {google.spanner.executor.v1.MutationAction.IUpdateArgs|null} [update] Mod update + * @property {google.spanner.executor.v1.MutationAction.IInsertArgs|null} [insertOrUpdate] Mod insertOrUpdate + * @property {google.spanner.executor.v1.MutationAction.IInsertArgs|null} [replace] Mod replace + * @property {google.spanner.executor.v1.IKeySet|null} [deleteKeys] Mod deleteKeys + */ + + /** + * Constructs a new Mod. + * @memberof google.spanner.executor.v1.MutationAction + * @classdesc Represents a Mod. + * @implements IMod + * @constructor + * @param {google.spanner.executor.v1.MutationAction.IMod=} [properties] Properties to set + */ + function Mod(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Mod table. + * @member {string} table + * @memberof google.spanner.executor.v1.MutationAction.Mod + * @instance + */ + Mod.prototype.table = ""; + + /** + * Mod insert. + * @member {google.spanner.executor.v1.MutationAction.IInsertArgs|null|undefined} insert + * @memberof google.spanner.executor.v1.MutationAction.Mod + * @instance + */ + Mod.prototype.insert = null; + + /** + * Mod update. + * @member {google.spanner.executor.v1.MutationAction.IUpdateArgs|null|undefined} update + * @memberof google.spanner.executor.v1.MutationAction.Mod + * @instance + */ + Mod.prototype.update = null; + + /** + * Mod insertOrUpdate. + * @member {google.spanner.executor.v1.MutationAction.IInsertArgs|null|undefined} insertOrUpdate + * @memberof google.spanner.executor.v1.MutationAction.Mod + * @instance + */ + Mod.prototype.insertOrUpdate = null; + + /** + * Mod replace. + * @member {google.spanner.executor.v1.MutationAction.IInsertArgs|null|undefined} replace + * @memberof google.spanner.executor.v1.MutationAction.Mod + * @instance + */ + Mod.prototype.replace = null; + + /** + * Mod deleteKeys. + * @member {google.spanner.executor.v1.IKeySet|null|undefined} deleteKeys + * @memberof google.spanner.executor.v1.MutationAction.Mod + * @instance + */ + Mod.prototype.deleteKeys = null; + + /** + * Creates a new Mod instance using the specified properties. + * @function create + * @memberof google.spanner.executor.v1.MutationAction.Mod + * @static + * @param {google.spanner.executor.v1.MutationAction.IMod=} [properties] Properties to set + * @returns {google.spanner.executor.v1.MutationAction.Mod} Mod instance + */ + Mod.create = function create(properties) { + return new Mod(properties); + }; + + /** + * Encodes the specified Mod message. Does not implicitly {@link google.spanner.executor.v1.MutationAction.Mod.verify|verify} messages. + * @function encode + * @memberof google.spanner.executor.v1.MutationAction.Mod + * @static + * @param {google.spanner.executor.v1.MutationAction.IMod} message Mod message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Mod.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.table != null && Object.hasOwnProperty.call(message, "table")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.table); + if (message.insert != null && Object.hasOwnProperty.call(message, "insert")) + $root.google.spanner.executor.v1.MutationAction.InsertArgs.encode(message.insert, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.update != null && Object.hasOwnProperty.call(message, "update")) + $root.google.spanner.executor.v1.MutationAction.UpdateArgs.encode(message.update, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.insertOrUpdate != null && Object.hasOwnProperty.call(message, "insertOrUpdate")) + $root.google.spanner.executor.v1.MutationAction.InsertArgs.encode(message.insertOrUpdate, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.replace != null && Object.hasOwnProperty.call(message, "replace")) + $root.google.spanner.executor.v1.MutationAction.InsertArgs.encode(message.replace, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.deleteKeys != null && Object.hasOwnProperty.call(message, "deleteKeys")) + $root.google.spanner.executor.v1.KeySet.encode(message.deleteKeys, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Mod message, length delimited. Does not implicitly {@link google.spanner.executor.v1.MutationAction.Mod.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.executor.v1.MutationAction.Mod + * @static + * @param {google.spanner.executor.v1.MutationAction.IMod} message Mod message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Mod.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Mod message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.executor.v1.MutationAction.Mod + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.executor.v1.MutationAction.Mod} Mod + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Mod.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.MutationAction.Mod(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.table = reader.string(); + break; + } + case 2: { + message.insert = $root.google.spanner.executor.v1.MutationAction.InsertArgs.decode(reader, reader.uint32()); + break; + } + case 3: { + message.update = $root.google.spanner.executor.v1.MutationAction.UpdateArgs.decode(reader, reader.uint32()); + break; + } + case 4: { + message.insertOrUpdate = $root.google.spanner.executor.v1.MutationAction.InsertArgs.decode(reader, reader.uint32()); + break; + } + case 5: { + message.replace = $root.google.spanner.executor.v1.MutationAction.InsertArgs.decode(reader, reader.uint32()); + break; + } + case 6: { + message.deleteKeys = $root.google.spanner.executor.v1.KeySet.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Mod message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.executor.v1.MutationAction.Mod + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.executor.v1.MutationAction.Mod} Mod + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Mod.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Mod message. + * @function verify + * @memberof google.spanner.executor.v1.MutationAction.Mod + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Mod.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.table != null && message.hasOwnProperty("table")) + if (!$util.isString(message.table)) + return "table: string expected"; + if (message.insert != null && message.hasOwnProperty("insert")) { + var error = $root.google.spanner.executor.v1.MutationAction.InsertArgs.verify(message.insert); + if (error) + return "insert." + error; + } + if (message.update != null && message.hasOwnProperty("update")) { + var error = $root.google.spanner.executor.v1.MutationAction.UpdateArgs.verify(message.update); + if (error) + return "update." + error; + } + if (message.insertOrUpdate != null && message.hasOwnProperty("insertOrUpdate")) { + var error = $root.google.spanner.executor.v1.MutationAction.InsertArgs.verify(message.insertOrUpdate); + if (error) + return "insertOrUpdate." + error; + } + if (message.replace != null && message.hasOwnProperty("replace")) { + var error = $root.google.spanner.executor.v1.MutationAction.InsertArgs.verify(message.replace); + if (error) + return "replace." + error; + } + if (message.deleteKeys != null && message.hasOwnProperty("deleteKeys")) { + var error = $root.google.spanner.executor.v1.KeySet.verify(message.deleteKeys); + if (error) + return "deleteKeys." + error; + } + return null; + }; + + /** + * Creates a Mod message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.executor.v1.MutationAction.Mod + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.executor.v1.MutationAction.Mod} Mod + */ + Mod.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.executor.v1.MutationAction.Mod) + return object; + var message = new $root.google.spanner.executor.v1.MutationAction.Mod(); + if (object.table != null) + message.table = String(object.table); + if (object.insert != null) { + if (typeof object.insert !== "object") + throw TypeError(".google.spanner.executor.v1.MutationAction.Mod.insert: object expected"); + message.insert = $root.google.spanner.executor.v1.MutationAction.InsertArgs.fromObject(object.insert); + } + if (object.update != null) { + if (typeof object.update !== "object") + throw TypeError(".google.spanner.executor.v1.MutationAction.Mod.update: object expected"); + message.update = $root.google.spanner.executor.v1.MutationAction.UpdateArgs.fromObject(object.update); + } + if (object.insertOrUpdate != null) { + if (typeof object.insertOrUpdate !== "object") + throw TypeError(".google.spanner.executor.v1.MutationAction.Mod.insertOrUpdate: object expected"); + message.insertOrUpdate = $root.google.spanner.executor.v1.MutationAction.InsertArgs.fromObject(object.insertOrUpdate); + } + if (object.replace != null) { + if (typeof object.replace !== "object") + throw TypeError(".google.spanner.executor.v1.MutationAction.Mod.replace: object expected"); + message.replace = $root.google.spanner.executor.v1.MutationAction.InsertArgs.fromObject(object.replace); + } + if (object.deleteKeys != null) { + if (typeof object.deleteKeys !== "object") + throw TypeError(".google.spanner.executor.v1.MutationAction.Mod.deleteKeys: object expected"); + message.deleteKeys = $root.google.spanner.executor.v1.KeySet.fromObject(object.deleteKeys); + } + return message; + }; + + /** + * Creates a plain object from a Mod message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.executor.v1.MutationAction.Mod + * @static + * @param {google.spanner.executor.v1.MutationAction.Mod} message Mod + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Mod.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.table = ""; + object.insert = null; + object.update = null; + object.insertOrUpdate = null; + object.replace = null; + object.deleteKeys = null; + } + if (message.table != null && message.hasOwnProperty("table")) + object.table = message.table; + if (message.insert != null && message.hasOwnProperty("insert")) + object.insert = $root.google.spanner.executor.v1.MutationAction.InsertArgs.toObject(message.insert, options); + if (message.update != null && message.hasOwnProperty("update")) + object.update = $root.google.spanner.executor.v1.MutationAction.UpdateArgs.toObject(message.update, options); + if (message.insertOrUpdate != null && message.hasOwnProperty("insertOrUpdate")) + object.insertOrUpdate = $root.google.spanner.executor.v1.MutationAction.InsertArgs.toObject(message.insertOrUpdate, options); + if (message.replace != null && message.hasOwnProperty("replace")) + object.replace = $root.google.spanner.executor.v1.MutationAction.InsertArgs.toObject(message.replace, options); + if (message.deleteKeys != null && message.hasOwnProperty("deleteKeys")) + object.deleteKeys = $root.google.spanner.executor.v1.KeySet.toObject(message.deleteKeys, options); + return object; + }; + + /** + * Converts this Mod to JSON. + * @function toJSON + * @memberof google.spanner.executor.v1.MutationAction.Mod + * @instance + * @returns {Object.} JSON object + */ + Mod.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Mod + * @function getTypeUrl + * @memberof google.spanner.executor.v1.MutationAction.Mod + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Mod.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.executor.v1.MutationAction.Mod"; + }; + + return Mod; + })(); + + return MutationAction; + })(); + + v1.WriteMutationsAction = (function() { + + /** + * Properties of a WriteMutationsAction. + * @memberof google.spanner.executor.v1 + * @interface IWriteMutationsAction + * @property {google.spanner.executor.v1.IMutationAction|null} [mutation] WriteMutationsAction mutation + */ + + /** + * Constructs a new WriteMutationsAction. + * @memberof google.spanner.executor.v1 + * @classdesc Represents a WriteMutationsAction. + * @implements IWriteMutationsAction + * @constructor + * @param {google.spanner.executor.v1.IWriteMutationsAction=} [properties] Properties to set + */ + function WriteMutationsAction(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WriteMutationsAction mutation. + * @member {google.spanner.executor.v1.IMutationAction|null|undefined} mutation + * @memberof google.spanner.executor.v1.WriteMutationsAction + * @instance + */ + WriteMutationsAction.prototype.mutation = null; + + /** + * Creates a new WriteMutationsAction instance using the specified properties. + * @function create + * @memberof google.spanner.executor.v1.WriteMutationsAction + * @static + * @param {google.spanner.executor.v1.IWriteMutationsAction=} [properties] Properties to set + * @returns {google.spanner.executor.v1.WriteMutationsAction} WriteMutationsAction instance + */ + WriteMutationsAction.create = function create(properties) { + return new WriteMutationsAction(properties); + }; + + /** + * Encodes the specified WriteMutationsAction message. Does not implicitly {@link google.spanner.executor.v1.WriteMutationsAction.verify|verify} messages. + * @function encode + * @memberof google.spanner.executor.v1.WriteMutationsAction + * @static + * @param {google.spanner.executor.v1.IWriteMutationsAction} message WriteMutationsAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WriteMutationsAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mutation != null && Object.hasOwnProperty.call(message, "mutation")) + $root.google.spanner.executor.v1.MutationAction.encode(message.mutation, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WriteMutationsAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.WriteMutationsAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.executor.v1.WriteMutationsAction + * @static + * @param {google.spanner.executor.v1.IWriteMutationsAction} message WriteMutationsAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WriteMutationsAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WriteMutationsAction message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.executor.v1.WriteMutationsAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.executor.v1.WriteMutationsAction} WriteMutationsAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WriteMutationsAction.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.WriteMutationsAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.mutation = $root.google.spanner.executor.v1.MutationAction.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WriteMutationsAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.executor.v1.WriteMutationsAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.executor.v1.WriteMutationsAction} WriteMutationsAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WriteMutationsAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WriteMutationsAction message. + * @function verify + * @memberof google.spanner.executor.v1.WriteMutationsAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WriteMutationsAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.mutation != null && message.hasOwnProperty("mutation")) { + var error = $root.google.spanner.executor.v1.MutationAction.verify(message.mutation); + if (error) + return "mutation." + error; + } + return null; + }; + + /** + * Creates a WriteMutationsAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.executor.v1.WriteMutationsAction + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.executor.v1.WriteMutationsAction} WriteMutationsAction + */ + WriteMutationsAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.executor.v1.WriteMutationsAction) + return object; + var message = new $root.google.spanner.executor.v1.WriteMutationsAction(); + if (object.mutation != null) { + if (typeof object.mutation !== "object") + throw TypeError(".google.spanner.executor.v1.WriteMutationsAction.mutation: object expected"); + message.mutation = $root.google.spanner.executor.v1.MutationAction.fromObject(object.mutation); + } + return message; + }; + + /** + * Creates a plain object from a WriteMutationsAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.executor.v1.WriteMutationsAction + * @static + * @param {google.spanner.executor.v1.WriteMutationsAction} message WriteMutationsAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WriteMutationsAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.mutation = null; + if (message.mutation != null && message.hasOwnProperty("mutation")) + object.mutation = $root.google.spanner.executor.v1.MutationAction.toObject(message.mutation, options); + return object; + }; + + /** + * Converts this WriteMutationsAction to JSON. + * @function toJSON + * @memberof google.spanner.executor.v1.WriteMutationsAction + * @instance + * @returns {Object.} JSON object + */ + WriteMutationsAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WriteMutationsAction + * @function getTypeUrl + * @memberof google.spanner.executor.v1.WriteMutationsAction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WriteMutationsAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.executor.v1.WriteMutationsAction"; + }; + + return WriteMutationsAction; + })(); + + v1.PartitionedUpdateAction = (function() { + + /** + * Properties of a PartitionedUpdateAction. + * @memberof google.spanner.executor.v1 + * @interface IPartitionedUpdateAction + * @property {google.spanner.executor.v1.PartitionedUpdateAction.IExecutePartitionedUpdateOptions|null} [options] PartitionedUpdateAction options + * @property {google.spanner.executor.v1.IQueryAction|null} [update] PartitionedUpdateAction update + */ + + /** + * Constructs a new PartitionedUpdateAction. + * @memberof google.spanner.executor.v1 + * @classdesc Represents a PartitionedUpdateAction. + * @implements IPartitionedUpdateAction + * @constructor + * @param {google.spanner.executor.v1.IPartitionedUpdateAction=} [properties] Properties to set + */ + function PartitionedUpdateAction(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PartitionedUpdateAction options. + * @member {google.spanner.executor.v1.PartitionedUpdateAction.IExecutePartitionedUpdateOptions|null|undefined} options + * @memberof google.spanner.executor.v1.PartitionedUpdateAction + * @instance + */ + PartitionedUpdateAction.prototype.options = null; + + /** + * PartitionedUpdateAction update. + * @member {google.spanner.executor.v1.IQueryAction|null|undefined} update + * @memberof google.spanner.executor.v1.PartitionedUpdateAction + * @instance + */ + PartitionedUpdateAction.prototype.update = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PartitionedUpdateAction.prototype, "_options", { + get: $util.oneOfGetter($oneOfFields = ["options"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PartitionedUpdateAction instance using the specified properties. + * @function create + * @memberof google.spanner.executor.v1.PartitionedUpdateAction + * @static + * @param {google.spanner.executor.v1.IPartitionedUpdateAction=} [properties] Properties to set + * @returns {google.spanner.executor.v1.PartitionedUpdateAction} PartitionedUpdateAction instance + */ + PartitionedUpdateAction.create = function create(properties) { + return new PartitionedUpdateAction(properties); + }; + + /** + * Encodes the specified PartitionedUpdateAction message. Does not implicitly {@link google.spanner.executor.v1.PartitionedUpdateAction.verify|verify} messages. + * @function encode + * @memberof google.spanner.executor.v1.PartitionedUpdateAction + * @static + * @param {google.spanner.executor.v1.IPartitionedUpdateAction} message PartitionedUpdateAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartitionedUpdateAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.spanner.executor.v1.PartitionedUpdateAction.ExecutePartitionedUpdateOptions.encode(message.options, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.update != null && Object.hasOwnProperty.call(message, "update")) + $root.google.spanner.executor.v1.QueryAction.encode(message.update, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PartitionedUpdateAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.PartitionedUpdateAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.executor.v1.PartitionedUpdateAction + * @static + * @param {google.spanner.executor.v1.IPartitionedUpdateAction} message PartitionedUpdateAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartitionedUpdateAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PartitionedUpdateAction message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.executor.v1.PartitionedUpdateAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.executor.v1.PartitionedUpdateAction} PartitionedUpdateAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartitionedUpdateAction.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.PartitionedUpdateAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.options = $root.google.spanner.executor.v1.PartitionedUpdateAction.ExecutePartitionedUpdateOptions.decode(reader, reader.uint32()); + break; + } + case 2: { + message.update = $root.google.spanner.executor.v1.QueryAction.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PartitionedUpdateAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.executor.v1.PartitionedUpdateAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.executor.v1.PartitionedUpdateAction} PartitionedUpdateAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartitionedUpdateAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PartitionedUpdateAction message. + * @function verify + * @memberof google.spanner.executor.v1.PartitionedUpdateAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PartitionedUpdateAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.options != null && message.hasOwnProperty("options")) { + properties._options = 1; + { + var error = $root.google.spanner.executor.v1.PartitionedUpdateAction.ExecutePartitionedUpdateOptions.verify(message.options); + if (error) + return "options." + error; + } + } + if (message.update != null && message.hasOwnProperty("update")) { + var error = $root.google.spanner.executor.v1.QueryAction.verify(message.update); + if (error) + return "update." + error; + } + return null; + }; + + /** + * Creates a PartitionedUpdateAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.executor.v1.PartitionedUpdateAction + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.executor.v1.PartitionedUpdateAction} PartitionedUpdateAction + */ + PartitionedUpdateAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.executor.v1.PartitionedUpdateAction) + return object; + var message = new $root.google.spanner.executor.v1.PartitionedUpdateAction(); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.spanner.executor.v1.PartitionedUpdateAction.options: object expected"); + message.options = $root.google.spanner.executor.v1.PartitionedUpdateAction.ExecutePartitionedUpdateOptions.fromObject(object.options); + } + if (object.update != null) { + if (typeof object.update !== "object") + throw TypeError(".google.spanner.executor.v1.PartitionedUpdateAction.update: object expected"); + message.update = $root.google.spanner.executor.v1.QueryAction.fromObject(object.update); + } + return message; + }; + + /** + * Creates a plain object from a PartitionedUpdateAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.executor.v1.PartitionedUpdateAction + * @static + * @param {google.spanner.executor.v1.PartitionedUpdateAction} message PartitionedUpdateAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PartitionedUpdateAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.update = null; + if (message.options != null && message.hasOwnProperty("options")) { + object.options = $root.google.spanner.executor.v1.PartitionedUpdateAction.ExecutePartitionedUpdateOptions.toObject(message.options, options); + if (options.oneofs) + object._options = "options"; + } + if (message.update != null && message.hasOwnProperty("update")) + object.update = $root.google.spanner.executor.v1.QueryAction.toObject(message.update, options); + return object; + }; + + /** + * Converts this PartitionedUpdateAction to JSON. + * @function toJSON + * @memberof google.spanner.executor.v1.PartitionedUpdateAction + * @instance + * @returns {Object.} JSON object + */ + PartitionedUpdateAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PartitionedUpdateAction + * @function getTypeUrl + * @memberof google.spanner.executor.v1.PartitionedUpdateAction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PartitionedUpdateAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.executor.v1.PartitionedUpdateAction"; + }; + + PartitionedUpdateAction.ExecutePartitionedUpdateOptions = (function() { + + /** + * Properties of an ExecutePartitionedUpdateOptions. + * @memberof google.spanner.executor.v1.PartitionedUpdateAction + * @interface IExecutePartitionedUpdateOptions + * @property {google.spanner.v1.RequestOptions.Priority|null} [rpcPriority] ExecutePartitionedUpdateOptions rpcPriority + * @property {string|null} [tag] ExecutePartitionedUpdateOptions tag + */ + + /** + * Constructs a new ExecutePartitionedUpdateOptions. + * @memberof google.spanner.executor.v1.PartitionedUpdateAction + * @classdesc Represents an ExecutePartitionedUpdateOptions. + * @implements IExecutePartitionedUpdateOptions + * @constructor + * @param {google.spanner.executor.v1.PartitionedUpdateAction.IExecutePartitionedUpdateOptions=} [properties] Properties to set + */ + function ExecutePartitionedUpdateOptions(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExecutePartitionedUpdateOptions rpcPriority. + * @member {google.spanner.v1.RequestOptions.Priority|null|undefined} rpcPriority + * @memberof google.spanner.executor.v1.PartitionedUpdateAction.ExecutePartitionedUpdateOptions + * @instance + */ + ExecutePartitionedUpdateOptions.prototype.rpcPriority = null; + + /** + * ExecutePartitionedUpdateOptions tag. + * @member {string|null|undefined} tag + * @memberof google.spanner.executor.v1.PartitionedUpdateAction.ExecutePartitionedUpdateOptions + * @instance + */ + ExecutePartitionedUpdateOptions.prototype.tag = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ExecutePartitionedUpdateOptions.prototype, "_rpcPriority", { + get: $util.oneOfGetter($oneOfFields = ["rpcPriority"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ExecutePartitionedUpdateOptions.prototype, "_tag", { + get: $util.oneOfGetter($oneOfFields = ["tag"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ExecutePartitionedUpdateOptions instance using the specified properties. + * @function create + * @memberof google.spanner.executor.v1.PartitionedUpdateAction.ExecutePartitionedUpdateOptions + * @static + * @param {google.spanner.executor.v1.PartitionedUpdateAction.IExecutePartitionedUpdateOptions=} [properties] Properties to set + * @returns {google.spanner.executor.v1.PartitionedUpdateAction.ExecutePartitionedUpdateOptions} ExecutePartitionedUpdateOptions instance + */ + ExecutePartitionedUpdateOptions.create = function create(properties) { + return new ExecutePartitionedUpdateOptions(properties); + }; + + /** + * Encodes the specified ExecutePartitionedUpdateOptions message. Does not implicitly {@link google.spanner.executor.v1.PartitionedUpdateAction.ExecutePartitionedUpdateOptions.verify|verify} messages. + * @function encode + * @memberof google.spanner.executor.v1.PartitionedUpdateAction.ExecutePartitionedUpdateOptions + * @static + * @param {google.spanner.executor.v1.PartitionedUpdateAction.IExecutePartitionedUpdateOptions} message ExecutePartitionedUpdateOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecutePartitionedUpdateOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rpcPriority != null && Object.hasOwnProperty.call(message, "rpcPriority")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.rpcPriority); + if (message.tag != null && Object.hasOwnProperty.call(message, "tag")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.tag); + return writer; + }; + + /** + * Encodes the specified ExecutePartitionedUpdateOptions message, length delimited. Does not implicitly {@link google.spanner.executor.v1.PartitionedUpdateAction.ExecutePartitionedUpdateOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.executor.v1.PartitionedUpdateAction.ExecutePartitionedUpdateOptions + * @static + * @param {google.spanner.executor.v1.PartitionedUpdateAction.IExecutePartitionedUpdateOptions} message ExecutePartitionedUpdateOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecutePartitionedUpdateOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExecutePartitionedUpdateOptions message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.executor.v1.PartitionedUpdateAction.ExecutePartitionedUpdateOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.executor.v1.PartitionedUpdateAction.ExecutePartitionedUpdateOptions} ExecutePartitionedUpdateOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecutePartitionedUpdateOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.PartitionedUpdateAction.ExecutePartitionedUpdateOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.rpcPriority = reader.int32(); + break; + } + case 2: { + message.tag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExecutePartitionedUpdateOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.executor.v1.PartitionedUpdateAction.ExecutePartitionedUpdateOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.executor.v1.PartitionedUpdateAction.ExecutePartitionedUpdateOptions} ExecutePartitionedUpdateOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecutePartitionedUpdateOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExecutePartitionedUpdateOptions message. + * @function verify + * @memberof google.spanner.executor.v1.PartitionedUpdateAction.ExecutePartitionedUpdateOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExecutePartitionedUpdateOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.rpcPriority != null && message.hasOwnProperty("rpcPriority")) { + properties._rpcPriority = 1; + switch (message.rpcPriority) { + default: + return "rpcPriority: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + } + if (message.tag != null && message.hasOwnProperty("tag")) { + properties._tag = 1; + if (!$util.isString(message.tag)) + return "tag: string expected"; + } + return null; + }; + + /** + * Creates an ExecutePartitionedUpdateOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.executor.v1.PartitionedUpdateAction.ExecutePartitionedUpdateOptions + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.executor.v1.PartitionedUpdateAction.ExecutePartitionedUpdateOptions} ExecutePartitionedUpdateOptions + */ + ExecutePartitionedUpdateOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.executor.v1.PartitionedUpdateAction.ExecutePartitionedUpdateOptions) + return object; + var message = new $root.google.spanner.executor.v1.PartitionedUpdateAction.ExecutePartitionedUpdateOptions(); + switch (object.rpcPriority) { + default: + if (typeof object.rpcPriority === "number") { + message.rpcPriority = object.rpcPriority; + break; + } + break; + case "PRIORITY_UNSPECIFIED": + case 0: + message.rpcPriority = 0; + break; + case "PRIORITY_LOW": + case 1: + message.rpcPriority = 1; + break; + case "PRIORITY_MEDIUM": + case 2: + message.rpcPriority = 2; + break; + case "PRIORITY_HIGH": + case 3: + message.rpcPriority = 3; + break; + } + if (object.tag != null) + message.tag = String(object.tag); + return message; + }; + + /** + * Creates a plain object from an ExecutePartitionedUpdateOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.executor.v1.PartitionedUpdateAction.ExecutePartitionedUpdateOptions + * @static + * @param {google.spanner.executor.v1.PartitionedUpdateAction.ExecutePartitionedUpdateOptions} message ExecutePartitionedUpdateOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExecutePartitionedUpdateOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.rpcPriority != null && message.hasOwnProperty("rpcPriority")) { + object.rpcPriority = options.enums === String ? $root.google.spanner.v1.RequestOptions.Priority[message.rpcPriority] === undefined ? message.rpcPriority : $root.google.spanner.v1.RequestOptions.Priority[message.rpcPriority] : message.rpcPriority; + if (options.oneofs) + object._rpcPriority = "rpcPriority"; + } + if (message.tag != null && message.hasOwnProperty("tag")) { + object.tag = message.tag; + if (options.oneofs) + object._tag = "tag"; + } + return object; + }; + + /** + * Converts this ExecutePartitionedUpdateOptions to JSON. + * @function toJSON + * @memberof google.spanner.executor.v1.PartitionedUpdateAction.ExecutePartitionedUpdateOptions + * @instance + * @returns {Object.} JSON object + */ + ExecutePartitionedUpdateOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExecutePartitionedUpdateOptions + * @function getTypeUrl + * @memberof google.spanner.executor.v1.PartitionedUpdateAction.ExecutePartitionedUpdateOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExecutePartitionedUpdateOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.executor.v1.PartitionedUpdateAction.ExecutePartitionedUpdateOptions"; + }; + + return ExecutePartitionedUpdateOptions; + })(); + + return PartitionedUpdateAction; + })(); + + v1.StartTransactionAction = (function() { + + /** + * Properties of a StartTransactionAction. + * @memberof google.spanner.executor.v1 + * @interface IStartTransactionAction + * @property {google.spanner.executor.v1.IConcurrency|null} [concurrency] StartTransactionAction concurrency + * @property {Array.|null} [table] StartTransactionAction table + * @property {string|null} [transactionSeed] StartTransactionAction transactionSeed + * @property {google.spanner.executor.v1.ITransactionExecutionOptions|null} [executionOptions] StartTransactionAction executionOptions + */ + + /** + * Constructs a new StartTransactionAction. + * @memberof google.spanner.executor.v1 + * @classdesc Represents a StartTransactionAction. + * @implements IStartTransactionAction + * @constructor + * @param {google.spanner.executor.v1.IStartTransactionAction=} [properties] Properties to set + */ + function StartTransactionAction(properties) { + this.table = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StartTransactionAction concurrency. + * @member {google.spanner.executor.v1.IConcurrency|null|undefined} concurrency + * @memberof google.spanner.executor.v1.StartTransactionAction + * @instance + */ + StartTransactionAction.prototype.concurrency = null; + + /** + * StartTransactionAction table. + * @member {Array.} table + * @memberof google.spanner.executor.v1.StartTransactionAction + * @instance + */ + StartTransactionAction.prototype.table = $util.emptyArray; + + /** + * StartTransactionAction transactionSeed. + * @member {string} transactionSeed + * @memberof google.spanner.executor.v1.StartTransactionAction + * @instance + */ + StartTransactionAction.prototype.transactionSeed = ""; + + /** + * StartTransactionAction executionOptions. + * @member {google.spanner.executor.v1.ITransactionExecutionOptions|null|undefined} executionOptions + * @memberof google.spanner.executor.v1.StartTransactionAction + * @instance + */ + StartTransactionAction.prototype.executionOptions = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(StartTransactionAction.prototype, "_concurrency", { + get: $util.oneOfGetter($oneOfFields = ["concurrency"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(StartTransactionAction.prototype, "_executionOptions", { + get: $util.oneOfGetter($oneOfFields = ["executionOptions"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new StartTransactionAction instance using the specified properties. + * @function create + * @memberof google.spanner.executor.v1.StartTransactionAction + * @static + * @param {google.spanner.executor.v1.IStartTransactionAction=} [properties] Properties to set + * @returns {google.spanner.executor.v1.StartTransactionAction} StartTransactionAction instance + */ + StartTransactionAction.create = function create(properties) { + return new StartTransactionAction(properties); + }; + + /** + * Encodes the specified StartTransactionAction message. Does not implicitly {@link google.spanner.executor.v1.StartTransactionAction.verify|verify} messages. + * @function encode + * @memberof google.spanner.executor.v1.StartTransactionAction + * @static + * @param {google.spanner.executor.v1.IStartTransactionAction} message StartTransactionAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartTransactionAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.concurrency != null && Object.hasOwnProperty.call(message, "concurrency")) + $root.google.spanner.executor.v1.Concurrency.encode(message.concurrency, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.table != null && message.table.length) + for (var i = 0; i < message.table.length; ++i) + $root.google.spanner.executor.v1.TableMetadata.encode(message.table[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.transactionSeed != null && Object.hasOwnProperty.call(message, "transactionSeed")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.transactionSeed); + if (message.executionOptions != null && Object.hasOwnProperty.call(message, "executionOptions")) + $root.google.spanner.executor.v1.TransactionExecutionOptions.encode(message.executionOptions, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified StartTransactionAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.StartTransactionAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.executor.v1.StartTransactionAction + * @static + * @param {google.spanner.executor.v1.IStartTransactionAction} message StartTransactionAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartTransactionAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StartTransactionAction message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.executor.v1.StartTransactionAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.executor.v1.StartTransactionAction} StartTransactionAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartTransactionAction.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.StartTransactionAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.concurrency = $root.google.spanner.executor.v1.Concurrency.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.table && message.table.length)) + message.table = []; + message.table.push($root.google.spanner.executor.v1.TableMetadata.decode(reader, reader.uint32())); + break; + } + case 3: { + message.transactionSeed = reader.string(); + break; + } + case 4: { + message.executionOptions = $root.google.spanner.executor.v1.TransactionExecutionOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StartTransactionAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.executor.v1.StartTransactionAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.executor.v1.StartTransactionAction} StartTransactionAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartTransactionAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StartTransactionAction message. + * @function verify + * @memberof google.spanner.executor.v1.StartTransactionAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StartTransactionAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.concurrency != null && message.hasOwnProperty("concurrency")) { + properties._concurrency = 1; + { + var error = $root.google.spanner.executor.v1.Concurrency.verify(message.concurrency); + if (error) + return "concurrency." + error; + } + } + if (message.table != null && message.hasOwnProperty("table")) { + if (!Array.isArray(message.table)) + return "table: array expected"; + for (var i = 0; i < message.table.length; ++i) { + var error = $root.google.spanner.executor.v1.TableMetadata.verify(message.table[i]); + if (error) + return "table." + error; + } + } + if (message.transactionSeed != null && message.hasOwnProperty("transactionSeed")) + if (!$util.isString(message.transactionSeed)) + return "transactionSeed: string expected"; + if (message.executionOptions != null && message.hasOwnProperty("executionOptions")) { + properties._executionOptions = 1; + { + var error = $root.google.spanner.executor.v1.TransactionExecutionOptions.verify(message.executionOptions); + if (error) + return "executionOptions." + error; + } + } + return null; + }; + + /** + * Creates a StartTransactionAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.executor.v1.StartTransactionAction + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.executor.v1.StartTransactionAction} StartTransactionAction + */ + StartTransactionAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.executor.v1.StartTransactionAction) + return object; + var message = new $root.google.spanner.executor.v1.StartTransactionAction(); + if (object.concurrency != null) { + if (typeof object.concurrency !== "object") + throw TypeError(".google.spanner.executor.v1.StartTransactionAction.concurrency: object expected"); + message.concurrency = $root.google.spanner.executor.v1.Concurrency.fromObject(object.concurrency); + } + if (object.table) { + if (!Array.isArray(object.table)) + throw TypeError(".google.spanner.executor.v1.StartTransactionAction.table: array expected"); + message.table = []; + for (var i = 0; i < object.table.length; ++i) { + if (typeof object.table[i] !== "object") + throw TypeError(".google.spanner.executor.v1.StartTransactionAction.table: object expected"); + message.table[i] = $root.google.spanner.executor.v1.TableMetadata.fromObject(object.table[i]); + } + } + if (object.transactionSeed != null) + message.transactionSeed = String(object.transactionSeed); + if (object.executionOptions != null) { + if (typeof object.executionOptions !== "object") + throw TypeError(".google.spanner.executor.v1.StartTransactionAction.executionOptions: object expected"); + message.executionOptions = $root.google.spanner.executor.v1.TransactionExecutionOptions.fromObject(object.executionOptions); + } + return message; + }; + + /** + * Creates a plain object from a StartTransactionAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.executor.v1.StartTransactionAction + * @static + * @param {google.spanner.executor.v1.StartTransactionAction} message StartTransactionAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StartTransactionAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.table = []; + if (options.defaults) + object.transactionSeed = ""; + if (message.concurrency != null && message.hasOwnProperty("concurrency")) { + object.concurrency = $root.google.spanner.executor.v1.Concurrency.toObject(message.concurrency, options); + if (options.oneofs) + object._concurrency = "concurrency"; + } + if (message.table && message.table.length) { + object.table = []; + for (var j = 0; j < message.table.length; ++j) + object.table[j] = $root.google.spanner.executor.v1.TableMetadata.toObject(message.table[j], options); + } + if (message.transactionSeed != null && message.hasOwnProperty("transactionSeed")) + object.transactionSeed = message.transactionSeed; + if (message.executionOptions != null && message.hasOwnProperty("executionOptions")) { + object.executionOptions = $root.google.spanner.executor.v1.TransactionExecutionOptions.toObject(message.executionOptions, options); + if (options.oneofs) + object._executionOptions = "executionOptions"; + } + return object; + }; + + /** + * Converts this StartTransactionAction to JSON. + * @function toJSON + * @memberof google.spanner.executor.v1.StartTransactionAction + * @instance + * @returns {Object.} JSON object + */ + StartTransactionAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StartTransactionAction + * @function getTypeUrl + * @memberof google.spanner.executor.v1.StartTransactionAction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StartTransactionAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.executor.v1.StartTransactionAction"; + }; + + return StartTransactionAction; + })(); + + v1.Concurrency = (function() { + + /** + * Properties of a Concurrency. + * @memberof google.spanner.executor.v1 + * @interface IConcurrency + * @property {number|null} [stalenessSeconds] Concurrency stalenessSeconds + * @property {number|Long|null} [minReadTimestampMicros] Concurrency minReadTimestampMicros + * @property {number|null} [maxStalenessSeconds] Concurrency maxStalenessSeconds + * @property {number|Long|null} [exactTimestampMicros] Concurrency exactTimestampMicros + * @property {boolean|null} [strong] Concurrency strong + * @property {boolean|null} [batch] Concurrency batch + * @property {boolean|null} [snapshotEpochRead] Concurrency snapshotEpochRead + * @property {string|null} [snapshotEpochRootTable] Concurrency snapshotEpochRootTable + * @property {number|Long|null} [batchReadTimestampMicros] Concurrency batchReadTimestampMicros + */ + + /** + * Constructs a new Concurrency. + * @memberof google.spanner.executor.v1 + * @classdesc Represents a Concurrency. + * @implements IConcurrency + * @constructor + * @param {google.spanner.executor.v1.IConcurrency=} [properties] Properties to set + */ + function Concurrency(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Concurrency stalenessSeconds. + * @member {number|null|undefined} stalenessSeconds + * @memberof google.spanner.executor.v1.Concurrency + * @instance + */ + Concurrency.prototype.stalenessSeconds = null; + + /** + * Concurrency minReadTimestampMicros. + * @member {number|Long|null|undefined} minReadTimestampMicros + * @memberof google.spanner.executor.v1.Concurrency + * @instance + */ + Concurrency.prototype.minReadTimestampMicros = null; + + /** + * Concurrency maxStalenessSeconds. + * @member {number|null|undefined} maxStalenessSeconds + * @memberof google.spanner.executor.v1.Concurrency + * @instance + */ + Concurrency.prototype.maxStalenessSeconds = null; + + /** + * Concurrency exactTimestampMicros. + * @member {number|Long|null|undefined} exactTimestampMicros + * @memberof google.spanner.executor.v1.Concurrency + * @instance + */ + Concurrency.prototype.exactTimestampMicros = null; + + /** + * Concurrency strong. + * @member {boolean|null|undefined} strong + * @memberof google.spanner.executor.v1.Concurrency + * @instance + */ + Concurrency.prototype.strong = null; + + /** + * Concurrency batch. + * @member {boolean|null|undefined} batch + * @memberof google.spanner.executor.v1.Concurrency + * @instance + */ + Concurrency.prototype.batch = null; + + /** + * Concurrency snapshotEpochRead. + * @member {boolean} snapshotEpochRead + * @memberof google.spanner.executor.v1.Concurrency + * @instance + */ + Concurrency.prototype.snapshotEpochRead = false; + + /** + * Concurrency snapshotEpochRootTable. + * @member {string} snapshotEpochRootTable + * @memberof google.spanner.executor.v1.Concurrency + * @instance + */ + Concurrency.prototype.snapshotEpochRootTable = ""; + + /** + * Concurrency batchReadTimestampMicros. + * @member {number|Long} batchReadTimestampMicros + * @memberof google.spanner.executor.v1.Concurrency + * @instance + */ + Concurrency.prototype.batchReadTimestampMicros = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Concurrency concurrencyMode. + * @member {"stalenessSeconds"|"minReadTimestampMicros"|"maxStalenessSeconds"|"exactTimestampMicros"|"strong"|"batch"|undefined} concurrencyMode + * @memberof google.spanner.executor.v1.Concurrency + * @instance + */ + Object.defineProperty(Concurrency.prototype, "concurrencyMode", { + get: $util.oneOfGetter($oneOfFields = ["stalenessSeconds", "minReadTimestampMicros", "maxStalenessSeconds", "exactTimestampMicros", "strong", "batch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Concurrency instance using the specified properties. + * @function create + * @memberof google.spanner.executor.v1.Concurrency + * @static + * @param {google.spanner.executor.v1.IConcurrency=} [properties] Properties to set + * @returns {google.spanner.executor.v1.Concurrency} Concurrency instance + */ + Concurrency.create = function create(properties) { + return new Concurrency(properties); + }; + + /** + * Encodes the specified Concurrency message. Does not implicitly {@link google.spanner.executor.v1.Concurrency.verify|verify} messages. + * @function encode + * @memberof google.spanner.executor.v1.Concurrency + * @static + * @param {google.spanner.executor.v1.IConcurrency} message Concurrency message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Concurrency.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.stalenessSeconds != null && Object.hasOwnProperty.call(message, "stalenessSeconds")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.stalenessSeconds); + if (message.minReadTimestampMicros != null && Object.hasOwnProperty.call(message, "minReadTimestampMicros")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.minReadTimestampMicros); + if (message.maxStalenessSeconds != null && Object.hasOwnProperty.call(message, "maxStalenessSeconds")) + writer.uint32(/* id 3, wireType 1 =*/25).double(message.maxStalenessSeconds); + if (message.exactTimestampMicros != null && Object.hasOwnProperty.call(message, "exactTimestampMicros")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.exactTimestampMicros); + if (message.strong != null && Object.hasOwnProperty.call(message, "strong")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.strong); + if (message.batch != null && Object.hasOwnProperty.call(message, "batch")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.batch); + if (message.snapshotEpochRead != null && Object.hasOwnProperty.call(message, "snapshotEpochRead")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.snapshotEpochRead); + if (message.snapshotEpochRootTable != null && Object.hasOwnProperty.call(message, "snapshotEpochRootTable")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.snapshotEpochRootTable); + if (message.batchReadTimestampMicros != null && Object.hasOwnProperty.call(message, "batchReadTimestampMicros")) + writer.uint32(/* id 9, wireType 0 =*/72).int64(message.batchReadTimestampMicros); + return writer; + }; + + /** + * Encodes the specified Concurrency message, length delimited. Does not implicitly {@link google.spanner.executor.v1.Concurrency.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.executor.v1.Concurrency + * @static + * @param {google.spanner.executor.v1.IConcurrency} message Concurrency message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Concurrency.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Concurrency message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.executor.v1.Concurrency + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.executor.v1.Concurrency} Concurrency + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Concurrency.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.Concurrency(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.stalenessSeconds = reader.double(); + break; + } + case 2: { + message.minReadTimestampMicros = reader.int64(); + break; + } + case 3: { + message.maxStalenessSeconds = reader.double(); + break; + } + case 4: { + message.exactTimestampMicros = reader.int64(); + break; + } + case 5: { + message.strong = reader.bool(); + break; + } + case 6: { + message.batch = reader.bool(); + break; + } + case 7: { + message.snapshotEpochRead = reader.bool(); + break; + } + case 8: { + message.snapshotEpochRootTable = reader.string(); + break; + } + case 9: { + message.batchReadTimestampMicros = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Concurrency message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.executor.v1.Concurrency + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.executor.v1.Concurrency} Concurrency + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Concurrency.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Concurrency message. + * @function verify + * @memberof google.spanner.executor.v1.Concurrency + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Concurrency.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.stalenessSeconds != null && message.hasOwnProperty("stalenessSeconds")) { + properties.concurrencyMode = 1; + if (typeof message.stalenessSeconds !== "number") + return "stalenessSeconds: number expected"; + } + if (message.minReadTimestampMicros != null && message.hasOwnProperty("minReadTimestampMicros")) { + if (properties.concurrencyMode === 1) + return "concurrencyMode: multiple values"; + properties.concurrencyMode = 1; + if (!$util.isInteger(message.minReadTimestampMicros) && !(message.minReadTimestampMicros && $util.isInteger(message.minReadTimestampMicros.low) && $util.isInteger(message.minReadTimestampMicros.high))) + return "minReadTimestampMicros: integer|Long expected"; + } + if (message.maxStalenessSeconds != null && message.hasOwnProperty("maxStalenessSeconds")) { + if (properties.concurrencyMode === 1) + return "concurrencyMode: multiple values"; + properties.concurrencyMode = 1; + if (typeof message.maxStalenessSeconds !== "number") + return "maxStalenessSeconds: number expected"; + } + if (message.exactTimestampMicros != null && message.hasOwnProperty("exactTimestampMicros")) { + if (properties.concurrencyMode === 1) + return "concurrencyMode: multiple values"; + properties.concurrencyMode = 1; + if (!$util.isInteger(message.exactTimestampMicros) && !(message.exactTimestampMicros && $util.isInteger(message.exactTimestampMicros.low) && $util.isInteger(message.exactTimestampMicros.high))) + return "exactTimestampMicros: integer|Long expected"; + } + if (message.strong != null && message.hasOwnProperty("strong")) { + if (properties.concurrencyMode === 1) + return "concurrencyMode: multiple values"; + properties.concurrencyMode = 1; + if (typeof message.strong !== "boolean") + return "strong: boolean expected"; + } + if (message.batch != null && message.hasOwnProperty("batch")) { + if (properties.concurrencyMode === 1) + return "concurrencyMode: multiple values"; + properties.concurrencyMode = 1; + if (typeof message.batch !== "boolean") + return "batch: boolean expected"; + } + if (message.snapshotEpochRead != null && message.hasOwnProperty("snapshotEpochRead")) + if (typeof message.snapshotEpochRead !== "boolean") + return "snapshotEpochRead: boolean expected"; + if (message.snapshotEpochRootTable != null && message.hasOwnProperty("snapshotEpochRootTable")) + if (!$util.isString(message.snapshotEpochRootTable)) + return "snapshotEpochRootTable: string expected"; + if (message.batchReadTimestampMicros != null && message.hasOwnProperty("batchReadTimestampMicros")) + if (!$util.isInteger(message.batchReadTimestampMicros) && !(message.batchReadTimestampMicros && $util.isInteger(message.batchReadTimestampMicros.low) && $util.isInteger(message.batchReadTimestampMicros.high))) + return "batchReadTimestampMicros: integer|Long expected"; + return null; + }; + + /** + * Creates a Concurrency message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.executor.v1.Concurrency + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.executor.v1.Concurrency} Concurrency + */ + Concurrency.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.executor.v1.Concurrency) + return object; + var message = new $root.google.spanner.executor.v1.Concurrency(); + if (object.stalenessSeconds != null) + message.stalenessSeconds = Number(object.stalenessSeconds); + if (object.minReadTimestampMicros != null) + if ($util.Long) + (message.minReadTimestampMicros = $util.Long.fromValue(object.minReadTimestampMicros)).unsigned = false; + else if (typeof object.minReadTimestampMicros === "string") + message.minReadTimestampMicros = parseInt(object.minReadTimestampMicros, 10); + else if (typeof object.minReadTimestampMicros === "number") + message.minReadTimestampMicros = object.minReadTimestampMicros; + else if (typeof object.minReadTimestampMicros === "object") + message.minReadTimestampMicros = new $util.LongBits(object.minReadTimestampMicros.low >>> 0, object.minReadTimestampMicros.high >>> 0).toNumber(); + if (object.maxStalenessSeconds != null) + message.maxStalenessSeconds = Number(object.maxStalenessSeconds); + if (object.exactTimestampMicros != null) + if ($util.Long) + (message.exactTimestampMicros = $util.Long.fromValue(object.exactTimestampMicros)).unsigned = false; + else if (typeof object.exactTimestampMicros === "string") + message.exactTimestampMicros = parseInt(object.exactTimestampMicros, 10); + else if (typeof object.exactTimestampMicros === "number") + message.exactTimestampMicros = object.exactTimestampMicros; + else if (typeof object.exactTimestampMicros === "object") + message.exactTimestampMicros = new $util.LongBits(object.exactTimestampMicros.low >>> 0, object.exactTimestampMicros.high >>> 0).toNumber(); + if (object.strong != null) + message.strong = Boolean(object.strong); + if (object.batch != null) + message.batch = Boolean(object.batch); + if (object.snapshotEpochRead != null) + message.snapshotEpochRead = Boolean(object.snapshotEpochRead); + if (object.snapshotEpochRootTable != null) + message.snapshotEpochRootTable = String(object.snapshotEpochRootTable); + if (object.batchReadTimestampMicros != null) + if ($util.Long) + (message.batchReadTimestampMicros = $util.Long.fromValue(object.batchReadTimestampMicros)).unsigned = false; + else if (typeof object.batchReadTimestampMicros === "string") + message.batchReadTimestampMicros = parseInt(object.batchReadTimestampMicros, 10); + else if (typeof object.batchReadTimestampMicros === "number") + message.batchReadTimestampMicros = object.batchReadTimestampMicros; + else if (typeof object.batchReadTimestampMicros === "object") + message.batchReadTimestampMicros = new $util.LongBits(object.batchReadTimestampMicros.low >>> 0, object.batchReadTimestampMicros.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a Concurrency message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.executor.v1.Concurrency + * @static + * @param {google.spanner.executor.v1.Concurrency} message Concurrency + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Concurrency.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.snapshotEpochRead = false; + object.snapshotEpochRootTable = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.batchReadTimestampMicros = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.batchReadTimestampMicros = options.longs === String ? "0" : 0; + } + if (message.stalenessSeconds != null && message.hasOwnProperty("stalenessSeconds")) { + object.stalenessSeconds = options.json && !isFinite(message.stalenessSeconds) ? String(message.stalenessSeconds) : message.stalenessSeconds; + if (options.oneofs) + object.concurrencyMode = "stalenessSeconds"; + } + if (message.minReadTimestampMicros != null && message.hasOwnProperty("minReadTimestampMicros")) { + if (typeof message.minReadTimestampMicros === "number") + object.minReadTimestampMicros = options.longs === String ? String(message.minReadTimestampMicros) : message.minReadTimestampMicros; + else + object.minReadTimestampMicros = options.longs === String ? $util.Long.prototype.toString.call(message.minReadTimestampMicros) : options.longs === Number ? new $util.LongBits(message.minReadTimestampMicros.low >>> 0, message.minReadTimestampMicros.high >>> 0).toNumber() : message.minReadTimestampMicros; + if (options.oneofs) + object.concurrencyMode = "minReadTimestampMicros"; + } + if (message.maxStalenessSeconds != null && message.hasOwnProperty("maxStalenessSeconds")) { + object.maxStalenessSeconds = options.json && !isFinite(message.maxStalenessSeconds) ? String(message.maxStalenessSeconds) : message.maxStalenessSeconds; + if (options.oneofs) + object.concurrencyMode = "maxStalenessSeconds"; + } + if (message.exactTimestampMicros != null && message.hasOwnProperty("exactTimestampMicros")) { + if (typeof message.exactTimestampMicros === "number") + object.exactTimestampMicros = options.longs === String ? String(message.exactTimestampMicros) : message.exactTimestampMicros; + else + object.exactTimestampMicros = options.longs === String ? $util.Long.prototype.toString.call(message.exactTimestampMicros) : options.longs === Number ? new $util.LongBits(message.exactTimestampMicros.low >>> 0, message.exactTimestampMicros.high >>> 0).toNumber() : message.exactTimestampMicros; + if (options.oneofs) + object.concurrencyMode = "exactTimestampMicros"; + } + if (message.strong != null && message.hasOwnProperty("strong")) { + object.strong = message.strong; + if (options.oneofs) + object.concurrencyMode = "strong"; + } + if (message.batch != null && message.hasOwnProperty("batch")) { + object.batch = message.batch; + if (options.oneofs) + object.concurrencyMode = "batch"; + } + if (message.snapshotEpochRead != null && message.hasOwnProperty("snapshotEpochRead")) + object.snapshotEpochRead = message.snapshotEpochRead; + if (message.snapshotEpochRootTable != null && message.hasOwnProperty("snapshotEpochRootTable")) + object.snapshotEpochRootTable = message.snapshotEpochRootTable; + if (message.batchReadTimestampMicros != null && message.hasOwnProperty("batchReadTimestampMicros")) + if (typeof message.batchReadTimestampMicros === "number") + object.batchReadTimestampMicros = options.longs === String ? String(message.batchReadTimestampMicros) : message.batchReadTimestampMicros; + else + object.batchReadTimestampMicros = options.longs === String ? $util.Long.prototype.toString.call(message.batchReadTimestampMicros) : options.longs === Number ? new $util.LongBits(message.batchReadTimestampMicros.low >>> 0, message.batchReadTimestampMicros.high >>> 0).toNumber() : message.batchReadTimestampMicros; + return object; + }; + + /** + * Converts this Concurrency to JSON. + * @function toJSON + * @memberof google.spanner.executor.v1.Concurrency + * @instance + * @returns {Object.} JSON object + */ + Concurrency.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Concurrency + * @function getTypeUrl + * @memberof google.spanner.executor.v1.Concurrency + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Concurrency.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.executor.v1.Concurrency"; + }; + + return Concurrency; + })(); + + v1.TableMetadata = (function() { + + /** + * Properties of a TableMetadata. + * @memberof google.spanner.executor.v1 + * @interface ITableMetadata + * @property {string|null} [name] TableMetadata name + * @property {Array.|null} [column] TableMetadata column + * @property {Array.|null} [keyColumn] TableMetadata keyColumn + */ + + /** + * Constructs a new TableMetadata. + * @memberof google.spanner.executor.v1 + * @classdesc Represents a TableMetadata. + * @implements ITableMetadata + * @constructor + * @param {google.spanner.executor.v1.ITableMetadata=} [properties] Properties to set + */ + function TableMetadata(properties) { + this.column = []; + this.keyColumn = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TableMetadata name. + * @member {string} name + * @memberof google.spanner.executor.v1.TableMetadata + * @instance + */ + TableMetadata.prototype.name = ""; + + /** + * TableMetadata column. + * @member {Array.} column + * @memberof google.spanner.executor.v1.TableMetadata + * @instance + */ + TableMetadata.prototype.column = $util.emptyArray; + + /** + * TableMetadata keyColumn. + * @member {Array.} keyColumn + * @memberof google.spanner.executor.v1.TableMetadata + * @instance + */ + TableMetadata.prototype.keyColumn = $util.emptyArray; + + /** + * Creates a new TableMetadata instance using the specified properties. + * @function create + * @memberof google.spanner.executor.v1.TableMetadata + * @static + * @param {google.spanner.executor.v1.ITableMetadata=} [properties] Properties to set + * @returns {google.spanner.executor.v1.TableMetadata} TableMetadata instance + */ + TableMetadata.create = function create(properties) { + return new TableMetadata(properties); + }; + + /** + * Encodes the specified TableMetadata message. Does not implicitly {@link google.spanner.executor.v1.TableMetadata.verify|verify} messages. + * @function encode + * @memberof google.spanner.executor.v1.TableMetadata + * @static + * @param {google.spanner.executor.v1.ITableMetadata} message TableMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TableMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.column != null && message.column.length) + for (var i = 0; i < message.column.length; ++i) + $root.google.spanner.executor.v1.ColumnMetadata.encode(message.column[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.keyColumn != null && message.keyColumn.length) + for (var i = 0; i < message.keyColumn.length; ++i) + $root.google.spanner.executor.v1.ColumnMetadata.encode(message.keyColumn[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TableMetadata message, length delimited. Does not implicitly {@link google.spanner.executor.v1.TableMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.executor.v1.TableMetadata + * @static + * @param {google.spanner.executor.v1.ITableMetadata} message TableMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TableMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TableMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.executor.v1.TableMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.executor.v1.TableMetadata} TableMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TableMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.TableMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.column && message.column.length)) + message.column = []; + message.column.push($root.google.spanner.executor.v1.ColumnMetadata.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.keyColumn && message.keyColumn.length)) + message.keyColumn = []; + message.keyColumn.push($root.google.spanner.executor.v1.ColumnMetadata.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TableMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.executor.v1.TableMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.executor.v1.TableMetadata} TableMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TableMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TableMetadata message. + * @function verify + * @memberof google.spanner.executor.v1.TableMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TableMetadata.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.column != null && message.hasOwnProperty("column")) { + if (!Array.isArray(message.column)) + return "column: array expected"; + for (var i = 0; i < message.column.length; ++i) { + var error = $root.google.spanner.executor.v1.ColumnMetadata.verify(message.column[i]); + if (error) + return "column." + error; + } + } + if (message.keyColumn != null && message.hasOwnProperty("keyColumn")) { + if (!Array.isArray(message.keyColumn)) + return "keyColumn: array expected"; + for (var i = 0; i < message.keyColumn.length; ++i) { + var error = $root.google.spanner.executor.v1.ColumnMetadata.verify(message.keyColumn[i]); + if (error) + return "keyColumn." + error; + } + } + return null; + }; + + /** + * Creates a TableMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.executor.v1.TableMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.executor.v1.TableMetadata} TableMetadata + */ + TableMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.executor.v1.TableMetadata) + return object; + var message = new $root.google.spanner.executor.v1.TableMetadata(); + if (object.name != null) + message.name = String(object.name); + if (object.column) { + if (!Array.isArray(object.column)) + throw TypeError(".google.spanner.executor.v1.TableMetadata.column: array expected"); + message.column = []; + for (var i = 0; i < object.column.length; ++i) { + if (typeof object.column[i] !== "object") + throw TypeError(".google.spanner.executor.v1.TableMetadata.column: object expected"); + message.column[i] = $root.google.spanner.executor.v1.ColumnMetadata.fromObject(object.column[i]); + } + } + if (object.keyColumn) { + if (!Array.isArray(object.keyColumn)) + throw TypeError(".google.spanner.executor.v1.TableMetadata.keyColumn: array expected"); + message.keyColumn = []; + for (var i = 0; i < object.keyColumn.length; ++i) { + if (typeof object.keyColumn[i] !== "object") + throw TypeError(".google.spanner.executor.v1.TableMetadata.keyColumn: object expected"); + message.keyColumn[i] = $root.google.spanner.executor.v1.ColumnMetadata.fromObject(object.keyColumn[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a TableMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.executor.v1.TableMetadata + * @static + * @param {google.spanner.executor.v1.TableMetadata} message TableMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TableMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.column = []; + object.keyColumn = []; + } + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.column && message.column.length) { + object.column = []; + for (var j = 0; j < message.column.length; ++j) + object.column[j] = $root.google.spanner.executor.v1.ColumnMetadata.toObject(message.column[j], options); + } + if (message.keyColumn && message.keyColumn.length) { + object.keyColumn = []; + for (var j = 0; j < message.keyColumn.length; ++j) + object.keyColumn[j] = $root.google.spanner.executor.v1.ColumnMetadata.toObject(message.keyColumn[j], options); + } + return object; + }; + + /** + * Converts this TableMetadata to JSON. + * @function toJSON + * @memberof google.spanner.executor.v1.TableMetadata + * @instance + * @returns {Object.} JSON object + */ + TableMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TableMetadata + * @function getTypeUrl + * @memberof google.spanner.executor.v1.TableMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TableMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.executor.v1.TableMetadata"; + }; + + return TableMetadata; + })(); + + v1.ColumnMetadata = (function() { + + /** + * Properties of a ColumnMetadata. + * @memberof google.spanner.executor.v1 + * @interface IColumnMetadata + * @property {string|null} [name] ColumnMetadata name + * @property {google.spanner.v1.IType|null} [type] ColumnMetadata type + */ + + /** + * Constructs a new ColumnMetadata. + * @memberof google.spanner.executor.v1 + * @classdesc Represents a ColumnMetadata. + * @implements IColumnMetadata + * @constructor + * @param {google.spanner.executor.v1.IColumnMetadata=} [properties] Properties to set + */ + function ColumnMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ColumnMetadata name. + * @member {string} name + * @memberof google.spanner.executor.v1.ColumnMetadata + * @instance + */ + ColumnMetadata.prototype.name = ""; + + /** + * ColumnMetadata type. + * @member {google.spanner.v1.IType|null|undefined} type + * @memberof google.spanner.executor.v1.ColumnMetadata + * @instance + */ + ColumnMetadata.prototype.type = null; + + /** + * Creates a new ColumnMetadata instance using the specified properties. + * @function create + * @memberof google.spanner.executor.v1.ColumnMetadata + * @static + * @param {google.spanner.executor.v1.IColumnMetadata=} [properties] Properties to set + * @returns {google.spanner.executor.v1.ColumnMetadata} ColumnMetadata instance + */ + ColumnMetadata.create = function create(properties) { + return new ColumnMetadata(properties); + }; + + /** + * Encodes the specified ColumnMetadata message. Does not implicitly {@link google.spanner.executor.v1.ColumnMetadata.verify|verify} messages. + * @function encode + * @memberof google.spanner.executor.v1.ColumnMetadata + * @static + * @param {google.spanner.executor.v1.IColumnMetadata} message ColumnMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ColumnMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + $root.google.spanner.v1.Type.encode(message.type, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ColumnMetadata message, length delimited. Does not implicitly {@link google.spanner.executor.v1.ColumnMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.executor.v1.ColumnMetadata + * @static + * @param {google.spanner.executor.v1.IColumnMetadata} message ColumnMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ColumnMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ColumnMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.executor.v1.ColumnMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.executor.v1.ColumnMetadata} ColumnMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ColumnMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.ColumnMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.type = $root.google.spanner.v1.Type.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ColumnMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.executor.v1.ColumnMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.executor.v1.ColumnMetadata} ColumnMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ColumnMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ColumnMetadata message. + * @function verify + * @memberof google.spanner.executor.v1.ColumnMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ColumnMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.type != null && message.hasOwnProperty("type")) { + var error = $root.google.spanner.v1.Type.verify(message.type); + if (error) + return "type." + error; + } + return null; + }; + + /** + * Creates a ColumnMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.executor.v1.ColumnMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.executor.v1.ColumnMetadata} ColumnMetadata + */ + ColumnMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.executor.v1.ColumnMetadata) + return object; + var message = new $root.google.spanner.executor.v1.ColumnMetadata(); + if (object.name != null) + message.name = String(object.name); + if (object.type != null) { + if (typeof object.type !== "object") + throw TypeError(".google.spanner.executor.v1.ColumnMetadata.type: object expected"); + message.type = $root.google.spanner.v1.Type.fromObject(object.type); + } + return message; + }; + + /** + * Creates a plain object from a ColumnMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.executor.v1.ColumnMetadata + * @static + * @param {google.spanner.executor.v1.ColumnMetadata} message ColumnMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ColumnMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.type = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.type != null && message.hasOwnProperty("type")) + object.type = $root.google.spanner.v1.Type.toObject(message.type, options); + return object; + }; + + /** + * Converts this ColumnMetadata to JSON. + * @function toJSON + * @memberof google.spanner.executor.v1.ColumnMetadata + * @instance + * @returns {Object.} JSON object + */ + ColumnMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ColumnMetadata + * @function getTypeUrl + * @memberof google.spanner.executor.v1.ColumnMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ColumnMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.executor.v1.ColumnMetadata"; + }; + + return ColumnMetadata; + })(); + + v1.TransactionExecutionOptions = (function() { + + /** + * Properties of a TransactionExecutionOptions. + * @memberof google.spanner.executor.v1 + * @interface ITransactionExecutionOptions + * @property {boolean|null} [optimistic] TransactionExecutionOptions optimistic + */ + + /** + * Constructs a new TransactionExecutionOptions. + * @memberof google.spanner.executor.v1 + * @classdesc Represents a TransactionExecutionOptions. + * @implements ITransactionExecutionOptions + * @constructor + * @param {google.spanner.executor.v1.ITransactionExecutionOptions=} [properties] Properties to set + */ + function TransactionExecutionOptions(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TransactionExecutionOptions optimistic. + * @member {boolean} optimistic + * @memberof google.spanner.executor.v1.TransactionExecutionOptions + * @instance + */ + TransactionExecutionOptions.prototype.optimistic = false; + + /** + * Creates a new TransactionExecutionOptions instance using the specified properties. + * @function create + * @memberof google.spanner.executor.v1.TransactionExecutionOptions + * @static + * @param {google.spanner.executor.v1.ITransactionExecutionOptions=} [properties] Properties to set + * @returns {google.spanner.executor.v1.TransactionExecutionOptions} TransactionExecutionOptions instance + */ + TransactionExecutionOptions.create = function create(properties) { + return new TransactionExecutionOptions(properties); + }; + + /** + * Encodes the specified TransactionExecutionOptions message. Does not implicitly {@link google.spanner.executor.v1.TransactionExecutionOptions.verify|verify} messages. + * @function encode + * @memberof google.spanner.executor.v1.TransactionExecutionOptions + * @static + * @param {google.spanner.executor.v1.ITransactionExecutionOptions} message TransactionExecutionOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionExecutionOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.optimistic != null && Object.hasOwnProperty.call(message, "optimistic")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.optimistic); + return writer; + }; + + /** + * Encodes the specified TransactionExecutionOptions message, length delimited. Does not implicitly {@link google.spanner.executor.v1.TransactionExecutionOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.executor.v1.TransactionExecutionOptions + * @static + * @param {google.spanner.executor.v1.ITransactionExecutionOptions} message TransactionExecutionOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionExecutionOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TransactionExecutionOptions message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.executor.v1.TransactionExecutionOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.executor.v1.TransactionExecutionOptions} TransactionExecutionOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionExecutionOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.TransactionExecutionOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.optimistic = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TransactionExecutionOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.executor.v1.TransactionExecutionOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.executor.v1.TransactionExecutionOptions} TransactionExecutionOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionExecutionOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TransactionExecutionOptions message. + * @function verify + * @memberof google.spanner.executor.v1.TransactionExecutionOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TransactionExecutionOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.optimistic != null && message.hasOwnProperty("optimistic")) + if (typeof message.optimistic !== "boolean") + return "optimistic: boolean expected"; + return null; + }; + + /** + * Creates a TransactionExecutionOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.executor.v1.TransactionExecutionOptions + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.executor.v1.TransactionExecutionOptions} TransactionExecutionOptions + */ + TransactionExecutionOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.executor.v1.TransactionExecutionOptions) + return object; + var message = new $root.google.spanner.executor.v1.TransactionExecutionOptions(); + if (object.optimistic != null) + message.optimistic = Boolean(object.optimistic); + return message; + }; + + /** + * Creates a plain object from a TransactionExecutionOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.executor.v1.TransactionExecutionOptions + * @static + * @param {google.spanner.executor.v1.TransactionExecutionOptions} message TransactionExecutionOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TransactionExecutionOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.optimistic = false; + if (message.optimistic != null && message.hasOwnProperty("optimistic")) + object.optimistic = message.optimistic; + return object; + }; + + /** + * Converts this TransactionExecutionOptions to JSON. + * @function toJSON + * @memberof google.spanner.executor.v1.TransactionExecutionOptions + * @instance + * @returns {Object.} JSON object + */ + TransactionExecutionOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TransactionExecutionOptions + * @function getTypeUrl + * @memberof google.spanner.executor.v1.TransactionExecutionOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionExecutionOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.executor.v1.TransactionExecutionOptions"; + }; + + return TransactionExecutionOptions; + })(); + + v1.FinishTransactionAction = (function() { + + /** + * Properties of a FinishTransactionAction. + * @memberof google.spanner.executor.v1 + * @interface IFinishTransactionAction + * @property {google.spanner.executor.v1.FinishTransactionAction.Mode|null} [mode] FinishTransactionAction mode + */ + + /** + * Constructs a new FinishTransactionAction. + * @memberof google.spanner.executor.v1 + * @classdesc Represents a FinishTransactionAction. + * @implements IFinishTransactionAction + * @constructor + * @param {google.spanner.executor.v1.IFinishTransactionAction=} [properties] Properties to set + */ + function FinishTransactionAction(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FinishTransactionAction mode. + * @member {google.spanner.executor.v1.FinishTransactionAction.Mode} mode + * @memberof google.spanner.executor.v1.FinishTransactionAction + * @instance + */ + FinishTransactionAction.prototype.mode = 0; + + /** + * Creates a new FinishTransactionAction instance using the specified properties. + * @function create + * @memberof google.spanner.executor.v1.FinishTransactionAction + * @static + * @param {google.spanner.executor.v1.IFinishTransactionAction=} [properties] Properties to set + * @returns {google.spanner.executor.v1.FinishTransactionAction} FinishTransactionAction instance + */ + FinishTransactionAction.create = function create(properties) { + return new FinishTransactionAction(properties); + }; + + /** + * Encodes the specified FinishTransactionAction message. Does not implicitly {@link google.spanner.executor.v1.FinishTransactionAction.verify|verify} messages. + * @function encode + * @memberof google.spanner.executor.v1.FinishTransactionAction + * @static + * @param {google.spanner.executor.v1.IFinishTransactionAction} message FinishTransactionAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FinishTransactionAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mode != null && Object.hasOwnProperty.call(message, "mode")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.mode); + return writer; + }; + + /** + * Encodes the specified FinishTransactionAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.FinishTransactionAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.executor.v1.FinishTransactionAction + * @static + * @param {google.spanner.executor.v1.IFinishTransactionAction} message FinishTransactionAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FinishTransactionAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FinishTransactionAction message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.executor.v1.FinishTransactionAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.executor.v1.FinishTransactionAction} FinishTransactionAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FinishTransactionAction.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.FinishTransactionAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.mode = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FinishTransactionAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.executor.v1.FinishTransactionAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.executor.v1.FinishTransactionAction} FinishTransactionAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FinishTransactionAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FinishTransactionAction message. + * @function verify + * @memberof google.spanner.executor.v1.FinishTransactionAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FinishTransactionAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.mode != null && message.hasOwnProperty("mode")) + switch (message.mode) { + default: + return "mode: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a FinishTransactionAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.executor.v1.FinishTransactionAction + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.executor.v1.FinishTransactionAction} FinishTransactionAction + */ + FinishTransactionAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.executor.v1.FinishTransactionAction) + return object; + var message = new $root.google.spanner.executor.v1.FinishTransactionAction(); + switch (object.mode) { + default: + if (typeof object.mode === "number") { + message.mode = object.mode; + break; + } + break; + case "MODE_UNSPECIFIED": + case 0: + message.mode = 0; + break; + case "COMMIT": + case 1: + message.mode = 1; + break; + case "ABANDON": + case 2: + message.mode = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a FinishTransactionAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.executor.v1.FinishTransactionAction + * @static + * @param {google.spanner.executor.v1.FinishTransactionAction} message FinishTransactionAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FinishTransactionAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.mode = options.enums === String ? "MODE_UNSPECIFIED" : 0; + if (message.mode != null && message.hasOwnProperty("mode")) + object.mode = options.enums === String ? $root.google.spanner.executor.v1.FinishTransactionAction.Mode[message.mode] === undefined ? message.mode : $root.google.spanner.executor.v1.FinishTransactionAction.Mode[message.mode] : message.mode; + return object; + }; + + /** + * Converts this FinishTransactionAction to JSON. + * @function toJSON + * @memberof google.spanner.executor.v1.FinishTransactionAction + * @instance + * @returns {Object.} JSON object + */ + FinishTransactionAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FinishTransactionAction + * @function getTypeUrl + * @memberof google.spanner.executor.v1.FinishTransactionAction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FinishTransactionAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.executor.v1.FinishTransactionAction"; + }; + + /** + * Mode enum. + * @name google.spanner.executor.v1.FinishTransactionAction.Mode + * @enum {number} + * @property {number} MODE_UNSPECIFIED=0 MODE_UNSPECIFIED value + * @property {number} COMMIT=1 COMMIT value + * @property {number} ABANDON=2 ABANDON value + */ + FinishTransactionAction.Mode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "COMMIT"] = 1; + values[valuesById[2] = "ABANDON"] = 2; + return values; + })(); + + return FinishTransactionAction; + })(); + + v1.AdminAction = (function() { + + /** + * Properties of an AdminAction. + * @memberof google.spanner.executor.v1 + * @interface IAdminAction + * @property {google.spanner.executor.v1.ICreateUserInstanceConfigAction|null} [createUserInstanceConfig] AdminAction createUserInstanceConfig + * @property {google.spanner.executor.v1.IUpdateUserInstanceConfigAction|null} [updateUserInstanceConfig] AdminAction updateUserInstanceConfig + * @property {google.spanner.executor.v1.IDeleteUserInstanceConfigAction|null} [deleteUserInstanceConfig] AdminAction deleteUserInstanceConfig + * @property {google.spanner.executor.v1.IGetCloudInstanceConfigAction|null} [getCloudInstanceConfig] AdminAction getCloudInstanceConfig + * @property {google.spanner.executor.v1.IListCloudInstanceConfigsAction|null} [listInstanceConfigs] AdminAction listInstanceConfigs + * @property {google.spanner.executor.v1.ICreateCloudInstanceAction|null} [createCloudInstance] AdminAction createCloudInstance + * @property {google.spanner.executor.v1.IUpdateCloudInstanceAction|null} [updateCloudInstance] AdminAction updateCloudInstance + * @property {google.spanner.executor.v1.IDeleteCloudInstanceAction|null} [deleteCloudInstance] AdminAction deleteCloudInstance + * @property {google.spanner.executor.v1.IListCloudInstancesAction|null} [listCloudInstances] AdminAction listCloudInstances + * @property {google.spanner.executor.v1.IGetCloudInstanceAction|null} [getCloudInstance] AdminAction getCloudInstance + * @property {google.spanner.executor.v1.ICreateCloudDatabaseAction|null} [createCloudDatabase] AdminAction createCloudDatabase + * @property {google.spanner.executor.v1.IUpdateCloudDatabaseDdlAction|null} [updateCloudDatabaseDdl] AdminAction updateCloudDatabaseDdl + * @property {google.spanner.executor.v1.IUpdateCloudDatabaseAction|null} [updateCloudDatabase] AdminAction updateCloudDatabase + * @property {google.spanner.executor.v1.IDropCloudDatabaseAction|null} [dropCloudDatabase] AdminAction dropCloudDatabase + * @property {google.spanner.executor.v1.IListCloudDatabasesAction|null} [listCloudDatabases] AdminAction listCloudDatabases + * @property {google.spanner.executor.v1.IListCloudDatabaseOperationsAction|null} [listCloudDatabaseOperations] AdminAction listCloudDatabaseOperations + * @property {google.spanner.executor.v1.IRestoreCloudDatabaseAction|null} [restoreCloudDatabase] AdminAction restoreCloudDatabase + * @property {google.spanner.executor.v1.IGetCloudDatabaseAction|null} [getCloudDatabase] AdminAction getCloudDatabase + * @property {google.spanner.executor.v1.ICreateCloudBackupAction|null} [createCloudBackup] AdminAction createCloudBackup + * @property {google.spanner.executor.v1.ICopyCloudBackupAction|null} [copyCloudBackup] AdminAction copyCloudBackup + * @property {google.spanner.executor.v1.IGetCloudBackupAction|null} [getCloudBackup] AdminAction getCloudBackup + * @property {google.spanner.executor.v1.IUpdateCloudBackupAction|null} [updateCloudBackup] AdminAction updateCloudBackup + * @property {google.spanner.executor.v1.IDeleteCloudBackupAction|null} [deleteCloudBackup] AdminAction deleteCloudBackup + * @property {google.spanner.executor.v1.IListCloudBackupsAction|null} [listCloudBackups] AdminAction listCloudBackups + * @property {google.spanner.executor.v1.IListCloudBackupOperationsAction|null} [listCloudBackupOperations] AdminAction listCloudBackupOperations + * @property {google.spanner.executor.v1.IGetOperationAction|null} [getOperation] AdminAction getOperation + * @property {google.spanner.executor.v1.ICancelOperationAction|null} [cancelOperation] AdminAction cancelOperation + * @property {google.spanner.executor.v1.IChangeQuorumCloudDatabaseAction|null} [changeQuorumCloudDatabase] AdminAction changeQuorumCloudDatabase + */ + + /** + * Constructs a new AdminAction. + * @memberof google.spanner.executor.v1 + * @classdesc Represents an AdminAction. + * @implements IAdminAction + * @constructor + * @param {google.spanner.executor.v1.IAdminAction=} [properties] Properties to set + */ + function AdminAction(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AdminAction createUserInstanceConfig. + * @member {google.spanner.executor.v1.ICreateUserInstanceConfigAction|null|undefined} createUserInstanceConfig + * @memberof google.spanner.executor.v1.AdminAction + * @instance + */ + AdminAction.prototype.createUserInstanceConfig = null; + + /** + * AdminAction updateUserInstanceConfig. + * @member {google.spanner.executor.v1.IUpdateUserInstanceConfigAction|null|undefined} updateUserInstanceConfig + * @memberof google.spanner.executor.v1.AdminAction + * @instance + */ + AdminAction.prototype.updateUserInstanceConfig = null; + + /** + * AdminAction deleteUserInstanceConfig. + * @member {google.spanner.executor.v1.IDeleteUserInstanceConfigAction|null|undefined} deleteUserInstanceConfig + * @memberof google.spanner.executor.v1.AdminAction + * @instance + */ + AdminAction.prototype.deleteUserInstanceConfig = null; + + /** + * AdminAction getCloudInstanceConfig. + * @member {google.spanner.executor.v1.IGetCloudInstanceConfigAction|null|undefined} getCloudInstanceConfig + * @memberof google.spanner.executor.v1.AdminAction + * @instance + */ + AdminAction.prototype.getCloudInstanceConfig = null; + + /** + * AdminAction listInstanceConfigs. + * @member {google.spanner.executor.v1.IListCloudInstanceConfigsAction|null|undefined} listInstanceConfigs + * @memberof google.spanner.executor.v1.AdminAction + * @instance + */ + AdminAction.prototype.listInstanceConfigs = null; + + /** + * AdminAction createCloudInstance. + * @member {google.spanner.executor.v1.ICreateCloudInstanceAction|null|undefined} createCloudInstance + * @memberof google.spanner.executor.v1.AdminAction + * @instance + */ + AdminAction.prototype.createCloudInstance = null; + + /** + * AdminAction updateCloudInstance. + * @member {google.spanner.executor.v1.IUpdateCloudInstanceAction|null|undefined} updateCloudInstance + * @memberof google.spanner.executor.v1.AdminAction + * @instance + */ + AdminAction.prototype.updateCloudInstance = null; + + /** + * AdminAction deleteCloudInstance. + * @member {google.spanner.executor.v1.IDeleteCloudInstanceAction|null|undefined} deleteCloudInstance + * @memberof google.spanner.executor.v1.AdminAction + * @instance + */ + AdminAction.prototype.deleteCloudInstance = null; + + /** + * AdminAction listCloudInstances. + * @member {google.spanner.executor.v1.IListCloudInstancesAction|null|undefined} listCloudInstances + * @memberof google.spanner.executor.v1.AdminAction + * @instance + */ + AdminAction.prototype.listCloudInstances = null; + + /** + * AdminAction getCloudInstance. + * @member {google.spanner.executor.v1.IGetCloudInstanceAction|null|undefined} getCloudInstance + * @memberof google.spanner.executor.v1.AdminAction + * @instance + */ + AdminAction.prototype.getCloudInstance = null; + + /** + * AdminAction createCloudDatabase. + * @member {google.spanner.executor.v1.ICreateCloudDatabaseAction|null|undefined} createCloudDatabase + * @memberof google.spanner.executor.v1.AdminAction + * @instance + */ + AdminAction.prototype.createCloudDatabase = null; + + /** + * AdminAction updateCloudDatabaseDdl. + * @member {google.spanner.executor.v1.IUpdateCloudDatabaseDdlAction|null|undefined} updateCloudDatabaseDdl + * @memberof google.spanner.executor.v1.AdminAction + * @instance + */ + AdminAction.prototype.updateCloudDatabaseDdl = null; + + /** + * AdminAction updateCloudDatabase. + * @member {google.spanner.executor.v1.IUpdateCloudDatabaseAction|null|undefined} updateCloudDatabase + * @memberof google.spanner.executor.v1.AdminAction + * @instance + */ + AdminAction.prototype.updateCloudDatabase = null; + + /** + * AdminAction dropCloudDatabase. + * @member {google.spanner.executor.v1.IDropCloudDatabaseAction|null|undefined} dropCloudDatabase + * @memberof google.spanner.executor.v1.AdminAction + * @instance + */ + AdminAction.prototype.dropCloudDatabase = null; + + /** + * AdminAction listCloudDatabases. + * @member {google.spanner.executor.v1.IListCloudDatabasesAction|null|undefined} listCloudDatabases + * @memberof google.spanner.executor.v1.AdminAction + * @instance + */ + AdminAction.prototype.listCloudDatabases = null; + + /** + * AdminAction listCloudDatabaseOperations. + * @member {google.spanner.executor.v1.IListCloudDatabaseOperationsAction|null|undefined} listCloudDatabaseOperations + * @memberof google.spanner.executor.v1.AdminAction + * @instance + */ + AdminAction.prototype.listCloudDatabaseOperations = null; + + /** + * AdminAction restoreCloudDatabase. + * @member {google.spanner.executor.v1.IRestoreCloudDatabaseAction|null|undefined} restoreCloudDatabase + * @memberof google.spanner.executor.v1.AdminAction + * @instance + */ + AdminAction.prototype.restoreCloudDatabase = null; + + /** + * AdminAction getCloudDatabase. + * @member {google.spanner.executor.v1.IGetCloudDatabaseAction|null|undefined} getCloudDatabase + * @memberof google.spanner.executor.v1.AdminAction + * @instance + */ + AdminAction.prototype.getCloudDatabase = null; + + /** + * AdminAction createCloudBackup. + * @member {google.spanner.executor.v1.ICreateCloudBackupAction|null|undefined} createCloudBackup + * @memberof google.spanner.executor.v1.AdminAction + * @instance + */ + AdminAction.prototype.createCloudBackup = null; + + /** + * AdminAction copyCloudBackup. + * @member {google.spanner.executor.v1.ICopyCloudBackupAction|null|undefined} copyCloudBackup + * @memberof google.spanner.executor.v1.AdminAction + * @instance + */ + AdminAction.prototype.copyCloudBackup = null; + + /** + * AdminAction getCloudBackup. + * @member {google.spanner.executor.v1.IGetCloudBackupAction|null|undefined} getCloudBackup + * @memberof google.spanner.executor.v1.AdminAction + * @instance + */ + AdminAction.prototype.getCloudBackup = null; + + /** + * AdminAction updateCloudBackup. + * @member {google.spanner.executor.v1.IUpdateCloudBackupAction|null|undefined} updateCloudBackup + * @memberof google.spanner.executor.v1.AdminAction + * @instance + */ + AdminAction.prototype.updateCloudBackup = null; + + /** + * AdminAction deleteCloudBackup. + * @member {google.spanner.executor.v1.IDeleteCloudBackupAction|null|undefined} deleteCloudBackup + * @memberof google.spanner.executor.v1.AdminAction + * @instance + */ + AdminAction.prototype.deleteCloudBackup = null; + + /** + * AdminAction listCloudBackups. + * @member {google.spanner.executor.v1.IListCloudBackupsAction|null|undefined} listCloudBackups + * @memberof google.spanner.executor.v1.AdminAction + * @instance + */ + AdminAction.prototype.listCloudBackups = null; + + /** + * AdminAction listCloudBackupOperations. + * @member {google.spanner.executor.v1.IListCloudBackupOperationsAction|null|undefined} listCloudBackupOperations + * @memberof google.spanner.executor.v1.AdminAction + * @instance + */ + AdminAction.prototype.listCloudBackupOperations = null; + + /** + * AdminAction getOperation. + * @member {google.spanner.executor.v1.IGetOperationAction|null|undefined} getOperation + * @memberof google.spanner.executor.v1.AdminAction + * @instance + */ + AdminAction.prototype.getOperation = null; + + /** + * AdminAction cancelOperation. + * @member {google.spanner.executor.v1.ICancelOperationAction|null|undefined} cancelOperation + * @memberof google.spanner.executor.v1.AdminAction + * @instance + */ + AdminAction.prototype.cancelOperation = null; + + /** + * AdminAction changeQuorumCloudDatabase. + * @member {google.spanner.executor.v1.IChangeQuorumCloudDatabaseAction|null|undefined} changeQuorumCloudDatabase + * @memberof google.spanner.executor.v1.AdminAction + * @instance + */ + AdminAction.prototype.changeQuorumCloudDatabase = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AdminAction action. + * @member {"createUserInstanceConfig"|"updateUserInstanceConfig"|"deleteUserInstanceConfig"|"getCloudInstanceConfig"|"listInstanceConfigs"|"createCloudInstance"|"updateCloudInstance"|"deleteCloudInstance"|"listCloudInstances"|"getCloudInstance"|"createCloudDatabase"|"updateCloudDatabaseDdl"|"updateCloudDatabase"|"dropCloudDatabase"|"listCloudDatabases"|"listCloudDatabaseOperations"|"restoreCloudDatabase"|"getCloudDatabase"|"createCloudBackup"|"copyCloudBackup"|"getCloudBackup"|"updateCloudBackup"|"deleteCloudBackup"|"listCloudBackups"|"listCloudBackupOperations"|"getOperation"|"cancelOperation"|"changeQuorumCloudDatabase"|undefined} action + * @memberof google.spanner.executor.v1.AdminAction + * @instance + */ + Object.defineProperty(AdminAction.prototype, "action", { + get: $util.oneOfGetter($oneOfFields = ["createUserInstanceConfig", "updateUserInstanceConfig", "deleteUserInstanceConfig", "getCloudInstanceConfig", "listInstanceConfigs", "createCloudInstance", "updateCloudInstance", "deleteCloudInstance", "listCloudInstances", "getCloudInstance", "createCloudDatabase", "updateCloudDatabaseDdl", "updateCloudDatabase", "dropCloudDatabase", "listCloudDatabases", "listCloudDatabaseOperations", "restoreCloudDatabase", "getCloudDatabase", "createCloudBackup", "copyCloudBackup", "getCloudBackup", "updateCloudBackup", "deleteCloudBackup", "listCloudBackups", "listCloudBackupOperations", "getOperation", "cancelOperation", "changeQuorumCloudDatabase"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AdminAction instance using the specified properties. + * @function create + * @memberof google.spanner.executor.v1.AdminAction + * @static + * @param {google.spanner.executor.v1.IAdminAction=} [properties] Properties to set + * @returns {google.spanner.executor.v1.AdminAction} AdminAction instance + */ + AdminAction.create = function create(properties) { + return new AdminAction(properties); + }; + + /** + * Encodes the specified AdminAction message. Does not implicitly {@link google.spanner.executor.v1.AdminAction.verify|verify} messages. + * @function encode + * @memberof google.spanner.executor.v1.AdminAction + * @static + * @param {google.spanner.executor.v1.IAdminAction} message AdminAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AdminAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.createUserInstanceConfig != null && Object.hasOwnProperty.call(message, "createUserInstanceConfig")) + $root.google.spanner.executor.v1.CreateUserInstanceConfigAction.encode(message.createUserInstanceConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateUserInstanceConfig != null && Object.hasOwnProperty.call(message, "updateUserInstanceConfig")) + $root.google.spanner.executor.v1.UpdateUserInstanceConfigAction.encode(message.updateUserInstanceConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.deleteUserInstanceConfig != null && Object.hasOwnProperty.call(message, "deleteUserInstanceConfig")) + $root.google.spanner.executor.v1.DeleteUserInstanceConfigAction.encode(message.deleteUserInstanceConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.getCloudInstanceConfig != null && Object.hasOwnProperty.call(message, "getCloudInstanceConfig")) + $root.google.spanner.executor.v1.GetCloudInstanceConfigAction.encode(message.getCloudInstanceConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.listInstanceConfigs != null && Object.hasOwnProperty.call(message, "listInstanceConfigs")) + $root.google.spanner.executor.v1.ListCloudInstanceConfigsAction.encode(message.listInstanceConfigs, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.createCloudInstance != null && Object.hasOwnProperty.call(message, "createCloudInstance")) + $root.google.spanner.executor.v1.CreateCloudInstanceAction.encode(message.createCloudInstance, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.updateCloudInstance != null && Object.hasOwnProperty.call(message, "updateCloudInstance")) + $root.google.spanner.executor.v1.UpdateCloudInstanceAction.encode(message.updateCloudInstance, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.deleteCloudInstance != null && Object.hasOwnProperty.call(message, "deleteCloudInstance")) + $root.google.spanner.executor.v1.DeleteCloudInstanceAction.encode(message.deleteCloudInstance, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.listCloudInstances != null && Object.hasOwnProperty.call(message, "listCloudInstances")) + $root.google.spanner.executor.v1.ListCloudInstancesAction.encode(message.listCloudInstances, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.getCloudInstance != null && Object.hasOwnProperty.call(message, "getCloudInstance")) + $root.google.spanner.executor.v1.GetCloudInstanceAction.encode(message.getCloudInstance, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.createCloudDatabase != null && Object.hasOwnProperty.call(message, "createCloudDatabase")) + $root.google.spanner.executor.v1.CreateCloudDatabaseAction.encode(message.createCloudDatabase, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.updateCloudDatabaseDdl != null && Object.hasOwnProperty.call(message, "updateCloudDatabaseDdl")) + $root.google.spanner.executor.v1.UpdateCloudDatabaseDdlAction.encode(message.updateCloudDatabaseDdl, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.dropCloudDatabase != null && Object.hasOwnProperty.call(message, "dropCloudDatabase")) + $root.google.spanner.executor.v1.DropCloudDatabaseAction.encode(message.dropCloudDatabase, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.listCloudDatabases != null && Object.hasOwnProperty.call(message, "listCloudDatabases")) + $root.google.spanner.executor.v1.ListCloudDatabasesAction.encode(message.listCloudDatabases, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.listCloudDatabaseOperations != null && Object.hasOwnProperty.call(message, "listCloudDatabaseOperations")) + $root.google.spanner.executor.v1.ListCloudDatabaseOperationsAction.encode(message.listCloudDatabaseOperations, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.restoreCloudDatabase != null && Object.hasOwnProperty.call(message, "restoreCloudDatabase")) + $root.google.spanner.executor.v1.RestoreCloudDatabaseAction.encode(message.restoreCloudDatabase, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); + if (message.getCloudDatabase != null && Object.hasOwnProperty.call(message, "getCloudDatabase")) + $root.google.spanner.executor.v1.GetCloudDatabaseAction.encode(message.getCloudDatabase, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.createCloudBackup != null && Object.hasOwnProperty.call(message, "createCloudBackup")) + $root.google.spanner.executor.v1.CreateCloudBackupAction.encode(message.createCloudBackup, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.copyCloudBackup != null && Object.hasOwnProperty.call(message, "copyCloudBackup")) + $root.google.spanner.executor.v1.CopyCloudBackupAction.encode(message.copyCloudBackup, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + if (message.getCloudBackup != null && Object.hasOwnProperty.call(message, "getCloudBackup")) + $root.google.spanner.executor.v1.GetCloudBackupAction.encode(message.getCloudBackup, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.updateCloudBackup != null && Object.hasOwnProperty.call(message, "updateCloudBackup")) + $root.google.spanner.executor.v1.UpdateCloudBackupAction.encode(message.updateCloudBackup, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.deleteCloudBackup != null && Object.hasOwnProperty.call(message, "deleteCloudBackup")) + $root.google.spanner.executor.v1.DeleteCloudBackupAction.encode(message.deleteCloudBackup, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.listCloudBackups != null && Object.hasOwnProperty.call(message, "listCloudBackups")) + $root.google.spanner.executor.v1.ListCloudBackupsAction.encode(message.listCloudBackups, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.listCloudBackupOperations != null && Object.hasOwnProperty.call(message, "listCloudBackupOperations")) + $root.google.spanner.executor.v1.ListCloudBackupOperationsAction.encode(message.listCloudBackupOperations, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + if (message.getOperation != null && Object.hasOwnProperty.call(message, "getOperation")) + $root.google.spanner.executor.v1.GetOperationAction.encode(message.getOperation, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); + if (message.cancelOperation != null && Object.hasOwnProperty.call(message, "cancelOperation")) + $root.google.spanner.executor.v1.CancelOperationAction.encode(message.cancelOperation, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + if (message.updateCloudDatabase != null && Object.hasOwnProperty.call(message, "updateCloudDatabase")) + $root.google.spanner.executor.v1.UpdateCloudDatabaseAction.encode(message.updateCloudDatabase, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); + if (message.changeQuorumCloudDatabase != null && Object.hasOwnProperty.call(message, "changeQuorumCloudDatabase")) + $root.google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction.encode(message.changeQuorumCloudDatabase, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AdminAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.AdminAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.executor.v1.AdminAction + * @static + * @param {google.spanner.executor.v1.IAdminAction} message AdminAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AdminAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AdminAction message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.executor.v1.AdminAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.executor.v1.AdminAction} AdminAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AdminAction.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.AdminAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.createUserInstanceConfig = $root.google.spanner.executor.v1.CreateUserInstanceConfigAction.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateUserInstanceConfig = $root.google.spanner.executor.v1.UpdateUserInstanceConfigAction.decode(reader, reader.uint32()); + break; + } + case 3: { + message.deleteUserInstanceConfig = $root.google.spanner.executor.v1.DeleteUserInstanceConfigAction.decode(reader, reader.uint32()); + break; + } + case 4: { + message.getCloudInstanceConfig = $root.google.spanner.executor.v1.GetCloudInstanceConfigAction.decode(reader, reader.uint32()); + break; + } + case 5: { + message.listInstanceConfigs = $root.google.spanner.executor.v1.ListCloudInstanceConfigsAction.decode(reader, reader.uint32()); + break; + } + case 6: { + message.createCloudInstance = $root.google.spanner.executor.v1.CreateCloudInstanceAction.decode(reader, reader.uint32()); + break; + } + case 7: { + message.updateCloudInstance = $root.google.spanner.executor.v1.UpdateCloudInstanceAction.decode(reader, reader.uint32()); + break; + } + case 8: { + message.deleteCloudInstance = $root.google.spanner.executor.v1.DeleteCloudInstanceAction.decode(reader, reader.uint32()); + break; + } + case 9: { + message.listCloudInstances = $root.google.spanner.executor.v1.ListCloudInstancesAction.decode(reader, reader.uint32()); + break; + } + case 10: { + message.getCloudInstance = $root.google.spanner.executor.v1.GetCloudInstanceAction.decode(reader, reader.uint32()); + break; + } + case 11: { + message.createCloudDatabase = $root.google.spanner.executor.v1.CreateCloudDatabaseAction.decode(reader, reader.uint32()); + break; + } + case 12: { + message.updateCloudDatabaseDdl = $root.google.spanner.executor.v1.UpdateCloudDatabaseDdlAction.decode(reader, reader.uint32()); + break; + } + case 27: { + message.updateCloudDatabase = $root.google.spanner.executor.v1.UpdateCloudDatabaseAction.decode(reader, reader.uint32()); + break; + } + case 13: { + message.dropCloudDatabase = $root.google.spanner.executor.v1.DropCloudDatabaseAction.decode(reader, reader.uint32()); + break; + } + case 14: { + message.listCloudDatabases = $root.google.spanner.executor.v1.ListCloudDatabasesAction.decode(reader, reader.uint32()); + break; + } + case 15: { + message.listCloudDatabaseOperations = $root.google.spanner.executor.v1.ListCloudDatabaseOperationsAction.decode(reader, reader.uint32()); + break; + } + case 16: { + message.restoreCloudDatabase = $root.google.spanner.executor.v1.RestoreCloudDatabaseAction.decode(reader, reader.uint32()); + break; + } + case 17: { + message.getCloudDatabase = $root.google.spanner.executor.v1.GetCloudDatabaseAction.decode(reader, reader.uint32()); + break; + } + case 18: { + message.createCloudBackup = $root.google.spanner.executor.v1.CreateCloudBackupAction.decode(reader, reader.uint32()); + break; + } + case 19: { + message.copyCloudBackup = $root.google.spanner.executor.v1.CopyCloudBackupAction.decode(reader, reader.uint32()); + break; + } + case 20: { + message.getCloudBackup = $root.google.spanner.executor.v1.GetCloudBackupAction.decode(reader, reader.uint32()); + break; + } + case 21: { + message.updateCloudBackup = $root.google.spanner.executor.v1.UpdateCloudBackupAction.decode(reader, reader.uint32()); + break; + } + case 22: { + message.deleteCloudBackup = $root.google.spanner.executor.v1.DeleteCloudBackupAction.decode(reader, reader.uint32()); + break; + } + case 23: { + message.listCloudBackups = $root.google.spanner.executor.v1.ListCloudBackupsAction.decode(reader, reader.uint32()); + break; + } + case 24: { + message.listCloudBackupOperations = $root.google.spanner.executor.v1.ListCloudBackupOperationsAction.decode(reader, reader.uint32()); + break; + } + case 25: { + message.getOperation = $root.google.spanner.executor.v1.GetOperationAction.decode(reader, reader.uint32()); + break; + } + case 26: { + message.cancelOperation = $root.google.spanner.executor.v1.CancelOperationAction.decode(reader, reader.uint32()); + break; + } + case 28: { + message.changeQuorumCloudDatabase = $root.google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AdminAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.executor.v1.AdminAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.executor.v1.AdminAction} AdminAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AdminAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AdminAction message. + * @function verify + * @memberof google.spanner.executor.v1.AdminAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AdminAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.createUserInstanceConfig != null && message.hasOwnProperty("createUserInstanceConfig")) { + properties.action = 1; + { + var error = $root.google.spanner.executor.v1.CreateUserInstanceConfigAction.verify(message.createUserInstanceConfig); + if (error) + return "createUserInstanceConfig." + error; + } + } + if (message.updateUserInstanceConfig != null && message.hasOwnProperty("updateUserInstanceConfig")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.spanner.executor.v1.UpdateUserInstanceConfigAction.verify(message.updateUserInstanceConfig); + if (error) + return "updateUserInstanceConfig." + error; + } + } + if (message.deleteUserInstanceConfig != null && message.hasOwnProperty("deleteUserInstanceConfig")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.spanner.executor.v1.DeleteUserInstanceConfigAction.verify(message.deleteUserInstanceConfig); + if (error) + return "deleteUserInstanceConfig." + error; + } + } + if (message.getCloudInstanceConfig != null && message.hasOwnProperty("getCloudInstanceConfig")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.spanner.executor.v1.GetCloudInstanceConfigAction.verify(message.getCloudInstanceConfig); + if (error) + return "getCloudInstanceConfig." + error; + } + } + if (message.listInstanceConfigs != null && message.hasOwnProperty("listInstanceConfigs")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.spanner.executor.v1.ListCloudInstanceConfigsAction.verify(message.listInstanceConfigs); + if (error) + return "listInstanceConfigs." + error; + } + } + if (message.createCloudInstance != null && message.hasOwnProperty("createCloudInstance")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.spanner.executor.v1.CreateCloudInstanceAction.verify(message.createCloudInstance); + if (error) + return "createCloudInstance." + error; + } + } + if (message.updateCloudInstance != null && message.hasOwnProperty("updateCloudInstance")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.spanner.executor.v1.UpdateCloudInstanceAction.verify(message.updateCloudInstance); + if (error) + return "updateCloudInstance." + error; + } + } + if (message.deleteCloudInstance != null && message.hasOwnProperty("deleteCloudInstance")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.spanner.executor.v1.DeleteCloudInstanceAction.verify(message.deleteCloudInstance); + if (error) + return "deleteCloudInstance." + error; + } + } + if (message.listCloudInstances != null && message.hasOwnProperty("listCloudInstances")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.spanner.executor.v1.ListCloudInstancesAction.verify(message.listCloudInstances); + if (error) + return "listCloudInstances." + error; + } + } + if (message.getCloudInstance != null && message.hasOwnProperty("getCloudInstance")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.spanner.executor.v1.GetCloudInstanceAction.verify(message.getCloudInstance); + if (error) + return "getCloudInstance." + error; + } + } + if (message.createCloudDatabase != null && message.hasOwnProperty("createCloudDatabase")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.spanner.executor.v1.CreateCloudDatabaseAction.verify(message.createCloudDatabase); + if (error) + return "createCloudDatabase." + error; + } + } + if (message.updateCloudDatabaseDdl != null && message.hasOwnProperty("updateCloudDatabaseDdl")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.spanner.executor.v1.UpdateCloudDatabaseDdlAction.verify(message.updateCloudDatabaseDdl); + if (error) + return "updateCloudDatabaseDdl." + error; + } + } + if (message.updateCloudDatabase != null && message.hasOwnProperty("updateCloudDatabase")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.spanner.executor.v1.UpdateCloudDatabaseAction.verify(message.updateCloudDatabase); + if (error) + return "updateCloudDatabase." + error; + } + } + if (message.dropCloudDatabase != null && message.hasOwnProperty("dropCloudDatabase")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.spanner.executor.v1.DropCloudDatabaseAction.verify(message.dropCloudDatabase); + if (error) + return "dropCloudDatabase." + error; + } + } + if (message.listCloudDatabases != null && message.hasOwnProperty("listCloudDatabases")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.spanner.executor.v1.ListCloudDatabasesAction.verify(message.listCloudDatabases); + if (error) + return "listCloudDatabases." + error; + } + } + if (message.listCloudDatabaseOperations != null && message.hasOwnProperty("listCloudDatabaseOperations")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.spanner.executor.v1.ListCloudDatabaseOperationsAction.verify(message.listCloudDatabaseOperations); + if (error) + return "listCloudDatabaseOperations." + error; + } + } + if (message.restoreCloudDatabase != null && message.hasOwnProperty("restoreCloudDatabase")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.spanner.executor.v1.RestoreCloudDatabaseAction.verify(message.restoreCloudDatabase); + if (error) + return "restoreCloudDatabase." + error; + } + } + if (message.getCloudDatabase != null && message.hasOwnProperty("getCloudDatabase")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.spanner.executor.v1.GetCloudDatabaseAction.verify(message.getCloudDatabase); + if (error) + return "getCloudDatabase." + error; + } + } + if (message.createCloudBackup != null && message.hasOwnProperty("createCloudBackup")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.spanner.executor.v1.CreateCloudBackupAction.verify(message.createCloudBackup); + if (error) + return "createCloudBackup." + error; + } + } + if (message.copyCloudBackup != null && message.hasOwnProperty("copyCloudBackup")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.spanner.executor.v1.CopyCloudBackupAction.verify(message.copyCloudBackup); + if (error) + return "copyCloudBackup." + error; + } + } + if (message.getCloudBackup != null && message.hasOwnProperty("getCloudBackup")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.spanner.executor.v1.GetCloudBackupAction.verify(message.getCloudBackup); + if (error) + return "getCloudBackup." + error; + } + } + if (message.updateCloudBackup != null && message.hasOwnProperty("updateCloudBackup")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.spanner.executor.v1.UpdateCloudBackupAction.verify(message.updateCloudBackup); + if (error) + return "updateCloudBackup." + error; + } + } + if (message.deleteCloudBackup != null && message.hasOwnProperty("deleteCloudBackup")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.spanner.executor.v1.DeleteCloudBackupAction.verify(message.deleteCloudBackup); + if (error) + return "deleteCloudBackup." + error; + } + } + if (message.listCloudBackups != null && message.hasOwnProperty("listCloudBackups")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.spanner.executor.v1.ListCloudBackupsAction.verify(message.listCloudBackups); + if (error) + return "listCloudBackups." + error; + } + } + if (message.listCloudBackupOperations != null && message.hasOwnProperty("listCloudBackupOperations")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.spanner.executor.v1.ListCloudBackupOperationsAction.verify(message.listCloudBackupOperations); + if (error) + return "listCloudBackupOperations." + error; + } + } + if (message.getOperation != null && message.hasOwnProperty("getOperation")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.spanner.executor.v1.GetOperationAction.verify(message.getOperation); + if (error) + return "getOperation." + error; + } + } + if (message.cancelOperation != null && message.hasOwnProperty("cancelOperation")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.spanner.executor.v1.CancelOperationAction.verify(message.cancelOperation); + if (error) + return "cancelOperation." + error; + } + } + if (message.changeQuorumCloudDatabase != null && message.hasOwnProperty("changeQuorumCloudDatabase")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction.verify(message.changeQuorumCloudDatabase); + if (error) + return "changeQuorumCloudDatabase." + error; + } + } + return null; + }; + + /** + * Creates an AdminAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.executor.v1.AdminAction + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.executor.v1.AdminAction} AdminAction + */ + AdminAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.executor.v1.AdminAction) + return object; + var message = new $root.google.spanner.executor.v1.AdminAction(); + if (object.createUserInstanceConfig != null) { + if (typeof object.createUserInstanceConfig !== "object") + throw TypeError(".google.spanner.executor.v1.AdminAction.createUserInstanceConfig: object expected"); + message.createUserInstanceConfig = $root.google.spanner.executor.v1.CreateUserInstanceConfigAction.fromObject(object.createUserInstanceConfig); + } + if (object.updateUserInstanceConfig != null) { + if (typeof object.updateUserInstanceConfig !== "object") + throw TypeError(".google.spanner.executor.v1.AdminAction.updateUserInstanceConfig: object expected"); + message.updateUserInstanceConfig = $root.google.spanner.executor.v1.UpdateUserInstanceConfigAction.fromObject(object.updateUserInstanceConfig); + } + if (object.deleteUserInstanceConfig != null) { + if (typeof object.deleteUserInstanceConfig !== "object") + throw TypeError(".google.spanner.executor.v1.AdminAction.deleteUserInstanceConfig: object expected"); + message.deleteUserInstanceConfig = $root.google.spanner.executor.v1.DeleteUserInstanceConfigAction.fromObject(object.deleteUserInstanceConfig); + } + if (object.getCloudInstanceConfig != null) { + if (typeof object.getCloudInstanceConfig !== "object") + throw TypeError(".google.spanner.executor.v1.AdminAction.getCloudInstanceConfig: object expected"); + message.getCloudInstanceConfig = $root.google.spanner.executor.v1.GetCloudInstanceConfigAction.fromObject(object.getCloudInstanceConfig); + } + if (object.listInstanceConfigs != null) { + if (typeof object.listInstanceConfigs !== "object") + throw TypeError(".google.spanner.executor.v1.AdminAction.listInstanceConfigs: object expected"); + message.listInstanceConfigs = $root.google.spanner.executor.v1.ListCloudInstanceConfigsAction.fromObject(object.listInstanceConfigs); + } + if (object.createCloudInstance != null) { + if (typeof object.createCloudInstance !== "object") + throw TypeError(".google.spanner.executor.v1.AdminAction.createCloudInstance: object expected"); + message.createCloudInstance = $root.google.spanner.executor.v1.CreateCloudInstanceAction.fromObject(object.createCloudInstance); + } + if (object.updateCloudInstance != null) { + if (typeof object.updateCloudInstance !== "object") + throw TypeError(".google.spanner.executor.v1.AdminAction.updateCloudInstance: object expected"); + message.updateCloudInstance = $root.google.spanner.executor.v1.UpdateCloudInstanceAction.fromObject(object.updateCloudInstance); + } + if (object.deleteCloudInstance != null) { + if (typeof object.deleteCloudInstance !== "object") + throw TypeError(".google.spanner.executor.v1.AdminAction.deleteCloudInstance: object expected"); + message.deleteCloudInstance = $root.google.spanner.executor.v1.DeleteCloudInstanceAction.fromObject(object.deleteCloudInstance); + } + if (object.listCloudInstances != null) { + if (typeof object.listCloudInstances !== "object") + throw TypeError(".google.spanner.executor.v1.AdminAction.listCloudInstances: object expected"); + message.listCloudInstances = $root.google.spanner.executor.v1.ListCloudInstancesAction.fromObject(object.listCloudInstances); + } + if (object.getCloudInstance != null) { + if (typeof object.getCloudInstance !== "object") + throw TypeError(".google.spanner.executor.v1.AdminAction.getCloudInstance: object expected"); + message.getCloudInstance = $root.google.spanner.executor.v1.GetCloudInstanceAction.fromObject(object.getCloudInstance); + } + if (object.createCloudDatabase != null) { + if (typeof object.createCloudDatabase !== "object") + throw TypeError(".google.spanner.executor.v1.AdminAction.createCloudDatabase: object expected"); + message.createCloudDatabase = $root.google.spanner.executor.v1.CreateCloudDatabaseAction.fromObject(object.createCloudDatabase); + } + if (object.updateCloudDatabaseDdl != null) { + if (typeof object.updateCloudDatabaseDdl !== "object") + throw TypeError(".google.spanner.executor.v1.AdminAction.updateCloudDatabaseDdl: object expected"); + message.updateCloudDatabaseDdl = $root.google.spanner.executor.v1.UpdateCloudDatabaseDdlAction.fromObject(object.updateCloudDatabaseDdl); + } + if (object.updateCloudDatabase != null) { + if (typeof object.updateCloudDatabase !== "object") + throw TypeError(".google.spanner.executor.v1.AdminAction.updateCloudDatabase: object expected"); + message.updateCloudDatabase = $root.google.spanner.executor.v1.UpdateCloudDatabaseAction.fromObject(object.updateCloudDatabase); + } + if (object.dropCloudDatabase != null) { + if (typeof object.dropCloudDatabase !== "object") + throw TypeError(".google.spanner.executor.v1.AdminAction.dropCloudDatabase: object expected"); + message.dropCloudDatabase = $root.google.spanner.executor.v1.DropCloudDatabaseAction.fromObject(object.dropCloudDatabase); + } + if (object.listCloudDatabases != null) { + if (typeof object.listCloudDatabases !== "object") + throw TypeError(".google.spanner.executor.v1.AdminAction.listCloudDatabases: object expected"); + message.listCloudDatabases = $root.google.spanner.executor.v1.ListCloudDatabasesAction.fromObject(object.listCloudDatabases); + } + if (object.listCloudDatabaseOperations != null) { + if (typeof object.listCloudDatabaseOperations !== "object") + throw TypeError(".google.spanner.executor.v1.AdminAction.listCloudDatabaseOperations: object expected"); + message.listCloudDatabaseOperations = $root.google.spanner.executor.v1.ListCloudDatabaseOperationsAction.fromObject(object.listCloudDatabaseOperations); + } + if (object.restoreCloudDatabase != null) { + if (typeof object.restoreCloudDatabase !== "object") + throw TypeError(".google.spanner.executor.v1.AdminAction.restoreCloudDatabase: object expected"); + message.restoreCloudDatabase = $root.google.spanner.executor.v1.RestoreCloudDatabaseAction.fromObject(object.restoreCloudDatabase); + } + if (object.getCloudDatabase != null) { + if (typeof object.getCloudDatabase !== "object") + throw TypeError(".google.spanner.executor.v1.AdminAction.getCloudDatabase: object expected"); + message.getCloudDatabase = $root.google.spanner.executor.v1.GetCloudDatabaseAction.fromObject(object.getCloudDatabase); + } + if (object.createCloudBackup != null) { + if (typeof object.createCloudBackup !== "object") + throw TypeError(".google.spanner.executor.v1.AdminAction.createCloudBackup: object expected"); + message.createCloudBackup = $root.google.spanner.executor.v1.CreateCloudBackupAction.fromObject(object.createCloudBackup); + } + if (object.copyCloudBackup != null) { + if (typeof object.copyCloudBackup !== "object") + throw TypeError(".google.spanner.executor.v1.AdminAction.copyCloudBackup: object expected"); + message.copyCloudBackup = $root.google.spanner.executor.v1.CopyCloudBackupAction.fromObject(object.copyCloudBackup); + } + if (object.getCloudBackup != null) { + if (typeof object.getCloudBackup !== "object") + throw TypeError(".google.spanner.executor.v1.AdminAction.getCloudBackup: object expected"); + message.getCloudBackup = $root.google.spanner.executor.v1.GetCloudBackupAction.fromObject(object.getCloudBackup); + } + if (object.updateCloudBackup != null) { + if (typeof object.updateCloudBackup !== "object") + throw TypeError(".google.spanner.executor.v1.AdminAction.updateCloudBackup: object expected"); + message.updateCloudBackup = $root.google.spanner.executor.v1.UpdateCloudBackupAction.fromObject(object.updateCloudBackup); + } + if (object.deleteCloudBackup != null) { + if (typeof object.deleteCloudBackup !== "object") + throw TypeError(".google.spanner.executor.v1.AdminAction.deleteCloudBackup: object expected"); + message.deleteCloudBackup = $root.google.spanner.executor.v1.DeleteCloudBackupAction.fromObject(object.deleteCloudBackup); + } + if (object.listCloudBackups != null) { + if (typeof object.listCloudBackups !== "object") + throw TypeError(".google.spanner.executor.v1.AdminAction.listCloudBackups: object expected"); + message.listCloudBackups = $root.google.spanner.executor.v1.ListCloudBackupsAction.fromObject(object.listCloudBackups); + } + if (object.listCloudBackupOperations != null) { + if (typeof object.listCloudBackupOperations !== "object") + throw TypeError(".google.spanner.executor.v1.AdminAction.listCloudBackupOperations: object expected"); + message.listCloudBackupOperations = $root.google.spanner.executor.v1.ListCloudBackupOperationsAction.fromObject(object.listCloudBackupOperations); + } + if (object.getOperation != null) { + if (typeof object.getOperation !== "object") + throw TypeError(".google.spanner.executor.v1.AdminAction.getOperation: object expected"); + message.getOperation = $root.google.spanner.executor.v1.GetOperationAction.fromObject(object.getOperation); + } + if (object.cancelOperation != null) { + if (typeof object.cancelOperation !== "object") + throw TypeError(".google.spanner.executor.v1.AdminAction.cancelOperation: object expected"); + message.cancelOperation = $root.google.spanner.executor.v1.CancelOperationAction.fromObject(object.cancelOperation); + } + if (object.changeQuorumCloudDatabase != null) { + if (typeof object.changeQuorumCloudDatabase !== "object") + throw TypeError(".google.spanner.executor.v1.AdminAction.changeQuorumCloudDatabase: object expected"); + message.changeQuorumCloudDatabase = $root.google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction.fromObject(object.changeQuorumCloudDatabase); + } + return message; + }; + + /** + * Creates a plain object from an AdminAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.executor.v1.AdminAction + * @static + * @param {google.spanner.executor.v1.AdminAction} message AdminAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AdminAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.createUserInstanceConfig != null && message.hasOwnProperty("createUserInstanceConfig")) { + object.createUserInstanceConfig = $root.google.spanner.executor.v1.CreateUserInstanceConfigAction.toObject(message.createUserInstanceConfig, options); + if (options.oneofs) + object.action = "createUserInstanceConfig"; + } + if (message.updateUserInstanceConfig != null && message.hasOwnProperty("updateUserInstanceConfig")) { + object.updateUserInstanceConfig = $root.google.spanner.executor.v1.UpdateUserInstanceConfigAction.toObject(message.updateUserInstanceConfig, options); + if (options.oneofs) + object.action = "updateUserInstanceConfig"; + } + if (message.deleteUserInstanceConfig != null && message.hasOwnProperty("deleteUserInstanceConfig")) { + object.deleteUserInstanceConfig = $root.google.spanner.executor.v1.DeleteUserInstanceConfigAction.toObject(message.deleteUserInstanceConfig, options); + if (options.oneofs) + object.action = "deleteUserInstanceConfig"; + } + if (message.getCloudInstanceConfig != null && message.hasOwnProperty("getCloudInstanceConfig")) { + object.getCloudInstanceConfig = $root.google.spanner.executor.v1.GetCloudInstanceConfigAction.toObject(message.getCloudInstanceConfig, options); + if (options.oneofs) + object.action = "getCloudInstanceConfig"; + } + if (message.listInstanceConfigs != null && message.hasOwnProperty("listInstanceConfigs")) { + object.listInstanceConfigs = $root.google.spanner.executor.v1.ListCloudInstanceConfigsAction.toObject(message.listInstanceConfigs, options); + if (options.oneofs) + object.action = "listInstanceConfigs"; + } + if (message.createCloudInstance != null && message.hasOwnProperty("createCloudInstance")) { + object.createCloudInstance = $root.google.spanner.executor.v1.CreateCloudInstanceAction.toObject(message.createCloudInstance, options); + if (options.oneofs) + object.action = "createCloudInstance"; + } + if (message.updateCloudInstance != null && message.hasOwnProperty("updateCloudInstance")) { + object.updateCloudInstance = $root.google.spanner.executor.v1.UpdateCloudInstanceAction.toObject(message.updateCloudInstance, options); + if (options.oneofs) + object.action = "updateCloudInstance"; + } + if (message.deleteCloudInstance != null && message.hasOwnProperty("deleteCloudInstance")) { + object.deleteCloudInstance = $root.google.spanner.executor.v1.DeleteCloudInstanceAction.toObject(message.deleteCloudInstance, options); + if (options.oneofs) + object.action = "deleteCloudInstance"; + } + if (message.listCloudInstances != null && message.hasOwnProperty("listCloudInstances")) { + object.listCloudInstances = $root.google.spanner.executor.v1.ListCloudInstancesAction.toObject(message.listCloudInstances, options); + if (options.oneofs) + object.action = "listCloudInstances"; + } + if (message.getCloudInstance != null && message.hasOwnProperty("getCloudInstance")) { + object.getCloudInstance = $root.google.spanner.executor.v1.GetCloudInstanceAction.toObject(message.getCloudInstance, options); + if (options.oneofs) + object.action = "getCloudInstance"; + } + if (message.createCloudDatabase != null && message.hasOwnProperty("createCloudDatabase")) { + object.createCloudDatabase = $root.google.spanner.executor.v1.CreateCloudDatabaseAction.toObject(message.createCloudDatabase, options); + if (options.oneofs) + object.action = "createCloudDatabase"; + } + if (message.updateCloudDatabaseDdl != null && message.hasOwnProperty("updateCloudDatabaseDdl")) { + object.updateCloudDatabaseDdl = $root.google.spanner.executor.v1.UpdateCloudDatabaseDdlAction.toObject(message.updateCloudDatabaseDdl, options); + if (options.oneofs) + object.action = "updateCloudDatabaseDdl"; + } + if (message.dropCloudDatabase != null && message.hasOwnProperty("dropCloudDatabase")) { + object.dropCloudDatabase = $root.google.spanner.executor.v1.DropCloudDatabaseAction.toObject(message.dropCloudDatabase, options); + if (options.oneofs) + object.action = "dropCloudDatabase"; + } + if (message.listCloudDatabases != null && message.hasOwnProperty("listCloudDatabases")) { + object.listCloudDatabases = $root.google.spanner.executor.v1.ListCloudDatabasesAction.toObject(message.listCloudDatabases, options); + if (options.oneofs) + object.action = "listCloudDatabases"; + } + if (message.listCloudDatabaseOperations != null && message.hasOwnProperty("listCloudDatabaseOperations")) { + object.listCloudDatabaseOperations = $root.google.spanner.executor.v1.ListCloudDatabaseOperationsAction.toObject(message.listCloudDatabaseOperations, options); + if (options.oneofs) + object.action = "listCloudDatabaseOperations"; + } + if (message.restoreCloudDatabase != null && message.hasOwnProperty("restoreCloudDatabase")) { + object.restoreCloudDatabase = $root.google.spanner.executor.v1.RestoreCloudDatabaseAction.toObject(message.restoreCloudDatabase, options); + if (options.oneofs) + object.action = "restoreCloudDatabase"; + } + if (message.getCloudDatabase != null && message.hasOwnProperty("getCloudDatabase")) { + object.getCloudDatabase = $root.google.spanner.executor.v1.GetCloudDatabaseAction.toObject(message.getCloudDatabase, options); + if (options.oneofs) + object.action = "getCloudDatabase"; + } + if (message.createCloudBackup != null && message.hasOwnProperty("createCloudBackup")) { + object.createCloudBackup = $root.google.spanner.executor.v1.CreateCloudBackupAction.toObject(message.createCloudBackup, options); + if (options.oneofs) + object.action = "createCloudBackup"; + } + if (message.copyCloudBackup != null && message.hasOwnProperty("copyCloudBackup")) { + object.copyCloudBackup = $root.google.spanner.executor.v1.CopyCloudBackupAction.toObject(message.copyCloudBackup, options); + if (options.oneofs) + object.action = "copyCloudBackup"; + } + if (message.getCloudBackup != null && message.hasOwnProperty("getCloudBackup")) { + object.getCloudBackup = $root.google.spanner.executor.v1.GetCloudBackupAction.toObject(message.getCloudBackup, options); + if (options.oneofs) + object.action = "getCloudBackup"; + } + if (message.updateCloudBackup != null && message.hasOwnProperty("updateCloudBackup")) { + object.updateCloudBackup = $root.google.spanner.executor.v1.UpdateCloudBackupAction.toObject(message.updateCloudBackup, options); + if (options.oneofs) + object.action = "updateCloudBackup"; + } + if (message.deleteCloudBackup != null && message.hasOwnProperty("deleteCloudBackup")) { + object.deleteCloudBackup = $root.google.spanner.executor.v1.DeleteCloudBackupAction.toObject(message.deleteCloudBackup, options); + if (options.oneofs) + object.action = "deleteCloudBackup"; + } + if (message.listCloudBackups != null && message.hasOwnProperty("listCloudBackups")) { + object.listCloudBackups = $root.google.spanner.executor.v1.ListCloudBackupsAction.toObject(message.listCloudBackups, options); + if (options.oneofs) + object.action = "listCloudBackups"; + } + if (message.listCloudBackupOperations != null && message.hasOwnProperty("listCloudBackupOperations")) { + object.listCloudBackupOperations = $root.google.spanner.executor.v1.ListCloudBackupOperationsAction.toObject(message.listCloudBackupOperations, options); + if (options.oneofs) + object.action = "listCloudBackupOperations"; + } + if (message.getOperation != null && message.hasOwnProperty("getOperation")) { + object.getOperation = $root.google.spanner.executor.v1.GetOperationAction.toObject(message.getOperation, options); + if (options.oneofs) + object.action = "getOperation"; + } + if (message.cancelOperation != null && message.hasOwnProperty("cancelOperation")) { + object.cancelOperation = $root.google.spanner.executor.v1.CancelOperationAction.toObject(message.cancelOperation, options); + if (options.oneofs) + object.action = "cancelOperation"; + } + if (message.updateCloudDatabase != null && message.hasOwnProperty("updateCloudDatabase")) { + object.updateCloudDatabase = $root.google.spanner.executor.v1.UpdateCloudDatabaseAction.toObject(message.updateCloudDatabase, options); + if (options.oneofs) + object.action = "updateCloudDatabase"; + } + if (message.changeQuorumCloudDatabase != null && message.hasOwnProperty("changeQuorumCloudDatabase")) { + object.changeQuorumCloudDatabase = $root.google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction.toObject(message.changeQuorumCloudDatabase, options); + if (options.oneofs) + object.action = "changeQuorumCloudDatabase"; + } + return object; + }; + + /** + * Converts this AdminAction to JSON. + * @function toJSON + * @memberof google.spanner.executor.v1.AdminAction + * @instance + * @returns {Object.} JSON object + */ + AdminAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AdminAction + * @function getTypeUrl + * @memberof google.spanner.executor.v1.AdminAction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AdminAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.executor.v1.AdminAction"; + }; + + return AdminAction; + })(); + + v1.CreateUserInstanceConfigAction = (function() { + + /** + * Properties of a CreateUserInstanceConfigAction. + * @memberof google.spanner.executor.v1 + * @interface ICreateUserInstanceConfigAction + * @property {string|null} [userConfigId] CreateUserInstanceConfigAction userConfigId + * @property {string|null} [projectId] CreateUserInstanceConfigAction projectId + * @property {string|null} [baseConfigId] CreateUserInstanceConfigAction baseConfigId + * @property {Array.|null} [replicas] CreateUserInstanceConfigAction replicas + */ + + /** + * Constructs a new CreateUserInstanceConfigAction. + * @memberof google.spanner.executor.v1 + * @classdesc Represents a CreateUserInstanceConfigAction. + * @implements ICreateUserInstanceConfigAction + * @constructor + * @param {google.spanner.executor.v1.ICreateUserInstanceConfigAction=} [properties] Properties to set + */ + function CreateUserInstanceConfigAction(properties) { + this.replicas = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateUserInstanceConfigAction userConfigId. + * @member {string} userConfigId + * @memberof google.spanner.executor.v1.CreateUserInstanceConfigAction + * @instance + */ + CreateUserInstanceConfigAction.prototype.userConfigId = ""; + + /** + * CreateUserInstanceConfigAction projectId. + * @member {string} projectId + * @memberof google.spanner.executor.v1.CreateUserInstanceConfigAction + * @instance + */ + CreateUserInstanceConfigAction.prototype.projectId = ""; + + /** + * CreateUserInstanceConfigAction baseConfigId. + * @member {string} baseConfigId + * @memberof google.spanner.executor.v1.CreateUserInstanceConfigAction + * @instance + */ + CreateUserInstanceConfigAction.prototype.baseConfigId = ""; + + /** + * CreateUserInstanceConfigAction replicas. + * @member {Array.} replicas + * @memberof google.spanner.executor.v1.CreateUserInstanceConfigAction + * @instance + */ + CreateUserInstanceConfigAction.prototype.replicas = $util.emptyArray; + + /** + * Creates a new CreateUserInstanceConfigAction instance using the specified properties. + * @function create + * @memberof google.spanner.executor.v1.CreateUserInstanceConfigAction + * @static + * @param {google.spanner.executor.v1.ICreateUserInstanceConfigAction=} [properties] Properties to set + * @returns {google.spanner.executor.v1.CreateUserInstanceConfigAction} CreateUserInstanceConfigAction instance + */ + CreateUserInstanceConfigAction.create = function create(properties) { + return new CreateUserInstanceConfigAction(properties); + }; + + /** + * Encodes the specified CreateUserInstanceConfigAction message. Does not implicitly {@link google.spanner.executor.v1.CreateUserInstanceConfigAction.verify|verify} messages. + * @function encode + * @memberof google.spanner.executor.v1.CreateUserInstanceConfigAction + * @static + * @param {google.spanner.executor.v1.ICreateUserInstanceConfigAction} message CreateUserInstanceConfigAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateUserInstanceConfigAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.userConfigId != null && Object.hasOwnProperty.call(message, "userConfigId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.userConfigId); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.projectId); + if (message.baseConfigId != null && Object.hasOwnProperty.call(message, "baseConfigId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.baseConfigId); + if (message.replicas != null && message.replicas.length) + for (var i = 0; i < message.replicas.length; ++i) + $root.google.spanner.admin.instance.v1.ReplicaInfo.encode(message.replicas[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateUserInstanceConfigAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.CreateUserInstanceConfigAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.executor.v1.CreateUserInstanceConfigAction + * @static + * @param {google.spanner.executor.v1.ICreateUserInstanceConfigAction} message CreateUserInstanceConfigAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateUserInstanceConfigAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateUserInstanceConfigAction message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.executor.v1.CreateUserInstanceConfigAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.executor.v1.CreateUserInstanceConfigAction} CreateUserInstanceConfigAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateUserInstanceConfigAction.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.CreateUserInstanceConfigAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.userConfigId = reader.string(); + break; + } + case 2: { + message.projectId = reader.string(); + break; + } + case 3: { + message.baseConfigId = reader.string(); + break; + } + case 4: { + if (!(message.replicas && message.replicas.length)) + message.replicas = []; + message.replicas.push($root.google.spanner.admin.instance.v1.ReplicaInfo.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateUserInstanceConfigAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.executor.v1.CreateUserInstanceConfigAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.executor.v1.CreateUserInstanceConfigAction} CreateUserInstanceConfigAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateUserInstanceConfigAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateUserInstanceConfigAction message. + * @function verify + * @memberof google.spanner.executor.v1.CreateUserInstanceConfigAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateUserInstanceConfigAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.userConfigId != null && message.hasOwnProperty("userConfigId")) + if (!$util.isString(message.userConfigId)) + return "userConfigId: string expected"; + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.baseConfigId != null && message.hasOwnProperty("baseConfigId")) + if (!$util.isString(message.baseConfigId)) + return "baseConfigId: string expected"; + if (message.replicas != null && message.hasOwnProperty("replicas")) { + if (!Array.isArray(message.replicas)) + return "replicas: array expected"; + for (var i = 0; i < message.replicas.length; ++i) { + var error = $root.google.spanner.admin.instance.v1.ReplicaInfo.verify(message.replicas[i]); + if (error) + return "replicas." + error; + } + } + return null; + }; + + /** + * Creates a CreateUserInstanceConfigAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.executor.v1.CreateUserInstanceConfigAction + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.executor.v1.CreateUserInstanceConfigAction} CreateUserInstanceConfigAction + */ + CreateUserInstanceConfigAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.executor.v1.CreateUserInstanceConfigAction) + return object; + var message = new $root.google.spanner.executor.v1.CreateUserInstanceConfigAction(); + if (object.userConfigId != null) + message.userConfigId = String(object.userConfigId); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.baseConfigId != null) + message.baseConfigId = String(object.baseConfigId); + if (object.replicas) { + if (!Array.isArray(object.replicas)) + throw TypeError(".google.spanner.executor.v1.CreateUserInstanceConfigAction.replicas: array expected"); + message.replicas = []; + for (var i = 0; i < object.replicas.length; ++i) { + if (typeof object.replicas[i] !== "object") + throw TypeError(".google.spanner.executor.v1.CreateUserInstanceConfigAction.replicas: object expected"); + message.replicas[i] = $root.google.spanner.admin.instance.v1.ReplicaInfo.fromObject(object.replicas[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a CreateUserInstanceConfigAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.executor.v1.CreateUserInstanceConfigAction + * @static + * @param {google.spanner.executor.v1.CreateUserInstanceConfigAction} message CreateUserInstanceConfigAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateUserInstanceConfigAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.replicas = []; + if (options.defaults) { + object.userConfigId = ""; + object.projectId = ""; + object.baseConfigId = ""; + } + if (message.userConfigId != null && message.hasOwnProperty("userConfigId")) + object.userConfigId = message.userConfigId; + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.baseConfigId != null && message.hasOwnProperty("baseConfigId")) + object.baseConfigId = message.baseConfigId; + if (message.replicas && message.replicas.length) { + object.replicas = []; + for (var j = 0; j < message.replicas.length; ++j) + object.replicas[j] = $root.google.spanner.admin.instance.v1.ReplicaInfo.toObject(message.replicas[j], options); + } + return object; + }; + + /** + * Converts this CreateUserInstanceConfigAction to JSON. + * @function toJSON + * @memberof google.spanner.executor.v1.CreateUserInstanceConfigAction + * @instance + * @returns {Object.} JSON object + */ + CreateUserInstanceConfigAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateUserInstanceConfigAction + * @function getTypeUrl + * @memberof google.spanner.executor.v1.CreateUserInstanceConfigAction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateUserInstanceConfigAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.executor.v1.CreateUserInstanceConfigAction"; + }; + + return CreateUserInstanceConfigAction; + })(); + + v1.UpdateUserInstanceConfigAction = (function() { + + /** + * Properties of an UpdateUserInstanceConfigAction. + * @memberof google.spanner.executor.v1 + * @interface IUpdateUserInstanceConfigAction + * @property {string|null} [userConfigId] UpdateUserInstanceConfigAction userConfigId + * @property {string|null} [projectId] UpdateUserInstanceConfigAction projectId + * @property {string|null} [displayName] UpdateUserInstanceConfigAction displayName + * @property {Object.|null} [labels] UpdateUserInstanceConfigAction labels + */ + + /** + * Constructs a new UpdateUserInstanceConfigAction. + * @memberof google.spanner.executor.v1 + * @classdesc Represents an UpdateUserInstanceConfigAction. + * @implements IUpdateUserInstanceConfigAction + * @constructor + * @param {google.spanner.executor.v1.IUpdateUserInstanceConfigAction=} [properties] Properties to set + */ + function UpdateUserInstanceConfigAction(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]]; + } + + /** + * UpdateUserInstanceConfigAction userConfigId. + * @member {string} userConfigId + * @memberof google.spanner.executor.v1.UpdateUserInstanceConfigAction + * @instance + */ + UpdateUserInstanceConfigAction.prototype.userConfigId = ""; + + /** + * UpdateUserInstanceConfigAction projectId. + * @member {string} projectId + * @memberof google.spanner.executor.v1.UpdateUserInstanceConfigAction + * @instance + */ + UpdateUserInstanceConfigAction.prototype.projectId = ""; + + /** + * UpdateUserInstanceConfigAction displayName. + * @member {string|null|undefined} displayName + * @memberof google.spanner.executor.v1.UpdateUserInstanceConfigAction + * @instance + */ + UpdateUserInstanceConfigAction.prototype.displayName = null; + + /** + * UpdateUserInstanceConfigAction labels. + * @member {Object.} labels + * @memberof google.spanner.executor.v1.UpdateUserInstanceConfigAction + * @instance + */ + UpdateUserInstanceConfigAction.prototype.labels = $util.emptyObject; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(UpdateUserInstanceConfigAction.prototype, "_displayName", { + get: $util.oneOfGetter($oneOfFields = ["displayName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new UpdateUserInstanceConfigAction instance using the specified properties. + * @function create + * @memberof google.spanner.executor.v1.UpdateUserInstanceConfigAction + * @static + * @param {google.spanner.executor.v1.IUpdateUserInstanceConfigAction=} [properties] Properties to set + * @returns {google.spanner.executor.v1.UpdateUserInstanceConfigAction} UpdateUserInstanceConfigAction instance + */ + UpdateUserInstanceConfigAction.create = function create(properties) { + return new UpdateUserInstanceConfigAction(properties); + }; + + /** + * Encodes the specified UpdateUserInstanceConfigAction message. Does not implicitly {@link google.spanner.executor.v1.UpdateUserInstanceConfigAction.verify|verify} messages. + * @function encode + * @memberof google.spanner.executor.v1.UpdateUserInstanceConfigAction + * @static + * @param {google.spanner.executor.v1.IUpdateUserInstanceConfigAction} message UpdateUserInstanceConfigAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateUserInstanceConfigAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.userConfigId != null && Object.hasOwnProperty.call(message, "userConfigId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.userConfigId); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.projectId); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.displayName); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).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 UpdateUserInstanceConfigAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.UpdateUserInstanceConfigAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.executor.v1.UpdateUserInstanceConfigAction + * @static + * @param {google.spanner.executor.v1.IUpdateUserInstanceConfigAction} message UpdateUserInstanceConfigAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateUserInstanceConfigAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateUserInstanceConfigAction message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.executor.v1.UpdateUserInstanceConfigAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.executor.v1.UpdateUserInstanceConfigAction} UpdateUserInstanceConfigAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateUserInstanceConfigAction.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.UpdateUserInstanceConfigAction(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.userConfigId = reader.string(); + break; + } + case 2: { + message.projectId = reader.string(); + break; + } + case 3: { + message.displayName = reader.string(); + break; + } + case 4: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateUserInstanceConfigAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.executor.v1.UpdateUserInstanceConfigAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.executor.v1.UpdateUserInstanceConfigAction} UpdateUserInstanceConfigAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateUserInstanceConfigAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateUserInstanceConfigAction message. + * @function verify + * @memberof google.spanner.executor.v1.UpdateUserInstanceConfigAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateUserInstanceConfigAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.userConfigId != null && message.hasOwnProperty("userConfigId")) + if (!$util.isString(message.userConfigId)) + return "userConfigId: string expected"; + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) { + properties._displayName = 1; + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + } + 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 UpdateUserInstanceConfigAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.executor.v1.UpdateUserInstanceConfigAction + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.executor.v1.UpdateUserInstanceConfigAction} UpdateUserInstanceConfigAction + */ + UpdateUserInstanceConfigAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.executor.v1.UpdateUserInstanceConfigAction) + return object; + var message = new $root.google.spanner.executor.v1.UpdateUserInstanceConfigAction(); + if (object.userConfigId != null) + message.userConfigId = String(object.userConfigId); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.spanner.executor.v1.UpdateUserInstanceConfigAction.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 UpdateUserInstanceConfigAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.executor.v1.UpdateUserInstanceConfigAction + * @static + * @param {google.spanner.executor.v1.UpdateUserInstanceConfigAction} message UpdateUserInstanceConfigAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateUserInstanceConfigAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.userConfigId = ""; + object.projectId = ""; + } + if (message.userConfigId != null && message.hasOwnProperty("userConfigId")) + object.userConfigId = message.userConfigId; + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.displayName != null && message.hasOwnProperty("displayName")) { + object.displayName = message.displayName; + if (options.oneofs) + object._displayName = "displayName"; + } + 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; + }; + + /** + * Converts this UpdateUserInstanceConfigAction to JSON. + * @function toJSON + * @memberof google.spanner.executor.v1.UpdateUserInstanceConfigAction + * @instance + * @returns {Object.} JSON object + */ + UpdateUserInstanceConfigAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateUserInstanceConfigAction + * @function getTypeUrl + * @memberof google.spanner.executor.v1.UpdateUserInstanceConfigAction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateUserInstanceConfigAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.executor.v1.UpdateUserInstanceConfigAction"; + }; + + return UpdateUserInstanceConfigAction; + })(); + + v1.GetCloudInstanceConfigAction = (function() { + + /** + * Properties of a GetCloudInstanceConfigAction. + * @memberof google.spanner.executor.v1 + * @interface IGetCloudInstanceConfigAction + * @property {string|null} [instanceConfigId] GetCloudInstanceConfigAction instanceConfigId + * @property {string|null} [projectId] GetCloudInstanceConfigAction projectId + */ + + /** + * Constructs a new GetCloudInstanceConfigAction. + * @memberof google.spanner.executor.v1 + * @classdesc Represents a GetCloudInstanceConfigAction. + * @implements IGetCloudInstanceConfigAction + * @constructor + * @param {google.spanner.executor.v1.IGetCloudInstanceConfigAction=} [properties] Properties to set + */ + function GetCloudInstanceConfigAction(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetCloudInstanceConfigAction instanceConfigId. + * @member {string} instanceConfigId + * @memberof google.spanner.executor.v1.GetCloudInstanceConfigAction + * @instance + */ + GetCloudInstanceConfigAction.prototype.instanceConfigId = ""; + + /** + * GetCloudInstanceConfigAction projectId. + * @member {string} projectId + * @memberof google.spanner.executor.v1.GetCloudInstanceConfigAction + * @instance + */ + GetCloudInstanceConfigAction.prototype.projectId = ""; + + /** + * Creates a new GetCloudInstanceConfigAction instance using the specified properties. + * @function create + * @memberof google.spanner.executor.v1.GetCloudInstanceConfigAction + * @static + * @param {google.spanner.executor.v1.IGetCloudInstanceConfigAction=} [properties] Properties to set + * @returns {google.spanner.executor.v1.GetCloudInstanceConfigAction} GetCloudInstanceConfigAction instance + */ + GetCloudInstanceConfigAction.create = function create(properties) { + return new GetCloudInstanceConfigAction(properties); + }; + + /** + * Encodes the specified GetCloudInstanceConfigAction message. Does not implicitly {@link google.spanner.executor.v1.GetCloudInstanceConfigAction.verify|verify} messages. + * @function encode + * @memberof google.spanner.executor.v1.GetCloudInstanceConfigAction + * @static + * @param {google.spanner.executor.v1.IGetCloudInstanceConfigAction} message GetCloudInstanceConfigAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCloudInstanceConfigAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.instanceConfigId != null && Object.hasOwnProperty.call(message, "instanceConfigId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.instanceConfigId); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.projectId); + return writer; + }; + + /** + * Encodes the specified GetCloudInstanceConfigAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.GetCloudInstanceConfigAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.executor.v1.GetCloudInstanceConfigAction + * @static + * @param {google.spanner.executor.v1.IGetCloudInstanceConfigAction} message GetCloudInstanceConfigAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCloudInstanceConfigAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetCloudInstanceConfigAction message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.executor.v1.GetCloudInstanceConfigAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.executor.v1.GetCloudInstanceConfigAction} GetCloudInstanceConfigAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCloudInstanceConfigAction.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.GetCloudInstanceConfigAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.instanceConfigId = reader.string(); + break; + } + case 2: { + message.projectId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetCloudInstanceConfigAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.executor.v1.GetCloudInstanceConfigAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.executor.v1.GetCloudInstanceConfigAction} GetCloudInstanceConfigAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCloudInstanceConfigAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetCloudInstanceConfigAction message. + * @function verify + * @memberof google.spanner.executor.v1.GetCloudInstanceConfigAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetCloudInstanceConfigAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.instanceConfigId != null && message.hasOwnProperty("instanceConfigId")) + if (!$util.isString(message.instanceConfigId)) + return "instanceConfigId: string expected"; + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + return null; + }; + + /** + * Creates a GetCloudInstanceConfigAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.executor.v1.GetCloudInstanceConfigAction + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.executor.v1.GetCloudInstanceConfigAction} GetCloudInstanceConfigAction + */ + GetCloudInstanceConfigAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.executor.v1.GetCloudInstanceConfigAction) + return object; + var message = new $root.google.spanner.executor.v1.GetCloudInstanceConfigAction(); + if (object.instanceConfigId != null) + message.instanceConfigId = String(object.instanceConfigId); + if (object.projectId != null) + message.projectId = String(object.projectId); + return message; + }; + + /** + * Creates a plain object from a GetCloudInstanceConfigAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.executor.v1.GetCloudInstanceConfigAction + * @static + * @param {google.spanner.executor.v1.GetCloudInstanceConfigAction} message GetCloudInstanceConfigAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetCloudInstanceConfigAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.instanceConfigId = ""; + object.projectId = ""; + } + if (message.instanceConfigId != null && message.hasOwnProperty("instanceConfigId")) + object.instanceConfigId = message.instanceConfigId; + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + return object; + }; + + /** + * Converts this GetCloudInstanceConfigAction to JSON. + * @function toJSON + * @memberof google.spanner.executor.v1.GetCloudInstanceConfigAction + * @instance + * @returns {Object.} JSON object + */ + GetCloudInstanceConfigAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetCloudInstanceConfigAction + * @function getTypeUrl + * @memberof google.spanner.executor.v1.GetCloudInstanceConfigAction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetCloudInstanceConfigAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.executor.v1.GetCloudInstanceConfigAction"; + }; + + return GetCloudInstanceConfigAction; + })(); + + v1.DeleteUserInstanceConfigAction = (function() { + + /** + * Properties of a DeleteUserInstanceConfigAction. + * @memberof google.spanner.executor.v1 + * @interface IDeleteUserInstanceConfigAction + * @property {string|null} [userConfigId] DeleteUserInstanceConfigAction userConfigId + * @property {string|null} [projectId] DeleteUserInstanceConfigAction projectId + */ + + /** + * Constructs a new DeleteUserInstanceConfigAction. + * @memberof google.spanner.executor.v1 + * @classdesc Represents a DeleteUserInstanceConfigAction. + * @implements IDeleteUserInstanceConfigAction + * @constructor + * @param {google.spanner.executor.v1.IDeleteUserInstanceConfigAction=} [properties] Properties to set + */ + function DeleteUserInstanceConfigAction(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteUserInstanceConfigAction userConfigId. + * @member {string} userConfigId + * @memberof google.spanner.executor.v1.DeleteUserInstanceConfigAction + * @instance + */ + DeleteUserInstanceConfigAction.prototype.userConfigId = ""; + + /** + * DeleteUserInstanceConfigAction projectId. + * @member {string} projectId + * @memberof google.spanner.executor.v1.DeleteUserInstanceConfigAction + * @instance + */ + DeleteUserInstanceConfigAction.prototype.projectId = ""; + + /** + * Creates a new DeleteUserInstanceConfigAction instance using the specified properties. + * @function create + * @memberof google.spanner.executor.v1.DeleteUserInstanceConfigAction + * @static + * @param {google.spanner.executor.v1.IDeleteUserInstanceConfigAction=} [properties] Properties to set + * @returns {google.spanner.executor.v1.DeleteUserInstanceConfigAction} DeleteUserInstanceConfigAction instance + */ + DeleteUserInstanceConfigAction.create = function create(properties) { + return new DeleteUserInstanceConfigAction(properties); + }; + + /** + * Encodes the specified DeleteUserInstanceConfigAction message. Does not implicitly {@link google.spanner.executor.v1.DeleteUserInstanceConfigAction.verify|verify} messages. + * @function encode + * @memberof google.spanner.executor.v1.DeleteUserInstanceConfigAction + * @static + * @param {google.spanner.executor.v1.IDeleteUserInstanceConfigAction} message DeleteUserInstanceConfigAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteUserInstanceConfigAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.userConfigId != null && Object.hasOwnProperty.call(message, "userConfigId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.userConfigId); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.projectId); + return writer; + }; + + /** + * Encodes the specified DeleteUserInstanceConfigAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.DeleteUserInstanceConfigAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.executor.v1.DeleteUserInstanceConfigAction + * @static + * @param {google.spanner.executor.v1.IDeleteUserInstanceConfigAction} message DeleteUserInstanceConfigAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteUserInstanceConfigAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteUserInstanceConfigAction message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.executor.v1.DeleteUserInstanceConfigAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.executor.v1.DeleteUserInstanceConfigAction} DeleteUserInstanceConfigAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteUserInstanceConfigAction.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.DeleteUserInstanceConfigAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.userConfigId = reader.string(); + break; + } + case 2: { + message.projectId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteUserInstanceConfigAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.executor.v1.DeleteUserInstanceConfigAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.executor.v1.DeleteUserInstanceConfigAction} DeleteUserInstanceConfigAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteUserInstanceConfigAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteUserInstanceConfigAction message. + * @function verify + * @memberof google.spanner.executor.v1.DeleteUserInstanceConfigAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteUserInstanceConfigAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.userConfigId != null && message.hasOwnProperty("userConfigId")) + if (!$util.isString(message.userConfigId)) + return "userConfigId: string expected"; + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + return null; + }; + + /** + * Creates a DeleteUserInstanceConfigAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.executor.v1.DeleteUserInstanceConfigAction + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.executor.v1.DeleteUserInstanceConfigAction} DeleteUserInstanceConfigAction + */ + DeleteUserInstanceConfigAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.executor.v1.DeleteUserInstanceConfigAction) + return object; + var message = new $root.google.spanner.executor.v1.DeleteUserInstanceConfigAction(); + if (object.userConfigId != null) + message.userConfigId = String(object.userConfigId); + if (object.projectId != null) + message.projectId = String(object.projectId); + return message; + }; + + /** + * Creates a plain object from a DeleteUserInstanceConfigAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.executor.v1.DeleteUserInstanceConfigAction + * @static + * @param {google.spanner.executor.v1.DeleteUserInstanceConfigAction} message DeleteUserInstanceConfigAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteUserInstanceConfigAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.userConfigId = ""; + object.projectId = ""; + } + if (message.userConfigId != null && message.hasOwnProperty("userConfigId")) + object.userConfigId = message.userConfigId; + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + return object; + }; + + /** + * Converts this DeleteUserInstanceConfigAction to JSON. + * @function toJSON + * @memberof google.spanner.executor.v1.DeleteUserInstanceConfigAction + * @instance + * @returns {Object.} JSON object + */ + DeleteUserInstanceConfigAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteUserInstanceConfigAction + * @function getTypeUrl + * @memberof google.spanner.executor.v1.DeleteUserInstanceConfigAction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteUserInstanceConfigAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.executor.v1.DeleteUserInstanceConfigAction"; + }; + + return DeleteUserInstanceConfigAction; + })(); + + v1.ListCloudInstanceConfigsAction = (function() { + + /** + * Properties of a ListCloudInstanceConfigsAction. + * @memberof google.spanner.executor.v1 + * @interface IListCloudInstanceConfigsAction + * @property {string|null} [projectId] ListCloudInstanceConfigsAction projectId + * @property {number|null} [pageSize] ListCloudInstanceConfigsAction pageSize + * @property {string|null} [pageToken] ListCloudInstanceConfigsAction pageToken + */ + + /** + * Constructs a new ListCloudInstanceConfigsAction. + * @memberof google.spanner.executor.v1 + * @classdesc Represents a ListCloudInstanceConfigsAction. + * @implements IListCloudInstanceConfigsAction + * @constructor + * @param {google.spanner.executor.v1.IListCloudInstanceConfigsAction=} [properties] Properties to set + */ + function ListCloudInstanceConfigsAction(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListCloudInstanceConfigsAction projectId. + * @member {string} projectId + * @memberof google.spanner.executor.v1.ListCloudInstanceConfigsAction + * @instance + */ + ListCloudInstanceConfigsAction.prototype.projectId = ""; + + /** + * ListCloudInstanceConfigsAction pageSize. + * @member {number|null|undefined} pageSize + * @memberof google.spanner.executor.v1.ListCloudInstanceConfigsAction + * @instance + */ + ListCloudInstanceConfigsAction.prototype.pageSize = null; + + /** + * ListCloudInstanceConfigsAction pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.spanner.executor.v1.ListCloudInstanceConfigsAction + * @instance + */ + ListCloudInstanceConfigsAction.prototype.pageToken = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ListCloudInstanceConfigsAction.prototype, "_pageSize", { + get: $util.oneOfGetter($oneOfFields = ["pageSize"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ListCloudInstanceConfigsAction.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListCloudInstanceConfigsAction instance using the specified properties. + * @function create + * @memberof google.spanner.executor.v1.ListCloudInstanceConfigsAction + * @static + * @param {google.spanner.executor.v1.IListCloudInstanceConfigsAction=} [properties] Properties to set + * @returns {google.spanner.executor.v1.ListCloudInstanceConfigsAction} ListCloudInstanceConfigsAction instance + */ + ListCloudInstanceConfigsAction.create = function create(properties) { + return new ListCloudInstanceConfigsAction(properties); + }; + + /** + * Encodes the specified ListCloudInstanceConfigsAction message. Does not implicitly {@link google.spanner.executor.v1.ListCloudInstanceConfigsAction.verify|verify} messages. + * @function encode + * @memberof google.spanner.executor.v1.ListCloudInstanceConfigsAction + * @static + * @param {google.spanner.executor.v1.IListCloudInstanceConfigsAction} message ListCloudInstanceConfigsAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCloudInstanceConfigsAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListCloudInstanceConfigsAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.ListCloudInstanceConfigsAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.executor.v1.ListCloudInstanceConfigsAction + * @static + * @param {google.spanner.executor.v1.IListCloudInstanceConfigsAction} message ListCloudInstanceConfigsAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCloudInstanceConfigsAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListCloudInstanceConfigsAction message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.executor.v1.ListCloudInstanceConfigsAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.executor.v1.ListCloudInstanceConfigsAction} ListCloudInstanceConfigsAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCloudInstanceConfigsAction.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.ListCloudInstanceConfigsAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.projectId = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListCloudInstanceConfigsAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.executor.v1.ListCloudInstanceConfigsAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.executor.v1.ListCloudInstanceConfigsAction} ListCloudInstanceConfigsAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCloudInstanceConfigsAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListCloudInstanceConfigsAction message. + * @function verify + * @memberof google.spanner.executor.v1.ListCloudInstanceConfigsAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListCloudInstanceConfigsAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) { + properties._pageSize = 1; + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + return null; + }; + + /** + * Creates a ListCloudInstanceConfigsAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.executor.v1.ListCloudInstanceConfigsAction + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.executor.v1.ListCloudInstanceConfigsAction} ListCloudInstanceConfigsAction + */ + ListCloudInstanceConfigsAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.executor.v1.ListCloudInstanceConfigsAction) + return object; + var message = new $root.google.spanner.executor.v1.ListCloudInstanceConfigsAction(); + if (object.projectId != null) + message.projectId = String(object.projectId); + 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 ListCloudInstanceConfigsAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.executor.v1.ListCloudInstanceConfigsAction + * @static + * @param {google.spanner.executor.v1.ListCloudInstanceConfigsAction} message ListCloudInstanceConfigsAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListCloudInstanceConfigsAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.projectId = ""; + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) { + object.pageSize = message.pageSize; + if (options.oneofs) + object._pageSize = "pageSize"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + return object; + }; + + /** + * Converts this ListCloudInstanceConfigsAction to JSON. + * @function toJSON + * @memberof google.spanner.executor.v1.ListCloudInstanceConfigsAction + * @instance + * @returns {Object.} JSON object + */ + ListCloudInstanceConfigsAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListCloudInstanceConfigsAction + * @function getTypeUrl + * @memberof google.spanner.executor.v1.ListCloudInstanceConfigsAction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListCloudInstanceConfigsAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.executor.v1.ListCloudInstanceConfigsAction"; + }; + + return ListCloudInstanceConfigsAction; + })(); + + v1.CreateCloudInstanceAction = (function() { + + /** + * Properties of a CreateCloudInstanceAction. + * @memberof google.spanner.executor.v1 + * @interface ICreateCloudInstanceAction + * @property {string|null} [instanceId] CreateCloudInstanceAction instanceId + * @property {string|null} [projectId] CreateCloudInstanceAction projectId + * @property {string|null} [instanceConfigId] CreateCloudInstanceAction instanceConfigId + * @property {number|null} [nodeCount] CreateCloudInstanceAction nodeCount + * @property {number|null} [processingUnits] CreateCloudInstanceAction processingUnits + * @property {google.spanner.admin.instance.v1.IAutoscalingConfig|null} [autoscalingConfig] CreateCloudInstanceAction autoscalingConfig + * @property {Object.|null} [labels] CreateCloudInstanceAction labels + */ + + /** + * Constructs a new CreateCloudInstanceAction. + * @memberof google.spanner.executor.v1 + * @classdesc Represents a CreateCloudInstanceAction. + * @implements ICreateCloudInstanceAction + * @constructor + * @param {google.spanner.executor.v1.ICreateCloudInstanceAction=} [properties] Properties to set + */ + function CreateCloudInstanceAction(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]]; + } + + /** + * CreateCloudInstanceAction instanceId. + * @member {string} instanceId + * @memberof google.spanner.executor.v1.CreateCloudInstanceAction + * @instance + */ + CreateCloudInstanceAction.prototype.instanceId = ""; + + /** + * CreateCloudInstanceAction projectId. + * @member {string} projectId + * @memberof google.spanner.executor.v1.CreateCloudInstanceAction + * @instance + */ + CreateCloudInstanceAction.prototype.projectId = ""; + + /** + * CreateCloudInstanceAction instanceConfigId. + * @member {string} instanceConfigId + * @memberof google.spanner.executor.v1.CreateCloudInstanceAction + * @instance + */ + CreateCloudInstanceAction.prototype.instanceConfigId = ""; + + /** + * CreateCloudInstanceAction nodeCount. + * @member {number|null|undefined} nodeCount + * @memberof google.spanner.executor.v1.CreateCloudInstanceAction + * @instance + */ + CreateCloudInstanceAction.prototype.nodeCount = null; + + /** + * CreateCloudInstanceAction processingUnits. + * @member {number|null|undefined} processingUnits + * @memberof google.spanner.executor.v1.CreateCloudInstanceAction + * @instance + */ + CreateCloudInstanceAction.prototype.processingUnits = null; + + /** + * CreateCloudInstanceAction autoscalingConfig. + * @member {google.spanner.admin.instance.v1.IAutoscalingConfig|null|undefined} autoscalingConfig + * @memberof google.spanner.executor.v1.CreateCloudInstanceAction + * @instance + */ + CreateCloudInstanceAction.prototype.autoscalingConfig = null; + + /** + * CreateCloudInstanceAction labels. + * @member {Object.} labels + * @memberof google.spanner.executor.v1.CreateCloudInstanceAction + * @instance + */ + CreateCloudInstanceAction.prototype.labels = $util.emptyObject; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(CreateCloudInstanceAction.prototype, "_nodeCount", { + get: $util.oneOfGetter($oneOfFields = ["nodeCount"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(CreateCloudInstanceAction.prototype, "_processingUnits", { + get: $util.oneOfGetter($oneOfFields = ["processingUnits"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(CreateCloudInstanceAction.prototype, "_autoscalingConfig", { + get: $util.oneOfGetter($oneOfFields = ["autoscalingConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CreateCloudInstanceAction instance using the specified properties. + * @function create + * @memberof google.spanner.executor.v1.CreateCloudInstanceAction + * @static + * @param {google.spanner.executor.v1.ICreateCloudInstanceAction=} [properties] Properties to set + * @returns {google.spanner.executor.v1.CreateCloudInstanceAction} CreateCloudInstanceAction instance + */ + CreateCloudInstanceAction.create = function create(properties) { + return new CreateCloudInstanceAction(properties); + }; + + /** + * Encodes the specified CreateCloudInstanceAction message. Does not implicitly {@link google.spanner.executor.v1.CreateCloudInstanceAction.verify|verify} messages. + * @function encode + * @memberof google.spanner.executor.v1.CreateCloudInstanceAction + * @static + * @param {google.spanner.executor.v1.ICreateCloudInstanceAction} message CreateCloudInstanceAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateCloudInstanceAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.instanceId); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.projectId); + if (message.instanceConfigId != null && Object.hasOwnProperty.call(message, "instanceConfigId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.instanceConfigId); + if (message.nodeCount != null && Object.hasOwnProperty.call(message, "nodeCount")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.nodeCount); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.processingUnits != null && Object.hasOwnProperty.call(message, "processingUnits")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.processingUnits); + if (message.autoscalingConfig != null && Object.hasOwnProperty.call(message, "autoscalingConfig")) + $root.google.spanner.admin.instance.v1.AutoscalingConfig.encode(message.autoscalingConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateCloudInstanceAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.CreateCloudInstanceAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.executor.v1.CreateCloudInstanceAction + * @static + * @param {google.spanner.executor.v1.ICreateCloudInstanceAction} message CreateCloudInstanceAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateCloudInstanceAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateCloudInstanceAction message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.executor.v1.CreateCloudInstanceAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.executor.v1.CreateCloudInstanceAction} CreateCloudInstanceAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateCloudInstanceAction.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.CreateCloudInstanceAction(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.instanceId = reader.string(); + break; + } + case 2: { + message.projectId = reader.string(); + break; + } + case 3: { + message.instanceConfigId = reader.string(); + break; + } + case 4: { + message.nodeCount = reader.int32(); + break; + } + case 6: { + message.processingUnits = reader.int32(); + break; + } + case 7: { + message.autoscalingConfig = $root.google.spanner.admin.instance.v1.AutoscalingConfig.decode(reader, reader.uint32()); + break; + } + case 5: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateCloudInstanceAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.executor.v1.CreateCloudInstanceAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.executor.v1.CreateCloudInstanceAction} CreateCloudInstanceAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateCloudInstanceAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateCloudInstanceAction message. + * @function verify + * @memberof google.spanner.executor.v1.CreateCloudInstanceAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateCloudInstanceAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + if (!$util.isString(message.instanceId)) + return "instanceId: string expected"; + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.instanceConfigId != null && message.hasOwnProperty("instanceConfigId")) + if (!$util.isString(message.instanceConfigId)) + return "instanceConfigId: string expected"; + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) { + properties._nodeCount = 1; + if (!$util.isInteger(message.nodeCount)) + return "nodeCount: integer expected"; + } + if (message.processingUnits != null && message.hasOwnProperty("processingUnits")) { + properties._processingUnits = 1; + if (!$util.isInteger(message.processingUnits)) + return "processingUnits: integer expected"; + } + if (message.autoscalingConfig != null && message.hasOwnProperty("autoscalingConfig")) { + properties._autoscalingConfig = 1; + { + var error = $root.google.spanner.admin.instance.v1.AutoscalingConfig.verify(message.autoscalingConfig); + if (error) + return "autoscalingConfig." + error; + } + } + 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 CreateCloudInstanceAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.executor.v1.CreateCloudInstanceAction + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.executor.v1.CreateCloudInstanceAction} CreateCloudInstanceAction + */ + CreateCloudInstanceAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.executor.v1.CreateCloudInstanceAction) + return object; + var message = new $root.google.spanner.executor.v1.CreateCloudInstanceAction(); + if (object.instanceId != null) + message.instanceId = String(object.instanceId); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.instanceConfigId != null) + message.instanceConfigId = String(object.instanceConfigId); + if (object.nodeCount != null) + message.nodeCount = object.nodeCount | 0; + if (object.processingUnits != null) + message.processingUnits = object.processingUnits | 0; + if (object.autoscalingConfig != null) { + if (typeof object.autoscalingConfig !== "object") + throw TypeError(".google.spanner.executor.v1.CreateCloudInstanceAction.autoscalingConfig: object expected"); + message.autoscalingConfig = $root.google.spanner.admin.instance.v1.AutoscalingConfig.fromObject(object.autoscalingConfig); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.spanner.executor.v1.CreateCloudInstanceAction.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 CreateCloudInstanceAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.executor.v1.CreateCloudInstanceAction + * @static + * @param {google.spanner.executor.v1.CreateCloudInstanceAction} message CreateCloudInstanceAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateCloudInstanceAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.instanceId = ""; + object.projectId = ""; + object.instanceConfigId = ""; + } + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + object.instanceId = message.instanceId; + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.instanceConfigId != null && message.hasOwnProperty("instanceConfigId")) + object.instanceConfigId = message.instanceConfigId; + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) { + object.nodeCount = message.nodeCount; + if (options.oneofs) + object._nodeCount = "nodeCount"; + } + 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.processingUnits != null && message.hasOwnProperty("processingUnits")) { + object.processingUnits = message.processingUnits; + if (options.oneofs) + object._processingUnits = "processingUnits"; + } + if (message.autoscalingConfig != null && message.hasOwnProperty("autoscalingConfig")) { + object.autoscalingConfig = $root.google.spanner.admin.instance.v1.AutoscalingConfig.toObject(message.autoscalingConfig, options); + if (options.oneofs) + object._autoscalingConfig = "autoscalingConfig"; + } + return object; + }; + + /** + * Converts this CreateCloudInstanceAction to JSON. + * @function toJSON + * @memberof google.spanner.executor.v1.CreateCloudInstanceAction + * @instance + * @returns {Object.} JSON object + */ + CreateCloudInstanceAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateCloudInstanceAction + * @function getTypeUrl + * @memberof google.spanner.executor.v1.CreateCloudInstanceAction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateCloudInstanceAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.executor.v1.CreateCloudInstanceAction"; + }; + + return CreateCloudInstanceAction; + })(); + + v1.UpdateCloudInstanceAction = (function() { + + /** + * Properties of an UpdateCloudInstanceAction. + * @memberof google.spanner.executor.v1 + * @interface IUpdateCloudInstanceAction + * @property {string|null} [instanceId] UpdateCloudInstanceAction instanceId + * @property {string|null} [projectId] UpdateCloudInstanceAction projectId + * @property {string|null} [displayName] UpdateCloudInstanceAction displayName + * @property {number|null} [nodeCount] UpdateCloudInstanceAction nodeCount + * @property {number|null} [processingUnits] UpdateCloudInstanceAction processingUnits + * @property {google.spanner.admin.instance.v1.IAutoscalingConfig|null} [autoscalingConfig] UpdateCloudInstanceAction autoscalingConfig + * @property {Object.|null} [labels] UpdateCloudInstanceAction labels + */ + + /** + * Constructs a new UpdateCloudInstanceAction. + * @memberof google.spanner.executor.v1 + * @classdesc Represents an UpdateCloudInstanceAction. + * @implements IUpdateCloudInstanceAction + * @constructor + * @param {google.spanner.executor.v1.IUpdateCloudInstanceAction=} [properties] Properties to set + */ + function UpdateCloudInstanceAction(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]]; + } + + /** + * UpdateCloudInstanceAction instanceId. + * @member {string} instanceId + * @memberof google.spanner.executor.v1.UpdateCloudInstanceAction + * @instance + */ + UpdateCloudInstanceAction.prototype.instanceId = ""; + + /** + * UpdateCloudInstanceAction projectId. + * @member {string} projectId + * @memberof google.spanner.executor.v1.UpdateCloudInstanceAction + * @instance + */ + UpdateCloudInstanceAction.prototype.projectId = ""; + + /** + * UpdateCloudInstanceAction displayName. + * @member {string|null|undefined} displayName + * @memberof google.spanner.executor.v1.UpdateCloudInstanceAction + * @instance + */ + UpdateCloudInstanceAction.prototype.displayName = null; + + /** + * UpdateCloudInstanceAction nodeCount. + * @member {number|null|undefined} nodeCount + * @memberof google.spanner.executor.v1.UpdateCloudInstanceAction + * @instance + */ + UpdateCloudInstanceAction.prototype.nodeCount = null; + + /** + * UpdateCloudInstanceAction processingUnits. + * @member {number|null|undefined} processingUnits + * @memberof google.spanner.executor.v1.UpdateCloudInstanceAction + * @instance + */ + UpdateCloudInstanceAction.prototype.processingUnits = null; + + /** + * UpdateCloudInstanceAction autoscalingConfig. + * @member {google.spanner.admin.instance.v1.IAutoscalingConfig|null|undefined} autoscalingConfig + * @memberof google.spanner.executor.v1.UpdateCloudInstanceAction + * @instance + */ + UpdateCloudInstanceAction.prototype.autoscalingConfig = null; + + /** + * UpdateCloudInstanceAction labels. + * @member {Object.} labels + * @memberof google.spanner.executor.v1.UpdateCloudInstanceAction + * @instance + */ + UpdateCloudInstanceAction.prototype.labels = $util.emptyObject; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(UpdateCloudInstanceAction.prototype, "_displayName", { + get: $util.oneOfGetter($oneOfFields = ["displayName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(UpdateCloudInstanceAction.prototype, "_nodeCount", { + get: $util.oneOfGetter($oneOfFields = ["nodeCount"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(UpdateCloudInstanceAction.prototype, "_processingUnits", { + get: $util.oneOfGetter($oneOfFields = ["processingUnits"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(UpdateCloudInstanceAction.prototype, "_autoscalingConfig", { + get: $util.oneOfGetter($oneOfFields = ["autoscalingConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new UpdateCloudInstanceAction instance using the specified properties. + * @function create + * @memberof google.spanner.executor.v1.UpdateCloudInstanceAction + * @static + * @param {google.spanner.executor.v1.IUpdateCloudInstanceAction=} [properties] Properties to set + * @returns {google.spanner.executor.v1.UpdateCloudInstanceAction} UpdateCloudInstanceAction instance + */ + UpdateCloudInstanceAction.create = function create(properties) { + return new UpdateCloudInstanceAction(properties); + }; + + /** + * Encodes the specified UpdateCloudInstanceAction message. Does not implicitly {@link google.spanner.executor.v1.UpdateCloudInstanceAction.verify|verify} messages. + * @function encode + * @memberof google.spanner.executor.v1.UpdateCloudInstanceAction + * @static + * @param {google.spanner.executor.v1.IUpdateCloudInstanceAction} message UpdateCloudInstanceAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateCloudInstanceAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.instanceId); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.projectId); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.displayName); + if (message.nodeCount != null && Object.hasOwnProperty.call(message, "nodeCount")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.nodeCount); + if (message.processingUnits != null && Object.hasOwnProperty.call(message, "processingUnits")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.processingUnits); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.autoscalingConfig != null && Object.hasOwnProperty.call(message, "autoscalingConfig")) + $root.google.spanner.admin.instance.v1.AutoscalingConfig.encode(message.autoscalingConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateCloudInstanceAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.UpdateCloudInstanceAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.executor.v1.UpdateCloudInstanceAction + * @static + * @param {google.spanner.executor.v1.IUpdateCloudInstanceAction} message UpdateCloudInstanceAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateCloudInstanceAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateCloudInstanceAction message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.executor.v1.UpdateCloudInstanceAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.executor.v1.UpdateCloudInstanceAction} UpdateCloudInstanceAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateCloudInstanceAction.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.UpdateCloudInstanceAction(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.instanceId = reader.string(); + break; + } + case 2: { + message.projectId = reader.string(); + break; + } + case 3: { + message.displayName = reader.string(); + break; + } + case 4: { + message.nodeCount = reader.int32(); + break; + } + case 5: { + message.processingUnits = reader.int32(); + break; + } + case 7: { + message.autoscalingConfig = $root.google.spanner.admin.instance.v1.AutoscalingConfig.decode(reader, reader.uint32()); + break; + } + case 6: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateCloudInstanceAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.executor.v1.UpdateCloudInstanceAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.executor.v1.UpdateCloudInstanceAction} UpdateCloudInstanceAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateCloudInstanceAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateCloudInstanceAction message. + * @function verify + * @memberof google.spanner.executor.v1.UpdateCloudInstanceAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateCloudInstanceAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + if (!$util.isString(message.instanceId)) + return "instanceId: string expected"; + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) { + properties._displayName = 1; + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + } + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) { + properties._nodeCount = 1; + if (!$util.isInteger(message.nodeCount)) + return "nodeCount: integer expected"; + } + if (message.processingUnits != null && message.hasOwnProperty("processingUnits")) { + properties._processingUnits = 1; + if (!$util.isInteger(message.processingUnits)) + return "processingUnits: integer expected"; + } + if (message.autoscalingConfig != null && message.hasOwnProperty("autoscalingConfig")) { + properties._autoscalingConfig = 1; + { + var error = $root.google.spanner.admin.instance.v1.AutoscalingConfig.verify(message.autoscalingConfig); + if (error) + return "autoscalingConfig." + error; + } + } + 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 UpdateCloudInstanceAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.executor.v1.UpdateCloudInstanceAction + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.executor.v1.UpdateCloudInstanceAction} UpdateCloudInstanceAction + */ + UpdateCloudInstanceAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.executor.v1.UpdateCloudInstanceAction) + return object; + var message = new $root.google.spanner.executor.v1.UpdateCloudInstanceAction(); + if (object.instanceId != null) + message.instanceId = String(object.instanceId); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.nodeCount != null) + message.nodeCount = object.nodeCount | 0; + if (object.processingUnits != null) + message.processingUnits = object.processingUnits | 0; + if (object.autoscalingConfig != null) { + if (typeof object.autoscalingConfig !== "object") + throw TypeError(".google.spanner.executor.v1.UpdateCloudInstanceAction.autoscalingConfig: object expected"); + message.autoscalingConfig = $root.google.spanner.admin.instance.v1.AutoscalingConfig.fromObject(object.autoscalingConfig); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.spanner.executor.v1.UpdateCloudInstanceAction.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 UpdateCloudInstanceAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.executor.v1.UpdateCloudInstanceAction + * @static + * @param {google.spanner.executor.v1.UpdateCloudInstanceAction} message UpdateCloudInstanceAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateCloudInstanceAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.instanceId = ""; + object.projectId = ""; + } + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + object.instanceId = message.instanceId; + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.displayName != null && message.hasOwnProperty("displayName")) { + object.displayName = message.displayName; + if (options.oneofs) + object._displayName = "displayName"; + } + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) { + object.nodeCount = message.nodeCount; + if (options.oneofs) + object._nodeCount = "nodeCount"; + } + if (message.processingUnits != null && message.hasOwnProperty("processingUnits")) { + object.processingUnits = message.processingUnits; + if (options.oneofs) + object._processingUnits = "processingUnits"; + } + 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.autoscalingConfig != null && message.hasOwnProperty("autoscalingConfig")) { + object.autoscalingConfig = $root.google.spanner.admin.instance.v1.AutoscalingConfig.toObject(message.autoscalingConfig, options); + if (options.oneofs) + object._autoscalingConfig = "autoscalingConfig"; + } + return object; + }; + + /** + * Converts this UpdateCloudInstanceAction to JSON. + * @function toJSON + * @memberof google.spanner.executor.v1.UpdateCloudInstanceAction + * @instance + * @returns {Object.} JSON object + */ + UpdateCloudInstanceAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateCloudInstanceAction + * @function getTypeUrl + * @memberof google.spanner.executor.v1.UpdateCloudInstanceAction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateCloudInstanceAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.executor.v1.UpdateCloudInstanceAction"; + }; + + return UpdateCloudInstanceAction; + })(); + + v1.DeleteCloudInstanceAction = (function() { + + /** + * Properties of a DeleteCloudInstanceAction. + * @memberof google.spanner.executor.v1 + * @interface IDeleteCloudInstanceAction + * @property {string|null} [instanceId] DeleteCloudInstanceAction instanceId + * @property {string|null} [projectId] DeleteCloudInstanceAction projectId + */ + + /** + * Constructs a new DeleteCloudInstanceAction. + * @memberof google.spanner.executor.v1 + * @classdesc Represents a DeleteCloudInstanceAction. + * @implements IDeleteCloudInstanceAction + * @constructor + * @param {google.spanner.executor.v1.IDeleteCloudInstanceAction=} [properties] Properties to set + */ + function DeleteCloudInstanceAction(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteCloudInstanceAction instanceId. + * @member {string} instanceId + * @memberof google.spanner.executor.v1.DeleteCloudInstanceAction + * @instance + */ + DeleteCloudInstanceAction.prototype.instanceId = ""; + + /** + * DeleteCloudInstanceAction projectId. + * @member {string} projectId + * @memberof google.spanner.executor.v1.DeleteCloudInstanceAction + * @instance + */ + DeleteCloudInstanceAction.prototype.projectId = ""; + + /** + * Creates a new DeleteCloudInstanceAction instance using the specified properties. + * @function create + * @memberof google.spanner.executor.v1.DeleteCloudInstanceAction + * @static + * @param {google.spanner.executor.v1.IDeleteCloudInstanceAction=} [properties] Properties to set + * @returns {google.spanner.executor.v1.DeleteCloudInstanceAction} DeleteCloudInstanceAction instance + */ + DeleteCloudInstanceAction.create = function create(properties) { + return new DeleteCloudInstanceAction(properties); + }; + + /** + * Encodes the specified DeleteCloudInstanceAction message. Does not implicitly {@link google.spanner.executor.v1.DeleteCloudInstanceAction.verify|verify} messages. + * @function encode + * @memberof google.spanner.executor.v1.DeleteCloudInstanceAction + * @static + * @param {google.spanner.executor.v1.IDeleteCloudInstanceAction} message DeleteCloudInstanceAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteCloudInstanceAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.instanceId); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.projectId); + return writer; + }; + + /** + * Encodes the specified DeleteCloudInstanceAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.DeleteCloudInstanceAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.executor.v1.DeleteCloudInstanceAction + * @static + * @param {google.spanner.executor.v1.IDeleteCloudInstanceAction} message DeleteCloudInstanceAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteCloudInstanceAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteCloudInstanceAction message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.executor.v1.DeleteCloudInstanceAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.executor.v1.DeleteCloudInstanceAction} DeleteCloudInstanceAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteCloudInstanceAction.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.DeleteCloudInstanceAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.instanceId = reader.string(); + break; + } + case 2: { + message.projectId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteCloudInstanceAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.executor.v1.DeleteCloudInstanceAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.executor.v1.DeleteCloudInstanceAction} DeleteCloudInstanceAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteCloudInstanceAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteCloudInstanceAction message. + * @function verify + * @memberof google.spanner.executor.v1.DeleteCloudInstanceAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteCloudInstanceAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + if (!$util.isString(message.instanceId)) + return "instanceId: string expected"; + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + return null; + }; + + /** + * Creates a DeleteCloudInstanceAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.executor.v1.DeleteCloudInstanceAction + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.executor.v1.DeleteCloudInstanceAction} DeleteCloudInstanceAction + */ + DeleteCloudInstanceAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.executor.v1.DeleteCloudInstanceAction) + return object; + var message = new $root.google.spanner.executor.v1.DeleteCloudInstanceAction(); + if (object.instanceId != null) + message.instanceId = String(object.instanceId); + if (object.projectId != null) + message.projectId = String(object.projectId); + return message; + }; + + /** + * Creates a plain object from a DeleteCloudInstanceAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.executor.v1.DeleteCloudInstanceAction + * @static + * @param {google.spanner.executor.v1.DeleteCloudInstanceAction} message DeleteCloudInstanceAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteCloudInstanceAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.instanceId = ""; + object.projectId = ""; + } + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + object.instanceId = message.instanceId; + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + return object; + }; + + /** + * Converts this DeleteCloudInstanceAction to JSON. + * @function toJSON + * @memberof google.spanner.executor.v1.DeleteCloudInstanceAction + * @instance + * @returns {Object.} JSON object + */ + DeleteCloudInstanceAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteCloudInstanceAction + * @function getTypeUrl + * @memberof google.spanner.executor.v1.DeleteCloudInstanceAction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteCloudInstanceAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.executor.v1.DeleteCloudInstanceAction"; + }; + + return DeleteCloudInstanceAction; + })(); + + v1.CreateCloudDatabaseAction = (function() { + + /** + * Properties of a CreateCloudDatabaseAction. + * @memberof google.spanner.executor.v1 + * @interface ICreateCloudDatabaseAction + * @property {string|null} [instanceId] CreateCloudDatabaseAction instanceId + * @property {string|null} [projectId] CreateCloudDatabaseAction projectId + * @property {string|null} [databaseId] CreateCloudDatabaseAction databaseId + * @property {Array.|null} [sdlStatement] CreateCloudDatabaseAction sdlStatement + * @property {google.spanner.admin.database.v1.IEncryptionConfig|null} [encryptionConfig] CreateCloudDatabaseAction encryptionConfig + * @property {string|null} [dialect] CreateCloudDatabaseAction dialect + * @property {Uint8Array|null} [protoDescriptors] CreateCloudDatabaseAction protoDescriptors + */ + + /** + * Constructs a new CreateCloudDatabaseAction. + * @memberof google.spanner.executor.v1 + * @classdesc Represents a CreateCloudDatabaseAction. + * @implements ICreateCloudDatabaseAction + * @constructor + * @param {google.spanner.executor.v1.ICreateCloudDatabaseAction=} [properties] Properties to set + */ + function CreateCloudDatabaseAction(properties) { + this.sdlStatement = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateCloudDatabaseAction instanceId. + * @member {string} instanceId + * @memberof google.spanner.executor.v1.CreateCloudDatabaseAction + * @instance + */ + CreateCloudDatabaseAction.prototype.instanceId = ""; + + /** + * CreateCloudDatabaseAction projectId. + * @member {string} projectId + * @memberof google.spanner.executor.v1.CreateCloudDatabaseAction + * @instance + */ + CreateCloudDatabaseAction.prototype.projectId = ""; + + /** + * CreateCloudDatabaseAction databaseId. + * @member {string} databaseId + * @memberof google.spanner.executor.v1.CreateCloudDatabaseAction + * @instance + */ + CreateCloudDatabaseAction.prototype.databaseId = ""; + + /** + * CreateCloudDatabaseAction sdlStatement. + * @member {Array.} sdlStatement + * @memberof google.spanner.executor.v1.CreateCloudDatabaseAction + * @instance + */ + CreateCloudDatabaseAction.prototype.sdlStatement = $util.emptyArray; + + /** + * CreateCloudDatabaseAction encryptionConfig. + * @member {google.spanner.admin.database.v1.IEncryptionConfig|null|undefined} encryptionConfig + * @memberof google.spanner.executor.v1.CreateCloudDatabaseAction + * @instance + */ + CreateCloudDatabaseAction.prototype.encryptionConfig = null; + + /** + * CreateCloudDatabaseAction dialect. + * @member {string|null|undefined} dialect + * @memberof google.spanner.executor.v1.CreateCloudDatabaseAction + * @instance + */ + CreateCloudDatabaseAction.prototype.dialect = null; + + /** + * CreateCloudDatabaseAction protoDescriptors. + * @member {Uint8Array|null|undefined} protoDescriptors + * @memberof google.spanner.executor.v1.CreateCloudDatabaseAction + * @instance + */ + CreateCloudDatabaseAction.prototype.protoDescriptors = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(CreateCloudDatabaseAction.prototype, "_dialect", { + get: $util.oneOfGetter($oneOfFields = ["dialect"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(CreateCloudDatabaseAction.prototype, "_protoDescriptors", { + get: $util.oneOfGetter($oneOfFields = ["protoDescriptors"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CreateCloudDatabaseAction instance using the specified properties. + * @function create + * @memberof google.spanner.executor.v1.CreateCloudDatabaseAction + * @static + * @param {google.spanner.executor.v1.ICreateCloudDatabaseAction=} [properties] Properties to set + * @returns {google.spanner.executor.v1.CreateCloudDatabaseAction} CreateCloudDatabaseAction instance + */ + CreateCloudDatabaseAction.create = function create(properties) { + return new CreateCloudDatabaseAction(properties); + }; + + /** + * Encodes the specified CreateCloudDatabaseAction message. Does not implicitly {@link google.spanner.executor.v1.CreateCloudDatabaseAction.verify|verify} messages. + * @function encode + * @memberof google.spanner.executor.v1.CreateCloudDatabaseAction + * @static + * @param {google.spanner.executor.v1.ICreateCloudDatabaseAction} message CreateCloudDatabaseAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateCloudDatabaseAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.instanceId); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.projectId); + if (message.databaseId != null && Object.hasOwnProperty.call(message, "databaseId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.databaseId); + if (message.sdlStatement != null && message.sdlStatement.length) + for (var i = 0; i < message.sdlStatement.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.sdlStatement[i]); + if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) + $root.google.spanner.admin.database.v1.EncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.dialect != null && Object.hasOwnProperty.call(message, "dialect")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.dialect); + if (message.protoDescriptors != null && Object.hasOwnProperty.call(message, "protoDescriptors")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.protoDescriptors); + return writer; + }; + + /** + * Encodes the specified CreateCloudDatabaseAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.CreateCloudDatabaseAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.executor.v1.CreateCloudDatabaseAction + * @static + * @param {google.spanner.executor.v1.ICreateCloudDatabaseAction} message CreateCloudDatabaseAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateCloudDatabaseAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateCloudDatabaseAction message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.executor.v1.CreateCloudDatabaseAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.executor.v1.CreateCloudDatabaseAction} CreateCloudDatabaseAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateCloudDatabaseAction.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.CreateCloudDatabaseAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.instanceId = reader.string(); + break; + } + case 2: { + message.projectId = reader.string(); + break; + } + case 3: { + message.databaseId = reader.string(); + break; + } + case 4: { + if (!(message.sdlStatement && message.sdlStatement.length)) + message.sdlStatement = []; + message.sdlStatement.push(reader.string()); + break; + } + case 5: { + message.encryptionConfig = $root.google.spanner.admin.database.v1.EncryptionConfig.decode(reader, reader.uint32()); + break; + } + case 6: { + message.dialect = reader.string(); + break; + } + case 7: { + message.protoDescriptors = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateCloudDatabaseAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.executor.v1.CreateCloudDatabaseAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.executor.v1.CreateCloudDatabaseAction} CreateCloudDatabaseAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateCloudDatabaseAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateCloudDatabaseAction message. + * @function verify + * @memberof google.spanner.executor.v1.CreateCloudDatabaseAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateCloudDatabaseAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + if (!$util.isString(message.instanceId)) + return "instanceId: string expected"; + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.databaseId != null && message.hasOwnProperty("databaseId")) + if (!$util.isString(message.databaseId)) + return "databaseId: string expected"; + if (message.sdlStatement != null && message.hasOwnProperty("sdlStatement")) { + if (!Array.isArray(message.sdlStatement)) + return "sdlStatement: array expected"; + for (var i = 0; i < message.sdlStatement.length; ++i) + if (!$util.isString(message.sdlStatement[i])) + return "sdlStatement: string[] expected"; + } + if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { + var error = $root.google.spanner.admin.database.v1.EncryptionConfig.verify(message.encryptionConfig); + if (error) + return "encryptionConfig." + error; + } + if (message.dialect != null && message.hasOwnProperty("dialect")) { + properties._dialect = 1; + if (!$util.isString(message.dialect)) + return "dialect: string expected"; + } + if (message.protoDescriptors != null && message.hasOwnProperty("protoDescriptors")) { + properties._protoDescriptors = 1; + if (!(message.protoDescriptors && typeof message.protoDescriptors.length === "number" || $util.isString(message.protoDescriptors))) + return "protoDescriptors: buffer expected"; + } + return null; + }; + + /** + * Creates a CreateCloudDatabaseAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.executor.v1.CreateCloudDatabaseAction + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.executor.v1.CreateCloudDatabaseAction} CreateCloudDatabaseAction + */ + CreateCloudDatabaseAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.executor.v1.CreateCloudDatabaseAction) + return object; + var message = new $root.google.spanner.executor.v1.CreateCloudDatabaseAction(); + if (object.instanceId != null) + message.instanceId = String(object.instanceId); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.databaseId != null) + message.databaseId = String(object.databaseId); + if (object.sdlStatement) { + if (!Array.isArray(object.sdlStatement)) + throw TypeError(".google.spanner.executor.v1.CreateCloudDatabaseAction.sdlStatement: array expected"); + message.sdlStatement = []; + for (var i = 0; i < object.sdlStatement.length; ++i) + message.sdlStatement[i] = String(object.sdlStatement[i]); + } + if (object.encryptionConfig != null) { + if (typeof object.encryptionConfig !== "object") + throw TypeError(".google.spanner.executor.v1.CreateCloudDatabaseAction.encryptionConfig: object expected"); + message.encryptionConfig = $root.google.spanner.admin.database.v1.EncryptionConfig.fromObject(object.encryptionConfig); + } + if (object.dialect != null) + message.dialect = String(object.dialect); + if (object.protoDescriptors != null) + if (typeof object.protoDescriptors === "string") + $util.base64.decode(object.protoDescriptors, message.protoDescriptors = $util.newBuffer($util.base64.length(object.protoDescriptors)), 0); + else if (object.protoDescriptors.length >= 0) + message.protoDescriptors = object.protoDescriptors; + return message; + }; + + /** + * Creates a plain object from a CreateCloudDatabaseAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.executor.v1.CreateCloudDatabaseAction + * @static + * @param {google.spanner.executor.v1.CreateCloudDatabaseAction} message CreateCloudDatabaseAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateCloudDatabaseAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.sdlStatement = []; + if (options.defaults) { + object.instanceId = ""; + object.projectId = ""; + object.databaseId = ""; + object.encryptionConfig = null; + } + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + object.instanceId = message.instanceId; + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.databaseId != null && message.hasOwnProperty("databaseId")) + object.databaseId = message.databaseId; + if (message.sdlStatement && message.sdlStatement.length) { + object.sdlStatement = []; + for (var j = 0; j < message.sdlStatement.length; ++j) + object.sdlStatement[j] = message.sdlStatement[j]; + } + if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) + object.encryptionConfig = $root.google.spanner.admin.database.v1.EncryptionConfig.toObject(message.encryptionConfig, options); + if (message.dialect != null && message.hasOwnProperty("dialect")) { + object.dialect = message.dialect; + if (options.oneofs) + object._dialect = "dialect"; + } + if (message.protoDescriptors != null && message.hasOwnProperty("protoDescriptors")) { + object.protoDescriptors = options.bytes === String ? $util.base64.encode(message.protoDescriptors, 0, message.protoDescriptors.length) : options.bytes === Array ? Array.prototype.slice.call(message.protoDescriptors) : message.protoDescriptors; + if (options.oneofs) + object._protoDescriptors = "protoDescriptors"; + } + return object; + }; + + /** + * Converts this CreateCloudDatabaseAction to JSON. + * @function toJSON + * @memberof google.spanner.executor.v1.CreateCloudDatabaseAction + * @instance + * @returns {Object.} JSON object + */ + CreateCloudDatabaseAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateCloudDatabaseAction + * @function getTypeUrl + * @memberof google.spanner.executor.v1.CreateCloudDatabaseAction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateCloudDatabaseAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.executor.v1.CreateCloudDatabaseAction"; + }; + + return CreateCloudDatabaseAction; + })(); + + v1.UpdateCloudDatabaseDdlAction = (function() { + + /** + * Properties of an UpdateCloudDatabaseDdlAction. + * @memberof google.spanner.executor.v1 + * @interface IUpdateCloudDatabaseDdlAction + * @property {string|null} [instanceId] UpdateCloudDatabaseDdlAction instanceId + * @property {string|null} [projectId] UpdateCloudDatabaseDdlAction projectId + * @property {string|null} [databaseId] UpdateCloudDatabaseDdlAction databaseId + * @property {Array.|null} [sdlStatement] UpdateCloudDatabaseDdlAction sdlStatement + * @property {string|null} [operationId] UpdateCloudDatabaseDdlAction operationId + * @property {Uint8Array|null} [protoDescriptors] UpdateCloudDatabaseDdlAction protoDescriptors + */ + + /** + * Constructs a new UpdateCloudDatabaseDdlAction. + * @memberof google.spanner.executor.v1 + * @classdesc Represents an UpdateCloudDatabaseDdlAction. + * @implements IUpdateCloudDatabaseDdlAction + * @constructor + * @param {google.spanner.executor.v1.IUpdateCloudDatabaseDdlAction=} [properties] Properties to set + */ + function UpdateCloudDatabaseDdlAction(properties) { + this.sdlStatement = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateCloudDatabaseDdlAction instanceId. + * @member {string} instanceId + * @memberof google.spanner.executor.v1.UpdateCloudDatabaseDdlAction + * @instance + */ + UpdateCloudDatabaseDdlAction.prototype.instanceId = ""; + + /** + * UpdateCloudDatabaseDdlAction projectId. + * @member {string} projectId + * @memberof google.spanner.executor.v1.UpdateCloudDatabaseDdlAction + * @instance + */ + UpdateCloudDatabaseDdlAction.prototype.projectId = ""; + + /** + * UpdateCloudDatabaseDdlAction databaseId. + * @member {string} databaseId + * @memberof google.spanner.executor.v1.UpdateCloudDatabaseDdlAction + * @instance + */ + UpdateCloudDatabaseDdlAction.prototype.databaseId = ""; + + /** + * UpdateCloudDatabaseDdlAction sdlStatement. + * @member {Array.} sdlStatement + * @memberof google.spanner.executor.v1.UpdateCloudDatabaseDdlAction + * @instance + */ + UpdateCloudDatabaseDdlAction.prototype.sdlStatement = $util.emptyArray; + + /** + * UpdateCloudDatabaseDdlAction operationId. + * @member {string} operationId + * @memberof google.spanner.executor.v1.UpdateCloudDatabaseDdlAction + * @instance + */ + UpdateCloudDatabaseDdlAction.prototype.operationId = ""; + + /** + * UpdateCloudDatabaseDdlAction protoDescriptors. + * @member {Uint8Array|null|undefined} protoDescriptors + * @memberof google.spanner.executor.v1.UpdateCloudDatabaseDdlAction + * @instance + */ + UpdateCloudDatabaseDdlAction.prototype.protoDescriptors = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(UpdateCloudDatabaseDdlAction.prototype, "_protoDescriptors", { + get: $util.oneOfGetter($oneOfFields = ["protoDescriptors"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new UpdateCloudDatabaseDdlAction instance using the specified properties. + * @function create + * @memberof google.spanner.executor.v1.UpdateCloudDatabaseDdlAction + * @static + * @param {google.spanner.executor.v1.IUpdateCloudDatabaseDdlAction=} [properties] Properties to set + * @returns {google.spanner.executor.v1.UpdateCloudDatabaseDdlAction} UpdateCloudDatabaseDdlAction instance + */ + UpdateCloudDatabaseDdlAction.create = function create(properties) { + return new UpdateCloudDatabaseDdlAction(properties); + }; + + /** + * Encodes the specified UpdateCloudDatabaseDdlAction message. Does not implicitly {@link google.spanner.executor.v1.UpdateCloudDatabaseDdlAction.verify|verify} messages. + * @function encode + * @memberof google.spanner.executor.v1.UpdateCloudDatabaseDdlAction + * @static + * @param {google.spanner.executor.v1.IUpdateCloudDatabaseDdlAction} message UpdateCloudDatabaseDdlAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateCloudDatabaseDdlAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.instanceId); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.projectId); + if (message.databaseId != null && Object.hasOwnProperty.call(message, "databaseId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.databaseId); + if (message.sdlStatement != null && message.sdlStatement.length) + for (var i = 0; i < message.sdlStatement.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.sdlStatement[i]); + if (message.operationId != null && Object.hasOwnProperty.call(message, "operationId")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.operationId); + if (message.protoDescriptors != null && Object.hasOwnProperty.call(message, "protoDescriptors")) + writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.protoDescriptors); + return writer; + }; + + /** + * Encodes the specified UpdateCloudDatabaseDdlAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.UpdateCloudDatabaseDdlAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.executor.v1.UpdateCloudDatabaseDdlAction + * @static + * @param {google.spanner.executor.v1.IUpdateCloudDatabaseDdlAction} message UpdateCloudDatabaseDdlAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateCloudDatabaseDdlAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateCloudDatabaseDdlAction message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.executor.v1.UpdateCloudDatabaseDdlAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.executor.v1.UpdateCloudDatabaseDdlAction} UpdateCloudDatabaseDdlAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateCloudDatabaseDdlAction.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.UpdateCloudDatabaseDdlAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.instanceId = reader.string(); + break; + } + case 2: { + message.projectId = reader.string(); + break; + } + case 3: { + message.databaseId = reader.string(); + break; + } + case 4: { + if (!(message.sdlStatement && message.sdlStatement.length)) + message.sdlStatement = []; + message.sdlStatement.push(reader.string()); + break; + } + case 5: { + message.operationId = reader.string(); + break; + } + case 6: { + message.protoDescriptors = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateCloudDatabaseDdlAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.executor.v1.UpdateCloudDatabaseDdlAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.executor.v1.UpdateCloudDatabaseDdlAction} UpdateCloudDatabaseDdlAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateCloudDatabaseDdlAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateCloudDatabaseDdlAction message. + * @function verify + * @memberof google.spanner.executor.v1.UpdateCloudDatabaseDdlAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateCloudDatabaseDdlAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + if (!$util.isString(message.instanceId)) + return "instanceId: string expected"; + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.databaseId != null && message.hasOwnProperty("databaseId")) + if (!$util.isString(message.databaseId)) + return "databaseId: string expected"; + if (message.sdlStatement != null && message.hasOwnProperty("sdlStatement")) { + if (!Array.isArray(message.sdlStatement)) + return "sdlStatement: array expected"; + for (var i = 0; i < message.sdlStatement.length; ++i) + if (!$util.isString(message.sdlStatement[i])) + return "sdlStatement: string[] expected"; + } + if (message.operationId != null && message.hasOwnProperty("operationId")) + if (!$util.isString(message.operationId)) + return "operationId: string expected"; + if (message.protoDescriptors != null && message.hasOwnProperty("protoDescriptors")) { + properties._protoDescriptors = 1; + if (!(message.protoDescriptors && typeof message.protoDescriptors.length === "number" || $util.isString(message.protoDescriptors))) + return "protoDescriptors: buffer expected"; + } + return null; + }; + + /** + * Creates an UpdateCloudDatabaseDdlAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.executor.v1.UpdateCloudDatabaseDdlAction + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.executor.v1.UpdateCloudDatabaseDdlAction} UpdateCloudDatabaseDdlAction + */ + UpdateCloudDatabaseDdlAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.executor.v1.UpdateCloudDatabaseDdlAction) + return object; + var message = new $root.google.spanner.executor.v1.UpdateCloudDatabaseDdlAction(); + if (object.instanceId != null) + message.instanceId = String(object.instanceId); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.databaseId != null) + message.databaseId = String(object.databaseId); + if (object.sdlStatement) { + if (!Array.isArray(object.sdlStatement)) + throw TypeError(".google.spanner.executor.v1.UpdateCloudDatabaseDdlAction.sdlStatement: array expected"); + message.sdlStatement = []; + for (var i = 0; i < object.sdlStatement.length; ++i) + message.sdlStatement[i] = String(object.sdlStatement[i]); + } + if (object.operationId != null) + message.operationId = String(object.operationId); + if (object.protoDescriptors != null) + if (typeof object.protoDescriptors === "string") + $util.base64.decode(object.protoDescriptors, message.protoDescriptors = $util.newBuffer($util.base64.length(object.protoDescriptors)), 0); + else if (object.protoDescriptors.length >= 0) + message.protoDescriptors = object.protoDescriptors; + return message; + }; + + /** + * Creates a plain object from an UpdateCloudDatabaseDdlAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.executor.v1.UpdateCloudDatabaseDdlAction + * @static + * @param {google.spanner.executor.v1.UpdateCloudDatabaseDdlAction} message UpdateCloudDatabaseDdlAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateCloudDatabaseDdlAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.sdlStatement = []; + if (options.defaults) { + object.instanceId = ""; + object.projectId = ""; + object.databaseId = ""; + object.operationId = ""; + } + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + object.instanceId = message.instanceId; + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.databaseId != null && message.hasOwnProperty("databaseId")) + object.databaseId = message.databaseId; + if (message.sdlStatement && message.sdlStatement.length) { + object.sdlStatement = []; + for (var j = 0; j < message.sdlStatement.length; ++j) + object.sdlStatement[j] = message.sdlStatement[j]; + } + if (message.operationId != null && message.hasOwnProperty("operationId")) + object.operationId = message.operationId; + if (message.protoDescriptors != null && message.hasOwnProperty("protoDescriptors")) { + object.protoDescriptors = options.bytes === String ? $util.base64.encode(message.protoDescriptors, 0, message.protoDescriptors.length) : options.bytes === Array ? Array.prototype.slice.call(message.protoDescriptors) : message.protoDescriptors; + if (options.oneofs) + object._protoDescriptors = "protoDescriptors"; + } + return object; + }; + + /** + * Converts this UpdateCloudDatabaseDdlAction to JSON. + * @function toJSON + * @memberof google.spanner.executor.v1.UpdateCloudDatabaseDdlAction + * @instance + * @returns {Object.} JSON object + */ + UpdateCloudDatabaseDdlAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateCloudDatabaseDdlAction + * @function getTypeUrl + * @memberof google.spanner.executor.v1.UpdateCloudDatabaseDdlAction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateCloudDatabaseDdlAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.executor.v1.UpdateCloudDatabaseDdlAction"; + }; + + return UpdateCloudDatabaseDdlAction; + })(); + + v1.UpdateCloudDatabaseAction = (function() { + + /** + * Properties of an UpdateCloudDatabaseAction. + * @memberof google.spanner.executor.v1 + * @interface IUpdateCloudDatabaseAction + * @property {string|null} [instanceId] UpdateCloudDatabaseAction instanceId + * @property {string|null} [projectId] UpdateCloudDatabaseAction projectId + * @property {string|null} [databaseName] UpdateCloudDatabaseAction databaseName + * @property {boolean|null} [enableDropProtection] UpdateCloudDatabaseAction enableDropProtection + */ + + /** + * Constructs a new UpdateCloudDatabaseAction. + * @memberof google.spanner.executor.v1 + * @classdesc Represents an UpdateCloudDatabaseAction. + * @implements IUpdateCloudDatabaseAction + * @constructor + * @param {google.spanner.executor.v1.IUpdateCloudDatabaseAction=} [properties] Properties to set + */ + function UpdateCloudDatabaseAction(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateCloudDatabaseAction instanceId. + * @member {string} instanceId + * @memberof google.spanner.executor.v1.UpdateCloudDatabaseAction + * @instance + */ + UpdateCloudDatabaseAction.prototype.instanceId = ""; + + /** + * UpdateCloudDatabaseAction projectId. + * @member {string} projectId + * @memberof google.spanner.executor.v1.UpdateCloudDatabaseAction + * @instance + */ + UpdateCloudDatabaseAction.prototype.projectId = ""; + + /** + * UpdateCloudDatabaseAction databaseName. + * @member {string} databaseName + * @memberof google.spanner.executor.v1.UpdateCloudDatabaseAction + * @instance + */ + UpdateCloudDatabaseAction.prototype.databaseName = ""; + + /** + * UpdateCloudDatabaseAction enableDropProtection. + * @member {boolean} enableDropProtection + * @memberof google.spanner.executor.v1.UpdateCloudDatabaseAction + * @instance + */ + UpdateCloudDatabaseAction.prototype.enableDropProtection = false; + + /** + * Creates a new UpdateCloudDatabaseAction instance using the specified properties. + * @function create + * @memberof google.spanner.executor.v1.UpdateCloudDatabaseAction + * @static + * @param {google.spanner.executor.v1.IUpdateCloudDatabaseAction=} [properties] Properties to set + * @returns {google.spanner.executor.v1.UpdateCloudDatabaseAction} UpdateCloudDatabaseAction instance + */ + UpdateCloudDatabaseAction.create = function create(properties) { + return new UpdateCloudDatabaseAction(properties); + }; + + /** + * Encodes the specified UpdateCloudDatabaseAction message. Does not implicitly {@link google.spanner.executor.v1.UpdateCloudDatabaseAction.verify|verify} messages. + * @function encode + * @memberof google.spanner.executor.v1.UpdateCloudDatabaseAction + * @static + * @param {google.spanner.executor.v1.IUpdateCloudDatabaseAction} message UpdateCloudDatabaseAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateCloudDatabaseAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.instanceId); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.projectId); + if (message.databaseName != null && Object.hasOwnProperty.call(message, "databaseName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.databaseName); + if (message.enableDropProtection != null && Object.hasOwnProperty.call(message, "enableDropProtection")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.enableDropProtection); + return writer; + }; + + /** + * Encodes the specified UpdateCloudDatabaseAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.UpdateCloudDatabaseAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.executor.v1.UpdateCloudDatabaseAction + * @static + * @param {google.spanner.executor.v1.IUpdateCloudDatabaseAction} message UpdateCloudDatabaseAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateCloudDatabaseAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateCloudDatabaseAction message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.executor.v1.UpdateCloudDatabaseAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.executor.v1.UpdateCloudDatabaseAction} UpdateCloudDatabaseAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateCloudDatabaseAction.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.UpdateCloudDatabaseAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.instanceId = reader.string(); + break; + } + case 2: { + message.projectId = reader.string(); + break; + } + case 3: { + message.databaseName = reader.string(); + break; + } + case 4: { + message.enableDropProtection = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateCloudDatabaseAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.executor.v1.UpdateCloudDatabaseAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.executor.v1.UpdateCloudDatabaseAction} UpdateCloudDatabaseAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateCloudDatabaseAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateCloudDatabaseAction message. + * @function verify + * @memberof google.spanner.executor.v1.UpdateCloudDatabaseAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateCloudDatabaseAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + if (!$util.isString(message.instanceId)) + return "instanceId: string expected"; + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.databaseName != null && message.hasOwnProperty("databaseName")) + if (!$util.isString(message.databaseName)) + return "databaseName: string expected"; + if (message.enableDropProtection != null && message.hasOwnProperty("enableDropProtection")) + if (typeof message.enableDropProtection !== "boolean") + return "enableDropProtection: boolean expected"; + return null; + }; + + /** + * Creates an UpdateCloudDatabaseAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.executor.v1.UpdateCloudDatabaseAction + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.executor.v1.UpdateCloudDatabaseAction} UpdateCloudDatabaseAction + */ + UpdateCloudDatabaseAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.executor.v1.UpdateCloudDatabaseAction) + return object; + var message = new $root.google.spanner.executor.v1.UpdateCloudDatabaseAction(); + if (object.instanceId != null) + message.instanceId = String(object.instanceId); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.databaseName != null) + message.databaseName = String(object.databaseName); + if (object.enableDropProtection != null) + message.enableDropProtection = Boolean(object.enableDropProtection); + return message; + }; + + /** + * Creates a plain object from an UpdateCloudDatabaseAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.executor.v1.UpdateCloudDatabaseAction + * @static + * @param {google.spanner.executor.v1.UpdateCloudDatabaseAction} message UpdateCloudDatabaseAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateCloudDatabaseAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.instanceId = ""; + object.projectId = ""; + object.databaseName = ""; + object.enableDropProtection = false; + } + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + object.instanceId = message.instanceId; + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.databaseName != null && message.hasOwnProperty("databaseName")) + object.databaseName = message.databaseName; + if (message.enableDropProtection != null && message.hasOwnProperty("enableDropProtection")) + object.enableDropProtection = message.enableDropProtection; + return object; + }; + + /** + * Converts this UpdateCloudDatabaseAction to JSON. + * @function toJSON + * @memberof google.spanner.executor.v1.UpdateCloudDatabaseAction + * @instance + * @returns {Object.} JSON object + */ + UpdateCloudDatabaseAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateCloudDatabaseAction + * @function getTypeUrl + * @memberof google.spanner.executor.v1.UpdateCloudDatabaseAction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateCloudDatabaseAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.executor.v1.UpdateCloudDatabaseAction"; + }; + + return UpdateCloudDatabaseAction; + })(); + + v1.DropCloudDatabaseAction = (function() { + + /** + * Properties of a DropCloudDatabaseAction. + * @memberof google.spanner.executor.v1 + * @interface IDropCloudDatabaseAction + * @property {string|null} [instanceId] DropCloudDatabaseAction instanceId + * @property {string|null} [projectId] DropCloudDatabaseAction projectId + * @property {string|null} [databaseId] DropCloudDatabaseAction databaseId + */ + + /** + * Constructs a new DropCloudDatabaseAction. + * @memberof google.spanner.executor.v1 + * @classdesc Represents a DropCloudDatabaseAction. + * @implements IDropCloudDatabaseAction + * @constructor + * @param {google.spanner.executor.v1.IDropCloudDatabaseAction=} [properties] Properties to set + */ + function DropCloudDatabaseAction(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DropCloudDatabaseAction instanceId. + * @member {string} instanceId + * @memberof google.spanner.executor.v1.DropCloudDatabaseAction + * @instance + */ + DropCloudDatabaseAction.prototype.instanceId = ""; + + /** + * DropCloudDatabaseAction projectId. + * @member {string} projectId + * @memberof google.spanner.executor.v1.DropCloudDatabaseAction + * @instance + */ + DropCloudDatabaseAction.prototype.projectId = ""; + + /** + * DropCloudDatabaseAction databaseId. + * @member {string} databaseId + * @memberof google.spanner.executor.v1.DropCloudDatabaseAction + * @instance + */ + DropCloudDatabaseAction.prototype.databaseId = ""; + + /** + * Creates a new DropCloudDatabaseAction instance using the specified properties. + * @function create + * @memberof google.spanner.executor.v1.DropCloudDatabaseAction + * @static + * @param {google.spanner.executor.v1.IDropCloudDatabaseAction=} [properties] Properties to set + * @returns {google.spanner.executor.v1.DropCloudDatabaseAction} DropCloudDatabaseAction instance + */ + DropCloudDatabaseAction.create = function create(properties) { + return new DropCloudDatabaseAction(properties); + }; + + /** + * Encodes the specified DropCloudDatabaseAction message. Does not implicitly {@link google.spanner.executor.v1.DropCloudDatabaseAction.verify|verify} messages. + * @function encode + * @memberof google.spanner.executor.v1.DropCloudDatabaseAction + * @static + * @param {google.spanner.executor.v1.IDropCloudDatabaseAction} message DropCloudDatabaseAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DropCloudDatabaseAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.instanceId); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.projectId); + if (message.databaseId != null && Object.hasOwnProperty.call(message, "databaseId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.databaseId); + return writer; + }; + + /** + * Encodes the specified DropCloudDatabaseAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.DropCloudDatabaseAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.executor.v1.DropCloudDatabaseAction + * @static + * @param {google.spanner.executor.v1.IDropCloudDatabaseAction} message DropCloudDatabaseAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DropCloudDatabaseAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DropCloudDatabaseAction message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.executor.v1.DropCloudDatabaseAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.executor.v1.DropCloudDatabaseAction} DropCloudDatabaseAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DropCloudDatabaseAction.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.DropCloudDatabaseAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.instanceId = reader.string(); + break; + } + case 2: { + message.projectId = reader.string(); + break; + } + case 3: { + message.databaseId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DropCloudDatabaseAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.executor.v1.DropCloudDatabaseAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.executor.v1.DropCloudDatabaseAction} DropCloudDatabaseAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DropCloudDatabaseAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DropCloudDatabaseAction message. + * @function verify + * @memberof google.spanner.executor.v1.DropCloudDatabaseAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DropCloudDatabaseAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + if (!$util.isString(message.instanceId)) + return "instanceId: string expected"; + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.databaseId != null && message.hasOwnProperty("databaseId")) + if (!$util.isString(message.databaseId)) + return "databaseId: string expected"; + return null; + }; + + /** + * Creates a DropCloudDatabaseAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.executor.v1.DropCloudDatabaseAction + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.executor.v1.DropCloudDatabaseAction} DropCloudDatabaseAction + */ + DropCloudDatabaseAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.executor.v1.DropCloudDatabaseAction) + return object; + var message = new $root.google.spanner.executor.v1.DropCloudDatabaseAction(); + if (object.instanceId != null) + message.instanceId = String(object.instanceId); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.databaseId != null) + message.databaseId = String(object.databaseId); + return message; + }; + + /** + * Creates a plain object from a DropCloudDatabaseAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.executor.v1.DropCloudDatabaseAction + * @static + * @param {google.spanner.executor.v1.DropCloudDatabaseAction} message DropCloudDatabaseAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DropCloudDatabaseAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.instanceId = ""; + object.projectId = ""; + object.databaseId = ""; + } + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + object.instanceId = message.instanceId; + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.databaseId != null && message.hasOwnProperty("databaseId")) + object.databaseId = message.databaseId; + return object; + }; + + /** + * Converts this DropCloudDatabaseAction to JSON. + * @function toJSON + * @memberof google.spanner.executor.v1.DropCloudDatabaseAction + * @instance + * @returns {Object.} JSON object + */ + DropCloudDatabaseAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DropCloudDatabaseAction + * @function getTypeUrl + * @memberof google.spanner.executor.v1.DropCloudDatabaseAction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DropCloudDatabaseAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.executor.v1.DropCloudDatabaseAction"; + }; + + return DropCloudDatabaseAction; + })(); + + v1.ChangeQuorumCloudDatabaseAction = (function() { + + /** + * Properties of a ChangeQuorumCloudDatabaseAction. + * @memberof google.spanner.executor.v1 + * @interface IChangeQuorumCloudDatabaseAction + * @property {string|null} [databaseUri] ChangeQuorumCloudDatabaseAction databaseUri + * @property {Array.|null} [servingLocations] ChangeQuorumCloudDatabaseAction servingLocations + */ + + /** + * Constructs a new ChangeQuorumCloudDatabaseAction. + * @memberof google.spanner.executor.v1 + * @classdesc Represents a ChangeQuorumCloudDatabaseAction. + * @implements IChangeQuorumCloudDatabaseAction + * @constructor + * @param {google.spanner.executor.v1.IChangeQuorumCloudDatabaseAction=} [properties] Properties to set + */ + function ChangeQuorumCloudDatabaseAction(properties) { + this.servingLocations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ChangeQuorumCloudDatabaseAction databaseUri. + * @member {string|null|undefined} databaseUri + * @memberof google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction + * @instance + */ + ChangeQuorumCloudDatabaseAction.prototype.databaseUri = null; + + /** + * ChangeQuorumCloudDatabaseAction servingLocations. + * @member {Array.} servingLocations + * @memberof google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction + * @instance + */ + ChangeQuorumCloudDatabaseAction.prototype.servingLocations = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ChangeQuorumCloudDatabaseAction.prototype, "_databaseUri", { + get: $util.oneOfGetter($oneOfFields = ["databaseUri"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ChangeQuorumCloudDatabaseAction instance using the specified properties. + * @function create + * @memberof google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction + * @static + * @param {google.spanner.executor.v1.IChangeQuorumCloudDatabaseAction=} [properties] Properties to set + * @returns {google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction} ChangeQuorumCloudDatabaseAction instance + */ + ChangeQuorumCloudDatabaseAction.create = function create(properties) { + return new ChangeQuorumCloudDatabaseAction(properties); + }; + + /** + * Encodes the specified ChangeQuorumCloudDatabaseAction message. Does not implicitly {@link google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction.verify|verify} messages. + * @function encode + * @memberof google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction + * @static + * @param {google.spanner.executor.v1.IChangeQuorumCloudDatabaseAction} message ChangeQuorumCloudDatabaseAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ChangeQuorumCloudDatabaseAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.databaseUri != null && Object.hasOwnProperty.call(message, "databaseUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.databaseUri); + if (message.servingLocations != null && message.servingLocations.length) + for (var i = 0; i < message.servingLocations.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.servingLocations[i]); + return writer; + }; + + /** + * Encodes the specified ChangeQuorumCloudDatabaseAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction + * @static + * @param {google.spanner.executor.v1.IChangeQuorumCloudDatabaseAction} message ChangeQuorumCloudDatabaseAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ChangeQuorumCloudDatabaseAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ChangeQuorumCloudDatabaseAction message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction} ChangeQuorumCloudDatabaseAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ChangeQuorumCloudDatabaseAction.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.databaseUri = reader.string(); + break; + } + case 2: { + if (!(message.servingLocations && message.servingLocations.length)) + message.servingLocations = []; + message.servingLocations.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ChangeQuorumCloudDatabaseAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction} ChangeQuorumCloudDatabaseAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ChangeQuorumCloudDatabaseAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ChangeQuorumCloudDatabaseAction message. + * @function verify + * @memberof google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ChangeQuorumCloudDatabaseAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.databaseUri != null && message.hasOwnProperty("databaseUri")) { + properties._databaseUri = 1; + if (!$util.isString(message.databaseUri)) + return "databaseUri: string expected"; + } + if (message.servingLocations != null && message.hasOwnProperty("servingLocations")) { + if (!Array.isArray(message.servingLocations)) + return "servingLocations: array expected"; + for (var i = 0; i < message.servingLocations.length; ++i) + if (!$util.isString(message.servingLocations[i])) + return "servingLocations: string[] expected"; + } + return null; + }; + + /** + * Creates a ChangeQuorumCloudDatabaseAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction} ChangeQuorumCloudDatabaseAction + */ + ChangeQuorumCloudDatabaseAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction) + return object; + var message = new $root.google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction(); + if (object.databaseUri != null) + message.databaseUri = String(object.databaseUri); + if (object.servingLocations) { + if (!Array.isArray(object.servingLocations)) + throw TypeError(".google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction.servingLocations: array expected"); + message.servingLocations = []; + for (var i = 0; i < object.servingLocations.length; ++i) + message.servingLocations[i] = String(object.servingLocations[i]); + } + return message; + }; + + /** + * Creates a plain object from a ChangeQuorumCloudDatabaseAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction + * @static + * @param {google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction} message ChangeQuorumCloudDatabaseAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ChangeQuorumCloudDatabaseAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.servingLocations = []; + if (message.databaseUri != null && message.hasOwnProperty("databaseUri")) { + object.databaseUri = message.databaseUri; + if (options.oneofs) + object._databaseUri = "databaseUri"; + } + if (message.servingLocations && message.servingLocations.length) { + object.servingLocations = []; + for (var j = 0; j < message.servingLocations.length; ++j) + object.servingLocations[j] = message.servingLocations[j]; + } + return object; + }; + + /** + * Converts this ChangeQuorumCloudDatabaseAction to JSON. + * @function toJSON + * @memberof google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction + * @instance + * @returns {Object.} JSON object + */ + ChangeQuorumCloudDatabaseAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ChangeQuorumCloudDatabaseAction + * @function getTypeUrl + * @memberof google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ChangeQuorumCloudDatabaseAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction"; + }; + + return ChangeQuorumCloudDatabaseAction; + })(); + + v1.ListCloudDatabasesAction = (function() { + + /** + * Properties of a ListCloudDatabasesAction. + * @memberof google.spanner.executor.v1 + * @interface IListCloudDatabasesAction + * @property {string|null} [projectId] ListCloudDatabasesAction projectId + * @property {string|null} [instanceId] ListCloudDatabasesAction instanceId + * @property {number|null} [pageSize] ListCloudDatabasesAction pageSize + * @property {string|null} [pageToken] ListCloudDatabasesAction pageToken + */ + + /** + * Constructs a new ListCloudDatabasesAction. + * @memberof google.spanner.executor.v1 + * @classdesc Represents a ListCloudDatabasesAction. + * @implements IListCloudDatabasesAction + * @constructor + * @param {google.spanner.executor.v1.IListCloudDatabasesAction=} [properties] Properties to set + */ + function ListCloudDatabasesAction(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListCloudDatabasesAction projectId. + * @member {string} projectId + * @memberof google.spanner.executor.v1.ListCloudDatabasesAction + * @instance + */ + ListCloudDatabasesAction.prototype.projectId = ""; + + /** + * ListCloudDatabasesAction instanceId. + * @member {string} instanceId + * @memberof google.spanner.executor.v1.ListCloudDatabasesAction + * @instance + */ + ListCloudDatabasesAction.prototype.instanceId = ""; + + /** + * ListCloudDatabasesAction pageSize. + * @member {number} pageSize + * @memberof google.spanner.executor.v1.ListCloudDatabasesAction + * @instance + */ + ListCloudDatabasesAction.prototype.pageSize = 0; + + /** + * ListCloudDatabasesAction pageToken. + * @member {string} pageToken + * @memberof google.spanner.executor.v1.ListCloudDatabasesAction + * @instance + */ + ListCloudDatabasesAction.prototype.pageToken = ""; + + /** + * Creates a new ListCloudDatabasesAction instance using the specified properties. + * @function create + * @memberof google.spanner.executor.v1.ListCloudDatabasesAction + * @static + * @param {google.spanner.executor.v1.IListCloudDatabasesAction=} [properties] Properties to set + * @returns {google.spanner.executor.v1.ListCloudDatabasesAction} ListCloudDatabasesAction instance + */ + ListCloudDatabasesAction.create = function create(properties) { + return new ListCloudDatabasesAction(properties); + }; + + /** + * Encodes the specified ListCloudDatabasesAction message. Does not implicitly {@link google.spanner.executor.v1.ListCloudDatabasesAction.verify|verify} messages. + * @function encode + * @memberof google.spanner.executor.v1.ListCloudDatabasesAction + * @static + * @param {google.spanner.executor.v1.IListCloudDatabasesAction} message ListCloudDatabasesAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCloudDatabasesAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.instanceId); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListCloudDatabasesAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.ListCloudDatabasesAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.executor.v1.ListCloudDatabasesAction + * @static + * @param {google.spanner.executor.v1.IListCloudDatabasesAction} message ListCloudDatabasesAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCloudDatabasesAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListCloudDatabasesAction message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.executor.v1.ListCloudDatabasesAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.executor.v1.ListCloudDatabasesAction} ListCloudDatabasesAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCloudDatabasesAction.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.ListCloudDatabasesAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.projectId = reader.string(); + break; + } + case 2: { + message.instanceId = reader.string(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListCloudDatabasesAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.executor.v1.ListCloudDatabasesAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.executor.v1.ListCloudDatabasesAction} ListCloudDatabasesAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCloudDatabasesAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListCloudDatabasesAction message. + * @function verify + * @memberof google.spanner.executor.v1.ListCloudDatabasesAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListCloudDatabasesAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + if (!$util.isString(message.instanceId)) + return "instanceId: 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 ListCloudDatabasesAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.executor.v1.ListCloudDatabasesAction + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.executor.v1.ListCloudDatabasesAction} ListCloudDatabasesAction + */ + ListCloudDatabasesAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.executor.v1.ListCloudDatabasesAction) + return object; + var message = new $root.google.spanner.executor.v1.ListCloudDatabasesAction(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.instanceId != null) + message.instanceId = String(object.instanceId); + 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 ListCloudDatabasesAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.executor.v1.ListCloudDatabasesAction + * @static + * @param {google.spanner.executor.v1.ListCloudDatabasesAction} message ListCloudDatabasesAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListCloudDatabasesAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.instanceId = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + object.instanceId = message.instanceId; + 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 ListCloudDatabasesAction to JSON. + * @function toJSON + * @memberof google.spanner.executor.v1.ListCloudDatabasesAction + * @instance + * @returns {Object.} JSON object + */ + ListCloudDatabasesAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListCloudDatabasesAction + * @function getTypeUrl + * @memberof google.spanner.executor.v1.ListCloudDatabasesAction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListCloudDatabasesAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.executor.v1.ListCloudDatabasesAction"; + }; + + return ListCloudDatabasesAction; + })(); + + v1.ListCloudInstancesAction = (function() { + + /** + * Properties of a ListCloudInstancesAction. + * @memberof google.spanner.executor.v1 + * @interface IListCloudInstancesAction + * @property {string|null} [projectId] ListCloudInstancesAction projectId + * @property {string|null} [filter] ListCloudInstancesAction filter + * @property {number|null} [pageSize] ListCloudInstancesAction pageSize + * @property {string|null} [pageToken] ListCloudInstancesAction pageToken + */ + + /** + * Constructs a new ListCloudInstancesAction. + * @memberof google.spanner.executor.v1 + * @classdesc Represents a ListCloudInstancesAction. + * @implements IListCloudInstancesAction + * @constructor + * @param {google.spanner.executor.v1.IListCloudInstancesAction=} [properties] Properties to set + */ + function ListCloudInstancesAction(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListCloudInstancesAction projectId. + * @member {string} projectId + * @memberof google.spanner.executor.v1.ListCloudInstancesAction + * @instance + */ + ListCloudInstancesAction.prototype.projectId = ""; + + /** + * ListCloudInstancesAction filter. + * @member {string|null|undefined} filter + * @memberof google.spanner.executor.v1.ListCloudInstancesAction + * @instance + */ + ListCloudInstancesAction.prototype.filter = null; + + /** + * ListCloudInstancesAction pageSize. + * @member {number|null|undefined} pageSize + * @memberof google.spanner.executor.v1.ListCloudInstancesAction + * @instance + */ + ListCloudInstancesAction.prototype.pageSize = null; + + /** + * ListCloudInstancesAction pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.spanner.executor.v1.ListCloudInstancesAction + * @instance + */ + ListCloudInstancesAction.prototype.pageToken = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ListCloudInstancesAction.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ListCloudInstancesAction.prototype, "_pageSize", { + get: $util.oneOfGetter($oneOfFields = ["pageSize"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ListCloudInstancesAction.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListCloudInstancesAction instance using the specified properties. + * @function create + * @memberof google.spanner.executor.v1.ListCloudInstancesAction + * @static + * @param {google.spanner.executor.v1.IListCloudInstancesAction=} [properties] Properties to set + * @returns {google.spanner.executor.v1.ListCloudInstancesAction} ListCloudInstancesAction instance + */ + ListCloudInstancesAction.create = function create(properties) { + return new ListCloudInstancesAction(properties); + }; + + /** + * Encodes the specified ListCloudInstancesAction message. Does not implicitly {@link google.spanner.executor.v1.ListCloudInstancesAction.verify|verify} messages. + * @function encode + * @memberof google.spanner.executor.v1.ListCloudInstancesAction + * @static + * @param {google.spanner.executor.v1.IListCloudInstancesAction} message ListCloudInstancesAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCloudInstancesAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListCloudInstancesAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.ListCloudInstancesAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.executor.v1.ListCloudInstancesAction + * @static + * @param {google.spanner.executor.v1.IListCloudInstancesAction} message ListCloudInstancesAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCloudInstancesAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListCloudInstancesAction message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.executor.v1.ListCloudInstancesAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.executor.v1.ListCloudInstancesAction} ListCloudInstancesAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCloudInstancesAction.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.ListCloudInstancesAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.projectId = reader.string(); + break; + } + case 2: { + message.filter = reader.string(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListCloudInstancesAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.executor.v1.ListCloudInstancesAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.executor.v1.ListCloudInstancesAction} ListCloudInstancesAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCloudInstancesAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListCloudInstancesAction message. + * @function verify + * @memberof google.spanner.executor.v1.ListCloudInstancesAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListCloudInstancesAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.pageSize != null && message.hasOwnProperty("pageSize")) { + properties._pageSize = 1; + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + return null; + }; + + /** + * Creates a ListCloudInstancesAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.executor.v1.ListCloudInstancesAction + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.executor.v1.ListCloudInstancesAction} ListCloudInstancesAction + */ + ListCloudInstancesAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.executor.v1.ListCloudInstancesAction) + return object; + var message = new $root.google.spanner.executor.v1.ListCloudInstancesAction(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListCloudInstancesAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.executor.v1.ListCloudInstancesAction + * @static + * @param {google.spanner.executor.v1.ListCloudInstancesAction} message ListCloudInstancesAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListCloudInstancesAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.projectId = ""; + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.pageSize != null && message.hasOwnProperty("pageSize")) { + object.pageSize = message.pageSize; + if (options.oneofs) + object._pageSize = "pageSize"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + return object; + }; + + /** + * Converts this ListCloudInstancesAction to JSON. + * @function toJSON + * @memberof google.spanner.executor.v1.ListCloudInstancesAction + * @instance + * @returns {Object.} JSON object + */ + ListCloudInstancesAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListCloudInstancesAction + * @function getTypeUrl + * @memberof google.spanner.executor.v1.ListCloudInstancesAction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListCloudInstancesAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.executor.v1.ListCloudInstancesAction"; + }; + + return ListCloudInstancesAction; + })(); + + v1.GetCloudInstanceAction = (function() { + + /** + * Properties of a GetCloudInstanceAction. + * @memberof google.spanner.executor.v1 + * @interface IGetCloudInstanceAction + * @property {string|null} [projectId] GetCloudInstanceAction projectId + * @property {string|null} [instanceId] GetCloudInstanceAction instanceId + */ + + /** + * Constructs a new GetCloudInstanceAction. + * @memberof google.spanner.executor.v1 + * @classdesc Represents a GetCloudInstanceAction. + * @implements IGetCloudInstanceAction + * @constructor + * @param {google.spanner.executor.v1.IGetCloudInstanceAction=} [properties] Properties to set + */ + function GetCloudInstanceAction(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetCloudInstanceAction projectId. + * @member {string} projectId + * @memberof google.spanner.executor.v1.GetCloudInstanceAction + * @instance + */ + GetCloudInstanceAction.prototype.projectId = ""; + + /** + * GetCloudInstanceAction instanceId. + * @member {string} instanceId + * @memberof google.spanner.executor.v1.GetCloudInstanceAction + * @instance + */ + GetCloudInstanceAction.prototype.instanceId = ""; + + /** + * Creates a new GetCloudInstanceAction instance using the specified properties. + * @function create + * @memberof google.spanner.executor.v1.GetCloudInstanceAction + * @static + * @param {google.spanner.executor.v1.IGetCloudInstanceAction=} [properties] Properties to set + * @returns {google.spanner.executor.v1.GetCloudInstanceAction} GetCloudInstanceAction instance + */ + GetCloudInstanceAction.create = function create(properties) { + return new GetCloudInstanceAction(properties); + }; + + /** + * Encodes the specified GetCloudInstanceAction message. Does not implicitly {@link google.spanner.executor.v1.GetCloudInstanceAction.verify|verify} messages. + * @function encode + * @memberof google.spanner.executor.v1.GetCloudInstanceAction + * @static + * @param {google.spanner.executor.v1.IGetCloudInstanceAction} message GetCloudInstanceAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCloudInstanceAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.instanceId); + return writer; + }; + + /** + * Encodes the specified GetCloudInstanceAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.GetCloudInstanceAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.executor.v1.GetCloudInstanceAction + * @static + * @param {google.spanner.executor.v1.IGetCloudInstanceAction} message GetCloudInstanceAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCloudInstanceAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetCloudInstanceAction message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.executor.v1.GetCloudInstanceAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.executor.v1.GetCloudInstanceAction} GetCloudInstanceAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCloudInstanceAction.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.GetCloudInstanceAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.projectId = reader.string(); + break; + } + case 2: { + message.instanceId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetCloudInstanceAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.executor.v1.GetCloudInstanceAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.executor.v1.GetCloudInstanceAction} GetCloudInstanceAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCloudInstanceAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetCloudInstanceAction message. + * @function verify + * @memberof google.spanner.executor.v1.GetCloudInstanceAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetCloudInstanceAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + if (!$util.isString(message.instanceId)) + return "instanceId: string expected"; + return null; + }; + + /** + * Creates a GetCloudInstanceAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.executor.v1.GetCloudInstanceAction + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.executor.v1.GetCloudInstanceAction} GetCloudInstanceAction + */ + GetCloudInstanceAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.executor.v1.GetCloudInstanceAction) + return object; + var message = new $root.google.spanner.executor.v1.GetCloudInstanceAction(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.instanceId != null) + message.instanceId = String(object.instanceId); + return message; + }; + + /** + * Creates a plain object from a GetCloudInstanceAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.executor.v1.GetCloudInstanceAction + * @static + * @param {google.spanner.executor.v1.GetCloudInstanceAction} message GetCloudInstanceAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetCloudInstanceAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.instanceId = ""; + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + object.instanceId = message.instanceId; + return object; + }; + + /** + * Converts this GetCloudInstanceAction to JSON. + * @function toJSON + * @memberof google.spanner.executor.v1.GetCloudInstanceAction + * @instance + * @returns {Object.} JSON object + */ + GetCloudInstanceAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetCloudInstanceAction + * @function getTypeUrl + * @memberof google.spanner.executor.v1.GetCloudInstanceAction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetCloudInstanceAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.executor.v1.GetCloudInstanceAction"; + }; + + return GetCloudInstanceAction; + })(); + + v1.ListCloudDatabaseOperationsAction = (function() { + + /** + * Properties of a ListCloudDatabaseOperationsAction. + * @memberof google.spanner.executor.v1 + * @interface IListCloudDatabaseOperationsAction + * @property {string|null} [projectId] ListCloudDatabaseOperationsAction projectId + * @property {string|null} [instanceId] ListCloudDatabaseOperationsAction instanceId + * @property {string|null} [filter] ListCloudDatabaseOperationsAction filter + * @property {number|null} [pageSize] ListCloudDatabaseOperationsAction pageSize + * @property {string|null} [pageToken] ListCloudDatabaseOperationsAction pageToken + */ + + /** + * Constructs a new ListCloudDatabaseOperationsAction. + * @memberof google.spanner.executor.v1 + * @classdesc Represents a ListCloudDatabaseOperationsAction. + * @implements IListCloudDatabaseOperationsAction + * @constructor + * @param {google.spanner.executor.v1.IListCloudDatabaseOperationsAction=} [properties] Properties to set + */ + function ListCloudDatabaseOperationsAction(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListCloudDatabaseOperationsAction projectId. + * @member {string} projectId + * @memberof google.spanner.executor.v1.ListCloudDatabaseOperationsAction + * @instance + */ + ListCloudDatabaseOperationsAction.prototype.projectId = ""; + + /** + * ListCloudDatabaseOperationsAction instanceId. + * @member {string} instanceId + * @memberof google.spanner.executor.v1.ListCloudDatabaseOperationsAction + * @instance + */ + ListCloudDatabaseOperationsAction.prototype.instanceId = ""; + + /** + * ListCloudDatabaseOperationsAction filter. + * @member {string} filter + * @memberof google.spanner.executor.v1.ListCloudDatabaseOperationsAction + * @instance + */ + ListCloudDatabaseOperationsAction.prototype.filter = ""; + + /** + * ListCloudDatabaseOperationsAction pageSize. + * @member {number} pageSize + * @memberof google.spanner.executor.v1.ListCloudDatabaseOperationsAction + * @instance + */ + ListCloudDatabaseOperationsAction.prototype.pageSize = 0; + + /** + * ListCloudDatabaseOperationsAction pageToken. + * @member {string} pageToken + * @memberof google.spanner.executor.v1.ListCloudDatabaseOperationsAction + * @instance + */ + ListCloudDatabaseOperationsAction.prototype.pageToken = ""; + + /** + * Creates a new ListCloudDatabaseOperationsAction instance using the specified properties. + * @function create + * @memberof google.spanner.executor.v1.ListCloudDatabaseOperationsAction + * @static + * @param {google.spanner.executor.v1.IListCloudDatabaseOperationsAction=} [properties] Properties to set + * @returns {google.spanner.executor.v1.ListCloudDatabaseOperationsAction} ListCloudDatabaseOperationsAction instance + */ + ListCloudDatabaseOperationsAction.create = function create(properties) { + return new ListCloudDatabaseOperationsAction(properties); + }; + + /** + * Encodes the specified ListCloudDatabaseOperationsAction message. Does not implicitly {@link google.spanner.executor.v1.ListCloudDatabaseOperationsAction.verify|verify} messages. + * @function encode + * @memberof google.spanner.executor.v1.ListCloudDatabaseOperationsAction + * @static + * @param {google.spanner.executor.v1.IListCloudDatabaseOperationsAction} message ListCloudDatabaseOperationsAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCloudDatabaseOperationsAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.instanceId); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListCloudDatabaseOperationsAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.ListCloudDatabaseOperationsAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.executor.v1.ListCloudDatabaseOperationsAction + * @static + * @param {google.spanner.executor.v1.IListCloudDatabaseOperationsAction} message ListCloudDatabaseOperationsAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCloudDatabaseOperationsAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListCloudDatabaseOperationsAction message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.executor.v1.ListCloudDatabaseOperationsAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.executor.v1.ListCloudDatabaseOperationsAction} ListCloudDatabaseOperationsAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCloudDatabaseOperationsAction.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.ListCloudDatabaseOperationsAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.projectId = reader.string(); + break; + } + case 2: { + message.instanceId = reader.string(); + break; + } + case 3: { + message.filter = reader.string(); + break; + } + case 4: { + message.pageSize = reader.int32(); + break; + } + case 5: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListCloudDatabaseOperationsAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.executor.v1.ListCloudDatabaseOperationsAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.executor.v1.ListCloudDatabaseOperationsAction} ListCloudDatabaseOperationsAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCloudDatabaseOperationsAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListCloudDatabaseOperationsAction message. + * @function verify + * @memberof google.spanner.executor.v1.ListCloudDatabaseOperationsAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListCloudDatabaseOperationsAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + if (!$util.isString(message.instanceId)) + return "instanceId: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListCloudDatabaseOperationsAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.executor.v1.ListCloudDatabaseOperationsAction + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.executor.v1.ListCloudDatabaseOperationsAction} ListCloudDatabaseOperationsAction + */ + ListCloudDatabaseOperationsAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.executor.v1.ListCloudDatabaseOperationsAction) + return object; + var message = new $root.google.spanner.executor.v1.ListCloudDatabaseOperationsAction(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.instanceId != null) + message.instanceId = String(object.instanceId); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListCloudDatabaseOperationsAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.executor.v1.ListCloudDatabaseOperationsAction + * @static + * @param {google.spanner.executor.v1.ListCloudDatabaseOperationsAction} message ListCloudDatabaseOperationsAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListCloudDatabaseOperationsAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.instanceId = ""; + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + object.instanceId = message.instanceId; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListCloudDatabaseOperationsAction to JSON. + * @function toJSON + * @memberof google.spanner.executor.v1.ListCloudDatabaseOperationsAction + * @instance + * @returns {Object.} JSON object + */ + ListCloudDatabaseOperationsAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListCloudDatabaseOperationsAction + * @function getTypeUrl + * @memberof google.spanner.executor.v1.ListCloudDatabaseOperationsAction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListCloudDatabaseOperationsAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.executor.v1.ListCloudDatabaseOperationsAction"; + }; + + return ListCloudDatabaseOperationsAction; + })(); + + v1.RestoreCloudDatabaseAction = (function() { + + /** + * Properties of a RestoreCloudDatabaseAction. + * @memberof google.spanner.executor.v1 + * @interface IRestoreCloudDatabaseAction + * @property {string|null} [projectId] RestoreCloudDatabaseAction projectId + * @property {string|null} [backupInstanceId] RestoreCloudDatabaseAction backupInstanceId + * @property {string|null} [backupId] RestoreCloudDatabaseAction backupId + * @property {string|null} [databaseInstanceId] RestoreCloudDatabaseAction databaseInstanceId + * @property {string|null} [databaseId] RestoreCloudDatabaseAction databaseId + * @property {google.spanner.admin.database.v1.IEncryptionConfig|null} [encryptionConfig] RestoreCloudDatabaseAction encryptionConfig + */ + + /** + * Constructs a new RestoreCloudDatabaseAction. + * @memberof google.spanner.executor.v1 + * @classdesc Represents a RestoreCloudDatabaseAction. + * @implements IRestoreCloudDatabaseAction + * @constructor + * @param {google.spanner.executor.v1.IRestoreCloudDatabaseAction=} [properties] Properties to set + */ + function RestoreCloudDatabaseAction(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RestoreCloudDatabaseAction projectId. + * @member {string} projectId + * @memberof google.spanner.executor.v1.RestoreCloudDatabaseAction + * @instance + */ + RestoreCloudDatabaseAction.prototype.projectId = ""; + + /** + * RestoreCloudDatabaseAction backupInstanceId. + * @member {string} backupInstanceId + * @memberof google.spanner.executor.v1.RestoreCloudDatabaseAction + * @instance + */ + RestoreCloudDatabaseAction.prototype.backupInstanceId = ""; + + /** + * RestoreCloudDatabaseAction backupId. + * @member {string} backupId + * @memberof google.spanner.executor.v1.RestoreCloudDatabaseAction + * @instance + */ + RestoreCloudDatabaseAction.prototype.backupId = ""; + + /** + * RestoreCloudDatabaseAction databaseInstanceId. + * @member {string} databaseInstanceId + * @memberof google.spanner.executor.v1.RestoreCloudDatabaseAction + * @instance + */ + RestoreCloudDatabaseAction.prototype.databaseInstanceId = ""; + + /** + * RestoreCloudDatabaseAction databaseId. + * @member {string} databaseId + * @memberof google.spanner.executor.v1.RestoreCloudDatabaseAction + * @instance + */ + RestoreCloudDatabaseAction.prototype.databaseId = ""; + + /** + * RestoreCloudDatabaseAction encryptionConfig. + * @member {google.spanner.admin.database.v1.IEncryptionConfig|null|undefined} encryptionConfig + * @memberof google.spanner.executor.v1.RestoreCloudDatabaseAction + * @instance + */ + RestoreCloudDatabaseAction.prototype.encryptionConfig = null; + + /** + * Creates a new RestoreCloudDatabaseAction instance using the specified properties. + * @function create + * @memberof google.spanner.executor.v1.RestoreCloudDatabaseAction + * @static + * @param {google.spanner.executor.v1.IRestoreCloudDatabaseAction=} [properties] Properties to set + * @returns {google.spanner.executor.v1.RestoreCloudDatabaseAction} RestoreCloudDatabaseAction instance + */ + RestoreCloudDatabaseAction.create = function create(properties) { + return new RestoreCloudDatabaseAction(properties); + }; + + /** + * Encodes the specified RestoreCloudDatabaseAction message. Does not implicitly {@link google.spanner.executor.v1.RestoreCloudDatabaseAction.verify|verify} messages. + * @function encode + * @memberof google.spanner.executor.v1.RestoreCloudDatabaseAction + * @static + * @param {google.spanner.executor.v1.IRestoreCloudDatabaseAction} message RestoreCloudDatabaseAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreCloudDatabaseAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.backupInstanceId != null && Object.hasOwnProperty.call(message, "backupInstanceId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.backupInstanceId); + if (message.backupId != null && Object.hasOwnProperty.call(message, "backupId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.backupId); + if (message.databaseInstanceId != null && Object.hasOwnProperty.call(message, "databaseInstanceId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.databaseInstanceId); + if (message.databaseId != null && Object.hasOwnProperty.call(message, "databaseId")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.databaseId); + if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) + $root.google.spanner.admin.database.v1.EncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RestoreCloudDatabaseAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.RestoreCloudDatabaseAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.executor.v1.RestoreCloudDatabaseAction + * @static + * @param {google.spanner.executor.v1.IRestoreCloudDatabaseAction} message RestoreCloudDatabaseAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreCloudDatabaseAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RestoreCloudDatabaseAction message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.executor.v1.RestoreCloudDatabaseAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.executor.v1.RestoreCloudDatabaseAction} RestoreCloudDatabaseAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreCloudDatabaseAction.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.RestoreCloudDatabaseAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.projectId = reader.string(); + break; + } + case 2: { + message.backupInstanceId = reader.string(); + break; + } + case 3: { + message.backupId = reader.string(); + break; + } + case 4: { + message.databaseInstanceId = reader.string(); + break; + } + case 5: { + message.databaseId = reader.string(); + break; + } + case 7: { + message.encryptionConfig = $root.google.spanner.admin.database.v1.EncryptionConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RestoreCloudDatabaseAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.executor.v1.RestoreCloudDatabaseAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.executor.v1.RestoreCloudDatabaseAction} RestoreCloudDatabaseAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreCloudDatabaseAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RestoreCloudDatabaseAction message. + * @function verify + * @memberof google.spanner.executor.v1.RestoreCloudDatabaseAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RestoreCloudDatabaseAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.backupInstanceId != null && message.hasOwnProperty("backupInstanceId")) + if (!$util.isString(message.backupInstanceId)) + return "backupInstanceId: string expected"; + if (message.backupId != null && message.hasOwnProperty("backupId")) + if (!$util.isString(message.backupId)) + return "backupId: string expected"; + if (message.databaseInstanceId != null && message.hasOwnProperty("databaseInstanceId")) + if (!$util.isString(message.databaseInstanceId)) + return "databaseInstanceId: string expected"; + if (message.databaseId != null && message.hasOwnProperty("databaseId")) + if (!$util.isString(message.databaseId)) + return "databaseId: string expected"; + if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { + var error = $root.google.spanner.admin.database.v1.EncryptionConfig.verify(message.encryptionConfig); + if (error) + return "encryptionConfig." + error; + } + return null; + }; + + /** + * Creates a RestoreCloudDatabaseAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.executor.v1.RestoreCloudDatabaseAction + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.executor.v1.RestoreCloudDatabaseAction} RestoreCloudDatabaseAction + */ + RestoreCloudDatabaseAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.executor.v1.RestoreCloudDatabaseAction) + return object; + var message = new $root.google.spanner.executor.v1.RestoreCloudDatabaseAction(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.backupInstanceId != null) + message.backupInstanceId = String(object.backupInstanceId); + if (object.backupId != null) + message.backupId = String(object.backupId); + if (object.databaseInstanceId != null) + message.databaseInstanceId = String(object.databaseInstanceId); + if (object.databaseId != null) + message.databaseId = String(object.databaseId); + if (object.encryptionConfig != null) { + if (typeof object.encryptionConfig !== "object") + throw TypeError(".google.spanner.executor.v1.RestoreCloudDatabaseAction.encryptionConfig: object expected"); + message.encryptionConfig = $root.google.spanner.admin.database.v1.EncryptionConfig.fromObject(object.encryptionConfig); + } + return message; + }; + + /** + * Creates a plain object from a RestoreCloudDatabaseAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.executor.v1.RestoreCloudDatabaseAction + * @static + * @param {google.spanner.executor.v1.RestoreCloudDatabaseAction} message RestoreCloudDatabaseAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RestoreCloudDatabaseAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.backupInstanceId = ""; + object.backupId = ""; + object.databaseInstanceId = ""; + object.databaseId = ""; + object.encryptionConfig = null; + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.backupInstanceId != null && message.hasOwnProperty("backupInstanceId")) + object.backupInstanceId = message.backupInstanceId; + if (message.backupId != null && message.hasOwnProperty("backupId")) + object.backupId = message.backupId; + if (message.databaseInstanceId != null && message.hasOwnProperty("databaseInstanceId")) + object.databaseInstanceId = message.databaseInstanceId; + if (message.databaseId != null && message.hasOwnProperty("databaseId")) + object.databaseId = message.databaseId; + if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) + object.encryptionConfig = $root.google.spanner.admin.database.v1.EncryptionConfig.toObject(message.encryptionConfig, options); + return object; + }; + + /** + * Converts this RestoreCloudDatabaseAction to JSON. + * @function toJSON + * @memberof google.spanner.executor.v1.RestoreCloudDatabaseAction + * @instance + * @returns {Object.} JSON object + */ + RestoreCloudDatabaseAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RestoreCloudDatabaseAction + * @function getTypeUrl + * @memberof google.spanner.executor.v1.RestoreCloudDatabaseAction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RestoreCloudDatabaseAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.executor.v1.RestoreCloudDatabaseAction"; + }; + + return RestoreCloudDatabaseAction; + })(); + + v1.GetCloudDatabaseAction = (function() { + + /** + * Properties of a GetCloudDatabaseAction. + * @memberof google.spanner.executor.v1 + * @interface IGetCloudDatabaseAction + * @property {string|null} [projectId] GetCloudDatabaseAction projectId + * @property {string|null} [instanceId] GetCloudDatabaseAction instanceId + * @property {string|null} [databaseId] GetCloudDatabaseAction databaseId + */ + + /** + * Constructs a new GetCloudDatabaseAction. + * @memberof google.spanner.executor.v1 + * @classdesc Represents a GetCloudDatabaseAction. + * @implements IGetCloudDatabaseAction + * @constructor + * @param {google.spanner.executor.v1.IGetCloudDatabaseAction=} [properties] Properties to set + */ + function GetCloudDatabaseAction(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetCloudDatabaseAction projectId. + * @member {string} projectId + * @memberof google.spanner.executor.v1.GetCloudDatabaseAction + * @instance + */ + GetCloudDatabaseAction.prototype.projectId = ""; + + /** + * GetCloudDatabaseAction instanceId. + * @member {string} instanceId + * @memberof google.spanner.executor.v1.GetCloudDatabaseAction + * @instance + */ + GetCloudDatabaseAction.prototype.instanceId = ""; + + /** + * GetCloudDatabaseAction databaseId. + * @member {string} databaseId + * @memberof google.spanner.executor.v1.GetCloudDatabaseAction + * @instance + */ + GetCloudDatabaseAction.prototype.databaseId = ""; + + /** + * Creates a new GetCloudDatabaseAction instance using the specified properties. + * @function create + * @memberof google.spanner.executor.v1.GetCloudDatabaseAction + * @static + * @param {google.spanner.executor.v1.IGetCloudDatabaseAction=} [properties] Properties to set + * @returns {google.spanner.executor.v1.GetCloudDatabaseAction} GetCloudDatabaseAction instance + */ + GetCloudDatabaseAction.create = function create(properties) { + return new GetCloudDatabaseAction(properties); + }; + + /** + * Encodes the specified GetCloudDatabaseAction message. Does not implicitly {@link google.spanner.executor.v1.GetCloudDatabaseAction.verify|verify} messages. + * @function encode + * @memberof google.spanner.executor.v1.GetCloudDatabaseAction + * @static + * @param {google.spanner.executor.v1.IGetCloudDatabaseAction} message GetCloudDatabaseAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCloudDatabaseAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.instanceId); + if (message.databaseId != null && Object.hasOwnProperty.call(message, "databaseId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.databaseId); + return writer; + }; + + /** + * Encodes the specified GetCloudDatabaseAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.GetCloudDatabaseAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.executor.v1.GetCloudDatabaseAction + * @static + * @param {google.spanner.executor.v1.IGetCloudDatabaseAction} message GetCloudDatabaseAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCloudDatabaseAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetCloudDatabaseAction message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.executor.v1.GetCloudDatabaseAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.executor.v1.GetCloudDatabaseAction} GetCloudDatabaseAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCloudDatabaseAction.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.GetCloudDatabaseAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.projectId = reader.string(); + break; + } + case 2: { + message.instanceId = reader.string(); + break; + } + case 3: { + message.databaseId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetCloudDatabaseAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.executor.v1.GetCloudDatabaseAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.executor.v1.GetCloudDatabaseAction} GetCloudDatabaseAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCloudDatabaseAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetCloudDatabaseAction message. + * @function verify + * @memberof google.spanner.executor.v1.GetCloudDatabaseAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetCloudDatabaseAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + if (!$util.isString(message.instanceId)) + return "instanceId: string expected"; + if (message.databaseId != null && message.hasOwnProperty("databaseId")) + if (!$util.isString(message.databaseId)) + return "databaseId: string expected"; + return null; + }; + + /** + * Creates a GetCloudDatabaseAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.executor.v1.GetCloudDatabaseAction + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.executor.v1.GetCloudDatabaseAction} GetCloudDatabaseAction + */ + GetCloudDatabaseAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.executor.v1.GetCloudDatabaseAction) + return object; + var message = new $root.google.spanner.executor.v1.GetCloudDatabaseAction(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.instanceId != null) + message.instanceId = String(object.instanceId); + if (object.databaseId != null) + message.databaseId = String(object.databaseId); + return message; + }; + + /** + * Creates a plain object from a GetCloudDatabaseAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.executor.v1.GetCloudDatabaseAction + * @static + * @param {google.spanner.executor.v1.GetCloudDatabaseAction} message GetCloudDatabaseAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetCloudDatabaseAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.instanceId = ""; + object.databaseId = ""; + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + object.instanceId = message.instanceId; + if (message.databaseId != null && message.hasOwnProperty("databaseId")) + object.databaseId = message.databaseId; + return object; + }; + + /** + * Converts this GetCloudDatabaseAction to JSON. + * @function toJSON + * @memberof google.spanner.executor.v1.GetCloudDatabaseAction + * @instance + * @returns {Object.} JSON object + */ + GetCloudDatabaseAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetCloudDatabaseAction + * @function getTypeUrl + * @memberof google.spanner.executor.v1.GetCloudDatabaseAction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetCloudDatabaseAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.executor.v1.GetCloudDatabaseAction"; + }; + + return GetCloudDatabaseAction; + })(); + + v1.CreateCloudBackupAction = (function() { + + /** + * Properties of a CreateCloudBackupAction. + * @memberof google.spanner.executor.v1 + * @interface ICreateCloudBackupAction + * @property {string|null} [projectId] CreateCloudBackupAction projectId + * @property {string|null} [instanceId] CreateCloudBackupAction instanceId + * @property {string|null} [backupId] CreateCloudBackupAction backupId + * @property {string|null} [databaseId] CreateCloudBackupAction databaseId + * @property {google.protobuf.ITimestamp|null} [expireTime] CreateCloudBackupAction expireTime + * @property {google.protobuf.ITimestamp|null} [versionTime] CreateCloudBackupAction versionTime + * @property {google.spanner.admin.database.v1.IEncryptionConfig|null} [encryptionConfig] CreateCloudBackupAction encryptionConfig + */ + + /** + * Constructs a new CreateCloudBackupAction. + * @memberof google.spanner.executor.v1 + * @classdesc Represents a CreateCloudBackupAction. + * @implements ICreateCloudBackupAction + * @constructor + * @param {google.spanner.executor.v1.ICreateCloudBackupAction=} [properties] Properties to set + */ + function CreateCloudBackupAction(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateCloudBackupAction projectId. + * @member {string} projectId + * @memberof google.spanner.executor.v1.CreateCloudBackupAction + * @instance + */ + CreateCloudBackupAction.prototype.projectId = ""; + + /** + * CreateCloudBackupAction instanceId. + * @member {string} instanceId + * @memberof google.spanner.executor.v1.CreateCloudBackupAction + * @instance + */ + CreateCloudBackupAction.prototype.instanceId = ""; + + /** + * CreateCloudBackupAction backupId. + * @member {string} backupId + * @memberof google.spanner.executor.v1.CreateCloudBackupAction + * @instance + */ + CreateCloudBackupAction.prototype.backupId = ""; + + /** + * CreateCloudBackupAction databaseId. + * @member {string} databaseId + * @memberof google.spanner.executor.v1.CreateCloudBackupAction + * @instance + */ + CreateCloudBackupAction.prototype.databaseId = ""; + + /** + * CreateCloudBackupAction expireTime. + * @member {google.protobuf.ITimestamp|null|undefined} expireTime + * @memberof google.spanner.executor.v1.CreateCloudBackupAction + * @instance + */ + CreateCloudBackupAction.prototype.expireTime = null; + + /** + * CreateCloudBackupAction versionTime. + * @member {google.protobuf.ITimestamp|null|undefined} versionTime + * @memberof google.spanner.executor.v1.CreateCloudBackupAction + * @instance + */ + CreateCloudBackupAction.prototype.versionTime = null; + + /** + * CreateCloudBackupAction encryptionConfig. + * @member {google.spanner.admin.database.v1.IEncryptionConfig|null|undefined} encryptionConfig + * @memberof google.spanner.executor.v1.CreateCloudBackupAction + * @instance + */ + CreateCloudBackupAction.prototype.encryptionConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(CreateCloudBackupAction.prototype, "_versionTime", { + get: $util.oneOfGetter($oneOfFields = ["versionTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CreateCloudBackupAction instance using the specified properties. + * @function create + * @memberof google.spanner.executor.v1.CreateCloudBackupAction + * @static + * @param {google.spanner.executor.v1.ICreateCloudBackupAction=} [properties] Properties to set + * @returns {google.spanner.executor.v1.CreateCloudBackupAction} CreateCloudBackupAction instance + */ + CreateCloudBackupAction.create = function create(properties) { + return new CreateCloudBackupAction(properties); + }; + + /** + * Encodes the specified CreateCloudBackupAction message. Does not implicitly {@link google.spanner.executor.v1.CreateCloudBackupAction.verify|verify} messages. + * @function encode + * @memberof google.spanner.executor.v1.CreateCloudBackupAction + * @static + * @param {google.spanner.executor.v1.ICreateCloudBackupAction} message CreateCloudBackupAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateCloudBackupAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.instanceId); + if (message.backupId != null && Object.hasOwnProperty.call(message, "backupId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.backupId); + if (message.databaseId != null && Object.hasOwnProperty.call(message, "databaseId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.databaseId); + if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) + $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.versionTime != null && Object.hasOwnProperty.call(message, "versionTime")) + $root.google.protobuf.Timestamp.encode(message.versionTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) + $root.google.spanner.admin.database.v1.EncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateCloudBackupAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.CreateCloudBackupAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.executor.v1.CreateCloudBackupAction + * @static + * @param {google.spanner.executor.v1.ICreateCloudBackupAction} message CreateCloudBackupAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateCloudBackupAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateCloudBackupAction message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.executor.v1.CreateCloudBackupAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.executor.v1.CreateCloudBackupAction} CreateCloudBackupAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateCloudBackupAction.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.CreateCloudBackupAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.projectId = reader.string(); + break; + } + case 2: { + message.instanceId = reader.string(); + break; + } + case 3: { + message.backupId = reader.string(); + break; + } + case 4: { + message.databaseId = reader.string(); + break; + } + case 5: { + message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.versionTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.encryptionConfig = $root.google.spanner.admin.database.v1.EncryptionConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateCloudBackupAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.executor.v1.CreateCloudBackupAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.executor.v1.CreateCloudBackupAction} CreateCloudBackupAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateCloudBackupAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateCloudBackupAction message. + * @function verify + * @memberof google.spanner.executor.v1.CreateCloudBackupAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateCloudBackupAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + if (!$util.isString(message.instanceId)) + return "instanceId: string expected"; + if (message.backupId != null && message.hasOwnProperty("backupId")) + if (!$util.isString(message.backupId)) + return "backupId: string expected"; + if (message.databaseId != null && message.hasOwnProperty("databaseId")) + if (!$util.isString(message.databaseId)) + return "databaseId: string expected"; + if (message.expireTime != null && message.hasOwnProperty("expireTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.expireTime); + if (error) + return "expireTime." + error; + } + if (message.versionTime != null && message.hasOwnProperty("versionTime")) { + properties._versionTime = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.versionTime); + if (error) + return "versionTime." + error; + } + } + if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { + var error = $root.google.spanner.admin.database.v1.EncryptionConfig.verify(message.encryptionConfig); + if (error) + return "encryptionConfig." + error; + } + return null; + }; + + /** + * Creates a CreateCloudBackupAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.executor.v1.CreateCloudBackupAction + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.executor.v1.CreateCloudBackupAction} CreateCloudBackupAction + */ + CreateCloudBackupAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.executor.v1.CreateCloudBackupAction) + return object; + var message = new $root.google.spanner.executor.v1.CreateCloudBackupAction(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.instanceId != null) + message.instanceId = String(object.instanceId); + if (object.backupId != null) + message.backupId = String(object.backupId); + if (object.databaseId != null) + message.databaseId = String(object.databaseId); + if (object.expireTime != null) { + if (typeof object.expireTime !== "object") + throw TypeError(".google.spanner.executor.v1.CreateCloudBackupAction.expireTime: object expected"); + message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); + } + if (object.versionTime != null) { + if (typeof object.versionTime !== "object") + throw TypeError(".google.spanner.executor.v1.CreateCloudBackupAction.versionTime: object expected"); + message.versionTime = $root.google.protobuf.Timestamp.fromObject(object.versionTime); + } + if (object.encryptionConfig != null) { + if (typeof object.encryptionConfig !== "object") + throw TypeError(".google.spanner.executor.v1.CreateCloudBackupAction.encryptionConfig: object expected"); + message.encryptionConfig = $root.google.spanner.admin.database.v1.EncryptionConfig.fromObject(object.encryptionConfig); + } + return message; + }; + + /** + * Creates a plain object from a CreateCloudBackupAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.executor.v1.CreateCloudBackupAction + * @static + * @param {google.spanner.executor.v1.CreateCloudBackupAction} message CreateCloudBackupAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateCloudBackupAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.instanceId = ""; + object.backupId = ""; + object.databaseId = ""; + object.expireTime = null; + object.encryptionConfig = null; + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + object.instanceId = message.instanceId; + if (message.backupId != null && message.hasOwnProperty("backupId")) + object.backupId = message.backupId; + if (message.databaseId != null && message.hasOwnProperty("databaseId")) + object.databaseId = message.databaseId; + if (message.expireTime != null && message.hasOwnProperty("expireTime")) + object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); + if (message.versionTime != null && message.hasOwnProperty("versionTime")) { + object.versionTime = $root.google.protobuf.Timestamp.toObject(message.versionTime, options); + if (options.oneofs) + object._versionTime = "versionTime"; + } + if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) + object.encryptionConfig = $root.google.spanner.admin.database.v1.EncryptionConfig.toObject(message.encryptionConfig, options); + return object; + }; + + /** + * Converts this CreateCloudBackupAction to JSON. + * @function toJSON + * @memberof google.spanner.executor.v1.CreateCloudBackupAction + * @instance + * @returns {Object.} JSON object + */ + CreateCloudBackupAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateCloudBackupAction + * @function getTypeUrl + * @memberof google.spanner.executor.v1.CreateCloudBackupAction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateCloudBackupAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.executor.v1.CreateCloudBackupAction"; + }; + + return CreateCloudBackupAction; + })(); + + v1.CopyCloudBackupAction = (function() { + + /** + * Properties of a CopyCloudBackupAction. + * @memberof google.spanner.executor.v1 + * @interface ICopyCloudBackupAction + * @property {string|null} [projectId] CopyCloudBackupAction projectId + * @property {string|null} [instanceId] CopyCloudBackupAction instanceId + * @property {string|null} [backupId] CopyCloudBackupAction backupId + * @property {string|null} [sourceBackup] CopyCloudBackupAction sourceBackup + * @property {google.protobuf.ITimestamp|null} [expireTime] CopyCloudBackupAction expireTime + */ + + /** + * Constructs a new CopyCloudBackupAction. + * @memberof google.spanner.executor.v1 + * @classdesc Represents a CopyCloudBackupAction. + * @implements ICopyCloudBackupAction + * @constructor + * @param {google.spanner.executor.v1.ICopyCloudBackupAction=} [properties] Properties to set + */ + function CopyCloudBackupAction(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CopyCloudBackupAction projectId. + * @member {string} projectId + * @memberof google.spanner.executor.v1.CopyCloudBackupAction + * @instance + */ + CopyCloudBackupAction.prototype.projectId = ""; + + /** + * CopyCloudBackupAction instanceId. + * @member {string} instanceId + * @memberof google.spanner.executor.v1.CopyCloudBackupAction + * @instance + */ + CopyCloudBackupAction.prototype.instanceId = ""; + + /** + * CopyCloudBackupAction backupId. + * @member {string} backupId + * @memberof google.spanner.executor.v1.CopyCloudBackupAction + * @instance + */ + CopyCloudBackupAction.prototype.backupId = ""; + + /** + * CopyCloudBackupAction sourceBackup. + * @member {string} sourceBackup + * @memberof google.spanner.executor.v1.CopyCloudBackupAction + * @instance + */ + CopyCloudBackupAction.prototype.sourceBackup = ""; + + /** + * CopyCloudBackupAction expireTime. + * @member {google.protobuf.ITimestamp|null|undefined} expireTime + * @memberof google.spanner.executor.v1.CopyCloudBackupAction + * @instance + */ + CopyCloudBackupAction.prototype.expireTime = null; + + /** + * Creates a new CopyCloudBackupAction instance using the specified properties. + * @function create + * @memberof google.spanner.executor.v1.CopyCloudBackupAction + * @static + * @param {google.spanner.executor.v1.ICopyCloudBackupAction=} [properties] Properties to set + * @returns {google.spanner.executor.v1.CopyCloudBackupAction} CopyCloudBackupAction instance + */ + CopyCloudBackupAction.create = function create(properties) { + return new CopyCloudBackupAction(properties); + }; + + /** + * Encodes the specified CopyCloudBackupAction message. Does not implicitly {@link google.spanner.executor.v1.CopyCloudBackupAction.verify|verify} messages. + * @function encode + * @memberof google.spanner.executor.v1.CopyCloudBackupAction + * @static + * @param {google.spanner.executor.v1.ICopyCloudBackupAction} message CopyCloudBackupAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CopyCloudBackupAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.instanceId); + if (message.backupId != null && Object.hasOwnProperty.call(message, "backupId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.backupId); + if (message.sourceBackup != null && Object.hasOwnProperty.call(message, "sourceBackup")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.sourceBackup); + if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) + $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CopyCloudBackupAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.CopyCloudBackupAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.executor.v1.CopyCloudBackupAction + * @static + * @param {google.spanner.executor.v1.ICopyCloudBackupAction} message CopyCloudBackupAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CopyCloudBackupAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CopyCloudBackupAction message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.executor.v1.CopyCloudBackupAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.executor.v1.CopyCloudBackupAction} CopyCloudBackupAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CopyCloudBackupAction.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.CopyCloudBackupAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.projectId = reader.string(); + break; + } + case 2: { + message.instanceId = reader.string(); + break; + } + case 3: { + message.backupId = reader.string(); + break; + } + case 4: { + message.sourceBackup = reader.string(); + break; + } + case 5: { + message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CopyCloudBackupAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.executor.v1.CopyCloudBackupAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.executor.v1.CopyCloudBackupAction} CopyCloudBackupAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CopyCloudBackupAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CopyCloudBackupAction message. + * @function verify + * @memberof google.spanner.executor.v1.CopyCloudBackupAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CopyCloudBackupAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + if (!$util.isString(message.instanceId)) + return "instanceId: string expected"; + if (message.backupId != null && message.hasOwnProperty("backupId")) + if (!$util.isString(message.backupId)) + return "backupId: string expected"; + if (message.sourceBackup != null && message.hasOwnProperty("sourceBackup")) + if (!$util.isString(message.sourceBackup)) + return "sourceBackup: string expected"; + if (message.expireTime != null && message.hasOwnProperty("expireTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.expireTime); + if (error) + return "expireTime." + error; + } + return null; + }; + + /** + * Creates a CopyCloudBackupAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.executor.v1.CopyCloudBackupAction + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.executor.v1.CopyCloudBackupAction} CopyCloudBackupAction + */ + CopyCloudBackupAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.executor.v1.CopyCloudBackupAction) + return object; + var message = new $root.google.spanner.executor.v1.CopyCloudBackupAction(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.instanceId != null) + message.instanceId = String(object.instanceId); + if (object.backupId != null) + message.backupId = String(object.backupId); + if (object.sourceBackup != null) + message.sourceBackup = String(object.sourceBackup); + if (object.expireTime != null) { + if (typeof object.expireTime !== "object") + throw TypeError(".google.spanner.executor.v1.CopyCloudBackupAction.expireTime: object expected"); + message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); + } + return message; + }; + + /** + * Creates a plain object from a CopyCloudBackupAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.executor.v1.CopyCloudBackupAction + * @static + * @param {google.spanner.executor.v1.CopyCloudBackupAction} message CopyCloudBackupAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CopyCloudBackupAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.instanceId = ""; + object.backupId = ""; + object.sourceBackup = ""; + object.expireTime = null; + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + object.instanceId = message.instanceId; + if (message.backupId != null && message.hasOwnProperty("backupId")) + object.backupId = message.backupId; + if (message.sourceBackup != null && message.hasOwnProperty("sourceBackup")) + object.sourceBackup = message.sourceBackup; + if (message.expireTime != null && message.hasOwnProperty("expireTime")) + object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); + return object; + }; + + /** + * Converts this CopyCloudBackupAction to JSON. + * @function toJSON + * @memberof google.spanner.executor.v1.CopyCloudBackupAction + * @instance + * @returns {Object.} JSON object + */ + CopyCloudBackupAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CopyCloudBackupAction + * @function getTypeUrl + * @memberof google.spanner.executor.v1.CopyCloudBackupAction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CopyCloudBackupAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.executor.v1.CopyCloudBackupAction"; + }; + + return CopyCloudBackupAction; + })(); + + v1.GetCloudBackupAction = (function() { + + /** + * Properties of a GetCloudBackupAction. + * @memberof google.spanner.executor.v1 + * @interface IGetCloudBackupAction + * @property {string|null} [projectId] GetCloudBackupAction projectId + * @property {string|null} [instanceId] GetCloudBackupAction instanceId + * @property {string|null} [backupId] GetCloudBackupAction backupId + */ + + /** + * Constructs a new GetCloudBackupAction. + * @memberof google.spanner.executor.v1 + * @classdesc Represents a GetCloudBackupAction. + * @implements IGetCloudBackupAction + * @constructor + * @param {google.spanner.executor.v1.IGetCloudBackupAction=} [properties] Properties to set + */ + function GetCloudBackupAction(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetCloudBackupAction projectId. + * @member {string} projectId + * @memberof google.spanner.executor.v1.GetCloudBackupAction + * @instance + */ + GetCloudBackupAction.prototype.projectId = ""; + + /** + * GetCloudBackupAction instanceId. + * @member {string} instanceId + * @memberof google.spanner.executor.v1.GetCloudBackupAction + * @instance + */ + GetCloudBackupAction.prototype.instanceId = ""; + + /** + * GetCloudBackupAction backupId. + * @member {string} backupId + * @memberof google.spanner.executor.v1.GetCloudBackupAction + * @instance + */ + GetCloudBackupAction.prototype.backupId = ""; + + /** + * Creates a new GetCloudBackupAction instance using the specified properties. + * @function create + * @memberof google.spanner.executor.v1.GetCloudBackupAction + * @static + * @param {google.spanner.executor.v1.IGetCloudBackupAction=} [properties] Properties to set + * @returns {google.spanner.executor.v1.GetCloudBackupAction} GetCloudBackupAction instance + */ + GetCloudBackupAction.create = function create(properties) { + return new GetCloudBackupAction(properties); + }; + + /** + * Encodes the specified GetCloudBackupAction message. Does not implicitly {@link google.spanner.executor.v1.GetCloudBackupAction.verify|verify} messages. + * @function encode + * @memberof google.spanner.executor.v1.GetCloudBackupAction + * @static + * @param {google.spanner.executor.v1.IGetCloudBackupAction} message GetCloudBackupAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCloudBackupAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.instanceId); + if (message.backupId != null && Object.hasOwnProperty.call(message, "backupId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.backupId); + return writer; + }; + + /** + * Encodes the specified GetCloudBackupAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.GetCloudBackupAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.executor.v1.GetCloudBackupAction + * @static + * @param {google.spanner.executor.v1.IGetCloudBackupAction} message GetCloudBackupAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCloudBackupAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetCloudBackupAction message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.executor.v1.GetCloudBackupAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.executor.v1.GetCloudBackupAction} GetCloudBackupAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCloudBackupAction.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.GetCloudBackupAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.projectId = reader.string(); + break; + } + case 2: { + message.instanceId = reader.string(); + break; + } + case 3: { + message.backupId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetCloudBackupAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.executor.v1.GetCloudBackupAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.executor.v1.GetCloudBackupAction} GetCloudBackupAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCloudBackupAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetCloudBackupAction message. + * @function verify + * @memberof google.spanner.executor.v1.GetCloudBackupAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetCloudBackupAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + if (!$util.isString(message.instanceId)) + return "instanceId: string expected"; + if (message.backupId != null && message.hasOwnProperty("backupId")) + if (!$util.isString(message.backupId)) + return "backupId: string expected"; + return null; + }; + + /** + * Creates a GetCloudBackupAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.executor.v1.GetCloudBackupAction + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.executor.v1.GetCloudBackupAction} GetCloudBackupAction + */ + GetCloudBackupAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.executor.v1.GetCloudBackupAction) + return object; + var message = new $root.google.spanner.executor.v1.GetCloudBackupAction(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.instanceId != null) + message.instanceId = String(object.instanceId); + if (object.backupId != null) + message.backupId = String(object.backupId); + return message; + }; + + /** + * Creates a plain object from a GetCloudBackupAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.executor.v1.GetCloudBackupAction + * @static + * @param {google.spanner.executor.v1.GetCloudBackupAction} message GetCloudBackupAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetCloudBackupAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.instanceId = ""; + object.backupId = ""; + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + object.instanceId = message.instanceId; + if (message.backupId != null && message.hasOwnProperty("backupId")) + object.backupId = message.backupId; + return object; + }; + + /** + * Converts this GetCloudBackupAction to JSON. + * @function toJSON + * @memberof google.spanner.executor.v1.GetCloudBackupAction + * @instance + * @returns {Object.} JSON object + */ + GetCloudBackupAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetCloudBackupAction + * @function getTypeUrl + * @memberof google.spanner.executor.v1.GetCloudBackupAction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetCloudBackupAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.executor.v1.GetCloudBackupAction"; + }; + + return GetCloudBackupAction; + })(); + + v1.UpdateCloudBackupAction = (function() { + + /** + * Properties of an UpdateCloudBackupAction. + * @memberof google.spanner.executor.v1 + * @interface IUpdateCloudBackupAction + * @property {string|null} [projectId] UpdateCloudBackupAction projectId + * @property {string|null} [instanceId] UpdateCloudBackupAction instanceId + * @property {string|null} [backupId] UpdateCloudBackupAction backupId + * @property {google.protobuf.ITimestamp|null} [expireTime] UpdateCloudBackupAction expireTime + */ + + /** + * Constructs a new UpdateCloudBackupAction. + * @memberof google.spanner.executor.v1 + * @classdesc Represents an UpdateCloudBackupAction. + * @implements IUpdateCloudBackupAction + * @constructor + * @param {google.spanner.executor.v1.IUpdateCloudBackupAction=} [properties] Properties to set + */ + function UpdateCloudBackupAction(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateCloudBackupAction projectId. + * @member {string} projectId + * @memberof google.spanner.executor.v1.UpdateCloudBackupAction + * @instance + */ + UpdateCloudBackupAction.prototype.projectId = ""; + + /** + * UpdateCloudBackupAction instanceId. + * @member {string} instanceId + * @memberof google.spanner.executor.v1.UpdateCloudBackupAction + * @instance + */ + UpdateCloudBackupAction.prototype.instanceId = ""; + + /** + * UpdateCloudBackupAction backupId. + * @member {string} backupId + * @memberof google.spanner.executor.v1.UpdateCloudBackupAction + * @instance + */ + UpdateCloudBackupAction.prototype.backupId = ""; + + /** + * UpdateCloudBackupAction expireTime. + * @member {google.protobuf.ITimestamp|null|undefined} expireTime + * @memberof google.spanner.executor.v1.UpdateCloudBackupAction + * @instance + */ + UpdateCloudBackupAction.prototype.expireTime = null; + + /** + * Creates a new UpdateCloudBackupAction instance using the specified properties. + * @function create + * @memberof google.spanner.executor.v1.UpdateCloudBackupAction + * @static + * @param {google.spanner.executor.v1.IUpdateCloudBackupAction=} [properties] Properties to set + * @returns {google.spanner.executor.v1.UpdateCloudBackupAction} UpdateCloudBackupAction instance + */ + UpdateCloudBackupAction.create = function create(properties) { + return new UpdateCloudBackupAction(properties); + }; + + /** + * Encodes the specified UpdateCloudBackupAction message. Does not implicitly {@link google.spanner.executor.v1.UpdateCloudBackupAction.verify|verify} messages. + * @function encode + * @memberof google.spanner.executor.v1.UpdateCloudBackupAction + * @static + * @param {google.spanner.executor.v1.IUpdateCloudBackupAction} message UpdateCloudBackupAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateCloudBackupAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.instanceId); + if (message.backupId != null && Object.hasOwnProperty.call(message, "backupId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.backupId); + if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) + $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateCloudBackupAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.UpdateCloudBackupAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.executor.v1.UpdateCloudBackupAction + * @static + * @param {google.spanner.executor.v1.IUpdateCloudBackupAction} message UpdateCloudBackupAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateCloudBackupAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateCloudBackupAction message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.executor.v1.UpdateCloudBackupAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.executor.v1.UpdateCloudBackupAction} UpdateCloudBackupAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateCloudBackupAction.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.UpdateCloudBackupAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.projectId = reader.string(); + break; + } + case 2: { + message.instanceId = reader.string(); + break; + } + case 3: { + message.backupId = reader.string(); + break; + } + case 4: { + message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateCloudBackupAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.executor.v1.UpdateCloudBackupAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.executor.v1.UpdateCloudBackupAction} UpdateCloudBackupAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateCloudBackupAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateCloudBackupAction message. + * @function verify + * @memberof google.spanner.executor.v1.UpdateCloudBackupAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateCloudBackupAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + if (!$util.isString(message.instanceId)) + return "instanceId: string expected"; + if (message.backupId != null && message.hasOwnProperty("backupId")) + if (!$util.isString(message.backupId)) + return "backupId: string expected"; + if (message.expireTime != null && message.hasOwnProperty("expireTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.expireTime); + if (error) + return "expireTime." + error; + } + return null; + }; + + /** + * Creates an UpdateCloudBackupAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.executor.v1.UpdateCloudBackupAction + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.executor.v1.UpdateCloudBackupAction} UpdateCloudBackupAction + */ + UpdateCloudBackupAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.executor.v1.UpdateCloudBackupAction) + return object; + var message = new $root.google.spanner.executor.v1.UpdateCloudBackupAction(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.instanceId != null) + message.instanceId = String(object.instanceId); + if (object.backupId != null) + message.backupId = String(object.backupId); + if (object.expireTime != null) { + if (typeof object.expireTime !== "object") + throw TypeError(".google.spanner.executor.v1.UpdateCloudBackupAction.expireTime: object expected"); + message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); + } + return message; + }; + + /** + * Creates a plain object from an UpdateCloudBackupAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.executor.v1.UpdateCloudBackupAction + * @static + * @param {google.spanner.executor.v1.UpdateCloudBackupAction} message UpdateCloudBackupAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateCloudBackupAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.instanceId = ""; + object.backupId = ""; + object.expireTime = null; + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + object.instanceId = message.instanceId; + if (message.backupId != null && message.hasOwnProperty("backupId")) + object.backupId = message.backupId; + if (message.expireTime != null && message.hasOwnProperty("expireTime")) + object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); + return object; + }; + + /** + * Converts this UpdateCloudBackupAction to JSON. + * @function toJSON + * @memberof google.spanner.executor.v1.UpdateCloudBackupAction + * @instance + * @returns {Object.} JSON object + */ + UpdateCloudBackupAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateCloudBackupAction + * @function getTypeUrl + * @memberof google.spanner.executor.v1.UpdateCloudBackupAction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateCloudBackupAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.executor.v1.UpdateCloudBackupAction"; + }; + + return UpdateCloudBackupAction; + })(); + + v1.DeleteCloudBackupAction = (function() { + + /** + * Properties of a DeleteCloudBackupAction. + * @memberof google.spanner.executor.v1 + * @interface IDeleteCloudBackupAction + * @property {string|null} [projectId] DeleteCloudBackupAction projectId + * @property {string|null} [instanceId] DeleteCloudBackupAction instanceId + * @property {string|null} [backupId] DeleteCloudBackupAction backupId + */ + + /** + * Constructs a new DeleteCloudBackupAction. + * @memberof google.spanner.executor.v1 + * @classdesc Represents a DeleteCloudBackupAction. + * @implements IDeleteCloudBackupAction + * @constructor + * @param {google.spanner.executor.v1.IDeleteCloudBackupAction=} [properties] Properties to set + */ + function DeleteCloudBackupAction(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteCloudBackupAction projectId. + * @member {string} projectId + * @memberof google.spanner.executor.v1.DeleteCloudBackupAction + * @instance + */ + DeleteCloudBackupAction.prototype.projectId = ""; + + /** + * DeleteCloudBackupAction instanceId. + * @member {string} instanceId + * @memberof google.spanner.executor.v1.DeleteCloudBackupAction + * @instance + */ + DeleteCloudBackupAction.prototype.instanceId = ""; + + /** + * DeleteCloudBackupAction backupId. + * @member {string} backupId + * @memberof google.spanner.executor.v1.DeleteCloudBackupAction + * @instance + */ + DeleteCloudBackupAction.prototype.backupId = ""; + + /** + * Creates a new DeleteCloudBackupAction instance using the specified properties. + * @function create + * @memberof google.spanner.executor.v1.DeleteCloudBackupAction + * @static + * @param {google.spanner.executor.v1.IDeleteCloudBackupAction=} [properties] Properties to set + * @returns {google.spanner.executor.v1.DeleteCloudBackupAction} DeleteCloudBackupAction instance + */ + DeleteCloudBackupAction.create = function create(properties) { + return new DeleteCloudBackupAction(properties); + }; + + /** + * Encodes the specified DeleteCloudBackupAction message. Does not implicitly {@link google.spanner.executor.v1.DeleteCloudBackupAction.verify|verify} messages. + * @function encode + * @memberof google.spanner.executor.v1.DeleteCloudBackupAction + * @static + * @param {google.spanner.executor.v1.IDeleteCloudBackupAction} message DeleteCloudBackupAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteCloudBackupAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.instanceId); + if (message.backupId != null && Object.hasOwnProperty.call(message, "backupId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.backupId); + return writer; + }; + + /** + * Encodes the specified DeleteCloudBackupAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.DeleteCloudBackupAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.executor.v1.DeleteCloudBackupAction + * @static + * @param {google.spanner.executor.v1.IDeleteCloudBackupAction} message DeleteCloudBackupAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteCloudBackupAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteCloudBackupAction message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.executor.v1.DeleteCloudBackupAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.executor.v1.DeleteCloudBackupAction} DeleteCloudBackupAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteCloudBackupAction.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.DeleteCloudBackupAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.projectId = reader.string(); + break; + } + case 2: { + message.instanceId = reader.string(); + break; + } + case 3: { + message.backupId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteCloudBackupAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.executor.v1.DeleteCloudBackupAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.executor.v1.DeleteCloudBackupAction} DeleteCloudBackupAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteCloudBackupAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteCloudBackupAction message. + * @function verify + * @memberof google.spanner.executor.v1.DeleteCloudBackupAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteCloudBackupAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + if (!$util.isString(message.instanceId)) + return "instanceId: string expected"; + if (message.backupId != null && message.hasOwnProperty("backupId")) + if (!$util.isString(message.backupId)) + return "backupId: string expected"; + return null; + }; + + /** + * Creates a DeleteCloudBackupAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.executor.v1.DeleteCloudBackupAction + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.executor.v1.DeleteCloudBackupAction} DeleteCloudBackupAction + */ + DeleteCloudBackupAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.executor.v1.DeleteCloudBackupAction) + return object; + var message = new $root.google.spanner.executor.v1.DeleteCloudBackupAction(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.instanceId != null) + message.instanceId = String(object.instanceId); + if (object.backupId != null) + message.backupId = String(object.backupId); + return message; + }; + + /** + * Creates a plain object from a DeleteCloudBackupAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.executor.v1.DeleteCloudBackupAction + * @static + * @param {google.spanner.executor.v1.DeleteCloudBackupAction} message DeleteCloudBackupAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteCloudBackupAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.instanceId = ""; + object.backupId = ""; + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + object.instanceId = message.instanceId; + if (message.backupId != null && message.hasOwnProperty("backupId")) + object.backupId = message.backupId; + return object; + }; + + /** + * Converts this DeleteCloudBackupAction to JSON. + * @function toJSON + * @memberof google.spanner.executor.v1.DeleteCloudBackupAction + * @instance + * @returns {Object.} JSON object + */ + DeleteCloudBackupAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteCloudBackupAction + * @function getTypeUrl + * @memberof google.spanner.executor.v1.DeleteCloudBackupAction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteCloudBackupAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.executor.v1.DeleteCloudBackupAction"; + }; + + return DeleteCloudBackupAction; + })(); + + v1.ListCloudBackupsAction = (function() { + + /** + * Properties of a ListCloudBackupsAction. + * @memberof google.spanner.executor.v1 + * @interface IListCloudBackupsAction + * @property {string|null} [projectId] ListCloudBackupsAction projectId + * @property {string|null} [instanceId] ListCloudBackupsAction instanceId + * @property {string|null} [filter] ListCloudBackupsAction filter + * @property {number|null} [pageSize] ListCloudBackupsAction pageSize + * @property {string|null} [pageToken] ListCloudBackupsAction pageToken + */ + + /** + * Constructs a new ListCloudBackupsAction. + * @memberof google.spanner.executor.v1 + * @classdesc Represents a ListCloudBackupsAction. + * @implements IListCloudBackupsAction + * @constructor + * @param {google.spanner.executor.v1.IListCloudBackupsAction=} [properties] Properties to set + */ + function ListCloudBackupsAction(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListCloudBackupsAction projectId. + * @member {string} projectId + * @memberof google.spanner.executor.v1.ListCloudBackupsAction + * @instance + */ + ListCloudBackupsAction.prototype.projectId = ""; + + /** + * ListCloudBackupsAction instanceId. + * @member {string} instanceId + * @memberof google.spanner.executor.v1.ListCloudBackupsAction + * @instance + */ + ListCloudBackupsAction.prototype.instanceId = ""; + + /** + * ListCloudBackupsAction filter. + * @member {string} filter + * @memberof google.spanner.executor.v1.ListCloudBackupsAction + * @instance + */ + ListCloudBackupsAction.prototype.filter = ""; + + /** + * ListCloudBackupsAction pageSize. + * @member {number} pageSize + * @memberof google.spanner.executor.v1.ListCloudBackupsAction + * @instance + */ + ListCloudBackupsAction.prototype.pageSize = 0; + + /** + * ListCloudBackupsAction pageToken. + * @member {string} pageToken + * @memberof google.spanner.executor.v1.ListCloudBackupsAction + * @instance + */ + ListCloudBackupsAction.prototype.pageToken = ""; + + /** + * Creates a new ListCloudBackupsAction instance using the specified properties. + * @function create + * @memberof google.spanner.executor.v1.ListCloudBackupsAction + * @static + * @param {google.spanner.executor.v1.IListCloudBackupsAction=} [properties] Properties to set + * @returns {google.spanner.executor.v1.ListCloudBackupsAction} ListCloudBackupsAction instance + */ + ListCloudBackupsAction.create = function create(properties) { + return new ListCloudBackupsAction(properties); + }; + + /** + * Encodes the specified ListCloudBackupsAction message. Does not implicitly {@link google.spanner.executor.v1.ListCloudBackupsAction.verify|verify} messages. + * @function encode + * @memberof google.spanner.executor.v1.ListCloudBackupsAction + * @static + * @param {google.spanner.executor.v1.IListCloudBackupsAction} message ListCloudBackupsAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCloudBackupsAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.instanceId); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListCloudBackupsAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.ListCloudBackupsAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.executor.v1.ListCloudBackupsAction + * @static + * @param {google.spanner.executor.v1.IListCloudBackupsAction} message ListCloudBackupsAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCloudBackupsAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListCloudBackupsAction message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.executor.v1.ListCloudBackupsAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.executor.v1.ListCloudBackupsAction} ListCloudBackupsAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCloudBackupsAction.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.ListCloudBackupsAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.projectId = reader.string(); + break; + } + case 2: { + message.instanceId = reader.string(); + break; + } + case 3: { + message.filter = reader.string(); + break; + } + case 4: { + message.pageSize = reader.int32(); + break; + } + case 5: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListCloudBackupsAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.executor.v1.ListCloudBackupsAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.executor.v1.ListCloudBackupsAction} ListCloudBackupsAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCloudBackupsAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListCloudBackupsAction message. + * @function verify + * @memberof google.spanner.executor.v1.ListCloudBackupsAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListCloudBackupsAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + if (!$util.isString(message.instanceId)) + return "instanceId: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListCloudBackupsAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.executor.v1.ListCloudBackupsAction + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.executor.v1.ListCloudBackupsAction} ListCloudBackupsAction + */ + ListCloudBackupsAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.executor.v1.ListCloudBackupsAction) + return object; + var message = new $root.google.spanner.executor.v1.ListCloudBackupsAction(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.instanceId != null) + message.instanceId = String(object.instanceId); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListCloudBackupsAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.executor.v1.ListCloudBackupsAction + * @static + * @param {google.spanner.executor.v1.ListCloudBackupsAction} message ListCloudBackupsAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListCloudBackupsAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.instanceId = ""; + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + object.instanceId = message.instanceId; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListCloudBackupsAction to JSON. + * @function toJSON + * @memberof google.spanner.executor.v1.ListCloudBackupsAction + * @instance + * @returns {Object.} JSON object + */ + ListCloudBackupsAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListCloudBackupsAction + * @function getTypeUrl + * @memberof google.spanner.executor.v1.ListCloudBackupsAction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListCloudBackupsAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.executor.v1.ListCloudBackupsAction"; + }; + + return ListCloudBackupsAction; + })(); + + v1.ListCloudBackupOperationsAction = (function() { + + /** + * Properties of a ListCloudBackupOperationsAction. + * @memberof google.spanner.executor.v1 + * @interface IListCloudBackupOperationsAction + * @property {string|null} [projectId] ListCloudBackupOperationsAction projectId + * @property {string|null} [instanceId] ListCloudBackupOperationsAction instanceId + * @property {string|null} [filter] ListCloudBackupOperationsAction filter + * @property {number|null} [pageSize] ListCloudBackupOperationsAction pageSize + * @property {string|null} [pageToken] ListCloudBackupOperationsAction pageToken + */ + + /** + * Constructs a new ListCloudBackupOperationsAction. + * @memberof google.spanner.executor.v1 + * @classdesc Represents a ListCloudBackupOperationsAction. + * @implements IListCloudBackupOperationsAction + * @constructor + * @param {google.spanner.executor.v1.IListCloudBackupOperationsAction=} [properties] Properties to set + */ + function ListCloudBackupOperationsAction(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListCloudBackupOperationsAction projectId. + * @member {string} projectId + * @memberof google.spanner.executor.v1.ListCloudBackupOperationsAction + * @instance + */ + ListCloudBackupOperationsAction.prototype.projectId = ""; + + /** + * ListCloudBackupOperationsAction instanceId. + * @member {string} instanceId + * @memberof google.spanner.executor.v1.ListCloudBackupOperationsAction + * @instance + */ + ListCloudBackupOperationsAction.prototype.instanceId = ""; + + /** + * ListCloudBackupOperationsAction filter. + * @member {string} filter + * @memberof google.spanner.executor.v1.ListCloudBackupOperationsAction + * @instance + */ + ListCloudBackupOperationsAction.prototype.filter = ""; + + /** + * ListCloudBackupOperationsAction pageSize. + * @member {number} pageSize + * @memberof google.spanner.executor.v1.ListCloudBackupOperationsAction + * @instance + */ + ListCloudBackupOperationsAction.prototype.pageSize = 0; + + /** + * ListCloudBackupOperationsAction pageToken. + * @member {string} pageToken + * @memberof google.spanner.executor.v1.ListCloudBackupOperationsAction + * @instance + */ + ListCloudBackupOperationsAction.prototype.pageToken = ""; + + /** + * Creates a new ListCloudBackupOperationsAction instance using the specified properties. + * @function create + * @memberof google.spanner.executor.v1.ListCloudBackupOperationsAction + * @static + * @param {google.spanner.executor.v1.IListCloudBackupOperationsAction=} [properties] Properties to set + * @returns {google.spanner.executor.v1.ListCloudBackupOperationsAction} ListCloudBackupOperationsAction instance + */ + ListCloudBackupOperationsAction.create = function create(properties) { + return new ListCloudBackupOperationsAction(properties); + }; + + /** + * Encodes the specified ListCloudBackupOperationsAction message. Does not implicitly {@link google.spanner.executor.v1.ListCloudBackupOperationsAction.verify|verify} messages. + * @function encode + * @memberof google.spanner.executor.v1.ListCloudBackupOperationsAction + * @static + * @param {google.spanner.executor.v1.IListCloudBackupOperationsAction} message ListCloudBackupOperationsAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCloudBackupOperationsAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.instanceId); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListCloudBackupOperationsAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.ListCloudBackupOperationsAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.executor.v1.ListCloudBackupOperationsAction + * @static + * @param {google.spanner.executor.v1.IListCloudBackupOperationsAction} message ListCloudBackupOperationsAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCloudBackupOperationsAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListCloudBackupOperationsAction message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.executor.v1.ListCloudBackupOperationsAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.executor.v1.ListCloudBackupOperationsAction} ListCloudBackupOperationsAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCloudBackupOperationsAction.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.ListCloudBackupOperationsAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.projectId = reader.string(); + break; + } + case 2: { + message.instanceId = reader.string(); + break; + } + case 3: { + message.filter = reader.string(); + break; + } + case 4: { + message.pageSize = reader.int32(); + break; + } + case 5: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListCloudBackupOperationsAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.executor.v1.ListCloudBackupOperationsAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.executor.v1.ListCloudBackupOperationsAction} ListCloudBackupOperationsAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCloudBackupOperationsAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListCloudBackupOperationsAction message. + * @function verify + * @memberof google.spanner.executor.v1.ListCloudBackupOperationsAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListCloudBackupOperationsAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + if (!$util.isString(message.instanceId)) + return "instanceId: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListCloudBackupOperationsAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.executor.v1.ListCloudBackupOperationsAction + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.executor.v1.ListCloudBackupOperationsAction} ListCloudBackupOperationsAction + */ + ListCloudBackupOperationsAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.executor.v1.ListCloudBackupOperationsAction) + return object; + var message = new $root.google.spanner.executor.v1.ListCloudBackupOperationsAction(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.instanceId != null) + message.instanceId = String(object.instanceId); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListCloudBackupOperationsAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.executor.v1.ListCloudBackupOperationsAction + * @static + * @param {google.spanner.executor.v1.ListCloudBackupOperationsAction} message ListCloudBackupOperationsAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListCloudBackupOperationsAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.instanceId = ""; + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + object.instanceId = message.instanceId; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListCloudBackupOperationsAction to JSON. + * @function toJSON + * @memberof google.spanner.executor.v1.ListCloudBackupOperationsAction + * @instance + * @returns {Object.} JSON object + */ + ListCloudBackupOperationsAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListCloudBackupOperationsAction + * @function getTypeUrl + * @memberof google.spanner.executor.v1.ListCloudBackupOperationsAction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListCloudBackupOperationsAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.executor.v1.ListCloudBackupOperationsAction"; + }; + + return ListCloudBackupOperationsAction; + })(); + + v1.GetOperationAction = (function() { + + /** + * Properties of a GetOperationAction. + * @memberof google.spanner.executor.v1 + * @interface IGetOperationAction + * @property {string|null} [operation] GetOperationAction operation + */ + + /** + * Constructs a new GetOperationAction. + * @memberof google.spanner.executor.v1 + * @classdesc Represents a GetOperationAction. + * @implements IGetOperationAction + * @constructor + * @param {google.spanner.executor.v1.IGetOperationAction=} [properties] Properties to set + */ + function GetOperationAction(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetOperationAction operation. + * @member {string} operation + * @memberof google.spanner.executor.v1.GetOperationAction + * @instance + */ + GetOperationAction.prototype.operation = ""; + + /** + * Creates a new GetOperationAction instance using the specified properties. + * @function create + * @memberof google.spanner.executor.v1.GetOperationAction + * @static + * @param {google.spanner.executor.v1.IGetOperationAction=} [properties] Properties to set + * @returns {google.spanner.executor.v1.GetOperationAction} GetOperationAction instance + */ + GetOperationAction.create = function create(properties) { + return new GetOperationAction(properties); + }; + + /** + * Encodes the specified GetOperationAction message. Does not implicitly {@link google.spanner.executor.v1.GetOperationAction.verify|verify} messages. + * @function encode + * @memberof google.spanner.executor.v1.GetOperationAction + * @static + * @param {google.spanner.executor.v1.IGetOperationAction} message GetOperationAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.operation != null && Object.hasOwnProperty.call(message, "operation")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.operation); + return writer; + }; + + /** + * Encodes the specified GetOperationAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.GetOperationAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.executor.v1.GetOperationAction + * @static + * @param {google.spanner.executor.v1.IGetOperationAction} message GetOperationAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetOperationAction message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.executor.v1.GetOperationAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.executor.v1.GetOperationAction} GetOperationAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationAction.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.GetOperationAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.operation = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetOperationAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.executor.v1.GetOperationAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.executor.v1.GetOperationAction} GetOperationAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetOperationAction message. + * @function verify + * @memberof google.spanner.executor.v1.GetOperationAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetOperationAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.operation != null && message.hasOwnProperty("operation")) + if (!$util.isString(message.operation)) + return "operation: string expected"; + return null; + }; + + /** + * Creates a GetOperationAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.executor.v1.GetOperationAction + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.executor.v1.GetOperationAction} GetOperationAction + */ + GetOperationAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.executor.v1.GetOperationAction) + return object; + var message = new $root.google.spanner.executor.v1.GetOperationAction(); + if (object.operation != null) + message.operation = String(object.operation); + return message; + }; + + /** + * Creates a plain object from a GetOperationAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.executor.v1.GetOperationAction + * @static + * @param {google.spanner.executor.v1.GetOperationAction} message GetOperationAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetOperationAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.operation = ""; + if (message.operation != null && message.hasOwnProperty("operation")) + object.operation = message.operation; + return object; + }; + + /** + * Converts this GetOperationAction to JSON. + * @function toJSON + * @memberof google.spanner.executor.v1.GetOperationAction + * @instance + * @returns {Object.} JSON object + */ + GetOperationAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetOperationAction + * @function getTypeUrl + * @memberof google.spanner.executor.v1.GetOperationAction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetOperationAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.executor.v1.GetOperationAction"; + }; + + return GetOperationAction; + })(); + + v1.QueryCancellationAction = (function() { + + /** + * Properties of a QueryCancellationAction. + * @memberof google.spanner.executor.v1 + * @interface IQueryCancellationAction + * @property {string|null} [longRunningSql] QueryCancellationAction longRunningSql + * @property {string|null} [cancelQuery] QueryCancellationAction cancelQuery + */ + + /** + * Constructs a new QueryCancellationAction. + * @memberof google.spanner.executor.v1 + * @classdesc Represents a QueryCancellationAction. + * @implements IQueryCancellationAction + * @constructor + * @param {google.spanner.executor.v1.IQueryCancellationAction=} [properties] Properties to set + */ + function QueryCancellationAction(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryCancellationAction longRunningSql. + * @member {string} longRunningSql + * @memberof google.spanner.executor.v1.QueryCancellationAction + * @instance + */ + QueryCancellationAction.prototype.longRunningSql = ""; + + /** + * QueryCancellationAction cancelQuery. + * @member {string} cancelQuery + * @memberof google.spanner.executor.v1.QueryCancellationAction + * @instance + */ + QueryCancellationAction.prototype.cancelQuery = ""; + + /** + * Creates a new QueryCancellationAction instance using the specified properties. + * @function create + * @memberof google.spanner.executor.v1.QueryCancellationAction + * @static + * @param {google.spanner.executor.v1.IQueryCancellationAction=} [properties] Properties to set + * @returns {google.spanner.executor.v1.QueryCancellationAction} QueryCancellationAction instance + */ + QueryCancellationAction.create = function create(properties) { + return new QueryCancellationAction(properties); + }; + + /** + * Encodes the specified QueryCancellationAction message. Does not implicitly {@link google.spanner.executor.v1.QueryCancellationAction.verify|verify} messages. + * @function encode + * @memberof google.spanner.executor.v1.QueryCancellationAction + * @static + * @param {google.spanner.executor.v1.IQueryCancellationAction} message QueryCancellationAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryCancellationAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.longRunningSql != null && Object.hasOwnProperty.call(message, "longRunningSql")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.longRunningSql); + if (message.cancelQuery != null && Object.hasOwnProperty.call(message, "cancelQuery")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.cancelQuery); + return writer; + }; + + /** + * Encodes the specified QueryCancellationAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.QueryCancellationAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.executor.v1.QueryCancellationAction + * @static + * @param {google.spanner.executor.v1.IQueryCancellationAction} message QueryCancellationAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryCancellationAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryCancellationAction message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.executor.v1.QueryCancellationAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.executor.v1.QueryCancellationAction} QueryCancellationAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryCancellationAction.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.QueryCancellationAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.longRunningSql = reader.string(); + break; + } + case 2: { + message.cancelQuery = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryCancellationAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.executor.v1.QueryCancellationAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.executor.v1.QueryCancellationAction} QueryCancellationAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryCancellationAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryCancellationAction message. + * @function verify + * @memberof google.spanner.executor.v1.QueryCancellationAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryCancellationAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.longRunningSql != null && message.hasOwnProperty("longRunningSql")) + if (!$util.isString(message.longRunningSql)) + return "longRunningSql: string expected"; + if (message.cancelQuery != null && message.hasOwnProperty("cancelQuery")) + if (!$util.isString(message.cancelQuery)) + return "cancelQuery: string expected"; + return null; + }; + + /** + * Creates a QueryCancellationAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.executor.v1.QueryCancellationAction + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.executor.v1.QueryCancellationAction} QueryCancellationAction + */ + QueryCancellationAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.executor.v1.QueryCancellationAction) + return object; + var message = new $root.google.spanner.executor.v1.QueryCancellationAction(); + if (object.longRunningSql != null) + message.longRunningSql = String(object.longRunningSql); + if (object.cancelQuery != null) + message.cancelQuery = String(object.cancelQuery); + return message; + }; + + /** + * Creates a plain object from a QueryCancellationAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.executor.v1.QueryCancellationAction + * @static + * @param {google.spanner.executor.v1.QueryCancellationAction} message QueryCancellationAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryCancellationAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.longRunningSql = ""; + object.cancelQuery = ""; + } + if (message.longRunningSql != null && message.hasOwnProperty("longRunningSql")) + object.longRunningSql = message.longRunningSql; + if (message.cancelQuery != null && message.hasOwnProperty("cancelQuery")) + object.cancelQuery = message.cancelQuery; + return object; + }; + + /** + * Converts this QueryCancellationAction to JSON. + * @function toJSON + * @memberof google.spanner.executor.v1.QueryCancellationAction + * @instance + * @returns {Object.} JSON object + */ + QueryCancellationAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for QueryCancellationAction + * @function getTypeUrl + * @memberof google.spanner.executor.v1.QueryCancellationAction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + QueryCancellationAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.executor.v1.QueryCancellationAction"; + }; + + return QueryCancellationAction; + })(); + + v1.CancelOperationAction = (function() { + + /** + * Properties of a CancelOperationAction. + * @memberof google.spanner.executor.v1 + * @interface ICancelOperationAction + * @property {string|null} [operation] CancelOperationAction operation + */ + + /** + * Constructs a new CancelOperationAction. + * @memberof google.spanner.executor.v1 + * @classdesc Represents a CancelOperationAction. + * @implements ICancelOperationAction + * @constructor + * @param {google.spanner.executor.v1.ICancelOperationAction=} [properties] Properties to set + */ + function CancelOperationAction(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CancelOperationAction operation. + * @member {string} operation + * @memberof google.spanner.executor.v1.CancelOperationAction + * @instance + */ + CancelOperationAction.prototype.operation = ""; + + /** + * Creates a new CancelOperationAction instance using the specified properties. + * @function create + * @memberof google.spanner.executor.v1.CancelOperationAction + * @static + * @param {google.spanner.executor.v1.ICancelOperationAction=} [properties] Properties to set + * @returns {google.spanner.executor.v1.CancelOperationAction} CancelOperationAction instance + */ + CancelOperationAction.create = function create(properties) { + return new CancelOperationAction(properties); + }; + + /** + * Encodes the specified CancelOperationAction message. Does not implicitly {@link google.spanner.executor.v1.CancelOperationAction.verify|verify} messages. + * @function encode + * @memberof google.spanner.executor.v1.CancelOperationAction + * @static + * @param {google.spanner.executor.v1.ICancelOperationAction} message CancelOperationAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.operation != null && Object.hasOwnProperty.call(message, "operation")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.operation); + return writer; + }; + + /** + * Encodes the specified CancelOperationAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.CancelOperationAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.executor.v1.CancelOperationAction + * @static + * @param {google.spanner.executor.v1.ICancelOperationAction} message CancelOperationAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CancelOperationAction message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.executor.v1.CancelOperationAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.executor.v1.CancelOperationAction} CancelOperationAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelOperationAction.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.CancelOperationAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.operation = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CancelOperationAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.executor.v1.CancelOperationAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.executor.v1.CancelOperationAction} CancelOperationAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelOperationAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CancelOperationAction message. + * @function verify + * @memberof google.spanner.executor.v1.CancelOperationAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CancelOperationAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.operation != null && message.hasOwnProperty("operation")) + if (!$util.isString(message.operation)) + return "operation: string expected"; + return null; + }; + + /** + * Creates a CancelOperationAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.executor.v1.CancelOperationAction + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.executor.v1.CancelOperationAction} CancelOperationAction + */ + CancelOperationAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.executor.v1.CancelOperationAction) + return object; + var message = new $root.google.spanner.executor.v1.CancelOperationAction(); + if (object.operation != null) + message.operation = String(object.operation); + return message; + }; + + /** + * Creates a plain object from a CancelOperationAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.executor.v1.CancelOperationAction + * @static + * @param {google.spanner.executor.v1.CancelOperationAction} message CancelOperationAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CancelOperationAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.operation = ""; + if (message.operation != null && message.hasOwnProperty("operation")) + object.operation = message.operation; + return object; + }; + + /** + * Converts this CancelOperationAction to JSON. + * @function toJSON + * @memberof google.spanner.executor.v1.CancelOperationAction + * @instance + * @returns {Object.} JSON object + */ + CancelOperationAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CancelOperationAction + * @function getTypeUrl + * @memberof google.spanner.executor.v1.CancelOperationAction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CancelOperationAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.executor.v1.CancelOperationAction"; + }; + + return CancelOperationAction; + })(); + + v1.StartBatchTransactionAction = (function() { + + /** + * Properties of a StartBatchTransactionAction. + * @memberof google.spanner.executor.v1 + * @interface IStartBatchTransactionAction + * @property {google.protobuf.ITimestamp|null} [batchTxnTime] StartBatchTransactionAction batchTxnTime + * @property {Uint8Array|null} [tid] StartBatchTransactionAction tid + * @property {string|null} [cloudDatabaseRole] StartBatchTransactionAction cloudDatabaseRole + */ + + /** + * Constructs a new StartBatchTransactionAction. + * @memberof google.spanner.executor.v1 + * @classdesc Represents a StartBatchTransactionAction. + * @implements IStartBatchTransactionAction + * @constructor + * @param {google.spanner.executor.v1.IStartBatchTransactionAction=} [properties] Properties to set + */ + function StartBatchTransactionAction(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StartBatchTransactionAction batchTxnTime. + * @member {google.protobuf.ITimestamp|null|undefined} batchTxnTime + * @memberof google.spanner.executor.v1.StartBatchTransactionAction + * @instance + */ + StartBatchTransactionAction.prototype.batchTxnTime = null; + + /** + * StartBatchTransactionAction tid. + * @member {Uint8Array|null|undefined} tid + * @memberof google.spanner.executor.v1.StartBatchTransactionAction + * @instance + */ + StartBatchTransactionAction.prototype.tid = null; + + /** + * StartBatchTransactionAction cloudDatabaseRole. + * @member {string} cloudDatabaseRole + * @memberof google.spanner.executor.v1.StartBatchTransactionAction + * @instance + */ + StartBatchTransactionAction.prototype.cloudDatabaseRole = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * StartBatchTransactionAction param. + * @member {"batchTxnTime"|"tid"|undefined} param + * @memberof google.spanner.executor.v1.StartBatchTransactionAction + * @instance + */ + Object.defineProperty(StartBatchTransactionAction.prototype, "param", { + get: $util.oneOfGetter($oneOfFields = ["batchTxnTime", "tid"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new StartBatchTransactionAction instance using the specified properties. + * @function create + * @memberof google.spanner.executor.v1.StartBatchTransactionAction + * @static + * @param {google.spanner.executor.v1.IStartBatchTransactionAction=} [properties] Properties to set + * @returns {google.spanner.executor.v1.StartBatchTransactionAction} StartBatchTransactionAction instance + */ + StartBatchTransactionAction.create = function create(properties) { + return new StartBatchTransactionAction(properties); + }; + + /** + * Encodes the specified StartBatchTransactionAction message. Does not implicitly {@link google.spanner.executor.v1.StartBatchTransactionAction.verify|verify} messages. + * @function encode + * @memberof google.spanner.executor.v1.StartBatchTransactionAction + * @static + * @param {google.spanner.executor.v1.IStartBatchTransactionAction} message StartBatchTransactionAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartBatchTransactionAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.batchTxnTime != null && Object.hasOwnProperty.call(message, "batchTxnTime")) + $root.google.protobuf.Timestamp.encode(message.batchTxnTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.tid != null && Object.hasOwnProperty.call(message, "tid")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.tid); + if (message.cloudDatabaseRole != null && Object.hasOwnProperty.call(message, "cloudDatabaseRole")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.cloudDatabaseRole); + return writer; + }; + + /** + * Encodes the specified StartBatchTransactionAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.StartBatchTransactionAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.executor.v1.StartBatchTransactionAction + * @static + * @param {google.spanner.executor.v1.IStartBatchTransactionAction} message StartBatchTransactionAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartBatchTransactionAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StartBatchTransactionAction message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.executor.v1.StartBatchTransactionAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.executor.v1.StartBatchTransactionAction} StartBatchTransactionAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartBatchTransactionAction.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.StartBatchTransactionAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.batchTxnTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.tid = reader.bytes(); + break; + } + case 3: { + message.cloudDatabaseRole = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StartBatchTransactionAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.executor.v1.StartBatchTransactionAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.executor.v1.StartBatchTransactionAction} StartBatchTransactionAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartBatchTransactionAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StartBatchTransactionAction message. + * @function verify + * @memberof google.spanner.executor.v1.StartBatchTransactionAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StartBatchTransactionAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.batchTxnTime != null && message.hasOwnProperty("batchTxnTime")) { + properties.param = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.batchTxnTime); + if (error) + return "batchTxnTime." + error; + } + } + if (message.tid != null && message.hasOwnProperty("tid")) { + if (properties.param === 1) + return "param: multiple values"; + properties.param = 1; + if (!(message.tid && typeof message.tid.length === "number" || $util.isString(message.tid))) + return "tid: buffer expected"; + } + if (message.cloudDatabaseRole != null && message.hasOwnProperty("cloudDatabaseRole")) + if (!$util.isString(message.cloudDatabaseRole)) + return "cloudDatabaseRole: string expected"; + return null; + }; + + /** + * Creates a StartBatchTransactionAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.executor.v1.StartBatchTransactionAction + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.executor.v1.StartBatchTransactionAction} StartBatchTransactionAction + */ + StartBatchTransactionAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.executor.v1.StartBatchTransactionAction) + return object; + var message = new $root.google.spanner.executor.v1.StartBatchTransactionAction(); + if (object.batchTxnTime != null) { + if (typeof object.batchTxnTime !== "object") + throw TypeError(".google.spanner.executor.v1.StartBatchTransactionAction.batchTxnTime: object expected"); + message.batchTxnTime = $root.google.protobuf.Timestamp.fromObject(object.batchTxnTime); + } + if (object.tid != null) + if (typeof object.tid === "string") + $util.base64.decode(object.tid, message.tid = $util.newBuffer($util.base64.length(object.tid)), 0); + else if (object.tid.length >= 0) + message.tid = object.tid; + if (object.cloudDatabaseRole != null) + message.cloudDatabaseRole = String(object.cloudDatabaseRole); + return message; + }; + + /** + * Creates a plain object from a StartBatchTransactionAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.executor.v1.StartBatchTransactionAction + * @static + * @param {google.spanner.executor.v1.StartBatchTransactionAction} message StartBatchTransactionAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StartBatchTransactionAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.cloudDatabaseRole = ""; + if (message.batchTxnTime != null && message.hasOwnProperty("batchTxnTime")) { + object.batchTxnTime = $root.google.protobuf.Timestamp.toObject(message.batchTxnTime, options); + if (options.oneofs) + object.param = "batchTxnTime"; + } + if (message.tid != null && message.hasOwnProperty("tid")) { + object.tid = options.bytes === String ? $util.base64.encode(message.tid, 0, message.tid.length) : options.bytes === Array ? Array.prototype.slice.call(message.tid) : message.tid; + if (options.oneofs) + object.param = "tid"; + } + if (message.cloudDatabaseRole != null && message.hasOwnProperty("cloudDatabaseRole")) + object.cloudDatabaseRole = message.cloudDatabaseRole; + return object; + }; + + /** + * Converts this StartBatchTransactionAction to JSON. + * @function toJSON + * @memberof google.spanner.executor.v1.StartBatchTransactionAction + * @instance + * @returns {Object.} JSON object + */ + StartBatchTransactionAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StartBatchTransactionAction + * @function getTypeUrl + * @memberof google.spanner.executor.v1.StartBatchTransactionAction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StartBatchTransactionAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.executor.v1.StartBatchTransactionAction"; + }; + + return StartBatchTransactionAction; + })(); + + v1.CloseBatchTransactionAction = (function() { + + /** + * Properties of a CloseBatchTransactionAction. + * @memberof google.spanner.executor.v1 + * @interface ICloseBatchTransactionAction + * @property {boolean|null} [cleanup] CloseBatchTransactionAction cleanup + */ + + /** + * Constructs a new CloseBatchTransactionAction. + * @memberof google.spanner.executor.v1 + * @classdesc Represents a CloseBatchTransactionAction. + * @implements ICloseBatchTransactionAction + * @constructor + * @param {google.spanner.executor.v1.ICloseBatchTransactionAction=} [properties] Properties to set + */ + function CloseBatchTransactionAction(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CloseBatchTransactionAction cleanup. + * @member {boolean} cleanup + * @memberof google.spanner.executor.v1.CloseBatchTransactionAction + * @instance + */ + CloseBatchTransactionAction.prototype.cleanup = false; + + /** + * Creates a new CloseBatchTransactionAction instance using the specified properties. + * @function create + * @memberof google.spanner.executor.v1.CloseBatchTransactionAction + * @static + * @param {google.spanner.executor.v1.ICloseBatchTransactionAction=} [properties] Properties to set + * @returns {google.spanner.executor.v1.CloseBatchTransactionAction} CloseBatchTransactionAction instance + */ + CloseBatchTransactionAction.create = function create(properties) { + return new CloseBatchTransactionAction(properties); + }; + + /** + * Encodes the specified CloseBatchTransactionAction message. Does not implicitly {@link google.spanner.executor.v1.CloseBatchTransactionAction.verify|verify} messages. + * @function encode + * @memberof google.spanner.executor.v1.CloseBatchTransactionAction + * @static + * @param {google.spanner.executor.v1.ICloseBatchTransactionAction} message CloseBatchTransactionAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloseBatchTransactionAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cleanup != null && Object.hasOwnProperty.call(message, "cleanup")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.cleanup); + return writer; + }; + + /** + * Encodes the specified CloseBatchTransactionAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.CloseBatchTransactionAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.executor.v1.CloseBatchTransactionAction + * @static + * @param {google.spanner.executor.v1.ICloseBatchTransactionAction} message CloseBatchTransactionAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloseBatchTransactionAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CloseBatchTransactionAction message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.executor.v1.CloseBatchTransactionAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.executor.v1.CloseBatchTransactionAction} CloseBatchTransactionAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloseBatchTransactionAction.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.CloseBatchTransactionAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.cleanup = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CloseBatchTransactionAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.executor.v1.CloseBatchTransactionAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.executor.v1.CloseBatchTransactionAction} CloseBatchTransactionAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloseBatchTransactionAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CloseBatchTransactionAction message. + * @function verify + * @memberof google.spanner.executor.v1.CloseBatchTransactionAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CloseBatchTransactionAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cleanup != null && message.hasOwnProperty("cleanup")) + if (typeof message.cleanup !== "boolean") + return "cleanup: boolean expected"; + return null; + }; + + /** + * Creates a CloseBatchTransactionAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.executor.v1.CloseBatchTransactionAction + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.executor.v1.CloseBatchTransactionAction} CloseBatchTransactionAction + */ + CloseBatchTransactionAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.executor.v1.CloseBatchTransactionAction) + return object; + var message = new $root.google.spanner.executor.v1.CloseBatchTransactionAction(); + if (object.cleanup != null) + message.cleanup = Boolean(object.cleanup); + return message; + }; + + /** + * Creates a plain object from a CloseBatchTransactionAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.executor.v1.CloseBatchTransactionAction + * @static + * @param {google.spanner.executor.v1.CloseBatchTransactionAction} message CloseBatchTransactionAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CloseBatchTransactionAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.cleanup = false; + if (message.cleanup != null && message.hasOwnProperty("cleanup")) + object.cleanup = message.cleanup; + return object; + }; + + /** + * Converts this CloseBatchTransactionAction to JSON. + * @function toJSON + * @memberof google.spanner.executor.v1.CloseBatchTransactionAction + * @instance + * @returns {Object.} JSON object + */ + CloseBatchTransactionAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CloseBatchTransactionAction + * @function getTypeUrl + * @memberof google.spanner.executor.v1.CloseBatchTransactionAction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CloseBatchTransactionAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.executor.v1.CloseBatchTransactionAction"; + }; + + return CloseBatchTransactionAction; + })(); + + v1.GenerateDbPartitionsForReadAction = (function() { + + /** + * Properties of a GenerateDbPartitionsForReadAction. + * @memberof google.spanner.executor.v1 + * @interface IGenerateDbPartitionsForReadAction + * @property {google.spanner.executor.v1.IReadAction|null} [read] GenerateDbPartitionsForReadAction read + * @property {Array.|null} [table] GenerateDbPartitionsForReadAction table + * @property {number|Long|null} [desiredBytesPerPartition] GenerateDbPartitionsForReadAction desiredBytesPerPartition + * @property {number|Long|null} [maxPartitionCount] GenerateDbPartitionsForReadAction maxPartitionCount + */ + + /** + * Constructs a new GenerateDbPartitionsForReadAction. + * @memberof google.spanner.executor.v1 + * @classdesc Represents a GenerateDbPartitionsForReadAction. + * @implements IGenerateDbPartitionsForReadAction + * @constructor + * @param {google.spanner.executor.v1.IGenerateDbPartitionsForReadAction=} [properties] Properties to set + */ + function GenerateDbPartitionsForReadAction(properties) { + this.table = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GenerateDbPartitionsForReadAction read. + * @member {google.spanner.executor.v1.IReadAction|null|undefined} read + * @memberof google.spanner.executor.v1.GenerateDbPartitionsForReadAction + * @instance + */ + GenerateDbPartitionsForReadAction.prototype.read = null; + + /** + * GenerateDbPartitionsForReadAction table. + * @member {Array.} table + * @memberof google.spanner.executor.v1.GenerateDbPartitionsForReadAction + * @instance + */ + GenerateDbPartitionsForReadAction.prototype.table = $util.emptyArray; + + /** + * GenerateDbPartitionsForReadAction desiredBytesPerPartition. + * @member {number|Long|null|undefined} desiredBytesPerPartition + * @memberof google.spanner.executor.v1.GenerateDbPartitionsForReadAction + * @instance + */ + GenerateDbPartitionsForReadAction.prototype.desiredBytesPerPartition = null; + + /** + * GenerateDbPartitionsForReadAction maxPartitionCount. + * @member {number|Long|null|undefined} maxPartitionCount + * @memberof google.spanner.executor.v1.GenerateDbPartitionsForReadAction + * @instance + */ + GenerateDbPartitionsForReadAction.prototype.maxPartitionCount = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(GenerateDbPartitionsForReadAction.prototype, "_desiredBytesPerPartition", { + get: $util.oneOfGetter($oneOfFields = ["desiredBytesPerPartition"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(GenerateDbPartitionsForReadAction.prototype, "_maxPartitionCount", { + get: $util.oneOfGetter($oneOfFields = ["maxPartitionCount"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GenerateDbPartitionsForReadAction instance using the specified properties. + * @function create + * @memberof google.spanner.executor.v1.GenerateDbPartitionsForReadAction + * @static + * @param {google.spanner.executor.v1.IGenerateDbPartitionsForReadAction=} [properties] Properties to set + * @returns {google.spanner.executor.v1.GenerateDbPartitionsForReadAction} GenerateDbPartitionsForReadAction instance + */ + GenerateDbPartitionsForReadAction.create = function create(properties) { + return new GenerateDbPartitionsForReadAction(properties); + }; + + /** + * Encodes the specified GenerateDbPartitionsForReadAction message. Does not implicitly {@link google.spanner.executor.v1.GenerateDbPartitionsForReadAction.verify|verify} messages. + * @function encode + * @memberof google.spanner.executor.v1.GenerateDbPartitionsForReadAction + * @static + * @param {google.spanner.executor.v1.IGenerateDbPartitionsForReadAction} message GenerateDbPartitionsForReadAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateDbPartitionsForReadAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.read != null && Object.hasOwnProperty.call(message, "read")) + $root.google.spanner.executor.v1.ReadAction.encode(message.read, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.table != null && message.table.length) + for (var i = 0; i < message.table.length; ++i) + $root.google.spanner.executor.v1.TableMetadata.encode(message.table[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.desiredBytesPerPartition != null && Object.hasOwnProperty.call(message, "desiredBytesPerPartition")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.desiredBytesPerPartition); + if (message.maxPartitionCount != null && Object.hasOwnProperty.call(message, "maxPartitionCount")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.maxPartitionCount); + return writer; + }; + + /** + * Encodes the specified GenerateDbPartitionsForReadAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.GenerateDbPartitionsForReadAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.executor.v1.GenerateDbPartitionsForReadAction + * @static + * @param {google.spanner.executor.v1.IGenerateDbPartitionsForReadAction} message GenerateDbPartitionsForReadAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateDbPartitionsForReadAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GenerateDbPartitionsForReadAction message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.executor.v1.GenerateDbPartitionsForReadAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.executor.v1.GenerateDbPartitionsForReadAction} GenerateDbPartitionsForReadAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateDbPartitionsForReadAction.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.GenerateDbPartitionsForReadAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.read = $root.google.spanner.executor.v1.ReadAction.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.table && message.table.length)) + message.table = []; + message.table.push($root.google.spanner.executor.v1.TableMetadata.decode(reader, reader.uint32())); + break; + } + case 3: { + message.desiredBytesPerPartition = reader.int64(); + break; + } + case 4: { + message.maxPartitionCount = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GenerateDbPartitionsForReadAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.executor.v1.GenerateDbPartitionsForReadAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.executor.v1.GenerateDbPartitionsForReadAction} GenerateDbPartitionsForReadAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateDbPartitionsForReadAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenerateDbPartitionsForReadAction message. + * @function verify + * @memberof google.spanner.executor.v1.GenerateDbPartitionsForReadAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenerateDbPartitionsForReadAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.read != null && message.hasOwnProperty("read")) { + var error = $root.google.spanner.executor.v1.ReadAction.verify(message.read); + if (error) + return "read." + error; + } + if (message.table != null && message.hasOwnProperty("table")) { + if (!Array.isArray(message.table)) + return "table: array expected"; + for (var i = 0; i < message.table.length; ++i) { + var error = $root.google.spanner.executor.v1.TableMetadata.verify(message.table[i]); + if (error) + return "table." + error; + } + } + if (message.desiredBytesPerPartition != null && message.hasOwnProperty("desiredBytesPerPartition")) { + properties._desiredBytesPerPartition = 1; + if (!$util.isInteger(message.desiredBytesPerPartition) && !(message.desiredBytesPerPartition && $util.isInteger(message.desiredBytesPerPartition.low) && $util.isInteger(message.desiredBytesPerPartition.high))) + return "desiredBytesPerPartition: integer|Long expected"; + } + if (message.maxPartitionCount != null && message.hasOwnProperty("maxPartitionCount")) { + properties._maxPartitionCount = 1; + if (!$util.isInteger(message.maxPartitionCount) && !(message.maxPartitionCount && $util.isInteger(message.maxPartitionCount.low) && $util.isInteger(message.maxPartitionCount.high))) + return "maxPartitionCount: integer|Long expected"; + } + return null; + }; + + /** + * Creates a GenerateDbPartitionsForReadAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.executor.v1.GenerateDbPartitionsForReadAction + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.executor.v1.GenerateDbPartitionsForReadAction} GenerateDbPartitionsForReadAction + */ + GenerateDbPartitionsForReadAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.executor.v1.GenerateDbPartitionsForReadAction) + return object; + var message = new $root.google.spanner.executor.v1.GenerateDbPartitionsForReadAction(); + if (object.read != null) { + if (typeof object.read !== "object") + throw TypeError(".google.spanner.executor.v1.GenerateDbPartitionsForReadAction.read: object expected"); + message.read = $root.google.spanner.executor.v1.ReadAction.fromObject(object.read); + } + if (object.table) { + if (!Array.isArray(object.table)) + throw TypeError(".google.spanner.executor.v1.GenerateDbPartitionsForReadAction.table: array expected"); + message.table = []; + for (var i = 0; i < object.table.length; ++i) { + if (typeof object.table[i] !== "object") + throw TypeError(".google.spanner.executor.v1.GenerateDbPartitionsForReadAction.table: object expected"); + message.table[i] = $root.google.spanner.executor.v1.TableMetadata.fromObject(object.table[i]); + } + } + if (object.desiredBytesPerPartition != null) + if ($util.Long) + (message.desiredBytesPerPartition = $util.Long.fromValue(object.desiredBytesPerPartition)).unsigned = false; + else if (typeof object.desiredBytesPerPartition === "string") + message.desiredBytesPerPartition = parseInt(object.desiredBytesPerPartition, 10); + else if (typeof object.desiredBytesPerPartition === "number") + message.desiredBytesPerPartition = object.desiredBytesPerPartition; + else if (typeof object.desiredBytesPerPartition === "object") + message.desiredBytesPerPartition = new $util.LongBits(object.desiredBytesPerPartition.low >>> 0, object.desiredBytesPerPartition.high >>> 0).toNumber(); + if (object.maxPartitionCount != null) + if ($util.Long) + (message.maxPartitionCount = $util.Long.fromValue(object.maxPartitionCount)).unsigned = false; + else if (typeof object.maxPartitionCount === "string") + message.maxPartitionCount = parseInt(object.maxPartitionCount, 10); + else if (typeof object.maxPartitionCount === "number") + message.maxPartitionCount = object.maxPartitionCount; + else if (typeof object.maxPartitionCount === "object") + message.maxPartitionCount = new $util.LongBits(object.maxPartitionCount.low >>> 0, object.maxPartitionCount.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a GenerateDbPartitionsForReadAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.executor.v1.GenerateDbPartitionsForReadAction + * @static + * @param {google.spanner.executor.v1.GenerateDbPartitionsForReadAction} message GenerateDbPartitionsForReadAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenerateDbPartitionsForReadAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.table = []; + if (options.defaults) + object.read = null; + if (message.read != null && message.hasOwnProperty("read")) + object.read = $root.google.spanner.executor.v1.ReadAction.toObject(message.read, options); + if (message.table && message.table.length) { + object.table = []; + for (var j = 0; j < message.table.length; ++j) + object.table[j] = $root.google.spanner.executor.v1.TableMetadata.toObject(message.table[j], options); + } + if (message.desiredBytesPerPartition != null && message.hasOwnProperty("desiredBytesPerPartition")) { + if (typeof message.desiredBytesPerPartition === "number") + object.desiredBytesPerPartition = options.longs === String ? String(message.desiredBytesPerPartition) : message.desiredBytesPerPartition; + else + object.desiredBytesPerPartition = options.longs === String ? $util.Long.prototype.toString.call(message.desiredBytesPerPartition) : options.longs === Number ? new $util.LongBits(message.desiredBytesPerPartition.low >>> 0, message.desiredBytesPerPartition.high >>> 0).toNumber() : message.desiredBytesPerPartition; + if (options.oneofs) + object._desiredBytesPerPartition = "desiredBytesPerPartition"; + } + if (message.maxPartitionCount != null && message.hasOwnProperty("maxPartitionCount")) { + if (typeof message.maxPartitionCount === "number") + object.maxPartitionCount = options.longs === String ? String(message.maxPartitionCount) : message.maxPartitionCount; + else + object.maxPartitionCount = options.longs === String ? $util.Long.prototype.toString.call(message.maxPartitionCount) : options.longs === Number ? new $util.LongBits(message.maxPartitionCount.low >>> 0, message.maxPartitionCount.high >>> 0).toNumber() : message.maxPartitionCount; + if (options.oneofs) + object._maxPartitionCount = "maxPartitionCount"; + } + return object; + }; + + /** + * Converts this GenerateDbPartitionsForReadAction to JSON. + * @function toJSON + * @memberof google.spanner.executor.v1.GenerateDbPartitionsForReadAction + * @instance + * @returns {Object.} JSON object + */ + GenerateDbPartitionsForReadAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GenerateDbPartitionsForReadAction + * @function getTypeUrl + * @memberof google.spanner.executor.v1.GenerateDbPartitionsForReadAction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GenerateDbPartitionsForReadAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.executor.v1.GenerateDbPartitionsForReadAction"; + }; + + return GenerateDbPartitionsForReadAction; + })(); + + v1.GenerateDbPartitionsForQueryAction = (function() { + + /** + * Properties of a GenerateDbPartitionsForQueryAction. + * @memberof google.spanner.executor.v1 + * @interface IGenerateDbPartitionsForQueryAction + * @property {google.spanner.executor.v1.IQueryAction|null} [query] GenerateDbPartitionsForQueryAction query + * @property {number|Long|null} [desiredBytesPerPartition] GenerateDbPartitionsForQueryAction desiredBytesPerPartition + */ + + /** + * Constructs a new GenerateDbPartitionsForQueryAction. + * @memberof google.spanner.executor.v1 + * @classdesc Represents a GenerateDbPartitionsForQueryAction. + * @implements IGenerateDbPartitionsForQueryAction + * @constructor + * @param {google.spanner.executor.v1.IGenerateDbPartitionsForQueryAction=} [properties] Properties to set + */ + function GenerateDbPartitionsForQueryAction(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GenerateDbPartitionsForQueryAction query. + * @member {google.spanner.executor.v1.IQueryAction|null|undefined} query + * @memberof google.spanner.executor.v1.GenerateDbPartitionsForQueryAction + * @instance + */ + GenerateDbPartitionsForQueryAction.prototype.query = null; + + /** + * GenerateDbPartitionsForQueryAction desiredBytesPerPartition. + * @member {number|Long|null|undefined} desiredBytesPerPartition + * @memberof google.spanner.executor.v1.GenerateDbPartitionsForQueryAction + * @instance + */ + GenerateDbPartitionsForQueryAction.prototype.desiredBytesPerPartition = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(GenerateDbPartitionsForQueryAction.prototype, "_desiredBytesPerPartition", { + get: $util.oneOfGetter($oneOfFields = ["desiredBytesPerPartition"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GenerateDbPartitionsForQueryAction instance using the specified properties. + * @function create + * @memberof google.spanner.executor.v1.GenerateDbPartitionsForQueryAction + * @static + * @param {google.spanner.executor.v1.IGenerateDbPartitionsForQueryAction=} [properties] Properties to set + * @returns {google.spanner.executor.v1.GenerateDbPartitionsForQueryAction} GenerateDbPartitionsForQueryAction instance + */ + GenerateDbPartitionsForQueryAction.create = function create(properties) { + return new GenerateDbPartitionsForQueryAction(properties); + }; + + /** + * Encodes the specified GenerateDbPartitionsForQueryAction message. Does not implicitly {@link google.spanner.executor.v1.GenerateDbPartitionsForQueryAction.verify|verify} messages. + * @function encode + * @memberof google.spanner.executor.v1.GenerateDbPartitionsForQueryAction + * @static + * @param {google.spanner.executor.v1.IGenerateDbPartitionsForQueryAction} message GenerateDbPartitionsForQueryAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateDbPartitionsForQueryAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + $root.google.spanner.executor.v1.QueryAction.encode(message.query, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.desiredBytesPerPartition != null && Object.hasOwnProperty.call(message, "desiredBytesPerPartition")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.desiredBytesPerPartition); + return writer; + }; + + /** + * Encodes the specified GenerateDbPartitionsForQueryAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.GenerateDbPartitionsForQueryAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.executor.v1.GenerateDbPartitionsForQueryAction + * @static + * @param {google.spanner.executor.v1.IGenerateDbPartitionsForQueryAction} message GenerateDbPartitionsForQueryAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateDbPartitionsForQueryAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GenerateDbPartitionsForQueryAction message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.executor.v1.GenerateDbPartitionsForQueryAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.executor.v1.GenerateDbPartitionsForQueryAction} GenerateDbPartitionsForQueryAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateDbPartitionsForQueryAction.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.GenerateDbPartitionsForQueryAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.query = $root.google.spanner.executor.v1.QueryAction.decode(reader, reader.uint32()); + break; + } + case 2: { + message.desiredBytesPerPartition = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GenerateDbPartitionsForQueryAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.executor.v1.GenerateDbPartitionsForQueryAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.executor.v1.GenerateDbPartitionsForQueryAction} GenerateDbPartitionsForQueryAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateDbPartitionsForQueryAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenerateDbPartitionsForQueryAction message. + * @function verify + * @memberof google.spanner.executor.v1.GenerateDbPartitionsForQueryAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenerateDbPartitionsForQueryAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.query != null && message.hasOwnProperty("query")) { + var error = $root.google.spanner.executor.v1.QueryAction.verify(message.query); + if (error) + return "query." + error; + } + if (message.desiredBytesPerPartition != null && message.hasOwnProperty("desiredBytesPerPartition")) { + properties._desiredBytesPerPartition = 1; + if (!$util.isInteger(message.desiredBytesPerPartition) && !(message.desiredBytesPerPartition && $util.isInteger(message.desiredBytesPerPartition.low) && $util.isInteger(message.desiredBytesPerPartition.high))) + return "desiredBytesPerPartition: integer|Long expected"; + } + return null; + }; + + /** + * Creates a GenerateDbPartitionsForQueryAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.executor.v1.GenerateDbPartitionsForQueryAction + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.executor.v1.GenerateDbPartitionsForQueryAction} GenerateDbPartitionsForQueryAction + */ + GenerateDbPartitionsForQueryAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.executor.v1.GenerateDbPartitionsForQueryAction) + return object; + var message = new $root.google.spanner.executor.v1.GenerateDbPartitionsForQueryAction(); + if (object.query != null) { + if (typeof object.query !== "object") + throw TypeError(".google.spanner.executor.v1.GenerateDbPartitionsForQueryAction.query: object expected"); + message.query = $root.google.spanner.executor.v1.QueryAction.fromObject(object.query); + } + if (object.desiredBytesPerPartition != null) + if ($util.Long) + (message.desiredBytesPerPartition = $util.Long.fromValue(object.desiredBytesPerPartition)).unsigned = false; + else if (typeof object.desiredBytesPerPartition === "string") + message.desiredBytesPerPartition = parseInt(object.desiredBytesPerPartition, 10); + else if (typeof object.desiredBytesPerPartition === "number") + message.desiredBytesPerPartition = object.desiredBytesPerPartition; + else if (typeof object.desiredBytesPerPartition === "object") + message.desiredBytesPerPartition = new $util.LongBits(object.desiredBytesPerPartition.low >>> 0, object.desiredBytesPerPartition.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a GenerateDbPartitionsForQueryAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.executor.v1.GenerateDbPartitionsForQueryAction + * @static + * @param {google.spanner.executor.v1.GenerateDbPartitionsForQueryAction} message GenerateDbPartitionsForQueryAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenerateDbPartitionsForQueryAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.query = null; + if (message.query != null && message.hasOwnProperty("query")) + object.query = $root.google.spanner.executor.v1.QueryAction.toObject(message.query, options); + if (message.desiredBytesPerPartition != null && message.hasOwnProperty("desiredBytesPerPartition")) { + if (typeof message.desiredBytesPerPartition === "number") + object.desiredBytesPerPartition = options.longs === String ? String(message.desiredBytesPerPartition) : message.desiredBytesPerPartition; + else + object.desiredBytesPerPartition = options.longs === String ? $util.Long.prototype.toString.call(message.desiredBytesPerPartition) : options.longs === Number ? new $util.LongBits(message.desiredBytesPerPartition.low >>> 0, message.desiredBytesPerPartition.high >>> 0).toNumber() : message.desiredBytesPerPartition; + if (options.oneofs) + object._desiredBytesPerPartition = "desiredBytesPerPartition"; + } + return object; + }; + + /** + * Converts this GenerateDbPartitionsForQueryAction to JSON. + * @function toJSON + * @memberof google.spanner.executor.v1.GenerateDbPartitionsForQueryAction + * @instance + * @returns {Object.} JSON object + */ + GenerateDbPartitionsForQueryAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GenerateDbPartitionsForQueryAction + * @function getTypeUrl + * @memberof google.spanner.executor.v1.GenerateDbPartitionsForQueryAction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GenerateDbPartitionsForQueryAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.executor.v1.GenerateDbPartitionsForQueryAction"; + }; + + return GenerateDbPartitionsForQueryAction; + })(); + + v1.BatchPartition = (function() { + + /** + * Properties of a BatchPartition. + * @memberof google.spanner.executor.v1 + * @interface IBatchPartition + * @property {Uint8Array|null} [partition] BatchPartition partition + * @property {Uint8Array|null} [partitionToken] BatchPartition partitionToken + * @property {string|null} [table] BatchPartition table + * @property {string|null} [index] BatchPartition index + */ + + /** + * Constructs a new BatchPartition. + * @memberof google.spanner.executor.v1 + * @classdesc Represents a BatchPartition. + * @implements IBatchPartition + * @constructor + * @param {google.spanner.executor.v1.IBatchPartition=} [properties] Properties to set + */ + function BatchPartition(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchPartition partition. + * @member {Uint8Array} partition + * @memberof google.spanner.executor.v1.BatchPartition + * @instance + */ + BatchPartition.prototype.partition = $util.newBuffer([]); + + /** + * BatchPartition partitionToken. + * @member {Uint8Array} partitionToken + * @memberof google.spanner.executor.v1.BatchPartition + * @instance + */ + BatchPartition.prototype.partitionToken = $util.newBuffer([]); + + /** + * BatchPartition table. + * @member {string|null|undefined} table + * @memberof google.spanner.executor.v1.BatchPartition + * @instance + */ + BatchPartition.prototype.table = null; + + /** + * BatchPartition index. + * @member {string|null|undefined} index + * @memberof google.spanner.executor.v1.BatchPartition + * @instance + */ + BatchPartition.prototype.index = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BatchPartition.prototype, "_table", { + get: $util.oneOfGetter($oneOfFields = ["table"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BatchPartition.prototype, "_index", { + get: $util.oneOfGetter($oneOfFields = ["index"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BatchPartition instance using the specified properties. + * @function create + * @memberof google.spanner.executor.v1.BatchPartition + * @static + * @param {google.spanner.executor.v1.IBatchPartition=} [properties] Properties to set + * @returns {google.spanner.executor.v1.BatchPartition} BatchPartition instance + */ + BatchPartition.create = function create(properties) { + return new BatchPartition(properties); + }; + + /** + * Encodes the specified BatchPartition message. Does not implicitly {@link google.spanner.executor.v1.BatchPartition.verify|verify} messages. + * @function encode + * @memberof google.spanner.executor.v1.BatchPartition + * @static + * @param {google.spanner.executor.v1.IBatchPartition} message BatchPartition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchPartition.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.partition != null && Object.hasOwnProperty.call(message, "partition")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.partition); + if (message.partitionToken != null && Object.hasOwnProperty.call(message, "partitionToken")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.partitionToken); + if (message.table != null && Object.hasOwnProperty.call(message, "table")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.table); + if (message.index != null && Object.hasOwnProperty.call(message, "index")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.index); + return writer; + }; + + /** + * Encodes the specified BatchPartition message, length delimited. Does not implicitly {@link google.spanner.executor.v1.BatchPartition.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.executor.v1.BatchPartition + * @static + * @param {google.spanner.executor.v1.IBatchPartition} message BatchPartition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchPartition.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchPartition message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.executor.v1.BatchPartition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.executor.v1.BatchPartition} BatchPartition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchPartition.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.BatchPartition(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.partition = reader.bytes(); + break; + } + case 2: { + message.partitionToken = reader.bytes(); + break; + } + case 3: { + message.table = reader.string(); + break; + } + case 4: { + message.index = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchPartition message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.executor.v1.BatchPartition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.executor.v1.BatchPartition} BatchPartition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchPartition.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchPartition message. + * @function verify + * @memberof google.spanner.executor.v1.BatchPartition + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchPartition.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.partition != null && message.hasOwnProperty("partition")) + if (!(message.partition && typeof message.partition.length === "number" || $util.isString(message.partition))) + return "partition: buffer expected"; + if (message.partitionToken != null && message.hasOwnProperty("partitionToken")) + if (!(message.partitionToken && typeof message.partitionToken.length === "number" || $util.isString(message.partitionToken))) + return "partitionToken: buffer expected"; + if (message.table != null && message.hasOwnProperty("table")) { + properties._table = 1; + if (!$util.isString(message.table)) + return "table: string expected"; + } + if (message.index != null && message.hasOwnProperty("index")) { + properties._index = 1; + if (!$util.isString(message.index)) + return "index: string expected"; + } + return null; + }; + + /** + * Creates a BatchPartition message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.executor.v1.BatchPartition + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.executor.v1.BatchPartition} BatchPartition + */ + BatchPartition.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.executor.v1.BatchPartition) + return object; + var message = new $root.google.spanner.executor.v1.BatchPartition(); + if (object.partition != null) + if (typeof object.partition === "string") + $util.base64.decode(object.partition, message.partition = $util.newBuffer($util.base64.length(object.partition)), 0); + else if (object.partition.length >= 0) + message.partition = object.partition; + if (object.partitionToken != null) + if (typeof object.partitionToken === "string") + $util.base64.decode(object.partitionToken, message.partitionToken = $util.newBuffer($util.base64.length(object.partitionToken)), 0); + else if (object.partitionToken.length >= 0) + message.partitionToken = object.partitionToken; + if (object.table != null) + message.table = String(object.table); + if (object.index != null) + message.index = String(object.index); + return message; + }; + + /** + * Creates a plain object from a BatchPartition message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.executor.v1.BatchPartition + * @static + * @param {google.spanner.executor.v1.BatchPartition} message BatchPartition + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchPartition.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.partition = ""; + else { + object.partition = []; + if (options.bytes !== Array) + object.partition = $util.newBuffer(object.partition); + } + if (options.bytes === String) + object.partitionToken = ""; + else { + object.partitionToken = []; + if (options.bytes !== Array) + object.partitionToken = $util.newBuffer(object.partitionToken); + } + } + if (message.partition != null && message.hasOwnProperty("partition")) + object.partition = options.bytes === String ? $util.base64.encode(message.partition, 0, message.partition.length) : options.bytes === Array ? Array.prototype.slice.call(message.partition) : message.partition; + if (message.partitionToken != null && message.hasOwnProperty("partitionToken")) + object.partitionToken = options.bytes === String ? $util.base64.encode(message.partitionToken, 0, message.partitionToken.length) : options.bytes === Array ? Array.prototype.slice.call(message.partitionToken) : message.partitionToken; + if (message.table != null && message.hasOwnProperty("table")) { + object.table = message.table; + if (options.oneofs) + object._table = "table"; + } + if (message.index != null && message.hasOwnProperty("index")) { + object.index = message.index; + if (options.oneofs) + object._index = "index"; + } + return object; + }; + + /** + * Converts this BatchPartition to JSON. + * @function toJSON + * @memberof google.spanner.executor.v1.BatchPartition + * @instance + * @returns {Object.} JSON object + */ + BatchPartition.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchPartition + * @function getTypeUrl + * @memberof google.spanner.executor.v1.BatchPartition + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchPartition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.executor.v1.BatchPartition"; + }; + + return BatchPartition; + })(); + + v1.ExecutePartitionAction = (function() { + + /** + * Properties of an ExecutePartitionAction. + * @memberof google.spanner.executor.v1 + * @interface IExecutePartitionAction + * @property {google.spanner.executor.v1.IBatchPartition|null} [partition] ExecutePartitionAction partition + */ + + /** + * Constructs a new ExecutePartitionAction. + * @memberof google.spanner.executor.v1 + * @classdesc Represents an ExecutePartitionAction. + * @implements IExecutePartitionAction + * @constructor + * @param {google.spanner.executor.v1.IExecutePartitionAction=} [properties] Properties to set + */ + function ExecutePartitionAction(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExecutePartitionAction partition. + * @member {google.spanner.executor.v1.IBatchPartition|null|undefined} partition + * @memberof google.spanner.executor.v1.ExecutePartitionAction + * @instance + */ + ExecutePartitionAction.prototype.partition = null; + + /** + * Creates a new ExecutePartitionAction instance using the specified properties. + * @function create + * @memberof google.spanner.executor.v1.ExecutePartitionAction + * @static + * @param {google.spanner.executor.v1.IExecutePartitionAction=} [properties] Properties to set + * @returns {google.spanner.executor.v1.ExecutePartitionAction} ExecutePartitionAction instance + */ + ExecutePartitionAction.create = function create(properties) { + return new ExecutePartitionAction(properties); + }; + + /** + * Encodes the specified ExecutePartitionAction message. Does not implicitly {@link google.spanner.executor.v1.ExecutePartitionAction.verify|verify} messages. + * @function encode + * @memberof google.spanner.executor.v1.ExecutePartitionAction + * @static + * @param {google.spanner.executor.v1.IExecutePartitionAction} message ExecutePartitionAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecutePartitionAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.partition != null && Object.hasOwnProperty.call(message, "partition")) + $root.google.spanner.executor.v1.BatchPartition.encode(message.partition, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExecutePartitionAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.ExecutePartitionAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.executor.v1.ExecutePartitionAction + * @static + * @param {google.spanner.executor.v1.IExecutePartitionAction} message ExecutePartitionAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecutePartitionAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExecutePartitionAction message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.executor.v1.ExecutePartitionAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.executor.v1.ExecutePartitionAction} ExecutePartitionAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecutePartitionAction.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.ExecutePartitionAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.partition = $root.google.spanner.executor.v1.BatchPartition.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExecutePartitionAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.executor.v1.ExecutePartitionAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.executor.v1.ExecutePartitionAction} ExecutePartitionAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecutePartitionAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExecutePartitionAction message. + * @function verify + * @memberof google.spanner.executor.v1.ExecutePartitionAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExecutePartitionAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.partition != null && message.hasOwnProperty("partition")) { + var error = $root.google.spanner.executor.v1.BatchPartition.verify(message.partition); + if (error) + return "partition." + error; + } + return null; + }; + + /** + * Creates an ExecutePartitionAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.executor.v1.ExecutePartitionAction + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.executor.v1.ExecutePartitionAction} ExecutePartitionAction + */ + ExecutePartitionAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.executor.v1.ExecutePartitionAction) + return object; + var message = new $root.google.spanner.executor.v1.ExecutePartitionAction(); + if (object.partition != null) { + if (typeof object.partition !== "object") + throw TypeError(".google.spanner.executor.v1.ExecutePartitionAction.partition: object expected"); + message.partition = $root.google.spanner.executor.v1.BatchPartition.fromObject(object.partition); + } + return message; + }; + + /** + * Creates a plain object from an ExecutePartitionAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.executor.v1.ExecutePartitionAction + * @static + * @param {google.spanner.executor.v1.ExecutePartitionAction} message ExecutePartitionAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExecutePartitionAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.partition = null; + if (message.partition != null && message.hasOwnProperty("partition")) + object.partition = $root.google.spanner.executor.v1.BatchPartition.toObject(message.partition, options); + return object; + }; + + /** + * Converts this ExecutePartitionAction to JSON. + * @function toJSON + * @memberof google.spanner.executor.v1.ExecutePartitionAction + * @instance + * @returns {Object.} JSON object + */ + ExecutePartitionAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExecutePartitionAction + * @function getTypeUrl + * @memberof google.spanner.executor.v1.ExecutePartitionAction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExecutePartitionAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.executor.v1.ExecutePartitionAction"; + }; + + return ExecutePartitionAction; + })(); + + v1.ExecuteChangeStreamQuery = (function() { + + /** + * Properties of an ExecuteChangeStreamQuery. + * @memberof google.spanner.executor.v1 + * @interface IExecuteChangeStreamQuery + * @property {string|null} [name] ExecuteChangeStreamQuery name + * @property {google.protobuf.ITimestamp|null} [startTime] ExecuteChangeStreamQuery startTime + * @property {google.protobuf.ITimestamp|null} [endTime] ExecuteChangeStreamQuery endTime + * @property {string|null} [partitionToken] ExecuteChangeStreamQuery partitionToken + * @property {Array.|null} [readOptions] ExecuteChangeStreamQuery readOptions + * @property {number|null} [heartbeatMilliseconds] ExecuteChangeStreamQuery heartbeatMilliseconds + * @property {number|Long|null} [deadlineSeconds] ExecuteChangeStreamQuery deadlineSeconds + * @property {string|null} [cloudDatabaseRole] ExecuteChangeStreamQuery cloudDatabaseRole + */ + + /** + * Constructs a new ExecuteChangeStreamQuery. + * @memberof google.spanner.executor.v1 + * @classdesc Represents an ExecuteChangeStreamQuery. + * @implements IExecuteChangeStreamQuery + * @constructor + * @param {google.spanner.executor.v1.IExecuteChangeStreamQuery=} [properties] Properties to set + */ + function ExecuteChangeStreamQuery(properties) { + this.readOptions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExecuteChangeStreamQuery name. + * @member {string} name + * @memberof google.spanner.executor.v1.ExecuteChangeStreamQuery + * @instance + */ + ExecuteChangeStreamQuery.prototype.name = ""; + + /** + * ExecuteChangeStreamQuery startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.spanner.executor.v1.ExecuteChangeStreamQuery + * @instance + */ + ExecuteChangeStreamQuery.prototype.startTime = null; + + /** + * ExecuteChangeStreamQuery endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.spanner.executor.v1.ExecuteChangeStreamQuery + * @instance + */ + ExecuteChangeStreamQuery.prototype.endTime = null; + + /** + * ExecuteChangeStreamQuery partitionToken. + * @member {string|null|undefined} partitionToken + * @memberof google.spanner.executor.v1.ExecuteChangeStreamQuery + * @instance + */ + ExecuteChangeStreamQuery.prototype.partitionToken = null; + + /** + * ExecuteChangeStreamQuery readOptions. + * @member {Array.} readOptions + * @memberof google.spanner.executor.v1.ExecuteChangeStreamQuery + * @instance + */ + ExecuteChangeStreamQuery.prototype.readOptions = $util.emptyArray; + + /** + * ExecuteChangeStreamQuery heartbeatMilliseconds. + * @member {number|null|undefined} heartbeatMilliseconds + * @memberof google.spanner.executor.v1.ExecuteChangeStreamQuery + * @instance + */ + ExecuteChangeStreamQuery.prototype.heartbeatMilliseconds = null; + + /** + * ExecuteChangeStreamQuery deadlineSeconds. + * @member {number|Long|null|undefined} deadlineSeconds + * @memberof google.spanner.executor.v1.ExecuteChangeStreamQuery + * @instance + */ + ExecuteChangeStreamQuery.prototype.deadlineSeconds = null; + + /** + * ExecuteChangeStreamQuery cloudDatabaseRole. + * @member {string|null|undefined} cloudDatabaseRole + * @memberof google.spanner.executor.v1.ExecuteChangeStreamQuery + * @instance + */ + ExecuteChangeStreamQuery.prototype.cloudDatabaseRole = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ExecuteChangeStreamQuery.prototype, "_endTime", { + get: $util.oneOfGetter($oneOfFields = ["endTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ExecuteChangeStreamQuery.prototype, "_partitionToken", { + get: $util.oneOfGetter($oneOfFields = ["partitionToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ExecuteChangeStreamQuery.prototype, "_heartbeatMilliseconds", { + get: $util.oneOfGetter($oneOfFields = ["heartbeatMilliseconds"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ExecuteChangeStreamQuery.prototype, "_deadlineSeconds", { + get: $util.oneOfGetter($oneOfFields = ["deadlineSeconds"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ExecuteChangeStreamQuery.prototype, "_cloudDatabaseRole", { + get: $util.oneOfGetter($oneOfFields = ["cloudDatabaseRole"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ExecuteChangeStreamQuery instance using the specified properties. + * @function create + * @memberof google.spanner.executor.v1.ExecuteChangeStreamQuery + * @static + * @param {google.spanner.executor.v1.IExecuteChangeStreamQuery=} [properties] Properties to set + * @returns {google.spanner.executor.v1.ExecuteChangeStreamQuery} ExecuteChangeStreamQuery instance + */ + ExecuteChangeStreamQuery.create = function create(properties) { + return new ExecuteChangeStreamQuery(properties); + }; + + /** + * Encodes the specified ExecuteChangeStreamQuery message. Does not implicitly {@link google.spanner.executor.v1.ExecuteChangeStreamQuery.verify|verify} messages. + * @function encode + * @memberof google.spanner.executor.v1.ExecuteChangeStreamQuery + * @static + * @param {google.spanner.executor.v1.IExecuteChangeStreamQuery} message ExecuteChangeStreamQuery message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecuteChangeStreamQuery.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.partitionToken != null && Object.hasOwnProperty.call(message, "partitionToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.partitionToken); + if (message.readOptions != null && message.readOptions.length) + for (var i = 0; i < message.readOptions.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.readOptions[i]); + if (message.heartbeatMilliseconds != null && Object.hasOwnProperty.call(message, "heartbeatMilliseconds")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.heartbeatMilliseconds); + if (message.deadlineSeconds != null && Object.hasOwnProperty.call(message, "deadlineSeconds")) + writer.uint32(/* id 7, wireType 0 =*/56).int64(message.deadlineSeconds); + if (message.cloudDatabaseRole != null && Object.hasOwnProperty.call(message, "cloudDatabaseRole")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.cloudDatabaseRole); + return writer; + }; + + /** + * Encodes the specified ExecuteChangeStreamQuery message, length delimited. Does not implicitly {@link google.spanner.executor.v1.ExecuteChangeStreamQuery.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.executor.v1.ExecuteChangeStreamQuery + * @static + * @param {google.spanner.executor.v1.IExecuteChangeStreamQuery} message ExecuteChangeStreamQuery message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecuteChangeStreamQuery.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExecuteChangeStreamQuery message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.executor.v1.ExecuteChangeStreamQuery + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.executor.v1.ExecuteChangeStreamQuery} ExecuteChangeStreamQuery + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecuteChangeStreamQuery.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.ExecuteChangeStreamQuery(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.partitionToken = reader.string(); + break; + } + case 5: { + if (!(message.readOptions && message.readOptions.length)) + message.readOptions = []; + message.readOptions.push(reader.string()); + break; + } + case 6: { + message.heartbeatMilliseconds = reader.int32(); + break; + } + case 7: { + message.deadlineSeconds = reader.int64(); + break; + } + case 8: { + message.cloudDatabaseRole = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExecuteChangeStreamQuery message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.executor.v1.ExecuteChangeStreamQuery + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.executor.v1.ExecuteChangeStreamQuery} ExecuteChangeStreamQuery + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecuteChangeStreamQuery.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExecuteChangeStreamQuery message. + * @function verify + * @memberof google.spanner.executor.v1.ExecuteChangeStreamQuery + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExecuteChangeStreamQuery.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.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + properties._endTime = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + } + if (message.partitionToken != null && message.hasOwnProperty("partitionToken")) { + properties._partitionToken = 1; + if (!$util.isString(message.partitionToken)) + return "partitionToken: string expected"; + } + if (message.readOptions != null && message.hasOwnProperty("readOptions")) { + if (!Array.isArray(message.readOptions)) + return "readOptions: array expected"; + for (var i = 0; i < message.readOptions.length; ++i) + if (!$util.isString(message.readOptions[i])) + return "readOptions: string[] expected"; + } + if (message.heartbeatMilliseconds != null && message.hasOwnProperty("heartbeatMilliseconds")) { + properties._heartbeatMilliseconds = 1; + if (!$util.isInteger(message.heartbeatMilliseconds)) + return "heartbeatMilliseconds: integer expected"; + } + if (message.deadlineSeconds != null && message.hasOwnProperty("deadlineSeconds")) { + properties._deadlineSeconds = 1; + if (!$util.isInteger(message.deadlineSeconds) && !(message.deadlineSeconds && $util.isInteger(message.deadlineSeconds.low) && $util.isInteger(message.deadlineSeconds.high))) + return "deadlineSeconds: integer|Long expected"; + } + if (message.cloudDatabaseRole != null && message.hasOwnProperty("cloudDatabaseRole")) { + properties._cloudDatabaseRole = 1; + if (!$util.isString(message.cloudDatabaseRole)) + return "cloudDatabaseRole: string expected"; + } + return null; + }; + + /** + * Creates an ExecuteChangeStreamQuery message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.executor.v1.ExecuteChangeStreamQuery + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.executor.v1.ExecuteChangeStreamQuery} ExecuteChangeStreamQuery + */ + ExecuteChangeStreamQuery.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.executor.v1.ExecuteChangeStreamQuery) + return object; + var message = new $root.google.spanner.executor.v1.ExecuteChangeStreamQuery(); + if (object.name != null) + message.name = String(object.name); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.spanner.executor.v1.ExecuteChangeStreamQuery.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.spanner.executor.v1.ExecuteChangeStreamQuery.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.partitionToken != null) + message.partitionToken = String(object.partitionToken); + if (object.readOptions) { + if (!Array.isArray(object.readOptions)) + throw TypeError(".google.spanner.executor.v1.ExecuteChangeStreamQuery.readOptions: array expected"); + message.readOptions = []; + for (var i = 0; i < object.readOptions.length; ++i) + message.readOptions[i] = String(object.readOptions[i]); + } + if (object.heartbeatMilliseconds != null) + message.heartbeatMilliseconds = object.heartbeatMilliseconds | 0; + if (object.deadlineSeconds != null) + if ($util.Long) + (message.deadlineSeconds = $util.Long.fromValue(object.deadlineSeconds)).unsigned = false; + else if (typeof object.deadlineSeconds === "string") + message.deadlineSeconds = parseInt(object.deadlineSeconds, 10); + else if (typeof object.deadlineSeconds === "number") + message.deadlineSeconds = object.deadlineSeconds; + else if (typeof object.deadlineSeconds === "object") + message.deadlineSeconds = new $util.LongBits(object.deadlineSeconds.low >>> 0, object.deadlineSeconds.high >>> 0).toNumber(); + if (object.cloudDatabaseRole != null) + message.cloudDatabaseRole = String(object.cloudDatabaseRole); + return message; + }; + + /** + * Creates a plain object from an ExecuteChangeStreamQuery message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.executor.v1.ExecuteChangeStreamQuery + * @static + * @param {google.spanner.executor.v1.ExecuteChangeStreamQuery} message ExecuteChangeStreamQuery + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExecuteChangeStreamQuery.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.readOptions = []; + if (options.defaults) { + object.name = ""; + object.startTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) { + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (options.oneofs) + object._endTime = "endTime"; + } + if (message.partitionToken != null && message.hasOwnProperty("partitionToken")) { + object.partitionToken = message.partitionToken; + if (options.oneofs) + object._partitionToken = "partitionToken"; + } + if (message.readOptions && message.readOptions.length) { + object.readOptions = []; + for (var j = 0; j < message.readOptions.length; ++j) + object.readOptions[j] = message.readOptions[j]; + } + if (message.heartbeatMilliseconds != null && message.hasOwnProperty("heartbeatMilliseconds")) { + object.heartbeatMilliseconds = message.heartbeatMilliseconds; + if (options.oneofs) + object._heartbeatMilliseconds = "heartbeatMilliseconds"; + } + if (message.deadlineSeconds != null && message.hasOwnProperty("deadlineSeconds")) { + if (typeof message.deadlineSeconds === "number") + object.deadlineSeconds = options.longs === String ? String(message.deadlineSeconds) : message.deadlineSeconds; + else + object.deadlineSeconds = options.longs === String ? $util.Long.prototype.toString.call(message.deadlineSeconds) : options.longs === Number ? new $util.LongBits(message.deadlineSeconds.low >>> 0, message.deadlineSeconds.high >>> 0).toNumber() : message.deadlineSeconds; + if (options.oneofs) + object._deadlineSeconds = "deadlineSeconds"; + } + if (message.cloudDatabaseRole != null && message.hasOwnProperty("cloudDatabaseRole")) { + object.cloudDatabaseRole = message.cloudDatabaseRole; + if (options.oneofs) + object._cloudDatabaseRole = "cloudDatabaseRole"; + } + return object; + }; + + /** + * Converts this ExecuteChangeStreamQuery to JSON. + * @function toJSON + * @memberof google.spanner.executor.v1.ExecuteChangeStreamQuery + * @instance + * @returns {Object.} JSON object + */ + ExecuteChangeStreamQuery.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExecuteChangeStreamQuery + * @function getTypeUrl + * @memberof google.spanner.executor.v1.ExecuteChangeStreamQuery + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExecuteChangeStreamQuery.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.executor.v1.ExecuteChangeStreamQuery"; + }; + + return ExecuteChangeStreamQuery; + })(); + + v1.SpannerActionOutcome = (function() { + + /** + * Properties of a SpannerActionOutcome. + * @memberof google.spanner.executor.v1 + * @interface ISpannerActionOutcome + * @property {google.rpc.IStatus|null} [status] SpannerActionOutcome status + * @property {google.protobuf.ITimestamp|null} [commitTime] SpannerActionOutcome commitTime + * @property {google.spanner.executor.v1.IReadResult|null} [readResult] SpannerActionOutcome readResult + * @property {google.spanner.executor.v1.IQueryResult|null} [queryResult] SpannerActionOutcome queryResult + * @property {boolean|null} [transactionRestarted] SpannerActionOutcome transactionRestarted + * @property {Uint8Array|null} [batchTxnId] SpannerActionOutcome batchTxnId + * @property {Array.|null} [dbPartition] SpannerActionOutcome dbPartition + * @property {google.spanner.executor.v1.IAdminResult|null} [adminResult] SpannerActionOutcome adminResult + * @property {Array.|null} [dmlRowsModified] SpannerActionOutcome dmlRowsModified + * @property {Array.|null} [changeStreamRecords] SpannerActionOutcome changeStreamRecords + */ + + /** + * Constructs a new SpannerActionOutcome. + * @memberof google.spanner.executor.v1 + * @classdesc Represents a SpannerActionOutcome. + * @implements ISpannerActionOutcome + * @constructor + * @param {google.spanner.executor.v1.ISpannerActionOutcome=} [properties] Properties to set + */ + function SpannerActionOutcome(properties) { + this.dbPartition = []; + this.dmlRowsModified = []; + this.changeStreamRecords = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SpannerActionOutcome status. + * @member {google.rpc.IStatus|null|undefined} status + * @memberof google.spanner.executor.v1.SpannerActionOutcome + * @instance + */ + SpannerActionOutcome.prototype.status = null; + + /** + * SpannerActionOutcome commitTime. + * @member {google.protobuf.ITimestamp|null|undefined} commitTime + * @memberof google.spanner.executor.v1.SpannerActionOutcome + * @instance + */ + SpannerActionOutcome.prototype.commitTime = null; + + /** + * SpannerActionOutcome readResult. + * @member {google.spanner.executor.v1.IReadResult|null|undefined} readResult + * @memberof google.spanner.executor.v1.SpannerActionOutcome + * @instance + */ + SpannerActionOutcome.prototype.readResult = null; + + /** + * SpannerActionOutcome queryResult. + * @member {google.spanner.executor.v1.IQueryResult|null|undefined} queryResult + * @memberof google.spanner.executor.v1.SpannerActionOutcome + * @instance + */ + SpannerActionOutcome.prototype.queryResult = null; + + /** + * SpannerActionOutcome transactionRestarted. + * @member {boolean|null|undefined} transactionRestarted + * @memberof google.spanner.executor.v1.SpannerActionOutcome + * @instance + */ + SpannerActionOutcome.prototype.transactionRestarted = null; + + /** + * SpannerActionOutcome batchTxnId. + * @member {Uint8Array|null|undefined} batchTxnId + * @memberof google.spanner.executor.v1.SpannerActionOutcome + * @instance + */ + SpannerActionOutcome.prototype.batchTxnId = null; + + /** + * SpannerActionOutcome dbPartition. + * @member {Array.} dbPartition + * @memberof google.spanner.executor.v1.SpannerActionOutcome + * @instance + */ + SpannerActionOutcome.prototype.dbPartition = $util.emptyArray; + + /** + * SpannerActionOutcome adminResult. + * @member {google.spanner.executor.v1.IAdminResult|null|undefined} adminResult + * @memberof google.spanner.executor.v1.SpannerActionOutcome + * @instance + */ + SpannerActionOutcome.prototype.adminResult = null; + + /** + * SpannerActionOutcome dmlRowsModified. + * @member {Array.} dmlRowsModified + * @memberof google.spanner.executor.v1.SpannerActionOutcome + * @instance + */ + SpannerActionOutcome.prototype.dmlRowsModified = $util.emptyArray; + + /** + * SpannerActionOutcome changeStreamRecords. + * @member {Array.} changeStreamRecords + * @memberof google.spanner.executor.v1.SpannerActionOutcome + * @instance + */ + SpannerActionOutcome.prototype.changeStreamRecords = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SpannerActionOutcome.prototype, "_status", { + get: $util.oneOfGetter($oneOfFields = ["status"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SpannerActionOutcome.prototype, "_commitTime", { + get: $util.oneOfGetter($oneOfFields = ["commitTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SpannerActionOutcome.prototype, "_readResult", { + get: $util.oneOfGetter($oneOfFields = ["readResult"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SpannerActionOutcome.prototype, "_queryResult", { + get: $util.oneOfGetter($oneOfFields = ["queryResult"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SpannerActionOutcome.prototype, "_transactionRestarted", { + get: $util.oneOfGetter($oneOfFields = ["transactionRestarted"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SpannerActionOutcome.prototype, "_batchTxnId", { + get: $util.oneOfGetter($oneOfFields = ["batchTxnId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SpannerActionOutcome.prototype, "_adminResult", { + get: $util.oneOfGetter($oneOfFields = ["adminResult"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SpannerActionOutcome instance using the specified properties. + * @function create + * @memberof google.spanner.executor.v1.SpannerActionOutcome + * @static + * @param {google.spanner.executor.v1.ISpannerActionOutcome=} [properties] Properties to set + * @returns {google.spanner.executor.v1.SpannerActionOutcome} SpannerActionOutcome instance + */ + SpannerActionOutcome.create = function create(properties) { + return new SpannerActionOutcome(properties); + }; + + /** + * Encodes the specified SpannerActionOutcome message. Does not implicitly {@link google.spanner.executor.v1.SpannerActionOutcome.verify|verify} messages. + * @function encode + * @memberof google.spanner.executor.v1.SpannerActionOutcome + * @static + * @param {google.spanner.executor.v1.ISpannerActionOutcome} message SpannerActionOutcome message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpannerActionOutcome.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + $root.google.rpc.Status.encode(message.status, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.commitTime != null && Object.hasOwnProperty.call(message, "commitTime")) + $root.google.protobuf.Timestamp.encode(message.commitTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.readResult != null && Object.hasOwnProperty.call(message, "readResult")) + $root.google.spanner.executor.v1.ReadResult.encode(message.readResult, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.queryResult != null && Object.hasOwnProperty.call(message, "queryResult")) + $root.google.spanner.executor.v1.QueryResult.encode(message.queryResult, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.transactionRestarted != null && Object.hasOwnProperty.call(message, "transactionRestarted")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.transactionRestarted); + if (message.batchTxnId != null && Object.hasOwnProperty.call(message, "batchTxnId")) + writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.batchTxnId); + if (message.dbPartition != null && message.dbPartition.length) + for (var i = 0; i < message.dbPartition.length; ++i) + $root.google.spanner.executor.v1.BatchPartition.encode(message.dbPartition[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.adminResult != null && Object.hasOwnProperty.call(message, "adminResult")) + $root.google.spanner.executor.v1.AdminResult.encode(message.adminResult, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.dmlRowsModified != null && message.dmlRowsModified.length) { + writer.uint32(/* id 9, wireType 2 =*/74).fork(); + for (var i = 0; i < message.dmlRowsModified.length; ++i) + writer.int64(message.dmlRowsModified[i]); + writer.ldelim(); + } + if (message.changeStreamRecords != null && message.changeStreamRecords.length) + for (var i = 0; i < message.changeStreamRecords.length; ++i) + $root.google.spanner.executor.v1.ChangeStreamRecord.encode(message.changeStreamRecords[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SpannerActionOutcome message, length delimited. Does not implicitly {@link google.spanner.executor.v1.SpannerActionOutcome.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.executor.v1.SpannerActionOutcome + * @static + * @param {google.spanner.executor.v1.ISpannerActionOutcome} message SpannerActionOutcome message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpannerActionOutcome.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SpannerActionOutcome message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.executor.v1.SpannerActionOutcome + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.executor.v1.SpannerActionOutcome} SpannerActionOutcome + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpannerActionOutcome.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.SpannerActionOutcome(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.status = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 2: { + message.commitTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.readResult = $root.google.spanner.executor.v1.ReadResult.decode(reader, reader.uint32()); + break; + } + case 4: { + message.queryResult = $root.google.spanner.executor.v1.QueryResult.decode(reader, reader.uint32()); + break; + } + case 5: { + message.transactionRestarted = reader.bool(); + break; + } + case 6: { + message.batchTxnId = reader.bytes(); + break; + } + case 7: { + if (!(message.dbPartition && message.dbPartition.length)) + message.dbPartition = []; + message.dbPartition.push($root.google.spanner.executor.v1.BatchPartition.decode(reader, reader.uint32())); + break; + } + case 8: { + message.adminResult = $root.google.spanner.executor.v1.AdminResult.decode(reader, reader.uint32()); + break; + } + case 9: { + if (!(message.dmlRowsModified && message.dmlRowsModified.length)) + message.dmlRowsModified = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.dmlRowsModified.push(reader.int64()); + } else + message.dmlRowsModified.push(reader.int64()); + break; + } + case 10: { + if (!(message.changeStreamRecords && message.changeStreamRecords.length)) + message.changeStreamRecords = []; + message.changeStreamRecords.push($root.google.spanner.executor.v1.ChangeStreamRecord.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SpannerActionOutcome message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.executor.v1.SpannerActionOutcome + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.executor.v1.SpannerActionOutcome} SpannerActionOutcome + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpannerActionOutcome.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SpannerActionOutcome message. + * @function verify + * @memberof google.spanner.executor.v1.SpannerActionOutcome + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SpannerActionOutcome.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.status != null && message.hasOwnProperty("status")) { + properties._status = 1; + { + var error = $root.google.rpc.Status.verify(message.status); + if (error) + return "status." + error; + } + } + if (message.commitTime != null && message.hasOwnProperty("commitTime")) { + properties._commitTime = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.commitTime); + if (error) + return "commitTime." + error; + } + } + if (message.readResult != null && message.hasOwnProperty("readResult")) { + properties._readResult = 1; + { + var error = $root.google.spanner.executor.v1.ReadResult.verify(message.readResult); + if (error) + return "readResult." + error; + } + } + if (message.queryResult != null && message.hasOwnProperty("queryResult")) { + properties._queryResult = 1; + { + var error = $root.google.spanner.executor.v1.QueryResult.verify(message.queryResult); + if (error) + return "queryResult." + error; + } + } + if (message.transactionRestarted != null && message.hasOwnProperty("transactionRestarted")) { + properties._transactionRestarted = 1; + if (typeof message.transactionRestarted !== "boolean") + return "transactionRestarted: boolean expected"; + } + if (message.batchTxnId != null && message.hasOwnProperty("batchTxnId")) { + properties._batchTxnId = 1; + if (!(message.batchTxnId && typeof message.batchTxnId.length === "number" || $util.isString(message.batchTxnId))) + return "batchTxnId: buffer expected"; + } + if (message.dbPartition != null && message.hasOwnProperty("dbPartition")) { + if (!Array.isArray(message.dbPartition)) + return "dbPartition: array expected"; + for (var i = 0; i < message.dbPartition.length; ++i) { + var error = $root.google.spanner.executor.v1.BatchPartition.verify(message.dbPartition[i]); + if (error) + return "dbPartition." + error; + } + } + if (message.adminResult != null && message.hasOwnProperty("adminResult")) { + properties._adminResult = 1; + { + var error = $root.google.spanner.executor.v1.AdminResult.verify(message.adminResult); + if (error) + return "adminResult." + error; + } + } + if (message.dmlRowsModified != null && message.hasOwnProperty("dmlRowsModified")) { + if (!Array.isArray(message.dmlRowsModified)) + return "dmlRowsModified: array expected"; + for (var i = 0; i < message.dmlRowsModified.length; ++i) + if (!$util.isInteger(message.dmlRowsModified[i]) && !(message.dmlRowsModified[i] && $util.isInteger(message.dmlRowsModified[i].low) && $util.isInteger(message.dmlRowsModified[i].high))) + return "dmlRowsModified: integer|Long[] expected"; + } + if (message.changeStreamRecords != null && message.hasOwnProperty("changeStreamRecords")) { + if (!Array.isArray(message.changeStreamRecords)) + return "changeStreamRecords: array expected"; + for (var i = 0; i < message.changeStreamRecords.length; ++i) { + var error = $root.google.spanner.executor.v1.ChangeStreamRecord.verify(message.changeStreamRecords[i]); + if (error) + return "changeStreamRecords." + error; + } + } + return null; + }; + + /** + * Creates a SpannerActionOutcome message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.executor.v1.SpannerActionOutcome + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.executor.v1.SpannerActionOutcome} SpannerActionOutcome + */ + SpannerActionOutcome.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.executor.v1.SpannerActionOutcome) + return object; + var message = new $root.google.spanner.executor.v1.SpannerActionOutcome(); + if (object.status != null) { + if (typeof object.status !== "object") + throw TypeError(".google.spanner.executor.v1.SpannerActionOutcome.status: object expected"); + message.status = $root.google.rpc.Status.fromObject(object.status); + } + if (object.commitTime != null) { + if (typeof object.commitTime !== "object") + throw TypeError(".google.spanner.executor.v1.SpannerActionOutcome.commitTime: object expected"); + message.commitTime = $root.google.protobuf.Timestamp.fromObject(object.commitTime); + } + if (object.readResult != null) { + if (typeof object.readResult !== "object") + throw TypeError(".google.spanner.executor.v1.SpannerActionOutcome.readResult: object expected"); + message.readResult = $root.google.spanner.executor.v1.ReadResult.fromObject(object.readResult); + } + if (object.queryResult != null) { + if (typeof object.queryResult !== "object") + throw TypeError(".google.spanner.executor.v1.SpannerActionOutcome.queryResult: object expected"); + message.queryResult = $root.google.spanner.executor.v1.QueryResult.fromObject(object.queryResult); + } + if (object.transactionRestarted != null) + message.transactionRestarted = Boolean(object.transactionRestarted); + if (object.batchTxnId != null) + if (typeof object.batchTxnId === "string") + $util.base64.decode(object.batchTxnId, message.batchTxnId = $util.newBuffer($util.base64.length(object.batchTxnId)), 0); + else if (object.batchTxnId.length >= 0) + message.batchTxnId = object.batchTxnId; + if (object.dbPartition) { + if (!Array.isArray(object.dbPartition)) + throw TypeError(".google.spanner.executor.v1.SpannerActionOutcome.dbPartition: array expected"); + message.dbPartition = []; + for (var i = 0; i < object.dbPartition.length; ++i) { + if (typeof object.dbPartition[i] !== "object") + throw TypeError(".google.spanner.executor.v1.SpannerActionOutcome.dbPartition: object expected"); + message.dbPartition[i] = $root.google.spanner.executor.v1.BatchPartition.fromObject(object.dbPartition[i]); + } + } + if (object.adminResult != null) { + if (typeof object.adminResult !== "object") + throw TypeError(".google.spanner.executor.v1.SpannerActionOutcome.adminResult: object expected"); + message.adminResult = $root.google.spanner.executor.v1.AdminResult.fromObject(object.adminResult); + } + if (object.dmlRowsModified) { + if (!Array.isArray(object.dmlRowsModified)) + throw TypeError(".google.spanner.executor.v1.SpannerActionOutcome.dmlRowsModified: array expected"); + message.dmlRowsModified = []; + for (var i = 0; i < object.dmlRowsModified.length; ++i) + if ($util.Long) + (message.dmlRowsModified[i] = $util.Long.fromValue(object.dmlRowsModified[i])).unsigned = false; + else if (typeof object.dmlRowsModified[i] === "string") + message.dmlRowsModified[i] = parseInt(object.dmlRowsModified[i], 10); + else if (typeof object.dmlRowsModified[i] === "number") + message.dmlRowsModified[i] = object.dmlRowsModified[i]; + else if (typeof object.dmlRowsModified[i] === "object") + message.dmlRowsModified[i] = new $util.LongBits(object.dmlRowsModified[i].low >>> 0, object.dmlRowsModified[i].high >>> 0).toNumber(); + } + if (object.changeStreamRecords) { + if (!Array.isArray(object.changeStreamRecords)) + throw TypeError(".google.spanner.executor.v1.SpannerActionOutcome.changeStreamRecords: array expected"); + message.changeStreamRecords = []; + for (var i = 0; i < object.changeStreamRecords.length; ++i) { + if (typeof object.changeStreamRecords[i] !== "object") + throw TypeError(".google.spanner.executor.v1.SpannerActionOutcome.changeStreamRecords: object expected"); + message.changeStreamRecords[i] = $root.google.spanner.executor.v1.ChangeStreamRecord.fromObject(object.changeStreamRecords[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SpannerActionOutcome message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.executor.v1.SpannerActionOutcome + * @static + * @param {google.spanner.executor.v1.SpannerActionOutcome} message SpannerActionOutcome + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpannerActionOutcome.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.dbPartition = []; + object.dmlRowsModified = []; + object.changeStreamRecords = []; + } + if (message.status != null && message.hasOwnProperty("status")) { + object.status = $root.google.rpc.Status.toObject(message.status, options); + if (options.oneofs) + object._status = "status"; + } + if (message.commitTime != null && message.hasOwnProperty("commitTime")) { + object.commitTime = $root.google.protobuf.Timestamp.toObject(message.commitTime, options); + if (options.oneofs) + object._commitTime = "commitTime"; + } + if (message.readResult != null && message.hasOwnProperty("readResult")) { + object.readResult = $root.google.spanner.executor.v1.ReadResult.toObject(message.readResult, options); + if (options.oneofs) + object._readResult = "readResult"; + } + if (message.queryResult != null && message.hasOwnProperty("queryResult")) { + object.queryResult = $root.google.spanner.executor.v1.QueryResult.toObject(message.queryResult, options); + if (options.oneofs) + object._queryResult = "queryResult"; + } + if (message.transactionRestarted != null && message.hasOwnProperty("transactionRestarted")) { + object.transactionRestarted = message.transactionRestarted; + if (options.oneofs) + object._transactionRestarted = "transactionRestarted"; + } + if (message.batchTxnId != null && message.hasOwnProperty("batchTxnId")) { + object.batchTxnId = options.bytes === String ? $util.base64.encode(message.batchTxnId, 0, message.batchTxnId.length) : options.bytes === Array ? Array.prototype.slice.call(message.batchTxnId) : message.batchTxnId; + if (options.oneofs) + object._batchTxnId = "batchTxnId"; + } + if (message.dbPartition && message.dbPartition.length) { + object.dbPartition = []; + for (var j = 0; j < message.dbPartition.length; ++j) + object.dbPartition[j] = $root.google.spanner.executor.v1.BatchPartition.toObject(message.dbPartition[j], options); + } + if (message.adminResult != null && message.hasOwnProperty("adminResult")) { + object.adminResult = $root.google.spanner.executor.v1.AdminResult.toObject(message.adminResult, options); + if (options.oneofs) + object._adminResult = "adminResult"; + } + if (message.dmlRowsModified && message.dmlRowsModified.length) { + object.dmlRowsModified = []; + for (var j = 0; j < message.dmlRowsModified.length; ++j) + if (typeof message.dmlRowsModified[j] === "number") + object.dmlRowsModified[j] = options.longs === String ? String(message.dmlRowsModified[j]) : message.dmlRowsModified[j]; + else + object.dmlRowsModified[j] = options.longs === String ? $util.Long.prototype.toString.call(message.dmlRowsModified[j]) : options.longs === Number ? new $util.LongBits(message.dmlRowsModified[j].low >>> 0, message.dmlRowsModified[j].high >>> 0).toNumber() : message.dmlRowsModified[j]; + } + if (message.changeStreamRecords && message.changeStreamRecords.length) { + object.changeStreamRecords = []; + for (var j = 0; j < message.changeStreamRecords.length; ++j) + object.changeStreamRecords[j] = $root.google.spanner.executor.v1.ChangeStreamRecord.toObject(message.changeStreamRecords[j], options); + } + return object; + }; + + /** + * Converts this SpannerActionOutcome to JSON. + * @function toJSON + * @memberof google.spanner.executor.v1.SpannerActionOutcome + * @instance + * @returns {Object.} JSON object + */ + SpannerActionOutcome.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SpannerActionOutcome + * @function getTypeUrl + * @memberof google.spanner.executor.v1.SpannerActionOutcome + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SpannerActionOutcome.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.executor.v1.SpannerActionOutcome"; + }; + + return SpannerActionOutcome; + })(); + + v1.AdminResult = (function() { + + /** + * Properties of an AdminResult. + * @memberof google.spanner.executor.v1 + * @interface IAdminResult + * @property {google.spanner.executor.v1.ICloudBackupResponse|null} [backupResponse] AdminResult backupResponse + * @property {google.spanner.executor.v1.IOperationResponse|null} [operationResponse] AdminResult operationResponse + * @property {google.spanner.executor.v1.ICloudDatabaseResponse|null} [databaseResponse] AdminResult databaseResponse + * @property {google.spanner.executor.v1.ICloudInstanceResponse|null} [instanceResponse] AdminResult instanceResponse + * @property {google.spanner.executor.v1.ICloudInstanceConfigResponse|null} [instanceConfigResponse] AdminResult instanceConfigResponse + */ + + /** + * Constructs a new AdminResult. + * @memberof google.spanner.executor.v1 + * @classdesc Represents an AdminResult. + * @implements IAdminResult + * @constructor + * @param {google.spanner.executor.v1.IAdminResult=} [properties] Properties to set + */ + function AdminResult(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AdminResult backupResponse. + * @member {google.spanner.executor.v1.ICloudBackupResponse|null|undefined} backupResponse + * @memberof google.spanner.executor.v1.AdminResult + * @instance + */ + AdminResult.prototype.backupResponse = null; + + /** + * AdminResult operationResponse. + * @member {google.spanner.executor.v1.IOperationResponse|null|undefined} operationResponse + * @memberof google.spanner.executor.v1.AdminResult + * @instance + */ + AdminResult.prototype.operationResponse = null; + + /** + * AdminResult databaseResponse. + * @member {google.spanner.executor.v1.ICloudDatabaseResponse|null|undefined} databaseResponse + * @memberof google.spanner.executor.v1.AdminResult + * @instance + */ + AdminResult.prototype.databaseResponse = null; + + /** + * AdminResult instanceResponse. + * @member {google.spanner.executor.v1.ICloudInstanceResponse|null|undefined} instanceResponse + * @memberof google.spanner.executor.v1.AdminResult + * @instance + */ + AdminResult.prototype.instanceResponse = null; + + /** + * AdminResult instanceConfigResponse. + * @member {google.spanner.executor.v1.ICloudInstanceConfigResponse|null|undefined} instanceConfigResponse + * @memberof google.spanner.executor.v1.AdminResult + * @instance + */ + AdminResult.prototype.instanceConfigResponse = null; + + /** + * Creates a new AdminResult instance using the specified properties. + * @function create + * @memberof google.spanner.executor.v1.AdminResult + * @static + * @param {google.spanner.executor.v1.IAdminResult=} [properties] Properties to set + * @returns {google.spanner.executor.v1.AdminResult} AdminResult instance + */ + AdminResult.create = function create(properties) { + return new AdminResult(properties); + }; + + /** + * Encodes the specified AdminResult message. Does not implicitly {@link google.spanner.executor.v1.AdminResult.verify|verify} messages. + * @function encode + * @memberof google.spanner.executor.v1.AdminResult + * @static + * @param {google.spanner.executor.v1.IAdminResult} message AdminResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AdminResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.backupResponse != null && Object.hasOwnProperty.call(message, "backupResponse")) + $root.google.spanner.executor.v1.CloudBackupResponse.encode(message.backupResponse, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.operationResponse != null && Object.hasOwnProperty.call(message, "operationResponse")) + $root.google.spanner.executor.v1.OperationResponse.encode(message.operationResponse, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.databaseResponse != null && Object.hasOwnProperty.call(message, "databaseResponse")) + $root.google.spanner.executor.v1.CloudDatabaseResponse.encode(message.databaseResponse, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.instanceResponse != null && Object.hasOwnProperty.call(message, "instanceResponse")) + $root.google.spanner.executor.v1.CloudInstanceResponse.encode(message.instanceResponse, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.instanceConfigResponse != null && Object.hasOwnProperty.call(message, "instanceConfigResponse")) + $root.google.spanner.executor.v1.CloudInstanceConfigResponse.encode(message.instanceConfigResponse, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AdminResult message, length delimited. Does not implicitly {@link google.spanner.executor.v1.AdminResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.executor.v1.AdminResult + * @static + * @param {google.spanner.executor.v1.IAdminResult} message AdminResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AdminResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AdminResult message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.executor.v1.AdminResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.executor.v1.AdminResult} AdminResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AdminResult.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.AdminResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.backupResponse = $root.google.spanner.executor.v1.CloudBackupResponse.decode(reader, reader.uint32()); + break; + } + case 2: { + message.operationResponse = $root.google.spanner.executor.v1.OperationResponse.decode(reader, reader.uint32()); + break; + } + case 3: { + message.databaseResponse = $root.google.spanner.executor.v1.CloudDatabaseResponse.decode(reader, reader.uint32()); + break; + } + case 4: { + message.instanceResponse = $root.google.spanner.executor.v1.CloudInstanceResponse.decode(reader, reader.uint32()); + break; + } + case 5: { + message.instanceConfigResponse = $root.google.spanner.executor.v1.CloudInstanceConfigResponse.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AdminResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.executor.v1.AdminResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.executor.v1.AdminResult} AdminResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AdminResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AdminResult message. + * @function verify + * @memberof google.spanner.executor.v1.AdminResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AdminResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.backupResponse != null && message.hasOwnProperty("backupResponse")) { + var error = $root.google.spanner.executor.v1.CloudBackupResponse.verify(message.backupResponse); + if (error) + return "backupResponse." + error; + } + if (message.operationResponse != null && message.hasOwnProperty("operationResponse")) { + var error = $root.google.spanner.executor.v1.OperationResponse.verify(message.operationResponse); + if (error) + return "operationResponse." + error; + } + if (message.databaseResponse != null && message.hasOwnProperty("databaseResponse")) { + var error = $root.google.spanner.executor.v1.CloudDatabaseResponse.verify(message.databaseResponse); + if (error) + return "databaseResponse." + error; + } + if (message.instanceResponse != null && message.hasOwnProperty("instanceResponse")) { + var error = $root.google.spanner.executor.v1.CloudInstanceResponse.verify(message.instanceResponse); + if (error) + return "instanceResponse." + error; + } + if (message.instanceConfigResponse != null && message.hasOwnProperty("instanceConfigResponse")) { + var error = $root.google.spanner.executor.v1.CloudInstanceConfigResponse.verify(message.instanceConfigResponse); + if (error) + return "instanceConfigResponse." + error; + } + return null; + }; + + /** + * Creates an AdminResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.executor.v1.AdminResult + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.executor.v1.AdminResult} AdminResult + */ + AdminResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.executor.v1.AdminResult) + return object; + var message = new $root.google.spanner.executor.v1.AdminResult(); + if (object.backupResponse != null) { + if (typeof object.backupResponse !== "object") + throw TypeError(".google.spanner.executor.v1.AdminResult.backupResponse: object expected"); + message.backupResponse = $root.google.spanner.executor.v1.CloudBackupResponse.fromObject(object.backupResponse); + } + if (object.operationResponse != null) { + if (typeof object.operationResponse !== "object") + throw TypeError(".google.spanner.executor.v1.AdminResult.operationResponse: object expected"); + message.operationResponse = $root.google.spanner.executor.v1.OperationResponse.fromObject(object.operationResponse); + } + if (object.databaseResponse != null) { + if (typeof object.databaseResponse !== "object") + throw TypeError(".google.spanner.executor.v1.AdminResult.databaseResponse: object expected"); + message.databaseResponse = $root.google.spanner.executor.v1.CloudDatabaseResponse.fromObject(object.databaseResponse); + } + if (object.instanceResponse != null) { + if (typeof object.instanceResponse !== "object") + throw TypeError(".google.spanner.executor.v1.AdminResult.instanceResponse: object expected"); + message.instanceResponse = $root.google.spanner.executor.v1.CloudInstanceResponse.fromObject(object.instanceResponse); + } + if (object.instanceConfigResponse != null) { + if (typeof object.instanceConfigResponse !== "object") + throw TypeError(".google.spanner.executor.v1.AdminResult.instanceConfigResponse: object expected"); + message.instanceConfigResponse = $root.google.spanner.executor.v1.CloudInstanceConfigResponse.fromObject(object.instanceConfigResponse); + } + return message; + }; + + /** + * Creates a plain object from an AdminResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.executor.v1.AdminResult + * @static + * @param {google.spanner.executor.v1.AdminResult} message AdminResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AdminResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.backupResponse = null; + object.operationResponse = null; + object.databaseResponse = null; + object.instanceResponse = null; + object.instanceConfigResponse = null; + } + if (message.backupResponse != null && message.hasOwnProperty("backupResponse")) + object.backupResponse = $root.google.spanner.executor.v1.CloudBackupResponse.toObject(message.backupResponse, options); + if (message.operationResponse != null && message.hasOwnProperty("operationResponse")) + object.operationResponse = $root.google.spanner.executor.v1.OperationResponse.toObject(message.operationResponse, options); + if (message.databaseResponse != null && message.hasOwnProperty("databaseResponse")) + object.databaseResponse = $root.google.spanner.executor.v1.CloudDatabaseResponse.toObject(message.databaseResponse, options); + if (message.instanceResponse != null && message.hasOwnProperty("instanceResponse")) + object.instanceResponse = $root.google.spanner.executor.v1.CloudInstanceResponse.toObject(message.instanceResponse, options); + if (message.instanceConfigResponse != null && message.hasOwnProperty("instanceConfigResponse")) + object.instanceConfigResponse = $root.google.spanner.executor.v1.CloudInstanceConfigResponse.toObject(message.instanceConfigResponse, options); + return object; + }; + + /** + * Converts this AdminResult to JSON. + * @function toJSON + * @memberof google.spanner.executor.v1.AdminResult + * @instance + * @returns {Object.} JSON object + */ + AdminResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AdminResult + * @function getTypeUrl + * @memberof google.spanner.executor.v1.AdminResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AdminResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.executor.v1.AdminResult"; + }; + + return AdminResult; + })(); + + v1.CloudBackupResponse = (function() { + + /** + * Properties of a CloudBackupResponse. + * @memberof google.spanner.executor.v1 + * @interface ICloudBackupResponse + * @property {Array.|null} [listedBackups] CloudBackupResponse listedBackups + * @property {Array.|null} [listedBackupOperations] CloudBackupResponse listedBackupOperations + * @property {string|null} [nextPageToken] CloudBackupResponse nextPageToken + * @property {google.spanner.admin.database.v1.IBackup|null} [backup] CloudBackupResponse backup + */ + + /** + * Constructs a new CloudBackupResponse. + * @memberof google.spanner.executor.v1 + * @classdesc Represents a CloudBackupResponse. + * @implements ICloudBackupResponse + * @constructor + * @param {google.spanner.executor.v1.ICloudBackupResponse=} [properties] Properties to set + */ + function CloudBackupResponse(properties) { + this.listedBackups = []; + this.listedBackupOperations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CloudBackupResponse listedBackups. + * @member {Array.} listedBackups + * @memberof google.spanner.executor.v1.CloudBackupResponse + * @instance + */ + CloudBackupResponse.prototype.listedBackups = $util.emptyArray; + + /** + * CloudBackupResponse listedBackupOperations. + * @member {Array.} listedBackupOperations + * @memberof google.spanner.executor.v1.CloudBackupResponse + * @instance + */ + CloudBackupResponse.prototype.listedBackupOperations = $util.emptyArray; + + /** + * CloudBackupResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.spanner.executor.v1.CloudBackupResponse + * @instance + */ + CloudBackupResponse.prototype.nextPageToken = ""; + + /** + * CloudBackupResponse backup. + * @member {google.spanner.admin.database.v1.IBackup|null|undefined} backup + * @memberof google.spanner.executor.v1.CloudBackupResponse + * @instance + */ + CloudBackupResponse.prototype.backup = null; + + /** + * Creates a new CloudBackupResponse instance using the specified properties. + * @function create + * @memberof google.spanner.executor.v1.CloudBackupResponse + * @static + * @param {google.spanner.executor.v1.ICloudBackupResponse=} [properties] Properties to set + * @returns {google.spanner.executor.v1.CloudBackupResponse} CloudBackupResponse instance + */ + CloudBackupResponse.create = function create(properties) { + return new CloudBackupResponse(properties); + }; + + /** + * Encodes the specified CloudBackupResponse message. Does not implicitly {@link google.spanner.executor.v1.CloudBackupResponse.verify|verify} messages. + * @function encode + * @memberof google.spanner.executor.v1.CloudBackupResponse + * @static + * @param {google.spanner.executor.v1.ICloudBackupResponse} message CloudBackupResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudBackupResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.listedBackups != null && message.listedBackups.length) + for (var i = 0; i < message.listedBackups.length; ++i) + $root.google.spanner.admin.database.v1.Backup.encode(message.listedBackups[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.listedBackupOperations != null && message.listedBackupOperations.length) + for (var i = 0; i < message.listedBackupOperations.length; ++i) + $root.google.longrunning.Operation.encode(message.listedBackupOperations[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); + if (message.backup != null && Object.hasOwnProperty.call(message, "backup")) + $root.google.spanner.admin.database.v1.Backup.encode(message.backup, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CloudBackupResponse message, length delimited. Does not implicitly {@link google.spanner.executor.v1.CloudBackupResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.executor.v1.CloudBackupResponse + * @static + * @param {google.spanner.executor.v1.ICloudBackupResponse} message CloudBackupResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudBackupResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CloudBackupResponse message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.executor.v1.CloudBackupResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.executor.v1.CloudBackupResponse} CloudBackupResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudBackupResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.CloudBackupResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.listedBackups && message.listedBackups.length)) + message.listedBackups = []; + message.listedBackups.push($root.google.spanner.admin.database.v1.Backup.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.listedBackupOperations && message.listedBackupOperations.length)) + message.listedBackupOperations = []; + message.listedBackupOperations.push($root.google.longrunning.Operation.decode(reader, reader.uint32())); + break; + } + case 3: { + message.nextPageToken = reader.string(); + break; + } + case 4: { + message.backup = $root.google.spanner.admin.database.v1.Backup.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CloudBackupResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.executor.v1.CloudBackupResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.executor.v1.CloudBackupResponse} CloudBackupResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudBackupResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CloudBackupResponse message. + * @function verify + * @memberof google.spanner.executor.v1.CloudBackupResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CloudBackupResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.listedBackups != null && message.hasOwnProperty("listedBackups")) { + if (!Array.isArray(message.listedBackups)) + return "listedBackups: array expected"; + for (var i = 0; i < message.listedBackups.length; ++i) { + var error = $root.google.spanner.admin.database.v1.Backup.verify(message.listedBackups[i]); + if (error) + return "listedBackups." + error; + } + } + if (message.listedBackupOperations != null && message.hasOwnProperty("listedBackupOperations")) { + if (!Array.isArray(message.listedBackupOperations)) + return "listedBackupOperations: array expected"; + for (var i = 0; i < message.listedBackupOperations.length; ++i) { + var error = $root.google.longrunning.Operation.verify(message.listedBackupOperations[i]); + if (error) + return "listedBackupOperations." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.backup != null && message.hasOwnProperty("backup")) { + var error = $root.google.spanner.admin.database.v1.Backup.verify(message.backup); + if (error) + return "backup." + error; + } + return null; + }; + + /** + * Creates a CloudBackupResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.executor.v1.CloudBackupResponse + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.executor.v1.CloudBackupResponse} CloudBackupResponse + */ + CloudBackupResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.executor.v1.CloudBackupResponse) + return object; + var message = new $root.google.spanner.executor.v1.CloudBackupResponse(); + if (object.listedBackups) { + if (!Array.isArray(object.listedBackups)) + throw TypeError(".google.spanner.executor.v1.CloudBackupResponse.listedBackups: array expected"); + message.listedBackups = []; + for (var i = 0; i < object.listedBackups.length; ++i) { + if (typeof object.listedBackups[i] !== "object") + throw TypeError(".google.spanner.executor.v1.CloudBackupResponse.listedBackups: object expected"); + message.listedBackups[i] = $root.google.spanner.admin.database.v1.Backup.fromObject(object.listedBackups[i]); + } + } + if (object.listedBackupOperations) { + if (!Array.isArray(object.listedBackupOperations)) + throw TypeError(".google.spanner.executor.v1.CloudBackupResponse.listedBackupOperations: array expected"); + message.listedBackupOperations = []; + for (var i = 0; i < object.listedBackupOperations.length; ++i) { + if (typeof object.listedBackupOperations[i] !== "object") + throw TypeError(".google.spanner.executor.v1.CloudBackupResponse.listedBackupOperations: object expected"); + message.listedBackupOperations[i] = $root.google.longrunning.Operation.fromObject(object.listedBackupOperations[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.backup != null) { + if (typeof object.backup !== "object") + throw TypeError(".google.spanner.executor.v1.CloudBackupResponse.backup: object expected"); + message.backup = $root.google.spanner.admin.database.v1.Backup.fromObject(object.backup); + } + return message; + }; + + /** + * Creates a plain object from a CloudBackupResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.executor.v1.CloudBackupResponse + * @static + * @param {google.spanner.executor.v1.CloudBackupResponse} message CloudBackupResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CloudBackupResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.listedBackups = []; + object.listedBackupOperations = []; + } + if (options.defaults) { + object.nextPageToken = ""; + object.backup = null; + } + if (message.listedBackups && message.listedBackups.length) { + object.listedBackups = []; + for (var j = 0; j < message.listedBackups.length; ++j) + object.listedBackups[j] = $root.google.spanner.admin.database.v1.Backup.toObject(message.listedBackups[j], options); + } + if (message.listedBackupOperations && message.listedBackupOperations.length) { + object.listedBackupOperations = []; + for (var j = 0; j < message.listedBackupOperations.length; ++j) + object.listedBackupOperations[j] = $root.google.longrunning.Operation.toObject(message.listedBackupOperations[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.backup != null && message.hasOwnProperty("backup")) + object.backup = $root.google.spanner.admin.database.v1.Backup.toObject(message.backup, options); + return object; + }; + + /** + * Converts this CloudBackupResponse to JSON. + * @function toJSON + * @memberof google.spanner.executor.v1.CloudBackupResponse + * @instance + * @returns {Object.} JSON object + */ + CloudBackupResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CloudBackupResponse + * @function getTypeUrl + * @memberof google.spanner.executor.v1.CloudBackupResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CloudBackupResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.executor.v1.CloudBackupResponse"; + }; + + return CloudBackupResponse; + })(); + + v1.OperationResponse = (function() { + + /** + * Properties of an OperationResponse. + * @memberof google.spanner.executor.v1 + * @interface IOperationResponse + * @property {Array.|null} [listedOperations] OperationResponse listedOperations + * @property {string|null} [nextPageToken] OperationResponse nextPageToken + * @property {google.longrunning.IOperation|null} [operation] OperationResponse operation + */ + + /** + * Constructs a new OperationResponse. + * @memberof google.spanner.executor.v1 + * @classdesc Represents an OperationResponse. + * @implements IOperationResponse + * @constructor + * @param {google.spanner.executor.v1.IOperationResponse=} [properties] Properties to set + */ + function OperationResponse(properties) { + this.listedOperations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OperationResponse listedOperations. + * @member {Array.} listedOperations + * @memberof google.spanner.executor.v1.OperationResponse + * @instance + */ + OperationResponse.prototype.listedOperations = $util.emptyArray; + + /** + * OperationResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.spanner.executor.v1.OperationResponse + * @instance + */ + OperationResponse.prototype.nextPageToken = ""; + + /** + * OperationResponse operation. + * @member {google.longrunning.IOperation|null|undefined} operation + * @memberof google.spanner.executor.v1.OperationResponse + * @instance + */ + OperationResponse.prototype.operation = null; + + /** + * Creates a new OperationResponse instance using the specified properties. + * @function create + * @memberof google.spanner.executor.v1.OperationResponse + * @static + * @param {google.spanner.executor.v1.IOperationResponse=} [properties] Properties to set + * @returns {google.spanner.executor.v1.OperationResponse} OperationResponse instance + */ + OperationResponse.create = function create(properties) { + return new OperationResponse(properties); + }; + + /** + * Encodes the specified OperationResponse message. Does not implicitly {@link google.spanner.executor.v1.OperationResponse.verify|verify} messages. + * @function encode + * @memberof google.spanner.executor.v1.OperationResponse + * @static + * @param {google.spanner.executor.v1.IOperationResponse} message OperationResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.listedOperations != null && message.listedOperations.length) + for (var i = 0; i < message.listedOperations.length; ++i) + $root.google.longrunning.Operation.encode(message.listedOperations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.operation != null && Object.hasOwnProperty.call(message, "operation")) + $root.google.longrunning.Operation.encode(message.operation, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OperationResponse message, length delimited. Does not implicitly {@link google.spanner.executor.v1.OperationResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.executor.v1.OperationResponse + * @static + * @param {google.spanner.executor.v1.IOperationResponse} message OperationResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationResponse message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.executor.v1.OperationResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.executor.v1.OperationResponse} OperationResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.OperationResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.listedOperations && message.listedOperations.length)) + message.listedOperations = []; + message.listedOperations.push($root.google.longrunning.Operation.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + message.operation = $root.google.longrunning.Operation.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.executor.v1.OperationResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.executor.v1.OperationResponse} OperationResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationResponse message. + * @function verify + * @memberof google.spanner.executor.v1.OperationResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.listedOperations != null && message.hasOwnProperty("listedOperations")) { + if (!Array.isArray(message.listedOperations)) + return "listedOperations: array expected"; + for (var i = 0; i < message.listedOperations.length; ++i) { + var error = $root.google.longrunning.Operation.verify(message.listedOperations[i]); + if (error) + return "listedOperations." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.operation != null && message.hasOwnProperty("operation")) { + var error = $root.google.longrunning.Operation.verify(message.operation); + if (error) + return "operation." + error; + } + return null; + }; + + /** + * Creates an OperationResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.executor.v1.OperationResponse + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.executor.v1.OperationResponse} OperationResponse + */ + OperationResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.executor.v1.OperationResponse) + return object; + var message = new $root.google.spanner.executor.v1.OperationResponse(); + if (object.listedOperations) { + if (!Array.isArray(object.listedOperations)) + throw TypeError(".google.spanner.executor.v1.OperationResponse.listedOperations: array expected"); + message.listedOperations = []; + for (var i = 0; i < object.listedOperations.length; ++i) { + if (typeof object.listedOperations[i] !== "object") + throw TypeError(".google.spanner.executor.v1.OperationResponse.listedOperations: object expected"); + message.listedOperations[i] = $root.google.longrunning.Operation.fromObject(object.listedOperations[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.operation != null) { + if (typeof object.operation !== "object") + throw TypeError(".google.spanner.executor.v1.OperationResponse.operation: object expected"); + message.operation = $root.google.longrunning.Operation.fromObject(object.operation); + } + return message; + }; + + /** + * Creates a plain object from an OperationResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.executor.v1.OperationResponse + * @static + * @param {google.spanner.executor.v1.OperationResponse} message OperationResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.listedOperations = []; + if (options.defaults) { + object.nextPageToken = ""; + object.operation = null; + } + if (message.listedOperations && message.listedOperations.length) { + object.listedOperations = []; + for (var j = 0; j < message.listedOperations.length; ++j) + object.listedOperations[j] = $root.google.longrunning.Operation.toObject(message.listedOperations[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.operation != null && message.hasOwnProperty("operation")) + object.operation = $root.google.longrunning.Operation.toObject(message.operation, options); + return object; + }; + + /** + * Converts this OperationResponse to JSON. + * @function toJSON + * @memberof google.spanner.executor.v1.OperationResponse + * @instance + * @returns {Object.} JSON object + */ + OperationResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OperationResponse + * @function getTypeUrl + * @memberof google.spanner.executor.v1.OperationResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OperationResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.executor.v1.OperationResponse"; + }; + + return OperationResponse; + })(); + + v1.CloudInstanceResponse = (function() { + + /** + * Properties of a CloudInstanceResponse. + * @memberof google.spanner.executor.v1 + * @interface ICloudInstanceResponse + * @property {Array.|null} [listedInstances] CloudInstanceResponse listedInstances + * @property {string|null} [nextPageToken] CloudInstanceResponse nextPageToken + * @property {google.spanner.admin.instance.v1.IInstance|null} [instance] CloudInstanceResponse instance + */ + + /** + * Constructs a new CloudInstanceResponse. + * @memberof google.spanner.executor.v1 + * @classdesc Represents a CloudInstanceResponse. + * @implements ICloudInstanceResponse + * @constructor + * @param {google.spanner.executor.v1.ICloudInstanceResponse=} [properties] Properties to set + */ + function CloudInstanceResponse(properties) { + this.listedInstances = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CloudInstanceResponse listedInstances. + * @member {Array.} listedInstances + * @memberof google.spanner.executor.v1.CloudInstanceResponse + * @instance + */ + CloudInstanceResponse.prototype.listedInstances = $util.emptyArray; + + /** + * CloudInstanceResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.spanner.executor.v1.CloudInstanceResponse + * @instance + */ + CloudInstanceResponse.prototype.nextPageToken = ""; + + /** + * CloudInstanceResponse instance. + * @member {google.spanner.admin.instance.v1.IInstance|null|undefined} instance + * @memberof google.spanner.executor.v1.CloudInstanceResponse + * @instance + */ + CloudInstanceResponse.prototype.instance = null; + + /** + * Creates a new CloudInstanceResponse instance using the specified properties. + * @function create + * @memberof google.spanner.executor.v1.CloudInstanceResponse + * @static + * @param {google.spanner.executor.v1.ICloudInstanceResponse=} [properties] Properties to set + * @returns {google.spanner.executor.v1.CloudInstanceResponse} CloudInstanceResponse instance + */ + CloudInstanceResponse.create = function create(properties) { + return new CloudInstanceResponse(properties); + }; + + /** + * Encodes the specified CloudInstanceResponse message. Does not implicitly {@link google.spanner.executor.v1.CloudInstanceResponse.verify|verify} messages. + * @function encode + * @memberof google.spanner.executor.v1.CloudInstanceResponse + * @static + * @param {google.spanner.executor.v1.ICloudInstanceResponse} message CloudInstanceResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudInstanceResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.listedInstances != null && message.listedInstances.length) + for (var i = 0; i < message.listedInstances.length; ++i) + $root.google.spanner.admin.instance.v1.Instance.encode(message.listedInstances[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + $root.google.spanner.admin.instance.v1.Instance.encode(message.instance, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CloudInstanceResponse message, length delimited. Does not implicitly {@link google.spanner.executor.v1.CloudInstanceResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.executor.v1.CloudInstanceResponse + * @static + * @param {google.spanner.executor.v1.ICloudInstanceResponse} message CloudInstanceResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudInstanceResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CloudInstanceResponse message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.executor.v1.CloudInstanceResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.executor.v1.CloudInstanceResponse} CloudInstanceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudInstanceResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.CloudInstanceResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.listedInstances && message.listedInstances.length)) + message.listedInstances = []; + message.listedInstances.push($root.google.spanner.admin.instance.v1.Instance.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + message.instance = $root.google.spanner.admin.instance.v1.Instance.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CloudInstanceResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.executor.v1.CloudInstanceResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.executor.v1.CloudInstanceResponse} CloudInstanceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudInstanceResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CloudInstanceResponse message. + * @function verify + * @memberof google.spanner.executor.v1.CloudInstanceResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CloudInstanceResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.listedInstances != null && message.hasOwnProperty("listedInstances")) { + if (!Array.isArray(message.listedInstances)) + return "listedInstances: array expected"; + for (var i = 0; i < message.listedInstances.length; ++i) { + var error = $root.google.spanner.admin.instance.v1.Instance.verify(message.listedInstances[i]); + if (error) + return "listedInstances." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.instance != null && message.hasOwnProperty("instance")) { + var error = $root.google.spanner.admin.instance.v1.Instance.verify(message.instance); + if (error) + return "instance." + error; + } + return null; + }; + + /** + * Creates a CloudInstanceResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.executor.v1.CloudInstanceResponse + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.executor.v1.CloudInstanceResponse} CloudInstanceResponse + */ + CloudInstanceResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.executor.v1.CloudInstanceResponse) + return object; + var message = new $root.google.spanner.executor.v1.CloudInstanceResponse(); + if (object.listedInstances) { + if (!Array.isArray(object.listedInstances)) + throw TypeError(".google.spanner.executor.v1.CloudInstanceResponse.listedInstances: array expected"); + message.listedInstances = []; + for (var i = 0; i < object.listedInstances.length; ++i) { + if (typeof object.listedInstances[i] !== "object") + throw TypeError(".google.spanner.executor.v1.CloudInstanceResponse.listedInstances: object expected"); + message.listedInstances[i] = $root.google.spanner.admin.instance.v1.Instance.fromObject(object.listedInstances[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.instance != null) { + if (typeof object.instance !== "object") + throw TypeError(".google.spanner.executor.v1.CloudInstanceResponse.instance: object expected"); + message.instance = $root.google.spanner.admin.instance.v1.Instance.fromObject(object.instance); + } + return message; + }; + + /** + * Creates a plain object from a CloudInstanceResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.executor.v1.CloudInstanceResponse + * @static + * @param {google.spanner.executor.v1.CloudInstanceResponse} message CloudInstanceResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CloudInstanceResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.listedInstances = []; + if (options.defaults) { + object.nextPageToken = ""; + object.instance = null; + } + if (message.listedInstances && message.listedInstances.length) { + object.listedInstances = []; + for (var j = 0; j < message.listedInstances.length; ++j) + object.listedInstances[j] = $root.google.spanner.admin.instance.v1.Instance.toObject(message.listedInstances[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.instance != null && message.hasOwnProperty("instance")) + object.instance = $root.google.spanner.admin.instance.v1.Instance.toObject(message.instance, options); + return object; + }; + + /** + * Converts this CloudInstanceResponse to JSON. + * @function toJSON + * @memberof google.spanner.executor.v1.CloudInstanceResponse + * @instance + * @returns {Object.} JSON object + */ + CloudInstanceResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CloudInstanceResponse + * @function getTypeUrl + * @memberof google.spanner.executor.v1.CloudInstanceResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CloudInstanceResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.executor.v1.CloudInstanceResponse"; + }; + + return CloudInstanceResponse; + })(); + + v1.CloudInstanceConfigResponse = (function() { + + /** + * Properties of a CloudInstanceConfigResponse. + * @memberof google.spanner.executor.v1 + * @interface ICloudInstanceConfigResponse + * @property {Array.|null} [listedInstanceConfigs] CloudInstanceConfigResponse listedInstanceConfigs + * @property {string|null} [nextPageToken] CloudInstanceConfigResponse nextPageToken + * @property {google.spanner.admin.instance.v1.IInstanceConfig|null} [instanceConfig] CloudInstanceConfigResponse instanceConfig + */ + + /** + * Constructs a new CloudInstanceConfigResponse. + * @memberof google.spanner.executor.v1 + * @classdesc Represents a CloudInstanceConfigResponse. + * @implements ICloudInstanceConfigResponse + * @constructor + * @param {google.spanner.executor.v1.ICloudInstanceConfigResponse=} [properties] Properties to set + */ + function CloudInstanceConfigResponse(properties) { + this.listedInstanceConfigs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CloudInstanceConfigResponse listedInstanceConfigs. + * @member {Array.} listedInstanceConfigs + * @memberof google.spanner.executor.v1.CloudInstanceConfigResponse + * @instance + */ + CloudInstanceConfigResponse.prototype.listedInstanceConfigs = $util.emptyArray; + + /** + * CloudInstanceConfigResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.spanner.executor.v1.CloudInstanceConfigResponse + * @instance + */ + CloudInstanceConfigResponse.prototype.nextPageToken = ""; + + /** + * CloudInstanceConfigResponse instanceConfig. + * @member {google.spanner.admin.instance.v1.IInstanceConfig|null|undefined} instanceConfig + * @memberof google.spanner.executor.v1.CloudInstanceConfigResponse + * @instance + */ + CloudInstanceConfigResponse.prototype.instanceConfig = null; + + /** + * Creates a new CloudInstanceConfigResponse instance using the specified properties. + * @function create + * @memberof google.spanner.executor.v1.CloudInstanceConfigResponse + * @static + * @param {google.spanner.executor.v1.ICloudInstanceConfigResponse=} [properties] Properties to set + * @returns {google.spanner.executor.v1.CloudInstanceConfigResponse} CloudInstanceConfigResponse instance + */ + CloudInstanceConfigResponse.create = function create(properties) { + return new CloudInstanceConfigResponse(properties); + }; + + /** + * Encodes the specified CloudInstanceConfigResponse message. Does not implicitly {@link google.spanner.executor.v1.CloudInstanceConfigResponse.verify|verify} messages. + * @function encode + * @memberof google.spanner.executor.v1.CloudInstanceConfigResponse + * @static + * @param {google.spanner.executor.v1.ICloudInstanceConfigResponse} message CloudInstanceConfigResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudInstanceConfigResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.listedInstanceConfigs != null && message.listedInstanceConfigs.length) + for (var i = 0; i < message.listedInstanceConfigs.length; ++i) + $root.google.spanner.admin.instance.v1.InstanceConfig.encode(message.listedInstanceConfigs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.instanceConfig != null && Object.hasOwnProperty.call(message, "instanceConfig")) + $root.google.spanner.admin.instance.v1.InstanceConfig.encode(message.instanceConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CloudInstanceConfigResponse message, length delimited. Does not implicitly {@link google.spanner.executor.v1.CloudInstanceConfigResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.executor.v1.CloudInstanceConfigResponse + * @static + * @param {google.spanner.executor.v1.ICloudInstanceConfigResponse} message CloudInstanceConfigResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudInstanceConfigResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CloudInstanceConfigResponse message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.executor.v1.CloudInstanceConfigResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.executor.v1.CloudInstanceConfigResponse} CloudInstanceConfigResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudInstanceConfigResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.CloudInstanceConfigResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.listedInstanceConfigs && message.listedInstanceConfigs.length)) + message.listedInstanceConfigs = []; + message.listedInstanceConfigs.push($root.google.spanner.admin.instance.v1.InstanceConfig.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + message.instanceConfig = $root.google.spanner.admin.instance.v1.InstanceConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CloudInstanceConfigResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.executor.v1.CloudInstanceConfigResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.executor.v1.CloudInstanceConfigResponse} CloudInstanceConfigResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudInstanceConfigResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CloudInstanceConfigResponse message. + * @function verify + * @memberof google.spanner.executor.v1.CloudInstanceConfigResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CloudInstanceConfigResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.listedInstanceConfigs != null && message.hasOwnProperty("listedInstanceConfigs")) { + if (!Array.isArray(message.listedInstanceConfigs)) + return "listedInstanceConfigs: array expected"; + for (var i = 0; i < message.listedInstanceConfigs.length; ++i) { + var error = $root.google.spanner.admin.instance.v1.InstanceConfig.verify(message.listedInstanceConfigs[i]); + if (error) + return "listedInstanceConfigs." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.instanceConfig != null && message.hasOwnProperty("instanceConfig")) { + var error = $root.google.spanner.admin.instance.v1.InstanceConfig.verify(message.instanceConfig); + if (error) + return "instanceConfig." + error; + } + return null; + }; + + /** + * Creates a CloudInstanceConfigResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.executor.v1.CloudInstanceConfigResponse + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.executor.v1.CloudInstanceConfigResponse} CloudInstanceConfigResponse + */ + CloudInstanceConfigResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.executor.v1.CloudInstanceConfigResponse) + return object; + var message = new $root.google.spanner.executor.v1.CloudInstanceConfigResponse(); + if (object.listedInstanceConfigs) { + if (!Array.isArray(object.listedInstanceConfigs)) + throw TypeError(".google.spanner.executor.v1.CloudInstanceConfigResponse.listedInstanceConfigs: array expected"); + message.listedInstanceConfigs = []; + for (var i = 0; i < object.listedInstanceConfigs.length; ++i) { + if (typeof object.listedInstanceConfigs[i] !== "object") + throw TypeError(".google.spanner.executor.v1.CloudInstanceConfigResponse.listedInstanceConfigs: object expected"); + message.listedInstanceConfigs[i] = $root.google.spanner.admin.instance.v1.InstanceConfig.fromObject(object.listedInstanceConfigs[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.instanceConfig != null) { + if (typeof object.instanceConfig !== "object") + throw TypeError(".google.spanner.executor.v1.CloudInstanceConfigResponse.instanceConfig: object expected"); + message.instanceConfig = $root.google.spanner.admin.instance.v1.InstanceConfig.fromObject(object.instanceConfig); + } + return message; + }; + + /** + * Creates a plain object from a CloudInstanceConfigResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.executor.v1.CloudInstanceConfigResponse + * @static + * @param {google.spanner.executor.v1.CloudInstanceConfigResponse} message CloudInstanceConfigResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CloudInstanceConfigResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.listedInstanceConfigs = []; + if (options.defaults) { + object.nextPageToken = ""; + object.instanceConfig = null; + } + if (message.listedInstanceConfigs && message.listedInstanceConfigs.length) { + object.listedInstanceConfigs = []; + for (var j = 0; j < message.listedInstanceConfigs.length; ++j) + object.listedInstanceConfigs[j] = $root.google.spanner.admin.instance.v1.InstanceConfig.toObject(message.listedInstanceConfigs[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.instanceConfig != null && message.hasOwnProperty("instanceConfig")) + object.instanceConfig = $root.google.spanner.admin.instance.v1.InstanceConfig.toObject(message.instanceConfig, options); + return object; + }; + + /** + * Converts this CloudInstanceConfigResponse to JSON. + * @function toJSON + * @memberof google.spanner.executor.v1.CloudInstanceConfigResponse + * @instance + * @returns {Object.} JSON object + */ + CloudInstanceConfigResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CloudInstanceConfigResponse + * @function getTypeUrl + * @memberof google.spanner.executor.v1.CloudInstanceConfigResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CloudInstanceConfigResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.executor.v1.CloudInstanceConfigResponse"; + }; + + return CloudInstanceConfigResponse; + })(); + + v1.CloudDatabaseResponse = (function() { + + /** + * Properties of a CloudDatabaseResponse. + * @memberof google.spanner.executor.v1 + * @interface ICloudDatabaseResponse + * @property {Array.|null} [listedDatabases] CloudDatabaseResponse listedDatabases + * @property {Array.|null} [listedDatabaseOperations] CloudDatabaseResponse listedDatabaseOperations + * @property {string|null} [nextPageToken] CloudDatabaseResponse nextPageToken + * @property {google.spanner.admin.database.v1.IDatabase|null} [database] CloudDatabaseResponse database + */ + + /** + * Constructs a new CloudDatabaseResponse. + * @memberof google.spanner.executor.v1 + * @classdesc Represents a CloudDatabaseResponse. + * @implements ICloudDatabaseResponse + * @constructor + * @param {google.spanner.executor.v1.ICloudDatabaseResponse=} [properties] Properties to set + */ + function CloudDatabaseResponse(properties) { + this.listedDatabases = []; + this.listedDatabaseOperations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CloudDatabaseResponse listedDatabases. + * @member {Array.} listedDatabases + * @memberof google.spanner.executor.v1.CloudDatabaseResponse + * @instance + */ + CloudDatabaseResponse.prototype.listedDatabases = $util.emptyArray; + + /** + * CloudDatabaseResponse listedDatabaseOperations. + * @member {Array.} listedDatabaseOperations + * @memberof google.spanner.executor.v1.CloudDatabaseResponse + * @instance + */ + CloudDatabaseResponse.prototype.listedDatabaseOperations = $util.emptyArray; + + /** + * CloudDatabaseResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.spanner.executor.v1.CloudDatabaseResponse + * @instance + */ + CloudDatabaseResponse.prototype.nextPageToken = ""; + + /** + * CloudDatabaseResponse database. + * @member {google.spanner.admin.database.v1.IDatabase|null|undefined} database + * @memberof google.spanner.executor.v1.CloudDatabaseResponse + * @instance + */ + CloudDatabaseResponse.prototype.database = null; + + /** + * Creates a new CloudDatabaseResponse instance using the specified properties. + * @function create + * @memberof google.spanner.executor.v1.CloudDatabaseResponse + * @static + * @param {google.spanner.executor.v1.ICloudDatabaseResponse=} [properties] Properties to set + * @returns {google.spanner.executor.v1.CloudDatabaseResponse} CloudDatabaseResponse instance + */ + CloudDatabaseResponse.create = function create(properties) { + return new CloudDatabaseResponse(properties); + }; + + /** + * Encodes the specified CloudDatabaseResponse message. Does not implicitly {@link google.spanner.executor.v1.CloudDatabaseResponse.verify|verify} messages. + * @function encode + * @memberof google.spanner.executor.v1.CloudDatabaseResponse + * @static + * @param {google.spanner.executor.v1.ICloudDatabaseResponse} message CloudDatabaseResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudDatabaseResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.listedDatabases != null && message.listedDatabases.length) + for (var i = 0; i < message.listedDatabases.length; ++i) + $root.google.spanner.admin.database.v1.Database.encode(message.listedDatabases[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.listedDatabaseOperations != null && message.listedDatabaseOperations.length) + for (var i = 0; i < message.listedDatabaseOperations.length; ++i) + $root.google.longrunning.Operation.encode(message.listedDatabaseOperations[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); + if (message.database != null && Object.hasOwnProperty.call(message, "database")) + $root.google.spanner.admin.database.v1.Database.encode(message.database, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CloudDatabaseResponse message, length delimited. Does not implicitly {@link google.spanner.executor.v1.CloudDatabaseResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.executor.v1.CloudDatabaseResponse + * @static + * @param {google.spanner.executor.v1.ICloudDatabaseResponse} message CloudDatabaseResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudDatabaseResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CloudDatabaseResponse message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.executor.v1.CloudDatabaseResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.executor.v1.CloudDatabaseResponse} CloudDatabaseResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudDatabaseResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.CloudDatabaseResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.listedDatabases && message.listedDatabases.length)) + message.listedDatabases = []; + message.listedDatabases.push($root.google.spanner.admin.database.v1.Database.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.listedDatabaseOperations && message.listedDatabaseOperations.length)) + message.listedDatabaseOperations = []; + message.listedDatabaseOperations.push($root.google.longrunning.Operation.decode(reader, reader.uint32())); + break; + } + case 3: { + message.nextPageToken = reader.string(); + break; + } + case 4: { + message.database = $root.google.spanner.admin.database.v1.Database.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CloudDatabaseResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.executor.v1.CloudDatabaseResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.executor.v1.CloudDatabaseResponse} CloudDatabaseResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudDatabaseResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CloudDatabaseResponse message. + * @function verify + * @memberof google.spanner.executor.v1.CloudDatabaseResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CloudDatabaseResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.listedDatabases != null && message.hasOwnProperty("listedDatabases")) { + if (!Array.isArray(message.listedDatabases)) + return "listedDatabases: array expected"; + for (var i = 0; i < message.listedDatabases.length; ++i) { + var error = $root.google.spanner.admin.database.v1.Database.verify(message.listedDatabases[i]); + if (error) + return "listedDatabases." + error; + } + } + if (message.listedDatabaseOperations != null && message.hasOwnProperty("listedDatabaseOperations")) { + if (!Array.isArray(message.listedDatabaseOperations)) + return "listedDatabaseOperations: array expected"; + for (var i = 0; i < message.listedDatabaseOperations.length; ++i) { + var error = $root.google.longrunning.Operation.verify(message.listedDatabaseOperations[i]); + if (error) + return "listedDatabaseOperations." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.database != null && message.hasOwnProperty("database")) { + var error = $root.google.spanner.admin.database.v1.Database.verify(message.database); + if (error) + return "database." + error; + } + return null; + }; + + /** + * Creates a CloudDatabaseResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.executor.v1.CloudDatabaseResponse + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.executor.v1.CloudDatabaseResponse} CloudDatabaseResponse + */ + CloudDatabaseResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.executor.v1.CloudDatabaseResponse) + return object; + var message = new $root.google.spanner.executor.v1.CloudDatabaseResponse(); + if (object.listedDatabases) { + if (!Array.isArray(object.listedDatabases)) + throw TypeError(".google.spanner.executor.v1.CloudDatabaseResponse.listedDatabases: array expected"); + message.listedDatabases = []; + for (var i = 0; i < object.listedDatabases.length; ++i) { + if (typeof object.listedDatabases[i] !== "object") + throw TypeError(".google.spanner.executor.v1.CloudDatabaseResponse.listedDatabases: object expected"); + message.listedDatabases[i] = $root.google.spanner.admin.database.v1.Database.fromObject(object.listedDatabases[i]); + } + } + if (object.listedDatabaseOperations) { + if (!Array.isArray(object.listedDatabaseOperations)) + throw TypeError(".google.spanner.executor.v1.CloudDatabaseResponse.listedDatabaseOperations: array expected"); + message.listedDatabaseOperations = []; + for (var i = 0; i < object.listedDatabaseOperations.length; ++i) { + if (typeof object.listedDatabaseOperations[i] !== "object") + throw TypeError(".google.spanner.executor.v1.CloudDatabaseResponse.listedDatabaseOperations: object expected"); + message.listedDatabaseOperations[i] = $root.google.longrunning.Operation.fromObject(object.listedDatabaseOperations[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.database != null) { + if (typeof object.database !== "object") + throw TypeError(".google.spanner.executor.v1.CloudDatabaseResponse.database: object expected"); + message.database = $root.google.spanner.admin.database.v1.Database.fromObject(object.database); + } + return message; + }; + + /** + * Creates a plain object from a CloudDatabaseResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.executor.v1.CloudDatabaseResponse + * @static + * @param {google.spanner.executor.v1.CloudDatabaseResponse} message CloudDatabaseResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CloudDatabaseResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.listedDatabases = []; + object.listedDatabaseOperations = []; + } + if (options.defaults) { + object.nextPageToken = ""; + object.database = null; + } + if (message.listedDatabases && message.listedDatabases.length) { + object.listedDatabases = []; + for (var j = 0; j < message.listedDatabases.length; ++j) + object.listedDatabases[j] = $root.google.spanner.admin.database.v1.Database.toObject(message.listedDatabases[j], options); + } + if (message.listedDatabaseOperations && message.listedDatabaseOperations.length) { + object.listedDatabaseOperations = []; + for (var j = 0; j < message.listedDatabaseOperations.length; ++j) + object.listedDatabaseOperations[j] = $root.google.longrunning.Operation.toObject(message.listedDatabaseOperations[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.database != null && message.hasOwnProperty("database")) + object.database = $root.google.spanner.admin.database.v1.Database.toObject(message.database, options); + return object; + }; + + /** + * Converts this CloudDatabaseResponse to JSON. + * @function toJSON + * @memberof google.spanner.executor.v1.CloudDatabaseResponse + * @instance + * @returns {Object.} JSON object + */ + CloudDatabaseResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CloudDatabaseResponse + * @function getTypeUrl + * @memberof google.spanner.executor.v1.CloudDatabaseResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CloudDatabaseResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.executor.v1.CloudDatabaseResponse"; + }; + + return CloudDatabaseResponse; + })(); + + v1.ReadResult = (function() { + + /** + * Properties of a ReadResult. + * @memberof google.spanner.executor.v1 + * @interface IReadResult + * @property {string|null} [table] ReadResult table + * @property {string|null} [index] ReadResult index + * @property {number|null} [requestIndex] ReadResult requestIndex + * @property {Array.|null} [row] ReadResult row + * @property {google.spanner.v1.IStructType|null} [rowType] ReadResult rowType + */ + + /** + * Constructs a new ReadResult. + * @memberof google.spanner.executor.v1 + * @classdesc Represents a ReadResult. + * @implements IReadResult + * @constructor + * @param {google.spanner.executor.v1.IReadResult=} [properties] Properties to set + */ + function ReadResult(properties) { + this.row = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReadResult table. + * @member {string} table + * @memberof google.spanner.executor.v1.ReadResult + * @instance + */ + ReadResult.prototype.table = ""; + + /** + * ReadResult index. + * @member {string|null|undefined} index + * @memberof google.spanner.executor.v1.ReadResult + * @instance + */ + ReadResult.prototype.index = null; + + /** + * ReadResult requestIndex. + * @member {number|null|undefined} requestIndex + * @memberof google.spanner.executor.v1.ReadResult + * @instance + */ + ReadResult.prototype.requestIndex = null; + + /** + * ReadResult row. + * @member {Array.} row + * @memberof google.spanner.executor.v1.ReadResult + * @instance + */ + ReadResult.prototype.row = $util.emptyArray; + + /** + * ReadResult rowType. + * @member {google.spanner.v1.IStructType|null|undefined} rowType + * @memberof google.spanner.executor.v1.ReadResult + * @instance + */ + ReadResult.prototype.rowType = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ReadResult.prototype, "_index", { + get: $util.oneOfGetter($oneOfFields = ["index"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ReadResult.prototype, "_requestIndex", { + get: $util.oneOfGetter($oneOfFields = ["requestIndex"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ReadResult.prototype, "_rowType", { + get: $util.oneOfGetter($oneOfFields = ["rowType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ReadResult instance using the specified properties. + * @function create + * @memberof google.spanner.executor.v1.ReadResult + * @static + * @param {google.spanner.executor.v1.IReadResult=} [properties] Properties to set + * @returns {google.spanner.executor.v1.ReadResult} ReadResult instance + */ + ReadResult.create = function create(properties) { + return new ReadResult(properties); + }; + + /** + * Encodes the specified ReadResult message. Does not implicitly {@link google.spanner.executor.v1.ReadResult.verify|verify} messages. + * @function encode + * @memberof google.spanner.executor.v1.ReadResult + * @static + * @param {google.spanner.executor.v1.IReadResult} message ReadResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.table != null && Object.hasOwnProperty.call(message, "table")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.table); + if (message.index != null && Object.hasOwnProperty.call(message, "index")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.index); + if (message.requestIndex != null && Object.hasOwnProperty.call(message, "requestIndex")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.requestIndex); + if (message.row != null && message.row.length) + for (var i = 0; i < message.row.length; ++i) + $root.google.spanner.executor.v1.ValueList.encode(message.row[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.rowType != null && Object.hasOwnProperty.call(message, "rowType")) + $root.google.spanner.v1.StructType.encode(message.rowType, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ReadResult message, length delimited. Does not implicitly {@link google.spanner.executor.v1.ReadResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.executor.v1.ReadResult + * @static + * @param {google.spanner.executor.v1.IReadResult} message ReadResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReadResult message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.executor.v1.ReadResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.executor.v1.ReadResult} ReadResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadResult.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.ReadResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.table = reader.string(); + break; + } + case 2: { + message.index = reader.string(); + break; + } + case 3: { + message.requestIndex = reader.int32(); + break; + } + case 4: { + if (!(message.row && message.row.length)) + message.row = []; + message.row.push($root.google.spanner.executor.v1.ValueList.decode(reader, reader.uint32())); + break; + } + case 5: { + message.rowType = $root.google.spanner.v1.StructType.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReadResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.executor.v1.ReadResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.executor.v1.ReadResult} ReadResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReadResult message. + * @function verify + * @memberof google.spanner.executor.v1.ReadResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReadResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.table != null && message.hasOwnProperty("table")) + if (!$util.isString(message.table)) + return "table: string expected"; + if (message.index != null && message.hasOwnProperty("index")) { + properties._index = 1; + if (!$util.isString(message.index)) + return "index: string expected"; + } + if (message.requestIndex != null && message.hasOwnProperty("requestIndex")) { + properties._requestIndex = 1; + if (!$util.isInteger(message.requestIndex)) + return "requestIndex: integer expected"; + } + if (message.row != null && message.hasOwnProperty("row")) { + if (!Array.isArray(message.row)) + return "row: array expected"; + for (var i = 0; i < message.row.length; ++i) { + var error = $root.google.spanner.executor.v1.ValueList.verify(message.row[i]); + if (error) + return "row." + error; + } + } + if (message.rowType != null && message.hasOwnProperty("rowType")) { + properties._rowType = 1; + { + var error = $root.google.spanner.v1.StructType.verify(message.rowType); + if (error) + return "rowType." + error; + } + } + return null; + }; + + /** + * Creates a ReadResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.executor.v1.ReadResult + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.executor.v1.ReadResult} ReadResult + */ + ReadResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.executor.v1.ReadResult) + return object; + var message = new $root.google.spanner.executor.v1.ReadResult(); + if (object.table != null) + message.table = String(object.table); + if (object.index != null) + message.index = String(object.index); + if (object.requestIndex != null) + message.requestIndex = object.requestIndex | 0; + if (object.row) { + if (!Array.isArray(object.row)) + throw TypeError(".google.spanner.executor.v1.ReadResult.row: array expected"); + message.row = []; + for (var i = 0; i < object.row.length; ++i) { + if (typeof object.row[i] !== "object") + throw TypeError(".google.spanner.executor.v1.ReadResult.row: object expected"); + message.row[i] = $root.google.spanner.executor.v1.ValueList.fromObject(object.row[i]); + } + } + if (object.rowType != null) { + if (typeof object.rowType !== "object") + throw TypeError(".google.spanner.executor.v1.ReadResult.rowType: object expected"); + message.rowType = $root.google.spanner.v1.StructType.fromObject(object.rowType); + } + return message; + }; + + /** + * Creates a plain object from a ReadResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.executor.v1.ReadResult + * @static + * @param {google.spanner.executor.v1.ReadResult} message ReadResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReadResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.row = []; + if (options.defaults) + object.table = ""; + if (message.table != null && message.hasOwnProperty("table")) + object.table = message.table; + if (message.index != null && message.hasOwnProperty("index")) { + object.index = message.index; + if (options.oneofs) + object._index = "index"; + } + if (message.requestIndex != null && message.hasOwnProperty("requestIndex")) { + object.requestIndex = message.requestIndex; + if (options.oneofs) + object._requestIndex = "requestIndex"; + } + if (message.row && message.row.length) { + object.row = []; + for (var j = 0; j < message.row.length; ++j) + object.row[j] = $root.google.spanner.executor.v1.ValueList.toObject(message.row[j], options); + } + if (message.rowType != null && message.hasOwnProperty("rowType")) { + object.rowType = $root.google.spanner.v1.StructType.toObject(message.rowType, options); + if (options.oneofs) + object._rowType = "rowType"; + } + return object; + }; + + /** + * Converts this ReadResult to JSON. + * @function toJSON + * @memberof google.spanner.executor.v1.ReadResult + * @instance + * @returns {Object.} JSON object + */ + ReadResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReadResult + * @function getTypeUrl + * @memberof google.spanner.executor.v1.ReadResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReadResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.executor.v1.ReadResult"; + }; + + return ReadResult; + })(); + + v1.QueryResult = (function() { + + /** + * Properties of a QueryResult. + * @memberof google.spanner.executor.v1 + * @interface IQueryResult + * @property {Array.|null} [row] QueryResult row + * @property {google.spanner.v1.IStructType|null} [rowType] QueryResult rowType + */ + + /** + * Constructs a new QueryResult. + * @memberof google.spanner.executor.v1 + * @classdesc Represents a QueryResult. + * @implements IQueryResult + * @constructor + * @param {google.spanner.executor.v1.IQueryResult=} [properties] Properties to set + */ + function QueryResult(properties) { + this.row = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryResult row. + * @member {Array.} row + * @memberof google.spanner.executor.v1.QueryResult + * @instance + */ + QueryResult.prototype.row = $util.emptyArray; + + /** + * QueryResult rowType. + * @member {google.spanner.v1.IStructType|null|undefined} rowType + * @memberof google.spanner.executor.v1.QueryResult + * @instance + */ + QueryResult.prototype.rowType = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(QueryResult.prototype, "_rowType", { + get: $util.oneOfGetter($oneOfFields = ["rowType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new QueryResult instance using the specified properties. + * @function create + * @memberof google.spanner.executor.v1.QueryResult + * @static + * @param {google.spanner.executor.v1.IQueryResult=} [properties] Properties to set + * @returns {google.spanner.executor.v1.QueryResult} QueryResult instance + */ + QueryResult.create = function create(properties) { + return new QueryResult(properties); + }; + + /** + * Encodes the specified QueryResult message. Does not implicitly {@link google.spanner.executor.v1.QueryResult.verify|verify} messages. + * @function encode + * @memberof google.spanner.executor.v1.QueryResult + * @static + * @param {google.spanner.executor.v1.IQueryResult} message QueryResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.row != null && message.row.length) + for (var i = 0; i < message.row.length; ++i) + $root.google.spanner.executor.v1.ValueList.encode(message.row[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.rowType != null && Object.hasOwnProperty.call(message, "rowType")) + $root.google.spanner.v1.StructType.encode(message.rowType, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryResult message, length delimited. Does not implicitly {@link google.spanner.executor.v1.QueryResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.executor.v1.QueryResult + * @static + * @param {google.spanner.executor.v1.IQueryResult} message QueryResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryResult message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.executor.v1.QueryResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.executor.v1.QueryResult} QueryResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryResult.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.QueryResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.row && message.row.length)) + message.row = []; + message.row.push($root.google.spanner.executor.v1.ValueList.decode(reader, reader.uint32())); + break; + } + case 2: { + message.rowType = $root.google.spanner.v1.StructType.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.executor.v1.QueryResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.executor.v1.QueryResult} QueryResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryResult message. + * @function verify + * @memberof google.spanner.executor.v1.QueryResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.row != null && message.hasOwnProperty("row")) { + if (!Array.isArray(message.row)) + return "row: array expected"; + for (var i = 0; i < message.row.length; ++i) { + var error = $root.google.spanner.executor.v1.ValueList.verify(message.row[i]); + if (error) + return "row." + error; + } + } + if (message.rowType != null && message.hasOwnProperty("rowType")) { + properties._rowType = 1; + { + var error = $root.google.spanner.v1.StructType.verify(message.rowType); + if (error) + return "rowType." + error; + } + } + return null; + }; + + /** + * Creates a QueryResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.executor.v1.QueryResult + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.executor.v1.QueryResult} QueryResult + */ + QueryResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.executor.v1.QueryResult) + return object; + var message = new $root.google.spanner.executor.v1.QueryResult(); + if (object.row) { + if (!Array.isArray(object.row)) + throw TypeError(".google.spanner.executor.v1.QueryResult.row: array expected"); + message.row = []; + for (var i = 0; i < object.row.length; ++i) { + if (typeof object.row[i] !== "object") + throw TypeError(".google.spanner.executor.v1.QueryResult.row: object expected"); + message.row[i] = $root.google.spanner.executor.v1.ValueList.fromObject(object.row[i]); + } + } + if (object.rowType != null) { + if (typeof object.rowType !== "object") + throw TypeError(".google.spanner.executor.v1.QueryResult.rowType: object expected"); + message.rowType = $root.google.spanner.v1.StructType.fromObject(object.rowType); + } + return message; + }; + + /** + * Creates a plain object from a QueryResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.executor.v1.QueryResult + * @static + * @param {google.spanner.executor.v1.QueryResult} message QueryResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.row = []; + if (message.row && message.row.length) { + object.row = []; + for (var j = 0; j < message.row.length; ++j) + object.row[j] = $root.google.spanner.executor.v1.ValueList.toObject(message.row[j], options); + } + if (message.rowType != null && message.hasOwnProperty("rowType")) { + object.rowType = $root.google.spanner.v1.StructType.toObject(message.rowType, options); + if (options.oneofs) + object._rowType = "rowType"; + } + return object; + }; + + /** + * Converts this QueryResult to JSON. + * @function toJSON + * @memberof google.spanner.executor.v1.QueryResult + * @instance + * @returns {Object.} JSON object + */ + QueryResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for QueryResult + * @function getTypeUrl + * @memberof google.spanner.executor.v1.QueryResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + QueryResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.executor.v1.QueryResult"; + }; + + return QueryResult; + })(); + + v1.ChangeStreamRecord = (function() { + + /** + * Properties of a ChangeStreamRecord. + * @memberof google.spanner.executor.v1 + * @interface IChangeStreamRecord + * @property {google.spanner.executor.v1.IDataChangeRecord|null} [dataChange] ChangeStreamRecord dataChange + * @property {google.spanner.executor.v1.IChildPartitionsRecord|null} [childPartition] ChangeStreamRecord childPartition + * @property {google.spanner.executor.v1.IHeartbeatRecord|null} [heartbeat] ChangeStreamRecord heartbeat + */ + + /** + * Constructs a new ChangeStreamRecord. + * @memberof google.spanner.executor.v1 + * @classdesc Represents a ChangeStreamRecord. + * @implements IChangeStreamRecord + * @constructor + * @param {google.spanner.executor.v1.IChangeStreamRecord=} [properties] Properties to set + */ + function ChangeStreamRecord(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ChangeStreamRecord dataChange. + * @member {google.spanner.executor.v1.IDataChangeRecord|null|undefined} dataChange + * @memberof google.spanner.executor.v1.ChangeStreamRecord + * @instance + */ + ChangeStreamRecord.prototype.dataChange = null; + + /** + * ChangeStreamRecord childPartition. + * @member {google.spanner.executor.v1.IChildPartitionsRecord|null|undefined} childPartition + * @memberof google.spanner.executor.v1.ChangeStreamRecord + * @instance + */ + ChangeStreamRecord.prototype.childPartition = null; + + /** + * ChangeStreamRecord heartbeat. + * @member {google.spanner.executor.v1.IHeartbeatRecord|null|undefined} heartbeat + * @memberof google.spanner.executor.v1.ChangeStreamRecord + * @instance + */ + ChangeStreamRecord.prototype.heartbeat = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ChangeStreamRecord record. + * @member {"dataChange"|"childPartition"|"heartbeat"|undefined} record + * @memberof google.spanner.executor.v1.ChangeStreamRecord + * @instance + */ + Object.defineProperty(ChangeStreamRecord.prototype, "record", { + get: $util.oneOfGetter($oneOfFields = ["dataChange", "childPartition", "heartbeat"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ChangeStreamRecord instance using the specified properties. + * @function create + * @memberof google.spanner.executor.v1.ChangeStreamRecord + * @static + * @param {google.spanner.executor.v1.IChangeStreamRecord=} [properties] Properties to set + * @returns {google.spanner.executor.v1.ChangeStreamRecord} ChangeStreamRecord instance + */ + ChangeStreamRecord.create = function create(properties) { + return new ChangeStreamRecord(properties); + }; + + /** + * Encodes the specified ChangeStreamRecord message. Does not implicitly {@link google.spanner.executor.v1.ChangeStreamRecord.verify|verify} messages. + * @function encode + * @memberof google.spanner.executor.v1.ChangeStreamRecord + * @static + * @param {google.spanner.executor.v1.IChangeStreamRecord} message ChangeStreamRecord message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ChangeStreamRecord.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataChange != null && Object.hasOwnProperty.call(message, "dataChange")) + $root.google.spanner.executor.v1.DataChangeRecord.encode(message.dataChange, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.childPartition != null && Object.hasOwnProperty.call(message, "childPartition")) + $root.google.spanner.executor.v1.ChildPartitionsRecord.encode(message.childPartition, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.heartbeat != null && Object.hasOwnProperty.call(message, "heartbeat")) + $root.google.spanner.executor.v1.HeartbeatRecord.encode(message.heartbeat, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ChangeStreamRecord message, length delimited. Does not implicitly {@link google.spanner.executor.v1.ChangeStreamRecord.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.executor.v1.ChangeStreamRecord + * @static + * @param {google.spanner.executor.v1.IChangeStreamRecord} message ChangeStreamRecord message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ChangeStreamRecord.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ChangeStreamRecord message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.executor.v1.ChangeStreamRecord + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.executor.v1.ChangeStreamRecord} ChangeStreamRecord + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ChangeStreamRecord.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.ChangeStreamRecord(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.dataChange = $root.google.spanner.executor.v1.DataChangeRecord.decode(reader, reader.uint32()); + break; + } + case 2: { + message.childPartition = $root.google.spanner.executor.v1.ChildPartitionsRecord.decode(reader, reader.uint32()); + break; + } + case 3: { + message.heartbeat = $root.google.spanner.executor.v1.HeartbeatRecord.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ChangeStreamRecord message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.executor.v1.ChangeStreamRecord + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.executor.v1.ChangeStreamRecord} ChangeStreamRecord + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ChangeStreamRecord.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ChangeStreamRecord message. + * @function verify + * @memberof google.spanner.executor.v1.ChangeStreamRecord + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ChangeStreamRecord.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.dataChange != null && message.hasOwnProperty("dataChange")) { + properties.record = 1; + { + var error = $root.google.spanner.executor.v1.DataChangeRecord.verify(message.dataChange); + if (error) + return "dataChange." + error; + } + } + if (message.childPartition != null && message.hasOwnProperty("childPartition")) { + if (properties.record === 1) + return "record: multiple values"; + properties.record = 1; + { + var error = $root.google.spanner.executor.v1.ChildPartitionsRecord.verify(message.childPartition); + if (error) + return "childPartition." + error; + } + } + if (message.heartbeat != null && message.hasOwnProperty("heartbeat")) { + if (properties.record === 1) + return "record: multiple values"; + properties.record = 1; + { + var error = $root.google.spanner.executor.v1.HeartbeatRecord.verify(message.heartbeat); + if (error) + return "heartbeat." + error; + } + } + return null; + }; + + /** + * Creates a ChangeStreamRecord message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.executor.v1.ChangeStreamRecord + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.executor.v1.ChangeStreamRecord} ChangeStreamRecord + */ + ChangeStreamRecord.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.executor.v1.ChangeStreamRecord) + return object; + var message = new $root.google.spanner.executor.v1.ChangeStreamRecord(); + if (object.dataChange != null) { + if (typeof object.dataChange !== "object") + throw TypeError(".google.spanner.executor.v1.ChangeStreamRecord.dataChange: object expected"); + message.dataChange = $root.google.spanner.executor.v1.DataChangeRecord.fromObject(object.dataChange); + } + if (object.childPartition != null) { + if (typeof object.childPartition !== "object") + throw TypeError(".google.spanner.executor.v1.ChangeStreamRecord.childPartition: object expected"); + message.childPartition = $root.google.spanner.executor.v1.ChildPartitionsRecord.fromObject(object.childPartition); + } + if (object.heartbeat != null) { + if (typeof object.heartbeat !== "object") + throw TypeError(".google.spanner.executor.v1.ChangeStreamRecord.heartbeat: object expected"); + message.heartbeat = $root.google.spanner.executor.v1.HeartbeatRecord.fromObject(object.heartbeat); + } + return message; + }; + + /** + * Creates a plain object from a ChangeStreamRecord message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.executor.v1.ChangeStreamRecord + * @static + * @param {google.spanner.executor.v1.ChangeStreamRecord} message ChangeStreamRecord + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ChangeStreamRecord.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.dataChange != null && message.hasOwnProperty("dataChange")) { + object.dataChange = $root.google.spanner.executor.v1.DataChangeRecord.toObject(message.dataChange, options); + if (options.oneofs) + object.record = "dataChange"; + } + if (message.childPartition != null && message.hasOwnProperty("childPartition")) { + object.childPartition = $root.google.spanner.executor.v1.ChildPartitionsRecord.toObject(message.childPartition, options); + if (options.oneofs) + object.record = "childPartition"; + } + if (message.heartbeat != null && message.hasOwnProperty("heartbeat")) { + object.heartbeat = $root.google.spanner.executor.v1.HeartbeatRecord.toObject(message.heartbeat, options); + if (options.oneofs) + object.record = "heartbeat"; + } + return object; + }; + + /** + * Converts this ChangeStreamRecord to JSON. + * @function toJSON + * @memberof google.spanner.executor.v1.ChangeStreamRecord + * @instance + * @returns {Object.} JSON object + */ + ChangeStreamRecord.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ChangeStreamRecord + * @function getTypeUrl + * @memberof google.spanner.executor.v1.ChangeStreamRecord + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ChangeStreamRecord.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.executor.v1.ChangeStreamRecord"; + }; + + return ChangeStreamRecord; + })(); + + v1.DataChangeRecord = (function() { + + /** + * Properties of a DataChangeRecord. + * @memberof google.spanner.executor.v1 + * @interface IDataChangeRecord + * @property {google.protobuf.ITimestamp|null} [commitTime] DataChangeRecord commitTime + * @property {string|null} [recordSequence] DataChangeRecord recordSequence + * @property {string|null} [transactionId] DataChangeRecord transactionId + * @property {boolean|null} [isLastRecord] DataChangeRecord isLastRecord + * @property {string|null} [table] DataChangeRecord table + * @property {Array.|null} [columnTypes] DataChangeRecord columnTypes + * @property {Array.|null} [mods] DataChangeRecord mods + * @property {string|null} [modType] DataChangeRecord modType + * @property {string|null} [valueCaptureType] DataChangeRecord valueCaptureType + * @property {number|Long|null} [recordCount] DataChangeRecord recordCount + * @property {number|Long|null} [partitionCount] DataChangeRecord partitionCount + * @property {string|null} [transactionTag] DataChangeRecord transactionTag + * @property {boolean|null} [isSystemTransaction] DataChangeRecord isSystemTransaction + */ + + /** + * Constructs a new DataChangeRecord. + * @memberof google.spanner.executor.v1 + * @classdesc Represents a DataChangeRecord. + * @implements IDataChangeRecord + * @constructor + * @param {google.spanner.executor.v1.IDataChangeRecord=} [properties] Properties to set + */ + function DataChangeRecord(properties) { + this.columnTypes = []; + this.mods = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DataChangeRecord commitTime. + * @member {google.protobuf.ITimestamp|null|undefined} commitTime + * @memberof google.spanner.executor.v1.DataChangeRecord + * @instance + */ + DataChangeRecord.prototype.commitTime = null; + + /** + * DataChangeRecord recordSequence. + * @member {string} recordSequence + * @memberof google.spanner.executor.v1.DataChangeRecord + * @instance + */ + DataChangeRecord.prototype.recordSequence = ""; + + /** + * DataChangeRecord transactionId. + * @member {string} transactionId + * @memberof google.spanner.executor.v1.DataChangeRecord + * @instance + */ + DataChangeRecord.prototype.transactionId = ""; + + /** + * DataChangeRecord isLastRecord. + * @member {boolean} isLastRecord + * @memberof google.spanner.executor.v1.DataChangeRecord + * @instance + */ + DataChangeRecord.prototype.isLastRecord = false; + + /** + * DataChangeRecord table. + * @member {string} table + * @memberof google.spanner.executor.v1.DataChangeRecord + * @instance + */ + DataChangeRecord.prototype.table = ""; + + /** + * DataChangeRecord columnTypes. + * @member {Array.} columnTypes + * @memberof google.spanner.executor.v1.DataChangeRecord + * @instance + */ + DataChangeRecord.prototype.columnTypes = $util.emptyArray; + + /** + * DataChangeRecord mods. + * @member {Array.} mods + * @memberof google.spanner.executor.v1.DataChangeRecord + * @instance + */ + DataChangeRecord.prototype.mods = $util.emptyArray; + + /** + * DataChangeRecord modType. + * @member {string} modType + * @memberof google.spanner.executor.v1.DataChangeRecord + * @instance + */ + DataChangeRecord.prototype.modType = ""; + + /** + * DataChangeRecord valueCaptureType. + * @member {string} valueCaptureType + * @memberof google.spanner.executor.v1.DataChangeRecord + * @instance + */ + DataChangeRecord.prototype.valueCaptureType = ""; + + /** + * DataChangeRecord recordCount. + * @member {number|Long} recordCount + * @memberof google.spanner.executor.v1.DataChangeRecord + * @instance + */ + DataChangeRecord.prototype.recordCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * DataChangeRecord partitionCount. + * @member {number|Long} partitionCount + * @memberof google.spanner.executor.v1.DataChangeRecord + * @instance + */ + DataChangeRecord.prototype.partitionCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * DataChangeRecord transactionTag. + * @member {string} transactionTag + * @memberof google.spanner.executor.v1.DataChangeRecord + * @instance + */ + DataChangeRecord.prototype.transactionTag = ""; + + /** + * DataChangeRecord isSystemTransaction. + * @member {boolean} isSystemTransaction + * @memberof google.spanner.executor.v1.DataChangeRecord + * @instance + */ + DataChangeRecord.prototype.isSystemTransaction = false; + + /** + * Creates a new DataChangeRecord instance using the specified properties. + * @function create + * @memberof google.spanner.executor.v1.DataChangeRecord + * @static + * @param {google.spanner.executor.v1.IDataChangeRecord=} [properties] Properties to set + * @returns {google.spanner.executor.v1.DataChangeRecord} DataChangeRecord instance + */ + DataChangeRecord.create = function create(properties) { + return new DataChangeRecord(properties); + }; + + /** + * Encodes the specified DataChangeRecord message. Does not implicitly {@link google.spanner.executor.v1.DataChangeRecord.verify|verify} messages. + * @function encode + * @memberof google.spanner.executor.v1.DataChangeRecord + * @static + * @param {google.spanner.executor.v1.IDataChangeRecord} message DataChangeRecord message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataChangeRecord.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.commitTime != null && Object.hasOwnProperty.call(message, "commitTime")) + $root.google.protobuf.Timestamp.encode(message.commitTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.recordSequence != null && Object.hasOwnProperty.call(message, "recordSequence")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.recordSequence); + if (message.transactionId != null && Object.hasOwnProperty.call(message, "transactionId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.transactionId); + if (message.isLastRecord != null && Object.hasOwnProperty.call(message, "isLastRecord")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.isLastRecord); + if (message.table != null && Object.hasOwnProperty.call(message, "table")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.table); + if (message.columnTypes != null && message.columnTypes.length) + for (var i = 0; i < message.columnTypes.length; ++i) + $root.google.spanner.executor.v1.DataChangeRecord.ColumnType.encode(message.columnTypes[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.mods != null && message.mods.length) + for (var i = 0; i < message.mods.length; ++i) + $root.google.spanner.executor.v1.DataChangeRecord.Mod.encode(message.mods[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.modType != null && Object.hasOwnProperty.call(message, "modType")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.modType); + if (message.valueCaptureType != null && Object.hasOwnProperty.call(message, "valueCaptureType")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.valueCaptureType); + if (message.recordCount != null && Object.hasOwnProperty.call(message, "recordCount")) + writer.uint32(/* id 10, wireType 0 =*/80).int64(message.recordCount); + if (message.partitionCount != null && Object.hasOwnProperty.call(message, "partitionCount")) + writer.uint32(/* id 11, wireType 0 =*/88).int64(message.partitionCount); + if (message.transactionTag != null && Object.hasOwnProperty.call(message, "transactionTag")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.transactionTag); + if (message.isSystemTransaction != null && Object.hasOwnProperty.call(message, "isSystemTransaction")) + writer.uint32(/* id 13, wireType 0 =*/104).bool(message.isSystemTransaction); + return writer; + }; + + /** + * Encodes the specified DataChangeRecord message, length delimited. Does not implicitly {@link google.spanner.executor.v1.DataChangeRecord.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.executor.v1.DataChangeRecord + * @static + * @param {google.spanner.executor.v1.IDataChangeRecord} message DataChangeRecord message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataChangeRecord.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DataChangeRecord message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.executor.v1.DataChangeRecord + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.executor.v1.DataChangeRecord} DataChangeRecord + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataChangeRecord.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.DataChangeRecord(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.commitTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.recordSequence = reader.string(); + break; + } + case 3: { + message.transactionId = reader.string(); + break; + } + case 4: { + message.isLastRecord = reader.bool(); + break; + } + case 5: { + message.table = reader.string(); + break; + } + case 6: { + if (!(message.columnTypes && message.columnTypes.length)) + message.columnTypes = []; + message.columnTypes.push($root.google.spanner.executor.v1.DataChangeRecord.ColumnType.decode(reader, reader.uint32())); + break; + } + case 7: { + if (!(message.mods && message.mods.length)) + message.mods = []; + message.mods.push($root.google.spanner.executor.v1.DataChangeRecord.Mod.decode(reader, reader.uint32())); + break; + } + case 8: { + message.modType = reader.string(); + break; + } + case 9: { + message.valueCaptureType = reader.string(); + break; + } + case 10: { + message.recordCount = reader.int64(); + break; + } + case 11: { + message.partitionCount = reader.int64(); + break; + } + case 12: { + message.transactionTag = reader.string(); + break; + } + case 13: { + message.isSystemTransaction = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DataChangeRecord message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.executor.v1.DataChangeRecord + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.executor.v1.DataChangeRecord} DataChangeRecord + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataChangeRecord.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataChangeRecord message. + * @function verify + * @memberof google.spanner.executor.v1.DataChangeRecord + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataChangeRecord.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.commitTime != null && message.hasOwnProperty("commitTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.commitTime); + if (error) + return "commitTime." + error; + } + if (message.recordSequence != null && message.hasOwnProperty("recordSequence")) + if (!$util.isString(message.recordSequence)) + return "recordSequence: string expected"; + if (message.transactionId != null && message.hasOwnProperty("transactionId")) + if (!$util.isString(message.transactionId)) + return "transactionId: string expected"; + if (message.isLastRecord != null && message.hasOwnProperty("isLastRecord")) + if (typeof message.isLastRecord !== "boolean") + return "isLastRecord: boolean expected"; + if (message.table != null && message.hasOwnProperty("table")) + if (!$util.isString(message.table)) + return "table: string expected"; + if (message.columnTypes != null && message.hasOwnProperty("columnTypes")) { + if (!Array.isArray(message.columnTypes)) + return "columnTypes: array expected"; + for (var i = 0; i < message.columnTypes.length; ++i) { + var error = $root.google.spanner.executor.v1.DataChangeRecord.ColumnType.verify(message.columnTypes[i]); + if (error) + return "columnTypes." + error; + } + } + if (message.mods != null && message.hasOwnProperty("mods")) { + if (!Array.isArray(message.mods)) + return "mods: array expected"; + for (var i = 0; i < message.mods.length; ++i) { + var error = $root.google.spanner.executor.v1.DataChangeRecord.Mod.verify(message.mods[i]); + if (error) + return "mods." + error; + } + } + if (message.modType != null && message.hasOwnProperty("modType")) + if (!$util.isString(message.modType)) + return "modType: string expected"; + if (message.valueCaptureType != null && message.hasOwnProperty("valueCaptureType")) + if (!$util.isString(message.valueCaptureType)) + return "valueCaptureType: string expected"; + if (message.recordCount != null && message.hasOwnProperty("recordCount")) + if (!$util.isInteger(message.recordCount) && !(message.recordCount && $util.isInteger(message.recordCount.low) && $util.isInteger(message.recordCount.high))) + return "recordCount: integer|Long expected"; + if (message.partitionCount != null && message.hasOwnProperty("partitionCount")) + if (!$util.isInteger(message.partitionCount) && !(message.partitionCount && $util.isInteger(message.partitionCount.low) && $util.isInteger(message.partitionCount.high))) + return "partitionCount: integer|Long expected"; + if (message.transactionTag != null && message.hasOwnProperty("transactionTag")) + if (!$util.isString(message.transactionTag)) + return "transactionTag: string expected"; + if (message.isSystemTransaction != null && message.hasOwnProperty("isSystemTransaction")) + if (typeof message.isSystemTransaction !== "boolean") + return "isSystemTransaction: boolean expected"; + return null; + }; + + /** + * Creates a DataChangeRecord message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.executor.v1.DataChangeRecord + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.executor.v1.DataChangeRecord} DataChangeRecord + */ + DataChangeRecord.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.executor.v1.DataChangeRecord) + return object; + var message = new $root.google.spanner.executor.v1.DataChangeRecord(); + if (object.commitTime != null) { + if (typeof object.commitTime !== "object") + throw TypeError(".google.spanner.executor.v1.DataChangeRecord.commitTime: object expected"); + message.commitTime = $root.google.protobuf.Timestamp.fromObject(object.commitTime); + } + if (object.recordSequence != null) + message.recordSequence = String(object.recordSequence); + if (object.transactionId != null) + message.transactionId = String(object.transactionId); + if (object.isLastRecord != null) + message.isLastRecord = Boolean(object.isLastRecord); + if (object.table != null) + message.table = String(object.table); + if (object.columnTypes) { + if (!Array.isArray(object.columnTypes)) + throw TypeError(".google.spanner.executor.v1.DataChangeRecord.columnTypes: array expected"); + message.columnTypes = []; + for (var i = 0; i < object.columnTypes.length; ++i) { + if (typeof object.columnTypes[i] !== "object") + throw TypeError(".google.spanner.executor.v1.DataChangeRecord.columnTypes: object expected"); + message.columnTypes[i] = $root.google.spanner.executor.v1.DataChangeRecord.ColumnType.fromObject(object.columnTypes[i]); + } + } + if (object.mods) { + if (!Array.isArray(object.mods)) + throw TypeError(".google.spanner.executor.v1.DataChangeRecord.mods: array expected"); + message.mods = []; + for (var i = 0; i < object.mods.length; ++i) { + if (typeof object.mods[i] !== "object") + throw TypeError(".google.spanner.executor.v1.DataChangeRecord.mods: object expected"); + message.mods[i] = $root.google.spanner.executor.v1.DataChangeRecord.Mod.fromObject(object.mods[i]); + } + } + if (object.modType != null) + message.modType = String(object.modType); + if (object.valueCaptureType != null) + message.valueCaptureType = String(object.valueCaptureType); + if (object.recordCount != null) + if ($util.Long) + (message.recordCount = $util.Long.fromValue(object.recordCount)).unsigned = false; + else if (typeof object.recordCount === "string") + message.recordCount = parseInt(object.recordCount, 10); + else if (typeof object.recordCount === "number") + message.recordCount = object.recordCount; + else if (typeof object.recordCount === "object") + message.recordCount = new $util.LongBits(object.recordCount.low >>> 0, object.recordCount.high >>> 0).toNumber(); + if (object.partitionCount != null) + if ($util.Long) + (message.partitionCount = $util.Long.fromValue(object.partitionCount)).unsigned = false; + else if (typeof object.partitionCount === "string") + message.partitionCount = parseInt(object.partitionCount, 10); + else if (typeof object.partitionCount === "number") + message.partitionCount = object.partitionCount; + else if (typeof object.partitionCount === "object") + message.partitionCount = new $util.LongBits(object.partitionCount.low >>> 0, object.partitionCount.high >>> 0).toNumber(); + if (object.transactionTag != null) + message.transactionTag = String(object.transactionTag); + if (object.isSystemTransaction != null) + message.isSystemTransaction = Boolean(object.isSystemTransaction); + return message; + }; + + /** + * Creates a plain object from a DataChangeRecord message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.executor.v1.DataChangeRecord + * @static + * @param {google.spanner.executor.v1.DataChangeRecord} message DataChangeRecord + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataChangeRecord.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.columnTypes = []; + object.mods = []; + } + if (options.defaults) { + object.commitTime = null; + object.recordSequence = ""; + object.transactionId = ""; + object.isLastRecord = false; + object.table = ""; + object.modType = ""; + object.valueCaptureType = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.recordCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.recordCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.partitionCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.partitionCount = options.longs === String ? "0" : 0; + object.transactionTag = ""; + object.isSystemTransaction = false; + } + if (message.commitTime != null && message.hasOwnProperty("commitTime")) + object.commitTime = $root.google.protobuf.Timestamp.toObject(message.commitTime, options); + if (message.recordSequence != null && message.hasOwnProperty("recordSequence")) + object.recordSequence = message.recordSequence; + if (message.transactionId != null && message.hasOwnProperty("transactionId")) + object.transactionId = message.transactionId; + if (message.isLastRecord != null && message.hasOwnProperty("isLastRecord")) + object.isLastRecord = message.isLastRecord; + if (message.table != null && message.hasOwnProperty("table")) + object.table = message.table; + if (message.columnTypes && message.columnTypes.length) { + object.columnTypes = []; + for (var j = 0; j < message.columnTypes.length; ++j) + object.columnTypes[j] = $root.google.spanner.executor.v1.DataChangeRecord.ColumnType.toObject(message.columnTypes[j], options); + } + if (message.mods && message.mods.length) { + object.mods = []; + for (var j = 0; j < message.mods.length; ++j) + object.mods[j] = $root.google.spanner.executor.v1.DataChangeRecord.Mod.toObject(message.mods[j], options); + } + if (message.modType != null && message.hasOwnProperty("modType")) + object.modType = message.modType; + if (message.valueCaptureType != null && message.hasOwnProperty("valueCaptureType")) + object.valueCaptureType = message.valueCaptureType; + if (message.recordCount != null && message.hasOwnProperty("recordCount")) + if (typeof message.recordCount === "number") + object.recordCount = options.longs === String ? String(message.recordCount) : message.recordCount; + else + object.recordCount = options.longs === String ? $util.Long.prototype.toString.call(message.recordCount) : options.longs === Number ? new $util.LongBits(message.recordCount.low >>> 0, message.recordCount.high >>> 0).toNumber() : message.recordCount; + if (message.partitionCount != null && message.hasOwnProperty("partitionCount")) + if (typeof message.partitionCount === "number") + object.partitionCount = options.longs === String ? String(message.partitionCount) : message.partitionCount; + else + object.partitionCount = options.longs === String ? $util.Long.prototype.toString.call(message.partitionCount) : options.longs === Number ? new $util.LongBits(message.partitionCount.low >>> 0, message.partitionCount.high >>> 0).toNumber() : message.partitionCount; + if (message.transactionTag != null && message.hasOwnProperty("transactionTag")) + object.transactionTag = message.transactionTag; + if (message.isSystemTransaction != null && message.hasOwnProperty("isSystemTransaction")) + object.isSystemTransaction = message.isSystemTransaction; + return object; + }; + + /** + * Converts this DataChangeRecord to JSON. + * @function toJSON + * @memberof google.spanner.executor.v1.DataChangeRecord + * @instance + * @returns {Object.} JSON object + */ + DataChangeRecord.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DataChangeRecord + * @function getTypeUrl + * @memberof google.spanner.executor.v1.DataChangeRecord + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DataChangeRecord.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.executor.v1.DataChangeRecord"; + }; + + DataChangeRecord.ColumnType = (function() { + + /** + * Properties of a ColumnType. + * @memberof google.spanner.executor.v1.DataChangeRecord + * @interface IColumnType + * @property {string|null} [name] ColumnType name + * @property {string|null} [type] ColumnType type + * @property {boolean|null} [isPrimaryKey] ColumnType isPrimaryKey + * @property {number|Long|null} [ordinalPosition] ColumnType ordinalPosition + */ + + /** + * Constructs a new ColumnType. + * @memberof google.spanner.executor.v1.DataChangeRecord + * @classdesc Represents a ColumnType. + * @implements IColumnType + * @constructor + * @param {google.spanner.executor.v1.DataChangeRecord.IColumnType=} [properties] Properties to set + */ + function ColumnType(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ColumnType name. + * @member {string} name + * @memberof google.spanner.executor.v1.DataChangeRecord.ColumnType + * @instance + */ + ColumnType.prototype.name = ""; + + /** + * ColumnType type. + * @member {string} type + * @memberof google.spanner.executor.v1.DataChangeRecord.ColumnType + * @instance + */ + ColumnType.prototype.type = ""; + + /** + * ColumnType isPrimaryKey. + * @member {boolean} isPrimaryKey + * @memberof google.spanner.executor.v1.DataChangeRecord.ColumnType + * @instance + */ + ColumnType.prototype.isPrimaryKey = false; + + /** + * ColumnType ordinalPosition. + * @member {number|Long} ordinalPosition + * @memberof google.spanner.executor.v1.DataChangeRecord.ColumnType + * @instance + */ + ColumnType.prototype.ordinalPosition = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ColumnType instance using the specified properties. + * @function create + * @memberof google.spanner.executor.v1.DataChangeRecord.ColumnType + * @static + * @param {google.spanner.executor.v1.DataChangeRecord.IColumnType=} [properties] Properties to set + * @returns {google.spanner.executor.v1.DataChangeRecord.ColumnType} ColumnType instance + */ + ColumnType.create = function create(properties) { + return new ColumnType(properties); + }; + + /** + * Encodes the specified ColumnType message. Does not implicitly {@link google.spanner.executor.v1.DataChangeRecord.ColumnType.verify|verify} messages. + * @function encode + * @memberof google.spanner.executor.v1.DataChangeRecord.ColumnType + * @static + * @param {google.spanner.executor.v1.DataChangeRecord.IColumnType} message ColumnType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ColumnType.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.type); + if (message.isPrimaryKey != null && Object.hasOwnProperty.call(message, "isPrimaryKey")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.isPrimaryKey); + if (message.ordinalPosition != null && Object.hasOwnProperty.call(message, "ordinalPosition")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.ordinalPosition); + return writer; + }; + + /** + * Encodes the specified ColumnType message, length delimited. Does not implicitly {@link google.spanner.executor.v1.DataChangeRecord.ColumnType.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.executor.v1.DataChangeRecord.ColumnType + * @static + * @param {google.spanner.executor.v1.DataChangeRecord.IColumnType} message ColumnType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ColumnType.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ColumnType message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.executor.v1.DataChangeRecord.ColumnType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.executor.v1.DataChangeRecord.ColumnType} ColumnType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ColumnType.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.DataChangeRecord.ColumnType(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.type = reader.string(); + break; + } + case 3: { + message.isPrimaryKey = reader.bool(); + break; + } + case 4: { + message.ordinalPosition = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ColumnType message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.executor.v1.DataChangeRecord.ColumnType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.executor.v1.DataChangeRecord.ColumnType} ColumnType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ColumnType.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ColumnType message. + * @function verify + * @memberof google.spanner.executor.v1.DataChangeRecord.ColumnType + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ColumnType.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.isPrimaryKey != null && message.hasOwnProperty("isPrimaryKey")) + if (typeof message.isPrimaryKey !== "boolean") + return "isPrimaryKey: boolean expected"; + if (message.ordinalPosition != null && message.hasOwnProperty("ordinalPosition")) + if (!$util.isInteger(message.ordinalPosition) && !(message.ordinalPosition && $util.isInteger(message.ordinalPosition.low) && $util.isInteger(message.ordinalPosition.high))) + return "ordinalPosition: integer|Long expected"; + return null; + }; + + /** + * Creates a ColumnType message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.executor.v1.DataChangeRecord.ColumnType + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.executor.v1.DataChangeRecord.ColumnType} ColumnType + */ + ColumnType.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.executor.v1.DataChangeRecord.ColumnType) + return object; + var message = new $root.google.spanner.executor.v1.DataChangeRecord.ColumnType(); + if (object.name != null) + message.name = String(object.name); + if (object.type != null) + message.type = String(object.type); + if (object.isPrimaryKey != null) + message.isPrimaryKey = Boolean(object.isPrimaryKey); + if (object.ordinalPosition != null) + if ($util.Long) + (message.ordinalPosition = $util.Long.fromValue(object.ordinalPosition)).unsigned = false; + else if (typeof object.ordinalPosition === "string") + message.ordinalPosition = parseInt(object.ordinalPosition, 10); + else if (typeof object.ordinalPosition === "number") + message.ordinalPosition = object.ordinalPosition; + else if (typeof object.ordinalPosition === "object") + message.ordinalPosition = new $util.LongBits(object.ordinalPosition.low >>> 0, object.ordinalPosition.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a ColumnType message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.executor.v1.DataChangeRecord.ColumnType + * @static + * @param {google.spanner.executor.v1.DataChangeRecord.ColumnType} message ColumnType + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ColumnType.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.type = ""; + object.isPrimaryKey = false; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.ordinalPosition = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.ordinalPosition = options.longs === String ? "0" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.isPrimaryKey != null && message.hasOwnProperty("isPrimaryKey")) + object.isPrimaryKey = message.isPrimaryKey; + if (message.ordinalPosition != null && message.hasOwnProperty("ordinalPosition")) + if (typeof message.ordinalPosition === "number") + object.ordinalPosition = options.longs === String ? String(message.ordinalPosition) : message.ordinalPosition; + else + object.ordinalPosition = options.longs === String ? $util.Long.prototype.toString.call(message.ordinalPosition) : options.longs === Number ? new $util.LongBits(message.ordinalPosition.low >>> 0, message.ordinalPosition.high >>> 0).toNumber() : message.ordinalPosition; + return object; + }; + + /** + * Converts this ColumnType to JSON. + * @function toJSON + * @memberof google.spanner.executor.v1.DataChangeRecord.ColumnType + * @instance + * @returns {Object.} JSON object + */ + ColumnType.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ColumnType + * @function getTypeUrl + * @memberof google.spanner.executor.v1.DataChangeRecord.ColumnType + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ColumnType.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.executor.v1.DataChangeRecord.ColumnType"; + }; + + return ColumnType; + })(); + + DataChangeRecord.Mod = (function() { + + /** + * Properties of a Mod. + * @memberof google.spanner.executor.v1.DataChangeRecord + * @interface IMod + * @property {string|null} [keys] Mod keys + * @property {string|null} [newValues] Mod newValues + * @property {string|null} [oldValues] Mod oldValues + */ + + /** + * Constructs a new Mod. + * @memberof google.spanner.executor.v1.DataChangeRecord + * @classdesc Represents a Mod. + * @implements IMod + * @constructor + * @param {google.spanner.executor.v1.DataChangeRecord.IMod=} [properties] Properties to set + */ + function Mod(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Mod keys. + * @member {string} keys + * @memberof google.spanner.executor.v1.DataChangeRecord.Mod + * @instance + */ + Mod.prototype.keys = ""; + + /** + * Mod newValues. + * @member {string} newValues + * @memberof google.spanner.executor.v1.DataChangeRecord.Mod + * @instance + */ + Mod.prototype.newValues = ""; + + /** + * Mod oldValues. + * @member {string} oldValues + * @memberof google.spanner.executor.v1.DataChangeRecord.Mod + * @instance + */ + Mod.prototype.oldValues = ""; + + /** + * Creates a new Mod instance using the specified properties. + * @function create + * @memberof google.spanner.executor.v1.DataChangeRecord.Mod + * @static + * @param {google.spanner.executor.v1.DataChangeRecord.IMod=} [properties] Properties to set + * @returns {google.spanner.executor.v1.DataChangeRecord.Mod} Mod instance + */ + Mod.create = function create(properties) { + return new Mod(properties); + }; + + /** + * Encodes the specified Mod message. Does not implicitly {@link google.spanner.executor.v1.DataChangeRecord.Mod.verify|verify} messages. + * @function encode + * @memberof google.spanner.executor.v1.DataChangeRecord.Mod + * @static + * @param {google.spanner.executor.v1.DataChangeRecord.IMod} message Mod message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Mod.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.keys != null && Object.hasOwnProperty.call(message, "keys")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.keys); + if (message.newValues != null && Object.hasOwnProperty.call(message, "newValues")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.newValues); + if (message.oldValues != null && Object.hasOwnProperty.call(message, "oldValues")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.oldValues); + return writer; + }; + + /** + * Encodes the specified Mod message, length delimited. Does not implicitly {@link google.spanner.executor.v1.DataChangeRecord.Mod.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.executor.v1.DataChangeRecord.Mod + * @static + * @param {google.spanner.executor.v1.DataChangeRecord.IMod} message Mod message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Mod.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Mod message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.executor.v1.DataChangeRecord.Mod + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.executor.v1.DataChangeRecord.Mod} Mod + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Mod.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.DataChangeRecord.Mod(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.keys = reader.string(); + break; + } + case 2: { + message.newValues = reader.string(); + break; + } + case 3: { + message.oldValues = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Mod message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.executor.v1.DataChangeRecord.Mod + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.executor.v1.DataChangeRecord.Mod} Mod + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Mod.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Mod message. + * @function verify + * @memberof google.spanner.executor.v1.DataChangeRecord.Mod + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Mod.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.keys != null && message.hasOwnProperty("keys")) + if (!$util.isString(message.keys)) + return "keys: string expected"; + if (message.newValues != null && message.hasOwnProperty("newValues")) + if (!$util.isString(message.newValues)) + return "newValues: string expected"; + if (message.oldValues != null && message.hasOwnProperty("oldValues")) + if (!$util.isString(message.oldValues)) + return "oldValues: string expected"; + return null; + }; + + /** + * Creates a Mod message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.executor.v1.DataChangeRecord.Mod + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.executor.v1.DataChangeRecord.Mod} Mod + */ + Mod.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.executor.v1.DataChangeRecord.Mod) + return object; + var message = new $root.google.spanner.executor.v1.DataChangeRecord.Mod(); + if (object.keys != null) + message.keys = String(object.keys); + if (object.newValues != null) + message.newValues = String(object.newValues); + if (object.oldValues != null) + message.oldValues = String(object.oldValues); + return message; + }; + + /** + * Creates a plain object from a Mod message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.executor.v1.DataChangeRecord.Mod + * @static + * @param {google.spanner.executor.v1.DataChangeRecord.Mod} message Mod + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Mod.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.keys = ""; + object.newValues = ""; + object.oldValues = ""; + } + if (message.keys != null && message.hasOwnProperty("keys")) + object.keys = message.keys; + if (message.newValues != null && message.hasOwnProperty("newValues")) + object.newValues = message.newValues; + if (message.oldValues != null && message.hasOwnProperty("oldValues")) + object.oldValues = message.oldValues; + return object; + }; + + /** + * Converts this Mod to JSON. + * @function toJSON + * @memberof google.spanner.executor.v1.DataChangeRecord.Mod + * @instance + * @returns {Object.} JSON object + */ + Mod.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Mod + * @function getTypeUrl + * @memberof google.spanner.executor.v1.DataChangeRecord.Mod + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Mod.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.executor.v1.DataChangeRecord.Mod"; + }; + + return Mod; + })(); + + return DataChangeRecord; + })(); + + v1.ChildPartitionsRecord = (function() { + + /** + * Properties of a ChildPartitionsRecord. + * @memberof google.spanner.executor.v1 + * @interface IChildPartitionsRecord + * @property {google.protobuf.ITimestamp|null} [startTime] ChildPartitionsRecord startTime + * @property {string|null} [recordSequence] ChildPartitionsRecord recordSequence + * @property {Array.|null} [childPartitions] ChildPartitionsRecord childPartitions + */ + + /** + * Constructs a new ChildPartitionsRecord. + * @memberof google.spanner.executor.v1 + * @classdesc Represents a ChildPartitionsRecord. + * @implements IChildPartitionsRecord + * @constructor + * @param {google.spanner.executor.v1.IChildPartitionsRecord=} [properties] Properties to set + */ + function ChildPartitionsRecord(properties) { + this.childPartitions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ChildPartitionsRecord startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.spanner.executor.v1.ChildPartitionsRecord + * @instance + */ + ChildPartitionsRecord.prototype.startTime = null; + + /** + * ChildPartitionsRecord recordSequence. + * @member {string} recordSequence + * @memberof google.spanner.executor.v1.ChildPartitionsRecord + * @instance + */ + ChildPartitionsRecord.prototype.recordSequence = ""; + + /** + * ChildPartitionsRecord childPartitions. + * @member {Array.} childPartitions + * @memberof google.spanner.executor.v1.ChildPartitionsRecord + * @instance + */ + ChildPartitionsRecord.prototype.childPartitions = $util.emptyArray; + + /** + * Creates a new ChildPartitionsRecord instance using the specified properties. + * @function create + * @memberof google.spanner.executor.v1.ChildPartitionsRecord + * @static + * @param {google.spanner.executor.v1.IChildPartitionsRecord=} [properties] Properties to set + * @returns {google.spanner.executor.v1.ChildPartitionsRecord} ChildPartitionsRecord instance + */ + ChildPartitionsRecord.create = function create(properties) { + return new ChildPartitionsRecord(properties); + }; + + /** + * Encodes the specified ChildPartitionsRecord message. Does not implicitly {@link google.spanner.executor.v1.ChildPartitionsRecord.verify|verify} messages. + * @function encode + * @memberof google.spanner.executor.v1.ChildPartitionsRecord + * @static + * @param {google.spanner.executor.v1.IChildPartitionsRecord} message ChildPartitionsRecord message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ChildPartitionsRecord.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.recordSequence != null && Object.hasOwnProperty.call(message, "recordSequence")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.recordSequence); + if (message.childPartitions != null && message.childPartitions.length) + for (var i = 0; i < message.childPartitions.length; ++i) + $root.google.spanner.executor.v1.ChildPartitionsRecord.ChildPartition.encode(message.childPartitions[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ChildPartitionsRecord message, length delimited. Does not implicitly {@link google.spanner.executor.v1.ChildPartitionsRecord.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.executor.v1.ChildPartitionsRecord + * @static + * @param {google.spanner.executor.v1.IChildPartitionsRecord} message ChildPartitionsRecord message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ChildPartitionsRecord.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ChildPartitionsRecord message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.executor.v1.ChildPartitionsRecord + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.executor.v1.ChildPartitionsRecord} ChildPartitionsRecord + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ChildPartitionsRecord.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.ChildPartitionsRecord(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.recordSequence = reader.string(); + break; + } + case 3: { + if (!(message.childPartitions && message.childPartitions.length)) + message.childPartitions = []; + message.childPartitions.push($root.google.spanner.executor.v1.ChildPartitionsRecord.ChildPartition.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ChildPartitionsRecord message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.executor.v1.ChildPartitionsRecord + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.executor.v1.ChildPartitionsRecord} ChildPartitionsRecord + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ChildPartitionsRecord.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ChildPartitionsRecord message. + * @function verify + * @memberof google.spanner.executor.v1.ChildPartitionsRecord + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ChildPartitionsRecord.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.recordSequence != null && message.hasOwnProperty("recordSequence")) + if (!$util.isString(message.recordSequence)) + return "recordSequence: string expected"; + if (message.childPartitions != null && message.hasOwnProperty("childPartitions")) { + if (!Array.isArray(message.childPartitions)) + return "childPartitions: array expected"; + for (var i = 0; i < message.childPartitions.length; ++i) { + var error = $root.google.spanner.executor.v1.ChildPartitionsRecord.ChildPartition.verify(message.childPartitions[i]); + if (error) + return "childPartitions." + error; + } + } + return null; + }; + + /** + * Creates a ChildPartitionsRecord message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.executor.v1.ChildPartitionsRecord + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.executor.v1.ChildPartitionsRecord} ChildPartitionsRecord + */ + ChildPartitionsRecord.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.executor.v1.ChildPartitionsRecord) + return object; + var message = new $root.google.spanner.executor.v1.ChildPartitionsRecord(); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.spanner.executor.v1.ChildPartitionsRecord.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.recordSequence != null) + message.recordSequence = String(object.recordSequence); + if (object.childPartitions) { + if (!Array.isArray(object.childPartitions)) + throw TypeError(".google.spanner.executor.v1.ChildPartitionsRecord.childPartitions: array expected"); + message.childPartitions = []; + for (var i = 0; i < object.childPartitions.length; ++i) { + if (typeof object.childPartitions[i] !== "object") + throw TypeError(".google.spanner.executor.v1.ChildPartitionsRecord.childPartitions: object expected"); + message.childPartitions[i] = $root.google.spanner.executor.v1.ChildPartitionsRecord.ChildPartition.fromObject(object.childPartitions[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ChildPartitionsRecord message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.executor.v1.ChildPartitionsRecord + * @static + * @param {google.spanner.executor.v1.ChildPartitionsRecord} message ChildPartitionsRecord + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ChildPartitionsRecord.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.childPartitions = []; + if (options.defaults) { + object.startTime = null; + object.recordSequence = ""; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.recordSequence != null && message.hasOwnProperty("recordSequence")) + object.recordSequence = message.recordSequence; + if (message.childPartitions && message.childPartitions.length) { + object.childPartitions = []; + for (var j = 0; j < message.childPartitions.length; ++j) + object.childPartitions[j] = $root.google.spanner.executor.v1.ChildPartitionsRecord.ChildPartition.toObject(message.childPartitions[j], options); + } + return object; + }; + + /** + * Converts this ChildPartitionsRecord to JSON. + * @function toJSON + * @memberof google.spanner.executor.v1.ChildPartitionsRecord + * @instance + * @returns {Object.} JSON object + */ + ChildPartitionsRecord.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ChildPartitionsRecord + * @function getTypeUrl + * @memberof google.spanner.executor.v1.ChildPartitionsRecord + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ChildPartitionsRecord.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.executor.v1.ChildPartitionsRecord"; + }; + + ChildPartitionsRecord.ChildPartition = (function() { + + /** + * Properties of a ChildPartition. + * @memberof google.spanner.executor.v1.ChildPartitionsRecord + * @interface IChildPartition + * @property {string|null} [token] ChildPartition token + * @property {Array.|null} [parentPartitionTokens] ChildPartition parentPartitionTokens + */ + + /** + * Constructs a new ChildPartition. + * @memberof google.spanner.executor.v1.ChildPartitionsRecord + * @classdesc Represents a ChildPartition. + * @implements IChildPartition + * @constructor + * @param {google.spanner.executor.v1.ChildPartitionsRecord.IChildPartition=} [properties] Properties to set + */ + function ChildPartition(properties) { + this.parentPartitionTokens = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ChildPartition token. + * @member {string} token + * @memberof google.spanner.executor.v1.ChildPartitionsRecord.ChildPartition + * @instance + */ + ChildPartition.prototype.token = ""; + + /** + * ChildPartition parentPartitionTokens. + * @member {Array.} parentPartitionTokens + * @memberof google.spanner.executor.v1.ChildPartitionsRecord.ChildPartition + * @instance + */ + ChildPartition.prototype.parentPartitionTokens = $util.emptyArray; + + /** + * Creates a new ChildPartition instance using the specified properties. + * @function create + * @memberof google.spanner.executor.v1.ChildPartitionsRecord.ChildPartition + * @static + * @param {google.spanner.executor.v1.ChildPartitionsRecord.IChildPartition=} [properties] Properties to set + * @returns {google.spanner.executor.v1.ChildPartitionsRecord.ChildPartition} ChildPartition instance + */ + ChildPartition.create = function create(properties) { + return new ChildPartition(properties); + }; + + /** + * Encodes the specified ChildPartition message. Does not implicitly {@link google.spanner.executor.v1.ChildPartitionsRecord.ChildPartition.verify|verify} messages. + * @function encode + * @memberof google.spanner.executor.v1.ChildPartitionsRecord.ChildPartition + * @static + * @param {google.spanner.executor.v1.ChildPartitionsRecord.IChildPartition} message ChildPartition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ChildPartition.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.token != null && Object.hasOwnProperty.call(message, "token")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.token); + if (message.parentPartitionTokens != null && message.parentPartitionTokens.length) + for (var i = 0; i < message.parentPartitionTokens.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.parentPartitionTokens[i]); + return writer; + }; + + /** + * Encodes the specified ChildPartition message, length delimited. Does not implicitly {@link google.spanner.executor.v1.ChildPartitionsRecord.ChildPartition.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.executor.v1.ChildPartitionsRecord.ChildPartition + * @static + * @param {google.spanner.executor.v1.ChildPartitionsRecord.IChildPartition} message ChildPartition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ChildPartition.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ChildPartition message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.executor.v1.ChildPartitionsRecord.ChildPartition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.executor.v1.ChildPartitionsRecord.ChildPartition} ChildPartition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ChildPartition.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.ChildPartitionsRecord.ChildPartition(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.token = reader.string(); + break; + } + case 2: { + if (!(message.parentPartitionTokens && message.parentPartitionTokens.length)) + message.parentPartitionTokens = []; + message.parentPartitionTokens.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ChildPartition message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.executor.v1.ChildPartitionsRecord.ChildPartition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.executor.v1.ChildPartitionsRecord.ChildPartition} ChildPartition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ChildPartition.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ChildPartition message. + * @function verify + * @memberof google.spanner.executor.v1.ChildPartitionsRecord.ChildPartition + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ChildPartition.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.token != null && message.hasOwnProperty("token")) + if (!$util.isString(message.token)) + return "token: string expected"; + if (message.parentPartitionTokens != null && message.hasOwnProperty("parentPartitionTokens")) { + if (!Array.isArray(message.parentPartitionTokens)) + return "parentPartitionTokens: array expected"; + for (var i = 0; i < message.parentPartitionTokens.length; ++i) + if (!$util.isString(message.parentPartitionTokens[i])) + return "parentPartitionTokens: string[] expected"; + } + return null; + }; + + /** + * Creates a ChildPartition message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.executor.v1.ChildPartitionsRecord.ChildPartition + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.executor.v1.ChildPartitionsRecord.ChildPartition} ChildPartition + */ + ChildPartition.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.executor.v1.ChildPartitionsRecord.ChildPartition) + return object; + var message = new $root.google.spanner.executor.v1.ChildPartitionsRecord.ChildPartition(); + if (object.token != null) + message.token = String(object.token); + if (object.parentPartitionTokens) { + if (!Array.isArray(object.parentPartitionTokens)) + throw TypeError(".google.spanner.executor.v1.ChildPartitionsRecord.ChildPartition.parentPartitionTokens: array expected"); + message.parentPartitionTokens = []; + for (var i = 0; i < object.parentPartitionTokens.length; ++i) + message.parentPartitionTokens[i] = String(object.parentPartitionTokens[i]); + } + return message; + }; + + /** + * Creates a plain object from a ChildPartition message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.executor.v1.ChildPartitionsRecord.ChildPartition + * @static + * @param {google.spanner.executor.v1.ChildPartitionsRecord.ChildPartition} message ChildPartition + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ChildPartition.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.parentPartitionTokens = []; + if (options.defaults) + object.token = ""; + if (message.token != null && message.hasOwnProperty("token")) + object.token = message.token; + if (message.parentPartitionTokens && message.parentPartitionTokens.length) { + object.parentPartitionTokens = []; + for (var j = 0; j < message.parentPartitionTokens.length; ++j) + object.parentPartitionTokens[j] = message.parentPartitionTokens[j]; + } + return object; + }; + + /** + * Converts this ChildPartition to JSON. + * @function toJSON + * @memberof google.spanner.executor.v1.ChildPartitionsRecord.ChildPartition + * @instance + * @returns {Object.} JSON object + */ + ChildPartition.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ChildPartition + * @function getTypeUrl + * @memberof google.spanner.executor.v1.ChildPartitionsRecord.ChildPartition + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ChildPartition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.executor.v1.ChildPartitionsRecord.ChildPartition"; + }; + + return ChildPartition; + })(); + + return ChildPartitionsRecord; + })(); + + v1.HeartbeatRecord = (function() { + + /** + * Properties of a HeartbeatRecord. + * @memberof google.spanner.executor.v1 + * @interface IHeartbeatRecord + * @property {google.protobuf.ITimestamp|null} [heartbeatTime] HeartbeatRecord heartbeatTime + */ + + /** + * Constructs a new HeartbeatRecord. + * @memberof google.spanner.executor.v1 + * @classdesc Represents a HeartbeatRecord. + * @implements IHeartbeatRecord + * @constructor + * @param {google.spanner.executor.v1.IHeartbeatRecord=} [properties] Properties to set + */ + function HeartbeatRecord(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HeartbeatRecord heartbeatTime. + * @member {google.protobuf.ITimestamp|null|undefined} heartbeatTime + * @memberof google.spanner.executor.v1.HeartbeatRecord + * @instance + */ + HeartbeatRecord.prototype.heartbeatTime = null; + + /** + * Creates a new HeartbeatRecord instance using the specified properties. + * @function create + * @memberof google.spanner.executor.v1.HeartbeatRecord + * @static + * @param {google.spanner.executor.v1.IHeartbeatRecord=} [properties] Properties to set + * @returns {google.spanner.executor.v1.HeartbeatRecord} HeartbeatRecord instance + */ + HeartbeatRecord.create = function create(properties) { + return new HeartbeatRecord(properties); + }; + + /** + * Encodes the specified HeartbeatRecord message. Does not implicitly {@link google.spanner.executor.v1.HeartbeatRecord.verify|verify} messages. + * @function encode + * @memberof google.spanner.executor.v1.HeartbeatRecord + * @static + * @param {google.spanner.executor.v1.IHeartbeatRecord} message HeartbeatRecord message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HeartbeatRecord.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.heartbeatTime != null && Object.hasOwnProperty.call(message, "heartbeatTime")) + $root.google.protobuf.Timestamp.encode(message.heartbeatTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified HeartbeatRecord message, length delimited. Does not implicitly {@link google.spanner.executor.v1.HeartbeatRecord.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.executor.v1.HeartbeatRecord + * @static + * @param {google.spanner.executor.v1.IHeartbeatRecord} message HeartbeatRecord message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HeartbeatRecord.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HeartbeatRecord message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.executor.v1.HeartbeatRecord + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.executor.v1.HeartbeatRecord} HeartbeatRecord + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HeartbeatRecord.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.HeartbeatRecord(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.heartbeatTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HeartbeatRecord message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.executor.v1.HeartbeatRecord + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.executor.v1.HeartbeatRecord} HeartbeatRecord + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HeartbeatRecord.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HeartbeatRecord message. + * @function verify + * @memberof google.spanner.executor.v1.HeartbeatRecord + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HeartbeatRecord.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.heartbeatTime != null && message.hasOwnProperty("heartbeatTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.heartbeatTime); + if (error) + return "heartbeatTime." + error; + } + return null; + }; + + /** + * Creates a HeartbeatRecord message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.executor.v1.HeartbeatRecord + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.executor.v1.HeartbeatRecord} HeartbeatRecord + */ + HeartbeatRecord.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.executor.v1.HeartbeatRecord) + return object; + var message = new $root.google.spanner.executor.v1.HeartbeatRecord(); + if (object.heartbeatTime != null) { + if (typeof object.heartbeatTime !== "object") + throw TypeError(".google.spanner.executor.v1.HeartbeatRecord.heartbeatTime: object expected"); + message.heartbeatTime = $root.google.protobuf.Timestamp.fromObject(object.heartbeatTime); + } + return message; + }; + + /** + * Creates a plain object from a HeartbeatRecord message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.executor.v1.HeartbeatRecord + * @static + * @param {google.spanner.executor.v1.HeartbeatRecord} message HeartbeatRecord + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HeartbeatRecord.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.heartbeatTime = null; + if (message.heartbeatTime != null && message.hasOwnProperty("heartbeatTime")) + object.heartbeatTime = $root.google.protobuf.Timestamp.toObject(message.heartbeatTime, options); + return object; + }; + + /** + * Converts this HeartbeatRecord to JSON. + * @function toJSON + * @memberof google.spanner.executor.v1.HeartbeatRecord + * @instance + * @returns {Object.} JSON object + */ + HeartbeatRecord.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HeartbeatRecord + * @function getTypeUrl + * @memberof google.spanner.executor.v1.HeartbeatRecord + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HeartbeatRecord.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.executor.v1.HeartbeatRecord"; + }; + + return HeartbeatRecord; + })(); + + v1.SpannerOptions = (function() { + + /** + * Properties of a SpannerOptions. + * @memberof google.spanner.executor.v1 + * @interface ISpannerOptions + * @property {google.spanner.executor.v1.ISessionPoolOptions|null} [sessionPoolOptions] SpannerOptions sessionPoolOptions + */ + + /** + * Constructs a new SpannerOptions. + * @memberof google.spanner.executor.v1 + * @classdesc Represents a SpannerOptions. + * @implements ISpannerOptions + * @constructor + * @param {google.spanner.executor.v1.ISpannerOptions=} [properties] Properties to set + */ + function SpannerOptions(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SpannerOptions sessionPoolOptions. + * @member {google.spanner.executor.v1.ISessionPoolOptions|null|undefined} sessionPoolOptions + * @memberof google.spanner.executor.v1.SpannerOptions + * @instance + */ + SpannerOptions.prototype.sessionPoolOptions = null; + + /** + * Creates a new SpannerOptions instance using the specified properties. + * @function create + * @memberof google.spanner.executor.v1.SpannerOptions + * @static + * @param {google.spanner.executor.v1.ISpannerOptions=} [properties] Properties to set + * @returns {google.spanner.executor.v1.SpannerOptions} SpannerOptions instance + */ + SpannerOptions.create = function create(properties) { + return new SpannerOptions(properties); + }; + + /** + * Encodes the specified SpannerOptions message. Does not implicitly {@link google.spanner.executor.v1.SpannerOptions.verify|verify} messages. + * @function encode + * @memberof google.spanner.executor.v1.SpannerOptions + * @static + * @param {google.spanner.executor.v1.ISpannerOptions} message SpannerOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpannerOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sessionPoolOptions != null && Object.hasOwnProperty.call(message, "sessionPoolOptions")) + $root.google.spanner.executor.v1.SessionPoolOptions.encode(message.sessionPoolOptions, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SpannerOptions message, length delimited. Does not implicitly {@link google.spanner.executor.v1.SpannerOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.executor.v1.SpannerOptions + * @static + * @param {google.spanner.executor.v1.ISpannerOptions} message SpannerOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpannerOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SpannerOptions message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.executor.v1.SpannerOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.executor.v1.SpannerOptions} SpannerOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpannerOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.SpannerOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.sessionPoolOptions = $root.google.spanner.executor.v1.SessionPoolOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SpannerOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.executor.v1.SpannerOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.executor.v1.SpannerOptions} SpannerOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpannerOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SpannerOptions message. + * @function verify + * @memberof google.spanner.executor.v1.SpannerOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SpannerOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sessionPoolOptions != null && message.hasOwnProperty("sessionPoolOptions")) { + var error = $root.google.spanner.executor.v1.SessionPoolOptions.verify(message.sessionPoolOptions); + if (error) + return "sessionPoolOptions." + error; + } + return null; + }; + + /** + * Creates a SpannerOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.executor.v1.SpannerOptions + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.executor.v1.SpannerOptions} SpannerOptions + */ + SpannerOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.executor.v1.SpannerOptions) + return object; + var message = new $root.google.spanner.executor.v1.SpannerOptions(); + if (object.sessionPoolOptions != null) { + if (typeof object.sessionPoolOptions !== "object") + throw TypeError(".google.spanner.executor.v1.SpannerOptions.sessionPoolOptions: object expected"); + message.sessionPoolOptions = $root.google.spanner.executor.v1.SessionPoolOptions.fromObject(object.sessionPoolOptions); + } + return message; + }; + + /** + * Creates a plain object from a SpannerOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.executor.v1.SpannerOptions + * @static + * @param {google.spanner.executor.v1.SpannerOptions} message SpannerOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpannerOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.sessionPoolOptions = null; + if (message.sessionPoolOptions != null && message.hasOwnProperty("sessionPoolOptions")) + object.sessionPoolOptions = $root.google.spanner.executor.v1.SessionPoolOptions.toObject(message.sessionPoolOptions, options); + return object; + }; + + /** + * Converts this SpannerOptions to JSON. + * @function toJSON + * @memberof google.spanner.executor.v1.SpannerOptions + * @instance + * @returns {Object.} JSON object + */ + SpannerOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SpannerOptions + * @function getTypeUrl + * @memberof google.spanner.executor.v1.SpannerOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SpannerOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.executor.v1.SpannerOptions"; + }; + + return SpannerOptions; + })(); + + v1.SessionPoolOptions = (function() { + + /** + * Properties of a SessionPoolOptions. + * @memberof google.spanner.executor.v1 + * @interface ISessionPoolOptions + * @property {boolean|null} [useMultiplexed] SessionPoolOptions useMultiplexed + */ + + /** + * Constructs a new SessionPoolOptions. + * @memberof google.spanner.executor.v1 + * @classdesc Represents a SessionPoolOptions. + * @implements ISessionPoolOptions + * @constructor + * @param {google.spanner.executor.v1.ISessionPoolOptions=} [properties] Properties to set + */ + function SessionPoolOptions(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SessionPoolOptions useMultiplexed. + * @member {boolean} useMultiplexed + * @memberof google.spanner.executor.v1.SessionPoolOptions + * @instance + */ + SessionPoolOptions.prototype.useMultiplexed = false; + + /** + * Creates a new SessionPoolOptions instance using the specified properties. + * @function create + * @memberof google.spanner.executor.v1.SessionPoolOptions + * @static + * @param {google.spanner.executor.v1.ISessionPoolOptions=} [properties] Properties to set + * @returns {google.spanner.executor.v1.SessionPoolOptions} SessionPoolOptions instance + */ + SessionPoolOptions.create = function create(properties) { + return new SessionPoolOptions(properties); + }; + + /** + * Encodes the specified SessionPoolOptions message. Does not implicitly {@link google.spanner.executor.v1.SessionPoolOptions.verify|verify} messages. + * @function encode + * @memberof google.spanner.executor.v1.SessionPoolOptions + * @static + * @param {google.spanner.executor.v1.ISessionPoolOptions} message SessionPoolOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SessionPoolOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.useMultiplexed != null && Object.hasOwnProperty.call(message, "useMultiplexed")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.useMultiplexed); + return writer; + }; + + /** + * Encodes the specified SessionPoolOptions message, length delimited. Does not implicitly {@link google.spanner.executor.v1.SessionPoolOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.executor.v1.SessionPoolOptions + * @static + * @param {google.spanner.executor.v1.ISessionPoolOptions} message SessionPoolOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SessionPoolOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SessionPoolOptions message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.executor.v1.SessionPoolOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.executor.v1.SessionPoolOptions} SessionPoolOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SessionPoolOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.SessionPoolOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.useMultiplexed = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SessionPoolOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.executor.v1.SessionPoolOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.executor.v1.SessionPoolOptions} SessionPoolOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SessionPoolOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SessionPoolOptions message. + * @function verify + * @memberof google.spanner.executor.v1.SessionPoolOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SessionPoolOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.useMultiplexed != null && message.hasOwnProperty("useMultiplexed")) + if (typeof message.useMultiplexed !== "boolean") + return "useMultiplexed: boolean expected"; + return null; + }; + + /** + * Creates a SessionPoolOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.executor.v1.SessionPoolOptions + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.executor.v1.SessionPoolOptions} SessionPoolOptions + */ + SessionPoolOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.executor.v1.SessionPoolOptions) + return object; + var message = new $root.google.spanner.executor.v1.SessionPoolOptions(); + if (object.useMultiplexed != null) + message.useMultiplexed = Boolean(object.useMultiplexed); + return message; + }; + + /** + * Creates a plain object from a SessionPoolOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.executor.v1.SessionPoolOptions + * @static + * @param {google.spanner.executor.v1.SessionPoolOptions} message SessionPoolOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SessionPoolOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.useMultiplexed = false; + if (message.useMultiplexed != null && message.hasOwnProperty("useMultiplexed")) + object.useMultiplexed = message.useMultiplexed; + return object; + }; + + /** + * Converts this SessionPoolOptions to JSON. + * @function toJSON + * @memberof google.spanner.executor.v1.SessionPoolOptions + * @instance + * @returns {Object.} JSON object + */ + SessionPoolOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SessionPoolOptions + * @function getTypeUrl + * @memberof google.spanner.executor.v1.SessionPoolOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SessionPoolOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.executor.v1.SessionPoolOptions"; + }; + + return SessionPoolOptions; + })(); + + return v1; + })(); + + return executor; + })(); + + spanner.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.spanner + * @namespace + */ + var v1 = {}; + + v1.Spanner = (function() { + + /** + * Constructs a new Spanner service. + * @memberof google.spanner.v1 + * @classdesc Represents a Spanner + * @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 Spanner(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Spanner.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Spanner; + + /** + * Creates new Spanner service using the specified rpc implementation. + * @function create + * @memberof google.spanner.v1.Spanner + * @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 {Spanner} RPC service. Useful where requests and/or responses are streamed. + */ + Spanner.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.spanner.v1.Spanner|createSession}. + * @memberof google.spanner.v1.Spanner + * @typedef CreateSessionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.spanner.v1.Session} [response] Session + */ + + /** + * Calls CreateSession. + * @function createSession + * @memberof google.spanner.v1.Spanner + * @instance + * @param {google.spanner.v1.ICreateSessionRequest} request CreateSessionRequest message or plain object + * @param {google.spanner.v1.Spanner.CreateSessionCallback} callback Node-style callback called with the error, if any, and Session + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Spanner.prototype.createSession = function createSession(request, callback) { + return this.rpcCall(createSession, $root.google.spanner.v1.CreateSessionRequest, $root.google.spanner.v1.Session, request, callback); + }, "name", { value: "CreateSession" }); + + /** + * Calls CreateSession. + * @function createSession + * @memberof google.spanner.v1.Spanner + * @instance + * @param {google.spanner.v1.ICreateSessionRequest} request CreateSessionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.v1.Spanner|batchCreateSessions}. + * @memberof google.spanner.v1.Spanner + * @typedef BatchCreateSessionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.spanner.v1.BatchCreateSessionsResponse} [response] BatchCreateSessionsResponse + */ + + /** + * Calls BatchCreateSessions. + * @function batchCreateSessions + * @memberof google.spanner.v1.Spanner + * @instance + * @param {google.spanner.v1.IBatchCreateSessionsRequest} request BatchCreateSessionsRequest message or plain object + * @param {google.spanner.v1.Spanner.BatchCreateSessionsCallback} callback Node-style callback called with the error, if any, and BatchCreateSessionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Spanner.prototype.batchCreateSessions = function batchCreateSessions(request, callback) { + return this.rpcCall(batchCreateSessions, $root.google.spanner.v1.BatchCreateSessionsRequest, $root.google.spanner.v1.BatchCreateSessionsResponse, request, callback); + }, "name", { value: "BatchCreateSessions" }); + + /** + * Calls BatchCreateSessions. + * @function batchCreateSessions + * @memberof google.spanner.v1.Spanner + * @instance + * @param {google.spanner.v1.IBatchCreateSessionsRequest} request BatchCreateSessionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.v1.Spanner|getSession}. + * @memberof google.spanner.v1.Spanner + * @typedef GetSessionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.spanner.v1.Session} [response] Session + */ + + /** + * Calls GetSession. + * @function getSession + * @memberof google.spanner.v1.Spanner + * @instance + * @param {google.spanner.v1.IGetSessionRequest} request GetSessionRequest message or plain object + * @param {google.spanner.v1.Spanner.GetSessionCallback} callback Node-style callback called with the error, if any, and Session + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Spanner.prototype.getSession = function getSession(request, callback) { + return this.rpcCall(getSession, $root.google.spanner.v1.GetSessionRequest, $root.google.spanner.v1.Session, request, callback); + }, "name", { value: "GetSession" }); + + /** + * Calls GetSession. + * @function getSession + * @memberof google.spanner.v1.Spanner + * @instance + * @param {google.spanner.v1.IGetSessionRequest} request GetSessionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.v1.Spanner|listSessions}. + * @memberof google.spanner.v1.Spanner + * @typedef ListSessionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.spanner.v1.ListSessionsResponse} [response] ListSessionsResponse + */ + + /** + * Calls ListSessions. + * @function listSessions + * @memberof google.spanner.v1.Spanner + * @instance + * @param {google.spanner.v1.IListSessionsRequest} request ListSessionsRequest message or plain object + * @param {google.spanner.v1.Spanner.ListSessionsCallback} callback Node-style callback called with the error, if any, and ListSessionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Spanner.prototype.listSessions = function listSessions(request, callback) { + return this.rpcCall(listSessions, $root.google.spanner.v1.ListSessionsRequest, $root.google.spanner.v1.ListSessionsResponse, request, callback); + }, "name", { value: "ListSessions" }); + + /** + * Calls ListSessions. + * @function listSessions + * @memberof google.spanner.v1.Spanner + * @instance + * @param {google.spanner.v1.IListSessionsRequest} request ListSessionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.v1.Spanner|deleteSession}. + * @memberof google.spanner.v1.Spanner + * @typedef DeleteSessionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteSession. + * @function deleteSession + * @memberof google.spanner.v1.Spanner + * @instance + * @param {google.spanner.v1.IDeleteSessionRequest} request DeleteSessionRequest message or plain object + * @param {google.spanner.v1.Spanner.DeleteSessionCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Spanner.prototype.deleteSession = function deleteSession(request, callback) { + return this.rpcCall(deleteSession, $root.google.spanner.v1.DeleteSessionRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteSession" }); + + /** + * Calls DeleteSession. + * @function deleteSession + * @memberof google.spanner.v1.Spanner + * @instance + * @param {google.spanner.v1.IDeleteSessionRequest} request DeleteSessionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.v1.Spanner|executeSql}. + * @memberof google.spanner.v1.Spanner + * @typedef ExecuteSqlCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.spanner.v1.ResultSet} [response] ResultSet + */ + + /** + * Calls ExecuteSql. + * @function executeSql + * @memberof google.spanner.v1.Spanner + * @instance + * @param {google.spanner.v1.IExecuteSqlRequest} request ExecuteSqlRequest message or plain object + * @param {google.spanner.v1.Spanner.ExecuteSqlCallback} callback Node-style callback called with the error, if any, and ResultSet + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Spanner.prototype.executeSql = function executeSql(request, callback) { + return this.rpcCall(executeSql, $root.google.spanner.v1.ExecuteSqlRequest, $root.google.spanner.v1.ResultSet, request, callback); + }, "name", { value: "ExecuteSql" }); + + /** + * Calls ExecuteSql. + * @function executeSql + * @memberof google.spanner.v1.Spanner + * @instance + * @param {google.spanner.v1.IExecuteSqlRequest} request ExecuteSqlRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.v1.Spanner|executeStreamingSql}. + * @memberof google.spanner.v1.Spanner + * @typedef ExecuteStreamingSqlCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.spanner.v1.PartialResultSet} [response] PartialResultSet + */ + + /** + * Calls ExecuteStreamingSql. + * @function executeStreamingSql + * @memberof google.spanner.v1.Spanner + * @instance + * @param {google.spanner.v1.IExecuteSqlRequest} request ExecuteSqlRequest message or plain object + * @param {google.spanner.v1.Spanner.ExecuteStreamingSqlCallback} callback Node-style callback called with the error, if any, and PartialResultSet + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Spanner.prototype.executeStreamingSql = function executeStreamingSql(request, callback) { + return this.rpcCall(executeStreamingSql, $root.google.spanner.v1.ExecuteSqlRequest, $root.google.spanner.v1.PartialResultSet, request, callback); + }, "name", { value: "ExecuteStreamingSql" }); + + /** + * Calls ExecuteStreamingSql. + * @function executeStreamingSql + * @memberof google.spanner.v1.Spanner + * @instance + * @param {google.spanner.v1.IExecuteSqlRequest} request ExecuteSqlRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.v1.Spanner|executeBatchDml}. + * @memberof google.spanner.v1.Spanner + * @typedef ExecuteBatchDmlCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.spanner.v1.ExecuteBatchDmlResponse} [response] ExecuteBatchDmlResponse + */ + + /** + * Calls ExecuteBatchDml. + * @function executeBatchDml + * @memberof google.spanner.v1.Spanner + * @instance + * @param {google.spanner.v1.IExecuteBatchDmlRequest} request ExecuteBatchDmlRequest message or plain object + * @param {google.spanner.v1.Spanner.ExecuteBatchDmlCallback} callback Node-style callback called with the error, if any, and ExecuteBatchDmlResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Spanner.prototype.executeBatchDml = function executeBatchDml(request, callback) { + return this.rpcCall(executeBatchDml, $root.google.spanner.v1.ExecuteBatchDmlRequest, $root.google.spanner.v1.ExecuteBatchDmlResponse, request, callback); + }, "name", { value: "ExecuteBatchDml" }); + + /** + * Calls ExecuteBatchDml. + * @function executeBatchDml + * @memberof google.spanner.v1.Spanner + * @instance + * @param {google.spanner.v1.IExecuteBatchDmlRequest} request ExecuteBatchDmlRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.v1.Spanner|read}. + * @memberof google.spanner.v1.Spanner + * @typedef ReadCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.spanner.v1.ResultSet} [response] ResultSet + */ + + /** + * Calls Read. + * @function read + * @memberof google.spanner.v1.Spanner + * @instance + * @param {google.spanner.v1.IReadRequest} request ReadRequest message or plain object + * @param {google.spanner.v1.Spanner.ReadCallback} callback Node-style callback called with the error, if any, and ResultSet + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Spanner.prototype.read = function read(request, callback) { + return this.rpcCall(read, $root.google.spanner.v1.ReadRequest, $root.google.spanner.v1.ResultSet, request, callback); + }, "name", { value: "Read" }); + + /** + * Calls Read. + * @function read + * @memberof google.spanner.v1.Spanner + * @instance + * @param {google.spanner.v1.IReadRequest} request ReadRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.v1.Spanner|streamingRead}. + * @memberof google.spanner.v1.Spanner + * @typedef StreamingReadCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.spanner.v1.PartialResultSet} [response] PartialResultSet + */ + + /** + * Calls StreamingRead. + * @function streamingRead + * @memberof google.spanner.v1.Spanner + * @instance + * @param {google.spanner.v1.IReadRequest} request ReadRequest message or plain object + * @param {google.spanner.v1.Spanner.StreamingReadCallback} callback Node-style callback called with the error, if any, and PartialResultSet + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Spanner.prototype.streamingRead = function streamingRead(request, callback) { + return this.rpcCall(streamingRead, $root.google.spanner.v1.ReadRequest, $root.google.spanner.v1.PartialResultSet, request, callback); + }, "name", { value: "StreamingRead" }); + + /** + * Calls StreamingRead. + * @function streamingRead + * @memberof google.spanner.v1.Spanner + * @instance + * @param {google.spanner.v1.IReadRequest} request ReadRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.v1.Spanner|beginTransaction}. + * @memberof google.spanner.v1.Spanner + * @typedef BeginTransactionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.spanner.v1.Transaction} [response] Transaction + */ + + /** + * Calls BeginTransaction. + * @function beginTransaction + * @memberof google.spanner.v1.Spanner + * @instance + * @param {google.spanner.v1.IBeginTransactionRequest} request BeginTransactionRequest message or plain object + * @param {google.spanner.v1.Spanner.BeginTransactionCallback} callback Node-style callback called with the error, if any, and Transaction + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Spanner.prototype.beginTransaction = function beginTransaction(request, callback) { + return this.rpcCall(beginTransaction, $root.google.spanner.v1.BeginTransactionRequest, $root.google.spanner.v1.Transaction, request, callback); + }, "name", { value: "BeginTransaction" }); + + /** + * Calls BeginTransaction. + * @function beginTransaction + * @memberof google.spanner.v1.Spanner + * @instance + * @param {google.spanner.v1.IBeginTransactionRequest} request BeginTransactionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.v1.Spanner|commit}. + * @memberof google.spanner.v1.Spanner + * @typedef CommitCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.spanner.v1.CommitResponse} [response] CommitResponse + */ + + /** + * Calls Commit. + * @function commit + * @memberof google.spanner.v1.Spanner + * @instance + * @param {google.spanner.v1.ICommitRequest} request CommitRequest message or plain object + * @param {google.spanner.v1.Spanner.CommitCallback} callback Node-style callback called with the error, if any, and CommitResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Spanner.prototype.commit = function commit(request, callback) { + return this.rpcCall(commit, $root.google.spanner.v1.CommitRequest, $root.google.spanner.v1.CommitResponse, request, callback); + }, "name", { value: "Commit" }); + + /** + * Calls Commit. + * @function commit + * @memberof google.spanner.v1.Spanner + * @instance + * @param {google.spanner.v1.ICommitRequest} request CommitRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.v1.Spanner|rollback}. + * @memberof google.spanner.v1.Spanner + * @typedef RollbackCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls Rollback. + * @function rollback + * @memberof google.spanner.v1.Spanner + * @instance + * @param {google.spanner.v1.IRollbackRequest} request RollbackRequest message or plain object + * @param {google.spanner.v1.Spanner.RollbackCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Spanner.prototype.rollback = function rollback(request, callback) { + return this.rpcCall(rollback, $root.google.spanner.v1.RollbackRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "Rollback" }); + + /** + * Calls Rollback. + * @function rollback + * @memberof google.spanner.v1.Spanner + * @instance + * @param {google.spanner.v1.IRollbackRequest} request RollbackRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.v1.Spanner|partitionQuery}. + * @memberof google.spanner.v1.Spanner + * @typedef PartitionQueryCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.spanner.v1.PartitionResponse} [response] PartitionResponse + */ + + /** + * Calls PartitionQuery. + * @function partitionQuery + * @memberof google.spanner.v1.Spanner + * @instance + * @param {google.spanner.v1.IPartitionQueryRequest} request PartitionQueryRequest message or plain object + * @param {google.spanner.v1.Spanner.PartitionQueryCallback} callback Node-style callback called with the error, if any, and PartitionResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Spanner.prototype.partitionQuery = function partitionQuery(request, callback) { + return this.rpcCall(partitionQuery, $root.google.spanner.v1.PartitionQueryRequest, $root.google.spanner.v1.PartitionResponse, request, callback); + }, "name", { value: "PartitionQuery" }); + + /** + * Calls PartitionQuery. + * @function partitionQuery + * @memberof google.spanner.v1.Spanner + * @instance + * @param {google.spanner.v1.IPartitionQueryRequest} request PartitionQueryRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.v1.Spanner|partitionRead}. + * @memberof google.spanner.v1.Spanner + * @typedef PartitionReadCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.spanner.v1.PartitionResponse} [response] PartitionResponse + */ + + /** + * Calls PartitionRead. + * @function partitionRead + * @memberof google.spanner.v1.Spanner + * @instance + * @param {google.spanner.v1.IPartitionReadRequest} request PartitionReadRequest message or plain object + * @param {google.spanner.v1.Spanner.PartitionReadCallback} callback Node-style callback called with the error, if any, and PartitionResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Spanner.prototype.partitionRead = function partitionRead(request, callback) { + return this.rpcCall(partitionRead, $root.google.spanner.v1.PartitionReadRequest, $root.google.spanner.v1.PartitionResponse, request, callback); + }, "name", { value: "PartitionRead" }); + + /** + * Calls PartitionRead. + * @function partitionRead + * @memberof google.spanner.v1.Spanner + * @instance + * @param {google.spanner.v1.IPartitionReadRequest} request PartitionReadRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.v1.Spanner|batchWrite}. + * @memberof google.spanner.v1.Spanner + * @typedef BatchWriteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.spanner.v1.BatchWriteResponse} [response] BatchWriteResponse + */ + + /** + * Calls BatchWrite. + * @function batchWrite + * @memberof google.spanner.v1.Spanner + * @instance + * @param {google.spanner.v1.IBatchWriteRequest} request BatchWriteRequest message or plain object + * @param {google.spanner.v1.Spanner.BatchWriteCallback} callback Node-style callback called with the error, if any, and BatchWriteResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Spanner.prototype.batchWrite = function batchWrite(request, callback) { + return this.rpcCall(batchWrite, $root.google.spanner.v1.BatchWriteRequest, $root.google.spanner.v1.BatchWriteResponse, request, callback); + }, "name", { value: "BatchWrite" }); + + /** + * Calls BatchWrite. + * @function batchWrite + * @memberof google.spanner.v1.Spanner + * @instance + * @param {google.spanner.v1.IBatchWriteRequest} request BatchWriteRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Spanner; + })(); + + v1.CreateSessionRequest = (function() { + + /** + * Properties of a CreateSessionRequest. + * @memberof google.spanner.v1 + * @interface ICreateSessionRequest + * @property {string|null} [database] CreateSessionRequest database + * @property {google.spanner.v1.ISession|null} [session] CreateSessionRequest session + */ + + /** + * Constructs a new CreateSessionRequest. + * @memberof google.spanner.v1 + * @classdesc Represents a CreateSessionRequest. + * @implements ICreateSessionRequest + * @constructor + * @param {google.spanner.v1.ICreateSessionRequest=} [properties] Properties to set + */ + function CreateSessionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateSessionRequest database. + * @member {string} database + * @memberof google.spanner.v1.CreateSessionRequest + * @instance + */ + CreateSessionRequest.prototype.database = ""; + + /** + * CreateSessionRequest session. + * @member {google.spanner.v1.ISession|null|undefined} session + * @memberof google.spanner.v1.CreateSessionRequest + * @instance + */ + CreateSessionRequest.prototype.session = null; + + /** + * Creates a new CreateSessionRequest instance using the specified properties. + * @function create + * @memberof google.spanner.v1.CreateSessionRequest + * @static + * @param {google.spanner.v1.ICreateSessionRequest=} [properties] Properties to set + * @returns {google.spanner.v1.CreateSessionRequest} CreateSessionRequest instance + */ + CreateSessionRequest.create = function create(properties) { + return new CreateSessionRequest(properties); + }; + + /** + * Encodes the specified CreateSessionRequest message. Does not implicitly {@link google.spanner.v1.CreateSessionRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.CreateSessionRequest + * @static + * @param {google.spanner.v1.ICreateSessionRequest} message CreateSessionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSessionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.database != null && Object.hasOwnProperty.call(message, "database")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.database); + if (message.session != null && Object.hasOwnProperty.call(message, "session")) + $root.google.spanner.v1.Session.encode(message.session, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateSessionRequest message, length delimited. Does not implicitly {@link google.spanner.v1.CreateSessionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.CreateSessionRequest + * @static + * @param {google.spanner.v1.ICreateSessionRequest} message CreateSessionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSessionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateSessionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.CreateSessionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.CreateSessionRequest} CreateSessionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSessionRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.CreateSessionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.database = reader.string(); + break; + } + case 2: { + message.session = $root.google.spanner.v1.Session.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateSessionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.CreateSessionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.CreateSessionRequest} CreateSessionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSessionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateSessionRequest message. + * @function verify + * @memberof google.spanner.v1.CreateSessionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateSessionRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.database != null && message.hasOwnProperty("database")) + if (!$util.isString(message.database)) + return "database: string expected"; + if (message.session != null && message.hasOwnProperty("session")) { + var error = $root.google.spanner.v1.Session.verify(message.session); + if (error) + return "session." + error; + } + return null; + }; + + /** + * Creates a CreateSessionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.CreateSessionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.CreateSessionRequest} CreateSessionRequest + */ + CreateSessionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.CreateSessionRequest) + return object; + var message = new $root.google.spanner.v1.CreateSessionRequest(); + if (object.database != null) + message.database = String(object.database); + if (object.session != null) { + if (typeof object.session !== "object") + throw TypeError(".google.spanner.v1.CreateSessionRequest.session: object expected"); + message.session = $root.google.spanner.v1.Session.fromObject(object.session); + } + return message; + }; + + /** + * Creates a plain object from a CreateSessionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.CreateSessionRequest + * @static + * @param {google.spanner.v1.CreateSessionRequest} message CreateSessionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateSessionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.database = ""; + object.session = null; + } + if (message.database != null && message.hasOwnProperty("database")) + object.database = message.database; + if (message.session != null && message.hasOwnProperty("session")) + object.session = $root.google.spanner.v1.Session.toObject(message.session, options); + return object; + }; + + /** + * Converts this CreateSessionRequest to JSON. + * @function toJSON + * @memberof google.spanner.v1.CreateSessionRequest + * @instance + * @returns {Object.} JSON object + */ + CreateSessionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateSessionRequest + * @function getTypeUrl + * @memberof google.spanner.v1.CreateSessionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateSessionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.CreateSessionRequest"; + }; + + return CreateSessionRequest; + })(); + + v1.BatchCreateSessionsRequest = (function() { + + /** + * Properties of a BatchCreateSessionsRequest. + * @memberof google.spanner.v1 + * @interface IBatchCreateSessionsRequest + * @property {string|null} [database] BatchCreateSessionsRequest database + * @property {google.spanner.v1.ISession|null} [sessionTemplate] BatchCreateSessionsRequest sessionTemplate + * @property {number|null} [sessionCount] BatchCreateSessionsRequest sessionCount + */ + + /** + * Constructs a new BatchCreateSessionsRequest. + * @memberof google.spanner.v1 + * @classdesc Represents a BatchCreateSessionsRequest. + * @implements IBatchCreateSessionsRequest + * @constructor + * @param {google.spanner.v1.IBatchCreateSessionsRequest=} [properties] Properties to set + */ + function BatchCreateSessionsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchCreateSessionsRequest database. + * @member {string} database + * @memberof google.spanner.v1.BatchCreateSessionsRequest + * @instance + */ + BatchCreateSessionsRequest.prototype.database = ""; + + /** + * BatchCreateSessionsRequest sessionTemplate. + * @member {google.spanner.v1.ISession|null|undefined} sessionTemplate + * @memberof google.spanner.v1.BatchCreateSessionsRequest + * @instance + */ + BatchCreateSessionsRequest.prototype.sessionTemplate = null; + + /** + * BatchCreateSessionsRequest sessionCount. + * @member {number} sessionCount + * @memberof google.spanner.v1.BatchCreateSessionsRequest + * @instance + */ + BatchCreateSessionsRequest.prototype.sessionCount = 0; + + /** + * Creates a new BatchCreateSessionsRequest instance using the specified properties. + * @function create + * @memberof google.spanner.v1.BatchCreateSessionsRequest + * @static + * @param {google.spanner.v1.IBatchCreateSessionsRequest=} [properties] Properties to set + * @returns {google.spanner.v1.BatchCreateSessionsRequest} BatchCreateSessionsRequest instance + */ + BatchCreateSessionsRequest.create = function create(properties) { + return new BatchCreateSessionsRequest(properties); + }; + + /** + * Encodes the specified BatchCreateSessionsRequest message. Does not implicitly {@link google.spanner.v1.BatchCreateSessionsRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.BatchCreateSessionsRequest + * @static + * @param {google.spanner.v1.IBatchCreateSessionsRequest} message BatchCreateSessionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchCreateSessionsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.database != null && Object.hasOwnProperty.call(message, "database")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.database); + if (message.sessionTemplate != null && Object.hasOwnProperty.call(message, "sessionTemplate")) + $root.google.spanner.v1.Session.encode(message.sessionTemplate, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.sessionCount != null && Object.hasOwnProperty.call(message, "sessionCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.sessionCount); + return writer; + }; + + /** + * Encodes the specified BatchCreateSessionsRequest message, length delimited. Does not implicitly {@link google.spanner.v1.BatchCreateSessionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.BatchCreateSessionsRequest + * @static + * @param {google.spanner.v1.IBatchCreateSessionsRequest} message BatchCreateSessionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchCreateSessionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchCreateSessionsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.BatchCreateSessionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.BatchCreateSessionsRequest} BatchCreateSessionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchCreateSessionsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.BatchCreateSessionsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.database = reader.string(); + break; + } + case 2: { + message.sessionTemplate = $root.google.spanner.v1.Session.decode(reader, reader.uint32()); + break; + } + case 3: { + message.sessionCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchCreateSessionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.BatchCreateSessionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.BatchCreateSessionsRequest} BatchCreateSessionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchCreateSessionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchCreateSessionsRequest message. + * @function verify + * @memberof google.spanner.v1.BatchCreateSessionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchCreateSessionsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.database != null && message.hasOwnProperty("database")) + if (!$util.isString(message.database)) + return "database: string expected"; + if (message.sessionTemplate != null && message.hasOwnProperty("sessionTemplate")) { + var error = $root.google.spanner.v1.Session.verify(message.sessionTemplate); + if (error) + return "sessionTemplate." + error; + } + if (message.sessionCount != null && message.hasOwnProperty("sessionCount")) + if (!$util.isInteger(message.sessionCount)) + return "sessionCount: integer expected"; + return null; + }; + + /** + * Creates a BatchCreateSessionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.BatchCreateSessionsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.BatchCreateSessionsRequest} BatchCreateSessionsRequest + */ + BatchCreateSessionsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.BatchCreateSessionsRequest) + return object; + var message = new $root.google.spanner.v1.BatchCreateSessionsRequest(); + if (object.database != null) + message.database = String(object.database); + if (object.sessionTemplate != null) { + if (typeof object.sessionTemplate !== "object") + throw TypeError(".google.spanner.v1.BatchCreateSessionsRequest.sessionTemplate: object expected"); + message.sessionTemplate = $root.google.spanner.v1.Session.fromObject(object.sessionTemplate); + } + if (object.sessionCount != null) + message.sessionCount = object.sessionCount | 0; + return message; + }; + + /** + * Creates a plain object from a BatchCreateSessionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.BatchCreateSessionsRequest + * @static + * @param {google.spanner.v1.BatchCreateSessionsRequest} message BatchCreateSessionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchCreateSessionsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.database = ""; + object.sessionTemplate = null; + object.sessionCount = 0; + } + if (message.database != null && message.hasOwnProperty("database")) + object.database = message.database; + if (message.sessionTemplate != null && message.hasOwnProperty("sessionTemplate")) + object.sessionTemplate = $root.google.spanner.v1.Session.toObject(message.sessionTemplate, options); + if (message.sessionCount != null && message.hasOwnProperty("sessionCount")) + object.sessionCount = message.sessionCount; + return object; + }; + + /** + * Converts this BatchCreateSessionsRequest to JSON. + * @function toJSON + * @memberof google.spanner.v1.BatchCreateSessionsRequest + * @instance + * @returns {Object.} JSON object + */ + BatchCreateSessionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchCreateSessionsRequest + * @function getTypeUrl + * @memberof google.spanner.v1.BatchCreateSessionsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchCreateSessionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.BatchCreateSessionsRequest"; + }; + + return BatchCreateSessionsRequest; + })(); + + v1.BatchCreateSessionsResponse = (function() { + + /** + * Properties of a BatchCreateSessionsResponse. + * @memberof google.spanner.v1 + * @interface IBatchCreateSessionsResponse + * @property {Array.|null} [session] BatchCreateSessionsResponse session + */ + + /** + * Constructs a new BatchCreateSessionsResponse. + * @memberof google.spanner.v1 + * @classdesc Represents a BatchCreateSessionsResponse. + * @implements IBatchCreateSessionsResponse + * @constructor + * @param {google.spanner.v1.IBatchCreateSessionsResponse=} [properties] Properties to set + */ + function BatchCreateSessionsResponse(properties) { + this.session = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchCreateSessionsResponse session. + * @member {Array.} session + * @memberof google.spanner.v1.BatchCreateSessionsResponse + * @instance + */ + BatchCreateSessionsResponse.prototype.session = $util.emptyArray; + + /** + * Creates a new BatchCreateSessionsResponse instance using the specified properties. + * @function create + * @memberof google.spanner.v1.BatchCreateSessionsResponse + * @static + * @param {google.spanner.v1.IBatchCreateSessionsResponse=} [properties] Properties to set + * @returns {google.spanner.v1.BatchCreateSessionsResponse} BatchCreateSessionsResponse instance + */ + BatchCreateSessionsResponse.create = function create(properties) { + return new BatchCreateSessionsResponse(properties); + }; + + /** + * Encodes the specified BatchCreateSessionsResponse message. Does not implicitly {@link google.spanner.v1.BatchCreateSessionsResponse.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.BatchCreateSessionsResponse + * @static + * @param {google.spanner.v1.IBatchCreateSessionsResponse} message BatchCreateSessionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchCreateSessionsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.session != null && message.session.length) + for (var i = 0; i < message.session.length; ++i) + $root.google.spanner.v1.Session.encode(message.session[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchCreateSessionsResponse message, length delimited. Does not implicitly {@link google.spanner.v1.BatchCreateSessionsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.BatchCreateSessionsResponse + * @static + * @param {google.spanner.v1.IBatchCreateSessionsResponse} message BatchCreateSessionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchCreateSessionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchCreateSessionsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.BatchCreateSessionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.BatchCreateSessionsResponse} BatchCreateSessionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchCreateSessionsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.BatchCreateSessionsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.session && message.session.length)) + message.session = []; + message.session.push($root.google.spanner.v1.Session.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchCreateSessionsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.BatchCreateSessionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.BatchCreateSessionsResponse} BatchCreateSessionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchCreateSessionsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchCreateSessionsResponse message. + * @function verify + * @memberof google.spanner.v1.BatchCreateSessionsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchCreateSessionsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.session != null && message.hasOwnProperty("session")) { + if (!Array.isArray(message.session)) + return "session: array expected"; + for (var i = 0; i < message.session.length; ++i) { + var error = $root.google.spanner.v1.Session.verify(message.session[i]); + if (error) + return "session." + error; + } + } + return null; + }; + + /** + * Creates a BatchCreateSessionsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.BatchCreateSessionsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.BatchCreateSessionsResponse} BatchCreateSessionsResponse + */ + BatchCreateSessionsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.BatchCreateSessionsResponse) + return object; + var message = new $root.google.spanner.v1.BatchCreateSessionsResponse(); + if (object.session) { + if (!Array.isArray(object.session)) + throw TypeError(".google.spanner.v1.BatchCreateSessionsResponse.session: array expected"); + message.session = []; + for (var i = 0; i < object.session.length; ++i) { + if (typeof object.session[i] !== "object") + throw TypeError(".google.spanner.v1.BatchCreateSessionsResponse.session: object expected"); + message.session[i] = $root.google.spanner.v1.Session.fromObject(object.session[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BatchCreateSessionsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.BatchCreateSessionsResponse + * @static + * @param {google.spanner.v1.BatchCreateSessionsResponse} message BatchCreateSessionsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchCreateSessionsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.session = []; + if (message.session && message.session.length) { + object.session = []; + for (var j = 0; j < message.session.length; ++j) + object.session[j] = $root.google.spanner.v1.Session.toObject(message.session[j], options); + } + return object; + }; + + /** + * Converts this BatchCreateSessionsResponse to JSON. + * @function toJSON + * @memberof google.spanner.v1.BatchCreateSessionsResponse + * @instance + * @returns {Object.} JSON object + */ + BatchCreateSessionsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchCreateSessionsResponse + * @function getTypeUrl + * @memberof google.spanner.v1.BatchCreateSessionsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchCreateSessionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.BatchCreateSessionsResponse"; + }; + + return BatchCreateSessionsResponse; + })(); + + v1.Session = (function() { + + /** + * Properties of a Session. + * @memberof google.spanner.v1 + * @interface ISession + * @property {string|null} [name] Session name + * @property {Object.|null} [labels] Session labels + * @property {google.protobuf.ITimestamp|null} [createTime] Session createTime + * @property {google.protobuf.ITimestamp|null} [approximateLastUseTime] Session approximateLastUseTime + * @property {string|null} [creatorRole] Session creatorRole + * @property {boolean|null} [multiplexed] Session multiplexed + */ + + /** + * Constructs a new Session. + * @memberof google.spanner.v1 + * @classdesc Represents a Session. + * @implements ISession + * @constructor + * @param {google.spanner.v1.ISession=} [properties] Properties to set + */ + function Session(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]]; + } + + /** + * Session name. + * @member {string} name + * @memberof google.spanner.v1.Session + * @instance + */ + Session.prototype.name = ""; + + /** + * Session labels. + * @member {Object.} labels + * @memberof google.spanner.v1.Session + * @instance + */ + Session.prototype.labels = $util.emptyObject; + + /** + * Session createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.spanner.v1.Session + * @instance + */ + Session.prototype.createTime = null; + + /** + * Session approximateLastUseTime. + * @member {google.protobuf.ITimestamp|null|undefined} approximateLastUseTime + * @memberof google.spanner.v1.Session + * @instance + */ + Session.prototype.approximateLastUseTime = null; + + /** + * Session creatorRole. + * @member {string} creatorRole + * @memberof google.spanner.v1.Session + * @instance + */ + Session.prototype.creatorRole = ""; + + /** + * Session multiplexed. + * @member {boolean} multiplexed + * @memberof google.spanner.v1.Session + * @instance + */ + Session.prototype.multiplexed = false; + + /** + * Creates a new Session instance using the specified properties. + * @function create + * @memberof google.spanner.v1.Session + * @static + * @param {google.spanner.v1.ISession=} [properties] Properties to set + * @returns {google.spanner.v1.Session} Session instance + */ + Session.create = function create(properties) { + return new Session(properties); + }; + + /** + * Encodes the specified Session message. Does not implicitly {@link google.spanner.v1.Session.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.Session + * @static + * @param {google.spanner.v1.ISession} message Session message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Session.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.approximateLastUseTime != null && Object.hasOwnProperty.call(message, "approximateLastUseTime")) + $root.google.protobuf.Timestamp.encode(message.approximateLastUseTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.creatorRole != null && Object.hasOwnProperty.call(message, "creatorRole")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.creatorRole); + if (message.multiplexed != null && Object.hasOwnProperty.call(message, "multiplexed")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.multiplexed); + return writer; + }; + + /** + * Encodes the specified Session message, length delimited. Does not implicitly {@link google.spanner.v1.Session.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.Session + * @static + * @param {google.spanner.v1.ISession} message Session message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Session.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Session message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.Session + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.Session} Session + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Session.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.Session(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 3: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.approximateLastUseTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.creatorRole = reader.string(); + break; + } + case 6: { + message.multiplexed = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Session message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.Session + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.Session} Session + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Session.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Session message. + * @function verify + * @memberof google.spanner.v1.Session + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Session.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.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.approximateLastUseTime != null && message.hasOwnProperty("approximateLastUseTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.approximateLastUseTime); + if (error) + return "approximateLastUseTime." + error; + } + if (message.creatorRole != null && message.hasOwnProperty("creatorRole")) + if (!$util.isString(message.creatorRole)) + return "creatorRole: string expected"; + if (message.multiplexed != null && message.hasOwnProperty("multiplexed")) + if (typeof message.multiplexed !== "boolean") + return "multiplexed: boolean expected"; + return null; + }; + + /** + * Creates a Session message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.Session + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.Session} Session + */ + Session.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.Session) + return object; + var message = new $root.google.spanner.v1.Session(); + if (object.name != null) + message.name = String(object.name); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.spanner.v1.Session.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.spanner.v1.Session.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.approximateLastUseTime != null) { + if (typeof object.approximateLastUseTime !== "object") + throw TypeError(".google.spanner.v1.Session.approximateLastUseTime: object expected"); + message.approximateLastUseTime = $root.google.protobuf.Timestamp.fromObject(object.approximateLastUseTime); + } + if (object.creatorRole != null) + message.creatorRole = String(object.creatorRole); + if (object.multiplexed != null) + message.multiplexed = Boolean(object.multiplexed); + return message; + }; + + /** + * Creates a plain object from a Session message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.Session + * @static + * @param {google.spanner.v1.Session} message Session + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Session.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.approximateLastUseTime = null; + object.creatorRole = ""; + object.multiplexed = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.approximateLastUseTime != null && message.hasOwnProperty("approximateLastUseTime")) + object.approximateLastUseTime = $root.google.protobuf.Timestamp.toObject(message.approximateLastUseTime, options); + if (message.creatorRole != null && message.hasOwnProperty("creatorRole")) + object.creatorRole = message.creatorRole; + if (message.multiplexed != null && message.hasOwnProperty("multiplexed")) + object.multiplexed = message.multiplexed; + return object; + }; + + /** + * Converts this Session to JSON. + * @function toJSON + * @memberof google.spanner.v1.Session + * @instance + * @returns {Object.} JSON object + */ + Session.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Session + * @function getTypeUrl + * @memberof google.spanner.v1.Session + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Session.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.Session"; + }; + + return Session; + })(); + + v1.GetSessionRequest = (function() { + + /** + * Properties of a GetSessionRequest. + * @memberof google.spanner.v1 + * @interface IGetSessionRequest + * @property {string|null} [name] GetSessionRequest name + */ + + /** + * Constructs a new GetSessionRequest. + * @memberof google.spanner.v1 + * @classdesc Represents a GetSessionRequest. + * @implements IGetSessionRequest + * @constructor + * @param {google.spanner.v1.IGetSessionRequest=} [properties] Properties to set + */ + function GetSessionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetSessionRequest name. + * @member {string} name + * @memberof google.spanner.v1.GetSessionRequest + * @instance + */ + GetSessionRequest.prototype.name = ""; + + /** + * Creates a new GetSessionRequest instance using the specified properties. + * @function create + * @memberof google.spanner.v1.GetSessionRequest + * @static + * @param {google.spanner.v1.IGetSessionRequest=} [properties] Properties to set + * @returns {google.spanner.v1.GetSessionRequest} GetSessionRequest instance + */ + GetSessionRequest.create = function create(properties) { + return new GetSessionRequest(properties); + }; + + /** + * Encodes the specified GetSessionRequest message. Does not implicitly {@link google.spanner.v1.GetSessionRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.GetSessionRequest + * @static + * @param {google.spanner.v1.IGetSessionRequest} message GetSessionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSessionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetSessionRequest message, length delimited. Does not implicitly {@link google.spanner.v1.GetSessionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.GetSessionRequest + * @static + * @param {google.spanner.v1.IGetSessionRequest} message GetSessionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSessionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetSessionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.GetSessionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.GetSessionRequest} GetSessionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSessionRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.GetSessionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetSessionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.GetSessionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.GetSessionRequest} GetSessionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSessionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetSessionRequest message. + * @function verify + * @memberof google.spanner.v1.GetSessionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetSessionRequest.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 GetSessionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.GetSessionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.GetSessionRequest} GetSessionRequest + */ + GetSessionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.GetSessionRequest) + return object; + var message = new $root.google.spanner.v1.GetSessionRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetSessionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.GetSessionRequest + * @static + * @param {google.spanner.v1.GetSessionRequest} message GetSessionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetSessionRequest.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 GetSessionRequest to JSON. + * @function toJSON + * @memberof google.spanner.v1.GetSessionRequest + * @instance + * @returns {Object.} JSON object + */ + GetSessionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetSessionRequest + * @function getTypeUrl + * @memberof google.spanner.v1.GetSessionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetSessionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.GetSessionRequest"; + }; + + return GetSessionRequest; + })(); + + v1.ListSessionsRequest = (function() { + + /** + * Properties of a ListSessionsRequest. + * @memberof google.spanner.v1 + * @interface IListSessionsRequest + * @property {string|null} [database] ListSessionsRequest database + * @property {number|null} [pageSize] ListSessionsRequest pageSize + * @property {string|null} [pageToken] ListSessionsRequest pageToken + * @property {string|null} [filter] ListSessionsRequest filter + */ + + /** + * Constructs a new ListSessionsRequest. + * @memberof google.spanner.v1 + * @classdesc Represents a ListSessionsRequest. + * @implements IListSessionsRequest + * @constructor + * @param {google.spanner.v1.IListSessionsRequest=} [properties] Properties to set + */ + function ListSessionsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListSessionsRequest database. + * @member {string} database + * @memberof google.spanner.v1.ListSessionsRequest + * @instance + */ + ListSessionsRequest.prototype.database = ""; + + /** + * ListSessionsRequest pageSize. + * @member {number} pageSize + * @memberof google.spanner.v1.ListSessionsRequest + * @instance + */ + ListSessionsRequest.prototype.pageSize = 0; + + /** + * ListSessionsRequest pageToken. + * @member {string} pageToken + * @memberof google.spanner.v1.ListSessionsRequest + * @instance + */ + ListSessionsRequest.prototype.pageToken = ""; + + /** + * ListSessionsRequest filter. + * @member {string} filter + * @memberof google.spanner.v1.ListSessionsRequest + * @instance + */ + ListSessionsRequest.prototype.filter = ""; + + /** + * Creates a new ListSessionsRequest instance using the specified properties. + * @function create + * @memberof google.spanner.v1.ListSessionsRequest + * @static + * @param {google.spanner.v1.IListSessionsRequest=} [properties] Properties to set + * @returns {google.spanner.v1.ListSessionsRequest} ListSessionsRequest instance + */ + ListSessionsRequest.create = function create(properties) { + return new ListSessionsRequest(properties); + }; + + /** + * Encodes the specified ListSessionsRequest message. Does not implicitly {@link google.spanner.v1.ListSessionsRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.ListSessionsRequest + * @static + * @param {google.spanner.v1.IListSessionsRequest} message ListSessionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSessionsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.database != null && Object.hasOwnProperty.call(message, "database")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.database); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + return writer; + }; + + /** + * Encodes the specified ListSessionsRequest message, length delimited. Does not implicitly {@link google.spanner.v1.ListSessionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.ListSessionsRequest + * @static + * @param {google.spanner.v1.IListSessionsRequest} message ListSessionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSessionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSessionsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.ListSessionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.ListSessionsRequest} ListSessionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSessionsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.ListSessionsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.database = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSessionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.ListSessionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.ListSessionsRequest} ListSessionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSessionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSessionsRequest message. + * @function verify + * @memberof google.spanner.v1.ListSessionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSessionsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.database != null && message.hasOwnProperty("database")) + if (!$util.isString(message.database)) + return "database: 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.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; + + /** + * Creates a ListSessionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.ListSessionsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.ListSessionsRequest} ListSessionsRequest + */ + ListSessionsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.ListSessionsRequest) + return object; + var message = new $root.google.spanner.v1.ListSessionsRequest(); + if (object.database != null) + message.database = String(object.database); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; + + /** + * Creates a plain object from a ListSessionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.ListSessionsRequest + * @static + * @param {google.spanner.v1.ListSessionsRequest} message ListSessionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSessionsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.database = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + } + if (message.database != null && message.hasOwnProperty("database")) + object.database = message.database; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; + + /** + * Converts this ListSessionsRequest to JSON. + * @function toJSON + * @memberof google.spanner.v1.ListSessionsRequest + * @instance + * @returns {Object.} JSON object + */ + ListSessionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSessionsRequest + * @function getTypeUrl + * @memberof google.spanner.v1.ListSessionsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSessionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.ListSessionsRequest"; + }; + + return ListSessionsRequest; + })(); + + v1.ListSessionsResponse = (function() { + + /** + * Properties of a ListSessionsResponse. + * @memberof google.spanner.v1 + * @interface IListSessionsResponse + * @property {Array.|null} [sessions] ListSessionsResponse sessions + * @property {string|null} [nextPageToken] ListSessionsResponse nextPageToken + */ + + /** + * Constructs a new ListSessionsResponse. + * @memberof google.spanner.v1 + * @classdesc Represents a ListSessionsResponse. + * @implements IListSessionsResponse + * @constructor + * @param {google.spanner.v1.IListSessionsResponse=} [properties] Properties to set + */ + function ListSessionsResponse(properties) { + this.sessions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListSessionsResponse sessions. + * @member {Array.} sessions + * @memberof google.spanner.v1.ListSessionsResponse + * @instance + */ + ListSessionsResponse.prototype.sessions = $util.emptyArray; + + /** + * ListSessionsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.spanner.v1.ListSessionsResponse + * @instance + */ + ListSessionsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListSessionsResponse instance using the specified properties. + * @function create + * @memberof google.spanner.v1.ListSessionsResponse + * @static + * @param {google.spanner.v1.IListSessionsResponse=} [properties] Properties to set + * @returns {google.spanner.v1.ListSessionsResponse} ListSessionsResponse instance + */ + ListSessionsResponse.create = function create(properties) { + return new ListSessionsResponse(properties); + }; + + /** + * Encodes the specified ListSessionsResponse message. Does not implicitly {@link google.spanner.v1.ListSessionsResponse.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.ListSessionsResponse + * @static + * @param {google.spanner.v1.IListSessionsResponse} message ListSessionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSessionsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sessions != null && message.sessions.length) + for (var i = 0; i < message.sessions.length; ++i) + $root.google.spanner.v1.Session.encode(message.sessions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListSessionsResponse message, length delimited. Does not implicitly {@link google.spanner.v1.ListSessionsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.ListSessionsResponse + * @static + * @param {google.spanner.v1.IListSessionsResponse} message ListSessionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSessionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSessionsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.ListSessionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.ListSessionsResponse} ListSessionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSessionsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.ListSessionsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.sessions && message.sessions.length)) + message.sessions = []; + message.sessions.push($root.google.spanner.v1.Session.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSessionsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.ListSessionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.ListSessionsResponse} ListSessionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSessionsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSessionsResponse message. + * @function verify + * @memberof google.spanner.v1.ListSessionsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSessionsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sessions != null && message.hasOwnProperty("sessions")) { + if (!Array.isArray(message.sessions)) + return "sessions: array expected"; + for (var i = 0; i < message.sessions.length; ++i) { + var error = $root.google.spanner.v1.Session.verify(message.sessions[i]); + if (error) + return "sessions." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListSessionsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.ListSessionsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.ListSessionsResponse} ListSessionsResponse + */ + ListSessionsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.ListSessionsResponse) + return object; + var message = new $root.google.spanner.v1.ListSessionsResponse(); + if (object.sessions) { + if (!Array.isArray(object.sessions)) + throw TypeError(".google.spanner.v1.ListSessionsResponse.sessions: array expected"); + message.sessions = []; + for (var i = 0; i < object.sessions.length; ++i) { + if (typeof object.sessions[i] !== "object") + throw TypeError(".google.spanner.v1.ListSessionsResponse.sessions: object expected"); + message.sessions[i] = $root.google.spanner.v1.Session.fromObject(object.sessions[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListSessionsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.ListSessionsResponse + * @static + * @param {google.spanner.v1.ListSessionsResponse} message ListSessionsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSessionsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.sessions = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.sessions && message.sessions.length) { + object.sessions = []; + for (var j = 0; j < message.sessions.length; ++j) + object.sessions[j] = $root.google.spanner.v1.Session.toObject(message.sessions[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListSessionsResponse to JSON. + * @function toJSON + * @memberof google.spanner.v1.ListSessionsResponse + * @instance + * @returns {Object.} JSON object + */ + ListSessionsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSessionsResponse + * @function getTypeUrl + * @memberof google.spanner.v1.ListSessionsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSessionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.ListSessionsResponse"; + }; + + return ListSessionsResponse; + })(); + + v1.DeleteSessionRequest = (function() { + + /** + * Properties of a DeleteSessionRequest. + * @memberof google.spanner.v1 + * @interface IDeleteSessionRequest + * @property {string|null} [name] DeleteSessionRequest name + */ + + /** + * Constructs a new DeleteSessionRequest. + * @memberof google.spanner.v1 + * @classdesc Represents a DeleteSessionRequest. + * @implements IDeleteSessionRequest + * @constructor + * @param {google.spanner.v1.IDeleteSessionRequest=} [properties] Properties to set + */ + function DeleteSessionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteSessionRequest name. + * @member {string} name + * @memberof google.spanner.v1.DeleteSessionRequest + * @instance + */ + DeleteSessionRequest.prototype.name = ""; + + /** + * Creates a new DeleteSessionRequest instance using the specified properties. + * @function create + * @memberof google.spanner.v1.DeleteSessionRequest + * @static + * @param {google.spanner.v1.IDeleteSessionRequest=} [properties] Properties to set + * @returns {google.spanner.v1.DeleteSessionRequest} DeleteSessionRequest instance + */ + DeleteSessionRequest.create = function create(properties) { + return new DeleteSessionRequest(properties); + }; + + /** + * Encodes the specified DeleteSessionRequest message. Does not implicitly {@link google.spanner.v1.DeleteSessionRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.DeleteSessionRequest + * @static + * @param {google.spanner.v1.IDeleteSessionRequest} message DeleteSessionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSessionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteSessionRequest message, length delimited. Does not implicitly {@link google.spanner.v1.DeleteSessionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.DeleteSessionRequest + * @static + * @param {google.spanner.v1.IDeleteSessionRequest} message DeleteSessionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSessionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteSessionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.DeleteSessionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.DeleteSessionRequest} DeleteSessionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSessionRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.DeleteSessionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteSessionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.DeleteSessionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.DeleteSessionRequest} DeleteSessionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSessionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteSessionRequest message. + * @function verify + * @memberof google.spanner.v1.DeleteSessionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteSessionRequest.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 DeleteSessionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.DeleteSessionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.DeleteSessionRequest} DeleteSessionRequest + */ + DeleteSessionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.DeleteSessionRequest) + return object; + var message = new $root.google.spanner.v1.DeleteSessionRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteSessionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.DeleteSessionRequest + * @static + * @param {google.spanner.v1.DeleteSessionRequest} message DeleteSessionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteSessionRequest.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 DeleteSessionRequest to JSON. + * @function toJSON + * @memberof google.spanner.v1.DeleteSessionRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteSessionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteSessionRequest + * @function getTypeUrl + * @memberof google.spanner.v1.DeleteSessionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteSessionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.DeleteSessionRequest"; + }; + + return DeleteSessionRequest; + })(); + + v1.RequestOptions = (function() { + + /** + * Properties of a RequestOptions. + * @memberof google.spanner.v1 + * @interface IRequestOptions + * @property {google.spanner.v1.RequestOptions.Priority|null} [priority] RequestOptions priority + * @property {string|null} [requestTag] RequestOptions requestTag + * @property {string|null} [transactionTag] RequestOptions transactionTag + * @property {google.spanner.v1.RequestOptions.IClientContext|null} [clientContext] RequestOptions clientContext + */ + + /** + * Constructs a new RequestOptions. + * @memberof google.spanner.v1 + * @classdesc Represents a RequestOptions. + * @implements IRequestOptions + * @constructor + * @param {google.spanner.v1.IRequestOptions=} [properties] Properties to set + */ + function RequestOptions(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RequestOptions priority. + * @member {google.spanner.v1.RequestOptions.Priority} priority + * @memberof google.spanner.v1.RequestOptions + * @instance + */ + RequestOptions.prototype.priority = 0; + + /** + * RequestOptions requestTag. + * @member {string} requestTag + * @memberof google.spanner.v1.RequestOptions + * @instance + */ + RequestOptions.prototype.requestTag = ""; + + /** + * RequestOptions transactionTag. + * @member {string} transactionTag + * @memberof google.spanner.v1.RequestOptions + * @instance + */ + RequestOptions.prototype.transactionTag = ""; + + /** + * RequestOptions clientContext. + * @member {google.spanner.v1.RequestOptions.IClientContext|null|undefined} clientContext + * @memberof google.spanner.v1.RequestOptions + * @instance + */ + RequestOptions.prototype.clientContext = null; + + /** + * Creates a new RequestOptions instance using the specified properties. + * @function create + * @memberof google.spanner.v1.RequestOptions + * @static + * @param {google.spanner.v1.IRequestOptions=} [properties] Properties to set + * @returns {google.spanner.v1.RequestOptions} RequestOptions instance + */ + RequestOptions.create = function create(properties) { + return new RequestOptions(properties); + }; + + /** + * Encodes the specified RequestOptions message. Does not implicitly {@link google.spanner.v1.RequestOptions.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.RequestOptions + * @static + * @param {google.spanner.v1.IRequestOptions} message RequestOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.priority != null && Object.hasOwnProperty.call(message, "priority")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.priority); + if (message.requestTag != null && Object.hasOwnProperty.call(message, "requestTag")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestTag); + if (message.transactionTag != null && Object.hasOwnProperty.call(message, "transactionTag")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.transactionTag); + if (message.clientContext != null && Object.hasOwnProperty.call(message, "clientContext")) + $root.google.spanner.v1.RequestOptions.ClientContext.encode(message.clientContext, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RequestOptions message, length delimited. Does not implicitly {@link google.spanner.v1.RequestOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.RequestOptions + * @static + * @param {google.spanner.v1.IRequestOptions} message RequestOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RequestOptions message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.RequestOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.RequestOptions} RequestOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.RequestOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.priority = reader.int32(); + break; + } + case 2: { + message.requestTag = reader.string(); + break; + } + case 3: { + message.transactionTag = reader.string(); + break; + } + case 4: { + message.clientContext = $root.google.spanner.v1.RequestOptions.ClientContext.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RequestOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.RequestOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.RequestOptions} RequestOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RequestOptions message. + * @function verify + * @memberof google.spanner.v1.RequestOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RequestOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.priority != null && message.hasOwnProperty("priority")) + switch (message.priority) { + default: + return "priority: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.requestTag != null && message.hasOwnProperty("requestTag")) + if (!$util.isString(message.requestTag)) + return "requestTag: string expected"; + if (message.transactionTag != null && message.hasOwnProperty("transactionTag")) + if (!$util.isString(message.transactionTag)) + return "transactionTag: string expected"; + if (message.clientContext != null && message.hasOwnProperty("clientContext")) { + var error = $root.google.spanner.v1.RequestOptions.ClientContext.verify(message.clientContext); + if (error) + return "clientContext." + error; + } + return null; + }; + + /** + * Creates a RequestOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.RequestOptions + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.RequestOptions} RequestOptions + */ + RequestOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.RequestOptions) + return object; + var message = new $root.google.spanner.v1.RequestOptions(); + switch (object.priority) { + default: + if (typeof object.priority === "number") { + message.priority = object.priority; + break; + } + break; + case "PRIORITY_UNSPECIFIED": + case 0: + message.priority = 0; + break; + case "PRIORITY_LOW": + case 1: + message.priority = 1; + break; + case "PRIORITY_MEDIUM": + case 2: + message.priority = 2; + break; + case "PRIORITY_HIGH": + case 3: + message.priority = 3; + break; + } + if (object.requestTag != null) + message.requestTag = String(object.requestTag); + if (object.transactionTag != null) + message.transactionTag = String(object.transactionTag); + if (object.clientContext != null) { + if (typeof object.clientContext !== "object") + throw TypeError(".google.spanner.v1.RequestOptions.clientContext: object expected"); + message.clientContext = $root.google.spanner.v1.RequestOptions.ClientContext.fromObject(object.clientContext); + } + return message; + }; + + /** + * Creates a plain object from a RequestOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.RequestOptions + * @static + * @param {google.spanner.v1.RequestOptions} message RequestOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RequestOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.priority = options.enums === String ? "PRIORITY_UNSPECIFIED" : 0; + object.requestTag = ""; + object.transactionTag = ""; + object.clientContext = null; + } + if (message.priority != null && message.hasOwnProperty("priority")) + object.priority = options.enums === String ? $root.google.spanner.v1.RequestOptions.Priority[message.priority] === undefined ? message.priority : $root.google.spanner.v1.RequestOptions.Priority[message.priority] : message.priority; + if (message.requestTag != null && message.hasOwnProperty("requestTag")) + object.requestTag = message.requestTag; + if (message.transactionTag != null && message.hasOwnProperty("transactionTag")) + object.transactionTag = message.transactionTag; + if (message.clientContext != null && message.hasOwnProperty("clientContext")) + object.clientContext = $root.google.spanner.v1.RequestOptions.ClientContext.toObject(message.clientContext, options); + return object; + }; + + /** + * Converts this RequestOptions to JSON. + * @function toJSON + * @memberof google.spanner.v1.RequestOptions + * @instance + * @returns {Object.} JSON object + */ + RequestOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RequestOptions + * @function getTypeUrl + * @memberof google.spanner.v1.RequestOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RequestOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.RequestOptions"; + }; + + /** + * Priority enum. + * @name google.spanner.v1.RequestOptions.Priority + * @enum {number} + * @property {number} PRIORITY_UNSPECIFIED=0 PRIORITY_UNSPECIFIED value + * @property {number} PRIORITY_LOW=1 PRIORITY_LOW value + * @property {number} PRIORITY_MEDIUM=2 PRIORITY_MEDIUM value + * @property {number} PRIORITY_HIGH=3 PRIORITY_HIGH value + */ + RequestOptions.Priority = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PRIORITY_UNSPECIFIED"] = 0; + values[valuesById[1] = "PRIORITY_LOW"] = 1; + values[valuesById[2] = "PRIORITY_MEDIUM"] = 2; + values[valuesById[3] = "PRIORITY_HIGH"] = 3; + return values; + })(); + + RequestOptions.ClientContext = (function() { + + /** + * Properties of a ClientContext. + * @memberof google.spanner.v1.RequestOptions + * @interface IClientContext + * @property {Object.|null} [secureContext] ClientContext secureContext + */ + + /** + * Constructs a new ClientContext. + * @memberof google.spanner.v1.RequestOptions + * @classdesc Represents a ClientContext. + * @implements IClientContext + * @constructor + * @param {google.spanner.v1.RequestOptions.IClientContext=} [properties] Properties to set + */ + function ClientContext(properties) { + this.secureContext = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClientContext secureContext. + * @member {Object.} secureContext + * @memberof google.spanner.v1.RequestOptions.ClientContext + * @instance + */ + ClientContext.prototype.secureContext = $util.emptyObject; + + /** + * Creates a new ClientContext instance using the specified properties. + * @function create + * @memberof google.spanner.v1.RequestOptions.ClientContext + * @static + * @param {google.spanner.v1.RequestOptions.IClientContext=} [properties] Properties to set + * @returns {google.spanner.v1.RequestOptions.ClientContext} ClientContext instance + */ + ClientContext.create = function create(properties) { + return new ClientContext(properties); + }; + + /** + * Encodes the specified ClientContext message. Does not implicitly {@link google.spanner.v1.RequestOptions.ClientContext.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.RequestOptions.ClientContext + * @static + * @param {google.spanner.v1.RequestOptions.IClientContext} message ClientContext message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientContext.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.secureContext != null && Object.hasOwnProperty.call(message, "secureContext")) + for (var keys = Object.keys(message.secureContext), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.protobuf.Value.encode(message.secureContext[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified ClientContext message, length delimited. Does not implicitly {@link google.spanner.v1.RequestOptions.ClientContext.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.RequestOptions.ClientContext + * @static + * @param {google.spanner.v1.RequestOptions.IClientContext} message ClientContext message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientContext.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClientContext message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.RequestOptions.ClientContext + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.RequestOptions.ClientContext} ClientContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientContext.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.RequestOptions.ClientContext(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (message.secureContext === $util.emptyObject) + message.secureContext = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.secureContext[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClientContext message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.RequestOptions.ClientContext + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.RequestOptions.ClientContext} ClientContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientContext.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClientContext message. + * @function verify + * @memberof google.spanner.v1.RequestOptions.ClientContext + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClientContext.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.secureContext != null && message.hasOwnProperty("secureContext")) { + if (!$util.isObject(message.secureContext)) + return "secureContext: object expected"; + var key = Object.keys(message.secureContext); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.secureContext[key[i]]); + if (error) + return "secureContext." + error; + } + } + return null; + }; + + /** + * Creates a ClientContext message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.RequestOptions.ClientContext + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.RequestOptions.ClientContext} ClientContext + */ + ClientContext.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.RequestOptions.ClientContext) + return object; + var message = new $root.google.spanner.v1.RequestOptions.ClientContext(); + if (object.secureContext) { + if (typeof object.secureContext !== "object") + throw TypeError(".google.spanner.v1.RequestOptions.ClientContext.secureContext: object expected"); + message.secureContext = {}; + for (var keys = Object.keys(object.secureContext), i = 0; i < keys.length; ++i) { + if (typeof object.secureContext[keys[i]] !== "object") + throw TypeError(".google.spanner.v1.RequestOptions.ClientContext.secureContext: object expected"); + message.secureContext[keys[i]] = $root.google.protobuf.Value.fromObject(object.secureContext[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a ClientContext message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.RequestOptions.ClientContext + * @static + * @param {google.spanner.v1.RequestOptions.ClientContext} message ClientContext + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClientContext.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.secureContext = {}; + var keys2; + if (message.secureContext && (keys2 = Object.keys(message.secureContext)).length) { + object.secureContext = {}; + for (var j = 0; j < keys2.length; ++j) + object.secureContext[keys2[j]] = $root.google.protobuf.Value.toObject(message.secureContext[keys2[j]], options); + } + return object; + }; + + /** + * Converts this ClientContext to JSON. + * @function toJSON + * @memberof google.spanner.v1.RequestOptions.ClientContext + * @instance + * @returns {Object.} JSON object + */ + ClientContext.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClientContext + * @function getTypeUrl + * @memberof google.spanner.v1.RequestOptions.ClientContext + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClientContext.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.RequestOptions.ClientContext"; + }; + + return ClientContext; + })(); + + return RequestOptions; + })(); + + v1.DirectedReadOptions = (function() { + + /** + * Properties of a DirectedReadOptions. + * @memberof google.spanner.v1 + * @interface IDirectedReadOptions + * @property {google.spanner.v1.DirectedReadOptions.IIncludeReplicas|null} [includeReplicas] DirectedReadOptions includeReplicas + * @property {google.spanner.v1.DirectedReadOptions.IExcludeReplicas|null} [excludeReplicas] DirectedReadOptions excludeReplicas + */ + + /** + * Constructs a new DirectedReadOptions. + * @memberof google.spanner.v1 + * @classdesc Represents a DirectedReadOptions. + * @implements IDirectedReadOptions + * @constructor + * @param {google.spanner.v1.IDirectedReadOptions=} [properties] Properties to set + */ + function DirectedReadOptions(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DirectedReadOptions includeReplicas. + * @member {google.spanner.v1.DirectedReadOptions.IIncludeReplicas|null|undefined} includeReplicas + * @memberof google.spanner.v1.DirectedReadOptions + * @instance + */ + DirectedReadOptions.prototype.includeReplicas = null; + + /** + * DirectedReadOptions excludeReplicas. + * @member {google.spanner.v1.DirectedReadOptions.IExcludeReplicas|null|undefined} excludeReplicas + * @memberof google.spanner.v1.DirectedReadOptions + * @instance + */ + DirectedReadOptions.prototype.excludeReplicas = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DirectedReadOptions replicas. + * @member {"includeReplicas"|"excludeReplicas"|undefined} replicas + * @memberof google.spanner.v1.DirectedReadOptions + * @instance + */ + Object.defineProperty(DirectedReadOptions.prototype, "replicas", { + get: $util.oneOfGetter($oneOfFields = ["includeReplicas", "excludeReplicas"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DirectedReadOptions instance using the specified properties. + * @function create + * @memberof google.spanner.v1.DirectedReadOptions + * @static + * @param {google.spanner.v1.IDirectedReadOptions=} [properties] Properties to set + * @returns {google.spanner.v1.DirectedReadOptions} DirectedReadOptions instance + */ + DirectedReadOptions.create = function create(properties) { + return new DirectedReadOptions(properties); + }; + + /** + * Encodes the specified DirectedReadOptions message. Does not implicitly {@link google.spanner.v1.DirectedReadOptions.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.DirectedReadOptions + * @static + * @param {google.spanner.v1.IDirectedReadOptions} message DirectedReadOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DirectedReadOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.includeReplicas != null && Object.hasOwnProperty.call(message, "includeReplicas")) + $root.google.spanner.v1.DirectedReadOptions.IncludeReplicas.encode(message.includeReplicas, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.excludeReplicas != null && Object.hasOwnProperty.call(message, "excludeReplicas")) + $root.google.spanner.v1.DirectedReadOptions.ExcludeReplicas.encode(message.excludeReplicas, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DirectedReadOptions message, length delimited. Does not implicitly {@link google.spanner.v1.DirectedReadOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.DirectedReadOptions + * @static + * @param {google.spanner.v1.IDirectedReadOptions} message DirectedReadOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DirectedReadOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DirectedReadOptions message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.DirectedReadOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.DirectedReadOptions} DirectedReadOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DirectedReadOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.DirectedReadOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.includeReplicas = $root.google.spanner.v1.DirectedReadOptions.IncludeReplicas.decode(reader, reader.uint32()); + break; + } + case 2: { + message.excludeReplicas = $root.google.spanner.v1.DirectedReadOptions.ExcludeReplicas.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DirectedReadOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.DirectedReadOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.DirectedReadOptions} DirectedReadOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DirectedReadOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DirectedReadOptions message. + * @function verify + * @memberof google.spanner.v1.DirectedReadOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DirectedReadOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.includeReplicas != null && message.hasOwnProperty("includeReplicas")) { + properties.replicas = 1; + { + var error = $root.google.spanner.v1.DirectedReadOptions.IncludeReplicas.verify(message.includeReplicas); + if (error) + return "includeReplicas." + error; + } + } + if (message.excludeReplicas != null && message.hasOwnProperty("excludeReplicas")) { + if (properties.replicas === 1) + return "replicas: multiple values"; + properties.replicas = 1; + { + var error = $root.google.spanner.v1.DirectedReadOptions.ExcludeReplicas.verify(message.excludeReplicas); + if (error) + return "excludeReplicas." + error; + } + } + return null; + }; + + /** + * Creates a DirectedReadOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.DirectedReadOptions + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.DirectedReadOptions} DirectedReadOptions + */ + DirectedReadOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.DirectedReadOptions) + return object; + var message = new $root.google.spanner.v1.DirectedReadOptions(); + if (object.includeReplicas != null) { + if (typeof object.includeReplicas !== "object") + throw TypeError(".google.spanner.v1.DirectedReadOptions.includeReplicas: object expected"); + message.includeReplicas = $root.google.spanner.v1.DirectedReadOptions.IncludeReplicas.fromObject(object.includeReplicas); + } + if (object.excludeReplicas != null) { + if (typeof object.excludeReplicas !== "object") + throw TypeError(".google.spanner.v1.DirectedReadOptions.excludeReplicas: object expected"); + message.excludeReplicas = $root.google.spanner.v1.DirectedReadOptions.ExcludeReplicas.fromObject(object.excludeReplicas); + } + return message; + }; + + /** + * Creates a plain object from a DirectedReadOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.DirectedReadOptions + * @static + * @param {google.spanner.v1.DirectedReadOptions} message DirectedReadOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DirectedReadOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.includeReplicas != null && message.hasOwnProperty("includeReplicas")) { + object.includeReplicas = $root.google.spanner.v1.DirectedReadOptions.IncludeReplicas.toObject(message.includeReplicas, options); + if (options.oneofs) + object.replicas = "includeReplicas"; + } + if (message.excludeReplicas != null && message.hasOwnProperty("excludeReplicas")) { + object.excludeReplicas = $root.google.spanner.v1.DirectedReadOptions.ExcludeReplicas.toObject(message.excludeReplicas, options); + if (options.oneofs) + object.replicas = "excludeReplicas"; + } + return object; + }; + + /** + * Converts this DirectedReadOptions to JSON. + * @function toJSON + * @memberof google.spanner.v1.DirectedReadOptions + * @instance + * @returns {Object.} JSON object + */ + DirectedReadOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DirectedReadOptions + * @function getTypeUrl + * @memberof google.spanner.v1.DirectedReadOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DirectedReadOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.DirectedReadOptions"; + }; + + DirectedReadOptions.ReplicaSelection = (function() { + + /** + * Properties of a ReplicaSelection. + * @memberof google.spanner.v1.DirectedReadOptions + * @interface IReplicaSelection + * @property {string|null} [location] ReplicaSelection location + * @property {google.spanner.v1.DirectedReadOptions.ReplicaSelection.Type|null} [type] ReplicaSelection type + */ + + /** + * Constructs a new ReplicaSelection. + * @memberof google.spanner.v1.DirectedReadOptions + * @classdesc Represents a ReplicaSelection. + * @implements IReplicaSelection + * @constructor + * @param {google.spanner.v1.DirectedReadOptions.IReplicaSelection=} [properties] Properties to set + */ + function ReplicaSelection(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReplicaSelection location. + * @member {string} location + * @memberof google.spanner.v1.DirectedReadOptions.ReplicaSelection + * @instance + */ + ReplicaSelection.prototype.location = ""; + + /** + * ReplicaSelection type. + * @member {google.spanner.v1.DirectedReadOptions.ReplicaSelection.Type} type + * @memberof google.spanner.v1.DirectedReadOptions.ReplicaSelection + * @instance + */ + ReplicaSelection.prototype.type = 0; + + /** + * Creates a new ReplicaSelection instance using the specified properties. + * @function create + * @memberof google.spanner.v1.DirectedReadOptions.ReplicaSelection + * @static + * @param {google.spanner.v1.DirectedReadOptions.IReplicaSelection=} [properties] Properties to set + * @returns {google.spanner.v1.DirectedReadOptions.ReplicaSelection} ReplicaSelection instance + */ + ReplicaSelection.create = function create(properties) { + return new ReplicaSelection(properties); + }; + + /** + * Encodes the specified ReplicaSelection message. Does not implicitly {@link google.spanner.v1.DirectedReadOptions.ReplicaSelection.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.DirectedReadOptions.ReplicaSelection + * @static + * @param {google.spanner.v1.DirectedReadOptions.IReplicaSelection} message ReplicaSelection message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReplicaSelection.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.location); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.type); + return writer; + }; + + /** + * Encodes the specified ReplicaSelection message, length delimited. Does not implicitly {@link google.spanner.v1.DirectedReadOptions.ReplicaSelection.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.DirectedReadOptions.ReplicaSelection + * @static + * @param {google.spanner.v1.DirectedReadOptions.IReplicaSelection} message ReplicaSelection message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReplicaSelection.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReplicaSelection message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.DirectedReadOptions.ReplicaSelection + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.DirectedReadOptions.ReplicaSelection} ReplicaSelection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReplicaSelection.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.DirectedReadOptions.ReplicaSelection(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.location = reader.string(); + break; + } + case 2: { + message.type = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReplicaSelection message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.DirectedReadOptions.ReplicaSelection + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.DirectedReadOptions.ReplicaSelection} ReplicaSelection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReplicaSelection.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReplicaSelection message. + * @function verify + * @memberof google.spanner.v1.DirectedReadOptions.ReplicaSelection + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReplicaSelection.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a ReplicaSelection message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.DirectedReadOptions.ReplicaSelection + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.DirectedReadOptions.ReplicaSelection} ReplicaSelection + */ + ReplicaSelection.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.DirectedReadOptions.ReplicaSelection) + return object; + var message = new $root.google.spanner.v1.DirectedReadOptions.ReplicaSelection(); + if (object.location != null) + message.location = String(object.location); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "READ_WRITE": + case 1: + message.type = 1; + break; + case "READ_ONLY": + case 2: + message.type = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a ReplicaSelection message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.DirectedReadOptions.ReplicaSelection + * @static + * @param {google.spanner.v1.DirectedReadOptions.ReplicaSelection} message ReplicaSelection + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReplicaSelection.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.location = ""; + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + } + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.spanner.v1.DirectedReadOptions.ReplicaSelection.Type[message.type] === undefined ? message.type : $root.google.spanner.v1.DirectedReadOptions.ReplicaSelection.Type[message.type] : message.type; + return object; + }; + + /** + * Converts this ReplicaSelection to JSON. + * @function toJSON + * @memberof google.spanner.v1.DirectedReadOptions.ReplicaSelection + * @instance + * @returns {Object.} JSON object + */ + ReplicaSelection.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReplicaSelection + * @function getTypeUrl + * @memberof google.spanner.v1.DirectedReadOptions.ReplicaSelection + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReplicaSelection.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.DirectedReadOptions.ReplicaSelection"; + }; + + /** + * Type enum. + * @name google.spanner.v1.DirectedReadOptions.ReplicaSelection.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} READ_WRITE=1 READ_WRITE value + * @property {number} READ_ONLY=2 READ_ONLY value + */ + ReplicaSelection.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "READ_WRITE"] = 1; + values[valuesById[2] = "READ_ONLY"] = 2; + return values; + })(); + + return ReplicaSelection; + })(); + + DirectedReadOptions.IncludeReplicas = (function() { + + /** + * Properties of an IncludeReplicas. + * @memberof google.spanner.v1.DirectedReadOptions + * @interface IIncludeReplicas + * @property {Array.|null} [replicaSelections] IncludeReplicas replicaSelections + * @property {boolean|null} [autoFailoverDisabled] IncludeReplicas autoFailoverDisabled + */ + + /** + * Constructs a new IncludeReplicas. + * @memberof google.spanner.v1.DirectedReadOptions + * @classdesc Represents an IncludeReplicas. + * @implements IIncludeReplicas + * @constructor + * @param {google.spanner.v1.DirectedReadOptions.IIncludeReplicas=} [properties] Properties to set + */ + function IncludeReplicas(properties) { + this.replicaSelections = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * IncludeReplicas replicaSelections. + * @member {Array.} replicaSelections + * @memberof google.spanner.v1.DirectedReadOptions.IncludeReplicas + * @instance + */ + IncludeReplicas.prototype.replicaSelections = $util.emptyArray; + + /** + * IncludeReplicas autoFailoverDisabled. + * @member {boolean} autoFailoverDisabled + * @memberof google.spanner.v1.DirectedReadOptions.IncludeReplicas + * @instance + */ + IncludeReplicas.prototype.autoFailoverDisabled = false; + + /** + * Creates a new IncludeReplicas instance using the specified properties. + * @function create + * @memberof google.spanner.v1.DirectedReadOptions.IncludeReplicas + * @static + * @param {google.spanner.v1.DirectedReadOptions.IIncludeReplicas=} [properties] Properties to set + * @returns {google.spanner.v1.DirectedReadOptions.IncludeReplicas} IncludeReplicas instance + */ + IncludeReplicas.create = function create(properties) { + return new IncludeReplicas(properties); + }; + + /** + * Encodes the specified IncludeReplicas message. Does not implicitly {@link google.spanner.v1.DirectedReadOptions.IncludeReplicas.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.DirectedReadOptions.IncludeReplicas + * @static + * @param {google.spanner.v1.DirectedReadOptions.IIncludeReplicas} message IncludeReplicas message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IncludeReplicas.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.replicaSelections != null && message.replicaSelections.length) + for (var i = 0; i < message.replicaSelections.length; ++i) + $root.google.spanner.v1.DirectedReadOptions.ReplicaSelection.encode(message.replicaSelections[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.autoFailoverDisabled != null && Object.hasOwnProperty.call(message, "autoFailoverDisabled")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.autoFailoverDisabled); + return writer; + }; + + /** + * Encodes the specified IncludeReplicas message, length delimited. Does not implicitly {@link google.spanner.v1.DirectedReadOptions.IncludeReplicas.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.DirectedReadOptions.IncludeReplicas + * @static + * @param {google.spanner.v1.DirectedReadOptions.IIncludeReplicas} message IncludeReplicas message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IncludeReplicas.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IncludeReplicas message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.DirectedReadOptions.IncludeReplicas + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.DirectedReadOptions.IncludeReplicas} IncludeReplicas + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IncludeReplicas.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.DirectedReadOptions.IncludeReplicas(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.replicaSelections && message.replicaSelections.length)) + message.replicaSelections = []; + message.replicaSelections.push($root.google.spanner.v1.DirectedReadOptions.ReplicaSelection.decode(reader, reader.uint32())); + break; + } + case 2: { + message.autoFailoverDisabled = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IncludeReplicas message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.DirectedReadOptions.IncludeReplicas + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.DirectedReadOptions.IncludeReplicas} IncludeReplicas + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IncludeReplicas.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IncludeReplicas message. + * @function verify + * @memberof google.spanner.v1.DirectedReadOptions.IncludeReplicas + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IncludeReplicas.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.replicaSelections != null && message.hasOwnProperty("replicaSelections")) { + if (!Array.isArray(message.replicaSelections)) + return "replicaSelections: array expected"; + for (var i = 0; i < message.replicaSelections.length; ++i) { + var error = $root.google.spanner.v1.DirectedReadOptions.ReplicaSelection.verify(message.replicaSelections[i]); + if (error) + return "replicaSelections." + error; + } + } + if (message.autoFailoverDisabled != null && message.hasOwnProperty("autoFailoverDisabled")) + if (typeof message.autoFailoverDisabled !== "boolean") + return "autoFailoverDisabled: boolean expected"; + return null; + }; + + /** + * Creates an IncludeReplicas message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.DirectedReadOptions.IncludeReplicas + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.DirectedReadOptions.IncludeReplicas} IncludeReplicas + */ + IncludeReplicas.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.DirectedReadOptions.IncludeReplicas) + return object; + var message = new $root.google.spanner.v1.DirectedReadOptions.IncludeReplicas(); + if (object.replicaSelections) { + if (!Array.isArray(object.replicaSelections)) + throw TypeError(".google.spanner.v1.DirectedReadOptions.IncludeReplicas.replicaSelections: array expected"); + message.replicaSelections = []; + for (var i = 0; i < object.replicaSelections.length; ++i) { + if (typeof object.replicaSelections[i] !== "object") + throw TypeError(".google.spanner.v1.DirectedReadOptions.IncludeReplicas.replicaSelections: object expected"); + message.replicaSelections[i] = $root.google.spanner.v1.DirectedReadOptions.ReplicaSelection.fromObject(object.replicaSelections[i]); + } + } + if (object.autoFailoverDisabled != null) + message.autoFailoverDisabled = Boolean(object.autoFailoverDisabled); + return message; + }; + + /** + * Creates a plain object from an IncludeReplicas message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.DirectedReadOptions.IncludeReplicas + * @static + * @param {google.spanner.v1.DirectedReadOptions.IncludeReplicas} message IncludeReplicas + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IncludeReplicas.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.replicaSelections = []; + if (options.defaults) + object.autoFailoverDisabled = false; + if (message.replicaSelections && message.replicaSelections.length) { + object.replicaSelections = []; + for (var j = 0; j < message.replicaSelections.length; ++j) + object.replicaSelections[j] = $root.google.spanner.v1.DirectedReadOptions.ReplicaSelection.toObject(message.replicaSelections[j], options); + } + if (message.autoFailoverDisabled != null && message.hasOwnProperty("autoFailoverDisabled")) + object.autoFailoverDisabled = message.autoFailoverDisabled; + return object; + }; + + /** + * Converts this IncludeReplicas to JSON. + * @function toJSON + * @memberof google.spanner.v1.DirectedReadOptions.IncludeReplicas + * @instance + * @returns {Object.} JSON object + */ + IncludeReplicas.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IncludeReplicas + * @function getTypeUrl + * @memberof google.spanner.v1.DirectedReadOptions.IncludeReplicas + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IncludeReplicas.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.DirectedReadOptions.IncludeReplicas"; + }; + + return IncludeReplicas; + })(); + + DirectedReadOptions.ExcludeReplicas = (function() { + + /** + * Properties of an ExcludeReplicas. + * @memberof google.spanner.v1.DirectedReadOptions + * @interface IExcludeReplicas + * @property {Array.|null} [replicaSelections] ExcludeReplicas replicaSelections + */ + + /** + * Constructs a new ExcludeReplicas. + * @memberof google.spanner.v1.DirectedReadOptions + * @classdesc Represents an ExcludeReplicas. + * @implements IExcludeReplicas + * @constructor + * @param {google.spanner.v1.DirectedReadOptions.IExcludeReplicas=} [properties] Properties to set + */ + function ExcludeReplicas(properties) { + this.replicaSelections = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExcludeReplicas replicaSelections. + * @member {Array.} replicaSelections + * @memberof google.spanner.v1.DirectedReadOptions.ExcludeReplicas + * @instance + */ + ExcludeReplicas.prototype.replicaSelections = $util.emptyArray; + + /** + * Creates a new ExcludeReplicas instance using the specified properties. + * @function create + * @memberof google.spanner.v1.DirectedReadOptions.ExcludeReplicas + * @static + * @param {google.spanner.v1.DirectedReadOptions.IExcludeReplicas=} [properties] Properties to set + * @returns {google.spanner.v1.DirectedReadOptions.ExcludeReplicas} ExcludeReplicas instance + */ + ExcludeReplicas.create = function create(properties) { + return new ExcludeReplicas(properties); + }; + + /** + * Encodes the specified ExcludeReplicas message. Does not implicitly {@link google.spanner.v1.DirectedReadOptions.ExcludeReplicas.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.DirectedReadOptions.ExcludeReplicas + * @static + * @param {google.spanner.v1.DirectedReadOptions.IExcludeReplicas} message ExcludeReplicas message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExcludeReplicas.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.replicaSelections != null && message.replicaSelections.length) + for (var i = 0; i < message.replicaSelections.length; ++i) + $root.google.spanner.v1.DirectedReadOptions.ReplicaSelection.encode(message.replicaSelections[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExcludeReplicas message, length delimited. Does not implicitly {@link google.spanner.v1.DirectedReadOptions.ExcludeReplicas.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.DirectedReadOptions.ExcludeReplicas + * @static + * @param {google.spanner.v1.DirectedReadOptions.IExcludeReplicas} message ExcludeReplicas message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExcludeReplicas.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExcludeReplicas message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.DirectedReadOptions.ExcludeReplicas + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.DirectedReadOptions.ExcludeReplicas} ExcludeReplicas + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExcludeReplicas.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.DirectedReadOptions.ExcludeReplicas(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.replicaSelections && message.replicaSelections.length)) + message.replicaSelections = []; + message.replicaSelections.push($root.google.spanner.v1.DirectedReadOptions.ReplicaSelection.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExcludeReplicas message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.DirectedReadOptions.ExcludeReplicas + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.DirectedReadOptions.ExcludeReplicas} ExcludeReplicas + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExcludeReplicas.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExcludeReplicas message. + * @function verify + * @memberof google.spanner.v1.DirectedReadOptions.ExcludeReplicas + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExcludeReplicas.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.replicaSelections != null && message.hasOwnProperty("replicaSelections")) { + if (!Array.isArray(message.replicaSelections)) + return "replicaSelections: array expected"; + for (var i = 0; i < message.replicaSelections.length; ++i) { + var error = $root.google.spanner.v1.DirectedReadOptions.ReplicaSelection.verify(message.replicaSelections[i]); + if (error) + return "replicaSelections." + error; + } + } + return null; + }; + + /** + * Creates an ExcludeReplicas message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.DirectedReadOptions.ExcludeReplicas + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.DirectedReadOptions.ExcludeReplicas} ExcludeReplicas + */ + ExcludeReplicas.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.DirectedReadOptions.ExcludeReplicas) + return object; + var message = new $root.google.spanner.v1.DirectedReadOptions.ExcludeReplicas(); + if (object.replicaSelections) { + if (!Array.isArray(object.replicaSelections)) + throw TypeError(".google.spanner.v1.DirectedReadOptions.ExcludeReplicas.replicaSelections: array expected"); + message.replicaSelections = []; + for (var i = 0; i < object.replicaSelections.length; ++i) { + if (typeof object.replicaSelections[i] !== "object") + throw TypeError(".google.spanner.v1.DirectedReadOptions.ExcludeReplicas.replicaSelections: object expected"); + message.replicaSelections[i] = $root.google.spanner.v1.DirectedReadOptions.ReplicaSelection.fromObject(object.replicaSelections[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an ExcludeReplicas message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.DirectedReadOptions.ExcludeReplicas + * @static + * @param {google.spanner.v1.DirectedReadOptions.ExcludeReplicas} message ExcludeReplicas + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExcludeReplicas.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.replicaSelections = []; + if (message.replicaSelections && message.replicaSelections.length) { + object.replicaSelections = []; + for (var j = 0; j < message.replicaSelections.length; ++j) + object.replicaSelections[j] = $root.google.spanner.v1.DirectedReadOptions.ReplicaSelection.toObject(message.replicaSelections[j], options); + } + return object; + }; + + /** + * Converts this ExcludeReplicas to JSON. + * @function toJSON + * @memberof google.spanner.v1.DirectedReadOptions.ExcludeReplicas + * @instance + * @returns {Object.} JSON object + */ + ExcludeReplicas.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExcludeReplicas + * @function getTypeUrl + * @memberof google.spanner.v1.DirectedReadOptions.ExcludeReplicas + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExcludeReplicas.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.DirectedReadOptions.ExcludeReplicas"; + }; + + return ExcludeReplicas; + })(); + + return DirectedReadOptions; + })(); + + v1.ExecuteSqlRequest = (function() { + + /** + * Properties of an ExecuteSqlRequest. + * @memberof google.spanner.v1 + * @interface IExecuteSqlRequest + * @property {string|null} [session] ExecuteSqlRequest session + * @property {google.spanner.v1.ITransactionSelector|null} [transaction] ExecuteSqlRequest transaction + * @property {string|null} [sql] ExecuteSqlRequest sql + * @property {google.protobuf.IStruct|null} [params] ExecuteSqlRequest params + * @property {Object.|null} [paramTypes] ExecuteSqlRequest paramTypes + * @property {Uint8Array|null} [resumeToken] ExecuteSqlRequest resumeToken + * @property {google.spanner.v1.ExecuteSqlRequest.QueryMode|null} [queryMode] ExecuteSqlRequest queryMode + * @property {Uint8Array|null} [partitionToken] ExecuteSqlRequest partitionToken + * @property {number|Long|null} [seqno] ExecuteSqlRequest seqno + * @property {google.spanner.v1.ExecuteSqlRequest.IQueryOptions|null} [queryOptions] ExecuteSqlRequest queryOptions + * @property {google.spanner.v1.IRequestOptions|null} [requestOptions] ExecuteSqlRequest requestOptions + * @property {google.spanner.v1.IDirectedReadOptions|null} [directedReadOptions] ExecuteSqlRequest directedReadOptions + * @property {boolean|null} [dataBoostEnabled] ExecuteSqlRequest dataBoostEnabled + * @property {boolean|null} [lastStatement] ExecuteSqlRequest lastStatement + * @property {google.spanner.v1.IRoutingHint|null} [routingHint] ExecuteSqlRequest routingHint + */ + + /** + * Constructs a new ExecuteSqlRequest. + * @memberof google.spanner.v1 + * @classdesc Represents an ExecuteSqlRequest. + * @implements IExecuteSqlRequest + * @constructor + * @param {google.spanner.v1.IExecuteSqlRequest=} [properties] Properties to set + */ + function ExecuteSqlRequest(properties) { + this.paramTypes = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExecuteSqlRequest session. + * @member {string} session + * @memberof google.spanner.v1.ExecuteSqlRequest + * @instance + */ + ExecuteSqlRequest.prototype.session = ""; + + /** + * ExecuteSqlRequest transaction. + * @member {google.spanner.v1.ITransactionSelector|null|undefined} transaction + * @memberof google.spanner.v1.ExecuteSqlRequest + * @instance + */ + ExecuteSqlRequest.prototype.transaction = null; + + /** + * ExecuteSqlRequest sql. + * @member {string} sql + * @memberof google.spanner.v1.ExecuteSqlRequest + * @instance + */ + ExecuteSqlRequest.prototype.sql = ""; + + /** + * ExecuteSqlRequest params. + * @member {google.protobuf.IStruct|null|undefined} params + * @memberof google.spanner.v1.ExecuteSqlRequest + * @instance + */ + ExecuteSqlRequest.prototype.params = null; + + /** + * ExecuteSqlRequest paramTypes. + * @member {Object.} paramTypes + * @memberof google.spanner.v1.ExecuteSqlRequest + * @instance + */ + ExecuteSqlRequest.prototype.paramTypes = $util.emptyObject; + + /** + * ExecuteSqlRequest resumeToken. + * @member {Uint8Array} resumeToken + * @memberof google.spanner.v1.ExecuteSqlRequest + * @instance + */ + ExecuteSqlRequest.prototype.resumeToken = $util.newBuffer([]); + + /** + * ExecuteSqlRequest queryMode. + * @member {google.spanner.v1.ExecuteSqlRequest.QueryMode} queryMode + * @memberof google.spanner.v1.ExecuteSqlRequest + * @instance + */ + ExecuteSqlRequest.prototype.queryMode = 0; + + /** + * ExecuteSqlRequest partitionToken. + * @member {Uint8Array} partitionToken + * @memberof google.spanner.v1.ExecuteSqlRequest + * @instance + */ + ExecuteSqlRequest.prototype.partitionToken = $util.newBuffer([]); + + /** + * ExecuteSqlRequest seqno. + * @member {number|Long} seqno + * @memberof google.spanner.v1.ExecuteSqlRequest + * @instance + */ + ExecuteSqlRequest.prototype.seqno = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ExecuteSqlRequest queryOptions. + * @member {google.spanner.v1.ExecuteSqlRequest.IQueryOptions|null|undefined} queryOptions + * @memberof google.spanner.v1.ExecuteSqlRequest + * @instance + */ + ExecuteSqlRequest.prototype.queryOptions = null; + + /** + * ExecuteSqlRequest requestOptions. + * @member {google.spanner.v1.IRequestOptions|null|undefined} requestOptions + * @memberof google.spanner.v1.ExecuteSqlRequest + * @instance + */ + ExecuteSqlRequest.prototype.requestOptions = null; + + /** + * ExecuteSqlRequest directedReadOptions. + * @member {google.spanner.v1.IDirectedReadOptions|null|undefined} directedReadOptions + * @memberof google.spanner.v1.ExecuteSqlRequest + * @instance + */ + ExecuteSqlRequest.prototype.directedReadOptions = null; + + /** + * ExecuteSqlRequest dataBoostEnabled. + * @member {boolean} dataBoostEnabled + * @memberof google.spanner.v1.ExecuteSqlRequest + * @instance + */ + ExecuteSqlRequest.prototype.dataBoostEnabled = false; + + /** + * ExecuteSqlRequest lastStatement. + * @member {boolean} lastStatement + * @memberof google.spanner.v1.ExecuteSqlRequest + * @instance + */ + ExecuteSqlRequest.prototype.lastStatement = false; + + /** + * ExecuteSqlRequest routingHint. + * @member {google.spanner.v1.IRoutingHint|null|undefined} routingHint + * @memberof google.spanner.v1.ExecuteSqlRequest + * @instance + */ + ExecuteSqlRequest.prototype.routingHint = null; + + /** + * Creates a new ExecuteSqlRequest instance using the specified properties. + * @function create + * @memberof google.spanner.v1.ExecuteSqlRequest + * @static + * @param {google.spanner.v1.IExecuteSqlRequest=} [properties] Properties to set + * @returns {google.spanner.v1.ExecuteSqlRequest} ExecuteSqlRequest instance + */ + ExecuteSqlRequest.create = function create(properties) { + return new ExecuteSqlRequest(properties); + }; + + /** + * Encodes the specified ExecuteSqlRequest message. Does not implicitly {@link google.spanner.v1.ExecuteSqlRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.ExecuteSqlRequest + * @static + * @param {google.spanner.v1.IExecuteSqlRequest} message ExecuteSqlRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecuteSqlRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.session != null && Object.hasOwnProperty.call(message, "session")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.session); + if (message.transaction != null && Object.hasOwnProperty.call(message, "transaction")) + $root.google.spanner.v1.TransactionSelector.encode(message.transaction, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.sql != null && Object.hasOwnProperty.call(message, "sql")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.sql); + if (message.params != null && Object.hasOwnProperty.call(message, "params")) + $root.google.protobuf.Struct.encode(message.params, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.paramTypes != null && Object.hasOwnProperty.call(message, "paramTypes")) + for (var keys = Object.keys(message.paramTypes), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.spanner.v1.Type.encode(message.paramTypes[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.resumeToken != null && Object.hasOwnProperty.call(message, "resumeToken")) + writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.resumeToken); + if (message.queryMode != null && Object.hasOwnProperty.call(message, "queryMode")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.queryMode); + if (message.partitionToken != null && Object.hasOwnProperty.call(message, "partitionToken")) + writer.uint32(/* id 8, wireType 2 =*/66).bytes(message.partitionToken); + if (message.seqno != null && Object.hasOwnProperty.call(message, "seqno")) + writer.uint32(/* id 9, wireType 0 =*/72).int64(message.seqno); + if (message.queryOptions != null && Object.hasOwnProperty.call(message, "queryOptions")) + $root.google.spanner.v1.ExecuteSqlRequest.QueryOptions.encode(message.queryOptions, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.requestOptions != null && Object.hasOwnProperty.call(message, "requestOptions")) + $root.google.spanner.v1.RequestOptions.encode(message.requestOptions, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.directedReadOptions != null && Object.hasOwnProperty.call(message, "directedReadOptions")) + $root.google.spanner.v1.DirectedReadOptions.encode(message.directedReadOptions, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.dataBoostEnabled != null && Object.hasOwnProperty.call(message, "dataBoostEnabled")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.dataBoostEnabled); + if (message.lastStatement != null && Object.hasOwnProperty.call(message, "lastStatement")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.lastStatement); + if (message.routingHint != null && Object.hasOwnProperty.call(message, "routingHint")) + $root.google.spanner.v1.RoutingHint.encode(message.routingHint, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExecuteSqlRequest message, length delimited. Does not implicitly {@link google.spanner.v1.ExecuteSqlRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.ExecuteSqlRequest + * @static + * @param {google.spanner.v1.IExecuteSqlRequest} message ExecuteSqlRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecuteSqlRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExecuteSqlRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.ExecuteSqlRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.ExecuteSqlRequest} ExecuteSqlRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecuteSqlRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.ExecuteSqlRequest(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.session = reader.string(); + break; + } + case 2: { + message.transaction = $root.google.spanner.v1.TransactionSelector.decode(reader, reader.uint32()); + break; + } + case 3: { + message.sql = reader.string(); + break; + } + case 4: { + message.params = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 5: { + if (message.paramTypes === $util.emptyObject) + message.paramTypes = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.spanner.v1.Type.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.paramTypes[key] = value; + break; + } + case 6: { + message.resumeToken = reader.bytes(); + break; + } + case 7: { + message.queryMode = reader.int32(); + break; + } + case 8: { + message.partitionToken = reader.bytes(); + break; + } + case 9: { + message.seqno = reader.int64(); + break; + } + case 10: { + message.queryOptions = $root.google.spanner.v1.ExecuteSqlRequest.QueryOptions.decode(reader, reader.uint32()); + break; + } + case 11: { + message.requestOptions = $root.google.spanner.v1.RequestOptions.decode(reader, reader.uint32()); + break; + } + case 15: { + message.directedReadOptions = $root.google.spanner.v1.DirectedReadOptions.decode(reader, reader.uint32()); + break; + } + case 16: { + message.dataBoostEnabled = reader.bool(); + break; + } + case 17: { + message.lastStatement = reader.bool(); + break; + } + case 18: { + message.routingHint = $root.google.spanner.v1.RoutingHint.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExecuteSqlRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.ExecuteSqlRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.ExecuteSqlRequest} ExecuteSqlRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecuteSqlRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExecuteSqlRequest message. + * @function verify + * @memberof google.spanner.v1.ExecuteSqlRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExecuteSqlRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.session != null && message.hasOwnProperty("session")) + if (!$util.isString(message.session)) + return "session: string expected"; + if (message.transaction != null && message.hasOwnProperty("transaction")) { + var error = $root.google.spanner.v1.TransactionSelector.verify(message.transaction); + if (error) + return "transaction." + error; + } + if (message.sql != null && message.hasOwnProperty("sql")) + if (!$util.isString(message.sql)) + return "sql: string expected"; + if (message.params != null && message.hasOwnProperty("params")) { + var error = $root.google.protobuf.Struct.verify(message.params); + if (error) + return "params." + error; + } + if (message.paramTypes != null && message.hasOwnProperty("paramTypes")) { + if (!$util.isObject(message.paramTypes)) + return "paramTypes: object expected"; + var key = Object.keys(message.paramTypes); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.spanner.v1.Type.verify(message.paramTypes[key[i]]); + if (error) + return "paramTypes." + error; + } + } + if (message.resumeToken != null && message.hasOwnProperty("resumeToken")) + if (!(message.resumeToken && typeof message.resumeToken.length === "number" || $util.isString(message.resumeToken))) + return "resumeToken: buffer expected"; + if (message.queryMode != null && message.hasOwnProperty("queryMode")) + switch (message.queryMode) { + default: + return "queryMode: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.partitionToken != null && message.hasOwnProperty("partitionToken")) + if (!(message.partitionToken && typeof message.partitionToken.length === "number" || $util.isString(message.partitionToken))) + return "partitionToken: buffer expected"; + if (message.seqno != null && message.hasOwnProperty("seqno")) + if (!$util.isInteger(message.seqno) && !(message.seqno && $util.isInteger(message.seqno.low) && $util.isInteger(message.seqno.high))) + return "seqno: integer|Long expected"; + if (message.queryOptions != null && message.hasOwnProperty("queryOptions")) { + var error = $root.google.spanner.v1.ExecuteSqlRequest.QueryOptions.verify(message.queryOptions); + if (error) + return "queryOptions." + error; + } + if (message.requestOptions != null && message.hasOwnProperty("requestOptions")) { + var error = $root.google.spanner.v1.RequestOptions.verify(message.requestOptions); + if (error) + return "requestOptions." + error; + } + if (message.directedReadOptions != null && message.hasOwnProperty("directedReadOptions")) { + var error = $root.google.spanner.v1.DirectedReadOptions.verify(message.directedReadOptions); + if (error) + return "directedReadOptions." + error; + } + if (message.dataBoostEnabled != null && message.hasOwnProperty("dataBoostEnabled")) + if (typeof message.dataBoostEnabled !== "boolean") + return "dataBoostEnabled: boolean expected"; + if (message.lastStatement != null && message.hasOwnProperty("lastStatement")) + if (typeof message.lastStatement !== "boolean") + return "lastStatement: boolean expected"; + if (message.routingHint != null && message.hasOwnProperty("routingHint")) { + var error = $root.google.spanner.v1.RoutingHint.verify(message.routingHint); + if (error) + return "routingHint." + error; + } + return null; + }; + + /** + * Creates an ExecuteSqlRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.ExecuteSqlRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.ExecuteSqlRequest} ExecuteSqlRequest + */ + ExecuteSqlRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.ExecuteSqlRequest) + return object; + var message = new $root.google.spanner.v1.ExecuteSqlRequest(); + if (object.session != null) + message.session = String(object.session); + if (object.transaction != null) { + if (typeof object.transaction !== "object") + throw TypeError(".google.spanner.v1.ExecuteSqlRequest.transaction: object expected"); + message.transaction = $root.google.spanner.v1.TransactionSelector.fromObject(object.transaction); + } + if (object.sql != null) + message.sql = String(object.sql); + if (object.params != null) { + if (typeof object.params !== "object") + throw TypeError(".google.spanner.v1.ExecuteSqlRequest.params: object expected"); + message.params = $root.google.protobuf.Struct.fromObject(object.params); + } + if (object.paramTypes) { + if (typeof object.paramTypes !== "object") + throw TypeError(".google.spanner.v1.ExecuteSqlRequest.paramTypes: object expected"); + message.paramTypes = {}; + for (var keys = Object.keys(object.paramTypes), i = 0; i < keys.length; ++i) { + if (typeof object.paramTypes[keys[i]] !== "object") + throw TypeError(".google.spanner.v1.ExecuteSqlRequest.paramTypes: object expected"); + message.paramTypes[keys[i]] = $root.google.spanner.v1.Type.fromObject(object.paramTypes[keys[i]]); + } + } + if (object.resumeToken != null) + if (typeof object.resumeToken === "string") + $util.base64.decode(object.resumeToken, message.resumeToken = $util.newBuffer($util.base64.length(object.resumeToken)), 0); + else if (object.resumeToken.length >= 0) + message.resumeToken = object.resumeToken; + switch (object.queryMode) { + default: + if (typeof object.queryMode === "number") { + message.queryMode = object.queryMode; + break; + } + break; + case "NORMAL": + case 0: + message.queryMode = 0; + break; + case "PLAN": + case 1: + message.queryMode = 1; + break; + case "PROFILE": + case 2: + message.queryMode = 2; + break; + case "WITH_STATS": + case 3: + message.queryMode = 3; + break; + case "WITH_PLAN_AND_STATS": + case 4: + message.queryMode = 4; + break; + } + if (object.partitionToken != null) + if (typeof object.partitionToken === "string") + $util.base64.decode(object.partitionToken, message.partitionToken = $util.newBuffer($util.base64.length(object.partitionToken)), 0); + else if (object.partitionToken.length >= 0) + message.partitionToken = object.partitionToken; + if (object.seqno != null) + if ($util.Long) + (message.seqno = $util.Long.fromValue(object.seqno)).unsigned = false; + else if (typeof object.seqno === "string") + message.seqno = parseInt(object.seqno, 10); + else if (typeof object.seqno === "number") + message.seqno = object.seqno; + else if (typeof object.seqno === "object") + message.seqno = new $util.LongBits(object.seqno.low >>> 0, object.seqno.high >>> 0).toNumber(); + if (object.queryOptions != null) { + if (typeof object.queryOptions !== "object") + throw TypeError(".google.spanner.v1.ExecuteSqlRequest.queryOptions: object expected"); + message.queryOptions = $root.google.spanner.v1.ExecuteSqlRequest.QueryOptions.fromObject(object.queryOptions); + } + if (object.requestOptions != null) { + if (typeof object.requestOptions !== "object") + throw TypeError(".google.spanner.v1.ExecuteSqlRequest.requestOptions: object expected"); + message.requestOptions = $root.google.spanner.v1.RequestOptions.fromObject(object.requestOptions); + } + if (object.directedReadOptions != null) { + if (typeof object.directedReadOptions !== "object") + throw TypeError(".google.spanner.v1.ExecuteSqlRequest.directedReadOptions: object expected"); + message.directedReadOptions = $root.google.spanner.v1.DirectedReadOptions.fromObject(object.directedReadOptions); + } + if (object.dataBoostEnabled != null) + message.dataBoostEnabled = Boolean(object.dataBoostEnabled); + if (object.lastStatement != null) + message.lastStatement = Boolean(object.lastStatement); + if (object.routingHint != null) { + if (typeof object.routingHint !== "object") + throw TypeError(".google.spanner.v1.ExecuteSqlRequest.routingHint: object expected"); + message.routingHint = $root.google.spanner.v1.RoutingHint.fromObject(object.routingHint); + } + return message; + }; + + /** + * Creates a plain object from an ExecuteSqlRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.ExecuteSqlRequest + * @static + * @param {google.spanner.v1.ExecuteSqlRequest} message ExecuteSqlRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExecuteSqlRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.paramTypes = {}; + if (options.defaults) { + object.session = ""; + object.transaction = null; + object.sql = ""; + object.params = null; + if (options.bytes === String) + object.resumeToken = ""; + else { + object.resumeToken = []; + if (options.bytes !== Array) + object.resumeToken = $util.newBuffer(object.resumeToken); + } + object.queryMode = options.enums === String ? "NORMAL" : 0; + if (options.bytes === String) + object.partitionToken = ""; + else { + object.partitionToken = []; + if (options.bytes !== Array) + object.partitionToken = $util.newBuffer(object.partitionToken); + } + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seqno = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seqno = options.longs === String ? "0" : 0; + object.queryOptions = null; + object.requestOptions = null; + object.directedReadOptions = null; + object.dataBoostEnabled = false; + object.lastStatement = false; + object.routingHint = null; + } + if (message.session != null && message.hasOwnProperty("session")) + object.session = message.session; + if (message.transaction != null && message.hasOwnProperty("transaction")) + object.transaction = $root.google.spanner.v1.TransactionSelector.toObject(message.transaction, options); + if (message.sql != null && message.hasOwnProperty("sql")) + object.sql = message.sql; + if (message.params != null && message.hasOwnProperty("params")) + object.params = $root.google.protobuf.Struct.toObject(message.params, options); + var keys2; + if (message.paramTypes && (keys2 = Object.keys(message.paramTypes)).length) { + object.paramTypes = {}; + for (var j = 0; j < keys2.length; ++j) + object.paramTypes[keys2[j]] = $root.google.spanner.v1.Type.toObject(message.paramTypes[keys2[j]], options); + } + if (message.resumeToken != null && message.hasOwnProperty("resumeToken")) + object.resumeToken = options.bytes === String ? $util.base64.encode(message.resumeToken, 0, message.resumeToken.length) : options.bytes === Array ? Array.prototype.slice.call(message.resumeToken) : message.resumeToken; + if (message.queryMode != null && message.hasOwnProperty("queryMode")) + object.queryMode = options.enums === String ? $root.google.spanner.v1.ExecuteSqlRequest.QueryMode[message.queryMode] === undefined ? message.queryMode : $root.google.spanner.v1.ExecuteSqlRequest.QueryMode[message.queryMode] : message.queryMode; + if (message.partitionToken != null && message.hasOwnProperty("partitionToken")) + object.partitionToken = options.bytes === String ? $util.base64.encode(message.partitionToken, 0, message.partitionToken.length) : options.bytes === Array ? Array.prototype.slice.call(message.partitionToken) : message.partitionToken; + if (message.seqno != null && message.hasOwnProperty("seqno")) + if (typeof message.seqno === "number") + object.seqno = options.longs === String ? String(message.seqno) : message.seqno; + else + object.seqno = options.longs === String ? $util.Long.prototype.toString.call(message.seqno) : options.longs === Number ? new $util.LongBits(message.seqno.low >>> 0, message.seqno.high >>> 0).toNumber() : message.seqno; + if (message.queryOptions != null && message.hasOwnProperty("queryOptions")) + object.queryOptions = $root.google.spanner.v1.ExecuteSqlRequest.QueryOptions.toObject(message.queryOptions, options); + if (message.requestOptions != null && message.hasOwnProperty("requestOptions")) + object.requestOptions = $root.google.spanner.v1.RequestOptions.toObject(message.requestOptions, options); + if (message.directedReadOptions != null && message.hasOwnProperty("directedReadOptions")) + object.directedReadOptions = $root.google.spanner.v1.DirectedReadOptions.toObject(message.directedReadOptions, options); + if (message.dataBoostEnabled != null && message.hasOwnProperty("dataBoostEnabled")) + object.dataBoostEnabled = message.dataBoostEnabled; + if (message.lastStatement != null && message.hasOwnProperty("lastStatement")) + object.lastStatement = message.lastStatement; + if (message.routingHint != null && message.hasOwnProperty("routingHint")) + object.routingHint = $root.google.spanner.v1.RoutingHint.toObject(message.routingHint, options); + return object; + }; + + /** + * Converts this ExecuteSqlRequest to JSON. + * @function toJSON + * @memberof google.spanner.v1.ExecuteSqlRequest + * @instance + * @returns {Object.} JSON object + */ + ExecuteSqlRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExecuteSqlRequest + * @function getTypeUrl + * @memberof google.spanner.v1.ExecuteSqlRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExecuteSqlRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.ExecuteSqlRequest"; + }; + + /** + * QueryMode enum. + * @name google.spanner.v1.ExecuteSqlRequest.QueryMode + * @enum {number} + * @property {number} NORMAL=0 NORMAL value + * @property {number} PLAN=1 PLAN value + * @property {number} PROFILE=2 PROFILE value + * @property {number} WITH_STATS=3 WITH_STATS value + * @property {number} WITH_PLAN_AND_STATS=4 WITH_PLAN_AND_STATS value + */ + ExecuteSqlRequest.QueryMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NORMAL"] = 0; + values[valuesById[1] = "PLAN"] = 1; + values[valuesById[2] = "PROFILE"] = 2; + values[valuesById[3] = "WITH_STATS"] = 3; + values[valuesById[4] = "WITH_PLAN_AND_STATS"] = 4; + return values; + })(); + + ExecuteSqlRequest.QueryOptions = (function() { + + /** + * Properties of a QueryOptions. + * @memberof google.spanner.v1.ExecuteSqlRequest + * @interface IQueryOptions + * @property {string|null} [optimizerVersion] QueryOptions optimizerVersion + * @property {string|null} [optimizerStatisticsPackage] QueryOptions optimizerStatisticsPackage + */ + + /** + * Constructs a new QueryOptions. + * @memberof google.spanner.v1.ExecuteSqlRequest + * @classdesc Represents a QueryOptions. + * @implements IQueryOptions + * @constructor + * @param {google.spanner.v1.ExecuteSqlRequest.IQueryOptions=} [properties] Properties to set + */ + function QueryOptions(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryOptions optimizerVersion. + * @member {string} optimizerVersion + * @memberof google.spanner.v1.ExecuteSqlRequest.QueryOptions + * @instance + */ + QueryOptions.prototype.optimizerVersion = ""; + + /** + * QueryOptions optimizerStatisticsPackage. + * @member {string} optimizerStatisticsPackage + * @memberof google.spanner.v1.ExecuteSqlRequest.QueryOptions + * @instance + */ + QueryOptions.prototype.optimizerStatisticsPackage = ""; + + /** + * Creates a new QueryOptions instance using the specified properties. + * @function create + * @memberof google.spanner.v1.ExecuteSqlRequest.QueryOptions + * @static + * @param {google.spanner.v1.ExecuteSqlRequest.IQueryOptions=} [properties] Properties to set + * @returns {google.spanner.v1.ExecuteSqlRequest.QueryOptions} QueryOptions instance + */ + QueryOptions.create = function create(properties) { + return new QueryOptions(properties); + }; + + /** + * Encodes the specified QueryOptions message. Does not implicitly {@link google.spanner.v1.ExecuteSqlRequest.QueryOptions.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.ExecuteSqlRequest.QueryOptions + * @static + * @param {google.spanner.v1.ExecuteSqlRequest.IQueryOptions} message QueryOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.optimizerVersion != null && Object.hasOwnProperty.call(message, "optimizerVersion")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.optimizerVersion); + if (message.optimizerStatisticsPackage != null && Object.hasOwnProperty.call(message, "optimizerStatisticsPackage")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.optimizerStatisticsPackage); + return writer; + }; + + /** + * Encodes the specified QueryOptions message, length delimited. Does not implicitly {@link google.spanner.v1.ExecuteSqlRequest.QueryOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.ExecuteSqlRequest.QueryOptions + * @static + * @param {google.spanner.v1.ExecuteSqlRequest.IQueryOptions} message QueryOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryOptions message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.ExecuteSqlRequest.QueryOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.ExecuteSqlRequest.QueryOptions} QueryOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.ExecuteSqlRequest.QueryOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.optimizerVersion = reader.string(); + break; + } + case 2: { + message.optimizerStatisticsPackage = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.ExecuteSqlRequest.QueryOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.ExecuteSqlRequest.QueryOptions} QueryOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryOptions message. + * @function verify + * @memberof google.spanner.v1.ExecuteSqlRequest.QueryOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.optimizerVersion != null && message.hasOwnProperty("optimizerVersion")) + if (!$util.isString(message.optimizerVersion)) + return "optimizerVersion: string expected"; + if (message.optimizerStatisticsPackage != null && message.hasOwnProperty("optimizerStatisticsPackage")) + if (!$util.isString(message.optimizerStatisticsPackage)) + return "optimizerStatisticsPackage: string expected"; + return null; + }; + + /** + * Creates a QueryOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.ExecuteSqlRequest.QueryOptions + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.ExecuteSqlRequest.QueryOptions} QueryOptions + */ + QueryOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.ExecuteSqlRequest.QueryOptions) + return object; + var message = new $root.google.spanner.v1.ExecuteSqlRequest.QueryOptions(); + if (object.optimizerVersion != null) + message.optimizerVersion = String(object.optimizerVersion); + if (object.optimizerStatisticsPackage != null) + message.optimizerStatisticsPackage = String(object.optimizerStatisticsPackage); + return message; + }; + + /** + * Creates a plain object from a QueryOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.ExecuteSqlRequest.QueryOptions + * @static + * @param {google.spanner.v1.ExecuteSqlRequest.QueryOptions} message QueryOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.optimizerVersion = ""; + object.optimizerStatisticsPackage = ""; + } + if (message.optimizerVersion != null && message.hasOwnProperty("optimizerVersion")) + object.optimizerVersion = message.optimizerVersion; + if (message.optimizerStatisticsPackage != null && message.hasOwnProperty("optimizerStatisticsPackage")) + object.optimizerStatisticsPackage = message.optimizerStatisticsPackage; + return object; + }; + + /** + * Converts this QueryOptions to JSON. + * @function toJSON + * @memberof google.spanner.v1.ExecuteSqlRequest.QueryOptions + * @instance + * @returns {Object.} JSON object + */ + QueryOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for QueryOptions + * @function getTypeUrl + * @memberof google.spanner.v1.ExecuteSqlRequest.QueryOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + QueryOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.ExecuteSqlRequest.QueryOptions"; + }; + + return QueryOptions; + })(); + + return ExecuteSqlRequest; + })(); + + v1.ExecuteBatchDmlRequest = (function() { + + /** + * Properties of an ExecuteBatchDmlRequest. + * @memberof google.spanner.v1 + * @interface IExecuteBatchDmlRequest + * @property {string|null} [session] ExecuteBatchDmlRequest session + * @property {google.spanner.v1.ITransactionSelector|null} [transaction] ExecuteBatchDmlRequest transaction + * @property {Array.|null} [statements] ExecuteBatchDmlRequest statements + * @property {number|Long|null} [seqno] ExecuteBatchDmlRequest seqno + * @property {google.spanner.v1.IRequestOptions|null} [requestOptions] ExecuteBatchDmlRequest requestOptions + * @property {boolean|null} [lastStatements] ExecuteBatchDmlRequest lastStatements + */ + + /** + * Constructs a new ExecuteBatchDmlRequest. + * @memberof google.spanner.v1 + * @classdesc Represents an ExecuteBatchDmlRequest. + * @implements IExecuteBatchDmlRequest + * @constructor + * @param {google.spanner.v1.IExecuteBatchDmlRequest=} [properties] Properties to set + */ + function ExecuteBatchDmlRequest(properties) { + this.statements = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExecuteBatchDmlRequest session. + * @member {string} session + * @memberof google.spanner.v1.ExecuteBatchDmlRequest + * @instance + */ + ExecuteBatchDmlRequest.prototype.session = ""; + + /** + * ExecuteBatchDmlRequest transaction. + * @member {google.spanner.v1.ITransactionSelector|null|undefined} transaction + * @memberof google.spanner.v1.ExecuteBatchDmlRequest + * @instance + */ + ExecuteBatchDmlRequest.prototype.transaction = null; + + /** + * ExecuteBatchDmlRequest statements. + * @member {Array.} statements + * @memberof google.spanner.v1.ExecuteBatchDmlRequest + * @instance + */ + ExecuteBatchDmlRequest.prototype.statements = $util.emptyArray; + + /** + * ExecuteBatchDmlRequest seqno. + * @member {number|Long} seqno + * @memberof google.spanner.v1.ExecuteBatchDmlRequest + * @instance + */ + ExecuteBatchDmlRequest.prototype.seqno = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ExecuteBatchDmlRequest requestOptions. + * @member {google.spanner.v1.IRequestOptions|null|undefined} requestOptions + * @memberof google.spanner.v1.ExecuteBatchDmlRequest + * @instance + */ + ExecuteBatchDmlRequest.prototype.requestOptions = null; + + /** + * ExecuteBatchDmlRequest lastStatements. + * @member {boolean} lastStatements + * @memberof google.spanner.v1.ExecuteBatchDmlRequest + * @instance + */ + ExecuteBatchDmlRequest.prototype.lastStatements = false; + + /** + * Creates a new ExecuteBatchDmlRequest instance using the specified properties. + * @function create + * @memberof google.spanner.v1.ExecuteBatchDmlRequest + * @static + * @param {google.spanner.v1.IExecuteBatchDmlRequest=} [properties] Properties to set + * @returns {google.spanner.v1.ExecuteBatchDmlRequest} ExecuteBatchDmlRequest instance + */ + ExecuteBatchDmlRequest.create = function create(properties) { + return new ExecuteBatchDmlRequest(properties); + }; + + /** + * Encodes the specified ExecuteBatchDmlRequest message. Does not implicitly {@link google.spanner.v1.ExecuteBatchDmlRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.ExecuteBatchDmlRequest + * @static + * @param {google.spanner.v1.IExecuteBatchDmlRequest} message ExecuteBatchDmlRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecuteBatchDmlRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.session != null && Object.hasOwnProperty.call(message, "session")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.session); + if (message.transaction != null && Object.hasOwnProperty.call(message, "transaction")) + $root.google.spanner.v1.TransactionSelector.encode(message.transaction, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.statements != null && message.statements.length) + for (var i = 0; i < message.statements.length; ++i) + $root.google.spanner.v1.ExecuteBatchDmlRequest.Statement.encode(message.statements[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.seqno != null && Object.hasOwnProperty.call(message, "seqno")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.seqno); + if (message.requestOptions != null && Object.hasOwnProperty.call(message, "requestOptions")) + $root.google.spanner.v1.RequestOptions.encode(message.requestOptions, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.lastStatements != null && Object.hasOwnProperty.call(message, "lastStatements")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.lastStatements); + return writer; + }; + + /** + * Encodes the specified ExecuteBatchDmlRequest message, length delimited. Does not implicitly {@link google.spanner.v1.ExecuteBatchDmlRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.ExecuteBatchDmlRequest + * @static + * @param {google.spanner.v1.IExecuteBatchDmlRequest} message ExecuteBatchDmlRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecuteBatchDmlRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExecuteBatchDmlRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.ExecuteBatchDmlRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.ExecuteBatchDmlRequest} ExecuteBatchDmlRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecuteBatchDmlRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.ExecuteBatchDmlRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.session = reader.string(); + break; + } + case 2: { + message.transaction = $root.google.spanner.v1.TransactionSelector.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.statements && message.statements.length)) + message.statements = []; + message.statements.push($root.google.spanner.v1.ExecuteBatchDmlRequest.Statement.decode(reader, reader.uint32())); + break; + } + case 4: { + message.seqno = reader.int64(); + break; + } + case 5: { + message.requestOptions = $root.google.spanner.v1.RequestOptions.decode(reader, reader.uint32()); + break; + } + case 6: { + message.lastStatements = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExecuteBatchDmlRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.ExecuteBatchDmlRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.ExecuteBatchDmlRequest} ExecuteBatchDmlRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecuteBatchDmlRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExecuteBatchDmlRequest message. + * @function verify + * @memberof google.spanner.v1.ExecuteBatchDmlRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExecuteBatchDmlRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.session != null && message.hasOwnProperty("session")) + if (!$util.isString(message.session)) + return "session: string expected"; + if (message.transaction != null && message.hasOwnProperty("transaction")) { + var error = $root.google.spanner.v1.TransactionSelector.verify(message.transaction); + if (error) + return "transaction." + error; + } + if (message.statements != null && message.hasOwnProperty("statements")) { + if (!Array.isArray(message.statements)) + return "statements: array expected"; + for (var i = 0; i < message.statements.length; ++i) { + var error = $root.google.spanner.v1.ExecuteBatchDmlRequest.Statement.verify(message.statements[i]); + if (error) + return "statements." + error; + } + } + if (message.seqno != null && message.hasOwnProperty("seqno")) + if (!$util.isInteger(message.seqno) && !(message.seqno && $util.isInteger(message.seqno.low) && $util.isInteger(message.seqno.high))) + return "seqno: integer|Long expected"; + if (message.requestOptions != null && message.hasOwnProperty("requestOptions")) { + var error = $root.google.spanner.v1.RequestOptions.verify(message.requestOptions); + if (error) + return "requestOptions." + error; + } + if (message.lastStatements != null && message.hasOwnProperty("lastStatements")) + if (typeof message.lastStatements !== "boolean") + return "lastStatements: boolean expected"; + return null; + }; + + /** + * Creates an ExecuteBatchDmlRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.ExecuteBatchDmlRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.ExecuteBatchDmlRequest} ExecuteBatchDmlRequest + */ + ExecuteBatchDmlRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.ExecuteBatchDmlRequest) + return object; + var message = new $root.google.spanner.v1.ExecuteBatchDmlRequest(); + if (object.session != null) + message.session = String(object.session); + if (object.transaction != null) { + if (typeof object.transaction !== "object") + throw TypeError(".google.spanner.v1.ExecuteBatchDmlRequest.transaction: object expected"); + message.transaction = $root.google.spanner.v1.TransactionSelector.fromObject(object.transaction); + } + if (object.statements) { + if (!Array.isArray(object.statements)) + throw TypeError(".google.spanner.v1.ExecuteBatchDmlRequest.statements: array expected"); + message.statements = []; + for (var i = 0; i < object.statements.length; ++i) { + if (typeof object.statements[i] !== "object") + throw TypeError(".google.spanner.v1.ExecuteBatchDmlRequest.statements: object expected"); + message.statements[i] = $root.google.spanner.v1.ExecuteBatchDmlRequest.Statement.fromObject(object.statements[i]); + } + } + if (object.seqno != null) + if ($util.Long) + (message.seqno = $util.Long.fromValue(object.seqno)).unsigned = false; + else if (typeof object.seqno === "string") + message.seqno = parseInt(object.seqno, 10); + else if (typeof object.seqno === "number") + message.seqno = object.seqno; + else if (typeof object.seqno === "object") + message.seqno = new $util.LongBits(object.seqno.low >>> 0, object.seqno.high >>> 0).toNumber(); + if (object.requestOptions != null) { + if (typeof object.requestOptions !== "object") + throw TypeError(".google.spanner.v1.ExecuteBatchDmlRequest.requestOptions: object expected"); + message.requestOptions = $root.google.spanner.v1.RequestOptions.fromObject(object.requestOptions); + } + if (object.lastStatements != null) + message.lastStatements = Boolean(object.lastStatements); + return message; + }; + + /** + * Creates a plain object from an ExecuteBatchDmlRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.ExecuteBatchDmlRequest + * @static + * @param {google.spanner.v1.ExecuteBatchDmlRequest} message ExecuteBatchDmlRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExecuteBatchDmlRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.statements = []; + if (options.defaults) { + object.session = ""; + object.transaction = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seqno = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seqno = options.longs === String ? "0" : 0; + object.requestOptions = null; + object.lastStatements = false; + } + if (message.session != null && message.hasOwnProperty("session")) + object.session = message.session; + if (message.transaction != null && message.hasOwnProperty("transaction")) + object.transaction = $root.google.spanner.v1.TransactionSelector.toObject(message.transaction, options); + if (message.statements && message.statements.length) { + object.statements = []; + for (var j = 0; j < message.statements.length; ++j) + object.statements[j] = $root.google.spanner.v1.ExecuteBatchDmlRequest.Statement.toObject(message.statements[j], options); + } + if (message.seqno != null && message.hasOwnProperty("seqno")) + if (typeof message.seqno === "number") + object.seqno = options.longs === String ? String(message.seqno) : message.seqno; + else + object.seqno = options.longs === String ? $util.Long.prototype.toString.call(message.seqno) : options.longs === Number ? new $util.LongBits(message.seqno.low >>> 0, message.seqno.high >>> 0).toNumber() : message.seqno; + if (message.requestOptions != null && message.hasOwnProperty("requestOptions")) + object.requestOptions = $root.google.spanner.v1.RequestOptions.toObject(message.requestOptions, options); + if (message.lastStatements != null && message.hasOwnProperty("lastStatements")) + object.lastStatements = message.lastStatements; + return object; + }; + + /** + * Converts this ExecuteBatchDmlRequest to JSON. + * @function toJSON + * @memberof google.spanner.v1.ExecuteBatchDmlRequest + * @instance + * @returns {Object.} JSON object + */ + ExecuteBatchDmlRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExecuteBatchDmlRequest + * @function getTypeUrl + * @memberof google.spanner.v1.ExecuteBatchDmlRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExecuteBatchDmlRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.ExecuteBatchDmlRequest"; + }; + + ExecuteBatchDmlRequest.Statement = (function() { + + /** + * Properties of a Statement. + * @memberof google.spanner.v1.ExecuteBatchDmlRequest + * @interface IStatement + * @property {string|null} [sql] Statement sql + * @property {google.protobuf.IStruct|null} [params] Statement params + * @property {Object.|null} [paramTypes] Statement paramTypes + */ + + /** + * Constructs a new Statement. + * @memberof google.spanner.v1.ExecuteBatchDmlRequest + * @classdesc Represents a Statement. + * @implements IStatement + * @constructor + * @param {google.spanner.v1.ExecuteBatchDmlRequest.IStatement=} [properties] Properties to set + */ + function Statement(properties) { + this.paramTypes = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Statement sql. + * @member {string} sql + * @memberof google.spanner.v1.ExecuteBatchDmlRequest.Statement + * @instance + */ + Statement.prototype.sql = ""; + + /** + * Statement params. + * @member {google.protobuf.IStruct|null|undefined} params + * @memberof google.spanner.v1.ExecuteBatchDmlRequest.Statement + * @instance + */ + Statement.prototype.params = null; + + /** + * Statement paramTypes. + * @member {Object.} paramTypes + * @memberof google.spanner.v1.ExecuteBatchDmlRequest.Statement + * @instance + */ + Statement.prototype.paramTypes = $util.emptyObject; + + /** + * Creates a new Statement instance using the specified properties. + * @function create + * @memberof google.spanner.v1.ExecuteBatchDmlRequest.Statement + * @static + * @param {google.spanner.v1.ExecuteBatchDmlRequest.IStatement=} [properties] Properties to set + * @returns {google.spanner.v1.ExecuteBatchDmlRequest.Statement} Statement instance + */ + Statement.create = function create(properties) { + return new Statement(properties); + }; + + /** + * Encodes the specified Statement message. Does not implicitly {@link google.spanner.v1.ExecuteBatchDmlRequest.Statement.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.ExecuteBatchDmlRequest.Statement + * @static + * @param {google.spanner.v1.ExecuteBatchDmlRequest.IStatement} message Statement message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Statement.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sql != null && Object.hasOwnProperty.call(message, "sql")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.sql); + if (message.params != null && Object.hasOwnProperty.call(message, "params")) + $root.google.protobuf.Struct.encode(message.params, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.paramTypes != null && Object.hasOwnProperty.call(message, "paramTypes")) + for (var keys = Object.keys(message.paramTypes), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.spanner.v1.Type.encode(message.paramTypes[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified Statement message, length delimited. Does not implicitly {@link google.spanner.v1.ExecuteBatchDmlRequest.Statement.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.ExecuteBatchDmlRequest.Statement + * @static + * @param {google.spanner.v1.ExecuteBatchDmlRequest.IStatement} message Statement message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Statement.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Statement message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.ExecuteBatchDmlRequest.Statement + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.ExecuteBatchDmlRequest.Statement} Statement + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Statement.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.ExecuteBatchDmlRequest.Statement(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.sql = reader.string(); + break; + } + case 2: { + message.params = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 3: { + if (message.paramTypes === $util.emptyObject) + message.paramTypes = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.spanner.v1.Type.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.paramTypes[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Statement message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.ExecuteBatchDmlRequest.Statement + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.ExecuteBatchDmlRequest.Statement} Statement + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Statement.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Statement message. + * @function verify + * @memberof google.spanner.v1.ExecuteBatchDmlRequest.Statement + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Statement.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sql != null && message.hasOwnProperty("sql")) + if (!$util.isString(message.sql)) + return "sql: string expected"; + if (message.params != null && message.hasOwnProperty("params")) { + var error = $root.google.protobuf.Struct.verify(message.params); + if (error) + return "params." + error; + } + if (message.paramTypes != null && message.hasOwnProperty("paramTypes")) { + if (!$util.isObject(message.paramTypes)) + return "paramTypes: object expected"; + var key = Object.keys(message.paramTypes); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.spanner.v1.Type.verify(message.paramTypes[key[i]]); + if (error) + return "paramTypes." + error; + } + } + return null; + }; + + /** + * Creates a Statement message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.ExecuteBatchDmlRequest.Statement + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.ExecuteBatchDmlRequest.Statement} Statement + */ + Statement.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.ExecuteBatchDmlRequest.Statement) + return object; + var message = new $root.google.spanner.v1.ExecuteBatchDmlRequest.Statement(); + if (object.sql != null) + message.sql = String(object.sql); + if (object.params != null) { + if (typeof object.params !== "object") + throw TypeError(".google.spanner.v1.ExecuteBatchDmlRequest.Statement.params: object expected"); + message.params = $root.google.protobuf.Struct.fromObject(object.params); + } + if (object.paramTypes) { + if (typeof object.paramTypes !== "object") + throw TypeError(".google.spanner.v1.ExecuteBatchDmlRequest.Statement.paramTypes: object expected"); + message.paramTypes = {}; + for (var keys = Object.keys(object.paramTypes), i = 0; i < keys.length; ++i) { + if (typeof object.paramTypes[keys[i]] !== "object") + throw TypeError(".google.spanner.v1.ExecuteBatchDmlRequest.Statement.paramTypes: object expected"); + message.paramTypes[keys[i]] = $root.google.spanner.v1.Type.fromObject(object.paramTypes[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a Statement message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.ExecuteBatchDmlRequest.Statement + * @static + * @param {google.spanner.v1.ExecuteBatchDmlRequest.Statement} message Statement + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Statement.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.paramTypes = {}; + if (options.defaults) { + object.sql = ""; + object.params = null; + } + if (message.sql != null && message.hasOwnProperty("sql")) + object.sql = message.sql; + if (message.params != null && message.hasOwnProperty("params")) + object.params = $root.google.protobuf.Struct.toObject(message.params, options); + var keys2; + if (message.paramTypes && (keys2 = Object.keys(message.paramTypes)).length) { + object.paramTypes = {}; + for (var j = 0; j < keys2.length; ++j) + object.paramTypes[keys2[j]] = $root.google.spanner.v1.Type.toObject(message.paramTypes[keys2[j]], options); + } + return object; + }; + + /** + * Converts this Statement to JSON. + * @function toJSON + * @memberof google.spanner.v1.ExecuteBatchDmlRequest.Statement + * @instance + * @returns {Object.} JSON object + */ + Statement.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Statement + * @function getTypeUrl + * @memberof google.spanner.v1.ExecuteBatchDmlRequest.Statement + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Statement.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.ExecuteBatchDmlRequest.Statement"; + }; + + return Statement; + })(); + + return ExecuteBatchDmlRequest; + })(); + + v1.ExecuteBatchDmlResponse = (function() { + + /** + * Properties of an ExecuteBatchDmlResponse. + * @memberof google.spanner.v1 + * @interface IExecuteBatchDmlResponse + * @property {Array.|null} [resultSets] ExecuteBatchDmlResponse resultSets + * @property {google.rpc.IStatus|null} [status] ExecuteBatchDmlResponse status + * @property {google.spanner.v1.IMultiplexedSessionPrecommitToken|null} [precommitToken] ExecuteBatchDmlResponse precommitToken + */ + + /** + * Constructs a new ExecuteBatchDmlResponse. + * @memberof google.spanner.v1 + * @classdesc Represents an ExecuteBatchDmlResponse. + * @implements IExecuteBatchDmlResponse + * @constructor + * @param {google.spanner.v1.IExecuteBatchDmlResponse=} [properties] Properties to set + */ + function ExecuteBatchDmlResponse(properties) { + this.resultSets = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExecuteBatchDmlResponse resultSets. + * @member {Array.} resultSets + * @memberof google.spanner.v1.ExecuteBatchDmlResponse + * @instance + */ + ExecuteBatchDmlResponse.prototype.resultSets = $util.emptyArray; + + /** + * ExecuteBatchDmlResponse status. + * @member {google.rpc.IStatus|null|undefined} status + * @memberof google.spanner.v1.ExecuteBatchDmlResponse + * @instance + */ + ExecuteBatchDmlResponse.prototype.status = null; + + /** + * ExecuteBatchDmlResponse precommitToken. + * @member {google.spanner.v1.IMultiplexedSessionPrecommitToken|null|undefined} precommitToken + * @memberof google.spanner.v1.ExecuteBatchDmlResponse + * @instance + */ + ExecuteBatchDmlResponse.prototype.precommitToken = null; + + /** + * Creates a new ExecuteBatchDmlResponse instance using the specified properties. + * @function create + * @memberof google.spanner.v1.ExecuteBatchDmlResponse + * @static + * @param {google.spanner.v1.IExecuteBatchDmlResponse=} [properties] Properties to set + * @returns {google.spanner.v1.ExecuteBatchDmlResponse} ExecuteBatchDmlResponse instance + */ + ExecuteBatchDmlResponse.create = function create(properties) { + return new ExecuteBatchDmlResponse(properties); + }; + + /** + * Encodes the specified ExecuteBatchDmlResponse message. Does not implicitly {@link google.spanner.v1.ExecuteBatchDmlResponse.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.ExecuteBatchDmlResponse + * @static + * @param {google.spanner.v1.IExecuteBatchDmlResponse} message ExecuteBatchDmlResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecuteBatchDmlResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resultSets != null && message.resultSets.length) + for (var i = 0; i < message.resultSets.length; ++i) + $root.google.spanner.v1.ResultSet.encode(message.resultSets[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + $root.google.rpc.Status.encode(message.status, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.precommitToken != null && Object.hasOwnProperty.call(message, "precommitToken")) + $root.google.spanner.v1.MultiplexedSessionPrecommitToken.encode(message.precommitToken, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExecuteBatchDmlResponse message, length delimited. Does not implicitly {@link google.spanner.v1.ExecuteBatchDmlResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.ExecuteBatchDmlResponse + * @static + * @param {google.spanner.v1.IExecuteBatchDmlResponse} message ExecuteBatchDmlResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecuteBatchDmlResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExecuteBatchDmlResponse message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.ExecuteBatchDmlResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.ExecuteBatchDmlResponse} ExecuteBatchDmlResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecuteBatchDmlResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.ExecuteBatchDmlResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.resultSets && message.resultSets.length)) + message.resultSets = []; + message.resultSets.push($root.google.spanner.v1.ResultSet.decode(reader, reader.uint32())); + break; + } + case 2: { + message.status = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 3: { + message.precommitToken = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExecuteBatchDmlResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.ExecuteBatchDmlResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.ExecuteBatchDmlResponse} ExecuteBatchDmlResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecuteBatchDmlResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExecuteBatchDmlResponse message. + * @function verify + * @memberof google.spanner.v1.ExecuteBatchDmlResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExecuteBatchDmlResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resultSets != null && message.hasOwnProperty("resultSets")) { + if (!Array.isArray(message.resultSets)) + return "resultSets: array expected"; + for (var i = 0; i < message.resultSets.length; ++i) { + var error = $root.google.spanner.v1.ResultSet.verify(message.resultSets[i]); + if (error) + return "resultSets." + error; + } + } + if (message.status != null && message.hasOwnProperty("status")) { + var error = $root.google.rpc.Status.verify(message.status); + if (error) + return "status." + error; + } + if (message.precommitToken != null && message.hasOwnProperty("precommitToken")) { + var error = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.verify(message.precommitToken); + if (error) + return "precommitToken." + error; + } + return null; + }; + + /** + * Creates an ExecuteBatchDmlResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.ExecuteBatchDmlResponse + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.ExecuteBatchDmlResponse} ExecuteBatchDmlResponse + */ + ExecuteBatchDmlResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.ExecuteBatchDmlResponse) + return object; + var message = new $root.google.spanner.v1.ExecuteBatchDmlResponse(); + if (object.resultSets) { + if (!Array.isArray(object.resultSets)) + throw TypeError(".google.spanner.v1.ExecuteBatchDmlResponse.resultSets: array expected"); + message.resultSets = []; + for (var i = 0; i < object.resultSets.length; ++i) { + if (typeof object.resultSets[i] !== "object") + throw TypeError(".google.spanner.v1.ExecuteBatchDmlResponse.resultSets: object expected"); + message.resultSets[i] = $root.google.spanner.v1.ResultSet.fromObject(object.resultSets[i]); + } + } + if (object.status != null) { + if (typeof object.status !== "object") + throw TypeError(".google.spanner.v1.ExecuteBatchDmlResponse.status: object expected"); + message.status = $root.google.rpc.Status.fromObject(object.status); + } + if (object.precommitToken != null) { + if (typeof object.precommitToken !== "object") + throw TypeError(".google.spanner.v1.ExecuteBatchDmlResponse.precommitToken: object expected"); + message.precommitToken = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.fromObject(object.precommitToken); + } + return message; + }; + + /** + * Creates a plain object from an ExecuteBatchDmlResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.ExecuteBatchDmlResponse + * @static + * @param {google.spanner.v1.ExecuteBatchDmlResponse} message ExecuteBatchDmlResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExecuteBatchDmlResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.resultSets = []; + if (options.defaults) { + object.status = null; + object.precommitToken = null; + } + if (message.resultSets && message.resultSets.length) { + object.resultSets = []; + for (var j = 0; j < message.resultSets.length; ++j) + object.resultSets[j] = $root.google.spanner.v1.ResultSet.toObject(message.resultSets[j], options); + } + if (message.status != null && message.hasOwnProperty("status")) + object.status = $root.google.rpc.Status.toObject(message.status, options); + if (message.precommitToken != null && message.hasOwnProperty("precommitToken")) + object.precommitToken = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.toObject(message.precommitToken, options); + return object; + }; + + /** + * Converts this ExecuteBatchDmlResponse to JSON. + * @function toJSON + * @memberof google.spanner.v1.ExecuteBatchDmlResponse + * @instance + * @returns {Object.} JSON object + */ + ExecuteBatchDmlResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExecuteBatchDmlResponse + * @function getTypeUrl + * @memberof google.spanner.v1.ExecuteBatchDmlResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExecuteBatchDmlResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.ExecuteBatchDmlResponse"; + }; + + return ExecuteBatchDmlResponse; + })(); + + v1.PartitionOptions = (function() { + + /** + * Properties of a PartitionOptions. + * @memberof google.spanner.v1 + * @interface IPartitionOptions + * @property {number|Long|null} [partitionSizeBytes] PartitionOptions partitionSizeBytes + * @property {number|Long|null} [maxPartitions] PartitionOptions maxPartitions + */ + + /** + * Constructs a new PartitionOptions. + * @memberof google.spanner.v1 + * @classdesc Represents a PartitionOptions. + * @implements IPartitionOptions + * @constructor + * @param {google.spanner.v1.IPartitionOptions=} [properties] Properties to set + */ + function PartitionOptions(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PartitionOptions partitionSizeBytes. + * @member {number|Long} partitionSizeBytes + * @memberof google.spanner.v1.PartitionOptions + * @instance + */ + PartitionOptions.prototype.partitionSizeBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * PartitionOptions maxPartitions. + * @member {number|Long} maxPartitions + * @memberof google.spanner.v1.PartitionOptions + * @instance + */ + PartitionOptions.prototype.maxPartitions = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new PartitionOptions instance using the specified properties. + * @function create + * @memberof google.spanner.v1.PartitionOptions + * @static + * @param {google.spanner.v1.IPartitionOptions=} [properties] Properties to set + * @returns {google.spanner.v1.PartitionOptions} PartitionOptions instance + */ + PartitionOptions.create = function create(properties) { + return new PartitionOptions(properties); + }; + + /** + * Encodes the specified PartitionOptions message. Does not implicitly {@link google.spanner.v1.PartitionOptions.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.PartitionOptions + * @static + * @param {google.spanner.v1.IPartitionOptions} message PartitionOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartitionOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.partitionSizeBytes != null && Object.hasOwnProperty.call(message, "partitionSizeBytes")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.partitionSizeBytes); + if (message.maxPartitions != null && Object.hasOwnProperty.call(message, "maxPartitions")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.maxPartitions); + return writer; + }; + + /** + * Encodes the specified PartitionOptions message, length delimited. Does not implicitly {@link google.spanner.v1.PartitionOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.PartitionOptions + * @static + * @param {google.spanner.v1.IPartitionOptions} message PartitionOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartitionOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PartitionOptions message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.PartitionOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.PartitionOptions} PartitionOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartitionOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.PartitionOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.partitionSizeBytes = reader.int64(); + break; + } + case 2: { + message.maxPartitions = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PartitionOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.PartitionOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.PartitionOptions} PartitionOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartitionOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PartitionOptions message. + * @function verify + * @memberof google.spanner.v1.PartitionOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PartitionOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.partitionSizeBytes != null && message.hasOwnProperty("partitionSizeBytes")) + if (!$util.isInteger(message.partitionSizeBytes) && !(message.partitionSizeBytes && $util.isInteger(message.partitionSizeBytes.low) && $util.isInteger(message.partitionSizeBytes.high))) + return "partitionSizeBytes: integer|Long expected"; + if (message.maxPartitions != null && message.hasOwnProperty("maxPartitions")) + if (!$util.isInteger(message.maxPartitions) && !(message.maxPartitions && $util.isInteger(message.maxPartitions.low) && $util.isInteger(message.maxPartitions.high))) + return "maxPartitions: integer|Long expected"; + return null; + }; + + /** + * Creates a PartitionOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.PartitionOptions + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.PartitionOptions} PartitionOptions + */ + PartitionOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.PartitionOptions) + return object; + var message = new $root.google.spanner.v1.PartitionOptions(); + if (object.partitionSizeBytes != null) + if ($util.Long) + (message.partitionSizeBytes = $util.Long.fromValue(object.partitionSizeBytes)).unsigned = false; + else if (typeof object.partitionSizeBytes === "string") + message.partitionSizeBytes = parseInt(object.partitionSizeBytes, 10); + else if (typeof object.partitionSizeBytes === "number") + message.partitionSizeBytes = object.partitionSizeBytes; + else if (typeof object.partitionSizeBytes === "object") + message.partitionSizeBytes = new $util.LongBits(object.partitionSizeBytes.low >>> 0, object.partitionSizeBytes.high >>> 0).toNumber(); + if (object.maxPartitions != null) + if ($util.Long) + (message.maxPartitions = $util.Long.fromValue(object.maxPartitions)).unsigned = false; + else if (typeof object.maxPartitions === "string") + message.maxPartitions = parseInt(object.maxPartitions, 10); + else if (typeof object.maxPartitions === "number") + message.maxPartitions = object.maxPartitions; + else if (typeof object.maxPartitions === "object") + message.maxPartitions = new $util.LongBits(object.maxPartitions.low >>> 0, object.maxPartitions.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a PartitionOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.PartitionOptions + * @static + * @param {google.spanner.v1.PartitionOptions} message PartitionOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PartitionOptions.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.partitionSizeBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.partitionSizeBytes = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.maxPartitions = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.maxPartitions = options.longs === String ? "0" : 0; + } + if (message.partitionSizeBytes != null && message.hasOwnProperty("partitionSizeBytes")) + if (typeof message.partitionSizeBytes === "number") + object.partitionSizeBytes = options.longs === String ? String(message.partitionSizeBytes) : message.partitionSizeBytes; + else + object.partitionSizeBytes = options.longs === String ? $util.Long.prototype.toString.call(message.partitionSizeBytes) : options.longs === Number ? new $util.LongBits(message.partitionSizeBytes.low >>> 0, message.partitionSizeBytes.high >>> 0).toNumber() : message.partitionSizeBytes; + if (message.maxPartitions != null && message.hasOwnProperty("maxPartitions")) + if (typeof message.maxPartitions === "number") + object.maxPartitions = options.longs === String ? String(message.maxPartitions) : message.maxPartitions; + else + object.maxPartitions = options.longs === String ? $util.Long.prototype.toString.call(message.maxPartitions) : options.longs === Number ? new $util.LongBits(message.maxPartitions.low >>> 0, message.maxPartitions.high >>> 0).toNumber() : message.maxPartitions; + return object; + }; + + /** + * Converts this PartitionOptions to JSON. + * @function toJSON + * @memberof google.spanner.v1.PartitionOptions + * @instance + * @returns {Object.} JSON object + */ + PartitionOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PartitionOptions + * @function getTypeUrl + * @memberof google.spanner.v1.PartitionOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PartitionOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.PartitionOptions"; + }; + + return PartitionOptions; + })(); + + v1.PartitionQueryRequest = (function() { + + /** + * Properties of a PartitionQueryRequest. + * @memberof google.spanner.v1 + * @interface IPartitionQueryRequest + * @property {string|null} [session] PartitionQueryRequest session + * @property {google.spanner.v1.ITransactionSelector|null} [transaction] PartitionQueryRequest transaction + * @property {string|null} [sql] PartitionQueryRequest sql + * @property {google.protobuf.IStruct|null} [params] PartitionQueryRequest params + * @property {Object.|null} [paramTypes] PartitionQueryRequest paramTypes + * @property {google.spanner.v1.IPartitionOptions|null} [partitionOptions] PartitionQueryRequest partitionOptions + */ + + /** + * Constructs a new PartitionQueryRequest. + * @memberof google.spanner.v1 + * @classdesc Represents a PartitionQueryRequest. + * @implements IPartitionQueryRequest + * @constructor + * @param {google.spanner.v1.IPartitionQueryRequest=} [properties] Properties to set + */ + function PartitionQueryRequest(properties) { + this.paramTypes = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PartitionQueryRequest session. + * @member {string} session + * @memberof google.spanner.v1.PartitionQueryRequest + * @instance + */ + PartitionQueryRequest.prototype.session = ""; + + /** + * PartitionQueryRequest transaction. + * @member {google.spanner.v1.ITransactionSelector|null|undefined} transaction + * @memberof google.spanner.v1.PartitionQueryRequest + * @instance + */ + PartitionQueryRequest.prototype.transaction = null; + + /** + * PartitionQueryRequest sql. + * @member {string} sql + * @memberof google.spanner.v1.PartitionQueryRequest + * @instance + */ + PartitionQueryRequest.prototype.sql = ""; + + /** + * PartitionQueryRequest params. + * @member {google.protobuf.IStruct|null|undefined} params + * @memberof google.spanner.v1.PartitionQueryRequest + * @instance + */ + PartitionQueryRequest.prototype.params = null; + + /** + * PartitionQueryRequest paramTypes. + * @member {Object.} paramTypes + * @memberof google.spanner.v1.PartitionQueryRequest + * @instance + */ + PartitionQueryRequest.prototype.paramTypes = $util.emptyObject; + + /** + * PartitionQueryRequest partitionOptions. + * @member {google.spanner.v1.IPartitionOptions|null|undefined} partitionOptions + * @memberof google.spanner.v1.PartitionQueryRequest + * @instance + */ + PartitionQueryRequest.prototype.partitionOptions = null; + + /** + * Creates a new PartitionQueryRequest instance using the specified properties. + * @function create + * @memberof google.spanner.v1.PartitionQueryRequest + * @static + * @param {google.spanner.v1.IPartitionQueryRequest=} [properties] Properties to set + * @returns {google.spanner.v1.PartitionQueryRequest} PartitionQueryRequest instance + */ + PartitionQueryRequest.create = function create(properties) { + return new PartitionQueryRequest(properties); + }; + + /** + * Encodes the specified PartitionQueryRequest message. Does not implicitly {@link google.spanner.v1.PartitionQueryRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.PartitionQueryRequest + * @static + * @param {google.spanner.v1.IPartitionQueryRequest} message PartitionQueryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartitionQueryRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.session != null && Object.hasOwnProperty.call(message, "session")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.session); + if (message.transaction != null && Object.hasOwnProperty.call(message, "transaction")) + $root.google.spanner.v1.TransactionSelector.encode(message.transaction, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.sql != null && Object.hasOwnProperty.call(message, "sql")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.sql); + if (message.params != null && Object.hasOwnProperty.call(message, "params")) + $root.google.protobuf.Struct.encode(message.params, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.paramTypes != null && Object.hasOwnProperty.call(message, "paramTypes")) + for (var keys = Object.keys(message.paramTypes), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.spanner.v1.Type.encode(message.paramTypes[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.partitionOptions != null && Object.hasOwnProperty.call(message, "partitionOptions")) + $root.google.spanner.v1.PartitionOptions.encode(message.partitionOptions, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PartitionQueryRequest message, length delimited. Does not implicitly {@link google.spanner.v1.PartitionQueryRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.PartitionQueryRequest + * @static + * @param {google.spanner.v1.IPartitionQueryRequest} message PartitionQueryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartitionQueryRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PartitionQueryRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.PartitionQueryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.PartitionQueryRequest} PartitionQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartitionQueryRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.PartitionQueryRequest(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.session = reader.string(); + break; + } + case 2: { + message.transaction = $root.google.spanner.v1.TransactionSelector.decode(reader, reader.uint32()); + break; + } + case 3: { + message.sql = reader.string(); + break; + } + case 4: { + message.params = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 5: { + if (message.paramTypes === $util.emptyObject) + message.paramTypes = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.spanner.v1.Type.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.paramTypes[key] = value; + break; + } + case 6: { + message.partitionOptions = $root.google.spanner.v1.PartitionOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PartitionQueryRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.PartitionQueryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.PartitionQueryRequest} PartitionQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartitionQueryRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PartitionQueryRequest message. + * @function verify + * @memberof google.spanner.v1.PartitionQueryRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PartitionQueryRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.session != null && message.hasOwnProperty("session")) + if (!$util.isString(message.session)) + return "session: string expected"; + if (message.transaction != null && message.hasOwnProperty("transaction")) { + var error = $root.google.spanner.v1.TransactionSelector.verify(message.transaction); + if (error) + return "transaction." + error; + } + if (message.sql != null && message.hasOwnProperty("sql")) + if (!$util.isString(message.sql)) + return "sql: string expected"; + if (message.params != null && message.hasOwnProperty("params")) { + var error = $root.google.protobuf.Struct.verify(message.params); + if (error) + return "params." + error; + } + if (message.paramTypes != null && message.hasOwnProperty("paramTypes")) { + if (!$util.isObject(message.paramTypes)) + return "paramTypes: object expected"; + var key = Object.keys(message.paramTypes); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.spanner.v1.Type.verify(message.paramTypes[key[i]]); + if (error) + return "paramTypes." + error; + } + } + if (message.partitionOptions != null && message.hasOwnProperty("partitionOptions")) { + var error = $root.google.spanner.v1.PartitionOptions.verify(message.partitionOptions); + if (error) + return "partitionOptions." + error; + } + return null; + }; + + /** + * Creates a PartitionQueryRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.PartitionQueryRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.PartitionQueryRequest} PartitionQueryRequest + */ + PartitionQueryRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.PartitionQueryRequest) + return object; + var message = new $root.google.spanner.v1.PartitionQueryRequest(); + if (object.session != null) + message.session = String(object.session); + if (object.transaction != null) { + if (typeof object.transaction !== "object") + throw TypeError(".google.spanner.v1.PartitionQueryRequest.transaction: object expected"); + message.transaction = $root.google.spanner.v1.TransactionSelector.fromObject(object.transaction); + } + if (object.sql != null) + message.sql = String(object.sql); + if (object.params != null) { + if (typeof object.params !== "object") + throw TypeError(".google.spanner.v1.PartitionQueryRequest.params: object expected"); + message.params = $root.google.protobuf.Struct.fromObject(object.params); + } + if (object.paramTypes) { + if (typeof object.paramTypes !== "object") + throw TypeError(".google.spanner.v1.PartitionQueryRequest.paramTypes: object expected"); + message.paramTypes = {}; + for (var keys = Object.keys(object.paramTypes), i = 0; i < keys.length; ++i) { + if (typeof object.paramTypes[keys[i]] !== "object") + throw TypeError(".google.spanner.v1.PartitionQueryRequest.paramTypes: object expected"); + message.paramTypes[keys[i]] = $root.google.spanner.v1.Type.fromObject(object.paramTypes[keys[i]]); + } + } + if (object.partitionOptions != null) { + if (typeof object.partitionOptions !== "object") + throw TypeError(".google.spanner.v1.PartitionQueryRequest.partitionOptions: object expected"); + message.partitionOptions = $root.google.spanner.v1.PartitionOptions.fromObject(object.partitionOptions); + } + return message; + }; + + /** + * Creates a plain object from a PartitionQueryRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.PartitionQueryRequest + * @static + * @param {google.spanner.v1.PartitionQueryRequest} message PartitionQueryRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PartitionQueryRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.paramTypes = {}; + if (options.defaults) { + object.session = ""; + object.transaction = null; + object.sql = ""; + object.params = null; + object.partitionOptions = null; + } + if (message.session != null && message.hasOwnProperty("session")) + object.session = message.session; + if (message.transaction != null && message.hasOwnProperty("transaction")) + object.transaction = $root.google.spanner.v1.TransactionSelector.toObject(message.transaction, options); + if (message.sql != null && message.hasOwnProperty("sql")) + object.sql = message.sql; + if (message.params != null && message.hasOwnProperty("params")) + object.params = $root.google.protobuf.Struct.toObject(message.params, options); + var keys2; + if (message.paramTypes && (keys2 = Object.keys(message.paramTypes)).length) { + object.paramTypes = {}; + for (var j = 0; j < keys2.length; ++j) + object.paramTypes[keys2[j]] = $root.google.spanner.v1.Type.toObject(message.paramTypes[keys2[j]], options); + } + if (message.partitionOptions != null && message.hasOwnProperty("partitionOptions")) + object.partitionOptions = $root.google.spanner.v1.PartitionOptions.toObject(message.partitionOptions, options); + return object; + }; + + /** + * Converts this PartitionQueryRequest to JSON. + * @function toJSON + * @memberof google.spanner.v1.PartitionQueryRequest + * @instance + * @returns {Object.} JSON object + */ + PartitionQueryRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PartitionQueryRequest + * @function getTypeUrl + * @memberof google.spanner.v1.PartitionQueryRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PartitionQueryRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.PartitionQueryRequest"; + }; + + return PartitionQueryRequest; + })(); + + v1.PartitionReadRequest = (function() { + + /** + * Properties of a PartitionReadRequest. + * @memberof google.spanner.v1 + * @interface IPartitionReadRequest + * @property {string|null} [session] PartitionReadRequest session + * @property {google.spanner.v1.ITransactionSelector|null} [transaction] PartitionReadRequest transaction + * @property {string|null} [table] PartitionReadRequest table + * @property {string|null} [index] PartitionReadRequest index + * @property {Array.|null} [columns] PartitionReadRequest columns + * @property {google.spanner.v1.IKeySet|null} [keySet] PartitionReadRequest keySet + * @property {google.spanner.v1.IPartitionOptions|null} [partitionOptions] PartitionReadRequest partitionOptions + */ + + /** + * Constructs a new PartitionReadRequest. + * @memberof google.spanner.v1 + * @classdesc Represents a PartitionReadRequest. + * @implements IPartitionReadRequest + * @constructor + * @param {google.spanner.v1.IPartitionReadRequest=} [properties] Properties to set + */ + function PartitionReadRequest(properties) { + this.columns = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PartitionReadRequest session. + * @member {string} session + * @memberof google.spanner.v1.PartitionReadRequest + * @instance + */ + PartitionReadRequest.prototype.session = ""; + + /** + * PartitionReadRequest transaction. + * @member {google.spanner.v1.ITransactionSelector|null|undefined} transaction + * @memberof google.spanner.v1.PartitionReadRequest + * @instance + */ + PartitionReadRequest.prototype.transaction = null; + + /** + * PartitionReadRequest table. + * @member {string} table + * @memberof google.spanner.v1.PartitionReadRequest + * @instance + */ + PartitionReadRequest.prototype.table = ""; + + /** + * PartitionReadRequest index. + * @member {string} index + * @memberof google.spanner.v1.PartitionReadRequest + * @instance + */ + PartitionReadRequest.prototype.index = ""; + + /** + * PartitionReadRequest columns. + * @member {Array.} columns + * @memberof google.spanner.v1.PartitionReadRequest + * @instance + */ + PartitionReadRequest.prototype.columns = $util.emptyArray; + + /** + * PartitionReadRequest keySet. + * @member {google.spanner.v1.IKeySet|null|undefined} keySet + * @memberof google.spanner.v1.PartitionReadRequest + * @instance + */ + PartitionReadRequest.prototype.keySet = null; + + /** + * PartitionReadRequest partitionOptions. + * @member {google.spanner.v1.IPartitionOptions|null|undefined} partitionOptions + * @memberof google.spanner.v1.PartitionReadRequest + * @instance + */ + PartitionReadRequest.prototype.partitionOptions = null; + + /** + * Creates a new PartitionReadRequest instance using the specified properties. + * @function create + * @memberof google.spanner.v1.PartitionReadRequest + * @static + * @param {google.spanner.v1.IPartitionReadRequest=} [properties] Properties to set + * @returns {google.spanner.v1.PartitionReadRequest} PartitionReadRequest instance + */ + PartitionReadRequest.create = function create(properties) { + return new PartitionReadRequest(properties); + }; + + /** + * Encodes the specified PartitionReadRequest message. Does not implicitly {@link google.spanner.v1.PartitionReadRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.PartitionReadRequest + * @static + * @param {google.spanner.v1.IPartitionReadRequest} message PartitionReadRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartitionReadRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.session != null && Object.hasOwnProperty.call(message, "session")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.session); + if (message.transaction != null && Object.hasOwnProperty.call(message, "transaction")) + $root.google.spanner.v1.TransactionSelector.encode(message.transaction, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.table != null && Object.hasOwnProperty.call(message, "table")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.table); + if (message.index != null && Object.hasOwnProperty.call(message, "index")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.index); + if (message.columns != null && message.columns.length) + for (var i = 0; i < message.columns.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.columns[i]); + if (message.keySet != null && Object.hasOwnProperty.call(message, "keySet")) + $root.google.spanner.v1.KeySet.encode(message.keySet, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.partitionOptions != null && Object.hasOwnProperty.call(message, "partitionOptions")) + $root.google.spanner.v1.PartitionOptions.encode(message.partitionOptions, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PartitionReadRequest message, length delimited. Does not implicitly {@link google.spanner.v1.PartitionReadRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.PartitionReadRequest + * @static + * @param {google.spanner.v1.IPartitionReadRequest} message PartitionReadRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartitionReadRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PartitionReadRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.PartitionReadRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.PartitionReadRequest} PartitionReadRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartitionReadRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.PartitionReadRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.session = reader.string(); + break; + } + case 2: { + message.transaction = $root.google.spanner.v1.TransactionSelector.decode(reader, reader.uint32()); + break; + } + case 3: { + message.table = reader.string(); + break; + } + case 4: { + message.index = reader.string(); + break; + } + case 5: { + if (!(message.columns && message.columns.length)) + message.columns = []; + message.columns.push(reader.string()); + break; + } + case 6: { + message.keySet = $root.google.spanner.v1.KeySet.decode(reader, reader.uint32()); + break; + } + case 9: { + message.partitionOptions = $root.google.spanner.v1.PartitionOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PartitionReadRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.PartitionReadRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.PartitionReadRequest} PartitionReadRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartitionReadRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PartitionReadRequest message. + * @function verify + * @memberof google.spanner.v1.PartitionReadRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PartitionReadRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.session != null && message.hasOwnProperty("session")) + if (!$util.isString(message.session)) + return "session: string expected"; + if (message.transaction != null && message.hasOwnProperty("transaction")) { + var error = $root.google.spanner.v1.TransactionSelector.verify(message.transaction); + if (error) + return "transaction." + error; + } + if (message.table != null && message.hasOwnProperty("table")) + if (!$util.isString(message.table)) + return "table: string expected"; + if (message.index != null && message.hasOwnProperty("index")) + if (!$util.isString(message.index)) + return "index: string expected"; + if (message.columns != null && message.hasOwnProperty("columns")) { + if (!Array.isArray(message.columns)) + return "columns: array expected"; + for (var i = 0; i < message.columns.length; ++i) + if (!$util.isString(message.columns[i])) + return "columns: string[] expected"; + } + if (message.keySet != null && message.hasOwnProperty("keySet")) { + var error = $root.google.spanner.v1.KeySet.verify(message.keySet); + if (error) + return "keySet." + error; + } + if (message.partitionOptions != null && message.hasOwnProperty("partitionOptions")) { + var error = $root.google.spanner.v1.PartitionOptions.verify(message.partitionOptions); + if (error) + return "partitionOptions." + error; + } + return null; + }; + + /** + * Creates a PartitionReadRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.PartitionReadRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.PartitionReadRequest} PartitionReadRequest + */ + PartitionReadRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.PartitionReadRequest) + return object; + var message = new $root.google.spanner.v1.PartitionReadRequest(); + if (object.session != null) + message.session = String(object.session); + if (object.transaction != null) { + if (typeof object.transaction !== "object") + throw TypeError(".google.spanner.v1.PartitionReadRequest.transaction: object expected"); + message.transaction = $root.google.spanner.v1.TransactionSelector.fromObject(object.transaction); + } + if (object.table != null) + message.table = String(object.table); + if (object.index != null) + message.index = String(object.index); + if (object.columns) { + if (!Array.isArray(object.columns)) + throw TypeError(".google.spanner.v1.PartitionReadRequest.columns: array expected"); + message.columns = []; + for (var i = 0; i < object.columns.length; ++i) + message.columns[i] = String(object.columns[i]); + } + if (object.keySet != null) { + if (typeof object.keySet !== "object") + throw TypeError(".google.spanner.v1.PartitionReadRequest.keySet: object expected"); + message.keySet = $root.google.spanner.v1.KeySet.fromObject(object.keySet); + } + if (object.partitionOptions != null) { + if (typeof object.partitionOptions !== "object") + throw TypeError(".google.spanner.v1.PartitionReadRequest.partitionOptions: object expected"); + message.partitionOptions = $root.google.spanner.v1.PartitionOptions.fromObject(object.partitionOptions); + } + return message; + }; + + /** + * Creates a plain object from a PartitionReadRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.PartitionReadRequest + * @static + * @param {google.spanner.v1.PartitionReadRequest} message PartitionReadRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PartitionReadRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.columns = []; + if (options.defaults) { + object.session = ""; + object.transaction = null; + object.table = ""; + object.index = ""; + object.keySet = null; + object.partitionOptions = null; + } + if (message.session != null && message.hasOwnProperty("session")) + object.session = message.session; + if (message.transaction != null && message.hasOwnProperty("transaction")) + object.transaction = $root.google.spanner.v1.TransactionSelector.toObject(message.transaction, options); + if (message.table != null && message.hasOwnProperty("table")) + object.table = message.table; + if (message.index != null && message.hasOwnProperty("index")) + object.index = message.index; + if (message.columns && message.columns.length) { + object.columns = []; + for (var j = 0; j < message.columns.length; ++j) + object.columns[j] = message.columns[j]; + } + if (message.keySet != null && message.hasOwnProperty("keySet")) + object.keySet = $root.google.spanner.v1.KeySet.toObject(message.keySet, options); + if (message.partitionOptions != null && message.hasOwnProperty("partitionOptions")) + object.partitionOptions = $root.google.spanner.v1.PartitionOptions.toObject(message.partitionOptions, options); + return object; + }; + + /** + * Converts this PartitionReadRequest to JSON. + * @function toJSON + * @memberof google.spanner.v1.PartitionReadRequest + * @instance + * @returns {Object.} JSON object + */ + PartitionReadRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PartitionReadRequest + * @function getTypeUrl + * @memberof google.spanner.v1.PartitionReadRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PartitionReadRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.PartitionReadRequest"; + }; + + return PartitionReadRequest; + })(); + + v1.Partition = (function() { + + /** + * Properties of a Partition. + * @memberof google.spanner.v1 + * @interface IPartition + * @property {Uint8Array|null} [partitionToken] Partition partitionToken + */ + + /** + * Constructs a new Partition. + * @memberof google.spanner.v1 + * @classdesc Represents a Partition. + * @implements IPartition + * @constructor + * @param {google.spanner.v1.IPartition=} [properties] Properties to set + */ + function Partition(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Partition partitionToken. + * @member {Uint8Array} partitionToken + * @memberof google.spanner.v1.Partition + * @instance + */ + Partition.prototype.partitionToken = $util.newBuffer([]); + + /** + * Creates a new Partition instance using the specified properties. + * @function create + * @memberof google.spanner.v1.Partition + * @static + * @param {google.spanner.v1.IPartition=} [properties] Properties to set + * @returns {google.spanner.v1.Partition} Partition instance + */ + Partition.create = function create(properties) { + return new Partition(properties); + }; + + /** + * Encodes the specified Partition message. Does not implicitly {@link google.spanner.v1.Partition.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.Partition + * @static + * @param {google.spanner.v1.IPartition} message Partition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Partition.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.partitionToken != null && Object.hasOwnProperty.call(message, "partitionToken")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.partitionToken); + return writer; + }; + + /** + * Encodes the specified Partition message, length delimited. Does not implicitly {@link google.spanner.v1.Partition.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.Partition + * @static + * @param {google.spanner.v1.IPartition} message Partition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Partition.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Partition message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.Partition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.Partition} Partition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Partition.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.Partition(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.partitionToken = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Partition message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.Partition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.Partition} Partition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Partition.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Partition message. + * @function verify + * @memberof google.spanner.v1.Partition + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Partition.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.partitionToken != null && message.hasOwnProperty("partitionToken")) + if (!(message.partitionToken && typeof message.partitionToken.length === "number" || $util.isString(message.partitionToken))) + return "partitionToken: buffer expected"; + return null; + }; + + /** + * Creates a Partition message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.Partition + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.Partition} Partition + */ + Partition.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.Partition) + return object; + var message = new $root.google.spanner.v1.Partition(); + if (object.partitionToken != null) + if (typeof object.partitionToken === "string") + $util.base64.decode(object.partitionToken, message.partitionToken = $util.newBuffer($util.base64.length(object.partitionToken)), 0); + else if (object.partitionToken.length >= 0) + message.partitionToken = object.partitionToken; + return message; + }; + + /** + * Creates a plain object from a Partition message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.Partition + * @static + * @param {google.spanner.v1.Partition} message Partition + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Partition.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if (options.bytes === String) + object.partitionToken = ""; + else { + object.partitionToken = []; + if (options.bytes !== Array) + object.partitionToken = $util.newBuffer(object.partitionToken); + } + if (message.partitionToken != null && message.hasOwnProperty("partitionToken")) + object.partitionToken = options.bytes === String ? $util.base64.encode(message.partitionToken, 0, message.partitionToken.length) : options.bytes === Array ? Array.prototype.slice.call(message.partitionToken) : message.partitionToken; + return object; + }; + + /** + * Converts this Partition to JSON. + * @function toJSON + * @memberof google.spanner.v1.Partition + * @instance + * @returns {Object.} JSON object + */ + Partition.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Partition + * @function getTypeUrl + * @memberof google.spanner.v1.Partition + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Partition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.Partition"; + }; + + return Partition; + })(); + + v1.PartitionResponse = (function() { + + /** + * Properties of a PartitionResponse. + * @memberof google.spanner.v1 + * @interface IPartitionResponse + * @property {Array.|null} [partitions] PartitionResponse partitions + * @property {google.spanner.v1.ITransaction|null} [transaction] PartitionResponse transaction + */ + + /** + * Constructs a new PartitionResponse. + * @memberof google.spanner.v1 + * @classdesc Represents a PartitionResponse. + * @implements IPartitionResponse + * @constructor + * @param {google.spanner.v1.IPartitionResponse=} [properties] Properties to set + */ + function PartitionResponse(properties) { + this.partitions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PartitionResponse partitions. + * @member {Array.} partitions + * @memberof google.spanner.v1.PartitionResponse + * @instance + */ + PartitionResponse.prototype.partitions = $util.emptyArray; + + /** + * PartitionResponse transaction. + * @member {google.spanner.v1.ITransaction|null|undefined} transaction + * @memberof google.spanner.v1.PartitionResponse + * @instance + */ + PartitionResponse.prototype.transaction = null; + + /** + * Creates a new PartitionResponse instance using the specified properties. + * @function create + * @memberof google.spanner.v1.PartitionResponse + * @static + * @param {google.spanner.v1.IPartitionResponse=} [properties] Properties to set + * @returns {google.spanner.v1.PartitionResponse} PartitionResponse instance + */ + PartitionResponse.create = function create(properties) { + return new PartitionResponse(properties); + }; + + /** + * Encodes the specified PartitionResponse message. Does not implicitly {@link google.spanner.v1.PartitionResponse.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.PartitionResponse + * @static + * @param {google.spanner.v1.IPartitionResponse} message PartitionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartitionResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.partitions != null && message.partitions.length) + for (var i = 0; i < message.partitions.length; ++i) + $root.google.spanner.v1.Partition.encode(message.partitions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.transaction != null && Object.hasOwnProperty.call(message, "transaction")) + $root.google.spanner.v1.Transaction.encode(message.transaction, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PartitionResponse message, length delimited. Does not implicitly {@link google.spanner.v1.PartitionResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.PartitionResponse + * @static + * @param {google.spanner.v1.IPartitionResponse} message PartitionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartitionResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PartitionResponse message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.PartitionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.PartitionResponse} PartitionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartitionResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.PartitionResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.partitions && message.partitions.length)) + message.partitions = []; + message.partitions.push($root.google.spanner.v1.Partition.decode(reader, reader.uint32())); + break; + } + case 2: { + message.transaction = $root.google.spanner.v1.Transaction.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PartitionResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.PartitionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.PartitionResponse} PartitionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartitionResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PartitionResponse message. + * @function verify + * @memberof google.spanner.v1.PartitionResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PartitionResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.partitions != null && message.hasOwnProperty("partitions")) { + if (!Array.isArray(message.partitions)) + return "partitions: array expected"; + for (var i = 0; i < message.partitions.length; ++i) { + var error = $root.google.spanner.v1.Partition.verify(message.partitions[i]); + if (error) + return "partitions." + error; + } + } + if (message.transaction != null && message.hasOwnProperty("transaction")) { + var error = $root.google.spanner.v1.Transaction.verify(message.transaction); + if (error) + return "transaction." + error; + } + return null; + }; + + /** + * Creates a PartitionResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.PartitionResponse + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.PartitionResponse} PartitionResponse + */ + PartitionResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.PartitionResponse) + return object; + var message = new $root.google.spanner.v1.PartitionResponse(); + if (object.partitions) { + if (!Array.isArray(object.partitions)) + throw TypeError(".google.spanner.v1.PartitionResponse.partitions: array expected"); + message.partitions = []; + for (var i = 0; i < object.partitions.length; ++i) { + if (typeof object.partitions[i] !== "object") + throw TypeError(".google.spanner.v1.PartitionResponse.partitions: object expected"); + message.partitions[i] = $root.google.spanner.v1.Partition.fromObject(object.partitions[i]); + } + } + if (object.transaction != null) { + if (typeof object.transaction !== "object") + throw TypeError(".google.spanner.v1.PartitionResponse.transaction: object expected"); + message.transaction = $root.google.spanner.v1.Transaction.fromObject(object.transaction); + } + return message; + }; + + /** + * Creates a plain object from a PartitionResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.PartitionResponse + * @static + * @param {google.spanner.v1.PartitionResponse} message PartitionResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PartitionResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.partitions = []; + if (options.defaults) + object.transaction = null; + if (message.partitions && message.partitions.length) { + object.partitions = []; + for (var j = 0; j < message.partitions.length; ++j) + object.partitions[j] = $root.google.spanner.v1.Partition.toObject(message.partitions[j], options); + } + if (message.transaction != null && message.hasOwnProperty("transaction")) + object.transaction = $root.google.spanner.v1.Transaction.toObject(message.transaction, options); + return object; + }; + + /** + * Converts this PartitionResponse to JSON. + * @function toJSON + * @memberof google.spanner.v1.PartitionResponse + * @instance + * @returns {Object.} JSON object + */ + PartitionResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PartitionResponse + * @function getTypeUrl + * @memberof google.spanner.v1.PartitionResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PartitionResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.PartitionResponse"; + }; + + return PartitionResponse; + })(); + + v1.ReadRequest = (function() { + + /** + * Properties of a ReadRequest. + * @memberof google.spanner.v1 + * @interface IReadRequest + * @property {string|null} [session] ReadRequest session + * @property {google.spanner.v1.ITransactionSelector|null} [transaction] ReadRequest transaction + * @property {string|null} [table] ReadRequest table + * @property {string|null} [index] ReadRequest index + * @property {Array.|null} [columns] ReadRequest columns + * @property {google.spanner.v1.IKeySet|null} [keySet] ReadRequest keySet + * @property {number|Long|null} [limit] ReadRequest limit + * @property {Uint8Array|null} [resumeToken] ReadRequest resumeToken + * @property {Uint8Array|null} [partitionToken] ReadRequest partitionToken + * @property {google.spanner.v1.IRequestOptions|null} [requestOptions] ReadRequest requestOptions + * @property {google.spanner.v1.IDirectedReadOptions|null} [directedReadOptions] ReadRequest directedReadOptions + * @property {boolean|null} [dataBoostEnabled] ReadRequest dataBoostEnabled + * @property {google.spanner.v1.ReadRequest.OrderBy|null} [orderBy] ReadRequest orderBy + * @property {google.spanner.v1.ReadRequest.LockHint|null} [lockHint] ReadRequest lockHint + * @property {google.spanner.v1.IRoutingHint|null} [routingHint] ReadRequest routingHint + */ + + /** + * Constructs a new ReadRequest. + * @memberof google.spanner.v1 + * @classdesc Represents a ReadRequest. + * @implements IReadRequest + * @constructor + * @param {google.spanner.v1.IReadRequest=} [properties] Properties to set + */ + function ReadRequest(properties) { + this.columns = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReadRequest session. + * @member {string} session + * @memberof google.spanner.v1.ReadRequest + * @instance + */ + ReadRequest.prototype.session = ""; + + /** + * ReadRequest transaction. + * @member {google.spanner.v1.ITransactionSelector|null|undefined} transaction + * @memberof google.spanner.v1.ReadRequest + * @instance + */ + ReadRequest.prototype.transaction = null; + + /** + * ReadRequest table. + * @member {string} table + * @memberof google.spanner.v1.ReadRequest + * @instance + */ + ReadRequest.prototype.table = ""; + + /** + * ReadRequest index. + * @member {string} index + * @memberof google.spanner.v1.ReadRequest + * @instance + */ + ReadRequest.prototype.index = ""; + + /** + * ReadRequest columns. + * @member {Array.} columns + * @memberof google.spanner.v1.ReadRequest + * @instance + */ + ReadRequest.prototype.columns = $util.emptyArray; + + /** + * ReadRequest keySet. + * @member {google.spanner.v1.IKeySet|null|undefined} keySet + * @memberof google.spanner.v1.ReadRequest + * @instance + */ + ReadRequest.prototype.keySet = null; + + /** + * ReadRequest limit. + * @member {number|Long} limit + * @memberof google.spanner.v1.ReadRequest + * @instance + */ + ReadRequest.prototype.limit = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ReadRequest resumeToken. + * @member {Uint8Array} resumeToken + * @memberof google.spanner.v1.ReadRequest + * @instance + */ + ReadRequest.prototype.resumeToken = $util.newBuffer([]); + + /** + * ReadRequest partitionToken. + * @member {Uint8Array} partitionToken + * @memberof google.spanner.v1.ReadRequest + * @instance + */ + ReadRequest.prototype.partitionToken = $util.newBuffer([]); + + /** + * ReadRequest requestOptions. + * @member {google.spanner.v1.IRequestOptions|null|undefined} requestOptions + * @memberof google.spanner.v1.ReadRequest + * @instance + */ + ReadRequest.prototype.requestOptions = null; + + /** + * ReadRequest directedReadOptions. + * @member {google.spanner.v1.IDirectedReadOptions|null|undefined} directedReadOptions + * @memberof google.spanner.v1.ReadRequest + * @instance + */ + ReadRequest.prototype.directedReadOptions = null; + + /** + * ReadRequest dataBoostEnabled. + * @member {boolean} dataBoostEnabled + * @memberof google.spanner.v1.ReadRequest + * @instance + */ + ReadRequest.prototype.dataBoostEnabled = false; + + /** + * ReadRequest orderBy. + * @member {google.spanner.v1.ReadRequest.OrderBy} orderBy + * @memberof google.spanner.v1.ReadRequest + * @instance + */ + ReadRequest.prototype.orderBy = 0; + + /** + * ReadRequest lockHint. + * @member {google.spanner.v1.ReadRequest.LockHint} lockHint + * @memberof google.spanner.v1.ReadRequest + * @instance + */ + ReadRequest.prototype.lockHint = 0; + + /** + * ReadRequest routingHint. + * @member {google.spanner.v1.IRoutingHint|null|undefined} routingHint + * @memberof google.spanner.v1.ReadRequest + * @instance + */ + ReadRequest.prototype.routingHint = null; + + /** + * Creates a new ReadRequest instance using the specified properties. + * @function create + * @memberof google.spanner.v1.ReadRequest + * @static + * @param {google.spanner.v1.IReadRequest=} [properties] Properties to set + * @returns {google.spanner.v1.ReadRequest} ReadRequest instance + */ + ReadRequest.create = function create(properties) { + return new ReadRequest(properties); + }; + + /** + * Encodes the specified ReadRequest message. Does not implicitly {@link google.spanner.v1.ReadRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.ReadRequest + * @static + * @param {google.spanner.v1.IReadRequest} message ReadRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.session != null && Object.hasOwnProperty.call(message, "session")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.session); + if (message.transaction != null && Object.hasOwnProperty.call(message, "transaction")) + $root.google.spanner.v1.TransactionSelector.encode(message.transaction, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.table != null && Object.hasOwnProperty.call(message, "table")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.table); + if (message.index != null && Object.hasOwnProperty.call(message, "index")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.index); + if (message.columns != null && message.columns.length) + for (var i = 0; i < message.columns.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.columns[i]); + if (message.keySet != null && Object.hasOwnProperty.call(message, "keySet")) + $root.google.spanner.v1.KeySet.encode(message.keySet, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) + writer.uint32(/* id 8, wireType 0 =*/64).int64(message.limit); + if (message.resumeToken != null && Object.hasOwnProperty.call(message, "resumeToken")) + writer.uint32(/* id 9, wireType 2 =*/74).bytes(message.resumeToken); + if (message.partitionToken != null && Object.hasOwnProperty.call(message, "partitionToken")) + writer.uint32(/* id 10, wireType 2 =*/82).bytes(message.partitionToken); + if (message.requestOptions != null && Object.hasOwnProperty.call(message, "requestOptions")) + $root.google.spanner.v1.RequestOptions.encode(message.requestOptions, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.directedReadOptions != null && Object.hasOwnProperty.call(message, "directedReadOptions")) + $root.google.spanner.v1.DirectedReadOptions.encode(message.directedReadOptions, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.dataBoostEnabled != null && Object.hasOwnProperty.call(message, "dataBoostEnabled")) + writer.uint32(/* id 15, wireType 0 =*/120).bool(message.dataBoostEnabled); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 16, wireType 0 =*/128).int32(message.orderBy); + if (message.lockHint != null && Object.hasOwnProperty.call(message, "lockHint")) + writer.uint32(/* id 17, wireType 0 =*/136).int32(message.lockHint); + if (message.routingHint != null && Object.hasOwnProperty.call(message, "routingHint")) + $root.google.spanner.v1.RoutingHint.encode(message.routingHint, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ReadRequest message, length delimited. Does not implicitly {@link google.spanner.v1.ReadRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.ReadRequest + * @static + * @param {google.spanner.v1.IReadRequest} message ReadRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReadRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.ReadRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.ReadRequest} ReadRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.ReadRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.session = reader.string(); + break; + } + case 2: { + message.transaction = $root.google.spanner.v1.TransactionSelector.decode(reader, reader.uint32()); + break; + } + case 3: { + message.table = reader.string(); + break; + } + case 4: { + message.index = reader.string(); + break; + } + case 5: { + if (!(message.columns && message.columns.length)) + message.columns = []; + message.columns.push(reader.string()); + break; + } + case 6: { + message.keySet = $root.google.spanner.v1.KeySet.decode(reader, reader.uint32()); + break; + } + case 8: { + message.limit = reader.int64(); + break; + } + case 9: { + message.resumeToken = reader.bytes(); + break; + } + case 10: { + message.partitionToken = reader.bytes(); + break; + } + case 11: { + message.requestOptions = $root.google.spanner.v1.RequestOptions.decode(reader, reader.uint32()); + break; + } + case 14: { + message.directedReadOptions = $root.google.spanner.v1.DirectedReadOptions.decode(reader, reader.uint32()); + break; + } + case 15: { + message.dataBoostEnabled = reader.bool(); + break; + } + case 16: { + message.orderBy = reader.int32(); + break; + } + case 17: { + message.lockHint = reader.int32(); + break; + } + case 18: { + message.routingHint = $root.google.spanner.v1.RoutingHint.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReadRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.ReadRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.ReadRequest} ReadRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReadRequest message. + * @function verify + * @memberof google.spanner.v1.ReadRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReadRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.session != null && message.hasOwnProperty("session")) + if (!$util.isString(message.session)) + return "session: string expected"; + if (message.transaction != null && message.hasOwnProperty("transaction")) { + var error = $root.google.spanner.v1.TransactionSelector.verify(message.transaction); + if (error) + return "transaction." + error; + } + if (message.table != null && message.hasOwnProperty("table")) + if (!$util.isString(message.table)) + return "table: string expected"; + if (message.index != null && message.hasOwnProperty("index")) + if (!$util.isString(message.index)) + return "index: string expected"; + if (message.columns != null && message.hasOwnProperty("columns")) { + if (!Array.isArray(message.columns)) + return "columns: array expected"; + for (var i = 0; i < message.columns.length; ++i) + if (!$util.isString(message.columns[i])) + return "columns: string[] expected"; + } + if (message.keySet != null && message.hasOwnProperty("keySet")) { + var error = $root.google.spanner.v1.KeySet.verify(message.keySet); + if (error) + return "keySet." + error; + } + if (message.limit != null && message.hasOwnProperty("limit")) + if (!$util.isInteger(message.limit) && !(message.limit && $util.isInteger(message.limit.low) && $util.isInteger(message.limit.high))) + return "limit: integer|Long expected"; + if (message.resumeToken != null && message.hasOwnProperty("resumeToken")) + if (!(message.resumeToken && typeof message.resumeToken.length === "number" || $util.isString(message.resumeToken))) + return "resumeToken: buffer expected"; + if (message.partitionToken != null && message.hasOwnProperty("partitionToken")) + if (!(message.partitionToken && typeof message.partitionToken.length === "number" || $util.isString(message.partitionToken))) + return "partitionToken: buffer expected"; + if (message.requestOptions != null && message.hasOwnProperty("requestOptions")) { + var error = $root.google.spanner.v1.RequestOptions.verify(message.requestOptions); + if (error) + return "requestOptions." + error; + } + if (message.directedReadOptions != null && message.hasOwnProperty("directedReadOptions")) { + var error = $root.google.spanner.v1.DirectedReadOptions.verify(message.directedReadOptions); + if (error) + return "directedReadOptions." + error; + } + if (message.dataBoostEnabled != null && message.hasOwnProperty("dataBoostEnabled")) + if (typeof message.dataBoostEnabled !== "boolean") + return "dataBoostEnabled: boolean expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + switch (message.orderBy) { + default: + return "orderBy: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.lockHint != null && message.hasOwnProperty("lockHint")) + switch (message.lockHint) { + default: + return "lockHint: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.routingHint != null && message.hasOwnProperty("routingHint")) { + var error = $root.google.spanner.v1.RoutingHint.verify(message.routingHint); + if (error) + return "routingHint." + error; + } + return null; + }; + + /** + * Creates a ReadRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.ReadRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.ReadRequest} ReadRequest + */ + ReadRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.ReadRequest) + return object; + var message = new $root.google.spanner.v1.ReadRequest(); + if (object.session != null) + message.session = String(object.session); + if (object.transaction != null) { + if (typeof object.transaction !== "object") + throw TypeError(".google.spanner.v1.ReadRequest.transaction: object expected"); + message.transaction = $root.google.spanner.v1.TransactionSelector.fromObject(object.transaction); + } + if (object.table != null) + message.table = String(object.table); + if (object.index != null) + message.index = String(object.index); + if (object.columns) { + if (!Array.isArray(object.columns)) + throw TypeError(".google.spanner.v1.ReadRequest.columns: array expected"); + message.columns = []; + for (var i = 0; i < object.columns.length; ++i) + message.columns[i] = String(object.columns[i]); + } + if (object.keySet != null) { + if (typeof object.keySet !== "object") + throw TypeError(".google.spanner.v1.ReadRequest.keySet: object expected"); + message.keySet = $root.google.spanner.v1.KeySet.fromObject(object.keySet); + } + if (object.limit != null) + if ($util.Long) + (message.limit = $util.Long.fromValue(object.limit)).unsigned = false; + else if (typeof object.limit === "string") + message.limit = parseInt(object.limit, 10); + else if (typeof object.limit === "number") + message.limit = object.limit; + else if (typeof object.limit === "object") + message.limit = new $util.LongBits(object.limit.low >>> 0, object.limit.high >>> 0).toNumber(); + if (object.resumeToken != null) + if (typeof object.resumeToken === "string") + $util.base64.decode(object.resumeToken, message.resumeToken = $util.newBuffer($util.base64.length(object.resumeToken)), 0); + else if (object.resumeToken.length >= 0) + message.resumeToken = object.resumeToken; + if (object.partitionToken != null) + if (typeof object.partitionToken === "string") + $util.base64.decode(object.partitionToken, message.partitionToken = $util.newBuffer($util.base64.length(object.partitionToken)), 0); + else if (object.partitionToken.length >= 0) + message.partitionToken = object.partitionToken; + if (object.requestOptions != null) { + if (typeof object.requestOptions !== "object") + throw TypeError(".google.spanner.v1.ReadRequest.requestOptions: object expected"); + message.requestOptions = $root.google.spanner.v1.RequestOptions.fromObject(object.requestOptions); + } + if (object.directedReadOptions != null) { + if (typeof object.directedReadOptions !== "object") + throw TypeError(".google.spanner.v1.ReadRequest.directedReadOptions: object expected"); + message.directedReadOptions = $root.google.spanner.v1.DirectedReadOptions.fromObject(object.directedReadOptions); + } + if (object.dataBoostEnabled != null) + message.dataBoostEnabled = Boolean(object.dataBoostEnabled); + switch (object.orderBy) { + default: + if (typeof object.orderBy === "number") { + message.orderBy = object.orderBy; + break; + } + break; + case "ORDER_BY_UNSPECIFIED": + case 0: + message.orderBy = 0; + break; + case "ORDER_BY_PRIMARY_KEY": + case 1: + message.orderBy = 1; + break; + case "ORDER_BY_NO_ORDER": + case 2: + message.orderBy = 2; + break; + } + switch (object.lockHint) { + default: + if (typeof object.lockHint === "number") { + message.lockHint = object.lockHint; + break; + } + break; + case "LOCK_HINT_UNSPECIFIED": + case 0: + message.lockHint = 0; + break; + case "LOCK_HINT_SHARED": + case 1: + message.lockHint = 1; + break; + case "LOCK_HINT_EXCLUSIVE": + case 2: + message.lockHint = 2; + break; + } + if (object.routingHint != null) { + if (typeof object.routingHint !== "object") + throw TypeError(".google.spanner.v1.ReadRequest.routingHint: object expected"); + message.routingHint = $root.google.spanner.v1.RoutingHint.fromObject(object.routingHint); + } + return message; + }; + + /** + * Creates a plain object from a ReadRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.ReadRequest + * @static + * @param {google.spanner.v1.ReadRequest} message ReadRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReadRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.columns = []; + if (options.defaults) { + object.session = ""; + object.transaction = null; + object.table = ""; + object.index = ""; + object.keySet = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.limit = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.limit = options.longs === String ? "0" : 0; + if (options.bytes === String) + object.resumeToken = ""; + else { + object.resumeToken = []; + if (options.bytes !== Array) + object.resumeToken = $util.newBuffer(object.resumeToken); + } + if (options.bytes === String) + object.partitionToken = ""; + else { + object.partitionToken = []; + if (options.bytes !== Array) + object.partitionToken = $util.newBuffer(object.partitionToken); + } + object.requestOptions = null; + object.directedReadOptions = null; + object.dataBoostEnabled = false; + object.orderBy = options.enums === String ? "ORDER_BY_UNSPECIFIED" : 0; + object.lockHint = options.enums === String ? "LOCK_HINT_UNSPECIFIED" : 0; + object.routingHint = null; + } + if (message.session != null && message.hasOwnProperty("session")) + object.session = message.session; + if (message.transaction != null && message.hasOwnProperty("transaction")) + object.transaction = $root.google.spanner.v1.TransactionSelector.toObject(message.transaction, options); + if (message.table != null && message.hasOwnProperty("table")) + object.table = message.table; + if (message.index != null && message.hasOwnProperty("index")) + object.index = message.index; + if (message.columns && message.columns.length) { + object.columns = []; + for (var j = 0; j < message.columns.length; ++j) + object.columns[j] = message.columns[j]; + } + if (message.keySet != null && message.hasOwnProperty("keySet")) + object.keySet = $root.google.spanner.v1.KeySet.toObject(message.keySet, options); + if (message.limit != null && message.hasOwnProperty("limit")) + if (typeof message.limit === "number") + object.limit = options.longs === String ? String(message.limit) : message.limit; + else + object.limit = options.longs === String ? $util.Long.prototype.toString.call(message.limit) : options.longs === Number ? new $util.LongBits(message.limit.low >>> 0, message.limit.high >>> 0).toNumber() : message.limit; + if (message.resumeToken != null && message.hasOwnProperty("resumeToken")) + object.resumeToken = options.bytes === String ? $util.base64.encode(message.resumeToken, 0, message.resumeToken.length) : options.bytes === Array ? Array.prototype.slice.call(message.resumeToken) : message.resumeToken; + if (message.partitionToken != null && message.hasOwnProperty("partitionToken")) + object.partitionToken = options.bytes === String ? $util.base64.encode(message.partitionToken, 0, message.partitionToken.length) : options.bytes === Array ? Array.prototype.slice.call(message.partitionToken) : message.partitionToken; + if (message.requestOptions != null && message.hasOwnProperty("requestOptions")) + object.requestOptions = $root.google.spanner.v1.RequestOptions.toObject(message.requestOptions, options); + if (message.directedReadOptions != null && message.hasOwnProperty("directedReadOptions")) + object.directedReadOptions = $root.google.spanner.v1.DirectedReadOptions.toObject(message.directedReadOptions, options); + if (message.dataBoostEnabled != null && message.hasOwnProperty("dataBoostEnabled")) + object.dataBoostEnabled = message.dataBoostEnabled; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = options.enums === String ? $root.google.spanner.v1.ReadRequest.OrderBy[message.orderBy] === undefined ? message.orderBy : $root.google.spanner.v1.ReadRequest.OrderBy[message.orderBy] : message.orderBy; + if (message.lockHint != null && message.hasOwnProperty("lockHint")) + object.lockHint = options.enums === String ? $root.google.spanner.v1.ReadRequest.LockHint[message.lockHint] === undefined ? message.lockHint : $root.google.spanner.v1.ReadRequest.LockHint[message.lockHint] : message.lockHint; + if (message.routingHint != null && message.hasOwnProperty("routingHint")) + object.routingHint = $root.google.spanner.v1.RoutingHint.toObject(message.routingHint, options); + return object; + }; + + /** + * Converts this ReadRequest to JSON. + * @function toJSON + * @memberof google.spanner.v1.ReadRequest + * @instance + * @returns {Object.} JSON object + */ + ReadRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReadRequest + * @function getTypeUrl + * @memberof google.spanner.v1.ReadRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReadRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.ReadRequest"; + }; + + /** + * OrderBy enum. + * @name google.spanner.v1.ReadRequest.OrderBy + * @enum {number} + * @property {number} ORDER_BY_UNSPECIFIED=0 ORDER_BY_UNSPECIFIED value + * @property {number} ORDER_BY_PRIMARY_KEY=1 ORDER_BY_PRIMARY_KEY value + * @property {number} ORDER_BY_NO_ORDER=2 ORDER_BY_NO_ORDER value + */ + ReadRequest.OrderBy = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ORDER_BY_UNSPECIFIED"] = 0; + values[valuesById[1] = "ORDER_BY_PRIMARY_KEY"] = 1; + values[valuesById[2] = "ORDER_BY_NO_ORDER"] = 2; + return values; + })(); + + /** + * LockHint enum. + * @name google.spanner.v1.ReadRequest.LockHint + * @enum {number} + * @property {number} LOCK_HINT_UNSPECIFIED=0 LOCK_HINT_UNSPECIFIED value + * @property {number} LOCK_HINT_SHARED=1 LOCK_HINT_SHARED value + * @property {number} LOCK_HINT_EXCLUSIVE=2 LOCK_HINT_EXCLUSIVE value + */ + ReadRequest.LockHint = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LOCK_HINT_UNSPECIFIED"] = 0; + values[valuesById[1] = "LOCK_HINT_SHARED"] = 1; + values[valuesById[2] = "LOCK_HINT_EXCLUSIVE"] = 2; + return values; + })(); + + return ReadRequest; + })(); + + v1.BeginTransactionRequest = (function() { + + /** + * Properties of a BeginTransactionRequest. + * @memberof google.spanner.v1 + * @interface IBeginTransactionRequest + * @property {string|null} [session] BeginTransactionRequest session + * @property {google.spanner.v1.ITransactionOptions|null} [options] BeginTransactionRequest options + * @property {google.spanner.v1.IRequestOptions|null} [requestOptions] BeginTransactionRequest requestOptions + * @property {google.spanner.v1.IMutation|null} [mutationKey] BeginTransactionRequest mutationKey + */ + + /** + * Constructs a new BeginTransactionRequest. + * @memberof google.spanner.v1 + * @classdesc Represents a BeginTransactionRequest. + * @implements IBeginTransactionRequest + * @constructor + * @param {google.spanner.v1.IBeginTransactionRequest=} [properties] Properties to set + */ + function BeginTransactionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BeginTransactionRequest session. + * @member {string} session + * @memberof google.spanner.v1.BeginTransactionRequest + * @instance + */ + BeginTransactionRequest.prototype.session = ""; + + /** + * BeginTransactionRequest options. + * @member {google.spanner.v1.ITransactionOptions|null|undefined} options + * @memberof google.spanner.v1.BeginTransactionRequest + * @instance + */ + BeginTransactionRequest.prototype.options = null; + + /** + * BeginTransactionRequest requestOptions. + * @member {google.spanner.v1.IRequestOptions|null|undefined} requestOptions + * @memberof google.spanner.v1.BeginTransactionRequest + * @instance + */ + BeginTransactionRequest.prototype.requestOptions = null; + + /** + * BeginTransactionRequest mutationKey. + * @member {google.spanner.v1.IMutation|null|undefined} mutationKey + * @memberof google.spanner.v1.BeginTransactionRequest + * @instance + */ + BeginTransactionRequest.prototype.mutationKey = null; + + /** + * Creates a new BeginTransactionRequest instance using the specified properties. + * @function create + * @memberof google.spanner.v1.BeginTransactionRequest + * @static + * @param {google.spanner.v1.IBeginTransactionRequest=} [properties] Properties to set + * @returns {google.spanner.v1.BeginTransactionRequest} BeginTransactionRequest instance + */ + BeginTransactionRequest.create = function create(properties) { + return new BeginTransactionRequest(properties); + }; + + /** + * Encodes the specified BeginTransactionRequest message. Does not implicitly {@link google.spanner.v1.BeginTransactionRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.BeginTransactionRequest + * @static + * @param {google.spanner.v1.IBeginTransactionRequest} message BeginTransactionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BeginTransactionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.session != null && Object.hasOwnProperty.call(message, "session")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.session); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.spanner.v1.TransactionOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestOptions != null && Object.hasOwnProperty.call(message, "requestOptions")) + $root.google.spanner.v1.RequestOptions.encode(message.requestOptions, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.mutationKey != null && Object.hasOwnProperty.call(message, "mutationKey")) + $root.google.spanner.v1.Mutation.encode(message.mutationKey, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BeginTransactionRequest message, length delimited. Does not implicitly {@link google.spanner.v1.BeginTransactionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.BeginTransactionRequest + * @static + * @param {google.spanner.v1.IBeginTransactionRequest} message BeginTransactionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BeginTransactionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BeginTransactionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.BeginTransactionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.BeginTransactionRequest} BeginTransactionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BeginTransactionRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.BeginTransactionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.session = reader.string(); + break; + } + case 2: { + message.options = $root.google.spanner.v1.TransactionOptions.decode(reader, reader.uint32()); + break; + } + case 3: { + message.requestOptions = $root.google.spanner.v1.RequestOptions.decode(reader, reader.uint32()); + break; + } + case 4: { + message.mutationKey = $root.google.spanner.v1.Mutation.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BeginTransactionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.BeginTransactionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.BeginTransactionRequest} BeginTransactionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BeginTransactionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BeginTransactionRequest message. + * @function verify + * @memberof google.spanner.v1.BeginTransactionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BeginTransactionRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.session != null && message.hasOwnProperty("session")) + if (!$util.isString(message.session)) + return "session: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.spanner.v1.TransactionOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.requestOptions != null && message.hasOwnProperty("requestOptions")) { + var error = $root.google.spanner.v1.RequestOptions.verify(message.requestOptions); + if (error) + return "requestOptions." + error; + } + if (message.mutationKey != null && message.hasOwnProperty("mutationKey")) { + var error = $root.google.spanner.v1.Mutation.verify(message.mutationKey); + if (error) + return "mutationKey." + error; + } + return null; + }; + + /** + * Creates a BeginTransactionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.BeginTransactionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.BeginTransactionRequest} BeginTransactionRequest + */ + BeginTransactionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.BeginTransactionRequest) + return object; + var message = new $root.google.spanner.v1.BeginTransactionRequest(); + if (object.session != null) + message.session = String(object.session); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.spanner.v1.BeginTransactionRequest.options: object expected"); + message.options = $root.google.spanner.v1.TransactionOptions.fromObject(object.options); + } + if (object.requestOptions != null) { + if (typeof object.requestOptions !== "object") + throw TypeError(".google.spanner.v1.BeginTransactionRequest.requestOptions: object expected"); + message.requestOptions = $root.google.spanner.v1.RequestOptions.fromObject(object.requestOptions); + } + if (object.mutationKey != null) { + if (typeof object.mutationKey !== "object") + throw TypeError(".google.spanner.v1.BeginTransactionRequest.mutationKey: object expected"); + message.mutationKey = $root.google.spanner.v1.Mutation.fromObject(object.mutationKey); + } + return message; + }; + + /** + * Creates a plain object from a BeginTransactionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.BeginTransactionRequest + * @static + * @param {google.spanner.v1.BeginTransactionRequest} message BeginTransactionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BeginTransactionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.session = ""; + object.options = null; + object.requestOptions = null; + object.mutationKey = null; + } + if (message.session != null && message.hasOwnProperty("session")) + object.session = message.session; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.spanner.v1.TransactionOptions.toObject(message.options, options); + if (message.requestOptions != null && message.hasOwnProperty("requestOptions")) + object.requestOptions = $root.google.spanner.v1.RequestOptions.toObject(message.requestOptions, options); + if (message.mutationKey != null && message.hasOwnProperty("mutationKey")) + object.mutationKey = $root.google.spanner.v1.Mutation.toObject(message.mutationKey, options); + return object; + }; + + /** + * Converts this BeginTransactionRequest to JSON. + * @function toJSON + * @memberof google.spanner.v1.BeginTransactionRequest + * @instance + * @returns {Object.} JSON object + */ + BeginTransactionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BeginTransactionRequest + * @function getTypeUrl + * @memberof google.spanner.v1.BeginTransactionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BeginTransactionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.BeginTransactionRequest"; + }; + + return BeginTransactionRequest; + })(); + + v1.CommitRequest = (function() { + + /** + * Properties of a CommitRequest. + * @memberof google.spanner.v1 + * @interface ICommitRequest + * @property {string|null} [session] CommitRequest session + * @property {Uint8Array|null} [transactionId] CommitRequest transactionId + * @property {google.spanner.v1.ITransactionOptions|null} [singleUseTransaction] CommitRequest singleUseTransaction + * @property {Array.|null} [mutations] CommitRequest mutations + * @property {boolean|null} [returnCommitStats] CommitRequest returnCommitStats + * @property {google.protobuf.IDuration|null} [maxCommitDelay] CommitRequest maxCommitDelay + * @property {google.spanner.v1.IRequestOptions|null} [requestOptions] CommitRequest requestOptions + * @property {google.spanner.v1.IMultiplexedSessionPrecommitToken|null} [precommitToken] CommitRequest precommitToken + */ + + /** + * Constructs a new CommitRequest. + * @memberof google.spanner.v1 + * @classdesc Represents a CommitRequest. + * @implements ICommitRequest + * @constructor + * @param {google.spanner.v1.ICommitRequest=} [properties] Properties to set + */ + function CommitRequest(properties) { + this.mutations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CommitRequest session. + * @member {string} session + * @memberof google.spanner.v1.CommitRequest + * @instance + */ + CommitRequest.prototype.session = ""; + + /** + * CommitRequest transactionId. + * @member {Uint8Array|null|undefined} transactionId + * @memberof google.spanner.v1.CommitRequest + * @instance + */ + CommitRequest.prototype.transactionId = null; + + /** + * CommitRequest singleUseTransaction. + * @member {google.spanner.v1.ITransactionOptions|null|undefined} singleUseTransaction + * @memberof google.spanner.v1.CommitRequest + * @instance + */ + CommitRequest.prototype.singleUseTransaction = null; + + /** + * CommitRequest mutations. + * @member {Array.} mutations + * @memberof google.spanner.v1.CommitRequest + * @instance + */ + CommitRequest.prototype.mutations = $util.emptyArray; + + /** + * CommitRequest returnCommitStats. + * @member {boolean} returnCommitStats + * @memberof google.spanner.v1.CommitRequest + * @instance + */ + CommitRequest.prototype.returnCommitStats = false; + + /** + * CommitRequest maxCommitDelay. + * @member {google.protobuf.IDuration|null|undefined} maxCommitDelay + * @memberof google.spanner.v1.CommitRequest + * @instance + */ + CommitRequest.prototype.maxCommitDelay = null; + + /** + * CommitRequest requestOptions. + * @member {google.spanner.v1.IRequestOptions|null|undefined} requestOptions + * @memberof google.spanner.v1.CommitRequest + * @instance + */ + CommitRequest.prototype.requestOptions = null; + + /** + * CommitRequest precommitToken. + * @member {google.spanner.v1.IMultiplexedSessionPrecommitToken|null|undefined} precommitToken + * @memberof google.spanner.v1.CommitRequest + * @instance + */ + CommitRequest.prototype.precommitToken = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * CommitRequest transaction. + * @member {"transactionId"|"singleUseTransaction"|undefined} transaction + * @memberof google.spanner.v1.CommitRequest + * @instance + */ + Object.defineProperty(CommitRequest.prototype, "transaction", { + get: $util.oneOfGetter($oneOfFields = ["transactionId", "singleUseTransaction"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CommitRequest instance using the specified properties. + * @function create + * @memberof google.spanner.v1.CommitRequest + * @static + * @param {google.spanner.v1.ICommitRequest=} [properties] Properties to set + * @returns {google.spanner.v1.CommitRequest} CommitRequest instance + */ + CommitRequest.create = function create(properties) { + return new CommitRequest(properties); + }; + + /** + * Encodes the specified CommitRequest message. Does not implicitly {@link google.spanner.v1.CommitRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.CommitRequest + * @static + * @param {google.spanner.v1.ICommitRequest} message CommitRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommitRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.session != null && Object.hasOwnProperty.call(message, "session")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.session); + if (message.transactionId != null && Object.hasOwnProperty.call(message, "transactionId")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.transactionId); + if (message.singleUseTransaction != null && Object.hasOwnProperty.call(message, "singleUseTransaction")) + $root.google.spanner.v1.TransactionOptions.encode(message.singleUseTransaction, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.mutations != null && message.mutations.length) + for (var i = 0; i < message.mutations.length; ++i) + $root.google.spanner.v1.Mutation.encode(message.mutations[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.returnCommitStats != null && Object.hasOwnProperty.call(message, "returnCommitStats")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.returnCommitStats); + if (message.requestOptions != null && Object.hasOwnProperty.call(message, "requestOptions")) + $root.google.spanner.v1.RequestOptions.encode(message.requestOptions, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.maxCommitDelay != null && Object.hasOwnProperty.call(message, "maxCommitDelay")) + $root.google.protobuf.Duration.encode(message.maxCommitDelay, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.precommitToken != null && Object.hasOwnProperty.call(message, "precommitToken")) + $root.google.spanner.v1.MultiplexedSessionPrecommitToken.encode(message.precommitToken, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CommitRequest message, length delimited. Does not implicitly {@link google.spanner.v1.CommitRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.CommitRequest + * @static + * @param {google.spanner.v1.ICommitRequest} message CommitRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommitRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CommitRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.CommitRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.CommitRequest} CommitRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommitRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.CommitRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.session = reader.string(); + break; + } + case 2: { + message.transactionId = reader.bytes(); + break; + } + case 3: { + message.singleUseTransaction = $root.google.spanner.v1.TransactionOptions.decode(reader, reader.uint32()); + break; + } + case 4: { + if (!(message.mutations && message.mutations.length)) + message.mutations = []; + message.mutations.push($root.google.spanner.v1.Mutation.decode(reader, reader.uint32())); + break; + } + case 5: { + message.returnCommitStats = reader.bool(); + break; + } + case 8: { + message.maxCommitDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 6: { + message.requestOptions = $root.google.spanner.v1.RequestOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + message.precommitToken = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CommitRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.CommitRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.CommitRequest} CommitRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommitRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CommitRequest message. + * @function verify + * @memberof google.spanner.v1.CommitRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CommitRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.session != null && message.hasOwnProperty("session")) + if (!$util.isString(message.session)) + return "session: string expected"; + if (message.transactionId != null && message.hasOwnProperty("transactionId")) { + properties.transaction = 1; + if (!(message.transactionId && typeof message.transactionId.length === "number" || $util.isString(message.transactionId))) + return "transactionId: buffer expected"; + } + if (message.singleUseTransaction != null && message.hasOwnProperty("singleUseTransaction")) { + if (properties.transaction === 1) + return "transaction: multiple values"; + properties.transaction = 1; + { + var error = $root.google.spanner.v1.TransactionOptions.verify(message.singleUseTransaction); + if (error) + return "singleUseTransaction." + error; + } + } + if (message.mutations != null && message.hasOwnProperty("mutations")) { + if (!Array.isArray(message.mutations)) + return "mutations: array expected"; + for (var i = 0; i < message.mutations.length; ++i) { + var error = $root.google.spanner.v1.Mutation.verify(message.mutations[i]); + if (error) + return "mutations." + error; + } + } + if (message.returnCommitStats != null && message.hasOwnProperty("returnCommitStats")) + if (typeof message.returnCommitStats !== "boolean") + return "returnCommitStats: boolean expected"; + if (message.maxCommitDelay != null && message.hasOwnProperty("maxCommitDelay")) { + var error = $root.google.protobuf.Duration.verify(message.maxCommitDelay); + if (error) + return "maxCommitDelay." + error; + } + if (message.requestOptions != null && message.hasOwnProperty("requestOptions")) { + var error = $root.google.spanner.v1.RequestOptions.verify(message.requestOptions); + if (error) + return "requestOptions." + error; + } + if (message.precommitToken != null && message.hasOwnProperty("precommitToken")) { + var error = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.verify(message.precommitToken); + if (error) + return "precommitToken." + error; + } + return null; + }; + + /** + * Creates a CommitRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.CommitRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.CommitRequest} CommitRequest + */ + CommitRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.CommitRequest) + return object; + var message = new $root.google.spanner.v1.CommitRequest(); + if (object.session != null) + message.session = String(object.session); + if (object.transactionId != null) + if (typeof object.transactionId === "string") + $util.base64.decode(object.transactionId, message.transactionId = $util.newBuffer($util.base64.length(object.transactionId)), 0); + else if (object.transactionId.length >= 0) + message.transactionId = object.transactionId; + if (object.singleUseTransaction != null) { + if (typeof object.singleUseTransaction !== "object") + throw TypeError(".google.spanner.v1.CommitRequest.singleUseTransaction: object expected"); + message.singleUseTransaction = $root.google.spanner.v1.TransactionOptions.fromObject(object.singleUseTransaction); + } + if (object.mutations) { + if (!Array.isArray(object.mutations)) + throw TypeError(".google.spanner.v1.CommitRequest.mutations: array expected"); + message.mutations = []; + for (var i = 0; i < object.mutations.length; ++i) { + if (typeof object.mutations[i] !== "object") + throw TypeError(".google.spanner.v1.CommitRequest.mutations: object expected"); + message.mutations[i] = $root.google.spanner.v1.Mutation.fromObject(object.mutations[i]); + } + } + if (object.returnCommitStats != null) + message.returnCommitStats = Boolean(object.returnCommitStats); + if (object.maxCommitDelay != null) { + if (typeof object.maxCommitDelay !== "object") + throw TypeError(".google.spanner.v1.CommitRequest.maxCommitDelay: object expected"); + message.maxCommitDelay = $root.google.protobuf.Duration.fromObject(object.maxCommitDelay); + } + if (object.requestOptions != null) { + if (typeof object.requestOptions !== "object") + throw TypeError(".google.spanner.v1.CommitRequest.requestOptions: object expected"); + message.requestOptions = $root.google.spanner.v1.RequestOptions.fromObject(object.requestOptions); + } + if (object.precommitToken != null) { + if (typeof object.precommitToken !== "object") + throw TypeError(".google.spanner.v1.CommitRequest.precommitToken: object expected"); + message.precommitToken = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.fromObject(object.precommitToken); + } + return message; + }; + + /** + * Creates a plain object from a CommitRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.CommitRequest + * @static + * @param {google.spanner.v1.CommitRequest} message CommitRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CommitRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.mutations = []; + if (options.defaults) { + object.session = ""; + object.returnCommitStats = false; + object.requestOptions = null; + object.maxCommitDelay = null; + object.precommitToken = null; + } + if (message.session != null && message.hasOwnProperty("session")) + object.session = message.session; + if (message.transactionId != null && message.hasOwnProperty("transactionId")) { + object.transactionId = options.bytes === String ? $util.base64.encode(message.transactionId, 0, message.transactionId.length) : options.bytes === Array ? Array.prototype.slice.call(message.transactionId) : message.transactionId; + if (options.oneofs) + object.transaction = "transactionId"; + } + if (message.singleUseTransaction != null && message.hasOwnProperty("singleUseTransaction")) { + object.singleUseTransaction = $root.google.spanner.v1.TransactionOptions.toObject(message.singleUseTransaction, options); + if (options.oneofs) + object.transaction = "singleUseTransaction"; + } + if (message.mutations && message.mutations.length) { + object.mutations = []; + for (var j = 0; j < message.mutations.length; ++j) + object.mutations[j] = $root.google.spanner.v1.Mutation.toObject(message.mutations[j], options); + } + if (message.returnCommitStats != null && message.hasOwnProperty("returnCommitStats")) + object.returnCommitStats = message.returnCommitStats; + if (message.requestOptions != null && message.hasOwnProperty("requestOptions")) + object.requestOptions = $root.google.spanner.v1.RequestOptions.toObject(message.requestOptions, options); + if (message.maxCommitDelay != null && message.hasOwnProperty("maxCommitDelay")) + object.maxCommitDelay = $root.google.protobuf.Duration.toObject(message.maxCommitDelay, options); + if (message.precommitToken != null && message.hasOwnProperty("precommitToken")) + object.precommitToken = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.toObject(message.precommitToken, options); + return object; + }; + + /** + * Converts this CommitRequest to JSON. + * @function toJSON + * @memberof google.spanner.v1.CommitRequest + * @instance + * @returns {Object.} JSON object + */ + CommitRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CommitRequest + * @function getTypeUrl + * @memberof google.spanner.v1.CommitRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CommitRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.CommitRequest"; + }; + + return CommitRequest; + })(); + + v1.RollbackRequest = (function() { + + /** + * Properties of a RollbackRequest. + * @memberof google.spanner.v1 + * @interface IRollbackRequest + * @property {string|null} [session] RollbackRequest session + * @property {Uint8Array|null} [transactionId] RollbackRequest transactionId + */ + + /** + * Constructs a new RollbackRequest. + * @memberof google.spanner.v1 + * @classdesc Represents a RollbackRequest. + * @implements IRollbackRequest + * @constructor + * @param {google.spanner.v1.IRollbackRequest=} [properties] Properties to set + */ + function RollbackRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RollbackRequest session. + * @member {string} session + * @memberof google.spanner.v1.RollbackRequest + * @instance + */ + RollbackRequest.prototype.session = ""; + + /** + * RollbackRequest transactionId. + * @member {Uint8Array} transactionId + * @memberof google.spanner.v1.RollbackRequest + * @instance + */ + RollbackRequest.prototype.transactionId = $util.newBuffer([]); + + /** + * Creates a new RollbackRequest instance using the specified properties. + * @function create + * @memberof google.spanner.v1.RollbackRequest + * @static + * @param {google.spanner.v1.IRollbackRequest=} [properties] Properties to set + * @returns {google.spanner.v1.RollbackRequest} RollbackRequest instance + */ + RollbackRequest.create = function create(properties) { + return new RollbackRequest(properties); + }; + + /** + * Encodes the specified RollbackRequest message. Does not implicitly {@link google.spanner.v1.RollbackRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.RollbackRequest + * @static + * @param {google.spanner.v1.IRollbackRequest} message RollbackRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RollbackRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.session != null && Object.hasOwnProperty.call(message, "session")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.session); + if (message.transactionId != null && Object.hasOwnProperty.call(message, "transactionId")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.transactionId); + return writer; + }; + + /** + * Encodes the specified RollbackRequest message, length delimited. Does not implicitly {@link google.spanner.v1.RollbackRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.RollbackRequest + * @static + * @param {google.spanner.v1.IRollbackRequest} message RollbackRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RollbackRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RollbackRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.RollbackRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.RollbackRequest} RollbackRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RollbackRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.RollbackRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.session = reader.string(); + break; + } + case 2: { + message.transactionId = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RollbackRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.RollbackRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.RollbackRequest} RollbackRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RollbackRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RollbackRequest message. + * @function verify + * @memberof google.spanner.v1.RollbackRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RollbackRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.session != null && message.hasOwnProperty("session")) + if (!$util.isString(message.session)) + return "session: string expected"; + if (message.transactionId != null && message.hasOwnProperty("transactionId")) + if (!(message.transactionId && typeof message.transactionId.length === "number" || $util.isString(message.transactionId))) + return "transactionId: buffer expected"; + return null; + }; + + /** + * Creates a RollbackRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.RollbackRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.RollbackRequest} RollbackRequest + */ + RollbackRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.RollbackRequest) + return object; + var message = new $root.google.spanner.v1.RollbackRequest(); + if (object.session != null) + message.session = String(object.session); + if (object.transactionId != null) + if (typeof object.transactionId === "string") + $util.base64.decode(object.transactionId, message.transactionId = $util.newBuffer($util.base64.length(object.transactionId)), 0); + else if (object.transactionId.length >= 0) + message.transactionId = object.transactionId; + return message; + }; + + /** + * Creates a plain object from a RollbackRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.RollbackRequest + * @static + * @param {google.spanner.v1.RollbackRequest} message RollbackRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RollbackRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.session = ""; + if (options.bytes === String) + object.transactionId = ""; + else { + object.transactionId = []; + if (options.bytes !== Array) + object.transactionId = $util.newBuffer(object.transactionId); + } + } + if (message.session != null && message.hasOwnProperty("session")) + object.session = message.session; + if (message.transactionId != null && message.hasOwnProperty("transactionId")) + object.transactionId = options.bytes === String ? $util.base64.encode(message.transactionId, 0, message.transactionId.length) : options.bytes === Array ? Array.prototype.slice.call(message.transactionId) : message.transactionId; + return object; + }; + + /** + * Converts this RollbackRequest to JSON. + * @function toJSON + * @memberof google.spanner.v1.RollbackRequest + * @instance + * @returns {Object.} JSON object + */ + RollbackRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RollbackRequest + * @function getTypeUrl + * @memberof google.spanner.v1.RollbackRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RollbackRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.RollbackRequest"; + }; + + return RollbackRequest; + })(); + + v1.BatchWriteRequest = (function() { + + /** + * Properties of a BatchWriteRequest. + * @memberof google.spanner.v1 + * @interface IBatchWriteRequest + * @property {string|null} [session] BatchWriteRequest session + * @property {google.spanner.v1.IRequestOptions|null} [requestOptions] BatchWriteRequest requestOptions + * @property {Array.|null} [mutationGroups] BatchWriteRequest mutationGroups + * @property {boolean|null} [excludeTxnFromChangeStreams] BatchWriteRequest excludeTxnFromChangeStreams + */ + + /** + * Constructs a new BatchWriteRequest. + * @memberof google.spanner.v1 + * @classdesc Represents a BatchWriteRequest. + * @implements IBatchWriteRequest + * @constructor + * @param {google.spanner.v1.IBatchWriteRequest=} [properties] Properties to set + */ + function BatchWriteRequest(properties) { + this.mutationGroups = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchWriteRequest session. + * @member {string} session + * @memberof google.spanner.v1.BatchWriteRequest + * @instance + */ + BatchWriteRequest.prototype.session = ""; + + /** + * BatchWriteRequest requestOptions. + * @member {google.spanner.v1.IRequestOptions|null|undefined} requestOptions + * @memberof google.spanner.v1.BatchWriteRequest + * @instance + */ + BatchWriteRequest.prototype.requestOptions = null; + + /** + * BatchWriteRequest mutationGroups. + * @member {Array.} mutationGroups + * @memberof google.spanner.v1.BatchWriteRequest + * @instance + */ + BatchWriteRequest.prototype.mutationGroups = $util.emptyArray; + + /** + * BatchWriteRequest excludeTxnFromChangeStreams. + * @member {boolean} excludeTxnFromChangeStreams + * @memberof google.spanner.v1.BatchWriteRequest + * @instance + */ + BatchWriteRequest.prototype.excludeTxnFromChangeStreams = false; + + /** + * Creates a new BatchWriteRequest instance using the specified properties. + * @function create + * @memberof google.spanner.v1.BatchWriteRequest + * @static + * @param {google.spanner.v1.IBatchWriteRequest=} [properties] Properties to set + * @returns {google.spanner.v1.BatchWriteRequest} BatchWriteRequest instance + */ + BatchWriteRequest.create = function create(properties) { + return new BatchWriteRequest(properties); + }; + + /** + * Encodes the specified BatchWriteRequest message. Does not implicitly {@link google.spanner.v1.BatchWriteRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.BatchWriteRequest + * @static + * @param {google.spanner.v1.IBatchWriteRequest} message BatchWriteRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchWriteRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.session != null && Object.hasOwnProperty.call(message, "session")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.session); + if (message.requestOptions != null && Object.hasOwnProperty.call(message, "requestOptions")) + $root.google.spanner.v1.RequestOptions.encode(message.requestOptions, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.mutationGroups != null && message.mutationGroups.length) + for (var i = 0; i < message.mutationGroups.length; ++i) + $root.google.spanner.v1.BatchWriteRequest.MutationGroup.encode(message.mutationGroups[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.excludeTxnFromChangeStreams != null && Object.hasOwnProperty.call(message, "excludeTxnFromChangeStreams")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.excludeTxnFromChangeStreams); + return writer; + }; + + /** + * Encodes the specified BatchWriteRequest message, length delimited. Does not implicitly {@link google.spanner.v1.BatchWriteRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.BatchWriteRequest + * @static + * @param {google.spanner.v1.IBatchWriteRequest} message BatchWriteRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchWriteRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchWriteRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.BatchWriteRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.BatchWriteRequest} BatchWriteRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchWriteRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.BatchWriteRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.session = reader.string(); + break; + } + case 3: { + message.requestOptions = $root.google.spanner.v1.RequestOptions.decode(reader, reader.uint32()); + break; + } + case 4: { + if (!(message.mutationGroups && message.mutationGroups.length)) + message.mutationGroups = []; + message.mutationGroups.push($root.google.spanner.v1.BatchWriteRequest.MutationGroup.decode(reader, reader.uint32())); + break; + } + case 5: { + message.excludeTxnFromChangeStreams = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchWriteRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.BatchWriteRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.BatchWriteRequest} BatchWriteRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchWriteRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchWriteRequest message. + * @function verify + * @memberof google.spanner.v1.BatchWriteRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchWriteRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.session != null && message.hasOwnProperty("session")) + if (!$util.isString(message.session)) + return "session: string expected"; + if (message.requestOptions != null && message.hasOwnProperty("requestOptions")) { + var error = $root.google.spanner.v1.RequestOptions.verify(message.requestOptions); + if (error) + return "requestOptions." + error; + } + if (message.mutationGroups != null && message.hasOwnProperty("mutationGroups")) { + if (!Array.isArray(message.mutationGroups)) + return "mutationGroups: array expected"; + for (var i = 0; i < message.mutationGroups.length; ++i) { + var error = $root.google.spanner.v1.BatchWriteRequest.MutationGroup.verify(message.mutationGroups[i]); + if (error) + return "mutationGroups." + error; + } + } + if (message.excludeTxnFromChangeStreams != null && message.hasOwnProperty("excludeTxnFromChangeStreams")) + if (typeof message.excludeTxnFromChangeStreams !== "boolean") + return "excludeTxnFromChangeStreams: boolean expected"; + return null; + }; + + /** + * Creates a BatchWriteRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.BatchWriteRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.BatchWriteRequest} BatchWriteRequest + */ + BatchWriteRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.BatchWriteRequest) + return object; + var message = new $root.google.spanner.v1.BatchWriteRequest(); + if (object.session != null) + message.session = String(object.session); + if (object.requestOptions != null) { + if (typeof object.requestOptions !== "object") + throw TypeError(".google.spanner.v1.BatchWriteRequest.requestOptions: object expected"); + message.requestOptions = $root.google.spanner.v1.RequestOptions.fromObject(object.requestOptions); + } + if (object.mutationGroups) { + if (!Array.isArray(object.mutationGroups)) + throw TypeError(".google.spanner.v1.BatchWriteRequest.mutationGroups: array expected"); + message.mutationGroups = []; + for (var i = 0; i < object.mutationGroups.length; ++i) { + if (typeof object.mutationGroups[i] !== "object") + throw TypeError(".google.spanner.v1.BatchWriteRequest.mutationGroups: object expected"); + message.mutationGroups[i] = $root.google.spanner.v1.BatchWriteRequest.MutationGroup.fromObject(object.mutationGroups[i]); + } + } + if (object.excludeTxnFromChangeStreams != null) + message.excludeTxnFromChangeStreams = Boolean(object.excludeTxnFromChangeStreams); + return message; + }; + + /** + * Creates a plain object from a BatchWriteRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.BatchWriteRequest + * @static + * @param {google.spanner.v1.BatchWriteRequest} message BatchWriteRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchWriteRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.mutationGroups = []; + if (options.defaults) { + object.session = ""; + object.requestOptions = null; + object.excludeTxnFromChangeStreams = false; + } + if (message.session != null && message.hasOwnProperty("session")) + object.session = message.session; + if (message.requestOptions != null && message.hasOwnProperty("requestOptions")) + object.requestOptions = $root.google.spanner.v1.RequestOptions.toObject(message.requestOptions, options); + if (message.mutationGroups && message.mutationGroups.length) { + object.mutationGroups = []; + for (var j = 0; j < message.mutationGroups.length; ++j) + object.mutationGroups[j] = $root.google.spanner.v1.BatchWriteRequest.MutationGroup.toObject(message.mutationGroups[j], options); + } + if (message.excludeTxnFromChangeStreams != null && message.hasOwnProperty("excludeTxnFromChangeStreams")) + object.excludeTxnFromChangeStreams = message.excludeTxnFromChangeStreams; + return object; + }; + + /** + * Converts this BatchWriteRequest to JSON. + * @function toJSON + * @memberof google.spanner.v1.BatchWriteRequest + * @instance + * @returns {Object.} JSON object + */ + BatchWriteRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchWriteRequest + * @function getTypeUrl + * @memberof google.spanner.v1.BatchWriteRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchWriteRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.BatchWriteRequest"; + }; + + BatchWriteRequest.MutationGroup = (function() { + + /** + * Properties of a MutationGroup. + * @memberof google.spanner.v1.BatchWriteRequest + * @interface IMutationGroup + * @property {Array.|null} [mutations] MutationGroup mutations + */ + + /** + * Constructs a new MutationGroup. + * @memberof google.spanner.v1.BatchWriteRequest + * @classdesc Represents a MutationGroup. + * @implements IMutationGroup + * @constructor + * @param {google.spanner.v1.BatchWriteRequest.IMutationGroup=} [properties] Properties to set + */ + function MutationGroup(properties) { + this.mutations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MutationGroup mutations. + * @member {Array.} mutations + * @memberof google.spanner.v1.BatchWriteRequest.MutationGroup + * @instance + */ + MutationGroup.prototype.mutations = $util.emptyArray; + + /** + * Creates a new MutationGroup instance using the specified properties. + * @function create + * @memberof google.spanner.v1.BatchWriteRequest.MutationGroup + * @static + * @param {google.spanner.v1.BatchWriteRequest.IMutationGroup=} [properties] Properties to set + * @returns {google.spanner.v1.BatchWriteRequest.MutationGroup} MutationGroup instance + */ + MutationGroup.create = function create(properties) { + return new MutationGroup(properties); + }; + + /** + * Encodes the specified MutationGroup message. Does not implicitly {@link google.spanner.v1.BatchWriteRequest.MutationGroup.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.BatchWriteRequest.MutationGroup + * @static + * @param {google.spanner.v1.BatchWriteRequest.IMutationGroup} message MutationGroup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MutationGroup.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mutations != null && message.mutations.length) + for (var i = 0; i < message.mutations.length; ++i) + $root.google.spanner.v1.Mutation.encode(message.mutations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MutationGroup message, length delimited. Does not implicitly {@link google.spanner.v1.BatchWriteRequest.MutationGroup.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.BatchWriteRequest.MutationGroup + * @static + * @param {google.spanner.v1.BatchWriteRequest.IMutationGroup} message MutationGroup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MutationGroup.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MutationGroup message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.BatchWriteRequest.MutationGroup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.BatchWriteRequest.MutationGroup} MutationGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MutationGroup.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.BatchWriteRequest.MutationGroup(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.mutations && message.mutations.length)) + message.mutations = []; + message.mutations.push($root.google.spanner.v1.Mutation.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MutationGroup message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.BatchWriteRequest.MutationGroup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.BatchWriteRequest.MutationGroup} MutationGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MutationGroup.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MutationGroup message. + * @function verify + * @memberof google.spanner.v1.BatchWriteRequest.MutationGroup + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MutationGroup.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.mutations != null && message.hasOwnProperty("mutations")) { + if (!Array.isArray(message.mutations)) + return "mutations: array expected"; + for (var i = 0; i < message.mutations.length; ++i) { + var error = $root.google.spanner.v1.Mutation.verify(message.mutations[i]); + if (error) + return "mutations." + error; + } + } + return null; + }; + + /** + * Creates a MutationGroup message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.BatchWriteRequest.MutationGroup + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.BatchWriteRequest.MutationGroup} MutationGroup + */ + MutationGroup.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.BatchWriteRequest.MutationGroup) + return object; + var message = new $root.google.spanner.v1.BatchWriteRequest.MutationGroup(); + if (object.mutations) { + if (!Array.isArray(object.mutations)) + throw TypeError(".google.spanner.v1.BatchWriteRequest.MutationGroup.mutations: array expected"); + message.mutations = []; + for (var i = 0; i < object.mutations.length; ++i) { + if (typeof object.mutations[i] !== "object") + throw TypeError(".google.spanner.v1.BatchWriteRequest.MutationGroup.mutations: object expected"); + message.mutations[i] = $root.google.spanner.v1.Mutation.fromObject(object.mutations[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a MutationGroup message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.BatchWriteRequest.MutationGroup + * @static + * @param {google.spanner.v1.BatchWriteRequest.MutationGroup} message MutationGroup + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MutationGroup.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.mutations = []; + if (message.mutations && message.mutations.length) { + object.mutations = []; + for (var j = 0; j < message.mutations.length; ++j) + object.mutations[j] = $root.google.spanner.v1.Mutation.toObject(message.mutations[j], options); + } + return object; + }; + + /** + * Converts this MutationGroup to JSON. + * @function toJSON + * @memberof google.spanner.v1.BatchWriteRequest.MutationGroup + * @instance + * @returns {Object.} JSON object + */ + MutationGroup.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MutationGroup + * @function getTypeUrl + * @memberof google.spanner.v1.BatchWriteRequest.MutationGroup + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MutationGroup.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.BatchWriteRequest.MutationGroup"; + }; + + return MutationGroup; + })(); + + return BatchWriteRequest; + })(); + + v1.BatchWriteResponse = (function() { + + /** + * Properties of a BatchWriteResponse. + * @memberof google.spanner.v1 + * @interface IBatchWriteResponse + * @property {Array.|null} [indexes] BatchWriteResponse indexes + * @property {google.rpc.IStatus|null} [status] BatchWriteResponse status + * @property {google.protobuf.ITimestamp|null} [commitTimestamp] BatchWriteResponse commitTimestamp + */ + + /** + * Constructs a new BatchWriteResponse. + * @memberof google.spanner.v1 + * @classdesc Represents a BatchWriteResponse. + * @implements IBatchWriteResponse + * @constructor + * @param {google.spanner.v1.IBatchWriteResponse=} [properties] Properties to set + */ + function BatchWriteResponse(properties) { + this.indexes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchWriteResponse indexes. + * @member {Array.} indexes + * @memberof google.spanner.v1.BatchWriteResponse + * @instance + */ + BatchWriteResponse.prototype.indexes = $util.emptyArray; + + /** + * BatchWriteResponse status. + * @member {google.rpc.IStatus|null|undefined} status + * @memberof google.spanner.v1.BatchWriteResponse + * @instance + */ + BatchWriteResponse.prototype.status = null; + + /** + * BatchWriteResponse commitTimestamp. + * @member {google.protobuf.ITimestamp|null|undefined} commitTimestamp + * @memberof google.spanner.v1.BatchWriteResponse + * @instance + */ + BatchWriteResponse.prototype.commitTimestamp = null; + + /** + * Creates a new BatchWriteResponse instance using the specified properties. + * @function create + * @memberof google.spanner.v1.BatchWriteResponse + * @static + * @param {google.spanner.v1.IBatchWriteResponse=} [properties] Properties to set + * @returns {google.spanner.v1.BatchWriteResponse} BatchWriteResponse instance + */ + BatchWriteResponse.create = function create(properties) { + return new BatchWriteResponse(properties); + }; + + /** + * Encodes the specified BatchWriteResponse message. Does not implicitly {@link google.spanner.v1.BatchWriteResponse.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.BatchWriteResponse + * @static + * @param {google.spanner.v1.IBatchWriteResponse} message BatchWriteResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchWriteResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.indexes != null && message.indexes.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.indexes.length; ++i) + writer.int32(message.indexes[i]); + writer.ldelim(); + } + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + $root.google.rpc.Status.encode(message.status, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.commitTimestamp != null && Object.hasOwnProperty.call(message, "commitTimestamp")) + $root.google.protobuf.Timestamp.encode(message.commitTimestamp, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchWriteResponse message, length delimited. Does not implicitly {@link google.spanner.v1.BatchWriteResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.BatchWriteResponse + * @static + * @param {google.spanner.v1.IBatchWriteResponse} message BatchWriteResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchWriteResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchWriteResponse message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.BatchWriteResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.BatchWriteResponse} BatchWriteResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchWriteResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.BatchWriteResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.indexes && message.indexes.length)) + message.indexes = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.indexes.push(reader.int32()); + } else + message.indexes.push(reader.int32()); + break; + } + case 2: { + message.status = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 3: { + message.commitTimestamp = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchWriteResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.BatchWriteResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.BatchWriteResponse} BatchWriteResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchWriteResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchWriteResponse message. + * @function verify + * @memberof google.spanner.v1.BatchWriteResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchWriteResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.indexes != null && message.hasOwnProperty("indexes")) { + if (!Array.isArray(message.indexes)) + return "indexes: array expected"; + for (var i = 0; i < message.indexes.length; ++i) + if (!$util.isInteger(message.indexes[i])) + return "indexes: integer[] expected"; + } + if (message.status != null && message.hasOwnProperty("status")) { + var error = $root.google.rpc.Status.verify(message.status); + if (error) + return "status." + error; + } + if (message.commitTimestamp != null && message.hasOwnProperty("commitTimestamp")) { + var error = $root.google.protobuf.Timestamp.verify(message.commitTimestamp); + if (error) + return "commitTimestamp." + error; + } + return null; + }; + + /** + * Creates a BatchWriteResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.BatchWriteResponse + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.BatchWriteResponse} BatchWriteResponse + */ + BatchWriteResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.BatchWriteResponse) + return object; + var message = new $root.google.spanner.v1.BatchWriteResponse(); + if (object.indexes) { + if (!Array.isArray(object.indexes)) + throw TypeError(".google.spanner.v1.BatchWriteResponse.indexes: array expected"); + message.indexes = []; + for (var i = 0; i < object.indexes.length; ++i) + message.indexes[i] = object.indexes[i] | 0; + } + if (object.status != null) { + if (typeof object.status !== "object") + throw TypeError(".google.spanner.v1.BatchWriteResponse.status: object expected"); + message.status = $root.google.rpc.Status.fromObject(object.status); + } + if (object.commitTimestamp != null) { + if (typeof object.commitTimestamp !== "object") + throw TypeError(".google.spanner.v1.BatchWriteResponse.commitTimestamp: object expected"); + message.commitTimestamp = $root.google.protobuf.Timestamp.fromObject(object.commitTimestamp); + } + return message; + }; + + /** + * Creates a plain object from a BatchWriteResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.BatchWriteResponse + * @static + * @param {google.spanner.v1.BatchWriteResponse} message BatchWriteResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchWriteResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.indexes = []; + if (options.defaults) { + object.status = null; + object.commitTimestamp = null; + } + if (message.indexes && message.indexes.length) { + object.indexes = []; + for (var j = 0; j < message.indexes.length; ++j) + object.indexes[j] = message.indexes[j]; + } + if (message.status != null && message.hasOwnProperty("status")) + object.status = $root.google.rpc.Status.toObject(message.status, options); + if (message.commitTimestamp != null && message.hasOwnProperty("commitTimestamp")) + object.commitTimestamp = $root.google.protobuf.Timestamp.toObject(message.commitTimestamp, options); + return object; + }; + + /** + * Converts this BatchWriteResponse to JSON. + * @function toJSON + * @memberof google.spanner.v1.BatchWriteResponse + * @instance + * @returns {Object.} JSON object + */ + BatchWriteResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchWriteResponse + * @function getTypeUrl + * @memberof google.spanner.v1.BatchWriteResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchWriteResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.BatchWriteResponse"; + }; + + return BatchWriteResponse; + })(); + + v1.CommitResponse = (function() { + + /** + * Properties of a CommitResponse. + * @memberof google.spanner.v1 + * @interface ICommitResponse + * @property {google.protobuf.ITimestamp|null} [commitTimestamp] CommitResponse commitTimestamp + * @property {google.spanner.v1.CommitResponse.ICommitStats|null} [commitStats] CommitResponse commitStats + * @property {google.spanner.v1.IMultiplexedSessionPrecommitToken|null} [precommitToken] CommitResponse precommitToken + * @property {google.protobuf.ITimestamp|null} [snapshotTimestamp] CommitResponse snapshotTimestamp + */ + + /** + * Constructs a new CommitResponse. + * @memberof google.spanner.v1 + * @classdesc Represents a CommitResponse. + * @implements ICommitResponse + * @constructor + * @param {google.spanner.v1.ICommitResponse=} [properties] Properties to set + */ + function CommitResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CommitResponse commitTimestamp. + * @member {google.protobuf.ITimestamp|null|undefined} commitTimestamp + * @memberof google.spanner.v1.CommitResponse + * @instance + */ + CommitResponse.prototype.commitTimestamp = null; + + /** + * CommitResponse commitStats. + * @member {google.spanner.v1.CommitResponse.ICommitStats|null|undefined} commitStats + * @memberof google.spanner.v1.CommitResponse + * @instance + */ + CommitResponse.prototype.commitStats = null; + + /** + * CommitResponse precommitToken. + * @member {google.spanner.v1.IMultiplexedSessionPrecommitToken|null|undefined} precommitToken + * @memberof google.spanner.v1.CommitResponse + * @instance + */ + CommitResponse.prototype.precommitToken = null; + + /** + * CommitResponse snapshotTimestamp. + * @member {google.protobuf.ITimestamp|null|undefined} snapshotTimestamp + * @memberof google.spanner.v1.CommitResponse + * @instance + */ + CommitResponse.prototype.snapshotTimestamp = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * CommitResponse MultiplexedSessionRetry. + * @member {"precommitToken"|undefined} MultiplexedSessionRetry + * @memberof google.spanner.v1.CommitResponse + * @instance + */ + Object.defineProperty(CommitResponse.prototype, "MultiplexedSessionRetry", { + get: $util.oneOfGetter($oneOfFields = ["precommitToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CommitResponse instance using the specified properties. + * @function create + * @memberof google.spanner.v1.CommitResponse + * @static + * @param {google.spanner.v1.ICommitResponse=} [properties] Properties to set + * @returns {google.spanner.v1.CommitResponse} CommitResponse instance + */ + CommitResponse.create = function create(properties) { + return new CommitResponse(properties); + }; + + /** + * Encodes the specified CommitResponse message. Does not implicitly {@link google.spanner.v1.CommitResponse.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.CommitResponse + * @static + * @param {google.spanner.v1.ICommitResponse} message CommitResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommitResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.commitTimestamp != null && Object.hasOwnProperty.call(message, "commitTimestamp")) + $root.google.protobuf.Timestamp.encode(message.commitTimestamp, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.commitStats != null && Object.hasOwnProperty.call(message, "commitStats")) + $root.google.spanner.v1.CommitResponse.CommitStats.encode(message.commitStats, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.precommitToken != null && Object.hasOwnProperty.call(message, "precommitToken")) + $root.google.spanner.v1.MultiplexedSessionPrecommitToken.encode(message.precommitToken, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.snapshotTimestamp != null && Object.hasOwnProperty.call(message, "snapshotTimestamp")) + $root.google.protobuf.Timestamp.encode(message.snapshotTimestamp, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CommitResponse message, length delimited. Does not implicitly {@link google.spanner.v1.CommitResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.CommitResponse + * @static + * @param {google.spanner.v1.ICommitResponse} message CommitResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommitResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CommitResponse message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.CommitResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.CommitResponse} CommitResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommitResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.CommitResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.commitTimestamp = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.commitStats = $root.google.spanner.v1.CommitResponse.CommitStats.decode(reader, reader.uint32()); + break; + } + case 4: { + message.precommitToken = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.decode(reader, reader.uint32()); + break; + } + case 5: { + message.snapshotTimestamp = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CommitResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.CommitResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.CommitResponse} CommitResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommitResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CommitResponse message. + * @function verify + * @memberof google.spanner.v1.CommitResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CommitResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.commitTimestamp != null && message.hasOwnProperty("commitTimestamp")) { + var error = $root.google.protobuf.Timestamp.verify(message.commitTimestamp); + if (error) + return "commitTimestamp." + error; + } + if (message.commitStats != null && message.hasOwnProperty("commitStats")) { + var error = $root.google.spanner.v1.CommitResponse.CommitStats.verify(message.commitStats); + if (error) + return "commitStats." + error; + } + if (message.precommitToken != null && message.hasOwnProperty("precommitToken")) { + properties.MultiplexedSessionRetry = 1; + { + var error = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.verify(message.precommitToken); + if (error) + return "precommitToken." + error; + } + } + if (message.snapshotTimestamp != null && message.hasOwnProperty("snapshotTimestamp")) { + var error = $root.google.protobuf.Timestamp.verify(message.snapshotTimestamp); + if (error) + return "snapshotTimestamp." + error; + } + return null; + }; + + /** + * Creates a CommitResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.CommitResponse + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.CommitResponse} CommitResponse + */ + CommitResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.CommitResponse) + return object; + var message = new $root.google.spanner.v1.CommitResponse(); + if (object.commitTimestamp != null) { + if (typeof object.commitTimestamp !== "object") + throw TypeError(".google.spanner.v1.CommitResponse.commitTimestamp: object expected"); + message.commitTimestamp = $root.google.protobuf.Timestamp.fromObject(object.commitTimestamp); + } + if (object.commitStats != null) { + if (typeof object.commitStats !== "object") + throw TypeError(".google.spanner.v1.CommitResponse.commitStats: object expected"); + message.commitStats = $root.google.spanner.v1.CommitResponse.CommitStats.fromObject(object.commitStats); + } + if (object.precommitToken != null) { + if (typeof object.precommitToken !== "object") + throw TypeError(".google.spanner.v1.CommitResponse.precommitToken: object expected"); + message.precommitToken = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.fromObject(object.precommitToken); + } + if (object.snapshotTimestamp != null) { + if (typeof object.snapshotTimestamp !== "object") + throw TypeError(".google.spanner.v1.CommitResponse.snapshotTimestamp: object expected"); + message.snapshotTimestamp = $root.google.protobuf.Timestamp.fromObject(object.snapshotTimestamp); + } + return message; + }; + + /** + * Creates a plain object from a CommitResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.CommitResponse + * @static + * @param {google.spanner.v1.CommitResponse} message CommitResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CommitResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.commitTimestamp = null; + object.commitStats = null; + object.snapshotTimestamp = null; + } + if (message.commitTimestamp != null && message.hasOwnProperty("commitTimestamp")) + object.commitTimestamp = $root.google.protobuf.Timestamp.toObject(message.commitTimestamp, options); + if (message.commitStats != null && message.hasOwnProperty("commitStats")) + object.commitStats = $root.google.spanner.v1.CommitResponse.CommitStats.toObject(message.commitStats, options); + if (message.precommitToken != null && message.hasOwnProperty("precommitToken")) { + object.precommitToken = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.toObject(message.precommitToken, options); + if (options.oneofs) + object.MultiplexedSessionRetry = "precommitToken"; + } + if (message.snapshotTimestamp != null && message.hasOwnProperty("snapshotTimestamp")) + object.snapshotTimestamp = $root.google.protobuf.Timestamp.toObject(message.snapshotTimestamp, options); + return object; + }; + + /** + * Converts this CommitResponse to JSON. + * @function toJSON + * @memberof google.spanner.v1.CommitResponse + * @instance + * @returns {Object.} JSON object + */ + CommitResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CommitResponse + * @function getTypeUrl + * @memberof google.spanner.v1.CommitResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CommitResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.CommitResponse"; + }; + + CommitResponse.CommitStats = (function() { + + /** + * Properties of a CommitStats. + * @memberof google.spanner.v1.CommitResponse + * @interface ICommitStats + * @property {number|Long|null} [mutationCount] CommitStats mutationCount + */ + + /** + * Constructs a new CommitStats. + * @memberof google.spanner.v1.CommitResponse + * @classdesc Represents a CommitStats. + * @implements ICommitStats + * @constructor + * @param {google.spanner.v1.CommitResponse.ICommitStats=} [properties] Properties to set + */ + function CommitStats(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CommitStats mutationCount. + * @member {number|Long} mutationCount + * @memberof google.spanner.v1.CommitResponse.CommitStats + * @instance + */ + CommitStats.prototype.mutationCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new CommitStats instance using the specified properties. + * @function create + * @memberof google.spanner.v1.CommitResponse.CommitStats + * @static + * @param {google.spanner.v1.CommitResponse.ICommitStats=} [properties] Properties to set + * @returns {google.spanner.v1.CommitResponse.CommitStats} CommitStats instance + */ + CommitStats.create = function create(properties) { + return new CommitStats(properties); + }; + + /** + * Encodes the specified CommitStats message. Does not implicitly {@link google.spanner.v1.CommitResponse.CommitStats.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.CommitResponse.CommitStats + * @static + * @param {google.spanner.v1.CommitResponse.ICommitStats} message CommitStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommitStats.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mutationCount != null && Object.hasOwnProperty.call(message, "mutationCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.mutationCount); + return writer; + }; + + /** + * Encodes the specified CommitStats message, length delimited. Does not implicitly {@link google.spanner.v1.CommitResponse.CommitStats.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.CommitResponse.CommitStats + * @static + * @param {google.spanner.v1.CommitResponse.ICommitStats} message CommitStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommitStats.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CommitStats message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.CommitResponse.CommitStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.CommitResponse.CommitStats} CommitStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommitStats.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.CommitResponse.CommitStats(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.mutationCount = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CommitStats message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.CommitResponse.CommitStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.CommitResponse.CommitStats} CommitStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommitStats.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CommitStats message. + * @function verify + * @memberof google.spanner.v1.CommitResponse.CommitStats + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CommitStats.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.mutationCount != null && message.hasOwnProperty("mutationCount")) + if (!$util.isInteger(message.mutationCount) && !(message.mutationCount && $util.isInteger(message.mutationCount.low) && $util.isInteger(message.mutationCount.high))) + return "mutationCount: integer|Long expected"; + return null; + }; + + /** + * Creates a CommitStats message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.CommitResponse.CommitStats + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.CommitResponse.CommitStats} CommitStats + */ + CommitStats.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.CommitResponse.CommitStats) + return object; + var message = new $root.google.spanner.v1.CommitResponse.CommitStats(); + if (object.mutationCount != null) + if ($util.Long) + (message.mutationCount = $util.Long.fromValue(object.mutationCount)).unsigned = false; + else if (typeof object.mutationCount === "string") + message.mutationCount = parseInt(object.mutationCount, 10); + else if (typeof object.mutationCount === "number") + message.mutationCount = object.mutationCount; + else if (typeof object.mutationCount === "object") + message.mutationCount = new $util.LongBits(object.mutationCount.low >>> 0, object.mutationCount.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a CommitStats message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.CommitResponse.CommitStats + * @static + * @param {google.spanner.v1.CommitResponse.CommitStats} message CommitStats + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CommitStats.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.mutationCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.mutationCount = options.longs === String ? "0" : 0; + if (message.mutationCount != null && message.hasOwnProperty("mutationCount")) + if (typeof message.mutationCount === "number") + object.mutationCount = options.longs === String ? String(message.mutationCount) : message.mutationCount; + else + object.mutationCount = options.longs === String ? $util.Long.prototype.toString.call(message.mutationCount) : options.longs === Number ? new $util.LongBits(message.mutationCount.low >>> 0, message.mutationCount.high >>> 0).toNumber() : message.mutationCount; + return object; + }; + + /** + * Converts this CommitStats to JSON. + * @function toJSON + * @memberof google.spanner.v1.CommitResponse.CommitStats + * @instance + * @returns {Object.} JSON object + */ + CommitStats.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CommitStats + * @function getTypeUrl + * @memberof google.spanner.v1.CommitResponse.CommitStats + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CommitStats.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.CommitResponse.CommitStats"; + }; + + return CommitStats; + })(); + + return CommitResponse; + })(); + + v1.TransactionOptions = (function() { + + /** + * Properties of a TransactionOptions. + * @memberof google.spanner.v1 + * @interface ITransactionOptions + * @property {google.spanner.v1.TransactionOptions.IReadWrite|null} [readWrite] TransactionOptions readWrite + * @property {google.spanner.v1.TransactionOptions.IPartitionedDml|null} [partitionedDml] TransactionOptions partitionedDml + * @property {google.spanner.v1.TransactionOptions.IReadOnly|null} [readOnly] TransactionOptions readOnly + * @property {boolean|null} [excludeTxnFromChangeStreams] TransactionOptions excludeTxnFromChangeStreams + * @property {google.spanner.v1.TransactionOptions.IsolationLevel|null} [isolationLevel] TransactionOptions isolationLevel + */ + + /** + * Constructs a new TransactionOptions. + * @memberof google.spanner.v1 + * @classdesc Represents a TransactionOptions. + * @implements ITransactionOptions + * @constructor + * @param {google.spanner.v1.ITransactionOptions=} [properties] Properties to set + */ + function TransactionOptions(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TransactionOptions readWrite. + * @member {google.spanner.v1.TransactionOptions.IReadWrite|null|undefined} readWrite + * @memberof google.spanner.v1.TransactionOptions + * @instance + */ + TransactionOptions.prototype.readWrite = null; + + /** + * TransactionOptions partitionedDml. + * @member {google.spanner.v1.TransactionOptions.IPartitionedDml|null|undefined} partitionedDml + * @memberof google.spanner.v1.TransactionOptions + * @instance + */ + TransactionOptions.prototype.partitionedDml = null; + + /** + * TransactionOptions readOnly. + * @member {google.spanner.v1.TransactionOptions.IReadOnly|null|undefined} readOnly + * @memberof google.spanner.v1.TransactionOptions + * @instance + */ + TransactionOptions.prototype.readOnly = null; + + /** + * TransactionOptions excludeTxnFromChangeStreams. + * @member {boolean} excludeTxnFromChangeStreams + * @memberof google.spanner.v1.TransactionOptions + * @instance + */ + TransactionOptions.prototype.excludeTxnFromChangeStreams = false; + + /** + * TransactionOptions isolationLevel. + * @member {google.spanner.v1.TransactionOptions.IsolationLevel} isolationLevel + * @memberof google.spanner.v1.TransactionOptions + * @instance + */ + TransactionOptions.prototype.isolationLevel = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TransactionOptions mode. + * @member {"readWrite"|"partitionedDml"|"readOnly"|undefined} mode + * @memberof google.spanner.v1.TransactionOptions + * @instance + */ + Object.defineProperty(TransactionOptions.prototype, "mode", { + get: $util.oneOfGetter($oneOfFields = ["readWrite", "partitionedDml", "readOnly"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TransactionOptions instance using the specified properties. + * @function create + * @memberof google.spanner.v1.TransactionOptions + * @static + * @param {google.spanner.v1.ITransactionOptions=} [properties] Properties to set + * @returns {google.spanner.v1.TransactionOptions} TransactionOptions instance + */ + TransactionOptions.create = function create(properties) { + return new TransactionOptions(properties); + }; + + /** + * Encodes the specified TransactionOptions message. Does not implicitly {@link google.spanner.v1.TransactionOptions.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.TransactionOptions + * @static + * @param {google.spanner.v1.ITransactionOptions} message TransactionOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.readWrite != null && Object.hasOwnProperty.call(message, "readWrite")) + $root.google.spanner.v1.TransactionOptions.ReadWrite.encode(message.readWrite, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.readOnly != null && Object.hasOwnProperty.call(message, "readOnly")) + $root.google.spanner.v1.TransactionOptions.ReadOnly.encode(message.readOnly, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.partitionedDml != null && Object.hasOwnProperty.call(message, "partitionedDml")) + $root.google.spanner.v1.TransactionOptions.PartitionedDml.encode(message.partitionedDml, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.excludeTxnFromChangeStreams != null && Object.hasOwnProperty.call(message, "excludeTxnFromChangeStreams")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.excludeTxnFromChangeStreams); + if (message.isolationLevel != null && Object.hasOwnProperty.call(message, "isolationLevel")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.isolationLevel); + return writer; + }; + + /** + * Encodes the specified TransactionOptions message, length delimited. Does not implicitly {@link google.spanner.v1.TransactionOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.TransactionOptions + * @static + * @param {google.spanner.v1.ITransactionOptions} message TransactionOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TransactionOptions message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.TransactionOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.TransactionOptions} TransactionOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.TransactionOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.readWrite = $root.google.spanner.v1.TransactionOptions.ReadWrite.decode(reader, reader.uint32()); + break; + } + case 3: { + message.partitionedDml = $root.google.spanner.v1.TransactionOptions.PartitionedDml.decode(reader, reader.uint32()); + break; + } + case 2: { + message.readOnly = $root.google.spanner.v1.TransactionOptions.ReadOnly.decode(reader, reader.uint32()); + break; + } + case 5: { + message.excludeTxnFromChangeStreams = reader.bool(); + break; + } + case 6: { + message.isolationLevel = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TransactionOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.TransactionOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.TransactionOptions} TransactionOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TransactionOptions message. + * @function verify + * @memberof google.spanner.v1.TransactionOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TransactionOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.readWrite != null && message.hasOwnProperty("readWrite")) { + properties.mode = 1; + { + var error = $root.google.spanner.v1.TransactionOptions.ReadWrite.verify(message.readWrite); + if (error) + return "readWrite." + error; + } + } + if (message.partitionedDml != null && message.hasOwnProperty("partitionedDml")) { + if (properties.mode === 1) + return "mode: multiple values"; + properties.mode = 1; + { + var error = $root.google.spanner.v1.TransactionOptions.PartitionedDml.verify(message.partitionedDml); + if (error) + return "partitionedDml." + error; + } + } + if (message.readOnly != null && message.hasOwnProperty("readOnly")) { + if (properties.mode === 1) + return "mode: multiple values"; + properties.mode = 1; + { + var error = $root.google.spanner.v1.TransactionOptions.ReadOnly.verify(message.readOnly); + if (error) + return "readOnly." + error; + } + } + if (message.excludeTxnFromChangeStreams != null && message.hasOwnProperty("excludeTxnFromChangeStreams")) + if (typeof message.excludeTxnFromChangeStreams !== "boolean") + return "excludeTxnFromChangeStreams: boolean expected"; + if (message.isolationLevel != null && message.hasOwnProperty("isolationLevel")) + switch (message.isolationLevel) { + default: + return "isolationLevel: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a TransactionOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.TransactionOptions + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.TransactionOptions} TransactionOptions + */ + TransactionOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.TransactionOptions) + return object; + var message = new $root.google.spanner.v1.TransactionOptions(); + if (object.readWrite != null) { + if (typeof object.readWrite !== "object") + throw TypeError(".google.spanner.v1.TransactionOptions.readWrite: object expected"); + message.readWrite = $root.google.spanner.v1.TransactionOptions.ReadWrite.fromObject(object.readWrite); + } + if (object.partitionedDml != null) { + if (typeof object.partitionedDml !== "object") + throw TypeError(".google.spanner.v1.TransactionOptions.partitionedDml: object expected"); + message.partitionedDml = $root.google.spanner.v1.TransactionOptions.PartitionedDml.fromObject(object.partitionedDml); + } + if (object.readOnly != null) { + if (typeof object.readOnly !== "object") + throw TypeError(".google.spanner.v1.TransactionOptions.readOnly: object expected"); + message.readOnly = $root.google.spanner.v1.TransactionOptions.ReadOnly.fromObject(object.readOnly); + } + if (object.excludeTxnFromChangeStreams != null) + message.excludeTxnFromChangeStreams = Boolean(object.excludeTxnFromChangeStreams); + switch (object.isolationLevel) { + default: + if (typeof object.isolationLevel === "number") { + message.isolationLevel = object.isolationLevel; + break; + } + break; + case "ISOLATION_LEVEL_UNSPECIFIED": + case 0: + message.isolationLevel = 0; + break; + case "SERIALIZABLE": + case 1: + message.isolationLevel = 1; + break; + case "REPEATABLE_READ": + case 2: + message.isolationLevel = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a TransactionOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.TransactionOptions + * @static + * @param {google.spanner.v1.TransactionOptions} message TransactionOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TransactionOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.excludeTxnFromChangeStreams = false; + object.isolationLevel = options.enums === String ? "ISOLATION_LEVEL_UNSPECIFIED" : 0; + } + if (message.readWrite != null && message.hasOwnProperty("readWrite")) { + object.readWrite = $root.google.spanner.v1.TransactionOptions.ReadWrite.toObject(message.readWrite, options); + if (options.oneofs) + object.mode = "readWrite"; + } + if (message.readOnly != null && message.hasOwnProperty("readOnly")) { + object.readOnly = $root.google.spanner.v1.TransactionOptions.ReadOnly.toObject(message.readOnly, options); + if (options.oneofs) + object.mode = "readOnly"; + } + if (message.partitionedDml != null && message.hasOwnProperty("partitionedDml")) { + object.partitionedDml = $root.google.spanner.v1.TransactionOptions.PartitionedDml.toObject(message.partitionedDml, options); + if (options.oneofs) + object.mode = "partitionedDml"; + } + if (message.excludeTxnFromChangeStreams != null && message.hasOwnProperty("excludeTxnFromChangeStreams")) + object.excludeTxnFromChangeStreams = message.excludeTxnFromChangeStreams; + if (message.isolationLevel != null && message.hasOwnProperty("isolationLevel")) + object.isolationLevel = options.enums === String ? $root.google.spanner.v1.TransactionOptions.IsolationLevel[message.isolationLevel] === undefined ? message.isolationLevel : $root.google.spanner.v1.TransactionOptions.IsolationLevel[message.isolationLevel] : message.isolationLevel; + return object; + }; + + /** + * Converts this TransactionOptions to JSON. + * @function toJSON + * @memberof google.spanner.v1.TransactionOptions + * @instance + * @returns {Object.} JSON object + */ + TransactionOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TransactionOptions + * @function getTypeUrl + * @memberof google.spanner.v1.TransactionOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.TransactionOptions"; + }; + + TransactionOptions.ReadWrite = (function() { + + /** + * Properties of a ReadWrite. + * @memberof google.spanner.v1.TransactionOptions + * @interface IReadWrite + * @property {google.spanner.v1.TransactionOptions.ReadWrite.ReadLockMode|null} [readLockMode] ReadWrite readLockMode + * @property {Uint8Array|null} [multiplexedSessionPreviousTransactionId] ReadWrite multiplexedSessionPreviousTransactionId + */ + + /** + * Constructs a new ReadWrite. + * @memberof google.spanner.v1.TransactionOptions + * @classdesc Represents a ReadWrite. + * @implements IReadWrite + * @constructor + * @param {google.spanner.v1.TransactionOptions.IReadWrite=} [properties] Properties to set + */ + function ReadWrite(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReadWrite readLockMode. + * @member {google.spanner.v1.TransactionOptions.ReadWrite.ReadLockMode} readLockMode + * @memberof google.spanner.v1.TransactionOptions.ReadWrite + * @instance + */ + ReadWrite.prototype.readLockMode = 0; + + /** + * ReadWrite multiplexedSessionPreviousTransactionId. + * @member {Uint8Array} multiplexedSessionPreviousTransactionId + * @memberof google.spanner.v1.TransactionOptions.ReadWrite + * @instance + */ + ReadWrite.prototype.multiplexedSessionPreviousTransactionId = $util.newBuffer([]); + + /** + * Creates a new ReadWrite instance using the specified properties. + * @function create + * @memberof google.spanner.v1.TransactionOptions.ReadWrite + * @static + * @param {google.spanner.v1.TransactionOptions.IReadWrite=} [properties] Properties to set + * @returns {google.spanner.v1.TransactionOptions.ReadWrite} ReadWrite instance + */ + ReadWrite.create = function create(properties) { + return new ReadWrite(properties); + }; + + /** + * Encodes the specified ReadWrite message. Does not implicitly {@link google.spanner.v1.TransactionOptions.ReadWrite.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.TransactionOptions.ReadWrite + * @static + * @param {google.spanner.v1.TransactionOptions.IReadWrite} message ReadWrite message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadWrite.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.readLockMode != null && Object.hasOwnProperty.call(message, "readLockMode")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.readLockMode); + if (message.multiplexedSessionPreviousTransactionId != null && Object.hasOwnProperty.call(message, "multiplexedSessionPreviousTransactionId")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.multiplexedSessionPreviousTransactionId); + return writer; + }; + + /** + * Encodes the specified ReadWrite message, length delimited. Does not implicitly {@link google.spanner.v1.TransactionOptions.ReadWrite.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.TransactionOptions.ReadWrite + * @static + * @param {google.spanner.v1.TransactionOptions.IReadWrite} message ReadWrite message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadWrite.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReadWrite message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.TransactionOptions.ReadWrite + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.TransactionOptions.ReadWrite} ReadWrite + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadWrite.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.TransactionOptions.ReadWrite(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.readLockMode = reader.int32(); + break; + } + case 2: { + message.multiplexedSessionPreviousTransactionId = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReadWrite message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.TransactionOptions.ReadWrite + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.TransactionOptions.ReadWrite} ReadWrite + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadWrite.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReadWrite message. + * @function verify + * @memberof google.spanner.v1.TransactionOptions.ReadWrite + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReadWrite.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.readLockMode != null && message.hasOwnProperty("readLockMode")) + switch (message.readLockMode) { + default: + return "readLockMode: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.multiplexedSessionPreviousTransactionId != null && message.hasOwnProperty("multiplexedSessionPreviousTransactionId")) + if (!(message.multiplexedSessionPreviousTransactionId && typeof message.multiplexedSessionPreviousTransactionId.length === "number" || $util.isString(message.multiplexedSessionPreviousTransactionId))) + return "multiplexedSessionPreviousTransactionId: buffer expected"; + return null; + }; + + /** + * Creates a ReadWrite message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.TransactionOptions.ReadWrite + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.TransactionOptions.ReadWrite} ReadWrite + */ + ReadWrite.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.TransactionOptions.ReadWrite) + return object; + var message = new $root.google.spanner.v1.TransactionOptions.ReadWrite(); + switch (object.readLockMode) { + default: + if (typeof object.readLockMode === "number") { + message.readLockMode = object.readLockMode; + break; + } + break; + case "READ_LOCK_MODE_UNSPECIFIED": + case 0: + message.readLockMode = 0; + break; + case "PESSIMISTIC": + case 1: + message.readLockMode = 1; + break; + case "OPTIMISTIC": + case 2: + message.readLockMode = 2; + break; + } + if (object.multiplexedSessionPreviousTransactionId != null) + if (typeof object.multiplexedSessionPreviousTransactionId === "string") + $util.base64.decode(object.multiplexedSessionPreviousTransactionId, message.multiplexedSessionPreviousTransactionId = $util.newBuffer($util.base64.length(object.multiplexedSessionPreviousTransactionId)), 0); + else if (object.multiplexedSessionPreviousTransactionId.length >= 0) + message.multiplexedSessionPreviousTransactionId = object.multiplexedSessionPreviousTransactionId; + return message; + }; + + /** + * Creates a plain object from a ReadWrite message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.TransactionOptions.ReadWrite + * @static + * @param {google.spanner.v1.TransactionOptions.ReadWrite} message ReadWrite + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReadWrite.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.readLockMode = options.enums === String ? "READ_LOCK_MODE_UNSPECIFIED" : 0; + if (options.bytes === String) + object.multiplexedSessionPreviousTransactionId = ""; + else { + object.multiplexedSessionPreviousTransactionId = []; + if (options.bytes !== Array) + object.multiplexedSessionPreviousTransactionId = $util.newBuffer(object.multiplexedSessionPreviousTransactionId); + } + } + if (message.readLockMode != null && message.hasOwnProperty("readLockMode")) + object.readLockMode = options.enums === String ? $root.google.spanner.v1.TransactionOptions.ReadWrite.ReadLockMode[message.readLockMode] === undefined ? message.readLockMode : $root.google.spanner.v1.TransactionOptions.ReadWrite.ReadLockMode[message.readLockMode] : message.readLockMode; + if (message.multiplexedSessionPreviousTransactionId != null && message.hasOwnProperty("multiplexedSessionPreviousTransactionId")) + object.multiplexedSessionPreviousTransactionId = options.bytes === String ? $util.base64.encode(message.multiplexedSessionPreviousTransactionId, 0, message.multiplexedSessionPreviousTransactionId.length) : options.bytes === Array ? Array.prototype.slice.call(message.multiplexedSessionPreviousTransactionId) : message.multiplexedSessionPreviousTransactionId; + return object; + }; + + /** + * Converts this ReadWrite to JSON. + * @function toJSON + * @memberof google.spanner.v1.TransactionOptions.ReadWrite + * @instance + * @returns {Object.} JSON object + */ + ReadWrite.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReadWrite + * @function getTypeUrl + * @memberof google.spanner.v1.TransactionOptions.ReadWrite + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReadWrite.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.TransactionOptions.ReadWrite"; + }; + + /** + * ReadLockMode enum. + * @name google.spanner.v1.TransactionOptions.ReadWrite.ReadLockMode + * @enum {number} + * @property {number} READ_LOCK_MODE_UNSPECIFIED=0 READ_LOCK_MODE_UNSPECIFIED value + * @property {number} PESSIMISTIC=1 PESSIMISTIC value + * @property {number} OPTIMISTIC=2 OPTIMISTIC value + */ + ReadWrite.ReadLockMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "READ_LOCK_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PESSIMISTIC"] = 1; + values[valuesById[2] = "OPTIMISTIC"] = 2; + return values; + })(); + + return ReadWrite; + })(); + + TransactionOptions.PartitionedDml = (function() { + + /** + * Properties of a PartitionedDml. + * @memberof google.spanner.v1.TransactionOptions + * @interface IPartitionedDml + */ + + /** + * Constructs a new PartitionedDml. + * @memberof google.spanner.v1.TransactionOptions + * @classdesc Represents a PartitionedDml. + * @implements IPartitionedDml + * @constructor + * @param {google.spanner.v1.TransactionOptions.IPartitionedDml=} [properties] Properties to set + */ + function PartitionedDml(properties) { + if (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 PartitionedDml instance using the specified properties. + * @function create + * @memberof google.spanner.v1.TransactionOptions.PartitionedDml + * @static + * @param {google.spanner.v1.TransactionOptions.IPartitionedDml=} [properties] Properties to set + * @returns {google.spanner.v1.TransactionOptions.PartitionedDml} PartitionedDml instance + */ + PartitionedDml.create = function create(properties) { + return new PartitionedDml(properties); + }; + + /** + * Encodes the specified PartitionedDml message. Does not implicitly {@link google.spanner.v1.TransactionOptions.PartitionedDml.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.TransactionOptions.PartitionedDml + * @static + * @param {google.spanner.v1.TransactionOptions.IPartitionedDml} message PartitionedDml message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartitionedDml.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified PartitionedDml message, length delimited. Does not implicitly {@link google.spanner.v1.TransactionOptions.PartitionedDml.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.TransactionOptions.PartitionedDml + * @static + * @param {google.spanner.v1.TransactionOptions.IPartitionedDml} message PartitionedDml message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartitionedDml.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PartitionedDml message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.TransactionOptions.PartitionedDml + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.TransactionOptions.PartitionedDml} PartitionedDml + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartitionedDml.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.TransactionOptions.PartitionedDml(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PartitionedDml message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.TransactionOptions.PartitionedDml + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.TransactionOptions.PartitionedDml} PartitionedDml + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartitionedDml.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PartitionedDml message. + * @function verify + * @memberof google.spanner.v1.TransactionOptions.PartitionedDml + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PartitionedDml.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a PartitionedDml message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.TransactionOptions.PartitionedDml + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.TransactionOptions.PartitionedDml} PartitionedDml + */ + PartitionedDml.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.TransactionOptions.PartitionedDml) + return object; + return new $root.google.spanner.v1.TransactionOptions.PartitionedDml(); + }; + + /** + * Creates a plain object from a PartitionedDml message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.TransactionOptions.PartitionedDml + * @static + * @param {google.spanner.v1.TransactionOptions.PartitionedDml} message PartitionedDml + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PartitionedDml.toObject = function toObject() { + return {}; + }; + + /** + * Converts this PartitionedDml to JSON. + * @function toJSON + * @memberof google.spanner.v1.TransactionOptions.PartitionedDml + * @instance + * @returns {Object.} JSON object + */ + PartitionedDml.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PartitionedDml + * @function getTypeUrl + * @memberof google.spanner.v1.TransactionOptions.PartitionedDml + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PartitionedDml.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.TransactionOptions.PartitionedDml"; + }; + + return PartitionedDml; + })(); + + TransactionOptions.ReadOnly = (function() { + + /** + * Properties of a ReadOnly. + * @memberof google.spanner.v1.TransactionOptions + * @interface IReadOnly + * @property {boolean|null} [strong] ReadOnly strong + * @property {google.protobuf.ITimestamp|null} [minReadTimestamp] ReadOnly minReadTimestamp + * @property {google.protobuf.IDuration|null} [maxStaleness] ReadOnly maxStaleness + * @property {google.protobuf.ITimestamp|null} [readTimestamp] ReadOnly readTimestamp + * @property {google.protobuf.IDuration|null} [exactStaleness] ReadOnly exactStaleness + * @property {boolean|null} [returnReadTimestamp] ReadOnly returnReadTimestamp + */ + + /** + * Constructs a new ReadOnly. + * @memberof google.spanner.v1.TransactionOptions + * @classdesc Represents a ReadOnly. + * @implements IReadOnly + * @constructor + * @param {google.spanner.v1.TransactionOptions.IReadOnly=} [properties] Properties to set + */ + function ReadOnly(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReadOnly strong. + * @member {boolean|null|undefined} strong + * @memberof google.spanner.v1.TransactionOptions.ReadOnly + * @instance + */ + ReadOnly.prototype.strong = null; + + /** + * ReadOnly minReadTimestamp. + * @member {google.protobuf.ITimestamp|null|undefined} minReadTimestamp + * @memberof google.spanner.v1.TransactionOptions.ReadOnly + * @instance + */ + ReadOnly.prototype.minReadTimestamp = null; + + /** + * ReadOnly maxStaleness. + * @member {google.protobuf.IDuration|null|undefined} maxStaleness + * @memberof google.spanner.v1.TransactionOptions.ReadOnly + * @instance + */ + ReadOnly.prototype.maxStaleness = null; + + /** + * ReadOnly readTimestamp. + * @member {google.protobuf.ITimestamp|null|undefined} readTimestamp + * @memberof google.spanner.v1.TransactionOptions.ReadOnly + * @instance + */ + ReadOnly.prototype.readTimestamp = null; + + /** + * ReadOnly exactStaleness. + * @member {google.protobuf.IDuration|null|undefined} exactStaleness + * @memberof google.spanner.v1.TransactionOptions.ReadOnly + * @instance + */ + ReadOnly.prototype.exactStaleness = null; + + /** + * ReadOnly returnReadTimestamp. + * @member {boolean} returnReadTimestamp + * @memberof google.spanner.v1.TransactionOptions.ReadOnly + * @instance + */ + ReadOnly.prototype.returnReadTimestamp = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ReadOnly timestampBound. + * @member {"strong"|"minReadTimestamp"|"maxStaleness"|"readTimestamp"|"exactStaleness"|undefined} timestampBound + * @memberof google.spanner.v1.TransactionOptions.ReadOnly + * @instance + */ + Object.defineProperty(ReadOnly.prototype, "timestampBound", { + get: $util.oneOfGetter($oneOfFields = ["strong", "minReadTimestamp", "maxStaleness", "readTimestamp", "exactStaleness"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ReadOnly instance using the specified properties. + * @function create + * @memberof google.spanner.v1.TransactionOptions.ReadOnly + * @static + * @param {google.spanner.v1.TransactionOptions.IReadOnly=} [properties] Properties to set + * @returns {google.spanner.v1.TransactionOptions.ReadOnly} ReadOnly instance + */ + ReadOnly.create = function create(properties) { + return new ReadOnly(properties); + }; + + /** + * Encodes the specified ReadOnly message. Does not implicitly {@link google.spanner.v1.TransactionOptions.ReadOnly.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.TransactionOptions.ReadOnly + * @static + * @param {google.spanner.v1.TransactionOptions.IReadOnly} message ReadOnly message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadOnly.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.strong != null && Object.hasOwnProperty.call(message, "strong")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.strong); + if (message.minReadTimestamp != null && Object.hasOwnProperty.call(message, "minReadTimestamp")) + $root.google.protobuf.Timestamp.encode(message.minReadTimestamp, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.maxStaleness != null && Object.hasOwnProperty.call(message, "maxStaleness")) + $root.google.protobuf.Duration.encode(message.maxStaleness, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.readTimestamp != null && Object.hasOwnProperty.call(message, "readTimestamp")) + $root.google.protobuf.Timestamp.encode(message.readTimestamp, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.exactStaleness != null && Object.hasOwnProperty.call(message, "exactStaleness")) + $root.google.protobuf.Duration.encode(message.exactStaleness, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.returnReadTimestamp != null && Object.hasOwnProperty.call(message, "returnReadTimestamp")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.returnReadTimestamp); + return writer; + }; + + /** + * Encodes the specified ReadOnly message, length delimited. Does not implicitly {@link google.spanner.v1.TransactionOptions.ReadOnly.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.TransactionOptions.ReadOnly + * @static + * @param {google.spanner.v1.TransactionOptions.IReadOnly} message ReadOnly message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadOnly.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReadOnly message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.TransactionOptions.ReadOnly + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.TransactionOptions.ReadOnly} ReadOnly + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadOnly.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.TransactionOptions.ReadOnly(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.strong = reader.bool(); + break; + } + case 2: { + message.minReadTimestamp = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.maxStaleness = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 4: { + message.readTimestamp = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.exactStaleness = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 6: { + message.returnReadTimestamp = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReadOnly message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.TransactionOptions.ReadOnly + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.TransactionOptions.ReadOnly} ReadOnly + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadOnly.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReadOnly message. + * @function verify + * @memberof google.spanner.v1.TransactionOptions.ReadOnly + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReadOnly.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.strong != null && message.hasOwnProperty("strong")) { + properties.timestampBound = 1; + if (typeof message.strong !== "boolean") + return "strong: boolean expected"; + } + if (message.minReadTimestamp != null && message.hasOwnProperty("minReadTimestamp")) { + if (properties.timestampBound === 1) + return "timestampBound: multiple values"; + properties.timestampBound = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.minReadTimestamp); + if (error) + return "minReadTimestamp." + error; + } + } + if (message.maxStaleness != null && message.hasOwnProperty("maxStaleness")) { + if (properties.timestampBound === 1) + return "timestampBound: multiple values"; + properties.timestampBound = 1; + { + var error = $root.google.protobuf.Duration.verify(message.maxStaleness); + if (error) + return "maxStaleness." + error; + } + } + if (message.readTimestamp != null && message.hasOwnProperty("readTimestamp")) { + if (properties.timestampBound === 1) + return "timestampBound: multiple values"; + properties.timestampBound = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.readTimestamp); + if (error) + return "readTimestamp." + error; + } + } + if (message.exactStaleness != null && message.hasOwnProperty("exactStaleness")) { + if (properties.timestampBound === 1) + return "timestampBound: multiple values"; + properties.timestampBound = 1; + { + var error = $root.google.protobuf.Duration.verify(message.exactStaleness); + if (error) + return "exactStaleness." + error; + } + } + if (message.returnReadTimestamp != null && message.hasOwnProperty("returnReadTimestamp")) + if (typeof message.returnReadTimestamp !== "boolean") + return "returnReadTimestamp: boolean expected"; + return null; + }; + + /** + * Creates a ReadOnly message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.TransactionOptions.ReadOnly + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.TransactionOptions.ReadOnly} ReadOnly + */ + ReadOnly.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.TransactionOptions.ReadOnly) + return object; + var message = new $root.google.spanner.v1.TransactionOptions.ReadOnly(); + if (object.strong != null) + message.strong = Boolean(object.strong); + if (object.minReadTimestamp != null) { + if (typeof object.minReadTimestamp !== "object") + throw TypeError(".google.spanner.v1.TransactionOptions.ReadOnly.minReadTimestamp: object expected"); + message.minReadTimestamp = $root.google.protobuf.Timestamp.fromObject(object.minReadTimestamp); + } + if (object.maxStaleness != null) { + if (typeof object.maxStaleness !== "object") + throw TypeError(".google.spanner.v1.TransactionOptions.ReadOnly.maxStaleness: object expected"); + message.maxStaleness = $root.google.protobuf.Duration.fromObject(object.maxStaleness); + } + if (object.readTimestamp != null) { + if (typeof object.readTimestamp !== "object") + throw TypeError(".google.spanner.v1.TransactionOptions.ReadOnly.readTimestamp: object expected"); + message.readTimestamp = $root.google.protobuf.Timestamp.fromObject(object.readTimestamp); + } + if (object.exactStaleness != null) { + if (typeof object.exactStaleness !== "object") + throw TypeError(".google.spanner.v1.TransactionOptions.ReadOnly.exactStaleness: object expected"); + message.exactStaleness = $root.google.protobuf.Duration.fromObject(object.exactStaleness); + } + if (object.returnReadTimestamp != null) + message.returnReadTimestamp = Boolean(object.returnReadTimestamp); + return message; + }; + + /** + * Creates a plain object from a ReadOnly message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.TransactionOptions.ReadOnly + * @static + * @param {google.spanner.v1.TransactionOptions.ReadOnly} message ReadOnly + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReadOnly.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.returnReadTimestamp = false; + if (message.strong != null && message.hasOwnProperty("strong")) { + object.strong = message.strong; + if (options.oneofs) + object.timestampBound = "strong"; + } + if (message.minReadTimestamp != null && message.hasOwnProperty("minReadTimestamp")) { + object.minReadTimestamp = $root.google.protobuf.Timestamp.toObject(message.minReadTimestamp, options); + if (options.oneofs) + object.timestampBound = "minReadTimestamp"; + } + if (message.maxStaleness != null && message.hasOwnProperty("maxStaleness")) { + object.maxStaleness = $root.google.protobuf.Duration.toObject(message.maxStaleness, options); + if (options.oneofs) + object.timestampBound = "maxStaleness"; + } + if (message.readTimestamp != null && message.hasOwnProperty("readTimestamp")) { + object.readTimestamp = $root.google.protobuf.Timestamp.toObject(message.readTimestamp, options); + if (options.oneofs) + object.timestampBound = "readTimestamp"; + } + if (message.exactStaleness != null && message.hasOwnProperty("exactStaleness")) { + object.exactStaleness = $root.google.protobuf.Duration.toObject(message.exactStaleness, options); + if (options.oneofs) + object.timestampBound = "exactStaleness"; + } + if (message.returnReadTimestamp != null && message.hasOwnProperty("returnReadTimestamp")) + object.returnReadTimestamp = message.returnReadTimestamp; + return object; + }; + + /** + * Converts this ReadOnly to JSON. + * @function toJSON + * @memberof google.spanner.v1.TransactionOptions.ReadOnly + * @instance + * @returns {Object.} JSON object + */ + ReadOnly.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReadOnly + * @function getTypeUrl + * @memberof google.spanner.v1.TransactionOptions.ReadOnly + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReadOnly.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.TransactionOptions.ReadOnly"; + }; + + return ReadOnly; + })(); + + /** + * IsolationLevel enum. + * @name google.spanner.v1.TransactionOptions.IsolationLevel + * @enum {number} + * @property {number} ISOLATION_LEVEL_UNSPECIFIED=0 ISOLATION_LEVEL_UNSPECIFIED value + * @property {number} SERIALIZABLE=1 SERIALIZABLE value + * @property {number} REPEATABLE_READ=2 REPEATABLE_READ value + */ + TransactionOptions.IsolationLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ISOLATION_LEVEL_UNSPECIFIED"] = 0; + values[valuesById[1] = "SERIALIZABLE"] = 1; + values[valuesById[2] = "REPEATABLE_READ"] = 2; + return values; + })(); + + return TransactionOptions; + })(); + + v1.Transaction = (function() { + + /** + * Properties of a Transaction. + * @memberof google.spanner.v1 + * @interface ITransaction + * @property {Uint8Array|null} [id] Transaction id + * @property {google.protobuf.ITimestamp|null} [readTimestamp] Transaction readTimestamp + * @property {google.spanner.v1.IMultiplexedSessionPrecommitToken|null} [precommitToken] Transaction precommitToken + */ + + /** + * Constructs a new Transaction. + * @memberof google.spanner.v1 + * @classdesc Represents a Transaction. + * @implements ITransaction + * @constructor + * @param {google.spanner.v1.ITransaction=} [properties] Properties to set + */ + function Transaction(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Transaction id. + * @member {Uint8Array} id + * @memberof google.spanner.v1.Transaction + * @instance + */ + Transaction.prototype.id = $util.newBuffer([]); + + /** + * Transaction readTimestamp. + * @member {google.protobuf.ITimestamp|null|undefined} readTimestamp + * @memberof google.spanner.v1.Transaction + * @instance + */ + Transaction.prototype.readTimestamp = null; + + /** + * Transaction precommitToken. + * @member {google.spanner.v1.IMultiplexedSessionPrecommitToken|null|undefined} precommitToken + * @memberof google.spanner.v1.Transaction + * @instance + */ + Transaction.prototype.precommitToken = null; + + /** + * Creates a new Transaction instance using the specified properties. + * @function create + * @memberof google.spanner.v1.Transaction + * @static + * @param {google.spanner.v1.ITransaction=} [properties] Properties to set + * @returns {google.spanner.v1.Transaction} Transaction instance + */ + Transaction.create = function create(properties) { + return new Transaction(properties); + }; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link google.spanner.v1.Transaction.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.Transaction + * @static + * @param {google.spanner.v1.ITransaction} message Transaction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Transaction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.id); + if (message.readTimestamp != null && Object.hasOwnProperty.call(message, "readTimestamp")) + $root.google.protobuf.Timestamp.encode(message.readTimestamp, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.precommitToken != null && Object.hasOwnProperty.call(message, "precommitToken")) + $root.google.spanner.v1.MultiplexedSessionPrecommitToken.encode(message.precommitToken, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Transaction message, length delimited. Does not implicitly {@link google.spanner.v1.Transaction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.Transaction + * @static + * @param {google.spanner.v1.ITransaction} message Transaction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Transaction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.Transaction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.Transaction} Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Transaction.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.Transaction(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.id = reader.bytes(); + break; + } + case 2: { + message.readTimestamp = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.precommitToken = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Transaction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.Transaction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.Transaction} Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Transaction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Transaction message. + * @function verify + * @memberof google.spanner.v1.Transaction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Transaction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!(message.id && typeof message.id.length === "number" || $util.isString(message.id))) + return "id: buffer expected"; + if (message.readTimestamp != null && message.hasOwnProperty("readTimestamp")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTimestamp); + if (error) + return "readTimestamp." + error; + } + if (message.precommitToken != null && message.hasOwnProperty("precommitToken")) { + var error = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.verify(message.precommitToken); + if (error) + return "precommitToken." + error; + } + return null; + }; + + /** + * Creates a Transaction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.Transaction + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.Transaction} Transaction + */ + Transaction.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.Transaction) + return object; + var message = new $root.google.spanner.v1.Transaction(); + if (object.id != null) + if (typeof object.id === "string") + $util.base64.decode(object.id, message.id = $util.newBuffer($util.base64.length(object.id)), 0); + else if (object.id.length >= 0) + message.id = object.id; + if (object.readTimestamp != null) { + if (typeof object.readTimestamp !== "object") + throw TypeError(".google.spanner.v1.Transaction.readTimestamp: object expected"); + message.readTimestamp = $root.google.protobuf.Timestamp.fromObject(object.readTimestamp); + } + if (object.precommitToken != null) { + if (typeof object.precommitToken !== "object") + throw TypeError(".google.spanner.v1.Transaction.precommitToken: object expected"); + message.precommitToken = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.fromObject(object.precommitToken); + } + return message; + }; + + /** + * Creates a plain object from a Transaction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.Transaction + * @static + * @param {google.spanner.v1.Transaction} message Transaction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Transaction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.id = ""; + else { + object.id = []; + if (options.bytes !== Array) + object.id = $util.newBuffer(object.id); + } + object.readTimestamp = null; + object.precommitToken = null; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = options.bytes === String ? $util.base64.encode(message.id, 0, message.id.length) : options.bytes === Array ? Array.prototype.slice.call(message.id) : message.id; + if (message.readTimestamp != null && message.hasOwnProperty("readTimestamp")) + object.readTimestamp = $root.google.protobuf.Timestamp.toObject(message.readTimestamp, options); + if (message.precommitToken != null && message.hasOwnProperty("precommitToken")) + object.precommitToken = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.toObject(message.precommitToken, options); + return object; + }; + + /** + * Converts this Transaction to JSON. + * @function toJSON + * @memberof google.spanner.v1.Transaction + * @instance + * @returns {Object.} JSON object + */ + Transaction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Transaction + * @function getTypeUrl + * @memberof google.spanner.v1.Transaction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Transaction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.Transaction"; + }; + + return Transaction; + })(); + + v1.TransactionSelector = (function() { + + /** + * Properties of a TransactionSelector. + * @memberof google.spanner.v1 + * @interface ITransactionSelector + * @property {google.spanner.v1.ITransactionOptions|null} [singleUse] TransactionSelector singleUse + * @property {Uint8Array|null} [id] TransactionSelector id + * @property {google.spanner.v1.ITransactionOptions|null} [begin] TransactionSelector begin + */ + + /** + * Constructs a new TransactionSelector. + * @memberof google.spanner.v1 + * @classdesc Represents a TransactionSelector. + * @implements ITransactionSelector + * @constructor + * @param {google.spanner.v1.ITransactionSelector=} [properties] Properties to set + */ + function TransactionSelector(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TransactionSelector singleUse. + * @member {google.spanner.v1.ITransactionOptions|null|undefined} singleUse + * @memberof google.spanner.v1.TransactionSelector + * @instance + */ + TransactionSelector.prototype.singleUse = null; + + /** + * TransactionSelector id. + * @member {Uint8Array|null|undefined} id + * @memberof google.spanner.v1.TransactionSelector + * @instance + */ + TransactionSelector.prototype.id = null; + + /** + * TransactionSelector begin. + * @member {google.spanner.v1.ITransactionOptions|null|undefined} begin + * @memberof google.spanner.v1.TransactionSelector + * @instance + */ + TransactionSelector.prototype.begin = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TransactionSelector selector. + * @member {"singleUse"|"id"|"begin"|undefined} selector + * @memberof google.spanner.v1.TransactionSelector + * @instance + */ + Object.defineProperty(TransactionSelector.prototype, "selector", { + get: $util.oneOfGetter($oneOfFields = ["singleUse", "id", "begin"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TransactionSelector instance using the specified properties. + * @function create + * @memberof google.spanner.v1.TransactionSelector + * @static + * @param {google.spanner.v1.ITransactionSelector=} [properties] Properties to set + * @returns {google.spanner.v1.TransactionSelector} TransactionSelector instance + */ + TransactionSelector.create = function create(properties) { + return new TransactionSelector(properties); + }; + + /** + * Encodes the specified TransactionSelector message. Does not implicitly {@link google.spanner.v1.TransactionSelector.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.TransactionSelector + * @static + * @param {google.spanner.v1.ITransactionSelector} message TransactionSelector message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionSelector.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.singleUse != null && Object.hasOwnProperty.call(message, "singleUse")) + $root.google.spanner.v1.TransactionOptions.encode(message.singleUse, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.id); + if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) + $root.google.spanner.v1.TransactionOptions.encode(message.begin, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TransactionSelector message, length delimited. Does not implicitly {@link google.spanner.v1.TransactionSelector.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.TransactionSelector + * @static + * @param {google.spanner.v1.ITransactionSelector} message TransactionSelector message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionSelector.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TransactionSelector message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.TransactionSelector + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.TransactionSelector} TransactionSelector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionSelector.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.TransactionSelector(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.singleUse = $root.google.spanner.v1.TransactionOptions.decode(reader, reader.uint32()); + break; + } + case 2: { + message.id = reader.bytes(); + break; + } + case 3: { + message.begin = $root.google.spanner.v1.TransactionOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TransactionSelector message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.TransactionSelector + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.TransactionSelector} TransactionSelector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionSelector.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TransactionSelector message. + * @function verify + * @memberof google.spanner.v1.TransactionSelector + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TransactionSelector.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.singleUse != null && message.hasOwnProperty("singleUse")) { + properties.selector = 1; + { + var error = $root.google.spanner.v1.TransactionOptions.verify(message.singleUse); + if (error) + return "singleUse." + error; + } + } + if (message.id != null && message.hasOwnProperty("id")) { + if (properties.selector === 1) + return "selector: multiple values"; + properties.selector = 1; + if (!(message.id && typeof message.id.length === "number" || $util.isString(message.id))) + return "id: buffer expected"; + } + if (message.begin != null && message.hasOwnProperty("begin")) { + if (properties.selector === 1) + return "selector: multiple values"; + properties.selector = 1; + { + var error = $root.google.spanner.v1.TransactionOptions.verify(message.begin); + if (error) + return "begin." + error; + } + } + return null; + }; + + /** + * Creates a TransactionSelector message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.TransactionSelector + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.TransactionSelector} TransactionSelector + */ + TransactionSelector.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.TransactionSelector) + return object; + var message = new $root.google.spanner.v1.TransactionSelector(); + if (object.singleUse != null) { + if (typeof object.singleUse !== "object") + throw TypeError(".google.spanner.v1.TransactionSelector.singleUse: object expected"); + message.singleUse = $root.google.spanner.v1.TransactionOptions.fromObject(object.singleUse); + } + if (object.id != null) + if (typeof object.id === "string") + $util.base64.decode(object.id, message.id = $util.newBuffer($util.base64.length(object.id)), 0); + else if (object.id.length >= 0) + message.id = object.id; + if (object.begin != null) { + if (typeof object.begin !== "object") + throw TypeError(".google.spanner.v1.TransactionSelector.begin: object expected"); + message.begin = $root.google.spanner.v1.TransactionOptions.fromObject(object.begin); + } + return message; + }; + + /** + * Creates a plain object from a TransactionSelector message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.TransactionSelector + * @static + * @param {google.spanner.v1.TransactionSelector} message TransactionSelector + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TransactionSelector.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.singleUse != null && message.hasOwnProperty("singleUse")) { + object.singleUse = $root.google.spanner.v1.TransactionOptions.toObject(message.singleUse, options); + if (options.oneofs) + object.selector = "singleUse"; + } + if (message.id != null && message.hasOwnProperty("id")) { + object.id = options.bytes === String ? $util.base64.encode(message.id, 0, message.id.length) : options.bytes === Array ? Array.prototype.slice.call(message.id) : message.id; + if (options.oneofs) + object.selector = "id"; + } + if (message.begin != null && message.hasOwnProperty("begin")) { + object.begin = $root.google.spanner.v1.TransactionOptions.toObject(message.begin, options); + if (options.oneofs) + object.selector = "begin"; + } + return object; + }; + + /** + * Converts this TransactionSelector to JSON. + * @function toJSON + * @memberof google.spanner.v1.TransactionSelector + * @instance + * @returns {Object.} JSON object + */ + TransactionSelector.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TransactionSelector + * @function getTypeUrl + * @memberof google.spanner.v1.TransactionSelector + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionSelector.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.TransactionSelector"; + }; + + return TransactionSelector; + })(); + + v1.MultiplexedSessionPrecommitToken = (function() { + + /** + * Properties of a MultiplexedSessionPrecommitToken. + * @memberof google.spanner.v1 + * @interface IMultiplexedSessionPrecommitToken + * @property {Uint8Array|null} [precommitToken] MultiplexedSessionPrecommitToken precommitToken + * @property {number|null} [seqNum] MultiplexedSessionPrecommitToken seqNum + */ + + /** + * Constructs a new MultiplexedSessionPrecommitToken. + * @memberof google.spanner.v1 + * @classdesc Represents a MultiplexedSessionPrecommitToken. + * @implements IMultiplexedSessionPrecommitToken + * @constructor + * @param {google.spanner.v1.IMultiplexedSessionPrecommitToken=} [properties] Properties to set + */ + function MultiplexedSessionPrecommitToken(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MultiplexedSessionPrecommitToken precommitToken. + * @member {Uint8Array} precommitToken + * @memberof google.spanner.v1.MultiplexedSessionPrecommitToken + * @instance + */ + MultiplexedSessionPrecommitToken.prototype.precommitToken = $util.newBuffer([]); + + /** + * MultiplexedSessionPrecommitToken seqNum. + * @member {number} seqNum + * @memberof google.spanner.v1.MultiplexedSessionPrecommitToken + * @instance + */ + MultiplexedSessionPrecommitToken.prototype.seqNum = 0; + + /** + * Creates a new MultiplexedSessionPrecommitToken instance using the specified properties. + * @function create + * @memberof google.spanner.v1.MultiplexedSessionPrecommitToken + * @static + * @param {google.spanner.v1.IMultiplexedSessionPrecommitToken=} [properties] Properties to set + * @returns {google.spanner.v1.MultiplexedSessionPrecommitToken} MultiplexedSessionPrecommitToken instance + */ + MultiplexedSessionPrecommitToken.create = function create(properties) { + return new MultiplexedSessionPrecommitToken(properties); + }; + + /** + * Encodes the specified MultiplexedSessionPrecommitToken message. Does not implicitly {@link google.spanner.v1.MultiplexedSessionPrecommitToken.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.MultiplexedSessionPrecommitToken + * @static + * @param {google.spanner.v1.IMultiplexedSessionPrecommitToken} message MultiplexedSessionPrecommitToken message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MultiplexedSessionPrecommitToken.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.precommitToken != null && Object.hasOwnProperty.call(message, "precommitToken")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.precommitToken); + if (message.seqNum != null && Object.hasOwnProperty.call(message, "seqNum")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.seqNum); + return writer; + }; + + /** + * Encodes the specified MultiplexedSessionPrecommitToken message, length delimited. Does not implicitly {@link google.spanner.v1.MultiplexedSessionPrecommitToken.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.MultiplexedSessionPrecommitToken + * @static + * @param {google.spanner.v1.IMultiplexedSessionPrecommitToken} message MultiplexedSessionPrecommitToken message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MultiplexedSessionPrecommitToken.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MultiplexedSessionPrecommitToken message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.MultiplexedSessionPrecommitToken + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.MultiplexedSessionPrecommitToken} MultiplexedSessionPrecommitToken + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MultiplexedSessionPrecommitToken.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.MultiplexedSessionPrecommitToken(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.precommitToken = reader.bytes(); + break; + } + case 2: { + message.seqNum = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MultiplexedSessionPrecommitToken message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.MultiplexedSessionPrecommitToken + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.MultiplexedSessionPrecommitToken} MultiplexedSessionPrecommitToken + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MultiplexedSessionPrecommitToken.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MultiplexedSessionPrecommitToken message. + * @function verify + * @memberof google.spanner.v1.MultiplexedSessionPrecommitToken + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MultiplexedSessionPrecommitToken.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.precommitToken != null && message.hasOwnProperty("precommitToken")) + if (!(message.precommitToken && typeof message.precommitToken.length === "number" || $util.isString(message.precommitToken))) + return "precommitToken: buffer expected"; + if (message.seqNum != null && message.hasOwnProperty("seqNum")) + if (!$util.isInteger(message.seqNum)) + return "seqNum: integer expected"; + return null; + }; + + /** + * Creates a MultiplexedSessionPrecommitToken message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.MultiplexedSessionPrecommitToken + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.MultiplexedSessionPrecommitToken} MultiplexedSessionPrecommitToken + */ + MultiplexedSessionPrecommitToken.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.MultiplexedSessionPrecommitToken) + return object; + var message = new $root.google.spanner.v1.MultiplexedSessionPrecommitToken(); + if (object.precommitToken != null) + if (typeof object.precommitToken === "string") + $util.base64.decode(object.precommitToken, message.precommitToken = $util.newBuffer($util.base64.length(object.precommitToken)), 0); + else if (object.precommitToken.length >= 0) + message.precommitToken = object.precommitToken; + if (object.seqNum != null) + message.seqNum = object.seqNum | 0; + return message; + }; + + /** + * Creates a plain object from a MultiplexedSessionPrecommitToken message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.MultiplexedSessionPrecommitToken + * @static + * @param {google.spanner.v1.MultiplexedSessionPrecommitToken} message MultiplexedSessionPrecommitToken + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MultiplexedSessionPrecommitToken.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.precommitToken = ""; + else { + object.precommitToken = []; + if (options.bytes !== Array) + object.precommitToken = $util.newBuffer(object.precommitToken); + } + object.seqNum = 0; + } + if (message.precommitToken != null && message.hasOwnProperty("precommitToken")) + object.precommitToken = options.bytes === String ? $util.base64.encode(message.precommitToken, 0, message.precommitToken.length) : options.bytes === Array ? Array.prototype.slice.call(message.precommitToken) : message.precommitToken; + if (message.seqNum != null && message.hasOwnProperty("seqNum")) + object.seqNum = message.seqNum; + return object; + }; + + /** + * Converts this MultiplexedSessionPrecommitToken to JSON. + * @function toJSON + * @memberof google.spanner.v1.MultiplexedSessionPrecommitToken + * @instance + * @returns {Object.} JSON object + */ + MultiplexedSessionPrecommitToken.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MultiplexedSessionPrecommitToken + * @function getTypeUrl + * @memberof google.spanner.v1.MultiplexedSessionPrecommitToken + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MultiplexedSessionPrecommitToken.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.MultiplexedSessionPrecommitToken"; + }; + + return MultiplexedSessionPrecommitToken; + })(); + + v1.KeyRange = (function() { + + /** + * Properties of a KeyRange. + * @memberof google.spanner.v1 + * @interface IKeyRange + * @property {google.protobuf.IListValue|null} [startClosed] KeyRange startClosed + * @property {google.protobuf.IListValue|null} [startOpen] KeyRange startOpen + * @property {google.protobuf.IListValue|null} [endClosed] KeyRange endClosed + * @property {google.protobuf.IListValue|null} [endOpen] KeyRange endOpen + */ + + /** + * Constructs a new KeyRange. + * @memberof google.spanner.v1 + * @classdesc Represents a KeyRange. + * @implements IKeyRange + * @constructor + * @param {google.spanner.v1.IKeyRange=} [properties] Properties to set + */ + function KeyRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * KeyRange startClosed. + * @member {google.protobuf.IListValue|null|undefined} startClosed + * @memberof google.spanner.v1.KeyRange + * @instance + */ + KeyRange.prototype.startClosed = null; + + /** + * KeyRange startOpen. + * @member {google.protobuf.IListValue|null|undefined} startOpen + * @memberof google.spanner.v1.KeyRange + * @instance + */ + KeyRange.prototype.startOpen = null; + + /** + * KeyRange endClosed. + * @member {google.protobuf.IListValue|null|undefined} endClosed + * @memberof google.spanner.v1.KeyRange + * @instance + */ + KeyRange.prototype.endClosed = null; + + /** + * KeyRange endOpen. + * @member {google.protobuf.IListValue|null|undefined} endOpen + * @memberof google.spanner.v1.KeyRange + * @instance + */ + KeyRange.prototype.endOpen = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * KeyRange startKeyType. + * @member {"startClosed"|"startOpen"|undefined} startKeyType + * @memberof google.spanner.v1.KeyRange + * @instance + */ + Object.defineProperty(KeyRange.prototype, "startKeyType", { + get: $util.oneOfGetter($oneOfFields = ["startClosed", "startOpen"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * KeyRange endKeyType. + * @member {"endClosed"|"endOpen"|undefined} endKeyType + * @memberof google.spanner.v1.KeyRange + * @instance + */ + Object.defineProperty(KeyRange.prototype, "endKeyType", { + get: $util.oneOfGetter($oneOfFields = ["endClosed", "endOpen"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new KeyRange instance using the specified properties. + * @function create + * @memberof google.spanner.v1.KeyRange + * @static + * @param {google.spanner.v1.IKeyRange=} [properties] Properties to set + * @returns {google.spanner.v1.KeyRange} KeyRange instance + */ + KeyRange.create = function create(properties) { + return new KeyRange(properties); + }; + + /** + * Encodes the specified KeyRange message. Does not implicitly {@link google.spanner.v1.KeyRange.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.KeyRange + * @static + * @param {google.spanner.v1.IKeyRange} message KeyRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startClosed != null && Object.hasOwnProperty.call(message, "startClosed")) + $root.google.protobuf.ListValue.encode(message.startClosed, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.startOpen != null && Object.hasOwnProperty.call(message, "startOpen")) + $root.google.protobuf.ListValue.encode(message.startOpen, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.endClosed != null && Object.hasOwnProperty.call(message, "endClosed")) + $root.google.protobuf.ListValue.encode(message.endClosed, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.endOpen != null && Object.hasOwnProperty.call(message, "endOpen")) + $root.google.protobuf.ListValue.encode(message.endOpen, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified KeyRange message, length delimited. Does not implicitly {@link google.spanner.v1.KeyRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.KeyRange + * @static + * @param {google.spanner.v1.IKeyRange} message KeyRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a KeyRange message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.KeyRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.KeyRange} KeyRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyRange.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.KeyRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.startClosed = $root.google.protobuf.ListValue.decode(reader, reader.uint32()); + break; + } + case 2: { + message.startOpen = $root.google.protobuf.ListValue.decode(reader, reader.uint32()); + break; + } + case 3: { + message.endClosed = $root.google.protobuf.ListValue.decode(reader, reader.uint32()); + break; + } + case 4: { + message.endOpen = $root.google.protobuf.ListValue.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a KeyRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.KeyRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.KeyRange} KeyRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a KeyRange message. + * @function verify + * @memberof google.spanner.v1.KeyRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + KeyRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.startClosed != null && message.hasOwnProperty("startClosed")) { + properties.startKeyType = 1; + { + var error = $root.google.protobuf.ListValue.verify(message.startClosed); + if (error) + return "startClosed." + error; + } + } + if (message.startOpen != null && message.hasOwnProperty("startOpen")) { + if (properties.startKeyType === 1) + return "startKeyType: multiple values"; + properties.startKeyType = 1; + { + var error = $root.google.protobuf.ListValue.verify(message.startOpen); + if (error) + return "startOpen." + error; + } + } + if (message.endClosed != null && message.hasOwnProperty("endClosed")) { + properties.endKeyType = 1; + { + var error = $root.google.protobuf.ListValue.verify(message.endClosed); + if (error) + return "endClosed." + error; + } + } + if (message.endOpen != null && message.hasOwnProperty("endOpen")) { + if (properties.endKeyType === 1) + return "endKeyType: multiple values"; + properties.endKeyType = 1; + { + var error = $root.google.protobuf.ListValue.verify(message.endOpen); + if (error) + return "endOpen." + error; + } + } + return null; + }; + + /** + * Creates a KeyRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.KeyRange + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.KeyRange} KeyRange + */ + KeyRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.KeyRange) + return object; + var message = new $root.google.spanner.v1.KeyRange(); + if (object.startClosed != null) { + if (typeof object.startClosed !== "object") + throw TypeError(".google.spanner.v1.KeyRange.startClosed: object expected"); + message.startClosed = $root.google.protobuf.ListValue.fromObject(object.startClosed); + } + if (object.startOpen != null) { + if (typeof object.startOpen !== "object") + throw TypeError(".google.spanner.v1.KeyRange.startOpen: object expected"); + message.startOpen = $root.google.protobuf.ListValue.fromObject(object.startOpen); + } + if (object.endClosed != null) { + if (typeof object.endClosed !== "object") + throw TypeError(".google.spanner.v1.KeyRange.endClosed: object expected"); + message.endClosed = $root.google.protobuf.ListValue.fromObject(object.endClosed); + } + if (object.endOpen != null) { + if (typeof object.endOpen !== "object") + throw TypeError(".google.spanner.v1.KeyRange.endOpen: object expected"); + message.endOpen = $root.google.protobuf.ListValue.fromObject(object.endOpen); + } + return message; + }; + + /** + * Creates a plain object from a KeyRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.KeyRange + * @static + * @param {google.spanner.v1.KeyRange} message KeyRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + KeyRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.startClosed != null && message.hasOwnProperty("startClosed")) { + object.startClosed = $root.google.protobuf.ListValue.toObject(message.startClosed, options); + if (options.oneofs) + object.startKeyType = "startClosed"; + } + if (message.startOpen != null && message.hasOwnProperty("startOpen")) { + object.startOpen = $root.google.protobuf.ListValue.toObject(message.startOpen, options); + if (options.oneofs) + object.startKeyType = "startOpen"; + } + if (message.endClosed != null && message.hasOwnProperty("endClosed")) { + object.endClosed = $root.google.protobuf.ListValue.toObject(message.endClosed, options); + if (options.oneofs) + object.endKeyType = "endClosed"; + } + if (message.endOpen != null && message.hasOwnProperty("endOpen")) { + object.endOpen = $root.google.protobuf.ListValue.toObject(message.endOpen, options); + if (options.oneofs) + object.endKeyType = "endOpen"; + } + return object; + }; + + /** + * Converts this KeyRange to JSON. + * @function toJSON + * @memberof google.spanner.v1.KeyRange + * @instance + * @returns {Object.} JSON object + */ + KeyRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for KeyRange + * @function getTypeUrl + * @memberof google.spanner.v1.KeyRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + KeyRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.KeyRange"; + }; + + return KeyRange; + })(); + + v1.KeySet = (function() { + + /** + * Properties of a KeySet. + * @memberof google.spanner.v1 + * @interface IKeySet + * @property {Array.|null} [keys] KeySet keys + * @property {Array.|null} [ranges] KeySet ranges + * @property {boolean|null} [all] KeySet all + */ + + /** + * Constructs a new KeySet. + * @memberof google.spanner.v1 + * @classdesc Represents a KeySet. + * @implements IKeySet + * @constructor + * @param {google.spanner.v1.IKeySet=} [properties] Properties to set + */ + function KeySet(properties) { + this.keys = []; + this.ranges = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * KeySet keys. + * @member {Array.} keys + * @memberof google.spanner.v1.KeySet + * @instance + */ + KeySet.prototype.keys = $util.emptyArray; + + /** + * KeySet ranges. + * @member {Array.} ranges + * @memberof google.spanner.v1.KeySet + * @instance + */ + KeySet.prototype.ranges = $util.emptyArray; + + /** + * KeySet all. + * @member {boolean} all + * @memberof google.spanner.v1.KeySet + * @instance + */ + KeySet.prototype.all = false; + + /** + * Creates a new KeySet instance using the specified properties. + * @function create + * @memberof google.spanner.v1.KeySet + * @static + * @param {google.spanner.v1.IKeySet=} [properties] Properties to set + * @returns {google.spanner.v1.KeySet} KeySet instance + */ + KeySet.create = function create(properties) { + return new KeySet(properties); + }; + + /** + * Encodes the specified KeySet message. Does not implicitly {@link google.spanner.v1.KeySet.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.KeySet + * @static + * @param {google.spanner.v1.IKeySet} message KeySet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeySet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.keys != null && message.keys.length) + for (var i = 0; i < message.keys.length; ++i) + $root.google.protobuf.ListValue.encode(message.keys[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.ranges != null && message.ranges.length) + for (var i = 0; i < message.ranges.length; ++i) + $root.google.spanner.v1.KeyRange.encode(message.ranges[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.all != null && Object.hasOwnProperty.call(message, "all")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.all); + return writer; + }; + + /** + * Encodes the specified KeySet message, length delimited. Does not implicitly {@link google.spanner.v1.KeySet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.KeySet + * @static + * @param {google.spanner.v1.IKeySet} message KeySet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeySet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a KeySet message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.KeySet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.KeySet} KeySet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeySet.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.KeySet(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.keys && message.keys.length)) + message.keys = []; + message.keys.push($root.google.protobuf.ListValue.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.ranges && message.ranges.length)) + message.ranges = []; + message.ranges.push($root.google.spanner.v1.KeyRange.decode(reader, reader.uint32())); + break; + } + case 3: { + message.all = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a KeySet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.KeySet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.KeySet} KeySet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeySet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a KeySet message. + * @function verify + * @memberof google.spanner.v1.KeySet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + KeySet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.keys != null && message.hasOwnProperty("keys")) { + if (!Array.isArray(message.keys)) + return "keys: array expected"; + for (var i = 0; i < message.keys.length; ++i) { + var error = $root.google.protobuf.ListValue.verify(message.keys[i]); + if (error) + return "keys." + error; + } + } + if (message.ranges != null && message.hasOwnProperty("ranges")) { + if (!Array.isArray(message.ranges)) + return "ranges: array expected"; + for (var i = 0; i < message.ranges.length; ++i) { + var error = $root.google.spanner.v1.KeyRange.verify(message.ranges[i]); + if (error) + return "ranges." + error; + } + } + if (message.all != null && message.hasOwnProperty("all")) + if (typeof message.all !== "boolean") + return "all: boolean expected"; + return null; + }; + + /** + * Creates a KeySet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.KeySet + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.KeySet} KeySet + */ + KeySet.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.KeySet) + return object; + var message = new $root.google.spanner.v1.KeySet(); + if (object.keys) { + if (!Array.isArray(object.keys)) + throw TypeError(".google.spanner.v1.KeySet.keys: array expected"); + message.keys = []; + for (var i = 0; i < object.keys.length; ++i) { + if (typeof object.keys[i] !== "object") + throw TypeError(".google.spanner.v1.KeySet.keys: object expected"); + message.keys[i] = $root.google.protobuf.ListValue.fromObject(object.keys[i]); + } + } + if (object.ranges) { + if (!Array.isArray(object.ranges)) + throw TypeError(".google.spanner.v1.KeySet.ranges: array expected"); + message.ranges = []; + for (var i = 0; i < object.ranges.length; ++i) { + if (typeof object.ranges[i] !== "object") + throw TypeError(".google.spanner.v1.KeySet.ranges: object expected"); + message.ranges[i] = $root.google.spanner.v1.KeyRange.fromObject(object.ranges[i]); + } + } + if (object.all != null) + message.all = Boolean(object.all); + return message; + }; + + /** + * Creates a plain object from a KeySet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.KeySet + * @static + * @param {google.spanner.v1.KeySet} message KeySet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + KeySet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.keys = []; + object.ranges = []; + } + if (options.defaults) + object.all = false; + if (message.keys && message.keys.length) { + object.keys = []; + for (var j = 0; j < message.keys.length; ++j) + object.keys[j] = $root.google.protobuf.ListValue.toObject(message.keys[j], options); + } + if (message.ranges && message.ranges.length) { + object.ranges = []; + for (var j = 0; j < message.ranges.length; ++j) + object.ranges[j] = $root.google.spanner.v1.KeyRange.toObject(message.ranges[j], options); + } + if (message.all != null && message.hasOwnProperty("all")) + object.all = message.all; + return object; + }; + + /** + * Converts this KeySet to JSON. + * @function toJSON + * @memberof google.spanner.v1.KeySet + * @instance + * @returns {Object.} JSON object + */ + KeySet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for KeySet + * @function getTypeUrl + * @memberof google.spanner.v1.KeySet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + KeySet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.KeySet"; + }; + + return KeySet; + })(); + + v1.Range = (function() { + + /** + * Properties of a Range. + * @memberof google.spanner.v1 + * @interface IRange + * @property {Uint8Array|null} [startKey] Range startKey + * @property {Uint8Array|null} [limitKey] Range limitKey + * @property {number|Long|null} [groupUid] Range groupUid + * @property {number|Long|null} [splitId] Range splitId + * @property {Uint8Array|null} [generation] Range generation + */ + + /** + * Constructs a new Range. + * @memberof google.spanner.v1 + * @classdesc Represents a Range. + * @implements IRange + * @constructor + * @param {google.spanner.v1.IRange=} [properties] Properties to set + */ + function Range(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Range startKey. + * @member {Uint8Array} startKey + * @memberof google.spanner.v1.Range + * @instance + */ + Range.prototype.startKey = $util.newBuffer([]); + + /** + * Range limitKey. + * @member {Uint8Array} limitKey + * @memberof google.spanner.v1.Range + * @instance + */ + Range.prototype.limitKey = $util.newBuffer([]); + + /** + * Range groupUid. + * @member {number|Long} groupUid + * @memberof google.spanner.v1.Range + * @instance + */ + Range.prototype.groupUid = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Range splitId. + * @member {number|Long} splitId + * @memberof google.spanner.v1.Range + * @instance + */ + Range.prototype.splitId = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Range generation. + * @member {Uint8Array} generation + * @memberof google.spanner.v1.Range + * @instance + */ + Range.prototype.generation = $util.newBuffer([]); + + /** + * Creates a new Range instance using the specified properties. + * @function create + * @memberof google.spanner.v1.Range + * @static + * @param {google.spanner.v1.IRange=} [properties] Properties to set + * @returns {google.spanner.v1.Range} Range instance + */ + Range.create = function create(properties) { + return new Range(properties); + }; + + /** + * Encodes the specified Range message. Does not implicitly {@link google.spanner.v1.Range.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.Range + * @static + * @param {google.spanner.v1.IRange} message Range message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Range.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startKey != null && Object.hasOwnProperty.call(message, "startKey")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.startKey); + if (message.limitKey != null && Object.hasOwnProperty.call(message, "limitKey")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.limitKey); + if (message.groupUid != null && Object.hasOwnProperty.call(message, "groupUid")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.groupUid); + if (message.splitId != null && Object.hasOwnProperty.call(message, "splitId")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.splitId); + if (message.generation != null && Object.hasOwnProperty.call(message, "generation")) + writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.generation); + return writer; + }; + + /** + * Encodes the specified Range message, length delimited. Does not implicitly {@link google.spanner.v1.Range.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.Range + * @static + * @param {google.spanner.v1.IRange} message Range message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Range.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Range message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.Range + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.Range} Range + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Range.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.Range(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.startKey = reader.bytes(); + break; + } + case 2: { + message.limitKey = reader.bytes(); + break; + } + case 3: { + message.groupUid = reader.uint64(); + break; + } + case 4: { + message.splitId = reader.uint64(); + break; + } + case 5: { + message.generation = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Range message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.Range + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.Range} Range + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Range.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Range message. + * @function verify + * @memberof google.spanner.v1.Range + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Range.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startKey != null && message.hasOwnProperty("startKey")) + if (!(message.startKey && typeof message.startKey.length === "number" || $util.isString(message.startKey))) + return "startKey: buffer expected"; + if (message.limitKey != null && message.hasOwnProperty("limitKey")) + if (!(message.limitKey && typeof message.limitKey.length === "number" || $util.isString(message.limitKey))) + return "limitKey: buffer expected"; + if (message.groupUid != null && message.hasOwnProperty("groupUid")) + if (!$util.isInteger(message.groupUid) && !(message.groupUid && $util.isInteger(message.groupUid.low) && $util.isInteger(message.groupUid.high))) + return "groupUid: integer|Long expected"; + if (message.splitId != null && message.hasOwnProperty("splitId")) + if (!$util.isInteger(message.splitId) && !(message.splitId && $util.isInteger(message.splitId.low) && $util.isInteger(message.splitId.high))) + return "splitId: integer|Long expected"; + if (message.generation != null && message.hasOwnProperty("generation")) + if (!(message.generation && typeof message.generation.length === "number" || $util.isString(message.generation))) + return "generation: buffer expected"; + return null; + }; + + /** + * Creates a Range message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.Range + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.Range} Range + */ + Range.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.Range) + return object; + var message = new $root.google.spanner.v1.Range(); + if (object.startKey != null) + if (typeof object.startKey === "string") + $util.base64.decode(object.startKey, message.startKey = $util.newBuffer($util.base64.length(object.startKey)), 0); + else if (object.startKey.length >= 0) + message.startKey = object.startKey; + if (object.limitKey != null) + if (typeof object.limitKey === "string") + $util.base64.decode(object.limitKey, message.limitKey = $util.newBuffer($util.base64.length(object.limitKey)), 0); + else if (object.limitKey.length >= 0) + message.limitKey = object.limitKey; + if (object.groupUid != null) + if ($util.Long) + (message.groupUid = $util.Long.fromValue(object.groupUid)).unsigned = true; + else if (typeof object.groupUid === "string") + message.groupUid = parseInt(object.groupUid, 10); + else if (typeof object.groupUid === "number") + message.groupUid = object.groupUid; + else if (typeof object.groupUid === "object") + message.groupUid = new $util.LongBits(object.groupUid.low >>> 0, object.groupUid.high >>> 0).toNumber(true); + if (object.splitId != null) + if ($util.Long) + (message.splitId = $util.Long.fromValue(object.splitId)).unsigned = true; + else if (typeof object.splitId === "string") + message.splitId = parseInt(object.splitId, 10); + else if (typeof object.splitId === "number") + message.splitId = object.splitId; + else if (typeof object.splitId === "object") + message.splitId = new $util.LongBits(object.splitId.low >>> 0, object.splitId.high >>> 0).toNumber(true); + if (object.generation != null) + if (typeof object.generation === "string") + $util.base64.decode(object.generation, message.generation = $util.newBuffer($util.base64.length(object.generation)), 0); + else if (object.generation.length >= 0) + message.generation = object.generation; + return message; + }; + + /** + * Creates a plain object from a Range message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.Range + * @static + * @param {google.spanner.v1.Range} message Range + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Range.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.startKey = ""; + else { + object.startKey = []; + if (options.bytes !== Array) + object.startKey = $util.newBuffer(object.startKey); + } + if (options.bytes === String) + object.limitKey = ""; + else { + object.limitKey = []; + if (options.bytes !== Array) + object.limitKey = $util.newBuffer(object.limitKey); + } + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.groupUid = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.groupUid = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.splitId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.splitId = options.longs === String ? "0" : 0; + if (options.bytes === String) + object.generation = ""; + else { + object.generation = []; + if (options.bytes !== Array) + object.generation = $util.newBuffer(object.generation); + } + } + if (message.startKey != null && message.hasOwnProperty("startKey")) + object.startKey = options.bytes === String ? $util.base64.encode(message.startKey, 0, message.startKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.startKey) : message.startKey; + if (message.limitKey != null && message.hasOwnProperty("limitKey")) + object.limitKey = options.bytes === String ? $util.base64.encode(message.limitKey, 0, message.limitKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.limitKey) : message.limitKey; + if (message.groupUid != null && message.hasOwnProperty("groupUid")) + if (typeof message.groupUid === "number") + object.groupUid = options.longs === String ? String(message.groupUid) : message.groupUid; + else + object.groupUid = options.longs === String ? $util.Long.prototype.toString.call(message.groupUid) : options.longs === Number ? new $util.LongBits(message.groupUid.low >>> 0, message.groupUid.high >>> 0).toNumber(true) : message.groupUid; + if (message.splitId != null && message.hasOwnProperty("splitId")) + if (typeof message.splitId === "number") + object.splitId = options.longs === String ? String(message.splitId) : message.splitId; + else + object.splitId = options.longs === String ? $util.Long.prototype.toString.call(message.splitId) : options.longs === Number ? new $util.LongBits(message.splitId.low >>> 0, message.splitId.high >>> 0).toNumber(true) : message.splitId; + if (message.generation != null && message.hasOwnProperty("generation")) + object.generation = options.bytes === String ? $util.base64.encode(message.generation, 0, message.generation.length) : options.bytes === Array ? Array.prototype.slice.call(message.generation) : message.generation; + return object; + }; + + /** + * Converts this Range to JSON. + * @function toJSON + * @memberof google.spanner.v1.Range + * @instance + * @returns {Object.} JSON object + */ + Range.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Range + * @function getTypeUrl + * @memberof google.spanner.v1.Range + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Range.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.Range"; + }; + + return Range; + })(); + + v1.Tablet = (function() { + + /** + * Properties of a Tablet. + * @memberof google.spanner.v1 + * @interface ITablet + * @property {number|Long|null} [tabletUid] Tablet tabletUid + * @property {string|null} [serverAddress] Tablet serverAddress + * @property {string|null} [location] Tablet location + * @property {google.spanner.v1.Tablet.Role|null} [role] Tablet role + * @property {Uint8Array|null} [incarnation] Tablet incarnation + * @property {number|null} [distance] Tablet distance + * @property {boolean|null} [skip] Tablet skip + */ + + /** + * Constructs a new Tablet. + * @memberof google.spanner.v1 + * @classdesc Represents a Tablet. + * @implements ITablet + * @constructor + * @param {google.spanner.v1.ITablet=} [properties] Properties to set + */ + function Tablet(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Tablet tabletUid. + * @member {number|Long} tabletUid + * @memberof google.spanner.v1.Tablet + * @instance + */ + Tablet.prototype.tabletUid = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Tablet serverAddress. + * @member {string} serverAddress + * @memberof google.spanner.v1.Tablet + * @instance + */ + Tablet.prototype.serverAddress = ""; + + /** + * Tablet location. + * @member {string} location + * @memberof google.spanner.v1.Tablet + * @instance + */ + Tablet.prototype.location = ""; + + /** + * Tablet role. + * @member {google.spanner.v1.Tablet.Role} role + * @memberof google.spanner.v1.Tablet + * @instance + */ + Tablet.prototype.role = 0; + + /** + * Tablet incarnation. + * @member {Uint8Array} incarnation + * @memberof google.spanner.v1.Tablet + * @instance + */ + Tablet.prototype.incarnation = $util.newBuffer([]); + + /** + * Tablet distance. + * @member {number} distance + * @memberof google.spanner.v1.Tablet + * @instance + */ + Tablet.prototype.distance = 0; + + /** + * Tablet skip. + * @member {boolean} skip + * @memberof google.spanner.v1.Tablet + * @instance + */ + Tablet.prototype.skip = false; + + /** + * Creates a new Tablet instance using the specified properties. + * @function create + * @memberof google.spanner.v1.Tablet + * @static + * @param {google.spanner.v1.ITablet=} [properties] Properties to set + * @returns {google.spanner.v1.Tablet} Tablet instance + */ + Tablet.create = function create(properties) { + return new Tablet(properties); + }; + + /** + * Encodes the specified Tablet message. Does not implicitly {@link google.spanner.v1.Tablet.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.Tablet + * @static + * @param {google.spanner.v1.ITablet} message Tablet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Tablet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tabletUid != null && Object.hasOwnProperty.call(message, "tabletUid")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.tabletUid); + if (message.serverAddress != null && Object.hasOwnProperty.call(message, "serverAddress")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.serverAddress); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.location); + if (message.role != null && Object.hasOwnProperty.call(message, "role")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.role); + if (message.incarnation != null && Object.hasOwnProperty.call(message, "incarnation")) + writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.incarnation); + if (message.distance != null && Object.hasOwnProperty.call(message, "distance")) + writer.uint32(/* id 6, wireType 0 =*/48).uint32(message.distance); + if (message.skip != null && Object.hasOwnProperty.call(message, "skip")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.skip); + return writer; + }; + + /** + * Encodes the specified Tablet message, length delimited. Does not implicitly {@link google.spanner.v1.Tablet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.Tablet + * @static + * @param {google.spanner.v1.ITablet} message Tablet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Tablet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Tablet message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.Tablet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.Tablet} Tablet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Tablet.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.Tablet(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.tabletUid = reader.uint64(); + break; + } + case 2: { + message.serverAddress = reader.string(); + break; + } + case 3: { + message.location = reader.string(); + break; + } + case 4: { + message.role = reader.int32(); + break; + } + case 5: { + message.incarnation = reader.bytes(); + break; + } + case 6: { + message.distance = reader.uint32(); + break; + } + case 7: { + message.skip = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Tablet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.Tablet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.Tablet} Tablet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Tablet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Tablet message. + * @function verify + * @memberof google.spanner.v1.Tablet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Tablet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tabletUid != null && message.hasOwnProperty("tabletUid")) + if (!$util.isInteger(message.tabletUid) && !(message.tabletUid && $util.isInteger(message.tabletUid.low) && $util.isInteger(message.tabletUid.high))) + return "tabletUid: integer|Long expected"; + if (message.serverAddress != null && message.hasOwnProperty("serverAddress")) + if (!$util.isString(message.serverAddress)) + return "serverAddress: string expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + if (message.role != null && message.hasOwnProperty("role")) + switch (message.role) { + default: + return "role: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.incarnation != null && message.hasOwnProperty("incarnation")) + if (!(message.incarnation && typeof message.incarnation.length === "number" || $util.isString(message.incarnation))) + return "incarnation: buffer expected"; + if (message.distance != null && message.hasOwnProperty("distance")) + if (!$util.isInteger(message.distance)) + return "distance: integer expected"; + if (message.skip != null && message.hasOwnProperty("skip")) + if (typeof message.skip !== "boolean") + return "skip: boolean expected"; + return null; + }; + + /** + * Creates a Tablet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.Tablet + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.Tablet} Tablet + */ + Tablet.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.Tablet) + return object; + var message = new $root.google.spanner.v1.Tablet(); + if (object.tabletUid != null) + if ($util.Long) + (message.tabletUid = $util.Long.fromValue(object.tabletUid)).unsigned = true; + else if (typeof object.tabletUid === "string") + message.tabletUid = parseInt(object.tabletUid, 10); + else if (typeof object.tabletUid === "number") + message.tabletUid = object.tabletUid; + else if (typeof object.tabletUid === "object") + message.tabletUid = new $util.LongBits(object.tabletUid.low >>> 0, object.tabletUid.high >>> 0).toNumber(true); + if (object.serverAddress != null) + message.serverAddress = String(object.serverAddress); + if (object.location != null) + message.location = String(object.location); + switch (object.role) { + default: + if (typeof object.role === "number") { + message.role = object.role; + break; + } + break; + case "ROLE_UNSPECIFIED": + case 0: + message.role = 0; + break; + case "READ_WRITE": + case 1: + message.role = 1; + break; + case "READ_ONLY": + case 2: + message.role = 2; + break; + } + if (object.incarnation != null) + if (typeof object.incarnation === "string") + $util.base64.decode(object.incarnation, message.incarnation = $util.newBuffer($util.base64.length(object.incarnation)), 0); + else if (object.incarnation.length >= 0) + message.incarnation = object.incarnation; + if (object.distance != null) + message.distance = object.distance >>> 0; + if (object.skip != null) + message.skip = Boolean(object.skip); + return message; + }; + + /** + * Creates a plain object from a Tablet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.Tablet + * @static + * @param {google.spanner.v1.Tablet} message Tablet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Tablet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.tabletUid = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.tabletUid = options.longs === String ? "0" : 0; + object.serverAddress = ""; + object.location = ""; + object.role = options.enums === String ? "ROLE_UNSPECIFIED" : 0; + if (options.bytes === String) + object.incarnation = ""; + else { + object.incarnation = []; + if (options.bytes !== Array) + object.incarnation = $util.newBuffer(object.incarnation); + } + object.distance = 0; + object.skip = false; + } + if (message.tabletUid != null && message.hasOwnProperty("tabletUid")) + if (typeof message.tabletUid === "number") + object.tabletUid = options.longs === String ? String(message.tabletUid) : message.tabletUid; + else + object.tabletUid = options.longs === String ? $util.Long.prototype.toString.call(message.tabletUid) : options.longs === Number ? new $util.LongBits(message.tabletUid.low >>> 0, message.tabletUid.high >>> 0).toNumber(true) : message.tabletUid; + if (message.serverAddress != null && message.hasOwnProperty("serverAddress")) + object.serverAddress = message.serverAddress; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + if (message.role != null && message.hasOwnProperty("role")) + object.role = options.enums === String ? $root.google.spanner.v1.Tablet.Role[message.role] === undefined ? message.role : $root.google.spanner.v1.Tablet.Role[message.role] : message.role; + if (message.incarnation != null && message.hasOwnProperty("incarnation")) + object.incarnation = options.bytes === String ? $util.base64.encode(message.incarnation, 0, message.incarnation.length) : options.bytes === Array ? Array.prototype.slice.call(message.incarnation) : message.incarnation; + if (message.distance != null && message.hasOwnProperty("distance")) + object.distance = message.distance; + if (message.skip != null && message.hasOwnProperty("skip")) + object.skip = message.skip; + return object; + }; + + /** + * Converts this Tablet to JSON. + * @function toJSON + * @memberof google.spanner.v1.Tablet + * @instance + * @returns {Object.} JSON object + */ + Tablet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Tablet + * @function getTypeUrl + * @memberof google.spanner.v1.Tablet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Tablet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.Tablet"; + }; + + /** + * Role enum. + * @name google.spanner.v1.Tablet.Role + * @enum {number} + * @property {number} ROLE_UNSPECIFIED=0 ROLE_UNSPECIFIED value + * @property {number} READ_WRITE=1 READ_WRITE value + * @property {number} READ_ONLY=2 READ_ONLY value + */ + Tablet.Role = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ROLE_UNSPECIFIED"] = 0; + values[valuesById[1] = "READ_WRITE"] = 1; + values[valuesById[2] = "READ_ONLY"] = 2; + return values; + })(); + + return Tablet; + })(); + + v1.Group = (function() { + + /** + * Properties of a Group. + * @memberof google.spanner.v1 + * @interface IGroup + * @property {number|Long|null} [groupUid] Group groupUid + * @property {Array.|null} [tablets] Group tablets + * @property {number|null} [leaderIndex] Group leaderIndex + * @property {Uint8Array|null} [generation] Group generation + */ + + /** + * Constructs a new Group. + * @memberof google.spanner.v1 + * @classdesc Represents a Group. + * @implements IGroup + * @constructor + * @param {google.spanner.v1.IGroup=} [properties] Properties to set + */ + function Group(properties) { + this.tablets = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Group groupUid. + * @member {number|Long} groupUid + * @memberof google.spanner.v1.Group + * @instance + */ + Group.prototype.groupUid = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Group tablets. + * @member {Array.} tablets + * @memberof google.spanner.v1.Group + * @instance + */ + Group.prototype.tablets = $util.emptyArray; + + /** + * Group leaderIndex. + * @member {number} leaderIndex + * @memberof google.spanner.v1.Group + * @instance + */ + Group.prototype.leaderIndex = 0; + + /** + * Group generation. + * @member {Uint8Array} generation + * @memberof google.spanner.v1.Group + * @instance + */ + Group.prototype.generation = $util.newBuffer([]); + + /** + * Creates a new Group instance using the specified properties. + * @function create + * @memberof google.spanner.v1.Group + * @static + * @param {google.spanner.v1.IGroup=} [properties] Properties to set + * @returns {google.spanner.v1.Group} Group instance + */ + Group.create = function create(properties) { + return new Group(properties); + }; + + /** + * Encodes the specified Group message. Does not implicitly {@link google.spanner.v1.Group.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.Group + * @static + * @param {google.spanner.v1.IGroup} message Group message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Group.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.groupUid != null && Object.hasOwnProperty.call(message, "groupUid")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.groupUid); + if (message.tablets != null && message.tablets.length) + for (var i = 0; i < message.tablets.length; ++i) + $root.google.spanner.v1.Tablet.encode(message.tablets[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.leaderIndex != null && Object.hasOwnProperty.call(message, "leaderIndex")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.leaderIndex); + if (message.generation != null && Object.hasOwnProperty.call(message, "generation")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.generation); + return writer; + }; + + /** + * Encodes the specified Group message, length delimited. Does not implicitly {@link google.spanner.v1.Group.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.Group + * @static + * @param {google.spanner.v1.IGroup} message Group message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Group.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Group message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.Group + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.Group} Group + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Group.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.Group(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.groupUid = reader.uint64(); + break; + } + case 2: { + if (!(message.tablets && message.tablets.length)) + message.tablets = []; + message.tablets.push($root.google.spanner.v1.Tablet.decode(reader, reader.uint32())); + break; + } + case 3: { + message.leaderIndex = reader.int32(); + break; + } + case 4: { + message.generation = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Group message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.Group + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.Group} Group + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Group.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Group message. + * @function verify + * @memberof google.spanner.v1.Group + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Group.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.groupUid != null && message.hasOwnProperty("groupUid")) + if (!$util.isInteger(message.groupUid) && !(message.groupUid && $util.isInteger(message.groupUid.low) && $util.isInteger(message.groupUid.high))) + return "groupUid: integer|Long expected"; + if (message.tablets != null && message.hasOwnProperty("tablets")) { + if (!Array.isArray(message.tablets)) + return "tablets: array expected"; + for (var i = 0; i < message.tablets.length; ++i) { + var error = $root.google.spanner.v1.Tablet.verify(message.tablets[i]); + if (error) + return "tablets." + error; + } + } + if (message.leaderIndex != null && message.hasOwnProperty("leaderIndex")) + if (!$util.isInteger(message.leaderIndex)) + return "leaderIndex: integer expected"; + if (message.generation != null && message.hasOwnProperty("generation")) + if (!(message.generation && typeof message.generation.length === "number" || $util.isString(message.generation))) + return "generation: buffer expected"; + return null; + }; + + /** + * Creates a Group message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.Group + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.Group} Group + */ + Group.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.Group) + return object; + var message = new $root.google.spanner.v1.Group(); + if (object.groupUid != null) + if ($util.Long) + (message.groupUid = $util.Long.fromValue(object.groupUid)).unsigned = true; + else if (typeof object.groupUid === "string") + message.groupUid = parseInt(object.groupUid, 10); + else if (typeof object.groupUid === "number") + message.groupUid = object.groupUid; + else if (typeof object.groupUid === "object") + message.groupUid = new $util.LongBits(object.groupUid.low >>> 0, object.groupUid.high >>> 0).toNumber(true); + if (object.tablets) { + if (!Array.isArray(object.tablets)) + throw TypeError(".google.spanner.v1.Group.tablets: array expected"); + message.tablets = []; + for (var i = 0; i < object.tablets.length; ++i) { + if (typeof object.tablets[i] !== "object") + throw TypeError(".google.spanner.v1.Group.tablets: object expected"); + message.tablets[i] = $root.google.spanner.v1.Tablet.fromObject(object.tablets[i]); + } + } + if (object.leaderIndex != null) + message.leaderIndex = object.leaderIndex | 0; + if (object.generation != null) + if (typeof object.generation === "string") + $util.base64.decode(object.generation, message.generation = $util.newBuffer($util.base64.length(object.generation)), 0); + else if (object.generation.length >= 0) + message.generation = object.generation; + return message; + }; + + /** + * Creates a plain object from a Group message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.Group + * @static + * @param {google.spanner.v1.Group} message Group + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Group.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.tablets = []; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.groupUid = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.groupUid = options.longs === String ? "0" : 0; + object.leaderIndex = 0; + if (options.bytes === String) + object.generation = ""; + else { + object.generation = []; + if (options.bytes !== Array) + object.generation = $util.newBuffer(object.generation); + } + } + if (message.groupUid != null && message.hasOwnProperty("groupUid")) + if (typeof message.groupUid === "number") + object.groupUid = options.longs === String ? String(message.groupUid) : message.groupUid; + else + object.groupUid = options.longs === String ? $util.Long.prototype.toString.call(message.groupUid) : options.longs === Number ? new $util.LongBits(message.groupUid.low >>> 0, message.groupUid.high >>> 0).toNumber(true) : message.groupUid; + if (message.tablets && message.tablets.length) { + object.tablets = []; + for (var j = 0; j < message.tablets.length; ++j) + object.tablets[j] = $root.google.spanner.v1.Tablet.toObject(message.tablets[j], options); + } + if (message.leaderIndex != null && message.hasOwnProperty("leaderIndex")) + object.leaderIndex = message.leaderIndex; + if (message.generation != null && message.hasOwnProperty("generation")) + object.generation = options.bytes === String ? $util.base64.encode(message.generation, 0, message.generation.length) : options.bytes === Array ? Array.prototype.slice.call(message.generation) : message.generation; + return object; + }; + + /** + * Converts this Group to JSON. + * @function toJSON + * @memberof google.spanner.v1.Group + * @instance + * @returns {Object.} JSON object + */ + Group.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Group + * @function getTypeUrl + * @memberof google.spanner.v1.Group + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Group.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.Group"; + }; + + return Group; + })(); + + v1.KeyRecipe = (function() { + + /** + * Properties of a KeyRecipe. + * @memberof google.spanner.v1 + * @interface IKeyRecipe + * @property {string|null} [tableName] KeyRecipe tableName + * @property {string|null} [indexName] KeyRecipe indexName + * @property {number|Long|null} [operationUid] KeyRecipe operationUid + * @property {Array.|null} [part] KeyRecipe part + */ + + /** + * Constructs a new KeyRecipe. + * @memberof google.spanner.v1 + * @classdesc Represents a KeyRecipe. + * @implements IKeyRecipe + * @constructor + * @param {google.spanner.v1.IKeyRecipe=} [properties] Properties to set + */ + function KeyRecipe(properties) { + this.part = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * KeyRecipe tableName. + * @member {string|null|undefined} tableName + * @memberof google.spanner.v1.KeyRecipe + * @instance + */ + KeyRecipe.prototype.tableName = null; + + /** + * KeyRecipe indexName. + * @member {string|null|undefined} indexName + * @memberof google.spanner.v1.KeyRecipe + * @instance + */ + KeyRecipe.prototype.indexName = null; + + /** + * KeyRecipe operationUid. + * @member {number|Long|null|undefined} operationUid + * @memberof google.spanner.v1.KeyRecipe + * @instance + */ + KeyRecipe.prototype.operationUid = null; + + /** + * KeyRecipe part. + * @member {Array.} part + * @memberof google.spanner.v1.KeyRecipe + * @instance + */ + KeyRecipe.prototype.part = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * KeyRecipe target. + * @member {"tableName"|"indexName"|"operationUid"|undefined} target + * @memberof google.spanner.v1.KeyRecipe + * @instance + */ + Object.defineProperty(KeyRecipe.prototype, "target", { + get: $util.oneOfGetter($oneOfFields = ["tableName", "indexName", "operationUid"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new KeyRecipe instance using the specified properties. + * @function create + * @memberof google.spanner.v1.KeyRecipe + * @static + * @param {google.spanner.v1.IKeyRecipe=} [properties] Properties to set + * @returns {google.spanner.v1.KeyRecipe} KeyRecipe instance + */ + KeyRecipe.create = function create(properties) { + return new KeyRecipe(properties); + }; + + /** + * Encodes the specified KeyRecipe message. Does not implicitly {@link google.spanner.v1.KeyRecipe.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.KeyRecipe + * @static + * @param {google.spanner.v1.IKeyRecipe} message KeyRecipe message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyRecipe.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tableName != null && Object.hasOwnProperty.call(message, "tableName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.tableName); + if (message.indexName != null && Object.hasOwnProperty.call(message, "indexName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.indexName); + if (message.operationUid != null && Object.hasOwnProperty.call(message, "operationUid")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.operationUid); + if (message.part != null && message.part.length) + for (var i = 0; i < message.part.length; ++i) + $root.google.spanner.v1.KeyRecipe.Part.encode(message.part[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified KeyRecipe message, length delimited. Does not implicitly {@link google.spanner.v1.KeyRecipe.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.KeyRecipe + * @static + * @param {google.spanner.v1.IKeyRecipe} message KeyRecipe message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyRecipe.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a KeyRecipe message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.KeyRecipe + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.KeyRecipe} KeyRecipe + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyRecipe.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.KeyRecipe(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.tableName = reader.string(); + break; + } + case 2: { + message.indexName = reader.string(); + break; + } + case 3: { + message.operationUid = reader.uint64(); + break; + } + case 4: { + if (!(message.part && message.part.length)) + message.part = []; + message.part.push($root.google.spanner.v1.KeyRecipe.Part.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a KeyRecipe message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.KeyRecipe + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.KeyRecipe} KeyRecipe + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyRecipe.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a KeyRecipe message. + * @function verify + * @memberof google.spanner.v1.KeyRecipe + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + KeyRecipe.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.tableName != null && message.hasOwnProperty("tableName")) { + properties.target = 1; + if (!$util.isString(message.tableName)) + return "tableName: string expected"; + } + if (message.indexName != null && message.hasOwnProperty("indexName")) { + if (properties.target === 1) + return "target: multiple values"; + properties.target = 1; + if (!$util.isString(message.indexName)) + return "indexName: string expected"; + } + if (message.operationUid != null && message.hasOwnProperty("operationUid")) { + if (properties.target === 1) + return "target: multiple values"; + properties.target = 1; + if (!$util.isInteger(message.operationUid) && !(message.operationUid && $util.isInteger(message.operationUid.low) && $util.isInteger(message.operationUid.high))) + return "operationUid: integer|Long expected"; + } + if (message.part != null && message.hasOwnProperty("part")) { + if (!Array.isArray(message.part)) + return "part: array expected"; + for (var i = 0; i < message.part.length; ++i) { + var error = $root.google.spanner.v1.KeyRecipe.Part.verify(message.part[i]); + if (error) + return "part." + error; + } + } + return null; + }; + + /** + * Creates a KeyRecipe message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.KeyRecipe + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.KeyRecipe} KeyRecipe + */ + KeyRecipe.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.KeyRecipe) + return object; + var message = new $root.google.spanner.v1.KeyRecipe(); + if (object.tableName != null) + message.tableName = String(object.tableName); + if (object.indexName != null) + message.indexName = String(object.indexName); + if (object.operationUid != null) + if ($util.Long) + (message.operationUid = $util.Long.fromValue(object.operationUid)).unsigned = true; + else if (typeof object.operationUid === "string") + message.operationUid = parseInt(object.operationUid, 10); + else if (typeof object.operationUid === "number") + message.operationUid = object.operationUid; + else if (typeof object.operationUid === "object") + message.operationUid = new $util.LongBits(object.operationUid.low >>> 0, object.operationUid.high >>> 0).toNumber(true); + if (object.part) { + if (!Array.isArray(object.part)) + throw TypeError(".google.spanner.v1.KeyRecipe.part: array expected"); + message.part = []; + for (var i = 0; i < object.part.length; ++i) { + if (typeof object.part[i] !== "object") + throw TypeError(".google.spanner.v1.KeyRecipe.part: object expected"); + message.part[i] = $root.google.spanner.v1.KeyRecipe.Part.fromObject(object.part[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a KeyRecipe message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.KeyRecipe + * @static + * @param {google.spanner.v1.KeyRecipe} message KeyRecipe + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + KeyRecipe.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.part = []; + if (message.tableName != null && message.hasOwnProperty("tableName")) { + object.tableName = message.tableName; + if (options.oneofs) + object.target = "tableName"; + } + if (message.indexName != null && message.hasOwnProperty("indexName")) { + object.indexName = message.indexName; + if (options.oneofs) + object.target = "indexName"; + } + if (message.operationUid != null && message.hasOwnProperty("operationUid")) { + if (typeof message.operationUid === "number") + object.operationUid = options.longs === String ? String(message.operationUid) : message.operationUid; + else + object.operationUid = options.longs === String ? $util.Long.prototype.toString.call(message.operationUid) : options.longs === Number ? new $util.LongBits(message.operationUid.low >>> 0, message.operationUid.high >>> 0).toNumber(true) : message.operationUid; + if (options.oneofs) + object.target = "operationUid"; + } + if (message.part && message.part.length) { + object.part = []; + for (var j = 0; j < message.part.length; ++j) + object.part[j] = $root.google.spanner.v1.KeyRecipe.Part.toObject(message.part[j], options); + } + return object; + }; + + /** + * Converts this KeyRecipe to JSON. + * @function toJSON + * @memberof google.spanner.v1.KeyRecipe + * @instance + * @returns {Object.} JSON object + */ + KeyRecipe.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for KeyRecipe + * @function getTypeUrl + * @memberof google.spanner.v1.KeyRecipe + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + KeyRecipe.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.KeyRecipe"; + }; + + KeyRecipe.Part = (function() { + + /** + * Properties of a Part. + * @memberof google.spanner.v1.KeyRecipe + * @interface IPart + * @property {number|null} [tag] Part tag + * @property {google.spanner.v1.KeyRecipe.Part.Order|null} [order] Part order + * @property {google.spanner.v1.KeyRecipe.Part.NullOrder|null} [nullOrder] Part nullOrder + * @property {google.spanner.v1.IType|null} [type] Part type + * @property {string|null} [identifier] Part identifier + * @property {google.protobuf.IValue|null} [value] Part value + * @property {boolean|null} [random] Part random + * @property {Array.|null} [structIdentifiers] Part structIdentifiers + */ + + /** + * Constructs a new Part. + * @memberof google.spanner.v1.KeyRecipe + * @classdesc Represents a Part. + * @implements IPart + * @constructor + * @param {google.spanner.v1.KeyRecipe.IPart=} [properties] Properties to set + */ + function Part(properties) { + this.structIdentifiers = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Part tag. + * @member {number} tag + * @memberof google.spanner.v1.KeyRecipe.Part + * @instance + */ + Part.prototype.tag = 0; + + /** + * Part order. + * @member {google.spanner.v1.KeyRecipe.Part.Order} order + * @memberof google.spanner.v1.KeyRecipe.Part + * @instance + */ + Part.prototype.order = 0; + + /** + * Part nullOrder. + * @member {google.spanner.v1.KeyRecipe.Part.NullOrder} nullOrder + * @memberof google.spanner.v1.KeyRecipe.Part + * @instance + */ + Part.prototype.nullOrder = 0; + + /** + * Part type. + * @member {google.spanner.v1.IType|null|undefined} type + * @memberof google.spanner.v1.KeyRecipe.Part + * @instance + */ + Part.prototype.type = null; + + /** + * Part identifier. + * @member {string|null|undefined} identifier + * @memberof google.spanner.v1.KeyRecipe.Part + * @instance + */ + Part.prototype.identifier = null; + + /** + * Part value. + * @member {google.protobuf.IValue|null|undefined} value + * @memberof google.spanner.v1.KeyRecipe.Part + * @instance + */ + Part.prototype.value = null; + + /** + * Part random. + * @member {boolean|null|undefined} random + * @memberof google.spanner.v1.KeyRecipe.Part + * @instance + */ + Part.prototype.random = null; + + /** + * Part structIdentifiers. + * @member {Array.} structIdentifiers + * @memberof google.spanner.v1.KeyRecipe.Part + * @instance + */ + Part.prototype.structIdentifiers = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Part valueType. + * @member {"identifier"|"value"|"random"|undefined} valueType + * @memberof google.spanner.v1.KeyRecipe.Part + * @instance + */ + Object.defineProperty(Part.prototype, "valueType", { + get: $util.oneOfGetter($oneOfFields = ["identifier", "value", "random"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Part instance using the specified properties. + * @function create + * @memberof google.spanner.v1.KeyRecipe.Part + * @static + * @param {google.spanner.v1.KeyRecipe.IPart=} [properties] Properties to set + * @returns {google.spanner.v1.KeyRecipe.Part} Part instance + */ + Part.create = function create(properties) { + return new Part(properties); + }; + + /** + * Encodes the specified Part message. Does not implicitly {@link google.spanner.v1.KeyRecipe.Part.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.KeyRecipe.Part + * @static + * @param {google.spanner.v1.KeyRecipe.IPart} message Part message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Part.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tag != null && Object.hasOwnProperty.call(message, "tag")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.tag); + if (message.order != null && Object.hasOwnProperty.call(message, "order")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.order); + if (message.nullOrder != null && Object.hasOwnProperty.call(message, "nullOrder")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.nullOrder); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + $root.google.spanner.v1.Type.encode(message.type, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.identifier != null && Object.hasOwnProperty.call(message, "identifier")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.identifier); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + $root.google.protobuf.Value.encode(message.value, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.structIdentifiers != null && message.structIdentifiers.length) { + writer.uint32(/* id 7, wireType 2 =*/58).fork(); + for (var i = 0; i < message.structIdentifiers.length; ++i) + writer.int32(message.structIdentifiers[i]); + writer.ldelim(); + } + if (message.random != null && Object.hasOwnProperty.call(message, "random")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.random); + return writer; + }; + + /** + * Encodes the specified Part message, length delimited. Does not implicitly {@link google.spanner.v1.KeyRecipe.Part.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.KeyRecipe.Part + * @static + * @param {google.spanner.v1.KeyRecipe.IPart} message Part message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Part.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Part message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.KeyRecipe.Part + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.KeyRecipe.Part} Part + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Part.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.KeyRecipe.Part(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.tag = reader.uint32(); + break; + } + case 2: { + message.order = reader.int32(); + break; + } + case 3: { + message.nullOrder = reader.int32(); + break; + } + case 4: { + message.type = $root.google.spanner.v1.Type.decode(reader, reader.uint32()); + break; + } + case 5: { + message.identifier = reader.string(); + break; + } + case 6: { + message.value = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + } + case 8: { + message.random = reader.bool(); + break; + } + case 7: { + if (!(message.structIdentifiers && message.structIdentifiers.length)) + message.structIdentifiers = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.structIdentifiers.push(reader.int32()); + } else + message.structIdentifiers.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Part message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.KeyRecipe.Part + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.KeyRecipe.Part} Part + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Part.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Part message. + * @function verify + * @memberof google.spanner.v1.KeyRecipe.Part + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Part.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.tag != null && message.hasOwnProperty("tag")) + if (!$util.isInteger(message.tag)) + return "tag: integer expected"; + if (message.order != null && message.hasOwnProperty("order")) + switch (message.order) { + default: + return "order: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.nullOrder != null && message.hasOwnProperty("nullOrder")) + switch (message.nullOrder) { + default: + return "nullOrder: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.type != null && message.hasOwnProperty("type")) { + var error = $root.google.spanner.v1.Type.verify(message.type); + if (error) + return "type." + error; + } + if (message.identifier != null && message.hasOwnProperty("identifier")) { + properties.valueType = 1; + if (!$util.isString(message.identifier)) + return "identifier: string expected"; + } + if (message.value != null && message.hasOwnProperty("value")) { + if (properties.valueType === 1) + return "valueType: multiple values"; + properties.valueType = 1; + { + var error = $root.google.protobuf.Value.verify(message.value); + if (error) + return "value." + error; + } + } + if (message.random != null && message.hasOwnProperty("random")) { + if (properties.valueType === 1) + return "valueType: multiple values"; + properties.valueType = 1; + if (typeof message.random !== "boolean") + return "random: boolean expected"; + } + if (message.structIdentifiers != null && message.hasOwnProperty("structIdentifiers")) { + if (!Array.isArray(message.structIdentifiers)) + return "structIdentifiers: array expected"; + for (var i = 0; i < message.structIdentifiers.length; ++i) + if (!$util.isInteger(message.structIdentifiers[i])) + return "structIdentifiers: integer[] expected"; + } + return null; + }; + + /** + * Creates a Part message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.KeyRecipe.Part + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.KeyRecipe.Part} Part + */ + Part.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.KeyRecipe.Part) + return object; + var message = new $root.google.spanner.v1.KeyRecipe.Part(); + if (object.tag != null) + message.tag = object.tag >>> 0; + switch (object.order) { + default: + if (typeof object.order === "number") { + message.order = object.order; + break; + } + break; + case "ORDER_UNSPECIFIED": + case 0: + message.order = 0; + break; + case "ASCENDING": + case 1: + message.order = 1; + break; + case "DESCENDING": + case 2: + message.order = 2; + break; + } + switch (object.nullOrder) { + default: + if (typeof object.nullOrder === "number") { + message.nullOrder = object.nullOrder; + break; + } + break; + case "NULL_ORDER_UNSPECIFIED": + case 0: + message.nullOrder = 0; + break; + case "NULLS_FIRST": + case 1: + message.nullOrder = 1; + break; + case "NULLS_LAST": + case 2: + message.nullOrder = 2; + break; + case "NOT_NULL": + case 3: + message.nullOrder = 3; + break; + } + if (object.type != null) { + if (typeof object.type !== "object") + throw TypeError(".google.spanner.v1.KeyRecipe.Part.type: object expected"); + message.type = $root.google.spanner.v1.Type.fromObject(object.type); + } + if (object.identifier != null) + message.identifier = String(object.identifier); + if (object.value != null) { + if (typeof object.value !== "object") + throw TypeError(".google.spanner.v1.KeyRecipe.Part.value: object expected"); + message.value = $root.google.protobuf.Value.fromObject(object.value); + } + if (object.random != null) + message.random = Boolean(object.random); + if (object.structIdentifiers) { + if (!Array.isArray(object.structIdentifiers)) + throw TypeError(".google.spanner.v1.KeyRecipe.Part.structIdentifiers: array expected"); + message.structIdentifiers = []; + for (var i = 0; i < object.structIdentifiers.length; ++i) + message.structIdentifiers[i] = object.structIdentifiers[i] | 0; + } + return message; + }; + + /** + * Creates a plain object from a Part message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.KeyRecipe.Part + * @static + * @param {google.spanner.v1.KeyRecipe.Part} message Part + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Part.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.structIdentifiers = []; + if (options.defaults) { + object.tag = 0; + object.order = options.enums === String ? "ORDER_UNSPECIFIED" : 0; + object.nullOrder = options.enums === String ? "NULL_ORDER_UNSPECIFIED" : 0; + object.type = null; + } + if (message.tag != null && message.hasOwnProperty("tag")) + object.tag = message.tag; + if (message.order != null && message.hasOwnProperty("order")) + object.order = options.enums === String ? $root.google.spanner.v1.KeyRecipe.Part.Order[message.order] === undefined ? message.order : $root.google.spanner.v1.KeyRecipe.Part.Order[message.order] : message.order; + if (message.nullOrder != null && message.hasOwnProperty("nullOrder")) + object.nullOrder = options.enums === String ? $root.google.spanner.v1.KeyRecipe.Part.NullOrder[message.nullOrder] === undefined ? message.nullOrder : $root.google.spanner.v1.KeyRecipe.Part.NullOrder[message.nullOrder] : message.nullOrder; + if (message.type != null && message.hasOwnProperty("type")) + object.type = $root.google.spanner.v1.Type.toObject(message.type, options); + if (message.identifier != null && message.hasOwnProperty("identifier")) { + object.identifier = message.identifier; + if (options.oneofs) + object.valueType = "identifier"; + } + if (message.value != null && message.hasOwnProperty("value")) { + object.value = $root.google.protobuf.Value.toObject(message.value, options); + if (options.oneofs) + object.valueType = "value"; + } + if (message.structIdentifiers && message.structIdentifiers.length) { + object.structIdentifiers = []; + for (var j = 0; j < message.structIdentifiers.length; ++j) + object.structIdentifiers[j] = message.structIdentifiers[j]; + } + if (message.random != null && message.hasOwnProperty("random")) { + object.random = message.random; + if (options.oneofs) + object.valueType = "random"; + } + return object; + }; + + /** + * Converts this Part to JSON. + * @function toJSON + * @memberof google.spanner.v1.KeyRecipe.Part + * @instance + * @returns {Object.} JSON object + */ + Part.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Part + * @function getTypeUrl + * @memberof google.spanner.v1.KeyRecipe.Part + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Part.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.KeyRecipe.Part"; + }; + + /** + * Order enum. + * @name google.spanner.v1.KeyRecipe.Part.Order + * @enum {number} + * @property {number} ORDER_UNSPECIFIED=0 ORDER_UNSPECIFIED value + * @property {number} ASCENDING=1 ASCENDING value + * @property {number} DESCENDING=2 DESCENDING value + */ + Part.Order = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ORDER_UNSPECIFIED"] = 0; + values[valuesById[1] = "ASCENDING"] = 1; + values[valuesById[2] = "DESCENDING"] = 2; + return values; + })(); + + /** + * NullOrder enum. + * @name google.spanner.v1.KeyRecipe.Part.NullOrder + * @enum {number} + * @property {number} NULL_ORDER_UNSPECIFIED=0 NULL_ORDER_UNSPECIFIED value + * @property {number} NULLS_FIRST=1 NULLS_FIRST value + * @property {number} NULLS_LAST=2 NULLS_LAST value + * @property {number} NOT_NULL=3 NOT_NULL value + */ + Part.NullOrder = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NULL_ORDER_UNSPECIFIED"] = 0; + values[valuesById[1] = "NULLS_FIRST"] = 1; + values[valuesById[2] = "NULLS_LAST"] = 2; + values[valuesById[3] = "NOT_NULL"] = 3; + return values; + })(); + + return Part; + })(); + + return KeyRecipe; + })(); + + v1.RecipeList = (function() { + + /** + * Properties of a RecipeList. + * @memberof google.spanner.v1 + * @interface IRecipeList + * @property {Uint8Array|null} [schemaGeneration] RecipeList schemaGeneration + * @property {Array.|null} [recipe] RecipeList recipe + */ + + /** + * Constructs a new RecipeList. + * @memberof google.spanner.v1 + * @classdesc Represents a RecipeList. + * @implements IRecipeList + * @constructor + * @param {google.spanner.v1.IRecipeList=} [properties] Properties to set + */ + function RecipeList(properties) { + this.recipe = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RecipeList schemaGeneration. + * @member {Uint8Array} schemaGeneration + * @memberof google.spanner.v1.RecipeList + * @instance + */ + RecipeList.prototype.schemaGeneration = $util.newBuffer([]); + + /** + * RecipeList recipe. + * @member {Array.} recipe + * @memberof google.spanner.v1.RecipeList + * @instance + */ + RecipeList.prototype.recipe = $util.emptyArray; + + /** + * Creates a new RecipeList instance using the specified properties. + * @function create + * @memberof google.spanner.v1.RecipeList + * @static + * @param {google.spanner.v1.IRecipeList=} [properties] Properties to set + * @returns {google.spanner.v1.RecipeList} RecipeList instance + */ + RecipeList.create = function create(properties) { + return new RecipeList(properties); + }; + + /** + * Encodes the specified RecipeList message. Does not implicitly {@link google.spanner.v1.RecipeList.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.RecipeList + * @static + * @param {google.spanner.v1.IRecipeList} message RecipeList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RecipeList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.schemaGeneration != null && Object.hasOwnProperty.call(message, "schemaGeneration")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.schemaGeneration); + if (message.recipe != null && message.recipe.length) + for (var i = 0; i < message.recipe.length; ++i) + $root.google.spanner.v1.KeyRecipe.encode(message.recipe[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RecipeList message, length delimited. Does not implicitly {@link google.spanner.v1.RecipeList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.RecipeList + * @static + * @param {google.spanner.v1.IRecipeList} message RecipeList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RecipeList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RecipeList message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.RecipeList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.RecipeList} RecipeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RecipeList.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.RecipeList(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.schemaGeneration = reader.bytes(); + break; + } + case 3: { + if (!(message.recipe && message.recipe.length)) + message.recipe = []; + message.recipe.push($root.google.spanner.v1.KeyRecipe.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RecipeList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.RecipeList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.RecipeList} RecipeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RecipeList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RecipeList message. + * @function verify + * @memberof google.spanner.v1.RecipeList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RecipeList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.schemaGeneration != null && message.hasOwnProperty("schemaGeneration")) + if (!(message.schemaGeneration && typeof message.schemaGeneration.length === "number" || $util.isString(message.schemaGeneration))) + return "schemaGeneration: buffer expected"; + if (message.recipe != null && message.hasOwnProperty("recipe")) { + if (!Array.isArray(message.recipe)) + return "recipe: array expected"; + for (var i = 0; i < message.recipe.length; ++i) { + var error = $root.google.spanner.v1.KeyRecipe.verify(message.recipe[i]); + if (error) + return "recipe." + error; + } + } + return null; + }; + + /** + * Creates a RecipeList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.RecipeList + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.RecipeList} RecipeList + */ + RecipeList.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.RecipeList) + return object; + var message = new $root.google.spanner.v1.RecipeList(); + if (object.schemaGeneration != null) + if (typeof object.schemaGeneration === "string") + $util.base64.decode(object.schemaGeneration, message.schemaGeneration = $util.newBuffer($util.base64.length(object.schemaGeneration)), 0); + else if (object.schemaGeneration.length >= 0) + message.schemaGeneration = object.schemaGeneration; + if (object.recipe) { + if (!Array.isArray(object.recipe)) + throw TypeError(".google.spanner.v1.RecipeList.recipe: array expected"); + message.recipe = []; + for (var i = 0; i < object.recipe.length; ++i) { + if (typeof object.recipe[i] !== "object") + throw TypeError(".google.spanner.v1.RecipeList.recipe: object expected"); + message.recipe[i] = $root.google.spanner.v1.KeyRecipe.fromObject(object.recipe[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a RecipeList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.RecipeList + * @static + * @param {google.spanner.v1.RecipeList} message RecipeList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RecipeList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.recipe = []; + if (options.defaults) + if (options.bytes === String) + object.schemaGeneration = ""; + else { + object.schemaGeneration = []; + if (options.bytes !== Array) + object.schemaGeneration = $util.newBuffer(object.schemaGeneration); + } + if (message.schemaGeneration != null && message.hasOwnProperty("schemaGeneration")) + object.schemaGeneration = options.bytes === String ? $util.base64.encode(message.schemaGeneration, 0, message.schemaGeneration.length) : options.bytes === Array ? Array.prototype.slice.call(message.schemaGeneration) : message.schemaGeneration; + if (message.recipe && message.recipe.length) { + object.recipe = []; + for (var j = 0; j < message.recipe.length; ++j) + object.recipe[j] = $root.google.spanner.v1.KeyRecipe.toObject(message.recipe[j], options); + } + return object; + }; + + /** + * Converts this RecipeList to JSON. + * @function toJSON + * @memberof google.spanner.v1.RecipeList + * @instance + * @returns {Object.} JSON object + */ + RecipeList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RecipeList + * @function getTypeUrl + * @memberof google.spanner.v1.RecipeList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RecipeList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.RecipeList"; + }; + + return RecipeList; + })(); + + v1.CacheUpdate = (function() { + + /** + * Properties of a CacheUpdate. + * @memberof google.spanner.v1 + * @interface ICacheUpdate + * @property {number|Long|null} [databaseId] CacheUpdate databaseId + * @property {Array.|null} [range] CacheUpdate range + * @property {Array.|null} [group] CacheUpdate group + * @property {google.spanner.v1.IRecipeList|null} [keyRecipes] CacheUpdate keyRecipes + */ + + /** + * Constructs a new CacheUpdate. + * @memberof google.spanner.v1 + * @classdesc Represents a CacheUpdate. + * @implements ICacheUpdate + * @constructor + * @param {google.spanner.v1.ICacheUpdate=} [properties] Properties to set + */ + function CacheUpdate(properties) { + this.range = []; + this.group = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CacheUpdate databaseId. + * @member {number|Long} databaseId + * @memberof google.spanner.v1.CacheUpdate + * @instance + */ + CacheUpdate.prototype.databaseId = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * CacheUpdate range. + * @member {Array.} range + * @memberof google.spanner.v1.CacheUpdate + * @instance + */ + CacheUpdate.prototype.range = $util.emptyArray; + + /** + * CacheUpdate group. + * @member {Array.} group + * @memberof google.spanner.v1.CacheUpdate + * @instance + */ + CacheUpdate.prototype.group = $util.emptyArray; + + /** + * CacheUpdate keyRecipes. + * @member {google.spanner.v1.IRecipeList|null|undefined} keyRecipes + * @memberof google.spanner.v1.CacheUpdate + * @instance + */ + CacheUpdate.prototype.keyRecipes = null; + + /** + * Creates a new CacheUpdate instance using the specified properties. + * @function create + * @memberof google.spanner.v1.CacheUpdate + * @static + * @param {google.spanner.v1.ICacheUpdate=} [properties] Properties to set + * @returns {google.spanner.v1.CacheUpdate} CacheUpdate instance + */ + CacheUpdate.create = function create(properties) { + return new CacheUpdate(properties); + }; + + /** + * Encodes the specified CacheUpdate message. Does not implicitly {@link google.spanner.v1.CacheUpdate.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.CacheUpdate + * @static + * @param {google.spanner.v1.ICacheUpdate} message CacheUpdate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CacheUpdate.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.databaseId != null && Object.hasOwnProperty.call(message, "databaseId")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.databaseId); + if (message.range != null && message.range.length) + for (var i = 0; i < message.range.length; ++i) + $root.google.spanner.v1.Range.encode(message.range[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.group != null && message.group.length) + for (var i = 0; i < message.group.length; ++i) + $root.google.spanner.v1.Group.encode(message.group[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.keyRecipes != null && Object.hasOwnProperty.call(message, "keyRecipes")) + $root.google.spanner.v1.RecipeList.encode(message.keyRecipes, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CacheUpdate message, length delimited. Does not implicitly {@link google.spanner.v1.CacheUpdate.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.CacheUpdate + * @static + * @param {google.spanner.v1.ICacheUpdate} message CacheUpdate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CacheUpdate.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CacheUpdate message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.CacheUpdate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.CacheUpdate} CacheUpdate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CacheUpdate.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.CacheUpdate(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.databaseId = reader.uint64(); + break; + } + case 2: { + if (!(message.range && message.range.length)) + message.range = []; + message.range.push($root.google.spanner.v1.Range.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.group && message.group.length)) + message.group = []; + message.group.push($root.google.spanner.v1.Group.decode(reader, reader.uint32())); + break; + } + case 5: { + message.keyRecipes = $root.google.spanner.v1.RecipeList.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CacheUpdate message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.CacheUpdate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.CacheUpdate} CacheUpdate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CacheUpdate.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CacheUpdate message. + * @function verify + * @memberof google.spanner.v1.CacheUpdate + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CacheUpdate.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.databaseId != null && message.hasOwnProperty("databaseId")) + if (!$util.isInteger(message.databaseId) && !(message.databaseId && $util.isInteger(message.databaseId.low) && $util.isInteger(message.databaseId.high))) + return "databaseId: integer|Long expected"; + if (message.range != null && message.hasOwnProperty("range")) { + if (!Array.isArray(message.range)) + return "range: array expected"; + for (var i = 0; i < message.range.length; ++i) { + var error = $root.google.spanner.v1.Range.verify(message.range[i]); + if (error) + return "range." + error; + } + } + if (message.group != null && message.hasOwnProperty("group")) { + if (!Array.isArray(message.group)) + return "group: array expected"; + for (var i = 0; i < message.group.length; ++i) { + var error = $root.google.spanner.v1.Group.verify(message.group[i]); + if (error) + return "group." + error; + } + } + if (message.keyRecipes != null && message.hasOwnProperty("keyRecipes")) { + var error = $root.google.spanner.v1.RecipeList.verify(message.keyRecipes); + if (error) + return "keyRecipes." + error; + } + return null; + }; + + /** + * Creates a CacheUpdate message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.CacheUpdate + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.CacheUpdate} CacheUpdate + */ + CacheUpdate.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.CacheUpdate) + return object; + var message = new $root.google.spanner.v1.CacheUpdate(); + if (object.databaseId != null) + if ($util.Long) + (message.databaseId = $util.Long.fromValue(object.databaseId)).unsigned = true; + else if (typeof object.databaseId === "string") + message.databaseId = parseInt(object.databaseId, 10); + else if (typeof object.databaseId === "number") + message.databaseId = object.databaseId; + else if (typeof object.databaseId === "object") + message.databaseId = new $util.LongBits(object.databaseId.low >>> 0, object.databaseId.high >>> 0).toNumber(true); + if (object.range) { + if (!Array.isArray(object.range)) + throw TypeError(".google.spanner.v1.CacheUpdate.range: array expected"); + message.range = []; + for (var i = 0; i < object.range.length; ++i) { + if (typeof object.range[i] !== "object") + throw TypeError(".google.spanner.v1.CacheUpdate.range: object expected"); + message.range[i] = $root.google.spanner.v1.Range.fromObject(object.range[i]); + } + } + if (object.group) { + if (!Array.isArray(object.group)) + throw TypeError(".google.spanner.v1.CacheUpdate.group: array expected"); + message.group = []; + for (var i = 0; i < object.group.length; ++i) { + if (typeof object.group[i] !== "object") + throw TypeError(".google.spanner.v1.CacheUpdate.group: object expected"); + message.group[i] = $root.google.spanner.v1.Group.fromObject(object.group[i]); + } + } + if (object.keyRecipes != null) { + if (typeof object.keyRecipes !== "object") + throw TypeError(".google.spanner.v1.CacheUpdate.keyRecipes: object expected"); + message.keyRecipes = $root.google.spanner.v1.RecipeList.fromObject(object.keyRecipes); + } + return message; + }; + + /** + * Creates a plain object from a CacheUpdate message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.CacheUpdate + * @static + * @param {google.spanner.v1.CacheUpdate} message CacheUpdate + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CacheUpdate.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.range = []; + object.group = []; + } + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.databaseId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.databaseId = options.longs === String ? "0" : 0; + object.keyRecipes = null; + } + if (message.databaseId != null && message.hasOwnProperty("databaseId")) + if (typeof message.databaseId === "number") + object.databaseId = options.longs === String ? String(message.databaseId) : message.databaseId; + else + object.databaseId = options.longs === String ? $util.Long.prototype.toString.call(message.databaseId) : options.longs === Number ? new $util.LongBits(message.databaseId.low >>> 0, message.databaseId.high >>> 0).toNumber(true) : message.databaseId; + if (message.range && message.range.length) { + object.range = []; + for (var j = 0; j < message.range.length; ++j) + object.range[j] = $root.google.spanner.v1.Range.toObject(message.range[j], options); + } + if (message.group && message.group.length) { + object.group = []; + for (var j = 0; j < message.group.length; ++j) + object.group[j] = $root.google.spanner.v1.Group.toObject(message.group[j], options); + } + if (message.keyRecipes != null && message.hasOwnProperty("keyRecipes")) + object.keyRecipes = $root.google.spanner.v1.RecipeList.toObject(message.keyRecipes, options); + return object; + }; + + /** + * Converts this CacheUpdate to JSON. + * @function toJSON + * @memberof google.spanner.v1.CacheUpdate + * @instance + * @returns {Object.} JSON object + */ + CacheUpdate.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CacheUpdate + * @function getTypeUrl + * @memberof google.spanner.v1.CacheUpdate + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CacheUpdate.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.CacheUpdate"; + }; + + return CacheUpdate; + })(); + + v1.RoutingHint = (function() { + + /** + * Properties of a RoutingHint. + * @memberof google.spanner.v1 + * @interface IRoutingHint + * @property {number|Long|null} [operationUid] RoutingHint operationUid + * @property {number|Long|null} [databaseId] RoutingHint databaseId + * @property {Uint8Array|null} [schemaGeneration] RoutingHint schemaGeneration + * @property {Uint8Array|null} [key] RoutingHint key + * @property {Uint8Array|null} [limitKey] RoutingHint limitKey + * @property {number|Long|null} [groupUid] RoutingHint groupUid + * @property {number|Long|null} [splitId] RoutingHint splitId + * @property {number|Long|null} [tabletUid] RoutingHint tabletUid + * @property {Array.|null} [skippedTabletUid] RoutingHint skippedTabletUid + * @property {string|null} [clientLocation] RoutingHint clientLocation + */ + + /** + * Constructs a new RoutingHint. + * @memberof google.spanner.v1 + * @classdesc Represents a RoutingHint. + * @implements IRoutingHint + * @constructor + * @param {google.spanner.v1.IRoutingHint=} [properties] Properties to set + */ + function RoutingHint(properties) { + this.skippedTabletUid = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RoutingHint operationUid. + * @member {number|Long} operationUid + * @memberof google.spanner.v1.RoutingHint + * @instance + */ + RoutingHint.prototype.operationUid = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * RoutingHint databaseId. + * @member {number|Long} databaseId + * @memberof google.spanner.v1.RoutingHint + * @instance + */ + RoutingHint.prototype.databaseId = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * RoutingHint schemaGeneration. + * @member {Uint8Array} schemaGeneration + * @memberof google.spanner.v1.RoutingHint + * @instance + */ + RoutingHint.prototype.schemaGeneration = $util.newBuffer([]); + + /** + * RoutingHint key. + * @member {Uint8Array} key + * @memberof google.spanner.v1.RoutingHint + * @instance + */ + RoutingHint.prototype.key = $util.newBuffer([]); + + /** + * RoutingHint limitKey. + * @member {Uint8Array} limitKey + * @memberof google.spanner.v1.RoutingHint + * @instance + */ + RoutingHint.prototype.limitKey = $util.newBuffer([]); + + /** + * RoutingHint groupUid. + * @member {number|Long} groupUid + * @memberof google.spanner.v1.RoutingHint + * @instance + */ + RoutingHint.prototype.groupUid = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * RoutingHint splitId. + * @member {number|Long} splitId + * @memberof google.spanner.v1.RoutingHint + * @instance + */ + RoutingHint.prototype.splitId = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * RoutingHint tabletUid. + * @member {number|Long} tabletUid + * @memberof google.spanner.v1.RoutingHint + * @instance + */ + RoutingHint.prototype.tabletUid = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * RoutingHint skippedTabletUid. + * @member {Array.} skippedTabletUid + * @memberof google.spanner.v1.RoutingHint + * @instance + */ + RoutingHint.prototype.skippedTabletUid = $util.emptyArray; + + /** + * RoutingHint clientLocation. + * @member {string} clientLocation + * @memberof google.spanner.v1.RoutingHint + * @instance + */ + RoutingHint.prototype.clientLocation = ""; + + /** + * Creates a new RoutingHint instance using the specified properties. + * @function create + * @memberof google.spanner.v1.RoutingHint + * @static + * @param {google.spanner.v1.IRoutingHint=} [properties] Properties to set + * @returns {google.spanner.v1.RoutingHint} RoutingHint instance + */ + RoutingHint.create = function create(properties) { + return new RoutingHint(properties); + }; + + /** + * Encodes the specified RoutingHint message. Does not implicitly {@link google.spanner.v1.RoutingHint.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.RoutingHint + * @static + * @param {google.spanner.v1.IRoutingHint} message RoutingHint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoutingHint.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.operationUid != null && Object.hasOwnProperty.call(message, "operationUid")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.operationUid); + if (message.databaseId != null && Object.hasOwnProperty.call(message, "databaseId")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.databaseId); + if (message.schemaGeneration != null && Object.hasOwnProperty.call(message, "schemaGeneration")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.schemaGeneration); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.key); + if (message.limitKey != null && Object.hasOwnProperty.call(message, "limitKey")) + writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.limitKey); + if (message.groupUid != null && Object.hasOwnProperty.call(message, "groupUid")) + writer.uint32(/* id 6, wireType 0 =*/48).uint64(message.groupUid); + if (message.splitId != null && Object.hasOwnProperty.call(message, "splitId")) + writer.uint32(/* id 7, wireType 0 =*/56).uint64(message.splitId); + if (message.tabletUid != null && Object.hasOwnProperty.call(message, "tabletUid")) + writer.uint32(/* id 8, wireType 0 =*/64).uint64(message.tabletUid); + if (message.skippedTabletUid != null && message.skippedTabletUid.length) + for (var i = 0; i < message.skippedTabletUid.length; ++i) + $root.google.spanner.v1.RoutingHint.SkippedTablet.encode(message.skippedTabletUid[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.clientLocation != null && Object.hasOwnProperty.call(message, "clientLocation")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.clientLocation); + return writer; + }; + + /** + * Encodes the specified RoutingHint message, length delimited. Does not implicitly {@link google.spanner.v1.RoutingHint.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.RoutingHint + * @static + * @param {google.spanner.v1.IRoutingHint} message RoutingHint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoutingHint.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RoutingHint message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.RoutingHint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.RoutingHint} RoutingHint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoutingHint.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.RoutingHint(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.operationUid = reader.uint64(); + break; + } + case 2: { + message.databaseId = reader.uint64(); + break; + } + case 3: { + message.schemaGeneration = reader.bytes(); + break; + } + case 4: { + message.key = reader.bytes(); + break; + } + case 5: { + message.limitKey = reader.bytes(); + break; + } + case 6: { + message.groupUid = reader.uint64(); + break; + } + case 7: { + message.splitId = reader.uint64(); + break; + } + case 8: { + message.tabletUid = reader.uint64(); + break; + } + case 9: { + if (!(message.skippedTabletUid && message.skippedTabletUid.length)) + message.skippedTabletUid = []; + message.skippedTabletUid.push($root.google.spanner.v1.RoutingHint.SkippedTablet.decode(reader, reader.uint32())); + break; + } + case 10: { + message.clientLocation = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RoutingHint message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.RoutingHint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.RoutingHint} RoutingHint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoutingHint.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RoutingHint message. + * @function verify + * @memberof google.spanner.v1.RoutingHint + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RoutingHint.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.operationUid != null && message.hasOwnProperty("operationUid")) + if (!$util.isInteger(message.operationUid) && !(message.operationUid && $util.isInteger(message.operationUid.low) && $util.isInteger(message.operationUid.high))) + return "operationUid: integer|Long expected"; + if (message.databaseId != null && message.hasOwnProperty("databaseId")) + if (!$util.isInteger(message.databaseId) && !(message.databaseId && $util.isInteger(message.databaseId.low) && $util.isInteger(message.databaseId.high))) + return "databaseId: integer|Long expected"; + if (message.schemaGeneration != null && message.hasOwnProperty("schemaGeneration")) + if (!(message.schemaGeneration && typeof message.schemaGeneration.length === "number" || $util.isString(message.schemaGeneration))) + return "schemaGeneration: buffer expected"; + if (message.key != null && message.hasOwnProperty("key")) + if (!(message.key && typeof message.key.length === "number" || $util.isString(message.key))) + return "key: buffer expected"; + if (message.limitKey != null && message.hasOwnProperty("limitKey")) + if (!(message.limitKey && typeof message.limitKey.length === "number" || $util.isString(message.limitKey))) + return "limitKey: buffer expected"; + if (message.groupUid != null && message.hasOwnProperty("groupUid")) + if (!$util.isInteger(message.groupUid) && !(message.groupUid && $util.isInteger(message.groupUid.low) && $util.isInteger(message.groupUid.high))) + return "groupUid: integer|Long expected"; + if (message.splitId != null && message.hasOwnProperty("splitId")) + if (!$util.isInteger(message.splitId) && !(message.splitId && $util.isInteger(message.splitId.low) && $util.isInteger(message.splitId.high))) + return "splitId: integer|Long expected"; + if (message.tabletUid != null && message.hasOwnProperty("tabletUid")) + if (!$util.isInteger(message.tabletUid) && !(message.tabletUid && $util.isInteger(message.tabletUid.low) && $util.isInteger(message.tabletUid.high))) + return "tabletUid: integer|Long expected"; + if (message.skippedTabletUid != null && message.hasOwnProperty("skippedTabletUid")) { + if (!Array.isArray(message.skippedTabletUid)) + return "skippedTabletUid: array expected"; + for (var i = 0; i < message.skippedTabletUid.length; ++i) { + var error = $root.google.spanner.v1.RoutingHint.SkippedTablet.verify(message.skippedTabletUid[i]); + if (error) + return "skippedTabletUid." + error; + } + } + if (message.clientLocation != null && message.hasOwnProperty("clientLocation")) + if (!$util.isString(message.clientLocation)) + return "clientLocation: string expected"; + return null; + }; + + /** + * Creates a RoutingHint message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.RoutingHint + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.RoutingHint} RoutingHint + */ + RoutingHint.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.RoutingHint) + return object; + var message = new $root.google.spanner.v1.RoutingHint(); + if (object.operationUid != null) + if ($util.Long) + (message.operationUid = $util.Long.fromValue(object.operationUid)).unsigned = true; + else if (typeof object.operationUid === "string") + message.operationUid = parseInt(object.operationUid, 10); + else if (typeof object.operationUid === "number") + message.operationUid = object.operationUid; + else if (typeof object.operationUid === "object") + message.operationUid = new $util.LongBits(object.operationUid.low >>> 0, object.operationUid.high >>> 0).toNumber(true); + if (object.databaseId != null) + if ($util.Long) + (message.databaseId = $util.Long.fromValue(object.databaseId)).unsigned = true; + else if (typeof object.databaseId === "string") + message.databaseId = parseInt(object.databaseId, 10); + else if (typeof object.databaseId === "number") + message.databaseId = object.databaseId; + else if (typeof object.databaseId === "object") + message.databaseId = new $util.LongBits(object.databaseId.low >>> 0, object.databaseId.high >>> 0).toNumber(true); + if (object.schemaGeneration != null) + if (typeof object.schemaGeneration === "string") + $util.base64.decode(object.schemaGeneration, message.schemaGeneration = $util.newBuffer($util.base64.length(object.schemaGeneration)), 0); + else if (object.schemaGeneration.length >= 0) + message.schemaGeneration = object.schemaGeneration; + if (object.key != null) + if (typeof object.key === "string") + $util.base64.decode(object.key, message.key = $util.newBuffer($util.base64.length(object.key)), 0); + else if (object.key.length >= 0) + message.key = object.key; + if (object.limitKey != null) + if (typeof object.limitKey === "string") + $util.base64.decode(object.limitKey, message.limitKey = $util.newBuffer($util.base64.length(object.limitKey)), 0); + else if (object.limitKey.length >= 0) + message.limitKey = object.limitKey; + if (object.groupUid != null) + if ($util.Long) + (message.groupUid = $util.Long.fromValue(object.groupUid)).unsigned = true; + else if (typeof object.groupUid === "string") + message.groupUid = parseInt(object.groupUid, 10); + else if (typeof object.groupUid === "number") + message.groupUid = object.groupUid; + else if (typeof object.groupUid === "object") + message.groupUid = new $util.LongBits(object.groupUid.low >>> 0, object.groupUid.high >>> 0).toNumber(true); + if (object.splitId != null) + if ($util.Long) + (message.splitId = $util.Long.fromValue(object.splitId)).unsigned = true; + else if (typeof object.splitId === "string") + message.splitId = parseInt(object.splitId, 10); + else if (typeof object.splitId === "number") + message.splitId = object.splitId; + else if (typeof object.splitId === "object") + message.splitId = new $util.LongBits(object.splitId.low >>> 0, object.splitId.high >>> 0).toNumber(true); + if (object.tabletUid != null) + if ($util.Long) + (message.tabletUid = $util.Long.fromValue(object.tabletUid)).unsigned = true; + else if (typeof object.tabletUid === "string") + message.tabletUid = parseInt(object.tabletUid, 10); + else if (typeof object.tabletUid === "number") + message.tabletUid = object.tabletUid; + else if (typeof object.tabletUid === "object") + message.tabletUid = new $util.LongBits(object.tabletUid.low >>> 0, object.tabletUid.high >>> 0).toNumber(true); + if (object.skippedTabletUid) { + if (!Array.isArray(object.skippedTabletUid)) + throw TypeError(".google.spanner.v1.RoutingHint.skippedTabletUid: array expected"); + message.skippedTabletUid = []; + for (var i = 0; i < object.skippedTabletUid.length; ++i) { + if (typeof object.skippedTabletUid[i] !== "object") + throw TypeError(".google.spanner.v1.RoutingHint.skippedTabletUid: object expected"); + message.skippedTabletUid[i] = $root.google.spanner.v1.RoutingHint.SkippedTablet.fromObject(object.skippedTabletUid[i]); + } + } + if (object.clientLocation != null) + message.clientLocation = String(object.clientLocation); + return message; + }; + + /** + * Creates a plain object from a RoutingHint message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.RoutingHint + * @static + * @param {google.spanner.v1.RoutingHint} message RoutingHint + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RoutingHint.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.skippedTabletUid = []; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.operationUid = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.operationUid = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.databaseId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.databaseId = options.longs === String ? "0" : 0; + if (options.bytes === String) + object.schemaGeneration = ""; + else { + object.schemaGeneration = []; + if (options.bytes !== Array) + object.schemaGeneration = $util.newBuffer(object.schemaGeneration); + } + if (options.bytes === String) + object.key = ""; + else { + object.key = []; + if (options.bytes !== Array) + object.key = $util.newBuffer(object.key); + } + if (options.bytes === String) + object.limitKey = ""; + else { + object.limitKey = []; + if (options.bytes !== Array) + object.limitKey = $util.newBuffer(object.limitKey); + } + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.groupUid = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.groupUid = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.splitId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.splitId = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.tabletUid = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.tabletUid = options.longs === String ? "0" : 0; + object.clientLocation = ""; + } + if (message.operationUid != null && message.hasOwnProperty("operationUid")) + if (typeof message.operationUid === "number") + object.operationUid = options.longs === String ? String(message.operationUid) : message.operationUid; + else + object.operationUid = options.longs === String ? $util.Long.prototype.toString.call(message.operationUid) : options.longs === Number ? new $util.LongBits(message.operationUid.low >>> 0, message.operationUid.high >>> 0).toNumber(true) : message.operationUid; + if (message.databaseId != null && message.hasOwnProperty("databaseId")) + if (typeof message.databaseId === "number") + object.databaseId = options.longs === String ? String(message.databaseId) : message.databaseId; + else + object.databaseId = options.longs === String ? $util.Long.prototype.toString.call(message.databaseId) : options.longs === Number ? new $util.LongBits(message.databaseId.low >>> 0, message.databaseId.high >>> 0).toNumber(true) : message.databaseId; + if (message.schemaGeneration != null && message.hasOwnProperty("schemaGeneration")) + object.schemaGeneration = options.bytes === String ? $util.base64.encode(message.schemaGeneration, 0, message.schemaGeneration.length) : options.bytes === Array ? Array.prototype.slice.call(message.schemaGeneration) : message.schemaGeneration; + if (message.key != null && message.hasOwnProperty("key")) + object.key = options.bytes === String ? $util.base64.encode(message.key, 0, message.key.length) : options.bytes === Array ? Array.prototype.slice.call(message.key) : message.key; + if (message.limitKey != null && message.hasOwnProperty("limitKey")) + object.limitKey = options.bytes === String ? $util.base64.encode(message.limitKey, 0, message.limitKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.limitKey) : message.limitKey; + if (message.groupUid != null && message.hasOwnProperty("groupUid")) + if (typeof message.groupUid === "number") + object.groupUid = options.longs === String ? String(message.groupUid) : message.groupUid; + else + object.groupUid = options.longs === String ? $util.Long.prototype.toString.call(message.groupUid) : options.longs === Number ? new $util.LongBits(message.groupUid.low >>> 0, message.groupUid.high >>> 0).toNumber(true) : message.groupUid; + if (message.splitId != null && message.hasOwnProperty("splitId")) + if (typeof message.splitId === "number") + object.splitId = options.longs === String ? String(message.splitId) : message.splitId; + else + object.splitId = options.longs === String ? $util.Long.prototype.toString.call(message.splitId) : options.longs === Number ? new $util.LongBits(message.splitId.low >>> 0, message.splitId.high >>> 0).toNumber(true) : message.splitId; + if (message.tabletUid != null && message.hasOwnProperty("tabletUid")) + if (typeof message.tabletUid === "number") + object.tabletUid = options.longs === String ? String(message.tabletUid) : message.tabletUid; + else + object.tabletUid = options.longs === String ? $util.Long.prototype.toString.call(message.tabletUid) : options.longs === Number ? new $util.LongBits(message.tabletUid.low >>> 0, message.tabletUid.high >>> 0).toNumber(true) : message.tabletUid; + if (message.skippedTabletUid && message.skippedTabletUid.length) { + object.skippedTabletUid = []; + for (var j = 0; j < message.skippedTabletUid.length; ++j) + object.skippedTabletUid[j] = $root.google.spanner.v1.RoutingHint.SkippedTablet.toObject(message.skippedTabletUid[j], options); + } + if (message.clientLocation != null && message.hasOwnProperty("clientLocation")) + object.clientLocation = message.clientLocation; + return object; + }; + + /** + * Converts this RoutingHint to JSON. + * @function toJSON + * @memberof google.spanner.v1.RoutingHint + * @instance + * @returns {Object.} JSON object + */ + RoutingHint.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RoutingHint + * @function getTypeUrl + * @memberof google.spanner.v1.RoutingHint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RoutingHint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.RoutingHint"; + }; + + RoutingHint.SkippedTablet = (function() { + + /** + * Properties of a SkippedTablet. + * @memberof google.spanner.v1.RoutingHint + * @interface ISkippedTablet + * @property {number|Long|null} [tabletUid] SkippedTablet tabletUid + * @property {Uint8Array|null} [incarnation] SkippedTablet incarnation + */ + + /** + * Constructs a new SkippedTablet. + * @memberof google.spanner.v1.RoutingHint + * @classdesc Represents a SkippedTablet. + * @implements ISkippedTablet + * @constructor + * @param {google.spanner.v1.RoutingHint.ISkippedTablet=} [properties] Properties to set + */ + function SkippedTablet(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SkippedTablet tabletUid. + * @member {number|Long} tabletUid + * @memberof google.spanner.v1.RoutingHint.SkippedTablet + * @instance + */ + SkippedTablet.prototype.tabletUid = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * SkippedTablet incarnation. + * @member {Uint8Array} incarnation + * @memberof google.spanner.v1.RoutingHint.SkippedTablet + * @instance + */ + SkippedTablet.prototype.incarnation = $util.newBuffer([]); + + /** + * Creates a new SkippedTablet instance using the specified properties. + * @function create + * @memberof google.spanner.v1.RoutingHint.SkippedTablet + * @static + * @param {google.spanner.v1.RoutingHint.ISkippedTablet=} [properties] Properties to set + * @returns {google.spanner.v1.RoutingHint.SkippedTablet} SkippedTablet instance + */ + SkippedTablet.create = function create(properties) { + return new SkippedTablet(properties); + }; + + /** + * Encodes the specified SkippedTablet message. Does not implicitly {@link google.spanner.v1.RoutingHint.SkippedTablet.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.RoutingHint.SkippedTablet + * @static + * @param {google.spanner.v1.RoutingHint.ISkippedTablet} message SkippedTablet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SkippedTablet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tabletUid != null && Object.hasOwnProperty.call(message, "tabletUid")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.tabletUid); + if (message.incarnation != null && Object.hasOwnProperty.call(message, "incarnation")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.incarnation); + return writer; + }; + + /** + * Encodes the specified SkippedTablet message, length delimited. Does not implicitly {@link google.spanner.v1.RoutingHint.SkippedTablet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.RoutingHint.SkippedTablet + * @static + * @param {google.spanner.v1.RoutingHint.ISkippedTablet} message SkippedTablet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SkippedTablet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SkippedTablet message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.RoutingHint.SkippedTablet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.RoutingHint.SkippedTablet} SkippedTablet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SkippedTablet.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.RoutingHint.SkippedTablet(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.tabletUid = reader.uint64(); + break; + } + case 2: { + message.incarnation = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SkippedTablet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.RoutingHint.SkippedTablet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.RoutingHint.SkippedTablet} SkippedTablet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SkippedTablet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SkippedTablet message. + * @function verify + * @memberof google.spanner.v1.RoutingHint.SkippedTablet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SkippedTablet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tabletUid != null && message.hasOwnProperty("tabletUid")) + if (!$util.isInteger(message.tabletUid) && !(message.tabletUid && $util.isInteger(message.tabletUid.low) && $util.isInteger(message.tabletUid.high))) + return "tabletUid: integer|Long expected"; + if (message.incarnation != null && message.hasOwnProperty("incarnation")) + if (!(message.incarnation && typeof message.incarnation.length === "number" || $util.isString(message.incarnation))) + return "incarnation: buffer expected"; + return null; + }; + + /** + * Creates a SkippedTablet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.RoutingHint.SkippedTablet + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.RoutingHint.SkippedTablet} SkippedTablet + */ + SkippedTablet.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.RoutingHint.SkippedTablet) + return object; + var message = new $root.google.spanner.v1.RoutingHint.SkippedTablet(); + if (object.tabletUid != null) + if ($util.Long) + (message.tabletUid = $util.Long.fromValue(object.tabletUid)).unsigned = true; + else if (typeof object.tabletUid === "string") + message.tabletUid = parseInt(object.tabletUid, 10); + else if (typeof object.tabletUid === "number") + message.tabletUid = object.tabletUid; + else if (typeof object.tabletUid === "object") + message.tabletUid = new $util.LongBits(object.tabletUid.low >>> 0, object.tabletUid.high >>> 0).toNumber(true); + if (object.incarnation != null) + if (typeof object.incarnation === "string") + $util.base64.decode(object.incarnation, message.incarnation = $util.newBuffer($util.base64.length(object.incarnation)), 0); + else if (object.incarnation.length >= 0) + message.incarnation = object.incarnation; + return message; + }; + + /** + * Creates a plain object from a SkippedTablet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.RoutingHint.SkippedTablet + * @static + * @param {google.spanner.v1.RoutingHint.SkippedTablet} message SkippedTablet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SkippedTablet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.tabletUid = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.tabletUid = options.longs === String ? "0" : 0; + if (options.bytes === String) + object.incarnation = ""; + else { + object.incarnation = []; + if (options.bytes !== Array) + object.incarnation = $util.newBuffer(object.incarnation); + } + } + if (message.tabletUid != null && message.hasOwnProperty("tabletUid")) + if (typeof message.tabletUid === "number") + object.tabletUid = options.longs === String ? String(message.tabletUid) : message.tabletUid; + else + object.tabletUid = options.longs === String ? $util.Long.prototype.toString.call(message.tabletUid) : options.longs === Number ? new $util.LongBits(message.tabletUid.low >>> 0, message.tabletUid.high >>> 0).toNumber(true) : message.tabletUid; + if (message.incarnation != null && message.hasOwnProperty("incarnation")) + object.incarnation = options.bytes === String ? $util.base64.encode(message.incarnation, 0, message.incarnation.length) : options.bytes === Array ? Array.prototype.slice.call(message.incarnation) : message.incarnation; + return object; + }; + + /** + * Converts this SkippedTablet to JSON. + * @function toJSON + * @memberof google.spanner.v1.RoutingHint.SkippedTablet + * @instance + * @returns {Object.} JSON object + */ + SkippedTablet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SkippedTablet + * @function getTypeUrl + * @memberof google.spanner.v1.RoutingHint.SkippedTablet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SkippedTablet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.RoutingHint.SkippedTablet"; + }; + + return SkippedTablet; + })(); + + return RoutingHint; + })(); + + v1.Type = (function() { + + /** + * Properties of a Type. + * @memberof google.spanner.v1 + * @interface IType + * @property {google.spanner.v1.TypeCode|null} [code] Type code + * @property {google.spanner.v1.IType|null} [arrayElementType] Type arrayElementType + * @property {google.spanner.v1.IStructType|null} [structType] Type structType + * @property {google.spanner.v1.TypeAnnotationCode|null} [typeAnnotation] Type typeAnnotation + * @property {string|null} [protoTypeFqn] Type protoTypeFqn + */ + + /** + * Constructs a new Type. + * @memberof google.spanner.v1 + * @classdesc Represents a Type. + * @implements IType + * @constructor + * @param {google.spanner.v1.IType=} [properties] Properties to set + */ + function Type(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Type code. + * @member {google.spanner.v1.TypeCode} code + * @memberof google.spanner.v1.Type + * @instance + */ + Type.prototype.code = 0; + + /** + * Type arrayElementType. + * @member {google.spanner.v1.IType|null|undefined} arrayElementType + * @memberof google.spanner.v1.Type + * @instance + */ + Type.prototype.arrayElementType = null; + + /** + * Type structType. + * @member {google.spanner.v1.IStructType|null|undefined} structType + * @memberof google.spanner.v1.Type + * @instance + */ + Type.prototype.structType = null; + + /** + * Type typeAnnotation. + * @member {google.spanner.v1.TypeAnnotationCode} typeAnnotation + * @memberof google.spanner.v1.Type + * @instance + */ + Type.prototype.typeAnnotation = 0; + + /** + * Type protoTypeFqn. + * @member {string} protoTypeFqn + * @memberof google.spanner.v1.Type + * @instance + */ + Type.prototype.protoTypeFqn = ""; + + /** + * Creates a new Type instance using the specified properties. + * @function create + * @memberof google.spanner.v1.Type + * @static + * @param {google.spanner.v1.IType=} [properties] Properties to set + * @returns {google.spanner.v1.Type} Type instance + */ + Type.create = function create(properties) { + return new Type(properties); + }; + + /** + * Encodes the specified Type message. Does not implicitly {@link google.spanner.v1.Type.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.Type + * @static + * @param {google.spanner.v1.IType} message Type message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Type.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); + if (message.arrayElementType != null && Object.hasOwnProperty.call(message, "arrayElementType")) + $root.google.spanner.v1.Type.encode(message.arrayElementType, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.structType != null && Object.hasOwnProperty.call(message, "structType")) + $root.google.spanner.v1.StructType.encode(message.structType, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.typeAnnotation != null && Object.hasOwnProperty.call(message, "typeAnnotation")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.typeAnnotation); + if (message.protoTypeFqn != null && Object.hasOwnProperty.call(message, "protoTypeFqn")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.protoTypeFqn); + return writer; + }; + + /** + * Encodes the specified Type message, length delimited. Does not implicitly {@link google.spanner.v1.Type.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.Type + * @static + * @param {google.spanner.v1.IType} message Type message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Type.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Type message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.Type + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.Type} Type + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Type.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.Type(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.code = reader.int32(); + break; + } + case 2: { + message.arrayElementType = $root.google.spanner.v1.Type.decode(reader, reader.uint32()); + break; + } + case 3: { + message.structType = $root.google.spanner.v1.StructType.decode(reader, reader.uint32()); + break; + } + case 4: { + message.typeAnnotation = reader.int32(); + break; + } + case 5: { + message.protoTypeFqn = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Type message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.Type + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.Type} Type + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Type.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Type message. + * @function verify + * @memberof google.spanner.v1.Type + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Type.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + switch (message.code) { + default: + return "code: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 15: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 13: + case 14: + case 16: + case 17: + break; + } + if (message.arrayElementType != null && message.hasOwnProperty("arrayElementType")) { + var error = $root.google.spanner.v1.Type.verify(message.arrayElementType); + if (error) + return "arrayElementType." + error; + } + if (message.structType != null && message.hasOwnProperty("structType")) { + var error = $root.google.spanner.v1.StructType.verify(message.structType); + if (error) + return "structType." + error; + } + if (message.typeAnnotation != null && message.hasOwnProperty("typeAnnotation")) + switch (message.typeAnnotation) { + default: + return "typeAnnotation: enum value expected"; + case 0: + case 2: + case 3: + case 4: + break; + } + if (message.protoTypeFqn != null && message.hasOwnProperty("protoTypeFqn")) + if (!$util.isString(message.protoTypeFqn)) + return "protoTypeFqn: string expected"; + return null; + }; + + /** + * Creates a Type message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.Type + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.Type} Type + */ + Type.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.Type) + return object; + var message = new $root.google.spanner.v1.Type(); + switch (object.code) { + default: + if (typeof object.code === "number") { + message.code = object.code; + break; + } + break; + case "TYPE_CODE_UNSPECIFIED": + case 0: + message.code = 0; + break; + case "BOOL": + case 1: + message.code = 1; + break; + case "INT64": + case 2: + message.code = 2; + break; + case "FLOAT64": + case 3: + message.code = 3; + break; + case "FLOAT32": + case 15: + message.code = 15; + break; + case "TIMESTAMP": + case 4: + message.code = 4; + break; + case "DATE": + case 5: + message.code = 5; + break; + case "STRING": + case 6: + message.code = 6; + break; + case "BYTES": + case 7: + message.code = 7; + break; + case "ARRAY": + case 8: + message.code = 8; + break; + case "STRUCT": + case 9: + message.code = 9; + break; + case "NUMERIC": + case 10: + message.code = 10; + break; + case "JSON": + case 11: + message.code = 11; + break; + case "PROTO": + case 13: + message.code = 13; + break; + case "ENUM": + case 14: + message.code = 14; + break; + case "INTERVAL": + case 16: + message.code = 16; + break; + case "UUID": + case 17: + message.code = 17; + break; + } + if (object.arrayElementType != null) { + if (typeof object.arrayElementType !== "object") + throw TypeError(".google.spanner.v1.Type.arrayElementType: object expected"); + message.arrayElementType = $root.google.spanner.v1.Type.fromObject(object.arrayElementType); + } + if (object.structType != null) { + if (typeof object.structType !== "object") + throw TypeError(".google.spanner.v1.Type.structType: object expected"); + message.structType = $root.google.spanner.v1.StructType.fromObject(object.structType); + } + switch (object.typeAnnotation) { + default: + if (typeof object.typeAnnotation === "number") { + message.typeAnnotation = object.typeAnnotation; + break; + } + break; + case "TYPE_ANNOTATION_CODE_UNSPECIFIED": + case 0: + message.typeAnnotation = 0; + break; + case "PG_NUMERIC": + case 2: + message.typeAnnotation = 2; + break; + case "PG_JSONB": + case 3: + message.typeAnnotation = 3; + break; + case "PG_OID": + case 4: + message.typeAnnotation = 4; + break; + } + if (object.protoTypeFqn != null) + message.protoTypeFqn = String(object.protoTypeFqn); + return message; + }; + + /** + * Creates a plain object from a Type message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.Type + * @static + * @param {google.spanner.v1.Type} message Type + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Type.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.code = options.enums === String ? "TYPE_CODE_UNSPECIFIED" : 0; + object.arrayElementType = null; + object.structType = null; + object.typeAnnotation = options.enums === String ? "TYPE_ANNOTATION_CODE_UNSPECIFIED" : 0; + object.protoTypeFqn = ""; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = options.enums === String ? $root.google.spanner.v1.TypeCode[message.code] === undefined ? message.code : $root.google.spanner.v1.TypeCode[message.code] : message.code; + if (message.arrayElementType != null && message.hasOwnProperty("arrayElementType")) + object.arrayElementType = $root.google.spanner.v1.Type.toObject(message.arrayElementType, options); + if (message.structType != null && message.hasOwnProperty("structType")) + object.structType = $root.google.spanner.v1.StructType.toObject(message.structType, options); + if (message.typeAnnotation != null && message.hasOwnProperty("typeAnnotation")) + object.typeAnnotation = options.enums === String ? $root.google.spanner.v1.TypeAnnotationCode[message.typeAnnotation] === undefined ? message.typeAnnotation : $root.google.spanner.v1.TypeAnnotationCode[message.typeAnnotation] : message.typeAnnotation; + if (message.protoTypeFqn != null && message.hasOwnProperty("protoTypeFqn")) + object.protoTypeFqn = message.protoTypeFqn; + return object; + }; + + /** + * Converts this Type to JSON. + * @function toJSON + * @memberof google.spanner.v1.Type + * @instance + * @returns {Object.} JSON object + */ + Type.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Type + * @function getTypeUrl + * @memberof google.spanner.v1.Type + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Type.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.Type"; + }; + + return Type; + })(); + + v1.StructType = (function() { + + /** + * Properties of a StructType. + * @memberof google.spanner.v1 + * @interface IStructType + * @property {Array.|null} [fields] StructType fields + */ + + /** + * Constructs a new StructType. + * @memberof google.spanner.v1 + * @classdesc Represents a StructType. + * @implements IStructType + * @constructor + * @param {google.spanner.v1.IStructType=} [properties] Properties to set + */ + function StructType(properties) { + this.fields = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StructType fields. + * @member {Array.} fields + * @memberof google.spanner.v1.StructType + * @instance + */ + StructType.prototype.fields = $util.emptyArray; + + /** + * Creates a new StructType instance using the specified properties. + * @function create + * @memberof google.spanner.v1.StructType + * @static + * @param {google.spanner.v1.IStructType=} [properties] Properties to set + * @returns {google.spanner.v1.StructType} StructType instance + */ + StructType.create = function create(properties) { + return new StructType(properties); + }; + + /** + * Encodes the specified StructType message. Does not implicitly {@link google.spanner.v1.StructType.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.StructType + * @static + * @param {google.spanner.v1.IStructType} message StructType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StructType.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fields != null && message.fields.length) + for (var i = 0; i < message.fields.length; ++i) + $root.google.spanner.v1.StructType.Field.encode(message.fields[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified StructType message, length delimited. Does not implicitly {@link google.spanner.v1.StructType.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.StructType + * @static + * @param {google.spanner.v1.IStructType} message StructType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StructType.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StructType message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.StructType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.StructType} StructType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StructType.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.StructType(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.fields && message.fields.length)) + message.fields = []; + message.fields.push($root.google.spanner.v1.StructType.Field.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StructType message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.StructType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.StructType} StructType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StructType.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StructType message. + * @function verify + * @memberof google.spanner.v1.StructType + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StructType.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fields != null && message.hasOwnProperty("fields")) { + if (!Array.isArray(message.fields)) + return "fields: array expected"; + for (var i = 0; i < message.fields.length; ++i) { + var error = $root.google.spanner.v1.StructType.Field.verify(message.fields[i]); + if (error) + return "fields." + error; + } + } + return null; + }; + + /** + * Creates a StructType message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.StructType + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.StructType} StructType + */ + StructType.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.StructType) + return object; + var message = new $root.google.spanner.v1.StructType(); + if (object.fields) { + if (!Array.isArray(object.fields)) + throw TypeError(".google.spanner.v1.StructType.fields: array expected"); + message.fields = []; + for (var i = 0; i < object.fields.length; ++i) { + if (typeof object.fields[i] !== "object") + throw TypeError(".google.spanner.v1.StructType.fields: object expected"); + message.fields[i] = $root.google.spanner.v1.StructType.Field.fromObject(object.fields[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a StructType message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.StructType + * @static + * @param {google.spanner.v1.StructType} message StructType + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StructType.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.fields = []; + if (message.fields && message.fields.length) { + object.fields = []; + for (var j = 0; j < message.fields.length; ++j) + object.fields[j] = $root.google.spanner.v1.StructType.Field.toObject(message.fields[j], options); + } + return object; + }; + + /** + * Converts this StructType to JSON. + * @function toJSON + * @memberof google.spanner.v1.StructType + * @instance + * @returns {Object.} JSON object + */ + StructType.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StructType + * @function getTypeUrl + * @memberof google.spanner.v1.StructType + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StructType.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.StructType"; + }; + + StructType.Field = (function() { + + /** + * Properties of a Field. + * @memberof google.spanner.v1.StructType + * @interface IField + * @property {string|null} [name] Field name + * @property {google.spanner.v1.IType|null} [type] Field type + */ + + /** + * Constructs a new Field. + * @memberof google.spanner.v1.StructType + * @classdesc Represents a Field. + * @implements IField + * @constructor + * @param {google.spanner.v1.StructType.IField=} [properties] Properties to set + */ + function Field(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Field name. + * @member {string} name + * @memberof google.spanner.v1.StructType.Field + * @instance + */ + Field.prototype.name = ""; + + /** + * Field type. + * @member {google.spanner.v1.IType|null|undefined} type + * @memberof google.spanner.v1.StructType.Field + * @instance + */ + Field.prototype.type = null; + + /** + * Creates a new Field instance using the specified properties. + * @function create + * @memberof google.spanner.v1.StructType.Field + * @static + * @param {google.spanner.v1.StructType.IField=} [properties] Properties to set + * @returns {google.spanner.v1.StructType.Field} Field instance + */ + Field.create = function create(properties) { + return new Field(properties); + }; + + /** + * Encodes the specified Field message. Does not implicitly {@link google.spanner.v1.StructType.Field.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.StructType.Field + * @static + * @param {google.spanner.v1.StructType.IField} message Field message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Field.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + $root.google.spanner.v1.Type.encode(message.type, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Field message, length delimited. Does not implicitly {@link google.spanner.v1.StructType.Field.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.StructType.Field + * @static + * @param {google.spanner.v1.StructType.IField} message Field message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Field.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Field message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.StructType.Field + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.StructType.Field} Field + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Field.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.StructType.Field(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.type = $root.google.spanner.v1.Type.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Field message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.StructType.Field + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.StructType.Field} Field + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Field.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Field message. + * @function verify + * @memberof google.spanner.v1.StructType.Field + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Field.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.type != null && message.hasOwnProperty("type")) { + var error = $root.google.spanner.v1.Type.verify(message.type); + if (error) + return "type." + error; + } + return null; + }; + + /** + * Creates a Field message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.StructType.Field + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.StructType.Field} Field + */ + Field.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.StructType.Field) + return object; + var message = new $root.google.spanner.v1.StructType.Field(); + if (object.name != null) + message.name = String(object.name); + if (object.type != null) { + if (typeof object.type !== "object") + throw TypeError(".google.spanner.v1.StructType.Field.type: object expected"); + message.type = $root.google.spanner.v1.Type.fromObject(object.type); + } + return message; + }; + + /** + * Creates a plain object from a Field message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.StructType.Field + * @static + * @param {google.spanner.v1.StructType.Field} message Field + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Field.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.type = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.type != null && message.hasOwnProperty("type")) + object.type = $root.google.spanner.v1.Type.toObject(message.type, options); + return object; + }; + + /** + * Converts this Field to JSON. + * @function toJSON + * @memberof google.spanner.v1.StructType.Field + * @instance + * @returns {Object.} JSON object + */ + Field.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Field + * @function getTypeUrl + * @memberof google.spanner.v1.StructType.Field + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Field.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.StructType.Field"; + }; + + return Field; + })(); + + return StructType; + })(); + + /** + * TypeCode enum. + * @name google.spanner.v1.TypeCode + * @enum {number} + * @property {number} TYPE_CODE_UNSPECIFIED=0 TYPE_CODE_UNSPECIFIED value + * @property {number} BOOL=1 BOOL value + * @property {number} INT64=2 INT64 value + * @property {number} FLOAT64=3 FLOAT64 value + * @property {number} FLOAT32=15 FLOAT32 value + * @property {number} TIMESTAMP=4 TIMESTAMP value + * @property {number} DATE=5 DATE value + * @property {number} STRING=6 STRING value + * @property {number} BYTES=7 BYTES value + * @property {number} ARRAY=8 ARRAY value + * @property {number} STRUCT=9 STRUCT value + * @property {number} NUMERIC=10 NUMERIC value + * @property {number} JSON=11 JSON value + * @property {number} PROTO=13 PROTO value + * @property {number} ENUM=14 ENUM value + * @property {number} INTERVAL=16 INTERVAL value + * @property {number} UUID=17 UUID value + */ + v1.TypeCode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_CODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "BOOL"] = 1; + values[valuesById[2] = "INT64"] = 2; + values[valuesById[3] = "FLOAT64"] = 3; + values[valuesById[15] = "FLOAT32"] = 15; + values[valuesById[4] = "TIMESTAMP"] = 4; + values[valuesById[5] = "DATE"] = 5; + values[valuesById[6] = "STRING"] = 6; + values[valuesById[7] = "BYTES"] = 7; + values[valuesById[8] = "ARRAY"] = 8; + values[valuesById[9] = "STRUCT"] = 9; + values[valuesById[10] = "NUMERIC"] = 10; + values[valuesById[11] = "JSON"] = 11; + values[valuesById[13] = "PROTO"] = 13; + values[valuesById[14] = "ENUM"] = 14; + values[valuesById[16] = "INTERVAL"] = 16; + values[valuesById[17] = "UUID"] = 17; + return values; + })(); + + /** + * TypeAnnotationCode enum. + * @name google.spanner.v1.TypeAnnotationCode + * @enum {number} + * @property {number} TYPE_ANNOTATION_CODE_UNSPECIFIED=0 TYPE_ANNOTATION_CODE_UNSPECIFIED value + * @property {number} PG_NUMERIC=2 PG_NUMERIC value + * @property {number} PG_JSONB=3 PG_JSONB value + * @property {number} PG_OID=4 PG_OID value + */ + v1.TypeAnnotationCode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_ANNOTATION_CODE_UNSPECIFIED"] = 0; + values[valuesById[2] = "PG_NUMERIC"] = 2; + values[valuesById[3] = "PG_JSONB"] = 3; + values[valuesById[4] = "PG_OID"] = 4; + return values; + })(); + + v1.Mutation = (function() { + + /** + * Properties of a Mutation. + * @memberof google.spanner.v1 + * @interface IMutation + * @property {google.spanner.v1.Mutation.IWrite|null} [insert] Mutation insert + * @property {google.spanner.v1.Mutation.IWrite|null} [update] Mutation update + * @property {google.spanner.v1.Mutation.IWrite|null} [insertOrUpdate] Mutation insertOrUpdate + * @property {google.spanner.v1.Mutation.IWrite|null} [replace] Mutation replace + * @property {google.spanner.v1.Mutation.IDelete|null} ["delete"] Mutation delete + * @property {google.spanner.v1.Mutation.ISend|null} [send] Mutation send + * @property {google.spanner.v1.Mutation.IAck|null} [ack] Mutation ack + */ + + /** + * Constructs a new Mutation. + * @memberof google.spanner.v1 + * @classdesc Represents a Mutation. + * @implements IMutation + * @constructor + * @param {google.spanner.v1.IMutation=} [properties] Properties to set + */ + function Mutation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Mutation insert. + * @member {google.spanner.v1.Mutation.IWrite|null|undefined} insert + * @memberof google.spanner.v1.Mutation + * @instance + */ + Mutation.prototype.insert = null; + + /** + * Mutation update. + * @member {google.spanner.v1.Mutation.IWrite|null|undefined} update + * @memberof google.spanner.v1.Mutation + * @instance + */ + Mutation.prototype.update = null; + + /** + * Mutation insertOrUpdate. + * @member {google.spanner.v1.Mutation.IWrite|null|undefined} insertOrUpdate + * @memberof google.spanner.v1.Mutation + * @instance + */ + Mutation.prototype.insertOrUpdate = null; + + /** + * Mutation replace. + * @member {google.spanner.v1.Mutation.IWrite|null|undefined} replace + * @memberof google.spanner.v1.Mutation + * @instance + */ + Mutation.prototype.replace = null; + + /** + * Mutation delete. + * @member {google.spanner.v1.Mutation.IDelete|null|undefined} delete + * @memberof google.spanner.v1.Mutation + * @instance + */ + Mutation.prototype["delete"] = null; + + /** + * Mutation send. + * @member {google.spanner.v1.Mutation.ISend|null|undefined} send + * @memberof google.spanner.v1.Mutation + * @instance + */ + Mutation.prototype.send = null; + + /** + * Mutation ack. + * @member {google.spanner.v1.Mutation.IAck|null|undefined} ack + * @memberof google.spanner.v1.Mutation + * @instance + */ + Mutation.prototype.ack = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Mutation operation. + * @member {"insert"|"update"|"insertOrUpdate"|"replace"|"delete"|"send"|"ack"|undefined} operation + * @memberof google.spanner.v1.Mutation + * @instance + */ + Object.defineProperty(Mutation.prototype, "operation", { + get: $util.oneOfGetter($oneOfFields = ["insert", "update", "insertOrUpdate", "replace", "delete", "send", "ack"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Mutation instance using the specified properties. + * @function create + * @memberof google.spanner.v1.Mutation + * @static + * @param {google.spanner.v1.IMutation=} [properties] Properties to set + * @returns {google.spanner.v1.Mutation} Mutation instance + */ + Mutation.create = function create(properties) { + return new Mutation(properties); + }; + + /** + * Encodes the specified Mutation message. Does not implicitly {@link google.spanner.v1.Mutation.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.Mutation + * @static + * @param {google.spanner.v1.IMutation} message Mutation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Mutation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.insert != null && Object.hasOwnProperty.call(message, "insert")) + $root.google.spanner.v1.Mutation.Write.encode(message.insert, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.update != null && Object.hasOwnProperty.call(message, "update")) + $root.google.spanner.v1.Mutation.Write.encode(message.update, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.insertOrUpdate != null && Object.hasOwnProperty.call(message, "insertOrUpdate")) + $root.google.spanner.v1.Mutation.Write.encode(message.insertOrUpdate, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.replace != null && Object.hasOwnProperty.call(message, "replace")) + $root.google.spanner.v1.Mutation.Write.encode(message.replace, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) + $root.google.spanner.v1.Mutation.Delete.encode(message["delete"], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.send != null && Object.hasOwnProperty.call(message, "send")) + $root.google.spanner.v1.Mutation.Send.encode(message.send, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.ack != null && Object.hasOwnProperty.call(message, "ack")) + $root.google.spanner.v1.Mutation.Ack.encode(message.ack, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Mutation message, length delimited. Does not implicitly {@link google.spanner.v1.Mutation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.Mutation + * @static + * @param {google.spanner.v1.IMutation} message Mutation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Mutation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Mutation message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.Mutation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.Mutation} Mutation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Mutation.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.Mutation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.insert = $root.google.spanner.v1.Mutation.Write.decode(reader, reader.uint32()); + break; + } + case 2: { + message.update = $root.google.spanner.v1.Mutation.Write.decode(reader, reader.uint32()); + break; + } + case 3: { + message.insertOrUpdate = $root.google.spanner.v1.Mutation.Write.decode(reader, reader.uint32()); + break; + } + case 4: { + message.replace = $root.google.spanner.v1.Mutation.Write.decode(reader, reader.uint32()); + break; + } + case 5: { + message["delete"] = $root.google.spanner.v1.Mutation.Delete.decode(reader, reader.uint32()); + break; + } + case 6: { + message.send = $root.google.spanner.v1.Mutation.Send.decode(reader, reader.uint32()); + break; + } + case 7: { + message.ack = $root.google.spanner.v1.Mutation.Ack.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Mutation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.Mutation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.Mutation} Mutation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Mutation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Mutation message. + * @function verify + * @memberof google.spanner.v1.Mutation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Mutation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.insert != null && message.hasOwnProperty("insert")) { + properties.operation = 1; + { + var error = $root.google.spanner.v1.Mutation.Write.verify(message.insert); + if (error) + return "insert." + error; + } + } + if (message.update != null && message.hasOwnProperty("update")) { + if (properties.operation === 1) + return "operation: multiple values"; + properties.operation = 1; + { + var error = $root.google.spanner.v1.Mutation.Write.verify(message.update); + if (error) + return "update." + error; + } + } + if (message.insertOrUpdate != null && message.hasOwnProperty("insertOrUpdate")) { + if (properties.operation === 1) + return "operation: multiple values"; + properties.operation = 1; + { + var error = $root.google.spanner.v1.Mutation.Write.verify(message.insertOrUpdate); + if (error) + return "insertOrUpdate." + error; + } + } + if (message.replace != null && message.hasOwnProperty("replace")) { + if (properties.operation === 1) + return "operation: multiple values"; + properties.operation = 1; + { + var error = $root.google.spanner.v1.Mutation.Write.verify(message.replace); + if (error) + return "replace." + error; + } + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + if (properties.operation === 1) + return "operation: multiple values"; + properties.operation = 1; + { + var error = $root.google.spanner.v1.Mutation.Delete.verify(message["delete"]); + if (error) + return "delete." + error; + } + } + if (message.send != null && message.hasOwnProperty("send")) { + if (properties.operation === 1) + return "operation: multiple values"; + properties.operation = 1; + { + var error = $root.google.spanner.v1.Mutation.Send.verify(message.send); + if (error) + return "send." + error; + } + } + if (message.ack != null && message.hasOwnProperty("ack")) { + if (properties.operation === 1) + return "operation: multiple values"; + properties.operation = 1; + { + var error = $root.google.spanner.v1.Mutation.Ack.verify(message.ack); + if (error) + return "ack." + error; + } + } + return null; + }; + + /** + * Creates a Mutation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.Mutation + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.Mutation} Mutation + */ + Mutation.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.Mutation) + return object; + var message = new $root.google.spanner.v1.Mutation(); + if (object.insert != null) { + if (typeof object.insert !== "object") + throw TypeError(".google.spanner.v1.Mutation.insert: object expected"); + message.insert = $root.google.spanner.v1.Mutation.Write.fromObject(object.insert); + } + if (object.update != null) { + if (typeof object.update !== "object") + throw TypeError(".google.spanner.v1.Mutation.update: object expected"); + message.update = $root.google.spanner.v1.Mutation.Write.fromObject(object.update); + } + if (object.insertOrUpdate != null) { + if (typeof object.insertOrUpdate !== "object") + throw TypeError(".google.spanner.v1.Mutation.insertOrUpdate: object expected"); + message.insertOrUpdate = $root.google.spanner.v1.Mutation.Write.fromObject(object.insertOrUpdate); + } + if (object.replace != null) { + if (typeof object.replace !== "object") + throw TypeError(".google.spanner.v1.Mutation.replace: object expected"); + message.replace = $root.google.spanner.v1.Mutation.Write.fromObject(object.replace); + } + if (object["delete"] != null) { + if (typeof object["delete"] !== "object") + throw TypeError(".google.spanner.v1.Mutation.delete: object expected"); + message["delete"] = $root.google.spanner.v1.Mutation.Delete.fromObject(object["delete"]); + } + if (object.send != null) { + if (typeof object.send !== "object") + throw TypeError(".google.spanner.v1.Mutation.send: object expected"); + message.send = $root.google.spanner.v1.Mutation.Send.fromObject(object.send); + } + if (object.ack != null) { + if (typeof object.ack !== "object") + throw TypeError(".google.spanner.v1.Mutation.ack: object expected"); + message.ack = $root.google.spanner.v1.Mutation.Ack.fromObject(object.ack); + } + return message; + }; + + /** + * Creates a plain object from a Mutation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.Mutation + * @static + * @param {google.spanner.v1.Mutation} message Mutation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Mutation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.insert != null && message.hasOwnProperty("insert")) { + object.insert = $root.google.spanner.v1.Mutation.Write.toObject(message.insert, options); + if (options.oneofs) + object.operation = "insert"; + } + if (message.update != null && message.hasOwnProperty("update")) { + object.update = $root.google.spanner.v1.Mutation.Write.toObject(message.update, options); + if (options.oneofs) + object.operation = "update"; + } + if (message.insertOrUpdate != null && message.hasOwnProperty("insertOrUpdate")) { + object.insertOrUpdate = $root.google.spanner.v1.Mutation.Write.toObject(message.insertOrUpdate, options); + if (options.oneofs) + object.operation = "insertOrUpdate"; + } + if (message.replace != null && message.hasOwnProperty("replace")) { + object.replace = $root.google.spanner.v1.Mutation.Write.toObject(message.replace, options); + if (options.oneofs) + object.operation = "replace"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + object["delete"] = $root.google.spanner.v1.Mutation.Delete.toObject(message["delete"], options); + if (options.oneofs) + object.operation = "delete"; + } + if (message.send != null && message.hasOwnProperty("send")) { + object.send = $root.google.spanner.v1.Mutation.Send.toObject(message.send, options); + if (options.oneofs) + object.operation = "send"; + } + if (message.ack != null && message.hasOwnProperty("ack")) { + object.ack = $root.google.spanner.v1.Mutation.Ack.toObject(message.ack, options); + if (options.oneofs) + object.operation = "ack"; + } + return object; + }; + + /** + * Converts this Mutation to JSON. + * @function toJSON + * @memberof google.spanner.v1.Mutation + * @instance + * @returns {Object.} JSON object + */ + Mutation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Mutation + * @function getTypeUrl + * @memberof google.spanner.v1.Mutation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Mutation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.Mutation"; + }; + + Mutation.Write = (function() { + + /** + * Properties of a Write. + * @memberof google.spanner.v1.Mutation + * @interface IWrite + * @property {string|null} [table] Write table + * @property {Array.|null} [columns] Write columns + * @property {Array.|null} [values] Write values + */ + + /** + * Constructs a new Write. + * @memberof google.spanner.v1.Mutation + * @classdesc Represents a Write. + * @implements IWrite + * @constructor + * @param {google.spanner.v1.Mutation.IWrite=} [properties] Properties to set + */ + function Write(properties) { + this.columns = []; + this.values = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Write table. + * @member {string} table + * @memberof google.spanner.v1.Mutation.Write + * @instance + */ + Write.prototype.table = ""; + + /** + * Write columns. + * @member {Array.} columns + * @memberof google.spanner.v1.Mutation.Write + * @instance + */ + Write.prototype.columns = $util.emptyArray; + + /** + * Write values. + * @member {Array.} values + * @memberof google.spanner.v1.Mutation.Write + * @instance + */ + Write.prototype.values = $util.emptyArray; + + /** + * Creates a new Write instance using the specified properties. + * @function create + * @memberof google.spanner.v1.Mutation.Write + * @static + * @param {google.spanner.v1.Mutation.IWrite=} [properties] Properties to set + * @returns {google.spanner.v1.Mutation.Write} Write instance + */ + Write.create = function create(properties) { + return new Write(properties); + }; + + /** + * Encodes the specified Write message. Does not implicitly {@link google.spanner.v1.Mutation.Write.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.Mutation.Write + * @static + * @param {google.spanner.v1.Mutation.IWrite} message Write message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Write.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.table != null && Object.hasOwnProperty.call(message, "table")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.table); + if (message.columns != null && message.columns.length) + for (var i = 0; i < message.columns.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.columns[i]); + if (message.values != null && message.values.length) + for (var i = 0; i < message.values.length; ++i) + $root.google.protobuf.ListValue.encode(message.values[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Write message, length delimited. Does not implicitly {@link google.spanner.v1.Mutation.Write.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.Mutation.Write + * @static + * @param {google.spanner.v1.Mutation.IWrite} message Write message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Write.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Write message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.Mutation.Write + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.Mutation.Write} Write + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Write.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.Mutation.Write(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.table = reader.string(); + break; + } + case 2: { + if (!(message.columns && message.columns.length)) + message.columns = []; + message.columns.push(reader.string()); + break; + } + case 3: { + if (!(message.values && message.values.length)) + message.values = []; + message.values.push($root.google.protobuf.ListValue.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Write message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.Mutation.Write + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.Mutation.Write} Write + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Write.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Write message. + * @function verify + * @memberof google.spanner.v1.Mutation.Write + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Write.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.table != null && message.hasOwnProperty("table")) + if (!$util.isString(message.table)) + return "table: string expected"; + if (message.columns != null && message.hasOwnProperty("columns")) { + if (!Array.isArray(message.columns)) + return "columns: array expected"; + for (var i = 0; i < message.columns.length; ++i) + if (!$util.isString(message.columns[i])) + return "columns: string[] expected"; + } + if (message.values != null && message.hasOwnProperty("values")) { + if (!Array.isArray(message.values)) + return "values: array expected"; + for (var i = 0; i < message.values.length; ++i) { + var error = $root.google.protobuf.ListValue.verify(message.values[i]); + if (error) + return "values." + error; + } + } + return null; + }; + + /** + * Creates a Write message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.Mutation.Write + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.Mutation.Write} Write + */ + Write.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.Mutation.Write) + return object; + var message = new $root.google.spanner.v1.Mutation.Write(); + if (object.table != null) + message.table = String(object.table); + if (object.columns) { + if (!Array.isArray(object.columns)) + throw TypeError(".google.spanner.v1.Mutation.Write.columns: array expected"); + message.columns = []; + for (var i = 0; i < object.columns.length; ++i) + message.columns[i] = String(object.columns[i]); + } + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.spanner.v1.Mutation.Write.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) { + if (typeof object.values[i] !== "object") + throw TypeError(".google.spanner.v1.Mutation.Write.values: object expected"); + message.values[i] = $root.google.protobuf.ListValue.fromObject(object.values[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Write message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.Mutation.Write + * @static + * @param {google.spanner.v1.Mutation.Write} message Write + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Write.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.columns = []; + object.values = []; + } + if (options.defaults) + object.table = ""; + if (message.table != null && message.hasOwnProperty("table")) + object.table = message.table; + if (message.columns && message.columns.length) { + object.columns = []; + for (var j = 0; j < message.columns.length; ++j) + object.columns[j] = message.columns[j]; + } + if (message.values && message.values.length) { + object.values = []; + for (var j = 0; j < message.values.length; ++j) + object.values[j] = $root.google.protobuf.ListValue.toObject(message.values[j], options); + } + return object; + }; + + /** + * Converts this Write to JSON. + * @function toJSON + * @memberof google.spanner.v1.Mutation.Write + * @instance + * @returns {Object.} JSON object + */ + Write.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Write + * @function getTypeUrl + * @memberof google.spanner.v1.Mutation.Write + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Write.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.Mutation.Write"; + }; + + return Write; + })(); + + Mutation.Delete = (function() { + + /** + * Properties of a Delete. + * @memberof google.spanner.v1.Mutation + * @interface IDelete + * @property {string|null} [table] Delete table + * @property {google.spanner.v1.IKeySet|null} [keySet] Delete keySet + */ + + /** + * Constructs a new Delete. + * @memberof google.spanner.v1.Mutation + * @classdesc Represents a Delete. + * @implements IDelete + * @constructor + * @param {google.spanner.v1.Mutation.IDelete=} [properties] Properties to set + */ + function Delete(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Delete table. + * @member {string} table + * @memberof google.spanner.v1.Mutation.Delete + * @instance + */ + Delete.prototype.table = ""; + + /** + * Delete keySet. + * @member {google.spanner.v1.IKeySet|null|undefined} keySet + * @memberof google.spanner.v1.Mutation.Delete + * @instance + */ + Delete.prototype.keySet = null; + + /** + * Creates a new Delete instance using the specified properties. + * @function create + * @memberof google.spanner.v1.Mutation.Delete + * @static + * @param {google.spanner.v1.Mutation.IDelete=} [properties] Properties to set + * @returns {google.spanner.v1.Mutation.Delete} Delete instance + */ + Delete.create = function create(properties) { + return new Delete(properties); + }; + + /** + * Encodes the specified Delete message. Does not implicitly {@link google.spanner.v1.Mutation.Delete.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.Mutation.Delete + * @static + * @param {google.spanner.v1.Mutation.IDelete} message Delete message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Delete.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.table != null && Object.hasOwnProperty.call(message, "table")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.table); + if (message.keySet != null && Object.hasOwnProperty.call(message, "keySet")) + $root.google.spanner.v1.KeySet.encode(message.keySet, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Delete message, length delimited. Does not implicitly {@link google.spanner.v1.Mutation.Delete.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.Mutation.Delete + * @static + * @param {google.spanner.v1.Mutation.IDelete} message Delete message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Delete.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Delete message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.Mutation.Delete + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.Mutation.Delete} Delete + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Delete.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.Mutation.Delete(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.table = reader.string(); + break; + } + case 2: { + message.keySet = $root.google.spanner.v1.KeySet.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Delete message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.Mutation.Delete + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.Mutation.Delete} Delete + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Delete.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Delete message. + * @function verify + * @memberof google.spanner.v1.Mutation.Delete + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Delete.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.table != null && message.hasOwnProperty("table")) + if (!$util.isString(message.table)) + return "table: string expected"; + if (message.keySet != null && message.hasOwnProperty("keySet")) { + var error = $root.google.spanner.v1.KeySet.verify(message.keySet); + if (error) + return "keySet." + error; + } + return null; + }; + + /** + * Creates a Delete message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.Mutation.Delete + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.Mutation.Delete} Delete + */ + Delete.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.Mutation.Delete) + return object; + var message = new $root.google.spanner.v1.Mutation.Delete(); + if (object.table != null) + message.table = String(object.table); + if (object.keySet != null) { + if (typeof object.keySet !== "object") + throw TypeError(".google.spanner.v1.Mutation.Delete.keySet: object expected"); + message.keySet = $root.google.spanner.v1.KeySet.fromObject(object.keySet); + } + return message; + }; + + /** + * Creates a plain object from a Delete message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.Mutation.Delete + * @static + * @param {google.spanner.v1.Mutation.Delete} message Delete + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Delete.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.table = ""; + object.keySet = null; + } + if (message.table != null && message.hasOwnProperty("table")) + object.table = message.table; + if (message.keySet != null && message.hasOwnProperty("keySet")) + object.keySet = $root.google.spanner.v1.KeySet.toObject(message.keySet, options); + return object; + }; + + /** + * Converts this Delete to JSON. + * @function toJSON + * @memberof google.spanner.v1.Mutation.Delete + * @instance + * @returns {Object.} JSON object + */ + Delete.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Delete + * @function getTypeUrl + * @memberof google.spanner.v1.Mutation.Delete + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Delete.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.Mutation.Delete"; + }; + + return Delete; + })(); + + Mutation.Send = (function() { + + /** + * Properties of a Send. + * @memberof google.spanner.v1.Mutation + * @interface ISend + * @property {string|null} [queue] Send queue + * @property {google.protobuf.IListValue|null} [key] Send key + * @property {google.protobuf.ITimestamp|null} [deliverTime] Send deliverTime + * @property {google.protobuf.IValue|null} [payload] Send payload + */ + + /** + * Constructs a new Send. + * @memberof google.spanner.v1.Mutation + * @classdesc Represents a Send. + * @implements ISend + * @constructor + * @param {google.spanner.v1.Mutation.ISend=} [properties] Properties to set + */ + function Send(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Send queue. + * @member {string} queue + * @memberof google.spanner.v1.Mutation.Send + * @instance + */ + Send.prototype.queue = ""; + + /** + * Send key. + * @member {google.protobuf.IListValue|null|undefined} key + * @memberof google.spanner.v1.Mutation.Send + * @instance + */ + Send.prototype.key = null; + + /** + * Send deliverTime. + * @member {google.protobuf.ITimestamp|null|undefined} deliverTime + * @memberof google.spanner.v1.Mutation.Send + * @instance + */ + Send.prototype.deliverTime = null; + + /** + * Send payload. + * @member {google.protobuf.IValue|null|undefined} payload + * @memberof google.spanner.v1.Mutation.Send + * @instance + */ + Send.prototype.payload = null; + + /** + * Creates a new Send instance using the specified properties. + * @function create + * @memberof google.spanner.v1.Mutation.Send + * @static + * @param {google.spanner.v1.Mutation.ISend=} [properties] Properties to set + * @returns {google.spanner.v1.Mutation.Send} Send instance + */ + Send.create = function create(properties) { + return new Send(properties); + }; + + /** + * Encodes the specified Send message. Does not implicitly {@link google.spanner.v1.Mutation.Send.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.Mutation.Send + * @static + * @param {google.spanner.v1.Mutation.ISend} message Send message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Send.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.queue != null && Object.hasOwnProperty.call(message, "queue")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.queue); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + $root.google.protobuf.ListValue.encode(message.key, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.deliverTime != null && Object.hasOwnProperty.call(message, "deliverTime")) + $root.google.protobuf.Timestamp.encode(message.deliverTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.payload != null && Object.hasOwnProperty.call(message, "payload")) + $root.google.protobuf.Value.encode(message.payload, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Send message, length delimited. Does not implicitly {@link google.spanner.v1.Mutation.Send.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.Mutation.Send + * @static + * @param {google.spanner.v1.Mutation.ISend} message Send message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Send.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Send message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.Mutation.Send + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.Mutation.Send} Send + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Send.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.Mutation.Send(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.queue = reader.string(); + break; + } + case 2: { + message.key = $root.google.protobuf.ListValue.decode(reader, reader.uint32()); + break; + } + case 3: { + message.deliverTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.payload = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Send message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.Mutation.Send + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.Mutation.Send} Send + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Send.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Send message. + * @function verify + * @memberof google.spanner.v1.Mutation.Send + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Send.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.queue != null && message.hasOwnProperty("queue")) + if (!$util.isString(message.queue)) + return "queue: string expected"; + if (message.key != null && message.hasOwnProperty("key")) { + var error = $root.google.protobuf.ListValue.verify(message.key); + if (error) + return "key." + error; + } + if (message.deliverTime != null && message.hasOwnProperty("deliverTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.deliverTime); + if (error) + return "deliverTime." + error; + } + if (message.payload != null && message.hasOwnProperty("payload")) { + var error = $root.google.protobuf.Value.verify(message.payload); + if (error) + return "payload." + error; + } + return null; + }; + + /** + * Creates a Send message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.Mutation.Send + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.Mutation.Send} Send + */ + Send.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.Mutation.Send) + return object; + var message = new $root.google.spanner.v1.Mutation.Send(); + if (object.queue != null) + message.queue = String(object.queue); + if (object.key != null) { + if (typeof object.key !== "object") + throw TypeError(".google.spanner.v1.Mutation.Send.key: object expected"); + message.key = $root.google.protobuf.ListValue.fromObject(object.key); + } + if (object.deliverTime != null) { + if (typeof object.deliverTime !== "object") + throw TypeError(".google.spanner.v1.Mutation.Send.deliverTime: object expected"); + message.deliverTime = $root.google.protobuf.Timestamp.fromObject(object.deliverTime); + } + if (object.payload != null) { + if (typeof object.payload !== "object") + throw TypeError(".google.spanner.v1.Mutation.Send.payload: object expected"); + message.payload = $root.google.protobuf.Value.fromObject(object.payload); + } + return message; + }; + + /** + * Creates a plain object from a Send message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.Mutation.Send + * @static + * @param {google.spanner.v1.Mutation.Send} message Send + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Send.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.queue = ""; + object.key = null; + object.deliverTime = null; + object.payload = null; + } + if (message.queue != null && message.hasOwnProperty("queue")) + object.queue = message.queue; + if (message.key != null && message.hasOwnProperty("key")) + object.key = $root.google.protobuf.ListValue.toObject(message.key, options); + if (message.deliverTime != null && message.hasOwnProperty("deliverTime")) + object.deliverTime = $root.google.protobuf.Timestamp.toObject(message.deliverTime, options); + if (message.payload != null && message.hasOwnProperty("payload")) + object.payload = $root.google.protobuf.Value.toObject(message.payload, options); + return object; + }; + + /** + * Converts this Send to JSON. + * @function toJSON + * @memberof google.spanner.v1.Mutation.Send + * @instance + * @returns {Object.} JSON object + */ + Send.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Send + * @function getTypeUrl + * @memberof google.spanner.v1.Mutation.Send + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Send.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.Mutation.Send"; + }; + + return Send; + })(); + + Mutation.Ack = (function() { + + /** + * Properties of an Ack. + * @memberof google.spanner.v1.Mutation + * @interface IAck + * @property {string|null} [queue] Ack queue + * @property {google.protobuf.IListValue|null} [key] Ack key + * @property {boolean|null} [ignoreNotFound] Ack ignoreNotFound + */ + + /** + * Constructs a new Ack. + * @memberof google.spanner.v1.Mutation + * @classdesc Represents an Ack. + * @implements IAck + * @constructor + * @param {google.spanner.v1.Mutation.IAck=} [properties] Properties to set + */ + function Ack(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Ack queue. + * @member {string} queue + * @memberof google.spanner.v1.Mutation.Ack + * @instance + */ + Ack.prototype.queue = ""; + + /** + * Ack key. + * @member {google.protobuf.IListValue|null|undefined} key + * @memberof google.spanner.v1.Mutation.Ack + * @instance + */ + Ack.prototype.key = null; + + /** + * Ack ignoreNotFound. + * @member {boolean} ignoreNotFound + * @memberof google.spanner.v1.Mutation.Ack + * @instance + */ + Ack.prototype.ignoreNotFound = false; + + /** + * Creates a new Ack instance using the specified properties. + * @function create + * @memberof google.spanner.v1.Mutation.Ack + * @static + * @param {google.spanner.v1.Mutation.IAck=} [properties] Properties to set + * @returns {google.spanner.v1.Mutation.Ack} Ack instance + */ + Ack.create = function create(properties) { + return new Ack(properties); + }; + + /** + * Encodes the specified Ack message. Does not implicitly {@link google.spanner.v1.Mutation.Ack.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.Mutation.Ack + * @static + * @param {google.spanner.v1.Mutation.IAck} message Ack message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Ack.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.queue != null && Object.hasOwnProperty.call(message, "queue")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.queue); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + $root.google.protobuf.ListValue.encode(message.key, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.ignoreNotFound != null && Object.hasOwnProperty.call(message, "ignoreNotFound")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.ignoreNotFound); + return writer; + }; + + /** + * Encodes the specified Ack message, length delimited. Does not implicitly {@link google.spanner.v1.Mutation.Ack.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.Mutation.Ack + * @static + * @param {google.spanner.v1.Mutation.IAck} message Ack message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Ack.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Ack message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.Mutation.Ack + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.Mutation.Ack} Ack + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Ack.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.Mutation.Ack(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.queue = reader.string(); + break; + } + case 2: { + message.key = $root.google.protobuf.ListValue.decode(reader, reader.uint32()); + break; + } + case 3: { + message.ignoreNotFound = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Ack message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.Mutation.Ack + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.Mutation.Ack} Ack + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Ack.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Ack message. + * @function verify + * @memberof google.spanner.v1.Mutation.Ack + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Ack.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.queue != null && message.hasOwnProperty("queue")) + if (!$util.isString(message.queue)) + return "queue: string expected"; + if (message.key != null && message.hasOwnProperty("key")) { + var error = $root.google.protobuf.ListValue.verify(message.key); + if (error) + return "key." + error; + } + if (message.ignoreNotFound != null && message.hasOwnProperty("ignoreNotFound")) + if (typeof message.ignoreNotFound !== "boolean") + return "ignoreNotFound: boolean expected"; + return null; + }; + + /** + * Creates an Ack message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.Mutation.Ack + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.Mutation.Ack} Ack + */ + Ack.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.Mutation.Ack) + return object; + var message = new $root.google.spanner.v1.Mutation.Ack(); + if (object.queue != null) + message.queue = String(object.queue); + if (object.key != null) { + if (typeof object.key !== "object") + throw TypeError(".google.spanner.v1.Mutation.Ack.key: object expected"); + message.key = $root.google.protobuf.ListValue.fromObject(object.key); + } + if (object.ignoreNotFound != null) + message.ignoreNotFound = Boolean(object.ignoreNotFound); + return message; + }; + + /** + * Creates a plain object from an Ack message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.Mutation.Ack + * @static + * @param {google.spanner.v1.Mutation.Ack} message Ack + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Ack.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.queue = ""; + object.key = null; + object.ignoreNotFound = false; + } + if (message.queue != null && message.hasOwnProperty("queue")) + object.queue = message.queue; + if (message.key != null && message.hasOwnProperty("key")) + object.key = $root.google.protobuf.ListValue.toObject(message.key, options); + if (message.ignoreNotFound != null && message.hasOwnProperty("ignoreNotFound")) + object.ignoreNotFound = message.ignoreNotFound; + return object; + }; + + /** + * Converts this Ack to JSON. + * @function toJSON + * @memberof google.spanner.v1.Mutation.Ack + * @instance + * @returns {Object.} JSON object + */ + Ack.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Ack + * @function getTypeUrl + * @memberof google.spanner.v1.Mutation.Ack + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Ack.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.Mutation.Ack"; + }; + + return Ack; + })(); + + return Mutation; + })(); + + v1.ResultSet = (function() { + + /** + * Properties of a ResultSet. + * @memberof google.spanner.v1 + * @interface IResultSet + * @property {google.spanner.v1.IResultSetMetadata|null} [metadata] ResultSet metadata + * @property {Array.|null} [rows] ResultSet rows + * @property {google.spanner.v1.IResultSetStats|null} [stats] ResultSet stats + * @property {google.spanner.v1.IMultiplexedSessionPrecommitToken|null} [precommitToken] ResultSet precommitToken + * @property {google.spanner.v1.ICacheUpdate|null} [cacheUpdate] ResultSet cacheUpdate + */ + + /** + * Constructs a new ResultSet. + * @memberof google.spanner.v1 + * @classdesc Represents a ResultSet. + * @implements IResultSet + * @constructor + * @param {google.spanner.v1.IResultSet=} [properties] Properties to set + */ + function ResultSet(properties) { + this.rows = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResultSet metadata. + * @member {google.spanner.v1.IResultSetMetadata|null|undefined} metadata + * @memberof google.spanner.v1.ResultSet + * @instance + */ + ResultSet.prototype.metadata = null; + + /** + * ResultSet rows. + * @member {Array.} rows + * @memberof google.spanner.v1.ResultSet + * @instance + */ + ResultSet.prototype.rows = $util.emptyArray; + + /** + * ResultSet stats. + * @member {google.spanner.v1.IResultSetStats|null|undefined} stats + * @memberof google.spanner.v1.ResultSet + * @instance + */ + ResultSet.prototype.stats = null; + + /** + * ResultSet precommitToken. + * @member {google.spanner.v1.IMultiplexedSessionPrecommitToken|null|undefined} precommitToken + * @memberof google.spanner.v1.ResultSet + * @instance + */ + ResultSet.prototype.precommitToken = null; + + /** + * ResultSet cacheUpdate. + * @member {google.spanner.v1.ICacheUpdate|null|undefined} cacheUpdate + * @memberof google.spanner.v1.ResultSet + * @instance + */ + ResultSet.prototype.cacheUpdate = null; + + /** + * Creates a new ResultSet instance using the specified properties. + * @function create + * @memberof google.spanner.v1.ResultSet + * @static + * @param {google.spanner.v1.IResultSet=} [properties] Properties to set + * @returns {google.spanner.v1.ResultSet} ResultSet instance + */ + ResultSet.create = function create(properties) { + return new ResultSet(properties); + }; + + /** + * Encodes the specified ResultSet message. Does not implicitly {@link google.spanner.v1.ResultSet.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.ResultSet + * @static + * @param {google.spanner.v1.IResultSet} message ResultSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResultSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.spanner.v1.ResultSetMetadata.encode(message.metadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.rows != null && message.rows.length) + for (var i = 0; i < message.rows.length; ++i) + $root.google.protobuf.ListValue.encode(message.rows[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.stats != null && Object.hasOwnProperty.call(message, "stats")) + $root.google.spanner.v1.ResultSetStats.encode(message.stats, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.precommitToken != null && Object.hasOwnProperty.call(message, "precommitToken")) + $root.google.spanner.v1.MultiplexedSessionPrecommitToken.encode(message.precommitToken, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.cacheUpdate != null && Object.hasOwnProperty.call(message, "cacheUpdate")) + $root.google.spanner.v1.CacheUpdate.encode(message.cacheUpdate, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ResultSet message, length delimited. Does not implicitly {@link google.spanner.v1.ResultSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.ResultSet + * @static + * @param {google.spanner.v1.IResultSet} message ResultSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResultSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResultSet message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.ResultSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.ResultSet} ResultSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResultSet.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.ResultSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.metadata = $root.google.spanner.v1.ResultSetMetadata.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.rows && message.rows.length)) + message.rows = []; + message.rows.push($root.google.protobuf.ListValue.decode(reader, reader.uint32())); + break; + } + case 3: { + message.stats = $root.google.spanner.v1.ResultSetStats.decode(reader, reader.uint32()); + break; + } + case 5: { + message.precommitToken = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.decode(reader, reader.uint32()); + break; + } + case 6: { + message.cacheUpdate = $root.google.spanner.v1.CacheUpdate.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResultSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.ResultSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.ResultSet} ResultSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResultSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResultSet message. + * @function verify + * @memberof google.spanner.v1.ResultSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResultSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.spanner.v1.ResultSetMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + if (message.rows != null && message.hasOwnProperty("rows")) { + if (!Array.isArray(message.rows)) + return "rows: array expected"; + for (var i = 0; i < message.rows.length; ++i) { + var error = $root.google.protobuf.ListValue.verify(message.rows[i]); + if (error) + return "rows." + error; + } + } + if (message.stats != null && message.hasOwnProperty("stats")) { + var error = $root.google.spanner.v1.ResultSetStats.verify(message.stats); + if (error) + return "stats." + error; + } + if (message.precommitToken != null && message.hasOwnProperty("precommitToken")) { + var error = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.verify(message.precommitToken); + if (error) + return "precommitToken." + error; + } + if (message.cacheUpdate != null && message.hasOwnProperty("cacheUpdate")) { + var error = $root.google.spanner.v1.CacheUpdate.verify(message.cacheUpdate); + if (error) + return "cacheUpdate." + error; + } + return null; + }; + + /** + * Creates a ResultSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.ResultSet + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.ResultSet} ResultSet + */ + ResultSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.ResultSet) + return object; + var message = new $root.google.spanner.v1.ResultSet(); + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.spanner.v1.ResultSet.metadata: object expected"); + message.metadata = $root.google.spanner.v1.ResultSetMetadata.fromObject(object.metadata); + } + if (object.rows) { + if (!Array.isArray(object.rows)) + throw TypeError(".google.spanner.v1.ResultSet.rows: array expected"); + message.rows = []; + for (var i = 0; i < object.rows.length; ++i) { + if (typeof object.rows[i] !== "object") + throw TypeError(".google.spanner.v1.ResultSet.rows: object expected"); + message.rows[i] = $root.google.protobuf.ListValue.fromObject(object.rows[i]); + } + } + if (object.stats != null) { + if (typeof object.stats !== "object") + throw TypeError(".google.spanner.v1.ResultSet.stats: object expected"); + message.stats = $root.google.spanner.v1.ResultSetStats.fromObject(object.stats); + } + if (object.precommitToken != null) { + if (typeof object.precommitToken !== "object") + throw TypeError(".google.spanner.v1.ResultSet.precommitToken: object expected"); + message.precommitToken = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.fromObject(object.precommitToken); + } + if (object.cacheUpdate != null) { + if (typeof object.cacheUpdate !== "object") + throw TypeError(".google.spanner.v1.ResultSet.cacheUpdate: object expected"); + message.cacheUpdate = $root.google.spanner.v1.CacheUpdate.fromObject(object.cacheUpdate); + } + return message; + }; + + /** + * Creates a plain object from a ResultSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.ResultSet + * @static + * @param {google.spanner.v1.ResultSet} message ResultSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResultSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rows = []; + if (options.defaults) { + object.metadata = null; + object.stats = null; + object.precommitToken = null; + object.cacheUpdate = null; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.spanner.v1.ResultSetMetadata.toObject(message.metadata, options); + if (message.rows && message.rows.length) { + object.rows = []; + for (var j = 0; j < message.rows.length; ++j) + object.rows[j] = $root.google.protobuf.ListValue.toObject(message.rows[j], options); + } + if (message.stats != null && message.hasOwnProperty("stats")) + object.stats = $root.google.spanner.v1.ResultSetStats.toObject(message.stats, options); + if (message.precommitToken != null && message.hasOwnProperty("precommitToken")) + object.precommitToken = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.toObject(message.precommitToken, options); + if (message.cacheUpdate != null && message.hasOwnProperty("cacheUpdate")) + object.cacheUpdate = $root.google.spanner.v1.CacheUpdate.toObject(message.cacheUpdate, options); + return object; + }; + + /** + * Converts this ResultSet to JSON. + * @function toJSON + * @memberof google.spanner.v1.ResultSet + * @instance + * @returns {Object.} JSON object + */ + ResultSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResultSet + * @function getTypeUrl + * @memberof google.spanner.v1.ResultSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResultSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.ResultSet"; + }; + + return ResultSet; + })(); + + v1.PartialResultSet = (function() { + + /** + * Properties of a PartialResultSet. + * @memberof google.spanner.v1 + * @interface IPartialResultSet + * @property {google.spanner.v1.IResultSetMetadata|null} [metadata] PartialResultSet metadata + * @property {Array.|null} [values] PartialResultSet values + * @property {boolean|null} [chunkedValue] PartialResultSet chunkedValue + * @property {Uint8Array|null} [resumeToken] PartialResultSet resumeToken + * @property {google.spanner.v1.IResultSetStats|null} [stats] PartialResultSet stats + * @property {google.spanner.v1.IMultiplexedSessionPrecommitToken|null} [precommitToken] PartialResultSet precommitToken + * @property {boolean|null} [last] PartialResultSet last + * @property {google.spanner.v1.ICacheUpdate|null} [cacheUpdate] PartialResultSet cacheUpdate + */ + + /** + * Constructs a new PartialResultSet. + * @memberof google.spanner.v1 + * @classdesc Represents a PartialResultSet. + * @implements IPartialResultSet + * @constructor + * @param {google.spanner.v1.IPartialResultSet=} [properties] Properties to set + */ + function PartialResultSet(properties) { + this.values = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PartialResultSet metadata. + * @member {google.spanner.v1.IResultSetMetadata|null|undefined} metadata + * @memberof google.spanner.v1.PartialResultSet + * @instance + */ + PartialResultSet.prototype.metadata = null; + + /** + * PartialResultSet values. + * @member {Array.} values + * @memberof google.spanner.v1.PartialResultSet + * @instance + */ + PartialResultSet.prototype.values = $util.emptyArray; + + /** + * PartialResultSet chunkedValue. + * @member {boolean} chunkedValue + * @memberof google.spanner.v1.PartialResultSet + * @instance + */ + PartialResultSet.prototype.chunkedValue = false; + + /** + * PartialResultSet resumeToken. + * @member {Uint8Array} resumeToken + * @memberof google.spanner.v1.PartialResultSet + * @instance + */ + PartialResultSet.prototype.resumeToken = $util.newBuffer([]); + + /** + * PartialResultSet stats. + * @member {google.spanner.v1.IResultSetStats|null|undefined} stats + * @memberof google.spanner.v1.PartialResultSet + * @instance + */ + PartialResultSet.prototype.stats = null; + + /** + * PartialResultSet precommitToken. + * @member {google.spanner.v1.IMultiplexedSessionPrecommitToken|null|undefined} precommitToken + * @memberof google.spanner.v1.PartialResultSet + * @instance + */ + PartialResultSet.prototype.precommitToken = null; + + /** + * PartialResultSet last. + * @member {boolean} last + * @memberof google.spanner.v1.PartialResultSet + * @instance + */ + PartialResultSet.prototype.last = false; + + /** + * PartialResultSet cacheUpdate. + * @member {google.spanner.v1.ICacheUpdate|null|undefined} cacheUpdate + * @memberof google.spanner.v1.PartialResultSet + * @instance + */ + PartialResultSet.prototype.cacheUpdate = null; + + /** + * Creates a new PartialResultSet instance using the specified properties. + * @function create + * @memberof google.spanner.v1.PartialResultSet + * @static + * @param {google.spanner.v1.IPartialResultSet=} [properties] Properties to set + * @returns {google.spanner.v1.PartialResultSet} PartialResultSet instance + */ + PartialResultSet.create = function create(properties) { + return new PartialResultSet(properties); + }; + + /** + * Encodes the specified PartialResultSet message. Does not implicitly {@link google.spanner.v1.PartialResultSet.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.PartialResultSet + * @static + * @param {google.spanner.v1.IPartialResultSet} message PartialResultSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartialResultSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.spanner.v1.ResultSetMetadata.encode(message.metadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.values != null && message.values.length) + for (var i = 0; i < message.values.length; ++i) + $root.google.protobuf.Value.encode(message.values[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.chunkedValue != null && Object.hasOwnProperty.call(message, "chunkedValue")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.chunkedValue); + if (message.resumeToken != null && Object.hasOwnProperty.call(message, "resumeToken")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.resumeToken); + if (message.stats != null && Object.hasOwnProperty.call(message, "stats")) + $root.google.spanner.v1.ResultSetStats.encode(message.stats, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.precommitToken != null && Object.hasOwnProperty.call(message, "precommitToken")) + $root.google.spanner.v1.MultiplexedSessionPrecommitToken.encode(message.precommitToken, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.last != null && Object.hasOwnProperty.call(message, "last")) + writer.uint32(/* id 9, wireType 0 =*/72).bool(message.last); + if (message.cacheUpdate != null && Object.hasOwnProperty.call(message, "cacheUpdate")) + $root.google.spanner.v1.CacheUpdate.encode(message.cacheUpdate, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PartialResultSet message, length delimited. Does not implicitly {@link google.spanner.v1.PartialResultSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.PartialResultSet + * @static + * @param {google.spanner.v1.IPartialResultSet} message PartialResultSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartialResultSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PartialResultSet message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.PartialResultSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.PartialResultSet} PartialResultSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartialResultSet.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.PartialResultSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.metadata = $root.google.spanner.v1.ResultSetMetadata.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.values && message.values.length)) + message.values = []; + message.values.push($root.google.protobuf.Value.decode(reader, reader.uint32())); + break; + } + case 3: { + message.chunkedValue = reader.bool(); + break; + } + case 4: { + message.resumeToken = reader.bytes(); + break; + } + case 5: { + message.stats = $root.google.spanner.v1.ResultSetStats.decode(reader, reader.uint32()); + break; + } + case 8: { + message.precommitToken = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.decode(reader, reader.uint32()); + break; + } + case 9: { + message.last = reader.bool(); + break; + } + case 10: { + message.cacheUpdate = $root.google.spanner.v1.CacheUpdate.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PartialResultSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.PartialResultSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.PartialResultSet} PartialResultSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartialResultSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PartialResultSet message. + * @function verify + * @memberof google.spanner.v1.PartialResultSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PartialResultSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.spanner.v1.ResultSetMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + if (message.values != null && message.hasOwnProperty("values")) { + if (!Array.isArray(message.values)) + return "values: array expected"; + for (var i = 0; i < message.values.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.values[i]); + if (error) + return "values." + error; + } + } + if (message.chunkedValue != null && message.hasOwnProperty("chunkedValue")) + if (typeof message.chunkedValue !== "boolean") + return "chunkedValue: boolean expected"; + if (message.resumeToken != null && message.hasOwnProperty("resumeToken")) + if (!(message.resumeToken && typeof message.resumeToken.length === "number" || $util.isString(message.resumeToken))) + return "resumeToken: buffer expected"; + if (message.stats != null && message.hasOwnProperty("stats")) { + var error = $root.google.spanner.v1.ResultSetStats.verify(message.stats); + if (error) + return "stats." + error; + } + if (message.precommitToken != null && message.hasOwnProperty("precommitToken")) { + var error = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.verify(message.precommitToken); + if (error) + return "precommitToken." + error; + } + if (message.last != null && message.hasOwnProperty("last")) + if (typeof message.last !== "boolean") + return "last: boolean expected"; + if (message.cacheUpdate != null && message.hasOwnProperty("cacheUpdate")) { + var error = $root.google.spanner.v1.CacheUpdate.verify(message.cacheUpdate); + if (error) + return "cacheUpdate." + error; + } + return null; + }; + + /** + * Creates a PartialResultSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.PartialResultSet + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.PartialResultSet} PartialResultSet + */ + PartialResultSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.PartialResultSet) + return object; + var message = new $root.google.spanner.v1.PartialResultSet(); + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.spanner.v1.PartialResultSet.metadata: object expected"); + message.metadata = $root.google.spanner.v1.ResultSetMetadata.fromObject(object.metadata); + } + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.spanner.v1.PartialResultSet.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) { + if (typeof object.values[i] !== "object") + throw TypeError(".google.spanner.v1.PartialResultSet.values: object expected"); + message.values[i] = $root.google.protobuf.Value.fromObject(object.values[i]); + } + } + if (object.chunkedValue != null) + message.chunkedValue = Boolean(object.chunkedValue); + if (object.resumeToken != null) + if (typeof object.resumeToken === "string") + $util.base64.decode(object.resumeToken, message.resumeToken = $util.newBuffer($util.base64.length(object.resumeToken)), 0); + else if (object.resumeToken.length >= 0) + message.resumeToken = object.resumeToken; + if (object.stats != null) { + if (typeof object.stats !== "object") + throw TypeError(".google.spanner.v1.PartialResultSet.stats: object expected"); + message.stats = $root.google.spanner.v1.ResultSetStats.fromObject(object.stats); + } + if (object.precommitToken != null) { + if (typeof object.precommitToken !== "object") + throw TypeError(".google.spanner.v1.PartialResultSet.precommitToken: object expected"); + message.precommitToken = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.fromObject(object.precommitToken); + } + if (object.last != null) + message.last = Boolean(object.last); + if (object.cacheUpdate != null) { + if (typeof object.cacheUpdate !== "object") + throw TypeError(".google.spanner.v1.PartialResultSet.cacheUpdate: object expected"); + message.cacheUpdate = $root.google.spanner.v1.CacheUpdate.fromObject(object.cacheUpdate); + } + return message; + }; + + /** + * Creates a plain object from a PartialResultSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.PartialResultSet + * @static + * @param {google.spanner.v1.PartialResultSet} message PartialResultSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PartialResultSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.values = []; + if (options.defaults) { + object.metadata = null; + object.chunkedValue = false; + if (options.bytes === String) + object.resumeToken = ""; + else { + object.resumeToken = []; + if (options.bytes !== Array) + object.resumeToken = $util.newBuffer(object.resumeToken); + } + object.stats = null; + object.precommitToken = null; + object.last = false; + object.cacheUpdate = null; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.spanner.v1.ResultSetMetadata.toObject(message.metadata, options); + if (message.values && message.values.length) { + object.values = []; + for (var j = 0; j < message.values.length; ++j) + object.values[j] = $root.google.protobuf.Value.toObject(message.values[j], options); + } + if (message.chunkedValue != null && message.hasOwnProperty("chunkedValue")) + object.chunkedValue = message.chunkedValue; + if (message.resumeToken != null && message.hasOwnProperty("resumeToken")) + object.resumeToken = options.bytes === String ? $util.base64.encode(message.resumeToken, 0, message.resumeToken.length) : options.bytes === Array ? Array.prototype.slice.call(message.resumeToken) : message.resumeToken; + if (message.stats != null && message.hasOwnProperty("stats")) + object.stats = $root.google.spanner.v1.ResultSetStats.toObject(message.stats, options); + if (message.precommitToken != null && message.hasOwnProperty("precommitToken")) + object.precommitToken = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.toObject(message.precommitToken, options); + if (message.last != null && message.hasOwnProperty("last")) + object.last = message.last; + if (message.cacheUpdate != null && message.hasOwnProperty("cacheUpdate")) + object.cacheUpdate = $root.google.spanner.v1.CacheUpdate.toObject(message.cacheUpdate, options); + return object; + }; + + /** + * Converts this PartialResultSet to JSON. + * @function toJSON + * @memberof google.spanner.v1.PartialResultSet + * @instance + * @returns {Object.} JSON object + */ + PartialResultSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PartialResultSet + * @function getTypeUrl + * @memberof google.spanner.v1.PartialResultSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PartialResultSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.PartialResultSet"; + }; + + return PartialResultSet; + })(); + + v1.ResultSetMetadata = (function() { + + /** + * Properties of a ResultSetMetadata. + * @memberof google.spanner.v1 + * @interface IResultSetMetadata + * @property {google.spanner.v1.IStructType|null} [rowType] ResultSetMetadata rowType + * @property {google.spanner.v1.ITransaction|null} [transaction] ResultSetMetadata transaction + * @property {google.spanner.v1.IStructType|null} [undeclaredParameters] ResultSetMetadata undeclaredParameters + */ + + /** + * Constructs a new ResultSetMetadata. + * @memberof google.spanner.v1 + * @classdesc Represents a ResultSetMetadata. + * @implements IResultSetMetadata + * @constructor + * @param {google.spanner.v1.IResultSetMetadata=} [properties] Properties to set + */ + function ResultSetMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResultSetMetadata rowType. + * @member {google.spanner.v1.IStructType|null|undefined} rowType + * @memberof google.spanner.v1.ResultSetMetadata + * @instance + */ + ResultSetMetadata.prototype.rowType = null; + + /** + * ResultSetMetadata transaction. + * @member {google.spanner.v1.ITransaction|null|undefined} transaction + * @memberof google.spanner.v1.ResultSetMetadata + * @instance + */ + ResultSetMetadata.prototype.transaction = null; + + /** + * ResultSetMetadata undeclaredParameters. + * @member {google.spanner.v1.IStructType|null|undefined} undeclaredParameters + * @memberof google.spanner.v1.ResultSetMetadata + * @instance + */ + ResultSetMetadata.prototype.undeclaredParameters = null; + + /** + * Creates a new ResultSetMetadata instance using the specified properties. + * @function create + * @memberof google.spanner.v1.ResultSetMetadata + * @static + * @param {google.spanner.v1.IResultSetMetadata=} [properties] Properties to set + * @returns {google.spanner.v1.ResultSetMetadata} ResultSetMetadata instance + */ + ResultSetMetadata.create = function create(properties) { + return new ResultSetMetadata(properties); + }; + + /** + * Encodes the specified ResultSetMetadata message. Does not implicitly {@link google.spanner.v1.ResultSetMetadata.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.ResultSetMetadata + * @static + * @param {google.spanner.v1.IResultSetMetadata} message ResultSetMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResultSetMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rowType != null && Object.hasOwnProperty.call(message, "rowType")) + $root.google.spanner.v1.StructType.encode(message.rowType, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.transaction != null && Object.hasOwnProperty.call(message, "transaction")) + $root.google.spanner.v1.Transaction.encode(message.transaction, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.undeclaredParameters != null && Object.hasOwnProperty.call(message, "undeclaredParameters")) + $root.google.spanner.v1.StructType.encode(message.undeclaredParameters, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ResultSetMetadata message, length delimited. Does not implicitly {@link google.spanner.v1.ResultSetMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.ResultSetMetadata + * @static + * @param {google.spanner.v1.IResultSetMetadata} message ResultSetMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResultSetMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResultSetMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.ResultSetMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.ResultSetMetadata} ResultSetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResultSetMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.ResultSetMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.rowType = $root.google.spanner.v1.StructType.decode(reader, reader.uint32()); + break; + } + case 2: { + message.transaction = $root.google.spanner.v1.Transaction.decode(reader, reader.uint32()); + break; + } + case 3: { + message.undeclaredParameters = $root.google.spanner.v1.StructType.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResultSetMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.ResultSetMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.ResultSetMetadata} ResultSetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResultSetMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResultSetMetadata message. + * @function verify + * @memberof google.spanner.v1.ResultSetMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResultSetMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rowType != null && message.hasOwnProperty("rowType")) { + var error = $root.google.spanner.v1.StructType.verify(message.rowType); + if (error) + return "rowType." + error; + } + if (message.transaction != null && message.hasOwnProperty("transaction")) { + var error = $root.google.spanner.v1.Transaction.verify(message.transaction); + if (error) + return "transaction." + error; + } + if (message.undeclaredParameters != null && message.hasOwnProperty("undeclaredParameters")) { + var error = $root.google.spanner.v1.StructType.verify(message.undeclaredParameters); + if (error) + return "undeclaredParameters." + error; + } + return null; + }; + + /** + * Creates a ResultSetMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.ResultSetMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.ResultSetMetadata} ResultSetMetadata + */ + ResultSetMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.ResultSetMetadata) + return object; + var message = new $root.google.spanner.v1.ResultSetMetadata(); + if (object.rowType != null) { + if (typeof object.rowType !== "object") + throw TypeError(".google.spanner.v1.ResultSetMetadata.rowType: object expected"); + message.rowType = $root.google.spanner.v1.StructType.fromObject(object.rowType); + } + if (object.transaction != null) { + if (typeof object.transaction !== "object") + throw TypeError(".google.spanner.v1.ResultSetMetadata.transaction: object expected"); + message.transaction = $root.google.spanner.v1.Transaction.fromObject(object.transaction); + } + if (object.undeclaredParameters != null) { + if (typeof object.undeclaredParameters !== "object") + throw TypeError(".google.spanner.v1.ResultSetMetadata.undeclaredParameters: object expected"); + message.undeclaredParameters = $root.google.spanner.v1.StructType.fromObject(object.undeclaredParameters); + } + return message; + }; + + /** + * Creates a plain object from a ResultSetMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.ResultSetMetadata + * @static + * @param {google.spanner.v1.ResultSetMetadata} message ResultSetMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResultSetMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.rowType = null; + object.transaction = null; + object.undeclaredParameters = null; + } + if (message.rowType != null && message.hasOwnProperty("rowType")) + object.rowType = $root.google.spanner.v1.StructType.toObject(message.rowType, options); + if (message.transaction != null && message.hasOwnProperty("transaction")) + object.transaction = $root.google.spanner.v1.Transaction.toObject(message.transaction, options); + if (message.undeclaredParameters != null && message.hasOwnProperty("undeclaredParameters")) + object.undeclaredParameters = $root.google.spanner.v1.StructType.toObject(message.undeclaredParameters, options); + return object; + }; + + /** + * Converts this ResultSetMetadata to JSON. + * @function toJSON + * @memberof google.spanner.v1.ResultSetMetadata + * @instance + * @returns {Object.} JSON object + */ + ResultSetMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResultSetMetadata + * @function getTypeUrl + * @memberof google.spanner.v1.ResultSetMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResultSetMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.ResultSetMetadata"; + }; + + return ResultSetMetadata; + })(); + + v1.ResultSetStats = (function() { + + /** + * Properties of a ResultSetStats. + * @memberof google.spanner.v1 + * @interface IResultSetStats + * @property {google.spanner.v1.IQueryPlan|null} [queryPlan] ResultSetStats queryPlan + * @property {google.protobuf.IStruct|null} [queryStats] ResultSetStats queryStats + * @property {number|Long|null} [rowCountExact] ResultSetStats rowCountExact + * @property {number|Long|null} [rowCountLowerBound] ResultSetStats rowCountLowerBound + */ + + /** + * Constructs a new ResultSetStats. + * @memberof google.spanner.v1 + * @classdesc Represents a ResultSetStats. + * @implements IResultSetStats + * @constructor + * @param {google.spanner.v1.IResultSetStats=} [properties] Properties to set + */ + function ResultSetStats(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResultSetStats queryPlan. + * @member {google.spanner.v1.IQueryPlan|null|undefined} queryPlan + * @memberof google.spanner.v1.ResultSetStats + * @instance + */ + ResultSetStats.prototype.queryPlan = null; + + /** + * ResultSetStats queryStats. + * @member {google.protobuf.IStruct|null|undefined} queryStats + * @memberof google.spanner.v1.ResultSetStats + * @instance + */ + ResultSetStats.prototype.queryStats = null; + + /** + * ResultSetStats rowCountExact. + * @member {number|Long|null|undefined} rowCountExact + * @memberof google.spanner.v1.ResultSetStats + * @instance + */ + ResultSetStats.prototype.rowCountExact = null; + + /** + * ResultSetStats rowCountLowerBound. + * @member {number|Long|null|undefined} rowCountLowerBound + * @memberof google.spanner.v1.ResultSetStats + * @instance + */ + ResultSetStats.prototype.rowCountLowerBound = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ResultSetStats rowCount. + * @member {"rowCountExact"|"rowCountLowerBound"|undefined} rowCount + * @memberof google.spanner.v1.ResultSetStats + * @instance + */ + Object.defineProperty(ResultSetStats.prototype, "rowCount", { + get: $util.oneOfGetter($oneOfFields = ["rowCountExact", "rowCountLowerBound"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ResultSetStats instance using the specified properties. + * @function create + * @memberof google.spanner.v1.ResultSetStats + * @static + * @param {google.spanner.v1.IResultSetStats=} [properties] Properties to set + * @returns {google.spanner.v1.ResultSetStats} ResultSetStats instance + */ + ResultSetStats.create = function create(properties) { + return new ResultSetStats(properties); + }; + + /** + * Encodes the specified ResultSetStats message. Does not implicitly {@link google.spanner.v1.ResultSetStats.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.ResultSetStats + * @static + * @param {google.spanner.v1.IResultSetStats} message ResultSetStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResultSetStats.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.queryPlan != null && Object.hasOwnProperty.call(message, "queryPlan")) + $root.google.spanner.v1.QueryPlan.encode(message.queryPlan, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.queryStats != null && Object.hasOwnProperty.call(message, "queryStats")) + $root.google.protobuf.Struct.encode(message.queryStats, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.rowCountExact != null && Object.hasOwnProperty.call(message, "rowCountExact")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.rowCountExact); + if (message.rowCountLowerBound != null && Object.hasOwnProperty.call(message, "rowCountLowerBound")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.rowCountLowerBound); + return writer; + }; + + /** + * Encodes the specified ResultSetStats message, length delimited. Does not implicitly {@link google.spanner.v1.ResultSetStats.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.ResultSetStats + * @static + * @param {google.spanner.v1.IResultSetStats} message ResultSetStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResultSetStats.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResultSetStats message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.ResultSetStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.ResultSetStats} ResultSetStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResultSetStats.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.ResultSetStats(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.queryPlan = $root.google.spanner.v1.QueryPlan.decode(reader, reader.uint32()); + break; + } + case 2: { + message.queryStats = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 3: { + message.rowCountExact = reader.int64(); + break; + } + case 4: { + message.rowCountLowerBound = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResultSetStats message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.ResultSetStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.ResultSetStats} ResultSetStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResultSetStats.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResultSetStats message. + * @function verify + * @memberof google.spanner.v1.ResultSetStats + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResultSetStats.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.queryPlan != null && message.hasOwnProperty("queryPlan")) { + var error = $root.google.spanner.v1.QueryPlan.verify(message.queryPlan); + if (error) + return "queryPlan." + error; + } + if (message.queryStats != null && message.hasOwnProperty("queryStats")) { + var error = $root.google.protobuf.Struct.verify(message.queryStats); + if (error) + return "queryStats." + error; + } + if (message.rowCountExact != null && message.hasOwnProperty("rowCountExact")) { + properties.rowCount = 1; + if (!$util.isInteger(message.rowCountExact) && !(message.rowCountExact && $util.isInteger(message.rowCountExact.low) && $util.isInteger(message.rowCountExact.high))) + return "rowCountExact: integer|Long expected"; + } + if (message.rowCountLowerBound != null && message.hasOwnProperty("rowCountLowerBound")) { + if (properties.rowCount === 1) + return "rowCount: multiple values"; + properties.rowCount = 1; + if (!$util.isInteger(message.rowCountLowerBound) && !(message.rowCountLowerBound && $util.isInteger(message.rowCountLowerBound.low) && $util.isInteger(message.rowCountLowerBound.high))) + return "rowCountLowerBound: integer|Long expected"; + } + return null; + }; + + /** + * Creates a ResultSetStats message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.ResultSetStats + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.ResultSetStats} ResultSetStats + */ + ResultSetStats.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.ResultSetStats) + return object; + var message = new $root.google.spanner.v1.ResultSetStats(); + if (object.queryPlan != null) { + if (typeof object.queryPlan !== "object") + throw TypeError(".google.spanner.v1.ResultSetStats.queryPlan: object expected"); + message.queryPlan = $root.google.spanner.v1.QueryPlan.fromObject(object.queryPlan); + } + if (object.queryStats != null) { + if (typeof object.queryStats !== "object") + throw TypeError(".google.spanner.v1.ResultSetStats.queryStats: object expected"); + message.queryStats = $root.google.protobuf.Struct.fromObject(object.queryStats); + } + if (object.rowCountExact != null) + if ($util.Long) + (message.rowCountExact = $util.Long.fromValue(object.rowCountExact)).unsigned = false; + else if (typeof object.rowCountExact === "string") + message.rowCountExact = parseInt(object.rowCountExact, 10); + else if (typeof object.rowCountExact === "number") + message.rowCountExact = object.rowCountExact; + else if (typeof object.rowCountExact === "object") + message.rowCountExact = new $util.LongBits(object.rowCountExact.low >>> 0, object.rowCountExact.high >>> 0).toNumber(); + if (object.rowCountLowerBound != null) + if ($util.Long) + (message.rowCountLowerBound = $util.Long.fromValue(object.rowCountLowerBound)).unsigned = false; + else if (typeof object.rowCountLowerBound === "string") + message.rowCountLowerBound = parseInt(object.rowCountLowerBound, 10); + else if (typeof object.rowCountLowerBound === "number") + message.rowCountLowerBound = object.rowCountLowerBound; + else if (typeof object.rowCountLowerBound === "object") + message.rowCountLowerBound = new $util.LongBits(object.rowCountLowerBound.low >>> 0, object.rowCountLowerBound.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a ResultSetStats message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.ResultSetStats + * @static + * @param {google.spanner.v1.ResultSetStats} message ResultSetStats + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResultSetStats.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.queryPlan = null; + object.queryStats = null; + } + if (message.queryPlan != null && message.hasOwnProperty("queryPlan")) + object.queryPlan = $root.google.spanner.v1.QueryPlan.toObject(message.queryPlan, options); + if (message.queryStats != null && message.hasOwnProperty("queryStats")) + object.queryStats = $root.google.protobuf.Struct.toObject(message.queryStats, options); + if (message.rowCountExact != null && message.hasOwnProperty("rowCountExact")) { + if (typeof message.rowCountExact === "number") + object.rowCountExact = options.longs === String ? String(message.rowCountExact) : message.rowCountExact; + else + object.rowCountExact = options.longs === String ? $util.Long.prototype.toString.call(message.rowCountExact) : options.longs === Number ? new $util.LongBits(message.rowCountExact.low >>> 0, message.rowCountExact.high >>> 0).toNumber() : message.rowCountExact; + if (options.oneofs) + object.rowCount = "rowCountExact"; + } + if (message.rowCountLowerBound != null && message.hasOwnProperty("rowCountLowerBound")) { + if (typeof message.rowCountLowerBound === "number") + object.rowCountLowerBound = options.longs === String ? String(message.rowCountLowerBound) : message.rowCountLowerBound; + else + object.rowCountLowerBound = options.longs === String ? $util.Long.prototype.toString.call(message.rowCountLowerBound) : options.longs === Number ? new $util.LongBits(message.rowCountLowerBound.low >>> 0, message.rowCountLowerBound.high >>> 0).toNumber() : message.rowCountLowerBound; + if (options.oneofs) + object.rowCount = "rowCountLowerBound"; + } + return object; + }; + + /** + * Converts this ResultSetStats to JSON. + * @function toJSON + * @memberof google.spanner.v1.ResultSetStats + * @instance + * @returns {Object.} JSON object + */ + ResultSetStats.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResultSetStats + * @function getTypeUrl + * @memberof google.spanner.v1.ResultSetStats + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResultSetStats.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.ResultSetStats"; + }; + + return ResultSetStats; + })(); + + v1.PlanNode = (function() { + + /** + * Properties of a PlanNode. + * @memberof google.spanner.v1 + * @interface IPlanNode + * @property {number|null} [index] PlanNode index + * @property {google.spanner.v1.PlanNode.Kind|null} [kind] PlanNode kind + * @property {string|null} [displayName] PlanNode displayName + * @property {Array.|null} [childLinks] PlanNode childLinks + * @property {google.spanner.v1.PlanNode.IShortRepresentation|null} [shortRepresentation] PlanNode shortRepresentation + * @property {google.protobuf.IStruct|null} [metadata] PlanNode metadata + * @property {google.protobuf.IStruct|null} [executionStats] PlanNode executionStats + */ + + /** + * Constructs a new PlanNode. + * @memberof google.spanner.v1 + * @classdesc Represents a PlanNode. + * @implements IPlanNode + * @constructor + * @param {google.spanner.v1.IPlanNode=} [properties] Properties to set + */ + function PlanNode(properties) { + this.childLinks = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PlanNode index. + * @member {number} index + * @memberof google.spanner.v1.PlanNode + * @instance + */ + PlanNode.prototype.index = 0; + + /** + * PlanNode kind. + * @member {google.spanner.v1.PlanNode.Kind} kind + * @memberof google.spanner.v1.PlanNode + * @instance + */ + PlanNode.prototype.kind = 0; + + /** + * PlanNode displayName. + * @member {string} displayName + * @memberof google.spanner.v1.PlanNode + * @instance + */ + PlanNode.prototype.displayName = ""; + + /** + * PlanNode childLinks. + * @member {Array.} childLinks + * @memberof google.spanner.v1.PlanNode + * @instance + */ + PlanNode.prototype.childLinks = $util.emptyArray; + + /** + * PlanNode shortRepresentation. + * @member {google.spanner.v1.PlanNode.IShortRepresentation|null|undefined} shortRepresentation + * @memberof google.spanner.v1.PlanNode + * @instance + */ + PlanNode.prototype.shortRepresentation = null; + + /** + * PlanNode metadata. + * @member {google.protobuf.IStruct|null|undefined} metadata + * @memberof google.spanner.v1.PlanNode + * @instance + */ + PlanNode.prototype.metadata = null; + + /** + * PlanNode executionStats. + * @member {google.protobuf.IStruct|null|undefined} executionStats + * @memberof google.spanner.v1.PlanNode + * @instance + */ + PlanNode.prototype.executionStats = null; + + /** + * Creates a new PlanNode instance using the specified properties. + * @function create + * @memberof google.spanner.v1.PlanNode + * @static + * @param {google.spanner.v1.IPlanNode=} [properties] Properties to set + * @returns {google.spanner.v1.PlanNode} PlanNode instance + */ + PlanNode.create = function create(properties) { + return new PlanNode(properties); + }; + + /** + * Encodes the specified PlanNode message. Does not implicitly {@link google.spanner.v1.PlanNode.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.PlanNode + * @static + * @param {google.spanner.v1.IPlanNode} message PlanNode message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PlanNode.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.index != null && Object.hasOwnProperty.call(message, "index")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.index); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.kind); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.displayName); + if (message.childLinks != null && message.childLinks.length) + for (var i = 0; i < message.childLinks.length; ++i) + $root.google.spanner.v1.PlanNode.ChildLink.encode(message.childLinks[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.shortRepresentation != null && Object.hasOwnProperty.call(message, "shortRepresentation")) + $root.google.spanner.v1.PlanNode.ShortRepresentation.encode(message.shortRepresentation, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.protobuf.Struct.encode(message.metadata, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.executionStats != null && Object.hasOwnProperty.call(message, "executionStats")) + $root.google.protobuf.Struct.encode(message.executionStats, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PlanNode message, length delimited. Does not implicitly {@link google.spanner.v1.PlanNode.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.PlanNode + * @static + * @param {google.spanner.v1.IPlanNode} message PlanNode message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PlanNode.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PlanNode message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.PlanNode + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.PlanNode} PlanNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PlanNode.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.PlanNode(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.index = reader.int32(); + break; + } + case 2: { + message.kind = reader.int32(); + break; + } + case 3: { + message.displayName = reader.string(); + break; + } + case 4: { + if (!(message.childLinks && message.childLinks.length)) + message.childLinks = []; + message.childLinks.push($root.google.spanner.v1.PlanNode.ChildLink.decode(reader, reader.uint32())); + break; + } + case 5: { + message.shortRepresentation = $root.google.spanner.v1.PlanNode.ShortRepresentation.decode(reader, reader.uint32()); + break; + } + case 6: { + message.metadata = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 7: { + message.executionStats = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PlanNode message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.PlanNode + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.PlanNode} PlanNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PlanNode.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PlanNode message. + * @function verify + * @memberof google.spanner.v1.PlanNode + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PlanNode.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.index != null && message.hasOwnProperty("index")) + if (!$util.isInteger(message.index)) + return "index: integer expected"; + if (message.kind != null && message.hasOwnProperty("kind")) + switch (message.kind) { + default: + return "kind: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.childLinks != null && message.hasOwnProperty("childLinks")) { + if (!Array.isArray(message.childLinks)) + return "childLinks: array expected"; + for (var i = 0; i < message.childLinks.length; ++i) { + var error = $root.google.spanner.v1.PlanNode.ChildLink.verify(message.childLinks[i]); + if (error) + return "childLinks." + error; + } + } + if (message.shortRepresentation != null && message.hasOwnProperty("shortRepresentation")) { + var error = $root.google.spanner.v1.PlanNode.ShortRepresentation.verify(message.shortRepresentation); + if (error) + return "shortRepresentation." + error; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.protobuf.Struct.verify(message.metadata); + if (error) + return "metadata." + error; + } + if (message.executionStats != null && message.hasOwnProperty("executionStats")) { + var error = $root.google.protobuf.Struct.verify(message.executionStats); + if (error) + return "executionStats." + error; + } + return null; + }; + + /** + * Creates a PlanNode message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.PlanNode + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.PlanNode} PlanNode + */ + PlanNode.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.PlanNode) + return object; + var message = new $root.google.spanner.v1.PlanNode(); + if (object.index != null) + message.index = object.index | 0; + switch (object.kind) { + default: + if (typeof object.kind === "number") { + message.kind = object.kind; + break; + } + break; + case "KIND_UNSPECIFIED": + case 0: + message.kind = 0; + break; + case "RELATIONAL": + case 1: + message.kind = 1; + break; + case "SCALAR": + case 2: + message.kind = 2; + break; + } + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.childLinks) { + if (!Array.isArray(object.childLinks)) + throw TypeError(".google.spanner.v1.PlanNode.childLinks: array expected"); + message.childLinks = []; + for (var i = 0; i < object.childLinks.length; ++i) { + if (typeof object.childLinks[i] !== "object") + throw TypeError(".google.spanner.v1.PlanNode.childLinks: object expected"); + message.childLinks[i] = $root.google.spanner.v1.PlanNode.ChildLink.fromObject(object.childLinks[i]); + } + } + if (object.shortRepresentation != null) { + if (typeof object.shortRepresentation !== "object") + throw TypeError(".google.spanner.v1.PlanNode.shortRepresentation: object expected"); + message.shortRepresentation = $root.google.spanner.v1.PlanNode.ShortRepresentation.fromObject(object.shortRepresentation); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.spanner.v1.PlanNode.metadata: object expected"); + message.metadata = $root.google.protobuf.Struct.fromObject(object.metadata); + } + if (object.executionStats != null) { + if (typeof object.executionStats !== "object") + throw TypeError(".google.spanner.v1.PlanNode.executionStats: object expected"); + message.executionStats = $root.google.protobuf.Struct.fromObject(object.executionStats); + } + return message; + }; + + /** + * Creates a plain object from a PlanNode message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.PlanNode + * @static + * @param {google.spanner.v1.PlanNode} message PlanNode + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PlanNode.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.childLinks = []; + if (options.defaults) { + object.index = 0; + object.kind = options.enums === String ? "KIND_UNSPECIFIED" : 0; + object.displayName = ""; + object.shortRepresentation = null; + object.metadata = null; + object.executionStats = null; + } + if (message.index != null && message.hasOwnProperty("index")) + object.index = message.index; + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = options.enums === String ? $root.google.spanner.v1.PlanNode.Kind[message.kind] === undefined ? message.kind : $root.google.spanner.v1.PlanNode.Kind[message.kind] : message.kind; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.childLinks && message.childLinks.length) { + object.childLinks = []; + for (var j = 0; j < message.childLinks.length; ++j) + object.childLinks[j] = $root.google.spanner.v1.PlanNode.ChildLink.toObject(message.childLinks[j], options); + } + if (message.shortRepresentation != null && message.hasOwnProperty("shortRepresentation")) + object.shortRepresentation = $root.google.spanner.v1.PlanNode.ShortRepresentation.toObject(message.shortRepresentation, options); + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.protobuf.Struct.toObject(message.metadata, options); + if (message.executionStats != null && message.hasOwnProperty("executionStats")) + object.executionStats = $root.google.protobuf.Struct.toObject(message.executionStats, options); + return object; + }; + + /** + * Converts this PlanNode to JSON. + * @function toJSON + * @memberof google.spanner.v1.PlanNode + * @instance + * @returns {Object.} JSON object + */ + PlanNode.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PlanNode + * @function getTypeUrl + * @memberof google.spanner.v1.PlanNode + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PlanNode.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.PlanNode"; + }; + + /** + * Kind enum. + * @name google.spanner.v1.PlanNode.Kind + * @enum {number} + * @property {number} KIND_UNSPECIFIED=0 KIND_UNSPECIFIED value + * @property {number} RELATIONAL=1 RELATIONAL value + * @property {number} SCALAR=2 SCALAR value + */ + PlanNode.Kind = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "KIND_UNSPECIFIED"] = 0; + values[valuesById[1] = "RELATIONAL"] = 1; + values[valuesById[2] = "SCALAR"] = 2; + return values; + })(); + + PlanNode.ChildLink = (function() { + + /** + * Properties of a ChildLink. + * @memberof google.spanner.v1.PlanNode + * @interface IChildLink + * @property {number|null} [childIndex] ChildLink childIndex + * @property {string|null} [type] ChildLink type + * @property {string|null} [variable] ChildLink variable + */ + + /** + * Constructs a new ChildLink. + * @memberof google.spanner.v1.PlanNode + * @classdesc Represents a ChildLink. + * @implements IChildLink + * @constructor + * @param {google.spanner.v1.PlanNode.IChildLink=} [properties] Properties to set + */ + function ChildLink(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ChildLink childIndex. + * @member {number} childIndex + * @memberof google.spanner.v1.PlanNode.ChildLink + * @instance + */ + ChildLink.prototype.childIndex = 0; + + /** + * ChildLink type. + * @member {string} type + * @memberof google.spanner.v1.PlanNode.ChildLink + * @instance + */ + ChildLink.prototype.type = ""; + + /** + * ChildLink variable. + * @member {string} variable + * @memberof google.spanner.v1.PlanNode.ChildLink + * @instance + */ + ChildLink.prototype.variable = ""; + + /** + * Creates a new ChildLink instance using the specified properties. + * @function create + * @memberof google.spanner.v1.PlanNode.ChildLink + * @static + * @param {google.spanner.v1.PlanNode.IChildLink=} [properties] Properties to set + * @returns {google.spanner.v1.PlanNode.ChildLink} ChildLink instance + */ + ChildLink.create = function create(properties) { + return new ChildLink(properties); + }; + + /** + * Encodes the specified ChildLink message. Does not implicitly {@link google.spanner.v1.PlanNode.ChildLink.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.PlanNode.ChildLink + * @static + * @param {google.spanner.v1.PlanNode.IChildLink} message ChildLink message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ChildLink.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.childIndex != null && Object.hasOwnProperty.call(message, "childIndex")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.childIndex); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.type); + if (message.variable != null && Object.hasOwnProperty.call(message, "variable")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.variable); + return writer; + }; + + /** + * Encodes the specified ChildLink message, length delimited. Does not implicitly {@link google.spanner.v1.PlanNode.ChildLink.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.PlanNode.ChildLink + * @static + * @param {google.spanner.v1.PlanNode.IChildLink} message ChildLink message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ChildLink.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ChildLink message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.PlanNode.ChildLink + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.PlanNode.ChildLink} ChildLink + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ChildLink.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.PlanNode.ChildLink(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.childIndex = reader.int32(); + break; + } + case 2: { + message.type = reader.string(); + break; + } + case 3: { + message.variable = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ChildLink message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.PlanNode.ChildLink + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.PlanNode.ChildLink} ChildLink + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ChildLink.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ChildLink message. + * @function verify + * @memberof google.spanner.v1.PlanNode.ChildLink + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ChildLink.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.childIndex != null && message.hasOwnProperty("childIndex")) + if (!$util.isInteger(message.childIndex)) + return "childIndex: integer expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.variable != null && message.hasOwnProperty("variable")) + if (!$util.isString(message.variable)) + return "variable: string expected"; + return null; + }; + + /** + * Creates a ChildLink message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.PlanNode.ChildLink + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.PlanNode.ChildLink} ChildLink + */ + ChildLink.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.PlanNode.ChildLink) + return object; + var message = new $root.google.spanner.v1.PlanNode.ChildLink(); + if (object.childIndex != null) + message.childIndex = object.childIndex | 0; + if (object.type != null) + message.type = String(object.type); + if (object.variable != null) + message.variable = String(object.variable); + return message; + }; + + /** + * Creates a plain object from a ChildLink message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.PlanNode.ChildLink + * @static + * @param {google.spanner.v1.PlanNode.ChildLink} message ChildLink + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ChildLink.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.childIndex = 0; + object.type = ""; + object.variable = ""; + } + if (message.childIndex != null && message.hasOwnProperty("childIndex")) + object.childIndex = message.childIndex; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.variable != null && message.hasOwnProperty("variable")) + object.variable = message.variable; + return object; + }; + + /** + * Converts this ChildLink to JSON. + * @function toJSON + * @memberof google.spanner.v1.PlanNode.ChildLink + * @instance + * @returns {Object.} JSON object + */ + ChildLink.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ChildLink + * @function getTypeUrl + * @memberof google.spanner.v1.PlanNode.ChildLink + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ChildLink.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.PlanNode.ChildLink"; + }; + + return ChildLink; + })(); + + PlanNode.ShortRepresentation = (function() { + + /** + * Properties of a ShortRepresentation. + * @memberof google.spanner.v1.PlanNode + * @interface IShortRepresentation + * @property {string|null} [description] ShortRepresentation description + * @property {Object.|null} [subqueries] ShortRepresentation subqueries + */ + + /** + * Constructs a new ShortRepresentation. + * @memberof google.spanner.v1.PlanNode + * @classdesc Represents a ShortRepresentation. + * @implements IShortRepresentation + * @constructor + * @param {google.spanner.v1.PlanNode.IShortRepresentation=} [properties] Properties to set + */ + function ShortRepresentation(properties) { + this.subqueries = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ShortRepresentation description. + * @member {string} description + * @memberof google.spanner.v1.PlanNode.ShortRepresentation + * @instance + */ + ShortRepresentation.prototype.description = ""; + + /** + * ShortRepresentation subqueries. + * @member {Object.} subqueries + * @memberof google.spanner.v1.PlanNode.ShortRepresentation + * @instance + */ + ShortRepresentation.prototype.subqueries = $util.emptyObject; + + /** + * Creates a new ShortRepresentation instance using the specified properties. + * @function create + * @memberof google.spanner.v1.PlanNode.ShortRepresentation + * @static + * @param {google.spanner.v1.PlanNode.IShortRepresentation=} [properties] Properties to set + * @returns {google.spanner.v1.PlanNode.ShortRepresentation} ShortRepresentation instance + */ + ShortRepresentation.create = function create(properties) { + return new ShortRepresentation(properties); + }; + + /** + * Encodes the specified ShortRepresentation message. Does not implicitly {@link google.spanner.v1.PlanNode.ShortRepresentation.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.PlanNode.ShortRepresentation + * @static + * @param {google.spanner.v1.PlanNode.IShortRepresentation} message ShortRepresentation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShortRepresentation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.description); + if (message.subqueries != null && Object.hasOwnProperty.call(message, "subqueries")) + for (var keys = Object.keys(message.subqueries), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 0 =*/16).int32(message.subqueries[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified ShortRepresentation message, length delimited. Does not implicitly {@link google.spanner.v1.PlanNode.ShortRepresentation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.PlanNode.ShortRepresentation + * @static + * @param {google.spanner.v1.PlanNode.IShortRepresentation} message ShortRepresentation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShortRepresentation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ShortRepresentation message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.PlanNode.ShortRepresentation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.PlanNode.ShortRepresentation} ShortRepresentation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShortRepresentation.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.PlanNode.ShortRepresentation(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.description = reader.string(); + break; + } + case 2: { + if (message.subqueries === $util.emptyObject) + message.subqueries = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = 0; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.int32(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.subqueries[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ShortRepresentation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.PlanNode.ShortRepresentation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.PlanNode.ShortRepresentation} ShortRepresentation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShortRepresentation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ShortRepresentation message. + * @function verify + * @memberof google.spanner.v1.PlanNode.ShortRepresentation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ShortRepresentation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.subqueries != null && message.hasOwnProperty("subqueries")) { + if (!$util.isObject(message.subqueries)) + return "subqueries: object expected"; + var key = Object.keys(message.subqueries); + for (var i = 0; i < key.length; ++i) + if (!$util.isInteger(message.subqueries[key[i]])) + return "subqueries: integer{k:string} expected"; + } + return null; + }; + + /** + * Creates a ShortRepresentation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.PlanNode.ShortRepresentation + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.PlanNode.ShortRepresentation} ShortRepresentation + */ + ShortRepresentation.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.PlanNode.ShortRepresentation) + return object; + var message = new $root.google.spanner.v1.PlanNode.ShortRepresentation(); + if (object.description != null) + message.description = String(object.description); + if (object.subqueries) { + if (typeof object.subqueries !== "object") + throw TypeError(".google.spanner.v1.PlanNode.ShortRepresentation.subqueries: object expected"); + message.subqueries = {}; + for (var keys = Object.keys(object.subqueries), i = 0; i < keys.length; ++i) + message.subqueries[keys[i]] = object.subqueries[keys[i]] | 0; + } + return message; + }; + + /** + * Creates a plain object from a ShortRepresentation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.PlanNode.ShortRepresentation + * @static + * @param {google.spanner.v1.PlanNode.ShortRepresentation} message ShortRepresentation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ShortRepresentation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.subqueries = {}; + if (options.defaults) + object.description = ""; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + var keys2; + if (message.subqueries && (keys2 = Object.keys(message.subqueries)).length) { + object.subqueries = {}; + for (var j = 0; j < keys2.length; ++j) + object.subqueries[keys2[j]] = message.subqueries[keys2[j]]; + } + return object; + }; + + /** + * Converts this ShortRepresentation to JSON. + * @function toJSON + * @memberof google.spanner.v1.PlanNode.ShortRepresentation + * @instance + * @returns {Object.} JSON object + */ + ShortRepresentation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ShortRepresentation + * @function getTypeUrl + * @memberof google.spanner.v1.PlanNode.ShortRepresentation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ShortRepresentation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.PlanNode.ShortRepresentation"; + }; + + return ShortRepresentation; + })(); + + return PlanNode; + })(); + + v1.QueryAdvisorResult = (function() { + + /** + * Properties of a QueryAdvisorResult. + * @memberof google.spanner.v1 + * @interface IQueryAdvisorResult + * @property {Array.|null} [indexAdvice] QueryAdvisorResult indexAdvice + */ + + /** + * Constructs a new QueryAdvisorResult. + * @memberof google.spanner.v1 + * @classdesc Represents a QueryAdvisorResult. + * @implements IQueryAdvisorResult + * @constructor + * @param {google.spanner.v1.IQueryAdvisorResult=} [properties] Properties to set + */ + function QueryAdvisorResult(properties) { + this.indexAdvice = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryAdvisorResult indexAdvice. + * @member {Array.} indexAdvice + * @memberof google.spanner.v1.QueryAdvisorResult + * @instance + */ + QueryAdvisorResult.prototype.indexAdvice = $util.emptyArray; + + /** + * Creates a new QueryAdvisorResult instance using the specified properties. + * @function create + * @memberof google.spanner.v1.QueryAdvisorResult + * @static + * @param {google.spanner.v1.IQueryAdvisorResult=} [properties] Properties to set + * @returns {google.spanner.v1.QueryAdvisorResult} QueryAdvisorResult instance + */ + QueryAdvisorResult.create = function create(properties) { + return new QueryAdvisorResult(properties); + }; + + /** + * Encodes the specified QueryAdvisorResult message. Does not implicitly {@link google.spanner.v1.QueryAdvisorResult.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.QueryAdvisorResult + * @static + * @param {google.spanner.v1.IQueryAdvisorResult} message QueryAdvisorResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryAdvisorResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.indexAdvice != null && message.indexAdvice.length) + for (var i = 0; i < message.indexAdvice.length; ++i) + $root.google.spanner.v1.QueryAdvisorResult.IndexAdvice.encode(message.indexAdvice[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryAdvisorResult message, length delimited. Does not implicitly {@link google.spanner.v1.QueryAdvisorResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.QueryAdvisorResult + * @static + * @param {google.spanner.v1.IQueryAdvisorResult} message QueryAdvisorResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryAdvisorResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryAdvisorResult message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.QueryAdvisorResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.QueryAdvisorResult} QueryAdvisorResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryAdvisorResult.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.QueryAdvisorResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.indexAdvice && message.indexAdvice.length)) + message.indexAdvice = []; + message.indexAdvice.push($root.google.spanner.v1.QueryAdvisorResult.IndexAdvice.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryAdvisorResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.QueryAdvisorResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.QueryAdvisorResult} QueryAdvisorResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryAdvisorResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryAdvisorResult message. + * @function verify + * @memberof google.spanner.v1.QueryAdvisorResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryAdvisorResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.indexAdvice != null && message.hasOwnProperty("indexAdvice")) { + if (!Array.isArray(message.indexAdvice)) + return "indexAdvice: array expected"; + for (var i = 0; i < message.indexAdvice.length; ++i) { + var error = $root.google.spanner.v1.QueryAdvisorResult.IndexAdvice.verify(message.indexAdvice[i]); + if (error) + return "indexAdvice." + error; + } + } + return null; + }; + + /** + * Creates a QueryAdvisorResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.QueryAdvisorResult + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.QueryAdvisorResult} QueryAdvisorResult + */ + QueryAdvisorResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.QueryAdvisorResult) + return object; + var message = new $root.google.spanner.v1.QueryAdvisorResult(); + if (object.indexAdvice) { + if (!Array.isArray(object.indexAdvice)) + throw TypeError(".google.spanner.v1.QueryAdvisorResult.indexAdvice: array expected"); + message.indexAdvice = []; + for (var i = 0; i < object.indexAdvice.length; ++i) { + if (typeof object.indexAdvice[i] !== "object") + throw TypeError(".google.spanner.v1.QueryAdvisorResult.indexAdvice: object expected"); + message.indexAdvice[i] = $root.google.spanner.v1.QueryAdvisorResult.IndexAdvice.fromObject(object.indexAdvice[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a QueryAdvisorResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.QueryAdvisorResult + * @static + * @param {google.spanner.v1.QueryAdvisorResult} message QueryAdvisorResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryAdvisorResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.indexAdvice = []; + if (message.indexAdvice && message.indexAdvice.length) { + object.indexAdvice = []; + for (var j = 0; j < message.indexAdvice.length; ++j) + object.indexAdvice[j] = $root.google.spanner.v1.QueryAdvisorResult.IndexAdvice.toObject(message.indexAdvice[j], options); + } + return object; + }; + + /** + * Converts this QueryAdvisorResult to JSON. + * @function toJSON + * @memberof google.spanner.v1.QueryAdvisorResult + * @instance + * @returns {Object.} JSON object + */ + QueryAdvisorResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for QueryAdvisorResult + * @function getTypeUrl + * @memberof google.spanner.v1.QueryAdvisorResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + QueryAdvisorResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.QueryAdvisorResult"; + }; + + QueryAdvisorResult.IndexAdvice = (function() { + + /** + * Properties of an IndexAdvice. + * @memberof google.spanner.v1.QueryAdvisorResult + * @interface IIndexAdvice + * @property {Array.|null} [ddl] IndexAdvice ddl + * @property {number|null} [improvementFactor] IndexAdvice improvementFactor + */ + + /** + * Constructs a new IndexAdvice. + * @memberof google.spanner.v1.QueryAdvisorResult + * @classdesc Represents an IndexAdvice. + * @implements IIndexAdvice + * @constructor + * @param {google.spanner.v1.QueryAdvisorResult.IIndexAdvice=} [properties] Properties to set + */ + function IndexAdvice(properties) { + this.ddl = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * IndexAdvice ddl. + * @member {Array.} ddl + * @memberof google.spanner.v1.QueryAdvisorResult.IndexAdvice + * @instance + */ + IndexAdvice.prototype.ddl = $util.emptyArray; + + /** + * IndexAdvice improvementFactor. + * @member {number} improvementFactor + * @memberof google.spanner.v1.QueryAdvisorResult.IndexAdvice + * @instance + */ + IndexAdvice.prototype.improvementFactor = 0; + + /** + * Creates a new IndexAdvice instance using the specified properties. + * @function create + * @memberof google.spanner.v1.QueryAdvisorResult.IndexAdvice + * @static + * @param {google.spanner.v1.QueryAdvisorResult.IIndexAdvice=} [properties] Properties to set + * @returns {google.spanner.v1.QueryAdvisorResult.IndexAdvice} IndexAdvice instance + */ + IndexAdvice.create = function create(properties) { + return new IndexAdvice(properties); + }; + + /** + * Encodes the specified IndexAdvice message. Does not implicitly {@link google.spanner.v1.QueryAdvisorResult.IndexAdvice.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.QueryAdvisorResult.IndexAdvice + * @static + * @param {google.spanner.v1.QueryAdvisorResult.IIndexAdvice} message IndexAdvice message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IndexAdvice.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ddl != null && message.ddl.length) + for (var i = 0; i < message.ddl.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.ddl[i]); + if (message.improvementFactor != null && Object.hasOwnProperty.call(message, "improvementFactor")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.improvementFactor); + return writer; + }; + + /** + * Encodes the specified IndexAdvice message, length delimited. Does not implicitly {@link google.spanner.v1.QueryAdvisorResult.IndexAdvice.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.QueryAdvisorResult.IndexAdvice + * @static + * @param {google.spanner.v1.QueryAdvisorResult.IIndexAdvice} message IndexAdvice message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IndexAdvice.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IndexAdvice message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.QueryAdvisorResult.IndexAdvice + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.QueryAdvisorResult.IndexAdvice} IndexAdvice + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IndexAdvice.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.QueryAdvisorResult.IndexAdvice(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.ddl && message.ddl.length)) + message.ddl = []; + message.ddl.push(reader.string()); + break; + } + case 2: { + message.improvementFactor = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IndexAdvice message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.QueryAdvisorResult.IndexAdvice + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.QueryAdvisorResult.IndexAdvice} IndexAdvice + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IndexAdvice.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IndexAdvice message. + * @function verify + * @memberof google.spanner.v1.QueryAdvisorResult.IndexAdvice + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IndexAdvice.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ddl != null && message.hasOwnProperty("ddl")) { + if (!Array.isArray(message.ddl)) + return "ddl: array expected"; + for (var i = 0; i < message.ddl.length; ++i) + if (!$util.isString(message.ddl[i])) + return "ddl: string[] expected"; + } + if (message.improvementFactor != null && message.hasOwnProperty("improvementFactor")) + if (typeof message.improvementFactor !== "number") + return "improvementFactor: number expected"; + return null; + }; + + /** + * Creates an IndexAdvice message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.QueryAdvisorResult.IndexAdvice + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.QueryAdvisorResult.IndexAdvice} IndexAdvice + */ + IndexAdvice.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.QueryAdvisorResult.IndexAdvice) + return object; + var message = new $root.google.spanner.v1.QueryAdvisorResult.IndexAdvice(); + if (object.ddl) { + if (!Array.isArray(object.ddl)) + throw TypeError(".google.spanner.v1.QueryAdvisorResult.IndexAdvice.ddl: array expected"); + message.ddl = []; + for (var i = 0; i < object.ddl.length; ++i) + message.ddl[i] = String(object.ddl[i]); + } + if (object.improvementFactor != null) + message.improvementFactor = Number(object.improvementFactor); + return message; + }; + + /** + * Creates a plain object from an IndexAdvice message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.QueryAdvisorResult.IndexAdvice + * @static + * @param {google.spanner.v1.QueryAdvisorResult.IndexAdvice} message IndexAdvice + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IndexAdvice.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.ddl = []; + if (options.defaults) + object.improvementFactor = 0; + if (message.ddl && message.ddl.length) { + object.ddl = []; + for (var j = 0; j < message.ddl.length; ++j) + object.ddl[j] = message.ddl[j]; + } + if (message.improvementFactor != null && message.hasOwnProperty("improvementFactor")) + object.improvementFactor = options.json && !isFinite(message.improvementFactor) ? String(message.improvementFactor) : message.improvementFactor; + return object; + }; + + /** + * Converts this IndexAdvice to JSON. + * @function toJSON + * @memberof google.spanner.v1.QueryAdvisorResult.IndexAdvice + * @instance + * @returns {Object.} JSON object + */ + IndexAdvice.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IndexAdvice + * @function getTypeUrl + * @memberof google.spanner.v1.QueryAdvisorResult.IndexAdvice + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IndexAdvice.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.QueryAdvisorResult.IndexAdvice"; + }; + + return IndexAdvice; + })(); + + return QueryAdvisorResult; + })(); + + v1.QueryPlan = (function() { + + /** + * Properties of a QueryPlan. + * @memberof google.spanner.v1 + * @interface IQueryPlan + * @property {Array.|null} [planNodes] QueryPlan planNodes + * @property {google.spanner.v1.IQueryAdvisorResult|null} [queryAdvice] QueryPlan queryAdvice + */ + + /** + * Constructs a new QueryPlan. + * @memberof google.spanner.v1 + * @classdesc Represents a QueryPlan. + * @implements IQueryPlan + * @constructor + * @param {google.spanner.v1.IQueryPlan=} [properties] Properties to set + */ + function QueryPlan(properties) { + this.planNodes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryPlan planNodes. + * @member {Array.} planNodes + * @memberof google.spanner.v1.QueryPlan + * @instance + */ + QueryPlan.prototype.planNodes = $util.emptyArray; + + /** + * QueryPlan queryAdvice. + * @member {google.spanner.v1.IQueryAdvisorResult|null|undefined} queryAdvice + * @memberof google.spanner.v1.QueryPlan + * @instance + */ + QueryPlan.prototype.queryAdvice = null; + + /** + * Creates a new QueryPlan instance using the specified properties. + * @function create + * @memberof google.spanner.v1.QueryPlan + * @static + * @param {google.spanner.v1.IQueryPlan=} [properties] Properties to set + * @returns {google.spanner.v1.QueryPlan} QueryPlan instance + */ + QueryPlan.create = function create(properties) { + return new QueryPlan(properties); + }; + + /** + * Encodes the specified QueryPlan message. Does not implicitly {@link google.spanner.v1.QueryPlan.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.QueryPlan + * @static + * @param {google.spanner.v1.IQueryPlan} message QueryPlan message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryPlan.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.planNodes != null && message.planNodes.length) + for (var i = 0; i < message.planNodes.length; ++i) + $root.google.spanner.v1.PlanNode.encode(message.planNodes[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.queryAdvice != null && Object.hasOwnProperty.call(message, "queryAdvice")) + $root.google.spanner.v1.QueryAdvisorResult.encode(message.queryAdvice, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryPlan message, length delimited. Does not implicitly {@link google.spanner.v1.QueryPlan.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.QueryPlan + * @static + * @param {google.spanner.v1.IQueryPlan} message QueryPlan message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryPlan.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryPlan message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.QueryPlan + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.QueryPlan} QueryPlan + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryPlan.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.QueryPlan(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.planNodes && message.planNodes.length)) + message.planNodes = []; + message.planNodes.push($root.google.spanner.v1.PlanNode.decode(reader, reader.uint32())); + break; + } + case 2: { + message.queryAdvice = $root.google.spanner.v1.QueryAdvisorResult.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryPlan message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.QueryPlan + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.QueryPlan} QueryPlan + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryPlan.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryPlan message. + * @function verify + * @memberof google.spanner.v1.QueryPlan + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryPlan.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.planNodes != null && message.hasOwnProperty("planNodes")) { + if (!Array.isArray(message.planNodes)) + return "planNodes: array expected"; + for (var i = 0; i < message.planNodes.length; ++i) { + var error = $root.google.spanner.v1.PlanNode.verify(message.planNodes[i]); + if (error) + return "planNodes." + error; + } + } + if (message.queryAdvice != null && message.hasOwnProperty("queryAdvice")) { + var error = $root.google.spanner.v1.QueryAdvisorResult.verify(message.queryAdvice); + if (error) + return "queryAdvice." + error; + } + return null; + }; + + /** + * Creates a QueryPlan message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.QueryPlan + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.QueryPlan} QueryPlan + */ + QueryPlan.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.QueryPlan) + return object; + var message = new $root.google.spanner.v1.QueryPlan(); + if (object.planNodes) { + if (!Array.isArray(object.planNodes)) + throw TypeError(".google.spanner.v1.QueryPlan.planNodes: array expected"); + message.planNodes = []; + for (var i = 0; i < object.planNodes.length; ++i) { + if (typeof object.planNodes[i] !== "object") + throw TypeError(".google.spanner.v1.QueryPlan.planNodes: object expected"); + message.planNodes[i] = $root.google.spanner.v1.PlanNode.fromObject(object.planNodes[i]); + } + } + if (object.queryAdvice != null) { + if (typeof object.queryAdvice !== "object") + throw TypeError(".google.spanner.v1.QueryPlan.queryAdvice: object expected"); + message.queryAdvice = $root.google.spanner.v1.QueryAdvisorResult.fromObject(object.queryAdvice); + } + return message; + }; + + /** + * Creates a plain object from a QueryPlan message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.QueryPlan + * @static + * @param {google.spanner.v1.QueryPlan} message QueryPlan + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryPlan.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.planNodes = []; + if (options.defaults) + object.queryAdvice = null; + if (message.planNodes && message.planNodes.length) { + object.planNodes = []; + for (var j = 0; j < message.planNodes.length; ++j) + object.planNodes[j] = $root.google.spanner.v1.PlanNode.toObject(message.planNodes[j], options); + } + if (message.queryAdvice != null && message.hasOwnProperty("queryAdvice")) + object.queryAdvice = $root.google.spanner.v1.QueryAdvisorResult.toObject(message.queryAdvice, options); + return object; + }; + + /** + * Converts this QueryPlan to JSON. + * @function toJSON + * @memberof google.spanner.v1.QueryPlan + * @instance + * @returns {Object.} JSON object + */ + QueryPlan.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for QueryPlan + * @function getTypeUrl + * @memberof google.spanner.v1.QueryPlan + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + QueryPlan.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.QueryPlan"; + }; + + return QueryPlan; + })(); + + return v1; + })(); + + return spanner; + })(); + + google.api = (function() { + + /** + * Namespace api. + * @memberof google + * @namespace + */ + var api = {}; + + /** + * FieldBehavior enum. + * @name google.api.FieldBehavior + * @enum {number} + * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value + * @property {number} OPTIONAL=1 OPTIONAL value + * @property {number} REQUIRED=2 REQUIRED value + * @property {number} OUTPUT_ONLY=3 OUTPUT_ONLY value + * @property {number} INPUT_ONLY=4 INPUT_ONLY value + * @property {number} IMMUTABLE=5 IMMUTABLE value + * @property {number} UNORDERED_LIST=6 UNORDERED_LIST value + * @property {number} NON_EMPTY_DEFAULT=7 NON_EMPTY_DEFAULT value + * @property {number} IDENTIFIER=8 IDENTIFIER value + */ + api.FieldBehavior = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_BEHAVIOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "OPTIONAL"] = 1; + values[valuesById[2] = "REQUIRED"] = 2; + values[valuesById[3] = "OUTPUT_ONLY"] = 3; + values[valuesById[4] = "INPUT_ONLY"] = 4; + values[valuesById[5] = "IMMUTABLE"] = 5; + values[valuesById[6] = "UNORDERED_LIST"] = 6; + values[valuesById[7] = "NON_EMPTY_DEFAULT"] = 7; + values[valuesById[8] = "IDENTIFIER"] = 8; + return values; + })(); + + api.ResourceDescriptor = (function() { + + /** + * Properties of a ResourceDescriptor. + * @memberof google.api + * @interface IResourceDescriptor + * @property {string|null} [type] ResourceDescriptor type + * @property {Array.|null} [pattern] ResourceDescriptor pattern + * @property {string|null} [nameField] ResourceDescriptor nameField + * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history + * @property {string|null} [plural] ResourceDescriptor plural + * @property {string|null} [singular] ResourceDescriptor singular + * @property {Array.|null} [style] ResourceDescriptor style + */ + + /** + * Constructs a new ResourceDescriptor. + * @memberof google.api + * @classdesc Represents a ResourceDescriptor. + * @implements IResourceDescriptor + * @constructor + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + */ + function ResourceDescriptor(properties) { + this.pattern = []; + this.style = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceDescriptor type. + * @member {string} type + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.type = ""; + + /** + * ResourceDescriptor pattern. + * @member {Array.} pattern + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.pattern = $util.emptyArray; + + /** + * ResourceDescriptor nameField. + * @member {string} nameField + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.nameField = ""; + + /** + * ResourceDescriptor history. + * @member {google.api.ResourceDescriptor.History} history + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.history = 0; + + /** + * ResourceDescriptor plural. + * @member {string} plural + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.plural = ""; + + /** + * ResourceDescriptor singular. + * @member {string} singular + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.singular = ""; + + /** + * ResourceDescriptor style. + * @member {Array.} style + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.style = $util.emptyArray; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @function create + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance + */ + ResourceDescriptor.create = function create(properties) { + return new ResourceDescriptor(properties); + }; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.pattern != null && message.pattern.length) + for (var i = 0; i < message.pattern.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pattern[i]); + if (message.nameField != null && Object.hasOwnProperty.call(message, "nameField")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); + if (message.history != null && Object.hasOwnProperty.call(message, "history")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); + if (message.plural != null && Object.hasOwnProperty.call(message, "plural")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); + if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); + if (message.style != null && message.style.length) { + writer.uint32(/* id 10, wireType 2 =*/82).fork(); + for (var i = 0; i < message.style.length; ++i) + writer.int32(message.style[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceDescriptor(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + if (!(message.pattern && message.pattern.length)) + message.pattern = []; + message.pattern.push(reader.string()); + break; + } + case 3: { + message.nameField = reader.string(); + break; + } + case 4: { + message.history = reader.int32(); + break; + } + case 5: { + message.plural = reader.string(); + break; + } + case 6: { + message.singular = reader.string(); + break; + } + case 10: { + if (!(message.style && message.style.length)) + message.style = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.style.push(reader.int32()); + } else + message.style.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceDescriptor message. + * @function verify + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceDescriptor.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.pattern != null && message.hasOwnProperty("pattern")) { + if (!Array.isArray(message.pattern)) + return "pattern: array expected"; + for (var i = 0; i < message.pattern.length; ++i) + if (!$util.isString(message.pattern[i])) + return "pattern: string[] expected"; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + if (!$util.isString(message.nameField)) + return "nameField: string expected"; + if (message.history != null && message.hasOwnProperty("history")) + switch (message.history) { + default: + return "history: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.plural != null && message.hasOwnProperty("plural")) + if (!$util.isString(message.plural)) + return "plural: string expected"; + if (message.singular != null && message.hasOwnProperty("singular")) + if (!$util.isString(message.singular)) + return "singular: string expected"; + if (message.style != null && message.hasOwnProperty("style")) { + if (!Array.isArray(message.style)) + return "style: array expected"; + for (var i = 0; i < message.style.length; ++i) + switch (message.style[i]) { + default: + return "style: enum value[] expected"; + case 0: + case 1: + break; + } + } + return null; + }; + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + */ + ResourceDescriptor.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceDescriptor) + return object; + var message = new $root.google.api.ResourceDescriptor(); + if (object.type != null) + message.type = String(object.type); + if (object.pattern) { + if (!Array.isArray(object.pattern)) + throw TypeError(".google.api.ResourceDescriptor.pattern: array expected"); + message.pattern = []; + for (var i = 0; i < object.pattern.length; ++i) + message.pattern[i] = String(object.pattern[i]); + } + if (object.nameField != null) + message.nameField = String(object.nameField); + switch (object.history) { + default: + if (typeof object.history === "number") { + message.history = object.history; + break; + } + break; + case "HISTORY_UNSPECIFIED": + case 0: + message.history = 0; + break; + case "ORIGINALLY_SINGLE_PATTERN": + case 1: + message.history = 1; + break; + case "FUTURE_MULTI_PATTERN": + case 2: + message.history = 2; + break; + } + if (object.plural != null) + message.plural = String(object.plural); + if (object.singular != null) + message.singular = String(object.singular); + if (object.style) { + if (!Array.isArray(object.style)) + throw TypeError(".google.api.ResourceDescriptor.style: array expected"); + message.style = []; + for (var i = 0; i < object.style.length; ++i) + switch (object.style[i]) { + default: + if (typeof object.style[i] === "number") { + message.style[i] = object.style[i]; + break; + } + case "STYLE_UNSPECIFIED": + case 0: + message.style[i] = 0; + break; + case "DECLARATIVE_FRIENDLY": + case 1: + message.style[i] = 1; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.ResourceDescriptor} message ResourceDescriptor + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceDescriptor.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.pattern = []; + object.style = []; + } + if (options.defaults) { + object.type = ""; + object.nameField = ""; + object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; + object.plural = ""; + object.singular = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.pattern && message.pattern.length) { + object.pattern = []; + for (var j = 0; j < message.pattern.length; ++j) + object.pattern[j] = message.pattern[j]; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + object.nameField = message.nameField; + if (message.history != null && message.hasOwnProperty("history")) + object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] === undefined ? message.history : $root.google.api.ResourceDescriptor.History[message.history] : message.history; + if (message.plural != null && message.hasOwnProperty("plural")) + object.plural = message.plural; + if (message.singular != null && message.hasOwnProperty("singular")) + object.singular = message.singular; + if (message.style && message.style.length) { + object.style = []; + for (var j = 0; j < message.style.length; ++j) + object.style[j] = options.enums === String ? $root.google.api.ResourceDescriptor.Style[message.style[j]] === undefined ? message.style[j] : $root.google.api.ResourceDescriptor.Style[message.style[j]] : message.style[j]; + } + return object; + }; + + /** + * Converts this ResourceDescriptor to JSON. + * @function toJSON + * @memberof google.api.ResourceDescriptor + * @instance + * @returns {Object.} JSON object + */ + ResourceDescriptor.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceDescriptor + * @function getTypeUrl + * @memberof google.api.ResourceDescriptor + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceDescriptor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceDescriptor"; + }; + + /** + * History enum. + * @name google.api.ResourceDescriptor.History + * @enum {number} + * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value + * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value + * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value + */ + ResourceDescriptor.History = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HISTORY_UNSPECIFIED"] = 0; + values[valuesById[1] = "ORIGINALLY_SINGLE_PATTERN"] = 1; + values[valuesById[2] = "FUTURE_MULTI_PATTERN"] = 2; + return values; + })(); + + /** + * Style enum. + * @name google.api.ResourceDescriptor.Style + * @enum {number} + * @property {number} STYLE_UNSPECIFIED=0 STYLE_UNSPECIFIED value + * @property {number} DECLARATIVE_FRIENDLY=1 DECLARATIVE_FRIENDLY value + */ + ResourceDescriptor.Style = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STYLE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DECLARATIVE_FRIENDLY"] = 1; + return values; + })(); + + return ResourceDescriptor; + })(); + + api.ResourceReference = (function() { + + /** + * Properties of a ResourceReference. + * @memberof google.api + * @interface IResourceReference + * @property {string|null} [type] ResourceReference type + * @property {string|null} [childType] ResourceReference childType + */ + + /** + * Constructs a new ResourceReference. + * @memberof google.api + * @classdesc Represents a ResourceReference. + * @implements IResourceReference + * @constructor + * @param {google.api.IResourceReference=} [properties] Properties to set + */ + function ResourceReference(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceReference type. + * @member {string} type + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.type = ""; + + /** + * ResourceReference childType. + * @member {string} childType + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.childType = ""; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @function create + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference=} [properties] Properties to set + * @returns {google.api.ResourceReference} ResourceReference instance + */ + ResourceReference.create = function create(properties) { + return new ResourceReference(properties); + }; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.childType != null && Object.hasOwnProperty.call(message, "childType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); + return writer; + }; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceReference(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + message.childType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceReference message. + * @function verify + * @memberof google.api.ResourceReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceReference.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.childType != null && message.hasOwnProperty("childType")) + if (!$util.isString(message.childType)) + return "childType: string expected"; + return null; + }; + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceReference + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceReference} ResourceReference + */ + ResourceReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceReference) + return object; + var message = new $root.google.api.ResourceReference(); + if (object.type != null) + message.type = String(object.type); + if (object.childType != null) + message.childType = String(object.childType); + return message; + }; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceReference + * @static + * @param {google.api.ResourceReference} message ResourceReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceReference.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = ""; + object.childType = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.childType != null && message.hasOwnProperty("childType")) + object.childType = message.childType; + return object; + }; + + /** + * Converts this ResourceReference to JSON. + * @function toJSON + * @memberof google.api.ResourceReference + * @instance + * @returns {Object.} JSON object + */ + ResourceReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceReference + * @function getTypeUrl + * @memberof google.api.ResourceReference + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceReference"; + }; + + return ResourceReference; + })(); + + api.Http = (function() { + + /** + * Properties of a Http. + * @memberof google.api + * @interface IHttp + * @property {Array.|null} [rules] Http rules + * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion + */ + + /** + * Constructs a new Http. + * @memberof google.api + * @classdesc Represents a Http. + * @implements IHttp + * @constructor + * @param {google.api.IHttp=} [properties] Properties to set + */ + function Http(properties) { + this.rules = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Http rules. + * @member {Array.} rules + * @memberof google.api.Http + * @instance + */ + Http.prototype.rules = $util.emptyArray; + + /** + * Http fullyDecodeReservedExpansion. + * @member {boolean} fullyDecodeReservedExpansion + * @memberof google.api.Http + * @instance + */ + Http.prototype.fullyDecodeReservedExpansion = false; + + /** + * Creates a new Http instance using the specified properties. + * @function create + * @memberof google.api.Http + * @static + * @param {google.api.IHttp=} [properties] Properties to set + * @returns {google.api.Http} Http instance + */ + Http.create = function create(properties) { + return new Http(properties); + }; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encode + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rules != null && message.rules.length) + for (var i = 0; i < message.rules.length; ++i) + $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); + return writer; + }; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Http message from the specified reader or buffer. + * @function decode + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + case 2: { + message.fullyDecodeReservedExpansion = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Http message. + * @function verify + * @memberof google.api.Http + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Http.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rules != null && message.hasOwnProperty("rules")) { + if (!Array.isArray(message.rules)) + return "rules: array expected"; + for (var i = 0; i < message.rules.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.rules[i]); + if (error) + return "rules." + error; + } + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + if (typeof message.fullyDecodeReservedExpansion !== "boolean") + return "fullyDecodeReservedExpansion: boolean expected"; + return null; + }; + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Http + * @static + * @param {Object.} object Plain object + * @returns {google.api.Http} Http + */ + Http.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Http) + return object; + var message = new $root.google.api.Http(); + if (object.rules) { + if (!Array.isArray(object.rules)) + throw TypeError(".google.api.Http.rules: array expected"); + message.rules = []; + for (var i = 0; i < object.rules.length; ++i) { + if (typeof object.rules[i] !== "object") + throw TypeError(".google.api.Http.rules: object expected"); + message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); + } + } + if (object.fullyDecodeReservedExpansion != null) + message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); + return message; + }; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Http + * @static + * @param {google.api.Http} message Http + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Http.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rules = []; + if (options.defaults) + object.fullyDecodeReservedExpansion = false; + if (message.rules && message.rules.length) { + object.rules = []; + for (var j = 0; j < message.rules.length; ++j) + object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; + return object; + }; + + /** + * Converts this Http to JSON. + * @function toJSON + * @memberof google.api.Http + * @instance + * @returns {Object.} JSON object + */ + Http.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Http + * @function getTypeUrl + * @memberof google.api.Http + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Http.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Http"; + }; + + return Http; + })(); + + api.HttpRule = (function() { + + /** + * Properties of a HttpRule. + * @memberof google.api + * @interface IHttpRule + * @property {string|null} [selector] HttpRule selector + * @property {string|null} [get] HttpRule get + * @property {string|null} [put] HttpRule put + * @property {string|null} [post] HttpRule post + * @property {string|null} ["delete"] HttpRule delete + * @property {string|null} [patch] HttpRule patch + * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom + * @property {string|null} [body] HttpRule body + * @property {string|null} [responseBody] HttpRule responseBody + * @property {Array.|null} [additionalBindings] HttpRule additionalBindings + */ + + /** + * Constructs a new HttpRule. + * @memberof google.api + * @classdesc Represents a HttpRule. + * @implements IHttpRule + * @constructor + * @param {google.api.IHttpRule=} [properties] Properties to set + */ + function HttpRule(properties) { + this.additionalBindings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HttpRule selector. + * @member {string} selector + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.selector = ""; + + /** + * HttpRule get. + * @member {string|null|undefined} get + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.get = null; + + /** + * HttpRule put. + * @member {string|null|undefined} put + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.put = null; + + /** + * HttpRule post. + * @member {string|null|undefined} post + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.post = null; + + /** + * HttpRule delete. + * @member {string|null|undefined} delete + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype["delete"] = null; + + /** + * HttpRule patch. + * @member {string|null|undefined} patch + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.patch = null; + + /** + * HttpRule custom. + * @member {google.api.ICustomHttpPattern|null|undefined} custom + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.custom = null; + + /** + * HttpRule body. + * @member {string} body + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.body = ""; + + /** + * HttpRule responseBody. + * @member {string} responseBody + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.responseBody = ""; + + /** + * HttpRule additionalBindings. + * @member {Array.} additionalBindings + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.additionalBindings = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HttpRule pattern. + * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern + * @memberof google.api.HttpRule + * @instance + */ + Object.defineProperty(HttpRule.prototype, "pattern", { + get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HttpRule instance using the specified properties. + * @function create + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule=} [properties] Properties to set + * @returns {google.api.HttpRule} HttpRule instance + */ + HttpRule.create = function create(properties) { + return new HttpRule(properties); + }; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encode + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.get != null && Object.hasOwnProperty.call(message, "get")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); + if (message.put != null && Object.hasOwnProperty.call(message, "put")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); + if (message.post != null && Object.hasOwnProperty.call(message, "post")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); + if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); + if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); + if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) + $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.additionalBindings != null && message.additionalBindings.length) + for (var i = 0; i < message.additionalBindings.length; ++i) + $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); + return writer; + }; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @function decode + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.get = reader.string(); + break; + } + case 3: { + message.put = reader.string(); + break; + } + case 4: { + message.post = reader.string(); + break; + } + case 5: { + message["delete"] = reader.string(); + break; + } + case 6: { + message.patch = reader.string(); + break; + } + case 8: { + message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); + break; + } + case 7: { + message.body = reader.string(); + break; + } + case 12: { + message.responseBody = reader.string(); + break; + } + case 11: { + if (!(message.additionalBindings && message.additionalBindings.length)) + message.additionalBindings = []; + message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HttpRule message. + * @function verify + * @memberof google.api.HttpRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HttpRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.get != null && message.hasOwnProperty("get")) { + properties.pattern = 1; + if (!$util.isString(message.get)) + return "get: string expected"; + } + if (message.put != null && message.hasOwnProperty("put")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.put)) + return "put: string expected"; + } + if (message.post != null && message.hasOwnProperty("post")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.post)) + return "post: string expected"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message["delete"])) + return "delete: string expected"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.patch)) + return "patch: string expected"; + } + if (message.custom != null && message.hasOwnProperty("custom")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + { + var error = $root.google.api.CustomHttpPattern.verify(message.custom); + if (error) + return "custom." + error; + } + } + if (message.body != null && message.hasOwnProperty("body")) + if (!$util.isString(message.body)) + return "body: string expected"; + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + if (!$util.isString(message.responseBody)) + return "responseBody: string expected"; + if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) { + if (!Array.isArray(message.additionalBindings)) + return "additionalBindings: array expected"; + for (var i = 0; i < message.additionalBindings.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]); + if (error) + return "additionalBindings." + error; + } + } + return null; + }; + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.HttpRule + * @static + * @param {Object.} object Plain object + * @returns {google.api.HttpRule} HttpRule + */ + HttpRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.HttpRule) + return object; + var message = new $root.google.api.HttpRule(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.get != null) + message.get = String(object.get); + if (object.put != null) + message.put = String(object.put); + if (object.post != null) + message.post = String(object.post); + if (object["delete"] != null) + message["delete"] = String(object["delete"]); + if (object.patch != null) + message.patch = String(object.patch); + if (object.custom != null) { + if (typeof object.custom !== "object") + throw TypeError(".google.api.HttpRule.custom: object expected"); + message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); + } + if (object.body != null) + message.body = String(object.body); + if (object.responseBody != null) + message.responseBody = String(object.responseBody); + if (object.additionalBindings) { + if (!Array.isArray(object.additionalBindings)) + throw TypeError(".google.api.HttpRule.additionalBindings: array expected"); + message.additionalBindings = []; + for (var i = 0; i < object.additionalBindings.length; ++i) { + if (typeof object.additionalBindings[i] !== "object") + throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); + message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.HttpRule + * @static + * @param {google.api.HttpRule} message HttpRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HttpRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.additionalBindings = []; + if (options.defaults) { + object.selector = ""; + object.body = ""; + object.responseBody = ""; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.get != null && message.hasOwnProperty("get")) { + object.get = message.get; + if (options.oneofs) + object.pattern = "get"; + } + if (message.put != null && message.hasOwnProperty("put")) { + object.put = message.put; + if (options.oneofs) + object.pattern = "put"; + } + if (message.post != null && message.hasOwnProperty("post")) { + object.post = message.post; + if (options.oneofs) + object.pattern = "post"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + object["delete"] = message["delete"]; + if (options.oneofs) + object.pattern = "delete"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + object.patch = message.patch; + if (options.oneofs) + object.pattern = "patch"; + } + if (message.body != null && message.hasOwnProperty("body")) + object.body = message.body; + if (message.custom != null && message.hasOwnProperty("custom")) { + object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); + if (options.oneofs) + object.pattern = "custom"; + } + if (message.additionalBindings && message.additionalBindings.length) { + object.additionalBindings = []; + for (var j = 0; j < message.additionalBindings.length; ++j) + object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options); + } + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + object.responseBody = message.responseBody; + return object; + }; + + /** + * Converts this HttpRule to JSON. + * @function toJSON + * @memberof google.api.HttpRule + * @instance + * @returns {Object.} JSON object + */ + HttpRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HttpRule + * @function getTypeUrl + * @memberof google.api.HttpRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HttpRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.HttpRule"; + }; + + return HttpRule; + })(); + + api.CustomHttpPattern = (function() { + + /** + * Properties of a CustomHttpPattern. + * @memberof google.api + * @interface ICustomHttpPattern + * @property {string|null} [kind] CustomHttpPattern kind + * @property {string|null} [path] CustomHttpPattern path + */ + + /** + * Constructs a new CustomHttpPattern. + * @memberof google.api + * @classdesc Represents a CustomHttpPattern. + * @implements ICustomHttpPattern + * @constructor + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + */ + function CustomHttpPattern(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CustomHttpPattern kind. + * @member {string} kind + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.kind = ""; + + /** + * CustomHttpPattern path. + * @member {string} path + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.path = ""; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @function create + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance + */ + CustomHttpPattern.create = function create(properties) { + return new CustomHttpPattern(properties); + }; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encode + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); + return writer; + }; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @function decode + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.kind = reader.string(); + break; + } + case 2: { + message.path = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomHttpPattern message. + * @function verify + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomHttpPattern.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kind != null && message.hasOwnProperty("kind")) + if (!$util.isString(message.kind)) + return "kind: string expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + return null; + }; + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} object Plain object + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + */ + CustomHttpPattern.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CustomHttpPattern) + return object; + var message = new $root.google.api.CustomHttpPattern(); + if (object.kind != null) + message.kind = String(object.kind); + if (object.path != null) + message.path = String(object.path); + return message; + }; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.CustomHttpPattern} message CustomHttpPattern + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomHttpPattern.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.kind = ""; + object.path = ""; + } + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = message.kind; + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; + return object; + }; + + /** + * Converts this CustomHttpPattern to JSON. + * @function toJSON + * @memberof google.api.CustomHttpPattern + * @instance + * @returns {Object.} JSON object + */ + CustomHttpPattern.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomHttpPattern + * @function getTypeUrl + * @memberof google.api.CustomHttpPattern + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomHttpPattern.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CustomHttpPattern"; + }; + + return CustomHttpPattern; + })(); + + api.CommonLanguageSettings = (function() { + + /** + * Properties of a CommonLanguageSettings. + * @memberof google.api + * @interface ICommonLanguageSettings + * @property {string|null} [referenceDocsUri] CommonLanguageSettings referenceDocsUri + * @property {Array.|null} [destinations] CommonLanguageSettings destinations + */ + + /** + * Constructs a new CommonLanguageSettings. + * @memberof google.api + * @classdesc Represents a CommonLanguageSettings. + * @implements ICommonLanguageSettings + * @constructor + * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set + */ + function CommonLanguageSettings(properties) { + this.destinations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CommonLanguageSettings referenceDocsUri. + * @member {string} referenceDocsUri + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.referenceDocsUri = ""; + + /** + * CommonLanguageSettings destinations. + * @member {Array.} destinations + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.destinations = $util.emptyArray; + + /** + * Creates a new CommonLanguageSettings instance using the specified properties. + * @function create + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings instance + */ + CommonLanguageSettings.create = function create(properties) { + return new CommonLanguageSettings(properties); + }; + + /** + * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @function encode + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommonLanguageSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.referenceDocsUri != null && Object.hasOwnProperty.call(message, "referenceDocsUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.referenceDocsUri); + if (message.destinations != null && message.destinations.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.destinations.length; ++i) + writer.int32(message.destinations[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommonLanguageSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.CommonLanguageSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommonLanguageSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CommonLanguageSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.referenceDocsUri = reader.string(); + break; + } + case 2: { + if (!(message.destinations && message.destinations.length)) + message.destinations = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.destinations.push(reader.int32()); + } else + message.destinations.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CommonLanguageSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommonLanguageSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CommonLanguageSettings message. + * @function verify + * @memberof google.api.CommonLanguageSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CommonLanguageSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) + if (!$util.isString(message.referenceDocsUri)) + return "referenceDocsUri: string expected"; + if (message.destinations != null && message.hasOwnProperty("destinations")) { + if (!Array.isArray(message.destinations)) + return "destinations: array expected"; + for (var i = 0; i < message.destinations.length; ++i) + switch (message.destinations[i]) { + default: + return "destinations: enum value[] expected"; + case 0: + case 10: + case 20: + break; + } + } + return null; + }; + + /** + * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CommonLanguageSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + */ + CommonLanguageSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CommonLanguageSettings) + return object; + var message = new $root.google.api.CommonLanguageSettings(); + if (object.referenceDocsUri != null) + message.referenceDocsUri = String(object.referenceDocsUri); + if (object.destinations) { + if (!Array.isArray(object.destinations)) + throw TypeError(".google.api.CommonLanguageSettings.destinations: array expected"); + message.destinations = []; + for (var i = 0; i < object.destinations.length; ++i) + switch (object.destinations[i]) { + default: + if (typeof object.destinations[i] === "number") { + message.destinations[i] = object.destinations[i]; + break; + } + case "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": + case 0: + message.destinations[i] = 0; + break; + case "GITHUB": + case 10: + message.destinations[i] = 10; + break; + case "PACKAGE_MANAGER": + case 20: + message.destinations[i] = 20; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.CommonLanguageSettings} message CommonLanguageSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CommonLanguageSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.destinations = []; + if (options.defaults) + object.referenceDocsUri = ""; + if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) + object.referenceDocsUri = message.referenceDocsUri; + if (message.destinations && message.destinations.length) { + object.destinations = []; + for (var j = 0; j < message.destinations.length; ++j) + object.destinations[j] = options.enums === String ? $root.google.api.ClientLibraryDestination[message.destinations[j]] === undefined ? message.destinations[j] : $root.google.api.ClientLibraryDestination[message.destinations[j]] : message.destinations[j]; + } + return object; + }; + + /** + * Converts this CommonLanguageSettings to JSON. + * @function toJSON + * @memberof google.api.CommonLanguageSettings + * @instance + * @returns {Object.} JSON object + */ + CommonLanguageSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CommonLanguageSettings + * @function getTypeUrl + * @memberof google.api.CommonLanguageSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CommonLanguageSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CommonLanguageSettings"; + }; + + return CommonLanguageSettings; + })(); + + api.ClientLibrarySettings = (function() { + + /** + * Properties of a ClientLibrarySettings. + * @memberof google.api + * @interface IClientLibrarySettings + * @property {string|null} [version] ClientLibrarySettings version + * @property {google.api.LaunchStage|null} [launchStage] ClientLibrarySettings launchStage + * @property {boolean|null} [restNumericEnums] ClientLibrarySettings restNumericEnums + * @property {google.api.IJavaSettings|null} [javaSettings] ClientLibrarySettings javaSettings + * @property {google.api.ICppSettings|null} [cppSettings] ClientLibrarySettings cppSettings + * @property {google.api.IPhpSettings|null} [phpSettings] ClientLibrarySettings phpSettings + * @property {google.api.IPythonSettings|null} [pythonSettings] ClientLibrarySettings pythonSettings + * @property {google.api.INodeSettings|null} [nodeSettings] ClientLibrarySettings nodeSettings + * @property {google.api.IDotnetSettings|null} [dotnetSettings] ClientLibrarySettings dotnetSettings + * @property {google.api.IRubySettings|null} [rubySettings] ClientLibrarySettings rubySettings + * @property {google.api.IGoSettings|null} [goSettings] ClientLibrarySettings goSettings + */ + + /** + * Constructs a new ClientLibrarySettings. + * @memberof google.api + * @classdesc Represents a ClientLibrarySettings. + * @implements IClientLibrarySettings + * @constructor + * @param {google.api.IClientLibrarySettings=} [properties] Properties to set + */ + function ClientLibrarySettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClientLibrarySettings version. + * @member {string} version + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.version = ""; + + /** + * ClientLibrarySettings launchStage. + * @member {google.api.LaunchStage} launchStage + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.launchStage = 0; + + /** + * ClientLibrarySettings restNumericEnums. + * @member {boolean} restNumericEnums + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.restNumericEnums = false; + + /** + * ClientLibrarySettings javaSettings. + * @member {google.api.IJavaSettings|null|undefined} javaSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.javaSettings = null; + + /** + * ClientLibrarySettings cppSettings. + * @member {google.api.ICppSettings|null|undefined} cppSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.cppSettings = null; + + /** + * ClientLibrarySettings phpSettings. + * @member {google.api.IPhpSettings|null|undefined} phpSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.phpSettings = null; + + /** + * ClientLibrarySettings pythonSettings. + * @member {google.api.IPythonSettings|null|undefined} pythonSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.pythonSettings = null; + + /** + * ClientLibrarySettings nodeSettings. + * @member {google.api.INodeSettings|null|undefined} nodeSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.nodeSettings = null; + + /** + * ClientLibrarySettings dotnetSettings. + * @member {google.api.IDotnetSettings|null|undefined} dotnetSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.dotnetSettings = null; + + /** + * ClientLibrarySettings rubySettings. + * @member {google.api.IRubySettings|null|undefined} rubySettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.rubySettings = null; + + /** + * ClientLibrarySettings goSettings. + * @member {google.api.IGoSettings|null|undefined} goSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.goSettings = null; + + /** + * Creates a new ClientLibrarySettings instance using the specified properties. + * @function create + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings=} [properties] Properties to set + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings instance + */ + ClientLibrarySettings.create = function create(properties) { + return new ClientLibrarySettings(properties); + }; + + /** + * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @function encode + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientLibrarySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); + if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.launchStage); + if (message.restNumericEnums != null && Object.hasOwnProperty.call(message, "restNumericEnums")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.restNumericEnums); + if (message.javaSettings != null && Object.hasOwnProperty.call(message, "javaSettings")) + $root.google.api.JavaSettings.encode(message.javaSettings, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.cppSettings != null && Object.hasOwnProperty.call(message, "cppSettings")) + $root.google.api.CppSettings.encode(message.cppSettings, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.phpSettings != null && Object.hasOwnProperty.call(message, "phpSettings")) + $root.google.api.PhpSettings.encode(message.phpSettings, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.pythonSettings != null && Object.hasOwnProperty.call(message, "pythonSettings")) + $root.google.api.PythonSettings.encode(message.pythonSettings, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + if (message.nodeSettings != null && Object.hasOwnProperty.call(message, "nodeSettings")) + $root.google.api.NodeSettings.encode(message.nodeSettings, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); + if (message.dotnetSettings != null && Object.hasOwnProperty.call(message, "dotnetSettings")) + $root.google.api.DotnetSettings.encode(message.dotnetSettings, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + if (message.rubySettings != null && Object.hasOwnProperty.call(message, "rubySettings")) + $root.google.api.RubySettings.encode(message.rubySettings, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); + if (message.goSettings != null && Object.hasOwnProperty.call(message, "goSettings")) + $root.google.api.GoSettings.encode(message.goSettings, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientLibrarySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.ClientLibrarySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientLibrarySettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ClientLibrarySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.version = reader.string(); + break; + } + case 2: { + message.launchStage = reader.int32(); + break; + } + case 3: { + message.restNumericEnums = reader.bool(); + break; + } + case 21: { + message.javaSettings = $root.google.api.JavaSettings.decode(reader, reader.uint32()); + break; + } + case 22: { + message.cppSettings = $root.google.api.CppSettings.decode(reader, reader.uint32()); + break; + } + case 23: { + message.phpSettings = $root.google.api.PhpSettings.decode(reader, reader.uint32()); + break; + } + case 24: { + message.pythonSettings = $root.google.api.PythonSettings.decode(reader, reader.uint32()); + break; + } + case 25: { + message.nodeSettings = $root.google.api.NodeSettings.decode(reader, reader.uint32()); + break; + } + case 26: { + message.dotnetSettings = $root.google.api.DotnetSettings.decode(reader, reader.uint32()); + break; + } + case 27: { + message.rubySettings = $root.google.api.RubySettings.decode(reader, reader.uint32()); + break; + } + case 28: { + message.goSettings = $root.google.api.GoSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ClientLibrarySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientLibrarySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClientLibrarySettings message. + * @function verify + * @memberof google.api.ClientLibrarySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClientLibrarySettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + switch (message.launchStage) { + default: + return "launchStage: enum value expected"; + case 0: + case 6: + case 7: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) + if (typeof message.restNumericEnums !== "boolean") + return "restNumericEnums: boolean expected"; + if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) { + var error = $root.google.api.JavaSettings.verify(message.javaSettings); + if (error) + return "javaSettings." + error; + } + if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) { + var error = $root.google.api.CppSettings.verify(message.cppSettings); + if (error) + return "cppSettings." + error; + } + if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) { + var error = $root.google.api.PhpSettings.verify(message.phpSettings); + if (error) + return "phpSettings." + error; + } + if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) { + var error = $root.google.api.PythonSettings.verify(message.pythonSettings); + if (error) + return "pythonSettings." + error; + } + if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) { + var error = $root.google.api.NodeSettings.verify(message.nodeSettings); + if (error) + return "nodeSettings." + error; + } + if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) { + var error = $root.google.api.DotnetSettings.verify(message.dotnetSettings); + if (error) + return "dotnetSettings." + error; + } + if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) { + var error = $root.google.api.RubySettings.verify(message.rubySettings); + if (error) + return "rubySettings." + error; + } + if (message.goSettings != null && message.hasOwnProperty("goSettings")) { + var error = $root.google.api.GoSettings.verify(message.goSettings); + if (error) + return "goSettings." + error; + } + return null; + }; + + /** + * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ClientLibrarySettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + */ + ClientLibrarySettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ClientLibrarySettings) + return object; + var message = new $root.google.api.ClientLibrarySettings(); + if (object.version != null) + message.version = String(object.version); + switch (object.launchStage) { + default: + if (typeof object.launchStage === "number") { + message.launchStage = object.launchStage; + break; + } + break; + case "LAUNCH_STAGE_UNSPECIFIED": + case 0: + message.launchStage = 0; + break; + case "UNIMPLEMENTED": + case 6: + message.launchStage = 6; + break; + case "PRELAUNCH": + case 7: + message.launchStage = 7; + break; + case "EARLY_ACCESS": + case 1: + message.launchStage = 1; + break; + case "ALPHA": + case 2: + message.launchStage = 2; + break; + case "BETA": + case 3: + message.launchStage = 3; + break; + case "GA": + case 4: + message.launchStage = 4; + break; + case "DEPRECATED": + case 5: + message.launchStage = 5; + break; + } + if (object.restNumericEnums != null) + message.restNumericEnums = Boolean(object.restNumericEnums); + if (object.javaSettings != null) { + if (typeof object.javaSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.javaSettings: object expected"); + message.javaSettings = $root.google.api.JavaSettings.fromObject(object.javaSettings); + } + if (object.cppSettings != null) { + if (typeof object.cppSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.cppSettings: object expected"); + message.cppSettings = $root.google.api.CppSettings.fromObject(object.cppSettings); + } + if (object.phpSettings != null) { + if (typeof object.phpSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.phpSettings: object expected"); + message.phpSettings = $root.google.api.PhpSettings.fromObject(object.phpSettings); + } + if (object.pythonSettings != null) { + if (typeof object.pythonSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.pythonSettings: object expected"); + message.pythonSettings = $root.google.api.PythonSettings.fromObject(object.pythonSettings); + } + if (object.nodeSettings != null) { + if (typeof object.nodeSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.nodeSettings: object expected"); + message.nodeSettings = $root.google.api.NodeSettings.fromObject(object.nodeSettings); + } + if (object.dotnetSettings != null) { + if (typeof object.dotnetSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.dotnetSettings: object expected"); + message.dotnetSettings = $root.google.api.DotnetSettings.fromObject(object.dotnetSettings); + } + if (object.rubySettings != null) { + if (typeof object.rubySettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.rubySettings: object expected"); + message.rubySettings = $root.google.api.RubySettings.fromObject(object.rubySettings); + } + if (object.goSettings != null) { + if (typeof object.goSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.goSettings: object expected"); + message.goSettings = $root.google.api.GoSettings.fromObject(object.goSettings); + } + return message; + }; + + /** + * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.ClientLibrarySettings} message ClientLibrarySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClientLibrarySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.version = ""; + object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; + object.restNumericEnums = false; + object.javaSettings = null; + object.cppSettings = null; + object.phpSettings = null; + object.pythonSettings = null; + object.nodeSettings = null; + object.dotnetSettings = null; + object.rubySettings = null; + object.goSettings = null; + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + object.launchStage = options.enums === String ? $root.google.api.LaunchStage[message.launchStage] === undefined ? message.launchStage : $root.google.api.LaunchStage[message.launchStage] : message.launchStage; + if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) + object.restNumericEnums = message.restNumericEnums; + if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) + object.javaSettings = $root.google.api.JavaSettings.toObject(message.javaSettings, options); + if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) + object.cppSettings = $root.google.api.CppSettings.toObject(message.cppSettings, options); + if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) + object.phpSettings = $root.google.api.PhpSettings.toObject(message.phpSettings, options); + if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) + object.pythonSettings = $root.google.api.PythonSettings.toObject(message.pythonSettings, options); + if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) + object.nodeSettings = $root.google.api.NodeSettings.toObject(message.nodeSettings, options); + if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) + object.dotnetSettings = $root.google.api.DotnetSettings.toObject(message.dotnetSettings, options); + if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) + object.rubySettings = $root.google.api.RubySettings.toObject(message.rubySettings, options); + if (message.goSettings != null && message.hasOwnProperty("goSettings")) + object.goSettings = $root.google.api.GoSettings.toObject(message.goSettings, options); + return object; + }; + + /** + * Converts this ClientLibrarySettings to JSON. + * @function toJSON + * @memberof google.api.ClientLibrarySettings + * @instance + * @returns {Object.} JSON object + */ + ClientLibrarySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClientLibrarySettings + * @function getTypeUrl + * @memberof google.api.ClientLibrarySettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClientLibrarySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ClientLibrarySettings"; + }; + + return ClientLibrarySettings; + })(); + + api.Publishing = (function() { + + /** + * Properties of a Publishing. + * @memberof google.api + * @interface IPublishing + * @property {Array.|null} [methodSettings] Publishing methodSettings + * @property {string|null} [newIssueUri] Publishing newIssueUri + * @property {string|null} [documentationUri] Publishing documentationUri + * @property {string|null} [apiShortName] Publishing apiShortName + * @property {string|null} [githubLabel] Publishing githubLabel + * @property {Array.|null} [codeownerGithubTeams] Publishing codeownerGithubTeams + * @property {string|null} [docTagPrefix] Publishing docTagPrefix + * @property {google.api.ClientLibraryOrganization|null} [organization] Publishing organization + * @property {Array.|null} [librarySettings] Publishing librarySettings + * @property {string|null} [protoReferenceDocumentationUri] Publishing protoReferenceDocumentationUri + * @property {string|null} [restReferenceDocumentationUri] Publishing restReferenceDocumentationUri + */ + + /** + * Constructs a new Publishing. + * @memberof google.api + * @classdesc Represents a Publishing. + * @implements IPublishing + * @constructor + * @param {google.api.IPublishing=} [properties] Properties to set + */ + function Publishing(properties) { + this.methodSettings = []; + this.codeownerGithubTeams = []; + this.librarySettings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Publishing methodSettings. + * @member {Array.} methodSettings + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.methodSettings = $util.emptyArray; + + /** + * Publishing newIssueUri. + * @member {string} newIssueUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.newIssueUri = ""; + + /** + * Publishing documentationUri. + * @member {string} documentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.documentationUri = ""; + + /** + * Publishing apiShortName. + * @member {string} apiShortName + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.apiShortName = ""; + + /** + * Publishing githubLabel. + * @member {string} githubLabel + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.githubLabel = ""; + + /** + * Publishing codeownerGithubTeams. + * @member {Array.} codeownerGithubTeams + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.codeownerGithubTeams = $util.emptyArray; + + /** + * Publishing docTagPrefix. + * @member {string} docTagPrefix + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.docTagPrefix = ""; + + /** + * Publishing organization. + * @member {google.api.ClientLibraryOrganization} organization + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.organization = 0; + + /** + * Publishing librarySettings. + * @member {Array.} librarySettings + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.librarySettings = $util.emptyArray; + + /** + * Publishing protoReferenceDocumentationUri. + * @member {string} protoReferenceDocumentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.protoReferenceDocumentationUri = ""; + + /** + * Publishing restReferenceDocumentationUri. + * @member {string} restReferenceDocumentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.restReferenceDocumentationUri = ""; + + /** + * Creates a new Publishing instance using the specified properties. + * @function create + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing=} [properties] Properties to set + * @returns {google.api.Publishing} Publishing instance + */ + Publishing.create = function create(properties) { + return new Publishing(properties); + }; + + /** + * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @function encode + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing} message Publishing message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Publishing.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.methodSettings != null && message.methodSettings.length) + for (var i = 0; i < message.methodSettings.length; ++i) + $root.google.api.MethodSettings.encode(message.methodSettings[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.newIssueUri != null && Object.hasOwnProperty.call(message, "newIssueUri")) + writer.uint32(/* id 101, wireType 2 =*/810).string(message.newIssueUri); + if (message.documentationUri != null && Object.hasOwnProperty.call(message, "documentationUri")) + writer.uint32(/* id 102, wireType 2 =*/818).string(message.documentationUri); + if (message.apiShortName != null && Object.hasOwnProperty.call(message, "apiShortName")) + writer.uint32(/* id 103, wireType 2 =*/826).string(message.apiShortName); + if (message.githubLabel != null && Object.hasOwnProperty.call(message, "githubLabel")) + writer.uint32(/* id 104, wireType 2 =*/834).string(message.githubLabel); + if (message.codeownerGithubTeams != null && message.codeownerGithubTeams.length) + for (var i = 0; i < message.codeownerGithubTeams.length; ++i) + writer.uint32(/* id 105, wireType 2 =*/842).string(message.codeownerGithubTeams[i]); + if (message.docTagPrefix != null && Object.hasOwnProperty.call(message, "docTagPrefix")) + writer.uint32(/* id 106, wireType 2 =*/850).string(message.docTagPrefix); + if (message.organization != null && Object.hasOwnProperty.call(message, "organization")) + writer.uint32(/* id 107, wireType 0 =*/856).int32(message.organization); + if (message.librarySettings != null && message.librarySettings.length) + for (var i = 0; i < message.librarySettings.length; ++i) + $root.google.api.ClientLibrarySettings.encode(message.librarySettings[i], writer.uint32(/* id 109, wireType 2 =*/874).fork()).ldelim(); + if (message.protoReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "protoReferenceDocumentationUri")) + writer.uint32(/* id 110, wireType 2 =*/882).string(message.protoReferenceDocumentationUri); + if (message.restReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "restReferenceDocumentationUri")) + writer.uint32(/* id 111, wireType 2 =*/890).string(message.restReferenceDocumentationUri); + return writer; + }; + + /** + * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing} message Publishing message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Publishing.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Publishing message from the specified reader or buffer. + * @function decode + * @memberof google.api.Publishing + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Publishing} Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Publishing.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Publishing(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + if (!(message.methodSettings && message.methodSettings.length)) + message.methodSettings = []; + message.methodSettings.push($root.google.api.MethodSettings.decode(reader, reader.uint32())); + break; + } + case 101: { + message.newIssueUri = reader.string(); + break; + } + case 102: { + message.documentationUri = reader.string(); + break; + } + case 103: { + message.apiShortName = reader.string(); + break; + } + case 104: { + message.githubLabel = reader.string(); + break; + } + case 105: { + if (!(message.codeownerGithubTeams && message.codeownerGithubTeams.length)) + message.codeownerGithubTeams = []; + message.codeownerGithubTeams.push(reader.string()); + break; + } + case 106: { + message.docTagPrefix = reader.string(); + break; + } + case 107: { + message.organization = reader.int32(); + break; + } + case 109: { + if (!(message.librarySettings && message.librarySettings.length)) + message.librarySettings = []; + message.librarySettings.push($root.google.api.ClientLibrarySettings.decode(reader, reader.uint32())); + break; + } + case 110: { + message.protoReferenceDocumentationUri = reader.string(); + break; + } + case 111: { + message.restReferenceDocumentationUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Publishing message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Publishing + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Publishing} Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Publishing.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Publishing message. + * @function verify + * @memberof google.api.Publishing + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Publishing.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.methodSettings != null && message.hasOwnProperty("methodSettings")) { + if (!Array.isArray(message.methodSettings)) + return "methodSettings: array expected"; + for (var i = 0; i < message.methodSettings.length; ++i) { + var error = $root.google.api.MethodSettings.verify(message.methodSettings[i]); + if (error) + return "methodSettings." + error; + } + } + if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) + if (!$util.isString(message.newIssueUri)) + return "newIssueUri: string expected"; + if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) + if (!$util.isString(message.documentationUri)) + return "documentationUri: string expected"; + if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) + if (!$util.isString(message.apiShortName)) + return "apiShortName: string expected"; + if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) + if (!$util.isString(message.githubLabel)) + return "githubLabel: string expected"; + if (message.codeownerGithubTeams != null && message.hasOwnProperty("codeownerGithubTeams")) { + if (!Array.isArray(message.codeownerGithubTeams)) + return "codeownerGithubTeams: array expected"; + for (var i = 0; i < message.codeownerGithubTeams.length; ++i) + if (!$util.isString(message.codeownerGithubTeams[i])) + return "codeownerGithubTeams: string[] expected"; + } + if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) + if (!$util.isString(message.docTagPrefix)) + return "docTagPrefix: string expected"; + if (message.organization != null && message.hasOwnProperty("organization")) + switch (message.organization) { + default: + return "organization: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + if (message.librarySettings != null && message.hasOwnProperty("librarySettings")) { + if (!Array.isArray(message.librarySettings)) + return "librarySettings: array expected"; + for (var i = 0; i < message.librarySettings.length; ++i) { + var error = $root.google.api.ClientLibrarySettings.verify(message.librarySettings[i]); + if (error) + return "librarySettings." + error; + } + } + if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) + if (!$util.isString(message.protoReferenceDocumentationUri)) + return "protoReferenceDocumentationUri: string expected"; + if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) + if (!$util.isString(message.restReferenceDocumentationUri)) + return "restReferenceDocumentationUri: string expected"; + return null; + }; + + /** + * Creates a Publishing message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Publishing + * @static + * @param {Object.} object Plain object + * @returns {google.api.Publishing} Publishing + */ + Publishing.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Publishing) + return object; + var message = new $root.google.api.Publishing(); + if (object.methodSettings) { + if (!Array.isArray(object.methodSettings)) + throw TypeError(".google.api.Publishing.methodSettings: array expected"); + message.methodSettings = []; + for (var i = 0; i < object.methodSettings.length; ++i) { + if (typeof object.methodSettings[i] !== "object") + throw TypeError(".google.api.Publishing.methodSettings: object expected"); + message.methodSettings[i] = $root.google.api.MethodSettings.fromObject(object.methodSettings[i]); + } + } + if (object.newIssueUri != null) + message.newIssueUri = String(object.newIssueUri); + if (object.documentationUri != null) + message.documentationUri = String(object.documentationUri); + if (object.apiShortName != null) + message.apiShortName = String(object.apiShortName); + if (object.githubLabel != null) + message.githubLabel = String(object.githubLabel); + if (object.codeownerGithubTeams) { + if (!Array.isArray(object.codeownerGithubTeams)) + throw TypeError(".google.api.Publishing.codeownerGithubTeams: array expected"); + message.codeownerGithubTeams = []; + for (var i = 0; i < object.codeownerGithubTeams.length; ++i) + message.codeownerGithubTeams[i] = String(object.codeownerGithubTeams[i]); + } + if (object.docTagPrefix != null) + message.docTagPrefix = String(object.docTagPrefix); + switch (object.organization) { + default: + if (typeof object.organization === "number") { + message.organization = object.organization; + break; + } + break; + case "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": + case 0: + message.organization = 0; + break; + case "CLOUD": + case 1: + message.organization = 1; + break; + case "ADS": + case 2: + message.organization = 2; + break; + case "PHOTOS": + case 3: + message.organization = 3; + break; + case "STREET_VIEW": + case 4: + message.organization = 4; + break; + case "SHOPPING": + case 5: + message.organization = 5; + break; + case "GEO": + case 6: + message.organization = 6; + break; + case "GENERATIVE_AI": + case 7: + message.organization = 7; + break; + } + if (object.librarySettings) { + if (!Array.isArray(object.librarySettings)) + throw TypeError(".google.api.Publishing.librarySettings: array expected"); + message.librarySettings = []; + for (var i = 0; i < object.librarySettings.length; ++i) { + if (typeof object.librarySettings[i] !== "object") + throw TypeError(".google.api.Publishing.librarySettings: object expected"); + message.librarySettings[i] = $root.google.api.ClientLibrarySettings.fromObject(object.librarySettings[i]); + } + } + if (object.protoReferenceDocumentationUri != null) + message.protoReferenceDocumentationUri = String(object.protoReferenceDocumentationUri); + if (object.restReferenceDocumentationUri != null) + message.restReferenceDocumentationUri = String(object.restReferenceDocumentationUri); + return message; + }; + + /** + * Creates a plain object from a Publishing message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Publishing + * @static + * @param {google.api.Publishing} message Publishing + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Publishing.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.methodSettings = []; + object.codeownerGithubTeams = []; + object.librarySettings = []; + } + if (options.defaults) { + object.newIssueUri = ""; + object.documentationUri = ""; + object.apiShortName = ""; + object.githubLabel = ""; + object.docTagPrefix = ""; + object.organization = options.enums === String ? "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED" : 0; + object.protoReferenceDocumentationUri = ""; + object.restReferenceDocumentationUri = ""; + } + if (message.methodSettings && message.methodSettings.length) { + object.methodSettings = []; + for (var j = 0; j < message.methodSettings.length; ++j) + object.methodSettings[j] = $root.google.api.MethodSettings.toObject(message.methodSettings[j], options); + } + if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) + object.newIssueUri = message.newIssueUri; + if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) + object.documentationUri = message.documentationUri; + if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) + object.apiShortName = message.apiShortName; + if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) + object.githubLabel = message.githubLabel; + if (message.codeownerGithubTeams && message.codeownerGithubTeams.length) { + object.codeownerGithubTeams = []; + for (var j = 0; j < message.codeownerGithubTeams.length; ++j) + object.codeownerGithubTeams[j] = message.codeownerGithubTeams[j]; + } + if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) + object.docTagPrefix = message.docTagPrefix; + if (message.organization != null && message.hasOwnProperty("organization")) + object.organization = options.enums === String ? $root.google.api.ClientLibraryOrganization[message.organization] === undefined ? message.organization : $root.google.api.ClientLibraryOrganization[message.organization] : message.organization; + if (message.librarySettings && message.librarySettings.length) { + object.librarySettings = []; + for (var j = 0; j < message.librarySettings.length; ++j) + object.librarySettings[j] = $root.google.api.ClientLibrarySettings.toObject(message.librarySettings[j], options); + } + if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) + object.protoReferenceDocumentationUri = message.protoReferenceDocumentationUri; + if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) + object.restReferenceDocumentationUri = message.restReferenceDocumentationUri; + return object; + }; + + /** + * Converts this Publishing to JSON. + * @function toJSON + * @memberof google.api.Publishing + * @instance + * @returns {Object.} JSON object + */ + Publishing.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Publishing + * @function getTypeUrl + * @memberof google.api.Publishing + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Publishing.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Publishing"; + }; + + return Publishing; + })(); + + api.JavaSettings = (function() { + + /** + * Properties of a JavaSettings. + * @memberof google.api + * @interface IJavaSettings + * @property {string|null} [libraryPackage] JavaSettings libraryPackage + * @property {Object.|null} [serviceClassNames] JavaSettings serviceClassNames + * @property {google.api.ICommonLanguageSettings|null} [common] JavaSettings common + */ + + /** + * Constructs a new JavaSettings. + * @memberof google.api + * @classdesc Represents a JavaSettings. + * @implements IJavaSettings + * @constructor + * @param {google.api.IJavaSettings=} [properties] Properties to set + */ + function JavaSettings(properties) { + this.serviceClassNames = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * JavaSettings libraryPackage. + * @member {string} libraryPackage + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.libraryPackage = ""; + + /** + * JavaSettings serviceClassNames. + * @member {Object.} serviceClassNames + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.serviceClassNames = $util.emptyObject; + + /** + * JavaSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.common = null; + + /** + * Creates a new JavaSettings instance using the specified properties. + * @function create + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings=} [properties] Properties to set + * @returns {google.api.JavaSettings} JavaSettings instance + */ + JavaSettings.create = function create(properties) { + return new JavaSettings(properties); + }; + + /** + * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @function encode + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JavaSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.libraryPackage != null && Object.hasOwnProperty.call(message, "libraryPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.libraryPackage); + if (message.serviceClassNames != null && Object.hasOwnProperty.call(message, "serviceClassNames")) + for (var keys = Object.keys(message.serviceClassNames), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.serviceClassNames[keys[i]]).ldelim(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JavaSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a JavaSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.JavaSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.JavaSettings} JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JavaSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.JavaSettings(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.libraryPackage = reader.string(); + break; + } + case 2: { + if (message.serviceClassNames === $util.emptyObject) + message.serviceClassNames = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.serviceClassNames[key] = value; + break; + } + case 3: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a JavaSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.JavaSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.JavaSettings} JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JavaSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JavaSettings message. + * @function verify + * @memberof google.api.JavaSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JavaSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) + if (!$util.isString(message.libraryPackage)) + return "libraryPackage: string expected"; + if (message.serviceClassNames != null && message.hasOwnProperty("serviceClassNames")) { + if (!$util.isObject(message.serviceClassNames)) + return "serviceClassNames: object expected"; + var key = Object.keys(message.serviceClassNames); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.serviceClassNames[key[i]])) + return "serviceClassNames: string{k:string} expected"; + } + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.JavaSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.JavaSettings} JavaSettings + */ + JavaSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.JavaSettings) + return object; + var message = new $root.google.api.JavaSettings(); + if (object.libraryPackage != null) + message.libraryPackage = String(object.libraryPackage); + if (object.serviceClassNames) { + if (typeof object.serviceClassNames !== "object") + throw TypeError(".google.api.JavaSettings.serviceClassNames: object expected"); + message.serviceClassNames = {}; + for (var keys = Object.keys(object.serviceClassNames), i = 0; i < keys.length; ++i) + message.serviceClassNames[keys[i]] = String(object.serviceClassNames[keys[i]]); + } + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.JavaSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.JavaSettings + * @static + * @param {google.api.JavaSettings} message JavaSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JavaSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.serviceClassNames = {}; + if (options.defaults) { + object.libraryPackage = ""; + object.common = null; + } + if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) + object.libraryPackage = message.libraryPackage; + var keys2; + if (message.serviceClassNames && (keys2 = Object.keys(message.serviceClassNames)).length) { + object.serviceClassNames = {}; + for (var j = 0; j < keys2.length; ++j) + object.serviceClassNames[keys2[j]] = message.serviceClassNames[keys2[j]]; + } + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this JavaSettings to JSON. + * @function toJSON + * @memberof google.api.JavaSettings + * @instance + * @returns {Object.} JSON object + */ + JavaSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JavaSettings + * @function getTypeUrl + * @memberof google.api.JavaSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JavaSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.JavaSettings"; + }; + + return JavaSettings; + })(); + + api.CppSettings = (function() { + + /** + * Properties of a CppSettings. + * @memberof google.api + * @interface ICppSettings + * @property {google.api.ICommonLanguageSettings|null} [common] CppSettings common + */ + + /** + * Constructs a new CppSettings. + * @memberof google.api + * @classdesc Represents a CppSettings. + * @implements ICppSettings + * @constructor + * @param {google.api.ICppSettings=} [properties] Properties to set + */ + function CppSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CppSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.CppSettings + * @instance + */ + CppSettings.prototype.common = null; + + /** + * Creates a new CppSettings instance using the specified properties. + * @function create + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings=} [properties] Properties to set + * @returns {google.api.CppSettings} CppSettings instance + */ + CppSettings.create = function create(properties) { + return new CppSettings(properties); + }; + + /** + * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @function encode + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings} message CppSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CppSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings} message CppSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CppSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CppSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.CppSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CppSettings} CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CppSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CppSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CppSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CppSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CppSettings} CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CppSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CppSettings message. + * @function verify + * @memberof google.api.CppSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CppSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CppSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.CppSettings} CppSettings + */ + CppSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CppSettings) + return object; + var message = new $root.google.api.CppSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.CppSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a CppSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CppSettings + * @static + * @param {google.api.CppSettings} message CppSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CppSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this CppSettings to JSON. + * @function toJSON + * @memberof google.api.CppSettings + * @instance + * @returns {Object.} JSON object + */ + CppSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CppSettings + * @function getTypeUrl + * @memberof google.api.CppSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CppSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CppSettings"; + }; + + return CppSettings; + })(); + + api.PhpSettings = (function() { + + /** + * Properties of a PhpSettings. + * @memberof google.api + * @interface IPhpSettings + * @property {google.api.ICommonLanguageSettings|null} [common] PhpSettings common + */ + + /** + * Constructs a new PhpSettings. + * @memberof google.api + * @classdesc Represents a PhpSettings. + * @implements IPhpSettings + * @constructor + * @param {google.api.IPhpSettings=} [properties] Properties to set + */ + function PhpSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PhpSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.PhpSettings + * @instance + */ + PhpSettings.prototype.common = null; + + /** + * Creates a new PhpSettings instance using the specified properties. + * @function create + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings=} [properties] Properties to set + * @returns {google.api.PhpSettings} PhpSettings instance + */ + PhpSettings.create = function create(properties) { + return new PhpSettings(properties); + }; + + /** + * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @function encode + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PhpSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PhpSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PhpSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.PhpSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PhpSettings} PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PhpSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PhpSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PhpSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PhpSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PhpSettings} PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PhpSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PhpSettings message. + * @function verify + * @memberof google.api.PhpSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PhpSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PhpSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.PhpSettings} PhpSettings + */ + PhpSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.PhpSettings) + return object; + var message = new $root.google.api.PhpSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.PhpSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PhpSettings + * @static + * @param {google.api.PhpSettings} message PhpSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PhpSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this PhpSettings to JSON. + * @function toJSON + * @memberof google.api.PhpSettings + * @instance + * @returns {Object.} JSON object + */ + PhpSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PhpSettings + * @function getTypeUrl + * @memberof google.api.PhpSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PhpSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PhpSettings"; + }; + + return PhpSettings; + })(); + + api.PythonSettings = (function() { + + /** + * Properties of a PythonSettings. + * @memberof google.api + * @interface IPythonSettings + * @property {google.api.ICommonLanguageSettings|null} [common] PythonSettings common + */ + + /** + * Constructs a new PythonSettings. + * @memberof google.api + * @classdesc Represents a PythonSettings. + * @implements IPythonSettings + * @constructor + * @param {google.api.IPythonSettings=} [properties] Properties to set + */ + function PythonSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PythonSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.PythonSettings + * @instance + */ + PythonSettings.prototype.common = null; + + /** + * Creates a new PythonSettings instance using the specified properties. + * @function create + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings=} [properties] Properties to set + * @returns {google.api.PythonSettings} PythonSettings instance + */ + PythonSettings.create = function create(properties) { + return new PythonSettings(properties); + }; + + /** + * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @function encode + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PythonSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PythonSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PythonSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.PythonSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PythonSettings} PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PythonSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PythonSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PythonSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PythonSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PythonSettings} PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PythonSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PythonSettings message. + * @function verify + * @memberof google.api.PythonSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PythonSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PythonSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.PythonSettings} PythonSettings + */ + PythonSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.PythonSettings) + return object; + var message = new $root.google.api.PythonSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.PythonSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PythonSettings + * @static + * @param {google.api.PythonSettings} message PythonSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PythonSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this PythonSettings to JSON. + * @function toJSON + * @memberof google.api.PythonSettings + * @instance + * @returns {Object.} JSON object + */ + PythonSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PythonSettings + * @function getTypeUrl + * @memberof google.api.PythonSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PythonSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PythonSettings"; + }; + + return PythonSettings; + })(); + + api.NodeSettings = (function() { + + /** + * Properties of a NodeSettings. + * @memberof google.api + * @interface INodeSettings + * @property {google.api.ICommonLanguageSettings|null} [common] NodeSettings common + */ + + /** + * Constructs a new NodeSettings. + * @memberof google.api + * @classdesc Represents a NodeSettings. + * @implements INodeSettings + * @constructor + * @param {google.api.INodeSettings=} [properties] Properties to set + */ + function NodeSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NodeSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.NodeSettings + * @instance + */ + NodeSettings.prototype.common = null; + + /** + * Creates a new NodeSettings instance using the specified properties. + * @function create + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings=} [properties] Properties to set + * @returns {google.api.NodeSettings} NodeSettings instance + */ + NodeSettings.create = function create(properties) { + return new NodeSettings(properties); + }; + + /** + * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @function encode + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NodeSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.NodeSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.NodeSettings} NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.NodeSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NodeSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.NodeSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.NodeSettings} NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NodeSettings message. + * @function verify + * @memberof google.api.NodeSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NodeSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.NodeSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.NodeSettings} NodeSettings + */ + NodeSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.NodeSettings) + return object; + var message = new $root.google.api.NodeSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.NodeSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.NodeSettings + * @static + * @param {google.api.NodeSettings} message NodeSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NodeSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this NodeSettings to JSON. + * @function toJSON + * @memberof google.api.NodeSettings + * @instance + * @returns {Object.} JSON object + */ + NodeSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NodeSettings + * @function getTypeUrl + * @memberof google.api.NodeSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.NodeSettings"; + }; + + return NodeSettings; + })(); + + api.DotnetSettings = (function() { + + /** + * Properties of a DotnetSettings. + * @memberof google.api + * @interface IDotnetSettings + * @property {google.api.ICommonLanguageSettings|null} [common] DotnetSettings common + * @property {Object.|null} [renamedServices] DotnetSettings renamedServices + * @property {Object.|null} [renamedResources] DotnetSettings renamedResources + * @property {Array.|null} [ignoredResources] DotnetSettings ignoredResources + * @property {Array.|null} [forcedNamespaceAliases] DotnetSettings forcedNamespaceAliases + * @property {Array.|null} [handwrittenSignatures] DotnetSettings handwrittenSignatures + */ + + /** + * Constructs a new DotnetSettings. + * @memberof google.api + * @classdesc Represents a DotnetSettings. + * @implements IDotnetSettings + * @constructor + * @param {google.api.IDotnetSettings=} [properties] Properties to set + */ + function DotnetSettings(properties) { + this.renamedServices = {}; + this.renamedResources = {}; + this.ignoredResources = []; + this.forcedNamespaceAliases = []; + this.handwrittenSignatures = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DotnetSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.common = null; + + /** + * DotnetSettings renamedServices. + * @member {Object.} renamedServices + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.renamedServices = $util.emptyObject; + + /** + * DotnetSettings renamedResources. + * @member {Object.} renamedResources + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.renamedResources = $util.emptyObject; + + /** + * DotnetSettings ignoredResources. + * @member {Array.} ignoredResources + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.ignoredResources = $util.emptyArray; + + /** + * DotnetSettings forcedNamespaceAliases. + * @member {Array.} forcedNamespaceAliases + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.forcedNamespaceAliases = $util.emptyArray; + + /** + * DotnetSettings handwrittenSignatures. + * @member {Array.} handwrittenSignatures + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.handwrittenSignatures = $util.emptyArray; + + /** + * Creates a new DotnetSettings instance using the specified properties. + * @function create + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings=} [properties] Properties to set + * @returns {google.api.DotnetSettings} DotnetSettings instance + */ + DotnetSettings.create = function create(properties) { + return new DotnetSettings(properties); + }; + + /** + * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @function encode + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DotnetSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.renamedServices != null && Object.hasOwnProperty.call(message, "renamedServices")) + for (var keys = Object.keys(message.renamedServices), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedServices[keys[i]]).ldelim(); + if (message.renamedResources != null && Object.hasOwnProperty.call(message, "renamedResources")) + for (var keys = Object.keys(message.renamedResources), i = 0; i < keys.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedResources[keys[i]]).ldelim(); + if (message.ignoredResources != null && message.ignoredResources.length) + for (var i = 0; i < message.ignoredResources.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.ignoredResources[i]); + if (message.forcedNamespaceAliases != null && message.forcedNamespaceAliases.length) + for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.forcedNamespaceAliases[i]); + if (message.handwrittenSignatures != null && message.handwrittenSignatures.length) + for (var i = 0; i < message.handwrittenSignatures.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.handwrittenSignatures[i]); + return writer; + }; + + /** + * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DotnetSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.DotnetSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.DotnetSettings} DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DotnetSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.DotnetSettings(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + case 2: { + if (message.renamedServices === $util.emptyObject) + message.renamedServices = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.renamedServices[key] = value; + break; + } + case 3: { + if (message.renamedResources === $util.emptyObject) + message.renamedResources = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.renamedResources[key] = value; + break; + } + case 4: { + if (!(message.ignoredResources && message.ignoredResources.length)) + message.ignoredResources = []; + message.ignoredResources.push(reader.string()); + break; + } + case 5: { + if (!(message.forcedNamespaceAliases && message.forcedNamespaceAliases.length)) + message.forcedNamespaceAliases = []; + message.forcedNamespaceAliases.push(reader.string()); + break; + } + case 6: { + if (!(message.handwrittenSignatures && message.handwrittenSignatures.length)) + message.handwrittenSignatures = []; + message.handwrittenSignatures.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.DotnetSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.DotnetSettings} DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DotnetSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DotnetSettings message. + * @function verify + * @memberof google.api.DotnetSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DotnetSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + if (message.renamedServices != null && message.hasOwnProperty("renamedServices")) { + if (!$util.isObject(message.renamedServices)) + return "renamedServices: object expected"; + var key = Object.keys(message.renamedServices); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.renamedServices[key[i]])) + return "renamedServices: string{k:string} expected"; + } + if (message.renamedResources != null && message.hasOwnProperty("renamedResources")) { + if (!$util.isObject(message.renamedResources)) + return "renamedResources: object expected"; + var key = Object.keys(message.renamedResources); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.renamedResources[key[i]])) + return "renamedResources: string{k:string} expected"; + } + if (message.ignoredResources != null && message.hasOwnProperty("ignoredResources")) { + if (!Array.isArray(message.ignoredResources)) + return "ignoredResources: array expected"; + for (var i = 0; i < message.ignoredResources.length; ++i) + if (!$util.isString(message.ignoredResources[i])) + return "ignoredResources: string[] expected"; + } + if (message.forcedNamespaceAliases != null && message.hasOwnProperty("forcedNamespaceAliases")) { + if (!Array.isArray(message.forcedNamespaceAliases)) + return "forcedNamespaceAliases: array expected"; + for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) + if (!$util.isString(message.forcedNamespaceAliases[i])) + return "forcedNamespaceAliases: string[] expected"; + } + if (message.handwrittenSignatures != null && message.hasOwnProperty("handwrittenSignatures")) { + if (!Array.isArray(message.handwrittenSignatures)) + return "handwrittenSignatures: array expected"; + for (var i = 0; i < message.handwrittenSignatures.length; ++i) + if (!$util.isString(message.handwrittenSignatures[i])) + return "handwrittenSignatures: string[] expected"; + } + return null; + }; + + /** + * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.DotnetSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.DotnetSettings} DotnetSettings + */ + DotnetSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.DotnetSettings) + return object; + var message = new $root.google.api.DotnetSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.DotnetSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + if (object.renamedServices) { + if (typeof object.renamedServices !== "object") + throw TypeError(".google.api.DotnetSettings.renamedServices: object expected"); + message.renamedServices = {}; + for (var keys = Object.keys(object.renamedServices), i = 0; i < keys.length; ++i) + message.renamedServices[keys[i]] = String(object.renamedServices[keys[i]]); + } + if (object.renamedResources) { + if (typeof object.renamedResources !== "object") + throw TypeError(".google.api.DotnetSettings.renamedResources: object expected"); + message.renamedResources = {}; + for (var keys = Object.keys(object.renamedResources), i = 0; i < keys.length; ++i) + message.renamedResources[keys[i]] = String(object.renamedResources[keys[i]]); + } + if (object.ignoredResources) { + if (!Array.isArray(object.ignoredResources)) + throw TypeError(".google.api.DotnetSettings.ignoredResources: array expected"); + message.ignoredResources = []; + for (var i = 0; i < object.ignoredResources.length; ++i) + message.ignoredResources[i] = String(object.ignoredResources[i]); + } + if (object.forcedNamespaceAliases) { + if (!Array.isArray(object.forcedNamespaceAliases)) + throw TypeError(".google.api.DotnetSettings.forcedNamespaceAliases: array expected"); + message.forcedNamespaceAliases = []; + for (var i = 0; i < object.forcedNamespaceAliases.length; ++i) + message.forcedNamespaceAliases[i] = String(object.forcedNamespaceAliases[i]); + } + if (object.handwrittenSignatures) { + if (!Array.isArray(object.handwrittenSignatures)) + throw TypeError(".google.api.DotnetSettings.handwrittenSignatures: array expected"); + message.handwrittenSignatures = []; + for (var i = 0; i < object.handwrittenSignatures.length; ++i) + message.handwrittenSignatures[i] = String(object.handwrittenSignatures[i]); + } + return message; + }; + + /** + * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.DotnetSettings} message DotnetSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DotnetSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.ignoredResources = []; + object.forcedNamespaceAliases = []; + object.handwrittenSignatures = []; + } + if (options.objects || options.defaults) { + object.renamedServices = {}; + object.renamedResources = {}; + } + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + var keys2; + if (message.renamedServices && (keys2 = Object.keys(message.renamedServices)).length) { + object.renamedServices = {}; + for (var j = 0; j < keys2.length; ++j) + object.renamedServices[keys2[j]] = message.renamedServices[keys2[j]]; + } + if (message.renamedResources && (keys2 = Object.keys(message.renamedResources)).length) { + object.renamedResources = {}; + for (var j = 0; j < keys2.length; ++j) + object.renamedResources[keys2[j]] = message.renamedResources[keys2[j]]; + } + if (message.ignoredResources && message.ignoredResources.length) { + object.ignoredResources = []; + for (var j = 0; j < message.ignoredResources.length; ++j) + object.ignoredResources[j] = message.ignoredResources[j]; + } + if (message.forcedNamespaceAliases && message.forcedNamespaceAliases.length) { + object.forcedNamespaceAliases = []; + for (var j = 0; j < message.forcedNamespaceAliases.length; ++j) + object.forcedNamespaceAliases[j] = message.forcedNamespaceAliases[j]; + } + if (message.handwrittenSignatures && message.handwrittenSignatures.length) { + object.handwrittenSignatures = []; + for (var j = 0; j < message.handwrittenSignatures.length; ++j) + object.handwrittenSignatures[j] = message.handwrittenSignatures[j]; + } + return object; + }; + + /** + * Converts this DotnetSettings to JSON. + * @function toJSON + * @memberof google.api.DotnetSettings + * @instance + * @returns {Object.} JSON object + */ + DotnetSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DotnetSettings + * @function getTypeUrl + * @memberof google.api.DotnetSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DotnetSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.DotnetSettings"; + }; + + return DotnetSettings; + })(); + + api.RubySettings = (function() { + + /** + * Properties of a RubySettings. + * @memberof google.api + * @interface IRubySettings + * @property {google.api.ICommonLanguageSettings|null} [common] RubySettings common + */ + + /** + * Constructs a new RubySettings. + * @memberof google.api + * @classdesc Represents a RubySettings. + * @implements IRubySettings + * @constructor + * @param {google.api.IRubySettings=} [properties] Properties to set + */ + function RubySettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RubySettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.RubySettings + * @instance + */ + RubySettings.prototype.common = null; + + /** + * Creates a new RubySettings instance using the specified properties. + * @function create + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings=} [properties] Properties to set + * @returns {google.api.RubySettings} RubySettings instance + */ + RubySettings.create = function create(properties) { + return new RubySettings(properties); + }; + + /** + * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @function encode + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings} message RubySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RubySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings} message RubySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RubySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RubySettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.RubySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.RubySettings} RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RubySettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.RubySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RubySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.RubySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.RubySettings} RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RubySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RubySettings message. + * @function verify + * @memberof google.api.RubySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RubySettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.RubySettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.RubySettings} RubySettings + */ + RubySettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.RubySettings) + return object; + var message = new $root.google.api.RubySettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.RubySettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a RubySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.RubySettings + * @static + * @param {google.api.RubySettings} message RubySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RubySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this RubySettings to JSON. + * @function toJSON + * @memberof google.api.RubySettings + * @instance + * @returns {Object.} JSON object + */ + RubySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RubySettings + * @function getTypeUrl + * @memberof google.api.RubySettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RubySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.RubySettings"; + }; + + return RubySettings; + })(); + + api.GoSettings = (function() { + + /** + * Properties of a GoSettings. + * @memberof google.api + * @interface IGoSettings + * @property {google.api.ICommonLanguageSettings|null} [common] GoSettings common + */ + + /** + * Constructs a new GoSettings. + * @memberof google.api + * @classdesc Represents a GoSettings. + * @implements IGoSettings + * @constructor + * @param {google.api.IGoSettings=} [properties] Properties to set + */ + function GoSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GoSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.GoSettings + * @instance + */ + GoSettings.prototype.common = null; + + /** + * Creates a new GoSettings instance using the specified properties. + * @function create + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings=} [properties] Properties to set + * @returns {google.api.GoSettings} GoSettings instance + */ + GoSettings.create = function create(properties) { + return new GoSettings(properties); + }; + + /** + * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @function encode + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings} message GoSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings} message GoSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GoSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.GoSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.GoSettings} GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.GoSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GoSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.GoSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.GoSettings} GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GoSettings message. + * @function verify + * @memberof google.api.GoSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GoSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.GoSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.GoSettings} GoSettings + */ + GoSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.GoSettings) + return object; + var message = new $root.google.api.GoSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.GoSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a GoSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.GoSettings + * @static + * @param {google.api.GoSettings} message GoSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GoSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this GoSettings to JSON. + * @function toJSON + * @memberof google.api.GoSettings + * @instance + * @returns {Object.} JSON object + */ + GoSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GoSettings + * @function getTypeUrl + * @memberof google.api.GoSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GoSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.GoSettings"; + }; + + return GoSettings; + })(); + + api.MethodSettings = (function() { + + /** + * Properties of a MethodSettings. + * @memberof google.api + * @interface IMethodSettings + * @property {string|null} [selector] MethodSettings selector + * @property {google.api.MethodSettings.ILongRunning|null} [longRunning] MethodSettings longRunning + * @property {Array.|null} [autoPopulatedFields] MethodSettings autoPopulatedFields + */ + + /** + * Constructs a new MethodSettings. + * @memberof google.api + * @classdesc Represents a MethodSettings. + * @implements IMethodSettings + * @constructor + * @param {google.api.IMethodSettings=} [properties] Properties to set + */ + function MethodSettings(properties) { + this.autoPopulatedFields = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodSettings selector. + * @member {string} selector + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.selector = ""; + + /** + * MethodSettings longRunning. + * @member {google.api.MethodSettings.ILongRunning|null|undefined} longRunning + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.longRunning = null; + + /** + * MethodSettings autoPopulatedFields. + * @member {Array.} autoPopulatedFields + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.autoPopulatedFields = $util.emptyArray; + + /** + * Creates a new MethodSettings instance using the specified properties. + * @function create + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings=} [properties] Properties to set + * @returns {google.api.MethodSettings} MethodSettings instance + */ + MethodSettings.create = function create(properties) { + return new MethodSettings(properties); + }; + + /** + * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @function encode + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.longRunning != null && Object.hasOwnProperty.call(message, "longRunning")) + $root.google.api.MethodSettings.LongRunning.encode(message.longRunning, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.autoPopulatedFields != null && message.autoPopulatedFields.length) + for (var i = 0; i < message.autoPopulatedFields.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.autoPopulatedFields[i]); + return writer; + }; + + /** + * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.MethodSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.MethodSettings} MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.longRunning = $root.google.api.MethodSettings.LongRunning.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.autoPopulatedFields && message.autoPopulatedFields.length)) + message.autoPopulatedFields = []; + message.autoPopulatedFields.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.MethodSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.MethodSettings} MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodSettings message. + * @function verify + * @memberof google.api.MethodSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.longRunning != null && message.hasOwnProperty("longRunning")) { + var error = $root.google.api.MethodSettings.LongRunning.verify(message.longRunning); + if (error) + return "longRunning." + error; + } + if (message.autoPopulatedFields != null && message.hasOwnProperty("autoPopulatedFields")) { + if (!Array.isArray(message.autoPopulatedFields)) + return "autoPopulatedFields: array expected"; + for (var i = 0; i < message.autoPopulatedFields.length; ++i) + if (!$util.isString(message.autoPopulatedFields[i])) + return "autoPopulatedFields: string[] expected"; + } + return null; + }; + + /** + * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.MethodSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.MethodSettings} MethodSettings + */ + MethodSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.MethodSettings) + return object; + var message = new $root.google.api.MethodSettings(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.longRunning != null) { + if (typeof object.longRunning !== "object") + throw TypeError(".google.api.MethodSettings.longRunning: object expected"); + message.longRunning = $root.google.api.MethodSettings.LongRunning.fromObject(object.longRunning); + } + if (object.autoPopulatedFields) { + if (!Array.isArray(object.autoPopulatedFields)) + throw TypeError(".google.api.MethodSettings.autoPopulatedFields: array expected"); + message.autoPopulatedFields = []; + for (var i = 0; i < object.autoPopulatedFields.length; ++i) + message.autoPopulatedFields[i] = String(object.autoPopulatedFields[i]); + } + return message; + }; + + /** + * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.MethodSettings + * @static + * @param {google.api.MethodSettings} message MethodSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.autoPopulatedFields = []; + if (options.defaults) { + object.selector = ""; + object.longRunning = null; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.longRunning != null && message.hasOwnProperty("longRunning")) + object.longRunning = $root.google.api.MethodSettings.LongRunning.toObject(message.longRunning, options); + if (message.autoPopulatedFields && message.autoPopulatedFields.length) { + object.autoPopulatedFields = []; + for (var j = 0; j < message.autoPopulatedFields.length; ++j) + object.autoPopulatedFields[j] = message.autoPopulatedFields[j]; + } + return object; + }; + + /** + * Converts this MethodSettings to JSON. + * @function toJSON + * @memberof google.api.MethodSettings + * @instance + * @returns {Object.} JSON object + */ + MethodSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodSettings + * @function getTypeUrl + * @memberof google.api.MethodSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.MethodSettings"; + }; + + MethodSettings.LongRunning = (function() { + + /** + * Properties of a LongRunning. + * @memberof google.api.MethodSettings + * @interface ILongRunning + * @property {google.protobuf.IDuration|null} [initialPollDelay] LongRunning initialPollDelay + * @property {number|null} [pollDelayMultiplier] LongRunning pollDelayMultiplier + * @property {google.protobuf.IDuration|null} [maxPollDelay] LongRunning maxPollDelay + * @property {google.protobuf.IDuration|null} [totalPollTimeout] LongRunning totalPollTimeout + */ + + /** + * Constructs a new LongRunning. + * @memberof google.api.MethodSettings + * @classdesc Represents a LongRunning. + * @implements ILongRunning + * @constructor + * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set + */ + function LongRunning(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LongRunning initialPollDelay. + * @member {google.protobuf.IDuration|null|undefined} initialPollDelay + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.initialPollDelay = null; + + /** + * LongRunning pollDelayMultiplier. + * @member {number} pollDelayMultiplier + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.pollDelayMultiplier = 0; + + /** + * LongRunning maxPollDelay. + * @member {google.protobuf.IDuration|null|undefined} maxPollDelay + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.maxPollDelay = null; + + /** + * LongRunning totalPollTimeout. + * @member {google.protobuf.IDuration|null|undefined} totalPollTimeout + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.totalPollTimeout = null; + + /** + * Creates a new LongRunning instance using the specified properties. + * @function create + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set + * @returns {google.api.MethodSettings.LongRunning} LongRunning instance + */ + LongRunning.create = function create(properties) { + return new LongRunning(properties); + }; + + /** + * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @function encode + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunning.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.initialPollDelay != null && Object.hasOwnProperty.call(message, "initialPollDelay")) + $root.google.protobuf.Duration.encode(message.initialPollDelay, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pollDelayMultiplier != null && Object.hasOwnProperty.call(message, "pollDelayMultiplier")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.pollDelayMultiplier); + if (message.maxPollDelay != null && Object.hasOwnProperty.call(message, "maxPollDelay")) + $root.google.protobuf.Duration.encode(message.maxPollDelay, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.totalPollTimeout != null && Object.hasOwnProperty.call(message, "totalPollTimeout")) + $root.google.protobuf.Duration.encode(message.totalPollTimeout, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunning.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LongRunning message from the specified reader or buffer. + * @function decode + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.MethodSettings.LongRunning} LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunning.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings.LongRunning(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.initialPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 2: { + message.pollDelayMultiplier = reader.float(); + break; + } + case 3: { + message.maxPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 4: { + message.totalPollTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LongRunning message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.MethodSettings.LongRunning} LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunning.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LongRunning message. + * @function verify + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LongRunning.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) { + var error = $root.google.protobuf.Duration.verify(message.initialPollDelay); + if (error) + return "initialPollDelay." + error; + } + if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) + if (typeof message.pollDelayMultiplier !== "number") + return "pollDelayMultiplier: number expected"; + if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) { + var error = $root.google.protobuf.Duration.verify(message.maxPollDelay); + if (error) + return "maxPollDelay." + error; + } + if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) { + var error = $root.google.protobuf.Duration.verify(message.totalPollTimeout); + if (error) + return "totalPollTimeout." + error; + } + return null; + }; + + /** + * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {Object.} object Plain object + * @returns {google.api.MethodSettings.LongRunning} LongRunning + */ + LongRunning.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.MethodSettings.LongRunning) + return object; + var message = new $root.google.api.MethodSettings.LongRunning(); + if (object.initialPollDelay != null) { + if (typeof object.initialPollDelay !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.initialPollDelay: object expected"); + message.initialPollDelay = $root.google.protobuf.Duration.fromObject(object.initialPollDelay); + } + if (object.pollDelayMultiplier != null) + message.pollDelayMultiplier = Number(object.pollDelayMultiplier); + if (object.maxPollDelay != null) { + if (typeof object.maxPollDelay !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.maxPollDelay: object expected"); + message.maxPollDelay = $root.google.protobuf.Duration.fromObject(object.maxPollDelay); + } + if (object.totalPollTimeout != null) { + if (typeof object.totalPollTimeout !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.totalPollTimeout: object expected"); + message.totalPollTimeout = $root.google.protobuf.Duration.fromObject(object.totalPollTimeout); + } + return message; + }; + + /** + * Creates a plain object from a LongRunning message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.LongRunning} message LongRunning + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LongRunning.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.initialPollDelay = null; + object.pollDelayMultiplier = 0; + object.maxPollDelay = null; + object.totalPollTimeout = null; + } + if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) + object.initialPollDelay = $root.google.protobuf.Duration.toObject(message.initialPollDelay, options); + if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) + object.pollDelayMultiplier = options.json && !isFinite(message.pollDelayMultiplier) ? String(message.pollDelayMultiplier) : message.pollDelayMultiplier; + if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) + object.maxPollDelay = $root.google.protobuf.Duration.toObject(message.maxPollDelay, options); + if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) + object.totalPollTimeout = $root.google.protobuf.Duration.toObject(message.totalPollTimeout, options); + return object; + }; + + /** + * Converts this LongRunning to JSON. + * @function toJSON + * @memberof google.api.MethodSettings.LongRunning + * @instance + * @returns {Object.} JSON object + */ + LongRunning.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LongRunning + * @function getTypeUrl + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LongRunning.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.MethodSettings.LongRunning"; + }; + + return LongRunning; + })(); + + return MethodSettings; + })(); + + /** + * ClientLibraryOrganization enum. + * @name google.api.ClientLibraryOrganization + * @enum {number} + * @property {number} CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED=0 CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED value + * @property {number} CLOUD=1 CLOUD value + * @property {number} ADS=2 ADS value + * @property {number} PHOTOS=3 PHOTOS value + * @property {number} STREET_VIEW=4 STREET_VIEW value + * @property {number} SHOPPING=5 SHOPPING value + * @property {number} GEO=6 GEO value + * @property {number} GENERATIVE_AI=7 GENERATIVE_AI value + */ + api.ClientLibraryOrganization = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED"] = 0; + values[valuesById[1] = "CLOUD"] = 1; + values[valuesById[2] = "ADS"] = 2; + values[valuesById[3] = "PHOTOS"] = 3; + values[valuesById[4] = "STREET_VIEW"] = 4; + values[valuesById[5] = "SHOPPING"] = 5; + values[valuesById[6] = "GEO"] = 6; + values[valuesById[7] = "GENERATIVE_AI"] = 7; + return values; + })(); + + /** + * ClientLibraryDestination enum. + * @name google.api.ClientLibraryDestination + * @enum {number} + * @property {number} CLIENT_LIBRARY_DESTINATION_UNSPECIFIED=0 CLIENT_LIBRARY_DESTINATION_UNSPECIFIED value + * @property {number} GITHUB=10 GITHUB value + * @property {number} PACKAGE_MANAGER=20 PACKAGE_MANAGER value + */ + api.ClientLibraryDestination = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED"] = 0; + values[valuesById[10] = "GITHUB"] = 10; + values[valuesById[20] = "PACKAGE_MANAGER"] = 20; + return values; + })(); + + /** + * LaunchStage enum. + * @name google.api.LaunchStage + * @enum {number} + * @property {number} LAUNCH_STAGE_UNSPECIFIED=0 LAUNCH_STAGE_UNSPECIFIED value + * @property {number} UNIMPLEMENTED=6 UNIMPLEMENTED value + * @property {number} PRELAUNCH=7 PRELAUNCH value + * @property {number} EARLY_ACCESS=1 EARLY_ACCESS value + * @property {number} ALPHA=2 ALPHA value + * @property {number} BETA=3 BETA value + * @property {number} GA=4 GA value + * @property {number} DEPRECATED=5 DEPRECATED value + */ + api.LaunchStage = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LAUNCH_STAGE_UNSPECIFIED"] = 0; + values[valuesById[6] = "UNIMPLEMENTED"] = 6; + values[valuesById[7] = "PRELAUNCH"] = 7; + values[valuesById[1] = "EARLY_ACCESS"] = 1; + values[valuesById[2] = "ALPHA"] = 2; + values[valuesById[3] = "BETA"] = 3; + values[valuesById[4] = "GA"] = 4; + values[valuesById[5] = "DEPRECATED"] = 5; + return values; + })(); + + return api; + })(); + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + var protobuf = {}; + + protobuf.FileDescriptorSet = (function() { + + /** + * Properties of a FileDescriptorSet. + * @memberof google.protobuf + * @interface IFileDescriptorSet + * @property {Array.|null} [file] FileDescriptorSet file + */ + + /** + * Constructs a new FileDescriptorSet. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorSet. + * @implements IFileDescriptorSet + * @constructor + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + */ + function FileDescriptorSet(properties) { + this.file = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileDescriptorSet file. + * @member {Array.} file + * @memberof google.protobuf.FileDescriptorSet + * @instance + */ + FileDescriptorSet.prototype.file = $util.emptyArray; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance + */ + FileDescriptorSet.create = function create(properties) { + return new FileDescriptorSet(properties); + }; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.file != null && message.file.length) + for (var i = 0; i < message.file.length; ++i) + $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.file && message.file.length)) + message.file = []; + message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorSet message. + * @function verify + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.file != null && message.hasOwnProperty("file")) { + if (!Array.isArray(message.file)) + return "file: array expected"; + for (var i = 0; i < message.file.length; ++i) { + var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]); + if (error) + return "file." + error; + } + } + return null; + }; + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + */ + FileDescriptorSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorSet) + return object; + var message = new $root.google.protobuf.FileDescriptorSet(); + if (object.file) { + if (!Array.isArray(object.file)) + throw TypeError(".google.protobuf.FileDescriptorSet.file: array expected"); + message.file = []; + for (var i = 0; i < object.file.length; ++i) { + if (typeof object.file[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected"); + message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.file = []; + if (message.file && message.file.length) { + object.file = []; + for (var j = 0; j < message.file.length; ++j) + object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options); + } + return object; + }; + + /** + * Converts this FileDescriptorSet to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorSet + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileDescriptorSet + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorSet"; + }; + + return FileDescriptorSet; + })(); + + /** + * Edition enum. + * @name google.protobuf.Edition + * @enum {number} + * @property {number} EDITION_UNKNOWN=0 EDITION_UNKNOWN value + * @property {number} EDITION_PROTO2=998 EDITION_PROTO2 value + * @property {number} EDITION_PROTO3=999 EDITION_PROTO3 value + * @property {number} EDITION_2023=1000 EDITION_2023 value + * @property {number} EDITION_2024=1001 EDITION_2024 value + * @property {number} EDITION_1_TEST_ONLY=1 EDITION_1_TEST_ONLY value + * @property {number} EDITION_2_TEST_ONLY=2 EDITION_2_TEST_ONLY value + * @property {number} EDITION_99997_TEST_ONLY=99997 EDITION_99997_TEST_ONLY value + * @property {number} EDITION_99998_TEST_ONLY=99998 EDITION_99998_TEST_ONLY value + * @property {number} EDITION_99999_TEST_ONLY=99999 EDITION_99999_TEST_ONLY value + * @property {number} EDITION_MAX=2147483647 EDITION_MAX value + */ + protobuf.Edition = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EDITION_UNKNOWN"] = 0; + values[valuesById[998] = "EDITION_PROTO2"] = 998; + values[valuesById[999] = "EDITION_PROTO3"] = 999; + values[valuesById[1000] = "EDITION_2023"] = 1000; + values[valuesById[1001] = "EDITION_2024"] = 1001; + values[valuesById[1] = "EDITION_1_TEST_ONLY"] = 1; + values[valuesById[2] = "EDITION_2_TEST_ONLY"] = 2; + values[valuesById[99997] = "EDITION_99997_TEST_ONLY"] = 99997; + values[valuesById[99998] = "EDITION_99998_TEST_ONLY"] = 99998; + values[valuesById[99999] = "EDITION_99999_TEST_ONLY"] = 99999; + values[valuesById[2147483647] = "EDITION_MAX"] = 2147483647; + return values; + })(); + + protobuf.FileDescriptorProto = (function() { + + /** + * Properties of a FileDescriptorProto. + * @memberof google.protobuf + * @interface IFileDescriptorProto + * @property {string|null} [name] FileDescriptorProto name + * @property {string|null} ["package"] FileDescriptorProto package + * @property {Array.|null} [dependency] FileDescriptorProto dependency + * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency + * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency + * @property {Array.|null} [messageType] FileDescriptorProto messageType + * @property {Array.|null} [enumType] FileDescriptorProto enumType + * @property {Array.|null} [service] FileDescriptorProto service + * @property {Array.|null} [extension] FileDescriptorProto extension + * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options + * @property {google.protobuf.ISourceCodeInfo|null} [sourceCodeInfo] FileDescriptorProto sourceCodeInfo + * @property {string|null} [syntax] FileDescriptorProto syntax + * @property {google.protobuf.Edition|null} [edition] FileDescriptorProto edition + */ + + /** + * Constructs a new FileDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorProto. + * @implements IFileDescriptorProto + * @constructor + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + */ + function FileDescriptorProto(properties) { + this.dependency = []; + this.publicDependency = []; + this.weakDependency = []; + this.messageType = []; + this.enumType = []; + this.service = []; + this.extension = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.name = ""; + + /** + * FileDescriptorProto package. + * @member {string} package + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype["package"] = ""; + + /** + * FileDescriptorProto dependency. + * @member {Array.} dependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.dependency = $util.emptyArray; + + /** + * FileDescriptorProto publicDependency. + * @member {Array.} publicDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.publicDependency = $util.emptyArray; + + /** + * FileDescriptorProto weakDependency. + * @member {Array.} weakDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.weakDependency = $util.emptyArray; + + /** + * FileDescriptorProto messageType. + * @member {Array.} messageType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.messageType = $util.emptyArray; + + /** + * FileDescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * FileDescriptorProto service. + * @member {Array.} service + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.service = $util.emptyArray; + + /** + * FileDescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.extension = $util.emptyArray; + + /** + * FileDescriptorProto options. + * @member {google.protobuf.IFileOptions|null|undefined} options + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.options = null; + + /** + * FileDescriptorProto sourceCodeInfo. + * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.sourceCodeInfo = null; + + /** + * FileDescriptorProto syntax. + * @member {string} syntax + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.syntax = ""; + + /** + * FileDescriptorProto edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.edition = 0; + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance + */ + FileDescriptorProto.create = function create(properties) { + return new FileDescriptorProto(properties); + }; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); + if (message.dependency != null && message.dependency.length) + for (var i = 0; i < message.dependency.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); + if (message.messageType != null && message.messageType.length) + for (var i = 0; i < message.messageType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.service != null && message.service.length) + for (var i = 0; i < message.service.length; ++i) + $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo")) + $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.publicDependency != null && message.publicDependency.length) + for (var i = 0; i < message.publicDependency.length; ++i) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]); + if (message.weakDependency != null && message.weakDependency.length) + for (var i = 0; i < message.weakDependency.length; ++i) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); + if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 14, wireType 0 =*/112).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message["package"] = reader.string(); + break; + } + case 3: { + if (!(message.dependency && message.dependency.length)) + message.dependency = []; + message.dependency.push(reader.string()); + break; + } + case 10: { + if (!(message.publicDependency && message.publicDependency.length)) + message.publicDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.publicDependency.push(reader.int32()); + } else + message.publicDependency.push(reader.int32()); + break; + } + case 11: { + if (!(message.weakDependency && message.weakDependency.length)) + message.weakDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.weakDependency.push(reader.int32()); + } else + message.weakDependency.push(reader.int32()); + break; + } + case 4: { + if (!(message.messageType && message.messageType.length)) + message.messageType = []; + message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.service && message.service.length)) + message.service = []; + message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 7: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 8: { + message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32()); + break; + } + case 12: { + message.syntax = reader.string(); + break; + } + case 14: { + message.edition = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorProto message. + * @function verify + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message["package"] != null && message.hasOwnProperty("package")) + if (!$util.isString(message["package"])) + return "package: string expected"; + if (message.dependency != null && message.hasOwnProperty("dependency")) { + if (!Array.isArray(message.dependency)) + return "dependency: array expected"; + for (var i = 0; i < message.dependency.length; ++i) + if (!$util.isString(message.dependency[i])) + return "dependency: string[] expected"; + } + if (message.publicDependency != null && message.hasOwnProperty("publicDependency")) { + if (!Array.isArray(message.publicDependency)) + return "publicDependency: array expected"; + for (var i = 0; i < message.publicDependency.length; ++i) + if (!$util.isInteger(message.publicDependency[i])) + return "publicDependency: integer[] expected"; + } + if (message.weakDependency != null && message.hasOwnProperty("weakDependency")) { + if (!Array.isArray(message.weakDependency)) + return "weakDependency: array expected"; + for (var i = 0; i < message.weakDependency.length; ++i) + if (!$util.isInteger(message.weakDependency[i])) + return "weakDependency: integer[] expected"; + } + if (message.messageType != null && message.hasOwnProperty("messageType")) { + if (!Array.isArray(message.messageType)) + return "messageType: array expected"; + for (var i = 0; i < message.messageType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.messageType[i]); + if (error) + return "messageType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.service != null && message.hasOwnProperty("service")) { + if (!Array.isArray(message.service)) + return "service: array expected"; + for (var i = 0; i < message.service.length; ++i) { + var error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i]); + if (error) + return "service." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FileOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) { + var error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo); + if (error) + return "sourceCodeInfo." + error; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + if (!$util.isString(message.syntax)) + return "syntax: string expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + return null; + }; + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + */ + FileDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorProto) + return object; + var message = new $root.google.protobuf.FileDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object["package"] != null) + message["package"] = String(object["package"]); + if (object.dependency) { + if (!Array.isArray(object.dependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.dependency: array expected"); + message.dependency = []; + for (var i = 0; i < object.dependency.length; ++i) + message.dependency[i] = String(object.dependency[i]); + } + if (object.publicDependency) { + if (!Array.isArray(object.publicDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.publicDependency: array expected"); + message.publicDependency = []; + for (var i = 0; i < object.publicDependency.length; ++i) + message.publicDependency[i] = object.publicDependency[i] | 0; + } + if (object.weakDependency) { + if (!Array.isArray(object.weakDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.weakDependency: array expected"); + message.weakDependency = []; + for (var i = 0; i < object.weakDependency.length; ++i) + message.weakDependency[i] = object.weakDependency[i] | 0; + } + if (object.messageType) { + if (!Array.isArray(object.messageType)) + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); + message.messageType = []; + for (var i = 0; i < object.messageType.length; ++i) { + if (typeof object.messageType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: object expected"); + message.messageType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.messageType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.service) { + if (!Array.isArray(object.service)) + throw TypeError(".google.protobuf.FileDescriptorProto.service: array expected"); + message.service = []; + for (var i = 0; i < object.service.length; ++i) { + if (typeof object.service[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.service: object expected"); + message.service[i] = $root.google.protobuf.ServiceDescriptorProto.fromObject(object.service[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.FileDescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FileOptions.fromObject(object.options); + } + if (object.sourceCodeInfo != null) { + if (typeof object.sourceCodeInfo !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.sourceCodeInfo: object expected"); + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.fromObject(object.sourceCodeInfo); + } + if (object.syntax != null) + message.syntax = String(object.syntax); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + return message; + }; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.dependency = []; + object.messageType = []; + object.enumType = []; + object.service = []; + object.extension = []; + object.publicDependency = []; + object.weakDependency = []; + } + if (options.defaults) { + object.name = ""; + object["package"] = ""; + object.options = null; + object.sourceCodeInfo = null; + object.syntax = ""; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message["package"] != null && message.hasOwnProperty("package")) + object["package"] = message["package"]; + if (message.dependency && message.dependency.length) { + object.dependency = []; + for (var j = 0; j < message.dependency.length; ++j) + object.dependency[j] = message.dependency[j]; + } + if (message.messageType && message.messageType.length) { + object.messageType = []; + for (var j = 0; j < message.messageType.length; ++j) + object.messageType[j] = $root.google.protobuf.DescriptorProto.toObject(message.messageType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.service && message.service.length) { + object.service = []; + for (var j = 0; j < message.service.length; ++j) + object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FileOptions.toObject(message.options, options); + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) + object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options); + if (message.publicDependency && message.publicDependency.length) { + object.publicDependency = []; + for (var j = 0; j < message.publicDependency.length; ++j) + object.publicDependency[j] = message.publicDependency[j]; + } + if (message.weakDependency && message.weakDependency.length) { + object.weakDependency = []; + for (var j = 0; j < message.weakDependency.length; ++j) + object.weakDependency[j] = message.weakDependency[j]; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + object.syntax = message.syntax; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this FileDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorProto"; + }; + + return FileDescriptorProto; + })(); + + protobuf.DescriptorProto = (function() { + + /** + * Properties of a DescriptorProto. + * @memberof google.protobuf + * @interface IDescriptorProto + * @property {string|null} [name] DescriptorProto name + * @property {Array.|null} [field] DescriptorProto field + * @property {Array.|null} [extension] DescriptorProto extension + * @property {Array.|null} [nestedType] DescriptorProto nestedType + * @property {Array.|null} [enumType] DescriptorProto enumType + * @property {Array.|null} [extensionRange] DescriptorProto extensionRange + * @property {Array.|null} [oneofDecl] DescriptorProto oneofDecl + * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options + * @property {Array.|null} [reservedRange] DescriptorProto reservedRange + * @property {Array.|null} [reservedName] DescriptorProto reservedName + */ + + /** + * Constructs a new DescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a DescriptorProto. + * @implements IDescriptorProto + * @constructor + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + */ + function DescriptorProto(properties) { + this.field = []; + this.extension = []; + this.nestedType = []; + this.enumType = []; + this.extensionRange = []; + this.oneofDecl = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DescriptorProto name. + * @member {string} name + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.name = ""; + + /** + * DescriptorProto field. + * @member {Array.} field + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.field = $util.emptyArray; + + /** + * DescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extension = $util.emptyArray; + + /** + * DescriptorProto nestedType. + * @member {Array.} nestedType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.nestedType = $util.emptyArray; + + /** + * DescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * DescriptorProto extensionRange. + * @member {Array.} extensionRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extensionRange = $util.emptyArray; + + /** + * DescriptorProto oneofDecl. + * @member {Array.} oneofDecl + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.oneofDecl = $util.emptyArray; + + /** + * DescriptorProto options. + * @member {google.protobuf.IMessageOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.options = null; + + /** + * DescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * DescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto} DescriptorProto instance + */ + DescriptorProto.create = function create(properties) { + return new DescriptorProto(properties); + }; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.field != null && message.field.length) + for (var i = 0; i < message.field.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nestedType != null && message.nestedType.length) + for (var i = 0; i < message.nestedType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.nestedType[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.extensionRange != null && message.extensionRange.length) + for (var i = 0; i < message.extensionRange.length; ++i) + $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extensionRange[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.oneofDecl != null && message.oneofDecl.length) + for (var i = 0; i < message.oneofDecl.length; ++i) + $root.google.protobuf.OneofDescriptorProto.encode(message.oneofDecl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.field && message.field.length)) + message.field = []; + message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.nestedType && message.nestedType.length)) + message.nestedType = []; + message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.extensionRange && message.extensionRange.length)) + message.extensionRange = []; + message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32())); + break; + } + case 8: { + if (!(message.oneofDecl && message.oneofDecl.length)) + message.oneofDecl = []; + message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 7: { + message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32())); + break; + } + case 10: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DescriptorProto message. + * @function verify + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.field != null && message.hasOwnProperty("field")) { + if (!Array.isArray(message.field)) + return "field: array expected"; + for (var i = 0; i < message.field.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.field[i]); + if (error) + return "field." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.nestedType != null && message.hasOwnProperty("nestedType")) { + if (!Array.isArray(message.nestedType)) + return "nestedType: array expected"; + for (var i = 0; i < message.nestedType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.nestedType[i]); + if (error) + return "nestedType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.extensionRange != null && message.hasOwnProperty("extensionRange")) { + if (!Array.isArray(message.extensionRange)) + return "extensionRange: array expected"; + for (var i = 0; i < message.extensionRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ExtensionRange.verify(message.extensionRange[i]); + if (error) + return "extensionRange." + error; + } + } + if (message.oneofDecl != null && message.hasOwnProperty("oneofDecl")) { + if (!Array.isArray(message.oneofDecl)) + return "oneofDecl: array expected"; + for (var i = 0; i < message.oneofDecl.length; ++i) { + var error = $root.google.protobuf.OneofDescriptorProto.verify(message.oneofDecl[i]); + if (error) + return "oneofDecl." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MessageOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto} DescriptorProto + */ + DescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto) + return object; + var message = new $root.google.protobuf.DescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.field) { + if (!Array.isArray(object.field)) + throw TypeError(".google.protobuf.DescriptorProto.field: array expected"); + message.field = []; + for (var i = 0; i < object.field.length; ++i) { + if (typeof object.field[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.field: object expected"); + message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.DescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.nestedType) { + if (!Array.isArray(object.nestedType)) + throw TypeError(".google.protobuf.DescriptorProto.nestedType: array expected"); + message.nestedType = []; + for (var i = 0; i < object.nestedType.length; ++i) { + if (typeof object.nestedType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.nestedType: object expected"); + message.nestedType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nestedType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.DescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.extensionRange) { + if (!Array.isArray(object.extensionRange)) + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: array expected"); + message.extensionRange = []; + for (var i = 0; i < object.extensionRange.length; ++i) { + if (typeof object.extensionRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: object expected"); + message.extensionRange[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extensionRange[i]); + } + } + if (object.oneofDecl) { + if (!Array.isArray(object.oneofDecl)) + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: array expected"); + message.oneofDecl = []; + for (var i = 0; i < object.oneofDecl.length; ++i) { + if (typeof object.oneofDecl[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: object expected"); + message.oneofDecl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneofDecl[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MessageOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.DescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.DescriptorProto} message DescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.field = []; + object.nestedType = []; + object.enumType = []; + object.extensionRange = []; + object.extension = []; + object.oneofDecl = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.field && message.field.length) { + object.field = []; + for (var j = 0; j < message.field.length; ++j) + object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options); + } + if (message.nestedType && message.nestedType.length) { + object.nestedType = []; + for (var j = 0; j < message.nestedType.length; ++j) + object.nestedType[j] = $root.google.protobuf.DescriptorProto.toObject(message.nestedType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.extensionRange && message.extensionRange.length) { + object.extensionRange = []; + for (var j = 0; j < message.extensionRange.length; ++j) + object.extensionRange[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extensionRange[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options); + if (message.oneofDecl && message.oneofDecl.length) { + object.oneofDecl = []; + for (var j = 0; j < message.oneofDecl.length; ++j) + object.oneofDecl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneofDecl[j], options); + } + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this DescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto + * @instance + * @returns {Object.} JSON object + */ + DescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto"; + }; + + DescriptorProto.ExtensionRange = (function() { + + /** + * Properties of an ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @interface IExtensionRange + * @property {number|null} [start] ExtensionRange start + * @property {number|null} [end] ExtensionRange end + * @property {google.protobuf.IExtensionRangeOptions|null} [options] ExtensionRange options + */ + + /** + * Constructs a new ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents an ExtensionRange. + * @implements IExtensionRange + * @constructor + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + */ + function ExtensionRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.start = 0; + + /** + * ExtensionRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.end = 0; + + /** + * ExtensionRange options. + * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.options = null; + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance + */ + ExtensionRange.create = function create(properties) { + return new ExtensionRange(properties); + }; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.ExtensionRangeOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ExtensionRangeOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + */ + ExtensionRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange.options: object expected"); + message.options = $root.google.protobuf.ExtensionRangeOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + object.options = null; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ExtensionRangeOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ExtensionRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + * @returns {Object.} JSON object + */ + ExtensionRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtensionRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ExtensionRange"; + }; + + return ExtensionRange; + })(); + + DescriptorProto.ReservedRange = (function() { + + /** + * Properties of a ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @interface IReservedRange + * @property {number|null} [start] ReservedRange start + * @property {number|null} [end] ReservedRange end + */ + + /** + * Constructs a new ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents a ReservedRange. + * @implements IReservedRange + * @constructor + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + */ + function ReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReservedRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.start = 0; + + /** + * ReservedRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.end = 0; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance + */ + ReservedRange.create = function create(properties) { + return new ReservedRange(properties); + }; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReservedRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + */ + ReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this ReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + * @returns {Object.} JSON object + */ + ReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReservedRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ReservedRange"; + }; + + return ReservedRange; + })(); + + return DescriptorProto; + })(); + + protobuf.ExtensionRangeOptions = (function() { + + /** + * Properties of an ExtensionRangeOptions. + * @memberof google.protobuf + * @interface IExtensionRangeOptions + * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption + * @property {Array.|null} [declaration] ExtensionRangeOptions declaration + * @property {google.protobuf.IFeatureSet|null} [features] ExtensionRangeOptions features + * @property {google.protobuf.ExtensionRangeOptions.VerificationState|null} [verification] ExtensionRangeOptions verification + */ + + /** + * Constructs a new ExtensionRangeOptions. + * @memberof google.protobuf + * @classdesc Represents an ExtensionRangeOptions. + * @implements IExtensionRangeOptions + * @constructor + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + */ + function ExtensionRangeOptions(properties) { + this.uninterpretedOption = []; + this.declaration = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRangeOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * ExtensionRangeOptions declaration. + * @member {Array.} declaration + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.declaration = $util.emptyArray; + + /** + * ExtensionRangeOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.features = null; + + /** + * ExtensionRangeOptions verification. + * @member {google.protobuf.ExtensionRangeOptions.VerificationState} verification + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.verification = 1; + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions instance + */ + ExtensionRangeOptions.create = function create(properties) { + return new ExtensionRangeOptions(properties); + }; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.declaration != null && message.declaration.length) + for (var i = 0; i < message.declaration.length; ++i) + $root.google.protobuf.ExtensionRangeOptions.Declaration.encode(message.declaration[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.verification != null && Object.hasOwnProperty.call(message, "verification")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.verification); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.declaration && message.declaration.length)) + message.declaration = []; + message.declaration.push($root.google.protobuf.ExtensionRangeOptions.Declaration.decode(reader, reader.uint32())); + break; + } + case 50: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 3: { + message.verification = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRangeOptions message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRangeOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message.declaration != null && message.hasOwnProperty("declaration")) { + if (!Array.isArray(message.declaration)) + return "declaration: array expected"; + for (var i = 0; i < message.declaration.length; ++i) { + var error = $root.google.protobuf.ExtensionRangeOptions.Declaration.verify(message.declaration[i]); + if (error) + return "declaration." + error; + } + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.verification != null && message.hasOwnProperty("verification")) + switch (message.verification) { + default: + return "verification: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + */ + ExtensionRangeOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions) + return object; + var message = new $root.google.protobuf.ExtensionRangeOptions(); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object.declaration) { + if (!Array.isArray(object.declaration)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: array expected"); + message.declaration = []; + for (var i = 0; i < object.declaration.length; ++i) { + if (typeof object.declaration[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: object expected"); + message.declaration[i] = $root.google.protobuf.ExtensionRangeOptions.Declaration.fromObject(object.declaration[i]); + } + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + switch (object.verification) { + case "DECLARATION": + case 0: + message.verification = 0; + break; + default: + if (typeof object.verification === "number") { + message.verification = object.verification; + break; + } + break; + case "UNVERIFIED": + case 1: + message.verification = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRangeOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.declaration = []; + object.uninterpretedOption = []; + } + if (options.defaults) { + object.verification = options.enums === String ? "UNVERIFIED" : 1; + object.features = null; + } + if (message.declaration && message.declaration.length) { + object.declaration = []; + for (var j = 0; j < message.declaration.length; ++j) + object.declaration[j] = $root.google.protobuf.ExtensionRangeOptions.Declaration.toObject(message.declaration[j], options); + } + if (message.verification != null && message.hasOwnProperty("verification")) + object.verification = options.enums === String ? $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] === undefined ? message.verification : $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] : message.verification; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + * @returns {Object.} JSON object + */ + ExtensionRangeOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @function getTypeUrl + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRangeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions"; + }; + + ExtensionRangeOptions.Declaration = (function() { + + /** + * Properties of a Declaration. + * @memberof google.protobuf.ExtensionRangeOptions + * @interface IDeclaration + * @property {number|null} [number] Declaration number + * @property {string|null} [fullName] Declaration fullName + * @property {string|null} [type] Declaration type + * @property {boolean|null} [reserved] Declaration reserved + * @property {boolean|null} [repeated] Declaration repeated + */ + + /** + * Constructs a new Declaration. + * @memberof google.protobuf.ExtensionRangeOptions + * @classdesc Represents a Declaration. + * @implements IDeclaration + * @constructor + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set + */ + function Declaration(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Declaration number. + * @member {number} number + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.number = 0; + + /** + * Declaration fullName. + * @member {string} fullName + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.fullName = ""; + + /** + * Declaration type. + * @member {string} type + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.type = ""; + + /** + * Declaration reserved. + * @member {boolean} reserved + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.reserved = false; + + /** + * Declaration repeated. + * @member {boolean} repeated + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.repeated = false; + + /** + * Creates a new Declaration instance using the specified properties. + * @function create + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration instance + */ + Declaration.create = function create(properties) { + return new Declaration(properties); + }; + + /** + * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Declaration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.number); + if (message.fullName != null && Object.hasOwnProperty.call(message, "fullName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.fullName); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.type); + if (message.reserved != null && Object.hasOwnProperty.call(message, "reserved")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.reserved); + if (message.repeated != null && Object.hasOwnProperty.call(message, "repeated")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.repeated); + return writer; + }; + + /** + * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Declaration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Declaration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Declaration.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.number = reader.int32(); + break; + } + case 2: { + message.fullName = reader.string(); + break; + } + case 3: { + message.type = reader.string(); + break; + } + case 5: { + message.reserved = reader.bool(); + break; + } + case 6: { + message.repeated = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Declaration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Declaration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Declaration message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Declaration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.fullName != null && message.hasOwnProperty("fullName")) + if (!$util.isString(message.fullName)) + return "fullName: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.reserved != null && message.hasOwnProperty("reserved")) + if (typeof message.reserved !== "boolean") + return "reserved: boolean expected"; + if (message.repeated != null && message.hasOwnProperty("repeated")) + if (typeof message.repeated !== "boolean") + return "repeated: boolean expected"; + return null; + }; + + /** + * Creates a Declaration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + */ + Declaration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions.Declaration) + return object; + var message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); + if (object.number != null) + message.number = object.number | 0; + if (object.fullName != null) + message.fullName = String(object.fullName); + if (object.type != null) + message.type = String(object.type); + if (object.reserved != null) + message.reserved = Boolean(object.reserved); + if (object.repeated != null) + message.repeated = Boolean(object.repeated); + return message; + }; + + /** + * Creates a plain object from a Declaration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.Declaration} message Declaration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Declaration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.number = 0; + object.fullName = ""; + object.type = ""; + object.reserved = false; + object.repeated = false; + } + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.fullName != null && message.hasOwnProperty("fullName")) + object.fullName = message.fullName; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.reserved != null && message.hasOwnProperty("reserved")) + object.reserved = message.reserved; + if (message.repeated != null && message.hasOwnProperty("repeated")) + object.repeated = message.repeated; + return object; + }; + + /** + * Converts this Declaration to JSON. + * @function toJSON + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + * @returns {Object.} JSON object + */ + Declaration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Declaration + * @function getTypeUrl + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Declaration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions.Declaration"; + }; + + return Declaration; + })(); + + /** + * VerificationState enum. + * @name google.protobuf.ExtensionRangeOptions.VerificationState + * @enum {number} + * @property {number} DECLARATION=0 DECLARATION value + * @property {number} UNVERIFIED=1 UNVERIFIED value + */ + ExtensionRangeOptions.VerificationState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DECLARATION"] = 0; + values[valuesById[1] = "UNVERIFIED"] = 1; + return values; + })(); + + return ExtensionRangeOptions; + })(); + + protobuf.FieldDescriptorProto = (function() { + + /** + * Properties of a FieldDescriptorProto. + * @memberof google.protobuf + * @interface IFieldDescriptorProto + * @property {string|null} [name] FieldDescriptorProto name + * @property {number|null} [number] FieldDescriptorProto number + * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label + * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type + * @property {string|null} [typeName] FieldDescriptorProto typeName + * @property {string|null} [extendee] FieldDescriptorProto extendee + * @property {string|null} [defaultValue] FieldDescriptorProto defaultValue + * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex + * @property {string|null} [jsonName] FieldDescriptorProto jsonName + * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options + * @property {boolean|null} [proto3Optional] FieldDescriptorProto proto3Optional + */ + + /** + * Constructs a new FieldDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FieldDescriptorProto. + * @implements IFieldDescriptorProto + * @constructor + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + */ + function FieldDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.name = ""; + + /** + * FieldDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.number = 0; + + /** + * FieldDescriptorProto label. + * @member {google.protobuf.FieldDescriptorProto.Label} label + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.label = 1; + + /** + * FieldDescriptorProto type. + * @member {google.protobuf.FieldDescriptorProto.Type} type + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.type = 1; + + /** + * FieldDescriptorProto typeName. + * @member {string} typeName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.typeName = ""; + + /** + * FieldDescriptorProto extendee. + * @member {string} extendee + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.extendee = ""; + + /** + * FieldDescriptorProto defaultValue. + * @member {string} defaultValue + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.defaultValue = ""; + + /** + * FieldDescriptorProto oneofIndex. + * @member {number} oneofIndex + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.oneofIndex = 0; + + /** + * FieldDescriptorProto jsonName. + * @member {string} jsonName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.jsonName = ""; + + /** + * FieldDescriptorProto options. + * @member {google.protobuf.IFieldOptions|null|undefined} options + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.options = null; + + /** + * FieldDescriptorProto proto3Optional. + * @member {boolean} proto3Optional + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.proto3Optional = false; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance + */ + FieldDescriptorProto.create = function create(properties) { + return new FieldDescriptorProto(properties); + }; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); + if (message.label != null && Object.hasOwnProperty.call(message, "label")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); + if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); + if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); + if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); + if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.proto3Optional); + return writer; + }; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.number = reader.int32(); + break; + } + case 4: { + message.label = reader.int32(); + break; + } + case 5: { + message.type = reader.int32(); + break; + } + case 6: { + message.typeName = reader.string(); + break; + } + case 2: { + message.extendee = reader.string(); + break; + } + case 7: { + message.defaultValue = reader.string(); + break; + } + case 9: { + message.oneofIndex = reader.int32(); + break; + } + case 10: { + message.jsonName = reader.string(); + break; + } + case 8: { + message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); + break; + } + case 17: { + message.proto3Optional = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldDescriptorProto message. + * @function verify + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.label != null && message.hasOwnProperty("label")) + switch (message.label) { + default: + return "label: enum value expected"; + case 1: + case 3: + case 2: + break; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + break; + } + if (message.typeName != null && message.hasOwnProperty("typeName")) + if (!$util.isString(message.typeName)) + return "typeName: string expected"; + if (message.extendee != null && message.hasOwnProperty("extendee")) + if (!$util.isString(message.extendee)) + return "extendee: string expected"; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + if (!$util.isString(message.defaultValue)) + return "defaultValue: string expected"; + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + if (!$util.isInteger(message.oneofIndex)) + return "oneofIndex: integer expected"; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + if (!$util.isString(message.jsonName)) + return "jsonName: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FieldOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + if (typeof message.proto3Optional !== "boolean") + return "proto3Optional: boolean expected"; + return null; + }; + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + */ + FieldDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldDescriptorProto) + return object; + var message = new $root.google.protobuf.FieldDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + switch (object.label) { + default: + if (typeof object.label === "number") { + message.label = object.label; + break; + } + break; + case "LABEL_OPTIONAL": + case 1: + message.label = 1; + break; + case "LABEL_REPEATED": + case 3: + message.label = 3; + break; + case "LABEL_REQUIRED": + case 2: + message.label = 2; + break; + } + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_DOUBLE": + case 1: + message.type = 1; + break; + case "TYPE_FLOAT": + case 2: + message.type = 2; + break; + case "TYPE_INT64": + case 3: + message.type = 3; + break; + case "TYPE_UINT64": + case 4: + message.type = 4; + break; + case "TYPE_INT32": + case 5: + message.type = 5; + break; + case "TYPE_FIXED64": + case 6: + message.type = 6; + break; + case "TYPE_FIXED32": + case 7: + message.type = 7; + break; + case "TYPE_BOOL": + case 8: + message.type = 8; + break; + case "TYPE_STRING": + case 9: + message.type = 9; + break; + case "TYPE_GROUP": + case 10: + message.type = 10; + break; + case "TYPE_MESSAGE": + case 11: + message.type = 11; + break; + case "TYPE_BYTES": + case 12: + message.type = 12; + break; + case "TYPE_UINT32": + case 13: + message.type = 13; + break; + case "TYPE_ENUM": + case 14: + message.type = 14; + break; + case "TYPE_SFIXED32": + case 15: + message.type = 15; + break; + case "TYPE_SFIXED64": + case 16: + message.type = 16; + break; + case "TYPE_SINT32": + case 17: + message.type = 17; + break; + case "TYPE_SINT64": + case 18: + message.type = 18; + break; + } + if (object.typeName != null) + message.typeName = String(object.typeName); + if (object.extendee != null) + message.extendee = String(object.extendee); + if (object.defaultValue != null) + message.defaultValue = String(object.defaultValue); + if (object.oneofIndex != null) + message.oneofIndex = object.oneofIndex | 0; + if (object.jsonName != null) + message.jsonName = String(object.jsonName); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FieldOptions.fromObject(object.options); + } + if (object.proto3Optional != null) + message.proto3Optional = Boolean(object.proto3Optional); + return message; + }; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.extendee = ""; + object.number = 0; + object.label = options.enums === String ? "LABEL_OPTIONAL" : 1; + object.type = options.enums === String ? "TYPE_DOUBLE" : 1; + object.typeName = ""; + object.defaultValue = ""; + object.options = null; + object.oneofIndex = 0; + object.jsonName = ""; + object.proto3Optional = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.extendee != null && message.hasOwnProperty("extendee")) + object.extendee = message.extendee; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.label != null && message.hasOwnProperty("label")) + object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] === undefined ? message.label : $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] === undefined ? message.type : $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; + if (message.typeName != null && message.hasOwnProperty("typeName")) + object.typeName = message.typeName; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + object.defaultValue = message.defaultValue; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options); + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + object.oneofIndex = message.oneofIndex; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + object.jsonName = message.jsonName; + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + object.proto3Optional = message.proto3Optional; + return object; + }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FieldDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FieldDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldDescriptorProto"; + }; + + /** + * Type enum. + * @name google.protobuf.FieldDescriptorProto.Type + * @enum {number} + * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value + * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value + * @property {number} TYPE_INT64=3 TYPE_INT64 value + * @property {number} TYPE_UINT64=4 TYPE_UINT64 value + * @property {number} TYPE_INT32=5 TYPE_INT32 value + * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value + * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value + * @property {number} TYPE_BOOL=8 TYPE_BOOL value + * @property {number} TYPE_STRING=9 TYPE_STRING value + * @property {number} TYPE_GROUP=10 TYPE_GROUP value + * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value + * @property {number} TYPE_BYTES=12 TYPE_BYTES value + * @property {number} TYPE_UINT32=13 TYPE_UINT32 value + * @property {number} TYPE_ENUM=14 TYPE_ENUM value + * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value + * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value + * @property {number} TYPE_SINT32=17 TYPE_SINT32 value + * @property {number} TYPE_SINT64=18 TYPE_SINT64 value + */ + FieldDescriptorProto.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "TYPE_DOUBLE"] = 1; + values[valuesById[2] = "TYPE_FLOAT"] = 2; + values[valuesById[3] = "TYPE_INT64"] = 3; + values[valuesById[4] = "TYPE_UINT64"] = 4; + values[valuesById[5] = "TYPE_INT32"] = 5; + values[valuesById[6] = "TYPE_FIXED64"] = 6; + values[valuesById[7] = "TYPE_FIXED32"] = 7; + values[valuesById[8] = "TYPE_BOOL"] = 8; + values[valuesById[9] = "TYPE_STRING"] = 9; + values[valuesById[10] = "TYPE_GROUP"] = 10; + values[valuesById[11] = "TYPE_MESSAGE"] = 11; + values[valuesById[12] = "TYPE_BYTES"] = 12; + values[valuesById[13] = "TYPE_UINT32"] = 13; + values[valuesById[14] = "TYPE_ENUM"] = 14; + values[valuesById[15] = "TYPE_SFIXED32"] = 15; + values[valuesById[16] = "TYPE_SFIXED64"] = 16; + values[valuesById[17] = "TYPE_SINT32"] = 17; + values[valuesById[18] = "TYPE_SINT64"] = 18; + return values; + })(); + + /** + * Label enum. + * @name google.protobuf.FieldDescriptorProto.Label + * @enum {number} + * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value + * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value + * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value + */ + FieldDescriptorProto.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "LABEL_OPTIONAL"] = 1; + values[valuesById[3] = "LABEL_REPEATED"] = 3; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; + return values; + })(); + + return FieldDescriptorProto; + })(); + + protobuf.OneofDescriptorProto = (function() { + + /** + * Properties of an OneofDescriptorProto. + * @memberof google.protobuf + * @interface IOneofDescriptorProto + * @property {string|null} [name] OneofDescriptorProto name + * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options + */ + + /** + * Constructs a new OneofDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an OneofDescriptorProto. + * @implements IOneofDescriptorProto + * @constructor + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + */ + function OneofDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.name = ""; + + /** + * OneofDescriptorProto options. + * @member {google.protobuf.IOneofOptions|null|undefined} options + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.options = null; + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance + */ + OneofDescriptorProto.create = function create(properties) { + return new OneofDescriptorProto(properties); + }; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofDescriptorProto message. + * @function verify + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.OneofOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + */ + OneofDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofDescriptorProto) + return object; + var message = new $root.google.protobuf.OneofDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.OneofOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.OneofDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + OneofDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OneofDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofDescriptorProto"; + }; + + return OneofDescriptorProto; + })(); + + protobuf.EnumDescriptorProto = (function() { + + /** + * Properties of an EnumDescriptorProto. + * @memberof google.protobuf + * @interface IEnumDescriptorProto + * @property {string|null} [name] EnumDescriptorProto name + * @property {Array.|null} [value] EnumDescriptorProto value + * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options + * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange + * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName + */ + + /** + * Constructs a new EnumDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumDescriptorProto. + * @implements IEnumDescriptorProto + * @constructor + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + */ + function EnumDescriptorProto(properties) { + this.value = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.name = ""; + + /** + * EnumDescriptorProto value. + * @member {Array.} value + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.value = $util.emptyArray; + + /** + * EnumDescriptorProto options. + * @member {google.protobuf.IEnumOptions|null|undefined} options + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.options = null; + + /** + * EnumDescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * EnumDescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance + */ + EnumDescriptorProto.create = function create(properties) { + return new EnumDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.value != null && message.value.length) + for (var i = 0; i < message.value.length; ++i) + $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.value && message.value.length)) + message.value = []; + message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); + break; + } + case 4: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.value != null && message.hasOwnProperty("value")) { + if (!Array.isArray(message.value)) + return "value: array expected"; + for (var i = 0; i < message.value.length; ++i) { + var error = $root.google.protobuf.EnumValueDescriptorProto.verify(message.value[i]); + if (error) + return "value." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + */ + EnumDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.value) { + if (!Array.isArray(object.value)) + throw TypeError(".google.protobuf.EnumDescriptorProto.value: array expected"); + message.value = []; + for (var i = 0; i < object.value.length; ++i) { + if (typeof object.value[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.value: object expected"); + message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.value = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.value && message.value.length) { + object.value = []; + for (var j = 0; j < message.value.length; ++j) + object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options); + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto"; + }; + + EnumDescriptorProto.EnumReservedRange = (function() { + + /** + * Properties of an EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @interface IEnumReservedRange + * @property {number|null} [start] EnumReservedRange start + * @property {number|null} [end] EnumReservedRange end + */ + + /** + * Constructs a new EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @classdesc Represents an EnumReservedRange. + * @implements IEnumReservedRange + * @constructor + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + */ + function EnumReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumReservedRange start. + * @member {number} start + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.start = 0; + + /** + * EnumReservedRange end. + * @member {number} end + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.end = 0; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance + */ + EnumReservedRange.create = function create(properties) { + return new EnumReservedRange(properties); + }; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumReservedRange message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + */ + EnumReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto.EnumReservedRange) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.EnumReservedRange} message EnumReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this EnumReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + * @returns {Object.} JSON object + */ + EnumReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumReservedRange + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto.EnumReservedRange"; + }; + + return EnumReservedRange; + })(); + + return EnumDescriptorProto; + })(); + + protobuf.EnumValueDescriptorProto = (function() { + + /** + * Properties of an EnumValueDescriptorProto. + * @memberof google.protobuf + * @interface IEnumValueDescriptorProto + * @property {string|null} [name] EnumValueDescriptorProto name + * @property {number|null} [number] EnumValueDescriptorProto number + * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options + */ + + /** + * Constructs a new EnumValueDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumValueDescriptorProto. + * @implements IEnumValueDescriptorProto + * @constructor + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + */ + function EnumValueDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.name = ""; + + /** + * EnumValueDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.number = 0; + + /** + * EnumValueDescriptorProto options. + * @member {google.protobuf.IEnumValueOptions|null|undefined} options + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.options = null; + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance + */ + EnumValueDescriptorProto.create = function create(properties) { + return new EnumValueDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.number = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumValueOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + */ + EnumValueDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumValueDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.number = 0; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumValueDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueDescriptorProto"; + }; + + return EnumValueDescriptorProto; + })(); + + protobuf.ServiceDescriptorProto = (function() { + + /** + * Properties of a ServiceDescriptorProto. + * @memberof google.protobuf + * @interface IServiceDescriptorProto + * @property {string|null} [name] ServiceDescriptorProto name + * @property {Array.|null} [method] ServiceDescriptorProto method + * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options + */ + + /** + * Constructs a new ServiceDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a ServiceDescriptorProto. + * @implements IServiceDescriptorProto + * @constructor + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + */ + function ServiceDescriptorProto(properties) { + this.method = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.name = ""; + + /** + * ServiceDescriptorProto method. + * @member {Array.} method + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.method = $util.emptyArray; + + /** + * ServiceDescriptorProto options. + * @member {google.protobuf.IServiceOptions|null|undefined} options + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.options = null; + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance + */ + ServiceDescriptorProto.create = function create(properties) { + return new ServiceDescriptorProto(properties); + }; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.method != null && message.method.length) + for (var i = 0; i < message.method.length; ++i) + $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.method && message.method.length)) + message.method = []; + message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceDescriptorProto message. + * @function verify + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.method != null && message.hasOwnProperty("method")) { + if (!Array.isArray(message.method)) + return "method: array expected"; + for (var i = 0; i < message.method.length; ++i) { + var error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i]); + if (error) + return "method." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ServiceOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + */ + ServiceDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceDescriptorProto) + return object; + var message = new $root.google.protobuf.ServiceDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.method) { + if (!Array.isArray(object.method)) + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: array expected"); + message.method = []; + for (var i = 0; i < object.method.length; ++i) { + if (typeof object.method[i] !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: object expected"); + message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.method = []; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.method && message.method.length) { + object.method = []; + for (var j = 0; j < message.method.length; ++j) + object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + ServiceDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceDescriptorProto"; + }; + + return ServiceDescriptorProto; + })(); + + protobuf.MethodDescriptorProto = (function() { + + /** + * Properties of a MethodDescriptorProto. + * @memberof google.protobuf + * @interface IMethodDescriptorProto + * @property {string|null} [name] MethodDescriptorProto name + * @property {string|null} [inputType] MethodDescriptorProto inputType + * @property {string|null} [outputType] MethodDescriptorProto outputType + * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options + * @property {boolean|null} [clientStreaming] MethodDescriptorProto clientStreaming + * @property {boolean|null} [serverStreaming] MethodDescriptorProto serverStreaming + */ + + /** + * Constructs a new MethodDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a MethodDescriptorProto. + * @implements IMethodDescriptorProto + * @constructor + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + */ + function MethodDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.name = ""; + + /** + * MethodDescriptorProto inputType. + * @member {string} inputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.inputType = ""; + + /** + * MethodDescriptorProto outputType. + * @member {string} outputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.outputType = ""; + + /** + * MethodDescriptorProto options. + * @member {google.protobuf.IMethodOptions|null|undefined} options + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.options = null; + + /** + * MethodDescriptorProto clientStreaming. + * @member {boolean} clientStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.clientStreaming = false; + + /** + * MethodDescriptorProto serverStreaming. + * @member {boolean} serverStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.serverStreaming = false; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance + */ + MethodDescriptorProto.create = function create(properties) { + return new MethodDescriptorProto(properties); + }; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); + if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); + if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); + return writer; + }; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.inputType = reader.string(); + break; + } + case 3: { + message.outputType = reader.string(); + break; + } + case 4: { + message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); + break; + } + case 5: { + message.clientStreaming = reader.bool(); + break; + } + case 6: { + message.serverStreaming = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodDescriptorProto message. + * @function verify + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.inputType != null && message.hasOwnProperty("inputType")) + if (!$util.isString(message.inputType)) + return "inputType: string expected"; + if (message.outputType != null && message.hasOwnProperty("outputType")) + if (!$util.isString(message.outputType)) + return "outputType: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MethodOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + if (typeof message.clientStreaming !== "boolean") + return "clientStreaming: boolean expected"; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + if (typeof message.serverStreaming !== "boolean") + return "serverStreaming: boolean expected"; + return null; + }; + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + */ + MethodDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodDescriptorProto) + return object; + var message = new $root.google.protobuf.MethodDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.inputType != null) + message.inputType = String(object.inputType); + if (object.outputType != null) + message.outputType = String(object.outputType); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MethodOptions.fromObject(object.options); + } + if (object.clientStreaming != null) + message.clientStreaming = Boolean(object.clientStreaming); + if (object.serverStreaming != null) + message.serverStreaming = Boolean(object.serverStreaming); + return message; + }; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.inputType = ""; + object.outputType = ""; + object.options = null; + object.clientStreaming = false; + object.serverStreaming = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.inputType != null && message.hasOwnProperty("inputType")) + object.inputType = message.inputType; + if (message.outputType != null && message.hasOwnProperty("outputType")) + object.outputType = message.outputType; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options); + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + object.clientStreaming = message.clientStreaming; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + object.serverStreaming = message.serverStreaming; + return object; + }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.MethodDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + MethodDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodDescriptorProto"; + }; + + return MethodDescriptorProto; + })(); + + protobuf.FileOptions = (function() { + + /** + * Properties of a FileOptions. + * @memberof google.protobuf + * @interface IFileOptions + * @property {string|null} [javaPackage] FileOptions javaPackage + * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname + * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles + * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash + * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8 + * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor + * @property {string|null} [goPackage] FileOptions goPackage + * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices + * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices + * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices + * @property {boolean|null} [deprecated] FileOptions deprecated + * @property {boolean|null} [ccEnableArenas] FileOptions ccEnableArenas + * @property {string|null} [objcClassPrefix] FileOptions objcClassPrefix + * @property {string|null} [csharpNamespace] FileOptions csharpNamespace + * @property {string|null} [swiftPrefix] FileOptions swiftPrefix + * @property {string|null} [phpClassPrefix] FileOptions phpClassPrefix + * @property {string|null} [phpNamespace] FileOptions phpNamespace + * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace + * @property {string|null} [rubyPackage] FileOptions rubyPackage + * @property {google.protobuf.IFeatureSet|null} [features] FileOptions features + * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption + * @property {Array.|null} [".google.api.resourceDefinition"] FileOptions .google.api.resourceDefinition + */ + + /** + * Constructs a new FileOptions. + * @memberof google.protobuf + * @classdesc Represents a FileOptions. + * @implements IFileOptions + * @constructor + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + */ + function FileOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.resourceDefinition"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileOptions javaPackage. + * @member {string} javaPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaPackage = ""; + + /** + * FileOptions javaOuterClassname. + * @member {string} javaOuterClassname + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaOuterClassname = ""; + + /** + * FileOptions javaMultipleFiles. + * @member {boolean} javaMultipleFiles + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaMultipleFiles = false; + + /** + * FileOptions javaGenerateEqualsAndHash. + * @member {boolean} javaGenerateEqualsAndHash + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenerateEqualsAndHash = false; + + /** + * FileOptions javaStringCheckUtf8. + * @member {boolean} javaStringCheckUtf8 + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaStringCheckUtf8 = false; + + /** + * FileOptions optimizeFor. + * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.optimizeFor = 1; + + /** + * FileOptions goPackage. + * @member {string} goPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.goPackage = ""; + + /** + * FileOptions ccGenericServices. + * @member {boolean} ccGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccGenericServices = false; + + /** + * FileOptions javaGenericServices. + * @member {boolean} javaGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenericServices = false; + + /** + * FileOptions pyGenericServices. + * @member {boolean} pyGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.pyGenericServices = false; + + /** + * FileOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.deprecated = false; + + /** + * FileOptions ccEnableArenas. + * @member {boolean} ccEnableArenas + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccEnableArenas = true; + + /** + * FileOptions objcClassPrefix. + * @member {string} objcClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.objcClassPrefix = ""; + + /** + * FileOptions csharpNamespace. + * @member {string} csharpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.csharpNamespace = ""; + + /** + * FileOptions swiftPrefix. + * @member {string} swiftPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.swiftPrefix = ""; + + /** + * FileOptions phpClassPrefix. + * @member {string} phpClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpClassPrefix = ""; + + /** + * FileOptions phpNamespace. + * @member {string} phpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpNamespace = ""; + + /** + * FileOptions phpMetadataNamespace. + * @member {string} phpMetadataNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpMetadataNamespace = ""; + + /** + * FileOptions rubyPackage. + * @member {string} rubyPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.rubyPackage = ""; + + /** + * FileOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.features = null; + + /** + * FileOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FileOptions .google.api.resourceDefinition. + * @member {Array.} .google.api.resourceDefinition + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray; + + /** + * Creates a new FileOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + * @returns {google.protobuf.FileOptions} FileOptions instance + */ + FileOptions.create = function create(properties) { + return new FileOptions(properties); + }; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); + if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); + if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); + if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); + if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); + if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); + if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); + if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) + writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); + if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) + writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); + if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) + writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); + if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) + writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); + if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) + writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); + if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) + writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); + if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) + writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); + if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) + writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); + if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) + writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); + if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) + writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); + if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) + writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resourceDefinition"] != null && message[".google.api.resourceDefinition"].length) + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resourceDefinition"][i], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.javaPackage = reader.string(); + break; + } + case 8: { + message.javaOuterClassname = reader.string(); + break; + } + case 10: { + message.javaMultipleFiles = reader.bool(); + break; + } + case 20: { + message.javaGenerateEqualsAndHash = reader.bool(); + break; + } + case 27: { + message.javaStringCheckUtf8 = reader.bool(); + break; + } + case 9: { + message.optimizeFor = reader.int32(); + break; + } + case 11: { + message.goPackage = reader.string(); + break; + } + case 16: { + message.ccGenericServices = reader.bool(); + break; + } + case 17: { + message.javaGenericServices = reader.bool(); + break; + } + case 18: { + message.pyGenericServices = reader.bool(); + break; + } + case 23: { + message.deprecated = reader.bool(); + break; + } + case 31: { + message.ccEnableArenas = reader.bool(); + break; + } + case 36: { + message.objcClassPrefix = reader.string(); + break; + } + case 37: { + message.csharpNamespace = reader.string(); + break; + } + case 39: { + message.swiftPrefix = reader.string(); + break; + } + case 40: { + message.phpClassPrefix = reader.string(); + break; + } + case 41: { + message.phpNamespace = reader.string(); + break; + } + case 44: { + message.phpMetadataNamespace = reader.string(); + break; + } + case 45: { + message.rubyPackage = reader.string(); + break; + } + case 50: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1053: { + if (!(message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length)) + message[".google.api.resourceDefinition"] = []; + message[".google.api.resourceDefinition"].push($root.google.api.ResourceDescriptor.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileOptions message. + * @function verify + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + if (!$util.isString(message.javaPackage)) + return "javaPackage: string expected"; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + if (!$util.isString(message.javaOuterClassname)) + return "javaOuterClassname: string expected"; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + if (typeof message.javaMultipleFiles !== "boolean") + return "javaMultipleFiles: boolean expected"; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + if (typeof message.javaGenerateEqualsAndHash !== "boolean") + return "javaGenerateEqualsAndHash: boolean expected"; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + if (typeof message.javaStringCheckUtf8 !== "boolean") + return "javaStringCheckUtf8: boolean expected"; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + switch (message.optimizeFor) { + default: + return "optimizeFor: enum value expected"; + case 1: + case 2: + case 3: + break; + } + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + if (!$util.isString(message.goPackage)) + return "goPackage: string expected"; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + if (typeof message.ccGenericServices !== "boolean") + return "ccGenericServices: boolean expected"; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + if (typeof message.javaGenericServices !== "boolean") + return "javaGenericServices: boolean expected"; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + if (typeof message.pyGenericServices !== "boolean") + return "pyGenericServices: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + if (typeof message.ccEnableArenas !== "boolean") + return "ccEnableArenas: boolean expected"; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + if (!$util.isString(message.objcClassPrefix)) + return "objcClassPrefix: string expected"; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + if (!$util.isString(message.csharpNamespace)) + return "csharpNamespace: string expected"; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + if (!$util.isString(message.swiftPrefix)) + return "swiftPrefix: string expected"; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + if (!$util.isString(message.phpClassPrefix)) + return "phpClassPrefix: string expected"; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + if (!$util.isString(message.phpNamespace)) + return "phpNamespace: string expected"; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + if (!$util.isString(message.phpMetadataNamespace)) + return "phpMetadataNamespace: string expected"; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + if (!$util.isString(message.rubyPackage)) + return "rubyPackage: string expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resourceDefinition"] != null && message.hasOwnProperty(".google.api.resourceDefinition")) { + if (!Array.isArray(message[".google.api.resourceDefinition"])) + return ".google.api.resourceDefinition: array expected"; + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resourceDefinition"][i]); + if (error) + return ".google.api.resourceDefinition." + error; + } + } + return null; + }; + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileOptions} FileOptions + */ + FileOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileOptions) + return object; + var message = new $root.google.protobuf.FileOptions(); + if (object.javaPackage != null) + message.javaPackage = String(object.javaPackage); + if (object.javaOuterClassname != null) + message.javaOuterClassname = String(object.javaOuterClassname); + if (object.javaMultipleFiles != null) + message.javaMultipleFiles = Boolean(object.javaMultipleFiles); + if (object.javaGenerateEqualsAndHash != null) + message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash); + if (object.javaStringCheckUtf8 != null) + message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); + switch (object.optimizeFor) { + default: + if (typeof object.optimizeFor === "number") { + message.optimizeFor = object.optimizeFor; + break; + } + break; + case "SPEED": + case 1: + message.optimizeFor = 1; + break; + case "CODE_SIZE": + case 2: + message.optimizeFor = 2; + break; + case "LITE_RUNTIME": + case 3: + message.optimizeFor = 3; + break; + } + if (object.goPackage != null) + message.goPackage = String(object.goPackage); + if (object.ccGenericServices != null) + message.ccGenericServices = Boolean(object.ccGenericServices); + if (object.javaGenericServices != null) + message.javaGenericServices = Boolean(object.javaGenericServices); + if (object.pyGenericServices != null) + message.pyGenericServices = Boolean(object.pyGenericServices); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.ccEnableArenas != null) + message.ccEnableArenas = Boolean(object.ccEnableArenas); + if (object.objcClassPrefix != null) + message.objcClassPrefix = String(object.objcClassPrefix); + if (object.csharpNamespace != null) + message.csharpNamespace = String(object.csharpNamespace); + if (object.swiftPrefix != null) + message.swiftPrefix = String(object.swiftPrefix); + if (object.phpClassPrefix != null) + message.phpClassPrefix = String(object.phpClassPrefix); + if (object.phpNamespace != null) + message.phpNamespace = String(object.phpNamespace); + if (object.phpMetadataNamespace != null) + message.phpMetadataNamespace = String(object.phpMetadataNamespace); + if (object.rubyPackage != null) + message.rubyPackage = String(object.rubyPackage); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FileOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resourceDefinition"]) { + if (!Array.isArray(object[".google.api.resourceDefinition"])) + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: array expected"); + message[".google.api.resourceDefinition"] = []; + for (var i = 0; i < object[".google.api.resourceDefinition"].length; ++i) { + if (typeof object[".google.api.resourceDefinition"][i] !== "object") + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: object expected"); + message[".google.api.resourceDefinition"][i] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resourceDefinition"][i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.FileOptions} message FileOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.resourceDefinition"] = []; + } + if (options.defaults) { + object.javaPackage = ""; + object.javaOuterClassname = ""; + object.optimizeFor = options.enums === String ? "SPEED" : 1; + object.javaMultipleFiles = false; + object.goPackage = ""; + object.ccGenericServices = false; + object.javaGenericServices = false; + object.pyGenericServices = false; + object.javaGenerateEqualsAndHash = false; + object.deprecated = false; + object.javaStringCheckUtf8 = false; + object.ccEnableArenas = true; + object.objcClassPrefix = ""; + object.csharpNamespace = ""; + object.swiftPrefix = ""; + object.phpClassPrefix = ""; + object.phpNamespace = ""; + object.phpMetadataNamespace = ""; + object.rubyPackage = ""; + object.features = null; + } + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + object.javaPackage = message.javaPackage; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + object.javaOuterClassname = message.javaOuterClassname; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] === undefined ? message.optimizeFor : $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + object.javaMultipleFiles = message.javaMultipleFiles; + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + object.goPackage = message.goPackage; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + object.ccGenericServices = message.ccGenericServices; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + object.javaGenericServices = message.javaGenericServices; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + object.pyGenericServices = message.pyGenericServices; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + object.javaStringCheckUtf8 = message.javaStringCheckUtf8; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + object.ccEnableArenas = message.ccEnableArenas; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + object.objcClassPrefix = message.objcClassPrefix; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + object.csharpNamespace = message.csharpNamespace; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + object.swiftPrefix = message.swiftPrefix; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + object.phpClassPrefix = message.phpClassPrefix; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + object.phpNamespace = message.phpNamespace; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + object.phpMetadataNamespace = message.phpMetadataNamespace; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + object.rubyPackage = message.rubyPackage; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length) { + object[".google.api.resourceDefinition"] = []; + for (var j = 0; j < message[".google.api.resourceDefinition"].length; ++j) + object[".google.api.resourceDefinition"][j] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resourceDefinition"][j], options); + } + return object; + }; + + /** + * Converts this FileOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FileOptions + * @instance + * @returns {Object.} JSON object + */ + FileOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileOptions + * @function getTypeUrl + * @memberof google.protobuf.FileOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileOptions"; + }; + + /** + * OptimizeMode enum. + * @name google.protobuf.FileOptions.OptimizeMode + * @enum {number} + * @property {number} SPEED=1 SPEED value + * @property {number} CODE_SIZE=2 CODE_SIZE value + * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value + */ + FileOptions.OptimizeMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "SPEED"] = 1; + values[valuesById[2] = "CODE_SIZE"] = 2; + values[valuesById[3] = "LITE_RUNTIME"] = 3; + return values; + })(); + + return FileOptions; + })(); + + protobuf.MessageOptions = (function() { + + /** + * Properties of a MessageOptions. + * @memberof google.protobuf + * @interface IMessageOptions + * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat + * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor + * @property {boolean|null} [deprecated] MessageOptions deprecated + * @property {boolean|null} [mapEntry] MessageOptions mapEntry + * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] MessageOptions deprecatedLegacyJsonFieldConflicts + * @property {google.protobuf.IFeatureSet|null} [features] MessageOptions features + * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption + * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource + */ + + /** + * Constructs a new MessageOptions. + * @memberof google.protobuf + * @classdesc Represents a MessageOptions. + * @implements IMessageOptions + * @constructor + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + */ + function MessageOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MessageOptions messageSetWireFormat. + * @member {boolean} messageSetWireFormat + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.messageSetWireFormat = false; + + /** + * MessageOptions noStandardDescriptorAccessor. + * @member {boolean} noStandardDescriptorAccessor + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.noStandardDescriptorAccessor = false; + + /** + * MessageOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecated = false; + + /** + * MessageOptions mapEntry. + * @member {boolean} mapEntry + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.mapEntry = false; + + /** + * MessageOptions deprecatedLegacyJsonFieldConflicts. + * @member {boolean} deprecatedLegacyJsonFieldConflicts + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; + + /** + * MessageOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.features = null; + + /** + * MessageOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MessageOptions .google.api.resource. + * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype[".google.api.resource"] = null; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + * @returns {google.protobuf.MessageOptions} MessageOptions instance + */ + MessageOptions.create = function create(properties) { + return new MessageOptions(properties); + }; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); + if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); + if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.deprecatedLegacyJsonFieldConflicts); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resource"] != null && Object.hasOwnProperty.call(message, ".google.api.resource")) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.messageSetWireFormat = reader.bool(); + break; + } + case 2: { + message.noStandardDescriptorAccessor = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 7: { + message.mapEntry = reader.bool(); + break; + } + case 11: { + message.deprecatedLegacyJsonFieldConflicts = reader.bool(); + break; + } + case 12: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1053: { + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MessageOptions message. + * @function verify + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MessageOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + if (typeof message.messageSetWireFormat !== "boolean") + return "messageSetWireFormat: boolean expected"; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + if (typeof message.noStandardDescriptorAccessor !== "boolean") + return "noStandardDescriptorAccessor: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + if (typeof message.mapEntry !== "boolean") + return "mapEntry: boolean expected"; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") + return "deprecatedLegacyJsonFieldConflicts: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resource"]); + if (error) + return ".google.api.resource." + error; + } + return null; + }; + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MessageOptions} MessageOptions + */ + MessageOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MessageOptions) + return object; + var message = new $root.google.protobuf.MessageOptions(); + if (object.messageSetWireFormat != null) + message.messageSetWireFormat = Boolean(object.messageSetWireFormat); + if (object.noStandardDescriptorAccessor != null) + message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.mapEntry != null) + message.mapEntry = Boolean(object.mapEntry); + if (object.deprecatedLegacyJsonFieldConflicts != null) + message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.MessageOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resource"] != null) { + if (typeof object[".google.api.resource"] !== "object") + throw TypeError(".google.protobuf.MessageOptions..google.api.resource: object expected"); + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resource"]); + } + return message; + }; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.MessageOptions} message MessageOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MessageOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.messageSetWireFormat = false; + object.noStandardDescriptorAccessor = false; + object.deprecated = false; + object.mapEntry = false; + object.deprecatedLegacyJsonFieldConflicts = false; + object.features = null; + object[".google.api.resource"] = null; + } + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + object.messageSetWireFormat = message.messageSetWireFormat; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + object.mapEntry = message.mapEntry; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) + object[".google.api.resource"] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resource"], options); + return object; + }; + + /** + * Converts this MessageOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MessageOptions + * @instance + * @returns {Object.} JSON object + */ + MessageOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MessageOptions + * @function getTypeUrl + * @memberof google.protobuf.MessageOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MessageOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MessageOptions"; + }; + + return MessageOptions; + })(); + + protobuf.FieldOptions = (function() { + + /** + * Properties of a FieldOptions. + * @memberof google.protobuf + * @interface IFieldOptions + * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype + * @property {boolean|null} [packed] FieldOptions packed + * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype + * @property {boolean|null} [lazy] FieldOptions lazy + * @property {boolean|null} [unverifiedLazy] FieldOptions unverifiedLazy + * @property {boolean|null} [deprecated] FieldOptions deprecated + * @property {boolean|null} [weak] FieldOptions weak + * @property {boolean|null} [debugRedact] FieldOptions debugRedact + * @property {google.protobuf.FieldOptions.OptionRetention|null} [retention] FieldOptions retention + * @property {Array.|null} [targets] FieldOptions targets + * @property {Array.|null} [editionDefaults] FieldOptions editionDefaults + * @property {google.protobuf.IFeatureSet|null} [features] FieldOptions features + * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption + * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior + * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference + */ + + /** + * Constructs a new FieldOptions. + * @memberof google.protobuf + * @classdesc Represents a FieldOptions. + * @implements IFieldOptions + * @constructor + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + */ + function FieldOptions(properties) { + this.targets = []; + this.editionDefaults = []; + this.uninterpretedOption = []; + this[".google.api.fieldBehavior"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldOptions ctype. + * @member {google.protobuf.FieldOptions.CType} ctype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.ctype = 0; + + /** + * FieldOptions packed. + * @member {boolean} packed + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.packed = false; + + /** + * FieldOptions jstype. + * @member {google.protobuf.FieldOptions.JSType} jstype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.jstype = 0; + + /** + * FieldOptions lazy. + * @member {boolean} lazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.lazy = false; + + /** + * FieldOptions unverifiedLazy. + * @member {boolean} unverifiedLazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.unverifiedLazy = false; + + /** + * FieldOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.deprecated = false; + + /** + * FieldOptions weak. + * @member {boolean} weak + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.weak = false; + + /** + * FieldOptions debugRedact. + * @member {boolean} debugRedact + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.debugRedact = false; + + /** + * FieldOptions retention. + * @member {google.protobuf.FieldOptions.OptionRetention} retention + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.retention = 0; + + /** + * FieldOptions targets. + * @member {Array.} targets + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.targets = $util.emptyArray; + + /** + * FieldOptions editionDefaults. + * @member {Array.} editionDefaults + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.editionDefaults = $util.emptyArray; + + /** + * FieldOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.features = null; + + /** + * FieldOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FieldOptions .google.api.fieldBehavior. + * @member {Array.} .google.api.fieldBehavior + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; + + /** + * FieldOptions .google.api.resourceReference. + * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.resourceReference"] = null; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions} FieldOptions instance + */ + FieldOptions.create = function create(properties) { + return new FieldOptions(properties); + }; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); + if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); + if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); + if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); + if (message.unverifiedLazy != null && Object.hasOwnProperty.call(message, "unverifiedLazy")) + writer.uint32(/* id 15, wireType 0 =*/120).bool(message.unverifiedLazy); + if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.debugRedact); + if (message.retention != null && Object.hasOwnProperty.call(message, "retention")) + writer.uint32(/* id 17, wireType 0 =*/136).int32(message.retention); + if (message.targets != null && message.targets.length) + for (var i = 0; i < message.targets.length; ++i) + writer.uint32(/* id 19, wireType 0 =*/152).int32(message.targets[i]); + if (message.editionDefaults != null && message.editionDefaults.length) + for (var i = 0; i < message.editionDefaults.length; ++i) + $root.google.protobuf.FieldOptions.EditionDefault.encode(message.editionDefaults[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + writer.uint32(/* id 1052, wireType 0 =*/8416).int32(message[".google.api.fieldBehavior"][i]); + if (message[".google.api.resourceReference"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceReference")) + $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.ctype = reader.int32(); + break; + } + case 2: { + message.packed = reader.bool(); + break; + } + case 6: { + message.jstype = reader.int32(); + break; + } + case 5: { + message.lazy = reader.bool(); + break; + } + case 15: { + message.unverifiedLazy = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 10: { + message.weak = reader.bool(); + break; + } + case 16: { + message.debugRedact = reader.bool(); + break; + } + case 17: { + message.retention = reader.int32(); + break; + } + case 19: { + if (!(message.targets && message.targets.length)) + message.targets = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.targets.push(reader.int32()); + } else + message.targets.push(reader.int32()); + break; + } + case 20: { + if (!(message.editionDefaults && message.editionDefaults.length)) + message.editionDefaults = []; + message.editionDefaults.push($root.google.protobuf.FieldOptions.EditionDefault.decode(reader, reader.uint32())); + break; + } + case 21: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1052: { + if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) + message[".google.api.fieldBehavior"] = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message[".google.api.fieldBehavior"].push(reader.int32()); + } else + message[".google.api.fieldBehavior"].push(reader.int32()); + break; + } + case 1055: { + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldOptions message. + * @function verify + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ctype != null && message.hasOwnProperty("ctype")) + switch (message.ctype) { + default: + return "ctype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.packed != null && message.hasOwnProperty("packed")) + if (typeof message.packed !== "boolean") + return "packed: boolean expected"; + if (message.jstype != null && message.hasOwnProperty("jstype")) + switch (message.jstype) { + default: + return "jstype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.lazy != null && message.hasOwnProperty("lazy")) + if (typeof message.lazy !== "boolean") + return "lazy: boolean expected"; + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + if (typeof message.unverifiedLazy !== "boolean") + return "unverifiedLazy: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.weak != null && message.hasOwnProperty("weak")) + if (typeof message.weak !== "boolean") + return "weak: boolean expected"; + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + if (typeof message.debugRedact !== "boolean") + return "debugRedact: boolean expected"; + if (message.retention != null && message.hasOwnProperty("retention")) + switch (message.retention) { + default: + return "retention: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.targets != null && message.hasOwnProperty("targets")) { + if (!Array.isArray(message.targets)) + return "targets: array expected"; + for (var i = 0; i < message.targets.length; ++i) + switch (message.targets[i]) { + default: + return "targets: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + break; + } + } + if (message.editionDefaults != null && message.hasOwnProperty("editionDefaults")) { + if (!Array.isArray(message.editionDefaults)) + return "editionDefaults: array expected"; + for (var i = 0; i < message.editionDefaults.length; ++i) { + var error = $root.google.protobuf.FieldOptions.EditionDefault.verify(message.editionDefaults[i]); + if (error) + return "editionDefaults." + error; + } + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) { + if (!Array.isArray(message[".google.api.fieldBehavior"])) + return ".google.api.fieldBehavior: array expected"; + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + switch (message[".google.api.fieldBehavior"][i]) { + default: + return ".google.api.fieldBehavior: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + break; + } + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) { + var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"]); + if (error) + return ".google.api.resourceReference." + error; + } + return null; + }; + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions} FieldOptions + */ + FieldOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions) + return object; + var message = new $root.google.protobuf.FieldOptions(); + switch (object.ctype) { + default: + if (typeof object.ctype === "number") { + message.ctype = object.ctype; + break; + } + break; + case "STRING": + case 0: + message.ctype = 0; + break; + case "CORD": + case 1: + message.ctype = 1; + break; + case "STRING_PIECE": + case 2: + message.ctype = 2; + break; + } + if (object.packed != null) + message.packed = Boolean(object.packed); + switch (object.jstype) { + default: + if (typeof object.jstype === "number") { + message.jstype = object.jstype; + break; + } + break; + case "JS_NORMAL": + case 0: + message.jstype = 0; + break; + case "JS_STRING": + case 1: + message.jstype = 1; + break; + case "JS_NUMBER": + case 2: + message.jstype = 2; + break; + } + if (object.lazy != null) + message.lazy = Boolean(object.lazy); + if (object.unverifiedLazy != null) + message.unverifiedLazy = Boolean(object.unverifiedLazy); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.weak != null) + message.weak = Boolean(object.weak); + if (object.debugRedact != null) + message.debugRedact = Boolean(object.debugRedact); + switch (object.retention) { + default: + if (typeof object.retention === "number") { + message.retention = object.retention; + break; + } + break; + case "RETENTION_UNKNOWN": + case 0: + message.retention = 0; + break; + case "RETENTION_RUNTIME": + case 1: + message.retention = 1; + break; + case "RETENTION_SOURCE": + case 2: + message.retention = 2; + break; + } + if (object.targets) { + if (!Array.isArray(object.targets)) + throw TypeError(".google.protobuf.FieldOptions.targets: array expected"); + message.targets = []; + for (var i = 0; i < object.targets.length; ++i) + switch (object.targets[i]) { + default: + if (typeof object.targets[i] === "number") { + message.targets[i] = object.targets[i]; + break; + } + case "TARGET_TYPE_UNKNOWN": + case 0: + message.targets[i] = 0; + break; + case "TARGET_TYPE_FILE": + case 1: + message.targets[i] = 1; + break; + case "TARGET_TYPE_EXTENSION_RANGE": + case 2: + message.targets[i] = 2; + break; + case "TARGET_TYPE_MESSAGE": + case 3: + message.targets[i] = 3; + break; + case "TARGET_TYPE_FIELD": + case 4: + message.targets[i] = 4; + break; + case "TARGET_TYPE_ONEOF": + case 5: + message.targets[i] = 5; + break; + case "TARGET_TYPE_ENUM": + case 6: + message.targets[i] = 6; + break; + case "TARGET_TYPE_ENUM_ENTRY": + case 7: + message.targets[i] = 7; + break; + case "TARGET_TYPE_SERVICE": + case 8: + message.targets[i] = 8; + break; + case "TARGET_TYPE_METHOD": + case 9: + message.targets[i] = 9; + break; + } + } + if (object.editionDefaults) { + if (!Array.isArray(object.editionDefaults)) + throw TypeError(".google.protobuf.FieldOptions.editionDefaults: array expected"); + message.editionDefaults = []; + for (var i = 0; i < object.editionDefaults.length; ++i) { + if (typeof object.editionDefaults[i] !== "object") + throw TypeError(".google.protobuf.FieldOptions.editionDefaults: object expected"); + message.editionDefaults[i] = $root.google.protobuf.FieldOptions.EditionDefault.fromObject(object.editionDefaults[i]); + } + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FieldOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.fieldBehavior"]) { + if (!Array.isArray(object[".google.api.fieldBehavior"])) + throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected"); + message[".google.api.fieldBehavior"] = []; + for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i) + switch (object[".google.api.fieldBehavior"][i]) { + default: + if (typeof object[".google.api.fieldBehavior"][i] === "number") { + message[".google.api.fieldBehavior"][i] = object[".google.api.fieldBehavior"][i]; + break; + } + case "FIELD_BEHAVIOR_UNSPECIFIED": + case 0: + message[".google.api.fieldBehavior"][i] = 0; + break; + case "OPTIONAL": + case 1: + message[".google.api.fieldBehavior"][i] = 1; + break; + case "REQUIRED": + case 2: + message[".google.api.fieldBehavior"][i] = 2; + break; + case "OUTPUT_ONLY": + case 3: + message[".google.api.fieldBehavior"][i] = 3; + break; + case "INPUT_ONLY": + case 4: + message[".google.api.fieldBehavior"][i] = 4; + break; + case "IMMUTABLE": + case 5: + message[".google.api.fieldBehavior"][i] = 5; + break; + case "UNORDERED_LIST": + case 6: + message[".google.api.fieldBehavior"][i] = 6; + break; + case "NON_EMPTY_DEFAULT": + case 7: + message[".google.api.fieldBehavior"][i] = 7; + break; + case "IDENTIFIER": + case 8: + message[".google.api.fieldBehavior"][i] = 8; + break; + } + } + if (object[".google.api.resourceReference"] != null) { + if (typeof object[".google.api.resourceReference"] !== "object") + throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected"); + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"]); + } + return message; + }; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.FieldOptions} message FieldOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.targets = []; + object.editionDefaults = []; + object.uninterpretedOption = []; + object[".google.api.fieldBehavior"] = []; + } + if (options.defaults) { + object.ctype = options.enums === String ? "STRING" : 0; + object.packed = false; + object.deprecated = false; + object.lazy = false; + object.jstype = options.enums === String ? "JS_NORMAL" : 0; + object.weak = false; + object.unverifiedLazy = false; + object.debugRedact = false; + object.retention = options.enums === String ? "RETENTION_UNKNOWN" : 0; + object.features = null; + object[".google.api.resourceReference"] = null; + } + if (message.ctype != null && message.hasOwnProperty("ctype")) + object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] === undefined ? message.ctype : $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; + if (message.packed != null && message.hasOwnProperty("packed")) + object.packed = message.packed; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.lazy != null && message.hasOwnProperty("lazy")) + object.lazy = message.lazy; + if (message.jstype != null && message.hasOwnProperty("jstype")) + object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] === undefined ? message.jstype : $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; + if (message.weak != null && message.hasOwnProperty("weak")) + object.weak = message.weak; + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + object.unverifiedLazy = message.unverifiedLazy; + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + object.debugRedact = message.debugRedact; + if (message.retention != null && message.hasOwnProperty("retention")) + object.retention = options.enums === String ? $root.google.protobuf.FieldOptions.OptionRetention[message.retention] === undefined ? message.retention : $root.google.protobuf.FieldOptions.OptionRetention[message.retention] : message.retention; + if (message.targets && message.targets.length) { + object.targets = []; + for (var j = 0; j < message.targets.length; ++j) + object.targets[j] = options.enums === String ? $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] === undefined ? message.targets[j] : $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] : message.targets[j]; + } + if (message.editionDefaults && message.editionDefaults.length) { + object.editionDefaults = []; + for (var j = 0; j < message.editionDefaults.length; ++j) + object.editionDefaults[j] = $root.google.protobuf.FieldOptions.EditionDefault.toObject(message.editionDefaults[j], options); + } + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length) { + object[".google.api.fieldBehavior"] = []; + for (var j = 0; j < message[".google.api.fieldBehavior"].length; ++j) + object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] === undefined ? message[".google.api.fieldBehavior"][j] : $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) + object[".google.api.resourceReference"] = $root.google.api.ResourceReference.toObject(message[".google.api.resourceReference"], options); + return object; + }; + + /** + * Converts this FieldOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions + * @instance + * @returns {Object.} JSON object + */ + FieldOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldOptions + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions"; + }; + + /** + * CType enum. + * @name google.protobuf.FieldOptions.CType + * @enum {number} + * @property {number} STRING=0 STRING value + * @property {number} CORD=1 CORD value + * @property {number} STRING_PIECE=2 STRING_PIECE value + */ + FieldOptions.CType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STRING"] = 0; + values[valuesById[1] = "CORD"] = 1; + values[valuesById[2] = "STRING_PIECE"] = 2; + return values; + })(); + + /** + * JSType enum. + * @name google.protobuf.FieldOptions.JSType + * @enum {number} + * @property {number} JS_NORMAL=0 JS_NORMAL value + * @property {number} JS_STRING=1 JS_STRING value + * @property {number} JS_NUMBER=2 JS_NUMBER value + */ + FieldOptions.JSType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JS_NORMAL"] = 0; + values[valuesById[1] = "JS_STRING"] = 1; + values[valuesById[2] = "JS_NUMBER"] = 2; + return values; + })(); + + /** + * OptionRetention enum. + * @name google.protobuf.FieldOptions.OptionRetention + * @enum {number} + * @property {number} RETENTION_UNKNOWN=0 RETENTION_UNKNOWN value + * @property {number} RETENTION_RUNTIME=1 RETENTION_RUNTIME value + * @property {number} RETENTION_SOURCE=2 RETENTION_SOURCE value + */ + FieldOptions.OptionRetention = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RETENTION_UNKNOWN"] = 0; + values[valuesById[1] = "RETENTION_RUNTIME"] = 1; + values[valuesById[2] = "RETENTION_SOURCE"] = 2; + return values; + })(); + + /** + * OptionTargetType enum. + * @name google.protobuf.FieldOptions.OptionTargetType + * @enum {number} + * @property {number} TARGET_TYPE_UNKNOWN=0 TARGET_TYPE_UNKNOWN value + * @property {number} TARGET_TYPE_FILE=1 TARGET_TYPE_FILE value + * @property {number} TARGET_TYPE_EXTENSION_RANGE=2 TARGET_TYPE_EXTENSION_RANGE value + * @property {number} TARGET_TYPE_MESSAGE=3 TARGET_TYPE_MESSAGE value + * @property {number} TARGET_TYPE_FIELD=4 TARGET_TYPE_FIELD value + * @property {number} TARGET_TYPE_ONEOF=5 TARGET_TYPE_ONEOF value + * @property {number} TARGET_TYPE_ENUM=6 TARGET_TYPE_ENUM value + * @property {number} TARGET_TYPE_ENUM_ENTRY=7 TARGET_TYPE_ENUM_ENTRY value + * @property {number} TARGET_TYPE_SERVICE=8 TARGET_TYPE_SERVICE value + * @property {number} TARGET_TYPE_METHOD=9 TARGET_TYPE_METHOD value + */ + FieldOptions.OptionTargetType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TARGET_TYPE_UNKNOWN"] = 0; + values[valuesById[1] = "TARGET_TYPE_FILE"] = 1; + values[valuesById[2] = "TARGET_TYPE_EXTENSION_RANGE"] = 2; + values[valuesById[3] = "TARGET_TYPE_MESSAGE"] = 3; + values[valuesById[4] = "TARGET_TYPE_FIELD"] = 4; + values[valuesById[5] = "TARGET_TYPE_ONEOF"] = 5; + values[valuesById[6] = "TARGET_TYPE_ENUM"] = 6; + values[valuesById[7] = "TARGET_TYPE_ENUM_ENTRY"] = 7; + values[valuesById[8] = "TARGET_TYPE_SERVICE"] = 8; + values[valuesById[9] = "TARGET_TYPE_METHOD"] = 9; + return values; + })(); + + FieldOptions.EditionDefault = (function() { + + /** + * Properties of an EditionDefault. + * @memberof google.protobuf.FieldOptions + * @interface IEditionDefault + * @property {google.protobuf.Edition|null} [edition] EditionDefault edition + * @property {string|null} [value] EditionDefault value + */ + + /** + * Constructs a new EditionDefault. + * @memberof google.protobuf.FieldOptions + * @classdesc Represents an EditionDefault. + * @implements IEditionDefault + * @constructor + * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set + */ + function EditionDefault(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EditionDefault edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + */ + EditionDefault.prototype.edition = 0; + + /** + * EditionDefault value. + * @member {string} value + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + */ + EditionDefault.prototype.value = ""; + + /** + * Creates a new EditionDefault instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault instance + */ + EditionDefault.create = function create(properties) { + return new EditionDefault(properties); + }; + + /** + * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EditionDefault.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EditionDefault.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EditionDefault message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EditionDefault.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions.EditionDefault(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.edition = reader.int32(); + break; + } + case 2: { + message.value = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EditionDefault message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EditionDefault.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EditionDefault message. + * @function verify + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EditionDefault.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + */ + EditionDefault.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions.EditionDefault) + return object; + var message = new $root.google.protobuf.FieldOptions.EditionDefault(); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.EditionDefault} message EditionDefault + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EditionDefault.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.value = ""; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this EditionDefault to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + * @returns {Object.} JSON object + */ + EditionDefault.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EditionDefault + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions.EditionDefault"; + }; + + return EditionDefault; + })(); + + return FieldOptions; + })(); + + protobuf.OneofOptions = (function() { + + /** + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @property {google.protobuf.IFeatureSet|null} [features] OneofOptions features + * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption + */ + + /** + * Constructs a new OneofOptions. + * @memberof google.protobuf + * @classdesc Represents an OneofOptions. + * @implements IOneofOptions + * @constructor + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + */ + function OneofOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.features = null; + + /** + * OneofOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + * @returns {google.protobuf.OneofOptions} OneofOptions instance + */ + OneofOptions.create = function create(properties) { + return new OneofOptions(properties); + }; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofOptions message. + * @function verify + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofOptions} OneofOptions + */ + OneofOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofOptions) + return object; + var message = new $root.google.protobuf.OneofOptions(); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.OneofOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.OneofOptions} message OneofOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) + object.features = null; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this OneofOptions to JSON. + * @function toJSON + * @memberof google.protobuf.OneofOptions + * @instance + * @returns {Object.} JSON object + */ + OneofOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OneofOptions + * @function getTypeUrl + * @memberof google.protobuf.OneofOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofOptions"; + }; + + return OneofOptions; + })(); + + protobuf.EnumOptions = (function() { + + /** + * Properties of an EnumOptions. + * @memberof google.protobuf + * @interface IEnumOptions + * @property {boolean|null} [allowAlias] EnumOptions allowAlias + * @property {boolean|null} [deprecated] EnumOptions deprecated + * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] EnumOptions deprecatedLegacyJsonFieldConflicts + * @property {google.protobuf.IFeatureSet|null} [features] EnumOptions features + * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption + */ + + /** + * Constructs a new EnumOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumOptions. + * @implements IEnumOptions + * @constructor + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + */ + function EnumOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumOptions allowAlias. + * @member {boolean} allowAlias + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.allowAlias = false; + + /** + * EnumOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecated = false; + + /** + * EnumOptions deprecatedLegacyJsonFieldConflicts. + * @member {boolean} deprecatedLegacyJsonFieldConflicts + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; + + /** + * EnumOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.features = null; + + /** + * EnumOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumOptions} EnumOptions instance + */ + EnumOptions.create = function create(properties) { + return new EnumOptions(properties); + }; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.deprecatedLegacyJsonFieldConflicts); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.allowAlias = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 6: { + message.deprecatedLegacyJsonFieldConflicts = reader.bool(); + break; + } + case 7: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumOptions message. + * @function verify + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + if (typeof message.allowAlias !== "boolean") + return "allowAlias: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") + return "deprecatedLegacyJsonFieldConflicts: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumOptions} EnumOptions + */ + EnumOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumOptions) + return object; + var message = new $root.google.protobuf.EnumOptions(); + if (object.allowAlias != null) + message.allowAlias = Boolean(object.allowAlias); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.deprecatedLegacyJsonFieldConflicts != null) + message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.EnumOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.EnumOptions} message EnumOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.allowAlias = false; + object.deprecated = false; + object.deprecatedLegacyJsonFieldConflicts = false; + object.features = null; + } + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + object.allowAlias = message.allowAlias; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumOptions + * @instance + * @returns {Object.} JSON object + */ + EnumOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumOptions"; + }; + + return EnumOptions; + })(); + + protobuf.EnumValueOptions = (function() { + + /** + * Properties of an EnumValueOptions. + * @memberof google.protobuf + * @interface IEnumValueOptions + * @property {boolean|null} [deprecated] EnumValueOptions deprecated + * @property {google.protobuf.IFeatureSet|null} [features] EnumValueOptions features + * @property {boolean|null} [debugRedact] EnumValueOptions debugRedact + * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption + */ + + /** + * Constructs a new EnumValueOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumValueOptions. + * @implements IEnumValueOptions + * @constructor + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + */ + function EnumValueOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.deprecated = false; + + /** + * EnumValueOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.features = null; + + /** + * EnumValueOptions debugRedact. + * @member {boolean} debugRedact + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.debugRedact = false; + + /** + * EnumValueOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance + */ + EnumValueOptions.create = function create(properties) { + return new EnumValueOptions(properties); + }; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.debugRedact); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.deprecated = reader.bool(); + break; + } + case 2: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 3: { + message.debugRedact = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueOptions message. + * @function verify + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + if (typeof message.debugRedact !== "boolean") + return "debugRedact: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + */ + EnumValueOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueOptions) + return object; + var message = new $root.google.protobuf.EnumValueOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.debugRedact != null) + message.debugRedact = Boolean(object.debugRedact); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.EnumValueOptions} message EnumValueOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object.features = null; + object.debugRedact = false; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + object.debugRedact = message.debugRedact; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumValueOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueOptions + * @instance + * @returns {Object.} JSON object + */ + EnumValueOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValueOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueOptions"; + }; + + return EnumValueOptions; + })(); + + protobuf.ServiceOptions = (function() { + + /** + * Properties of a ServiceOptions. + * @memberof google.protobuf + * @interface IServiceOptions + * @property {google.protobuf.IFeatureSet|null} [features] ServiceOptions features + * @property {boolean|null} [deprecated] ServiceOptions deprecated + * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption + * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost + * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes + * @property {string|null} [".google.api.apiVersion"] ServiceOptions .google.api.apiVersion + */ + + /** + * Constructs a new ServiceOptions. + * @memberof google.protobuf + * @classdesc Represents a ServiceOptions. + * @implements IServiceOptions + * @constructor + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + */ + function ServiceOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.features = null; + + /** + * ServiceOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.deprecated = false; + + /** + * ServiceOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * ServiceOptions .google.api.defaultHost. + * @member {string} .google.api.defaultHost + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.defaultHost"] = ""; + + /** + * ServiceOptions .google.api.oauthScopes. + * @member {string} .google.api.oauthScopes + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.oauthScopes"] = ""; + + /** + * ServiceOptions .google.api.apiVersion. + * @member {string} .google.api.apiVersion + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.apiVersion"] = ""; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + * @returns {google.protobuf.ServiceOptions} ServiceOptions instance + */ + ServiceOptions.create = function create(properties) { + return new ServiceOptions(properties); + }; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 34, wireType 2 =*/274).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) + writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); + if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) + writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); + if (message[".google.api.apiVersion"] != null && Object.hasOwnProperty.call(message, ".google.api.apiVersion")) + writer.uint32(/* id 525000001, wireType 2 =*/4200000010).string(message[".google.api.apiVersion"]); + return writer; + }; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 34: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 33: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1049: { + message[".google.api.defaultHost"] = reader.string(); + break; + } + case 1050: { + message[".google.api.oauthScopes"] = reader.string(); + break; + } + case 525000001: { + message[".google.api.apiVersion"] = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceOptions message. + * @function verify + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + if (!$util.isString(message[".google.api.defaultHost"])) + return ".google.api.defaultHost: string expected"; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + if (!$util.isString(message[".google.api.oauthScopes"])) + return ".google.api.oauthScopes: string expected"; + if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) + if (!$util.isString(message[".google.api.apiVersion"])) + return ".google.api.apiVersion: string expected"; + return null; + }; + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceOptions} ServiceOptions + */ + ServiceOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceOptions) + return object; + var message = new $root.google.protobuf.ServiceOptions(); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.ServiceOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.defaultHost"] != null) + message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); + if (object[".google.api.oauthScopes"] != null) + message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); + if (object[".google.api.apiVersion"] != null) + message[".google.api.apiVersion"] = String(object[".google.api.apiVersion"]); + return message; + }; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.ServiceOptions} message ServiceOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object.features = null; + object[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + object[".google.api.apiVersion"] = ""; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; + if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) + object[".google.api.apiVersion"] = message[".google.api.apiVersion"]; + return object; + }; + + /** + * Converts this ServiceOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceOptions + * @instance + * @returns {Object.} JSON object + */ + ServiceOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceOptions + * @function getTypeUrl + * @memberof google.protobuf.ServiceOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceOptions"; + }; + + return ServiceOptions; + })(); + + protobuf.MethodOptions = (function() { + + /** + * Properties of a MethodOptions. + * @memberof google.protobuf + * @interface IMethodOptions + * @property {boolean|null} [deprecated] MethodOptions deprecated + * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel + * @property {google.protobuf.IFeatureSet|null} [features] MethodOptions features + * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption + * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http + * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature + * @property {google.longrunning.IOperationInfo|null} [".google.longrunning.operationInfo"] MethodOptions .google.longrunning.operationInfo + */ + + /** + * Constructs a new MethodOptions. + * @memberof google.protobuf + * @classdesc Represents a MethodOptions. + * @implements IMethodOptions + * @constructor + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + */ + function MethodOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.methodSignature"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.deprecated = false; + + /** + * MethodOptions idempotencyLevel. + * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.idempotencyLevel = 0; + + /** + * MethodOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.features = null; + + /** + * MethodOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MethodOptions .google.api.http. + * @member {google.api.IHttpRule|null|undefined} .google.api.http + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.http"] = null; + + /** + * MethodOptions .google.api.methodSignature. + * @member {Array.} .google.api.methodSignature + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; + + /** + * MethodOptions .google.longrunning.operationInfo. + * @member {google.longrunning.IOperationInfo|null|undefined} .google.longrunning.operationInfo + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.longrunning.operationInfo"] = null; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + * @returns {google.protobuf.MethodOptions} MethodOptions instance + */ + MethodOptions.create = function create(properties) { + return new MethodOptions(properties); + }; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel")) + writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 35, wireType 2 =*/282).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.longrunning.operationInfo"] != null && Object.hasOwnProperty.call(message, ".google.longrunning.operationInfo")) + $root.google.longrunning.OperationInfo.encode(message[".google.longrunning.operationInfo"], writer.uint32(/* id 1049, wireType 2 =*/8394).fork()).ldelim(); + if (message[".google.api.methodSignature"] != null && message[".google.api.methodSignature"].length) + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + writer.uint32(/* id 1051, wireType 2 =*/8410).string(message[".google.api.methodSignature"][i]); + if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http")) + $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 33: { + message.deprecated = reader.bool(); + break; + } + case 34: { + message.idempotencyLevel = reader.int32(); + break; + } + case 35: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 72295728: { + message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); + break; + } + case 1051: { + if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) + message[".google.api.methodSignature"] = []; + message[".google.api.methodSignature"].push(reader.string()); + break; + } + case 1049: { + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodOptions message. + * @function verify + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + switch (message.idempotencyLevel) { + default: + return "idempotencyLevel: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) { + var error = $root.google.api.HttpRule.verify(message[".google.api.http"]); + if (error) + return ".google.api.http." + error; + } + if (message[".google.api.methodSignature"] != null && message.hasOwnProperty(".google.api.methodSignature")) { + if (!Array.isArray(message[".google.api.methodSignature"])) + return ".google.api.methodSignature: array expected"; + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + if (!$util.isString(message[".google.api.methodSignature"][i])) + return ".google.api.methodSignature: string[] expected"; + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) { + var error = $root.google.longrunning.OperationInfo.verify(message[".google.longrunning.operationInfo"]); + if (error) + return ".google.longrunning.operationInfo." + error; + } + return null; + }; + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodOptions} MethodOptions + */ + MethodOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodOptions) + return object; + var message = new $root.google.protobuf.MethodOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + switch (object.idempotencyLevel) { + default: + if (typeof object.idempotencyLevel === "number") { + message.idempotencyLevel = object.idempotencyLevel; + break; + } + break; + case "IDEMPOTENCY_UNKNOWN": + case 0: + message.idempotencyLevel = 0; + break; + case "NO_SIDE_EFFECTS": + case 1: + message.idempotencyLevel = 1; + break; + case "IDEMPOTENT": + case 2: + message.idempotencyLevel = 2; + break; + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.MethodOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.http"] != null) { + if (typeof object[".google.api.http"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected"); + message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"]); + } + if (object[".google.api.methodSignature"]) { + if (!Array.isArray(object[".google.api.methodSignature"])) + throw TypeError(".google.protobuf.MethodOptions..google.api.methodSignature: array expected"); + message[".google.api.methodSignature"] = []; + for (var i = 0; i < object[".google.api.methodSignature"].length; ++i) + message[".google.api.methodSignature"][i] = String(object[".google.api.methodSignature"][i]); + } + if (object[".google.longrunning.operationInfo"] != null) { + if (typeof object[".google.longrunning.operationInfo"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.longrunning.operationInfo: object expected"); + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.fromObject(object[".google.longrunning.operationInfo"]); + } + return message; + }; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.MethodOptions} message MethodOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.methodSignature"] = []; + } + if (options.defaults) { + object.deprecated = false; + object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0; + object.features = null; + object[".google.longrunning.operationInfo"] = null; + object[".google.api.http"] = null; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] === undefined ? message.idempotencyLevel : $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) + object[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.toObject(message[".google.longrunning.operationInfo"], options); + if (message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length) { + object[".google.api.methodSignature"] = []; + for (var j = 0; j < message[".google.api.methodSignature"].length; ++j) + object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j]; + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) + object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); + return object; + }; + + /** + * Converts this MethodOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MethodOptions + * @instance + * @returns {Object.} JSON object + */ + MethodOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodOptions + * @function getTypeUrl + * @memberof google.protobuf.MethodOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodOptions"; + }; + + /** + * IdempotencyLevel enum. + * @name google.protobuf.MethodOptions.IdempotencyLevel + * @enum {number} + * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value + * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value + * @property {number} IDEMPOTENT=2 IDEMPOTENT value + */ + MethodOptions.IdempotencyLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0; + values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1; + values[valuesById[2] = "IDEMPOTENT"] = 2; + return values; + })(); + + return MethodOptions; + })(); + + protobuf.UninterpretedOption = (function() { + + /** + * Properties of an UninterpretedOption. + * @memberof google.protobuf + * @interface IUninterpretedOption + * @property {Array.|null} [name] UninterpretedOption name + * @property {string|null} [identifierValue] UninterpretedOption identifierValue + * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue + * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue + * @property {number|null} [doubleValue] UninterpretedOption doubleValue + * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue + * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue + */ + + /** + * Constructs a new UninterpretedOption. + * @memberof google.protobuf + * @classdesc Represents an UninterpretedOption. + * @implements IUninterpretedOption + * @constructor + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + */ + function UninterpretedOption(properties) { + this.name = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UninterpretedOption name. + * @member {Array.} name + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.name = $util.emptyArray; + + /** + * UninterpretedOption identifierValue. + * @member {string} identifierValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.identifierValue = ""; + + /** + * UninterpretedOption positiveIntValue. + * @member {number|Long} positiveIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * UninterpretedOption negativeIntValue. + * @member {number|Long} negativeIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * UninterpretedOption doubleValue. + * @member {number} doubleValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.doubleValue = 0; + + /** + * UninterpretedOption stringValue. + * @member {Uint8Array} stringValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.stringValue = $util.newBuffer([]); + + /** + * UninterpretedOption aggregateValue. + * @member {string} aggregateValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.aggregateValue = ""; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance + */ + UninterpretedOption.create = function create(properties) { + return new UninterpretedOption(properties); + }; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.name.length) + for (var i = 0; i < message.name.length; ++i) + $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); + if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); + if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); + if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) + writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); + if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); + return writer; + }; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + if (!(message.name && message.name.length)) + message.name = []; + message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); + break; + } + case 3: { + message.identifierValue = reader.string(); + break; + } + case 4: { + message.positiveIntValue = reader.uint64(); + break; + } + case 5: { + message.negativeIntValue = reader.int64(); + break; + } + case 6: { + message.doubleValue = reader.double(); + break; + } + case 7: { + message.stringValue = reader.bytes(); + break; + } + case 8: { + message.aggregateValue = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UninterpretedOption message. + * @function verify + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UninterpretedOption.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) { + if (!Array.isArray(message.name)) + return "name: array expected"; + for (var i = 0; i < message.name.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]); + if (error) + return "name." + error; + } + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + if (!$util.isString(message.identifierValue)) + return "identifierValue: string expected"; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high))) + return "positiveIntValue: integer|Long expected"; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high))) + return "negativeIntValue: integer|Long expected"; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + if (typeof message.doubleValue !== "number") + return "doubleValue: number expected"; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue))) + return "stringValue: buffer expected"; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + if (!$util.isString(message.aggregateValue)) + return "aggregateValue: string expected"; + return null; + }; + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + */ + UninterpretedOption.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption) + return object; + var message = new $root.google.protobuf.UninterpretedOption(); + if (object.name) { + if (!Array.isArray(object.name)) + throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); + message.name = []; + for (var i = 0; i < object.name.length; ++i) { + if (typeof object.name[i] !== "object") + throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); + message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); + } + } + if (object.identifierValue != null) + message.identifierValue = String(object.identifierValue); + if (object.positiveIntValue != null) + if ($util.Long) + (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; + else if (typeof object.positiveIntValue === "string") + message.positiveIntValue = parseInt(object.positiveIntValue, 10); + else if (typeof object.positiveIntValue === "number") + message.positiveIntValue = object.positiveIntValue; + else if (typeof object.positiveIntValue === "object") + message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); + if (object.negativeIntValue != null) + if ($util.Long) + (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false; + else if (typeof object.negativeIntValue === "string") + message.negativeIntValue = parseInt(object.negativeIntValue, 10); + else if (typeof object.negativeIntValue === "number") + message.negativeIntValue = object.negativeIntValue; + else if (typeof object.negativeIntValue === "object") + message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); + if (object.doubleValue != null) + message.doubleValue = Number(object.doubleValue); + if (object.stringValue != null) + if (typeof object.stringValue === "string") + $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); + else if (object.stringValue.length >= 0) + message.stringValue = object.stringValue; + if (object.aggregateValue != null) + message.aggregateValue = String(object.aggregateValue); + return message; + }; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.UninterpretedOption} message UninterpretedOption + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UninterpretedOption.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.name = []; + if (options.defaults) { + object.identifierValue = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.positiveIntValue = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.negativeIntValue = options.longs === String ? "0" : 0; + object.doubleValue = 0; + if (options.bytes === String) + object.stringValue = ""; + else { + object.stringValue = []; + if (options.bytes !== Array) + object.stringValue = $util.newBuffer(object.stringValue); + } + object.aggregateValue = ""; + } + if (message.name && message.name.length) { + object.name = []; + for (var j = 0; j < message.name.length; ++j) + object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + object.identifierValue = message.identifierValue; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (typeof message.positiveIntValue === "number") + object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue; + else + object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (typeof message.negativeIntValue === "number") + object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue; + else + object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + object.aggregateValue = message.aggregateValue; + return object; + }; + + /** + * Converts this UninterpretedOption to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption + * @instance + * @returns {Object.} JSON object + */ + UninterpretedOption.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UninterpretedOption + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UninterpretedOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption"; + }; + + UninterpretedOption.NamePart = (function() { + + /** + * Properties of a NamePart. + * @memberof google.protobuf.UninterpretedOption + * @interface INamePart + * @property {string} namePart NamePart namePart + * @property {boolean} isExtension NamePart isExtension + */ + + /** + * Constructs a new NamePart. + * @memberof google.protobuf.UninterpretedOption + * @classdesc Represents a NamePart. + * @implements INamePart + * @constructor + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + */ + function NamePart(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NamePart namePart. + * @member {string} namePart + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.namePart = ""; + + /** + * NamePart isExtension. + * @member {boolean} isExtension + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.isExtension = false; + + /** + * Creates a new NamePart instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance + */ + NamePart.create = function create(properties) { + return new NamePart(properties); + }; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart); + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension); + return writer; + }; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.namePart = reader.string(); + break; + } + case 2: { + message.isExtension = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + if (!message.hasOwnProperty("namePart")) + throw $util.ProtocolError("missing required 'namePart'", { instance: message }); + if (!message.hasOwnProperty("isExtension")) + throw $util.ProtocolError("missing required 'isExtension'", { instance: message }); + return message; + }; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NamePart message. + * @function verify + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NamePart.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (!$util.isString(message.namePart)) + return "namePart: string expected"; + if (typeof message.isExtension !== "boolean") + return "isExtension: boolean expected"; + return null; + }; + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + */ + NamePart.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) + return object; + var message = new $root.google.protobuf.UninterpretedOption.NamePart(); + if (object.namePart != null) + message.namePart = String(object.namePart); + if (object.isExtension != null) + message.isExtension = Boolean(object.isExtension); + return message; + }; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NamePart.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.namePart = ""; + object.isExtension = false; + } + if (message.namePart != null && message.hasOwnProperty("namePart")) + object.namePart = message.namePart; + if (message.isExtension != null && message.hasOwnProperty("isExtension")) + object.isExtension = message.isExtension; + return object; + }; + + /** + * Converts this NamePart to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + * @returns {Object.} JSON object + */ + NamePart.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NamePart + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NamePart.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption.NamePart"; + }; + + return NamePart; + })(); + + return UninterpretedOption; + })(); + + protobuf.FeatureSet = (function() { + + /** + * Properties of a FeatureSet. + * @memberof google.protobuf + * @interface IFeatureSet + * @property {google.protobuf.FeatureSet.FieldPresence|null} [fieldPresence] FeatureSet fieldPresence + * @property {google.protobuf.FeatureSet.EnumType|null} [enumType] FeatureSet enumType + * @property {google.protobuf.FeatureSet.RepeatedFieldEncoding|null} [repeatedFieldEncoding] FeatureSet repeatedFieldEncoding + * @property {google.protobuf.FeatureSet.Utf8Validation|null} [utf8Validation] FeatureSet utf8Validation + * @property {google.protobuf.FeatureSet.MessageEncoding|null} [messageEncoding] FeatureSet messageEncoding + * @property {google.protobuf.FeatureSet.JsonFormat|null} [jsonFormat] FeatureSet jsonFormat + */ + + /** + * Constructs a new FeatureSet. + * @memberof google.protobuf + * @classdesc Represents a FeatureSet. + * @implements IFeatureSet + * @constructor + * @param {google.protobuf.IFeatureSet=} [properties] Properties to set + */ + function FeatureSet(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSet fieldPresence. + * @member {google.protobuf.FeatureSet.FieldPresence} fieldPresence + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.fieldPresence = 0; + + /** + * FeatureSet enumType. + * @member {google.protobuf.FeatureSet.EnumType} enumType + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.enumType = 0; + + /** + * FeatureSet repeatedFieldEncoding. + * @member {google.protobuf.FeatureSet.RepeatedFieldEncoding} repeatedFieldEncoding + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.repeatedFieldEncoding = 0; + + /** + * FeatureSet utf8Validation. + * @member {google.protobuf.FeatureSet.Utf8Validation} utf8Validation + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.utf8Validation = 0; + + /** + * FeatureSet messageEncoding. + * @member {google.protobuf.FeatureSet.MessageEncoding} messageEncoding + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.messageEncoding = 0; + + /** + * FeatureSet jsonFormat. + * @member {google.protobuf.FeatureSet.JsonFormat} jsonFormat + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.jsonFormat = 0; + + /** + * Creates a new FeatureSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet=} [properties] Properties to set + * @returns {google.protobuf.FeatureSet} FeatureSet instance + */ + FeatureSet.create = function create(properties) { + return new FeatureSet(properties); + }; + + /** + * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fieldPresence != null && Object.hasOwnProperty.call(message, "fieldPresence")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.fieldPresence); + if (message.enumType != null && Object.hasOwnProperty.call(message, "enumType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.enumType); + if (message.repeatedFieldEncoding != null && Object.hasOwnProperty.call(message, "repeatedFieldEncoding")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.repeatedFieldEncoding); + if (message.utf8Validation != null && Object.hasOwnProperty.call(message, "utf8Validation")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.utf8Validation); + if (message.messageEncoding != null && Object.hasOwnProperty.call(message, "messageEncoding")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.messageEncoding); + if (message.jsonFormat != null && Object.hasOwnProperty.call(message, "jsonFormat")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jsonFormat); + return writer; + }; + + /** + * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSet} FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSet.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.fieldPresence = reader.int32(); + break; + } + case 2: { + message.enumType = reader.int32(); + break; + } + case 3: { + message.repeatedFieldEncoding = reader.int32(); + break; + } + case 4: { + message.utf8Validation = reader.int32(); + break; + } + case 5: { + message.messageEncoding = reader.int32(); + break; + } + case 6: { + message.jsonFormat = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSet} FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSet message. + * @function verify + * @memberof google.protobuf.FeatureSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) + switch (message.fieldPresence) { + default: + return "fieldPresence: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.enumType != null && message.hasOwnProperty("enumType")) + switch (message.enumType) { + default: + return "enumType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) + switch (message.repeatedFieldEncoding) { + default: + return "repeatedFieldEncoding: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) + switch (message.utf8Validation) { + default: + return "utf8Validation: enum value expected"; + case 0: + case 2: + case 3: + break; + } + if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) + switch (message.messageEncoding) { + default: + return "messageEncoding: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) + switch (message.jsonFormat) { + default: + return "jsonFormat: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSet} FeatureSet + */ + FeatureSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSet) + return object; + var message = new $root.google.protobuf.FeatureSet(); + switch (object.fieldPresence) { + default: + if (typeof object.fieldPresence === "number") { + message.fieldPresence = object.fieldPresence; + break; + } + break; + case "FIELD_PRESENCE_UNKNOWN": + case 0: + message.fieldPresence = 0; + break; + case "EXPLICIT": + case 1: + message.fieldPresence = 1; + break; + case "IMPLICIT": + case 2: + message.fieldPresence = 2; + break; + case "LEGACY_REQUIRED": + case 3: + message.fieldPresence = 3; + break; + } + switch (object.enumType) { + default: + if (typeof object.enumType === "number") { + message.enumType = object.enumType; + break; + } + break; + case "ENUM_TYPE_UNKNOWN": + case 0: + message.enumType = 0; + break; + case "OPEN": + case 1: + message.enumType = 1; + break; + case "CLOSED": + case 2: + message.enumType = 2; + break; + } + switch (object.repeatedFieldEncoding) { + default: + if (typeof object.repeatedFieldEncoding === "number") { + message.repeatedFieldEncoding = object.repeatedFieldEncoding; + break; + } + break; + case "REPEATED_FIELD_ENCODING_UNKNOWN": + case 0: + message.repeatedFieldEncoding = 0; + break; + case "PACKED": + case 1: + message.repeatedFieldEncoding = 1; + break; + case "EXPANDED": + case 2: + message.repeatedFieldEncoding = 2; + break; + } + switch (object.utf8Validation) { + default: + if (typeof object.utf8Validation === "number") { + message.utf8Validation = object.utf8Validation; + break; + } + break; + case "UTF8_VALIDATION_UNKNOWN": + case 0: + message.utf8Validation = 0; + break; + case "VERIFY": + case 2: + message.utf8Validation = 2; + break; + case "NONE": + case 3: + message.utf8Validation = 3; + break; + } + switch (object.messageEncoding) { + default: + if (typeof object.messageEncoding === "number") { + message.messageEncoding = object.messageEncoding; + break; + } + break; + case "MESSAGE_ENCODING_UNKNOWN": + case 0: + message.messageEncoding = 0; + break; + case "LENGTH_PREFIXED": + case 1: + message.messageEncoding = 1; + break; + case "DELIMITED": + case 2: + message.messageEncoding = 2; + break; + } + switch (object.jsonFormat) { + default: + if (typeof object.jsonFormat === "number") { + message.jsonFormat = object.jsonFormat; + break; + } + break; + case "JSON_FORMAT_UNKNOWN": + case 0: + message.jsonFormat = 0; + break; + case "ALLOW": + case 1: + message.jsonFormat = 1; + break; + case "LEGACY_BEST_EFFORT": + case 2: + message.jsonFormat = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.FeatureSet} message FeatureSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.fieldPresence = options.enums === String ? "FIELD_PRESENCE_UNKNOWN" : 0; + object.enumType = options.enums === String ? "ENUM_TYPE_UNKNOWN" : 0; + object.repeatedFieldEncoding = options.enums === String ? "REPEATED_FIELD_ENCODING_UNKNOWN" : 0; + object.utf8Validation = options.enums === String ? "UTF8_VALIDATION_UNKNOWN" : 0; + object.messageEncoding = options.enums === String ? "MESSAGE_ENCODING_UNKNOWN" : 0; + object.jsonFormat = options.enums === String ? "JSON_FORMAT_UNKNOWN" : 0; + } + if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) + object.fieldPresence = options.enums === String ? $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] === undefined ? message.fieldPresence : $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] : message.fieldPresence; + if (message.enumType != null && message.hasOwnProperty("enumType")) + object.enumType = options.enums === String ? $root.google.protobuf.FeatureSet.EnumType[message.enumType] === undefined ? message.enumType : $root.google.protobuf.FeatureSet.EnumType[message.enumType] : message.enumType; + if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) + object.repeatedFieldEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] === undefined ? message.repeatedFieldEncoding : $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] : message.repeatedFieldEncoding; + if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) + object.utf8Validation = options.enums === String ? $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] === undefined ? message.utf8Validation : $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] : message.utf8Validation; + if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) + object.messageEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] === undefined ? message.messageEncoding : $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] : message.messageEncoding; + if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) + object.jsonFormat = options.enums === String ? $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] === undefined ? message.jsonFormat : $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] : message.jsonFormat; + return object; + }; + + /** + * Converts this FeatureSet to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSet + * @instance + * @returns {Object.} JSON object + */ + FeatureSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSet + * @function getTypeUrl + * @memberof google.protobuf.FeatureSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSet"; + }; + + /** + * FieldPresence enum. + * @name google.protobuf.FeatureSet.FieldPresence + * @enum {number} + * @property {number} FIELD_PRESENCE_UNKNOWN=0 FIELD_PRESENCE_UNKNOWN value + * @property {number} EXPLICIT=1 EXPLICIT value + * @property {number} IMPLICIT=2 IMPLICIT value + * @property {number} LEGACY_REQUIRED=3 LEGACY_REQUIRED value + */ + FeatureSet.FieldPresence = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_PRESENCE_UNKNOWN"] = 0; + values[valuesById[1] = "EXPLICIT"] = 1; + values[valuesById[2] = "IMPLICIT"] = 2; + values[valuesById[3] = "LEGACY_REQUIRED"] = 3; + return values; + })(); + + /** + * EnumType enum. + * @name google.protobuf.FeatureSet.EnumType + * @enum {number} + * @property {number} ENUM_TYPE_UNKNOWN=0 ENUM_TYPE_UNKNOWN value + * @property {number} OPEN=1 OPEN value + * @property {number} CLOSED=2 CLOSED value + */ + FeatureSet.EnumType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENUM_TYPE_UNKNOWN"] = 0; + values[valuesById[1] = "OPEN"] = 1; + values[valuesById[2] = "CLOSED"] = 2; + return values; + })(); + + /** + * RepeatedFieldEncoding enum. + * @name google.protobuf.FeatureSet.RepeatedFieldEncoding + * @enum {number} + * @property {number} REPEATED_FIELD_ENCODING_UNKNOWN=0 REPEATED_FIELD_ENCODING_UNKNOWN value + * @property {number} PACKED=1 PACKED value + * @property {number} EXPANDED=2 EXPANDED value + */ + FeatureSet.RepeatedFieldEncoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "REPEATED_FIELD_ENCODING_UNKNOWN"] = 0; + values[valuesById[1] = "PACKED"] = 1; + values[valuesById[2] = "EXPANDED"] = 2; + return values; + })(); + + /** + * Utf8Validation enum. + * @name google.protobuf.FeatureSet.Utf8Validation + * @enum {number} + * @property {number} UTF8_VALIDATION_UNKNOWN=0 UTF8_VALIDATION_UNKNOWN value + * @property {number} VERIFY=2 VERIFY value + * @property {number} NONE=3 NONE value + */ + FeatureSet.Utf8Validation = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UTF8_VALIDATION_UNKNOWN"] = 0; + values[valuesById[2] = "VERIFY"] = 2; + values[valuesById[3] = "NONE"] = 3; + return values; + })(); + + /** + * MessageEncoding enum. + * @name google.protobuf.FeatureSet.MessageEncoding + * @enum {number} + * @property {number} MESSAGE_ENCODING_UNKNOWN=0 MESSAGE_ENCODING_UNKNOWN value + * @property {number} LENGTH_PREFIXED=1 LENGTH_PREFIXED value + * @property {number} DELIMITED=2 DELIMITED value + */ + FeatureSet.MessageEncoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MESSAGE_ENCODING_UNKNOWN"] = 0; + values[valuesById[1] = "LENGTH_PREFIXED"] = 1; + values[valuesById[2] = "DELIMITED"] = 2; + return values; + })(); + + /** + * JsonFormat enum. + * @name google.protobuf.FeatureSet.JsonFormat + * @enum {number} + * @property {number} JSON_FORMAT_UNKNOWN=0 JSON_FORMAT_UNKNOWN value + * @property {number} ALLOW=1 ALLOW value + * @property {number} LEGACY_BEST_EFFORT=2 LEGACY_BEST_EFFORT value + */ + FeatureSet.JsonFormat = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JSON_FORMAT_UNKNOWN"] = 0; + values[valuesById[1] = "ALLOW"] = 1; + values[valuesById[2] = "LEGACY_BEST_EFFORT"] = 2; + return values; + })(); + + return FeatureSet; + })(); + + protobuf.FeatureSetDefaults = (function() { + + /** + * Properties of a FeatureSetDefaults. + * @memberof google.protobuf + * @interface IFeatureSetDefaults + * @property {Array.|null} [defaults] FeatureSetDefaults defaults + * @property {google.protobuf.Edition|null} [minimumEdition] FeatureSetDefaults minimumEdition + * @property {google.protobuf.Edition|null} [maximumEdition] FeatureSetDefaults maximumEdition + */ + + /** + * Constructs a new FeatureSetDefaults. + * @memberof google.protobuf + * @classdesc Represents a FeatureSetDefaults. + * @implements IFeatureSetDefaults + * @constructor + * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set + */ + function FeatureSetDefaults(properties) { + this.defaults = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSetDefaults defaults. + * @member {Array.} defaults + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.defaults = $util.emptyArray; + + /** + * FeatureSetDefaults minimumEdition. + * @member {google.protobuf.Edition} minimumEdition + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.minimumEdition = 0; + + /** + * FeatureSetDefaults maximumEdition. + * @member {google.protobuf.Edition} maximumEdition + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.maximumEdition = 0; + + /** + * Creates a new FeatureSetDefaults instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults instance + */ + FeatureSetDefaults.create = function create(properties) { + return new FeatureSetDefaults(properties); + }; + + /** + * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetDefaults.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.defaults != null && message.defaults.length) + for (var i = 0; i < message.defaults.length; ++i) + $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.encode(message.defaults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.minimumEdition != null && Object.hasOwnProperty.call(message, "minimumEdition")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.minimumEdition); + if (message.maximumEdition != null && Object.hasOwnProperty.call(message, "maximumEdition")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maximumEdition); + return writer; + }; + + /** + * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetDefaults.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetDefaults.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.defaults && message.defaults.length)) + message.defaults = []; + message.defaults.push($root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.decode(reader, reader.uint32())); + break; + } + case 4: { + message.minimumEdition = reader.int32(); + break; + } + case 5: { + message.maximumEdition = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetDefaults.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSetDefaults message. + * @function verify + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSetDefaults.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.defaults != null && message.hasOwnProperty("defaults")) { + if (!Array.isArray(message.defaults)) + return "defaults: array expected"; + for (var i = 0; i < message.defaults.length; ++i) { + var error = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify(message.defaults[i]); + if (error) + return "defaults." + error; + } + } + if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) + switch (message.minimumEdition) { + default: + return "minimumEdition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) + switch (message.maximumEdition) { + default: + return "maximumEdition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + return null; + }; + + /** + * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + */ + FeatureSetDefaults.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSetDefaults) + return object; + var message = new $root.google.protobuf.FeatureSetDefaults(); + if (object.defaults) { + if (!Array.isArray(object.defaults)) + throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: array expected"); + message.defaults = []; + for (var i = 0; i < object.defaults.length; ++i) { + if (typeof object.defaults[i] !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: object expected"); + message.defaults[i] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fromObject(object.defaults[i]); + } + } + switch (object.minimumEdition) { + default: + if (typeof object.minimumEdition === "number") { + message.minimumEdition = object.minimumEdition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.minimumEdition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.minimumEdition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.minimumEdition = 999; + break; + case "EDITION_2023": + case 1000: + message.minimumEdition = 1000; + break; + case "EDITION_2024": + case 1001: + message.minimumEdition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.minimumEdition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.minimumEdition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.minimumEdition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.minimumEdition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.minimumEdition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.minimumEdition = 2147483647; + break; + } + switch (object.maximumEdition) { + default: + if (typeof object.maximumEdition === "number") { + message.maximumEdition = object.maximumEdition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.maximumEdition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.maximumEdition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.maximumEdition = 999; + break; + case "EDITION_2023": + case 1000: + message.maximumEdition = 1000; + break; + case "EDITION_2024": + case 1001: + message.maximumEdition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.maximumEdition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.maximumEdition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.maximumEdition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.maximumEdition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.maximumEdition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.maximumEdition = 2147483647; + break; + } + return message; + }; + + /** + * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.FeatureSetDefaults} message FeatureSetDefaults + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSetDefaults.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.defaults = []; + if (options.defaults) { + object.minimumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.maximumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.defaults && message.defaults.length) { + object.defaults = []; + for (var j = 0; j < message.defaults.length; ++j) + object.defaults[j] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.toObject(message.defaults[j], options); + } + if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) + object.minimumEdition = options.enums === String ? $root.google.protobuf.Edition[message.minimumEdition] === undefined ? message.minimumEdition : $root.google.protobuf.Edition[message.minimumEdition] : message.minimumEdition; + if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) + object.maximumEdition = options.enums === String ? $root.google.protobuf.Edition[message.maximumEdition] === undefined ? message.maximumEdition : $root.google.protobuf.Edition[message.maximumEdition] : message.maximumEdition; + return object; + }; + + /** + * Converts this FeatureSetDefaults to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSetDefaults + * @instance + * @returns {Object.} JSON object + */ + FeatureSetDefaults.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSetDefaults + * @function getTypeUrl + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSetDefaults.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults"; + }; + + FeatureSetDefaults.FeatureSetEditionDefault = (function() { + + /** + * Properties of a FeatureSetEditionDefault. + * @memberof google.protobuf.FeatureSetDefaults + * @interface IFeatureSetEditionDefault + * @property {google.protobuf.Edition|null} [edition] FeatureSetEditionDefault edition + * @property {google.protobuf.IFeatureSet|null} [features] FeatureSetEditionDefault features + */ + + /** + * Constructs a new FeatureSetEditionDefault. + * @memberof google.protobuf.FeatureSetDefaults + * @classdesc Represents a FeatureSetEditionDefault. + * @implements IFeatureSetEditionDefault + * @constructor + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set + */ + function FeatureSetEditionDefault(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSetEditionDefault edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.edition = 0; + + /** + * FeatureSetEditionDefault features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.features = null; + + /** + * Creates a new FeatureSetEditionDefault instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault instance + */ + FeatureSetEditionDefault.create = function create(properties) { + return new FeatureSetEditionDefault(properties); + }; + + /** + * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetEditionDefault.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetEditionDefault.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetEditionDefault.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.edition = reader.int32(); + break; + } + case 2: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetEditionDefault.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSetEditionDefault message. + * @function verify + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSetEditionDefault.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + return null; + }; + + /** + * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + */ + FeatureSetEditionDefault.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault) + return object; + var message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + return message; + }; + + /** + * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} message FeatureSetEditionDefault + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSetEditionDefault.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.features = null; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this FeatureSetEditionDefault to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + * @returns {Object.} JSON object + */ + FeatureSetEditionDefault.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSetEditionDefault + * @function getTypeUrl + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSetEditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault"; + }; + + return FeatureSetEditionDefault; + })(); + + return FeatureSetDefaults; + })(); + + protobuf.SourceCodeInfo = (function() { + + /** + * Properties of a SourceCodeInfo. + * @memberof google.protobuf + * @interface ISourceCodeInfo + * @property {Array.|null} [location] SourceCodeInfo location + */ + + /** + * Constructs a new SourceCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a SourceCodeInfo. + * @implements ISourceCodeInfo + * @constructor + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + */ + function SourceCodeInfo(properties) { + this.location = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SourceCodeInfo location. + * @member {Array.} location + * @memberof google.protobuf.SourceCodeInfo + * @instance + */ + SourceCodeInfo.prototype.location = $util.emptyArray; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance + */ + SourceCodeInfo.create = function create(properties) { + return new SourceCodeInfo(properties); + }; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.location != null && message.location.length) + for (var i = 0; i < message.location.length; ++i) + $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.location && message.location.length)) + message.location = []; + message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SourceCodeInfo message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SourceCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.location != null && message.hasOwnProperty("location")) { + if (!Array.isArray(message.location)) + return "location: array expected"; + for (var i = 0; i < message.location.length; ++i) { + var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]); + if (error) + return "location." + error; + } + } + return null; + }; + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + */ + SourceCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo) + return object; + var message = new $root.google.protobuf.SourceCodeInfo(); + if (object.location) { + if (!Array.isArray(object.location)) + throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); + message.location = []; + for (var i = 0; i < object.location.length; ++i) { + if (typeof object.location[i] !== "object") + throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); + message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SourceCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.location = []; + if (message.location && message.location.length) { + object.location = []; + for (var j = 0; j < message.location.length; ++j) + object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options); + } + return object; + }; + + /** + * Converts this SourceCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo + * @instance + * @returns {Object.} JSON object + */ + SourceCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SourceCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SourceCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo"; + }; + + SourceCodeInfo.Location = (function() { + + /** + * Properties of a Location. + * @memberof google.protobuf.SourceCodeInfo + * @interface ILocation + * @property {Array.|null} [path] Location path + * @property {Array.|null} [span] Location span + * @property {string|null} [leadingComments] Location leadingComments + * @property {string|null} [trailingComments] Location trailingComments + * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments + */ + + /** + * Constructs a new Location. + * @memberof google.protobuf.SourceCodeInfo + * @classdesc Represents a Location. + * @implements ILocation + * @constructor + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + */ + function Location(properties) { + this.path = []; + this.span = []; + this.leadingDetachedComments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Location path. + * @member {Array.} path + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.path = $util.emptyArray; + + /** + * Location span. + * @member {Array.} span + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.span = $util.emptyArray; + + /** + * Location leadingComments. + * @member {string} leadingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingComments = ""; + + /** + * Location trailingComments. + * @member {string} trailingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.trailingComments = ""; + + /** + * Location leadingDetachedComments. + * @member {Array.} leadingDetachedComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingDetachedComments = $util.emptyArray; + + /** + * Creates a new Location instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo.Location} Location instance + */ + Location.create = function create(properties) { + return new Location(properties); + }; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.span != null && message.span.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.span.length; ++i) + writer.int32(message.span[i]); + writer.ldelim(); + } + if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); + if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); + if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); + return writer; + }; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Location message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + if (!(message.span && message.span.length)) + message.span = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.span.push(reader.int32()); + } else + message.span.push(reader.int32()); + break; + } + case 3: { + message.leadingComments = reader.string(); + break; + } + case 4: { + message.trailingComments = reader.string(); + break; + } + case 6: { + if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) + message.leadingDetachedComments = []; + message.leadingDetachedComments.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Location message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Location.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.span != null && message.hasOwnProperty("span")) { + if (!Array.isArray(message.span)) + return "span: array expected"; + for (var i = 0; i < message.span.length; ++i) + if (!$util.isInteger(message.span[i])) + return "span: integer[] expected"; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + if (!$util.isString(message.leadingComments)) + return "leadingComments: string expected"; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + if (!$util.isString(message.trailingComments)) + return "trailingComments: string expected"; + if (message.leadingDetachedComments != null && message.hasOwnProperty("leadingDetachedComments")) { + if (!Array.isArray(message.leadingDetachedComments)) + return "leadingDetachedComments: array expected"; + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + if (!$util.isString(message.leadingDetachedComments[i])) + return "leadingDetachedComments: string[] expected"; + } + return null; + }; + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo.Location} Location + */ + Location.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) + return object; + var message = new $root.google.protobuf.SourceCodeInfo.Location(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.span) { + if (!Array.isArray(object.span)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); + message.span = []; + for (var i = 0; i < object.span.length; ++i) + message.span[i] = object.span[i] | 0; + } + if (object.leadingComments != null) + message.leadingComments = String(object.leadingComments); + if (object.trailingComments != null) + message.trailingComments = String(object.trailingComments); + if (object.leadingDetachedComments) { + if (!Array.isArray(object.leadingDetachedComments)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected"); + message.leadingDetachedComments = []; + for (var i = 0; i < object.leadingDetachedComments.length; ++i) + message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]); + } + return message; + }; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.Location} message Location + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Location.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.path = []; + object.span = []; + object.leadingDetachedComments = []; + } + if (options.defaults) { + object.leadingComments = ""; + object.trailingComments = ""; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.span && message.span.length) { + object.span = []; + for (var j = 0; j < message.span.length; ++j) + object.span[j] = message.span[j]; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + object.leadingComments = message.leadingComments; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + object.trailingComments = message.trailingComments; + if (message.leadingDetachedComments && message.leadingDetachedComments.length) { + object.leadingDetachedComments = []; + for (var j = 0; j < message.leadingDetachedComments.length; ++j) + object.leadingDetachedComments[j] = message.leadingDetachedComments[j]; + } + return object; + }; + + /** + * Converts this Location to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + * @returns {Object.} JSON object + */ + Location.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Location + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Location.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo.Location"; + }; + + return Location; + })(); + + return SourceCodeInfo; + })(); + + protobuf.GeneratedCodeInfo = (function() { + + /** + * Properties of a GeneratedCodeInfo. + * @memberof google.protobuf + * @interface IGeneratedCodeInfo + * @property {Array.|null} [annotation] GeneratedCodeInfo annotation + */ + + /** + * Constructs a new GeneratedCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a GeneratedCodeInfo. + * @implements IGeneratedCodeInfo + * @constructor + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + */ + function GeneratedCodeInfo(properties) { + this.annotation = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GeneratedCodeInfo annotation. + * @member {Array.} annotation + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + */ + GeneratedCodeInfo.prototype.annotation = $util.emptyArray; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance + */ + GeneratedCodeInfo.create = function create(properties) { + return new GeneratedCodeInfo(properties); + }; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotation != null && message.annotation.length) + for (var i = 0; i < message.annotation.length; ++i) + $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.annotation && message.annotation.length)) + message.annotation = []; + message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GeneratedCodeInfo message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GeneratedCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.annotation != null && message.hasOwnProperty("annotation")) { + if (!Array.isArray(message.annotation)) + return "annotation: array expected"; + for (var i = 0; i < message.annotation.length; ++i) { + var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]); + if (error) + return "annotation." + error; + } + } + return null; + }; + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + */ + GeneratedCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo(); + if (object.annotation) { + if (!Array.isArray(object.annotation)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); + message.annotation = []; + for (var i = 0; i < object.annotation.length; ++i) { + if (typeof object.annotation[i] !== "object") + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); + message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GeneratedCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.annotation = []; + if (message.annotation && message.annotation.length) { + object.annotation = []; + for (var j = 0; j < message.annotation.length; ++j) + object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options); + } + return object; + }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + * @returns {Object.} JSON object + */ + GeneratedCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GeneratedCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo"; + }; + + GeneratedCodeInfo.Annotation = (function() { + + /** + * Properties of an Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @interface IAnnotation + * @property {Array.|null} [path] Annotation path + * @property {string|null} [sourceFile] Annotation sourceFile + * @property {number|null} [begin] Annotation begin + * @property {number|null} [end] Annotation end + * @property {google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null} [semantic] Annotation semantic + */ + + /** + * Constructs a new Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @classdesc Represents an Annotation. + * @implements IAnnotation + * @constructor + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + */ + function Annotation(properties) { + this.path = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Annotation path. + * @member {Array.} path + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.path = $util.emptyArray; + + /** + * Annotation sourceFile. + * @member {string} sourceFile + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.sourceFile = ""; + + /** + * Annotation begin. + * @member {number} begin + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.begin = 0; + + /** + * Annotation end. + * @member {number} end + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.end = 0; + + /** + * Annotation semantic. + * @member {google.protobuf.GeneratedCodeInfo.Annotation.Semantic} semantic + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.semantic = 0; + + /** + * Creates a new Annotation instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance + */ + Annotation.create = function create(properties) { + return new Annotation(properties); + }; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); + if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); + if (message.semantic != null && Object.hasOwnProperty.call(message, "semantic")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.semantic); + return writer; + }; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + message.sourceFile = reader.string(); + break; + } + case 3: { + message.begin = reader.int32(); + break; + } + case 4: { + message.end = reader.int32(); + break; + } + case 5: { + message.semantic = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Annotation message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Annotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + if (!$util.isString(message.sourceFile)) + return "sourceFile: string expected"; + if (message.begin != null && message.hasOwnProperty("begin")) + if (!$util.isInteger(message.begin)) + return "begin: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.semantic != null && message.hasOwnProperty("semantic")) + switch (message.semantic) { + default: + return "semantic: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + */ + Annotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.sourceFile != null) + message.sourceFile = String(object.sourceFile); + if (object.begin != null) + message.begin = object.begin | 0; + if (object.end != null) + message.end = object.end | 0; + switch (object.semantic) { + default: + if (typeof object.semantic === "number") { + message.semantic = object.semantic; + break; + } + break; + case "NONE": + case 0: + message.semantic = 0; + break; + case "SET": + case 1: + message.semantic = 1; + break; + case "ALIAS": + case 2: + message.semantic = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Annotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.path = []; + if (options.defaults) { + object.sourceFile = ""; + object.begin = 0; + object.end = 0; + object.semantic = options.enums === String ? "NONE" : 0; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + object.sourceFile = message.sourceFile; + if (message.begin != null && message.hasOwnProperty("begin")) + object.begin = message.begin; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.semantic != null && message.hasOwnProperty("semantic")) + object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] === undefined ? message.semantic : $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic; + return object; + }; + + /** + * Converts this Annotation to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + * @returns {Object.} JSON object + */ + Annotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Annotation + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Annotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo.Annotation"; + }; + + /** + * Semantic enum. + * @name google.protobuf.GeneratedCodeInfo.Annotation.Semantic + * @enum {number} + * @property {number} NONE=0 NONE value + * @property {number} SET=1 SET value + * @property {number} ALIAS=2 ALIAS value + */ + Annotation.Semantic = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "SET"] = 1; + values[valuesById[2] = "ALIAS"] = 2; + return values; + })(); + + return Annotation; + })(); + + return GeneratedCodeInfo; + })(); + + protobuf.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof google.protobuf + * @interface IDuration + * @property {number|Long|null} [seconds] Duration seconds + * @property {number|null} [nanos] Duration nanos + */ + + /** + * Constructs a new Duration. + * @memberof google.protobuf + * @classdesc Represents a Duration. + * @implements IDuration + * @constructor + * @param {google.protobuf.IDuration=} [properties] Properties to set + */ + function Duration(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Duration seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Duration nanos. + * @member {number} nanos + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.nanos = 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration=} [properties] Properties to set + * @returns {google.protobuf.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Duration message. + * @function verify + * @memberof google.protobuf.Duration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Duration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Duration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Duration} Duration + */ + Duration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Duration) + return object; + var message = new $root.google.protobuf.Duration(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.Duration} message Duration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Duration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Duration to JSON. + * @function toJSON + * @memberof google.protobuf.Duration + * @instance + * @returns {Object.} JSON object + */ + Duration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof google.protobuf.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Duration"; + }; + + return Duration; + })(); + + protobuf.Any = (function() { + + /** + * Properties of an Any. + * @memberof google.protobuf + * @interface IAny + * @property {string|null} [type_url] Any type_url + * @property {Uint8Array|null} [value] Any value + */ + + /** + * Constructs a new Any. + * @memberof google.protobuf + * @classdesc Represents an Any. + * @implements IAny + * @constructor + * @param {google.protobuf.IAny=} [properties] Properties to set + */ + function Any(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Any type_url. + * @member {string} type_url + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.type_url = ""; + + /** + * Any value. + * @member {Uint8Array} value + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.value = $util.newBuffer([]); + + /** + * Creates a new Any instance using the specified properties. + * @function create + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny=} [properties] Properties to set + * @returns {google.protobuf.Any} Any instance + */ + Any.create = function create(properties) { + return new Any(properties); + }; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Any message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.type_url = reader.string(); + break; + } + case 2: { + message.value = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Any message. + * @function verify + * @memberof google.protobuf.Any + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Any.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type_url != null && message.hasOwnProperty("type_url")) + if (!$util.isString(message.type_url)) + return "type_url: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Any + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Any} Any + */ + Any.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Any) + return object; + var message = new $root.google.protobuf.Any(); + if (object.type_url != null) + message.type_url = String(object.type_url); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length >= 0) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.Any} message Any + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Any.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type_url = ""; + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + } + if (message.type_url != null && message.hasOwnProperty("type_url")) + object.type_url = message.type_url; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this Any to JSON. + * @function toJSON + * @memberof google.protobuf.Any + * @instance + * @returns {Object.} JSON object + */ + Any.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Any + * @function getTypeUrl + * @memberof google.protobuf.Any + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Any.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Any"; + }; + + return Any; + })(); + + protobuf.Empty = (function() { + + /** + * Properties of an Empty. + * @memberof google.protobuf + * @interface IEmpty + */ + + /** + * Constructs a new Empty. + * @memberof google.protobuf + * @classdesc Represents an Empty. + * @implements IEmpty + * @constructor + * @param {google.protobuf.IEmpty=} [properties] Properties to set + */ + function Empty(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new Empty instance using the specified properties. + * @function create + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty=} [properties] Properties to set + * @returns {google.protobuf.Empty} Empty instance + */ + Empty.create = function create(properties) { + return new Empty(properties); + }; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Empty message. + * @function verify + * @memberof google.protobuf.Empty + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Empty.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Empty + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Empty} Empty + */ + Empty.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Empty) + return object; + return new $root.google.protobuf.Empty(); + }; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.Empty} message Empty + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Empty.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Empty to JSON. + * @function toJSON + * @memberof google.protobuf.Empty + * @instance + * @returns {Object.} JSON object + */ + Empty.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Empty + * @function getTypeUrl + * @memberof google.protobuf.Empty + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Empty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Empty"; + }; + + return Empty; + })(); + + protobuf.FieldMask = (function() { + + /** + * Properties of a FieldMask. + * @memberof google.protobuf + * @interface IFieldMask + * @property {Array.|null} [paths] FieldMask paths + */ + + /** + * Constructs a new FieldMask. + * @memberof google.protobuf + * @classdesc Represents a FieldMask. + * @implements IFieldMask + * @constructor + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + */ + function FieldMask(properties) { + this.paths = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldMask paths. + * @member {Array.} paths + * @memberof google.protobuf.FieldMask + * @instance + */ + FieldMask.prototype.paths = $util.emptyArray; + + /** + * Creates a new FieldMask instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + * @returns {google.protobuf.FieldMask} FieldMask instance + */ + FieldMask.create = function create(properties) { + return new FieldMask(properties); + }; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.paths != null && message.paths.length) + for (var i = 0; i < message.paths.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.paths[i]); + return writer; + }; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldMask(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.paths && message.paths.length)) + message.paths = []; + message.paths.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldMask message. + * @function verify + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldMask.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.paths != null && message.hasOwnProperty("paths")) { + if (!Array.isArray(message.paths)) + return "paths: array expected"; + for (var i = 0; i < message.paths.length; ++i) + if (!$util.isString(message.paths[i])) + return "paths: string[] expected"; + } + return null; + }; + + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldMask} FieldMask + */ + FieldMask.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldMask) + return object; + var message = new $root.google.protobuf.FieldMask(); + if (object.paths) { + if (!Array.isArray(object.paths)) + throw TypeError(".google.protobuf.FieldMask.paths: array expected"); + message.paths = []; + for (var i = 0; i < object.paths.length; ++i) + message.paths[i] = String(object.paths[i]); + } + return message; + }; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.FieldMask} message FieldMask + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldMask.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.paths = []; + if (message.paths && message.paths.length) { + object.paths = []; + for (var j = 0; j < message.paths.length; ++j) + object.paths[j] = message.paths[j]; + } + return object; + }; + + /** + * Converts this FieldMask to JSON. + * @function toJSON + * @memberof google.protobuf.FieldMask + * @instance + * @returns {Object.} JSON object + */ + FieldMask.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldMask + * @function getTypeUrl + * @memberof google.protobuf.FieldMask + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldMask.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldMask"; + }; + + return FieldMask; + })(); + + protobuf.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof google.protobuf + * @interface ITimestamp + * @property {number|Long|null} [seconds] Timestamp seconds + * @property {number|null} [nanos] Timestamp nanos + */ + + /** + * Constructs a new Timestamp. + * @memberof google.protobuf + * @classdesc Represents a Timestamp. + * @implements ITimestamp + * @constructor + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + */ + function Timestamp(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Timestamp seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Timestamp nanos. + * @member {number} nanos + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + * @returns {google.protobuf.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Timestamp message. + * @function verify + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Timestamp.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Timestamp} Timestamp + */ + Timestamp.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Timestamp) + return object; + var message = new $root.google.protobuf.Timestamp(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.Timestamp} message Timestamp + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Timestamp.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Timestamp to JSON. + * @function toJSON + * @memberof google.protobuf.Timestamp + * @instance + * @returns {Object.} JSON object + */ + Timestamp.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof google.protobuf.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Timestamp"; + }; + + return Timestamp; + })(); + + protobuf.Struct = (function() { + + /** + * Properties of a Struct. + * @memberof google.protobuf + * @interface IStruct + * @property {Object.|null} [fields] Struct fields + */ + + /** + * Constructs a new Struct. + * @memberof google.protobuf + * @classdesc Represents a Struct. + * @implements IStruct + * @constructor + * @param {google.protobuf.IStruct=} [properties] Properties to set + */ + function Struct(properties) { + this.fields = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Struct fields. + * @member {Object.} fields + * @memberof google.protobuf.Struct + * @instance + */ + Struct.prototype.fields = $util.emptyObject; + + /** + * Creates a new Struct instance using the specified properties. + * @function create + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.IStruct=} [properties] Properties to set + * @returns {google.protobuf.Struct} Struct instance + */ + Struct.create = function create(properties) { + return new Struct(properties); + }; + + /** + * Encodes the specified Struct message. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.IStruct} message Struct message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Struct.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fields != null && Object.hasOwnProperty.call(message, "fields")) + for (var keys = Object.keys(message.fields), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.protobuf.Value.encode(message.fields[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified Struct message, length delimited. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.IStruct} message Struct message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Struct.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Struct message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Struct + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Struct} Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Struct.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Struct(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (message.fields === $util.emptyObject) + message.fields = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.fields[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Struct message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Struct + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Struct} Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Struct.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Struct message. + * @function verify + * @memberof google.protobuf.Struct + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Struct.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fields != null && message.hasOwnProperty("fields")) { + if (!$util.isObject(message.fields)) + return "fields: object expected"; + var key = Object.keys(message.fields); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.fields[key[i]]); + if (error) + return "fields." + error; + } + } + return null; + }; + + /** + * Creates a Struct message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Struct + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Struct} Struct + */ + Struct.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Struct) + return object; + var message = new $root.google.protobuf.Struct(); + if (object.fields) { + if (typeof object.fields !== "object") + throw TypeError(".google.protobuf.Struct.fields: object expected"); + message.fields = {}; + for (var keys = Object.keys(object.fields), i = 0; i < keys.length; ++i) { + if (typeof object.fields[keys[i]] !== "object") + throw TypeError(".google.protobuf.Struct.fields: object expected"); + message.fields[keys[i]] = $root.google.protobuf.Value.fromObject(object.fields[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a Struct message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.Struct} message Struct + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Struct.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.fields = {}; + var keys2; + if (message.fields && (keys2 = Object.keys(message.fields)).length) { + object.fields = {}; + for (var j = 0; j < keys2.length; ++j) + object.fields[keys2[j]] = $root.google.protobuf.Value.toObject(message.fields[keys2[j]], options); + } + return object; + }; + + /** + * Converts this Struct to JSON. + * @function toJSON + * @memberof google.protobuf.Struct + * @instance + * @returns {Object.} JSON object + */ + Struct.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Struct + * @function getTypeUrl + * @memberof google.protobuf.Struct + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Struct.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Struct"; + }; + + return Struct; + })(); + + protobuf.Value = (function() { + + /** + * Properties of a Value. + * @memberof google.protobuf + * @interface IValue + * @property {google.protobuf.NullValue|null} [nullValue] Value nullValue + * @property {number|null} [numberValue] Value numberValue + * @property {string|null} [stringValue] Value stringValue + * @property {boolean|null} [boolValue] Value boolValue + * @property {google.protobuf.IStruct|null} [structValue] Value structValue + * @property {google.protobuf.IListValue|null} [listValue] Value listValue + */ + + /** + * Constructs a new Value. + * @memberof google.protobuf + * @classdesc Represents a Value. + * @implements IValue + * @constructor + * @param {google.protobuf.IValue=} [properties] Properties to set + */ + function Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Value nullValue. + * @member {google.protobuf.NullValue|null|undefined} nullValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.nullValue = null; + + /** + * Value numberValue. + * @member {number|null|undefined} numberValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.numberValue = null; + + /** + * Value stringValue. + * @member {string|null|undefined} stringValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.stringValue = null; + + /** + * Value boolValue. + * @member {boolean|null|undefined} boolValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.boolValue = null; + + /** + * Value structValue. + * @member {google.protobuf.IStruct|null|undefined} structValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.structValue = null; + + /** + * Value listValue. + * @member {google.protobuf.IListValue|null|undefined} listValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.listValue = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Value kind. + * @member {"nullValue"|"numberValue"|"stringValue"|"boolValue"|"structValue"|"listValue"|undefined} kind + * @memberof google.protobuf.Value + * @instance + */ + Object.defineProperty(Value.prototype, "kind", { + get: $util.oneOfGetter($oneOfFields = ["nullValue", "numberValue", "stringValue", "boolValue", "structValue", "listValue"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.IValue=} [properties] Properties to set + * @returns {google.protobuf.Value} Value instance + */ + Value.create = function create(properties) { + return new Value(properties); + }; + + /** + * Encodes the specified Value message. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.IValue} message Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.nullValue != null && Object.hasOwnProperty.call(message, "nullValue")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.nullValue); + if (message.numberValue != null && Object.hasOwnProperty.call(message, "numberValue")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.numberValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.stringValue); + if (message.boolValue != null && Object.hasOwnProperty.call(message, "boolValue")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.boolValue); + if (message.structValue != null && Object.hasOwnProperty.call(message, "structValue")) + $root.google.protobuf.Struct.encode(message.structValue, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.listValue != null && Object.hasOwnProperty.call(message, "listValue")) + $root.google.protobuf.ListValue.encode(message.listValue, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Value message, length delimited. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.IValue} message Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Value} Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Value.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.nullValue = reader.int32(); + break; + } + case 2: { + message.numberValue = reader.double(); + break; + } + case 3: { + message.stringValue = reader.string(); + break; + } + case 4: { + message.boolValue = reader.bool(); + break; + } + case 5: { + message.structValue = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 6: { + message.listValue = $root.google.protobuf.ListValue.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Value} Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Value message. + * @function verify + * @memberof google.protobuf.Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.nullValue != null && message.hasOwnProperty("nullValue")) { + properties.kind = 1; + switch (message.nullValue) { + default: + return "nullValue: enum value expected"; + case 0: + break; + } + } + if (message.numberValue != null && message.hasOwnProperty("numberValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (typeof message.numberValue !== "number") + return "numberValue: number expected"; + } + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (!$util.isString(message.stringValue)) + return "stringValue: string expected"; + } + if (message.boolValue != null && message.hasOwnProperty("boolValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (typeof message.boolValue !== "boolean") + return "boolValue: boolean expected"; + } + if (message.structValue != null && message.hasOwnProperty("structValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.protobuf.Struct.verify(message.structValue); + if (error) + return "structValue." + error; + } + } + if (message.listValue != null && message.hasOwnProperty("listValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.protobuf.ListValue.verify(message.listValue); + if (error) + return "listValue." + error; + } + } + return null; + }; + + /** + * Creates a Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Value} Value + */ + Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Value) + return object; + var message = new $root.google.protobuf.Value(); + switch (object.nullValue) { + default: + if (typeof object.nullValue === "number") { + message.nullValue = object.nullValue; + break; + } + break; + case "NULL_VALUE": + case 0: + message.nullValue = 0; + break; + } + if (object.numberValue != null) + message.numberValue = Number(object.numberValue); + if (object.stringValue != null) + message.stringValue = String(object.stringValue); + if (object.boolValue != null) + message.boolValue = Boolean(object.boolValue); + if (object.structValue != null) { + if (typeof object.structValue !== "object") + throw TypeError(".google.protobuf.Value.structValue: object expected"); + message.structValue = $root.google.protobuf.Struct.fromObject(object.structValue); + } + if (object.listValue != null) { + if (typeof object.listValue !== "object") + throw TypeError(".google.protobuf.Value.listValue: object expected"); + message.listValue = $root.google.protobuf.ListValue.fromObject(object.listValue); + } + return message; + }; + + /** + * Creates a plain object from a Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.Value} message Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.nullValue != null && message.hasOwnProperty("nullValue")) { + object.nullValue = options.enums === String ? $root.google.protobuf.NullValue[message.nullValue] === undefined ? message.nullValue : $root.google.protobuf.NullValue[message.nullValue] : message.nullValue; + if (options.oneofs) + object.kind = "nullValue"; + } + if (message.numberValue != null && message.hasOwnProperty("numberValue")) { + object.numberValue = options.json && !isFinite(message.numberValue) ? String(message.numberValue) : message.numberValue; + if (options.oneofs) + object.kind = "numberValue"; + } + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + object.stringValue = message.stringValue; + if (options.oneofs) + object.kind = "stringValue"; + } + if (message.boolValue != null && message.hasOwnProperty("boolValue")) { + object.boolValue = message.boolValue; + if (options.oneofs) + object.kind = "boolValue"; + } + if (message.structValue != null && message.hasOwnProperty("structValue")) { + object.structValue = $root.google.protobuf.Struct.toObject(message.structValue, options); + if (options.oneofs) + object.kind = "structValue"; + } + if (message.listValue != null && message.hasOwnProperty("listValue")) { + object.listValue = $root.google.protobuf.ListValue.toObject(message.listValue, options); + if (options.oneofs) + object.kind = "listValue"; + } + return object; + }; + + /** + * Converts this Value to JSON. + * @function toJSON + * @memberof google.protobuf.Value + * @instance + * @returns {Object.} JSON object + */ + Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Value + * @function getTypeUrl + * @memberof google.protobuf.Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Value"; + }; + + return Value; + })(); + + /** + * NullValue enum. + * @name google.protobuf.NullValue + * @enum {number} + * @property {number} NULL_VALUE=0 NULL_VALUE value + */ + protobuf.NullValue = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NULL_VALUE"] = 0; + return values; + })(); + + protobuf.ListValue = (function() { + + /** + * Properties of a ListValue. + * @memberof google.protobuf + * @interface IListValue + * @property {Array.|null} [values] ListValue values + */ + + /** + * Constructs a new ListValue. + * @memberof google.protobuf + * @classdesc Represents a ListValue. + * @implements IListValue + * @constructor + * @param {google.protobuf.IListValue=} [properties] Properties to set + */ + function ListValue(properties) { + this.values = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListValue values. + * @member {Array.} values + * @memberof google.protobuf.ListValue + * @instance + */ + ListValue.prototype.values = $util.emptyArray; + + /** + * Creates a new ListValue instance using the specified properties. + * @function create + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.IListValue=} [properties] Properties to set + * @returns {google.protobuf.ListValue} ListValue instance + */ + ListValue.create = function create(properties) { + return new ListValue(properties); + }; + + /** + * Encodes the specified ListValue message. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.IListValue} message ListValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.values != null && message.values.length) + for (var i = 0; i < message.values.length; ++i) + $root.google.protobuf.Value.encode(message.values[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ListValue message, length delimited. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.IListValue} message ListValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ListValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ListValue} ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListValue.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ListValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.values && message.values.length)) + message.values = []; + message.values.push($root.google.protobuf.Value.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ListValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ListValue} ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListValue message. + * @function verify + * @memberof google.protobuf.ListValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.values != null && message.hasOwnProperty("values")) { + if (!Array.isArray(message.values)) + return "values: array expected"; + for (var i = 0; i < message.values.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.values[i]); + if (error) + return "values." + error; + } + } + return null; + }; + + /** + * Creates a ListValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ListValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ListValue} ListValue + */ + ListValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ListValue) + return object; + var message = new $root.google.protobuf.ListValue(); + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.protobuf.ListValue.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) { + if (typeof object.values[i] !== "object") + throw TypeError(".google.protobuf.ListValue.values: object expected"); + message.values[i] = $root.google.protobuf.Value.fromObject(object.values[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ListValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.ListValue} message ListValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.values = []; + if (message.values && message.values.length) { + object.values = []; + for (var j = 0; j < message.values.length; ++j) + object.values[j] = $root.google.protobuf.Value.toObject(message.values[j], options); + } + return object; + }; + + /** + * Converts this ListValue to JSON. + * @function toJSON + * @memberof google.protobuf.ListValue + * @instance + * @returns {Object.} JSON object + */ + ListValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListValue + * @function getTypeUrl + * @memberof google.protobuf.ListValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ListValue"; + }; + + return ListValue; + })(); + + return protobuf; + })(); + + google.longrunning = (function() { + + /** + * Namespace longrunning. + * @memberof google + * @namespace + */ + var longrunning = {}; + + longrunning.Operations = (function() { + + /** + * Constructs a new Operations service. + * @memberof google.longrunning + * @classdesc Represents an Operations + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Operations(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Operations.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Operations; + + /** + * Creates new Operations service using the specified rpc implementation. + * @function create + * @memberof google.longrunning.Operations + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Operations} RPC service. Useful where requests and/or responses are streamed. + */ + Operations.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.longrunning.Operations|listOperations}. + * @memberof google.longrunning.Operations + * @typedef ListOperationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.ListOperationsResponse} [response] ListOperationsResponse + */ + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @param {google.longrunning.Operations.ListOperationsCallback} callback Node-style callback called with the error, if any, and ListOperationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.listOperations = function listOperations(request, callback) { + return this.rpcCall(listOperations, $root.google.longrunning.ListOperationsRequest, $root.google.longrunning.ListOperationsResponse, request, callback); + }, "name", { value: "ListOperations" }); + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|getOperation}. + * @memberof google.longrunning.Operations + * @typedef GetOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @param {google.longrunning.Operations.GetOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.getOperation = function getOperation(request, callback) { + return this.rpcCall(getOperation, $root.google.longrunning.GetOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "GetOperation" }); + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. + * @memberof google.longrunning.Operations + * @typedef DeleteOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @param {google.longrunning.Operations.DeleteOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.deleteOperation = function deleteOperation(request, callback) { + return this.rpcCall(deleteOperation, $root.google.longrunning.DeleteOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteOperation" }); + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. + * @memberof google.longrunning.Operations + * @typedef CancelOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @param {google.longrunning.Operations.CancelOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.cancelOperation = function cancelOperation(request, callback) { + return this.rpcCall(cancelOperation, $root.google.longrunning.CancelOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "CancelOperation" }); + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|waitOperation}. + * @memberof google.longrunning.Operations + * @typedef WaitOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @param {google.longrunning.Operations.WaitOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.waitOperation = function waitOperation(request, callback) { + return this.rpcCall(waitOperation, $root.google.longrunning.WaitOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "WaitOperation" }); + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Operations; + })(); + + longrunning.Operation = (function() { + + /** + * Properties of an Operation. + * @memberof google.longrunning + * @interface IOperation + * @property {string|null} [name] Operation name + * @property {google.protobuf.IAny|null} [metadata] Operation metadata + * @property {boolean|null} [done] Operation done + * @property {google.rpc.IStatus|null} [error] Operation error + * @property {google.protobuf.IAny|null} [response] Operation response + */ + + /** + * Constructs a new Operation. + * @memberof google.longrunning + * @classdesc Represents an Operation. + * @implements IOperation + * @constructor + * @param {google.longrunning.IOperation=} [properties] Properties to set + */ + function Operation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Operation name. + * @member {string} name + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.name = ""; + + /** + * Operation metadata. + * @member {google.protobuf.IAny|null|undefined} metadata + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.metadata = null; + + /** + * Operation done. + * @member {boolean} done + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.done = false; + + /** + * Operation error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.error = null; + + /** + * Operation response. + * @member {google.protobuf.IAny|null|undefined} response + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.response = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Operation result. + * @member {"error"|"response"|undefined} result + * @memberof google.longrunning.Operation + * @instance + */ + Object.defineProperty(Operation.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["error", "response"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Operation instance using the specified properties. + * @function create + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation=} [properties] Properties to set + * @returns {google.longrunning.Operation} Operation instance + */ + Operation.create = function create(properties) { + return new Operation(properties); + }; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @function encode + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.protobuf.Any.encode(message.metadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.done != null && Object.hasOwnProperty.call(message, "done")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.done); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.response != null && Object.hasOwnProperty.call(message, "response")) + $root.google.protobuf.Any.encode(message.response, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.Operation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.metadata = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } + case 3: { + message.done = reader.bool(); + break; + } + case 4: { + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 5: { + message.response = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Operation message. + * @function verify + * @memberof google.longrunning.Operation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Operation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.protobuf.Any.verify(message.metadata); + if (error) + return "metadata." + error; + } + if (message.done != null && message.hasOwnProperty("done")) + if (typeof message.done !== "boolean") + return "done: boolean expected"; + if (message.error != null && message.hasOwnProperty("error")) { + properties.result = 1; + { + var error = $root.google.rpc.Status.verify(message.error); + if (error) + return "error." + error; + } + } + if (message.response != null && message.hasOwnProperty("response")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.google.protobuf.Any.verify(message.response); + if (error) + return "response." + error; + } + } + return null; + }; + + /** + * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.Operation + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.Operation} Operation + */ + Operation.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.Operation) + return object; + var message = new $root.google.longrunning.Operation(); + if (object.name != null) + message.name = String(object.name); + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.longrunning.Operation.metadata: object expected"); + message.metadata = $root.google.protobuf.Any.fromObject(object.metadata); + } + if (object.done != null) + message.done = Boolean(object.done); + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.longrunning.Operation.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + if (object.response != null) { + if (typeof object.response !== "object") + throw TypeError(".google.longrunning.Operation.response: object expected"); + message.response = $root.google.protobuf.Any.fromObject(object.response); + } + return message; + }; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.Operation} message Operation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Operation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.metadata = null; + object.done = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.protobuf.Any.toObject(message.metadata, options); + if (message.done != null && message.hasOwnProperty("done")) + object.done = message.done; + if (message.error != null && message.hasOwnProperty("error")) { + object.error = $root.google.rpc.Status.toObject(message.error, options); + if (options.oneofs) + object.result = "error"; + } + if (message.response != null && message.hasOwnProperty("response")) { + object.response = $root.google.protobuf.Any.toObject(message.response, options); + if (options.oneofs) + object.result = "response"; + } + return object; + }; + + /** + * Converts this Operation to JSON. + * @function toJSON + * @memberof google.longrunning.Operation + * @instance + * @returns {Object.} JSON object + */ + Operation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Operation + * @function getTypeUrl + * @memberof google.longrunning.Operation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Operation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.Operation"; + }; + + return Operation; + })(); + + longrunning.GetOperationRequest = (function() { + + /** + * Properties of a GetOperationRequest. + * @memberof google.longrunning + * @interface IGetOperationRequest + * @property {string|null} [name] GetOperationRequest name + */ + + /** + * Constructs a new GetOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a GetOperationRequest. + * @implements IGetOperationRequest + * @constructor + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + */ + function GetOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetOperationRequest name. + * @member {string} name + * @memberof google.longrunning.GetOperationRequest + * @instance + */ + GetOperationRequest.prototype.name = ""; + + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest instance + */ + GetOperationRequest.create = function create(properties) { + return new GetOperationRequest(properties); + }; + + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.GetOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetOperationRequest message. + * @function verify + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + */ + GetOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.GetOperationRequest) + return object; + var message = new $root.google.longrunning.GetOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.GetOperationRequest} message GetOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.GetOperationRequest + * @instance + * @returns {Object.} JSON object + */ + GetOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.GetOperationRequest"; + }; + + return GetOperationRequest; + })(); + + longrunning.ListOperationsRequest = (function() { + + /** + * Properties of a ListOperationsRequest. + * @memberof google.longrunning + * @interface IListOperationsRequest + * @property {string|null} [name] ListOperationsRequest name + * @property {string|null} [filter] ListOperationsRequest filter + * @property {number|null} [pageSize] ListOperationsRequest pageSize + * @property {string|null} [pageToken] ListOperationsRequest pageToken + */ + + /** + * Constructs a new ListOperationsRequest. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsRequest. + * @implements IListOperationsRequest + * @constructor + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + */ + function ListOperationsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOperationsRequest name. + * @member {string} name + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.name = ""; + + /** + * ListOperationsRequest filter. + * @member {string} filter + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.filter = ""; + + /** + * ListOperationsRequest pageSize. + * @member {number} pageSize + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageSize = 0; + + /** + * ListOperationsRequest pageToken. + * @member {string} pageToken + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest instance + */ + ListOperationsRequest.create = function create(properties) { + return new ListOperationsRequest(properties); + }; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); + return writer; + }; + + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 4: { + message.name = reader.string(); + break; + } + case 1: { + message.filter = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOperationsRequest message. + * @function verify + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOperationsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + */ + ListOperationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.ListOperationsRequest) + return object; + var message = new $root.google.longrunning.ListOperationsRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.ListOperationsRequest} message ListOperationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOperationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + object.name = ""; + } + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this ListOperationsRequest to JSON. + * @function toJSON + * @memberof google.longrunning.ListOperationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListOperationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOperationsRequest + * @function getTypeUrl + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOperationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.ListOperationsRequest"; + }; + + return ListOperationsRequest; + })(); + + longrunning.ListOperationsResponse = (function() { + + /** + * Properties of a ListOperationsResponse. + * @memberof google.longrunning + * @interface IListOperationsResponse + * @property {Array.|null} [operations] ListOperationsResponse operations + * @property {string|null} [nextPageToken] ListOperationsResponse nextPageToken + */ + + /** + * Constructs a new ListOperationsResponse. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsResponse. + * @implements IListOperationsResponse + * @constructor + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + */ + function ListOperationsResponse(properties) { + this.operations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOperationsResponse operations. + * @member {Array.} operations + * @memberof google.longrunning.ListOperationsResponse + * @instance + */ + ListOperationsResponse.prototype.operations = $util.emptyArray; + + /** + * ListOperationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.longrunning.ListOperationsResponse + * @instance + */ + ListOperationsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @function create + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse instance + */ + ListOperationsResponse.create = function create(properties) { + return new ListOperationsResponse(properties); + }; + + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @function encode + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.operations != null && message.operations.length) + for (var i = 0; i < message.operations.length; ++i) + $root.google.longrunning.Operation.encode(message.operations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.operations && message.operations.length)) + message.operations = []; + message.operations.push($root.google.longrunning.Operation.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOperationsResponse message. + * @function verify + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOperationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.operations != null && message.hasOwnProperty("operations")) { + if (!Array.isArray(message.operations)) + return "operations: array expected"; + for (var i = 0; i < message.operations.length; ++i) { + var error = $root.google.longrunning.Operation.verify(message.operations[i]); + if (error) + return "operations." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + */ + ListOperationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.ListOperationsResponse) + return object; + var message = new $root.google.longrunning.ListOperationsResponse(); + if (object.operations) { + if (!Array.isArray(object.operations)) + throw TypeError(".google.longrunning.ListOperationsResponse.operations: array expected"); + message.operations = []; + for (var i = 0; i < object.operations.length; ++i) { + if (typeof object.operations[i] !== "object") + throw TypeError(".google.longrunning.ListOperationsResponse.operations: object expected"); + message.operations[i] = $root.google.longrunning.Operation.fromObject(object.operations[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.ListOperationsResponse} message ListOperationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOperationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.operations = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.operations && message.operations.length) { + object.operations = []; + for (var j = 0; j < message.operations.length; ++j) + object.operations[j] = $root.google.longrunning.Operation.toObject(message.operations[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListOperationsResponse to JSON. + * @function toJSON + * @memberof google.longrunning.ListOperationsResponse + * @instance + * @returns {Object.} JSON object + */ + ListOperationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOperationsResponse + * @function getTypeUrl + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOperationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.ListOperationsResponse"; + }; + + return ListOperationsResponse; + })(); + + longrunning.CancelOperationRequest = (function() { + + /** + * Properties of a CancelOperationRequest. + * @memberof google.longrunning + * @interface ICancelOperationRequest + * @property {string|null} [name] CancelOperationRequest name + */ + + /** + * Constructs a new CancelOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a CancelOperationRequest. + * @implements ICancelOperationRequest + * @constructor + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + */ + function CancelOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CancelOperationRequest name. + * @member {string} name + * @memberof google.longrunning.CancelOperationRequest + * @instance + */ + CancelOperationRequest.prototype.name = ""; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest instance + */ + CancelOperationRequest.create = function create(properties) { + return new CancelOperationRequest(properties); + }; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelOperationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.CancelOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CancelOperationRequest message. + * @function verify + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CancelOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + */ + CancelOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.CancelOperationRequest) + return object; + var message = new $root.google.longrunning.CancelOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.CancelOperationRequest} message CancelOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CancelOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this CancelOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.CancelOperationRequest + * @instance + * @returns {Object.} JSON object + */ + CancelOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CancelOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CancelOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.CancelOperationRequest"; + }; + + return CancelOperationRequest; + })(); + + longrunning.DeleteOperationRequest = (function() { + + /** + * Properties of a DeleteOperationRequest. + * @memberof google.longrunning + * @interface IDeleteOperationRequest + * @property {string|null} [name] DeleteOperationRequest name + */ + + /** + * Constructs a new DeleteOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a DeleteOperationRequest. + * @implements IDeleteOperationRequest + * @constructor + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set + */ + function DeleteOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteOperationRequest name. + * @member {string} name + * @memberof google.longrunning.DeleteOperationRequest + * @instance + */ + DeleteOperationRequest.prototype.name = ""; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest instance + */ + DeleteOperationRequest.create = function create(properties) { + return new DeleteOperationRequest(properties); + }; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.DeleteOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteOperationRequest message. + * @function verify + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + */ + DeleteOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.DeleteOperationRequest) + return object; + var message = new $root.google.longrunning.DeleteOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.DeleteOperationRequest} message DeleteOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.DeleteOperationRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.DeleteOperationRequest"; + }; + + return DeleteOperationRequest; + })(); + + longrunning.WaitOperationRequest = (function() { + + /** + * Properties of a WaitOperationRequest. + * @memberof google.longrunning + * @interface IWaitOperationRequest + * @property {string|null} [name] WaitOperationRequest name + * @property {google.protobuf.IDuration|null} [timeout] WaitOperationRequest timeout + */ + + /** + * Constructs a new WaitOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a WaitOperationRequest. + * @implements IWaitOperationRequest + * @constructor + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set + */ + function WaitOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WaitOperationRequest name. + * @member {string} name + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.name = ""; + + /** + * WaitOperationRequest timeout. + * @member {google.protobuf.IDuration|null|undefined} timeout + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.timeout = null; + + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest instance + */ + WaitOperationRequest.create = function create(properties) { + return new WaitOperationRequest(properties); + }; + + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) + $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitOperationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.WaitOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WaitOperationRequest message. + * @function verify + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WaitOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.timeout != null && message.hasOwnProperty("timeout")) { + var error = $root.google.protobuf.Duration.verify(message.timeout); + if (error) + return "timeout." + error; + } + return null; + }; + + /** + * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + */ + WaitOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.WaitOperationRequest) + return object; + var message = new $root.google.longrunning.WaitOperationRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.timeout != null) { + if (typeof object.timeout !== "object") + throw TypeError(".google.longrunning.WaitOperationRequest.timeout: object expected"); + message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); + } + return message; + }; + + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.WaitOperationRequest} message WaitOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WaitOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.timeout = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.timeout != null && message.hasOwnProperty("timeout")) + object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); + return object; + }; + + /** + * Converts this WaitOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.WaitOperationRequest + * @instance + * @returns {Object.} JSON object + */ + WaitOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WaitOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WaitOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.WaitOperationRequest"; + }; + + return WaitOperationRequest; + })(); + + longrunning.OperationInfo = (function() { + + /** + * Properties of an OperationInfo. + * @memberof google.longrunning + * @interface IOperationInfo + * @property {string|null} [responseType] OperationInfo responseType + * @property {string|null} [metadataType] OperationInfo metadataType + */ + + /** + * Constructs a new OperationInfo. + * @memberof google.longrunning + * @classdesc Represents an OperationInfo. + * @implements IOperationInfo + * @constructor + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + */ + function OperationInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OperationInfo responseType. + * @member {string} responseType + * @memberof google.longrunning.OperationInfo + * @instance + */ + OperationInfo.prototype.responseType = ""; + + /** + * OperationInfo metadataType. + * @member {string} metadataType + * @memberof google.longrunning.OperationInfo + * @instance + */ + OperationInfo.prototype.metadataType = ""; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @function create + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + * @returns {google.longrunning.OperationInfo} OperationInfo instance + */ + OperationInfo.create = function create(properties) { + return new OperationInfo(properties); + }; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @function encode + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.responseType != null && Object.hasOwnProperty.call(message, "responseType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseType); + if (message.metadataType != null && Object.hasOwnProperty.call(message, "metadataType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.metadataType); + return writer; + }; + + /** + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.OperationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.OperationInfo} OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.OperationInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.responseType = reader.string(); + break; + } + case 2: { + message.metadataType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.OperationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.OperationInfo} OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationInfo message. + * @function verify + * @memberof google.longrunning.OperationInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.responseType != null && message.hasOwnProperty("responseType")) + if (!$util.isString(message.responseType)) + return "responseType: string expected"; + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + if (!$util.isString(message.metadataType)) + return "metadataType: string expected"; + return null; + }; + + /** + * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.OperationInfo + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.OperationInfo} OperationInfo + */ + OperationInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.OperationInfo) + return object; + var message = new $root.google.longrunning.OperationInfo(); + if (object.responseType != null) + message.responseType = String(object.responseType); + if (object.metadataType != null) + message.metadataType = String(object.metadataType); + return message; + }; + + /** + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.OperationInfo} message OperationInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.responseType = ""; + object.metadataType = ""; + } + if (message.responseType != null && message.hasOwnProperty("responseType")) + object.responseType = message.responseType; + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + object.metadataType = message.metadataType; + return object; + }; + + /** + * Converts this OperationInfo to JSON. + * @function toJSON + * @memberof google.longrunning.OperationInfo + * @instance + * @returns {Object.} JSON object + */ + OperationInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OperationInfo + * @function getTypeUrl + * @memberof google.longrunning.OperationInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OperationInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.OperationInfo"; + }; + + return OperationInfo; + })(); + + return longrunning; + })(); + + google.rpc = (function() { + + /** + * Namespace rpc. + * @memberof google + * @namespace + */ + var rpc = {}; + + rpc.Status = (function() { + + /** + * Properties of a Status. + * @memberof google.rpc + * @interface IStatus + * @property {number|null} [code] Status code + * @property {string|null} [message] Status message + * @property {Array.|null} [details] Status details + */ + + /** + * Constructs a new Status. + * @memberof google.rpc + * @classdesc Represents a Status. + * @implements IStatus + * @constructor + * @param {google.rpc.IStatus=} [properties] Properties to set + */ + function Status(properties) { + this.details = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Status code. + * @member {number} code + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.code = 0; + + /** + * Status message. + * @member {string} message + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.message = ""; + + /** + * Status details. + * @member {Array.} details + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.details = $util.emptyArray; + + /** + * Creates a new Status instance using the specified properties. + * @function create + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus=} [properties] Properties to set + * @returns {google.rpc.Status} Status instance + */ + Status.create = function create(properties) { + return new Status(properties); + }; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encode + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); + if (message.details != null && message.details.length) + for (var i = 0; i < message.details.length; ++i) + $root.google.protobuf.Any.encode(message.details[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encodeDelimited + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Status message from the specified reader or buffer. + * @function decode + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.rpc.Status(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.code = reader.int32(); + break; + } + case 2: { + message.message = reader.string(); + break; + } + case 3: { + if (!(message.details && message.details.length)) + message.details = []; + message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Status message. + * @function verify + * @memberof google.rpc.Status + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Status.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + if (!$util.isInteger(message.code)) + return "code: integer expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.details != null && message.hasOwnProperty("details")) { + if (!Array.isArray(message.details)) + return "details: array expected"; + for (var i = 0; i < message.details.length; ++i) { + var error = $root.google.protobuf.Any.verify(message.details[i]); + if (error) + return "details." + error; + } + } + return null; + }; + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.rpc.Status + * @static + * @param {Object.} object Plain object + * @returns {google.rpc.Status} Status + */ + Status.fromObject = function fromObject(object) { + if (object instanceof $root.google.rpc.Status) + return object; + var message = new $root.google.rpc.Status(); + if (object.code != null) + message.code = object.code | 0; + if (object.message != null) + message.message = String(object.message); + if (object.details) { + if (!Array.isArray(object.details)) + throw TypeError(".google.rpc.Status.details: array expected"); + message.details = []; + for (var i = 0; i < object.details.length; ++i) { + if (typeof object.details[i] !== "object") + throw TypeError(".google.rpc.Status.details: object expected"); + message.details[i] = $root.google.protobuf.Any.fromObject(object.details[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @function toObject + * @memberof google.rpc.Status + * @static + * @param {google.rpc.Status} message Status + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Status.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.details = []; + if (options.defaults) { + object.code = 0; + object.message = ""; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = message.code; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.details && message.details.length) { + object.details = []; + for (var j = 0; j < message.details.length; ++j) + object.details[j] = $root.google.protobuf.Any.toObject(message.details[j], options); + } + return object; + }; + + /** + * Converts this Status to JSON. + * @function toJSON + * @memberof google.rpc.Status + * @instance + * @returns {Object.} JSON object + */ + Status.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Status + * @function getTypeUrl + * @memberof google.rpc.Status + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Status.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.rpc.Status"; + }; + + return Status; + })(); + + return rpc; + })(); + + google.iam = (function() { + + /** + * Namespace iam. + * @memberof google + * @namespace + */ + var iam = {}; + + iam.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.iam + * @namespace + */ + var v1 = {}; + + v1.IAMPolicy = (function() { + + /** + * Constructs a new IAMPolicy service. + * @memberof google.iam.v1 + * @classdesc Represents a IAMPolicy + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function IAMPolicy(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (IAMPolicy.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = IAMPolicy; + + /** + * Creates new IAMPolicy service using the specified rpc implementation. + * @function create + * @memberof google.iam.v1.IAMPolicy + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {IAMPolicy} RPC service. Useful where requests and/or responses are streamed. + */ + IAMPolicy.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.iam.v1.IAMPolicy|setIamPolicy}. + * @memberof google.iam.v1.IAMPolicy + * @typedef SetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.iam.v1.IAMPolicy + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @param {google.iam.v1.IAMPolicy.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(IAMPolicy.prototype.setIamPolicy = function setIamPolicy(request, callback) { + return this.rpcCall(setIamPolicy, $root.google.iam.v1.SetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "SetIamPolicy" }); + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.iam.v1.IAMPolicy + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.iam.v1.IAMPolicy|getIamPolicy}. + * @memberof google.iam.v1.IAMPolicy + * @typedef GetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.iam.v1.IAMPolicy + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @param {google.iam.v1.IAMPolicy.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(IAMPolicy.prototype.getIamPolicy = function getIamPolicy(request, callback) { + return this.rpcCall(getIamPolicy, $root.google.iam.v1.GetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "GetIamPolicy" }); + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.iam.v1.IAMPolicy + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.iam.v1.IAMPolicy|testIamPermissions}. + * @memberof google.iam.v1.IAMPolicy + * @typedef TestIamPermissionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.TestIamPermissionsResponse} [response] TestIamPermissionsResponse + */ + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.iam.v1.IAMPolicy + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @param {google.iam.v1.IAMPolicy.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(IAMPolicy.prototype.testIamPermissions = function testIamPermissions(request, callback) { + return this.rpcCall(testIamPermissions, $root.google.iam.v1.TestIamPermissionsRequest, $root.google.iam.v1.TestIamPermissionsResponse, request, callback); + }, "name", { value: "TestIamPermissions" }); + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.iam.v1.IAMPolicy + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return IAMPolicy; + })(); + + v1.SetIamPolicyRequest = (function() { + + /** + * Properties of a SetIamPolicyRequest. + * @memberof google.iam.v1 + * @interface ISetIamPolicyRequest + * @property {string|null} [resource] SetIamPolicyRequest resource + * @property {google.iam.v1.IPolicy|null} [policy] SetIamPolicyRequest policy + * @property {google.protobuf.IFieldMask|null} [updateMask] SetIamPolicyRequest updateMask + */ + + /** + * Constructs a new SetIamPolicyRequest. + * @memberof google.iam.v1 + * @classdesc Represents a SetIamPolicyRequest. + * @implements ISetIamPolicyRequest + * @constructor + * @param {google.iam.v1.ISetIamPolicyRequest=} [properties] Properties to set + */ + function SetIamPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SetIamPolicyRequest resource. + * @member {string} resource + * @memberof google.iam.v1.SetIamPolicyRequest + * @instance + */ + SetIamPolicyRequest.prototype.resource = ""; + + /** + * SetIamPolicyRequest policy. + * @member {google.iam.v1.IPolicy|null|undefined} policy + * @memberof google.iam.v1.SetIamPolicyRequest + * @instance + */ + SetIamPolicyRequest.prototype.policy = null; + + /** + * SetIamPolicyRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.iam.v1.SetIamPolicyRequest + * @instance + */ + SetIamPolicyRequest.prototype.updateMask = null; + + /** + * Creates a new SetIamPolicyRequest instance using the specified properties. + * @function create + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {google.iam.v1.ISetIamPolicyRequest=} [properties] Properties to set + * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest instance + */ + SetIamPolicyRequest.create = function create(properties) { + return new SetIamPolicyRequest(properties); + }; + + /** + * Encodes the specified SetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {google.iam.v1.ISetIamPolicyRequest} message SetIamPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetIamPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); + if (message.policy != null && Object.hasOwnProperty.call(message, "policy")) + $root.google.iam.v1.Policy.encode(message.policy, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {google.iam.v1.ISetIamPolicyRequest} message SetIamPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetIamPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetIamPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetIamPolicyRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.SetIamPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.resource = reader.string(); + break; + } + case 2: { + message.policy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetIamPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetIamPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetIamPolicyRequest message. + * @function verify + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetIamPolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.policy != null && message.hasOwnProperty("policy")) { + var error = $root.google.iam.v1.Policy.verify(message.policy); + if (error) + return "policy." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates a SetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest + */ + SetIamPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.SetIamPolicyRequest) + return object; + var message = new $root.google.iam.v1.SetIamPolicyRequest(); + if (object.resource != null) + message.resource = String(object.resource); + if (object.policy != null) { + if (typeof object.policy !== "object") + throw TypeError(".google.iam.v1.SetIamPolicyRequest.policy: object expected"); + message.policy = $root.google.iam.v1.Policy.fromObject(object.policy); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.iam.v1.SetIamPolicyRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from a SetIamPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {google.iam.v1.SetIamPolicyRequest} message SetIamPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetIamPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.resource = ""; + object.policy = null; + object.updateMask = null; + } + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.policy != null && message.hasOwnProperty("policy")) + object.policy = $root.google.iam.v1.Policy.toObject(message.policy, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this SetIamPolicyRequest to JSON. + * @function toJSON + * @memberof google.iam.v1.SetIamPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + SetIamPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SetIamPolicyRequest + * @function getTypeUrl + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SetIamPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.SetIamPolicyRequest"; + }; + + return SetIamPolicyRequest; + })(); + + v1.GetIamPolicyRequest = (function() { + + /** + * Properties of a GetIamPolicyRequest. + * @memberof google.iam.v1 + * @interface IGetIamPolicyRequest + * @property {string|null} [resource] GetIamPolicyRequest resource + * @property {google.iam.v1.IGetPolicyOptions|null} [options] GetIamPolicyRequest options + */ + + /** + * Constructs a new GetIamPolicyRequest. + * @memberof google.iam.v1 + * @classdesc Represents a GetIamPolicyRequest. + * @implements IGetIamPolicyRequest + * @constructor + * @param {google.iam.v1.IGetIamPolicyRequest=} [properties] Properties to set + */ + function GetIamPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIamPolicyRequest resource. + * @member {string} resource + * @memberof google.iam.v1.GetIamPolicyRequest + * @instance + */ + GetIamPolicyRequest.prototype.resource = ""; + + /** + * GetIamPolicyRequest options. + * @member {google.iam.v1.IGetPolicyOptions|null|undefined} options + * @memberof google.iam.v1.GetIamPolicyRequest + * @instance + */ + GetIamPolicyRequest.prototype.options = null; + + /** + * Creates a new GetIamPolicyRequest instance using the specified properties. + * @function create + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {google.iam.v1.IGetIamPolicyRequest=} [properties] Properties to set + * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest instance + */ + GetIamPolicyRequest.create = function create(properties) { + return new GetIamPolicyRequest(properties); + }; + + /** + * Encodes the specified GetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {google.iam.v1.IGetIamPolicyRequest} message GetIamPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIamPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.iam.v1.GetPolicyOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {google.iam.v1.IGetIamPolicyRequest} message GetIamPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIamPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIamPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIamPolicyRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.GetIamPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.resource = reader.string(); + break; + } + case 2: { + message.options = $root.google.iam.v1.GetPolicyOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIamPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIamPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIamPolicyRequest message. + * @function verify + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIamPolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.iam.v1.GetPolicyOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates a GetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest + */ + GetIamPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.GetIamPolicyRequest) + return object; + var message = new $root.google.iam.v1.GetIamPolicyRequest(); + if (object.resource != null) + message.resource = String(object.resource); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.iam.v1.GetIamPolicyRequest.options: object expected"); + message.options = $root.google.iam.v1.GetPolicyOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from a GetIamPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {google.iam.v1.GetIamPolicyRequest} message GetIamPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIamPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.resource = ""; + object.options = null; + } + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.iam.v1.GetPolicyOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this GetIamPolicyRequest to JSON. + * @function toJSON + * @memberof google.iam.v1.GetIamPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + GetIamPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetIamPolicyRequest + * @function getTypeUrl + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetIamPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.GetIamPolicyRequest"; + }; + + return GetIamPolicyRequest; + })(); + + v1.TestIamPermissionsRequest = (function() { + + /** + * Properties of a TestIamPermissionsRequest. + * @memberof google.iam.v1 + * @interface ITestIamPermissionsRequest + * @property {string|null} [resource] TestIamPermissionsRequest resource + * @property {Array.|null} [permissions] TestIamPermissionsRequest permissions + */ + + /** + * Constructs a new TestIamPermissionsRequest. + * @memberof google.iam.v1 + * @classdesc Represents a TestIamPermissionsRequest. + * @implements ITestIamPermissionsRequest + * @constructor + * @param {google.iam.v1.ITestIamPermissionsRequest=} [properties] Properties to set + */ + function TestIamPermissionsRequest(properties) { + this.permissions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TestIamPermissionsRequest resource. + * @member {string} resource + * @memberof google.iam.v1.TestIamPermissionsRequest + * @instance + */ + TestIamPermissionsRequest.prototype.resource = ""; + + /** + * TestIamPermissionsRequest permissions. + * @member {Array.} permissions + * @memberof google.iam.v1.TestIamPermissionsRequest + * @instance + */ + TestIamPermissionsRequest.prototype.permissions = $util.emptyArray; + + /** + * Creates a new TestIamPermissionsRequest instance using the specified properties. + * @function create + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {google.iam.v1.ITestIamPermissionsRequest=} [properties] Properties to set + * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest instance + */ + TestIamPermissionsRequest.create = function create(properties) { + return new TestIamPermissionsRequest(properties); + }; + + /** + * Encodes the specified TestIamPermissionsRequest message. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {google.iam.v1.ITestIamPermissionsRequest} message TestIamPermissionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestIamPermissionsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); + if (message.permissions != null && message.permissions.length) + for (var i = 0; i < message.permissions.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.permissions[i]); + return writer; + }; + + /** + * Encodes the specified TestIamPermissionsRequest message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {google.iam.v1.ITestIamPermissionsRequest} message TestIamPermissionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestIamPermissionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TestIamPermissionsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestIamPermissionsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.TestIamPermissionsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.resource = reader.string(); + break; + } + case 2: { + if (!(message.permissions && message.permissions.length)) + message.permissions = []; + message.permissions.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TestIamPermissionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestIamPermissionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TestIamPermissionsRequest message. + * @function verify + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TestIamPermissionsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.permissions != null && message.hasOwnProperty("permissions")) { + if (!Array.isArray(message.permissions)) + return "permissions: array expected"; + for (var i = 0; i < message.permissions.length; ++i) + if (!$util.isString(message.permissions[i])) + return "permissions: string[] expected"; + } + return null; + }; + + /** + * Creates a TestIamPermissionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest + */ + TestIamPermissionsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.TestIamPermissionsRequest) + return object; + var message = new $root.google.iam.v1.TestIamPermissionsRequest(); + if (object.resource != null) + message.resource = String(object.resource); + if (object.permissions) { + if (!Array.isArray(object.permissions)) + throw TypeError(".google.iam.v1.TestIamPermissionsRequest.permissions: array expected"); + message.permissions = []; + for (var i = 0; i < object.permissions.length; ++i) + message.permissions[i] = String(object.permissions[i]); + } + return message; + }; + + /** + * Creates a plain object from a TestIamPermissionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {google.iam.v1.TestIamPermissionsRequest} message TestIamPermissionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TestIamPermissionsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.permissions = []; + if (options.defaults) + object.resource = ""; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.permissions && message.permissions.length) { + object.permissions = []; + for (var j = 0; j < message.permissions.length; ++j) + object.permissions[j] = message.permissions[j]; + } + return object; + }; + + /** + * Converts this TestIamPermissionsRequest to JSON. + * @function toJSON + * @memberof google.iam.v1.TestIamPermissionsRequest + * @instance + * @returns {Object.} JSON object + */ + TestIamPermissionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TestIamPermissionsRequest + * @function getTypeUrl + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TestIamPermissionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.TestIamPermissionsRequest"; + }; + + return TestIamPermissionsRequest; + })(); + + v1.TestIamPermissionsResponse = (function() { + + /** + * Properties of a TestIamPermissionsResponse. + * @memberof google.iam.v1 + * @interface ITestIamPermissionsResponse + * @property {Array.|null} [permissions] TestIamPermissionsResponse permissions + */ + + /** + * Constructs a new TestIamPermissionsResponse. + * @memberof google.iam.v1 + * @classdesc Represents a TestIamPermissionsResponse. + * @implements ITestIamPermissionsResponse + * @constructor + * @param {google.iam.v1.ITestIamPermissionsResponse=} [properties] Properties to set + */ + function TestIamPermissionsResponse(properties) { + this.permissions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TestIamPermissionsResponse permissions. + * @member {Array.} permissions + * @memberof google.iam.v1.TestIamPermissionsResponse + * @instance + */ + TestIamPermissionsResponse.prototype.permissions = $util.emptyArray; + + /** + * Creates a new TestIamPermissionsResponse instance using the specified properties. + * @function create + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {google.iam.v1.ITestIamPermissionsResponse=} [properties] Properties to set + * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse instance + */ + TestIamPermissionsResponse.create = function create(properties) { + return new TestIamPermissionsResponse(properties); + }; + + /** + * Encodes the specified TestIamPermissionsResponse message. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {google.iam.v1.ITestIamPermissionsResponse} message TestIamPermissionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestIamPermissionsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.permissions != null && message.permissions.length) + for (var i = 0; i < message.permissions.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.permissions[i]); + return writer; + }; + + /** + * Encodes the specified TestIamPermissionsResponse message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {google.iam.v1.ITestIamPermissionsResponse} message TestIamPermissionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestIamPermissionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TestIamPermissionsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestIamPermissionsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.TestIamPermissionsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.permissions && message.permissions.length)) + message.permissions = []; + message.permissions.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TestIamPermissionsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestIamPermissionsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TestIamPermissionsResponse message. + * @function verify + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TestIamPermissionsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.permissions != null && message.hasOwnProperty("permissions")) { + if (!Array.isArray(message.permissions)) + return "permissions: array expected"; + for (var i = 0; i < message.permissions.length; ++i) + if (!$util.isString(message.permissions[i])) + return "permissions: string[] expected"; + } + return null; + }; + + /** + * Creates a TestIamPermissionsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse + */ + TestIamPermissionsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.TestIamPermissionsResponse) + return object; + var message = new $root.google.iam.v1.TestIamPermissionsResponse(); + if (object.permissions) { + if (!Array.isArray(object.permissions)) + throw TypeError(".google.iam.v1.TestIamPermissionsResponse.permissions: array expected"); + message.permissions = []; + for (var i = 0; i < object.permissions.length; ++i) + message.permissions[i] = String(object.permissions[i]); + } + return message; + }; + + /** + * Creates a plain object from a TestIamPermissionsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {google.iam.v1.TestIamPermissionsResponse} message TestIamPermissionsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TestIamPermissionsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.permissions = []; + if (message.permissions && message.permissions.length) { + object.permissions = []; + for (var j = 0; j < message.permissions.length; ++j) + object.permissions[j] = message.permissions[j]; + } + return object; + }; + + /** + * Converts this TestIamPermissionsResponse to JSON. + * @function toJSON + * @memberof google.iam.v1.TestIamPermissionsResponse + * @instance + * @returns {Object.} JSON object + */ + TestIamPermissionsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TestIamPermissionsResponse + * @function getTypeUrl + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TestIamPermissionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.TestIamPermissionsResponse"; + }; + + return TestIamPermissionsResponse; + })(); + + v1.GetPolicyOptions = (function() { + + /** + * Properties of a GetPolicyOptions. + * @memberof google.iam.v1 + * @interface IGetPolicyOptions + * @property {number|null} [requestedPolicyVersion] GetPolicyOptions requestedPolicyVersion + */ + + /** + * Constructs a new GetPolicyOptions. + * @memberof google.iam.v1 + * @classdesc Represents a GetPolicyOptions. + * @implements IGetPolicyOptions + * @constructor + * @param {google.iam.v1.IGetPolicyOptions=} [properties] Properties to set + */ + function GetPolicyOptions(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetPolicyOptions requestedPolicyVersion. + * @member {number} requestedPolicyVersion + * @memberof google.iam.v1.GetPolicyOptions + * @instance + */ + GetPolicyOptions.prototype.requestedPolicyVersion = 0; + + /** + * Creates a new GetPolicyOptions instance using the specified properties. + * @function create + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {google.iam.v1.IGetPolicyOptions=} [properties] Properties to set + * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions instance + */ + GetPolicyOptions.create = function create(properties) { + return new GetPolicyOptions(properties); + }; + + /** + * Encodes the specified GetPolicyOptions message. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {google.iam.v1.IGetPolicyOptions} message GetPolicyOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPolicyOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestedPolicyVersion != null && Object.hasOwnProperty.call(message, "requestedPolicyVersion")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.requestedPolicyVersion); + return writer; + }; + + /** + * Encodes the specified GetPolicyOptions message, length delimited. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {google.iam.v1.IGetPolicyOptions} message GetPolicyOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPolicyOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetPolicyOptions message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPolicyOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.GetPolicyOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.requestedPolicyVersion = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetPolicyOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPolicyOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetPolicyOptions message. + * @function verify + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetPolicyOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.requestedPolicyVersion != null && message.hasOwnProperty("requestedPolicyVersion")) + if (!$util.isInteger(message.requestedPolicyVersion)) + return "requestedPolicyVersion: integer expected"; + return null; + }; + + /** + * Creates a GetPolicyOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions + */ + GetPolicyOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.GetPolicyOptions) + return object; + var message = new $root.google.iam.v1.GetPolicyOptions(); + if (object.requestedPolicyVersion != null) + message.requestedPolicyVersion = object.requestedPolicyVersion | 0; + return message; + }; + + /** + * Creates a plain object from a GetPolicyOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {google.iam.v1.GetPolicyOptions} message GetPolicyOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetPolicyOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.requestedPolicyVersion = 0; + if (message.requestedPolicyVersion != null && message.hasOwnProperty("requestedPolicyVersion")) + object.requestedPolicyVersion = message.requestedPolicyVersion; + return object; + }; + + /** + * Converts this GetPolicyOptions to JSON. + * @function toJSON + * @memberof google.iam.v1.GetPolicyOptions + * @instance + * @returns {Object.} JSON object + */ + GetPolicyOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetPolicyOptions + * @function getTypeUrl + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetPolicyOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.GetPolicyOptions"; + }; + + return GetPolicyOptions; + })(); + + v1.Policy = (function() { + + /** + * Properties of a Policy. + * @memberof google.iam.v1 + * @interface IPolicy + * @property {number|null} [version] Policy version + * @property {Array.|null} [bindings] Policy bindings + * @property {Array.|null} [auditConfigs] Policy auditConfigs + * @property {Uint8Array|null} [etag] Policy etag + */ + + /** + * Constructs a new Policy. + * @memberof google.iam.v1 + * @classdesc Represents a Policy. + * @implements IPolicy + * @constructor + * @param {google.iam.v1.IPolicy=} [properties] Properties to set + */ + function Policy(properties) { + this.bindings = []; + this.auditConfigs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Policy version. + * @member {number} version + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.version = 0; + + /** + * Policy bindings. + * @member {Array.} bindings + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.bindings = $util.emptyArray; + + /** + * Policy auditConfigs. + * @member {Array.} auditConfigs + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.auditConfigs = $util.emptyArray; + + /** + * Policy etag. + * @member {Uint8Array} etag + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.etag = $util.newBuffer([]); + + /** + * Creates a new Policy instance using the specified properties. + * @function create + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.IPolicy=} [properties] Properties to set + * @returns {google.iam.v1.Policy} Policy instance + */ + Policy.create = function create(properties) { + return new Policy(properties); + }; + + /** + * Encodes the specified Policy message. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.IPolicy} message Policy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Policy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.version); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.etag); + if (message.bindings != null && message.bindings.length) + for (var i = 0; i < message.bindings.length; ++i) + $root.google.iam.v1.Binding.encode(message.bindings[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.auditConfigs != null && message.auditConfigs.length) + for (var i = 0; i < message.auditConfigs.length; ++i) + $root.google.iam.v1.AuditConfig.encode(message.auditConfigs[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Policy message, length delimited. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.IPolicy} message Policy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Policy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Policy message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.Policy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.Policy} Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Policy.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.Policy(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.version = reader.int32(); + break; + } + case 4: { + if (!(message.bindings && message.bindings.length)) + message.bindings = []; + message.bindings.push($root.google.iam.v1.Binding.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.auditConfigs && message.auditConfigs.length)) + message.auditConfigs = []; + message.auditConfigs.push($root.google.iam.v1.AuditConfig.decode(reader, reader.uint32())); + break; + } + case 3: { + message.etag = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Policy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.Policy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.Policy} Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Policy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Policy message. + * @function verify + * @memberof google.iam.v1.Policy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Policy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isInteger(message.version)) + return "version: integer expected"; + if (message.bindings != null && message.hasOwnProperty("bindings")) { + if (!Array.isArray(message.bindings)) + return "bindings: array expected"; + for (var i = 0; i < message.bindings.length; ++i) { + var error = $root.google.iam.v1.Binding.verify(message.bindings[i]); + if (error) + return "bindings." + error; + } + } + if (message.auditConfigs != null && message.hasOwnProperty("auditConfigs")) { + if (!Array.isArray(message.auditConfigs)) + return "auditConfigs: array expected"; + for (var i = 0; i < message.auditConfigs.length; ++i) { + var error = $root.google.iam.v1.AuditConfig.verify(message.auditConfigs[i]); + if (error) + return "auditConfigs." + error; + } + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!(message.etag && typeof message.etag.length === "number" || $util.isString(message.etag))) + return "etag: buffer expected"; + return null; + }; + + /** + * Creates a Policy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.Policy + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.Policy} Policy + */ + Policy.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.Policy) + return object; + var message = new $root.google.iam.v1.Policy(); + if (object.version != null) + message.version = object.version | 0; + if (object.bindings) { + if (!Array.isArray(object.bindings)) + throw TypeError(".google.iam.v1.Policy.bindings: array expected"); + message.bindings = []; + for (var i = 0; i < object.bindings.length; ++i) { + if (typeof object.bindings[i] !== "object") + throw TypeError(".google.iam.v1.Policy.bindings: object expected"); + message.bindings[i] = $root.google.iam.v1.Binding.fromObject(object.bindings[i]); + } + } + if (object.auditConfigs) { + if (!Array.isArray(object.auditConfigs)) + throw TypeError(".google.iam.v1.Policy.auditConfigs: array expected"); + message.auditConfigs = []; + for (var i = 0; i < object.auditConfigs.length; ++i) { + if (typeof object.auditConfigs[i] !== "object") + throw TypeError(".google.iam.v1.Policy.auditConfigs: object expected"); + message.auditConfigs[i] = $root.google.iam.v1.AuditConfig.fromObject(object.auditConfigs[i]); + } + } + if (object.etag != null) + if (typeof object.etag === "string") + $util.base64.decode(object.etag, message.etag = $util.newBuffer($util.base64.length(object.etag)), 0); + else if (object.etag.length >= 0) + message.etag = object.etag; + return message; + }; + + /** + * Creates a plain object from a Policy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.Policy} message Policy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Policy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.bindings = []; + object.auditConfigs = []; + } + if (options.defaults) { + object.version = 0; + if (options.bytes === String) + object.etag = ""; + else { + object.etag = []; + if (options.bytes !== Array) + object.etag = $util.newBuffer(object.etag); + } + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = options.bytes === String ? $util.base64.encode(message.etag, 0, message.etag.length) : options.bytes === Array ? Array.prototype.slice.call(message.etag) : message.etag; + if (message.bindings && message.bindings.length) { + object.bindings = []; + for (var j = 0; j < message.bindings.length; ++j) + object.bindings[j] = $root.google.iam.v1.Binding.toObject(message.bindings[j], options); + } + if (message.auditConfigs && message.auditConfigs.length) { + object.auditConfigs = []; + for (var j = 0; j < message.auditConfigs.length; ++j) + object.auditConfigs[j] = $root.google.iam.v1.AuditConfig.toObject(message.auditConfigs[j], options); + } + return object; + }; + + /** + * Converts this Policy to JSON. + * @function toJSON + * @memberof google.iam.v1.Policy + * @instance + * @returns {Object.} JSON object + */ + Policy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Policy + * @function getTypeUrl + * @memberof google.iam.v1.Policy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Policy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.Policy"; + }; + + return Policy; + })(); + + v1.Binding = (function() { + + /** + * Properties of a Binding. + * @memberof google.iam.v1 + * @interface IBinding + * @property {string|null} [role] Binding role + * @property {Array.|null} [members] Binding members + * @property {google.type.IExpr|null} [condition] Binding condition + */ + + /** + * Constructs a new Binding. + * @memberof google.iam.v1 + * @classdesc Represents a Binding. + * @implements IBinding + * @constructor + * @param {google.iam.v1.IBinding=} [properties] Properties to set + */ + function Binding(properties) { + this.members = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Binding role. + * @member {string} role + * @memberof google.iam.v1.Binding + * @instance + */ + Binding.prototype.role = ""; + + /** + * Binding members. + * @member {Array.} members + * @memberof google.iam.v1.Binding + * @instance + */ + Binding.prototype.members = $util.emptyArray; + + /** + * Binding condition. + * @member {google.type.IExpr|null|undefined} condition + * @memberof google.iam.v1.Binding + * @instance + */ + Binding.prototype.condition = null; + + /** + * Creates a new Binding instance using the specified properties. + * @function create + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.IBinding=} [properties] Properties to set + * @returns {google.iam.v1.Binding} Binding instance + */ + Binding.create = function create(properties) { + return new Binding(properties); + }; + + /** + * Encodes the specified Binding message. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.IBinding} message Binding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Binding.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.role != null && Object.hasOwnProperty.call(message, "role")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.role); + if (message.members != null && message.members.length) + for (var i = 0; i < message.members.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.members[i]); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + $root.google.type.Expr.encode(message.condition, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Binding message, length delimited. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.IBinding} message Binding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Binding.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Binding message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.Binding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.Binding} Binding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Binding.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.Binding(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.role = reader.string(); + break; + } + case 2: { + if (!(message.members && message.members.length)) + message.members = []; + message.members.push(reader.string()); + break; + } + case 3: { + message.condition = $root.google.type.Expr.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Binding message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.Binding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.Binding} Binding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Binding.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Binding message. + * @function verify + * @memberof google.iam.v1.Binding + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Binding.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.role != null && message.hasOwnProperty("role")) + if (!$util.isString(message.role)) + return "role: string expected"; + if (message.members != null && message.hasOwnProperty("members")) { + if (!Array.isArray(message.members)) + return "members: array expected"; + for (var i = 0; i < message.members.length; ++i) + if (!$util.isString(message.members[i])) + return "members: string[] expected"; + } + if (message.condition != null && message.hasOwnProperty("condition")) { + var error = $root.google.type.Expr.verify(message.condition); + if (error) + return "condition." + error; + } + return null; + }; + + /** + * Creates a Binding message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.Binding + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.Binding} Binding + */ + Binding.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.Binding) + return object; + var message = new $root.google.iam.v1.Binding(); + if (object.role != null) + message.role = String(object.role); + if (object.members) { + if (!Array.isArray(object.members)) + throw TypeError(".google.iam.v1.Binding.members: array expected"); + message.members = []; + for (var i = 0; i < object.members.length; ++i) + message.members[i] = String(object.members[i]); + } + if (object.condition != null) { + if (typeof object.condition !== "object") + throw TypeError(".google.iam.v1.Binding.condition: object expected"); + message.condition = $root.google.type.Expr.fromObject(object.condition); + } + return message; + }; + + /** + * Creates a plain object from a Binding message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.Binding} message Binding + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Binding.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.members = []; + if (options.defaults) { + object.role = ""; + object.condition = null; + } + if (message.role != null && message.hasOwnProperty("role")) + object.role = message.role; + if (message.members && message.members.length) { + object.members = []; + for (var j = 0; j < message.members.length; ++j) + object.members[j] = message.members[j]; + } + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = $root.google.type.Expr.toObject(message.condition, options); + return object; + }; + + /** + * Converts this Binding to JSON. + * @function toJSON + * @memberof google.iam.v1.Binding + * @instance + * @returns {Object.} JSON object + */ + Binding.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Binding + * @function getTypeUrl + * @memberof google.iam.v1.Binding + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Binding.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.Binding"; + }; + + return Binding; + })(); + + v1.AuditConfig = (function() { + + /** + * Properties of an AuditConfig. + * @memberof google.iam.v1 + * @interface IAuditConfig + * @property {string|null} [service] AuditConfig service + * @property {Array.|null} [auditLogConfigs] AuditConfig auditLogConfigs + */ + + /** + * Constructs a new AuditConfig. + * @memberof google.iam.v1 + * @classdesc Represents an AuditConfig. + * @implements IAuditConfig + * @constructor + * @param {google.iam.v1.IAuditConfig=} [properties] Properties to set + */ + function AuditConfig(properties) { + this.auditLogConfigs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AuditConfig service. + * @member {string} service + * @memberof google.iam.v1.AuditConfig + * @instance + */ + AuditConfig.prototype.service = ""; + + /** + * AuditConfig auditLogConfigs. + * @member {Array.} auditLogConfigs + * @memberof google.iam.v1.AuditConfig + * @instance + */ + AuditConfig.prototype.auditLogConfigs = $util.emptyArray; + + /** + * Creates a new AuditConfig instance using the specified properties. + * @function create + * @memberof google.iam.v1.AuditConfig + * @static + * @param {google.iam.v1.IAuditConfig=} [properties] Properties to set + * @returns {google.iam.v1.AuditConfig} AuditConfig instance + */ + AuditConfig.create = function create(properties) { + return new AuditConfig(properties); + }; + + /** + * Encodes the specified AuditConfig message. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.AuditConfig + * @static + * @param {google.iam.v1.IAuditConfig} message AuditConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.service != null && Object.hasOwnProperty.call(message, "service")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.service); + if (message.auditLogConfigs != null && message.auditLogConfigs.length) + for (var i = 0; i < message.auditLogConfigs.length; ++i) + $root.google.iam.v1.AuditLogConfig.encode(message.auditLogConfigs[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AuditConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.AuditConfig + * @static + * @param {google.iam.v1.IAuditConfig} message AuditConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuditConfig message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.AuditConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.AuditConfig} AuditConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.AuditConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.service = reader.string(); + break; + } + case 3: { + if (!(message.auditLogConfigs && message.auditLogConfigs.length)) + message.auditLogConfigs = []; + message.auditLogConfigs.push($root.google.iam.v1.AuditLogConfig.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuditConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.AuditConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.AuditConfig} AuditConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuditConfig message. + * @function verify + * @memberof google.iam.v1.AuditConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuditConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.service != null && message.hasOwnProperty("service")) + if (!$util.isString(message.service)) + return "service: string expected"; + if (message.auditLogConfigs != null && message.hasOwnProperty("auditLogConfigs")) { + if (!Array.isArray(message.auditLogConfigs)) + return "auditLogConfigs: array expected"; + for (var i = 0; i < message.auditLogConfigs.length; ++i) { + var error = $root.google.iam.v1.AuditLogConfig.verify(message.auditLogConfigs[i]); + if (error) + return "auditLogConfigs." + error; + } + } + return null; + }; + + /** + * Creates an AuditConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.AuditConfig + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.AuditConfig} AuditConfig + */ + AuditConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.AuditConfig) + return object; + var message = new $root.google.iam.v1.AuditConfig(); + if (object.service != null) + message.service = String(object.service); + if (object.auditLogConfigs) { + if (!Array.isArray(object.auditLogConfigs)) + throw TypeError(".google.iam.v1.AuditConfig.auditLogConfigs: array expected"); + message.auditLogConfigs = []; + for (var i = 0; i < object.auditLogConfigs.length; ++i) { + if (typeof object.auditLogConfigs[i] !== "object") + throw TypeError(".google.iam.v1.AuditConfig.auditLogConfigs: object expected"); + message.auditLogConfigs[i] = $root.google.iam.v1.AuditLogConfig.fromObject(object.auditLogConfigs[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an AuditConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.AuditConfig + * @static + * @param {google.iam.v1.AuditConfig} message AuditConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuditConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.auditLogConfigs = []; + if (options.defaults) + object.service = ""; + if (message.service != null && message.hasOwnProperty("service")) + object.service = message.service; + if (message.auditLogConfigs && message.auditLogConfigs.length) { + object.auditLogConfigs = []; + for (var j = 0; j < message.auditLogConfigs.length; ++j) + object.auditLogConfigs[j] = $root.google.iam.v1.AuditLogConfig.toObject(message.auditLogConfigs[j], options); + } + return object; + }; + + /** + * Converts this AuditConfig to JSON. + * @function toJSON + * @memberof google.iam.v1.AuditConfig + * @instance + * @returns {Object.} JSON object + */ + AuditConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AuditConfig + * @function getTypeUrl + * @memberof google.iam.v1.AuditConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AuditConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.AuditConfig"; + }; + + return AuditConfig; + })(); + + v1.AuditLogConfig = (function() { + + /** + * Properties of an AuditLogConfig. + * @memberof google.iam.v1 + * @interface IAuditLogConfig + * @property {google.iam.v1.AuditLogConfig.LogType|null} [logType] AuditLogConfig logType + * @property {Array.|null} [exemptedMembers] AuditLogConfig exemptedMembers + */ + + /** + * Constructs a new AuditLogConfig. + * @memberof google.iam.v1 + * @classdesc Represents an AuditLogConfig. + * @implements IAuditLogConfig + * @constructor + * @param {google.iam.v1.IAuditLogConfig=} [properties] Properties to set + */ + function AuditLogConfig(properties) { + this.exemptedMembers = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AuditLogConfig logType. + * @member {google.iam.v1.AuditLogConfig.LogType} logType + * @memberof google.iam.v1.AuditLogConfig + * @instance + */ + AuditLogConfig.prototype.logType = 0; + + /** + * AuditLogConfig exemptedMembers. + * @member {Array.} exemptedMembers + * @memberof google.iam.v1.AuditLogConfig + * @instance + */ + AuditLogConfig.prototype.exemptedMembers = $util.emptyArray; + + /** + * Creates a new AuditLogConfig instance using the specified properties. + * @function create + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {google.iam.v1.IAuditLogConfig=} [properties] Properties to set + * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig instance + */ + AuditLogConfig.create = function create(properties) { + return new AuditLogConfig(properties); + }; + + /** + * Encodes the specified AuditLogConfig message. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {google.iam.v1.IAuditLogConfig} message AuditLogConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditLogConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.logType != null && Object.hasOwnProperty.call(message, "logType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.logType); + if (message.exemptedMembers != null && message.exemptedMembers.length) + for (var i = 0; i < message.exemptedMembers.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.exemptedMembers[i]); + return writer; + }; + + /** + * Encodes the specified AuditLogConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {google.iam.v1.IAuditLogConfig} message AuditLogConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditLogConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuditLogConfig message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditLogConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.AuditLogConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.logType = reader.int32(); + break; + } + case 2: { + if (!(message.exemptedMembers && message.exemptedMembers.length)) + message.exemptedMembers = []; + message.exemptedMembers.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuditLogConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditLogConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuditLogConfig message. + * @function verify + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuditLogConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.logType != null && message.hasOwnProperty("logType")) + switch (message.logType) { + default: + return "logType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.exemptedMembers != null && message.hasOwnProperty("exemptedMembers")) { + if (!Array.isArray(message.exemptedMembers)) + return "exemptedMembers: array expected"; + for (var i = 0; i < message.exemptedMembers.length; ++i) + if (!$util.isString(message.exemptedMembers[i])) + return "exemptedMembers: string[] expected"; + } + return null; + }; + + /** + * Creates an AuditLogConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig + */ + AuditLogConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.AuditLogConfig) + return object; + var message = new $root.google.iam.v1.AuditLogConfig(); + switch (object.logType) { + default: + if (typeof object.logType === "number") { + message.logType = object.logType; + break; + } + break; + case "LOG_TYPE_UNSPECIFIED": + case 0: + message.logType = 0; + break; + case "ADMIN_READ": + case 1: + message.logType = 1; + break; + case "DATA_WRITE": + case 2: + message.logType = 2; + break; + case "DATA_READ": + case 3: + message.logType = 3; + break; + } + if (object.exemptedMembers) { + if (!Array.isArray(object.exemptedMembers)) + throw TypeError(".google.iam.v1.AuditLogConfig.exemptedMembers: array expected"); + message.exemptedMembers = []; + for (var i = 0; i < object.exemptedMembers.length; ++i) + message.exemptedMembers[i] = String(object.exemptedMembers[i]); + } + return message; + }; + + /** + * Creates a plain object from an AuditLogConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {google.iam.v1.AuditLogConfig} message AuditLogConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuditLogConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.exemptedMembers = []; + if (options.defaults) + object.logType = options.enums === String ? "LOG_TYPE_UNSPECIFIED" : 0; + if (message.logType != null && message.hasOwnProperty("logType")) + object.logType = options.enums === String ? $root.google.iam.v1.AuditLogConfig.LogType[message.logType] === undefined ? message.logType : $root.google.iam.v1.AuditLogConfig.LogType[message.logType] : message.logType; + if (message.exemptedMembers && message.exemptedMembers.length) { + object.exemptedMembers = []; + for (var j = 0; j < message.exemptedMembers.length; ++j) + object.exemptedMembers[j] = message.exemptedMembers[j]; + } + return object; + }; + + /** + * Converts this AuditLogConfig to JSON. + * @function toJSON + * @memberof google.iam.v1.AuditLogConfig + * @instance + * @returns {Object.} JSON object + */ + AuditLogConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AuditLogConfig + * @function getTypeUrl + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AuditLogConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.AuditLogConfig"; + }; + + /** + * LogType enum. + * @name google.iam.v1.AuditLogConfig.LogType + * @enum {number} + * @property {number} LOG_TYPE_UNSPECIFIED=0 LOG_TYPE_UNSPECIFIED value + * @property {number} ADMIN_READ=1 ADMIN_READ value + * @property {number} DATA_WRITE=2 DATA_WRITE value + * @property {number} DATA_READ=3 DATA_READ value + */ + AuditLogConfig.LogType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LOG_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ADMIN_READ"] = 1; + values[valuesById[2] = "DATA_WRITE"] = 2; + values[valuesById[3] = "DATA_READ"] = 3; + return values; + })(); + + return AuditLogConfig; + })(); + + v1.PolicyDelta = (function() { + + /** + * Properties of a PolicyDelta. + * @memberof google.iam.v1 + * @interface IPolicyDelta + * @property {Array.|null} [bindingDeltas] PolicyDelta bindingDeltas + * @property {Array.|null} [auditConfigDeltas] PolicyDelta auditConfigDeltas + */ + + /** + * Constructs a new PolicyDelta. + * @memberof google.iam.v1 + * @classdesc Represents a PolicyDelta. + * @implements IPolicyDelta + * @constructor + * @param {google.iam.v1.IPolicyDelta=} [properties] Properties to set + */ + function PolicyDelta(properties) { + this.bindingDeltas = []; + this.auditConfigDeltas = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PolicyDelta bindingDeltas. + * @member {Array.} bindingDeltas + * @memberof google.iam.v1.PolicyDelta + * @instance + */ + PolicyDelta.prototype.bindingDeltas = $util.emptyArray; + + /** + * PolicyDelta auditConfigDeltas. + * @member {Array.} auditConfigDeltas + * @memberof google.iam.v1.PolicyDelta + * @instance + */ + PolicyDelta.prototype.auditConfigDeltas = $util.emptyArray; + + /** + * Creates a new PolicyDelta instance using the specified properties. + * @function create + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.IPolicyDelta=} [properties] Properties to set + * @returns {google.iam.v1.PolicyDelta} PolicyDelta instance + */ + PolicyDelta.create = function create(properties) { + return new PolicyDelta(properties); + }; + + /** + * Encodes the specified PolicyDelta message. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.IPolicyDelta} message PolicyDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PolicyDelta.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bindingDeltas != null && message.bindingDeltas.length) + for (var i = 0; i < message.bindingDeltas.length; ++i) + $root.google.iam.v1.BindingDelta.encode(message.bindingDeltas[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.auditConfigDeltas != null && message.auditConfigDeltas.length) + for (var i = 0; i < message.auditConfigDeltas.length; ++i) + $root.google.iam.v1.AuditConfigDelta.encode(message.auditConfigDeltas[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PolicyDelta message, length delimited. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.IPolicyDelta} message PolicyDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PolicyDelta.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PolicyDelta message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.PolicyDelta} PolicyDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PolicyDelta.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.PolicyDelta(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.bindingDeltas && message.bindingDeltas.length)) + message.bindingDeltas = []; + message.bindingDeltas.push($root.google.iam.v1.BindingDelta.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.auditConfigDeltas && message.auditConfigDeltas.length)) + message.auditConfigDeltas = []; + message.auditConfigDeltas.push($root.google.iam.v1.AuditConfigDelta.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PolicyDelta message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.PolicyDelta} PolicyDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PolicyDelta.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PolicyDelta message. + * @function verify + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PolicyDelta.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.bindingDeltas != null && message.hasOwnProperty("bindingDeltas")) { + if (!Array.isArray(message.bindingDeltas)) + return "bindingDeltas: array expected"; + for (var i = 0; i < message.bindingDeltas.length; ++i) { + var error = $root.google.iam.v1.BindingDelta.verify(message.bindingDeltas[i]); + if (error) + return "bindingDeltas." + error; + } + } + if (message.auditConfigDeltas != null && message.hasOwnProperty("auditConfigDeltas")) { + if (!Array.isArray(message.auditConfigDeltas)) + return "auditConfigDeltas: array expected"; + for (var i = 0; i < message.auditConfigDeltas.length; ++i) { + var error = $root.google.iam.v1.AuditConfigDelta.verify(message.auditConfigDeltas[i]); + if (error) + return "auditConfigDeltas." + error; + } + } + return null; + }; + + /** + * Creates a PolicyDelta message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.PolicyDelta} PolicyDelta + */ + PolicyDelta.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.PolicyDelta) + return object; + var message = new $root.google.iam.v1.PolicyDelta(); + if (object.bindingDeltas) { + if (!Array.isArray(object.bindingDeltas)) + throw TypeError(".google.iam.v1.PolicyDelta.bindingDeltas: array expected"); + message.bindingDeltas = []; + for (var i = 0; i < object.bindingDeltas.length; ++i) { + if (typeof object.bindingDeltas[i] !== "object") + throw TypeError(".google.iam.v1.PolicyDelta.bindingDeltas: object expected"); + message.bindingDeltas[i] = $root.google.iam.v1.BindingDelta.fromObject(object.bindingDeltas[i]); + } + } + if (object.auditConfigDeltas) { + if (!Array.isArray(object.auditConfigDeltas)) + throw TypeError(".google.iam.v1.PolicyDelta.auditConfigDeltas: array expected"); + message.auditConfigDeltas = []; + for (var i = 0; i < object.auditConfigDeltas.length; ++i) { + if (typeof object.auditConfigDeltas[i] !== "object") + throw TypeError(".google.iam.v1.PolicyDelta.auditConfigDeltas: object expected"); + message.auditConfigDeltas[i] = $root.google.iam.v1.AuditConfigDelta.fromObject(object.auditConfigDeltas[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a PolicyDelta message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.PolicyDelta} message PolicyDelta + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PolicyDelta.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.bindingDeltas = []; + object.auditConfigDeltas = []; + } + if (message.bindingDeltas && message.bindingDeltas.length) { + object.bindingDeltas = []; + for (var j = 0; j < message.bindingDeltas.length; ++j) + object.bindingDeltas[j] = $root.google.iam.v1.BindingDelta.toObject(message.bindingDeltas[j], options); + } + if (message.auditConfigDeltas && message.auditConfigDeltas.length) { + object.auditConfigDeltas = []; + for (var j = 0; j < message.auditConfigDeltas.length; ++j) + object.auditConfigDeltas[j] = $root.google.iam.v1.AuditConfigDelta.toObject(message.auditConfigDeltas[j], options); + } + return object; + }; + + /** + * Converts this PolicyDelta to JSON. + * @function toJSON + * @memberof google.iam.v1.PolicyDelta + * @instance + * @returns {Object.} JSON object + */ + PolicyDelta.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PolicyDelta + * @function getTypeUrl + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PolicyDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.PolicyDelta"; + }; + + return PolicyDelta; + })(); + + v1.BindingDelta = (function() { + + /** + * Properties of a BindingDelta. + * @memberof google.iam.v1 + * @interface IBindingDelta + * @property {google.iam.v1.BindingDelta.Action|null} [action] BindingDelta action + * @property {string|null} [role] BindingDelta role + * @property {string|null} [member] BindingDelta member + * @property {google.type.IExpr|null} [condition] BindingDelta condition + */ + + /** + * Constructs a new BindingDelta. + * @memberof google.iam.v1 + * @classdesc Represents a BindingDelta. + * @implements IBindingDelta + * @constructor + * @param {google.iam.v1.IBindingDelta=} [properties] Properties to set + */ + function BindingDelta(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BindingDelta action. + * @member {google.iam.v1.BindingDelta.Action} action + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.action = 0; + + /** + * BindingDelta role. + * @member {string} role + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.role = ""; + + /** + * BindingDelta member. + * @member {string} member + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.member = ""; + + /** + * BindingDelta condition. + * @member {google.type.IExpr|null|undefined} condition + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.condition = null; + + /** + * Creates a new BindingDelta instance using the specified properties. + * @function create + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.IBindingDelta=} [properties] Properties to set + * @returns {google.iam.v1.BindingDelta} BindingDelta instance + */ + BindingDelta.create = function create(properties) { + return new BindingDelta(properties); + }; + + /** + * Encodes the specified BindingDelta message. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.IBindingDelta} message BindingDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BindingDelta.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); + if (message.role != null && Object.hasOwnProperty.call(message, "role")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.role); + if (message.member != null && Object.hasOwnProperty.call(message, "member")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.member); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + $root.google.type.Expr.encode(message.condition, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BindingDelta message, length delimited. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.IBindingDelta} message BindingDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BindingDelta.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BindingDelta message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.BindingDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.BindingDelta} BindingDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BindingDelta.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.BindingDelta(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.action = reader.int32(); + break; + } + case 2: { + message.role = reader.string(); + break; + } + case 3: { + message.member = reader.string(); + break; + } + case 4: { + message.condition = $root.google.type.Expr.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BindingDelta message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.BindingDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.BindingDelta} BindingDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BindingDelta.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BindingDelta message. + * @function verify + * @memberof google.iam.v1.BindingDelta + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BindingDelta.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.action != null && message.hasOwnProperty("action")) + switch (message.action) { + default: + return "action: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.role != null && message.hasOwnProperty("role")) + if (!$util.isString(message.role)) + return "role: string expected"; + if (message.member != null && message.hasOwnProperty("member")) + if (!$util.isString(message.member)) + return "member: string expected"; + if (message.condition != null && message.hasOwnProperty("condition")) { + var error = $root.google.type.Expr.verify(message.condition); + if (error) + return "condition." + error; + } + return null; + }; + + /** + * Creates a BindingDelta message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.BindingDelta + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.BindingDelta} BindingDelta + */ + BindingDelta.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.BindingDelta) + return object; + var message = new $root.google.iam.v1.BindingDelta(); + switch (object.action) { + default: + if (typeof object.action === "number") { + message.action = object.action; + break; + } + break; + case "ACTION_UNSPECIFIED": + case 0: + message.action = 0; + break; + case "ADD": + case 1: + message.action = 1; + break; + case "REMOVE": + case 2: + message.action = 2; + break; + } + if (object.role != null) + message.role = String(object.role); + if (object.member != null) + message.member = String(object.member); + if (object.condition != null) { + if (typeof object.condition !== "object") + throw TypeError(".google.iam.v1.BindingDelta.condition: object expected"); + message.condition = $root.google.type.Expr.fromObject(object.condition); + } + return message; + }; + + /** + * Creates a plain object from a BindingDelta message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.BindingDelta} message BindingDelta + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BindingDelta.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.action = options.enums === String ? "ACTION_UNSPECIFIED" : 0; + object.role = ""; + object.member = ""; + object.condition = null; + } + if (message.action != null && message.hasOwnProperty("action")) + object.action = options.enums === String ? $root.google.iam.v1.BindingDelta.Action[message.action] === undefined ? message.action : $root.google.iam.v1.BindingDelta.Action[message.action] : message.action; + if (message.role != null && message.hasOwnProperty("role")) + object.role = message.role; + if (message.member != null && message.hasOwnProperty("member")) + object.member = message.member; + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = $root.google.type.Expr.toObject(message.condition, options); + return object; + }; + + /** + * Converts this BindingDelta to JSON. + * @function toJSON + * @memberof google.iam.v1.BindingDelta + * @instance + * @returns {Object.} JSON object + */ + BindingDelta.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BindingDelta + * @function getTypeUrl + * @memberof google.iam.v1.BindingDelta + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BindingDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.BindingDelta"; + }; + + /** + * Action enum. + * @name google.iam.v1.BindingDelta.Action + * @enum {number} + * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value + * @property {number} ADD=1 ADD value + * @property {number} REMOVE=2 REMOVE value + */ + BindingDelta.Action = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "ADD"] = 1; + values[valuesById[2] = "REMOVE"] = 2; + return values; + })(); + + return BindingDelta; + })(); + + v1.AuditConfigDelta = (function() { + + /** + * Properties of an AuditConfigDelta. + * @memberof google.iam.v1 + * @interface IAuditConfigDelta + * @property {google.iam.v1.AuditConfigDelta.Action|null} [action] AuditConfigDelta action + * @property {string|null} [service] AuditConfigDelta service + * @property {string|null} [exemptedMember] AuditConfigDelta exemptedMember + * @property {string|null} [logType] AuditConfigDelta logType + */ + + /** + * Constructs a new AuditConfigDelta. + * @memberof google.iam.v1 + * @classdesc Represents an AuditConfigDelta. + * @implements IAuditConfigDelta + * @constructor + * @param {google.iam.v1.IAuditConfigDelta=} [properties] Properties to set + */ + function AuditConfigDelta(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AuditConfigDelta action. + * @member {google.iam.v1.AuditConfigDelta.Action} action + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.action = 0; + + /** + * AuditConfigDelta service. + * @member {string} service + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.service = ""; + + /** + * AuditConfigDelta exemptedMember. + * @member {string} exemptedMember + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.exemptedMember = ""; + + /** + * AuditConfigDelta logType. + * @member {string} logType + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.logType = ""; + + /** + * Creates a new AuditConfigDelta instance using the specified properties. + * @function create + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.IAuditConfigDelta=} [properties] Properties to set + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta instance + */ + AuditConfigDelta.create = function create(properties) { + return new AuditConfigDelta(properties); + }; + + /** + * Encodes the specified AuditConfigDelta message. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.IAuditConfigDelta} message AuditConfigDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfigDelta.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); + if (message.service != null && Object.hasOwnProperty.call(message, "service")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.service); + if (message.exemptedMember != null && Object.hasOwnProperty.call(message, "exemptedMember")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.exemptedMember); + if (message.logType != null && Object.hasOwnProperty.call(message, "logType")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.logType); + return writer; + }; + + /** + * Encodes the specified AuditConfigDelta message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.IAuditConfigDelta} message AuditConfigDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfigDelta.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfigDelta.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.AuditConfigDelta(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.action = reader.int32(); + break; + } + case 2: { + message.service = reader.string(); + break; + } + case 3: { + message.exemptedMember = reader.string(); + break; + } + case 4: { + message.logType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfigDelta.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuditConfigDelta message. + * @function verify + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuditConfigDelta.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.action != null && message.hasOwnProperty("action")) + switch (message.action) { + default: + return "action: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.service != null && message.hasOwnProperty("service")) + if (!$util.isString(message.service)) + return "service: string expected"; + if (message.exemptedMember != null && message.hasOwnProperty("exemptedMember")) + if (!$util.isString(message.exemptedMember)) + return "exemptedMember: string expected"; + if (message.logType != null && message.hasOwnProperty("logType")) + if (!$util.isString(message.logType)) + return "logType: string expected"; + return null; + }; + + /** + * Creates an AuditConfigDelta message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta + */ + AuditConfigDelta.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.AuditConfigDelta) + return object; + var message = new $root.google.iam.v1.AuditConfigDelta(); + switch (object.action) { + default: + if (typeof object.action === "number") { + message.action = object.action; + break; + } + break; + case "ACTION_UNSPECIFIED": + case 0: + message.action = 0; + break; + case "ADD": + case 1: + message.action = 1; + break; + case "REMOVE": + case 2: + message.action = 2; + break; + } + if (object.service != null) + message.service = String(object.service); + if (object.exemptedMember != null) + message.exemptedMember = String(object.exemptedMember); + if (object.logType != null) + message.logType = String(object.logType); + return message; + }; + + /** + * Creates a plain object from an AuditConfigDelta message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.AuditConfigDelta} message AuditConfigDelta + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuditConfigDelta.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.action = options.enums === String ? "ACTION_UNSPECIFIED" : 0; + object.service = ""; + object.exemptedMember = ""; + object.logType = ""; + } + if (message.action != null && message.hasOwnProperty("action")) + object.action = options.enums === String ? $root.google.iam.v1.AuditConfigDelta.Action[message.action] === undefined ? message.action : $root.google.iam.v1.AuditConfigDelta.Action[message.action] : message.action; + if (message.service != null && message.hasOwnProperty("service")) + object.service = message.service; + if (message.exemptedMember != null && message.hasOwnProperty("exemptedMember")) + object.exemptedMember = message.exemptedMember; + if (message.logType != null && message.hasOwnProperty("logType")) + object.logType = message.logType; + return object; + }; + + /** + * Converts this AuditConfigDelta to JSON. + * @function toJSON + * @memberof google.iam.v1.AuditConfigDelta + * @instance + * @returns {Object.} JSON object + */ + AuditConfigDelta.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AuditConfigDelta + * @function getTypeUrl + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AuditConfigDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.AuditConfigDelta"; + }; + + /** + * Action enum. + * @name google.iam.v1.AuditConfigDelta.Action + * @enum {number} + * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value + * @property {number} ADD=1 ADD value + * @property {number} REMOVE=2 REMOVE value + */ + AuditConfigDelta.Action = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "ADD"] = 1; + values[valuesById[2] = "REMOVE"] = 2; + return values; + })(); + + return AuditConfigDelta; + })(); + + return v1; + })(); + + return iam; + })(); + + google.type = (function() { + + /** + * Namespace type. + * @memberof google + * @namespace + */ + var type = {}; + + type.Expr = (function() { + + /** + * Properties of an Expr. + * @memberof google.type + * @interface IExpr + * @property {string|null} [expression] Expr expression + * @property {string|null} [title] Expr title + * @property {string|null} [description] Expr description + * @property {string|null} [location] Expr location + */ + + /** + * Constructs a new Expr. + * @memberof google.type + * @classdesc Represents an Expr. + * @implements IExpr + * @constructor + * @param {google.type.IExpr=} [properties] Properties to set + */ + function Expr(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Expr expression. + * @member {string} expression + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.expression = ""; + + /** + * Expr title. + * @member {string} title + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.title = ""; + + /** + * Expr description. + * @member {string} description + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.description = ""; + + /** + * Expr location. + * @member {string} location + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.location = ""; + + /** + * Creates a new Expr instance using the specified properties. + * @function create + * @memberof google.type.Expr + * @static + * @param {google.type.IExpr=} [properties] Properties to set + * @returns {google.type.Expr} Expr instance + */ + Expr.create = function create(properties) { + return new Expr(properties); + }; + + /** + * Encodes the specified Expr message. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @function encode + * @memberof google.type.Expr + * @static + * @param {google.type.IExpr} message Expr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Expr.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.expression != null && Object.hasOwnProperty.call(message, "expression")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.expression); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.title); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.location); + return writer; + }; + + /** + * Encodes the specified Expr message, length delimited. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @function encodeDelimited + * @memberof google.type.Expr + * @static + * @param {google.type.IExpr} message Expr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Expr.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Expr message from the specified reader or buffer. + * @function decode + * @memberof google.type.Expr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.type.Expr} Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Expr.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.Expr(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.expression = reader.string(); + break; + } + case 2: { + message.title = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + message.location = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Expr message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.type.Expr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.type.Expr} Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Expr.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Expr message. + * @function verify + * @memberof google.type.Expr + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Expr.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.expression != null && message.hasOwnProperty("expression")) + if (!$util.isString(message.expression)) + return "expression: string expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + return null; + }; + + /** + * Creates an Expr message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.type.Expr + * @static + * @param {Object.} object Plain object + * @returns {google.type.Expr} Expr + */ + Expr.fromObject = function fromObject(object) { + if (object instanceof $root.google.type.Expr) + return object; + var message = new $root.google.type.Expr(); + if (object.expression != null) + message.expression = String(object.expression); + if (object.title != null) + message.title = String(object.title); + if (object.description != null) + message.description = String(object.description); + if (object.location != null) + message.location = String(object.location); + return message; + }; + + /** + * Creates a plain object from an Expr message. Also converts values to other types if specified. + * @function toObject + * @memberof google.type.Expr + * @static + * @param {google.type.Expr} message Expr + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Expr.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.expression = ""; + object.title = ""; + object.description = ""; + object.location = ""; + } + if (message.expression != null && message.hasOwnProperty("expression")) + object.expression = message.expression; + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this Expr to JSON. + * @function toJSON + * @memberof google.type.Expr + * @instance + * @returns {Object.} JSON object + */ + Expr.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Expr + * @function getTypeUrl + * @memberof google.type.Expr + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Expr.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.type.Expr"; + }; + + return Expr; + })(); + + return type; + })(); + + return google; + })(); + + return $root; +}); diff --git a/owl-bot-staging/executor/v1/protos/protos.json b/owl-bot-staging/executor/v1/protos/protos.json new file mode 100644 index 000000000..43bf0a679 --- /dev/null +++ b/owl-bot-staging/executor/v1/protos/protos.json @@ -0,0 +1,10772 @@ +{ + "nested": { + "google": { + "nested": { + "spanner": { + "nested": { + "admin": { + "nested": { + "database": { + "nested": { + "v1": { + "options": { + "csharp_namespace": "Google.Cloud.Spanner.Admin.Database.V1", + "go_package": "cloud.google.com/go/spanner/admin/database/apiv1/databasepb;databasepb", + "java_multiple_files": true, + "java_outer_classname": "SpannerDatabaseAdminProto", + "java_package": "com.google.spanner.admin.database.v1", + "php_namespace": "Google\\Cloud\\Spanner\\Admin\\Database\\V1", + "ruby_package": "Google::Cloud::Spanner::Admin::Database::V1", + "(google.api.resource_definition).type": "spanner.googleapis.com/InstancePartition", + "(google.api.resource_definition).pattern": "projects/{project}/instances/{instance}/instancePartitions/{instance_partition}" + }, + "nested": { + "Backup": { + "options": { + "(google.api.resource).type": "spanner.googleapis.com/Backup", + "(google.api.resource).pattern": "projects/{project}/instances/{instance}/backups/{backup}" + }, + "fields": { + "database": { + "type": "string", + "id": 2, + "options": { + "(google.api.resource_reference).type": "spanner.googleapis.com/Database" + } + }, + "versionTime": { + "type": "google.protobuf.Timestamp", + "id": 9 + }, + "expireTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + }, + "name": { + "type": "string", + "id": 1 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "sizeBytes": { + "type": "int64", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "freeableSizeBytes": { + "type": "int64", + "id": 15, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "exclusiveSizeBytes": { + "type": "int64", + "id": 16, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "State", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "referencingDatabases": { + "rule": "repeated", + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "spanner.googleapis.com/Database" + } + }, + "encryptionInfo": { + "type": "EncryptionInfo", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "encryptionInformation": { + "rule": "repeated", + "type": "EncryptionInfo", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "databaseDialect": { + "type": "DatabaseDialect", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "referencingBackups": { + "rule": "repeated", + "type": "string", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "spanner.googleapis.com/Backup" + } + }, + "maxExpireTime": { + "type": "google.protobuf.Timestamp", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "backupSchedules": { + "rule": "repeated", + "type": "string", + "id": 14, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "spanner.googleapis.com/BackupSchedule" + } + }, + "incrementalBackupChainId": { + "type": "string", + "id": 17, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "oldestVersionTime": { + "type": "google.protobuf.Timestamp", + "id": 18, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "instancePartitions": { + "rule": "repeated", + "type": "BackupInstancePartition", + "id": 19, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "CREATING": 1, + "READY": 2 + } + } + } + }, + "CreateBackupRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/Instance" + } + }, + "backupId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "backup": { + "type": "Backup", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "encryptionConfig": { + "type": "CreateBackupEncryptionConfig", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "CreateBackupMetadata": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "spanner.googleapis.com/Backup" + } + }, + "database": { + "type": "string", + "id": 2, + "options": { + "(google.api.resource_reference).type": "spanner.googleapis.com/Database" + } + }, + "progress": { + "type": "OperationProgress", + "id": 3 + }, + "cancelTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + } + } + }, + "CopyBackupRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/Instance" + } + }, + "backupId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "sourceBackup": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/Backup" + } + }, + "expireTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "encryptionConfig": { + "type": "CopyBackupEncryptionConfig", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "CopyBackupMetadata": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "spanner.googleapis.com/Backup" + } + }, + "sourceBackup": { + "type": "string", + "id": 2, + "options": { + "(google.api.resource_reference).type": "spanner.googleapis.com/Backup" + } + }, + "progress": { + "type": "OperationProgress", + "id": 3 + }, + "cancelTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + } + } + }, + "UpdateBackupRequest": { + "fields": { + "backup": { + "type": "Backup", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetBackupRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/Backup" + } + } + } + }, + "DeleteBackupRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/Backup" + } + } + } + }, + "ListBackupsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/Instance" + } + }, + "filter": { + "type": "string", + "id": 2 + }, + "pageSize": { + "type": "int32", + "id": 3 + }, + "pageToken": { + "type": "string", + "id": 4 + } + } + }, + "ListBackupsResponse": { + "fields": { + "backups": { + "rule": "repeated", + "type": "Backup", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "ListBackupOperationsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/Instance" + } + }, + "filter": { + "type": "string", + "id": 2 + }, + "pageSize": { + "type": "int32", + "id": 3 + }, + "pageToken": { + "type": "string", + "id": 4 + } + } + }, + "ListBackupOperationsResponse": { + "fields": { + "operations": { + "rule": "repeated", + "type": "google.longrunning.Operation", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "BackupInfo": { + "fields": { + "backup": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "spanner.googleapis.com/Backup" + } + }, + "versionTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "sourceDatabase": { + "type": "string", + "id": 3, + "options": { + "(google.api.resource_reference).type": "spanner.googleapis.com/Database" + } + } + } + }, + "CreateBackupEncryptionConfig": { + "fields": { + "encryptionType": { + "type": "EncryptionType", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "kmsKeyName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" + } + }, + "kmsKeyNames": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" + } + } + }, + "nested": { + "EncryptionType": { + "values": { + "ENCRYPTION_TYPE_UNSPECIFIED": 0, + "USE_DATABASE_ENCRYPTION": 1, + "GOOGLE_DEFAULT_ENCRYPTION": 2, + "CUSTOMER_MANAGED_ENCRYPTION": 3 + } + } + } + }, + "CopyBackupEncryptionConfig": { + "fields": { + "encryptionType": { + "type": "EncryptionType", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "kmsKeyName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" + } + }, + "kmsKeyNames": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" + } + } + }, + "nested": { + "EncryptionType": { + "values": { + "ENCRYPTION_TYPE_UNSPECIFIED": 0, + "USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION": 1, + "GOOGLE_DEFAULT_ENCRYPTION": 2, + "CUSTOMER_MANAGED_ENCRYPTION": 3 + } + } + } + }, + "FullBackupSpec": { + "fields": {} + }, + "IncrementalBackupSpec": { + "fields": {} + }, + "BackupInstancePartition": { + "fields": { + "instancePartition": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "spanner.googleapis.com/InstancePartition" + } + } + } + }, + "OperationProgress": { + "fields": { + "progressPercent": { + "type": "int32", + "id": 1 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + } + } + }, + "EncryptionConfig": { + "fields": { + "kmsKeyName": { + "type": "string", + "id": 2, + "options": { + "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" + } + }, + "kmsKeyNames": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" + } + } + } + }, + "EncryptionInfo": { + "fields": { + "encryptionType": { + "type": "Type", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "encryptionStatus": { + "type": "google.rpc.Status", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "kmsKeyVersion": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKeyVersion" + } + } + }, + "nested": { + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "GOOGLE_DEFAULT_ENCRYPTION": 1, + "CUSTOMER_MANAGED_ENCRYPTION": 2 + } + } + } + }, + "DatabaseDialect": { + "values": { + "DATABASE_DIALECT_UNSPECIFIED": 0, + "GOOGLE_STANDARD_SQL": 1, + "POSTGRESQL": 2 + } + }, + "BackupScheduleSpec": { + "oneofs": { + "scheduleSpec": { + "oneof": [ + "cronSpec" + ] + } + }, + "fields": { + "cronSpec": { + "type": "CrontabSpec", + "id": 1 + } + } + }, + "BackupSchedule": { + "options": { + "(google.api.resource).type": "spanner.googleapis.com/BackupSchedule", + "(google.api.resource).pattern": "projects/{project}/instances/{instance}/databases/{database}/backupSchedules/{schedule}", + "(google.api.resource).plural": "backupSchedules", + "(google.api.resource).singular": "backupSchedule" + }, + "oneofs": { + "backupTypeSpec": { + "oneof": [ + "fullBackupSpec", + "incrementalBackupSpec" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "spec": { + "type": "BackupScheduleSpec", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "retentionDuration": { + "type": "google.protobuf.Duration", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "encryptionConfig": { + "type": "CreateBackupEncryptionConfig", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "fullBackupSpec": { + "type": "FullBackupSpec", + "id": 7 + }, + "incrementalBackupSpec": { + "type": "IncrementalBackupSpec", + "id": 8 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "CrontabSpec": { + "fields": { + "text": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "timeZone": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "creationWindow": { + "type": "google.protobuf.Duration", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "CreateBackupScheduleRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/Database" + } + }, + "backupScheduleId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "backupSchedule": { + "type": "BackupSchedule", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetBackupScheduleRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/BackupSchedule" + } + } + } + }, + "DeleteBackupScheduleRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/BackupSchedule" + } + } + } + }, + "ListBackupSchedulesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/Database" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListBackupSchedulesResponse": { + "fields": { + "backupSchedules": { + "rule": "repeated", + "type": "BackupSchedule", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "UpdateBackupScheduleRequest": { + "fields": { + "backupSchedule": { + "type": "BackupSchedule", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DatabaseAdmin": { + "options": { + "(google.api.default_host)": "spanner.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/spanner.admin" + }, + "methods": { + "ListDatabases": { + "requestType": "ListDatabasesRequest", + "responseType": "ListDatabasesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/instances/*}/databases", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/instances/*}/databases" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "CreateDatabase": { + "requestType": "CreateDatabaseRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/instances/*}/databases", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent,create_statement", + "(google.longrunning.operation_info).response_type": "google.spanner.admin.database.v1.Database", + "(google.longrunning.operation_info).metadata_type": "google.spanner.admin.database.v1.CreateDatabaseMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/instances/*}/databases", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent,create_statement" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.spanner.admin.database.v1.Database", + "metadata_type": "google.spanner.admin.database.v1.CreateDatabaseMetadata" + } + } + ] + }, + "GetDatabase": { + "requestType": "GetDatabaseRequest", + "responseType": "Database", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/instances/*/databases/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/instances/*/databases/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateDatabase": { + "requestType": "UpdateDatabaseRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{database.name=projects/*/instances/*/databases/*}", + "(google.api.http).body": "database", + "(google.api.method_signature)": "database,update_mask", + "(google.longrunning.operation_info).response_type": "Database", + "(google.longrunning.operation_info).metadata_type": "UpdateDatabaseMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{database.name=projects/*/instances/*/databases/*}", + "body": "database" + } + }, + { + "(google.api.method_signature)": "database,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Database", + "metadata_type": "UpdateDatabaseMetadata" + } + } + ] + }, + "UpdateDatabaseDdl": { + "requestType": "UpdateDatabaseDdlRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{database=projects/*/instances/*/databases/*}/ddl", + "(google.api.http).body": "*", + "(google.api.method_signature)": "database,statements", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{database=projects/*/instances/*/databases/*}/ddl", + "body": "*" + } + }, + { + "(google.api.method_signature)": "database,statements" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata" + } + } + ] + }, + "DropDatabase": { + "requestType": "DropDatabaseRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{database=projects/*/instances/*/databases/*}", + "(google.api.method_signature)": "database" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{database=projects/*/instances/*/databases/*}" + } + }, + { + "(google.api.method_signature)": "database" + } + ] + }, + "GetDatabaseDdl": { + "requestType": "GetDatabaseDdlRequest", + "responseType": "GetDatabaseDdlResponse", + "options": { + "(google.api.http).get": "/v1/{database=projects/*/instances/*/databases/*}/ddl", + "(google.api.method_signature)": "database" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{database=projects/*/instances/*/databases/*}/ddl" + } + }, + { + "(google.api.method_signature)": "database" + } + ] + }, + "SetIamPolicy": { + "requestType": "google.iam.v1.SetIamPolicyRequest", + "responseType": "google.iam.v1.Policy", + "options": { + "(google.api.http).post": "/v1/{resource=projects/*/instances/*/databases/*}:setIamPolicy", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1/{resource=projects/*/instances/*/databases/*/backupSchedules/*}:setIamPolicy", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "resource,policy" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{resource=projects/*/instances/*/databases/*}:setIamPolicy", + "body": "*", + "additional_bindings": [ + { + "post": "/v1/{resource=projects/*/instances/*/backups/*}:setIamPolicy", + "body": "*" + }, + { + "post": "/v1/{resource=projects/*/instances/*/databases/*/backupSchedules/*}:setIamPolicy", + "body": "*" + } + ] + } + }, + { + "(google.api.method_signature)": "resource,policy" + } + ] + }, + "GetIamPolicy": { + "requestType": "google.iam.v1.GetIamPolicyRequest", + "responseType": "google.iam.v1.Policy", + "options": { + "(google.api.http).post": "/v1/{resource=projects/*/instances/*/databases/*}:getIamPolicy", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1/{resource=projects/*/instances/*/databases/*/backupSchedules/*}:getIamPolicy", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{resource=projects/*/instances/*/databases/*}:getIamPolicy", + "body": "*", + "additional_bindings": [ + { + "post": "/v1/{resource=projects/*/instances/*/backups/*}:getIamPolicy", + "body": "*" + }, + { + "post": "/v1/{resource=projects/*/instances/*/databases/*/backupSchedules/*}:getIamPolicy", + "body": "*" + } + ] + } + }, + { + "(google.api.method_signature)": "resource" + } + ] + }, + "TestIamPermissions": { + "requestType": "google.iam.v1.TestIamPermissionsRequest", + "responseType": "google.iam.v1.TestIamPermissionsResponse", + "options": { + "(google.api.http).post": "/v1/{resource=projects/*/instances/*/databases/*}:testIamPermissions", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1/{resource=projects/*/instances/*/databases/*/databaseRoles/*}:testIamPermissions", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "resource,permissions" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{resource=projects/*/instances/*/databases/*}:testIamPermissions", + "body": "*", + "additional_bindings": [ + { + "post": "/v1/{resource=projects/*/instances/*/backups/*}:testIamPermissions", + "body": "*" + }, + { + "post": "/v1/{resource=projects/*/instances/*/databases/*/backupSchedules/*}:testIamPermissions", + "body": "*" + }, + { + "post": "/v1/{resource=projects/*/instances/*/databases/*/databaseRoles/*}:testIamPermissions", + "body": "*" + } + ] + } + }, + { + "(google.api.method_signature)": "resource,permissions" + } + ] + }, + "CreateBackup": { + "requestType": "CreateBackupRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/instances/*}/backups", + "(google.api.http).body": "backup", + "(google.api.method_signature)": "parent,backup,backup_id", + "(google.longrunning.operation_info).response_type": "google.spanner.admin.database.v1.Backup", + "(google.longrunning.operation_info).metadata_type": "google.spanner.admin.database.v1.CreateBackupMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/instances/*}/backups", + "body": "backup" + } + }, + { + "(google.api.method_signature)": "parent,backup,backup_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.spanner.admin.database.v1.Backup", + "metadata_type": "google.spanner.admin.database.v1.CreateBackupMetadata" + } + } + ] + }, + "CopyBackup": { + "requestType": "CopyBackupRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/instances/*}/backups:copy", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent,backup_id,source_backup,expire_time", + "(google.longrunning.operation_info).response_type": "google.spanner.admin.database.v1.Backup", + "(google.longrunning.operation_info).metadata_type": "google.spanner.admin.database.v1.CopyBackupMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/instances/*}/backups:copy", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent,backup_id,source_backup,expire_time" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.spanner.admin.database.v1.Backup", + "metadata_type": "google.spanner.admin.database.v1.CopyBackupMetadata" + } + } + ] + }, + "GetBackup": { + "requestType": "GetBackupRequest", + "responseType": "Backup", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/instances/*/backups/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/instances/*/backups/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateBackup": { + "requestType": "UpdateBackupRequest", + "responseType": "Backup", + "options": { + "(google.api.http).patch": "/v1/{backup.name=projects/*/instances/*/backups/*}", + "(google.api.http).body": "backup", + "(google.api.method_signature)": "backup,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{backup.name=projects/*/instances/*/backups/*}", + "body": "backup" + } + }, + { + "(google.api.method_signature)": "backup,update_mask" + } + ] + }, + "DeleteBackup": { + "requestType": "DeleteBackupRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/instances/*/backups/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/instances/*/backups/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListBackups": { + "requestType": "ListBackupsRequest", + "responseType": "ListBackupsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/instances/*}/backups", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/instances/*}/backups" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "RestoreDatabase": { + "requestType": "RestoreDatabaseRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/instances/*}/databases:restore", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent,database_id,backup", + "(google.longrunning.operation_info).response_type": "google.spanner.admin.database.v1.Database", + "(google.longrunning.operation_info).metadata_type": "google.spanner.admin.database.v1.RestoreDatabaseMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/instances/*}/databases:restore", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent,database_id,backup" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.spanner.admin.database.v1.Database", + "metadata_type": "google.spanner.admin.database.v1.RestoreDatabaseMetadata" + } + } + ] + }, + "ListDatabaseOperations": { + "requestType": "ListDatabaseOperationsRequest", + "responseType": "ListDatabaseOperationsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/instances/*}/databaseOperations", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/instances/*}/databaseOperations" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "ListBackupOperations": { + "requestType": "ListBackupOperationsRequest", + "responseType": "ListBackupOperationsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/instances/*}/backupOperations", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/instances/*}/backupOperations" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "ListDatabaseRoles": { + "requestType": "ListDatabaseRolesRequest", + "responseType": "ListDatabaseRolesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/instances/*/databases/*}/databaseRoles", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/instances/*/databases/*}/databaseRoles" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "AddSplitPoints": { + "requestType": "AddSplitPointsRequest", + "responseType": "AddSplitPointsResponse", + "options": { + "(google.api.http).post": "/v1/{database=projects/*/instances/*/databases/*}:addSplitPoints", + "(google.api.http).body": "*", + "(google.api.method_signature)": "database,split_points" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{database=projects/*/instances/*/databases/*}:addSplitPoints", + "body": "*" + } + }, + { + "(google.api.method_signature)": "database,split_points" + } + ] + }, + "CreateBackupSchedule": { + "requestType": "CreateBackupScheduleRequest", + "responseType": "BackupSchedule", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/instances/*/databases/*}/backupSchedules", + "(google.api.http).body": "backup_schedule", + "(google.api.method_signature)": "parent,backup_schedule,backup_schedule_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/instances/*/databases/*}/backupSchedules", + "body": "backup_schedule" + } + }, + { + "(google.api.method_signature)": "parent,backup_schedule,backup_schedule_id" + } + ] + }, + "GetBackupSchedule": { + "requestType": "GetBackupScheduleRequest", + "responseType": "BackupSchedule", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/instances/*/databases/*/backupSchedules/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/instances/*/databases/*/backupSchedules/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateBackupSchedule": { + "requestType": "UpdateBackupScheduleRequest", + "responseType": "BackupSchedule", + "options": { + "(google.api.http).patch": "/v1/{backup_schedule.name=projects/*/instances/*/databases/*/backupSchedules/*}", + "(google.api.http).body": "backup_schedule", + "(google.api.method_signature)": "backup_schedule,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{backup_schedule.name=projects/*/instances/*/databases/*/backupSchedules/*}", + "body": "backup_schedule" + } + }, + { + "(google.api.method_signature)": "backup_schedule,update_mask" + } + ] + }, + "DeleteBackupSchedule": { + "requestType": "DeleteBackupScheduleRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/instances/*/databases/*/backupSchedules/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/instances/*/databases/*/backupSchedules/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListBackupSchedules": { + "requestType": "ListBackupSchedulesRequest", + "responseType": "ListBackupSchedulesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/instances/*/databases/*}/backupSchedules", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/instances/*/databases/*}/backupSchedules" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "InternalUpdateGraphOperation": { + "requestType": "InternalUpdateGraphOperationRequest", + "responseType": "InternalUpdateGraphOperationResponse", + "options": { + "(google.api.method_signature)": "database,operation_id" + }, + "parsedOptions": [ + { + "(google.api.method_signature)": "database,operation_id" + } + ] + } + } + }, + "RestoreInfo": { + "oneofs": { + "sourceInfo": { + "oneof": [ + "backupInfo" + ] + } + }, + "fields": { + "sourceType": { + "type": "RestoreSourceType", + "id": 1 + }, + "backupInfo": { + "type": "BackupInfo", + "id": 2 + } + } + }, + "Database": { + "options": { + "(google.api.resource).type": "spanner.googleapis.com/Database", + "(google.api.resource).pattern": "projects/{project}/instances/{instance}/databases/{database}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "state": { + "type": "State", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "restoreInfo": { + "type": "RestoreInfo", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "encryptionConfig": { + "type": "EncryptionConfig", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "encryptionInfo": { + "rule": "repeated", + "type": "EncryptionInfo", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "versionRetentionPeriod": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "earliestVersionTime": { + "type": "google.protobuf.Timestamp", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "defaultLeader": { + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "databaseDialect": { + "type": "DatabaseDialect", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "enableDropProtection": { + "type": "bool", + "id": 11 + }, + "reconciling": { + "type": "bool", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "CREATING": 1, + "READY": 2, + "READY_OPTIMIZING": 3 + } + } + } + }, + "ListDatabasesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/Instance" + } + }, + "pageSize": { + "type": "int32", + "id": 3 + }, + "pageToken": { + "type": "string", + "id": 4 + } + } + }, + "ListDatabasesResponse": { + "fields": { + "databases": { + "rule": "repeated", + "type": "Database", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CreateDatabaseRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/Instance" + } + }, + "createStatement": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "extraStatements": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "encryptionConfig": { + "type": "EncryptionConfig", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "databaseDialect": { + "type": "DatabaseDialect", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "protoDescriptors": { + "type": "bytes", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "CreateDatabaseMetadata": { + "fields": { + "database": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "spanner.googleapis.com/Database" + } + } + } + }, + "GetDatabaseRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/Database" + } + } + } + }, + "UpdateDatabaseRequest": { + "fields": { + "database": { + "type": "Database", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateDatabaseMetadata": { + "fields": { + "request": { + "type": "UpdateDatabaseRequest", + "id": 1 + }, + "progress": { + "type": "OperationProgress", + "id": 2 + }, + "cancelTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + } + } + }, + "UpdateDatabaseDdlRequest": { + "fields": { + "database": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/Database" + } + }, + "statements": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "operationId": { + "type": "string", + "id": 3 + }, + "protoDescriptors": { + "type": "bytes", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "throughputMode": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DdlStatementActionInfo": { + "fields": { + "action": { + "type": "string", + "id": 1 + }, + "entityType": { + "type": "string", + "id": 2 + }, + "entityNames": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "UpdateDatabaseDdlMetadata": { + "fields": { + "database": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "spanner.googleapis.com/Database" + } + }, + "statements": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "commitTimestamps": { + "rule": "repeated", + "type": "google.protobuf.Timestamp", + "id": 3 + }, + "throttled": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "progress": { + "rule": "repeated", + "type": "OperationProgress", + "id": 5 + }, + "actions": { + "rule": "repeated", + "type": "DdlStatementActionInfo", + "id": 6 + } + } + }, + "DropDatabaseRequest": { + "fields": { + "database": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/Database" + } + } + } + }, + "GetDatabaseDdlRequest": { + "fields": { + "database": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/Database" + } + } + } + }, + "GetDatabaseDdlResponse": { + "fields": { + "statements": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "protoDescriptors": { + "type": "bytes", + "id": 2 + } + } + }, + "ListDatabaseOperationsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/Instance" + } + }, + "filter": { + "type": "string", + "id": 2 + }, + "pageSize": { + "type": "int32", + "id": 3 + }, + "pageToken": { + "type": "string", + "id": 4 + } + } + }, + "ListDatabaseOperationsResponse": { + "fields": { + "operations": { + "rule": "repeated", + "type": "google.longrunning.Operation", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "RestoreDatabaseRequest": { + "oneofs": { + "source": { + "oneof": [ + "backup" + ] + } + }, + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/Instance" + } + }, + "databaseId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "backup": { + "type": "string", + "id": 3, + "options": { + "(google.api.resource_reference).type": "spanner.googleapis.com/Backup" + } + }, + "encryptionConfig": { + "type": "RestoreDatabaseEncryptionConfig", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "RestoreDatabaseEncryptionConfig": { + "fields": { + "encryptionType": { + "type": "EncryptionType", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "kmsKeyName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" + } + }, + "kmsKeyNames": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" + } + } + }, + "nested": { + "EncryptionType": { + "values": { + "ENCRYPTION_TYPE_UNSPECIFIED": 0, + "USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION": 1, + "GOOGLE_DEFAULT_ENCRYPTION": 2, + "CUSTOMER_MANAGED_ENCRYPTION": 3 + } + } + } + }, + "RestoreDatabaseMetadata": { + "oneofs": { + "sourceInfo": { + "oneof": [ + "backupInfo" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "spanner.googleapis.com/Database" + } + }, + "sourceType": { + "type": "RestoreSourceType", + "id": 2 + }, + "backupInfo": { + "type": "BackupInfo", + "id": 3 + }, + "progress": { + "type": "OperationProgress", + "id": 4 + }, + "cancelTime": { + "type": "google.protobuf.Timestamp", + "id": 5 + }, + "optimizeDatabaseOperationName": { + "type": "string", + "id": 6 + } + } + }, + "OptimizeRestoredDatabaseMetadata": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "spanner.googleapis.com/Database" + } + }, + "progress": { + "type": "OperationProgress", + "id": 2 + } + } + }, + "RestoreSourceType": { + "values": { + "TYPE_UNSPECIFIED": 0, + "BACKUP": 1 + } + }, + "DatabaseRole": { + "options": { + "(google.api.resource).type": "spanner.googleapis.com/DatabaseRole", + "(google.api.resource).pattern": "projects/{project}/instances/{instance}/databases/{database}/databaseRoles/{role}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListDatabaseRolesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/Database" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListDatabaseRolesResponse": { + "fields": { + "databaseRoles": { + "rule": "repeated", + "type": "DatabaseRole", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "AddSplitPointsRequest": { + "fields": { + "database": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/Database" + } + }, + "splitPoints": { + "rule": "repeated", + "type": "SplitPoints", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "initiator": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "AddSplitPointsResponse": { + "fields": {} + }, + "SplitPoints": { + "fields": { + "table": { + "type": "string", + "id": 1 + }, + "index": { + "type": "string", + "id": 2 + }, + "keys": { + "rule": "repeated", + "type": "Key", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "expireTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "Key": { + "fields": { + "keyParts": { + "type": "google.protobuf.ListValue", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + } + } + }, + "InternalUpdateGraphOperationRequest": { + "fields": { + "database": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/Database" + } + }, + "operationId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "vmIdentityToken": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "progress": { + "type": "double", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "status": { + "type": "google.rpc.Status", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "InternalUpdateGraphOperationResponse": { + "fields": {} + } + } + } + } + }, + "instance": { + "nested": { + "v1": { + "options": { + "csharp_namespace": "Google.Cloud.Spanner.Admin.Instance.V1", + "go_package": "cloud.google.com/go/spanner/admin/instance/apiv1/instancepb;instancepb", + "java_multiple_files": true, + "java_outer_classname": "SpannerInstanceAdminProto", + "java_package": "com.google.spanner.admin.instance.v1", + "php_namespace": "Google\\Cloud\\Spanner\\Admin\\Instance\\V1", + "ruby_package": "Google::Cloud::Spanner::Admin::Instance::V1" + }, + "nested": { + "OperationProgress": { + "fields": { + "progressPercent": { + "type": "int32", + "id": 1 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + } + } + }, + "FulfillmentPeriod": { + "values": { + "FULFILLMENT_PERIOD_UNSPECIFIED": 0, + "FULFILLMENT_PERIOD_NORMAL": 1, + "FULFILLMENT_PERIOD_EXTENDED": 2 + } + }, + "ReplicaSelection": { + "fields": { + "location": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "InstanceAdmin": { + "options": { + "(google.api.default_host)": "spanner.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/spanner.admin" + }, + "methods": { + "ListInstanceConfigs": { + "requestType": "ListInstanceConfigsRequest", + "responseType": "ListInstanceConfigsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*}/instanceConfigs", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*}/instanceConfigs" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetInstanceConfig": { + "requestType": "GetInstanceConfigRequest", + "responseType": "InstanceConfig", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/instanceConfigs/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/instanceConfigs/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateInstanceConfig": { + "requestType": "CreateInstanceConfigRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*}/instanceConfigs", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent,instance_config,instance_config_id", + "(google.longrunning.operation_info).response_type": "google.spanner.admin.instance.v1.InstanceConfig", + "(google.longrunning.operation_info).metadata_type": "google.spanner.admin.instance.v1.CreateInstanceConfigMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*}/instanceConfigs", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent,instance_config,instance_config_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.spanner.admin.instance.v1.InstanceConfig", + "metadata_type": "google.spanner.admin.instance.v1.CreateInstanceConfigMetadata" + } + } + ] + }, + "UpdateInstanceConfig": { + "requestType": "UpdateInstanceConfigRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{instance_config.name=projects/*/instanceConfigs/*}", + "(google.api.http).body": "*", + "(google.api.method_signature)": "instance_config,update_mask", + "(google.longrunning.operation_info).response_type": "google.spanner.admin.instance.v1.InstanceConfig", + "(google.longrunning.operation_info).metadata_type": "google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{instance_config.name=projects/*/instanceConfigs/*}", + "body": "*" + } + }, + { + "(google.api.method_signature)": "instance_config,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.spanner.admin.instance.v1.InstanceConfig", + "metadata_type": "google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata" + } + } + ] + }, + "DeleteInstanceConfig": { + "requestType": "DeleteInstanceConfigRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/instanceConfigs/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/instanceConfigs/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListInstanceConfigOperations": { + "requestType": "ListInstanceConfigOperationsRequest", + "responseType": "ListInstanceConfigOperationsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*}/instanceConfigOperations", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*}/instanceConfigOperations" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "ListInstances": { + "requestType": "ListInstancesRequest", + "responseType": "ListInstancesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*}/instances", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*}/instances" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "ListInstancePartitions": { + "requestType": "ListInstancePartitionsRequest", + "responseType": "ListInstancePartitionsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/instances/*}/instancePartitions", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/instances/*}/instancePartitions" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetInstance": { + "requestType": "GetInstanceRequest", + "responseType": "Instance", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/instances/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/instances/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateInstance": { + "requestType": "CreateInstanceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*}/instances", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent,instance_id,instance", + "(google.longrunning.operation_info).response_type": "google.spanner.admin.instance.v1.Instance", + "(google.longrunning.operation_info).metadata_type": "google.spanner.admin.instance.v1.CreateInstanceMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*}/instances", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent,instance_id,instance" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.spanner.admin.instance.v1.Instance", + "metadata_type": "google.spanner.admin.instance.v1.CreateInstanceMetadata" + } + } + ] + }, + "UpdateInstance": { + "requestType": "UpdateInstanceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{instance.name=projects/*/instances/*}", + "(google.api.http).body": "*", + "(google.api.method_signature)": "instance,field_mask", + "(google.longrunning.operation_info).response_type": "google.spanner.admin.instance.v1.Instance", + "(google.longrunning.operation_info).metadata_type": "google.spanner.admin.instance.v1.UpdateInstanceMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{instance.name=projects/*/instances/*}", + "body": "*" + } + }, + { + "(google.api.method_signature)": "instance,field_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.spanner.admin.instance.v1.Instance", + "metadata_type": "google.spanner.admin.instance.v1.UpdateInstanceMetadata" + } + } + ] + }, + "DeleteInstance": { + "requestType": "DeleteInstanceRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/instances/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/instances/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "SetIamPolicy": { + "requestType": "google.iam.v1.SetIamPolicyRequest", + "responseType": "google.iam.v1.Policy", + "options": { + "(google.api.http).post": "/v1/{resource=projects/*/instances/*}:setIamPolicy", + "(google.api.http).body": "*", + "(google.api.method_signature)": "resource,policy" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{resource=projects/*/instances/*}:setIamPolicy", + "body": "*" + } + }, + { + "(google.api.method_signature)": "resource,policy" + } + ] + }, + "GetIamPolicy": { + "requestType": "google.iam.v1.GetIamPolicyRequest", + "responseType": "google.iam.v1.Policy", + "options": { + "(google.api.http).post": "/v1/{resource=projects/*/instances/*}:getIamPolicy", + "(google.api.http).body": "*", + "(google.api.method_signature)": "resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{resource=projects/*/instances/*}:getIamPolicy", + "body": "*" + } + }, + { + "(google.api.method_signature)": "resource" + } + ] + }, + "TestIamPermissions": { + "requestType": "google.iam.v1.TestIamPermissionsRequest", + "responseType": "google.iam.v1.TestIamPermissionsResponse", + "options": { + "(google.api.http).post": "/v1/{resource=projects/*/instances/*}:testIamPermissions", + "(google.api.http).body": "*", + "(google.api.method_signature)": "resource,permissions" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{resource=projects/*/instances/*}:testIamPermissions", + "body": "*" + } + }, + { + "(google.api.method_signature)": "resource,permissions" + } + ] + }, + "GetInstancePartition": { + "requestType": "GetInstancePartitionRequest", + "responseType": "InstancePartition", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/instances/*/instancePartitions/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/instances/*/instancePartitions/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateInstancePartition": { + "requestType": "CreateInstancePartitionRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/instances/*}/instancePartitions", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent,instance_partition,instance_partition_id", + "(google.longrunning.operation_info).response_type": "google.spanner.admin.instance.v1.InstancePartition", + "(google.longrunning.operation_info).metadata_type": "google.spanner.admin.instance.v1.CreateInstancePartitionMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/instances/*}/instancePartitions", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent,instance_partition,instance_partition_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.spanner.admin.instance.v1.InstancePartition", + "metadata_type": "google.spanner.admin.instance.v1.CreateInstancePartitionMetadata" + } + } + ] + }, + "DeleteInstancePartition": { + "requestType": "DeleteInstancePartitionRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/instances/*/instancePartitions/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/instances/*/instancePartitions/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateInstancePartition": { + "requestType": "UpdateInstancePartitionRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{instance_partition.name=projects/*/instances/*/instancePartitions/*}", + "(google.api.http).body": "*", + "(google.api.method_signature)": "instance_partition,field_mask", + "(google.longrunning.operation_info).response_type": "google.spanner.admin.instance.v1.InstancePartition", + "(google.longrunning.operation_info).metadata_type": "google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{instance_partition.name=projects/*/instances/*/instancePartitions/*}", + "body": "*" + } + }, + { + "(google.api.method_signature)": "instance_partition,field_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.spanner.admin.instance.v1.InstancePartition", + "metadata_type": "google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata" + } + } + ] + }, + "ListInstancePartitionOperations": { + "requestType": "ListInstancePartitionOperationsRequest", + "responseType": "ListInstancePartitionOperationsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/instances/*}/instancePartitionOperations", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/instances/*}/instancePartitionOperations" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "MoveInstance": { + "requestType": "MoveInstanceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/instances/*}:move", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "google.spanner.admin.instance.v1.MoveInstanceResponse", + "(google.longrunning.operation_info).metadata_type": "google.spanner.admin.instance.v1.MoveInstanceMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/instances/*}:move", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.spanner.admin.instance.v1.MoveInstanceResponse", + "metadata_type": "google.spanner.admin.instance.v1.MoveInstanceMetadata" + } + } + ] + } + } + }, + "ReplicaInfo": { + "fields": { + "location": { + "type": "string", + "id": 1 + }, + "type": { + "type": "ReplicaType", + "id": 2 + }, + "defaultLeaderLocation": { + "type": "bool", + "id": 3 + } + }, + "nested": { + "ReplicaType": { + "values": { + "TYPE_UNSPECIFIED": 0, + "READ_WRITE": 1, + "READ_ONLY": 2, + "WITNESS": 3 + } + } + } + }, + "InstanceConfig": { + "options": { + "(google.api.resource).type": "spanner.googleapis.com/InstanceConfig", + "(google.api.resource).pattern": "projects/{project}/instanceConfigs/{instance_config}", + "(google.api.resource).plural": "instanceConfigs", + "(google.api.resource).singular": "instanceConfig" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2 + }, + "configType": { + "type": "Type", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "replicas": { + "rule": "repeated", + "type": "ReplicaInfo", + "id": 3 + }, + "optionalReplicas": { + "rule": "repeated", + "type": "ReplicaInfo", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "baseConfig": { + "type": "string", + "id": 7, + "options": { + "(google.api.resource_reference).type": "spanner.googleapis.com/InstanceConfig" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 8 + }, + "etag": { + "type": "string", + "id": 9 + }, + "leaderOptions": { + "rule": "repeated", + "type": "string", + "id": 4 + }, + "reconciling": { + "type": "bool", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "State", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "freeInstanceAvailability": { + "type": "FreeInstanceAvailability", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "quorumType": { + "type": "QuorumType", + "id": 18, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "storageLimitPerProcessingUnit": { + "type": "int64", + "id": 19, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "GOOGLE_MANAGED": 1, + "USER_MANAGED": 2 + } + }, + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "CREATING": 1, + "READY": 2 + } + }, + "FreeInstanceAvailability": { + "values": { + "FREE_INSTANCE_AVAILABILITY_UNSPECIFIED": 0, + "AVAILABLE": 1, + "UNSUPPORTED": 2, + "DISABLED": 3, + "QUOTA_EXCEEDED": 4 + } + }, + "QuorumType": { + "values": { + "QUORUM_TYPE_UNSPECIFIED": 0, + "REGION": 1, + "DUAL_REGION": 2, + "MULTI_REGION": 3 + } + } + } + }, + "ReplicaComputeCapacity": { + "oneofs": { + "computeCapacity": { + "oneof": [ + "nodeCount", + "processingUnits" + ] + } + }, + "fields": { + "replicaSelection": { + "type": "ReplicaSelection", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "nodeCount": { + "type": "int32", + "id": 2 + }, + "processingUnits": { + "type": "int32", + "id": 3 + } + } + }, + "AutoscalingConfig": { + "fields": { + "autoscalingLimits": { + "type": "AutoscalingLimits", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "autoscalingTargets": { + "type": "AutoscalingTargets", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "asymmetricAutoscalingOptions": { + "rule": "repeated", + "type": "AsymmetricAutoscalingOption", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "AutoscalingLimits": { + "oneofs": { + "minLimit": { + "oneof": [ + "minNodes", + "minProcessingUnits" + ] + }, + "maxLimit": { + "oneof": [ + "maxNodes", + "maxProcessingUnits" + ] + } + }, + "fields": { + "minNodes": { + "type": "int32", + "id": 1 + }, + "minProcessingUnits": { + "type": "int32", + "id": 2 + }, + "maxNodes": { + "type": "int32", + "id": 3 + }, + "maxProcessingUnits": { + "type": "int32", + "id": 4 + } + } + }, + "AutoscalingTargets": { + "fields": { + "highPriorityCpuUtilizationPercent": { + "type": "int32", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "totalCpuUtilizationPercent": { + "type": "int32", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "storageUtilizationPercent": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "AsymmetricAutoscalingOption": { + "fields": { + "replicaSelection": { + "type": "ReplicaSelection", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "overrides": { + "type": "AutoscalingConfigOverrides", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "AutoscalingConfigOverrides": { + "fields": { + "autoscalingLimits": { + "type": "AutoscalingLimits", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "autoscalingTargetHighPriorityCpuUtilizationPercent": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "autoscalingTargetTotalCpuUtilizationPercent": { + "type": "int32", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "disableHighPriorityCpuAutoscaling": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "disableTotalCpuAutoscaling": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + } + } + }, + "Instance": { + "options": { + "(google.api.resource).type": "spanner.googleapis.com/Instance", + "(google.api.resource).pattern": "projects/{project}/instances/{instance}", + "(google.api.resource).plural": "instances", + "(google.api.resource).singular": "instance" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "config": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/InstanceConfig" + } + }, + "displayName": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "nodeCount": { + "type": "int32", + "id": 5 + }, + "processingUnits": { + "type": "int32", + "id": 9 + }, + "replicaComputeCapacity": { + "rule": "repeated", + "type": "ReplicaComputeCapacity", + "id": 19, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "autoscalingConfig": { + "type": "AutoscalingConfig", + "id": 17, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "state": { + "type": "State", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 7 + }, + "instanceType": { + "type": "InstanceType", + "id": 10 + }, + "endpointUris": { + "rule": "repeated", + "type": "string", + "id": 8 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "freeInstanceMetadata": { + "type": "FreeInstanceMetadata", + "id": 13 + }, + "edition": { + "type": "Edition", + "id": 20, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "defaultBackupScheduleType": { + "type": "DefaultBackupScheduleType", + "id": 23, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "CREATING": 1, + "READY": 2 + } + }, + "InstanceType": { + "values": { + "INSTANCE_TYPE_UNSPECIFIED": 0, + "PROVISIONED": 1, + "FREE_INSTANCE": 2 + } + }, + "Edition": { + "values": { + "EDITION_UNSPECIFIED": 0, + "STANDARD": 1, + "ENTERPRISE": 2, + "ENTERPRISE_PLUS": 3 + } + }, + "DefaultBackupScheduleType": { + "values": { + "DEFAULT_BACKUP_SCHEDULE_TYPE_UNSPECIFIED": 0, + "NONE": 1, + "AUTOMATIC": 2 + } + } + } + }, + "ListInstanceConfigsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListInstanceConfigsResponse": { + "fields": { + "instanceConfigs": { + "rule": "repeated", + "type": "InstanceConfig", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetInstanceConfigRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/InstanceConfig" + } + } + } + }, + "CreateInstanceConfigRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" + } + }, + "instanceConfigId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "instanceConfig": { + "type": "InstanceConfig", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "validateOnly": { + "type": "bool", + "id": 4 + } + } + }, + "UpdateInstanceConfigRequest": { + "fields": { + "instanceConfig": { + "type": "InstanceConfig", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "validateOnly": { + "type": "bool", + "id": 3 + } + } + }, + "DeleteInstanceConfigRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/InstanceConfig" + } + }, + "etag": { + "type": "string", + "id": 2 + }, + "validateOnly": { + "type": "bool", + "id": 3 + } + } + }, + "ListInstanceConfigOperationsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" + } + }, + "filter": { + "type": "string", + "id": 2 + }, + "pageSize": { + "type": "int32", + "id": 3 + }, + "pageToken": { + "type": "string", + "id": 4 + } + } + }, + "ListInstanceConfigOperationsResponse": { + "fields": { + "operations": { + "rule": "repeated", + "type": "google.longrunning.Operation", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetInstanceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/Instance" + } + }, + "fieldMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "CreateInstanceRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" + } + }, + "instanceId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "instance": { + "type": "Instance", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListInstancesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4 + }, + "instanceDeadline": { + "type": "google.protobuf.Timestamp", + "id": 5 + } + } + }, + "ListInstancesResponse": { + "fields": { + "instances": { + "rule": "repeated", + "type": "Instance", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "UpdateInstanceRequest": { + "fields": { + "instance": { + "type": "Instance", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "fieldMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteInstanceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/Instance" + } + } + } + }, + "CreateInstanceMetadata": { + "fields": { + "instance": { + "type": "Instance", + "id": 1 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "cancelTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + }, + "expectedFulfillmentPeriod": { + "type": "FulfillmentPeriod", + "id": 5 + } + } + }, + "UpdateInstanceMetadata": { + "fields": { + "instance": { + "type": "Instance", + "id": 1 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "cancelTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + }, + "expectedFulfillmentPeriod": { + "type": "FulfillmentPeriod", + "id": 5 + } + } + }, + "FreeInstanceMetadata": { + "fields": { + "expireTime": { + "type": "google.protobuf.Timestamp", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "upgradeTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "expireBehavior": { + "type": "ExpireBehavior", + "id": 3 + } + }, + "nested": { + "ExpireBehavior": { + "values": { + "EXPIRE_BEHAVIOR_UNSPECIFIED": 0, + "FREE_TO_PROVISIONED": 1, + "REMOVE_AFTER_GRACE_PERIOD": 2 + } + } + } + }, + "CreateInstanceConfigMetadata": { + "fields": { + "instanceConfig": { + "type": "InstanceConfig", + "id": 1 + }, + "progress": { + "type": "OperationProgress", + "id": 2 + }, + "cancelTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + } + } + }, + "UpdateInstanceConfigMetadata": { + "fields": { + "instanceConfig": { + "type": "InstanceConfig", + "id": 1 + }, + "progress": { + "type": "OperationProgress", + "id": 2 + }, + "cancelTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + } + } + }, + "InstancePartition": { + "options": { + "(google.api.resource).type": "spanner.googleapis.com/InstancePartition", + "(google.api.resource).pattern": "projects/{project}/instances/{instance}/instancePartitions/{instance_partition}", + "(google.api.resource).plural": "instancePartitions", + "(google.api.resource).singular": "instancePartition" + }, + "oneofs": { + "computeCapacity": { + "oneof": [ + "nodeCount", + "processingUnits" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "config": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/InstanceConfig" + } + }, + "displayName": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "nodeCount": { + "type": "int32", + "id": 5 + }, + "processingUnits": { + "type": "int32", + "id": 6 + }, + "autoscalingConfig": { + "type": "AutoscalingConfig", + "id": 13, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "state": { + "type": "State", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "referencingDatabases": { + "rule": "repeated", + "type": "string", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "referencingBackups": { + "rule": "repeated", + "type": "string", + "id": 11, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "etag": { + "type": "string", + "id": 12 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "CREATING": 1, + "READY": 2 + } + } + } + }, + "CreateInstancePartitionMetadata": { + "fields": { + "instancePartition": { + "type": "InstancePartition", + "id": 1 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "cancelTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + } + } + }, + "CreateInstancePartitionRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/Instance" + } + }, + "instancePartitionId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "instancePartition": { + "type": "InstancePartition", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteInstancePartitionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/InstancePartition" + } + }, + "etag": { + "type": "string", + "id": 2 + } + } + }, + "GetInstancePartitionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/InstancePartition" + } + } + } + }, + "UpdateInstancePartitionRequest": { + "fields": { + "instancePartition": { + "type": "InstancePartition", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "fieldMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateInstancePartitionMetadata": { + "fields": { + "instancePartition": { + "type": "InstancePartition", + "id": 1 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "cancelTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + } + } + }, + "ListInstancePartitionsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/Instance" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "instancePartitionDeadline": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListInstancePartitionsResponse": { + "fields": { + "instancePartitions": { + "rule": "repeated", + "type": "InstancePartition", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "ListInstancePartitionOperationsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/Instance" + } + }, + "filter": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageSize": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "instancePartitionDeadline": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListInstancePartitionOperationsResponse": { + "fields": { + "operations": { + "rule": "repeated", + "type": "google.longrunning.Operation", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachableInstancePartitions": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "MoveInstanceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/Instance" + } + }, + "targetConfig": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/InstanceConfig" + } + } + } + }, + "MoveInstanceResponse": { + "fields": {} + }, + "MoveInstanceMetadata": { + "fields": { + "targetConfig": { + "type": "string", + "id": 1 + }, + "progress": { + "type": "OperationProgress", + "id": 2 + }, + "cancelTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + } + } + } + } + } + } + } + } + }, + "executor": { + "nested": { + "v1": { + "options": { + "go_package": "cloud.google.com/go/spanner/executor/apiv1/executorpb;executorpb", + "java_multiple_files": true, + "java_outer_classname": "CloudExecutorProto", + "java_package": "com.google.spanner.executor.v1" + }, + "nested": { + "SpannerExecutorProxy": { + "options": { + "(google.api.default_host)": "spanner-cloud-executor.googleapis.com" + }, + "methods": { + "ExecuteActionAsync": { + "requestType": "SpannerAsyncActionRequest", + "requestStream": true, + "responseType": "SpannerAsyncActionResponse", + "responseStream": true + } + } + }, + "SpannerAsyncActionRequest": { + "fields": { + "actionId": { + "type": "int32", + "id": 1 + }, + "action": { + "type": "SpannerAction", + "id": 2 + } + } + }, + "SpannerAsyncActionResponse": { + "fields": { + "actionId": { + "type": "int32", + "id": 1 + }, + "outcome": { + "type": "SpannerActionOutcome", + "id": 2 + } + } + }, + "SpannerAction": { + "oneofs": { + "action": { + "oneof": [ + "start", + "finish", + "read", + "query", + "mutation", + "dml", + "batchDml", + "write", + "partitionedUpdate", + "admin", + "startBatchTxn", + "closeBatchTxn", + "generateDbPartitionsRead", + "generateDbPartitionsQuery", + "executePartition", + "executeChangeStreamQuery", + "queryCancellation" + ] + } + }, + "fields": { + "databasePath": { + "type": "string", + "id": 1 + }, + "spannerOptions": { + "type": "SpannerOptions", + "id": 2 + }, + "start": { + "type": "StartTransactionAction", + "id": 10 + }, + "finish": { + "type": "FinishTransactionAction", + "id": 11 + }, + "read": { + "type": "ReadAction", + "id": 20 + }, + "query": { + "type": "QueryAction", + "id": 21 + }, + "mutation": { + "type": "MutationAction", + "id": 22 + }, + "dml": { + "type": "DmlAction", + "id": 23 + }, + "batchDml": { + "type": "BatchDmlAction", + "id": 24 + }, + "write": { + "type": "WriteMutationsAction", + "id": 25 + }, + "partitionedUpdate": { + "type": "PartitionedUpdateAction", + "id": 27 + }, + "admin": { + "type": "AdminAction", + "id": 30 + }, + "startBatchTxn": { + "type": "StartBatchTransactionAction", + "id": 40 + }, + "closeBatchTxn": { + "type": "CloseBatchTransactionAction", + "id": 41 + }, + "generateDbPartitionsRead": { + "type": "GenerateDbPartitionsForReadAction", + "id": 42 + }, + "generateDbPartitionsQuery": { + "type": "GenerateDbPartitionsForQueryAction", + "id": 43 + }, + "executePartition": { + "type": "ExecutePartitionAction", + "id": 44 + }, + "executeChangeStreamQuery": { + "type": "ExecuteChangeStreamQuery", + "id": 50 + }, + "queryCancellation": { + "type": "QueryCancellationAction", + "id": 51 + } + } + }, + "ReadAction": { + "oneofs": { + "_index": { + "oneof": [ + "index" + ] + } + }, + "fields": { + "table": { + "type": "string", + "id": 1 + }, + "index": { + "type": "string", + "id": 2, + "options": { + "proto3_optional": true + } + }, + "column": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "keys": { + "type": "KeySet", + "id": 4 + }, + "limit": { + "type": "int32", + "id": 5 + } + } + }, + "QueryAction": { + "fields": { + "sql": { + "type": "string", + "id": 1 + }, + "params": { + "rule": "repeated", + "type": "Parameter", + "id": 2 + } + }, + "nested": { + "Parameter": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "type": { + "type": "google.spanner.v1.Type", + "id": 2 + }, + "value": { + "type": "Value", + "id": 3 + } + } + } + } + }, + "DmlAction": { + "oneofs": { + "_autocommitIfSupported": { + "oneof": [ + "autocommitIfSupported" + ] + } + }, + "fields": { + "update": { + "type": "QueryAction", + "id": 1 + }, + "autocommitIfSupported": { + "type": "bool", + "id": 2, + "options": { + "proto3_optional": true + } + } + } + }, + "BatchDmlAction": { + "fields": { + "updates": { + "rule": "repeated", + "type": "QueryAction", + "id": 1 + } + } + }, + "Value": { + "oneofs": { + "valueType": { + "oneof": [ + "isNull", + "intValue", + "boolValue", + "doubleValue", + "bytesValue", + "stringValue", + "structValue", + "timestampValue", + "dateDaysValue", + "isCommitTimestamp", + "arrayValue" + ] + }, + "_arrayType": { + "oneof": [ + "arrayType" + ] + } + }, + "fields": { + "isNull": { + "type": "bool", + "id": 1 + }, + "intValue": { + "type": "int64", + "id": 2 + }, + "boolValue": { + "type": "bool", + "id": 3 + }, + "doubleValue": { + "type": "double", + "id": 4 + }, + "bytesValue": { + "type": "bytes", + "id": 5 + }, + "stringValue": { + "type": "string", + "id": 6 + }, + "structValue": { + "type": "ValueList", + "id": 7 + }, + "timestampValue": { + "type": "google.protobuf.Timestamp", + "id": 8 + }, + "dateDaysValue": { + "type": "int32", + "id": 9 + }, + "isCommitTimestamp": { + "type": "bool", + "id": 10 + }, + "arrayValue": { + "type": "ValueList", + "id": 11 + }, + "arrayType": { + "type": "google.spanner.v1.Type", + "id": 12, + "options": { + "proto3_optional": true + } + } + } + }, + "KeyRange": { + "oneofs": { + "_type": { + "oneof": [ + "type" + ] + } + }, + "fields": { + "start": { + "type": "ValueList", + "id": 1 + }, + "limit": { + "type": "ValueList", + "id": 2 + }, + "type": { + "type": "Type", + "id": 3, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "CLOSED_CLOSED": 1, + "CLOSED_OPEN": 2, + "OPEN_CLOSED": 3, + "OPEN_OPEN": 4 + } + } + } + }, + "KeySet": { + "fields": { + "point": { + "rule": "repeated", + "type": "ValueList", + "id": 1 + }, + "range": { + "rule": "repeated", + "type": "KeyRange", + "id": 2 + }, + "all": { + "type": "bool", + "id": 3 + } + } + }, + "ValueList": { + "fields": { + "value": { + "rule": "repeated", + "type": "Value", + "id": 1 + } + } + }, + "MutationAction": { + "fields": { + "mod": { + "rule": "repeated", + "type": "Mod", + "id": 1 + } + }, + "nested": { + "InsertArgs": { + "fields": { + "column": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "type": { + "rule": "repeated", + "type": "google.spanner.v1.Type", + "id": 2 + }, + "values": { + "rule": "repeated", + "type": "ValueList", + "id": 3 + } + } + }, + "UpdateArgs": { + "fields": { + "column": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "type": { + "rule": "repeated", + "type": "google.spanner.v1.Type", + "id": 2 + }, + "values": { + "rule": "repeated", + "type": "ValueList", + "id": 3 + } + } + }, + "Mod": { + "fields": { + "table": { + "type": "string", + "id": 1 + }, + "insert": { + "type": "InsertArgs", + "id": 2 + }, + "update": { + "type": "UpdateArgs", + "id": 3 + }, + "insertOrUpdate": { + "type": "InsertArgs", + "id": 4 + }, + "replace": { + "type": "InsertArgs", + "id": 5 + }, + "deleteKeys": { + "type": "KeySet", + "id": 6 + } + } + } + } + }, + "WriteMutationsAction": { + "fields": { + "mutation": { + "type": "MutationAction", + "id": 1 + } + } + }, + "PartitionedUpdateAction": { + "oneofs": { + "_options": { + "oneof": [ + "options" + ] + } + }, + "fields": { + "options": { + "type": "ExecutePartitionedUpdateOptions", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "update": { + "type": "QueryAction", + "id": 2 + } + }, + "nested": { + "ExecutePartitionedUpdateOptions": { + "oneofs": { + "_rpcPriority": { + "oneof": [ + "rpcPriority" + ] + }, + "_tag": { + "oneof": [ + "tag" + ] + } + }, + "fields": { + "rpcPriority": { + "type": "google.spanner.v1.RequestOptions.Priority", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "tag": { + "type": "string", + "id": 2, + "options": { + "proto3_optional": true + } + } + } + } + } + }, + "StartTransactionAction": { + "oneofs": { + "_concurrency": { + "oneof": [ + "concurrency" + ] + }, + "_executionOptions": { + "oneof": [ + "executionOptions" + ] + } + }, + "fields": { + "concurrency": { + "type": "Concurrency", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "table": { + "rule": "repeated", + "type": "TableMetadata", + "id": 2 + }, + "transactionSeed": { + "type": "string", + "id": 3 + }, + "executionOptions": { + "type": "TransactionExecutionOptions", + "id": 4, + "options": { + "proto3_optional": true + } + } + } + }, + "Concurrency": { + "oneofs": { + "concurrencyMode": { + "oneof": [ + "stalenessSeconds", + "minReadTimestampMicros", + "maxStalenessSeconds", + "exactTimestampMicros", + "strong", + "batch" + ] + } + }, + "fields": { + "stalenessSeconds": { + "type": "double", + "id": 1 + }, + "minReadTimestampMicros": { + "type": "int64", + "id": 2 + }, + "maxStalenessSeconds": { + "type": "double", + "id": 3 + }, + "exactTimestampMicros": { + "type": "int64", + "id": 4 + }, + "strong": { + "type": "bool", + "id": 5 + }, + "batch": { + "type": "bool", + "id": 6 + }, + "snapshotEpochRead": { + "type": "bool", + "id": 7 + }, + "snapshotEpochRootTable": { + "type": "string", + "id": 8 + }, + "batchReadTimestampMicros": { + "type": "int64", + "id": 9 + } + } + }, + "TableMetadata": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "column": { + "rule": "repeated", + "type": "ColumnMetadata", + "id": 2 + }, + "keyColumn": { + "rule": "repeated", + "type": "ColumnMetadata", + "id": 3 + } + } + }, + "ColumnMetadata": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "type": { + "type": "google.spanner.v1.Type", + "id": 2 + } + } + }, + "TransactionExecutionOptions": { + "fields": { + "optimistic": { + "type": "bool", + "id": 1 + } + } + }, + "FinishTransactionAction": { + "fields": { + "mode": { + "type": "Mode", + "id": 1 + } + }, + "nested": { + "Mode": { + "values": { + "MODE_UNSPECIFIED": 0, + "COMMIT": 1, + "ABANDON": 2 + } + } + } + }, + "AdminAction": { + "oneofs": { + "action": { + "oneof": [ + "createUserInstanceConfig", + "updateUserInstanceConfig", + "deleteUserInstanceConfig", + "getCloudInstanceConfig", + "listInstanceConfigs", + "createCloudInstance", + "updateCloudInstance", + "deleteCloudInstance", + "listCloudInstances", + "getCloudInstance", + "createCloudDatabase", + "updateCloudDatabaseDdl", + "updateCloudDatabase", + "dropCloudDatabase", + "listCloudDatabases", + "listCloudDatabaseOperations", + "restoreCloudDatabase", + "getCloudDatabase", + "createCloudBackup", + "copyCloudBackup", + "getCloudBackup", + "updateCloudBackup", + "deleteCloudBackup", + "listCloudBackups", + "listCloudBackupOperations", + "getOperation", + "cancelOperation", + "changeQuorumCloudDatabase" + ] + } + }, + "fields": { + "createUserInstanceConfig": { + "type": "CreateUserInstanceConfigAction", + "id": 1 + }, + "updateUserInstanceConfig": { + "type": "UpdateUserInstanceConfigAction", + "id": 2 + }, + "deleteUserInstanceConfig": { + "type": "DeleteUserInstanceConfigAction", + "id": 3 + }, + "getCloudInstanceConfig": { + "type": "GetCloudInstanceConfigAction", + "id": 4 + }, + "listInstanceConfigs": { + "type": "ListCloudInstanceConfigsAction", + "id": 5 + }, + "createCloudInstance": { + "type": "CreateCloudInstanceAction", + "id": 6 + }, + "updateCloudInstance": { + "type": "UpdateCloudInstanceAction", + "id": 7 + }, + "deleteCloudInstance": { + "type": "DeleteCloudInstanceAction", + "id": 8 + }, + "listCloudInstances": { + "type": "ListCloudInstancesAction", + "id": 9 + }, + "getCloudInstance": { + "type": "GetCloudInstanceAction", + "id": 10 + }, + "createCloudDatabase": { + "type": "CreateCloudDatabaseAction", + "id": 11 + }, + "updateCloudDatabaseDdl": { + "type": "UpdateCloudDatabaseDdlAction", + "id": 12 + }, + "updateCloudDatabase": { + "type": "UpdateCloudDatabaseAction", + "id": 27 + }, + "dropCloudDatabase": { + "type": "DropCloudDatabaseAction", + "id": 13 + }, + "listCloudDatabases": { + "type": "ListCloudDatabasesAction", + "id": 14 + }, + "listCloudDatabaseOperations": { + "type": "ListCloudDatabaseOperationsAction", + "id": 15 + }, + "restoreCloudDatabase": { + "type": "RestoreCloudDatabaseAction", + "id": 16 + }, + "getCloudDatabase": { + "type": "GetCloudDatabaseAction", + "id": 17 + }, + "createCloudBackup": { + "type": "CreateCloudBackupAction", + "id": 18 + }, + "copyCloudBackup": { + "type": "CopyCloudBackupAction", + "id": 19 + }, + "getCloudBackup": { + "type": "GetCloudBackupAction", + "id": 20 + }, + "updateCloudBackup": { + "type": "UpdateCloudBackupAction", + "id": 21 + }, + "deleteCloudBackup": { + "type": "DeleteCloudBackupAction", + "id": 22 + }, + "listCloudBackups": { + "type": "ListCloudBackupsAction", + "id": 23 + }, + "listCloudBackupOperations": { + "type": "ListCloudBackupOperationsAction", + "id": 24 + }, + "getOperation": { + "type": "GetOperationAction", + "id": 25 + }, + "cancelOperation": { + "type": "CancelOperationAction", + "id": 26 + }, + "changeQuorumCloudDatabase": { + "type": "ChangeQuorumCloudDatabaseAction", + "id": 28 + } + } + }, + "CreateUserInstanceConfigAction": { + "fields": { + "userConfigId": { + "type": "string", + "id": 1 + }, + "projectId": { + "type": "string", + "id": 2 + }, + "baseConfigId": { + "type": "string", + "id": 3 + }, + "replicas": { + "rule": "repeated", + "type": "google.spanner.admin.instance.v1.ReplicaInfo", + "id": 4 + } + } + }, + "UpdateUserInstanceConfigAction": { + "oneofs": { + "_displayName": { + "oneof": [ + "displayName" + ] + } + }, + "fields": { + "userConfigId": { + "type": "string", + "id": 1 + }, + "projectId": { + "type": "string", + "id": 2 + }, + "displayName": { + "type": "string", + "id": 3, + "options": { + "proto3_optional": true + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 4 + } + } + }, + "GetCloudInstanceConfigAction": { + "fields": { + "instanceConfigId": { + "type": "string", + "id": 1 + }, + "projectId": { + "type": "string", + "id": 2 + } + } + }, + "DeleteUserInstanceConfigAction": { + "fields": { + "userConfigId": { + "type": "string", + "id": 1 + }, + "projectId": { + "type": "string", + "id": 2 + } + } + }, + "ListCloudInstanceConfigsAction": { + "oneofs": { + "_pageSize": { + "oneof": [ + "pageSize" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + } + }, + "fields": { + "projectId": { + "type": "string", + "id": 1 + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "proto3_optional": true + } + } + } + }, + "CreateCloudInstanceAction": { + "oneofs": { + "_nodeCount": { + "oneof": [ + "nodeCount" + ] + }, + "_processingUnits": { + "oneof": [ + "processingUnits" + ] + }, + "_autoscalingConfig": { + "oneof": [ + "autoscalingConfig" + ] + } + }, + "fields": { + "instanceId": { + "type": "string", + "id": 1 + }, + "projectId": { + "type": "string", + "id": 2 + }, + "instanceConfigId": { + "type": "string", + "id": 3 + }, + "nodeCount": { + "type": "int32", + "id": 4, + "options": { + "proto3_optional": true + } + }, + "processingUnits": { + "type": "int32", + "id": 6, + "options": { + "proto3_optional": true + } + }, + "autoscalingConfig": { + "type": "google.spanner.admin.instance.v1.AutoscalingConfig", + "id": 7, + "options": { + "proto3_optional": true + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 5 + } + } + }, + "UpdateCloudInstanceAction": { + "oneofs": { + "_displayName": { + "oneof": [ + "displayName" + ] + }, + "_nodeCount": { + "oneof": [ + "nodeCount" + ] + }, + "_processingUnits": { + "oneof": [ + "processingUnits" + ] + }, + "_autoscalingConfig": { + "oneof": [ + "autoscalingConfig" + ] + } + }, + "fields": { + "instanceId": { + "type": "string", + "id": 1 + }, + "projectId": { + "type": "string", + "id": 2 + }, + "displayName": { + "type": "string", + "id": 3, + "options": { + "proto3_optional": true + } + }, + "nodeCount": { + "type": "int32", + "id": 4, + "options": { + "proto3_optional": true + } + }, + "processingUnits": { + "type": "int32", + "id": 5, + "options": { + "proto3_optional": true + } + }, + "autoscalingConfig": { + "type": "google.spanner.admin.instance.v1.AutoscalingConfig", + "id": 7, + "options": { + "proto3_optional": true + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 6 + } + } + }, + "DeleteCloudInstanceAction": { + "fields": { + "instanceId": { + "type": "string", + "id": 1 + }, + "projectId": { + "type": "string", + "id": 2 + } + } + }, + "CreateCloudDatabaseAction": { + "oneofs": { + "_dialect": { + "oneof": [ + "dialect" + ] + }, + "_protoDescriptors": { + "oneof": [ + "protoDescriptors" + ] + } + }, + "fields": { + "instanceId": { + "type": "string", + "id": 1 + }, + "projectId": { + "type": "string", + "id": 2 + }, + "databaseId": { + "type": "string", + "id": 3 + }, + "sdlStatement": { + "rule": "repeated", + "type": "string", + "id": 4 + }, + "encryptionConfig": { + "type": "google.spanner.admin.database.v1.EncryptionConfig", + "id": 5 + }, + "dialect": { + "type": "string", + "id": 6, + "options": { + "proto3_optional": true + } + }, + "protoDescriptors": { + "type": "bytes", + "id": 7, + "options": { + "proto3_optional": true + } + } + } + }, + "UpdateCloudDatabaseDdlAction": { + "oneofs": { + "_protoDescriptors": { + "oneof": [ + "protoDescriptors" + ] + } + }, + "fields": { + "instanceId": { + "type": "string", + "id": 1 + }, + "projectId": { + "type": "string", + "id": 2 + }, + "databaseId": { + "type": "string", + "id": 3 + }, + "sdlStatement": { + "rule": "repeated", + "type": "string", + "id": 4 + }, + "operationId": { + "type": "string", + "id": 5 + }, + "protoDescriptors": { + "type": "bytes", + "id": 6, + "options": { + "proto3_optional": true + } + } + } + }, + "UpdateCloudDatabaseAction": { + "fields": { + "instanceId": { + "type": "string", + "id": 1 + }, + "projectId": { + "type": "string", + "id": 2 + }, + "databaseName": { + "type": "string", + "id": 3 + }, + "enableDropProtection": { + "type": "bool", + "id": 4 + } + } + }, + "DropCloudDatabaseAction": { + "fields": { + "instanceId": { + "type": "string", + "id": 1 + }, + "projectId": { + "type": "string", + "id": 2 + }, + "databaseId": { + "type": "string", + "id": 3 + } + } + }, + "ChangeQuorumCloudDatabaseAction": { + "oneofs": { + "_databaseUri": { + "oneof": [ + "databaseUri" + ] + } + }, + "fields": { + "databaseUri": { + "type": "string", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "servingLocations": { + "rule": "repeated", + "type": "string", + "id": 2 + } + } + }, + "ListCloudDatabasesAction": { + "fields": { + "projectId": { + "type": "string", + "id": 1 + }, + "instanceId": { + "type": "string", + "id": 2 + }, + "pageSize": { + "type": "int32", + "id": 3 + }, + "pageToken": { + "type": "string", + "id": 4 + } + } + }, + "ListCloudInstancesAction": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_pageSize": { + "oneof": [ + "pageSize" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + } + }, + "fields": { + "projectId": { + "type": "string", + "id": 1 + }, + "filter": { + "type": "string", + "id": 2, + "options": { + "proto3_optional": true + } + }, + "pageSize": { + "type": "int32", + "id": 3, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 4, + "options": { + "proto3_optional": true + } + } + } + }, + "GetCloudInstanceAction": { + "fields": { + "projectId": { + "type": "string", + "id": 1 + }, + "instanceId": { + "type": "string", + "id": 2 + } + } + }, + "ListCloudDatabaseOperationsAction": { + "fields": { + "projectId": { + "type": "string", + "id": 1 + }, + "instanceId": { + "type": "string", + "id": 2 + }, + "filter": { + "type": "string", + "id": 3 + }, + "pageSize": { + "type": "int32", + "id": 4 + }, + "pageToken": { + "type": "string", + "id": 5 + } + } + }, + "RestoreCloudDatabaseAction": { + "fields": { + "projectId": { + "type": "string", + "id": 1 + }, + "backupInstanceId": { + "type": "string", + "id": 2 + }, + "backupId": { + "type": "string", + "id": 3 + }, + "databaseInstanceId": { + "type": "string", + "id": 4 + }, + "databaseId": { + "type": "string", + "id": 5 + }, + "encryptionConfig": { + "type": "google.spanner.admin.database.v1.EncryptionConfig", + "id": 7 + } + } + }, + "GetCloudDatabaseAction": { + "fields": { + "projectId": { + "type": "string", + "id": 1 + }, + "instanceId": { + "type": "string", + "id": 2 + }, + "databaseId": { + "type": "string", + "id": 3 + } + } + }, + "CreateCloudBackupAction": { + "oneofs": { + "_versionTime": { + "oneof": [ + "versionTime" + ] + } + }, + "fields": { + "projectId": { + "type": "string", + "id": 1 + }, + "instanceId": { + "type": "string", + "id": 2 + }, + "backupId": { + "type": "string", + "id": 3 + }, + "databaseId": { + "type": "string", + "id": 4 + }, + "expireTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "versionTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "proto3_optional": true + } + }, + "encryptionConfig": { + "type": "google.spanner.admin.database.v1.EncryptionConfig", + "id": 7 + } + } + }, + "CopyCloudBackupAction": { + "fields": { + "projectId": { + "type": "string", + "id": 1 + }, + "instanceId": { + "type": "string", + "id": 2 + }, + "backupId": { + "type": "string", + "id": 3 + }, + "sourceBackup": { + "type": "string", + "id": 4 + }, + "expireTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "GetCloudBackupAction": { + "fields": { + "projectId": { + "type": "string", + "id": 1 + }, + "instanceId": { + "type": "string", + "id": 2 + }, + "backupId": { + "type": "string", + "id": 3 + } + } + }, + "UpdateCloudBackupAction": { + "fields": { + "projectId": { + "type": "string", + "id": 1 + }, + "instanceId": { + "type": "string", + "id": 2 + }, + "backupId": { + "type": "string", + "id": 3 + }, + "expireTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "DeleteCloudBackupAction": { + "fields": { + "projectId": { + "type": "string", + "id": 1 + }, + "instanceId": { + "type": "string", + "id": 2 + }, + "backupId": { + "type": "string", + "id": 3 + } + } + }, + "ListCloudBackupsAction": { + "fields": { + "projectId": { + "type": "string", + "id": 1 + }, + "instanceId": { + "type": "string", + "id": 2 + }, + "filter": { + "type": "string", + "id": 3 + }, + "pageSize": { + "type": "int32", + "id": 4 + }, + "pageToken": { + "type": "string", + "id": 5 + } + } + }, + "ListCloudBackupOperationsAction": { + "fields": { + "projectId": { + "type": "string", + "id": 1 + }, + "instanceId": { + "type": "string", + "id": 2 + }, + "filter": { + "type": "string", + "id": 3 + }, + "pageSize": { + "type": "int32", + "id": 4 + }, + "pageToken": { + "type": "string", + "id": 5 + } + } + }, + "GetOperationAction": { + "fields": { + "operation": { + "type": "string", + "id": 1 + } + } + }, + "QueryCancellationAction": { + "fields": { + "longRunningSql": { + "type": "string", + "id": 1 + }, + "cancelQuery": { + "type": "string", + "id": 2 + } + } + }, + "CancelOperationAction": { + "fields": { + "operation": { + "type": "string", + "id": 1 + } + } + }, + "StartBatchTransactionAction": { + "oneofs": { + "param": { + "oneof": [ + "batchTxnTime", + "tid" + ] + } + }, + "fields": { + "batchTxnTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "tid": { + "type": "bytes", + "id": 2 + }, + "cloudDatabaseRole": { + "type": "string", + "id": 3 + } + } + }, + "CloseBatchTransactionAction": { + "fields": { + "cleanup": { + "type": "bool", + "id": 1 + } + } + }, + "GenerateDbPartitionsForReadAction": { + "oneofs": { + "_desiredBytesPerPartition": { + "oneof": [ + "desiredBytesPerPartition" + ] + }, + "_maxPartitionCount": { + "oneof": [ + "maxPartitionCount" + ] + } + }, + "fields": { + "read": { + "type": "ReadAction", + "id": 1 + }, + "table": { + "rule": "repeated", + "type": "TableMetadata", + "id": 2 + }, + "desiredBytesPerPartition": { + "type": "int64", + "id": 3, + "options": { + "proto3_optional": true + } + }, + "maxPartitionCount": { + "type": "int64", + "id": 4, + "options": { + "proto3_optional": true + } + } + } + }, + "GenerateDbPartitionsForQueryAction": { + "oneofs": { + "_desiredBytesPerPartition": { + "oneof": [ + "desiredBytesPerPartition" + ] + } + }, + "fields": { + "query": { + "type": "QueryAction", + "id": 1 + }, + "desiredBytesPerPartition": { + "type": "int64", + "id": 2, + "options": { + "proto3_optional": true + } + } + } + }, + "BatchPartition": { + "oneofs": { + "_table": { + "oneof": [ + "table" + ] + }, + "_index": { + "oneof": [ + "index" + ] + } + }, + "fields": { + "partition": { + "type": "bytes", + "id": 1 + }, + "partitionToken": { + "type": "bytes", + "id": 2 + }, + "table": { + "type": "string", + "id": 3, + "options": { + "proto3_optional": true + } + }, + "index": { + "type": "string", + "id": 4, + "options": { + "proto3_optional": true + } + } + } + }, + "ExecutePartitionAction": { + "fields": { + "partition": { + "type": "BatchPartition", + "id": 1 + } + } + }, + "ExecuteChangeStreamQuery": { + "oneofs": { + "_endTime": { + "oneof": [ + "endTime" + ] + }, + "_partitionToken": { + "oneof": [ + "partitionToken" + ] + }, + "_heartbeatMilliseconds": { + "oneof": [ + "heartbeatMilliseconds" + ] + }, + "_deadlineSeconds": { + "oneof": [ + "deadlineSeconds" + ] + }, + "_cloudDatabaseRole": { + "oneof": [ + "cloudDatabaseRole" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "proto3_optional": true + } + }, + "partitionToken": { + "type": "string", + "id": 4, + "options": { + "proto3_optional": true + } + }, + "readOptions": { + "rule": "repeated", + "type": "string", + "id": 5 + }, + "heartbeatMilliseconds": { + "type": "int32", + "id": 6, + "options": { + "proto3_optional": true + } + }, + "deadlineSeconds": { + "type": "int64", + "id": 7, + "options": { + "proto3_optional": true + } + }, + "cloudDatabaseRole": { + "type": "string", + "id": 8, + "options": { + "proto3_optional": true + } + } + } + }, + "SpannerActionOutcome": { + "oneofs": { + "_status": { + "oneof": [ + "status" + ] + }, + "_commitTime": { + "oneof": [ + "commitTime" + ] + }, + "_readResult": { + "oneof": [ + "readResult" + ] + }, + "_queryResult": { + "oneof": [ + "queryResult" + ] + }, + "_transactionRestarted": { + "oneof": [ + "transactionRestarted" + ] + }, + "_batchTxnId": { + "oneof": [ + "batchTxnId" + ] + }, + "_adminResult": { + "oneof": [ + "adminResult" + ] + } + }, + "fields": { + "status": { + "type": "google.rpc.Status", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "commitTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "proto3_optional": true + } + }, + "readResult": { + "type": "ReadResult", + "id": 3, + "options": { + "proto3_optional": true + } + }, + "queryResult": { + "type": "QueryResult", + "id": 4, + "options": { + "proto3_optional": true + } + }, + "transactionRestarted": { + "type": "bool", + "id": 5, + "options": { + "proto3_optional": true + } + }, + "batchTxnId": { + "type": "bytes", + "id": 6, + "options": { + "proto3_optional": true + } + }, + "dbPartition": { + "rule": "repeated", + "type": "BatchPartition", + "id": 7 + }, + "adminResult": { + "type": "AdminResult", + "id": 8, + "options": { + "proto3_optional": true + } + }, + "dmlRowsModified": { + "rule": "repeated", + "type": "int64", + "id": 9 + }, + "changeStreamRecords": { + "rule": "repeated", + "type": "ChangeStreamRecord", + "id": 10 + } + } + }, + "AdminResult": { + "fields": { + "backupResponse": { + "type": "CloudBackupResponse", + "id": 1 + }, + "operationResponse": { + "type": "OperationResponse", + "id": 2 + }, + "databaseResponse": { + "type": "CloudDatabaseResponse", + "id": 3 + }, + "instanceResponse": { + "type": "CloudInstanceResponse", + "id": 4 + }, + "instanceConfigResponse": { + "type": "CloudInstanceConfigResponse", + "id": 5 + } + } + }, + "CloudBackupResponse": { + "fields": { + "listedBackups": { + "rule": "repeated", + "type": "google.spanner.admin.database.v1.Backup", + "id": 1 + }, + "listedBackupOperations": { + "rule": "repeated", + "type": "google.longrunning.Operation", + "id": 2 + }, + "nextPageToken": { + "type": "string", + "id": 3 + }, + "backup": { + "type": "google.spanner.admin.database.v1.Backup", + "id": 4 + } + } + }, + "OperationResponse": { + "fields": { + "listedOperations": { + "rule": "repeated", + "type": "google.longrunning.Operation", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "operation": { + "type": "google.longrunning.Operation", + "id": 3 + } + } + }, + "CloudInstanceResponse": { + "fields": { + "listedInstances": { + "rule": "repeated", + "type": "google.spanner.admin.instance.v1.Instance", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "instance": { + "type": "google.spanner.admin.instance.v1.Instance", + "id": 3 + } + } + }, + "CloudInstanceConfigResponse": { + "fields": { + "listedInstanceConfigs": { + "rule": "repeated", + "type": "google.spanner.admin.instance.v1.InstanceConfig", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "instanceConfig": { + "type": "google.spanner.admin.instance.v1.InstanceConfig", + "id": 3 + } + } + }, + "CloudDatabaseResponse": { + "fields": { + "listedDatabases": { + "rule": "repeated", + "type": "google.spanner.admin.database.v1.Database", + "id": 1 + }, + "listedDatabaseOperations": { + "rule": "repeated", + "type": "google.longrunning.Operation", + "id": 2 + }, + "nextPageToken": { + "type": "string", + "id": 3 + }, + "database": { + "type": "google.spanner.admin.database.v1.Database", + "id": 4 + } + } + }, + "ReadResult": { + "oneofs": { + "_index": { + "oneof": [ + "index" + ] + }, + "_requestIndex": { + "oneof": [ + "requestIndex" + ] + }, + "_rowType": { + "oneof": [ + "rowType" + ] + } + }, + "fields": { + "table": { + "type": "string", + "id": 1 + }, + "index": { + "type": "string", + "id": 2, + "options": { + "proto3_optional": true + } + }, + "requestIndex": { + "type": "int32", + "id": 3, + "options": { + "proto3_optional": true + } + }, + "row": { + "rule": "repeated", + "type": "ValueList", + "id": 4 + }, + "rowType": { + "type": "google.spanner.v1.StructType", + "id": 5, + "options": { + "proto3_optional": true + } + } + } + }, + "QueryResult": { + "oneofs": { + "_rowType": { + "oneof": [ + "rowType" + ] + } + }, + "fields": { + "row": { + "rule": "repeated", + "type": "ValueList", + "id": 1 + }, + "rowType": { + "type": "google.spanner.v1.StructType", + "id": 2, + "options": { + "proto3_optional": true + } + } + } + }, + "ChangeStreamRecord": { + "oneofs": { + "record": { + "oneof": [ + "dataChange", + "childPartition", + "heartbeat" + ] + } + }, + "fields": { + "dataChange": { + "type": "DataChangeRecord", + "id": 1 + }, + "childPartition": { + "type": "ChildPartitionsRecord", + "id": 2 + }, + "heartbeat": { + "type": "HeartbeatRecord", + "id": 3 + } + } + }, + "DataChangeRecord": { + "fields": { + "commitTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "recordSequence": { + "type": "string", + "id": 2 + }, + "transactionId": { + "type": "string", + "id": 3 + }, + "isLastRecord": { + "type": "bool", + "id": 4 + }, + "table": { + "type": "string", + "id": 5 + }, + "columnTypes": { + "rule": "repeated", + "type": "ColumnType", + "id": 6 + }, + "mods": { + "rule": "repeated", + "type": "Mod", + "id": 7 + }, + "modType": { + "type": "string", + "id": 8 + }, + "valueCaptureType": { + "type": "string", + "id": 9 + }, + "recordCount": { + "type": "int64", + "id": 10 + }, + "partitionCount": { + "type": "int64", + "id": 11 + }, + "transactionTag": { + "type": "string", + "id": 12 + }, + "isSystemTransaction": { + "type": "bool", + "id": 13 + } + }, + "nested": { + "ColumnType": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "type": { + "type": "string", + "id": 2 + }, + "isPrimaryKey": { + "type": "bool", + "id": 3 + }, + "ordinalPosition": { + "type": "int64", + "id": 4 + } + } + }, + "Mod": { + "fields": { + "keys": { + "type": "string", + "id": 1 + }, + "newValues": { + "type": "string", + "id": 2 + }, + "oldValues": { + "type": "string", + "id": 3 + } + } + } + } + }, + "ChildPartitionsRecord": { + "fields": { + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "recordSequence": { + "type": "string", + "id": 2 + }, + "childPartitions": { + "rule": "repeated", + "type": "ChildPartition", + "id": 3 + } + }, + "nested": { + "ChildPartition": { + "fields": { + "token": { + "type": "string", + "id": 1 + }, + "parentPartitionTokens": { + "rule": "repeated", + "type": "string", + "id": 2 + } + } + } + } + }, + "HeartbeatRecord": { + "fields": { + "heartbeatTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + } + } + }, + "SpannerOptions": { + "fields": { + "sessionPoolOptions": { + "type": "SessionPoolOptions", + "id": 1 + } + } + }, + "SessionPoolOptions": { + "fields": { + "useMultiplexed": { + "type": "bool", + "id": 1 + } + } + } + } + } + } + }, + "v1": { + "options": { + "csharp_namespace": "Google.Cloud.Spanner.V1", + "go_package": "cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb", + "java_multiple_files": true, + "java_outer_classname": "QueryPlanProto", + "java_package": "com.google.spanner.v1", + "php_namespace": "Google\\Cloud\\Spanner\\V1", + "ruby_package": "Google::Cloud::Spanner::V1", + "(google.api.resource_definition).type": "spanner.googleapis.com/Database", + "(google.api.resource_definition).pattern": "projects/{project}/instances/{instance}/databases/{database}" + }, + "nested": { + "Spanner": { + "options": { + "(google.api.default_host)": "spanner.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/spanner.data" + }, + "methods": { + "CreateSession": { + "requestType": "CreateSessionRequest", + "responseType": "Session", + "options": { + "(google.api.http).post": "/v1/{database=projects/*/instances/*/databases/*}/sessions", + "(google.api.http).body": "*", + "(google.api.method_signature)": "database" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{database=projects/*/instances/*/databases/*}/sessions", + "body": "*" + } + }, + { + "(google.api.method_signature)": "database" + } + ] + }, + "BatchCreateSessions": { + "requestType": "BatchCreateSessionsRequest", + "responseType": "BatchCreateSessionsResponse", + "options": { + "(google.api.http).post": "/v1/{database=projects/*/instances/*/databases/*}/sessions:batchCreate", + "(google.api.http).body": "*", + "(google.api.method_signature)": "database,session_count" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{database=projects/*/instances/*/databases/*}/sessions:batchCreate", + "body": "*" + } + }, + { + "(google.api.method_signature)": "database,session_count" + } + ] + }, + "GetSession": { + "requestType": "GetSessionRequest", + "responseType": "Session", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/instances/*/databases/*/sessions/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/instances/*/databases/*/sessions/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListSessions": { + "requestType": "ListSessionsRequest", + "responseType": "ListSessionsResponse", + "options": { + "(google.api.http).get": "/v1/{database=projects/*/instances/*/databases/*}/sessions", + "(google.api.method_signature)": "database" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{database=projects/*/instances/*/databases/*}/sessions" + } + }, + { + "(google.api.method_signature)": "database" + } + ] + }, + "DeleteSession": { + "requestType": "DeleteSessionRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/instances/*/databases/*/sessions/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/instances/*/databases/*/sessions/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ExecuteSql": { + "requestType": "ExecuteSqlRequest", + "responseType": "ResultSet", + "options": { + "(google.api.http).post": "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:executeSql", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:executeSql", + "body": "*" + } + } + ] + }, + "ExecuteStreamingSql": { + "requestType": "ExecuteSqlRequest", + "responseType": "PartialResultSet", + "responseStream": true, + "options": { + "(google.api.http).post": "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:executeStreamingSql", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:executeStreamingSql", + "body": "*" + } + } + ] + }, + "ExecuteBatchDml": { + "requestType": "ExecuteBatchDmlRequest", + "responseType": "ExecuteBatchDmlResponse", + "options": { + "(google.api.http).post": "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:executeBatchDml", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:executeBatchDml", + "body": "*" + } + } + ] + }, + "Read": { + "requestType": "ReadRequest", + "responseType": "ResultSet", + "options": { + "(google.api.http).post": "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:read", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:read", + "body": "*" + } + } + ] + }, + "StreamingRead": { + "requestType": "ReadRequest", + "responseType": "PartialResultSet", + "responseStream": true, + "options": { + "(google.api.http).post": "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:streamingRead", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:streamingRead", + "body": "*" + } + } + ] + }, + "BeginTransaction": { + "requestType": "BeginTransactionRequest", + "responseType": "Transaction", + "options": { + "(google.api.http).post": "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:beginTransaction", + "(google.api.http).body": "*", + "(google.api.method_signature)": "session,options" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:beginTransaction", + "body": "*" + } + }, + { + "(google.api.method_signature)": "session,options" + } + ] + }, + "Commit": { + "requestType": "CommitRequest", + "responseType": "CommitResponse", + "options": { + "(google.api.http).post": "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:commit", + "(google.api.http).body": "*", + "(google.api.method_signature)": "session,single_use_transaction,mutations" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:commit", + "body": "*" + } + }, + { + "(google.api.method_signature)": "session,transaction_id,mutations" + }, + { + "(google.api.method_signature)": "session,single_use_transaction,mutations" + } + ] + }, + "Rollback": { + "requestType": "RollbackRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).post": "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:rollback", + "(google.api.http).body": "*", + "(google.api.method_signature)": "session,transaction_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:rollback", + "body": "*" + } + }, + { + "(google.api.method_signature)": "session,transaction_id" + } + ] + }, + "PartitionQuery": { + "requestType": "PartitionQueryRequest", + "responseType": "PartitionResponse", + "options": { + "(google.api.http).post": "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:partitionQuery", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:partitionQuery", + "body": "*" + } + } + ] + }, + "PartitionRead": { + "requestType": "PartitionReadRequest", + "responseType": "PartitionResponse", + "options": { + "(google.api.http).post": "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:partitionRead", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:partitionRead", + "body": "*" + } + } + ] + }, + "BatchWrite": { + "requestType": "BatchWriteRequest", + "responseType": "BatchWriteResponse", + "responseStream": true, + "options": { + "(google.api.http).post": "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:batchWrite", + "(google.api.http).body": "*", + "(google.api.method_signature)": "session,mutation_groups" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:batchWrite", + "body": "*" + } + }, + { + "(google.api.method_signature)": "session,mutation_groups" + } + ] + } + } + }, + "CreateSessionRequest": { + "fields": { + "database": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/Database" + } + }, + "session": { + "type": "Session", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "BatchCreateSessionsRequest": { + "fields": { + "database": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/Database" + } + }, + "sessionTemplate": { + "type": "Session", + "id": 2 + }, + "sessionCount": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "BatchCreateSessionsResponse": { + "fields": { + "session": { + "rule": "repeated", + "type": "Session", + "id": 1 + } + } + }, + "Session": { + "options": { + "(google.api.resource).type": "spanner.googleapis.com/Session", + "(google.api.resource).pattern": "projects/{project}/instances/{instance}/databases/{database}/sessions/{session}", + "(google.api.resource).plural": "sessions", + "(google.api.resource).singular": "session" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "approximateLastUseTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "creatorRole": { + "type": "string", + "id": 5 + }, + "multiplexed": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "GetSessionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/Session" + } + } + } + }, + "ListSessionsRequest": { + "fields": { + "database": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/Database" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4 + } + } + }, + "ListSessionsResponse": { + "fields": { + "sessions": { + "rule": "repeated", + "type": "Session", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "DeleteSessionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/Session" + } + } + } + }, + "RequestOptions": { + "fields": { + "priority": { + "type": "Priority", + "id": 1 + }, + "requestTag": { + "type": "string", + "id": 2 + }, + "transactionTag": { + "type": "string", + "id": 3 + }, + "clientContext": { + "type": "ClientContext", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "Priority": { + "values": { + "PRIORITY_UNSPECIFIED": 0, + "PRIORITY_LOW": 1, + "PRIORITY_MEDIUM": 2, + "PRIORITY_HIGH": 3 + } + }, + "ClientContext": { + "fields": { + "secureContext": { + "keyType": "string", + "type": "google.protobuf.Value", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + }, + "DirectedReadOptions": { + "oneofs": { + "replicas": { + "oneof": [ + "includeReplicas", + "excludeReplicas" + ] + } + }, + "fields": { + "includeReplicas": { + "type": "IncludeReplicas", + "id": 1 + }, + "excludeReplicas": { + "type": "ExcludeReplicas", + "id": 2 + } + }, + "nested": { + "ReplicaSelection": { + "fields": { + "location": { + "type": "string", + "id": 1 + }, + "type": { + "type": "Type", + "id": 2 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "READ_WRITE": 1, + "READ_ONLY": 2 + } + } + } + }, + "IncludeReplicas": { + "fields": { + "replicaSelections": { + "rule": "repeated", + "type": "ReplicaSelection", + "id": 1 + }, + "autoFailoverDisabled": { + "type": "bool", + "id": 2 + } + } + }, + "ExcludeReplicas": { + "fields": { + "replicaSelections": { + "rule": "repeated", + "type": "ReplicaSelection", + "id": 1 + } + } + } + } + }, + "ExecuteSqlRequest": { + "fields": { + "session": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/Session" + } + }, + "transaction": { + "type": "TransactionSelector", + "id": 2 + }, + "sql": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "params": { + "type": "google.protobuf.Struct", + "id": 4 + }, + "paramTypes": { + "keyType": "string", + "type": "Type", + "id": 5 + }, + "resumeToken": { + "type": "bytes", + "id": 6 + }, + "queryMode": { + "type": "QueryMode", + "id": 7 + }, + "partitionToken": { + "type": "bytes", + "id": 8 + }, + "seqno": { + "type": "int64", + "id": 9 + }, + "queryOptions": { + "type": "QueryOptions", + "id": 10 + }, + "requestOptions": { + "type": "RequestOptions", + "id": 11 + }, + "directedReadOptions": { + "type": "DirectedReadOptions", + "id": 15 + }, + "dataBoostEnabled": { + "type": "bool", + "id": 16 + }, + "lastStatement": { + "type": "bool", + "id": 17, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "routingHint": { + "type": "RoutingHint", + "id": 18, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "QueryMode": { + "values": { + "NORMAL": 0, + "PLAN": 1, + "PROFILE": 2, + "WITH_STATS": 3, + "WITH_PLAN_AND_STATS": 4 + } + }, + "QueryOptions": { + "fields": { + "optimizerVersion": { + "type": "string", + "id": 1 + }, + "optimizerStatisticsPackage": { + "type": "string", + "id": 2 + } + } + } + } + }, + "ExecuteBatchDmlRequest": { + "fields": { + "session": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/Session" + } + }, + "transaction": { + "type": "TransactionSelector", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "statements": { + "rule": "repeated", + "type": "Statement", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "seqno": { + "type": "int64", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestOptions": { + "type": "RequestOptions", + "id": 5 + }, + "lastStatements": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "Statement": { + "fields": { + "sql": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "params": { + "type": "google.protobuf.Struct", + "id": 2 + }, + "paramTypes": { + "keyType": "string", + "type": "Type", + "id": 3 + } + } + } + } + }, + "ExecuteBatchDmlResponse": { + "fields": { + "resultSets": { + "rule": "repeated", + "type": "ResultSet", + "id": 1 + }, + "status": { + "type": "google.rpc.Status", + "id": 2 + }, + "precommitToken": { + "type": "MultiplexedSessionPrecommitToken", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "PartitionOptions": { + "fields": { + "partitionSizeBytes": { + "type": "int64", + "id": 1 + }, + "maxPartitions": { + "type": "int64", + "id": 2 + } + } + }, + "PartitionQueryRequest": { + "fields": { + "session": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/Session" + } + }, + "transaction": { + "type": "TransactionSelector", + "id": 2 + }, + "sql": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "params": { + "type": "google.protobuf.Struct", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "paramTypes": { + "keyType": "string", + "type": "Type", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "partitionOptions": { + "type": "PartitionOptions", + "id": 6 + } + } + }, + "PartitionReadRequest": { + "fields": { + "session": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/Session" + } + }, + "transaction": { + "type": "TransactionSelector", + "id": 2 + }, + "table": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "index": { + "type": "string", + "id": 4 + }, + "columns": { + "rule": "repeated", + "type": "string", + "id": 5 + }, + "keySet": { + "type": "KeySet", + "id": 6, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "partitionOptions": { + "type": "PartitionOptions", + "id": 9 + } + } + }, + "Partition": { + "fields": { + "partitionToken": { + "type": "bytes", + "id": 1 + } + } + }, + "PartitionResponse": { + "fields": { + "partitions": { + "rule": "repeated", + "type": "Partition", + "id": 1 + }, + "transaction": { + "type": "Transaction", + "id": 2 + } + } + }, + "ReadRequest": { + "fields": { + "session": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/Session" + } + }, + "transaction": { + "type": "TransactionSelector", + "id": 2 + }, + "table": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "index": { + "type": "string", + "id": 4 + }, + "columns": { + "rule": "repeated", + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "keySet": { + "type": "KeySet", + "id": 6, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "limit": { + "type": "int64", + "id": 8 + }, + "resumeToken": { + "type": "bytes", + "id": 9 + }, + "partitionToken": { + "type": "bytes", + "id": 10 + }, + "requestOptions": { + "type": "RequestOptions", + "id": 11 + }, + "directedReadOptions": { + "type": "DirectedReadOptions", + "id": 14 + }, + "dataBoostEnabled": { + "type": "bool", + "id": 15 + }, + "orderBy": { + "type": "OrderBy", + "id": 16, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "lockHint": { + "type": "LockHint", + "id": 17, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "routingHint": { + "type": "RoutingHint", + "id": 18, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "OrderBy": { + "values": { + "ORDER_BY_UNSPECIFIED": 0, + "ORDER_BY_PRIMARY_KEY": 1, + "ORDER_BY_NO_ORDER": 2 + } + }, + "LockHint": { + "values": { + "LOCK_HINT_UNSPECIFIED": 0, + "LOCK_HINT_SHARED": 1, + "LOCK_HINT_EXCLUSIVE": 2 + } + } + } + }, + "BeginTransactionRequest": { + "fields": { + "session": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/Session" + } + }, + "options": { + "type": "TransactionOptions", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestOptions": { + "type": "RequestOptions", + "id": 3 + }, + "mutationKey": { + "type": "Mutation", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "CommitRequest": { + "oneofs": { + "transaction": { + "oneof": [ + "transactionId", + "singleUseTransaction" + ] + } + }, + "fields": { + "session": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/Session" + } + }, + "transactionId": { + "type": "bytes", + "id": 2 + }, + "singleUseTransaction": { + "type": "TransactionOptions", + "id": 3 + }, + "mutations": { + "rule": "repeated", + "type": "Mutation", + "id": 4 + }, + "returnCommitStats": { + "type": "bool", + "id": 5 + }, + "maxCommitDelay": { + "type": "google.protobuf.Duration", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "requestOptions": { + "type": "RequestOptions", + "id": 6 + }, + "precommitToken": { + "type": "MultiplexedSessionPrecommitToken", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "RollbackRequest": { + "fields": { + "session": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/Session" + } + }, + "transactionId": { + "type": "bytes", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "BatchWriteRequest": { + "fields": { + "session": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/Session" + } + }, + "requestOptions": { + "type": "RequestOptions", + "id": 3 + }, + "mutationGroups": { + "rule": "repeated", + "type": "MutationGroup", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "excludeTxnFromChangeStreams": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "MutationGroup": { + "fields": { + "mutations": { + "rule": "repeated", + "type": "Mutation", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + } + } + }, + "BatchWriteResponse": { + "fields": { + "indexes": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "status": { + "type": "google.rpc.Status", + "id": 2 + }, + "commitTimestamp": { + "type": "google.protobuf.Timestamp", + "id": 3 + } + } + }, + "CommitResponse": { + "oneofs": { + "MultiplexedSessionRetry": { + "oneof": [ + "precommitToken" + ] + } + }, + "fields": { + "commitTimestamp": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "commitStats": { + "type": "CommitStats", + "id": 2 + }, + "precommitToken": { + "type": "MultiplexedSessionPrecommitToken", + "id": 4 + }, + "snapshotTimestamp": { + "type": "google.protobuf.Timestamp", + "id": 5 + } + }, + "nested": { + "CommitStats": { + "fields": { + "mutationCount": { + "type": "int64", + "id": 1 + } + } + } + } + }, + "TransactionOptions": { + "oneofs": { + "mode": { + "oneof": [ + "readWrite", + "partitionedDml", + "readOnly" + ] + } + }, + "fields": { + "readWrite": { + "type": "ReadWrite", + "id": 1 + }, + "partitionedDml": { + "type": "PartitionedDml", + "id": 3 + }, + "readOnly": { + "type": "ReadOnly", + "id": 2 + }, + "excludeTxnFromChangeStreams": { + "type": "bool", + "id": 5 + }, + "isolationLevel": { + "type": "IsolationLevel", + "id": 6 + } + }, + "nested": { + "ReadWrite": { + "fields": { + "readLockMode": { + "type": "ReadLockMode", + "id": 1 + }, + "multiplexedSessionPreviousTransactionId": { + "type": "bytes", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "ReadLockMode": { + "values": { + "READ_LOCK_MODE_UNSPECIFIED": 0, + "PESSIMISTIC": 1, + "OPTIMISTIC": 2 + } + } + } + }, + "PartitionedDml": { + "fields": {} + }, + "ReadOnly": { + "oneofs": { + "timestampBound": { + "oneof": [ + "strong", + "minReadTimestamp", + "maxStaleness", + "readTimestamp", + "exactStaleness" + ] + } + }, + "fields": { + "strong": { + "type": "bool", + "id": 1 + }, + "minReadTimestamp": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "maxStaleness": { + "type": "google.protobuf.Duration", + "id": 3 + }, + "readTimestamp": { + "type": "google.protobuf.Timestamp", + "id": 4 + }, + "exactStaleness": { + "type": "google.protobuf.Duration", + "id": 5 + }, + "returnReadTimestamp": { + "type": "bool", + "id": 6 + } + } + }, + "IsolationLevel": { + "values": { + "ISOLATION_LEVEL_UNSPECIFIED": 0, + "SERIALIZABLE": 1, + "REPEATABLE_READ": 2 + } + } + } + }, + "Transaction": { + "fields": { + "id": { + "type": "bytes", + "id": 1 + }, + "readTimestamp": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "precommitToken": { + "type": "MultiplexedSessionPrecommitToken", + "id": 3 + } + } + }, + "TransactionSelector": { + "oneofs": { + "selector": { + "oneof": [ + "singleUse", + "id", + "begin" + ] + } + }, + "fields": { + "singleUse": { + "type": "TransactionOptions", + "id": 1 + }, + "id": { + "type": "bytes", + "id": 2 + }, + "begin": { + "type": "TransactionOptions", + "id": 3 + } + } + }, + "MultiplexedSessionPrecommitToken": { + "fields": { + "precommitToken": { + "type": "bytes", + "id": 1 + }, + "seqNum": { + "type": "int32", + "id": 2 + } + } + }, + "KeyRange": { + "oneofs": { + "startKeyType": { + "oneof": [ + "startClosed", + "startOpen" + ] + }, + "endKeyType": { + "oneof": [ + "endClosed", + "endOpen" + ] + } + }, + "fields": { + "startClosed": { + "type": "google.protobuf.ListValue", + "id": 1 + }, + "startOpen": { + "type": "google.protobuf.ListValue", + "id": 2 + }, + "endClosed": { + "type": "google.protobuf.ListValue", + "id": 3 + }, + "endOpen": { + "type": "google.protobuf.ListValue", + "id": 4 + } + } + }, + "KeySet": { + "fields": { + "keys": { + "rule": "repeated", + "type": "google.protobuf.ListValue", + "id": 1 + }, + "ranges": { + "rule": "repeated", + "type": "KeyRange", + "id": 2 + }, + "all": { + "type": "bool", + "id": 3 + } + } + }, + "Range": { + "fields": { + "startKey": { + "type": "bytes", + "id": 1 + }, + "limitKey": { + "type": "bytes", + "id": 2 + }, + "groupUid": { + "type": "uint64", + "id": 3 + }, + "splitId": { + "type": "uint64", + "id": 4 + }, + "generation": { + "type": "bytes", + "id": 5 + } + } + }, + "Tablet": { + "fields": { + "tabletUid": { + "type": "uint64", + "id": 1 + }, + "serverAddress": { + "type": "string", + "id": 2 + }, + "location": { + "type": "string", + "id": 3 + }, + "role": { + "type": "Role", + "id": 4 + }, + "incarnation": { + "type": "bytes", + "id": 5 + }, + "distance": { + "type": "uint32", + "id": 6 + }, + "skip": { + "type": "bool", + "id": 7 + } + }, + "nested": { + "Role": { + "values": { + "ROLE_UNSPECIFIED": 0, + "READ_WRITE": 1, + "READ_ONLY": 2 + } + } + } + }, + "Group": { + "fields": { + "groupUid": { + "type": "uint64", + "id": 1 + }, + "tablets": { + "rule": "repeated", + "type": "Tablet", + "id": 2 + }, + "leaderIndex": { + "type": "int32", + "id": 3 + }, + "generation": { + "type": "bytes", + "id": 4 + } + } + }, + "KeyRecipe": { + "oneofs": { + "target": { + "oneof": [ + "tableName", + "indexName", + "operationUid" + ] + } + }, + "fields": { + "tableName": { + "type": "string", + "id": 1 + }, + "indexName": { + "type": "string", + "id": 2 + }, + "operationUid": { + "type": "uint64", + "id": 3 + }, + "part": { + "rule": "repeated", + "type": "Part", + "id": 4 + } + }, + "nested": { + "Part": { + "oneofs": { + "valueType": { + "oneof": [ + "identifier", + "value", + "random" + ] + } + }, + "fields": { + "tag": { + "type": "uint32", + "id": 1 + }, + "order": { + "type": "Order", + "id": 2 + }, + "nullOrder": { + "type": "NullOrder", + "id": 3 + }, + "type": { + "type": "Type", + "id": 4 + }, + "identifier": { + "type": "string", + "id": 5 + }, + "value": { + "type": "google.protobuf.Value", + "id": 6 + }, + "random": { + "type": "bool", + "id": 8 + }, + "structIdentifiers": { + "rule": "repeated", + "type": "int32", + "id": 7 + } + }, + "nested": { + "Order": { + "values": { + "ORDER_UNSPECIFIED": 0, + "ASCENDING": 1, + "DESCENDING": 2 + } + }, + "NullOrder": { + "values": { + "NULL_ORDER_UNSPECIFIED": 0, + "NULLS_FIRST": 1, + "NULLS_LAST": 2, + "NOT_NULL": 3 + } + } + } + } + } + }, + "RecipeList": { + "fields": { + "schemaGeneration": { + "type": "bytes", + "id": 1 + }, + "recipe": { + "rule": "repeated", + "type": "KeyRecipe", + "id": 3 + } + } + }, + "CacheUpdate": { + "fields": { + "databaseId": { + "type": "uint64", + "id": 1 + }, + "range": { + "rule": "repeated", + "type": "Range", + "id": 2 + }, + "group": { + "rule": "repeated", + "type": "Group", + "id": 3 + }, + "keyRecipes": { + "type": "RecipeList", + "id": 5 + } + } + }, + "RoutingHint": { + "fields": { + "operationUid": { + "type": "uint64", + "id": 1 + }, + "databaseId": { + "type": "uint64", + "id": 2 + }, + "schemaGeneration": { + "type": "bytes", + "id": 3 + }, + "key": { + "type": "bytes", + "id": 4 + }, + "limitKey": { + "type": "bytes", + "id": 5 + }, + "groupUid": { + "type": "uint64", + "id": 6 + }, + "splitId": { + "type": "uint64", + "id": 7 + }, + "tabletUid": { + "type": "uint64", + "id": 8 + }, + "skippedTabletUid": { + "rule": "repeated", + "type": "SkippedTablet", + "id": 9 + }, + "clientLocation": { + "type": "string", + "id": 10 + } + }, + "nested": { + "SkippedTablet": { + "fields": { + "tabletUid": { + "type": "uint64", + "id": 1 + }, + "incarnation": { + "type": "bytes", + "id": 2 + } + } + } + } + }, + "Type": { + "fields": { + "code": { + "type": "TypeCode", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "arrayElementType": { + "type": "Type", + "id": 2 + }, + "structType": { + "type": "StructType", + "id": 3 + }, + "typeAnnotation": { + "type": "TypeAnnotationCode", + "id": 4 + }, + "protoTypeFqn": { + "type": "string", + "id": 5 + } + } + }, + "StructType": { + "fields": { + "fields": { + "rule": "repeated", + "type": "Field", + "id": 1 + } + }, + "nested": { + "Field": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "type": { + "type": "Type", + "id": 2 + } + } + } + } + }, + "TypeCode": { + "values": { + "TYPE_CODE_UNSPECIFIED": 0, + "BOOL": 1, + "INT64": 2, + "FLOAT64": 3, + "FLOAT32": 15, + "TIMESTAMP": 4, + "DATE": 5, + "STRING": 6, + "BYTES": 7, + "ARRAY": 8, + "STRUCT": 9, + "NUMERIC": 10, + "JSON": 11, + "PROTO": 13, + "ENUM": 14, + "INTERVAL": 16, + "UUID": 17 + } + }, + "TypeAnnotationCode": { + "values": { + "TYPE_ANNOTATION_CODE_UNSPECIFIED": 0, + "PG_NUMERIC": 2, + "PG_JSONB": 3, + "PG_OID": 4 + } + }, + "Mutation": { + "oneofs": { + "operation": { + "oneof": [ + "insert", + "update", + "insertOrUpdate", + "replace", + "delete", + "send", + "ack" + ] + } + }, + "fields": { + "insert": { + "type": "Write", + "id": 1 + }, + "update": { + "type": "Write", + "id": 2 + }, + "insertOrUpdate": { + "type": "Write", + "id": 3 + }, + "replace": { + "type": "Write", + "id": 4 + }, + "delete": { + "type": "Delete", + "id": 5 + }, + "send": { + "type": "Send", + "id": 6 + }, + "ack": { + "type": "Ack", + "id": 7 + } + }, + "nested": { + "Write": { + "fields": { + "table": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "columns": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "values": { + "rule": "repeated", + "type": "google.protobuf.ListValue", + "id": 3 + } + } + }, + "Delete": { + "fields": { + "table": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "keySet": { + "type": "KeySet", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "Send": { + "fields": { + "queue": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "key": { + "type": "google.protobuf.ListValue", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "deliverTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + }, + "payload": { + "type": "google.protobuf.Value", + "id": 4 + } + } + }, + "Ack": { + "fields": { + "queue": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "key": { + "type": "google.protobuf.ListValue", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "ignoreNotFound": { + "type": "bool", + "id": 3 + } + } + } + } + }, + "ResultSet": { + "fields": { + "metadata": { + "type": "ResultSetMetadata", + "id": 1 + }, + "rows": { + "rule": "repeated", + "type": "google.protobuf.ListValue", + "id": 2 + }, + "stats": { + "type": "ResultSetStats", + "id": 3 + }, + "precommitToken": { + "type": "MultiplexedSessionPrecommitToken", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "cacheUpdate": { + "type": "CacheUpdate", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "PartialResultSet": { + "fields": { + "metadata": { + "type": "ResultSetMetadata", + "id": 1 + }, + "values": { + "rule": "repeated", + "type": "google.protobuf.Value", + "id": 2 + }, + "chunkedValue": { + "type": "bool", + "id": 3 + }, + "resumeToken": { + "type": "bytes", + "id": 4 + }, + "stats": { + "type": "ResultSetStats", + "id": 5 + }, + "precommitToken": { + "type": "MultiplexedSessionPrecommitToken", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "last": { + "type": "bool", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "cacheUpdate": { + "type": "CacheUpdate", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ResultSetMetadata": { + "fields": { + "rowType": { + "type": "StructType", + "id": 1 + }, + "transaction": { + "type": "Transaction", + "id": 2 + }, + "undeclaredParameters": { + "type": "StructType", + "id": 3 + } + } + }, + "ResultSetStats": { + "oneofs": { + "rowCount": { + "oneof": [ + "rowCountExact", + "rowCountLowerBound" + ] + } + }, + "fields": { + "queryPlan": { + "type": "QueryPlan", + "id": 1 + }, + "queryStats": { + "type": "google.protobuf.Struct", + "id": 2 + }, + "rowCountExact": { + "type": "int64", + "id": 3 + }, + "rowCountLowerBound": { + "type": "int64", + "id": 4 + } + } + }, + "PlanNode": { + "fields": { + "index": { + "type": "int32", + "id": 1 + }, + "kind": { + "type": "Kind", + "id": 2 + }, + "displayName": { + "type": "string", + "id": 3 + }, + "childLinks": { + "rule": "repeated", + "type": "ChildLink", + "id": 4 + }, + "shortRepresentation": { + "type": "ShortRepresentation", + "id": 5 + }, + "metadata": { + "type": "google.protobuf.Struct", + "id": 6 + }, + "executionStats": { + "type": "google.protobuf.Struct", + "id": 7 + } + }, + "nested": { + "Kind": { + "values": { + "KIND_UNSPECIFIED": 0, + "RELATIONAL": 1, + "SCALAR": 2 + } + }, + "ChildLink": { + "fields": { + "childIndex": { + "type": "int32", + "id": 1 + }, + "type": { + "type": "string", + "id": 2 + }, + "variable": { + "type": "string", + "id": 3 + } + } + }, + "ShortRepresentation": { + "fields": { + "description": { + "type": "string", + "id": 1 + }, + "subqueries": { + "keyType": "string", + "type": "int32", + "id": 2 + } + } + } + } + }, + "QueryAdvisorResult": { + "fields": { + "indexAdvice": { + "rule": "repeated", + "type": "IndexAdvice", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "IndexAdvice": { + "fields": { + "ddl": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "improvementFactor": { + "type": "double", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + }, + "QueryPlan": { + "fields": { + "planNodes": { + "rule": "repeated", + "type": "PlanNode", + "id": 1 + }, + "queryAdvice": { + "type": "QueryAdvisorResult", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + } + } + }, + "api": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/api;api", + "java_multiple_files": true, + "java_outer_classname": "LaunchStageProto", + "java_package": "com.google.api", + "objc_class_prefix": "GAPI", + "cc_enable_arenas": true + }, + "nested": { + "fieldBehavior": { + "rule": "repeated", + "type": "google.api.FieldBehavior", + "id": 1052, + "extend": "google.protobuf.FieldOptions", + "options": { + "packed": false + } + }, + "FieldBehavior": { + "values": { + "FIELD_BEHAVIOR_UNSPECIFIED": 0, + "OPTIONAL": 1, + "REQUIRED": 2, + "OUTPUT_ONLY": 3, + "INPUT_ONLY": 4, + "IMMUTABLE": 5, + "UNORDERED_LIST": 6, + "NON_EMPTY_DEFAULT": 7, + "IDENTIFIER": 8 + } + }, + "resourceReference": { + "type": "google.api.ResourceReference", + "id": 1055, + "extend": "google.protobuf.FieldOptions" + }, + "resourceDefinition": { + "rule": "repeated", + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.FileOptions" + }, + "resource": { + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.MessageOptions" + }, + "ResourceDescriptor": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "pattern": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "nameField": { + "type": "string", + "id": 3 + }, + "history": { + "type": "History", + "id": 4 + }, + "plural": { + "type": "string", + "id": 5 + }, + "singular": { + "type": "string", + "id": 6 + }, + "style": { + "rule": "repeated", + "type": "Style", + "id": 10 + } + }, + "nested": { + "History": { + "values": { + "HISTORY_UNSPECIFIED": 0, + "ORIGINALLY_SINGLE_PATTERN": 1, + "FUTURE_MULTI_PATTERN": 2 + } + }, + "Style": { + "values": { + "STYLE_UNSPECIFIED": 0, + "DECLARATIVE_FRIENDLY": 1 + } + } + } + }, + "ResourceReference": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "childType": { + "type": "string", + "id": 2 + } + } + }, + "http": { + "type": "HttpRule", + "id": 72295728, + "extend": "google.protobuf.MethodOptions" + }, + "Http": { + "fields": { + "rules": { + "rule": "repeated", + "type": "HttpRule", + "id": 1 + }, + "fullyDecodeReservedExpansion": { + "type": "bool", + "id": 2 + } + } + }, + "HttpRule": { + "oneofs": { + "pattern": { + "oneof": [ + "get", + "put", + "post", + "delete", + "patch", + "custom" + ] + } + }, + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "get": { + "type": "string", + "id": 2 + }, + "put": { + "type": "string", + "id": 3 + }, + "post": { + "type": "string", + "id": 4 + }, + "delete": { + "type": "string", + "id": 5 + }, + "patch": { + "type": "string", + "id": 6 + }, + "custom": { + "type": "CustomHttpPattern", + "id": 8 + }, + "body": { + "type": "string", + "id": 7 + }, + "responseBody": { + "type": "string", + "id": 12 + }, + "additionalBindings": { + "rule": "repeated", + "type": "HttpRule", + "id": 11 + } + } + }, + "CustomHttpPattern": { + "fields": { + "kind": { + "type": "string", + "id": 1 + }, + "path": { + "type": "string", + "id": 2 + } + } + }, + "methodSignature": { + "rule": "repeated", + "type": "string", + "id": 1051, + "extend": "google.protobuf.MethodOptions" + }, + "defaultHost": { + "type": "string", + "id": 1049, + "extend": "google.protobuf.ServiceOptions" + }, + "oauthScopes": { + "type": "string", + "id": 1050, + "extend": "google.protobuf.ServiceOptions" + }, + "apiVersion": { + "type": "string", + "id": 525000001, + "extend": "google.protobuf.ServiceOptions" + }, + "CommonLanguageSettings": { + "fields": { + "referenceDocsUri": { + "type": "string", + "id": 1, + "options": { + "deprecated": true + } + }, + "destinations": { + "rule": "repeated", + "type": "ClientLibraryDestination", + "id": 2 + } + } + }, + "ClientLibrarySettings": { + "fields": { + "version": { + "type": "string", + "id": 1 + }, + "launchStage": { + "type": "LaunchStage", + "id": 2 + }, + "restNumericEnums": { + "type": "bool", + "id": 3 + }, + "javaSettings": { + "type": "JavaSettings", + "id": 21 + }, + "cppSettings": { + "type": "CppSettings", + "id": 22 + }, + "phpSettings": { + "type": "PhpSettings", + "id": 23 + }, + "pythonSettings": { + "type": "PythonSettings", + "id": 24 + }, + "nodeSettings": { + "type": "NodeSettings", + "id": 25 + }, + "dotnetSettings": { + "type": "DotnetSettings", + "id": 26 + }, + "rubySettings": { + "type": "RubySettings", + "id": 27 + }, + "goSettings": { + "type": "GoSettings", + "id": 28 + } + } + }, + "Publishing": { + "fields": { + "methodSettings": { + "rule": "repeated", + "type": "MethodSettings", + "id": 2 + }, + "newIssueUri": { + "type": "string", + "id": 101 + }, + "documentationUri": { + "type": "string", + "id": 102 + }, + "apiShortName": { + "type": "string", + "id": 103 + }, + "githubLabel": { + "type": "string", + "id": 104 + }, + "codeownerGithubTeams": { + "rule": "repeated", + "type": "string", + "id": 105 + }, + "docTagPrefix": { + "type": "string", + "id": 106 + }, + "organization": { + "type": "ClientLibraryOrganization", + "id": 107 + }, + "librarySettings": { + "rule": "repeated", + "type": "ClientLibrarySettings", + "id": 109 + }, + "protoReferenceDocumentationUri": { + "type": "string", + "id": 110 + }, + "restReferenceDocumentationUri": { + "type": "string", + "id": 111 + } + } + }, + "JavaSettings": { + "fields": { + "libraryPackage": { + "type": "string", + "id": 1 + }, + "serviceClassNames": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "common": { + "type": "CommonLanguageSettings", + "id": 3 + } + } + }, + "CppSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "PhpSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "PythonSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "NodeSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "DotnetSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + }, + "renamedServices": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "renamedResources": { + "keyType": "string", + "type": "string", + "id": 3 + }, + "ignoredResources": { + "rule": "repeated", + "type": "string", + "id": 4 + }, + "forcedNamespaceAliases": { + "rule": "repeated", + "type": "string", + "id": 5 + }, + "handwrittenSignatures": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + }, + "RubySettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "GoSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "MethodSettings": { + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "longRunning": { + "type": "LongRunning", + "id": 2 + }, + "autoPopulatedFields": { + "rule": "repeated", + "type": "string", + "id": 3 + } + }, + "nested": { + "LongRunning": { + "fields": { + "initialPollDelay": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "pollDelayMultiplier": { + "type": "float", + "id": 2 + }, + "maxPollDelay": { + "type": "google.protobuf.Duration", + "id": 3 + }, + "totalPollTimeout": { + "type": "google.protobuf.Duration", + "id": 4 + } + } + } + } + }, + "ClientLibraryOrganization": { + "values": { + "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": 0, + "CLOUD": 1, + "ADS": 2, + "PHOTOS": 3, + "STREET_VIEW": 4, + "SHOPPING": 5, + "GEO": 6, + "GENERATIVE_AI": 7 + } + }, + "ClientLibraryDestination": { + "values": { + "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": 0, + "GITHUB": 10, + "PACKAGE_MANAGER": 20 + } + }, + "LaunchStage": { + "values": { + "LAUNCH_STAGE_UNSPECIFIED": 0, + "UNIMPLEMENTED": 6, + "PRELAUNCH": 7, + "EARLY_ACCESS": 1, + "ALPHA": 2, + "BETA": 3, + "GA": 4, + "DEPRECATED": 5 + } + } + } + }, + "protobuf": { + "options": { + "go_package": "google.golang.org/protobuf/types/descriptorpb", + "java_package": "com.google.protobuf", + "java_outer_classname": "DescriptorProtos", + "csharp_namespace": "Google.Protobuf.Reflection", + "objc_class_prefix": "GPB", + "cc_enable_arenas": true, + "optimize_for": "SPEED" + }, + "nested": { + "FileDescriptorSet": { + "edition": "proto2", + "fields": { + "file": { + "rule": "repeated", + "type": "FileDescriptorProto", + "id": 1 + } + } + }, + "Edition": { + "edition": "proto2", + "values": { + "EDITION_UNKNOWN": 0, + "EDITION_PROTO2": 998, + "EDITION_PROTO3": 999, + "EDITION_2023": 1000, + "EDITION_2024": 1001, + "EDITION_1_TEST_ONLY": 1, + "EDITION_2_TEST_ONLY": 2, + "EDITION_99997_TEST_ONLY": 99997, + "EDITION_99998_TEST_ONLY": 99998, + "EDITION_99999_TEST_ONLY": 99999, + "EDITION_MAX": 2147483647 + } + }, + "FileDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "package": { + "type": "string", + "id": 2 + }, + "dependency": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "publicDependency": { + "rule": "repeated", + "type": "int32", + "id": 10 + }, + "weakDependency": { + "rule": "repeated", + "type": "int32", + "id": 11 + }, + "messageType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 4 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 5 + }, + "service": { + "rule": "repeated", + "type": "ServiceDescriptorProto", + "id": 6 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 7 + }, + "options": { + "type": "FileOptions", + "id": 8 + }, + "sourceCodeInfo": { + "type": "SourceCodeInfo", + "id": 9 + }, + "syntax": { + "type": "string", + "id": 12 + }, + "edition": { + "type": "Edition", + "id": 14 + } + } + }, + "DescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "field": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 2 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 6 + }, + "nestedType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 3 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 4 + }, + "extensionRange": { + "rule": "repeated", + "type": "ExtensionRange", + "id": 5 + }, + "oneofDecl": { + "rule": "repeated", + "type": "OneofDescriptorProto", + "id": 8 + }, + "options": { + "type": "MessageOptions", + "id": 7 + }, + "reservedRange": { + "rule": "repeated", + "type": "ReservedRange", + "id": 9 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 10 + } + }, + "nested": { + "ExtensionRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "ExtensionRangeOptions", + "id": 3 + } + } + }, + "ReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "ExtensionRangeOptions": { + "edition": "proto2", + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + }, + "declaration": { + "rule": "repeated", + "type": "Declaration", + "id": 2, + "options": { + "retention": "RETENTION_SOURCE" + } + }, + "features": { + "type": "FeatureSet", + "id": 50 + }, + "verification": { + "type": "VerificationState", + "id": 3, + "options": { + "default": "UNVERIFIED", + "retention": "RETENTION_SOURCE" + } + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "Declaration": { + "fields": { + "number": { + "type": "int32", + "id": 1 + }, + "fullName": { + "type": "string", + "id": 2 + }, + "type": { + "type": "string", + "id": 3 + }, + "reserved": { + "type": "bool", + "id": 5 + }, + "repeated": { + "type": "bool", + "id": 6 + } + }, + "reserved": [ + [ + 4, + 4 + ] + ] + }, + "VerificationState": { + "values": { + "DECLARATION": 0, + "UNVERIFIED": 1 + } + } + } + }, + "FieldDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 3 + }, + "label": { + "type": "Label", + "id": 4 + }, + "type": { + "type": "Type", + "id": 5 + }, + "typeName": { + "type": "string", + "id": 6 + }, + "extendee": { + "type": "string", + "id": 2 + }, + "defaultValue": { + "type": "string", + "id": 7 + }, + "oneofIndex": { + "type": "int32", + "id": 9 + }, + "jsonName": { + "type": "string", + "id": 10 + }, + "options": { + "type": "FieldOptions", + "id": 8 + }, + "proto3Optional": { + "type": "bool", + "id": 17 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_DOUBLE": 1, + "TYPE_FLOAT": 2, + "TYPE_INT64": 3, + "TYPE_UINT64": 4, + "TYPE_INT32": 5, + "TYPE_FIXED64": 6, + "TYPE_FIXED32": 7, + "TYPE_BOOL": 8, + "TYPE_STRING": 9, + "TYPE_GROUP": 10, + "TYPE_MESSAGE": 11, + "TYPE_BYTES": 12, + "TYPE_UINT32": 13, + "TYPE_ENUM": 14, + "TYPE_SFIXED32": 15, + "TYPE_SFIXED64": 16, + "TYPE_SINT32": 17, + "TYPE_SINT64": 18 + } + }, + "Label": { + "values": { + "LABEL_OPTIONAL": 1, + "LABEL_REPEATED": 3, + "LABEL_REQUIRED": 2 + } + } + } + }, + "OneofDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "options": { + "type": "OneofOptions", + "id": 2 + } + } + }, + "EnumDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "value": { + "rule": "repeated", + "type": "EnumValueDescriptorProto", + "id": 2 + }, + "options": { + "type": "EnumOptions", + "id": 3 + }, + "reservedRange": { + "rule": "repeated", + "type": "EnumReservedRange", + "id": 4 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 5 + } + }, + "nested": { + "EnumReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "EnumValueDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "EnumValueOptions", + "id": 3 + } + } + }, + "ServiceDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "method": { + "rule": "repeated", + "type": "MethodDescriptorProto", + "id": 2 + }, + "options": { + "type": "ServiceOptions", + "id": 3 + } + } + }, + "MethodDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "inputType": { + "type": "string", + "id": 2 + }, + "outputType": { + "type": "string", + "id": 3 + }, + "options": { + "type": "MethodOptions", + "id": 4 + }, + "clientStreaming": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "serverStreaming": { + "type": "bool", + "id": 6, + "options": { + "default": false + } + } + } + }, + "FileOptions": { + "edition": "proto2", + "fields": { + "javaPackage": { + "type": "string", + "id": 1 + }, + "javaOuterClassname": { + "type": "string", + "id": 8 + }, + "javaMultipleFiles": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "javaGenerateEqualsAndHash": { + "type": "bool", + "id": 20, + "options": { + "deprecated": true + } + }, + "javaStringCheckUtf8": { + "type": "bool", + "id": 27, + "options": { + "default": false + } + }, + "optimizeFor": { + "type": "OptimizeMode", + "id": 9, + "options": { + "default": "SPEED" + } + }, + "goPackage": { + "type": "string", + "id": 11 + }, + "ccGenericServices": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "javaGenericServices": { + "type": "bool", + "id": 17, + "options": { + "default": false + } + }, + "pyGenericServices": { + "type": "bool", + "id": 18, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 23, + "options": { + "default": false + } + }, + "ccEnableArenas": { + "type": "bool", + "id": 31, + "options": { + "default": true + } + }, + "objcClassPrefix": { + "type": "string", + "id": 36 + }, + "csharpNamespace": { + "type": "string", + "id": 37 + }, + "swiftPrefix": { + "type": "string", + "id": 39 + }, + "phpClassPrefix": { + "type": "string", + "id": 40 + }, + "phpNamespace": { + "type": "string", + "id": 41 + }, + "phpMetadataNamespace": { + "type": "string", + "id": 44 + }, + "rubyPackage": { + "type": "string", + "id": 45 + }, + "features": { + "type": "FeatureSet", + "id": 50 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 42, + 42 + ], + [ + 38, + 38 + ] + ], + "nested": { + "OptimizeMode": { + "values": { + "SPEED": 1, + "CODE_SIZE": 2, + "LITE_RUNTIME": 3 + } + } + } + }, + "MessageOptions": { + "edition": "proto2", + "fields": { + "messageSetWireFormat": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "noStandardDescriptorAccessor": { + "type": "bool", + "id": 2, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "mapEntry": { + "type": "bool", + "id": 7 + }, + "deprecatedLegacyJsonFieldConflicts": { + "type": "bool", + "id": 11, + "options": { + "deprecated": true + } + }, + "features": { + "type": "FeatureSet", + "id": 12 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ], + [ + 5, + 5 + ], + [ + 6, + 6 + ], + [ + 8, + 8 + ], + [ + 9, + 9 + ] + ] + }, + "FieldOptions": { + "edition": "proto2", + "fields": { + "ctype": { + "type": "CType", + "id": 1, + "options": { + "default": "STRING" + } + }, + "packed": { + "type": "bool", + "id": 2 + }, + "jstype": { + "type": "JSType", + "id": 6, + "options": { + "default": "JS_NORMAL" + } + }, + "lazy": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "unverifiedLazy": { + "type": "bool", + "id": 15, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "weak": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "debugRedact": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "retention": { + "type": "OptionRetention", + "id": 17 + }, + "targets": { + "rule": "repeated", + "type": "OptionTargetType", + "id": 19 + }, + "editionDefaults": { + "rule": "repeated", + "type": "EditionDefault", + "id": 20 + }, + "features": { + "type": "FeatureSet", + "id": 21 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ], + [ + 18, + 18 + ] + ], + "nested": { + "CType": { + "values": { + "STRING": 0, + "CORD": 1, + "STRING_PIECE": 2 + } + }, + "JSType": { + "values": { + "JS_NORMAL": 0, + "JS_STRING": 1, + "JS_NUMBER": 2 + } + }, + "OptionRetention": { + "values": { + "RETENTION_UNKNOWN": 0, + "RETENTION_RUNTIME": 1, + "RETENTION_SOURCE": 2 + } + }, + "OptionTargetType": { + "values": { + "TARGET_TYPE_UNKNOWN": 0, + "TARGET_TYPE_FILE": 1, + "TARGET_TYPE_EXTENSION_RANGE": 2, + "TARGET_TYPE_MESSAGE": 3, + "TARGET_TYPE_FIELD": 4, + "TARGET_TYPE_ONEOF": 5, + "TARGET_TYPE_ENUM": 6, + "TARGET_TYPE_ENUM_ENTRY": 7, + "TARGET_TYPE_SERVICE": 8, + "TARGET_TYPE_METHOD": 9 + } + }, + "EditionDefault": { + "fields": { + "edition": { + "type": "Edition", + "id": 3 + }, + "value": { + "type": "string", + "id": 2 + } + } + } + } + }, + "OneofOptions": { + "edition": "proto2", + "fields": { + "features": { + "type": "FeatureSet", + "id": 1 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "EnumOptions": { + "edition": "proto2", + "fields": { + "allowAlias": { + "type": "bool", + "id": 2 + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "deprecatedLegacyJsonFieldConflicts": { + "type": "bool", + "id": 6, + "options": { + "deprecated": true + } + }, + "features": { + "type": "FeatureSet", + "id": 7 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 5, + 5 + ] + ] + }, + "EnumValueOptions": { + "edition": "proto2", + "fields": { + "deprecated": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "features": { + "type": "FeatureSet", + "id": 2 + }, + "debugRedact": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "edition": "proto2", + "fields": { + "features": { + "type": "FeatureSet", + "id": 34 + }, + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "MethodOptions": { + "edition": "proto2", + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "idempotencyLevel": { + "type": "IdempotencyLevel", + "id": 34, + "options": { + "default": "IDEMPOTENCY_UNKNOWN" + } + }, + "features": { + "type": "FeatureSet", + "id": 35 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "IdempotencyLevel": { + "values": { + "IDEMPOTENCY_UNKNOWN": 0, + "NO_SIDE_EFFECTS": 1, + "IDEMPOTENT": 2 + } + } + } + }, + "UninterpretedOption": { + "edition": "proto2", + "fields": { + "name": { + "rule": "repeated", + "type": "NamePart", + "id": 2 + }, + "identifierValue": { + "type": "string", + "id": 3 + }, + "positiveIntValue": { + "type": "uint64", + "id": 4 + }, + "negativeIntValue": { + "type": "int64", + "id": 5 + }, + "doubleValue": { + "type": "double", + "id": 6 + }, + "stringValue": { + "type": "bytes", + "id": 7 + }, + "aggregateValue": { + "type": "string", + "id": 8 + } + }, + "nested": { + "NamePart": { + "fields": { + "namePart": { + "rule": "required", + "type": "string", + "id": 1 + }, + "isExtension": { + "rule": "required", + "type": "bool", + "id": 2 + } + } + } + } + }, + "FeatureSet": { + "edition": "proto2", + "fields": { + "fieldPresence": { + "type": "FieldPresence", + "id": 1, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_2023", + "edition_defaults.value": "EXPLICIT" + } + }, + "enumType": { + "type": "EnumType", + "id": 2, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "OPEN" + } + }, + "repeatedFieldEncoding": { + "type": "RepeatedFieldEncoding", + "id": 3, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "PACKED" + } + }, + "utf8Validation": { + "type": "Utf8Validation", + "id": 4, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "VERIFY" + } + }, + "messageEncoding": { + "type": "MessageEncoding", + "id": 5, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO2", + "edition_defaults.value": "LENGTH_PREFIXED" + } + }, + "jsonFormat": { + "type": "JsonFormat", + "id": 6, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "ALLOW" + } + } + }, + "extensions": [ + [ + 1000, + 1000 + ], + [ + 1001, + 1001 + ], + [ + 1002, + 1002 + ], + [ + 9990, + 9990 + ], + [ + 9995, + 9999 + ], + [ + 10000, + 10000 + ] + ], + "reserved": [ + [ + 999, + 999 + ] + ], + "nested": { + "FieldPresence": { + "values": { + "FIELD_PRESENCE_UNKNOWN": 0, + "EXPLICIT": 1, + "IMPLICIT": 2, + "LEGACY_REQUIRED": 3 + } + }, + "EnumType": { + "values": { + "ENUM_TYPE_UNKNOWN": 0, + "OPEN": 1, + "CLOSED": 2 + } + }, + "RepeatedFieldEncoding": { + "values": { + "REPEATED_FIELD_ENCODING_UNKNOWN": 0, + "PACKED": 1, + "EXPANDED": 2 + } + }, + "Utf8Validation": { + "values": { + "UTF8_VALIDATION_UNKNOWN": 0, + "VERIFY": 2, + "NONE": 3 + } + }, + "MessageEncoding": { + "values": { + "MESSAGE_ENCODING_UNKNOWN": 0, + "LENGTH_PREFIXED": 1, + "DELIMITED": 2 + } + }, + "JsonFormat": { + "values": { + "JSON_FORMAT_UNKNOWN": 0, + "ALLOW": 1, + "LEGACY_BEST_EFFORT": 2 + } + } + } + }, + "FeatureSetDefaults": { + "edition": "proto2", + "fields": { + "defaults": { + "rule": "repeated", + "type": "FeatureSetEditionDefault", + "id": 1 + }, + "minimumEdition": { + "type": "Edition", + "id": 4 + }, + "maximumEdition": { + "type": "Edition", + "id": 5 + } + }, + "nested": { + "FeatureSetEditionDefault": { + "fields": { + "edition": { + "type": "Edition", + "id": 3 + }, + "features": { + "type": "FeatureSet", + "id": 2 + } + } + } + } + }, + "SourceCodeInfo": { + "edition": "proto2", + "fields": { + "location": { + "rule": "repeated", + "type": "Location", + "id": 1 + } + }, + "nested": { + "Location": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1, + "options": { + "packed": true + } + }, + "span": { + "rule": "repeated", + "type": "int32", + "id": 2, + "options": { + "packed": true + } + }, + "leadingComments": { + "type": "string", + "id": 3 + }, + "trailingComments": { + "type": "string", + "id": 4 + }, + "leadingDetachedComments": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + } + } + }, + "GeneratedCodeInfo": { + "edition": "proto2", + "fields": { + "annotation": { + "rule": "repeated", + "type": "Annotation", + "id": 1 + } + }, + "nested": { + "Annotation": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1, + "options": { + "packed": true + } + }, + "sourceFile": { + "type": "string", + "id": 2 + }, + "begin": { + "type": "int32", + "id": 3 + }, + "end": { + "type": "int32", + "id": 4 + }, + "semantic": { + "type": "Semantic", + "id": 5 + } + }, + "nested": { + "Semantic": { + "values": { + "NONE": 0, + "SET": 1, + "ALIAS": 2 + } + } + } + } + } + }, + "Duration": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Any": { + "fields": { + "type_url": { + "type": "string", + "id": 1 + }, + "value": { + "type": "bytes", + "id": 2 + } + } + }, + "Empty": { + "fields": {} + }, + "FieldMask": { + "fields": { + "paths": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "Timestamp": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Struct": { + "fields": { + "fields": { + "keyType": "string", + "type": "Value", + "id": 1 + } + } + }, + "Value": { + "oneofs": { + "kind": { + "oneof": [ + "nullValue", + "numberValue", + "stringValue", + "boolValue", + "structValue", + "listValue" + ] + } + }, + "fields": { + "nullValue": { + "type": "NullValue", + "id": 1 + }, + "numberValue": { + "type": "double", + "id": 2 + }, + "stringValue": { + "type": "string", + "id": 3 + }, + "boolValue": { + "type": "bool", + "id": 4 + }, + "structValue": { + "type": "Struct", + "id": 5 + }, + "listValue": { + "type": "ListValue", + "id": 6 + } + } + }, + "NullValue": { + "values": { + "NULL_VALUE": 0 + } + }, + "ListValue": { + "fields": { + "values": { + "rule": "repeated", + "type": "Value", + "id": 1 + } + } + } + } + }, + "longrunning": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.LongRunning", + "go_package": "cloud.google.com/go/longrunning/autogen/longrunningpb;longrunningpb", + "java_multiple_files": true, + "java_outer_classname": "OperationsProto", + "java_package": "com.google.longrunning", + "php_namespace": "Google\\LongRunning" + }, + "nested": { + "operationInfo": { + "type": "google.longrunning.OperationInfo", + "id": 1049, + "extend": "google.protobuf.MethodOptions" + }, + "Operations": { + "options": { + "(google.api.default_host)": "longrunning.googleapis.com" + }, + "methods": { + "ListOperations": { + "requestType": "ListOperationsRequest", + "responseType": "ListOperationsResponse", + "options": { + "(google.api.http).get": "/v1/{name=operations}", + "(google.api.method_signature)": "name,filter" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations}" + } + }, + { + "(google.api.method_signature)": "name,filter" + } + ] + }, + "GetOperation": { + "requestType": "GetOperationRequest", + "responseType": "Operation", + "options": { + "(google.api.http).get": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "DeleteOperation": { + "requestType": "DeleteOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CancelOperation": { + "requestType": "CancelOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).post": "/v1/{name=operations/**}:cancel", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=operations/**}:cancel", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "WaitOperation": { + "requestType": "WaitOperationRequest", + "responseType": "Operation" + } + } + }, + "Operation": { + "oneofs": { + "result": { + "oneof": [ + "error", + "response" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "metadata": { + "type": "google.protobuf.Any", + "id": 2 + }, + "done": { + "type": "bool", + "id": 3 + }, + "error": { + "type": "google.rpc.Status", + "id": 4 + }, + "response": { + "type": "google.protobuf.Any", + "id": 5 + } + } + }, + "GetOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "ListOperationsRequest": { + "fields": { + "name": { + "type": "string", + "id": 4 + }, + "filter": { + "type": "string", + "id": 1 + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListOperationsResponse": { + "fields": { + "operations": { + "rule": "repeated", + "type": "Operation", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CancelOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "DeleteOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "WaitOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "timeout": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + }, + "OperationInfo": { + "fields": { + "responseType": { + "type": "string", + "id": 1 + }, + "metadataType": { + "type": "string", + "id": 2 + } + } + } + } + }, + "rpc": { + "options": { + "cc_enable_arenas": true, + "go_package": "google.golang.org/genproto/googleapis/rpc/status;status", + "java_multiple_files": true, + "java_outer_classname": "StatusProto", + "java_package": "com.google.rpc", + "objc_class_prefix": "RPC" + }, + "nested": { + "Status": { + "fields": { + "code": { + "type": "int32", + "id": 1 + }, + "message": { + "type": "string", + "id": 2 + }, + "details": { + "rule": "repeated", + "type": "google.protobuf.Any", + "id": 3 + } + } + } + } + }, + "iam": { + "nested": { + "v1": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.Cloud.Iam.V1", + "go_package": "cloud.google.com/go/iam/apiv1/iampb;iampb", + "java_multiple_files": true, + "java_outer_classname": "PolicyProto", + "java_package": "com.google.iam.v1", + "php_namespace": "Google\\Cloud\\Iam\\V1" + }, + "nested": { + "IAMPolicy": { + "options": { + "(google.api.default_host)": "iam-meta-api.googleapis.com" + }, + "methods": { + "SetIamPolicy": { + "requestType": "SetIamPolicyRequest", + "responseType": "Policy", + "options": { + "(google.api.http).post": "/v1/{resource=**}:setIamPolicy", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{resource=**}:setIamPolicy", + "body": "*" + } + } + ] + }, + "GetIamPolicy": { + "requestType": "GetIamPolicyRequest", + "responseType": "Policy", + "options": { + "(google.api.http).post": "/v1/{resource=**}:getIamPolicy", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{resource=**}:getIamPolicy", + "body": "*" + } + } + ] + }, + "TestIamPermissions": { + "requestType": "TestIamPermissionsRequest", + "responseType": "TestIamPermissionsResponse", + "options": { + "(google.api.http).post": "/v1/{resource=**}:testIamPermissions", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{resource=**}:testIamPermissions", + "body": "*" + } + } + ] + } + } + }, + "SetIamPolicyRequest": { + "fields": { + "resource": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "*" + } + }, + "policy": { + "type": "Policy", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 3 + } + } + }, + "GetIamPolicyRequest": { + "fields": { + "resource": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "*" + } + }, + "options": { + "type": "GetPolicyOptions", + "id": 2 + } + } + }, + "TestIamPermissionsRequest": { + "fields": { + "resource": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "*" + } + }, + "permissions": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "TestIamPermissionsResponse": { + "fields": { + "permissions": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "GetPolicyOptions": { + "fields": { + "requestedPolicyVersion": { + "type": "int32", + "id": 1 + } + } + }, + "Policy": { + "fields": { + "version": { + "type": "int32", + "id": 1 + }, + "bindings": { + "rule": "repeated", + "type": "Binding", + "id": 4 + }, + "auditConfigs": { + "rule": "repeated", + "type": "AuditConfig", + "id": 6 + }, + "etag": { + "type": "bytes", + "id": 3 + } + } + }, + "Binding": { + "fields": { + "role": { + "type": "string", + "id": 1 + }, + "members": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "condition": { + "type": "google.type.Expr", + "id": 3 + } + } + }, + "AuditConfig": { + "fields": { + "service": { + "type": "string", + "id": 1 + }, + "auditLogConfigs": { + "rule": "repeated", + "type": "AuditLogConfig", + "id": 3 + } + } + }, + "AuditLogConfig": { + "fields": { + "logType": { + "type": "LogType", + "id": 1 + }, + "exemptedMembers": { + "rule": "repeated", + "type": "string", + "id": 2 + } + }, + "nested": { + "LogType": { + "values": { + "LOG_TYPE_UNSPECIFIED": 0, + "ADMIN_READ": 1, + "DATA_WRITE": 2, + "DATA_READ": 3 + } + } + } + }, + "PolicyDelta": { + "fields": { + "bindingDeltas": { + "rule": "repeated", + "type": "BindingDelta", + "id": 1 + }, + "auditConfigDeltas": { + "rule": "repeated", + "type": "AuditConfigDelta", + "id": 2 + } + } + }, + "BindingDelta": { + "fields": { + "action": { + "type": "Action", + "id": 1 + }, + "role": { + "type": "string", + "id": 2 + }, + "member": { + "type": "string", + "id": 3 + }, + "condition": { + "type": "google.type.Expr", + "id": 4 + } + }, + "nested": { + "Action": { + "values": { + "ACTION_UNSPECIFIED": 0, + "ADD": 1, + "REMOVE": 2 + } + } + } + }, + "AuditConfigDelta": { + "fields": { + "action": { + "type": "Action", + "id": 1 + }, + "service": { + "type": "string", + "id": 2 + }, + "exemptedMember": { + "type": "string", + "id": 3 + }, + "logType": { + "type": "string", + "id": 4 + } + }, + "nested": { + "Action": { + "values": { + "ACTION_UNSPECIFIED": 0, + "ADD": 1, + "REMOVE": 2 + } + } + } + } + } + } + } + }, + "type": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/type/expr;expr", + "java_multiple_files": true, + "java_outer_classname": "ExprProto", + "java_package": "com.google.type", + "objc_class_prefix": "GTP" + }, + "nested": { + "Expr": { + "fields": { + "expression": { + "type": "string", + "id": 1 + }, + "title": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + }, + "location": { + "type": "string", + "id": 4 + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/owl-bot-staging/executor/v1/src/index.ts b/owl-bot-staging/executor/v1/src/index.ts new file mode 100644 index 000000000..e6dcb78a8 --- /dev/null +++ b/owl-bot-staging/executor/v1/src/index.ts @@ -0,0 +1,25 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as v1 from './v1'; +const SpannerExecutorProxyClient = v1.SpannerExecutorProxyClient; +type SpannerExecutorProxyClient = v1.SpannerExecutorProxyClient; +export {v1, SpannerExecutorProxyClient}; +export default {v1, SpannerExecutorProxyClient}; +import * as protos from '../protos/protos'; +export {protos} diff --git a/owl-bot-staging/executor/v1/src/v1/gapic_metadata.json b/owl-bot-staging/executor/v1/src/v1/gapic_metadata.json new file mode 100644 index 000000000..fd7e7f8cc --- /dev/null +++ b/owl-bot-staging/executor/v1/src/v1/gapic_metadata.json @@ -0,0 +1,27 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.spanner.executor.v1", + "libraryPackage": "@google-cloud/executor", + "services": { + "SpannerExecutorProxy": { + "clients": { + "grpc": { + "libraryClient": "SpannerExecutorProxyClient", + "rpcs": { + "ExecuteActionAsync": { + "methods": [ + "executeActionAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "SpannerExecutorProxyClient", + "rpcs": {} + } + } + } + } +} diff --git a/owl-bot-staging/executor/v1/src/v1/index.ts b/owl-bot-staging/executor/v1/src/v1/index.ts new file mode 100644 index 000000000..6da8e65b8 --- /dev/null +++ b/owl-bot-staging/executor/v1/src/v1/index.ts @@ -0,0 +1,19 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +export {SpannerExecutorProxyClient} from './spanner_executor_proxy_client'; diff --git a/owl-bot-staging/executor/v1/src/v1/spanner_executor_proxy_client.ts b/owl-bot-staging/executor/v1/src/v1/spanner_executor_proxy_client.ts new file mode 100644 index 000000000..538f733a1 --- /dev/null +++ b/owl-bot-staging/executor/v1/src/v1/spanner_executor_proxy_client.ts @@ -0,0 +1,816 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions} from 'google-gax'; +import {PassThrough} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v1/spanner_executor_proxy_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './spanner_executor_proxy_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service that executes SpannerActions asynchronously. + * @class + * @memberof v1 + */ +export class SpannerExecutorProxyClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('executor'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + spannerExecutorProxyStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of SpannerExecutorProxyClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new SpannerExecutorProxyClient({fallback: true}, gax); + * ``` + */ + constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof SpannerExecutorProxyClient; + if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { + throw new Error('Please set either universe_domain or universeDomain, but not both.'); + } + const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; + this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; + this._servicePath = 'spanner-cloud-executor.' + this._universeDomain; + const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== this._servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process === 'object' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + backupPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/instances/{instance}/backups/{backup}' + ), + backupSchedulePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/instances/{instance}/databases/{database}/backupSchedules/{schedule}' + ), + databasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/instances/{instance}/databases/{database}' + ), + databaseRolePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/instances/{instance}/databases/{database}/databaseRoles/{role}' + ), + instancePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/instances/{instance}' + ), + instanceConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/instanceConfigs/{instance_config}' + ), + instancePartitionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/instances/{instance}/instancePartitions/{instance_partition}' + ), + sessionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/instances/{instance}/databases/{database}/sessions/{session}' + ), + }; + + // Some of the methods on this service provide streaming responses. + // Provide descriptors for these. + this.descriptors.stream = { + executeActionAsync: new this._gaxModule.StreamDescriptor(this._gaxModule.StreamType.BIDI_STREAMING, !!opts.fallback, !!opts.gaxServerStreamingRetries) + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.spanner.executor.v1.SpannerExecutorProxy', gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.spannerExecutorProxyStub) { + return this.spannerExecutorProxyStub; + } + + // Put together the "service stub" for + // google.spanner.executor.v1.SpannerExecutorProxy. + this.spannerExecutorProxyStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.spanner.executor.v1.SpannerExecutorProxy') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.spanner.executor.v1.SpannerExecutorProxy, + this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const spannerExecutorProxyStubMethods = + ['executeActionAsync']; + for (const methodName of spannerExecutorProxyStubMethods) { + const callPromise = this.spannerExecutorProxyStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + if (methodName in this.descriptors.stream) { + const stream = new PassThrough({objectMode: true}); + setImmediate(() => { + stream.emit('error', new this._gaxModule.GoogleError('The client has already been closed.')); + }); + return stream; + } + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + this.descriptors.stream[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.spannerExecutorProxyStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'spanner-cloud-executor.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'spanner-cloud-executor.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return []; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + +/** + * ExecuteActionAsync is a streaming call that starts executing a new Spanner + * action. + * + * For each request, the server will reply with one or more responses, but + * only the last response will contain status in the outcome. + * + * Responses can be matched to requests by action_id. It is allowed to have + * multiple actions in flight--in that case, actions are be executed in + * parallel. + * + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which is both readable and writable. It accepts objects + * representing {@link protos.google.spanner.executor.v1.SpannerAsyncActionRequest|SpannerAsyncActionRequest} for write() method, and + * will emit objects representing {@link protos.google.spanner.executor.v1.SpannerAsyncActionResponse|SpannerAsyncActionResponse} on 'data' event asynchronously. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#bi-directional-streaming | documentation } + * for more details and examples. + * @example include:samples/generated/v1/spanner_executor_proxy.execute_action_async.js + * region_tag:spanner-cloud-executor_v1_generated_SpannerExecutorProxy_ExecuteActionAsync_async + */ + executeActionAsync( + options?: CallOptions): + gax.CancellableStream { + this.initialize().catch(err => {throw err}); + this._log.info('executeActionAsync stream %j', options); + return this.innerApiCalls.executeActionAsync(null, options); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified backup resource name string. + * + * @param {string} project + * @param {string} instance + * @param {string} backup + * @returns {string} Resource name string. + */ + backupPath(project:string,instance:string,backup:string) { + return this.pathTemplates.backupPathTemplate.render({ + project: project, + instance: instance, + backup: backup, + }); + } + + /** + * Parse the project from Backup resource. + * + * @param {string} backupName + * A fully-qualified path representing Backup resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBackupName(backupName: string) { + return this.pathTemplates.backupPathTemplate.match(backupName).project; + } + + /** + * Parse the instance from Backup resource. + * + * @param {string} backupName + * A fully-qualified path representing Backup resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromBackupName(backupName: string) { + return this.pathTemplates.backupPathTemplate.match(backupName).instance; + } + + /** + * Parse the backup from Backup resource. + * + * @param {string} backupName + * A fully-qualified path representing Backup resource. + * @returns {string} A string representing the backup. + */ + matchBackupFromBackupName(backupName: string) { + return this.pathTemplates.backupPathTemplate.match(backupName).backup; + } + + /** + * Return a fully-qualified backupSchedule resource name string. + * + * @param {string} project + * @param {string} instance + * @param {string} database + * @param {string} schedule + * @returns {string} Resource name string. + */ + backupSchedulePath(project:string,instance:string,database:string,schedule:string) { + return this.pathTemplates.backupSchedulePathTemplate.render({ + project: project, + instance: instance, + database: database, + schedule: schedule, + }); + } + + /** + * Parse the project from BackupSchedule resource. + * + * @param {string} backupScheduleName + * A fully-qualified path representing BackupSchedule resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBackupScheduleName(backupScheduleName: string) { + return this.pathTemplates.backupSchedulePathTemplate.match(backupScheduleName).project; + } + + /** + * Parse the instance from BackupSchedule resource. + * + * @param {string} backupScheduleName + * A fully-qualified path representing BackupSchedule resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromBackupScheduleName(backupScheduleName: string) { + return this.pathTemplates.backupSchedulePathTemplate.match(backupScheduleName).instance; + } + + /** + * Parse the database from BackupSchedule resource. + * + * @param {string} backupScheduleName + * A fully-qualified path representing BackupSchedule resource. + * @returns {string} A string representing the database. + */ + matchDatabaseFromBackupScheduleName(backupScheduleName: string) { + return this.pathTemplates.backupSchedulePathTemplate.match(backupScheduleName).database; + } + + /** + * Parse the schedule from BackupSchedule resource. + * + * @param {string} backupScheduleName + * A fully-qualified path representing BackupSchedule resource. + * @returns {string} A string representing the schedule. + */ + matchScheduleFromBackupScheduleName(backupScheduleName: string) { + return this.pathTemplates.backupSchedulePathTemplate.match(backupScheduleName).schedule; + } + + /** + * Return a fully-qualified database resource name string. + * + * @param {string} project + * @param {string} instance + * @param {string} database + * @returns {string} Resource name string. + */ + databasePath(project:string,instance:string,database:string) { + return this.pathTemplates.databasePathTemplate.render({ + project: project, + instance: instance, + database: database, + }); + } + + /** + * Parse the project from Database resource. + * + * @param {string} databaseName + * A fully-qualified path representing Database resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDatabaseName(databaseName: string) { + return this.pathTemplates.databasePathTemplate.match(databaseName).project; + } + + /** + * Parse the instance from Database resource. + * + * @param {string} databaseName + * A fully-qualified path representing Database resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromDatabaseName(databaseName: string) { + return this.pathTemplates.databasePathTemplate.match(databaseName).instance; + } + + /** + * Parse the database from Database resource. + * + * @param {string} databaseName + * A fully-qualified path representing Database resource. + * @returns {string} A string representing the database. + */ + matchDatabaseFromDatabaseName(databaseName: string) { + return this.pathTemplates.databasePathTemplate.match(databaseName).database; + } + + /** + * Return a fully-qualified databaseRole resource name string. + * + * @param {string} project + * @param {string} instance + * @param {string} database + * @param {string} role + * @returns {string} Resource name string. + */ + databaseRolePath(project:string,instance:string,database:string,role:string) { + return this.pathTemplates.databaseRolePathTemplate.render({ + project: project, + instance: instance, + database: database, + role: role, + }); + } + + /** + * Parse the project from DatabaseRole resource. + * + * @param {string} databaseRoleName + * A fully-qualified path representing DatabaseRole resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDatabaseRoleName(databaseRoleName: string) { + return this.pathTemplates.databaseRolePathTemplate.match(databaseRoleName).project; + } + + /** + * Parse the instance from DatabaseRole resource. + * + * @param {string} databaseRoleName + * A fully-qualified path representing DatabaseRole resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromDatabaseRoleName(databaseRoleName: string) { + return this.pathTemplates.databaseRolePathTemplate.match(databaseRoleName).instance; + } + + /** + * Parse the database from DatabaseRole resource. + * + * @param {string} databaseRoleName + * A fully-qualified path representing DatabaseRole resource. + * @returns {string} A string representing the database. + */ + matchDatabaseFromDatabaseRoleName(databaseRoleName: string) { + return this.pathTemplates.databaseRolePathTemplate.match(databaseRoleName).database; + } + + /** + * Parse the role from DatabaseRole resource. + * + * @param {string} databaseRoleName + * A fully-qualified path representing DatabaseRole resource. + * @returns {string} A string representing the role. + */ + matchRoleFromDatabaseRoleName(databaseRoleName: string) { + return this.pathTemplates.databaseRolePathTemplate.match(databaseRoleName).role; + } + + /** + * Return a fully-qualified instance resource name string. + * + * @param {string} project + * @param {string} instance + * @returns {string} Resource name string. + */ + instancePath(project:string,instance:string) { + return this.pathTemplates.instancePathTemplate.render({ + project: project, + instance: instance, + }); + } + + /** + * Parse the project from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the project. + */ + matchProjectFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).project; + } + + /** + * Parse the instance from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).instance; + } + + /** + * Return a fully-qualified instanceConfig resource name string. + * + * @param {string} project + * @param {string} instance_config + * @returns {string} Resource name string. + */ + instanceConfigPath(project:string,instanceConfig:string) { + return this.pathTemplates.instanceConfigPathTemplate.render({ + project: project, + instance_config: instanceConfig, + }); + } + + /** + * Parse the project from InstanceConfig resource. + * + * @param {string} instanceConfigName + * A fully-qualified path representing InstanceConfig resource. + * @returns {string} A string representing the project. + */ + matchProjectFromInstanceConfigName(instanceConfigName: string) { + return this.pathTemplates.instanceConfigPathTemplate.match(instanceConfigName).project; + } + + /** + * Parse the instance_config from InstanceConfig resource. + * + * @param {string} instanceConfigName + * A fully-qualified path representing InstanceConfig resource. + * @returns {string} A string representing the instance_config. + */ + matchInstanceConfigFromInstanceConfigName(instanceConfigName: string) { + return this.pathTemplates.instanceConfigPathTemplate.match(instanceConfigName).instance_config; + } + + /** + * Return a fully-qualified instancePartition resource name string. + * + * @param {string} project + * @param {string} instance + * @param {string} instance_partition + * @returns {string} Resource name string. + */ + instancePartitionPath(project:string,instance:string,instancePartition:string) { + return this.pathTemplates.instancePartitionPathTemplate.render({ + project: project, + instance: instance, + instance_partition: instancePartition, + }); + } + + /** + * Parse the project from InstancePartition resource. + * + * @param {string} instancePartitionName + * A fully-qualified path representing InstancePartition resource. + * @returns {string} A string representing the project. + */ + matchProjectFromInstancePartitionName(instancePartitionName: string) { + return this.pathTemplates.instancePartitionPathTemplate.match(instancePartitionName).project; + } + + /** + * Parse the instance from InstancePartition resource. + * + * @param {string} instancePartitionName + * A fully-qualified path representing InstancePartition resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromInstancePartitionName(instancePartitionName: string) { + return this.pathTemplates.instancePartitionPathTemplate.match(instancePartitionName).instance; + } + + /** + * Parse the instance_partition from InstancePartition resource. + * + * @param {string} instancePartitionName + * A fully-qualified path representing InstancePartition resource. + * @returns {string} A string representing the instance_partition. + */ + matchInstancePartitionFromInstancePartitionName(instancePartitionName: string) { + return this.pathTemplates.instancePartitionPathTemplate.match(instancePartitionName).instance_partition; + } + + /** + * Return a fully-qualified session resource name string. + * + * @param {string} project + * @param {string} instance + * @param {string} database + * @param {string} session + * @returns {string} Resource name string. + */ + sessionPath(project:string,instance:string,database:string,session:string) { + return this.pathTemplates.sessionPathTemplate.render({ + project: project, + instance: instance, + database: database, + session: session, + }); + } + + /** + * Parse the project from Session resource. + * + * @param {string} sessionName + * A fully-qualified path representing Session resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSessionName(sessionName: string) { + return this.pathTemplates.sessionPathTemplate.match(sessionName).project; + } + + /** + * Parse the instance from Session resource. + * + * @param {string} sessionName + * A fully-qualified path representing Session resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromSessionName(sessionName: string) { + return this.pathTemplates.sessionPathTemplate.match(sessionName).instance; + } + + /** + * Parse the database from Session resource. + * + * @param {string} sessionName + * A fully-qualified path representing Session resource. + * @returns {string} A string representing the database. + */ + matchDatabaseFromSessionName(sessionName: string) { + return this.pathTemplates.sessionPathTemplate.match(sessionName).database; + } + + /** + * Parse the session from Session resource. + * + * @param {string} sessionName + * A fully-qualified path representing Session resource. + * @returns {string} A string representing the session. + */ + matchSessionFromSessionName(sessionName: string) { + return this.pathTemplates.sessionPathTemplate.match(sessionName).session; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.spannerExecutorProxyStub && !this._terminated) { + return this.spannerExecutorProxyStub.then(stub => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} \ No newline at end of file diff --git a/owl-bot-staging/executor/v1/src/v1/spanner_executor_proxy_client_config.json b/owl-bot-staging/executor/v1/src/v1/spanner_executor_proxy_client_config.json new file mode 100644 index 000000000..a26ec1166 --- /dev/null +++ b/owl-bot-staging/executor/v1/src/v1/spanner_executor_proxy_client_config.json @@ -0,0 +1,30 @@ +{ + "interfaces": { + "google.spanner.executor.v1.SpannerExecutorProxy": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ExecuteActionAsync": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/executor/v1/src/v1/spanner_executor_proxy_proto_list.json b/owl-bot-staging/executor/v1/src/v1/spanner_executor_proxy_proto_list.json new file mode 100644 index 000000000..eaca520c9 --- /dev/null +++ b/owl-bot-staging/executor/v1/src/v1/spanner_executor_proxy_proto_list.json @@ -0,0 +1,15 @@ +[ + "../../protos/google/spanner/admin/database/v1/backup.proto", + "../../protos/google/spanner/admin/database/v1/backup_schedule.proto", + "../../protos/google/spanner/admin/database/v1/common.proto", + "../../protos/google/spanner/admin/instance/v1/common.proto", + "../../protos/google/spanner/executor/v1/cloud_executor.proto", + "../../protos/google/spanner/v1/commit_response.proto", + "../../protos/google/spanner/v1/keys.proto", + "../../protos/google/spanner/v1/location.proto", + "../../protos/google/spanner/v1/mutation.proto", + "../../protos/google/spanner/v1/query_plan.proto", + "../../protos/google/spanner/v1/result_set.proto", + "../../protos/google/spanner/v1/transaction.proto", + "../../protos/google/spanner/v1/type.proto" +] diff --git a/owl-bot-staging/executor/v1/test/gapic_spanner_executor_proxy_v1.ts b/owl-bot-staging/executor/v1/test/gapic_spanner_executor_proxy_v1.ts new file mode 100644 index 000000000..f03673534 --- /dev/null +++ b/owl-bot-staging/executor/v1/test/gapic_spanner_executor_proxy_v1.ts @@ -0,0 +1,660 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as spannerexecutorproxyModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubBidiStreamingCall(response?: ResponseType, error?: Error) { + const transformStub = error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + return sinon.stub().returns(mockStream); +} + +describe('v1.SpannerExecutorProxyClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new spannerexecutorproxyModule.v1.SpannerExecutorProxyClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'spanner-cloud-executor.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new spannerexecutorproxyModule.v1.SpannerExecutorProxyClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, "googleapis.com"); + }); + + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = spannerexecutorproxyModule.v1.SpannerExecutorProxyClient.servicePath; + assert.strictEqual(servicePath, 'spanner-cloud-executor.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = spannerexecutorproxyModule.v1.SpannerExecutorProxyClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'spanner-cloud-executor.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new spannerexecutorproxyModule.v1.SpannerExecutorProxyClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'spanner-cloud-executor.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new spannerexecutorproxyModule.v1.SpannerExecutorProxyClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'spanner-cloud-executor.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new spannerexecutorproxyModule.v1.SpannerExecutorProxyClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'spanner-cloud-executor.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new spannerexecutorproxyModule.v1.SpannerExecutorProxyClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'spanner-cloud-executor.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { new spannerexecutorproxyModule.v1.SpannerExecutorProxyClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = spannerexecutorproxyModule.v1.SpannerExecutorProxyClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new spannerexecutorproxyModule.v1.SpannerExecutorProxyClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new spannerexecutorproxyModule.v1.SpannerExecutorProxyClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new spannerexecutorproxyModule.v1.SpannerExecutorProxyClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.spannerExecutorProxyStub, undefined); + await client.initialize(); + assert(client.spannerExecutorProxyStub); + }); + + it('has close method for the initialized client', done => { + const client = new spannerexecutorproxyModule.v1.SpannerExecutorProxyClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize().catch(err => {throw err}); + assert(client.spannerExecutorProxyStub); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has close method for the non-initialized client', done => { + const client = new spannerexecutorproxyModule.v1.SpannerExecutorProxyClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.spannerExecutorProxyStub, undefined); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new spannerexecutorproxyModule.v1.SpannerExecutorProxyClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new spannerexecutorproxyModule.v1.SpannerExecutorProxyClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error|null, projectId?: string|null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + }); + + describe('executeActionAsync', () => { + it('invokes executeActionAsync without error', async () => { + const client = new spannerexecutorproxyModule.v1.SpannerExecutorProxyClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.executor.v1.SpannerAsyncActionRequest() + ); + + const expectedResponse = generateSampleMessage( + new protos.google.spanner.executor.v1.SpannerAsyncActionResponse() + ); + client.innerApiCalls.executeActionAsync = stubBidiStreamingCall(expectedResponse); + const stream = client.executeActionAsync(); + const promise = new Promise((resolve, reject) => { + stream.on('data', (response: protos.google.spanner.executor.v1.SpannerAsyncActionResponse) => { + resolve(response); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + stream.write(request); + stream.end(); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.executeActionAsync as SinonStub) + .getCall(0).calledWith(null)); + assert.deepStrictEqual(((stream as unknown as PassThrough) + ._transform as SinonStub).getCall(0).args[0], request); + }); + + it('invokes executeActionAsync with error', async () => { + const client = new spannerexecutorproxyModule.v1.SpannerExecutorProxyClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.executor.v1.SpannerAsyncActionRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.executeActionAsync = stubBidiStreamingCall(undefined, expectedError); + const stream = client.executeActionAsync(); + const promise = new Promise((resolve, reject) => { + stream.on('data', (response: protos.google.spanner.executor.v1.SpannerAsyncActionResponse) => { + resolve(response); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + stream.write(request); + stream.end(); + }); + await assert.rejects(promise, expectedError); + assert((client.innerApiCalls.executeActionAsync as SinonStub) + .getCall(0).calledWith(null)); + assert.deepStrictEqual(((stream as unknown as PassThrough) + ._transform as SinonStub).getCall(0).args[0], request); + }); + }); + + describe('Path templates', () => { + + describe('backup', async () => { + const fakePath = "/rendered/path/backup"; + const expectedParameters = { + project: "projectValue", + instance: "instanceValue", + backup: "backupValue", + }; + const client = new spannerexecutorproxyModule.v1.SpannerExecutorProxyClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.backupPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.backupPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('backupPath', () => { + const result = client.backupPath("projectValue", "instanceValue", "backupValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.backupPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromBackupName', () => { + const result = client.matchProjectFromBackupName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.backupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInstanceFromBackupName', () => { + const result = client.matchInstanceFromBackupName(fakePath); + assert.strictEqual(result, "instanceValue"); + assert((client.pathTemplates.backupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchBackupFromBackupName', () => { + const result = client.matchBackupFromBackupName(fakePath); + assert.strictEqual(result, "backupValue"); + assert((client.pathTemplates.backupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('backupSchedule', async () => { + const fakePath = "/rendered/path/backupSchedule"; + const expectedParameters = { + project: "projectValue", + instance: "instanceValue", + database: "databaseValue", + schedule: "scheduleValue", + }; + const client = new spannerexecutorproxyModule.v1.SpannerExecutorProxyClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.backupSchedulePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.backupSchedulePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('backupSchedulePath', () => { + const result = client.backupSchedulePath("projectValue", "instanceValue", "databaseValue", "scheduleValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.backupSchedulePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromBackupScheduleName', () => { + const result = client.matchProjectFromBackupScheduleName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.backupSchedulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInstanceFromBackupScheduleName', () => { + const result = client.matchInstanceFromBackupScheduleName(fakePath); + assert.strictEqual(result, "instanceValue"); + assert((client.pathTemplates.backupSchedulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatabaseFromBackupScheduleName', () => { + const result = client.matchDatabaseFromBackupScheduleName(fakePath); + assert.strictEqual(result, "databaseValue"); + assert((client.pathTemplates.backupSchedulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchScheduleFromBackupScheduleName', () => { + const result = client.matchScheduleFromBackupScheduleName(fakePath); + assert.strictEqual(result, "scheduleValue"); + assert((client.pathTemplates.backupSchedulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('database', async () => { + const fakePath = "/rendered/path/database"; + const expectedParameters = { + project: "projectValue", + instance: "instanceValue", + database: "databaseValue", + }; + const client = new spannerexecutorproxyModule.v1.SpannerExecutorProxyClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.databasePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.databasePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('databasePath', () => { + const result = client.databasePath("projectValue", "instanceValue", "databaseValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.databasePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDatabaseName', () => { + const result = client.matchProjectFromDatabaseName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.databasePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInstanceFromDatabaseName', () => { + const result = client.matchInstanceFromDatabaseName(fakePath); + assert.strictEqual(result, "instanceValue"); + assert((client.pathTemplates.databasePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatabaseFromDatabaseName', () => { + const result = client.matchDatabaseFromDatabaseName(fakePath); + assert.strictEqual(result, "databaseValue"); + assert((client.pathTemplates.databasePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('databaseRole', async () => { + const fakePath = "/rendered/path/databaseRole"; + const expectedParameters = { + project: "projectValue", + instance: "instanceValue", + database: "databaseValue", + role: "roleValue", + }; + const client = new spannerexecutorproxyModule.v1.SpannerExecutorProxyClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.databaseRolePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.databaseRolePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('databaseRolePath', () => { + const result = client.databaseRolePath("projectValue", "instanceValue", "databaseValue", "roleValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.databaseRolePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDatabaseRoleName', () => { + const result = client.matchProjectFromDatabaseRoleName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.databaseRolePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInstanceFromDatabaseRoleName', () => { + const result = client.matchInstanceFromDatabaseRoleName(fakePath); + assert.strictEqual(result, "instanceValue"); + assert((client.pathTemplates.databaseRolePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatabaseFromDatabaseRoleName', () => { + const result = client.matchDatabaseFromDatabaseRoleName(fakePath); + assert.strictEqual(result, "databaseValue"); + assert((client.pathTemplates.databaseRolePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRoleFromDatabaseRoleName', () => { + const result = client.matchRoleFromDatabaseRoleName(fakePath); + assert.strictEqual(result, "roleValue"); + assert((client.pathTemplates.databaseRolePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('instance', async () => { + const fakePath = "/rendered/path/instance"; + const expectedParameters = { + project: "projectValue", + instance: "instanceValue", + }; + const client = new spannerexecutorproxyModule.v1.SpannerExecutorProxyClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.instancePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.instancePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('instancePath', () => { + const result = client.instancePath("projectValue", "instanceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.instancePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromInstanceName', () => { + const result = client.matchProjectFromInstanceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInstanceFromInstanceName', () => { + const result = client.matchInstanceFromInstanceName(fakePath); + assert.strictEqual(result, "instanceValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('instanceConfig', async () => { + const fakePath = "/rendered/path/instanceConfig"; + const expectedParameters = { + project: "projectValue", + instance_config: "instanceConfigValue", + }; + const client = new spannerexecutorproxyModule.v1.SpannerExecutorProxyClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.instanceConfigPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.instanceConfigPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('instanceConfigPath', () => { + const result = client.instanceConfigPath("projectValue", "instanceConfigValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.instanceConfigPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromInstanceConfigName', () => { + const result = client.matchProjectFromInstanceConfigName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.instanceConfigPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInstanceConfigFromInstanceConfigName', () => { + const result = client.matchInstanceConfigFromInstanceConfigName(fakePath); + assert.strictEqual(result, "instanceConfigValue"); + assert((client.pathTemplates.instanceConfigPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('instancePartition', async () => { + const fakePath = "/rendered/path/instancePartition"; + const expectedParameters = { + project: "projectValue", + instance: "instanceValue", + instance_partition: "instancePartitionValue", + }; + const client = new spannerexecutorproxyModule.v1.SpannerExecutorProxyClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.instancePartitionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.instancePartitionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('instancePartitionPath', () => { + const result = client.instancePartitionPath("projectValue", "instanceValue", "instancePartitionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.instancePartitionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromInstancePartitionName', () => { + const result = client.matchProjectFromInstancePartitionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.instancePartitionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInstanceFromInstancePartitionName', () => { + const result = client.matchInstanceFromInstancePartitionName(fakePath); + assert.strictEqual(result, "instanceValue"); + assert((client.pathTemplates.instancePartitionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInstancePartitionFromInstancePartitionName', () => { + const result = client.matchInstancePartitionFromInstancePartitionName(fakePath); + assert.strictEqual(result, "instancePartitionValue"); + assert((client.pathTemplates.instancePartitionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('session', async () => { + const fakePath = "/rendered/path/session"; + const expectedParameters = { + project: "projectValue", + instance: "instanceValue", + database: "databaseValue", + session: "sessionValue", + }; + const client = new spannerexecutorproxyModule.v1.SpannerExecutorProxyClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.sessionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.sessionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('sessionPath', () => { + const result = client.sessionPath("projectValue", "instanceValue", "databaseValue", "sessionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.sessionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSessionName', () => { + const result = client.matchProjectFromSessionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.sessionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInstanceFromSessionName', () => { + const result = client.matchInstanceFromSessionName(fakePath); + assert.strictEqual(result, "instanceValue"); + assert((client.pathTemplates.sessionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatabaseFromSessionName', () => { + const result = client.matchDatabaseFromSessionName(fakePath); + assert.strictEqual(result, "databaseValue"); + assert((client.pathTemplates.sessionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSessionFromSessionName', () => { + const result = client.matchSessionFromSessionName(fakePath); + assert.strictEqual(result, "sessionValue"); + assert((client.pathTemplates.sessionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/executor/v1/tsconfig.json b/owl-bot-staging/executor/v1/tsconfig.json new file mode 100644 index 000000000..ca73e7bfc --- /dev/null +++ b/owl-bot-staging/executor/v1/tsconfig.json @@ -0,0 +1,22 @@ +{ + "extends": "./node_modules/gts/tsconfig-google.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "build", + "resolveJsonModule": true, + "lib": [ + "es2023", + "dom" + ] + }, + "include": [ + "src/*.ts", + "src/**/*.ts", + "test/*.ts", + "test/**/*.ts", + "system-test/*.ts", + "src/**/*.json", + "samples/**/*.json", + "protos/protos.json" + ] +} diff --git a/owl-bot-staging/executor/v1/webpack.config.js b/owl-bot-staging/executor/v1/webpack.config.js new file mode 100644 index 000000000..ef04209ca --- /dev/null +++ b/owl-bot-staging/executor/v1/webpack.config.js @@ -0,0 +1,64 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +const path = require('path'); + +module.exports = { + entry: './src/index.ts', + output: { + library: 'DatabaseAdmin', + filename: './database-admin.js', + }, + node: { + child_process: 'empty', + fs: 'empty', + crypto: 'empty', + }, + resolve: { + alias: { + '../../../package.json': path.resolve(__dirname, 'package.json'), + }, + extensions: ['.js', '.json', '.ts'], + }, + module: { + rules: [ + { + test: /\.tsx?$/, + use: 'ts-loader', + exclude: /node_modules/ + }, + { + test: /node_modules[\\/]@grpc[\\/]grpc-js/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]grpc/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]retry-request/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]https?-proxy-agent/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]gtoken/, + use: 'null-loader' + }, + ], + }, + mode: 'production', +}; diff --git a/owl-bot-staging/v1/.OwlBot.yaml b/owl-bot-staging/v1/.OwlBot.yaml new file mode 100644 index 000000000..23551270f --- /dev/null +++ b/owl-bot-staging/v1/.OwlBot.yaml @@ -0,0 +1,19 @@ +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +deep-copy-regex: + - source: /google/spanner/google-spanner-nodejs + dest: /owl-bot-staging/google-spanner + +api-name: spanner \ No newline at end of file diff --git a/owl-bot-staging/v1/.eslintignore b/owl-bot-staging/v1/.eslintignore new file mode 100644 index 000000000..cfc348ec4 --- /dev/null +++ b/owl-bot-staging/v1/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/.coverage +build/ +docs/ +protos/ +system-test/ +samples/generated/ diff --git a/owl-bot-staging/v1/.eslintrc.json b/owl-bot-staging/v1/.eslintrc.json new file mode 100644 index 000000000..782153495 --- /dev/null +++ b/owl-bot-staging/v1/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/owl-bot-staging/v1/.gitattributes b/owl-bot-staging/v1/.gitattributes new file mode 100644 index 000000000..33739cb74 --- /dev/null +++ b/owl-bot-staging/v1/.gitattributes @@ -0,0 +1,4 @@ +*.ts text eol=lf +*.js text eol=lf +protos/* linguist-generated +**/api-extractor.json linguist-language=JSON-with-Comments diff --git a/owl-bot-staging/v1/.gitignore b/owl-bot-staging/v1/.gitignore new file mode 100644 index 000000000..d4f03a0df --- /dev/null +++ b/owl-bot-staging/v1/.gitignore @@ -0,0 +1,14 @@ +**/*.log +**/node_modules +/.coverage +/coverage +/.nyc_output +/docs/ +/out/ +/build/ +system-test/secrets.js +system-test/*key.json +*.lock +.DS_Store +package-lock.json +__pycache__ diff --git a/owl-bot-staging/v1/.jsdoc.js b/owl-bot-staging/v1/.jsdoc.js new file mode 100644 index 000000000..89dbb7cd9 --- /dev/null +++ b/owl-bot-staging/v1/.jsdoc.js @@ -0,0 +1,55 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +'use strict'; + +module.exports = { + opts: { + readme: './README.md', + package: './package.json', + template: './node_modules/jsdoc-fresh', + recurse: true, + verbose: true, + destination: './docs/' + }, + plugins: [ + 'plugins/markdown', + 'jsdoc-region-tag' + ], + source: { + excludePattern: '(^|\\/|\\\\)[._]', + include: [ + 'build/src', + 'protos' + ], + includePattern: '\\.js$' + }, + templates: { + copyright: 'Copyright 2026 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/spanner', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/owl-bot-staging/v1/.mocharc.js b/owl-bot-staging/v1/.mocharc.js new file mode 100644 index 000000000..5eb34e86c --- /dev/null +++ b/owl-bot-staging/v1/.mocharc.js @@ -0,0 +1,33 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000 +} +if (process.env.MOCHA_THROW_DEPRECATION === 'false') { + delete config['throw-deprecation']; +} +if (process.env.MOCHA_REPORTER) { + config.reporter = process.env.MOCHA_REPORTER; +} +if (process.env.MOCHA_REPORTER_OUTPUT) { + config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; +} +module.exports = config diff --git a/owl-bot-staging/v1/.nycrc b/owl-bot-staging/v1/.nycrc new file mode 100644 index 000000000..81a95fc94 --- /dev/null +++ b/owl-bot-staging/v1/.nycrc @@ -0,0 +1,24 @@ +{ + "report-dir": "./.coverage", + "reporter": ["text", "lcov"], + "exclude": [ + "**/*-test", + "**/.coverage", + "**/apis", + "**/benchmark", + "**/conformance", + "**/docs", + "**/samples", + "**/scripts", + "**/protos", + "**/test", + "**/*.d.ts", + ".jsdoc.js", + "**/.jsdoc.js", + "karma.conf.js", + "webpack-tests.config.js", + "webpack.config.js" + ], + "exclude-after-remap": false, + "all": true +} \ No newline at end of file diff --git a/owl-bot-staging/v1/.prettierignore b/owl-bot-staging/v1/.prettierignore new file mode 100644 index 000000000..9340ad9b8 --- /dev/null +++ b/owl-bot-staging/v1/.prettierignore @@ -0,0 +1,6 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ diff --git a/owl-bot-staging/v1/.prettierrc.js b/owl-bot-staging/v1/.prettierrc.js new file mode 100644 index 000000000..7649ee3c2 --- /dev/null +++ b/owl-bot-staging/v1/.prettierrc.js @@ -0,0 +1,22 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/owl-bot-staging/v1/CODE_OF_CONDUCT.md b/owl-bot-staging/v1/CODE_OF_CONDUCT.md new file mode 100644 index 000000000..2add2547a --- /dev/null +++ b/owl-bot-staging/v1/CODE_OF_CONDUCT.md @@ -0,0 +1,94 @@ + +# Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of +experience, education, socio-economic status, nationality, personal appearance, +race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, or to ban temporarily or permanently any +contributor for other behaviors that they deem inappropriate, threatening, +offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +This Code of Conduct also applies outside the project spaces when the Project +Steward has a reasonable belief that an individual's behavior may have a +negative impact on the project or its community. + +## Conflict Resolution + +We do not believe that all conflict is bad; healthy debate and disagreement +often yield positive results. However, it is never okay to be disrespectful or +to engage in behavior that violates the project’s code of conduct. + +If you see someone violating the code of conduct, you are encouraged to address +the behavior directly with those involved. Many issues can be resolved quickly +and easily, and this gives people more control over the outcome of their +dispute. If you are unable to resolve the matter for any reason, or if the +behavior is threatening or harassing, report it. We are dedicated to providing +an environment where participants feel welcome and safe. + +Reports should be directed to *googleapis-stewards@google.com*, the +Project Steward(s) for *Google Cloud Client Libraries*. It is the Project Steward’s duty to +receive and address reported violations of the code of conduct. They will then +work with a committee consisting of representatives from the Open Source +Programs Office and the Google Open Source Strategy team. If for any reason you +are uncomfortable reaching out to the Project Steward, please email +opensource@google.com. + +We will investigate every complaint, but you may not receive a direct response. +We will use our discretion in determining when and how to follow up on reported +incidents, which may range from not taking action to permanent expulsion from +the project and project-sponsored spaces. We will notify the accused of the +report and provide them an opportunity to discuss it before any action is taken. +The identity of the reporter will be omitted from the details of the report +supplied to the accused. In potentially harmful situations, such as ongoing +harassment or threats to anyone's safety, we may take action without notice. + +## Attribution + +This Code of Conduct is adapted from the Contributor Covenant, version 1.4, +available at +https://www.contributor-covenant.org/version/1/4/code-of-conduct.html \ No newline at end of file diff --git a/owl-bot-staging/v1/CONTRIBUTING.md b/owl-bot-staging/v1/CONTRIBUTING.md new file mode 100644 index 000000000..5ddaa4e60 --- /dev/null +++ b/owl-bot-staging/v1/CONTRIBUTING.md @@ -0,0 +1,76 @@ +# How to become a contributor and submit your own code + +**Table of contents** + +* [Contributor License Agreements](#contributor-license-agreements) +* [Contributing a patch](#contributing-a-patch) +* [Running the tests](#running-the-tests) +* [Releasing the library](#releasing-the-library) + +## Contributor License Agreements + +We'd love to accept your sample apps and patches! Before we can take them, we +have to jump a couple of legal hurdles. + +Please fill out either the individual or corporate Contributor License Agreement +(CLA). + + * If you are an individual writing original source code and you're sure you + own the intellectual property, then you'll need to sign an [individual CLA](https://developers.google.com/open-source/cla/individual). + * If you work for a company that wants to allow you to contribute your work, + then you'll need to sign a [corporate CLA](https://developers.google.com/open-source/cla/corporate). + +Follow either of the two links above to access the appropriate CLA and +instructions for how to sign and return it. Once we receive it, we'll be able to +accept your pull requests. + +## Contributing A Patch + +1. Submit an issue describing your proposed change to the repo in question. +1. The repo owner will respond to your issue promptly. +1. If your proposed change is accepted, and you haven't already done so, sign a + Contributor License Agreement (see details above). +1. Fork the desired repo, develop and test your code changes. +1. Ensure that your code adheres to the existing style in the code to which + you are contributing. +1. Ensure that your code has an appropriate set of tests which all pass. +1. Title your pull request following [Conventional Commits](https://www.conventionalcommits.org/) styling. +1. Submit a pull request. + +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Spanner API][enable_api]. +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + + +## Running the tests + +1. [Prepare your environment for Node.js setup][setup]. + +1. Install dependencies: + + npm install + +1. Run the tests: + + # Run unit tests. + npm test + + # Run sample integration tests. + npm run samples-test + + # Run all system tests. + npm run system-test + +1. Lint (and maybe fix) any changes: + + npm run fix + +[setup]: https://cloud.google.com/nodejs/docs/setup +[projects]: https://console.cloud.google.com/project +[billing]: https://support.google.com/cloud/answer/6293499#enable-billing +[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=spanner.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/owl-bot-staging/v1/LICENSE b/owl-bot-staging/v1/LICENSE new file mode 100644 index 000000000..d64569567 --- /dev/null +++ b/owl-bot-staging/v1/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/owl-bot-staging/v1/README.md b/owl-bot-staging/v1/README.md new file mode 100644 index 000000000..b8fb95907 --- /dev/null +++ b/owl-bot-staging/v1/README.md @@ -0,0 +1,108 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "The comments you see below are used to generate those parts of the template in later states." +Google Cloud Platform logo + +# [Cloud Spanner API: Nodejs Client][homepage] + +[//]: # "releaseLevel" + +[![npm version](https://img.shields.io/npm/v/@google-cloud/spanner.svg)](https://www.npmjs.org/package/@google-cloud/spanner) + +Cloud Spanner API client for Node.js + +[//]: # "partials.introduction" + +A comprehensive list of changes in each version may be found in +[the CHANGELOG][homepage_changelog]. + +* [Cloud Spanner API Nodejs Client API Reference](https://cloud.google.com/nodejs/docs/reference/spanner/latest) +* [Cloud Spanner API Documentation](https://cloud.google.com/spanner/) + +Read more about the client libraries for Cloud APIs, including the older +Google APIs Client Libraries, in [Client Libraries Explained][explained]. + +[explained]: https://cloud.google.com/apis/docs/client-libraries-explained + +**Table of contents:** + +* [Quickstart](#quickstart) + * [Before you begin](#before-you-begin) + * [Installing the client library](#installing-the-client-library) + +* [Versioning](#versioning) +* [Contributing](#contributing) +* [License](#license) + +## Quickstart +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Cloud Spanner API API][enable_api]. +1. [Set up authentication][auth] so you can access the + API from your local workstation. +### Installing the client library + +```bash +npm install @google-cloud/spanner +``` + +[//]: # "partials.body" + +## Samples + +Samples are in the [`samples/`][homepage_samples] directory. Each sample's `README.md` has instructions for running its sample. + +[//]: # "samples" + +## Supported Node.js Versions + +Our client libraries follow the [Node.js release schedule](https://github.com/nodejs/release#release-schedule). +Libraries are compatible with all current _active_ and _maintenance_ versions of +Node.js. +If you are using an end-of-life version of Node.js, we recommend that you update +as soon as possible to an actively supported LTS version. + +Google's client libraries support legacy versions of Node.js runtimes on a +best-efforts basis with the following warnings: + +* Legacy versions are not tested in continuous integration. +* Some security patches and features cannot be backported. +* Dependencies cannot be kept up-to-date. + +Client libraries targeting some end-of-life versions of Node.js are available, and +can be installed through npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). +The dist-tags follow the naming convention `legacy-(version)`. +For example, `npm install @google-cloud/spanner@legacy-8` installs client libraries +for versions compatible with Node.js 8. + +## Versioning + +This library follows [Semantic Versioning](http://semver.org/). + +More Information: [Google Cloud Platform Launch Stages][launch_stages] + +[launch_stages]: https://cloud.google.com/terms/launch-stages + +## Contributing + +Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-spanner/CONTRIBUTING.md). + +Please note that this `README.md` +and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) +are generated from a central template. + +## License + +Apache Version 2.0 + +See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-spanner/LICENSE) + +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[projects]: https://console.cloud.google.com/project +[billing]: https://support.google.com/cloud/answer/6293499#enable-billing +[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=spanner.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/external/set-up-adc-local +[homepage_samples]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-spanner/samples +[homepage_changelog]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-spanner/CHANGELOG.md +[homepage]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-spanner diff --git a/owl-bot-staging/v1/package.json b/owl-bot-staging/v1/package.json new file mode 100644 index 000000000..2b8152dd8 --- /dev/null +++ b/owl-bot-staging/v1/package.json @@ -0,0 +1,58 @@ +{ + "name": "@google-cloud/spanner", + "version": "0.1.0", + "description": "Spanner client for Node.js", + "repository": "googleapis/nodejs-spanner", + "license": "Apache-2.0", + "author": "Google LLC", + "main": "build/src/index.js", + "files": [ + "build/src", + "build/protos" + ], + "keywords": [ + "google apis client", + "google api client", + "google apis", + "google api", + "google", + "google cloud platform", + "google cloud", + "cloud", + "google spanner", + "spanner", + "spanner" + ], + "scripts": { + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/ && minifyProtoJson", + "compile-protos": "compileProtos src", + "docs": "jsdoc -c .jsdoc.js", + "fix": "gts fix", + "lint": "gts check", + "prepare": "npm run compile-protos && npm run compile", + "system-test": "c8 mocha build/system-test", + "test": "c8 mocha build/test" + }, + "dependencies": { + "google-gax": "^5.1.1-rc.1" + }, + "devDependencies": { + "@types/mocha": "^10.0.10", + "@types/node": "^22.18.12", + "@types/sinon": "^17.0.4", + "c8": "^10.1.3", + "gapic-tools": "^1.0.3", + "gts": "^6.0.2", + "jsdoc": "^4.0.5", + "jsdoc-fresh": "^5.0.2", + "jsdoc-region-tag": "^4.0.1", + "mocha": "^11.7.4", + "pack-n-play": "^4.2.1", + "typescript": "5.8.3", + "sinon": "^21.0.0" + }, + "engines": { + "node": ">=v18" + } +} diff --git a/owl-bot-staging/v1/protos/google/spanner/v1/change_stream.proto b/owl-bot-staging/v1/protos/google/spanner/v1/change_stream.proto new file mode 100644 index 000000000..e7d12e608 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/spanner/v1/change_stream.proto @@ -0,0 +1,451 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.spanner.v1; + +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; +import "google/spanner/v1/type.proto"; + +option csharp_namespace = "Google.Cloud.Spanner.V1"; +option go_package = "cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb"; +option java_multiple_files = true; +option java_outer_classname = "ChangeStreamProto"; +option java_package = "com.google.spanner.v1"; +option php_namespace = "Google\\Cloud\\Spanner\\V1"; +option ruby_package = "Google::Cloud::Spanner::V1"; + +// Spanner Change Streams enable customers to capture and stream out changes to +// their Spanner databases in real-time. A change stream +// can be created with option partition_mode='IMMUTABLE_KEY_RANGE' or +// partition_mode='MUTABLE_KEY_RANGE'. +// +// This message is only used in Change Streams created with the option +// partition_mode='MUTABLE_KEY_RANGE'. Spanner automatically creates a special +// Table-Valued Function (TVF) along with each Change Streams. The function +// provides access to the change stream's records. The function is named +// READ_ (where is the +// name of the change stream), and it returns a table with only one column +// called ChangeRecord. +message ChangeStreamRecord { + // A data change record contains a set of changes to a table with the same + // modification type (insert, update, or delete) committed at the same commit + // timestamp in one change stream partition for the same transaction. Multiple + // data change records can be returned for the same transaction across + // multiple change stream partitions. + message DataChangeRecord { + // Metadata for a column. + message ColumnMetadata { + // Name of the column. + string name = 1; + + // Type of the column. + Type type = 2; + + // Indicates whether the column is a primary key column. + bool is_primary_key = 3; + + // Ordinal position of the column based on the original table definition + // in the schema starting with a value of 1. + int64 ordinal_position = 4; + } + + // Returns the value and associated metadata for a particular field of the + // [Mod][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod]. + message ModValue { + // Index within the repeated + // [column_metadata][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.column_metadata] + // field, to obtain the column metadata for the column that was modified. + int32 column_metadata_index = 1; + + // The value of the column. + google.protobuf.Value value = 2; + } + + // A mod describes all data changes in a watched table row. + message Mod { + // Returns the value of the primary key of the modified row. + repeated ModValue keys = 1; + + // Returns the old values before the change for the modified columns. + // Always empty for + // [INSERT][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType.INSERT], + // or if old values are not being captured specified by + // [value_capture_type][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ValueCaptureType]. + repeated ModValue old_values = 2; + + // Returns the new values after the change for the modified columns. + // Always empty for + // [DELETE][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType.DELETE]. + repeated ModValue new_values = 3; + } + + // Mod type describes the type of change Spanner applied to the data. For + // example, if the client submits an INSERT_OR_UPDATE request, Spanner will + // perform an insert if there is no existing row and return ModType INSERT. + // Alternatively, if there is an existing row, Spanner will perform an + // update and return ModType UPDATE. + enum ModType { + // Not specified. + MOD_TYPE_UNSPECIFIED = 0; + + // Indicates data was inserted. + INSERT = 10; + + // Indicates existing data was updated. + UPDATE = 20; + + // Indicates existing data was deleted. + DELETE = 30; + } + + // Value capture type describes which values are recorded in the data + // change record. + enum ValueCaptureType { + // Not specified. + VALUE_CAPTURE_TYPE_UNSPECIFIED = 0; + + // Records both old and new values of the modified watched columns. + OLD_AND_NEW_VALUES = 10; + + // Records only new values of the modified watched columns. + NEW_VALUES = 20; + + // Records new values of all watched columns, including modified and + // unmodified columns. + NEW_ROW = 30; + + // Records the new values of all watched columns, including modified and + // unmodified columns. Also records the old values of the modified + // columns. + NEW_ROW_AND_OLD_VALUES = 40; + } + + // Indicates the timestamp in which the change was committed. + // DataChangeRecord.commit_timestamps, + // PartitionStartRecord.start_timestamps, + // PartitionEventRecord.commit_timestamps, and + // PartitionEndRecord.end_timestamps can have the same value in the same + // partition. + google.protobuf.Timestamp commit_timestamp = 1; + + // Record sequence numbers are unique and monotonically increasing (but not + // necessarily contiguous) for a specific timestamp across record + // types in the same partition. To guarantee ordered processing, the reader + // should process records (of potentially different types) in + // record_sequence order for a specific timestamp in the same partition. + // + // The record sequence number ordering across partitions is only meaningful + // in the context of a specific transaction. Record sequence numbers are + // unique across partitions for a specific transaction. Sort the + // DataChangeRecords for the same + // [server_transaction_id][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.server_transaction_id] + // by + // [record_sequence][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.record_sequence] + // to reconstruct the ordering of the changes within the transaction. + string record_sequence = 2; + + // Provides a globally unique string that represents the transaction in + // which the change was committed. Multiple transactions can have the same + // commit timestamp, but each transaction has a unique + // server_transaction_id. + string server_transaction_id = 3; + + // Indicates whether this is the last record for a transaction in the + // current partition. Clients can use this field to determine when all + // records for a transaction in the current partition have been received. + bool is_last_record_in_transaction_in_partition = 4; + + // Name of the table affected by the change. + string table = 5; + + // Provides metadata describing the columns associated with the + // [mods][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.mods] listed + // below. + repeated ColumnMetadata column_metadata = 6; + + // Describes the changes that were made. + repeated Mod mods = 7; + + // Describes the type of change. + ModType mod_type = 8; + + // Describes the value capture type that was specified in the change stream + // configuration when this change was captured. + ValueCaptureType value_capture_type = 9; + + // Indicates the number of data change records that are part of this + // transaction across all change stream partitions. This value can be used + // to assemble all the records associated with a particular transaction. + int32 number_of_records_in_transaction = 10; + + // Indicates the number of partitions that return data change records for + // this transaction. This value can be helpful in assembling all records + // associated with a particular transaction. + int32 number_of_partitions_in_transaction = 11; + + // Indicates the transaction tag associated with this transaction. + string transaction_tag = 12; + + // Indicates whether the transaction is a system transaction. System + // transactions include those issued by time-to-live (TTL), column backfill, + // etc. + bool is_system_transaction = 13; + } + + // A heartbeat record is returned as a progress indicator, when there are no + // data changes or any other partition record types in the change stream + // partition. + message HeartbeatRecord { + // Indicates the timestamp at which the query has returned all the records + // in the change stream partition with timestamp <= heartbeat timestamp. + // The heartbeat timestamp will not be the same as the timestamps of other + // record types in the same partition. + google.protobuf.Timestamp timestamp = 1; + } + + // A partition start record serves as a notification that the client should + // schedule the partitions to be queried. PartitionStartRecord returns + // information about one or more partitions. + message PartitionStartRecord { + // Start timestamp at which the partitions should be queried to return + // change stream records with timestamps >= start_timestamp. + // DataChangeRecord.commit_timestamps, + // PartitionStartRecord.start_timestamps, + // PartitionEventRecord.commit_timestamps, and + // PartitionEndRecord.end_timestamps can have the same value in the same + // partition. + google.protobuf.Timestamp start_timestamp = 1; + + // Record sequence numbers are unique and monotonically increasing (but not + // necessarily contiguous) for a specific timestamp across record + // types in the same partition. To guarantee ordered processing, the reader + // should process records (of potentially different types) in + // record_sequence order for a specific timestamp in the same partition. + string record_sequence = 2; + + // Unique partition identifiers to be used in queries. + repeated string partition_tokens = 3; + } + + // A partition end record serves as a notification that the client should stop + // reading the partition. No further records are expected to be retrieved on + // it. + message PartitionEndRecord { + // End timestamp at which the change stream partition is terminated. All + // changes generated by this partition will have timestamps <= + // end_timestamp. DataChangeRecord.commit_timestamps, + // PartitionStartRecord.start_timestamps, + // PartitionEventRecord.commit_timestamps, and + // PartitionEndRecord.end_timestamps can have the same value in the same + // partition. PartitionEndRecord is the last record returned for a + // partition. + google.protobuf.Timestamp end_timestamp = 1; + + // Record sequence numbers are unique and monotonically increasing (but not + // necessarily contiguous) for a specific timestamp across record + // types in the same partition. To guarantee ordered processing, the reader + // should process records (of potentially different types) in + // record_sequence order for a specific timestamp in the same partition. + string record_sequence = 2; + + // Unique partition identifier describing the terminated change stream + // partition. + // [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEndRecord.partition_token] + // is equal to the partition token of the change stream partition currently + // queried to return this PartitionEndRecord. + string partition_token = 3; + } + + // A partition event record describes key range changes for a change stream + // partition. The changes to a row defined by its primary key can be captured + // in one change stream partition for a specific time range, and then be + // captured in a different change stream partition for a different time range. + // This movement of key ranges across change stream partitions is a reflection + // of activities, such as Spanner's dynamic splitting and load balancing, etc. + // Processing this event is needed if users want to guarantee processing of + // the changes for any key in timestamp order. If time ordered processing of + // changes for a primary key is not needed, this event can be ignored. + // To guarantee time ordered processing for each primary key, if the event + // describes move-ins, the reader of this partition needs to wait until the + // readers of the source partitions have processed all records with timestamps + // <= this PartitionEventRecord.commit_timestamp, before advancing beyond this + // PartitionEventRecord. If the event describes move-outs, the reader can + // notify the readers of the destination partitions that they can continue + // processing. + message PartitionEventRecord { + // Describes move-in of the key ranges into the change stream partition + // identified by + // [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token]. + // + // To maintain processing the changes for a particular key in timestamp + // order, the query processing the change stream partition identified by + // [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token] + // should not advance beyond the partition event record commit timestamp + // until the queries processing the source change stream partitions have + // processed all change stream records with timestamps <= the partition + // event record commit timestamp. + message MoveInEvent { + // An unique partition identifier describing the source change stream + // partition that recorded changes for the key range that is moving + // into this partition. + string source_partition_token = 1; + } + + // Describes move-out of the key ranges out of the change stream partition + // identified by + // [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token]. + // + // To maintain processing the changes for a particular key in timestamp + // order, the query processing the + // [MoveOutEvent][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent] + // in the partition identified by + // [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token] + // should inform the queries processing the destination partitions that + // they can unblock and proceed processing records past the + // [commit_timestamp][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.commit_timestamp]. + message MoveOutEvent { + // An unique partition identifier describing the destination change + // stream partition that will record changes for the key range that is + // moving out of this partition. + string destination_partition_token = 1; + } + + // Indicates the commit timestamp at which the key range change occurred. + // DataChangeRecord.commit_timestamps, + // PartitionStartRecord.start_timestamps, + // PartitionEventRecord.commit_timestamps, and + // PartitionEndRecord.end_timestamps can have the same value in the same + // partition. + google.protobuf.Timestamp commit_timestamp = 1; + + // Record sequence numbers are unique and monotonically increasing (but not + // necessarily contiguous) for a specific timestamp across record + // types in the same partition. To guarantee ordered processing, the reader + // should process records (of potentially different types) in + // record_sequence order for a specific timestamp in the same partition. + string record_sequence = 2; + + // Unique partition identifier describing the partition this event + // occurred on. + // [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token] + // is equal to the partition token of the change stream partition currently + // queried to return this PartitionEventRecord. + string partition_token = 3; + + // Set when one or more key ranges are moved into the change stream + // partition identified by + // [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token]. + // + // Example: Two key ranges are moved into partition (P1) from partition (P2) + // and partition (P3) in a single transaction at timestamp T. + // + // The PartitionEventRecord returned in P1 will reflect the move as: + // + // PartitionEventRecord { + // commit_timestamp: T + // partition_token: "P1" + // move_in_events { + // source_partition_token: "P2" + // } + // move_in_events { + // source_partition_token: "P3" + // } + // } + // + // The PartitionEventRecord returned in P2 will reflect the move as: + // + // PartitionEventRecord { + // commit_timestamp: T + // partition_token: "P2" + // move_out_events { + // destination_partition_token: "P1" + // } + // } + // + // The PartitionEventRecord returned in P3 will reflect the move as: + // + // PartitionEventRecord { + // commit_timestamp: T + // partition_token: "P3" + // move_out_events { + // destination_partition_token: "P1" + // } + // } + repeated MoveInEvent move_in_events = 4; + + // Set when one or more key ranges are moved out of the change stream + // partition identified by + // [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token]. + // + // Example: Two key ranges are moved out of partition (P1) to partition (P2) + // and partition (P3) in a single transaction at timestamp T. + // + // The PartitionEventRecord returned in P1 will reflect the move as: + // + // PartitionEventRecord { + // commit_timestamp: T + // partition_token: "P1" + // move_out_events { + // destination_partition_token: "P2" + // } + // move_out_events { + // destination_partition_token: "P3" + // } + // } + // + // The PartitionEventRecord returned in P2 will reflect the move as: + // + // PartitionEventRecord { + // commit_timestamp: T + // partition_token: "P2" + // move_in_events { + // source_partition_token: "P1" + // } + // } + // + // The PartitionEventRecord returned in P3 will reflect the move as: + // + // PartitionEventRecord { + // commit_timestamp: T + // partition_token: "P3" + // move_in_events { + // source_partition_token: "P1" + // } + // } + repeated MoveOutEvent move_out_events = 5; + } + + // One of the change stream subrecords. + oneof record { + // Data change record describing a data change for a change stream + // partition. + DataChangeRecord data_change_record = 1; + + // Heartbeat record describing a heartbeat for a change stream partition. + HeartbeatRecord heartbeat_record = 2; + + // Partition start record describing a new change stream partition. + PartitionStartRecord partition_start_record = 3; + + // Partition end record describing a terminated change stream partition. + PartitionEndRecord partition_end_record = 4; + + // Partition event record describing key range changes for a change stream + // partition. + PartitionEventRecord partition_event_record = 5; + } +} diff --git a/owl-bot-staging/v1/protos/google/spanner/v1/commit_response.proto b/owl-bot-staging/v1/protos/google/spanner/v1/commit_response.proto new file mode 100644 index 000000000..6e4459122 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/spanner/v1/commit_response.proto @@ -0,0 +1,64 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.spanner.v1; + +import "google/protobuf/timestamp.proto"; +import "google/spanner/v1/transaction.proto"; + +option csharp_namespace = "Google.Cloud.Spanner.V1"; +option go_package = "cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb"; +option java_multiple_files = true; +option java_outer_classname = "CommitResponseProto"; +option java_package = "com.google.spanner.v1"; +option php_namespace = "Google\\Cloud\\Spanner\\V1"; +option ruby_package = "Google::Cloud::Spanner::V1"; + +// The response for [Commit][google.spanner.v1.Spanner.Commit]. +message CommitResponse { + // Additional statistics about a commit. + message CommitStats { + // The total number of mutations for the transaction. Knowing the + // `mutation_count` value can help you maximize the number of mutations + // in a transaction and minimize the number of API round trips. You can + // also monitor this value to prevent transactions from exceeding the system + // [limit](https://cloud.google.com/spanner/quotas#limits_for_creating_reading_updating_and_deleting_data). + // If the number of mutations exceeds the limit, the server returns + // [INVALID_ARGUMENT](https://cloud.google.com/spanner/docs/reference/rest/v1/Code#ENUM_VALUES.INVALID_ARGUMENT). + int64 mutation_count = 1; + } + + // The Cloud Spanner timestamp at which the transaction committed. + google.protobuf.Timestamp commit_timestamp = 1; + + // The statistics about this `Commit`. Not returned by default. + // For more information, see + // [CommitRequest.return_commit_stats][google.spanner.v1.CommitRequest.return_commit_stats]. + CommitStats commit_stats = 2; + + // You must examine and retry the commit if the following is populated. + oneof MultiplexedSessionRetry { + // If specified, transaction has not committed yet. + // You must retry the commit with the new precommit token. + MultiplexedSessionPrecommitToken precommit_token = 4; + } + + // If `TransactionOptions.isolation_level` is set to + // `IsolationLevel.REPEATABLE_READ`, then the snapshot timestamp is the + // timestamp at which all reads in the transaction ran. This timestamp is + // never returned. + google.protobuf.Timestamp snapshot_timestamp = 5; +} diff --git a/owl-bot-staging/v1/protos/google/spanner/v1/keys.proto b/owl-bot-staging/v1/protos/google/spanner/v1/keys.proto new file mode 100644 index 000000000..5e30e831e --- /dev/null +++ b/owl-bot-staging/v1/protos/google/spanner/v1/keys.proto @@ -0,0 +1,163 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.spanner.v1; + +import "google/protobuf/struct.proto"; + +option csharp_namespace = "Google.Cloud.Spanner.V1"; +option go_package = "cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb"; +option java_multiple_files = true; +option java_outer_classname = "KeysProto"; +option java_package = "com.google.spanner.v1"; +option php_namespace = "Google\\Cloud\\Spanner\\V1"; +option ruby_package = "Google::Cloud::Spanner::V1"; + +// KeyRange represents a range of rows in a table or index. +// +// A range has a start key and an end key. These keys can be open or +// closed, indicating if the range includes rows with that key. +// +// Keys are represented by lists, where the ith value in the list +// corresponds to the ith component of the table or index primary key. +// Individual values are encoded as described +// [here][google.spanner.v1.TypeCode]. +// +// For example, consider the following table definition: +// +// CREATE TABLE UserEvents ( +// UserName STRING(MAX), +// EventDate STRING(10) +// ) PRIMARY KEY(UserName, EventDate); +// +// The following keys name rows in this table: +// +// ["Bob", "2014-09-23"] +// ["Alfred", "2015-06-12"] +// +// Since the `UserEvents` table's `PRIMARY KEY` clause names two +// columns, each `UserEvents` key has two elements; the first is the +// `UserName`, and the second is the `EventDate`. +// +// Key ranges with multiple components are interpreted +// lexicographically by component using the table or index key's declared +// sort order. For example, the following range returns all events for +// user `"Bob"` that occurred in the year 2015: +// +// "start_closed": ["Bob", "2015-01-01"] +// "end_closed": ["Bob", "2015-12-31"] +// +// Start and end keys can omit trailing key components. This affects the +// inclusion and exclusion of rows that exactly match the provided key +// components: if the key is closed, then rows that exactly match the +// provided components are included; if the key is open, then rows +// that exactly match are not included. +// +// For example, the following range includes all events for `"Bob"` that +// occurred during and after the year 2000: +// +// "start_closed": ["Bob", "2000-01-01"] +// "end_closed": ["Bob"] +// +// The next example retrieves all events for `"Bob"`: +// +// "start_closed": ["Bob"] +// "end_closed": ["Bob"] +// +// To retrieve events before the year 2000: +// +// "start_closed": ["Bob"] +// "end_open": ["Bob", "2000-01-01"] +// +// The following range includes all rows in the table: +// +// "start_closed": [] +// "end_closed": [] +// +// This range returns all users whose `UserName` begins with any +// character from A to C: +// +// "start_closed": ["A"] +// "end_open": ["D"] +// +// This range returns all users whose `UserName` begins with B: +// +// "start_closed": ["B"] +// "end_open": ["C"] +// +// Key ranges honor column sort order. For example, suppose a table is +// defined as follows: +// +// CREATE TABLE DescendingSortedTable { +// Key INT64, +// ... +// ) PRIMARY KEY(Key DESC); +// +// The following range retrieves all rows with key values between 1 +// and 100 inclusive: +// +// "start_closed": ["100"] +// "end_closed": ["1"] +// +// Note that 100 is passed as the start, and 1 is passed as the end, +// because `Key` is a descending column in the schema. +message KeyRange { + // The start key must be provided. It can be either closed or open. + oneof start_key_type { + // If the start is closed, then the range includes all rows whose + // first `len(start_closed)` key columns exactly match `start_closed`. + google.protobuf.ListValue start_closed = 1; + + // If the start is open, then the range excludes rows whose first + // `len(start_open)` key columns exactly match `start_open`. + google.protobuf.ListValue start_open = 2; + } + + // The end key must be provided. It can be either closed or open. + oneof end_key_type { + // If the end is closed, then the range includes all rows whose + // first `len(end_closed)` key columns exactly match `end_closed`. + google.protobuf.ListValue end_closed = 3; + + // If the end is open, then the range excludes rows whose first + // `len(end_open)` key columns exactly match `end_open`. + google.protobuf.ListValue end_open = 4; + } +} + +// `KeySet` defines a collection of Cloud Spanner keys and/or key ranges. All +// the keys are expected to be in the same table or index. The keys need +// not be sorted in any particular way. +// +// If the same key is specified multiple times in the set (for example +// if two ranges, two keys, or a key and a range overlap), Cloud Spanner +// behaves as if the key were only specified once. +message KeySet { + // A list of specific keys. Entries in `keys` should have exactly as + // many elements as there are columns in the primary or index key + // with which this `KeySet` is used. Individual key values are + // encoded as described [here][google.spanner.v1.TypeCode]. + repeated google.protobuf.ListValue keys = 1; + + // A list of key ranges. See [KeyRange][google.spanner.v1.KeyRange] for more + // information about key range specifications. + repeated KeyRange ranges = 2; + + // For convenience `all` can be set to `true` to indicate that this + // `KeySet` matches all keys in the table or index. Note that any keys + // specified in `keys` or `ranges` are only yielded once. + bool all = 3; +} diff --git a/owl-bot-staging/v1/protos/google/spanner/v1/location.proto b/owl-bot-staging/v1/protos/google/spanner/v1/location.proto new file mode 100644 index 000000000..870dc0ec0 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/spanner/v1/location.proto @@ -0,0 +1,388 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.spanner.v1; + +import "google/protobuf/struct.proto"; +import "google/spanner/v1/type.proto"; + +option csharp_namespace = "Google.Cloud.Spanner.V1"; +option go_package = "cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb"; +option java_multiple_files = true; +option java_outer_classname = "LocationProto"; +option java_package = "com.google.spanner.v1"; +option php_namespace = "Google\\Cloud\\Spanner\\V1"; +option ruby_package = "Google::Cloud::Spanner::V1"; + +// A `Range` represents a range of keys in a database. The keys themselves +// are encoded in "sortable string format", also known as ssformat. Consult +// Spanner's open source client libraries for details on the encoding. +// +// Each range represents a contiguous range of rows, possibly from multiple +// tables/indexes. Each range is associated with a single paxos group (known as +// a "group" throughout this API), a split (which names the exact range within +// the group), and a generation that can be used to determine whether a given +// `Range` represents a newer or older location for the key range. +message Range { + // The start key of the range, inclusive. Encoded in "sortable string format" + // (ssformat). + bytes start_key = 1; + + // The limit key of the range, exclusive. Encoded in "sortable string format" + // (ssformat). + bytes limit_key = 2; + + // The UID of the paxos group where this range is stored. UIDs are unique + // within the database. References `Group.group_uid`. + uint64 group_uid = 3; + + // A group can store multiple ranges of keys. Each key range is named by an + // ID (the split ID). Within a group, split IDs are unique. The `split_id` + // names the exact split in `group_uid` where this range is stored. + uint64 split_id = 4; + + // `generation` indicates the freshness of the range information contained + // in this proto. Generations can be compared lexicographically; if generation + // A is greater than generation B, then the `Range` corresponding to A is + // newer than the `Range` corresponding to B, and should be used + // preferentially. + bytes generation = 5; +} + +// A `Tablet` represents a single replica of a `Group`. A tablet is served by a +// single server at a time, and can move between servers due to server death or +// simply load balancing. +message Tablet { + // Indicates the role of the tablet. + enum Role { + // Not specified. + ROLE_UNSPECIFIED = 0; + + // The tablet can perform reads and (if elected leader) writes. + READ_WRITE = 1; + + // The tablet can only perform reads. + READ_ONLY = 2; + } + + // The UID of the tablet, unique within the database. Matches the + // `tablet_uids` and `leader_tablet_uid` fields in `Group`. + uint64 tablet_uid = 1; + + // The address of the server that is serving this tablet -- either an IP + // address or DNS hostname and a port number. + string server_address = 2; + + // Where this tablet is located. This is the name of a Google Cloud region, + // such as "us-central1". + string location = 3; + + // The role of the tablet. + Role role = 4; + + // `incarnation` indicates the freshness of the tablet information contained + // in this proto. Incarnations can be compared lexicographically; if + // incarnation A is greater than incarnation B, then the `Tablet` + // corresponding to A is newer than the `Tablet` corresponding to B, and + // should be used preferentially. + bytes incarnation = 5; + + // Distances help the client pick the closest tablet out of the list of + // tablets for a given request. Tablets with lower distances should generally + // be preferred. Tablets with the same distance are approximately equally + // close; the client can choose arbitrarily. + // + // Distances do not correspond precisely to expected latency, geographical + // distance, or anything else. Distances should be compared only between + // tablets of the same group; they are not meaningful between different + // groups. + // + // A value of zero indicates that the tablet may be in the same zone as + // the client, and have minimum network latency. A value less than or equal to + // five indicates that the tablet is thought to be in the same region as the + // client, and may have a few milliseconds of network latency. Values greater + // than five are most likely in a different region, with non-trivial network + // latency. + // + // Clients should use the following algorithm: + // * If the request is using a directed read, eliminate any tablets that + // do not match the directed read's target zone and/or replica type. + // * (Read-write transactions only) Choose leader tablet if it has an + // distance <=5. + // * Group and sort tablets by distance. Choose a random + // tablet with the lowest distance. If the request + // is not a directed read, only consider replicas with distances <=5. + // * Send the request to the fallback endpoint. + // + // The tablet picked by this algorithm may be skipped, either because it is + // marked as `skip` by the server or because the corresponding server is + // unreachable, flow controlled, etc. Skipped tablets should be added to the + // `skipped_tablet_uid` field in `RoutingHint`; the algorithm above should + // then be re-run without including the skipped tablet(s) to pick the next + // best tablet. + uint32 distance = 6; + + // If true, the tablet should not be chosen by the client. Typically, this + // signals that the tablet is unhealthy in some way. Tablets with `skip` + // set to true should be reported back to the server in + // `RoutingHint.skipped_tablet_uid`; this cues the server to send updated + // information for this tablet should it become usable again. + bool skip = 7; +} + +// A `Group` represents a paxos group in a database. A group is a set of +// tablets that are replicated across multiple servers. Groups may have a leader +// tablet. Groups store one (or sometimes more) ranges of keys. +message Group { + // The UID of the paxos group, unique within the database. Matches the + // `group_uid` field in `Range`. + uint64 group_uid = 1; + + // A list of tablets that are part of the group. Note that this list may not + // be exhaustive; it will only include tablets the server considers useful + // to the client. The returned list is ordered ascending by distance. + // + // Tablet UIDs reference `Tablet.tablet_uid`. + repeated Tablet tablets = 2; + + // The last known leader tablet of the group as an index into `tablets`. May + // be negative if the group has no known leader. + int32 leader_index = 3; + + // `generation` indicates the freshness of the group information (including + // leader information) contained in this proto. Generations can be compared + // lexicographically; if generation A is greater than generation B, then the + // `Group` corresponding to A is newer than the `Group` corresponding to B, + // and should be used preferentially. + bytes generation = 4; +} + +// A `KeyRecipe` provides the metadata required to translate reads, mutations, +// and queries into a byte array in "sortable string format" (ssformat)that can +// be used with `Range`s to route requests. Note that the client *must* tolerate +// `KeyRecipe`s that appear to be invalid, since the `KeyRecipe` format may +// change over time. Requests with invalid `KeyRecipe`s should be routed to a +// default server. +message KeyRecipe { + // An ssformat key is composed of a sequence of tag numbers and key column + // values. `Part` represents a single tag or key column value. + message Part { + // The remaining fields encode column values. + enum Order { + // Default value, equivalent to `ASCENDING`. + ORDER_UNSPECIFIED = 0; + + // The key is ascending - corresponds to `ASC` in the schema definition. + ASCENDING = 1; + + // The key is descending - corresponds to `DESC` in the schema definition. + DESCENDING = 2; + } + + // The null order of the key column. This dictates where NULL values sort + // in the sorted order. Note that columns which are `NOT NULL` can have a + // special encoding. + enum NullOrder { + // Default value. This value is unused. + NULL_ORDER_UNSPECIFIED = 0; + + // NULL values sort before any non-NULL values. + NULLS_FIRST = 1; + + // NULL values sort after any non-NULL values. + NULLS_LAST = 2; + + // The column does not support NULL values. + NOT_NULL = 3; + } + + // If non-zero, `tag` is the only field present in this `Part`. The part + // is encoded by appending `tag` to the ssformat key. + uint32 tag = 1; + + // Whether the key column is sorted ascending or descending. Only present + // if `tag` is zero. + Order order = 2; + + // How NULLs are represented in the encoded key part. Only present if `tag` + // is zero. + NullOrder null_order = 3; + + // The type of the key part. Only present if `tag` is zero. + Type type = 4; + + // Only present if `tag` is zero. + oneof value_type { + // `identifier` is the name of the column or query parameter. + string identifier = 5; + + // The constant value of the key part. + // It is present when query uses a constant as a part of the key. + google.protobuf.Value value = 6; + + // If true, the client is responsible to fill in the value randomly. + // It's relevant only for the INT64 type. + bool random = 8; + } + + // It is a repeated field to support fetching key columns from nested + // structs, such as `STRUCT` query parameters. + repeated int32 struct_identifiers = 7; + } + + // A recipe can be associated with a table, index, or query. Tables recipes + // are used to encode read and write keys; index recipes are used for index + // reads, and query recipes are used only for SQL queries. + oneof target { + // A table name, matching the name from the database schema. + string table_name = 1; + + // An index name, matching the name from the database schema. + string index_name = 2; + + // The UID of a query, matching the UID from `RoutingHint`. + uint64 operation_uid = 3; + } + + // Parts are in the order they should appear in the encoded key. + repeated Part part = 4; +} + +// A `RecipeList` contains a list of `KeyRecipe`s, which share the same +// schema generation. +message RecipeList { + // The schema generation of the recipes. To be sent to the server in + // `RoutingHint.schema_generation` whenever one of the recipes is used. + // `schema_generation` values are comparable with each other; if generation A + // compares greater than generation B, then A is a more recent schema than B. + // Clients should in general aim to cache only the latest schema generation, + // and discard more stale recipes. + bytes schema_generation = 1; + + // A list of recipes to be cached. + repeated KeyRecipe recipe = 3; +} + +// A `CacheUpdate` expresses a set of changes the client should incorporate into +// its location cache. These changes may or may not be newer than what the +// client has in its cache, and should be discarded if necessary. `CacheUpdate`s +// can be obtained in response to requests that included a `RoutingHint` +// field, but may also be obtained by explicit location-fetching RPCs which may +// be added in the future. +message CacheUpdate { + // An internal ID for the database. Database names can be reused if a database + // is deleted and re-created. Each time the database is re-created, it will + // get a new database ID, which will never be re-used for any other database. + uint64 database_id = 1; + + // A list of ranges to be cached. + repeated Range range = 2; + + // A list of groups to be cached. + repeated Group group = 3; + + // A list of recipes to be cached. + RecipeList key_recipes = 5; +} + +// `RoutingHint` can be optionally added to location-aware Spanner +// requests. It gives the server hints that can be used to route the request to +// an appropriate server, potentially significantly decreasing latency and +// improving throughput. To achieve improved performance, most fields must be +// filled in with accurate values. +// +// The presence of a valid `RoutingHint` tells the server that the client +// is location-aware. +// +// `RoutingHint` does not change the semantics of the request; it is +// purely a performance hint; the request will perform the same actions on the +// database's data as if `RoutingHint` were not present. However, if +// the `RoutingHint` is incomplete or incorrect, the response may include +// a `CacheUpdate` the client can use to correct its location cache. +message RoutingHint { + // A tablet that was skipped by the client. See `Tablet.tablet_uid` and + // `Tablet.incarnation`. + message SkippedTablet { + // The tablet UID of the tablet that was skipped. See `Tablet.tablet_uid`. + uint64 tablet_uid = 1; + + // The incarnation of the tablet that was skipped. See `Tablet.incarnation`. + bytes incarnation = 2; + } + + // A session-scoped unique ID for the operation, computed client-side. + // Requests with the same `operation_uid` should have a shared 'shape', + // meaning that some fields are expected to be the same, such as the SQL + // query, the target table/columns (for reads) etc. Requests with the same + // `operation_uid` are meant to differ only in fields like keys/key + // ranges/query parameters, transaction IDs, etc. + // + // `operation_uid` must be non-zero for `RoutingHint` to be valid. + uint64 operation_uid = 1; + + // The database ID of the database being accessed, see + // `CacheUpdate.database_id`. Should match the cache entries that were used + // to generate the rest of the fields in this `RoutingHint`. + uint64 database_id = 2; + + // The schema generation of the recipe that was used to generate `key` and + // `limit_key`. See also `RecipeList.schema_generation`. + bytes schema_generation = 3; + + // The key / key range that this request accesses. For operations that + // access a single key, `key` should be set and `limit_key` should be empty. + // For operations that access a key range, `key` and `limit_key` should both + // be set, to the inclusive start and exclusive end of the range respectively. + // + // The keys are encoded in "sortable string format" (ssformat), using a + // `KeyRecipe` that is appropriate for the request. See `KeyRecipe` for more + // details. + bytes key = 4; + + // If this request targets a key range, this is the exclusive end of the + // range. See `key` for more details. + bytes limit_key = 5; + + // The group UID of the group that the client believes serves the range + // defined by `key` and `limit_key`. See `Range.group_uid` for more details. + uint64 group_uid = 6; + + // The split ID of the split that the client believes contains the range + // defined by `key` and `limit_key`. See `Range.split_id` for more details. + uint64 split_id = 7; + + // The tablet UID of the tablet from group `group_uid` that the client + // believes is best to serve this request. See `Group.local_tablet_uids` and + // `Group.leader_tablet_uid`. + uint64 tablet_uid = 8; + + // If the client had multiple options for tablet selection, and some of its + // first choices were unhealthy (e.g., the server is unreachable, or + // `Tablet.skip` is true), this field will contain the tablet UIDs of those + // tablets, with their incarnations. The server may include a `CacheUpdate` + // with new locations for those tablets. + repeated SkippedTablet skipped_tablet_uid = 9; + + // If present, the client's current location. This should be the name of a + // Google Cloud zone or region, such as "us-central1". + // + // If absent, the client's location will be assumed to be the same as the + // location of the server the client ends up connected to. + // + // Locations are primarily valuable for clients that connect from regions + // other than the ones that contain the Spanner database. + string client_location = 10; +} diff --git a/owl-bot-staging/v1/protos/google/spanner/v1/mutation.proto b/owl-bot-staging/v1/protos/google/spanner/v1/mutation.proto new file mode 100644 index 000000000..7e3306a20 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/spanner/v1/mutation.proto @@ -0,0 +1,156 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.spanner.v1; + +import "google/api/field_behavior.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; +import "google/spanner/v1/keys.proto"; + +option csharp_namespace = "Google.Cloud.Spanner.V1"; +option go_package = "cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb"; +option java_multiple_files = true; +option java_outer_classname = "MutationProto"; +option java_package = "com.google.spanner.v1"; +option php_namespace = "Google\\Cloud\\Spanner\\V1"; +option ruby_package = "Google::Cloud::Spanner::V1"; + +// A modification to one or more Cloud Spanner rows. Mutations can be +// applied to a Cloud Spanner database by sending them in a +// [Commit][google.spanner.v1.Spanner.Commit] call. +message Mutation { + // Arguments to [insert][google.spanner.v1.Mutation.insert], + // [update][google.spanner.v1.Mutation.update], + // [insert_or_update][google.spanner.v1.Mutation.insert_or_update], and + // [replace][google.spanner.v1.Mutation.replace] operations. + message Write { + // Required. The table whose rows will be written. + string table = 1 [(google.api.field_behavior) = REQUIRED]; + + // The names of the columns in + // [table][google.spanner.v1.Mutation.Write.table] to be written. + // + // The list of columns must contain enough columns to allow + // Cloud Spanner to derive values for all primary key columns in the + // row(s) to be modified. + repeated string columns = 2; + + // The values to be written. `values` can contain more than one + // list of values. If it does, then multiple rows are written, one + // for each entry in `values`. Each list in `values` must have + // exactly as many entries as there are entries in + // [columns][google.spanner.v1.Mutation.Write.columns] above. Sending + // multiple lists is equivalent to sending multiple `Mutation`s, each + // containing one `values` entry and repeating + // [table][google.spanner.v1.Mutation.Write.table] and + // [columns][google.spanner.v1.Mutation.Write.columns]. Individual values in + // each list are encoded as described [here][google.spanner.v1.TypeCode]. + repeated google.protobuf.ListValue values = 3; + } + + // Arguments to [delete][google.spanner.v1.Mutation.delete] operations. + message Delete { + // Required. The table whose rows will be deleted. + string table = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The primary keys of the rows within + // [table][google.spanner.v1.Mutation.Delete.table] to delete. The primary + // keys must be specified in the order in which they appear in the `PRIMARY + // KEY()` clause of the table's equivalent DDL statement (the DDL statement + // used to create the table). Delete is idempotent. The transaction will + // succeed even if some or all rows do not exist. + KeySet key_set = 2 [(google.api.field_behavior) = REQUIRED]; + } + + // Arguments to [send][google.spanner.v1.Mutation.send] operations. + message Send { + // Required. The queue to which the message will be sent. + string queue = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The primary key of the message to be sent. + google.protobuf.ListValue key = 2 [(google.api.field_behavior) = REQUIRED]; + + // The time at which Spanner will begin attempting to deliver the message. + // If `deliver_time` is not set, Spanner will deliver the message + // immediately. If `deliver_time` is in the past, Spanner will replace it + // with a value closer to the current time. + google.protobuf.Timestamp deliver_time = 3; + + // The payload of the message. + google.protobuf.Value payload = 4; + } + + // Arguments to [ack][google.spanner.v1.Mutation.ack] operations. + message Ack { + // Required. The queue where the message to be acked is stored. + string queue = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The primary key of the message to be acked. + google.protobuf.ListValue key = 2 [(google.api.field_behavior) = REQUIRED]; + + // By default, an attempt to ack a message that does not exist will fail + // with a `NOT_FOUND` error. With `ignore_not_found` set to true, the ack + // will succeed even if the message does not exist. This is useful for + // unconditionally acking a message, even if it is missing or has already + // been acked. + bool ignore_not_found = 3; + } + + // Required. The operation to perform. + oneof operation { + // Insert new rows in a table. If any of the rows already exist, + // the write or transaction fails with error `ALREADY_EXISTS`. + Write insert = 1; + + // Update existing rows in a table. If any of the rows does not + // already exist, the transaction fails with error `NOT_FOUND`. + Write update = 2; + + // Like [insert][google.spanner.v1.Mutation.insert], except that if the row + // already exists, then its column values are overwritten with the ones + // provided. Any column values not explicitly written are preserved. + // + // When using + // [insert_or_update][google.spanner.v1.Mutation.insert_or_update], just as + // when using [insert][google.spanner.v1.Mutation.insert], all `NOT NULL` + // columns in the table must be given a value. This holds true even when the + // row already exists and will therefore actually be updated. + Write insert_or_update = 3; + + // Like [insert][google.spanner.v1.Mutation.insert], except that if the row + // already exists, it is deleted, and the column values provided are + // inserted instead. Unlike + // [insert_or_update][google.spanner.v1.Mutation.insert_or_update], this + // means any values not explicitly written become `NULL`. + // + // In an interleaved table, if you create the child table with the + // `ON DELETE CASCADE` annotation, then replacing a parent row + // also deletes the child rows. Otherwise, you must delete the + // child rows before you replace the parent row. + Write replace = 4; + + // Delete rows from a table. Succeeds whether or not the named + // rows were present. + Delete delete = 5; + + // Send a message to a queue. + Send send = 6; + + // Ack a message from a queue. + Ack ack = 7; + } +} diff --git a/owl-bot-staging/v1/protos/google/spanner/v1/query_plan.proto b/owl-bot-staging/v1/protos/google/spanner/v1/query_plan.proto new file mode 100644 index 000000000..5850ff97f --- /dev/null +++ b/owl-bot-staging/v1/protos/google/spanner/v1/query_plan.proto @@ -0,0 +1,156 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.spanner.v1; + +import "google/api/field_behavior.proto"; +import "google/protobuf/struct.proto"; + +option csharp_namespace = "Google.Cloud.Spanner.V1"; +option go_package = "cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb"; +option java_multiple_files = true; +option java_outer_classname = "QueryPlanProto"; +option java_package = "com.google.spanner.v1"; +option php_namespace = "Google\\Cloud\\Spanner\\V1"; +option ruby_package = "Google::Cloud::Spanner::V1"; + +// Node information for nodes appearing in a +// [QueryPlan.plan_nodes][google.spanner.v1.QueryPlan.plan_nodes]. +message PlanNode { + // The kind of [PlanNode][google.spanner.v1.PlanNode]. Distinguishes between + // the two different kinds of nodes that can appear in a query plan. + enum Kind { + // Not specified. + KIND_UNSPECIFIED = 0; + + // Denotes a Relational operator node in the expression tree. Relational + // operators represent iterative processing of rows during query execution. + // For example, a `TableScan` operation that reads rows from a table. + RELATIONAL = 1; + + // Denotes a Scalar node in the expression tree. Scalar nodes represent + // non-iterable entities in the query plan. For example, constants or + // arithmetic operators appearing inside predicate expressions or references + // to column names. + SCALAR = 2; + } + + // Metadata associated with a parent-child relationship appearing in a + // [PlanNode][google.spanner.v1.PlanNode]. + message ChildLink { + // The node to which the link points. + int32 child_index = 1; + + // The type of the link. For example, in Hash Joins this could be used to + // distinguish between the build child and the probe child, or in the case + // of the child being an output variable, to represent the tag associated + // with the output variable. + string type = 2; + + // Only present if the child node is + // [SCALAR][google.spanner.v1.PlanNode.Kind.SCALAR] and corresponds to an + // output variable of the parent node. The field carries the name of the + // output variable. For example, a `TableScan` operator that reads rows from + // a table will have child links to the `SCALAR` nodes representing the + // output variables created for each column that is read by the operator. + // The corresponding `variable` fields will be set to the variable names + // assigned to the columns. + string variable = 3; + } + + // Condensed representation of a node and its subtree. Only present for + // `SCALAR` [PlanNode(s)][google.spanner.v1.PlanNode]. + message ShortRepresentation { + // A string representation of the expression subtree rooted at this node. + string description = 1; + + // A mapping of (subquery variable name) -> (subquery node id) for cases + // where the `description` string of this node references a `SCALAR` + // subquery contained in the expression subtree rooted at this node. The + // referenced `SCALAR` subquery may not necessarily be a direct child of + // this node. + map subqueries = 2; + } + + // The `PlanNode`'s index in [node + // list][google.spanner.v1.QueryPlan.plan_nodes]. + int32 index = 1; + + // Used to determine the type of node. May be needed for visualizing + // different kinds of nodes differently. For example, If the node is a + // [SCALAR][google.spanner.v1.PlanNode.Kind.SCALAR] node, it will have a + // condensed representation which can be used to directly embed a description + // of the node in its parent. + Kind kind = 2; + + // The display name for the node. + string display_name = 3; + + // List of child node `index`es and their relationship to this parent. + repeated ChildLink child_links = 4; + + // Condensed representation for + // [SCALAR][google.spanner.v1.PlanNode.Kind.SCALAR] nodes. + ShortRepresentation short_representation = 5; + + // Attributes relevant to the node contained in a group of key-value pairs. + // For example, a Parameter Reference node could have the following + // information in its metadata: + // + // { + // "parameter_reference": "param1", + // "parameter_type": "array" + // } + google.protobuf.Struct metadata = 6; + + // The execution statistics associated with the node, contained in a group of + // key-value pairs. Only present if the plan was returned as a result of a + // profile query. For example, number of executions, number of rows/time per + // execution etc. + google.protobuf.Struct execution_stats = 7; +} + +// Output of query advisor analysis. +message QueryAdvisorResult { + // Recommendation to add new indexes to run queries more efficiently. + message IndexAdvice { + // Optional. DDL statements to add new indexes that will improve the query. + repeated string ddl = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Estimated latency improvement factor. For example if the query + // currently takes 500 ms to run and the estimated latency with new indexes + // is 100 ms this field will be 5. + double improvement_factor = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. Index Recommendation for a query. This is an optional field and + // the recommendation will only be available when the recommendation + // guarantees significant improvement in query performance. + repeated IndexAdvice index_advice = 1 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Contains an ordered list of nodes appearing in the query plan. +message QueryPlan { + // The nodes in the query plan. Plan nodes are returned in pre-order starting + // with the plan root. Each [PlanNode][google.spanner.v1.PlanNode]'s `id` + // corresponds to its index in `plan_nodes`. + repeated PlanNode plan_nodes = 1; + + // Optional. The advise/recommendations for a query. Currently this field will + // be serving index recommendations for a query. + QueryAdvisorResult query_advice = 2 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/owl-bot-staging/v1/protos/google/spanner/v1/result_set.proto b/owl-bot-staging/v1/protos/google/spanner/v1/result_set.proto new file mode 100644 index 000000000..3851d688c --- /dev/null +++ b/owl-bot-staging/v1/protos/google/spanner/v1/result_set.proto @@ -0,0 +1,260 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.spanner.v1; + +import "google/api/field_behavior.proto"; +import "google/protobuf/struct.proto"; +import "google/spanner/v1/location.proto"; +import "google/spanner/v1/query_plan.proto"; +import "google/spanner/v1/transaction.proto"; +import "google/spanner/v1/type.proto"; + +option csharp_namespace = "Google.Cloud.Spanner.V1"; +option go_package = "cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb"; +option java_multiple_files = true; +option java_outer_classname = "ResultSetProto"; +option java_package = "com.google.spanner.v1"; +option php_namespace = "Google\\Cloud\\Spanner\\V1"; +option ruby_package = "Google::Cloud::Spanner::V1"; + +// Results from [Read][google.spanner.v1.Spanner.Read] or +// [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql]. +message ResultSet { + // Metadata about the result set, such as row type information. + ResultSetMetadata metadata = 1; + + // Each element in `rows` is a row whose format is defined by + // [metadata.row_type][google.spanner.v1.ResultSetMetadata.row_type]. The ith + // element in each row matches the ith field in + // [metadata.row_type][google.spanner.v1.ResultSetMetadata.row_type]. Elements + // are encoded based on type as described [here][google.spanner.v1.TypeCode]. + repeated google.protobuf.ListValue rows = 2; + + // Query plan and execution statistics for the SQL statement that + // produced this result set. These can be requested by setting + // [ExecuteSqlRequest.query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode]. + // DML statements always produce stats containing the number of rows + // modified, unless executed using the + // [ExecuteSqlRequest.QueryMode.PLAN][google.spanner.v1.ExecuteSqlRequest.QueryMode.PLAN] + // [ExecuteSqlRequest.query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode]. + // Other fields might or might not be populated, based on the + // [ExecuteSqlRequest.query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode]. + ResultSetStats stats = 3; + + // Optional. A precommit token is included if the read-write transaction is on + // a multiplexed session. Pass the precommit token with the highest sequence + // number from this transaction attempt to the + // [Commit][google.spanner.v1.Spanner.Commit] request for this transaction. + MultiplexedSessionPrecommitToken precommit_token = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A cache update expresses a set of changes the client should + // incorporate into its location cache. The client should discard the changes + // if they are older than the data it already has. This data can be obtained + // in response to requests that included a `RoutingHint` field, but may also + // be obtained by explicit location-fetching RPCs which may be added in the + // future. + CacheUpdate cache_update = 6 [(google.api.field_behavior) = OPTIONAL]; +} + +// Partial results from a streaming read or SQL query. Streaming reads and +// SQL queries better tolerate large result sets, large rows, and large +// values, but are a little trickier to consume. +message PartialResultSet { + // Metadata about the result set, such as row type information. + // Only present in the first response. + ResultSetMetadata metadata = 1; + + // A streamed result set consists of a stream of values, which might + // be split into many `PartialResultSet` messages to accommodate + // large rows and/or large values. Every N complete values defines a + // row, where N is equal to the number of entries in + // [metadata.row_type.fields][google.spanner.v1.StructType.fields]. + // + // Most values are encoded based on type as described + // [here][google.spanner.v1.TypeCode]. + // + // It's possible that the last value in values is "chunked", + // meaning that the rest of the value is sent in subsequent + // `PartialResultSet`(s). This is denoted by the + // [chunked_value][google.spanner.v1.PartialResultSet.chunked_value] field. + // Two or more chunked values can be merged to form a complete value as + // follows: + // + // * `bool/number/null`: can't be chunked + // * `string`: concatenate the strings + // * `list`: concatenate the lists. If the last element in a list is a + // `string`, `list`, or `object`, merge it with the first element in + // the next list by applying these rules recursively. + // * `object`: concatenate the (field name, field value) pairs. If a + // field name is duplicated, then apply these rules recursively + // to merge the field values. + // + // Some examples of merging: + // + // Strings are concatenated. + // "foo", "bar" => "foobar" + // + // Lists of non-strings are concatenated. + // [2, 3], [4] => [2, 3, 4] + // + // Lists are concatenated, but the last and first elements are merged + // because they are strings. + // ["a", "b"], ["c", "d"] => ["a", "bc", "d"] + // + // Lists are concatenated, but the last and first elements are merged + // because they are lists. Recursively, the last and first elements + // of the inner lists are merged because they are strings. + // ["a", ["b", "c"]], [["d"], "e"] => ["a", ["b", "cd"], "e"] + // + // Non-overlapping object fields are combined. + // {"a": "1"}, {"b": "2"} => {"a": "1", "b": 2"} + // + // Overlapping object fields are merged. + // {"a": "1"}, {"a": "2"} => {"a": "12"} + // + // Examples of merging objects containing lists of strings. + // {"a": ["1"]}, {"a": ["2"]} => {"a": ["12"]} + // + // For a more complete example, suppose a streaming SQL query is + // yielding a result set whose rows contain a single string + // field. The following `PartialResultSet`s might be yielded: + // + // { + // "metadata": { ... } + // "values": ["Hello", "W"] + // "chunked_value": true + // "resume_token": "Af65..." + // } + // { + // "values": ["orl"] + // "chunked_value": true + // } + // { + // "values": ["d"] + // "resume_token": "Zx1B..." + // } + // + // This sequence of `PartialResultSet`s encodes two rows, one + // containing the field value `"Hello"`, and a second containing the + // field value `"World" = "W" + "orl" + "d"`. + // + // Not all `PartialResultSet`s contain a `resume_token`. Execution can only be + // resumed from a previously yielded `resume_token`. For the above sequence of + // `PartialResultSet`s, resuming the query with `"resume_token": "Af65..."` + // yields results from the `PartialResultSet` with value "orl". + repeated google.protobuf.Value values = 2; + + // If true, then the final value in + // [values][google.spanner.v1.PartialResultSet.values] is chunked, and must be + // combined with more values from subsequent `PartialResultSet`s to obtain a + // complete field value. + bool chunked_value = 3; + + // Streaming calls might be interrupted for a variety of reasons, such + // as TCP connection loss. If this occurs, the stream of results can + // be resumed by re-sending the original request and including + // `resume_token`. Note that executing any other transaction in the + // same session invalidates the token. + bytes resume_token = 4; + + // Query plan and execution statistics for the statement that produced this + // streaming result set. These can be requested by setting + // [ExecuteSqlRequest.query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode] + // and are sent only once with the last response in the stream. This field is + // also present in the last response for DML statements. + ResultSetStats stats = 5; + + // Optional. A precommit token is included if the read-write transaction + // has multiplexed sessions enabled. Pass the precommit token with the highest + // sequence number from this transaction attempt to the + // [Commit][google.spanner.v1.Spanner.Commit] request for this transaction. + MultiplexedSessionPrecommitToken precommit_token = 8 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Indicates whether this is the last `PartialResultSet` in the + // stream. The server might optionally set this field. Clients shouldn't rely + // on this field being set in all cases. + bool last = 9 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A cache update expresses a set of changes the client should + // incorporate into its location cache. The client should discard the changes + // if they are older than the data it already has. This data can be obtained + // in response to requests that included a `RoutingHint` field, but may also + // be obtained by explicit location-fetching RPCs which may be added in the + // future. + CacheUpdate cache_update = 10 [(google.api.field_behavior) = OPTIONAL]; +} + +// Metadata about a [ResultSet][google.spanner.v1.ResultSet] or +// [PartialResultSet][google.spanner.v1.PartialResultSet]. +message ResultSetMetadata { + // Indicates the field names and types for the rows in the result + // set. For example, a SQL query like `"SELECT UserId, UserName FROM + // Users"` could return a `row_type` value like: + // + // "fields": [ + // { "name": "UserId", "type": { "code": "INT64" } }, + // { "name": "UserName", "type": { "code": "STRING" } }, + // ] + StructType row_type = 1; + + // If the read or SQL query began a transaction as a side-effect, the + // information about the new transaction is yielded here. + Transaction transaction = 2; + + // A SQL query can be parameterized. In PLAN mode, these parameters can be + // undeclared. This indicates the field names and types for those undeclared + // parameters in the SQL query. For example, a SQL query like `"SELECT * FROM + // Users where UserId = @userId and UserName = @userName "` could return a + // `undeclared_parameters` value like: + // + // "fields": [ + // { "name": "UserId", "type": { "code": "INT64" } }, + // { "name": "UserName", "type": { "code": "STRING" } }, + // ] + StructType undeclared_parameters = 3; +} + +// Additional statistics about a [ResultSet][google.spanner.v1.ResultSet] or +// [PartialResultSet][google.spanner.v1.PartialResultSet]. +message ResultSetStats { + // [QueryPlan][google.spanner.v1.QueryPlan] for the query associated with this + // result. + QueryPlan query_plan = 1; + + // Aggregated statistics from the execution of the query. Only present when + // the query is profiled. For example, a query could return the statistics as + // follows: + // + // { + // "rows_returned": "3", + // "elapsed_time": "1.22 secs", + // "cpu_time": "1.19 secs" + // } + google.protobuf.Struct query_stats = 2; + + // The number of rows modified by the DML statement. + oneof row_count { + // Standard DML returns an exact count of rows that were modified. + int64 row_count_exact = 3; + + // Partitioned DML doesn't offer exactly-once semantics, so it + // returns a lower bound of the rows modified. + int64 row_count_lower_bound = 4; + } +} diff --git a/owl-bot-staging/v1/protos/google/spanner/v1/spanner.proto b/owl-bot-staging/v1/protos/google/spanner/v1/spanner.proto new file mode 100644 index 000000000..525cc2ba4 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/spanner/v1/spanner.proto @@ -0,0 +1,1419 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.spanner.v1; + +import public "google/spanner/v1/commit_response.proto"; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; +import "google/spanner/v1/keys.proto"; +import "google/spanner/v1/location.proto"; +import "google/spanner/v1/mutation.proto"; +import "google/spanner/v1/result_set.proto"; +import "google/spanner/v1/transaction.proto"; +import "google/spanner/v1/type.proto"; + +option csharp_namespace = "Google.Cloud.Spanner.V1"; +option go_package = "cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb"; +option java_multiple_files = true; +option java_outer_classname = "SpannerProto"; +option java_package = "com.google.spanner.v1"; +option php_namespace = "Google\\Cloud\\Spanner\\V1"; +option ruby_package = "Google::Cloud::Spanner::V1"; +option (google.api.resource_definition) = { + type: "spanner.googleapis.com/Database" + pattern: "projects/{project}/instances/{instance}/databases/{database}" +}; + +// Cloud Spanner API +// +// The Cloud Spanner API can be used to manage sessions and execute +// transactions on data stored in Cloud Spanner databases. +service Spanner { + option (google.api.default_host) = "spanner.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/spanner.data"; + + // Creates a new session. A session can be used to perform + // transactions that read and/or modify data in a Cloud Spanner database. + // Sessions are meant to be reused for many consecutive + // transactions. + // + // Sessions can only execute one transaction at a time. To execute + // multiple concurrent read-write/write-only transactions, create + // multiple sessions. Note that standalone reads and queries use a + // transaction internally, and count toward the one transaction + // limit. + // + // Active sessions use additional server resources, so it's a good idea to + // delete idle and unneeded sessions. + // Aside from explicit deletes, Cloud Spanner can delete sessions when no + // operations are sent for more than an hour. If a session is deleted, + // requests to it return `NOT_FOUND`. + // + // Idle sessions can be kept alive by sending a trivial SQL query + // periodically, for example, `"SELECT 1"`. + rpc CreateSession(CreateSessionRequest) returns (Session) { + option (google.api.http) = { + post: "/v1/{database=projects/*/instances/*/databases/*}/sessions" + body: "*" + }; + option (google.api.method_signature) = "database"; + } + + // Creates multiple new sessions. + // + // This API can be used to initialize a session cache on the clients. + // See https://goo.gl/TgSFN2 for best practices on session cache management. + rpc BatchCreateSessions(BatchCreateSessionsRequest) + returns (BatchCreateSessionsResponse) { + option (google.api.http) = { + post: "/v1/{database=projects/*/instances/*/databases/*}/sessions:batchCreate" + body: "*" + }; + option (google.api.method_signature) = "database,session_count"; + } + + // Gets a session. Returns `NOT_FOUND` if the session doesn't exist. + // This is mainly useful for determining whether a session is still + // alive. + rpc GetSession(GetSessionRequest) returns (Session) { + option (google.api.http) = { + get: "/v1/{name=projects/*/instances/*/databases/*/sessions/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists all sessions in a given database. + rpc ListSessions(ListSessionsRequest) returns (ListSessionsResponse) { + option (google.api.http) = { + get: "/v1/{database=projects/*/instances/*/databases/*}/sessions" + }; + option (google.api.method_signature) = "database"; + } + + // Ends a session, releasing server resources associated with it. This + // asynchronously triggers the cancellation of any operations that are running + // with this session. + rpc DeleteSession(DeleteSessionRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/instances/*/databases/*/sessions/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Executes an SQL statement, returning all results in a single reply. This + // method can't be used to return a result set larger than 10 MiB; + // if the query yields more data than that, the query fails with + // a `FAILED_PRECONDITION` error. + // + // Operations inside read-write transactions might return `ABORTED`. If + // this occurs, the application should restart the transaction from + // the beginning. See [Transaction][google.spanner.v1.Transaction] for more + // details. + // + // Larger result sets can be fetched in streaming fashion by calling + // [ExecuteStreamingSql][google.spanner.v1.Spanner.ExecuteStreamingSql] + // instead. + // + // The query string can be SQL or [Graph Query Language + // (GQL)](https://cloud.google.com/spanner/docs/reference/standard-sql/graph-intro). + rpc ExecuteSql(ExecuteSqlRequest) returns (ResultSet) { + option (google.api.http) = { + post: "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:executeSql" + body: "*" + }; + } + + // Like [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql], except returns the + // result set as a stream. Unlike + // [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql], there is no limit on + // the size of the returned result set. However, no individual row in the + // result set can exceed 100 MiB, and no column value can exceed 10 MiB. + // + // The query string can be SQL or [Graph Query Language + // (GQL)](https://cloud.google.com/spanner/docs/reference/standard-sql/graph-intro). + rpc ExecuteStreamingSql(ExecuteSqlRequest) returns (stream PartialResultSet) { + option (google.api.http) = { + post: "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:executeStreamingSql" + body: "*" + }; + } + + // Executes a batch of SQL DML statements. This method allows many statements + // to be run with lower latency than submitting them sequentially with + // [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql]. + // + // Statements are executed in sequential order. A request can succeed even if + // a statement fails. The + // [ExecuteBatchDmlResponse.status][google.spanner.v1.ExecuteBatchDmlResponse.status] + // field in the response provides information about the statement that failed. + // Clients must inspect this field to determine whether an error occurred. + // + // Execution stops after the first failed statement; the remaining statements + // are not executed. + rpc ExecuteBatchDml(ExecuteBatchDmlRequest) + returns (ExecuteBatchDmlResponse) { + option (google.api.http) = { + post: "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:executeBatchDml" + body: "*" + }; + } + + // Reads rows from the database using key lookups and scans, as a + // simple key/value style alternative to + // [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql]. This method can't be + // used to return a result set larger than 10 MiB; if the read matches more + // data than that, the read fails with a `FAILED_PRECONDITION` + // error. + // + // Reads inside read-write transactions might return `ABORTED`. If + // this occurs, the application should restart the transaction from + // the beginning. See [Transaction][google.spanner.v1.Transaction] for more + // details. + // + // Larger result sets can be yielded in streaming fashion by calling + // [StreamingRead][google.spanner.v1.Spanner.StreamingRead] instead. + rpc Read(ReadRequest) returns (ResultSet) { + option (google.api.http) = { + post: "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:read" + body: "*" + }; + } + + // Like [Read][google.spanner.v1.Spanner.Read], except returns the result set + // as a stream. Unlike [Read][google.spanner.v1.Spanner.Read], there is no + // limit on the size of the returned result set. However, no individual row in + // the result set can exceed 100 MiB, and no column value can exceed + // 10 MiB. + rpc StreamingRead(ReadRequest) returns (stream PartialResultSet) { + option (google.api.http) = { + post: "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:streamingRead" + body: "*" + }; + } + + // Begins a new transaction. This step can often be skipped: + // [Read][google.spanner.v1.Spanner.Read], + // [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql] and + // [Commit][google.spanner.v1.Spanner.Commit] can begin a new transaction as a + // side-effect. + rpc BeginTransaction(BeginTransactionRequest) returns (Transaction) { + option (google.api.http) = { + post: "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:beginTransaction" + body: "*" + }; + option (google.api.method_signature) = "session,options"; + } + + // Commits a transaction. The request includes the mutations to be + // applied to rows in the database. + // + // `Commit` might return an `ABORTED` error. This can occur at any time; + // commonly, the cause is conflicts with concurrent + // transactions. However, it can also happen for a variety of other + // reasons. If `Commit` returns `ABORTED`, the caller should retry + // the transaction from the beginning, reusing the same session. + // + // On very rare occasions, `Commit` might return `UNKNOWN`. This can happen, + // for example, if the client job experiences a 1+ hour networking failure. + // At that point, Cloud Spanner has lost track of the transaction outcome and + // we recommend that you perform another read from the database to see the + // state of things as they are now. + rpc Commit(CommitRequest) returns (CommitResponse) { + option (google.api.http) = { + post: "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:commit" + body: "*" + }; + option (google.api.method_signature) = "session,transaction_id,mutations"; + option (google.api.method_signature) = + "session,single_use_transaction,mutations"; + } + + // Rolls back a transaction, releasing any locks it holds. It's a good + // idea to call this for any transaction that includes one or more + // [Read][google.spanner.v1.Spanner.Read] or + // [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql] requests and ultimately + // decides not to commit. + // + // `Rollback` returns `OK` if it successfully aborts the transaction, the + // transaction was already aborted, or the transaction isn't + // found. `Rollback` never returns `ABORTED`. + rpc Rollback(RollbackRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:rollback" + body: "*" + }; + option (google.api.method_signature) = "session,transaction_id"; + } + + // Creates a set of partition tokens that can be used to execute a query + // operation in parallel. Each of the returned partition tokens can be used + // by [ExecuteStreamingSql][google.spanner.v1.Spanner.ExecuteStreamingSql] to + // specify a subset of the query result to read. The same session and + // read-only transaction must be used by the `PartitionQueryRequest` used to + // create the partition tokens and the `ExecuteSqlRequests` that use the + // partition tokens. + // + // Partition tokens become invalid when the session used to create them + // is deleted, is idle for too long, begins a new transaction, or becomes too + // old. When any of these happen, it isn't possible to resume the query, and + // the whole operation must be restarted from the beginning. + rpc PartitionQuery(PartitionQueryRequest) returns (PartitionResponse) { + option (google.api.http) = { + post: "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:partitionQuery" + body: "*" + }; + } + + // Creates a set of partition tokens that can be used to execute a read + // operation in parallel. Each of the returned partition tokens can be used + // by [StreamingRead][google.spanner.v1.Spanner.StreamingRead] to specify a + // subset of the read result to read. The same session and read-only + // transaction must be used by the `PartitionReadRequest` used to create the + // partition tokens and the `ReadRequests` that use the partition tokens. + // There are no ordering guarantees on rows returned among the returned + // partition tokens, or even within each individual `StreamingRead` call + // issued with a `partition_token`. + // + // Partition tokens become invalid when the session used to create them + // is deleted, is idle for too long, begins a new transaction, or becomes too + // old. When any of these happen, it isn't possible to resume the read, and + // the whole operation must be restarted from the beginning. + rpc PartitionRead(PartitionReadRequest) returns (PartitionResponse) { + option (google.api.http) = { + post: "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:partitionRead" + body: "*" + }; + } + + // Batches the supplied mutation groups in a collection of efficient + // transactions. All mutations in a group are committed atomically. However, + // mutations across groups can be committed non-atomically in an unspecified + // order and thus, they must be independent of each other. Partial failure is + // possible, that is, some groups might have been committed successfully, + // while some might have failed. The results of individual batches are + // streamed into the response as the batches are applied. + // + // `BatchWrite` requests are not replay protected, meaning that each mutation + // group can be applied more than once. Replays of non-idempotent mutations + // can have undesirable effects. For example, replays of an insert mutation + // can produce an already exists error or if you use generated or commit + // timestamp-based keys, it can result in additional rows being added to the + // mutation's table. We recommend structuring your mutation groups to be + // idempotent to avoid this issue. + rpc BatchWrite(BatchWriteRequest) returns (stream BatchWriteResponse) { + option (google.api.http) = { + post: "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:batchWrite" + body: "*" + }; + option (google.api.method_signature) = "session,mutation_groups"; + } +} + +// The request for [CreateSession][google.spanner.v1.Spanner.CreateSession]. +message CreateSessionRequest { + // Required. The database in which the new session is created. + string database = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "spanner.googleapis.com/Database" + } + ]; + + // Required. The session to create. + Session session = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The request for +// [BatchCreateSessions][google.spanner.v1.Spanner.BatchCreateSessions]. +message BatchCreateSessionsRequest { + // Required. The database in which the new sessions are created. + string database = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "spanner.googleapis.com/Database" + } + ]; + + // Parameters to apply to each created session. + Session session_template = 2; + + // Required. The number of sessions to be created in this batch call. At least + // one session is created. The API can return fewer than the requested number + // of sessions. If a specific number of sessions are desired, the client can + // make additional calls to `BatchCreateSessions` (adjusting + // [session_count][google.spanner.v1.BatchCreateSessionsRequest.session_count] + // as necessary). + int32 session_count = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// The response for +// [BatchCreateSessions][google.spanner.v1.Spanner.BatchCreateSessions]. +message BatchCreateSessionsResponse { + // The freshly created sessions. + repeated Session session = 1; +} + +// A session in the Cloud Spanner API. +message Session { + option (google.api.resource) = { + type: "spanner.googleapis.com/Session" + pattern: "projects/{project}/instances/{instance}/databases/{database}/sessions/{session}" + plural: "sessions" + singular: "session" + }; + + // Output only. The name of the session. This is always system-assigned. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The labels for the session. + // + // * Label keys must be between 1 and 63 characters long and must conform to + // the following regular expression: `[a-z]([-a-z0-9]*[a-z0-9])?`. + // * Label values must be between 0 and 63 characters long and must conform + // to the regular expression `([a-z]([-a-z0-9]*[a-z0-9])?)?`. + // * No more than 64 labels can be associated with a given session. + // + // See https://goo.gl/xmQnxf for more information on and examples of labels. + map labels = 2; + + // Output only. The timestamp when the session is created. + google.protobuf.Timestamp create_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The approximate timestamp when the session is last used. It's + // typically earlier than the actual last use time. + google.protobuf.Timestamp approximate_last_use_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The database role which created this session. + string creator_role = 5; + + // Optional. If `true`, specifies a multiplexed session. Use a multiplexed + // session for multiple, concurrent operations including any combination of + // read-only and read-write transactions. Use + // [`sessions.create`][google.spanner.v1.Spanner.CreateSession] to create + // multiplexed sessions. Don't use + // [BatchCreateSessions][google.spanner.v1.Spanner.BatchCreateSessions] to + // create a multiplexed session. You can't delete or list multiplexed + // sessions. + bool multiplexed = 6 [(google.api.field_behavior) = OPTIONAL]; +} + +// The request for [GetSession][google.spanner.v1.Spanner.GetSession]. +message GetSessionRequest { + // Required. The name of the session to retrieve. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "spanner.googleapis.com/Session" } + ]; +} + +// The request for [ListSessions][google.spanner.v1.Spanner.ListSessions]. +message ListSessionsRequest { + // Required. The database in which to list sessions. + string database = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "spanner.googleapis.com/Database" + } + ]; + + // Number of sessions to be returned in the response. If 0 or less, defaults + // to the server's maximum allowed page size. + int32 page_size = 2; + + // If non-empty, `page_token` should contain a + // [next_page_token][google.spanner.v1.ListSessionsResponse.next_page_token] + // from a previous + // [ListSessionsResponse][google.spanner.v1.ListSessionsResponse]. + string page_token = 3; + + // An expression for filtering the results of the request. Filter rules are + // case insensitive. The fields eligible for filtering are: + // + // * `labels.key` where key is the name of a label + // + // Some examples of using filters are: + // + // * `labels.env:*` --> The session has the label "env". + // * `labels.env:dev` --> The session has the label "env" and the value of + // the label contains the string "dev". + string filter = 4; +} + +// The response for [ListSessions][google.spanner.v1.Spanner.ListSessions]. +message ListSessionsResponse { + // The list of requested sessions. + repeated Session sessions = 1; + + // `next_page_token` can be sent in a subsequent + // [ListSessions][google.spanner.v1.Spanner.ListSessions] call to fetch more + // of the matching sessions. + string next_page_token = 2; +} + +// The request for [DeleteSession][google.spanner.v1.Spanner.DeleteSession]. +message DeleteSessionRequest { + // Required. The name of the session to delete. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "spanner.googleapis.com/Session" } + ]; +} + +// Common request options for various APIs. +message RequestOptions { + // The relative priority for requests. Note that priority isn't applicable + // for [BeginTransaction][google.spanner.v1.Spanner.BeginTransaction]. + // + // The priority acts as a hint to the Cloud Spanner scheduler and doesn't + // guarantee priority or order of execution. For example: + // + // * Some parts of a write operation always execute at `PRIORITY_HIGH`, + // regardless of the specified priority. This can cause you to see an + // increase in high priority workload even when executing a low priority + // request. This can also potentially cause a priority inversion where a + // lower priority request is fulfilled ahead of a higher priority + // request. + // * If a transaction contains multiple operations with different priorities, + // Cloud Spanner doesn't guarantee to process the higher priority + // operations first. There might be other constraints to satisfy, such as + // the order of operations. + enum Priority { + // `PRIORITY_UNSPECIFIED` is equivalent to `PRIORITY_HIGH`. + PRIORITY_UNSPECIFIED = 0; + + // This specifies that the request is low priority. + PRIORITY_LOW = 1; + + // This specifies that the request is medium priority. + PRIORITY_MEDIUM = 2; + + // This specifies that the request is high priority. + PRIORITY_HIGH = 3; + } + + // Container for various pieces of client-owned context attached to a request. + message ClientContext { + // Optional. Map of parameter name to value for this request. These values + // will be returned by any SECURE_CONTEXT() calls invoked by this request + // (e.g., by queries against Parameterized Secure Views). + map secure_context = 1 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Priority for the request. + Priority priority = 1; + + // A per-request tag which can be applied to queries or reads, used for + // statistics collection. + // Both `request_tag` and `transaction_tag` can be specified for a read or + // query that belongs to a transaction. + // This field is ignored for requests where it's not applicable (for example, + // `CommitRequest`). + // Legal characters for `request_tag` values are all printable characters + // (ASCII 32 - 126) and the length of a request_tag is limited to 50 + // characters. Values that exceed this limit are truncated. + // Any leading underscore (_) characters are removed from the string. + string request_tag = 2; + + // A tag used for statistics collection about this transaction. + // Both `request_tag` and `transaction_tag` can be specified for a read or + // query that belongs to a transaction. + // To enable tagging on a transaction, `transaction_tag` must be set to the + // same value for all requests belonging to the same transaction, including + // [BeginTransaction][google.spanner.v1.Spanner.BeginTransaction]. + // If this request doesn't belong to any transaction, `transaction_tag` is + // ignored. + // Legal characters for `transaction_tag` values are all printable characters + // (ASCII 32 - 126) and the length of a `transaction_tag` is limited to 50 + // characters. Values that exceed this limit are truncated. + // Any leading underscore (_) characters are removed from the string. + string transaction_tag = 3; + + // Optional. Optional context that may be needed for some requests. + ClientContext client_context = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// The `DirectedReadOptions` can be used to indicate which replicas or regions +// should be used for non-transactional reads or queries. +// +// `DirectedReadOptions` can only be specified for a read-only transaction, +// otherwise the API returns an `INVALID_ARGUMENT` error. +message DirectedReadOptions { + // The directed read replica selector. + // Callers must provide one or more of the following fields for replica + // selection: + // + // * `location` - The location must be one of the regions within the + // multi-region configuration of your database. + // * `type` - The type of the replica. + // + // Some examples of using replica_selectors are: + // + // * `location:us-east1` --> The "us-east1" replica(s) of any available type + // is used to process the request. + // * `type:READ_ONLY` --> The "READ_ONLY" type replica(s) in the nearest + // available location are used to process the + // request. + // * `location:us-east1 type:READ_ONLY` --> The "READ_ONLY" type replica(s) + // in location "us-east1" is used to process + // the request. + message ReplicaSelection { + // Indicates the type of replica. + enum Type { + // Not specified. + TYPE_UNSPECIFIED = 0; + + // Read-write replicas support both reads and writes. + READ_WRITE = 1; + + // Read-only replicas only support reads (not writes). + READ_ONLY = 2; + } + + // The location or region of the serving requests, for example, "us-east1". + string location = 1; + + // The type of replica. + Type type = 2; + } + + // An `IncludeReplicas` contains a repeated set of `ReplicaSelection` which + // indicates the order in which replicas should be considered. + message IncludeReplicas { + // The directed read replica selector. + repeated ReplicaSelection replica_selections = 1; + + // If `true`, Spanner doesn't route requests to a replica outside the + // <`include_replicas` list when all of the specified replicas are + // unavailable or unhealthy. Default value is `false`. + bool auto_failover_disabled = 2; + } + + // An ExcludeReplicas contains a repeated set of ReplicaSelection that should + // be excluded from serving requests. + message ExcludeReplicas { + // The directed read replica selector. + repeated ReplicaSelection replica_selections = 1; + } + + // Required. At most one of either `include_replicas` or `exclude_replicas` + // should be present in the message. + oneof replicas { + // `Include_replicas` indicates the order of replicas (as they appear in + // this list) to process the request. If `auto_failover_disabled` is set to + // `true` and all replicas are exhausted without finding a healthy replica, + // Spanner waits for a replica in the list to become available, requests + // might fail due to `DEADLINE_EXCEEDED` errors. + IncludeReplicas include_replicas = 1; + + // `Exclude_replicas` indicates that specified replicas should be excluded + // from serving requests. Spanner doesn't route requests to the replicas + // in this list. + ExcludeReplicas exclude_replicas = 2; + } +} + +// The request for [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql] and +// [ExecuteStreamingSql][google.spanner.v1.Spanner.ExecuteStreamingSql]. +message ExecuteSqlRequest { + // Mode in which the statement must be processed. + enum QueryMode { + // The default mode. Only the statement results are returned. + NORMAL = 0; + + // This mode returns only the query plan, without any results or + // execution statistics information. + PLAN = 1; + + // This mode returns the query plan, overall execution statistics, + // operator level execution statistics along with the results. This has a + // performance overhead compared to the other modes. It isn't recommended + // to use this mode for production traffic. + PROFILE = 2; + + // This mode returns the overall (but not operator-level) execution + // statistics along with the results. + WITH_STATS = 3; + + // This mode returns the query plan, overall (but not operator-level) + // execution statistics along with the results. + WITH_PLAN_AND_STATS = 4; + } + + // Query optimizer configuration. + message QueryOptions { + // An option to control the selection of optimizer version. + // + // This parameter allows individual queries to pick different query + // optimizer versions. + // + // Specifying `latest` as a value instructs Cloud Spanner to use the + // latest supported query optimizer version. If not specified, Cloud Spanner + // uses the optimizer version set at the database level options. Any other + // positive integer (from the list of supported optimizer versions) + // overrides the default optimizer version for query execution. + // + // The list of supported optimizer versions can be queried from + // `SPANNER_SYS.SUPPORTED_OPTIMIZER_VERSIONS`. + // + // Executing a SQL statement with an invalid optimizer version fails with + // an `INVALID_ARGUMENT` error. + // + // See + // https://cloud.google.com/spanner/docs/query-optimizer/manage-query-optimizer + // for more information on managing the query optimizer. + // + // The `optimizer_version` statement hint has precedence over this setting. + string optimizer_version = 1; + + // An option to control the selection of optimizer statistics package. + // + // This parameter allows individual queries to use a different query + // optimizer statistics package. + // + // Specifying `latest` as a value instructs Cloud Spanner to use the latest + // generated statistics package. If not specified, Cloud Spanner uses + // the statistics package set at the database level options, or the latest + // package if the database option isn't set. + // + // The statistics package requested by the query has to be exempt from + // garbage collection. This can be achieved with the following DDL + // statement: + // + // ```sql + // ALTER STATISTICS SET OPTIONS (allow_gc=false) + // ``` + // + // The list of available statistics packages can be queried from + // `INFORMATION_SCHEMA.SPANNER_STATISTICS`. + // + // Executing a SQL statement with an invalid optimizer statistics package + // or with a statistics package that allows garbage collection fails with + // an `INVALID_ARGUMENT` error. + string optimizer_statistics_package = 2; + } + + // Required. The session in which the SQL query should be performed. + string session = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "spanner.googleapis.com/Session" } + ]; + + // The transaction to use. + // + // For queries, if none is provided, the default is a temporary read-only + // transaction with strong concurrency. + // + // Standard DML statements require a read-write transaction. To protect + // against replays, single-use transactions are not supported. The caller + // must either supply an existing transaction ID or begin a new transaction. + // + // Partitioned DML requires an existing Partitioned DML transaction ID. + TransactionSelector transaction = 2; + + // Required. The SQL string. + string sql = 3 [(google.api.field_behavior) = REQUIRED]; + + // Parameter names and values that bind to placeholders in the SQL string. + // + // A parameter placeholder consists of the `@` character followed by the + // parameter name (for example, `@firstName`). Parameter names must conform + // to the naming requirements of identifiers as specified at + // https://cloud.google.com/spanner/docs/lexical#identifiers. + // + // Parameters can appear anywhere that a literal value is expected. The same + // parameter name can be used more than once, for example: + // + // `"WHERE id > @msg_id AND id < @msg_id + 100"` + // + // It's an error to execute a SQL statement with unbound parameters. + google.protobuf.Struct params = 4; + + // It isn't always possible for Cloud Spanner to infer the right SQL type + // from a JSON value. For example, values of type `BYTES` and values + // of type `STRING` both appear in + // [params][google.spanner.v1.ExecuteSqlRequest.params] as JSON strings. + // + // In these cases, you can use `param_types` to specify the exact + // SQL type for some or all of the SQL statement parameters. See the + // definition of [Type][google.spanner.v1.Type] for more information + // about SQL types. + map param_types = 5; + + // If this request is resuming a previously interrupted SQL statement + // execution, `resume_token` should be copied from the last + // [PartialResultSet][google.spanner.v1.PartialResultSet] yielded before the + // interruption. Doing this enables the new SQL statement execution to resume + // where the last one left off. The rest of the request parameters must + // exactly match the request that yielded this token. + bytes resume_token = 6; + + // Used to control the amount of debugging information returned in + // [ResultSetStats][google.spanner.v1.ResultSetStats]. If + // [partition_token][google.spanner.v1.ExecuteSqlRequest.partition_token] is + // set, [query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode] can only + // be set to + // [QueryMode.NORMAL][google.spanner.v1.ExecuteSqlRequest.QueryMode.NORMAL]. + QueryMode query_mode = 7; + + // If present, results are restricted to the specified partition + // previously created using `PartitionQuery`. There must be an exact + // match for the values of fields common to this message and the + // `PartitionQueryRequest` message used to create this `partition_token`. + bytes partition_token = 8; + + // A per-transaction sequence number used to identify this request. This field + // makes each request idempotent such that if the request is received multiple + // times, at most one succeeds. + // + // The sequence number must be monotonically increasing within the + // transaction. If a request arrives for the first time with an out-of-order + // sequence number, the transaction can be aborted. Replays of previously + // handled requests yield the same response as the first execution. + // + // Required for DML statements. Ignored for queries. + int64 seqno = 9; + + // Query optimizer configuration to use for the given query. + QueryOptions query_options = 10; + + // Common options for this request. + RequestOptions request_options = 11; + + // Directed read options for this request. + DirectedReadOptions directed_read_options = 15; + + // If this is for a partitioned query and this field is set to `true`, the + // request is executed with Spanner Data Boost independent compute resources. + // + // If the field is set to `true` but the request doesn't set + // `partition_token`, the API returns an `INVALID_ARGUMENT` error. + bool data_boost_enabled = 16; + + // Optional. If set to `true`, this statement marks the end of the + // transaction. After this statement executes, you must commit or abort the + // transaction. Attempts to execute any other requests against this + // transaction (including reads and queries) are rejected. + // + // For DML statements, setting this option might cause some error reporting to + // be deferred until commit time (for example, validation of unique + // constraints). Given this, successful execution of a DML statement shouldn't + // be assumed until a subsequent `Commit` call completes successfully. + bool last_statement = 17 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If present, it makes the Spanner requests location-aware. + // + // It gives the server hints that can be used to route the request + // to an appropriate server, potentially significantly decreasing latency and + // improving throughput. To achieve improved performance, most fields must be + // filled in with accurate values. + RoutingHint routing_hint = 18 [(google.api.field_behavior) = OPTIONAL]; +} + +// The request for [ExecuteBatchDml][google.spanner.v1.Spanner.ExecuteBatchDml]. +message ExecuteBatchDmlRequest { + // A single DML statement. + message Statement { + // Required. The DML string. + string sql = 1 [(google.api.field_behavior) = REQUIRED]; + + // Parameter names and values that bind to placeholders in the DML string. + // + // A parameter placeholder consists of the `@` character followed by the + // parameter name (for example, `@firstName`). Parameter names can contain + // letters, numbers, and underscores. + // + // Parameters can appear anywhere that a literal value is expected. The + // same parameter name can be used more than once, for example: + // + // `"WHERE id > @msg_id AND id < @msg_id + 100"` + // + // It's an error to execute a SQL statement with unbound parameters. + google.protobuf.Struct params = 2; + + // It isn't always possible for Cloud Spanner to infer the right SQL type + // from a JSON value. For example, values of type `BYTES` and values + // of type `STRING` both appear in + // [params][google.spanner.v1.ExecuteBatchDmlRequest.Statement.params] as + // JSON strings. + // + // In these cases, `param_types` can be used to specify the exact + // SQL type for some or all of the SQL statement parameters. See the + // definition of [Type][google.spanner.v1.Type] for more information + // about SQL types. + map param_types = 3; + } + + // Required. The session in which the DML statements should be performed. + string session = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "spanner.googleapis.com/Session" } + ]; + + // Required. The transaction to use. Must be a read-write transaction. + // + // To protect against replays, single-use transactions are not supported. The + // caller must either supply an existing transaction ID or begin a new + // transaction. + TransactionSelector transaction = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The list of statements to execute in this batch. Statements are + // executed serially, such that the effects of statement `i` are visible to + // statement `i+1`. Each statement must be a DML statement. Execution stops at + // the first failed statement; the remaining statements are not executed. + // + // Callers must provide at least one statement. + repeated Statement statements = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. A per-transaction sequence number used to identify this request. + // This field makes each request idempotent such that if the request is + // received multiple times, at most one succeeds. + // + // The sequence number must be monotonically increasing within the + // transaction. If a request arrives for the first time with an out-of-order + // sequence number, the transaction might be aborted. Replays of previously + // handled requests yield the same response as the first execution. + int64 seqno = 4 [(google.api.field_behavior) = REQUIRED]; + + // Common options for this request. + RequestOptions request_options = 5; + + // Optional. If set to `true`, this request marks the end of the transaction. + // After these statements execute, you must commit or abort the transaction. + // Attempts to execute any other requests against this transaction + // (including reads and queries) are rejected. + // + // Setting this option might cause some error reporting to be deferred until + // commit time (for example, validation of unique constraints). Given this, + // successful execution of statements shouldn't be assumed until a subsequent + // `Commit` call completes successfully. + bool last_statements = 6 [(google.api.field_behavior) = OPTIONAL]; +} + +// The response for +// [ExecuteBatchDml][google.spanner.v1.Spanner.ExecuteBatchDml]. Contains a list +// of [ResultSet][google.spanner.v1.ResultSet] messages, one for each DML +// statement that has successfully executed, in the same order as the statements +// in the request. If a statement fails, the status in the response body +// identifies the cause of the failure. +// +// To check for DML statements that failed, use the following approach: +// +// 1. Check the status in the response message. The +// [google.rpc.Code][google.rpc.Code] enum +// value `OK` indicates that all statements were executed successfully. +// 2. If the status was not `OK`, check the number of result sets in the +// response. If the response contains `N` +// [ResultSet][google.spanner.v1.ResultSet] messages, then statement `N+1` in +// the request failed. +// +// Example 1: +// +// * Request: 5 DML statements, all executed successfully. +// * Response: 5 [ResultSet][google.spanner.v1.ResultSet] messages, with the +// status `OK`. +// +// Example 2: +// +// * Request: 5 DML statements. The third statement has a syntax error. +// * Response: 2 [ResultSet][google.spanner.v1.ResultSet] messages, and a syntax +// error (`INVALID_ARGUMENT`) +// status. The number of [ResultSet][google.spanner.v1.ResultSet] messages +// indicates that the third statement failed, and the fourth and fifth +// statements were not executed. +message ExecuteBatchDmlResponse { + // One [ResultSet][google.spanner.v1.ResultSet] for each statement in the + // request that ran successfully, in the same order as the statements in the + // request. Each [ResultSet][google.spanner.v1.ResultSet] does not contain any + // rows. The [ResultSetStats][google.spanner.v1.ResultSetStats] in each + // [ResultSet][google.spanner.v1.ResultSet] contain the number of rows + // modified by the statement. + // + // Only the first [ResultSet][google.spanner.v1.ResultSet] in the response + // contains valid [ResultSetMetadata][google.spanner.v1.ResultSetMetadata]. + repeated ResultSet result_sets = 1; + + // If all DML statements are executed successfully, the status is `OK`. + // Otherwise, the error status of the first failed statement. + google.rpc.Status status = 2; + + // Optional. A precommit token is included if the read-write transaction + // is on a multiplexed session. Pass the precommit token with the highest + // sequence number from this transaction attempt should be passed to the + // [Commit][google.spanner.v1.Spanner.Commit] request for this transaction. + MultiplexedSessionPrecommitToken precommit_token = 3 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Options for a `PartitionQueryRequest` and `PartitionReadRequest`. +message PartitionOptions { + // **Note:** This hint is currently ignored by `PartitionQuery` and + // `PartitionRead` requests. + // + // The desired data size for each partition generated. The default for this + // option is currently 1 GiB. This is only a hint. The actual size of each + // partition can be smaller or larger than this size request. + int64 partition_size_bytes = 1; + + // **Note:** This hint is currently ignored by `PartitionQuery` and + // `PartitionRead` requests. + // + // The desired maximum number of partitions to return. For example, this + // might be set to the number of workers available. The default for this + // option is currently 10,000. The maximum value is currently 200,000. This + // is only a hint. The actual number of partitions returned can be smaller or + // larger than this maximum count request. + int64 max_partitions = 2; +} + +// The request for [PartitionQuery][google.spanner.v1.Spanner.PartitionQuery] +message PartitionQueryRequest { + // Required. The session used to create the partitions. + string session = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "spanner.googleapis.com/Session" } + ]; + + // Read-only snapshot transactions are supported, read and write and + // single-use transactions are not. + TransactionSelector transaction = 2; + + // Required. The query request to generate partitions for. The request fails + // if the query isn't root partitionable. For a query to be root + // partitionable, it needs to satisfy a few conditions. For example, if the + // query execution plan contains a distributed union operator, then it must be + // the first operator in the plan. For more information about other + // conditions, see [Read data in + // parallel](https://cloud.google.com/spanner/docs/reads#read_data_in_parallel). + // + // The query request must not contain DML commands, such as `INSERT`, + // `UPDATE`, or `DELETE`. Use + // [`ExecuteStreamingSql`][google.spanner.v1.Spanner.ExecuteStreamingSql] with + // a `PartitionedDml` transaction for large, partition-friendly DML + // operations. + string sql = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Parameter names and values that bind to placeholders in the SQL + // string. + // + // A parameter placeholder consists of the `@` character followed by the + // parameter name (for example, `@firstName`). Parameter names can contain + // letters, numbers, and underscores. + // + // Parameters can appear anywhere that a literal value is expected. The same + // parameter name can be used more than once, for example: + // + // `"WHERE id > @msg_id AND id < @msg_id + 100"` + // + // It's an error to execute a SQL statement with unbound parameters. + google.protobuf.Struct params = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. It isn't always possible for Cloud Spanner to infer the right SQL + // type from a JSON value. For example, values of type `BYTES` and values of + // type `STRING` both appear in + // [params][google.spanner.v1.PartitionQueryRequest.params] as JSON strings. + // + // In these cases, `param_types` can be used to specify the exact + // SQL type for some or all of the SQL query parameters. See the + // definition of [Type][google.spanner.v1.Type] for more information + // about SQL types. + map param_types = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Additional options that affect how many partitions are created. + PartitionOptions partition_options = 6; +} + +// The request for [PartitionRead][google.spanner.v1.Spanner.PartitionRead] +message PartitionReadRequest { + // Required. The session used to create the partitions. + string session = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "spanner.googleapis.com/Session" } + ]; + + // Read only snapshot transactions are supported, read/write and single use + // transactions are not. + TransactionSelector transaction = 2; + + // Required. The name of the table in the database to be read. + string table = 3 [(google.api.field_behavior) = REQUIRED]; + + // If non-empty, the name of an index on + // [table][google.spanner.v1.PartitionReadRequest.table]. This index is used + // instead of the table primary key when interpreting + // [key_set][google.spanner.v1.PartitionReadRequest.key_set] and sorting + // result rows. See [key_set][google.spanner.v1.PartitionReadRequest.key_set] + // for further information. + string index = 4; + + // The columns of [table][google.spanner.v1.PartitionReadRequest.table] to be + // returned for each row matching this request. + repeated string columns = 5; + + // Required. `key_set` identifies the rows to be yielded. `key_set` names the + // primary keys of the rows in + // [table][google.spanner.v1.PartitionReadRequest.table] to be yielded, unless + // [index][google.spanner.v1.PartitionReadRequest.index] is present. If + // [index][google.spanner.v1.PartitionReadRequest.index] is present, then + // [key_set][google.spanner.v1.PartitionReadRequest.key_set] instead names + // index keys in [index][google.spanner.v1.PartitionReadRequest.index]. + // + // It isn't an error for the `key_set` to name rows that don't + // exist in the database. Read yields nothing for nonexistent rows. + KeySet key_set = 6 [(google.api.field_behavior) = REQUIRED]; + + // Additional options that affect how many partitions are created. + PartitionOptions partition_options = 9; +} + +// Information returned for each partition returned in a +// PartitionResponse. +message Partition { + // This token can be passed to `Read`, `StreamingRead`, `ExecuteSql`, or + // `ExecuteStreamingSql` requests to restrict the results to those identified + // by this partition token. + bytes partition_token = 1; +} + +// The response for [PartitionQuery][google.spanner.v1.Spanner.PartitionQuery] +// or [PartitionRead][google.spanner.v1.Spanner.PartitionRead] +message PartitionResponse { + // Partitions created by this request. + repeated Partition partitions = 1; + + // Transaction created by this request. + Transaction transaction = 2; +} + +// The request for [Read][google.spanner.v1.Spanner.Read] and +// [StreamingRead][google.spanner.v1.Spanner.StreamingRead]. +message ReadRequest { + // An option to control the order in which rows are returned from a read. + enum OrderBy { + // Default value. + // + // `ORDER_BY_UNSPECIFIED` is equivalent to `ORDER_BY_PRIMARY_KEY`. + ORDER_BY_UNSPECIFIED = 0; + + // Read rows are returned in primary key order. + // + // In the event that this option is used in conjunction with the + // `partition_token` field, the API returns an `INVALID_ARGUMENT` error. + ORDER_BY_PRIMARY_KEY = 1; + + // Read rows are returned in any order. + ORDER_BY_NO_ORDER = 2; + } + + // A lock hint mechanism for reads done within a transaction. + enum LockHint { + // Default value. + // + // `LOCK_HINT_UNSPECIFIED` is equivalent to `LOCK_HINT_SHARED`. + LOCK_HINT_UNSPECIFIED = 0; + + // Acquire shared locks. + // + // By default when you perform a read as part of a read-write transaction, + // Spanner acquires shared read locks, which allows other reads to still + // access the data until your transaction is ready to commit. When your + // transaction is committing and writes are being applied, the transaction + // attempts to upgrade to an exclusive lock for any data you are writing. + // For more information about locks, see [Lock + // modes](https://cloud.google.com/spanner/docs/introspection/lock-statistics#explain-lock-modes). + LOCK_HINT_SHARED = 1; + + // Acquire exclusive locks. + // + // Requesting exclusive locks is beneficial if you observe high write + // contention, which means you notice that multiple transactions are + // concurrently trying to read and write to the same data, resulting in a + // large number of aborts. This problem occurs when two transactions + // initially acquire shared locks and then both try to upgrade to exclusive + // locks at the same time. In this situation both transactions are waiting + // for the other to give up their lock, resulting in a deadlocked situation. + // Spanner is able to detect this occurring and force one of the + // transactions to abort. However, this is a slow and expensive operation + // and results in lower performance. In this case it makes sense to acquire + // exclusive locks at the start of the transaction because then when + // multiple transactions try to act on the same data, they automatically get + // serialized. Each transaction waits its turn to acquire the lock and + // avoids getting into deadlock situations. + // + // Because the exclusive lock hint is just a hint, it shouldn't be + // considered equivalent to a mutex. In other words, you shouldn't use + // Spanner exclusive locks as a mutual exclusion mechanism for the execution + // of code outside of Spanner. + // + // **Note:** Request exclusive locks judiciously because they block others + // from reading that data for the entire transaction, rather than just when + // the writes are being performed. Unless you observe high write contention, + // you should use the default of shared read locks so you don't prematurely + // block other clients from reading the data that you're writing to. + LOCK_HINT_EXCLUSIVE = 2; + } + + // Required. The session in which the read should be performed. + string session = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "spanner.googleapis.com/Session" } + ]; + + // The transaction to use. If none is provided, the default is a + // temporary read-only transaction with strong concurrency. + TransactionSelector transaction = 2; + + // Required. The name of the table in the database to be read. + string table = 3 [(google.api.field_behavior) = REQUIRED]; + + // If non-empty, the name of an index on + // [table][google.spanner.v1.ReadRequest.table]. This index is used instead of + // the table primary key when interpreting + // [key_set][google.spanner.v1.ReadRequest.key_set] and sorting result rows. + // See [key_set][google.spanner.v1.ReadRequest.key_set] for further + // information. + string index = 4; + + // Required. The columns of [table][google.spanner.v1.ReadRequest.table] to be + // returned for each row matching this request. + repeated string columns = 5 [(google.api.field_behavior) = REQUIRED]; + + // Required. `key_set` identifies the rows to be yielded. `key_set` names the + // primary keys of the rows in [table][google.spanner.v1.ReadRequest.table] to + // be yielded, unless [index][google.spanner.v1.ReadRequest.index] is present. + // If [index][google.spanner.v1.ReadRequest.index] is present, then + // [key_set][google.spanner.v1.ReadRequest.key_set] instead names index keys + // in [index][google.spanner.v1.ReadRequest.index]. + // + // If the [partition_token][google.spanner.v1.ReadRequest.partition_token] + // field is empty, rows are yielded in table primary key order (if + // [index][google.spanner.v1.ReadRequest.index] is empty) or index key order + // (if [index][google.spanner.v1.ReadRequest.index] is non-empty). If the + // [partition_token][google.spanner.v1.ReadRequest.partition_token] field + // isn't empty, rows are yielded in an unspecified order. + // + // It isn't an error for the `key_set` to name rows that don't + // exist in the database. Read yields nothing for nonexistent rows. + KeySet key_set = 6 [(google.api.field_behavior) = REQUIRED]; + + // If greater than zero, only the first `limit` rows are yielded. If `limit` + // is zero, the default is no limit. A limit can't be specified if + // `partition_token` is set. + int64 limit = 8; + + // If this request is resuming a previously interrupted read, + // `resume_token` should be copied from the last + // [PartialResultSet][google.spanner.v1.PartialResultSet] yielded before the + // interruption. Doing this enables the new read to resume where the last read + // left off. The rest of the request parameters must exactly match the request + // that yielded this token. + bytes resume_token = 9; + + // If present, results are restricted to the specified partition + // previously created using `PartitionRead`. There must be an exact + // match for the values of fields common to this message and the + // PartitionReadRequest message used to create this partition_token. + bytes partition_token = 10; + + // Common options for this request. + RequestOptions request_options = 11; + + // Directed read options for this request. + DirectedReadOptions directed_read_options = 14; + + // If this is for a partitioned read and this field is set to `true`, the + // request is executed with Spanner Data Boost independent compute resources. + // + // If the field is set to `true` but the request doesn't set + // `partition_token`, the API returns an `INVALID_ARGUMENT` error. + bool data_boost_enabled = 15; + + // Optional. Order for the returned rows. + // + // By default, Spanner returns result rows in primary key order except for + // PartitionRead requests. For applications that don't require rows to be + // returned in primary key (`ORDER_BY_PRIMARY_KEY`) order, setting + // `ORDER_BY_NO_ORDER` option allows Spanner to optimize row retrieval, + // resulting in lower latencies in certain cases (for example, bulk point + // lookups). + OrderBy order_by = 16 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Lock Hint for the request, it can only be used with read-write + // transactions. + LockHint lock_hint = 17 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If present, it makes the Spanner requests location-aware. + // + // It gives the server hints that can be used to route the request + // to an appropriate server, potentially significantly decreasing latency and + // improving throughput. To achieve improved performance, most fields must be + // filled in with accurate values. + RoutingHint routing_hint = 18 [(google.api.field_behavior) = OPTIONAL]; +} + +// The request for +// [BeginTransaction][google.spanner.v1.Spanner.BeginTransaction]. +message BeginTransactionRequest { + // Required. The session in which the transaction runs. + string session = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "spanner.googleapis.com/Session" } + ]; + + // Required. Options for the new transaction. + TransactionOptions options = 2 [(google.api.field_behavior) = REQUIRED]; + + // Common options for this request. + // Priority is ignored for this request. Setting the priority in this + // `request_options` struct doesn't do anything. To set the priority for a + // transaction, set it on the reads and writes that are part of this + // transaction instead. + RequestOptions request_options = 3; + + // Optional. Required for read-write transactions on a multiplexed session + // that commit mutations but don't perform any reads or queries. You must + // randomly select one of the mutations from the mutation set and send it as a + // part of this request. + Mutation mutation_key = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// The request for [Commit][google.spanner.v1.Spanner.Commit]. +message CommitRequest { + // Required. The session in which the transaction to be committed is running. + string session = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "spanner.googleapis.com/Session" } + ]; + + // Required. The transaction in which to commit. + oneof transaction { + // Commit a previously-started transaction. + bytes transaction_id = 2; + + // Execute mutations in a temporary transaction. Note that unlike + // commit of a previously-started transaction, commit with a + // temporary transaction is non-idempotent. That is, if the + // `CommitRequest` is sent to Cloud Spanner more than once (for + // instance, due to retries in the application, or in the + // transport library), it's possible that the mutations are + // executed more than once. If this is undesirable, use + // [BeginTransaction][google.spanner.v1.Spanner.BeginTransaction] and + // [Commit][google.spanner.v1.Spanner.Commit] instead. + TransactionOptions single_use_transaction = 3; + } + + // The mutations to be executed when this transaction commits. All + // mutations are applied atomically, in the order they appear in + // this list. + repeated Mutation mutations = 4; + + // If `true`, then statistics related to the transaction is included in + // the [CommitResponse][google.spanner.v1.CommitResponse.commit_stats]. + // Default value is `false`. + bool return_commit_stats = 5; + + // Optional. The amount of latency this request is configured to incur in + // order to improve throughput. If this field isn't set, Spanner assumes + // requests are relatively latency sensitive and automatically determines an + // appropriate delay time. You can specify a commit delay value between 0 and + // 500 ms. + google.protobuf.Duration max_commit_delay = 8 + [(google.api.field_behavior) = OPTIONAL]; + + // Common options for this request. + RequestOptions request_options = 6; + + // Optional. If the read-write transaction was executed on a multiplexed + // session, then you must include the precommit token with the highest + // sequence number received in this transaction attempt. Failing to do so + // results in a `FailedPrecondition` error. + MultiplexedSessionPrecommitToken precommit_token = 9 + [(google.api.field_behavior) = OPTIONAL]; +} + +// The request for [Rollback][google.spanner.v1.Spanner.Rollback]. +message RollbackRequest { + // Required. The session in which the transaction to roll back is running. + string session = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "spanner.googleapis.com/Session" } + ]; + + // Required. The transaction to roll back. + bytes transaction_id = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The request for [BatchWrite][google.spanner.v1.Spanner.BatchWrite]. +message BatchWriteRequest { + // A group of mutations to be committed together. Related mutations should be + // placed in a group. For example, two mutations inserting rows with the same + // primary key prefix in both parent and child tables are related. + message MutationGroup { + // Required. The mutations in this group. + repeated Mutation mutations = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // Required. The session in which the batch request is to be run. + string session = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "spanner.googleapis.com/Session" } + ]; + + // Common options for this request. + RequestOptions request_options = 3; + + // Required. The groups of mutations to be applied. + repeated MutationGroup mutation_groups = 4 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. If you don't set the `exclude_txn_from_change_streams` option or + // if it's set to `false`, then any change streams monitoring columns modified + // by transactions will capture the updates made within that transaction. + bool exclude_txn_from_change_streams = 5 + [(google.api.field_behavior) = OPTIONAL]; +} + +// The result of applying a batch of mutations. +message BatchWriteResponse { + // The mutation groups applied in this batch. The values index into the + // `mutation_groups` field in the corresponding `BatchWriteRequest`. + repeated int32 indexes = 1; + + // An `OK` status indicates success. Any other status indicates a failure. + google.rpc.Status status = 2; + + // The commit timestamp of the transaction that applied this batch. + // Present if status is OK and the mutation groups were applied, absent + // otherwise. + // + // For mutation groups with conditions, a status=OK and missing + // commit_timestamp means that the mutation groups were not applied due to the + // condition not being satisfied after evaluation. + google.protobuf.Timestamp commit_timestamp = 3; +} diff --git a/owl-bot-staging/v1/protos/google/spanner/v1/transaction.proto b/owl-bot-staging/v1/protos/google/spanner/v1/transaction.proto new file mode 100644 index 000000000..dfdf3b11a --- /dev/null +++ b/owl-bot-staging/v1/protos/google/spanner/v1/transaction.proto @@ -0,0 +1,309 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.spanner.v1; + +import "google/api/field_behavior.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Spanner.V1"; +option go_package = "cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb"; +option java_multiple_files = true; +option java_outer_classname = "TransactionProto"; +option java_package = "com.google.spanner.v1"; +option php_namespace = "Google\\Cloud\\Spanner\\V1"; +option ruby_package = "Google::Cloud::Spanner::V1"; + +// Options to use for transactions. +message TransactionOptions { + // Message type to initiate a read-write transaction. Currently this + // transaction type has no options. + message ReadWrite { + // `ReadLockMode` is used to set the read lock mode for read-write + // transactions. + enum ReadLockMode { + // Default value. + // + // * If isolation level is + // [REPEATABLE_READ][google.spanner.v1.TransactionOptions.IsolationLevel.REPEATABLE_READ], + // then it is an error to specify `read_lock_mode`. Locking semantics + // default to `OPTIMISTIC`. No validation checks are done for reads, + // except to validate that the data that was served at the snapshot time + // is unchanged at commit time in the following cases: + // 1. reads done as part of queries that use `SELECT FOR UPDATE` + // 2. reads done as part of statements with a `LOCK_SCANNED_RANGES` + // hint + // 3. reads done as part of DML statements + // * At all other isolation levels, if `read_lock_mode` is the default + // value, then pessimistic read locks are used. + READ_LOCK_MODE_UNSPECIFIED = 0; + + // Pessimistic lock mode. + // + // Read locks are acquired immediately on read. + // Semantics described only applies to + // [SERIALIZABLE][google.spanner.v1.TransactionOptions.IsolationLevel.SERIALIZABLE] + // isolation. + PESSIMISTIC = 1; + + // Optimistic lock mode. + // + // Locks for reads within the transaction are not acquired on read. + // Instead the locks are acquired on a commit to validate that + // read/queried data has not changed since the transaction started. + // Semantics described only applies to + // [SERIALIZABLE][google.spanner.v1.TransactionOptions.IsolationLevel.SERIALIZABLE] + // isolation. + OPTIMISTIC = 2; + } + + // Read lock mode for the transaction. + ReadLockMode read_lock_mode = 1; + + // Optional. Clients should pass the transaction ID of the previous + // transaction attempt that was aborted if this transaction is being + // executed on a multiplexed session. + bytes multiplexed_session_previous_transaction_id = 2 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Message type to initiate a Partitioned DML transaction. + message PartitionedDml {} + + // Message type to initiate a read-only transaction. + message ReadOnly { + // How to choose the timestamp for the read-only transaction. + oneof timestamp_bound { + // Read at a timestamp where all previously committed transactions + // are visible. + bool strong = 1; + + // Executes all reads at a timestamp >= `min_read_timestamp`. + // + // This is useful for requesting fresher data than some previous + // read, or data that is fresh enough to observe the effects of some + // previously committed transaction whose timestamp is known. + // + // Note that this option can only be used in single-use transactions. + // + // A timestamp in RFC3339 UTC \"Zulu\" format, accurate to nanoseconds. + // Example: `"2014-10-02T15:01:23.045123456Z"`. + google.protobuf.Timestamp min_read_timestamp = 2; + + // Read data at a timestamp >= `NOW - max_staleness` + // seconds. Guarantees that all writes that have committed more + // than the specified number of seconds ago are visible. Because + // Cloud Spanner chooses the exact timestamp, this mode works even if + // the client's local clock is substantially skewed from Cloud Spanner + // commit timestamps. + // + // Useful for reading the freshest data available at a nearby + // replica, while bounding the possible staleness if the local + // replica has fallen behind. + // + // Note that this option can only be used in single-use + // transactions. + google.protobuf.Duration max_staleness = 3; + + // Executes all reads at the given timestamp. Unlike other modes, + // reads at a specific timestamp are repeatable; the same read at + // the same timestamp always returns the same data. If the + // timestamp is in the future, the read is blocked until the + // specified timestamp, modulo the read's deadline. + // + // Useful for large scale consistent reads such as mapreduces, or + // for coordinating many reads against a consistent snapshot of the + // data. + // + // A timestamp in RFC3339 UTC \"Zulu\" format, accurate to nanoseconds. + // Example: `"2014-10-02T15:01:23.045123456Z"`. + google.protobuf.Timestamp read_timestamp = 4; + + // Executes all reads at a timestamp that is `exact_staleness` + // old. The timestamp is chosen soon after the read is started. + // + // Guarantees that all writes that have committed more than the + // specified number of seconds ago are visible. Because Cloud Spanner + // chooses the exact timestamp, this mode works even if the client's + // local clock is substantially skewed from Cloud Spanner commit + // timestamps. + // + // Useful for reading at nearby replicas without the distributed + // timestamp negotiation overhead of `max_staleness`. + google.protobuf.Duration exact_staleness = 5; + } + + // If true, the Cloud Spanner-selected read timestamp is included in + // the [Transaction][google.spanner.v1.Transaction] message that describes + // the transaction. + bool return_read_timestamp = 6; + } + + // `IsolationLevel` is used when setting the [isolation + // level](https://cloud.google.com/spanner/docs/isolation-levels) for a + // transaction. + enum IsolationLevel { + // Default value. + // + // If the value is not specified, the `SERIALIZABLE` isolation level is + // used. + ISOLATION_LEVEL_UNSPECIFIED = 0; + + // All transactions appear as if they executed in a serial order, even if + // some of the reads, writes, and other operations of distinct transactions + // actually occurred in parallel. Spanner assigns commit timestamps that + // reflect the order of committed transactions to implement this property. + // Spanner offers a stronger guarantee than serializability called external + // consistency. For more information, see + // [TrueTime and external + // consistency](https://cloud.google.com/spanner/docs/true-time-external-consistency#serializability). + SERIALIZABLE = 1; + + // All reads performed during the transaction observe a consistent snapshot + // of the database, and the transaction is only successfully committed in + // the absence of conflicts between its updates and any concurrent updates + // that have occurred since that snapshot. Consequently, in contrast to + // `SERIALIZABLE` transactions, only write-write conflicts are detected in + // snapshot transactions. + // + // This isolation level does not support read-only and partitioned DML + // transactions. + // + // When `REPEATABLE_READ` is specified on a read-write transaction, the + // locking semantics default to `OPTIMISTIC`. + REPEATABLE_READ = 2; + } + + // Required. The type of transaction. + oneof mode { + // Transaction may write. + // + // Authorization to begin a read-write transaction requires + // `spanner.databases.beginOrRollbackReadWriteTransaction` permission + // on the `session` resource. + ReadWrite read_write = 1; + + // Partitioned DML transaction. + // + // Authorization to begin a Partitioned DML transaction requires + // `spanner.databases.beginPartitionedDmlTransaction` permission + // on the `session` resource. + PartitionedDml partitioned_dml = 3; + + // Transaction does not write. + // + // Authorization to begin a read-only transaction requires + // `spanner.databases.beginReadOnlyTransaction` permission + // on the `session` resource. + ReadOnly read_only = 2; + } + + // When `exclude_txn_from_change_streams` is set to `true`, it prevents read + // or write transactions from being tracked in change streams. + // + // * If the DDL option `allow_txn_exclusion` is set to `true`, then the + // updates + // made within this transaction aren't recorded in the change stream. + // + // * If you don't set the DDL option `allow_txn_exclusion` or if it's + // set to `false`, then the updates made within this transaction are + // recorded in the change stream. + // + // When `exclude_txn_from_change_streams` is set to `false` or not set, + // modifications from this transaction are recorded in all change streams + // that are tracking columns modified by these transactions. + // + // The `exclude_txn_from_change_streams` option can only be specified + // for read-write or partitioned DML transactions, otherwise the API returns + // an `INVALID_ARGUMENT` error. + bool exclude_txn_from_change_streams = 5; + + // Isolation level for the transaction. + IsolationLevel isolation_level = 6; +} + +// A transaction. +message Transaction { + // `id` may be used to identify the transaction in subsequent + // [Read][google.spanner.v1.Spanner.Read], + // [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql], + // [Commit][google.spanner.v1.Spanner.Commit], or + // [Rollback][google.spanner.v1.Spanner.Rollback] calls. + // + // Single-use read-only transactions do not have IDs, because + // single-use transactions do not support multiple requests. + bytes id = 1; + + // For snapshot read-only transactions, the read timestamp chosen + // for the transaction. Not returned by default: see + // [TransactionOptions.ReadOnly.return_read_timestamp][google.spanner.v1.TransactionOptions.ReadOnly.return_read_timestamp]. + // + // A timestamp in RFC3339 UTC \"Zulu\" format, accurate to nanoseconds. + // Example: `"2014-10-02T15:01:23.045123456Z"`. + google.protobuf.Timestamp read_timestamp = 2; + + // A precommit token is included in the response of a BeginTransaction + // request if the read-write transaction is on a multiplexed session and + // a mutation_key was specified in the + // [BeginTransaction][google.spanner.v1.BeginTransactionRequest]. + // The precommit token with the highest sequence number from this transaction + // attempt should be passed to the [Commit][google.spanner.v1.Spanner.Commit] + // request for this transaction. + MultiplexedSessionPrecommitToken precommit_token = 3; +} + +// This message is used to select the transaction in which a +// [Read][google.spanner.v1.Spanner.Read] or +// [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql] call runs. +// +// See [TransactionOptions][google.spanner.v1.TransactionOptions] for more +// information about transactions. +message TransactionSelector { + // If no fields are set, the default is a single use transaction + // with strong concurrency. + oneof selector { + // Execute the read or SQL query in a temporary transaction. + // This is the most efficient way to execute a transaction that + // consists of a single SQL query. + TransactionOptions single_use = 1; + + // Execute the read or SQL query in a previously-started transaction. + bytes id = 2; + + // Begin a new transaction and execute this read or SQL query in + // it. The transaction ID of the new transaction is returned in + // [ResultSetMetadata.transaction][google.spanner.v1.ResultSetMetadata.transaction], + // which is a [Transaction][google.spanner.v1.Transaction]. + TransactionOptions begin = 3; + } +} + +// When a read-write transaction is executed on a multiplexed session, +// this precommit token is sent back to the client +// as a part of the [Transaction][google.spanner.v1.Transaction] message in the +// [BeginTransaction][google.spanner.v1.BeginTransactionRequest] response and +// also as a part of the [ResultSet][google.spanner.v1.ResultSet] and +// [PartialResultSet][google.spanner.v1.PartialResultSet] responses. +message MultiplexedSessionPrecommitToken { + // Opaque precommit token. + bytes precommit_token = 1; + + // An incrementing seq number is generated on every precommit token + // that is returned. Clients should remember the precommit token with the + // highest sequence number from the current transaction attempt. + int32 seq_num = 2; +} diff --git a/owl-bot-staging/v1/protos/google/spanner/v1/type.proto b/owl-bot-staging/v1/protos/google/spanner/v1/type.proto new file mode 100644 index 000000000..e3e85a770 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/spanner/v1/type.proto @@ -0,0 +1,214 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.spanner.v1; + +import "google/api/field_behavior.proto"; + +option csharp_namespace = "Google.Cloud.Spanner.V1"; +option go_package = "cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb"; +option java_multiple_files = true; +option java_outer_classname = "TypeProto"; +option java_package = "com.google.spanner.v1"; +option php_namespace = "Google\\Cloud\\Spanner\\V1"; +option ruby_package = "Google::Cloud::Spanner::V1"; + +// `Type` indicates the type of a Cloud Spanner value, as might be stored in a +// table cell or returned from an SQL query. +message Type { + // Required. The [TypeCode][google.spanner.v1.TypeCode] for this type. + TypeCode code = 1 [(google.api.field_behavior) = REQUIRED]; + + // If [code][google.spanner.v1.Type.code] == + // [ARRAY][google.spanner.v1.TypeCode.ARRAY], then `array_element_type` is the + // type of the array elements. + Type array_element_type = 2; + + // If [code][google.spanner.v1.Type.code] == + // [STRUCT][google.spanner.v1.TypeCode.STRUCT], then `struct_type` provides + // type information for the struct's fields. + StructType struct_type = 3; + + // The [TypeAnnotationCode][google.spanner.v1.TypeAnnotationCode] that + // disambiguates SQL type that Spanner will use to represent values of this + // type during query processing. This is necessary for some type codes because + // a single [TypeCode][google.spanner.v1.TypeCode] can be mapped to different + // SQL types depending on the SQL dialect. + // [type_annotation][google.spanner.v1.Type.type_annotation] typically is not + // needed to process the content of a value (it doesn't affect serialization) + // and clients can ignore it on the read path. + TypeAnnotationCode type_annotation = 4; + + // If [code][google.spanner.v1.Type.code] == + // [PROTO][google.spanner.v1.TypeCode.PROTO] or + // [code][google.spanner.v1.Type.code] == + // [ENUM][google.spanner.v1.TypeCode.ENUM], then `proto_type_fqn` is the fully + // qualified name of the proto type representing the proto/enum definition. + string proto_type_fqn = 5; +} + +// `StructType` defines the fields of a +// [STRUCT][google.spanner.v1.TypeCode.STRUCT] type. +message StructType { + // Message representing a single field of a struct. + message Field { + // The name of the field. For reads, this is the column name. For + // SQL queries, it is the column alias (e.g., `"Word"` in the + // query `"SELECT 'hello' AS Word"`), or the column name (e.g., + // `"ColName"` in the query `"SELECT ColName FROM Table"`). Some + // columns might have an empty name (e.g., `"SELECT + // UPPER(ColName)"`). Note that a query result can contain + // multiple fields with the same name. + string name = 1; + + // The type of the field. + Type type = 2; + } + + // The list of fields that make up this struct. Order is + // significant, because values of this struct type are represented as + // lists, where the order of field values matches the order of + // fields in the [StructType][google.spanner.v1.StructType]. In turn, the + // order of fields matches the order of columns in a read request, or the + // order of fields in the `SELECT` clause of a query. + repeated Field fields = 1; +} + +// `TypeCode` is used as part of [Type][google.spanner.v1.Type] to +// indicate the type of a Cloud Spanner value. +// +// Each legal value of a type can be encoded to or decoded from a JSON +// value, using the encodings described below. All Cloud Spanner values can +// be `null`, regardless of type; `null`s are always encoded as a JSON +// `null`. +enum TypeCode { + // Not specified. + TYPE_CODE_UNSPECIFIED = 0; + + // Encoded as JSON `true` or `false`. + BOOL = 1; + + // Encoded as `string`, in decimal format. + INT64 = 2; + + // Encoded as `number`, or the strings `"NaN"`, `"Infinity"`, or + // `"-Infinity"`. + FLOAT64 = 3; + + // Encoded as `number`, or the strings `"NaN"`, `"Infinity"`, or + // `"-Infinity"`. + FLOAT32 = 15; + + // Encoded as `string` in RFC 3339 timestamp format. The time zone + // must be present, and must be `"Z"`. + // + // If the schema has the column option + // `allow_commit_timestamp=true`, the placeholder string + // `"spanner.commit_timestamp()"` can be used to instruct the system + // to insert the commit timestamp associated with the transaction + // commit. + TIMESTAMP = 4; + + // Encoded as `string` in RFC 3339 date format. + DATE = 5; + + // Encoded as `string`. + STRING = 6; + + // Encoded as a base64-encoded `string`, as described in RFC 4648, + // section 4. + BYTES = 7; + + // Encoded as `list`, where the list elements are represented + // according to + // [array_element_type][google.spanner.v1.Type.array_element_type]. + ARRAY = 8; + + // Encoded as `list`, where list element `i` is represented according + // to [struct_type.fields[i]][google.spanner.v1.StructType.fields]. + STRUCT = 9; + + // Encoded as `string`, in decimal format or scientific notation format. + // Decimal format: + // `[+-]Digits[.[Digits]]` or + // `[+-][Digits].Digits` + // + // Scientific notation: + // `[+-]Digits[.[Digits]][ExponentIndicator[+-]Digits]` or + // `[+-][Digits].Digits[ExponentIndicator[+-]Digits]` + // (ExponentIndicator is `"e"` or `"E"`) + NUMERIC = 10; + + // Encoded as a JSON-formatted `string` as described in RFC 7159. The + // following rules are applied when parsing JSON input: + // + // - Whitespace characters are not preserved. + // - If a JSON object has duplicate keys, only the first key is preserved. + // - Members of a JSON object are not guaranteed to have their order + // preserved. + // - JSON array elements will have their order preserved. + JSON = 11; + + // Encoded as a base64-encoded `string`, as described in RFC 4648, + // section 4. + PROTO = 13; + + // Encoded as `string`, in decimal format. + ENUM = 14; + + // Encoded as `string`, in `ISO8601` duration format - + // `P[n]Y[n]M[n]DT[n]H[n]M[n[.fraction]]S` + // where `n` is an integer. + // For example, `P1Y2M3DT4H5M6.5S` represents time duration of 1 year, 2 + // months, 3 days, 4 hours, 5 minutes, and 6.5 seconds. + INTERVAL = 16; + + // Encoded as `string`, in lower-case hexa-decimal format, as described + // in RFC 9562, section 4. + UUID = 17; +} + +// `TypeAnnotationCode` is used as a part of [Type][google.spanner.v1.Type] to +// disambiguate SQL types that should be used for a given Cloud Spanner value. +// Disambiguation is needed because the same Cloud Spanner type can be mapped to +// different SQL types depending on SQL dialect. TypeAnnotationCode doesn't +// affect the way value is serialized. +enum TypeAnnotationCode { + // Not specified. + TYPE_ANNOTATION_CODE_UNSPECIFIED = 0; + + // PostgreSQL compatible NUMERIC type. This annotation needs to be applied to + // [Type][google.spanner.v1.Type] instances having + // [NUMERIC][google.spanner.v1.TypeCode.NUMERIC] type code to specify that + // values of this type should be treated as PostgreSQL NUMERIC values. + // Currently this annotation is always needed for + // [NUMERIC][google.spanner.v1.TypeCode.NUMERIC] when a client interacts with + // PostgreSQL-enabled Spanner databases. + PG_NUMERIC = 2; + + // PostgreSQL compatible JSONB type. This annotation needs to be applied to + // [Type][google.spanner.v1.Type] instances having + // [JSON][google.spanner.v1.TypeCode.JSON] type code to specify that values of + // this type should be treated as PostgreSQL JSONB values. Currently this + // annotation is always needed for [JSON][google.spanner.v1.TypeCode.JSON] + // when a client interacts with PostgreSQL-enabled Spanner databases. + PG_JSONB = 3; + + // PostgreSQL compatible OID type. This annotation can be used by a client + // interacting with PostgreSQL-enabled Spanner database to specify that a + // value should be treated using the semantics of the OID type. + PG_OID = 4; +} diff --git a/owl-bot-staging/v1/protos/protos.d.ts b/owl-bot-staging/v1/protos/protos.d.ts new file mode 100644 index 000000000..fa190f40c --- /dev/null +++ b/owl-bot-staging/v1/protos/protos.d.ts @@ -0,0 +1,16769 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import type {protobuf as $protobuf} from "google-gax"; +import Long = require("long"); +/** Namespace google. */ +export namespace google { + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a Struct. */ + interface IStruct { + + /** Struct fields */ + fields?: ({ [k: string]: google.protobuf.IValue }|null); + } + + /** Represents a Struct. */ + class Struct implements IStruct { + + /** + * Constructs a new Struct. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IStruct); + + /** Struct fields. */ + public fields: { [k: string]: google.protobuf.IValue }; + + /** + * Creates a new Struct instance using the specified properties. + * @param [properties] Properties to set + * @returns Struct instance + */ + public static create(properties?: google.protobuf.IStruct): google.protobuf.Struct; + + /** + * Encodes the specified Struct message. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @param message Struct message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IStruct, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Struct message, length delimited. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @param message Struct message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IStruct, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Struct message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Struct; + + /** + * Decodes a Struct message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Struct; + + /** + * Verifies a Struct message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Struct message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Struct + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Struct; + + /** + * Creates a plain object from a Struct message. Also converts values to other types if specified. + * @param message Struct + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Struct, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Struct to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Struct + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Value. */ + interface IValue { + + /** Value nullValue */ + nullValue?: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue|null); + + /** Value numberValue */ + numberValue?: (number|null); + + /** Value stringValue */ + stringValue?: (string|null); + + /** Value boolValue */ + boolValue?: (boolean|null); + + /** Value structValue */ + structValue?: (google.protobuf.IStruct|null); + + /** Value listValue */ + listValue?: (google.protobuf.IListValue|null); + } + + /** Represents a Value. */ + class Value implements IValue { + + /** + * Constructs a new Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IValue); + + /** Value nullValue. */ + public nullValue?: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue|null); + + /** Value numberValue. */ + public numberValue?: (number|null); + + /** Value stringValue. */ + public stringValue?: (string|null); + + /** Value boolValue. */ + public boolValue?: (boolean|null); + + /** Value structValue. */ + public structValue?: (google.protobuf.IStruct|null); + + /** Value listValue. */ + public listValue?: (google.protobuf.IListValue|null); + + /** Value kind. */ + public kind?: ("nullValue"|"numberValue"|"stringValue"|"boolValue"|"structValue"|"listValue"); + + /** + * Creates a new Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Value instance + */ + public static create(properties?: google.protobuf.IValue): google.protobuf.Value; + + /** + * Encodes the specified Value message. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @param message Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Value message, length delimited. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @param message Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Value; + + /** + * Decodes a Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Value; + + /** + * Verifies a Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Value; + + /** + * Creates a plain object from a Value message. Also converts values to other types if specified. + * @param message Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** NullValue enum. */ + enum NullValue { + NULL_VALUE = 0 + } + + /** Properties of a ListValue. */ + interface IListValue { + + /** ListValue values */ + values?: (google.protobuf.IValue[]|null); + } + + /** Represents a ListValue. */ + class ListValue implements IListValue { + + /** + * Constructs a new ListValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IListValue); + + /** ListValue values. */ + public values: google.protobuf.IValue[]; + + /** + * Creates a new ListValue instance using the specified properties. + * @param [properties] Properties to set + * @returns ListValue instance + */ + public static create(properties?: google.protobuf.IListValue): google.protobuf.ListValue; + + /** + * Encodes the specified ListValue message. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @param message ListValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IListValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListValue message, length delimited. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @param message ListValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IListValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListValue + * @throws {Error} If the payload is not 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.ListValue; + + /** + * Decodes a ListValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListValue + * @throws {Error} If the payload 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.ListValue; + + /** + * Verifies a ListValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ListValue; + + /** + * Creates a plain object from a ListValue message. Also converts values to other types if specified. + * @param message ListValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ListValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** Timestamp seconds */ + seconds?: (number|Long|string|null); + + /** Timestamp nanos */ + nanos?: (number|null); + } + + /** Represents a Timestamp. */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ITimestamp); + + /** Timestamp seconds. */ + public seconds: (number|Long|string); + + /** Timestamp nanos. */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Timestamp; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Timestamp; + + /** + * Verifies a Timestamp message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Timestamp + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @param message Timestamp + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Timestamp to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileDescriptorSet. */ + interface IFileDescriptorSet { + + /** FileDescriptorSet file */ + file?: (google.protobuf.IFileDescriptorProto[]|null); + } + + /** Represents a FileDescriptorSet. */ + class FileDescriptorSet implements IFileDescriptorSet { + + /** + * Constructs a new FileDescriptorSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorSet); + + /** FileDescriptorSet file. */ + public file: google.protobuf.IFileDescriptorProto[]; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorSet instance + */ + public static create(properties?: google.protobuf.IFileDescriptorSet): google.protobuf.FileDescriptorSet; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorSet; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorSet; + + /** + * Verifies a FileDescriptorSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorSet + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorSet; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @param message FileDescriptorSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileDescriptorSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Edition enum. */ + enum Edition { + EDITION_UNKNOWN = 0, + EDITION_PROTO2 = 998, + EDITION_PROTO3 = 999, + EDITION_2023 = 1000, + EDITION_2024 = 1001, + EDITION_1_TEST_ONLY = 1, + EDITION_2_TEST_ONLY = 2, + EDITION_99997_TEST_ONLY = 99997, + EDITION_99998_TEST_ONLY = 99998, + EDITION_99999_TEST_ONLY = 99999, + EDITION_MAX = 2147483647 + } + + /** Properties of a FileDescriptorProto. */ + interface IFileDescriptorProto { + + /** FileDescriptorProto name */ + name?: (string|null); + + /** FileDescriptorProto package */ + "package"?: (string|null); + + /** FileDescriptorProto dependency */ + dependency?: (string[]|null); + + /** FileDescriptorProto publicDependency */ + publicDependency?: (number[]|null); + + /** FileDescriptorProto weakDependency */ + weakDependency?: (number[]|null); + + /** FileDescriptorProto messageType */ + messageType?: (google.protobuf.IDescriptorProto[]|null); + + /** FileDescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** FileDescriptorProto service */ + service?: (google.protobuf.IServiceDescriptorProto[]|null); + + /** FileDescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** FileDescriptorProto options */ + options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo */ + sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax */ + syntax?: (string|null); + + /** FileDescriptorProto edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + } + + /** Represents a FileDescriptorProto. */ + class FileDescriptorProto implements IFileDescriptorProto { + + /** + * Constructs a new FileDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorProto); + + /** FileDescriptorProto name. */ + public name: string; + + /** FileDescriptorProto package. */ + public package: string; + + /** FileDescriptorProto dependency. */ + public dependency: string[]; + + /** FileDescriptorProto publicDependency. */ + public publicDependency: number[]; + + /** FileDescriptorProto weakDependency. */ + public weakDependency: number[]; + + /** FileDescriptorProto messageType. */ + public messageType: google.protobuf.IDescriptorProto[]; + + /** FileDescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** FileDescriptorProto service. */ + public service: google.protobuf.IServiceDescriptorProto[]; + + /** FileDescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** FileDescriptorProto options. */ + public options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo. */ + public sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax. */ + public syntax: string; + + /** FileDescriptorProto edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFileDescriptorProto): google.protobuf.FileDescriptorProto; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorProto; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorProto; + + /** + * Verifies a FileDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorProto; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @param message FileDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DescriptorProto. */ + interface IDescriptorProto { + + /** DescriptorProto name */ + name?: (string|null); + + /** DescriptorProto field */ + field?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto nestedType */ + nestedType?: (google.protobuf.IDescriptorProto[]|null); + + /** DescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** DescriptorProto extensionRange */ + extensionRange?: (google.protobuf.DescriptorProto.IExtensionRange[]|null); + + /** DescriptorProto oneofDecl */ + oneofDecl?: (google.protobuf.IOneofDescriptorProto[]|null); + + /** DescriptorProto options */ + options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange */ + reservedRange?: (google.protobuf.DescriptorProto.IReservedRange[]|null); + + /** DescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents a DescriptorProto. */ + class DescriptorProto implements IDescriptorProto { + + /** + * Constructs a new DescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDescriptorProto); + + /** DescriptorProto name. */ + public name: string; + + /** DescriptorProto field. */ + public field: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto nestedType. */ + public nestedType: google.protobuf.IDescriptorProto[]; + + /** DescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** DescriptorProto extensionRange. */ + public extensionRange: google.protobuf.DescriptorProto.IExtensionRange[]; + + /** DescriptorProto oneofDecl. */ + public oneofDecl: google.protobuf.IOneofDescriptorProto[]; + + /** DescriptorProto options. */ + public options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange. */ + public reservedRange: google.protobuf.DescriptorProto.IReservedRange[]; + + /** DescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns DescriptorProto instance + */ + public static create(properties?: google.protobuf.IDescriptorProto): google.protobuf.DescriptorProto; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto; + + /** + * Verifies a DescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @param message DescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DescriptorProto { + + /** Properties of an ExtensionRange. */ + interface IExtensionRange { + + /** ExtensionRange start */ + start?: (number|null); + + /** ExtensionRange end */ + end?: (number|null); + + /** ExtensionRange options */ + options?: (google.protobuf.IExtensionRangeOptions|null); + } + + /** Represents an ExtensionRange. */ + class ExtensionRange implements IExtensionRange { + + /** + * Constructs a new ExtensionRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange); + + /** ExtensionRange start. */ + public start: number; + + /** ExtensionRange end. */ + public end: number; + + /** ExtensionRange options. */ + public options?: (google.protobuf.IExtensionRangeOptions|null); + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IExtensionRange): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Verifies an ExtensionRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @param message ExtensionRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ExtensionRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtensionRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReservedRange. */ + interface IReservedRange { + + /** ReservedRange start */ + start?: (number|null); + + /** ReservedRange end */ + end?: (number|null); + } + + /** Represents a ReservedRange. */ + class ReservedRange implements IReservedRange { + + /** + * Constructs a new ReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IReservedRange); + + /** ReservedRange start. */ + public start: number; + + /** ReservedRange end. */ + public end: number; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ReservedRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IReservedRange): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Verifies a ReservedRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @param message ReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ExtensionRangeOptions. */ + interface IExtensionRangeOptions { + + /** ExtensionRangeOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** ExtensionRangeOptions declaration */ + declaration?: (google.protobuf.ExtensionRangeOptions.IDeclaration[]|null); + + /** ExtensionRangeOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** ExtensionRangeOptions verification */ + verification?: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState|null); + } + + /** Represents an ExtensionRangeOptions. */ + class ExtensionRangeOptions implements IExtensionRangeOptions { + + /** + * Constructs a new ExtensionRangeOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IExtensionRangeOptions); + + /** ExtensionRangeOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** ExtensionRangeOptions declaration. */ + public declaration: google.protobuf.ExtensionRangeOptions.IDeclaration[]; + + /** ExtensionRangeOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** ExtensionRangeOptions verification. */ + public verification: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState); + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRangeOptions instance + */ + public static create(properties?: google.protobuf.IExtensionRangeOptions): google.protobuf.ExtensionRangeOptions; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions; + + /** + * Verifies an ExtensionRangeOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRangeOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @param message ExtensionRangeOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ExtensionRangeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ExtensionRangeOptions { + + /** Properties of a Declaration. */ + interface IDeclaration { + + /** Declaration number */ + number?: (number|null); + + /** Declaration fullName */ + fullName?: (string|null); + + /** Declaration type */ + type?: (string|null); + + /** Declaration reserved */ + reserved?: (boolean|null); + + /** Declaration repeated */ + repeated?: (boolean|null); + } + + /** Represents a Declaration. */ + class Declaration implements IDeclaration { + + /** + * Constructs a new Declaration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration); + + /** Declaration number. */ + public number: number; + + /** Declaration fullName. */ + public fullName: string; + + /** Declaration type. */ + public type: string; + + /** Declaration reserved. */ + public reserved: boolean; + + /** Declaration repeated. */ + public repeated: boolean; + + /** + * Creates a new Declaration instance using the specified properties. + * @param [properties] Properties to set + * @returns Declaration instance + */ + public static create(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @param message Declaration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @param message Declaration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Declaration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Decodes a Declaration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Verifies a Declaration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Declaration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Declaration + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Creates a plain object from a Declaration message. Also converts values to other types if specified. + * @param message Declaration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ExtensionRangeOptions.Declaration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Declaration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Declaration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** VerificationState enum. */ + enum VerificationState { + DECLARATION = 0, + UNVERIFIED = 1 + } + } + + /** Properties of a FieldDescriptorProto. */ + interface IFieldDescriptorProto { + + /** FieldDescriptorProto name */ + name?: (string|null); + + /** FieldDescriptorProto number */ + number?: (number|null); + + /** FieldDescriptorProto label */ + label?: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label|null); + + /** FieldDescriptorProto type */ + type?: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type|null); + + /** FieldDescriptorProto typeName */ + typeName?: (string|null); + + /** FieldDescriptorProto extendee */ + extendee?: (string|null); + + /** FieldDescriptorProto defaultValue */ + defaultValue?: (string|null); + + /** FieldDescriptorProto oneofIndex */ + oneofIndex?: (number|null); + + /** FieldDescriptorProto jsonName */ + jsonName?: (string|null); + + /** FieldDescriptorProto options */ + options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional */ + proto3Optional?: (boolean|null); + } + + /** Represents a FieldDescriptorProto. */ + class FieldDescriptorProto implements IFieldDescriptorProto { + + /** + * Constructs a new FieldDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldDescriptorProto); + + /** FieldDescriptorProto name. */ + public name: string; + + /** FieldDescriptorProto number. */ + public number: number; + + /** FieldDescriptorProto label. */ + public label: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label); + + /** FieldDescriptorProto type. */ + public type: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type); + + /** FieldDescriptorProto typeName. */ + public typeName: string; + + /** FieldDescriptorProto extendee. */ + public extendee: string; + + /** FieldDescriptorProto defaultValue. */ + public defaultValue: string; + + /** FieldDescriptorProto oneofIndex. */ + public oneofIndex: number; + + /** FieldDescriptorProto jsonName. */ + public jsonName: string; + + /** FieldDescriptorProto options. */ + public options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional. */ + public proto3Optional: boolean; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFieldDescriptorProto): google.protobuf.FieldDescriptorProto; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldDescriptorProto; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldDescriptorProto; + + /** + * Verifies a FieldDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @param message FieldDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldDescriptorProto { + + /** Type enum. */ + enum Type { + TYPE_DOUBLE = 1, + TYPE_FLOAT = 2, + TYPE_INT64 = 3, + TYPE_UINT64 = 4, + TYPE_INT32 = 5, + TYPE_FIXED64 = 6, + TYPE_FIXED32 = 7, + TYPE_BOOL = 8, + TYPE_STRING = 9, + TYPE_GROUP = 10, + TYPE_MESSAGE = 11, + TYPE_BYTES = 12, + TYPE_UINT32 = 13, + TYPE_ENUM = 14, + TYPE_SFIXED32 = 15, + TYPE_SFIXED64 = 16, + TYPE_SINT32 = 17, + TYPE_SINT64 = 18 + } + + /** Label enum. */ + enum Label { + LABEL_OPTIONAL = 1, + LABEL_REPEATED = 3, + LABEL_REQUIRED = 2 + } + } + + /** Properties of an OneofDescriptorProto. */ + interface IOneofDescriptorProto { + + /** OneofDescriptorProto name */ + name?: (string|null); + + /** OneofDescriptorProto options */ + options?: (google.protobuf.IOneofOptions|null); + } + + /** Represents an OneofDescriptorProto. */ + class OneofDescriptorProto implements IOneofDescriptorProto { + + /** + * Constructs a new OneofDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofDescriptorProto); + + /** OneofDescriptorProto name. */ + public name: string; + + /** OneofDescriptorProto options. */ + public options?: (google.protobuf.IOneofOptions|null); + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofDescriptorProto instance + */ + public static create(properties?: google.protobuf.IOneofDescriptorProto): google.protobuf.OneofDescriptorProto; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofDescriptorProto; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofDescriptorProto; + + /** + * Verifies an OneofDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofDescriptorProto; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @param message OneofDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneofDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumDescriptorProto. */ + interface IEnumDescriptorProto { + + /** EnumDescriptorProto name */ + name?: (string|null); + + /** EnumDescriptorProto value */ + value?: (google.protobuf.IEnumValueDescriptorProto[]|null); + + /** EnumDescriptorProto options */ + options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange */ + reservedRange?: (google.protobuf.EnumDescriptorProto.IEnumReservedRange[]|null); + + /** EnumDescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents an EnumDescriptorProto. */ + class EnumDescriptorProto implements IEnumDescriptorProto { + + /** + * Constructs a new EnumDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumDescriptorProto); + + /** EnumDescriptorProto name. */ + public name: string; + + /** EnumDescriptorProto value. */ + public value: google.protobuf.IEnumValueDescriptorProto[]; + + /** EnumDescriptorProto options. */ + public options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange. */ + public reservedRange: google.protobuf.EnumDescriptorProto.IEnumReservedRange[]; + + /** EnumDescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumDescriptorProto): google.protobuf.EnumDescriptorProto; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto; + + /** + * Verifies an EnumDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @param message EnumDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EnumDescriptorProto { + + /** Properties of an EnumReservedRange. */ + interface IEnumReservedRange { + + /** EnumReservedRange start */ + start?: (number|null); + + /** EnumReservedRange end */ + end?: (number|null); + } + + /** Represents an EnumReservedRange. */ + class EnumReservedRange implements IEnumReservedRange { + + /** + * Constructs a new EnumReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange); + + /** EnumReservedRange start. */ + public start: number; + + /** EnumReservedRange end. */ + public end: number; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumReservedRange instance + */ + public static create(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Verifies an EnumReservedRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @param message EnumReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto.EnumReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an EnumValueDescriptorProto. */ + interface IEnumValueDescriptorProto { + + /** EnumValueDescriptorProto name */ + name?: (string|null); + + /** EnumValueDescriptorProto number */ + number?: (number|null); + + /** EnumValueDescriptorProto options */ + options?: (google.protobuf.IEnumValueOptions|null); + } + + /** Represents an EnumValueDescriptorProto. */ + class EnumValueDescriptorProto implements IEnumValueDescriptorProto { + + /** + * Constructs a new EnumValueDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueDescriptorProto); + + /** EnumValueDescriptorProto name. */ + public name: string; + + /** EnumValueDescriptorProto number. */ + public number: number; + + /** EnumValueDescriptorProto options. */ + public options?: (google.protobuf.IEnumValueOptions|null); + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumValueDescriptorProto): google.protobuf.EnumValueDescriptorProto; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueDescriptorProto; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueDescriptorProto; + + /** + * Verifies an EnumValueDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueDescriptorProto; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @param message EnumValueDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceDescriptorProto. */ + interface IServiceDescriptorProto { + + /** ServiceDescriptorProto name */ + name?: (string|null); + + /** ServiceDescriptorProto method */ + method?: (google.protobuf.IMethodDescriptorProto[]|null); + + /** ServiceDescriptorProto options */ + options?: (google.protobuf.IServiceOptions|null); + } + + /** Represents a ServiceDescriptorProto. */ + class ServiceDescriptorProto implements IServiceDescriptorProto { + + /** + * Constructs a new ServiceDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceDescriptorProto); + + /** ServiceDescriptorProto name. */ + public name: string; + + /** ServiceDescriptorProto method. */ + public method: google.protobuf.IMethodDescriptorProto[]; + + /** ServiceDescriptorProto options. */ + public options?: (google.protobuf.IServiceOptions|null); + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceDescriptorProto instance + */ + public static create(properties?: google.protobuf.IServiceDescriptorProto): google.protobuf.ServiceDescriptorProto; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceDescriptorProto; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceDescriptorProto; + + /** + * Verifies a ServiceDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceDescriptorProto; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @param message ServiceDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodDescriptorProto. */ + interface IMethodDescriptorProto { + + /** MethodDescriptorProto name */ + name?: (string|null); + + /** MethodDescriptorProto inputType */ + inputType?: (string|null); + + /** MethodDescriptorProto outputType */ + outputType?: (string|null); + + /** MethodDescriptorProto options */ + options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming */ + clientStreaming?: (boolean|null); + + /** MethodDescriptorProto serverStreaming */ + serverStreaming?: (boolean|null); + } + + /** Represents a MethodDescriptorProto. */ + class MethodDescriptorProto implements IMethodDescriptorProto { + + /** + * Constructs a new MethodDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodDescriptorProto); + + /** MethodDescriptorProto name. */ + public name: string; + + /** MethodDescriptorProto inputType. */ + public inputType: string; + + /** MethodDescriptorProto outputType. */ + public outputType: string; + + /** MethodDescriptorProto options. */ + public options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming. */ + public clientStreaming: boolean; + + /** MethodDescriptorProto serverStreaming. */ + public serverStreaming: boolean; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodDescriptorProto instance + */ + public static create(properties?: google.protobuf.IMethodDescriptorProto): google.protobuf.MethodDescriptorProto; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodDescriptorProto; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodDescriptorProto; + + /** + * Verifies a MethodDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodDescriptorProto; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @param message MethodDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileOptions. */ + interface IFileOptions { + + /** FileOptions javaPackage */ + javaPackage?: (string|null); + + /** FileOptions javaOuterClassname */ + javaOuterClassname?: (string|null); + + /** FileOptions javaMultipleFiles */ + javaMultipleFiles?: (boolean|null); + + /** FileOptions javaGenerateEqualsAndHash */ + javaGenerateEqualsAndHash?: (boolean|null); + + /** FileOptions javaStringCheckUtf8 */ + javaStringCheckUtf8?: (boolean|null); + + /** FileOptions optimizeFor */ + optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode|null); + + /** FileOptions goPackage */ + goPackage?: (string|null); + + /** FileOptions ccGenericServices */ + ccGenericServices?: (boolean|null); + + /** FileOptions javaGenericServices */ + javaGenericServices?: (boolean|null); + + /** FileOptions pyGenericServices */ + pyGenericServices?: (boolean|null); + + /** FileOptions deprecated */ + deprecated?: (boolean|null); + + /** FileOptions ccEnableArenas */ + ccEnableArenas?: (boolean|null); + + /** FileOptions objcClassPrefix */ + objcClassPrefix?: (string|null); + + /** FileOptions csharpNamespace */ + csharpNamespace?: (string|null); + + /** FileOptions swiftPrefix */ + swiftPrefix?: (string|null); + + /** FileOptions phpClassPrefix */ + phpClassPrefix?: (string|null); + + /** FileOptions phpNamespace */ + phpNamespace?: (string|null); + + /** FileOptions phpMetadataNamespace */ + phpMetadataNamespace?: (string|null); + + /** FileOptions rubyPackage */ + rubyPackage?: (string|null); + + /** FileOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** FileOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FileOptions .google.api.resourceDefinition */ + ".google.api.resourceDefinition"?: (google.api.IResourceDescriptor[]|null); + } + + /** Represents a FileOptions. */ + class FileOptions implements IFileOptions { + + /** + * Constructs a new FileOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileOptions); + + /** FileOptions javaPackage. */ + public javaPackage: string; + + /** FileOptions javaOuterClassname. */ + public javaOuterClassname: string; + + /** FileOptions javaMultipleFiles. */ + public javaMultipleFiles: boolean; + + /** FileOptions javaGenerateEqualsAndHash. */ + public javaGenerateEqualsAndHash: boolean; + + /** FileOptions javaStringCheckUtf8. */ + public javaStringCheckUtf8: boolean; + + /** FileOptions optimizeFor. */ + public optimizeFor: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode); + + /** FileOptions goPackage. */ + public goPackage: string; + + /** FileOptions ccGenericServices. */ + public ccGenericServices: boolean; + + /** FileOptions javaGenericServices. */ + public javaGenericServices: boolean; + + /** FileOptions pyGenericServices. */ + public pyGenericServices: boolean; + + /** FileOptions deprecated. */ + public deprecated: boolean; + + /** FileOptions ccEnableArenas. */ + public ccEnableArenas: boolean; + + /** FileOptions objcClassPrefix. */ + public objcClassPrefix: string; + + /** FileOptions csharpNamespace. */ + public csharpNamespace: string; + + /** FileOptions swiftPrefix. */ + public swiftPrefix: string; + + /** FileOptions phpClassPrefix. */ + public phpClassPrefix: string; + + /** FileOptions phpNamespace. */ + public phpNamespace: string; + + /** FileOptions phpMetadataNamespace. */ + public phpMetadataNamespace: string; + + /** FileOptions rubyPackage. */ + public rubyPackage: string; + + /** FileOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** FileOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FileOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FileOptions instance + */ + public static create(properties?: google.protobuf.IFileOptions): google.protobuf.FileOptions; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileOptions; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileOptions; + + /** + * Verifies a FileOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileOptions; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @param message FileOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FileOptions { + + /** OptimizeMode enum. */ + enum OptimizeMode { + SPEED = 1, + CODE_SIZE = 2, + LITE_RUNTIME = 3 + } + } + + /** Properties of a MessageOptions. */ + interface IMessageOptions { + + /** MessageOptions messageSetWireFormat */ + messageSetWireFormat?: (boolean|null); + + /** MessageOptions noStandardDescriptorAccessor */ + noStandardDescriptorAccessor?: (boolean|null); + + /** MessageOptions deprecated */ + deprecated?: (boolean|null); + + /** MessageOptions mapEntry */ + mapEntry?: (boolean|null); + + /** MessageOptions deprecatedLegacyJsonFieldConflicts */ + deprecatedLegacyJsonFieldConflicts?: (boolean|null); + + /** MessageOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** MessageOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MessageOptions .google.api.resource */ + ".google.api.resource"?: (google.api.IResourceDescriptor|null); + } + + /** Represents a MessageOptions. */ + class MessageOptions implements IMessageOptions { + + /** + * Constructs a new MessageOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMessageOptions); + + /** MessageOptions messageSetWireFormat. */ + public messageSetWireFormat: boolean; + + /** MessageOptions noStandardDescriptorAccessor. */ + public noStandardDescriptorAccessor: boolean; + + /** MessageOptions deprecated. */ + public deprecated: boolean; + + /** MessageOptions mapEntry. */ + public mapEntry: boolean; + + /** MessageOptions deprecatedLegacyJsonFieldConflicts. */ + public deprecatedLegacyJsonFieldConflicts: boolean; + + /** MessageOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** MessageOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MessageOptions instance + */ + public static create(properties?: google.protobuf.IMessageOptions): google.protobuf.MessageOptions; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MessageOptions; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MessageOptions; + + /** + * Verifies a MessageOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MessageOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MessageOptions; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @param message MessageOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MessageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MessageOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MessageOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldOptions. */ + interface IFieldOptions { + + /** FieldOptions ctype */ + ctype?: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType|null); + + /** FieldOptions packed */ + packed?: (boolean|null); + + /** FieldOptions jstype */ + jstype?: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType|null); + + /** FieldOptions lazy */ + lazy?: (boolean|null); + + /** FieldOptions unverifiedLazy */ + unverifiedLazy?: (boolean|null); + + /** FieldOptions deprecated */ + deprecated?: (boolean|null); + + /** FieldOptions weak */ + weak?: (boolean|null); + + /** FieldOptions debugRedact */ + debugRedact?: (boolean|null); + + /** FieldOptions retention */ + retention?: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention|null); + + /** FieldOptions targets */ + targets?: (google.protobuf.FieldOptions.OptionTargetType[]|null); + + /** FieldOptions editionDefaults */ + editionDefaults?: (google.protobuf.FieldOptions.IEditionDefault[]|null); + + /** FieldOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** FieldOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FieldOptions .google.api.fieldBehavior */ + ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); + + /** FieldOptions .google.api.resourceReference */ + ".google.api.resourceReference"?: (google.api.IResourceReference|null); + } + + /** Represents a FieldOptions. */ + class FieldOptions implements IFieldOptions { + + /** + * Constructs a new FieldOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldOptions); + + /** FieldOptions ctype. */ + public ctype: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType); + + /** FieldOptions packed. */ + public packed: boolean; + + /** FieldOptions jstype. */ + public jstype: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType); + + /** FieldOptions lazy. */ + public lazy: boolean; + + /** FieldOptions unverifiedLazy. */ + public unverifiedLazy: boolean; + + /** FieldOptions deprecated. */ + public deprecated: boolean; + + /** FieldOptions weak. */ + public weak: boolean; + + /** FieldOptions debugRedact. */ + public debugRedact: boolean; + + /** FieldOptions retention. */ + public retention: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention); + + /** FieldOptions targets. */ + public targets: google.protobuf.FieldOptions.OptionTargetType[]; + + /** FieldOptions editionDefaults. */ + public editionDefaults: google.protobuf.FieldOptions.IEditionDefault[]; + + /** FieldOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** FieldOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldOptions instance + */ + public static create(properties?: google.protobuf.IFieldOptions): google.protobuf.FieldOptions; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions; + + /** + * Verifies a FieldOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @param message FieldOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldOptions { + + /** CType enum. */ + enum CType { + STRING = 0, + CORD = 1, + STRING_PIECE = 2 + } + + /** JSType enum. */ + enum JSType { + JS_NORMAL = 0, + JS_STRING = 1, + JS_NUMBER = 2 + } + + /** OptionRetention enum. */ + enum OptionRetention { + RETENTION_UNKNOWN = 0, + RETENTION_RUNTIME = 1, + RETENTION_SOURCE = 2 + } + + /** OptionTargetType enum. */ + enum OptionTargetType { + TARGET_TYPE_UNKNOWN = 0, + TARGET_TYPE_FILE = 1, + TARGET_TYPE_EXTENSION_RANGE = 2, + TARGET_TYPE_MESSAGE = 3, + TARGET_TYPE_FIELD = 4, + TARGET_TYPE_ONEOF = 5, + TARGET_TYPE_ENUM = 6, + TARGET_TYPE_ENUM_ENTRY = 7, + TARGET_TYPE_SERVICE = 8, + TARGET_TYPE_METHOD = 9 + } + + /** Properties of an EditionDefault. */ + interface IEditionDefault { + + /** EditionDefault edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** EditionDefault value */ + value?: (string|null); + } + + /** Represents an EditionDefault. */ + class EditionDefault implements IEditionDefault { + + /** + * Constructs a new EditionDefault. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FieldOptions.IEditionDefault); + + /** EditionDefault edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** EditionDefault value. */ + public value: string; + + /** + * Creates a new EditionDefault instance using the specified properties. + * @param [properties] Properties to set + * @returns EditionDefault instance + */ + public static create(properties?: google.protobuf.FieldOptions.IEditionDefault): google.protobuf.FieldOptions.EditionDefault; + + /** + * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @param message EditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @param message EditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EditionDefault message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions.EditionDefault; + + /** + * Decodes an EditionDefault message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions.EditionDefault; + + /** + * Verifies an EditionDefault message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EditionDefault + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions.EditionDefault; + + /** + * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. + * @param message EditionDefault + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions.EditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EditionDefault to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EditionDefault + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an OneofOptions. */ + interface IOneofOptions { + + /** OneofOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** OneofOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an OneofOptions. */ + class OneofOptions implements IOneofOptions { + + /** + * Constructs a new OneofOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofOptions); + + /** OneofOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** OneofOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofOptions instance + */ + public static create(properties?: google.protobuf.IOneofOptions): google.protobuf.OneofOptions; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofOptions; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofOptions; + + /** + * Verifies an OneofOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofOptions; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @param message OneofOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneofOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumOptions. */ + interface IEnumOptions { + + /** EnumOptions allowAlias */ + allowAlias?: (boolean|null); + + /** EnumOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumOptions deprecatedLegacyJsonFieldConflicts */ + deprecatedLegacyJsonFieldConflicts?: (boolean|null); + + /** EnumOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** EnumOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumOptions. */ + class EnumOptions implements IEnumOptions { + + /** + * Constructs a new EnumOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumOptions); + + /** EnumOptions allowAlias. */ + public allowAlias: boolean; + + /** EnumOptions deprecated. */ + public deprecated: boolean; + + /** EnumOptions deprecatedLegacyJsonFieldConflicts. */ + public deprecatedLegacyJsonFieldConflicts: boolean; + + /** EnumOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** EnumOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumOptions instance + */ + public static create(properties?: google.protobuf.IEnumOptions): google.protobuf.EnumOptions; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumOptions; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumOptions; + + /** + * Verifies an EnumOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumOptions; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @param message EnumOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumValueOptions. */ + interface IEnumValueOptions { + + /** EnumValueOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumValueOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** EnumValueOptions debugRedact */ + debugRedact?: (boolean|null); + + /** EnumValueOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumValueOptions. */ + class EnumValueOptions implements IEnumValueOptions { + + /** + * Constructs a new EnumValueOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueOptions); + + /** EnumValueOptions deprecated. */ + public deprecated: boolean; + + /** EnumValueOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** EnumValueOptions debugRedact. */ + public debugRedact: boolean; + + /** EnumValueOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueOptions instance + */ + public static create(properties?: google.protobuf.IEnumValueOptions): google.protobuf.EnumValueOptions; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueOptions; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueOptions; + + /** + * Verifies an EnumValueOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueOptions; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @param message EnumValueOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceOptions. */ + interface IServiceOptions { + + /** ServiceOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** ServiceOptions deprecated */ + deprecated?: (boolean|null); + + /** ServiceOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** ServiceOptions .google.api.defaultHost */ + ".google.api.defaultHost"?: (string|null); + + /** ServiceOptions .google.api.oauthScopes */ + ".google.api.oauthScopes"?: (string|null); + + /** ServiceOptions .google.api.apiVersion */ + ".google.api.apiVersion"?: (string|null); + } + + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { + + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceOptions); + + /** ServiceOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** ServiceOptions deprecated. */ + public deprecated: boolean; + + /** ServiceOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceOptions instance + */ + public static create(properties?: google.protobuf.IServiceOptions): google.protobuf.ServiceOptions; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceOptions; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceOptions; + + /** + * Verifies a ServiceOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @param message ServiceOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodOptions. */ + interface IMethodOptions { + + /** MethodOptions deprecated */ + deprecated?: (boolean|null); + + /** MethodOptions idempotencyLevel */ + idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); + + /** MethodOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** MethodOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MethodOptions .google.api.http */ + ".google.api.http"?: (google.api.IHttpRule|null); + + /** MethodOptions .google.api.methodSignature */ + ".google.api.methodSignature"?: (string[]|null); + } + + /** Represents a MethodOptions. */ + class MethodOptions implements IMethodOptions { + + /** + * Constructs a new MethodOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodOptions); + + /** MethodOptions deprecated. */ + public deprecated: boolean; + + /** MethodOptions idempotencyLevel. */ + public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); + + /** MethodOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** MethodOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodOptions instance + */ + public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodOptions; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodOptions; + + /** + * Verifies a MethodOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @param message MethodOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MethodOptions { + + /** IdempotencyLevel enum. */ + enum IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0, + NO_SIDE_EFFECTS = 1, + IDEMPOTENT = 2 + } + } + + /** Properties of an UninterpretedOption. */ + interface IUninterpretedOption { + + /** UninterpretedOption name */ + name?: (google.protobuf.UninterpretedOption.INamePart[]|null); + + /** UninterpretedOption identifierValue */ + identifierValue?: (string|null); + + /** UninterpretedOption positiveIntValue */ + positiveIntValue?: (number|Long|string|null); + + /** UninterpretedOption negativeIntValue */ + negativeIntValue?: (number|Long|string|null); + + /** UninterpretedOption doubleValue */ + doubleValue?: (number|null); + + /** UninterpretedOption stringValue */ + stringValue?: (Uint8Array|Buffer|string|null); + + /** UninterpretedOption aggregateValue */ + aggregateValue?: (string|null); + } + + /** Represents an UninterpretedOption. */ + class UninterpretedOption implements IUninterpretedOption { + + /** + * Constructs a new UninterpretedOption. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUninterpretedOption); + + /** UninterpretedOption name. */ + public name: google.protobuf.UninterpretedOption.INamePart[]; + + /** UninterpretedOption identifierValue. */ + public identifierValue: string; + + /** UninterpretedOption positiveIntValue. */ + public positiveIntValue: (number|Long|string); + + /** UninterpretedOption negativeIntValue. */ + public negativeIntValue: (number|Long|string); + + /** UninterpretedOption doubleValue. */ + public doubleValue: number; + + /** UninterpretedOption stringValue. */ + public stringValue: (Uint8Array|Buffer|string); + + /** UninterpretedOption aggregateValue. */ + public aggregateValue: string; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @param [properties] Properties to set + * @returns UninterpretedOption instance + */ + public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption; + + /** + * Verifies an UninterpretedOption message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UninterpretedOption + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @param message UninterpretedOption + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UninterpretedOption to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UninterpretedOption + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace UninterpretedOption { + + /** Properties of a NamePart. */ + interface INamePart { + + /** NamePart namePart */ + namePart: string; + + /** NamePart isExtension */ + isExtension: boolean; + } + + /** Represents a NamePart. */ + class NamePart implements INamePart { + + /** + * Constructs a new NamePart. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.UninterpretedOption.INamePart); + + /** NamePart namePart. */ + public namePart: string; + + /** NamePart isExtension. */ + public isExtension: boolean; + + /** + * Creates a new NamePart instance using the specified properties. + * @param [properties] Properties to set + * @returns NamePart instance + */ + public static create(properties?: google.protobuf.UninterpretedOption.INamePart): google.protobuf.UninterpretedOption.NamePart; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption.NamePart; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption.NamePart; + + /** + * Verifies a NamePart message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NamePart + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @param message NamePart + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NamePart to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NamePart + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a FeatureSet. */ + interface IFeatureSet { + + /** FeatureSet fieldPresence */ + fieldPresence?: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence|null); + + /** FeatureSet enumType */ + enumType?: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType|null); + + /** FeatureSet repeatedFieldEncoding */ + repeatedFieldEncoding?: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding|null); + + /** FeatureSet utf8Validation */ + utf8Validation?: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation|null); + + /** FeatureSet messageEncoding */ + messageEncoding?: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding|null); + + /** FeatureSet jsonFormat */ + jsonFormat?: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat|null); + } + + /** Represents a FeatureSet. */ + class FeatureSet implements IFeatureSet { + + /** + * Constructs a new FeatureSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFeatureSet); + + /** FeatureSet fieldPresence. */ + public fieldPresence: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence); + + /** FeatureSet enumType. */ + public enumType: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType); + + /** FeatureSet repeatedFieldEncoding. */ + public repeatedFieldEncoding: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding); + + /** FeatureSet utf8Validation. */ + public utf8Validation: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation); + + /** FeatureSet messageEncoding. */ + public messageEncoding: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding); + + /** FeatureSet jsonFormat. */ + public jsonFormat: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat); + + /** + * Creates a new FeatureSet instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSet instance + */ + public static create(properties?: google.protobuf.IFeatureSet): google.protobuf.FeatureSet; + + /** + * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @param message FeatureSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @param message FeatureSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSet; + + /** + * Decodes a FeatureSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSet; + + /** + * Verifies a FeatureSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSet + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSet; + + /** + * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. + * @param message FeatureSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FeatureSet { + + /** FieldPresence enum. */ + enum FieldPresence { + FIELD_PRESENCE_UNKNOWN = 0, + EXPLICIT = 1, + IMPLICIT = 2, + LEGACY_REQUIRED = 3 + } + + /** EnumType enum. */ + enum EnumType { + ENUM_TYPE_UNKNOWN = 0, + OPEN = 1, + CLOSED = 2 + } + + /** RepeatedFieldEncoding enum. */ + enum RepeatedFieldEncoding { + REPEATED_FIELD_ENCODING_UNKNOWN = 0, + PACKED = 1, + EXPANDED = 2 + } + + /** Utf8Validation enum. */ + enum Utf8Validation { + UTF8_VALIDATION_UNKNOWN = 0, + VERIFY = 2, + NONE = 3 + } + + /** MessageEncoding enum. */ + enum MessageEncoding { + MESSAGE_ENCODING_UNKNOWN = 0, + LENGTH_PREFIXED = 1, + DELIMITED = 2 + } + + /** JsonFormat enum. */ + enum JsonFormat { + JSON_FORMAT_UNKNOWN = 0, + ALLOW = 1, + LEGACY_BEST_EFFORT = 2 + } + } + + /** Properties of a FeatureSetDefaults. */ + interface IFeatureSetDefaults { + + /** FeatureSetDefaults defaults */ + defaults?: (google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]|null); + + /** FeatureSetDefaults minimumEdition */ + minimumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSetDefaults maximumEdition */ + maximumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + } + + /** Represents a FeatureSetDefaults. */ + class FeatureSetDefaults implements IFeatureSetDefaults { + + /** + * Constructs a new FeatureSetDefaults. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFeatureSetDefaults); + + /** FeatureSetDefaults defaults. */ + public defaults: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]; + + /** FeatureSetDefaults minimumEdition. */ + public minimumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSetDefaults maximumEdition. */ + public maximumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** + * Creates a new FeatureSetDefaults instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSetDefaults instance + */ + public static create(properties?: google.protobuf.IFeatureSetDefaults): google.protobuf.FeatureSetDefaults; + + /** + * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @param message FeatureSetDefaults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @param message FeatureSetDefaults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSetDefaults; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSetDefaults; + + /** + * Verifies a FeatureSetDefaults message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSetDefaults + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults; + + /** + * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. + * @param message FeatureSetDefaults + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSetDefaults, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSetDefaults to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSetDefaults + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FeatureSetDefaults { + + /** Properties of a FeatureSetEditionDefault. */ + interface IFeatureSetEditionDefault { + + /** FeatureSetEditionDefault edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSetEditionDefault features */ + features?: (google.protobuf.IFeatureSet|null); + } + + /** Represents a FeatureSetEditionDefault. */ + class FeatureSetEditionDefault implements IFeatureSetEditionDefault { + + /** + * Constructs a new FeatureSetEditionDefault. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault); + + /** FeatureSetEditionDefault edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSetEditionDefault features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** + * Creates a new FeatureSetEditionDefault instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSetEditionDefault instance + */ + public static create(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @param message FeatureSetEditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @param message FeatureSetEditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Verifies a FeatureSetEditionDefault message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSetEditionDefault + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. + * @param message FeatureSetEditionDefault + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSetEditionDefault to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSetEditionDefault + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a SourceCodeInfo. */ + interface ISourceCodeInfo { + + /** SourceCodeInfo location */ + location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); + } + + /** Represents a SourceCodeInfo. */ + class SourceCodeInfo implements ISourceCodeInfo { + + /** + * Constructs a new SourceCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ISourceCodeInfo); + + /** SourceCodeInfo location. */ + public location: google.protobuf.SourceCodeInfo.ILocation[]; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns SourceCodeInfo instance + */ + public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo; + + /** + * Verifies a SourceCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SourceCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @param message SourceCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SourceCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SourceCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SourceCodeInfo { + + /** Properties of a Location. */ + interface ILocation { + + /** Location path */ + path?: (number[]|null); + + /** Location span */ + span?: (number[]|null); + + /** Location leadingComments */ + leadingComments?: (string|null); + + /** Location trailingComments */ + trailingComments?: (string|null); + + /** Location leadingDetachedComments */ + leadingDetachedComments?: (string[]|null); + } + + /** Represents a Location. */ + class Location implements ILocation { + + /** + * Constructs a new Location. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); + + /** Location path. */ + public path: number[]; + + /** Location span. */ + public span: number[]; + + /** Location leadingComments. */ + public leadingComments: string; + + /** Location trailingComments. */ + public trailingComments: string; + + /** Location leadingDetachedComments. */ + public leadingDetachedComments: string[]; + + /** + * Creates a new Location instance using the specified properties. + * @param [properties] Properties to set + * @returns Location instance + */ + public static create(properties?: google.protobuf.SourceCodeInfo.ILocation): google.protobuf.SourceCodeInfo.Location; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Location message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo.Location; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo.Location; + + /** + * Verifies a Location message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Location + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @param message Location + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Location to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Location + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a GeneratedCodeInfo. */ + interface IGeneratedCodeInfo { + + /** GeneratedCodeInfo annotation */ + annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); + } + + /** Represents a GeneratedCodeInfo. */ + class GeneratedCodeInfo implements IGeneratedCodeInfo { + + /** + * Constructs a new GeneratedCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IGeneratedCodeInfo); + + /** GeneratedCodeInfo annotation. */ + public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns GeneratedCodeInfo instance + */ + public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo; + + /** + * Verifies a GeneratedCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GeneratedCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @param message GeneratedCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GeneratedCodeInfo { + + /** Properties of an Annotation. */ + interface IAnnotation { + + /** Annotation path */ + path?: (number[]|null); + + /** Annotation sourceFile */ + sourceFile?: (string|null); + + /** Annotation begin */ + begin?: (number|null); + + /** Annotation end */ + end?: (number|null); + + /** Annotation semantic */ + semantic?: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null); + } + + /** Represents an Annotation. */ + class Annotation implements IAnnotation { + + /** + * Constructs a new Annotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); + + /** Annotation path. */ + public path: number[]; + + /** Annotation sourceFile. */ + public sourceFile: string; + + /** Annotation begin. */ + public begin: number; + + /** Annotation end. */ + public end: number; + + /** Annotation semantic. */ + public semantic: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic); + + /** + * Creates a new Annotation instance using the specified properties. + * @param [properties] Properties to set + * @returns Annotation instance + */ + public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Verifies an Annotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Annotation + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @param message Annotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Annotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Annotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Annotation { + + /** Semantic enum. */ + enum Semantic { + NONE = 0, + SET = 1, + ALIAS = 2 + } + } + } + + /** Properties of a Duration. */ + interface IDuration { + + /** Duration seconds */ + seconds?: (number|Long|string|null); + + /** Duration nanos */ + nanos?: (number|null); + } + + /** Represents a Duration. */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDuration); + + /** Duration seconds. */ + public seconds: (number|Long|string); + + /** Duration nanos. */ + public nanos: number; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: google.protobuf.IDuration): google.protobuf.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Duration; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Duration; + + /** + * Verifies a Duration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Duration + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @param message Duration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Duration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Empty. */ + interface IEmpty { + } + + /** Represents an Empty. */ + class Empty implements IEmpty { + + /** + * Constructs a new Empty. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEmpty); + + /** + * Creates a new Empty instance using the specified properties. + * @param [properties] Properties to set + * @returns Empty instance + */ + public static create(properties?: google.protobuf.IEmpty): google.protobuf.Empty; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Empty; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Empty; + + /** + * Verifies an Empty message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Empty + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Empty; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @param message Empty + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Empty to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Empty + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Any. */ + interface IAny { + + /** Any type_url */ + type_url?: (string|null); + + /** Any value */ + value?: (Uint8Array|Buffer|string|null); + } + + /** Represents an Any. */ + class Any implements IAny { + + /** + * Constructs a new Any. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IAny); + + /** Any type_url. */ + public type_url: string; + + /** Any value. */ + public value: (Uint8Array|Buffer|string); + + /** + * Creates a new Any instance using the specified properties. + * @param [properties] Properties to set + * @returns Any instance + */ + public static create(properties?: google.protobuf.IAny): google.protobuf.Any; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Any message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Any; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Any; + + /** + * Verifies an Any message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Any + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Any; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @param message Any + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Any, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Any to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Any + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace spanner. */ + namespace spanner { + + /** Namespace v1. */ + namespace v1 { + + /** Properties of a ChangeStreamRecord. */ + interface IChangeStreamRecord { + + /** ChangeStreamRecord dataChangeRecord */ + dataChangeRecord?: (google.spanner.v1.ChangeStreamRecord.IDataChangeRecord|null); + + /** ChangeStreamRecord heartbeatRecord */ + heartbeatRecord?: (google.spanner.v1.ChangeStreamRecord.IHeartbeatRecord|null); + + /** ChangeStreamRecord partitionStartRecord */ + partitionStartRecord?: (google.spanner.v1.ChangeStreamRecord.IPartitionStartRecord|null); + + /** ChangeStreamRecord partitionEndRecord */ + partitionEndRecord?: (google.spanner.v1.ChangeStreamRecord.IPartitionEndRecord|null); + + /** ChangeStreamRecord partitionEventRecord */ + partitionEventRecord?: (google.spanner.v1.ChangeStreamRecord.IPartitionEventRecord|null); + } + + /** Represents a ChangeStreamRecord. */ + class ChangeStreamRecord implements IChangeStreamRecord { + + /** + * Constructs a new ChangeStreamRecord. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.IChangeStreamRecord); + + /** ChangeStreamRecord dataChangeRecord. */ + public dataChangeRecord?: (google.spanner.v1.ChangeStreamRecord.IDataChangeRecord|null); + + /** ChangeStreamRecord heartbeatRecord. */ + public heartbeatRecord?: (google.spanner.v1.ChangeStreamRecord.IHeartbeatRecord|null); + + /** ChangeStreamRecord partitionStartRecord. */ + public partitionStartRecord?: (google.spanner.v1.ChangeStreamRecord.IPartitionStartRecord|null); + + /** ChangeStreamRecord partitionEndRecord. */ + public partitionEndRecord?: (google.spanner.v1.ChangeStreamRecord.IPartitionEndRecord|null); + + /** ChangeStreamRecord partitionEventRecord. */ + public partitionEventRecord?: (google.spanner.v1.ChangeStreamRecord.IPartitionEventRecord|null); + + /** ChangeStreamRecord record. */ + public record?: ("dataChangeRecord"|"heartbeatRecord"|"partitionStartRecord"|"partitionEndRecord"|"partitionEventRecord"); + + /** + * Creates a new ChangeStreamRecord instance using the specified properties. + * @param [properties] Properties to set + * @returns ChangeStreamRecord instance + */ + public static create(properties?: google.spanner.v1.IChangeStreamRecord): google.spanner.v1.ChangeStreamRecord; + + /** + * Encodes the specified ChangeStreamRecord message. Does not implicitly {@link google.spanner.v1.ChangeStreamRecord.verify|verify} messages. + * @param message ChangeStreamRecord message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.IChangeStreamRecord, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ChangeStreamRecord message, length delimited. Does not implicitly {@link google.spanner.v1.ChangeStreamRecord.verify|verify} messages. + * @param message ChangeStreamRecord message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.IChangeStreamRecord, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ChangeStreamRecord message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ChangeStreamRecord + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.ChangeStreamRecord; + + /** + * Decodes a ChangeStreamRecord message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ChangeStreamRecord + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.ChangeStreamRecord; + + /** + * Verifies a ChangeStreamRecord message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ChangeStreamRecord message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ChangeStreamRecord + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.ChangeStreamRecord; + + /** + * Creates a plain object from a ChangeStreamRecord message. Also converts values to other types if specified. + * @param message ChangeStreamRecord + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.ChangeStreamRecord, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ChangeStreamRecord to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ChangeStreamRecord + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ChangeStreamRecord { + + /** Properties of a DataChangeRecord. */ + interface IDataChangeRecord { + + /** DataChangeRecord commitTimestamp */ + commitTimestamp?: (google.protobuf.ITimestamp|null); + + /** DataChangeRecord recordSequence */ + recordSequence?: (string|null); + + /** DataChangeRecord serverTransactionId */ + serverTransactionId?: (string|null); + + /** DataChangeRecord isLastRecordInTransactionInPartition */ + isLastRecordInTransactionInPartition?: (boolean|null); + + /** DataChangeRecord table */ + table?: (string|null); + + /** DataChangeRecord columnMetadata */ + columnMetadata?: (google.spanner.v1.ChangeStreamRecord.DataChangeRecord.IColumnMetadata[]|null); + + /** DataChangeRecord mods */ + mods?: (google.spanner.v1.ChangeStreamRecord.DataChangeRecord.IMod[]|null); + + /** DataChangeRecord modType */ + modType?: (google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType|keyof typeof google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType|null); + + /** DataChangeRecord valueCaptureType */ + valueCaptureType?: (google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ValueCaptureType|keyof typeof google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ValueCaptureType|null); + + /** DataChangeRecord numberOfRecordsInTransaction */ + numberOfRecordsInTransaction?: (number|null); + + /** DataChangeRecord numberOfPartitionsInTransaction */ + numberOfPartitionsInTransaction?: (number|null); + + /** DataChangeRecord transactionTag */ + transactionTag?: (string|null); + + /** DataChangeRecord isSystemTransaction */ + isSystemTransaction?: (boolean|null); + } + + /** Represents a DataChangeRecord. */ + class DataChangeRecord implements IDataChangeRecord { + + /** + * Constructs a new DataChangeRecord. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.ChangeStreamRecord.IDataChangeRecord); + + /** DataChangeRecord commitTimestamp. */ + public commitTimestamp?: (google.protobuf.ITimestamp|null); + + /** DataChangeRecord recordSequence. */ + public recordSequence: string; + + /** DataChangeRecord serverTransactionId. */ + public serverTransactionId: string; + + /** DataChangeRecord isLastRecordInTransactionInPartition. */ + public isLastRecordInTransactionInPartition: boolean; + + /** DataChangeRecord table. */ + public table: string; + + /** DataChangeRecord columnMetadata. */ + public columnMetadata: google.spanner.v1.ChangeStreamRecord.DataChangeRecord.IColumnMetadata[]; + + /** DataChangeRecord mods. */ + public mods: google.spanner.v1.ChangeStreamRecord.DataChangeRecord.IMod[]; + + /** DataChangeRecord modType. */ + public modType: (google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType|keyof typeof google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType); + + /** DataChangeRecord valueCaptureType. */ + public valueCaptureType: (google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ValueCaptureType|keyof typeof google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ValueCaptureType); + + /** DataChangeRecord numberOfRecordsInTransaction. */ + public numberOfRecordsInTransaction: number; + + /** DataChangeRecord numberOfPartitionsInTransaction. */ + public numberOfPartitionsInTransaction: number; + + /** DataChangeRecord transactionTag. */ + public transactionTag: string; + + /** DataChangeRecord isSystemTransaction. */ + public isSystemTransaction: boolean; + + /** + * Creates a new DataChangeRecord instance using the specified properties. + * @param [properties] Properties to set + * @returns DataChangeRecord instance + */ + public static create(properties?: google.spanner.v1.ChangeStreamRecord.IDataChangeRecord): google.spanner.v1.ChangeStreamRecord.DataChangeRecord; + + /** + * Encodes the specified DataChangeRecord message. Does not implicitly {@link google.spanner.v1.ChangeStreamRecord.DataChangeRecord.verify|verify} messages. + * @param message DataChangeRecord message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.ChangeStreamRecord.IDataChangeRecord, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DataChangeRecord message, length delimited. Does not implicitly {@link google.spanner.v1.ChangeStreamRecord.DataChangeRecord.verify|verify} messages. + * @param message DataChangeRecord message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.ChangeStreamRecord.IDataChangeRecord, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DataChangeRecord message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DataChangeRecord + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.ChangeStreamRecord.DataChangeRecord; + + /** + * Decodes a DataChangeRecord message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DataChangeRecord + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.ChangeStreamRecord.DataChangeRecord; + + /** + * Verifies a DataChangeRecord message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DataChangeRecord message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DataChangeRecord + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.ChangeStreamRecord.DataChangeRecord; + + /** + * Creates a plain object from a DataChangeRecord message. Also converts values to other types if specified. + * @param message DataChangeRecord + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.ChangeStreamRecord.DataChangeRecord, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DataChangeRecord to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DataChangeRecord + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DataChangeRecord { + + /** Properties of a ColumnMetadata. */ + interface IColumnMetadata { + + /** ColumnMetadata name */ + name?: (string|null); + + /** ColumnMetadata type */ + type?: (google.spanner.v1.IType|null); + + /** ColumnMetadata isPrimaryKey */ + isPrimaryKey?: (boolean|null); + + /** ColumnMetadata ordinalPosition */ + ordinalPosition?: (number|Long|string|null); + } + + /** Represents a ColumnMetadata. */ + class ColumnMetadata implements IColumnMetadata { + + /** + * Constructs a new ColumnMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.ChangeStreamRecord.DataChangeRecord.IColumnMetadata); + + /** ColumnMetadata name. */ + public name: string; + + /** ColumnMetadata type. */ + public type?: (google.spanner.v1.IType|null); + + /** ColumnMetadata isPrimaryKey. */ + public isPrimaryKey: boolean; + + /** ColumnMetadata ordinalPosition. */ + public ordinalPosition: (number|Long|string); + + /** + * Creates a new ColumnMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ColumnMetadata instance + */ + public static create(properties?: google.spanner.v1.ChangeStreamRecord.DataChangeRecord.IColumnMetadata): google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata; + + /** + * Encodes the specified ColumnMetadata message. Does not implicitly {@link google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata.verify|verify} messages. + * @param message ColumnMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.ChangeStreamRecord.DataChangeRecord.IColumnMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ColumnMetadata message, length delimited. Does not implicitly {@link google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata.verify|verify} messages. + * @param message ColumnMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.ChangeStreamRecord.DataChangeRecord.IColumnMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ColumnMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ColumnMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata; + + /** + * Decodes a ColumnMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ColumnMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata; + + /** + * Verifies a ColumnMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ColumnMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ColumnMetadata + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata; + + /** + * Creates a plain object from a ColumnMetadata message. Also converts values to other types if specified. + * @param message ColumnMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ColumnMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ColumnMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ModValue. */ + interface IModValue { + + /** ModValue columnMetadataIndex */ + columnMetadataIndex?: (number|null); + + /** ModValue value */ + value?: (google.protobuf.IValue|null); + } + + /** Represents a ModValue. */ + class ModValue implements IModValue { + + /** + * Constructs a new ModValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.ChangeStreamRecord.DataChangeRecord.IModValue); + + /** ModValue columnMetadataIndex. */ + public columnMetadataIndex: number; + + /** ModValue value. */ + public value?: (google.protobuf.IValue|null); + + /** + * Creates a new ModValue instance using the specified properties. + * @param [properties] Properties to set + * @returns ModValue instance + */ + public static create(properties?: google.spanner.v1.ChangeStreamRecord.DataChangeRecord.IModValue): google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue; + + /** + * Encodes the specified ModValue message. Does not implicitly {@link google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue.verify|verify} messages. + * @param message ModValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.ChangeStreamRecord.DataChangeRecord.IModValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ModValue message, length delimited. Does not implicitly {@link google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue.verify|verify} messages. + * @param message ModValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.ChangeStreamRecord.DataChangeRecord.IModValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ModValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ModValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue; + + /** + * Decodes a ModValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ModValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue; + + /** + * Verifies a ModValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ModValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ModValue + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue; + + /** + * Creates a plain object from a ModValue message. Also converts values to other types if specified. + * @param message ModValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ModValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ModValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Mod. */ + interface IMod { + + /** Mod keys */ + keys?: (google.spanner.v1.ChangeStreamRecord.DataChangeRecord.IModValue[]|null); + + /** Mod oldValues */ + oldValues?: (google.spanner.v1.ChangeStreamRecord.DataChangeRecord.IModValue[]|null); + + /** Mod newValues */ + newValues?: (google.spanner.v1.ChangeStreamRecord.DataChangeRecord.IModValue[]|null); + } + + /** Represents a Mod. */ + class Mod implements IMod { + + /** + * Constructs a new Mod. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.ChangeStreamRecord.DataChangeRecord.IMod); + + /** Mod keys. */ + public keys: google.spanner.v1.ChangeStreamRecord.DataChangeRecord.IModValue[]; + + /** Mod oldValues. */ + public oldValues: google.spanner.v1.ChangeStreamRecord.DataChangeRecord.IModValue[]; + + /** Mod newValues. */ + public newValues: google.spanner.v1.ChangeStreamRecord.DataChangeRecord.IModValue[]; + + /** + * Creates a new Mod instance using the specified properties. + * @param [properties] Properties to set + * @returns Mod instance + */ + public static create(properties?: google.spanner.v1.ChangeStreamRecord.DataChangeRecord.IMod): google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod; + + /** + * Encodes the specified Mod message. Does not implicitly {@link google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod.verify|verify} messages. + * @param message Mod message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.ChangeStreamRecord.DataChangeRecord.IMod, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Mod message, length delimited. Does not implicitly {@link google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod.verify|verify} messages. + * @param message Mod message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.ChangeStreamRecord.DataChangeRecord.IMod, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Mod message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Mod + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod; + + /** + * Decodes a Mod message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Mod + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod; + + /** + * Verifies a Mod message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Mod message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Mod + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod; + + /** + * Creates a plain object from a Mod message. Also converts values to other types if specified. + * @param message Mod + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Mod to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Mod + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** ModType enum. */ + enum ModType { + MOD_TYPE_UNSPECIFIED = 0, + INSERT = 10, + UPDATE = 20, + DELETE = 30 + } + + /** ValueCaptureType enum. */ + enum ValueCaptureType { + VALUE_CAPTURE_TYPE_UNSPECIFIED = 0, + OLD_AND_NEW_VALUES = 10, + NEW_VALUES = 20, + NEW_ROW = 30, + NEW_ROW_AND_OLD_VALUES = 40 + } + } + + /** Properties of a HeartbeatRecord. */ + interface IHeartbeatRecord { + + /** HeartbeatRecord timestamp */ + timestamp?: (google.protobuf.ITimestamp|null); + } + + /** Represents a HeartbeatRecord. */ + class HeartbeatRecord implements IHeartbeatRecord { + + /** + * Constructs a new HeartbeatRecord. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.ChangeStreamRecord.IHeartbeatRecord); + + /** HeartbeatRecord timestamp. */ + public timestamp?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new HeartbeatRecord instance using the specified properties. + * @param [properties] Properties to set + * @returns HeartbeatRecord instance + */ + public static create(properties?: google.spanner.v1.ChangeStreamRecord.IHeartbeatRecord): google.spanner.v1.ChangeStreamRecord.HeartbeatRecord; + + /** + * Encodes the specified HeartbeatRecord message. Does not implicitly {@link google.spanner.v1.ChangeStreamRecord.HeartbeatRecord.verify|verify} messages. + * @param message HeartbeatRecord message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.ChangeStreamRecord.IHeartbeatRecord, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HeartbeatRecord message, length delimited. Does not implicitly {@link google.spanner.v1.ChangeStreamRecord.HeartbeatRecord.verify|verify} messages. + * @param message HeartbeatRecord message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.ChangeStreamRecord.IHeartbeatRecord, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HeartbeatRecord message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HeartbeatRecord + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.ChangeStreamRecord.HeartbeatRecord; + + /** + * Decodes a HeartbeatRecord message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HeartbeatRecord + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.ChangeStreamRecord.HeartbeatRecord; + + /** + * Verifies a HeartbeatRecord message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HeartbeatRecord message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HeartbeatRecord + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.ChangeStreamRecord.HeartbeatRecord; + + /** + * Creates a plain object from a HeartbeatRecord message. Also converts values to other types if specified. + * @param message HeartbeatRecord + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.ChangeStreamRecord.HeartbeatRecord, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HeartbeatRecord to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HeartbeatRecord + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PartitionStartRecord. */ + interface IPartitionStartRecord { + + /** PartitionStartRecord startTimestamp */ + startTimestamp?: (google.protobuf.ITimestamp|null); + + /** PartitionStartRecord recordSequence */ + recordSequence?: (string|null); + + /** PartitionStartRecord partitionTokens */ + partitionTokens?: (string[]|null); + } + + /** Represents a PartitionStartRecord. */ + class PartitionStartRecord implements IPartitionStartRecord { + + /** + * Constructs a new PartitionStartRecord. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.ChangeStreamRecord.IPartitionStartRecord); + + /** PartitionStartRecord startTimestamp. */ + public startTimestamp?: (google.protobuf.ITimestamp|null); + + /** PartitionStartRecord recordSequence. */ + public recordSequence: string; + + /** PartitionStartRecord partitionTokens. */ + public partitionTokens: string[]; + + /** + * Creates a new PartitionStartRecord instance using the specified properties. + * @param [properties] Properties to set + * @returns PartitionStartRecord instance + */ + public static create(properties?: google.spanner.v1.ChangeStreamRecord.IPartitionStartRecord): google.spanner.v1.ChangeStreamRecord.PartitionStartRecord; + + /** + * Encodes the specified PartitionStartRecord message. Does not implicitly {@link google.spanner.v1.ChangeStreamRecord.PartitionStartRecord.verify|verify} messages. + * @param message PartitionStartRecord message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.ChangeStreamRecord.IPartitionStartRecord, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PartitionStartRecord message, length delimited. Does not implicitly {@link google.spanner.v1.ChangeStreamRecord.PartitionStartRecord.verify|verify} messages. + * @param message PartitionStartRecord message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.ChangeStreamRecord.IPartitionStartRecord, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PartitionStartRecord message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PartitionStartRecord + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.ChangeStreamRecord.PartitionStartRecord; + + /** + * Decodes a PartitionStartRecord message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PartitionStartRecord + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.ChangeStreamRecord.PartitionStartRecord; + + /** + * Verifies a PartitionStartRecord message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PartitionStartRecord message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PartitionStartRecord + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.ChangeStreamRecord.PartitionStartRecord; + + /** + * Creates a plain object from a PartitionStartRecord message. Also converts values to other types if specified. + * @param message PartitionStartRecord + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.ChangeStreamRecord.PartitionStartRecord, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PartitionStartRecord to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PartitionStartRecord + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PartitionEndRecord. */ + interface IPartitionEndRecord { + + /** PartitionEndRecord endTimestamp */ + endTimestamp?: (google.protobuf.ITimestamp|null); + + /** PartitionEndRecord recordSequence */ + recordSequence?: (string|null); + + /** PartitionEndRecord partitionToken */ + partitionToken?: (string|null); + } + + /** Represents a PartitionEndRecord. */ + class PartitionEndRecord implements IPartitionEndRecord { + + /** + * Constructs a new PartitionEndRecord. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.ChangeStreamRecord.IPartitionEndRecord); + + /** PartitionEndRecord endTimestamp. */ + public endTimestamp?: (google.protobuf.ITimestamp|null); + + /** PartitionEndRecord recordSequence. */ + public recordSequence: string; + + /** PartitionEndRecord partitionToken. */ + public partitionToken: string; + + /** + * Creates a new PartitionEndRecord instance using the specified properties. + * @param [properties] Properties to set + * @returns PartitionEndRecord instance + */ + public static create(properties?: google.spanner.v1.ChangeStreamRecord.IPartitionEndRecord): google.spanner.v1.ChangeStreamRecord.PartitionEndRecord; + + /** + * Encodes the specified PartitionEndRecord message. Does not implicitly {@link google.spanner.v1.ChangeStreamRecord.PartitionEndRecord.verify|verify} messages. + * @param message PartitionEndRecord message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.ChangeStreamRecord.IPartitionEndRecord, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PartitionEndRecord message, length delimited. Does not implicitly {@link google.spanner.v1.ChangeStreamRecord.PartitionEndRecord.verify|verify} messages. + * @param message PartitionEndRecord message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.ChangeStreamRecord.IPartitionEndRecord, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PartitionEndRecord message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PartitionEndRecord + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.ChangeStreamRecord.PartitionEndRecord; + + /** + * Decodes a PartitionEndRecord message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PartitionEndRecord + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.ChangeStreamRecord.PartitionEndRecord; + + /** + * Verifies a PartitionEndRecord message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PartitionEndRecord message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PartitionEndRecord + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.ChangeStreamRecord.PartitionEndRecord; + + /** + * Creates a plain object from a PartitionEndRecord message. Also converts values to other types if specified. + * @param message PartitionEndRecord + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.ChangeStreamRecord.PartitionEndRecord, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PartitionEndRecord to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PartitionEndRecord + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PartitionEventRecord. */ + interface IPartitionEventRecord { + + /** PartitionEventRecord commitTimestamp */ + commitTimestamp?: (google.protobuf.ITimestamp|null); + + /** PartitionEventRecord recordSequence */ + recordSequence?: (string|null); + + /** PartitionEventRecord partitionToken */ + partitionToken?: (string|null); + + /** PartitionEventRecord moveInEvents */ + moveInEvents?: (google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.IMoveInEvent[]|null); + + /** PartitionEventRecord moveOutEvents */ + moveOutEvents?: (google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.IMoveOutEvent[]|null); + } + + /** Represents a PartitionEventRecord. */ + class PartitionEventRecord implements IPartitionEventRecord { + + /** + * Constructs a new PartitionEventRecord. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.ChangeStreamRecord.IPartitionEventRecord); + + /** PartitionEventRecord commitTimestamp. */ + public commitTimestamp?: (google.protobuf.ITimestamp|null); + + /** PartitionEventRecord recordSequence. */ + public recordSequence: string; + + /** PartitionEventRecord partitionToken. */ + public partitionToken: string; + + /** PartitionEventRecord moveInEvents. */ + public moveInEvents: google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.IMoveInEvent[]; + + /** PartitionEventRecord moveOutEvents. */ + public moveOutEvents: google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.IMoveOutEvent[]; + + /** + * Creates a new PartitionEventRecord instance using the specified properties. + * @param [properties] Properties to set + * @returns PartitionEventRecord instance + */ + public static create(properties?: google.spanner.v1.ChangeStreamRecord.IPartitionEventRecord): google.spanner.v1.ChangeStreamRecord.PartitionEventRecord; + + /** + * Encodes the specified PartitionEventRecord message. Does not implicitly {@link google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.verify|verify} messages. + * @param message PartitionEventRecord message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.ChangeStreamRecord.IPartitionEventRecord, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PartitionEventRecord message, length delimited. Does not implicitly {@link google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.verify|verify} messages. + * @param message PartitionEventRecord message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.ChangeStreamRecord.IPartitionEventRecord, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PartitionEventRecord message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PartitionEventRecord + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.ChangeStreamRecord.PartitionEventRecord; + + /** + * Decodes a PartitionEventRecord message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PartitionEventRecord + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.ChangeStreamRecord.PartitionEventRecord; + + /** + * Verifies a PartitionEventRecord message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PartitionEventRecord message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PartitionEventRecord + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.ChangeStreamRecord.PartitionEventRecord; + + /** + * Creates a plain object from a PartitionEventRecord message. Also converts values to other types if specified. + * @param message PartitionEventRecord + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.ChangeStreamRecord.PartitionEventRecord, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PartitionEventRecord to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PartitionEventRecord + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace PartitionEventRecord { + + /** Properties of a MoveInEvent. */ + interface IMoveInEvent { + + /** MoveInEvent sourcePartitionToken */ + sourcePartitionToken?: (string|null); + } + + /** Represents a MoveInEvent. */ + class MoveInEvent implements IMoveInEvent { + + /** + * Constructs a new MoveInEvent. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.IMoveInEvent); + + /** MoveInEvent sourcePartitionToken. */ + public sourcePartitionToken: string; + + /** + * Creates a new MoveInEvent instance using the specified properties. + * @param [properties] Properties to set + * @returns MoveInEvent instance + */ + public static create(properties?: google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.IMoveInEvent): google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent; + + /** + * Encodes the specified MoveInEvent message. Does not implicitly {@link google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent.verify|verify} messages. + * @param message MoveInEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.IMoveInEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MoveInEvent message, length delimited. Does not implicitly {@link google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent.verify|verify} messages. + * @param message MoveInEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.IMoveInEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MoveInEvent message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MoveInEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent; + + /** + * Decodes a MoveInEvent message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MoveInEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent; + + /** + * Verifies a MoveInEvent message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MoveInEvent message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MoveInEvent + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent; + + /** + * Creates a plain object from a MoveInEvent message. Also converts values to other types if specified. + * @param message MoveInEvent + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MoveInEvent to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MoveInEvent + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MoveOutEvent. */ + interface IMoveOutEvent { + + /** MoveOutEvent destinationPartitionToken */ + destinationPartitionToken?: (string|null); + } + + /** Represents a MoveOutEvent. */ + class MoveOutEvent implements IMoveOutEvent { + + /** + * Constructs a new MoveOutEvent. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.IMoveOutEvent); + + /** MoveOutEvent destinationPartitionToken. */ + public destinationPartitionToken: string; + + /** + * Creates a new MoveOutEvent instance using the specified properties. + * @param [properties] Properties to set + * @returns MoveOutEvent instance + */ + public static create(properties?: google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.IMoveOutEvent): google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent; + + /** + * Encodes the specified MoveOutEvent message. Does not implicitly {@link google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent.verify|verify} messages. + * @param message MoveOutEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.IMoveOutEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MoveOutEvent message, length delimited. Does not implicitly {@link google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent.verify|verify} messages. + * @param message MoveOutEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.IMoveOutEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MoveOutEvent message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MoveOutEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent; + + /** + * Decodes a MoveOutEvent message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MoveOutEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent; + + /** + * Verifies a MoveOutEvent message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MoveOutEvent message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MoveOutEvent + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent; + + /** + * Creates a plain object from a MoveOutEvent message. Also converts values to other types if specified. + * @param message MoveOutEvent + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MoveOutEvent to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MoveOutEvent + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Properties of a Type. */ + interface IType { + + /** Type code */ + code?: (google.spanner.v1.TypeCode|keyof typeof google.spanner.v1.TypeCode|null); + + /** Type arrayElementType */ + arrayElementType?: (google.spanner.v1.IType|null); + + /** Type structType */ + structType?: (google.spanner.v1.IStructType|null); + + /** Type typeAnnotation */ + typeAnnotation?: (google.spanner.v1.TypeAnnotationCode|keyof typeof google.spanner.v1.TypeAnnotationCode|null); + + /** Type protoTypeFqn */ + protoTypeFqn?: (string|null); + } + + /** Represents a Type. */ + class Type implements IType { + + /** + * Constructs a new Type. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.IType); + + /** Type code. */ + public code: (google.spanner.v1.TypeCode|keyof typeof google.spanner.v1.TypeCode); + + /** Type arrayElementType. */ + public arrayElementType?: (google.spanner.v1.IType|null); + + /** Type structType. */ + public structType?: (google.spanner.v1.IStructType|null); + + /** Type typeAnnotation. */ + public typeAnnotation: (google.spanner.v1.TypeAnnotationCode|keyof typeof google.spanner.v1.TypeAnnotationCode); + + /** Type protoTypeFqn. */ + public protoTypeFqn: string; + + /** + * Creates a new Type instance using the specified properties. + * @param [properties] Properties to set + * @returns Type instance + */ + public static create(properties?: google.spanner.v1.IType): google.spanner.v1.Type; + + /** + * Encodes the specified Type message. Does not implicitly {@link google.spanner.v1.Type.verify|verify} messages. + * @param message Type message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.IType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Type message, length delimited. Does not implicitly {@link google.spanner.v1.Type.verify|verify} messages. + * @param message Type message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.IType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Type message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Type + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.Type; + + /** + * Decodes a Type message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Type + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.Type; + + /** + * Verifies a Type message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Type message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Type + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.Type; + + /** + * Creates a plain object from a Type message. Also converts values to other types if specified. + * @param message Type + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.Type, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Type to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Type + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StructType. */ + interface IStructType { + + /** StructType fields */ + fields?: (google.spanner.v1.StructType.IField[]|null); + } + + /** Represents a StructType. */ + class StructType implements IStructType { + + /** + * Constructs a new StructType. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.IStructType); + + /** StructType fields. */ + public fields: google.spanner.v1.StructType.IField[]; + + /** + * Creates a new StructType instance using the specified properties. + * @param [properties] Properties to set + * @returns StructType instance + */ + public static create(properties?: google.spanner.v1.IStructType): google.spanner.v1.StructType; + + /** + * Encodes the specified StructType message. Does not implicitly {@link google.spanner.v1.StructType.verify|verify} messages. + * @param message StructType message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.IStructType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StructType message, length delimited. Does not implicitly {@link google.spanner.v1.StructType.verify|verify} messages. + * @param message StructType message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.IStructType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StructType message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StructType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.StructType; + + /** + * Decodes a StructType message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StructType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.StructType; + + /** + * Verifies a StructType message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StructType message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StructType + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.StructType; + + /** + * Creates a plain object from a StructType message. Also converts values to other types if specified. + * @param message StructType + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.StructType, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StructType to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StructType + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace StructType { + + /** Properties of a Field. */ + interface IField { + + /** Field name */ + name?: (string|null); + + /** Field type */ + type?: (google.spanner.v1.IType|null); + } + + /** Represents a Field. */ + class Field implements IField { + + /** + * Constructs a new Field. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.StructType.IField); + + /** Field name. */ + public name: string; + + /** Field type. */ + public type?: (google.spanner.v1.IType|null); + + /** + * Creates a new Field instance using the specified properties. + * @param [properties] Properties to set + * @returns Field instance + */ + public static create(properties?: google.spanner.v1.StructType.IField): google.spanner.v1.StructType.Field; + + /** + * Encodes the specified Field message. Does not implicitly {@link google.spanner.v1.StructType.Field.verify|verify} messages. + * @param message Field message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.StructType.IField, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Field message, length delimited. Does not implicitly {@link google.spanner.v1.StructType.Field.verify|verify} messages. + * @param message Field message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.StructType.IField, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Field message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Field + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.StructType.Field; + + /** + * Decodes a Field message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Field + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.StructType.Field; + + /** + * Verifies a Field message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Field message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Field + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.StructType.Field; + + /** + * Creates a plain object from a Field message. Also converts values to other types if specified. + * @param message Field + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.StructType.Field, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Field to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Field + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** TypeCode enum. */ + enum TypeCode { + TYPE_CODE_UNSPECIFIED = 0, + BOOL = 1, + INT64 = 2, + FLOAT64 = 3, + FLOAT32 = 15, + TIMESTAMP = 4, + DATE = 5, + STRING = 6, + BYTES = 7, + ARRAY = 8, + STRUCT = 9, + NUMERIC = 10, + JSON = 11, + PROTO = 13, + ENUM = 14, + INTERVAL = 16, + UUID = 17 + } + + /** TypeAnnotationCode enum. */ + enum TypeAnnotationCode { + TYPE_ANNOTATION_CODE_UNSPECIFIED = 0, + PG_NUMERIC = 2, + PG_JSONB = 3, + PG_OID = 4 + } + + /** Properties of a CommitResponse. */ + interface ICommitResponse { + + /** CommitResponse commitTimestamp */ + commitTimestamp?: (google.protobuf.ITimestamp|null); + + /** CommitResponse commitStats */ + commitStats?: (google.spanner.v1.CommitResponse.ICommitStats|null); + + /** CommitResponse precommitToken */ + precommitToken?: (google.spanner.v1.IMultiplexedSessionPrecommitToken|null); + + /** CommitResponse snapshotTimestamp */ + snapshotTimestamp?: (google.protobuf.ITimestamp|null); + } + + /** Represents a CommitResponse. */ + class CommitResponse implements ICommitResponse { + + /** + * Constructs a new CommitResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.ICommitResponse); + + /** CommitResponse commitTimestamp. */ + public commitTimestamp?: (google.protobuf.ITimestamp|null); + + /** CommitResponse commitStats. */ + public commitStats?: (google.spanner.v1.CommitResponse.ICommitStats|null); + + /** CommitResponse precommitToken. */ + public precommitToken?: (google.spanner.v1.IMultiplexedSessionPrecommitToken|null); + + /** CommitResponse snapshotTimestamp. */ + public snapshotTimestamp?: (google.protobuf.ITimestamp|null); + + /** CommitResponse MultiplexedSessionRetry. */ + public MultiplexedSessionRetry?: "precommitToken"; + + /** + * Creates a new CommitResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns CommitResponse instance + */ + public static create(properties?: google.spanner.v1.ICommitResponse): google.spanner.v1.CommitResponse; + + /** + * Encodes the specified CommitResponse message. Does not implicitly {@link google.spanner.v1.CommitResponse.verify|verify} messages. + * @param message CommitResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.ICommitResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CommitResponse message, length delimited. Does not implicitly {@link google.spanner.v1.CommitResponse.verify|verify} messages. + * @param message CommitResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.ICommitResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CommitResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CommitResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.CommitResponse; + + /** + * Decodes a CommitResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CommitResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.CommitResponse; + + /** + * Verifies a CommitResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CommitResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CommitResponse + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.CommitResponse; + + /** + * Creates a plain object from a CommitResponse message. Also converts values to other types if specified. + * @param message CommitResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.CommitResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CommitResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CommitResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace CommitResponse { + + /** Properties of a CommitStats. */ + interface ICommitStats { + + /** CommitStats mutationCount */ + mutationCount?: (number|Long|string|null); + } + + /** Represents a CommitStats. */ + class CommitStats implements ICommitStats { + + /** + * Constructs a new CommitStats. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.CommitResponse.ICommitStats); + + /** CommitStats mutationCount. */ + public mutationCount: (number|Long|string); + + /** + * Creates a new CommitStats instance using the specified properties. + * @param [properties] Properties to set + * @returns CommitStats instance + */ + public static create(properties?: google.spanner.v1.CommitResponse.ICommitStats): google.spanner.v1.CommitResponse.CommitStats; + + /** + * Encodes the specified CommitStats message. Does not implicitly {@link google.spanner.v1.CommitResponse.CommitStats.verify|verify} messages. + * @param message CommitStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.CommitResponse.ICommitStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CommitStats message, length delimited. Does not implicitly {@link google.spanner.v1.CommitResponse.CommitStats.verify|verify} messages. + * @param message CommitStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.CommitResponse.ICommitStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CommitStats message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CommitStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.CommitResponse.CommitStats; + + /** + * Decodes a CommitStats message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CommitStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.CommitResponse.CommitStats; + + /** + * Verifies a CommitStats message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CommitStats message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CommitStats + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.CommitResponse.CommitStats; + + /** + * Creates a plain object from a CommitStats message. Also converts values to other types if specified. + * @param message CommitStats + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.CommitResponse.CommitStats, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CommitStats to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CommitStats + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a TransactionOptions. */ + interface ITransactionOptions { + + /** TransactionOptions readWrite */ + readWrite?: (google.spanner.v1.TransactionOptions.IReadWrite|null); + + /** TransactionOptions partitionedDml */ + partitionedDml?: (google.spanner.v1.TransactionOptions.IPartitionedDml|null); + + /** TransactionOptions readOnly */ + readOnly?: (google.spanner.v1.TransactionOptions.IReadOnly|null); + + /** TransactionOptions excludeTxnFromChangeStreams */ + excludeTxnFromChangeStreams?: (boolean|null); + + /** TransactionOptions isolationLevel */ + isolationLevel?: (google.spanner.v1.TransactionOptions.IsolationLevel|keyof typeof google.spanner.v1.TransactionOptions.IsolationLevel|null); + } + + /** Represents a TransactionOptions. */ + class TransactionOptions implements ITransactionOptions { + + /** + * Constructs a new TransactionOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.ITransactionOptions); + + /** TransactionOptions readWrite. */ + public readWrite?: (google.spanner.v1.TransactionOptions.IReadWrite|null); + + /** TransactionOptions partitionedDml. */ + public partitionedDml?: (google.spanner.v1.TransactionOptions.IPartitionedDml|null); + + /** TransactionOptions readOnly. */ + public readOnly?: (google.spanner.v1.TransactionOptions.IReadOnly|null); + + /** TransactionOptions excludeTxnFromChangeStreams. */ + public excludeTxnFromChangeStreams: boolean; + + /** TransactionOptions isolationLevel. */ + public isolationLevel: (google.spanner.v1.TransactionOptions.IsolationLevel|keyof typeof google.spanner.v1.TransactionOptions.IsolationLevel); + + /** TransactionOptions mode. */ + public mode?: ("readWrite"|"partitionedDml"|"readOnly"); + + /** + * Creates a new TransactionOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionOptions instance + */ + public static create(properties?: google.spanner.v1.ITransactionOptions): google.spanner.v1.TransactionOptions; + + /** + * Encodes the specified TransactionOptions message. Does not implicitly {@link google.spanner.v1.TransactionOptions.verify|verify} messages. + * @param message TransactionOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.ITransactionOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TransactionOptions message, length delimited. Does not implicitly {@link google.spanner.v1.TransactionOptions.verify|verify} messages. + * @param message TransactionOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.ITransactionOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TransactionOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.TransactionOptions; + + /** + * Decodes a TransactionOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TransactionOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.TransactionOptions; + + /** + * Verifies a TransactionOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TransactionOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TransactionOptions + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.TransactionOptions; + + /** + * Creates a plain object from a TransactionOptions message. Also converts values to other types if specified. + * @param message TransactionOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.TransactionOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TransactionOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TransactionOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace TransactionOptions { + + /** Properties of a ReadWrite. */ + interface IReadWrite { + + /** ReadWrite readLockMode */ + readLockMode?: (google.spanner.v1.TransactionOptions.ReadWrite.ReadLockMode|keyof typeof google.spanner.v1.TransactionOptions.ReadWrite.ReadLockMode|null); + + /** ReadWrite multiplexedSessionPreviousTransactionId */ + multiplexedSessionPreviousTransactionId?: (Uint8Array|Buffer|string|null); + } + + /** Represents a ReadWrite. */ + class ReadWrite implements IReadWrite { + + /** + * Constructs a new ReadWrite. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.TransactionOptions.IReadWrite); + + /** ReadWrite readLockMode. */ + public readLockMode: (google.spanner.v1.TransactionOptions.ReadWrite.ReadLockMode|keyof typeof google.spanner.v1.TransactionOptions.ReadWrite.ReadLockMode); + + /** ReadWrite multiplexedSessionPreviousTransactionId. */ + public multiplexedSessionPreviousTransactionId: (Uint8Array|Buffer|string); + + /** + * Creates a new ReadWrite instance using the specified properties. + * @param [properties] Properties to set + * @returns ReadWrite instance + */ + public static create(properties?: google.spanner.v1.TransactionOptions.IReadWrite): google.spanner.v1.TransactionOptions.ReadWrite; + + /** + * Encodes the specified ReadWrite message. Does not implicitly {@link google.spanner.v1.TransactionOptions.ReadWrite.verify|verify} messages. + * @param message ReadWrite message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.TransactionOptions.IReadWrite, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReadWrite message, length delimited. Does not implicitly {@link google.spanner.v1.TransactionOptions.ReadWrite.verify|verify} messages. + * @param message ReadWrite message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.TransactionOptions.IReadWrite, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReadWrite message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReadWrite + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.TransactionOptions.ReadWrite; + + /** + * Decodes a ReadWrite message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReadWrite + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.TransactionOptions.ReadWrite; + + /** + * Verifies a ReadWrite message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReadWrite message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReadWrite + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.TransactionOptions.ReadWrite; + + /** + * Creates a plain object from a ReadWrite message. Also converts values to other types if specified. + * @param message ReadWrite + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.TransactionOptions.ReadWrite, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReadWrite to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReadWrite + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ReadWrite { + + /** ReadLockMode enum. */ + enum ReadLockMode { + READ_LOCK_MODE_UNSPECIFIED = 0, + PESSIMISTIC = 1, + OPTIMISTIC = 2 + } + } + + /** Properties of a PartitionedDml. */ + interface IPartitionedDml { + } + + /** Represents a PartitionedDml. */ + class PartitionedDml implements IPartitionedDml { + + /** + * Constructs a new PartitionedDml. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.TransactionOptions.IPartitionedDml); + + /** + * Creates a new PartitionedDml instance using the specified properties. + * @param [properties] Properties to set + * @returns PartitionedDml instance + */ + public static create(properties?: google.spanner.v1.TransactionOptions.IPartitionedDml): google.spanner.v1.TransactionOptions.PartitionedDml; + + /** + * Encodes the specified PartitionedDml message. Does not implicitly {@link google.spanner.v1.TransactionOptions.PartitionedDml.verify|verify} messages. + * @param message PartitionedDml message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.TransactionOptions.IPartitionedDml, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PartitionedDml message, length delimited. Does not implicitly {@link google.spanner.v1.TransactionOptions.PartitionedDml.verify|verify} messages. + * @param message PartitionedDml message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.TransactionOptions.IPartitionedDml, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PartitionedDml message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PartitionedDml + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.TransactionOptions.PartitionedDml; + + /** + * Decodes a PartitionedDml message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PartitionedDml + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.TransactionOptions.PartitionedDml; + + /** + * Verifies a PartitionedDml message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PartitionedDml message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PartitionedDml + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.TransactionOptions.PartitionedDml; + + /** + * Creates a plain object from a PartitionedDml message. Also converts values to other types if specified. + * @param message PartitionedDml + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.TransactionOptions.PartitionedDml, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PartitionedDml to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PartitionedDml + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReadOnly. */ + interface IReadOnly { + + /** ReadOnly strong */ + strong?: (boolean|null); + + /** ReadOnly minReadTimestamp */ + minReadTimestamp?: (google.protobuf.ITimestamp|null); + + /** ReadOnly maxStaleness */ + maxStaleness?: (google.protobuf.IDuration|null); + + /** ReadOnly readTimestamp */ + readTimestamp?: (google.protobuf.ITimestamp|null); + + /** ReadOnly exactStaleness */ + exactStaleness?: (google.protobuf.IDuration|null); + + /** ReadOnly returnReadTimestamp */ + returnReadTimestamp?: (boolean|null); + } + + /** Represents a ReadOnly. */ + class ReadOnly implements IReadOnly { + + /** + * Constructs a new ReadOnly. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.TransactionOptions.IReadOnly); + + /** ReadOnly strong. */ + public strong?: (boolean|null); + + /** ReadOnly minReadTimestamp. */ + public minReadTimestamp?: (google.protobuf.ITimestamp|null); + + /** ReadOnly maxStaleness. */ + public maxStaleness?: (google.protobuf.IDuration|null); + + /** ReadOnly readTimestamp. */ + public readTimestamp?: (google.protobuf.ITimestamp|null); + + /** ReadOnly exactStaleness. */ + public exactStaleness?: (google.protobuf.IDuration|null); + + /** ReadOnly returnReadTimestamp. */ + public returnReadTimestamp: boolean; + + /** ReadOnly timestampBound. */ + public timestampBound?: ("strong"|"minReadTimestamp"|"maxStaleness"|"readTimestamp"|"exactStaleness"); + + /** + * Creates a new ReadOnly instance using the specified properties. + * @param [properties] Properties to set + * @returns ReadOnly instance + */ + public static create(properties?: google.spanner.v1.TransactionOptions.IReadOnly): google.spanner.v1.TransactionOptions.ReadOnly; + + /** + * Encodes the specified ReadOnly message. Does not implicitly {@link google.spanner.v1.TransactionOptions.ReadOnly.verify|verify} messages. + * @param message ReadOnly message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.TransactionOptions.IReadOnly, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReadOnly message, length delimited. Does not implicitly {@link google.spanner.v1.TransactionOptions.ReadOnly.verify|verify} messages. + * @param message ReadOnly message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.TransactionOptions.IReadOnly, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReadOnly message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReadOnly + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.TransactionOptions.ReadOnly; + + /** + * Decodes a ReadOnly message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReadOnly + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.TransactionOptions.ReadOnly; + + /** + * Verifies a ReadOnly message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReadOnly message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReadOnly + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.TransactionOptions.ReadOnly; + + /** + * Creates a plain object from a ReadOnly message. Also converts values to other types if specified. + * @param message ReadOnly + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.TransactionOptions.ReadOnly, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReadOnly to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReadOnly + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** IsolationLevel enum. */ + enum IsolationLevel { + ISOLATION_LEVEL_UNSPECIFIED = 0, + SERIALIZABLE = 1, + REPEATABLE_READ = 2 + } + } + + /** Properties of a Transaction. */ + interface ITransaction { + + /** Transaction id */ + id?: (Uint8Array|Buffer|string|null); + + /** Transaction readTimestamp */ + readTimestamp?: (google.protobuf.ITimestamp|null); + + /** Transaction precommitToken */ + precommitToken?: (google.spanner.v1.IMultiplexedSessionPrecommitToken|null); + } + + /** Represents a Transaction. */ + class Transaction implements ITransaction { + + /** + * Constructs a new Transaction. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.ITransaction); + + /** Transaction id. */ + public id: (Uint8Array|Buffer|string); + + /** Transaction readTimestamp. */ + public readTimestamp?: (google.protobuf.ITimestamp|null); + + /** Transaction precommitToken. */ + public precommitToken?: (google.spanner.v1.IMultiplexedSessionPrecommitToken|null); + + /** + * Creates a new Transaction instance using the specified properties. + * @param [properties] Properties to set + * @returns Transaction instance + */ + public static create(properties?: google.spanner.v1.ITransaction): google.spanner.v1.Transaction; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link google.spanner.v1.Transaction.verify|verify} messages. + * @param message Transaction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.ITransaction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Transaction message, length delimited. Does not implicitly {@link google.spanner.v1.Transaction.verify|verify} messages. + * @param message Transaction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.ITransaction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.Transaction; + + /** + * Decodes a Transaction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.Transaction; + + /** + * Verifies a Transaction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Transaction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Transaction + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.Transaction; + + /** + * Creates a plain object from a Transaction message. Also converts values to other types if specified. + * @param message Transaction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.Transaction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Transaction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Transaction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionSelector. */ + interface ITransactionSelector { + + /** TransactionSelector singleUse */ + singleUse?: (google.spanner.v1.ITransactionOptions|null); + + /** TransactionSelector id */ + id?: (Uint8Array|Buffer|string|null); + + /** TransactionSelector begin */ + begin?: (google.spanner.v1.ITransactionOptions|null); + } + + /** Represents a TransactionSelector. */ + class TransactionSelector implements ITransactionSelector { + + /** + * Constructs a new TransactionSelector. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.ITransactionSelector); + + /** TransactionSelector singleUse. */ + public singleUse?: (google.spanner.v1.ITransactionOptions|null); + + /** TransactionSelector id. */ + public id?: (Uint8Array|Buffer|string|null); + + /** TransactionSelector begin. */ + public begin?: (google.spanner.v1.ITransactionOptions|null); + + /** TransactionSelector selector. */ + public selector?: ("singleUse"|"id"|"begin"); + + /** + * Creates a new TransactionSelector instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionSelector instance + */ + public static create(properties?: google.spanner.v1.ITransactionSelector): google.spanner.v1.TransactionSelector; + + /** + * Encodes the specified TransactionSelector message. Does not implicitly {@link google.spanner.v1.TransactionSelector.verify|verify} messages. + * @param message TransactionSelector message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.ITransactionSelector, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TransactionSelector message, length delimited. Does not implicitly {@link google.spanner.v1.TransactionSelector.verify|verify} messages. + * @param message TransactionSelector message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.ITransactionSelector, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionSelector message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TransactionSelector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.TransactionSelector; + + /** + * Decodes a TransactionSelector message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TransactionSelector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.TransactionSelector; + + /** + * Verifies a TransactionSelector message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TransactionSelector message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TransactionSelector + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.TransactionSelector; + + /** + * Creates a plain object from a TransactionSelector message. Also converts values to other types if specified. + * @param message TransactionSelector + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.TransactionSelector, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TransactionSelector to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TransactionSelector + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MultiplexedSessionPrecommitToken. */ + interface IMultiplexedSessionPrecommitToken { + + /** MultiplexedSessionPrecommitToken precommitToken */ + precommitToken?: (Uint8Array|Buffer|string|null); + + /** MultiplexedSessionPrecommitToken seqNum */ + seqNum?: (number|null); + } + + /** Represents a MultiplexedSessionPrecommitToken. */ + class MultiplexedSessionPrecommitToken implements IMultiplexedSessionPrecommitToken { + + /** + * Constructs a new MultiplexedSessionPrecommitToken. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.IMultiplexedSessionPrecommitToken); + + /** MultiplexedSessionPrecommitToken precommitToken. */ + public precommitToken: (Uint8Array|Buffer|string); + + /** MultiplexedSessionPrecommitToken seqNum. */ + public seqNum: number; + + /** + * Creates a new MultiplexedSessionPrecommitToken instance using the specified properties. + * @param [properties] Properties to set + * @returns MultiplexedSessionPrecommitToken instance + */ + public static create(properties?: google.spanner.v1.IMultiplexedSessionPrecommitToken): google.spanner.v1.MultiplexedSessionPrecommitToken; + + /** + * Encodes the specified MultiplexedSessionPrecommitToken message. Does not implicitly {@link google.spanner.v1.MultiplexedSessionPrecommitToken.verify|verify} messages. + * @param message MultiplexedSessionPrecommitToken message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.IMultiplexedSessionPrecommitToken, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MultiplexedSessionPrecommitToken message, length delimited. Does not implicitly {@link google.spanner.v1.MultiplexedSessionPrecommitToken.verify|verify} messages. + * @param message MultiplexedSessionPrecommitToken message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.IMultiplexedSessionPrecommitToken, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MultiplexedSessionPrecommitToken message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MultiplexedSessionPrecommitToken + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.MultiplexedSessionPrecommitToken; + + /** + * Decodes a MultiplexedSessionPrecommitToken message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MultiplexedSessionPrecommitToken + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.MultiplexedSessionPrecommitToken; + + /** + * Verifies a MultiplexedSessionPrecommitToken message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MultiplexedSessionPrecommitToken message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MultiplexedSessionPrecommitToken + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.MultiplexedSessionPrecommitToken; + + /** + * Creates a plain object from a MultiplexedSessionPrecommitToken message. Also converts values to other types if specified. + * @param message MultiplexedSessionPrecommitToken + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.MultiplexedSessionPrecommitToken, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MultiplexedSessionPrecommitToken to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MultiplexedSessionPrecommitToken + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a KeyRange. */ + interface IKeyRange { + + /** KeyRange startClosed */ + startClosed?: (google.protobuf.IListValue|null); + + /** KeyRange startOpen */ + startOpen?: (google.protobuf.IListValue|null); + + /** KeyRange endClosed */ + endClosed?: (google.protobuf.IListValue|null); + + /** KeyRange endOpen */ + endOpen?: (google.protobuf.IListValue|null); + } + + /** Represents a KeyRange. */ + class KeyRange implements IKeyRange { + + /** + * Constructs a new KeyRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.IKeyRange); + + /** KeyRange startClosed. */ + public startClosed?: (google.protobuf.IListValue|null); + + /** KeyRange startOpen. */ + public startOpen?: (google.protobuf.IListValue|null); + + /** KeyRange endClosed. */ + public endClosed?: (google.protobuf.IListValue|null); + + /** KeyRange endOpen. */ + public endOpen?: (google.protobuf.IListValue|null); + + /** KeyRange startKeyType. */ + public startKeyType?: ("startClosed"|"startOpen"); + + /** KeyRange endKeyType. */ + public endKeyType?: ("endClosed"|"endOpen"); + + /** + * Creates a new KeyRange instance using the specified properties. + * @param [properties] Properties to set + * @returns KeyRange instance + */ + public static create(properties?: google.spanner.v1.IKeyRange): google.spanner.v1.KeyRange; + + /** + * Encodes the specified KeyRange message. Does not implicitly {@link google.spanner.v1.KeyRange.verify|verify} messages. + * @param message KeyRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.IKeyRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified KeyRange message, length delimited. Does not implicitly {@link google.spanner.v1.KeyRange.verify|verify} messages. + * @param message KeyRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.IKeyRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KeyRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns KeyRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.KeyRange; + + /** + * Decodes a KeyRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns KeyRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.KeyRange; + + /** + * Verifies a KeyRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a KeyRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns KeyRange + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.KeyRange; + + /** + * Creates a plain object from a KeyRange message. Also converts values to other types if specified. + * @param message KeyRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.KeyRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this KeyRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for KeyRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a KeySet. */ + interface IKeySet { + + /** KeySet keys */ + keys?: (google.protobuf.IListValue[]|null); + + /** KeySet ranges */ + ranges?: (google.spanner.v1.IKeyRange[]|null); + + /** KeySet all */ + all?: (boolean|null); + } + + /** Represents a KeySet. */ + class KeySet implements IKeySet { + + /** + * Constructs a new KeySet. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.IKeySet); + + /** KeySet keys. */ + public keys: google.protobuf.IListValue[]; + + /** KeySet ranges. */ + public ranges: google.spanner.v1.IKeyRange[]; + + /** KeySet all. */ + public all: boolean; + + /** + * Creates a new KeySet instance using the specified properties. + * @param [properties] Properties to set + * @returns KeySet instance + */ + public static create(properties?: google.spanner.v1.IKeySet): google.spanner.v1.KeySet; + + /** + * Encodes the specified KeySet message. Does not implicitly {@link google.spanner.v1.KeySet.verify|verify} messages. + * @param message KeySet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.IKeySet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified KeySet message, length delimited. Does not implicitly {@link google.spanner.v1.KeySet.verify|verify} messages. + * @param message KeySet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.IKeySet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KeySet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns KeySet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.KeySet; + + /** + * Decodes a KeySet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns KeySet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.KeySet; + + /** + * Verifies a KeySet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a KeySet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns KeySet + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.KeySet; + + /** + * Creates a plain object from a KeySet message. Also converts values to other types if specified. + * @param message KeySet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.KeySet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this KeySet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for KeySet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Range. */ + interface IRange { + + /** Range startKey */ + startKey?: (Uint8Array|Buffer|string|null); + + /** Range limitKey */ + limitKey?: (Uint8Array|Buffer|string|null); + + /** Range groupUid */ + groupUid?: (number|Long|string|null); + + /** Range splitId */ + splitId?: (number|Long|string|null); + + /** Range generation */ + generation?: (Uint8Array|Buffer|string|null); + } + + /** Represents a Range. */ + class Range implements IRange { + + /** + * Constructs a new Range. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.IRange); + + /** Range startKey. */ + public startKey: (Uint8Array|Buffer|string); + + /** Range limitKey. */ + public limitKey: (Uint8Array|Buffer|string); + + /** Range groupUid. */ + public groupUid: (number|Long|string); + + /** Range splitId. */ + public splitId: (number|Long|string); + + /** Range generation. */ + public generation: (Uint8Array|Buffer|string); + + /** + * Creates a new Range instance using the specified properties. + * @param [properties] Properties to set + * @returns Range instance + */ + public static create(properties?: google.spanner.v1.IRange): google.spanner.v1.Range; + + /** + * Encodes the specified Range message. Does not implicitly {@link google.spanner.v1.Range.verify|verify} messages. + * @param message Range message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.IRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Range message, length delimited. Does not implicitly {@link google.spanner.v1.Range.verify|verify} messages. + * @param message Range message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.IRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Range message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Range + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.Range; + + /** + * Decodes a Range message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Range + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.Range; + + /** + * Verifies a Range message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Range message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Range + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.Range; + + /** + * Creates a plain object from a Range message. Also converts values to other types if specified. + * @param message Range + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.Range, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Range to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Range + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Tablet. */ + interface ITablet { + + /** Tablet tabletUid */ + tabletUid?: (number|Long|string|null); + + /** Tablet serverAddress */ + serverAddress?: (string|null); + + /** Tablet location */ + location?: (string|null); + + /** Tablet role */ + role?: (google.spanner.v1.Tablet.Role|keyof typeof google.spanner.v1.Tablet.Role|null); + + /** Tablet incarnation */ + incarnation?: (Uint8Array|Buffer|string|null); + + /** Tablet distance */ + distance?: (number|null); + + /** Tablet skip */ + skip?: (boolean|null); + } + + /** Represents a Tablet. */ + class Tablet implements ITablet { + + /** + * Constructs a new Tablet. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.ITablet); + + /** Tablet tabletUid. */ + public tabletUid: (number|Long|string); + + /** Tablet serverAddress. */ + public serverAddress: string; + + /** Tablet location. */ + public location: string; + + /** Tablet role. */ + public role: (google.spanner.v1.Tablet.Role|keyof typeof google.spanner.v1.Tablet.Role); + + /** Tablet incarnation. */ + public incarnation: (Uint8Array|Buffer|string); + + /** Tablet distance. */ + public distance: number; + + /** Tablet skip. */ + public skip: boolean; + + /** + * Creates a new Tablet instance using the specified properties. + * @param [properties] Properties to set + * @returns Tablet instance + */ + public static create(properties?: google.spanner.v1.ITablet): google.spanner.v1.Tablet; + + /** + * Encodes the specified Tablet message. Does not implicitly {@link google.spanner.v1.Tablet.verify|verify} messages. + * @param message Tablet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.ITablet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Tablet message, length delimited. Does not implicitly {@link google.spanner.v1.Tablet.verify|verify} messages. + * @param message Tablet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.ITablet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Tablet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Tablet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.Tablet; + + /** + * Decodes a Tablet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Tablet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.Tablet; + + /** + * Verifies a Tablet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Tablet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Tablet + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.Tablet; + + /** + * Creates a plain object from a Tablet message. Also converts values to other types if specified. + * @param message Tablet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.Tablet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Tablet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Tablet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Tablet { + + /** Role enum. */ + enum Role { + ROLE_UNSPECIFIED = 0, + READ_WRITE = 1, + READ_ONLY = 2 + } + } + + /** Properties of a Group. */ + interface IGroup { + + /** Group groupUid */ + groupUid?: (number|Long|string|null); + + /** Group tablets */ + tablets?: (google.spanner.v1.ITablet[]|null); + + /** Group leaderIndex */ + leaderIndex?: (number|null); + + /** Group generation */ + generation?: (Uint8Array|Buffer|string|null); + } + + /** Represents a Group. */ + class Group implements IGroup { + + /** + * Constructs a new Group. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.IGroup); + + /** Group groupUid. */ + public groupUid: (number|Long|string); + + /** Group tablets. */ + public tablets: google.spanner.v1.ITablet[]; + + /** Group leaderIndex. */ + public leaderIndex: number; + + /** Group generation. */ + public generation: (Uint8Array|Buffer|string); + + /** + * Creates a new Group instance using the specified properties. + * @param [properties] Properties to set + * @returns Group instance + */ + public static create(properties?: google.spanner.v1.IGroup): google.spanner.v1.Group; + + /** + * Encodes the specified Group message. Does not implicitly {@link google.spanner.v1.Group.verify|verify} messages. + * @param message Group message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.IGroup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Group message, length delimited. Does not implicitly {@link google.spanner.v1.Group.verify|verify} messages. + * @param message Group message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.IGroup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Group message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Group + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.Group; + + /** + * Decodes a Group message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Group + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.Group; + + /** + * Verifies a Group message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Group message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Group + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.Group; + + /** + * Creates a plain object from a Group message. Also converts values to other types if specified. + * @param message Group + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.Group, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Group to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Group + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a KeyRecipe. */ + interface IKeyRecipe { + + /** KeyRecipe tableName */ + tableName?: (string|null); + + /** KeyRecipe indexName */ + indexName?: (string|null); + + /** KeyRecipe operationUid */ + operationUid?: (number|Long|string|null); + + /** KeyRecipe part */ + part?: (google.spanner.v1.KeyRecipe.IPart[]|null); + } + + /** Represents a KeyRecipe. */ + class KeyRecipe implements IKeyRecipe { + + /** + * Constructs a new KeyRecipe. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.IKeyRecipe); + + /** KeyRecipe tableName. */ + public tableName?: (string|null); + + /** KeyRecipe indexName. */ + public indexName?: (string|null); + + /** KeyRecipe operationUid. */ + public operationUid?: (number|Long|string|null); + + /** KeyRecipe part. */ + public part: google.spanner.v1.KeyRecipe.IPart[]; + + /** KeyRecipe target. */ + public target?: ("tableName"|"indexName"|"operationUid"); + + /** + * Creates a new KeyRecipe instance using the specified properties. + * @param [properties] Properties to set + * @returns KeyRecipe instance + */ + public static create(properties?: google.spanner.v1.IKeyRecipe): google.spanner.v1.KeyRecipe; + + /** + * Encodes the specified KeyRecipe message. Does not implicitly {@link google.spanner.v1.KeyRecipe.verify|verify} messages. + * @param message KeyRecipe message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.IKeyRecipe, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified KeyRecipe message, length delimited. Does not implicitly {@link google.spanner.v1.KeyRecipe.verify|verify} messages. + * @param message KeyRecipe message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.IKeyRecipe, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KeyRecipe message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns KeyRecipe + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.KeyRecipe; + + /** + * Decodes a KeyRecipe message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns KeyRecipe + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.KeyRecipe; + + /** + * Verifies a KeyRecipe message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a KeyRecipe message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns KeyRecipe + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.KeyRecipe; + + /** + * Creates a plain object from a KeyRecipe message. Also converts values to other types if specified. + * @param message KeyRecipe + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.KeyRecipe, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this KeyRecipe to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for KeyRecipe + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace KeyRecipe { + + /** Properties of a Part. */ + interface IPart { + + /** Part tag */ + tag?: (number|null); + + /** Part order */ + order?: (google.spanner.v1.KeyRecipe.Part.Order|keyof typeof google.spanner.v1.KeyRecipe.Part.Order|null); + + /** Part nullOrder */ + nullOrder?: (google.spanner.v1.KeyRecipe.Part.NullOrder|keyof typeof google.spanner.v1.KeyRecipe.Part.NullOrder|null); + + /** Part type */ + type?: (google.spanner.v1.IType|null); + + /** Part identifier */ + identifier?: (string|null); + + /** Part value */ + value?: (google.protobuf.IValue|null); + + /** Part random */ + random?: (boolean|null); + + /** Part structIdentifiers */ + structIdentifiers?: (number[]|null); + } + + /** Represents a Part. */ + class Part implements IPart { + + /** + * Constructs a new Part. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.KeyRecipe.IPart); + + /** Part tag. */ + public tag: number; + + /** Part order. */ + public order: (google.spanner.v1.KeyRecipe.Part.Order|keyof typeof google.spanner.v1.KeyRecipe.Part.Order); + + /** Part nullOrder. */ + public nullOrder: (google.spanner.v1.KeyRecipe.Part.NullOrder|keyof typeof google.spanner.v1.KeyRecipe.Part.NullOrder); + + /** Part type. */ + public type?: (google.spanner.v1.IType|null); + + /** Part identifier. */ + public identifier?: (string|null); + + /** Part value. */ + public value?: (google.protobuf.IValue|null); + + /** Part random. */ + public random?: (boolean|null); + + /** Part structIdentifiers. */ + public structIdentifiers: number[]; + + /** Part valueType. */ + public valueType?: ("identifier"|"value"|"random"); + + /** + * Creates a new Part instance using the specified properties. + * @param [properties] Properties to set + * @returns Part instance + */ + public static create(properties?: google.spanner.v1.KeyRecipe.IPart): google.spanner.v1.KeyRecipe.Part; + + /** + * Encodes the specified Part message. Does not implicitly {@link google.spanner.v1.KeyRecipe.Part.verify|verify} messages. + * @param message Part message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.KeyRecipe.IPart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Part message, length delimited. Does not implicitly {@link google.spanner.v1.KeyRecipe.Part.verify|verify} messages. + * @param message Part message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.KeyRecipe.IPart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Part message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Part + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.KeyRecipe.Part; + + /** + * Decodes a Part message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Part + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.KeyRecipe.Part; + + /** + * Verifies a Part message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Part message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Part + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.KeyRecipe.Part; + + /** + * Creates a plain object from a Part message. Also converts values to other types if specified. + * @param message Part + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.KeyRecipe.Part, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Part to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Part + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Part { + + /** Order enum. */ + enum Order { + ORDER_UNSPECIFIED = 0, + ASCENDING = 1, + DESCENDING = 2 + } + + /** NullOrder enum. */ + enum NullOrder { + NULL_ORDER_UNSPECIFIED = 0, + NULLS_FIRST = 1, + NULLS_LAST = 2, + NOT_NULL = 3 + } + } + } + + /** Properties of a RecipeList. */ + interface IRecipeList { + + /** RecipeList schemaGeneration */ + schemaGeneration?: (Uint8Array|Buffer|string|null); + + /** RecipeList recipe */ + recipe?: (google.spanner.v1.IKeyRecipe[]|null); + } + + /** Represents a RecipeList. */ + class RecipeList implements IRecipeList { + + /** + * Constructs a new RecipeList. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.IRecipeList); + + /** RecipeList schemaGeneration. */ + public schemaGeneration: (Uint8Array|Buffer|string); + + /** RecipeList recipe. */ + public recipe: google.spanner.v1.IKeyRecipe[]; + + /** + * Creates a new RecipeList instance using the specified properties. + * @param [properties] Properties to set + * @returns RecipeList instance + */ + public static create(properties?: google.spanner.v1.IRecipeList): google.spanner.v1.RecipeList; + + /** + * Encodes the specified RecipeList message. Does not implicitly {@link google.spanner.v1.RecipeList.verify|verify} messages. + * @param message RecipeList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.IRecipeList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RecipeList message, length delimited. Does not implicitly {@link google.spanner.v1.RecipeList.verify|verify} messages. + * @param message RecipeList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.IRecipeList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RecipeList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RecipeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.RecipeList; + + /** + * Decodes a RecipeList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RecipeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.RecipeList; + + /** + * Verifies a RecipeList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RecipeList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RecipeList + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.RecipeList; + + /** + * Creates a plain object from a RecipeList message. Also converts values to other types if specified. + * @param message RecipeList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.RecipeList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RecipeList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RecipeList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CacheUpdate. */ + interface ICacheUpdate { + + /** CacheUpdate databaseId */ + databaseId?: (number|Long|string|null); + + /** CacheUpdate range */ + range?: (google.spanner.v1.IRange[]|null); + + /** CacheUpdate group */ + group?: (google.spanner.v1.IGroup[]|null); + + /** CacheUpdate keyRecipes */ + keyRecipes?: (google.spanner.v1.IRecipeList|null); + } + + /** Represents a CacheUpdate. */ + class CacheUpdate implements ICacheUpdate { + + /** + * Constructs a new CacheUpdate. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.ICacheUpdate); + + /** CacheUpdate databaseId. */ + public databaseId: (number|Long|string); + + /** CacheUpdate range. */ + public range: google.spanner.v1.IRange[]; + + /** CacheUpdate group. */ + public group: google.spanner.v1.IGroup[]; + + /** CacheUpdate keyRecipes. */ + public keyRecipes?: (google.spanner.v1.IRecipeList|null); + + /** + * Creates a new CacheUpdate instance using the specified properties. + * @param [properties] Properties to set + * @returns CacheUpdate instance + */ + public static create(properties?: google.spanner.v1.ICacheUpdate): google.spanner.v1.CacheUpdate; + + /** + * Encodes the specified CacheUpdate message. Does not implicitly {@link google.spanner.v1.CacheUpdate.verify|verify} messages. + * @param message CacheUpdate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.ICacheUpdate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CacheUpdate message, length delimited. Does not implicitly {@link google.spanner.v1.CacheUpdate.verify|verify} messages. + * @param message CacheUpdate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.ICacheUpdate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CacheUpdate message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CacheUpdate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.CacheUpdate; + + /** + * Decodes a CacheUpdate message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CacheUpdate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.CacheUpdate; + + /** + * Verifies a CacheUpdate message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CacheUpdate message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CacheUpdate + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.CacheUpdate; + + /** + * Creates a plain object from a CacheUpdate message. Also converts values to other types if specified. + * @param message CacheUpdate + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.CacheUpdate, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CacheUpdate to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CacheUpdate + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RoutingHint. */ + interface IRoutingHint { + + /** RoutingHint operationUid */ + operationUid?: (number|Long|string|null); + + /** RoutingHint databaseId */ + databaseId?: (number|Long|string|null); + + /** RoutingHint schemaGeneration */ + schemaGeneration?: (Uint8Array|Buffer|string|null); + + /** RoutingHint key */ + key?: (Uint8Array|Buffer|string|null); + + /** RoutingHint limitKey */ + limitKey?: (Uint8Array|Buffer|string|null); + + /** RoutingHint groupUid */ + groupUid?: (number|Long|string|null); + + /** RoutingHint splitId */ + splitId?: (number|Long|string|null); + + /** RoutingHint tabletUid */ + tabletUid?: (number|Long|string|null); + + /** RoutingHint skippedTabletUid */ + skippedTabletUid?: (google.spanner.v1.RoutingHint.ISkippedTablet[]|null); + + /** RoutingHint clientLocation */ + clientLocation?: (string|null); + } + + /** Represents a RoutingHint. */ + class RoutingHint implements IRoutingHint { + + /** + * Constructs a new RoutingHint. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.IRoutingHint); + + /** RoutingHint operationUid. */ + public operationUid: (number|Long|string); + + /** RoutingHint databaseId. */ + public databaseId: (number|Long|string); + + /** RoutingHint schemaGeneration. */ + public schemaGeneration: (Uint8Array|Buffer|string); + + /** RoutingHint key. */ + public key: (Uint8Array|Buffer|string); + + /** RoutingHint limitKey. */ + public limitKey: (Uint8Array|Buffer|string); + + /** RoutingHint groupUid. */ + public groupUid: (number|Long|string); + + /** RoutingHint splitId. */ + public splitId: (number|Long|string); + + /** RoutingHint tabletUid. */ + public tabletUid: (number|Long|string); + + /** RoutingHint skippedTabletUid. */ + public skippedTabletUid: google.spanner.v1.RoutingHint.ISkippedTablet[]; + + /** RoutingHint clientLocation. */ + public clientLocation: string; + + /** + * Creates a new RoutingHint instance using the specified properties. + * @param [properties] Properties to set + * @returns RoutingHint instance + */ + public static create(properties?: google.spanner.v1.IRoutingHint): google.spanner.v1.RoutingHint; + + /** + * Encodes the specified RoutingHint message. Does not implicitly {@link google.spanner.v1.RoutingHint.verify|verify} messages. + * @param message RoutingHint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.IRoutingHint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RoutingHint message, length delimited. Does not implicitly {@link google.spanner.v1.RoutingHint.verify|verify} messages. + * @param message RoutingHint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.IRoutingHint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RoutingHint message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RoutingHint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.RoutingHint; + + /** + * Decodes a RoutingHint message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RoutingHint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.RoutingHint; + + /** + * Verifies a RoutingHint message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RoutingHint message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RoutingHint + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.RoutingHint; + + /** + * Creates a plain object from a RoutingHint message. Also converts values to other types if specified. + * @param message RoutingHint + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.RoutingHint, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RoutingHint to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RoutingHint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace RoutingHint { + + /** Properties of a SkippedTablet. */ + interface ISkippedTablet { + + /** SkippedTablet tabletUid */ + tabletUid?: (number|Long|string|null); + + /** SkippedTablet incarnation */ + incarnation?: (Uint8Array|Buffer|string|null); + } + + /** Represents a SkippedTablet. */ + class SkippedTablet implements ISkippedTablet { + + /** + * Constructs a new SkippedTablet. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.RoutingHint.ISkippedTablet); + + /** SkippedTablet tabletUid. */ + public tabletUid: (number|Long|string); + + /** SkippedTablet incarnation. */ + public incarnation: (Uint8Array|Buffer|string); + + /** + * Creates a new SkippedTablet instance using the specified properties. + * @param [properties] Properties to set + * @returns SkippedTablet instance + */ + public static create(properties?: google.spanner.v1.RoutingHint.ISkippedTablet): google.spanner.v1.RoutingHint.SkippedTablet; + + /** + * Encodes the specified SkippedTablet message. Does not implicitly {@link google.spanner.v1.RoutingHint.SkippedTablet.verify|verify} messages. + * @param message SkippedTablet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.RoutingHint.ISkippedTablet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SkippedTablet message, length delimited. Does not implicitly {@link google.spanner.v1.RoutingHint.SkippedTablet.verify|verify} messages. + * @param message SkippedTablet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.RoutingHint.ISkippedTablet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SkippedTablet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SkippedTablet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.RoutingHint.SkippedTablet; + + /** + * Decodes a SkippedTablet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SkippedTablet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.RoutingHint.SkippedTablet; + + /** + * Verifies a SkippedTablet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SkippedTablet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SkippedTablet + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.RoutingHint.SkippedTablet; + + /** + * Creates a plain object from a SkippedTablet message. Also converts values to other types if specified. + * @param message SkippedTablet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.RoutingHint.SkippedTablet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SkippedTablet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SkippedTablet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a Mutation. */ + interface IMutation { + + /** Mutation insert */ + insert?: (google.spanner.v1.Mutation.IWrite|null); + + /** Mutation update */ + update?: (google.spanner.v1.Mutation.IWrite|null); + + /** Mutation insertOrUpdate */ + insertOrUpdate?: (google.spanner.v1.Mutation.IWrite|null); + + /** Mutation replace */ + replace?: (google.spanner.v1.Mutation.IWrite|null); + + /** Mutation delete */ + "delete"?: (google.spanner.v1.Mutation.IDelete|null); + + /** Mutation send */ + send?: (google.spanner.v1.Mutation.ISend|null); + + /** Mutation ack */ + ack?: (google.spanner.v1.Mutation.IAck|null); + } + + /** Represents a Mutation. */ + class Mutation implements IMutation { + + /** + * Constructs a new Mutation. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.IMutation); + + /** Mutation insert. */ + public insert?: (google.spanner.v1.Mutation.IWrite|null); + + /** Mutation update. */ + public update?: (google.spanner.v1.Mutation.IWrite|null); + + /** Mutation insertOrUpdate. */ + public insertOrUpdate?: (google.spanner.v1.Mutation.IWrite|null); + + /** Mutation replace. */ + public replace?: (google.spanner.v1.Mutation.IWrite|null); + + /** Mutation delete. */ + public delete?: (google.spanner.v1.Mutation.IDelete|null); + + /** Mutation send. */ + public send?: (google.spanner.v1.Mutation.ISend|null); + + /** Mutation ack. */ + public ack?: (google.spanner.v1.Mutation.IAck|null); + + /** Mutation operation. */ + public operation?: ("insert"|"update"|"insertOrUpdate"|"replace"|"delete"|"send"|"ack"); + + /** + * Creates a new Mutation instance using the specified properties. + * @param [properties] Properties to set + * @returns Mutation instance + */ + public static create(properties?: google.spanner.v1.IMutation): google.spanner.v1.Mutation; + + /** + * Encodes the specified Mutation message. Does not implicitly {@link google.spanner.v1.Mutation.verify|verify} messages. + * @param message Mutation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.IMutation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Mutation message, length delimited. Does not implicitly {@link google.spanner.v1.Mutation.verify|verify} messages. + * @param message Mutation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.IMutation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Mutation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Mutation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.Mutation; + + /** + * Decodes a Mutation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Mutation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.Mutation; + + /** + * Verifies a Mutation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Mutation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Mutation + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.Mutation; + + /** + * Creates a plain object from a Mutation message. Also converts values to other types if specified. + * @param message Mutation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.Mutation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Mutation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Mutation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Mutation { + + /** Properties of a Write. */ + interface IWrite { + + /** Write table */ + table?: (string|null); + + /** Write columns */ + columns?: (string[]|null); + + /** Write values */ + values?: (google.protobuf.IListValue[]|null); + } + + /** Represents a Write. */ + class Write implements IWrite { + + /** + * Constructs a new Write. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.Mutation.IWrite); + + /** Write table. */ + public table: string; + + /** Write columns. */ + public columns: string[]; + + /** Write values. */ + public values: google.protobuf.IListValue[]; + + /** + * Creates a new Write instance using the specified properties. + * @param [properties] Properties to set + * @returns Write instance + */ + public static create(properties?: google.spanner.v1.Mutation.IWrite): google.spanner.v1.Mutation.Write; + + /** + * Encodes the specified Write message. Does not implicitly {@link google.spanner.v1.Mutation.Write.verify|verify} messages. + * @param message Write message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.Mutation.IWrite, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Write message, length delimited. Does not implicitly {@link google.spanner.v1.Mutation.Write.verify|verify} messages. + * @param message Write message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.Mutation.IWrite, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Write message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Write + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.Mutation.Write; + + /** + * Decodes a Write message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Write + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.Mutation.Write; + + /** + * Verifies a Write message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Write message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Write + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.Mutation.Write; + + /** + * Creates a plain object from a Write message. Also converts values to other types if specified. + * @param message Write + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.Mutation.Write, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Write to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Write + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Delete. */ + interface IDelete { + + /** Delete table */ + table?: (string|null); + + /** Delete keySet */ + keySet?: (google.spanner.v1.IKeySet|null); + } + + /** Represents a Delete. */ + class Delete implements IDelete { + + /** + * Constructs a new Delete. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.Mutation.IDelete); + + /** Delete table. */ + public table: string; + + /** Delete keySet. */ + public keySet?: (google.spanner.v1.IKeySet|null); + + /** + * Creates a new Delete instance using the specified properties. + * @param [properties] Properties to set + * @returns Delete instance + */ + public static create(properties?: google.spanner.v1.Mutation.IDelete): google.spanner.v1.Mutation.Delete; + + /** + * Encodes the specified Delete message. Does not implicitly {@link google.spanner.v1.Mutation.Delete.verify|verify} messages. + * @param message Delete message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.Mutation.IDelete, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Delete message, length delimited. Does not implicitly {@link google.spanner.v1.Mutation.Delete.verify|verify} messages. + * @param message Delete message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.Mutation.IDelete, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Delete message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Delete + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.Mutation.Delete; + + /** + * Decodes a Delete message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Delete + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.Mutation.Delete; + + /** + * Verifies a Delete message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Delete message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Delete + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.Mutation.Delete; + + /** + * Creates a plain object from a Delete message. Also converts values to other types if specified. + * @param message Delete + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.Mutation.Delete, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Delete to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Delete + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Send. */ + interface ISend { + + /** Send queue */ + queue?: (string|null); + + /** Send key */ + key?: (google.protobuf.IListValue|null); + + /** Send deliverTime */ + deliverTime?: (google.protobuf.ITimestamp|null); + + /** Send payload */ + payload?: (google.protobuf.IValue|null); + } + + /** Represents a Send. */ + class Send implements ISend { + + /** + * Constructs a new Send. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.Mutation.ISend); + + /** Send queue. */ + public queue: string; + + /** Send key. */ + public key?: (google.protobuf.IListValue|null); + + /** Send deliverTime. */ + public deliverTime?: (google.protobuf.ITimestamp|null); + + /** Send payload. */ + public payload?: (google.protobuf.IValue|null); + + /** + * Creates a new Send instance using the specified properties. + * @param [properties] Properties to set + * @returns Send instance + */ + public static create(properties?: google.spanner.v1.Mutation.ISend): google.spanner.v1.Mutation.Send; + + /** + * Encodes the specified Send message. Does not implicitly {@link google.spanner.v1.Mutation.Send.verify|verify} messages. + * @param message Send message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.Mutation.ISend, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Send message, length delimited. Does not implicitly {@link google.spanner.v1.Mutation.Send.verify|verify} messages. + * @param message Send message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.Mutation.ISend, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Send message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Send + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.Mutation.Send; + + /** + * Decodes a Send message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Send + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.Mutation.Send; + + /** + * Verifies a Send message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Send message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Send + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.Mutation.Send; + + /** + * Creates a plain object from a Send message. Also converts values to other types if specified. + * @param message Send + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.Mutation.Send, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Send to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Send + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Ack. */ + interface IAck { + + /** Ack queue */ + queue?: (string|null); + + /** Ack key */ + key?: (google.protobuf.IListValue|null); + + /** Ack ignoreNotFound */ + ignoreNotFound?: (boolean|null); + } + + /** Represents an Ack. */ + class Ack implements IAck { + + /** + * Constructs a new Ack. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.Mutation.IAck); + + /** Ack queue. */ + public queue: string; + + /** Ack key. */ + public key?: (google.protobuf.IListValue|null); + + /** Ack ignoreNotFound. */ + public ignoreNotFound: boolean; + + /** + * Creates a new Ack instance using the specified properties. + * @param [properties] Properties to set + * @returns Ack instance + */ + public static create(properties?: google.spanner.v1.Mutation.IAck): google.spanner.v1.Mutation.Ack; + + /** + * Encodes the specified Ack message. Does not implicitly {@link google.spanner.v1.Mutation.Ack.verify|verify} messages. + * @param message Ack message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.Mutation.IAck, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Ack message, length delimited. Does not implicitly {@link google.spanner.v1.Mutation.Ack.verify|verify} messages. + * @param message Ack message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.Mutation.IAck, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Ack message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Ack + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.Mutation.Ack; + + /** + * Decodes an Ack message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Ack + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.Mutation.Ack; + + /** + * Verifies an Ack message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Ack message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Ack + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.Mutation.Ack; + + /** + * Creates a plain object from an Ack message. Also converts values to other types if specified. + * @param message Ack + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.Mutation.Ack, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Ack to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Ack + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a PlanNode. */ + interface IPlanNode { + + /** PlanNode index */ + index?: (number|null); + + /** PlanNode kind */ + kind?: (google.spanner.v1.PlanNode.Kind|keyof typeof google.spanner.v1.PlanNode.Kind|null); + + /** PlanNode displayName */ + displayName?: (string|null); + + /** PlanNode childLinks */ + childLinks?: (google.spanner.v1.PlanNode.IChildLink[]|null); + + /** PlanNode shortRepresentation */ + shortRepresentation?: (google.spanner.v1.PlanNode.IShortRepresentation|null); + + /** PlanNode metadata */ + metadata?: (google.protobuf.IStruct|null); + + /** PlanNode executionStats */ + executionStats?: (google.protobuf.IStruct|null); + } + + /** Represents a PlanNode. */ + class PlanNode implements IPlanNode { + + /** + * Constructs a new PlanNode. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.IPlanNode); + + /** PlanNode index. */ + public index: number; + + /** PlanNode kind. */ + public kind: (google.spanner.v1.PlanNode.Kind|keyof typeof google.spanner.v1.PlanNode.Kind); + + /** PlanNode displayName. */ + public displayName: string; + + /** PlanNode childLinks. */ + public childLinks: google.spanner.v1.PlanNode.IChildLink[]; + + /** PlanNode shortRepresentation. */ + public shortRepresentation?: (google.spanner.v1.PlanNode.IShortRepresentation|null); + + /** PlanNode metadata. */ + public metadata?: (google.protobuf.IStruct|null); + + /** PlanNode executionStats. */ + public executionStats?: (google.protobuf.IStruct|null); + + /** + * Creates a new PlanNode instance using the specified properties. + * @param [properties] Properties to set + * @returns PlanNode instance + */ + public static create(properties?: google.spanner.v1.IPlanNode): google.spanner.v1.PlanNode; + + /** + * Encodes the specified PlanNode message. Does not implicitly {@link google.spanner.v1.PlanNode.verify|verify} messages. + * @param message PlanNode message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.IPlanNode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PlanNode message, length delimited. Does not implicitly {@link google.spanner.v1.PlanNode.verify|verify} messages. + * @param message PlanNode message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.IPlanNode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PlanNode message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PlanNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.PlanNode; + + /** + * Decodes a PlanNode message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PlanNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.PlanNode; + + /** + * Verifies a PlanNode message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PlanNode message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PlanNode + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.PlanNode; + + /** + * Creates a plain object from a PlanNode message. Also converts values to other types if specified. + * @param message PlanNode + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.PlanNode, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PlanNode to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PlanNode + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace PlanNode { + + /** Kind enum. */ + enum Kind { + KIND_UNSPECIFIED = 0, + RELATIONAL = 1, + SCALAR = 2 + } + + /** Properties of a ChildLink. */ + interface IChildLink { + + /** ChildLink childIndex */ + childIndex?: (number|null); + + /** ChildLink type */ + type?: (string|null); + + /** ChildLink variable */ + variable?: (string|null); + } + + /** Represents a ChildLink. */ + class ChildLink implements IChildLink { + + /** + * Constructs a new ChildLink. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.PlanNode.IChildLink); + + /** ChildLink childIndex. */ + public childIndex: number; + + /** ChildLink type. */ + public type: string; + + /** ChildLink variable. */ + public variable: string; + + /** + * Creates a new ChildLink instance using the specified properties. + * @param [properties] Properties to set + * @returns ChildLink instance + */ + public static create(properties?: google.spanner.v1.PlanNode.IChildLink): google.spanner.v1.PlanNode.ChildLink; + + /** + * Encodes the specified ChildLink message. Does not implicitly {@link google.spanner.v1.PlanNode.ChildLink.verify|verify} messages. + * @param message ChildLink message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.PlanNode.IChildLink, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ChildLink message, length delimited. Does not implicitly {@link google.spanner.v1.PlanNode.ChildLink.verify|verify} messages. + * @param message ChildLink message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.PlanNode.IChildLink, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ChildLink message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ChildLink + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.PlanNode.ChildLink; + + /** + * Decodes a ChildLink message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ChildLink + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.PlanNode.ChildLink; + + /** + * Verifies a ChildLink message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ChildLink message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ChildLink + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.PlanNode.ChildLink; + + /** + * Creates a plain object from a ChildLink message. Also converts values to other types if specified. + * @param message ChildLink + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.PlanNode.ChildLink, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ChildLink to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ChildLink + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ShortRepresentation. */ + interface IShortRepresentation { + + /** ShortRepresentation description */ + description?: (string|null); + + /** ShortRepresentation subqueries */ + subqueries?: ({ [k: string]: number }|null); + } + + /** Represents a ShortRepresentation. */ + class ShortRepresentation implements IShortRepresentation { + + /** + * Constructs a new ShortRepresentation. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.PlanNode.IShortRepresentation); + + /** ShortRepresentation description. */ + public description: string; + + /** ShortRepresentation subqueries. */ + public subqueries: { [k: string]: number }; + + /** + * Creates a new ShortRepresentation instance using the specified properties. + * @param [properties] Properties to set + * @returns ShortRepresentation instance + */ + public static create(properties?: google.spanner.v1.PlanNode.IShortRepresentation): google.spanner.v1.PlanNode.ShortRepresentation; + + /** + * Encodes the specified ShortRepresentation message. Does not implicitly {@link google.spanner.v1.PlanNode.ShortRepresentation.verify|verify} messages. + * @param message ShortRepresentation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.PlanNode.IShortRepresentation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ShortRepresentation message, length delimited. Does not implicitly {@link google.spanner.v1.PlanNode.ShortRepresentation.verify|verify} messages. + * @param message ShortRepresentation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.PlanNode.IShortRepresentation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ShortRepresentation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ShortRepresentation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.PlanNode.ShortRepresentation; + + /** + * Decodes a ShortRepresentation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ShortRepresentation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.PlanNode.ShortRepresentation; + + /** + * Verifies a ShortRepresentation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ShortRepresentation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ShortRepresentation + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.PlanNode.ShortRepresentation; + + /** + * Creates a plain object from a ShortRepresentation message. Also converts values to other types if specified. + * @param message ShortRepresentation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.PlanNode.ShortRepresentation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ShortRepresentation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ShortRepresentation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a QueryAdvisorResult. */ + interface IQueryAdvisorResult { + + /** QueryAdvisorResult indexAdvice */ + indexAdvice?: (google.spanner.v1.QueryAdvisorResult.IIndexAdvice[]|null); + } + + /** Represents a QueryAdvisorResult. */ + class QueryAdvisorResult implements IQueryAdvisorResult { + + /** + * Constructs a new QueryAdvisorResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.IQueryAdvisorResult); + + /** QueryAdvisorResult indexAdvice. */ + public indexAdvice: google.spanner.v1.QueryAdvisorResult.IIndexAdvice[]; + + /** + * Creates a new QueryAdvisorResult instance using the specified properties. + * @param [properties] Properties to set + * @returns QueryAdvisorResult instance + */ + public static create(properties?: google.spanner.v1.IQueryAdvisorResult): google.spanner.v1.QueryAdvisorResult; + + /** + * Encodes the specified QueryAdvisorResult message. Does not implicitly {@link google.spanner.v1.QueryAdvisorResult.verify|verify} messages. + * @param message QueryAdvisorResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.IQueryAdvisorResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QueryAdvisorResult message, length delimited. Does not implicitly {@link google.spanner.v1.QueryAdvisorResult.verify|verify} messages. + * @param message QueryAdvisorResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.IQueryAdvisorResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QueryAdvisorResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QueryAdvisorResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.QueryAdvisorResult; + + /** + * Decodes a QueryAdvisorResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QueryAdvisorResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.QueryAdvisorResult; + + /** + * Verifies a QueryAdvisorResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a QueryAdvisorResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QueryAdvisorResult + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.QueryAdvisorResult; + + /** + * Creates a plain object from a QueryAdvisorResult message. Also converts values to other types if specified. + * @param message QueryAdvisorResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.QueryAdvisorResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QueryAdvisorResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for QueryAdvisorResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace QueryAdvisorResult { + + /** Properties of an IndexAdvice. */ + interface IIndexAdvice { + + /** IndexAdvice ddl */ + ddl?: (string[]|null); + + /** IndexAdvice improvementFactor */ + improvementFactor?: (number|null); + } + + /** Represents an IndexAdvice. */ + class IndexAdvice implements IIndexAdvice { + + /** + * Constructs a new IndexAdvice. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.QueryAdvisorResult.IIndexAdvice); + + /** IndexAdvice ddl. */ + public ddl: string[]; + + /** IndexAdvice improvementFactor. */ + public improvementFactor: number; + + /** + * Creates a new IndexAdvice instance using the specified properties. + * @param [properties] Properties to set + * @returns IndexAdvice instance + */ + public static create(properties?: google.spanner.v1.QueryAdvisorResult.IIndexAdvice): google.spanner.v1.QueryAdvisorResult.IndexAdvice; + + /** + * Encodes the specified IndexAdvice message. Does not implicitly {@link google.spanner.v1.QueryAdvisorResult.IndexAdvice.verify|verify} messages. + * @param message IndexAdvice message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.QueryAdvisorResult.IIndexAdvice, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IndexAdvice message, length delimited. Does not implicitly {@link google.spanner.v1.QueryAdvisorResult.IndexAdvice.verify|verify} messages. + * @param message IndexAdvice message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.QueryAdvisorResult.IIndexAdvice, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IndexAdvice message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IndexAdvice + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.QueryAdvisorResult.IndexAdvice; + + /** + * Decodes an IndexAdvice message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IndexAdvice + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.QueryAdvisorResult.IndexAdvice; + + /** + * Verifies an IndexAdvice message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an IndexAdvice message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IndexAdvice + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.QueryAdvisorResult.IndexAdvice; + + /** + * Creates a plain object from an IndexAdvice message. Also converts values to other types if specified. + * @param message IndexAdvice + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.QueryAdvisorResult.IndexAdvice, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IndexAdvice to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IndexAdvice + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a QueryPlan. */ + interface IQueryPlan { + + /** QueryPlan planNodes */ + planNodes?: (google.spanner.v1.IPlanNode[]|null); + + /** QueryPlan queryAdvice */ + queryAdvice?: (google.spanner.v1.IQueryAdvisorResult|null); + } + + /** Represents a QueryPlan. */ + class QueryPlan implements IQueryPlan { + + /** + * Constructs a new QueryPlan. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.IQueryPlan); + + /** QueryPlan planNodes. */ + public planNodes: google.spanner.v1.IPlanNode[]; + + /** QueryPlan queryAdvice. */ + public queryAdvice?: (google.spanner.v1.IQueryAdvisorResult|null); + + /** + * Creates a new QueryPlan instance using the specified properties. + * @param [properties] Properties to set + * @returns QueryPlan instance + */ + public static create(properties?: google.spanner.v1.IQueryPlan): google.spanner.v1.QueryPlan; + + /** + * Encodes the specified QueryPlan message. Does not implicitly {@link google.spanner.v1.QueryPlan.verify|verify} messages. + * @param message QueryPlan message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.IQueryPlan, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QueryPlan message, length delimited. Does not implicitly {@link google.spanner.v1.QueryPlan.verify|verify} messages. + * @param message QueryPlan message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.IQueryPlan, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QueryPlan message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QueryPlan + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.QueryPlan; + + /** + * Decodes a QueryPlan message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QueryPlan + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.QueryPlan; + + /** + * Verifies a QueryPlan message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a QueryPlan message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QueryPlan + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.QueryPlan; + + /** + * Creates a plain object from a QueryPlan message. Also converts values to other types if specified. + * @param message QueryPlan + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.QueryPlan, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QueryPlan to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for QueryPlan + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ResultSet. */ + interface IResultSet { + + /** ResultSet metadata */ + metadata?: (google.spanner.v1.IResultSetMetadata|null); + + /** ResultSet rows */ + rows?: (google.protobuf.IListValue[]|null); + + /** ResultSet stats */ + stats?: (google.spanner.v1.IResultSetStats|null); + + /** ResultSet precommitToken */ + precommitToken?: (google.spanner.v1.IMultiplexedSessionPrecommitToken|null); + + /** ResultSet cacheUpdate */ + cacheUpdate?: (google.spanner.v1.ICacheUpdate|null); + } + + /** Represents a ResultSet. */ + class ResultSet implements IResultSet { + + /** + * Constructs a new ResultSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.IResultSet); + + /** ResultSet metadata. */ + public metadata?: (google.spanner.v1.IResultSetMetadata|null); + + /** ResultSet rows. */ + public rows: google.protobuf.IListValue[]; + + /** ResultSet stats. */ + public stats?: (google.spanner.v1.IResultSetStats|null); + + /** ResultSet precommitToken. */ + public precommitToken?: (google.spanner.v1.IMultiplexedSessionPrecommitToken|null); + + /** ResultSet cacheUpdate. */ + public cacheUpdate?: (google.spanner.v1.ICacheUpdate|null); + + /** + * Creates a new ResultSet instance using the specified properties. + * @param [properties] Properties to set + * @returns ResultSet instance + */ + public static create(properties?: google.spanner.v1.IResultSet): google.spanner.v1.ResultSet; + + /** + * Encodes the specified ResultSet message. Does not implicitly {@link google.spanner.v1.ResultSet.verify|verify} messages. + * @param message ResultSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.IResultSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResultSet message, length delimited. Does not implicitly {@link google.spanner.v1.ResultSet.verify|verify} messages. + * @param message ResultSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.IResultSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResultSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResultSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.ResultSet; + + /** + * Decodes a ResultSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResultSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.ResultSet; + + /** + * Verifies a ResultSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResultSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResultSet + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.ResultSet; + + /** + * Creates a plain object from a ResultSet message. Also converts values to other types if specified. + * @param message ResultSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.ResultSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResultSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResultSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PartialResultSet. */ + interface IPartialResultSet { + + /** PartialResultSet metadata */ + metadata?: (google.spanner.v1.IResultSetMetadata|null); + + /** PartialResultSet values */ + values?: (google.protobuf.IValue[]|null); + + /** PartialResultSet chunkedValue */ + chunkedValue?: (boolean|null); + + /** PartialResultSet resumeToken */ + resumeToken?: (Uint8Array|Buffer|string|null); + + /** PartialResultSet stats */ + stats?: (google.spanner.v1.IResultSetStats|null); + + /** PartialResultSet precommitToken */ + precommitToken?: (google.spanner.v1.IMultiplexedSessionPrecommitToken|null); + + /** PartialResultSet last */ + last?: (boolean|null); + + /** PartialResultSet cacheUpdate */ + cacheUpdate?: (google.spanner.v1.ICacheUpdate|null); + } + + /** Represents a PartialResultSet. */ + class PartialResultSet implements IPartialResultSet { + + /** + * Constructs a new PartialResultSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.IPartialResultSet); + + /** PartialResultSet metadata. */ + public metadata?: (google.spanner.v1.IResultSetMetadata|null); + + /** PartialResultSet values. */ + public values: google.protobuf.IValue[]; + + /** PartialResultSet chunkedValue. */ + public chunkedValue: boolean; + + /** PartialResultSet resumeToken. */ + public resumeToken: (Uint8Array|Buffer|string); + + /** PartialResultSet stats. */ + public stats?: (google.spanner.v1.IResultSetStats|null); + + /** PartialResultSet precommitToken. */ + public precommitToken?: (google.spanner.v1.IMultiplexedSessionPrecommitToken|null); + + /** PartialResultSet last. */ + public last: boolean; + + /** PartialResultSet cacheUpdate. */ + public cacheUpdate?: (google.spanner.v1.ICacheUpdate|null); + + /** + * Creates a new PartialResultSet instance using the specified properties. + * @param [properties] Properties to set + * @returns PartialResultSet instance + */ + public static create(properties?: google.spanner.v1.IPartialResultSet): google.spanner.v1.PartialResultSet; + + /** + * Encodes the specified PartialResultSet message. Does not implicitly {@link google.spanner.v1.PartialResultSet.verify|verify} messages. + * @param message PartialResultSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.IPartialResultSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PartialResultSet message, length delimited. Does not implicitly {@link google.spanner.v1.PartialResultSet.verify|verify} messages. + * @param message PartialResultSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.IPartialResultSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PartialResultSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PartialResultSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.PartialResultSet; + + /** + * Decodes a PartialResultSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PartialResultSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.PartialResultSet; + + /** + * Verifies a PartialResultSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PartialResultSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PartialResultSet + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.PartialResultSet; + + /** + * Creates a plain object from a PartialResultSet message. Also converts values to other types if specified. + * @param message PartialResultSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.PartialResultSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PartialResultSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PartialResultSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ResultSetMetadata. */ + interface IResultSetMetadata { + + /** ResultSetMetadata rowType */ + rowType?: (google.spanner.v1.IStructType|null); + + /** ResultSetMetadata transaction */ + transaction?: (google.spanner.v1.ITransaction|null); + + /** ResultSetMetadata undeclaredParameters */ + undeclaredParameters?: (google.spanner.v1.IStructType|null); + } + + /** Represents a ResultSetMetadata. */ + class ResultSetMetadata implements IResultSetMetadata { + + /** + * Constructs a new ResultSetMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.IResultSetMetadata); + + /** ResultSetMetadata rowType. */ + public rowType?: (google.spanner.v1.IStructType|null); + + /** ResultSetMetadata transaction. */ + public transaction?: (google.spanner.v1.ITransaction|null); + + /** ResultSetMetadata undeclaredParameters. */ + public undeclaredParameters?: (google.spanner.v1.IStructType|null); + + /** + * Creates a new ResultSetMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ResultSetMetadata instance + */ + public static create(properties?: google.spanner.v1.IResultSetMetadata): google.spanner.v1.ResultSetMetadata; + + /** + * Encodes the specified ResultSetMetadata message. Does not implicitly {@link google.spanner.v1.ResultSetMetadata.verify|verify} messages. + * @param message ResultSetMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.IResultSetMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResultSetMetadata message, length delimited. Does not implicitly {@link google.spanner.v1.ResultSetMetadata.verify|verify} messages. + * @param message ResultSetMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.IResultSetMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResultSetMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResultSetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.ResultSetMetadata; + + /** + * Decodes a ResultSetMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResultSetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.ResultSetMetadata; + + /** + * Verifies a ResultSetMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResultSetMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResultSetMetadata + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.ResultSetMetadata; + + /** + * Creates a plain object from a ResultSetMetadata message. Also converts values to other types if specified. + * @param message ResultSetMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.ResultSetMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResultSetMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResultSetMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ResultSetStats. */ + interface IResultSetStats { + + /** ResultSetStats queryPlan */ + queryPlan?: (google.spanner.v1.IQueryPlan|null); + + /** ResultSetStats queryStats */ + queryStats?: (google.protobuf.IStruct|null); + + /** ResultSetStats rowCountExact */ + rowCountExact?: (number|Long|string|null); + + /** ResultSetStats rowCountLowerBound */ + rowCountLowerBound?: (number|Long|string|null); + } + + /** Represents a ResultSetStats. */ + class ResultSetStats implements IResultSetStats { + + /** + * Constructs a new ResultSetStats. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.IResultSetStats); + + /** ResultSetStats queryPlan. */ + public queryPlan?: (google.spanner.v1.IQueryPlan|null); + + /** ResultSetStats queryStats. */ + public queryStats?: (google.protobuf.IStruct|null); + + /** ResultSetStats rowCountExact. */ + public rowCountExact?: (number|Long|string|null); + + /** ResultSetStats rowCountLowerBound. */ + public rowCountLowerBound?: (number|Long|string|null); + + /** ResultSetStats rowCount. */ + public rowCount?: ("rowCountExact"|"rowCountLowerBound"); + + /** + * Creates a new ResultSetStats instance using the specified properties. + * @param [properties] Properties to set + * @returns ResultSetStats instance + */ + public static create(properties?: google.spanner.v1.IResultSetStats): google.spanner.v1.ResultSetStats; + + /** + * Encodes the specified ResultSetStats message. Does not implicitly {@link google.spanner.v1.ResultSetStats.verify|verify} messages. + * @param message ResultSetStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.IResultSetStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResultSetStats message, length delimited. Does not implicitly {@link google.spanner.v1.ResultSetStats.verify|verify} messages. + * @param message ResultSetStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.IResultSetStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResultSetStats message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResultSetStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.ResultSetStats; + + /** + * Decodes a ResultSetStats message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResultSetStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.ResultSetStats; + + /** + * Verifies a ResultSetStats message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResultSetStats message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResultSetStats + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.ResultSetStats; + + /** + * Creates a plain object from a ResultSetStats message. Also converts values to other types if specified. + * @param message ResultSetStats + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.ResultSetStats, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResultSetStats to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResultSetStats + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a Spanner */ + class Spanner extends $protobuf.rpc.Service { + + /** + * Constructs a new Spanner service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Spanner 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): Spanner; + + /** + * Calls CreateSession. + * @param request CreateSessionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Session + */ + public createSession(request: google.spanner.v1.ICreateSessionRequest, callback: google.spanner.v1.Spanner.CreateSessionCallback): void; + + /** + * Calls CreateSession. + * @param request CreateSessionRequest message or plain object + * @returns Promise + */ + public createSession(request: google.spanner.v1.ICreateSessionRequest): Promise; + + /** + * Calls BatchCreateSessions. + * @param request BatchCreateSessionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and BatchCreateSessionsResponse + */ + public batchCreateSessions(request: google.spanner.v1.IBatchCreateSessionsRequest, callback: google.spanner.v1.Spanner.BatchCreateSessionsCallback): void; + + /** + * Calls BatchCreateSessions. + * @param request BatchCreateSessionsRequest message or plain object + * @returns Promise + */ + public batchCreateSessions(request: google.spanner.v1.IBatchCreateSessionsRequest): Promise; + + /** + * Calls GetSession. + * @param request GetSessionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Session + */ + public getSession(request: google.spanner.v1.IGetSessionRequest, callback: google.spanner.v1.Spanner.GetSessionCallback): void; + + /** + * Calls GetSession. + * @param request GetSessionRequest message or plain object + * @returns Promise + */ + public getSession(request: google.spanner.v1.IGetSessionRequest): Promise; + + /** + * Calls ListSessions. + * @param request ListSessionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListSessionsResponse + */ + public listSessions(request: google.spanner.v1.IListSessionsRequest, callback: google.spanner.v1.Spanner.ListSessionsCallback): void; + + /** + * Calls ListSessions. + * @param request ListSessionsRequest message or plain object + * @returns Promise + */ + public listSessions(request: google.spanner.v1.IListSessionsRequest): Promise; + + /** + * Calls DeleteSession. + * @param request DeleteSessionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteSession(request: google.spanner.v1.IDeleteSessionRequest, callback: google.spanner.v1.Spanner.DeleteSessionCallback): void; + + /** + * Calls DeleteSession. + * @param request DeleteSessionRequest message or plain object + * @returns Promise + */ + public deleteSession(request: google.spanner.v1.IDeleteSessionRequest): Promise; + + /** + * Calls ExecuteSql. + * @param request ExecuteSqlRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ResultSet + */ + public executeSql(request: google.spanner.v1.IExecuteSqlRequest, callback: google.spanner.v1.Spanner.ExecuteSqlCallback): void; + + /** + * Calls ExecuteSql. + * @param request ExecuteSqlRequest message or plain object + * @returns Promise + */ + public executeSql(request: google.spanner.v1.IExecuteSqlRequest): Promise; + + /** + * Calls ExecuteStreamingSql. + * @param request ExecuteSqlRequest message or plain object + * @param callback Node-style callback called with the error, if any, and PartialResultSet + */ + public executeStreamingSql(request: google.spanner.v1.IExecuteSqlRequest, callback: google.spanner.v1.Spanner.ExecuteStreamingSqlCallback): void; + + /** + * Calls ExecuteStreamingSql. + * @param request ExecuteSqlRequest message or plain object + * @returns Promise + */ + public executeStreamingSql(request: google.spanner.v1.IExecuteSqlRequest): Promise; + + /** + * Calls ExecuteBatchDml. + * @param request ExecuteBatchDmlRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ExecuteBatchDmlResponse + */ + public executeBatchDml(request: google.spanner.v1.IExecuteBatchDmlRequest, callback: google.spanner.v1.Spanner.ExecuteBatchDmlCallback): void; + + /** + * Calls ExecuteBatchDml. + * @param request ExecuteBatchDmlRequest message or plain object + * @returns Promise + */ + public executeBatchDml(request: google.spanner.v1.IExecuteBatchDmlRequest): Promise; + + /** + * Calls Read. + * @param request ReadRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ResultSet + */ + public read(request: google.spanner.v1.IReadRequest, callback: google.spanner.v1.Spanner.ReadCallback): void; + + /** + * Calls Read. + * @param request ReadRequest message or plain object + * @returns Promise + */ + public read(request: google.spanner.v1.IReadRequest): Promise; + + /** + * Calls StreamingRead. + * @param request ReadRequest message or plain object + * @param callback Node-style callback called with the error, if any, and PartialResultSet + */ + public streamingRead(request: google.spanner.v1.IReadRequest, callback: google.spanner.v1.Spanner.StreamingReadCallback): void; + + /** + * Calls StreamingRead. + * @param request ReadRequest message or plain object + * @returns Promise + */ + public streamingRead(request: google.spanner.v1.IReadRequest): Promise; + + /** + * Calls BeginTransaction. + * @param request BeginTransactionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Transaction + */ + public beginTransaction(request: google.spanner.v1.IBeginTransactionRequest, callback: google.spanner.v1.Spanner.BeginTransactionCallback): void; + + /** + * Calls BeginTransaction. + * @param request BeginTransactionRequest message or plain object + * @returns Promise + */ + public beginTransaction(request: google.spanner.v1.IBeginTransactionRequest): Promise; + + /** + * Calls Commit. + * @param request CommitRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CommitResponse + */ + public commit(request: google.spanner.v1.ICommitRequest, callback: google.spanner.v1.Spanner.CommitCallback): void; + + /** + * Calls Commit. + * @param request CommitRequest message or plain object + * @returns Promise + */ + public commit(request: google.spanner.v1.ICommitRequest): Promise; + + /** + * Calls Rollback. + * @param request RollbackRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public rollback(request: google.spanner.v1.IRollbackRequest, callback: google.spanner.v1.Spanner.RollbackCallback): void; + + /** + * Calls Rollback. + * @param request RollbackRequest message or plain object + * @returns Promise + */ + public rollback(request: google.spanner.v1.IRollbackRequest): Promise; + + /** + * Calls PartitionQuery. + * @param request PartitionQueryRequest message or plain object + * @param callback Node-style callback called with the error, if any, and PartitionResponse + */ + public partitionQuery(request: google.spanner.v1.IPartitionQueryRequest, callback: google.spanner.v1.Spanner.PartitionQueryCallback): void; + + /** + * Calls PartitionQuery. + * @param request PartitionQueryRequest message or plain object + * @returns Promise + */ + public partitionQuery(request: google.spanner.v1.IPartitionQueryRequest): Promise; + + /** + * Calls PartitionRead. + * @param request PartitionReadRequest message or plain object + * @param callback Node-style callback called with the error, if any, and PartitionResponse + */ + public partitionRead(request: google.spanner.v1.IPartitionReadRequest, callback: google.spanner.v1.Spanner.PartitionReadCallback): void; + + /** + * Calls PartitionRead. + * @param request PartitionReadRequest message or plain object + * @returns Promise + */ + public partitionRead(request: google.spanner.v1.IPartitionReadRequest): Promise; + + /** + * Calls BatchWrite. + * @param request BatchWriteRequest message or plain object + * @param callback Node-style callback called with the error, if any, and BatchWriteResponse + */ + public batchWrite(request: google.spanner.v1.IBatchWriteRequest, callback: google.spanner.v1.Spanner.BatchWriteCallback): void; + + /** + * Calls BatchWrite. + * @param request BatchWriteRequest message or plain object + * @returns Promise + */ + public batchWrite(request: google.spanner.v1.IBatchWriteRequest): Promise; + } + + namespace Spanner { + + /** + * Callback as used by {@link google.spanner.v1.Spanner|createSession}. + * @param error Error, if any + * @param [response] Session + */ + type CreateSessionCallback = (error: (Error|null), response?: google.spanner.v1.Session) => void; + + /** + * Callback as used by {@link google.spanner.v1.Spanner|batchCreateSessions}. + * @param error Error, if any + * @param [response] BatchCreateSessionsResponse + */ + type BatchCreateSessionsCallback = (error: (Error|null), response?: google.spanner.v1.BatchCreateSessionsResponse) => void; + + /** + * Callback as used by {@link google.spanner.v1.Spanner|getSession}. + * @param error Error, if any + * @param [response] Session + */ + type GetSessionCallback = (error: (Error|null), response?: google.spanner.v1.Session) => void; + + /** + * Callback as used by {@link google.spanner.v1.Spanner|listSessions}. + * @param error Error, if any + * @param [response] ListSessionsResponse + */ + type ListSessionsCallback = (error: (Error|null), response?: google.spanner.v1.ListSessionsResponse) => void; + + /** + * Callback as used by {@link google.spanner.v1.Spanner|deleteSession}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteSessionCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.spanner.v1.Spanner|executeSql}. + * @param error Error, if any + * @param [response] ResultSet + */ + type ExecuteSqlCallback = (error: (Error|null), response?: google.spanner.v1.ResultSet) => void; + + /** + * Callback as used by {@link google.spanner.v1.Spanner|executeStreamingSql}. + * @param error Error, if any + * @param [response] PartialResultSet + */ + type ExecuteStreamingSqlCallback = (error: (Error|null), response?: google.spanner.v1.PartialResultSet) => void; + + /** + * Callback as used by {@link google.spanner.v1.Spanner|executeBatchDml}. + * @param error Error, if any + * @param [response] ExecuteBatchDmlResponse + */ + type ExecuteBatchDmlCallback = (error: (Error|null), response?: google.spanner.v1.ExecuteBatchDmlResponse) => void; + + /** + * Callback as used by {@link google.spanner.v1.Spanner|read}. + * @param error Error, if any + * @param [response] ResultSet + */ + type ReadCallback = (error: (Error|null), response?: google.spanner.v1.ResultSet) => void; + + /** + * Callback as used by {@link google.spanner.v1.Spanner|streamingRead}. + * @param error Error, if any + * @param [response] PartialResultSet + */ + type StreamingReadCallback = (error: (Error|null), response?: google.spanner.v1.PartialResultSet) => void; + + /** + * Callback as used by {@link google.spanner.v1.Spanner|beginTransaction}. + * @param error Error, if any + * @param [response] Transaction + */ + type BeginTransactionCallback = (error: (Error|null), response?: google.spanner.v1.Transaction) => void; + + /** + * Callback as used by {@link google.spanner.v1.Spanner|commit}. + * @param error Error, if any + * @param [response] CommitResponse + */ + type CommitCallback = (error: (Error|null), response?: google.spanner.v1.CommitResponse) => void; + + /** + * Callback as used by {@link google.spanner.v1.Spanner|rollback}. + * @param error Error, if any + * @param [response] Empty + */ + type RollbackCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.spanner.v1.Spanner|partitionQuery}. + * @param error Error, if any + * @param [response] PartitionResponse + */ + type PartitionQueryCallback = (error: (Error|null), response?: google.spanner.v1.PartitionResponse) => void; + + /** + * Callback as used by {@link google.spanner.v1.Spanner|partitionRead}. + * @param error Error, if any + * @param [response] PartitionResponse + */ + type PartitionReadCallback = (error: (Error|null), response?: google.spanner.v1.PartitionResponse) => void; + + /** + * Callback as used by {@link google.spanner.v1.Spanner|batchWrite}. + * @param error Error, if any + * @param [response] BatchWriteResponse + */ + type BatchWriteCallback = (error: (Error|null), response?: google.spanner.v1.BatchWriteResponse) => void; + } + + /** Properties of a CreateSessionRequest. */ + interface ICreateSessionRequest { + + /** CreateSessionRequest database */ + database?: (string|null); + + /** CreateSessionRequest session */ + session?: (google.spanner.v1.ISession|null); + } + + /** Represents a CreateSessionRequest. */ + class CreateSessionRequest implements ICreateSessionRequest { + + /** + * Constructs a new CreateSessionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.ICreateSessionRequest); + + /** CreateSessionRequest database. */ + public database: string; + + /** CreateSessionRequest session. */ + public session?: (google.spanner.v1.ISession|null); + + /** + * Creates a new CreateSessionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateSessionRequest instance + */ + public static create(properties?: google.spanner.v1.ICreateSessionRequest): google.spanner.v1.CreateSessionRequest; + + /** + * Encodes the specified CreateSessionRequest message. Does not implicitly {@link google.spanner.v1.CreateSessionRequest.verify|verify} messages. + * @param message CreateSessionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.ICreateSessionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateSessionRequest message, length delimited. Does not implicitly {@link google.spanner.v1.CreateSessionRequest.verify|verify} messages. + * @param message CreateSessionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.ICreateSessionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateSessionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateSessionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.CreateSessionRequest; + + /** + * Decodes a CreateSessionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateSessionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.CreateSessionRequest; + + /** + * Verifies a CreateSessionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateSessionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateSessionRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.CreateSessionRequest; + + /** + * Creates a plain object from a CreateSessionRequest message. Also converts values to other types if specified. + * @param message CreateSessionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.CreateSessionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateSessionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateSessionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchCreateSessionsRequest. */ + interface IBatchCreateSessionsRequest { + + /** BatchCreateSessionsRequest database */ + database?: (string|null); + + /** BatchCreateSessionsRequest sessionTemplate */ + sessionTemplate?: (google.spanner.v1.ISession|null); + + /** BatchCreateSessionsRequest sessionCount */ + sessionCount?: (number|null); + } + + /** Represents a BatchCreateSessionsRequest. */ + class BatchCreateSessionsRequest implements IBatchCreateSessionsRequest { + + /** + * Constructs a new BatchCreateSessionsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.IBatchCreateSessionsRequest); + + /** BatchCreateSessionsRequest database. */ + public database: string; + + /** BatchCreateSessionsRequest sessionTemplate. */ + public sessionTemplate?: (google.spanner.v1.ISession|null); + + /** BatchCreateSessionsRequest sessionCount. */ + public sessionCount: number; + + /** + * Creates a new BatchCreateSessionsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchCreateSessionsRequest instance + */ + public static create(properties?: google.spanner.v1.IBatchCreateSessionsRequest): google.spanner.v1.BatchCreateSessionsRequest; + + /** + * Encodes the specified BatchCreateSessionsRequest message. Does not implicitly {@link google.spanner.v1.BatchCreateSessionsRequest.verify|verify} messages. + * @param message BatchCreateSessionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.IBatchCreateSessionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchCreateSessionsRequest message, length delimited. Does not implicitly {@link google.spanner.v1.BatchCreateSessionsRequest.verify|verify} messages. + * @param message BatchCreateSessionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.IBatchCreateSessionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchCreateSessionsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchCreateSessionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.BatchCreateSessionsRequest; + + /** + * Decodes a BatchCreateSessionsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchCreateSessionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.BatchCreateSessionsRequest; + + /** + * Verifies a BatchCreateSessionsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchCreateSessionsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchCreateSessionsRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.BatchCreateSessionsRequest; + + /** + * Creates a plain object from a BatchCreateSessionsRequest message. Also converts values to other types if specified. + * @param message BatchCreateSessionsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.BatchCreateSessionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchCreateSessionsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchCreateSessionsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchCreateSessionsResponse. */ + interface IBatchCreateSessionsResponse { + + /** BatchCreateSessionsResponse session */ + session?: (google.spanner.v1.ISession[]|null); + } + + /** Represents a BatchCreateSessionsResponse. */ + class BatchCreateSessionsResponse implements IBatchCreateSessionsResponse { + + /** + * Constructs a new BatchCreateSessionsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.IBatchCreateSessionsResponse); + + /** BatchCreateSessionsResponse session. */ + public session: google.spanner.v1.ISession[]; + + /** + * Creates a new BatchCreateSessionsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchCreateSessionsResponse instance + */ + public static create(properties?: google.spanner.v1.IBatchCreateSessionsResponse): google.spanner.v1.BatchCreateSessionsResponse; + + /** + * Encodes the specified BatchCreateSessionsResponse message. Does not implicitly {@link google.spanner.v1.BatchCreateSessionsResponse.verify|verify} messages. + * @param message BatchCreateSessionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.IBatchCreateSessionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchCreateSessionsResponse message, length delimited. Does not implicitly {@link google.spanner.v1.BatchCreateSessionsResponse.verify|verify} messages. + * @param message BatchCreateSessionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.IBatchCreateSessionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchCreateSessionsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchCreateSessionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.BatchCreateSessionsResponse; + + /** + * Decodes a BatchCreateSessionsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchCreateSessionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.BatchCreateSessionsResponse; + + /** + * Verifies a BatchCreateSessionsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchCreateSessionsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchCreateSessionsResponse + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.BatchCreateSessionsResponse; + + /** + * Creates a plain object from a BatchCreateSessionsResponse message. Also converts values to other types if specified. + * @param message BatchCreateSessionsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.BatchCreateSessionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchCreateSessionsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchCreateSessionsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Session. */ + interface ISession { + + /** Session name */ + name?: (string|null); + + /** Session labels */ + labels?: ({ [k: string]: string }|null); + + /** Session createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Session approximateLastUseTime */ + approximateLastUseTime?: (google.protobuf.ITimestamp|null); + + /** Session creatorRole */ + creatorRole?: (string|null); + + /** Session multiplexed */ + multiplexed?: (boolean|null); + } + + /** Represents a Session. */ + class Session implements ISession { + + /** + * Constructs a new Session. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.ISession); + + /** Session name. */ + public name: string; + + /** Session labels. */ + public labels: { [k: string]: string }; + + /** Session createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Session approximateLastUseTime. */ + public approximateLastUseTime?: (google.protobuf.ITimestamp|null); + + /** Session creatorRole. */ + public creatorRole: string; + + /** Session multiplexed. */ + public multiplexed: boolean; + + /** + * Creates a new Session instance using the specified properties. + * @param [properties] Properties to set + * @returns Session instance + */ + public static create(properties?: google.spanner.v1.ISession): google.spanner.v1.Session; + + /** + * Encodes the specified Session message. Does not implicitly {@link google.spanner.v1.Session.verify|verify} messages. + * @param message Session message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.ISession, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Session message, length delimited. Does not implicitly {@link google.spanner.v1.Session.verify|verify} messages. + * @param message Session message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.ISession, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Session message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Session + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.Session; + + /** + * Decodes a Session message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Session + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.Session; + + /** + * Verifies a Session message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Session message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Session + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.Session; + + /** + * Creates a plain object from a Session message. Also converts values to other types if specified. + * @param message Session + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.Session, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Session to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Session + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetSessionRequest. */ + interface IGetSessionRequest { + + /** GetSessionRequest name */ + name?: (string|null); + } + + /** Represents a GetSessionRequest. */ + class GetSessionRequest implements IGetSessionRequest { + + /** + * Constructs a new GetSessionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.IGetSessionRequest); + + /** GetSessionRequest name. */ + public name: string; + + /** + * Creates a new GetSessionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetSessionRequest instance + */ + public static create(properties?: google.spanner.v1.IGetSessionRequest): google.spanner.v1.GetSessionRequest; + + /** + * Encodes the specified GetSessionRequest message. Does not implicitly {@link google.spanner.v1.GetSessionRequest.verify|verify} messages. + * @param message GetSessionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.IGetSessionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetSessionRequest message, length delimited. Does not implicitly {@link google.spanner.v1.GetSessionRequest.verify|verify} messages. + * @param message GetSessionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.IGetSessionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetSessionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetSessionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.GetSessionRequest; + + /** + * Decodes a GetSessionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetSessionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.GetSessionRequest; + + /** + * Verifies a GetSessionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetSessionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetSessionRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.GetSessionRequest; + + /** + * Creates a plain object from a GetSessionRequest message. Also converts values to other types if specified. + * @param message GetSessionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.GetSessionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetSessionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetSessionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListSessionsRequest. */ + interface IListSessionsRequest { + + /** ListSessionsRequest database */ + database?: (string|null); + + /** ListSessionsRequest pageSize */ + pageSize?: (number|null); + + /** ListSessionsRequest pageToken */ + pageToken?: (string|null); + + /** ListSessionsRequest filter */ + filter?: (string|null); + } + + /** Represents a ListSessionsRequest. */ + class ListSessionsRequest implements IListSessionsRequest { + + /** + * Constructs a new ListSessionsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.IListSessionsRequest); + + /** ListSessionsRequest database. */ + public database: string; + + /** ListSessionsRequest pageSize. */ + public pageSize: number; + + /** ListSessionsRequest pageToken. */ + public pageToken: string; + + /** ListSessionsRequest filter. */ + public filter: string; + + /** + * Creates a new ListSessionsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSessionsRequest instance + */ + public static create(properties?: google.spanner.v1.IListSessionsRequest): google.spanner.v1.ListSessionsRequest; + + /** + * Encodes the specified ListSessionsRequest message. Does not implicitly {@link google.spanner.v1.ListSessionsRequest.verify|verify} messages. + * @param message ListSessionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.IListSessionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSessionsRequest message, length delimited. Does not implicitly {@link google.spanner.v1.ListSessionsRequest.verify|verify} messages. + * @param message ListSessionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.IListSessionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSessionsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSessionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.ListSessionsRequest; + + /** + * Decodes a ListSessionsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSessionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.ListSessionsRequest; + + /** + * Verifies a ListSessionsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListSessionsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSessionsRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.ListSessionsRequest; + + /** + * Creates a plain object from a ListSessionsRequest message. Also converts values to other types if specified. + * @param message ListSessionsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.ListSessionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSessionsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSessionsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListSessionsResponse. */ + interface IListSessionsResponse { + + /** ListSessionsResponse sessions */ + sessions?: (google.spanner.v1.ISession[]|null); + + /** ListSessionsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListSessionsResponse. */ + class ListSessionsResponse implements IListSessionsResponse { + + /** + * Constructs a new ListSessionsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.IListSessionsResponse); + + /** ListSessionsResponse sessions. */ + public sessions: google.spanner.v1.ISession[]; + + /** ListSessionsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListSessionsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSessionsResponse instance + */ + public static create(properties?: google.spanner.v1.IListSessionsResponse): google.spanner.v1.ListSessionsResponse; + + /** + * Encodes the specified ListSessionsResponse message. Does not implicitly {@link google.spanner.v1.ListSessionsResponse.verify|verify} messages. + * @param message ListSessionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.IListSessionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSessionsResponse message, length delimited. Does not implicitly {@link google.spanner.v1.ListSessionsResponse.verify|verify} messages. + * @param message ListSessionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.IListSessionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSessionsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSessionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.ListSessionsResponse; + + /** + * Decodes a ListSessionsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSessionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.ListSessionsResponse; + + /** + * Verifies a ListSessionsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListSessionsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSessionsResponse + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.ListSessionsResponse; + + /** + * Creates a plain object from a ListSessionsResponse message. Also converts values to other types if specified. + * @param message ListSessionsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.ListSessionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSessionsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSessionsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteSessionRequest. */ + interface IDeleteSessionRequest { + + /** DeleteSessionRequest name */ + name?: (string|null); + } + + /** Represents a DeleteSessionRequest. */ + class DeleteSessionRequest implements IDeleteSessionRequest { + + /** + * Constructs a new DeleteSessionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.IDeleteSessionRequest); + + /** DeleteSessionRequest name. */ + public name: string; + + /** + * Creates a new DeleteSessionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteSessionRequest instance + */ + public static create(properties?: google.spanner.v1.IDeleteSessionRequest): google.spanner.v1.DeleteSessionRequest; + + /** + * Encodes the specified DeleteSessionRequest message. Does not implicitly {@link google.spanner.v1.DeleteSessionRequest.verify|verify} messages. + * @param message DeleteSessionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.IDeleteSessionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteSessionRequest message, length delimited. Does not implicitly {@link google.spanner.v1.DeleteSessionRequest.verify|verify} messages. + * @param message DeleteSessionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.IDeleteSessionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteSessionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteSessionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.DeleteSessionRequest; + + /** + * Decodes a DeleteSessionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteSessionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.DeleteSessionRequest; + + /** + * Verifies a DeleteSessionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteSessionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteSessionRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.DeleteSessionRequest; + + /** + * Creates a plain object from a DeleteSessionRequest message. Also converts values to other types if specified. + * @param message DeleteSessionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.DeleteSessionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteSessionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteSessionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RequestOptions. */ + interface IRequestOptions { + + /** RequestOptions priority */ + priority?: (google.spanner.v1.RequestOptions.Priority|keyof typeof google.spanner.v1.RequestOptions.Priority|null); + + /** RequestOptions requestTag */ + requestTag?: (string|null); + + /** RequestOptions transactionTag */ + transactionTag?: (string|null); + + /** RequestOptions clientContext */ + clientContext?: (google.spanner.v1.RequestOptions.IClientContext|null); + } + + /** Represents a RequestOptions. */ + class RequestOptions implements IRequestOptions { + + /** + * Constructs a new RequestOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.IRequestOptions); + + /** RequestOptions priority. */ + public priority: (google.spanner.v1.RequestOptions.Priority|keyof typeof google.spanner.v1.RequestOptions.Priority); + + /** RequestOptions requestTag. */ + public requestTag: string; + + /** RequestOptions transactionTag. */ + public transactionTag: string; + + /** RequestOptions clientContext. */ + public clientContext?: (google.spanner.v1.RequestOptions.IClientContext|null); + + /** + * Creates a new RequestOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns RequestOptions instance + */ + public static create(properties?: google.spanner.v1.IRequestOptions): google.spanner.v1.RequestOptions; + + /** + * Encodes the specified RequestOptions message. Does not implicitly {@link google.spanner.v1.RequestOptions.verify|verify} messages. + * @param message RequestOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.IRequestOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RequestOptions message, length delimited. Does not implicitly {@link google.spanner.v1.RequestOptions.verify|verify} messages. + * @param message RequestOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.IRequestOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RequestOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RequestOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.RequestOptions; + + /** + * Decodes a RequestOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RequestOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.RequestOptions; + + /** + * Verifies a RequestOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RequestOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RequestOptions + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.RequestOptions; + + /** + * Creates a plain object from a RequestOptions message. Also converts values to other types if specified. + * @param message RequestOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.RequestOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RequestOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RequestOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace RequestOptions { + + /** Priority enum. */ + enum Priority { + PRIORITY_UNSPECIFIED = 0, + PRIORITY_LOW = 1, + PRIORITY_MEDIUM = 2, + PRIORITY_HIGH = 3 + } + + /** Properties of a ClientContext. */ + interface IClientContext { + + /** ClientContext secureContext */ + secureContext?: ({ [k: string]: google.protobuf.IValue }|null); + } + + /** Represents a ClientContext. */ + class ClientContext implements IClientContext { + + /** + * Constructs a new ClientContext. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.RequestOptions.IClientContext); + + /** ClientContext secureContext. */ + public secureContext: { [k: string]: google.protobuf.IValue }; + + /** + * Creates a new ClientContext instance using the specified properties. + * @param [properties] Properties to set + * @returns ClientContext instance + */ + public static create(properties?: google.spanner.v1.RequestOptions.IClientContext): google.spanner.v1.RequestOptions.ClientContext; + + /** + * Encodes the specified ClientContext message. Does not implicitly {@link google.spanner.v1.RequestOptions.ClientContext.verify|verify} messages. + * @param message ClientContext message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.RequestOptions.IClientContext, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClientContext message, length delimited. Does not implicitly {@link google.spanner.v1.RequestOptions.ClientContext.verify|verify} messages. + * @param message ClientContext message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.RequestOptions.IClientContext, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClientContext message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClientContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.RequestOptions.ClientContext; + + /** + * Decodes a ClientContext message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClientContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.RequestOptions.ClientContext; + + /** + * Verifies a ClientContext message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ClientContext message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClientContext + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.RequestOptions.ClientContext; + + /** + * Creates a plain object from a ClientContext message. Also converts values to other types if specified. + * @param message ClientContext + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.RequestOptions.ClientContext, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClientContext to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClientContext + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a DirectedReadOptions. */ + interface IDirectedReadOptions { + + /** DirectedReadOptions includeReplicas */ + includeReplicas?: (google.spanner.v1.DirectedReadOptions.IIncludeReplicas|null); + + /** DirectedReadOptions excludeReplicas */ + excludeReplicas?: (google.spanner.v1.DirectedReadOptions.IExcludeReplicas|null); + } + + /** Represents a DirectedReadOptions. */ + class DirectedReadOptions implements IDirectedReadOptions { + + /** + * Constructs a new DirectedReadOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.IDirectedReadOptions); + + /** DirectedReadOptions includeReplicas. */ + public includeReplicas?: (google.spanner.v1.DirectedReadOptions.IIncludeReplicas|null); + + /** DirectedReadOptions excludeReplicas. */ + public excludeReplicas?: (google.spanner.v1.DirectedReadOptions.IExcludeReplicas|null); + + /** DirectedReadOptions replicas. */ + public replicas?: ("includeReplicas"|"excludeReplicas"); + + /** + * Creates a new DirectedReadOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns DirectedReadOptions instance + */ + public static create(properties?: google.spanner.v1.IDirectedReadOptions): google.spanner.v1.DirectedReadOptions; + + /** + * Encodes the specified DirectedReadOptions message. Does not implicitly {@link google.spanner.v1.DirectedReadOptions.verify|verify} messages. + * @param message DirectedReadOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.IDirectedReadOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DirectedReadOptions message, length delimited. Does not implicitly {@link google.spanner.v1.DirectedReadOptions.verify|verify} messages. + * @param message DirectedReadOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.IDirectedReadOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DirectedReadOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DirectedReadOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.DirectedReadOptions; + + /** + * Decodes a DirectedReadOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DirectedReadOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.DirectedReadOptions; + + /** + * Verifies a DirectedReadOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DirectedReadOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DirectedReadOptions + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.DirectedReadOptions; + + /** + * Creates a plain object from a DirectedReadOptions message. Also converts values to other types if specified. + * @param message DirectedReadOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.DirectedReadOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DirectedReadOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DirectedReadOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DirectedReadOptions { + + /** Properties of a ReplicaSelection. */ + interface IReplicaSelection { + + /** ReplicaSelection location */ + location?: (string|null); + + /** ReplicaSelection type */ + type?: (google.spanner.v1.DirectedReadOptions.ReplicaSelection.Type|keyof typeof google.spanner.v1.DirectedReadOptions.ReplicaSelection.Type|null); + } + + /** Represents a ReplicaSelection. */ + class ReplicaSelection implements IReplicaSelection { + + /** + * Constructs a new ReplicaSelection. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.DirectedReadOptions.IReplicaSelection); + + /** ReplicaSelection location. */ + public location: string; + + /** ReplicaSelection type. */ + public type: (google.spanner.v1.DirectedReadOptions.ReplicaSelection.Type|keyof typeof google.spanner.v1.DirectedReadOptions.ReplicaSelection.Type); + + /** + * Creates a new ReplicaSelection instance using the specified properties. + * @param [properties] Properties to set + * @returns ReplicaSelection instance + */ + public static create(properties?: google.spanner.v1.DirectedReadOptions.IReplicaSelection): google.spanner.v1.DirectedReadOptions.ReplicaSelection; + + /** + * Encodes the specified ReplicaSelection message. Does not implicitly {@link google.spanner.v1.DirectedReadOptions.ReplicaSelection.verify|verify} messages. + * @param message ReplicaSelection message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.DirectedReadOptions.IReplicaSelection, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReplicaSelection message, length delimited. Does not implicitly {@link google.spanner.v1.DirectedReadOptions.ReplicaSelection.verify|verify} messages. + * @param message ReplicaSelection message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.DirectedReadOptions.IReplicaSelection, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReplicaSelection message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReplicaSelection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.DirectedReadOptions.ReplicaSelection; + + /** + * Decodes a ReplicaSelection message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReplicaSelection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.DirectedReadOptions.ReplicaSelection; + + /** + * Verifies a ReplicaSelection message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReplicaSelection message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReplicaSelection + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.DirectedReadOptions.ReplicaSelection; + + /** + * Creates a plain object from a ReplicaSelection message. Also converts values to other types if specified. + * @param message ReplicaSelection + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.DirectedReadOptions.ReplicaSelection, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReplicaSelection to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReplicaSelection + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ReplicaSelection { + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + READ_WRITE = 1, + READ_ONLY = 2 + } + } + + /** Properties of an IncludeReplicas. */ + interface IIncludeReplicas { + + /** IncludeReplicas replicaSelections */ + replicaSelections?: (google.spanner.v1.DirectedReadOptions.IReplicaSelection[]|null); + + /** IncludeReplicas autoFailoverDisabled */ + autoFailoverDisabled?: (boolean|null); + } + + /** Represents an IncludeReplicas. */ + class IncludeReplicas implements IIncludeReplicas { + + /** + * Constructs a new IncludeReplicas. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.DirectedReadOptions.IIncludeReplicas); + + /** IncludeReplicas replicaSelections. */ + public replicaSelections: google.spanner.v1.DirectedReadOptions.IReplicaSelection[]; + + /** IncludeReplicas autoFailoverDisabled. */ + public autoFailoverDisabled: boolean; + + /** + * Creates a new IncludeReplicas instance using the specified properties. + * @param [properties] Properties to set + * @returns IncludeReplicas instance + */ + public static create(properties?: google.spanner.v1.DirectedReadOptions.IIncludeReplicas): google.spanner.v1.DirectedReadOptions.IncludeReplicas; + + /** + * Encodes the specified IncludeReplicas message. Does not implicitly {@link google.spanner.v1.DirectedReadOptions.IncludeReplicas.verify|verify} messages. + * @param message IncludeReplicas message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.DirectedReadOptions.IIncludeReplicas, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IncludeReplicas message, length delimited. Does not implicitly {@link google.spanner.v1.DirectedReadOptions.IncludeReplicas.verify|verify} messages. + * @param message IncludeReplicas message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.DirectedReadOptions.IIncludeReplicas, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IncludeReplicas message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IncludeReplicas + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.DirectedReadOptions.IncludeReplicas; + + /** + * Decodes an IncludeReplicas message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IncludeReplicas + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.DirectedReadOptions.IncludeReplicas; + + /** + * Verifies an IncludeReplicas message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an IncludeReplicas message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IncludeReplicas + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.DirectedReadOptions.IncludeReplicas; + + /** + * Creates a plain object from an IncludeReplicas message. Also converts values to other types if specified. + * @param message IncludeReplicas + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.DirectedReadOptions.IncludeReplicas, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IncludeReplicas to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IncludeReplicas + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExcludeReplicas. */ + interface IExcludeReplicas { + + /** ExcludeReplicas replicaSelections */ + replicaSelections?: (google.spanner.v1.DirectedReadOptions.IReplicaSelection[]|null); + } + + /** Represents an ExcludeReplicas. */ + class ExcludeReplicas implements IExcludeReplicas { + + /** + * Constructs a new ExcludeReplicas. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.DirectedReadOptions.IExcludeReplicas); + + /** ExcludeReplicas replicaSelections. */ + public replicaSelections: google.spanner.v1.DirectedReadOptions.IReplicaSelection[]; + + /** + * Creates a new ExcludeReplicas instance using the specified properties. + * @param [properties] Properties to set + * @returns ExcludeReplicas instance + */ + public static create(properties?: google.spanner.v1.DirectedReadOptions.IExcludeReplicas): google.spanner.v1.DirectedReadOptions.ExcludeReplicas; + + /** + * Encodes the specified ExcludeReplicas message. Does not implicitly {@link google.spanner.v1.DirectedReadOptions.ExcludeReplicas.verify|verify} messages. + * @param message ExcludeReplicas message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.DirectedReadOptions.IExcludeReplicas, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExcludeReplicas message, length delimited. Does not implicitly {@link google.spanner.v1.DirectedReadOptions.ExcludeReplicas.verify|verify} messages. + * @param message ExcludeReplicas message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.DirectedReadOptions.IExcludeReplicas, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExcludeReplicas message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExcludeReplicas + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.DirectedReadOptions.ExcludeReplicas; + + /** + * Decodes an ExcludeReplicas message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExcludeReplicas + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.DirectedReadOptions.ExcludeReplicas; + + /** + * Verifies an ExcludeReplicas message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExcludeReplicas message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExcludeReplicas + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.DirectedReadOptions.ExcludeReplicas; + + /** + * Creates a plain object from an ExcludeReplicas message. Also converts values to other types if specified. + * @param message ExcludeReplicas + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.DirectedReadOptions.ExcludeReplicas, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExcludeReplicas to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExcludeReplicas + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ExecuteSqlRequest. */ + interface IExecuteSqlRequest { + + /** ExecuteSqlRequest session */ + session?: (string|null); + + /** ExecuteSqlRequest transaction */ + transaction?: (google.spanner.v1.ITransactionSelector|null); + + /** ExecuteSqlRequest sql */ + sql?: (string|null); + + /** ExecuteSqlRequest params */ + params?: (google.protobuf.IStruct|null); + + /** ExecuteSqlRequest paramTypes */ + paramTypes?: ({ [k: string]: google.spanner.v1.IType }|null); + + /** ExecuteSqlRequest resumeToken */ + resumeToken?: (Uint8Array|Buffer|string|null); + + /** ExecuteSqlRequest queryMode */ + queryMode?: (google.spanner.v1.ExecuteSqlRequest.QueryMode|keyof typeof google.spanner.v1.ExecuteSqlRequest.QueryMode|null); + + /** ExecuteSqlRequest partitionToken */ + partitionToken?: (Uint8Array|Buffer|string|null); + + /** ExecuteSqlRequest seqno */ + seqno?: (number|Long|string|null); + + /** ExecuteSqlRequest queryOptions */ + queryOptions?: (google.spanner.v1.ExecuteSqlRequest.IQueryOptions|null); + + /** ExecuteSqlRequest requestOptions */ + requestOptions?: (google.spanner.v1.IRequestOptions|null); + + /** ExecuteSqlRequest directedReadOptions */ + directedReadOptions?: (google.spanner.v1.IDirectedReadOptions|null); + + /** ExecuteSqlRequest dataBoostEnabled */ + dataBoostEnabled?: (boolean|null); + + /** ExecuteSqlRequest lastStatement */ + lastStatement?: (boolean|null); + + /** ExecuteSqlRequest routingHint */ + routingHint?: (google.spanner.v1.IRoutingHint|null); + } + + /** Represents an ExecuteSqlRequest. */ + class ExecuteSqlRequest implements IExecuteSqlRequest { + + /** + * Constructs a new ExecuteSqlRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.IExecuteSqlRequest); + + /** ExecuteSqlRequest session. */ + public session: string; + + /** ExecuteSqlRequest transaction. */ + public transaction?: (google.spanner.v1.ITransactionSelector|null); + + /** ExecuteSqlRequest sql. */ + public sql: string; + + /** ExecuteSqlRequest params. */ + public params?: (google.protobuf.IStruct|null); + + /** ExecuteSqlRequest paramTypes. */ + public paramTypes: { [k: string]: google.spanner.v1.IType }; + + /** ExecuteSqlRequest resumeToken. */ + public resumeToken: (Uint8Array|Buffer|string); + + /** ExecuteSqlRequest queryMode. */ + public queryMode: (google.spanner.v1.ExecuteSqlRequest.QueryMode|keyof typeof google.spanner.v1.ExecuteSqlRequest.QueryMode); + + /** ExecuteSqlRequest partitionToken. */ + public partitionToken: (Uint8Array|Buffer|string); + + /** ExecuteSqlRequest seqno. */ + public seqno: (number|Long|string); + + /** ExecuteSqlRequest queryOptions. */ + public queryOptions?: (google.spanner.v1.ExecuteSqlRequest.IQueryOptions|null); + + /** ExecuteSqlRequest requestOptions. */ + public requestOptions?: (google.spanner.v1.IRequestOptions|null); + + /** ExecuteSqlRequest directedReadOptions. */ + public directedReadOptions?: (google.spanner.v1.IDirectedReadOptions|null); + + /** ExecuteSqlRequest dataBoostEnabled. */ + public dataBoostEnabled: boolean; + + /** ExecuteSqlRequest lastStatement. */ + public lastStatement: boolean; + + /** ExecuteSqlRequest routingHint. */ + public routingHint?: (google.spanner.v1.IRoutingHint|null); + + /** + * Creates a new ExecuteSqlRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ExecuteSqlRequest instance + */ + public static create(properties?: google.spanner.v1.IExecuteSqlRequest): google.spanner.v1.ExecuteSqlRequest; + + /** + * Encodes the specified ExecuteSqlRequest message. Does not implicitly {@link google.spanner.v1.ExecuteSqlRequest.verify|verify} messages. + * @param message ExecuteSqlRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.IExecuteSqlRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExecuteSqlRequest message, length delimited. Does not implicitly {@link google.spanner.v1.ExecuteSqlRequest.verify|verify} messages. + * @param message ExecuteSqlRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.IExecuteSqlRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExecuteSqlRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExecuteSqlRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.ExecuteSqlRequest; + + /** + * Decodes an ExecuteSqlRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExecuteSqlRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.ExecuteSqlRequest; + + /** + * Verifies an ExecuteSqlRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExecuteSqlRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExecuteSqlRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.ExecuteSqlRequest; + + /** + * Creates a plain object from an ExecuteSqlRequest message. Also converts values to other types if specified. + * @param message ExecuteSqlRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.ExecuteSqlRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExecuteSqlRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExecuteSqlRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ExecuteSqlRequest { + + /** QueryMode enum. */ + enum QueryMode { + NORMAL = 0, + PLAN = 1, + PROFILE = 2, + WITH_STATS = 3, + WITH_PLAN_AND_STATS = 4 + } + + /** Properties of a QueryOptions. */ + interface IQueryOptions { + + /** QueryOptions optimizerVersion */ + optimizerVersion?: (string|null); + + /** QueryOptions optimizerStatisticsPackage */ + optimizerStatisticsPackage?: (string|null); + } + + /** Represents a QueryOptions. */ + class QueryOptions implements IQueryOptions { + + /** + * Constructs a new QueryOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.ExecuteSqlRequest.IQueryOptions); + + /** QueryOptions optimizerVersion. */ + public optimizerVersion: string; + + /** QueryOptions optimizerStatisticsPackage. */ + public optimizerStatisticsPackage: string; + + /** + * Creates a new QueryOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns QueryOptions instance + */ + public static create(properties?: google.spanner.v1.ExecuteSqlRequest.IQueryOptions): google.spanner.v1.ExecuteSqlRequest.QueryOptions; + + /** + * Encodes the specified QueryOptions message. Does not implicitly {@link google.spanner.v1.ExecuteSqlRequest.QueryOptions.verify|verify} messages. + * @param message QueryOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.ExecuteSqlRequest.IQueryOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QueryOptions message, length delimited. Does not implicitly {@link google.spanner.v1.ExecuteSqlRequest.QueryOptions.verify|verify} messages. + * @param message QueryOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.ExecuteSqlRequest.IQueryOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QueryOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QueryOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.ExecuteSqlRequest.QueryOptions; + + /** + * Decodes a QueryOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QueryOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.ExecuteSqlRequest.QueryOptions; + + /** + * Verifies a QueryOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a QueryOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QueryOptions + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.ExecuteSqlRequest.QueryOptions; + + /** + * Creates a plain object from a QueryOptions message. Also converts values to other types if specified. + * @param message QueryOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.ExecuteSqlRequest.QueryOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QueryOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for QueryOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ExecuteBatchDmlRequest. */ + interface IExecuteBatchDmlRequest { + + /** ExecuteBatchDmlRequest session */ + session?: (string|null); + + /** ExecuteBatchDmlRequest transaction */ + transaction?: (google.spanner.v1.ITransactionSelector|null); + + /** ExecuteBatchDmlRequest statements */ + statements?: (google.spanner.v1.ExecuteBatchDmlRequest.IStatement[]|null); + + /** ExecuteBatchDmlRequest seqno */ + seqno?: (number|Long|string|null); + + /** ExecuteBatchDmlRequest requestOptions */ + requestOptions?: (google.spanner.v1.IRequestOptions|null); + + /** ExecuteBatchDmlRequest lastStatements */ + lastStatements?: (boolean|null); + } + + /** Represents an ExecuteBatchDmlRequest. */ + class ExecuteBatchDmlRequest implements IExecuteBatchDmlRequest { + + /** + * Constructs a new ExecuteBatchDmlRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.IExecuteBatchDmlRequest); + + /** ExecuteBatchDmlRequest session. */ + public session: string; + + /** ExecuteBatchDmlRequest transaction. */ + public transaction?: (google.spanner.v1.ITransactionSelector|null); + + /** ExecuteBatchDmlRequest statements. */ + public statements: google.spanner.v1.ExecuteBatchDmlRequest.IStatement[]; + + /** ExecuteBatchDmlRequest seqno. */ + public seqno: (number|Long|string); + + /** ExecuteBatchDmlRequest requestOptions. */ + public requestOptions?: (google.spanner.v1.IRequestOptions|null); + + /** ExecuteBatchDmlRequest lastStatements. */ + public lastStatements: boolean; + + /** + * Creates a new ExecuteBatchDmlRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ExecuteBatchDmlRequest instance + */ + public static create(properties?: google.spanner.v1.IExecuteBatchDmlRequest): google.spanner.v1.ExecuteBatchDmlRequest; + + /** + * Encodes the specified ExecuteBatchDmlRequest message. Does not implicitly {@link google.spanner.v1.ExecuteBatchDmlRequest.verify|verify} messages. + * @param message ExecuteBatchDmlRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.IExecuteBatchDmlRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExecuteBatchDmlRequest message, length delimited. Does not implicitly {@link google.spanner.v1.ExecuteBatchDmlRequest.verify|verify} messages. + * @param message ExecuteBatchDmlRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.IExecuteBatchDmlRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExecuteBatchDmlRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExecuteBatchDmlRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.ExecuteBatchDmlRequest; + + /** + * Decodes an ExecuteBatchDmlRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExecuteBatchDmlRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.ExecuteBatchDmlRequest; + + /** + * Verifies an ExecuteBatchDmlRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExecuteBatchDmlRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExecuteBatchDmlRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.ExecuteBatchDmlRequest; + + /** + * Creates a plain object from an ExecuteBatchDmlRequest message. Also converts values to other types if specified. + * @param message ExecuteBatchDmlRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.ExecuteBatchDmlRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExecuteBatchDmlRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExecuteBatchDmlRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ExecuteBatchDmlRequest { + + /** Properties of a Statement. */ + interface IStatement { + + /** Statement sql */ + sql?: (string|null); + + /** Statement params */ + params?: (google.protobuf.IStruct|null); + + /** Statement paramTypes */ + paramTypes?: ({ [k: string]: google.spanner.v1.IType }|null); + } + + /** Represents a Statement. */ + class Statement implements IStatement { + + /** + * Constructs a new Statement. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.ExecuteBatchDmlRequest.IStatement); + + /** Statement sql. */ + public sql: string; + + /** Statement params. */ + public params?: (google.protobuf.IStruct|null); + + /** Statement paramTypes. */ + public paramTypes: { [k: string]: google.spanner.v1.IType }; + + /** + * Creates a new Statement instance using the specified properties. + * @param [properties] Properties to set + * @returns Statement instance + */ + public static create(properties?: google.spanner.v1.ExecuteBatchDmlRequest.IStatement): google.spanner.v1.ExecuteBatchDmlRequest.Statement; + + /** + * Encodes the specified Statement message. Does not implicitly {@link google.spanner.v1.ExecuteBatchDmlRequest.Statement.verify|verify} messages. + * @param message Statement message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.ExecuteBatchDmlRequest.IStatement, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Statement message, length delimited. Does not implicitly {@link google.spanner.v1.ExecuteBatchDmlRequest.Statement.verify|verify} messages. + * @param message Statement message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.ExecuteBatchDmlRequest.IStatement, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Statement message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Statement + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.ExecuteBatchDmlRequest.Statement; + + /** + * Decodes a Statement message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Statement + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.ExecuteBatchDmlRequest.Statement; + + /** + * Verifies a Statement message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Statement message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Statement + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.ExecuteBatchDmlRequest.Statement; + + /** + * Creates a plain object from a Statement message. Also converts values to other types if specified. + * @param message Statement + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.ExecuteBatchDmlRequest.Statement, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Statement to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Statement + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ExecuteBatchDmlResponse. */ + interface IExecuteBatchDmlResponse { + + /** ExecuteBatchDmlResponse resultSets */ + resultSets?: (google.spanner.v1.IResultSet[]|null); + + /** ExecuteBatchDmlResponse status */ + status?: (google.rpc.IStatus|null); + + /** ExecuteBatchDmlResponse precommitToken */ + precommitToken?: (google.spanner.v1.IMultiplexedSessionPrecommitToken|null); + } + + /** Represents an ExecuteBatchDmlResponse. */ + class ExecuteBatchDmlResponse implements IExecuteBatchDmlResponse { + + /** + * Constructs a new ExecuteBatchDmlResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.IExecuteBatchDmlResponse); + + /** ExecuteBatchDmlResponse resultSets. */ + public resultSets: google.spanner.v1.IResultSet[]; + + /** ExecuteBatchDmlResponse status. */ + public status?: (google.rpc.IStatus|null); + + /** ExecuteBatchDmlResponse precommitToken. */ + public precommitToken?: (google.spanner.v1.IMultiplexedSessionPrecommitToken|null); + + /** + * Creates a new ExecuteBatchDmlResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ExecuteBatchDmlResponse instance + */ + public static create(properties?: google.spanner.v1.IExecuteBatchDmlResponse): google.spanner.v1.ExecuteBatchDmlResponse; + + /** + * Encodes the specified ExecuteBatchDmlResponse message. Does not implicitly {@link google.spanner.v1.ExecuteBatchDmlResponse.verify|verify} messages. + * @param message ExecuteBatchDmlResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.IExecuteBatchDmlResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExecuteBatchDmlResponse message, length delimited. Does not implicitly {@link google.spanner.v1.ExecuteBatchDmlResponse.verify|verify} messages. + * @param message ExecuteBatchDmlResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.IExecuteBatchDmlResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExecuteBatchDmlResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExecuteBatchDmlResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.ExecuteBatchDmlResponse; + + /** + * Decodes an ExecuteBatchDmlResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExecuteBatchDmlResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.ExecuteBatchDmlResponse; + + /** + * Verifies an ExecuteBatchDmlResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExecuteBatchDmlResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExecuteBatchDmlResponse + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.ExecuteBatchDmlResponse; + + /** + * Creates a plain object from an ExecuteBatchDmlResponse message. Also converts values to other types if specified. + * @param message ExecuteBatchDmlResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.ExecuteBatchDmlResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExecuteBatchDmlResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExecuteBatchDmlResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PartitionOptions. */ + interface IPartitionOptions { + + /** PartitionOptions partitionSizeBytes */ + partitionSizeBytes?: (number|Long|string|null); + + /** PartitionOptions maxPartitions */ + maxPartitions?: (number|Long|string|null); + } + + /** Represents a PartitionOptions. */ + class PartitionOptions implements IPartitionOptions { + + /** + * Constructs a new PartitionOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.IPartitionOptions); + + /** PartitionOptions partitionSizeBytes. */ + public partitionSizeBytes: (number|Long|string); + + /** PartitionOptions maxPartitions. */ + public maxPartitions: (number|Long|string); + + /** + * Creates a new PartitionOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns PartitionOptions instance + */ + public static create(properties?: google.spanner.v1.IPartitionOptions): google.spanner.v1.PartitionOptions; + + /** + * Encodes the specified PartitionOptions message. Does not implicitly {@link google.spanner.v1.PartitionOptions.verify|verify} messages. + * @param message PartitionOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.IPartitionOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PartitionOptions message, length delimited. Does not implicitly {@link google.spanner.v1.PartitionOptions.verify|verify} messages. + * @param message PartitionOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.IPartitionOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PartitionOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PartitionOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.PartitionOptions; + + /** + * Decodes a PartitionOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PartitionOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.PartitionOptions; + + /** + * Verifies a PartitionOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PartitionOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PartitionOptions + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.PartitionOptions; + + /** + * Creates a plain object from a PartitionOptions message. Also converts values to other types if specified. + * @param message PartitionOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.PartitionOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PartitionOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PartitionOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PartitionQueryRequest. */ + interface IPartitionQueryRequest { + + /** PartitionQueryRequest session */ + session?: (string|null); + + /** PartitionQueryRequest transaction */ + transaction?: (google.spanner.v1.ITransactionSelector|null); + + /** PartitionQueryRequest sql */ + sql?: (string|null); + + /** PartitionQueryRequest params */ + params?: (google.protobuf.IStruct|null); + + /** PartitionQueryRequest paramTypes */ + paramTypes?: ({ [k: string]: google.spanner.v1.IType }|null); + + /** PartitionQueryRequest partitionOptions */ + partitionOptions?: (google.spanner.v1.IPartitionOptions|null); + } + + /** Represents a PartitionQueryRequest. */ + class PartitionQueryRequest implements IPartitionQueryRequest { + + /** + * Constructs a new PartitionQueryRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.IPartitionQueryRequest); + + /** PartitionQueryRequest session. */ + public session: string; + + /** PartitionQueryRequest transaction. */ + public transaction?: (google.spanner.v1.ITransactionSelector|null); + + /** PartitionQueryRequest sql. */ + public sql: string; + + /** PartitionQueryRequest params. */ + public params?: (google.protobuf.IStruct|null); + + /** PartitionQueryRequest paramTypes. */ + public paramTypes: { [k: string]: google.spanner.v1.IType }; + + /** PartitionQueryRequest partitionOptions. */ + public partitionOptions?: (google.spanner.v1.IPartitionOptions|null); + + /** + * Creates a new PartitionQueryRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns PartitionQueryRequest instance + */ + public static create(properties?: google.spanner.v1.IPartitionQueryRequest): google.spanner.v1.PartitionQueryRequest; + + /** + * Encodes the specified PartitionQueryRequest message. Does not implicitly {@link google.spanner.v1.PartitionQueryRequest.verify|verify} messages. + * @param message PartitionQueryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.IPartitionQueryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PartitionQueryRequest message, length delimited. Does not implicitly {@link google.spanner.v1.PartitionQueryRequest.verify|verify} messages. + * @param message PartitionQueryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.IPartitionQueryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PartitionQueryRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PartitionQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.PartitionQueryRequest; + + /** + * Decodes a PartitionQueryRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PartitionQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.PartitionQueryRequest; + + /** + * Verifies a PartitionQueryRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PartitionQueryRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PartitionQueryRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.PartitionQueryRequest; + + /** + * Creates a plain object from a PartitionQueryRequest message. Also converts values to other types if specified. + * @param message PartitionQueryRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.PartitionQueryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PartitionQueryRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PartitionQueryRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PartitionReadRequest. */ + interface IPartitionReadRequest { + + /** PartitionReadRequest session */ + session?: (string|null); + + /** PartitionReadRequest transaction */ + transaction?: (google.spanner.v1.ITransactionSelector|null); + + /** PartitionReadRequest table */ + table?: (string|null); + + /** PartitionReadRequest index */ + index?: (string|null); + + /** PartitionReadRequest columns */ + columns?: (string[]|null); + + /** PartitionReadRequest keySet */ + keySet?: (google.spanner.v1.IKeySet|null); + + /** PartitionReadRequest partitionOptions */ + partitionOptions?: (google.spanner.v1.IPartitionOptions|null); + } + + /** Represents a PartitionReadRequest. */ + class PartitionReadRequest implements IPartitionReadRequest { + + /** + * Constructs a new PartitionReadRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.IPartitionReadRequest); + + /** PartitionReadRequest session. */ + public session: string; + + /** PartitionReadRequest transaction. */ + public transaction?: (google.spanner.v1.ITransactionSelector|null); + + /** PartitionReadRequest table. */ + public table: string; + + /** PartitionReadRequest index. */ + public index: string; + + /** PartitionReadRequest columns. */ + public columns: string[]; + + /** PartitionReadRequest keySet. */ + public keySet?: (google.spanner.v1.IKeySet|null); + + /** PartitionReadRequest partitionOptions. */ + public partitionOptions?: (google.spanner.v1.IPartitionOptions|null); + + /** + * Creates a new PartitionReadRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns PartitionReadRequest instance + */ + public static create(properties?: google.spanner.v1.IPartitionReadRequest): google.spanner.v1.PartitionReadRequest; + + /** + * Encodes the specified PartitionReadRequest message. Does not implicitly {@link google.spanner.v1.PartitionReadRequest.verify|verify} messages. + * @param message PartitionReadRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.IPartitionReadRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PartitionReadRequest message, length delimited. Does not implicitly {@link google.spanner.v1.PartitionReadRequest.verify|verify} messages. + * @param message PartitionReadRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.IPartitionReadRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PartitionReadRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PartitionReadRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.PartitionReadRequest; + + /** + * Decodes a PartitionReadRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PartitionReadRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.PartitionReadRequest; + + /** + * Verifies a PartitionReadRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PartitionReadRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PartitionReadRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.PartitionReadRequest; + + /** + * Creates a plain object from a PartitionReadRequest message. Also converts values to other types if specified. + * @param message PartitionReadRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.PartitionReadRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PartitionReadRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PartitionReadRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Partition. */ + interface IPartition { + + /** Partition partitionToken */ + partitionToken?: (Uint8Array|Buffer|string|null); + } + + /** Represents a Partition. */ + class Partition implements IPartition { + + /** + * Constructs a new Partition. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.IPartition); + + /** Partition partitionToken. */ + public partitionToken: (Uint8Array|Buffer|string); + + /** + * Creates a new Partition instance using the specified properties. + * @param [properties] Properties to set + * @returns Partition instance + */ + public static create(properties?: google.spanner.v1.IPartition): google.spanner.v1.Partition; + + /** + * Encodes the specified Partition message. Does not implicitly {@link google.spanner.v1.Partition.verify|verify} messages. + * @param message Partition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.IPartition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Partition message, length delimited. Does not implicitly {@link google.spanner.v1.Partition.verify|verify} messages. + * @param message Partition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.IPartition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Partition message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Partition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.Partition; + + /** + * Decodes a Partition message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Partition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.Partition; + + /** + * Verifies a Partition message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Partition message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Partition + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.Partition; + + /** + * Creates a plain object from a Partition message. Also converts values to other types if specified. + * @param message Partition + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.Partition, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Partition to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Partition + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PartitionResponse. */ + interface IPartitionResponse { + + /** PartitionResponse partitions */ + partitions?: (google.spanner.v1.IPartition[]|null); + + /** PartitionResponse transaction */ + transaction?: (google.spanner.v1.ITransaction|null); + } + + /** Represents a PartitionResponse. */ + class PartitionResponse implements IPartitionResponse { + + /** + * Constructs a new PartitionResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.IPartitionResponse); + + /** PartitionResponse partitions. */ + public partitions: google.spanner.v1.IPartition[]; + + /** PartitionResponse transaction. */ + public transaction?: (google.spanner.v1.ITransaction|null); + + /** + * Creates a new PartitionResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns PartitionResponse instance + */ + public static create(properties?: google.spanner.v1.IPartitionResponse): google.spanner.v1.PartitionResponse; + + /** + * Encodes the specified PartitionResponse message. Does not implicitly {@link google.spanner.v1.PartitionResponse.verify|verify} messages. + * @param message PartitionResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.IPartitionResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PartitionResponse message, length delimited. Does not implicitly {@link google.spanner.v1.PartitionResponse.verify|verify} messages. + * @param message PartitionResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.IPartitionResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PartitionResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PartitionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.PartitionResponse; + + /** + * Decodes a PartitionResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PartitionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.PartitionResponse; + + /** + * Verifies a PartitionResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PartitionResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PartitionResponse + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.PartitionResponse; + + /** + * Creates a plain object from a PartitionResponse message. Also converts values to other types if specified. + * @param message PartitionResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.PartitionResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PartitionResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PartitionResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReadRequest. */ + interface IReadRequest { + + /** ReadRequest session */ + session?: (string|null); + + /** ReadRequest transaction */ + transaction?: (google.spanner.v1.ITransactionSelector|null); + + /** ReadRequest table */ + table?: (string|null); + + /** ReadRequest index */ + index?: (string|null); + + /** ReadRequest columns */ + columns?: (string[]|null); + + /** ReadRequest keySet */ + keySet?: (google.spanner.v1.IKeySet|null); + + /** ReadRequest limit */ + limit?: (number|Long|string|null); + + /** ReadRequest resumeToken */ + resumeToken?: (Uint8Array|Buffer|string|null); + + /** ReadRequest partitionToken */ + partitionToken?: (Uint8Array|Buffer|string|null); + + /** ReadRequest requestOptions */ + requestOptions?: (google.spanner.v1.IRequestOptions|null); + + /** ReadRequest directedReadOptions */ + directedReadOptions?: (google.spanner.v1.IDirectedReadOptions|null); + + /** ReadRequest dataBoostEnabled */ + dataBoostEnabled?: (boolean|null); + + /** ReadRequest orderBy */ + orderBy?: (google.spanner.v1.ReadRequest.OrderBy|keyof typeof google.spanner.v1.ReadRequest.OrderBy|null); + + /** ReadRequest lockHint */ + lockHint?: (google.spanner.v1.ReadRequest.LockHint|keyof typeof google.spanner.v1.ReadRequest.LockHint|null); + + /** ReadRequest routingHint */ + routingHint?: (google.spanner.v1.IRoutingHint|null); + } + + /** Represents a ReadRequest. */ + class ReadRequest implements IReadRequest { + + /** + * Constructs a new ReadRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.IReadRequest); + + /** ReadRequest session. */ + public session: string; + + /** ReadRequest transaction. */ + public transaction?: (google.spanner.v1.ITransactionSelector|null); + + /** ReadRequest table. */ + public table: string; + + /** ReadRequest index. */ + public index: string; + + /** ReadRequest columns. */ + public columns: string[]; + + /** ReadRequest keySet. */ + public keySet?: (google.spanner.v1.IKeySet|null); + + /** ReadRequest limit. */ + public limit: (number|Long|string); + + /** ReadRequest resumeToken. */ + public resumeToken: (Uint8Array|Buffer|string); + + /** ReadRequest partitionToken. */ + public partitionToken: (Uint8Array|Buffer|string); + + /** ReadRequest requestOptions. */ + public requestOptions?: (google.spanner.v1.IRequestOptions|null); + + /** ReadRequest directedReadOptions. */ + public directedReadOptions?: (google.spanner.v1.IDirectedReadOptions|null); + + /** ReadRequest dataBoostEnabled. */ + public dataBoostEnabled: boolean; + + /** ReadRequest orderBy. */ + public orderBy: (google.spanner.v1.ReadRequest.OrderBy|keyof typeof google.spanner.v1.ReadRequest.OrderBy); + + /** ReadRequest lockHint. */ + public lockHint: (google.spanner.v1.ReadRequest.LockHint|keyof typeof google.spanner.v1.ReadRequest.LockHint); + + /** ReadRequest routingHint. */ + public routingHint?: (google.spanner.v1.IRoutingHint|null); + + /** + * Creates a new ReadRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ReadRequest instance + */ + public static create(properties?: google.spanner.v1.IReadRequest): google.spanner.v1.ReadRequest; + + /** + * Encodes the specified ReadRequest message. Does not implicitly {@link google.spanner.v1.ReadRequest.verify|verify} messages. + * @param message ReadRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.IReadRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReadRequest message, length delimited. Does not implicitly {@link google.spanner.v1.ReadRequest.verify|verify} messages. + * @param message ReadRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.IReadRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReadRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReadRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.ReadRequest; + + /** + * Decodes a ReadRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReadRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.ReadRequest; + + /** + * Verifies a ReadRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReadRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReadRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.ReadRequest; + + /** + * Creates a plain object from a ReadRequest message. Also converts values to other types if specified. + * @param message ReadRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.ReadRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReadRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReadRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ReadRequest { + + /** OrderBy enum. */ + enum OrderBy { + ORDER_BY_UNSPECIFIED = 0, + ORDER_BY_PRIMARY_KEY = 1, + ORDER_BY_NO_ORDER = 2 + } + + /** LockHint enum. */ + enum LockHint { + LOCK_HINT_UNSPECIFIED = 0, + LOCK_HINT_SHARED = 1, + LOCK_HINT_EXCLUSIVE = 2 + } + } + + /** Properties of a BeginTransactionRequest. */ + interface IBeginTransactionRequest { + + /** BeginTransactionRequest session */ + session?: (string|null); + + /** BeginTransactionRequest options */ + options?: (google.spanner.v1.ITransactionOptions|null); + + /** BeginTransactionRequest requestOptions */ + requestOptions?: (google.spanner.v1.IRequestOptions|null); + + /** BeginTransactionRequest mutationKey */ + mutationKey?: (google.spanner.v1.IMutation|null); + } + + /** Represents a BeginTransactionRequest. */ + class BeginTransactionRequest implements IBeginTransactionRequest { + + /** + * Constructs a new BeginTransactionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.IBeginTransactionRequest); + + /** BeginTransactionRequest session. */ + public session: string; + + /** BeginTransactionRequest options. */ + public options?: (google.spanner.v1.ITransactionOptions|null); + + /** BeginTransactionRequest requestOptions. */ + public requestOptions?: (google.spanner.v1.IRequestOptions|null); + + /** BeginTransactionRequest mutationKey. */ + public mutationKey?: (google.spanner.v1.IMutation|null); + + /** + * Creates a new BeginTransactionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns BeginTransactionRequest instance + */ + public static create(properties?: google.spanner.v1.IBeginTransactionRequest): google.spanner.v1.BeginTransactionRequest; + + /** + * Encodes the specified BeginTransactionRequest message. Does not implicitly {@link google.spanner.v1.BeginTransactionRequest.verify|verify} messages. + * @param message BeginTransactionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.IBeginTransactionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BeginTransactionRequest message, length delimited. Does not implicitly {@link google.spanner.v1.BeginTransactionRequest.verify|verify} messages. + * @param message BeginTransactionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.IBeginTransactionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BeginTransactionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BeginTransactionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.BeginTransactionRequest; + + /** + * Decodes a BeginTransactionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BeginTransactionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.BeginTransactionRequest; + + /** + * Verifies a BeginTransactionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BeginTransactionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BeginTransactionRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.BeginTransactionRequest; + + /** + * Creates a plain object from a BeginTransactionRequest message. Also converts values to other types if specified. + * @param message BeginTransactionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.BeginTransactionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BeginTransactionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BeginTransactionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CommitRequest. */ + interface ICommitRequest { + + /** CommitRequest session */ + session?: (string|null); + + /** CommitRequest transactionId */ + transactionId?: (Uint8Array|Buffer|string|null); + + /** CommitRequest singleUseTransaction */ + singleUseTransaction?: (google.spanner.v1.ITransactionOptions|null); + + /** CommitRequest mutations */ + mutations?: (google.spanner.v1.IMutation[]|null); + + /** CommitRequest returnCommitStats */ + returnCommitStats?: (boolean|null); + + /** CommitRequest maxCommitDelay */ + maxCommitDelay?: (google.protobuf.IDuration|null); + + /** CommitRequest requestOptions */ + requestOptions?: (google.spanner.v1.IRequestOptions|null); + + /** CommitRequest precommitToken */ + precommitToken?: (google.spanner.v1.IMultiplexedSessionPrecommitToken|null); + } + + /** Represents a CommitRequest. */ + class CommitRequest implements ICommitRequest { + + /** + * Constructs a new CommitRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.ICommitRequest); + + /** CommitRequest session. */ + public session: string; + + /** CommitRequest transactionId. */ + public transactionId?: (Uint8Array|Buffer|string|null); + + /** CommitRequest singleUseTransaction. */ + public singleUseTransaction?: (google.spanner.v1.ITransactionOptions|null); + + /** CommitRequest mutations. */ + public mutations: google.spanner.v1.IMutation[]; + + /** CommitRequest returnCommitStats. */ + public returnCommitStats: boolean; + + /** CommitRequest maxCommitDelay. */ + public maxCommitDelay?: (google.protobuf.IDuration|null); + + /** CommitRequest requestOptions. */ + public requestOptions?: (google.spanner.v1.IRequestOptions|null); + + /** CommitRequest precommitToken. */ + public precommitToken?: (google.spanner.v1.IMultiplexedSessionPrecommitToken|null); + + /** CommitRequest transaction. */ + public transaction?: ("transactionId"|"singleUseTransaction"); + + /** + * Creates a new CommitRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CommitRequest instance + */ + public static create(properties?: google.spanner.v1.ICommitRequest): google.spanner.v1.CommitRequest; + + /** + * Encodes the specified CommitRequest message. Does not implicitly {@link google.spanner.v1.CommitRequest.verify|verify} messages. + * @param message CommitRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.ICommitRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CommitRequest message, length delimited. Does not implicitly {@link google.spanner.v1.CommitRequest.verify|verify} messages. + * @param message CommitRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.ICommitRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CommitRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CommitRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.CommitRequest; + + /** + * Decodes a CommitRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CommitRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.CommitRequest; + + /** + * Verifies a CommitRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CommitRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CommitRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.CommitRequest; + + /** + * Creates a plain object from a CommitRequest message. Also converts values to other types if specified. + * @param message CommitRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.CommitRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CommitRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CommitRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RollbackRequest. */ + interface IRollbackRequest { + + /** RollbackRequest session */ + session?: (string|null); + + /** RollbackRequest transactionId */ + transactionId?: (Uint8Array|Buffer|string|null); + } + + /** Represents a RollbackRequest. */ + class RollbackRequest implements IRollbackRequest { + + /** + * Constructs a new RollbackRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.IRollbackRequest); + + /** RollbackRequest session. */ + public session: string; + + /** RollbackRequest transactionId. */ + public transactionId: (Uint8Array|Buffer|string); + + /** + * Creates a new RollbackRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RollbackRequest instance + */ + public static create(properties?: google.spanner.v1.IRollbackRequest): google.spanner.v1.RollbackRequest; + + /** + * Encodes the specified RollbackRequest message. Does not implicitly {@link google.spanner.v1.RollbackRequest.verify|verify} messages. + * @param message RollbackRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.IRollbackRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RollbackRequest message, length delimited. Does not implicitly {@link google.spanner.v1.RollbackRequest.verify|verify} messages. + * @param message RollbackRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.IRollbackRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RollbackRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RollbackRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.RollbackRequest; + + /** + * Decodes a RollbackRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RollbackRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.RollbackRequest; + + /** + * Verifies a RollbackRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RollbackRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RollbackRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.RollbackRequest; + + /** + * Creates a plain object from a RollbackRequest message. Also converts values to other types if specified. + * @param message RollbackRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.RollbackRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RollbackRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RollbackRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchWriteRequest. */ + interface IBatchWriteRequest { + + /** BatchWriteRequest session */ + session?: (string|null); + + /** BatchWriteRequest requestOptions */ + requestOptions?: (google.spanner.v1.IRequestOptions|null); + + /** BatchWriteRequest mutationGroups */ + mutationGroups?: (google.spanner.v1.BatchWriteRequest.IMutationGroup[]|null); + + /** BatchWriteRequest excludeTxnFromChangeStreams */ + excludeTxnFromChangeStreams?: (boolean|null); + } + + /** Represents a BatchWriteRequest. */ + class BatchWriteRequest implements IBatchWriteRequest { + + /** + * Constructs a new BatchWriteRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.IBatchWriteRequest); + + /** BatchWriteRequest session. */ + public session: string; + + /** BatchWriteRequest requestOptions. */ + public requestOptions?: (google.spanner.v1.IRequestOptions|null); + + /** BatchWriteRequest mutationGroups. */ + public mutationGroups: google.spanner.v1.BatchWriteRequest.IMutationGroup[]; + + /** BatchWriteRequest excludeTxnFromChangeStreams. */ + public excludeTxnFromChangeStreams: boolean; + + /** + * Creates a new BatchWriteRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchWriteRequest instance + */ + public static create(properties?: google.spanner.v1.IBatchWriteRequest): google.spanner.v1.BatchWriteRequest; + + /** + * Encodes the specified BatchWriteRequest message. Does not implicitly {@link google.spanner.v1.BatchWriteRequest.verify|verify} messages. + * @param message BatchWriteRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.IBatchWriteRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchWriteRequest message, length delimited. Does not implicitly {@link google.spanner.v1.BatchWriteRequest.verify|verify} messages. + * @param message BatchWriteRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.IBatchWriteRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchWriteRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchWriteRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.BatchWriteRequest; + + /** + * Decodes a BatchWriteRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchWriteRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.BatchWriteRequest; + + /** + * Verifies a BatchWriteRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchWriteRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchWriteRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.BatchWriteRequest; + + /** + * Creates a plain object from a BatchWriteRequest message. Also converts values to other types if specified. + * @param message BatchWriteRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.BatchWriteRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchWriteRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchWriteRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BatchWriteRequest { + + /** Properties of a MutationGroup. */ + interface IMutationGroup { + + /** MutationGroup mutations */ + mutations?: (google.spanner.v1.IMutation[]|null); + } + + /** Represents a MutationGroup. */ + class MutationGroup implements IMutationGroup { + + /** + * Constructs a new MutationGroup. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.BatchWriteRequest.IMutationGroup); + + /** MutationGroup mutations. */ + public mutations: google.spanner.v1.IMutation[]; + + /** + * Creates a new MutationGroup instance using the specified properties. + * @param [properties] Properties to set + * @returns MutationGroup instance + */ + public static create(properties?: google.spanner.v1.BatchWriteRequest.IMutationGroup): google.spanner.v1.BatchWriteRequest.MutationGroup; + + /** + * Encodes the specified MutationGroup message. Does not implicitly {@link google.spanner.v1.BatchWriteRequest.MutationGroup.verify|verify} messages. + * @param message MutationGroup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.BatchWriteRequest.IMutationGroup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MutationGroup message, length delimited. Does not implicitly {@link google.spanner.v1.BatchWriteRequest.MutationGroup.verify|verify} messages. + * @param message MutationGroup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.BatchWriteRequest.IMutationGroup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MutationGroup message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MutationGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.BatchWriteRequest.MutationGroup; + + /** + * Decodes a MutationGroup message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MutationGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.BatchWriteRequest.MutationGroup; + + /** + * Verifies a MutationGroup message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MutationGroup message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MutationGroup + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.BatchWriteRequest.MutationGroup; + + /** + * Creates a plain object from a MutationGroup message. Also converts values to other types if specified. + * @param message MutationGroup + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.BatchWriteRequest.MutationGroup, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MutationGroup to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MutationGroup + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a BatchWriteResponse. */ + interface IBatchWriteResponse { + + /** BatchWriteResponse indexes */ + indexes?: (number[]|null); + + /** BatchWriteResponse status */ + status?: (google.rpc.IStatus|null); + + /** BatchWriteResponse commitTimestamp */ + commitTimestamp?: (google.protobuf.ITimestamp|null); + } + + /** Represents a BatchWriteResponse. */ + class BatchWriteResponse implements IBatchWriteResponse { + + /** + * Constructs a new BatchWriteResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.IBatchWriteResponse); + + /** BatchWriteResponse indexes. */ + public indexes: number[]; + + /** BatchWriteResponse status. */ + public status?: (google.rpc.IStatus|null); + + /** BatchWriteResponse commitTimestamp. */ + public commitTimestamp?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new BatchWriteResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchWriteResponse instance + */ + public static create(properties?: google.spanner.v1.IBatchWriteResponse): google.spanner.v1.BatchWriteResponse; + + /** + * Encodes the specified BatchWriteResponse message. Does not implicitly {@link google.spanner.v1.BatchWriteResponse.verify|verify} messages. + * @param message BatchWriteResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.IBatchWriteResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchWriteResponse message, length delimited. Does not implicitly {@link google.spanner.v1.BatchWriteResponse.verify|verify} messages. + * @param message BatchWriteResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.IBatchWriteResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchWriteResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchWriteResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.BatchWriteResponse; + + /** + * Decodes a BatchWriteResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchWriteResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.BatchWriteResponse; + + /** + * Verifies a BatchWriteResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchWriteResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchWriteResponse + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.BatchWriteResponse; + + /** + * Creates a plain object from a BatchWriteResponse message. Also converts values to other types if specified. + * @param message BatchWriteResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.BatchWriteResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchWriteResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchWriteResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Namespace api. */ + namespace api { + + /** FieldBehavior enum. */ + enum FieldBehavior { + FIELD_BEHAVIOR_UNSPECIFIED = 0, + OPTIONAL = 1, + REQUIRED = 2, + OUTPUT_ONLY = 3, + INPUT_ONLY = 4, + IMMUTABLE = 5, + UNORDERED_LIST = 6, + NON_EMPTY_DEFAULT = 7, + IDENTIFIER = 8 + } + + /** Properties of a Http. */ + interface IHttp { + + /** Http rules */ + rules?: (google.api.IHttpRule[]|null); + + /** Http fullyDecodeReservedExpansion */ + fullyDecodeReservedExpansion?: (boolean|null); + } + + /** Represents a Http. */ + class Http implements IHttp { + + /** + * Constructs a new Http. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttp); + + /** Http rules. */ + public rules: google.api.IHttpRule[]; + + /** Http fullyDecodeReservedExpansion. */ + public fullyDecodeReservedExpansion: boolean; + + /** + * Creates a new Http instance using the specified properties. + * @param [properties] Properties to set + * @returns Http instance + */ + public static create(properties?: google.api.IHttp): google.api.Http; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Http message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Http; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Http; + + /** + * Verifies a Http message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Http + */ + public static fromObject(object: { [k: string]: any }): google.api.Http; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @param message Http + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Http to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Http + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a HttpRule. */ + interface IHttpRule { + + /** HttpRule selector */ + selector?: (string|null); + + /** HttpRule get */ + get?: (string|null); + + /** HttpRule put */ + put?: (string|null); + + /** HttpRule post */ + post?: (string|null); + + /** HttpRule delete */ + "delete"?: (string|null); + + /** HttpRule patch */ + patch?: (string|null); + + /** HttpRule custom */ + custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body */ + body?: (string|null); + + /** HttpRule responseBody */ + responseBody?: (string|null); + + /** HttpRule additionalBindings */ + additionalBindings?: (google.api.IHttpRule[]|null); + } + + /** Represents a HttpRule. */ + class HttpRule implements IHttpRule { + + /** + * Constructs a new HttpRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttpRule); + + /** HttpRule selector. */ + public selector: string; + + /** HttpRule get. */ + public get?: (string|null); + + /** HttpRule put. */ + public put?: (string|null); + + /** HttpRule post. */ + public post?: (string|null); + + /** HttpRule delete. */ + public delete?: (string|null); + + /** HttpRule patch. */ + public patch?: (string|null); + + /** HttpRule custom. */ + public custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body. */ + public body: string; + + /** HttpRule responseBody. */ + public responseBody: string; + + /** HttpRule additionalBindings. */ + public additionalBindings: google.api.IHttpRule[]; + + /** HttpRule pattern. */ + public pattern?: ("get"|"put"|"post"|"delete"|"patch"|"custom"); + + /** + * Creates a new HttpRule instance using the specified properties. + * @param [properties] Properties to set + * @returns HttpRule instance + */ + public static create(properties?: google.api.IHttpRule): google.api.HttpRule; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.HttpRule; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.HttpRule; + + /** + * Verifies a HttpRule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HttpRule + */ + public static fromObject(object: { [k: string]: any }): google.api.HttpRule; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @param message HttpRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.HttpRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HttpRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HttpRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomHttpPattern. */ + interface ICustomHttpPattern { + + /** CustomHttpPattern kind */ + kind?: (string|null); + + /** CustomHttpPattern path */ + path?: (string|null); + } + + /** Represents a CustomHttpPattern. */ + class CustomHttpPattern implements ICustomHttpPattern { + + /** + * Constructs a new CustomHttpPattern. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICustomHttpPattern); + + /** CustomHttpPattern kind. */ + public kind: string; + + /** CustomHttpPattern path. */ + public path: string; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomHttpPattern instance + */ + public static create(properties?: google.api.ICustomHttpPattern): google.api.CustomHttpPattern; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CustomHttpPattern; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CustomHttpPattern; + + /** + * Verifies a CustomHttpPattern message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomHttpPattern + */ + public static fromObject(object: { [k: string]: any }): google.api.CustomHttpPattern; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @param message CustomHttpPattern + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CustomHttpPattern, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomHttpPattern to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomHttpPattern + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CommonLanguageSettings. */ + interface ICommonLanguageSettings { + + /** CommonLanguageSettings referenceDocsUri */ + referenceDocsUri?: (string|null); + + /** CommonLanguageSettings destinations */ + destinations?: (google.api.ClientLibraryDestination[]|null); + } + + /** Represents a CommonLanguageSettings. */ + class CommonLanguageSettings implements ICommonLanguageSettings { + + /** + * Constructs a new CommonLanguageSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICommonLanguageSettings); + + /** CommonLanguageSettings referenceDocsUri. */ + public referenceDocsUri: string; + + /** CommonLanguageSettings destinations. */ + public destinations: google.api.ClientLibraryDestination[]; + + /** + * Creates a new CommonLanguageSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns CommonLanguageSettings instance + */ + public static create(properties?: google.api.ICommonLanguageSettings): google.api.CommonLanguageSettings; + + /** + * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @param message CommonLanguageSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @param message CommonLanguageSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CommonLanguageSettings; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CommonLanguageSettings; + + /** + * Verifies a CommonLanguageSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CommonLanguageSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.CommonLanguageSettings; + + /** + * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. + * @param message CommonLanguageSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CommonLanguageSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CommonLanguageSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CommonLanguageSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ClientLibrarySettings. */ + interface IClientLibrarySettings { + + /** ClientLibrarySettings version */ + version?: (string|null); + + /** ClientLibrarySettings launchStage */ + launchStage?: (google.api.LaunchStage|keyof typeof google.api.LaunchStage|null); + + /** ClientLibrarySettings restNumericEnums */ + restNumericEnums?: (boolean|null); + + /** ClientLibrarySettings javaSettings */ + javaSettings?: (google.api.IJavaSettings|null); + + /** ClientLibrarySettings cppSettings */ + cppSettings?: (google.api.ICppSettings|null); + + /** ClientLibrarySettings phpSettings */ + phpSettings?: (google.api.IPhpSettings|null); + + /** ClientLibrarySettings pythonSettings */ + pythonSettings?: (google.api.IPythonSettings|null); + + /** ClientLibrarySettings nodeSettings */ + nodeSettings?: (google.api.INodeSettings|null); + + /** ClientLibrarySettings dotnetSettings */ + dotnetSettings?: (google.api.IDotnetSettings|null); + + /** ClientLibrarySettings rubySettings */ + rubySettings?: (google.api.IRubySettings|null); + + /** ClientLibrarySettings goSettings */ + goSettings?: (google.api.IGoSettings|null); + } + + /** Represents a ClientLibrarySettings. */ + class ClientLibrarySettings implements IClientLibrarySettings { + + /** + * Constructs a new ClientLibrarySettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IClientLibrarySettings); + + /** ClientLibrarySettings version. */ + public version: string; + + /** ClientLibrarySettings launchStage. */ + public launchStage: (google.api.LaunchStage|keyof typeof google.api.LaunchStage); + + /** ClientLibrarySettings restNumericEnums. */ + public restNumericEnums: boolean; + + /** ClientLibrarySettings javaSettings. */ + public javaSettings?: (google.api.IJavaSettings|null); + + /** ClientLibrarySettings cppSettings. */ + public cppSettings?: (google.api.ICppSettings|null); + + /** ClientLibrarySettings phpSettings. */ + public phpSettings?: (google.api.IPhpSettings|null); + + /** ClientLibrarySettings pythonSettings. */ + public pythonSettings?: (google.api.IPythonSettings|null); + + /** ClientLibrarySettings nodeSettings. */ + public nodeSettings?: (google.api.INodeSettings|null); + + /** ClientLibrarySettings dotnetSettings. */ + public dotnetSettings?: (google.api.IDotnetSettings|null); + + /** ClientLibrarySettings rubySettings. */ + public rubySettings?: (google.api.IRubySettings|null); + + /** ClientLibrarySettings goSettings. */ + public goSettings?: (google.api.IGoSettings|null); + + /** + * Creates a new ClientLibrarySettings instance using the specified properties. + * @param [properties] Properties to set + * @returns ClientLibrarySettings instance + */ + public static create(properties?: google.api.IClientLibrarySettings): google.api.ClientLibrarySettings; + + /** + * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @param message ClientLibrarySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @param message ClientLibrarySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ClientLibrarySettings; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ClientLibrarySettings; + + /** + * Verifies a ClientLibrarySettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClientLibrarySettings + */ + public static fromObject(object: { [k: string]: any }): google.api.ClientLibrarySettings; + + /** + * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. + * @param message ClientLibrarySettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ClientLibrarySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClientLibrarySettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClientLibrarySettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Publishing. */ + interface IPublishing { + + /** Publishing methodSettings */ + methodSettings?: (google.api.IMethodSettings[]|null); + + /** Publishing newIssueUri */ + newIssueUri?: (string|null); + + /** Publishing documentationUri */ + documentationUri?: (string|null); + + /** Publishing apiShortName */ + apiShortName?: (string|null); + + /** Publishing githubLabel */ + githubLabel?: (string|null); + + /** Publishing codeownerGithubTeams */ + codeownerGithubTeams?: (string[]|null); + + /** Publishing docTagPrefix */ + docTagPrefix?: (string|null); + + /** Publishing organization */ + organization?: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization|null); + + /** Publishing librarySettings */ + librarySettings?: (google.api.IClientLibrarySettings[]|null); + + /** Publishing protoReferenceDocumentationUri */ + protoReferenceDocumentationUri?: (string|null); + + /** Publishing restReferenceDocumentationUri */ + restReferenceDocumentationUri?: (string|null); + } + + /** Represents a Publishing. */ + class Publishing implements IPublishing { + + /** + * Constructs a new Publishing. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPublishing); + + /** Publishing methodSettings. */ + public methodSettings: google.api.IMethodSettings[]; + + /** Publishing newIssueUri. */ + public newIssueUri: string; + + /** Publishing documentationUri. */ + public documentationUri: string; + + /** Publishing apiShortName. */ + public apiShortName: string; + + /** Publishing githubLabel. */ + public githubLabel: string; + + /** Publishing codeownerGithubTeams. */ + public codeownerGithubTeams: string[]; + + /** Publishing docTagPrefix. */ + public docTagPrefix: string; + + /** Publishing organization. */ + public organization: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization); + + /** Publishing librarySettings. */ + public librarySettings: google.api.IClientLibrarySettings[]; + + /** Publishing protoReferenceDocumentationUri. */ + public protoReferenceDocumentationUri: string; + + /** Publishing restReferenceDocumentationUri. */ + public restReferenceDocumentationUri: string; + + /** + * Creates a new Publishing instance using the specified properties. + * @param [properties] Properties to set + * @returns Publishing instance + */ + public static create(properties?: google.api.IPublishing): google.api.Publishing; + + /** + * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @param message Publishing message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @param message Publishing message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Publishing message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Publishing; + + /** + * Decodes a Publishing message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Publishing; + + /** + * Verifies a Publishing message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Publishing message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Publishing + */ + public static fromObject(object: { [k: string]: any }): google.api.Publishing; + + /** + * Creates a plain object from a Publishing message. Also converts values to other types if specified. + * @param message Publishing + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Publishing, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Publishing to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Publishing + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a JavaSettings. */ + interface IJavaSettings { + + /** JavaSettings libraryPackage */ + libraryPackage?: (string|null); + + /** JavaSettings serviceClassNames */ + serviceClassNames?: ({ [k: string]: string }|null); + + /** JavaSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a JavaSettings. */ + class JavaSettings implements IJavaSettings { + + /** + * Constructs a new JavaSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IJavaSettings); + + /** JavaSettings libraryPackage. */ + public libraryPackage: string; + + /** JavaSettings serviceClassNames. */ + public serviceClassNames: { [k: string]: string }; + + /** JavaSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new JavaSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns JavaSettings instance + */ + public static create(properties?: google.api.IJavaSettings): google.api.JavaSettings; + + /** + * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @param message JavaSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @param message JavaSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JavaSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.JavaSettings; + + /** + * Decodes a JavaSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.JavaSettings; + + /** + * Verifies a JavaSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JavaSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.JavaSettings; + + /** + * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. + * @param message JavaSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.JavaSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JavaSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JavaSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CppSettings. */ + interface ICppSettings { + + /** CppSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a CppSettings. */ + class CppSettings implements ICppSettings { + + /** + * Constructs a new CppSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICppSettings); + + /** CppSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new CppSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns CppSettings instance + */ + public static create(properties?: google.api.ICppSettings): google.api.CppSettings; + + /** + * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @param message CppSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @param message CppSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CppSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CppSettings; + + /** + * Decodes a CppSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CppSettings; + + /** + * Verifies a CppSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CppSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.CppSettings; + + /** + * Creates a plain object from a CppSettings message. Also converts values to other types if specified. + * @param message CppSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CppSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CppSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CppSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PhpSettings. */ + interface IPhpSettings { + + /** PhpSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a PhpSettings. */ + class PhpSettings implements IPhpSettings { + + /** + * Constructs a new PhpSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPhpSettings); + + /** PhpSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new PhpSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns PhpSettings instance + */ + public static create(properties?: google.api.IPhpSettings): google.api.PhpSettings; + + /** + * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @param message PhpSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @param message PhpSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PhpSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PhpSettings; + + /** + * Decodes a PhpSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PhpSettings; + + /** + * Verifies a PhpSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PhpSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.PhpSettings; + + /** + * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. + * @param message PhpSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PhpSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PhpSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PhpSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PythonSettings. */ + interface IPythonSettings { + + /** PythonSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a PythonSettings. */ + class PythonSettings implements IPythonSettings { + + /** + * Constructs a new PythonSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPythonSettings); + + /** PythonSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new PythonSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns PythonSettings instance + */ + public static create(properties?: google.api.IPythonSettings): google.api.PythonSettings; + + /** + * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @param message PythonSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @param message PythonSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PythonSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PythonSettings; + + /** + * Decodes a PythonSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PythonSettings; + + /** + * Verifies a PythonSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PythonSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.PythonSettings; + + /** + * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. + * @param message PythonSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PythonSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PythonSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PythonSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeSettings. */ + interface INodeSettings { + + /** NodeSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a NodeSettings. */ + class NodeSettings implements INodeSettings { + + /** + * Constructs a new NodeSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.INodeSettings); + + /** NodeSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new NodeSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeSettings instance + */ + public static create(properties?: google.api.INodeSettings): google.api.NodeSettings; + + /** + * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @param message NodeSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @param message NodeSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.NodeSettings; + + /** + * Decodes a NodeSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.NodeSettings; + + /** + * Verifies a NodeSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NodeSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.NodeSettings; + + /** + * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. + * @param message NodeSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.NodeSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NodeSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NodeSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DotnetSettings. */ + interface IDotnetSettings { + + /** DotnetSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + + /** DotnetSettings renamedServices */ + renamedServices?: ({ [k: string]: string }|null); + + /** DotnetSettings renamedResources */ + renamedResources?: ({ [k: string]: string }|null); + + /** DotnetSettings ignoredResources */ + ignoredResources?: (string[]|null); + + /** DotnetSettings forcedNamespaceAliases */ + forcedNamespaceAliases?: (string[]|null); + + /** DotnetSettings handwrittenSignatures */ + handwrittenSignatures?: (string[]|null); + } + + /** Represents a DotnetSettings. */ + class DotnetSettings implements IDotnetSettings { + + /** + * Constructs a new DotnetSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IDotnetSettings); + + /** DotnetSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** DotnetSettings renamedServices. */ + public renamedServices: { [k: string]: string }; + + /** DotnetSettings renamedResources. */ + public renamedResources: { [k: string]: string }; + + /** DotnetSettings ignoredResources. */ + public ignoredResources: string[]; + + /** DotnetSettings forcedNamespaceAliases. */ + public forcedNamespaceAliases: string[]; + + /** DotnetSettings handwrittenSignatures. */ + public handwrittenSignatures: string[]; + + /** + * Creates a new DotnetSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns DotnetSettings instance + */ + public static create(properties?: google.api.IDotnetSettings): google.api.DotnetSettings; + + /** + * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @param message DotnetSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @param message DotnetSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.DotnetSettings; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.DotnetSettings; + + /** + * Verifies a DotnetSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DotnetSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.DotnetSettings; + + /** + * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. + * @param message DotnetSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.DotnetSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DotnetSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DotnetSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RubySettings. */ + interface IRubySettings { + + /** RubySettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a RubySettings. */ + class RubySettings implements IRubySettings { + + /** + * Constructs a new RubySettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IRubySettings); + + /** RubySettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new RubySettings instance using the specified properties. + * @param [properties] Properties to set + * @returns RubySettings instance + */ + public static create(properties?: google.api.IRubySettings): google.api.RubySettings; + + /** + * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @param message RubySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @param message RubySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RubySettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.RubySettings; + + /** + * Decodes a RubySettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.RubySettings; + + /** + * Verifies a RubySettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RubySettings + */ + public static fromObject(object: { [k: string]: any }): google.api.RubySettings; + + /** + * Creates a plain object from a RubySettings message. Also converts values to other types if specified. + * @param message RubySettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.RubySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RubySettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RubySettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GoSettings. */ + interface IGoSettings { + + /** GoSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a GoSettings. */ + class GoSettings implements IGoSettings { + + /** + * Constructs a new GoSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IGoSettings); + + /** GoSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new GoSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns GoSettings instance + */ + public static create(properties?: google.api.IGoSettings): google.api.GoSettings; + + /** + * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @param message GoSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @param message GoSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GoSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.GoSettings; + + /** + * Decodes a GoSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.GoSettings; + + /** + * Verifies a GoSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GoSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.GoSettings; + + /** + * Creates a plain object from a GoSettings message. Also converts values to other types if specified. + * @param message GoSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.GoSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GoSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GoSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodSettings. */ + interface IMethodSettings { + + /** MethodSettings selector */ + selector?: (string|null); + + /** MethodSettings longRunning */ + longRunning?: (google.api.MethodSettings.ILongRunning|null); + + /** MethodSettings autoPopulatedFields */ + autoPopulatedFields?: (string[]|null); + } + + /** Represents a MethodSettings. */ + class MethodSettings implements IMethodSettings { + + /** + * Constructs a new MethodSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IMethodSettings); + + /** MethodSettings selector. */ + public selector: string; + + /** MethodSettings longRunning. */ + public longRunning?: (google.api.MethodSettings.ILongRunning|null); + + /** MethodSettings autoPopulatedFields. */ + public autoPopulatedFields: string[]; + + /** + * Creates a new MethodSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodSettings instance + */ + public static create(properties?: google.api.IMethodSettings): google.api.MethodSettings; + + /** + * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @param message MethodSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @param message MethodSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.MethodSettings; + + /** + * Decodes a MethodSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.MethodSettings; + + /** + * Verifies a MethodSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.MethodSettings; + + /** + * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. + * @param message MethodSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.MethodSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MethodSettings { + + /** Properties of a LongRunning. */ + interface ILongRunning { + + /** LongRunning initialPollDelay */ + initialPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning pollDelayMultiplier */ + pollDelayMultiplier?: (number|null); + + /** LongRunning maxPollDelay */ + maxPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning totalPollTimeout */ + totalPollTimeout?: (google.protobuf.IDuration|null); + } + + /** Represents a LongRunning. */ + class LongRunning implements ILongRunning { + + /** + * Constructs a new LongRunning. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.MethodSettings.ILongRunning); + + /** LongRunning initialPollDelay. */ + public initialPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning pollDelayMultiplier. */ + public pollDelayMultiplier: number; + + /** LongRunning maxPollDelay. */ + public maxPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning totalPollTimeout. */ + public totalPollTimeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new LongRunning instance using the specified properties. + * @param [properties] Properties to set + * @returns LongRunning instance + */ + public static create(properties?: google.api.MethodSettings.ILongRunning): google.api.MethodSettings.LongRunning; + + /** + * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @param message LongRunning message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @param message LongRunning message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LongRunning message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.MethodSettings.LongRunning; + + /** + * Decodes a LongRunning message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.MethodSettings.LongRunning; + + /** + * Verifies a LongRunning message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LongRunning + */ + public static fromObject(object: { [k: string]: any }): google.api.MethodSettings.LongRunning; + + /** + * Creates a plain object from a LongRunning message. Also converts values to other types if specified. + * @param message LongRunning + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.MethodSettings.LongRunning, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LongRunning to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LongRunning + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** ClientLibraryOrganization enum. */ + enum ClientLibraryOrganization { + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0, + CLOUD = 1, + ADS = 2, + PHOTOS = 3, + STREET_VIEW = 4, + SHOPPING = 5, + GEO = 6, + GENERATIVE_AI = 7 + } + + /** ClientLibraryDestination enum. */ + enum ClientLibraryDestination { + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0, + GITHUB = 10, + PACKAGE_MANAGER = 20 + } + + /** LaunchStage enum. */ + enum LaunchStage { + LAUNCH_STAGE_UNSPECIFIED = 0, + UNIMPLEMENTED = 6, + PRELAUNCH = 7, + EARLY_ACCESS = 1, + ALPHA = 2, + BETA = 3, + GA = 4, + DEPRECATED = 5 + } + + /** Properties of a ResourceDescriptor. */ + interface IResourceDescriptor { + + /** ResourceDescriptor type */ + type?: (string|null); + + /** ResourceDescriptor pattern */ + pattern?: (string[]|null); + + /** ResourceDescriptor nameField */ + nameField?: (string|null); + + /** ResourceDescriptor history */ + history?: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History|null); + + /** ResourceDescriptor plural */ + plural?: (string|null); + + /** ResourceDescriptor singular */ + singular?: (string|null); + + /** ResourceDescriptor style */ + style?: (google.api.ResourceDescriptor.Style[]|null); + } + + /** Represents a ResourceDescriptor. */ + class ResourceDescriptor implements IResourceDescriptor { + + /** + * Constructs a new ResourceDescriptor. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceDescriptor); + + /** ResourceDescriptor type. */ + public type: string; + + /** ResourceDescriptor pattern. */ + public pattern: string[]; + + /** ResourceDescriptor nameField. */ + public nameField: string; + + /** ResourceDescriptor history. */ + public history: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History); + + /** ResourceDescriptor plural. */ + public plural: string; + + /** ResourceDescriptor singular. */ + public singular: string; + + /** ResourceDescriptor style. */ + public style: google.api.ResourceDescriptor.Style[]; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceDescriptor instance + */ + public static create(properties?: google.api.IResourceDescriptor): google.api.ResourceDescriptor; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceDescriptor; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceDescriptor; + + /** + * Verifies a ResourceDescriptor message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceDescriptor + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceDescriptor; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @param message ResourceDescriptor + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceDescriptor to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceDescriptor + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ResourceDescriptor { + + /** History enum. */ + enum History { + HISTORY_UNSPECIFIED = 0, + ORIGINALLY_SINGLE_PATTERN = 1, + FUTURE_MULTI_PATTERN = 2 + } + + /** Style enum. */ + enum Style { + STYLE_UNSPECIFIED = 0, + DECLARATIVE_FRIENDLY = 1 + } + } + + /** Properties of a ResourceReference. */ + interface IResourceReference { + + /** ResourceReference type */ + type?: (string|null); + + /** ResourceReference childType */ + childType?: (string|null); + } + + /** Represents a ResourceReference. */ + class ResourceReference implements IResourceReference { + + /** + * Constructs a new ResourceReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceReference); + + /** ResourceReference type. */ + public type: string; + + /** ResourceReference childType. */ + public childType: string; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceReference instance + */ + public static create(properties?: google.api.IResourceReference): google.api.ResourceReference; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceReference; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceReference; + + /** + * Verifies a ResourceReference message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceReference + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceReference; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @param message ResourceReference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceReference + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace rpc. */ + namespace rpc { + + /** Properties of a Status. */ + interface IStatus { + + /** Status code */ + code?: (number|null); + + /** Status message */ + message?: (string|null); + + /** Status details */ + details?: (google.protobuf.IAny[]|null); + } + + /** Represents a Status. */ + class Status implements IStatus { + + /** + * Constructs a new Status. + * @param [properties] Properties to set + */ + constructor(properties?: google.rpc.IStatus); + + /** Status code. */ + public code: number; + + /** Status message. */ + public message: string; + + /** Status details. */ + public details: google.protobuf.IAny[]; + + /** + * Creates a new Status instance using the specified properties. + * @param [properties] Properties to set + * @returns Status instance + */ + public static create(properties?: google.rpc.IStatus): google.rpc.Status; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Status message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.rpc.Status; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.rpc.Status; + + /** + * Verifies a Status message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Status + */ + public static fromObject(object: { [k: string]: any }): google.rpc.Status; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @param message Status + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.rpc.Status, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Status to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Status + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } +} diff --git a/owl-bot-staging/v1/protos/protos.js b/owl-bot-staging/v1/protos/protos.js new file mode 100644 index 000000000..2aa5a7c34 --- /dev/null +++ b/owl-bot-staging/v1/protos/protos.js @@ -0,0 +1,45218 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +(function(global, factory) { /* global define, require, module */ + + /* AMD */ if (typeof define === 'function' && define.amd) + define(["protobufjs/minimal"], factory); + + /* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports) + module.exports = factory(require("google-gax/build/src/protobuf").protobufMinimal); + +})(this, function($protobuf) { + "use strict"; + + // Common aliases + var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + + // Exported root namespace + var $root = $protobuf.roots._google_cloud_spanner_protos || ($protobuf.roots._google_cloud_spanner_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + var protobuf = {}; + + protobuf.Struct = (function() { + + /** + * Properties of a Struct. + * @memberof google.protobuf + * @interface IStruct + * @property {Object.|null} [fields] Struct fields + */ + + /** + * Constructs a new Struct. + * @memberof google.protobuf + * @classdesc Represents a Struct. + * @implements IStruct + * @constructor + * @param {google.protobuf.IStruct=} [properties] Properties to set + */ + function Struct(properties) { + this.fields = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Struct fields. + * @member {Object.} fields + * @memberof google.protobuf.Struct + * @instance + */ + Struct.prototype.fields = $util.emptyObject; + + /** + * Creates a new Struct instance using the specified properties. + * @function create + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.IStruct=} [properties] Properties to set + * @returns {google.protobuf.Struct} Struct instance + */ + Struct.create = function create(properties) { + return new Struct(properties); + }; + + /** + * Encodes the specified Struct message. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.IStruct} message Struct message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Struct.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fields != null && Object.hasOwnProperty.call(message, "fields")) + for (var keys = Object.keys(message.fields), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.protobuf.Value.encode(message.fields[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified Struct message, length delimited. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.IStruct} message Struct message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Struct.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Struct message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Struct + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Struct} Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Struct.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Struct(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (message.fields === $util.emptyObject) + message.fields = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.fields[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Struct message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Struct + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Struct} Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Struct.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Struct message. + * @function verify + * @memberof google.protobuf.Struct + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Struct.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fields != null && message.hasOwnProperty("fields")) { + if (!$util.isObject(message.fields)) + return "fields: object expected"; + var key = Object.keys(message.fields); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.fields[key[i]]); + if (error) + return "fields." + error; + } + } + return null; + }; + + /** + * Creates a Struct message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Struct + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Struct} Struct + */ + Struct.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Struct) + return object; + var message = new $root.google.protobuf.Struct(); + if (object.fields) { + if (typeof object.fields !== "object") + throw TypeError(".google.protobuf.Struct.fields: object expected"); + message.fields = {}; + for (var keys = Object.keys(object.fields), i = 0; i < keys.length; ++i) { + if (typeof object.fields[keys[i]] !== "object") + throw TypeError(".google.protobuf.Struct.fields: object expected"); + message.fields[keys[i]] = $root.google.protobuf.Value.fromObject(object.fields[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a Struct message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.Struct} message Struct + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Struct.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.fields = {}; + var keys2; + if (message.fields && (keys2 = Object.keys(message.fields)).length) { + object.fields = {}; + for (var j = 0; j < keys2.length; ++j) + object.fields[keys2[j]] = $root.google.protobuf.Value.toObject(message.fields[keys2[j]], options); + } + return object; + }; + + /** + * Converts this Struct to JSON. + * @function toJSON + * @memberof google.protobuf.Struct + * @instance + * @returns {Object.} JSON object + */ + Struct.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Struct + * @function getTypeUrl + * @memberof google.protobuf.Struct + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Struct.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Struct"; + }; + + return Struct; + })(); + + protobuf.Value = (function() { + + /** + * Properties of a Value. + * @memberof google.protobuf + * @interface IValue + * @property {google.protobuf.NullValue|null} [nullValue] Value nullValue + * @property {number|null} [numberValue] Value numberValue + * @property {string|null} [stringValue] Value stringValue + * @property {boolean|null} [boolValue] Value boolValue + * @property {google.protobuf.IStruct|null} [structValue] Value structValue + * @property {google.protobuf.IListValue|null} [listValue] Value listValue + */ + + /** + * Constructs a new Value. + * @memberof google.protobuf + * @classdesc Represents a Value. + * @implements IValue + * @constructor + * @param {google.protobuf.IValue=} [properties] Properties to set + */ + function Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Value nullValue. + * @member {google.protobuf.NullValue|null|undefined} nullValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.nullValue = null; + + /** + * Value numberValue. + * @member {number|null|undefined} numberValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.numberValue = null; + + /** + * Value stringValue. + * @member {string|null|undefined} stringValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.stringValue = null; + + /** + * Value boolValue. + * @member {boolean|null|undefined} boolValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.boolValue = null; + + /** + * Value structValue. + * @member {google.protobuf.IStruct|null|undefined} structValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.structValue = null; + + /** + * Value listValue. + * @member {google.protobuf.IListValue|null|undefined} listValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.listValue = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Value kind. + * @member {"nullValue"|"numberValue"|"stringValue"|"boolValue"|"structValue"|"listValue"|undefined} kind + * @memberof google.protobuf.Value + * @instance + */ + Object.defineProperty(Value.prototype, "kind", { + get: $util.oneOfGetter($oneOfFields = ["nullValue", "numberValue", "stringValue", "boolValue", "structValue", "listValue"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.IValue=} [properties] Properties to set + * @returns {google.protobuf.Value} Value instance + */ + Value.create = function create(properties) { + return new Value(properties); + }; + + /** + * Encodes the specified Value message. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.IValue} message Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.nullValue != null && Object.hasOwnProperty.call(message, "nullValue")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.nullValue); + if (message.numberValue != null && Object.hasOwnProperty.call(message, "numberValue")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.numberValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.stringValue); + if (message.boolValue != null && Object.hasOwnProperty.call(message, "boolValue")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.boolValue); + if (message.structValue != null && Object.hasOwnProperty.call(message, "structValue")) + $root.google.protobuf.Struct.encode(message.structValue, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.listValue != null && Object.hasOwnProperty.call(message, "listValue")) + $root.google.protobuf.ListValue.encode(message.listValue, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Value message, length delimited. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.IValue} message Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Value} Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Value.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.nullValue = reader.int32(); + break; + } + case 2: { + message.numberValue = reader.double(); + break; + } + case 3: { + message.stringValue = reader.string(); + break; + } + case 4: { + message.boolValue = reader.bool(); + break; + } + case 5: { + message.structValue = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 6: { + message.listValue = $root.google.protobuf.ListValue.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Value} Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Value message. + * @function verify + * @memberof google.protobuf.Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.nullValue != null && message.hasOwnProperty("nullValue")) { + properties.kind = 1; + switch (message.nullValue) { + default: + return "nullValue: enum value expected"; + case 0: + break; + } + } + if (message.numberValue != null && message.hasOwnProperty("numberValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (typeof message.numberValue !== "number") + return "numberValue: number expected"; + } + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (!$util.isString(message.stringValue)) + return "stringValue: string expected"; + } + if (message.boolValue != null && message.hasOwnProperty("boolValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (typeof message.boolValue !== "boolean") + return "boolValue: boolean expected"; + } + if (message.structValue != null && message.hasOwnProperty("structValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.protobuf.Struct.verify(message.structValue); + if (error) + return "structValue." + error; + } + } + if (message.listValue != null && message.hasOwnProperty("listValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.protobuf.ListValue.verify(message.listValue); + if (error) + return "listValue." + error; + } + } + return null; + }; + + /** + * Creates a Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Value} Value + */ + Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Value) + return object; + var message = new $root.google.protobuf.Value(); + switch (object.nullValue) { + default: + if (typeof object.nullValue === "number") { + message.nullValue = object.nullValue; + break; + } + break; + case "NULL_VALUE": + case 0: + message.nullValue = 0; + break; + } + if (object.numberValue != null) + message.numberValue = Number(object.numberValue); + if (object.stringValue != null) + message.stringValue = String(object.stringValue); + if (object.boolValue != null) + message.boolValue = Boolean(object.boolValue); + if (object.structValue != null) { + if (typeof object.structValue !== "object") + throw TypeError(".google.protobuf.Value.structValue: object expected"); + message.structValue = $root.google.protobuf.Struct.fromObject(object.structValue); + } + if (object.listValue != null) { + if (typeof object.listValue !== "object") + throw TypeError(".google.protobuf.Value.listValue: object expected"); + message.listValue = $root.google.protobuf.ListValue.fromObject(object.listValue); + } + return message; + }; + + /** + * Creates a plain object from a Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.Value} message Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.nullValue != null && message.hasOwnProperty("nullValue")) { + object.nullValue = options.enums === String ? $root.google.protobuf.NullValue[message.nullValue] === undefined ? message.nullValue : $root.google.protobuf.NullValue[message.nullValue] : message.nullValue; + if (options.oneofs) + object.kind = "nullValue"; + } + if (message.numberValue != null && message.hasOwnProperty("numberValue")) { + object.numberValue = options.json && !isFinite(message.numberValue) ? String(message.numberValue) : message.numberValue; + if (options.oneofs) + object.kind = "numberValue"; + } + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + object.stringValue = message.stringValue; + if (options.oneofs) + object.kind = "stringValue"; + } + if (message.boolValue != null && message.hasOwnProperty("boolValue")) { + object.boolValue = message.boolValue; + if (options.oneofs) + object.kind = "boolValue"; + } + if (message.structValue != null && message.hasOwnProperty("structValue")) { + object.structValue = $root.google.protobuf.Struct.toObject(message.structValue, options); + if (options.oneofs) + object.kind = "structValue"; + } + if (message.listValue != null && message.hasOwnProperty("listValue")) { + object.listValue = $root.google.protobuf.ListValue.toObject(message.listValue, options); + if (options.oneofs) + object.kind = "listValue"; + } + return object; + }; + + /** + * Converts this Value to JSON. + * @function toJSON + * @memberof google.protobuf.Value + * @instance + * @returns {Object.} JSON object + */ + Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Value + * @function getTypeUrl + * @memberof google.protobuf.Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Value"; + }; + + return Value; + })(); + + /** + * NullValue enum. + * @name google.protobuf.NullValue + * @enum {number} + * @property {number} NULL_VALUE=0 NULL_VALUE value + */ + protobuf.NullValue = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NULL_VALUE"] = 0; + return values; + })(); + + protobuf.ListValue = (function() { + + /** + * Properties of a ListValue. + * @memberof google.protobuf + * @interface IListValue + * @property {Array.|null} [values] ListValue values + */ + + /** + * Constructs a new ListValue. + * @memberof google.protobuf + * @classdesc Represents a ListValue. + * @implements IListValue + * @constructor + * @param {google.protobuf.IListValue=} [properties] Properties to set + */ + function ListValue(properties) { + this.values = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListValue values. + * @member {Array.} values + * @memberof google.protobuf.ListValue + * @instance + */ + ListValue.prototype.values = $util.emptyArray; + + /** + * Creates a new ListValue instance using the specified properties. + * @function create + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.IListValue=} [properties] Properties to set + * @returns {google.protobuf.ListValue} ListValue instance + */ + ListValue.create = function create(properties) { + return new ListValue(properties); + }; + + /** + * Encodes the specified ListValue message. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.IListValue} message ListValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.values != null && message.values.length) + for (var i = 0; i < message.values.length; ++i) + $root.google.protobuf.Value.encode(message.values[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ListValue message, length delimited. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.IListValue} message ListValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ListValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ListValue} ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListValue.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ListValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.values && message.values.length)) + message.values = []; + message.values.push($root.google.protobuf.Value.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ListValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ListValue} ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListValue message. + * @function verify + * @memberof google.protobuf.ListValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.values != null && message.hasOwnProperty("values")) { + if (!Array.isArray(message.values)) + return "values: array expected"; + for (var i = 0; i < message.values.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.values[i]); + if (error) + return "values." + error; + } + } + return null; + }; + + /** + * Creates a ListValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ListValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ListValue} ListValue + */ + ListValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ListValue) + return object; + var message = new $root.google.protobuf.ListValue(); + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.protobuf.ListValue.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) { + if (typeof object.values[i] !== "object") + throw TypeError(".google.protobuf.ListValue.values: object expected"); + message.values[i] = $root.google.protobuf.Value.fromObject(object.values[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ListValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.ListValue} message ListValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.values = []; + if (message.values && message.values.length) { + object.values = []; + for (var j = 0; j < message.values.length; ++j) + object.values[j] = $root.google.protobuf.Value.toObject(message.values[j], options); + } + return object; + }; + + /** + * Converts this ListValue to JSON. + * @function toJSON + * @memberof google.protobuf.ListValue + * @instance + * @returns {Object.} JSON object + */ + ListValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListValue + * @function getTypeUrl + * @memberof google.protobuf.ListValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ListValue"; + }; + + return ListValue; + })(); + + protobuf.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof google.protobuf + * @interface ITimestamp + * @property {number|Long|null} [seconds] Timestamp seconds + * @property {number|null} [nanos] Timestamp nanos + */ + + /** + * Constructs a new Timestamp. + * @memberof google.protobuf + * @classdesc Represents a Timestamp. + * @implements ITimestamp + * @constructor + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + */ + function Timestamp(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Timestamp seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Timestamp nanos. + * @member {number} nanos + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + * @returns {google.protobuf.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Timestamp message. + * @function verify + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Timestamp.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Timestamp} Timestamp + */ + Timestamp.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Timestamp) + return object; + var message = new $root.google.protobuf.Timestamp(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.Timestamp} message Timestamp + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Timestamp.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Timestamp to JSON. + * @function toJSON + * @memberof google.protobuf.Timestamp + * @instance + * @returns {Object.} JSON object + */ + Timestamp.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof google.protobuf.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Timestamp"; + }; + + return Timestamp; + })(); + + protobuf.FileDescriptorSet = (function() { + + /** + * Properties of a FileDescriptorSet. + * @memberof google.protobuf + * @interface IFileDescriptorSet + * @property {Array.|null} [file] FileDescriptorSet file + */ + + /** + * Constructs a new FileDescriptorSet. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorSet. + * @implements IFileDescriptorSet + * @constructor + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + */ + function FileDescriptorSet(properties) { + this.file = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileDescriptorSet file. + * @member {Array.} file + * @memberof google.protobuf.FileDescriptorSet + * @instance + */ + FileDescriptorSet.prototype.file = $util.emptyArray; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance + */ + FileDescriptorSet.create = function create(properties) { + return new FileDescriptorSet(properties); + }; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.file != null && message.file.length) + for (var i = 0; i < message.file.length; ++i) + $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.file && message.file.length)) + message.file = []; + message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorSet message. + * @function verify + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.file != null && message.hasOwnProperty("file")) { + if (!Array.isArray(message.file)) + return "file: array expected"; + for (var i = 0; i < message.file.length; ++i) { + var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]); + if (error) + return "file." + error; + } + } + return null; + }; + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + */ + FileDescriptorSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorSet) + return object; + var message = new $root.google.protobuf.FileDescriptorSet(); + if (object.file) { + if (!Array.isArray(object.file)) + throw TypeError(".google.protobuf.FileDescriptorSet.file: array expected"); + message.file = []; + for (var i = 0; i < object.file.length; ++i) { + if (typeof object.file[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected"); + message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.file = []; + if (message.file && message.file.length) { + object.file = []; + for (var j = 0; j < message.file.length; ++j) + object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options); + } + return object; + }; + + /** + * Converts this FileDescriptorSet to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorSet + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileDescriptorSet + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorSet"; + }; + + return FileDescriptorSet; + })(); + + /** + * Edition enum. + * @name google.protobuf.Edition + * @enum {number} + * @property {number} EDITION_UNKNOWN=0 EDITION_UNKNOWN value + * @property {number} EDITION_PROTO2=998 EDITION_PROTO2 value + * @property {number} EDITION_PROTO3=999 EDITION_PROTO3 value + * @property {number} EDITION_2023=1000 EDITION_2023 value + * @property {number} EDITION_2024=1001 EDITION_2024 value + * @property {number} EDITION_1_TEST_ONLY=1 EDITION_1_TEST_ONLY value + * @property {number} EDITION_2_TEST_ONLY=2 EDITION_2_TEST_ONLY value + * @property {number} EDITION_99997_TEST_ONLY=99997 EDITION_99997_TEST_ONLY value + * @property {number} EDITION_99998_TEST_ONLY=99998 EDITION_99998_TEST_ONLY value + * @property {number} EDITION_99999_TEST_ONLY=99999 EDITION_99999_TEST_ONLY value + * @property {number} EDITION_MAX=2147483647 EDITION_MAX value + */ + protobuf.Edition = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EDITION_UNKNOWN"] = 0; + values[valuesById[998] = "EDITION_PROTO2"] = 998; + values[valuesById[999] = "EDITION_PROTO3"] = 999; + values[valuesById[1000] = "EDITION_2023"] = 1000; + values[valuesById[1001] = "EDITION_2024"] = 1001; + values[valuesById[1] = "EDITION_1_TEST_ONLY"] = 1; + values[valuesById[2] = "EDITION_2_TEST_ONLY"] = 2; + values[valuesById[99997] = "EDITION_99997_TEST_ONLY"] = 99997; + values[valuesById[99998] = "EDITION_99998_TEST_ONLY"] = 99998; + values[valuesById[99999] = "EDITION_99999_TEST_ONLY"] = 99999; + values[valuesById[2147483647] = "EDITION_MAX"] = 2147483647; + return values; + })(); + + protobuf.FileDescriptorProto = (function() { + + /** + * Properties of a FileDescriptorProto. + * @memberof google.protobuf + * @interface IFileDescriptorProto + * @property {string|null} [name] FileDescriptorProto name + * @property {string|null} ["package"] FileDescriptorProto package + * @property {Array.|null} [dependency] FileDescriptorProto dependency + * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency + * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency + * @property {Array.|null} [messageType] FileDescriptorProto messageType + * @property {Array.|null} [enumType] FileDescriptorProto enumType + * @property {Array.|null} [service] FileDescriptorProto service + * @property {Array.|null} [extension] FileDescriptorProto extension + * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options + * @property {google.protobuf.ISourceCodeInfo|null} [sourceCodeInfo] FileDescriptorProto sourceCodeInfo + * @property {string|null} [syntax] FileDescriptorProto syntax + * @property {google.protobuf.Edition|null} [edition] FileDescriptorProto edition + */ + + /** + * Constructs a new FileDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorProto. + * @implements IFileDescriptorProto + * @constructor + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + */ + function FileDescriptorProto(properties) { + this.dependency = []; + this.publicDependency = []; + this.weakDependency = []; + this.messageType = []; + this.enumType = []; + this.service = []; + this.extension = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.name = ""; + + /** + * FileDescriptorProto package. + * @member {string} package + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype["package"] = ""; + + /** + * FileDescriptorProto dependency. + * @member {Array.} dependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.dependency = $util.emptyArray; + + /** + * FileDescriptorProto publicDependency. + * @member {Array.} publicDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.publicDependency = $util.emptyArray; + + /** + * FileDescriptorProto weakDependency. + * @member {Array.} weakDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.weakDependency = $util.emptyArray; + + /** + * FileDescriptorProto messageType. + * @member {Array.} messageType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.messageType = $util.emptyArray; + + /** + * FileDescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * FileDescriptorProto service. + * @member {Array.} service + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.service = $util.emptyArray; + + /** + * FileDescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.extension = $util.emptyArray; + + /** + * FileDescriptorProto options. + * @member {google.protobuf.IFileOptions|null|undefined} options + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.options = null; + + /** + * FileDescriptorProto sourceCodeInfo. + * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.sourceCodeInfo = null; + + /** + * FileDescriptorProto syntax. + * @member {string} syntax + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.syntax = ""; + + /** + * FileDescriptorProto edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.edition = 0; + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance + */ + FileDescriptorProto.create = function create(properties) { + return new FileDescriptorProto(properties); + }; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); + if (message.dependency != null && message.dependency.length) + for (var i = 0; i < message.dependency.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); + if (message.messageType != null && message.messageType.length) + for (var i = 0; i < message.messageType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.service != null && message.service.length) + for (var i = 0; i < message.service.length; ++i) + $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo")) + $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.publicDependency != null && message.publicDependency.length) + for (var i = 0; i < message.publicDependency.length; ++i) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]); + if (message.weakDependency != null && message.weakDependency.length) + for (var i = 0; i < message.weakDependency.length; ++i) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); + if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 14, wireType 0 =*/112).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message["package"] = reader.string(); + break; + } + case 3: { + if (!(message.dependency && message.dependency.length)) + message.dependency = []; + message.dependency.push(reader.string()); + break; + } + case 10: { + if (!(message.publicDependency && message.publicDependency.length)) + message.publicDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.publicDependency.push(reader.int32()); + } else + message.publicDependency.push(reader.int32()); + break; + } + case 11: { + if (!(message.weakDependency && message.weakDependency.length)) + message.weakDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.weakDependency.push(reader.int32()); + } else + message.weakDependency.push(reader.int32()); + break; + } + case 4: { + if (!(message.messageType && message.messageType.length)) + message.messageType = []; + message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.service && message.service.length)) + message.service = []; + message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 7: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 8: { + message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32()); + break; + } + case 12: { + message.syntax = reader.string(); + break; + } + case 14: { + message.edition = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorProto message. + * @function verify + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message["package"] != null && message.hasOwnProperty("package")) + if (!$util.isString(message["package"])) + return "package: string expected"; + if (message.dependency != null && message.hasOwnProperty("dependency")) { + if (!Array.isArray(message.dependency)) + return "dependency: array expected"; + for (var i = 0; i < message.dependency.length; ++i) + if (!$util.isString(message.dependency[i])) + return "dependency: string[] expected"; + } + if (message.publicDependency != null && message.hasOwnProperty("publicDependency")) { + if (!Array.isArray(message.publicDependency)) + return "publicDependency: array expected"; + for (var i = 0; i < message.publicDependency.length; ++i) + if (!$util.isInteger(message.publicDependency[i])) + return "publicDependency: integer[] expected"; + } + if (message.weakDependency != null && message.hasOwnProperty("weakDependency")) { + if (!Array.isArray(message.weakDependency)) + return "weakDependency: array expected"; + for (var i = 0; i < message.weakDependency.length; ++i) + if (!$util.isInteger(message.weakDependency[i])) + return "weakDependency: integer[] expected"; + } + if (message.messageType != null && message.hasOwnProperty("messageType")) { + if (!Array.isArray(message.messageType)) + return "messageType: array expected"; + for (var i = 0; i < message.messageType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.messageType[i]); + if (error) + return "messageType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.service != null && message.hasOwnProperty("service")) { + if (!Array.isArray(message.service)) + return "service: array expected"; + for (var i = 0; i < message.service.length; ++i) { + var error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i]); + if (error) + return "service." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FileOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) { + var error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo); + if (error) + return "sourceCodeInfo." + error; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + if (!$util.isString(message.syntax)) + return "syntax: string expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + return null; + }; + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + */ + FileDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorProto) + return object; + var message = new $root.google.protobuf.FileDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object["package"] != null) + message["package"] = String(object["package"]); + if (object.dependency) { + if (!Array.isArray(object.dependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.dependency: array expected"); + message.dependency = []; + for (var i = 0; i < object.dependency.length; ++i) + message.dependency[i] = String(object.dependency[i]); + } + if (object.publicDependency) { + if (!Array.isArray(object.publicDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.publicDependency: array expected"); + message.publicDependency = []; + for (var i = 0; i < object.publicDependency.length; ++i) + message.publicDependency[i] = object.publicDependency[i] | 0; + } + if (object.weakDependency) { + if (!Array.isArray(object.weakDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.weakDependency: array expected"); + message.weakDependency = []; + for (var i = 0; i < object.weakDependency.length; ++i) + message.weakDependency[i] = object.weakDependency[i] | 0; + } + if (object.messageType) { + if (!Array.isArray(object.messageType)) + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); + message.messageType = []; + for (var i = 0; i < object.messageType.length; ++i) { + if (typeof object.messageType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: object expected"); + message.messageType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.messageType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.service) { + if (!Array.isArray(object.service)) + throw TypeError(".google.protobuf.FileDescriptorProto.service: array expected"); + message.service = []; + for (var i = 0; i < object.service.length; ++i) { + if (typeof object.service[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.service: object expected"); + message.service[i] = $root.google.protobuf.ServiceDescriptorProto.fromObject(object.service[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.FileDescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FileOptions.fromObject(object.options); + } + if (object.sourceCodeInfo != null) { + if (typeof object.sourceCodeInfo !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.sourceCodeInfo: object expected"); + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.fromObject(object.sourceCodeInfo); + } + if (object.syntax != null) + message.syntax = String(object.syntax); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + return message; + }; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.dependency = []; + object.messageType = []; + object.enumType = []; + object.service = []; + object.extension = []; + object.publicDependency = []; + object.weakDependency = []; + } + if (options.defaults) { + object.name = ""; + object["package"] = ""; + object.options = null; + object.sourceCodeInfo = null; + object.syntax = ""; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message["package"] != null && message.hasOwnProperty("package")) + object["package"] = message["package"]; + if (message.dependency && message.dependency.length) { + object.dependency = []; + for (var j = 0; j < message.dependency.length; ++j) + object.dependency[j] = message.dependency[j]; + } + if (message.messageType && message.messageType.length) { + object.messageType = []; + for (var j = 0; j < message.messageType.length; ++j) + object.messageType[j] = $root.google.protobuf.DescriptorProto.toObject(message.messageType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.service && message.service.length) { + object.service = []; + for (var j = 0; j < message.service.length; ++j) + object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FileOptions.toObject(message.options, options); + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) + object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options); + if (message.publicDependency && message.publicDependency.length) { + object.publicDependency = []; + for (var j = 0; j < message.publicDependency.length; ++j) + object.publicDependency[j] = message.publicDependency[j]; + } + if (message.weakDependency && message.weakDependency.length) { + object.weakDependency = []; + for (var j = 0; j < message.weakDependency.length; ++j) + object.weakDependency[j] = message.weakDependency[j]; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + object.syntax = message.syntax; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this FileDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorProto"; + }; + + return FileDescriptorProto; + })(); + + protobuf.DescriptorProto = (function() { + + /** + * Properties of a DescriptorProto. + * @memberof google.protobuf + * @interface IDescriptorProto + * @property {string|null} [name] DescriptorProto name + * @property {Array.|null} [field] DescriptorProto field + * @property {Array.|null} [extension] DescriptorProto extension + * @property {Array.|null} [nestedType] DescriptorProto nestedType + * @property {Array.|null} [enumType] DescriptorProto enumType + * @property {Array.|null} [extensionRange] DescriptorProto extensionRange + * @property {Array.|null} [oneofDecl] DescriptorProto oneofDecl + * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options + * @property {Array.|null} [reservedRange] DescriptorProto reservedRange + * @property {Array.|null} [reservedName] DescriptorProto reservedName + */ + + /** + * Constructs a new DescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a DescriptorProto. + * @implements IDescriptorProto + * @constructor + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + */ + function DescriptorProto(properties) { + this.field = []; + this.extension = []; + this.nestedType = []; + this.enumType = []; + this.extensionRange = []; + this.oneofDecl = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DescriptorProto name. + * @member {string} name + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.name = ""; + + /** + * DescriptorProto field. + * @member {Array.} field + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.field = $util.emptyArray; + + /** + * DescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extension = $util.emptyArray; + + /** + * DescriptorProto nestedType. + * @member {Array.} nestedType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.nestedType = $util.emptyArray; + + /** + * DescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * DescriptorProto extensionRange. + * @member {Array.} extensionRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extensionRange = $util.emptyArray; + + /** + * DescriptorProto oneofDecl. + * @member {Array.} oneofDecl + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.oneofDecl = $util.emptyArray; + + /** + * DescriptorProto options. + * @member {google.protobuf.IMessageOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.options = null; + + /** + * DescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * DescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto} DescriptorProto instance + */ + DescriptorProto.create = function create(properties) { + return new DescriptorProto(properties); + }; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.field != null && message.field.length) + for (var i = 0; i < message.field.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nestedType != null && message.nestedType.length) + for (var i = 0; i < message.nestedType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.nestedType[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.extensionRange != null && message.extensionRange.length) + for (var i = 0; i < message.extensionRange.length; ++i) + $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extensionRange[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.oneofDecl != null && message.oneofDecl.length) + for (var i = 0; i < message.oneofDecl.length; ++i) + $root.google.protobuf.OneofDescriptorProto.encode(message.oneofDecl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.field && message.field.length)) + message.field = []; + message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.nestedType && message.nestedType.length)) + message.nestedType = []; + message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.extensionRange && message.extensionRange.length)) + message.extensionRange = []; + message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32())); + break; + } + case 8: { + if (!(message.oneofDecl && message.oneofDecl.length)) + message.oneofDecl = []; + message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 7: { + message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32())); + break; + } + case 10: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DescriptorProto message. + * @function verify + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.field != null && message.hasOwnProperty("field")) { + if (!Array.isArray(message.field)) + return "field: array expected"; + for (var i = 0; i < message.field.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.field[i]); + if (error) + return "field." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.nestedType != null && message.hasOwnProperty("nestedType")) { + if (!Array.isArray(message.nestedType)) + return "nestedType: array expected"; + for (var i = 0; i < message.nestedType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.nestedType[i]); + if (error) + return "nestedType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.extensionRange != null && message.hasOwnProperty("extensionRange")) { + if (!Array.isArray(message.extensionRange)) + return "extensionRange: array expected"; + for (var i = 0; i < message.extensionRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ExtensionRange.verify(message.extensionRange[i]); + if (error) + return "extensionRange." + error; + } + } + if (message.oneofDecl != null && message.hasOwnProperty("oneofDecl")) { + if (!Array.isArray(message.oneofDecl)) + return "oneofDecl: array expected"; + for (var i = 0; i < message.oneofDecl.length; ++i) { + var error = $root.google.protobuf.OneofDescriptorProto.verify(message.oneofDecl[i]); + if (error) + return "oneofDecl." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MessageOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto} DescriptorProto + */ + DescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto) + return object; + var message = new $root.google.protobuf.DescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.field) { + if (!Array.isArray(object.field)) + throw TypeError(".google.protobuf.DescriptorProto.field: array expected"); + message.field = []; + for (var i = 0; i < object.field.length; ++i) { + if (typeof object.field[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.field: object expected"); + message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.DescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.nestedType) { + if (!Array.isArray(object.nestedType)) + throw TypeError(".google.protobuf.DescriptorProto.nestedType: array expected"); + message.nestedType = []; + for (var i = 0; i < object.nestedType.length; ++i) { + if (typeof object.nestedType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.nestedType: object expected"); + message.nestedType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nestedType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.DescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.extensionRange) { + if (!Array.isArray(object.extensionRange)) + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: array expected"); + message.extensionRange = []; + for (var i = 0; i < object.extensionRange.length; ++i) { + if (typeof object.extensionRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: object expected"); + message.extensionRange[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extensionRange[i]); + } + } + if (object.oneofDecl) { + if (!Array.isArray(object.oneofDecl)) + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: array expected"); + message.oneofDecl = []; + for (var i = 0; i < object.oneofDecl.length; ++i) { + if (typeof object.oneofDecl[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: object expected"); + message.oneofDecl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneofDecl[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MessageOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.DescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.DescriptorProto} message DescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.field = []; + object.nestedType = []; + object.enumType = []; + object.extensionRange = []; + object.extension = []; + object.oneofDecl = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.field && message.field.length) { + object.field = []; + for (var j = 0; j < message.field.length; ++j) + object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options); + } + if (message.nestedType && message.nestedType.length) { + object.nestedType = []; + for (var j = 0; j < message.nestedType.length; ++j) + object.nestedType[j] = $root.google.protobuf.DescriptorProto.toObject(message.nestedType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.extensionRange && message.extensionRange.length) { + object.extensionRange = []; + for (var j = 0; j < message.extensionRange.length; ++j) + object.extensionRange[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extensionRange[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options); + if (message.oneofDecl && message.oneofDecl.length) { + object.oneofDecl = []; + for (var j = 0; j < message.oneofDecl.length; ++j) + object.oneofDecl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneofDecl[j], options); + } + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this DescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto + * @instance + * @returns {Object.} JSON object + */ + DescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto"; + }; + + DescriptorProto.ExtensionRange = (function() { + + /** + * Properties of an ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @interface IExtensionRange + * @property {number|null} [start] ExtensionRange start + * @property {number|null} [end] ExtensionRange end + * @property {google.protobuf.IExtensionRangeOptions|null} [options] ExtensionRange options + */ + + /** + * Constructs a new ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents an ExtensionRange. + * @implements IExtensionRange + * @constructor + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + */ + function ExtensionRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.start = 0; + + /** + * ExtensionRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.end = 0; + + /** + * ExtensionRange options. + * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.options = null; + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance + */ + ExtensionRange.create = function create(properties) { + return new ExtensionRange(properties); + }; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.ExtensionRangeOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ExtensionRangeOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + */ + ExtensionRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange.options: object expected"); + message.options = $root.google.protobuf.ExtensionRangeOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + object.options = null; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ExtensionRangeOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ExtensionRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + * @returns {Object.} JSON object + */ + ExtensionRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtensionRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ExtensionRange"; + }; + + return ExtensionRange; + })(); + + DescriptorProto.ReservedRange = (function() { + + /** + * Properties of a ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @interface IReservedRange + * @property {number|null} [start] ReservedRange start + * @property {number|null} [end] ReservedRange end + */ + + /** + * Constructs a new ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents a ReservedRange. + * @implements IReservedRange + * @constructor + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + */ + function ReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReservedRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.start = 0; + + /** + * ReservedRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.end = 0; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance + */ + ReservedRange.create = function create(properties) { + return new ReservedRange(properties); + }; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReservedRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + */ + ReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this ReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + * @returns {Object.} JSON object + */ + ReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReservedRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ReservedRange"; + }; + + return ReservedRange; + })(); + + return DescriptorProto; + })(); + + protobuf.ExtensionRangeOptions = (function() { + + /** + * Properties of an ExtensionRangeOptions. + * @memberof google.protobuf + * @interface IExtensionRangeOptions + * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption + * @property {Array.|null} [declaration] ExtensionRangeOptions declaration + * @property {google.protobuf.IFeatureSet|null} [features] ExtensionRangeOptions features + * @property {google.protobuf.ExtensionRangeOptions.VerificationState|null} [verification] ExtensionRangeOptions verification + */ + + /** + * Constructs a new ExtensionRangeOptions. + * @memberof google.protobuf + * @classdesc Represents an ExtensionRangeOptions. + * @implements IExtensionRangeOptions + * @constructor + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + */ + function ExtensionRangeOptions(properties) { + this.uninterpretedOption = []; + this.declaration = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRangeOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * ExtensionRangeOptions declaration. + * @member {Array.} declaration + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.declaration = $util.emptyArray; + + /** + * ExtensionRangeOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.features = null; + + /** + * ExtensionRangeOptions verification. + * @member {google.protobuf.ExtensionRangeOptions.VerificationState} verification + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.verification = 1; + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions instance + */ + ExtensionRangeOptions.create = function create(properties) { + return new ExtensionRangeOptions(properties); + }; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.declaration != null && message.declaration.length) + for (var i = 0; i < message.declaration.length; ++i) + $root.google.protobuf.ExtensionRangeOptions.Declaration.encode(message.declaration[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.verification != null && Object.hasOwnProperty.call(message, "verification")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.verification); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.declaration && message.declaration.length)) + message.declaration = []; + message.declaration.push($root.google.protobuf.ExtensionRangeOptions.Declaration.decode(reader, reader.uint32())); + break; + } + case 50: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 3: { + message.verification = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRangeOptions message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRangeOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message.declaration != null && message.hasOwnProperty("declaration")) { + if (!Array.isArray(message.declaration)) + return "declaration: array expected"; + for (var i = 0; i < message.declaration.length; ++i) { + var error = $root.google.protobuf.ExtensionRangeOptions.Declaration.verify(message.declaration[i]); + if (error) + return "declaration." + error; + } + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.verification != null && message.hasOwnProperty("verification")) + switch (message.verification) { + default: + return "verification: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + */ + ExtensionRangeOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions) + return object; + var message = new $root.google.protobuf.ExtensionRangeOptions(); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object.declaration) { + if (!Array.isArray(object.declaration)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: array expected"); + message.declaration = []; + for (var i = 0; i < object.declaration.length; ++i) { + if (typeof object.declaration[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: object expected"); + message.declaration[i] = $root.google.protobuf.ExtensionRangeOptions.Declaration.fromObject(object.declaration[i]); + } + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + switch (object.verification) { + case "DECLARATION": + case 0: + message.verification = 0; + break; + default: + if (typeof object.verification === "number") { + message.verification = object.verification; + break; + } + break; + case "UNVERIFIED": + case 1: + message.verification = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRangeOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.declaration = []; + object.uninterpretedOption = []; + } + if (options.defaults) { + object.verification = options.enums === String ? "UNVERIFIED" : 1; + object.features = null; + } + if (message.declaration && message.declaration.length) { + object.declaration = []; + for (var j = 0; j < message.declaration.length; ++j) + object.declaration[j] = $root.google.protobuf.ExtensionRangeOptions.Declaration.toObject(message.declaration[j], options); + } + if (message.verification != null && message.hasOwnProperty("verification")) + object.verification = options.enums === String ? $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] === undefined ? message.verification : $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] : message.verification; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + * @returns {Object.} JSON object + */ + ExtensionRangeOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @function getTypeUrl + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRangeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions"; + }; + + ExtensionRangeOptions.Declaration = (function() { + + /** + * Properties of a Declaration. + * @memberof google.protobuf.ExtensionRangeOptions + * @interface IDeclaration + * @property {number|null} [number] Declaration number + * @property {string|null} [fullName] Declaration fullName + * @property {string|null} [type] Declaration type + * @property {boolean|null} [reserved] Declaration reserved + * @property {boolean|null} [repeated] Declaration repeated + */ + + /** + * Constructs a new Declaration. + * @memberof google.protobuf.ExtensionRangeOptions + * @classdesc Represents a Declaration. + * @implements IDeclaration + * @constructor + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set + */ + function Declaration(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Declaration number. + * @member {number} number + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.number = 0; + + /** + * Declaration fullName. + * @member {string} fullName + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.fullName = ""; + + /** + * Declaration type. + * @member {string} type + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.type = ""; + + /** + * Declaration reserved. + * @member {boolean} reserved + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.reserved = false; + + /** + * Declaration repeated. + * @member {boolean} repeated + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.repeated = false; + + /** + * Creates a new Declaration instance using the specified properties. + * @function create + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration instance + */ + Declaration.create = function create(properties) { + return new Declaration(properties); + }; + + /** + * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Declaration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.number); + if (message.fullName != null && Object.hasOwnProperty.call(message, "fullName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.fullName); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.type); + if (message.reserved != null && Object.hasOwnProperty.call(message, "reserved")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.reserved); + if (message.repeated != null && Object.hasOwnProperty.call(message, "repeated")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.repeated); + return writer; + }; + + /** + * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Declaration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Declaration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Declaration.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.number = reader.int32(); + break; + } + case 2: { + message.fullName = reader.string(); + break; + } + case 3: { + message.type = reader.string(); + break; + } + case 5: { + message.reserved = reader.bool(); + break; + } + case 6: { + message.repeated = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Declaration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Declaration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Declaration message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Declaration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.fullName != null && message.hasOwnProperty("fullName")) + if (!$util.isString(message.fullName)) + return "fullName: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.reserved != null && message.hasOwnProperty("reserved")) + if (typeof message.reserved !== "boolean") + return "reserved: boolean expected"; + if (message.repeated != null && message.hasOwnProperty("repeated")) + if (typeof message.repeated !== "boolean") + return "repeated: boolean expected"; + return null; + }; + + /** + * Creates a Declaration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + */ + Declaration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions.Declaration) + return object; + var message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); + if (object.number != null) + message.number = object.number | 0; + if (object.fullName != null) + message.fullName = String(object.fullName); + if (object.type != null) + message.type = String(object.type); + if (object.reserved != null) + message.reserved = Boolean(object.reserved); + if (object.repeated != null) + message.repeated = Boolean(object.repeated); + return message; + }; + + /** + * Creates a plain object from a Declaration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.Declaration} message Declaration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Declaration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.number = 0; + object.fullName = ""; + object.type = ""; + object.reserved = false; + object.repeated = false; + } + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.fullName != null && message.hasOwnProperty("fullName")) + object.fullName = message.fullName; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.reserved != null && message.hasOwnProperty("reserved")) + object.reserved = message.reserved; + if (message.repeated != null && message.hasOwnProperty("repeated")) + object.repeated = message.repeated; + return object; + }; + + /** + * Converts this Declaration to JSON. + * @function toJSON + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + * @returns {Object.} JSON object + */ + Declaration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Declaration + * @function getTypeUrl + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Declaration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions.Declaration"; + }; + + return Declaration; + })(); + + /** + * VerificationState enum. + * @name google.protobuf.ExtensionRangeOptions.VerificationState + * @enum {number} + * @property {number} DECLARATION=0 DECLARATION value + * @property {number} UNVERIFIED=1 UNVERIFIED value + */ + ExtensionRangeOptions.VerificationState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DECLARATION"] = 0; + values[valuesById[1] = "UNVERIFIED"] = 1; + return values; + })(); + + return ExtensionRangeOptions; + })(); + + protobuf.FieldDescriptorProto = (function() { + + /** + * Properties of a FieldDescriptorProto. + * @memberof google.protobuf + * @interface IFieldDescriptorProto + * @property {string|null} [name] FieldDescriptorProto name + * @property {number|null} [number] FieldDescriptorProto number + * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label + * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type + * @property {string|null} [typeName] FieldDescriptorProto typeName + * @property {string|null} [extendee] FieldDescriptorProto extendee + * @property {string|null} [defaultValue] FieldDescriptorProto defaultValue + * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex + * @property {string|null} [jsonName] FieldDescriptorProto jsonName + * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options + * @property {boolean|null} [proto3Optional] FieldDescriptorProto proto3Optional + */ + + /** + * Constructs a new FieldDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FieldDescriptorProto. + * @implements IFieldDescriptorProto + * @constructor + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + */ + function FieldDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.name = ""; + + /** + * FieldDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.number = 0; + + /** + * FieldDescriptorProto label. + * @member {google.protobuf.FieldDescriptorProto.Label} label + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.label = 1; + + /** + * FieldDescriptorProto type. + * @member {google.protobuf.FieldDescriptorProto.Type} type + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.type = 1; + + /** + * FieldDescriptorProto typeName. + * @member {string} typeName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.typeName = ""; + + /** + * FieldDescriptorProto extendee. + * @member {string} extendee + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.extendee = ""; + + /** + * FieldDescriptorProto defaultValue. + * @member {string} defaultValue + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.defaultValue = ""; + + /** + * FieldDescriptorProto oneofIndex. + * @member {number} oneofIndex + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.oneofIndex = 0; + + /** + * FieldDescriptorProto jsonName. + * @member {string} jsonName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.jsonName = ""; + + /** + * FieldDescriptorProto options. + * @member {google.protobuf.IFieldOptions|null|undefined} options + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.options = null; + + /** + * FieldDescriptorProto proto3Optional. + * @member {boolean} proto3Optional + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.proto3Optional = false; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance + */ + FieldDescriptorProto.create = function create(properties) { + return new FieldDescriptorProto(properties); + }; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); + if (message.label != null && Object.hasOwnProperty.call(message, "label")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); + if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); + if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); + if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); + if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.proto3Optional); + return writer; + }; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.number = reader.int32(); + break; + } + case 4: { + message.label = reader.int32(); + break; + } + case 5: { + message.type = reader.int32(); + break; + } + case 6: { + message.typeName = reader.string(); + break; + } + case 2: { + message.extendee = reader.string(); + break; + } + case 7: { + message.defaultValue = reader.string(); + break; + } + case 9: { + message.oneofIndex = reader.int32(); + break; + } + case 10: { + message.jsonName = reader.string(); + break; + } + case 8: { + message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); + break; + } + case 17: { + message.proto3Optional = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldDescriptorProto message. + * @function verify + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.label != null && message.hasOwnProperty("label")) + switch (message.label) { + default: + return "label: enum value expected"; + case 1: + case 3: + case 2: + break; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + break; + } + if (message.typeName != null && message.hasOwnProperty("typeName")) + if (!$util.isString(message.typeName)) + return "typeName: string expected"; + if (message.extendee != null && message.hasOwnProperty("extendee")) + if (!$util.isString(message.extendee)) + return "extendee: string expected"; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + if (!$util.isString(message.defaultValue)) + return "defaultValue: string expected"; + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + if (!$util.isInteger(message.oneofIndex)) + return "oneofIndex: integer expected"; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + if (!$util.isString(message.jsonName)) + return "jsonName: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FieldOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + if (typeof message.proto3Optional !== "boolean") + return "proto3Optional: boolean expected"; + return null; + }; + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + */ + FieldDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldDescriptorProto) + return object; + var message = new $root.google.protobuf.FieldDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + switch (object.label) { + default: + if (typeof object.label === "number") { + message.label = object.label; + break; + } + break; + case "LABEL_OPTIONAL": + case 1: + message.label = 1; + break; + case "LABEL_REPEATED": + case 3: + message.label = 3; + break; + case "LABEL_REQUIRED": + case 2: + message.label = 2; + break; + } + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_DOUBLE": + case 1: + message.type = 1; + break; + case "TYPE_FLOAT": + case 2: + message.type = 2; + break; + case "TYPE_INT64": + case 3: + message.type = 3; + break; + case "TYPE_UINT64": + case 4: + message.type = 4; + break; + case "TYPE_INT32": + case 5: + message.type = 5; + break; + case "TYPE_FIXED64": + case 6: + message.type = 6; + break; + case "TYPE_FIXED32": + case 7: + message.type = 7; + break; + case "TYPE_BOOL": + case 8: + message.type = 8; + break; + case "TYPE_STRING": + case 9: + message.type = 9; + break; + case "TYPE_GROUP": + case 10: + message.type = 10; + break; + case "TYPE_MESSAGE": + case 11: + message.type = 11; + break; + case "TYPE_BYTES": + case 12: + message.type = 12; + break; + case "TYPE_UINT32": + case 13: + message.type = 13; + break; + case "TYPE_ENUM": + case 14: + message.type = 14; + break; + case "TYPE_SFIXED32": + case 15: + message.type = 15; + break; + case "TYPE_SFIXED64": + case 16: + message.type = 16; + break; + case "TYPE_SINT32": + case 17: + message.type = 17; + break; + case "TYPE_SINT64": + case 18: + message.type = 18; + break; + } + if (object.typeName != null) + message.typeName = String(object.typeName); + if (object.extendee != null) + message.extendee = String(object.extendee); + if (object.defaultValue != null) + message.defaultValue = String(object.defaultValue); + if (object.oneofIndex != null) + message.oneofIndex = object.oneofIndex | 0; + if (object.jsonName != null) + message.jsonName = String(object.jsonName); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FieldOptions.fromObject(object.options); + } + if (object.proto3Optional != null) + message.proto3Optional = Boolean(object.proto3Optional); + return message; + }; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.extendee = ""; + object.number = 0; + object.label = options.enums === String ? "LABEL_OPTIONAL" : 1; + object.type = options.enums === String ? "TYPE_DOUBLE" : 1; + object.typeName = ""; + object.defaultValue = ""; + object.options = null; + object.oneofIndex = 0; + object.jsonName = ""; + object.proto3Optional = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.extendee != null && message.hasOwnProperty("extendee")) + object.extendee = message.extendee; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.label != null && message.hasOwnProperty("label")) + object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] === undefined ? message.label : $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] === undefined ? message.type : $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; + if (message.typeName != null && message.hasOwnProperty("typeName")) + object.typeName = message.typeName; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + object.defaultValue = message.defaultValue; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options); + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + object.oneofIndex = message.oneofIndex; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + object.jsonName = message.jsonName; + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + object.proto3Optional = message.proto3Optional; + return object; + }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FieldDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FieldDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldDescriptorProto"; + }; + + /** + * Type enum. + * @name google.protobuf.FieldDescriptorProto.Type + * @enum {number} + * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value + * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value + * @property {number} TYPE_INT64=3 TYPE_INT64 value + * @property {number} TYPE_UINT64=4 TYPE_UINT64 value + * @property {number} TYPE_INT32=5 TYPE_INT32 value + * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value + * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value + * @property {number} TYPE_BOOL=8 TYPE_BOOL value + * @property {number} TYPE_STRING=9 TYPE_STRING value + * @property {number} TYPE_GROUP=10 TYPE_GROUP value + * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value + * @property {number} TYPE_BYTES=12 TYPE_BYTES value + * @property {number} TYPE_UINT32=13 TYPE_UINT32 value + * @property {number} TYPE_ENUM=14 TYPE_ENUM value + * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value + * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value + * @property {number} TYPE_SINT32=17 TYPE_SINT32 value + * @property {number} TYPE_SINT64=18 TYPE_SINT64 value + */ + FieldDescriptorProto.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "TYPE_DOUBLE"] = 1; + values[valuesById[2] = "TYPE_FLOAT"] = 2; + values[valuesById[3] = "TYPE_INT64"] = 3; + values[valuesById[4] = "TYPE_UINT64"] = 4; + values[valuesById[5] = "TYPE_INT32"] = 5; + values[valuesById[6] = "TYPE_FIXED64"] = 6; + values[valuesById[7] = "TYPE_FIXED32"] = 7; + values[valuesById[8] = "TYPE_BOOL"] = 8; + values[valuesById[9] = "TYPE_STRING"] = 9; + values[valuesById[10] = "TYPE_GROUP"] = 10; + values[valuesById[11] = "TYPE_MESSAGE"] = 11; + values[valuesById[12] = "TYPE_BYTES"] = 12; + values[valuesById[13] = "TYPE_UINT32"] = 13; + values[valuesById[14] = "TYPE_ENUM"] = 14; + values[valuesById[15] = "TYPE_SFIXED32"] = 15; + values[valuesById[16] = "TYPE_SFIXED64"] = 16; + values[valuesById[17] = "TYPE_SINT32"] = 17; + values[valuesById[18] = "TYPE_SINT64"] = 18; + return values; + })(); + + /** + * Label enum. + * @name google.protobuf.FieldDescriptorProto.Label + * @enum {number} + * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value + * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value + * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value + */ + FieldDescriptorProto.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "LABEL_OPTIONAL"] = 1; + values[valuesById[3] = "LABEL_REPEATED"] = 3; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; + return values; + })(); + + return FieldDescriptorProto; + })(); + + protobuf.OneofDescriptorProto = (function() { + + /** + * Properties of an OneofDescriptorProto. + * @memberof google.protobuf + * @interface IOneofDescriptorProto + * @property {string|null} [name] OneofDescriptorProto name + * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options + */ + + /** + * Constructs a new OneofDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an OneofDescriptorProto. + * @implements IOneofDescriptorProto + * @constructor + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + */ + function OneofDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.name = ""; + + /** + * OneofDescriptorProto options. + * @member {google.protobuf.IOneofOptions|null|undefined} options + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.options = null; + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance + */ + OneofDescriptorProto.create = function create(properties) { + return new OneofDescriptorProto(properties); + }; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofDescriptorProto message. + * @function verify + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.OneofOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + */ + OneofDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofDescriptorProto) + return object; + var message = new $root.google.protobuf.OneofDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.OneofOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.OneofDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + OneofDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OneofDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofDescriptorProto"; + }; + + return OneofDescriptorProto; + })(); + + protobuf.EnumDescriptorProto = (function() { + + /** + * Properties of an EnumDescriptorProto. + * @memberof google.protobuf + * @interface IEnumDescriptorProto + * @property {string|null} [name] EnumDescriptorProto name + * @property {Array.|null} [value] EnumDescriptorProto value + * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options + * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange + * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName + */ + + /** + * Constructs a new EnumDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumDescriptorProto. + * @implements IEnumDescriptorProto + * @constructor + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + */ + function EnumDescriptorProto(properties) { + this.value = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.name = ""; + + /** + * EnumDescriptorProto value. + * @member {Array.} value + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.value = $util.emptyArray; + + /** + * EnumDescriptorProto options. + * @member {google.protobuf.IEnumOptions|null|undefined} options + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.options = null; + + /** + * EnumDescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * EnumDescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance + */ + EnumDescriptorProto.create = function create(properties) { + return new EnumDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.value != null && message.value.length) + for (var i = 0; i < message.value.length; ++i) + $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.value && message.value.length)) + message.value = []; + message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); + break; + } + case 4: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.value != null && message.hasOwnProperty("value")) { + if (!Array.isArray(message.value)) + return "value: array expected"; + for (var i = 0; i < message.value.length; ++i) { + var error = $root.google.protobuf.EnumValueDescriptorProto.verify(message.value[i]); + if (error) + return "value." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + */ + EnumDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.value) { + if (!Array.isArray(object.value)) + throw TypeError(".google.protobuf.EnumDescriptorProto.value: array expected"); + message.value = []; + for (var i = 0; i < object.value.length; ++i) { + if (typeof object.value[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.value: object expected"); + message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.value = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.value && message.value.length) { + object.value = []; + for (var j = 0; j < message.value.length; ++j) + object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options); + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto"; + }; + + EnumDescriptorProto.EnumReservedRange = (function() { + + /** + * Properties of an EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @interface IEnumReservedRange + * @property {number|null} [start] EnumReservedRange start + * @property {number|null} [end] EnumReservedRange end + */ + + /** + * Constructs a new EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @classdesc Represents an EnumReservedRange. + * @implements IEnumReservedRange + * @constructor + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + */ + function EnumReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumReservedRange start. + * @member {number} start + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.start = 0; + + /** + * EnumReservedRange end. + * @member {number} end + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.end = 0; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance + */ + EnumReservedRange.create = function create(properties) { + return new EnumReservedRange(properties); + }; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumReservedRange message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + */ + EnumReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto.EnumReservedRange) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.EnumReservedRange} message EnumReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this EnumReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + * @returns {Object.} JSON object + */ + EnumReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumReservedRange + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto.EnumReservedRange"; + }; + + return EnumReservedRange; + })(); + + return EnumDescriptorProto; + })(); + + protobuf.EnumValueDescriptorProto = (function() { + + /** + * Properties of an EnumValueDescriptorProto. + * @memberof google.protobuf + * @interface IEnumValueDescriptorProto + * @property {string|null} [name] EnumValueDescriptorProto name + * @property {number|null} [number] EnumValueDescriptorProto number + * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options + */ + + /** + * Constructs a new EnumValueDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumValueDescriptorProto. + * @implements IEnumValueDescriptorProto + * @constructor + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + */ + function EnumValueDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.name = ""; + + /** + * EnumValueDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.number = 0; + + /** + * EnumValueDescriptorProto options. + * @member {google.protobuf.IEnumValueOptions|null|undefined} options + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.options = null; + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance + */ + EnumValueDescriptorProto.create = function create(properties) { + return new EnumValueDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.number = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumValueOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + */ + EnumValueDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumValueDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.number = 0; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumValueDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueDescriptorProto"; + }; + + return EnumValueDescriptorProto; + })(); + + protobuf.ServiceDescriptorProto = (function() { + + /** + * Properties of a ServiceDescriptorProto. + * @memberof google.protobuf + * @interface IServiceDescriptorProto + * @property {string|null} [name] ServiceDescriptorProto name + * @property {Array.|null} [method] ServiceDescriptorProto method + * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options + */ + + /** + * Constructs a new ServiceDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a ServiceDescriptorProto. + * @implements IServiceDescriptorProto + * @constructor + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + */ + function ServiceDescriptorProto(properties) { + this.method = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.name = ""; + + /** + * ServiceDescriptorProto method. + * @member {Array.} method + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.method = $util.emptyArray; + + /** + * ServiceDescriptorProto options. + * @member {google.protobuf.IServiceOptions|null|undefined} options + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.options = null; + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance + */ + ServiceDescriptorProto.create = function create(properties) { + return new ServiceDescriptorProto(properties); + }; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.method != null && message.method.length) + for (var i = 0; i < message.method.length; ++i) + $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.method && message.method.length)) + message.method = []; + message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceDescriptorProto message. + * @function verify + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.method != null && message.hasOwnProperty("method")) { + if (!Array.isArray(message.method)) + return "method: array expected"; + for (var i = 0; i < message.method.length; ++i) { + var error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i]); + if (error) + return "method." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ServiceOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + */ + ServiceDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceDescriptorProto) + return object; + var message = new $root.google.protobuf.ServiceDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.method) { + if (!Array.isArray(object.method)) + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: array expected"); + message.method = []; + for (var i = 0; i < object.method.length; ++i) { + if (typeof object.method[i] !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: object expected"); + message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.method = []; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.method && message.method.length) { + object.method = []; + for (var j = 0; j < message.method.length; ++j) + object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + ServiceDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceDescriptorProto"; + }; + + return ServiceDescriptorProto; + })(); + + protobuf.MethodDescriptorProto = (function() { + + /** + * Properties of a MethodDescriptorProto. + * @memberof google.protobuf + * @interface IMethodDescriptorProto + * @property {string|null} [name] MethodDescriptorProto name + * @property {string|null} [inputType] MethodDescriptorProto inputType + * @property {string|null} [outputType] MethodDescriptorProto outputType + * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options + * @property {boolean|null} [clientStreaming] MethodDescriptorProto clientStreaming + * @property {boolean|null} [serverStreaming] MethodDescriptorProto serverStreaming + */ + + /** + * Constructs a new MethodDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a MethodDescriptorProto. + * @implements IMethodDescriptorProto + * @constructor + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + */ + function MethodDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.name = ""; + + /** + * MethodDescriptorProto inputType. + * @member {string} inputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.inputType = ""; + + /** + * MethodDescriptorProto outputType. + * @member {string} outputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.outputType = ""; + + /** + * MethodDescriptorProto options. + * @member {google.protobuf.IMethodOptions|null|undefined} options + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.options = null; + + /** + * MethodDescriptorProto clientStreaming. + * @member {boolean} clientStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.clientStreaming = false; + + /** + * MethodDescriptorProto serverStreaming. + * @member {boolean} serverStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.serverStreaming = false; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance + */ + MethodDescriptorProto.create = function create(properties) { + return new MethodDescriptorProto(properties); + }; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); + if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); + if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); + return writer; + }; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.inputType = reader.string(); + break; + } + case 3: { + message.outputType = reader.string(); + break; + } + case 4: { + message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); + break; + } + case 5: { + message.clientStreaming = reader.bool(); + break; + } + case 6: { + message.serverStreaming = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodDescriptorProto message. + * @function verify + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.inputType != null && message.hasOwnProperty("inputType")) + if (!$util.isString(message.inputType)) + return "inputType: string expected"; + if (message.outputType != null && message.hasOwnProperty("outputType")) + if (!$util.isString(message.outputType)) + return "outputType: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MethodOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + if (typeof message.clientStreaming !== "boolean") + return "clientStreaming: boolean expected"; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + if (typeof message.serverStreaming !== "boolean") + return "serverStreaming: boolean expected"; + return null; + }; + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + */ + MethodDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodDescriptorProto) + return object; + var message = new $root.google.protobuf.MethodDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.inputType != null) + message.inputType = String(object.inputType); + if (object.outputType != null) + message.outputType = String(object.outputType); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MethodOptions.fromObject(object.options); + } + if (object.clientStreaming != null) + message.clientStreaming = Boolean(object.clientStreaming); + if (object.serverStreaming != null) + message.serverStreaming = Boolean(object.serverStreaming); + return message; + }; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.inputType = ""; + object.outputType = ""; + object.options = null; + object.clientStreaming = false; + object.serverStreaming = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.inputType != null && message.hasOwnProperty("inputType")) + object.inputType = message.inputType; + if (message.outputType != null && message.hasOwnProperty("outputType")) + object.outputType = message.outputType; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options); + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + object.clientStreaming = message.clientStreaming; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + object.serverStreaming = message.serverStreaming; + return object; + }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.MethodDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + MethodDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodDescriptorProto"; + }; + + return MethodDescriptorProto; + })(); + + protobuf.FileOptions = (function() { + + /** + * Properties of a FileOptions. + * @memberof google.protobuf + * @interface IFileOptions + * @property {string|null} [javaPackage] FileOptions javaPackage + * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname + * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles + * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash + * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8 + * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor + * @property {string|null} [goPackage] FileOptions goPackage + * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices + * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices + * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices + * @property {boolean|null} [deprecated] FileOptions deprecated + * @property {boolean|null} [ccEnableArenas] FileOptions ccEnableArenas + * @property {string|null} [objcClassPrefix] FileOptions objcClassPrefix + * @property {string|null} [csharpNamespace] FileOptions csharpNamespace + * @property {string|null} [swiftPrefix] FileOptions swiftPrefix + * @property {string|null} [phpClassPrefix] FileOptions phpClassPrefix + * @property {string|null} [phpNamespace] FileOptions phpNamespace + * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace + * @property {string|null} [rubyPackage] FileOptions rubyPackage + * @property {google.protobuf.IFeatureSet|null} [features] FileOptions features + * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption + * @property {Array.|null} [".google.api.resourceDefinition"] FileOptions .google.api.resourceDefinition + */ + + /** + * Constructs a new FileOptions. + * @memberof google.protobuf + * @classdesc Represents a FileOptions. + * @implements IFileOptions + * @constructor + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + */ + function FileOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.resourceDefinition"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileOptions javaPackage. + * @member {string} javaPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaPackage = ""; + + /** + * FileOptions javaOuterClassname. + * @member {string} javaOuterClassname + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaOuterClassname = ""; + + /** + * FileOptions javaMultipleFiles. + * @member {boolean} javaMultipleFiles + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaMultipleFiles = false; + + /** + * FileOptions javaGenerateEqualsAndHash. + * @member {boolean} javaGenerateEqualsAndHash + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenerateEqualsAndHash = false; + + /** + * FileOptions javaStringCheckUtf8. + * @member {boolean} javaStringCheckUtf8 + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaStringCheckUtf8 = false; + + /** + * FileOptions optimizeFor. + * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.optimizeFor = 1; + + /** + * FileOptions goPackage. + * @member {string} goPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.goPackage = ""; + + /** + * FileOptions ccGenericServices. + * @member {boolean} ccGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccGenericServices = false; + + /** + * FileOptions javaGenericServices. + * @member {boolean} javaGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenericServices = false; + + /** + * FileOptions pyGenericServices. + * @member {boolean} pyGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.pyGenericServices = false; + + /** + * FileOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.deprecated = false; + + /** + * FileOptions ccEnableArenas. + * @member {boolean} ccEnableArenas + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccEnableArenas = true; + + /** + * FileOptions objcClassPrefix. + * @member {string} objcClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.objcClassPrefix = ""; + + /** + * FileOptions csharpNamespace. + * @member {string} csharpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.csharpNamespace = ""; + + /** + * FileOptions swiftPrefix. + * @member {string} swiftPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.swiftPrefix = ""; + + /** + * FileOptions phpClassPrefix. + * @member {string} phpClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpClassPrefix = ""; + + /** + * FileOptions phpNamespace. + * @member {string} phpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpNamespace = ""; + + /** + * FileOptions phpMetadataNamespace. + * @member {string} phpMetadataNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpMetadataNamespace = ""; + + /** + * FileOptions rubyPackage. + * @member {string} rubyPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.rubyPackage = ""; + + /** + * FileOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.features = null; + + /** + * FileOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FileOptions .google.api.resourceDefinition. + * @member {Array.} .google.api.resourceDefinition + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray; + + /** + * Creates a new FileOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + * @returns {google.protobuf.FileOptions} FileOptions instance + */ + FileOptions.create = function create(properties) { + return new FileOptions(properties); + }; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); + if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); + if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); + if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); + if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); + if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); + if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); + if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) + writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); + if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) + writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); + if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) + writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); + if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) + writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); + if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) + writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); + if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) + writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); + if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) + writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); + if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) + writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); + if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) + writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); + if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) + writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); + if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) + writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resourceDefinition"] != null && message[".google.api.resourceDefinition"].length) + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resourceDefinition"][i], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.javaPackage = reader.string(); + break; + } + case 8: { + message.javaOuterClassname = reader.string(); + break; + } + case 10: { + message.javaMultipleFiles = reader.bool(); + break; + } + case 20: { + message.javaGenerateEqualsAndHash = reader.bool(); + break; + } + case 27: { + message.javaStringCheckUtf8 = reader.bool(); + break; + } + case 9: { + message.optimizeFor = reader.int32(); + break; + } + case 11: { + message.goPackage = reader.string(); + break; + } + case 16: { + message.ccGenericServices = reader.bool(); + break; + } + case 17: { + message.javaGenericServices = reader.bool(); + break; + } + case 18: { + message.pyGenericServices = reader.bool(); + break; + } + case 23: { + message.deprecated = reader.bool(); + break; + } + case 31: { + message.ccEnableArenas = reader.bool(); + break; + } + case 36: { + message.objcClassPrefix = reader.string(); + break; + } + case 37: { + message.csharpNamespace = reader.string(); + break; + } + case 39: { + message.swiftPrefix = reader.string(); + break; + } + case 40: { + message.phpClassPrefix = reader.string(); + break; + } + case 41: { + message.phpNamespace = reader.string(); + break; + } + case 44: { + message.phpMetadataNamespace = reader.string(); + break; + } + case 45: { + message.rubyPackage = reader.string(); + break; + } + case 50: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1053: { + if (!(message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length)) + message[".google.api.resourceDefinition"] = []; + message[".google.api.resourceDefinition"].push($root.google.api.ResourceDescriptor.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileOptions message. + * @function verify + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + if (!$util.isString(message.javaPackage)) + return "javaPackage: string expected"; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + if (!$util.isString(message.javaOuterClassname)) + return "javaOuterClassname: string expected"; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + if (typeof message.javaMultipleFiles !== "boolean") + return "javaMultipleFiles: boolean expected"; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + if (typeof message.javaGenerateEqualsAndHash !== "boolean") + return "javaGenerateEqualsAndHash: boolean expected"; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + if (typeof message.javaStringCheckUtf8 !== "boolean") + return "javaStringCheckUtf8: boolean expected"; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + switch (message.optimizeFor) { + default: + return "optimizeFor: enum value expected"; + case 1: + case 2: + case 3: + break; + } + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + if (!$util.isString(message.goPackage)) + return "goPackage: string expected"; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + if (typeof message.ccGenericServices !== "boolean") + return "ccGenericServices: boolean expected"; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + if (typeof message.javaGenericServices !== "boolean") + return "javaGenericServices: boolean expected"; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + if (typeof message.pyGenericServices !== "boolean") + return "pyGenericServices: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + if (typeof message.ccEnableArenas !== "boolean") + return "ccEnableArenas: boolean expected"; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + if (!$util.isString(message.objcClassPrefix)) + return "objcClassPrefix: string expected"; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + if (!$util.isString(message.csharpNamespace)) + return "csharpNamespace: string expected"; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + if (!$util.isString(message.swiftPrefix)) + return "swiftPrefix: string expected"; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + if (!$util.isString(message.phpClassPrefix)) + return "phpClassPrefix: string expected"; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + if (!$util.isString(message.phpNamespace)) + return "phpNamespace: string expected"; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + if (!$util.isString(message.phpMetadataNamespace)) + return "phpMetadataNamespace: string expected"; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + if (!$util.isString(message.rubyPackage)) + return "rubyPackage: string expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resourceDefinition"] != null && message.hasOwnProperty(".google.api.resourceDefinition")) { + if (!Array.isArray(message[".google.api.resourceDefinition"])) + return ".google.api.resourceDefinition: array expected"; + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resourceDefinition"][i]); + if (error) + return ".google.api.resourceDefinition." + error; + } + } + return null; + }; + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileOptions} FileOptions + */ + FileOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileOptions) + return object; + var message = new $root.google.protobuf.FileOptions(); + if (object.javaPackage != null) + message.javaPackage = String(object.javaPackage); + if (object.javaOuterClassname != null) + message.javaOuterClassname = String(object.javaOuterClassname); + if (object.javaMultipleFiles != null) + message.javaMultipleFiles = Boolean(object.javaMultipleFiles); + if (object.javaGenerateEqualsAndHash != null) + message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash); + if (object.javaStringCheckUtf8 != null) + message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); + switch (object.optimizeFor) { + default: + if (typeof object.optimizeFor === "number") { + message.optimizeFor = object.optimizeFor; + break; + } + break; + case "SPEED": + case 1: + message.optimizeFor = 1; + break; + case "CODE_SIZE": + case 2: + message.optimizeFor = 2; + break; + case "LITE_RUNTIME": + case 3: + message.optimizeFor = 3; + break; + } + if (object.goPackage != null) + message.goPackage = String(object.goPackage); + if (object.ccGenericServices != null) + message.ccGenericServices = Boolean(object.ccGenericServices); + if (object.javaGenericServices != null) + message.javaGenericServices = Boolean(object.javaGenericServices); + if (object.pyGenericServices != null) + message.pyGenericServices = Boolean(object.pyGenericServices); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.ccEnableArenas != null) + message.ccEnableArenas = Boolean(object.ccEnableArenas); + if (object.objcClassPrefix != null) + message.objcClassPrefix = String(object.objcClassPrefix); + if (object.csharpNamespace != null) + message.csharpNamespace = String(object.csharpNamespace); + if (object.swiftPrefix != null) + message.swiftPrefix = String(object.swiftPrefix); + if (object.phpClassPrefix != null) + message.phpClassPrefix = String(object.phpClassPrefix); + if (object.phpNamespace != null) + message.phpNamespace = String(object.phpNamespace); + if (object.phpMetadataNamespace != null) + message.phpMetadataNamespace = String(object.phpMetadataNamespace); + if (object.rubyPackage != null) + message.rubyPackage = String(object.rubyPackage); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FileOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resourceDefinition"]) { + if (!Array.isArray(object[".google.api.resourceDefinition"])) + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: array expected"); + message[".google.api.resourceDefinition"] = []; + for (var i = 0; i < object[".google.api.resourceDefinition"].length; ++i) { + if (typeof object[".google.api.resourceDefinition"][i] !== "object") + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: object expected"); + message[".google.api.resourceDefinition"][i] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resourceDefinition"][i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.FileOptions} message FileOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.resourceDefinition"] = []; + } + if (options.defaults) { + object.javaPackage = ""; + object.javaOuterClassname = ""; + object.optimizeFor = options.enums === String ? "SPEED" : 1; + object.javaMultipleFiles = false; + object.goPackage = ""; + object.ccGenericServices = false; + object.javaGenericServices = false; + object.pyGenericServices = false; + object.javaGenerateEqualsAndHash = false; + object.deprecated = false; + object.javaStringCheckUtf8 = false; + object.ccEnableArenas = true; + object.objcClassPrefix = ""; + object.csharpNamespace = ""; + object.swiftPrefix = ""; + object.phpClassPrefix = ""; + object.phpNamespace = ""; + object.phpMetadataNamespace = ""; + object.rubyPackage = ""; + object.features = null; + } + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + object.javaPackage = message.javaPackage; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + object.javaOuterClassname = message.javaOuterClassname; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] === undefined ? message.optimizeFor : $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + object.javaMultipleFiles = message.javaMultipleFiles; + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + object.goPackage = message.goPackage; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + object.ccGenericServices = message.ccGenericServices; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + object.javaGenericServices = message.javaGenericServices; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + object.pyGenericServices = message.pyGenericServices; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + object.javaStringCheckUtf8 = message.javaStringCheckUtf8; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + object.ccEnableArenas = message.ccEnableArenas; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + object.objcClassPrefix = message.objcClassPrefix; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + object.csharpNamespace = message.csharpNamespace; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + object.swiftPrefix = message.swiftPrefix; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + object.phpClassPrefix = message.phpClassPrefix; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + object.phpNamespace = message.phpNamespace; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + object.phpMetadataNamespace = message.phpMetadataNamespace; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + object.rubyPackage = message.rubyPackage; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length) { + object[".google.api.resourceDefinition"] = []; + for (var j = 0; j < message[".google.api.resourceDefinition"].length; ++j) + object[".google.api.resourceDefinition"][j] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resourceDefinition"][j], options); + } + return object; + }; + + /** + * Converts this FileOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FileOptions + * @instance + * @returns {Object.} JSON object + */ + FileOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileOptions + * @function getTypeUrl + * @memberof google.protobuf.FileOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileOptions"; + }; + + /** + * OptimizeMode enum. + * @name google.protobuf.FileOptions.OptimizeMode + * @enum {number} + * @property {number} SPEED=1 SPEED value + * @property {number} CODE_SIZE=2 CODE_SIZE value + * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value + */ + FileOptions.OptimizeMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "SPEED"] = 1; + values[valuesById[2] = "CODE_SIZE"] = 2; + values[valuesById[3] = "LITE_RUNTIME"] = 3; + return values; + })(); + + return FileOptions; + })(); + + protobuf.MessageOptions = (function() { + + /** + * Properties of a MessageOptions. + * @memberof google.protobuf + * @interface IMessageOptions + * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat + * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor + * @property {boolean|null} [deprecated] MessageOptions deprecated + * @property {boolean|null} [mapEntry] MessageOptions mapEntry + * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] MessageOptions deprecatedLegacyJsonFieldConflicts + * @property {google.protobuf.IFeatureSet|null} [features] MessageOptions features + * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption + * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource + */ + + /** + * Constructs a new MessageOptions. + * @memberof google.protobuf + * @classdesc Represents a MessageOptions. + * @implements IMessageOptions + * @constructor + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + */ + function MessageOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MessageOptions messageSetWireFormat. + * @member {boolean} messageSetWireFormat + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.messageSetWireFormat = false; + + /** + * MessageOptions noStandardDescriptorAccessor. + * @member {boolean} noStandardDescriptorAccessor + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.noStandardDescriptorAccessor = false; + + /** + * MessageOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecated = false; + + /** + * MessageOptions mapEntry. + * @member {boolean} mapEntry + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.mapEntry = false; + + /** + * MessageOptions deprecatedLegacyJsonFieldConflicts. + * @member {boolean} deprecatedLegacyJsonFieldConflicts + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; + + /** + * MessageOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.features = null; + + /** + * MessageOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MessageOptions .google.api.resource. + * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype[".google.api.resource"] = null; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + * @returns {google.protobuf.MessageOptions} MessageOptions instance + */ + MessageOptions.create = function create(properties) { + return new MessageOptions(properties); + }; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); + if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); + if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.deprecatedLegacyJsonFieldConflicts); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resource"] != null && Object.hasOwnProperty.call(message, ".google.api.resource")) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.messageSetWireFormat = reader.bool(); + break; + } + case 2: { + message.noStandardDescriptorAccessor = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 7: { + message.mapEntry = reader.bool(); + break; + } + case 11: { + message.deprecatedLegacyJsonFieldConflicts = reader.bool(); + break; + } + case 12: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1053: { + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MessageOptions message. + * @function verify + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MessageOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + if (typeof message.messageSetWireFormat !== "boolean") + return "messageSetWireFormat: boolean expected"; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + if (typeof message.noStandardDescriptorAccessor !== "boolean") + return "noStandardDescriptorAccessor: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + if (typeof message.mapEntry !== "boolean") + return "mapEntry: boolean expected"; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") + return "deprecatedLegacyJsonFieldConflicts: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resource"]); + if (error) + return ".google.api.resource." + error; + } + return null; + }; + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MessageOptions} MessageOptions + */ + MessageOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MessageOptions) + return object; + var message = new $root.google.protobuf.MessageOptions(); + if (object.messageSetWireFormat != null) + message.messageSetWireFormat = Boolean(object.messageSetWireFormat); + if (object.noStandardDescriptorAccessor != null) + message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.mapEntry != null) + message.mapEntry = Boolean(object.mapEntry); + if (object.deprecatedLegacyJsonFieldConflicts != null) + message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.MessageOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resource"] != null) { + if (typeof object[".google.api.resource"] !== "object") + throw TypeError(".google.protobuf.MessageOptions..google.api.resource: object expected"); + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resource"]); + } + return message; + }; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.MessageOptions} message MessageOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MessageOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.messageSetWireFormat = false; + object.noStandardDescriptorAccessor = false; + object.deprecated = false; + object.mapEntry = false; + object.deprecatedLegacyJsonFieldConflicts = false; + object.features = null; + object[".google.api.resource"] = null; + } + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + object.messageSetWireFormat = message.messageSetWireFormat; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + object.mapEntry = message.mapEntry; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) + object[".google.api.resource"] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resource"], options); + return object; + }; + + /** + * Converts this MessageOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MessageOptions + * @instance + * @returns {Object.} JSON object + */ + MessageOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MessageOptions + * @function getTypeUrl + * @memberof google.protobuf.MessageOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MessageOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MessageOptions"; + }; + + return MessageOptions; + })(); + + protobuf.FieldOptions = (function() { + + /** + * Properties of a FieldOptions. + * @memberof google.protobuf + * @interface IFieldOptions + * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype + * @property {boolean|null} [packed] FieldOptions packed + * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype + * @property {boolean|null} [lazy] FieldOptions lazy + * @property {boolean|null} [unverifiedLazy] FieldOptions unverifiedLazy + * @property {boolean|null} [deprecated] FieldOptions deprecated + * @property {boolean|null} [weak] FieldOptions weak + * @property {boolean|null} [debugRedact] FieldOptions debugRedact + * @property {google.protobuf.FieldOptions.OptionRetention|null} [retention] FieldOptions retention + * @property {Array.|null} [targets] FieldOptions targets + * @property {Array.|null} [editionDefaults] FieldOptions editionDefaults + * @property {google.protobuf.IFeatureSet|null} [features] FieldOptions features + * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption + * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior + * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference + */ + + /** + * Constructs a new FieldOptions. + * @memberof google.protobuf + * @classdesc Represents a FieldOptions. + * @implements IFieldOptions + * @constructor + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + */ + function FieldOptions(properties) { + this.targets = []; + this.editionDefaults = []; + this.uninterpretedOption = []; + this[".google.api.fieldBehavior"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldOptions ctype. + * @member {google.protobuf.FieldOptions.CType} ctype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.ctype = 0; + + /** + * FieldOptions packed. + * @member {boolean} packed + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.packed = false; + + /** + * FieldOptions jstype. + * @member {google.protobuf.FieldOptions.JSType} jstype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.jstype = 0; + + /** + * FieldOptions lazy. + * @member {boolean} lazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.lazy = false; + + /** + * FieldOptions unverifiedLazy. + * @member {boolean} unverifiedLazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.unverifiedLazy = false; + + /** + * FieldOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.deprecated = false; + + /** + * FieldOptions weak. + * @member {boolean} weak + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.weak = false; + + /** + * FieldOptions debugRedact. + * @member {boolean} debugRedact + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.debugRedact = false; + + /** + * FieldOptions retention. + * @member {google.protobuf.FieldOptions.OptionRetention} retention + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.retention = 0; + + /** + * FieldOptions targets. + * @member {Array.} targets + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.targets = $util.emptyArray; + + /** + * FieldOptions editionDefaults. + * @member {Array.} editionDefaults + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.editionDefaults = $util.emptyArray; + + /** + * FieldOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.features = null; + + /** + * FieldOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FieldOptions .google.api.fieldBehavior. + * @member {Array.} .google.api.fieldBehavior + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; + + /** + * FieldOptions .google.api.resourceReference. + * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.resourceReference"] = null; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions} FieldOptions instance + */ + FieldOptions.create = function create(properties) { + return new FieldOptions(properties); + }; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); + if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); + if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); + if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); + if (message.unverifiedLazy != null && Object.hasOwnProperty.call(message, "unverifiedLazy")) + writer.uint32(/* id 15, wireType 0 =*/120).bool(message.unverifiedLazy); + if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.debugRedact); + if (message.retention != null && Object.hasOwnProperty.call(message, "retention")) + writer.uint32(/* id 17, wireType 0 =*/136).int32(message.retention); + if (message.targets != null && message.targets.length) + for (var i = 0; i < message.targets.length; ++i) + writer.uint32(/* id 19, wireType 0 =*/152).int32(message.targets[i]); + if (message.editionDefaults != null && message.editionDefaults.length) + for (var i = 0; i < message.editionDefaults.length; ++i) + $root.google.protobuf.FieldOptions.EditionDefault.encode(message.editionDefaults[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + writer.uint32(/* id 1052, wireType 0 =*/8416).int32(message[".google.api.fieldBehavior"][i]); + if (message[".google.api.resourceReference"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceReference")) + $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.ctype = reader.int32(); + break; + } + case 2: { + message.packed = reader.bool(); + break; + } + case 6: { + message.jstype = reader.int32(); + break; + } + case 5: { + message.lazy = reader.bool(); + break; + } + case 15: { + message.unverifiedLazy = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 10: { + message.weak = reader.bool(); + break; + } + case 16: { + message.debugRedact = reader.bool(); + break; + } + case 17: { + message.retention = reader.int32(); + break; + } + case 19: { + if (!(message.targets && message.targets.length)) + message.targets = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.targets.push(reader.int32()); + } else + message.targets.push(reader.int32()); + break; + } + case 20: { + if (!(message.editionDefaults && message.editionDefaults.length)) + message.editionDefaults = []; + message.editionDefaults.push($root.google.protobuf.FieldOptions.EditionDefault.decode(reader, reader.uint32())); + break; + } + case 21: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1052: { + if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) + message[".google.api.fieldBehavior"] = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message[".google.api.fieldBehavior"].push(reader.int32()); + } else + message[".google.api.fieldBehavior"].push(reader.int32()); + break; + } + case 1055: { + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldOptions message. + * @function verify + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ctype != null && message.hasOwnProperty("ctype")) + switch (message.ctype) { + default: + return "ctype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.packed != null && message.hasOwnProperty("packed")) + if (typeof message.packed !== "boolean") + return "packed: boolean expected"; + if (message.jstype != null && message.hasOwnProperty("jstype")) + switch (message.jstype) { + default: + return "jstype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.lazy != null && message.hasOwnProperty("lazy")) + if (typeof message.lazy !== "boolean") + return "lazy: boolean expected"; + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + if (typeof message.unverifiedLazy !== "boolean") + return "unverifiedLazy: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.weak != null && message.hasOwnProperty("weak")) + if (typeof message.weak !== "boolean") + return "weak: boolean expected"; + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + if (typeof message.debugRedact !== "boolean") + return "debugRedact: boolean expected"; + if (message.retention != null && message.hasOwnProperty("retention")) + switch (message.retention) { + default: + return "retention: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.targets != null && message.hasOwnProperty("targets")) { + if (!Array.isArray(message.targets)) + return "targets: array expected"; + for (var i = 0; i < message.targets.length; ++i) + switch (message.targets[i]) { + default: + return "targets: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + break; + } + } + if (message.editionDefaults != null && message.hasOwnProperty("editionDefaults")) { + if (!Array.isArray(message.editionDefaults)) + return "editionDefaults: array expected"; + for (var i = 0; i < message.editionDefaults.length; ++i) { + var error = $root.google.protobuf.FieldOptions.EditionDefault.verify(message.editionDefaults[i]); + if (error) + return "editionDefaults." + error; + } + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) { + if (!Array.isArray(message[".google.api.fieldBehavior"])) + return ".google.api.fieldBehavior: array expected"; + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + switch (message[".google.api.fieldBehavior"][i]) { + default: + return ".google.api.fieldBehavior: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + break; + } + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) { + var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"]); + if (error) + return ".google.api.resourceReference." + error; + } + return null; + }; + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions} FieldOptions + */ + FieldOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions) + return object; + var message = new $root.google.protobuf.FieldOptions(); + switch (object.ctype) { + default: + if (typeof object.ctype === "number") { + message.ctype = object.ctype; + break; + } + break; + case "STRING": + case 0: + message.ctype = 0; + break; + case "CORD": + case 1: + message.ctype = 1; + break; + case "STRING_PIECE": + case 2: + message.ctype = 2; + break; + } + if (object.packed != null) + message.packed = Boolean(object.packed); + switch (object.jstype) { + default: + if (typeof object.jstype === "number") { + message.jstype = object.jstype; + break; + } + break; + case "JS_NORMAL": + case 0: + message.jstype = 0; + break; + case "JS_STRING": + case 1: + message.jstype = 1; + break; + case "JS_NUMBER": + case 2: + message.jstype = 2; + break; + } + if (object.lazy != null) + message.lazy = Boolean(object.lazy); + if (object.unverifiedLazy != null) + message.unverifiedLazy = Boolean(object.unverifiedLazy); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.weak != null) + message.weak = Boolean(object.weak); + if (object.debugRedact != null) + message.debugRedact = Boolean(object.debugRedact); + switch (object.retention) { + default: + if (typeof object.retention === "number") { + message.retention = object.retention; + break; + } + break; + case "RETENTION_UNKNOWN": + case 0: + message.retention = 0; + break; + case "RETENTION_RUNTIME": + case 1: + message.retention = 1; + break; + case "RETENTION_SOURCE": + case 2: + message.retention = 2; + break; + } + if (object.targets) { + if (!Array.isArray(object.targets)) + throw TypeError(".google.protobuf.FieldOptions.targets: array expected"); + message.targets = []; + for (var i = 0; i < object.targets.length; ++i) + switch (object.targets[i]) { + default: + if (typeof object.targets[i] === "number") { + message.targets[i] = object.targets[i]; + break; + } + case "TARGET_TYPE_UNKNOWN": + case 0: + message.targets[i] = 0; + break; + case "TARGET_TYPE_FILE": + case 1: + message.targets[i] = 1; + break; + case "TARGET_TYPE_EXTENSION_RANGE": + case 2: + message.targets[i] = 2; + break; + case "TARGET_TYPE_MESSAGE": + case 3: + message.targets[i] = 3; + break; + case "TARGET_TYPE_FIELD": + case 4: + message.targets[i] = 4; + break; + case "TARGET_TYPE_ONEOF": + case 5: + message.targets[i] = 5; + break; + case "TARGET_TYPE_ENUM": + case 6: + message.targets[i] = 6; + break; + case "TARGET_TYPE_ENUM_ENTRY": + case 7: + message.targets[i] = 7; + break; + case "TARGET_TYPE_SERVICE": + case 8: + message.targets[i] = 8; + break; + case "TARGET_TYPE_METHOD": + case 9: + message.targets[i] = 9; + break; + } + } + if (object.editionDefaults) { + if (!Array.isArray(object.editionDefaults)) + throw TypeError(".google.protobuf.FieldOptions.editionDefaults: array expected"); + message.editionDefaults = []; + for (var i = 0; i < object.editionDefaults.length; ++i) { + if (typeof object.editionDefaults[i] !== "object") + throw TypeError(".google.protobuf.FieldOptions.editionDefaults: object expected"); + message.editionDefaults[i] = $root.google.protobuf.FieldOptions.EditionDefault.fromObject(object.editionDefaults[i]); + } + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FieldOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.fieldBehavior"]) { + if (!Array.isArray(object[".google.api.fieldBehavior"])) + throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected"); + message[".google.api.fieldBehavior"] = []; + for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i) + switch (object[".google.api.fieldBehavior"][i]) { + default: + if (typeof object[".google.api.fieldBehavior"][i] === "number") { + message[".google.api.fieldBehavior"][i] = object[".google.api.fieldBehavior"][i]; + break; + } + case "FIELD_BEHAVIOR_UNSPECIFIED": + case 0: + message[".google.api.fieldBehavior"][i] = 0; + break; + case "OPTIONAL": + case 1: + message[".google.api.fieldBehavior"][i] = 1; + break; + case "REQUIRED": + case 2: + message[".google.api.fieldBehavior"][i] = 2; + break; + case "OUTPUT_ONLY": + case 3: + message[".google.api.fieldBehavior"][i] = 3; + break; + case "INPUT_ONLY": + case 4: + message[".google.api.fieldBehavior"][i] = 4; + break; + case "IMMUTABLE": + case 5: + message[".google.api.fieldBehavior"][i] = 5; + break; + case "UNORDERED_LIST": + case 6: + message[".google.api.fieldBehavior"][i] = 6; + break; + case "NON_EMPTY_DEFAULT": + case 7: + message[".google.api.fieldBehavior"][i] = 7; + break; + case "IDENTIFIER": + case 8: + message[".google.api.fieldBehavior"][i] = 8; + break; + } + } + if (object[".google.api.resourceReference"] != null) { + if (typeof object[".google.api.resourceReference"] !== "object") + throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected"); + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"]); + } + return message; + }; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.FieldOptions} message FieldOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.targets = []; + object.editionDefaults = []; + object.uninterpretedOption = []; + object[".google.api.fieldBehavior"] = []; + } + if (options.defaults) { + object.ctype = options.enums === String ? "STRING" : 0; + object.packed = false; + object.deprecated = false; + object.lazy = false; + object.jstype = options.enums === String ? "JS_NORMAL" : 0; + object.weak = false; + object.unverifiedLazy = false; + object.debugRedact = false; + object.retention = options.enums === String ? "RETENTION_UNKNOWN" : 0; + object.features = null; + object[".google.api.resourceReference"] = null; + } + if (message.ctype != null && message.hasOwnProperty("ctype")) + object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] === undefined ? message.ctype : $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; + if (message.packed != null && message.hasOwnProperty("packed")) + object.packed = message.packed; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.lazy != null && message.hasOwnProperty("lazy")) + object.lazy = message.lazy; + if (message.jstype != null && message.hasOwnProperty("jstype")) + object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] === undefined ? message.jstype : $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; + if (message.weak != null && message.hasOwnProperty("weak")) + object.weak = message.weak; + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + object.unverifiedLazy = message.unverifiedLazy; + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + object.debugRedact = message.debugRedact; + if (message.retention != null && message.hasOwnProperty("retention")) + object.retention = options.enums === String ? $root.google.protobuf.FieldOptions.OptionRetention[message.retention] === undefined ? message.retention : $root.google.protobuf.FieldOptions.OptionRetention[message.retention] : message.retention; + if (message.targets && message.targets.length) { + object.targets = []; + for (var j = 0; j < message.targets.length; ++j) + object.targets[j] = options.enums === String ? $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] === undefined ? message.targets[j] : $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] : message.targets[j]; + } + if (message.editionDefaults && message.editionDefaults.length) { + object.editionDefaults = []; + for (var j = 0; j < message.editionDefaults.length; ++j) + object.editionDefaults[j] = $root.google.protobuf.FieldOptions.EditionDefault.toObject(message.editionDefaults[j], options); + } + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length) { + object[".google.api.fieldBehavior"] = []; + for (var j = 0; j < message[".google.api.fieldBehavior"].length; ++j) + object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] === undefined ? message[".google.api.fieldBehavior"][j] : $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) + object[".google.api.resourceReference"] = $root.google.api.ResourceReference.toObject(message[".google.api.resourceReference"], options); + return object; + }; + + /** + * Converts this FieldOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions + * @instance + * @returns {Object.} JSON object + */ + FieldOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldOptions + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions"; + }; + + /** + * CType enum. + * @name google.protobuf.FieldOptions.CType + * @enum {number} + * @property {number} STRING=0 STRING value + * @property {number} CORD=1 CORD value + * @property {number} STRING_PIECE=2 STRING_PIECE value + */ + FieldOptions.CType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STRING"] = 0; + values[valuesById[1] = "CORD"] = 1; + values[valuesById[2] = "STRING_PIECE"] = 2; + return values; + })(); + + /** + * JSType enum. + * @name google.protobuf.FieldOptions.JSType + * @enum {number} + * @property {number} JS_NORMAL=0 JS_NORMAL value + * @property {number} JS_STRING=1 JS_STRING value + * @property {number} JS_NUMBER=2 JS_NUMBER value + */ + FieldOptions.JSType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JS_NORMAL"] = 0; + values[valuesById[1] = "JS_STRING"] = 1; + values[valuesById[2] = "JS_NUMBER"] = 2; + return values; + })(); + + /** + * OptionRetention enum. + * @name google.protobuf.FieldOptions.OptionRetention + * @enum {number} + * @property {number} RETENTION_UNKNOWN=0 RETENTION_UNKNOWN value + * @property {number} RETENTION_RUNTIME=1 RETENTION_RUNTIME value + * @property {number} RETENTION_SOURCE=2 RETENTION_SOURCE value + */ + FieldOptions.OptionRetention = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RETENTION_UNKNOWN"] = 0; + values[valuesById[1] = "RETENTION_RUNTIME"] = 1; + values[valuesById[2] = "RETENTION_SOURCE"] = 2; + return values; + })(); + + /** + * OptionTargetType enum. + * @name google.protobuf.FieldOptions.OptionTargetType + * @enum {number} + * @property {number} TARGET_TYPE_UNKNOWN=0 TARGET_TYPE_UNKNOWN value + * @property {number} TARGET_TYPE_FILE=1 TARGET_TYPE_FILE value + * @property {number} TARGET_TYPE_EXTENSION_RANGE=2 TARGET_TYPE_EXTENSION_RANGE value + * @property {number} TARGET_TYPE_MESSAGE=3 TARGET_TYPE_MESSAGE value + * @property {number} TARGET_TYPE_FIELD=4 TARGET_TYPE_FIELD value + * @property {number} TARGET_TYPE_ONEOF=5 TARGET_TYPE_ONEOF value + * @property {number} TARGET_TYPE_ENUM=6 TARGET_TYPE_ENUM value + * @property {number} TARGET_TYPE_ENUM_ENTRY=7 TARGET_TYPE_ENUM_ENTRY value + * @property {number} TARGET_TYPE_SERVICE=8 TARGET_TYPE_SERVICE value + * @property {number} TARGET_TYPE_METHOD=9 TARGET_TYPE_METHOD value + */ + FieldOptions.OptionTargetType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TARGET_TYPE_UNKNOWN"] = 0; + values[valuesById[1] = "TARGET_TYPE_FILE"] = 1; + values[valuesById[2] = "TARGET_TYPE_EXTENSION_RANGE"] = 2; + values[valuesById[3] = "TARGET_TYPE_MESSAGE"] = 3; + values[valuesById[4] = "TARGET_TYPE_FIELD"] = 4; + values[valuesById[5] = "TARGET_TYPE_ONEOF"] = 5; + values[valuesById[6] = "TARGET_TYPE_ENUM"] = 6; + values[valuesById[7] = "TARGET_TYPE_ENUM_ENTRY"] = 7; + values[valuesById[8] = "TARGET_TYPE_SERVICE"] = 8; + values[valuesById[9] = "TARGET_TYPE_METHOD"] = 9; + return values; + })(); + + FieldOptions.EditionDefault = (function() { + + /** + * Properties of an EditionDefault. + * @memberof google.protobuf.FieldOptions + * @interface IEditionDefault + * @property {google.protobuf.Edition|null} [edition] EditionDefault edition + * @property {string|null} [value] EditionDefault value + */ + + /** + * Constructs a new EditionDefault. + * @memberof google.protobuf.FieldOptions + * @classdesc Represents an EditionDefault. + * @implements IEditionDefault + * @constructor + * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set + */ + function EditionDefault(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EditionDefault edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + */ + EditionDefault.prototype.edition = 0; + + /** + * EditionDefault value. + * @member {string} value + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + */ + EditionDefault.prototype.value = ""; + + /** + * Creates a new EditionDefault instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault instance + */ + EditionDefault.create = function create(properties) { + return new EditionDefault(properties); + }; + + /** + * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EditionDefault.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EditionDefault.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EditionDefault message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EditionDefault.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions.EditionDefault(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.edition = reader.int32(); + break; + } + case 2: { + message.value = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EditionDefault message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EditionDefault.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EditionDefault message. + * @function verify + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EditionDefault.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + */ + EditionDefault.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions.EditionDefault) + return object; + var message = new $root.google.protobuf.FieldOptions.EditionDefault(); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.EditionDefault} message EditionDefault + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EditionDefault.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.value = ""; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this EditionDefault to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + * @returns {Object.} JSON object + */ + EditionDefault.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EditionDefault + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions.EditionDefault"; + }; + + return EditionDefault; + })(); + + return FieldOptions; + })(); + + protobuf.OneofOptions = (function() { + + /** + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @property {google.protobuf.IFeatureSet|null} [features] OneofOptions features + * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption + */ + + /** + * Constructs a new OneofOptions. + * @memberof google.protobuf + * @classdesc Represents an OneofOptions. + * @implements IOneofOptions + * @constructor + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + */ + function OneofOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.features = null; + + /** + * OneofOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + * @returns {google.protobuf.OneofOptions} OneofOptions instance + */ + OneofOptions.create = function create(properties) { + return new OneofOptions(properties); + }; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofOptions message. + * @function verify + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofOptions} OneofOptions + */ + OneofOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofOptions) + return object; + var message = new $root.google.protobuf.OneofOptions(); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.OneofOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.OneofOptions} message OneofOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) + object.features = null; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this OneofOptions to JSON. + * @function toJSON + * @memberof google.protobuf.OneofOptions + * @instance + * @returns {Object.} JSON object + */ + OneofOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OneofOptions + * @function getTypeUrl + * @memberof google.protobuf.OneofOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofOptions"; + }; + + return OneofOptions; + })(); + + protobuf.EnumOptions = (function() { + + /** + * Properties of an EnumOptions. + * @memberof google.protobuf + * @interface IEnumOptions + * @property {boolean|null} [allowAlias] EnumOptions allowAlias + * @property {boolean|null} [deprecated] EnumOptions deprecated + * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] EnumOptions deprecatedLegacyJsonFieldConflicts + * @property {google.protobuf.IFeatureSet|null} [features] EnumOptions features + * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption + */ + + /** + * Constructs a new EnumOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumOptions. + * @implements IEnumOptions + * @constructor + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + */ + function EnumOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumOptions allowAlias. + * @member {boolean} allowAlias + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.allowAlias = false; + + /** + * EnumOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecated = false; + + /** + * EnumOptions deprecatedLegacyJsonFieldConflicts. + * @member {boolean} deprecatedLegacyJsonFieldConflicts + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; + + /** + * EnumOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.features = null; + + /** + * EnumOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumOptions} EnumOptions instance + */ + EnumOptions.create = function create(properties) { + return new EnumOptions(properties); + }; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.deprecatedLegacyJsonFieldConflicts); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.allowAlias = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 6: { + message.deprecatedLegacyJsonFieldConflicts = reader.bool(); + break; + } + case 7: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumOptions message. + * @function verify + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + if (typeof message.allowAlias !== "boolean") + return "allowAlias: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") + return "deprecatedLegacyJsonFieldConflicts: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumOptions} EnumOptions + */ + EnumOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumOptions) + return object; + var message = new $root.google.protobuf.EnumOptions(); + if (object.allowAlias != null) + message.allowAlias = Boolean(object.allowAlias); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.deprecatedLegacyJsonFieldConflicts != null) + message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.EnumOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.EnumOptions} message EnumOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.allowAlias = false; + object.deprecated = false; + object.deprecatedLegacyJsonFieldConflicts = false; + object.features = null; + } + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + object.allowAlias = message.allowAlias; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumOptions + * @instance + * @returns {Object.} JSON object + */ + EnumOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumOptions"; + }; + + return EnumOptions; + })(); + + protobuf.EnumValueOptions = (function() { + + /** + * Properties of an EnumValueOptions. + * @memberof google.protobuf + * @interface IEnumValueOptions + * @property {boolean|null} [deprecated] EnumValueOptions deprecated + * @property {google.protobuf.IFeatureSet|null} [features] EnumValueOptions features + * @property {boolean|null} [debugRedact] EnumValueOptions debugRedact + * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption + */ + + /** + * Constructs a new EnumValueOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumValueOptions. + * @implements IEnumValueOptions + * @constructor + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + */ + function EnumValueOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.deprecated = false; + + /** + * EnumValueOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.features = null; + + /** + * EnumValueOptions debugRedact. + * @member {boolean} debugRedact + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.debugRedact = false; + + /** + * EnumValueOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance + */ + EnumValueOptions.create = function create(properties) { + return new EnumValueOptions(properties); + }; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.debugRedact); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.deprecated = reader.bool(); + break; + } + case 2: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 3: { + message.debugRedact = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueOptions message. + * @function verify + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + if (typeof message.debugRedact !== "boolean") + return "debugRedact: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + */ + EnumValueOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueOptions) + return object; + var message = new $root.google.protobuf.EnumValueOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.debugRedact != null) + message.debugRedact = Boolean(object.debugRedact); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.EnumValueOptions} message EnumValueOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object.features = null; + object.debugRedact = false; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + object.debugRedact = message.debugRedact; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumValueOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueOptions + * @instance + * @returns {Object.} JSON object + */ + EnumValueOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValueOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueOptions"; + }; + + return EnumValueOptions; + })(); + + protobuf.ServiceOptions = (function() { + + /** + * Properties of a ServiceOptions. + * @memberof google.protobuf + * @interface IServiceOptions + * @property {google.protobuf.IFeatureSet|null} [features] ServiceOptions features + * @property {boolean|null} [deprecated] ServiceOptions deprecated + * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption + * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost + * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes + * @property {string|null} [".google.api.apiVersion"] ServiceOptions .google.api.apiVersion + */ + + /** + * Constructs a new ServiceOptions. + * @memberof google.protobuf + * @classdesc Represents a ServiceOptions. + * @implements IServiceOptions + * @constructor + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + */ + function ServiceOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.features = null; + + /** + * ServiceOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.deprecated = false; + + /** + * ServiceOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * ServiceOptions .google.api.defaultHost. + * @member {string} .google.api.defaultHost + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.defaultHost"] = ""; + + /** + * ServiceOptions .google.api.oauthScopes. + * @member {string} .google.api.oauthScopes + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.oauthScopes"] = ""; + + /** + * ServiceOptions .google.api.apiVersion. + * @member {string} .google.api.apiVersion + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.apiVersion"] = ""; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + * @returns {google.protobuf.ServiceOptions} ServiceOptions instance + */ + ServiceOptions.create = function create(properties) { + return new ServiceOptions(properties); + }; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 34, wireType 2 =*/274).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) + writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); + if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) + writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); + if (message[".google.api.apiVersion"] != null && Object.hasOwnProperty.call(message, ".google.api.apiVersion")) + writer.uint32(/* id 525000001, wireType 2 =*/4200000010).string(message[".google.api.apiVersion"]); + return writer; + }; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 34: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 33: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1049: { + message[".google.api.defaultHost"] = reader.string(); + break; + } + case 1050: { + message[".google.api.oauthScopes"] = reader.string(); + break; + } + case 525000001: { + message[".google.api.apiVersion"] = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceOptions message. + * @function verify + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + if (!$util.isString(message[".google.api.defaultHost"])) + return ".google.api.defaultHost: string expected"; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + if (!$util.isString(message[".google.api.oauthScopes"])) + return ".google.api.oauthScopes: string expected"; + if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) + if (!$util.isString(message[".google.api.apiVersion"])) + return ".google.api.apiVersion: string expected"; + return null; + }; + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceOptions} ServiceOptions + */ + ServiceOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceOptions) + return object; + var message = new $root.google.protobuf.ServiceOptions(); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.ServiceOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.defaultHost"] != null) + message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); + if (object[".google.api.oauthScopes"] != null) + message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); + if (object[".google.api.apiVersion"] != null) + message[".google.api.apiVersion"] = String(object[".google.api.apiVersion"]); + return message; + }; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.ServiceOptions} message ServiceOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object.features = null; + object[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + object[".google.api.apiVersion"] = ""; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; + if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) + object[".google.api.apiVersion"] = message[".google.api.apiVersion"]; + return object; + }; + + /** + * Converts this ServiceOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceOptions + * @instance + * @returns {Object.} JSON object + */ + ServiceOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceOptions + * @function getTypeUrl + * @memberof google.protobuf.ServiceOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceOptions"; + }; + + return ServiceOptions; + })(); + + protobuf.MethodOptions = (function() { + + /** + * Properties of a MethodOptions. + * @memberof google.protobuf + * @interface IMethodOptions + * @property {boolean|null} [deprecated] MethodOptions deprecated + * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel + * @property {google.protobuf.IFeatureSet|null} [features] MethodOptions features + * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption + * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http + * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature + */ + + /** + * Constructs a new MethodOptions. + * @memberof google.protobuf + * @classdesc Represents a MethodOptions. + * @implements IMethodOptions + * @constructor + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + */ + function MethodOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.methodSignature"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.deprecated = false; + + /** + * MethodOptions idempotencyLevel. + * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.idempotencyLevel = 0; + + /** + * MethodOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.features = null; + + /** + * MethodOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MethodOptions .google.api.http. + * @member {google.api.IHttpRule|null|undefined} .google.api.http + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.http"] = null; + + /** + * MethodOptions .google.api.methodSignature. + * @member {Array.} .google.api.methodSignature + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + * @returns {google.protobuf.MethodOptions} MethodOptions instance + */ + MethodOptions.create = function create(properties) { + return new MethodOptions(properties); + }; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel")) + writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 35, wireType 2 =*/282).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.methodSignature"] != null && message[".google.api.methodSignature"].length) + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + writer.uint32(/* id 1051, wireType 2 =*/8410).string(message[".google.api.methodSignature"][i]); + if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http")) + $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 33: { + message.deprecated = reader.bool(); + break; + } + case 34: { + message.idempotencyLevel = reader.int32(); + break; + } + case 35: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 72295728: { + message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); + break; + } + case 1051: { + if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) + message[".google.api.methodSignature"] = []; + message[".google.api.methodSignature"].push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodOptions message. + * @function verify + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + switch (message.idempotencyLevel) { + default: + return "idempotencyLevel: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) { + var error = $root.google.api.HttpRule.verify(message[".google.api.http"]); + if (error) + return ".google.api.http." + error; + } + if (message[".google.api.methodSignature"] != null && message.hasOwnProperty(".google.api.methodSignature")) { + if (!Array.isArray(message[".google.api.methodSignature"])) + return ".google.api.methodSignature: array expected"; + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + if (!$util.isString(message[".google.api.methodSignature"][i])) + return ".google.api.methodSignature: string[] expected"; + } + return null; + }; + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodOptions} MethodOptions + */ + MethodOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodOptions) + return object; + var message = new $root.google.protobuf.MethodOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + switch (object.idempotencyLevel) { + default: + if (typeof object.idempotencyLevel === "number") { + message.idempotencyLevel = object.idempotencyLevel; + break; + } + break; + case "IDEMPOTENCY_UNKNOWN": + case 0: + message.idempotencyLevel = 0; + break; + case "NO_SIDE_EFFECTS": + case 1: + message.idempotencyLevel = 1; + break; + case "IDEMPOTENT": + case 2: + message.idempotencyLevel = 2; + break; + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.MethodOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.http"] != null) { + if (typeof object[".google.api.http"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected"); + message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"]); + } + if (object[".google.api.methodSignature"]) { + if (!Array.isArray(object[".google.api.methodSignature"])) + throw TypeError(".google.protobuf.MethodOptions..google.api.methodSignature: array expected"); + message[".google.api.methodSignature"] = []; + for (var i = 0; i < object[".google.api.methodSignature"].length; ++i) + message[".google.api.methodSignature"][i] = String(object[".google.api.methodSignature"][i]); + } + return message; + }; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.MethodOptions} message MethodOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.methodSignature"] = []; + } + if (options.defaults) { + object.deprecated = false; + object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0; + object.features = null; + object[".google.api.http"] = null; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] === undefined ? message.idempotencyLevel : $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length) { + object[".google.api.methodSignature"] = []; + for (var j = 0; j < message[".google.api.methodSignature"].length; ++j) + object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j]; + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) + object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); + return object; + }; + + /** + * Converts this MethodOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MethodOptions + * @instance + * @returns {Object.} JSON object + */ + MethodOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodOptions + * @function getTypeUrl + * @memberof google.protobuf.MethodOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodOptions"; + }; + + /** + * IdempotencyLevel enum. + * @name google.protobuf.MethodOptions.IdempotencyLevel + * @enum {number} + * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value + * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value + * @property {number} IDEMPOTENT=2 IDEMPOTENT value + */ + MethodOptions.IdempotencyLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0; + values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1; + values[valuesById[2] = "IDEMPOTENT"] = 2; + return values; + })(); + + return MethodOptions; + })(); + + protobuf.UninterpretedOption = (function() { + + /** + * Properties of an UninterpretedOption. + * @memberof google.protobuf + * @interface IUninterpretedOption + * @property {Array.|null} [name] UninterpretedOption name + * @property {string|null} [identifierValue] UninterpretedOption identifierValue + * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue + * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue + * @property {number|null} [doubleValue] UninterpretedOption doubleValue + * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue + * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue + */ + + /** + * Constructs a new UninterpretedOption. + * @memberof google.protobuf + * @classdesc Represents an UninterpretedOption. + * @implements IUninterpretedOption + * @constructor + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + */ + function UninterpretedOption(properties) { + this.name = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UninterpretedOption name. + * @member {Array.} name + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.name = $util.emptyArray; + + /** + * UninterpretedOption identifierValue. + * @member {string} identifierValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.identifierValue = ""; + + /** + * UninterpretedOption positiveIntValue. + * @member {number|Long} positiveIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * UninterpretedOption negativeIntValue. + * @member {number|Long} negativeIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * UninterpretedOption doubleValue. + * @member {number} doubleValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.doubleValue = 0; + + /** + * UninterpretedOption stringValue. + * @member {Uint8Array} stringValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.stringValue = $util.newBuffer([]); + + /** + * UninterpretedOption aggregateValue. + * @member {string} aggregateValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.aggregateValue = ""; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance + */ + UninterpretedOption.create = function create(properties) { + return new UninterpretedOption(properties); + }; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.name.length) + for (var i = 0; i < message.name.length; ++i) + $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); + if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); + if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); + if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) + writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); + if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); + return writer; + }; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + if (!(message.name && message.name.length)) + message.name = []; + message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); + break; + } + case 3: { + message.identifierValue = reader.string(); + break; + } + case 4: { + message.positiveIntValue = reader.uint64(); + break; + } + case 5: { + message.negativeIntValue = reader.int64(); + break; + } + case 6: { + message.doubleValue = reader.double(); + break; + } + case 7: { + message.stringValue = reader.bytes(); + break; + } + case 8: { + message.aggregateValue = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UninterpretedOption message. + * @function verify + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UninterpretedOption.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) { + if (!Array.isArray(message.name)) + return "name: array expected"; + for (var i = 0; i < message.name.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]); + if (error) + return "name." + error; + } + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + if (!$util.isString(message.identifierValue)) + return "identifierValue: string expected"; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high))) + return "positiveIntValue: integer|Long expected"; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high))) + return "negativeIntValue: integer|Long expected"; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + if (typeof message.doubleValue !== "number") + return "doubleValue: number expected"; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue))) + return "stringValue: buffer expected"; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + if (!$util.isString(message.aggregateValue)) + return "aggregateValue: string expected"; + return null; + }; + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + */ + UninterpretedOption.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption) + return object; + var message = new $root.google.protobuf.UninterpretedOption(); + if (object.name) { + if (!Array.isArray(object.name)) + throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); + message.name = []; + for (var i = 0; i < object.name.length; ++i) { + if (typeof object.name[i] !== "object") + throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); + message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); + } + } + if (object.identifierValue != null) + message.identifierValue = String(object.identifierValue); + if (object.positiveIntValue != null) + if ($util.Long) + (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; + else if (typeof object.positiveIntValue === "string") + message.positiveIntValue = parseInt(object.positiveIntValue, 10); + else if (typeof object.positiveIntValue === "number") + message.positiveIntValue = object.positiveIntValue; + else if (typeof object.positiveIntValue === "object") + message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); + if (object.negativeIntValue != null) + if ($util.Long) + (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false; + else if (typeof object.negativeIntValue === "string") + message.negativeIntValue = parseInt(object.negativeIntValue, 10); + else if (typeof object.negativeIntValue === "number") + message.negativeIntValue = object.negativeIntValue; + else if (typeof object.negativeIntValue === "object") + message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); + if (object.doubleValue != null) + message.doubleValue = Number(object.doubleValue); + if (object.stringValue != null) + if (typeof object.stringValue === "string") + $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); + else if (object.stringValue.length >= 0) + message.stringValue = object.stringValue; + if (object.aggregateValue != null) + message.aggregateValue = String(object.aggregateValue); + return message; + }; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.UninterpretedOption} message UninterpretedOption + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UninterpretedOption.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.name = []; + if (options.defaults) { + object.identifierValue = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.positiveIntValue = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.negativeIntValue = options.longs === String ? "0" : 0; + object.doubleValue = 0; + if (options.bytes === String) + object.stringValue = ""; + else { + object.stringValue = []; + if (options.bytes !== Array) + object.stringValue = $util.newBuffer(object.stringValue); + } + object.aggregateValue = ""; + } + if (message.name && message.name.length) { + object.name = []; + for (var j = 0; j < message.name.length; ++j) + object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + object.identifierValue = message.identifierValue; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (typeof message.positiveIntValue === "number") + object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue; + else + object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (typeof message.negativeIntValue === "number") + object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue; + else + object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + object.aggregateValue = message.aggregateValue; + return object; + }; + + /** + * Converts this UninterpretedOption to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption + * @instance + * @returns {Object.} JSON object + */ + UninterpretedOption.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UninterpretedOption + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UninterpretedOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption"; + }; + + UninterpretedOption.NamePart = (function() { + + /** + * Properties of a NamePart. + * @memberof google.protobuf.UninterpretedOption + * @interface INamePart + * @property {string} namePart NamePart namePart + * @property {boolean} isExtension NamePart isExtension + */ + + /** + * Constructs a new NamePart. + * @memberof google.protobuf.UninterpretedOption + * @classdesc Represents a NamePart. + * @implements INamePart + * @constructor + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + */ + function NamePart(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NamePart namePart. + * @member {string} namePart + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.namePart = ""; + + /** + * NamePart isExtension. + * @member {boolean} isExtension + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.isExtension = false; + + /** + * Creates a new NamePart instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance + */ + NamePart.create = function create(properties) { + return new NamePart(properties); + }; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart); + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension); + return writer; + }; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.namePart = reader.string(); + break; + } + case 2: { + message.isExtension = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + if (!message.hasOwnProperty("namePart")) + throw $util.ProtocolError("missing required 'namePart'", { instance: message }); + if (!message.hasOwnProperty("isExtension")) + throw $util.ProtocolError("missing required 'isExtension'", { instance: message }); + return message; + }; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NamePart message. + * @function verify + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NamePart.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (!$util.isString(message.namePart)) + return "namePart: string expected"; + if (typeof message.isExtension !== "boolean") + return "isExtension: boolean expected"; + return null; + }; + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + */ + NamePart.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) + return object; + var message = new $root.google.protobuf.UninterpretedOption.NamePart(); + if (object.namePart != null) + message.namePart = String(object.namePart); + if (object.isExtension != null) + message.isExtension = Boolean(object.isExtension); + return message; + }; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NamePart.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.namePart = ""; + object.isExtension = false; + } + if (message.namePart != null && message.hasOwnProperty("namePart")) + object.namePart = message.namePart; + if (message.isExtension != null && message.hasOwnProperty("isExtension")) + object.isExtension = message.isExtension; + return object; + }; + + /** + * Converts this NamePart to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + * @returns {Object.} JSON object + */ + NamePart.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NamePart + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NamePart.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption.NamePart"; + }; + + return NamePart; + })(); + + return UninterpretedOption; + })(); + + protobuf.FeatureSet = (function() { + + /** + * Properties of a FeatureSet. + * @memberof google.protobuf + * @interface IFeatureSet + * @property {google.protobuf.FeatureSet.FieldPresence|null} [fieldPresence] FeatureSet fieldPresence + * @property {google.protobuf.FeatureSet.EnumType|null} [enumType] FeatureSet enumType + * @property {google.protobuf.FeatureSet.RepeatedFieldEncoding|null} [repeatedFieldEncoding] FeatureSet repeatedFieldEncoding + * @property {google.protobuf.FeatureSet.Utf8Validation|null} [utf8Validation] FeatureSet utf8Validation + * @property {google.protobuf.FeatureSet.MessageEncoding|null} [messageEncoding] FeatureSet messageEncoding + * @property {google.protobuf.FeatureSet.JsonFormat|null} [jsonFormat] FeatureSet jsonFormat + */ + + /** + * Constructs a new FeatureSet. + * @memberof google.protobuf + * @classdesc Represents a FeatureSet. + * @implements IFeatureSet + * @constructor + * @param {google.protobuf.IFeatureSet=} [properties] Properties to set + */ + function FeatureSet(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSet fieldPresence. + * @member {google.protobuf.FeatureSet.FieldPresence} fieldPresence + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.fieldPresence = 0; + + /** + * FeatureSet enumType. + * @member {google.protobuf.FeatureSet.EnumType} enumType + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.enumType = 0; + + /** + * FeatureSet repeatedFieldEncoding. + * @member {google.protobuf.FeatureSet.RepeatedFieldEncoding} repeatedFieldEncoding + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.repeatedFieldEncoding = 0; + + /** + * FeatureSet utf8Validation. + * @member {google.protobuf.FeatureSet.Utf8Validation} utf8Validation + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.utf8Validation = 0; + + /** + * FeatureSet messageEncoding. + * @member {google.protobuf.FeatureSet.MessageEncoding} messageEncoding + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.messageEncoding = 0; + + /** + * FeatureSet jsonFormat. + * @member {google.protobuf.FeatureSet.JsonFormat} jsonFormat + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.jsonFormat = 0; + + /** + * Creates a new FeatureSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet=} [properties] Properties to set + * @returns {google.protobuf.FeatureSet} FeatureSet instance + */ + FeatureSet.create = function create(properties) { + return new FeatureSet(properties); + }; + + /** + * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fieldPresence != null && Object.hasOwnProperty.call(message, "fieldPresence")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.fieldPresence); + if (message.enumType != null && Object.hasOwnProperty.call(message, "enumType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.enumType); + if (message.repeatedFieldEncoding != null && Object.hasOwnProperty.call(message, "repeatedFieldEncoding")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.repeatedFieldEncoding); + if (message.utf8Validation != null && Object.hasOwnProperty.call(message, "utf8Validation")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.utf8Validation); + if (message.messageEncoding != null && Object.hasOwnProperty.call(message, "messageEncoding")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.messageEncoding); + if (message.jsonFormat != null && Object.hasOwnProperty.call(message, "jsonFormat")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jsonFormat); + return writer; + }; + + /** + * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSet} FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSet.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.fieldPresence = reader.int32(); + break; + } + case 2: { + message.enumType = reader.int32(); + break; + } + case 3: { + message.repeatedFieldEncoding = reader.int32(); + break; + } + case 4: { + message.utf8Validation = reader.int32(); + break; + } + case 5: { + message.messageEncoding = reader.int32(); + break; + } + case 6: { + message.jsonFormat = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSet} FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSet message. + * @function verify + * @memberof google.protobuf.FeatureSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) + switch (message.fieldPresence) { + default: + return "fieldPresence: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.enumType != null && message.hasOwnProperty("enumType")) + switch (message.enumType) { + default: + return "enumType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) + switch (message.repeatedFieldEncoding) { + default: + return "repeatedFieldEncoding: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) + switch (message.utf8Validation) { + default: + return "utf8Validation: enum value expected"; + case 0: + case 2: + case 3: + break; + } + if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) + switch (message.messageEncoding) { + default: + return "messageEncoding: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) + switch (message.jsonFormat) { + default: + return "jsonFormat: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSet} FeatureSet + */ + FeatureSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSet) + return object; + var message = new $root.google.protobuf.FeatureSet(); + switch (object.fieldPresence) { + default: + if (typeof object.fieldPresence === "number") { + message.fieldPresence = object.fieldPresence; + break; + } + break; + case "FIELD_PRESENCE_UNKNOWN": + case 0: + message.fieldPresence = 0; + break; + case "EXPLICIT": + case 1: + message.fieldPresence = 1; + break; + case "IMPLICIT": + case 2: + message.fieldPresence = 2; + break; + case "LEGACY_REQUIRED": + case 3: + message.fieldPresence = 3; + break; + } + switch (object.enumType) { + default: + if (typeof object.enumType === "number") { + message.enumType = object.enumType; + break; + } + break; + case "ENUM_TYPE_UNKNOWN": + case 0: + message.enumType = 0; + break; + case "OPEN": + case 1: + message.enumType = 1; + break; + case "CLOSED": + case 2: + message.enumType = 2; + break; + } + switch (object.repeatedFieldEncoding) { + default: + if (typeof object.repeatedFieldEncoding === "number") { + message.repeatedFieldEncoding = object.repeatedFieldEncoding; + break; + } + break; + case "REPEATED_FIELD_ENCODING_UNKNOWN": + case 0: + message.repeatedFieldEncoding = 0; + break; + case "PACKED": + case 1: + message.repeatedFieldEncoding = 1; + break; + case "EXPANDED": + case 2: + message.repeatedFieldEncoding = 2; + break; + } + switch (object.utf8Validation) { + default: + if (typeof object.utf8Validation === "number") { + message.utf8Validation = object.utf8Validation; + break; + } + break; + case "UTF8_VALIDATION_UNKNOWN": + case 0: + message.utf8Validation = 0; + break; + case "VERIFY": + case 2: + message.utf8Validation = 2; + break; + case "NONE": + case 3: + message.utf8Validation = 3; + break; + } + switch (object.messageEncoding) { + default: + if (typeof object.messageEncoding === "number") { + message.messageEncoding = object.messageEncoding; + break; + } + break; + case "MESSAGE_ENCODING_UNKNOWN": + case 0: + message.messageEncoding = 0; + break; + case "LENGTH_PREFIXED": + case 1: + message.messageEncoding = 1; + break; + case "DELIMITED": + case 2: + message.messageEncoding = 2; + break; + } + switch (object.jsonFormat) { + default: + if (typeof object.jsonFormat === "number") { + message.jsonFormat = object.jsonFormat; + break; + } + break; + case "JSON_FORMAT_UNKNOWN": + case 0: + message.jsonFormat = 0; + break; + case "ALLOW": + case 1: + message.jsonFormat = 1; + break; + case "LEGACY_BEST_EFFORT": + case 2: + message.jsonFormat = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.FeatureSet} message FeatureSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.fieldPresence = options.enums === String ? "FIELD_PRESENCE_UNKNOWN" : 0; + object.enumType = options.enums === String ? "ENUM_TYPE_UNKNOWN" : 0; + object.repeatedFieldEncoding = options.enums === String ? "REPEATED_FIELD_ENCODING_UNKNOWN" : 0; + object.utf8Validation = options.enums === String ? "UTF8_VALIDATION_UNKNOWN" : 0; + object.messageEncoding = options.enums === String ? "MESSAGE_ENCODING_UNKNOWN" : 0; + object.jsonFormat = options.enums === String ? "JSON_FORMAT_UNKNOWN" : 0; + } + if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) + object.fieldPresence = options.enums === String ? $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] === undefined ? message.fieldPresence : $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] : message.fieldPresence; + if (message.enumType != null && message.hasOwnProperty("enumType")) + object.enumType = options.enums === String ? $root.google.protobuf.FeatureSet.EnumType[message.enumType] === undefined ? message.enumType : $root.google.protobuf.FeatureSet.EnumType[message.enumType] : message.enumType; + if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) + object.repeatedFieldEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] === undefined ? message.repeatedFieldEncoding : $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] : message.repeatedFieldEncoding; + if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) + object.utf8Validation = options.enums === String ? $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] === undefined ? message.utf8Validation : $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] : message.utf8Validation; + if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) + object.messageEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] === undefined ? message.messageEncoding : $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] : message.messageEncoding; + if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) + object.jsonFormat = options.enums === String ? $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] === undefined ? message.jsonFormat : $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] : message.jsonFormat; + return object; + }; + + /** + * Converts this FeatureSet to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSet + * @instance + * @returns {Object.} JSON object + */ + FeatureSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSet + * @function getTypeUrl + * @memberof google.protobuf.FeatureSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSet"; + }; + + /** + * FieldPresence enum. + * @name google.protobuf.FeatureSet.FieldPresence + * @enum {number} + * @property {number} FIELD_PRESENCE_UNKNOWN=0 FIELD_PRESENCE_UNKNOWN value + * @property {number} EXPLICIT=1 EXPLICIT value + * @property {number} IMPLICIT=2 IMPLICIT value + * @property {number} LEGACY_REQUIRED=3 LEGACY_REQUIRED value + */ + FeatureSet.FieldPresence = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_PRESENCE_UNKNOWN"] = 0; + values[valuesById[1] = "EXPLICIT"] = 1; + values[valuesById[2] = "IMPLICIT"] = 2; + values[valuesById[3] = "LEGACY_REQUIRED"] = 3; + return values; + })(); + + /** + * EnumType enum. + * @name google.protobuf.FeatureSet.EnumType + * @enum {number} + * @property {number} ENUM_TYPE_UNKNOWN=0 ENUM_TYPE_UNKNOWN value + * @property {number} OPEN=1 OPEN value + * @property {number} CLOSED=2 CLOSED value + */ + FeatureSet.EnumType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENUM_TYPE_UNKNOWN"] = 0; + values[valuesById[1] = "OPEN"] = 1; + values[valuesById[2] = "CLOSED"] = 2; + return values; + })(); + + /** + * RepeatedFieldEncoding enum. + * @name google.protobuf.FeatureSet.RepeatedFieldEncoding + * @enum {number} + * @property {number} REPEATED_FIELD_ENCODING_UNKNOWN=0 REPEATED_FIELD_ENCODING_UNKNOWN value + * @property {number} PACKED=1 PACKED value + * @property {number} EXPANDED=2 EXPANDED value + */ + FeatureSet.RepeatedFieldEncoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "REPEATED_FIELD_ENCODING_UNKNOWN"] = 0; + values[valuesById[1] = "PACKED"] = 1; + values[valuesById[2] = "EXPANDED"] = 2; + return values; + })(); + + /** + * Utf8Validation enum. + * @name google.protobuf.FeatureSet.Utf8Validation + * @enum {number} + * @property {number} UTF8_VALIDATION_UNKNOWN=0 UTF8_VALIDATION_UNKNOWN value + * @property {number} VERIFY=2 VERIFY value + * @property {number} NONE=3 NONE value + */ + FeatureSet.Utf8Validation = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UTF8_VALIDATION_UNKNOWN"] = 0; + values[valuesById[2] = "VERIFY"] = 2; + values[valuesById[3] = "NONE"] = 3; + return values; + })(); + + /** + * MessageEncoding enum. + * @name google.protobuf.FeatureSet.MessageEncoding + * @enum {number} + * @property {number} MESSAGE_ENCODING_UNKNOWN=0 MESSAGE_ENCODING_UNKNOWN value + * @property {number} LENGTH_PREFIXED=1 LENGTH_PREFIXED value + * @property {number} DELIMITED=2 DELIMITED value + */ + FeatureSet.MessageEncoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MESSAGE_ENCODING_UNKNOWN"] = 0; + values[valuesById[1] = "LENGTH_PREFIXED"] = 1; + values[valuesById[2] = "DELIMITED"] = 2; + return values; + })(); + + /** + * JsonFormat enum. + * @name google.protobuf.FeatureSet.JsonFormat + * @enum {number} + * @property {number} JSON_FORMAT_UNKNOWN=0 JSON_FORMAT_UNKNOWN value + * @property {number} ALLOW=1 ALLOW value + * @property {number} LEGACY_BEST_EFFORT=2 LEGACY_BEST_EFFORT value + */ + FeatureSet.JsonFormat = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JSON_FORMAT_UNKNOWN"] = 0; + values[valuesById[1] = "ALLOW"] = 1; + values[valuesById[2] = "LEGACY_BEST_EFFORT"] = 2; + return values; + })(); + + return FeatureSet; + })(); + + protobuf.FeatureSetDefaults = (function() { + + /** + * Properties of a FeatureSetDefaults. + * @memberof google.protobuf + * @interface IFeatureSetDefaults + * @property {Array.|null} [defaults] FeatureSetDefaults defaults + * @property {google.protobuf.Edition|null} [minimumEdition] FeatureSetDefaults minimumEdition + * @property {google.protobuf.Edition|null} [maximumEdition] FeatureSetDefaults maximumEdition + */ + + /** + * Constructs a new FeatureSetDefaults. + * @memberof google.protobuf + * @classdesc Represents a FeatureSetDefaults. + * @implements IFeatureSetDefaults + * @constructor + * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set + */ + function FeatureSetDefaults(properties) { + this.defaults = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSetDefaults defaults. + * @member {Array.} defaults + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.defaults = $util.emptyArray; + + /** + * FeatureSetDefaults minimumEdition. + * @member {google.protobuf.Edition} minimumEdition + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.minimumEdition = 0; + + /** + * FeatureSetDefaults maximumEdition. + * @member {google.protobuf.Edition} maximumEdition + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.maximumEdition = 0; + + /** + * Creates a new FeatureSetDefaults instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults instance + */ + FeatureSetDefaults.create = function create(properties) { + return new FeatureSetDefaults(properties); + }; + + /** + * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetDefaults.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.defaults != null && message.defaults.length) + for (var i = 0; i < message.defaults.length; ++i) + $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.encode(message.defaults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.minimumEdition != null && Object.hasOwnProperty.call(message, "minimumEdition")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.minimumEdition); + if (message.maximumEdition != null && Object.hasOwnProperty.call(message, "maximumEdition")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maximumEdition); + return writer; + }; + + /** + * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetDefaults.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetDefaults.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.defaults && message.defaults.length)) + message.defaults = []; + message.defaults.push($root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.decode(reader, reader.uint32())); + break; + } + case 4: { + message.minimumEdition = reader.int32(); + break; + } + case 5: { + message.maximumEdition = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetDefaults.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSetDefaults message. + * @function verify + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSetDefaults.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.defaults != null && message.hasOwnProperty("defaults")) { + if (!Array.isArray(message.defaults)) + return "defaults: array expected"; + for (var i = 0; i < message.defaults.length; ++i) { + var error = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify(message.defaults[i]); + if (error) + return "defaults." + error; + } + } + if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) + switch (message.minimumEdition) { + default: + return "minimumEdition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) + switch (message.maximumEdition) { + default: + return "maximumEdition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + return null; + }; + + /** + * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + */ + FeatureSetDefaults.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSetDefaults) + return object; + var message = new $root.google.protobuf.FeatureSetDefaults(); + if (object.defaults) { + if (!Array.isArray(object.defaults)) + throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: array expected"); + message.defaults = []; + for (var i = 0; i < object.defaults.length; ++i) { + if (typeof object.defaults[i] !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: object expected"); + message.defaults[i] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fromObject(object.defaults[i]); + } + } + switch (object.minimumEdition) { + default: + if (typeof object.minimumEdition === "number") { + message.minimumEdition = object.minimumEdition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.minimumEdition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.minimumEdition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.minimumEdition = 999; + break; + case "EDITION_2023": + case 1000: + message.minimumEdition = 1000; + break; + case "EDITION_2024": + case 1001: + message.minimumEdition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.minimumEdition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.minimumEdition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.minimumEdition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.minimumEdition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.minimumEdition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.minimumEdition = 2147483647; + break; + } + switch (object.maximumEdition) { + default: + if (typeof object.maximumEdition === "number") { + message.maximumEdition = object.maximumEdition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.maximumEdition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.maximumEdition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.maximumEdition = 999; + break; + case "EDITION_2023": + case 1000: + message.maximumEdition = 1000; + break; + case "EDITION_2024": + case 1001: + message.maximumEdition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.maximumEdition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.maximumEdition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.maximumEdition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.maximumEdition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.maximumEdition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.maximumEdition = 2147483647; + break; + } + return message; + }; + + /** + * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.FeatureSetDefaults} message FeatureSetDefaults + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSetDefaults.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.defaults = []; + if (options.defaults) { + object.minimumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.maximumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.defaults && message.defaults.length) { + object.defaults = []; + for (var j = 0; j < message.defaults.length; ++j) + object.defaults[j] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.toObject(message.defaults[j], options); + } + if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) + object.minimumEdition = options.enums === String ? $root.google.protobuf.Edition[message.minimumEdition] === undefined ? message.minimumEdition : $root.google.protobuf.Edition[message.minimumEdition] : message.minimumEdition; + if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) + object.maximumEdition = options.enums === String ? $root.google.protobuf.Edition[message.maximumEdition] === undefined ? message.maximumEdition : $root.google.protobuf.Edition[message.maximumEdition] : message.maximumEdition; + return object; + }; + + /** + * Converts this FeatureSetDefaults to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSetDefaults + * @instance + * @returns {Object.} JSON object + */ + FeatureSetDefaults.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSetDefaults + * @function getTypeUrl + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSetDefaults.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults"; + }; + + FeatureSetDefaults.FeatureSetEditionDefault = (function() { + + /** + * Properties of a FeatureSetEditionDefault. + * @memberof google.protobuf.FeatureSetDefaults + * @interface IFeatureSetEditionDefault + * @property {google.protobuf.Edition|null} [edition] FeatureSetEditionDefault edition + * @property {google.protobuf.IFeatureSet|null} [features] FeatureSetEditionDefault features + */ + + /** + * Constructs a new FeatureSetEditionDefault. + * @memberof google.protobuf.FeatureSetDefaults + * @classdesc Represents a FeatureSetEditionDefault. + * @implements IFeatureSetEditionDefault + * @constructor + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set + */ + function FeatureSetEditionDefault(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSetEditionDefault edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.edition = 0; + + /** + * FeatureSetEditionDefault features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.features = null; + + /** + * Creates a new FeatureSetEditionDefault instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault instance + */ + FeatureSetEditionDefault.create = function create(properties) { + return new FeatureSetEditionDefault(properties); + }; + + /** + * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetEditionDefault.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetEditionDefault.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetEditionDefault.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.edition = reader.int32(); + break; + } + case 2: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetEditionDefault.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSetEditionDefault message. + * @function verify + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSetEditionDefault.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + return null; + }; + + /** + * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + */ + FeatureSetEditionDefault.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault) + return object; + var message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + return message; + }; + + /** + * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} message FeatureSetEditionDefault + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSetEditionDefault.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.features = null; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this FeatureSetEditionDefault to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + * @returns {Object.} JSON object + */ + FeatureSetEditionDefault.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSetEditionDefault + * @function getTypeUrl + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSetEditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault"; + }; + + return FeatureSetEditionDefault; + })(); + + return FeatureSetDefaults; + })(); + + protobuf.SourceCodeInfo = (function() { + + /** + * Properties of a SourceCodeInfo. + * @memberof google.protobuf + * @interface ISourceCodeInfo + * @property {Array.|null} [location] SourceCodeInfo location + */ + + /** + * Constructs a new SourceCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a SourceCodeInfo. + * @implements ISourceCodeInfo + * @constructor + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + */ + function SourceCodeInfo(properties) { + this.location = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SourceCodeInfo location. + * @member {Array.} location + * @memberof google.protobuf.SourceCodeInfo + * @instance + */ + SourceCodeInfo.prototype.location = $util.emptyArray; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance + */ + SourceCodeInfo.create = function create(properties) { + return new SourceCodeInfo(properties); + }; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.location != null && message.location.length) + for (var i = 0; i < message.location.length; ++i) + $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.location && message.location.length)) + message.location = []; + message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SourceCodeInfo message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SourceCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.location != null && message.hasOwnProperty("location")) { + if (!Array.isArray(message.location)) + return "location: array expected"; + for (var i = 0; i < message.location.length; ++i) { + var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]); + if (error) + return "location." + error; + } + } + return null; + }; + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + */ + SourceCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo) + return object; + var message = new $root.google.protobuf.SourceCodeInfo(); + if (object.location) { + if (!Array.isArray(object.location)) + throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); + message.location = []; + for (var i = 0; i < object.location.length; ++i) { + if (typeof object.location[i] !== "object") + throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); + message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SourceCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.location = []; + if (message.location && message.location.length) { + object.location = []; + for (var j = 0; j < message.location.length; ++j) + object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options); + } + return object; + }; + + /** + * Converts this SourceCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo + * @instance + * @returns {Object.} JSON object + */ + SourceCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SourceCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SourceCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo"; + }; + + SourceCodeInfo.Location = (function() { + + /** + * Properties of a Location. + * @memberof google.protobuf.SourceCodeInfo + * @interface ILocation + * @property {Array.|null} [path] Location path + * @property {Array.|null} [span] Location span + * @property {string|null} [leadingComments] Location leadingComments + * @property {string|null} [trailingComments] Location trailingComments + * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments + */ + + /** + * Constructs a new Location. + * @memberof google.protobuf.SourceCodeInfo + * @classdesc Represents a Location. + * @implements ILocation + * @constructor + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + */ + function Location(properties) { + this.path = []; + this.span = []; + this.leadingDetachedComments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Location path. + * @member {Array.} path + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.path = $util.emptyArray; + + /** + * Location span. + * @member {Array.} span + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.span = $util.emptyArray; + + /** + * Location leadingComments. + * @member {string} leadingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingComments = ""; + + /** + * Location trailingComments. + * @member {string} trailingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.trailingComments = ""; + + /** + * Location leadingDetachedComments. + * @member {Array.} leadingDetachedComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingDetachedComments = $util.emptyArray; + + /** + * Creates a new Location instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo.Location} Location instance + */ + Location.create = function create(properties) { + return new Location(properties); + }; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.span != null && message.span.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.span.length; ++i) + writer.int32(message.span[i]); + writer.ldelim(); + } + if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); + if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); + if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); + return writer; + }; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Location message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + if (!(message.span && message.span.length)) + message.span = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.span.push(reader.int32()); + } else + message.span.push(reader.int32()); + break; + } + case 3: { + message.leadingComments = reader.string(); + break; + } + case 4: { + message.trailingComments = reader.string(); + break; + } + case 6: { + if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) + message.leadingDetachedComments = []; + message.leadingDetachedComments.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Location message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Location.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.span != null && message.hasOwnProperty("span")) { + if (!Array.isArray(message.span)) + return "span: array expected"; + for (var i = 0; i < message.span.length; ++i) + if (!$util.isInteger(message.span[i])) + return "span: integer[] expected"; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + if (!$util.isString(message.leadingComments)) + return "leadingComments: string expected"; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + if (!$util.isString(message.trailingComments)) + return "trailingComments: string expected"; + if (message.leadingDetachedComments != null && message.hasOwnProperty("leadingDetachedComments")) { + if (!Array.isArray(message.leadingDetachedComments)) + return "leadingDetachedComments: array expected"; + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + if (!$util.isString(message.leadingDetachedComments[i])) + return "leadingDetachedComments: string[] expected"; + } + return null; + }; + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo.Location} Location + */ + Location.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) + return object; + var message = new $root.google.protobuf.SourceCodeInfo.Location(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.span) { + if (!Array.isArray(object.span)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); + message.span = []; + for (var i = 0; i < object.span.length; ++i) + message.span[i] = object.span[i] | 0; + } + if (object.leadingComments != null) + message.leadingComments = String(object.leadingComments); + if (object.trailingComments != null) + message.trailingComments = String(object.trailingComments); + if (object.leadingDetachedComments) { + if (!Array.isArray(object.leadingDetachedComments)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected"); + message.leadingDetachedComments = []; + for (var i = 0; i < object.leadingDetachedComments.length; ++i) + message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]); + } + return message; + }; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.Location} message Location + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Location.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.path = []; + object.span = []; + object.leadingDetachedComments = []; + } + if (options.defaults) { + object.leadingComments = ""; + object.trailingComments = ""; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.span && message.span.length) { + object.span = []; + for (var j = 0; j < message.span.length; ++j) + object.span[j] = message.span[j]; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + object.leadingComments = message.leadingComments; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + object.trailingComments = message.trailingComments; + if (message.leadingDetachedComments && message.leadingDetachedComments.length) { + object.leadingDetachedComments = []; + for (var j = 0; j < message.leadingDetachedComments.length; ++j) + object.leadingDetachedComments[j] = message.leadingDetachedComments[j]; + } + return object; + }; + + /** + * Converts this Location to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + * @returns {Object.} JSON object + */ + Location.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Location + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Location.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo.Location"; + }; + + return Location; + })(); + + return SourceCodeInfo; + })(); + + protobuf.GeneratedCodeInfo = (function() { + + /** + * Properties of a GeneratedCodeInfo. + * @memberof google.protobuf + * @interface IGeneratedCodeInfo + * @property {Array.|null} [annotation] GeneratedCodeInfo annotation + */ + + /** + * Constructs a new GeneratedCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a GeneratedCodeInfo. + * @implements IGeneratedCodeInfo + * @constructor + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + */ + function GeneratedCodeInfo(properties) { + this.annotation = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GeneratedCodeInfo annotation. + * @member {Array.} annotation + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + */ + GeneratedCodeInfo.prototype.annotation = $util.emptyArray; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance + */ + GeneratedCodeInfo.create = function create(properties) { + return new GeneratedCodeInfo(properties); + }; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotation != null && message.annotation.length) + for (var i = 0; i < message.annotation.length; ++i) + $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.annotation && message.annotation.length)) + message.annotation = []; + message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GeneratedCodeInfo message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GeneratedCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.annotation != null && message.hasOwnProperty("annotation")) { + if (!Array.isArray(message.annotation)) + return "annotation: array expected"; + for (var i = 0; i < message.annotation.length; ++i) { + var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]); + if (error) + return "annotation." + error; + } + } + return null; + }; + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + */ + GeneratedCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo(); + if (object.annotation) { + if (!Array.isArray(object.annotation)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); + message.annotation = []; + for (var i = 0; i < object.annotation.length; ++i) { + if (typeof object.annotation[i] !== "object") + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); + message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GeneratedCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.annotation = []; + if (message.annotation && message.annotation.length) { + object.annotation = []; + for (var j = 0; j < message.annotation.length; ++j) + object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options); + } + return object; + }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + * @returns {Object.} JSON object + */ + GeneratedCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GeneratedCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo"; + }; + + GeneratedCodeInfo.Annotation = (function() { + + /** + * Properties of an Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @interface IAnnotation + * @property {Array.|null} [path] Annotation path + * @property {string|null} [sourceFile] Annotation sourceFile + * @property {number|null} [begin] Annotation begin + * @property {number|null} [end] Annotation end + * @property {google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null} [semantic] Annotation semantic + */ + + /** + * Constructs a new Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @classdesc Represents an Annotation. + * @implements IAnnotation + * @constructor + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + */ + function Annotation(properties) { + this.path = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Annotation path. + * @member {Array.} path + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.path = $util.emptyArray; + + /** + * Annotation sourceFile. + * @member {string} sourceFile + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.sourceFile = ""; + + /** + * Annotation begin. + * @member {number} begin + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.begin = 0; + + /** + * Annotation end. + * @member {number} end + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.end = 0; + + /** + * Annotation semantic. + * @member {google.protobuf.GeneratedCodeInfo.Annotation.Semantic} semantic + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.semantic = 0; + + /** + * Creates a new Annotation instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance + */ + Annotation.create = function create(properties) { + return new Annotation(properties); + }; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); + if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); + if (message.semantic != null && Object.hasOwnProperty.call(message, "semantic")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.semantic); + return writer; + }; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + message.sourceFile = reader.string(); + break; + } + case 3: { + message.begin = reader.int32(); + break; + } + case 4: { + message.end = reader.int32(); + break; + } + case 5: { + message.semantic = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Annotation message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Annotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + if (!$util.isString(message.sourceFile)) + return "sourceFile: string expected"; + if (message.begin != null && message.hasOwnProperty("begin")) + if (!$util.isInteger(message.begin)) + return "begin: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.semantic != null && message.hasOwnProperty("semantic")) + switch (message.semantic) { + default: + return "semantic: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + */ + Annotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.sourceFile != null) + message.sourceFile = String(object.sourceFile); + if (object.begin != null) + message.begin = object.begin | 0; + if (object.end != null) + message.end = object.end | 0; + switch (object.semantic) { + default: + if (typeof object.semantic === "number") { + message.semantic = object.semantic; + break; + } + break; + case "NONE": + case 0: + message.semantic = 0; + break; + case "SET": + case 1: + message.semantic = 1; + break; + case "ALIAS": + case 2: + message.semantic = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Annotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.path = []; + if (options.defaults) { + object.sourceFile = ""; + object.begin = 0; + object.end = 0; + object.semantic = options.enums === String ? "NONE" : 0; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + object.sourceFile = message.sourceFile; + if (message.begin != null && message.hasOwnProperty("begin")) + object.begin = message.begin; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.semantic != null && message.hasOwnProperty("semantic")) + object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] === undefined ? message.semantic : $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic; + return object; + }; + + /** + * Converts this Annotation to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + * @returns {Object.} JSON object + */ + Annotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Annotation + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Annotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo.Annotation"; + }; + + /** + * Semantic enum. + * @name google.protobuf.GeneratedCodeInfo.Annotation.Semantic + * @enum {number} + * @property {number} NONE=0 NONE value + * @property {number} SET=1 SET value + * @property {number} ALIAS=2 ALIAS value + */ + Annotation.Semantic = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "SET"] = 1; + values[valuesById[2] = "ALIAS"] = 2; + return values; + })(); + + return Annotation; + })(); + + return GeneratedCodeInfo; + })(); + + protobuf.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof google.protobuf + * @interface IDuration + * @property {number|Long|null} [seconds] Duration seconds + * @property {number|null} [nanos] Duration nanos + */ + + /** + * Constructs a new Duration. + * @memberof google.protobuf + * @classdesc Represents a Duration. + * @implements IDuration + * @constructor + * @param {google.protobuf.IDuration=} [properties] Properties to set + */ + function Duration(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Duration seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Duration nanos. + * @member {number} nanos + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.nanos = 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration=} [properties] Properties to set + * @returns {google.protobuf.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Duration message. + * @function verify + * @memberof google.protobuf.Duration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Duration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Duration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Duration} Duration + */ + Duration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Duration) + return object; + var message = new $root.google.protobuf.Duration(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.Duration} message Duration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Duration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Duration to JSON. + * @function toJSON + * @memberof google.protobuf.Duration + * @instance + * @returns {Object.} JSON object + */ + Duration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof google.protobuf.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Duration"; + }; + + return Duration; + })(); + + protobuf.Empty = (function() { + + /** + * Properties of an Empty. + * @memberof google.protobuf + * @interface IEmpty + */ + + /** + * Constructs a new Empty. + * @memberof google.protobuf + * @classdesc Represents an Empty. + * @implements IEmpty + * @constructor + * @param {google.protobuf.IEmpty=} [properties] Properties to set + */ + function Empty(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new Empty instance using the specified properties. + * @function create + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty=} [properties] Properties to set + * @returns {google.protobuf.Empty} Empty instance + */ + Empty.create = function create(properties) { + return new Empty(properties); + }; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Empty message. + * @function verify + * @memberof google.protobuf.Empty + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Empty.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Empty + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Empty} Empty + */ + Empty.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Empty) + return object; + return new $root.google.protobuf.Empty(); + }; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.Empty} message Empty + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Empty.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Empty to JSON. + * @function toJSON + * @memberof google.protobuf.Empty + * @instance + * @returns {Object.} JSON object + */ + Empty.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Empty + * @function getTypeUrl + * @memberof google.protobuf.Empty + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Empty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Empty"; + }; + + return Empty; + })(); + + protobuf.Any = (function() { + + /** + * Properties of an Any. + * @memberof google.protobuf + * @interface IAny + * @property {string|null} [type_url] Any type_url + * @property {Uint8Array|null} [value] Any value + */ + + /** + * Constructs a new Any. + * @memberof google.protobuf + * @classdesc Represents an Any. + * @implements IAny + * @constructor + * @param {google.protobuf.IAny=} [properties] Properties to set + */ + function Any(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Any type_url. + * @member {string} type_url + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.type_url = ""; + + /** + * Any value. + * @member {Uint8Array} value + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.value = $util.newBuffer([]); + + /** + * Creates a new Any instance using the specified properties. + * @function create + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny=} [properties] Properties to set + * @returns {google.protobuf.Any} Any instance + */ + Any.create = function create(properties) { + return new Any(properties); + }; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Any message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.type_url = reader.string(); + break; + } + case 2: { + message.value = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Any message. + * @function verify + * @memberof google.protobuf.Any + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Any.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type_url != null && message.hasOwnProperty("type_url")) + if (!$util.isString(message.type_url)) + return "type_url: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Any + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Any} Any + */ + Any.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Any) + return object; + var message = new $root.google.protobuf.Any(); + if (object.type_url != null) + message.type_url = String(object.type_url); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length >= 0) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.Any} message Any + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Any.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type_url = ""; + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + } + if (message.type_url != null && message.hasOwnProperty("type_url")) + object.type_url = message.type_url; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this Any to JSON. + * @function toJSON + * @memberof google.protobuf.Any + * @instance + * @returns {Object.} JSON object + */ + Any.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Any + * @function getTypeUrl + * @memberof google.protobuf.Any + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Any.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Any"; + }; + + return Any; + })(); + + return protobuf; + })(); + + google.spanner = (function() { + + /** + * Namespace spanner. + * @memberof google + * @namespace + */ + var spanner = {}; + + spanner.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.spanner + * @namespace + */ + var v1 = {}; + + v1.ChangeStreamRecord = (function() { + + /** + * Properties of a ChangeStreamRecord. + * @memberof google.spanner.v1 + * @interface IChangeStreamRecord + * @property {google.spanner.v1.ChangeStreamRecord.IDataChangeRecord|null} [dataChangeRecord] ChangeStreamRecord dataChangeRecord + * @property {google.spanner.v1.ChangeStreamRecord.IHeartbeatRecord|null} [heartbeatRecord] ChangeStreamRecord heartbeatRecord + * @property {google.spanner.v1.ChangeStreamRecord.IPartitionStartRecord|null} [partitionStartRecord] ChangeStreamRecord partitionStartRecord + * @property {google.spanner.v1.ChangeStreamRecord.IPartitionEndRecord|null} [partitionEndRecord] ChangeStreamRecord partitionEndRecord + * @property {google.spanner.v1.ChangeStreamRecord.IPartitionEventRecord|null} [partitionEventRecord] ChangeStreamRecord partitionEventRecord + */ + + /** + * Constructs a new ChangeStreamRecord. + * @memberof google.spanner.v1 + * @classdesc Represents a ChangeStreamRecord. + * @implements IChangeStreamRecord + * @constructor + * @param {google.spanner.v1.IChangeStreamRecord=} [properties] Properties to set + */ + function ChangeStreamRecord(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ChangeStreamRecord dataChangeRecord. + * @member {google.spanner.v1.ChangeStreamRecord.IDataChangeRecord|null|undefined} dataChangeRecord + * @memberof google.spanner.v1.ChangeStreamRecord + * @instance + */ + ChangeStreamRecord.prototype.dataChangeRecord = null; + + /** + * ChangeStreamRecord heartbeatRecord. + * @member {google.spanner.v1.ChangeStreamRecord.IHeartbeatRecord|null|undefined} heartbeatRecord + * @memberof google.spanner.v1.ChangeStreamRecord + * @instance + */ + ChangeStreamRecord.prototype.heartbeatRecord = null; + + /** + * ChangeStreamRecord partitionStartRecord. + * @member {google.spanner.v1.ChangeStreamRecord.IPartitionStartRecord|null|undefined} partitionStartRecord + * @memberof google.spanner.v1.ChangeStreamRecord + * @instance + */ + ChangeStreamRecord.prototype.partitionStartRecord = null; + + /** + * ChangeStreamRecord partitionEndRecord. + * @member {google.spanner.v1.ChangeStreamRecord.IPartitionEndRecord|null|undefined} partitionEndRecord + * @memberof google.spanner.v1.ChangeStreamRecord + * @instance + */ + ChangeStreamRecord.prototype.partitionEndRecord = null; + + /** + * ChangeStreamRecord partitionEventRecord. + * @member {google.spanner.v1.ChangeStreamRecord.IPartitionEventRecord|null|undefined} partitionEventRecord + * @memberof google.spanner.v1.ChangeStreamRecord + * @instance + */ + ChangeStreamRecord.prototype.partitionEventRecord = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ChangeStreamRecord record. + * @member {"dataChangeRecord"|"heartbeatRecord"|"partitionStartRecord"|"partitionEndRecord"|"partitionEventRecord"|undefined} record + * @memberof google.spanner.v1.ChangeStreamRecord + * @instance + */ + Object.defineProperty(ChangeStreamRecord.prototype, "record", { + get: $util.oneOfGetter($oneOfFields = ["dataChangeRecord", "heartbeatRecord", "partitionStartRecord", "partitionEndRecord", "partitionEventRecord"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ChangeStreamRecord instance using the specified properties. + * @function create + * @memberof google.spanner.v1.ChangeStreamRecord + * @static + * @param {google.spanner.v1.IChangeStreamRecord=} [properties] Properties to set + * @returns {google.spanner.v1.ChangeStreamRecord} ChangeStreamRecord instance + */ + ChangeStreamRecord.create = function create(properties) { + return new ChangeStreamRecord(properties); + }; + + /** + * Encodes the specified ChangeStreamRecord message. Does not implicitly {@link google.spanner.v1.ChangeStreamRecord.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.ChangeStreamRecord + * @static + * @param {google.spanner.v1.IChangeStreamRecord} message ChangeStreamRecord message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ChangeStreamRecord.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataChangeRecord != null && Object.hasOwnProperty.call(message, "dataChangeRecord")) + $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.encode(message.dataChangeRecord, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.heartbeatRecord != null && Object.hasOwnProperty.call(message, "heartbeatRecord")) + $root.google.spanner.v1.ChangeStreamRecord.HeartbeatRecord.encode(message.heartbeatRecord, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.partitionStartRecord != null && Object.hasOwnProperty.call(message, "partitionStartRecord")) + $root.google.spanner.v1.ChangeStreamRecord.PartitionStartRecord.encode(message.partitionStartRecord, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.partitionEndRecord != null && Object.hasOwnProperty.call(message, "partitionEndRecord")) + $root.google.spanner.v1.ChangeStreamRecord.PartitionEndRecord.encode(message.partitionEndRecord, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.partitionEventRecord != null && Object.hasOwnProperty.call(message, "partitionEventRecord")) + $root.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.encode(message.partitionEventRecord, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ChangeStreamRecord message, length delimited. Does not implicitly {@link google.spanner.v1.ChangeStreamRecord.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.ChangeStreamRecord + * @static + * @param {google.spanner.v1.IChangeStreamRecord} message ChangeStreamRecord message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ChangeStreamRecord.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ChangeStreamRecord message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.ChangeStreamRecord + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.ChangeStreamRecord} ChangeStreamRecord + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ChangeStreamRecord.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.ChangeStreamRecord(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.dataChangeRecord = $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.decode(reader, reader.uint32()); + break; + } + case 2: { + message.heartbeatRecord = $root.google.spanner.v1.ChangeStreamRecord.HeartbeatRecord.decode(reader, reader.uint32()); + break; + } + case 3: { + message.partitionStartRecord = $root.google.spanner.v1.ChangeStreamRecord.PartitionStartRecord.decode(reader, reader.uint32()); + break; + } + case 4: { + message.partitionEndRecord = $root.google.spanner.v1.ChangeStreamRecord.PartitionEndRecord.decode(reader, reader.uint32()); + break; + } + case 5: { + message.partitionEventRecord = $root.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ChangeStreamRecord message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.ChangeStreamRecord + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.ChangeStreamRecord} ChangeStreamRecord + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ChangeStreamRecord.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ChangeStreamRecord message. + * @function verify + * @memberof google.spanner.v1.ChangeStreamRecord + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ChangeStreamRecord.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.dataChangeRecord != null && message.hasOwnProperty("dataChangeRecord")) { + properties.record = 1; + { + var error = $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.verify(message.dataChangeRecord); + if (error) + return "dataChangeRecord." + error; + } + } + if (message.heartbeatRecord != null && message.hasOwnProperty("heartbeatRecord")) { + if (properties.record === 1) + return "record: multiple values"; + properties.record = 1; + { + var error = $root.google.spanner.v1.ChangeStreamRecord.HeartbeatRecord.verify(message.heartbeatRecord); + if (error) + return "heartbeatRecord." + error; + } + } + if (message.partitionStartRecord != null && message.hasOwnProperty("partitionStartRecord")) { + if (properties.record === 1) + return "record: multiple values"; + properties.record = 1; + { + var error = $root.google.spanner.v1.ChangeStreamRecord.PartitionStartRecord.verify(message.partitionStartRecord); + if (error) + return "partitionStartRecord." + error; + } + } + if (message.partitionEndRecord != null && message.hasOwnProperty("partitionEndRecord")) { + if (properties.record === 1) + return "record: multiple values"; + properties.record = 1; + { + var error = $root.google.spanner.v1.ChangeStreamRecord.PartitionEndRecord.verify(message.partitionEndRecord); + if (error) + return "partitionEndRecord." + error; + } + } + if (message.partitionEventRecord != null && message.hasOwnProperty("partitionEventRecord")) { + if (properties.record === 1) + return "record: multiple values"; + properties.record = 1; + { + var error = $root.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.verify(message.partitionEventRecord); + if (error) + return "partitionEventRecord." + error; + } + } + return null; + }; + + /** + * Creates a ChangeStreamRecord message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.ChangeStreamRecord + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.ChangeStreamRecord} ChangeStreamRecord + */ + ChangeStreamRecord.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.ChangeStreamRecord) + return object; + var message = new $root.google.spanner.v1.ChangeStreamRecord(); + if (object.dataChangeRecord != null) { + if (typeof object.dataChangeRecord !== "object") + throw TypeError(".google.spanner.v1.ChangeStreamRecord.dataChangeRecord: object expected"); + message.dataChangeRecord = $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.fromObject(object.dataChangeRecord); + } + if (object.heartbeatRecord != null) { + if (typeof object.heartbeatRecord !== "object") + throw TypeError(".google.spanner.v1.ChangeStreamRecord.heartbeatRecord: object expected"); + message.heartbeatRecord = $root.google.spanner.v1.ChangeStreamRecord.HeartbeatRecord.fromObject(object.heartbeatRecord); + } + if (object.partitionStartRecord != null) { + if (typeof object.partitionStartRecord !== "object") + throw TypeError(".google.spanner.v1.ChangeStreamRecord.partitionStartRecord: object expected"); + message.partitionStartRecord = $root.google.spanner.v1.ChangeStreamRecord.PartitionStartRecord.fromObject(object.partitionStartRecord); + } + if (object.partitionEndRecord != null) { + if (typeof object.partitionEndRecord !== "object") + throw TypeError(".google.spanner.v1.ChangeStreamRecord.partitionEndRecord: object expected"); + message.partitionEndRecord = $root.google.spanner.v1.ChangeStreamRecord.PartitionEndRecord.fromObject(object.partitionEndRecord); + } + if (object.partitionEventRecord != null) { + if (typeof object.partitionEventRecord !== "object") + throw TypeError(".google.spanner.v1.ChangeStreamRecord.partitionEventRecord: object expected"); + message.partitionEventRecord = $root.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.fromObject(object.partitionEventRecord); + } + return message; + }; + + /** + * Creates a plain object from a ChangeStreamRecord message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.ChangeStreamRecord + * @static + * @param {google.spanner.v1.ChangeStreamRecord} message ChangeStreamRecord + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ChangeStreamRecord.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.dataChangeRecord != null && message.hasOwnProperty("dataChangeRecord")) { + object.dataChangeRecord = $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.toObject(message.dataChangeRecord, options); + if (options.oneofs) + object.record = "dataChangeRecord"; + } + if (message.heartbeatRecord != null && message.hasOwnProperty("heartbeatRecord")) { + object.heartbeatRecord = $root.google.spanner.v1.ChangeStreamRecord.HeartbeatRecord.toObject(message.heartbeatRecord, options); + if (options.oneofs) + object.record = "heartbeatRecord"; + } + if (message.partitionStartRecord != null && message.hasOwnProperty("partitionStartRecord")) { + object.partitionStartRecord = $root.google.spanner.v1.ChangeStreamRecord.PartitionStartRecord.toObject(message.partitionStartRecord, options); + if (options.oneofs) + object.record = "partitionStartRecord"; + } + if (message.partitionEndRecord != null && message.hasOwnProperty("partitionEndRecord")) { + object.partitionEndRecord = $root.google.spanner.v1.ChangeStreamRecord.PartitionEndRecord.toObject(message.partitionEndRecord, options); + if (options.oneofs) + object.record = "partitionEndRecord"; + } + if (message.partitionEventRecord != null && message.hasOwnProperty("partitionEventRecord")) { + object.partitionEventRecord = $root.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.toObject(message.partitionEventRecord, options); + if (options.oneofs) + object.record = "partitionEventRecord"; + } + return object; + }; + + /** + * Converts this ChangeStreamRecord to JSON. + * @function toJSON + * @memberof google.spanner.v1.ChangeStreamRecord + * @instance + * @returns {Object.} JSON object + */ + ChangeStreamRecord.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ChangeStreamRecord + * @function getTypeUrl + * @memberof google.spanner.v1.ChangeStreamRecord + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ChangeStreamRecord.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.ChangeStreamRecord"; + }; + + ChangeStreamRecord.DataChangeRecord = (function() { + + /** + * Properties of a DataChangeRecord. + * @memberof google.spanner.v1.ChangeStreamRecord + * @interface IDataChangeRecord + * @property {google.protobuf.ITimestamp|null} [commitTimestamp] DataChangeRecord commitTimestamp + * @property {string|null} [recordSequence] DataChangeRecord recordSequence + * @property {string|null} [serverTransactionId] DataChangeRecord serverTransactionId + * @property {boolean|null} [isLastRecordInTransactionInPartition] DataChangeRecord isLastRecordInTransactionInPartition + * @property {string|null} [table] DataChangeRecord table + * @property {Array.|null} [columnMetadata] DataChangeRecord columnMetadata + * @property {Array.|null} [mods] DataChangeRecord mods + * @property {google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType|null} [modType] DataChangeRecord modType + * @property {google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ValueCaptureType|null} [valueCaptureType] DataChangeRecord valueCaptureType + * @property {number|null} [numberOfRecordsInTransaction] DataChangeRecord numberOfRecordsInTransaction + * @property {number|null} [numberOfPartitionsInTransaction] DataChangeRecord numberOfPartitionsInTransaction + * @property {string|null} [transactionTag] DataChangeRecord transactionTag + * @property {boolean|null} [isSystemTransaction] DataChangeRecord isSystemTransaction + */ + + /** + * Constructs a new DataChangeRecord. + * @memberof google.spanner.v1.ChangeStreamRecord + * @classdesc Represents a DataChangeRecord. + * @implements IDataChangeRecord + * @constructor + * @param {google.spanner.v1.ChangeStreamRecord.IDataChangeRecord=} [properties] Properties to set + */ + function DataChangeRecord(properties) { + this.columnMetadata = []; + this.mods = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DataChangeRecord commitTimestamp. + * @member {google.protobuf.ITimestamp|null|undefined} commitTimestamp + * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord + * @instance + */ + DataChangeRecord.prototype.commitTimestamp = null; + + /** + * DataChangeRecord recordSequence. + * @member {string} recordSequence + * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord + * @instance + */ + DataChangeRecord.prototype.recordSequence = ""; + + /** + * DataChangeRecord serverTransactionId. + * @member {string} serverTransactionId + * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord + * @instance + */ + DataChangeRecord.prototype.serverTransactionId = ""; + + /** + * DataChangeRecord isLastRecordInTransactionInPartition. + * @member {boolean} isLastRecordInTransactionInPartition + * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord + * @instance + */ + DataChangeRecord.prototype.isLastRecordInTransactionInPartition = false; + + /** + * DataChangeRecord table. + * @member {string} table + * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord + * @instance + */ + DataChangeRecord.prototype.table = ""; + + /** + * DataChangeRecord columnMetadata. + * @member {Array.} columnMetadata + * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord + * @instance + */ + DataChangeRecord.prototype.columnMetadata = $util.emptyArray; + + /** + * DataChangeRecord mods. + * @member {Array.} mods + * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord + * @instance + */ + DataChangeRecord.prototype.mods = $util.emptyArray; + + /** + * DataChangeRecord modType. + * @member {google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType} modType + * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord + * @instance + */ + DataChangeRecord.prototype.modType = 0; + + /** + * DataChangeRecord valueCaptureType. + * @member {google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ValueCaptureType} valueCaptureType + * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord + * @instance + */ + DataChangeRecord.prototype.valueCaptureType = 0; + + /** + * DataChangeRecord numberOfRecordsInTransaction. + * @member {number} numberOfRecordsInTransaction + * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord + * @instance + */ + DataChangeRecord.prototype.numberOfRecordsInTransaction = 0; + + /** + * DataChangeRecord numberOfPartitionsInTransaction. + * @member {number} numberOfPartitionsInTransaction + * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord + * @instance + */ + DataChangeRecord.prototype.numberOfPartitionsInTransaction = 0; + + /** + * DataChangeRecord transactionTag. + * @member {string} transactionTag + * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord + * @instance + */ + DataChangeRecord.prototype.transactionTag = ""; + + /** + * DataChangeRecord isSystemTransaction. + * @member {boolean} isSystemTransaction + * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord + * @instance + */ + DataChangeRecord.prototype.isSystemTransaction = false; + + /** + * Creates a new DataChangeRecord instance using the specified properties. + * @function create + * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord + * @static + * @param {google.spanner.v1.ChangeStreamRecord.IDataChangeRecord=} [properties] Properties to set + * @returns {google.spanner.v1.ChangeStreamRecord.DataChangeRecord} DataChangeRecord instance + */ + DataChangeRecord.create = function create(properties) { + return new DataChangeRecord(properties); + }; + + /** + * Encodes the specified DataChangeRecord message. Does not implicitly {@link google.spanner.v1.ChangeStreamRecord.DataChangeRecord.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord + * @static + * @param {google.spanner.v1.ChangeStreamRecord.IDataChangeRecord} message DataChangeRecord message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataChangeRecord.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.commitTimestamp != null && Object.hasOwnProperty.call(message, "commitTimestamp")) + $root.google.protobuf.Timestamp.encode(message.commitTimestamp, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.recordSequence != null && Object.hasOwnProperty.call(message, "recordSequence")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.recordSequence); + if (message.serverTransactionId != null && Object.hasOwnProperty.call(message, "serverTransactionId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.serverTransactionId); + if (message.isLastRecordInTransactionInPartition != null && Object.hasOwnProperty.call(message, "isLastRecordInTransactionInPartition")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.isLastRecordInTransactionInPartition); + if (message.table != null && Object.hasOwnProperty.call(message, "table")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.table); + if (message.columnMetadata != null && message.columnMetadata.length) + for (var i = 0; i < message.columnMetadata.length; ++i) + $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata.encode(message.columnMetadata[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.mods != null && message.mods.length) + for (var i = 0; i < message.mods.length; ++i) + $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod.encode(message.mods[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.modType != null && Object.hasOwnProperty.call(message, "modType")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.modType); + if (message.valueCaptureType != null && Object.hasOwnProperty.call(message, "valueCaptureType")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.valueCaptureType); + if (message.numberOfRecordsInTransaction != null && Object.hasOwnProperty.call(message, "numberOfRecordsInTransaction")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.numberOfRecordsInTransaction); + if (message.numberOfPartitionsInTransaction != null && Object.hasOwnProperty.call(message, "numberOfPartitionsInTransaction")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.numberOfPartitionsInTransaction); + if (message.transactionTag != null && Object.hasOwnProperty.call(message, "transactionTag")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.transactionTag); + if (message.isSystemTransaction != null && Object.hasOwnProperty.call(message, "isSystemTransaction")) + writer.uint32(/* id 13, wireType 0 =*/104).bool(message.isSystemTransaction); + return writer; + }; + + /** + * Encodes the specified DataChangeRecord message, length delimited. Does not implicitly {@link google.spanner.v1.ChangeStreamRecord.DataChangeRecord.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord + * @static + * @param {google.spanner.v1.ChangeStreamRecord.IDataChangeRecord} message DataChangeRecord message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataChangeRecord.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DataChangeRecord message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.ChangeStreamRecord.DataChangeRecord} DataChangeRecord + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataChangeRecord.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.commitTimestamp = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.recordSequence = reader.string(); + break; + } + case 3: { + message.serverTransactionId = reader.string(); + break; + } + case 4: { + message.isLastRecordInTransactionInPartition = reader.bool(); + break; + } + case 5: { + message.table = reader.string(); + break; + } + case 6: { + if (!(message.columnMetadata && message.columnMetadata.length)) + message.columnMetadata = []; + message.columnMetadata.push($root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata.decode(reader, reader.uint32())); + break; + } + case 7: { + if (!(message.mods && message.mods.length)) + message.mods = []; + message.mods.push($root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod.decode(reader, reader.uint32())); + break; + } + case 8: { + message.modType = reader.int32(); + break; + } + case 9: { + message.valueCaptureType = reader.int32(); + break; + } + case 10: { + message.numberOfRecordsInTransaction = reader.int32(); + break; + } + case 11: { + message.numberOfPartitionsInTransaction = reader.int32(); + break; + } + case 12: { + message.transactionTag = reader.string(); + break; + } + case 13: { + message.isSystemTransaction = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DataChangeRecord message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.ChangeStreamRecord.DataChangeRecord} DataChangeRecord + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataChangeRecord.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataChangeRecord message. + * @function verify + * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataChangeRecord.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.commitTimestamp != null && message.hasOwnProperty("commitTimestamp")) { + var error = $root.google.protobuf.Timestamp.verify(message.commitTimestamp); + if (error) + return "commitTimestamp." + error; + } + if (message.recordSequence != null && message.hasOwnProperty("recordSequence")) + if (!$util.isString(message.recordSequence)) + return "recordSequence: string expected"; + if (message.serverTransactionId != null && message.hasOwnProperty("serverTransactionId")) + if (!$util.isString(message.serverTransactionId)) + return "serverTransactionId: string expected"; + if (message.isLastRecordInTransactionInPartition != null && message.hasOwnProperty("isLastRecordInTransactionInPartition")) + if (typeof message.isLastRecordInTransactionInPartition !== "boolean") + return "isLastRecordInTransactionInPartition: boolean expected"; + if (message.table != null && message.hasOwnProperty("table")) + if (!$util.isString(message.table)) + return "table: string expected"; + if (message.columnMetadata != null && message.hasOwnProperty("columnMetadata")) { + if (!Array.isArray(message.columnMetadata)) + return "columnMetadata: array expected"; + for (var i = 0; i < message.columnMetadata.length; ++i) { + var error = $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata.verify(message.columnMetadata[i]); + if (error) + return "columnMetadata." + error; + } + } + if (message.mods != null && message.hasOwnProperty("mods")) { + if (!Array.isArray(message.mods)) + return "mods: array expected"; + for (var i = 0; i < message.mods.length; ++i) { + var error = $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod.verify(message.mods[i]); + if (error) + return "mods." + error; + } + } + if (message.modType != null && message.hasOwnProperty("modType")) + switch (message.modType) { + default: + return "modType: enum value expected"; + case 0: + case 10: + case 20: + case 30: + break; + } + if (message.valueCaptureType != null && message.hasOwnProperty("valueCaptureType")) + switch (message.valueCaptureType) { + default: + return "valueCaptureType: enum value expected"; + case 0: + case 10: + case 20: + case 30: + case 40: + break; + } + if (message.numberOfRecordsInTransaction != null && message.hasOwnProperty("numberOfRecordsInTransaction")) + if (!$util.isInteger(message.numberOfRecordsInTransaction)) + return "numberOfRecordsInTransaction: integer expected"; + if (message.numberOfPartitionsInTransaction != null && message.hasOwnProperty("numberOfPartitionsInTransaction")) + if (!$util.isInteger(message.numberOfPartitionsInTransaction)) + return "numberOfPartitionsInTransaction: integer expected"; + if (message.transactionTag != null && message.hasOwnProperty("transactionTag")) + if (!$util.isString(message.transactionTag)) + return "transactionTag: string expected"; + if (message.isSystemTransaction != null && message.hasOwnProperty("isSystemTransaction")) + if (typeof message.isSystemTransaction !== "boolean") + return "isSystemTransaction: boolean expected"; + return null; + }; + + /** + * Creates a DataChangeRecord message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.ChangeStreamRecord.DataChangeRecord} DataChangeRecord + */ + DataChangeRecord.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord) + return object; + var message = new $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord(); + if (object.commitTimestamp != null) { + if (typeof object.commitTimestamp !== "object") + throw TypeError(".google.spanner.v1.ChangeStreamRecord.DataChangeRecord.commitTimestamp: object expected"); + message.commitTimestamp = $root.google.protobuf.Timestamp.fromObject(object.commitTimestamp); + } + if (object.recordSequence != null) + message.recordSequence = String(object.recordSequence); + if (object.serverTransactionId != null) + message.serverTransactionId = String(object.serverTransactionId); + if (object.isLastRecordInTransactionInPartition != null) + message.isLastRecordInTransactionInPartition = Boolean(object.isLastRecordInTransactionInPartition); + if (object.table != null) + message.table = String(object.table); + if (object.columnMetadata) { + if (!Array.isArray(object.columnMetadata)) + throw TypeError(".google.spanner.v1.ChangeStreamRecord.DataChangeRecord.columnMetadata: array expected"); + message.columnMetadata = []; + for (var i = 0; i < object.columnMetadata.length; ++i) { + if (typeof object.columnMetadata[i] !== "object") + throw TypeError(".google.spanner.v1.ChangeStreamRecord.DataChangeRecord.columnMetadata: object expected"); + message.columnMetadata[i] = $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata.fromObject(object.columnMetadata[i]); + } + } + if (object.mods) { + if (!Array.isArray(object.mods)) + throw TypeError(".google.spanner.v1.ChangeStreamRecord.DataChangeRecord.mods: array expected"); + message.mods = []; + for (var i = 0; i < object.mods.length; ++i) { + if (typeof object.mods[i] !== "object") + throw TypeError(".google.spanner.v1.ChangeStreamRecord.DataChangeRecord.mods: object expected"); + message.mods[i] = $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod.fromObject(object.mods[i]); + } + } + switch (object.modType) { + default: + if (typeof object.modType === "number") { + message.modType = object.modType; + break; + } + break; + case "MOD_TYPE_UNSPECIFIED": + case 0: + message.modType = 0; + break; + case "INSERT": + case 10: + message.modType = 10; + break; + case "UPDATE": + case 20: + message.modType = 20; + break; + case "DELETE": + case 30: + message.modType = 30; + break; + } + switch (object.valueCaptureType) { + default: + if (typeof object.valueCaptureType === "number") { + message.valueCaptureType = object.valueCaptureType; + break; + } + break; + case "VALUE_CAPTURE_TYPE_UNSPECIFIED": + case 0: + message.valueCaptureType = 0; + break; + case "OLD_AND_NEW_VALUES": + case 10: + message.valueCaptureType = 10; + break; + case "NEW_VALUES": + case 20: + message.valueCaptureType = 20; + break; + case "NEW_ROW": + case 30: + message.valueCaptureType = 30; + break; + case "NEW_ROW_AND_OLD_VALUES": + case 40: + message.valueCaptureType = 40; + break; + } + if (object.numberOfRecordsInTransaction != null) + message.numberOfRecordsInTransaction = object.numberOfRecordsInTransaction | 0; + if (object.numberOfPartitionsInTransaction != null) + message.numberOfPartitionsInTransaction = object.numberOfPartitionsInTransaction | 0; + if (object.transactionTag != null) + message.transactionTag = String(object.transactionTag); + if (object.isSystemTransaction != null) + message.isSystemTransaction = Boolean(object.isSystemTransaction); + return message; + }; + + /** + * Creates a plain object from a DataChangeRecord message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord + * @static + * @param {google.spanner.v1.ChangeStreamRecord.DataChangeRecord} message DataChangeRecord + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataChangeRecord.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.columnMetadata = []; + object.mods = []; + } + if (options.defaults) { + object.commitTimestamp = null; + object.recordSequence = ""; + object.serverTransactionId = ""; + object.isLastRecordInTransactionInPartition = false; + object.table = ""; + object.modType = options.enums === String ? "MOD_TYPE_UNSPECIFIED" : 0; + object.valueCaptureType = options.enums === String ? "VALUE_CAPTURE_TYPE_UNSPECIFIED" : 0; + object.numberOfRecordsInTransaction = 0; + object.numberOfPartitionsInTransaction = 0; + object.transactionTag = ""; + object.isSystemTransaction = false; + } + if (message.commitTimestamp != null && message.hasOwnProperty("commitTimestamp")) + object.commitTimestamp = $root.google.protobuf.Timestamp.toObject(message.commitTimestamp, options); + if (message.recordSequence != null && message.hasOwnProperty("recordSequence")) + object.recordSequence = message.recordSequence; + if (message.serverTransactionId != null && message.hasOwnProperty("serverTransactionId")) + object.serverTransactionId = message.serverTransactionId; + if (message.isLastRecordInTransactionInPartition != null && message.hasOwnProperty("isLastRecordInTransactionInPartition")) + object.isLastRecordInTransactionInPartition = message.isLastRecordInTransactionInPartition; + if (message.table != null && message.hasOwnProperty("table")) + object.table = message.table; + if (message.columnMetadata && message.columnMetadata.length) { + object.columnMetadata = []; + for (var j = 0; j < message.columnMetadata.length; ++j) + object.columnMetadata[j] = $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata.toObject(message.columnMetadata[j], options); + } + if (message.mods && message.mods.length) { + object.mods = []; + for (var j = 0; j < message.mods.length; ++j) + object.mods[j] = $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod.toObject(message.mods[j], options); + } + if (message.modType != null && message.hasOwnProperty("modType")) + object.modType = options.enums === String ? $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType[message.modType] === undefined ? message.modType : $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType[message.modType] : message.modType; + if (message.valueCaptureType != null && message.hasOwnProperty("valueCaptureType")) + object.valueCaptureType = options.enums === String ? $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ValueCaptureType[message.valueCaptureType] === undefined ? message.valueCaptureType : $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ValueCaptureType[message.valueCaptureType] : message.valueCaptureType; + if (message.numberOfRecordsInTransaction != null && message.hasOwnProperty("numberOfRecordsInTransaction")) + object.numberOfRecordsInTransaction = message.numberOfRecordsInTransaction; + if (message.numberOfPartitionsInTransaction != null && message.hasOwnProperty("numberOfPartitionsInTransaction")) + object.numberOfPartitionsInTransaction = message.numberOfPartitionsInTransaction; + if (message.transactionTag != null && message.hasOwnProperty("transactionTag")) + object.transactionTag = message.transactionTag; + if (message.isSystemTransaction != null && message.hasOwnProperty("isSystemTransaction")) + object.isSystemTransaction = message.isSystemTransaction; + return object; + }; + + /** + * Converts this DataChangeRecord to JSON. + * @function toJSON + * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord + * @instance + * @returns {Object.} JSON object + */ + DataChangeRecord.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DataChangeRecord + * @function getTypeUrl + * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DataChangeRecord.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.ChangeStreamRecord.DataChangeRecord"; + }; + + DataChangeRecord.ColumnMetadata = (function() { + + /** + * Properties of a ColumnMetadata. + * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord + * @interface IColumnMetadata + * @property {string|null} [name] ColumnMetadata name + * @property {google.spanner.v1.IType|null} [type] ColumnMetadata type + * @property {boolean|null} [isPrimaryKey] ColumnMetadata isPrimaryKey + * @property {number|Long|null} [ordinalPosition] ColumnMetadata ordinalPosition + */ + + /** + * Constructs a new ColumnMetadata. + * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord + * @classdesc Represents a ColumnMetadata. + * @implements IColumnMetadata + * @constructor + * @param {google.spanner.v1.ChangeStreamRecord.DataChangeRecord.IColumnMetadata=} [properties] Properties to set + */ + function ColumnMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ColumnMetadata name. + * @member {string} name + * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata + * @instance + */ + ColumnMetadata.prototype.name = ""; + + /** + * ColumnMetadata type. + * @member {google.spanner.v1.IType|null|undefined} type + * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata + * @instance + */ + ColumnMetadata.prototype.type = null; + + /** + * ColumnMetadata isPrimaryKey. + * @member {boolean} isPrimaryKey + * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata + * @instance + */ + ColumnMetadata.prototype.isPrimaryKey = false; + + /** + * ColumnMetadata ordinalPosition. + * @member {number|Long} ordinalPosition + * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata + * @instance + */ + ColumnMetadata.prototype.ordinalPosition = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ColumnMetadata instance using the specified properties. + * @function create + * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata + * @static + * @param {google.spanner.v1.ChangeStreamRecord.DataChangeRecord.IColumnMetadata=} [properties] Properties to set + * @returns {google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata} ColumnMetadata instance + */ + ColumnMetadata.create = function create(properties) { + return new ColumnMetadata(properties); + }; + + /** + * Encodes the specified ColumnMetadata message. Does not implicitly {@link google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata + * @static + * @param {google.spanner.v1.ChangeStreamRecord.DataChangeRecord.IColumnMetadata} message ColumnMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ColumnMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + $root.google.spanner.v1.Type.encode(message.type, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.isPrimaryKey != null && Object.hasOwnProperty.call(message, "isPrimaryKey")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.isPrimaryKey); + if (message.ordinalPosition != null && Object.hasOwnProperty.call(message, "ordinalPosition")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.ordinalPosition); + return writer; + }; + + /** + * Encodes the specified ColumnMetadata message, length delimited. Does not implicitly {@link google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata + * @static + * @param {google.spanner.v1.ChangeStreamRecord.DataChangeRecord.IColumnMetadata} message ColumnMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ColumnMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ColumnMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata} ColumnMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ColumnMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.type = $root.google.spanner.v1.Type.decode(reader, reader.uint32()); + break; + } + case 3: { + message.isPrimaryKey = reader.bool(); + break; + } + case 4: { + message.ordinalPosition = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ColumnMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata} ColumnMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ColumnMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ColumnMetadata message. + * @function verify + * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ColumnMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.type != null && message.hasOwnProperty("type")) { + var error = $root.google.spanner.v1.Type.verify(message.type); + if (error) + return "type." + error; + } + if (message.isPrimaryKey != null && message.hasOwnProperty("isPrimaryKey")) + if (typeof message.isPrimaryKey !== "boolean") + return "isPrimaryKey: boolean expected"; + if (message.ordinalPosition != null && message.hasOwnProperty("ordinalPosition")) + if (!$util.isInteger(message.ordinalPosition) && !(message.ordinalPosition && $util.isInteger(message.ordinalPosition.low) && $util.isInteger(message.ordinalPosition.high))) + return "ordinalPosition: integer|Long expected"; + return null; + }; + + /** + * Creates a ColumnMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata} ColumnMetadata + */ + ColumnMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata) + return object; + var message = new $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata(); + if (object.name != null) + message.name = String(object.name); + if (object.type != null) { + if (typeof object.type !== "object") + throw TypeError(".google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata.type: object expected"); + message.type = $root.google.spanner.v1.Type.fromObject(object.type); + } + if (object.isPrimaryKey != null) + message.isPrimaryKey = Boolean(object.isPrimaryKey); + if (object.ordinalPosition != null) + if ($util.Long) + (message.ordinalPosition = $util.Long.fromValue(object.ordinalPosition)).unsigned = false; + else if (typeof object.ordinalPosition === "string") + message.ordinalPosition = parseInt(object.ordinalPosition, 10); + else if (typeof object.ordinalPosition === "number") + message.ordinalPosition = object.ordinalPosition; + else if (typeof object.ordinalPosition === "object") + message.ordinalPosition = new $util.LongBits(object.ordinalPosition.low >>> 0, object.ordinalPosition.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a ColumnMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata + * @static + * @param {google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata} message ColumnMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ColumnMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.type = null; + object.isPrimaryKey = false; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.ordinalPosition = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.ordinalPosition = options.longs === String ? "0" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.type != null && message.hasOwnProperty("type")) + object.type = $root.google.spanner.v1.Type.toObject(message.type, options); + if (message.isPrimaryKey != null && message.hasOwnProperty("isPrimaryKey")) + object.isPrimaryKey = message.isPrimaryKey; + if (message.ordinalPosition != null && message.hasOwnProperty("ordinalPosition")) + if (typeof message.ordinalPosition === "number") + object.ordinalPosition = options.longs === String ? String(message.ordinalPosition) : message.ordinalPosition; + else + object.ordinalPosition = options.longs === String ? $util.Long.prototype.toString.call(message.ordinalPosition) : options.longs === Number ? new $util.LongBits(message.ordinalPosition.low >>> 0, message.ordinalPosition.high >>> 0).toNumber() : message.ordinalPosition; + return object; + }; + + /** + * Converts this ColumnMetadata to JSON. + * @function toJSON + * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata + * @instance + * @returns {Object.} JSON object + */ + ColumnMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ColumnMetadata + * @function getTypeUrl + * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ColumnMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata"; + }; + + return ColumnMetadata; + })(); + + DataChangeRecord.ModValue = (function() { + + /** + * Properties of a ModValue. + * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord + * @interface IModValue + * @property {number|null} [columnMetadataIndex] ModValue columnMetadataIndex + * @property {google.protobuf.IValue|null} [value] ModValue value + */ + + /** + * Constructs a new ModValue. + * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord + * @classdesc Represents a ModValue. + * @implements IModValue + * @constructor + * @param {google.spanner.v1.ChangeStreamRecord.DataChangeRecord.IModValue=} [properties] Properties to set + */ + function ModValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ModValue columnMetadataIndex. + * @member {number} columnMetadataIndex + * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue + * @instance + */ + ModValue.prototype.columnMetadataIndex = 0; + + /** + * ModValue value. + * @member {google.protobuf.IValue|null|undefined} value + * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue + * @instance + */ + ModValue.prototype.value = null; + + /** + * Creates a new ModValue instance using the specified properties. + * @function create + * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue + * @static + * @param {google.spanner.v1.ChangeStreamRecord.DataChangeRecord.IModValue=} [properties] Properties to set + * @returns {google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue} ModValue instance + */ + ModValue.create = function create(properties) { + return new ModValue(properties); + }; + + /** + * Encodes the specified ModValue message. Does not implicitly {@link google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue + * @static + * @param {google.spanner.v1.ChangeStreamRecord.DataChangeRecord.IModValue} message ModValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.columnMetadataIndex != null && Object.hasOwnProperty.call(message, "columnMetadataIndex")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.columnMetadataIndex); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + $root.google.protobuf.Value.encode(message.value, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ModValue message, length delimited. Does not implicitly {@link google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue + * @static + * @param {google.spanner.v1.ChangeStreamRecord.DataChangeRecord.IModValue} message ModValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ModValue message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue} ModValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModValue.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.columnMetadataIndex = reader.int32(); + break; + } + case 2: { + message.value = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ModValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue} ModValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ModValue message. + * @function verify + * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ModValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.columnMetadataIndex != null && message.hasOwnProperty("columnMetadataIndex")) + if (!$util.isInteger(message.columnMetadataIndex)) + return "columnMetadataIndex: integer expected"; + if (message.value != null && message.hasOwnProperty("value")) { + var error = $root.google.protobuf.Value.verify(message.value); + if (error) + return "value." + error; + } + return null; + }; + + /** + * Creates a ModValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue} ModValue + */ + ModValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue) + return object; + var message = new $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue(); + if (object.columnMetadataIndex != null) + message.columnMetadataIndex = object.columnMetadataIndex | 0; + if (object.value != null) { + if (typeof object.value !== "object") + throw TypeError(".google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue.value: object expected"); + message.value = $root.google.protobuf.Value.fromObject(object.value); + } + return message; + }; + + /** + * Creates a plain object from a ModValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue + * @static + * @param {google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue} message ModValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ModValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.columnMetadataIndex = 0; + object.value = null; + } + if (message.columnMetadataIndex != null && message.hasOwnProperty("columnMetadataIndex")) + object.columnMetadataIndex = message.columnMetadataIndex; + if (message.value != null && message.hasOwnProperty("value")) + object.value = $root.google.protobuf.Value.toObject(message.value, options); + return object; + }; + + /** + * Converts this ModValue to JSON. + * @function toJSON + * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue + * @instance + * @returns {Object.} JSON object + */ + ModValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ModValue + * @function getTypeUrl + * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ModValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue"; + }; + + return ModValue; + })(); + + DataChangeRecord.Mod = (function() { + + /** + * Properties of a Mod. + * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord + * @interface IMod + * @property {Array.|null} [keys] Mod keys + * @property {Array.|null} [oldValues] Mod oldValues + * @property {Array.|null} [newValues] Mod newValues + */ + + /** + * Constructs a new Mod. + * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord + * @classdesc Represents a Mod. + * @implements IMod + * @constructor + * @param {google.spanner.v1.ChangeStreamRecord.DataChangeRecord.IMod=} [properties] Properties to set + */ + function Mod(properties) { + this.keys = []; + this.oldValues = []; + this.newValues = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Mod keys. + * @member {Array.} keys + * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod + * @instance + */ + Mod.prototype.keys = $util.emptyArray; + + /** + * Mod oldValues. + * @member {Array.} oldValues + * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod + * @instance + */ + Mod.prototype.oldValues = $util.emptyArray; + + /** + * Mod newValues. + * @member {Array.} newValues + * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod + * @instance + */ + Mod.prototype.newValues = $util.emptyArray; + + /** + * Creates a new Mod instance using the specified properties. + * @function create + * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod + * @static + * @param {google.spanner.v1.ChangeStreamRecord.DataChangeRecord.IMod=} [properties] Properties to set + * @returns {google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod} Mod instance + */ + Mod.create = function create(properties) { + return new Mod(properties); + }; + + /** + * Encodes the specified Mod message. Does not implicitly {@link google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod + * @static + * @param {google.spanner.v1.ChangeStreamRecord.DataChangeRecord.IMod} message Mod message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Mod.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.keys != null && message.keys.length) + for (var i = 0; i < message.keys.length; ++i) + $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue.encode(message.keys[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.oldValues != null && message.oldValues.length) + for (var i = 0; i < message.oldValues.length; ++i) + $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue.encode(message.oldValues[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.newValues != null && message.newValues.length) + for (var i = 0; i < message.newValues.length; ++i) + $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue.encode(message.newValues[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Mod message, length delimited. Does not implicitly {@link google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod + * @static + * @param {google.spanner.v1.ChangeStreamRecord.DataChangeRecord.IMod} message Mod message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Mod.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Mod message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod} Mod + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Mod.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.keys && message.keys.length)) + message.keys = []; + message.keys.push($root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.oldValues && message.oldValues.length)) + message.oldValues = []; + message.oldValues.push($root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.newValues && message.newValues.length)) + message.newValues = []; + message.newValues.push($root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Mod message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod} Mod + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Mod.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Mod message. + * @function verify + * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Mod.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.keys != null && message.hasOwnProperty("keys")) { + if (!Array.isArray(message.keys)) + return "keys: array expected"; + for (var i = 0; i < message.keys.length; ++i) { + var error = $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue.verify(message.keys[i]); + if (error) + return "keys." + error; + } + } + if (message.oldValues != null && message.hasOwnProperty("oldValues")) { + if (!Array.isArray(message.oldValues)) + return "oldValues: array expected"; + for (var i = 0; i < message.oldValues.length; ++i) { + var error = $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue.verify(message.oldValues[i]); + if (error) + return "oldValues." + error; + } + } + if (message.newValues != null && message.hasOwnProperty("newValues")) { + if (!Array.isArray(message.newValues)) + return "newValues: array expected"; + for (var i = 0; i < message.newValues.length; ++i) { + var error = $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue.verify(message.newValues[i]); + if (error) + return "newValues." + error; + } + } + return null; + }; + + /** + * Creates a Mod message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod} Mod + */ + Mod.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod) + return object; + var message = new $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod(); + if (object.keys) { + if (!Array.isArray(object.keys)) + throw TypeError(".google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod.keys: array expected"); + message.keys = []; + for (var i = 0; i < object.keys.length; ++i) { + if (typeof object.keys[i] !== "object") + throw TypeError(".google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod.keys: object expected"); + message.keys[i] = $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue.fromObject(object.keys[i]); + } + } + if (object.oldValues) { + if (!Array.isArray(object.oldValues)) + throw TypeError(".google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod.oldValues: array expected"); + message.oldValues = []; + for (var i = 0; i < object.oldValues.length; ++i) { + if (typeof object.oldValues[i] !== "object") + throw TypeError(".google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod.oldValues: object expected"); + message.oldValues[i] = $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue.fromObject(object.oldValues[i]); + } + } + if (object.newValues) { + if (!Array.isArray(object.newValues)) + throw TypeError(".google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod.newValues: array expected"); + message.newValues = []; + for (var i = 0; i < object.newValues.length; ++i) { + if (typeof object.newValues[i] !== "object") + throw TypeError(".google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod.newValues: object expected"); + message.newValues[i] = $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue.fromObject(object.newValues[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Mod message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod + * @static + * @param {google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod} message Mod + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Mod.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.keys = []; + object.oldValues = []; + object.newValues = []; + } + if (message.keys && message.keys.length) { + object.keys = []; + for (var j = 0; j < message.keys.length; ++j) + object.keys[j] = $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue.toObject(message.keys[j], options); + } + if (message.oldValues && message.oldValues.length) { + object.oldValues = []; + for (var j = 0; j < message.oldValues.length; ++j) + object.oldValues[j] = $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue.toObject(message.oldValues[j], options); + } + if (message.newValues && message.newValues.length) { + object.newValues = []; + for (var j = 0; j < message.newValues.length; ++j) + object.newValues[j] = $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue.toObject(message.newValues[j], options); + } + return object; + }; + + /** + * Converts this Mod to JSON. + * @function toJSON + * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod + * @instance + * @returns {Object.} JSON object + */ + Mod.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Mod + * @function getTypeUrl + * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Mod.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod"; + }; + + return Mod; + })(); + + /** + * ModType enum. + * @name google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType + * @enum {number} + * @property {number} MOD_TYPE_UNSPECIFIED=0 MOD_TYPE_UNSPECIFIED value + * @property {number} INSERT=10 INSERT value + * @property {number} UPDATE=20 UPDATE value + * @property {number} DELETE=30 DELETE value + */ + DataChangeRecord.ModType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MOD_TYPE_UNSPECIFIED"] = 0; + values[valuesById[10] = "INSERT"] = 10; + values[valuesById[20] = "UPDATE"] = 20; + values[valuesById[30] = "DELETE"] = 30; + return values; + })(); + + /** + * ValueCaptureType enum. + * @name google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ValueCaptureType + * @enum {number} + * @property {number} VALUE_CAPTURE_TYPE_UNSPECIFIED=0 VALUE_CAPTURE_TYPE_UNSPECIFIED value + * @property {number} OLD_AND_NEW_VALUES=10 OLD_AND_NEW_VALUES value + * @property {number} NEW_VALUES=20 NEW_VALUES value + * @property {number} NEW_ROW=30 NEW_ROW value + * @property {number} NEW_ROW_AND_OLD_VALUES=40 NEW_ROW_AND_OLD_VALUES value + */ + DataChangeRecord.ValueCaptureType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "VALUE_CAPTURE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[10] = "OLD_AND_NEW_VALUES"] = 10; + values[valuesById[20] = "NEW_VALUES"] = 20; + values[valuesById[30] = "NEW_ROW"] = 30; + values[valuesById[40] = "NEW_ROW_AND_OLD_VALUES"] = 40; + return values; + })(); + + return DataChangeRecord; + })(); + + ChangeStreamRecord.HeartbeatRecord = (function() { + + /** + * Properties of a HeartbeatRecord. + * @memberof google.spanner.v1.ChangeStreamRecord + * @interface IHeartbeatRecord + * @property {google.protobuf.ITimestamp|null} [timestamp] HeartbeatRecord timestamp + */ + + /** + * Constructs a new HeartbeatRecord. + * @memberof google.spanner.v1.ChangeStreamRecord + * @classdesc Represents a HeartbeatRecord. + * @implements IHeartbeatRecord + * @constructor + * @param {google.spanner.v1.ChangeStreamRecord.IHeartbeatRecord=} [properties] Properties to set + */ + function HeartbeatRecord(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HeartbeatRecord timestamp. + * @member {google.protobuf.ITimestamp|null|undefined} timestamp + * @memberof google.spanner.v1.ChangeStreamRecord.HeartbeatRecord + * @instance + */ + HeartbeatRecord.prototype.timestamp = null; + + /** + * Creates a new HeartbeatRecord instance using the specified properties. + * @function create + * @memberof google.spanner.v1.ChangeStreamRecord.HeartbeatRecord + * @static + * @param {google.spanner.v1.ChangeStreamRecord.IHeartbeatRecord=} [properties] Properties to set + * @returns {google.spanner.v1.ChangeStreamRecord.HeartbeatRecord} HeartbeatRecord instance + */ + HeartbeatRecord.create = function create(properties) { + return new HeartbeatRecord(properties); + }; + + /** + * Encodes the specified HeartbeatRecord message. Does not implicitly {@link google.spanner.v1.ChangeStreamRecord.HeartbeatRecord.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.ChangeStreamRecord.HeartbeatRecord + * @static + * @param {google.spanner.v1.ChangeStreamRecord.IHeartbeatRecord} message HeartbeatRecord message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HeartbeatRecord.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) + $root.google.protobuf.Timestamp.encode(message.timestamp, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified HeartbeatRecord message, length delimited. Does not implicitly {@link google.spanner.v1.ChangeStreamRecord.HeartbeatRecord.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.ChangeStreamRecord.HeartbeatRecord + * @static + * @param {google.spanner.v1.ChangeStreamRecord.IHeartbeatRecord} message HeartbeatRecord message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HeartbeatRecord.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HeartbeatRecord message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.ChangeStreamRecord.HeartbeatRecord + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.ChangeStreamRecord.HeartbeatRecord} HeartbeatRecord + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HeartbeatRecord.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.ChangeStreamRecord.HeartbeatRecord(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.timestamp = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HeartbeatRecord message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.ChangeStreamRecord.HeartbeatRecord + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.ChangeStreamRecord.HeartbeatRecord} HeartbeatRecord + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HeartbeatRecord.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HeartbeatRecord message. + * @function verify + * @memberof google.spanner.v1.ChangeStreamRecord.HeartbeatRecord + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HeartbeatRecord.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.timestamp != null && message.hasOwnProperty("timestamp")) { + var error = $root.google.protobuf.Timestamp.verify(message.timestamp); + if (error) + return "timestamp." + error; + } + return null; + }; + + /** + * Creates a HeartbeatRecord message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.ChangeStreamRecord.HeartbeatRecord + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.ChangeStreamRecord.HeartbeatRecord} HeartbeatRecord + */ + HeartbeatRecord.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.ChangeStreamRecord.HeartbeatRecord) + return object; + var message = new $root.google.spanner.v1.ChangeStreamRecord.HeartbeatRecord(); + if (object.timestamp != null) { + if (typeof object.timestamp !== "object") + throw TypeError(".google.spanner.v1.ChangeStreamRecord.HeartbeatRecord.timestamp: object expected"); + message.timestamp = $root.google.protobuf.Timestamp.fromObject(object.timestamp); + } + return message; + }; + + /** + * Creates a plain object from a HeartbeatRecord message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.ChangeStreamRecord.HeartbeatRecord + * @static + * @param {google.spanner.v1.ChangeStreamRecord.HeartbeatRecord} message HeartbeatRecord + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HeartbeatRecord.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.timestamp = null; + if (message.timestamp != null && message.hasOwnProperty("timestamp")) + object.timestamp = $root.google.protobuf.Timestamp.toObject(message.timestamp, options); + return object; + }; + + /** + * Converts this HeartbeatRecord to JSON. + * @function toJSON + * @memberof google.spanner.v1.ChangeStreamRecord.HeartbeatRecord + * @instance + * @returns {Object.} JSON object + */ + HeartbeatRecord.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HeartbeatRecord + * @function getTypeUrl + * @memberof google.spanner.v1.ChangeStreamRecord.HeartbeatRecord + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HeartbeatRecord.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.ChangeStreamRecord.HeartbeatRecord"; + }; + + return HeartbeatRecord; + })(); + + ChangeStreamRecord.PartitionStartRecord = (function() { + + /** + * Properties of a PartitionStartRecord. + * @memberof google.spanner.v1.ChangeStreamRecord + * @interface IPartitionStartRecord + * @property {google.protobuf.ITimestamp|null} [startTimestamp] PartitionStartRecord startTimestamp + * @property {string|null} [recordSequence] PartitionStartRecord recordSequence + * @property {Array.|null} [partitionTokens] PartitionStartRecord partitionTokens + */ + + /** + * Constructs a new PartitionStartRecord. + * @memberof google.spanner.v1.ChangeStreamRecord + * @classdesc Represents a PartitionStartRecord. + * @implements IPartitionStartRecord + * @constructor + * @param {google.spanner.v1.ChangeStreamRecord.IPartitionStartRecord=} [properties] Properties to set + */ + function PartitionStartRecord(properties) { + this.partitionTokens = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PartitionStartRecord startTimestamp. + * @member {google.protobuf.ITimestamp|null|undefined} startTimestamp + * @memberof google.spanner.v1.ChangeStreamRecord.PartitionStartRecord + * @instance + */ + PartitionStartRecord.prototype.startTimestamp = null; + + /** + * PartitionStartRecord recordSequence. + * @member {string} recordSequence + * @memberof google.spanner.v1.ChangeStreamRecord.PartitionStartRecord + * @instance + */ + PartitionStartRecord.prototype.recordSequence = ""; + + /** + * PartitionStartRecord partitionTokens. + * @member {Array.} partitionTokens + * @memberof google.spanner.v1.ChangeStreamRecord.PartitionStartRecord + * @instance + */ + PartitionStartRecord.prototype.partitionTokens = $util.emptyArray; + + /** + * Creates a new PartitionStartRecord instance using the specified properties. + * @function create + * @memberof google.spanner.v1.ChangeStreamRecord.PartitionStartRecord + * @static + * @param {google.spanner.v1.ChangeStreamRecord.IPartitionStartRecord=} [properties] Properties to set + * @returns {google.spanner.v1.ChangeStreamRecord.PartitionStartRecord} PartitionStartRecord instance + */ + PartitionStartRecord.create = function create(properties) { + return new PartitionStartRecord(properties); + }; + + /** + * Encodes the specified PartitionStartRecord message. Does not implicitly {@link google.spanner.v1.ChangeStreamRecord.PartitionStartRecord.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.ChangeStreamRecord.PartitionStartRecord + * @static + * @param {google.spanner.v1.ChangeStreamRecord.IPartitionStartRecord} message PartitionStartRecord message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartitionStartRecord.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startTimestamp != null && Object.hasOwnProperty.call(message, "startTimestamp")) + $root.google.protobuf.Timestamp.encode(message.startTimestamp, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.recordSequence != null && Object.hasOwnProperty.call(message, "recordSequence")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.recordSequence); + if (message.partitionTokens != null && message.partitionTokens.length) + for (var i = 0; i < message.partitionTokens.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.partitionTokens[i]); + return writer; + }; + + /** + * Encodes the specified PartitionStartRecord message, length delimited. Does not implicitly {@link google.spanner.v1.ChangeStreamRecord.PartitionStartRecord.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.ChangeStreamRecord.PartitionStartRecord + * @static + * @param {google.spanner.v1.ChangeStreamRecord.IPartitionStartRecord} message PartitionStartRecord message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartitionStartRecord.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PartitionStartRecord message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.ChangeStreamRecord.PartitionStartRecord + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.ChangeStreamRecord.PartitionStartRecord} PartitionStartRecord + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartitionStartRecord.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.ChangeStreamRecord.PartitionStartRecord(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.startTimestamp = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.recordSequence = reader.string(); + break; + } + case 3: { + if (!(message.partitionTokens && message.partitionTokens.length)) + message.partitionTokens = []; + message.partitionTokens.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PartitionStartRecord message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.ChangeStreamRecord.PartitionStartRecord + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.ChangeStreamRecord.PartitionStartRecord} PartitionStartRecord + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartitionStartRecord.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PartitionStartRecord message. + * @function verify + * @memberof google.spanner.v1.ChangeStreamRecord.PartitionStartRecord + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PartitionStartRecord.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startTimestamp != null && message.hasOwnProperty("startTimestamp")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTimestamp); + if (error) + return "startTimestamp." + error; + } + if (message.recordSequence != null && message.hasOwnProperty("recordSequence")) + if (!$util.isString(message.recordSequence)) + return "recordSequence: string expected"; + if (message.partitionTokens != null && message.hasOwnProperty("partitionTokens")) { + if (!Array.isArray(message.partitionTokens)) + return "partitionTokens: array expected"; + for (var i = 0; i < message.partitionTokens.length; ++i) + if (!$util.isString(message.partitionTokens[i])) + return "partitionTokens: string[] expected"; + } + return null; + }; + + /** + * Creates a PartitionStartRecord message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.ChangeStreamRecord.PartitionStartRecord + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.ChangeStreamRecord.PartitionStartRecord} PartitionStartRecord + */ + PartitionStartRecord.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.ChangeStreamRecord.PartitionStartRecord) + return object; + var message = new $root.google.spanner.v1.ChangeStreamRecord.PartitionStartRecord(); + if (object.startTimestamp != null) { + if (typeof object.startTimestamp !== "object") + throw TypeError(".google.spanner.v1.ChangeStreamRecord.PartitionStartRecord.startTimestamp: object expected"); + message.startTimestamp = $root.google.protobuf.Timestamp.fromObject(object.startTimestamp); + } + if (object.recordSequence != null) + message.recordSequence = String(object.recordSequence); + if (object.partitionTokens) { + if (!Array.isArray(object.partitionTokens)) + throw TypeError(".google.spanner.v1.ChangeStreamRecord.PartitionStartRecord.partitionTokens: array expected"); + message.partitionTokens = []; + for (var i = 0; i < object.partitionTokens.length; ++i) + message.partitionTokens[i] = String(object.partitionTokens[i]); + } + return message; + }; + + /** + * Creates a plain object from a PartitionStartRecord message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.ChangeStreamRecord.PartitionStartRecord + * @static + * @param {google.spanner.v1.ChangeStreamRecord.PartitionStartRecord} message PartitionStartRecord + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PartitionStartRecord.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.partitionTokens = []; + if (options.defaults) { + object.startTimestamp = null; + object.recordSequence = ""; + } + if (message.startTimestamp != null && message.hasOwnProperty("startTimestamp")) + object.startTimestamp = $root.google.protobuf.Timestamp.toObject(message.startTimestamp, options); + if (message.recordSequence != null && message.hasOwnProperty("recordSequence")) + object.recordSequence = message.recordSequence; + if (message.partitionTokens && message.partitionTokens.length) { + object.partitionTokens = []; + for (var j = 0; j < message.partitionTokens.length; ++j) + object.partitionTokens[j] = message.partitionTokens[j]; + } + return object; + }; + + /** + * Converts this PartitionStartRecord to JSON. + * @function toJSON + * @memberof google.spanner.v1.ChangeStreamRecord.PartitionStartRecord + * @instance + * @returns {Object.} JSON object + */ + PartitionStartRecord.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PartitionStartRecord + * @function getTypeUrl + * @memberof google.spanner.v1.ChangeStreamRecord.PartitionStartRecord + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PartitionStartRecord.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.ChangeStreamRecord.PartitionStartRecord"; + }; + + return PartitionStartRecord; + })(); + + ChangeStreamRecord.PartitionEndRecord = (function() { + + /** + * Properties of a PartitionEndRecord. + * @memberof google.spanner.v1.ChangeStreamRecord + * @interface IPartitionEndRecord + * @property {google.protobuf.ITimestamp|null} [endTimestamp] PartitionEndRecord endTimestamp + * @property {string|null} [recordSequence] PartitionEndRecord recordSequence + * @property {string|null} [partitionToken] PartitionEndRecord partitionToken + */ + + /** + * Constructs a new PartitionEndRecord. + * @memberof google.spanner.v1.ChangeStreamRecord + * @classdesc Represents a PartitionEndRecord. + * @implements IPartitionEndRecord + * @constructor + * @param {google.spanner.v1.ChangeStreamRecord.IPartitionEndRecord=} [properties] Properties to set + */ + function PartitionEndRecord(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PartitionEndRecord endTimestamp. + * @member {google.protobuf.ITimestamp|null|undefined} endTimestamp + * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEndRecord + * @instance + */ + PartitionEndRecord.prototype.endTimestamp = null; + + /** + * PartitionEndRecord recordSequence. + * @member {string} recordSequence + * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEndRecord + * @instance + */ + PartitionEndRecord.prototype.recordSequence = ""; + + /** + * PartitionEndRecord partitionToken. + * @member {string} partitionToken + * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEndRecord + * @instance + */ + PartitionEndRecord.prototype.partitionToken = ""; + + /** + * Creates a new PartitionEndRecord instance using the specified properties. + * @function create + * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEndRecord + * @static + * @param {google.spanner.v1.ChangeStreamRecord.IPartitionEndRecord=} [properties] Properties to set + * @returns {google.spanner.v1.ChangeStreamRecord.PartitionEndRecord} PartitionEndRecord instance + */ + PartitionEndRecord.create = function create(properties) { + return new PartitionEndRecord(properties); + }; + + /** + * Encodes the specified PartitionEndRecord message. Does not implicitly {@link google.spanner.v1.ChangeStreamRecord.PartitionEndRecord.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEndRecord + * @static + * @param {google.spanner.v1.ChangeStreamRecord.IPartitionEndRecord} message PartitionEndRecord message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartitionEndRecord.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.endTimestamp != null && Object.hasOwnProperty.call(message, "endTimestamp")) + $root.google.protobuf.Timestamp.encode(message.endTimestamp, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.recordSequence != null && Object.hasOwnProperty.call(message, "recordSequence")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.recordSequence); + if (message.partitionToken != null && Object.hasOwnProperty.call(message, "partitionToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.partitionToken); + return writer; + }; + + /** + * Encodes the specified PartitionEndRecord message, length delimited. Does not implicitly {@link google.spanner.v1.ChangeStreamRecord.PartitionEndRecord.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEndRecord + * @static + * @param {google.spanner.v1.ChangeStreamRecord.IPartitionEndRecord} message PartitionEndRecord message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartitionEndRecord.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PartitionEndRecord message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEndRecord + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.ChangeStreamRecord.PartitionEndRecord} PartitionEndRecord + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartitionEndRecord.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.ChangeStreamRecord.PartitionEndRecord(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.endTimestamp = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.recordSequence = reader.string(); + break; + } + case 3: { + message.partitionToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PartitionEndRecord message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEndRecord + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.ChangeStreamRecord.PartitionEndRecord} PartitionEndRecord + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartitionEndRecord.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PartitionEndRecord message. + * @function verify + * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEndRecord + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PartitionEndRecord.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.endTimestamp != null && message.hasOwnProperty("endTimestamp")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTimestamp); + if (error) + return "endTimestamp." + error; + } + if (message.recordSequence != null && message.hasOwnProperty("recordSequence")) + if (!$util.isString(message.recordSequence)) + return "recordSequence: string expected"; + if (message.partitionToken != null && message.hasOwnProperty("partitionToken")) + if (!$util.isString(message.partitionToken)) + return "partitionToken: string expected"; + return null; + }; + + /** + * Creates a PartitionEndRecord message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEndRecord + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.ChangeStreamRecord.PartitionEndRecord} PartitionEndRecord + */ + PartitionEndRecord.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.ChangeStreamRecord.PartitionEndRecord) + return object; + var message = new $root.google.spanner.v1.ChangeStreamRecord.PartitionEndRecord(); + if (object.endTimestamp != null) { + if (typeof object.endTimestamp !== "object") + throw TypeError(".google.spanner.v1.ChangeStreamRecord.PartitionEndRecord.endTimestamp: object expected"); + message.endTimestamp = $root.google.protobuf.Timestamp.fromObject(object.endTimestamp); + } + if (object.recordSequence != null) + message.recordSequence = String(object.recordSequence); + if (object.partitionToken != null) + message.partitionToken = String(object.partitionToken); + return message; + }; + + /** + * Creates a plain object from a PartitionEndRecord message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEndRecord + * @static + * @param {google.spanner.v1.ChangeStreamRecord.PartitionEndRecord} message PartitionEndRecord + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PartitionEndRecord.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.endTimestamp = null; + object.recordSequence = ""; + object.partitionToken = ""; + } + if (message.endTimestamp != null && message.hasOwnProperty("endTimestamp")) + object.endTimestamp = $root.google.protobuf.Timestamp.toObject(message.endTimestamp, options); + if (message.recordSequence != null && message.hasOwnProperty("recordSequence")) + object.recordSequence = message.recordSequence; + if (message.partitionToken != null && message.hasOwnProperty("partitionToken")) + object.partitionToken = message.partitionToken; + return object; + }; + + /** + * Converts this PartitionEndRecord to JSON. + * @function toJSON + * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEndRecord + * @instance + * @returns {Object.} JSON object + */ + PartitionEndRecord.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PartitionEndRecord + * @function getTypeUrl + * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEndRecord + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PartitionEndRecord.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.ChangeStreamRecord.PartitionEndRecord"; + }; + + return PartitionEndRecord; + })(); + + ChangeStreamRecord.PartitionEventRecord = (function() { + + /** + * Properties of a PartitionEventRecord. + * @memberof google.spanner.v1.ChangeStreamRecord + * @interface IPartitionEventRecord + * @property {google.protobuf.ITimestamp|null} [commitTimestamp] PartitionEventRecord commitTimestamp + * @property {string|null} [recordSequence] PartitionEventRecord recordSequence + * @property {string|null} [partitionToken] PartitionEventRecord partitionToken + * @property {Array.|null} [moveInEvents] PartitionEventRecord moveInEvents + * @property {Array.|null} [moveOutEvents] PartitionEventRecord moveOutEvents + */ + + /** + * Constructs a new PartitionEventRecord. + * @memberof google.spanner.v1.ChangeStreamRecord + * @classdesc Represents a PartitionEventRecord. + * @implements IPartitionEventRecord + * @constructor + * @param {google.spanner.v1.ChangeStreamRecord.IPartitionEventRecord=} [properties] Properties to set + */ + function PartitionEventRecord(properties) { + this.moveInEvents = []; + this.moveOutEvents = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PartitionEventRecord commitTimestamp. + * @member {google.protobuf.ITimestamp|null|undefined} commitTimestamp + * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEventRecord + * @instance + */ + PartitionEventRecord.prototype.commitTimestamp = null; + + /** + * PartitionEventRecord recordSequence. + * @member {string} recordSequence + * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEventRecord + * @instance + */ + PartitionEventRecord.prototype.recordSequence = ""; + + /** + * PartitionEventRecord partitionToken. + * @member {string} partitionToken + * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEventRecord + * @instance + */ + PartitionEventRecord.prototype.partitionToken = ""; + + /** + * PartitionEventRecord moveInEvents. + * @member {Array.} moveInEvents + * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEventRecord + * @instance + */ + PartitionEventRecord.prototype.moveInEvents = $util.emptyArray; + + /** + * PartitionEventRecord moveOutEvents. + * @member {Array.} moveOutEvents + * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEventRecord + * @instance + */ + PartitionEventRecord.prototype.moveOutEvents = $util.emptyArray; + + /** + * Creates a new PartitionEventRecord instance using the specified properties. + * @function create + * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEventRecord + * @static + * @param {google.spanner.v1.ChangeStreamRecord.IPartitionEventRecord=} [properties] Properties to set + * @returns {google.spanner.v1.ChangeStreamRecord.PartitionEventRecord} PartitionEventRecord instance + */ + PartitionEventRecord.create = function create(properties) { + return new PartitionEventRecord(properties); + }; + + /** + * Encodes the specified PartitionEventRecord message. Does not implicitly {@link google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEventRecord + * @static + * @param {google.spanner.v1.ChangeStreamRecord.IPartitionEventRecord} message PartitionEventRecord message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartitionEventRecord.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.commitTimestamp != null && Object.hasOwnProperty.call(message, "commitTimestamp")) + $root.google.protobuf.Timestamp.encode(message.commitTimestamp, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.recordSequence != null && Object.hasOwnProperty.call(message, "recordSequence")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.recordSequence); + if (message.partitionToken != null && Object.hasOwnProperty.call(message, "partitionToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.partitionToken); + if (message.moveInEvents != null && message.moveInEvents.length) + for (var i = 0; i < message.moveInEvents.length; ++i) + $root.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent.encode(message.moveInEvents[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.moveOutEvents != null && message.moveOutEvents.length) + for (var i = 0; i < message.moveOutEvents.length; ++i) + $root.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent.encode(message.moveOutEvents[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PartitionEventRecord message, length delimited. Does not implicitly {@link google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEventRecord + * @static + * @param {google.spanner.v1.ChangeStreamRecord.IPartitionEventRecord} message PartitionEventRecord message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartitionEventRecord.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PartitionEventRecord message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEventRecord + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.ChangeStreamRecord.PartitionEventRecord} PartitionEventRecord + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartitionEventRecord.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.commitTimestamp = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.recordSequence = reader.string(); + break; + } + case 3: { + message.partitionToken = reader.string(); + break; + } + case 4: { + if (!(message.moveInEvents && message.moveInEvents.length)) + message.moveInEvents = []; + message.moveInEvents.push($root.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.moveOutEvents && message.moveOutEvents.length)) + message.moveOutEvents = []; + message.moveOutEvents.push($root.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PartitionEventRecord message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEventRecord + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.ChangeStreamRecord.PartitionEventRecord} PartitionEventRecord + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartitionEventRecord.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PartitionEventRecord message. + * @function verify + * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEventRecord + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PartitionEventRecord.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.commitTimestamp != null && message.hasOwnProperty("commitTimestamp")) { + var error = $root.google.protobuf.Timestamp.verify(message.commitTimestamp); + if (error) + return "commitTimestamp." + error; + } + if (message.recordSequence != null && message.hasOwnProperty("recordSequence")) + if (!$util.isString(message.recordSequence)) + return "recordSequence: string expected"; + if (message.partitionToken != null && message.hasOwnProperty("partitionToken")) + if (!$util.isString(message.partitionToken)) + return "partitionToken: string expected"; + if (message.moveInEvents != null && message.hasOwnProperty("moveInEvents")) { + if (!Array.isArray(message.moveInEvents)) + return "moveInEvents: array expected"; + for (var i = 0; i < message.moveInEvents.length; ++i) { + var error = $root.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent.verify(message.moveInEvents[i]); + if (error) + return "moveInEvents." + error; + } + } + if (message.moveOutEvents != null && message.hasOwnProperty("moveOutEvents")) { + if (!Array.isArray(message.moveOutEvents)) + return "moveOutEvents: array expected"; + for (var i = 0; i < message.moveOutEvents.length; ++i) { + var error = $root.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent.verify(message.moveOutEvents[i]); + if (error) + return "moveOutEvents." + error; + } + } + return null; + }; + + /** + * Creates a PartitionEventRecord message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEventRecord + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.ChangeStreamRecord.PartitionEventRecord} PartitionEventRecord + */ + PartitionEventRecord.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord) + return object; + var message = new $root.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord(); + if (object.commitTimestamp != null) { + if (typeof object.commitTimestamp !== "object") + throw TypeError(".google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.commitTimestamp: object expected"); + message.commitTimestamp = $root.google.protobuf.Timestamp.fromObject(object.commitTimestamp); + } + if (object.recordSequence != null) + message.recordSequence = String(object.recordSequence); + if (object.partitionToken != null) + message.partitionToken = String(object.partitionToken); + if (object.moveInEvents) { + if (!Array.isArray(object.moveInEvents)) + throw TypeError(".google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.moveInEvents: array expected"); + message.moveInEvents = []; + for (var i = 0; i < object.moveInEvents.length; ++i) { + if (typeof object.moveInEvents[i] !== "object") + throw TypeError(".google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.moveInEvents: object expected"); + message.moveInEvents[i] = $root.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent.fromObject(object.moveInEvents[i]); + } + } + if (object.moveOutEvents) { + if (!Array.isArray(object.moveOutEvents)) + throw TypeError(".google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.moveOutEvents: array expected"); + message.moveOutEvents = []; + for (var i = 0; i < object.moveOutEvents.length; ++i) { + if (typeof object.moveOutEvents[i] !== "object") + throw TypeError(".google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.moveOutEvents: object expected"); + message.moveOutEvents[i] = $root.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent.fromObject(object.moveOutEvents[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a PartitionEventRecord message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEventRecord + * @static + * @param {google.spanner.v1.ChangeStreamRecord.PartitionEventRecord} message PartitionEventRecord + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PartitionEventRecord.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.moveInEvents = []; + object.moveOutEvents = []; + } + if (options.defaults) { + object.commitTimestamp = null; + object.recordSequence = ""; + object.partitionToken = ""; + } + if (message.commitTimestamp != null && message.hasOwnProperty("commitTimestamp")) + object.commitTimestamp = $root.google.protobuf.Timestamp.toObject(message.commitTimestamp, options); + if (message.recordSequence != null && message.hasOwnProperty("recordSequence")) + object.recordSequence = message.recordSequence; + if (message.partitionToken != null && message.hasOwnProperty("partitionToken")) + object.partitionToken = message.partitionToken; + if (message.moveInEvents && message.moveInEvents.length) { + object.moveInEvents = []; + for (var j = 0; j < message.moveInEvents.length; ++j) + object.moveInEvents[j] = $root.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent.toObject(message.moveInEvents[j], options); + } + if (message.moveOutEvents && message.moveOutEvents.length) { + object.moveOutEvents = []; + for (var j = 0; j < message.moveOutEvents.length; ++j) + object.moveOutEvents[j] = $root.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent.toObject(message.moveOutEvents[j], options); + } + return object; + }; + + /** + * Converts this PartitionEventRecord to JSON. + * @function toJSON + * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEventRecord + * @instance + * @returns {Object.} JSON object + */ + PartitionEventRecord.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PartitionEventRecord + * @function getTypeUrl + * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEventRecord + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PartitionEventRecord.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.ChangeStreamRecord.PartitionEventRecord"; + }; + + PartitionEventRecord.MoveInEvent = (function() { + + /** + * Properties of a MoveInEvent. + * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEventRecord + * @interface IMoveInEvent + * @property {string|null} [sourcePartitionToken] MoveInEvent sourcePartitionToken + */ + + /** + * Constructs a new MoveInEvent. + * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEventRecord + * @classdesc Represents a MoveInEvent. + * @implements IMoveInEvent + * @constructor + * @param {google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.IMoveInEvent=} [properties] Properties to set + */ + function MoveInEvent(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MoveInEvent sourcePartitionToken. + * @member {string} sourcePartitionToken + * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent + * @instance + */ + MoveInEvent.prototype.sourcePartitionToken = ""; + + /** + * Creates a new MoveInEvent instance using the specified properties. + * @function create + * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent + * @static + * @param {google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.IMoveInEvent=} [properties] Properties to set + * @returns {google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent} MoveInEvent instance + */ + MoveInEvent.create = function create(properties) { + return new MoveInEvent(properties); + }; + + /** + * Encodes the specified MoveInEvent message. Does not implicitly {@link google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent + * @static + * @param {google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.IMoveInEvent} message MoveInEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MoveInEvent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sourcePartitionToken != null && Object.hasOwnProperty.call(message, "sourcePartitionToken")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.sourcePartitionToken); + return writer; + }; + + /** + * Encodes the specified MoveInEvent message, length delimited. Does not implicitly {@link google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent + * @static + * @param {google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.IMoveInEvent} message MoveInEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MoveInEvent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MoveInEvent message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent} MoveInEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MoveInEvent.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.sourcePartitionToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MoveInEvent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent} MoveInEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MoveInEvent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MoveInEvent message. + * @function verify + * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MoveInEvent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sourcePartitionToken != null && message.hasOwnProperty("sourcePartitionToken")) + if (!$util.isString(message.sourcePartitionToken)) + return "sourcePartitionToken: string expected"; + return null; + }; + + /** + * Creates a MoveInEvent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent} MoveInEvent + */ + MoveInEvent.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent) + return object; + var message = new $root.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent(); + if (object.sourcePartitionToken != null) + message.sourcePartitionToken = String(object.sourcePartitionToken); + return message; + }; + + /** + * Creates a plain object from a MoveInEvent message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent + * @static + * @param {google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent} message MoveInEvent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MoveInEvent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.sourcePartitionToken = ""; + if (message.sourcePartitionToken != null && message.hasOwnProperty("sourcePartitionToken")) + object.sourcePartitionToken = message.sourcePartitionToken; + return object; + }; + + /** + * Converts this MoveInEvent to JSON. + * @function toJSON + * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent + * @instance + * @returns {Object.} JSON object + */ + MoveInEvent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MoveInEvent + * @function getTypeUrl + * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MoveInEvent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent"; + }; + + return MoveInEvent; + })(); + + PartitionEventRecord.MoveOutEvent = (function() { + + /** + * Properties of a MoveOutEvent. + * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEventRecord + * @interface IMoveOutEvent + * @property {string|null} [destinationPartitionToken] MoveOutEvent destinationPartitionToken + */ + + /** + * Constructs a new MoveOutEvent. + * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEventRecord + * @classdesc Represents a MoveOutEvent. + * @implements IMoveOutEvent + * @constructor + * @param {google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.IMoveOutEvent=} [properties] Properties to set + */ + function MoveOutEvent(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MoveOutEvent destinationPartitionToken. + * @member {string} destinationPartitionToken + * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent + * @instance + */ + MoveOutEvent.prototype.destinationPartitionToken = ""; + + /** + * Creates a new MoveOutEvent instance using the specified properties. + * @function create + * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent + * @static + * @param {google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.IMoveOutEvent=} [properties] Properties to set + * @returns {google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent} MoveOutEvent instance + */ + MoveOutEvent.create = function create(properties) { + return new MoveOutEvent(properties); + }; + + /** + * Encodes the specified MoveOutEvent message. Does not implicitly {@link google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent + * @static + * @param {google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.IMoveOutEvent} message MoveOutEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MoveOutEvent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.destinationPartitionToken != null && Object.hasOwnProperty.call(message, "destinationPartitionToken")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.destinationPartitionToken); + return writer; + }; + + /** + * Encodes the specified MoveOutEvent message, length delimited. Does not implicitly {@link google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent + * @static + * @param {google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.IMoveOutEvent} message MoveOutEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MoveOutEvent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MoveOutEvent message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent} MoveOutEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MoveOutEvent.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.destinationPartitionToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MoveOutEvent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent} MoveOutEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MoveOutEvent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MoveOutEvent message. + * @function verify + * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MoveOutEvent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.destinationPartitionToken != null && message.hasOwnProperty("destinationPartitionToken")) + if (!$util.isString(message.destinationPartitionToken)) + return "destinationPartitionToken: string expected"; + return null; + }; + + /** + * Creates a MoveOutEvent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent} MoveOutEvent + */ + MoveOutEvent.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent) + return object; + var message = new $root.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent(); + if (object.destinationPartitionToken != null) + message.destinationPartitionToken = String(object.destinationPartitionToken); + return message; + }; + + /** + * Creates a plain object from a MoveOutEvent message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent + * @static + * @param {google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent} message MoveOutEvent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MoveOutEvent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.destinationPartitionToken = ""; + if (message.destinationPartitionToken != null && message.hasOwnProperty("destinationPartitionToken")) + object.destinationPartitionToken = message.destinationPartitionToken; + return object; + }; + + /** + * Converts this MoveOutEvent to JSON. + * @function toJSON + * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent + * @instance + * @returns {Object.} JSON object + */ + MoveOutEvent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MoveOutEvent + * @function getTypeUrl + * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MoveOutEvent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent"; + }; + + return MoveOutEvent; + })(); + + return PartitionEventRecord; + })(); + + return ChangeStreamRecord; + })(); + + v1.Type = (function() { + + /** + * Properties of a Type. + * @memberof google.spanner.v1 + * @interface IType + * @property {google.spanner.v1.TypeCode|null} [code] Type code + * @property {google.spanner.v1.IType|null} [arrayElementType] Type arrayElementType + * @property {google.spanner.v1.IStructType|null} [structType] Type structType + * @property {google.spanner.v1.TypeAnnotationCode|null} [typeAnnotation] Type typeAnnotation + * @property {string|null} [protoTypeFqn] Type protoTypeFqn + */ + + /** + * Constructs a new Type. + * @memberof google.spanner.v1 + * @classdesc Represents a Type. + * @implements IType + * @constructor + * @param {google.spanner.v1.IType=} [properties] Properties to set + */ + function Type(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Type code. + * @member {google.spanner.v1.TypeCode} code + * @memberof google.spanner.v1.Type + * @instance + */ + Type.prototype.code = 0; + + /** + * Type arrayElementType. + * @member {google.spanner.v1.IType|null|undefined} arrayElementType + * @memberof google.spanner.v1.Type + * @instance + */ + Type.prototype.arrayElementType = null; + + /** + * Type structType. + * @member {google.spanner.v1.IStructType|null|undefined} structType + * @memberof google.spanner.v1.Type + * @instance + */ + Type.prototype.structType = null; + + /** + * Type typeAnnotation. + * @member {google.spanner.v1.TypeAnnotationCode} typeAnnotation + * @memberof google.spanner.v1.Type + * @instance + */ + Type.prototype.typeAnnotation = 0; + + /** + * Type protoTypeFqn. + * @member {string} protoTypeFqn + * @memberof google.spanner.v1.Type + * @instance + */ + Type.prototype.protoTypeFqn = ""; + + /** + * Creates a new Type instance using the specified properties. + * @function create + * @memberof google.spanner.v1.Type + * @static + * @param {google.spanner.v1.IType=} [properties] Properties to set + * @returns {google.spanner.v1.Type} Type instance + */ + Type.create = function create(properties) { + return new Type(properties); + }; + + /** + * Encodes the specified Type message. Does not implicitly {@link google.spanner.v1.Type.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.Type + * @static + * @param {google.spanner.v1.IType} message Type message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Type.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); + if (message.arrayElementType != null && Object.hasOwnProperty.call(message, "arrayElementType")) + $root.google.spanner.v1.Type.encode(message.arrayElementType, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.structType != null && Object.hasOwnProperty.call(message, "structType")) + $root.google.spanner.v1.StructType.encode(message.structType, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.typeAnnotation != null && Object.hasOwnProperty.call(message, "typeAnnotation")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.typeAnnotation); + if (message.protoTypeFqn != null && Object.hasOwnProperty.call(message, "protoTypeFqn")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.protoTypeFqn); + return writer; + }; + + /** + * Encodes the specified Type message, length delimited. Does not implicitly {@link google.spanner.v1.Type.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.Type + * @static + * @param {google.spanner.v1.IType} message Type message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Type.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Type message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.Type + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.Type} Type + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Type.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.Type(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.code = reader.int32(); + break; + } + case 2: { + message.arrayElementType = $root.google.spanner.v1.Type.decode(reader, reader.uint32()); + break; + } + case 3: { + message.structType = $root.google.spanner.v1.StructType.decode(reader, reader.uint32()); + break; + } + case 4: { + message.typeAnnotation = reader.int32(); + break; + } + case 5: { + message.protoTypeFqn = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Type message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.Type + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.Type} Type + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Type.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Type message. + * @function verify + * @memberof google.spanner.v1.Type + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Type.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + switch (message.code) { + default: + return "code: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 15: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 13: + case 14: + case 16: + case 17: + break; + } + if (message.arrayElementType != null && message.hasOwnProperty("arrayElementType")) { + var error = $root.google.spanner.v1.Type.verify(message.arrayElementType); + if (error) + return "arrayElementType." + error; + } + if (message.structType != null && message.hasOwnProperty("structType")) { + var error = $root.google.spanner.v1.StructType.verify(message.structType); + if (error) + return "structType." + error; + } + if (message.typeAnnotation != null && message.hasOwnProperty("typeAnnotation")) + switch (message.typeAnnotation) { + default: + return "typeAnnotation: enum value expected"; + case 0: + case 2: + case 3: + case 4: + break; + } + if (message.protoTypeFqn != null && message.hasOwnProperty("protoTypeFqn")) + if (!$util.isString(message.protoTypeFqn)) + return "protoTypeFqn: string expected"; + return null; + }; + + /** + * Creates a Type message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.Type + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.Type} Type + */ + Type.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.Type) + return object; + var message = new $root.google.spanner.v1.Type(); + switch (object.code) { + default: + if (typeof object.code === "number") { + message.code = object.code; + break; + } + break; + case "TYPE_CODE_UNSPECIFIED": + case 0: + message.code = 0; + break; + case "BOOL": + case 1: + message.code = 1; + break; + case "INT64": + case 2: + message.code = 2; + break; + case "FLOAT64": + case 3: + message.code = 3; + break; + case "FLOAT32": + case 15: + message.code = 15; + break; + case "TIMESTAMP": + case 4: + message.code = 4; + break; + case "DATE": + case 5: + message.code = 5; + break; + case "STRING": + case 6: + message.code = 6; + break; + case "BYTES": + case 7: + message.code = 7; + break; + case "ARRAY": + case 8: + message.code = 8; + break; + case "STRUCT": + case 9: + message.code = 9; + break; + case "NUMERIC": + case 10: + message.code = 10; + break; + case "JSON": + case 11: + message.code = 11; + break; + case "PROTO": + case 13: + message.code = 13; + break; + case "ENUM": + case 14: + message.code = 14; + break; + case "INTERVAL": + case 16: + message.code = 16; + break; + case "UUID": + case 17: + message.code = 17; + break; + } + if (object.arrayElementType != null) { + if (typeof object.arrayElementType !== "object") + throw TypeError(".google.spanner.v1.Type.arrayElementType: object expected"); + message.arrayElementType = $root.google.spanner.v1.Type.fromObject(object.arrayElementType); + } + if (object.structType != null) { + if (typeof object.structType !== "object") + throw TypeError(".google.spanner.v1.Type.structType: object expected"); + message.structType = $root.google.spanner.v1.StructType.fromObject(object.structType); + } + switch (object.typeAnnotation) { + default: + if (typeof object.typeAnnotation === "number") { + message.typeAnnotation = object.typeAnnotation; + break; + } + break; + case "TYPE_ANNOTATION_CODE_UNSPECIFIED": + case 0: + message.typeAnnotation = 0; + break; + case "PG_NUMERIC": + case 2: + message.typeAnnotation = 2; + break; + case "PG_JSONB": + case 3: + message.typeAnnotation = 3; + break; + case "PG_OID": + case 4: + message.typeAnnotation = 4; + break; + } + if (object.protoTypeFqn != null) + message.protoTypeFqn = String(object.protoTypeFqn); + return message; + }; + + /** + * Creates a plain object from a Type message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.Type + * @static + * @param {google.spanner.v1.Type} message Type + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Type.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.code = options.enums === String ? "TYPE_CODE_UNSPECIFIED" : 0; + object.arrayElementType = null; + object.structType = null; + object.typeAnnotation = options.enums === String ? "TYPE_ANNOTATION_CODE_UNSPECIFIED" : 0; + object.protoTypeFqn = ""; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = options.enums === String ? $root.google.spanner.v1.TypeCode[message.code] === undefined ? message.code : $root.google.spanner.v1.TypeCode[message.code] : message.code; + if (message.arrayElementType != null && message.hasOwnProperty("arrayElementType")) + object.arrayElementType = $root.google.spanner.v1.Type.toObject(message.arrayElementType, options); + if (message.structType != null && message.hasOwnProperty("structType")) + object.structType = $root.google.spanner.v1.StructType.toObject(message.structType, options); + if (message.typeAnnotation != null && message.hasOwnProperty("typeAnnotation")) + object.typeAnnotation = options.enums === String ? $root.google.spanner.v1.TypeAnnotationCode[message.typeAnnotation] === undefined ? message.typeAnnotation : $root.google.spanner.v1.TypeAnnotationCode[message.typeAnnotation] : message.typeAnnotation; + if (message.protoTypeFqn != null && message.hasOwnProperty("protoTypeFqn")) + object.protoTypeFqn = message.protoTypeFqn; + return object; + }; + + /** + * Converts this Type to JSON. + * @function toJSON + * @memberof google.spanner.v1.Type + * @instance + * @returns {Object.} JSON object + */ + Type.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Type + * @function getTypeUrl + * @memberof google.spanner.v1.Type + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Type.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.Type"; + }; + + return Type; + })(); + + v1.StructType = (function() { + + /** + * Properties of a StructType. + * @memberof google.spanner.v1 + * @interface IStructType + * @property {Array.|null} [fields] StructType fields + */ + + /** + * Constructs a new StructType. + * @memberof google.spanner.v1 + * @classdesc Represents a StructType. + * @implements IStructType + * @constructor + * @param {google.spanner.v1.IStructType=} [properties] Properties to set + */ + function StructType(properties) { + this.fields = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StructType fields. + * @member {Array.} fields + * @memberof google.spanner.v1.StructType + * @instance + */ + StructType.prototype.fields = $util.emptyArray; + + /** + * Creates a new StructType instance using the specified properties. + * @function create + * @memberof google.spanner.v1.StructType + * @static + * @param {google.spanner.v1.IStructType=} [properties] Properties to set + * @returns {google.spanner.v1.StructType} StructType instance + */ + StructType.create = function create(properties) { + return new StructType(properties); + }; + + /** + * Encodes the specified StructType message. Does not implicitly {@link google.spanner.v1.StructType.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.StructType + * @static + * @param {google.spanner.v1.IStructType} message StructType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StructType.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fields != null && message.fields.length) + for (var i = 0; i < message.fields.length; ++i) + $root.google.spanner.v1.StructType.Field.encode(message.fields[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified StructType message, length delimited. Does not implicitly {@link google.spanner.v1.StructType.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.StructType + * @static + * @param {google.spanner.v1.IStructType} message StructType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StructType.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StructType message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.StructType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.StructType} StructType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StructType.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.StructType(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.fields && message.fields.length)) + message.fields = []; + message.fields.push($root.google.spanner.v1.StructType.Field.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StructType message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.StructType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.StructType} StructType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StructType.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StructType message. + * @function verify + * @memberof google.spanner.v1.StructType + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StructType.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fields != null && message.hasOwnProperty("fields")) { + if (!Array.isArray(message.fields)) + return "fields: array expected"; + for (var i = 0; i < message.fields.length; ++i) { + var error = $root.google.spanner.v1.StructType.Field.verify(message.fields[i]); + if (error) + return "fields." + error; + } + } + return null; + }; + + /** + * Creates a StructType message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.StructType + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.StructType} StructType + */ + StructType.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.StructType) + return object; + var message = new $root.google.spanner.v1.StructType(); + if (object.fields) { + if (!Array.isArray(object.fields)) + throw TypeError(".google.spanner.v1.StructType.fields: array expected"); + message.fields = []; + for (var i = 0; i < object.fields.length; ++i) { + if (typeof object.fields[i] !== "object") + throw TypeError(".google.spanner.v1.StructType.fields: object expected"); + message.fields[i] = $root.google.spanner.v1.StructType.Field.fromObject(object.fields[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a StructType message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.StructType + * @static + * @param {google.spanner.v1.StructType} message StructType + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StructType.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.fields = []; + if (message.fields && message.fields.length) { + object.fields = []; + for (var j = 0; j < message.fields.length; ++j) + object.fields[j] = $root.google.spanner.v1.StructType.Field.toObject(message.fields[j], options); + } + return object; + }; + + /** + * Converts this StructType to JSON. + * @function toJSON + * @memberof google.spanner.v1.StructType + * @instance + * @returns {Object.} JSON object + */ + StructType.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StructType + * @function getTypeUrl + * @memberof google.spanner.v1.StructType + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StructType.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.StructType"; + }; + + StructType.Field = (function() { + + /** + * Properties of a Field. + * @memberof google.spanner.v1.StructType + * @interface IField + * @property {string|null} [name] Field name + * @property {google.spanner.v1.IType|null} [type] Field type + */ + + /** + * Constructs a new Field. + * @memberof google.spanner.v1.StructType + * @classdesc Represents a Field. + * @implements IField + * @constructor + * @param {google.spanner.v1.StructType.IField=} [properties] Properties to set + */ + function Field(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Field name. + * @member {string} name + * @memberof google.spanner.v1.StructType.Field + * @instance + */ + Field.prototype.name = ""; + + /** + * Field type. + * @member {google.spanner.v1.IType|null|undefined} type + * @memberof google.spanner.v1.StructType.Field + * @instance + */ + Field.prototype.type = null; + + /** + * Creates a new Field instance using the specified properties. + * @function create + * @memberof google.spanner.v1.StructType.Field + * @static + * @param {google.spanner.v1.StructType.IField=} [properties] Properties to set + * @returns {google.spanner.v1.StructType.Field} Field instance + */ + Field.create = function create(properties) { + return new Field(properties); + }; + + /** + * Encodes the specified Field message. Does not implicitly {@link google.spanner.v1.StructType.Field.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.StructType.Field + * @static + * @param {google.spanner.v1.StructType.IField} message Field message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Field.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + $root.google.spanner.v1.Type.encode(message.type, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Field message, length delimited. Does not implicitly {@link google.spanner.v1.StructType.Field.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.StructType.Field + * @static + * @param {google.spanner.v1.StructType.IField} message Field message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Field.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Field message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.StructType.Field + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.StructType.Field} Field + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Field.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.StructType.Field(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.type = $root.google.spanner.v1.Type.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Field message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.StructType.Field + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.StructType.Field} Field + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Field.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Field message. + * @function verify + * @memberof google.spanner.v1.StructType.Field + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Field.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.type != null && message.hasOwnProperty("type")) { + var error = $root.google.spanner.v1.Type.verify(message.type); + if (error) + return "type." + error; + } + return null; + }; + + /** + * Creates a Field message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.StructType.Field + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.StructType.Field} Field + */ + Field.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.StructType.Field) + return object; + var message = new $root.google.spanner.v1.StructType.Field(); + if (object.name != null) + message.name = String(object.name); + if (object.type != null) { + if (typeof object.type !== "object") + throw TypeError(".google.spanner.v1.StructType.Field.type: object expected"); + message.type = $root.google.spanner.v1.Type.fromObject(object.type); + } + return message; + }; + + /** + * Creates a plain object from a Field message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.StructType.Field + * @static + * @param {google.spanner.v1.StructType.Field} message Field + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Field.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.type = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.type != null && message.hasOwnProperty("type")) + object.type = $root.google.spanner.v1.Type.toObject(message.type, options); + return object; + }; + + /** + * Converts this Field to JSON. + * @function toJSON + * @memberof google.spanner.v1.StructType.Field + * @instance + * @returns {Object.} JSON object + */ + Field.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Field + * @function getTypeUrl + * @memberof google.spanner.v1.StructType.Field + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Field.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.StructType.Field"; + }; + + return Field; + })(); + + return StructType; + })(); + + /** + * TypeCode enum. + * @name google.spanner.v1.TypeCode + * @enum {number} + * @property {number} TYPE_CODE_UNSPECIFIED=0 TYPE_CODE_UNSPECIFIED value + * @property {number} BOOL=1 BOOL value + * @property {number} INT64=2 INT64 value + * @property {number} FLOAT64=3 FLOAT64 value + * @property {number} FLOAT32=15 FLOAT32 value + * @property {number} TIMESTAMP=4 TIMESTAMP value + * @property {number} DATE=5 DATE value + * @property {number} STRING=6 STRING value + * @property {number} BYTES=7 BYTES value + * @property {number} ARRAY=8 ARRAY value + * @property {number} STRUCT=9 STRUCT value + * @property {number} NUMERIC=10 NUMERIC value + * @property {number} JSON=11 JSON value + * @property {number} PROTO=13 PROTO value + * @property {number} ENUM=14 ENUM value + * @property {number} INTERVAL=16 INTERVAL value + * @property {number} UUID=17 UUID value + */ + v1.TypeCode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_CODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "BOOL"] = 1; + values[valuesById[2] = "INT64"] = 2; + values[valuesById[3] = "FLOAT64"] = 3; + values[valuesById[15] = "FLOAT32"] = 15; + values[valuesById[4] = "TIMESTAMP"] = 4; + values[valuesById[5] = "DATE"] = 5; + values[valuesById[6] = "STRING"] = 6; + values[valuesById[7] = "BYTES"] = 7; + values[valuesById[8] = "ARRAY"] = 8; + values[valuesById[9] = "STRUCT"] = 9; + values[valuesById[10] = "NUMERIC"] = 10; + values[valuesById[11] = "JSON"] = 11; + values[valuesById[13] = "PROTO"] = 13; + values[valuesById[14] = "ENUM"] = 14; + values[valuesById[16] = "INTERVAL"] = 16; + values[valuesById[17] = "UUID"] = 17; + return values; + })(); + + /** + * TypeAnnotationCode enum. + * @name google.spanner.v1.TypeAnnotationCode + * @enum {number} + * @property {number} TYPE_ANNOTATION_CODE_UNSPECIFIED=0 TYPE_ANNOTATION_CODE_UNSPECIFIED value + * @property {number} PG_NUMERIC=2 PG_NUMERIC value + * @property {number} PG_JSONB=3 PG_JSONB value + * @property {number} PG_OID=4 PG_OID value + */ + v1.TypeAnnotationCode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_ANNOTATION_CODE_UNSPECIFIED"] = 0; + values[valuesById[2] = "PG_NUMERIC"] = 2; + values[valuesById[3] = "PG_JSONB"] = 3; + values[valuesById[4] = "PG_OID"] = 4; + return values; + })(); + + v1.CommitResponse = (function() { + + /** + * Properties of a CommitResponse. + * @memberof google.spanner.v1 + * @interface ICommitResponse + * @property {google.protobuf.ITimestamp|null} [commitTimestamp] CommitResponse commitTimestamp + * @property {google.spanner.v1.CommitResponse.ICommitStats|null} [commitStats] CommitResponse commitStats + * @property {google.spanner.v1.IMultiplexedSessionPrecommitToken|null} [precommitToken] CommitResponse precommitToken + * @property {google.protobuf.ITimestamp|null} [snapshotTimestamp] CommitResponse snapshotTimestamp + */ + + /** + * Constructs a new CommitResponse. + * @memberof google.spanner.v1 + * @classdesc Represents a CommitResponse. + * @implements ICommitResponse + * @constructor + * @param {google.spanner.v1.ICommitResponse=} [properties] Properties to set + */ + function CommitResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CommitResponse commitTimestamp. + * @member {google.protobuf.ITimestamp|null|undefined} commitTimestamp + * @memberof google.spanner.v1.CommitResponse + * @instance + */ + CommitResponse.prototype.commitTimestamp = null; + + /** + * CommitResponse commitStats. + * @member {google.spanner.v1.CommitResponse.ICommitStats|null|undefined} commitStats + * @memberof google.spanner.v1.CommitResponse + * @instance + */ + CommitResponse.prototype.commitStats = null; + + /** + * CommitResponse precommitToken. + * @member {google.spanner.v1.IMultiplexedSessionPrecommitToken|null|undefined} precommitToken + * @memberof google.spanner.v1.CommitResponse + * @instance + */ + CommitResponse.prototype.precommitToken = null; + + /** + * CommitResponse snapshotTimestamp. + * @member {google.protobuf.ITimestamp|null|undefined} snapshotTimestamp + * @memberof google.spanner.v1.CommitResponse + * @instance + */ + CommitResponse.prototype.snapshotTimestamp = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * CommitResponse MultiplexedSessionRetry. + * @member {"precommitToken"|undefined} MultiplexedSessionRetry + * @memberof google.spanner.v1.CommitResponse + * @instance + */ + Object.defineProperty(CommitResponse.prototype, "MultiplexedSessionRetry", { + get: $util.oneOfGetter($oneOfFields = ["precommitToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CommitResponse instance using the specified properties. + * @function create + * @memberof google.spanner.v1.CommitResponse + * @static + * @param {google.spanner.v1.ICommitResponse=} [properties] Properties to set + * @returns {google.spanner.v1.CommitResponse} CommitResponse instance + */ + CommitResponse.create = function create(properties) { + return new CommitResponse(properties); + }; + + /** + * Encodes the specified CommitResponse message. Does not implicitly {@link google.spanner.v1.CommitResponse.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.CommitResponse + * @static + * @param {google.spanner.v1.ICommitResponse} message CommitResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommitResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.commitTimestamp != null && Object.hasOwnProperty.call(message, "commitTimestamp")) + $root.google.protobuf.Timestamp.encode(message.commitTimestamp, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.commitStats != null && Object.hasOwnProperty.call(message, "commitStats")) + $root.google.spanner.v1.CommitResponse.CommitStats.encode(message.commitStats, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.precommitToken != null && Object.hasOwnProperty.call(message, "precommitToken")) + $root.google.spanner.v1.MultiplexedSessionPrecommitToken.encode(message.precommitToken, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.snapshotTimestamp != null && Object.hasOwnProperty.call(message, "snapshotTimestamp")) + $root.google.protobuf.Timestamp.encode(message.snapshotTimestamp, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CommitResponse message, length delimited. Does not implicitly {@link google.spanner.v1.CommitResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.CommitResponse + * @static + * @param {google.spanner.v1.ICommitResponse} message CommitResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommitResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CommitResponse message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.CommitResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.CommitResponse} CommitResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommitResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.CommitResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.commitTimestamp = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.commitStats = $root.google.spanner.v1.CommitResponse.CommitStats.decode(reader, reader.uint32()); + break; + } + case 4: { + message.precommitToken = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.decode(reader, reader.uint32()); + break; + } + case 5: { + message.snapshotTimestamp = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CommitResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.CommitResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.CommitResponse} CommitResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommitResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CommitResponse message. + * @function verify + * @memberof google.spanner.v1.CommitResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CommitResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.commitTimestamp != null && message.hasOwnProperty("commitTimestamp")) { + var error = $root.google.protobuf.Timestamp.verify(message.commitTimestamp); + if (error) + return "commitTimestamp." + error; + } + if (message.commitStats != null && message.hasOwnProperty("commitStats")) { + var error = $root.google.spanner.v1.CommitResponse.CommitStats.verify(message.commitStats); + if (error) + return "commitStats." + error; + } + if (message.precommitToken != null && message.hasOwnProperty("precommitToken")) { + properties.MultiplexedSessionRetry = 1; + { + var error = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.verify(message.precommitToken); + if (error) + return "precommitToken." + error; + } + } + if (message.snapshotTimestamp != null && message.hasOwnProperty("snapshotTimestamp")) { + var error = $root.google.protobuf.Timestamp.verify(message.snapshotTimestamp); + if (error) + return "snapshotTimestamp." + error; + } + return null; + }; + + /** + * Creates a CommitResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.CommitResponse + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.CommitResponse} CommitResponse + */ + CommitResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.CommitResponse) + return object; + var message = new $root.google.spanner.v1.CommitResponse(); + if (object.commitTimestamp != null) { + if (typeof object.commitTimestamp !== "object") + throw TypeError(".google.spanner.v1.CommitResponse.commitTimestamp: object expected"); + message.commitTimestamp = $root.google.protobuf.Timestamp.fromObject(object.commitTimestamp); + } + if (object.commitStats != null) { + if (typeof object.commitStats !== "object") + throw TypeError(".google.spanner.v1.CommitResponse.commitStats: object expected"); + message.commitStats = $root.google.spanner.v1.CommitResponse.CommitStats.fromObject(object.commitStats); + } + if (object.precommitToken != null) { + if (typeof object.precommitToken !== "object") + throw TypeError(".google.spanner.v1.CommitResponse.precommitToken: object expected"); + message.precommitToken = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.fromObject(object.precommitToken); + } + if (object.snapshotTimestamp != null) { + if (typeof object.snapshotTimestamp !== "object") + throw TypeError(".google.spanner.v1.CommitResponse.snapshotTimestamp: object expected"); + message.snapshotTimestamp = $root.google.protobuf.Timestamp.fromObject(object.snapshotTimestamp); + } + return message; + }; + + /** + * Creates a plain object from a CommitResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.CommitResponse + * @static + * @param {google.spanner.v1.CommitResponse} message CommitResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CommitResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.commitTimestamp = null; + object.commitStats = null; + object.snapshotTimestamp = null; + } + if (message.commitTimestamp != null && message.hasOwnProperty("commitTimestamp")) + object.commitTimestamp = $root.google.protobuf.Timestamp.toObject(message.commitTimestamp, options); + if (message.commitStats != null && message.hasOwnProperty("commitStats")) + object.commitStats = $root.google.spanner.v1.CommitResponse.CommitStats.toObject(message.commitStats, options); + if (message.precommitToken != null && message.hasOwnProperty("precommitToken")) { + object.precommitToken = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.toObject(message.precommitToken, options); + if (options.oneofs) + object.MultiplexedSessionRetry = "precommitToken"; + } + if (message.snapshotTimestamp != null && message.hasOwnProperty("snapshotTimestamp")) + object.snapshotTimestamp = $root.google.protobuf.Timestamp.toObject(message.snapshotTimestamp, options); + return object; + }; + + /** + * Converts this CommitResponse to JSON. + * @function toJSON + * @memberof google.spanner.v1.CommitResponse + * @instance + * @returns {Object.} JSON object + */ + CommitResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CommitResponse + * @function getTypeUrl + * @memberof google.spanner.v1.CommitResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CommitResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.CommitResponse"; + }; + + CommitResponse.CommitStats = (function() { + + /** + * Properties of a CommitStats. + * @memberof google.spanner.v1.CommitResponse + * @interface ICommitStats + * @property {number|Long|null} [mutationCount] CommitStats mutationCount + */ + + /** + * Constructs a new CommitStats. + * @memberof google.spanner.v1.CommitResponse + * @classdesc Represents a CommitStats. + * @implements ICommitStats + * @constructor + * @param {google.spanner.v1.CommitResponse.ICommitStats=} [properties] Properties to set + */ + function CommitStats(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CommitStats mutationCount. + * @member {number|Long} mutationCount + * @memberof google.spanner.v1.CommitResponse.CommitStats + * @instance + */ + CommitStats.prototype.mutationCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new CommitStats instance using the specified properties. + * @function create + * @memberof google.spanner.v1.CommitResponse.CommitStats + * @static + * @param {google.spanner.v1.CommitResponse.ICommitStats=} [properties] Properties to set + * @returns {google.spanner.v1.CommitResponse.CommitStats} CommitStats instance + */ + CommitStats.create = function create(properties) { + return new CommitStats(properties); + }; + + /** + * Encodes the specified CommitStats message. Does not implicitly {@link google.spanner.v1.CommitResponse.CommitStats.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.CommitResponse.CommitStats + * @static + * @param {google.spanner.v1.CommitResponse.ICommitStats} message CommitStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommitStats.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mutationCount != null && Object.hasOwnProperty.call(message, "mutationCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.mutationCount); + return writer; + }; + + /** + * Encodes the specified CommitStats message, length delimited. Does not implicitly {@link google.spanner.v1.CommitResponse.CommitStats.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.CommitResponse.CommitStats + * @static + * @param {google.spanner.v1.CommitResponse.ICommitStats} message CommitStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommitStats.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CommitStats message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.CommitResponse.CommitStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.CommitResponse.CommitStats} CommitStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommitStats.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.CommitResponse.CommitStats(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.mutationCount = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CommitStats message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.CommitResponse.CommitStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.CommitResponse.CommitStats} CommitStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommitStats.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CommitStats message. + * @function verify + * @memberof google.spanner.v1.CommitResponse.CommitStats + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CommitStats.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.mutationCount != null && message.hasOwnProperty("mutationCount")) + if (!$util.isInteger(message.mutationCount) && !(message.mutationCount && $util.isInteger(message.mutationCount.low) && $util.isInteger(message.mutationCount.high))) + return "mutationCount: integer|Long expected"; + return null; + }; + + /** + * Creates a CommitStats message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.CommitResponse.CommitStats + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.CommitResponse.CommitStats} CommitStats + */ + CommitStats.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.CommitResponse.CommitStats) + return object; + var message = new $root.google.spanner.v1.CommitResponse.CommitStats(); + if (object.mutationCount != null) + if ($util.Long) + (message.mutationCount = $util.Long.fromValue(object.mutationCount)).unsigned = false; + else if (typeof object.mutationCount === "string") + message.mutationCount = parseInt(object.mutationCount, 10); + else if (typeof object.mutationCount === "number") + message.mutationCount = object.mutationCount; + else if (typeof object.mutationCount === "object") + message.mutationCount = new $util.LongBits(object.mutationCount.low >>> 0, object.mutationCount.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a CommitStats message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.CommitResponse.CommitStats + * @static + * @param {google.spanner.v1.CommitResponse.CommitStats} message CommitStats + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CommitStats.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.mutationCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.mutationCount = options.longs === String ? "0" : 0; + if (message.mutationCount != null && message.hasOwnProperty("mutationCount")) + if (typeof message.mutationCount === "number") + object.mutationCount = options.longs === String ? String(message.mutationCount) : message.mutationCount; + else + object.mutationCount = options.longs === String ? $util.Long.prototype.toString.call(message.mutationCount) : options.longs === Number ? new $util.LongBits(message.mutationCount.low >>> 0, message.mutationCount.high >>> 0).toNumber() : message.mutationCount; + return object; + }; + + /** + * Converts this CommitStats to JSON. + * @function toJSON + * @memberof google.spanner.v1.CommitResponse.CommitStats + * @instance + * @returns {Object.} JSON object + */ + CommitStats.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CommitStats + * @function getTypeUrl + * @memberof google.spanner.v1.CommitResponse.CommitStats + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CommitStats.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.CommitResponse.CommitStats"; + }; + + return CommitStats; + })(); + + return CommitResponse; + })(); + + v1.TransactionOptions = (function() { + + /** + * Properties of a TransactionOptions. + * @memberof google.spanner.v1 + * @interface ITransactionOptions + * @property {google.spanner.v1.TransactionOptions.IReadWrite|null} [readWrite] TransactionOptions readWrite + * @property {google.spanner.v1.TransactionOptions.IPartitionedDml|null} [partitionedDml] TransactionOptions partitionedDml + * @property {google.spanner.v1.TransactionOptions.IReadOnly|null} [readOnly] TransactionOptions readOnly + * @property {boolean|null} [excludeTxnFromChangeStreams] TransactionOptions excludeTxnFromChangeStreams + * @property {google.spanner.v1.TransactionOptions.IsolationLevel|null} [isolationLevel] TransactionOptions isolationLevel + */ + + /** + * Constructs a new TransactionOptions. + * @memberof google.spanner.v1 + * @classdesc Represents a TransactionOptions. + * @implements ITransactionOptions + * @constructor + * @param {google.spanner.v1.ITransactionOptions=} [properties] Properties to set + */ + function TransactionOptions(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TransactionOptions readWrite. + * @member {google.spanner.v1.TransactionOptions.IReadWrite|null|undefined} readWrite + * @memberof google.spanner.v1.TransactionOptions + * @instance + */ + TransactionOptions.prototype.readWrite = null; + + /** + * TransactionOptions partitionedDml. + * @member {google.spanner.v1.TransactionOptions.IPartitionedDml|null|undefined} partitionedDml + * @memberof google.spanner.v1.TransactionOptions + * @instance + */ + TransactionOptions.prototype.partitionedDml = null; + + /** + * TransactionOptions readOnly. + * @member {google.spanner.v1.TransactionOptions.IReadOnly|null|undefined} readOnly + * @memberof google.spanner.v1.TransactionOptions + * @instance + */ + TransactionOptions.prototype.readOnly = null; + + /** + * TransactionOptions excludeTxnFromChangeStreams. + * @member {boolean} excludeTxnFromChangeStreams + * @memberof google.spanner.v1.TransactionOptions + * @instance + */ + TransactionOptions.prototype.excludeTxnFromChangeStreams = false; + + /** + * TransactionOptions isolationLevel. + * @member {google.spanner.v1.TransactionOptions.IsolationLevel} isolationLevel + * @memberof google.spanner.v1.TransactionOptions + * @instance + */ + TransactionOptions.prototype.isolationLevel = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TransactionOptions mode. + * @member {"readWrite"|"partitionedDml"|"readOnly"|undefined} mode + * @memberof google.spanner.v1.TransactionOptions + * @instance + */ + Object.defineProperty(TransactionOptions.prototype, "mode", { + get: $util.oneOfGetter($oneOfFields = ["readWrite", "partitionedDml", "readOnly"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TransactionOptions instance using the specified properties. + * @function create + * @memberof google.spanner.v1.TransactionOptions + * @static + * @param {google.spanner.v1.ITransactionOptions=} [properties] Properties to set + * @returns {google.spanner.v1.TransactionOptions} TransactionOptions instance + */ + TransactionOptions.create = function create(properties) { + return new TransactionOptions(properties); + }; + + /** + * Encodes the specified TransactionOptions message. Does not implicitly {@link google.spanner.v1.TransactionOptions.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.TransactionOptions + * @static + * @param {google.spanner.v1.ITransactionOptions} message TransactionOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.readWrite != null && Object.hasOwnProperty.call(message, "readWrite")) + $root.google.spanner.v1.TransactionOptions.ReadWrite.encode(message.readWrite, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.readOnly != null && Object.hasOwnProperty.call(message, "readOnly")) + $root.google.spanner.v1.TransactionOptions.ReadOnly.encode(message.readOnly, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.partitionedDml != null && Object.hasOwnProperty.call(message, "partitionedDml")) + $root.google.spanner.v1.TransactionOptions.PartitionedDml.encode(message.partitionedDml, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.excludeTxnFromChangeStreams != null && Object.hasOwnProperty.call(message, "excludeTxnFromChangeStreams")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.excludeTxnFromChangeStreams); + if (message.isolationLevel != null && Object.hasOwnProperty.call(message, "isolationLevel")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.isolationLevel); + return writer; + }; + + /** + * Encodes the specified TransactionOptions message, length delimited. Does not implicitly {@link google.spanner.v1.TransactionOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.TransactionOptions + * @static + * @param {google.spanner.v1.ITransactionOptions} message TransactionOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TransactionOptions message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.TransactionOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.TransactionOptions} TransactionOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.TransactionOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.readWrite = $root.google.spanner.v1.TransactionOptions.ReadWrite.decode(reader, reader.uint32()); + break; + } + case 3: { + message.partitionedDml = $root.google.spanner.v1.TransactionOptions.PartitionedDml.decode(reader, reader.uint32()); + break; + } + case 2: { + message.readOnly = $root.google.spanner.v1.TransactionOptions.ReadOnly.decode(reader, reader.uint32()); + break; + } + case 5: { + message.excludeTxnFromChangeStreams = reader.bool(); + break; + } + case 6: { + message.isolationLevel = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TransactionOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.TransactionOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.TransactionOptions} TransactionOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TransactionOptions message. + * @function verify + * @memberof google.spanner.v1.TransactionOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TransactionOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.readWrite != null && message.hasOwnProperty("readWrite")) { + properties.mode = 1; + { + var error = $root.google.spanner.v1.TransactionOptions.ReadWrite.verify(message.readWrite); + if (error) + return "readWrite." + error; + } + } + if (message.partitionedDml != null && message.hasOwnProperty("partitionedDml")) { + if (properties.mode === 1) + return "mode: multiple values"; + properties.mode = 1; + { + var error = $root.google.spanner.v1.TransactionOptions.PartitionedDml.verify(message.partitionedDml); + if (error) + return "partitionedDml." + error; + } + } + if (message.readOnly != null && message.hasOwnProperty("readOnly")) { + if (properties.mode === 1) + return "mode: multiple values"; + properties.mode = 1; + { + var error = $root.google.spanner.v1.TransactionOptions.ReadOnly.verify(message.readOnly); + if (error) + return "readOnly." + error; + } + } + if (message.excludeTxnFromChangeStreams != null && message.hasOwnProperty("excludeTxnFromChangeStreams")) + if (typeof message.excludeTxnFromChangeStreams !== "boolean") + return "excludeTxnFromChangeStreams: boolean expected"; + if (message.isolationLevel != null && message.hasOwnProperty("isolationLevel")) + switch (message.isolationLevel) { + default: + return "isolationLevel: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a TransactionOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.TransactionOptions + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.TransactionOptions} TransactionOptions + */ + TransactionOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.TransactionOptions) + return object; + var message = new $root.google.spanner.v1.TransactionOptions(); + if (object.readWrite != null) { + if (typeof object.readWrite !== "object") + throw TypeError(".google.spanner.v1.TransactionOptions.readWrite: object expected"); + message.readWrite = $root.google.spanner.v1.TransactionOptions.ReadWrite.fromObject(object.readWrite); + } + if (object.partitionedDml != null) { + if (typeof object.partitionedDml !== "object") + throw TypeError(".google.spanner.v1.TransactionOptions.partitionedDml: object expected"); + message.partitionedDml = $root.google.spanner.v1.TransactionOptions.PartitionedDml.fromObject(object.partitionedDml); + } + if (object.readOnly != null) { + if (typeof object.readOnly !== "object") + throw TypeError(".google.spanner.v1.TransactionOptions.readOnly: object expected"); + message.readOnly = $root.google.spanner.v1.TransactionOptions.ReadOnly.fromObject(object.readOnly); + } + if (object.excludeTxnFromChangeStreams != null) + message.excludeTxnFromChangeStreams = Boolean(object.excludeTxnFromChangeStreams); + switch (object.isolationLevel) { + default: + if (typeof object.isolationLevel === "number") { + message.isolationLevel = object.isolationLevel; + break; + } + break; + case "ISOLATION_LEVEL_UNSPECIFIED": + case 0: + message.isolationLevel = 0; + break; + case "SERIALIZABLE": + case 1: + message.isolationLevel = 1; + break; + case "REPEATABLE_READ": + case 2: + message.isolationLevel = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a TransactionOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.TransactionOptions + * @static + * @param {google.spanner.v1.TransactionOptions} message TransactionOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TransactionOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.excludeTxnFromChangeStreams = false; + object.isolationLevel = options.enums === String ? "ISOLATION_LEVEL_UNSPECIFIED" : 0; + } + if (message.readWrite != null && message.hasOwnProperty("readWrite")) { + object.readWrite = $root.google.spanner.v1.TransactionOptions.ReadWrite.toObject(message.readWrite, options); + if (options.oneofs) + object.mode = "readWrite"; + } + if (message.readOnly != null && message.hasOwnProperty("readOnly")) { + object.readOnly = $root.google.spanner.v1.TransactionOptions.ReadOnly.toObject(message.readOnly, options); + if (options.oneofs) + object.mode = "readOnly"; + } + if (message.partitionedDml != null && message.hasOwnProperty("partitionedDml")) { + object.partitionedDml = $root.google.spanner.v1.TransactionOptions.PartitionedDml.toObject(message.partitionedDml, options); + if (options.oneofs) + object.mode = "partitionedDml"; + } + if (message.excludeTxnFromChangeStreams != null && message.hasOwnProperty("excludeTxnFromChangeStreams")) + object.excludeTxnFromChangeStreams = message.excludeTxnFromChangeStreams; + if (message.isolationLevel != null && message.hasOwnProperty("isolationLevel")) + object.isolationLevel = options.enums === String ? $root.google.spanner.v1.TransactionOptions.IsolationLevel[message.isolationLevel] === undefined ? message.isolationLevel : $root.google.spanner.v1.TransactionOptions.IsolationLevel[message.isolationLevel] : message.isolationLevel; + return object; + }; + + /** + * Converts this TransactionOptions to JSON. + * @function toJSON + * @memberof google.spanner.v1.TransactionOptions + * @instance + * @returns {Object.} JSON object + */ + TransactionOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TransactionOptions + * @function getTypeUrl + * @memberof google.spanner.v1.TransactionOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.TransactionOptions"; + }; + + TransactionOptions.ReadWrite = (function() { + + /** + * Properties of a ReadWrite. + * @memberof google.spanner.v1.TransactionOptions + * @interface IReadWrite + * @property {google.spanner.v1.TransactionOptions.ReadWrite.ReadLockMode|null} [readLockMode] ReadWrite readLockMode + * @property {Uint8Array|null} [multiplexedSessionPreviousTransactionId] ReadWrite multiplexedSessionPreviousTransactionId + */ + + /** + * Constructs a new ReadWrite. + * @memberof google.spanner.v1.TransactionOptions + * @classdesc Represents a ReadWrite. + * @implements IReadWrite + * @constructor + * @param {google.spanner.v1.TransactionOptions.IReadWrite=} [properties] Properties to set + */ + function ReadWrite(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReadWrite readLockMode. + * @member {google.spanner.v1.TransactionOptions.ReadWrite.ReadLockMode} readLockMode + * @memberof google.spanner.v1.TransactionOptions.ReadWrite + * @instance + */ + ReadWrite.prototype.readLockMode = 0; + + /** + * ReadWrite multiplexedSessionPreviousTransactionId. + * @member {Uint8Array} multiplexedSessionPreviousTransactionId + * @memberof google.spanner.v1.TransactionOptions.ReadWrite + * @instance + */ + ReadWrite.prototype.multiplexedSessionPreviousTransactionId = $util.newBuffer([]); + + /** + * Creates a new ReadWrite instance using the specified properties. + * @function create + * @memberof google.spanner.v1.TransactionOptions.ReadWrite + * @static + * @param {google.spanner.v1.TransactionOptions.IReadWrite=} [properties] Properties to set + * @returns {google.spanner.v1.TransactionOptions.ReadWrite} ReadWrite instance + */ + ReadWrite.create = function create(properties) { + return new ReadWrite(properties); + }; + + /** + * Encodes the specified ReadWrite message. Does not implicitly {@link google.spanner.v1.TransactionOptions.ReadWrite.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.TransactionOptions.ReadWrite + * @static + * @param {google.spanner.v1.TransactionOptions.IReadWrite} message ReadWrite message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadWrite.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.readLockMode != null && Object.hasOwnProperty.call(message, "readLockMode")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.readLockMode); + if (message.multiplexedSessionPreviousTransactionId != null && Object.hasOwnProperty.call(message, "multiplexedSessionPreviousTransactionId")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.multiplexedSessionPreviousTransactionId); + return writer; + }; + + /** + * Encodes the specified ReadWrite message, length delimited. Does not implicitly {@link google.spanner.v1.TransactionOptions.ReadWrite.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.TransactionOptions.ReadWrite + * @static + * @param {google.spanner.v1.TransactionOptions.IReadWrite} message ReadWrite message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadWrite.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReadWrite message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.TransactionOptions.ReadWrite + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.TransactionOptions.ReadWrite} ReadWrite + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadWrite.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.TransactionOptions.ReadWrite(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.readLockMode = reader.int32(); + break; + } + case 2: { + message.multiplexedSessionPreviousTransactionId = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReadWrite message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.TransactionOptions.ReadWrite + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.TransactionOptions.ReadWrite} ReadWrite + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadWrite.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReadWrite message. + * @function verify + * @memberof google.spanner.v1.TransactionOptions.ReadWrite + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReadWrite.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.readLockMode != null && message.hasOwnProperty("readLockMode")) + switch (message.readLockMode) { + default: + return "readLockMode: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.multiplexedSessionPreviousTransactionId != null && message.hasOwnProperty("multiplexedSessionPreviousTransactionId")) + if (!(message.multiplexedSessionPreviousTransactionId && typeof message.multiplexedSessionPreviousTransactionId.length === "number" || $util.isString(message.multiplexedSessionPreviousTransactionId))) + return "multiplexedSessionPreviousTransactionId: buffer expected"; + return null; + }; + + /** + * Creates a ReadWrite message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.TransactionOptions.ReadWrite + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.TransactionOptions.ReadWrite} ReadWrite + */ + ReadWrite.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.TransactionOptions.ReadWrite) + return object; + var message = new $root.google.spanner.v1.TransactionOptions.ReadWrite(); + switch (object.readLockMode) { + default: + if (typeof object.readLockMode === "number") { + message.readLockMode = object.readLockMode; + break; + } + break; + case "READ_LOCK_MODE_UNSPECIFIED": + case 0: + message.readLockMode = 0; + break; + case "PESSIMISTIC": + case 1: + message.readLockMode = 1; + break; + case "OPTIMISTIC": + case 2: + message.readLockMode = 2; + break; + } + if (object.multiplexedSessionPreviousTransactionId != null) + if (typeof object.multiplexedSessionPreviousTransactionId === "string") + $util.base64.decode(object.multiplexedSessionPreviousTransactionId, message.multiplexedSessionPreviousTransactionId = $util.newBuffer($util.base64.length(object.multiplexedSessionPreviousTransactionId)), 0); + else if (object.multiplexedSessionPreviousTransactionId.length >= 0) + message.multiplexedSessionPreviousTransactionId = object.multiplexedSessionPreviousTransactionId; + return message; + }; + + /** + * Creates a plain object from a ReadWrite message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.TransactionOptions.ReadWrite + * @static + * @param {google.spanner.v1.TransactionOptions.ReadWrite} message ReadWrite + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReadWrite.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.readLockMode = options.enums === String ? "READ_LOCK_MODE_UNSPECIFIED" : 0; + if (options.bytes === String) + object.multiplexedSessionPreviousTransactionId = ""; + else { + object.multiplexedSessionPreviousTransactionId = []; + if (options.bytes !== Array) + object.multiplexedSessionPreviousTransactionId = $util.newBuffer(object.multiplexedSessionPreviousTransactionId); + } + } + if (message.readLockMode != null && message.hasOwnProperty("readLockMode")) + object.readLockMode = options.enums === String ? $root.google.spanner.v1.TransactionOptions.ReadWrite.ReadLockMode[message.readLockMode] === undefined ? message.readLockMode : $root.google.spanner.v1.TransactionOptions.ReadWrite.ReadLockMode[message.readLockMode] : message.readLockMode; + if (message.multiplexedSessionPreviousTransactionId != null && message.hasOwnProperty("multiplexedSessionPreviousTransactionId")) + object.multiplexedSessionPreviousTransactionId = options.bytes === String ? $util.base64.encode(message.multiplexedSessionPreviousTransactionId, 0, message.multiplexedSessionPreviousTransactionId.length) : options.bytes === Array ? Array.prototype.slice.call(message.multiplexedSessionPreviousTransactionId) : message.multiplexedSessionPreviousTransactionId; + return object; + }; + + /** + * Converts this ReadWrite to JSON. + * @function toJSON + * @memberof google.spanner.v1.TransactionOptions.ReadWrite + * @instance + * @returns {Object.} JSON object + */ + ReadWrite.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReadWrite + * @function getTypeUrl + * @memberof google.spanner.v1.TransactionOptions.ReadWrite + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReadWrite.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.TransactionOptions.ReadWrite"; + }; + + /** + * ReadLockMode enum. + * @name google.spanner.v1.TransactionOptions.ReadWrite.ReadLockMode + * @enum {number} + * @property {number} READ_LOCK_MODE_UNSPECIFIED=0 READ_LOCK_MODE_UNSPECIFIED value + * @property {number} PESSIMISTIC=1 PESSIMISTIC value + * @property {number} OPTIMISTIC=2 OPTIMISTIC value + */ + ReadWrite.ReadLockMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "READ_LOCK_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PESSIMISTIC"] = 1; + values[valuesById[2] = "OPTIMISTIC"] = 2; + return values; + })(); + + return ReadWrite; + })(); + + TransactionOptions.PartitionedDml = (function() { + + /** + * Properties of a PartitionedDml. + * @memberof google.spanner.v1.TransactionOptions + * @interface IPartitionedDml + */ + + /** + * Constructs a new PartitionedDml. + * @memberof google.spanner.v1.TransactionOptions + * @classdesc Represents a PartitionedDml. + * @implements IPartitionedDml + * @constructor + * @param {google.spanner.v1.TransactionOptions.IPartitionedDml=} [properties] Properties to set + */ + function PartitionedDml(properties) { + if (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 PartitionedDml instance using the specified properties. + * @function create + * @memberof google.spanner.v1.TransactionOptions.PartitionedDml + * @static + * @param {google.spanner.v1.TransactionOptions.IPartitionedDml=} [properties] Properties to set + * @returns {google.spanner.v1.TransactionOptions.PartitionedDml} PartitionedDml instance + */ + PartitionedDml.create = function create(properties) { + return new PartitionedDml(properties); + }; + + /** + * Encodes the specified PartitionedDml message. Does not implicitly {@link google.spanner.v1.TransactionOptions.PartitionedDml.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.TransactionOptions.PartitionedDml + * @static + * @param {google.spanner.v1.TransactionOptions.IPartitionedDml} message PartitionedDml message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartitionedDml.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified PartitionedDml message, length delimited. Does not implicitly {@link google.spanner.v1.TransactionOptions.PartitionedDml.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.TransactionOptions.PartitionedDml + * @static + * @param {google.spanner.v1.TransactionOptions.IPartitionedDml} message PartitionedDml message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartitionedDml.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PartitionedDml message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.TransactionOptions.PartitionedDml + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.TransactionOptions.PartitionedDml} PartitionedDml + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartitionedDml.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.TransactionOptions.PartitionedDml(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PartitionedDml message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.TransactionOptions.PartitionedDml + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.TransactionOptions.PartitionedDml} PartitionedDml + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartitionedDml.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PartitionedDml message. + * @function verify + * @memberof google.spanner.v1.TransactionOptions.PartitionedDml + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PartitionedDml.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a PartitionedDml message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.TransactionOptions.PartitionedDml + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.TransactionOptions.PartitionedDml} PartitionedDml + */ + PartitionedDml.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.TransactionOptions.PartitionedDml) + return object; + return new $root.google.spanner.v1.TransactionOptions.PartitionedDml(); + }; + + /** + * Creates a plain object from a PartitionedDml message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.TransactionOptions.PartitionedDml + * @static + * @param {google.spanner.v1.TransactionOptions.PartitionedDml} message PartitionedDml + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PartitionedDml.toObject = function toObject() { + return {}; + }; + + /** + * Converts this PartitionedDml to JSON. + * @function toJSON + * @memberof google.spanner.v1.TransactionOptions.PartitionedDml + * @instance + * @returns {Object.} JSON object + */ + PartitionedDml.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PartitionedDml + * @function getTypeUrl + * @memberof google.spanner.v1.TransactionOptions.PartitionedDml + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PartitionedDml.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.TransactionOptions.PartitionedDml"; + }; + + return PartitionedDml; + })(); + + TransactionOptions.ReadOnly = (function() { + + /** + * Properties of a ReadOnly. + * @memberof google.spanner.v1.TransactionOptions + * @interface IReadOnly + * @property {boolean|null} [strong] ReadOnly strong + * @property {google.protobuf.ITimestamp|null} [minReadTimestamp] ReadOnly minReadTimestamp + * @property {google.protobuf.IDuration|null} [maxStaleness] ReadOnly maxStaleness + * @property {google.protobuf.ITimestamp|null} [readTimestamp] ReadOnly readTimestamp + * @property {google.protobuf.IDuration|null} [exactStaleness] ReadOnly exactStaleness + * @property {boolean|null} [returnReadTimestamp] ReadOnly returnReadTimestamp + */ + + /** + * Constructs a new ReadOnly. + * @memberof google.spanner.v1.TransactionOptions + * @classdesc Represents a ReadOnly. + * @implements IReadOnly + * @constructor + * @param {google.spanner.v1.TransactionOptions.IReadOnly=} [properties] Properties to set + */ + function ReadOnly(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReadOnly strong. + * @member {boolean|null|undefined} strong + * @memberof google.spanner.v1.TransactionOptions.ReadOnly + * @instance + */ + ReadOnly.prototype.strong = null; + + /** + * ReadOnly minReadTimestamp. + * @member {google.protobuf.ITimestamp|null|undefined} minReadTimestamp + * @memberof google.spanner.v1.TransactionOptions.ReadOnly + * @instance + */ + ReadOnly.prototype.minReadTimestamp = null; + + /** + * ReadOnly maxStaleness. + * @member {google.protobuf.IDuration|null|undefined} maxStaleness + * @memberof google.spanner.v1.TransactionOptions.ReadOnly + * @instance + */ + ReadOnly.prototype.maxStaleness = null; + + /** + * ReadOnly readTimestamp. + * @member {google.protobuf.ITimestamp|null|undefined} readTimestamp + * @memberof google.spanner.v1.TransactionOptions.ReadOnly + * @instance + */ + ReadOnly.prototype.readTimestamp = null; + + /** + * ReadOnly exactStaleness. + * @member {google.protobuf.IDuration|null|undefined} exactStaleness + * @memberof google.spanner.v1.TransactionOptions.ReadOnly + * @instance + */ + ReadOnly.prototype.exactStaleness = null; + + /** + * ReadOnly returnReadTimestamp. + * @member {boolean} returnReadTimestamp + * @memberof google.spanner.v1.TransactionOptions.ReadOnly + * @instance + */ + ReadOnly.prototype.returnReadTimestamp = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ReadOnly timestampBound. + * @member {"strong"|"minReadTimestamp"|"maxStaleness"|"readTimestamp"|"exactStaleness"|undefined} timestampBound + * @memberof google.spanner.v1.TransactionOptions.ReadOnly + * @instance + */ + Object.defineProperty(ReadOnly.prototype, "timestampBound", { + get: $util.oneOfGetter($oneOfFields = ["strong", "minReadTimestamp", "maxStaleness", "readTimestamp", "exactStaleness"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ReadOnly instance using the specified properties. + * @function create + * @memberof google.spanner.v1.TransactionOptions.ReadOnly + * @static + * @param {google.spanner.v1.TransactionOptions.IReadOnly=} [properties] Properties to set + * @returns {google.spanner.v1.TransactionOptions.ReadOnly} ReadOnly instance + */ + ReadOnly.create = function create(properties) { + return new ReadOnly(properties); + }; + + /** + * Encodes the specified ReadOnly message. Does not implicitly {@link google.spanner.v1.TransactionOptions.ReadOnly.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.TransactionOptions.ReadOnly + * @static + * @param {google.spanner.v1.TransactionOptions.IReadOnly} message ReadOnly message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadOnly.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.strong != null && Object.hasOwnProperty.call(message, "strong")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.strong); + if (message.minReadTimestamp != null && Object.hasOwnProperty.call(message, "minReadTimestamp")) + $root.google.protobuf.Timestamp.encode(message.minReadTimestamp, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.maxStaleness != null && Object.hasOwnProperty.call(message, "maxStaleness")) + $root.google.protobuf.Duration.encode(message.maxStaleness, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.readTimestamp != null && Object.hasOwnProperty.call(message, "readTimestamp")) + $root.google.protobuf.Timestamp.encode(message.readTimestamp, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.exactStaleness != null && Object.hasOwnProperty.call(message, "exactStaleness")) + $root.google.protobuf.Duration.encode(message.exactStaleness, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.returnReadTimestamp != null && Object.hasOwnProperty.call(message, "returnReadTimestamp")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.returnReadTimestamp); + return writer; + }; + + /** + * Encodes the specified ReadOnly message, length delimited. Does not implicitly {@link google.spanner.v1.TransactionOptions.ReadOnly.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.TransactionOptions.ReadOnly + * @static + * @param {google.spanner.v1.TransactionOptions.IReadOnly} message ReadOnly message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadOnly.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReadOnly message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.TransactionOptions.ReadOnly + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.TransactionOptions.ReadOnly} ReadOnly + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadOnly.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.TransactionOptions.ReadOnly(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.strong = reader.bool(); + break; + } + case 2: { + message.minReadTimestamp = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.maxStaleness = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 4: { + message.readTimestamp = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.exactStaleness = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 6: { + message.returnReadTimestamp = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReadOnly message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.TransactionOptions.ReadOnly + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.TransactionOptions.ReadOnly} ReadOnly + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadOnly.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReadOnly message. + * @function verify + * @memberof google.spanner.v1.TransactionOptions.ReadOnly + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReadOnly.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.strong != null && message.hasOwnProperty("strong")) { + properties.timestampBound = 1; + if (typeof message.strong !== "boolean") + return "strong: boolean expected"; + } + if (message.minReadTimestamp != null && message.hasOwnProperty("minReadTimestamp")) { + if (properties.timestampBound === 1) + return "timestampBound: multiple values"; + properties.timestampBound = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.minReadTimestamp); + if (error) + return "minReadTimestamp." + error; + } + } + if (message.maxStaleness != null && message.hasOwnProperty("maxStaleness")) { + if (properties.timestampBound === 1) + return "timestampBound: multiple values"; + properties.timestampBound = 1; + { + var error = $root.google.protobuf.Duration.verify(message.maxStaleness); + if (error) + return "maxStaleness." + error; + } + } + if (message.readTimestamp != null && message.hasOwnProperty("readTimestamp")) { + if (properties.timestampBound === 1) + return "timestampBound: multiple values"; + properties.timestampBound = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.readTimestamp); + if (error) + return "readTimestamp." + error; + } + } + if (message.exactStaleness != null && message.hasOwnProperty("exactStaleness")) { + if (properties.timestampBound === 1) + return "timestampBound: multiple values"; + properties.timestampBound = 1; + { + var error = $root.google.protobuf.Duration.verify(message.exactStaleness); + if (error) + return "exactStaleness." + error; + } + } + if (message.returnReadTimestamp != null && message.hasOwnProperty("returnReadTimestamp")) + if (typeof message.returnReadTimestamp !== "boolean") + return "returnReadTimestamp: boolean expected"; + return null; + }; + + /** + * Creates a ReadOnly message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.TransactionOptions.ReadOnly + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.TransactionOptions.ReadOnly} ReadOnly + */ + ReadOnly.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.TransactionOptions.ReadOnly) + return object; + var message = new $root.google.spanner.v1.TransactionOptions.ReadOnly(); + if (object.strong != null) + message.strong = Boolean(object.strong); + if (object.minReadTimestamp != null) { + if (typeof object.minReadTimestamp !== "object") + throw TypeError(".google.spanner.v1.TransactionOptions.ReadOnly.minReadTimestamp: object expected"); + message.minReadTimestamp = $root.google.protobuf.Timestamp.fromObject(object.minReadTimestamp); + } + if (object.maxStaleness != null) { + if (typeof object.maxStaleness !== "object") + throw TypeError(".google.spanner.v1.TransactionOptions.ReadOnly.maxStaleness: object expected"); + message.maxStaleness = $root.google.protobuf.Duration.fromObject(object.maxStaleness); + } + if (object.readTimestamp != null) { + if (typeof object.readTimestamp !== "object") + throw TypeError(".google.spanner.v1.TransactionOptions.ReadOnly.readTimestamp: object expected"); + message.readTimestamp = $root.google.protobuf.Timestamp.fromObject(object.readTimestamp); + } + if (object.exactStaleness != null) { + if (typeof object.exactStaleness !== "object") + throw TypeError(".google.spanner.v1.TransactionOptions.ReadOnly.exactStaleness: object expected"); + message.exactStaleness = $root.google.protobuf.Duration.fromObject(object.exactStaleness); + } + if (object.returnReadTimestamp != null) + message.returnReadTimestamp = Boolean(object.returnReadTimestamp); + return message; + }; + + /** + * Creates a plain object from a ReadOnly message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.TransactionOptions.ReadOnly + * @static + * @param {google.spanner.v1.TransactionOptions.ReadOnly} message ReadOnly + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReadOnly.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.returnReadTimestamp = false; + if (message.strong != null && message.hasOwnProperty("strong")) { + object.strong = message.strong; + if (options.oneofs) + object.timestampBound = "strong"; + } + if (message.minReadTimestamp != null && message.hasOwnProperty("minReadTimestamp")) { + object.minReadTimestamp = $root.google.protobuf.Timestamp.toObject(message.minReadTimestamp, options); + if (options.oneofs) + object.timestampBound = "minReadTimestamp"; + } + if (message.maxStaleness != null && message.hasOwnProperty("maxStaleness")) { + object.maxStaleness = $root.google.protobuf.Duration.toObject(message.maxStaleness, options); + if (options.oneofs) + object.timestampBound = "maxStaleness"; + } + if (message.readTimestamp != null && message.hasOwnProperty("readTimestamp")) { + object.readTimestamp = $root.google.protobuf.Timestamp.toObject(message.readTimestamp, options); + if (options.oneofs) + object.timestampBound = "readTimestamp"; + } + if (message.exactStaleness != null && message.hasOwnProperty("exactStaleness")) { + object.exactStaleness = $root.google.protobuf.Duration.toObject(message.exactStaleness, options); + if (options.oneofs) + object.timestampBound = "exactStaleness"; + } + if (message.returnReadTimestamp != null && message.hasOwnProperty("returnReadTimestamp")) + object.returnReadTimestamp = message.returnReadTimestamp; + return object; + }; + + /** + * Converts this ReadOnly to JSON. + * @function toJSON + * @memberof google.spanner.v1.TransactionOptions.ReadOnly + * @instance + * @returns {Object.} JSON object + */ + ReadOnly.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReadOnly + * @function getTypeUrl + * @memberof google.spanner.v1.TransactionOptions.ReadOnly + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReadOnly.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.TransactionOptions.ReadOnly"; + }; + + return ReadOnly; + })(); + + /** + * IsolationLevel enum. + * @name google.spanner.v1.TransactionOptions.IsolationLevel + * @enum {number} + * @property {number} ISOLATION_LEVEL_UNSPECIFIED=0 ISOLATION_LEVEL_UNSPECIFIED value + * @property {number} SERIALIZABLE=1 SERIALIZABLE value + * @property {number} REPEATABLE_READ=2 REPEATABLE_READ value + */ + TransactionOptions.IsolationLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ISOLATION_LEVEL_UNSPECIFIED"] = 0; + values[valuesById[1] = "SERIALIZABLE"] = 1; + values[valuesById[2] = "REPEATABLE_READ"] = 2; + return values; + })(); + + return TransactionOptions; + })(); + + v1.Transaction = (function() { + + /** + * Properties of a Transaction. + * @memberof google.spanner.v1 + * @interface ITransaction + * @property {Uint8Array|null} [id] Transaction id + * @property {google.protobuf.ITimestamp|null} [readTimestamp] Transaction readTimestamp + * @property {google.spanner.v1.IMultiplexedSessionPrecommitToken|null} [precommitToken] Transaction precommitToken + */ + + /** + * Constructs a new Transaction. + * @memberof google.spanner.v1 + * @classdesc Represents a Transaction. + * @implements ITransaction + * @constructor + * @param {google.spanner.v1.ITransaction=} [properties] Properties to set + */ + function Transaction(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Transaction id. + * @member {Uint8Array} id + * @memberof google.spanner.v1.Transaction + * @instance + */ + Transaction.prototype.id = $util.newBuffer([]); + + /** + * Transaction readTimestamp. + * @member {google.protobuf.ITimestamp|null|undefined} readTimestamp + * @memberof google.spanner.v1.Transaction + * @instance + */ + Transaction.prototype.readTimestamp = null; + + /** + * Transaction precommitToken. + * @member {google.spanner.v1.IMultiplexedSessionPrecommitToken|null|undefined} precommitToken + * @memberof google.spanner.v1.Transaction + * @instance + */ + Transaction.prototype.precommitToken = null; + + /** + * Creates a new Transaction instance using the specified properties. + * @function create + * @memberof google.spanner.v1.Transaction + * @static + * @param {google.spanner.v1.ITransaction=} [properties] Properties to set + * @returns {google.spanner.v1.Transaction} Transaction instance + */ + Transaction.create = function create(properties) { + return new Transaction(properties); + }; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link google.spanner.v1.Transaction.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.Transaction + * @static + * @param {google.spanner.v1.ITransaction} message Transaction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Transaction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.id); + if (message.readTimestamp != null && Object.hasOwnProperty.call(message, "readTimestamp")) + $root.google.protobuf.Timestamp.encode(message.readTimestamp, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.precommitToken != null && Object.hasOwnProperty.call(message, "precommitToken")) + $root.google.spanner.v1.MultiplexedSessionPrecommitToken.encode(message.precommitToken, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Transaction message, length delimited. Does not implicitly {@link google.spanner.v1.Transaction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.Transaction + * @static + * @param {google.spanner.v1.ITransaction} message Transaction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Transaction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.Transaction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.Transaction} Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Transaction.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.Transaction(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.id = reader.bytes(); + break; + } + case 2: { + message.readTimestamp = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.precommitToken = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Transaction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.Transaction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.Transaction} Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Transaction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Transaction message. + * @function verify + * @memberof google.spanner.v1.Transaction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Transaction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!(message.id && typeof message.id.length === "number" || $util.isString(message.id))) + return "id: buffer expected"; + if (message.readTimestamp != null && message.hasOwnProperty("readTimestamp")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTimestamp); + if (error) + return "readTimestamp." + error; + } + if (message.precommitToken != null && message.hasOwnProperty("precommitToken")) { + var error = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.verify(message.precommitToken); + if (error) + return "precommitToken." + error; + } + return null; + }; + + /** + * Creates a Transaction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.Transaction + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.Transaction} Transaction + */ + Transaction.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.Transaction) + return object; + var message = new $root.google.spanner.v1.Transaction(); + if (object.id != null) + if (typeof object.id === "string") + $util.base64.decode(object.id, message.id = $util.newBuffer($util.base64.length(object.id)), 0); + else if (object.id.length >= 0) + message.id = object.id; + if (object.readTimestamp != null) { + if (typeof object.readTimestamp !== "object") + throw TypeError(".google.spanner.v1.Transaction.readTimestamp: object expected"); + message.readTimestamp = $root.google.protobuf.Timestamp.fromObject(object.readTimestamp); + } + if (object.precommitToken != null) { + if (typeof object.precommitToken !== "object") + throw TypeError(".google.spanner.v1.Transaction.precommitToken: object expected"); + message.precommitToken = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.fromObject(object.precommitToken); + } + return message; + }; + + /** + * Creates a plain object from a Transaction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.Transaction + * @static + * @param {google.spanner.v1.Transaction} message Transaction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Transaction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.id = ""; + else { + object.id = []; + if (options.bytes !== Array) + object.id = $util.newBuffer(object.id); + } + object.readTimestamp = null; + object.precommitToken = null; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = options.bytes === String ? $util.base64.encode(message.id, 0, message.id.length) : options.bytes === Array ? Array.prototype.slice.call(message.id) : message.id; + if (message.readTimestamp != null && message.hasOwnProperty("readTimestamp")) + object.readTimestamp = $root.google.protobuf.Timestamp.toObject(message.readTimestamp, options); + if (message.precommitToken != null && message.hasOwnProperty("precommitToken")) + object.precommitToken = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.toObject(message.precommitToken, options); + return object; + }; + + /** + * Converts this Transaction to JSON. + * @function toJSON + * @memberof google.spanner.v1.Transaction + * @instance + * @returns {Object.} JSON object + */ + Transaction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Transaction + * @function getTypeUrl + * @memberof google.spanner.v1.Transaction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Transaction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.Transaction"; + }; + + return Transaction; + })(); + + v1.TransactionSelector = (function() { + + /** + * Properties of a TransactionSelector. + * @memberof google.spanner.v1 + * @interface ITransactionSelector + * @property {google.spanner.v1.ITransactionOptions|null} [singleUse] TransactionSelector singleUse + * @property {Uint8Array|null} [id] TransactionSelector id + * @property {google.spanner.v1.ITransactionOptions|null} [begin] TransactionSelector begin + */ + + /** + * Constructs a new TransactionSelector. + * @memberof google.spanner.v1 + * @classdesc Represents a TransactionSelector. + * @implements ITransactionSelector + * @constructor + * @param {google.spanner.v1.ITransactionSelector=} [properties] Properties to set + */ + function TransactionSelector(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TransactionSelector singleUse. + * @member {google.spanner.v1.ITransactionOptions|null|undefined} singleUse + * @memberof google.spanner.v1.TransactionSelector + * @instance + */ + TransactionSelector.prototype.singleUse = null; + + /** + * TransactionSelector id. + * @member {Uint8Array|null|undefined} id + * @memberof google.spanner.v1.TransactionSelector + * @instance + */ + TransactionSelector.prototype.id = null; + + /** + * TransactionSelector begin. + * @member {google.spanner.v1.ITransactionOptions|null|undefined} begin + * @memberof google.spanner.v1.TransactionSelector + * @instance + */ + TransactionSelector.prototype.begin = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TransactionSelector selector. + * @member {"singleUse"|"id"|"begin"|undefined} selector + * @memberof google.spanner.v1.TransactionSelector + * @instance + */ + Object.defineProperty(TransactionSelector.prototype, "selector", { + get: $util.oneOfGetter($oneOfFields = ["singleUse", "id", "begin"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TransactionSelector instance using the specified properties. + * @function create + * @memberof google.spanner.v1.TransactionSelector + * @static + * @param {google.spanner.v1.ITransactionSelector=} [properties] Properties to set + * @returns {google.spanner.v1.TransactionSelector} TransactionSelector instance + */ + TransactionSelector.create = function create(properties) { + return new TransactionSelector(properties); + }; + + /** + * Encodes the specified TransactionSelector message. Does not implicitly {@link google.spanner.v1.TransactionSelector.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.TransactionSelector + * @static + * @param {google.spanner.v1.ITransactionSelector} message TransactionSelector message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionSelector.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.singleUse != null && Object.hasOwnProperty.call(message, "singleUse")) + $root.google.spanner.v1.TransactionOptions.encode(message.singleUse, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.id); + if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) + $root.google.spanner.v1.TransactionOptions.encode(message.begin, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TransactionSelector message, length delimited. Does not implicitly {@link google.spanner.v1.TransactionSelector.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.TransactionSelector + * @static + * @param {google.spanner.v1.ITransactionSelector} message TransactionSelector message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionSelector.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TransactionSelector message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.TransactionSelector + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.TransactionSelector} TransactionSelector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionSelector.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.TransactionSelector(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.singleUse = $root.google.spanner.v1.TransactionOptions.decode(reader, reader.uint32()); + break; + } + case 2: { + message.id = reader.bytes(); + break; + } + case 3: { + message.begin = $root.google.spanner.v1.TransactionOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TransactionSelector message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.TransactionSelector + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.TransactionSelector} TransactionSelector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionSelector.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TransactionSelector message. + * @function verify + * @memberof google.spanner.v1.TransactionSelector + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TransactionSelector.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.singleUse != null && message.hasOwnProperty("singleUse")) { + properties.selector = 1; + { + var error = $root.google.spanner.v1.TransactionOptions.verify(message.singleUse); + if (error) + return "singleUse." + error; + } + } + if (message.id != null && message.hasOwnProperty("id")) { + if (properties.selector === 1) + return "selector: multiple values"; + properties.selector = 1; + if (!(message.id && typeof message.id.length === "number" || $util.isString(message.id))) + return "id: buffer expected"; + } + if (message.begin != null && message.hasOwnProperty("begin")) { + if (properties.selector === 1) + return "selector: multiple values"; + properties.selector = 1; + { + var error = $root.google.spanner.v1.TransactionOptions.verify(message.begin); + if (error) + return "begin." + error; + } + } + return null; + }; + + /** + * Creates a TransactionSelector message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.TransactionSelector + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.TransactionSelector} TransactionSelector + */ + TransactionSelector.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.TransactionSelector) + return object; + var message = new $root.google.spanner.v1.TransactionSelector(); + if (object.singleUse != null) { + if (typeof object.singleUse !== "object") + throw TypeError(".google.spanner.v1.TransactionSelector.singleUse: object expected"); + message.singleUse = $root.google.spanner.v1.TransactionOptions.fromObject(object.singleUse); + } + if (object.id != null) + if (typeof object.id === "string") + $util.base64.decode(object.id, message.id = $util.newBuffer($util.base64.length(object.id)), 0); + else if (object.id.length >= 0) + message.id = object.id; + if (object.begin != null) { + if (typeof object.begin !== "object") + throw TypeError(".google.spanner.v1.TransactionSelector.begin: object expected"); + message.begin = $root.google.spanner.v1.TransactionOptions.fromObject(object.begin); + } + return message; + }; + + /** + * Creates a plain object from a TransactionSelector message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.TransactionSelector + * @static + * @param {google.spanner.v1.TransactionSelector} message TransactionSelector + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TransactionSelector.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.singleUse != null && message.hasOwnProperty("singleUse")) { + object.singleUse = $root.google.spanner.v1.TransactionOptions.toObject(message.singleUse, options); + if (options.oneofs) + object.selector = "singleUse"; + } + if (message.id != null && message.hasOwnProperty("id")) { + object.id = options.bytes === String ? $util.base64.encode(message.id, 0, message.id.length) : options.bytes === Array ? Array.prototype.slice.call(message.id) : message.id; + if (options.oneofs) + object.selector = "id"; + } + if (message.begin != null && message.hasOwnProperty("begin")) { + object.begin = $root.google.spanner.v1.TransactionOptions.toObject(message.begin, options); + if (options.oneofs) + object.selector = "begin"; + } + return object; + }; + + /** + * Converts this TransactionSelector to JSON. + * @function toJSON + * @memberof google.spanner.v1.TransactionSelector + * @instance + * @returns {Object.} JSON object + */ + TransactionSelector.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TransactionSelector + * @function getTypeUrl + * @memberof google.spanner.v1.TransactionSelector + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionSelector.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.TransactionSelector"; + }; + + return TransactionSelector; + })(); + + v1.MultiplexedSessionPrecommitToken = (function() { + + /** + * Properties of a MultiplexedSessionPrecommitToken. + * @memberof google.spanner.v1 + * @interface IMultiplexedSessionPrecommitToken + * @property {Uint8Array|null} [precommitToken] MultiplexedSessionPrecommitToken precommitToken + * @property {number|null} [seqNum] MultiplexedSessionPrecommitToken seqNum + */ + + /** + * Constructs a new MultiplexedSessionPrecommitToken. + * @memberof google.spanner.v1 + * @classdesc Represents a MultiplexedSessionPrecommitToken. + * @implements IMultiplexedSessionPrecommitToken + * @constructor + * @param {google.spanner.v1.IMultiplexedSessionPrecommitToken=} [properties] Properties to set + */ + function MultiplexedSessionPrecommitToken(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MultiplexedSessionPrecommitToken precommitToken. + * @member {Uint8Array} precommitToken + * @memberof google.spanner.v1.MultiplexedSessionPrecommitToken + * @instance + */ + MultiplexedSessionPrecommitToken.prototype.precommitToken = $util.newBuffer([]); + + /** + * MultiplexedSessionPrecommitToken seqNum. + * @member {number} seqNum + * @memberof google.spanner.v1.MultiplexedSessionPrecommitToken + * @instance + */ + MultiplexedSessionPrecommitToken.prototype.seqNum = 0; + + /** + * Creates a new MultiplexedSessionPrecommitToken instance using the specified properties. + * @function create + * @memberof google.spanner.v1.MultiplexedSessionPrecommitToken + * @static + * @param {google.spanner.v1.IMultiplexedSessionPrecommitToken=} [properties] Properties to set + * @returns {google.spanner.v1.MultiplexedSessionPrecommitToken} MultiplexedSessionPrecommitToken instance + */ + MultiplexedSessionPrecommitToken.create = function create(properties) { + return new MultiplexedSessionPrecommitToken(properties); + }; + + /** + * Encodes the specified MultiplexedSessionPrecommitToken message. Does not implicitly {@link google.spanner.v1.MultiplexedSessionPrecommitToken.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.MultiplexedSessionPrecommitToken + * @static + * @param {google.spanner.v1.IMultiplexedSessionPrecommitToken} message MultiplexedSessionPrecommitToken message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MultiplexedSessionPrecommitToken.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.precommitToken != null && Object.hasOwnProperty.call(message, "precommitToken")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.precommitToken); + if (message.seqNum != null && Object.hasOwnProperty.call(message, "seqNum")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.seqNum); + return writer; + }; + + /** + * Encodes the specified MultiplexedSessionPrecommitToken message, length delimited. Does not implicitly {@link google.spanner.v1.MultiplexedSessionPrecommitToken.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.MultiplexedSessionPrecommitToken + * @static + * @param {google.spanner.v1.IMultiplexedSessionPrecommitToken} message MultiplexedSessionPrecommitToken message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MultiplexedSessionPrecommitToken.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MultiplexedSessionPrecommitToken message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.MultiplexedSessionPrecommitToken + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.MultiplexedSessionPrecommitToken} MultiplexedSessionPrecommitToken + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MultiplexedSessionPrecommitToken.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.MultiplexedSessionPrecommitToken(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.precommitToken = reader.bytes(); + break; + } + case 2: { + message.seqNum = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MultiplexedSessionPrecommitToken message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.MultiplexedSessionPrecommitToken + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.MultiplexedSessionPrecommitToken} MultiplexedSessionPrecommitToken + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MultiplexedSessionPrecommitToken.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MultiplexedSessionPrecommitToken message. + * @function verify + * @memberof google.spanner.v1.MultiplexedSessionPrecommitToken + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MultiplexedSessionPrecommitToken.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.precommitToken != null && message.hasOwnProperty("precommitToken")) + if (!(message.precommitToken && typeof message.precommitToken.length === "number" || $util.isString(message.precommitToken))) + return "precommitToken: buffer expected"; + if (message.seqNum != null && message.hasOwnProperty("seqNum")) + if (!$util.isInteger(message.seqNum)) + return "seqNum: integer expected"; + return null; + }; + + /** + * Creates a MultiplexedSessionPrecommitToken message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.MultiplexedSessionPrecommitToken + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.MultiplexedSessionPrecommitToken} MultiplexedSessionPrecommitToken + */ + MultiplexedSessionPrecommitToken.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.MultiplexedSessionPrecommitToken) + return object; + var message = new $root.google.spanner.v1.MultiplexedSessionPrecommitToken(); + if (object.precommitToken != null) + if (typeof object.precommitToken === "string") + $util.base64.decode(object.precommitToken, message.precommitToken = $util.newBuffer($util.base64.length(object.precommitToken)), 0); + else if (object.precommitToken.length >= 0) + message.precommitToken = object.precommitToken; + if (object.seqNum != null) + message.seqNum = object.seqNum | 0; + return message; + }; + + /** + * Creates a plain object from a MultiplexedSessionPrecommitToken message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.MultiplexedSessionPrecommitToken + * @static + * @param {google.spanner.v1.MultiplexedSessionPrecommitToken} message MultiplexedSessionPrecommitToken + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MultiplexedSessionPrecommitToken.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.precommitToken = ""; + else { + object.precommitToken = []; + if (options.bytes !== Array) + object.precommitToken = $util.newBuffer(object.precommitToken); + } + object.seqNum = 0; + } + if (message.precommitToken != null && message.hasOwnProperty("precommitToken")) + object.precommitToken = options.bytes === String ? $util.base64.encode(message.precommitToken, 0, message.precommitToken.length) : options.bytes === Array ? Array.prototype.slice.call(message.precommitToken) : message.precommitToken; + if (message.seqNum != null && message.hasOwnProperty("seqNum")) + object.seqNum = message.seqNum; + return object; + }; + + /** + * Converts this MultiplexedSessionPrecommitToken to JSON. + * @function toJSON + * @memberof google.spanner.v1.MultiplexedSessionPrecommitToken + * @instance + * @returns {Object.} JSON object + */ + MultiplexedSessionPrecommitToken.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MultiplexedSessionPrecommitToken + * @function getTypeUrl + * @memberof google.spanner.v1.MultiplexedSessionPrecommitToken + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MultiplexedSessionPrecommitToken.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.MultiplexedSessionPrecommitToken"; + }; + + return MultiplexedSessionPrecommitToken; + })(); + + v1.KeyRange = (function() { + + /** + * Properties of a KeyRange. + * @memberof google.spanner.v1 + * @interface IKeyRange + * @property {google.protobuf.IListValue|null} [startClosed] KeyRange startClosed + * @property {google.protobuf.IListValue|null} [startOpen] KeyRange startOpen + * @property {google.protobuf.IListValue|null} [endClosed] KeyRange endClosed + * @property {google.protobuf.IListValue|null} [endOpen] KeyRange endOpen + */ + + /** + * Constructs a new KeyRange. + * @memberof google.spanner.v1 + * @classdesc Represents a KeyRange. + * @implements IKeyRange + * @constructor + * @param {google.spanner.v1.IKeyRange=} [properties] Properties to set + */ + function KeyRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * KeyRange startClosed. + * @member {google.protobuf.IListValue|null|undefined} startClosed + * @memberof google.spanner.v1.KeyRange + * @instance + */ + KeyRange.prototype.startClosed = null; + + /** + * KeyRange startOpen. + * @member {google.protobuf.IListValue|null|undefined} startOpen + * @memberof google.spanner.v1.KeyRange + * @instance + */ + KeyRange.prototype.startOpen = null; + + /** + * KeyRange endClosed. + * @member {google.protobuf.IListValue|null|undefined} endClosed + * @memberof google.spanner.v1.KeyRange + * @instance + */ + KeyRange.prototype.endClosed = null; + + /** + * KeyRange endOpen. + * @member {google.protobuf.IListValue|null|undefined} endOpen + * @memberof google.spanner.v1.KeyRange + * @instance + */ + KeyRange.prototype.endOpen = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * KeyRange startKeyType. + * @member {"startClosed"|"startOpen"|undefined} startKeyType + * @memberof google.spanner.v1.KeyRange + * @instance + */ + Object.defineProperty(KeyRange.prototype, "startKeyType", { + get: $util.oneOfGetter($oneOfFields = ["startClosed", "startOpen"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * KeyRange endKeyType. + * @member {"endClosed"|"endOpen"|undefined} endKeyType + * @memberof google.spanner.v1.KeyRange + * @instance + */ + Object.defineProperty(KeyRange.prototype, "endKeyType", { + get: $util.oneOfGetter($oneOfFields = ["endClosed", "endOpen"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new KeyRange instance using the specified properties. + * @function create + * @memberof google.spanner.v1.KeyRange + * @static + * @param {google.spanner.v1.IKeyRange=} [properties] Properties to set + * @returns {google.spanner.v1.KeyRange} KeyRange instance + */ + KeyRange.create = function create(properties) { + return new KeyRange(properties); + }; + + /** + * Encodes the specified KeyRange message. Does not implicitly {@link google.spanner.v1.KeyRange.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.KeyRange + * @static + * @param {google.spanner.v1.IKeyRange} message KeyRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startClosed != null && Object.hasOwnProperty.call(message, "startClosed")) + $root.google.protobuf.ListValue.encode(message.startClosed, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.startOpen != null && Object.hasOwnProperty.call(message, "startOpen")) + $root.google.protobuf.ListValue.encode(message.startOpen, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.endClosed != null && Object.hasOwnProperty.call(message, "endClosed")) + $root.google.protobuf.ListValue.encode(message.endClosed, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.endOpen != null && Object.hasOwnProperty.call(message, "endOpen")) + $root.google.protobuf.ListValue.encode(message.endOpen, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified KeyRange message, length delimited. Does not implicitly {@link google.spanner.v1.KeyRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.KeyRange + * @static + * @param {google.spanner.v1.IKeyRange} message KeyRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a KeyRange message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.KeyRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.KeyRange} KeyRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyRange.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.KeyRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.startClosed = $root.google.protobuf.ListValue.decode(reader, reader.uint32()); + break; + } + case 2: { + message.startOpen = $root.google.protobuf.ListValue.decode(reader, reader.uint32()); + break; + } + case 3: { + message.endClosed = $root.google.protobuf.ListValue.decode(reader, reader.uint32()); + break; + } + case 4: { + message.endOpen = $root.google.protobuf.ListValue.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a KeyRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.KeyRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.KeyRange} KeyRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a KeyRange message. + * @function verify + * @memberof google.spanner.v1.KeyRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + KeyRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.startClosed != null && message.hasOwnProperty("startClosed")) { + properties.startKeyType = 1; + { + var error = $root.google.protobuf.ListValue.verify(message.startClosed); + if (error) + return "startClosed." + error; + } + } + if (message.startOpen != null && message.hasOwnProperty("startOpen")) { + if (properties.startKeyType === 1) + return "startKeyType: multiple values"; + properties.startKeyType = 1; + { + var error = $root.google.protobuf.ListValue.verify(message.startOpen); + if (error) + return "startOpen." + error; + } + } + if (message.endClosed != null && message.hasOwnProperty("endClosed")) { + properties.endKeyType = 1; + { + var error = $root.google.protobuf.ListValue.verify(message.endClosed); + if (error) + return "endClosed." + error; + } + } + if (message.endOpen != null && message.hasOwnProperty("endOpen")) { + if (properties.endKeyType === 1) + return "endKeyType: multiple values"; + properties.endKeyType = 1; + { + var error = $root.google.protobuf.ListValue.verify(message.endOpen); + if (error) + return "endOpen." + error; + } + } + return null; + }; + + /** + * Creates a KeyRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.KeyRange + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.KeyRange} KeyRange + */ + KeyRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.KeyRange) + return object; + var message = new $root.google.spanner.v1.KeyRange(); + if (object.startClosed != null) { + if (typeof object.startClosed !== "object") + throw TypeError(".google.spanner.v1.KeyRange.startClosed: object expected"); + message.startClosed = $root.google.protobuf.ListValue.fromObject(object.startClosed); + } + if (object.startOpen != null) { + if (typeof object.startOpen !== "object") + throw TypeError(".google.spanner.v1.KeyRange.startOpen: object expected"); + message.startOpen = $root.google.protobuf.ListValue.fromObject(object.startOpen); + } + if (object.endClosed != null) { + if (typeof object.endClosed !== "object") + throw TypeError(".google.spanner.v1.KeyRange.endClosed: object expected"); + message.endClosed = $root.google.protobuf.ListValue.fromObject(object.endClosed); + } + if (object.endOpen != null) { + if (typeof object.endOpen !== "object") + throw TypeError(".google.spanner.v1.KeyRange.endOpen: object expected"); + message.endOpen = $root.google.protobuf.ListValue.fromObject(object.endOpen); + } + return message; + }; + + /** + * Creates a plain object from a KeyRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.KeyRange + * @static + * @param {google.spanner.v1.KeyRange} message KeyRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + KeyRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.startClosed != null && message.hasOwnProperty("startClosed")) { + object.startClosed = $root.google.protobuf.ListValue.toObject(message.startClosed, options); + if (options.oneofs) + object.startKeyType = "startClosed"; + } + if (message.startOpen != null && message.hasOwnProperty("startOpen")) { + object.startOpen = $root.google.protobuf.ListValue.toObject(message.startOpen, options); + if (options.oneofs) + object.startKeyType = "startOpen"; + } + if (message.endClosed != null && message.hasOwnProperty("endClosed")) { + object.endClosed = $root.google.protobuf.ListValue.toObject(message.endClosed, options); + if (options.oneofs) + object.endKeyType = "endClosed"; + } + if (message.endOpen != null && message.hasOwnProperty("endOpen")) { + object.endOpen = $root.google.protobuf.ListValue.toObject(message.endOpen, options); + if (options.oneofs) + object.endKeyType = "endOpen"; + } + return object; + }; + + /** + * Converts this KeyRange to JSON. + * @function toJSON + * @memberof google.spanner.v1.KeyRange + * @instance + * @returns {Object.} JSON object + */ + KeyRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for KeyRange + * @function getTypeUrl + * @memberof google.spanner.v1.KeyRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + KeyRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.KeyRange"; + }; + + return KeyRange; + })(); + + v1.KeySet = (function() { + + /** + * Properties of a KeySet. + * @memberof google.spanner.v1 + * @interface IKeySet + * @property {Array.|null} [keys] KeySet keys + * @property {Array.|null} [ranges] KeySet ranges + * @property {boolean|null} [all] KeySet all + */ + + /** + * Constructs a new KeySet. + * @memberof google.spanner.v1 + * @classdesc Represents a KeySet. + * @implements IKeySet + * @constructor + * @param {google.spanner.v1.IKeySet=} [properties] Properties to set + */ + function KeySet(properties) { + this.keys = []; + this.ranges = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * KeySet keys. + * @member {Array.} keys + * @memberof google.spanner.v1.KeySet + * @instance + */ + KeySet.prototype.keys = $util.emptyArray; + + /** + * KeySet ranges. + * @member {Array.} ranges + * @memberof google.spanner.v1.KeySet + * @instance + */ + KeySet.prototype.ranges = $util.emptyArray; + + /** + * KeySet all. + * @member {boolean} all + * @memberof google.spanner.v1.KeySet + * @instance + */ + KeySet.prototype.all = false; + + /** + * Creates a new KeySet instance using the specified properties. + * @function create + * @memberof google.spanner.v1.KeySet + * @static + * @param {google.spanner.v1.IKeySet=} [properties] Properties to set + * @returns {google.spanner.v1.KeySet} KeySet instance + */ + KeySet.create = function create(properties) { + return new KeySet(properties); + }; + + /** + * Encodes the specified KeySet message. Does not implicitly {@link google.spanner.v1.KeySet.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.KeySet + * @static + * @param {google.spanner.v1.IKeySet} message KeySet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeySet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.keys != null && message.keys.length) + for (var i = 0; i < message.keys.length; ++i) + $root.google.protobuf.ListValue.encode(message.keys[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.ranges != null && message.ranges.length) + for (var i = 0; i < message.ranges.length; ++i) + $root.google.spanner.v1.KeyRange.encode(message.ranges[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.all != null && Object.hasOwnProperty.call(message, "all")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.all); + return writer; + }; + + /** + * Encodes the specified KeySet message, length delimited. Does not implicitly {@link google.spanner.v1.KeySet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.KeySet + * @static + * @param {google.spanner.v1.IKeySet} message KeySet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeySet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a KeySet message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.KeySet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.KeySet} KeySet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeySet.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.KeySet(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.keys && message.keys.length)) + message.keys = []; + message.keys.push($root.google.protobuf.ListValue.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.ranges && message.ranges.length)) + message.ranges = []; + message.ranges.push($root.google.spanner.v1.KeyRange.decode(reader, reader.uint32())); + break; + } + case 3: { + message.all = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a KeySet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.KeySet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.KeySet} KeySet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeySet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a KeySet message. + * @function verify + * @memberof google.spanner.v1.KeySet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + KeySet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.keys != null && message.hasOwnProperty("keys")) { + if (!Array.isArray(message.keys)) + return "keys: array expected"; + for (var i = 0; i < message.keys.length; ++i) { + var error = $root.google.protobuf.ListValue.verify(message.keys[i]); + if (error) + return "keys." + error; + } + } + if (message.ranges != null && message.hasOwnProperty("ranges")) { + if (!Array.isArray(message.ranges)) + return "ranges: array expected"; + for (var i = 0; i < message.ranges.length; ++i) { + var error = $root.google.spanner.v1.KeyRange.verify(message.ranges[i]); + if (error) + return "ranges." + error; + } + } + if (message.all != null && message.hasOwnProperty("all")) + if (typeof message.all !== "boolean") + return "all: boolean expected"; + return null; + }; + + /** + * Creates a KeySet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.KeySet + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.KeySet} KeySet + */ + KeySet.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.KeySet) + return object; + var message = new $root.google.spanner.v1.KeySet(); + if (object.keys) { + if (!Array.isArray(object.keys)) + throw TypeError(".google.spanner.v1.KeySet.keys: array expected"); + message.keys = []; + for (var i = 0; i < object.keys.length; ++i) { + if (typeof object.keys[i] !== "object") + throw TypeError(".google.spanner.v1.KeySet.keys: object expected"); + message.keys[i] = $root.google.protobuf.ListValue.fromObject(object.keys[i]); + } + } + if (object.ranges) { + if (!Array.isArray(object.ranges)) + throw TypeError(".google.spanner.v1.KeySet.ranges: array expected"); + message.ranges = []; + for (var i = 0; i < object.ranges.length; ++i) { + if (typeof object.ranges[i] !== "object") + throw TypeError(".google.spanner.v1.KeySet.ranges: object expected"); + message.ranges[i] = $root.google.spanner.v1.KeyRange.fromObject(object.ranges[i]); + } + } + if (object.all != null) + message.all = Boolean(object.all); + return message; + }; + + /** + * Creates a plain object from a KeySet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.KeySet + * @static + * @param {google.spanner.v1.KeySet} message KeySet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + KeySet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.keys = []; + object.ranges = []; + } + if (options.defaults) + object.all = false; + if (message.keys && message.keys.length) { + object.keys = []; + for (var j = 0; j < message.keys.length; ++j) + object.keys[j] = $root.google.protobuf.ListValue.toObject(message.keys[j], options); + } + if (message.ranges && message.ranges.length) { + object.ranges = []; + for (var j = 0; j < message.ranges.length; ++j) + object.ranges[j] = $root.google.spanner.v1.KeyRange.toObject(message.ranges[j], options); + } + if (message.all != null && message.hasOwnProperty("all")) + object.all = message.all; + return object; + }; + + /** + * Converts this KeySet to JSON. + * @function toJSON + * @memberof google.spanner.v1.KeySet + * @instance + * @returns {Object.} JSON object + */ + KeySet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for KeySet + * @function getTypeUrl + * @memberof google.spanner.v1.KeySet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + KeySet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.KeySet"; + }; + + return KeySet; + })(); + + v1.Range = (function() { + + /** + * Properties of a Range. + * @memberof google.spanner.v1 + * @interface IRange + * @property {Uint8Array|null} [startKey] Range startKey + * @property {Uint8Array|null} [limitKey] Range limitKey + * @property {number|Long|null} [groupUid] Range groupUid + * @property {number|Long|null} [splitId] Range splitId + * @property {Uint8Array|null} [generation] Range generation + */ + + /** + * Constructs a new Range. + * @memberof google.spanner.v1 + * @classdesc Represents a Range. + * @implements IRange + * @constructor + * @param {google.spanner.v1.IRange=} [properties] Properties to set + */ + function Range(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Range startKey. + * @member {Uint8Array} startKey + * @memberof google.spanner.v1.Range + * @instance + */ + Range.prototype.startKey = $util.newBuffer([]); + + /** + * Range limitKey. + * @member {Uint8Array} limitKey + * @memberof google.spanner.v1.Range + * @instance + */ + Range.prototype.limitKey = $util.newBuffer([]); + + /** + * Range groupUid. + * @member {number|Long} groupUid + * @memberof google.spanner.v1.Range + * @instance + */ + Range.prototype.groupUid = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Range splitId. + * @member {number|Long} splitId + * @memberof google.spanner.v1.Range + * @instance + */ + Range.prototype.splitId = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Range generation. + * @member {Uint8Array} generation + * @memberof google.spanner.v1.Range + * @instance + */ + Range.prototype.generation = $util.newBuffer([]); + + /** + * Creates a new Range instance using the specified properties. + * @function create + * @memberof google.spanner.v1.Range + * @static + * @param {google.spanner.v1.IRange=} [properties] Properties to set + * @returns {google.spanner.v1.Range} Range instance + */ + Range.create = function create(properties) { + return new Range(properties); + }; + + /** + * Encodes the specified Range message. Does not implicitly {@link google.spanner.v1.Range.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.Range + * @static + * @param {google.spanner.v1.IRange} message Range message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Range.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startKey != null && Object.hasOwnProperty.call(message, "startKey")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.startKey); + if (message.limitKey != null && Object.hasOwnProperty.call(message, "limitKey")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.limitKey); + if (message.groupUid != null && Object.hasOwnProperty.call(message, "groupUid")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.groupUid); + if (message.splitId != null && Object.hasOwnProperty.call(message, "splitId")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.splitId); + if (message.generation != null && Object.hasOwnProperty.call(message, "generation")) + writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.generation); + return writer; + }; + + /** + * Encodes the specified Range message, length delimited. Does not implicitly {@link google.spanner.v1.Range.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.Range + * @static + * @param {google.spanner.v1.IRange} message Range message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Range.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Range message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.Range + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.Range} Range + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Range.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.Range(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.startKey = reader.bytes(); + break; + } + case 2: { + message.limitKey = reader.bytes(); + break; + } + case 3: { + message.groupUid = reader.uint64(); + break; + } + case 4: { + message.splitId = reader.uint64(); + break; + } + case 5: { + message.generation = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Range message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.Range + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.Range} Range + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Range.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Range message. + * @function verify + * @memberof google.spanner.v1.Range + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Range.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startKey != null && message.hasOwnProperty("startKey")) + if (!(message.startKey && typeof message.startKey.length === "number" || $util.isString(message.startKey))) + return "startKey: buffer expected"; + if (message.limitKey != null && message.hasOwnProperty("limitKey")) + if (!(message.limitKey && typeof message.limitKey.length === "number" || $util.isString(message.limitKey))) + return "limitKey: buffer expected"; + if (message.groupUid != null && message.hasOwnProperty("groupUid")) + if (!$util.isInteger(message.groupUid) && !(message.groupUid && $util.isInteger(message.groupUid.low) && $util.isInteger(message.groupUid.high))) + return "groupUid: integer|Long expected"; + if (message.splitId != null && message.hasOwnProperty("splitId")) + if (!$util.isInteger(message.splitId) && !(message.splitId && $util.isInteger(message.splitId.low) && $util.isInteger(message.splitId.high))) + return "splitId: integer|Long expected"; + if (message.generation != null && message.hasOwnProperty("generation")) + if (!(message.generation && typeof message.generation.length === "number" || $util.isString(message.generation))) + return "generation: buffer expected"; + return null; + }; + + /** + * Creates a Range message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.Range + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.Range} Range + */ + Range.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.Range) + return object; + var message = new $root.google.spanner.v1.Range(); + if (object.startKey != null) + if (typeof object.startKey === "string") + $util.base64.decode(object.startKey, message.startKey = $util.newBuffer($util.base64.length(object.startKey)), 0); + else if (object.startKey.length >= 0) + message.startKey = object.startKey; + if (object.limitKey != null) + if (typeof object.limitKey === "string") + $util.base64.decode(object.limitKey, message.limitKey = $util.newBuffer($util.base64.length(object.limitKey)), 0); + else if (object.limitKey.length >= 0) + message.limitKey = object.limitKey; + if (object.groupUid != null) + if ($util.Long) + (message.groupUid = $util.Long.fromValue(object.groupUid)).unsigned = true; + else if (typeof object.groupUid === "string") + message.groupUid = parseInt(object.groupUid, 10); + else if (typeof object.groupUid === "number") + message.groupUid = object.groupUid; + else if (typeof object.groupUid === "object") + message.groupUid = new $util.LongBits(object.groupUid.low >>> 0, object.groupUid.high >>> 0).toNumber(true); + if (object.splitId != null) + if ($util.Long) + (message.splitId = $util.Long.fromValue(object.splitId)).unsigned = true; + else if (typeof object.splitId === "string") + message.splitId = parseInt(object.splitId, 10); + else if (typeof object.splitId === "number") + message.splitId = object.splitId; + else if (typeof object.splitId === "object") + message.splitId = new $util.LongBits(object.splitId.low >>> 0, object.splitId.high >>> 0).toNumber(true); + if (object.generation != null) + if (typeof object.generation === "string") + $util.base64.decode(object.generation, message.generation = $util.newBuffer($util.base64.length(object.generation)), 0); + else if (object.generation.length >= 0) + message.generation = object.generation; + return message; + }; + + /** + * Creates a plain object from a Range message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.Range + * @static + * @param {google.spanner.v1.Range} message Range + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Range.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.startKey = ""; + else { + object.startKey = []; + if (options.bytes !== Array) + object.startKey = $util.newBuffer(object.startKey); + } + if (options.bytes === String) + object.limitKey = ""; + else { + object.limitKey = []; + if (options.bytes !== Array) + object.limitKey = $util.newBuffer(object.limitKey); + } + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.groupUid = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.groupUid = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.splitId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.splitId = options.longs === String ? "0" : 0; + if (options.bytes === String) + object.generation = ""; + else { + object.generation = []; + if (options.bytes !== Array) + object.generation = $util.newBuffer(object.generation); + } + } + if (message.startKey != null && message.hasOwnProperty("startKey")) + object.startKey = options.bytes === String ? $util.base64.encode(message.startKey, 0, message.startKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.startKey) : message.startKey; + if (message.limitKey != null && message.hasOwnProperty("limitKey")) + object.limitKey = options.bytes === String ? $util.base64.encode(message.limitKey, 0, message.limitKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.limitKey) : message.limitKey; + if (message.groupUid != null && message.hasOwnProperty("groupUid")) + if (typeof message.groupUid === "number") + object.groupUid = options.longs === String ? String(message.groupUid) : message.groupUid; + else + object.groupUid = options.longs === String ? $util.Long.prototype.toString.call(message.groupUid) : options.longs === Number ? new $util.LongBits(message.groupUid.low >>> 0, message.groupUid.high >>> 0).toNumber(true) : message.groupUid; + if (message.splitId != null && message.hasOwnProperty("splitId")) + if (typeof message.splitId === "number") + object.splitId = options.longs === String ? String(message.splitId) : message.splitId; + else + object.splitId = options.longs === String ? $util.Long.prototype.toString.call(message.splitId) : options.longs === Number ? new $util.LongBits(message.splitId.low >>> 0, message.splitId.high >>> 0).toNumber(true) : message.splitId; + if (message.generation != null && message.hasOwnProperty("generation")) + object.generation = options.bytes === String ? $util.base64.encode(message.generation, 0, message.generation.length) : options.bytes === Array ? Array.prototype.slice.call(message.generation) : message.generation; + return object; + }; + + /** + * Converts this Range to JSON. + * @function toJSON + * @memberof google.spanner.v1.Range + * @instance + * @returns {Object.} JSON object + */ + Range.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Range + * @function getTypeUrl + * @memberof google.spanner.v1.Range + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Range.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.Range"; + }; + + return Range; + })(); + + v1.Tablet = (function() { + + /** + * Properties of a Tablet. + * @memberof google.spanner.v1 + * @interface ITablet + * @property {number|Long|null} [tabletUid] Tablet tabletUid + * @property {string|null} [serverAddress] Tablet serverAddress + * @property {string|null} [location] Tablet location + * @property {google.spanner.v1.Tablet.Role|null} [role] Tablet role + * @property {Uint8Array|null} [incarnation] Tablet incarnation + * @property {number|null} [distance] Tablet distance + * @property {boolean|null} [skip] Tablet skip + */ + + /** + * Constructs a new Tablet. + * @memberof google.spanner.v1 + * @classdesc Represents a Tablet. + * @implements ITablet + * @constructor + * @param {google.spanner.v1.ITablet=} [properties] Properties to set + */ + function Tablet(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Tablet tabletUid. + * @member {number|Long} tabletUid + * @memberof google.spanner.v1.Tablet + * @instance + */ + Tablet.prototype.tabletUid = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Tablet serverAddress. + * @member {string} serverAddress + * @memberof google.spanner.v1.Tablet + * @instance + */ + Tablet.prototype.serverAddress = ""; + + /** + * Tablet location. + * @member {string} location + * @memberof google.spanner.v1.Tablet + * @instance + */ + Tablet.prototype.location = ""; + + /** + * Tablet role. + * @member {google.spanner.v1.Tablet.Role} role + * @memberof google.spanner.v1.Tablet + * @instance + */ + Tablet.prototype.role = 0; + + /** + * Tablet incarnation. + * @member {Uint8Array} incarnation + * @memberof google.spanner.v1.Tablet + * @instance + */ + Tablet.prototype.incarnation = $util.newBuffer([]); + + /** + * Tablet distance. + * @member {number} distance + * @memberof google.spanner.v1.Tablet + * @instance + */ + Tablet.prototype.distance = 0; + + /** + * Tablet skip. + * @member {boolean} skip + * @memberof google.spanner.v1.Tablet + * @instance + */ + Tablet.prototype.skip = false; + + /** + * Creates a new Tablet instance using the specified properties. + * @function create + * @memberof google.spanner.v1.Tablet + * @static + * @param {google.spanner.v1.ITablet=} [properties] Properties to set + * @returns {google.spanner.v1.Tablet} Tablet instance + */ + Tablet.create = function create(properties) { + return new Tablet(properties); + }; + + /** + * Encodes the specified Tablet message. Does not implicitly {@link google.spanner.v1.Tablet.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.Tablet + * @static + * @param {google.spanner.v1.ITablet} message Tablet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Tablet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tabletUid != null && Object.hasOwnProperty.call(message, "tabletUid")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.tabletUid); + if (message.serverAddress != null && Object.hasOwnProperty.call(message, "serverAddress")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.serverAddress); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.location); + if (message.role != null && Object.hasOwnProperty.call(message, "role")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.role); + if (message.incarnation != null && Object.hasOwnProperty.call(message, "incarnation")) + writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.incarnation); + if (message.distance != null && Object.hasOwnProperty.call(message, "distance")) + writer.uint32(/* id 6, wireType 0 =*/48).uint32(message.distance); + if (message.skip != null && Object.hasOwnProperty.call(message, "skip")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.skip); + return writer; + }; + + /** + * Encodes the specified Tablet message, length delimited. Does not implicitly {@link google.spanner.v1.Tablet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.Tablet + * @static + * @param {google.spanner.v1.ITablet} message Tablet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Tablet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Tablet message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.Tablet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.Tablet} Tablet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Tablet.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.Tablet(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.tabletUid = reader.uint64(); + break; + } + case 2: { + message.serverAddress = reader.string(); + break; + } + case 3: { + message.location = reader.string(); + break; + } + case 4: { + message.role = reader.int32(); + break; + } + case 5: { + message.incarnation = reader.bytes(); + break; + } + case 6: { + message.distance = reader.uint32(); + break; + } + case 7: { + message.skip = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Tablet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.Tablet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.Tablet} Tablet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Tablet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Tablet message. + * @function verify + * @memberof google.spanner.v1.Tablet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Tablet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tabletUid != null && message.hasOwnProperty("tabletUid")) + if (!$util.isInteger(message.tabletUid) && !(message.tabletUid && $util.isInteger(message.tabletUid.low) && $util.isInteger(message.tabletUid.high))) + return "tabletUid: integer|Long expected"; + if (message.serverAddress != null && message.hasOwnProperty("serverAddress")) + if (!$util.isString(message.serverAddress)) + return "serverAddress: string expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + if (message.role != null && message.hasOwnProperty("role")) + switch (message.role) { + default: + return "role: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.incarnation != null && message.hasOwnProperty("incarnation")) + if (!(message.incarnation && typeof message.incarnation.length === "number" || $util.isString(message.incarnation))) + return "incarnation: buffer expected"; + if (message.distance != null && message.hasOwnProperty("distance")) + if (!$util.isInteger(message.distance)) + return "distance: integer expected"; + if (message.skip != null && message.hasOwnProperty("skip")) + if (typeof message.skip !== "boolean") + return "skip: boolean expected"; + return null; + }; + + /** + * Creates a Tablet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.Tablet + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.Tablet} Tablet + */ + Tablet.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.Tablet) + return object; + var message = new $root.google.spanner.v1.Tablet(); + if (object.tabletUid != null) + if ($util.Long) + (message.tabletUid = $util.Long.fromValue(object.tabletUid)).unsigned = true; + else if (typeof object.tabletUid === "string") + message.tabletUid = parseInt(object.tabletUid, 10); + else if (typeof object.tabletUid === "number") + message.tabletUid = object.tabletUid; + else if (typeof object.tabletUid === "object") + message.tabletUid = new $util.LongBits(object.tabletUid.low >>> 0, object.tabletUid.high >>> 0).toNumber(true); + if (object.serverAddress != null) + message.serverAddress = String(object.serverAddress); + if (object.location != null) + message.location = String(object.location); + switch (object.role) { + default: + if (typeof object.role === "number") { + message.role = object.role; + break; + } + break; + case "ROLE_UNSPECIFIED": + case 0: + message.role = 0; + break; + case "READ_WRITE": + case 1: + message.role = 1; + break; + case "READ_ONLY": + case 2: + message.role = 2; + break; + } + if (object.incarnation != null) + if (typeof object.incarnation === "string") + $util.base64.decode(object.incarnation, message.incarnation = $util.newBuffer($util.base64.length(object.incarnation)), 0); + else if (object.incarnation.length >= 0) + message.incarnation = object.incarnation; + if (object.distance != null) + message.distance = object.distance >>> 0; + if (object.skip != null) + message.skip = Boolean(object.skip); + return message; + }; + + /** + * Creates a plain object from a Tablet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.Tablet + * @static + * @param {google.spanner.v1.Tablet} message Tablet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Tablet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.tabletUid = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.tabletUid = options.longs === String ? "0" : 0; + object.serverAddress = ""; + object.location = ""; + object.role = options.enums === String ? "ROLE_UNSPECIFIED" : 0; + if (options.bytes === String) + object.incarnation = ""; + else { + object.incarnation = []; + if (options.bytes !== Array) + object.incarnation = $util.newBuffer(object.incarnation); + } + object.distance = 0; + object.skip = false; + } + if (message.tabletUid != null && message.hasOwnProperty("tabletUid")) + if (typeof message.tabletUid === "number") + object.tabletUid = options.longs === String ? String(message.tabletUid) : message.tabletUid; + else + object.tabletUid = options.longs === String ? $util.Long.prototype.toString.call(message.tabletUid) : options.longs === Number ? new $util.LongBits(message.tabletUid.low >>> 0, message.tabletUid.high >>> 0).toNumber(true) : message.tabletUid; + if (message.serverAddress != null && message.hasOwnProperty("serverAddress")) + object.serverAddress = message.serverAddress; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + if (message.role != null && message.hasOwnProperty("role")) + object.role = options.enums === String ? $root.google.spanner.v1.Tablet.Role[message.role] === undefined ? message.role : $root.google.spanner.v1.Tablet.Role[message.role] : message.role; + if (message.incarnation != null && message.hasOwnProperty("incarnation")) + object.incarnation = options.bytes === String ? $util.base64.encode(message.incarnation, 0, message.incarnation.length) : options.bytes === Array ? Array.prototype.slice.call(message.incarnation) : message.incarnation; + if (message.distance != null && message.hasOwnProperty("distance")) + object.distance = message.distance; + if (message.skip != null && message.hasOwnProperty("skip")) + object.skip = message.skip; + return object; + }; + + /** + * Converts this Tablet to JSON. + * @function toJSON + * @memberof google.spanner.v1.Tablet + * @instance + * @returns {Object.} JSON object + */ + Tablet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Tablet + * @function getTypeUrl + * @memberof google.spanner.v1.Tablet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Tablet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.Tablet"; + }; + + /** + * Role enum. + * @name google.spanner.v1.Tablet.Role + * @enum {number} + * @property {number} ROLE_UNSPECIFIED=0 ROLE_UNSPECIFIED value + * @property {number} READ_WRITE=1 READ_WRITE value + * @property {number} READ_ONLY=2 READ_ONLY value + */ + Tablet.Role = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ROLE_UNSPECIFIED"] = 0; + values[valuesById[1] = "READ_WRITE"] = 1; + values[valuesById[2] = "READ_ONLY"] = 2; + return values; + })(); + + return Tablet; + })(); + + v1.Group = (function() { + + /** + * Properties of a Group. + * @memberof google.spanner.v1 + * @interface IGroup + * @property {number|Long|null} [groupUid] Group groupUid + * @property {Array.|null} [tablets] Group tablets + * @property {number|null} [leaderIndex] Group leaderIndex + * @property {Uint8Array|null} [generation] Group generation + */ + + /** + * Constructs a new Group. + * @memberof google.spanner.v1 + * @classdesc Represents a Group. + * @implements IGroup + * @constructor + * @param {google.spanner.v1.IGroup=} [properties] Properties to set + */ + function Group(properties) { + this.tablets = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Group groupUid. + * @member {number|Long} groupUid + * @memberof google.spanner.v1.Group + * @instance + */ + Group.prototype.groupUid = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Group tablets. + * @member {Array.} tablets + * @memberof google.spanner.v1.Group + * @instance + */ + Group.prototype.tablets = $util.emptyArray; + + /** + * Group leaderIndex. + * @member {number} leaderIndex + * @memberof google.spanner.v1.Group + * @instance + */ + Group.prototype.leaderIndex = 0; + + /** + * Group generation. + * @member {Uint8Array} generation + * @memberof google.spanner.v1.Group + * @instance + */ + Group.prototype.generation = $util.newBuffer([]); + + /** + * Creates a new Group instance using the specified properties. + * @function create + * @memberof google.spanner.v1.Group + * @static + * @param {google.spanner.v1.IGroup=} [properties] Properties to set + * @returns {google.spanner.v1.Group} Group instance + */ + Group.create = function create(properties) { + return new Group(properties); + }; + + /** + * Encodes the specified Group message. Does not implicitly {@link google.spanner.v1.Group.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.Group + * @static + * @param {google.spanner.v1.IGroup} message Group message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Group.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.groupUid != null && Object.hasOwnProperty.call(message, "groupUid")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.groupUid); + if (message.tablets != null && message.tablets.length) + for (var i = 0; i < message.tablets.length; ++i) + $root.google.spanner.v1.Tablet.encode(message.tablets[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.leaderIndex != null && Object.hasOwnProperty.call(message, "leaderIndex")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.leaderIndex); + if (message.generation != null && Object.hasOwnProperty.call(message, "generation")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.generation); + return writer; + }; + + /** + * Encodes the specified Group message, length delimited. Does not implicitly {@link google.spanner.v1.Group.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.Group + * @static + * @param {google.spanner.v1.IGroup} message Group message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Group.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Group message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.Group + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.Group} Group + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Group.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.Group(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.groupUid = reader.uint64(); + break; + } + case 2: { + if (!(message.tablets && message.tablets.length)) + message.tablets = []; + message.tablets.push($root.google.spanner.v1.Tablet.decode(reader, reader.uint32())); + break; + } + case 3: { + message.leaderIndex = reader.int32(); + break; + } + case 4: { + message.generation = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Group message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.Group + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.Group} Group + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Group.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Group message. + * @function verify + * @memberof google.spanner.v1.Group + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Group.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.groupUid != null && message.hasOwnProperty("groupUid")) + if (!$util.isInteger(message.groupUid) && !(message.groupUid && $util.isInteger(message.groupUid.low) && $util.isInteger(message.groupUid.high))) + return "groupUid: integer|Long expected"; + if (message.tablets != null && message.hasOwnProperty("tablets")) { + if (!Array.isArray(message.tablets)) + return "tablets: array expected"; + for (var i = 0; i < message.tablets.length; ++i) { + var error = $root.google.spanner.v1.Tablet.verify(message.tablets[i]); + if (error) + return "tablets." + error; + } + } + if (message.leaderIndex != null && message.hasOwnProperty("leaderIndex")) + if (!$util.isInteger(message.leaderIndex)) + return "leaderIndex: integer expected"; + if (message.generation != null && message.hasOwnProperty("generation")) + if (!(message.generation && typeof message.generation.length === "number" || $util.isString(message.generation))) + return "generation: buffer expected"; + return null; + }; + + /** + * Creates a Group message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.Group + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.Group} Group + */ + Group.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.Group) + return object; + var message = new $root.google.spanner.v1.Group(); + if (object.groupUid != null) + if ($util.Long) + (message.groupUid = $util.Long.fromValue(object.groupUid)).unsigned = true; + else if (typeof object.groupUid === "string") + message.groupUid = parseInt(object.groupUid, 10); + else if (typeof object.groupUid === "number") + message.groupUid = object.groupUid; + else if (typeof object.groupUid === "object") + message.groupUid = new $util.LongBits(object.groupUid.low >>> 0, object.groupUid.high >>> 0).toNumber(true); + if (object.tablets) { + if (!Array.isArray(object.tablets)) + throw TypeError(".google.spanner.v1.Group.tablets: array expected"); + message.tablets = []; + for (var i = 0; i < object.tablets.length; ++i) { + if (typeof object.tablets[i] !== "object") + throw TypeError(".google.spanner.v1.Group.tablets: object expected"); + message.tablets[i] = $root.google.spanner.v1.Tablet.fromObject(object.tablets[i]); + } + } + if (object.leaderIndex != null) + message.leaderIndex = object.leaderIndex | 0; + if (object.generation != null) + if (typeof object.generation === "string") + $util.base64.decode(object.generation, message.generation = $util.newBuffer($util.base64.length(object.generation)), 0); + else if (object.generation.length >= 0) + message.generation = object.generation; + return message; + }; + + /** + * Creates a plain object from a Group message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.Group + * @static + * @param {google.spanner.v1.Group} message Group + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Group.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.tablets = []; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.groupUid = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.groupUid = options.longs === String ? "0" : 0; + object.leaderIndex = 0; + if (options.bytes === String) + object.generation = ""; + else { + object.generation = []; + if (options.bytes !== Array) + object.generation = $util.newBuffer(object.generation); + } + } + if (message.groupUid != null && message.hasOwnProperty("groupUid")) + if (typeof message.groupUid === "number") + object.groupUid = options.longs === String ? String(message.groupUid) : message.groupUid; + else + object.groupUid = options.longs === String ? $util.Long.prototype.toString.call(message.groupUid) : options.longs === Number ? new $util.LongBits(message.groupUid.low >>> 0, message.groupUid.high >>> 0).toNumber(true) : message.groupUid; + if (message.tablets && message.tablets.length) { + object.tablets = []; + for (var j = 0; j < message.tablets.length; ++j) + object.tablets[j] = $root.google.spanner.v1.Tablet.toObject(message.tablets[j], options); + } + if (message.leaderIndex != null && message.hasOwnProperty("leaderIndex")) + object.leaderIndex = message.leaderIndex; + if (message.generation != null && message.hasOwnProperty("generation")) + object.generation = options.bytes === String ? $util.base64.encode(message.generation, 0, message.generation.length) : options.bytes === Array ? Array.prototype.slice.call(message.generation) : message.generation; + return object; + }; + + /** + * Converts this Group to JSON. + * @function toJSON + * @memberof google.spanner.v1.Group + * @instance + * @returns {Object.} JSON object + */ + Group.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Group + * @function getTypeUrl + * @memberof google.spanner.v1.Group + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Group.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.Group"; + }; + + return Group; + })(); + + v1.KeyRecipe = (function() { + + /** + * Properties of a KeyRecipe. + * @memberof google.spanner.v1 + * @interface IKeyRecipe + * @property {string|null} [tableName] KeyRecipe tableName + * @property {string|null} [indexName] KeyRecipe indexName + * @property {number|Long|null} [operationUid] KeyRecipe operationUid + * @property {Array.|null} [part] KeyRecipe part + */ + + /** + * Constructs a new KeyRecipe. + * @memberof google.spanner.v1 + * @classdesc Represents a KeyRecipe. + * @implements IKeyRecipe + * @constructor + * @param {google.spanner.v1.IKeyRecipe=} [properties] Properties to set + */ + function KeyRecipe(properties) { + this.part = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * KeyRecipe tableName. + * @member {string|null|undefined} tableName + * @memberof google.spanner.v1.KeyRecipe + * @instance + */ + KeyRecipe.prototype.tableName = null; + + /** + * KeyRecipe indexName. + * @member {string|null|undefined} indexName + * @memberof google.spanner.v1.KeyRecipe + * @instance + */ + KeyRecipe.prototype.indexName = null; + + /** + * KeyRecipe operationUid. + * @member {number|Long|null|undefined} operationUid + * @memberof google.spanner.v1.KeyRecipe + * @instance + */ + KeyRecipe.prototype.operationUid = null; + + /** + * KeyRecipe part. + * @member {Array.} part + * @memberof google.spanner.v1.KeyRecipe + * @instance + */ + KeyRecipe.prototype.part = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * KeyRecipe target. + * @member {"tableName"|"indexName"|"operationUid"|undefined} target + * @memberof google.spanner.v1.KeyRecipe + * @instance + */ + Object.defineProperty(KeyRecipe.prototype, "target", { + get: $util.oneOfGetter($oneOfFields = ["tableName", "indexName", "operationUid"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new KeyRecipe instance using the specified properties. + * @function create + * @memberof google.spanner.v1.KeyRecipe + * @static + * @param {google.spanner.v1.IKeyRecipe=} [properties] Properties to set + * @returns {google.spanner.v1.KeyRecipe} KeyRecipe instance + */ + KeyRecipe.create = function create(properties) { + return new KeyRecipe(properties); + }; + + /** + * Encodes the specified KeyRecipe message. Does not implicitly {@link google.spanner.v1.KeyRecipe.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.KeyRecipe + * @static + * @param {google.spanner.v1.IKeyRecipe} message KeyRecipe message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyRecipe.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tableName != null && Object.hasOwnProperty.call(message, "tableName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.tableName); + if (message.indexName != null && Object.hasOwnProperty.call(message, "indexName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.indexName); + if (message.operationUid != null && Object.hasOwnProperty.call(message, "operationUid")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.operationUid); + if (message.part != null && message.part.length) + for (var i = 0; i < message.part.length; ++i) + $root.google.spanner.v1.KeyRecipe.Part.encode(message.part[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified KeyRecipe message, length delimited. Does not implicitly {@link google.spanner.v1.KeyRecipe.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.KeyRecipe + * @static + * @param {google.spanner.v1.IKeyRecipe} message KeyRecipe message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyRecipe.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a KeyRecipe message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.KeyRecipe + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.KeyRecipe} KeyRecipe + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyRecipe.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.KeyRecipe(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.tableName = reader.string(); + break; + } + case 2: { + message.indexName = reader.string(); + break; + } + case 3: { + message.operationUid = reader.uint64(); + break; + } + case 4: { + if (!(message.part && message.part.length)) + message.part = []; + message.part.push($root.google.spanner.v1.KeyRecipe.Part.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a KeyRecipe message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.KeyRecipe + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.KeyRecipe} KeyRecipe + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyRecipe.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a KeyRecipe message. + * @function verify + * @memberof google.spanner.v1.KeyRecipe + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + KeyRecipe.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.tableName != null && message.hasOwnProperty("tableName")) { + properties.target = 1; + if (!$util.isString(message.tableName)) + return "tableName: string expected"; + } + if (message.indexName != null && message.hasOwnProperty("indexName")) { + if (properties.target === 1) + return "target: multiple values"; + properties.target = 1; + if (!$util.isString(message.indexName)) + return "indexName: string expected"; + } + if (message.operationUid != null && message.hasOwnProperty("operationUid")) { + if (properties.target === 1) + return "target: multiple values"; + properties.target = 1; + if (!$util.isInteger(message.operationUid) && !(message.operationUid && $util.isInteger(message.operationUid.low) && $util.isInteger(message.operationUid.high))) + return "operationUid: integer|Long expected"; + } + if (message.part != null && message.hasOwnProperty("part")) { + if (!Array.isArray(message.part)) + return "part: array expected"; + for (var i = 0; i < message.part.length; ++i) { + var error = $root.google.spanner.v1.KeyRecipe.Part.verify(message.part[i]); + if (error) + return "part." + error; + } + } + return null; + }; + + /** + * Creates a KeyRecipe message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.KeyRecipe + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.KeyRecipe} KeyRecipe + */ + KeyRecipe.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.KeyRecipe) + return object; + var message = new $root.google.spanner.v1.KeyRecipe(); + if (object.tableName != null) + message.tableName = String(object.tableName); + if (object.indexName != null) + message.indexName = String(object.indexName); + if (object.operationUid != null) + if ($util.Long) + (message.operationUid = $util.Long.fromValue(object.operationUid)).unsigned = true; + else if (typeof object.operationUid === "string") + message.operationUid = parseInt(object.operationUid, 10); + else if (typeof object.operationUid === "number") + message.operationUid = object.operationUid; + else if (typeof object.operationUid === "object") + message.operationUid = new $util.LongBits(object.operationUid.low >>> 0, object.operationUid.high >>> 0).toNumber(true); + if (object.part) { + if (!Array.isArray(object.part)) + throw TypeError(".google.spanner.v1.KeyRecipe.part: array expected"); + message.part = []; + for (var i = 0; i < object.part.length; ++i) { + if (typeof object.part[i] !== "object") + throw TypeError(".google.spanner.v1.KeyRecipe.part: object expected"); + message.part[i] = $root.google.spanner.v1.KeyRecipe.Part.fromObject(object.part[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a KeyRecipe message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.KeyRecipe + * @static + * @param {google.spanner.v1.KeyRecipe} message KeyRecipe + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + KeyRecipe.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.part = []; + if (message.tableName != null && message.hasOwnProperty("tableName")) { + object.tableName = message.tableName; + if (options.oneofs) + object.target = "tableName"; + } + if (message.indexName != null && message.hasOwnProperty("indexName")) { + object.indexName = message.indexName; + if (options.oneofs) + object.target = "indexName"; + } + if (message.operationUid != null && message.hasOwnProperty("operationUid")) { + if (typeof message.operationUid === "number") + object.operationUid = options.longs === String ? String(message.operationUid) : message.operationUid; + else + object.operationUid = options.longs === String ? $util.Long.prototype.toString.call(message.operationUid) : options.longs === Number ? new $util.LongBits(message.operationUid.low >>> 0, message.operationUid.high >>> 0).toNumber(true) : message.operationUid; + if (options.oneofs) + object.target = "operationUid"; + } + if (message.part && message.part.length) { + object.part = []; + for (var j = 0; j < message.part.length; ++j) + object.part[j] = $root.google.spanner.v1.KeyRecipe.Part.toObject(message.part[j], options); + } + return object; + }; + + /** + * Converts this KeyRecipe to JSON. + * @function toJSON + * @memberof google.spanner.v1.KeyRecipe + * @instance + * @returns {Object.} JSON object + */ + KeyRecipe.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for KeyRecipe + * @function getTypeUrl + * @memberof google.spanner.v1.KeyRecipe + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + KeyRecipe.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.KeyRecipe"; + }; + + KeyRecipe.Part = (function() { + + /** + * Properties of a Part. + * @memberof google.spanner.v1.KeyRecipe + * @interface IPart + * @property {number|null} [tag] Part tag + * @property {google.spanner.v1.KeyRecipe.Part.Order|null} [order] Part order + * @property {google.spanner.v1.KeyRecipe.Part.NullOrder|null} [nullOrder] Part nullOrder + * @property {google.spanner.v1.IType|null} [type] Part type + * @property {string|null} [identifier] Part identifier + * @property {google.protobuf.IValue|null} [value] Part value + * @property {boolean|null} [random] Part random + * @property {Array.|null} [structIdentifiers] Part structIdentifiers + */ + + /** + * Constructs a new Part. + * @memberof google.spanner.v1.KeyRecipe + * @classdesc Represents a Part. + * @implements IPart + * @constructor + * @param {google.spanner.v1.KeyRecipe.IPart=} [properties] Properties to set + */ + function Part(properties) { + this.structIdentifiers = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Part tag. + * @member {number} tag + * @memberof google.spanner.v1.KeyRecipe.Part + * @instance + */ + Part.prototype.tag = 0; + + /** + * Part order. + * @member {google.spanner.v1.KeyRecipe.Part.Order} order + * @memberof google.spanner.v1.KeyRecipe.Part + * @instance + */ + Part.prototype.order = 0; + + /** + * Part nullOrder. + * @member {google.spanner.v1.KeyRecipe.Part.NullOrder} nullOrder + * @memberof google.spanner.v1.KeyRecipe.Part + * @instance + */ + Part.prototype.nullOrder = 0; + + /** + * Part type. + * @member {google.spanner.v1.IType|null|undefined} type + * @memberof google.spanner.v1.KeyRecipe.Part + * @instance + */ + Part.prototype.type = null; + + /** + * Part identifier. + * @member {string|null|undefined} identifier + * @memberof google.spanner.v1.KeyRecipe.Part + * @instance + */ + Part.prototype.identifier = null; + + /** + * Part value. + * @member {google.protobuf.IValue|null|undefined} value + * @memberof google.spanner.v1.KeyRecipe.Part + * @instance + */ + Part.prototype.value = null; + + /** + * Part random. + * @member {boolean|null|undefined} random + * @memberof google.spanner.v1.KeyRecipe.Part + * @instance + */ + Part.prototype.random = null; + + /** + * Part structIdentifiers. + * @member {Array.} structIdentifiers + * @memberof google.spanner.v1.KeyRecipe.Part + * @instance + */ + Part.prototype.structIdentifiers = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Part valueType. + * @member {"identifier"|"value"|"random"|undefined} valueType + * @memberof google.spanner.v1.KeyRecipe.Part + * @instance + */ + Object.defineProperty(Part.prototype, "valueType", { + get: $util.oneOfGetter($oneOfFields = ["identifier", "value", "random"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Part instance using the specified properties. + * @function create + * @memberof google.spanner.v1.KeyRecipe.Part + * @static + * @param {google.spanner.v1.KeyRecipe.IPart=} [properties] Properties to set + * @returns {google.spanner.v1.KeyRecipe.Part} Part instance + */ + Part.create = function create(properties) { + return new Part(properties); + }; + + /** + * Encodes the specified Part message. Does not implicitly {@link google.spanner.v1.KeyRecipe.Part.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.KeyRecipe.Part + * @static + * @param {google.spanner.v1.KeyRecipe.IPart} message Part message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Part.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tag != null && Object.hasOwnProperty.call(message, "tag")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.tag); + if (message.order != null && Object.hasOwnProperty.call(message, "order")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.order); + if (message.nullOrder != null && Object.hasOwnProperty.call(message, "nullOrder")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.nullOrder); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + $root.google.spanner.v1.Type.encode(message.type, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.identifier != null && Object.hasOwnProperty.call(message, "identifier")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.identifier); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + $root.google.protobuf.Value.encode(message.value, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.structIdentifiers != null && message.structIdentifiers.length) { + writer.uint32(/* id 7, wireType 2 =*/58).fork(); + for (var i = 0; i < message.structIdentifiers.length; ++i) + writer.int32(message.structIdentifiers[i]); + writer.ldelim(); + } + if (message.random != null && Object.hasOwnProperty.call(message, "random")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.random); + return writer; + }; + + /** + * Encodes the specified Part message, length delimited. Does not implicitly {@link google.spanner.v1.KeyRecipe.Part.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.KeyRecipe.Part + * @static + * @param {google.spanner.v1.KeyRecipe.IPart} message Part message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Part.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Part message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.KeyRecipe.Part + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.KeyRecipe.Part} Part + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Part.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.KeyRecipe.Part(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.tag = reader.uint32(); + break; + } + case 2: { + message.order = reader.int32(); + break; + } + case 3: { + message.nullOrder = reader.int32(); + break; + } + case 4: { + message.type = $root.google.spanner.v1.Type.decode(reader, reader.uint32()); + break; + } + case 5: { + message.identifier = reader.string(); + break; + } + case 6: { + message.value = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + } + case 8: { + message.random = reader.bool(); + break; + } + case 7: { + if (!(message.structIdentifiers && message.structIdentifiers.length)) + message.structIdentifiers = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.structIdentifiers.push(reader.int32()); + } else + message.structIdentifiers.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Part message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.KeyRecipe.Part + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.KeyRecipe.Part} Part + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Part.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Part message. + * @function verify + * @memberof google.spanner.v1.KeyRecipe.Part + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Part.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.tag != null && message.hasOwnProperty("tag")) + if (!$util.isInteger(message.tag)) + return "tag: integer expected"; + if (message.order != null && message.hasOwnProperty("order")) + switch (message.order) { + default: + return "order: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.nullOrder != null && message.hasOwnProperty("nullOrder")) + switch (message.nullOrder) { + default: + return "nullOrder: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.type != null && message.hasOwnProperty("type")) { + var error = $root.google.spanner.v1.Type.verify(message.type); + if (error) + return "type." + error; + } + if (message.identifier != null && message.hasOwnProperty("identifier")) { + properties.valueType = 1; + if (!$util.isString(message.identifier)) + return "identifier: string expected"; + } + if (message.value != null && message.hasOwnProperty("value")) { + if (properties.valueType === 1) + return "valueType: multiple values"; + properties.valueType = 1; + { + var error = $root.google.protobuf.Value.verify(message.value); + if (error) + return "value." + error; + } + } + if (message.random != null && message.hasOwnProperty("random")) { + if (properties.valueType === 1) + return "valueType: multiple values"; + properties.valueType = 1; + if (typeof message.random !== "boolean") + return "random: boolean expected"; + } + if (message.structIdentifiers != null && message.hasOwnProperty("structIdentifiers")) { + if (!Array.isArray(message.structIdentifiers)) + return "structIdentifiers: array expected"; + for (var i = 0; i < message.structIdentifiers.length; ++i) + if (!$util.isInteger(message.structIdentifiers[i])) + return "structIdentifiers: integer[] expected"; + } + return null; + }; + + /** + * Creates a Part message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.KeyRecipe.Part + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.KeyRecipe.Part} Part + */ + Part.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.KeyRecipe.Part) + return object; + var message = new $root.google.spanner.v1.KeyRecipe.Part(); + if (object.tag != null) + message.tag = object.tag >>> 0; + switch (object.order) { + default: + if (typeof object.order === "number") { + message.order = object.order; + break; + } + break; + case "ORDER_UNSPECIFIED": + case 0: + message.order = 0; + break; + case "ASCENDING": + case 1: + message.order = 1; + break; + case "DESCENDING": + case 2: + message.order = 2; + break; + } + switch (object.nullOrder) { + default: + if (typeof object.nullOrder === "number") { + message.nullOrder = object.nullOrder; + break; + } + break; + case "NULL_ORDER_UNSPECIFIED": + case 0: + message.nullOrder = 0; + break; + case "NULLS_FIRST": + case 1: + message.nullOrder = 1; + break; + case "NULLS_LAST": + case 2: + message.nullOrder = 2; + break; + case "NOT_NULL": + case 3: + message.nullOrder = 3; + break; + } + if (object.type != null) { + if (typeof object.type !== "object") + throw TypeError(".google.spanner.v1.KeyRecipe.Part.type: object expected"); + message.type = $root.google.spanner.v1.Type.fromObject(object.type); + } + if (object.identifier != null) + message.identifier = String(object.identifier); + if (object.value != null) { + if (typeof object.value !== "object") + throw TypeError(".google.spanner.v1.KeyRecipe.Part.value: object expected"); + message.value = $root.google.protobuf.Value.fromObject(object.value); + } + if (object.random != null) + message.random = Boolean(object.random); + if (object.structIdentifiers) { + if (!Array.isArray(object.structIdentifiers)) + throw TypeError(".google.spanner.v1.KeyRecipe.Part.structIdentifiers: array expected"); + message.structIdentifiers = []; + for (var i = 0; i < object.structIdentifiers.length; ++i) + message.structIdentifiers[i] = object.structIdentifiers[i] | 0; + } + return message; + }; + + /** + * Creates a plain object from a Part message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.KeyRecipe.Part + * @static + * @param {google.spanner.v1.KeyRecipe.Part} message Part + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Part.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.structIdentifiers = []; + if (options.defaults) { + object.tag = 0; + object.order = options.enums === String ? "ORDER_UNSPECIFIED" : 0; + object.nullOrder = options.enums === String ? "NULL_ORDER_UNSPECIFIED" : 0; + object.type = null; + } + if (message.tag != null && message.hasOwnProperty("tag")) + object.tag = message.tag; + if (message.order != null && message.hasOwnProperty("order")) + object.order = options.enums === String ? $root.google.spanner.v1.KeyRecipe.Part.Order[message.order] === undefined ? message.order : $root.google.spanner.v1.KeyRecipe.Part.Order[message.order] : message.order; + if (message.nullOrder != null && message.hasOwnProperty("nullOrder")) + object.nullOrder = options.enums === String ? $root.google.spanner.v1.KeyRecipe.Part.NullOrder[message.nullOrder] === undefined ? message.nullOrder : $root.google.spanner.v1.KeyRecipe.Part.NullOrder[message.nullOrder] : message.nullOrder; + if (message.type != null && message.hasOwnProperty("type")) + object.type = $root.google.spanner.v1.Type.toObject(message.type, options); + if (message.identifier != null && message.hasOwnProperty("identifier")) { + object.identifier = message.identifier; + if (options.oneofs) + object.valueType = "identifier"; + } + if (message.value != null && message.hasOwnProperty("value")) { + object.value = $root.google.protobuf.Value.toObject(message.value, options); + if (options.oneofs) + object.valueType = "value"; + } + if (message.structIdentifiers && message.structIdentifiers.length) { + object.structIdentifiers = []; + for (var j = 0; j < message.structIdentifiers.length; ++j) + object.structIdentifiers[j] = message.structIdentifiers[j]; + } + if (message.random != null && message.hasOwnProperty("random")) { + object.random = message.random; + if (options.oneofs) + object.valueType = "random"; + } + return object; + }; + + /** + * Converts this Part to JSON. + * @function toJSON + * @memberof google.spanner.v1.KeyRecipe.Part + * @instance + * @returns {Object.} JSON object + */ + Part.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Part + * @function getTypeUrl + * @memberof google.spanner.v1.KeyRecipe.Part + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Part.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.KeyRecipe.Part"; + }; + + /** + * Order enum. + * @name google.spanner.v1.KeyRecipe.Part.Order + * @enum {number} + * @property {number} ORDER_UNSPECIFIED=0 ORDER_UNSPECIFIED value + * @property {number} ASCENDING=1 ASCENDING value + * @property {number} DESCENDING=2 DESCENDING value + */ + Part.Order = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ORDER_UNSPECIFIED"] = 0; + values[valuesById[1] = "ASCENDING"] = 1; + values[valuesById[2] = "DESCENDING"] = 2; + return values; + })(); + + /** + * NullOrder enum. + * @name google.spanner.v1.KeyRecipe.Part.NullOrder + * @enum {number} + * @property {number} NULL_ORDER_UNSPECIFIED=0 NULL_ORDER_UNSPECIFIED value + * @property {number} NULLS_FIRST=1 NULLS_FIRST value + * @property {number} NULLS_LAST=2 NULLS_LAST value + * @property {number} NOT_NULL=3 NOT_NULL value + */ + Part.NullOrder = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NULL_ORDER_UNSPECIFIED"] = 0; + values[valuesById[1] = "NULLS_FIRST"] = 1; + values[valuesById[2] = "NULLS_LAST"] = 2; + values[valuesById[3] = "NOT_NULL"] = 3; + return values; + })(); + + return Part; + })(); + + return KeyRecipe; + })(); + + v1.RecipeList = (function() { + + /** + * Properties of a RecipeList. + * @memberof google.spanner.v1 + * @interface IRecipeList + * @property {Uint8Array|null} [schemaGeneration] RecipeList schemaGeneration + * @property {Array.|null} [recipe] RecipeList recipe + */ + + /** + * Constructs a new RecipeList. + * @memberof google.spanner.v1 + * @classdesc Represents a RecipeList. + * @implements IRecipeList + * @constructor + * @param {google.spanner.v1.IRecipeList=} [properties] Properties to set + */ + function RecipeList(properties) { + this.recipe = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RecipeList schemaGeneration. + * @member {Uint8Array} schemaGeneration + * @memberof google.spanner.v1.RecipeList + * @instance + */ + RecipeList.prototype.schemaGeneration = $util.newBuffer([]); + + /** + * RecipeList recipe. + * @member {Array.} recipe + * @memberof google.spanner.v1.RecipeList + * @instance + */ + RecipeList.prototype.recipe = $util.emptyArray; + + /** + * Creates a new RecipeList instance using the specified properties. + * @function create + * @memberof google.spanner.v1.RecipeList + * @static + * @param {google.spanner.v1.IRecipeList=} [properties] Properties to set + * @returns {google.spanner.v1.RecipeList} RecipeList instance + */ + RecipeList.create = function create(properties) { + return new RecipeList(properties); + }; + + /** + * Encodes the specified RecipeList message. Does not implicitly {@link google.spanner.v1.RecipeList.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.RecipeList + * @static + * @param {google.spanner.v1.IRecipeList} message RecipeList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RecipeList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.schemaGeneration != null && Object.hasOwnProperty.call(message, "schemaGeneration")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.schemaGeneration); + if (message.recipe != null && message.recipe.length) + for (var i = 0; i < message.recipe.length; ++i) + $root.google.spanner.v1.KeyRecipe.encode(message.recipe[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RecipeList message, length delimited. Does not implicitly {@link google.spanner.v1.RecipeList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.RecipeList + * @static + * @param {google.spanner.v1.IRecipeList} message RecipeList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RecipeList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RecipeList message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.RecipeList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.RecipeList} RecipeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RecipeList.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.RecipeList(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.schemaGeneration = reader.bytes(); + break; + } + case 3: { + if (!(message.recipe && message.recipe.length)) + message.recipe = []; + message.recipe.push($root.google.spanner.v1.KeyRecipe.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RecipeList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.RecipeList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.RecipeList} RecipeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RecipeList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RecipeList message. + * @function verify + * @memberof google.spanner.v1.RecipeList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RecipeList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.schemaGeneration != null && message.hasOwnProperty("schemaGeneration")) + if (!(message.schemaGeneration && typeof message.schemaGeneration.length === "number" || $util.isString(message.schemaGeneration))) + return "schemaGeneration: buffer expected"; + if (message.recipe != null && message.hasOwnProperty("recipe")) { + if (!Array.isArray(message.recipe)) + return "recipe: array expected"; + for (var i = 0; i < message.recipe.length; ++i) { + var error = $root.google.spanner.v1.KeyRecipe.verify(message.recipe[i]); + if (error) + return "recipe." + error; + } + } + return null; + }; + + /** + * Creates a RecipeList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.RecipeList + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.RecipeList} RecipeList + */ + RecipeList.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.RecipeList) + return object; + var message = new $root.google.spanner.v1.RecipeList(); + if (object.schemaGeneration != null) + if (typeof object.schemaGeneration === "string") + $util.base64.decode(object.schemaGeneration, message.schemaGeneration = $util.newBuffer($util.base64.length(object.schemaGeneration)), 0); + else if (object.schemaGeneration.length >= 0) + message.schemaGeneration = object.schemaGeneration; + if (object.recipe) { + if (!Array.isArray(object.recipe)) + throw TypeError(".google.spanner.v1.RecipeList.recipe: array expected"); + message.recipe = []; + for (var i = 0; i < object.recipe.length; ++i) { + if (typeof object.recipe[i] !== "object") + throw TypeError(".google.spanner.v1.RecipeList.recipe: object expected"); + message.recipe[i] = $root.google.spanner.v1.KeyRecipe.fromObject(object.recipe[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a RecipeList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.RecipeList + * @static + * @param {google.spanner.v1.RecipeList} message RecipeList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RecipeList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.recipe = []; + if (options.defaults) + if (options.bytes === String) + object.schemaGeneration = ""; + else { + object.schemaGeneration = []; + if (options.bytes !== Array) + object.schemaGeneration = $util.newBuffer(object.schemaGeneration); + } + if (message.schemaGeneration != null && message.hasOwnProperty("schemaGeneration")) + object.schemaGeneration = options.bytes === String ? $util.base64.encode(message.schemaGeneration, 0, message.schemaGeneration.length) : options.bytes === Array ? Array.prototype.slice.call(message.schemaGeneration) : message.schemaGeneration; + if (message.recipe && message.recipe.length) { + object.recipe = []; + for (var j = 0; j < message.recipe.length; ++j) + object.recipe[j] = $root.google.spanner.v1.KeyRecipe.toObject(message.recipe[j], options); + } + return object; + }; + + /** + * Converts this RecipeList to JSON. + * @function toJSON + * @memberof google.spanner.v1.RecipeList + * @instance + * @returns {Object.} JSON object + */ + RecipeList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RecipeList + * @function getTypeUrl + * @memberof google.spanner.v1.RecipeList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RecipeList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.RecipeList"; + }; + + return RecipeList; + })(); + + v1.CacheUpdate = (function() { + + /** + * Properties of a CacheUpdate. + * @memberof google.spanner.v1 + * @interface ICacheUpdate + * @property {number|Long|null} [databaseId] CacheUpdate databaseId + * @property {Array.|null} [range] CacheUpdate range + * @property {Array.|null} [group] CacheUpdate group + * @property {google.spanner.v1.IRecipeList|null} [keyRecipes] CacheUpdate keyRecipes + */ + + /** + * Constructs a new CacheUpdate. + * @memberof google.spanner.v1 + * @classdesc Represents a CacheUpdate. + * @implements ICacheUpdate + * @constructor + * @param {google.spanner.v1.ICacheUpdate=} [properties] Properties to set + */ + function CacheUpdate(properties) { + this.range = []; + this.group = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CacheUpdate databaseId. + * @member {number|Long} databaseId + * @memberof google.spanner.v1.CacheUpdate + * @instance + */ + CacheUpdate.prototype.databaseId = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * CacheUpdate range. + * @member {Array.} range + * @memberof google.spanner.v1.CacheUpdate + * @instance + */ + CacheUpdate.prototype.range = $util.emptyArray; + + /** + * CacheUpdate group. + * @member {Array.} group + * @memberof google.spanner.v1.CacheUpdate + * @instance + */ + CacheUpdate.prototype.group = $util.emptyArray; + + /** + * CacheUpdate keyRecipes. + * @member {google.spanner.v1.IRecipeList|null|undefined} keyRecipes + * @memberof google.spanner.v1.CacheUpdate + * @instance + */ + CacheUpdate.prototype.keyRecipes = null; + + /** + * Creates a new CacheUpdate instance using the specified properties. + * @function create + * @memberof google.spanner.v1.CacheUpdate + * @static + * @param {google.spanner.v1.ICacheUpdate=} [properties] Properties to set + * @returns {google.spanner.v1.CacheUpdate} CacheUpdate instance + */ + CacheUpdate.create = function create(properties) { + return new CacheUpdate(properties); + }; + + /** + * Encodes the specified CacheUpdate message. Does not implicitly {@link google.spanner.v1.CacheUpdate.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.CacheUpdate + * @static + * @param {google.spanner.v1.ICacheUpdate} message CacheUpdate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CacheUpdate.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.databaseId != null && Object.hasOwnProperty.call(message, "databaseId")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.databaseId); + if (message.range != null && message.range.length) + for (var i = 0; i < message.range.length; ++i) + $root.google.spanner.v1.Range.encode(message.range[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.group != null && message.group.length) + for (var i = 0; i < message.group.length; ++i) + $root.google.spanner.v1.Group.encode(message.group[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.keyRecipes != null && Object.hasOwnProperty.call(message, "keyRecipes")) + $root.google.spanner.v1.RecipeList.encode(message.keyRecipes, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CacheUpdate message, length delimited. Does not implicitly {@link google.spanner.v1.CacheUpdate.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.CacheUpdate + * @static + * @param {google.spanner.v1.ICacheUpdate} message CacheUpdate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CacheUpdate.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CacheUpdate message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.CacheUpdate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.CacheUpdate} CacheUpdate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CacheUpdate.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.CacheUpdate(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.databaseId = reader.uint64(); + break; + } + case 2: { + if (!(message.range && message.range.length)) + message.range = []; + message.range.push($root.google.spanner.v1.Range.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.group && message.group.length)) + message.group = []; + message.group.push($root.google.spanner.v1.Group.decode(reader, reader.uint32())); + break; + } + case 5: { + message.keyRecipes = $root.google.spanner.v1.RecipeList.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CacheUpdate message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.CacheUpdate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.CacheUpdate} CacheUpdate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CacheUpdate.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CacheUpdate message. + * @function verify + * @memberof google.spanner.v1.CacheUpdate + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CacheUpdate.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.databaseId != null && message.hasOwnProperty("databaseId")) + if (!$util.isInteger(message.databaseId) && !(message.databaseId && $util.isInteger(message.databaseId.low) && $util.isInteger(message.databaseId.high))) + return "databaseId: integer|Long expected"; + if (message.range != null && message.hasOwnProperty("range")) { + if (!Array.isArray(message.range)) + return "range: array expected"; + for (var i = 0; i < message.range.length; ++i) { + var error = $root.google.spanner.v1.Range.verify(message.range[i]); + if (error) + return "range." + error; + } + } + if (message.group != null && message.hasOwnProperty("group")) { + if (!Array.isArray(message.group)) + return "group: array expected"; + for (var i = 0; i < message.group.length; ++i) { + var error = $root.google.spanner.v1.Group.verify(message.group[i]); + if (error) + return "group." + error; + } + } + if (message.keyRecipes != null && message.hasOwnProperty("keyRecipes")) { + var error = $root.google.spanner.v1.RecipeList.verify(message.keyRecipes); + if (error) + return "keyRecipes." + error; + } + return null; + }; + + /** + * Creates a CacheUpdate message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.CacheUpdate + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.CacheUpdate} CacheUpdate + */ + CacheUpdate.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.CacheUpdate) + return object; + var message = new $root.google.spanner.v1.CacheUpdate(); + if (object.databaseId != null) + if ($util.Long) + (message.databaseId = $util.Long.fromValue(object.databaseId)).unsigned = true; + else if (typeof object.databaseId === "string") + message.databaseId = parseInt(object.databaseId, 10); + else if (typeof object.databaseId === "number") + message.databaseId = object.databaseId; + else if (typeof object.databaseId === "object") + message.databaseId = new $util.LongBits(object.databaseId.low >>> 0, object.databaseId.high >>> 0).toNumber(true); + if (object.range) { + if (!Array.isArray(object.range)) + throw TypeError(".google.spanner.v1.CacheUpdate.range: array expected"); + message.range = []; + for (var i = 0; i < object.range.length; ++i) { + if (typeof object.range[i] !== "object") + throw TypeError(".google.spanner.v1.CacheUpdate.range: object expected"); + message.range[i] = $root.google.spanner.v1.Range.fromObject(object.range[i]); + } + } + if (object.group) { + if (!Array.isArray(object.group)) + throw TypeError(".google.spanner.v1.CacheUpdate.group: array expected"); + message.group = []; + for (var i = 0; i < object.group.length; ++i) { + if (typeof object.group[i] !== "object") + throw TypeError(".google.spanner.v1.CacheUpdate.group: object expected"); + message.group[i] = $root.google.spanner.v1.Group.fromObject(object.group[i]); + } + } + if (object.keyRecipes != null) { + if (typeof object.keyRecipes !== "object") + throw TypeError(".google.spanner.v1.CacheUpdate.keyRecipes: object expected"); + message.keyRecipes = $root.google.spanner.v1.RecipeList.fromObject(object.keyRecipes); + } + return message; + }; + + /** + * Creates a plain object from a CacheUpdate message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.CacheUpdate + * @static + * @param {google.spanner.v1.CacheUpdate} message CacheUpdate + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CacheUpdate.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.range = []; + object.group = []; + } + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.databaseId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.databaseId = options.longs === String ? "0" : 0; + object.keyRecipes = null; + } + if (message.databaseId != null && message.hasOwnProperty("databaseId")) + if (typeof message.databaseId === "number") + object.databaseId = options.longs === String ? String(message.databaseId) : message.databaseId; + else + object.databaseId = options.longs === String ? $util.Long.prototype.toString.call(message.databaseId) : options.longs === Number ? new $util.LongBits(message.databaseId.low >>> 0, message.databaseId.high >>> 0).toNumber(true) : message.databaseId; + if (message.range && message.range.length) { + object.range = []; + for (var j = 0; j < message.range.length; ++j) + object.range[j] = $root.google.spanner.v1.Range.toObject(message.range[j], options); + } + if (message.group && message.group.length) { + object.group = []; + for (var j = 0; j < message.group.length; ++j) + object.group[j] = $root.google.spanner.v1.Group.toObject(message.group[j], options); + } + if (message.keyRecipes != null && message.hasOwnProperty("keyRecipes")) + object.keyRecipes = $root.google.spanner.v1.RecipeList.toObject(message.keyRecipes, options); + return object; + }; + + /** + * Converts this CacheUpdate to JSON. + * @function toJSON + * @memberof google.spanner.v1.CacheUpdate + * @instance + * @returns {Object.} JSON object + */ + CacheUpdate.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CacheUpdate + * @function getTypeUrl + * @memberof google.spanner.v1.CacheUpdate + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CacheUpdate.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.CacheUpdate"; + }; + + return CacheUpdate; + })(); + + v1.RoutingHint = (function() { + + /** + * Properties of a RoutingHint. + * @memberof google.spanner.v1 + * @interface IRoutingHint + * @property {number|Long|null} [operationUid] RoutingHint operationUid + * @property {number|Long|null} [databaseId] RoutingHint databaseId + * @property {Uint8Array|null} [schemaGeneration] RoutingHint schemaGeneration + * @property {Uint8Array|null} [key] RoutingHint key + * @property {Uint8Array|null} [limitKey] RoutingHint limitKey + * @property {number|Long|null} [groupUid] RoutingHint groupUid + * @property {number|Long|null} [splitId] RoutingHint splitId + * @property {number|Long|null} [tabletUid] RoutingHint tabletUid + * @property {Array.|null} [skippedTabletUid] RoutingHint skippedTabletUid + * @property {string|null} [clientLocation] RoutingHint clientLocation + */ + + /** + * Constructs a new RoutingHint. + * @memberof google.spanner.v1 + * @classdesc Represents a RoutingHint. + * @implements IRoutingHint + * @constructor + * @param {google.spanner.v1.IRoutingHint=} [properties] Properties to set + */ + function RoutingHint(properties) { + this.skippedTabletUid = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RoutingHint operationUid. + * @member {number|Long} operationUid + * @memberof google.spanner.v1.RoutingHint + * @instance + */ + RoutingHint.prototype.operationUid = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * RoutingHint databaseId. + * @member {number|Long} databaseId + * @memberof google.spanner.v1.RoutingHint + * @instance + */ + RoutingHint.prototype.databaseId = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * RoutingHint schemaGeneration. + * @member {Uint8Array} schemaGeneration + * @memberof google.spanner.v1.RoutingHint + * @instance + */ + RoutingHint.prototype.schemaGeneration = $util.newBuffer([]); + + /** + * RoutingHint key. + * @member {Uint8Array} key + * @memberof google.spanner.v1.RoutingHint + * @instance + */ + RoutingHint.prototype.key = $util.newBuffer([]); + + /** + * RoutingHint limitKey. + * @member {Uint8Array} limitKey + * @memberof google.spanner.v1.RoutingHint + * @instance + */ + RoutingHint.prototype.limitKey = $util.newBuffer([]); + + /** + * RoutingHint groupUid. + * @member {number|Long} groupUid + * @memberof google.spanner.v1.RoutingHint + * @instance + */ + RoutingHint.prototype.groupUid = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * RoutingHint splitId. + * @member {number|Long} splitId + * @memberof google.spanner.v1.RoutingHint + * @instance + */ + RoutingHint.prototype.splitId = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * RoutingHint tabletUid. + * @member {number|Long} tabletUid + * @memberof google.spanner.v1.RoutingHint + * @instance + */ + RoutingHint.prototype.tabletUid = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * RoutingHint skippedTabletUid. + * @member {Array.} skippedTabletUid + * @memberof google.spanner.v1.RoutingHint + * @instance + */ + RoutingHint.prototype.skippedTabletUid = $util.emptyArray; + + /** + * RoutingHint clientLocation. + * @member {string} clientLocation + * @memberof google.spanner.v1.RoutingHint + * @instance + */ + RoutingHint.prototype.clientLocation = ""; + + /** + * Creates a new RoutingHint instance using the specified properties. + * @function create + * @memberof google.spanner.v1.RoutingHint + * @static + * @param {google.spanner.v1.IRoutingHint=} [properties] Properties to set + * @returns {google.spanner.v1.RoutingHint} RoutingHint instance + */ + RoutingHint.create = function create(properties) { + return new RoutingHint(properties); + }; + + /** + * Encodes the specified RoutingHint message. Does not implicitly {@link google.spanner.v1.RoutingHint.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.RoutingHint + * @static + * @param {google.spanner.v1.IRoutingHint} message RoutingHint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoutingHint.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.operationUid != null && Object.hasOwnProperty.call(message, "operationUid")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.operationUid); + if (message.databaseId != null && Object.hasOwnProperty.call(message, "databaseId")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.databaseId); + if (message.schemaGeneration != null && Object.hasOwnProperty.call(message, "schemaGeneration")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.schemaGeneration); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.key); + if (message.limitKey != null && Object.hasOwnProperty.call(message, "limitKey")) + writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.limitKey); + if (message.groupUid != null && Object.hasOwnProperty.call(message, "groupUid")) + writer.uint32(/* id 6, wireType 0 =*/48).uint64(message.groupUid); + if (message.splitId != null && Object.hasOwnProperty.call(message, "splitId")) + writer.uint32(/* id 7, wireType 0 =*/56).uint64(message.splitId); + if (message.tabletUid != null && Object.hasOwnProperty.call(message, "tabletUid")) + writer.uint32(/* id 8, wireType 0 =*/64).uint64(message.tabletUid); + if (message.skippedTabletUid != null && message.skippedTabletUid.length) + for (var i = 0; i < message.skippedTabletUid.length; ++i) + $root.google.spanner.v1.RoutingHint.SkippedTablet.encode(message.skippedTabletUid[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.clientLocation != null && Object.hasOwnProperty.call(message, "clientLocation")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.clientLocation); + return writer; + }; + + /** + * Encodes the specified RoutingHint message, length delimited. Does not implicitly {@link google.spanner.v1.RoutingHint.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.RoutingHint + * @static + * @param {google.spanner.v1.IRoutingHint} message RoutingHint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoutingHint.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RoutingHint message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.RoutingHint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.RoutingHint} RoutingHint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoutingHint.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.RoutingHint(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.operationUid = reader.uint64(); + break; + } + case 2: { + message.databaseId = reader.uint64(); + break; + } + case 3: { + message.schemaGeneration = reader.bytes(); + break; + } + case 4: { + message.key = reader.bytes(); + break; + } + case 5: { + message.limitKey = reader.bytes(); + break; + } + case 6: { + message.groupUid = reader.uint64(); + break; + } + case 7: { + message.splitId = reader.uint64(); + break; + } + case 8: { + message.tabletUid = reader.uint64(); + break; + } + case 9: { + if (!(message.skippedTabletUid && message.skippedTabletUid.length)) + message.skippedTabletUid = []; + message.skippedTabletUid.push($root.google.spanner.v1.RoutingHint.SkippedTablet.decode(reader, reader.uint32())); + break; + } + case 10: { + message.clientLocation = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RoutingHint message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.RoutingHint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.RoutingHint} RoutingHint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoutingHint.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RoutingHint message. + * @function verify + * @memberof google.spanner.v1.RoutingHint + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RoutingHint.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.operationUid != null && message.hasOwnProperty("operationUid")) + if (!$util.isInteger(message.operationUid) && !(message.operationUid && $util.isInteger(message.operationUid.low) && $util.isInteger(message.operationUid.high))) + return "operationUid: integer|Long expected"; + if (message.databaseId != null && message.hasOwnProperty("databaseId")) + if (!$util.isInteger(message.databaseId) && !(message.databaseId && $util.isInteger(message.databaseId.low) && $util.isInteger(message.databaseId.high))) + return "databaseId: integer|Long expected"; + if (message.schemaGeneration != null && message.hasOwnProperty("schemaGeneration")) + if (!(message.schemaGeneration && typeof message.schemaGeneration.length === "number" || $util.isString(message.schemaGeneration))) + return "schemaGeneration: buffer expected"; + if (message.key != null && message.hasOwnProperty("key")) + if (!(message.key && typeof message.key.length === "number" || $util.isString(message.key))) + return "key: buffer expected"; + if (message.limitKey != null && message.hasOwnProperty("limitKey")) + if (!(message.limitKey && typeof message.limitKey.length === "number" || $util.isString(message.limitKey))) + return "limitKey: buffer expected"; + if (message.groupUid != null && message.hasOwnProperty("groupUid")) + if (!$util.isInteger(message.groupUid) && !(message.groupUid && $util.isInteger(message.groupUid.low) && $util.isInteger(message.groupUid.high))) + return "groupUid: integer|Long expected"; + if (message.splitId != null && message.hasOwnProperty("splitId")) + if (!$util.isInteger(message.splitId) && !(message.splitId && $util.isInteger(message.splitId.low) && $util.isInteger(message.splitId.high))) + return "splitId: integer|Long expected"; + if (message.tabletUid != null && message.hasOwnProperty("tabletUid")) + if (!$util.isInteger(message.tabletUid) && !(message.tabletUid && $util.isInteger(message.tabletUid.low) && $util.isInteger(message.tabletUid.high))) + return "tabletUid: integer|Long expected"; + if (message.skippedTabletUid != null && message.hasOwnProperty("skippedTabletUid")) { + if (!Array.isArray(message.skippedTabletUid)) + return "skippedTabletUid: array expected"; + for (var i = 0; i < message.skippedTabletUid.length; ++i) { + var error = $root.google.spanner.v1.RoutingHint.SkippedTablet.verify(message.skippedTabletUid[i]); + if (error) + return "skippedTabletUid." + error; + } + } + if (message.clientLocation != null && message.hasOwnProperty("clientLocation")) + if (!$util.isString(message.clientLocation)) + return "clientLocation: string expected"; + return null; + }; + + /** + * Creates a RoutingHint message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.RoutingHint + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.RoutingHint} RoutingHint + */ + RoutingHint.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.RoutingHint) + return object; + var message = new $root.google.spanner.v1.RoutingHint(); + if (object.operationUid != null) + if ($util.Long) + (message.operationUid = $util.Long.fromValue(object.operationUid)).unsigned = true; + else if (typeof object.operationUid === "string") + message.operationUid = parseInt(object.operationUid, 10); + else if (typeof object.operationUid === "number") + message.operationUid = object.operationUid; + else if (typeof object.operationUid === "object") + message.operationUid = new $util.LongBits(object.operationUid.low >>> 0, object.operationUid.high >>> 0).toNumber(true); + if (object.databaseId != null) + if ($util.Long) + (message.databaseId = $util.Long.fromValue(object.databaseId)).unsigned = true; + else if (typeof object.databaseId === "string") + message.databaseId = parseInt(object.databaseId, 10); + else if (typeof object.databaseId === "number") + message.databaseId = object.databaseId; + else if (typeof object.databaseId === "object") + message.databaseId = new $util.LongBits(object.databaseId.low >>> 0, object.databaseId.high >>> 0).toNumber(true); + if (object.schemaGeneration != null) + if (typeof object.schemaGeneration === "string") + $util.base64.decode(object.schemaGeneration, message.schemaGeneration = $util.newBuffer($util.base64.length(object.schemaGeneration)), 0); + else if (object.schemaGeneration.length >= 0) + message.schemaGeneration = object.schemaGeneration; + if (object.key != null) + if (typeof object.key === "string") + $util.base64.decode(object.key, message.key = $util.newBuffer($util.base64.length(object.key)), 0); + else if (object.key.length >= 0) + message.key = object.key; + if (object.limitKey != null) + if (typeof object.limitKey === "string") + $util.base64.decode(object.limitKey, message.limitKey = $util.newBuffer($util.base64.length(object.limitKey)), 0); + else if (object.limitKey.length >= 0) + message.limitKey = object.limitKey; + if (object.groupUid != null) + if ($util.Long) + (message.groupUid = $util.Long.fromValue(object.groupUid)).unsigned = true; + else if (typeof object.groupUid === "string") + message.groupUid = parseInt(object.groupUid, 10); + else if (typeof object.groupUid === "number") + message.groupUid = object.groupUid; + else if (typeof object.groupUid === "object") + message.groupUid = new $util.LongBits(object.groupUid.low >>> 0, object.groupUid.high >>> 0).toNumber(true); + if (object.splitId != null) + if ($util.Long) + (message.splitId = $util.Long.fromValue(object.splitId)).unsigned = true; + else if (typeof object.splitId === "string") + message.splitId = parseInt(object.splitId, 10); + else if (typeof object.splitId === "number") + message.splitId = object.splitId; + else if (typeof object.splitId === "object") + message.splitId = new $util.LongBits(object.splitId.low >>> 0, object.splitId.high >>> 0).toNumber(true); + if (object.tabletUid != null) + if ($util.Long) + (message.tabletUid = $util.Long.fromValue(object.tabletUid)).unsigned = true; + else if (typeof object.tabletUid === "string") + message.tabletUid = parseInt(object.tabletUid, 10); + else if (typeof object.tabletUid === "number") + message.tabletUid = object.tabletUid; + else if (typeof object.tabletUid === "object") + message.tabletUid = new $util.LongBits(object.tabletUid.low >>> 0, object.tabletUid.high >>> 0).toNumber(true); + if (object.skippedTabletUid) { + if (!Array.isArray(object.skippedTabletUid)) + throw TypeError(".google.spanner.v1.RoutingHint.skippedTabletUid: array expected"); + message.skippedTabletUid = []; + for (var i = 0; i < object.skippedTabletUid.length; ++i) { + if (typeof object.skippedTabletUid[i] !== "object") + throw TypeError(".google.spanner.v1.RoutingHint.skippedTabletUid: object expected"); + message.skippedTabletUid[i] = $root.google.spanner.v1.RoutingHint.SkippedTablet.fromObject(object.skippedTabletUid[i]); + } + } + if (object.clientLocation != null) + message.clientLocation = String(object.clientLocation); + return message; + }; + + /** + * Creates a plain object from a RoutingHint message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.RoutingHint + * @static + * @param {google.spanner.v1.RoutingHint} message RoutingHint + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RoutingHint.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.skippedTabletUid = []; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.operationUid = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.operationUid = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.databaseId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.databaseId = options.longs === String ? "0" : 0; + if (options.bytes === String) + object.schemaGeneration = ""; + else { + object.schemaGeneration = []; + if (options.bytes !== Array) + object.schemaGeneration = $util.newBuffer(object.schemaGeneration); + } + if (options.bytes === String) + object.key = ""; + else { + object.key = []; + if (options.bytes !== Array) + object.key = $util.newBuffer(object.key); + } + if (options.bytes === String) + object.limitKey = ""; + else { + object.limitKey = []; + if (options.bytes !== Array) + object.limitKey = $util.newBuffer(object.limitKey); + } + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.groupUid = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.groupUid = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.splitId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.splitId = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.tabletUid = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.tabletUid = options.longs === String ? "0" : 0; + object.clientLocation = ""; + } + if (message.operationUid != null && message.hasOwnProperty("operationUid")) + if (typeof message.operationUid === "number") + object.operationUid = options.longs === String ? String(message.operationUid) : message.operationUid; + else + object.operationUid = options.longs === String ? $util.Long.prototype.toString.call(message.operationUid) : options.longs === Number ? new $util.LongBits(message.operationUid.low >>> 0, message.operationUid.high >>> 0).toNumber(true) : message.operationUid; + if (message.databaseId != null && message.hasOwnProperty("databaseId")) + if (typeof message.databaseId === "number") + object.databaseId = options.longs === String ? String(message.databaseId) : message.databaseId; + else + object.databaseId = options.longs === String ? $util.Long.prototype.toString.call(message.databaseId) : options.longs === Number ? new $util.LongBits(message.databaseId.low >>> 0, message.databaseId.high >>> 0).toNumber(true) : message.databaseId; + if (message.schemaGeneration != null && message.hasOwnProperty("schemaGeneration")) + object.schemaGeneration = options.bytes === String ? $util.base64.encode(message.schemaGeneration, 0, message.schemaGeneration.length) : options.bytes === Array ? Array.prototype.slice.call(message.schemaGeneration) : message.schemaGeneration; + if (message.key != null && message.hasOwnProperty("key")) + object.key = options.bytes === String ? $util.base64.encode(message.key, 0, message.key.length) : options.bytes === Array ? Array.prototype.slice.call(message.key) : message.key; + if (message.limitKey != null && message.hasOwnProperty("limitKey")) + object.limitKey = options.bytes === String ? $util.base64.encode(message.limitKey, 0, message.limitKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.limitKey) : message.limitKey; + if (message.groupUid != null && message.hasOwnProperty("groupUid")) + if (typeof message.groupUid === "number") + object.groupUid = options.longs === String ? String(message.groupUid) : message.groupUid; + else + object.groupUid = options.longs === String ? $util.Long.prototype.toString.call(message.groupUid) : options.longs === Number ? new $util.LongBits(message.groupUid.low >>> 0, message.groupUid.high >>> 0).toNumber(true) : message.groupUid; + if (message.splitId != null && message.hasOwnProperty("splitId")) + if (typeof message.splitId === "number") + object.splitId = options.longs === String ? String(message.splitId) : message.splitId; + else + object.splitId = options.longs === String ? $util.Long.prototype.toString.call(message.splitId) : options.longs === Number ? new $util.LongBits(message.splitId.low >>> 0, message.splitId.high >>> 0).toNumber(true) : message.splitId; + if (message.tabletUid != null && message.hasOwnProperty("tabletUid")) + if (typeof message.tabletUid === "number") + object.tabletUid = options.longs === String ? String(message.tabletUid) : message.tabletUid; + else + object.tabletUid = options.longs === String ? $util.Long.prototype.toString.call(message.tabletUid) : options.longs === Number ? new $util.LongBits(message.tabletUid.low >>> 0, message.tabletUid.high >>> 0).toNumber(true) : message.tabletUid; + if (message.skippedTabletUid && message.skippedTabletUid.length) { + object.skippedTabletUid = []; + for (var j = 0; j < message.skippedTabletUid.length; ++j) + object.skippedTabletUid[j] = $root.google.spanner.v1.RoutingHint.SkippedTablet.toObject(message.skippedTabletUid[j], options); + } + if (message.clientLocation != null && message.hasOwnProperty("clientLocation")) + object.clientLocation = message.clientLocation; + return object; + }; + + /** + * Converts this RoutingHint to JSON. + * @function toJSON + * @memberof google.spanner.v1.RoutingHint + * @instance + * @returns {Object.} JSON object + */ + RoutingHint.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RoutingHint + * @function getTypeUrl + * @memberof google.spanner.v1.RoutingHint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RoutingHint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.RoutingHint"; + }; + + RoutingHint.SkippedTablet = (function() { + + /** + * Properties of a SkippedTablet. + * @memberof google.spanner.v1.RoutingHint + * @interface ISkippedTablet + * @property {number|Long|null} [tabletUid] SkippedTablet tabletUid + * @property {Uint8Array|null} [incarnation] SkippedTablet incarnation + */ + + /** + * Constructs a new SkippedTablet. + * @memberof google.spanner.v1.RoutingHint + * @classdesc Represents a SkippedTablet. + * @implements ISkippedTablet + * @constructor + * @param {google.spanner.v1.RoutingHint.ISkippedTablet=} [properties] Properties to set + */ + function SkippedTablet(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SkippedTablet tabletUid. + * @member {number|Long} tabletUid + * @memberof google.spanner.v1.RoutingHint.SkippedTablet + * @instance + */ + SkippedTablet.prototype.tabletUid = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * SkippedTablet incarnation. + * @member {Uint8Array} incarnation + * @memberof google.spanner.v1.RoutingHint.SkippedTablet + * @instance + */ + SkippedTablet.prototype.incarnation = $util.newBuffer([]); + + /** + * Creates a new SkippedTablet instance using the specified properties. + * @function create + * @memberof google.spanner.v1.RoutingHint.SkippedTablet + * @static + * @param {google.spanner.v1.RoutingHint.ISkippedTablet=} [properties] Properties to set + * @returns {google.spanner.v1.RoutingHint.SkippedTablet} SkippedTablet instance + */ + SkippedTablet.create = function create(properties) { + return new SkippedTablet(properties); + }; + + /** + * Encodes the specified SkippedTablet message. Does not implicitly {@link google.spanner.v1.RoutingHint.SkippedTablet.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.RoutingHint.SkippedTablet + * @static + * @param {google.spanner.v1.RoutingHint.ISkippedTablet} message SkippedTablet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SkippedTablet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tabletUid != null && Object.hasOwnProperty.call(message, "tabletUid")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.tabletUid); + if (message.incarnation != null && Object.hasOwnProperty.call(message, "incarnation")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.incarnation); + return writer; + }; + + /** + * Encodes the specified SkippedTablet message, length delimited. Does not implicitly {@link google.spanner.v1.RoutingHint.SkippedTablet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.RoutingHint.SkippedTablet + * @static + * @param {google.spanner.v1.RoutingHint.ISkippedTablet} message SkippedTablet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SkippedTablet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SkippedTablet message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.RoutingHint.SkippedTablet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.RoutingHint.SkippedTablet} SkippedTablet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SkippedTablet.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.RoutingHint.SkippedTablet(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.tabletUid = reader.uint64(); + break; + } + case 2: { + message.incarnation = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SkippedTablet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.RoutingHint.SkippedTablet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.RoutingHint.SkippedTablet} SkippedTablet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SkippedTablet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SkippedTablet message. + * @function verify + * @memberof google.spanner.v1.RoutingHint.SkippedTablet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SkippedTablet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tabletUid != null && message.hasOwnProperty("tabletUid")) + if (!$util.isInteger(message.tabletUid) && !(message.tabletUid && $util.isInteger(message.tabletUid.low) && $util.isInteger(message.tabletUid.high))) + return "tabletUid: integer|Long expected"; + if (message.incarnation != null && message.hasOwnProperty("incarnation")) + if (!(message.incarnation && typeof message.incarnation.length === "number" || $util.isString(message.incarnation))) + return "incarnation: buffer expected"; + return null; + }; + + /** + * Creates a SkippedTablet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.RoutingHint.SkippedTablet + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.RoutingHint.SkippedTablet} SkippedTablet + */ + SkippedTablet.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.RoutingHint.SkippedTablet) + return object; + var message = new $root.google.spanner.v1.RoutingHint.SkippedTablet(); + if (object.tabletUid != null) + if ($util.Long) + (message.tabletUid = $util.Long.fromValue(object.tabletUid)).unsigned = true; + else if (typeof object.tabletUid === "string") + message.tabletUid = parseInt(object.tabletUid, 10); + else if (typeof object.tabletUid === "number") + message.tabletUid = object.tabletUid; + else if (typeof object.tabletUid === "object") + message.tabletUid = new $util.LongBits(object.tabletUid.low >>> 0, object.tabletUid.high >>> 0).toNumber(true); + if (object.incarnation != null) + if (typeof object.incarnation === "string") + $util.base64.decode(object.incarnation, message.incarnation = $util.newBuffer($util.base64.length(object.incarnation)), 0); + else if (object.incarnation.length >= 0) + message.incarnation = object.incarnation; + return message; + }; + + /** + * Creates a plain object from a SkippedTablet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.RoutingHint.SkippedTablet + * @static + * @param {google.spanner.v1.RoutingHint.SkippedTablet} message SkippedTablet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SkippedTablet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.tabletUid = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.tabletUid = options.longs === String ? "0" : 0; + if (options.bytes === String) + object.incarnation = ""; + else { + object.incarnation = []; + if (options.bytes !== Array) + object.incarnation = $util.newBuffer(object.incarnation); + } + } + if (message.tabletUid != null && message.hasOwnProperty("tabletUid")) + if (typeof message.tabletUid === "number") + object.tabletUid = options.longs === String ? String(message.tabletUid) : message.tabletUid; + else + object.tabletUid = options.longs === String ? $util.Long.prototype.toString.call(message.tabletUid) : options.longs === Number ? new $util.LongBits(message.tabletUid.low >>> 0, message.tabletUid.high >>> 0).toNumber(true) : message.tabletUid; + if (message.incarnation != null && message.hasOwnProperty("incarnation")) + object.incarnation = options.bytes === String ? $util.base64.encode(message.incarnation, 0, message.incarnation.length) : options.bytes === Array ? Array.prototype.slice.call(message.incarnation) : message.incarnation; + return object; + }; + + /** + * Converts this SkippedTablet to JSON. + * @function toJSON + * @memberof google.spanner.v1.RoutingHint.SkippedTablet + * @instance + * @returns {Object.} JSON object + */ + SkippedTablet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SkippedTablet + * @function getTypeUrl + * @memberof google.spanner.v1.RoutingHint.SkippedTablet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SkippedTablet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.RoutingHint.SkippedTablet"; + }; + + return SkippedTablet; + })(); + + return RoutingHint; + })(); + + v1.Mutation = (function() { + + /** + * Properties of a Mutation. + * @memberof google.spanner.v1 + * @interface IMutation + * @property {google.spanner.v1.Mutation.IWrite|null} [insert] Mutation insert + * @property {google.spanner.v1.Mutation.IWrite|null} [update] Mutation update + * @property {google.spanner.v1.Mutation.IWrite|null} [insertOrUpdate] Mutation insertOrUpdate + * @property {google.spanner.v1.Mutation.IWrite|null} [replace] Mutation replace + * @property {google.spanner.v1.Mutation.IDelete|null} ["delete"] Mutation delete + * @property {google.spanner.v1.Mutation.ISend|null} [send] Mutation send + * @property {google.spanner.v1.Mutation.IAck|null} [ack] Mutation ack + */ + + /** + * Constructs a new Mutation. + * @memberof google.spanner.v1 + * @classdesc Represents a Mutation. + * @implements IMutation + * @constructor + * @param {google.spanner.v1.IMutation=} [properties] Properties to set + */ + function Mutation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Mutation insert. + * @member {google.spanner.v1.Mutation.IWrite|null|undefined} insert + * @memberof google.spanner.v1.Mutation + * @instance + */ + Mutation.prototype.insert = null; + + /** + * Mutation update. + * @member {google.spanner.v1.Mutation.IWrite|null|undefined} update + * @memberof google.spanner.v1.Mutation + * @instance + */ + Mutation.prototype.update = null; + + /** + * Mutation insertOrUpdate. + * @member {google.spanner.v1.Mutation.IWrite|null|undefined} insertOrUpdate + * @memberof google.spanner.v1.Mutation + * @instance + */ + Mutation.prototype.insertOrUpdate = null; + + /** + * Mutation replace. + * @member {google.spanner.v1.Mutation.IWrite|null|undefined} replace + * @memberof google.spanner.v1.Mutation + * @instance + */ + Mutation.prototype.replace = null; + + /** + * Mutation delete. + * @member {google.spanner.v1.Mutation.IDelete|null|undefined} delete + * @memberof google.spanner.v1.Mutation + * @instance + */ + Mutation.prototype["delete"] = null; + + /** + * Mutation send. + * @member {google.spanner.v1.Mutation.ISend|null|undefined} send + * @memberof google.spanner.v1.Mutation + * @instance + */ + Mutation.prototype.send = null; + + /** + * Mutation ack. + * @member {google.spanner.v1.Mutation.IAck|null|undefined} ack + * @memberof google.spanner.v1.Mutation + * @instance + */ + Mutation.prototype.ack = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Mutation operation. + * @member {"insert"|"update"|"insertOrUpdate"|"replace"|"delete"|"send"|"ack"|undefined} operation + * @memberof google.spanner.v1.Mutation + * @instance + */ + Object.defineProperty(Mutation.prototype, "operation", { + get: $util.oneOfGetter($oneOfFields = ["insert", "update", "insertOrUpdate", "replace", "delete", "send", "ack"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Mutation instance using the specified properties. + * @function create + * @memberof google.spanner.v1.Mutation + * @static + * @param {google.spanner.v1.IMutation=} [properties] Properties to set + * @returns {google.spanner.v1.Mutation} Mutation instance + */ + Mutation.create = function create(properties) { + return new Mutation(properties); + }; + + /** + * Encodes the specified Mutation message. Does not implicitly {@link google.spanner.v1.Mutation.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.Mutation + * @static + * @param {google.spanner.v1.IMutation} message Mutation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Mutation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.insert != null && Object.hasOwnProperty.call(message, "insert")) + $root.google.spanner.v1.Mutation.Write.encode(message.insert, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.update != null && Object.hasOwnProperty.call(message, "update")) + $root.google.spanner.v1.Mutation.Write.encode(message.update, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.insertOrUpdate != null && Object.hasOwnProperty.call(message, "insertOrUpdate")) + $root.google.spanner.v1.Mutation.Write.encode(message.insertOrUpdate, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.replace != null && Object.hasOwnProperty.call(message, "replace")) + $root.google.spanner.v1.Mutation.Write.encode(message.replace, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) + $root.google.spanner.v1.Mutation.Delete.encode(message["delete"], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.send != null && Object.hasOwnProperty.call(message, "send")) + $root.google.spanner.v1.Mutation.Send.encode(message.send, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.ack != null && Object.hasOwnProperty.call(message, "ack")) + $root.google.spanner.v1.Mutation.Ack.encode(message.ack, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Mutation message, length delimited. Does not implicitly {@link google.spanner.v1.Mutation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.Mutation + * @static + * @param {google.spanner.v1.IMutation} message Mutation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Mutation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Mutation message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.Mutation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.Mutation} Mutation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Mutation.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.Mutation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.insert = $root.google.spanner.v1.Mutation.Write.decode(reader, reader.uint32()); + break; + } + case 2: { + message.update = $root.google.spanner.v1.Mutation.Write.decode(reader, reader.uint32()); + break; + } + case 3: { + message.insertOrUpdate = $root.google.spanner.v1.Mutation.Write.decode(reader, reader.uint32()); + break; + } + case 4: { + message.replace = $root.google.spanner.v1.Mutation.Write.decode(reader, reader.uint32()); + break; + } + case 5: { + message["delete"] = $root.google.spanner.v1.Mutation.Delete.decode(reader, reader.uint32()); + break; + } + case 6: { + message.send = $root.google.spanner.v1.Mutation.Send.decode(reader, reader.uint32()); + break; + } + case 7: { + message.ack = $root.google.spanner.v1.Mutation.Ack.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Mutation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.Mutation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.Mutation} Mutation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Mutation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Mutation message. + * @function verify + * @memberof google.spanner.v1.Mutation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Mutation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.insert != null && message.hasOwnProperty("insert")) { + properties.operation = 1; + { + var error = $root.google.spanner.v1.Mutation.Write.verify(message.insert); + if (error) + return "insert." + error; + } + } + if (message.update != null && message.hasOwnProperty("update")) { + if (properties.operation === 1) + return "operation: multiple values"; + properties.operation = 1; + { + var error = $root.google.spanner.v1.Mutation.Write.verify(message.update); + if (error) + return "update." + error; + } + } + if (message.insertOrUpdate != null && message.hasOwnProperty("insertOrUpdate")) { + if (properties.operation === 1) + return "operation: multiple values"; + properties.operation = 1; + { + var error = $root.google.spanner.v1.Mutation.Write.verify(message.insertOrUpdate); + if (error) + return "insertOrUpdate." + error; + } + } + if (message.replace != null && message.hasOwnProperty("replace")) { + if (properties.operation === 1) + return "operation: multiple values"; + properties.operation = 1; + { + var error = $root.google.spanner.v1.Mutation.Write.verify(message.replace); + if (error) + return "replace." + error; + } + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + if (properties.operation === 1) + return "operation: multiple values"; + properties.operation = 1; + { + var error = $root.google.spanner.v1.Mutation.Delete.verify(message["delete"]); + if (error) + return "delete." + error; + } + } + if (message.send != null && message.hasOwnProperty("send")) { + if (properties.operation === 1) + return "operation: multiple values"; + properties.operation = 1; + { + var error = $root.google.spanner.v1.Mutation.Send.verify(message.send); + if (error) + return "send." + error; + } + } + if (message.ack != null && message.hasOwnProperty("ack")) { + if (properties.operation === 1) + return "operation: multiple values"; + properties.operation = 1; + { + var error = $root.google.spanner.v1.Mutation.Ack.verify(message.ack); + if (error) + return "ack." + error; + } + } + return null; + }; + + /** + * Creates a Mutation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.Mutation + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.Mutation} Mutation + */ + Mutation.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.Mutation) + return object; + var message = new $root.google.spanner.v1.Mutation(); + if (object.insert != null) { + if (typeof object.insert !== "object") + throw TypeError(".google.spanner.v1.Mutation.insert: object expected"); + message.insert = $root.google.spanner.v1.Mutation.Write.fromObject(object.insert); + } + if (object.update != null) { + if (typeof object.update !== "object") + throw TypeError(".google.spanner.v1.Mutation.update: object expected"); + message.update = $root.google.spanner.v1.Mutation.Write.fromObject(object.update); + } + if (object.insertOrUpdate != null) { + if (typeof object.insertOrUpdate !== "object") + throw TypeError(".google.spanner.v1.Mutation.insertOrUpdate: object expected"); + message.insertOrUpdate = $root.google.spanner.v1.Mutation.Write.fromObject(object.insertOrUpdate); + } + if (object.replace != null) { + if (typeof object.replace !== "object") + throw TypeError(".google.spanner.v1.Mutation.replace: object expected"); + message.replace = $root.google.spanner.v1.Mutation.Write.fromObject(object.replace); + } + if (object["delete"] != null) { + if (typeof object["delete"] !== "object") + throw TypeError(".google.spanner.v1.Mutation.delete: object expected"); + message["delete"] = $root.google.spanner.v1.Mutation.Delete.fromObject(object["delete"]); + } + if (object.send != null) { + if (typeof object.send !== "object") + throw TypeError(".google.spanner.v1.Mutation.send: object expected"); + message.send = $root.google.spanner.v1.Mutation.Send.fromObject(object.send); + } + if (object.ack != null) { + if (typeof object.ack !== "object") + throw TypeError(".google.spanner.v1.Mutation.ack: object expected"); + message.ack = $root.google.spanner.v1.Mutation.Ack.fromObject(object.ack); + } + return message; + }; + + /** + * Creates a plain object from a Mutation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.Mutation + * @static + * @param {google.spanner.v1.Mutation} message Mutation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Mutation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.insert != null && message.hasOwnProperty("insert")) { + object.insert = $root.google.spanner.v1.Mutation.Write.toObject(message.insert, options); + if (options.oneofs) + object.operation = "insert"; + } + if (message.update != null && message.hasOwnProperty("update")) { + object.update = $root.google.spanner.v1.Mutation.Write.toObject(message.update, options); + if (options.oneofs) + object.operation = "update"; + } + if (message.insertOrUpdate != null && message.hasOwnProperty("insertOrUpdate")) { + object.insertOrUpdate = $root.google.spanner.v1.Mutation.Write.toObject(message.insertOrUpdate, options); + if (options.oneofs) + object.operation = "insertOrUpdate"; + } + if (message.replace != null && message.hasOwnProperty("replace")) { + object.replace = $root.google.spanner.v1.Mutation.Write.toObject(message.replace, options); + if (options.oneofs) + object.operation = "replace"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + object["delete"] = $root.google.spanner.v1.Mutation.Delete.toObject(message["delete"], options); + if (options.oneofs) + object.operation = "delete"; + } + if (message.send != null && message.hasOwnProperty("send")) { + object.send = $root.google.spanner.v1.Mutation.Send.toObject(message.send, options); + if (options.oneofs) + object.operation = "send"; + } + if (message.ack != null && message.hasOwnProperty("ack")) { + object.ack = $root.google.spanner.v1.Mutation.Ack.toObject(message.ack, options); + if (options.oneofs) + object.operation = "ack"; + } + return object; + }; + + /** + * Converts this Mutation to JSON. + * @function toJSON + * @memberof google.spanner.v1.Mutation + * @instance + * @returns {Object.} JSON object + */ + Mutation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Mutation + * @function getTypeUrl + * @memberof google.spanner.v1.Mutation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Mutation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.Mutation"; + }; + + Mutation.Write = (function() { + + /** + * Properties of a Write. + * @memberof google.spanner.v1.Mutation + * @interface IWrite + * @property {string|null} [table] Write table + * @property {Array.|null} [columns] Write columns + * @property {Array.|null} [values] Write values + */ + + /** + * Constructs a new Write. + * @memberof google.spanner.v1.Mutation + * @classdesc Represents a Write. + * @implements IWrite + * @constructor + * @param {google.spanner.v1.Mutation.IWrite=} [properties] Properties to set + */ + function Write(properties) { + this.columns = []; + this.values = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Write table. + * @member {string} table + * @memberof google.spanner.v1.Mutation.Write + * @instance + */ + Write.prototype.table = ""; + + /** + * Write columns. + * @member {Array.} columns + * @memberof google.spanner.v1.Mutation.Write + * @instance + */ + Write.prototype.columns = $util.emptyArray; + + /** + * Write values. + * @member {Array.} values + * @memberof google.spanner.v1.Mutation.Write + * @instance + */ + Write.prototype.values = $util.emptyArray; + + /** + * Creates a new Write instance using the specified properties. + * @function create + * @memberof google.spanner.v1.Mutation.Write + * @static + * @param {google.spanner.v1.Mutation.IWrite=} [properties] Properties to set + * @returns {google.spanner.v1.Mutation.Write} Write instance + */ + Write.create = function create(properties) { + return new Write(properties); + }; + + /** + * Encodes the specified Write message. Does not implicitly {@link google.spanner.v1.Mutation.Write.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.Mutation.Write + * @static + * @param {google.spanner.v1.Mutation.IWrite} message Write message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Write.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.table != null && Object.hasOwnProperty.call(message, "table")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.table); + if (message.columns != null && message.columns.length) + for (var i = 0; i < message.columns.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.columns[i]); + if (message.values != null && message.values.length) + for (var i = 0; i < message.values.length; ++i) + $root.google.protobuf.ListValue.encode(message.values[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Write message, length delimited. Does not implicitly {@link google.spanner.v1.Mutation.Write.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.Mutation.Write + * @static + * @param {google.spanner.v1.Mutation.IWrite} message Write message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Write.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Write message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.Mutation.Write + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.Mutation.Write} Write + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Write.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.Mutation.Write(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.table = reader.string(); + break; + } + case 2: { + if (!(message.columns && message.columns.length)) + message.columns = []; + message.columns.push(reader.string()); + break; + } + case 3: { + if (!(message.values && message.values.length)) + message.values = []; + message.values.push($root.google.protobuf.ListValue.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Write message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.Mutation.Write + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.Mutation.Write} Write + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Write.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Write message. + * @function verify + * @memberof google.spanner.v1.Mutation.Write + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Write.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.table != null && message.hasOwnProperty("table")) + if (!$util.isString(message.table)) + return "table: string expected"; + if (message.columns != null && message.hasOwnProperty("columns")) { + if (!Array.isArray(message.columns)) + return "columns: array expected"; + for (var i = 0; i < message.columns.length; ++i) + if (!$util.isString(message.columns[i])) + return "columns: string[] expected"; + } + if (message.values != null && message.hasOwnProperty("values")) { + if (!Array.isArray(message.values)) + return "values: array expected"; + for (var i = 0; i < message.values.length; ++i) { + var error = $root.google.protobuf.ListValue.verify(message.values[i]); + if (error) + return "values." + error; + } + } + return null; + }; + + /** + * Creates a Write message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.Mutation.Write + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.Mutation.Write} Write + */ + Write.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.Mutation.Write) + return object; + var message = new $root.google.spanner.v1.Mutation.Write(); + if (object.table != null) + message.table = String(object.table); + if (object.columns) { + if (!Array.isArray(object.columns)) + throw TypeError(".google.spanner.v1.Mutation.Write.columns: array expected"); + message.columns = []; + for (var i = 0; i < object.columns.length; ++i) + message.columns[i] = String(object.columns[i]); + } + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.spanner.v1.Mutation.Write.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) { + if (typeof object.values[i] !== "object") + throw TypeError(".google.spanner.v1.Mutation.Write.values: object expected"); + message.values[i] = $root.google.protobuf.ListValue.fromObject(object.values[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Write message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.Mutation.Write + * @static + * @param {google.spanner.v1.Mutation.Write} message Write + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Write.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.columns = []; + object.values = []; + } + if (options.defaults) + object.table = ""; + if (message.table != null && message.hasOwnProperty("table")) + object.table = message.table; + if (message.columns && message.columns.length) { + object.columns = []; + for (var j = 0; j < message.columns.length; ++j) + object.columns[j] = message.columns[j]; + } + if (message.values && message.values.length) { + object.values = []; + for (var j = 0; j < message.values.length; ++j) + object.values[j] = $root.google.protobuf.ListValue.toObject(message.values[j], options); + } + return object; + }; + + /** + * Converts this Write to JSON. + * @function toJSON + * @memberof google.spanner.v1.Mutation.Write + * @instance + * @returns {Object.} JSON object + */ + Write.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Write + * @function getTypeUrl + * @memberof google.spanner.v1.Mutation.Write + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Write.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.Mutation.Write"; + }; + + return Write; + })(); + + Mutation.Delete = (function() { + + /** + * Properties of a Delete. + * @memberof google.spanner.v1.Mutation + * @interface IDelete + * @property {string|null} [table] Delete table + * @property {google.spanner.v1.IKeySet|null} [keySet] Delete keySet + */ + + /** + * Constructs a new Delete. + * @memberof google.spanner.v1.Mutation + * @classdesc Represents a Delete. + * @implements IDelete + * @constructor + * @param {google.spanner.v1.Mutation.IDelete=} [properties] Properties to set + */ + function Delete(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Delete table. + * @member {string} table + * @memberof google.spanner.v1.Mutation.Delete + * @instance + */ + Delete.prototype.table = ""; + + /** + * Delete keySet. + * @member {google.spanner.v1.IKeySet|null|undefined} keySet + * @memberof google.spanner.v1.Mutation.Delete + * @instance + */ + Delete.prototype.keySet = null; + + /** + * Creates a new Delete instance using the specified properties. + * @function create + * @memberof google.spanner.v1.Mutation.Delete + * @static + * @param {google.spanner.v1.Mutation.IDelete=} [properties] Properties to set + * @returns {google.spanner.v1.Mutation.Delete} Delete instance + */ + Delete.create = function create(properties) { + return new Delete(properties); + }; + + /** + * Encodes the specified Delete message. Does not implicitly {@link google.spanner.v1.Mutation.Delete.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.Mutation.Delete + * @static + * @param {google.spanner.v1.Mutation.IDelete} message Delete message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Delete.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.table != null && Object.hasOwnProperty.call(message, "table")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.table); + if (message.keySet != null && Object.hasOwnProperty.call(message, "keySet")) + $root.google.spanner.v1.KeySet.encode(message.keySet, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Delete message, length delimited. Does not implicitly {@link google.spanner.v1.Mutation.Delete.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.Mutation.Delete + * @static + * @param {google.spanner.v1.Mutation.IDelete} message Delete message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Delete.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Delete message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.Mutation.Delete + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.Mutation.Delete} Delete + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Delete.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.Mutation.Delete(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.table = reader.string(); + break; + } + case 2: { + message.keySet = $root.google.spanner.v1.KeySet.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Delete message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.Mutation.Delete + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.Mutation.Delete} Delete + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Delete.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Delete message. + * @function verify + * @memberof google.spanner.v1.Mutation.Delete + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Delete.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.table != null && message.hasOwnProperty("table")) + if (!$util.isString(message.table)) + return "table: string expected"; + if (message.keySet != null && message.hasOwnProperty("keySet")) { + var error = $root.google.spanner.v1.KeySet.verify(message.keySet); + if (error) + return "keySet." + error; + } + return null; + }; + + /** + * Creates a Delete message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.Mutation.Delete + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.Mutation.Delete} Delete + */ + Delete.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.Mutation.Delete) + return object; + var message = new $root.google.spanner.v1.Mutation.Delete(); + if (object.table != null) + message.table = String(object.table); + if (object.keySet != null) { + if (typeof object.keySet !== "object") + throw TypeError(".google.spanner.v1.Mutation.Delete.keySet: object expected"); + message.keySet = $root.google.spanner.v1.KeySet.fromObject(object.keySet); + } + return message; + }; + + /** + * Creates a plain object from a Delete message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.Mutation.Delete + * @static + * @param {google.spanner.v1.Mutation.Delete} message Delete + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Delete.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.table = ""; + object.keySet = null; + } + if (message.table != null && message.hasOwnProperty("table")) + object.table = message.table; + if (message.keySet != null && message.hasOwnProperty("keySet")) + object.keySet = $root.google.spanner.v1.KeySet.toObject(message.keySet, options); + return object; + }; + + /** + * Converts this Delete to JSON. + * @function toJSON + * @memberof google.spanner.v1.Mutation.Delete + * @instance + * @returns {Object.} JSON object + */ + Delete.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Delete + * @function getTypeUrl + * @memberof google.spanner.v1.Mutation.Delete + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Delete.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.Mutation.Delete"; + }; + + return Delete; + })(); + + Mutation.Send = (function() { + + /** + * Properties of a Send. + * @memberof google.spanner.v1.Mutation + * @interface ISend + * @property {string|null} [queue] Send queue + * @property {google.protobuf.IListValue|null} [key] Send key + * @property {google.protobuf.ITimestamp|null} [deliverTime] Send deliverTime + * @property {google.protobuf.IValue|null} [payload] Send payload + */ + + /** + * Constructs a new Send. + * @memberof google.spanner.v1.Mutation + * @classdesc Represents a Send. + * @implements ISend + * @constructor + * @param {google.spanner.v1.Mutation.ISend=} [properties] Properties to set + */ + function Send(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Send queue. + * @member {string} queue + * @memberof google.spanner.v1.Mutation.Send + * @instance + */ + Send.prototype.queue = ""; + + /** + * Send key. + * @member {google.protobuf.IListValue|null|undefined} key + * @memberof google.spanner.v1.Mutation.Send + * @instance + */ + Send.prototype.key = null; + + /** + * Send deliverTime. + * @member {google.protobuf.ITimestamp|null|undefined} deliverTime + * @memberof google.spanner.v1.Mutation.Send + * @instance + */ + Send.prototype.deliverTime = null; + + /** + * Send payload. + * @member {google.protobuf.IValue|null|undefined} payload + * @memberof google.spanner.v1.Mutation.Send + * @instance + */ + Send.prototype.payload = null; + + /** + * Creates a new Send instance using the specified properties. + * @function create + * @memberof google.spanner.v1.Mutation.Send + * @static + * @param {google.spanner.v1.Mutation.ISend=} [properties] Properties to set + * @returns {google.spanner.v1.Mutation.Send} Send instance + */ + Send.create = function create(properties) { + return new Send(properties); + }; + + /** + * Encodes the specified Send message. Does not implicitly {@link google.spanner.v1.Mutation.Send.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.Mutation.Send + * @static + * @param {google.spanner.v1.Mutation.ISend} message Send message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Send.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.queue != null && Object.hasOwnProperty.call(message, "queue")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.queue); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + $root.google.protobuf.ListValue.encode(message.key, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.deliverTime != null && Object.hasOwnProperty.call(message, "deliverTime")) + $root.google.protobuf.Timestamp.encode(message.deliverTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.payload != null && Object.hasOwnProperty.call(message, "payload")) + $root.google.protobuf.Value.encode(message.payload, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Send message, length delimited. Does not implicitly {@link google.spanner.v1.Mutation.Send.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.Mutation.Send + * @static + * @param {google.spanner.v1.Mutation.ISend} message Send message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Send.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Send message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.Mutation.Send + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.Mutation.Send} Send + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Send.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.Mutation.Send(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.queue = reader.string(); + break; + } + case 2: { + message.key = $root.google.protobuf.ListValue.decode(reader, reader.uint32()); + break; + } + case 3: { + message.deliverTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.payload = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Send message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.Mutation.Send + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.Mutation.Send} Send + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Send.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Send message. + * @function verify + * @memberof google.spanner.v1.Mutation.Send + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Send.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.queue != null && message.hasOwnProperty("queue")) + if (!$util.isString(message.queue)) + return "queue: string expected"; + if (message.key != null && message.hasOwnProperty("key")) { + var error = $root.google.protobuf.ListValue.verify(message.key); + if (error) + return "key." + error; + } + if (message.deliverTime != null && message.hasOwnProperty("deliverTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.deliverTime); + if (error) + return "deliverTime." + error; + } + if (message.payload != null && message.hasOwnProperty("payload")) { + var error = $root.google.protobuf.Value.verify(message.payload); + if (error) + return "payload." + error; + } + return null; + }; + + /** + * Creates a Send message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.Mutation.Send + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.Mutation.Send} Send + */ + Send.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.Mutation.Send) + return object; + var message = new $root.google.spanner.v1.Mutation.Send(); + if (object.queue != null) + message.queue = String(object.queue); + if (object.key != null) { + if (typeof object.key !== "object") + throw TypeError(".google.spanner.v1.Mutation.Send.key: object expected"); + message.key = $root.google.protobuf.ListValue.fromObject(object.key); + } + if (object.deliverTime != null) { + if (typeof object.deliverTime !== "object") + throw TypeError(".google.spanner.v1.Mutation.Send.deliverTime: object expected"); + message.deliverTime = $root.google.protobuf.Timestamp.fromObject(object.deliverTime); + } + if (object.payload != null) { + if (typeof object.payload !== "object") + throw TypeError(".google.spanner.v1.Mutation.Send.payload: object expected"); + message.payload = $root.google.protobuf.Value.fromObject(object.payload); + } + return message; + }; + + /** + * Creates a plain object from a Send message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.Mutation.Send + * @static + * @param {google.spanner.v1.Mutation.Send} message Send + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Send.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.queue = ""; + object.key = null; + object.deliverTime = null; + object.payload = null; + } + if (message.queue != null && message.hasOwnProperty("queue")) + object.queue = message.queue; + if (message.key != null && message.hasOwnProperty("key")) + object.key = $root.google.protobuf.ListValue.toObject(message.key, options); + if (message.deliverTime != null && message.hasOwnProperty("deliverTime")) + object.deliverTime = $root.google.protobuf.Timestamp.toObject(message.deliverTime, options); + if (message.payload != null && message.hasOwnProperty("payload")) + object.payload = $root.google.protobuf.Value.toObject(message.payload, options); + return object; + }; + + /** + * Converts this Send to JSON. + * @function toJSON + * @memberof google.spanner.v1.Mutation.Send + * @instance + * @returns {Object.} JSON object + */ + Send.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Send + * @function getTypeUrl + * @memberof google.spanner.v1.Mutation.Send + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Send.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.Mutation.Send"; + }; + + return Send; + })(); + + Mutation.Ack = (function() { + + /** + * Properties of an Ack. + * @memberof google.spanner.v1.Mutation + * @interface IAck + * @property {string|null} [queue] Ack queue + * @property {google.protobuf.IListValue|null} [key] Ack key + * @property {boolean|null} [ignoreNotFound] Ack ignoreNotFound + */ + + /** + * Constructs a new Ack. + * @memberof google.spanner.v1.Mutation + * @classdesc Represents an Ack. + * @implements IAck + * @constructor + * @param {google.spanner.v1.Mutation.IAck=} [properties] Properties to set + */ + function Ack(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Ack queue. + * @member {string} queue + * @memberof google.spanner.v1.Mutation.Ack + * @instance + */ + Ack.prototype.queue = ""; + + /** + * Ack key. + * @member {google.protobuf.IListValue|null|undefined} key + * @memberof google.spanner.v1.Mutation.Ack + * @instance + */ + Ack.prototype.key = null; + + /** + * Ack ignoreNotFound. + * @member {boolean} ignoreNotFound + * @memberof google.spanner.v1.Mutation.Ack + * @instance + */ + Ack.prototype.ignoreNotFound = false; + + /** + * Creates a new Ack instance using the specified properties. + * @function create + * @memberof google.spanner.v1.Mutation.Ack + * @static + * @param {google.spanner.v1.Mutation.IAck=} [properties] Properties to set + * @returns {google.spanner.v1.Mutation.Ack} Ack instance + */ + Ack.create = function create(properties) { + return new Ack(properties); + }; + + /** + * Encodes the specified Ack message. Does not implicitly {@link google.spanner.v1.Mutation.Ack.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.Mutation.Ack + * @static + * @param {google.spanner.v1.Mutation.IAck} message Ack message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Ack.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.queue != null && Object.hasOwnProperty.call(message, "queue")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.queue); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + $root.google.protobuf.ListValue.encode(message.key, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.ignoreNotFound != null && Object.hasOwnProperty.call(message, "ignoreNotFound")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.ignoreNotFound); + return writer; + }; + + /** + * Encodes the specified Ack message, length delimited. Does not implicitly {@link google.spanner.v1.Mutation.Ack.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.Mutation.Ack + * @static + * @param {google.spanner.v1.Mutation.IAck} message Ack message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Ack.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Ack message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.Mutation.Ack + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.Mutation.Ack} Ack + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Ack.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.Mutation.Ack(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.queue = reader.string(); + break; + } + case 2: { + message.key = $root.google.protobuf.ListValue.decode(reader, reader.uint32()); + break; + } + case 3: { + message.ignoreNotFound = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Ack message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.Mutation.Ack + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.Mutation.Ack} Ack + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Ack.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Ack message. + * @function verify + * @memberof google.spanner.v1.Mutation.Ack + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Ack.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.queue != null && message.hasOwnProperty("queue")) + if (!$util.isString(message.queue)) + return "queue: string expected"; + if (message.key != null && message.hasOwnProperty("key")) { + var error = $root.google.protobuf.ListValue.verify(message.key); + if (error) + return "key." + error; + } + if (message.ignoreNotFound != null && message.hasOwnProperty("ignoreNotFound")) + if (typeof message.ignoreNotFound !== "boolean") + return "ignoreNotFound: boolean expected"; + return null; + }; + + /** + * Creates an Ack message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.Mutation.Ack + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.Mutation.Ack} Ack + */ + Ack.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.Mutation.Ack) + return object; + var message = new $root.google.spanner.v1.Mutation.Ack(); + if (object.queue != null) + message.queue = String(object.queue); + if (object.key != null) { + if (typeof object.key !== "object") + throw TypeError(".google.spanner.v1.Mutation.Ack.key: object expected"); + message.key = $root.google.protobuf.ListValue.fromObject(object.key); + } + if (object.ignoreNotFound != null) + message.ignoreNotFound = Boolean(object.ignoreNotFound); + return message; + }; + + /** + * Creates a plain object from an Ack message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.Mutation.Ack + * @static + * @param {google.spanner.v1.Mutation.Ack} message Ack + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Ack.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.queue = ""; + object.key = null; + object.ignoreNotFound = false; + } + if (message.queue != null && message.hasOwnProperty("queue")) + object.queue = message.queue; + if (message.key != null && message.hasOwnProperty("key")) + object.key = $root.google.protobuf.ListValue.toObject(message.key, options); + if (message.ignoreNotFound != null && message.hasOwnProperty("ignoreNotFound")) + object.ignoreNotFound = message.ignoreNotFound; + return object; + }; + + /** + * Converts this Ack to JSON. + * @function toJSON + * @memberof google.spanner.v1.Mutation.Ack + * @instance + * @returns {Object.} JSON object + */ + Ack.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Ack + * @function getTypeUrl + * @memberof google.spanner.v1.Mutation.Ack + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Ack.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.Mutation.Ack"; + }; + + return Ack; + })(); + + return Mutation; + })(); + + v1.PlanNode = (function() { + + /** + * Properties of a PlanNode. + * @memberof google.spanner.v1 + * @interface IPlanNode + * @property {number|null} [index] PlanNode index + * @property {google.spanner.v1.PlanNode.Kind|null} [kind] PlanNode kind + * @property {string|null} [displayName] PlanNode displayName + * @property {Array.|null} [childLinks] PlanNode childLinks + * @property {google.spanner.v1.PlanNode.IShortRepresentation|null} [shortRepresentation] PlanNode shortRepresentation + * @property {google.protobuf.IStruct|null} [metadata] PlanNode metadata + * @property {google.protobuf.IStruct|null} [executionStats] PlanNode executionStats + */ + + /** + * Constructs a new PlanNode. + * @memberof google.spanner.v1 + * @classdesc Represents a PlanNode. + * @implements IPlanNode + * @constructor + * @param {google.spanner.v1.IPlanNode=} [properties] Properties to set + */ + function PlanNode(properties) { + this.childLinks = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PlanNode index. + * @member {number} index + * @memberof google.spanner.v1.PlanNode + * @instance + */ + PlanNode.prototype.index = 0; + + /** + * PlanNode kind. + * @member {google.spanner.v1.PlanNode.Kind} kind + * @memberof google.spanner.v1.PlanNode + * @instance + */ + PlanNode.prototype.kind = 0; + + /** + * PlanNode displayName. + * @member {string} displayName + * @memberof google.spanner.v1.PlanNode + * @instance + */ + PlanNode.prototype.displayName = ""; + + /** + * PlanNode childLinks. + * @member {Array.} childLinks + * @memberof google.spanner.v1.PlanNode + * @instance + */ + PlanNode.prototype.childLinks = $util.emptyArray; + + /** + * PlanNode shortRepresentation. + * @member {google.spanner.v1.PlanNode.IShortRepresentation|null|undefined} shortRepresentation + * @memberof google.spanner.v1.PlanNode + * @instance + */ + PlanNode.prototype.shortRepresentation = null; + + /** + * PlanNode metadata. + * @member {google.protobuf.IStruct|null|undefined} metadata + * @memberof google.spanner.v1.PlanNode + * @instance + */ + PlanNode.prototype.metadata = null; + + /** + * PlanNode executionStats. + * @member {google.protobuf.IStruct|null|undefined} executionStats + * @memberof google.spanner.v1.PlanNode + * @instance + */ + PlanNode.prototype.executionStats = null; + + /** + * Creates a new PlanNode instance using the specified properties. + * @function create + * @memberof google.spanner.v1.PlanNode + * @static + * @param {google.spanner.v1.IPlanNode=} [properties] Properties to set + * @returns {google.spanner.v1.PlanNode} PlanNode instance + */ + PlanNode.create = function create(properties) { + return new PlanNode(properties); + }; + + /** + * Encodes the specified PlanNode message. Does not implicitly {@link google.spanner.v1.PlanNode.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.PlanNode + * @static + * @param {google.spanner.v1.IPlanNode} message PlanNode message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PlanNode.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.index != null && Object.hasOwnProperty.call(message, "index")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.index); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.kind); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.displayName); + if (message.childLinks != null && message.childLinks.length) + for (var i = 0; i < message.childLinks.length; ++i) + $root.google.spanner.v1.PlanNode.ChildLink.encode(message.childLinks[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.shortRepresentation != null && Object.hasOwnProperty.call(message, "shortRepresentation")) + $root.google.spanner.v1.PlanNode.ShortRepresentation.encode(message.shortRepresentation, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.protobuf.Struct.encode(message.metadata, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.executionStats != null && Object.hasOwnProperty.call(message, "executionStats")) + $root.google.protobuf.Struct.encode(message.executionStats, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PlanNode message, length delimited. Does not implicitly {@link google.spanner.v1.PlanNode.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.PlanNode + * @static + * @param {google.spanner.v1.IPlanNode} message PlanNode message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PlanNode.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PlanNode message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.PlanNode + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.PlanNode} PlanNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PlanNode.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.PlanNode(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.index = reader.int32(); + break; + } + case 2: { + message.kind = reader.int32(); + break; + } + case 3: { + message.displayName = reader.string(); + break; + } + case 4: { + if (!(message.childLinks && message.childLinks.length)) + message.childLinks = []; + message.childLinks.push($root.google.spanner.v1.PlanNode.ChildLink.decode(reader, reader.uint32())); + break; + } + case 5: { + message.shortRepresentation = $root.google.spanner.v1.PlanNode.ShortRepresentation.decode(reader, reader.uint32()); + break; + } + case 6: { + message.metadata = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 7: { + message.executionStats = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PlanNode message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.PlanNode + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.PlanNode} PlanNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PlanNode.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PlanNode message. + * @function verify + * @memberof google.spanner.v1.PlanNode + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PlanNode.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.index != null && message.hasOwnProperty("index")) + if (!$util.isInteger(message.index)) + return "index: integer expected"; + if (message.kind != null && message.hasOwnProperty("kind")) + switch (message.kind) { + default: + return "kind: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.childLinks != null && message.hasOwnProperty("childLinks")) { + if (!Array.isArray(message.childLinks)) + return "childLinks: array expected"; + for (var i = 0; i < message.childLinks.length; ++i) { + var error = $root.google.spanner.v1.PlanNode.ChildLink.verify(message.childLinks[i]); + if (error) + return "childLinks." + error; + } + } + if (message.shortRepresentation != null && message.hasOwnProperty("shortRepresentation")) { + var error = $root.google.spanner.v1.PlanNode.ShortRepresentation.verify(message.shortRepresentation); + if (error) + return "shortRepresentation." + error; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.protobuf.Struct.verify(message.metadata); + if (error) + return "metadata." + error; + } + if (message.executionStats != null && message.hasOwnProperty("executionStats")) { + var error = $root.google.protobuf.Struct.verify(message.executionStats); + if (error) + return "executionStats." + error; + } + return null; + }; + + /** + * Creates a PlanNode message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.PlanNode + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.PlanNode} PlanNode + */ + PlanNode.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.PlanNode) + return object; + var message = new $root.google.spanner.v1.PlanNode(); + if (object.index != null) + message.index = object.index | 0; + switch (object.kind) { + default: + if (typeof object.kind === "number") { + message.kind = object.kind; + break; + } + break; + case "KIND_UNSPECIFIED": + case 0: + message.kind = 0; + break; + case "RELATIONAL": + case 1: + message.kind = 1; + break; + case "SCALAR": + case 2: + message.kind = 2; + break; + } + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.childLinks) { + if (!Array.isArray(object.childLinks)) + throw TypeError(".google.spanner.v1.PlanNode.childLinks: array expected"); + message.childLinks = []; + for (var i = 0; i < object.childLinks.length; ++i) { + if (typeof object.childLinks[i] !== "object") + throw TypeError(".google.spanner.v1.PlanNode.childLinks: object expected"); + message.childLinks[i] = $root.google.spanner.v1.PlanNode.ChildLink.fromObject(object.childLinks[i]); + } + } + if (object.shortRepresentation != null) { + if (typeof object.shortRepresentation !== "object") + throw TypeError(".google.spanner.v1.PlanNode.shortRepresentation: object expected"); + message.shortRepresentation = $root.google.spanner.v1.PlanNode.ShortRepresentation.fromObject(object.shortRepresentation); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.spanner.v1.PlanNode.metadata: object expected"); + message.metadata = $root.google.protobuf.Struct.fromObject(object.metadata); + } + if (object.executionStats != null) { + if (typeof object.executionStats !== "object") + throw TypeError(".google.spanner.v1.PlanNode.executionStats: object expected"); + message.executionStats = $root.google.protobuf.Struct.fromObject(object.executionStats); + } + return message; + }; + + /** + * Creates a plain object from a PlanNode message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.PlanNode + * @static + * @param {google.spanner.v1.PlanNode} message PlanNode + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PlanNode.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.childLinks = []; + if (options.defaults) { + object.index = 0; + object.kind = options.enums === String ? "KIND_UNSPECIFIED" : 0; + object.displayName = ""; + object.shortRepresentation = null; + object.metadata = null; + object.executionStats = null; + } + if (message.index != null && message.hasOwnProperty("index")) + object.index = message.index; + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = options.enums === String ? $root.google.spanner.v1.PlanNode.Kind[message.kind] === undefined ? message.kind : $root.google.spanner.v1.PlanNode.Kind[message.kind] : message.kind; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.childLinks && message.childLinks.length) { + object.childLinks = []; + for (var j = 0; j < message.childLinks.length; ++j) + object.childLinks[j] = $root.google.spanner.v1.PlanNode.ChildLink.toObject(message.childLinks[j], options); + } + if (message.shortRepresentation != null && message.hasOwnProperty("shortRepresentation")) + object.shortRepresentation = $root.google.spanner.v1.PlanNode.ShortRepresentation.toObject(message.shortRepresentation, options); + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.protobuf.Struct.toObject(message.metadata, options); + if (message.executionStats != null && message.hasOwnProperty("executionStats")) + object.executionStats = $root.google.protobuf.Struct.toObject(message.executionStats, options); + return object; + }; + + /** + * Converts this PlanNode to JSON. + * @function toJSON + * @memberof google.spanner.v1.PlanNode + * @instance + * @returns {Object.} JSON object + */ + PlanNode.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PlanNode + * @function getTypeUrl + * @memberof google.spanner.v1.PlanNode + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PlanNode.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.PlanNode"; + }; + + /** + * Kind enum. + * @name google.spanner.v1.PlanNode.Kind + * @enum {number} + * @property {number} KIND_UNSPECIFIED=0 KIND_UNSPECIFIED value + * @property {number} RELATIONAL=1 RELATIONAL value + * @property {number} SCALAR=2 SCALAR value + */ + PlanNode.Kind = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "KIND_UNSPECIFIED"] = 0; + values[valuesById[1] = "RELATIONAL"] = 1; + values[valuesById[2] = "SCALAR"] = 2; + return values; + })(); + + PlanNode.ChildLink = (function() { + + /** + * Properties of a ChildLink. + * @memberof google.spanner.v1.PlanNode + * @interface IChildLink + * @property {number|null} [childIndex] ChildLink childIndex + * @property {string|null} [type] ChildLink type + * @property {string|null} [variable] ChildLink variable + */ + + /** + * Constructs a new ChildLink. + * @memberof google.spanner.v1.PlanNode + * @classdesc Represents a ChildLink. + * @implements IChildLink + * @constructor + * @param {google.spanner.v1.PlanNode.IChildLink=} [properties] Properties to set + */ + function ChildLink(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ChildLink childIndex. + * @member {number} childIndex + * @memberof google.spanner.v1.PlanNode.ChildLink + * @instance + */ + ChildLink.prototype.childIndex = 0; + + /** + * ChildLink type. + * @member {string} type + * @memberof google.spanner.v1.PlanNode.ChildLink + * @instance + */ + ChildLink.prototype.type = ""; + + /** + * ChildLink variable. + * @member {string} variable + * @memberof google.spanner.v1.PlanNode.ChildLink + * @instance + */ + ChildLink.prototype.variable = ""; + + /** + * Creates a new ChildLink instance using the specified properties. + * @function create + * @memberof google.spanner.v1.PlanNode.ChildLink + * @static + * @param {google.spanner.v1.PlanNode.IChildLink=} [properties] Properties to set + * @returns {google.spanner.v1.PlanNode.ChildLink} ChildLink instance + */ + ChildLink.create = function create(properties) { + return new ChildLink(properties); + }; + + /** + * Encodes the specified ChildLink message. Does not implicitly {@link google.spanner.v1.PlanNode.ChildLink.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.PlanNode.ChildLink + * @static + * @param {google.spanner.v1.PlanNode.IChildLink} message ChildLink message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ChildLink.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.childIndex != null && Object.hasOwnProperty.call(message, "childIndex")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.childIndex); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.type); + if (message.variable != null && Object.hasOwnProperty.call(message, "variable")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.variable); + return writer; + }; + + /** + * Encodes the specified ChildLink message, length delimited. Does not implicitly {@link google.spanner.v1.PlanNode.ChildLink.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.PlanNode.ChildLink + * @static + * @param {google.spanner.v1.PlanNode.IChildLink} message ChildLink message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ChildLink.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ChildLink message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.PlanNode.ChildLink + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.PlanNode.ChildLink} ChildLink + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ChildLink.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.PlanNode.ChildLink(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.childIndex = reader.int32(); + break; + } + case 2: { + message.type = reader.string(); + break; + } + case 3: { + message.variable = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ChildLink message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.PlanNode.ChildLink + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.PlanNode.ChildLink} ChildLink + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ChildLink.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ChildLink message. + * @function verify + * @memberof google.spanner.v1.PlanNode.ChildLink + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ChildLink.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.childIndex != null && message.hasOwnProperty("childIndex")) + if (!$util.isInteger(message.childIndex)) + return "childIndex: integer expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.variable != null && message.hasOwnProperty("variable")) + if (!$util.isString(message.variable)) + return "variable: string expected"; + return null; + }; + + /** + * Creates a ChildLink message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.PlanNode.ChildLink + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.PlanNode.ChildLink} ChildLink + */ + ChildLink.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.PlanNode.ChildLink) + return object; + var message = new $root.google.spanner.v1.PlanNode.ChildLink(); + if (object.childIndex != null) + message.childIndex = object.childIndex | 0; + if (object.type != null) + message.type = String(object.type); + if (object.variable != null) + message.variable = String(object.variable); + return message; + }; + + /** + * Creates a plain object from a ChildLink message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.PlanNode.ChildLink + * @static + * @param {google.spanner.v1.PlanNode.ChildLink} message ChildLink + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ChildLink.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.childIndex = 0; + object.type = ""; + object.variable = ""; + } + if (message.childIndex != null && message.hasOwnProperty("childIndex")) + object.childIndex = message.childIndex; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.variable != null && message.hasOwnProperty("variable")) + object.variable = message.variable; + return object; + }; + + /** + * Converts this ChildLink to JSON. + * @function toJSON + * @memberof google.spanner.v1.PlanNode.ChildLink + * @instance + * @returns {Object.} JSON object + */ + ChildLink.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ChildLink + * @function getTypeUrl + * @memberof google.spanner.v1.PlanNode.ChildLink + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ChildLink.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.PlanNode.ChildLink"; + }; + + return ChildLink; + })(); + + PlanNode.ShortRepresentation = (function() { + + /** + * Properties of a ShortRepresentation. + * @memberof google.spanner.v1.PlanNode + * @interface IShortRepresentation + * @property {string|null} [description] ShortRepresentation description + * @property {Object.|null} [subqueries] ShortRepresentation subqueries + */ + + /** + * Constructs a new ShortRepresentation. + * @memberof google.spanner.v1.PlanNode + * @classdesc Represents a ShortRepresentation. + * @implements IShortRepresentation + * @constructor + * @param {google.spanner.v1.PlanNode.IShortRepresentation=} [properties] Properties to set + */ + function ShortRepresentation(properties) { + this.subqueries = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ShortRepresentation description. + * @member {string} description + * @memberof google.spanner.v1.PlanNode.ShortRepresentation + * @instance + */ + ShortRepresentation.prototype.description = ""; + + /** + * ShortRepresentation subqueries. + * @member {Object.} subqueries + * @memberof google.spanner.v1.PlanNode.ShortRepresentation + * @instance + */ + ShortRepresentation.prototype.subqueries = $util.emptyObject; + + /** + * Creates a new ShortRepresentation instance using the specified properties. + * @function create + * @memberof google.spanner.v1.PlanNode.ShortRepresentation + * @static + * @param {google.spanner.v1.PlanNode.IShortRepresentation=} [properties] Properties to set + * @returns {google.spanner.v1.PlanNode.ShortRepresentation} ShortRepresentation instance + */ + ShortRepresentation.create = function create(properties) { + return new ShortRepresentation(properties); + }; + + /** + * Encodes the specified ShortRepresentation message. Does not implicitly {@link google.spanner.v1.PlanNode.ShortRepresentation.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.PlanNode.ShortRepresentation + * @static + * @param {google.spanner.v1.PlanNode.IShortRepresentation} message ShortRepresentation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShortRepresentation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.description); + if (message.subqueries != null && Object.hasOwnProperty.call(message, "subqueries")) + for (var keys = Object.keys(message.subqueries), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 0 =*/16).int32(message.subqueries[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified ShortRepresentation message, length delimited. Does not implicitly {@link google.spanner.v1.PlanNode.ShortRepresentation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.PlanNode.ShortRepresentation + * @static + * @param {google.spanner.v1.PlanNode.IShortRepresentation} message ShortRepresentation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShortRepresentation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ShortRepresentation message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.PlanNode.ShortRepresentation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.PlanNode.ShortRepresentation} ShortRepresentation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShortRepresentation.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.PlanNode.ShortRepresentation(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.description = reader.string(); + break; + } + case 2: { + if (message.subqueries === $util.emptyObject) + message.subqueries = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = 0; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.int32(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.subqueries[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ShortRepresentation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.PlanNode.ShortRepresentation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.PlanNode.ShortRepresentation} ShortRepresentation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShortRepresentation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ShortRepresentation message. + * @function verify + * @memberof google.spanner.v1.PlanNode.ShortRepresentation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ShortRepresentation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.subqueries != null && message.hasOwnProperty("subqueries")) { + if (!$util.isObject(message.subqueries)) + return "subqueries: object expected"; + var key = Object.keys(message.subqueries); + for (var i = 0; i < key.length; ++i) + if (!$util.isInteger(message.subqueries[key[i]])) + return "subqueries: integer{k:string} expected"; + } + return null; + }; + + /** + * Creates a ShortRepresentation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.PlanNode.ShortRepresentation + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.PlanNode.ShortRepresentation} ShortRepresentation + */ + ShortRepresentation.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.PlanNode.ShortRepresentation) + return object; + var message = new $root.google.spanner.v1.PlanNode.ShortRepresentation(); + if (object.description != null) + message.description = String(object.description); + if (object.subqueries) { + if (typeof object.subqueries !== "object") + throw TypeError(".google.spanner.v1.PlanNode.ShortRepresentation.subqueries: object expected"); + message.subqueries = {}; + for (var keys = Object.keys(object.subqueries), i = 0; i < keys.length; ++i) + message.subqueries[keys[i]] = object.subqueries[keys[i]] | 0; + } + return message; + }; + + /** + * Creates a plain object from a ShortRepresentation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.PlanNode.ShortRepresentation + * @static + * @param {google.spanner.v1.PlanNode.ShortRepresentation} message ShortRepresentation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ShortRepresentation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.subqueries = {}; + if (options.defaults) + object.description = ""; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + var keys2; + if (message.subqueries && (keys2 = Object.keys(message.subqueries)).length) { + object.subqueries = {}; + for (var j = 0; j < keys2.length; ++j) + object.subqueries[keys2[j]] = message.subqueries[keys2[j]]; + } + return object; + }; + + /** + * Converts this ShortRepresentation to JSON. + * @function toJSON + * @memberof google.spanner.v1.PlanNode.ShortRepresentation + * @instance + * @returns {Object.} JSON object + */ + ShortRepresentation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ShortRepresentation + * @function getTypeUrl + * @memberof google.spanner.v1.PlanNode.ShortRepresentation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ShortRepresentation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.PlanNode.ShortRepresentation"; + }; + + return ShortRepresentation; + })(); + + return PlanNode; + })(); + + v1.QueryAdvisorResult = (function() { + + /** + * Properties of a QueryAdvisorResult. + * @memberof google.spanner.v1 + * @interface IQueryAdvisorResult + * @property {Array.|null} [indexAdvice] QueryAdvisorResult indexAdvice + */ + + /** + * Constructs a new QueryAdvisorResult. + * @memberof google.spanner.v1 + * @classdesc Represents a QueryAdvisorResult. + * @implements IQueryAdvisorResult + * @constructor + * @param {google.spanner.v1.IQueryAdvisorResult=} [properties] Properties to set + */ + function QueryAdvisorResult(properties) { + this.indexAdvice = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryAdvisorResult indexAdvice. + * @member {Array.} indexAdvice + * @memberof google.spanner.v1.QueryAdvisorResult + * @instance + */ + QueryAdvisorResult.prototype.indexAdvice = $util.emptyArray; + + /** + * Creates a new QueryAdvisorResult instance using the specified properties. + * @function create + * @memberof google.spanner.v1.QueryAdvisorResult + * @static + * @param {google.spanner.v1.IQueryAdvisorResult=} [properties] Properties to set + * @returns {google.spanner.v1.QueryAdvisorResult} QueryAdvisorResult instance + */ + QueryAdvisorResult.create = function create(properties) { + return new QueryAdvisorResult(properties); + }; + + /** + * Encodes the specified QueryAdvisorResult message. Does not implicitly {@link google.spanner.v1.QueryAdvisorResult.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.QueryAdvisorResult + * @static + * @param {google.spanner.v1.IQueryAdvisorResult} message QueryAdvisorResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryAdvisorResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.indexAdvice != null && message.indexAdvice.length) + for (var i = 0; i < message.indexAdvice.length; ++i) + $root.google.spanner.v1.QueryAdvisorResult.IndexAdvice.encode(message.indexAdvice[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryAdvisorResult message, length delimited. Does not implicitly {@link google.spanner.v1.QueryAdvisorResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.QueryAdvisorResult + * @static + * @param {google.spanner.v1.IQueryAdvisorResult} message QueryAdvisorResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryAdvisorResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryAdvisorResult message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.QueryAdvisorResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.QueryAdvisorResult} QueryAdvisorResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryAdvisorResult.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.QueryAdvisorResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.indexAdvice && message.indexAdvice.length)) + message.indexAdvice = []; + message.indexAdvice.push($root.google.spanner.v1.QueryAdvisorResult.IndexAdvice.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryAdvisorResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.QueryAdvisorResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.QueryAdvisorResult} QueryAdvisorResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryAdvisorResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryAdvisorResult message. + * @function verify + * @memberof google.spanner.v1.QueryAdvisorResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryAdvisorResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.indexAdvice != null && message.hasOwnProperty("indexAdvice")) { + if (!Array.isArray(message.indexAdvice)) + return "indexAdvice: array expected"; + for (var i = 0; i < message.indexAdvice.length; ++i) { + var error = $root.google.spanner.v1.QueryAdvisorResult.IndexAdvice.verify(message.indexAdvice[i]); + if (error) + return "indexAdvice." + error; + } + } + return null; + }; + + /** + * Creates a QueryAdvisorResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.QueryAdvisorResult + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.QueryAdvisorResult} QueryAdvisorResult + */ + QueryAdvisorResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.QueryAdvisorResult) + return object; + var message = new $root.google.spanner.v1.QueryAdvisorResult(); + if (object.indexAdvice) { + if (!Array.isArray(object.indexAdvice)) + throw TypeError(".google.spanner.v1.QueryAdvisorResult.indexAdvice: array expected"); + message.indexAdvice = []; + for (var i = 0; i < object.indexAdvice.length; ++i) { + if (typeof object.indexAdvice[i] !== "object") + throw TypeError(".google.spanner.v1.QueryAdvisorResult.indexAdvice: object expected"); + message.indexAdvice[i] = $root.google.spanner.v1.QueryAdvisorResult.IndexAdvice.fromObject(object.indexAdvice[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a QueryAdvisorResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.QueryAdvisorResult + * @static + * @param {google.spanner.v1.QueryAdvisorResult} message QueryAdvisorResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryAdvisorResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.indexAdvice = []; + if (message.indexAdvice && message.indexAdvice.length) { + object.indexAdvice = []; + for (var j = 0; j < message.indexAdvice.length; ++j) + object.indexAdvice[j] = $root.google.spanner.v1.QueryAdvisorResult.IndexAdvice.toObject(message.indexAdvice[j], options); + } + return object; + }; + + /** + * Converts this QueryAdvisorResult to JSON. + * @function toJSON + * @memberof google.spanner.v1.QueryAdvisorResult + * @instance + * @returns {Object.} JSON object + */ + QueryAdvisorResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for QueryAdvisorResult + * @function getTypeUrl + * @memberof google.spanner.v1.QueryAdvisorResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + QueryAdvisorResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.QueryAdvisorResult"; + }; + + QueryAdvisorResult.IndexAdvice = (function() { + + /** + * Properties of an IndexAdvice. + * @memberof google.spanner.v1.QueryAdvisorResult + * @interface IIndexAdvice + * @property {Array.|null} [ddl] IndexAdvice ddl + * @property {number|null} [improvementFactor] IndexAdvice improvementFactor + */ + + /** + * Constructs a new IndexAdvice. + * @memberof google.spanner.v1.QueryAdvisorResult + * @classdesc Represents an IndexAdvice. + * @implements IIndexAdvice + * @constructor + * @param {google.spanner.v1.QueryAdvisorResult.IIndexAdvice=} [properties] Properties to set + */ + function IndexAdvice(properties) { + this.ddl = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * IndexAdvice ddl. + * @member {Array.} ddl + * @memberof google.spanner.v1.QueryAdvisorResult.IndexAdvice + * @instance + */ + IndexAdvice.prototype.ddl = $util.emptyArray; + + /** + * IndexAdvice improvementFactor. + * @member {number} improvementFactor + * @memberof google.spanner.v1.QueryAdvisorResult.IndexAdvice + * @instance + */ + IndexAdvice.prototype.improvementFactor = 0; + + /** + * Creates a new IndexAdvice instance using the specified properties. + * @function create + * @memberof google.spanner.v1.QueryAdvisorResult.IndexAdvice + * @static + * @param {google.spanner.v1.QueryAdvisorResult.IIndexAdvice=} [properties] Properties to set + * @returns {google.spanner.v1.QueryAdvisorResult.IndexAdvice} IndexAdvice instance + */ + IndexAdvice.create = function create(properties) { + return new IndexAdvice(properties); + }; + + /** + * Encodes the specified IndexAdvice message. Does not implicitly {@link google.spanner.v1.QueryAdvisorResult.IndexAdvice.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.QueryAdvisorResult.IndexAdvice + * @static + * @param {google.spanner.v1.QueryAdvisorResult.IIndexAdvice} message IndexAdvice message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IndexAdvice.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ddl != null && message.ddl.length) + for (var i = 0; i < message.ddl.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.ddl[i]); + if (message.improvementFactor != null && Object.hasOwnProperty.call(message, "improvementFactor")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.improvementFactor); + return writer; + }; + + /** + * Encodes the specified IndexAdvice message, length delimited. Does not implicitly {@link google.spanner.v1.QueryAdvisorResult.IndexAdvice.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.QueryAdvisorResult.IndexAdvice + * @static + * @param {google.spanner.v1.QueryAdvisorResult.IIndexAdvice} message IndexAdvice message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IndexAdvice.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IndexAdvice message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.QueryAdvisorResult.IndexAdvice + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.QueryAdvisorResult.IndexAdvice} IndexAdvice + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IndexAdvice.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.QueryAdvisorResult.IndexAdvice(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.ddl && message.ddl.length)) + message.ddl = []; + message.ddl.push(reader.string()); + break; + } + case 2: { + message.improvementFactor = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IndexAdvice message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.QueryAdvisorResult.IndexAdvice + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.QueryAdvisorResult.IndexAdvice} IndexAdvice + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IndexAdvice.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IndexAdvice message. + * @function verify + * @memberof google.spanner.v1.QueryAdvisorResult.IndexAdvice + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IndexAdvice.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ddl != null && message.hasOwnProperty("ddl")) { + if (!Array.isArray(message.ddl)) + return "ddl: array expected"; + for (var i = 0; i < message.ddl.length; ++i) + if (!$util.isString(message.ddl[i])) + return "ddl: string[] expected"; + } + if (message.improvementFactor != null && message.hasOwnProperty("improvementFactor")) + if (typeof message.improvementFactor !== "number") + return "improvementFactor: number expected"; + return null; + }; + + /** + * Creates an IndexAdvice message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.QueryAdvisorResult.IndexAdvice + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.QueryAdvisorResult.IndexAdvice} IndexAdvice + */ + IndexAdvice.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.QueryAdvisorResult.IndexAdvice) + return object; + var message = new $root.google.spanner.v1.QueryAdvisorResult.IndexAdvice(); + if (object.ddl) { + if (!Array.isArray(object.ddl)) + throw TypeError(".google.spanner.v1.QueryAdvisorResult.IndexAdvice.ddl: array expected"); + message.ddl = []; + for (var i = 0; i < object.ddl.length; ++i) + message.ddl[i] = String(object.ddl[i]); + } + if (object.improvementFactor != null) + message.improvementFactor = Number(object.improvementFactor); + return message; + }; + + /** + * Creates a plain object from an IndexAdvice message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.QueryAdvisorResult.IndexAdvice + * @static + * @param {google.spanner.v1.QueryAdvisorResult.IndexAdvice} message IndexAdvice + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IndexAdvice.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.ddl = []; + if (options.defaults) + object.improvementFactor = 0; + if (message.ddl && message.ddl.length) { + object.ddl = []; + for (var j = 0; j < message.ddl.length; ++j) + object.ddl[j] = message.ddl[j]; + } + if (message.improvementFactor != null && message.hasOwnProperty("improvementFactor")) + object.improvementFactor = options.json && !isFinite(message.improvementFactor) ? String(message.improvementFactor) : message.improvementFactor; + return object; + }; + + /** + * Converts this IndexAdvice to JSON. + * @function toJSON + * @memberof google.spanner.v1.QueryAdvisorResult.IndexAdvice + * @instance + * @returns {Object.} JSON object + */ + IndexAdvice.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IndexAdvice + * @function getTypeUrl + * @memberof google.spanner.v1.QueryAdvisorResult.IndexAdvice + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IndexAdvice.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.QueryAdvisorResult.IndexAdvice"; + }; + + return IndexAdvice; + })(); + + return QueryAdvisorResult; + })(); + + v1.QueryPlan = (function() { + + /** + * Properties of a QueryPlan. + * @memberof google.spanner.v1 + * @interface IQueryPlan + * @property {Array.|null} [planNodes] QueryPlan planNodes + * @property {google.spanner.v1.IQueryAdvisorResult|null} [queryAdvice] QueryPlan queryAdvice + */ + + /** + * Constructs a new QueryPlan. + * @memberof google.spanner.v1 + * @classdesc Represents a QueryPlan. + * @implements IQueryPlan + * @constructor + * @param {google.spanner.v1.IQueryPlan=} [properties] Properties to set + */ + function QueryPlan(properties) { + this.planNodes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryPlan planNodes. + * @member {Array.} planNodes + * @memberof google.spanner.v1.QueryPlan + * @instance + */ + QueryPlan.prototype.planNodes = $util.emptyArray; + + /** + * QueryPlan queryAdvice. + * @member {google.spanner.v1.IQueryAdvisorResult|null|undefined} queryAdvice + * @memberof google.spanner.v1.QueryPlan + * @instance + */ + QueryPlan.prototype.queryAdvice = null; + + /** + * Creates a new QueryPlan instance using the specified properties. + * @function create + * @memberof google.spanner.v1.QueryPlan + * @static + * @param {google.spanner.v1.IQueryPlan=} [properties] Properties to set + * @returns {google.spanner.v1.QueryPlan} QueryPlan instance + */ + QueryPlan.create = function create(properties) { + return new QueryPlan(properties); + }; + + /** + * Encodes the specified QueryPlan message. Does not implicitly {@link google.spanner.v1.QueryPlan.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.QueryPlan + * @static + * @param {google.spanner.v1.IQueryPlan} message QueryPlan message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryPlan.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.planNodes != null && message.planNodes.length) + for (var i = 0; i < message.planNodes.length; ++i) + $root.google.spanner.v1.PlanNode.encode(message.planNodes[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.queryAdvice != null && Object.hasOwnProperty.call(message, "queryAdvice")) + $root.google.spanner.v1.QueryAdvisorResult.encode(message.queryAdvice, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryPlan message, length delimited. Does not implicitly {@link google.spanner.v1.QueryPlan.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.QueryPlan + * @static + * @param {google.spanner.v1.IQueryPlan} message QueryPlan message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryPlan.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryPlan message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.QueryPlan + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.QueryPlan} QueryPlan + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryPlan.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.QueryPlan(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.planNodes && message.planNodes.length)) + message.planNodes = []; + message.planNodes.push($root.google.spanner.v1.PlanNode.decode(reader, reader.uint32())); + break; + } + case 2: { + message.queryAdvice = $root.google.spanner.v1.QueryAdvisorResult.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryPlan message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.QueryPlan + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.QueryPlan} QueryPlan + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryPlan.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryPlan message. + * @function verify + * @memberof google.spanner.v1.QueryPlan + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryPlan.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.planNodes != null && message.hasOwnProperty("planNodes")) { + if (!Array.isArray(message.planNodes)) + return "planNodes: array expected"; + for (var i = 0; i < message.planNodes.length; ++i) { + var error = $root.google.spanner.v1.PlanNode.verify(message.planNodes[i]); + if (error) + return "planNodes." + error; + } + } + if (message.queryAdvice != null && message.hasOwnProperty("queryAdvice")) { + var error = $root.google.spanner.v1.QueryAdvisorResult.verify(message.queryAdvice); + if (error) + return "queryAdvice." + error; + } + return null; + }; + + /** + * Creates a QueryPlan message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.QueryPlan + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.QueryPlan} QueryPlan + */ + QueryPlan.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.QueryPlan) + return object; + var message = new $root.google.spanner.v1.QueryPlan(); + if (object.planNodes) { + if (!Array.isArray(object.planNodes)) + throw TypeError(".google.spanner.v1.QueryPlan.planNodes: array expected"); + message.planNodes = []; + for (var i = 0; i < object.planNodes.length; ++i) { + if (typeof object.planNodes[i] !== "object") + throw TypeError(".google.spanner.v1.QueryPlan.planNodes: object expected"); + message.planNodes[i] = $root.google.spanner.v1.PlanNode.fromObject(object.planNodes[i]); + } + } + if (object.queryAdvice != null) { + if (typeof object.queryAdvice !== "object") + throw TypeError(".google.spanner.v1.QueryPlan.queryAdvice: object expected"); + message.queryAdvice = $root.google.spanner.v1.QueryAdvisorResult.fromObject(object.queryAdvice); + } + return message; + }; + + /** + * Creates a plain object from a QueryPlan message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.QueryPlan + * @static + * @param {google.spanner.v1.QueryPlan} message QueryPlan + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryPlan.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.planNodes = []; + if (options.defaults) + object.queryAdvice = null; + if (message.planNodes && message.planNodes.length) { + object.planNodes = []; + for (var j = 0; j < message.planNodes.length; ++j) + object.planNodes[j] = $root.google.spanner.v1.PlanNode.toObject(message.planNodes[j], options); + } + if (message.queryAdvice != null && message.hasOwnProperty("queryAdvice")) + object.queryAdvice = $root.google.spanner.v1.QueryAdvisorResult.toObject(message.queryAdvice, options); + return object; + }; + + /** + * Converts this QueryPlan to JSON. + * @function toJSON + * @memberof google.spanner.v1.QueryPlan + * @instance + * @returns {Object.} JSON object + */ + QueryPlan.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for QueryPlan + * @function getTypeUrl + * @memberof google.spanner.v1.QueryPlan + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + QueryPlan.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.QueryPlan"; + }; + + return QueryPlan; + })(); + + v1.ResultSet = (function() { + + /** + * Properties of a ResultSet. + * @memberof google.spanner.v1 + * @interface IResultSet + * @property {google.spanner.v1.IResultSetMetadata|null} [metadata] ResultSet metadata + * @property {Array.|null} [rows] ResultSet rows + * @property {google.spanner.v1.IResultSetStats|null} [stats] ResultSet stats + * @property {google.spanner.v1.IMultiplexedSessionPrecommitToken|null} [precommitToken] ResultSet precommitToken + * @property {google.spanner.v1.ICacheUpdate|null} [cacheUpdate] ResultSet cacheUpdate + */ + + /** + * Constructs a new ResultSet. + * @memberof google.spanner.v1 + * @classdesc Represents a ResultSet. + * @implements IResultSet + * @constructor + * @param {google.spanner.v1.IResultSet=} [properties] Properties to set + */ + function ResultSet(properties) { + this.rows = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResultSet metadata. + * @member {google.spanner.v1.IResultSetMetadata|null|undefined} metadata + * @memberof google.spanner.v1.ResultSet + * @instance + */ + ResultSet.prototype.metadata = null; + + /** + * ResultSet rows. + * @member {Array.} rows + * @memberof google.spanner.v1.ResultSet + * @instance + */ + ResultSet.prototype.rows = $util.emptyArray; + + /** + * ResultSet stats. + * @member {google.spanner.v1.IResultSetStats|null|undefined} stats + * @memberof google.spanner.v1.ResultSet + * @instance + */ + ResultSet.prototype.stats = null; + + /** + * ResultSet precommitToken. + * @member {google.spanner.v1.IMultiplexedSessionPrecommitToken|null|undefined} precommitToken + * @memberof google.spanner.v1.ResultSet + * @instance + */ + ResultSet.prototype.precommitToken = null; + + /** + * ResultSet cacheUpdate. + * @member {google.spanner.v1.ICacheUpdate|null|undefined} cacheUpdate + * @memberof google.spanner.v1.ResultSet + * @instance + */ + ResultSet.prototype.cacheUpdate = null; + + /** + * Creates a new ResultSet instance using the specified properties. + * @function create + * @memberof google.spanner.v1.ResultSet + * @static + * @param {google.spanner.v1.IResultSet=} [properties] Properties to set + * @returns {google.spanner.v1.ResultSet} ResultSet instance + */ + ResultSet.create = function create(properties) { + return new ResultSet(properties); + }; + + /** + * Encodes the specified ResultSet message. Does not implicitly {@link google.spanner.v1.ResultSet.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.ResultSet + * @static + * @param {google.spanner.v1.IResultSet} message ResultSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResultSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.spanner.v1.ResultSetMetadata.encode(message.metadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.rows != null && message.rows.length) + for (var i = 0; i < message.rows.length; ++i) + $root.google.protobuf.ListValue.encode(message.rows[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.stats != null && Object.hasOwnProperty.call(message, "stats")) + $root.google.spanner.v1.ResultSetStats.encode(message.stats, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.precommitToken != null && Object.hasOwnProperty.call(message, "precommitToken")) + $root.google.spanner.v1.MultiplexedSessionPrecommitToken.encode(message.precommitToken, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.cacheUpdate != null && Object.hasOwnProperty.call(message, "cacheUpdate")) + $root.google.spanner.v1.CacheUpdate.encode(message.cacheUpdate, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ResultSet message, length delimited. Does not implicitly {@link google.spanner.v1.ResultSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.ResultSet + * @static + * @param {google.spanner.v1.IResultSet} message ResultSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResultSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResultSet message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.ResultSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.ResultSet} ResultSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResultSet.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.ResultSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.metadata = $root.google.spanner.v1.ResultSetMetadata.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.rows && message.rows.length)) + message.rows = []; + message.rows.push($root.google.protobuf.ListValue.decode(reader, reader.uint32())); + break; + } + case 3: { + message.stats = $root.google.spanner.v1.ResultSetStats.decode(reader, reader.uint32()); + break; + } + case 5: { + message.precommitToken = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.decode(reader, reader.uint32()); + break; + } + case 6: { + message.cacheUpdate = $root.google.spanner.v1.CacheUpdate.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResultSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.ResultSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.ResultSet} ResultSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResultSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResultSet message. + * @function verify + * @memberof google.spanner.v1.ResultSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResultSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.spanner.v1.ResultSetMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + if (message.rows != null && message.hasOwnProperty("rows")) { + if (!Array.isArray(message.rows)) + return "rows: array expected"; + for (var i = 0; i < message.rows.length; ++i) { + var error = $root.google.protobuf.ListValue.verify(message.rows[i]); + if (error) + return "rows." + error; + } + } + if (message.stats != null && message.hasOwnProperty("stats")) { + var error = $root.google.spanner.v1.ResultSetStats.verify(message.stats); + if (error) + return "stats." + error; + } + if (message.precommitToken != null && message.hasOwnProperty("precommitToken")) { + var error = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.verify(message.precommitToken); + if (error) + return "precommitToken." + error; + } + if (message.cacheUpdate != null && message.hasOwnProperty("cacheUpdate")) { + var error = $root.google.spanner.v1.CacheUpdate.verify(message.cacheUpdate); + if (error) + return "cacheUpdate." + error; + } + return null; + }; + + /** + * Creates a ResultSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.ResultSet + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.ResultSet} ResultSet + */ + ResultSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.ResultSet) + return object; + var message = new $root.google.spanner.v1.ResultSet(); + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.spanner.v1.ResultSet.metadata: object expected"); + message.metadata = $root.google.spanner.v1.ResultSetMetadata.fromObject(object.metadata); + } + if (object.rows) { + if (!Array.isArray(object.rows)) + throw TypeError(".google.spanner.v1.ResultSet.rows: array expected"); + message.rows = []; + for (var i = 0; i < object.rows.length; ++i) { + if (typeof object.rows[i] !== "object") + throw TypeError(".google.spanner.v1.ResultSet.rows: object expected"); + message.rows[i] = $root.google.protobuf.ListValue.fromObject(object.rows[i]); + } + } + if (object.stats != null) { + if (typeof object.stats !== "object") + throw TypeError(".google.spanner.v1.ResultSet.stats: object expected"); + message.stats = $root.google.spanner.v1.ResultSetStats.fromObject(object.stats); + } + if (object.precommitToken != null) { + if (typeof object.precommitToken !== "object") + throw TypeError(".google.spanner.v1.ResultSet.precommitToken: object expected"); + message.precommitToken = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.fromObject(object.precommitToken); + } + if (object.cacheUpdate != null) { + if (typeof object.cacheUpdate !== "object") + throw TypeError(".google.spanner.v1.ResultSet.cacheUpdate: object expected"); + message.cacheUpdate = $root.google.spanner.v1.CacheUpdate.fromObject(object.cacheUpdate); + } + return message; + }; + + /** + * Creates a plain object from a ResultSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.ResultSet + * @static + * @param {google.spanner.v1.ResultSet} message ResultSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResultSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rows = []; + if (options.defaults) { + object.metadata = null; + object.stats = null; + object.precommitToken = null; + object.cacheUpdate = null; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.spanner.v1.ResultSetMetadata.toObject(message.metadata, options); + if (message.rows && message.rows.length) { + object.rows = []; + for (var j = 0; j < message.rows.length; ++j) + object.rows[j] = $root.google.protobuf.ListValue.toObject(message.rows[j], options); + } + if (message.stats != null && message.hasOwnProperty("stats")) + object.stats = $root.google.spanner.v1.ResultSetStats.toObject(message.stats, options); + if (message.precommitToken != null && message.hasOwnProperty("precommitToken")) + object.precommitToken = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.toObject(message.precommitToken, options); + if (message.cacheUpdate != null && message.hasOwnProperty("cacheUpdate")) + object.cacheUpdate = $root.google.spanner.v1.CacheUpdate.toObject(message.cacheUpdate, options); + return object; + }; + + /** + * Converts this ResultSet to JSON. + * @function toJSON + * @memberof google.spanner.v1.ResultSet + * @instance + * @returns {Object.} JSON object + */ + ResultSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResultSet + * @function getTypeUrl + * @memberof google.spanner.v1.ResultSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResultSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.ResultSet"; + }; + + return ResultSet; + })(); + + v1.PartialResultSet = (function() { + + /** + * Properties of a PartialResultSet. + * @memberof google.spanner.v1 + * @interface IPartialResultSet + * @property {google.spanner.v1.IResultSetMetadata|null} [metadata] PartialResultSet metadata + * @property {Array.|null} [values] PartialResultSet values + * @property {boolean|null} [chunkedValue] PartialResultSet chunkedValue + * @property {Uint8Array|null} [resumeToken] PartialResultSet resumeToken + * @property {google.spanner.v1.IResultSetStats|null} [stats] PartialResultSet stats + * @property {google.spanner.v1.IMultiplexedSessionPrecommitToken|null} [precommitToken] PartialResultSet precommitToken + * @property {boolean|null} [last] PartialResultSet last + * @property {google.spanner.v1.ICacheUpdate|null} [cacheUpdate] PartialResultSet cacheUpdate + */ + + /** + * Constructs a new PartialResultSet. + * @memberof google.spanner.v1 + * @classdesc Represents a PartialResultSet. + * @implements IPartialResultSet + * @constructor + * @param {google.spanner.v1.IPartialResultSet=} [properties] Properties to set + */ + function PartialResultSet(properties) { + this.values = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PartialResultSet metadata. + * @member {google.spanner.v1.IResultSetMetadata|null|undefined} metadata + * @memberof google.spanner.v1.PartialResultSet + * @instance + */ + PartialResultSet.prototype.metadata = null; + + /** + * PartialResultSet values. + * @member {Array.} values + * @memberof google.spanner.v1.PartialResultSet + * @instance + */ + PartialResultSet.prototype.values = $util.emptyArray; + + /** + * PartialResultSet chunkedValue. + * @member {boolean} chunkedValue + * @memberof google.spanner.v1.PartialResultSet + * @instance + */ + PartialResultSet.prototype.chunkedValue = false; + + /** + * PartialResultSet resumeToken. + * @member {Uint8Array} resumeToken + * @memberof google.spanner.v1.PartialResultSet + * @instance + */ + PartialResultSet.prototype.resumeToken = $util.newBuffer([]); + + /** + * PartialResultSet stats. + * @member {google.spanner.v1.IResultSetStats|null|undefined} stats + * @memberof google.spanner.v1.PartialResultSet + * @instance + */ + PartialResultSet.prototype.stats = null; + + /** + * PartialResultSet precommitToken. + * @member {google.spanner.v1.IMultiplexedSessionPrecommitToken|null|undefined} precommitToken + * @memberof google.spanner.v1.PartialResultSet + * @instance + */ + PartialResultSet.prototype.precommitToken = null; + + /** + * PartialResultSet last. + * @member {boolean} last + * @memberof google.spanner.v1.PartialResultSet + * @instance + */ + PartialResultSet.prototype.last = false; + + /** + * PartialResultSet cacheUpdate. + * @member {google.spanner.v1.ICacheUpdate|null|undefined} cacheUpdate + * @memberof google.spanner.v1.PartialResultSet + * @instance + */ + PartialResultSet.prototype.cacheUpdate = null; + + /** + * Creates a new PartialResultSet instance using the specified properties. + * @function create + * @memberof google.spanner.v1.PartialResultSet + * @static + * @param {google.spanner.v1.IPartialResultSet=} [properties] Properties to set + * @returns {google.spanner.v1.PartialResultSet} PartialResultSet instance + */ + PartialResultSet.create = function create(properties) { + return new PartialResultSet(properties); + }; + + /** + * Encodes the specified PartialResultSet message. Does not implicitly {@link google.spanner.v1.PartialResultSet.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.PartialResultSet + * @static + * @param {google.spanner.v1.IPartialResultSet} message PartialResultSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartialResultSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.spanner.v1.ResultSetMetadata.encode(message.metadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.values != null && message.values.length) + for (var i = 0; i < message.values.length; ++i) + $root.google.protobuf.Value.encode(message.values[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.chunkedValue != null && Object.hasOwnProperty.call(message, "chunkedValue")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.chunkedValue); + if (message.resumeToken != null && Object.hasOwnProperty.call(message, "resumeToken")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.resumeToken); + if (message.stats != null && Object.hasOwnProperty.call(message, "stats")) + $root.google.spanner.v1.ResultSetStats.encode(message.stats, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.precommitToken != null && Object.hasOwnProperty.call(message, "precommitToken")) + $root.google.spanner.v1.MultiplexedSessionPrecommitToken.encode(message.precommitToken, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.last != null && Object.hasOwnProperty.call(message, "last")) + writer.uint32(/* id 9, wireType 0 =*/72).bool(message.last); + if (message.cacheUpdate != null && Object.hasOwnProperty.call(message, "cacheUpdate")) + $root.google.spanner.v1.CacheUpdate.encode(message.cacheUpdate, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PartialResultSet message, length delimited. Does not implicitly {@link google.spanner.v1.PartialResultSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.PartialResultSet + * @static + * @param {google.spanner.v1.IPartialResultSet} message PartialResultSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartialResultSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PartialResultSet message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.PartialResultSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.PartialResultSet} PartialResultSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartialResultSet.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.PartialResultSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.metadata = $root.google.spanner.v1.ResultSetMetadata.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.values && message.values.length)) + message.values = []; + message.values.push($root.google.protobuf.Value.decode(reader, reader.uint32())); + break; + } + case 3: { + message.chunkedValue = reader.bool(); + break; + } + case 4: { + message.resumeToken = reader.bytes(); + break; + } + case 5: { + message.stats = $root.google.spanner.v1.ResultSetStats.decode(reader, reader.uint32()); + break; + } + case 8: { + message.precommitToken = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.decode(reader, reader.uint32()); + break; + } + case 9: { + message.last = reader.bool(); + break; + } + case 10: { + message.cacheUpdate = $root.google.spanner.v1.CacheUpdate.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PartialResultSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.PartialResultSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.PartialResultSet} PartialResultSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartialResultSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PartialResultSet message. + * @function verify + * @memberof google.spanner.v1.PartialResultSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PartialResultSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.spanner.v1.ResultSetMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + if (message.values != null && message.hasOwnProperty("values")) { + if (!Array.isArray(message.values)) + return "values: array expected"; + for (var i = 0; i < message.values.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.values[i]); + if (error) + return "values." + error; + } + } + if (message.chunkedValue != null && message.hasOwnProperty("chunkedValue")) + if (typeof message.chunkedValue !== "boolean") + return "chunkedValue: boolean expected"; + if (message.resumeToken != null && message.hasOwnProperty("resumeToken")) + if (!(message.resumeToken && typeof message.resumeToken.length === "number" || $util.isString(message.resumeToken))) + return "resumeToken: buffer expected"; + if (message.stats != null && message.hasOwnProperty("stats")) { + var error = $root.google.spanner.v1.ResultSetStats.verify(message.stats); + if (error) + return "stats." + error; + } + if (message.precommitToken != null && message.hasOwnProperty("precommitToken")) { + var error = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.verify(message.precommitToken); + if (error) + return "precommitToken." + error; + } + if (message.last != null && message.hasOwnProperty("last")) + if (typeof message.last !== "boolean") + return "last: boolean expected"; + if (message.cacheUpdate != null && message.hasOwnProperty("cacheUpdate")) { + var error = $root.google.spanner.v1.CacheUpdate.verify(message.cacheUpdate); + if (error) + return "cacheUpdate." + error; + } + return null; + }; + + /** + * Creates a PartialResultSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.PartialResultSet + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.PartialResultSet} PartialResultSet + */ + PartialResultSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.PartialResultSet) + return object; + var message = new $root.google.spanner.v1.PartialResultSet(); + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.spanner.v1.PartialResultSet.metadata: object expected"); + message.metadata = $root.google.spanner.v1.ResultSetMetadata.fromObject(object.metadata); + } + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.spanner.v1.PartialResultSet.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) { + if (typeof object.values[i] !== "object") + throw TypeError(".google.spanner.v1.PartialResultSet.values: object expected"); + message.values[i] = $root.google.protobuf.Value.fromObject(object.values[i]); + } + } + if (object.chunkedValue != null) + message.chunkedValue = Boolean(object.chunkedValue); + if (object.resumeToken != null) + if (typeof object.resumeToken === "string") + $util.base64.decode(object.resumeToken, message.resumeToken = $util.newBuffer($util.base64.length(object.resumeToken)), 0); + else if (object.resumeToken.length >= 0) + message.resumeToken = object.resumeToken; + if (object.stats != null) { + if (typeof object.stats !== "object") + throw TypeError(".google.spanner.v1.PartialResultSet.stats: object expected"); + message.stats = $root.google.spanner.v1.ResultSetStats.fromObject(object.stats); + } + if (object.precommitToken != null) { + if (typeof object.precommitToken !== "object") + throw TypeError(".google.spanner.v1.PartialResultSet.precommitToken: object expected"); + message.precommitToken = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.fromObject(object.precommitToken); + } + if (object.last != null) + message.last = Boolean(object.last); + if (object.cacheUpdate != null) { + if (typeof object.cacheUpdate !== "object") + throw TypeError(".google.spanner.v1.PartialResultSet.cacheUpdate: object expected"); + message.cacheUpdate = $root.google.spanner.v1.CacheUpdate.fromObject(object.cacheUpdate); + } + return message; + }; + + /** + * Creates a plain object from a PartialResultSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.PartialResultSet + * @static + * @param {google.spanner.v1.PartialResultSet} message PartialResultSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PartialResultSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.values = []; + if (options.defaults) { + object.metadata = null; + object.chunkedValue = false; + if (options.bytes === String) + object.resumeToken = ""; + else { + object.resumeToken = []; + if (options.bytes !== Array) + object.resumeToken = $util.newBuffer(object.resumeToken); + } + object.stats = null; + object.precommitToken = null; + object.last = false; + object.cacheUpdate = null; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.spanner.v1.ResultSetMetadata.toObject(message.metadata, options); + if (message.values && message.values.length) { + object.values = []; + for (var j = 0; j < message.values.length; ++j) + object.values[j] = $root.google.protobuf.Value.toObject(message.values[j], options); + } + if (message.chunkedValue != null && message.hasOwnProperty("chunkedValue")) + object.chunkedValue = message.chunkedValue; + if (message.resumeToken != null && message.hasOwnProperty("resumeToken")) + object.resumeToken = options.bytes === String ? $util.base64.encode(message.resumeToken, 0, message.resumeToken.length) : options.bytes === Array ? Array.prototype.slice.call(message.resumeToken) : message.resumeToken; + if (message.stats != null && message.hasOwnProperty("stats")) + object.stats = $root.google.spanner.v1.ResultSetStats.toObject(message.stats, options); + if (message.precommitToken != null && message.hasOwnProperty("precommitToken")) + object.precommitToken = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.toObject(message.precommitToken, options); + if (message.last != null && message.hasOwnProperty("last")) + object.last = message.last; + if (message.cacheUpdate != null && message.hasOwnProperty("cacheUpdate")) + object.cacheUpdate = $root.google.spanner.v1.CacheUpdate.toObject(message.cacheUpdate, options); + return object; + }; + + /** + * Converts this PartialResultSet to JSON. + * @function toJSON + * @memberof google.spanner.v1.PartialResultSet + * @instance + * @returns {Object.} JSON object + */ + PartialResultSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PartialResultSet + * @function getTypeUrl + * @memberof google.spanner.v1.PartialResultSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PartialResultSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.PartialResultSet"; + }; + + return PartialResultSet; + })(); + + v1.ResultSetMetadata = (function() { + + /** + * Properties of a ResultSetMetadata. + * @memberof google.spanner.v1 + * @interface IResultSetMetadata + * @property {google.spanner.v1.IStructType|null} [rowType] ResultSetMetadata rowType + * @property {google.spanner.v1.ITransaction|null} [transaction] ResultSetMetadata transaction + * @property {google.spanner.v1.IStructType|null} [undeclaredParameters] ResultSetMetadata undeclaredParameters + */ + + /** + * Constructs a new ResultSetMetadata. + * @memberof google.spanner.v1 + * @classdesc Represents a ResultSetMetadata. + * @implements IResultSetMetadata + * @constructor + * @param {google.spanner.v1.IResultSetMetadata=} [properties] Properties to set + */ + function ResultSetMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResultSetMetadata rowType. + * @member {google.spanner.v1.IStructType|null|undefined} rowType + * @memberof google.spanner.v1.ResultSetMetadata + * @instance + */ + ResultSetMetadata.prototype.rowType = null; + + /** + * ResultSetMetadata transaction. + * @member {google.spanner.v1.ITransaction|null|undefined} transaction + * @memberof google.spanner.v1.ResultSetMetadata + * @instance + */ + ResultSetMetadata.prototype.transaction = null; + + /** + * ResultSetMetadata undeclaredParameters. + * @member {google.spanner.v1.IStructType|null|undefined} undeclaredParameters + * @memberof google.spanner.v1.ResultSetMetadata + * @instance + */ + ResultSetMetadata.prototype.undeclaredParameters = null; + + /** + * Creates a new ResultSetMetadata instance using the specified properties. + * @function create + * @memberof google.spanner.v1.ResultSetMetadata + * @static + * @param {google.spanner.v1.IResultSetMetadata=} [properties] Properties to set + * @returns {google.spanner.v1.ResultSetMetadata} ResultSetMetadata instance + */ + ResultSetMetadata.create = function create(properties) { + return new ResultSetMetadata(properties); + }; + + /** + * Encodes the specified ResultSetMetadata message. Does not implicitly {@link google.spanner.v1.ResultSetMetadata.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.ResultSetMetadata + * @static + * @param {google.spanner.v1.IResultSetMetadata} message ResultSetMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResultSetMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rowType != null && Object.hasOwnProperty.call(message, "rowType")) + $root.google.spanner.v1.StructType.encode(message.rowType, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.transaction != null && Object.hasOwnProperty.call(message, "transaction")) + $root.google.spanner.v1.Transaction.encode(message.transaction, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.undeclaredParameters != null && Object.hasOwnProperty.call(message, "undeclaredParameters")) + $root.google.spanner.v1.StructType.encode(message.undeclaredParameters, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ResultSetMetadata message, length delimited. Does not implicitly {@link google.spanner.v1.ResultSetMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.ResultSetMetadata + * @static + * @param {google.spanner.v1.IResultSetMetadata} message ResultSetMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResultSetMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResultSetMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.ResultSetMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.ResultSetMetadata} ResultSetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResultSetMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.ResultSetMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.rowType = $root.google.spanner.v1.StructType.decode(reader, reader.uint32()); + break; + } + case 2: { + message.transaction = $root.google.spanner.v1.Transaction.decode(reader, reader.uint32()); + break; + } + case 3: { + message.undeclaredParameters = $root.google.spanner.v1.StructType.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResultSetMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.ResultSetMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.ResultSetMetadata} ResultSetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResultSetMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResultSetMetadata message. + * @function verify + * @memberof google.spanner.v1.ResultSetMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResultSetMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rowType != null && message.hasOwnProperty("rowType")) { + var error = $root.google.spanner.v1.StructType.verify(message.rowType); + if (error) + return "rowType." + error; + } + if (message.transaction != null && message.hasOwnProperty("transaction")) { + var error = $root.google.spanner.v1.Transaction.verify(message.transaction); + if (error) + return "transaction." + error; + } + if (message.undeclaredParameters != null && message.hasOwnProperty("undeclaredParameters")) { + var error = $root.google.spanner.v1.StructType.verify(message.undeclaredParameters); + if (error) + return "undeclaredParameters." + error; + } + return null; + }; + + /** + * Creates a ResultSetMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.ResultSetMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.ResultSetMetadata} ResultSetMetadata + */ + ResultSetMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.ResultSetMetadata) + return object; + var message = new $root.google.spanner.v1.ResultSetMetadata(); + if (object.rowType != null) { + if (typeof object.rowType !== "object") + throw TypeError(".google.spanner.v1.ResultSetMetadata.rowType: object expected"); + message.rowType = $root.google.spanner.v1.StructType.fromObject(object.rowType); + } + if (object.transaction != null) { + if (typeof object.transaction !== "object") + throw TypeError(".google.spanner.v1.ResultSetMetadata.transaction: object expected"); + message.transaction = $root.google.spanner.v1.Transaction.fromObject(object.transaction); + } + if (object.undeclaredParameters != null) { + if (typeof object.undeclaredParameters !== "object") + throw TypeError(".google.spanner.v1.ResultSetMetadata.undeclaredParameters: object expected"); + message.undeclaredParameters = $root.google.spanner.v1.StructType.fromObject(object.undeclaredParameters); + } + return message; + }; + + /** + * Creates a plain object from a ResultSetMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.ResultSetMetadata + * @static + * @param {google.spanner.v1.ResultSetMetadata} message ResultSetMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResultSetMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.rowType = null; + object.transaction = null; + object.undeclaredParameters = null; + } + if (message.rowType != null && message.hasOwnProperty("rowType")) + object.rowType = $root.google.spanner.v1.StructType.toObject(message.rowType, options); + if (message.transaction != null && message.hasOwnProperty("transaction")) + object.transaction = $root.google.spanner.v1.Transaction.toObject(message.transaction, options); + if (message.undeclaredParameters != null && message.hasOwnProperty("undeclaredParameters")) + object.undeclaredParameters = $root.google.spanner.v1.StructType.toObject(message.undeclaredParameters, options); + return object; + }; + + /** + * Converts this ResultSetMetadata to JSON. + * @function toJSON + * @memberof google.spanner.v1.ResultSetMetadata + * @instance + * @returns {Object.} JSON object + */ + ResultSetMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResultSetMetadata + * @function getTypeUrl + * @memberof google.spanner.v1.ResultSetMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResultSetMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.ResultSetMetadata"; + }; + + return ResultSetMetadata; + })(); + + v1.ResultSetStats = (function() { + + /** + * Properties of a ResultSetStats. + * @memberof google.spanner.v1 + * @interface IResultSetStats + * @property {google.spanner.v1.IQueryPlan|null} [queryPlan] ResultSetStats queryPlan + * @property {google.protobuf.IStruct|null} [queryStats] ResultSetStats queryStats + * @property {number|Long|null} [rowCountExact] ResultSetStats rowCountExact + * @property {number|Long|null} [rowCountLowerBound] ResultSetStats rowCountLowerBound + */ + + /** + * Constructs a new ResultSetStats. + * @memberof google.spanner.v1 + * @classdesc Represents a ResultSetStats. + * @implements IResultSetStats + * @constructor + * @param {google.spanner.v1.IResultSetStats=} [properties] Properties to set + */ + function ResultSetStats(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResultSetStats queryPlan. + * @member {google.spanner.v1.IQueryPlan|null|undefined} queryPlan + * @memberof google.spanner.v1.ResultSetStats + * @instance + */ + ResultSetStats.prototype.queryPlan = null; + + /** + * ResultSetStats queryStats. + * @member {google.protobuf.IStruct|null|undefined} queryStats + * @memberof google.spanner.v1.ResultSetStats + * @instance + */ + ResultSetStats.prototype.queryStats = null; + + /** + * ResultSetStats rowCountExact. + * @member {number|Long|null|undefined} rowCountExact + * @memberof google.spanner.v1.ResultSetStats + * @instance + */ + ResultSetStats.prototype.rowCountExact = null; + + /** + * ResultSetStats rowCountLowerBound. + * @member {number|Long|null|undefined} rowCountLowerBound + * @memberof google.spanner.v1.ResultSetStats + * @instance + */ + ResultSetStats.prototype.rowCountLowerBound = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ResultSetStats rowCount. + * @member {"rowCountExact"|"rowCountLowerBound"|undefined} rowCount + * @memberof google.spanner.v1.ResultSetStats + * @instance + */ + Object.defineProperty(ResultSetStats.prototype, "rowCount", { + get: $util.oneOfGetter($oneOfFields = ["rowCountExact", "rowCountLowerBound"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ResultSetStats instance using the specified properties. + * @function create + * @memberof google.spanner.v1.ResultSetStats + * @static + * @param {google.spanner.v1.IResultSetStats=} [properties] Properties to set + * @returns {google.spanner.v1.ResultSetStats} ResultSetStats instance + */ + ResultSetStats.create = function create(properties) { + return new ResultSetStats(properties); + }; + + /** + * Encodes the specified ResultSetStats message. Does not implicitly {@link google.spanner.v1.ResultSetStats.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.ResultSetStats + * @static + * @param {google.spanner.v1.IResultSetStats} message ResultSetStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResultSetStats.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.queryPlan != null && Object.hasOwnProperty.call(message, "queryPlan")) + $root.google.spanner.v1.QueryPlan.encode(message.queryPlan, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.queryStats != null && Object.hasOwnProperty.call(message, "queryStats")) + $root.google.protobuf.Struct.encode(message.queryStats, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.rowCountExact != null && Object.hasOwnProperty.call(message, "rowCountExact")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.rowCountExact); + if (message.rowCountLowerBound != null && Object.hasOwnProperty.call(message, "rowCountLowerBound")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.rowCountLowerBound); + return writer; + }; + + /** + * Encodes the specified ResultSetStats message, length delimited. Does not implicitly {@link google.spanner.v1.ResultSetStats.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.ResultSetStats + * @static + * @param {google.spanner.v1.IResultSetStats} message ResultSetStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResultSetStats.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResultSetStats message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.ResultSetStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.ResultSetStats} ResultSetStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResultSetStats.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.ResultSetStats(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.queryPlan = $root.google.spanner.v1.QueryPlan.decode(reader, reader.uint32()); + break; + } + case 2: { + message.queryStats = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 3: { + message.rowCountExact = reader.int64(); + break; + } + case 4: { + message.rowCountLowerBound = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResultSetStats message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.ResultSetStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.ResultSetStats} ResultSetStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResultSetStats.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResultSetStats message. + * @function verify + * @memberof google.spanner.v1.ResultSetStats + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResultSetStats.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.queryPlan != null && message.hasOwnProperty("queryPlan")) { + var error = $root.google.spanner.v1.QueryPlan.verify(message.queryPlan); + if (error) + return "queryPlan." + error; + } + if (message.queryStats != null && message.hasOwnProperty("queryStats")) { + var error = $root.google.protobuf.Struct.verify(message.queryStats); + if (error) + return "queryStats." + error; + } + if (message.rowCountExact != null && message.hasOwnProperty("rowCountExact")) { + properties.rowCount = 1; + if (!$util.isInteger(message.rowCountExact) && !(message.rowCountExact && $util.isInteger(message.rowCountExact.low) && $util.isInteger(message.rowCountExact.high))) + return "rowCountExact: integer|Long expected"; + } + if (message.rowCountLowerBound != null && message.hasOwnProperty("rowCountLowerBound")) { + if (properties.rowCount === 1) + return "rowCount: multiple values"; + properties.rowCount = 1; + if (!$util.isInteger(message.rowCountLowerBound) && !(message.rowCountLowerBound && $util.isInteger(message.rowCountLowerBound.low) && $util.isInteger(message.rowCountLowerBound.high))) + return "rowCountLowerBound: integer|Long expected"; + } + return null; + }; + + /** + * Creates a ResultSetStats message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.ResultSetStats + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.ResultSetStats} ResultSetStats + */ + ResultSetStats.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.ResultSetStats) + return object; + var message = new $root.google.spanner.v1.ResultSetStats(); + if (object.queryPlan != null) { + if (typeof object.queryPlan !== "object") + throw TypeError(".google.spanner.v1.ResultSetStats.queryPlan: object expected"); + message.queryPlan = $root.google.spanner.v1.QueryPlan.fromObject(object.queryPlan); + } + if (object.queryStats != null) { + if (typeof object.queryStats !== "object") + throw TypeError(".google.spanner.v1.ResultSetStats.queryStats: object expected"); + message.queryStats = $root.google.protobuf.Struct.fromObject(object.queryStats); + } + if (object.rowCountExact != null) + if ($util.Long) + (message.rowCountExact = $util.Long.fromValue(object.rowCountExact)).unsigned = false; + else if (typeof object.rowCountExact === "string") + message.rowCountExact = parseInt(object.rowCountExact, 10); + else if (typeof object.rowCountExact === "number") + message.rowCountExact = object.rowCountExact; + else if (typeof object.rowCountExact === "object") + message.rowCountExact = new $util.LongBits(object.rowCountExact.low >>> 0, object.rowCountExact.high >>> 0).toNumber(); + if (object.rowCountLowerBound != null) + if ($util.Long) + (message.rowCountLowerBound = $util.Long.fromValue(object.rowCountLowerBound)).unsigned = false; + else if (typeof object.rowCountLowerBound === "string") + message.rowCountLowerBound = parseInt(object.rowCountLowerBound, 10); + else if (typeof object.rowCountLowerBound === "number") + message.rowCountLowerBound = object.rowCountLowerBound; + else if (typeof object.rowCountLowerBound === "object") + message.rowCountLowerBound = new $util.LongBits(object.rowCountLowerBound.low >>> 0, object.rowCountLowerBound.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a ResultSetStats message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.ResultSetStats + * @static + * @param {google.spanner.v1.ResultSetStats} message ResultSetStats + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResultSetStats.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.queryPlan = null; + object.queryStats = null; + } + if (message.queryPlan != null && message.hasOwnProperty("queryPlan")) + object.queryPlan = $root.google.spanner.v1.QueryPlan.toObject(message.queryPlan, options); + if (message.queryStats != null && message.hasOwnProperty("queryStats")) + object.queryStats = $root.google.protobuf.Struct.toObject(message.queryStats, options); + if (message.rowCountExact != null && message.hasOwnProperty("rowCountExact")) { + if (typeof message.rowCountExact === "number") + object.rowCountExact = options.longs === String ? String(message.rowCountExact) : message.rowCountExact; + else + object.rowCountExact = options.longs === String ? $util.Long.prototype.toString.call(message.rowCountExact) : options.longs === Number ? new $util.LongBits(message.rowCountExact.low >>> 0, message.rowCountExact.high >>> 0).toNumber() : message.rowCountExact; + if (options.oneofs) + object.rowCount = "rowCountExact"; + } + if (message.rowCountLowerBound != null && message.hasOwnProperty("rowCountLowerBound")) { + if (typeof message.rowCountLowerBound === "number") + object.rowCountLowerBound = options.longs === String ? String(message.rowCountLowerBound) : message.rowCountLowerBound; + else + object.rowCountLowerBound = options.longs === String ? $util.Long.prototype.toString.call(message.rowCountLowerBound) : options.longs === Number ? new $util.LongBits(message.rowCountLowerBound.low >>> 0, message.rowCountLowerBound.high >>> 0).toNumber() : message.rowCountLowerBound; + if (options.oneofs) + object.rowCount = "rowCountLowerBound"; + } + return object; + }; + + /** + * Converts this ResultSetStats to JSON. + * @function toJSON + * @memberof google.spanner.v1.ResultSetStats + * @instance + * @returns {Object.} JSON object + */ + ResultSetStats.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResultSetStats + * @function getTypeUrl + * @memberof google.spanner.v1.ResultSetStats + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResultSetStats.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.ResultSetStats"; + }; + + return ResultSetStats; + })(); + + v1.Spanner = (function() { + + /** + * Constructs a new Spanner service. + * @memberof google.spanner.v1 + * @classdesc Represents a Spanner + * @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 Spanner(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Spanner.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Spanner; + + /** + * Creates new Spanner service using the specified rpc implementation. + * @function create + * @memberof google.spanner.v1.Spanner + * @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 {Spanner} RPC service. Useful where requests and/or responses are streamed. + */ + Spanner.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.spanner.v1.Spanner|createSession}. + * @memberof google.spanner.v1.Spanner + * @typedef CreateSessionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.spanner.v1.Session} [response] Session + */ + + /** + * Calls CreateSession. + * @function createSession + * @memberof google.spanner.v1.Spanner + * @instance + * @param {google.spanner.v1.ICreateSessionRequest} request CreateSessionRequest message or plain object + * @param {google.spanner.v1.Spanner.CreateSessionCallback} callback Node-style callback called with the error, if any, and Session + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Spanner.prototype.createSession = function createSession(request, callback) { + return this.rpcCall(createSession, $root.google.spanner.v1.CreateSessionRequest, $root.google.spanner.v1.Session, request, callback); + }, "name", { value: "CreateSession" }); + + /** + * Calls CreateSession. + * @function createSession + * @memberof google.spanner.v1.Spanner + * @instance + * @param {google.spanner.v1.ICreateSessionRequest} request CreateSessionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.v1.Spanner|batchCreateSessions}. + * @memberof google.spanner.v1.Spanner + * @typedef BatchCreateSessionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.spanner.v1.BatchCreateSessionsResponse} [response] BatchCreateSessionsResponse + */ + + /** + * Calls BatchCreateSessions. + * @function batchCreateSessions + * @memberof google.spanner.v1.Spanner + * @instance + * @param {google.spanner.v1.IBatchCreateSessionsRequest} request BatchCreateSessionsRequest message or plain object + * @param {google.spanner.v1.Spanner.BatchCreateSessionsCallback} callback Node-style callback called with the error, if any, and BatchCreateSessionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Spanner.prototype.batchCreateSessions = function batchCreateSessions(request, callback) { + return this.rpcCall(batchCreateSessions, $root.google.spanner.v1.BatchCreateSessionsRequest, $root.google.spanner.v1.BatchCreateSessionsResponse, request, callback); + }, "name", { value: "BatchCreateSessions" }); + + /** + * Calls BatchCreateSessions. + * @function batchCreateSessions + * @memberof google.spanner.v1.Spanner + * @instance + * @param {google.spanner.v1.IBatchCreateSessionsRequest} request BatchCreateSessionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.v1.Spanner|getSession}. + * @memberof google.spanner.v1.Spanner + * @typedef GetSessionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.spanner.v1.Session} [response] Session + */ + + /** + * Calls GetSession. + * @function getSession + * @memberof google.spanner.v1.Spanner + * @instance + * @param {google.spanner.v1.IGetSessionRequest} request GetSessionRequest message or plain object + * @param {google.spanner.v1.Spanner.GetSessionCallback} callback Node-style callback called with the error, if any, and Session + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Spanner.prototype.getSession = function getSession(request, callback) { + return this.rpcCall(getSession, $root.google.spanner.v1.GetSessionRequest, $root.google.spanner.v1.Session, request, callback); + }, "name", { value: "GetSession" }); + + /** + * Calls GetSession. + * @function getSession + * @memberof google.spanner.v1.Spanner + * @instance + * @param {google.spanner.v1.IGetSessionRequest} request GetSessionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.v1.Spanner|listSessions}. + * @memberof google.spanner.v1.Spanner + * @typedef ListSessionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.spanner.v1.ListSessionsResponse} [response] ListSessionsResponse + */ + + /** + * Calls ListSessions. + * @function listSessions + * @memberof google.spanner.v1.Spanner + * @instance + * @param {google.spanner.v1.IListSessionsRequest} request ListSessionsRequest message or plain object + * @param {google.spanner.v1.Spanner.ListSessionsCallback} callback Node-style callback called with the error, if any, and ListSessionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Spanner.prototype.listSessions = function listSessions(request, callback) { + return this.rpcCall(listSessions, $root.google.spanner.v1.ListSessionsRequest, $root.google.spanner.v1.ListSessionsResponse, request, callback); + }, "name", { value: "ListSessions" }); + + /** + * Calls ListSessions. + * @function listSessions + * @memberof google.spanner.v1.Spanner + * @instance + * @param {google.spanner.v1.IListSessionsRequest} request ListSessionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.v1.Spanner|deleteSession}. + * @memberof google.spanner.v1.Spanner + * @typedef DeleteSessionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteSession. + * @function deleteSession + * @memberof google.spanner.v1.Spanner + * @instance + * @param {google.spanner.v1.IDeleteSessionRequest} request DeleteSessionRequest message or plain object + * @param {google.spanner.v1.Spanner.DeleteSessionCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Spanner.prototype.deleteSession = function deleteSession(request, callback) { + return this.rpcCall(deleteSession, $root.google.spanner.v1.DeleteSessionRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteSession" }); + + /** + * Calls DeleteSession. + * @function deleteSession + * @memberof google.spanner.v1.Spanner + * @instance + * @param {google.spanner.v1.IDeleteSessionRequest} request DeleteSessionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.v1.Spanner|executeSql}. + * @memberof google.spanner.v1.Spanner + * @typedef ExecuteSqlCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.spanner.v1.ResultSet} [response] ResultSet + */ + + /** + * Calls ExecuteSql. + * @function executeSql + * @memberof google.spanner.v1.Spanner + * @instance + * @param {google.spanner.v1.IExecuteSqlRequest} request ExecuteSqlRequest message or plain object + * @param {google.spanner.v1.Spanner.ExecuteSqlCallback} callback Node-style callback called with the error, if any, and ResultSet + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Spanner.prototype.executeSql = function executeSql(request, callback) { + return this.rpcCall(executeSql, $root.google.spanner.v1.ExecuteSqlRequest, $root.google.spanner.v1.ResultSet, request, callback); + }, "name", { value: "ExecuteSql" }); + + /** + * Calls ExecuteSql. + * @function executeSql + * @memberof google.spanner.v1.Spanner + * @instance + * @param {google.spanner.v1.IExecuteSqlRequest} request ExecuteSqlRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.v1.Spanner|executeStreamingSql}. + * @memberof google.spanner.v1.Spanner + * @typedef ExecuteStreamingSqlCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.spanner.v1.PartialResultSet} [response] PartialResultSet + */ + + /** + * Calls ExecuteStreamingSql. + * @function executeStreamingSql + * @memberof google.spanner.v1.Spanner + * @instance + * @param {google.spanner.v1.IExecuteSqlRequest} request ExecuteSqlRequest message or plain object + * @param {google.spanner.v1.Spanner.ExecuteStreamingSqlCallback} callback Node-style callback called with the error, if any, and PartialResultSet + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Spanner.prototype.executeStreamingSql = function executeStreamingSql(request, callback) { + return this.rpcCall(executeStreamingSql, $root.google.spanner.v1.ExecuteSqlRequest, $root.google.spanner.v1.PartialResultSet, request, callback); + }, "name", { value: "ExecuteStreamingSql" }); + + /** + * Calls ExecuteStreamingSql. + * @function executeStreamingSql + * @memberof google.spanner.v1.Spanner + * @instance + * @param {google.spanner.v1.IExecuteSqlRequest} request ExecuteSqlRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.v1.Spanner|executeBatchDml}. + * @memberof google.spanner.v1.Spanner + * @typedef ExecuteBatchDmlCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.spanner.v1.ExecuteBatchDmlResponse} [response] ExecuteBatchDmlResponse + */ + + /** + * Calls ExecuteBatchDml. + * @function executeBatchDml + * @memberof google.spanner.v1.Spanner + * @instance + * @param {google.spanner.v1.IExecuteBatchDmlRequest} request ExecuteBatchDmlRequest message or plain object + * @param {google.spanner.v1.Spanner.ExecuteBatchDmlCallback} callback Node-style callback called with the error, if any, and ExecuteBatchDmlResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Spanner.prototype.executeBatchDml = function executeBatchDml(request, callback) { + return this.rpcCall(executeBatchDml, $root.google.spanner.v1.ExecuteBatchDmlRequest, $root.google.spanner.v1.ExecuteBatchDmlResponse, request, callback); + }, "name", { value: "ExecuteBatchDml" }); + + /** + * Calls ExecuteBatchDml. + * @function executeBatchDml + * @memberof google.spanner.v1.Spanner + * @instance + * @param {google.spanner.v1.IExecuteBatchDmlRequest} request ExecuteBatchDmlRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.v1.Spanner|read}. + * @memberof google.spanner.v1.Spanner + * @typedef ReadCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.spanner.v1.ResultSet} [response] ResultSet + */ + + /** + * Calls Read. + * @function read + * @memberof google.spanner.v1.Spanner + * @instance + * @param {google.spanner.v1.IReadRequest} request ReadRequest message or plain object + * @param {google.spanner.v1.Spanner.ReadCallback} callback Node-style callback called with the error, if any, and ResultSet + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Spanner.prototype.read = function read(request, callback) { + return this.rpcCall(read, $root.google.spanner.v1.ReadRequest, $root.google.spanner.v1.ResultSet, request, callback); + }, "name", { value: "Read" }); + + /** + * Calls Read. + * @function read + * @memberof google.spanner.v1.Spanner + * @instance + * @param {google.spanner.v1.IReadRequest} request ReadRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.v1.Spanner|streamingRead}. + * @memberof google.spanner.v1.Spanner + * @typedef StreamingReadCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.spanner.v1.PartialResultSet} [response] PartialResultSet + */ + + /** + * Calls StreamingRead. + * @function streamingRead + * @memberof google.spanner.v1.Spanner + * @instance + * @param {google.spanner.v1.IReadRequest} request ReadRequest message or plain object + * @param {google.spanner.v1.Spanner.StreamingReadCallback} callback Node-style callback called with the error, if any, and PartialResultSet + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Spanner.prototype.streamingRead = function streamingRead(request, callback) { + return this.rpcCall(streamingRead, $root.google.spanner.v1.ReadRequest, $root.google.spanner.v1.PartialResultSet, request, callback); + }, "name", { value: "StreamingRead" }); + + /** + * Calls StreamingRead. + * @function streamingRead + * @memberof google.spanner.v1.Spanner + * @instance + * @param {google.spanner.v1.IReadRequest} request ReadRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.v1.Spanner|beginTransaction}. + * @memberof google.spanner.v1.Spanner + * @typedef BeginTransactionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.spanner.v1.Transaction} [response] Transaction + */ + + /** + * Calls BeginTransaction. + * @function beginTransaction + * @memberof google.spanner.v1.Spanner + * @instance + * @param {google.spanner.v1.IBeginTransactionRequest} request BeginTransactionRequest message or plain object + * @param {google.spanner.v1.Spanner.BeginTransactionCallback} callback Node-style callback called with the error, if any, and Transaction + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Spanner.prototype.beginTransaction = function beginTransaction(request, callback) { + return this.rpcCall(beginTransaction, $root.google.spanner.v1.BeginTransactionRequest, $root.google.spanner.v1.Transaction, request, callback); + }, "name", { value: "BeginTransaction" }); + + /** + * Calls BeginTransaction. + * @function beginTransaction + * @memberof google.spanner.v1.Spanner + * @instance + * @param {google.spanner.v1.IBeginTransactionRequest} request BeginTransactionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.v1.Spanner|commit}. + * @memberof google.spanner.v1.Spanner + * @typedef CommitCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.spanner.v1.CommitResponse} [response] CommitResponse + */ + + /** + * Calls Commit. + * @function commit + * @memberof google.spanner.v1.Spanner + * @instance + * @param {google.spanner.v1.ICommitRequest} request CommitRequest message or plain object + * @param {google.spanner.v1.Spanner.CommitCallback} callback Node-style callback called with the error, if any, and CommitResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Spanner.prototype.commit = function commit(request, callback) { + return this.rpcCall(commit, $root.google.spanner.v1.CommitRequest, $root.google.spanner.v1.CommitResponse, request, callback); + }, "name", { value: "Commit" }); + + /** + * Calls Commit. + * @function commit + * @memberof google.spanner.v1.Spanner + * @instance + * @param {google.spanner.v1.ICommitRequest} request CommitRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.v1.Spanner|rollback}. + * @memberof google.spanner.v1.Spanner + * @typedef RollbackCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls Rollback. + * @function rollback + * @memberof google.spanner.v1.Spanner + * @instance + * @param {google.spanner.v1.IRollbackRequest} request RollbackRequest message or plain object + * @param {google.spanner.v1.Spanner.RollbackCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Spanner.prototype.rollback = function rollback(request, callback) { + return this.rpcCall(rollback, $root.google.spanner.v1.RollbackRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "Rollback" }); + + /** + * Calls Rollback. + * @function rollback + * @memberof google.spanner.v1.Spanner + * @instance + * @param {google.spanner.v1.IRollbackRequest} request RollbackRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.v1.Spanner|partitionQuery}. + * @memberof google.spanner.v1.Spanner + * @typedef PartitionQueryCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.spanner.v1.PartitionResponse} [response] PartitionResponse + */ + + /** + * Calls PartitionQuery. + * @function partitionQuery + * @memberof google.spanner.v1.Spanner + * @instance + * @param {google.spanner.v1.IPartitionQueryRequest} request PartitionQueryRequest message or plain object + * @param {google.spanner.v1.Spanner.PartitionQueryCallback} callback Node-style callback called with the error, if any, and PartitionResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Spanner.prototype.partitionQuery = function partitionQuery(request, callback) { + return this.rpcCall(partitionQuery, $root.google.spanner.v1.PartitionQueryRequest, $root.google.spanner.v1.PartitionResponse, request, callback); + }, "name", { value: "PartitionQuery" }); + + /** + * Calls PartitionQuery. + * @function partitionQuery + * @memberof google.spanner.v1.Spanner + * @instance + * @param {google.spanner.v1.IPartitionQueryRequest} request PartitionQueryRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.v1.Spanner|partitionRead}. + * @memberof google.spanner.v1.Spanner + * @typedef PartitionReadCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.spanner.v1.PartitionResponse} [response] PartitionResponse + */ + + /** + * Calls PartitionRead. + * @function partitionRead + * @memberof google.spanner.v1.Spanner + * @instance + * @param {google.spanner.v1.IPartitionReadRequest} request PartitionReadRequest message or plain object + * @param {google.spanner.v1.Spanner.PartitionReadCallback} callback Node-style callback called with the error, if any, and PartitionResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Spanner.prototype.partitionRead = function partitionRead(request, callback) { + return this.rpcCall(partitionRead, $root.google.spanner.v1.PartitionReadRequest, $root.google.spanner.v1.PartitionResponse, request, callback); + }, "name", { value: "PartitionRead" }); + + /** + * Calls PartitionRead. + * @function partitionRead + * @memberof google.spanner.v1.Spanner + * @instance + * @param {google.spanner.v1.IPartitionReadRequest} request PartitionReadRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.spanner.v1.Spanner|batchWrite}. + * @memberof google.spanner.v1.Spanner + * @typedef BatchWriteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.spanner.v1.BatchWriteResponse} [response] BatchWriteResponse + */ + + /** + * Calls BatchWrite. + * @function batchWrite + * @memberof google.spanner.v1.Spanner + * @instance + * @param {google.spanner.v1.IBatchWriteRequest} request BatchWriteRequest message or plain object + * @param {google.spanner.v1.Spanner.BatchWriteCallback} callback Node-style callback called with the error, if any, and BatchWriteResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Spanner.prototype.batchWrite = function batchWrite(request, callback) { + return this.rpcCall(batchWrite, $root.google.spanner.v1.BatchWriteRequest, $root.google.spanner.v1.BatchWriteResponse, request, callback); + }, "name", { value: "BatchWrite" }); + + /** + * Calls BatchWrite. + * @function batchWrite + * @memberof google.spanner.v1.Spanner + * @instance + * @param {google.spanner.v1.IBatchWriteRequest} request BatchWriteRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Spanner; + })(); + + v1.CreateSessionRequest = (function() { + + /** + * Properties of a CreateSessionRequest. + * @memberof google.spanner.v1 + * @interface ICreateSessionRequest + * @property {string|null} [database] CreateSessionRequest database + * @property {google.spanner.v1.ISession|null} [session] CreateSessionRequest session + */ + + /** + * Constructs a new CreateSessionRequest. + * @memberof google.spanner.v1 + * @classdesc Represents a CreateSessionRequest. + * @implements ICreateSessionRequest + * @constructor + * @param {google.spanner.v1.ICreateSessionRequest=} [properties] Properties to set + */ + function CreateSessionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateSessionRequest database. + * @member {string} database + * @memberof google.spanner.v1.CreateSessionRequest + * @instance + */ + CreateSessionRequest.prototype.database = ""; + + /** + * CreateSessionRequest session. + * @member {google.spanner.v1.ISession|null|undefined} session + * @memberof google.spanner.v1.CreateSessionRequest + * @instance + */ + CreateSessionRequest.prototype.session = null; + + /** + * Creates a new CreateSessionRequest instance using the specified properties. + * @function create + * @memberof google.spanner.v1.CreateSessionRequest + * @static + * @param {google.spanner.v1.ICreateSessionRequest=} [properties] Properties to set + * @returns {google.spanner.v1.CreateSessionRequest} CreateSessionRequest instance + */ + CreateSessionRequest.create = function create(properties) { + return new CreateSessionRequest(properties); + }; + + /** + * Encodes the specified CreateSessionRequest message. Does not implicitly {@link google.spanner.v1.CreateSessionRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.CreateSessionRequest + * @static + * @param {google.spanner.v1.ICreateSessionRequest} message CreateSessionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSessionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.database != null && Object.hasOwnProperty.call(message, "database")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.database); + if (message.session != null && Object.hasOwnProperty.call(message, "session")) + $root.google.spanner.v1.Session.encode(message.session, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateSessionRequest message, length delimited. Does not implicitly {@link google.spanner.v1.CreateSessionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.CreateSessionRequest + * @static + * @param {google.spanner.v1.ICreateSessionRequest} message CreateSessionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSessionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateSessionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.CreateSessionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.CreateSessionRequest} CreateSessionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSessionRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.CreateSessionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.database = reader.string(); + break; + } + case 2: { + message.session = $root.google.spanner.v1.Session.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateSessionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.CreateSessionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.CreateSessionRequest} CreateSessionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSessionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateSessionRequest message. + * @function verify + * @memberof google.spanner.v1.CreateSessionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateSessionRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.database != null && message.hasOwnProperty("database")) + if (!$util.isString(message.database)) + return "database: string expected"; + if (message.session != null && message.hasOwnProperty("session")) { + var error = $root.google.spanner.v1.Session.verify(message.session); + if (error) + return "session." + error; + } + return null; + }; + + /** + * Creates a CreateSessionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.CreateSessionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.CreateSessionRequest} CreateSessionRequest + */ + CreateSessionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.CreateSessionRequest) + return object; + var message = new $root.google.spanner.v1.CreateSessionRequest(); + if (object.database != null) + message.database = String(object.database); + if (object.session != null) { + if (typeof object.session !== "object") + throw TypeError(".google.spanner.v1.CreateSessionRequest.session: object expected"); + message.session = $root.google.spanner.v1.Session.fromObject(object.session); + } + return message; + }; + + /** + * Creates a plain object from a CreateSessionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.CreateSessionRequest + * @static + * @param {google.spanner.v1.CreateSessionRequest} message CreateSessionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateSessionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.database = ""; + object.session = null; + } + if (message.database != null && message.hasOwnProperty("database")) + object.database = message.database; + if (message.session != null && message.hasOwnProperty("session")) + object.session = $root.google.spanner.v1.Session.toObject(message.session, options); + return object; + }; + + /** + * Converts this CreateSessionRequest to JSON. + * @function toJSON + * @memberof google.spanner.v1.CreateSessionRequest + * @instance + * @returns {Object.} JSON object + */ + CreateSessionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateSessionRequest + * @function getTypeUrl + * @memberof google.spanner.v1.CreateSessionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateSessionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.CreateSessionRequest"; + }; + + return CreateSessionRequest; + })(); + + v1.BatchCreateSessionsRequest = (function() { + + /** + * Properties of a BatchCreateSessionsRequest. + * @memberof google.spanner.v1 + * @interface IBatchCreateSessionsRequest + * @property {string|null} [database] BatchCreateSessionsRequest database + * @property {google.spanner.v1.ISession|null} [sessionTemplate] BatchCreateSessionsRequest sessionTemplate + * @property {number|null} [sessionCount] BatchCreateSessionsRequest sessionCount + */ + + /** + * Constructs a new BatchCreateSessionsRequest. + * @memberof google.spanner.v1 + * @classdesc Represents a BatchCreateSessionsRequest. + * @implements IBatchCreateSessionsRequest + * @constructor + * @param {google.spanner.v1.IBatchCreateSessionsRequest=} [properties] Properties to set + */ + function BatchCreateSessionsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchCreateSessionsRequest database. + * @member {string} database + * @memberof google.spanner.v1.BatchCreateSessionsRequest + * @instance + */ + BatchCreateSessionsRequest.prototype.database = ""; + + /** + * BatchCreateSessionsRequest sessionTemplate. + * @member {google.spanner.v1.ISession|null|undefined} sessionTemplate + * @memberof google.spanner.v1.BatchCreateSessionsRequest + * @instance + */ + BatchCreateSessionsRequest.prototype.sessionTemplate = null; + + /** + * BatchCreateSessionsRequest sessionCount. + * @member {number} sessionCount + * @memberof google.spanner.v1.BatchCreateSessionsRequest + * @instance + */ + BatchCreateSessionsRequest.prototype.sessionCount = 0; + + /** + * Creates a new BatchCreateSessionsRequest instance using the specified properties. + * @function create + * @memberof google.spanner.v1.BatchCreateSessionsRequest + * @static + * @param {google.spanner.v1.IBatchCreateSessionsRequest=} [properties] Properties to set + * @returns {google.spanner.v1.BatchCreateSessionsRequest} BatchCreateSessionsRequest instance + */ + BatchCreateSessionsRequest.create = function create(properties) { + return new BatchCreateSessionsRequest(properties); + }; + + /** + * Encodes the specified BatchCreateSessionsRequest message. Does not implicitly {@link google.spanner.v1.BatchCreateSessionsRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.BatchCreateSessionsRequest + * @static + * @param {google.spanner.v1.IBatchCreateSessionsRequest} message BatchCreateSessionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchCreateSessionsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.database != null && Object.hasOwnProperty.call(message, "database")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.database); + if (message.sessionTemplate != null && Object.hasOwnProperty.call(message, "sessionTemplate")) + $root.google.spanner.v1.Session.encode(message.sessionTemplate, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.sessionCount != null && Object.hasOwnProperty.call(message, "sessionCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.sessionCount); + return writer; + }; + + /** + * Encodes the specified BatchCreateSessionsRequest message, length delimited. Does not implicitly {@link google.spanner.v1.BatchCreateSessionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.BatchCreateSessionsRequest + * @static + * @param {google.spanner.v1.IBatchCreateSessionsRequest} message BatchCreateSessionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchCreateSessionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchCreateSessionsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.BatchCreateSessionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.BatchCreateSessionsRequest} BatchCreateSessionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchCreateSessionsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.BatchCreateSessionsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.database = reader.string(); + break; + } + case 2: { + message.sessionTemplate = $root.google.spanner.v1.Session.decode(reader, reader.uint32()); + break; + } + case 3: { + message.sessionCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchCreateSessionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.BatchCreateSessionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.BatchCreateSessionsRequest} BatchCreateSessionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchCreateSessionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchCreateSessionsRequest message. + * @function verify + * @memberof google.spanner.v1.BatchCreateSessionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchCreateSessionsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.database != null && message.hasOwnProperty("database")) + if (!$util.isString(message.database)) + return "database: string expected"; + if (message.sessionTemplate != null && message.hasOwnProperty("sessionTemplate")) { + var error = $root.google.spanner.v1.Session.verify(message.sessionTemplate); + if (error) + return "sessionTemplate." + error; + } + if (message.sessionCount != null && message.hasOwnProperty("sessionCount")) + if (!$util.isInteger(message.sessionCount)) + return "sessionCount: integer expected"; + return null; + }; + + /** + * Creates a BatchCreateSessionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.BatchCreateSessionsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.BatchCreateSessionsRequest} BatchCreateSessionsRequest + */ + BatchCreateSessionsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.BatchCreateSessionsRequest) + return object; + var message = new $root.google.spanner.v1.BatchCreateSessionsRequest(); + if (object.database != null) + message.database = String(object.database); + if (object.sessionTemplate != null) { + if (typeof object.sessionTemplate !== "object") + throw TypeError(".google.spanner.v1.BatchCreateSessionsRequest.sessionTemplate: object expected"); + message.sessionTemplate = $root.google.spanner.v1.Session.fromObject(object.sessionTemplate); + } + if (object.sessionCount != null) + message.sessionCount = object.sessionCount | 0; + return message; + }; + + /** + * Creates a plain object from a BatchCreateSessionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.BatchCreateSessionsRequest + * @static + * @param {google.spanner.v1.BatchCreateSessionsRequest} message BatchCreateSessionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchCreateSessionsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.database = ""; + object.sessionTemplate = null; + object.sessionCount = 0; + } + if (message.database != null && message.hasOwnProperty("database")) + object.database = message.database; + if (message.sessionTemplate != null && message.hasOwnProperty("sessionTemplate")) + object.sessionTemplate = $root.google.spanner.v1.Session.toObject(message.sessionTemplate, options); + if (message.sessionCount != null && message.hasOwnProperty("sessionCount")) + object.sessionCount = message.sessionCount; + return object; + }; + + /** + * Converts this BatchCreateSessionsRequest to JSON. + * @function toJSON + * @memberof google.spanner.v1.BatchCreateSessionsRequest + * @instance + * @returns {Object.} JSON object + */ + BatchCreateSessionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchCreateSessionsRequest + * @function getTypeUrl + * @memberof google.spanner.v1.BatchCreateSessionsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchCreateSessionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.BatchCreateSessionsRequest"; + }; + + return BatchCreateSessionsRequest; + })(); + + v1.BatchCreateSessionsResponse = (function() { + + /** + * Properties of a BatchCreateSessionsResponse. + * @memberof google.spanner.v1 + * @interface IBatchCreateSessionsResponse + * @property {Array.|null} [session] BatchCreateSessionsResponse session + */ + + /** + * Constructs a new BatchCreateSessionsResponse. + * @memberof google.spanner.v1 + * @classdesc Represents a BatchCreateSessionsResponse. + * @implements IBatchCreateSessionsResponse + * @constructor + * @param {google.spanner.v1.IBatchCreateSessionsResponse=} [properties] Properties to set + */ + function BatchCreateSessionsResponse(properties) { + this.session = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchCreateSessionsResponse session. + * @member {Array.} session + * @memberof google.spanner.v1.BatchCreateSessionsResponse + * @instance + */ + BatchCreateSessionsResponse.prototype.session = $util.emptyArray; + + /** + * Creates a new BatchCreateSessionsResponse instance using the specified properties. + * @function create + * @memberof google.spanner.v1.BatchCreateSessionsResponse + * @static + * @param {google.spanner.v1.IBatchCreateSessionsResponse=} [properties] Properties to set + * @returns {google.spanner.v1.BatchCreateSessionsResponse} BatchCreateSessionsResponse instance + */ + BatchCreateSessionsResponse.create = function create(properties) { + return new BatchCreateSessionsResponse(properties); + }; + + /** + * Encodes the specified BatchCreateSessionsResponse message. Does not implicitly {@link google.spanner.v1.BatchCreateSessionsResponse.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.BatchCreateSessionsResponse + * @static + * @param {google.spanner.v1.IBatchCreateSessionsResponse} message BatchCreateSessionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchCreateSessionsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.session != null && message.session.length) + for (var i = 0; i < message.session.length; ++i) + $root.google.spanner.v1.Session.encode(message.session[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchCreateSessionsResponse message, length delimited. Does not implicitly {@link google.spanner.v1.BatchCreateSessionsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.BatchCreateSessionsResponse + * @static + * @param {google.spanner.v1.IBatchCreateSessionsResponse} message BatchCreateSessionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchCreateSessionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchCreateSessionsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.BatchCreateSessionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.BatchCreateSessionsResponse} BatchCreateSessionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchCreateSessionsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.BatchCreateSessionsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.session && message.session.length)) + message.session = []; + message.session.push($root.google.spanner.v1.Session.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchCreateSessionsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.BatchCreateSessionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.BatchCreateSessionsResponse} BatchCreateSessionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchCreateSessionsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchCreateSessionsResponse message. + * @function verify + * @memberof google.spanner.v1.BatchCreateSessionsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchCreateSessionsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.session != null && message.hasOwnProperty("session")) { + if (!Array.isArray(message.session)) + return "session: array expected"; + for (var i = 0; i < message.session.length; ++i) { + var error = $root.google.spanner.v1.Session.verify(message.session[i]); + if (error) + return "session." + error; + } + } + return null; + }; + + /** + * Creates a BatchCreateSessionsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.BatchCreateSessionsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.BatchCreateSessionsResponse} BatchCreateSessionsResponse + */ + BatchCreateSessionsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.BatchCreateSessionsResponse) + return object; + var message = new $root.google.spanner.v1.BatchCreateSessionsResponse(); + if (object.session) { + if (!Array.isArray(object.session)) + throw TypeError(".google.spanner.v1.BatchCreateSessionsResponse.session: array expected"); + message.session = []; + for (var i = 0; i < object.session.length; ++i) { + if (typeof object.session[i] !== "object") + throw TypeError(".google.spanner.v1.BatchCreateSessionsResponse.session: object expected"); + message.session[i] = $root.google.spanner.v1.Session.fromObject(object.session[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BatchCreateSessionsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.BatchCreateSessionsResponse + * @static + * @param {google.spanner.v1.BatchCreateSessionsResponse} message BatchCreateSessionsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchCreateSessionsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.session = []; + if (message.session && message.session.length) { + object.session = []; + for (var j = 0; j < message.session.length; ++j) + object.session[j] = $root.google.spanner.v1.Session.toObject(message.session[j], options); + } + return object; + }; + + /** + * Converts this BatchCreateSessionsResponse to JSON. + * @function toJSON + * @memberof google.spanner.v1.BatchCreateSessionsResponse + * @instance + * @returns {Object.} JSON object + */ + BatchCreateSessionsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchCreateSessionsResponse + * @function getTypeUrl + * @memberof google.spanner.v1.BatchCreateSessionsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchCreateSessionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.BatchCreateSessionsResponse"; + }; + + return BatchCreateSessionsResponse; + })(); + + v1.Session = (function() { + + /** + * Properties of a Session. + * @memberof google.spanner.v1 + * @interface ISession + * @property {string|null} [name] Session name + * @property {Object.|null} [labels] Session labels + * @property {google.protobuf.ITimestamp|null} [createTime] Session createTime + * @property {google.protobuf.ITimestamp|null} [approximateLastUseTime] Session approximateLastUseTime + * @property {string|null} [creatorRole] Session creatorRole + * @property {boolean|null} [multiplexed] Session multiplexed + */ + + /** + * Constructs a new Session. + * @memberof google.spanner.v1 + * @classdesc Represents a Session. + * @implements ISession + * @constructor + * @param {google.spanner.v1.ISession=} [properties] Properties to set + */ + function Session(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]]; + } + + /** + * Session name. + * @member {string} name + * @memberof google.spanner.v1.Session + * @instance + */ + Session.prototype.name = ""; + + /** + * Session labels. + * @member {Object.} labels + * @memberof google.spanner.v1.Session + * @instance + */ + Session.prototype.labels = $util.emptyObject; + + /** + * Session createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.spanner.v1.Session + * @instance + */ + Session.prototype.createTime = null; + + /** + * Session approximateLastUseTime. + * @member {google.protobuf.ITimestamp|null|undefined} approximateLastUseTime + * @memberof google.spanner.v1.Session + * @instance + */ + Session.prototype.approximateLastUseTime = null; + + /** + * Session creatorRole. + * @member {string} creatorRole + * @memberof google.spanner.v1.Session + * @instance + */ + Session.prototype.creatorRole = ""; + + /** + * Session multiplexed. + * @member {boolean} multiplexed + * @memberof google.spanner.v1.Session + * @instance + */ + Session.prototype.multiplexed = false; + + /** + * Creates a new Session instance using the specified properties. + * @function create + * @memberof google.spanner.v1.Session + * @static + * @param {google.spanner.v1.ISession=} [properties] Properties to set + * @returns {google.spanner.v1.Session} Session instance + */ + Session.create = function create(properties) { + return new Session(properties); + }; + + /** + * Encodes the specified Session message. Does not implicitly {@link google.spanner.v1.Session.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.Session + * @static + * @param {google.spanner.v1.ISession} message Session message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Session.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.approximateLastUseTime != null && Object.hasOwnProperty.call(message, "approximateLastUseTime")) + $root.google.protobuf.Timestamp.encode(message.approximateLastUseTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.creatorRole != null && Object.hasOwnProperty.call(message, "creatorRole")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.creatorRole); + if (message.multiplexed != null && Object.hasOwnProperty.call(message, "multiplexed")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.multiplexed); + return writer; + }; + + /** + * Encodes the specified Session message, length delimited. Does not implicitly {@link google.spanner.v1.Session.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.Session + * @static + * @param {google.spanner.v1.ISession} message Session message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Session.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Session message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.Session + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.Session} Session + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Session.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.Session(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 3: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.approximateLastUseTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.creatorRole = reader.string(); + break; + } + case 6: { + message.multiplexed = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Session message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.Session + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.Session} Session + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Session.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Session message. + * @function verify + * @memberof google.spanner.v1.Session + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Session.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.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.approximateLastUseTime != null && message.hasOwnProperty("approximateLastUseTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.approximateLastUseTime); + if (error) + return "approximateLastUseTime." + error; + } + if (message.creatorRole != null && message.hasOwnProperty("creatorRole")) + if (!$util.isString(message.creatorRole)) + return "creatorRole: string expected"; + if (message.multiplexed != null && message.hasOwnProperty("multiplexed")) + if (typeof message.multiplexed !== "boolean") + return "multiplexed: boolean expected"; + return null; + }; + + /** + * Creates a Session message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.Session + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.Session} Session + */ + Session.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.Session) + return object; + var message = new $root.google.spanner.v1.Session(); + if (object.name != null) + message.name = String(object.name); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.spanner.v1.Session.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.spanner.v1.Session.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.approximateLastUseTime != null) { + if (typeof object.approximateLastUseTime !== "object") + throw TypeError(".google.spanner.v1.Session.approximateLastUseTime: object expected"); + message.approximateLastUseTime = $root.google.protobuf.Timestamp.fromObject(object.approximateLastUseTime); + } + if (object.creatorRole != null) + message.creatorRole = String(object.creatorRole); + if (object.multiplexed != null) + message.multiplexed = Boolean(object.multiplexed); + return message; + }; + + /** + * Creates a plain object from a Session message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.Session + * @static + * @param {google.spanner.v1.Session} message Session + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Session.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.approximateLastUseTime = null; + object.creatorRole = ""; + object.multiplexed = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.approximateLastUseTime != null && message.hasOwnProperty("approximateLastUseTime")) + object.approximateLastUseTime = $root.google.protobuf.Timestamp.toObject(message.approximateLastUseTime, options); + if (message.creatorRole != null && message.hasOwnProperty("creatorRole")) + object.creatorRole = message.creatorRole; + if (message.multiplexed != null && message.hasOwnProperty("multiplexed")) + object.multiplexed = message.multiplexed; + return object; + }; + + /** + * Converts this Session to JSON. + * @function toJSON + * @memberof google.spanner.v1.Session + * @instance + * @returns {Object.} JSON object + */ + Session.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Session + * @function getTypeUrl + * @memberof google.spanner.v1.Session + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Session.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.Session"; + }; + + return Session; + })(); + + v1.GetSessionRequest = (function() { + + /** + * Properties of a GetSessionRequest. + * @memberof google.spanner.v1 + * @interface IGetSessionRequest + * @property {string|null} [name] GetSessionRequest name + */ + + /** + * Constructs a new GetSessionRequest. + * @memberof google.spanner.v1 + * @classdesc Represents a GetSessionRequest. + * @implements IGetSessionRequest + * @constructor + * @param {google.spanner.v1.IGetSessionRequest=} [properties] Properties to set + */ + function GetSessionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetSessionRequest name. + * @member {string} name + * @memberof google.spanner.v1.GetSessionRequest + * @instance + */ + GetSessionRequest.prototype.name = ""; + + /** + * Creates a new GetSessionRequest instance using the specified properties. + * @function create + * @memberof google.spanner.v1.GetSessionRequest + * @static + * @param {google.spanner.v1.IGetSessionRequest=} [properties] Properties to set + * @returns {google.spanner.v1.GetSessionRequest} GetSessionRequest instance + */ + GetSessionRequest.create = function create(properties) { + return new GetSessionRequest(properties); + }; + + /** + * Encodes the specified GetSessionRequest message. Does not implicitly {@link google.spanner.v1.GetSessionRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.GetSessionRequest + * @static + * @param {google.spanner.v1.IGetSessionRequest} message GetSessionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSessionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetSessionRequest message, length delimited. Does not implicitly {@link google.spanner.v1.GetSessionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.GetSessionRequest + * @static + * @param {google.spanner.v1.IGetSessionRequest} message GetSessionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSessionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetSessionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.GetSessionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.GetSessionRequest} GetSessionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSessionRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.GetSessionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetSessionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.GetSessionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.GetSessionRequest} GetSessionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSessionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetSessionRequest message. + * @function verify + * @memberof google.spanner.v1.GetSessionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetSessionRequest.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 GetSessionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.GetSessionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.GetSessionRequest} GetSessionRequest + */ + GetSessionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.GetSessionRequest) + return object; + var message = new $root.google.spanner.v1.GetSessionRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetSessionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.GetSessionRequest + * @static + * @param {google.spanner.v1.GetSessionRequest} message GetSessionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetSessionRequest.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 GetSessionRequest to JSON. + * @function toJSON + * @memberof google.spanner.v1.GetSessionRequest + * @instance + * @returns {Object.} JSON object + */ + GetSessionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetSessionRequest + * @function getTypeUrl + * @memberof google.spanner.v1.GetSessionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetSessionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.GetSessionRequest"; + }; + + return GetSessionRequest; + })(); + + v1.ListSessionsRequest = (function() { + + /** + * Properties of a ListSessionsRequest. + * @memberof google.spanner.v1 + * @interface IListSessionsRequest + * @property {string|null} [database] ListSessionsRequest database + * @property {number|null} [pageSize] ListSessionsRequest pageSize + * @property {string|null} [pageToken] ListSessionsRequest pageToken + * @property {string|null} [filter] ListSessionsRequest filter + */ + + /** + * Constructs a new ListSessionsRequest. + * @memberof google.spanner.v1 + * @classdesc Represents a ListSessionsRequest. + * @implements IListSessionsRequest + * @constructor + * @param {google.spanner.v1.IListSessionsRequest=} [properties] Properties to set + */ + function ListSessionsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListSessionsRequest database. + * @member {string} database + * @memberof google.spanner.v1.ListSessionsRequest + * @instance + */ + ListSessionsRequest.prototype.database = ""; + + /** + * ListSessionsRequest pageSize. + * @member {number} pageSize + * @memberof google.spanner.v1.ListSessionsRequest + * @instance + */ + ListSessionsRequest.prototype.pageSize = 0; + + /** + * ListSessionsRequest pageToken. + * @member {string} pageToken + * @memberof google.spanner.v1.ListSessionsRequest + * @instance + */ + ListSessionsRequest.prototype.pageToken = ""; + + /** + * ListSessionsRequest filter. + * @member {string} filter + * @memberof google.spanner.v1.ListSessionsRequest + * @instance + */ + ListSessionsRequest.prototype.filter = ""; + + /** + * Creates a new ListSessionsRequest instance using the specified properties. + * @function create + * @memberof google.spanner.v1.ListSessionsRequest + * @static + * @param {google.spanner.v1.IListSessionsRequest=} [properties] Properties to set + * @returns {google.spanner.v1.ListSessionsRequest} ListSessionsRequest instance + */ + ListSessionsRequest.create = function create(properties) { + return new ListSessionsRequest(properties); + }; + + /** + * Encodes the specified ListSessionsRequest message. Does not implicitly {@link google.spanner.v1.ListSessionsRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.ListSessionsRequest + * @static + * @param {google.spanner.v1.IListSessionsRequest} message ListSessionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSessionsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.database != null && Object.hasOwnProperty.call(message, "database")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.database); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + return writer; + }; + + /** + * Encodes the specified ListSessionsRequest message, length delimited. Does not implicitly {@link google.spanner.v1.ListSessionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.ListSessionsRequest + * @static + * @param {google.spanner.v1.IListSessionsRequest} message ListSessionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSessionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSessionsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.ListSessionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.ListSessionsRequest} ListSessionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSessionsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.ListSessionsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.database = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSessionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.ListSessionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.ListSessionsRequest} ListSessionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSessionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSessionsRequest message. + * @function verify + * @memberof google.spanner.v1.ListSessionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSessionsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.database != null && message.hasOwnProperty("database")) + if (!$util.isString(message.database)) + return "database: 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.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; + + /** + * Creates a ListSessionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.ListSessionsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.ListSessionsRequest} ListSessionsRequest + */ + ListSessionsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.ListSessionsRequest) + return object; + var message = new $root.google.spanner.v1.ListSessionsRequest(); + if (object.database != null) + message.database = String(object.database); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; + + /** + * Creates a plain object from a ListSessionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.ListSessionsRequest + * @static + * @param {google.spanner.v1.ListSessionsRequest} message ListSessionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSessionsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.database = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + } + if (message.database != null && message.hasOwnProperty("database")) + object.database = message.database; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; + + /** + * Converts this ListSessionsRequest to JSON. + * @function toJSON + * @memberof google.spanner.v1.ListSessionsRequest + * @instance + * @returns {Object.} JSON object + */ + ListSessionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSessionsRequest + * @function getTypeUrl + * @memberof google.spanner.v1.ListSessionsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSessionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.ListSessionsRequest"; + }; + + return ListSessionsRequest; + })(); + + v1.ListSessionsResponse = (function() { + + /** + * Properties of a ListSessionsResponse. + * @memberof google.spanner.v1 + * @interface IListSessionsResponse + * @property {Array.|null} [sessions] ListSessionsResponse sessions + * @property {string|null} [nextPageToken] ListSessionsResponse nextPageToken + */ + + /** + * Constructs a new ListSessionsResponse. + * @memberof google.spanner.v1 + * @classdesc Represents a ListSessionsResponse. + * @implements IListSessionsResponse + * @constructor + * @param {google.spanner.v1.IListSessionsResponse=} [properties] Properties to set + */ + function ListSessionsResponse(properties) { + this.sessions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListSessionsResponse sessions. + * @member {Array.} sessions + * @memberof google.spanner.v1.ListSessionsResponse + * @instance + */ + ListSessionsResponse.prototype.sessions = $util.emptyArray; + + /** + * ListSessionsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.spanner.v1.ListSessionsResponse + * @instance + */ + ListSessionsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListSessionsResponse instance using the specified properties. + * @function create + * @memberof google.spanner.v1.ListSessionsResponse + * @static + * @param {google.spanner.v1.IListSessionsResponse=} [properties] Properties to set + * @returns {google.spanner.v1.ListSessionsResponse} ListSessionsResponse instance + */ + ListSessionsResponse.create = function create(properties) { + return new ListSessionsResponse(properties); + }; + + /** + * Encodes the specified ListSessionsResponse message. Does not implicitly {@link google.spanner.v1.ListSessionsResponse.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.ListSessionsResponse + * @static + * @param {google.spanner.v1.IListSessionsResponse} message ListSessionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSessionsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sessions != null && message.sessions.length) + for (var i = 0; i < message.sessions.length; ++i) + $root.google.spanner.v1.Session.encode(message.sessions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListSessionsResponse message, length delimited. Does not implicitly {@link google.spanner.v1.ListSessionsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.ListSessionsResponse + * @static + * @param {google.spanner.v1.IListSessionsResponse} message ListSessionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSessionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSessionsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.ListSessionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.ListSessionsResponse} ListSessionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSessionsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.ListSessionsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.sessions && message.sessions.length)) + message.sessions = []; + message.sessions.push($root.google.spanner.v1.Session.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSessionsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.ListSessionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.ListSessionsResponse} ListSessionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSessionsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSessionsResponse message. + * @function verify + * @memberof google.spanner.v1.ListSessionsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSessionsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sessions != null && message.hasOwnProperty("sessions")) { + if (!Array.isArray(message.sessions)) + return "sessions: array expected"; + for (var i = 0; i < message.sessions.length; ++i) { + var error = $root.google.spanner.v1.Session.verify(message.sessions[i]); + if (error) + return "sessions." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListSessionsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.ListSessionsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.ListSessionsResponse} ListSessionsResponse + */ + ListSessionsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.ListSessionsResponse) + return object; + var message = new $root.google.spanner.v1.ListSessionsResponse(); + if (object.sessions) { + if (!Array.isArray(object.sessions)) + throw TypeError(".google.spanner.v1.ListSessionsResponse.sessions: array expected"); + message.sessions = []; + for (var i = 0; i < object.sessions.length; ++i) { + if (typeof object.sessions[i] !== "object") + throw TypeError(".google.spanner.v1.ListSessionsResponse.sessions: object expected"); + message.sessions[i] = $root.google.spanner.v1.Session.fromObject(object.sessions[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListSessionsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.ListSessionsResponse + * @static + * @param {google.spanner.v1.ListSessionsResponse} message ListSessionsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSessionsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.sessions = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.sessions && message.sessions.length) { + object.sessions = []; + for (var j = 0; j < message.sessions.length; ++j) + object.sessions[j] = $root.google.spanner.v1.Session.toObject(message.sessions[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListSessionsResponse to JSON. + * @function toJSON + * @memberof google.spanner.v1.ListSessionsResponse + * @instance + * @returns {Object.} JSON object + */ + ListSessionsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSessionsResponse + * @function getTypeUrl + * @memberof google.spanner.v1.ListSessionsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSessionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.ListSessionsResponse"; + }; + + return ListSessionsResponse; + })(); + + v1.DeleteSessionRequest = (function() { + + /** + * Properties of a DeleteSessionRequest. + * @memberof google.spanner.v1 + * @interface IDeleteSessionRequest + * @property {string|null} [name] DeleteSessionRequest name + */ + + /** + * Constructs a new DeleteSessionRequest. + * @memberof google.spanner.v1 + * @classdesc Represents a DeleteSessionRequest. + * @implements IDeleteSessionRequest + * @constructor + * @param {google.spanner.v1.IDeleteSessionRequest=} [properties] Properties to set + */ + function DeleteSessionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteSessionRequest name. + * @member {string} name + * @memberof google.spanner.v1.DeleteSessionRequest + * @instance + */ + DeleteSessionRequest.prototype.name = ""; + + /** + * Creates a new DeleteSessionRequest instance using the specified properties. + * @function create + * @memberof google.spanner.v1.DeleteSessionRequest + * @static + * @param {google.spanner.v1.IDeleteSessionRequest=} [properties] Properties to set + * @returns {google.spanner.v1.DeleteSessionRequest} DeleteSessionRequest instance + */ + DeleteSessionRequest.create = function create(properties) { + return new DeleteSessionRequest(properties); + }; + + /** + * Encodes the specified DeleteSessionRequest message. Does not implicitly {@link google.spanner.v1.DeleteSessionRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.DeleteSessionRequest + * @static + * @param {google.spanner.v1.IDeleteSessionRequest} message DeleteSessionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSessionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteSessionRequest message, length delimited. Does not implicitly {@link google.spanner.v1.DeleteSessionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.DeleteSessionRequest + * @static + * @param {google.spanner.v1.IDeleteSessionRequest} message DeleteSessionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSessionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteSessionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.DeleteSessionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.DeleteSessionRequest} DeleteSessionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSessionRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.DeleteSessionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteSessionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.DeleteSessionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.DeleteSessionRequest} DeleteSessionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSessionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteSessionRequest message. + * @function verify + * @memberof google.spanner.v1.DeleteSessionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteSessionRequest.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 DeleteSessionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.DeleteSessionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.DeleteSessionRequest} DeleteSessionRequest + */ + DeleteSessionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.DeleteSessionRequest) + return object; + var message = new $root.google.spanner.v1.DeleteSessionRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteSessionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.DeleteSessionRequest + * @static + * @param {google.spanner.v1.DeleteSessionRequest} message DeleteSessionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteSessionRequest.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 DeleteSessionRequest to JSON. + * @function toJSON + * @memberof google.spanner.v1.DeleteSessionRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteSessionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteSessionRequest + * @function getTypeUrl + * @memberof google.spanner.v1.DeleteSessionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteSessionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.DeleteSessionRequest"; + }; + + return DeleteSessionRequest; + })(); + + v1.RequestOptions = (function() { + + /** + * Properties of a RequestOptions. + * @memberof google.spanner.v1 + * @interface IRequestOptions + * @property {google.spanner.v1.RequestOptions.Priority|null} [priority] RequestOptions priority + * @property {string|null} [requestTag] RequestOptions requestTag + * @property {string|null} [transactionTag] RequestOptions transactionTag + * @property {google.spanner.v1.RequestOptions.IClientContext|null} [clientContext] RequestOptions clientContext + */ + + /** + * Constructs a new RequestOptions. + * @memberof google.spanner.v1 + * @classdesc Represents a RequestOptions. + * @implements IRequestOptions + * @constructor + * @param {google.spanner.v1.IRequestOptions=} [properties] Properties to set + */ + function RequestOptions(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RequestOptions priority. + * @member {google.spanner.v1.RequestOptions.Priority} priority + * @memberof google.spanner.v1.RequestOptions + * @instance + */ + RequestOptions.prototype.priority = 0; + + /** + * RequestOptions requestTag. + * @member {string} requestTag + * @memberof google.spanner.v1.RequestOptions + * @instance + */ + RequestOptions.prototype.requestTag = ""; + + /** + * RequestOptions transactionTag. + * @member {string} transactionTag + * @memberof google.spanner.v1.RequestOptions + * @instance + */ + RequestOptions.prototype.transactionTag = ""; + + /** + * RequestOptions clientContext. + * @member {google.spanner.v1.RequestOptions.IClientContext|null|undefined} clientContext + * @memberof google.spanner.v1.RequestOptions + * @instance + */ + RequestOptions.prototype.clientContext = null; + + /** + * Creates a new RequestOptions instance using the specified properties. + * @function create + * @memberof google.spanner.v1.RequestOptions + * @static + * @param {google.spanner.v1.IRequestOptions=} [properties] Properties to set + * @returns {google.spanner.v1.RequestOptions} RequestOptions instance + */ + RequestOptions.create = function create(properties) { + return new RequestOptions(properties); + }; + + /** + * Encodes the specified RequestOptions message. Does not implicitly {@link google.spanner.v1.RequestOptions.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.RequestOptions + * @static + * @param {google.spanner.v1.IRequestOptions} message RequestOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.priority != null && Object.hasOwnProperty.call(message, "priority")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.priority); + if (message.requestTag != null && Object.hasOwnProperty.call(message, "requestTag")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestTag); + if (message.transactionTag != null && Object.hasOwnProperty.call(message, "transactionTag")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.transactionTag); + if (message.clientContext != null && Object.hasOwnProperty.call(message, "clientContext")) + $root.google.spanner.v1.RequestOptions.ClientContext.encode(message.clientContext, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RequestOptions message, length delimited. Does not implicitly {@link google.spanner.v1.RequestOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.RequestOptions + * @static + * @param {google.spanner.v1.IRequestOptions} message RequestOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RequestOptions message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.RequestOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.RequestOptions} RequestOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.RequestOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.priority = reader.int32(); + break; + } + case 2: { + message.requestTag = reader.string(); + break; + } + case 3: { + message.transactionTag = reader.string(); + break; + } + case 4: { + message.clientContext = $root.google.spanner.v1.RequestOptions.ClientContext.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RequestOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.RequestOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.RequestOptions} RequestOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RequestOptions message. + * @function verify + * @memberof google.spanner.v1.RequestOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RequestOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.priority != null && message.hasOwnProperty("priority")) + switch (message.priority) { + default: + return "priority: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.requestTag != null && message.hasOwnProperty("requestTag")) + if (!$util.isString(message.requestTag)) + return "requestTag: string expected"; + if (message.transactionTag != null && message.hasOwnProperty("transactionTag")) + if (!$util.isString(message.transactionTag)) + return "transactionTag: string expected"; + if (message.clientContext != null && message.hasOwnProperty("clientContext")) { + var error = $root.google.spanner.v1.RequestOptions.ClientContext.verify(message.clientContext); + if (error) + return "clientContext." + error; + } + return null; + }; + + /** + * Creates a RequestOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.RequestOptions + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.RequestOptions} RequestOptions + */ + RequestOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.RequestOptions) + return object; + var message = new $root.google.spanner.v1.RequestOptions(); + switch (object.priority) { + default: + if (typeof object.priority === "number") { + message.priority = object.priority; + break; + } + break; + case "PRIORITY_UNSPECIFIED": + case 0: + message.priority = 0; + break; + case "PRIORITY_LOW": + case 1: + message.priority = 1; + break; + case "PRIORITY_MEDIUM": + case 2: + message.priority = 2; + break; + case "PRIORITY_HIGH": + case 3: + message.priority = 3; + break; + } + if (object.requestTag != null) + message.requestTag = String(object.requestTag); + if (object.transactionTag != null) + message.transactionTag = String(object.transactionTag); + if (object.clientContext != null) { + if (typeof object.clientContext !== "object") + throw TypeError(".google.spanner.v1.RequestOptions.clientContext: object expected"); + message.clientContext = $root.google.spanner.v1.RequestOptions.ClientContext.fromObject(object.clientContext); + } + return message; + }; + + /** + * Creates a plain object from a RequestOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.RequestOptions + * @static + * @param {google.spanner.v1.RequestOptions} message RequestOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RequestOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.priority = options.enums === String ? "PRIORITY_UNSPECIFIED" : 0; + object.requestTag = ""; + object.transactionTag = ""; + object.clientContext = null; + } + if (message.priority != null && message.hasOwnProperty("priority")) + object.priority = options.enums === String ? $root.google.spanner.v1.RequestOptions.Priority[message.priority] === undefined ? message.priority : $root.google.spanner.v1.RequestOptions.Priority[message.priority] : message.priority; + if (message.requestTag != null && message.hasOwnProperty("requestTag")) + object.requestTag = message.requestTag; + if (message.transactionTag != null && message.hasOwnProperty("transactionTag")) + object.transactionTag = message.transactionTag; + if (message.clientContext != null && message.hasOwnProperty("clientContext")) + object.clientContext = $root.google.spanner.v1.RequestOptions.ClientContext.toObject(message.clientContext, options); + return object; + }; + + /** + * Converts this RequestOptions to JSON. + * @function toJSON + * @memberof google.spanner.v1.RequestOptions + * @instance + * @returns {Object.} JSON object + */ + RequestOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RequestOptions + * @function getTypeUrl + * @memberof google.spanner.v1.RequestOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RequestOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.RequestOptions"; + }; + + /** + * Priority enum. + * @name google.spanner.v1.RequestOptions.Priority + * @enum {number} + * @property {number} PRIORITY_UNSPECIFIED=0 PRIORITY_UNSPECIFIED value + * @property {number} PRIORITY_LOW=1 PRIORITY_LOW value + * @property {number} PRIORITY_MEDIUM=2 PRIORITY_MEDIUM value + * @property {number} PRIORITY_HIGH=3 PRIORITY_HIGH value + */ + RequestOptions.Priority = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PRIORITY_UNSPECIFIED"] = 0; + values[valuesById[1] = "PRIORITY_LOW"] = 1; + values[valuesById[2] = "PRIORITY_MEDIUM"] = 2; + values[valuesById[3] = "PRIORITY_HIGH"] = 3; + return values; + })(); + + RequestOptions.ClientContext = (function() { + + /** + * Properties of a ClientContext. + * @memberof google.spanner.v1.RequestOptions + * @interface IClientContext + * @property {Object.|null} [secureContext] ClientContext secureContext + */ + + /** + * Constructs a new ClientContext. + * @memberof google.spanner.v1.RequestOptions + * @classdesc Represents a ClientContext. + * @implements IClientContext + * @constructor + * @param {google.spanner.v1.RequestOptions.IClientContext=} [properties] Properties to set + */ + function ClientContext(properties) { + this.secureContext = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClientContext secureContext. + * @member {Object.} secureContext + * @memberof google.spanner.v1.RequestOptions.ClientContext + * @instance + */ + ClientContext.prototype.secureContext = $util.emptyObject; + + /** + * Creates a new ClientContext instance using the specified properties. + * @function create + * @memberof google.spanner.v1.RequestOptions.ClientContext + * @static + * @param {google.spanner.v1.RequestOptions.IClientContext=} [properties] Properties to set + * @returns {google.spanner.v1.RequestOptions.ClientContext} ClientContext instance + */ + ClientContext.create = function create(properties) { + return new ClientContext(properties); + }; + + /** + * Encodes the specified ClientContext message. Does not implicitly {@link google.spanner.v1.RequestOptions.ClientContext.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.RequestOptions.ClientContext + * @static + * @param {google.spanner.v1.RequestOptions.IClientContext} message ClientContext message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientContext.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.secureContext != null && Object.hasOwnProperty.call(message, "secureContext")) + for (var keys = Object.keys(message.secureContext), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.protobuf.Value.encode(message.secureContext[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified ClientContext message, length delimited. Does not implicitly {@link google.spanner.v1.RequestOptions.ClientContext.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.RequestOptions.ClientContext + * @static + * @param {google.spanner.v1.RequestOptions.IClientContext} message ClientContext message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientContext.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClientContext message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.RequestOptions.ClientContext + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.RequestOptions.ClientContext} ClientContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientContext.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.RequestOptions.ClientContext(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (message.secureContext === $util.emptyObject) + message.secureContext = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.secureContext[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClientContext message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.RequestOptions.ClientContext + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.RequestOptions.ClientContext} ClientContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientContext.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClientContext message. + * @function verify + * @memberof google.spanner.v1.RequestOptions.ClientContext + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClientContext.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.secureContext != null && message.hasOwnProperty("secureContext")) { + if (!$util.isObject(message.secureContext)) + return "secureContext: object expected"; + var key = Object.keys(message.secureContext); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.secureContext[key[i]]); + if (error) + return "secureContext." + error; + } + } + return null; + }; + + /** + * Creates a ClientContext message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.RequestOptions.ClientContext + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.RequestOptions.ClientContext} ClientContext + */ + ClientContext.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.RequestOptions.ClientContext) + return object; + var message = new $root.google.spanner.v1.RequestOptions.ClientContext(); + if (object.secureContext) { + if (typeof object.secureContext !== "object") + throw TypeError(".google.spanner.v1.RequestOptions.ClientContext.secureContext: object expected"); + message.secureContext = {}; + for (var keys = Object.keys(object.secureContext), i = 0; i < keys.length; ++i) { + if (typeof object.secureContext[keys[i]] !== "object") + throw TypeError(".google.spanner.v1.RequestOptions.ClientContext.secureContext: object expected"); + message.secureContext[keys[i]] = $root.google.protobuf.Value.fromObject(object.secureContext[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a ClientContext message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.RequestOptions.ClientContext + * @static + * @param {google.spanner.v1.RequestOptions.ClientContext} message ClientContext + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClientContext.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.secureContext = {}; + var keys2; + if (message.secureContext && (keys2 = Object.keys(message.secureContext)).length) { + object.secureContext = {}; + for (var j = 0; j < keys2.length; ++j) + object.secureContext[keys2[j]] = $root.google.protobuf.Value.toObject(message.secureContext[keys2[j]], options); + } + return object; + }; + + /** + * Converts this ClientContext to JSON. + * @function toJSON + * @memberof google.spanner.v1.RequestOptions.ClientContext + * @instance + * @returns {Object.} JSON object + */ + ClientContext.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClientContext + * @function getTypeUrl + * @memberof google.spanner.v1.RequestOptions.ClientContext + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClientContext.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.RequestOptions.ClientContext"; + }; + + return ClientContext; + })(); + + return RequestOptions; + })(); + + v1.DirectedReadOptions = (function() { + + /** + * Properties of a DirectedReadOptions. + * @memberof google.spanner.v1 + * @interface IDirectedReadOptions + * @property {google.spanner.v1.DirectedReadOptions.IIncludeReplicas|null} [includeReplicas] DirectedReadOptions includeReplicas + * @property {google.spanner.v1.DirectedReadOptions.IExcludeReplicas|null} [excludeReplicas] DirectedReadOptions excludeReplicas + */ + + /** + * Constructs a new DirectedReadOptions. + * @memberof google.spanner.v1 + * @classdesc Represents a DirectedReadOptions. + * @implements IDirectedReadOptions + * @constructor + * @param {google.spanner.v1.IDirectedReadOptions=} [properties] Properties to set + */ + function DirectedReadOptions(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DirectedReadOptions includeReplicas. + * @member {google.spanner.v1.DirectedReadOptions.IIncludeReplicas|null|undefined} includeReplicas + * @memberof google.spanner.v1.DirectedReadOptions + * @instance + */ + DirectedReadOptions.prototype.includeReplicas = null; + + /** + * DirectedReadOptions excludeReplicas. + * @member {google.spanner.v1.DirectedReadOptions.IExcludeReplicas|null|undefined} excludeReplicas + * @memberof google.spanner.v1.DirectedReadOptions + * @instance + */ + DirectedReadOptions.prototype.excludeReplicas = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DirectedReadOptions replicas. + * @member {"includeReplicas"|"excludeReplicas"|undefined} replicas + * @memberof google.spanner.v1.DirectedReadOptions + * @instance + */ + Object.defineProperty(DirectedReadOptions.prototype, "replicas", { + get: $util.oneOfGetter($oneOfFields = ["includeReplicas", "excludeReplicas"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DirectedReadOptions instance using the specified properties. + * @function create + * @memberof google.spanner.v1.DirectedReadOptions + * @static + * @param {google.spanner.v1.IDirectedReadOptions=} [properties] Properties to set + * @returns {google.spanner.v1.DirectedReadOptions} DirectedReadOptions instance + */ + DirectedReadOptions.create = function create(properties) { + return new DirectedReadOptions(properties); + }; + + /** + * Encodes the specified DirectedReadOptions message. Does not implicitly {@link google.spanner.v1.DirectedReadOptions.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.DirectedReadOptions + * @static + * @param {google.spanner.v1.IDirectedReadOptions} message DirectedReadOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DirectedReadOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.includeReplicas != null && Object.hasOwnProperty.call(message, "includeReplicas")) + $root.google.spanner.v1.DirectedReadOptions.IncludeReplicas.encode(message.includeReplicas, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.excludeReplicas != null && Object.hasOwnProperty.call(message, "excludeReplicas")) + $root.google.spanner.v1.DirectedReadOptions.ExcludeReplicas.encode(message.excludeReplicas, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DirectedReadOptions message, length delimited. Does not implicitly {@link google.spanner.v1.DirectedReadOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.DirectedReadOptions + * @static + * @param {google.spanner.v1.IDirectedReadOptions} message DirectedReadOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DirectedReadOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DirectedReadOptions message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.DirectedReadOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.DirectedReadOptions} DirectedReadOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DirectedReadOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.DirectedReadOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.includeReplicas = $root.google.spanner.v1.DirectedReadOptions.IncludeReplicas.decode(reader, reader.uint32()); + break; + } + case 2: { + message.excludeReplicas = $root.google.spanner.v1.DirectedReadOptions.ExcludeReplicas.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DirectedReadOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.DirectedReadOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.DirectedReadOptions} DirectedReadOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DirectedReadOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DirectedReadOptions message. + * @function verify + * @memberof google.spanner.v1.DirectedReadOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DirectedReadOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.includeReplicas != null && message.hasOwnProperty("includeReplicas")) { + properties.replicas = 1; + { + var error = $root.google.spanner.v1.DirectedReadOptions.IncludeReplicas.verify(message.includeReplicas); + if (error) + return "includeReplicas." + error; + } + } + if (message.excludeReplicas != null && message.hasOwnProperty("excludeReplicas")) { + if (properties.replicas === 1) + return "replicas: multiple values"; + properties.replicas = 1; + { + var error = $root.google.spanner.v1.DirectedReadOptions.ExcludeReplicas.verify(message.excludeReplicas); + if (error) + return "excludeReplicas." + error; + } + } + return null; + }; + + /** + * Creates a DirectedReadOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.DirectedReadOptions + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.DirectedReadOptions} DirectedReadOptions + */ + DirectedReadOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.DirectedReadOptions) + return object; + var message = new $root.google.spanner.v1.DirectedReadOptions(); + if (object.includeReplicas != null) { + if (typeof object.includeReplicas !== "object") + throw TypeError(".google.spanner.v1.DirectedReadOptions.includeReplicas: object expected"); + message.includeReplicas = $root.google.spanner.v1.DirectedReadOptions.IncludeReplicas.fromObject(object.includeReplicas); + } + if (object.excludeReplicas != null) { + if (typeof object.excludeReplicas !== "object") + throw TypeError(".google.spanner.v1.DirectedReadOptions.excludeReplicas: object expected"); + message.excludeReplicas = $root.google.spanner.v1.DirectedReadOptions.ExcludeReplicas.fromObject(object.excludeReplicas); + } + return message; + }; + + /** + * Creates a plain object from a DirectedReadOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.DirectedReadOptions + * @static + * @param {google.spanner.v1.DirectedReadOptions} message DirectedReadOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DirectedReadOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.includeReplicas != null && message.hasOwnProperty("includeReplicas")) { + object.includeReplicas = $root.google.spanner.v1.DirectedReadOptions.IncludeReplicas.toObject(message.includeReplicas, options); + if (options.oneofs) + object.replicas = "includeReplicas"; + } + if (message.excludeReplicas != null && message.hasOwnProperty("excludeReplicas")) { + object.excludeReplicas = $root.google.spanner.v1.DirectedReadOptions.ExcludeReplicas.toObject(message.excludeReplicas, options); + if (options.oneofs) + object.replicas = "excludeReplicas"; + } + return object; + }; + + /** + * Converts this DirectedReadOptions to JSON. + * @function toJSON + * @memberof google.spanner.v1.DirectedReadOptions + * @instance + * @returns {Object.} JSON object + */ + DirectedReadOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DirectedReadOptions + * @function getTypeUrl + * @memberof google.spanner.v1.DirectedReadOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DirectedReadOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.DirectedReadOptions"; + }; + + DirectedReadOptions.ReplicaSelection = (function() { + + /** + * Properties of a ReplicaSelection. + * @memberof google.spanner.v1.DirectedReadOptions + * @interface IReplicaSelection + * @property {string|null} [location] ReplicaSelection location + * @property {google.spanner.v1.DirectedReadOptions.ReplicaSelection.Type|null} [type] ReplicaSelection type + */ + + /** + * Constructs a new ReplicaSelection. + * @memberof google.spanner.v1.DirectedReadOptions + * @classdesc Represents a ReplicaSelection. + * @implements IReplicaSelection + * @constructor + * @param {google.spanner.v1.DirectedReadOptions.IReplicaSelection=} [properties] Properties to set + */ + function ReplicaSelection(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReplicaSelection location. + * @member {string} location + * @memberof google.spanner.v1.DirectedReadOptions.ReplicaSelection + * @instance + */ + ReplicaSelection.prototype.location = ""; + + /** + * ReplicaSelection type. + * @member {google.spanner.v1.DirectedReadOptions.ReplicaSelection.Type} type + * @memberof google.spanner.v1.DirectedReadOptions.ReplicaSelection + * @instance + */ + ReplicaSelection.prototype.type = 0; + + /** + * Creates a new ReplicaSelection instance using the specified properties. + * @function create + * @memberof google.spanner.v1.DirectedReadOptions.ReplicaSelection + * @static + * @param {google.spanner.v1.DirectedReadOptions.IReplicaSelection=} [properties] Properties to set + * @returns {google.spanner.v1.DirectedReadOptions.ReplicaSelection} ReplicaSelection instance + */ + ReplicaSelection.create = function create(properties) { + return new ReplicaSelection(properties); + }; + + /** + * Encodes the specified ReplicaSelection message. Does not implicitly {@link google.spanner.v1.DirectedReadOptions.ReplicaSelection.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.DirectedReadOptions.ReplicaSelection + * @static + * @param {google.spanner.v1.DirectedReadOptions.IReplicaSelection} message ReplicaSelection message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReplicaSelection.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.location); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.type); + return writer; + }; + + /** + * Encodes the specified ReplicaSelection message, length delimited. Does not implicitly {@link google.spanner.v1.DirectedReadOptions.ReplicaSelection.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.DirectedReadOptions.ReplicaSelection + * @static + * @param {google.spanner.v1.DirectedReadOptions.IReplicaSelection} message ReplicaSelection message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReplicaSelection.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReplicaSelection message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.DirectedReadOptions.ReplicaSelection + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.DirectedReadOptions.ReplicaSelection} ReplicaSelection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReplicaSelection.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.DirectedReadOptions.ReplicaSelection(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.location = reader.string(); + break; + } + case 2: { + message.type = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReplicaSelection message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.DirectedReadOptions.ReplicaSelection + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.DirectedReadOptions.ReplicaSelection} ReplicaSelection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReplicaSelection.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReplicaSelection message. + * @function verify + * @memberof google.spanner.v1.DirectedReadOptions.ReplicaSelection + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReplicaSelection.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a ReplicaSelection message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.DirectedReadOptions.ReplicaSelection + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.DirectedReadOptions.ReplicaSelection} ReplicaSelection + */ + ReplicaSelection.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.DirectedReadOptions.ReplicaSelection) + return object; + var message = new $root.google.spanner.v1.DirectedReadOptions.ReplicaSelection(); + if (object.location != null) + message.location = String(object.location); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "READ_WRITE": + case 1: + message.type = 1; + break; + case "READ_ONLY": + case 2: + message.type = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a ReplicaSelection message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.DirectedReadOptions.ReplicaSelection + * @static + * @param {google.spanner.v1.DirectedReadOptions.ReplicaSelection} message ReplicaSelection + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReplicaSelection.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.location = ""; + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + } + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.spanner.v1.DirectedReadOptions.ReplicaSelection.Type[message.type] === undefined ? message.type : $root.google.spanner.v1.DirectedReadOptions.ReplicaSelection.Type[message.type] : message.type; + return object; + }; + + /** + * Converts this ReplicaSelection to JSON. + * @function toJSON + * @memberof google.spanner.v1.DirectedReadOptions.ReplicaSelection + * @instance + * @returns {Object.} JSON object + */ + ReplicaSelection.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReplicaSelection + * @function getTypeUrl + * @memberof google.spanner.v1.DirectedReadOptions.ReplicaSelection + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReplicaSelection.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.DirectedReadOptions.ReplicaSelection"; + }; + + /** + * Type enum. + * @name google.spanner.v1.DirectedReadOptions.ReplicaSelection.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} READ_WRITE=1 READ_WRITE value + * @property {number} READ_ONLY=2 READ_ONLY value + */ + ReplicaSelection.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "READ_WRITE"] = 1; + values[valuesById[2] = "READ_ONLY"] = 2; + return values; + })(); + + return ReplicaSelection; + })(); + + DirectedReadOptions.IncludeReplicas = (function() { + + /** + * Properties of an IncludeReplicas. + * @memberof google.spanner.v1.DirectedReadOptions + * @interface IIncludeReplicas + * @property {Array.|null} [replicaSelections] IncludeReplicas replicaSelections + * @property {boolean|null} [autoFailoverDisabled] IncludeReplicas autoFailoverDisabled + */ + + /** + * Constructs a new IncludeReplicas. + * @memberof google.spanner.v1.DirectedReadOptions + * @classdesc Represents an IncludeReplicas. + * @implements IIncludeReplicas + * @constructor + * @param {google.spanner.v1.DirectedReadOptions.IIncludeReplicas=} [properties] Properties to set + */ + function IncludeReplicas(properties) { + this.replicaSelections = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * IncludeReplicas replicaSelections. + * @member {Array.} replicaSelections + * @memberof google.spanner.v1.DirectedReadOptions.IncludeReplicas + * @instance + */ + IncludeReplicas.prototype.replicaSelections = $util.emptyArray; + + /** + * IncludeReplicas autoFailoverDisabled. + * @member {boolean} autoFailoverDisabled + * @memberof google.spanner.v1.DirectedReadOptions.IncludeReplicas + * @instance + */ + IncludeReplicas.prototype.autoFailoverDisabled = false; + + /** + * Creates a new IncludeReplicas instance using the specified properties. + * @function create + * @memberof google.spanner.v1.DirectedReadOptions.IncludeReplicas + * @static + * @param {google.spanner.v1.DirectedReadOptions.IIncludeReplicas=} [properties] Properties to set + * @returns {google.spanner.v1.DirectedReadOptions.IncludeReplicas} IncludeReplicas instance + */ + IncludeReplicas.create = function create(properties) { + return new IncludeReplicas(properties); + }; + + /** + * Encodes the specified IncludeReplicas message. Does not implicitly {@link google.spanner.v1.DirectedReadOptions.IncludeReplicas.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.DirectedReadOptions.IncludeReplicas + * @static + * @param {google.spanner.v1.DirectedReadOptions.IIncludeReplicas} message IncludeReplicas message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IncludeReplicas.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.replicaSelections != null && message.replicaSelections.length) + for (var i = 0; i < message.replicaSelections.length; ++i) + $root.google.spanner.v1.DirectedReadOptions.ReplicaSelection.encode(message.replicaSelections[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.autoFailoverDisabled != null && Object.hasOwnProperty.call(message, "autoFailoverDisabled")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.autoFailoverDisabled); + return writer; + }; + + /** + * Encodes the specified IncludeReplicas message, length delimited. Does not implicitly {@link google.spanner.v1.DirectedReadOptions.IncludeReplicas.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.DirectedReadOptions.IncludeReplicas + * @static + * @param {google.spanner.v1.DirectedReadOptions.IIncludeReplicas} message IncludeReplicas message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IncludeReplicas.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IncludeReplicas message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.DirectedReadOptions.IncludeReplicas + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.DirectedReadOptions.IncludeReplicas} IncludeReplicas + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IncludeReplicas.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.DirectedReadOptions.IncludeReplicas(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.replicaSelections && message.replicaSelections.length)) + message.replicaSelections = []; + message.replicaSelections.push($root.google.spanner.v1.DirectedReadOptions.ReplicaSelection.decode(reader, reader.uint32())); + break; + } + case 2: { + message.autoFailoverDisabled = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IncludeReplicas message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.DirectedReadOptions.IncludeReplicas + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.DirectedReadOptions.IncludeReplicas} IncludeReplicas + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IncludeReplicas.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IncludeReplicas message. + * @function verify + * @memberof google.spanner.v1.DirectedReadOptions.IncludeReplicas + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IncludeReplicas.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.replicaSelections != null && message.hasOwnProperty("replicaSelections")) { + if (!Array.isArray(message.replicaSelections)) + return "replicaSelections: array expected"; + for (var i = 0; i < message.replicaSelections.length; ++i) { + var error = $root.google.spanner.v1.DirectedReadOptions.ReplicaSelection.verify(message.replicaSelections[i]); + if (error) + return "replicaSelections." + error; + } + } + if (message.autoFailoverDisabled != null && message.hasOwnProperty("autoFailoverDisabled")) + if (typeof message.autoFailoverDisabled !== "boolean") + return "autoFailoverDisabled: boolean expected"; + return null; + }; + + /** + * Creates an IncludeReplicas message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.DirectedReadOptions.IncludeReplicas + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.DirectedReadOptions.IncludeReplicas} IncludeReplicas + */ + IncludeReplicas.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.DirectedReadOptions.IncludeReplicas) + return object; + var message = new $root.google.spanner.v1.DirectedReadOptions.IncludeReplicas(); + if (object.replicaSelections) { + if (!Array.isArray(object.replicaSelections)) + throw TypeError(".google.spanner.v1.DirectedReadOptions.IncludeReplicas.replicaSelections: array expected"); + message.replicaSelections = []; + for (var i = 0; i < object.replicaSelections.length; ++i) { + if (typeof object.replicaSelections[i] !== "object") + throw TypeError(".google.spanner.v1.DirectedReadOptions.IncludeReplicas.replicaSelections: object expected"); + message.replicaSelections[i] = $root.google.spanner.v1.DirectedReadOptions.ReplicaSelection.fromObject(object.replicaSelections[i]); + } + } + if (object.autoFailoverDisabled != null) + message.autoFailoverDisabled = Boolean(object.autoFailoverDisabled); + return message; + }; + + /** + * Creates a plain object from an IncludeReplicas message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.DirectedReadOptions.IncludeReplicas + * @static + * @param {google.spanner.v1.DirectedReadOptions.IncludeReplicas} message IncludeReplicas + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IncludeReplicas.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.replicaSelections = []; + if (options.defaults) + object.autoFailoverDisabled = false; + if (message.replicaSelections && message.replicaSelections.length) { + object.replicaSelections = []; + for (var j = 0; j < message.replicaSelections.length; ++j) + object.replicaSelections[j] = $root.google.spanner.v1.DirectedReadOptions.ReplicaSelection.toObject(message.replicaSelections[j], options); + } + if (message.autoFailoverDisabled != null && message.hasOwnProperty("autoFailoverDisabled")) + object.autoFailoverDisabled = message.autoFailoverDisabled; + return object; + }; + + /** + * Converts this IncludeReplicas to JSON. + * @function toJSON + * @memberof google.spanner.v1.DirectedReadOptions.IncludeReplicas + * @instance + * @returns {Object.} JSON object + */ + IncludeReplicas.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IncludeReplicas + * @function getTypeUrl + * @memberof google.spanner.v1.DirectedReadOptions.IncludeReplicas + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IncludeReplicas.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.DirectedReadOptions.IncludeReplicas"; + }; + + return IncludeReplicas; + })(); + + DirectedReadOptions.ExcludeReplicas = (function() { + + /** + * Properties of an ExcludeReplicas. + * @memberof google.spanner.v1.DirectedReadOptions + * @interface IExcludeReplicas + * @property {Array.|null} [replicaSelections] ExcludeReplicas replicaSelections + */ + + /** + * Constructs a new ExcludeReplicas. + * @memberof google.spanner.v1.DirectedReadOptions + * @classdesc Represents an ExcludeReplicas. + * @implements IExcludeReplicas + * @constructor + * @param {google.spanner.v1.DirectedReadOptions.IExcludeReplicas=} [properties] Properties to set + */ + function ExcludeReplicas(properties) { + this.replicaSelections = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExcludeReplicas replicaSelections. + * @member {Array.} replicaSelections + * @memberof google.spanner.v1.DirectedReadOptions.ExcludeReplicas + * @instance + */ + ExcludeReplicas.prototype.replicaSelections = $util.emptyArray; + + /** + * Creates a new ExcludeReplicas instance using the specified properties. + * @function create + * @memberof google.spanner.v1.DirectedReadOptions.ExcludeReplicas + * @static + * @param {google.spanner.v1.DirectedReadOptions.IExcludeReplicas=} [properties] Properties to set + * @returns {google.spanner.v1.DirectedReadOptions.ExcludeReplicas} ExcludeReplicas instance + */ + ExcludeReplicas.create = function create(properties) { + return new ExcludeReplicas(properties); + }; + + /** + * Encodes the specified ExcludeReplicas message. Does not implicitly {@link google.spanner.v1.DirectedReadOptions.ExcludeReplicas.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.DirectedReadOptions.ExcludeReplicas + * @static + * @param {google.spanner.v1.DirectedReadOptions.IExcludeReplicas} message ExcludeReplicas message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExcludeReplicas.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.replicaSelections != null && message.replicaSelections.length) + for (var i = 0; i < message.replicaSelections.length; ++i) + $root.google.spanner.v1.DirectedReadOptions.ReplicaSelection.encode(message.replicaSelections[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExcludeReplicas message, length delimited. Does not implicitly {@link google.spanner.v1.DirectedReadOptions.ExcludeReplicas.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.DirectedReadOptions.ExcludeReplicas + * @static + * @param {google.spanner.v1.DirectedReadOptions.IExcludeReplicas} message ExcludeReplicas message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExcludeReplicas.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExcludeReplicas message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.DirectedReadOptions.ExcludeReplicas + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.DirectedReadOptions.ExcludeReplicas} ExcludeReplicas + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExcludeReplicas.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.DirectedReadOptions.ExcludeReplicas(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.replicaSelections && message.replicaSelections.length)) + message.replicaSelections = []; + message.replicaSelections.push($root.google.spanner.v1.DirectedReadOptions.ReplicaSelection.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExcludeReplicas message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.DirectedReadOptions.ExcludeReplicas + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.DirectedReadOptions.ExcludeReplicas} ExcludeReplicas + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExcludeReplicas.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExcludeReplicas message. + * @function verify + * @memberof google.spanner.v1.DirectedReadOptions.ExcludeReplicas + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExcludeReplicas.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.replicaSelections != null && message.hasOwnProperty("replicaSelections")) { + if (!Array.isArray(message.replicaSelections)) + return "replicaSelections: array expected"; + for (var i = 0; i < message.replicaSelections.length; ++i) { + var error = $root.google.spanner.v1.DirectedReadOptions.ReplicaSelection.verify(message.replicaSelections[i]); + if (error) + return "replicaSelections." + error; + } + } + return null; + }; + + /** + * Creates an ExcludeReplicas message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.DirectedReadOptions.ExcludeReplicas + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.DirectedReadOptions.ExcludeReplicas} ExcludeReplicas + */ + ExcludeReplicas.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.DirectedReadOptions.ExcludeReplicas) + return object; + var message = new $root.google.spanner.v1.DirectedReadOptions.ExcludeReplicas(); + if (object.replicaSelections) { + if (!Array.isArray(object.replicaSelections)) + throw TypeError(".google.spanner.v1.DirectedReadOptions.ExcludeReplicas.replicaSelections: array expected"); + message.replicaSelections = []; + for (var i = 0; i < object.replicaSelections.length; ++i) { + if (typeof object.replicaSelections[i] !== "object") + throw TypeError(".google.spanner.v1.DirectedReadOptions.ExcludeReplicas.replicaSelections: object expected"); + message.replicaSelections[i] = $root.google.spanner.v1.DirectedReadOptions.ReplicaSelection.fromObject(object.replicaSelections[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an ExcludeReplicas message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.DirectedReadOptions.ExcludeReplicas + * @static + * @param {google.spanner.v1.DirectedReadOptions.ExcludeReplicas} message ExcludeReplicas + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExcludeReplicas.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.replicaSelections = []; + if (message.replicaSelections && message.replicaSelections.length) { + object.replicaSelections = []; + for (var j = 0; j < message.replicaSelections.length; ++j) + object.replicaSelections[j] = $root.google.spanner.v1.DirectedReadOptions.ReplicaSelection.toObject(message.replicaSelections[j], options); + } + return object; + }; + + /** + * Converts this ExcludeReplicas to JSON. + * @function toJSON + * @memberof google.spanner.v1.DirectedReadOptions.ExcludeReplicas + * @instance + * @returns {Object.} JSON object + */ + ExcludeReplicas.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExcludeReplicas + * @function getTypeUrl + * @memberof google.spanner.v1.DirectedReadOptions.ExcludeReplicas + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExcludeReplicas.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.DirectedReadOptions.ExcludeReplicas"; + }; + + return ExcludeReplicas; + })(); + + return DirectedReadOptions; + })(); + + v1.ExecuteSqlRequest = (function() { + + /** + * Properties of an ExecuteSqlRequest. + * @memberof google.spanner.v1 + * @interface IExecuteSqlRequest + * @property {string|null} [session] ExecuteSqlRequest session + * @property {google.spanner.v1.ITransactionSelector|null} [transaction] ExecuteSqlRequest transaction + * @property {string|null} [sql] ExecuteSqlRequest sql + * @property {google.protobuf.IStruct|null} [params] ExecuteSqlRequest params + * @property {Object.|null} [paramTypes] ExecuteSqlRequest paramTypes + * @property {Uint8Array|null} [resumeToken] ExecuteSqlRequest resumeToken + * @property {google.spanner.v1.ExecuteSqlRequest.QueryMode|null} [queryMode] ExecuteSqlRequest queryMode + * @property {Uint8Array|null} [partitionToken] ExecuteSqlRequest partitionToken + * @property {number|Long|null} [seqno] ExecuteSqlRequest seqno + * @property {google.spanner.v1.ExecuteSqlRequest.IQueryOptions|null} [queryOptions] ExecuteSqlRequest queryOptions + * @property {google.spanner.v1.IRequestOptions|null} [requestOptions] ExecuteSqlRequest requestOptions + * @property {google.spanner.v1.IDirectedReadOptions|null} [directedReadOptions] ExecuteSqlRequest directedReadOptions + * @property {boolean|null} [dataBoostEnabled] ExecuteSqlRequest dataBoostEnabled + * @property {boolean|null} [lastStatement] ExecuteSqlRequest lastStatement + * @property {google.spanner.v1.IRoutingHint|null} [routingHint] ExecuteSqlRequest routingHint + */ + + /** + * Constructs a new ExecuteSqlRequest. + * @memberof google.spanner.v1 + * @classdesc Represents an ExecuteSqlRequest. + * @implements IExecuteSqlRequest + * @constructor + * @param {google.spanner.v1.IExecuteSqlRequest=} [properties] Properties to set + */ + function ExecuteSqlRequest(properties) { + this.paramTypes = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExecuteSqlRequest session. + * @member {string} session + * @memberof google.spanner.v1.ExecuteSqlRequest + * @instance + */ + ExecuteSqlRequest.prototype.session = ""; + + /** + * ExecuteSqlRequest transaction. + * @member {google.spanner.v1.ITransactionSelector|null|undefined} transaction + * @memberof google.spanner.v1.ExecuteSqlRequest + * @instance + */ + ExecuteSqlRequest.prototype.transaction = null; + + /** + * ExecuteSqlRequest sql. + * @member {string} sql + * @memberof google.spanner.v1.ExecuteSqlRequest + * @instance + */ + ExecuteSqlRequest.prototype.sql = ""; + + /** + * ExecuteSqlRequest params. + * @member {google.protobuf.IStruct|null|undefined} params + * @memberof google.spanner.v1.ExecuteSqlRequest + * @instance + */ + ExecuteSqlRequest.prototype.params = null; + + /** + * ExecuteSqlRequest paramTypes. + * @member {Object.} paramTypes + * @memberof google.spanner.v1.ExecuteSqlRequest + * @instance + */ + ExecuteSqlRequest.prototype.paramTypes = $util.emptyObject; + + /** + * ExecuteSqlRequest resumeToken. + * @member {Uint8Array} resumeToken + * @memberof google.spanner.v1.ExecuteSqlRequest + * @instance + */ + ExecuteSqlRequest.prototype.resumeToken = $util.newBuffer([]); + + /** + * ExecuteSqlRequest queryMode. + * @member {google.spanner.v1.ExecuteSqlRequest.QueryMode} queryMode + * @memberof google.spanner.v1.ExecuteSqlRequest + * @instance + */ + ExecuteSqlRequest.prototype.queryMode = 0; + + /** + * ExecuteSqlRequest partitionToken. + * @member {Uint8Array} partitionToken + * @memberof google.spanner.v1.ExecuteSqlRequest + * @instance + */ + ExecuteSqlRequest.prototype.partitionToken = $util.newBuffer([]); + + /** + * ExecuteSqlRequest seqno. + * @member {number|Long} seqno + * @memberof google.spanner.v1.ExecuteSqlRequest + * @instance + */ + ExecuteSqlRequest.prototype.seqno = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ExecuteSqlRequest queryOptions. + * @member {google.spanner.v1.ExecuteSqlRequest.IQueryOptions|null|undefined} queryOptions + * @memberof google.spanner.v1.ExecuteSqlRequest + * @instance + */ + ExecuteSqlRequest.prototype.queryOptions = null; + + /** + * ExecuteSqlRequest requestOptions. + * @member {google.spanner.v1.IRequestOptions|null|undefined} requestOptions + * @memberof google.spanner.v1.ExecuteSqlRequest + * @instance + */ + ExecuteSqlRequest.prototype.requestOptions = null; + + /** + * ExecuteSqlRequest directedReadOptions. + * @member {google.spanner.v1.IDirectedReadOptions|null|undefined} directedReadOptions + * @memberof google.spanner.v1.ExecuteSqlRequest + * @instance + */ + ExecuteSqlRequest.prototype.directedReadOptions = null; + + /** + * ExecuteSqlRequest dataBoostEnabled. + * @member {boolean} dataBoostEnabled + * @memberof google.spanner.v1.ExecuteSqlRequest + * @instance + */ + ExecuteSqlRequest.prototype.dataBoostEnabled = false; + + /** + * ExecuteSqlRequest lastStatement. + * @member {boolean} lastStatement + * @memberof google.spanner.v1.ExecuteSqlRequest + * @instance + */ + ExecuteSqlRequest.prototype.lastStatement = false; + + /** + * ExecuteSqlRequest routingHint. + * @member {google.spanner.v1.IRoutingHint|null|undefined} routingHint + * @memberof google.spanner.v1.ExecuteSqlRequest + * @instance + */ + ExecuteSqlRequest.prototype.routingHint = null; + + /** + * Creates a new ExecuteSqlRequest instance using the specified properties. + * @function create + * @memberof google.spanner.v1.ExecuteSqlRequest + * @static + * @param {google.spanner.v1.IExecuteSqlRequest=} [properties] Properties to set + * @returns {google.spanner.v1.ExecuteSqlRequest} ExecuteSqlRequest instance + */ + ExecuteSqlRequest.create = function create(properties) { + return new ExecuteSqlRequest(properties); + }; + + /** + * Encodes the specified ExecuteSqlRequest message. Does not implicitly {@link google.spanner.v1.ExecuteSqlRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.ExecuteSqlRequest + * @static + * @param {google.spanner.v1.IExecuteSqlRequest} message ExecuteSqlRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecuteSqlRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.session != null && Object.hasOwnProperty.call(message, "session")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.session); + if (message.transaction != null && Object.hasOwnProperty.call(message, "transaction")) + $root.google.spanner.v1.TransactionSelector.encode(message.transaction, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.sql != null && Object.hasOwnProperty.call(message, "sql")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.sql); + if (message.params != null && Object.hasOwnProperty.call(message, "params")) + $root.google.protobuf.Struct.encode(message.params, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.paramTypes != null && Object.hasOwnProperty.call(message, "paramTypes")) + for (var keys = Object.keys(message.paramTypes), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.spanner.v1.Type.encode(message.paramTypes[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.resumeToken != null && Object.hasOwnProperty.call(message, "resumeToken")) + writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.resumeToken); + if (message.queryMode != null && Object.hasOwnProperty.call(message, "queryMode")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.queryMode); + if (message.partitionToken != null && Object.hasOwnProperty.call(message, "partitionToken")) + writer.uint32(/* id 8, wireType 2 =*/66).bytes(message.partitionToken); + if (message.seqno != null && Object.hasOwnProperty.call(message, "seqno")) + writer.uint32(/* id 9, wireType 0 =*/72).int64(message.seqno); + if (message.queryOptions != null && Object.hasOwnProperty.call(message, "queryOptions")) + $root.google.spanner.v1.ExecuteSqlRequest.QueryOptions.encode(message.queryOptions, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.requestOptions != null && Object.hasOwnProperty.call(message, "requestOptions")) + $root.google.spanner.v1.RequestOptions.encode(message.requestOptions, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.directedReadOptions != null && Object.hasOwnProperty.call(message, "directedReadOptions")) + $root.google.spanner.v1.DirectedReadOptions.encode(message.directedReadOptions, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.dataBoostEnabled != null && Object.hasOwnProperty.call(message, "dataBoostEnabled")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.dataBoostEnabled); + if (message.lastStatement != null && Object.hasOwnProperty.call(message, "lastStatement")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.lastStatement); + if (message.routingHint != null && Object.hasOwnProperty.call(message, "routingHint")) + $root.google.spanner.v1.RoutingHint.encode(message.routingHint, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExecuteSqlRequest message, length delimited. Does not implicitly {@link google.spanner.v1.ExecuteSqlRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.ExecuteSqlRequest + * @static + * @param {google.spanner.v1.IExecuteSqlRequest} message ExecuteSqlRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecuteSqlRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExecuteSqlRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.ExecuteSqlRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.ExecuteSqlRequest} ExecuteSqlRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecuteSqlRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.ExecuteSqlRequest(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.session = reader.string(); + break; + } + case 2: { + message.transaction = $root.google.spanner.v1.TransactionSelector.decode(reader, reader.uint32()); + break; + } + case 3: { + message.sql = reader.string(); + break; + } + case 4: { + message.params = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 5: { + if (message.paramTypes === $util.emptyObject) + message.paramTypes = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.spanner.v1.Type.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.paramTypes[key] = value; + break; + } + case 6: { + message.resumeToken = reader.bytes(); + break; + } + case 7: { + message.queryMode = reader.int32(); + break; + } + case 8: { + message.partitionToken = reader.bytes(); + break; + } + case 9: { + message.seqno = reader.int64(); + break; + } + case 10: { + message.queryOptions = $root.google.spanner.v1.ExecuteSqlRequest.QueryOptions.decode(reader, reader.uint32()); + break; + } + case 11: { + message.requestOptions = $root.google.spanner.v1.RequestOptions.decode(reader, reader.uint32()); + break; + } + case 15: { + message.directedReadOptions = $root.google.spanner.v1.DirectedReadOptions.decode(reader, reader.uint32()); + break; + } + case 16: { + message.dataBoostEnabled = reader.bool(); + break; + } + case 17: { + message.lastStatement = reader.bool(); + break; + } + case 18: { + message.routingHint = $root.google.spanner.v1.RoutingHint.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExecuteSqlRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.ExecuteSqlRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.ExecuteSqlRequest} ExecuteSqlRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecuteSqlRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExecuteSqlRequest message. + * @function verify + * @memberof google.spanner.v1.ExecuteSqlRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExecuteSqlRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.session != null && message.hasOwnProperty("session")) + if (!$util.isString(message.session)) + return "session: string expected"; + if (message.transaction != null && message.hasOwnProperty("transaction")) { + var error = $root.google.spanner.v1.TransactionSelector.verify(message.transaction); + if (error) + return "transaction." + error; + } + if (message.sql != null && message.hasOwnProperty("sql")) + if (!$util.isString(message.sql)) + return "sql: string expected"; + if (message.params != null && message.hasOwnProperty("params")) { + var error = $root.google.protobuf.Struct.verify(message.params); + if (error) + return "params." + error; + } + if (message.paramTypes != null && message.hasOwnProperty("paramTypes")) { + if (!$util.isObject(message.paramTypes)) + return "paramTypes: object expected"; + var key = Object.keys(message.paramTypes); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.spanner.v1.Type.verify(message.paramTypes[key[i]]); + if (error) + return "paramTypes." + error; + } + } + if (message.resumeToken != null && message.hasOwnProperty("resumeToken")) + if (!(message.resumeToken && typeof message.resumeToken.length === "number" || $util.isString(message.resumeToken))) + return "resumeToken: buffer expected"; + if (message.queryMode != null && message.hasOwnProperty("queryMode")) + switch (message.queryMode) { + default: + return "queryMode: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.partitionToken != null && message.hasOwnProperty("partitionToken")) + if (!(message.partitionToken && typeof message.partitionToken.length === "number" || $util.isString(message.partitionToken))) + return "partitionToken: buffer expected"; + if (message.seqno != null && message.hasOwnProperty("seqno")) + if (!$util.isInteger(message.seqno) && !(message.seqno && $util.isInteger(message.seqno.low) && $util.isInteger(message.seqno.high))) + return "seqno: integer|Long expected"; + if (message.queryOptions != null && message.hasOwnProperty("queryOptions")) { + var error = $root.google.spanner.v1.ExecuteSqlRequest.QueryOptions.verify(message.queryOptions); + if (error) + return "queryOptions." + error; + } + if (message.requestOptions != null && message.hasOwnProperty("requestOptions")) { + var error = $root.google.spanner.v1.RequestOptions.verify(message.requestOptions); + if (error) + return "requestOptions." + error; + } + if (message.directedReadOptions != null && message.hasOwnProperty("directedReadOptions")) { + var error = $root.google.spanner.v1.DirectedReadOptions.verify(message.directedReadOptions); + if (error) + return "directedReadOptions." + error; + } + if (message.dataBoostEnabled != null && message.hasOwnProperty("dataBoostEnabled")) + if (typeof message.dataBoostEnabled !== "boolean") + return "dataBoostEnabled: boolean expected"; + if (message.lastStatement != null && message.hasOwnProperty("lastStatement")) + if (typeof message.lastStatement !== "boolean") + return "lastStatement: boolean expected"; + if (message.routingHint != null && message.hasOwnProperty("routingHint")) { + var error = $root.google.spanner.v1.RoutingHint.verify(message.routingHint); + if (error) + return "routingHint." + error; + } + return null; + }; + + /** + * Creates an ExecuteSqlRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.ExecuteSqlRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.ExecuteSqlRequest} ExecuteSqlRequest + */ + ExecuteSqlRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.ExecuteSqlRequest) + return object; + var message = new $root.google.spanner.v1.ExecuteSqlRequest(); + if (object.session != null) + message.session = String(object.session); + if (object.transaction != null) { + if (typeof object.transaction !== "object") + throw TypeError(".google.spanner.v1.ExecuteSqlRequest.transaction: object expected"); + message.transaction = $root.google.spanner.v1.TransactionSelector.fromObject(object.transaction); + } + if (object.sql != null) + message.sql = String(object.sql); + if (object.params != null) { + if (typeof object.params !== "object") + throw TypeError(".google.spanner.v1.ExecuteSqlRequest.params: object expected"); + message.params = $root.google.protobuf.Struct.fromObject(object.params); + } + if (object.paramTypes) { + if (typeof object.paramTypes !== "object") + throw TypeError(".google.spanner.v1.ExecuteSqlRequest.paramTypes: object expected"); + message.paramTypes = {}; + for (var keys = Object.keys(object.paramTypes), i = 0; i < keys.length; ++i) { + if (typeof object.paramTypes[keys[i]] !== "object") + throw TypeError(".google.spanner.v1.ExecuteSqlRequest.paramTypes: object expected"); + message.paramTypes[keys[i]] = $root.google.spanner.v1.Type.fromObject(object.paramTypes[keys[i]]); + } + } + if (object.resumeToken != null) + if (typeof object.resumeToken === "string") + $util.base64.decode(object.resumeToken, message.resumeToken = $util.newBuffer($util.base64.length(object.resumeToken)), 0); + else if (object.resumeToken.length >= 0) + message.resumeToken = object.resumeToken; + switch (object.queryMode) { + default: + if (typeof object.queryMode === "number") { + message.queryMode = object.queryMode; + break; + } + break; + case "NORMAL": + case 0: + message.queryMode = 0; + break; + case "PLAN": + case 1: + message.queryMode = 1; + break; + case "PROFILE": + case 2: + message.queryMode = 2; + break; + case "WITH_STATS": + case 3: + message.queryMode = 3; + break; + case "WITH_PLAN_AND_STATS": + case 4: + message.queryMode = 4; + break; + } + if (object.partitionToken != null) + if (typeof object.partitionToken === "string") + $util.base64.decode(object.partitionToken, message.partitionToken = $util.newBuffer($util.base64.length(object.partitionToken)), 0); + else if (object.partitionToken.length >= 0) + message.partitionToken = object.partitionToken; + if (object.seqno != null) + if ($util.Long) + (message.seqno = $util.Long.fromValue(object.seqno)).unsigned = false; + else if (typeof object.seqno === "string") + message.seqno = parseInt(object.seqno, 10); + else if (typeof object.seqno === "number") + message.seqno = object.seqno; + else if (typeof object.seqno === "object") + message.seqno = new $util.LongBits(object.seqno.low >>> 0, object.seqno.high >>> 0).toNumber(); + if (object.queryOptions != null) { + if (typeof object.queryOptions !== "object") + throw TypeError(".google.spanner.v1.ExecuteSqlRequest.queryOptions: object expected"); + message.queryOptions = $root.google.spanner.v1.ExecuteSqlRequest.QueryOptions.fromObject(object.queryOptions); + } + if (object.requestOptions != null) { + if (typeof object.requestOptions !== "object") + throw TypeError(".google.spanner.v1.ExecuteSqlRequest.requestOptions: object expected"); + message.requestOptions = $root.google.spanner.v1.RequestOptions.fromObject(object.requestOptions); + } + if (object.directedReadOptions != null) { + if (typeof object.directedReadOptions !== "object") + throw TypeError(".google.spanner.v1.ExecuteSqlRequest.directedReadOptions: object expected"); + message.directedReadOptions = $root.google.spanner.v1.DirectedReadOptions.fromObject(object.directedReadOptions); + } + if (object.dataBoostEnabled != null) + message.dataBoostEnabled = Boolean(object.dataBoostEnabled); + if (object.lastStatement != null) + message.lastStatement = Boolean(object.lastStatement); + if (object.routingHint != null) { + if (typeof object.routingHint !== "object") + throw TypeError(".google.spanner.v1.ExecuteSqlRequest.routingHint: object expected"); + message.routingHint = $root.google.spanner.v1.RoutingHint.fromObject(object.routingHint); + } + return message; + }; + + /** + * Creates a plain object from an ExecuteSqlRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.ExecuteSqlRequest + * @static + * @param {google.spanner.v1.ExecuteSqlRequest} message ExecuteSqlRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExecuteSqlRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.paramTypes = {}; + if (options.defaults) { + object.session = ""; + object.transaction = null; + object.sql = ""; + object.params = null; + if (options.bytes === String) + object.resumeToken = ""; + else { + object.resumeToken = []; + if (options.bytes !== Array) + object.resumeToken = $util.newBuffer(object.resumeToken); + } + object.queryMode = options.enums === String ? "NORMAL" : 0; + if (options.bytes === String) + object.partitionToken = ""; + else { + object.partitionToken = []; + if (options.bytes !== Array) + object.partitionToken = $util.newBuffer(object.partitionToken); + } + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seqno = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seqno = options.longs === String ? "0" : 0; + object.queryOptions = null; + object.requestOptions = null; + object.directedReadOptions = null; + object.dataBoostEnabled = false; + object.lastStatement = false; + object.routingHint = null; + } + if (message.session != null && message.hasOwnProperty("session")) + object.session = message.session; + if (message.transaction != null && message.hasOwnProperty("transaction")) + object.transaction = $root.google.spanner.v1.TransactionSelector.toObject(message.transaction, options); + if (message.sql != null && message.hasOwnProperty("sql")) + object.sql = message.sql; + if (message.params != null && message.hasOwnProperty("params")) + object.params = $root.google.protobuf.Struct.toObject(message.params, options); + var keys2; + if (message.paramTypes && (keys2 = Object.keys(message.paramTypes)).length) { + object.paramTypes = {}; + for (var j = 0; j < keys2.length; ++j) + object.paramTypes[keys2[j]] = $root.google.spanner.v1.Type.toObject(message.paramTypes[keys2[j]], options); + } + if (message.resumeToken != null && message.hasOwnProperty("resumeToken")) + object.resumeToken = options.bytes === String ? $util.base64.encode(message.resumeToken, 0, message.resumeToken.length) : options.bytes === Array ? Array.prototype.slice.call(message.resumeToken) : message.resumeToken; + if (message.queryMode != null && message.hasOwnProperty("queryMode")) + object.queryMode = options.enums === String ? $root.google.spanner.v1.ExecuteSqlRequest.QueryMode[message.queryMode] === undefined ? message.queryMode : $root.google.spanner.v1.ExecuteSqlRequest.QueryMode[message.queryMode] : message.queryMode; + if (message.partitionToken != null && message.hasOwnProperty("partitionToken")) + object.partitionToken = options.bytes === String ? $util.base64.encode(message.partitionToken, 0, message.partitionToken.length) : options.bytes === Array ? Array.prototype.slice.call(message.partitionToken) : message.partitionToken; + if (message.seqno != null && message.hasOwnProperty("seqno")) + if (typeof message.seqno === "number") + object.seqno = options.longs === String ? String(message.seqno) : message.seqno; + else + object.seqno = options.longs === String ? $util.Long.prototype.toString.call(message.seqno) : options.longs === Number ? new $util.LongBits(message.seqno.low >>> 0, message.seqno.high >>> 0).toNumber() : message.seqno; + if (message.queryOptions != null && message.hasOwnProperty("queryOptions")) + object.queryOptions = $root.google.spanner.v1.ExecuteSqlRequest.QueryOptions.toObject(message.queryOptions, options); + if (message.requestOptions != null && message.hasOwnProperty("requestOptions")) + object.requestOptions = $root.google.spanner.v1.RequestOptions.toObject(message.requestOptions, options); + if (message.directedReadOptions != null && message.hasOwnProperty("directedReadOptions")) + object.directedReadOptions = $root.google.spanner.v1.DirectedReadOptions.toObject(message.directedReadOptions, options); + if (message.dataBoostEnabled != null && message.hasOwnProperty("dataBoostEnabled")) + object.dataBoostEnabled = message.dataBoostEnabled; + if (message.lastStatement != null && message.hasOwnProperty("lastStatement")) + object.lastStatement = message.lastStatement; + if (message.routingHint != null && message.hasOwnProperty("routingHint")) + object.routingHint = $root.google.spanner.v1.RoutingHint.toObject(message.routingHint, options); + return object; + }; + + /** + * Converts this ExecuteSqlRequest to JSON. + * @function toJSON + * @memberof google.spanner.v1.ExecuteSqlRequest + * @instance + * @returns {Object.} JSON object + */ + ExecuteSqlRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExecuteSqlRequest + * @function getTypeUrl + * @memberof google.spanner.v1.ExecuteSqlRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExecuteSqlRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.ExecuteSqlRequest"; + }; + + /** + * QueryMode enum. + * @name google.spanner.v1.ExecuteSqlRequest.QueryMode + * @enum {number} + * @property {number} NORMAL=0 NORMAL value + * @property {number} PLAN=1 PLAN value + * @property {number} PROFILE=2 PROFILE value + * @property {number} WITH_STATS=3 WITH_STATS value + * @property {number} WITH_PLAN_AND_STATS=4 WITH_PLAN_AND_STATS value + */ + ExecuteSqlRequest.QueryMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NORMAL"] = 0; + values[valuesById[1] = "PLAN"] = 1; + values[valuesById[2] = "PROFILE"] = 2; + values[valuesById[3] = "WITH_STATS"] = 3; + values[valuesById[4] = "WITH_PLAN_AND_STATS"] = 4; + return values; + })(); + + ExecuteSqlRequest.QueryOptions = (function() { + + /** + * Properties of a QueryOptions. + * @memberof google.spanner.v1.ExecuteSqlRequest + * @interface IQueryOptions + * @property {string|null} [optimizerVersion] QueryOptions optimizerVersion + * @property {string|null} [optimizerStatisticsPackage] QueryOptions optimizerStatisticsPackage + */ + + /** + * Constructs a new QueryOptions. + * @memberof google.spanner.v1.ExecuteSqlRequest + * @classdesc Represents a QueryOptions. + * @implements IQueryOptions + * @constructor + * @param {google.spanner.v1.ExecuteSqlRequest.IQueryOptions=} [properties] Properties to set + */ + function QueryOptions(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryOptions optimizerVersion. + * @member {string} optimizerVersion + * @memberof google.spanner.v1.ExecuteSqlRequest.QueryOptions + * @instance + */ + QueryOptions.prototype.optimizerVersion = ""; + + /** + * QueryOptions optimizerStatisticsPackage. + * @member {string} optimizerStatisticsPackage + * @memberof google.spanner.v1.ExecuteSqlRequest.QueryOptions + * @instance + */ + QueryOptions.prototype.optimizerStatisticsPackage = ""; + + /** + * Creates a new QueryOptions instance using the specified properties. + * @function create + * @memberof google.spanner.v1.ExecuteSqlRequest.QueryOptions + * @static + * @param {google.spanner.v1.ExecuteSqlRequest.IQueryOptions=} [properties] Properties to set + * @returns {google.spanner.v1.ExecuteSqlRequest.QueryOptions} QueryOptions instance + */ + QueryOptions.create = function create(properties) { + return new QueryOptions(properties); + }; + + /** + * Encodes the specified QueryOptions message. Does not implicitly {@link google.spanner.v1.ExecuteSqlRequest.QueryOptions.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.ExecuteSqlRequest.QueryOptions + * @static + * @param {google.spanner.v1.ExecuteSqlRequest.IQueryOptions} message QueryOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.optimizerVersion != null && Object.hasOwnProperty.call(message, "optimizerVersion")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.optimizerVersion); + if (message.optimizerStatisticsPackage != null && Object.hasOwnProperty.call(message, "optimizerStatisticsPackage")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.optimizerStatisticsPackage); + return writer; + }; + + /** + * Encodes the specified QueryOptions message, length delimited. Does not implicitly {@link google.spanner.v1.ExecuteSqlRequest.QueryOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.ExecuteSqlRequest.QueryOptions + * @static + * @param {google.spanner.v1.ExecuteSqlRequest.IQueryOptions} message QueryOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryOptions message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.ExecuteSqlRequest.QueryOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.ExecuteSqlRequest.QueryOptions} QueryOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.ExecuteSqlRequest.QueryOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.optimizerVersion = reader.string(); + break; + } + case 2: { + message.optimizerStatisticsPackage = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.ExecuteSqlRequest.QueryOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.ExecuteSqlRequest.QueryOptions} QueryOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryOptions message. + * @function verify + * @memberof google.spanner.v1.ExecuteSqlRequest.QueryOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.optimizerVersion != null && message.hasOwnProperty("optimizerVersion")) + if (!$util.isString(message.optimizerVersion)) + return "optimizerVersion: string expected"; + if (message.optimizerStatisticsPackage != null && message.hasOwnProperty("optimizerStatisticsPackage")) + if (!$util.isString(message.optimizerStatisticsPackage)) + return "optimizerStatisticsPackage: string expected"; + return null; + }; + + /** + * Creates a QueryOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.ExecuteSqlRequest.QueryOptions + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.ExecuteSqlRequest.QueryOptions} QueryOptions + */ + QueryOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.ExecuteSqlRequest.QueryOptions) + return object; + var message = new $root.google.spanner.v1.ExecuteSqlRequest.QueryOptions(); + if (object.optimizerVersion != null) + message.optimizerVersion = String(object.optimizerVersion); + if (object.optimizerStatisticsPackage != null) + message.optimizerStatisticsPackage = String(object.optimizerStatisticsPackage); + return message; + }; + + /** + * Creates a plain object from a QueryOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.ExecuteSqlRequest.QueryOptions + * @static + * @param {google.spanner.v1.ExecuteSqlRequest.QueryOptions} message QueryOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.optimizerVersion = ""; + object.optimizerStatisticsPackage = ""; + } + if (message.optimizerVersion != null && message.hasOwnProperty("optimizerVersion")) + object.optimizerVersion = message.optimizerVersion; + if (message.optimizerStatisticsPackage != null && message.hasOwnProperty("optimizerStatisticsPackage")) + object.optimizerStatisticsPackage = message.optimizerStatisticsPackage; + return object; + }; + + /** + * Converts this QueryOptions to JSON. + * @function toJSON + * @memberof google.spanner.v1.ExecuteSqlRequest.QueryOptions + * @instance + * @returns {Object.} JSON object + */ + QueryOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for QueryOptions + * @function getTypeUrl + * @memberof google.spanner.v1.ExecuteSqlRequest.QueryOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + QueryOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.ExecuteSqlRequest.QueryOptions"; + }; + + return QueryOptions; + })(); + + return ExecuteSqlRequest; + })(); + + v1.ExecuteBatchDmlRequest = (function() { + + /** + * Properties of an ExecuteBatchDmlRequest. + * @memberof google.spanner.v1 + * @interface IExecuteBatchDmlRequest + * @property {string|null} [session] ExecuteBatchDmlRequest session + * @property {google.spanner.v1.ITransactionSelector|null} [transaction] ExecuteBatchDmlRequest transaction + * @property {Array.|null} [statements] ExecuteBatchDmlRequest statements + * @property {number|Long|null} [seqno] ExecuteBatchDmlRequest seqno + * @property {google.spanner.v1.IRequestOptions|null} [requestOptions] ExecuteBatchDmlRequest requestOptions + * @property {boolean|null} [lastStatements] ExecuteBatchDmlRequest lastStatements + */ + + /** + * Constructs a new ExecuteBatchDmlRequest. + * @memberof google.spanner.v1 + * @classdesc Represents an ExecuteBatchDmlRequest. + * @implements IExecuteBatchDmlRequest + * @constructor + * @param {google.spanner.v1.IExecuteBatchDmlRequest=} [properties] Properties to set + */ + function ExecuteBatchDmlRequest(properties) { + this.statements = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExecuteBatchDmlRequest session. + * @member {string} session + * @memberof google.spanner.v1.ExecuteBatchDmlRequest + * @instance + */ + ExecuteBatchDmlRequest.prototype.session = ""; + + /** + * ExecuteBatchDmlRequest transaction. + * @member {google.spanner.v1.ITransactionSelector|null|undefined} transaction + * @memberof google.spanner.v1.ExecuteBatchDmlRequest + * @instance + */ + ExecuteBatchDmlRequest.prototype.transaction = null; + + /** + * ExecuteBatchDmlRequest statements. + * @member {Array.} statements + * @memberof google.spanner.v1.ExecuteBatchDmlRequest + * @instance + */ + ExecuteBatchDmlRequest.prototype.statements = $util.emptyArray; + + /** + * ExecuteBatchDmlRequest seqno. + * @member {number|Long} seqno + * @memberof google.spanner.v1.ExecuteBatchDmlRequest + * @instance + */ + ExecuteBatchDmlRequest.prototype.seqno = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ExecuteBatchDmlRequest requestOptions. + * @member {google.spanner.v1.IRequestOptions|null|undefined} requestOptions + * @memberof google.spanner.v1.ExecuteBatchDmlRequest + * @instance + */ + ExecuteBatchDmlRequest.prototype.requestOptions = null; + + /** + * ExecuteBatchDmlRequest lastStatements. + * @member {boolean} lastStatements + * @memberof google.spanner.v1.ExecuteBatchDmlRequest + * @instance + */ + ExecuteBatchDmlRequest.prototype.lastStatements = false; + + /** + * Creates a new ExecuteBatchDmlRequest instance using the specified properties. + * @function create + * @memberof google.spanner.v1.ExecuteBatchDmlRequest + * @static + * @param {google.spanner.v1.IExecuteBatchDmlRequest=} [properties] Properties to set + * @returns {google.spanner.v1.ExecuteBatchDmlRequest} ExecuteBatchDmlRequest instance + */ + ExecuteBatchDmlRequest.create = function create(properties) { + return new ExecuteBatchDmlRequest(properties); + }; + + /** + * Encodes the specified ExecuteBatchDmlRequest message. Does not implicitly {@link google.spanner.v1.ExecuteBatchDmlRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.ExecuteBatchDmlRequest + * @static + * @param {google.spanner.v1.IExecuteBatchDmlRequest} message ExecuteBatchDmlRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecuteBatchDmlRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.session != null && Object.hasOwnProperty.call(message, "session")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.session); + if (message.transaction != null && Object.hasOwnProperty.call(message, "transaction")) + $root.google.spanner.v1.TransactionSelector.encode(message.transaction, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.statements != null && message.statements.length) + for (var i = 0; i < message.statements.length; ++i) + $root.google.spanner.v1.ExecuteBatchDmlRequest.Statement.encode(message.statements[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.seqno != null && Object.hasOwnProperty.call(message, "seqno")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.seqno); + if (message.requestOptions != null && Object.hasOwnProperty.call(message, "requestOptions")) + $root.google.spanner.v1.RequestOptions.encode(message.requestOptions, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.lastStatements != null && Object.hasOwnProperty.call(message, "lastStatements")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.lastStatements); + return writer; + }; + + /** + * Encodes the specified ExecuteBatchDmlRequest message, length delimited. Does not implicitly {@link google.spanner.v1.ExecuteBatchDmlRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.ExecuteBatchDmlRequest + * @static + * @param {google.spanner.v1.IExecuteBatchDmlRequest} message ExecuteBatchDmlRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecuteBatchDmlRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExecuteBatchDmlRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.ExecuteBatchDmlRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.ExecuteBatchDmlRequest} ExecuteBatchDmlRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecuteBatchDmlRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.ExecuteBatchDmlRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.session = reader.string(); + break; + } + case 2: { + message.transaction = $root.google.spanner.v1.TransactionSelector.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.statements && message.statements.length)) + message.statements = []; + message.statements.push($root.google.spanner.v1.ExecuteBatchDmlRequest.Statement.decode(reader, reader.uint32())); + break; + } + case 4: { + message.seqno = reader.int64(); + break; + } + case 5: { + message.requestOptions = $root.google.spanner.v1.RequestOptions.decode(reader, reader.uint32()); + break; + } + case 6: { + message.lastStatements = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExecuteBatchDmlRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.ExecuteBatchDmlRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.ExecuteBatchDmlRequest} ExecuteBatchDmlRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecuteBatchDmlRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExecuteBatchDmlRequest message. + * @function verify + * @memberof google.spanner.v1.ExecuteBatchDmlRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExecuteBatchDmlRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.session != null && message.hasOwnProperty("session")) + if (!$util.isString(message.session)) + return "session: string expected"; + if (message.transaction != null && message.hasOwnProperty("transaction")) { + var error = $root.google.spanner.v1.TransactionSelector.verify(message.transaction); + if (error) + return "transaction." + error; + } + if (message.statements != null && message.hasOwnProperty("statements")) { + if (!Array.isArray(message.statements)) + return "statements: array expected"; + for (var i = 0; i < message.statements.length; ++i) { + var error = $root.google.spanner.v1.ExecuteBatchDmlRequest.Statement.verify(message.statements[i]); + if (error) + return "statements." + error; + } + } + if (message.seqno != null && message.hasOwnProperty("seqno")) + if (!$util.isInteger(message.seqno) && !(message.seqno && $util.isInteger(message.seqno.low) && $util.isInteger(message.seqno.high))) + return "seqno: integer|Long expected"; + if (message.requestOptions != null && message.hasOwnProperty("requestOptions")) { + var error = $root.google.spanner.v1.RequestOptions.verify(message.requestOptions); + if (error) + return "requestOptions." + error; + } + if (message.lastStatements != null && message.hasOwnProperty("lastStatements")) + if (typeof message.lastStatements !== "boolean") + return "lastStatements: boolean expected"; + return null; + }; + + /** + * Creates an ExecuteBatchDmlRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.ExecuteBatchDmlRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.ExecuteBatchDmlRequest} ExecuteBatchDmlRequest + */ + ExecuteBatchDmlRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.ExecuteBatchDmlRequest) + return object; + var message = new $root.google.spanner.v1.ExecuteBatchDmlRequest(); + if (object.session != null) + message.session = String(object.session); + if (object.transaction != null) { + if (typeof object.transaction !== "object") + throw TypeError(".google.spanner.v1.ExecuteBatchDmlRequest.transaction: object expected"); + message.transaction = $root.google.spanner.v1.TransactionSelector.fromObject(object.transaction); + } + if (object.statements) { + if (!Array.isArray(object.statements)) + throw TypeError(".google.spanner.v1.ExecuteBatchDmlRequest.statements: array expected"); + message.statements = []; + for (var i = 0; i < object.statements.length; ++i) { + if (typeof object.statements[i] !== "object") + throw TypeError(".google.spanner.v1.ExecuteBatchDmlRequest.statements: object expected"); + message.statements[i] = $root.google.spanner.v1.ExecuteBatchDmlRequest.Statement.fromObject(object.statements[i]); + } + } + if (object.seqno != null) + if ($util.Long) + (message.seqno = $util.Long.fromValue(object.seqno)).unsigned = false; + else if (typeof object.seqno === "string") + message.seqno = parseInt(object.seqno, 10); + else if (typeof object.seqno === "number") + message.seqno = object.seqno; + else if (typeof object.seqno === "object") + message.seqno = new $util.LongBits(object.seqno.low >>> 0, object.seqno.high >>> 0).toNumber(); + if (object.requestOptions != null) { + if (typeof object.requestOptions !== "object") + throw TypeError(".google.spanner.v1.ExecuteBatchDmlRequest.requestOptions: object expected"); + message.requestOptions = $root.google.spanner.v1.RequestOptions.fromObject(object.requestOptions); + } + if (object.lastStatements != null) + message.lastStatements = Boolean(object.lastStatements); + return message; + }; + + /** + * Creates a plain object from an ExecuteBatchDmlRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.ExecuteBatchDmlRequest + * @static + * @param {google.spanner.v1.ExecuteBatchDmlRequest} message ExecuteBatchDmlRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExecuteBatchDmlRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.statements = []; + if (options.defaults) { + object.session = ""; + object.transaction = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seqno = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seqno = options.longs === String ? "0" : 0; + object.requestOptions = null; + object.lastStatements = false; + } + if (message.session != null && message.hasOwnProperty("session")) + object.session = message.session; + if (message.transaction != null && message.hasOwnProperty("transaction")) + object.transaction = $root.google.spanner.v1.TransactionSelector.toObject(message.transaction, options); + if (message.statements && message.statements.length) { + object.statements = []; + for (var j = 0; j < message.statements.length; ++j) + object.statements[j] = $root.google.spanner.v1.ExecuteBatchDmlRequest.Statement.toObject(message.statements[j], options); + } + if (message.seqno != null && message.hasOwnProperty("seqno")) + if (typeof message.seqno === "number") + object.seqno = options.longs === String ? String(message.seqno) : message.seqno; + else + object.seqno = options.longs === String ? $util.Long.prototype.toString.call(message.seqno) : options.longs === Number ? new $util.LongBits(message.seqno.low >>> 0, message.seqno.high >>> 0).toNumber() : message.seqno; + if (message.requestOptions != null && message.hasOwnProperty("requestOptions")) + object.requestOptions = $root.google.spanner.v1.RequestOptions.toObject(message.requestOptions, options); + if (message.lastStatements != null && message.hasOwnProperty("lastStatements")) + object.lastStatements = message.lastStatements; + return object; + }; + + /** + * Converts this ExecuteBatchDmlRequest to JSON. + * @function toJSON + * @memberof google.spanner.v1.ExecuteBatchDmlRequest + * @instance + * @returns {Object.} JSON object + */ + ExecuteBatchDmlRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExecuteBatchDmlRequest + * @function getTypeUrl + * @memberof google.spanner.v1.ExecuteBatchDmlRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExecuteBatchDmlRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.ExecuteBatchDmlRequest"; + }; + + ExecuteBatchDmlRequest.Statement = (function() { + + /** + * Properties of a Statement. + * @memberof google.spanner.v1.ExecuteBatchDmlRequest + * @interface IStatement + * @property {string|null} [sql] Statement sql + * @property {google.protobuf.IStruct|null} [params] Statement params + * @property {Object.|null} [paramTypes] Statement paramTypes + */ + + /** + * Constructs a new Statement. + * @memberof google.spanner.v1.ExecuteBatchDmlRequest + * @classdesc Represents a Statement. + * @implements IStatement + * @constructor + * @param {google.spanner.v1.ExecuteBatchDmlRequest.IStatement=} [properties] Properties to set + */ + function Statement(properties) { + this.paramTypes = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Statement sql. + * @member {string} sql + * @memberof google.spanner.v1.ExecuteBatchDmlRequest.Statement + * @instance + */ + Statement.prototype.sql = ""; + + /** + * Statement params. + * @member {google.protobuf.IStruct|null|undefined} params + * @memberof google.spanner.v1.ExecuteBatchDmlRequest.Statement + * @instance + */ + Statement.prototype.params = null; + + /** + * Statement paramTypes. + * @member {Object.} paramTypes + * @memberof google.spanner.v1.ExecuteBatchDmlRequest.Statement + * @instance + */ + Statement.prototype.paramTypes = $util.emptyObject; + + /** + * Creates a new Statement instance using the specified properties. + * @function create + * @memberof google.spanner.v1.ExecuteBatchDmlRequest.Statement + * @static + * @param {google.spanner.v1.ExecuteBatchDmlRequest.IStatement=} [properties] Properties to set + * @returns {google.spanner.v1.ExecuteBatchDmlRequest.Statement} Statement instance + */ + Statement.create = function create(properties) { + return new Statement(properties); + }; + + /** + * Encodes the specified Statement message. Does not implicitly {@link google.spanner.v1.ExecuteBatchDmlRequest.Statement.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.ExecuteBatchDmlRequest.Statement + * @static + * @param {google.spanner.v1.ExecuteBatchDmlRequest.IStatement} message Statement message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Statement.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sql != null && Object.hasOwnProperty.call(message, "sql")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.sql); + if (message.params != null && Object.hasOwnProperty.call(message, "params")) + $root.google.protobuf.Struct.encode(message.params, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.paramTypes != null && Object.hasOwnProperty.call(message, "paramTypes")) + for (var keys = Object.keys(message.paramTypes), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.spanner.v1.Type.encode(message.paramTypes[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified Statement message, length delimited. Does not implicitly {@link google.spanner.v1.ExecuteBatchDmlRequest.Statement.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.ExecuteBatchDmlRequest.Statement + * @static + * @param {google.spanner.v1.ExecuteBatchDmlRequest.IStatement} message Statement message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Statement.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Statement message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.ExecuteBatchDmlRequest.Statement + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.ExecuteBatchDmlRequest.Statement} Statement + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Statement.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.ExecuteBatchDmlRequest.Statement(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.sql = reader.string(); + break; + } + case 2: { + message.params = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 3: { + if (message.paramTypes === $util.emptyObject) + message.paramTypes = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.spanner.v1.Type.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.paramTypes[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Statement message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.ExecuteBatchDmlRequest.Statement + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.ExecuteBatchDmlRequest.Statement} Statement + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Statement.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Statement message. + * @function verify + * @memberof google.spanner.v1.ExecuteBatchDmlRequest.Statement + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Statement.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sql != null && message.hasOwnProperty("sql")) + if (!$util.isString(message.sql)) + return "sql: string expected"; + if (message.params != null && message.hasOwnProperty("params")) { + var error = $root.google.protobuf.Struct.verify(message.params); + if (error) + return "params." + error; + } + if (message.paramTypes != null && message.hasOwnProperty("paramTypes")) { + if (!$util.isObject(message.paramTypes)) + return "paramTypes: object expected"; + var key = Object.keys(message.paramTypes); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.spanner.v1.Type.verify(message.paramTypes[key[i]]); + if (error) + return "paramTypes." + error; + } + } + return null; + }; + + /** + * Creates a Statement message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.ExecuteBatchDmlRequest.Statement + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.ExecuteBatchDmlRequest.Statement} Statement + */ + Statement.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.ExecuteBatchDmlRequest.Statement) + return object; + var message = new $root.google.spanner.v1.ExecuteBatchDmlRequest.Statement(); + if (object.sql != null) + message.sql = String(object.sql); + if (object.params != null) { + if (typeof object.params !== "object") + throw TypeError(".google.spanner.v1.ExecuteBatchDmlRequest.Statement.params: object expected"); + message.params = $root.google.protobuf.Struct.fromObject(object.params); + } + if (object.paramTypes) { + if (typeof object.paramTypes !== "object") + throw TypeError(".google.spanner.v1.ExecuteBatchDmlRequest.Statement.paramTypes: object expected"); + message.paramTypes = {}; + for (var keys = Object.keys(object.paramTypes), i = 0; i < keys.length; ++i) { + if (typeof object.paramTypes[keys[i]] !== "object") + throw TypeError(".google.spanner.v1.ExecuteBatchDmlRequest.Statement.paramTypes: object expected"); + message.paramTypes[keys[i]] = $root.google.spanner.v1.Type.fromObject(object.paramTypes[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a Statement message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.ExecuteBatchDmlRequest.Statement + * @static + * @param {google.spanner.v1.ExecuteBatchDmlRequest.Statement} message Statement + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Statement.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.paramTypes = {}; + if (options.defaults) { + object.sql = ""; + object.params = null; + } + if (message.sql != null && message.hasOwnProperty("sql")) + object.sql = message.sql; + if (message.params != null && message.hasOwnProperty("params")) + object.params = $root.google.protobuf.Struct.toObject(message.params, options); + var keys2; + if (message.paramTypes && (keys2 = Object.keys(message.paramTypes)).length) { + object.paramTypes = {}; + for (var j = 0; j < keys2.length; ++j) + object.paramTypes[keys2[j]] = $root.google.spanner.v1.Type.toObject(message.paramTypes[keys2[j]], options); + } + return object; + }; + + /** + * Converts this Statement to JSON. + * @function toJSON + * @memberof google.spanner.v1.ExecuteBatchDmlRequest.Statement + * @instance + * @returns {Object.} JSON object + */ + Statement.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Statement + * @function getTypeUrl + * @memberof google.spanner.v1.ExecuteBatchDmlRequest.Statement + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Statement.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.ExecuteBatchDmlRequest.Statement"; + }; + + return Statement; + })(); + + return ExecuteBatchDmlRequest; + })(); + + v1.ExecuteBatchDmlResponse = (function() { + + /** + * Properties of an ExecuteBatchDmlResponse. + * @memberof google.spanner.v1 + * @interface IExecuteBatchDmlResponse + * @property {Array.|null} [resultSets] ExecuteBatchDmlResponse resultSets + * @property {google.rpc.IStatus|null} [status] ExecuteBatchDmlResponse status + * @property {google.spanner.v1.IMultiplexedSessionPrecommitToken|null} [precommitToken] ExecuteBatchDmlResponse precommitToken + */ + + /** + * Constructs a new ExecuteBatchDmlResponse. + * @memberof google.spanner.v1 + * @classdesc Represents an ExecuteBatchDmlResponse. + * @implements IExecuteBatchDmlResponse + * @constructor + * @param {google.spanner.v1.IExecuteBatchDmlResponse=} [properties] Properties to set + */ + function ExecuteBatchDmlResponse(properties) { + this.resultSets = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExecuteBatchDmlResponse resultSets. + * @member {Array.} resultSets + * @memberof google.spanner.v1.ExecuteBatchDmlResponse + * @instance + */ + ExecuteBatchDmlResponse.prototype.resultSets = $util.emptyArray; + + /** + * ExecuteBatchDmlResponse status. + * @member {google.rpc.IStatus|null|undefined} status + * @memberof google.spanner.v1.ExecuteBatchDmlResponse + * @instance + */ + ExecuteBatchDmlResponse.prototype.status = null; + + /** + * ExecuteBatchDmlResponse precommitToken. + * @member {google.spanner.v1.IMultiplexedSessionPrecommitToken|null|undefined} precommitToken + * @memberof google.spanner.v1.ExecuteBatchDmlResponse + * @instance + */ + ExecuteBatchDmlResponse.prototype.precommitToken = null; + + /** + * Creates a new ExecuteBatchDmlResponse instance using the specified properties. + * @function create + * @memberof google.spanner.v1.ExecuteBatchDmlResponse + * @static + * @param {google.spanner.v1.IExecuteBatchDmlResponse=} [properties] Properties to set + * @returns {google.spanner.v1.ExecuteBatchDmlResponse} ExecuteBatchDmlResponse instance + */ + ExecuteBatchDmlResponse.create = function create(properties) { + return new ExecuteBatchDmlResponse(properties); + }; + + /** + * Encodes the specified ExecuteBatchDmlResponse message. Does not implicitly {@link google.spanner.v1.ExecuteBatchDmlResponse.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.ExecuteBatchDmlResponse + * @static + * @param {google.spanner.v1.IExecuteBatchDmlResponse} message ExecuteBatchDmlResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecuteBatchDmlResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resultSets != null && message.resultSets.length) + for (var i = 0; i < message.resultSets.length; ++i) + $root.google.spanner.v1.ResultSet.encode(message.resultSets[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + $root.google.rpc.Status.encode(message.status, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.precommitToken != null && Object.hasOwnProperty.call(message, "precommitToken")) + $root.google.spanner.v1.MultiplexedSessionPrecommitToken.encode(message.precommitToken, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExecuteBatchDmlResponse message, length delimited. Does not implicitly {@link google.spanner.v1.ExecuteBatchDmlResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.ExecuteBatchDmlResponse + * @static + * @param {google.spanner.v1.IExecuteBatchDmlResponse} message ExecuteBatchDmlResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecuteBatchDmlResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExecuteBatchDmlResponse message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.ExecuteBatchDmlResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.ExecuteBatchDmlResponse} ExecuteBatchDmlResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecuteBatchDmlResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.ExecuteBatchDmlResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.resultSets && message.resultSets.length)) + message.resultSets = []; + message.resultSets.push($root.google.spanner.v1.ResultSet.decode(reader, reader.uint32())); + break; + } + case 2: { + message.status = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 3: { + message.precommitToken = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExecuteBatchDmlResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.ExecuteBatchDmlResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.ExecuteBatchDmlResponse} ExecuteBatchDmlResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecuteBatchDmlResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExecuteBatchDmlResponse message. + * @function verify + * @memberof google.spanner.v1.ExecuteBatchDmlResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExecuteBatchDmlResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resultSets != null && message.hasOwnProperty("resultSets")) { + if (!Array.isArray(message.resultSets)) + return "resultSets: array expected"; + for (var i = 0; i < message.resultSets.length; ++i) { + var error = $root.google.spanner.v1.ResultSet.verify(message.resultSets[i]); + if (error) + return "resultSets." + error; + } + } + if (message.status != null && message.hasOwnProperty("status")) { + var error = $root.google.rpc.Status.verify(message.status); + if (error) + return "status." + error; + } + if (message.precommitToken != null && message.hasOwnProperty("precommitToken")) { + var error = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.verify(message.precommitToken); + if (error) + return "precommitToken." + error; + } + return null; + }; + + /** + * Creates an ExecuteBatchDmlResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.ExecuteBatchDmlResponse + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.ExecuteBatchDmlResponse} ExecuteBatchDmlResponse + */ + ExecuteBatchDmlResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.ExecuteBatchDmlResponse) + return object; + var message = new $root.google.spanner.v1.ExecuteBatchDmlResponse(); + if (object.resultSets) { + if (!Array.isArray(object.resultSets)) + throw TypeError(".google.spanner.v1.ExecuteBatchDmlResponse.resultSets: array expected"); + message.resultSets = []; + for (var i = 0; i < object.resultSets.length; ++i) { + if (typeof object.resultSets[i] !== "object") + throw TypeError(".google.spanner.v1.ExecuteBatchDmlResponse.resultSets: object expected"); + message.resultSets[i] = $root.google.spanner.v1.ResultSet.fromObject(object.resultSets[i]); + } + } + if (object.status != null) { + if (typeof object.status !== "object") + throw TypeError(".google.spanner.v1.ExecuteBatchDmlResponse.status: object expected"); + message.status = $root.google.rpc.Status.fromObject(object.status); + } + if (object.precommitToken != null) { + if (typeof object.precommitToken !== "object") + throw TypeError(".google.spanner.v1.ExecuteBatchDmlResponse.precommitToken: object expected"); + message.precommitToken = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.fromObject(object.precommitToken); + } + return message; + }; + + /** + * Creates a plain object from an ExecuteBatchDmlResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.ExecuteBatchDmlResponse + * @static + * @param {google.spanner.v1.ExecuteBatchDmlResponse} message ExecuteBatchDmlResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExecuteBatchDmlResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.resultSets = []; + if (options.defaults) { + object.status = null; + object.precommitToken = null; + } + if (message.resultSets && message.resultSets.length) { + object.resultSets = []; + for (var j = 0; j < message.resultSets.length; ++j) + object.resultSets[j] = $root.google.spanner.v1.ResultSet.toObject(message.resultSets[j], options); + } + if (message.status != null && message.hasOwnProperty("status")) + object.status = $root.google.rpc.Status.toObject(message.status, options); + if (message.precommitToken != null && message.hasOwnProperty("precommitToken")) + object.precommitToken = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.toObject(message.precommitToken, options); + return object; + }; + + /** + * Converts this ExecuteBatchDmlResponse to JSON. + * @function toJSON + * @memberof google.spanner.v1.ExecuteBatchDmlResponse + * @instance + * @returns {Object.} JSON object + */ + ExecuteBatchDmlResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExecuteBatchDmlResponse + * @function getTypeUrl + * @memberof google.spanner.v1.ExecuteBatchDmlResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExecuteBatchDmlResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.ExecuteBatchDmlResponse"; + }; + + return ExecuteBatchDmlResponse; + })(); + + v1.PartitionOptions = (function() { + + /** + * Properties of a PartitionOptions. + * @memberof google.spanner.v1 + * @interface IPartitionOptions + * @property {number|Long|null} [partitionSizeBytes] PartitionOptions partitionSizeBytes + * @property {number|Long|null} [maxPartitions] PartitionOptions maxPartitions + */ + + /** + * Constructs a new PartitionOptions. + * @memberof google.spanner.v1 + * @classdesc Represents a PartitionOptions. + * @implements IPartitionOptions + * @constructor + * @param {google.spanner.v1.IPartitionOptions=} [properties] Properties to set + */ + function PartitionOptions(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PartitionOptions partitionSizeBytes. + * @member {number|Long} partitionSizeBytes + * @memberof google.spanner.v1.PartitionOptions + * @instance + */ + PartitionOptions.prototype.partitionSizeBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * PartitionOptions maxPartitions. + * @member {number|Long} maxPartitions + * @memberof google.spanner.v1.PartitionOptions + * @instance + */ + PartitionOptions.prototype.maxPartitions = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new PartitionOptions instance using the specified properties. + * @function create + * @memberof google.spanner.v1.PartitionOptions + * @static + * @param {google.spanner.v1.IPartitionOptions=} [properties] Properties to set + * @returns {google.spanner.v1.PartitionOptions} PartitionOptions instance + */ + PartitionOptions.create = function create(properties) { + return new PartitionOptions(properties); + }; + + /** + * Encodes the specified PartitionOptions message. Does not implicitly {@link google.spanner.v1.PartitionOptions.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.PartitionOptions + * @static + * @param {google.spanner.v1.IPartitionOptions} message PartitionOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartitionOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.partitionSizeBytes != null && Object.hasOwnProperty.call(message, "partitionSizeBytes")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.partitionSizeBytes); + if (message.maxPartitions != null && Object.hasOwnProperty.call(message, "maxPartitions")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.maxPartitions); + return writer; + }; + + /** + * Encodes the specified PartitionOptions message, length delimited. Does not implicitly {@link google.spanner.v1.PartitionOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.PartitionOptions + * @static + * @param {google.spanner.v1.IPartitionOptions} message PartitionOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartitionOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PartitionOptions message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.PartitionOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.PartitionOptions} PartitionOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartitionOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.PartitionOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.partitionSizeBytes = reader.int64(); + break; + } + case 2: { + message.maxPartitions = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PartitionOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.PartitionOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.PartitionOptions} PartitionOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartitionOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PartitionOptions message. + * @function verify + * @memberof google.spanner.v1.PartitionOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PartitionOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.partitionSizeBytes != null && message.hasOwnProperty("partitionSizeBytes")) + if (!$util.isInteger(message.partitionSizeBytes) && !(message.partitionSizeBytes && $util.isInteger(message.partitionSizeBytes.low) && $util.isInteger(message.partitionSizeBytes.high))) + return "partitionSizeBytes: integer|Long expected"; + if (message.maxPartitions != null && message.hasOwnProperty("maxPartitions")) + if (!$util.isInteger(message.maxPartitions) && !(message.maxPartitions && $util.isInteger(message.maxPartitions.low) && $util.isInteger(message.maxPartitions.high))) + return "maxPartitions: integer|Long expected"; + return null; + }; + + /** + * Creates a PartitionOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.PartitionOptions + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.PartitionOptions} PartitionOptions + */ + PartitionOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.PartitionOptions) + return object; + var message = new $root.google.spanner.v1.PartitionOptions(); + if (object.partitionSizeBytes != null) + if ($util.Long) + (message.partitionSizeBytes = $util.Long.fromValue(object.partitionSizeBytes)).unsigned = false; + else if (typeof object.partitionSizeBytes === "string") + message.partitionSizeBytes = parseInt(object.partitionSizeBytes, 10); + else if (typeof object.partitionSizeBytes === "number") + message.partitionSizeBytes = object.partitionSizeBytes; + else if (typeof object.partitionSizeBytes === "object") + message.partitionSizeBytes = new $util.LongBits(object.partitionSizeBytes.low >>> 0, object.partitionSizeBytes.high >>> 0).toNumber(); + if (object.maxPartitions != null) + if ($util.Long) + (message.maxPartitions = $util.Long.fromValue(object.maxPartitions)).unsigned = false; + else if (typeof object.maxPartitions === "string") + message.maxPartitions = parseInt(object.maxPartitions, 10); + else if (typeof object.maxPartitions === "number") + message.maxPartitions = object.maxPartitions; + else if (typeof object.maxPartitions === "object") + message.maxPartitions = new $util.LongBits(object.maxPartitions.low >>> 0, object.maxPartitions.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a PartitionOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.PartitionOptions + * @static + * @param {google.spanner.v1.PartitionOptions} message PartitionOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PartitionOptions.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.partitionSizeBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.partitionSizeBytes = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.maxPartitions = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.maxPartitions = options.longs === String ? "0" : 0; + } + if (message.partitionSizeBytes != null && message.hasOwnProperty("partitionSizeBytes")) + if (typeof message.partitionSizeBytes === "number") + object.partitionSizeBytes = options.longs === String ? String(message.partitionSizeBytes) : message.partitionSizeBytes; + else + object.partitionSizeBytes = options.longs === String ? $util.Long.prototype.toString.call(message.partitionSizeBytes) : options.longs === Number ? new $util.LongBits(message.partitionSizeBytes.low >>> 0, message.partitionSizeBytes.high >>> 0).toNumber() : message.partitionSizeBytes; + if (message.maxPartitions != null && message.hasOwnProperty("maxPartitions")) + if (typeof message.maxPartitions === "number") + object.maxPartitions = options.longs === String ? String(message.maxPartitions) : message.maxPartitions; + else + object.maxPartitions = options.longs === String ? $util.Long.prototype.toString.call(message.maxPartitions) : options.longs === Number ? new $util.LongBits(message.maxPartitions.low >>> 0, message.maxPartitions.high >>> 0).toNumber() : message.maxPartitions; + return object; + }; + + /** + * Converts this PartitionOptions to JSON. + * @function toJSON + * @memberof google.spanner.v1.PartitionOptions + * @instance + * @returns {Object.} JSON object + */ + PartitionOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PartitionOptions + * @function getTypeUrl + * @memberof google.spanner.v1.PartitionOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PartitionOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.PartitionOptions"; + }; + + return PartitionOptions; + })(); + + v1.PartitionQueryRequest = (function() { + + /** + * Properties of a PartitionQueryRequest. + * @memberof google.spanner.v1 + * @interface IPartitionQueryRequest + * @property {string|null} [session] PartitionQueryRequest session + * @property {google.spanner.v1.ITransactionSelector|null} [transaction] PartitionQueryRequest transaction + * @property {string|null} [sql] PartitionQueryRequest sql + * @property {google.protobuf.IStruct|null} [params] PartitionQueryRequest params + * @property {Object.|null} [paramTypes] PartitionQueryRequest paramTypes + * @property {google.spanner.v1.IPartitionOptions|null} [partitionOptions] PartitionQueryRequest partitionOptions + */ + + /** + * Constructs a new PartitionQueryRequest. + * @memberof google.spanner.v1 + * @classdesc Represents a PartitionQueryRequest. + * @implements IPartitionQueryRequest + * @constructor + * @param {google.spanner.v1.IPartitionQueryRequest=} [properties] Properties to set + */ + function PartitionQueryRequest(properties) { + this.paramTypes = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PartitionQueryRequest session. + * @member {string} session + * @memberof google.spanner.v1.PartitionQueryRequest + * @instance + */ + PartitionQueryRequest.prototype.session = ""; + + /** + * PartitionQueryRequest transaction. + * @member {google.spanner.v1.ITransactionSelector|null|undefined} transaction + * @memberof google.spanner.v1.PartitionQueryRequest + * @instance + */ + PartitionQueryRequest.prototype.transaction = null; + + /** + * PartitionQueryRequest sql. + * @member {string} sql + * @memberof google.spanner.v1.PartitionQueryRequest + * @instance + */ + PartitionQueryRequest.prototype.sql = ""; + + /** + * PartitionQueryRequest params. + * @member {google.protobuf.IStruct|null|undefined} params + * @memberof google.spanner.v1.PartitionQueryRequest + * @instance + */ + PartitionQueryRequest.prototype.params = null; + + /** + * PartitionQueryRequest paramTypes. + * @member {Object.} paramTypes + * @memberof google.spanner.v1.PartitionQueryRequest + * @instance + */ + PartitionQueryRequest.prototype.paramTypes = $util.emptyObject; + + /** + * PartitionQueryRequest partitionOptions. + * @member {google.spanner.v1.IPartitionOptions|null|undefined} partitionOptions + * @memberof google.spanner.v1.PartitionQueryRequest + * @instance + */ + PartitionQueryRequest.prototype.partitionOptions = null; + + /** + * Creates a new PartitionQueryRequest instance using the specified properties. + * @function create + * @memberof google.spanner.v1.PartitionQueryRequest + * @static + * @param {google.spanner.v1.IPartitionQueryRequest=} [properties] Properties to set + * @returns {google.spanner.v1.PartitionQueryRequest} PartitionQueryRequest instance + */ + PartitionQueryRequest.create = function create(properties) { + return new PartitionQueryRequest(properties); + }; + + /** + * Encodes the specified PartitionQueryRequest message. Does not implicitly {@link google.spanner.v1.PartitionQueryRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.PartitionQueryRequest + * @static + * @param {google.spanner.v1.IPartitionQueryRequest} message PartitionQueryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartitionQueryRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.session != null && Object.hasOwnProperty.call(message, "session")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.session); + if (message.transaction != null && Object.hasOwnProperty.call(message, "transaction")) + $root.google.spanner.v1.TransactionSelector.encode(message.transaction, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.sql != null && Object.hasOwnProperty.call(message, "sql")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.sql); + if (message.params != null && Object.hasOwnProperty.call(message, "params")) + $root.google.protobuf.Struct.encode(message.params, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.paramTypes != null && Object.hasOwnProperty.call(message, "paramTypes")) + for (var keys = Object.keys(message.paramTypes), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.spanner.v1.Type.encode(message.paramTypes[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.partitionOptions != null && Object.hasOwnProperty.call(message, "partitionOptions")) + $root.google.spanner.v1.PartitionOptions.encode(message.partitionOptions, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PartitionQueryRequest message, length delimited. Does not implicitly {@link google.spanner.v1.PartitionQueryRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.PartitionQueryRequest + * @static + * @param {google.spanner.v1.IPartitionQueryRequest} message PartitionQueryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartitionQueryRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PartitionQueryRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.PartitionQueryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.PartitionQueryRequest} PartitionQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartitionQueryRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.PartitionQueryRequest(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.session = reader.string(); + break; + } + case 2: { + message.transaction = $root.google.spanner.v1.TransactionSelector.decode(reader, reader.uint32()); + break; + } + case 3: { + message.sql = reader.string(); + break; + } + case 4: { + message.params = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 5: { + if (message.paramTypes === $util.emptyObject) + message.paramTypes = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.spanner.v1.Type.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.paramTypes[key] = value; + break; + } + case 6: { + message.partitionOptions = $root.google.spanner.v1.PartitionOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PartitionQueryRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.PartitionQueryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.PartitionQueryRequest} PartitionQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartitionQueryRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PartitionQueryRequest message. + * @function verify + * @memberof google.spanner.v1.PartitionQueryRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PartitionQueryRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.session != null && message.hasOwnProperty("session")) + if (!$util.isString(message.session)) + return "session: string expected"; + if (message.transaction != null && message.hasOwnProperty("transaction")) { + var error = $root.google.spanner.v1.TransactionSelector.verify(message.transaction); + if (error) + return "transaction." + error; + } + if (message.sql != null && message.hasOwnProperty("sql")) + if (!$util.isString(message.sql)) + return "sql: string expected"; + if (message.params != null && message.hasOwnProperty("params")) { + var error = $root.google.protobuf.Struct.verify(message.params); + if (error) + return "params." + error; + } + if (message.paramTypes != null && message.hasOwnProperty("paramTypes")) { + if (!$util.isObject(message.paramTypes)) + return "paramTypes: object expected"; + var key = Object.keys(message.paramTypes); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.spanner.v1.Type.verify(message.paramTypes[key[i]]); + if (error) + return "paramTypes." + error; + } + } + if (message.partitionOptions != null && message.hasOwnProperty("partitionOptions")) { + var error = $root.google.spanner.v1.PartitionOptions.verify(message.partitionOptions); + if (error) + return "partitionOptions." + error; + } + return null; + }; + + /** + * Creates a PartitionQueryRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.PartitionQueryRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.PartitionQueryRequest} PartitionQueryRequest + */ + PartitionQueryRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.PartitionQueryRequest) + return object; + var message = new $root.google.spanner.v1.PartitionQueryRequest(); + if (object.session != null) + message.session = String(object.session); + if (object.transaction != null) { + if (typeof object.transaction !== "object") + throw TypeError(".google.spanner.v1.PartitionQueryRequest.transaction: object expected"); + message.transaction = $root.google.spanner.v1.TransactionSelector.fromObject(object.transaction); + } + if (object.sql != null) + message.sql = String(object.sql); + if (object.params != null) { + if (typeof object.params !== "object") + throw TypeError(".google.spanner.v1.PartitionQueryRequest.params: object expected"); + message.params = $root.google.protobuf.Struct.fromObject(object.params); + } + if (object.paramTypes) { + if (typeof object.paramTypes !== "object") + throw TypeError(".google.spanner.v1.PartitionQueryRequest.paramTypes: object expected"); + message.paramTypes = {}; + for (var keys = Object.keys(object.paramTypes), i = 0; i < keys.length; ++i) { + if (typeof object.paramTypes[keys[i]] !== "object") + throw TypeError(".google.spanner.v1.PartitionQueryRequest.paramTypes: object expected"); + message.paramTypes[keys[i]] = $root.google.spanner.v1.Type.fromObject(object.paramTypes[keys[i]]); + } + } + if (object.partitionOptions != null) { + if (typeof object.partitionOptions !== "object") + throw TypeError(".google.spanner.v1.PartitionQueryRequest.partitionOptions: object expected"); + message.partitionOptions = $root.google.spanner.v1.PartitionOptions.fromObject(object.partitionOptions); + } + return message; + }; + + /** + * Creates a plain object from a PartitionQueryRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.PartitionQueryRequest + * @static + * @param {google.spanner.v1.PartitionQueryRequest} message PartitionQueryRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PartitionQueryRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.paramTypes = {}; + if (options.defaults) { + object.session = ""; + object.transaction = null; + object.sql = ""; + object.params = null; + object.partitionOptions = null; + } + if (message.session != null && message.hasOwnProperty("session")) + object.session = message.session; + if (message.transaction != null && message.hasOwnProperty("transaction")) + object.transaction = $root.google.spanner.v1.TransactionSelector.toObject(message.transaction, options); + if (message.sql != null && message.hasOwnProperty("sql")) + object.sql = message.sql; + if (message.params != null && message.hasOwnProperty("params")) + object.params = $root.google.protobuf.Struct.toObject(message.params, options); + var keys2; + if (message.paramTypes && (keys2 = Object.keys(message.paramTypes)).length) { + object.paramTypes = {}; + for (var j = 0; j < keys2.length; ++j) + object.paramTypes[keys2[j]] = $root.google.spanner.v1.Type.toObject(message.paramTypes[keys2[j]], options); + } + if (message.partitionOptions != null && message.hasOwnProperty("partitionOptions")) + object.partitionOptions = $root.google.spanner.v1.PartitionOptions.toObject(message.partitionOptions, options); + return object; + }; + + /** + * Converts this PartitionQueryRequest to JSON. + * @function toJSON + * @memberof google.spanner.v1.PartitionQueryRequest + * @instance + * @returns {Object.} JSON object + */ + PartitionQueryRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PartitionQueryRequest + * @function getTypeUrl + * @memberof google.spanner.v1.PartitionQueryRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PartitionQueryRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.PartitionQueryRequest"; + }; + + return PartitionQueryRequest; + })(); + + v1.PartitionReadRequest = (function() { + + /** + * Properties of a PartitionReadRequest. + * @memberof google.spanner.v1 + * @interface IPartitionReadRequest + * @property {string|null} [session] PartitionReadRequest session + * @property {google.spanner.v1.ITransactionSelector|null} [transaction] PartitionReadRequest transaction + * @property {string|null} [table] PartitionReadRequest table + * @property {string|null} [index] PartitionReadRequest index + * @property {Array.|null} [columns] PartitionReadRequest columns + * @property {google.spanner.v1.IKeySet|null} [keySet] PartitionReadRequest keySet + * @property {google.spanner.v1.IPartitionOptions|null} [partitionOptions] PartitionReadRequest partitionOptions + */ + + /** + * Constructs a new PartitionReadRequest. + * @memberof google.spanner.v1 + * @classdesc Represents a PartitionReadRequest. + * @implements IPartitionReadRequest + * @constructor + * @param {google.spanner.v1.IPartitionReadRequest=} [properties] Properties to set + */ + function PartitionReadRequest(properties) { + this.columns = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PartitionReadRequest session. + * @member {string} session + * @memberof google.spanner.v1.PartitionReadRequest + * @instance + */ + PartitionReadRequest.prototype.session = ""; + + /** + * PartitionReadRequest transaction. + * @member {google.spanner.v1.ITransactionSelector|null|undefined} transaction + * @memberof google.spanner.v1.PartitionReadRequest + * @instance + */ + PartitionReadRequest.prototype.transaction = null; + + /** + * PartitionReadRequest table. + * @member {string} table + * @memberof google.spanner.v1.PartitionReadRequest + * @instance + */ + PartitionReadRequest.prototype.table = ""; + + /** + * PartitionReadRequest index. + * @member {string} index + * @memberof google.spanner.v1.PartitionReadRequest + * @instance + */ + PartitionReadRequest.prototype.index = ""; + + /** + * PartitionReadRequest columns. + * @member {Array.} columns + * @memberof google.spanner.v1.PartitionReadRequest + * @instance + */ + PartitionReadRequest.prototype.columns = $util.emptyArray; + + /** + * PartitionReadRequest keySet. + * @member {google.spanner.v1.IKeySet|null|undefined} keySet + * @memberof google.spanner.v1.PartitionReadRequest + * @instance + */ + PartitionReadRequest.prototype.keySet = null; + + /** + * PartitionReadRequest partitionOptions. + * @member {google.spanner.v1.IPartitionOptions|null|undefined} partitionOptions + * @memberof google.spanner.v1.PartitionReadRequest + * @instance + */ + PartitionReadRequest.prototype.partitionOptions = null; + + /** + * Creates a new PartitionReadRequest instance using the specified properties. + * @function create + * @memberof google.spanner.v1.PartitionReadRequest + * @static + * @param {google.spanner.v1.IPartitionReadRequest=} [properties] Properties to set + * @returns {google.spanner.v1.PartitionReadRequest} PartitionReadRequest instance + */ + PartitionReadRequest.create = function create(properties) { + return new PartitionReadRequest(properties); + }; + + /** + * Encodes the specified PartitionReadRequest message. Does not implicitly {@link google.spanner.v1.PartitionReadRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.PartitionReadRequest + * @static + * @param {google.spanner.v1.IPartitionReadRequest} message PartitionReadRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartitionReadRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.session != null && Object.hasOwnProperty.call(message, "session")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.session); + if (message.transaction != null && Object.hasOwnProperty.call(message, "transaction")) + $root.google.spanner.v1.TransactionSelector.encode(message.transaction, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.table != null && Object.hasOwnProperty.call(message, "table")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.table); + if (message.index != null && Object.hasOwnProperty.call(message, "index")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.index); + if (message.columns != null && message.columns.length) + for (var i = 0; i < message.columns.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.columns[i]); + if (message.keySet != null && Object.hasOwnProperty.call(message, "keySet")) + $root.google.spanner.v1.KeySet.encode(message.keySet, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.partitionOptions != null && Object.hasOwnProperty.call(message, "partitionOptions")) + $root.google.spanner.v1.PartitionOptions.encode(message.partitionOptions, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PartitionReadRequest message, length delimited. Does not implicitly {@link google.spanner.v1.PartitionReadRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.PartitionReadRequest + * @static + * @param {google.spanner.v1.IPartitionReadRequest} message PartitionReadRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartitionReadRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PartitionReadRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.PartitionReadRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.PartitionReadRequest} PartitionReadRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartitionReadRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.PartitionReadRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.session = reader.string(); + break; + } + case 2: { + message.transaction = $root.google.spanner.v1.TransactionSelector.decode(reader, reader.uint32()); + break; + } + case 3: { + message.table = reader.string(); + break; + } + case 4: { + message.index = reader.string(); + break; + } + case 5: { + if (!(message.columns && message.columns.length)) + message.columns = []; + message.columns.push(reader.string()); + break; + } + case 6: { + message.keySet = $root.google.spanner.v1.KeySet.decode(reader, reader.uint32()); + break; + } + case 9: { + message.partitionOptions = $root.google.spanner.v1.PartitionOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PartitionReadRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.PartitionReadRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.PartitionReadRequest} PartitionReadRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartitionReadRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PartitionReadRequest message. + * @function verify + * @memberof google.spanner.v1.PartitionReadRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PartitionReadRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.session != null && message.hasOwnProperty("session")) + if (!$util.isString(message.session)) + return "session: string expected"; + if (message.transaction != null && message.hasOwnProperty("transaction")) { + var error = $root.google.spanner.v1.TransactionSelector.verify(message.transaction); + if (error) + return "transaction." + error; + } + if (message.table != null && message.hasOwnProperty("table")) + if (!$util.isString(message.table)) + return "table: string expected"; + if (message.index != null && message.hasOwnProperty("index")) + if (!$util.isString(message.index)) + return "index: string expected"; + if (message.columns != null && message.hasOwnProperty("columns")) { + if (!Array.isArray(message.columns)) + return "columns: array expected"; + for (var i = 0; i < message.columns.length; ++i) + if (!$util.isString(message.columns[i])) + return "columns: string[] expected"; + } + if (message.keySet != null && message.hasOwnProperty("keySet")) { + var error = $root.google.spanner.v1.KeySet.verify(message.keySet); + if (error) + return "keySet." + error; + } + if (message.partitionOptions != null && message.hasOwnProperty("partitionOptions")) { + var error = $root.google.spanner.v1.PartitionOptions.verify(message.partitionOptions); + if (error) + return "partitionOptions." + error; + } + return null; + }; + + /** + * Creates a PartitionReadRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.PartitionReadRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.PartitionReadRequest} PartitionReadRequest + */ + PartitionReadRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.PartitionReadRequest) + return object; + var message = new $root.google.spanner.v1.PartitionReadRequest(); + if (object.session != null) + message.session = String(object.session); + if (object.transaction != null) { + if (typeof object.transaction !== "object") + throw TypeError(".google.spanner.v1.PartitionReadRequest.transaction: object expected"); + message.transaction = $root.google.spanner.v1.TransactionSelector.fromObject(object.transaction); + } + if (object.table != null) + message.table = String(object.table); + if (object.index != null) + message.index = String(object.index); + if (object.columns) { + if (!Array.isArray(object.columns)) + throw TypeError(".google.spanner.v1.PartitionReadRequest.columns: array expected"); + message.columns = []; + for (var i = 0; i < object.columns.length; ++i) + message.columns[i] = String(object.columns[i]); + } + if (object.keySet != null) { + if (typeof object.keySet !== "object") + throw TypeError(".google.spanner.v1.PartitionReadRequest.keySet: object expected"); + message.keySet = $root.google.spanner.v1.KeySet.fromObject(object.keySet); + } + if (object.partitionOptions != null) { + if (typeof object.partitionOptions !== "object") + throw TypeError(".google.spanner.v1.PartitionReadRequest.partitionOptions: object expected"); + message.partitionOptions = $root.google.spanner.v1.PartitionOptions.fromObject(object.partitionOptions); + } + return message; + }; + + /** + * Creates a plain object from a PartitionReadRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.PartitionReadRequest + * @static + * @param {google.spanner.v1.PartitionReadRequest} message PartitionReadRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PartitionReadRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.columns = []; + if (options.defaults) { + object.session = ""; + object.transaction = null; + object.table = ""; + object.index = ""; + object.keySet = null; + object.partitionOptions = null; + } + if (message.session != null && message.hasOwnProperty("session")) + object.session = message.session; + if (message.transaction != null && message.hasOwnProperty("transaction")) + object.transaction = $root.google.spanner.v1.TransactionSelector.toObject(message.transaction, options); + if (message.table != null && message.hasOwnProperty("table")) + object.table = message.table; + if (message.index != null && message.hasOwnProperty("index")) + object.index = message.index; + if (message.columns && message.columns.length) { + object.columns = []; + for (var j = 0; j < message.columns.length; ++j) + object.columns[j] = message.columns[j]; + } + if (message.keySet != null && message.hasOwnProperty("keySet")) + object.keySet = $root.google.spanner.v1.KeySet.toObject(message.keySet, options); + if (message.partitionOptions != null && message.hasOwnProperty("partitionOptions")) + object.partitionOptions = $root.google.spanner.v1.PartitionOptions.toObject(message.partitionOptions, options); + return object; + }; + + /** + * Converts this PartitionReadRequest to JSON. + * @function toJSON + * @memberof google.spanner.v1.PartitionReadRequest + * @instance + * @returns {Object.} JSON object + */ + PartitionReadRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PartitionReadRequest + * @function getTypeUrl + * @memberof google.spanner.v1.PartitionReadRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PartitionReadRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.PartitionReadRequest"; + }; + + return PartitionReadRequest; + })(); + + v1.Partition = (function() { + + /** + * Properties of a Partition. + * @memberof google.spanner.v1 + * @interface IPartition + * @property {Uint8Array|null} [partitionToken] Partition partitionToken + */ + + /** + * Constructs a new Partition. + * @memberof google.spanner.v1 + * @classdesc Represents a Partition. + * @implements IPartition + * @constructor + * @param {google.spanner.v1.IPartition=} [properties] Properties to set + */ + function Partition(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Partition partitionToken. + * @member {Uint8Array} partitionToken + * @memberof google.spanner.v1.Partition + * @instance + */ + Partition.prototype.partitionToken = $util.newBuffer([]); + + /** + * Creates a new Partition instance using the specified properties. + * @function create + * @memberof google.spanner.v1.Partition + * @static + * @param {google.spanner.v1.IPartition=} [properties] Properties to set + * @returns {google.spanner.v1.Partition} Partition instance + */ + Partition.create = function create(properties) { + return new Partition(properties); + }; + + /** + * Encodes the specified Partition message. Does not implicitly {@link google.spanner.v1.Partition.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.Partition + * @static + * @param {google.spanner.v1.IPartition} message Partition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Partition.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.partitionToken != null && Object.hasOwnProperty.call(message, "partitionToken")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.partitionToken); + return writer; + }; + + /** + * Encodes the specified Partition message, length delimited. Does not implicitly {@link google.spanner.v1.Partition.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.Partition + * @static + * @param {google.spanner.v1.IPartition} message Partition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Partition.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Partition message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.Partition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.Partition} Partition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Partition.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.Partition(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.partitionToken = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Partition message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.Partition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.Partition} Partition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Partition.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Partition message. + * @function verify + * @memberof google.spanner.v1.Partition + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Partition.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.partitionToken != null && message.hasOwnProperty("partitionToken")) + if (!(message.partitionToken && typeof message.partitionToken.length === "number" || $util.isString(message.partitionToken))) + return "partitionToken: buffer expected"; + return null; + }; + + /** + * Creates a Partition message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.Partition + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.Partition} Partition + */ + Partition.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.Partition) + return object; + var message = new $root.google.spanner.v1.Partition(); + if (object.partitionToken != null) + if (typeof object.partitionToken === "string") + $util.base64.decode(object.partitionToken, message.partitionToken = $util.newBuffer($util.base64.length(object.partitionToken)), 0); + else if (object.partitionToken.length >= 0) + message.partitionToken = object.partitionToken; + return message; + }; + + /** + * Creates a plain object from a Partition message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.Partition + * @static + * @param {google.spanner.v1.Partition} message Partition + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Partition.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if (options.bytes === String) + object.partitionToken = ""; + else { + object.partitionToken = []; + if (options.bytes !== Array) + object.partitionToken = $util.newBuffer(object.partitionToken); + } + if (message.partitionToken != null && message.hasOwnProperty("partitionToken")) + object.partitionToken = options.bytes === String ? $util.base64.encode(message.partitionToken, 0, message.partitionToken.length) : options.bytes === Array ? Array.prototype.slice.call(message.partitionToken) : message.partitionToken; + return object; + }; + + /** + * Converts this Partition to JSON. + * @function toJSON + * @memberof google.spanner.v1.Partition + * @instance + * @returns {Object.} JSON object + */ + Partition.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Partition + * @function getTypeUrl + * @memberof google.spanner.v1.Partition + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Partition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.Partition"; + }; + + return Partition; + })(); + + v1.PartitionResponse = (function() { + + /** + * Properties of a PartitionResponse. + * @memberof google.spanner.v1 + * @interface IPartitionResponse + * @property {Array.|null} [partitions] PartitionResponse partitions + * @property {google.spanner.v1.ITransaction|null} [transaction] PartitionResponse transaction + */ + + /** + * Constructs a new PartitionResponse. + * @memberof google.spanner.v1 + * @classdesc Represents a PartitionResponse. + * @implements IPartitionResponse + * @constructor + * @param {google.spanner.v1.IPartitionResponse=} [properties] Properties to set + */ + function PartitionResponse(properties) { + this.partitions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PartitionResponse partitions. + * @member {Array.} partitions + * @memberof google.spanner.v1.PartitionResponse + * @instance + */ + PartitionResponse.prototype.partitions = $util.emptyArray; + + /** + * PartitionResponse transaction. + * @member {google.spanner.v1.ITransaction|null|undefined} transaction + * @memberof google.spanner.v1.PartitionResponse + * @instance + */ + PartitionResponse.prototype.transaction = null; + + /** + * Creates a new PartitionResponse instance using the specified properties. + * @function create + * @memberof google.spanner.v1.PartitionResponse + * @static + * @param {google.spanner.v1.IPartitionResponse=} [properties] Properties to set + * @returns {google.spanner.v1.PartitionResponse} PartitionResponse instance + */ + PartitionResponse.create = function create(properties) { + return new PartitionResponse(properties); + }; + + /** + * Encodes the specified PartitionResponse message. Does not implicitly {@link google.spanner.v1.PartitionResponse.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.PartitionResponse + * @static + * @param {google.spanner.v1.IPartitionResponse} message PartitionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartitionResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.partitions != null && message.partitions.length) + for (var i = 0; i < message.partitions.length; ++i) + $root.google.spanner.v1.Partition.encode(message.partitions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.transaction != null && Object.hasOwnProperty.call(message, "transaction")) + $root.google.spanner.v1.Transaction.encode(message.transaction, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PartitionResponse message, length delimited. Does not implicitly {@link google.spanner.v1.PartitionResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.PartitionResponse + * @static + * @param {google.spanner.v1.IPartitionResponse} message PartitionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartitionResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PartitionResponse message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.PartitionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.PartitionResponse} PartitionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartitionResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.PartitionResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.partitions && message.partitions.length)) + message.partitions = []; + message.partitions.push($root.google.spanner.v1.Partition.decode(reader, reader.uint32())); + break; + } + case 2: { + message.transaction = $root.google.spanner.v1.Transaction.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PartitionResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.PartitionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.PartitionResponse} PartitionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartitionResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PartitionResponse message. + * @function verify + * @memberof google.spanner.v1.PartitionResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PartitionResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.partitions != null && message.hasOwnProperty("partitions")) { + if (!Array.isArray(message.partitions)) + return "partitions: array expected"; + for (var i = 0; i < message.partitions.length; ++i) { + var error = $root.google.spanner.v1.Partition.verify(message.partitions[i]); + if (error) + return "partitions." + error; + } + } + if (message.transaction != null && message.hasOwnProperty("transaction")) { + var error = $root.google.spanner.v1.Transaction.verify(message.transaction); + if (error) + return "transaction." + error; + } + return null; + }; + + /** + * Creates a PartitionResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.PartitionResponse + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.PartitionResponse} PartitionResponse + */ + PartitionResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.PartitionResponse) + return object; + var message = new $root.google.spanner.v1.PartitionResponse(); + if (object.partitions) { + if (!Array.isArray(object.partitions)) + throw TypeError(".google.spanner.v1.PartitionResponse.partitions: array expected"); + message.partitions = []; + for (var i = 0; i < object.partitions.length; ++i) { + if (typeof object.partitions[i] !== "object") + throw TypeError(".google.spanner.v1.PartitionResponse.partitions: object expected"); + message.partitions[i] = $root.google.spanner.v1.Partition.fromObject(object.partitions[i]); + } + } + if (object.transaction != null) { + if (typeof object.transaction !== "object") + throw TypeError(".google.spanner.v1.PartitionResponse.transaction: object expected"); + message.transaction = $root.google.spanner.v1.Transaction.fromObject(object.transaction); + } + return message; + }; + + /** + * Creates a plain object from a PartitionResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.PartitionResponse + * @static + * @param {google.spanner.v1.PartitionResponse} message PartitionResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PartitionResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.partitions = []; + if (options.defaults) + object.transaction = null; + if (message.partitions && message.partitions.length) { + object.partitions = []; + for (var j = 0; j < message.partitions.length; ++j) + object.partitions[j] = $root.google.spanner.v1.Partition.toObject(message.partitions[j], options); + } + if (message.transaction != null && message.hasOwnProperty("transaction")) + object.transaction = $root.google.spanner.v1.Transaction.toObject(message.transaction, options); + return object; + }; + + /** + * Converts this PartitionResponse to JSON. + * @function toJSON + * @memberof google.spanner.v1.PartitionResponse + * @instance + * @returns {Object.} JSON object + */ + PartitionResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PartitionResponse + * @function getTypeUrl + * @memberof google.spanner.v1.PartitionResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PartitionResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.PartitionResponse"; + }; + + return PartitionResponse; + })(); + + v1.ReadRequest = (function() { + + /** + * Properties of a ReadRequest. + * @memberof google.spanner.v1 + * @interface IReadRequest + * @property {string|null} [session] ReadRequest session + * @property {google.spanner.v1.ITransactionSelector|null} [transaction] ReadRequest transaction + * @property {string|null} [table] ReadRequest table + * @property {string|null} [index] ReadRequest index + * @property {Array.|null} [columns] ReadRequest columns + * @property {google.spanner.v1.IKeySet|null} [keySet] ReadRequest keySet + * @property {number|Long|null} [limit] ReadRequest limit + * @property {Uint8Array|null} [resumeToken] ReadRequest resumeToken + * @property {Uint8Array|null} [partitionToken] ReadRequest partitionToken + * @property {google.spanner.v1.IRequestOptions|null} [requestOptions] ReadRequest requestOptions + * @property {google.spanner.v1.IDirectedReadOptions|null} [directedReadOptions] ReadRequest directedReadOptions + * @property {boolean|null} [dataBoostEnabled] ReadRequest dataBoostEnabled + * @property {google.spanner.v1.ReadRequest.OrderBy|null} [orderBy] ReadRequest orderBy + * @property {google.spanner.v1.ReadRequest.LockHint|null} [lockHint] ReadRequest lockHint + * @property {google.spanner.v1.IRoutingHint|null} [routingHint] ReadRequest routingHint + */ + + /** + * Constructs a new ReadRequest. + * @memberof google.spanner.v1 + * @classdesc Represents a ReadRequest. + * @implements IReadRequest + * @constructor + * @param {google.spanner.v1.IReadRequest=} [properties] Properties to set + */ + function ReadRequest(properties) { + this.columns = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReadRequest session. + * @member {string} session + * @memberof google.spanner.v1.ReadRequest + * @instance + */ + ReadRequest.prototype.session = ""; + + /** + * ReadRequest transaction. + * @member {google.spanner.v1.ITransactionSelector|null|undefined} transaction + * @memberof google.spanner.v1.ReadRequest + * @instance + */ + ReadRequest.prototype.transaction = null; + + /** + * ReadRequest table. + * @member {string} table + * @memberof google.spanner.v1.ReadRequest + * @instance + */ + ReadRequest.prototype.table = ""; + + /** + * ReadRequest index. + * @member {string} index + * @memberof google.spanner.v1.ReadRequest + * @instance + */ + ReadRequest.prototype.index = ""; + + /** + * ReadRequest columns. + * @member {Array.} columns + * @memberof google.spanner.v1.ReadRequest + * @instance + */ + ReadRequest.prototype.columns = $util.emptyArray; + + /** + * ReadRequest keySet. + * @member {google.spanner.v1.IKeySet|null|undefined} keySet + * @memberof google.spanner.v1.ReadRequest + * @instance + */ + ReadRequest.prototype.keySet = null; + + /** + * ReadRequest limit. + * @member {number|Long} limit + * @memberof google.spanner.v1.ReadRequest + * @instance + */ + ReadRequest.prototype.limit = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ReadRequest resumeToken. + * @member {Uint8Array} resumeToken + * @memberof google.spanner.v1.ReadRequest + * @instance + */ + ReadRequest.prototype.resumeToken = $util.newBuffer([]); + + /** + * ReadRequest partitionToken. + * @member {Uint8Array} partitionToken + * @memberof google.spanner.v1.ReadRequest + * @instance + */ + ReadRequest.prototype.partitionToken = $util.newBuffer([]); + + /** + * ReadRequest requestOptions. + * @member {google.spanner.v1.IRequestOptions|null|undefined} requestOptions + * @memberof google.spanner.v1.ReadRequest + * @instance + */ + ReadRequest.prototype.requestOptions = null; + + /** + * ReadRequest directedReadOptions. + * @member {google.spanner.v1.IDirectedReadOptions|null|undefined} directedReadOptions + * @memberof google.spanner.v1.ReadRequest + * @instance + */ + ReadRequest.prototype.directedReadOptions = null; + + /** + * ReadRequest dataBoostEnabled. + * @member {boolean} dataBoostEnabled + * @memberof google.spanner.v1.ReadRequest + * @instance + */ + ReadRequest.prototype.dataBoostEnabled = false; + + /** + * ReadRequest orderBy. + * @member {google.spanner.v1.ReadRequest.OrderBy} orderBy + * @memberof google.spanner.v1.ReadRequest + * @instance + */ + ReadRequest.prototype.orderBy = 0; + + /** + * ReadRequest lockHint. + * @member {google.spanner.v1.ReadRequest.LockHint} lockHint + * @memberof google.spanner.v1.ReadRequest + * @instance + */ + ReadRequest.prototype.lockHint = 0; + + /** + * ReadRequest routingHint. + * @member {google.spanner.v1.IRoutingHint|null|undefined} routingHint + * @memberof google.spanner.v1.ReadRequest + * @instance + */ + ReadRequest.prototype.routingHint = null; + + /** + * Creates a new ReadRequest instance using the specified properties. + * @function create + * @memberof google.spanner.v1.ReadRequest + * @static + * @param {google.spanner.v1.IReadRequest=} [properties] Properties to set + * @returns {google.spanner.v1.ReadRequest} ReadRequest instance + */ + ReadRequest.create = function create(properties) { + return new ReadRequest(properties); + }; + + /** + * Encodes the specified ReadRequest message. Does not implicitly {@link google.spanner.v1.ReadRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.ReadRequest + * @static + * @param {google.spanner.v1.IReadRequest} message ReadRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.session != null && Object.hasOwnProperty.call(message, "session")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.session); + if (message.transaction != null && Object.hasOwnProperty.call(message, "transaction")) + $root.google.spanner.v1.TransactionSelector.encode(message.transaction, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.table != null && Object.hasOwnProperty.call(message, "table")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.table); + if (message.index != null && Object.hasOwnProperty.call(message, "index")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.index); + if (message.columns != null && message.columns.length) + for (var i = 0; i < message.columns.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.columns[i]); + if (message.keySet != null && Object.hasOwnProperty.call(message, "keySet")) + $root.google.spanner.v1.KeySet.encode(message.keySet, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) + writer.uint32(/* id 8, wireType 0 =*/64).int64(message.limit); + if (message.resumeToken != null && Object.hasOwnProperty.call(message, "resumeToken")) + writer.uint32(/* id 9, wireType 2 =*/74).bytes(message.resumeToken); + if (message.partitionToken != null && Object.hasOwnProperty.call(message, "partitionToken")) + writer.uint32(/* id 10, wireType 2 =*/82).bytes(message.partitionToken); + if (message.requestOptions != null && Object.hasOwnProperty.call(message, "requestOptions")) + $root.google.spanner.v1.RequestOptions.encode(message.requestOptions, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.directedReadOptions != null && Object.hasOwnProperty.call(message, "directedReadOptions")) + $root.google.spanner.v1.DirectedReadOptions.encode(message.directedReadOptions, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.dataBoostEnabled != null && Object.hasOwnProperty.call(message, "dataBoostEnabled")) + writer.uint32(/* id 15, wireType 0 =*/120).bool(message.dataBoostEnabled); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 16, wireType 0 =*/128).int32(message.orderBy); + if (message.lockHint != null && Object.hasOwnProperty.call(message, "lockHint")) + writer.uint32(/* id 17, wireType 0 =*/136).int32(message.lockHint); + if (message.routingHint != null && Object.hasOwnProperty.call(message, "routingHint")) + $root.google.spanner.v1.RoutingHint.encode(message.routingHint, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ReadRequest message, length delimited. Does not implicitly {@link google.spanner.v1.ReadRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.ReadRequest + * @static + * @param {google.spanner.v1.IReadRequest} message ReadRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReadRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.ReadRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.ReadRequest} ReadRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.ReadRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.session = reader.string(); + break; + } + case 2: { + message.transaction = $root.google.spanner.v1.TransactionSelector.decode(reader, reader.uint32()); + break; + } + case 3: { + message.table = reader.string(); + break; + } + case 4: { + message.index = reader.string(); + break; + } + case 5: { + if (!(message.columns && message.columns.length)) + message.columns = []; + message.columns.push(reader.string()); + break; + } + case 6: { + message.keySet = $root.google.spanner.v1.KeySet.decode(reader, reader.uint32()); + break; + } + case 8: { + message.limit = reader.int64(); + break; + } + case 9: { + message.resumeToken = reader.bytes(); + break; + } + case 10: { + message.partitionToken = reader.bytes(); + break; + } + case 11: { + message.requestOptions = $root.google.spanner.v1.RequestOptions.decode(reader, reader.uint32()); + break; + } + case 14: { + message.directedReadOptions = $root.google.spanner.v1.DirectedReadOptions.decode(reader, reader.uint32()); + break; + } + case 15: { + message.dataBoostEnabled = reader.bool(); + break; + } + case 16: { + message.orderBy = reader.int32(); + break; + } + case 17: { + message.lockHint = reader.int32(); + break; + } + case 18: { + message.routingHint = $root.google.spanner.v1.RoutingHint.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReadRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.ReadRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.ReadRequest} ReadRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReadRequest message. + * @function verify + * @memberof google.spanner.v1.ReadRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReadRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.session != null && message.hasOwnProperty("session")) + if (!$util.isString(message.session)) + return "session: string expected"; + if (message.transaction != null && message.hasOwnProperty("transaction")) { + var error = $root.google.spanner.v1.TransactionSelector.verify(message.transaction); + if (error) + return "transaction." + error; + } + if (message.table != null && message.hasOwnProperty("table")) + if (!$util.isString(message.table)) + return "table: string expected"; + if (message.index != null && message.hasOwnProperty("index")) + if (!$util.isString(message.index)) + return "index: string expected"; + if (message.columns != null && message.hasOwnProperty("columns")) { + if (!Array.isArray(message.columns)) + return "columns: array expected"; + for (var i = 0; i < message.columns.length; ++i) + if (!$util.isString(message.columns[i])) + return "columns: string[] expected"; + } + if (message.keySet != null && message.hasOwnProperty("keySet")) { + var error = $root.google.spanner.v1.KeySet.verify(message.keySet); + if (error) + return "keySet." + error; + } + if (message.limit != null && message.hasOwnProperty("limit")) + if (!$util.isInteger(message.limit) && !(message.limit && $util.isInteger(message.limit.low) && $util.isInteger(message.limit.high))) + return "limit: integer|Long expected"; + if (message.resumeToken != null && message.hasOwnProperty("resumeToken")) + if (!(message.resumeToken && typeof message.resumeToken.length === "number" || $util.isString(message.resumeToken))) + return "resumeToken: buffer expected"; + if (message.partitionToken != null && message.hasOwnProperty("partitionToken")) + if (!(message.partitionToken && typeof message.partitionToken.length === "number" || $util.isString(message.partitionToken))) + return "partitionToken: buffer expected"; + if (message.requestOptions != null && message.hasOwnProperty("requestOptions")) { + var error = $root.google.spanner.v1.RequestOptions.verify(message.requestOptions); + if (error) + return "requestOptions." + error; + } + if (message.directedReadOptions != null && message.hasOwnProperty("directedReadOptions")) { + var error = $root.google.spanner.v1.DirectedReadOptions.verify(message.directedReadOptions); + if (error) + return "directedReadOptions." + error; + } + if (message.dataBoostEnabled != null && message.hasOwnProperty("dataBoostEnabled")) + if (typeof message.dataBoostEnabled !== "boolean") + return "dataBoostEnabled: boolean expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + switch (message.orderBy) { + default: + return "orderBy: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.lockHint != null && message.hasOwnProperty("lockHint")) + switch (message.lockHint) { + default: + return "lockHint: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.routingHint != null && message.hasOwnProperty("routingHint")) { + var error = $root.google.spanner.v1.RoutingHint.verify(message.routingHint); + if (error) + return "routingHint." + error; + } + return null; + }; + + /** + * Creates a ReadRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.ReadRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.ReadRequest} ReadRequest + */ + ReadRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.ReadRequest) + return object; + var message = new $root.google.spanner.v1.ReadRequest(); + if (object.session != null) + message.session = String(object.session); + if (object.transaction != null) { + if (typeof object.transaction !== "object") + throw TypeError(".google.spanner.v1.ReadRequest.transaction: object expected"); + message.transaction = $root.google.spanner.v1.TransactionSelector.fromObject(object.transaction); + } + if (object.table != null) + message.table = String(object.table); + if (object.index != null) + message.index = String(object.index); + if (object.columns) { + if (!Array.isArray(object.columns)) + throw TypeError(".google.spanner.v1.ReadRequest.columns: array expected"); + message.columns = []; + for (var i = 0; i < object.columns.length; ++i) + message.columns[i] = String(object.columns[i]); + } + if (object.keySet != null) { + if (typeof object.keySet !== "object") + throw TypeError(".google.spanner.v1.ReadRequest.keySet: object expected"); + message.keySet = $root.google.spanner.v1.KeySet.fromObject(object.keySet); + } + if (object.limit != null) + if ($util.Long) + (message.limit = $util.Long.fromValue(object.limit)).unsigned = false; + else if (typeof object.limit === "string") + message.limit = parseInt(object.limit, 10); + else if (typeof object.limit === "number") + message.limit = object.limit; + else if (typeof object.limit === "object") + message.limit = new $util.LongBits(object.limit.low >>> 0, object.limit.high >>> 0).toNumber(); + if (object.resumeToken != null) + if (typeof object.resumeToken === "string") + $util.base64.decode(object.resumeToken, message.resumeToken = $util.newBuffer($util.base64.length(object.resumeToken)), 0); + else if (object.resumeToken.length >= 0) + message.resumeToken = object.resumeToken; + if (object.partitionToken != null) + if (typeof object.partitionToken === "string") + $util.base64.decode(object.partitionToken, message.partitionToken = $util.newBuffer($util.base64.length(object.partitionToken)), 0); + else if (object.partitionToken.length >= 0) + message.partitionToken = object.partitionToken; + if (object.requestOptions != null) { + if (typeof object.requestOptions !== "object") + throw TypeError(".google.spanner.v1.ReadRequest.requestOptions: object expected"); + message.requestOptions = $root.google.spanner.v1.RequestOptions.fromObject(object.requestOptions); + } + if (object.directedReadOptions != null) { + if (typeof object.directedReadOptions !== "object") + throw TypeError(".google.spanner.v1.ReadRequest.directedReadOptions: object expected"); + message.directedReadOptions = $root.google.spanner.v1.DirectedReadOptions.fromObject(object.directedReadOptions); + } + if (object.dataBoostEnabled != null) + message.dataBoostEnabled = Boolean(object.dataBoostEnabled); + switch (object.orderBy) { + default: + if (typeof object.orderBy === "number") { + message.orderBy = object.orderBy; + break; + } + break; + case "ORDER_BY_UNSPECIFIED": + case 0: + message.orderBy = 0; + break; + case "ORDER_BY_PRIMARY_KEY": + case 1: + message.orderBy = 1; + break; + case "ORDER_BY_NO_ORDER": + case 2: + message.orderBy = 2; + break; + } + switch (object.lockHint) { + default: + if (typeof object.lockHint === "number") { + message.lockHint = object.lockHint; + break; + } + break; + case "LOCK_HINT_UNSPECIFIED": + case 0: + message.lockHint = 0; + break; + case "LOCK_HINT_SHARED": + case 1: + message.lockHint = 1; + break; + case "LOCK_HINT_EXCLUSIVE": + case 2: + message.lockHint = 2; + break; + } + if (object.routingHint != null) { + if (typeof object.routingHint !== "object") + throw TypeError(".google.spanner.v1.ReadRequest.routingHint: object expected"); + message.routingHint = $root.google.spanner.v1.RoutingHint.fromObject(object.routingHint); + } + return message; + }; + + /** + * Creates a plain object from a ReadRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.ReadRequest + * @static + * @param {google.spanner.v1.ReadRequest} message ReadRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReadRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.columns = []; + if (options.defaults) { + object.session = ""; + object.transaction = null; + object.table = ""; + object.index = ""; + object.keySet = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.limit = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.limit = options.longs === String ? "0" : 0; + if (options.bytes === String) + object.resumeToken = ""; + else { + object.resumeToken = []; + if (options.bytes !== Array) + object.resumeToken = $util.newBuffer(object.resumeToken); + } + if (options.bytes === String) + object.partitionToken = ""; + else { + object.partitionToken = []; + if (options.bytes !== Array) + object.partitionToken = $util.newBuffer(object.partitionToken); + } + object.requestOptions = null; + object.directedReadOptions = null; + object.dataBoostEnabled = false; + object.orderBy = options.enums === String ? "ORDER_BY_UNSPECIFIED" : 0; + object.lockHint = options.enums === String ? "LOCK_HINT_UNSPECIFIED" : 0; + object.routingHint = null; + } + if (message.session != null && message.hasOwnProperty("session")) + object.session = message.session; + if (message.transaction != null && message.hasOwnProperty("transaction")) + object.transaction = $root.google.spanner.v1.TransactionSelector.toObject(message.transaction, options); + if (message.table != null && message.hasOwnProperty("table")) + object.table = message.table; + if (message.index != null && message.hasOwnProperty("index")) + object.index = message.index; + if (message.columns && message.columns.length) { + object.columns = []; + for (var j = 0; j < message.columns.length; ++j) + object.columns[j] = message.columns[j]; + } + if (message.keySet != null && message.hasOwnProperty("keySet")) + object.keySet = $root.google.spanner.v1.KeySet.toObject(message.keySet, options); + if (message.limit != null && message.hasOwnProperty("limit")) + if (typeof message.limit === "number") + object.limit = options.longs === String ? String(message.limit) : message.limit; + else + object.limit = options.longs === String ? $util.Long.prototype.toString.call(message.limit) : options.longs === Number ? new $util.LongBits(message.limit.low >>> 0, message.limit.high >>> 0).toNumber() : message.limit; + if (message.resumeToken != null && message.hasOwnProperty("resumeToken")) + object.resumeToken = options.bytes === String ? $util.base64.encode(message.resumeToken, 0, message.resumeToken.length) : options.bytes === Array ? Array.prototype.slice.call(message.resumeToken) : message.resumeToken; + if (message.partitionToken != null && message.hasOwnProperty("partitionToken")) + object.partitionToken = options.bytes === String ? $util.base64.encode(message.partitionToken, 0, message.partitionToken.length) : options.bytes === Array ? Array.prototype.slice.call(message.partitionToken) : message.partitionToken; + if (message.requestOptions != null && message.hasOwnProperty("requestOptions")) + object.requestOptions = $root.google.spanner.v1.RequestOptions.toObject(message.requestOptions, options); + if (message.directedReadOptions != null && message.hasOwnProperty("directedReadOptions")) + object.directedReadOptions = $root.google.spanner.v1.DirectedReadOptions.toObject(message.directedReadOptions, options); + if (message.dataBoostEnabled != null && message.hasOwnProperty("dataBoostEnabled")) + object.dataBoostEnabled = message.dataBoostEnabled; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = options.enums === String ? $root.google.spanner.v1.ReadRequest.OrderBy[message.orderBy] === undefined ? message.orderBy : $root.google.spanner.v1.ReadRequest.OrderBy[message.orderBy] : message.orderBy; + if (message.lockHint != null && message.hasOwnProperty("lockHint")) + object.lockHint = options.enums === String ? $root.google.spanner.v1.ReadRequest.LockHint[message.lockHint] === undefined ? message.lockHint : $root.google.spanner.v1.ReadRequest.LockHint[message.lockHint] : message.lockHint; + if (message.routingHint != null && message.hasOwnProperty("routingHint")) + object.routingHint = $root.google.spanner.v1.RoutingHint.toObject(message.routingHint, options); + return object; + }; + + /** + * Converts this ReadRequest to JSON. + * @function toJSON + * @memberof google.spanner.v1.ReadRequest + * @instance + * @returns {Object.} JSON object + */ + ReadRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReadRequest + * @function getTypeUrl + * @memberof google.spanner.v1.ReadRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReadRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.ReadRequest"; + }; + + /** + * OrderBy enum. + * @name google.spanner.v1.ReadRequest.OrderBy + * @enum {number} + * @property {number} ORDER_BY_UNSPECIFIED=0 ORDER_BY_UNSPECIFIED value + * @property {number} ORDER_BY_PRIMARY_KEY=1 ORDER_BY_PRIMARY_KEY value + * @property {number} ORDER_BY_NO_ORDER=2 ORDER_BY_NO_ORDER value + */ + ReadRequest.OrderBy = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ORDER_BY_UNSPECIFIED"] = 0; + values[valuesById[1] = "ORDER_BY_PRIMARY_KEY"] = 1; + values[valuesById[2] = "ORDER_BY_NO_ORDER"] = 2; + return values; + })(); + + /** + * LockHint enum. + * @name google.spanner.v1.ReadRequest.LockHint + * @enum {number} + * @property {number} LOCK_HINT_UNSPECIFIED=0 LOCK_HINT_UNSPECIFIED value + * @property {number} LOCK_HINT_SHARED=1 LOCK_HINT_SHARED value + * @property {number} LOCK_HINT_EXCLUSIVE=2 LOCK_HINT_EXCLUSIVE value + */ + ReadRequest.LockHint = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LOCK_HINT_UNSPECIFIED"] = 0; + values[valuesById[1] = "LOCK_HINT_SHARED"] = 1; + values[valuesById[2] = "LOCK_HINT_EXCLUSIVE"] = 2; + return values; + })(); + + return ReadRequest; + })(); + + v1.BeginTransactionRequest = (function() { + + /** + * Properties of a BeginTransactionRequest. + * @memberof google.spanner.v1 + * @interface IBeginTransactionRequest + * @property {string|null} [session] BeginTransactionRequest session + * @property {google.spanner.v1.ITransactionOptions|null} [options] BeginTransactionRequest options + * @property {google.spanner.v1.IRequestOptions|null} [requestOptions] BeginTransactionRequest requestOptions + * @property {google.spanner.v1.IMutation|null} [mutationKey] BeginTransactionRequest mutationKey + */ + + /** + * Constructs a new BeginTransactionRequest. + * @memberof google.spanner.v1 + * @classdesc Represents a BeginTransactionRequest. + * @implements IBeginTransactionRequest + * @constructor + * @param {google.spanner.v1.IBeginTransactionRequest=} [properties] Properties to set + */ + function BeginTransactionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BeginTransactionRequest session. + * @member {string} session + * @memberof google.spanner.v1.BeginTransactionRequest + * @instance + */ + BeginTransactionRequest.prototype.session = ""; + + /** + * BeginTransactionRequest options. + * @member {google.spanner.v1.ITransactionOptions|null|undefined} options + * @memberof google.spanner.v1.BeginTransactionRequest + * @instance + */ + BeginTransactionRequest.prototype.options = null; + + /** + * BeginTransactionRequest requestOptions. + * @member {google.spanner.v1.IRequestOptions|null|undefined} requestOptions + * @memberof google.spanner.v1.BeginTransactionRequest + * @instance + */ + BeginTransactionRequest.prototype.requestOptions = null; + + /** + * BeginTransactionRequest mutationKey. + * @member {google.spanner.v1.IMutation|null|undefined} mutationKey + * @memberof google.spanner.v1.BeginTransactionRequest + * @instance + */ + BeginTransactionRequest.prototype.mutationKey = null; + + /** + * Creates a new BeginTransactionRequest instance using the specified properties. + * @function create + * @memberof google.spanner.v1.BeginTransactionRequest + * @static + * @param {google.spanner.v1.IBeginTransactionRequest=} [properties] Properties to set + * @returns {google.spanner.v1.BeginTransactionRequest} BeginTransactionRequest instance + */ + BeginTransactionRequest.create = function create(properties) { + return new BeginTransactionRequest(properties); + }; + + /** + * Encodes the specified BeginTransactionRequest message. Does not implicitly {@link google.spanner.v1.BeginTransactionRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.BeginTransactionRequest + * @static + * @param {google.spanner.v1.IBeginTransactionRequest} message BeginTransactionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BeginTransactionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.session != null && Object.hasOwnProperty.call(message, "session")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.session); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.spanner.v1.TransactionOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestOptions != null && Object.hasOwnProperty.call(message, "requestOptions")) + $root.google.spanner.v1.RequestOptions.encode(message.requestOptions, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.mutationKey != null && Object.hasOwnProperty.call(message, "mutationKey")) + $root.google.spanner.v1.Mutation.encode(message.mutationKey, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BeginTransactionRequest message, length delimited. Does not implicitly {@link google.spanner.v1.BeginTransactionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.BeginTransactionRequest + * @static + * @param {google.spanner.v1.IBeginTransactionRequest} message BeginTransactionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BeginTransactionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BeginTransactionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.BeginTransactionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.BeginTransactionRequest} BeginTransactionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BeginTransactionRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.BeginTransactionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.session = reader.string(); + break; + } + case 2: { + message.options = $root.google.spanner.v1.TransactionOptions.decode(reader, reader.uint32()); + break; + } + case 3: { + message.requestOptions = $root.google.spanner.v1.RequestOptions.decode(reader, reader.uint32()); + break; + } + case 4: { + message.mutationKey = $root.google.spanner.v1.Mutation.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BeginTransactionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.BeginTransactionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.BeginTransactionRequest} BeginTransactionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BeginTransactionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BeginTransactionRequest message. + * @function verify + * @memberof google.spanner.v1.BeginTransactionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BeginTransactionRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.session != null && message.hasOwnProperty("session")) + if (!$util.isString(message.session)) + return "session: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.spanner.v1.TransactionOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.requestOptions != null && message.hasOwnProperty("requestOptions")) { + var error = $root.google.spanner.v1.RequestOptions.verify(message.requestOptions); + if (error) + return "requestOptions." + error; + } + if (message.mutationKey != null && message.hasOwnProperty("mutationKey")) { + var error = $root.google.spanner.v1.Mutation.verify(message.mutationKey); + if (error) + return "mutationKey." + error; + } + return null; + }; + + /** + * Creates a BeginTransactionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.BeginTransactionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.BeginTransactionRequest} BeginTransactionRequest + */ + BeginTransactionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.BeginTransactionRequest) + return object; + var message = new $root.google.spanner.v1.BeginTransactionRequest(); + if (object.session != null) + message.session = String(object.session); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.spanner.v1.BeginTransactionRequest.options: object expected"); + message.options = $root.google.spanner.v1.TransactionOptions.fromObject(object.options); + } + if (object.requestOptions != null) { + if (typeof object.requestOptions !== "object") + throw TypeError(".google.spanner.v1.BeginTransactionRequest.requestOptions: object expected"); + message.requestOptions = $root.google.spanner.v1.RequestOptions.fromObject(object.requestOptions); + } + if (object.mutationKey != null) { + if (typeof object.mutationKey !== "object") + throw TypeError(".google.spanner.v1.BeginTransactionRequest.mutationKey: object expected"); + message.mutationKey = $root.google.spanner.v1.Mutation.fromObject(object.mutationKey); + } + return message; + }; + + /** + * Creates a plain object from a BeginTransactionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.BeginTransactionRequest + * @static + * @param {google.spanner.v1.BeginTransactionRequest} message BeginTransactionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BeginTransactionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.session = ""; + object.options = null; + object.requestOptions = null; + object.mutationKey = null; + } + if (message.session != null && message.hasOwnProperty("session")) + object.session = message.session; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.spanner.v1.TransactionOptions.toObject(message.options, options); + if (message.requestOptions != null && message.hasOwnProperty("requestOptions")) + object.requestOptions = $root.google.spanner.v1.RequestOptions.toObject(message.requestOptions, options); + if (message.mutationKey != null && message.hasOwnProperty("mutationKey")) + object.mutationKey = $root.google.spanner.v1.Mutation.toObject(message.mutationKey, options); + return object; + }; + + /** + * Converts this BeginTransactionRequest to JSON. + * @function toJSON + * @memberof google.spanner.v1.BeginTransactionRequest + * @instance + * @returns {Object.} JSON object + */ + BeginTransactionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BeginTransactionRequest + * @function getTypeUrl + * @memberof google.spanner.v1.BeginTransactionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BeginTransactionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.BeginTransactionRequest"; + }; + + return BeginTransactionRequest; + })(); + + v1.CommitRequest = (function() { + + /** + * Properties of a CommitRequest. + * @memberof google.spanner.v1 + * @interface ICommitRequest + * @property {string|null} [session] CommitRequest session + * @property {Uint8Array|null} [transactionId] CommitRequest transactionId + * @property {google.spanner.v1.ITransactionOptions|null} [singleUseTransaction] CommitRequest singleUseTransaction + * @property {Array.|null} [mutations] CommitRequest mutations + * @property {boolean|null} [returnCommitStats] CommitRequest returnCommitStats + * @property {google.protobuf.IDuration|null} [maxCommitDelay] CommitRequest maxCommitDelay + * @property {google.spanner.v1.IRequestOptions|null} [requestOptions] CommitRequest requestOptions + * @property {google.spanner.v1.IMultiplexedSessionPrecommitToken|null} [precommitToken] CommitRequest precommitToken + */ + + /** + * Constructs a new CommitRequest. + * @memberof google.spanner.v1 + * @classdesc Represents a CommitRequest. + * @implements ICommitRequest + * @constructor + * @param {google.spanner.v1.ICommitRequest=} [properties] Properties to set + */ + function CommitRequest(properties) { + this.mutations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CommitRequest session. + * @member {string} session + * @memberof google.spanner.v1.CommitRequest + * @instance + */ + CommitRequest.prototype.session = ""; + + /** + * CommitRequest transactionId. + * @member {Uint8Array|null|undefined} transactionId + * @memberof google.spanner.v1.CommitRequest + * @instance + */ + CommitRequest.prototype.transactionId = null; + + /** + * CommitRequest singleUseTransaction. + * @member {google.spanner.v1.ITransactionOptions|null|undefined} singleUseTransaction + * @memberof google.spanner.v1.CommitRequest + * @instance + */ + CommitRequest.prototype.singleUseTransaction = null; + + /** + * CommitRequest mutations. + * @member {Array.} mutations + * @memberof google.spanner.v1.CommitRequest + * @instance + */ + CommitRequest.prototype.mutations = $util.emptyArray; + + /** + * CommitRequest returnCommitStats. + * @member {boolean} returnCommitStats + * @memberof google.spanner.v1.CommitRequest + * @instance + */ + CommitRequest.prototype.returnCommitStats = false; + + /** + * CommitRequest maxCommitDelay. + * @member {google.protobuf.IDuration|null|undefined} maxCommitDelay + * @memberof google.spanner.v1.CommitRequest + * @instance + */ + CommitRequest.prototype.maxCommitDelay = null; + + /** + * CommitRequest requestOptions. + * @member {google.spanner.v1.IRequestOptions|null|undefined} requestOptions + * @memberof google.spanner.v1.CommitRequest + * @instance + */ + CommitRequest.prototype.requestOptions = null; + + /** + * CommitRequest precommitToken. + * @member {google.spanner.v1.IMultiplexedSessionPrecommitToken|null|undefined} precommitToken + * @memberof google.spanner.v1.CommitRequest + * @instance + */ + CommitRequest.prototype.precommitToken = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * CommitRequest transaction. + * @member {"transactionId"|"singleUseTransaction"|undefined} transaction + * @memberof google.spanner.v1.CommitRequest + * @instance + */ + Object.defineProperty(CommitRequest.prototype, "transaction", { + get: $util.oneOfGetter($oneOfFields = ["transactionId", "singleUseTransaction"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CommitRequest instance using the specified properties. + * @function create + * @memberof google.spanner.v1.CommitRequest + * @static + * @param {google.spanner.v1.ICommitRequest=} [properties] Properties to set + * @returns {google.spanner.v1.CommitRequest} CommitRequest instance + */ + CommitRequest.create = function create(properties) { + return new CommitRequest(properties); + }; + + /** + * Encodes the specified CommitRequest message. Does not implicitly {@link google.spanner.v1.CommitRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.CommitRequest + * @static + * @param {google.spanner.v1.ICommitRequest} message CommitRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommitRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.session != null && Object.hasOwnProperty.call(message, "session")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.session); + if (message.transactionId != null && Object.hasOwnProperty.call(message, "transactionId")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.transactionId); + if (message.singleUseTransaction != null && Object.hasOwnProperty.call(message, "singleUseTransaction")) + $root.google.spanner.v1.TransactionOptions.encode(message.singleUseTransaction, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.mutations != null && message.mutations.length) + for (var i = 0; i < message.mutations.length; ++i) + $root.google.spanner.v1.Mutation.encode(message.mutations[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.returnCommitStats != null && Object.hasOwnProperty.call(message, "returnCommitStats")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.returnCommitStats); + if (message.requestOptions != null && Object.hasOwnProperty.call(message, "requestOptions")) + $root.google.spanner.v1.RequestOptions.encode(message.requestOptions, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.maxCommitDelay != null && Object.hasOwnProperty.call(message, "maxCommitDelay")) + $root.google.protobuf.Duration.encode(message.maxCommitDelay, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.precommitToken != null && Object.hasOwnProperty.call(message, "precommitToken")) + $root.google.spanner.v1.MultiplexedSessionPrecommitToken.encode(message.precommitToken, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CommitRequest message, length delimited. Does not implicitly {@link google.spanner.v1.CommitRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.CommitRequest + * @static + * @param {google.spanner.v1.ICommitRequest} message CommitRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommitRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CommitRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.CommitRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.CommitRequest} CommitRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommitRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.CommitRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.session = reader.string(); + break; + } + case 2: { + message.transactionId = reader.bytes(); + break; + } + case 3: { + message.singleUseTransaction = $root.google.spanner.v1.TransactionOptions.decode(reader, reader.uint32()); + break; + } + case 4: { + if (!(message.mutations && message.mutations.length)) + message.mutations = []; + message.mutations.push($root.google.spanner.v1.Mutation.decode(reader, reader.uint32())); + break; + } + case 5: { + message.returnCommitStats = reader.bool(); + break; + } + case 8: { + message.maxCommitDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 6: { + message.requestOptions = $root.google.spanner.v1.RequestOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + message.precommitToken = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CommitRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.CommitRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.CommitRequest} CommitRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommitRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CommitRequest message. + * @function verify + * @memberof google.spanner.v1.CommitRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CommitRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.session != null && message.hasOwnProperty("session")) + if (!$util.isString(message.session)) + return "session: string expected"; + if (message.transactionId != null && message.hasOwnProperty("transactionId")) { + properties.transaction = 1; + if (!(message.transactionId && typeof message.transactionId.length === "number" || $util.isString(message.transactionId))) + return "transactionId: buffer expected"; + } + if (message.singleUseTransaction != null && message.hasOwnProperty("singleUseTransaction")) { + if (properties.transaction === 1) + return "transaction: multiple values"; + properties.transaction = 1; + { + var error = $root.google.spanner.v1.TransactionOptions.verify(message.singleUseTransaction); + if (error) + return "singleUseTransaction." + error; + } + } + if (message.mutations != null && message.hasOwnProperty("mutations")) { + if (!Array.isArray(message.mutations)) + return "mutations: array expected"; + for (var i = 0; i < message.mutations.length; ++i) { + var error = $root.google.spanner.v1.Mutation.verify(message.mutations[i]); + if (error) + return "mutations." + error; + } + } + if (message.returnCommitStats != null && message.hasOwnProperty("returnCommitStats")) + if (typeof message.returnCommitStats !== "boolean") + return "returnCommitStats: boolean expected"; + if (message.maxCommitDelay != null && message.hasOwnProperty("maxCommitDelay")) { + var error = $root.google.protobuf.Duration.verify(message.maxCommitDelay); + if (error) + return "maxCommitDelay." + error; + } + if (message.requestOptions != null && message.hasOwnProperty("requestOptions")) { + var error = $root.google.spanner.v1.RequestOptions.verify(message.requestOptions); + if (error) + return "requestOptions." + error; + } + if (message.precommitToken != null && message.hasOwnProperty("precommitToken")) { + var error = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.verify(message.precommitToken); + if (error) + return "precommitToken." + error; + } + return null; + }; + + /** + * Creates a CommitRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.CommitRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.CommitRequest} CommitRequest + */ + CommitRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.CommitRequest) + return object; + var message = new $root.google.spanner.v1.CommitRequest(); + if (object.session != null) + message.session = String(object.session); + if (object.transactionId != null) + if (typeof object.transactionId === "string") + $util.base64.decode(object.transactionId, message.transactionId = $util.newBuffer($util.base64.length(object.transactionId)), 0); + else if (object.transactionId.length >= 0) + message.transactionId = object.transactionId; + if (object.singleUseTransaction != null) { + if (typeof object.singleUseTransaction !== "object") + throw TypeError(".google.spanner.v1.CommitRequest.singleUseTransaction: object expected"); + message.singleUseTransaction = $root.google.spanner.v1.TransactionOptions.fromObject(object.singleUseTransaction); + } + if (object.mutations) { + if (!Array.isArray(object.mutations)) + throw TypeError(".google.spanner.v1.CommitRequest.mutations: array expected"); + message.mutations = []; + for (var i = 0; i < object.mutations.length; ++i) { + if (typeof object.mutations[i] !== "object") + throw TypeError(".google.spanner.v1.CommitRequest.mutations: object expected"); + message.mutations[i] = $root.google.spanner.v1.Mutation.fromObject(object.mutations[i]); + } + } + if (object.returnCommitStats != null) + message.returnCommitStats = Boolean(object.returnCommitStats); + if (object.maxCommitDelay != null) { + if (typeof object.maxCommitDelay !== "object") + throw TypeError(".google.spanner.v1.CommitRequest.maxCommitDelay: object expected"); + message.maxCommitDelay = $root.google.protobuf.Duration.fromObject(object.maxCommitDelay); + } + if (object.requestOptions != null) { + if (typeof object.requestOptions !== "object") + throw TypeError(".google.spanner.v1.CommitRequest.requestOptions: object expected"); + message.requestOptions = $root.google.spanner.v1.RequestOptions.fromObject(object.requestOptions); + } + if (object.precommitToken != null) { + if (typeof object.precommitToken !== "object") + throw TypeError(".google.spanner.v1.CommitRequest.precommitToken: object expected"); + message.precommitToken = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.fromObject(object.precommitToken); + } + return message; + }; + + /** + * Creates a plain object from a CommitRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.CommitRequest + * @static + * @param {google.spanner.v1.CommitRequest} message CommitRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CommitRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.mutations = []; + if (options.defaults) { + object.session = ""; + object.returnCommitStats = false; + object.requestOptions = null; + object.maxCommitDelay = null; + object.precommitToken = null; + } + if (message.session != null && message.hasOwnProperty("session")) + object.session = message.session; + if (message.transactionId != null && message.hasOwnProperty("transactionId")) { + object.transactionId = options.bytes === String ? $util.base64.encode(message.transactionId, 0, message.transactionId.length) : options.bytes === Array ? Array.prototype.slice.call(message.transactionId) : message.transactionId; + if (options.oneofs) + object.transaction = "transactionId"; + } + if (message.singleUseTransaction != null && message.hasOwnProperty("singleUseTransaction")) { + object.singleUseTransaction = $root.google.spanner.v1.TransactionOptions.toObject(message.singleUseTransaction, options); + if (options.oneofs) + object.transaction = "singleUseTransaction"; + } + if (message.mutations && message.mutations.length) { + object.mutations = []; + for (var j = 0; j < message.mutations.length; ++j) + object.mutations[j] = $root.google.spanner.v1.Mutation.toObject(message.mutations[j], options); + } + if (message.returnCommitStats != null && message.hasOwnProperty("returnCommitStats")) + object.returnCommitStats = message.returnCommitStats; + if (message.requestOptions != null && message.hasOwnProperty("requestOptions")) + object.requestOptions = $root.google.spanner.v1.RequestOptions.toObject(message.requestOptions, options); + if (message.maxCommitDelay != null && message.hasOwnProperty("maxCommitDelay")) + object.maxCommitDelay = $root.google.protobuf.Duration.toObject(message.maxCommitDelay, options); + if (message.precommitToken != null && message.hasOwnProperty("precommitToken")) + object.precommitToken = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.toObject(message.precommitToken, options); + return object; + }; + + /** + * Converts this CommitRequest to JSON. + * @function toJSON + * @memberof google.spanner.v1.CommitRequest + * @instance + * @returns {Object.} JSON object + */ + CommitRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CommitRequest + * @function getTypeUrl + * @memberof google.spanner.v1.CommitRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CommitRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.CommitRequest"; + }; + + return CommitRequest; + })(); + + v1.RollbackRequest = (function() { + + /** + * Properties of a RollbackRequest. + * @memberof google.spanner.v1 + * @interface IRollbackRequest + * @property {string|null} [session] RollbackRequest session + * @property {Uint8Array|null} [transactionId] RollbackRequest transactionId + */ + + /** + * Constructs a new RollbackRequest. + * @memberof google.spanner.v1 + * @classdesc Represents a RollbackRequest. + * @implements IRollbackRequest + * @constructor + * @param {google.spanner.v1.IRollbackRequest=} [properties] Properties to set + */ + function RollbackRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RollbackRequest session. + * @member {string} session + * @memberof google.spanner.v1.RollbackRequest + * @instance + */ + RollbackRequest.prototype.session = ""; + + /** + * RollbackRequest transactionId. + * @member {Uint8Array} transactionId + * @memberof google.spanner.v1.RollbackRequest + * @instance + */ + RollbackRequest.prototype.transactionId = $util.newBuffer([]); + + /** + * Creates a new RollbackRequest instance using the specified properties. + * @function create + * @memberof google.spanner.v1.RollbackRequest + * @static + * @param {google.spanner.v1.IRollbackRequest=} [properties] Properties to set + * @returns {google.spanner.v1.RollbackRequest} RollbackRequest instance + */ + RollbackRequest.create = function create(properties) { + return new RollbackRequest(properties); + }; + + /** + * Encodes the specified RollbackRequest message. Does not implicitly {@link google.spanner.v1.RollbackRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.RollbackRequest + * @static + * @param {google.spanner.v1.IRollbackRequest} message RollbackRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RollbackRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.session != null && Object.hasOwnProperty.call(message, "session")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.session); + if (message.transactionId != null && Object.hasOwnProperty.call(message, "transactionId")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.transactionId); + return writer; + }; + + /** + * Encodes the specified RollbackRequest message, length delimited. Does not implicitly {@link google.spanner.v1.RollbackRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.RollbackRequest + * @static + * @param {google.spanner.v1.IRollbackRequest} message RollbackRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RollbackRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RollbackRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.RollbackRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.RollbackRequest} RollbackRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RollbackRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.RollbackRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.session = reader.string(); + break; + } + case 2: { + message.transactionId = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RollbackRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.RollbackRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.RollbackRequest} RollbackRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RollbackRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RollbackRequest message. + * @function verify + * @memberof google.spanner.v1.RollbackRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RollbackRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.session != null && message.hasOwnProperty("session")) + if (!$util.isString(message.session)) + return "session: string expected"; + if (message.transactionId != null && message.hasOwnProperty("transactionId")) + if (!(message.transactionId && typeof message.transactionId.length === "number" || $util.isString(message.transactionId))) + return "transactionId: buffer expected"; + return null; + }; + + /** + * Creates a RollbackRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.RollbackRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.RollbackRequest} RollbackRequest + */ + RollbackRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.RollbackRequest) + return object; + var message = new $root.google.spanner.v1.RollbackRequest(); + if (object.session != null) + message.session = String(object.session); + if (object.transactionId != null) + if (typeof object.transactionId === "string") + $util.base64.decode(object.transactionId, message.transactionId = $util.newBuffer($util.base64.length(object.transactionId)), 0); + else if (object.transactionId.length >= 0) + message.transactionId = object.transactionId; + return message; + }; + + /** + * Creates a plain object from a RollbackRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.RollbackRequest + * @static + * @param {google.spanner.v1.RollbackRequest} message RollbackRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RollbackRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.session = ""; + if (options.bytes === String) + object.transactionId = ""; + else { + object.transactionId = []; + if (options.bytes !== Array) + object.transactionId = $util.newBuffer(object.transactionId); + } + } + if (message.session != null && message.hasOwnProperty("session")) + object.session = message.session; + if (message.transactionId != null && message.hasOwnProperty("transactionId")) + object.transactionId = options.bytes === String ? $util.base64.encode(message.transactionId, 0, message.transactionId.length) : options.bytes === Array ? Array.prototype.slice.call(message.transactionId) : message.transactionId; + return object; + }; + + /** + * Converts this RollbackRequest to JSON. + * @function toJSON + * @memberof google.spanner.v1.RollbackRequest + * @instance + * @returns {Object.} JSON object + */ + RollbackRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RollbackRequest + * @function getTypeUrl + * @memberof google.spanner.v1.RollbackRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RollbackRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.RollbackRequest"; + }; + + return RollbackRequest; + })(); + + v1.BatchWriteRequest = (function() { + + /** + * Properties of a BatchWriteRequest. + * @memberof google.spanner.v1 + * @interface IBatchWriteRequest + * @property {string|null} [session] BatchWriteRequest session + * @property {google.spanner.v1.IRequestOptions|null} [requestOptions] BatchWriteRequest requestOptions + * @property {Array.|null} [mutationGroups] BatchWriteRequest mutationGroups + * @property {boolean|null} [excludeTxnFromChangeStreams] BatchWriteRequest excludeTxnFromChangeStreams + */ + + /** + * Constructs a new BatchWriteRequest. + * @memberof google.spanner.v1 + * @classdesc Represents a BatchWriteRequest. + * @implements IBatchWriteRequest + * @constructor + * @param {google.spanner.v1.IBatchWriteRequest=} [properties] Properties to set + */ + function BatchWriteRequest(properties) { + this.mutationGroups = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchWriteRequest session. + * @member {string} session + * @memberof google.spanner.v1.BatchWriteRequest + * @instance + */ + BatchWriteRequest.prototype.session = ""; + + /** + * BatchWriteRequest requestOptions. + * @member {google.spanner.v1.IRequestOptions|null|undefined} requestOptions + * @memberof google.spanner.v1.BatchWriteRequest + * @instance + */ + BatchWriteRequest.prototype.requestOptions = null; + + /** + * BatchWriteRequest mutationGroups. + * @member {Array.} mutationGroups + * @memberof google.spanner.v1.BatchWriteRequest + * @instance + */ + BatchWriteRequest.prototype.mutationGroups = $util.emptyArray; + + /** + * BatchWriteRequest excludeTxnFromChangeStreams. + * @member {boolean} excludeTxnFromChangeStreams + * @memberof google.spanner.v1.BatchWriteRequest + * @instance + */ + BatchWriteRequest.prototype.excludeTxnFromChangeStreams = false; + + /** + * Creates a new BatchWriteRequest instance using the specified properties. + * @function create + * @memberof google.spanner.v1.BatchWriteRequest + * @static + * @param {google.spanner.v1.IBatchWriteRequest=} [properties] Properties to set + * @returns {google.spanner.v1.BatchWriteRequest} BatchWriteRequest instance + */ + BatchWriteRequest.create = function create(properties) { + return new BatchWriteRequest(properties); + }; + + /** + * Encodes the specified BatchWriteRequest message. Does not implicitly {@link google.spanner.v1.BatchWriteRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.BatchWriteRequest + * @static + * @param {google.spanner.v1.IBatchWriteRequest} message BatchWriteRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchWriteRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.session != null && Object.hasOwnProperty.call(message, "session")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.session); + if (message.requestOptions != null && Object.hasOwnProperty.call(message, "requestOptions")) + $root.google.spanner.v1.RequestOptions.encode(message.requestOptions, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.mutationGroups != null && message.mutationGroups.length) + for (var i = 0; i < message.mutationGroups.length; ++i) + $root.google.spanner.v1.BatchWriteRequest.MutationGroup.encode(message.mutationGroups[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.excludeTxnFromChangeStreams != null && Object.hasOwnProperty.call(message, "excludeTxnFromChangeStreams")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.excludeTxnFromChangeStreams); + return writer; + }; + + /** + * Encodes the specified BatchWriteRequest message, length delimited. Does not implicitly {@link google.spanner.v1.BatchWriteRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.BatchWriteRequest + * @static + * @param {google.spanner.v1.IBatchWriteRequest} message BatchWriteRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchWriteRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchWriteRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.BatchWriteRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.BatchWriteRequest} BatchWriteRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchWriteRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.BatchWriteRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.session = reader.string(); + break; + } + case 3: { + message.requestOptions = $root.google.spanner.v1.RequestOptions.decode(reader, reader.uint32()); + break; + } + case 4: { + if (!(message.mutationGroups && message.mutationGroups.length)) + message.mutationGroups = []; + message.mutationGroups.push($root.google.spanner.v1.BatchWriteRequest.MutationGroup.decode(reader, reader.uint32())); + break; + } + case 5: { + message.excludeTxnFromChangeStreams = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchWriteRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.BatchWriteRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.BatchWriteRequest} BatchWriteRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchWriteRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchWriteRequest message. + * @function verify + * @memberof google.spanner.v1.BatchWriteRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchWriteRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.session != null && message.hasOwnProperty("session")) + if (!$util.isString(message.session)) + return "session: string expected"; + if (message.requestOptions != null && message.hasOwnProperty("requestOptions")) { + var error = $root.google.spanner.v1.RequestOptions.verify(message.requestOptions); + if (error) + return "requestOptions." + error; + } + if (message.mutationGroups != null && message.hasOwnProperty("mutationGroups")) { + if (!Array.isArray(message.mutationGroups)) + return "mutationGroups: array expected"; + for (var i = 0; i < message.mutationGroups.length; ++i) { + var error = $root.google.spanner.v1.BatchWriteRequest.MutationGroup.verify(message.mutationGroups[i]); + if (error) + return "mutationGroups." + error; + } + } + if (message.excludeTxnFromChangeStreams != null && message.hasOwnProperty("excludeTxnFromChangeStreams")) + if (typeof message.excludeTxnFromChangeStreams !== "boolean") + return "excludeTxnFromChangeStreams: boolean expected"; + return null; + }; + + /** + * Creates a BatchWriteRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.BatchWriteRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.BatchWriteRequest} BatchWriteRequest + */ + BatchWriteRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.BatchWriteRequest) + return object; + var message = new $root.google.spanner.v1.BatchWriteRequest(); + if (object.session != null) + message.session = String(object.session); + if (object.requestOptions != null) { + if (typeof object.requestOptions !== "object") + throw TypeError(".google.spanner.v1.BatchWriteRequest.requestOptions: object expected"); + message.requestOptions = $root.google.spanner.v1.RequestOptions.fromObject(object.requestOptions); + } + if (object.mutationGroups) { + if (!Array.isArray(object.mutationGroups)) + throw TypeError(".google.spanner.v1.BatchWriteRequest.mutationGroups: array expected"); + message.mutationGroups = []; + for (var i = 0; i < object.mutationGroups.length; ++i) { + if (typeof object.mutationGroups[i] !== "object") + throw TypeError(".google.spanner.v1.BatchWriteRequest.mutationGroups: object expected"); + message.mutationGroups[i] = $root.google.spanner.v1.BatchWriteRequest.MutationGroup.fromObject(object.mutationGroups[i]); + } + } + if (object.excludeTxnFromChangeStreams != null) + message.excludeTxnFromChangeStreams = Boolean(object.excludeTxnFromChangeStreams); + return message; + }; + + /** + * Creates a plain object from a BatchWriteRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.BatchWriteRequest + * @static + * @param {google.spanner.v1.BatchWriteRequest} message BatchWriteRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchWriteRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.mutationGroups = []; + if (options.defaults) { + object.session = ""; + object.requestOptions = null; + object.excludeTxnFromChangeStreams = false; + } + if (message.session != null && message.hasOwnProperty("session")) + object.session = message.session; + if (message.requestOptions != null && message.hasOwnProperty("requestOptions")) + object.requestOptions = $root.google.spanner.v1.RequestOptions.toObject(message.requestOptions, options); + if (message.mutationGroups && message.mutationGroups.length) { + object.mutationGroups = []; + for (var j = 0; j < message.mutationGroups.length; ++j) + object.mutationGroups[j] = $root.google.spanner.v1.BatchWriteRequest.MutationGroup.toObject(message.mutationGroups[j], options); + } + if (message.excludeTxnFromChangeStreams != null && message.hasOwnProperty("excludeTxnFromChangeStreams")) + object.excludeTxnFromChangeStreams = message.excludeTxnFromChangeStreams; + return object; + }; + + /** + * Converts this BatchWriteRequest to JSON. + * @function toJSON + * @memberof google.spanner.v1.BatchWriteRequest + * @instance + * @returns {Object.} JSON object + */ + BatchWriteRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchWriteRequest + * @function getTypeUrl + * @memberof google.spanner.v1.BatchWriteRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchWriteRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.BatchWriteRequest"; + }; + + BatchWriteRequest.MutationGroup = (function() { + + /** + * Properties of a MutationGroup. + * @memberof google.spanner.v1.BatchWriteRequest + * @interface IMutationGroup + * @property {Array.|null} [mutations] MutationGroup mutations + */ + + /** + * Constructs a new MutationGroup. + * @memberof google.spanner.v1.BatchWriteRequest + * @classdesc Represents a MutationGroup. + * @implements IMutationGroup + * @constructor + * @param {google.spanner.v1.BatchWriteRequest.IMutationGroup=} [properties] Properties to set + */ + function MutationGroup(properties) { + this.mutations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MutationGroup mutations. + * @member {Array.} mutations + * @memberof google.spanner.v1.BatchWriteRequest.MutationGroup + * @instance + */ + MutationGroup.prototype.mutations = $util.emptyArray; + + /** + * Creates a new MutationGroup instance using the specified properties. + * @function create + * @memberof google.spanner.v1.BatchWriteRequest.MutationGroup + * @static + * @param {google.spanner.v1.BatchWriteRequest.IMutationGroup=} [properties] Properties to set + * @returns {google.spanner.v1.BatchWriteRequest.MutationGroup} MutationGroup instance + */ + MutationGroup.create = function create(properties) { + return new MutationGroup(properties); + }; + + /** + * Encodes the specified MutationGroup message. Does not implicitly {@link google.spanner.v1.BatchWriteRequest.MutationGroup.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.BatchWriteRequest.MutationGroup + * @static + * @param {google.spanner.v1.BatchWriteRequest.IMutationGroup} message MutationGroup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MutationGroup.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mutations != null && message.mutations.length) + for (var i = 0; i < message.mutations.length; ++i) + $root.google.spanner.v1.Mutation.encode(message.mutations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MutationGroup message, length delimited. Does not implicitly {@link google.spanner.v1.BatchWriteRequest.MutationGroup.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.BatchWriteRequest.MutationGroup + * @static + * @param {google.spanner.v1.BatchWriteRequest.IMutationGroup} message MutationGroup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MutationGroup.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MutationGroup message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.BatchWriteRequest.MutationGroup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.BatchWriteRequest.MutationGroup} MutationGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MutationGroup.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.BatchWriteRequest.MutationGroup(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.mutations && message.mutations.length)) + message.mutations = []; + message.mutations.push($root.google.spanner.v1.Mutation.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MutationGroup message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.BatchWriteRequest.MutationGroup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.BatchWriteRequest.MutationGroup} MutationGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MutationGroup.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MutationGroup message. + * @function verify + * @memberof google.spanner.v1.BatchWriteRequest.MutationGroup + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MutationGroup.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.mutations != null && message.hasOwnProperty("mutations")) { + if (!Array.isArray(message.mutations)) + return "mutations: array expected"; + for (var i = 0; i < message.mutations.length; ++i) { + var error = $root.google.spanner.v1.Mutation.verify(message.mutations[i]); + if (error) + return "mutations." + error; + } + } + return null; + }; + + /** + * Creates a MutationGroup message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.BatchWriteRequest.MutationGroup + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.BatchWriteRequest.MutationGroup} MutationGroup + */ + MutationGroup.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.BatchWriteRequest.MutationGroup) + return object; + var message = new $root.google.spanner.v1.BatchWriteRequest.MutationGroup(); + if (object.mutations) { + if (!Array.isArray(object.mutations)) + throw TypeError(".google.spanner.v1.BatchWriteRequest.MutationGroup.mutations: array expected"); + message.mutations = []; + for (var i = 0; i < object.mutations.length; ++i) { + if (typeof object.mutations[i] !== "object") + throw TypeError(".google.spanner.v1.BatchWriteRequest.MutationGroup.mutations: object expected"); + message.mutations[i] = $root.google.spanner.v1.Mutation.fromObject(object.mutations[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a MutationGroup message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.BatchWriteRequest.MutationGroup + * @static + * @param {google.spanner.v1.BatchWriteRequest.MutationGroup} message MutationGroup + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MutationGroup.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.mutations = []; + if (message.mutations && message.mutations.length) { + object.mutations = []; + for (var j = 0; j < message.mutations.length; ++j) + object.mutations[j] = $root.google.spanner.v1.Mutation.toObject(message.mutations[j], options); + } + return object; + }; + + /** + * Converts this MutationGroup to JSON. + * @function toJSON + * @memberof google.spanner.v1.BatchWriteRequest.MutationGroup + * @instance + * @returns {Object.} JSON object + */ + MutationGroup.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MutationGroup + * @function getTypeUrl + * @memberof google.spanner.v1.BatchWriteRequest.MutationGroup + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MutationGroup.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.BatchWriteRequest.MutationGroup"; + }; + + return MutationGroup; + })(); + + return BatchWriteRequest; + })(); + + v1.BatchWriteResponse = (function() { + + /** + * Properties of a BatchWriteResponse. + * @memberof google.spanner.v1 + * @interface IBatchWriteResponse + * @property {Array.|null} [indexes] BatchWriteResponse indexes + * @property {google.rpc.IStatus|null} [status] BatchWriteResponse status + * @property {google.protobuf.ITimestamp|null} [commitTimestamp] BatchWriteResponse commitTimestamp + */ + + /** + * Constructs a new BatchWriteResponse. + * @memberof google.spanner.v1 + * @classdesc Represents a BatchWriteResponse. + * @implements IBatchWriteResponse + * @constructor + * @param {google.spanner.v1.IBatchWriteResponse=} [properties] Properties to set + */ + function BatchWriteResponse(properties) { + this.indexes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchWriteResponse indexes. + * @member {Array.} indexes + * @memberof google.spanner.v1.BatchWriteResponse + * @instance + */ + BatchWriteResponse.prototype.indexes = $util.emptyArray; + + /** + * BatchWriteResponse status. + * @member {google.rpc.IStatus|null|undefined} status + * @memberof google.spanner.v1.BatchWriteResponse + * @instance + */ + BatchWriteResponse.prototype.status = null; + + /** + * BatchWriteResponse commitTimestamp. + * @member {google.protobuf.ITimestamp|null|undefined} commitTimestamp + * @memberof google.spanner.v1.BatchWriteResponse + * @instance + */ + BatchWriteResponse.prototype.commitTimestamp = null; + + /** + * Creates a new BatchWriteResponse instance using the specified properties. + * @function create + * @memberof google.spanner.v1.BatchWriteResponse + * @static + * @param {google.spanner.v1.IBatchWriteResponse=} [properties] Properties to set + * @returns {google.spanner.v1.BatchWriteResponse} BatchWriteResponse instance + */ + BatchWriteResponse.create = function create(properties) { + return new BatchWriteResponse(properties); + }; + + /** + * Encodes the specified BatchWriteResponse message. Does not implicitly {@link google.spanner.v1.BatchWriteResponse.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.BatchWriteResponse + * @static + * @param {google.spanner.v1.IBatchWriteResponse} message BatchWriteResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchWriteResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.indexes != null && message.indexes.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.indexes.length; ++i) + writer.int32(message.indexes[i]); + writer.ldelim(); + } + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + $root.google.rpc.Status.encode(message.status, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.commitTimestamp != null && Object.hasOwnProperty.call(message, "commitTimestamp")) + $root.google.protobuf.Timestamp.encode(message.commitTimestamp, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchWriteResponse message, length delimited. Does not implicitly {@link google.spanner.v1.BatchWriteResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.BatchWriteResponse + * @static + * @param {google.spanner.v1.IBatchWriteResponse} message BatchWriteResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchWriteResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchWriteResponse message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.BatchWriteResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.BatchWriteResponse} BatchWriteResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchWriteResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.BatchWriteResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.indexes && message.indexes.length)) + message.indexes = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.indexes.push(reader.int32()); + } else + message.indexes.push(reader.int32()); + break; + } + case 2: { + message.status = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 3: { + message.commitTimestamp = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchWriteResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.BatchWriteResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.BatchWriteResponse} BatchWriteResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchWriteResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchWriteResponse message. + * @function verify + * @memberof google.spanner.v1.BatchWriteResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchWriteResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.indexes != null && message.hasOwnProperty("indexes")) { + if (!Array.isArray(message.indexes)) + return "indexes: array expected"; + for (var i = 0; i < message.indexes.length; ++i) + if (!$util.isInteger(message.indexes[i])) + return "indexes: integer[] expected"; + } + if (message.status != null && message.hasOwnProperty("status")) { + var error = $root.google.rpc.Status.verify(message.status); + if (error) + return "status." + error; + } + if (message.commitTimestamp != null && message.hasOwnProperty("commitTimestamp")) { + var error = $root.google.protobuf.Timestamp.verify(message.commitTimestamp); + if (error) + return "commitTimestamp." + error; + } + return null; + }; + + /** + * Creates a BatchWriteResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.BatchWriteResponse + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.BatchWriteResponse} BatchWriteResponse + */ + BatchWriteResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.BatchWriteResponse) + return object; + var message = new $root.google.spanner.v1.BatchWriteResponse(); + if (object.indexes) { + if (!Array.isArray(object.indexes)) + throw TypeError(".google.spanner.v1.BatchWriteResponse.indexes: array expected"); + message.indexes = []; + for (var i = 0; i < object.indexes.length; ++i) + message.indexes[i] = object.indexes[i] | 0; + } + if (object.status != null) { + if (typeof object.status !== "object") + throw TypeError(".google.spanner.v1.BatchWriteResponse.status: object expected"); + message.status = $root.google.rpc.Status.fromObject(object.status); + } + if (object.commitTimestamp != null) { + if (typeof object.commitTimestamp !== "object") + throw TypeError(".google.spanner.v1.BatchWriteResponse.commitTimestamp: object expected"); + message.commitTimestamp = $root.google.protobuf.Timestamp.fromObject(object.commitTimestamp); + } + return message; + }; + + /** + * Creates a plain object from a BatchWriteResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.BatchWriteResponse + * @static + * @param {google.spanner.v1.BatchWriteResponse} message BatchWriteResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchWriteResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.indexes = []; + if (options.defaults) { + object.status = null; + object.commitTimestamp = null; + } + if (message.indexes && message.indexes.length) { + object.indexes = []; + for (var j = 0; j < message.indexes.length; ++j) + object.indexes[j] = message.indexes[j]; + } + if (message.status != null && message.hasOwnProperty("status")) + object.status = $root.google.rpc.Status.toObject(message.status, options); + if (message.commitTimestamp != null && message.hasOwnProperty("commitTimestamp")) + object.commitTimestamp = $root.google.protobuf.Timestamp.toObject(message.commitTimestamp, options); + return object; + }; + + /** + * Converts this BatchWriteResponse to JSON. + * @function toJSON + * @memberof google.spanner.v1.BatchWriteResponse + * @instance + * @returns {Object.} JSON object + */ + BatchWriteResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchWriteResponse + * @function getTypeUrl + * @memberof google.spanner.v1.BatchWriteResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchWriteResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.BatchWriteResponse"; + }; + + return BatchWriteResponse; + })(); + + return v1; + })(); + + return spanner; + })(); + + google.api = (function() { + + /** + * Namespace api. + * @memberof google + * @namespace + */ + var api = {}; + + /** + * FieldBehavior enum. + * @name google.api.FieldBehavior + * @enum {number} + * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value + * @property {number} OPTIONAL=1 OPTIONAL value + * @property {number} REQUIRED=2 REQUIRED value + * @property {number} OUTPUT_ONLY=3 OUTPUT_ONLY value + * @property {number} INPUT_ONLY=4 INPUT_ONLY value + * @property {number} IMMUTABLE=5 IMMUTABLE value + * @property {number} UNORDERED_LIST=6 UNORDERED_LIST value + * @property {number} NON_EMPTY_DEFAULT=7 NON_EMPTY_DEFAULT value + * @property {number} IDENTIFIER=8 IDENTIFIER value + */ + api.FieldBehavior = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_BEHAVIOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "OPTIONAL"] = 1; + values[valuesById[2] = "REQUIRED"] = 2; + values[valuesById[3] = "OUTPUT_ONLY"] = 3; + values[valuesById[4] = "INPUT_ONLY"] = 4; + values[valuesById[5] = "IMMUTABLE"] = 5; + values[valuesById[6] = "UNORDERED_LIST"] = 6; + values[valuesById[7] = "NON_EMPTY_DEFAULT"] = 7; + values[valuesById[8] = "IDENTIFIER"] = 8; + return values; + })(); + + api.Http = (function() { + + /** + * Properties of a Http. + * @memberof google.api + * @interface IHttp + * @property {Array.|null} [rules] Http rules + * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion + */ + + /** + * Constructs a new Http. + * @memberof google.api + * @classdesc Represents a Http. + * @implements IHttp + * @constructor + * @param {google.api.IHttp=} [properties] Properties to set + */ + function Http(properties) { + this.rules = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Http rules. + * @member {Array.} rules + * @memberof google.api.Http + * @instance + */ + Http.prototype.rules = $util.emptyArray; + + /** + * Http fullyDecodeReservedExpansion. + * @member {boolean} fullyDecodeReservedExpansion + * @memberof google.api.Http + * @instance + */ + Http.prototype.fullyDecodeReservedExpansion = false; + + /** + * Creates a new Http instance using the specified properties. + * @function create + * @memberof google.api.Http + * @static + * @param {google.api.IHttp=} [properties] Properties to set + * @returns {google.api.Http} Http instance + */ + Http.create = function create(properties) { + return new Http(properties); + }; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encode + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rules != null && message.rules.length) + for (var i = 0; i < message.rules.length; ++i) + $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); + return writer; + }; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Http message from the specified reader or buffer. + * @function decode + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + case 2: { + message.fullyDecodeReservedExpansion = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Http message. + * @function verify + * @memberof google.api.Http + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Http.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rules != null && message.hasOwnProperty("rules")) { + if (!Array.isArray(message.rules)) + return "rules: array expected"; + for (var i = 0; i < message.rules.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.rules[i]); + if (error) + return "rules." + error; + } + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + if (typeof message.fullyDecodeReservedExpansion !== "boolean") + return "fullyDecodeReservedExpansion: boolean expected"; + return null; + }; + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Http + * @static + * @param {Object.} object Plain object + * @returns {google.api.Http} Http + */ + Http.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Http) + return object; + var message = new $root.google.api.Http(); + if (object.rules) { + if (!Array.isArray(object.rules)) + throw TypeError(".google.api.Http.rules: array expected"); + message.rules = []; + for (var i = 0; i < object.rules.length; ++i) { + if (typeof object.rules[i] !== "object") + throw TypeError(".google.api.Http.rules: object expected"); + message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); + } + } + if (object.fullyDecodeReservedExpansion != null) + message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); + return message; + }; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Http + * @static + * @param {google.api.Http} message Http + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Http.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rules = []; + if (options.defaults) + object.fullyDecodeReservedExpansion = false; + if (message.rules && message.rules.length) { + object.rules = []; + for (var j = 0; j < message.rules.length; ++j) + object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; + return object; + }; + + /** + * Converts this Http to JSON. + * @function toJSON + * @memberof google.api.Http + * @instance + * @returns {Object.} JSON object + */ + Http.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Http + * @function getTypeUrl + * @memberof google.api.Http + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Http.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Http"; + }; + + return Http; + })(); + + api.HttpRule = (function() { + + /** + * Properties of a HttpRule. + * @memberof google.api + * @interface IHttpRule + * @property {string|null} [selector] HttpRule selector + * @property {string|null} [get] HttpRule get + * @property {string|null} [put] HttpRule put + * @property {string|null} [post] HttpRule post + * @property {string|null} ["delete"] HttpRule delete + * @property {string|null} [patch] HttpRule patch + * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom + * @property {string|null} [body] HttpRule body + * @property {string|null} [responseBody] HttpRule responseBody + * @property {Array.|null} [additionalBindings] HttpRule additionalBindings + */ + + /** + * Constructs a new HttpRule. + * @memberof google.api + * @classdesc Represents a HttpRule. + * @implements IHttpRule + * @constructor + * @param {google.api.IHttpRule=} [properties] Properties to set + */ + function HttpRule(properties) { + this.additionalBindings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HttpRule selector. + * @member {string} selector + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.selector = ""; + + /** + * HttpRule get. + * @member {string|null|undefined} get + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.get = null; + + /** + * HttpRule put. + * @member {string|null|undefined} put + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.put = null; + + /** + * HttpRule post. + * @member {string|null|undefined} post + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.post = null; + + /** + * HttpRule delete. + * @member {string|null|undefined} delete + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype["delete"] = null; + + /** + * HttpRule patch. + * @member {string|null|undefined} patch + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.patch = null; + + /** + * HttpRule custom. + * @member {google.api.ICustomHttpPattern|null|undefined} custom + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.custom = null; + + /** + * HttpRule body. + * @member {string} body + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.body = ""; + + /** + * HttpRule responseBody. + * @member {string} responseBody + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.responseBody = ""; + + /** + * HttpRule additionalBindings. + * @member {Array.} additionalBindings + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.additionalBindings = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HttpRule pattern. + * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern + * @memberof google.api.HttpRule + * @instance + */ + Object.defineProperty(HttpRule.prototype, "pattern", { + get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HttpRule instance using the specified properties. + * @function create + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule=} [properties] Properties to set + * @returns {google.api.HttpRule} HttpRule instance + */ + HttpRule.create = function create(properties) { + return new HttpRule(properties); + }; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encode + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.get != null && Object.hasOwnProperty.call(message, "get")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); + if (message.put != null && Object.hasOwnProperty.call(message, "put")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); + if (message.post != null && Object.hasOwnProperty.call(message, "post")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); + if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); + if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); + if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) + $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.additionalBindings != null && message.additionalBindings.length) + for (var i = 0; i < message.additionalBindings.length; ++i) + $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); + return writer; + }; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @function decode + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.get = reader.string(); + break; + } + case 3: { + message.put = reader.string(); + break; + } + case 4: { + message.post = reader.string(); + break; + } + case 5: { + message["delete"] = reader.string(); + break; + } + case 6: { + message.patch = reader.string(); + break; + } + case 8: { + message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); + break; + } + case 7: { + message.body = reader.string(); + break; + } + case 12: { + message.responseBody = reader.string(); + break; + } + case 11: { + if (!(message.additionalBindings && message.additionalBindings.length)) + message.additionalBindings = []; + message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HttpRule message. + * @function verify + * @memberof google.api.HttpRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HttpRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.get != null && message.hasOwnProperty("get")) { + properties.pattern = 1; + if (!$util.isString(message.get)) + return "get: string expected"; + } + if (message.put != null && message.hasOwnProperty("put")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.put)) + return "put: string expected"; + } + if (message.post != null && message.hasOwnProperty("post")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.post)) + return "post: string expected"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message["delete"])) + return "delete: string expected"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.patch)) + return "patch: string expected"; + } + if (message.custom != null && message.hasOwnProperty("custom")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + { + var error = $root.google.api.CustomHttpPattern.verify(message.custom); + if (error) + return "custom." + error; + } + } + if (message.body != null && message.hasOwnProperty("body")) + if (!$util.isString(message.body)) + return "body: string expected"; + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + if (!$util.isString(message.responseBody)) + return "responseBody: string expected"; + if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) { + if (!Array.isArray(message.additionalBindings)) + return "additionalBindings: array expected"; + for (var i = 0; i < message.additionalBindings.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]); + if (error) + return "additionalBindings." + error; + } + } + return null; + }; + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.HttpRule + * @static + * @param {Object.} object Plain object + * @returns {google.api.HttpRule} HttpRule + */ + HttpRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.HttpRule) + return object; + var message = new $root.google.api.HttpRule(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.get != null) + message.get = String(object.get); + if (object.put != null) + message.put = String(object.put); + if (object.post != null) + message.post = String(object.post); + if (object["delete"] != null) + message["delete"] = String(object["delete"]); + if (object.patch != null) + message.patch = String(object.patch); + if (object.custom != null) { + if (typeof object.custom !== "object") + throw TypeError(".google.api.HttpRule.custom: object expected"); + message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); + } + if (object.body != null) + message.body = String(object.body); + if (object.responseBody != null) + message.responseBody = String(object.responseBody); + if (object.additionalBindings) { + if (!Array.isArray(object.additionalBindings)) + throw TypeError(".google.api.HttpRule.additionalBindings: array expected"); + message.additionalBindings = []; + for (var i = 0; i < object.additionalBindings.length; ++i) { + if (typeof object.additionalBindings[i] !== "object") + throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); + message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.HttpRule + * @static + * @param {google.api.HttpRule} message HttpRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HttpRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.additionalBindings = []; + if (options.defaults) { + object.selector = ""; + object.body = ""; + object.responseBody = ""; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.get != null && message.hasOwnProperty("get")) { + object.get = message.get; + if (options.oneofs) + object.pattern = "get"; + } + if (message.put != null && message.hasOwnProperty("put")) { + object.put = message.put; + if (options.oneofs) + object.pattern = "put"; + } + if (message.post != null && message.hasOwnProperty("post")) { + object.post = message.post; + if (options.oneofs) + object.pattern = "post"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + object["delete"] = message["delete"]; + if (options.oneofs) + object.pattern = "delete"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + object.patch = message.patch; + if (options.oneofs) + object.pattern = "patch"; + } + if (message.body != null && message.hasOwnProperty("body")) + object.body = message.body; + if (message.custom != null && message.hasOwnProperty("custom")) { + object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); + if (options.oneofs) + object.pattern = "custom"; + } + if (message.additionalBindings && message.additionalBindings.length) { + object.additionalBindings = []; + for (var j = 0; j < message.additionalBindings.length; ++j) + object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options); + } + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + object.responseBody = message.responseBody; + return object; + }; + + /** + * Converts this HttpRule to JSON. + * @function toJSON + * @memberof google.api.HttpRule + * @instance + * @returns {Object.} JSON object + */ + HttpRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HttpRule + * @function getTypeUrl + * @memberof google.api.HttpRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HttpRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.HttpRule"; + }; + + return HttpRule; + })(); + + api.CustomHttpPattern = (function() { + + /** + * Properties of a CustomHttpPattern. + * @memberof google.api + * @interface ICustomHttpPattern + * @property {string|null} [kind] CustomHttpPattern kind + * @property {string|null} [path] CustomHttpPattern path + */ + + /** + * Constructs a new CustomHttpPattern. + * @memberof google.api + * @classdesc Represents a CustomHttpPattern. + * @implements ICustomHttpPattern + * @constructor + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + */ + function CustomHttpPattern(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CustomHttpPattern kind. + * @member {string} kind + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.kind = ""; + + /** + * CustomHttpPattern path. + * @member {string} path + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.path = ""; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @function create + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance + */ + CustomHttpPattern.create = function create(properties) { + return new CustomHttpPattern(properties); + }; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encode + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); + return writer; + }; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @function decode + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.kind = reader.string(); + break; + } + case 2: { + message.path = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomHttpPattern message. + * @function verify + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomHttpPattern.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kind != null && message.hasOwnProperty("kind")) + if (!$util.isString(message.kind)) + return "kind: string expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + return null; + }; + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} object Plain object + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + */ + CustomHttpPattern.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CustomHttpPattern) + return object; + var message = new $root.google.api.CustomHttpPattern(); + if (object.kind != null) + message.kind = String(object.kind); + if (object.path != null) + message.path = String(object.path); + return message; + }; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.CustomHttpPattern} message CustomHttpPattern + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomHttpPattern.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.kind = ""; + object.path = ""; + } + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = message.kind; + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; + return object; + }; + + /** + * Converts this CustomHttpPattern to JSON. + * @function toJSON + * @memberof google.api.CustomHttpPattern + * @instance + * @returns {Object.} JSON object + */ + CustomHttpPattern.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomHttpPattern + * @function getTypeUrl + * @memberof google.api.CustomHttpPattern + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomHttpPattern.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CustomHttpPattern"; + }; + + return CustomHttpPattern; + })(); + + api.CommonLanguageSettings = (function() { + + /** + * Properties of a CommonLanguageSettings. + * @memberof google.api + * @interface ICommonLanguageSettings + * @property {string|null} [referenceDocsUri] CommonLanguageSettings referenceDocsUri + * @property {Array.|null} [destinations] CommonLanguageSettings destinations + */ + + /** + * Constructs a new CommonLanguageSettings. + * @memberof google.api + * @classdesc Represents a CommonLanguageSettings. + * @implements ICommonLanguageSettings + * @constructor + * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set + */ + function CommonLanguageSettings(properties) { + this.destinations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CommonLanguageSettings referenceDocsUri. + * @member {string} referenceDocsUri + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.referenceDocsUri = ""; + + /** + * CommonLanguageSettings destinations. + * @member {Array.} destinations + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.destinations = $util.emptyArray; + + /** + * Creates a new CommonLanguageSettings instance using the specified properties. + * @function create + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings instance + */ + CommonLanguageSettings.create = function create(properties) { + return new CommonLanguageSettings(properties); + }; + + /** + * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @function encode + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommonLanguageSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.referenceDocsUri != null && Object.hasOwnProperty.call(message, "referenceDocsUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.referenceDocsUri); + if (message.destinations != null && message.destinations.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.destinations.length; ++i) + writer.int32(message.destinations[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommonLanguageSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.CommonLanguageSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommonLanguageSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CommonLanguageSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.referenceDocsUri = reader.string(); + break; + } + case 2: { + if (!(message.destinations && message.destinations.length)) + message.destinations = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.destinations.push(reader.int32()); + } else + message.destinations.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CommonLanguageSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommonLanguageSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CommonLanguageSettings message. + * @function verify + * @memberof google.api.CommonLanguageSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CommonLanguageSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) + if (!$util.isString(message.referenceDocsUri)) + return "referenceDocsUri: string expected"; + if (message.destinations != null && message.hasOwnProperty("destinations")) { + if (!Array.isArray(message.destinations)) + return "destinations: array expected"; + for (var i = 0; i < message.destinations.length; ++i) + switch (message.destinations[i]) { + default: + return "destinations: enum value[] expected"; + case 0: + case 10: + case 20: + break; + } + } + return null; + }; + + /** + * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CommonLanguageSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + */ + CommonLanguageSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CommonLanguageSettings) + return object; + var message = new $root.google.api.CommonLanguageSettings(); + if (object.referenceDocsUri != null) + message.referenceDocsUri = String(object.referenceDocsUri); + if (object.destinations) { + if (!Array.isArray(object.destinations)) + throw TypeError(".google.api.CommonLanguageSettings.destinations: array expected"); + message.destinations = []; + for (var i = 0; i < object.destinations.length; ++i) + switch (object.destinations[i]) { + default: + if (typeof object.destinations[i] === "number") { + message.destinations[i] = object.destinations[i]; + break; + } + case "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": + case 0: + message.destinations[i] = 0; + break; + case "GITHUB": + case 10: + message.destinations[i] = 10; + break; + case "PACKAGE_MANAGER": + case 20: + message.destinations[i] = 20; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.CommonLanguageSettings} message CommonLanguageSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CommonLanguageSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.destinations = []; + if (options.defaults) + object.referenceDocsUri = ""; + if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) + object.referenceDocsUri = message.referenceDocsUri; + if (message.destinations && message.destinations.length) { + object.destinations = []; + for (var j = 0; j < message.destinations.length; ++j) + object.destinations[j] = options.enums === String ? $root.google.api.ClientLibraryDestination[message.destinations[j]] === undefined ? message.destinations[j] : $root.google.api.ClientLibraryDestination[message.destinations[j]] : message.destinations[j]; + } + return object; + }; + + /** + * Converts this CommonLanguageSettings to JSON. + * @function toJSON + * @memberof google.api.CommonLanguageSettings + * @instance + * @returns {Object.} JSON object + */ + CommonLanguageSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CommonLanguageSettings + * @function getTypeUrl + * @memberof google.api.CommonLanguageSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CommonLanguageSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CommonLanguageSettings"; + }; + + return CommonLanguageSettings; + })(); + + api.ClientLibrarySettings = (function() { + + /** + * Properties of a ClientLibrarySettings. + * @memberof google.api + * @interface IClientLibrarySettings + * @property {string|null} [version] ClientLibrarySettings version + * @property {google.api.LaunchStage|null} [launchStage] ClientLibrarySettings launchStage + * @property {boolean|null} [restNumericEnums] ClientLibrarySettings restNumericEnums + * @property {google.api.IJavaSettings|null} [javaSettings] ClientLibrarySettings javaSettings + * @property {google.api.ICppSettings|null} [cppSettings] ClientLibrarySettings cppSettings + * @property {google.api.IPhpSettings|null} [phpSettings] ClientLibrarySettings phpSettings + * @property {google.api.IPythonSettings|null} [pythonSettings] ClientLibrarySettings pythonSettings + * @property {google.api.INodeSettings|null} [nodeSettings] ClientLibrarySettings nodeSettings + * @property {google.api.IDotnetSettings|null} [dotnetSettings] ClientLibrarySettings dotnetSettings + * @property {google.api.IRubySettings|null} [rubySettings] ClientLibrarySettings rubySettings + * @property {google.api.IGoSettings|null} [goSettings] ClientLibrarySettings goSettings + */ + + /** + * Constructs a new ClientLibrarySettings. + * @memberof google.api + * @classdesc Represents a ClientLibrarySettings. + * @implements IClientLibrarySettings + * @constructor + * @param {google.api.IClientLibrarySettings=} [properties] Properties to set + */ + function ClientLibrarySettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClientLibrarySettings version. + * @member {string} version + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.version = ""; + + /** + * ClientLibrarySettings launchStage. + * @member {google.api.LaunchStage} launchStage + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.launchStage = 0; + + /** + * ClientLibrarySettings restNumericEnums. + * @member {boolean} restNumericEnums + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.restNumericEnums = false; + + /** + * ClientLibrarySettings javaSettings. + * @member {google.api.IJavaSettings|null|undefined} javaSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.javaSettings = null; + + /** + * ClientLibrarySettings cppSettings. + * @member {google.api.ICppSettings|null|undefined} cppSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.cppSettings = null; + + /** + * ClientLibrarySettings phpSettings. + * @member {google.api.IPhpSettings|null|undefined} phpSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.phpSettings = null; + + /** + * ClientLibrarySettings pythonSettings. + * @member {google.api.IPythonSettings|null|undefined} pythonSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.pythonSettings = null; + + /** + * ClientLibrarySettings nodeSettings. + * @member {google.api.INodeSettings|null|undefined} nodeSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.nodeSettings = null; + + /** + * ClientLibrarySettings dotnetSettings. + * @member {google.api.IDotnetSettings|null|undefined} dotnetSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.dotnetSettings = null; + + /** + * ClientLibrarySettings rubySettings. + * @member {google.api.IRubySettings|null|undefined} rubySettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.rubySettings = null; + + /** + * ClientLibrarySettings goSettings. + * @member {google.api.IGoSettings|null|undefined} goSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.goSettings = null; + + /** + * Creates a new ClientLibrarySettings instance using the specified properties. + * @function create + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings=} [properties] Properties to set + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings instance + */ + ClientLibrarySettings.create = function create(properties) { + return new ClientLibrarySettings(properties); + }; + + /** + * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @function encode + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientLibrarySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); + if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.launchStage); + if (message.restNumericEnums != null && Object.hasOwnProperty.call(message, "restNumericEnums")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.restNumericEnums); + if (message.javaSettings != null && Object.hasOwnProperty.call(message, "javaSettings")) + $root.google.api.JavaSettings.encode(message.javaSettings, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.cppSettings != null && Object.hasOwnProperty.call(message, "cppSettings")) + $root.google.api.CppSettings.encode(message.cppSettings, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.phpSettings != null && Object.hasOwnProperty.call(message, "phpSettings")) + $root.google.api.PhpSettings.encode(message.phpSettings, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.pythonSettings != null && Object.hasOwnProperty.call(message, "pythonSettings")) + $root.google.api.PythonSettings.encode(message.pythonSettings, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + if (message.nodeSettings != null && Object.hasOwnProperty.call(message, "nodeSettings")) + $root.google.api.NodeSettings.encode(message.nodeSettings, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); + if (message.dotnetSettings != null && Object.hasOwnProperty.call(message, "dotnetSettings")) + $root.google.api.DotnetSettings.encode(message.dotnetSettings, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + if (message.rubySettings != null && Object.hasOwnProperty.call(message, "rubySettings")) + $root.google.api.RubySettings.encode(message.rubySettings, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); + if (message.goSettings != null && Object.hasOwnProperty.call(message, "goSettings")) + $root.google.api.GoSettings.encode(message.goSettings, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientLibrarySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.ClientLibrarySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientLibrarySettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ClientLibrarySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.version = reader.string(); + break; + } + case 2: { + message.launchStage = reader.int32(); + break; + } + case 3: { + message.restNumericEnums = reader.bool(); + break; + } + case 21: { + message.javaSettings = $root.google.api.JavaSettings.decode(reader, reader.uint32()); + break; + } + case 22: { + message.cppSettings = $root.google.api.CppSettings.decode(reader, reader.uint32()); + break; + } + case 23: { + message.phpSettings = $root.google.api.PhpSettings.decode(reader, reader.uint32()); + break; + } + case 24: { + message.pythonSettings = $root.google.api.PythonSettings.decode(reader, reader.uint32()); + break; + } + case 25: { + message.nodeSettings = $root.google.api.NodeSettings.decode(reader, reader.uint32()); + break; + } + case 26: { + message.dotnetSettings = $root.google.api.DotnetSettings.decode(reader, reader.uint32()); + break; + } + case 27: { + message.rubySettings = $root.google.api.RubySettings.decode(reader, reader.uint32()); + break; + } + case 28: { + message.goSettings = $root.google.api.GoSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ClientLibrarySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientLibrarySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClientLibrarySettings message. + * @function verify + * @memberof google.api.ClientLibrarySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClientLibrarySettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + switch (message.launchStage) { + default: + return "launchStage: enum value expected"; + case 0: + case 6: + case 7: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) + if (typeof message.restNumericEnums !== "boolean") + return "restNumericEnums: boolean expected"; + if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) { + var error = $root.google.api.JavaSettings.verify(message.javaSettings); + if (error) + return "javaSettings." + error; + } + if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) { + var error = $root.google.api.CppSettings.verify(message.cppSettings); + if (error) + return "cppSettings." + error; + } + if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) { + var error = $root.google.api.PhpSettings.verify(message.phpSettings); + if (error) + return "phpSettings." + error; + } + if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) { + var error = $root.google.api.PythonSettings.verify(message.pythonSettings); + if (error) + return "pythonSettings." + error; + } + if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) { + var error = $root.google.api.NodeSettings.verify(message.nodeSettings); + if (error) + return "nodeSettings." + error; + } + if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) { + var error = $root.google.api.DotnetSettings.verify(message.dotnetSettings); + if (error) + return "dotnetSettings." + error; + } + if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) { + var error = $root.google.api.RubySettings.verify(message.rubySettings); + if (error) + return "rubySettings." + error; + } + if (message.goSettings != null && message.hasOwnProperty("goSettings")) { + var error = $root.google.api.GoSettings.verify(message.goSettings); + if (error) + return "goSettings." + error; + } + return null; + }; + + /** + * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ClientLibrarySettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + */ + ClientLibrarySettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ClientLibrarySettings) + return object; + var message = new $root.google.api.ClientLibrarySettings(); + if (object.version != null) + message.version = String(object.version); + switch (object.launchStage) { + default: + if (typeof object.launchStage === "number") { + message.launchStage = object.launchStage; + break; + } + break; + case "LAUNCH_STAGE_UNSPECIFIED": + case 0: + message.launchStage = 0; + break; + case "UNIMPLEMENTED": + case 6: + message.launchStage = 6; + break; + case "PRELAUNCH": + case 7: + message.launchStage = 7; + break; + case "EARLY_ACCESS": + case 1: + message.launchStage = 1; + break; + case "ALPHA": + case 2: + message.launchStage = 2; + break; + case "BETA": + case 3: + message.launchStage = 3; + break; + case "GA": + case 4: + message.launchStage = 4; + break; + case "DEPRECATED": + case 5: + message.launchStage = 5; + break; + } + if (object.restNumericEnums != null) + message.restNumericEnums = Boolean(object.restNumericEnums); + if (object.javaSettings != null) { + if (typeof object.javaSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.javaSettings: object expected"); + message.javaSettings = $root.google.api.JavaSettings.fromObject(object.javaSettings); + } + if (object.cppSettings != null) { + if (typeof object.cppSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.cppSettings: object expected"); + message.cppSettings = $root.google.api.CppSettings.fromObject(object.cppSettings); + } + if (object.phpSettings != null) { + if (typeof object.phpSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.phpSettings: object expected"); + message.phpSettings = $root.google.api.PhpSettings.fromObject(object.phpSettings); + } + if (object.pythonSettings != null) { + if (typeof object.pythonSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.pythonSettings: object expected"); + message.pythonSettings = $root.google.api.PythonSettings.fromObject(object.pythonSettings); + } + if (object.nodeSettings != null) { + if (typeof object.nodeSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.nodeSettings: object expected"); + message.nodeSettings = $root.google.api.NodeSettings.fromObject(object.nodeSettings); + } + if (object.dotnetSettings != null) { + if (typeof object.dotnetSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.dotnetSettings: object expected"); + message.dotnetSettings = $root.google.api.DotnetSettings.fromObject(object.dotnetSettings); + } + if (object.rubySettings != null) { + if (typeof object.rubySettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.rubySettings: object expected"); + message.rubySettings = $root.google.api.RubySettings.fromObject(object.rubySettings); + } + if (object.goSettings != null) { + if (typeof object.goSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.goSettings: object expected"); + message.goSettings = $root.google.api.GoSettings.fromObject(object.goSettings); + } + return message; + }; + + /** + * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.ClientLibrarySettings} message ClientLibrarySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClientLibrarySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.version = ""; + object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; + object.restNumericEnums = false; + object.javaSettings = null; + object.cppSettings = null; + object.phpSettings = null; + object.pythonSettings = null; + object.nodeSettings = null; + object.dotnetSettings = null; + object.rubySettings = null; + object.goSettings = null; + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + object.launchStage = options.enums === String ? $root.google.api.LaunchStage[message.launchStage] === undefined ? message.launchStage : $root.google.api.LaunchStage[message.launchStage] : message.launchStage; + if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) + object.restNumericEnums = message.restNumericEnums; + if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) + object.javaSettings = $root.google.api.JavaSettings.toObject(message.javaSettings, options); + if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) + object.cppSettings = $root.google.api.CppSettings.toObject(message.cppSettings, options); + if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) + object.phpSettings = $root.google.api.PhpSettings.toObject(message.phpSettings, options); + if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) + object.pythonSettings = $root.google.api.PythonSettings.toObject(message.pythonSettings, options); + if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) + object.nodeSettings = $root.google.api.NodeSettings.toObject(message.nodeSettings, options); + if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) + object.dotnetSettings = $root.google.api.DotnetSettings.toObject(message.dotnetSettings, options); + if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) + object.rubySettings = $root.google.api.RubySettings.toObject(message.rubySettings, options); + if (message.goSettings != null && message.hasOwnProperty("goSettings")) + object.goSettings = $root.google.api.GoSettings.toObject(message.goSettings, options); + return object; + }; + + /** + * Converts this ClientLibrarySettings to JSON. + * @function toJSON + * @memberof google.api.ClientLibrarySettings + * @instance + * @returns {Object.} JSON object + */ + ClientLibrarySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClientLibrarySettings + * @function getTypeUrl + * @memberof google.api.ClientLibrarySettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClientLibrarySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ClientLibrarySettings"; + }; + + return ClientLibrarySettings; + })(); + + api.Publishing = (function() { + + /** + * Properties of a Publishing. + * @memberof google.api + * @interface IPublishing + * @property {Array.|null} [methodSettings] Publishing methodSettings + * @property {string|null} [newIssueUri] Publishing newIssueUri + * @property {string|null} [documentationUri] Publishing documentationUri + * @property {string|null} [apiShortName] Publishing apiShortName + * @property {string|null} [githubLabel] Publishing githubLabel + * @property {Array.|null} [codeownerGithubTeams] Publishing codeownerGithubTeams + * @property {string|null} [docTagPrefix] Publishing docTagPrefix + * @property {google.api.ClientLibraryOrganization|null} [organization] Publishing organization + * @property {Array.|null} [librarySettings] Publishing librarySettings + * @property {string|null} [protoReferenceDocumentationUri] Publishing protoReferenceDocumentationUri + * @property {string|null} [restReferenceDocumentationUri] Publishing restReferenceDocumentationUri + */ + + /** + * Constructs a new Publishing. + * @memberof google.api + * @classdesc Represents a Publishing. + * @implements IPublishing + * @constructor + * @param {google.api.IPublishing=} [properties] Properties to set + */ + function Publishing(properties) { + this.methodSettings = []; + this.codeownerGithubTeams = []; + this.librarySettings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Publishing methodSettings. + * @member {Array.} methodSettings + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.methodSettings = $util.emptyArray; + + /** + * Publishing newIssueUri. + * @member {string} newIssueUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.newIssueUri = ""; + + /** + * Publishing documentationUri. + * @member {string} documentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.documentationUri = ""; + + /** + * Publishing apiShortName. + * @member {string} apiShortName + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.apiShortName = ""; + + /** + * Publishing githubLabel. + * @member {string} githubLabel + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.githubLabel = ""; + + /** + * Publishing codeownerGithubTeams. + * @member {Array.} codeownerGithubTeams + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.codeownerGithubTeams = $util.emptyArray; + + /** + * Publishing docTagPrefix. + * @member {string} docTagPrefix + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.docTagPrefix = ""; + + /** + * Publishing organization. + * @member {google.api.ClientLibraryOrganization} organization + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.organization = 0; + + /** + * Publishing librarySettings. + * @member {Array.} librarySettings + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.librarySettings = $util.emptyArray; + + /** + * Publishing protoReferenceDocumentationUri. + * @member {string} protoReferenceDocumentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.protoReferenceDocumentationUri = ""; + + /** + * Publishing restReferenceDocumentationUri. + * @member {string} restReferenceDocumentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.restReferenceDocumentationUri = ""; + + /** + * Creates a new Publishing instance using the specified properties. + * @function create + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing=} [properties] Properties to set + * @returns {google.api.Publishing} Publishing instance + */ + Publishing.create = function create(properties) { + return new Publishing(properties); + }; + + /** + * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @function encode + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing} message Publishing message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Publishing.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.methodSettings != null && message.methodSettings.length) + for (var i = 0; i < message.methodSettings.length; ++i) + $root.google.api.MethodSettings.encode(message.methodSettings[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.newIssueUri != null && Object.hasOwnProperty.call(message, "newIssueUri")) + writer.uint32(/* id 101, wireType 2 =*/810).string(message.newIssueUri); + if (message.documentationUri != null && Object.hasOwnProperty.call(message, "documentationUri")) + writer.uint32(/* id 102, wireType 2 =*/818).string(message.documentationUri); + if (message.apiShortName != null && Object.hasOwnProperty.call(message, "apiShortName")) + writer.uint32(/* id 103, wireType 2 =*/826).string(message.apiShortName); + if (message.githubLabel != null && Object.hasOwnProperty.call(message, "githubLabel")) + writer.uint32(/* id 104, wireType 2 =*/834).string(message.githubLabel); + if (message.codeownerGithubTeams != null && message.codeownerGithubTeams.length) + for (var i = 0; i < message.codeownerGithubTeams.length; ++i) + writer.uint32(/* id 105, wireType 2 =*/842).string(message.codeownerGithubTeams[i]); + if (message.docTagPrefix != null && Object.hasOwnProperty.call(message, "docTagPrefix")) + writer.uint32(/* id 106, wireType 2 =*/850).string(message.docTagPrefix); + if (message.organization != null && Object.hasOwnProperty.call(message, "organization")) + writer.uint32(/* id 107, wireType 0 =*/856).int32(message.organization); + if (message.librarySettings != null && message.librarySettings.length) + for (var i = 0; i < message.librarySettings.length; ++i) + $root.google.api.ClientLibrarySettings.encode(message.librarySettings[i], writer.uint32(/* id 109, wireType 2 =*/874).fork()).ldelim(); + if (message.protoReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "protoReferenceDocumentationUri")) + writer.uint32(/* id 110, wireType 2 =*/882).string(message.protoReferenceDocumentationUri); + if (message.restReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "restReferenceDocumentationUri")) + writer.uint32(/* id 111, wireType 2 =*/890).string(message.restReferenceDocumentationUri); + return writer; + }; + + /** + * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing} message Publishing message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Publishing.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Publishing message from the specified reader or buffer. + * @function decode + * @memberof google.api.Publishing + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Publishing} Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Publishing.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Publishing(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + if (!(message.methodSettings && message.methodSettings.length)) + message.methodSettings = []; + message.methodSettings.push($root.google.api.MethodSettings.decode(reader, reader.uint32())); + break; + } + case 101: { + message.newIssueUri = reader.string(); + break; + } + case 102: { + message.documentationUri = reader.string(); + break; + } + case 103: { + message.apiShortName = reader.string(); + break; + } + case 104: { + message.githubLabel = reader.string(); + break; + } + case 105: { + if (!(message.codeownerGithubTeams && message.codeownerGithubTeams.length)) + message.codeownerGithubTeams = []; + message.codeownerGithubTeams.push(reader.string()); + break; + } + case 106: { + message.docTagPrefix = reader.string(); + break; + } + case 107: { + message.organization = reader.int32(); + break; + } + case 109: { + if (!(message.librarySettings && message.librarySettings.length)) + message.librarySettings = []; + message.librarySettings.push($root.google.api.ClientLibrarySettings.decode(reader, reader.uint32())); + break; + } + case 110: { + message.protoReferenceDocumentationUri = reader.string(); + break; + } + case 111: { + message.restReferenceDocumentationUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Publishing message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Publishing + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Publishing} Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Publishing.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Publishing message. + * @function verify + * @memberof google.api.Publishing + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Publishing.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.methodSettings != null && message.hasOwnProperty("methodSettings")) { + if (!Array.isArray(message.methodSettings)) + return "methodSettings: array expected"; + for (var i = 0; i < message.methodSettings.length; ++i) { + var error = $root.google.api.MethodSettings.verify(message.methodSettings[i]); + if (error) + return "methodSettings." + error; + } + } + if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) + if (!$util.isString(message.newIssueUri)) + return "newIssueUri: string expected"; + if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) + if (!$util.isString(message.documentationUri)) + return "documentationUri: string expected"; + if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) + if (!$util.isString(message.apiShortName)) + return "apiShortName: string expected"; + if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) + if (!$util.isString(message.githubLabel)) + return "githubLabel: string expected"; + if (message.codeownerGithubTeams != null && message.hasOwnProperty("codeownerGithubTeams")) { + if (!Array.isArray(message.codeownerGithubTeams)) + return "codeownerGithubTeams: array expected"; + for (var i = 0; i < message.codeownerGithubTeams.length; ++i) + if (!$util.isString(message.codeownerGithubTeams[i])) + return "codeownerGithubTeams: string[] expected"; + } + if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) + if (!$util.isString(message.docTagPrefix)) + return "docTagPrefix: string expected"; + if (message.organization != null && message.hasOwnProperty("organization")) + switch (message.organization) { + default: + return "organization: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + if (message.librarySettings != null && message.hasOwnProperty("librarySettings")) { + if (!Array.isArray(message.librarySettings)) + return "librarySettings: array expected"; + for (var i = 0; i < message.librarySettings.length; ++i) { + var error = $root.google.api.ClientLibrarySettings.verify(message.librarySettings[i]); + if (error) + return "librarySettings." + error; + } + } + if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) + if (!$util.isString(message.protoReferenceDocumentationUri)) + return "protoReferenceDocumentationUri: string expected"; + if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) + if (!$util.isString(message.restReferenceDocumentationUri)) + return "restReferenceDocumentationUri: string expected"; + return null; + }; + + /** + * Creates a Publishing message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Publishing + * @static + * @param {Object.} object Plain object + * @returns {google.api.Publishing} Publishing + */ + Publishing.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Publishing) + return object; + var message = new $root.google.api.Publishing(); + if (object.methodSettings) { + if (!Array.isArray(object.methodSettings)) + throw TypeError(".google.api.Publishing.methodSettings: array expected"); + message.methodSettings = []; + for (var i = 0; i < object.methodSettings.length; ++i) { + if (typeof object.methodSettings[i] !== "object") + throw TypeError(".google.api.Publishing.methodSettings: object expected"); + message.methodSettings[i] = $root.google.api.MethodSettings.fromObject(object.methodSettings[i]); + } + } + if (object.newIssueUri != null) + message.newIssueUri = String(object.newIssueUri); + if (object.documentationUri != null) + message.documentationUri = String(object.documentationUri); + if (object.apiShortName != null) + message.apiShortName = String(object.apiShortName); + if (object.githubLabel != null) + message.githubLabel = String(object.githubLabel); + if (object.codeownerGithubTeams) { + if (!Array.isArray(object.codeownerGithubTeams)) + throw TypeError(".google.api.Publishing.codeownerGithubTeams: array expected"); + message.codeownerGithubTeams = []; + for (var i = 0; i < object.codeownerGithubTeams.length; ++i) + message.codeownerGithubTeams[i] = String(object.codeownerGithubTeams[i]); + } + if (object.docTagPrefix != null) + message.docTagPrefix = String(object.docTagPrefix); + switch (object.organization) { + default: + if (typeof object.organization === "number") { + message.organization = object.organization; + break; + } + break; + case "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": + case 0: + message.organization = 0; + break; + case "CLOUD": + case 1: + message.organization = 1; + break; + case "ADS": + case 2: + message.organization = 2; + break; + case "PHOTOS": + case 3: + message.organization = 3; + break; + case "STREET_VIEW": + case 4: + message.organization = 4; + break; + case "SHOPPING": + case 5: + message.organization = 5; + break; + case "GEO": + case 6: + message.organization = 6; + break; + case "GENERATIVE_AI": + case 7: + message.organization = 7; + break; + } + if (object.librarySettings) { + if (!Array.isArray(object.librarySettings)) + throw TypeError(".google.api.Publishing.librarySettings: array expected"); + message.librarySettings = []; + for (var i = 0; i < object.librarySettings.length; ++i) { + if (typeof object.librarySettings[i] !== "object") + throw TypeError(".google.api.Publishing.librarySettings: object expected"); + message.librarySettings[i] = $root.google.api.ClientLibrarySettings.fromObject(object.librarySettings[i]); + } + } + if (object.protoReferenceDocumentationUri != null) + message.protoReferenceDocumentationUri = String(object.protoReferenceDocumentationUri); + if (object.restReferenceDocumentationUri != null) + message.restReferenceDocumentationUri = String(object.restReferenceDocumentationUri); + return message; + }; + + /** + * Creates a plain object from a Publishing message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Publishing + * @static + * @param {google.api.Publishing} message Publishing + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Publishing.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.methodSettings = []; + object.codeownerGithubTeams = []; + object.librarySettings = []; + } + if (options.defaults) { + object.newIssueUri = ""; + object.documentationUri = ""; + object.apiShortName = ""; + object.githubLabel = ""; + object.docTagPrefix = ""; + object.organization = options.enums === String ? "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED" : 0; + object.protoReferenceDocumentationUri = ""; + object.restReferenceDocumentationUri = ""; + } + if (message.methodSettings && message.methodSettings.length) { + object.methodSettings = []; + for (var j = 0; j < message.methodSettings.length; ++j) + object.methodSettings[j] = $root.google.api.MethodSettings.toObject(message.methodSettings[j], options); + } + if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) + object.newIssueUri = message.newIssueUri; + if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) + object.documentationUri = message.documentationUri; + if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) + object.apiShortName = message.apiShortName; + if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) + object.githubLabel = message.githubLabel; + if (message.codeownerGithubTeams && message.codeownerGithubTeams.length) { + object.codeownerGithubTeams = []; + for (var j = 0; j < message.codeownerGithubTeams.length; ++j) + object.codeownerGithubTeams[j] = message.codeownerGithubTeams[j]; + } + if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) + object.docTagPrefix = message.docTagPrefix; + if (message.organization != null && message.hasOwnProperty("organization")) + object.organization = options.enums === String ? $root.google.api.ClientLibraryOrganization[message.organization] === undefined ? message.organization : $root.google.api.ClientLibraryOrganization[message.organization] : message.organization; + if (message.librarySettings && message.librarySettings.length) { + object.librarySettings = []; + for (var j = 0; j < message.librarySettings.length; ++j) + object.librarySettings[j] = $root.google.api.ClientLibrarySettings.toObject(message.librarySettings[j], options); + } + if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) + object.protoReferenceDocumentationUri = message.protoReferenceDocumentationUri; + if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) + object.restReferenceDocumentationUri = message.restReferenceDocumentationUri; + return object; + }; + + /** + * Converts this Publishing to JSON. + * @function toJSON + * @memberof google.api.Publishing + * @instance + * @returns {Object.} JSON object + */ + Publishing.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Publishing + * @function getTypeUrl + * @memberof google.api.Publishing + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Publishing.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Publishing"; + }; + + return Publishing; + })(); + + api.JavaSettings = (function() { + + /** + * Properties of a JavaSettings. + * @memberof google.api + * @interface IJavaSettings + * @property {string|null} [libraryPackage] JavaSettings libraryPackage + * @property {Object.|null} [serviceClassNames] JavaSettings serviceClassNames + * @property {google.api.ICommonLanguageSettings|null} [common] JavaSettings common + */ + + /** + * Constructs a new JavaSettings. + * @memberof google.api + * @classdesc Represents a JavaSettings. + * @implements IJavaSettings + * @constructor + * @param {google.api.IJavaSettings=} [properties] Properties to set + */ + function JavaSettings(properties) { + this.serviceClassNames = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * JavaSettings libraryPackage. + * @member {string} libraryPackage + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.libraryPackage = ""; + + /** + * JavaSettings serviceClassNames. + * @member {Object.} serviceClassNames + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.serviceClassNames = $util.emptyObject; + + /** + * JavaSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.common = null; + + /** + * Creates a new JavaSettings instance using the specified properties. + * @function create + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings=} [properties] Properties to set + * @returns {google.api.JavaSettings} JavaSettings instance + */ + JavaSettings.create = function create(properties) { + return new JavaSettings(properties); + }; + + /** + * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @function encode + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JavaSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.libraryPackage != null && Object.hasOwnProperty.call(message, "libraryPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.libraryPackage); + if (message.serviceClassNames != null && Object.hasOwnProperty.call(message, "serviceClassNames")) + for (var keys = Object.keys(message.serviceClassNames), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.serviceClassNames[keys[i]]).ldelim(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JavaSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a JavaSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.JavaSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.JavaSettings} JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JavaSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.JavaSettings(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.libraryPackage = reader.string(); + break; + } + case 2: { + if (message.serviceClassNames === $util.emptyObject) + message.serviceClassNames = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.serviceClassNames[key] = value; + break; + } + case 3: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a JavaSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.JavaSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.JavaSettings} JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JavaSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JavaSettings message. + * @function verify + * @memberof google.api.JavaSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JavaSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) + if (!$util.isString(message.libraryPackage)) + return "libraryPackage: string expected"; + if (message.serviceClassNames != null && message.hasOwnProperty("serviceClassNames")) { + if (!$util.isObject(message.serviceClassNames)) + return "serviceClassNames: object expected"; + var key = Object.keys(message.serviceClassNames); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.serviceClassNames[key[i]])) + return "serviceClassNames: string{k:string} expected"; + } + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.JavaSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.JavaSettings} JavaSettings + */ + JavaSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.JavaSettings) + return object; + var message = new $root.google.api.JavaSettings(); + if (object.libraryPackage != null) + message.libraryPackage = String(object.libraryPackage); + if (object.serviceClassNames) { + if (typeof object.serviceClassNames !== "object") + throw TypeError(".google.api.JavaSettings.serviceClassNames: object expected"); + message.serviceClassNames = {}; + for (var keys = Object.keys(object.serviceClassNames), i = 0; i < keys.length; ++i) + message.serviceClassNames[keys[i]] = String(object.serviceClassNames[keys[i]]); + } + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.JavaSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.JavaSettings + * @static + * @param {google.api.JavaSettings} message JavaSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JavaSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.serviceClassNames = {}; + if (options.defaults) { + object.libraryPackage = ""; + object.common = null; + } + if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) + object.libraryPackage = message.libraryPackage; + var keys2; + if (message.serviceClassNames && (keys2 = Object.keys(message.serviceClassNames)).length) { + object.serviceClassNames = {}; + for (var j = 0; j < keys2.length; ++j) + object.serviceClassNames[keys2[j]] = message.serviceClassNames[keys2[j]]; + } + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this JavaSettings to JSON. + * @function toJSON + * @memberof google.api.JavaSettings + * @instance + * @returns {Object.} JSON object + */ + JavaSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JavaSettings + * @function getTypeUrl + * @memberof google.api.JavaSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JavaSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.JavaSettings"; + }; + + return JavaSettings; + })(); + + api.CppSettings = (function() { + + /** + * Properties of a CppSettings. + * @memberof google.api + * @interface ICppSettings + * @property {google.api.ICommonLanguageSettings|null} [common] CppSettings common + */ + + /** + * Constructs a new CppSettings. + * @memberof google.api + * @classdesc Represents a CppSettings. + * @implements ICppSettings + * @constructor + * @param {google.api.ICppSettings=} [properties] Properties to set + */ + function CppSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CppSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.CppSettings + * @instance + */ + CppSettings.prototype.common = null; + + /** + * Creates a new CppSettings instance using the specified properties. + * @function create + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings=} [properties] Properties to set + * @returns {google.api.CppSettings} CppSettings instance + */ + CppSettings.create = function create(properties) { + return new CppSettings(properties); + }; + + /** + * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @function encode + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings} message CppSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CppSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings} message CppSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CppSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CppSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.CppSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CppSettings} CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CppSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CppSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CppSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CppSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CppSettings} CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CppSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CppSettings message. + * @function verify + * @memberof google.api.CppSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CppSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CppSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.CppSettings} CppSettings + */ + CppSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CppSettings) + return object; + var message = new $root.google.api.CppSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.CppSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a CppSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CppSettings + * @static + * @param {google.api.CppSettings} message CppSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CppSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this CppSettings to JSON. + * @function toJSON + * @memberof google.api.CppSettings + * @instance + * @returns {Object.} JSON object + */ + CppSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CppSettings + * @function getTypeUrl + * @memberof google.api.CppSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CppSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CppSettings"; + }; + + return CppSettings; + })(); + + api.PhpSettings = (function() { + + /** + * Properties of a PhpSettings. + * @memberof google.api + * @interface IPhpSettings + * @property {google.api.ICommonLanguageSettings|null} [common] PhpSettings common + */ + + /** + * Constructs a new PhpSettings. + * @memberof google.api + * @classdesc Represents a PhpSettings. + * @implements IPhpSettings + * @constructor + * @param {google.api.IPhpSettings=} [properties] Properties to set + */ + function PhpSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PhpSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.PhpSettings + * @instance + */ + PhpSettings.prototype.common = null; + + /** + * Creates a new PhpSettings instance using the specified properties. + * @function create + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings=} [properties] Properties to set + * @returns {google.api.PhpSettings} PhpSettings instance + */ + PhpSettings.create = function create(properties) { + return new PhpSettings(properties); + }; + + /** + * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @function encode + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PhpSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PhpSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PhpSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.PhpSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PhpSettings} PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PhpSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PhpSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PhpSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PhpSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PhpSettings} PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PhpSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PhpSettings message. + * @function verify + * @memberof google.api.PhpSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PhpSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PhpSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.PhpSettings} PhpSettings + */ + PhpSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.PhpSettings) + return object; + var message = new $root.google.api.PhpSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.PhpSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PhpSettings + * @static + * @param {google.api.PhpSettings} message PhpSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PhpSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this PhpSettings to JSON. + * @function toJSON + * @memberof google.api.PhpSettings + * @instance + * @returns {Object.} JSON object + */ + PhpSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PhpSettings + * @function getTypeUrl + * @memberof google.api.PhpSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PhpSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PhpSettings"; + }; + + return PhpSettings; + })(); + + api.PythonSettings = (function() { + + /** + * Properties of a PythonSettings. + * @memberof google.api + * @interface IPythonSettings + * @property {google.api.ICommonLanguageSettings|null} [common] PythonSettings common + */ + + /** + * Constructs a new PythonSettings. + * @memberof google.api + * @classdesc Represents a PythonSettings. + * @implements IPythonSettings + * @constructor + * @param {google.api.IPythonSettings=} [properties] Properties to set + */ + function PythonSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PythonSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.PythonSettings + * @instance + */ + PythonSettings.prototype.common = null; + + /** + * Creates a new PythonSettings instance using the specified properties. + * @function create + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings=} [properties] Properties to set + * @returns {google.api.PythonSettings} PythonSettings instance + */ + PythonSettings.create = function create(properties) { + return new PythonSettings(properties); + }; + + /** + * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @function encode + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PythonSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PythonSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PythonSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.PythonSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PythonSettings} PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PythonSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PythonSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PythonSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PythonSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PythonSettings} PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PythonSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PythonSettings message. + * @function verify + * @memberof google.api.PythonSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PythonSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PythonSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.PythonSettings} PythonSettings + */ + PythonSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.PythonSettings) + return object; + var message = new $root.google.api.PythonSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.PythonSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PythonSettings + * @static + * @param {google.api.PythonSettings} message PythonSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PythonSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this PythonSettings to JSON. + * @function toJSON + * @memberof google.api.PythonSettings + * @instance + * @returns {Object.} JSON object + */ + PythonSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PythonSettings + * @function getTypeUrl + * @memberof google.api.PythonSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PythonSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PythonSettings"; + }; + + return PythonSettings; + })(); + + api.NodeSettings = (function() { + + /** + * Properties of a NodeSettings. + * @memberof google.api + * @interface INodeSettings + * @property {google.api.ICommonLanguageSettings|null} [common] NodeSettings common + */ + + /** + * Constructs a new NodeSettings. + * @memberof google.api + * @classdesc Represents a NodeSettings. + * @implements INodeSettings + * @constructor + * @param {google.api.INodeSettings=} [properties] Properties to set + */ + function NodeSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NodeSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.NodeSettings + * @instance + */ + NodeSettings.prototype.common = null; + + /** + * Creates a new NodeSettings instance using the specified properties. + * @function create + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings=} [properties] Properties to set + * @returns {google.api.NodeSettings} NodeSettings instance + */ + NodeSettings.create = function create(properties) { + return new NodeSettings(properties); + }; + + /** + * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @function encode + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NodeSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.NodeSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.NodeSettings} NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.NodeSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NodeSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.NodeSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.NodeSettings} NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NodeSettings message. + * @function verify + * @memberof google.api.NodeSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NodeSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.NodeSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.NodeSettings} NodeSettings + */ + NodeSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.NodeSettings) + return object; + var message = new $root.google.api.NodeSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.NodeSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.NodeSettings + * @static + * @param {google.api.NodeSettings} message NodeSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NodeSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this NodeSettings to JSON. + * @function toJSON + * @memberof google.api.NodeSettings + * @instance + * @returns {Object.} JSON object + */ + NodeSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NodeSettings + * @function getTypeUrl + * @memberof google.api.NodeSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.NodeSettings"; + }; + + return NodeSettings; + })(); + + api.DotnetSettings = (function() { + + /** + * Properties of a DotnetSettings. + * @memberof google.api + * @interface IDotnetSettings + * @property {google.api.ICommonLanguageSettings|null} [common] DotnetSettings common + * @property {Object.|null} [renamedServices] DotnetSettings renamedServices + * @property {Object.|null} [renamedResources] DotnetSettings renamedResources + * @property {Array.|null} [ignoredResources] DotnetSettings ignoredResources + * @property {Array.|null} [forcedNamespaceAliases] DotnetSettings forcedNamespaceAliases + * @property {Array.|null} [handwrittenSignatures] DotnetSettings handwrittenSignatures + */ + + /** + * Constructs a new DotnetSettings. + * @memberof google.api + * @classdesc Represents a DotnetSettings. + * @implements IDotnetSettings + * @constructor + * @param {google.api.IDotnetSettings=} [properties] Properties to set + */ + function DotnetSettings(properties) { + this.renamedServices = {}; + this.renamedResources = {}; + this.ignoredResources = []; + this.forcedNamespaceAliases = []; + this.handwrittenSignatures = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DotnetSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.common = null; + + /** + * DotnetSettings renamedServices. + * @member {Object.} renamedServices + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.renamedServices = $util.emptyObject; + + /** + * DotnetSettings renamedResources. + * @member {Object.} renamedResources + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.renamedResources = $util.emptyObject; + + /** + * DotnetSettings ignoredResources. + * @member {Array.} ignoredResources + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.ignoredResources = $util.emptyArray; + + /** + * DotnetSettings forcedNamespaceAliases. + * @member {Array.} forcedNamespaceAliases + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.forcedNamespaceAliases = $util.emptyArray; + + /** + * DotnetSettings handwrittenSignatures. + * @member {Array.} handwrittenSignatures + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.handwrittenSignatures = $util.emptyArray; + + /** + * Creates a new DotnetSettings instance using the specified properties. + * @function create + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings=} [properties] Properties to set + * @returns {google.api.DotnetSettings} DotnetSettings instance + */ + DotnetSettings.create = function create(properties) { + return new DotnetSettings(properties); + }; + + /** + * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @function encode + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DotnetSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.renamedServices != null && Object.hasOwnProperty.call(message, "renamedServices")) + for (var keys = Object.keys(message.renamedServices), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedServices[keys[i]]).ldelim(); + if (message.renamedResources != null && Object.hasOwnProperty.call(message, "renamedResources")) + for (var keys = Object.keys(message.renamedResources), i = 0; i < keys.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedResources[keys[i]]).ldelim(); + if (message.ignoredResources != null && message.ignoredResources.length) + for (var i = 0; i < message.ignoredResources.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.ignoredResources[i]); + if (message.forcedNamespaceAliases != null && message.forcedNamespaceAliases.length) + for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.forcedNamespaceAliases[i]); + if (message.handwrittenSignatures != null && message.handwrittenSignatures.length) + for (var i = 0; i < message.handwrittenSignatures.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.handwrittenSignatures[i]); + return writer; + }; + + /** + * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DotnetSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.DotnetSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.DotnetSettings} DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DotnetSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.DotnetSettings(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + case 2: { + if (message.renamedServices === $util.emptyObject) + message.renamedServices = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.renamedServices[key] = value; + break; + } + case 3: { + if (message.renamedResources === $util.emptyObject) + message.renamedResources = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.renamedResources[key] = value; + break; + } + case 4: { + if (!(message.ignoredResources && message.ignoredResources.length)) + message.ignoredResources = []; + message.ignoredResources.push(reader.string()); + break; + } + case 5: { + if (!(message.forcedNamespaceAliases && message.forcedNamespaceAliases.length)) + message.forcedNamespaceAliases = []; + message.forcedNamespaceAliases.push(reader.string()); + break; + } + case 6: { + if (!(message.handwrittenSignatures && message.handwrittenSignatures.length)) + message.handwrittenSignatures = []; + message.handwrittenSignatures.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.DotnetSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.DotnetSettings} DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DotnetSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DotnetSettings message. + * @function verify + * @memberof google.api.DotnetSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DotnetSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + if (message.renamedServices != null && message.hasOwnProperty("renamedServices")) { + if (!$util.isObject(message.renamedServices)) + return "renamedServices: object expected"; + var key = Object.keys(message.renamedServices); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.renamedServices[key[i]])) + return "renamedServices: string{k:string} expected"; + } + if (message.renamedResources != null && message.hasOwnProperty("renamedResources")) { + if (!$util.isObject(message.renamedResources)) + return "renamedResources: object expected"; + var key = Object.keys(message.renamedResources); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.renamedResources[key[i]])) + return "renamedResources: string{k:string} expected"; + } + if (message.ignoredResources != null && message.hasOwnProperty("ignoredResources")) { + if (!Array.isArray(message.ignoredResources)) + return "ignoredResources: array expected"; + for (var i = 0; i < message.ignoredResources.length; ++i) + if (!$util.isString(message.ignoredResources[i])) + return "ignoredResources: string[] expected"; + } + if (message.forcedNamespaceAliases != null && message.hasOwnProperty("forcedNamespaceAliases")) { + if (!Array.isArray(message.forcedNamespaceAliases)) + return "forcedNamespaceAliases: array expected"; + for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) + if (!$util.isString(message.forcedNamespaceAliases[i])) + return "forcedNamespaceAliases: string[] expected"; + } + if (message.handwrittenSignatures != null && message.hasOwnProperty("handwrittenSignatures")) { + if (!Array.isArray(message.handwrittenSignatures)) + return "handwrittenSignatures: array expected"; + for (var i = 0; i < message.handwrittenSignatures.length; ++i) + if (!$util.isString(message.handwrittenSignatures[i])) + return "handwrittenSignatures: string[] expected"; + } + return null; + }; + + /** + * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.DotnetSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.DotnetSettings} DotnetSettings + */ + DotnetSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.DotnetSettings) + return object; + var message = new $root.google.api.DotnetSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.DotnetSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + if (object.renamedServices) { + if (typeof object.renamedServices !== "object") + throw TypeError(".google.api.DotnetSettings.renamedServices: object expected"); + message.renamedServices = {}; + for (var keys = Object.keys(object.renamedServices), i = 0; i < keys.length; ++i) + message.renamedServices[keys[i]] = String(object.renamedServices[keys[i]]); + } + if (object.renamedResources) { + if (typeof object.renamedResources !== "object") + throw TypeError(".google.api.DotnetSettings.renamedResources: object expected"); + message.renamedResources = {}; + for (var keys = Object.keys(object.renamedResources), i = 0; i < keys.length; ++i) + message.renamedResources[keys[i]] = String(object.renamedResources[keys[i]]); + } + if (object.ignoredResources) { + if (!Array.isArray(object.ignoredResources)) + throw TypeError(".google.api.DotnetSettings.ignoredResources: array expected"); + message.ignoredResources = []; + for (var i = 0; i < object.ignoredResources.length; ++i) + message.ignoredResources[i] = String(object.ignoredResources[i]); + } + if (object.forcedNamespaceAliases) { + if (!Array.isArray(object.forcedNamespaceAliases)) + throw TypeError(".google.api.DotnetSettings.forcedNamespaceAliases: array expected"); + message.forcedNamespaceAliases = []; + for (var i = 0; i < object.forcedNamespaceAliases.length; ++i) + message.forcedNamespaceAliases[i] = String(object.forcedNamespaceAliases[i]); + } + if (object.handwrittenSignatures) { + if (!Array.isArray(object.handwrittenSignatures)) + throw TypeError(".google.api.DotnetSettings.handwrittenSignatures: array expected"); + message.handwrittenSignatures = []; + for (var i = 0; i < object.handwrittenSignatures.length; ++i) + message.handwrittenSignatures[i] = String(object.handwrittenSignatures[i]); + } + return message; + }; + + /** + * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.DotnetSettings} message DotnetSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DotnetSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.ignoredResources = []; + object.forcedNamespaceAliases = []; + object.handwrittenSignatures = []; + } + if (options.objects || options.defaults) { + object.renamedServices = {}; + object.renamedResources = {}; + } + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + var keys2; + if (message.renamedServices && (keys2 = Object.keys(message.renamedServices)).length) { + object.renamedServices = {}; + for (var j = 0; j < keys2.length; ++j) + object.renamedServices[keys2[j]] = message.renamedServices[keys2[j]]; + } + if (message.renamedResources && (keys2 = Object.keys(message.renamedResources)).length) { + object.renamedResources = {}; + for (var j = 0; j < keys2.length; ++j) + object.renamedResources[keys2[j]] = message.renamedResources[keys2[j]]; + } + if (message.ignoredResources && message.ignoredResources.length) { + object.ignoredResources = []; + for (var j = 0; j < message.ignoredResources.length; ++j) + object.ignoredResources[j] = message.ignoredResources[j]; + } + if (message.forcedNamespaceAliases && message.forcedNamespaceAliases.length) { + object.forcedNamespaceAliases = []; + for (var j = 0; j < message.forcedNamespaceAliases.length; ++j) + object.forcedNamespaceAliases[j] = message.forcedNamespaceAliases[j]; + } + if (message.handwrittenSignatures && message.handwrittenSignatures.length) { + object.handwrittenSignatures = []; + for (var j = 0; j < message.handwrittenSignatures.length; ++j) + object.handwrittenSignatures[j] = message.handwrittenSignatures[j]; + } + return object; + }; + + /** + * Converts this DotnetSettings to JSON. + * @function toJSON + * @memberof google.api.DotnetSettings + * @instance + * @returns {Object.} JSON object + */ + DotnetSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DotnetSettings + * @function getTypeUrl + * @memberof google.api.DotnetSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DotnetSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.DotnetSettings"; + }; + + return DotnetSettings; + })(); + + api.RubySettings = (function() { + + /** + * Properties of a RubySettings. + * @memberof google.api + * @interface IRubySettings + * @property {google.api.ICommonLanguageSettings|null} [common] RubySettings common + */ + + /** + * Constructs a new RubySettings. + * @memberof google.api + * @classdesc Represents a RubySettings. + * @implements IRubySettings + * @constructor + * @param {google.api.IRubySettings=} [properties] Properties to set + */ + function RubySettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RubySettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.RubySettings + * @instance + */ + RubySettings.prototype.common = null; + + /** + * Creates a new RubySettings instance using the specified properties. + * @function create + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings=} [properties] Properties to set + * @returns {google.api.RubySettings} RubySettings instance + */ + RubySettings.create = function create(properties) { + return new RubySettings(properties); + }; + + /** + * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @function encode + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings} message RubySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RubySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings} message RubySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RubySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RubySettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.RubySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.RubySettings} RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RubySettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.RubySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RubySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.RubySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.RubySettings} RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RubySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RubySettings message. + * @function verify + * @memberof google.api.RubySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RubySettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.RubySettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.RubySettings} RubySettings + */ + RubySettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.RubySettings) + return object; + var message = new $root.google.api.RubySettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.RubySettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a RubySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.RubySettings + * @static + * @param {google.api.RubySettings} message RubySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RubySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this RubySettings to JSON. + * @function toJSON + * @memberof google.api.RubySettings + * @instance + * @returns {Object.} JSON object + */ + RubySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RubySettings + * @function getTypeUrl + * @memberof google.api.RubySettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RubySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.RubySettings"; + }; + + return RubySettings; + })(); + + api.GoSettings = (function() { + + /** + * Properties of a GoSettings. + * @memberof google.api + * @interface IGoSettings + * @property {google.api.ICommonLanguageSettings|null} [common] GoSettings common + */ + + /** + * Constructs a new GoSettings. + * @memberof google.api + * @classdesc Represents a GoSettings. + * @implements IGoSettings + * @constructor + * @param {google.api.IGoSettings=} [properties] Properties to set + */ + function GoSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GoSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.GoSettings + * @instance + */ + GoSettings.prototype.common = null; + + /** + * Creates a new GoSettings instance using the specified properties. + * @function create + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings=} [properties] Properties to set + * @returns {google.api.GoSettings} GoSettings instance + */ + GoSettings.create = function create(properties) { + return new GoSettings(properties); + }; + + /** + * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @function encode + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings} message GoSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings} message GoSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GoSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.GoSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.GoSettings} GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.GoSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GoSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.GoSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.GoSettings} GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GoSettings message. + * @function verify + * @memberof google.api.GoSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GoSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.GoSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.GoSettings} GoSettings + */ + GoSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.GoSettings) + return object; + var message = new $root.google.api.GoSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.GoSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a GoSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.GoSettings + * @static + * @param {google.api.GoSettings} message GoSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GoSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this GoSettings to JSON. + * @function toJSON + * @memberof google.api.GoSettings + * @instance + * @returns {Object.} JSON object + */ + GoSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GoSettings + * @function getTypeUrl + * @memberof google.api.GoSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GoSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.GoSettings"; + }; + + return GoSettings; + })(); + + api.MethodSettings = (function() { + + /** + * Properties of a MethodSettings. + * @memberof google.api + * @interface IMethodSettings + * @property {string|null} [selector] MethodSettings selector + * @property {google.api.MethodSettings.ILongRunning|null} [longRunning] MethodSettings longRunning + * @property {Array.|null} [autoPopulatedFields] MethodSettings autoPopulatedFields + */ + + /** + * Constructs a new MethodSettings. + * @memberof google.api + * @classdesc Represents a MethodSettings. + * @implements IMethodSettings + * @constructor + * @param {google.api.IMethodSettings=} [properties] Properties to set + */ + function MethodSettings(properties) { + this.autoPopulatedFields = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodSettings selector. + * @member {string} selector + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.selector = ""; + + /** + * MethodSettings longRunning. + * @member {google.api.MethodSettings.ILongRunning|null|undefined} longRunning + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.longRunning = null; + + /** + * MethodSettings autoPopulatedFields. + * @member {Array.} autoPopulatedFields + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.autoPopulatedFields = $util.emptyArray; + + /** + * Creates a new MethodSettings instance using the specified properties. + * @function create + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings=} [properties] Properties to set + * @returns {google.api.MethodSettings} MethodSettings instance + */ + MethodSettings.create = function create(properties) { + return new MethodSettings(properties); + }; + + /** + * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @function encode + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.longRunning != null && Object.hasOwnProperty.call(message, "longRunning")) + $root.google.api.MethodSettings.LongRunning.encode(message.longRunning, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.autoPopulatedFields != null && message.autoPopulatedFields.length) + for (var i = 0; i < message.autoPopulatedFields.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.autoPopulatedFields[i]); + return writer; + }; + + /** + * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.MethodSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.MethodSettings} MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.longRunning = $root.google.api.MethodSettings.LongRunning.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.autoPopulatedFields && message.autoPopulatedFields.length)) + message.autoPopulatedFields = []; + message.autoPopulatedFields.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.MethodSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.MethodSettings} MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodSettings message. + * @function verify + * @memberof google.api.MethodSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.longRunning != null && message.hasOwnProperty("longRunning")) { + var error = $root.google.api.MethodSettings.LongRunning.verify(message.longRunning); + if (error) + return "longRunning." + error; + } + if (message.autoPopulatedFields != null && message.hasOwnProperty("autoPopulatedFields")) { + if (!Array.isArray(message.autoPopulatedFields)) + return "autoPopulatedFields: array expected"; + for (var i = 0; i < message.autoPopulatedFields.length; ++i) + if (!$util.isString(message.autoPopulatedFields[i])) + return "autoPopulatedFields: string[] expected"; + } + return null; + }; + + /** + * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.MethodSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.MethodSettings} MethodSettings + */ + MethodSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.MethodSettings) + return object; + var message = new $root.google.api.MethodSettings(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.longRunning != null) { + if (typeof object.longRunning !== "object") + throw TypeError(".google.api.MethodSettings.longRunning: object expected"); + message.longRunning = $root.google.api.MethodSettings.LongRunning.fromObject(object.longRunning); + } + if (object.autoPopulatedFields) { + if (!Array.isArray(object.autoPopulatedFields)) + throw TypeError(".google.api.MethodSettings.autoPopulatedFields: array expected"); + message.autoPopulatedFields = []; + for (var i = 0; i < object.autoPopulatedFields.length; ++i) + message.autoPopulatedFields[i] = String(object.autoPopulatedFields[i]); + } + return message; + }; + + /** + * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.MethodSettings + * @static + * @param {google.api.MethodSettings} message MethodSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.autoPopulatedFields = []; + if (options.defaults) { + object.selector = ""; + object.longRunning = null; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.longRunning != null && message.hasOwnProperty("longRunning")) + object.longRunning = $root.google.api.MethodSettings.LongRunning.toObject(message.longRunning, options); + if (message.autoPopulatedFields && message.autoPopulatedFields.length) { + object.autoPopulatedFields = []; + for (var j = 0; j < message.autoPopulatedFields.length; ++j) + object.autoPopulatedFields[j] = message.autoPopulatedFields[j]; + } + return object; + }; + + /** + * Converts this MethodSettings to JSON. + * @function toJSON + * @memberof google.api.MethodSettings + * @instance + * @returns {Object.} JSON object + */ + MethodSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodSettings + * @function getTypeUrl + * @memberof google.api.MethodSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.MethodSettings"; + }; + + MethodSettings.LongRunning = (function() { + + /** + * Properties of a LongRunning. + * @memberof google.api.MethodSettings + * @interface ILongRunning + * @property {google.protobuf.IDuration|null} [initialPollDelay] LongRunning initialPollDelay + * @property {number|null} [pollDelayMultiplier] LongRunning pollDelayMultiplier + * @property {google.protobuf.IDuration|null} [maxPollDelay] LongRunning maxPollDelay + * @property {google.protobuf.IDuration|null} [totalPollTimeout] LongRunning totalPollTimeout + */ + + /** + * Constructs a new LongRunning. + * @memberof google.api.MethodSettings + * @classdesc Represents a LongRunning. + * @implements ILongRunning + * @constructor + * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set + */ + function LongRunning(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LongRunning initialPollDelay. + * @member {google.protobuf.IDuration|null|undefined} initialPollDelay + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.initialPollDelay = null; + + /** + * LongRunning pollDelayMultiplier. + * @member {number} pollDelayMultiplier + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.pollDelayMultiplier = 0; + + /** + * LongRunning maxPollDelay. + * @member {google.protobuf.IDuration|null|undefined} maxPollDelay + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.maxPollDelay = null; + + /** + * LongRunning totalPollTimeout. + * @member {google.protobuf.IDuration|null|undefined} totalPollTimeout + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.totalPollTimeout = null; + + /** + * Creates a new LongRunning instance using the specified properties. + * @function create + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set + * @returns {google.api.MethodSettings.LongRunning} LongRunning instance + */ + LongRunning.create = function create(properties) { + return new LongRunning(properties); + }; + + /** + * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @function encode + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunning.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.initialPollDelay != null && Object.hasOwnProperty.call(message, "initialPollDelay")) + $root.google.protobuf.Duration.encode(message.initialPollDelay, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pollDelayMultiplier != null && Object.hasOwnProperty.call(message, "pollDelayMultiplier")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.pollDelayMultiplier); + if (message.maxPollDelay != null && Object.hasOwnProperty.call(message, "maxPollDelay")) + $root.google.protobuf.Duration.encode(message.maxPollDelay, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.totalPollTimeout != null && Object.hasOwnProperty.call(message, "totalPollTimeout")) + $root.google.protobuf.Duration.encode(message.totalPollTimeout, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunning.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LongRunning message from the specified reader or buffer. + * @function decode + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.MethodSettings.LongRunning} LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunning.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings.LongRunning(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.initialPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 2: { + message.pollDelayMultiplier = reader.float(); + break; + } + case 3: { + message.maxPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 4: { + message.totalPollTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LongRunning message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.MethodSettings.LongRunning} LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunning.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LongRunning message. + * @function verify + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LongRunning.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) { + var error = $root.google.protobuf.Duration.verify(message.initialPollDelay); + if (error) + return "initialPollDelay." + error; + } + if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) + if (typeof message.pollDelayMultiplier !== "number") + return "pollDelayMultiplier: number expected"; + if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) { + var error = $root.google.protobuf.Duration.verify(message.maxPollDelay); + if (error) + return "maxPollDelay." + error; + } + if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) { + var error = $root.google.protobuf.Duration.verify(message.totalPollTimeout); + if (error) + return "totalPollTimeout." + error; + } + return null; + }; + + /** + * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {Object.} object Plain object + * @returns {google.api.MethodSettings.LongRunning} LongRunning + */ + LongRunning.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.MethodSettings.LongRunning) + return object; + var message = new $root.google.api.MethodSettings.LongRunning(); + if (object.initialPollDelay != null) { + if (typeof object.initialPollDelay !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.initialPollDelay: object expected"); + message.initialPollDelay = $root.google.protobuf.Duration.fromObject(object.initialPollDelay); + } + if (object.pollDelayMultiplier != null) + message.pollDelayMultiplier = Number(object.pollDelayMultiplier); + if (object.maxPollDelay != null) { + if (typeof object.maxPollDelay !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.maxPollDelay: object expected"); + message.maxPollDelay = $root.google.protobuf.Duration.fromObject(object.maxPollDelay); + } + if (object.totalPollTimeout != null) { + if (typeof object.totalPollTimeout !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.totalPollTimeout: object expected"); + message.totalPollTimeout = $root.google.protobuf.Duration.fromObject(object.totalPollTimeout); + } + return message; + }; + + /** + * Creates a plain object from a LongRunning message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.LongRunning} message LongRunning + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LongRunning.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.initialPollDelay = null; + object.pollDelayMultiplier = 0; + object.maxPollDelay = null; + object.totalPollTimeout = null; + } + if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) + object.initialPollDelay = $root.google.protobuf.Duration.toObject(message.initialPollDelay, options); + if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) + object.pollDelayMultiplier = options.json && !isFinite(message.pollDelayMultiplier) ? String(message.pollDelayMultiplier) : message.pollDelayMultiplier; + if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) + object.maxPollDelay = $root.google.protobuf.Duration.toObject(message.maxPollDelay, options); + if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) + object.totalPollTimeout = $root.google.protobuf.Duration.toObject(message.totalPollTimeout, options); + return object; + }; + + /** + * Converts this LongRunning to JSON. + * @function toJSON + * @memberof google.api.MethodSettings.LongRunning + * @instance + * @returns {Object.} JSON object + */ + LongRunning.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LongRunning + * @function getTypeUrl + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LongRunning.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.MethodSettings.LongRunning"; + }; + + return LongRunning; + })(); + + return MethodSettings; + })(); + + /** + * ClientLibraryOrganization enum. + * @name google.api.ClientLibraryOrganization + * @enum {number} + * @property {number} CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED=0 CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED value + * @property {number} CLOUD=1 CLOUD value + * @property {number} ADS=2 ADS value + * @property {number} PHOTOS=3 PHOTOS value + * @property {number} STREET_VIEW=4 STREET_VIEW value + * @property {number} SHOPPING=5 SHOPPING value + * @property {number} GEO=6 GEO value + * @property {number} GENERATIVE_AI=7 GENERATIVE_AI value + */ + api.ClientLibraryOrganization = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED"] = 0; + values[valuesById[1] = "CLOUD"] = 1; + values[valuesById[2] = "ADS"] = 2; + values[valuesById[3] = "PHOTOS"] = 3; + values[valuesById[4] = "STREET_VIEW"] = 4; + values[valuesById[5] = "SHOPPING"] = 5; + values[valuesById[6] = "GEO"] = 6; + values[valuesById[7] = "GENERATIVE_AI"] = 7; + return values; + })(); + + /** + * ClientLibraryDestination enum. + * @name google.api.ClientLibraryDestination + * @enum {number} + * @property {number} CLIENT_LIBRARY_DESTINATION_UNSPECIFIED=0 CLIENT_LIBRARY_DESTINATION_UNSPECIFIED value + * @property {number} GITHUB=10 GITHUB value + * @property {number} PACKAGE_MANAGER=20 PACKAGE_MANAGER value + */ + api.ClientLibraryDestination = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED"] = 0; + values[valuesById[10] = "GITHUB"] = 10; + values[valuesById[20] = "PACKAGE_MANAGER"] = 20; + return values; + })(); + + /** + * LaunchStage enum. + * @name google.api.LaunchStage + * @enum {number} + * @property {number} LAUNCH_STAGE_UNSPECIFIED=0 LAUNCH_STAGE_UNSPECIFIED value + * @property {number} UNIMPLEMENTED=6 UNIMPLEMENTED value + * @property {number} PRELAUNCH=7 PRELAUNCH value + * @property {number} EARLY_ACCESS=1 EARLY_ACCESS value + * @property {number} ALPHA=2 ALPHA value + * @property {number} BETA=3 BETA value + * @property {number} GA=4 GA value + * @property {number} DEPRECATED=5 DEPRECATED value + */ + api.LaunchStage = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LAUNCH_STAGE_UNSPECIFIED"] = 0; + values[valuesById[6] = "UNIMPLEMENTED"] = 6; + values[valuesById[7] = "PRELAUNCH"] = 7; + values[valuesById[1] = "EARLY_ACCESS"] = 1; + values[valuesById[2] = "ALPHA"] = 2; + values[valuesById[3] = "BETA"] = 3; + values[valuesById[4] = "GA"] = 4; + values[valuesById[5] = "DEPRECATED"] = 5; + return values; + })(); + + api.ResourceDescriptor = (function() { + + /** + * Properties of a ResourceDescriptor. + * @memberof google.api + * @interface IResourceDescriptor + * @property {string|null} [type] ResourceDescriptor type + * @property {Array.|null} [pattern] ResourceDescriptor pattern + * @property {string|null} [nameField] ResourceDescriptor nameField + * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history + * @property {string|null} [plural] ResourceDescriptor plural + * @property {string|null} [singular] ResourceDescriptor singular + * @property {Array.|null} [style] ResourceDescriptor style + */ + + /** + * Constructs a new ResourceDescriptor. + * @memberof google.api + * @classdesc Represents a ResourceDescriptor. + * @implements IResourceDescriptor + * @constructor + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + */ + function ResourceDescriptor(properties) { + this.pattern = []; + this.style = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceDescriptor type. + * @member {string} type + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.type = ""; + + /** + * ResourceDescriptor pattern. + * @member {Array.} pattern + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.pattern = $util.emptyArray; + + /** + * ResourceDescriptor nameField. + * @member {string} nameField + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.nameField = ""; + + /** + * ResourceDescriptor history. + * @member {google.api.ResourceDescriptor.History} history + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.history = 0; + + /** + * ResourceDescriptor plural. + * @member {string} plural + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.plural = ""; + + /** + * ResourceDescriptor singular. + * @member {string} singular + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.singular = ""; + + /** + * ResourceDescriptor style. + * @member {Array.} style + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.style = $util.emptyArray; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @function create + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance + */ + ResourceDescriptor.create = function create(properties) { + return new ResourceDescriptor(properties); + }; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.pattern != null && message.pattern.length) + for (var i = 0; i < message.pattern.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pattern[i]); + if (message.nameField != null && Object.hasOwnProperty.call(message, "nameField")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); + if (message.history != null && Object.hasOwnProperty.call(message, "history")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); + if (message.plural != null && Object.hasOwnProperty.call(message, "plural")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); + if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); + if (message.style != null && message.style.length) { + writer.uint32(/* id 10, wireType 2 =*/82).fork(); + for (var i = 0; i < message.style.length; ++i) + writer.int32(message.style[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceDescriptor(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + if (!(message.pattern && message.pattern.length)) + message.pattern = []; + message.pattern.push(reader.string()); + break; + } + case 3: { + message.nameField = reader.string(); + break; + } + case 4: { + message.history = reader.int32(); + break; + } + case 5: { + message.plural = reader.string(); + break; + } + case 6: { + message.singular = reader.string(); + break; + } + case 10: { + if (!(message.style && message.style.length)) + message.style = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.style.push(reader.int32()); + } else + message.style.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceDescriptor message. + * @function verify + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceDescriptor.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.pattern != null && message.hasOwnProperty("pattern")) { + if (!Array.isArray(message.pattern)) + return "pattern: array expected"; + for (var i = 0; i < message.pattern.length; ++i) + if (!$util.isString(message.pattern[i])) + return "pattern: string[] expected"; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + if (!$util.isString(message.nameField)) + return "nameField: string expected"; + if (message.history != null && message.hasOwnProperty("history")) + switch (message.history) { + default: + return "history: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.plural != null && message.hasOwnProperty("plural")) + if (!$util.isString(message.plural)) + return "plural: string expected"; + if (message.singular != null && message.hasOwnProperty("singular")) + if (!$util.isString(message.singular)) + return "singular: string expected"; + if (message.style != null && message.hasOwnProperty("style")) { + if (!Array.isArray(message.style)) + return "style: array expected"; + for (var i = 0; i < message.style.length; ++i) + switch (message.style[i]) { + default: + return "style: enum value[] expected"; + case 0: + case 1: + break; + } + } + return null; + }; + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + */ + ResourceDescriptor.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceDescriptor) + return object; + var message = new $root.google.api.ResourceDescriptor(); + if (object.type != null) + message.type = String(object.type); + if (object.pattern) { + if (!Array.isArray(object.pattern)) + throw TypeError(".google.api.ResourceDescriptor.pattern: array expected"); + message.pattern = []; + for (var i = 0; i < object.pattern.length; ++i) + message.pattern[i] = String(object.pattern[i]); + } + if (object.nameField != null) + message.nameField = String(object.nameField); + switch (object.history) { + default: + if (typeof object.history === "number") { + message.history = object.history; + break; + } + break; + case "HISTORY_UNSPECIFIED": + case 0: + message.history = 0; + break; + case "ORIGINALLY_SINGLE_PATTERN": + case 1: + message.history = 1; + break; + case "FUTURE_MULTI_PATTERN": + case 2: + message.history = 2; + break; + } + if (object.plural != null) + message.plural = String(object.plural); + if (object.singular != null) + message.singular = String(object.singular); + if (object.style) { + if (!Array.isArray(object.style)) + throw TypeError(".google.api.ResourceDescriptor.style: array expected"); + message.style = []; + for (var i = 0; i < object.style.length; ++i) + switch (object.style[i]) { + default: + if (typeof object.style[i] === "number") { + message.style[i] = object.style[i]; + break; + } + case "STYLE_UNSPECIFIED": + case 0: + message.style[i] = 0; + break; + case "DECLARATIVE_FRIENDLY": + case 1: + message.style[i] = 1; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.ResourceDescriptor} message ResourceDescriptor + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceDescriptor.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.pattern = []; + object.style = []; + } + if (options.defaults) { + object.type = ""; + object.nameField = ""; + object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; + object.plural = ""; + object.singular = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.pattern && message.pattern.length) { + object.pattern = []; + for (var j = 0; j < message.pattern.length; ++j) + object.pattern[j] = message.pattern[j]; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + object.nameField = message.nameField; + if (message.history != null && message.hasOwnProperty("history")) + object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] === undefined ? message.history : $root.google.api.ResourceDescriptor.History[message.history] : message.history; + if (message.plural != null && message.hasOwnProperty("plural")) + object.plural = message.plural; + if (message.singular != null && message.hasOwnProperty("singular")) + object.singular = message.singular; + if (message.style && message.style.length) { + object.style = []; + for (var j = 0; j < message.style.length; ++j) + object.style[j] = options.enums === String ? $root.google.api.ResourceDescriptor.Style[message.style[j]] === undefined ? message.style[j] : $root.google.api.ResourceDescriptor.Style[message.style[j]] : message.style[j]; + } + return object; + }; + + /** + * Converts this ResourceDescriptor to JSON. + * @function toJSON + * @memberof google.api.ResourceDescriptor + * @instance + * @returns {Object.} JSON object + */ + ResourceDescriptor.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceDescriptor + * @function getTypeUrl + * @memberof google.api.ResourceDescriptor + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceDescriptor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceDescriptor"; + }; + + /** + * History enum. + * @name google.api.ResourceDescriptor.History + * @enum {number} + * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value + * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value + * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value + */ + ResourceDescriptor.History = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HISTORY_UNSPECIFIED"] = 0; + values[valuesById[1] = "ORIGINALLY_SINGLE_PATTERN"] = 1; + values[valuesById[2] = "FUTURE_MULTI_PATTERN"] = 2; + return values; + })(); + + /** + * Style enum. + * @name google.api.ResourceDescriptor.Style + * @enum {number} + * @property {number} STYLE_UNSPECIFIED=0 STYLE_UNSPECIFIED value + * @property {number} DECLARATIVE_FRIENDLY=1 DECLARATIVE_FRIENDLY value + */ + ResourceDescriptor.Style = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STYLE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DECLARATIVE_FRIENDLY"] = 1; + return values; + })(); + + return ResourceDescriptor; + })(); + + api.ResourceReference = (function() { + + /** + * Properties of a ResourceReference. + * @memberof google.api + * @interface IResourceReference + * @property {string|null} [type] ResourceReference type + * @property {string|null} [childType] ResourceReference childType + */ + + /** + * Constructs a new ResourceReference. + * @memberof google.api + * @classdesc Represents a ResourceReference. + * @implements IResourceReference + * @constructor + * @param {google.api.IResourceReference=} [properties] Properties to set + */ + function ResourceReference(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceReference type. + * @member {string} type + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.type = ""; + + /** + * ResourceReference childType. + * @member {string} childType + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.childType = ""; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @function create + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference=} [properties] Properties to set + * @returns {google.api.ResourceReference} ResourceReference instance + */ + ResourceReference.create = function create(properties) { + return new ResourceReference(properties); + }; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.childType != null && Object.hasOwnProperty.call(message, "childType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); + return writer; + }; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceReference(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + message.childType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceReference message. + * @function verify + * @memberof google.api.ResourceReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceReference.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.childType != null && message.hasOwnProperty("childType")) + if (!$util.isString(message.childType)) + return "childType: string expected"; + return null; + }; + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceReference + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceReference} ResourceReference + */ + ResourceReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceReference) + return object; + var message = new $root.google.api.ResourceReference(); + if (object.type != null) + message.type = String(object.type); + if (object.childType != null) + message.childType = String(object.childType); + return message; + }; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceReference + * @static + * @param {google.api.ResourceReference} message ResourceReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceReference.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = ""; + object.childType = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.childType != null && message.hasOwnProperty("childType")) + object.childType = message.childType; + return object; + }; + + /** + * Converts this ResourceReference to JSON. + * @function toJSON + * @memberof google.api.ResourceReference + * @instance + * @returns {Object.} JSON object + */ + ResourceReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceReference + * @function getTypeUrl + * @memberof google.api.ResourceReference + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceReference"; + }; + + return ResourceReference; + })(); + + return api; + })(); + + google.rpc = (function() { + + /** + * Namespace rpc. + * @memberof google + * @namespace + */ + var rpc = {}; + + rpc.Status = (function() { + + /** + * Properties of a Status. + * @memberof google.rpc + * @interface IStatus + * @property {number|null} [code] Status code + * @property {string|null} [message] Status message + * @property {Array.|null} [details] Status details + */ + + /** + * Constructs a new Status. + * @memberof google.rpc + * @classdesc Represents a Status. + * @implements IStatus + * @constructor + * @param {google.rpc.IStatus=} [properties] Properties to set + */ + function Status(properties) { + this.details = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Status code. + * @member {number} code + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.code = 0; + + /** + * Status message. + * @member {string} message + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.message = ""; + + /** + * Status details. + * @member {Array.} details + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.details = $util.emptyArray; + + /** + * Creates a new Status instance using the specified properties. + * @function create + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus=} [properties] Properties to set + * @returns {google.rpc.Status} Status instance + */ + Status.create = function create(properties) { + return new Status(properties); + }; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encode + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); + if (message.details != null && message.details.length) + for (var i = 0; i < message.details.length; ++i) + $root.google.protobuf.Any.encode(message.details[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encodeDelimited + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Status message from the specified reader or buffer. + * @function decode + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.rpc.Status(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.code = reader.int32(); + break; + } + case 2: { + message.message = reader.string(); + break; + } + case 3: { + if (!(message.details && message.details.length)) + message.details = []; + message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Status message. + * @function verify + * @memberof google.rpc.Status + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Status.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + if (!$util.isInteger(message.code)) + return "code: integer expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.details != null && message.hasOwnProperty("details")) { + if (!Array.isArray(message.details)) + return "details: array expected"; + for (var i = 0; i < message.details.length; ++i) { + var error = $root.google.protobuf.Any.verify(message.details[i]); + if (error) + return "details." + error; + } + } + return null; + }; + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.rpc.Status + * @static + * @param {Object.} object Plain object + * @returns {google.rpc.Status} Status + */ + Status.fromObject = function fromObject(object) { + if (object instanceof $root.google.rpc.Status) + return object; + var message = new $root.google.rpc.Status(); + if (object.code != null) + message.code = object.code | 0; + if (object.message != null) + message.message = String(object.message); + if (object.details) { + if (!Array.isArray(object.details)) + throw TypeError(".google.rpc.Status.details: array expected"); + message.details = []; + for (var i = 0; i < object.details.length; ++i) { + if (typeof object.details[i] !== "object") + throw TypeError(".google.rpc.Status.details: object expected"); + message.details[i] = $root.google.protobuf.Any.fromObject(object.details[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @function toObject + * @memberof google.rpc.Status + * @static + * @param {google.rpc.Status} message Status + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Status.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.details = []; + if (options.defaults) { + object.code = 0; + object.message = ""; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = message.code; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.details && message.details.length) { + object.details = []; + for (var j = 0; j < message.details.length; ++j) + object.details[j] = $root.google.protobuf.Any.toObject(message.details[j], options); + } + return object; + }; + + /** + * Converts this Status to JSON. + * @function toJSON + * @memberof google.rpc.Status + * @instance + * @returns {Object.} JSON object + */ + Status.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Status + * @function getTypeUrl + * @memberof google.rpc.Status + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Status.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.rpc.Status"; + }; + + return Status; + })(); + + return rpc; + })(); + + return google; + })(); + + return $root; +}); diff --git a/owl-bot-staging/v1/protos/protos.json b/owl-bot-staging/v1/protos/protos.json new file mode 100644 index 000000000..64305ac31 --- /dev/null +++ b/owl-bot-staging/v1/protos/protos.json @@ -0,0 +1,4346 @@ +{ + "nested": { + "google": { + "nested": { + "protobuf": { + "options": { + "go_package": "google.golang.org/protobuf/types/descriptorpb", + "java_package": "com.google.protobuf", + "java_outer_classname": "DescriptorProtos", + "csharp_namespace": "Google.Protobuf.Reflection", + "objc_class_prefix": "GPB", + "cc_enable_arenas": true, + "optimize_for": "SPEED" + }, + "nested": { + "Struct": { + "fields": { + "fields": { + "keyType": "string", + "type": "Value", + "id": 1 + } + } + }, + "Value": { + "oneofs": { + "kind": { + "oneof": [ + "nullValue", + "numberValue", + "stringValue", + "boolValue", + "structValue", + "listValue" + ] + } + }, + "fields": { + "nullValue": { + "type": "NullValue", + "id": 1 + }, + "numberValue": { + "type": "double", + "id": 2 + }, + "stringValue": { + "type": "string", + "id": 3 + }, + "boolValue": { + "type": "bool", + "id": 4 + }, + "structValue": { + "type": "Struct", + "id": 5 + }, + "listValue": { + "type": "ListValue", + "id": 6 + } + } + }, + "NullValue": { + "values": { + "NULL_VALUE": 0 + } + }, + "ListValue": { + "fields": { + "values": { + "rule": "repeated", + "type": "Value", + "id": 1 + } + } + }, + "Timestamp": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "FileDescriptorSet": { + "edition": "proto2", + "fields": { + "file": { + "rule": "repeated", + "type": "FileDescriptorProto", + "id": 1 + } + } + }, + "Edition": { + "edition": "proto2", + "values": { + "EDITION_UNKNOWN": 0, + "EDITION_PROTO2": 998, + "EDITION_PROTO3": 999, + "EDITION_2023": 1000, + "EDITION_2024": 1001, + "EDITION_1_TEST_ONLY": 1, + "EDITION_2_TEST_ONLY": 2, + "EDITION_99997_TEST_ONLY": 99997, + "EDITION_99998_TEST_ONLY": 99998, + "EDITION_99999_TEST_ONLY": 99999, + "EDITION_MAX": 2147483647 + } + }, + "FileDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "package": { + "type": "string", + "id": 2 + }, + "dependency": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "publicDependency": { + "rule": "repeated", + "type": "int32", + "id": 10 + }, + "weakDependency": { + "rule": "repeated", + "type": "int32", + "id": 11 + }, + "messageType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 4 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 5 + }, + "service": { + "rule": "repeated", + "type": "ServiceDescriptorProto", + "id": 6 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 7 + }, + "options": { + "type": "FileOptions", + "id": 8 + }, + "sourceCodeInfo": { + "type": "SourceCodeInfo", + "id": 9 + }, + "syntax": { + "type": "string", + "id": 12 + }, + "edition": { + "type": "Edition", + "id": 14 + } + } + }, + "DescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "field": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 2 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 6 + }, + "nestedType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 3 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 4 + }, + "extensionRange": { + "rule": "repeated", + "type": "ExtensionRange", + "id": 5 + }, + "oneofDecl": { + "rule": "repeated", + "type": "OneofDescriptorProto", + "id": 8 + }, + "options": { + "type": "MessageOptions", + "id": 7 + }, + "reservedRange": { + "rule": "repeated", + "type": "ReservedRange", + "id": 9 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 10 + } + }, + "nested": { + "ExtensionRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "ExtensionRangeOptions", + "id": 3 + } + } + }, + "ReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "ExtensionRangeOptions": { + "edition": "proto2", + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + }, + "declaration": { + "rule": "repeated", + "type": "Declaration", + "id": 2, + "options": { + "retention": "RETENTION_SOURCE" + } + }, + "features": { + "type": "FeatureSet", + "id": 50 + }, + "verification": { + "type": "VerificationState", + "id": 3, + "options": { + "default": "UNVERIFIED", + "retention": "RETENTION_SOURCE" + } + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "Declaration": { + "fields": { + "number": { + "type": "int32", + "id": 1 + }, + "fullName": { + "type": "string", + "id": 2 + }, + "type": { + "type": "string", + "id": 3 + }, + "reserved": { + "type": "bool", + "id": 5 + }, + "repeated": { + "type": "bool", + "id": 6 + } + }, + "reserved": [ + [ + 4, + 4 + ] + ] + }, + "VerificationState": { + "values": { + "DECLARATION": 0, + "UNVERIFIED": 1 + } + } + } + }, + "FieldDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 3 + }, + "label": { + "type": "Label", + "id": 4 + }, + "type": { + "type": "Type", + "id": 5 + }, + "typeName": { + "type": "string", + "id": 6 + }, + "extendee": { + "type": "string", + "id": 2 + }, + "defaultValue": { + "type": "string", + "id": 7 + }, + "oneofIndex": { + "type": "int32", + "id": 9 + }, + "jsonName": { + "type": "string", + "id": 10 + }, + "options": { + "type": "FieldOptions", + "id": 8 + }, + "proto3Optional": { + "type": "bool", + "id": 17 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_DOUBLE": 1, + "TYPE_FLOAT": 2, + "TYPE_INT64": 3, + "TYPE_UINT64": 4, + "TYPE_INT32": 5, + "TYPE_FIXED64": 6, + "TYPE_FIXED32": 7, + "TYPE_BOOL": 8, + "TYPE_STRING": 9, + "TYPE_GROUP": 10, + "TYPE_MESSAGE": 11, + "TYPE_BYTES": 12, + "TYPE_UINT32": 13, + "TYPE_ENUM": 14, + "TYPE_SFIXED32": 15, + "TYPE_SFIXED64": 16, + "TYPE_SINT32": 17, + "TYPE_SINT64": 18 + } + }, + "Label": { + "values": { + "LABEL_OPTIONAL": 1, + "LABEL_REPEATED": 3, + "LABEL_REQUIRED": 2 + } + } + } + }, + "OneofDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "options": { + "type": "OneofOptions", + "id": 2 + } + } + }, + "EnumDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "value": { + "rule": "repeated", + "type": "EnumValueDescriptorProto", + "id": 2 + }, + "options": { + "type": "EnumOptions", + "id": 3 + }, + "reservedRange": { + "rule": "repeated", + "type": "EnumReservedRange", + "id": 4 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 5 + } + }, + "nested": { + "EnumReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "EnumValueDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "EnumValueOptions", + "id": 3 + } + } + }, + "ServiceDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "method": { + "rule": "repeated", + "type": "MethodDescriptorProto", + "id": 2 + }, + "options": { + "type": "ServiceOptions", + "id": 3 + } + } + }, + "MethodDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "inputType": { + "type": "string", + "id": 2 + }, + "outputType": { + "type": "string", + "id": 3 + }, + "options": { + "type": "MethodOptions", + "id": 4 + }, + "clientStreaming": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "serverStreaming": { + "type": "bool", + "id": 6, + "options": { + "default": false + } + } + } + }, + "FileOptions": { + "edition": "proto2", + "fields": { + "javaPackage": { + "type": "string", + "id": 1 + }, + "javaOuterClassname": { + "type": "string", + "id": 8 + }, + "javaMultipleFiles": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "javaGenerateEqualsAndHash": { + "type": "bool", + "id": 20, + "options": { + "deprecated": true + } + }, + "javaStringCheckUtf8": { + "type": "bool", + "id": 27, + "options": { + "default": false + } + }, + "optimizeFor": { + "type": "OptimizeMode", + "id": 9, + "options": { + "default": "SPEED" + } + }, + "goPackage": { + "type": "string", + "id": 11 + }, + "ccGenericServices": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "javaGenericServices": { + "type": "bool", + "id": 17, + "options": { + "default": false + } + }, + "pyGenericServices": { + "type": "bool", + "id": 18, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 23, + "options": { + "default": false + } + }, + "ccEnableArenas": { + "type": "bool", + "id": 31, + "options": { + "default": true + } + }, + "objcClassPrefix": { + "type": "string", + "id": 36 + }, + "csharpNamespace": { + "type": "string", + "id": 37 + }, + "swiftPrefix": { + "type": "string", + "id": 39 + }, + "phpClassPrefix": { + "type": "string", + "id": 40 + }, + "phpNamespace": { + "type": "string", + "id": 41 + }, + "phpMetadataNamespace": { + "type": "string", + "id": 44 + }, + "rubyPackage": { + "type": "string", + "id": 45 + }, + "features": { + "type": "FeatureSet", + "id": 50 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 42, + 42 + ], + [ + 38, + 38 + ] + ], + "nested": { + "OptimizeMode": { + "values": { + "SPEED": 1, + "CODE_SIZE": 2, + "LITE_RUNTIME": 3 + } + } + } + }, + "MessageOptions": { + "edition": "proto2", + "fields": { + "messageSetWireFormat": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "noStandardDescriptorAccessor": { + "type": "bool", + "id": 2, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "mapEntry": { + "type": "bool", + "id": 7 + }, + "deprecatedLegacyJsonFieldConflicts": { + "type": "bool", + "id": 11, + "options": { + "deprecated": true + } + }, + "features": { + "type": "FeatureSet", + "id": 12 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ], + [ + 5, + 5 + ], + [ + 6, + 6 + ], + [ + 8, + 8 + ], + [ + 9, + 9 + ] + ] + }, + "FieldOptions": { + "edition": "proto2", + "fields": { + "ctype": { + "type": "CType", + "id": 1, + "options": { + "default": "STRING" + } + }, + "packed": { + "type": "bool", + "id": 2 + }, + "jstype": { + "type": "JSType", + "id": 6, + "options": { + "default": "JS_NORMAL" + } + }, + "lazy": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "unverifiedLazy": { + "type": "bool", + "id": 15, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "weak": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "debugRedact": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "retention": { + "type": "OptionRetention", + "id": 17 + }, + "targets": { + "rule": "repeated", + "type": "OptionTargetType", + "id": 19 + }, + "editionDefaults": { + "rule": "repeated", + "type": "EditionDefault", + "id": 20 + }, + "features": { + "type": "FeatureSet", + "id": 21 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ], + [ + 18, + 18 + ] + ], + "nested": { + "CType": { + "values": { + "STRING": 0, + "CORD": 1, + "STRING_PIECE": 2 + } + }, + "JSType": { + "values": { + "JS_NORMAL": 0, + "JS_STRING": 1, + "JS_NUMBER": 2 + } + }, + "OptionRetention": { + "values": { + "RETENTION_UNKNOWN": 0, + "RETENTION_RUNTIME": 1, + "RETENTION_SOURCE": 2 + } + }, + "OptionTargetType": { + "values": { + "TARGET_TYPE_UNKNOWN": 0, + "TARGET_TYPE_FILE": 1, + "TARGET_TYPE_EXTENSION_RANGE": 2, + "TARGET_TYPE_MESSAGE": 3, + "TARGET_TYPE_FIELD": 4, + "TARGET_TYPE_ONEOF": 5, + "TARGET_TYPE_ENUM": 6, + "TARGET_TYPE_ENUM_ENTRY": 7, + "TARGET_TYPE_SERVICE": 8, + "TARGET_TYPE_METHOD": 9 + } + }, + "EditionDefault": { + "fields": { + "edition": { + "type": "Edition", + "id": 3 + }, + "value": { + "type": "string", + "id": 2 + } + } + } + } + }, + "OneofOptions": { + "edition": "proto2", + "fields": { + "features": { + "type": "FeatureSet", + "id": 1 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "EnumOptions": { + "edition": "proto2", + "fields": { + "allowAlias": { + "type": "bool", + "id": 2 + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "deprecatedLegacyJsonFieldConflicts": { + "type": "bool", + "id": 6, + "options": { + "deprecated": true + } + }, + "features": { + "type": "FeatureSet", + "id": 7 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 5, + 5 + ] + ] + }, + "EnumValueOptions": { + "edition": "proto2", + "fields": { + "deprecated": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "features": { + "type": "FeatureSet", + "id": 2 + }, + "debugRedact": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "edition": "proto2", + "fields": { + "features": { + "type": "FeatureSet", + "id": 34 + }, + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "MethodOptions": { + "edition": "proto2", + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "idempotencyLevel": { + "type": "IdempotencyLevel", + "id": 34, + "options": { + "default": "IDEMPOTENCY_UNKNOWN" + } + }, + "features": { + "type": "FeatureSet", + "id": 35 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "IdempotencyLevel": { + "values": { + "IDEMPOTENCY_UNKNOWN": 0, + "NO_SIDE_EFFECTS": 1, + "IDEMPOTENT": 2 + } + } + } + }, + "UninterpretedOption": { + "edition": "proto2", + "fields": { + "name": { + "rule": "repeated", + "type": "NamePart", + "id": 2 + }, + "identifierValue": { + "type": "string", + "id": 3 + }, + "positiveIntValue": { + "type": "uint64", + "id": 4 + }, + "negativeIntValue": { + "type": "int64", + "id": 5 + }, + "doubleValue": { + "type": "double", + "id": 6 + }, + "stringValue": { + "type": "bytes", + "id": 7 + }, + "aggregateValue": { + "type": "string", + "id": 8 + } + }, + "nested": { + "NamePart": { + "fields": { + "namePart": { + "rule": "required", + "type": "string", + "id": 1 + }, + "isExtension": { + "rule": "required", + "type": "bool", + "id": 2 + } + } + } + } + }, + "FeatureSet": { + "edition": "proto2", + "fields": { + "fieldPresence": { + "type": "FieldPresence", + "id": 1, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_2023", + "edition_defaults.value": "EXPLICIT" + } + }, + "enumType": { + "type": "EnumType", + "id": 2, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "OPEN" + } + }, + "repeatedFieldEncoding": { + "type": "RepeatedFieldEncoding", + "id": 3, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "PACKED" + } + }, + "utf8Validation": { + "type": "Utf8Validation", + "id": 4, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "VERIFY" + } + }, + "messageEncoding": { + "type": "MessageEncoding", + "id": 5, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO2", + "edition_defaults.value": "LENGTH_PREFIXED" + } + }, + "jsonFormat": { + "type": "JsonFormat", + "id": 6, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "ALLOW" + } + } + }, + "extensions": [ + [ + 1000, + 1000 + ], + [ + 1001, + 1001 + ], + [ + 1002, + 1002 + ], + [ + 9990, + 9990 + ], + [ + 9995, + 9999 + ], + [ + 10000, + 10000 + ] + ], + "reserved": [ + [ + 999, + 999 + ] + ], + "nested": { + "FieldPresence": { + "values": { + "FIELD_PRESENCE_UNKNOWN": 0, + "EXPLICIT": 1, + "IMPLICIT": 2, + "LEGACY_REQUIRED": 3 + } + }, + "EnumType": { + "values": { + "ENUM_TYPE_UNKNOWN": 0, + "OPEN": 1, + "CLOSED": 2 + } + }, + "RepeatedFieldEncoding": { + "values": { + "REPEATED_FIELD_ENCODING_UNKNOWN": 0, + "PACKED": 1, + "EXPANDED": 2 + } + }, + "Utf8Validation": { + "values": { + "UTF8_VALIDATION_UNKNOWN": 0, + "VERIFY": 2, + "NONE": 3 + } + }, + "MessageEncoding": { + "values": { + "MESSAGE_ENCODING_UNKNOWN": 0, + "LENGTH_PREFIXED": 1, + "DELIMITED": 2 + } + }, + "JsonFormat": { + "values": { + "JSON_FORMAT_UNKNOWN": 0, + "ALLOW": 1, + "LEGACY_BEST_EFFORT": 2 + } + } + } + }, + "FeatureSetDefaults": { + "edition": "proto2", + "fields": { + "defaults": { + "rule": "repeated", + "type": "FeatureSetEditionDefault", + "id": 1 + }, + "minimumEdition": { + "type": "Edition", + "id": 4 + }, + "maximumEdition": { + "type": "Edition", + "id": 5 + } + }, + "nested": { + "FeatureSetEditionDefault": { + "fields": { + "edition": { + "type": "Edition", + "id": 3 + }, + "features": { + "type": "FeatureSet", + "id": 2 + } + } + } + } + }, + "SourceCodeInfo": { + "edition": "proto2", + "fields": { + "location": { + "rule": "repeated", + "type": "Location", + "id": 1 + } + }, + "nested": { + "Location": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1, + "options": { + "packed": true + } + }, + "span": { + "rule": "repeated", + "type": "int32", + "id": 2, + "options": { + "packed": true + } + }, + "leadingComments": { + "type": "string", + "id": 3 + }, + "trailingComments": { + "type": "string", + "id": 4 + }, + "leadingDetachedComments": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + } + } + }, + "GeneratedCodeInfo": { + "edition": "proto2", + "fields": { + "annotation": { + "rule": "repeated", + "type": "Annotation", + "id": 1 + } + }, + "nested": { + "Annotation": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1, + "options": { + "packed": true + } + }, + "sourceFile": { + "type": "string", + "id": 2 + }, + "begin": { + "type": "int32", + "id": 3 + }, + "end": { + "type": "int32", + "id": 4 + }, + "semantic": { + "type": "Semantic", + "id": 5 + } + }, + "nested": { + "Semantic": { + "values": { + "NONE": 0, + "SET": 1, + "ALIAS": 2 + } + } + } + } + } + }, + "Duration": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Empty": { + "fields": {} + }, + "Any": { + "fields": { + "type_url": { + "type": "string", + "id": 1 + }, + "value": { + "type": "bytes", + "id": 2 + } + } + } + } + }, + "spanner": { + "nested": { + "v1": { + "options": { + "csharp_namespace": "Google.Cloud.Spanner.V1", + "go_package": "cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb", + "java_multiple_files": true, + "java_outer_classname": "SpannerProto", + "java_package": "com.google.spanner.v1", + "php_namespace": "Google\\Cloud\\Spanner\\V1", + "ruby_package": "Google::Cloud::Spanner::V1", + "(google.api.resource_definition).type": "spanner.googleapis.com/Database", + "(google.api.resource_definition).pattern": "projects/{project}/instances/{instance}/databases/{database}" + }, + "nested": { + "ChangeStreamRecord": { + "oneofs": { + "record": { + "oneof": [ + "dataChangeRecord", + "heartbeatRecord", + "partitionStartRecord", + "partitionEndRecord", + "partitionEventRecord" + ] + } + }, + "fields": { + "dataChangeRecord": { + "type": "DataChangeRecord", + "id": 1 + }, + "heartbeatRecord": { + "type": "HeartbeatRecord", + "id": 2 + }, + "partitionStartRecord": { + "type": "PartitionStartRecord", + "id": 3 + }, + "partitionEndRecord": { + "type": "PartitionEndRecord", + "id": 4 + }, + "partitionEventRecord": { + "type": "PartitionEventRecord", + "id": 5 + } + }, + "nested": { + "DataChangeRecord": { + "fields": { + "commitTimestamp": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "recordSequence": { + "type": "string", + "id": 2 + }, + "serverTransactionId": { + "type": "string", + "id": 3 + }, + "isLastRecordInTransactionInPartition": { + "type": "bool", + "id": 4 + }, + "table": { + "type": "string", + "id": 5 + }, + "columnMetadata": { + "rule": "repeated", + "type": "ColumnMetadata", + "id": 6 + }, + "mods": { + "rule": "repeated", + "type": "Mod", + "id": 7 + }, + "modType": { + "type": "ModType", + "id": 8 + }, + "valueCaptureType": { + "type": "ValueCaptureType", + "id": 9 + }, + "numberOfRecordsInTransaction": { + "type": "int32", + "id": 10 + }, + "numberOfPartitionsInTransaction": { + "type": "int32", + "id": 11 + }, + "transactionTag": { + "type": "string", + "id": 12 + }, + "isSystemTransaction": { + "type": "bool", + "id": 13 + } + }, + "nested": { + "ColumnMetadata": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "type": { + "type": "Type", + "id": 2 + }, + "isPrimaryKey": { + "type": "bool", + "id": 3 + }, + "ordinalPosition": { + "type": "int64", + "id": 4 + } + } + }, + "ModValue": { + "fields": { + "columnMetadataIndex": { + "type": "int32", + "id": 1 + }, + "value": { + "type": "google.protobuf.Value", + "id": 2 + } + } + }, + "Mod": { + "fields": { + "keys": { + "rule": "repeated", + "type": "ModValue", + "id": 1 + }, + "oldValues": { + "rule": "repeated", + "type": "ModValue", + "id": 2 + }, + "newValues": { + "rule": "repeated", + "type": "ModValue", + "id": 3 + } + } + }, + "ModType": { + "values": { + "MOD_TYPE_UNSPECIFIED": 0, + "INSERT": 10, + "UPDATE": 20, + "DELETE": 30 + } + }, + "ValueCaptureType": { + "values": { + "VALUE_CAPTURE_TYPE_UNSPECIFIED": 0, + "OLD_AND_NEW_VALUES": 10, + "NEW_VALUES": 20, + "NEW_ROW": 30, + "NEW_ROW_AND_OLD_VALUES": 40 + } + } + } + }, + "HeartbeatRecord": { + "fields": { + "timestamp": { + "type": "google.protobuf.Timestamp", + "id": 1 + } + } + }, + "PartitionStartRecord": { + "fields": { + "startTimestamp": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "recordSequence": { + "type": "string", + "id": 2 + }, + "partitionTokens": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "PartitionEndRecord": { + "fields": { + "endTimestamp": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "recordSequence": { + "type": "string", + "id": 2 + }, + "partitionToken": { + "type": "string", + "id": 3 + } + } + }, + "PartitionEventRecord": { + "fields": { + "commitTimestamp": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "recordSequence": { + "type": "string", + "id": 2 + }, + "partitionToken": { + "type": "string", + "id": 3 + }, + "moveInEvents": { + "rule": "repeated", + "type": "MoveInEvent", + "id": 4 + }, + "moveOutEvents": { + "rule": "repeated", + "type": "MoveOutEvent", + "id": 5 + } + }, + "nested": { + "MoveInEvent": { + "fields": { + "sourcePartitionToken": { + "type": "string", + "id": 1 + } + } + }, + "MoveOutEvent": { + "fields": { + "destinationPartitionToken": { + "type": "string", + "id": 1 + } + } + } + } + } + } + }, + "Type": { + "fields": { + "code": { + "type": "TypeCode", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "arrayElementType": { + "type": "Type", + "id": 2 + }, + "structType": { + "type": "StructType", + "id": 3 + }, + "typeAnnotation": { + "type": "TypeAnnotationCode", + "id": 4 + }, + "protoTypeFqn": { + "type": "string", + "id": 5 + } + } + }, + "StructType": { + "fields": { + "fields": { + "rule": "repeated", + "type": "Field", + "id": 1 + } + }, + "nested": { + "Field": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "type": { + "type": "Type", + "id": 2 + } + } + } + } + }, + "TypeCode": { + "values": { + "TYPE_CODE_UNSPECIFIED": 0, + "BOOL": 1, + "INT64": 2, + "FLOAT64": 3, + "FLOAT32": 15, + "TIMESTAMP": 4, + "DATE": 5, + "STRING": 6, + "BYTES": 7, + "ARRAY": 8, + "STRUCT": 9, + "NUMERIC": 10, + "JSON": 11, + "PROTO": 13, + "ENUM": 14, + "INTERVAL": 16, + "UUID": 17 + } + }, + "TypeAnnotationCode": { + "values": { + "TYPE_ANNOTATION_CODE_UNSPECIFIED": 0, + "PG_NUMERIC": 2, + "PG_JSONB": 3, + "PG_OID": 4 + } + }, + "CommitResponse": { + "oneofs": { + "MultiplexedSessionRetry": { + "oneof": [ + "precommitToken" + ] + } + }, + "fields": { + "commitTimestamp": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "commitStats": { + "type": "CommitStats", + "id": 2 + }, + "precommitToken": { + "type": "MultiplexedSessionPrecommitToken", + "id": 4 + }, + "snapshotTimestamp": { + "type": "google.protobuf.Timestamp", + "id": 5 + } + }, + "nested": { + "CommitStats": { + "fields": { + "mutationCount": { + "type": "int64", + "id": 1 + } + } + } + } + }, + "TransactionOptions": { + "oneofs": { + "mode": { + "oneof": [ + "readWrite", + "partitionedDml", + "readOnly" + ] + } + }, + "fields": { + "readWrite": { + "type": "ReadWrite", + "id": 1 + }, + "partitionedDml": { + "type": "PartitionedDml", + "id": 3 + }, + "readOnly": { + "type": "ReadOnly", + "id": 2 + }, + "excludeTxnFromChangeStreams": { + "type": "bool", + "id": 5 + }, + "isolationLevel": { + "type": "IsolationLevel", + "id": 6 + } + }, + "nested": { + "ReadWrite": { + "fields": { + "readLockMode": { + "type": "ReadLockMode", + "id": 1 + }, + "multiplexedSessionPreviousTransactionId": { + "type": "bytes", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "ReadLockMode": { + "values": { + "READ_LOCK_MODE_UNSPECIFIED": 0, + "PESSIMISTIC": 1, + "OPTIMISTIC": 2 + } + } + } + }, + "PartitionedDml": { + "fields": {} + }, + "ReadOnly": { + "oneofs": { + "timestampBound": { + "oneof": [ + "strong", + "minReadTimestamp", + "maxStaleness", + "readTimestamp", + "exactStaleness" + ] + } + }, + "fields": { + "strong": { + "type": "bool", + "id": 1 + }, + "minReadTimestamp": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "maxStaleness": { + "type": "google.protobuf.Duration", + "id": 3 + }, + "readTimestamp": { + "type": "google.protobuf.Timestamp", + "id": 4 + }, + "exactStaleness": { + "type": "google.protobuf.Duration", + "id": 5 + }, + "returnReadTimestamp": { + "type": "bool", + "id": 6 + } + } + }, + "IsolationLevel": { + "values": { + "ISOLATION_LEVEL_UNSPECIFIED": 0, + "SERIALIZABLE": 1, + "REPEATABLE_READ": 2 + } + } + } + }, + "Transaction": { + "fields": { + "id": { + "type": "bytes", + "id": 1 + }, + "readTimestamp": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "precommitToken": { + "type": "MultiplexedSessionPrecommitToken", + "id": 3 + } + } + }, + "TransactionSelector": { + "oneofs": { + "selector": { + "oneof": [ + "singleUse", + "id", + "begin" + ] + } + }, + "fields": { + "singleUse": { + "type": "TransactionOptions", + "id": 1 + }, + "id": { + "type": "bytes", + "id": 2 + }, + "begin": { + "type": "TransactionOptions", + "id": 3 + } + } + }, + "MultiplexedSessionPrecommitToken": { + "fields": { + "precommitToken": { + "type": "bytes", + "id": 1 + }, + "seqNum": { + "type": "int32", + "id": 2 + } + } + }, + "KeyRange": { + "oneofs": { + "startKeyType": { + "oneof": [ + "startClosed", + "startOpen" + ] + }, + "endKeyType": { + "oneof": [ + "endClosed", + "endOpen" + ] + } + }, + "fields": { + "startClosed": { + "type": "google.protobuf.ListValue", + "id": 1 + }, + "startOpen": { + "type": "google.protobuf.ListValue", + "id": 2 + }, + "endClosed": { + "type": "google.protobuf.ListValue", + "id": 3 + }, + "endOpen": { + "type": "google.protobuf.ListValue", + "id": 4 + } + } + }, + "KeySet": { + "fields": { + "keys": { + "rule": "repeated", + "type": "google.protobuf.ListValue", + "id": 1 + }, + "ranges": { + "rule": "repeated", + "type": "KeyRange", + "id": 2 + }, + "all": { + "type": "bool", + "id": 3 + } + } + }, + "Range": { + "fields": { + "startKey": { + "type": "bytes", + "id": 1 + }, + "limitKey": { + "type": "bytes", + "id": 2 + }, + "groupUid": { + "type": "uint64", + "id": 3 + }, + "splitId": { + "type": "uint64", + "id": 4 + }, + "generation": { + "type": "bytes", + "id": 5 + } + } + }, + "Tablet": { + "fields": { + "tabletUid": { + "type": "uint64", + "id": 1 + }, + "serverAddress": { + "type": "string", + "id": 2 + }, + "location": { + "type": "string", + "id": 3 + }, + "role": { + "type": "Role", + "id": 4 + }, + "incarnation": { + "type": "bytes", + "id": 5 + }, + "distance": { + "type": "uint32", + "id": 6 + }, + "skip": { + "type": "bool", + "id": 7 + } + }, + "nested": { + "Role": { + "values": { + "ROLE_UNSPECIFIED": 0, + "READ_WRITE": 1, + "READ_ONLY": 2 + } + } + } + }, + "Group": { + "fields": { + "groupUid": { + "type": "uint64", + "id": 1 + }, + "tablets": { + "rule": "repeated", + "type": "Tablet", + "id": 2 + }, + "leaderIndex": { + "type": "int32", + "id": 3 + }, + "generation": { + "type": "bytes", + "id": 4 + } + } + }, + "KeyRecipe": { + "oneofs": { + "target": { + "oneof": [ + "tableName", + "indexName", + "operationUid" + ] + } + }, + "fields": { + "tableName": { + "type": "string", + "id": 1 + }, + "indexName": { + "type": "string", + "id": 2 + }, + "operationUid": { + "type": "uint64", + "id": 3 + }, + "part": { + "rule": "repeated", + "type": "Part", + "id": 4 + } + }, + "nested": { + "Part": { + "oneofs": { + "valueType": { + "oneof": [ + "identifier", + "value", + "random" + ] + } + }, + "fields": { + "tag": { + "type": "uint32", + "id": 1 + }, + "order": { + "type": "Order", + "id": 2 + }, + "nullOrder": { + "type": "NullOrder", + "id": 3 + }, + "type": { + "type": "Type", + "id": 4 + }, + "identifier": { + "type": "string", + "id": 5 + }, + "value": { + "type": "google.protobuf.Value", + "id": 6 + }, + "random": { + "type": "bool", + "id": 8 + }, + "structIdentifiers": { + "rule": "repeated", + "type": "int32", + "id": 7 + } + }, + "nested": { + "Order": { + "values": { + "ORDER_UNSPECIFIED": 0, + "ASCENDING": 1, + "DESCENDING": 2 + } + }, + "NullOrder": { + "values": { + "NULL_ORDER_UNSPECIFIED": 0, + "NULLS_FIRST": 1, + "NULLS_LAST": 2, + "NOT_NULL": 3 + } + } + } + } + } + }, + "RecipeList": { + "fields": { + "schemaGeneration": { + "type": "bytes", + "id": 1 + }, + "recipe": { + "rule": "repeated", + "type": "KeyRecipe", + "id": 3 + } + } + }, + "CacheUpdate": { + "fields": { + "databaseId": { + "type": "uint64", + "id": 1 + }, + "range": { + "rule": "repeated", + "type": "Range", + "id": 2 + }, + "group": { + "rule": "repeated", + "type": "Group", + "id": 3 + }, + "keyRecipes": { + "type": "RecipeList", + "id": 5 + } + } + }, + "RoutingHint": { + "fields": { + "operationUid": { + "type": "uint64", + "id": 1 + }, + "databaseId": { + "type": "uint64", + "id": 2 + }, + "schemaGeneration": { + "type": "bytes", + "id": 3 + }, + "key": { + "type": "bytes", + "id": 4 + }, + "limitKey": { + "type": "bytes", + "id": 5 + }, + "groupUid": { + "type": "uint64", + "id": 6 + }, + "splitId": { + "type": "uint64", + "id": 7 + }, + "tabletUid": { + "type": "uint64", + "id": 8 + }, + "skippedTabletUid": { + "rule": "repeated", + "type": "SkippedTablet", + "id": 9 + }, + "clientLocation": { + "type": "string", + "id": 10 + } + }, + "nested": { + "SkippedTablet": { + "fields": { + "tabletUid": { + "type": "uint64", + "id": 1 + }, + "incarnation": { + "type": "bytes", + "id": 2 + } + } + } + } + }, + "Mutation": { + "oneofs": { + "operation": { + "oneof": [ + "insert", + "update", + "insertOrUpdate", + "replace", + "delete", + "send", + "ack" + ] + } + }, + "fields": { + "insert": { + "type": "Write", + "id": 1 + }, + "update": { + "type": "Write", + "id": 2 + }, + "insertOrUpdate": { + "type": "Write", + "id": 3 + }, + "replace": { + "type": "Write", + "id": 4 + }, + "delete": { + "type": "Delete", + "id": 5 + }, + "send": { + "type": "Send", + "id": 6 + }, + "ack": { + "type": "Ack", + "id": 7 + } + }, + "nested": { + "Write": { + "fields": { + "table": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "columns": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "values": { + "rule": "repeated", + "type": "google.protobuf.ListValue", + "id": 3 + } + } + }, + "Delete": { + "fields": { + "table": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "keySet": { + "type": "KeySet", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "Send": { + "fields": { + "queue": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "key": { + "type": "google.protobuf.ListValue", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "deliverTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + }, + "payload": { + "type": "google.protobuf.Value", + "id": 4 + } + } + }, + "Ack": { + "fields": { + "queue": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "key": { + "type": "google.protobuf.ListValue", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "ignoreNotFound": { + "type": "bool", + "id": 3 + } + } + } + } + }, + "PlanNode": { + "fields": { + "index": { + "type": "int32", + "id": 1 + }, + "kind": { + "type": "Kind", + "id": 2 + }, + "displayName": { + "type": "string", + "id": 3 + }, + "childLinks": { + "rule": "repeated", + "type": "ChildLink", + "id": 4 + }, + "shortRepresentation": { + "type": "ShortRepresentation", + "id": 5 + }, + "metadata": { + "type": "google.protobuf.Struct", + "id": 6 + }, + "executionStats": { + "type": "google.protobuf.Struct", + "id": 7 + } + }, + "nested": { + "Kind": { + "values": { + "KIND_UNSPECIFIED": 0, + "RELATIONAL": 1, + "SCALAR": 2 + } + }, + "ChildLink": { + "fields": { + "childIndex": { + "type": "int32", + "id": 1 + }, + "type": { + "type": "string", + "id": 2 + }, + "variable": { + "type": "string", + "id": 3 + } + } + }, + "ShortRepresentation": { + "fields": { + "description": { + "type": "string", + "id": 1 + }, + "subqueries": { + "keyType": "string", + "type": "int32", + "id": 2 + } + } + } + } + }, + "QueryAdvisorResult": { + "fields": { + "indexAdvice": { + "rule": "repeated", + "type": "IndexAdvice", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "IndexAdvice": { + "fields": { + "ddl": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "improvementFactor": { + "type": "double", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + }, + "QueryPlan": { + "fields": { + "planNodes": { + "rule": "repeated", + "type": "PlanNode", + "id": 1 + }, + "queryAdvice": { + "type": "QueryAdvisorResult", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ResultSet": { + "fields": { + "metadata": { + "type": "ResultSetMetadata", + "id": 1 + }, + "rows": { + "rule": "repeated", + "type": "google.protobuf.ListValue", + "id": 2 + }, + "stats": { + "type": "ResultSetStats", + "id": 3 + }, + "precommitToken": { + "type": "MultiplexedSessionPrecommitToken", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "cacheUpdate": { + "type": "CacheUpdate", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "PartialResultSet": { + "fields": { + "metadata": { + "type": "ResultSetMetadata", + "id": 1 + }, + "values": { + "rule": "repeated", + "type": "google.protobuf.Value", + "id": 2 + }, + "chunkedValue": { + "type": "bool", + "id": 3 + }, + "resumeToken": { + "type": "bytes", + "id": 4 + }, + "stats": { + "type": "ResultSetStats", + "id": 5 + }, + "precommitToken": { + "type": "MultiplexedSessionPrecommitToken", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "last": { + "type": "bool", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "cacheUpdate": { + "type": "CacheUpdate", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ResultSetMetadata": { + "fields": { + "rowType": { + "type": "StructType", + "id": 1 + }, + "transaction": { + "type": "Transaction", + "id": 2 + }, + "undeclaredParameters": { + "type": "StructType", + "id": 3 + } + } + }, + "ResultSetStats": { + "oneofs": { + "rowCount": { + "oneof": [ + "rowCountExact", + "rowCountLowerBound" + ] + } + }, + "fields": { + "queryPlan": { + "type": "QueryPlan", + "id": 1 + }, + "queryStats": { + "type": "google.protobuf.Struct", + "id": 2 + }, + "rowCountExact": { + "type": "int64", + "id": 3 + }, + "rowCountLowerBound": { + "type": "int64", + "id": 4 + } + } + }, + "Spanner": { + "options": { + "(google.api.default_host)": "spanner.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/spanner.data" + }, + "methods": { + "CreateSession": { + "requestType": "CreateSessionRequest", + "responseType": "Session", + "options": { + "(google.api.http).post": "/v1/{database=projects/*/instances/*/databases/*}/sessions", + "(google.api.http).body": "*", + "(google.api.method_signature)": "database" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{database=projects/*/instances/*/databases/*}/sessions", + "body": "*" + } + }, + { + "(google.api.method_signature)": "database" + } + ] + }, + "BatchCreateSessions": { + "requestType": "BatchCreateSessionsRequest", + "responseType": "BatchCreateSessionsResponse", + "options": { + "(google.api.http).post": "/v1/{database=projects/*/instances/*/databases/*}/sessions:batchCreate", + "(google.api.http).body": "*", + "(google.api.method_signature)": "database,session_count" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{database=projects/*/instances/*/databases/*}/sessions:batchCreate", + "body": "*" + } + }, + { + "(google.api.method_signature)": "database,session_count" + } + ] + }, + "GetSession": { + "requestType": "GetSessionRequest", + "responseType": "Session", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/instances/*/databases/*/sessions/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/instances/*/databases/*/sessions/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListSessions": { + "requestType": "ListSessionsRequest", + "responseType": "ListSessionsResponse", + "options": { + "(google.api.http).get": "/v1/{database=projects/*/instances/*/databases/*}/sessions", + "(google.api.method_signature)": "database" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{database=projects/*/instances/*/databases/*}/sessions" + } + }, + { + "(google.api.method_signature)": "database" + } + ] + }, + "DeleteSession": { + "requestType": "DeleteSessionRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/instances/*/databases/*/sessions/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/instances/*/databases/*/sessions/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ExecuteSql": { + "requestType": "ExecuteSqlRequest", + "responseType": "ResultSet", + "options": { + "(google.api.http).post": "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:executeSql", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:executeSql", + "body": "*" + } + } + ] + }, + "ExecuteStreamingSql": { + "requestType": "ExecuteSqlRequest", + "responseType": "PartialResultSet", + "responseStream": true, + "options": { + "(google.api.http).post": "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:executeStreamingSql", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:executeStreamingSql", + "body": "*" + } + } + ] + }, + "ExecuteBatchDml": { + "requestType": "ExecuteBatchDmlRequest", + "responseType": "ExecuteBatchDmlResponse", + "options": { + "(google.api.http).post": "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:executeBatchDml", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:executeBatchDml", + "body": "*" + } + } + ] + }, + "Read": { + "requestType": "ReadRequest", + "responseType": "ResultSet", + "options": { + "(google.api.http).post": "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:read", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:read", + "body": "*" + } + } + ] + }, + "StreamingRead": { + "requestType": "ReadRequest", + "responseType": "PartialResultSet", + "responseStream": true, + "options": { + "(google.api.http).post": "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:streamingRead", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:streamingRead", + "body": "*" + } + } + ] + }, + "BeginTransaction": { + "requestType": "BeginTransactionRequest", + "responseType": "Transaction", + "options": { + "(google.api.http).post": "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:beginTransaction", + "(google.api.http).body": "*", + "(google.api.method_signature)": "session,options" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:beginTransaction", + "body": "*" + } + }, + { + "(google.api.method_signature)": "session,options" + } + ] + }, + "Commit": { + "requestType": "CommitRequest", + "responseType": "CommitResponse", + "options": { + "(google.api.http).post": "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:commit", + "(google.api.http).body": "*", + "(google.api.method_signature)": "session,single_use_transaction,mutations" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:commit", + "body": "*" + } + }, + { + "(google.api.method_signature)": "session,transaction_id,mutations" + }, + { + "(google.api.method_signature)": "session,single_use_transaction,mutations" + } + ] + }, + "Rollback": { + "requestType": "RollbackRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).post": "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:rollback", + "(google.api.http).body": "*", + "(google.api.method_signature)": "session,transaction_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:rollback", + "body": "*" + } + }, + { + "(google.api.method_signature)": "session,transaction_id" + } + ] + }, + "PartitionQuery": { + "requestType": "PartitionQueryRequest", + "responseType": "PartitionResponse", + "options": { + "(google.api.http).post": "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:partitionQuery", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:partitionQuery", + "body": "*" + } + } + ] + }, + "PartitionRead": { + "requestType": "PartitionReadRequest", + "responseType": "PartitionResponse", + "options": { + "(google.api.http).post": "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:partitionRead", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:partitionRead", + "body": "*" + } + } + ] + }, + "BatchWrite": { + "requestType": "BatchWriteRequest", + "responseType": "BatchWriteResponse", + "responseStream": true, + "options": { + "(google.api.http).post": "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:batchWrite", + "(google.api.http).body": "*", + "(google.api.method_signature)": "session,mutation_groups" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:batchWrite", + "body": "*" + } + }, + { + "(google.api.method_signature)": "session,mutation_groups" + } + ] + } + } + }, + "CreateSessionRequest": { + "fields": { + "database": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/Database" + } + }, + "session": { + "type": "Session", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "BatchCreateSessionsRequest": { + "fields": { + "database": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/Database" + } + }, + "sessionTemplate": { + "type": "Session", + "id": 2 + }, + "sessionCount": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "BatchCreateSessionsResponse": { + "fields": { + "session": { + "rule": "repeated", + "type": "Session", + "id": 1 + } + } + }, + "Session": { + "options": { + "(google.api.resource).type": "spanner.googleapis.com/Session", + "(google.api.resource).pattern": "projects/{project}/instances/{instance}/databases/{database}/sessions/{session}", + "(google.api.resource).plural": "sessions", + "(google.api.resource).singular": "session" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "approximateLastUseTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "creatorRole": { + "type": "string", + "id": 5 + }, + "multiplexed": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "GetSessionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/Session" + } + } + } + }, + "ListSessionsRequest": { + "fields": { + "database": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/Database" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4 + } + } + }, + "ListSessionsResponse": { + "fields": { + "sessions": { + "rule": "repeated", + "type": "Session", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "DeleteSessionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/Session" + } + } + } + }, + "RequestOptions": { + "fields": { + "priority": { + "type": "Priority", + "id": 1 + }, + "requestTag": { + "type": "string", + "id": 2 + }, + "transactionTag": { + "type": "string", + "id": 3 + }, + "clientContext": { + "type": "ClientContext", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "Priority": { + "values": { + "PRIORITY_UNSPECIFIED": 0, + "PRIORITY_LOW": 1, + "PRIORITY_MEDIUM": 2, + "PRIORITY_HIGH": 3 + } + }, + "ClientContext": { + "fields": { + "secureContext": { + "keyType": "string", + "type": "google.protobuf.Value", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + }, + "DirectedReadOptions": { + "oneofs": { + "replicas": { + "oneof": [ + "includeReplicas", + "excludeReplicas" + ] + } + }, + "fields": { + "includeReplicas": { + "type": "IncludeReplicas", + "id": 1 + }, + "excludeReplicas": { + "type": "ExcludeReplicas", + "id": 2 + } + }, + "nested": { + "ReplicaSelection": { + "fields": { + "location": { + "type": "string", + "id": 1 + }, + "type": { + "type": "Type", + "id": 2 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "READ_WRITE": 1, + "READ_ONLY": 2 + } + } + } + }, + "IncludeReplicas": { + "fields": { + "replicaSelections": { + "rule": "repeated", + "type": "ReplicaSelection", + "id": 1 + }, + "autoFailoverDisabled": { + "type": "bool", + "id": 2 + } + } + }, + "ExcludeReplicas": { + "fields": { + "replicaSelections": { + "rule": "repeated", + "type": "ReplicaSelection", + "id": 1 + } + } + } + } + }, + "ExecuteSqlRequest": { + "fields": { + "session": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/Session" + } + }, + "transaction": { + "type": "TransactionSelector", + "id": 2 + }, + "sql": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "params": { + "type": "google.protobuf.Struct", + "id": 4 + }, + "paramTypes": { + "keyType": "string", + "type": "Type", + "id": 5 + }, + "resumeToken": { + "type": "bytes", + "id": 6 + }, + "queryMode": { + "type": "QueryMode", + "id": 7 + }, + "partitionToken": { + "type": "bytes", + "id": 8 + }, + "seqno": { + "type": "int64", + "id": 9 + }, + "queryOptions": { + "type": "QueryOptions", + "id": 10 + }, + "requestOptions": { + "type": "RequestOptions", + "id": 11 + }, + "directedReadOptions": { + "type": "DirectedReadOptions", + "id": 15 + }, + "dataBoostEnabled": { + "type": "bool", + "id": 16 + }, + "lastStatement": { + "type": "bool", + "id": 17, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "routingHint": { + "type": "RoutingHint", + "id": 18, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "QueryMode": { + "values": { + "NORMAL": 0, + "PLAN": 1, + "PROFILE": 2, + "WITH_STATS": 3, + "WITH_PLAN_AND_STATS": 4 + } + }, + "QueryOptions": { + "fields": { + "optimizerVersion": { + "type": "string", + "id": 1 + }, + "optimizerStatisticsPackage": { + "type": "string", + "id": 2 + } + } + } + } + }, + "ExecuteBatchDmlRequest": { + "fields": { + "session": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/Session" + } + }, + "transaction": { + "type": "TransactionSelector", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "statements": { + "rule": "repeated", + "type": "Statement", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "seqno": { + "type": "int64", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestOptions": { + "type": "RequestOptions", + "id": 5 + }, + "lastStatements": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "Statement": { + "fields": { + "sql": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "params": { + "type": "google.protobuf.Struct", + "id": 2 + }, + "paramTypes": { + "keyType": "string", + "type": "Type", + "id": 3 + } + } + } + } + }, + "ExecuteBatchDmlResponse": { + "fields": { + "resultSets": { + "rule": "repeated", + "type": "ResultSet", + "id": 1 + }, + "status": { + "type": "google.rpc.Status", + "id": 2 + }, + "precommitToken": { + "type": "MultiplexedSessionPrecommitToken", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "PartitionOptions": { + "fields": { + "partitionSizeBytes": { + "type": "int64", + "id": 1 + }, + "maxPartitions": { + "type": "int64", + "id": 2 + } + } + }, + "PartitionQueryRequest": { + "fields": { + "session": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/Session" + } + }, + "transaction": { + "type": "TransactionSelector", + "id": 2 + }, + "sql": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "params": { + "type": "google.protobuf.Struct", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "paramTypes": { + "keyType": "string", + "type": "Type", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "partitionOptions": { + "type": "PartitionOptions", + "id": 6 + } + } + }, + "PartitionReadRequest": { + "fields": { + "session": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/Session" + } + }, + "transaction": { + "type": "TransactionSelector", + "id": 2 + }, + "table": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "index": { + "type": "string", + "id": 4 + }, + "columns": { + "rule": "repeated", + "type": "string", + "id": 5 + }, + "keySet": { + "type": "KeySet", + "id": 6, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "partitionOptions": { + "type": "PartitionOptions", + "id": 9 + } + } + }, + "Partition": { + "fields": { + "partitionToken": { + "type": "bytes", + "id": 1 + } + } + }, + "PartitionResponse": { + "fields": { + "partitions": { + "rule": "repeated", + "type": "Partition", + "id": 1 + }, + "transaction": { + "type": "Transaction", + "id": 2 + } + } + }, + "ReadRequest": { + "fields": { + "session": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/Session" + } + }, + "transaction": { + "type": "TransactionSelector", + "id": 2 + }, + "table": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "index": { + "type": "string", + "id": 4 + }, + "columns": { + "rule": "repeated", + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "keySet": { + "type": "KeySet", + "id": 6, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "limit": { + "type": "int64", + "id": 8 + }, + "resumeToken": { + "type": "bytes", + "id": 9 + }, + "partitionToken": { + "type": "bytes", + "id": 10 + }, + "requestOptions": { + "type": "RequestOptions", + "id": 11 + }, + "directedReadOptions": { + "type": "DirectedReadOptions", + "id": 14 + }, + "dataBoostEnabled": { + "type": "bool", + "id": 15 + }, + "orderBy": { + "type": "OrderBy", + "id": 16, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "lockHint": { + "type": "LockHint", + "id": 17, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "routingHint": { + "type": "RoutingHint", + "id": 18, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "OrderBy": { + "values": { + "ORDER_BY_UNSPECIFIED": 0, + "ORDER_BY_PRIMARY_KEY": 1, + "ORDER_BY_NO_ORDER": 2 + } + }, + "LockHint": { + "values": { + "LOCK_HINT_UNSPECIFIED": 0, + "LOCK_HINT_SHARED": 1, + "LOCK_HINT_EXCLUSIVE": 2 + } + } + } + }, + "BeginTransactionRequest": { + "fields": { + "session": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/Session" + } + }, + "options": { + "type": "TransactionOptions", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestOptions": { + "type": "RequestOptions", + "id": 3 + }, + "mutationKey": { + "type": "Mutation", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "CommitRequest": { + "oneofs": { + "transaction": { + "oneof": [ + "transactionId", + "singleUseTransaction" + ] + } + }, + "fields": { + "session": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/Session" + } + }, + "transactionId": { + "type": "bytes", + "id": 2 + }, + "singleUseTransaction": { + "type": "TransactionOptions", + "id": 3 + }, + "mutations": { + "rule": "repeated", + "type": "Mutation", + "id": 4 + }, + "returnCommitStats": { + "type": "bool", + "id": 5 + }, + "maxCommitDelay": { + "type": "google.protobuf.Duration", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "requestOptions": { + "type": "RequestOptions", + "id": 6 + }, + "precommitToken": { + "type": "MultiplexedSessionPrecommitToken", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "RollbackRequest": { + "fields": { + "session": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/Session" + } + }, + "transactionId": { + "type": "bytes", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "BatchWriteRequest": { + "fields": { + "session": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/Session" + } + }, + "requestOptions": { + "type": "RequestOptions", + "id": 3 + }, + "mutationGroups": { + "rule": "repeated", + "type": "MutationGroup", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "excludeTxnFromChangeStreams": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "MutationGroup": { + "fields": { + "mutations": { + "rule": "repeated", + "type": "Mutation", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + } + } + }, + "BatchWriteResponse": { + "fields": { + "indexes": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "status": { + "type": "google.rpc.Status", + "id": 2 + }, + "commitTimestamp": { + "type": "google.protobuf.Timestamp", + "id": 3 + } + } + } + } + } + } + }, + "api": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", + "java_multiple_files": true, + "java_outer_classname": "ResourceProto", + "java_package": "com.google.api", + "objc_class_prefix": "GAPI", + "cc_enable_arenas": true + }, + "nested": { + "fieldBehavior": { + "rule": "repeated", + "type": "google.api.FieldBehavior", + "id": 1052, + "extend": "google.protobuf.FieldOptions", + "options": { + "packed": false + } + }, + "FieldBehavior": { + "values": { + "FIELD_BEHAVIOR_UNSPECIFIED": 0, + "OPTIONAL": 1, + "REQUIRED": 2, + "OUTPUT_ONLY": 3, + "INPUT_ONLY": 4, + "IMMUTABLE": 5, + "UNORDERED_LIST": 6, + "NON_EMPTY_DEFAULT": 7, + "IDENTIFIER": 8 + } + }, + "http": { + "type": "HttpRule", + "id": 72295728, + "extend": "google.protobuf.MethodOptions" + }, + "Http": { + "fields": { + "rules": { + "rule": "repeated", + "type": "HttpRule", + "id": 1 + }, + "fullyDecodeReservedExpansion": { + "type": "bool", + "id": 2 + } + } + }, + "HttpRule": { + "oneofs": { + "pattern": { + "oneof": [ + "get", + "put", + "post", + "delete", + "patch", + "custom" + ] + } + }, + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "get": { + "type": "string", + "id": 2 + }, + "put": { + "type": "string", + "id": 3 + }, + "post": { + "type": "string", + "id": 4 + }, + "delete": { + "type": "string", + "id": 5 + }, + "patch": { + "type": "string", + "id": 6 + }, + "custom": { + "type": "CustomHttpPattern", + "id": 8 + }, + "body": { + "type": "string", + "id": 7 + }, + "responseBody": { + "type": "string", + "id": 12 + }, + "additionalBindings": { + "rule": "repeated", + "type": "HttpRule", + "id": 11 + } + } + }, + "CustomHttpPattern": { + "fields": { + "kind": { + "type": "string", + "id": 1 + }, + "path": { + "type": "string", + "id": 2 + } + } + }, + "methodSignature": { + "rule": "repeated", + "type": "string", + "id": 1051, + "extend": "google.protobuf.MethodOptions" + }, + "defaultHost": { + "type": "string", + "id": 1049, + "extend": "google.protobuf.ServiceOptions" + }, + "oauthScopes": { + "type": "string", + "id": 1050, + "extend": "google.protobuf.ServiceOptions" + }, + "apiVersion": { + "type": "string", + "id": 525000001, + "extend": "google.protobuf.ServiceOptions" + }, + "CommonLanguageSettings": { + "fields": { + "referenceDocsUri": { + "type": "string", + "id": 1, + "options": { + "deprecated": true + } + }, + "destinations": { + "rule": "repeated", + "type": "ClientLibraryDestination", + "id": 2 + } + } + }, + "ClientLibrarySettings": { + "fields": { + "version": { + "type": "string", + "id": 1 + }, + "launchStage": { + "type": "LaunchStage", + "id": 2 + }, + "restNumericEnums": { + "type": "bool", + "id": 3 + }, + "javaSettings": { + "type": "JavaSettings", + "id": 21 + }, + "cppSettings": { + "type": "CppSettings", + "id": 22 + }, + "phpSettings": { + "type": "PhpSettings", + "id": 23 + }, + "pythonSettings": { + "type": "PythonSettings", + "id": 24 + }, + "nodeSettings": { + "type": "NodeSettings", + "id": 25 + }, + "dotnetSettings": { + "type": "DotnetSettings", + "id": 26 + }, + "rubySettings": { + "type": "RubySettings", + "id": 27 + }, + "goSettings": { + "type": "GoSettings", + "id": 28 + } + } + }, + "Publishing": { + "fields": { + "methodSettings": { + "rule": "repeated", + "type": "MethodSettings", + "id": 2 + }, + "newIssueUri": { + "type": "string", + "id": 101 + }, + "documentationUri": { + "type": "string", + "id": 102 + }, + "apiShortName": { + "type": "string", + "id": 103 + }, + "githubLabel": { + "type": "string", + "id": 104 + }, + "codeownerGithubTeams": { + "rule": "repeated", + "type": "string", + "id": 105 + }, + "docTagPrefix": { + "type": "string", + "id": 106 + }, + "organization": { + "type": "ClientLibraryOrganization", + "id": 107 + }, + "librarySettings": { + "rule": "repeated", + "type": "ClientLibrarySettings", + "id": 109 + }, + "protoReferenceDocumentationUri": { + "type": "string", + "id": 110 + }, + "restReferenceDocumentationUri": { + "type": "string", + "id": 111 + } + } + }, + "JavaSettings": { + "fields": { + "libraryPackage": { + "type": "string", + "id": 1 + }, + "serviceClassNames": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "common": { + "type": "CommonLanguageSettings", + "id": 3 + } + } + }, + "CppSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "PhpSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "PythonSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "NodeSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "DotnetSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + }, + "renamedServices": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "renamedResources": { + "keyType": "string", + "type": "string", + "id": 3 + }, + "ignoredResources": { + "rule": "repeated", + "type": "string", + "id": 4 + }, + "forcedNamespaceAliases": { + "rule": "repeated", + "type": "string", + "id": 5 + }, + "handwrittenSignatures": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + }, + "RubySettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "GoSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "MethodSettings": { + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "longRunning": { + "type": "LongRunning", + "id": 2 + }, + "autoPopulatedFields": { + "rule": "repeated", + "type": "string", + "id": 3 + } + }, + "nested": { + "LongRunning": { + "fields": { + "initialPollDelay": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "pollDelayMultiplier": { + "type": "float", + "id": 2 + }, + "maxPollDelay": { + "type": "google.protobuf.Duration", + "id": 3 + }, + "totalPollTimeout": { + "type": "google.protobuf.Duration", + "id": 4 + } + } + } + } + }, + "ClientLibraryOrganization": { + "values": { + "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": 0, + "CLOUD": 1, + "ADS": 2, + "PHOTOS": 3, + "STREET_VIEW": 4, + "SHOPPING": 5, + "GEO": 6, + "GENERATIVE_AI": 7 + } + }, + "ClientLibraryDestination": { + "values": { + "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": 0, + "GITHUB": 10, + "PACKAGE_MANAGER": 20 + } + }, + "LaunchStage": { + "values": { + "LAUNCH_STAGE_UNSPECIFIED": 0, + "UNIMPLEMENTED": 6, + "PRELAUNCH": 7, + "EARLY_ACCESS": 1, + "ALPHA": 2, + "BETA": 3, + "GA": 4, + "DEPRECATED": 5 + } + }, + "resourceReference": { + "type": "google.api.ResourceReference", + "id": 1055, + "extend": "google.protobuf.FieldOptions" + }, + "resourceDefinition": { + "rule": "repeated", + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.FileOptions" + }, + "resource": { + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.MessageOptions" + }, + "ResourceDescriptor": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "pattern": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "nameField": { + "type": "string", + "id": 3 + }, + "history": { + "type": "History", + "id": 4 + }, + "plural": { + "type": "string", + "id": 5 + }, + "singular": { + "type": "string", + "id": 6 + }, + "style": { + "rule": "repeated", + "type": "Style", + "id": 10 + } + }, + "nested": { + "History": { + "values": { + "HISTORY_UNSPECIFIED": 0, + "ORIGINALLY_SINGLE_PATTERN": 1, + "FUTURE_MULTI_PATTERN": 2 + } + }, + "Style": { + "values": { + "STYLE_UNSPECIFIED": 0, + "DECLARATIVE_FRIENDLY": 1 + } + } + } + }, + "ResourceReference": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "childType": { + "type": "string", + "id": 2 + } + } + } + } + }, + "rpc": { + "options": { + "cc_enable_arenas": true, + "go_package": "google.golang.org/genproto/googleapis/rpc/status;status", + "java_multiple_files": true, + "java_outer_classname": "StatusProto", + "java_package": "com.google.rpc", + "objc_class_prefix": "RPC" + }, + "nested": { + "Status": { + "fields": { + "code": { + "type": "int32", + "id": 1 + }, + "message": { + "type": "string", + "id": 2 + }, + "details": { + "rule": "repeated", + "type": "google.protobuf.Any", + "id": 3 + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/owl-bot-staging/v1/src/index.ts b/owl-bot-staging/v1/src/index.ts new file mode 100644 index 000000000..2703db602 --- /dev/null +++ b/owl-bot-staging/v1/src/index.ts @@ -0,0 +1,25 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as v1 from './v1'; +const SpannerClient = v1.SpannerClient; +type SpannerClient = v1.SpannerClient; +export {v1, SpannerClient}; +export default {v1, SpannerClient}; +import * as protos from '../protos/protos'; +export {protos} diff --git a/owl-bot-staging/v1/src/v1/gapic_metadata.json b/owl-bot-staging/v1/src/v1/gapic_metadata.json new file mode 100644 index 000000000..3354d9b87 --- /dev/null +++ b/owl-bot-staging/v1/src/v1/gapic_metadata.json @@ -0,0 +1,172 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.spanner.v1", + "libraryPackage": "@google-cloud/spanner", + "services": { + "Spanner": { + "clients": { + "grpc": { + "libraryClient": "SpannerClient", + "rpcs": { + "CreateSession": { + "methods": [ + "createSession" + ] + }, + "BatchCreateSessions": { + "methods": [ + "batchCreateSessions" + ] + }, + "GetSession": { + "methods": [ + "getSession" + ] + }, + "DeleteSession": { + "methods": [ + "deleteSession" + ] + }, + "ExecuteSql": { + "methods": [ + "executeSql" + ] + }, + "ExecuteBatchDml": { + "methods": [ + "executeBatchDml" + ] + }, + "Read": { + "methods": [ + "read" + ] + }, + "BeginTransaction": { + "methods": [ + "beginTransaction" + ] + }, + "Commit": { + "methods": [ + "commit" + ] + }, + "Rollback": { + "methods": [ + "rollback" + ] + }, + "PartitionQuery": { + "methods": [ + "partitionQuery" + ] + }, + "PartitionRead": { + "methods": [ + "partitionRead" + ] + }, + "ExecuteStreamingSql": { + "methods": [ + "executeStreamingSql" + ] + }, + "StreamingRead": { + "methods": [ + "streamingRead" + ] + }, + "BatchWrite": { + "methods": [ + "batchWrite" + ] + }, + "ListSessions": { + "methods": [ + "listSessions", + "listSessionsStream", + "listSessionsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "SpannerClient", + "rpcs": { + "CreateSession": { + "methods": [ + "createSession" + ] + }, + "BatchCreateSessions": { + "methods": [ + "batchCreateSessions" + ] + }, + "GetSession": { + "methods": [ + "getSession" + ] + }, + "DeleteSession": { + "methods": [ + "deleteSession" + ] + }, + "ExecuteSql": { + "methods": [ + "executeSql" + ] + }, + "ExecuteBatchDml": { + "methods": [ + "executeBatchDml" + ] + }, + "Read": { + "methods": [ + "read" + ] + }, + "BeginTransaction": { + "methods": [ + "beginTransaction" + ] + }, + "Commit": { + "methods": [ + "commit" + ] + }, + "Rollback": { + "methods": [ + "rollback" + ] + }, + "PartitionQuery": { + "methods": [ + "partitionQuery" + ] + }, + "PartitionRead": { + "methods": [ + "partitionRead" + ] + }, + "ListSessions": { + "methods": [ + "listSessions", + "listSessionsStream", + "listSessionsAsync" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/v1/src/v1/index.ts b/owl-bot-staging/v1/src/v1/index.ts new file mode 100644 index 000000000..aa14c15b6 --- /dev/null +++ b/owl-bot-staging/v1/src/v1/index.ts @@ -0,0 +1,19 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +export {SpannerClient} from './spanner_client'; diff --git a/owl-bot-staging/v1/src/v1/spanner_client.ts b/owl-bot-staging/v1/src/v1/spanner_client.ts new file mode 100644 index 000000000..c7a1f8be6 --- /dev/null +++ b/owl-bot-staging/v1/src/v1/spanner_client.ts @@ -0,0 +1,2584 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback, GaxCall} from 'google-gax'; +import {Transform, PassThrough} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v1/spanner_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './spanner_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Cloud Spanner API + * + * The Cloud Spanner API can be used to manage sessions and execute + * transactions on data stored in Cloud Spanner databases. + * @class + * @memberof v1 + */ +export class SpannerClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('spanner'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + spannerStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of SpannerClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new SpannerClient({fallback: true}, gax); + * ``` + */ + constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof SpannerClient; + if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { + throw new Error('Please set either universe_domain or universeDomain, but not both.'); + } + const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; + this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; + this._servicePath = 'spanner.' + this._universeDomain; + const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== this._servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process === 'object' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + databasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/instances/{instance}/databases/{database}' + ), + sessionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/instances/{instance}/databases/{database}/sessions/{session}' + ), + }; + + // 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 = { + listSessions: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'sessions') + }; + + // Some of the methods on this service provide streaming responses. + // Provide descriptors for these. + this.descriptors.stream = { + executeStreamingSql: new this._gaxModule.StreamDescriptor(this._gaxModule.StreamType.SERVER_STREAMING, !!opts.fallback, !!opts.gaxServerStreamingRetries), + streamingRead: new this._gaxModule.StreamDescriptor(this._gaxModule.StreamType.SERVER_STREAMING, !!opts.fallback, !!opts.gaxServerStreamingRetries), + batchWrite: new this._gaxModule.StreamDescriptor(this._gaxModule.StreamType.SERVER_STREAMING, !!opts.fallback, !!opts.gaxServerStreamingRetries) + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.spanner.v1.Spanner', gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.spannerStub) { + return this.spannerStub; + } + + // Put together the "service stub" for + // google.spanner.v1.Spanner. + this.spannerStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.spanner.v1.Spanner') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.spanner.v1.Spanner, + this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const spannerStubMethods = + ['createSession', 'batchCreateSessions', 'getSession', 'listSessions', 'deleteSession', 'executeSql', 'executeStreamingSql', 'executeBatchDml', 'read', 'streamingRead', 'beginTransaction', 'commit', 'rollback', 'partitionQuery', 'partitionRead', 'batchWrite']; + for (const methodName of spannerStubMethods) { + const callPromise = this.spannerStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + if (methodName in this.descriptors.stream) { + const stream = new PassThrough({objectMode: true}); + setImmediate(() => { + stream.emit('error', new this._gaxModule.GoogleError('The client has already been closed.')); + }); + return stream; + } + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.stream[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.spannerStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'spanner.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'spanner.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/spanner.data' + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- +/** + * Creates a new session. A session can be used to perform + * transactions that read and/or modify data in a Cloud Spanner database. + * Sessions are meant to be reused for many consecutive + * transactions. + * + * Sessions can only execute one transaction at a time. To execute + * multiple concurrent read-write/write-only transactions, create + * multiple sessions. Note that standalone reads and queries use a + * transaction internally, and count toward the one transaction + * limit. + * + * Active sessions use additional server resources, so it's a good idea to + * delete idle and unneeded sessions. + * Aside from explicit deletes, Cloud Spanner can delete sessions when no + * operations are sent for more than an hour. If a session is deleted, + * requests to it return `NOT_FOUND`. + * + * Idle sessions can be kept alive by sending a trivial SQL query + * periodically, for example, `"SELECT 1"`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.database + * Required. The database in which the new session is created. + * @param {google.spanner.v1.Session} request.session + * Required. The session to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.spanner.v1.Session|Session}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + */ + createSession( + request?: protos.google.spanner.v1.ICreateSessionRequest, + options?: CallOptions): + Promise<[ + protos.google.spanner.v1.ISession, + protos.google.spanner.v1.ICreateSessionRequest|undefined, {}|undefined + ]>; + createSession( + request: protos.google.spanner.v1.ICreateSessionRequest, + options: CallOptions, + callback: Callback< + protos.google.spanner.v1.ISession, + protos.google.spanner.v1.ICreateSessionRequest|null|undefined, + {}|null|undefined>): void; + createSession( + request: protos.google.spanner.v1.ICreateSessionRequest, + callback: Callback< + protos.google.spanner.v1.ISession, + protos.google.spanner.v1.ICreateSessionRequest|null|undefined, + {}|null|undefined>): void; + createSession( + request?: protos.google.spanner.v1.ICreateSessionRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.spanner.v1.ISession, + protos.google.spanner.v1.ICreateSessionRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.spanner.v1.ISession, + protos.google.spanner.v1.ICreateSessionRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.spanner.v1.ISession, + protos.google.spanner.v1.ICreateSessionRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'database': request.database ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('createSession request %j', request); + const wrappedCallback: Callback< + protos.google.spanner.v1.ISession, + protos.google.spanner.v1.ICreateSessionRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createSession response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.createSession(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.spanner.v1.ISession, + protos.google.spanner.v1.ICreateSessionRequest|undefined, + {}|undefined + ]) => { + this._log.info('createSession response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Creates multiple new sessions. + * + * This API can be used to initialize a session cache on the clients. + * See https://goo.gl/TgSFN2 for best practices on session cache management. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.database + * Required. The database in which the new sessions are created. + * @param {google.spanner.v1.Session} request.sessionTemplate + * Parameters to apply to each created session. + * @param {number} request.sessionCount + * Required. The number of sessions to be created in this batch call. At least + * one session is created. The API can return fewer than the requested number + * of sessions. If a specific number of sessions are desired, the client can + * make additional calls to `BatchCreateSessions` (adjusting + * {@link protos.google.spanner.v1.BatchCreateSessionsRequest.session_count|session_count} + * as necessary). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.spanner.v1.BatchCreateSessionsResponse|BatchCreateSessionsResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + */ + batchCreateSessions( + request?: protos.google.spanner.v1.IBatchCreateSessionsRequest, + options?: CallOptions): + Promise<[ + protos.google.spanner.v1.IBatchCreateSessionsResponse, + protos.google.spanner.v1.IBatchCreateSessionsRequest|undefined, {}|undefined + ]>; + batchCreateSessions( + request: protos.google.spanner.v1.IBatchCreateSessionsRequest, + options: CallOptions, + callback: Callback< + protos.google.spanner.v1.IBatchCreateSessionsResponse, + protos.google.spanner.v1.IBatchCreateSessionsRequest|null|undefined, + {}|null|undefined>): void; + batchCreateSessions( + request: protos.google.spanner.v1.IBatchCreateSessionsRequest, + callback: Callback< + protos.google.spanner.v1.IBatchCreateSessionsResponse, + protos.google.spanner.v1.IBatchCreateSessionsRequest|null|undefined, + {}|null|undefined>): void; + batchCreateSessions( + request?: protos.google.spanner.v1.IBatchCreateSessionsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.spanner.v1.IBatchCreateSessionsResponse, + protos.google.spanner.v1.IBatchCreateSessionsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.spanner.v1.IBatchCreateSessionsResponse, + protos.google.spanner.v1.IBatchCreateSessionsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.spanner.v1.IBatchCreateSessionsResponse, + protos.google.spanner.v1.IBatchCreateSessionsRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'database': request.database ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('batchCreateSessions request %j', request); + const wrappedCallback: Callback< + protos.google.spanner.v1.IBatchCreateSessionsResponse, + protos.google.spanner.v1.IBatchCreateSessionsRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('batchCreateSessions response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.batchCreateSessions(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.spanner.v1.IBatchCreateSessionsResponse, + protos.google.spanner.v1.IBatchCreateSessionsRequest|undefined, + {}|undefined + ]) => { + this._log.info('batchCreateSessions response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Gets a session. Returns `NOT_FOUND` if the session doesn't exist. + * This is mainly useful for determining whether a session is still + * alive. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the session to retrieve. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.spanner.v1.Session|Session}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + */ + getSession( + request?: protos.google.spanner.v1.IGetSessionRequest, + options?: CallOptions): + Promise<[ + protos.google.spanner.v1.ISession, + protos.google.spanner.v1.IGetSessionRequest|undefined, {}|undefined + ]>; + getSession( + request: protos.google.spanner.v1.IGetSessionRequest, + options: CallOptions, + callback: Callback< + protos.google.spanner.v1.ISession, + protos.google.spanner.v1.IGetSessionRequest|null|undefined, + {}|null|undefined>): void; + getSession( + request: protos.google.spanner.v1.IGetSessionRequest, + callback: Callback< + protos.google.spanner.v1.ISession, + protos.google.spanner.v1.IGetSessionRequest|null|undefined, + {}|null|undefined>): void; + getSession( + request?: protos.google.spanner.v1.IGetSessionRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.spanner.v1.ISession, + protos.google.spanner.v1.IGetSessionRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.spanner.v1.ISession, + protos.google.spanner.v1.IGetSessionRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.spanner.v1.ISession, + protos.google.spanner.v1.IGetSessionRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getSession request %j', request); + const wrappedCallback: Callback< + protos.google.spanner.v1.ISession, + protos.google.spanner.v1.IGetSessionRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getSession response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getSession(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.spanner.v1.ISession, + protos.google.spanner.v1.IGetSessionRequest|undefined, + {}|undefined + ]) => { + this._log.info('getSession response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Ends a session, releasing server resources associated with it. This + * asynchronously triggers the cancellation of any operations that are running + * with this session. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the session to delete. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + */ + deleteSession( + request?: protos.google.spanner.v1.IDeleteSessionRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.spanner.v1.IDeleteSessionRequest|undefined, {}|undefined + ]>; + deleteSession( + request: protos.google.spanner.v1.IDeleteSessionRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.spanner.v1.IDeleteSessionRequest|null|undefined, + {}|null|undefined>): void; + deleteSession( + request: protos.google.spanner.v1.IDeleteSessionRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.spanner.v1.IDeleteSessionRequest|null|undefined, + {}|null|undefined>): void; + deleteSession( + request?: protos.google.spanner.v1.IDeleteSessionRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.spanner.v1.IDeleteSessionRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.spanner.v1.IDeleteSessionRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.spanner.v1.IDeleteSessionRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('deleteSession request %j', request); + const wrappedCallback: Callback< + protos.google.protobuf.IEmpty, + protos.google.spanner.v1.IDeleteSessionRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteSession response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.deleteSession(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.spanner.v1.IDeleteSessionRequest|undefined, + {}|undefined + ]) => { + this._log.info('deleteSession response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Executes an SQL statement, returning all results in a single reply. This + * method can't be used to return a result set larger than 10 MiB; + * if the query yields more data than that, the query fails with + * a `FAILED_PRECONDITION` error. + * + * Operations inside read-write transactions might return `ABORTED`. If + * this occurs, the application should restart the transaction from + * the beginning. See {@link protos.google.spanner.v1.Transaction|Transaction} for more + * details. + * + * Larger result sets can be fetched in streaming fashion by calling + * {@link protos.google.spanner.v1.Spanner.ExecuteStreamingSql|ExecuteStreamingSql} + * instead. + * + * The query string can be SQL or [Graph Query Language + * (GQL)](https://cloud.google.com/spanner/docs/reference/standard-sql/graph-intro). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.session + * Required. The session in which the SQL query should be performed. + * @param {google.spanner.v1.TransactionSelector} request.transaction + * The transaction to use. + * + * For queries, if none is provided, the default is a temporary read-only + * transaction with strong concurrency. + * + * Standard DML statements require a read-write transaction. To protect + * against replays, single-use transactions are not supported. The caller + * must either supply an existing transaction ID or begin a new transaction. + * + * Partitioned DML requires an existing Partitioned DML transaction ID. + * @param {string} request.sql + * Required. The SQL string. + * @param {google.protobuf.Struct} request.params + * Parameter names and values that bind to placeholders in the SQL string. + * + * A parameter placeholder consists of the `@` character followed by the + * parameter name (for example, `@firstName`). Parameter names must conform + * to the naming requirements of identifiers as specified at + * https://cloud.google.com/spanner/docs/lexical#identifiers. + * + * Parameters can appear anywhere that a literal value is expected. The same + * parameter name can be used more than once, for example: + * + * `"WHERE id > @msg_id AND id < @msg_id + 100"` + * + * It's an error to execute a SQL statement with unbound parameters. + * @param {number[]} request.paramTypes + * It isn't always possible for Cloud Spanner to infer the right SQL type + * from a JSON value. For example, values of type `BYTES` and values + * of type `STRING` both appear in + * {@link protos.google.spanner.v1.ExecuteSqlRequest.params|params} as JSON strings. + * + * In these cases, you can use `param_types` to specify the exact + * SQL type for some or all of the SQL statement parameters. See the + * definition of {@link protos.google.spanner.v1.Type|Type} for more information + * about SQL types. + * @param {Buffer} request.resumeToken + * If this request is resuming a previously interrupted SQL statement + * execution, `resume_token` should be copied from the last + * {@link protos.google.spanner.v1.PartialResultSet|PartialResultSet} yielded before the + * interruption. Doing this enables the new SQL statement execution to resume + * where the last one left off. The rest of the request parameters must + * exactly match the request that yielded this token. + * @param {google.spanner.v1.ExecuteSqlRequest.QueryMode} request.queryMode + * Used to control the amount of debugging information returned in + * {@link protos.google.spanner.v1.ResultSetStats|ResultSetStats}. If + * {@link protos.google.spanner.v1.ExecuteSqlRequest.partition_token|partition_token} is + * set, {@link protos.google.spanner.v1.ExecuteSqlRequest.query_mode|query_mode} can only + * be set to + * {@link protos.google.spanner.v1.ExecuteSqlRequest.QueryMode.NORMAL|QueryMode.NORMAL}. + * @param {Buffer} request.partitionToken + * If present, results are restricted to the specified partition + * previously created using `PartitionQuery`. There must be an exact + * match for the values of fields common to this message and the + * `PartitionQueryRequest` message used to create this `partition_token`. + * @param {number} request.seqno + * A per-transaction sequence number used to identify this request. This field + * makes each request idempotent such that if the request is received multiple + * times, at most one succeeds. + * + * The sequence number must be monotonically increasing within the + * transaction. If a request arrives for the first time with an out-of-order + * sequence number, the transaction can be aborted. Replays of previously + * handled requests yield the same response as the first execution. + * + * Required for DML statements. Ignored for queries. + * @param {google.spanner.v1.ExecuteSqlRequest.QueryOptions} request.queryOptions + * Query optimizer configuration to use for the given query. + * @param {google.spanner.v1.RequestOptions} request.requestOptions + * Common options for this request. + * @param {google.spanner.v1.DirectedReadOptions} request.directedReadOptions + * Directed read options for this request. + * @param {boolean} request.dataBoostEnabled + * If this is for a partitioned query and this field is set to `true`, the + * request is executed with Spanner Data Boost independent compute resources. + * + * If the field is set to `true` but the request doesn't set + * `partition_token`, the API returns an `INVALID_ARGUMENT` error. + * @param {boolean} [request.lastStatement] + * Optional. If set to `true`, this statement marks the end of the + * transaction. After this statement executes, you must commit or abort the + * transaction. Attempts to execute any other requests against this + * transaction (including reads and queries) are rejected. + * + * For DML statements, setting this option might cause some error reporting to + * be deferred until commit time (for example, validation of unique + * constraints). Given this, successful execution of a DML statement shouldn't + * be assumed until a subsequent `Commit` call completes successfully. + * @param {google.spanner.v1.RoutingHint} [request.routingHint] + * Optional. If present, it makes the Spanner requests location-aware. + * + * It gives the server hints that can be used to route the request + * to an appropriate server, potentially significantly decreasing latency and + * improving throughput. To achieve improved performance, most fields must be + * filled in with accurate values. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.spanner.v1.ResultSet|ResultSet}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + */ + executeSql( + request?: protos.google.spanner.v1.IExecuteSqlRequest, + options?: CallOptions): + Promise<[ + protos.google.spanner.v1.IResultSet, + protos.google.spanner.v1.IExecuteSqlRequest|undefined, {}|undefined + ]>; + executeSql( + request: protos.google.spanner.v1.IExecuteSqlRequest, + options: CallOptions, + callback: Callback< + protos.google.spanner.v1.IResultSet, + protos.google.spanner.v1.IExecuteSqlRequest|null|undefined, + {}|null|undefined>): void; + executeSql( + request: protos.google.spanner.v1.IExecuteSqlRequest, + callback: Callback< + protos.google.spanner.v1.IResultSet, + protos.google.spanner.v1.IExecuteSqlRequest|null|undefined, + {}|null|undefined>): void; + executeSql( + request?: protos.google.spanner.v1.IExecuteSqlRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.spanner.v1.IResultSet, + protos.google.spanner.v1.IExecuteSqlRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.spanner.v1.IResultSet, + protos.google.spanner.v1.IExecuteSqlRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.spanner.v1.IResultSet, + protos.google.spanner.v1.IExecuteSqlRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'session': request.session ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('executeSql request %j', request); + const wrappedCallback: Callback< + protos.google.spanner.v1.IResultSet, + protos.google.spanner.v1.IExecuteSqlRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('executeSql response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.executeSql(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.spanner.v1.IResultSet, + protos.google.spanner.v1.IExecuteSqlRequest|undefined, + {}|undefined + ]) => { + this._log.info('executeSql response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Executes a batch of SQL DML statements. This method allows many statements + * to be run with lower latency than submitting them sequentially with + * {@link protos.google.spanner.v1.Spanner.ExecuteSql|ExecuteSql}. + * + * Statements are executed in sequential order. A request can succeed even if + * a statement fails. The + * {@link protos.google.spanner.v1.ExecuteBatchDmlResponse.status|ExecuteBatchDmlResponse.status} + * field in the response provides information about the statement that failed. + * Clients must inspect this field to determine whether an error occurred. + * + * Execution stops after the first failed statement; the remaining statements + * are not executed. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.session + * Required. The session in which the DML statements should be performed. + * @param {google.spanner.v1.TransactionSelector} request.transaction + * Required. The transaction to use. Must be a read-write transaction. + * + * To protect against replays, single-use transactions are not supported. The + * caller must either supply an existing transaction ID or begin a new + * transaction. + * @param {number[]} request.statements + * Required. The list of statements to execute in this batch. Statements are + * executed serially, such that the effects of statement `i` are visible to + * statement `i+1`. Each statement must be a DML statement. Execution stops at + * the first failed statement; the remaining statements are not executed. + * + * Callers must provide at least one statement. + * @param {number} request.seqno + * Required. A per-transaction sequence number used to identify this request. + * This field makes each request idempotent such that if the request is + * received multiple times, at most one succeeds. + * + * The sequence number must be monotonically increasing within the + * transaction. If a request arrives for the first time with an out-of-order + * sequence number, the transaction might be aborted. Replays of previously + * handled requests yield the same response as the first execution. + * @param {google.spanner.v1.RequestOptions} request.requestOptions + * Common options for this request. + * @param {boolean} [request.lastStatements] + * Optional. If set to `true`, this request marks the end of the transaction. + * After these statements execute, you must commit or abort the transaction. + * Attempts to execute any other requests against this transaction + * (including reads and queries) are rejected. + * + * Setting this option might cause some error reporting to be deferred until + * commit time (for example, validation of unique constraints). Given this, + * successful execution of statements shouldn't be assumed until a subsequent + * `Commit` call completes successfully. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.spanner.v1.ExecuteBatchDmlResponse|ExecuteBatchDmlResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + */ + executeBatchDml( + request?: protos.google.spanner.v1.IExecuteBatchDmlRequest, + options?: CallOptions): + Promise<[ + protos.google.spanner.v1.IExecuteBatchDmlResponse, + protos.google.spanner.v1.IExecuteBatchDmlRequest|undefined, {}|undefined + ]>; + executeBatchDml( + request: protos.google.spanner.v1.IExecuteBatchDmlRequest, + options: CallOptions, + callback: Callback< + protos.google.spanner.v1.IExecuteBatchDmlResponse, + protos.google.spanner.v1.IExecuteBatchDmlRequest|null|undefined, + {}|null|undefined>): void; + executeBatchDml( + request: protos.google.spanner.v1.IExecuteBatchDmlRequest, + callback: Callback< + protos.google.spanner.v1.IExecuteBatchDmlResponse, + protos.google.spanner.v1.IExecuteBatchDmlRequest|null|undefined, + {}|null|undefined>): void; + executeBatchDml( + request?: protos.google.spanner.v1.IExecuteBatchDmlRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.spanner.v1.IExecuteBatchDmlResponse, + protos.google.spanner.v1.IExecuteBatchDmlRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.spanner.v1.IExecuteBatchDmlResponse, + protos.google.spanner.v1.IExecuteBatchDmlRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.spanner.v1.IExecuteBatchDmlResponse, + protos.google.spanner.v1.IExecuteBatchDmlRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'session': request.session ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('executeBatchDml request %j', request); + const wrappedCallback: Callback< + protos.google.spanner.v1.IExecuteBatchDmlResponse, + protos.google.spanner.v1.IExecuteBatchDmlRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('executeBatchDml response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.executeBatchDml(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.spanner.v1.IExecuteBatchDmlResponse, + protos.google.spanner.v1.IExecuteBatchDmlRequest|undefined, + {}|undefined + ]) => { + this._log.info('executeBatchDml response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Reads rows from the database using key lookups and scans, as a + * simple key/value style alternative to + * {@link protos.google.spanner.v1.Spanner.ExecuteSql|ExecuteSql}. This method can't be + * used to return a result set larger than 10 MiB; if the read matches more + * data than that, the read fails with a `FAILED_PRECONDITION` + * error. + * + * Reads inside read-write transactions might return `ABORTED`. If + * this occurs, the application should restart the transaction from + * the beginning. See {@link protos.google.spanner.v1.Transaction|Transaction} for more + * details. + * + * Larger result sets can be yielded in streaming fashion by calling + * {@link protos.google.spanner.v1.Spanner.StreamingRead|StreamingRead} instead. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.session + * Required. The session in which the read should be performed. + * @param {google.spanner.v1.TransactionSelector} request.transaction + * The transaction to use. If none is provided, the default is a + * temporary read-only transaction with strong concurrency. + * @param {string} request.table + * Required. The name of the table in the database to be read. + * @param {string} request.index + * If non-empty, the name of an index on + * {@link protos.google.spanner.v1.ReadRequest.table|table}. This index is used instead of + * the table primary key when interpreting + * {@link protos.google.spanner.v1.ReadRequest.key_set|key_set} and sorting result rows. + * See {@link protos.google.spanner.v1.ReadRequest.key_set|key_set} for further + * information. + * @param {string[]} request.columns + * Required. The columns of {@link protos.google.spanner.v1.ReadRequest.table|table} to be + * returned for each row matching this request. + * @param {google.spanner.v1.KeySet} request.keySet + * Required. `key_set` identifies the rows to be yielded. `key_set` names the + * primary keys of the rows in {@link protos.google.spanner.v1.ReadRequest.table|table} to + * be yielded, unless {@link protos.google.spanner.v1.ReadRequest.index|index} is present. + * If {@link protos.google.spanner.v1.ReadRequest.index|index} is present, then + * {@link protos.google.spanner.v1.ReadRequest.key_set|key_set} instead names index keys + * in {@link protos.google.spanner.v1.ReadRequest.index|index}. + * + * If the {@link protos.google.spanner.v1.ReadRequest.partition_token|partition_token} + * field is empty, rows are yielded in table primary key order (if + * {@link protos.google.spanner.v1.ReadRequest.index|index} is empty) or index key order + * (if {@link protos.google.spanner.v1.ReadRequest.index|index} is non-empty). If the + * {@link protos.google.spanner.v1.ReadRequest.partition_token|partition_token} field + * isn't empty, rows are yielded in an unspecified order. + * + * It isn't an error for the `key_set` to name rows that don't + * exist in the database. Read yields nothing for nonexistent rows. + * @param {number} request.limit + * If greater than zero, only the first `limit` rows are yielded. If `limit` + * is zero, the default is no limit. A limit can't be specified if + * `partition_token` is set. + * @param {Buffer} request.resumeToken + * If this request is resuming a previously interrupted read, + * `resume_token` should be copied from the last + * {@link protos.google.spanner.v1.PartialResultSet|PartialResultSet} yielded before the + * interruption. Doing this enables the new read to resume where the last read + * left off. The rest of the request parameters must exactly match the request + * that yielded this token. + * @param {Buffer} request.partitionToken + * If present, results are restricted to the specified partition + * previously created using `PartitionRead`. There must be an exact + * match for the values of fields common to this message and the + * PartitionReadRequest message used to create this partition_token. + * @param {google.spanner.v1.RequestOptions} request.requestOptions + * Common options for this request. + * @param {google.spanner.v1.DirectedReadOptions} request.directedReadOptions + * Directed read options for this request. + * @param {boolean} request.dataBoostEnabled + * If this is for a partitioned read and this field is set to `true`, the + * request is executed with Spanner Data Boost independent compute resources. + * + * If the field is set to `true` but the request doesn't set + * `partition_token`, the API returns an `INVALID_ARGUMENT` error. + * @param {google.spanner.v1.ReadRequest.OrderBy} [request.orderBy] + * Optional. Order for the returned rows. + * + * By default, Spanner returns result rows in primary key order except for + * PartitionRead requests. For applications that don't require rows to be + * returned in primary key (`ORDER_BY_PRIMARY_KEY`) order, setting + * `ORDER_BY_NO_ORDER` option allows Spanner to optimize row retrieval, + * resulting in lower latencies in certain cases (for example, bulk point + * lookups). + * @param {google.spanner.v1.ReadRequest.LockHint} [request.lockHint] + * Optional. Lock Hint for the request, it can only be used with read-write + * transactions. + * @param {google.spanner.v1.RoutingHint} [request.routingHint] + * Optional. If present, it makes the Spanner requests location-aware. + * + * It gives the server hints that can be used to route the request + * to an appropriate server, potentially significantly decreasing latency and + * improving throughput. To achieve improved performance, most fields must be + * filled in with accurate values. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.spanner.v1.ResultSet|ResultSet}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + */ + read( + request?: protos.google.spanner.v1.IReadRequest, + options?: CallOptions): + Promise<[ + protos.google.spanner.v1.IResultSet, + protos.google.spanner.v1.IReadRequest|undefined, {}|undefined + ]>; + read( + request: protos.google.spanner.v1.IReadRequest, + options: CallOptions, + callback: Callback< + protos.google.spanner.v1.IResultSet, + protos.google.spanner.v1.IReadRequest|null|undefined, + {}|null|undefined>): void; + read( + request: protos.google.spanner.v1.IReadRequest, + callback: Callback< + protos.google.spanner.v1.IResultSet, + protos.google.spanner.v1.IReadRequest|null|undefined, + {}|null|undefined>): void; + read( + request?: protos.google.spanner.v1.IReadRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.spanner.v1.IResultSet, + protos.google.spanner.v1.IReadRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.spanner.v1.IResultSet, + protos.google.spanner.v1.IReadRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.spanner.v1.IResultSet, + protos.google.spanner.v1.IReadRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'session': request.session ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('read request %j', request); + const wrappedCallback: Callback< + protos.google.spanner.v1.IResultSet, + protos.google.spanner.v1.IReadRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('read response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.read(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.spanner.v1.IResultSet, + protos.google.spanner.v1.IReadRequest|undefined, + {}|undefined + ]) => { + this._log.info('read response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Begins a new transaction. This step can often be skipped: + * {@link protos.google.spanner.v1.Spanner.Read|Read}, + * {@link protos.google.spanner.v1.Spanner.ExecuteSql|ExecuteSql} and + * {@link protos.google.spanner.v1.Spanner.Commit|Commit} can begin a new transaction as a + * side-effect. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.session + * Required. The session in which the transaction runs. + * @param {google.spanner.v1.TransactionOptions} request.options + * Required. Options for the new transaction. + * @param {google.spanner.v1.RequestOptions} request.requestOptions + * Common options for this request. + * Priority is ignored for this request. Setting the priority in this + * `request_options` struct doesn't do anything. To set the priority for a + * transaction, set it on the reads and writes that are part of this + * transaction instead. + * @param {google.spanner.v1.Mutation} [request.mutationKey] + * Optional. Required for read-write transactions on a multiplexed session + * that commit mutations but don't perform any reads or queries. You must + * randomly select one of the mutations from the mutation set and send it as a + * part of this request. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.spanner.v1.Transaction|Transaction}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + */ + beginTransaction( + request?: protos.google.spanner.v1.IBeginTransactionRequest, + options?: CallOptions): + Promise<[ + protos.google.spanner.v1.ITransaction, + protos.google.spanner.v1.IBeginTransactionRequest|undefined, {}|undefined + ]>; + beginTransaction( + request: protos.google.spanner.v1.IBeginTransactionRequest, + options: CallOptions, + callback: Callback< + protos.google.spanner.v1.ITransaction, + protos.google.spanner.v1.IBeginTransactionRequest|null|undefined, + {}|null|undefined>): void; + beginTransaction( + request: protos.google.spanner.v1.IBeginTransactionRequest, + callback: Callback< + protos.google.spanner.v1.ITransaction, + protos.google.spanner.v1.IBeginTransactionRequest|null|undefined, + {}|null|undefined>): void; + beginTransaction( + request?: protos.google.spanner.v1.IBeginTransactionRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.spanner.v1.ITransaction, + protos.google.spanner.v1.IBeginTransactionRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.spanner.v1.ITransaction, + protos.google.spanner.v1.IBeginTransactionRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.spanner.v1.ITransaction, + protos.google.spanner.v1.IBeginTransactionRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'session': request.session ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('beginTransaction request %j', request); + const wrappedCallback: Callback< + protos.google.spanner.v1.ITransaction, + protos.google.spanner.v1.IBeginTransactionRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('beginTransaction response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.beginTransaction(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.spanner.v1.ITransaction, + protos.google.spanner.v1.IBeginTransactionRequest|undefined, + {}|undefined + ]) => { + this._log.info('beginTransaction response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Commits a transaction. The request includes the mutations to be + * applied to rows in the database. + * + * `Commit` might return an `ABORTED` error. This can occur at any time; + * commonly, the cause is conflicts with concurrent + * transactions. However, it can also happen for a variety of other + * reasons. If `Commit` returns `ABORTED`, the caller should retry + * the transaction from the beginning, reusing the same session. + * + * On very rare occasions, `Commit` might return `UNKNOWN`. This can happen, + * for example, if the client job experiences a 1+ hour networking failure. + * At that point, Cloud Spanner has lost track of the transaction outcome and + * we recommend that you perform another read from the database to see the + * state of things as they are now. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.session + * Required. The session in which the transaction to be committed is running. + * @param {Buffer} request.transactionId + * Commit a previously-started transaction. + * @param {google.spanner.v1.TransactionOptions} request.singleUseTransaction + * Execute mutations in a temporary transaction. Note that unlike + * commit of a previously-started transaction, commit with a + * temporary transaction is non-idempotent. That is, if the + * `CommitRequest` is sent to Cloud Spanner more than once (for + * instance, due to retries in the application, or in the + * transport library), it's possible that the mutations are + * executed more than once. If this is undesirable, use + * {@link protos.google.spanner.v1.Spanner.BeginTransaction|BeginTransaction} and + * {@link protos.google.spanner.v1.Spanner.Commit|Commit} instead. + * @param {number[]} request.mutations + * The mutations to be executed when this transaction commits. All + * mutations are applied atomically, in the order they appear in + * this list. + * @param {boolean} request.returnCommitStats + * If `true`, then statistics related to the transaction is included in + * the {@link protos.google.spanner.v1.CommitResponse.commit_stats|CommitResponse}. + * Default value is `false`. + * @param {google.protobuf.Duration} [request.maxCommitDelay] + * Optional. The amount of latency this request is configured to incur in + * order to improve throughput. If this field isn't set, Spanner assumes + * requests are relatively latency sensitive and automatically determines an + * appropriate delay time. You can specify a commit delay value between 0 and + * 500 ms. + * @param {google.spanner.v1.RequestOptions} request.requestOptions + * Common options for this request. + * @param {google.spanner.v1.MultiplexedSessionPrecommitToken} [request.precommitToken] + * Optional. If the read-write transaction was executed on a multiplexed + * session, then you must include the precommit token with the highest + * sequence number received in this transaction attempt. Failing to do so + * results in a `FailedPrecondition` error. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.spanner.v1.CommitResponse|CommitResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + */ + commit( + request?: protos.google.spanner.v1.ICommitRequest, + options?: CallOptions): + Promise<[ + protos.google.spanner.v1.ICommitResponse, + protos.google.spanner.v1.ICommitRequest|undefined, {}|undefined + ]>; + commit( + request: protos.google.spanner.v1.ICommitRequest, + options: CallOptions, + callback: Callback< + protos.google.spanner.v1.ICommitResponse, + protos.google.spanner.v1.ICommitRequest|null|undefined, + {}|null|undefined>): void; + commit( + request: protos.google.spanner.v1.ICommitRequest, + callback: Callback< + protos.google.spanner.v1.ICommitResponse, + protos.google.spanner.v1.ICommitRequest|null|undefined, + {}|null|undefined>): void; + commit( + request?: protos.google.spanner.v1.ICommitRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.spanner.v1.ICommitResponse, + protos.google.spanner.v1.ICommitRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.spanner.v1.ICommitResponse, + protos.google.spanner.v1.ICommitRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.spanner.v1.ICommitResponse, + protos.google.spanner.v1.ICommitRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'session': request.session ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('commit request %j', request); + const wrappedCallback: Callback< + protos.google.spanner.v1.ICommitResponse, + protos.google.spanner.v1.ICommitRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('commit response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.commit(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.spanner.v1.ICommitResponse, + protos.google.spanner.v1.ICommitRequest|undefined, + {}|undefined + ]) => { + this._log.info('commit response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Rolls back a transaction, releasing any locks it holds. It's a good + * idea to call this for any transaction that includes one or more + * {@link protos.google.spanner.v1.Spanner.Read|Read} or + * {@link protos.google.spanner.v1.Spanner.ExecuteSql|ExecuteSql} requests and ultimately + * decides not to commit. + * + * `Rollback` returns `OK` if it successfully aborts the transaction, the + * transaction was already aborted, or the transaction isn't + * found. `Rollback` never returns `ABORTED`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.session + * Required. The session in which the transaction to roll back is running. + * @param {Buffer} request.transactionId + * Required. The transaction to roll back. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + */ + rollback( + request?: protos.google.spanner.v1.IRollbackRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.spanner.v1.IRollbackRequest|undefined, {}|undefined + ]>; + rollback( + request: protos.google.spanner.v1.IRollbackRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.spanner.v1.IRollbackRequest|null|undefined, + {}|null|undefined>): void; + rollback( + request: protos.google.spanner.v1.IRollbackRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.spanner.v1.IRollbackRequest|null|undefined, + {}|null|undefined>): void; + rollback( + request?: protos.google.spanner.v1.IRollbackRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.spanner.v1.IRollbackRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.spanner.v1.IRollbackRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.spanner.v1.IRollbackRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'session': request.session ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('rollback request %j', request); + const wrappedCallback: Callback< + protos.google.protobuf.IEmpty, + protos.google.spanner.v1.IRollbackRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('rollback response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.rollback(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.spanner.v1.IRollbackRequest|undefined, + {}|undefined + ]) => { + this._log.info('rollback response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Creates a set of partition tokens that can be used to execute a query + * operation in parallel. Each of the returned partition tokens can be used + * by {@link protos.google.spanner.v1.Spanner.ExecuteStreamingSql|ExecuteStreamingSql} to + * specify a subset of the query result to read. The same session and + * read-only transaction must be used by the `PartitionQueryRequest` used to + * create the partition tokens and the `ExecuteSqlRequests` that use the + * partition tokens. + * + * Partition tokens become invalid when the session used to create them + * is deleted, is idle for too long, begins a new transaction, or becomes too + * old. When any of these happen, it isn't possible to resume the query, and + * the whole operation must be restarted from the beginning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.session + * Required. The session used to create the partitions. + * @param {google.spanner.v1.TransactionSelector} request.transaction + * Read-only snapshot transactions are supported, read and write and + * single-use transactions are not. + * @param {string} request.sql + * Required. The query request to generate partitions for. The request fails + * if the query isn't root partitionable. For a query to be root + * partitionable, it needs to satisfy a few conditions. For example, if the + * query execution plan contains a distributed union operator, then it must be + * the first operator in the plan. For more information about other + * conditions, see [Read data in + * parallel](https://cloud.google.com/spanner/docs/reads#read_data_in_parallel). + * + * The query request must not contain DML commands, such as `INSERT`, + * `UPDATE`, or `DELETE`. Use + * {@link protos.google.spanner.v1.Spanner.ExecuteStreamingSql|`ExecuteStreamingSql`} with + * a `PartitionedDml` transaction for large, partition-friendly DML + * operations. + * @param {google.protobuf.Struct} [request.params] + * Optional. Parameter names and values that bind to placeholders in the SQL + * string. + * + * A parameter placeholder consists of the `@` character followed by the + * parameter name (for example, `@firstName`). Parameter names can contain + * letters, numbers, and underscores. + * + * Parameters can appear anywhere that a literal value is expected. The same + * parameter name can be used more than once, for example: + * + * `"WHERE id > @msg_id AND id < @msg_id + 100"` + * + * It's an error to execute a SQL statement with unbound parameters. + * @param {number[]} [request.paramTypes] + * Optional. It isn't always possible for Cloud Spanner to infer the right SQL + * type from a JSON value. For example, values of type `BYTES` and values of + * type `STRING` both appear in + * {@link protos.google.spanner.v1.PartitionQueryRequest.params|params} as JSON strings. + * + * In these cases, `param_types` can be used to specify the exact + * SQL type for some or all of the SQL query parameters. See the + * definition of {@link protos.google.spanner.v1.Type|Type} for more information + * about SQL types. + * @param {google.spanner.v1.PartitionOptions} request.partitionOptions + * Additional options that affect how many partitions are created. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.spanner.v1.PartitionResponse|PartitionResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + */ + partitionQuery( + request?: protos.google.spanner.v1.IPartitionQueryRequest, + options?: CallOptions): + Promise<[ + protos.google.spanner.v1.IPartitionResponse, + protos.google.spanner.v1.IPartitionQueryRequest|undefined, {}|undefined + ]>; + partitionQuery( + request: protos.google.spanner.v1.IPartitionQueryRequest, + options: CallOptions, + callback: Callback< + protos.google.spanner.v1.IPartitionResponse, + protos.google.spanner.v1.IPartitionQueryRequest|null|undefined, + {}|null|undefined>): void; + partitionQuery( + request: protos.google.spanner.v1.IPartitionQueryRequest, + callback: Callback< + protos.google.spanner.v1.IPartitionResponse, + protos.google.spanner.v1.IPartitionQueryRequest|null|undefined, + {}|null|undefined>): void; + partitionQuery( + request?: protos.google.spanner.v1.IPartitionQueryRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.spanner.v1.IPartitionResponse, + protos.google.spanner.v1.IPartitionQueryRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.spanner.v1.IPartitionResponse, + protos.google.spanner.v1.IPartitionQueryRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.spanner.v1.IPartitionResponse, + protos.google.spanner.v1.IPartitionQueryRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'session': request.session ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('partitionQuery request %j', request); + const wrappedCallback: Callback< + protos.google.spanner.v1.IPartitionResponse, + protos.google.spanner.v1.IPartitionQueryRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('partitionQuery response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.partitionQuery(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.spanner.v1.IPartitionResponse, + protos.google.spanner.v1.IPartitionQueryRequest|undefined, + {}|undefined + ]) => { + this._log.info('partitionQuery response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Creates a set of partition tokens that can be used to execute a read + * operation in parallel. Each of the returned partition tokens can be used + * by {@link protos.google.spanner.v1.Spanner.StreamingRead|StreamingRead} to specify a + * subset of the read result to read. The same session and read-only + * transaction must be used by the `PartitionReadRequest` used to create the + * partition tokens and the `ReadRequests` that use the partition tokens. + * There are no ordering guarantees on rows returned among the returned + * partition tokens, or even within each individual `StreamingRead` call + * issued with a `partition_token`. + * + * Partition tokens become invalid when the session used to create them + * is deleted, is idle for too long, begins a new transaction, or becomes too + * old. When any of these happen, it isn't possible to resume the read, and + * the whole operation must be restarted from the beginning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.session + * Required. The session used to create the partitions. + * @param {google.spanner.v1.TransactionSelector} request.transaction + * Read only snapshot transactions are supported, read/write and single use + * transactions are not. + * @param {string} request.table + * Required. The name of the table in the database to be read. + * @param {string} request.index + * If non-empty, the name of an index on + * {@link protos.google.spanner.v1.PartitionReadRequest.table|table}. This index is used + * instead of the table primary key when interpreting + * {@link protos.google.spanner.v1.PartitionReadRequest.key_set|key_set} and sorting + * result rows. See {@link protos.google.spanner.v1.PartitionReadRequest.key_set|key_set} + * for further information. + * @param {string[]} request.columns + * The columns of {@link protos.google.spanner.v1.PartitionReadRequest.table|table} to be + * returned for each row matching this request. + * @param {google.spanner.v1.KeySet} request.keySet + * Required. `key_set` identifies the rows to be yielded. `key_set` names the + * primary keys of the rows in + * {@link protos.google.spanner.v1.PartitionReadRequest.table|table} to be yielded, unless + * {@link protos.google.spanner.v1.PartitionReadRequest.index|index} is present. If + * {@link protos.google.spanner.v1.PartitionReadRequest.index|index} is present, then + * {@link protos.google.spanner.v1.PartitionReadRequest.key_set|key_set} instead names + * index keys in {@link protos.google.spanner.v1.PartitionReadRequest.index|index}. + * + * It isn't an error for the `key_set` to name rows that don't + * exist in the database. Read yields nothing for nonexistent rows. + * @param {google.spanner.v1.PartitionOptions} request.partitionOptions + * Additional options that affect how many partitions are created. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.spanner.v1.PartitionResponse|PartitionResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + */ + partitionRead( + request?: protos.google.spanner.v1.IPartitionReadRequest, + options?: CallOptions): + Promise<[ + protos.google.spanner.v1.IPartitionResponse, + protos.google.spanner.v1.IPartitionReadRequest|undefined, {}|undefined + ]>; + partitionRead( + request: protos.google.spanner.v1.IPartitionReadRequest, + options: CallOptions, + callback: Callback< + protos.google.spanner.v1.IPartitionResponse, + protos.google.spanner.v1.IPartitionReadRequest|null|undefined, + {}|null|undefined>): void; + partitionRead( + request: protos.google.spanner.v1.IPartitionReadRequest, + callback: Callback< + protos.google.spanner.v1.IPartitionResponse, + protos.google.spanner.v1.IPartitionReadRequest|null|undefined, + {}|null|undefined>): void; + partitionRead( + request?: protos.google.spanner.v1.IPartitionReadRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.spanner.v1.IPartitionResponse, + protos.google.spanner.v1.IPartitionReadRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.spanner.v1.IPartitionResponse, + protos.google.spanner.v1.IPartitionReadRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.spanner.v1.IPartitionResponse, + protos.google.spanner.v1.IPartitionReadRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'session': request.session ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('partitionRead request %j', request); + const wrappedCallback: Callback< + protos.google.spanner.v1.IPartitionResponse, + protos.google.spanner.v1.IPartitionReadRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('partitionRead response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.partitionRead(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.spanner.v1.IPartitionResponse, + protos.google.spanner.v1.IPartitionReadRequest|undefined, + {}|undefined + ]) => { + this._log.info('partitionRead response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } + +/** + * Like {@link protos.google.spanner.v1.Spanner.ExecuteSql|ExecuteSql}, except returns the + * result set as a stream. Unlike + * {@link protos.google.spanner.v1.Spanner.ExecuteSql|ExecuteSql}, there is no limit on + * the size of the returned result set. However, no individual row in the + * result set can exceed 100 MiB, and no column value can exceed 10 MiB. + * + * The query string can be SQL or [Graph Query Language + * (GQL)](https://cloud.google.com/spanner/docs/reference/standard-sql/graph-intro). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.session + * Required. The session in which the SQL query should be performed. + * @param {google.spanner.v1.TransactionSelector} request.transaction + * The transaction to use. + * + * For queries, if none is provided, the default is a temporary read-only + * transaction with strong concurrency. + * + * Standard DML statements require a read-write transaction. To protect + * against replays, single-use transactions are not supported. The caller + * must either supply an existing transaction ID or begin a new transaction. + * + * Partitioned DML requires an existing Partitioned DML transaction ID. + * @param {string} request.sql + * Required. The SQL string. + * @param {google.protobuf.Struct} request.params + * Parameter names and values that bind to placeholders in the SQL string. + * + * A parameter placeholder consists of the `@` character followed by the + * parameter name (for example, `@firstName`). Parameter names must conform + * to the naming requirements of identifiers as specified at + * https://cloud.google.com/spanner/docs/lexical#identifiers. + * + * Parameters can appear anywhere that a literal value is expected. The same + * parameter name can be used more than once, for example: + * + * `"WHERE id > @msg_id AND id < @msg_id + 100"` + * + * It's an error to execute a SQL statement with unbound parameters. + * @param {number[]} request.paramTypes + * It isn't always possible for Cloud Spanner to infer the right SQL type + * from a JSON value. For example, values of type `BYTES` and values + * of type `STRING` both appear in + * {@link protos.google.spanner.v1.ExecuteSqlRequest.params|params} as JSON strings. + * + * In these cases, you can use `param_types` to specify the exact + * SQL type for some or all of the SQL statement parameters. See the + * definition of {@link protos.google.spanner.v1.Type|Type} for more information + * about SQL types. + * @param {Buffer} request.resumeToken + * If this request is resuming a previously interrupted SQL statement + * execution, `resume_token` should be copied from the last + * {@link protos.google.spanner.v1.PartialResultSet|PartialResultSet} yielded before the + * interruption. Doing this enables the new SQL statement execution to resume + * where the last one left off. The rest of the request parameters must + * exactly match the request that yielded this token. + * @param {google.spanner.v1.ExecuteSqlRequest.QueryMode} request.queryMode + * Used to control the amount of debugging information returned in + * {@link protos.google.spanner.v1.ResultSetStats|ResultSetStats}. If + * {@link protos.google.spanner.v1.ExecuteSqlRequest.partition_token|partition_token} is + * set, {@link protos.google.spanner.v1.ExecuteSqlRequest.query_mode|query_mode} can only + * be set to + * {@link protos.google.spanner.v1.ExecuteSqlRequest.QueryMode.NORMAL|QueryMode.NORMAL}. + * @param {Buffer} request.partitionToken + * If present, results are restricted to the specified partition + * previously created using `PartitionQuery`. There must be an exact + * match for the values of fields common to this message and the + * `PartitionQueryRequest` message used to create this `partition_token`. + * @param {number} request.seqno + * A per-transaction sequence number used to identify this request. This field + * makes each request idempotent such that if the request is received multiple + * times, at most one succeeds. + * + * The sequence number must be monotonically increasing within the + * transaction. If a request arrives for the first time with an out-of-order + * sequence number, the transaction can be aborted. Replays of previously + * handled requests yield the same response as the first execution. + * + * Required for DML statements. Ignored for queries. + * @param {google.spanner.v1.ExecuteSqlRequest.QueryOptions} request.queryOptions + * Query optimizer configuration to use for the given query. + * @param {google.spanner.v1.RequestOptions} request.requestOptions + * Common options for this request. + * @param {google.spanner.v1.DirectedReadOptions} request.directedReadOptions + * Directed read options for this request. + * @param {boolean} request.dataBoostEnabled + * If this is for a partitioned query and this field is set to `true`, the + * request is executed with Spanner Data Boost independent compute resources. + * + * If the field is set to `true` but the request doesn't set + * `partition_token`, the API returns an `INVALID_ARGUMENT` error. + * @param {boolean} [request.lastStatement] + * Optional. If set to `true`, this statement marks the end of the + * transaction. After this statement executes, you must commit or abort the + * transaction. Attempts to execute any other requests against this + * transaction (including reads and queries) are rejected. + * + * For DML statements, setting this option might cause some error reporting to + * be deferred until commit time (for example, validation of unique + * constraints). Given this, successful execution of a DML statement shouldn't + * be assumed until a subsequent `Commit` call completes successfully. + * @param {google.spanner.v1.RoutingHint} [request.routingHint] + * Optional. If present, it makes the Spanner requests location-aware. + * + * It gives the server hints that can be used to route the request + * to an appropriate server, potentially significantly decreasing latency and + * improving throughput. To achieve improved performance, most fields must be + * filled in with accurate values. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits {@link protos.google.spanner.v1.PartialResultSet|PartialResultSet} on 'data' event. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#server-streaming | documentation } + * for more details and examples. + */ + executeStreamingSql( + request?: protos.google.spanner.v1.IExecuteSqlRequest, + options?: CallOptions): + gax.CancellableStream{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'session': request.session ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('executeStreamingSql stream %j', options); + return this.innerApiCalls.executeStreamingSql(request, options); + } + +/** + * Like {@link protos.google.spanner.v1.Spanner.Read|Read}, except returns the result set + * as a stream. Unlike {@link protos.google.spanner.v1.Spanner.Read|Read}, there is no + * limit on the size of the returned result set. However, no individual row in + * the result set can exceed 100 MiB, and no column value can exceed + * 10 MiB. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.session + * Required. The session in which the read should be performed. + * @param {google.spanner.v1.TransactionSelector} request.transaction + * The transaction to use. If none is provided, the default is a + * temporary read-only transaction with strong concurrency. + * @param {string} request.table + * Required. The name of the table in the database to be read. + * @param {string} request.index + * If non-empty, the name of an index on + * {@link protos.google.spanner.v1.ReadRequest.table|table}. This index is used instead of + * the table primary key when interpreting + * {@link protos.google.spanner.v1.ReadRequest.key_set|key_set} and sorting result rows. + * See {@link protos.google.spanner.v1.ReadRequest.key_set|key_set} for further + * information. + * @param {string[]} request.columns + * Required. The columns of {@link protos.google.spanner.v1.ReadRequest.table|table} to be + * returned for each row matching this request. + * @param {google.spanner.v1.KeySet} request.keySet + * Required. `key_set` identifies the rows to be yielded. `key_set` names the + * primary keys of the rows in {@link protos.google.spanner.v1.ReadRequest.table|table} to + * be yielded, unless {@link protos.google.spanner.v1.ReadRequest.index|index} is present. + * If {@link protos.google.spanner.v1.ReadRequest.index|index} is present, then + * {@link protos.google.spanner.v1.ReadRequest.key_set|key_set} instead names index keys + * in {@link protos.google.spanner.v1.ReadRequest.index|index}. + * + * If the {@link protos.google.spanner.v1.ReadRequest.partition_token|partition_token} + * field is empty, rows are yielded in table primary key order (if + * {@link protos.google.spanner.v1.ReadRequest.index|index} is empty) or index key order + * (if {@link protos.google.spanner.v1.ReadRequest.index|index} is non-empty). If the + * {@link protos.google.spanner.v1.ReadRequest.partition_token|partition_token} field + * isn't empty, rows are yielded in an unspecified order. + * + * It isn't an error for the `key_set` to name rows that don't + * exist in the database. Read yields nothing for nonexistent rows. + * @param {number} request.limit + * If greater than zero, only the first `limit` rows are yielded. If `limit` + * is zero, the default is no limit. A limit can't be specified if + * `partition_token` is set. + * @param {Buffer} request.resumeToken + * If this request is resuming a previously interrupted read, + * `resume_token` should be copied from the last + * {@link protos.google.spanner.v1.PartialResultSet|PartialResultSet} yielded before the + * interruption. Doing this enables the new read to resume where the last read + * left off. The rest of the request parameters must exactly match the request + * that yielded this token. + * @param {Buffer} request.partitionToken + * If present, results are restricted to the specified partition + * previously created using `PartitionRead`. There must be an exact + * match for the values of fields common to this message and the + * PartitionReadRequest message used to create this partition_token. + * @param {google.spanner.v1.RequestOptions} request.requestOptions + * Common options for this request. + * @param {google.spanner.v1.DirectedReadOptions} request.directedReadOptions + * Directed read options for this request. + * @param {boolean} request.dataBoostEnabled + * If this is for a partitioned read and this field is set to `true`, the + * request is executed with Spanner Data Boost independent compute resources. + * + * If the field is set to `true` but the request doesn't set + * `partition_token`, the API returns an `INVALID_ARGUMENT` error. + * @param {google.spanner.v1.ReadRequest.OrderBy} [request.orderBy] + * Optional. Order for the returned rows. + * + * By default, Spanner returns result rows in primary key order except for + * PartitionRead requests. For applications that don't require rows to be + * returned in primary key (`ORDER_BY_PRIMARY_KEY`) order, setting + * `ORDER_BY_NO_ORDER` option allows Spanner to optimize row retrieval, + * resulting in lower latencies in certain cases (for example, bulk point + * lookups). + * @param {google.spanner.v1.ReadRequest.LockHint} [request.lockHint] + * Optional. Lock Hint for the request, it can only be used with read-write + * transactions. + * @param {google.spanner.v1.RoutingHint} [request.routingHint] + * Optional. If present, it makes the Spanner requests location-aware. + * + * It gives the server hints that can be used to route the request + * to an appropriate server, potentially significantly decreasing latency and + * improving throughput. To achieve improved performance, most fields must be + * filled in with accurate values. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits {@link protos.google.spanner.v1.PartialResultSet|PartialResultSet} on 'data' event. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#server-streaming | documentation } + * for more details and examples. + */ + streamingRead( + request?: protos.google.spanner.v1.IReadRequest, + options?: CallOptions): + gax.CancellableStream{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'session': request.session ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('streamingRead stream %j', options); + return this.innerApiCalls.streamingRead(request, options); + } + +/** + * Batches the supplied mutation groups in a collection of efficient + * transactions. All mutations in a group are committed atomically. However, + * mutations across groups can be committed non-atomically in an unspecified + * order and thus, they must be independent of each other. Partial failure is + * possible, that is, some groups might have been committed successfully, + * while some might have failed. The results of individual batches are + * streamed into the response as the batches are applied. + * + * `BatchWrite` requests are not replay protected, meaning that each mutation + * group can be applied more than once. Replays of non-idempotent mutations + * can have undesirable effects. For example, replays of an insert mutation + * can produce an already exists error or if you use generated or commit + * timestamp-based keys, it can result in additional rows being added to the + * mutation's table. We recommend structuring your mutation groups to be + * idempotent to avoid this issue. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.session + * Required. The session in which the batch request is to be run. + * @param {google.spanner.v1.RequestOptions} request.requestOptions + * Common options for this request. + * @param {number[]} request.mutationGroups + * Required. The groups of mutations to be applied. + * @param {boolean} [request.excludeTxnFromChangeStreams] + * Optional. If you don't set the `exclude_txn_from_change_streams` option or + * if it's set to `false`, then any change streams monitoring columns modified + * by transactions will capture the updates made within that transaction. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits {@link protos.google.spanner.v1.BatchWriteResponse|BatchWriteResponse} on 'data' event. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#server-streaming | documentation } + * for more details and examples. + */ + batchWrite( + request?: protos.google.spanner.v1.IBatchWriteRequest, + options?: CallOptions): + gax.CancellableStream{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'session': request.session ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('batchWrite stream %j', options); + return this.innerApiCalls.batchWrite(request, options); + } + + /** + * Lists all sessions in a given database. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.database + * Required. The database in which to list sessions. + * @param {number} request.pageSize + * Number of sessions to be returned in the response. If 0 or less, defaults + * to the server's maximum allowed page size. + * @param {string} request.pageToken + * If non-empty, `page_token` should contain a + * {@link protos.google.spanner.v1.ListSessionsResponse.next_page_token|next_page_token} + * from a previous + * {@link protos.google.spanner.v1.ListSessionsResponse|ListSessionsResponse}. + * @param {string} request.filter + * An expression for filtering the results of the request. Filter rules are + * case insensitive. The fields eligible for filtering are: + * + * * `labels.key` where key is the name of a label + * + * Some examples of using filters are: + * + * * `labels.env:*` --> The session has the label "env". + * * `labels.env:dev` --> The session has the label "env" and the value of + * the label contains the string "dev". + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.spanner.v1.Session|Session}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listSessionsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listSessions( + request?: protos.google.spanner.v1.IListSessionsRequest, + options?: CallOptions): + Promise<[ + protos.google.spanner.v1.ISession[], + protos.google.spanner.v1.IListSessionsRequest|null, + protos.google.spanner.v1.IListSessionsResponse + ]>; + listSessions( + request: protos.google.spanner.v1.IListSessionsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.spanner.v1.IListSessionsRequest, + protos.google.spanner.v1.IListSessionsResponse|null|undefined, + protos.google.spanner.v1.ISession>): void; + listSessions( + request: protos.google.spanner.v1.IListSessionsRequest, + callback: PaginationCallback< + protos.google.spanner.v1.IListSessionsRequest, + protos.google.spanner.v1.IListSessionsResponse|null|undefined, + protos.google.spanner.v1.ISession>): void; + listSessions( + request?: protos.google.spanner.v1.IListSessionsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.spanner.v1.IListSessionsRequest, + protos.google.spanner.v1.IListSessionsResponse|null|undefined, + protos.google.spanner.v1.ISession>, + callback?: PaginationCallback< + protos.google.spanner.v1.IListSessionsRequest, + protos.google.spanner.v1.IListSessionsResponse|null|undefined, + protos.google.spanner.v1.ISession>): + Promise<[ + protos.google.spanner.v1.ISession[], + protos.google.spanner.v1.IListSessionsRequest|null, + protos.google.spanner.v1.IListSessionsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'database': request.database ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.spanner.v1.IListSessionsRequest, + protos.google.spanner.v1.IListSessionsResponse|null|undefined, + protos.google.spanner.v1.ISession>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listSessions values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listSessions request %j', request); + return this.innerApiCalls + .listSessions(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.spanner.v1.ISession[], + protos.google.spanner.v1.IListSessionsRequest|null, + protos.google.spanner.v1.IListSessionsResponse + ]) => { + this._log.info('listSessions values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listSessions`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.database + * Required. The database in which to list sessions. + * @param {number} request.pageSize + * Number of sessions to be returned in the response. If 0 or less, defaults + * to the server's maximum allowed page size. + * @param {string} request.pageToken + * If non-empty, `page_token` should contain a + * {@link protos.google.spanner.v1.ListSessionsResponse.next_page_token|next_page_token} + * from a previous + * {@link protos.google.spanner.v1.ListSessionsResponse|ListSessionsResponse}. + * @param {string} request.filter + * An expression for filtering the results of the request. Filter rules are + * case insensitive. The fields eligible for filtering are: + * + * * `labels.key` where key is the name of a label + * + * Some examples of using filters are: + * + * * `labels.env:*` --> The session has the label "env". + * * `labels.env:dev` --> The session has the label "env" and the value of + * the label contains the string "dev". + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.spanner.v1.Session|Session} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listSessionsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listSessionsStream( + request?: protos.google.spanner.v1.IListSessionsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'database': request.database ?? '', + }); + const defaultCallSettings = this._defaults['listSessions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listSessions stream %j', request); + return this.descriptors.page.listSessions.createStream( + this.innerApiCalls.listSessions as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listSessions`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.database + * Required. The database in which to list sessions. + * @param {number} request.pageSize + * Number of sessions to be returned in the response. If 0 or less, defaults + * to the server's maximum allowed page size. + * @param {string} request.pageToken + * If non-empty, `page_token` should contain a + * {@link protos.google.spanner.v1.ListSessionsResponse.next_page_token|next_page_token} + * from a previous + * {@link protos.google.spanner.v1.ListSessionsResponse|ListSessionsResponse}. + * @param {string} request.filter + * An expression for filtering the results of the request. Filter rules are + * case insensitive. The fields eligible for filtering are: + * + * * `labels.key` where key is the name of a label + * + * Some examples of using filters are: + * + * * `labels.env:*` --> The session has the label "env". + * * `labels.env:dev` --> The session has the label "env" and the value of + * the label contains the string "dev". + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.spanner.v1.Session|Session}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listSessionsAsync( + request?: protos.google.spanner.v1.IListSessionsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'database': request.database ?? '', + }); + const defaultCallSettings = this._defaults['listSessions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listSessions iterate %j', request); + return this.descriptors.page.listSessions.asyncIterate( + this.innerApiCalls['listSessions'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified database resource name string. + * + * @param {string} project + * @param {string} instance + * @param {string} database + * @returns {string} Resource name string. + */ + databasePath(project:string,instance:string,database:string) { + return this.pathTemplates.databasePathTemplate.render({ + project: project, + instance: instance, + database: database, + }); + } + + /** + * Parse the project from Database resource. + * + * @param {string} databaseName + * A fully-qualified path representing Database resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDatabaseName(databaseName: string) { + return this.pathTemplates.databasePathTemplate.match(databaseName).project; + } + + /** + * Parse the instance from Database resource. + * + * @param {string} databaseName + * A fully-qualified path representing Database resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromDatabaseName(databaseName: string) { + return this.pathTemplates.databasePathTemplate.match(databaseName).instance; + } + + /** + * Parse the database from Database resource. + * + * @param {string} databaseName + * A fully-qualified path representing Database resource. + * @returns {string} A string representing the database. + */ + matchDatabaseFromDatabaseName(databaseName: string) { + return this.pathTemplates.databasePathTemplate.match(databaseName).database; + } + + /** + * Return a fully-qualified session resource name string. + * + * @param {string} project + * @param {string} instance + * @param {string} database + * @param {string} session + * @returns {string} Resource name string. + */ + sessionPath(project:string,instance:string,database:string,session:string) { + return this.pathTemplates.sessionPathTemplate.render({ + project: project, + instance: instance, + database: database, + session: session, + }); + } + + /** + * Parse the project from Session resource. + * + * @param {string} sessionName + * A fully-qualified path representing Session resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSessionName(sessionName: string) { + return this.pathTemplates.sessionPathTemplate.match(sessionName).project; + } + + /** + * Parse the instance from Session resource. + * + * @param {string} sessionName + * A fully-qualified path representing Session resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromSessionName(sessionName: string) { + return this.pathTemplates.sessionPathTemplate.match(sessionName).instance; + } + + /** + * Parse the database from Session resource. + * + * @param {string} sessionName + * A fully-qualified path representing Session resource. + * @returns {string} A string representing the database. + */ + matchDatabaseFromSessionName(sessionName: string) { + return this.pathTemplates.sessionPathTemplate.match(sessionName).database; + } + + /** + * Parse the session from Session resource. + * + * @param {string} sessionName + * A fully-qualified path representing Session resource. + * @returns {string} A string representing the session. + */ + matchSessionFromSessionName(sessionName: string) { + return this.pathTemplates.sessionPathTemplate.match(sessionName).session; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.spannerStub && !this._terminated) { + return this.spannerStub.then(stub => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} \ No newline at end of file diff --git a/owl-bot-staging/v1/src/v1/spanner_client_config.json b/owl-bot-staging/v1/src/v1/spanner_client_config.json new file mode 100644 index 000000000..3d5086946 --- /dev/null +++ b/owl-bot-staging/v1/src/v1/spanner_client_config.json @@ -0,0 +1,119 @@ +{ + "interfaces": { + "google.spanner.v1.Spanner": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "resource_exhausted_unavailable": [ + "RESOURCE_EXHAUSTED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + }, + "9442ca297df43f7314712e1a19d003838e738a45": { + "initial_retry_delay_millis": 250, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 32000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateSession": { + "timeout_millis": 30000, + "retry_codes_name": "resource_exhausted_unavailable", + "retry_params_name": "9442ca297df43f7314712e1a19d003838e738a45" + }, + "BatchCreateSessions": { + "timeout_millis": 60000, + "retry_codes_name": "resource_exhausted_unavailable", + "retry_params_name": "9442ca297df43f7314712e1a19d003838e738a45" + }, + "GetSession": { + "timeout_millis": 30000, + "retry_codes_name": "resource_exhausted_unavailable", + "retry_params_name": "9442ca297df43f7314712e1a19d003838e738a45" + }, + "ListSessions": { + "timeout_millis": 3600000, + "retry_codes_name": "resource_exhausted_unavailable", + "retry_params_name": "9442ca297df43f7314712e1a19d003838e738a45" + }, + "DeleteSession": { + "timeout_millis": 30000, + "retry_codes_name": "resource_exhausted_unavailable", + "retry_params_name": "9442ca297df43f7314712e1a19d003838e738a45" + }, + "ExecuteSql": { + "timeout_millis": 30000, + "retry_codes_name": "resource_exhausted_unavailable", + "retry_params_name": "9442ca297df43f7314712e1a19d003838e738a45" + }, + "ExecuteStreamingSql": { + "timeout_millis": 3600000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ExecuteBatchDml": { + "timeout_millis": 30000, + "retry_codes_name": "resource_exhausted_unavailable", + "retry_params_name": "9442ca297df43f7314712e1a19d003838e738a45" + }, + "Read": { + "timeout_millis": 30000, + "retry_codes_name": "resource_exhausted_unavailable", + "retry_params_name": "9442ca297df43f7314712e1a19d003838e738a45" + }, + "StreamingRead": { + "timeout_millis": 3600000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "BeginTransaction": { + "timeout_millis": 30000, + "retry_codes_name": "resource_exhausted_unavailable", + "retry_params_name": "9442ca297df43f7314712e1a19d003838e738a45" + }, + "Commit": { + "timeout_millis": 3600000, + "retry_codes_name": "resource_exhausted_unavailable", + "retry_params_name": "9442ca297df43f7314712e1a19d003838e738a45" + }, + "Rollback": { + "timeout_millis": 30000, + "retry_codes_name": "resource_exhausted_unavailable", + "retry_params_name": "9442ca297df43f7314712e1a19d003838e738a45" + }, + "PartitionQuery": { + "timeout_millis": 30000, + "retry_codes_name": "resource_exhausted_unavailable", + "retry_params_name": "9442ca297df43f7314712e1a19d003838e738a45" + }, + "PartitionRead": { + "timeout_millis": 30000, + "retry_codes_name": "resource_exhausted_unavailable", + "retry_params_name": "9442ca297df43f7314712e1a19d003838e738a45" + }, + "BatchWrite": { + "timeout_millis": 3600000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/v1/src/v1/spanner_proto_list.json b/owl-bot-staging/v1/src/v1/spanner_proto_list.json new file mode 100644 index 000000000..a27ba58ca --- /dev/null +++ b/owl-bot-staging/v1/src/v1/spanner_proto_list.json @@ -0,0 +1,12 @@ +[ + "../../protos/google/spanner/v1/change_stream.proto", + "../../protos/google/spanner/v1/commit_response.proto", + "../../protos/google/spanner/v1/keys.proto", + "../../protos/google/spanner/v1/location.proto", + "../../protos/google/spanner/v1/mutation.proto", + "../../protos/google/spanner/v1/query_plan.proto", + "../../protos/google/spanner/v1/result_set.proto", + "../../protos/google/spanner/v1/spanner.proto", + "../../protos/google/spanner/v1/transaction.proto", + "../../protos/google/spanner/v1/type.proto" +] diff --git a/owl-bot-staging/v1/test/gapic_spanner_v1.ts b/owl-bot-staging/v1/test/gapic_spanner_v1.ts new file mode 100644 index 000000000..e308561cb --- /dev/null +++ b/owl-bot-staging/v1/test/gapic_spanner_v1.ts @@ -0,0 +1,2337 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as spannerModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +} + +function stubServerStreamingCall(response?: ResponseType, error?: Error) { + const transformStub = error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // write something to the stream to trigger transformStub and send the response back to the client + setImmediate(() => { mockStream.write({}); }); + setImmediate(() => { mockStream.end(); }); + return sinon.stub().returns(mockStream); +} + +function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { mockStream.write({}); }); + } + setImmediate(() => { mockStream.end(); }); + } else { + setImmediate(() => { mockStream.write({}); }); + setImmediate(() => { mockStream.end(); }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + } + }; + } + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1.SpannerClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new spannerModule.v1.SpannerClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'spanner.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new spannerModule.v1.SpannerClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, "googleapis.com"); + }); + + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = spannerModule.v1.SpannerClient.servicePath; + assert.strictEqual(servicePath, 'spanner.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = spannerModule.v1.SpannerClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'spanner.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new spannerModule.v1.SpannerClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'spanner.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new spannerModule.v1.SpannerClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'spanner.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new spannerModule.v1.SpannerClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'spanner.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new spannerModule.v1.SpannerClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'spanner.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { new spannerModule.v1.SpannerClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = spannerModule.v1.SpannerClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new spannerModule.v1.SpannerClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new spannerModule.v1.SpannerClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new spannerModule.v1.SpannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.spannerStub, undefined); + await client.initialize(); + assert(client.spannerStub); + }); + + it('has close method for the initialized client', done => { + const client = new spannerModule.v1.SpannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize().catch(err => {throw err}); + assert(client.spannerStub); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has close method for the non-initialized client', done => { + const client = new spannerModule.v1.SpannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.spannerStub, undefined); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new spannerModule.v1.SpannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new spannerModule.v1.SpannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error|null, projectId?: string|null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + }); + + describe('createSession', () => { + it('invokes createSession without error', async () => { + const client = new spannerModule.v1.SpannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.v1.CreateSessionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.v1.CreateSessionRequest', ['database']); + request.database = defaultValue1; + const expectedHeaderRequestParams = `database=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.spanner.v1.Session() + ); + client.innerApiCalls.createSession = stubSimpleCall(expectedResponse); + const [response] = await client.createSession(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createSession as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createSession as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSession without error using callback', async () => { + const client = new spannerModule.v1.SpannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.v1.CreateSessionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.v1.CreateSessionRequest', ['database']); + request.database = defaultValue1; + const expectedHeaderRequestParams = `database=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.spanner.v1.Session() + ); + client.innerApiCalls.createSession = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createSession( + request, + (err?: Error|null, result?: protos.google.spanner.v1.ISession|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createSession as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createSession as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSession with error', async () => { + const client = new spannerModule.v1.SpannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.v1.CreateSessionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.v1.CreateSessionRequest', ['database']); + request.database = defaultValue1; + const expectedHeaderRequestParams = `database=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createSession = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createSession(request), expectedError); + const actualRequest = (client.innerApiCalls.createSession as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createSession as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSession with closed client', async () => { + const client = new spannerModule.v1.SpannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.v1.CreateSessionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.v1.CreateSessionRequest', ['database']); + request.database = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.createSession(request), expectedError); + }); + }); + + describe('batchCreateSessions', () => { + it('invokes batchCreateSessions without error', async () => { + const client = new spannerModule.v1.SpannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.v1.BatchCreateSessionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.v1.BatchCreateSessionsRequest', ['database']); + request.database = defaultValue1; + const expectedHeaderRequestParams = `database=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.spanner.v1.BatchCreateSessionsResponse() + ); + client.innerApiCalls.batchCreateSessions = stubSimpleCall(expectedResponse); + const [response] = await client.batchCreateSessions(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.batchCreateSessions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchCreateSessions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchCreateSessions without error using callback', async () => { + const client = new spannerModule.v1.SpannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.v1.BatchCreateSessionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.v1.BatchCreateSessionsRequest', ['database']); + request.database = defaultValue1; + const expectedHeaderRequestParams = `database=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.spanner.v1.BatchCreateSessionsResponse() + ); + client.innerApiCalls.batchCreateSessions = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.batchCreateSessions( + request, + (err?: Error|null, result?: protos.google.spanner.v1.IBatchCreateSessionsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.batchCreateSessions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchCreateSessions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchCreateSessions with error', async () => { + const client = new spannerModule.v1.SpannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.v1.BatchCreateSessionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.v1.BatchCreateSessionsRequest', ['database']); + request.database = defaultValue1; + const expectedHeaderRequestParams = `database=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchCreateSessions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.batchCreateSessions(request), expectedError); + const actualRequest = (client.innerApiCalls.batchCreateSessions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchCreateSessions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchCreateSessions with closed client', async () => { + const client = new spannerModule.v1.SpannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.v1.BatchCreateSessionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.v1.BatchCreateSessionsRequest', ['database']); + request.database = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.batchCreateSessions(request), expectedError); + }); + }); + + describe('getSession', () => { + it('invokes getSession without error', async () => { + const client = new spannerModule.v1.SpannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.v1.GetSessionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.v1.GetSessionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.spanner.v1.Session() + ); + client.innerApiCalls.getSession = stubSimpleCall(expectedResponse); + const [response] = await client.getSession(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getSession as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getSession as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSession without error using callback', async () => { + const client = new spannerModule.v1.SpannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.v1.GetSessionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.v1.GetSessionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.spanner.v1.Session() + ); + client.innerApiCalls.getSession = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getSession( + request, + (err?: Error|null, result?: protos.google.spanner.v1.ISession|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getSession as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getSession as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSession with error', async () => { + const client = new spannerModule.v1.SpannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.v1.GetSessionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.v1.GetSessionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getSession = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getSession(request), expectedError); + const actualRequest = (client.innerApiCalls.getSession as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getSession as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSession with closed client', async () => { + const client = new spannerModule.v1.SpannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.v1.GetSessionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.v1.GetSessionRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getSession(request), expectedError); + }); + }); + + describe('deleteSession', () => { + it('invokes deleteSession without error', async () => { + const client = new spannerModule.v1.SpannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.v1.DeleteSessionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.v1.DeleteSessionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteSession = stubSimpleCall(expectedResponse); + const [response] = await client.deleteSession(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteSession as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteSession as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSession without error using callback', async () => { + const client = new spannerModule.v1.SpannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.v1.DeleteSessionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.v1.DeleteSessionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteSession = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteSession( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteSession as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteSession as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSession with error', async () => { + const client = new spannerModule.v1.SpannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.v1.DeleteSessionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.v1.DeleteSessionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteSession = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteSession(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteSession as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteSession as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSession with closed client', async () => { + const client = new spannerModule.v1.SpannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.v1.DeleteSessionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.v1.DeleteSessionRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.deleteSession(request), expectedError); + }); + }); + + describe('executeSql', () => { + it('invokes executeSql without error', async () => { + const client = new spannerModule.v1.SpannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.v1.ExecuteSqlRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.v1.ExecuteSqlRequest', ['session']); + request.session = defaultValue1; + const expectedHeaderRequestParams = `session=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.spanner.v1.ResultSet() + ); + client.innerApiCalls.executeSql = stubSimpleCall(expectedResponse); + const [response] = await client.executeSql(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.executeSql as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.executeSql as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes executeSql without error using callback', async () => { + const client = new spannerModule.v1.SpannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.v1.ExecuteSqlRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.v1.ExecuteSqlRequest', ['session']); + request.session = defaultValue1; + const expectedHeaderRequestParams = `session=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.spanner.v1.ResultSet() + ); + client.innerApiCalls.executeSql = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.executeSql( + request, + (err?: Error|null, result?: protos.google.spanner.v1.IResultSet|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.executeSql as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.executeSql as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes executeSql with error', async () => { + const client = new spannerModule.v1.SpannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.v1.ExecuteSqlRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.v1.ExecuteSqlRequest', ['session']); + request.session = defaultValue1; + const expectedHeaderRequestParams = `session=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.executeSql = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.executeSql(request), expectedError); + const actualRequest = (client.innerApiCalls.executeSql as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.executeSql as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes executeSql with closed client', async () => { + const client = new spannerModule.v1.SpannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.v1.ExecuteSqlRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.v1.ExecuteSqlRequest', ['session']); + request.session = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.executeSql(request), expectedError); + }); + }); + + describe('executeBatchDml', () => { + it('invokes executeBatchDml without error', async () => { + const client = new spannerModule.v1.SpannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.v1.ExecuteBatchDmlRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.v1.ExecuteBatchDmlRequest', ['session']); + request.session = defaultValue1; + const expectedHeaderRequestParams = `session=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.spanner.v1.ExecuteBatchDmlResponse() + ); + client.innerApiCalls.executeBatchDml = stubSimpleCall(expectedResponse); + const [response] = await client.executeBatchDml(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.executeBatchDml as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.executeBatchDml as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes executeBatchDml without error using callback', async () => { + const client = new spannerModule.v1.SpannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.v1.ExecuteBatchDmlRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.v1.ExecuteBatchDmlRequest', ['session']); + request.session = defaultValue1; + const expectedHeaderRequestParams = `session=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.spanner.v1.ExecuteBatchDmlResponse() + ); + client.innerApiCalls.executeBatchDml = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.executeBatchDml( + request, + (err?: Error|null, result?: protos.google.spanner.v1.IExecuteBatchDmlResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.executeBatchDml as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.executeBatchDml as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes executeBatchDml with error', async () => { + const client = new spannerModule.v1.SpannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.v1.ExecuteBatchDmlRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.v1.ExecuteBatchDmlRequest', ['session']); + request.session = defaultValue1; + const expectedHeaderRequestParams = `session=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.executeBatchDml = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.executeBatchDml(request), expectedError); + const actualRequest = (client.innerApiCalls.executeBatchDml as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.executeBatchDml as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes executeBatchDml with closed client', async () => { + const client = new spannerModule.v1.SpannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.v1.ExecuteBatchDmlRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.v1.ExecuteBatchDmlRequest', ['session']); + request.session = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.executeBatchDml(request), expectedError); + }); + }); + + describe('read', () => { + it('invokes read without error', async () => { + const client = new spannerModule.v1.SpannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.v1.ReadRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.v1.ReadRequest', ['session']); + request.session = defaultValue1; + const expectedHeaderRequestParams = `session=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.spanner.v1.ResultSet() + ); + client.innerApiCalls.read = stubSimpleCall(expectedResponse); + const [response] = await client.read(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.read as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.read as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes read without error using callback', async () => { + const client = new spannerModule.v1.SpannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.v1.ReadRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.v1.ReadRequest', ['session']); + request.session = defaultValue1; + const expectedHeaderRequestParams = `session=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.spanner.v1.ResultSet() + ); + client.innerApiCalls.read = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.read( + request, + (err?: Error|null, result?: protos.google.spanner.v1.IResultSet|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.read as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.read as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes read with error', async () => { + const client = new spannerModule.v1.SpannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.v1.ReadRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.v1.ReadRequest', ['session']); + request.session = defaultValue1; + const expectedHeaderRequestParams = `session=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.read = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.read(request), expectedError); + const actualRequest = (client.innerApiCalls.read as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.read as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes read with closed client', async () => { + const client = new spannerModule.v1.SpannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.v1.ReadRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.v1.ReadRequest', ['session']); + request.session = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.read(request), expectedError); + }); + }); + + describe('beginTransaction', () => { + it('invokes beginTransaction without error', async () => { + const client = new spannerModule.v1.SpannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.v1.BeginTransactionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.v1.BeginTransactionRequest', ['session']); + request.session = defaultValue1; + const expectedHeaderRequestParams = `session=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.spanner.v1.Transaction() + ); + client.innerApiCalls.beginTransaction = stubSimpleCall(expectedResponse); + const [response] = await client.beginTransaction(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.beginTransaction as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.beginTransaction as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes beginTransaction without error using callback', async () => { + const client = new spannerModule.v1.SpannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.v1.BeginTransactionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.v1.BeginTransactionRequest', ['session']); + request.session = defaultValue1; + const expectedHeaderRequestParams = `session=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.spanner.v1.Transaction() + ); + client.innerApiCalls.beginTransaction = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.beginTransaction( + request, + (err?: Error|null, result?: protos.google.spanner.v1.ITransaction|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.beginTransaction as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.beginTransaction as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes beginTransaction with error', async () => { + const client = new spannerModule.v1.SpannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.v1.BeginTransactionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.v1.BeginTransactionRequest', ['session']); + request.session = defaultValue1; + const expectedHeaderRequestParams = `session=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.beginTransaction = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.beginTransaction(request), expectedError); + const actualRequest = (client.innerApiCalls.beginTransaction as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.beginTransaction as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes beginTransaction with closed client', async () => { + const client = new spannerModule.v1.SpannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.v1.BeginTransactionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.v1.BeginTransactionRequest', ['session']); + request.session = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.beginTransaction(request), expectedError); + }); + }); + + describe('commit', () => { + it('invokes commit without error', async () => { + const client = new spannerModule.v1.SpannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.v1.CommitRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.v1.CommitRequest', ['session']); + request.session = defaultValue1; + const expectedHeaderRequestParams = `session=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.spanner.v1.CommitResponse() + ); + client.innerApiCalls.commit = stubSimpleCall(expectedResponse); + const [response] = await client.commit(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.commit as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.commit as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes commit without error using callback', async () => { + const client = new spannerModule.v1.SpannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.v1.CommitRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.v1.CommitRequest', ['session']); + request.session = defaultValue1; + const expectedHeaderRequestParams = `session=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.spanner.v1.CommitResponse() + ); + client.innerApiCalls.commit = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.commit( + request, + (err?: Error|null, result?: protos.google.spanner.v1.ICommitResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.commit as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.commit as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes commit with error', async () => { + const client = new spannerModule.v1.SpannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.v1.CommitRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.v1.CommitRequest', ['session']); + request.session = defaultValue1; + const expectedHeaderRequestParams = `session=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.commit = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.commit(request), expectedError); + const actualRequest = (client.innerApiCalls.commit as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.commit as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes commit with closed client', async () => { + const client = new spannerModule.v1.SpannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.v1.CommitRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.v1.CommitRequest', ['session']); + request.session = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.commit(request), expectedError); + }); + }); + + describe('rollback', () => { + it('invokes rollback without error', async () => { + const client = new spannerModule.v1.SpannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.v1.RollbackRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.v1.RollbackRequest', ['session']); + request.session = defaultValue1; + const expectedHeaderRequestParams = `session=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.rollback = stubSimpleCall(expectedResponse); + const [response] = await client.rollback(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.rollback as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.rollback as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes rollback without error using callback', async () => { + const client = new spannerModule.v1.SpannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.v1.RollbackRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.v1.RollbackRequest', ['session']); + request.session = defaultValue1; + const expectedHeaderRequestParams = `session=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.rollback = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.rollback( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.rollback as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.rollback as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes rollback with error', async () => { + const client = new spannerModule.v1.SpannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.v1.RollbackRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.v1.RollbackRequest', ['session']); + request.session = defaultValue1; + const expectedHeaderRequestParams = `session=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.rollback = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.rollback(request), expectedError); + const actualRequest = (client.innerApiCalls.rollback as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.rollback as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes rollback with closed client', async () => { + const client = new spannerModule.v1.SpannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.v1.RollbackRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.v1.RollbackRequest', ['session']); + request.session = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.rollback(request), expectedError); + }); + }); + + describe('partitionQuery', () => { + it('invokes partitionQuery without error', async () => { + const client = new spannerModule.v1.SpannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.v1.PartitionQueryRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.v1.PartitionQueryRequest', ['session']); + request.session = defaultValue1; + const expectedHeaderRequestParams = `session=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.spanner.v1.PartitionResponse() + ); + client.innerApiCalls.partitionQuery = stubSimpleCall(expectedResponse); + const [response] = await client.partitionQuery(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.partitionQuery as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.partitionQuery as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes partitionQuery without error using callback', async () => { + const client = new spannerModule.v1.SpannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.v1.PartitionQueryRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.v1.PartitionQueryRequest', ['session']); + request.session = defaultValue1; + const expectedHeaderRequestParams = `session=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.spanner.v1.PartitionResponse() + ); + client.innerApiCalls.partitionQuery = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.partitionQuery( + request, + (err?: Error|null, result?: protos.google.spanner.v1.IPartitionResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.partitionQuery as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.partitionQuery as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes partitionQuery with error', async () => { + const client = new spannerModule.v1.SpannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.v1.PartitionQueryRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.v1.PartitionQueryRequest', ['session']); + request.session = defaultValue1; + const expectedHeaderRequestParams = `session=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.partitionQuery = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.partitionQuery(request), expectedError); + const actualRequest = (client.innerApiCalls.partitionQuery as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.partitionQuery as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes partitionQuery with closed client', async () => { + const client = new spannerModule.v1.SpannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.v1.PartitionQueryRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.v1.PartitionQueryRequest', ['session']); + request.session = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.partitionQuery(request), expectedError); + }); + }); + + describe('partitionRead', () => { + it('invokes partitionRead without error', async () => { + const client = new spannerModule.v1.SpannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.v1.PartitionReadRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.v1.PartitionReadRequest', ['session']); + request.session = defaultValue1; + const expectedHeaderRequestParams = `session=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.spanner.v1.PartitionResponse() + ); + client.innerApiCalls.partitionRead = stubSimpleCall(expectedResponse); + const [response] = await client.partitionRead(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.partitionRead as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.partitionRead as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes partitionRead without error using callback', async () => { + const client = new spannerModule.v1.SpannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.v1.PartitionReadRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.v1.PartitionReadRequest', ['session']); + request.session = defaultValue1; + const expectedHeaderRequestParams = `session=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.spanner.v1.PartitionResponse() + ); + client.innerApiCalls.partitionRead = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.partitionRead( + request, + (err?: Error|null, result?: protos.google.spanner.v1.IPartitionResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.partitionRead as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.partitionRead as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes partitionRead with error', async () => { + const client = new spannerModule.v1.SpannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.v1.PartitionReadRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.v1.PartitionReadRequest', ['session']); + request.session = defaultValue1; + const expectedHeaderRequestParams = `session=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.partitionRead = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.partitionRead(request), expectedError); + const actualRequest = (client.innerApiCalls.partitionRead as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.partitionRead as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes partitionRead with closed client', async () => { + const client = new spannerModule.v1.SpannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.v1.PartitionReadRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.v1.PartitionReadRequest', ['session']); + request.session = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.partitionRead(request), expectedError); + }); + }); + + describe('executeStreamingSql', () => { + it('invokes executeStreamingSql without error', async () => { + const client = new spannerModule.v1.SpannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.v1.ExecuteSqlRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.v1.ExecuteSqlRequest', ['session']); + request.session = defaultValue1; + const expectedHeaderRequestParams = `session=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.spanner.v1.PartialResultSet() + ); + client.innerApiCalls.executeStreamingSql = stubServerStreamingCall(expectedResponse); + const stream = client.executeStreamingSql(request); + const promise = new Promise((resolve, reject) => { + stream.on('data', (response: protos.google.spanner.v1.PartialResultSet) => { + resolve(response); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.executeStreamingSql as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.executeStreamingSql as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes executeStreamingSql without error and gaxServerStreamingRetries enabled', async () => { + const client = new spannerModule.v1.SpannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + gaxServerStreamingRetries: true + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.v1.ExecuteSqlRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.v1.ExecuteSqlRequest', ['session']); + request.session = defaultValue1; + const expectedHeaderRequestParams = `session=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.spanner.v1.PartialResultSet() + ); + client.innerApiCalls.executeStreamingSql = stubServerStreamingCall(expectedResponse); + const stream = client.executeStreamingSql(request); + const promise = new Promise((resolve, reject) => { + stream.on('data', (response: protos.google.spanner.v1.PartialResultSet) => { + resolve(response); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.executeStreamingSql as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.executeStreamingSql as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes executeStreamingSql with error', async () => { + const client = new spannerModule.v1.SpannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.v1.ExecuteSqlRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.v1.ExecuteSqlRequest', ['session']); + request.session = defaultValue1; + const expectedHeaderRequestParams = `session=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.executeStreamingSql = stubServerStreamingCall(undefined, expectedError); + const stream = client.executeStreamingSql(request); + const promise = new Promise((resolve, reject) => { + stream.on('data', (response: protos.google.spanner.v1.PartialResultSet) => { + resolve(response); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + const actualRequest = (client.innerApiCalls.executeStreamingSql as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.executeStreamingSql as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes executeStreamingSql with closed client', async () => { + const client = new spannerModule.v1.SpannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.v1.ExecuteSqlRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.v1.ExecuteSqlRequest', ['session']); + request.session = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + const stream = client.executeStreamingSql(request, {retryRequestOptions: {noResponseRetries: 0}}); + const promise = new Promise((resolve, reject) => { + stream.on('data', (response: protos.google.spanner.v1.PartialResultSet) => { + resolve(response); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + }); + it('should create a client with gaxServerStreamingRetries enabled', () => { + const client = new spannerModule.v1.SpannerClient({ + gaxServerStreamingRetries: true, + }); + assert(client); + }); + }); + + describe('streamingRead', () => { + it('invokes streamingRead without error', async () => { + const client = new spannerModule.v1.SpannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.v1.ReadRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.v1.ReadRequest', ['session']); + request.session = defaultValue1; + const expectedHeaderRequestParams = `session=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.spanner.v1.PartialResultSet() + ); + client.innerApiCalls.streamingRead = stubServerStreamingCall(expectedResponse); + const stream = client.streamingRead(request); + const promise = new Promise((resolve, reject) => { + stream.on('data', (response: protos.google.spanner.v1.PartialResultSet) => { + resolve(response); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.streamingRead as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.streamingRead as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes streamingRead without error and gaxServerStreamingRetries enabled', async () => { + const client = new spannerModule.v1.SpannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + gaxServerStreamingRetries: true + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.v1.ReadRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.v1.ReadRequest', ['session']); + request.session = defaultValue1; + const expectedHeaderRequestParams = `session=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.spanner.v1.PartialResultSet() + ); + client.innerApiCalls.streamingRead = stubServerStreamingCall(expectedResponse); + const stream = client.streamingRead(request); + const promise = new Promise((resolve, reject) => { + stream.on('data', (response: protos.google.spanner.v1.PartialResultSet) => { + resolve(response); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.streamingRead as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.streamingRead as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes streamingRead with error', async () => { + const client = new spannerModule.v1.SpannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.v1.ReadRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.v1.ReadRequest', ['session']); + request.session = defaultValue1; + const expectedHeaderRequestParams = `session=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.streamingRead = stubServerStreamingCall(undefined, expectedError); + const stream = client.streamingRead(request); + const promise = new Promise((resolve, reject) => { + stream.on('data', (response: protos.google.spanner.v1.PartialResultSet) => { + resolve(response); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + const actualRequest = (client.innerApiCalls.streamingRead as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.streamingRead as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes streamingRead with closed client', async () => { + const client = new spannerModule.v1.SpannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.v1.ReadRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.v1.ReadRequest', ['session']); + request.session = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + const stream = client.streamingRead(request, {retryRequestOptions: {noResponseRetries: 0}}); + const promise = new Promise((resolve, reject) => { + stream.on('data', (response: protos.google.spanner.v1.PartialResultSet) => { + resolve(response); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + }); + it('should create a client with gaxServerStreamingRetries enabled', () => { + const client = new spannerModule.v1.SpannerClient({ + gaxServerStreamingRetries: true, + }); + assert(client); + }); + }); + + describe('batchWrite', () => { + it('invokes batchWrite without error', async () => { + const client = new spannerModule.v1.SpannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.v1.BatchWriteRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.v1.BatchWriteRequest', ['session']); + request.session = defaultValue1; + const expectedHeaderRequestParams = `session=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.spanner.v1.BatchWriteResponse() + ); + client.innerApiCalls.batchWrite = stubServerStreamingCall(expectedResponse); + const stream = client.batchWrite(request); + const promise = new Promise((resolve, reject) => { + stream.on('data', (response: protos.google.spanner.v1.BatchWriteResponse) => { + resolve(response); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.batchWrite as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchWrite as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchWrite without error and gaxServerStreamingRetries enabled', async () => { + const client = new spannerModule.v1.SpannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + gaxServerStreamingRetries: true + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.v1.BatchWriteRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.v1.BatchWriteRequest', ['session']); + request.session = defaultValue1; + const expectedHeaderRequestParams = `session=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.spanner.v1.BatchWriteResponse() + ); + client.innerApiCalls.batchWrite = stubServerStreamingCall(expectedResponse); + const stream = client.batchWrite(request); + const promise = new Promise((resolve, reject) => { + stream.on('data', (response: protos.google.spanner.v1.BatchWriteResponse) => { + resolve(response); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.batchWrite as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchWrite as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchWrite with error', async () => { + const client = new spannerModule.v1.SpannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.v1.BatchWriteRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.v1.BatchWriteRequest', ['session']); + request.session = defaultValue1; + const expectedHeaderRequestParams = `session=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchWrite = stubServerStreamingCall(undefined, expectedError); + const stream = client.batchWrite(request); + const promise = new Promise((resolve, reject) => { + stream.on('data', (response: protos.google.spanner.v1.BatchWriteResponse) => { + resolve(response); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + const actualRequest = (client.innerApiCalls.batchWrite as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchWrite as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchWrite with closed client', async () => { + const client = new spannerModule.v1.SpannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.v1.BatchWriteRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.v1.BatchWriteRequest', ['session']); + request.session = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + const stream = client.batchWrite(request, {retryRequestOptions: {noResponseRetries: 0}}); + const promise = new Promise((resolve, reject) => { + stream.on('data', (response: protos.google.spanner.v1.BatchWriteResponse) => { + resolve(response); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + }); + it('should create a client with gaxServerStreamingRetries enabled', () => { + const client = new spannerModule.v1.SpannerClient({ + gaxServerStreamingRetries: true, + }); + assert(client); + }); + }); + + describe('listSessions', () => { + it('invokes listSessions without error', async () => { + const client = new spannerModule.v1.SpannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.v1.ListSessionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.v1.ListSessionsRequest', ['database']); + request.database = defaultValue1; + const expectedHeaderRequestParams = `database=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.spanner.v1.Session()), + generateSampleMessage(new protos.google.spanner.v1.Session()), + generateSampleMessage(new protos.google.spanner.v1.Session()), + ]; + client.innerApiCalls.listSessions = stubSimpleCall(expectedResponse); + const [response] = await client.listSessions(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listSessions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listSessions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSessions without error using callback', async () => { + const client = new spannerModule.v1.SpannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.v1.ListSessionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.v1.ListSessionsRequest', ['database']); + request.database = defaultValue1; + const expectedHeaderRequestParams = `database=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.spanner.v1.Session()), + generateSampleMessage(new protos.google.spanner.v1.Session()), + generateSampleMessage(new protos.google.spanner.v1.Session()), + ]; + client.innerApiCalls.listSessions = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listSessions( + request, + (err?: Error|null, result?: protos.google.spanner.v1.ISession[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listSessions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listSessions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSessions with error', async () => { + const client = new spannerModule.v1.SpannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.v1.ListSessionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.v1.ListSessionsRequest', ['database']); + request.database = defaultValue1; + const expectedHeaderRequestParams = `database=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listSessions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listSessions(request), expectedError); + const actualRequest = (client.innerApiCalls.listSessions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listSessions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSessionsStream without error', async () => { + const client = new spannerModule.v1.SpannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.v1.ListSessionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.v1.ListSessionsRequest', ['database']); + request.database = defaultValue1; + const expectedHeaderRequestParams = `database=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.spanner.v1.Session()), + generateSampleMessage(new protos.google.spanner.v1.Session()), + generateSampleMessage(new protos.google.spanner.v1.Session()), + ]; + client.descriptors.page.listSessions.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listSessionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.spanner.v1.Session[] = []; + stream.on('data', (response: protos.google.spanner.v1.Session) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listSessions.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listSessions, request)); + assert( + (client.descriptors.page.listSessions.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listSessionsStream with error', async () => { + const client = new spannerModule.v1.SpannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.v1.ListSessionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.v1.ListSessionsRequest', ['database']); + request.database = defaultValue1; + const expectedHeaderRequestParams = `database=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listSessions.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listSessionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.spanner.v1.Session[] = []; + stream.on('data', (response: protos.google.spanner.v1.Session) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listSessions.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listSessions, request)); + assert( + (client.descriptors.page.listSessions.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listSessions without error', async () => { + const client = new spannerModule.v1.SpannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.v1.ListSessionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.v1.ListSessionsRequest', ['database']); + request.database = defaultValue1; + const expectedHeaderRequestParams = `database=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.spanner.v1.Session()), + generateSampleMessage(new protos.google.spanner.v1.Session()), + generateSampleMessage(new protos.google.spanner.v1.Session()), + ]; + client.descriptors.page.listSessions.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.spanner.v1.ISession[] = []; + const iterable = client.listSessionsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listSessions.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listSessions.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listSessions with error', async () => { + const client = new spannerModule.v1.SpannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.v1.ListSessionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.spanner.v1.ListSessionsRequest', ['database']); + request.database = defaultValue1; + const expectedHeaderRequestParams = `database=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listSessions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listSessionsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.spanner.v1.ISession[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listSessions.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listSessions.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + + describe('database', async () => { + const fakePath = "/rendered/path/database"; + const expectedParameters = { + project: "projectValue", + instance: "instanceValue", + database: "databaseValue", + }; + const client = new spannerModule.v1.SpannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.databasePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.databasePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('databasePath', () => { + const result = client.databasePath("projectValue", "instanceValue", "databaseValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.databasePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDatabaseName', () => { + const result = client.matchProjectFromDatabaseName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.databasePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInstanceFromDatabaseName', () => { + const result = client.matchInstanceFromDatabaseName(fakePath); + assert.strictEqual(result, "instanceValue"); + assert((client.pathTemplates.databasePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatabaseFromDatabaseName', () => { + const result = client.matchDatabaseFromDatabaseName(fakePath); + assert.strictEqual(result, "databaseValue"); + assert((client.pathTemplates.databasePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('session', async () => { + const fakePath = "/rendered/path/session"; + const expectedParameters = { + project: "projectValue", + instance: "instanceValue", + database: "databaseValue", + session: "sessionValue", + }; + const client = new spannerModule.v1.SpannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.sessionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.sessionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('sessionPath', () => { + const result = client.sessionPath("projectValue", "instanceValue", "databaseValue", "sessionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.sessionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSessionName', () => { + const result = client.matchProjectFromSessionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.sessionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInstanceFromSessionName', () => { + const result = client.matchInstanceFromSessionName(fakePath); + assert.strictEqual(result, "instanceValue"); + assert((client.pathTemplates.sessionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatabaseFromSessionName', () => { + const result = client.matchDatabaseFromSessionName(fakePath); + assert.strictEqual(result, "databaseValue"); + assert((client.pathTemplates.sessionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSessionFromSessionName', () => { + const result = client.matchSessionFromSessionName(fakePath); + assert.strictEqual(result, "sessionValue"); + assert((client.pathTemplates.sessionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/v1/tsconfig.json b/owl-bot-staging/v1/tsconfig.json new file mode 100644 index 000000000..ca73e7bfc --- /dev/null +++ b/owl-bot-staging/v1/tsconfig.json @@ -0,0 +1,22 @@ +{ + "extends": "./node_modules/gts/tsconfig-google.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "build", + "resolveJsonModule": true, + "lib": [ + "es2023", + "dom" + ] + }, + "include": [ + "src/*.ts", + "src/**/*.ts", + "test/*.ts", + "test/**/*.ts", + "system-test/*.ts", + "src/**/*.json", + "samples/**/*.json", + "protos/protos.json" + ] +} diff --git a/owl-bot-staging/v1/webpack.config.js b/owl-bot-staging/v1/webpack.config.js new file mode 100644 index 000000000..ee59a7326 --- /dev/null +++ b/owl-bot-staging/v1/webpack.config.js @@ -0,0 +1,64 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +const path = require('path'); + +module.exports = { + entry: './src/index.ts', + output: { + library: 'spanner', + filename: './spanner.js', + }, + node: { + child_process: 'empty', + fs: 'empty', + crypto: 'empty', + }, + resolve: { + alias: { + '../../../package.json': path.resolve(__dirname, 'package.json'), + }, + extensions: ['.js', '.json', '.ts'], + }, + module: { + rules: [ + { + test: /\.tsx?$/, + use: 'ts-loader', + exclude: /node_modules/ + }, + { + test: /node_modules[\\/]@grpc[\\/]grpc-js/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]grpc/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]retry-request/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]https?-proxy-agent/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]gtoken/, + use: 'null-loader' + }, + ], + }, + mode: 'production', +}; From a08bfc431cc59ebc13db1bf851527da61b686f87 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Wed, 4 Feb 2026 23:12:49 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20po?= =?UTF-8?q?st-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- README.md | 2 +- .../admin/database/v1/.OwlBot.yaml | 19 - .../admin/database/v1/.eslintignore | 7 - .../admin/database/v1/.eslintrc.json | 3 - .../admin/database/v1/.gitattributes | 4 - owl-bot-staging/admin/database/v1/.gitignore | 14 - owl-bot-staging/admin/database/v1/.jsdoc.js | 55 - owl-bot-staging/admin/database/v1/.mocharc.js | 33 - owl-bot-staging/admin/database/v1/.nycrc | 24 - .../admin/database/v1/.prettierignore | 6 - .../admin/database/v1/.prettierrc.js | 22 - .../admin/database/v1/CODE_OF_CONDUCT.md | 94 - .../admin/database/v1/CONTRIBUTING.md | 76 - owl-bot-staging/admin/database/v1/LICENSE | 202 - owl-bot-staging/admin/database/v1/README.md | 108 - .../admin/database/v1/package.json | 58 - .../spanner/admin/database/v1/backup.proto | 773 - .../admin/database/v1/backup_schedule.proto | 230 - .../spanner/admin/database/v1/common.proto | 132 - .../database/v1/spanner_database_admin.proto | 1314 - .../admin/database/v1/protos/protos.d.ts | 16947 --- .../admin/database/v1/protos/protos.js | 43422 ------ .../admin/database/v1/protos/protos.json | 4651 - .../admin/database/v1/src/index.ts | 25 - .../v1/src/v1/database_admin_client.ts | 5071 - .../src/v1/database_admin_client_config.json | 169 - .../v1/src/v1/database_admin_proto_list.json | 6 - .../database/v1/src/v1/gapic_metadata.json | 317 - .../admin/database/v1/src/v1/index.ts | 19 - .../v1/test/gapic_database_admin_v1.ts | 4820 - .../admin/database/v1/tsconfig.json | 22 - .../admin/database/v1/webpack.config.js | 64 - .../admin/instance/v1/.OwlBot.yaml | 19 - .../admin/instance/v1/.eslintignore | 7 - .../admin/instance/v1/.eslintrc.json | 3 - .../admin/instance/v1/.gitattributes | 4 - owl-bot-staging/admin/instance/v1/.gitignore | 14 - owl-bot-staging/admin/instance/v1/.jsdoc.js | 55 - owl-bot-staging/admin/instance/v1/.mocharc.js | 33 - owl-bot-staging/admin/instance/v1/.nycrc | 24 - .../admin/instance/v1/.prettierignore | 6 - .../admin/instance/v1/.prettierrc.js | 22 - .../admin/instance/v1/CODE_OF_CONDUCT.md | 94 - .../admin/instance/v1/CONTRIBUTING.md | 76 - owl-bot-staging/admin/instance/v1/LICENSE | 202 - owl-bot-staging/admin/instance/v1/README.md | 108 - .../admin/instance/v1/package.json | 58 - .../spanner/admin/instance/v1/common.proto | 64 - .../instance/v1/spanner_instance_admin.proto | 2184 - .../admin/instance/v1/protos/protos.d.ts | 14931 --- .../admin/instance/v1/protos/protos.js | 38901 ------ .../admin/instance/v1/protos/protos.json | 4167 - .../admin/instance/v1/src/index.ts | 25 - .../instance/v1/src/v1/gapic_metadata.json | 253 - .../admin/instance/v1/src/v1/index.ts | 19 - .../v1/src/v1/instance_admin_client.ts | 4289 - .../src/v1/instance_admin_client_config.json | 129 - .../v1/src/v1/instance_admin_proto_list.json | 4 - .../v1/test/gapic_instance_admin_v1.ts | 3974 - .../admin/instance/v1/tsconfig.json | 22 - .../admin/instance/v1/webpack.config.js | 64 - owl-bot-staging/executor/v1/.OwlBot.yaml | 19 - owl-bot-staging/executor/v1/.eslintignore | 7 - owl-bot-staging/executor/v1/.eslintrc.json | 3 - owl-bot-staging/executor/v1/.gitattributes | 4 - owl-bot-staging/executor/v1/.gitignore | 14 - owl-bot-staging/executor/v1/.jsdoc.js | 55 - owl-bot-staging/executor/v1/.mocharc.js | 33 - owl-bot-staging/executor/v1/.nycrc | 24 - owl-bot-staging/executor/v1/.prettierignore | 6 - owl-bot-staging/executor/v1/.prettierrc.js | 22 - .../executor/v1/CODE_OF_CONDUCT.md | 94 - owl-bot-staging/executor/v1/CONTRIBUTING.md | 76 - owl-bot-staging/executor/v1/LICENSE | 202 - owl-bot-staging/executor/v1/README.md | 108 - owl-bot-staging/executor/v1/package.json | 61 - .../spanner/admin/database/v1/backup.proto | 773 - .../admin/database/v1/backup_schedule.proto | 230 - .../spanner/admin/database/v1/common.proto | 132 - .../database/v1/spanner_database_admin.proto | 1314 - .../spanner/admin/instance/v1/common.proto | 64 - .../instance/v1/spanner_instance_admin.proto | 2184 - .../spanner/executor/v1/cloud_executor.proto | 1520 - .../google/spanner/v1/change_stream.proto | 451 - .../google/spanner/v1/commit_response.proto | 64 - .../v1/protos/google/spanner/v1/keys.proto | 163 - .../protos/google/spanner/v1/location.proto | 388 - .../protos/google/spanner/v1/mutation.proto | 156 - .../protos/google/spanner/v1/query_plan.proto | 156 - .../protos/google/spanner/v1/result_set.proto | 260 - .../v1/protos/google/spanner/v1/spanner.proto | 1419 - .../google/spanner/v1/transaction.proto | 309 - .../v1/protos/google/spanner/v1/type.proto | 214 - .../executor/v1/protos/protos.d.ts | 40265 ------ owl-bot-staging/executor/v1/protos/protos.js | 104291 --------------- .../executor/v1/protos/protos.json | 10772 -- owl-bot-staging/executor/v1/src/index.ts | 25 - .../executor/v1/src/v1/gapic_metadata.json | 27 - owl-bot-staging/executor/v1/src/v1/index.ts | 19 - .../src/v1/spanner_executor_proxy_client.ts | 816 - .../spanner_executor_proxy_client_config.json | 30 - .../v1/spanner_executor_proxy_proto_list.json | 15 - .../test/gapic_spanner_executor_proxy_v1.ts | 660 - owl-bot-staging/executor/v1/tsconfig.json | 22 - owl-bot-staging/executor/v1/webpack.config.js | 64 - owl-bot-staging/v1/.OwlBot.yaml | 19 - owl-bot-staging/v1/.eslintignore | 7 - owl-bot-staging/v1/.eslintrc.json | 3 - owl-bot-staging/v1/.gitattributes | 4 - owl-bot-staging/v1/.gitignore | 14 - owl-bot-staging/v1/.jsdoc.js | 55 - owl-bot-staging/v1/.mocharc.js | 33 - owl-bot-staging/v1/.nycrc | 24 - owl-bot-staging/v1/.prettierignore | 6 - owl-bot-staging/v1/.prettierrc.js | 22 - owl-bot-staging/v1/CODE_OF_CONDUCT.md | 94 - owl-bot-staging/v1/CONTRIBUTING.md | 76 - owl-bot-staging/v1/LICENSE | 202 - owl-bot-staging/v1/README.md | 108 - owl-bot-staging/v1/package.json | 58 - .../google/spanner/v1/change_stream.proto | 451 - .../google/spanner/v1/commit_response.proto | 64 - .../v1/protos/google/spanner/v1/keys.proto | 163 - .../protos/google/spanner/v1/location.proto | 388 - .../protos/google/spanner/v1/mutation.proto | 156 - .../protos/google/spanner/v1/query_plan.proto | 156 - .../protos/google/spanner/v1/result_set.proto | 260 - .../v1/protos/google/spanner/v1/spanner.proto | 1419 - .../google/spanner/v1/transaction.proto | 309 - .../v1/protos/google/spanner/v1/type.proto | 214 - owl-bot-staging/v1/protos/protos.d.ts | 16769 --- owl-bot-staging/v1/protos/protos.js | 45218 ------- owl-bot-staging/v1/protos/protos.json | 4346 - owl-bot-staging/v1/src/index.ts | 25 - owl-bot-staging/v1/src/v1/gapic_metadata.json | 172 - owl-bot-staging/v1/src/v1/index.ts | 19 - owl-bot-staging/v1/src/v1/spanner_client.ts | 2584 - .../v1/src/v1/spanner_client_config.json | 119 - .../v1/src/v1/spanner_proto_list.json | 12 - owl-bot-staging/v1/test/gapic_spanner_v1.ts | 2337 - owl-bot-staging/v1/tsconfig.json | 22 - owl-bot-staging/v1/webpack.config.js | 64 - protos/google/spanner/v1/change_stream.proto | 2 +- .../google/spanner/v1/commit_response.proto | 2 +- protos/google/spanner/v1/keys.proto | 2 +- protos/google/spanner/v1/location.proto | 2 +- protos/google/spanner/v1/mutation.proto | 2 +- protos/google/spanner/v1/query_plan.proto | 2 +- protos/google/spanner/v1/result_set.proto | 10 +- protos/google/spanner/v1/spanner.proto | 27 +- protos/google/spanner/v1/transaction.proto | 2 +- protos/google/spanner/v1/type.proto | 2 +- protos/protos.d.ts | 6 + protos/protos.js | 28 + protos/protos.json | 17 +- samples/README.md | 20 +- src/v1/spanner_client.ts | 13 +- 157 files changed, 102 insertions(+), 392018 deletions(-) delete mode 100644 owl-bot-staging/admin/database/v1/.OwlBot.yaml delete mode 100644 owl-bot-staging/admin/database/v1/.eslintignore delete mode 100644 owl-bot-staging/admin/database/v1/.eslintrc.json delete mode 100644 owl-bot-staging/admin/database/v1/.gitattributes delete mode 100644 owl-bot-staging/admin/database/v1/.gitignore delete mode 100644 owl-bot-staging/admin/database/v1/.jsdoc.js delete mode 100644 owl-bot-staging/admin/database/v1/.mocharc.js delete mode 100644 owl-bot-staging/admin/database/v1/.nycrc delete mode 100644 owl-bot-staging/admin/database/v1/.prettierignore delete mode 100644 owl-bot-staging/admin/database/v1/.prettierrc.js delete mode 100644 owl-bot-staging/admin/database/v1/CODE_OF_CONDUCT.md delete mode 100644 owl-bot-staging/admin/database/v1/CONTRIBUTING.md delete mode 100644 owl-bot-staging/admin/database/v1/LICENSE delete mode 100644 owl-bot-staging/admin/database/v1/README.md delete mode 100644 owl-bot-staging/admin/database/v1/package.json delete mode 100644 owl-bot-staging/admin/database/v1/protos/google/spanner/admin/database/v1/backup.proto delete mode 100644 owl-bot-staging/admin/database/v1/protos/google/spanner/admin/database/v1/backup_schedule.proto delete mode 100644 owl-bot-staging/admin/database/v1/protos/google/spanner/admin/database/v1/common.proto delete mode 100644 owl-bot-staging/admin/database/v1/protos/google/spanner/admin/database/v1/spanner_database_admin.proto delete mode 100644 owl-bot-staging/admin/database/v1/protos/protos.d.ts delete mode 100644 owl-bot-staging/admin/database/v1/protos/protos.js delete mode 100644 owl-bot-staging/admin/database/v1/protos/protos.json delete mode 100644 owl-bot-staging/admin/database/v1/src/index.ts delete mode 100644 owl-bot-staging/admin/database/v1/src/v1/database_admin_client.ts delete mode 100644 owl-bot-staging/admin/database/v1/src/v1/database_admin_client_config.json delete mode 100644 owl-bot-staging/admin/database/v1/src/v1/database_admin_proto_list.json delete mode 100644 owl-bot-staging/admin/database/v1/src/v1/gapic_metadata.json delete mode 100644 owl-bot-staging/admin/database/v1/src/v1/index.ts delete mode 100644 owl-bot-staging/admin/database/v1/test/gapic_database_admin_v1.ts delete mode 100644 owl-bot-staging/admin/database/v1/tsconfig.json delete mode 100644 owl-bot-staging/admin/database/v1/webpack.config.js delete mode 100644 owl-bot-staging/admin/instance/v1/.OwlBot.yaml delete mode 100644 owl-bot-staging/admin/instance/v1/.eslintignore delete mode 100644 owl-bot-staging/admin/instance/v1/.eslintrc.json delete mode 100644 owl-bot-staging/admin/instance/v1/.gitattributes delete mode 100644 owl-bot-staging/admin/instance/v1/.gitignore delete mode 100644 owl-bot-staging/admin/instance/v1/.jsdoc.js delete mode 100644 owl-bot-staging/admin/instance/v1/.mocharc.js delete mode 100644 owl-bot-staging/admin/instance/v1/.nycrc delete mode 100644 owl-bot-staging/admin/instance/v1/.prettierignore delete mode 100644 owl-bot-staging/admin/instance/v1/.prettierrc.js delete mode 100644 owl-bot-staging/admin/instance/v1/CODE_OF_CONDUCT.md delete mode 100644 owl-bot-staging/admin/instance/v1/CONTRIBUTING.md delete mode 100644 owl-bot-staging/admin/instance/v1/LICENSE delete mode 100644 owl-bot-staging/admin/instance/v1/README.md delete mode 100644 owl-bot-staging/admin/instance/v1/package.json delete mode 100644 owl-bot-staging/admin/instance/v1/protos/google/spanner/admin/instance/v1/common.proto delete mode 100644 owl-bot-staging/admin/instance/v1/protos/google/spanner/admin/instance/v1/spanner_instance_admin.proto delete mode 100644 owl-bot-staging/admin/instance/v1/protos/protos.d.ts delete mode 100644 owl-bot-staging/admin/instance/v1/protos/protos.js delete mode 100644 owl-bot-staging/admin/instance/v1/protos/protos.json delete mode 100644 owl-bot-staging/admin/instance/v1/src/index.ts delete mode 100644 owl-bot-staging/admin/instance/v1/src/v1/gapic_metadata.json delete mode 100644 owl-bot-staging/admin/instance/v1/src/v1/index.ts delete mode 100644 owl-bot-staging/admin/instance/v1/src/v1/instance_admin_client.ts delete mode 100644 owl-bot-staging/admin/instance/v1/src/v1/instance_admin_client_config.json delete mode 100644 owl-bot-staging/admin/instance/v1/src/v1/instance_admin_proto_list.json delete mode 100644 owl-bot-staging/admin/instance/v1/test/gapic_instance_admin_v1.ts delete mode 100644 owl-bot-staging/admin/instance/v1/tsconfig.json delete mode 100644 owl-bot-staging/admin/instance/v1/webpack.config.js delete mode 100644 owl-bot-staging/executor/v1/.OwlBot.yaml delete mode 100644 owl-bot-staging/executor/v1/.eslintignore delete mode 100644 owl-bot-staging/executor/v1/.eslintrc.json delete mode 100644 owl-bot-staging/executor/v1/.gitattributes delete mode 100644 owl-bot-staging/executor/v1/.gitignore delete mode 100644 owl-bot-staging/executor/v1/.jsdoc.js delete mode 100644 owl-bot-staging/executor/v1/.mocharc.js delete mode 100644 owl-bot-staging/executor/v1/.nycrc delete mode 100644 owl-bot-staging/executor/v1/.prettierignore delete mode 100644 owl-bot-staging/executor/v1/.prettierrc.js delete mode 100644 owl-bot-staging/executor/v1/CODE_OF_CONDUCT.md delete mode 100644 owl-bot-staging/executor/v1/CONTRIBUTING.md delete mode 100644 owl-bot-staging/executor/v1/LICENSE delete mode 100644 owl-bot-staging/executor/v1/README.md delete mode 100644 owl-bot-staging/executor/v1/package.json delete mode 100644 owl-bot-staging/executor/v1/protos/google/spanner/admin/database/v1/backup.proto delete mode 100644 owl-bot-staging/executor/v1/protos/google/spanner/admin/database/v1/backup_schedule.proto delete mode 100644 owl-bot-staging/executor/v1/protos/google/spanner/admin/database/v1/common.proto delete mode 100644 owl-bot-staging/executor/v1/protos/google/spanner/admin/database/v1/spanner_database_admin.proto delete mode 100644 owl-bot-staging/executor/v1/protos/google/spanner/admin/instance/v1/common.proto delete mode 100644 owl-bot-staging/executor/v1/protos/google/spanner/admin/instance/v1/spanner_instance_admin.proto delete mode 100644 owl-bot-staging/executor/v1/protos/google/spanner/executor/v1/cloud_executor.proto delete mode 100644 owl-bot-staging/executor/v1/protos/google/spanner/v1/change_stream.proto delete mode 100644 owl-bot-staging/executor/v1/protos/google/spanner/v1/commit_response.proto delete mode 100644 owl-bot-staging/executor/v1/protos/google/spanner/v1/keys.proto delete mode 100644 owl-bot-staging/executor/v1/protos/google/spanner/v1/location.proto delete mode 100644 owl-bot-staging/executor/v1/protos/google/spanner/v1/mutation.proto delete mode 100644 owl-bot-staging/executor/v1/protos/google/spanner/v1/query_plan.proto delete mode 100644 owl-bot-staging/executor/v1/protos/google/spanner/v1/result_set.proto delete mode 100644 owl-bot-staging/executor/v1/protos/google/spanner/v1/spanner.proto delete mode 100644 owl-bot-staging/executor/v1/protos/google/spanner/v1/transaction.proto delete mode 100644 owl-bot-staging/executor/v1/protos/google/spanner/v1/type.proto delete mode 100644 owl-bot-staging/executor/v1/protos/protos.d.ts delete mode 100644 owl-bot-staging/executor/v1/protos/protos.js delete mode 100644 owl-bot-staging/executor/v1/protos/protos.json delete mode 100644 owl-bot-staging/executor/v1/src/index.ts delete mode 100644 owl-bot-staging/executor/v1/src/v1/gapic_metadata.json delete mode 100644 owl-bot-staging/executor/v1/src/v1/index.ts delete mode 100644 owl-bot-staging/executor/v1/src/v1/spanner_executor_proxy_client.ts delete mode 100644 owl-bot-staging/executor/v1/src/v1/spanner_executor_proxy_client_config.json delete mode 100644 owl-bot-staging/executor/v1/src/v1/spanner_executor_proxy_proto_list.json delete mode 100644 owl-bot-staging/executor/v1/test/gapic_spanner_executor_proxy_v1.ts delete mode 100644 owl-bot-staging/executor/v1/tsconfig.json delete mode 100644 owl-bot-staging/executor/v1/webpack.config.js delete mode 100644 owl-bot-staging/v1/.OwlBot.yaml delete mode 100644 owl-bot-staging/v1/.eslintignore delete mode 100644 owl-bot-staging/v1/.eslintrc.json delete mode 100644 owl-bot-staging/v1/.gitattributes delete mode 100644 owl-bot-staging/v1/.gitignore delete mode 100644 owl-bot-staging/v1/.jsdoc.js delete mode 100644 owl-bot-staging/v1/.mocharc.js delete mode 100644 owl-bot-staging/v1/.nycrc delete mode 100644 owl-bot-staging/v1/.prettierignore delete mode 100644 owl-bot-staging/v1/.prettierrc.js delete mode 100644 owl-bot-staging/v1/CODE_OF_CONDUCT.md delete mode 100644 owl-bot-staging/v1/CONTRIBUTING.md delete mode 100644 owl-bot-staging/v1/LICENSE delete mode 100644 owl-bot-staging/v1/README.md delete mode 100644 owl-bot-staging/v1/package.json delete mode 100644 owl-bot-staging/v1/protos/google/spanner/v1/change_stream.proto delete mode 100644 owl-bot-staging/v1/protos/google/spanner/v1/commit_response.proto delete mode 100644 owl-bot-staging/v1/protos/google/spanner/v1/keys.proto delete mode 100644 owl-bot-staging/v1/protos/google/spanner/v1/location.proto delete mode 100644 owl-bot-staging/v1/protos/google/spanner/v1/mutation.proto delete mode 100644 owl-bot-staging/v1/protos/google/spanner/v1/query_plan.proto delete mode 100644 owl-bot-staging/v1/protos/google/spanner/v1/result_set.proto delete mode 100644 owl-bot-staging/v1/protos/google/spanner/v1/spanner.proto delete mode 100644 owl-bot-staging/v1/protos/google/spanner/v1/transaction.proto delete mode 100644 owl-bot-staging/v1/protos/google/spanner/v1/type.proto delete mode 100644 owl-bot-staging/v1/protos/protos.d.ts delete mode 100644 owl-bot-staging/v1/protos/protos.js delete mode 100644 owl-bot-staging/v1/protos/protos.json delete mode 100644 owl-bot-staging/v1/src/index.ts delete mode 100644 owl-bot-staging/v1/src/v1/gapic_metadata.json delete mode 100644 owl-bot-staging/v1/src/v1/index.ts delete mode 100644 owl-bot-staging/v1/src/v1/spanner_client.ts delete mode 100644 owl-bot-staging/v1/src/v1/spanner_client_config.json delete mode 100644 owl-bot-staging/v1/src/v1/spanner_proto_list.json delete mode 100644 owl-bot-staging/v1/test/gapic_spanner_v1.ts delete mode 100644 owl-bot-staging/v1/tsconfig.json delete mode 100644 owl-bot-staging/v1/webpack.config.js diff --git a/README.md b/README.md index 798e51cec..2f55e5c9a 100644 --- a/README.md +++ b/README.md @@ -233,8 +233,8 @@ Samples are in the [`samples/`](https://github.com/googleapis/nodejs-spanner/tre | Queryoptions | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/queryoptions.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/queryoptions.js,samples/README.md) | | Quickstart | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) | | Read data with database role | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/read-data-with-database-role.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/read-data-with-database-role.js,samples/README.md) | -| Performs a read-write transaction with isolation level option | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/repeatable-reads.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/repeatable-reads.js,samples/README.md) | | Performs a read-write transaction with read lock mode option | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/read-lock-mode.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/read-lock-mode.js,samples/README.md) | +| Performs a read-write transaction with isolation level option | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/repeatable-reads.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/repeatable-reads.js,samples/README.md) | | Sets a request tag for a single query | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/request-tag.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/request-tag.js,samples/README.md) | | Run Batch update with RPC priority | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/rpc-priority-batch-dml.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/rpc-priority-batch-dml.js,samples/README.md) | | Run partitioned update with RPC priority | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/rpc-priority-partitioned-dml.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/rpc-priority-partitioned-dml.js,samples/README.md) | diff --git a/owl-bot-staging/admin/database/v1/.OwlBot.yaml b/owl-bot-staging/admin/database/v1/.OwlBot.yaml deleted file mode 100644 index 23a34a9ea..000000000 --- a/owl-bot-staging/admin/database/v1/.OwlBot.yaml +++ /dev/null @@ -1,19 +0,0 @@ -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -deep-copy-regex: - - source: /google/spanner/admin/database/google-spanner-admin-database-nodejs - dest: /owl-bot-staging/google-spanner-admin-database - -api-name: database \ No newline at end of file diff --git a/owl-bot-staging/admin/database/v1/.eslintignore b/owl-bot-staging/admin/database/v1/.eslintignore deleted file mode 100644 index cfc348ec4..000000000 --- a/owl-bot-staging/admin/database/v1/.eslintignore +++ /dev/null @@ -1,7 +0,0 @@ -**/node_modules -**/.coverage -build/ -docs/ -protos/ -system-test/ -samples/generated/ diff --git a/owl-bot-staging/admin/database/v1/.eslintrc.json b/owl-bot-staging/admin/database/v1/.eslintrc.json deleted file mode 100644 index 782153495..000000000 --- a/owl-bot-staging/admin/database/v1/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./node_modules/gts" -} diff --git a/owl-bot-staging/admin/database/v1/.gitattributes b/owl-bot-staging/admin/database/v1/.gitattributes deleted file mode 100644 index 33739cb74..000000000 --- a/owl-bot-staging/admin/database/v1/.gitattributes +++ /dev/null @@ -1,4 +0,0 @@ -*.ts text eol=lf -*.js text eol=lf -protos/* linguist-generated -**/api-extractor.json linguist-language=JSON-with-Comments diff --git a/owl-bot-staging/admin/database/v1/.gitignore b/owl-bot-staging/admin/database/v1/.gitignore deleted file mode 100644 index d4f03a0df..000000000 --- a/owl-bot-staging/admin/database/v1/.gitignore +++ /dev/null @@ -1,14 +0,0 @@ -**/*.log -**/node_modules -/.coverage -/coverage -/.nyc_output -/docs/ -/out/ -/build/ -system-test/secrets.js -system-test/*key.json -*.lock -.DS_Store -package-lock.json -__pycache__ diff --git a/owl-bot-staging/admin/database/v1/.jsdoc.js b/owl-bot-staging/admin/database/v1/.jsdoc.js deleted file mode 100644 index 89dbb7cd9..000000000 --- a/owl-bot-staging/admin/database/v1/.jsdoc.js +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -'use strict'; - -module.exports = { - opts: { - readme: './README.md', - package: './package.json', - template: './node_modules/jsdoc-fresh', - recurse: true, - verbose: true, - destination: './docs/' - }, - plugins: [ - 'plugins/markdown', - 'jsdoc-region-tag' - ], - source: { - excludePattern: '(^|\\/|\\\\)[._]', - include: [ - 'build/src', - 'protos' - ], - includePattern: '\\.js$' - }, - templates: { - copyright: 'Copyright 2026 Google LLC', - includeDate: false, - sourceFiles: false, - systemName: '@google-cloud/spanner', - theme: 'lumen', - default: { - outputSourceFiles: false - } - }, - markdown: { - idInHeadings: true - } -}; diff --git a/owl-bot-staging/admin/database/v1/.mocharc.js b/owl-bot-staging/admin/database/v1/.mocharc.js deleted file mode 100644 index 5eb34e86c..000000000 --- a/owl-bot-staging/admin/database/v1/.mocharc.js +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -const config = { - "enable-source-maps": true, - "throw-deprecation": true, - "timeout": 10000 -} -if (process.env.MOCHA_THROW_DEPRECATION === 'false') { - delete config['throw-deprecation']; -} -if (process.env.MOCHA_REPORTER) { - config.reporter = process.env.MOCHA_REPORTER; -} -if (process.env.MOCHA_REPORTER_OUTPUT) { - config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; -} -module.exports = config diff --git a/owl-bot-staging/admin/database/v1/.nycrc b/owl-bot-staging/admin/database/v1/.nycrc deleted file mode 100644 index 81a95fc94..000000000 --- a/owl-bot-staging/admin/database/v1/.nycrc +++ /dev/null @@ -1,24 +0,0 @@ -{ - "report-dir": "./.coverage", - "reporter": ["text", "lcov"], - "exclude": [ - "**/*-test", - "**/.coverage", - "**/apis", - "**/benchmark", - "**/conformance", - "**/docs", - "**/samples", - "**/scripts", - "**/protos", - "**/test", - "**/*.d.ts", - ".jsdoc.js", - "**/.jsdoc.js", - "karma.conf.js", - "webpack-tests.config.js", - "webpack.config.js" - ], - "exclude-after-remap": false, - "all": true -} \ No newline at end of file diff --git a/owl-bot-staging/admin/database/v1/.prettierignore b/owl-bot-staging/admin/database/v1/.prettierignore deleted file mode 100644 index 9340ad9b8..000000000 --- a/owl-bot-staging/admin/database/v1/.prettierignore +++ /dev/null @@ -1,6 +0,0 @@ -**/node_modules -**/coverage -test/fixtures -build/ -docs/ -protos/ diff --git a/owl-bot-staging/admin/database/v1/.prettierrc.js b/owl-bot-staging/admin/database/v1/.prettierrc.js deleted file mode 100644 index 7649ee3c2..000000000 --- a/owl-bot-staging/admin/database/v1/.prettierrc.js +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - -module.exports = { - ...require('gts/.prettierrc.json') -} diff --git a/owl-bot-staging/admin/database/v1/CODE_OF_CONDUCT.md b/owl-bot-staging/admin/database/v1/CODE_OF_CONDUCT.md deleted file mode 100644 index 2add2547a..000000000 --- a/owl-bot-staging/admin/database/v1/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,94 +0,0 @@ - -# Code of Conduct - -## Our Pledge - -In the interest of fostering an open and welcoming environment, we as -contributors and maintainers pledge to making participation in our project and -our community a harassment-free experience for everyone, regardless of age, body -size, disability, ethnicity, gender identity and expression, level of -experience, education, socio-economic status, nationality, personal appearance, -race, religion, or sexual identity and orientation. - -## Our Standards - -Examples of behavior that contributes to creating a positive environment -include: - -* Using welcoming and inclusive language -* Being respectful of differing viewpoints and experiences -* Gracefully accepting constructive criticism -* Focusing on what is best for the community -* Showing empathy towards other community members - -Examples of unacceptable behavior by participants include: - -* The use of sexualized language or imagery and unwelcome sexual attention or - advances -* Trolling, insulting/derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or electronic - address, without explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting - -## Our Responsibilities - -Project maintainers are responsible for clarifying the standards of acceptable -behavior and are expected to take appropriate and fair corrective action in -response to any instances of unacceptable behavior. - -Project maintainers have the right and responsibility to remove, edit, or reject -comments, commits, code, wiki edits, issues, and other contributions that are -not aligned to this Code of Conduct, or to ban temporarily or permanently any -contributor for other behaviors that they deem inappropriate, threatening, -offensive, or harmful. - -## Scope - -This Code of Conduct applies both within project spaces and in public spaces -when an individual is representing the project or its community. Examples of -representing a project or community include using an official project e-mail -address, posting via an official social media account, or acting as an appointed -representative at an online or offline event. Representation of a project may be -further defined and clarified by project maintainers. - -This Code of Conduct also applies outside the project spaces when the Project -Steward has a reasonable belief that an individual's behavior may have a -negative impact on the project or its community. - -## Conflict Resolution - -We do not believe that all conflict is bad; healthy debate and disagreement -often yield positive results. However, it is never okay to be disrespectful or -to engage in behavior that violates the project’s code of conduct. - -If you see someone violating the code of conduct, you are encouraged to address -the behavior directly with those involved. Many issues can be resolved quickly -and easily, and this gives people more control over the outcome of their -dispute. If you are unable to resolve the matter for any reason, or if the -behavior is threatening or harassing, report it. We are dedicated to providing -an environment where participants feel welcome and safe. - -Reports should be directed to *googleapis-stewards@google.com*, the -Project Steward(s) for *Google Cloud Client Libraries*. It is the Project Steward’s duty to -receive and address reported violations of the code of conduct. They will then -work with a committee consisting of representatives from the Open Source -Programs Office and the Google Open Source Strategy team. If for any reason you -are uncomfortable reaching out to the Project Steward, please email -opensource@google.com. - -We will investigate every complaint, but you may not receive a direct response. -We will use our discretion in determining when and how to follow up on reported -incidents, which may range from not taking action to permanent expulsion from -the project and project-sponsored spaces. We will notify the accused of the -report and provide them an opportunity to discuss it before any action is taken. -The identity of the reporter will be omitted from the details of the report -supplied to the accused. In potentially harmful situations, such as ongoing -harassment or threats to anyone's safety, we may take action without notice. - -## Attribution - -This Code of Conduct is adapted from the Contributor Covenant, version 1.4, -available at -https://www.contributor-covenant.org/version/1/4/code-of-conduct.html \ No newline at end of file diff --git a/owl-bot-staging/admin/database/v1/CONTRIBUTING.md b/owl-bot-staging/admin/database/v1/CONTRIBUTING.md deleted file mode 100644 index 6e5fdafe3..000000000 --- a/owl-bot-staging/admin/database/v1/CONTRIBUTING.md +++ /dev/null @@ -1,76 +0,0 @@ -# How to become a contributor and submit your own code - -**Table of contents** - -* [Contributor License Agreements](#contributor-license-agreements) -* [Contributing a patch](#contributing-a-patch) -* [Running the tests](#running-the-tests) -* [Releasing the library](#releasing-the-library) - -## Contributor License Agreements - -We'd love to accept your sample apps and patches! Before we can take them, we -have to jump a couple of legal hurdles. - -Please fill out either the individual or corporate Contributor License Agreement -(CLA). - - * If you are an individual writing original source code and you're sure you - own the intellectual property, then you'll need to sign an [individual CLA](https://developers.google.com/open-source/cla/individual). - * If you work for a company that wants to allow you to contribute your work, - then you'll need to sign a [corporate CLA](https://developers.google.com/open-source/cla/corporate). - -Follow either of the two links above to access the appropriate CLA and -instructions for how to sign and return it. Once we receive it, we'll be able to -accept your pull requests. - -## Contributing A Patch - -1. Submit an issue describing your proposed change to the repo in question. -1. The repo owner will respond to your issue promptly. -1. If your proposed change is accepted, and you haven't already done so, sign a - Contributor License Agreement (see details above). -1. Fork the desired repo, develop and test your code changes. -1. Ensure that your code adheres to the existing style in the code to which - you are contributing. -1. Ensure that your code has an appropriate set of tests which all pass. -1. Title your pull request following [Conventional Commits](https://www.conventionalcommits.org/) styling. -1. Submit a pull request. - -### Before you begin - -1. [Select or create a Cloud Platform project][projects]. -1. [Enable billing for your project][billing]. -1. [Enable the Database API][enable_api]. -1. [Set up authentication with a service account][auth] so you can access the - API from your local workstation. - - -## Running the tests - -1. [Prepare your environment for Node.js setup][setup]. - -1. Install dependencies: - - npm install - -1. Run the tests: - - # Run unit tests. - npm test - - # Run sample integration tests. - npm run samples-test - - # Run all system tests. - npm run system-test - -1. Lint (and maybe fix) any changes: - - npm run fix - -[setup]: https://cloud.google.com/nodejs/docs/setup -[projects]: https://console.cloud.google.com/project -[billing]: https://support.google.com/cloud/answer/6293499#enable-billing -[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=spanner.googleapis.com -[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/owl-bot-staging/admin/database/v1/LICENSE b/owl-bot-staging/admin/database/v1/LICENSE deleted file mode 100644 index d64569567..000000000 --- a/owl-bot-staging/admin/database/v1/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/owl-bot-staging/admin/database/v1/README.md b/owl-bot-staging/admin/database/v1/README.md deleted file mode 100644 index 601a2a6cb..000000000 --- a/owl-bot-staging/admin/database/v1/README.md +++ /dev/null @@ -1,108 +0,0 @@ -[//]: # "This README.md file is auto-generated, all changes to this file will be lost." -[//]: # "The comments you see below are used to generate those parts of the template in later states." -Google Cloud Platform logo - -# [Cloud Spanner API: Nodejs Client][homepage] - -[//]: # "releaseLevel" - -[![npm version](https://img.shields.io/npm/v/@google-cloud/spanner.svg)](https://www.npmjs.org/package/@google-cloud/spanner) - -Cloud Spanner API client for Node.js - -[//]: # "partials.introduction" - -A comprehensive list of changes in each version may be found in -[the CHANGELOG][homepage_changelog]. - -* [Cloud Spanner API Nodejs Client API Reference](https://cloud.google.com/nodejs/docs/reference/database/latest) -* [Cloud Spanner API Documentation](https://cloud.google.com/spanner/) - -Read more about the client libraries for Cloud APIs, including the older -Google APIs Client Libraries, in [Client Libraries Explained][explained]. - -[explained]: https://cloud.google.com/apis/docs/client-libraries-explained - -**Table of contents:** - -* [Quickstart](#quickstart) - * [Before you begin](#before-you-begin) - * [Installing the client library](#installing-the-client-library) - -* [Versioning](#versioning) -* [Contributing](#contributing) -* [License](#license) - -## Quickstart -### Before you begin - -1. [Select or create a Cloud Platform project][projects]. -1. [Enable billing for your project][billing]. -1. [Enable the Cloud Spanner API API][enable_api]. -1. [Set up authentication][auth] so you can access the - API from your local workstation. -### Installing the client library - -```bash -npm install @google-cloud/spanner -``` - -[//]: # "partials.body" - -## Samples - -Samples are in the [`samples/`][homepage_samples] directory. Each sample's `README.md` has instructions for running its sample. - -[//]: # "samples" - -## Supported Node.js Versions - -Our client libraries follow the [Node.js release schedule](https://github.com/nodejs/release#release-schedule). -Libraries are compatible with all current _active_ and _maintenance_ versions of -Node.js. -If you are using an end-of-life version of Node.js, we recommend that you update -as soon as possible to an actively supported LTS version. - -Google's client libraries support legacy versions of Node.js runtimes on a -best-efforts basis with the following warnings: - -* Legacy versions are not tested in continuous integration. -* Some security patches and features cannot be backported. -* Dependencies cannot be kept up-to-date. - -Client libraries targeting some end-of-life versions of Node.js are available, and -can be installed through npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). -The dist-tags follow the naming convention `legacy-(version)`. -For example, `npm install @google-cloud/spanner@legacy-8` installs client libraries -for versions compatible with Node.js 8. - -## Versioning - -This library follows [Semantic Versioning](http://semver.org/). - -More Information: [Google Cloud Platform Launch Stages][launch_stages] - -[launch_stages]: https://cloud.google.com/terms/launch-stages - -## Contributing - -Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-spanner-admin-database/CONTRIBUTING.md). - -Please note that this `README.md` -and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) -are generated from a central template. - -## License - -Apache Version 2.0 - -See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-spanner-admin-database/LICENSE) - -[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png -[projects]: https://console.cloud.google.com/project -[billing]: https://support.google.com/cloud/answer/6293499#enable-billing -[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=spanner.googleapis.com -[auth]: https://cloud.google.com/docs/authentication/external/set-up-adc-local -[homepage_samples]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-spanner-admin-database/samples -[homepage_changelog]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-spanner-admin-database/CHANGELOG.md -[homepage]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-spanner-admin-database diff --git a/owl-bot-staging/admin/database/v1/package.json b/owl-bot-staging/admin/database/v1/package.json deleted file mode 100644 index a06896525..000000000 --- a/owl-bot-staging/admin/database/v1/package.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "name": "@google-cloud/spanner", - "version": "0.1.0", - "description": "Database client for Node.js", - "repository": "googleapis/nodejs-database", - "license": "Apache-2.0", - "author": "Google LLC", - "main": "build/src/index.js", - "files": [ - "build/src", - "build/protos" - ], - "keywords": [ - "google apis client", - "google api client", - "google apis", - "google api", - "google", - "google cloud platform", - "google cloud", - "cloud", - "google database", - "database", - "database admin" - ], - "scripts": { - "clean": "gts clean", - "compile": "tsc -p . && cp -r protos build/ && minifyProtoJson", - "compile-protos": "compileProtos src", - "docs": "jsdoc -c .jsdoc.js", - "fix": "gts fix", - "lint": "gts check", - "prepare": "npm run compile-protos && npm run compile", - "system-test": "c8 mocha build/system-test", - "test": "c8 mocha build/test" - }, - "dependencies": { - "google-gax": "^5.1.1-rc.1" - }, - "devDependencies": { - "@types/mocha": "^10.0.10", - "@types/node": "^22.18.12", - "@types/sinon": "^17.0.4", - "c8": "^10.1.3", - "gapic-tools": "^1.0.3", - "gts": "^6.0.2", - "jsdoc": "^4.0.5", - "jsdoc-fresh": "^5.0.2", - "jsdoc-region-tag": "^4.0.1", - "mocha": "^11.7.4", - "pack-n-play": "^4.2.1", - "typescript": "5.8.3", - "sinon": "^21.0.0" - }, - "engines": { - "node": ">=v18" - } -} diff --git a/owl-bot-staging/admin/database/v1/protos/google/spanner/admin/database/v1/backup.proto b/owl-bot-staging/admin/database/v1/protos/google/spanner/admin/database/v1/backup.proto deleted file mode 100644 index 6898814c4..000000000 --- a/owl-bot-staging/admin/database/v1/protos/google/spanner/admin/database/v1/backup.proto +++ /dev/null @@ -1,773 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.spanner.admin.database.v1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/field_mask.proto"; -import "google/protobuf/timestamp.proto"; -import "google/spanner/admin/database/v1/common.proto"; - -option csharp_namespace = "Google.Cloud.Spanner.Admin.Database.V1"; -option go_package = "cloud.google.com/go/spanner/admin/database/apiv1/databasepb;databasepb"; -option java_multiple_files = true; -option java_outer_classname = "BackupProto"; -option java_package = "com.google.spanner.admin.database.v1"; -option php_namespace = "Google\\Cloud\\Spanner\\Admin\\Database\\V1"; -option ruby_package = "Google::Cloud::Spanner::Admin::Database::V1"; - -// A backup of a Cloud Spanner database. -message Backup { - option (google.api.resource) = { - type: "spanner.googleapis.com/Backup" - pattern: "projects/{project}/instances/{instance}/backups/{backup}" - }; - - // Indicates the current state of the backup. - enum State { - // Not specified. - STATE_UNSPECIFIED = 0; - - // The pending backup is still being created. Operations on the - // backup may fail with `FAILED_PRECONDITION` in this state. - CREATING = 1; - - // The backup is complete and ready for use. - READY = 2; - } - - // Required for the - // [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] - // operation. Name of the database from which this backup was created. This - // needs to be in the same instance as the backup. Values are of the form - // `projects//instances//databases/`. - string database = 2 [(google.api.resource_reference) = { - type: "spanner.googleapis.com/Database" - }]; - - // The backup will contain an externally consistent copy of the database at - // the timestamp specified by `version_time`. If `version_time` is not - // specified, the system will set `version_time` to the `create_time` of the - // backup. - google.protobuf.Timestamp version_time = 9; - - // Required for the - // [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] - // operation. The expiration time of the backup, with microseconds - // granularity that must be at least 6 hours and at most 366 days - // from the time the CreateBackup request is processed. Once the `expire_time` - // has passed, the backup is eligible to be automatically deleted by Cloud - // Spanner to free the resources used by the backup. - google.protobuf.Timestamp expire_time = 3; - - // Output only for the - // [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] - // operation. Required for the - // [UpdateBackup][google.spanner.admin.database.v1.DatabaseAdmin.UpdateBackup] - // operation. - // - // A globally unique identifier for the backup which cannot be - // changed. Values are of the form - // `projects//instances//backups/[a-z][a-z0-9_\-]*[a-z0-9]` - // The final segment of the name must be between 2 and 60 characters - // in length. - // - // The backup is stored in the location(s) specified in the instance - // configuration of the instance containing the backup, identified - // by the prefix of the backup name of the form - // `projects//instances/`. - string name = 1; - - // Output only. The time the - // [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] - // request is received. If the request does not specify `version_time`, the - // `version_time` of the backup will be equivalent to the `create_time`. - google.protobuf.Timestamp create_time = 4 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Size of the backup in bytes. - int64 size_bytes = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The number of bytes that will be freed by deleting this - // backup. This value will be zero if, for example, this backup is part of an - // incremental backup chain and younger backups in the chain require that we - // keep its data. For backups not in an incremental backup chain, this is - // always the size of the backup. This value may change if backups on the same - // chain get created, deleted or expired. - int64 freeable_size_bytes = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. For a backup in an incremental backup chain, this is the - // storage space needed to keep the data that has changed since the previous - // backup. For all other backups, this is always the size of the backup. This - // value may change if backups on the same chain get deleted or expired. - // - // This field can be used to calculate the total storage space used by a set - // of backups. For example, the total space used by all backups of a database - // can be computed by summing up this field. - int64 exclusive_size_bytes = 16 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The current state of the backup. - State state = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The names of the restored databases that reference the backup. - // The database names are of - // the form `projects//instances//databases/`. - // Referencing databases may exist in different instances. The existence of - // any referencing database prevents the backup from being deleted. When a - // restored database from the backup enters the `READY` state, the reference - // to the backup is removed. - repeated string referencing_databases = 7 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.resource_reference) = { - type: "spanner.googleapis.com/Database" - } - ]; - - // Output only. The encryption information for the backup. - EncryptionInfo encryption_info = 8 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The encryption information for the backup, whether it is - // protected by one or more KMS keys. The information includes all Cloud - // KMS key versions used to encrypt the backup. The `encryption_status' field - // inside of each `EncryptionInfo` is not populated. At least one of the key - // versions must be available for the backup to be restored. If a key version - // is revoked in the middle of a restore, the restore behavior is undefined. - repeated EncryptionInfo encryption_information = 13 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The database dialect information for the backup. - DatabaseDialect database_dialect = 10 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The names of the destination backups being created by copying - // this source backup. The backup names are of the form - // `projects//instances//backups/`. - // Referencing backups may exist in different instances. The existence of - // any referencing backup prevents the backup from being deleted. When the - // copy operation is done (either successfully completed or cancelled or the - // destination backup is deleted), the reference to the backup is removed. - repeated string referencing_backups = 11 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.resource_reference) = { type: "spanner.googleapis.com/Backup" } - ]; - - // Output only. The max allowed expiration time of the backup, with - // microseconds granularity. A backup's expiration time can be configured in - // multiple APIs: CreateBackup, UpdateBackup, CopyBackup. When updating or - // copying an existing backup, the expiration time specified must be - // less than `Backup.max_expire_time`. - google.protobuf.Timestamp max_expire_time = 12 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. List of backup schedule URIs that are associated with - // creating this backup. This is only applicable for scheduled backups, and - // is empty for on-demand backups. - // - // To optimize for storage, whenever possible, multiple schedules are - // collapsed together to create one backup. In such cases, this field captures - // the list of all backup schedule URIs that are associated with creating - // this backup. If collapsing is not done, then this field captures the - // single backup schedule URI associated with creating this backup. - repeated string backup_schedules = 14 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.resource_reference) = { - type: "spanner.googleapis.com/BackupSchedule" - } - ]; - - // Output only. Populated only for backups in an incremental backup chain. - // Backups share the same chain id if and only if they belong to the same - // incremental backup chain. Use this field to determine which backups are - // part of the same incremental backup chain. The ordering of backups in the - // chain can be determined by ordering the backup `version_time`. - string incremental_backup_chain_id = 17 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Data deleted at a time older than this is guaranteed not to be - // retained in order to support this backup. For a backup in an incremental - // backup chain, this is the version time of the oldest backup that exists or - // ever existed in the chain. For all other backups, this is the version time - // of the backup. This field can be used to understand what data is being - // retained by the backup system. - google.protobuf.Timestamp oldest_version_time = 18 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The instance partition(s) storing the backup. - // - // This is the same as the list of the instance partition(s) that the database - // had footprint in at the backup's `version_time`. - repeated BackupInstancePartition instance_partitions = 19 - [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// The request for -// [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup]. -message CreateBackupRequest { - // Required. The name of the instance in which the backup will be - // created. This must be the same instance that contains the database the - // backup will be created from. The backup will be stored in the - // location(s) specified in the instance configuration of this - // instance. Values are of the form - // `projects//instances/`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "spanner.googleapis.com/Instance" - } - ]; - - // Required. The id of the backup to be created. The `backup_id` appended to - // `parent` forms the full backup name of the form - // `projects//instances//backups/`. - string backup_id = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The backup to create. - Backup backup = 3 [(google.api.field_behavior) = REQUIRED]; - - // Optional. The encryption configuration used to encrypt the backup. If this - // field is not specified, the backup will use the same encryption - // configuration as the database by default, namely - // [encryption_type][google.spanner.admin.database.v1.CreateBackupEncryptionConfig.encryption_type] - // = `USE_DATABASE_ENCRYPTION`. - CreateBackupEncryptionConfig encryption_config = 4 - [(google.api.field_behavior) = OPTIONAL]; -} - -// Metadata type for the operation returned by -// [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup]. -message CreateBackupMetadata { - // The name of the backup being created. - string name = 1 [ - (google.api.resource_reference) = { type: "spanner.googleapis.com/Backup" } - ]; - - // The name of the database the backup is created from. - string database = 2 [(google.api.resource_reference) = { - type: "spanner.googleapis.com/Database" - }]; - - // The progress of the - // [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] - // operation. - OperationProgress progress = 3; - - // The time at which cancellation of this operation was received. - // [Operations.CancelOperation][google.longrunning.Operations.CancelOperation] - // starts asynchronous cancellation on a long-running operation. The server - // makes a best effort to cancel the operation, but success is not guaranteed. - // Clients can use - // [Operations.GetOperation][google.longrunning.Operations.GetOperation] or - // other methods to check whether the cancellation succeeded or whether the - // operation completed despite cancellation. On successful cancellation, - // the operation is not deleted; instead, it becomes an operation with - // an [Operation.error][google.longrunning.Operation.error] value with a - // [google.rpc.Status.code][google.rpc.Status.code] of 1, - // corresponding to `Code.CANCELLED`. - google.protobuf.Timestamp cancel_time = 4; -} - -// The request for -// [CopyBackup][google.spanner.admin.database.v1.DatabaseAdmin.CopyBackup]. -message CopyBackupRequest { - // Required. The name of the destination instance that will contain the backup - // copy. Values are of the form: `projects//instances/`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "spanner.googleapis.com/Instance" - } - ]; - - // Required. The id of the backup copy. - // The `backup_id` appended to `parent` forms the full backup_uri of the form - // `projects//instances//backups/`. - string backup_id = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The source backup to be copied. - // The source backup needs to be in READY state for it to be copied. - // Once CopyBackup is in progress, the source backup cannot be deleted or - // cleaned up on expiration until CopyBackup is finished. - // Values are of the form: - // `projects//instances//backups/`. - string source_backup = 3 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "spanner.googleapis.com/Backup" } - ]; - - // Required. The expiration time of the backup in microsecond granularity. - // The expiration time must be at least 6 hours and at most 366 days - // from the `create_time` of the source backup. Once the `expire_time` has - // passed, the backup is eligible to be automatically deleted by Cloud Spanner - // to free the resources used by the backup. - google.protobuf.Timestamp expire_time = 4 - [(google.api.field_behavior) = REQUIRED]; - - // Optional. The encryption configuration used to encrypt the backup. If this - // field is not specified, the backup will use the same encryption - // configuration as the source backup by default, namely - // [encryption_type][google.spanner.admin.database.v1.CopyBackupEncryptionConfig.encryption_type] - // = `USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION`. - CopyBackupEncryptionConfig encryption_config = 5 - [(google.api.field_behavior) = OPTIONAL]; -} - -// Metadata type for the operation returned by -// [CopyBackup][google.spanner.admin.database.v1.DatabaseAdmin.CopyBackup]. -message CopyBackupMetadata { - // The name of the backup being created through the copy operation. - // Values are of the form - // `projects//instances//backups/`. - string name = 1 [ - (google.api.resource_reference) = { type: "spanner.googleapis.com/Backup" } - ]; - - // The name of the source backup that is being copied. - // Values are of the form - // `projects//instances//backups/`. - string source_backup = 2 [ - (google.api.resource_reference) = { type: "spanner.googleapis.com/Backup" } - ]; - - // The progress of the - // [CopyBackup][google.spanner.admin.database.v1.DatabaseAdmin.CopyBackup] - // operation. - OperationProgress progress = 3; - - // The time at which cancellation of CopyBackup operation was received. - // [Operations.CancelOperation][google.longrunning.Operations.CancelOperation] - // starts asynchronous cancellation on a long-running operation. The server - // makes a best effort to cancel the operation, but success is not guaranteed. - // Clients can use - // [Operations.GetOperation][google.longrunning.Operations.GetOperation] or - // other methods to check whether the cancellation succeeded or whether the - // operation completed despite cancellation. On successful cancellation, - // the operation is not deleted; instead, it becomes an operation with - // an [Operation.error][google.longrunning.Operation.error] value with a - // [google.rpc.Status.code][google.rpc.Status.code] of 1, - // corresponding to `Code.CANCELLED`. - google.protobuf.Timestamp cancel_time = 4; -} - -// The request for -// [UpdateBackup][google.spanner.admin.database.v1.DatabaseAdmin.UpdateBackup]. -message UpdateBackupRequest { - // Required. The backup to update. `backup.name`, and the fields to be updated - // as specified by `update_mask` are required. Other fields are ignored. - // Update is only supported for the following fields: - // * `backup.expire_time`. - Backup backup = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. A mask specifying which fields (e.g. `expire_time`) in the - // Backup resource should be updated. This mask is relative to the Backup - // resource, not to the request message. The field mask must always be - // specified; this prevents any future fields from being erased accidentally - // by clients that do not know about them. - google.protobuf.FieldMask update_mask = 2 - [(google.api.field_behavior) = REQUIRED]; -} - -// The request for -// [GetBackup][google.spanner.admin.database.v1.DatabaseAdmin.GetBackup]. -message GetBackupRequest { - // Required. Name of the backup. - // Values are of the form - // `projects//instances//backups/`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "spanner.googleapis.com/Backup" } - ]; -} - -// The request for -// [DeleteBackup][google.spanner.admin.database.v1.DatabaseAdmin.DeleteBackup]. -message DeleteBackupRequest { - // Required. Name of the backup to delete. - // Values are of the form - // `projects//instances//backups/`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "spanner.googleapis.com/Backup" } - ]; -} - -// The request for -// [ListBackups][google.spanner.admin.database.v1.DatabaseAdmin.ListBackups]. -message ListBackupsRequest { - // Required. The instance to list backups from. Values are of the - // form `projects//instances/`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "spanner.googleapis.com/Instance" - } - ]; - - // An expression that filters the list of returned backups. - // - // A filter expression consists of a field name, a comparison operator, and a - // value for filtering. - // The value must be a string, a number, or a boolean. The comparison operator - // must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. - // Colon `:` is the contains operator. Filter rules are not case sensitive. - // - // The following fields in the - // [Backup][google.spanner.admin.database.v1.Backup] are eligible for - // filtering: - // - // * `name` - // * `database` - // * `state` - // * `create_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) - // * `expire_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) - // * `version_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) - // * `size_bytes` - // * `backup_schedules` - // - // You can combine multiple expressions by enclosing each expression in - // parentheses. By default, expressions are combined with AND logic, but - // you can specify AND, OR, and NOT logic explicitly. - // - // Here are a few examples: - // - // * `name:Howl` - The backup's name contains the string "howl". - // * `database:prod` - // - The database's name contains the string "prod". - // * `state:CREATING` - The backup is pending creation. - // * `state:READY` - The backup is fully created and ready for use. - // * `(name:howl) AND (create_time < \"2018-03-28T14:50:00Z\")` - // - The backup name contains the string "howl" and `create_time` - // of the backup is before 2018-03-28T14:50:00Z. - // * `expire_time < \"2018-03-28T14:50:00Z\"` - // - The backup `expire_time` is before 2018-03-28T14:50:00Z. - // * `size_bytes > 10000000000` - The backup's size is greater than 10GB - // * `backup_schedules:daily` - // - The backup is created from a schedule with "daily" in its name. - string filter = 2; - - // Number of backups to be returned in the response. If 0 or - // less, defaults to the server's maximum allowed page size. - int32 page_size = 3; - - // If non-empty, `page_token` should contain a - // [next_page_token][google.spanner.admin.database.v1.ListBackupsResponse.next_page_token] - // from a previous - // [ListBackupsResponse][google.spanner.admin.database.v1.ListBackupsResponse] - // to the same `parent` and with the same `filter`. - string page_token = 4; -} - -// The response for -// [ListBackups][google.spanner.admin.database.v1.DatabaseAdmin.ListBackups]. -message ListBackupsResponse { - // The list of matching backups. Backups returned are ordered by `create_time` - // in descending order, starting from the most recent `create_time`. - repeated Backup backups = 1; - - // `next_page_token` can be sent in a subsequent - // [ListBackups][google.spanner.admin.database.v1.DatabaseAdmin.ListBackups] - // call to fetch more of the matching backups. - string next_page_token = 2; -} - -// The request for -// [ListBackupOperations][google.spanner.admin.database.v1.DatabaseAdmin.ListBackupOperations]. -message ListBackupOperationsRequest { - // Required. The instance of the backup operations. Values are of - // the form `projects//instances/`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "spanner.googleapis.com/Instance" - } - ]; - - // An expression that filters the list of returned backup operations. - // - // A filter expression consists of a field name, a - // comparison operator, and a value for filtering. - // The value must be a string, a number, or a boolean. The comparison operator - // must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. - // Colon `:` is the contains operator. Filter rules are not case sensitive. - // - // The following fields in the [operation][google.longrunning.Operation] - // are eligible for filtering: - // - // * `name` - The name of the long-running operation - // * `done` - False if the operation is in progress, else true. - // * `metadata.@type` - the type of metadata. For example, the type string - // for - // [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata] - // is - // `type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata`. - // * `metadata.` - any field in metadata.value. - // `metadata.@type` must be specified first if filtering on metadata - // fields. - // * `error` - Error associated with the long-running operation. - // * `response.@type` - the type of response. - // * `response.` - any field in response.value. - // - // You can combine multiple expressions by enclosing each expression in - // parentheses. By default, expressions are combined with AND logic, but - // you can specify AND, OR, and NOT logic explicitly. - // - // Here are a few examples: - // - // * `done:true` - The operation is complete. - // * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \ - // `metadata.database:prod` - Returns operations where: - // * The operation's metadata type is - // [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. - // * The source database name of backup contains the string "prod". - // * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \ - // `(metadata.name:howl) AND` \ - // `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \ - // `(error:*)` - Returns operations where: - // * The operation's metadata type is - // [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. - // * The backup name contains the string "howl". - // * The operation started before 2018-03-28T14:50:00Z. - // * The operation resulted in an error. - // * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CopyBackupMetadata) AND` \ - // `(metadata.source_backup:test) AND` \ - // `(metadata.progress.start_time < \"2022-01-18T14:50:00Z\") AND` \ - // `(error:*)` - Returns operations where: - // * The operation's metadata type is - // [CopyBackupMetadata][google.spanner.admin.database.v1.CopyBackupMetadata]. - // * The source backup name contains the string "test". - // * The operation started before 2022-01-18T14:50:00Z. - // * The operation resulted in an error. - // * `((metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \ - // `(metadata.database:test_db)) OR` \ - // `((metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CopyBackupMetadata) - // AND` \ - // `(metadata.source_backup:test_bkp)) AND` \ - // `(error:*)` - Returns operations where: - // * The operation's metadata matches either of criteria: - // * The operation's metadata type is - // [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata] - // AND the source database name of the backup contains the string - // "test_db" - // * The operation's metadata type is - // [CopyBackupMetadata][google.spanner.admin.database.v1.CopyBackupMetadata] - // AND the source backup name contains the string "test_bkp" - // * The operation resulted in an error. - string filter = 2; - - // Number of operations to be returned in the response. If 0 or - // less, defaults to the server's maximum allowed page size. - int32 page_size = 3; - - // If non-empty, `page_token` should contain a - // [next_page_token][google.spanner.admin.database.v1.ListBackupOperationsResponse.next_page_token] - // from a previous - // [ListBackupOperationsResponse][google.spanner.admin.database.v1.ListBackupOperationsResponse] - // to the same `parent` and with the same `filter`. - string page_token = 4; -} - -// The response for -// [ListBackupOperations][google.spanner.admin.database.v1.DatabaseAdmin.ListBackupOperations]. -message ListBackupOperationsResponse { - // The list of matching backup [long-running - // operations][google.longrunning.Operation]. Each operation's name will be - // prefixed by the backup's name. The operation's - // [metadata][google.longrunning.Operation.metadata] field type - // `metadata.type_url` describes the type of the metadata. Operations returned - // include those that are pending or have completed/failed/canceled within the - // last 7 days. Operations returned are ordered by - // `operation.metadata.value.progress.start_time` in descending order starting - // from the most recently started operation. - repeated google.longrunning.Operation operations = 1; - - // `next_page_token` can be sent in a subsequent - // [ListBackupOperations][google.spanner.admin.database.v1.DatabaseAdmin.ListBackupOperations] - // call to fetch more of the matching metadata. - string next_page_token = 2; -} - -// Information about a backup. -message BackupInfo { - // Name of the backup. - string backup = 1 [ - (google.api.resource_reference) = { type: "spanner.googleapis.com/Backup" } - ]; - - // The backup contains an externally consistent copy of `source_database` at - // the timestamp specified by `version_time`. If the - // [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] - // request did not specify `version_time`, the `version_time` of the backup is - // equivalent to the `create_time`. - google.protobuf.Timestamp version_time = 4; - - // The time the - // [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] - // request was received. - google.protobuf.Timestamp create_time = 2; - - // Name of the database the backup was created from. - string source_database = 3 [(google.api.resource_reference) = { - type: "spanner.googleapis.com/Database" - }]; -} - -// Encryption configuration for the backup to create. -message CreateBackupEncryptionConfig { - // Encryption types for the backup. - enum EncryptionType { - // Unspecified. Do not use. - ENCRYPTION_TYPE_UNSPECIFIED = 0; - - // Use the same encryption configuration as the database. This is the - // default option when - // [encryption_config][google.spanner.admin.database.v1.CreateBackupEncryptionConfig] - // is empty. For example, if the database is using - // `Customer_Managed_Encryption`, the backup will be using the same Cloud - // KMS key as the database. - USE_DATABASE_ENCRYPTION = 1; - - // Use Google default encryption. - GOOGLE_DEFAULT_ENCRYPTION = 2; - - // Use customer managed encryption. If specified, `kms_key_name` - // must contain a valid Cloud KMS key. - CUSTOMER_MANAGED_ENCRYPTION = 3; - } - - // Required. The encryption type of the backup. - EncryptionType encryption_type = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. The Cloud KMS key that will be used to protect the backup. - // This field should be set only when - // [encryption_type][google.spanner.admin.database.v1.CreateBackupEncryptionConfig.encryption_type] - // is `CUSTOMER_MANAGED_ENCRYPTION`. Values are of the form - // `projects//locations//keyRings//cryptoKeys/`. - string kms_key_name = 2 [ - (google.api.field_behavior) = OPTIONAL, - (google.api.resource_reference) = { - type: "cloudkms.googleapis.com/CryptoKey" - } - ]; - - // Optional. Specifies the KMS configuration for the one or more keys used to - // protect the backup. Values are of the form - // `projects//locations//keyRings//cryptoKeys/`. - // - // The keys referenced by kms_key_names must fully cover all - // regions of the backup's instance configuration. Some examples: - // * For single region instance configs, specify a single regional - // location KMS key. - // * For multi-regional instance configs of type GOOGLE_MANAGED, - // either specify a multi-regional location KMS key or multiple regional - // location KMS keys that cover all regions in the instance config. - // * For an instance config of type USER_MANAGED, please specify only - // regional location KMS keys to cover each region in the instance config. - // Multi-regional location KMS keys are not supported for USER_MANAGED - // instance configs. - repeated string kms_key_names = 3 [ - (google.api.field_behavior) = OPTIONAL, - (google.api.resource_reference) = { - type: "cloudkms.googleapis.com/CryptoKey" - } - ]; -} - -// Encryption configuration for the copied backup. -message CopyBackupEncryptionConfig { - // Encryption types for the backup. - enum EncryptionType { - // Unspecified. Do not use. - ENCRYPTION_TYPE_UNSPECIFIED = 0; - - // This is the default option for - // [CopyBackup][google.spanner.admin.database.v1.DatabaseAdmin.CopyBackup] - // when - // [encryption_config][google.spanner.admin.database.v1.CopyBackupEncryptionConfig] - // is not specified. For example, if the source backup is using - // `Customer_Managed_Encryption`, the backup will be using the same Cloud - // KMS key as the source backup. - USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION = 1; - - // Use Google default encryption. - GOOGLE_DEFAULT_ENCRYPTION = 2; - - // Use customer managed encryption. If specified, either `kms_key_name` or - // `kms_key_names` must contain valid Cloud KMS key(s). - CUSTOMER_MANAGED_ENCRYPTION = 3; - } - - // Required. The encryption type of the backup. - EncryptionType encryption_type = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. The Cloud KMS key that will be used to protect the backup. - // This field should be set only when - // [encryption_type][google.spanner.admin.database.v1.CopyBackupEncryptionConfig.encryption_type] - // is `CUSTOMER_MANAGED_ENCRYPTION`. Values are of the form - // `projects//locations//keyRings//cryptoKeys/`. - string kms_key_name = 2 [ - (google.api.field_behavior) = OPTIONAL, - (google.api.resource_reference) = { - type: "cloudkms.googleapis.com/CryptoKey" - } - ]; - - // Optional. Specifies the KMS configuration for the one or more keys used to - // protect the backup. Values are of the form - // `projects//locations//keyRings//cryptoKeys/`. - // Kms keys specified can be in any order. - // - // The keys referenced by kms_key_names must fully cover all - // regions of the backup's instance configuration. Some examples: - // * For single region instance configs, specify a single regional - // location KMS key. - // * For multi-regional instance configs of type GOOGLE_MANAGED, - // either specify a multi-regional location KMS key or multiple regional - // location KMS keys that cover all regions in the instance config. - // * For an instance config of type USER_MANAGED, please specify only - // regional location KMS keys to cover each region in the instance config. - // Multi-regional location KMS keys are not supported for USER_MANAGED - // instance configs. - repeated string kms_key_names = 3 [ - (google.api.field_behavior) = OPTIONAL, - (google.api.resource_reference) = { - type: "cloudkms.googleapis.com/CryptoKey" - } - ]; -} - -// The specification for full backups. -// A full backup stores the entire contents of the database at a given -// version time. -message FullBackupSpec {} - -// The specification for incremental backup chains. -// An incremental backup stores the delta of changes between a previous -// backup and the database contents at a given version time. An -// incremental backup chain consists of a full backup and zero or more -// successive incremental backups. The first backup created for an -// incremental backup chain is always a full backup. -message IncrementalBackupSpec {} - -// Instance partition information for the backup. -message BackupInstancePartition { - // A unique identifier for the instance partition. Values are of the form - // `projects//instances//instancePartitions/` - string instance_partition = 1 [(google.api.resource_reference) = { - type: "spanner.googleapis.com/InstancePartition" - }]; -} diff --git a/owl-bot-staging/admin/database/v1/protos/google/spanner/admin/database/v1/backup_schedule.proto b/owl-bot-staging/admin/database/v1/protos/google/spanner/admin/database/v1/backup_schedule.proto deleted file mode 100644 index c273516ae..000000000 --- a/owl-bot-staging/admin/database/v1/protos/google/spanner/admin/database/v1/backup_schedule.proto +++ /dev/null @@ -1,230 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.spanner.admin.database.v1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/field_mask.proto"; -import "google/protobuf/timestamp.proto"; -import "google/spanner/admin/database/v1/backup.proto"; - -option csharp_namespace = "Google.Cloud.Spanner.Admin.Database.V1"; -option go_package = "cloud.google.com/go/spanner/admin/database/apiv1/databasepb;databasepb"; -option java_multiple_files = true; -option java_outer_classname = "BackupScheduleProto"; -option java_package = "com.google.spanner.admin.database.v1"; -option php_namespace = "Google\\Cloud\\Spanner\\Admin\\Database\\V1"; -option ruby_package = "Google::Cloud::Spanner::Admin::Database::V1"; - -// Defines specifications of the backup schedule. -message BackupScheduleSpec { - // Required. - oneof schedule_spec { - // Cron style schedule specification. - CrontabSpec cron_spec = 1; - } -} - -// BackupSchedule expresses the automated backup creation specification for a -// Spanner database. -// Next ID: 10 -message BackupSchedule { - option (google.api.resource) = { - type: "spanner.googleapis.com/BackupSchedule" - pattern: "projects/{project}/instances/{instance}/databases/{database}/backupSchedules/{schedule}" - plural: "backupSchedules" - singular: "backupSchedule" - }; - - // Identifier. Output only for the - // [CreateBackupSchedule][DatabaseAdmin.CreateBackupSchededule] operation. - // Required for the - // [UpdateBackupSchedule][google.spanner.admin.database.v1.DatabaseAdmin.UpdateBackupSchedule] - // operation. A globally unique identifier for the backup schedule which - // cannot be changed. Values are of the form - // `projects//instances//databases//backupSchedules/[a-z][a-z0-9_\-]*[a-z0-9]` - // The final segment of the name must be between 2 and 60 characters in - // length. - string name = 1 [(google.api.field_behavior) = IDENTIFIER]; - - // Optional. The schedule specification based on which the backup creations - // are triggered. - BackupScheduleSpec spec = 6 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The retention duration of a backup that must be at least 6 hours - // and at most 366 days. The backup is eligible to be automatically deleted - // once the retention period has elapsed. - google.protobuf.Duration retention_duration = 3 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The encryption configuration that will be used to encrypt the - // backup. If this field is not specified, the backup will use the same - // encryption configuration as the database. - CreateBackupEncryptionConfig encryption_config = 4 - [(google.api.field_behavior) = OPTIONAL]; - - // Required. Backup type spec determines the type of backup that is created by - // the backup schedule. Currently, only full backups are supported. - oneof backup_type_spec { - // The schedule creates only full backups. - FullBackupSpec full_backup_spec = 7; - - // The schedule creates incremental backup chains. - IncrementalBackupSpec incremental_backup_spec = 8; - } - - // Output only. The timestamp at which the schedule was last updated. - // If the schedule has never been updated, this field contains the timestamp - // when the schedule was first created. - google.protobuf.Timestamp update_time = 9 - [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// CrontabSpec can be used to specify the version time and frequency at -// which the backup should be created. -message CrontabSpec { - // Required. Textual representation of the crontab. User can customize the - // backup frequency and the backup version time using the cron - // expression. The version time must be in UTC timezone. - // - // The backup will contain an externally consistent copy of the - // database at the version time. Allowed frequencies are 12 hour, 1 day, - // 1 week and 1 month. Examples of valid cron specifications: - // * `0 2/12 * * * ` : every 12 hours at (2, 14) hours past midnight in UTC. - // * `0 2,14 * * * ` : every 12 hours at (2,14) hours past midnight in UTC. - // * `0 2 * * * ` : once a day at 2 past midnight in UTC. - // * `0 2 * * 0 ` : once a week every Sunday at 2 past midnight in UTC. - // * `0 2 8 * * ` : once a month on 8th day at 2 past midnight in UTC. - string text = 1 [(google.api.field_behavior) = REQUIRED]; - - // Output only. The time zone of the times in `CrontabSpec.text`. Currently - // only UTC is supported. - string time_zone = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Schedule backups will contain an externally consistent copy - // of the database at the version time specified in - // `schedule_spec.cron_spec`. However, Spanner may not initiate the creation - // of the scheduled backups at that version time. Spanner will initiate - // the creation of scheduled backups within the time window bounded by the - // version_time specified in `schedule_spec.cron_spec` and version_time + - // `creation_window`. - google.protobuf.Duration creation_window = 3 - [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// The request for -// [CreateBackupSchedule][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackupSchedule]. -message CreateBackupScheduleRequest { - // Required. The name of the database that this backup schedule applies to. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "spanner.googleapis.com/Database" - } - ]; - - // Required. The Id to use for the backup schedule. The `backup_schedule_id` - // appended to `parent` forms the full backup schedule name of the form - // `projects//instances//databases//backupSchedules/`. - string backup_schedule_id = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The backup schedule to create. - BackupSchedule backup_schedule = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// The request for -// [GetBackupSchedule][google.spanner.admin.database.v1.DatabaseAdmin.GetBackupSchedule]. -message GetBackupScheduleRequest { - // Required. The name of the schedule to retrieve. - // Values are of the form - // `projects//instances//databases//backupSchedules/`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "spanner.googleapis.com/BackupSchedule" - } - ]; -} - -// The request for -// [DeleteBackupSchedule][google.spanner.admin.database.v1.DatabaseAdmin.DeleteBackupSchedule]. -message DeleteBackupScheduleRequest { - // Required. The name of the schedule to delete. - // Values are of the form - // `projects//instances//databases//backupSchedules/`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "spanner.googleapis.com/BackupSchedule" - } - ]; -} - -// The request for -// [ListBackupSchedules][google.spanner.admin.database.v1.DatabaseAdmin.ListBackupSchedules]. -message ListBackupSchedulesRequest { - // Required. Database is the parent resource whose backup schedules should be - // listed. Values are of the form - // projects//instances//databases/ - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "spanner.googleapis.com/Database" - } - ]; - - // Optional. Number of backup schedules to be returned in the response. If 0 - // or less, defaults to the server's maximum allowed page size. - int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If non-empty, `page_token` should contain a - // [next_page_token][google.spanner.admin.database.v1.ListBackupSchedulesResponse.next_page_token] - // from a previous - // [ListBackupSchedulesResponse][google.spanner.admin.database.v1.ListBackupSchedulesResponse] - // to the same `parent`. - string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; -} - -// The response for -// [ListBackupSchedules][google.spanner.admin.database.v1.DatabaseAdmin.ListBackupSchedules]. -message ListBackupSchedulesResponse { - // The list of backup schedules for a database. - repeated BackupSchedule backup_schedules = 1; - - // `next_page_token` can be sent in a subsequent - // [ListBackupSchedules][google.spanner.admin.database.v1.DatabaseAdmin.ListBackupSchedules] - // call to fetch more of the schedules. - string next_page_token = 2; -} - -// The request for -// [UpdateBackupScheduleRequest][google.spanner.admin.database.v1.DatabaseAdmin.UpdateBackupSchedule]. -message UpdateBackupScheduleRequest { - // Required. The backup schedule to update. `backup_schedule.name`, and the - // fields to be updated as specified by `update_mask` are required. Other - // fields are ignored. - BackupSchedule backup_schedule = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. A mask specifying which fields in the BackupSchedule resource - // should be updated. This mask is relative to the BackupSchedule resource, - // not to the request message. The field mask must always be - // specified; this prevents any future fields from being erased - // accidentally. - google.protobuf.FieldMask update_mask = 2 - [(google.api.field_behavior) = REQUIRED]; -} diff --git a/owl-bot-staging/admin/database/v1/protos/google/spanner/admin/database/v1/common.proto b/owl-bot-staging/admin/database/v1/protos/google/spanner/admin/database/v1/common.proto deleted file mode 100644 index c494b8cf7..000000000 --- a/owl-bot-staging/admin/database/v1/protos/google/spanner/admin/database/v1/common.proto +++ /dev/null @@ -1,132 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.spanner.admin.database.v1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/protobuf/timestamp.proto"; -import "google/rpc/status.proto"; - -option csharp_namespace = "Google.Cloud.Spanner.Admin.Database.V1"; -option go_package = "cloud.google.com/go/spanner/admin/database/apiv1/databasepb;databasepb"; -option java_multiple_files = true; -option java_outer_classname = "CommonProto"; -option java_package = "com.google.spanner.admin.database.v1"; -option php_namespace = "Google\\Cloud\\Spanner\\Admin\\Database\\V1"; -option ruby_package = "Google::Cloud::Spanner::Admin::Database::V1"; -option (google.api.resource_definition) = { - type: "cloudkms.googleapis.com/CryptoKey" - pattern: "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}" -}; -option (google.api.resource_definition) = { - type: "cloudkms.googleapis.com/CryptoKeyVersion" - pattern: "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}" -}; - -// Encapsulates progress related information for a Cloud Spanner long -// running operation. -message OperationProgress { - // Percent completion of the operation. - // Values are between 0 and 100 inclusive. - int32 progress_percent = 1; - - // Time the request was received. - google.protobuf.Timestamp start_time = 2; - - // If set, the time at which this operation failed or was completed - // successfully. - google.protobuf.Timestamp end_time = 3; -} - -// Encryption configuration for a Cloud Spanner database. -message EncryptionConfig { - // The Cloud KMS key to be used for encrypting and decrypting - // the database. Values are of the form - // `projects//locations//keyRings//cryptoKeys/`. - string kms_key_name = 2 [(google.api.resource_reference) = { - type: "cloudkms.googleapis.com/CryptoKey" - }]; - - // Specifies the KMS configuration for the one or more keys used to encrypt - // the database. Values are of the form - // `projects//locations//keyRings//cryptoKeys/`. - // - // The keys referenced by kms_key_names must fully cover all - // regions of the database instance configuration. Some examples: - // * For single region database instance configs, specify a single regional - // location KMS key. - // * For multi-regional database instance configs of type GOOGLE_MANAGED, - // either specify a multi-regional location KMS key or multiple regional - // location KMS keys that cover all regions in the instance config. - // * For a database instance config of type USER_MANAGED, please specify only - // regional location KMS keys to cover each region in the instance config. - // Multi-regional location KMS keys are not supported for USER_MANAGED - // instance configs. - repeated string kms_key_names = 3 [(google.api.resource_reference) = { - type: "cloudkms.googleapis.com/CryptoKey" - }]; -} - -// Encryption information for a Cloud Spanner database or backup. -message EncryptionInfo { - // Possible encryption types. - enum Type { - // Encryption type was not specified, though data at rest remains encrypted. - TYPE_UNSPECIFIED = 0; - - // The data is encrypted at rest with a key that is - // fully managed by Google. No key version or status will be populated. - // This is the default state. - GOOGLE_DEFAULT_ENCRYPTION = 1; - - // The data is encrypted at rest with a key that is - // managed by the customer. The active version of the key. `kms_key_version` - // will be populated, and `encryption_status` may be populated. - CUSTOMER_MANAGED_ENCRYPTION = 2; - } - - // Output only. The type of encryption. - Type encryption_type = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. If present, the status of a recent encrypt/decrypt call on - // underlying data for this database or backup. Regardless of status, data is - // always encrypted at rest. - google.rpc.Status encryption_status = 4 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. A Cloud KMS key version that is being used to protect the - // database or backup. - string kms_key_version = 2 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.resource_reference) = { - type: "cloudkms.googleapis.com/CryptoKeyVersion" - } - ]; -} - -// Indicates the dialect type of a database. -enum DatabaseDialect { - // Default value. This value will create a database with the - // GOOGLE_STANDARD_SQL dialect. - DATABASE_DIALECT_UNSPECIFIED = 0; - - // GoogleSQL supported SQL. - GOOGLE_STANDARD_SQL = 1; - - // PostgreSQL supported SQL. - POSTGRESQL = 2; -} diff --git a/owl-bot-staging/admin/database/v1/protos/google/spanner/admin/database/v1/spanner_database_admin.proto b/owl-bot-staging/admin/database/v1/protos/google/spanner/admin/database/v1/spanner_database_admin.proto deleted file mode 100644 index d41a4114c..000000000 --- a/owl-bot-staging/admin/database/v1/protos/google/spanner/admin/database/v1/spanner_database_admin.proto +++ /dev/null @@ -1,1314 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.spanner.admin.database.v1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/iam/v1/iam_policy.proto"; -import "google/iam/v1/policy.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/empty.proto"; -import "google/protobuf/field_mask.proto"; -import "google/protobuf/struct.proto"; -import "google/protobuf/timestamp.proto"; -import "google/rpc/status.proto"; -import "google/spanner/admin/database/v1/backup.proto"; -import "google/spanner/admin/database/v1/backup_schedule.proto"; -import "google/spanner/admin/database/v1/common.proto"; - -option csharp_namespace = "Google.Cloud.Spanner.Admin.Database.V1"; -option go_package = "cloud.google.com/go/spanner/admin/database/apiv1/databasepb;databasepb"; -option java_multiple_files = true; -option java_outer_classname = "SpannerDatabaseAdminProto"; -option java_package = "com.google.spanner.admin.database.v1"; -option php_namespace = "Google\\Cloud\\Spanner\\Admin\\Database\\V1"; -option ruby_package = "Google::Cloud::Spanner::Admin::Database::V1"; -option (google.api.resource_definition) = { - type: "spanner.googleapis.com/Instance" - pattern: "projects/{project}/instances/{instance}" -}; -option (google.api.resource_definition) = { - type: "spanner.googleapis.com/InstancePartition" - pattern: "projects/{project}/instances/{instance}/instancePartitions/{instance_partition}" -}; - -// Cloud Spanner Database Admin API -// -// The Cloud Spanner Database Admin API can be used to: -// * create, drop, and list databases -// * update the schema of pre-existing databases -// * create, delete, copy and list backups for a database -// * restore a database from an existing backup -service DatabaseAdmin { - option (google.api.default_host) = "spanner.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform," - "https://www.googleapis.com/auth/spanner.admin"; - - // Lists Cloud Spanner databases. - rpc ListDatabases(ListDatabasesRequest) returns (ListDatabasesResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/instances/*}/databases" - }; - option (google.api.method_signature) = "parent"; - } - - // Creates a new Cloud Spanner database and starts to prepare it for serving. - // The returned [long-running operation][google.longrunning.Operation] will - // have a name of the format `/operations/` and - // can be used to track preparation of the database. The - // [metadata][google.longrunning.Operation.metadata] field type is - // [CreateDatabaseMetadata][google.spanner.admin.database.v1.CreateDatabaseMetadata]. - // The [response][google.longrunning.Operation.response] field type is - // [Database][google.spanner.admin.database.v1.Database], if successful. - rpc CreateDatabase(CreateDatabaseRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/instances/*}/databases" - body: "*" - }; - option (google.api.method_signature) = "parent,create_statement"; - option (google.longrunning.operation_info) = { - response_type: "google.spanner.admin.database.v1.Database" - metadata_type: "google.spanner.admin.database.v1.CreateDatabaseMetadata" - }; - } - - // Gets the state of a Cloud Spanner database. - rpc GetDatabase(GetDatabaseRequest) returns (Database) { - option (google.api.http) = { - get: "/v1/{name=projects/*/instances/*/databases/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Updates a Cloud Spanner database. The returned - // [long-running operation][google.longrunning.Operation] can be used to track - // the progress of updating the database. If the named database does not - // exist, returns `NOT_FOUND`. - // - // While the operation is pending: - // - // * The database's - // [reconciling][google.spanner.admin.database.v1.Database.reconciling] - // field is set to true. - // * Cancelling the operation is best-effort. If the cancellation succeeds, - // the operation metadata's - // [cancel_time][google.spanner.admin.database.v1.UpdateDatabaseMetadata.cancel_time] - // is set, the updates are reverted, and the operation terminates with a - // `CANCELLED` status. - // * New UpdateDatabase requests will return a `FAILED_PRECONDITION` error - // until the pending operation is done (returns successfully or with - // error). - // * Reading the database via the API continues to give the pre-request - // values. - // - // Upon completion of the returned operation: - // - // * The new values are in effect and readable via the API. - // * The database's - // [reconciling][google.spanner.admin.database.v1.Database.reconciling] - // field becomes false. - // - // The returned [long-running operation][google.longrunning.Operation] will - // have a name of the format - // `projects//instances//databases//operations/` - // and can be used to track the database modification. The - // [metadata][google.longrunning.Operation.metadata] field type is - // [UpdateDatabaseMetadata][google.spanner.admin.database.v1.UpdateDatabaseMetadata]. - // The [response][google.longrunning.Operation.response] field type is - // [Database][google.spanner.admin.database.v1.Database], if successful. - rpc UpdateDatabase(UpdateDatabaseRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - patch: "/v1/{database.name=projects/*/instances/*/databases/*}" - body: "database" - }; - option (google.api.method_signature) = "database,update_mask"; - option (google.longrunning.operation_info) = { - response_type: "Database" - metadata_type: "UpdateDatabaseMetadata" - }; - } - - // Updates the schema of a Cloud Spanner database by - // creating/altering/dropping tables, columns, indexes, etc. The returned - // [long-running operation][google.longrunning.Operation] will have a name of - // the format `/operations/` and can be used to - // track execution of the schema change(s). The - // [metadata][google.longrunning.Operation.metadata] field type is - // [UpdateDatabaseDdlMetadata][google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata]. - // The operation has no response. - rpc UpdateDatabaseDdl(UpdateDatabaseDdlRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - patch: "/v1/{database=projects/*/instances/*/databases/*}/ddl" - body: "*" - }; - option (google.api.method_signature) = "database,statements"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata" - }; - } - - // Drops (aka deletes) a Cloud Spanner database. - // Completed backups for the database will be retained according to their - // `expire_time`. - // Note: Cloud Spanner might continue to accept requests for a few seconds - // after the database has been deleted. - rpc DropDatabase(DropDatabaseRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1/{database=projects/*/instances/*/databases/*}" - }; - option (google.api.method_signature) = "database"; - } - - // Returns the schema of a Cloud Spanner database as a list of formatted - // DDL statements. This method does not show pending schema updates, those may - // be queried using the [Operations][google.longrunning.Operations] API. - rpc GetDatabaseDdl(GetDatabaseDdlRequest) returns (GetDatabaseDdlResponse) { - option (google.api.http) = { - get: "/v1/{database=projects/*/instances/*/databases/*}/ddl" - }; - option (google.api.method_signature) = "database"; - } - - // Sets the access control policy on a database or backup resource. - // Replaces any existing policy. - // - // Authorization requires `spanner.databases.setIamPolicy` - // permission on [resource][google.iam.v1.SetIamPolicyRequest.resource]. - // For backups, authorization requires `spanner.backups.setIamPolicy` - // permission on [resource][google.iam.v1.SetIamPolicyRequest.resource]. - rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) - returns (google.iam.v1.Policy) { - option (google.api.http) = { - post: "/v1/{resource=projects/*/instances/*/databases/*}:setIamPolicy" - body: "*" - additional_bindings { - post: "/v1/{resource=projects/*/instances/*/backups/*}:setIamPolicy" - body: "*" - } - additional_bindings { - post: "/v1/{resource=projects/*/instances/*/databases/*/backupSchedules/*}:setIamPolicy" - body: "*" - } - }; - option (google.api.method_signature) = "resource,policy"; - } - - // Gets the access control policy for a database or backup resource. - // Returns an empty policy if a database or backup exists but does not have a - // policy set. - // - // Authorization requires `spanner.databases.getIamPolicy` permission on - // [resource][google.iam.v1.GetIamPolicyRequest.resource]. - // For backups, authorization requires `spanner.backups.getIamPolicy` - // permission on [resource][google.iam.v1.GetIamPolicyRequest.resource]. - rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) - returns (google.iam.v1.Policy) { - option (google.api.http) = { - post: "/v1/{resource=projects/*/instances/*/databases/*}:getIamPolicy" - body: "*" - additional_bindings { - post: "/v1/{resource=projects/*/instances/*/backups/*}:getIamPolicy" - body: "*" - } - additional_bindings { - post: "/v1/{resource=projects/*/instances/*/databases/*/backupSchedules/*}:getIamPolicy" - body: "*" - } - }; - option (google.api.method_signature) = "resource"; - } - - // Returns permissions that the caller has on the specified database or backup - // resource. - // - // Attempting this RPC on a non-existent Cloud Spanner database will - // result in a NOT_FOUND error if the user has - // `spanner.databases.list` permission on the containing Cloud - // Spanner instance. Otherwise returns an empty set of permissions. - // Calling this method on a backup that does not exist will - // result in a NOT_FOUND error if the user has - // `spanner.backups.list` permission on the containing instance. - rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) - returns (google.iam.v1.TestIamPermissionsResponse) { - option (google.api.http) = { - post: "/v1/{resource=projects/*/instances/*/databases/*}:testIamPermissions" - body: "*" - additional_bindings { - post: "/v1/{resource=projects/*/instances/*/backups/*}:testIamPermissions" - body: "*" - } - additional_bindings { - post: "/v1/{resource=projects/*/instances/*/databases/*/backupSchedules/*}:testIamPermissions" - body: "*" - } - additional_bindings { - post: "/v1/{resource=projects/*/instances/*/databases/*/databaseRoles/*}:testIamPermissions" - body: "*" - } - }; - option (google.api.method_signature) = "resource,permissions"; - } - - // Starts creating a new Cloud Spanner Backup. - // The returned backup [long-running operation][google.longrunning.Operation] - // will have a name of the format - // `projects//instances//backups//operations/` - // and can be used to track creation of the backup. The - // [metadata][google.longrunning.Operation.metadata] field type is - // [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. - // The [response][google.longrunning.Operation.response] field type is - // [Backup][google.spanner.admin.database.v1.Backup], if successful. - // Cancelling the returned operation will stop the creation and delete the - // backup. There can be only one pending backup creation per database. Backup - // creation of different databases can run concurrently. - rpc CreateBackup(CreateBackupRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/instances/*}/backups" - body: "backup" - }; - option (google.api.method_signature) = "parent,backup,backup_id"; - option (google.longrunning.operation_info) = { - response_type: "google.spanner.admin.database.v1.Backup" - metadata_type: "google.spanner.admin.database.v1.CreateBackupMetadata" - }; - } - - // Starts copying a Cloud Spanner Backup. - // The returned backup [long-running operation][google.longrunning.Operation] - // will have a name of the format - // `projects//instances//backups//operations/` - // and can be used to track copying of the backup. The operation is associated - // with the destination backup. - // The [metadata][google.longrunning.Operation.metadata] field type is - // [CopyBackupMetadata][google.spanner.admin.database.v1.CopyBackupMetadata]. - // The [response][google.longrunning.Operation.response] field type is - // [Backup][google.spanner.admin.database.v1.Backup], if successful. - // Cancelling the returned operation will stop the copying and delete the - // destination backup. Concurrent CopyBackup requests can run on the same - // source backup. - rpc CopyBackup(CopyBackupRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/instances/*}/backups:copy" - body: "*" - }; - option (google.api.method_signature) = - "parent,backup_id,source_backup,expire_time"; - option (google.longrunning.operation_info) = { - response_type: "google.spanner.admin.database.v1.Backup" - metadata_type: "google.spanner.admin.database.v1.CopyBackupMetadata" - }; - } - - // Gets metadata on a pending or completed - // [Backup][google.spanner.admin.database.v1.Backup]. - rpc GetBackup(GetBackupRequest) returns (Backup) { - option (google.api.http) = { - get: "/v1/{name=projects/*/instances/*/backups/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Updates a pending or completed - // [Backup][google.spanner.admin.database.v1.Backup]. - rpc UpdateBackup(UpdateBackupRequest) returns (Backup) { - option (google.api.http) = { - patch: "/v1/{backup.name=projects/*/instances/*/backups/*}" - body: "backup" - }; - option (google.api.method_signature) = "backup,update_mask"; - } - - // Deletes a pending or completed - // [Backup][google.spanner.admin.database.v1.Backup]. - rpc DeleteBackup(DeleteBackupRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/instances/*/backups/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists completed and pending backups. - // Backups returned are ordered by `create_time` in descending order, - // starting from the most recent `create_time`. - rpc ListBackups(ListBackupsRequest) returns (ListBackupsResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/instances/*}/backups" - }; - option (google.api.method_signature) = "parent"; - } - - // Create a new database by restoring from a completed backup. The new - // database must be in the same project and in an instance with the same - // instance configuration as the instance containing - // the backup. The returned database [long-running - // operation][google.longrunning.Operation] has a name of the format - // `projects//instances//databases//operations/`, - // and can be used to track the progress of the operation, and to cancel it. - // The [metadata][google.longrunning.Operation.metadata] field type is - // [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata]. - // The [response][google.longrunning.Operation.response] type - // is [Database][google.spanner.admin.database.v1.Database], if - // successful. Cancelling the returned operation will stop the restore and - // delete the database. - // There can be only one database being restored into an instance at a time. - // Once the restore operation completes, a new restore operation can be - // initiated, without waiting for the optimize operation associated with the - // first restore to complete. - rpc RestoreDatabase(RestoreDatabaseRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/instances/*}/databases:restore" - body: "*" - }; - option (google.api.method_signature) = "parent,database_id,backup"; - option (google.longrunning.operation_info) = { - response_type: "google.spanner.admin.database.v1.Database" - metadata_type: "google.spanner.admin.database.v1.RestoreDatabaseMetadata" - }; - } - - // Lists database [longrunning-operations][google.longrunning.Operation]. - // A database operation has a name of the form - // `projects//instances//databases//operations/`. - // The long-running operation - // [metadata][google.longrunning.Operation.metadata] field type - // `metadata.type_url` describes the type of the metadata. Operations returned - // include those that have completed/failed/canceled within the last 7 days, - // and pending operations. - rpc ListDatabaseOperations(ListDatabaseOperationsRequest) - returns (ListDatabaseOperationsResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/instances/*}/databaseOperations" - }; - option (google.api.method_signature) = "parent"; - } - - // Lists the backup [long-running operations][google.longrunning.Operation] in - // the given instance. A backup operation has a name of the form - // `projects//instances//backups//operations/`. - // The long-running operation - // [metadata][google.longrunning.Operation.metadata] field type - // `metadata.type_url` describes the type of the metadata. Operations returned - // include those that have completed/failed/canceled within the last 7 days, - // and pending operations. Operations returned are ordered by - // `operation.metadata.value.progress.start_time` in descending order starting - // from the most recently started operation. - rpc ListBackupOperations(ListBackupOperationsRequest) - returns (ListBackupOperationsResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/instances/*}/backupOperations" - }; - option (google.api.method_signature) = "parent"; - } - - // Lists Cloud Spanner database roles. - rpc ListDatabaseRoles(ListDatabaseRolesRequest) - returns (ListDatabaseRolesResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/instances/*/databases/*}/databaseRoles" - }; - option (google.api.method_signature) = "parent"; - } - - // Adds split points to specified tables, indexes of a database. - rpc AddSplitPoints(AddSplitPointsRequest) returns (AddSplitPointsResponse) { - option (google.api.http) = { - post: "/v1/{database=projects/*/instances/*/databases/*}:addSplitPoints" - body: "*" - }; - option (google.api.method_signature) = "database,split_points"; - } - - // Creates a new backup schedule. - rpc CreateBackupSchedule(CreateBackupScheduleRequest) - returns (BackupSchedule) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/instances/*/databases/*}/backupSchedules" - body: "backup_schedule" - }; - option (google.api.method_signature) = - "parent,backup_schedule,backup_schedule_id"; - } - - // Gets backup schedule for the input schedule name. - rpc GetBackupSchedule(GetBackupScheduleRequest) returns (BackupSchedule) { - option (google.api.http) = { - get: "/v1/{name=projects/*/instances/*/databases/*/backupSchedules/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Updates a backup schedule. - rpc UpdateBackupSchedule(UpdateBackupScheduleRequest) - returns (BackupSchedule) { - option (google.api.http) = { - patch: "/v1/{backup_schedule.name=projects/*/instances/*/databases/*/backupSchedules/*}" - body: "backup_schedule" - }; - option (google.api.method_signature) = "backup_schedule,update_mask"; - } - - // Deletes a backup schedule. - rpc DeleteBackupSchedule(DeleteBackupScheduleRequest) - returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/instances/*/databases/*/backupSchedules/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists all the backup schedules for the database. - rpc ListBackupSchedules(ListBackupSchedulesRequest) - returns (ListBackupSchedulesResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/instances/*/databases/*}/backupSchedules" - }; - option (google.api.method_signature) = "parent"; - } - - // This is an internal API called by Spanner Graph jobs. You should never need - // to call this API directly. - rpc InternalUpdateGraphOperation(InternalUpdateGraphOperationRequest) - returns (InternalUpdateGraphOperationResponse) { - option (google.api.method_signature) = "database,operation_id"; - } -} - -// Information about the database restore. -message RestoreInfo { - // The type of the restore source. - RestoreSourceType source_type = 1; - - // Information about the source used to restore the database. - oneof source_info { - // Information about the backup used to restore the database. The backup - // may no longer exist. - BackupInfo backup_info = 2; - } -} - -// A Cloud Spanner database. -message Database { - option (google.api.resource) = { - type: "spanner.googleapis.com/Database" - pattern: "projects/{project}/instances/{instance}/databases/{database}" - }; - - // Indicates the current state of the database. - enum State { - // Not specified. - STATE_UNSPECIFIED = 0; - - // The database is still being created. Operations on the database may fail - // with `FAILED_PRECONDITION` in this state. - CREATING = 1; - - // The database is fully created and ready for use. - READY = 2; - - // The database is fully created and ready for use, but is still - // being optimized for performance and cannot handle full load. - // - // In this state, the database still references the backup - // it was restore from, preventing the backup - // from being deleted. When optimizations are complete, the full performance - // of the database will be restored, and the database will transition to - // `READY` state. - READY_OPTIMIZING = 3; - } - - // Required. The name of the database. Values are of the form - // `projects//instances//databases/`, - // where `` is as specified in the `CREATE DATABASE` - // statement. This name can be passed to other API methods to - // identify the database. - string name = 1 [(google.api.field_behavior) = REQUIRED]; - - // Output only. The current database state. - State state = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. If exists, the time at which the database creation started. - google.protobuf.Timestamp create_time = 3 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Applicable only for restored databases. Contains information - // about the restore source. - RestoreInfo restore_info = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. For databases that are using customer managed encryption, this - // field contains the encryption configuration for the database. - // For databases that are using Google default or other types of encryption, - // this field is empty. - EncryptionConfig encryption_config = 5 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. For databases that are using customer managed encryption, this - // field contains the encryption information for the database, such as - // all Cloud KMS key versions that are in use. The `encryption_status' field - // inside of each `EncryptionInfo` is not populated. - // - // For databases that are using Google default or other types of encryption, - // this field is empty. - // - // This field is propagated lazily from the backend. There might be a delay - // from when a key version is being used and when it appears in this field. - repeated EncryptionInfo encryption_info = 8 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The period in which Cloud Spanner retains all versions of data - // for the database. This is the same as the value of version_retention_period - // database option set using - // [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl]. - // Defaults to 1 hour, if not set. - string version_retention_period = 6 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Earliest timestamp at which older versions of the data can be - // read. This value is continuously updated by Cloud Spanner and becomes stale - // the moment it is queried. If you are using this value to recover data, make - // sure to account for the time from the moment when the value is queried to - // the moment when you initiate the recovery. - google.protobuf.Timestamp earliest_version_time = 7 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The read-write region which contains the database's leader - // replicas. - // - // This is the same as the value of default_leader - // database option set using DatabaseAdmin.CreateDatabase or - // DatabaseAdmin.UpdateDatabaseDdl. If not explicitly set, this is empty. - string default_leader = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The dialect of the Cloud Spanner Database. - DatabaseDialect database_dialect = 10 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Whether drop protection is enabled for this database. Defaults to false, - // if not set. For more details, please see how to [prevent accidental - // database - // deletion](https://cloud.google.com/spanner/docs/prevent-database-deletion). - bool enable_drop_protection = 11; - - // Output only. If true, the database is being updated. If false, there are no - // ongoing update operations for the database. - bool reconciling = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// The request for -// [ListDatabases][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabases]. -message ListDatabasesRequest { - // Required. The instance whose databases should be listed. - // Values are of the form `projects//instances/`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "spanner.googleapis.com/Instance" - } - ]; - - // Number of databases to be returned in the response. If 0 or less, - // defaults to the server's maximum allowed page size. - int32 page_size = 3; - - // If non-empty, `page_token` should contain a - // [next_page_token][google.spanner.admin.database.v1.ListDatabasesResponse.next_page_token] - // from a previous - // [ListDatabasesResponse][google.spanner.admin.database.v1.ListDatabasesResponse]. - string page_token = 4; -} - -// The response for -// [ListDatabases][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabases]. -message ListDatabasesResponse { - // Databases that matched the request. - repeated Database databases = 1; - - // `next_page_token` can be sent in a subsequent - // [ListDatabases][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabases] - // call to fetch more of the matching databases. - string next_page_token = 2; -} - -// The request for -// [CreateDatabase][google.spanner.admin.database.v1.DatabaseAdmin.CreateDatabase]. -message CreateDatabaseRequest { - // Required. The name of the instance that will serve the new database. - // Values are of the form `projects//instances/`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "spanner.googleapis.com/Instance" - } - ]; - - // Required. A `CREATE DATABASE` statement, which specifies the ID of the - // new database. The database ID must conform to the regular expression - // `[a-z][a-z0-9_\-]*[a-z0-9]` and be between 2 and 30 characters in length. - // If the database ID is a reserved word or if it contains a hyphen, the - // database ID must be enclosed in backticks (`` ` ``). - string create_statement = 2 [(google.api.field_behavior) = REQUIRED]; - - // Optional. A list of DDL statements to run inside the newly created - // database. Statements can create tables, indexes, etc. These - // statements execute atomically with the creation of the database: - // if there is an error in any statement, the database is not created. - repeated string extra_statements = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The encryption configuration for the database. If this field is - // not specified, Cloud Spanner will encrypt/decrypt all data at rest using - // Google default encryption. - EncryptionConfig encryption_config = 4 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The dialect of the Cloud Spanner Database. - DatabaseDialect database_dialect = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Proto descriptors used by CREATE/ALTER PROTO BUNDLE statements in - // 'extra_statements' above. - // Contains a protobuf-serialized - // [google.protobuf.FileDescriptorSet](https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/descriptor.proto). - // To generate it, [install](https://grpc.io/docs/protoc-installation/) and - // run `protoc` with --include_imports and --descriptor_set_out. For example, - // to generate for moon/shot/app.proto, run - // ``` - // $protoc --proto_path=/app_path --proto_path=/lib_path \ - // --include_imports \ - // --descriptor_set_out=descriptors.data \ - // moon/shot/app.proto - // ``` - // For more details, see protobuffer [self - // description](https://developers.google.com/protocol-buffers/docs/techniques#self-description). - bytes proto_descriptors = 6 [(google.api.field_behavior) = OPTIONAL]; -} - -// Metadata type for the operation returned by -// [CreateDatabase][google.spanner.admin.database.v1.DatabaseAdmin.CreateDatabase]. -message CreateDatabaseMetadata { - // The database being created. - string database = 1 [(google.api.resource_reference) = { - type: "spanner.googleapis.com/Database" - }]; -} - -// The request for -// [GetDatabase][google.spanner.admin.database.v1.DatabaseAdmin.GetDatabase]. -message GetDatabaseRequest { - // Required. The name of the requested database. Values are of the form - // `projects//instances//databases/`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "spanner.googleapis.com/Database" - } - ]; -} - -// The request for -// [UpdateDatabase][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabase]. -message UpdateDatabaseRequest { - // Required. The database to update. - // The `name` field of the database is of the form - // `projects//instances//databases/`. - Database database = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The list of fields to update. Currently, only - // `enable_drop_protection` field can be updated. - google.protobuf.FieldMask update_mask = 2 - [(google.api.field_behavior) = REQUIRED]; -} - -// Metadata type for the operation returned by -// [UpdateDatabase][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabase]. -message UpdateDatabaseMetadata { - // The request for - // [UpdateDatabase][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabase]. - UpdateDatabaseRequest request = 1; - - // The progress of the - // [UpdateDatabase][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabase] - // operation. - OperationProgress progress = 2; - - // The time at which this operation was cancelled. If set, this operation is - // in the process of undoing itself (which is best-effort). - google.protobuf.Timestamp cancel_time = 3; -} - -// Enqueues the given DDL statements to be applied, in order but not -// necessarily all at once, to the database schema at some point (or -// points) in the future. The server checks that the statements -// are executable (syntactically valid, name tables that exist, etc.) -// before enqueueing them, but they may still fail upon -// later execution (e.g., if a statement from another batch of -// statements is applied first and it conflicts in some way, or if -// there is some data-related problem like a `NULL` value in a column to -// which `NOT NULL` would be added). If a statement fails, all -// subsequent statements in the batch are automatically cancelled. -// -// Each batch of statements is assigned a name which can be used with -// the [Operations][google.longrunning.Operations] API to monitor -// progress. See the -// [operation_id][google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.operation_id] -// field for more details. -message UpdateDatabaseDdlRequest { - // Required. The database to update. - string database = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "spanner.googleapis.com/Database" - } - ]; - - // Required. DDL statements to be applied to the database. - repeated string statements = 2 [(google.api.field_behavior) = REQUIRED]; - - // If empty, the new update request is assigned an - // automatically-generated operation ID. Otherwise, `operation_id` - // is used to construct the name of the resulting - // [Operation][google.longrunning.Operation]. - // - // Specifying an explicit operation ID simplifies determining - // whether the statements were executed in the event that the - // [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl] - // call is replayed, or the return value is otherwise lost: the - // [database][google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.database] - // and `operation_id` fields can be combined to form the - // [name][google.longrunning.Operation.name] of the resulting - // [longrunning.Operation][google.longrunning.Operation]: - // `/operations/`. - // - // `operation_id` should be unique within the database, and must be - // a valid identifier: `[a-z][a-z0-9_]*`. Note that - // automatically-generated operation IDs always begin with an - // underscore. If the named operation already exists, - // [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl] - // returns `ALREADY_EXISTS`. - string operation_id = 3; - - // Optional. Proto descriptors used by CREATE/ALTER PROTO BUNDLE statements. - // Contains a protobuf-serialized - // [google.protobuf.FileDescriptorSet](https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/descriptor.proto). - // To generate it, [install](https://grpc.io/docs/protoc-installation/) and - // run `protoc` with --include_imports and --descriptor_set_out. For example, - // to generate for moon/shot/app.proto, run - // ``` - // $protoc --proto_path=/app_path --proto_path=/lib_path \ - // --include_imports \ - // --descriptor_set_out=descriptors.data \ - // moon/shot/app.proto - // ``` - // For more details, see protobuffer [self - // description](https://developers.google.com/protocol-buffers/docs/techniques#self-description). - bytes proto_descriptors = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. This field is exposed to be used by the Spanner Migration Tool. - // For more details, see - // [SMT](https://github.com/GoogleCloudPlatform/spanner-migration-tool). - bool throughput_mode = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// Action information extracted from a DDL statement. This proto is used to -// display the brief info of the DDL statement for the operation -// [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl]. -message DdlStatementActionInfo { - // The action for the DDL statement, e.g. CREATE, ALTER, DROP, GRANT, etc. - // This field is a non-empty string. - string action = 1; - - // The entity type for the DDL statement, e.g. TABLE, INDEX, VIEW, etc. - // This field can be empty string for some DDL statement, - // e.g. for statement "ANALYZE", `entity_type` = "". - string entity_type = 2; - - // The entity name(s) being operated on the DDL statement. - // E.g. - // 1. For statement "CREATE TABLE t1(...)", `entity_names` = ["t1"]. - // 2. For statement "GRANT ROLE r1, r2 ...", `entity_names` = ["r1", "r2"]. - // 3. For statement "ANALYZE", `entity_names` = []. - repeated string entity_names = 3; -} - -// Metadata type for the operation returned by -// [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl]. -message UpdateDatabaseDdlMetadata { - // The database being modified. - string database = 1 [(google.api.resource_reference) = { - type: "spanner.googleapis.com/Database" - }]; - - // For an update this list contains all the statements. For an - // individual statement, this list contains only that statement. - repeated string statements = 2; - - // Reports the commit timestamps of all statements that have - // succeeded so far, where `commit_timestamps[i]` is the commit - // timestamp for the statement `statements[i]`. - repeated google.protobuf.Timestamp commit_timestamps = 3; - - // Output only. When true, indicates that the operation is throttled e.g. - // due to resource constraints. When resources become available the operation - // will resume and this field will be false again. - bool throttled = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The progress of the - // [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl] - // operations. All DDL statements will have continuously updating progress, - // and `progress[i]` is the operation progress for `statements[i]`. Also, - // `progress[i]` will have start time and end time populated with commit - // timestamp of operation, as well as a progress of 100% once the operation - // has completed. - repeated OperationProgress progress = 5; - - // The brief action info for the DDL statements. - // `actions[i]` is the brief info for `statements[i]`. - repeated DdlStatementActionInfo actions = 6; -} - -// The request for -// [DropDatabase][google.spanner.admin.database.v1.DatabaseAdmin.DropDatabase]. -message DropDatabaseRequest { - // Required. The database to be dropped. - string database = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "spanner.googleapis.com/Database" - } - ]; -} - -// The request for -// [GetDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.GetDatabaseDdl]. -message GetDatabaseDdlRequest { - // Required. The database whose schema we wish to get. - // Values are of the form - // `projects//instances//databases/` - string database = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "spanner.googleapis.com/Database" - } - ]; -} - -// The response for -// [GetDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.GetDatabaseDdl]. -message GetDatabaseDdlResponse { - // A list of formatted DDL statements defining the schema of the database - // specified in the request. - repeated string statements = 1; - - // Proto descriptors stored in the database. - // Contains a protobuf-serialized - // [google.protobuf.FileDescriptorSet](https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/descriptor.proto). - // For more details, see protobuffer [self - // description](https://developers.google.com/protocol-buffers/docs/techniques#self-description). - bytes proto_descriptors = 2; -} - -// The request for -// [ListDatabaseOperations][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabaseOperations]. -message ListDatabaseOperationsRequest { - // Required. The instance of the database operations. - // Values are of the form `projects//instances/`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "spanner.googleapis.com/Instance" - } - ]; - - // An expression that filters the list of returned operations. - // - // A filter expression consists of a field name, a - // comparison operator, and a value for filtering. - // The value must be a string, a number, or a boolean. The comparison operator - // must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. - // Colon `:` is the contains operator. Filter rules are not case sensitive. - // - // The following fields in the [Operation][google.longrunning.Operation] - // are eligible for filtering: - // - // * `name` - The name of the long-running operation - // * `done` - False if the operation is in progress, else true. - // * `metadata.@type` - the type of metadata. For example, the type string - // for - // [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata] - // is - // `type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata`. - // * `metadata.` - any field in metadata.value. - // `metadata.@type` must be specified first, if filtering on metadata - // fields. - // * `error` - Error associated with the long-running operation. - // * `response.@type` - the type of response. - // * `response.` - any field in response.value. - // - // You can combine multiple expressions by enclosing each expression in - // parentheses. By default, expressions are combined with AND logic. However, - // you can specify AND, OR, and NOT logic explicitly. - // - // Here are a few examples: - // - // * `done:true` - The operation is complete. - // * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata) AND` \ - // `(metadata.source_type:BACKUP) AND` \ - // `(metadata.backup_info.backup:backup_howl) AND` \ - // `(metadata.name:restored_howl) AND` \ - // `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \ - // `(error:*)` - Return operations where: - // * The operation's metadata type is - // [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata]. - // * The database is restored from a backup. - // * The backup name contains "backup_howl". - // * The restored database's name contains "restored_howl". - // * The operation started before 2018-03-28T14:50:00Z. - // * The operation resulted in an error. - string filter = 2; - - // Number of operations to be returned in the response. If 0 or - // less, defaults to the server's maximum allowed page size. - int32 page_size = 3; - - // If non-empty, `page_token` should contain a - // [next_page_token][google.spanner.admin.database.v1.ListDatabaseOperationsResponse.next_page_token] - // from a previous - // [ListDatabaseOperationsResponse][google.spanner.admin.database.v1.ListDatabaseOperationsResponse] - // to the same `parent` and with the same `filter`. - string page_token = 4; -} - -// The response for -// [ListDatabaseOperations][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabaseOperations]. -message ListDatabaseOperationsResponse { - // The list of matching database [long-running - // operations][google.longrunning.Operation]. Each operation's name will be - // prefixed by the database's name. The operation's - // [metadata][google.longrunning.Operation.metadata] field type - // `metadata.type_url` describes the type of the metadata. - repeated google.longrunning.Operation operations = 1; - - // `next_page_token` can be sent in a subsequent - // [ListDatabaseOperations][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabaseOperations] - // call to fetch more of the matching metadata. - string next_page_token = 2; -} - -// The request for -// [RestoreDatabase][google.spanner.admin.database.v1.DatabaseAdmin.RestoreDatabase]. -message RestoreDatabaseRequest { - // Required. The name of the instance in which to create the - // restored database. This instance must be in the same project and - // have the same instance configuration as the instance containing - // the source backup. Values are of the form - // `projects//instances/`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "spanner.googleapis.com/Instance" - } - ]; - - // Required. The id of the database to create and restore to. This - // database must not already exist. The `database_id` appended to - // `parent` forms the full database name of the form - // `projects//instances//databases/`. - string database_id = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The source from which to restore. - oneof source { - // Name of the backup from which to restore. Values are of the form - // `projects//instances//backups/`. - string backup = 3 [(google.api.resource_reference) = { - type: "spanner.googleapis.com/Backup" - }]; - } - - // Optional. An encryption configuration describing the encryption type and - // key resources in Cloud KMS used to encrypt/decrypt the database to restore - // to. If this field is not specified, the restored database will use the same - // encryption configuration as the backup by default, namely - // [encryption_type][google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.encryption_type] - // = `USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION`. - RestoreDatabaseEncryptionConfig encryption_config = 4 - [(google.api.field_behavior) = OPTIONAL]; -} - -// Encryption configuration for the restored database. -message RestoreDatabaseEncryptionConfig { - // Encryption types for the database to be restored. - enum EncryptionType { - // Unspecified. Do not use. - ENCRYPTION_TYPE_UNSPECIFIED = 0; - - // This is the default option when - // [encryption_config][google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig] - // is not specified. - USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION = 1; - - // Use Google default encryption. - GOOGLE_DEFAULT_ENCRYPTION = 2; - - // Use customer managed encryption. If specified, `kms_key_name` must - // must contain a valid Cloud KMS key. - CUSTOMER_MANAGED_ENCRYPTION = 3; - } - - // Required. The encryption type of the restored database. - EncryptionType encryption_type = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. The Cloud KMS key that will be used to encrypt/decrypt the - // restored database. This field should be set only when - // [encryption_type][google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.encryption_type] - // is `CUSTOMER_MANAGED_ENCRYPTION`. Values are of the form - // `projects//locations//keyRings//cryptoKeys/`. - string kms_key_name = 2 [ - (google.api.field_behavior) = OPTIONAL, - (google.api.resource_reference) = { - type: "cloudkms.googleapis.com/CryptoKey" - } - ]; - - // Optional. Specifies the KMS configuration for the one or more keys used to - // encrypt the database. Values are of the form - // `projects//locations//keyRings//cryptoKeys/`. - // - // The keys referenced by kms_key_names must fully cover all - // regions of the database instance configuration. Some examples: - // * For single region database instance configs, specify a single regional - // location KMS key. - // * For multi-regional database instance configs of type GOOGLE_MANAGED, - // either specify a multi-regional location KMS key or multiple regional - // location KMS keys that cover all regions in the instance config. - // * For a database instance config of type USER_MANAGED, please specify only - // regional location KMS keys to cover each region in the instance config. - // Multi-regional location KMS keys are not supported for USER_MANAGED - // instance configs. - repeated string kms_key_names = 3 [ - (google.api.field_behavior) = OPTIONAL, - (google.api.resource_reference) = { - type: "cloudkms.googleapis.com/CryptoKey" - } - ]; -} - -// Metadata type for the long-running operation returned by -// [RestoreDatabase][google.spanner.admin.database.v1.DatabaseAdmin.RestoreDatabase]. -message RestoreDatabaseMetadata { - // Name of the database being created and restored to. - string name = 1 [(google.api.resource_reference) = { - type: "spanner.googleapis.com/Database" - }]; - - // The type of the restore source. - RestoreSourceType source_type = 2; - - // Information about the source used to restore the database, as specified by - // `source` in - // [RestoreDatabaseRequest][google.spanner.admin.database.v1.RestoreDatabaseRequest]. - oneof source_info { - // Information about the backup used to restore the database. - BackupInfo backup_info = 3; - } - - // The progress of the - // [RestoreDatabase][google.spanner.admin.database.v1.DatabaseAdmin.RestoreDatabase] - // operation. - OperationProgress progress = 4; - - // The time at which cancellation of this operation was received. - // [Operations.CancelOperation][google.longrunning.Operations.CancelOperation] - // starts asynchronous cancellation on a long-running operation. The server - // makes a best effort to cancel the operation, but success is not guaranteed. - // Clients can use - // [Operations.GetOperation][google.longrunning.Operations.GetOperation] or - // other methods to check whether the cancellation succeeded or whether the - // operation completed despite cancellation. On successful cancellation, - // the operation is not deleted; instead, it becomes an operation with - // an [Operation.error][google.longrunning.Operation.error] value with a - // [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - // `Code.CANCELLED`. - google.protobuf.Timestamp cancel_time = 5; - - // If exists, the name of the long-running operation that will be used to - // track the post-restore optimization process to optimize the performance of - // the restored database, and remove the dependency on the restore source. - // The name is of the form - // `projects//instances//databases//operations/` - // where the is the name of database being created and restored to. - // The metadata type of the long-running operation is - // [OptimizeRestoredDatabaseMetadata][google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata]. - // This long-running operation will be automatically created by the system - // after the RestoreDatabase long-running operation completes successfully. - // This operation will not be created if the restore was not successful. - string optimize_database_operation_name = 6; -} - -// Metadata type for the long-running operation used to track the progress -// of optimizations performed on a newly restored database. This long-running -// operation is automatically created by the system after the successful -// completion of a database restore, and cannot be cancelled. -message OptimizeRestoredDatabaseMetadata { - // Name of the restored database being optimized. - string name = 1 [(google.api.resource_reference) = { - type: "spanner.googleapis.com/Database" - }]; - - // The progress of the post-restore optimizations. - OperationProgress progress = 2; -} - -// Indicates the type of the restore source. -enum RestoreSourceType { - // No restore associated. - TYPE_UNSPECIFIED = 0; - - // A backup was used as the source of the restore. - BACKUP = 1; -} - -// A Cloud Spanner database role. -message DatabaseRole { - option (google.api.resource) = { - type: "spanner.googleapis.com/DatabaseRole" - pattern: "projects/{project}/instances/{instance}/databases/{database}/databaseRoles/{role}" - }; - - // Required. The name of the database role. Values are of the form - // `projects//instances//databases//databaseRoles/` - // where `` is as specified in the `CREATE ROLE` DDL statement. - string name = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// The request for -// [ListDatabaseRoles][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabaseRoles]. -message ListDatabaseRolesRequest { - // Required. The database whose roles should be listed. - // Values are of the form - // `projects//instances//databases/`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "spanner.googleapis.com/Database" - } - ]; - - // Number of database roles to be returned in the response. If 0 or less, - // defaults to the server's maximum allowed page size. - int32 page_size = 2; - - // If non-empty, `page_token` should contain a - // [next_page_token][google.spanner.admin.database.v1.ListDatabaseRolesResponse.next_page_token] - // from a previous - // [ListDatabaseRolesResponse][google.spanner.admin.database.v1.ListDatabaseRolesResponse]. - string page_token = 3; -} - -// The response for -// [ListDatabaseRoles][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabaseRoles]. -message ListDatabaseRolesResponse { - // Database roles that matched the request. - repeated DatabaseRole database_roles = 1; - - // `next_page_token` can be sent in a subsequent - // [ListDatabaseRoles][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabaseRoles] - // call to fetch more of the matching roles. - string next_page_token = 2; -} - -// The request for -// [AddSplitPoints][google.spanner.admin.database.v1.DatabaseAdmin.AddSplitPoints]. -message AddSplitPointsRequest { - // Required. The database on whose tables/indexes split points are to be - // added. Values are of the form - // `projects//instances//databases/`. - string database = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "spanner.googleapis.com/Database" - } - ]; - - // Required. The split points to add. - repeated SplitPoints split_points = 2 - [(google.api.field_behavior) = REQUIRED]; - - // Optional. A user-supplied tag associated with the split points. - // For example, "intital_data_load", "special_event_1". - // Defaults to "CloudAddSplitPointsAPI" if not specified. - // The length of the tag must not exceed 50 characters,else will be trimmed. - // Only valid UTF8 characters are allowed. - string initiator = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// The response for -// [AddSplitPoints][google.spanner.admin.database.v1.DatabaseAdmin.AddSplitPoints]. -message AddSplitPointsResponse {} - -// The split points of a table/index. -message SplitPoints { - // A split key. - message Key { - // Required. The column values making up the split key. - google.protobuf.ListValue key_parts = 1 - [(google.api.field_behavior) = REQUIRED]; - } - - // The table to split. - string table = 1; - - // The index to split. - // If specified, the `table` field must refer to the index's base table. - string index = 2; - - // Required. The list of split keys, i.e., the split boundaries. - repeated Key keys = 3 [(google.api.field_behavior) = REQUIRED]; - - // Optional. The expiration timestamp of the split points. - // A timestamp in the past means immediate expiration. - // The maximum value can be 30 days in the future. - // Defaults to 10 days in the future if not specified. - google.protobuf.Timestamp expire_time = 5 - [(google.api.field_behavior) = OPTIONAL]; -} - -// Internal request proto, do not use directly. -message InternalUpdateGraphOperationRequest { - // Internal field, do not use directly. - string database = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "spanner.googleapis.com/Database" - } - ]; - // Internal field, do not use directly. - string operation_id = 2 [(google.api.field_behavior) = REQUIRED]; - // Internal field, do not use directly. - string vm_identity_token = 5 [(google.api.field_behavior) = REQUIRED]; - // Internal field, do not use directly. - double progress = 3 [(google.api.field_behavior) = OPTIONAL]; - // Internal field, do not use directly. - google.rpc.Status status = 6 [(google.api.field_behavior) = OPTIONAL]; -} - -// Internal response proto, do not use directly. -message InternalUpdateGraphOperationResponse {} diff --git a/owl-bot-staging/admin/database/v1/protos/protos.d.ts b/owl-bot-staging/admin/database/v1/protos/protos.d.ts deleted file mode 100644 index a4d7b0513..000000000 --- a/owl-bot-staging/admin/database/v1/protos/protos.d.ts +++ /dev/null @@ -1,16947 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -import type {protobuf as $protobuf} from "google-gax"; -import Long = require("long"); -/** Namespace google. */ -export namespace google { - - /** Namespace spanner. */ - namespace spanner { - - /** Namespace admin. */ - namespace admin { - - /** Namespace database. */ - namespace database { - - /** Namespace v1. */ - namespace v1 { - - /** Properties of a Backup. */ - interface IBackup { - - /** Backup database */ - database?: (string|null); - - /** Backup versionTime */ - versionTime?: (google.protobuf.ITimestamp|null); - - /** Backup expireTime */ - expireTime?: (google.protobuf.ITimestamp|null); - - /** Backup name */ - name?: (string|null); - - /** Backup createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** Backup sizeBytes */ - sizeBytes?: (number|Long|string|null); - - /** Backup freeableSizeBytes */ - freeableSizeBytes?: (number|Long|string|null); - - /** Backup exclusiveSizeBytes */ - exclusiveSizeBytes?: (number|Long|string|null); - - /** Backup state */ - state?: (google.spanner.admin.database.v1.Backup.State|keyof typeof google.spanner.admin.database.v1.Backup.State|null); - - /** Backup referencingDatabases */ - referencingDatabases?: (string[]|null); - - /** Backup encryptionInfo */ - encryptionInfo?: (google.spanner.admin.database.v1.IEncryptionInfo|null); - - /** Backup encryptionInformation */ - encryptionInformation?: (google.spanner.admin.database.v1.IEncryptionInfo[]|null); - - /** Backup databaseDialect */ - databaseDialect?: (google.spanner.admin.database.v1.DatabaseDialect|keyof typeof google.spanner.admin.database.v1.DatabaseDialect|null); - - /** Backup referencingBackups */ - referencingBackups?: (string[]|null); - - /** Backup maxExpireTime */ - maxExpireTime?: (google.protobuf.ITimestamp|null); - - /** Backup backupSchedules */ - backupSchedules?: (string[]|null); - - /** Backup incrementalBackupChainId */ - incrementalBackupChainId?: (string|null); - - /** Backup oldestVersionTime */ - oldestVersionTime?: (google.protobuf.ITimestamp|null); - - /** Backup instancePartitions */ - instancePartitions?: (google.spanner.admin.database.v1.IBackupInstancePartition[]|null); - } - - /** Represents a Backup. */ - class Backup implements IBackup { - - /** - * Constructs a new Backup. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IBackup); - - /** Backup database. */ - public database: string; - - /** Backup versionTime. */ - public versionTime?: (google.protobuf.ITimestamp|null); - - /** Backup expireTime. */ - public expireTime?: (google.protobuf.ITimestamp|null); - - /** Backup name. */ - public name: string; - - /** Backup createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** Backup sizeBytes. */ - public sizeBytes: (number|Long|string); - - /** Backup freeableSizeBytes. */ - public freeableSizeBytes: (number|Long|string); - - /** Backup exclusiveSizeBytes. */ - public exclusiveSizeBytes: (number|Long|string); - - /** Backup state. */ - public state: (google.spanner.admin.database.v1.Backup.State|keyof typeof google.spanner.admin.database.v1.Backup.State); - - /** Backup referencingDatabases. */ - public referencingDatabases: string[]; - - /** Backup encryptionInfo. */ - public encryptionInfo?: (google.spanner.admin.database.v1.IEncryptionInfo|null); - - /** Backup encryptionInformation. */ - public encryptionInformation: google.spanner.admin.database.v1.IEncryptionInfo[]; - - /** Backup databaseDialect. */ - public databaseDialect: (google.spanner.admin.database.v1.DatabaseDialect|keyof typeof google.spanner.admin.database.v1.DatabaseDialect); - - /** Backup referencingBackups. */ - public referencingBackups: string[]; - - /** Backup maxExpireTime. */ - public maxExpireTime?: (google.protobuf.ITimestamp|null); - - /** Backup backupSchedules. */ - public backupSchedules: string[]; - - /** Backup incrementalBackupChainId. */ - public incrementalBackupChainId: string; - - /** Backup oldestVersionTime. */ - public oldestVersionTime?: (google.protobuf.ITimestamp|null); - - /** Backup instancePartitions. */ - public instancePartitions: google.spanner.admin.database.v1.IBackupInstancePartition[]; - - /** - * Creates a new Backup instance using the specified properties. - * @param [properties] Properties to set - * @returns Backup instance - */ - public static create(properties?: google.spanner.admin.database.v1.IBackup): google.spanner.admin.database.v1.Backup; - - /** - * Encodes the specified Backup message. Does not implicitly {@link google.spanner.admin.database.v1.Backup.verify|verify} messages. - * @param message Backup message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IBackup, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Backup message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.Backup.verify|verify} messages. - * @param message Backup message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IBackup, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Backup message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Backup - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.Backup; - - /** - * Decodes a Backup message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Backup - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.Backup; - - /** - * Verifies a Backup message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Backup message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Backup - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.Backup; - - /** - * Creates a plain object from a Backup message. Also converts values to other types if specified. - * @param message Backup - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.Backup, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Backup to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Backup - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Backup { - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - CREATING = 1, - READY = 2 - } - } - - /** Properties of a CreateBackupRequest. */ - interface ICreateBackupRequest { - - /** CreateBackupRequest parent */ - parent?: (string|null); - - /** CreateBackupRequest backupId */ - backupId?: (string|null); - - /** CreateBackupRequest backup */ - backup?: (google.spanner.admin.database.v1.IBackup|null); - - /** CreateBackupRequest encryptionConfig */ - encryptionConfig?: (google.spanner.admin.database.v1.ICreateBackupEncryptionConfig|null); - } - - /** Represents a CreateBackupRequest. */ - class CreateBackupRequest implements ICreateBackupRequest { - - /** - * Constructs a new CreateBackupRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.ICreateBackupRequest); - - /** CreateBackupRequest parent. */ - public parent: string; - - /** CreateBackupRequest backupId. */ - public backupId: string; - - /** CreateBackupRequest backup. */ - public backup?: (google.spanner.admin.database.v1.IBackup|null); - - /** CreateBackupRequest encryptionConfig. */ - public encryptionConfig?: (google.spanner.admin.database.v1.ICreateBackupEncryptionConfig|null); - - /** - * Creates a new CreateBackupRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateBackupRequest instance - */ - public static create(properties?: google.spanner.admin.database.v1.ICreateBackupRequest): google.spanner.admin.database.v1.CreateBackupRequest; - - /** - * Encodes the specified CreateBackupRequest message. Does not implicitly {@link google.spanner.admin.database.v1.CreateBackupRequest.verify|verify} messages. - * @param message CreateBackupRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.ICreateBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateBackupRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.CreateBackupRequest.verify|verify} messages. - * @param message CreateBackupRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.ICreateBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateBackupRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.CreateBackupRequest; - - /** - * Decodes a CreateBackupRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.CreateBackupRequest; - - /** - * Verifies a CreateBackupRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateBackupRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateBackupRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.CreateBackupRequest; - - /** - * Creates a plain object from a CreateBackupRequest message. Also converts values to other types if specified. - * @param message CreateBackupRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.CreateBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateBackupRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateBackupRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateBackupMetadata. */ - interface ICreateBackupMetadata { - - /** CreateBackupMetadata name */ - name?: (string|null); - - /** CreateBackupMetadata database */ - database?: (string|null); - - /** CreateBackupMetadata progress */ - progress?: (google.spanner.admin.database.v1.IOperationProgress|null); - - /** CreateBackupMetadata cancelTime */ - cancelTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a CreateBackupMetadata. */ - class CreateBackupMetadata implements ICreateBackupMetadata { - - /** - * Constructs a new CreateBackupMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.ICreateBackupMetadata); - - /** CreateBackupMetadata name. */ - public name: string; - - /** CreateBackupMetadata database. */ - public database: string; - - /** CreateBackupMetadata progress. */ - public progress?: (google.spanner.admin.database.v1.IOperationProgress|null); - - /** CreateBackupMetadata cancelTime. */ - public cancelTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new CreateBackupMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateBackupMetadata instance - */ - public static create(properties?: google.spanner.admin.database.v1.ICreateBackupMetadata): google.spanner.admin.database.v1.CreateBackupMetadata; - - /** - * Encodes the specified CreateBackupMetadata message. Does not implicitly {@link google.spanner.admin.database.v1.CreateBackupMetadata.verify|verify} messages. - * @param message CreateBackupMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.ICreateBackupMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateBackupMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.CreateBackupMetadata.verify|verify} messages. - * @param message CreateBackupMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.ICreateBackupMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateBackupMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateBackupMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.CreateBackupMetadata; - - /** - * Decodes a CreateBackupMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateBackupMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.CreateBackupMetadata; - - /** - * Verifies a CreateBackupMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateBackupMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateBackupMetadata - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.CreateBackupMetadata; - - /** - * Creates a plain object from a CreateBackupMetadata message. Also converts values to other types if specified. - * @param message CreateBackupMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.CreateBackupMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateBackupMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateBackupMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CopyBackupRequest. */ - interface ICopyBackupRequest { - - /** CopyBackupRequest parent */ - parent?: (string|null); - - /** CopyBackupRequest backupId */ - backupId?: (string|null); - - /** CopyBackupRequest sourceBackup */ - sourceBackup?: (string|null); - - /** CopyBackupRequest expireTime */ - expireTime?: (google.protobuf.ITimestamp|null); - - /** CopyBackupRequest encryptionConfig */ - encryptionConfig?: (google.spanner.admin.database.v1.ICopyBackupEncryptionConfig|null); - } - - /** Represents a CopyBackupRequest. */ - class CopyBackupRequest implements ICopyBackupRequest { - - /** - * Constructs a new CopyBackupRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.ICopyBackupRequest); - - /** CopyBackupRequest parent. */ - public parent: string; - - /** CopyBackupRequest backupId. */ - public backupId: string; - - /** CopyBackupRequest sourceBackup. */ - public sourceBackup: string; - - /** CopyBackupRequest expireTime. */ - public expireTime?: (google.protobuf.ITimestamp|null); - - /** CopyBackupRequest encryptionConfig. */ - public encryptionConfig?: (google.spanner.admin.database.v1.ICopyBackupEncryptionConfig|null); - - /** - * Creates a new CopyBackupRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CopyBackupRequest instance - */ - public static create(properties?: google.spanner.admin.database.v1.ICopyBackupRequest): google.spanner.admin.database.v1.CopyBackupRequest; - - /** - * Encodes the specified CopyBackupRequest message. Does not implicitly {@link google.spanner.admin.database.v1.CopyBackupRequest.verify|verify} messages. - * @param message CopyBackupRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.ICopyBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CopyBackupRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.CopyBackupRequest.verify|verify} messages. - * @param message CopyBackupRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.ICopyBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CopyBackupRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CopyBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.CopyBackupRequest; - - /** - * Decodes a CopyBackupRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CopyBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.CopyBackupRequest; - - /** - * Verifies a CopyBackupRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CopyBackupRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CopyBackupRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.CopyBackupRequest; - - /** - * Creates a plain object from a CopyBackupRequest message. Also converts values to other types if specified. - * @param message CopyBackupRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.CopyBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CopyBackupRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CopyBackupRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CopyBackupMetadata. */ - interface ICopyBackupMetadata { - - /** CopyBackupMetadata name */ - name?: (string|null); - - /** CopyBackupMetadata sourceBackup */ - sourceBackup?: (string|null); - - /** CopyBackupMetadata progress */ - progress?: (google.spanner.admin.database.v1.IOperationProgress|null); - - /** CopyBackupMetadata cancelTime */ - cancelTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a CopyBackupMetadata. */ - class CopyBackupMetadata implements ICopyBackupMetadata { - - /** - * Constructs a new CopyBackupMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.ICopyBackupMetadata); - - /** CopyBackupMetadata name. */ - public name: string; - - /** CopyBackupMetadata sourceBackup. */ - public sourceBackup: string; - - /** CopyBackupMetadata progress. */ - public progress?: (google.spanner.admin.database.v1.IOperationProgress|null); - - /** CopyBackupMetadata cancelTime. */ - public cancelTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new CopyBackupMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns CopyBackupMetadata instance - */ - public static create(properties?: google.spanner.admin.database.v1.ICopyBackupMetadata): google.spanner.admin.database.v1.CopyBackupMetadata; - - /** - * Encodes the specified CopyBackupMetadata message. Does not implicitly {@link google.spanner.admin.database.v1.CopyBackupMetadata.verify|verify} messages. - * @param message CopyBackupMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.ICopyBackupMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CopyBackupMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.CopyBackupMetadata.verify|verify} messages. - * @param message CopyBackupMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.ICopyBackupMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CopyBackupMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CopyBackupMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.CopyBackupMetadata; - - /** - * Decodes a CopyBackupMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CopyBackupMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.CopyBackupMetadata; - - /** - * Verifies a CopyBackupMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CopyBackupMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CopyBackupMetadata - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.CopyBackupMetadata; - - /** - * Creates a plain object from a CopyBackupMetadata message. Also converts values to other types if specified. - * @param message CopyBackupMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.CopyBackupMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CopyBackupMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CopyBackupMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateBackupRequest. */ - interface IUpdateBackupRequest { - - /** UpdateBackupRequest backup */ - backup?: (google.spanner.admin.database.v1.IBackup|null); - - /** UpdateBackupRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - } - - /** Represents an UpdateBackupRequest. */ - class UpdateBackupRequest implements IUpdateBackupRequest { - - /** - * Constructs a new UpdateBackupRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IUpdateBackupRequest); - - /** UpdateBackupRequest backup. */ - public backup?: (google.spanner.admin.database.v1.IBackup|null); - - /** UpdateBackupRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** - * Creates a new UpdateBackupRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateBackupRequest instance - */ - public static create(properties?: google.spanner.admin.database.v1.IUpdateBackupRequest): google.spanner.admin.database.v1.UpdateBackupRequest; - - /** - * Encodes the specified UpdateBackupRequest message. Does not implicitly {@link google.spanner.admin.database.v1.UpdateBackupRequest.verify|verify} messages. - * @param message UpdateBackupRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IUpdateBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateBackupRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.UpdateBackupRequest.verify|verify} messages. - * @param message UpdateBackupRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IUpdateBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateBackupRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.UpdateBackupRequest; - - /** - * Decodes an UpdateBackupRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.UpdateBackupRequest; - - /** - * Verifies an UpdateBackupRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UpdateBackupRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateBackupRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.UpdateBackupRequest; - - /** - * Creates a plain object from an UpdateBackupRequest message. Also converts values to other types if specified. - * @param message UpdateBackupRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.UpdateBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateBackupRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateBackupRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetBackupRequest. */ - interface IGetBackupRequest { - - /** GetBackupRequest name */ - name?: (string|null); - } - - /** Represents a GetBackupRequest. */ - class GetBackupRequest implements IGetBackupRequest { - - /** - * Constructs a new GetBackupRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IGetBackupRequest); - - /** GetBackupRequest name. */ - public name: string; - - /** - * Creates a new GetBackupRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetBackupRequest instance - */ - public static create(properties?: google.spanner.admin.database.v1.IGetBackupRequest): google.spanner.admin.database.v1.GetBackupRequest; - - /** - * Encodes the specified GetBackupRequest message. Does not implicitly {@link google.spanner.admin.database.v1.GetBackupRequest.verify|verify} messages. - * @param message GetBackupRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IGetBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetBackupRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.GetBackupRequest.verify|verify} messages. - * @param message GetBackupRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IGetBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetBackupRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.GetBackupRequest; - - /** - * Decodes a GetBackupRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.GetBackupRequest; - - /** - * Verifies a GetBackupRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetBackupRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetBackupRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.GetBackupRequest; - - /** - * Creates a plain object from a GetBackupRequest message. Also converts values to other types if specified. - * @param message GetBackupRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.GetBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetBackupRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetBackupRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteBackupRequest. */ - interface IDeleteBackupRequest { - - /** DeleteBackupRequest name */ - name?: (string|null); - } - - /** Represents a DeleteBackupRequest. */ - class DeleteBackupRequest implements IDeleteBackupRequest { - - /** - * Constructs a new DeleteBackupRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IDeleteBackupRequest); - - /** DeleteBackupRequest name. */ - public name: string; - - /** - * Creates a new DeleteBackupRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteBackupRequest instance - */ - public static create(properties?: google.spanner.admin.database.v1.IDeleteBackupRequest): google.spanner.admin.database.v1.DeleteBackupRequest; - - /** - * Encodes the specified DeleteBackupRequest message. Does not implicitly {@link google.spanner.admin.database.v1.DeleteBackupRequest.verify|verify} messages. - * @param message DeleteBackupRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IDeleteBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteBackupRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.DeleteBackupRequest.verify|verify} messages. - * @param message DeleteBackupRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IDeleteBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteBackupRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.DeleteBackupRequest; - - /** - * Decodes a DeleteBackupRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.DeleteBackupRequest; - - /** - * Verifies a DeleteBackupRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteBackupRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteBackupRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.DeleteBackupRequest; - - /** - * Creates a plain object from a DeleteBackupRequest message. Also converts values to other types if specified. - * @param message DeleteBackupRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.DeleteBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteBackupRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteBackupRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListBackupsRequest. */ - interface IListBackupsRequest { - - /** ListBackupsRequest parent */ - parent?: (string|null); - - /** ListBackupsRequest filter */ - filter?: (string|null); - - /** ListBackupsRequest pageSize */ - pageSize?: (number|null); - - /** ListBackupsRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListBackupsRequest. */ - class ListBackupsRequest implements IListBackupsRequest { - - /** - * Constructs a new ListBackupsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IListBackupsRequest); - - /** ListBackupsRequest parent. */ - public parent: string; - - /** ListBackupsRequest filter. */ - public filter: string; - - /** ListBackupsRequest pageSize. */ - public pageSize: number; - - /** ListBackupsRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListBackupsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListBackupsRequest instance - */ - public static create(properties?: google.spanner.admin.database.v1.IListBackupsRequest): google.spanner.admin.database.v1.ListBackupsRequest; - - /** - * Encodes the specified ListBackupsRequest message. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupsRequest.verify|verify} messages. - * @param message ListBackupsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IListBackupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListBackupsRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupsRequest.verify|verify} messages. - * @param message ListBackupsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IListBackupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListBackupsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListBackupsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.ListBackupsRequest; - - /** - * Decodes a ListBackupsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListBackupsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.ListBackupsRequest; - - /** - * Verifies a ListBackupsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListBackupsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListBackupsRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.ListBackupsRequest; - - /** - * Creates a plain object from a ListBackupsRequest message. Also converts values to other types if specified. - * @param message ListBackupsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.ListBackupsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListBackupsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListBackupsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListBackupsResponse. */ - interface IListBackupsResponse { - - /** ListBackupsResponse backups */ - backups?: (google.spanner.admin.database.v1.IBackup[]|null); - - /** ListBackupsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListBackupsResponse. */ - class ListBackupsResponse implements IListBackupsResponse { - - /** - * Constructs a new ListBackupsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IListBackupsResponse); - - /** ListBackupsResponse backups. */ - public backups: google.spanner.admin.database.v1.IBackup[]; - - /** ListBackupsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListBackupsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListBackupsResponse instance - */ - public static create(properties?: google.spanner.admin.database.v1.IListBackupsResponse): google.spanner.admin.database.v1.ListBackupsResponse; - - /** - * Encodes the specified ListBackupsResponse message. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupsResponse.verify|verify} messages. - * @param message ListBackupsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IListBackupsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListBackupsResponse message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupsResponse.verify|verify} messages. - * @param message ListBackupsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IListBackupsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListBackupsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListBackupsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.ListBackupsResponse; - - /** - * Decodes a ListBackupsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListBackupsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.ListBackupsResponse; - - /** - * Verifies a ListBackupsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListBackupsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListBackupsResponse - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.ListBackupsResponse; - - /** - * Creates a plain object from a ListBackupsResponse message. Also converts values to other types if specified. - * @param message ListBackupsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.ListBackupsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListBackupsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListBackupsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListBackupOperationsRequest. */ - interface IListBackupOperationsRequest { - - /** ListBackupOperationsRequest parent */ - parent?: (string|null); - - /** ListBackupOperationsRequest filter */ - filter?: (string|null); - - /** ListBackupOperationsRequest pageSize */ - pageSize?: (number|null); - - /** ListBackupOperationsRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListBackupOperationsRequest. */ - class ListBackupOperationsRequest implements IListBackupOperationsRequest { - - /** - * Constructs a new ListBackupOperationsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IListBackupOperationsRequest); - - /** ListBackupOperationsRequest parent. */ - public parent: string; - - /** ListBackupOperationsRequest filter. */ - public filter: string; - - /** ListBackupOperationsRequest pageSize. */ - public pageSize: number; - - /** ListBackupOperationsRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListBackupOperationsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListBackupOperationsRequest instance - */ - public static create(properties?: google.spanner.admin.database.v1.IListBackupOperationsRequest): google.spanner.admin.database.v1.ListBackupOperationsRequest; - - /** - * Encodes the specified ListBackupOperationsRequest message. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupOperationsRequest.verify|verify} messages. - * @param message ListBackupOperationsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IListBackupOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListBackupOperationsRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupOperationsRequest.verify|verify} messages. - * @param message ListBackupOperationsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IListBackupOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListBackupOperationsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListBackupOperationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.ListBackupOperationsRequest; - - /** - * Decodes a ListBackupOperationsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListBackupOperationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.ListBackupOperationsRequest; - - /** - * Verifies a ListBackupOperationsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListBackupOperationsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListBackupOperationsRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.ListBackupOperationsRequest; - - /** - * Creates a plain object from a ListBackupOperationsRequest message. Also converts values to other types if specified. - * @param message ListBackupOperationsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.ListBackupOperationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListBackupOperationsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListBackupOperationsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListBackupOperationsResponse. */ - interface IListBackupOperationsResponse { - - /** ListBackupOperationsResponse operations */ - operations?: (google.longrunning.IOperation[]|null); - - /** ListBackupOperationsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListBackupOperationsResponse. */ - class ListBackupOperationsResponse implements IListBackupOperationsResponse { - - /** - * Constructs a new ListBackupOperationsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IListBackupOperationsResponse); - - /** ListBackupOperationsResponse operations. */ - public operations: google.longrunning.IOperation[]; - - /** ListBackupOperationsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListBackupOperationsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListBackupOperationsResponse instance - */ - public static create(properties?: google.spanner.admin.database.v1.IListBackupOperationsResponse): google.spanner.admin.database.v1.ListBackupOperationsResponse; - - /** - * Encodes the specified ListBackupOperationsResponse message. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupOperationsResponse.verify|verify} messages. - * @param message ListBackupOperationsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IListBackupOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListBackupOperationsResponse message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupOperationsResponse.verify|verify} messages. - * @param message ListBackupOperationsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IListBackupOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListBackupOperationsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListBackupOperationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.ListBackupOperationsResponse; - - /** - * Decodes a ListBackupOperationsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListBackupOperationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.ListBackupOperationsResponse; - - /** - * Verifies a ListBackupOperationsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListBackupOperationsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListBackupOperationsResponse - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.ListBackupOperationsResponse; - - /** - * Creates a plain object from a ListBackupOperationsResponse message. Also converts values to other types if specified. - * @param message ListBackupOperationsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.ListBackupOperationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListBackupOperationsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListBackupOperationsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BackupInfo. */ - interface IBackupInfo { - - /** BackupInfo backup */ - backup?: (string|null); - - /** BackupInfo versionTime */ - versionTime?: (google.protobuf.ITimestamp|null); - - /** BackupInfo createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** BackupInfo sourceDatabase */ - sourceDatabase?: (string|null); - } - - /** Represents a BackupInfo. */ - class BackupInfo implements IBackupInfo { - - /** - * Constructs a new BackupInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IBackupInfo); - - /** BackupInfo backup. */ - public backup: string; - - /** BackupInfo versionTime. */ - public versionTime?: (google.protobuf.ITimestamp|null); - - /** BackupInfo createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** BackupInfo sourceDatabase. */ - public sourceDatabase: string; - - /** - * Creates a new BackupInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns BackupInfo instance - */ - public static create(properties?: google.spanner.admin.database.v1.IBackupInfo): google.spanner.admin.database.v1.BackupInfo; - - /** - * Encodes the specified BackupInfo message. Does not implicitly {@link google.spanner.admin.database.v1.BackupInfo.verify|verify} messages. - * @param message BackupInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IBackupInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BackupInfo message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.BackupInfo.verify|verify} messages. - * @param message BackupInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IBackupInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BackupInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BackupInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.BackupInfo; - - /** - * Decodes a BackupInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BackupInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.BackupInfo; - - /** - * Verifies a BackupInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BackupInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BackupInfo - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.BackupInfo; - - /** - * Creates a plain object from a BackupInfo message. Also converts values to other types if specified. - * @param message BackupInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.BackupInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BackupInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BackupInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateBackupEncryptionConfig. */ - interface ICreateBackupEncryptionConfig { - - /** CreateBackupEncryptionConfig encryptionType */ - encryptionType?: (google.spanner.admin.database.v1.CreateBackupEncryptionConfig.EncryptionType|keyof typeof google.spanner.admin.database.v1.CreateBackupEncryptionConfig.EncryptionType|null); - - /** CreateBackupEncryptionConfig kmsKeyName */ - kmsKeyName?: (string|null); - - /** CreateBackupEncryptionConfig kmsKeyNames */ - kmsKeyNames?: (string[]|null); - } - - /** Represents a CreateBackupEncryptionConfig. */ - class CreateBackupEncryptionConfig implements ICreateBackupEncryptionConfig { - - /** - * Constructs a new CreateBackupEncryptionConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.ICreateBackupEncryptionConfig); - - /** CreateBackupEncryptionConfig encryptionType. */ - public encryptionType: (google.spanner.admin.database.v1.CreateBackupEncryptionConfig.EncryptionType|keyof typeof google.spanner.admin.database.v1.CreateBackupEncryptionConfig.EncryptionType); - - /** CreateBackupEncryptionConfig kmsKeyName. */ - public kmsKeyName: string; - - /** CreateBackupEncryptionConfig kmsKeyNames. */ - public kmsKeyNames: string[]; - - /** - * Creates a new CreateBackupEncryptionConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateBackupEncryptionConfig instance - */ - public static create(properties?: google.spanner.admin.database.v1.ICreateBackupEncryptionConfig): google.spanner.admin.database.v1.CreateBackupEncryptionConfig; - - /** - * Encodes the specified CreateBackupEncryptionConfig message. Does not implicitly {@link google.spanner.admin.database.v1.CreateBackupEncryptionConfig.verify|verify} messages. - * @param message CreateBackupEncryptionConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.ICreateBackupEncryptionConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateBackupEncryptionConfig message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.CreateBackupEncryptionConfig.verify|verify} messages. - * @param message CreateBackupEncryptionConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.ICreateBackupEncryptionConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateBackupEncryptionConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateBackupEncryptionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.CreateBackupEncryptionConfig; - - /** - * Decodes a CreateBackupEncryptionConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateBackupEncryptionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.CreateBackupEncryptionConfig; - - /** - * Verifies a CreateBackupEncryptionConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateBackupEncryptionConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateBackupEncryptionConfig - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.CreateBackupEncryptionConfig; - - /** - * Creates a plain object from a CreateBackupEncryptionConfig message. Also converts values to other types if specified. - * @param message CreateBackupEncryptionConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.CreateBackupEncryptionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateBackupEncryptionConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateBackupEncryptionConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace CreateBackupEncryptionConfig { - - /** EncryptionType enum. */ - enum EncryptionType { - ENCRYPTION_TYPE_UNSPECIFIED = 0, - USE_DATABASE_ENCRYPTION = 1, - GOOGLE_DEFAULT_ENCRYPTION = 2, - CUSTOMER_MANAGED_ENCRYPTION = 3 - } - } - - /** Properties of a CopyBackupEncryptionConfig. */ - interface ICopyBackupEncryptionConfig { - - /** CopyBackupEncryptionConfig encryptionType */ - encryptionType?: (google.spanner.admin.database.v1.CopyBackupEncryptionConfig.EncryptionType|keyof typeof google.spanner.admin.database.v1.CopyBackupEncryptionConfig.EncryptionType|null); - - /** CopyBackupEncryptionConfig kmsKeyName */ - kmsKeyName?: (string|null); - - /** CopyBackupEncryptionConfig kmsKeyNames */ - kmsKeyNames?: (string[]|null); - } - - /** Represents a CopyBackupEncryptionConfig. */ - class CopyBackupEncryptionConfig implements ICopyBackupEncryptionConfig { - - /** - * Constructs a new CopyBackupEncryptionConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.ICopyBackupEncryptionConfig); - - /** CopyBackupEncryptionConfig encryptionType. */ - public encryptionType: (google.spanner.admin.database.v1.CopyBackupEncryptionConfig.EncryptionType|keyof typeof google.spanner.admin.database.v1.CopyBackupEncryptionConfig.EncryptionType); - - /** CopyBackupEncryptionConfig kmsKeyName. */ - public kmsKeyName: string; - - /** CopyBackupEncryptionConfig kmsKeyNames. */ - public kmsKeyNames: string[]; - - /** - * Creates a new CopyBackupEncryptionConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns CopyBackupEncryptionConfig instance - */ - public static create(properties?: google.spanner.admin.database.v1.ICopyBackupEncryptionConfig): google.spanner.admin.database.v1.CopyBackupEncryptionConfig; - - /** - * Encodes the specified CopyBackupEncryptionConfig message. Does not implicitly {@link google.spanner.admin.database.v1.CopyBackupEncryptionConfig.verify|verify} messages. - * @param message CopyBackupEncryptionConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.ICopyBackupEncryptionConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CopyBackupEncryptionConfig message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.CopyBackupEncryptionConfig.verify|verify} messages. - * @param message CopyBackupEncryptionConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.ICopyBackupEncryptionConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CopyBackupEncryptionConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CopyBackupEncryptionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.CopyBackupEncryptionConfig; - - /** - * Decodes a CopyBackupEncryptionConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CopyBackupEncryptionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.CopyBackupEncryptionConfig; - - /** - * Verifies a CopyBackupEncryptionConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CopyBackupEncryptionConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CopyBackupEncryptionConfig - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.CopyBackupEncryptionConfig; - - /** - * Creates a plain object from a CopyBackupEncryptionConfig message. Also converts values to other types if specified. - * @param message CopyBackupEncryptionConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.CopyBackupEncryptionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CopyBackupEncryptionConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CopyBackupEncryptionConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace CopyBackupEncryptionConfig { - - /** EncryptionType enum. */ - enum EncryptionType { - ENCRYPTION_TYPE_UNSPECIFIED = 0, - USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION = 1, - GOOGLE_DEFAULT_ENCRYPTION = 2, - CUSTOMER_MANAGED_ENCRYPTION = 3 - } - } - - /** Properties of a FullBackupSpec. */ - interface IFullBackupSpec { - } - - /** Represents a FullBackupSpec. */ - class FullBackupSpec implements IFullBackupSpec { - - /** - * Constructs a new FullBackupSpec. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IFullBackupSpec); - - /** - * Creates a new FullBackupSpec instance using the specified properties. - * @param [properties] Properties to set - * @returns FullBackupSpec instance - */ - public static create(properties?: google.spanner.admin.database.v1.IFullBackupSpec): google.spanner.admin.database.v1.FullBackupSpec; - - /** - * Encodes the specified FullBackupSpec message. Does not implicitly {@link google.spanner.admin.database.v1.FullBackupSpec.verify|verify} messages. - * @param message FullBackupSpec message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IFullBackupSpec, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FullBackupSpec message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.FullBackupSpec.verify|verify} messages. - * @param message FullBackupSpec message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IFullBackupSpec, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FullBackupSpec message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FullBackupSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.FullBackupSpec; - - /** - * Decodes a FullBackupSpec message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FullBackupSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.FullBackupSpec; - - /** - * Verifies a FullBackupSpec message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FullBackupSpec message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FullBackupSpec - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.FullBackupSpec; - - /** - * Creates a plain object from a FullBackupSpec message. Also converts values to other types if specified. - * @param message FullBackupSpec - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.FullBackupSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FullBackupSpec to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FullBackupSpec - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an IncrementalBackupSpec. */ - interface IIncrementalBackupSpec { - } - - /** Represents an IncrementalBackupSpec. */ - class IncrementalBackupSpec implements IIncrementalBackupSpec { - - /** - * Constructs a new IncrementalBackupSpec. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IIncrementalBackupSpec); - - /** - * Creates a new IncrementalBackupSpec instance using the specified properties. - * @param [properties] Properties to set - * @returns IncrementalBackupSpec instance - */ - public static create(properties?: google.spanner.admin.database.v1.IIncrementalBackupSpec): google.spanner.admin.database.v1.IncrementalBackupSpec; - - /** - * Encodes the specified IncrementalBackupSpec message. Does not implicitly {@link google.spanner.admin.database.v1.IncrementalBackupSpec.verify|verify} messages. - * @param message IncrementalBackupSpec message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IIncrementalBackupSpec, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified IncrementalBackupSpec message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.IncrementalBackupSpec.verify|verify} messages. - * @param message IncrementalBackupSpec message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IIncrementalBackupSpec, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an IncrementalBackupSpec message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns IncrementalBackupSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.IncrementalBackupSpec; - - /** - * Decodes an IncrementalBackupSpec message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns IncrementalBackupSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.IncrementalBackupSpec; - - /** - * Verifies an IncrementalBackupSpec message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an IncrementalBackupSpec message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns IncrementalBackupSpec - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.IncrementalBackupSpec; - - /** - * Creates a plain object from an IncrementalBackupSpec message. Also converts values to other types if specified. - * @param message IncrementalBackupSpec - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.IncrementalBackupSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this IncrementalBackupSpec to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for IncrementalBackupSpec - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BackupInstancePartition. */ - interface IBackupInstancePartition { - - /** BackupInstancePartition instancePartition */ - instancePartition?: (string|null); - } - - /** Represents a BackupInstancePartition. */ - class BackupInstancePartition implements IBackupInstancePartition { - - /** - * Constructs a new BackupInstancePartition. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IBackupInstancePartition); - - /** BackupInstancePartition instancePartition. */ - public instancePartition: string; - - /** - * Creates a new BackupInstancePartition instance using the specified properties. - * @param [properties] Properties to set - * @returns BackupInstancePartition instance - */ - public static create(properties?: google.spanner.admin.database.v1.IBackupInstancePartition): google.spanner.admin.database.v1.BackupInstancePartition; - - /** - * Encodes the specified BackupInstancePartition message. Does not implicitly {@link google.spanner.admin.database.v1.BackupInstancePartition.verify|verify} messages. - * @param message BackupInstancePartition message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IBackupInstancePartition, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BackupInstancePartition message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.BackupInstancePartition.verify|verify} messages. - * @param message BackupInstancePartition message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IBackupInstancePartition, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BackupInstancePartition message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BackupInstancePartition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.BackupInstancePartition; - - /** - * Decodes a BackupInstancePartition message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BackupInstancePartition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.BackupInstancePartition; - - /** - * Verifies a BackupInstancePartition message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BackupInstancePartition message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BackupInstancePartition - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.BackupInstancePartition; - - /** - * Creates a plain object from a BackupInstancePartition message. Also converts values to other types if specified. - * @param message BackupInstancePartition - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.BackupInstancePartition, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BackupInstancePartition to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BackupInstancePartition - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an OperationProgress. */ - interface IOperationProgress { - - /** OperationProgress progressPercent */ - progressPercent?: (number|null); - - /** OperationProgress startTime */ - startTime?: (google.protobuf.ITimestamp|null); - - /** OperationProgress endTime */ - endTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents an OperationProgress. */ - class OperationProgress implements IOperationProgress { - - /** - * Constructs a new OperationProgress. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IOperationProgress); - - /** OperationProgress progressPercent. */ - public progressPercent: number; - - /** OperationProgress startTime. */ - public startTime?: (google.protobuf.ITimestamp|null); - - /** OperationProgress endTime. */ - public endTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new OperationProgress instance using the specified properties. - * @param [properties] Properties to set - * @returns OperationProgress instance - */ - public static create(properties?: google.spanner.admin.database.v1.IOperationProgress): google.spanner.admin.database.v1.OperationProgress; - - /** - * Encodes the specified OperationProgress message. Does not implicitly {@link google.spanner.admin.database.v1.OperationProgress.verify|verify} messages. - * @param message OperationProgress message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IOperationProgress, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OperationProgress message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.OperationProgress.verify|verify} messages. - * @param message OperationProgress message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IOperationProgress, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OperationProgress message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OperationProgress - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.OperationProgress; - - /** - * Decodes an OperationProgress message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OperationProgress - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.OperationProgress; - - /** - * Verifies an OperationProgress message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an OperationProgress message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OperationProgress - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.OperationProgress; - - /** - * Creates a plain object from an OperationProgress message. Also converts values to other types if specified. - * @param message OperationProgress - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.OperationProgress, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OperationProgress to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for OperationProgress - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EncryptionConfig. */ - interface IEncryptionConfig { - - /** EncryptionConfig kmsKeyName */ - kmsKeyName?: (string|null); - - /** EncryptionConfig kmsKeyNames */ - kmsKeyNames?: (string[]|null); - } - - /** Represents an EncryptionConfig. */ - class EncryptionConfig implements IEncryptionConfig { - - /** - * Constructs a new EncryptionConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IEncryptionConfig); - - /** EncryptionConfig kmsKeyName. */ - public kmsKeyName: string; - - /** EncryptionConfig kmsKeyNames. */ - public kmsKeyNames: string[]; - - /** - * Creates a new EncryptionConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns EncryptionConfig instance - */ - public static create(properties?: google.spanner.admin.database.v1.IEncryptionConfig): google.spanner.admin.database.v1.EncryptionConfig; - - /** - * Encodes the specified EncryptionConfig message. Does not implicitly {@link google.spanner.admin.database.v1.EncryptionConfig.verify|verify} messages. - * @param message EncryptionConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IEncryptionConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EncryptionConfig message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.EncryptionConfig.verify|verify} messages. - * @param message EncryptionConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IEncryptionConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EncryptionConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EncryptionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.EncryptionConfig; - - /** - * Decodes an EncryptionConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EncryptionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.EncryptionConfig; - - /** - * Verifies an EncryptionConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EncryptionConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EncryptionConfig - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.EncryptionConfig; - - /** - * Creates a plain object from an EncryptionConfig message. Also converts values to other types if specified. - * @param message EncryptionConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.EncryptionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EncryptionConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EncryptionConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EncryptionInfo. */ - interface IEncryptionInfo { - - /** EncryptionInfo encryptionType */ - encryptionType?: (google.spanner.admin.database.v1.EncryptionInfo.Type|keyof typeof google.spanner.admin.database.v1.EncryptionInfo.Type|null); - - /** EncryptionInfo encryptionStatus */ - encryptionStatus?: (google.rpc.IStatus|null); - - /** EncryptionInfo kmsKeyVersion */ - kmsKeyVersion?: (string|null); - } - - /** Represents an EncryptionInfo. */ - class EncryptionInfo implements IEncryptionInfo { - - /** - * Constructs a new EncryptionInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IEncryptionInfo); - - /** EncryptionInfo encryptionType. */ - public encryptionType: (google.spanner.admin.database.v1.EncryptionInfo.Type|keyof typeof google.spanner.admin.database.v1.EncryptionInfo.Type); - - /** EncryptionInfo encryptionStatus. */ - public encryptionStatus?: (google.rpc.IStatus|null); - - /** EncryptionInfo kmsKeyVersion. */ - public kmsKeyVersion: string; - - /** - * Creates a new EncryptionInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns EncryptionInfo instance - */ - public static create(properties?: google.spanner.admin.database.v1.IEncryptionInfo): google.spanner.admin.database.v1.EncryptionInfo; - - /** - * Encodes the specified EncryptionInfo message. Does not implicitly {@link google.spanner.admin.database.v1.EncryptionInfo.verify|verify} messages. - * @param message EncryptionInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IEncryptionInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EncryptionInfo message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.EncryptionInfo.verify|verify} messages. - * @param message EncryptionInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IEncryptionInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EncryptionInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EncryptionInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.EncryptionInfo; - - /** - * Decodes an EncryptionInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EncryptionInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.EncryptionInfo; - - /** - * Verifies an EncryptionInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EncryptionInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EncryptionInfo - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.EncryptionInfo; - - /** - * Creates a plain object from an EncryptionInfo message. Also converts values to other types if specified. - * @param message EncryptionInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.EncryptionInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EncryptionInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EncryptionInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace EncryptionInfo { - - /** Type enum. */ - enum Type { - TYPE_UNSPECIFIED = 0, - GOOGLE_DEFAULT_ENCRYPTION = 1, - CUSTOMER_MANAGED_ENCRYPTION = 2 - } - } - - /** DatabaseDialect enum. */ - enum DatabaseDialect { - DATABASE_DIALECT_UNSPECIFIED = 0, - GOOGLE_STANDARD_SQL = 1, - POSTGRESQL = 2 - } - - /** Properties of a BackupScheduleSpec. */ - interface IBackupScheduleSpec { - - /** BackupScheduleSpec cronSpec */ - cronSpec?: (google.spanner.admin.database.v1.ICrontabSpec|null); - } - - /** Represents a BackupScheduleSpec. */ - class BackupScheduleSpec implements IBackupScheduleSpec { - - /** - * Constructs a new BackupScheduleSpec. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IBackupScheduleSpec); - - /** BackupScheduleSpec cronSpec. */ - public cronSpec?: (google.spanner.admin.database.v1.ICrontabSpec|null); - - /** BackupScheduleSpec scheduleSpec. */ - public scheduleSpec?: "cronSpec"; - - /** - * Creates a new BackupScheduleSpec instance using the specified properties. - * @param [properties] Properties to set - * @returns BackupScheduleSpec instance - */ - public static create(properties?: google.spanner.admin.database.v1.IBackupScheduleSpec): google.spanner.admin.database.v1.BackupScheduleSpec; - - /** - * Encodes the specified BackupScheduleSpec message. Does not implicitly {@link google.spanner.admin.database.v1.BackupScheduleSpec.verify|verify} messages. - * @param message BackupScheduleSpec message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IBackupScheduleSpec, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BackupScheduleSpec message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.BackupScheduleSpec.verify|verify} messages. - * @param message BackupScheduleSpec message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IBackupScheduleSpec, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BackupScheduleSpec message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BackupScheduleSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.BackupScheduleSpec; - - /** - * Decodes a BackupScheduleSpec message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BackupScheduleSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.BackupScheduleSpec; - - /** - * Verifies a BackupScheduleSpec message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BackupScheduleSpec message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BackupScheduleSpec - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.BackupScheduleSpec; - - /** - * Creates a plain object from a BackupScheduleSpec message. Also converts values to other types if specified. - * @param message BackupScheduleSpec - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.BackupScheduleSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BackupScheduleSpec to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BackupScheduleSpec - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BackupSchedule. */ - interface IBackupSchedule { - - /** BackupSchedule name */ - name?: (string|null); - - /** BackupSchedule spec */ - spec?: (google.spanner.admin.database.v1.IBackupScheduleSpec|null); - - /** BackupSchedule retentionDuration */ - retentionDuration?: (google.protobuf.IDuration|null); - - /** BackupSchedule encryptionConfig */ - encryptionConfig?: (google.spanner.admin.database.v1.ICreateBackupEncryptionConfig|null); - - /** BackupSchedule fullBackupSpec */ - fullBackupSpec?: (google.spanner.admin.database.v1.IFullBackupSpec|null); - - /** BackupSchedule incrementalBackupSpec */ - incrementalBackupSpec?: (google.spanner.admin.database.v1.IIncrementalBackupSpec|null); - - /** BackupSchedule updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a BackupSchedule. */ - class BackupSchedule implements IBackupSchedule { - - /** - * Constructs a new BackupSchedule. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IBackupSchedule); - - /** BackupSchedule name. */ - public name: string; - - /** BackupSchedule spec. */ - public spec?: (google.spanner.admin.database.v1.IBackupScheduleSpec|null); - - /** BackupSchedule retentionDuration. */ - public retentionDuration?: (google.protobuf.IDuration|null); - - /** BackupSchedule encryptionConfig. */ - public encryptionConfig?: (google.spanner.admin.database.v1.ICreateBackupEncryptionConfig|null); - - /** BackupSchedule fullBackupSpec. */ - public fullBackupSpec?: (google.spanner.admin.database.v1.IFullBackupSpec|null); - - /** BackupSchedule incrementalBackupSpec. */ - public incrementalBackupSpec?: (google.spanner.admin.database.v1.IIncrementalBackupSpec|null); - - /** BackupSchedule updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** BackupSchedule backupTypeSpec. */ - public backupTypeSpec?: ("fullBackupSpec"|"incrementalBackupSpec"); - - /** - * Creates a new BackupSchedule instance using the specified properties. - * @param [properties] Properties to set - * @returns BackupSchedule instance - */ - public static create(properties?: google.spanner.admin.database.v1.IBackupSchedule): google.spanner.admin.database.v1.BackupSchedule; - - /** - * Encodes the specified BackupSchedule message. Does not implicitly {@link google.spanner.admin.database.v1.BackupSchedule.verify|verify} messages. - * @param message BackupSchedule message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IBackupSchedule, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BackupSchedule message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.BackupSchedule.verify|verify} messages. - * @param message BackupSchedule message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IBackupSchedule, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BackupSchedule message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BackupSchedule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.BackupSchedule; - - /** - * Decodes a BackupSchedule message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BackupSchedule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.BackupSchedule; - - /** - * Verifies a BackupSchedule message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BackupSchedule message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BackupSchedule - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.BackupSchedule; - - /** - * Creates a plain object from a BackupSchedule message. Also converts values to other types if specified. - * @param message BackupSchedule - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.BackupSchedule, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BackupSchedule to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BackupSchedule - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CrontabSpec. */ - interface ICrontabSpec { - - /** CrontabSpec text */ - text?: (string|null); - - /** CrontabSpec timeZone */ - timeZone?: (string|null); - - /** CrontabSpec creationWindow */ - creationWindow?: (google.protobuf.IDuration|null); - } - - /** Represents a CrontabSpec. */ - class CrontabSpec implements ICrontabSpec { - - /** - * Constructs a new CrontabSpec. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.ICrontabSpec); - - /** CrontabSpec text. */ - public text: string; - - /** CrontabSpec timeZone. */ - public timeZone: string; - - /** CrontabSpec creationWindow. */ - public creationWindow?: (google.protobuf.IDuration|null); - - /** - * Creates a new CrontabSpec instance using the specified properties. - * @param [properties] Properties to set - * @returns CrontabSpec instance - */ - public static create(properties?: google.spanner.admin.database.v1.ICrontabSpec): google.spanner.admin.database.v1.CrontabSpec; - - /** - * Encodes the specified CrontabSpec message. Does not implicitly {@link google.spanner.admin.database.v1.CrontabSpec.verify|verify} messages. - * @param message CrontabSpec message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.ICrontabSpec, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CrontabSpec message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.CrontabSpec.verify|verify} messages. - * @param message CrontabSpec message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.ICrontabSpec, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CrontabSpec message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CrontabSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.CrontabSpec; - - /** - * Decodes a CrontabSpec message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CrontabSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.CrontabSpec; - - /** - * Verifies a CrontabSpec message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CrontabSpec message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CrontabSpec - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.CrontabSpec; - - /** - * Creates a plain object from a CrontabSpec message. Also converts values to other types if specified. - * @param message CrontabSpec - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.CrontabSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CrontabSpec to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CrontabSpec - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateBackupScheduleRequest. */ - interface ICreateBackupScheduleRequest { - - /** CreateBackupScheduleRequest parent */ - parent?: (string|null); - - /** CreateBackupScheduleRequest backupScheduleId */ - backupScheduleId?: (string|null); - - /** CreateBackupScheduleRequest backupSchedule */ - backupSchedule?: (google.spanner.admin.database.v1.IBackupSchedule|null); - } - - /** Represents a CreateBackupScheduleRequest. */ - class CreateBackupScheduleRequest implements ICreateBackupScheduleRequest { - - /** - * Constructs a new CreateBackupScheduleRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.ICreateBackupScheduleRequest); - - /** CreateBackupScheduleRequest parent. */ - public parent: string; - - /** CreateBackupScheduleRequest backupScheduleId. */ - public backupScheduleId: string; - - /** CreateBackupScheduleRequest backupSchedule. */ - public backupSchedule?: (google.spanner.admin.database.v1.IBackupSchedule|null); - - /** - * Creates a new CreateBackupScheduleRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateBackupScheduleRequest instance - */ - public static create(properties?: google.spanner.admin.database.v1.ICreateBackupScheduleRequest): google.spanner.admin.database.v1.CreateBackupScheduleRequest; - - /** - * Encodes the specified CreateBackupScheduleRequest message. Does not implicitly {@link google.spanner.admin.database.v1.CreateBackupScheduleRequest.verify|verify} messages. - * @param message CreateBackupScheduleRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.ICreateBackupScheduleRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateBackupScheduleRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.CreateBackupScheduleRequest.verify|verify} messages. - * @param message CreateBackupScheduleRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.ICreateBackupScheduleRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateBackupScheduleRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateBackupScheduleRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.CreateBackupScheduleRequest; - - /** - * Decodes a CreateBackupScheduleRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateBackupScheduleRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.CreateBackupScheduleRequest; - - /** - * Verifies a CreateBackupScheduleRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateBackupScheduleRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateBackupScheduleRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.CreateBackupScheduleRequest; - - /** - * Creates a plain object from a CreateBackupScheduleRequest message. Also converts values to other types if specified. - * @param message CreateBackupScheduleRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.CreateBackupScheduleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateBackupScheduleRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateBackupScheduleRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetBackupScheduleRequest. */ - interface IGetBackupScheduleRequest { - - /** GetBackupScheduleRequest name */ - name?: (string|null); - } - - /** Represents a GetBackupScheduleRequest. */ - class GetBackupScheduleRequest implements IGetBackupScheduleRequest { - - /** - * Constructs a new GetBackupScheduleRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IGetBackupScheduleRequest); - - /** GetBackupScheduleRequest name. */ - public name: string; - - /** - * Creates a new GetBackupScheduleRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetBackupScheduleRequest instance - */ - public static create(properties?: google.spanner.admin.database.v1.IGetBackupScheduleRequest): google.spanner.admin.database.v1.GetBackupScheduleRequest; - - /** - * Encodes the specified GetBackupScheduleRequest message. Does not implicitly {@link google.spanner.admin.database.v1.GetBackupScheduleRequest.verify|verify} messages. - * @param message GetBackupScheduleRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IGetBackupScheduleRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetBackupScheduleRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.GetBackupScheduleRequest.verify|verify} messages. - * @param message GetBackupScheduleRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IGetBackupScheduleRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetBackupScheduleRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetBackupScheduleRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.GetBackupScheduleRequest; - - /** - * Decodes a GetBackupScheduleRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetBackupScheduleRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.GetBackupScheduleRequest; - - /** - * Verifies a GetBackupScheduleRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetBackupScheduleRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetBackupScheduleRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.GetBackupScheduleRequest; - - /** - * Creates a plain object from a GetBackupScheduleRequest message. Also converts values to other types if specified. - * @param message GetBackupScheduleRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.GetBackupScheduleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetBackupScheduleRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetBackupScheduleRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteBackupScheduleRequest. */ - interface IDeleteBackupScheduleRequest { - - /** DeleteBackupScheduleRequest name */ - name?: (string|null); - } - - /** Represents a DeleteBackupScheduleRequest. */ - class DeleteBackupScheduleRequest implements IDeleteBackupScheduleRequest { - - /** - * Constructs a new DeleteBackupScheduleRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IDeleteBackupScheduleRequest); - - /** DeleteBackupScheduleRequest name. */ - public name: string; - - /** - * Creates a new DeleteBackupScheduleRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteBackupScheduleRequest instance - */ - public static create(properties?: google.spanner.admin.database.v1.IDeleteBackupScheduleRequest): google.spanner.admin.database.v1.DeleteBackupScheduleRequest; - - /** - * Encodes the specified DeleteBackupScheduleRequest message. Does not implicitly {@link google.spanner.admin.database.v1.DeleteBackupScheduleRequest.verify|verify} messages. - * @param message DeleteBackupScheduleRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IDeleteBackupScheduleRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteBackupScheduleRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.DeleteBackupScheduleRequest.verify|verify} messages. - * @param message DeleteBackupScheduleRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IDeleteBackupScheduleRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteBackupScheduleRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteBackupScheduleRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.DeleteBackupScheduleRequest; - - /** - * Decodes a DeleteBackupScheduleRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteBackupScheduleRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.DeleteBackupScheduleRequest; - - /** - * Verifies a DeleteBackupScheduleRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteBackupScheduleRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteBackupScheduleRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.DeleteBackupScheduleRequest; - - /** - * Creates a plain object from a DeleteBackupScheduleRequest message. Also converts values to other types if specified. - * @param message DeleteBackupScheduleRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.DeleteBackupScheduleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteBackupScheduleRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteBackupScheduleRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListBackupSchedulesRequest. */ - interface IListBackupSchedulesRequest { - - /** ListBackupSchedulesRequest parent */ - parent?: (string|null); - - /** ListBackupSchedulesRequest pageSize */ - pageSize?: (number|null); - - /** ListBackupSchedulesRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListBackupSchedulesRequest. */ - class ListBackupSchedulesRequest implements IListBackupSchedulesRequest { - - /** - * Constructs a new ListBackupSchedulesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IListBackupSchedulesRequest); - - /** ListBackupSchedulesRequest parent. */ - public parent: string; - - /** ListBackupSchedulesRequest pageSize. */ - public pageSize: number; - - /** ListBackupSchedulesRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListBackupSchedulesRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListBackupSchedulesRequest instance - */ - public static create(properties?: google.spanner.admin.database.v1.IListBackupSchedulesRequest): google.spanner.admin.database.v1.ListBackupSchedulesRequest; - - /** - * Encodes the specified ListBackupSchedulesRequest message. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupSchedulesRequest.verify|verify} messages. - * @param message ListBackupSchedulesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IListBackupSchedulesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListBackupSchedulesRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupSchedulesRequest.verify|verify} messages. - * @param message ListBackupSchedulesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IListBackupSchedulesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListBackupSchedulesRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListBackupSchedulesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.ListBackupSchedulesRequest; - - /** - * Decodes a ListBackupSchedulesRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListBackupSchedulesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.ListBackupSchedulesRequest; - - /** - * Verifies a ListBackupSchedulesRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListBackupSchedulesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListBackupSchedulesRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.ListBackupSchedulesRequest; - - /** - * Creates a plain object from a ListBackupSchedulesRequest message. Also converts values to other types if specified. - * @param message ListBackupSchedulesRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.ListBackupSchedulesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListBackupSchedulesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListBackupSchedulesRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListBackupSchedulesResponse. */ - interface IListBackupSchedulesResponse { - - /** ListBackupSchedulesResponse backupSchedules */ - backupSchedules?: (google.spanner.admin.database.v1.IBackupSchedule[]|null); - - /** ListBackupSchedulesResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListBackupSchedulesResponse. */ - class ListBackupSchedulesResponse implements IListBackupSchedulesResponse { - - /** - * Constructs a new ListBackupSchedulesResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IListBackupSchedulesResponse); - - /** ListBackupSchedulesResponse backupSchedules. */ - public backupSchedules: google.spanner.admin.database.v1.IBackupSchedule[]; - - /** ListBackupSchedulesResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListBackupSchedulesResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListBackupSchedulesResponse instance - */ - public static create(properties?: google.spanner.admin.database.v1.IListBackupSchedulesResponse): google.spanner.admin.database.v1.ListBackupSchedulesResponse; - - /** - * Encodes the specified ListBackupSchedulesResponse message. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupSchedulesResponse.verify|verify} messages. - * @param message ListBackupSchedulesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IListBackupSchedulesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListBackupSchedulesResponse message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupSchedulesResponse.verify|verify} messages. - * @param message ListBackupSchedulesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IListBackupSchedulesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListBackupSchedulesResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListBackupSchedulesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.ListBackupSchedulesResponse; - - /** - * Decodes a ListBackupSchedulesResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListBackupSchedulesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.ListBackupSchedulesResponse; - - /** - * Verifies a ListBackupSchedulesResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListBackupSchedulesResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListBackupSchedulesResponse - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.ListBackupSchedulesResponse; - - /** - * Creates a plain object from a ListBackupSchedulesResponse message. Also converts values to other types if specified. - * @param message ListBackupSchedulesResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.ListBackupSchedulesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListBackupSchedulesResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListBackupSchedulesResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateBackupScheduleRequest. */ - interface IUpdateBackupScheduleRequest { - - /** UpdateBackupScheduleRequest backupSchedule */ - backupSchedule?: (google.spanner.admin.database.v1.IBackupSchedule|null); - - /** UpdateBackupScheduleRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - } - - /** Represents an UpdateBackupScheduleRequest. */ - class UpdateBackupScheduleRequest implements IUpdateBackupScheduleRequest { - - /** - * Constructs a new UpdateBackupScheduleRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IUpdateBackupScheduleRequest); - - /** UpdateBackupScheduleRequest backupSchedule. */ - public backupSchedule?: (google.spanner.admin.database.v1.IBackupSchedule|null); - - /** UpdateBackupScheduleRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** - * Creates a new UpdateBackupScheduleRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateBackupScheduleRequest instance - */ - public static create(properties?: google.spanner.admin.database.v1.IUpdateBackupScheduleRequest): google.spanner.admin.database.v1.UpdateBackupScheduleRequest; - - /** - * Encodes the specified UpdateBackupScheduleRequest message. Does not implicitly {@link google.spanner.admin.database.v1.UpdateBackupScheduleRequest.verify|verify} messages. - * @param message UpdateBackupScheduleRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IUpdateBackupScheduleRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateBackupScheduleRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.UpdateBackupScheduleRequest.verify|verify} messages. - * @param message UpdateBackupScheduleRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IUpdateBackupScheduleRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateBackupScheduleRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateBackupScheduleRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.UpdateBackupScheduleRequest; - - /** - * Decodes an UpdateBackupScheduleRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateBackupScheduleRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.UpdateBackupScheduleRequest; - - /** - * Verifies an UpdateBackupScheduleRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UpdateBackupScheduleRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateBackupScheduleRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.UpdateBackupScheduleRequest; - - /** - * Creates a plain object from an UpdateBackupScheduleRequest message. Also converts values to other types if specified. - * @param message UpdateBackupScheduleRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.UpdateBackupScheduleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateBackupScheduleRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateBackupScheduleRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Represents a DatabaseAdmin */ - class DatabaseAdmin extends $protobuf.rpc.Service { - - /** - * Constructs a new DatabaseAdmin service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - - /** - * Creates new DatabaseAdmin 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): DatabaseAdmin; - - /** - * Calls ListDatabases. - * @param request ListDatabasesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListDatabasesResponse - */ - public listDatabases(request: google.spanner.admin.database.v1.IListDatabasesRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.ListDatabasesCallback): void; - - /** - * Calls ListDatabases. - * @param request ListDatabasesRequest message or plain object - * @returns Promise - */ - public listDatabases(request: google.spanner.admin.database.v1.IListDatabasesRequest): Promise; - - /** - * Calls CreateDatabase. - * @param request CreateDatabaseRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public createDatabase(request: google.spanner.admin.database.v1.ICreateDatabaseRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.CreateDatabaseCallback): void; - - /** - * Calls CreateDatabase. - * @param request CreateDatabaseRequest message or plain object - * @returns Promise - */ - public createDatabase(request: google.spanner.admin.database.v1.ICreateDatabaseRequest): Promise; - - /** - * Calls GetDatabase. - * @param request GetDatabaseRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Database - */ - public getDatabase(request: google.spanner.admin.database.v1.IGetDatabaseRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.GetDatabaseCallback): void; - - /** - * Calls GetDatabase. - * @param request GetDatabaseRequest message or plain object - * @returns Promise - */ - public getDatabase(request: google.spanner.admin.database.v1.IGetDatabaseRequest): Promise; - - /** - * Calls UpdateDatabase. - * @param request UpdateDatabaseRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public updateDatabase(request: google.spanner.admin.database.v1.IUpdateDatabaseRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseCallback): void; - - /** - * Calls UpdateDatabase. - * @param request UpdateDatabaseRequest message or plain object - * @returns Promise - */ - public updateDatabase(request: google.spanner.admin.database.v1.IUpdateDatabaseRequest): Promise; - - /** - * Calls UpdateDatabaseDdl. - * @param request UpdateDatabaseDdlRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public updateDatabaseDdl(request: google.spanner.admin.database.v1.IUpdateDatabaseDdlRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdlCallback): void; - - /** - * Calls UpdateDatabaseDdl. - * @param request UpdateDatabaseDdlRequest message or plain object - * @returns Promise - */ - public updateDatabaseDdl(request: google.spanner.admin.database.v1.IUpdateDatabaseDdlRequest): Promise; - - /** - * Calls DropDatabase. - * @param request DropDatabaseRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public dropDatabase(request: google.spanner.admin.database.v1.IDropDatabaseRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.DropDatabaseCallback): void; - - /** - * Calls DropDatabase. - * @param request DropDatabaseRequest message or plain object - * @returns Promise - */ - public dropDatabase(request: google.spanner.admin.database.v1.IDropDatabaseRequest): Promise; - - /** - * Calls GetDatabaseDdl. - * @param request GetDatabaseDdlRequest message or plain object - * @param callback Node-style callback called with the error, if any, and GetDatabaseDdlResponse - */ - public getDatabaseDdl(request: google.spanner.admin.database.v1.IGetDatabaseDdlRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.GetDatabaseDdlCallback): void; - - /** - * Calls GetDatabaseDdl. - * @param request GetDatabaseDdlRequest message or plain object - * @returns Promise - */ - public getDatabaseDdl(request: google.spanner.admin.database.v1.IGetDatabaseDdlRequest): Promise; - - /** - * Calls SetIamPolicy. - * @param request SetIamPolicyRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Policy - */ - public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.SetIamPolicyCallback): void; - - /** - * Calls SetIamPolicy. - * @param request SetIamPolicyRequest message or plain object - * @returns Promise - */ - public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest): Promise; - - /** - * Calls GetIamPolicy. - * @param request GetIamPolicyRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Policy - */ - public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.GetIamPolicyCallback): void; - - /** - * Calls GetIamPolicy. - * @param request GetIamPolicyRequest message or plain object - * @returns Promise - */ - public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest): Promise; - - /** - * Calls TestIamPermissions. - * @param request TestIamPermissionsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and TestIamPermissionsResponse - */ - public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.TestIamPermissionsCallback): void; - - /** - * Calls TestIamPermissions. - * @param request TestIamPermissionsRequest message or plain object - * @returns Promise - */ - public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest): Promise; - - /** - * Calls CreateBackup. - * @param request CreateBackupRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public createBackup(request: google.spanner.admin.database.v1.ICreateBackupRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.CreateBackupCallback): void; - - /** - * Calls CreateBackup. - * @param request CreateBackupRequest message or plain object - * @returns Promise - */ - public createBackup(request: google.spanner.admin.database.v1.ICreateBackupRequest): Promise; - - /** - * Calls CopyBackup. - * @param request CopyBackupRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public copyBackup(request: google.spanner.admin.database.v1.ICopyBackupRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.CopyBackupCallback): void; - - /** - * Calls CopyBackup. - * @param request CopyBackupRequest message or plain object - * @returns Promise - */ - public copyBackup(request: google.spanner.admin.database.v1.ICopyBackupRequest): Promise; - - /** - * Calls GetBackup. - * @param request GetBackupRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Backup - */ - public getBackup(request: google.spanner.admin.database.v1.IGetBackupRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.GetBackupCallback): void; - - /** - * Calls GetBackup. - * @param request GetBackupRequest message or plain object - * @returns Promise - */ - public getBackup(request: google.spanner.admin.database.v1.IGetBackupRequest): Promise; - - /** - * Calls UpdateBackup. - * @param request UpdateBackupRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Backup - */ - public updateBackup(request: google.spanner.admin.database.v1.IUpdateBackupRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.UpdateBackupCallback): void; - - /** - * Calls UpdateBackup. - * @param request UpdateBackupRequest message or plain object - * @returns Promise - */ - public updateBackup(request: google.spanner.admin.database.v1.IUpdateBackupRequest): Promise; - - /** - * Calls DeleteBackup. - * @param request DeleteBackupRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteBackup(request: google.spanner.admin.database.v1.IDeleteBackupRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.DeleteBackupCallback): void; - - /** - * Calls DeleteBackup. - * @param request DeleteBackupRequest message or plain object - * @returns Promise - */ - public deleteBackup(request: google.spanner.admin.database.v1.IDeleteBackupRequest): Promise; - - /** - * Calls ListBackups. - * @param request ListBackupsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListBackupsResponse - */ - public listBackups(request: google.spanner.admin.database.v1.IListBackupsRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.ListBackupsCallback): void; - - /** - * Calls ListBackups. - * @param request ListBackupsRequest message or plain object - * @returns Promise - */ - public listBackups(request: google.spanner.admin.database.v1.IListBackupsRequest): Promise; - - /** - * Calls RestoreDatabase. - * @param request RestoreDatabaseRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public restoreDatabase(request: google.spanner.admin.database.v1.IRestoreDatabaseRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.RestoreDatabaseCallback): void; - - /** - * Calls RestoreDatabase. - * @param request RestoreDatabaseRequest message or plain object - * @returns Promise - */ - public restoreDatabase(request: google.spanner.admin.database.v1.IRestoreDatabaseRequest): Promise; - - /** - * Calls ListDatabaseOperations. - * @param request ListDatabaseOperationsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListDatabaseOperationsResponse - */ - public listDatabaseOperations(request: google.spanner.admin.database.v1.IListDatabaseOperationsRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.ListDatabaseOperationsCallback): void; - - /** - * Calls ListDatabaseOperations. - * @param request ListDatabaseOperationsRequest message or plain object - * @returns Promise - */ - public listDatabaseOperations(request: google.spanner.admin.database.v1.IListDatabaseOperationsRequest): Promise; - - /** - * Calls ListBackupOperations. - * @param request ListBackupOperationsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListBackupOperationsResponse - */ - public listBackupOperations(request: google.spanner.admin.database.v1.IListBackupOperationsRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.ListBackupOperationsCallback): void; - - /** - * Calls ListBackupOperations. - * @param request ListBackupOperationsRequest message or plain object - * @returns Promise - */ - public listBackupOperations(request: google.spanner.admin.database.v1.IListBackupOperationsRequest): Promise; - - /** - * Calls ListDatabaseRoles. - * @param request ListDatabaseRolesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListDatabaseRolesResponse - */ - public listDatabaseRoles(request: google.spanner.admin.database.v1.IListDatabaseRolesRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.ListDatabaseRolesCallback): void; - - /** - * Calls ListDatabaseRoles. - * @param request ListDatabaseRolesRequest message or plain object - * @returns Promise - */ - public listDatabaseRoles(request: google.spanner.admin.database.v1.IListDatabaseRolesRequest): Promise; - - /** - * Calls AddSplitPoints. - * @param request AddSplitPointsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and AddSplitPointsResponse - */ - public addSplitPoints(request: google.spanner.admin.database.v1.IAddSplitPointsRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.AddSplitPointsCallback): void; - - /** - * Calls AddSplitPoints. - * @param request AddSplitPointsRequest message or plain object - * @returns Promise - */ - public addSplitPoints(request: google.spanner.admin.database.v1.IAddSplitPointsRequest): Promise; - - /** - * Calls CreateBackupSchedule. - * @param request CreateBackupScheduleRequest message or plain object - * @param callback Node-style callback called with the error, if any, and BackupSchedule - */ - public createBackupSchedule(request: google.spanner.admin.database.v1.ICreateBackupScheduleRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.CreateBackupScheduleCallback): void; - - /** - * Calls CreateBackupSchedule. - * @param request CreateBackupScheduleRequest message or plain object - * @returns Promise - */ - public createBackupSchedule(request: google.spanner.admin.database.v1.ICreateBackupScheduleRequest): Promise; - - /** - * Calls GetBackupSchedule. - * @param request GetBackupScheduleRequest message or plain object - * @param callback Node-style callback called with the error, if any, and BackupSchedule - */ - public getBackupSchedule(request: google.spanner.admin.database.v1.IGetBackupScheduleRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.GetBackupScheduleCallback): void; - - /** - * Calls GetBackupSchedule. - * @param request GetBackupScheduleRequest message or plain object - * @returns Promise - */ - public getBackupSchedule(request: google.spanner.admin.database.v1.IGetBackupScheduleRequest): Promise; - - /** - * Calls UpdateBackupSchedule. - * @param request UpdateBackupScheduleRequest message or plain object - * @param callback Node-style callback called with the error, if any, and BackupSchedule - */ - public updateBackupSchedule(request: google.spanner.admin.database.v1.IUpdateBackupScheduleRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.UpdateBackupScheduleCallback): void; - - /** - * Calls UpdateBackupSchedule. - * @param request UpdateBackupScheduleRequest message or plain object - * @returns Promise - */ - public updateBackupSchedule(request: google.spanner.admin.database.v1.IUpdateBackupScheduleRequest): Promise; - - /** - * Calls DeleteBackupSchedule. - * @param request DeleteBackupScheduleRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteBackupSchedule(request: google.spanner.admin.database.v1.IDeleteBackupScheduleRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.DeleteBackupScheduleCallback): void; - - /** - * Calls DeleteBackupSchedule. - * @param request DeleteBackupScheduleRequest message or plain object - * @returns Promise - */ - public deleteBackupSchedule(request: google.spanner.admin.database.v1.IDeleteBackupScheduleRequest): Promise; - - /** - * Calls ListBackupSchedules. - * @param request ListBackupSchedulesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListBackupSchedulesResponse - */ - public listBackupSchedules(request: google.spanner.admin.database.v1.IListBackupSchedulesRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.ListBackupSchedulesCallback): void; - - /** - * Calls ListBackupSchedules. - * @param request ListBackupSchedulesRequest message or plain object - * @returns Promise - */ - public listBackupSchedules(request: google.spanner.admin.database.v1.IListBackupSchedulesRequest): Promise; - - /** - * Calls InternalUpdateGraphOperation. - * @param request InternalUpdateGraphOperationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and InternalUpdateGraphOperationResponse - */ - public internalUpdateGraphOperation(request: google.spanner.admin.database.v1.IInternalUpdateGraphOperationRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.InternalUpdateGraphOperationCallback): void; - - /** - * Calls InternalUpdateGraphOperation. - * @param request InternalUpdateGraphOperationRequest message or plain object - * @returns Promise - */ - public internalUpdateGraphOperation(request: google.spanner.admin.database.v1.IInternalUpdateGraphOperationRequest): Promise; - } - - namespace DatabaseAdmin { - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|listDatabases}. - * @param error Error, if any - * @param [response] ListDatabasesResponse - */ - type ListDatabasesCallback = (error: (Error|null), response?: google.spanner.admin.database.v1.ListDatabasesResponse) => void; - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|createDatabase}. - * @param error Error, if any - * @param [response] Operation - */ - type CreateDatabaseCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|getDatabase}. - * @param error Error, if any - * @param [response] Database - */ - type GetDatabaseCallback = (error: (Error|null), response?: google.spanner.admin.database.v1.Database) => void; - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|updateDatabase}. - * @param error Error, if any - * @param [response] Operation - */ - type UpdateDatabaseCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|updateDatabaseDdl}. - * @param error Error, if any - * @param [response] Operation - */ - type UpdateDatabaseDdlCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|dropDatabase}. - * @param error Error, if any - * @param [response] Empty - */ - type DropDatabaseCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|getDatabaseDdl}. - * @param error Error, if any - * @param [response] GetDatabaseDdlResponse - */ - type GetDatabaseDdlCallback = (error: (Error|null), response?: google.spanner.admin.database.v1.GetDatabaseDdlResponse) => void; - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|setIamPolicy}. - * @param error Error, if any - * @param [response] Policy - */ - type SetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|getIamPolicy}. - * @param error Error, if any - * @param [response] Policy - */ - type GetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|testIamPermissions}. - * @param error Error, if any - * @param [response] TestIamPermissionsResponse - */ - type TestIamPermissionsCallback = (error: (Error|null), response?: google.iam.v1.TestIamPermissionsResponse) => void; - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|createBackup}. - * @param error Error, if any - * @param [response] Operation - */ - type CreateBackupCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|copyBackup}. - * @param error Error, if any - * @param [response] Operation - */ - type CopyBackupCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|getBackup}. - * @param error Error, if any - * @param [response] Backup - */ - type GetBackupCallback = (error: (Error|null), response?: google.spanner.admin.database.v1.Backup) => void; - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|updateBackup}. - * @param error Error, if any - * @param [response] Backup - */ - type UpdateBackupCallback = (error: (Error|null), response?: google.spanner.admin.database.v1.Backup) => void; - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|deleteBackup}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteBackupCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|listBackups}. - * @param error Error, if any - * @param [response] ListBackupsResponse - */ - type ListBackupsCallback = (error: (Error|null), response?: google.spanner.admin.database.v1.ListBackupsResponse) => void; - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|restoreDatabase}. - * @param error Error, if any - * @param [response] Operation - */ - type RestoreDatabaseCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|listDatabaseOperations}. - * @param error Error, if any - * @param [response] ListDatabaseOperationsResponse - */ - type ListDatabaseOperationsCallback = (error: (Error|null), response?: google.spanner.admin.database.v1.ListDatabaseOperationsResponse) => void; - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|listBackupOperations}. - * @param error Error, if any - * @param [response] ListBackupOperationsResponse - */ - type ListBackupOperationsCallback = (error: (Error|null), response?: google.spanner.admin.database.v1.ListBackupOperationsResponse) => void; - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|listDatabaseRoles}. - * @param error Error, if any - * @param [response] ListDatabaseRolesResponse - */ - type ListDatabaseRolesCallback = (error: (Error|null), response?: google.spanner.admin.database.v1.ListDatabaseRolesResponse) => void; - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|addSplitPoints}. - * @param error Error, if any - * @param [response] AddSplitPointsResponse - */ - type AddSplitPointsCallback = (error: (Error|null), response?: google.spanner.admin.database.v1.AddSplitPointsResponse) => void; - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|createBackupSchedule}. - * @param error Error, if any - * @param [response] BackupSchedule - */ - type CreateBackupScheduleCallback = (error: (Error|null), response?: google.spanner.admin.database.v1.BackupSchedule) => void; - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|getBackupSchedule}. - * @param error Error, if any - * @param [response] BackupSchedule - */ - type GetBackupScheduleCallback = (error: (Error|null), response?: google.spanner.admin.database.v1.BackupSchedule) => void; - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|updateBackupSchedule}. - * @param error Error, if any - * @param [response] BackupSchedule - */ - type UpdateBackupScheduleCallback = (error: (Error|null), response?: google.spanner.admin.database.v1.BackupSchedule) => void; - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|deleteBackupSchedule}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteBackupScheduleCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|listBackupSchedules}. - * @param error Error, if any - * @param [response] ListBackupSchedulesResponse - */ - type ListBackupSchedulesCallback = (error: (Error|null), response?: google.spanner.admin.database.v1.ListBackupSchedulesResponse) => void; - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|internalUpdateGraphOperation}. - * @param error Error, if any - * @param [response] InternalUpdateGraphOperationResponse - */ - type InternalUpdateGraphOperationCallback = (error: (Error|null), response?: google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse) => void; - } - - /** Properties of a RestoreInfo. */ - interface IRestoreInfo { - - /** RestoreInfo sourceType */ - sourceType?: (google.spanner.admin.database.v1.RestoreSourceType|keyof typeof google.spanner.admin.database.v1.RestoreSourceType|null); - - /** RestoreInfo backupInfo */ - backupInfo?: (google.spanner.admin.database.v1.IBackupInfo|null); - } - - /** Represents a RestoreInfo. */ - class RestoreInfo implements IRestoreInfo { - - /** - * Constructs a new RestoreInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IRestoreInfo); - - /** RestoreInfo sourceType. */ - public sourceType: (google.spanner.admin.database.v1.RestoreSourceType|keyof typeof google.spanner.admin.database.v1.RestoreSourceType); - - /** RestoreInfo backupInfo. */ - public backupInfo?: (google.spanner.admin.database.v1.IBackupInfo|null); - - /** RestoreInfo sourceInfo. */ - public sourceInfo?: "backupInfo"; - - /** - * Creates a new RestoreInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns RestoreInfo instance - */ - public static create(properties?: google.spanner.admin.database.v1.IRestoreInfo): google.spanner.admin.database.v1.RestoreInfo; - - /** - * Encodes the specified RestoreInfo message. Does not implicitly {@link google.spanner.admin.database.v1.RestoreInfo.verify|verify} messages. - * @param message RestoreInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IRestoreInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RestoreInfo message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.RestoreInfo.verify|verify} messages. - * @param message RestoreInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IRestoreInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RestoreInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RestoreInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.RestoreInfo; - - /** - * Decodes a RestoreInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RestoreInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.RestoreInfo; - - /** - * Verifies a RestoreInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RestoreInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RestoreInfo - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.RestoreInfo; - - /** - * Creates a plain object from a RestoreInfo message. Also converts values to other types if specified. - * @param message RestoreInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.RestoreInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RestoreInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RestoreInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Database. */ - interface IDatabase { - - /** Database name */ - name?: (string|null); - - /** Database state */ - state?: (google.spanner.admin.database.v1.Database.State|keyof typeof google.spanner.admin.database.v1.Database.State|null); - - /** Database createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** Database restoreInfo */ - restoreInfo?: (google.spanner.admin.database.v1.IRestoreInfo|null); - - /** Database encryptionConfig */ - encryptionConfig?: (google.spanner.admin.database.v1.IEncryptionConfig|null); - - /** Database encryptionInfo */ - encryptionInfo?: (google.spanner.admin.database.v1.IEncryptionInfo[]|null); - - /** Database versionRetentionPeriod */ - versionRetentionPeriod?: (string|null); - - /** Database earliestVersionTime */ - earliestVersionTime?: (google.protobuf.ITimestamp|null); - - /** Database defaultLeader */ - defaultLeader?: (string|null); - - /** Database databaseDialect */ - databaseDialect?: (google.spanner.admin.database.v1.DatabaseDialect|keyof typeof google.spanner.admin.database.v1.DatabaseDialect|null); - - /** Database enableDropProtection */ - enableDropProtection?: (boolean|null); - - /** Database reconciling */ - reconciling?: (boolean|null); - } - - /** Represents a Database. */ - class Database implements IDatabase { - - /** - * Constructs a new Database. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IDatabase); - - /** Database name. */ - public name: string; - - /** Database state. */ - public state: (google.spanner.admin.database.v1.Database.State|keyof typeof google.spanner.admin.database.v1.Database.State); - - /** Database createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** Database restoreInfo. */ - public restoreInfo?: (google.spanner.admin.database.v1.IRestoreInfo|null); - - /** Database encryptionConfig. */ - public encryptionConfig?: (google.spanner.admin.database.v1.IEncryptionConfig|null); - - /** Database encryptionInfo. */ - public encryptionInfo: google.spanner.admin.database.v1.IEncryptionInfo[]; - - /** Database versionRetentionPeriod. */ - public versionRetentionPeriod: string; - - /** Database earliestVersionTime. */ - public earliestVersionTime?: (google.protobuf.ITimestamp|null); - - /** Database defaultLeader. */ - public defaultLeader: string; - - /** Database databaseDialect. */ - public databaseDialect: (google.spanner.admin.database.v1.DatabaseDialect|keyof typeof google.spanner.admin.database.v1.DatabaseDialect); - - /** Database enableDropProtection. */ - public enableDropProtection: boolean; - - /** Database reconciling. */ - public reconciling: boolean; - - /** - * Creates a new Database instance using the specified properties. - * @param [properties] Properties to set - * @returns Database instance - */ - public static create(properties?: google.spanner.admin.database.v1.IDatabase): google.spanner.admin.database.v1.Database; - - /** - * Encodes the specified Database message. Does not implicitly {@link google.spanner.admin.database.v1.Database.verify|verify} messages. - * @param message Database message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IDatabase, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Database message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.Database.verify|verify} messages. - * @param message Database message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IDatabase, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Database message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Database - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.Database; - - /** - * Decodes a Database message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Database - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.Database; - - /** - * Verifies a Database message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Database message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Database - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.Database; - - /** - * Creates a plain object from a Database message. Also converts values to other types if specified. - * @param message Database - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.Database, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Database to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Database - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Database { - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - CREATING = 1, - READY = 2, - READY_OPTIMIZING = 3 - } - } - - /** Properties of a ListDatabasesRequest. */ - interface IListDatabasesRequest { - - /** ListDatabasesRequest parent */ - parent?: (string|null); - - /** ListDatabasesRequest pageSize */ - pageSize?: (number|null); - - /** ListDatabasesRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListDatabasesRequest. */ - class ListDatabasesRequest implements IListDatabasesRequest { - - /** - * Constructs a new ListDatabasesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IListDatabasesRequest); - - /** ListDatabasesRequest parent. */ - public parent: string; - - /** ListDatabasesRequest pageSize. */ - public pageSize: number; - - /** ListDatabasesRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListDatabasesRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListDatabasesRequest instance - */ - public static create(properties?: google.spanner.admin.database.v1.IListDatabasesRequest): google.spanner.admin.database.v1.ListDatabasesRequest; - - /** - * Encodes the specified ListDatabasesRequest message. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabasesRequest.verify|verify} messages. - * @param message ListDatabasesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IListDatabasesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListDatabasesRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabasesRequest.verify|verify} messages. - * @param message ListDatabasesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IListDatabasesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListDatabasesRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListDatabasesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.ListDatabasesRequest; - - /** - * Decodes a ListDatabasesRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListDatabasesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.ListDatabasesRequest; - - /** - * Verifies a ListDatabasesRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListDatabasesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListDatabasesRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.ListDatabasesRequest; - - /** - * Creates a plain object from a ListDatabasesRequest message. Also converts values to other types if specified. - * @param message ListDatabasesRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.ListDatabasesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListDatabasesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListDatabasesRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListDatabasesResponse. */ - interface IListDatabasesResponse { - - /** ListDatabasesResponse databases */ - databases?: (google.spanner.admin.database.v1.IDatabase[]|null); - - /** ListDatabasesResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListDatabasesResponse. */ - class ListDatabasesResponse implements IListDatabasesResponse { - - /** - * Constructs a new ListDatabasesResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IListDatabasesResponse); - - /** ListDatabasesResponse databases. */ - public databases: google.spanner.admin.database.v1.IDatabase[]; - - /** ListDatabasesResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListDatabasesResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListDatabasesResponse instance - */ - public static create(properties?: google.spanner.admin.database.v1.IListDatabasesResponse): google.spanner.admin.database.v1.ListDatabasesResponse; - - /** - * Encodes the specified ListDatabasesResponse message. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabasesResponse.verify|verify} messages. - * @param message ListDatabasesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IListDatabasesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListDatabasesResponse message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabasesResponse.verify|verify} messages. - * @param message ListDatabasesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IListDatabasesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListDatabasesResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListDatabasesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.ListDatabasesResponse; - - /** - * Decodes a ListDatabasesResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListDatabasesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.ListDatabasesResponse; - - /** - * Verifies a ListDatabasesResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListDatabasesResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListDatabasesResponse - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.ListDatabasesResponse; - - /** - * Creates a plain object from a ListDatabasesResponse message. Also converts values to other types if specified. - * @param message ListDatabasesResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.ListDatabasesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListDatabasesResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListDatabasesResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateDatabaseRequest. */ - interface ICreateDatabaseRequest { - - /** CreateDatabaseRequest parent */ - parent?: (string|null); - - /** CreateDatabaseRequest createStatement */ - createStatement?: (string|null); - - /** CreateDatabaseRequest extraStatements */ - extraStatements?: (string[]|null); - - /** CreateDatabaseRequest encryptionConfig */ - encryptionConfig?: (google.spanner.admin.database.v1.IEncryptionConfig|null); - - /** CreateDatabaseRequest databaseDialect */ - databaseDialect?: (google.spanner.admin.database.v1.DatabaseDialect|keyof typeof google.spanner.admin.database.v1.DatabaseDialect|null); - - /** CreateDatabaseRequest protoDescriptors */ - protoDescriptors?: (Uint8Array|Buffer|string|null); - } - - /** Represents a CreateDatabaseRequest. */ - class CreateDatabaseRequest implements ICreateDatabaseRequest { - - /** - * Constructs a new CreateDatabaseRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.ICreateDatabaseRequest); - - /** CreateDatabaseRequest parent. */ - public parent: string; - - /** CreateDatabaseRequest createStatement. */ - public createStatement: string; - - /** CreateDatabaseRequest extraStatements. */ - public extraStatements: string[]; - - /** CreateDatabaseRequest encryptionConfig. */ - public encryptionConfig?: (google.spanner.admin.database.v1.IEncryptionConfig|null); - - /** CreateDatabaseRequest databaseDialect. */ - public databaseDialect: (google.spanner.admin.database.v1.DatabaseDialect|keyof typeof google.spanner.admin.database.v1.DatabaseDialect); - - /** CreateDatabaseRequest protoDescriptors. */ - public protoDescriptors: (Uint8Array|Buffer|string); - - /** - * Creates a new CreateDatabaseRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateDatabaseRequest instance - */ - public static create(properties?: google.spanner.admin.database.v1.ICreateDatabaseRequest): google.spanner.admin.database.v1.CreateDatabaseRequest; - - /** - * Encodes the specified CreateDatabaseRequest message. Does not implicitly {@link google.spanner.admin.database.v1.CreateDatabaseRequest.verify|verify} messages. - * @param message CreateDatabaseRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.ICreateDatabaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateDatabaseRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.CreateDatabaseRequest.verify|verify} messages. - * @param message CreateDatabaseRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.ICreateDatabaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateDatabaseRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateDatabaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.CreateDatabaseRequest; - - /** - * Decodes a CreateDatabaseRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateDatabaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.CreateDatabaseRequest; - - /** - * Verifies a CreateDatabaseRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateDatabaseRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateDatabaseRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.CreateDatabaseRequest; - - /** - * Creates a plain object from a CreateDatabaseRequest message. Also converts values to other types if specified. - * @param message CreateDatabaseRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.CreateDatabaseRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateDatabaseRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateDatabaseRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateDatabaseMetadata. */ - interface ICreateDatabaseMetadata { - - /** CreateDatabaseMetadata database */ - database?: (string|null); - } - - /** Represents a CreateDatabaseMetadata. */ - class CreateDatabaseMetadata implements ICreateDatabaseMetadata { - - /** - * Constructs a new CreateDatabaseMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.ICreateDatabaseMetadata); - - /** CreateDatabaseMetadata database. */ - public database: string; - - /** - * Creates a new CreateDatabaseMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateDatabaseMetadata instance - */ - public static create(properties?: google.spanner.admin.database.v1.ICreateDatabaseMetadata): google.spanner.admin.database.v1.CreateDatabaseMetadata; - - /** - * Encodes the specified CreateDatabaseMetadata message. Does not implicitly {@link google.spanner.admin.database.v1.CreateDatabaseMetadata.verify|verify} messages. - * @param message CreateDatabaseMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.ICreateDatabaseMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateDatabaseMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.CreateDatabaseMetadata.verify|verify} messages. - * @param message CreateDatabaseMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.ICreateDatabaseMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateDatabaseMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateDatabaseMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.CreateDatabaseMetadata; - - /** - * Decodes a CreateDatabaseMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateDatabaseMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.CreateDatabaseMetadata; - - /** - * Verifies a CreateDatabaseMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateDatabaseMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateDatabaseMetadata - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.CreateDatabaseMetadata; - - /** - * Creates a plain object from a CreateDatabaseMetadata message. Also converts values to other types if specified. - * @param message CreateDatabaseMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.CreateDatabaseMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateDatabaseMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateDatabaseMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetDatabaseRequest. */ - interface IGetDatabaseRequest { - - /** GetDatabaseRequest name */ - name?: (string|null); - } - - /** Represents a GetDatabaseRequest. */ - class GetDatabaseRequest implements IGetDatabaseRequest { - - /** - * Constructs a new GetDatabaseRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IGetDatabaseRequest); - - /** GetDatabaseRequest name. */ - public name: string; - - /** - * Creates a new GetDatabaseRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetDatabaseRequest instance - */ - public static create(properties?: google.spanner.admin.database.v1.IGetDatabaseRequest): google.spanner.admin.database.v1.GetDatabaseRequest; - - /** - * Encodes the specified GetDatabaseRequest message. Does not implicitly {@link google.spanner.admin.database.v1.GetDatabaseRequest.verify|verify} messages. - * @param message GetDatabaseRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IGetDatabaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetDatabaseRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.GetDatabaseRequest.verify|verify} messages. - * @param message GetDatabaseRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IGetDatabaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetDatabaseRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetDatabaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.GetDatabaseRequest; - - /** - * Decodes a GetDatabaseRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetDatabaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.GetDatabaseRequest; - - /** - * Verifies a GetDatabaseRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetDatabaseRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetDatabaseRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.GetDatabaseRequest; - - /** - * Creates a plain object from a GetDatabaseRequest message. Also converts values to other types if specified. - * @param message GetDatabaseRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.GetDatabaseRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetDatabaseRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetDatabaseRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateDatabaseRequest. */ - interface IUpdateDatabaseRequest { - - /** UpdateDatabaseRequest database */ - database?: (google.spanner.admin.database.v1.IDatabase|null); - - /** UpdateDatabaseRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - } - - /** Represents an UpdateDatabaseRequest. */ - class UpdateDatabaseRequest implements IUpdateDatabaseRequest { - - /** - * Constructs a new UpdateDatabaseRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IUpdateDatabaseRequest); - - /** UpdateDatabaseRequest database. */ - public database?: (google.spanner.admin.database.v1.IDatabase|null); - - /** UpdateDatabaseRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** - * Creates a new UpdateDatabaseRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateDatabaseRequest instance - */ - public static create(properties?: google.spanner.admin.database.v1.IUpdateDatabaseRequest): google.spanner.admin.database.v1.UpdateDatabaseRequest; - - /** - * Encodes the specified UpdateDatabaseRequest message. Does not implicitly {@link google.spanner.admin.database.v1.UpdateDatabaseRequest.verify|verify} messages. - * @param message UpdateDatabaseRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IUpdateDatabaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateDatabaseRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.UpdateDatabaseRequest.verify|verify} messages. - * @param message UpdateDatabaseRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IUpdateDatabaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateDatabaseRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateDatabaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.UpdateDatabaseRequest; - - /** - * Decodes an UpdateDatabaseRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateDatabaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.UpdateDatabaseRequest; - - /** - * Verifies an UpdateDatabaseRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UpdateDatabaseRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateDatabaseRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.UpdateDatabaseRequest; - - /** - * Creates a plain object from an UpdateDatabaseRequest message. Also converts values to other types if specified. - * @param message UpdateDatabaseRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.UpdateDatabaseRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateDatabaseRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateDatabaseRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateDatabaseMetadata. */ - interface IUpdateDatabaseMetadata { - - /** UpdateDatabaseMetadata request */ - request?: (google.spanner.admin.database.v1.IUpdateDatabaseRequest|null); - - /** UpdateDatabaseMetadata progress */ - progress?: (google.spanner.admin.database.v1.IOperationProgress|null); - - /** UpdateDatabaseMetadata cancelTime */ - cancelTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents an UpdateDatabaseMetadata. */ - class UpdateDatabaseMetadata implements IUpdateDatabaseMetadata { - - /** - * Constructs a new UpdateDatabaseMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IUpdateDatabaseMetadata); - - /** UpdateDatabaseMetadata request. */ - public request?: (google.spanner.admin.database.v1.IUpdateDatabaseRequest|null); - - /** UpdateDatabaseMetadata progress. */ - public progress?: (google.spanner.admin.database.v1.IOperationProgress|null); - - /** UpdateDatabaseMetadata cancelTime. */ - public cancelTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new UpdateDatabaseMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateDatabaseMetadata instance - */ - public static create(properties?: google.spanner.admin.database.v1.IUpdateDatabaseMetadata): google.spanner.admin.database.v1.UpdateDatabaseMetadata; - - /** - * Encodes the specified UpdateDatabaseMetadata message. Does not implicitly {@link google.spanner.admin.database.v1.UpdateDatabaseMetadata.verify|verify} messages. - * @param message UpdateDatabaseMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IUpdateDatabaseMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateDatabaseMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.UpdateDatabaseMetadata.verify|verify} messages. - * @param message UpdateDatabaseMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IUpdateDatabaseMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateDatabaseMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateDatabaseMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.UpdateDatabaseMetadata; - - /** - * Decodes an UpdateDatabaseMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateDatabaseMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.UpdateDatabaseMetadata; - - /** - * Verifies an UpdateDatabaseMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UpdateDatabaseMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateDatabaseMetadata - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.UpdateDatabaseMetadata; - - /** - * Creates a plain object from an UpdateDatabaseMetadata message. Also converts values to other types if specified. - * @param message UpdateDatabaseMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.UpdateDatabaseMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateDatabaseMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateDatabaseMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateDatabaseDdlRequest. */ - interface IUpdateDatabaseDdlRequest { - - /** UpdateDatabaseDdlRequest database */ - database?: (string|null); - - /** UpdateDatabaseDdlRequest statements */ - statements?: (string[]|null); - - /** UpdateDatabaseDdlRequest operationId */ - operationId?: (string|null); - - /** UpdateDatabaseDdlRequest protoDescriptors */ - protoDescriptors?: (Uint8Array|Buffer|string|null); - - /** UpdateDatabaseDdlRequest throughputMode */ - throughputMode?: (boolean|null); - } - - /** Represents an UpdateDatabaseDdlRequest. */ - class UpdateDatabaseDdlRequest implements IUpdateDatabaseDdlRequest { - - /** - * Constructs a new UpdateDatabaseDdlRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IUpdateDatabaseDdlRequest); - - /** UpdateDatabaseDdlRequest database. */ - public database: string; - - /** UpdateDatabaseDdlRequest statements. */ - public statements: string[]; - - /** UpdateDatabaseDdlRequest operationId. */ - public operationId: string; - - /** UpdateDatabaseDdlRequest protoDescriptors. */ - public protoDescriptors: (Uint8Array|Buffer|string); - - /** UpdateDatabaseDdlRequest throughputMode. */ - public throughputMode: boolean; - - /** - * Creates a new UpdateDatabaseDdlRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateDatabaseDdlRequest instance - */ - public static create(properties?: google.spanner.admin.database.v1.IUpdateDatabaseDdlRequest): google.spanner.admin.database.v1.UpdateDatabaseDdlRequest; - - /** - * Encodes the specified UpdateDatabaseDdlRequest message. Does not implicitly {@link google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.verify|verify} messages. - * @param message UpdateDatabaseDdlRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IUpdateDatabaseDdlRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateDatabaseDdlRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.verify|verify} messages. - * @param message UpdateDatabaseDdlRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IUpdateDatabaseDdlRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateDatabaseDdlRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateDatabaseDdlRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.UpdateDatabaseDdlRequest; - - /** - * Decodes an UpdateDatabaseDdlRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateDatabaseDdlRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.UpdateDatabaseDdlRequest; - - /** - * Verifies an UpdateDatabaseDdlRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UpdateDatabaseDdlRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateDatabaseDdlRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.UpdateDatabaseDdlRequest; - - /** - * Creates a plain object from an UpdateDatabaseDdlRequest message. Also converts values to other types if specified. - * @param message UpdateDatabaseDdlRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.UpdateDatabaseDdlRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateDatabaseDdlRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateDatabaseDdlRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DdlStatementActionInfo. */ - interface IDdlStatementActionInfo { - - /** DdlStatementActionInfo action */ - action?: (string|null); - - /** DdlStatementActionInfo entityType */ - entityType?: (string|null); - - /** DdlStatementActionInfo entityNames */ - entityNames?: (string[]|null); - } - - /** Represents a DdlStatementActionInfo. */ - class DdlStatementActionInfo implements IDdlStatementActionInfo { - - /** - * Constructs a new DdlStatementActionInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IDdlStatementActionInfo); - - /** DdlStatementActionInfo action. */ - public action: string; - - /** DdlStatementActionInfo entityType. */ - public entityType: string; - - /** DdlStatementActionInfo entityNames. */ - public entityNames: string[]; - - /** - * Creates a new DdlStatementActionInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns DdlStatementActionInfo instance - */ - public static create(properties?: google.spanner.admin.database.v1.IDdlStatementActionInfo): google.spanner.admin.database.v1.DdlStatementActionInfo; - - /** - * Encodes the specified DdlStatementActionInfo message. Does not implicitly {@link google.spanner.admin.database.v1.DdlStatementActionInfo.verify|verify} messages. - * @param message DdlStatementActionInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IDdlStatementActionInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DdlStatementActionInfo message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.DdlStatementActionInfo.verify|verify} messages. - * @param message DdlStatementActionInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IDdlStatementActionInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DdlStatementActionInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DdlStatementActionInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.DdlStatementActionInfo; - - /** - * Decodes a DdlStatementActionInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DdlStatementActionInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.DdlStatementActionInfo; - - /** - * Verifies a DdlStatementActionInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DdlStatementActionInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DdlStatementActionInfo - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.DdlStatementActionInfo; - - /** - * Creates a plain object from a DdlStatementActionInfo message. Also converts values to other types if specified. - * @param message DdlStatementActionInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.DdlStatementActionInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DdlStatementActionInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DdlStatementActionInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateDatabaseDdlMetadata. */ - interface IUpdateDatabaseDdlMetadata { - - /** UpdateDatabaseDdlMetadata database */ - database?: (string|null); - - /** UpdateDatabaseDdlMetadata statements */ - statements?: (string[]|null); - - /** UpdateDatabaseDdlMetadata commitTimestamps */ - commitTimestamps?: (google.protobuf.ITimestamp[]|null); - - /** UpdateDatabaseDdlMetadata throttled */ - throttled?: (boolean|null); - - /** UpdateDatabaseDdlMetadata progress */ - progress?: (google.spanner.admin.database.v1.IOperationProgress[]|null); - - /** UpdateDatabaseDdlMetadata actions */ - actions?: (google.spanner.admin.database.v1.IDdlStatementActionInfo[]|null); - } - - /** Represents an UpdateDatabaseDdlMetadata. */ - class UpdateDatabaseDdlMetadata implements IUpdateDatabaseDdlMetadata { - - /** - * Constructs a new UpdateDatabaseDdlMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IUpdateDatabaseDdlMetadata); - - /** UpdateDatabaseDdlMetadata database. */ - public database: string; - - /** UpdateDatabaseDdlMetadata statements. */ - public statements: string[]; - - /** UpdateDatabaseDdlMetadata commitTimestamps. */ - public commitTimestamps: google.protobuf.ITimestamp[]; - - /** UpdateDatabaseDdlMetadata throttled. */ - public throttled: boolean; - - /** UpdateDatabaseDdlMetadata progress. */ - public progress: google.spanner.admin.database.v1.IOperationProgress[]; - - /** UpdateDatabaseDdlMetadata actions. */ - public actions: google.spanner.admin.database.v1.IDdlStatementActionInfo[]; - - /** - * Creates a new UpdateDatabaseDdlMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateDatabaseDdlMetadata instance - */ - public static create(properties?: google.spanner.admin.database.v1.IUpdateDatabaseDdlMetadata): google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata; - - /** - * Encodes the specified UpdateDatabaseDdlMetadata message. Does not implicitly {@link google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata.verify|verify} messages. - * @param message UpdateDatabaseDdlMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IUpdateDatabaseDdlMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateDatabaseDdlMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata.verify|verify} messages. - * @param message UpdateDatabaseDdlMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IUpdateDatabaseDdlMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateDatabaseDdlMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateDatabaseDdlMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata; - - /** - * Decodes an UpdateDatabaseDdlMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateDatabaseDdlMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata; - - /** - * Verifies an UpdateDatabaseDdlMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UpdateDatabaseDdlMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateDatabaseDdlMetadata - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata; - - /** - * Creates a plain object from an UpdateDatabaseDdlMetadata message. Also converts values to other types if specified. - * @param message UpdateDatabaseDdlMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateDatabaseDdlMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateDatabaseDdlMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DropDatabaseRequest. */ - interface IDropDatabaseRequest { - - /** DropDatabaseRequest database */ - database?: (string|null); - } - - /** Represents a DropDatabaseRequest. */ - class DropDatabaseRequest implements IDropDatabaseRequest { - - /** - * Constructs a new DropDatabaseRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IDropDatabaseRequest); - - /** DropDatabaseRequest database. */ - public database: string; - - /** - * Creates a new DropDatabaseRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DropDatabaseRequest instance - */ - public static create(properties?: google.spanner.admin.database.v1.IDropDatabaseRequest): google.spanner.admin.database.v1.DropDatabaseRequest; - - /** - * Encodes the specified DropDatabaseRequest message. Does not implicitly {@link google.spanner.admin.database.v1.DropDatabaseRequest.verify|verify} messages. - * @param message DropDatabaseRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IDropDatabaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DropDatabaseRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.DropDatabaseRequest.verify|verify} messages. - * @param message DropDatabaseRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IDropDatabaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DropDatabaseRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DropDatabaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.DropDatabaseRequest; - - /** - * Decodes a DropDatabaseRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DropDatabaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.DropDatabaseRequest; - - /** - * Verifies a DropDatabaseRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DropDatabaseRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DropDatabaseRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.DropDatabaseRequest; - - /** - * Creates a plain object from a DropDatabaseRequest message. Also converts values to other types if specified. - * @param message DropDatabaseRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.DropDatabaseRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DropDatabaseRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DropDatabaseRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetDatabaseDdlRequest. */ - interface IGetDatabaseDdlRequest { - - /** GetDatabaseDdlRequest database */ - database?: (string|null); - } - - /** Represents a GetDatabaseDdlRequest. */ - class GetDatabaseDdlRequest implements IGetDatabaseDdlRequest { - - /** - * Constructs a new GetDatabaseDdlRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IGetDatabaseDdlRequest); - - /** GetDatabaseDdlRequest database. */ - public database: string; - - /** - * Creates a new GetDatabaseDdlRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetDatabaseDdlRequest instance - */ - public static create(properties?: google.spanner.admin.database.v1.IGetDatabaseDdlRequest): google.spanner.admin.database.v1.GetDatabaseDdlRequest; - - /** - * Encodes the specified GetDatabaseDdlRequest message. Does not implicitly {@link google.spanner.admin.database.v1.GetDatabaseDdlRequest.verify|verify} messages. - * @param message GetDatabaseDdlRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IGetDatabaseDdlRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetDatabaseDdlRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.GetDatabaseDdlRequest.verify|verify} messages. - * @param message GetDatabaseDdlRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IGetDatabaseDdlRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetDatabaseDdlRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetDatabaseDdlRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.GetDatabaseDdlRequest; - - /** - * Decodes a GetDatabaseDdlRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetDatabaseDdlRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.GetDatabaseDdlRequest; - - /** - * Verifies a GetDatabaseDdlRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetDatabaseDdlRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetDatabaseDdlRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.GetDatabaseDdlRequest; - - /** - * Creates a plain object from a GetDatabaseDdlRequest message. Also converts values to other types if specified. - * @param message GetDatabaseDdlRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.GetDatabaseDdlRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetDatabaseDdlRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetDatabaseDdlRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetDatabaseDdlResponse. */ - interface IGetDatabaseDdlResponse { - - /** GetDatabaseDdlResponse statements */ - statements?: (string[]|null); - - /** GetDatabaseDdlResponse protoDescriptors */ - protoDescriptors?: (Uint8Array|Buffer|string|null); - } - - /** Represents a GetDatabaseDdlResponse. */ - class GetDatabaseDdlResponse implements IGetDatabaseDdlResponse { - - /** - * Constructs a new GetDatabaseDdlResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IGetDatabaseDdlResponse); - - /** GetDatabaseDdlResponse statements. */ - public statements: string[]; - - /** GetDatabaseDdlResponse protoDescriptors. */ - public protoDescriptors: (Uint8Array|Buffer|string); - - /** - * Creates a new GetDatabaseDdlResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns GetDatabaseDdlResponse instance - */ - public static create(properties?: google.spanner.admin.database.v1.IGetDatabaseDdlResponse): google.spanner.admin.database.v1.GetDatabaseDdlResponse; - - /** - * Encodes the specified GetDatabaseDdlResponse message. Does not implicitly {@link google.spanner.admin.database.v1.GetDatabaseDdlResponse.verify|verify} messages. - * @param message GetDatabaseDdlResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IGetDatabaseDdlResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetDatabaseDdlResponse message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.GetDatabaseDdlResponse.verify|verify} messages. - * @param message GetDatabaseDdlResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IGetDatabaseDdlResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetDatabaseDdlResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetDatabaseDdlResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.GetDatabaseDdlResponse; - - /** - * Decodes a GetDatabaseDdlResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetDatabaseDdlResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.GetDatabaseDdlResponse; - - /** - * Verifies a GetDatabaseDdlResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetDatabaseDdlResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetDatabaseDdlResponse - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.GetDatabaseDdlResponse; - - /** - * Creates a plain object from a GetDatabaseDdlResponse message. Also converts values to other types if specified. - * @param message GetDatabaseDdlResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.GetDatabaseDdlResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetDatabaseDdlResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetDatabaseDdlResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListDatabaseOperationsRequest. */ - interface IListDatabaseOperationsRequest { - - /** ListDatabaseOperationsRequest parent */ - parent?: (string|null); - - /** ListDatabaseOperationsRequest filter */ - filter?: (string|null); - - /** ListDatabaseOperationsRequest pageSize */ - pageSize?: (number|null); - - /** ListDatabaseOperationsRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListDatabaseOperationsRequest. */ - class ListDatabaseOperationsRequest implements IListDatabaseOperationsRequest { - - /** - * Constructs a new ListDatabaseOperationsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IListDatabaseOperationsRequest); - - /** ListDatabaseOperationsRequest parent. */ - public parent: string; - - /** ListDatabaseOperationsRequest filter. */ - public filter: string; - - /** ListDatabaseOperationsRequest pageSize. */ - public pageSize: number; - - /** ListDatabaseOperationsRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListDatabaseOperationsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListDatabaseOperationsRequest instance - */ - public static create(properties?: google.spanner.admin.database.v1.IListDatabaseOperationsRequest): google.spanner.admin.database.v1.ListDatabaseOperationsRequest; - - /** - * Encodes the specified ListDatabaseOperationsRequest message. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabaseOperationsRequest.verify|verify} messages. - * @param message ListDatabaseOperationsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IListDatabaseOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListDatabaseOperationsRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabaseOperationsRequest.verify|verify} messages. - * @param message ListDatabaseOperationsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IListDatabaseOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListDatabaseOperationsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListDatabaseOperationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.ListDatabaseOperationsRequest; - - /** - * Decodes a ListDatabaseOperationsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListDatabaseOperationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.ListDatabaseOperationsRequest; - - /** - * Verifies a ListDatabaseOperationsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListDatabaseOperationsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListDatabaseOperationsRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.ListDatabaseOperationsRequest; - - /** - * Creates a plain object from a ListDatabaseOperationsRequest message. Also converts values to other types if specified. - * @param message ListDatabaseOperationsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.ListDatabaseOperationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListDatabaseOperationsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListDatabaseOperationsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListDatabaseOperationsResponse. */ - interface IListDatabaseOperationsResponse { - - /** ListDatabaseOperationsResponse operations */ - operations?: (google.longrunning.IOperation[]|null); - - /** ListDatabaseOperationsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListDatabaseOperationsResponse. */ - class ListDatabaseOperationsResponse implements IListDatabaseOperationsResponse { - - /** - * Constructs a new ListDatabaseOperationsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IListDatabaseOperationsResponse); - - /** ListDatabaseOperationsResponse operations. */ - public operations: google.longrunning.IOperation[]; - - /** ListDatabaseOperationsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListDatabaseOperationsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListDatabaseOperationsResponse instance - */ - public static create(properties?: google.spanner.admin.database.v1.IListDatabaseOperationsResponse): google.spanner.admin.database.v1.ListDatabaseOperationsResponse; - - /** - * Encodes the specified ListDatabaseOperationsResponse message. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabaseOperationsResponse.verify|verify} messages. - * @param message ListDatabaseOperationsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IListDatabaseOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListDatabaseOperationsResponse message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabaseOperationsResponse.verify|verify} messages. - * @param message ListDatabaseOperationsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IListDatabaseOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListDatabaseOperationsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListDatabaseOperationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.ListDatabaseOperationsResponse; - - /** - * Decodes a ListDatabaseOperationsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListDatabaseOperationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.ListDatabaseOperationsResponse; - - /** - * Verifies a ListDatabaseOperationsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListDatabaseOperationsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListDatabaseOperationsResponse - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.ListDatabaseOperationsResponse; - - /** - * Creates a plain object from a ListDatabaseOperationsResponse message. Also converts values to other types if specified. - * @param message ListDatabaseOperationsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.ListDatabaseOperationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListDatabaseOperationsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListDatabaseOperationsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RestoreDatabaseRequest. */ - interface IRestoreDatabaseRequest { - - /** RestoreDatabaseRequest parent */ - parent?: (string|null); - - /** RestoreDatabaseRequest databaseId */ - databaseId?: (string|null); - - /** RestoreDatabaseRequest backup */ - backup?: (string|null); - - /** RestoreDatabaseRequest encryptionConfig */ - encryptionConfig?: (google.spanner.admin.database.v1.IRestoreDatabaseEncryptionConfig|null); - } - - /** Represents a RestoreDatabaseRequest. */ - class RestoreDatabaseRequest implements IRestoreDatabaseRequest { - - /** - * Constructs a new RestoreDatabaseRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IRestoreDatabaseRequest); - - /** RestoreDatabaseRequest parent. */ - public parent: string; - - /** RestoreDatabaseRequest databaseId. */ - public databaseId: string; - - /** RestoreDatabaseRequest backup. */ - public backup?: (string|null); - - /** RestoreDatabaseRequest encryptionConfig. */ - public encryptionConfig?: (google.spanner.admin.database.v1.IRestoreDatabaseEncryptionConfig|null); - - /** RestoreDatabaseRequest source. */ - public source?: "backup"; - - /** - * Creates a new RestoreDatabaseRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns RestoreDatabaseRequest instance - */ - public static create(properties?: google.spanner.admin.database.v1.IRestoreDatabaseRequest): google.spanner.admin.database.v1.RestoreDatabaseRequest; - - /** - * Encodes the specified RestoreDatabaseRequest message. Does not implicitly {@link google.spanner.admin.database.v1.RestoreDatabaseRequest.verify|verify} messages. - * @param message RestoreDatabaseRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IRestoreDatabaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RestoreDatabaseRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.RestoreDatabaseRequest.verify|verify} messages. - * @param message RestoreDatabaseRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IRestoreDatabaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RestoreDatabaseRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RestoreDatabaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.RestoreDatabaseRequest; - - /** - * Decodes a RestoreDatabaseRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RestoreDatabaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.RestoreDatabaseRequest; - - /** - * Verifies a RestoreDatabaseRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RestoreDatabaseRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RestoreDatabaseRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.RestoreDatabaseRequest; - - /** - * Creates a plain object from a RestoreDatabaseRequest message. Also converts values to other types if specified. - * @param message RestoreDatabaseRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.RestoreDatabaseRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RestoreDatabaseRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RestoreDatabaseRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RestoreDatabaseEncryptionConfig. */ - interface IRestoreDatabaseEncryptionConfig { - - /** RestoreDatabaseEncryptionConfig encryptionType */ - encryptionType?: (google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.EncryptionType|keyof typeof google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.EncryptionType|null); - - /** RestoreDatabaseEncryptionConfig kmsKeyName */ - kmsKeyName?: (string|null); - - /** RestoreDatabaseEncryptionConfig kmsKeyNames */ - kmsKeyNames?: (string[]|null); - } - - /** Represents a RestoreDatabaseEncryptionConfig. */ - class RestoreDatabaseEncryptionConfig implements IRestoreDatabaseEncryptionConfig { - - /** - * Constructs a new RestoreDatabaseEncryptionConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IRestoreDatabaseEncryptionConfig); - - /** RestoreDatabaseEncryptionConfig encryptionType. */ - public encryptionType: (google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.EncryptionType|keyof typeof google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.EncryptionType); - - /** RestoreDatabaseEncryptionConfig kmsKeyName. */ - public kmsKeyName: string; - - /** RestoreDatabaseEncryptionConfig kmsKeyNames. */ - public kmsKeyNames: string[]; - - /** - * Creates a new RestoreDatabaseEncryptionConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns RestoreDatabaseEncryptionConfig instance - */ - public static create(properties?: google.spanner.admin.database.v1.IRestoreDatabaseEncryptionConfig): google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig; - - /** - * Encodes the specified RestoreDatabaseEncryptionConfig message. Does not implicitly {@link google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.verify|verify} messages. - * @param message RestoreDatabaseEncryptionConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IRestoreDatabaseEncryptionConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RestoreDatabaseEncryptionConfig message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.verify|verify} messages. - * @param message RestoreDatabaseEncryptionConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IRestoreDatabaseEncryptionConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RestoreDatabaseEncryptionConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RestoreDatabaseEncryptionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig; - - /** - * Decodes a RestoreDatabaseEncryptionConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RestoreDatabaseEncryptionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig; - - /** - * Verifies a RestoreDatabaseEncryptionConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RestoreDatabaseEncryptionConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RestoreDatabaseEncryptionConfig - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig; - - /** - * Creates a plain object from a RestoreDatabaseEncryptionConfig message. Also converts values to other types if specified. - * @param message RestoreDatabaseEncryptionConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RestoreDatabaseEncryptionConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RestoreDatabaseEncryptionConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace RestoreDatabaseEncryptionConfig { - - /** EncryptionType enum. */ - enum EncryptionType { - ENCRYPTION_TYPE_UNSPECIFIED = 0, - USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION = 1, - GOOGLE_DEFAULT_ENCRYPTION = 2, - CUSTOMER_MANAGED_ENCRYPTION = 3 - } - } - - /** Properties of a RestoreDatabaseMetadata. */ - interface IRestoreDatabaseMetadata { - - /** RestoreDatabaseMetadata name */ - name?: (string|null); - - /** RestoreDatabaseMetadata sourceType */ - sourceType?: (google.spanner.admin.database.v1.RestoreSourceType|keyof typeof google.spanner.admin.database.v1.RestoreSourceType|null); - - /** RestoreDatabaseMetadata backupInfo */ - backupInfo?: (google.spanner.admin.database.v1.IBackupInfo|null); - - /** RestoreDatabaseMetadata progress */ - progress?: (google.spanner.admin.database.v1.IOperationProgress|null); - - /** RestoreDatabaseMetadata cancelTime */ - cancelTime?: (google.protobuf.ITimestamp|null); - - /** RestoreDatabaseMetadata optimizeDatabaseOperationName */ - optimizeDatabaseOperationName?: (string|null); - } - - /** Represents a RestoreDatabaseMetadata. */ - class RestoreDatabaseMetadata implements IRestoreDatabaseMetadata { - - /** - * Constructs a new RestoreDatabaseMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IRestoreDatabaseMetadata); - - /** RestoreDatabaseMetadata name. */ - public name: string; - - /** RestoreDatabaseMetadata sourceType. */ - public sourceType: (google.spanner.admin.database.v1.RestoreSourceType|keyof typeof google.spanner.admin.database.v1.RestoreSourceType); - - /** RestoreDatabaseMetadata backupInfo. */ - public backupInfo?: (google.spanner.admin.database.v1.IBackupInfo|null); - - /** RestoreDatabaseMetadata progress. */ - public progress?: (google.spanner.admin.database.v1.IOperationProgress|null); - - /** RestoreDatabaseMetadata cancelTime. */ - public cancelTime?: (google.protobuf.ITimestamp|null); - - /** RestoreDatabaseMetadata optimizeDatabaseOperationName. */ - public optimizeDatabaseOperationName: string; - - /** RestoreDatabaseMetadata sourceInfo. */ - public sourceInfo?: "backupInfo"; - - /** - * Creates a new RestoreDatabaseMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns RestoreDatabaseMetadata instance - */ - public static create(properties?: google.spanner.admin.database.v1.IRestoreDatabaseMetadata): google.spanner.admin.database.v1.RestoreDatabaseMetadata; - - /** - * Encodes the specified RestoreDatabaseMetadata message. Does not implicitly {@link google.spanner.admin.database.v1.RestoreDatabaseMetadata.verify|verify} messages. - * @param message RestoreDatabaseMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IRestoreDatabaseMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RestoreDatabaseMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.RestoreDatabaseMetadata.verify|verify} messages. - * @param message RestoreDatabaseMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IRestoreDatabaseMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RestoreDatabaseMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RestoreDatabaseMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.RestoreDatabaseMetadata; - - /** - * Decodes a RestoreDatabaseMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RestoreDatabaseMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.RestoreDatabaseMetadata; - - /** - * Verifies a RestoreDatabaseMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RestoreDatabaseMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RestoreDatabaseMetadata - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.RestoreDatabaseMetadata; - - /** - * Creates a plain object from a RestoreDatabaseMetadata message. Also converts values to other types if specified. - * @param message RestoreDatabaseMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.RestoreDatabaseMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RestoreDatabaseMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RestoreDatabaseMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an OptimizeRestoredDatabaseMetadata. */ - interface IOptimizeRestoredDatabaseMetadata { - - /** OptimizeRestoredDatabaseMetadata name */ - name?: (string|null); - - /** OptimizeRestoredDatabaseMetadata progress */ - progress?: (google.spanner.admin.database.v1.IOperationProgress|null); - } - - /** Represents an OptimizeRestoredDatabaseMetadata. */ - class OptimizeRestoredDatabaseMetadata implements IOptimizeRestoredDatabaseMetadata { - - /** - * Constructs a new OptimizeRestoredDatabaseMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IOptimizeRestoredDatabaseMetadata); - - /** OptimizeRestoredDatabaseMetadata name. */ - public name: string; - - /** OptimizeRestoredDatabaseMetadata progress. */ - public progress?: (google.spanner.admin.database.v1.IOperationProgress|null); - - /** - * Creates a new OptimizeRestoredDatabaseMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns OptimizeRestoredDatabaseMetadata instance - */ - public static create(properties?: google.spanner.admin.database.v1.IOptimizeRestoredDatabaseMetadata): google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata; - - /** - * Encodes the specified OptimizeRestoredDatabaseMetadata message. Does not implicitly {@link google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata.verify|verify} messages. - * @param message OptimizeRestoredDatabaseMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IOptimizeRestoredDatabaseMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OptimizeRestoredDatabaseMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata.verify|verify} messages. - * @param message OptimizeRestoredDatabaseMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IOptimizeRestoredDatabaseMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OptimizeRestoredDatabaseMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OptimizeRestoredDatabaseMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata; - - /** - * Decodes an OptimizeRestoredDatabaseMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OptimizeRestoredDatabaseMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata; - - /** - * Verifies an OptimizeRestoredDatabaseMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an OptimizeRestoredDatabaseMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OptimizeRestoredDatabaseMetadata - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata; - - /** - * Creates a plain object from an OptimizeRestoredDatabaseMetadata message. Also converts values to other types if specified. - * @param message OptimizeRestoredDatabaseMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OptimizeRestoredDatabaseMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for OptimizeRestoredDatabaseMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** RestoreSourceType enum. */ - enum RestoreSourceType { - TYPE_UNSPECIFIED = 0, - BACKUP = 1 - } - - /** Properties of a DatabaseRole. */ - interface IDatabaseRole { - - /** DatabaseRole name */ - name?: (string|null); - } - - /** Represents a DatabaseRole. */ - class DatabaseRole implements IDatabaseRole { - - /** - * Constructs a new DatabaseRole. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IDatabaseRole); - - /** DatabaseRole name. */ - public name: string; - - /** - * Creates a new DatabaseRole instance using the specified properties. - * @param [properties] Properties to set - * @returns DatabaseRole instance - */ - public static create(properties?: google.spanner.admin.database.v1.IDatabaseRole): google.spanner.admin.database.v1.DatabaseRole; - - /** - * Encodes the specified DatabaseRole message. Does not implicitly {@link google.spanner.admin.database.v1.DatabaseRole.verify|verify} messages. - * @param message DatabaseRole message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IDatabaseRole, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DatabaseRole message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.DatabaseRole.verify|verify} messages. - * @param message DatabaseRole message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IDatabaseRole, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DatabaseRole message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DatabaseRole - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.DatabaseRole; - - /** - * Decodes a DatabaseRole message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DatabaseRole - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.DatabaseRole; - - /** - * Verifies a DatabaseRole message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DatabaseRole message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DatabaseRole - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.DatabaseRole; - - /** - * Creates a plain object from a DatabaseRole message. Also converts values to other types if specified. - * @param message DatabaseRole - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.DatabaseRole, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DatabaseRole to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DatabaseRole - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListDatabaseRolesRequest. */ - interface IListDatabaseRolesRequest { - - /** ListDatabaseRolesRequest parent */ - parent?: (string|null); - - /** ListDatabaseRolesRequest pageSize */ - pageSize?: (number|null); - - /** ListDatabaseRolesRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListDatabaseRolesRequest. */ - class ListDatabaseRolesRequest implements IListDatabaseRolesRequest { - - /** - * Constructs a new ListDatabaseRolesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IListDatabaseRolesRequest); - - /** ListDatabaseRolesRequest parent. */ - public parent: string; - - /** ListDatabaseRolesRequest pageSize. */ - public pageSize: number; - - /** ListDatabaseRolesRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListDatabaseRolesRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListDatabaseRolesRequest instance - */ - public static create(properties?: google.spanner.admin.database.v1.IListDatabaseRolesRequest): google.spanner.admin.database.v1.ListDatabaseRolesRequest; - - /** - * Encodes the specified ListDatabaseRolesRequest message. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabaseRolesRequest.verify|verify} messages. - * @param message ListDatabaseRolesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IListDatabaseRolesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListDatabaseRolesRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabaseRolesRequest.verify|verify} messages. - * @param message ListDatabaseRolesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IListDatabaseRolesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListDatabaseRolesRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListDatabaseRolesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.ListDatabaseRolesRequest; - - /** - * Decodes a ListDatabaseRolesRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListDatabaseRolesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.ListDatabaseRolesRequest; - - /** - * Verifies a ListDatabaseRolesRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListDatabaseRolesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListDatabaseRolesRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.ListDatabaseRolesRequest; - - /** - * Creates a plain object from a ListDatabaseRolesRequest message. Also converts values to other types if specified. - * @param message ListDatabaseRolesRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.ListDatabaseRolesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListDatabaseRolesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListDatabaseRolesRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListDatabaseRolesResponse. */ - interface IListDatabaseRolesResponse { - - /** ListDatabaseRolesResponse databaseRoles */ - databaseRoles?: (google.spanner.admin.database.v1.IDatabaseRole[]|null); - - /** ListDatabaseRolesResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListDatabaseRolesResponse. */ - class ListDatabaseRolesResponse implements IListDatabaseRolesResponse { - - /** - * Constructs a new ListDatabaseRolesResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IListDatabaseRolesResponse); - - /** ListDatabaseRolesResponse databaseRoles. */ - public databaseRoles: google.spanner.admin.database.v1.IDatabaseRole[]; - - /** ListDatabaseRolesResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListDatabaseRolesResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListDatabaseRolesResponse instance - */ - public static create(properties?: google.spanner.admin.database.v1.IListDatabaseRolesResponse): google.spanner.admin.database.v1.ListDatabaseRolesResponse; - - /** - * Encodes the specified ListDatabaseRolesResponse message. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabaseRolesResponse.verify|verify} messages. - * @param message ListDatabaseRolesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IListDatabaseRolesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListDatabaseRolesResponse message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabaseRolesResponse.verify|verify} messages. - * @param message ListDatabaseRolesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IListDatabaseRolesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListDatabaseRolesResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListDatabaseRolesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.ListDatabaseRolesResponse; - - /** - * Decodes a ListDatabaseRolesResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListDatabaseRolesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.ListDatabaseRolesResponse; - - /** - * Verifies a ListDatabaseRolesResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListDatabaseRolesResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListDatabaseRolesResponse - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.ListDatabaseRolesResponse; - - /** - * Creates a plain object from a ListDatabaseRolesResponse message. Also converts values to other types if specified. - * @param message ListDatabaseRolesResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.ListDatabaseRolesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListDatabaseRolesResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListDatabaseRolesResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an AddSplitPointsRequest. */ - interface IAddSplitPointsRequest { - - /** AddSplitPointsRequest database */ - database?: (string|null); - - /** AddSplitPointsRequest splitPoints */ - splitPoints?: (google.spanner.admin.database.v1.ISplitPoints[]|null); - - /** AddSplitPointsRequest initiator */ - initiator?: (string|null); - } - - /** Represents an AddSplitPointsRequest. */ - class AddSplitPointsRequest implements IAddSplitPointsRequest { - - /** - * Constructs a new AddSplitPointsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IAddSplitPointsRequest); - - /** AddSplitPointsRequest database. */ - public database: string; - - /** AddSplitPointsRequest splitPoints. */ - public splitPoints: google.spanner.admin.database.v1.ISplitPoints[]; - - /** AddSplitPointsRequest initiator. */ - public initiator: string; - - /** - * Creates a new AddSplitPointsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns AddSplitPointsRequest instance - */ - public static create(properties?: google.spanner.admin.database.v1.IAddSplitPointsRequest): google.spanner.admin.database.v1.AddSplitPointsRequest; - - /** - * Encodes the specified AddSplitPointsRequest message. Does not implicitly {@link google.spanner.admin.database.v1.AddSplitPointsRequest.verify|verify} messages. - * @param message AddSplitPointsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IAddSplitPointsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AddSplitPointsRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.AddSplitPointsRequest.verify|verify} messages. - * @param message AddSplitPointsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IAddSplitPointsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AddSplitPointsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AddSplitPointsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.AddSplitPointsRequest; - - /** - * Decodes an AddSplitPointsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AddSplitPointsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.AddSplitPointsRequest; - - /** - * Verifies an AddSplitPointsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an AddSplitPointsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AddSplitPointsRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.AddSplitPointsRequest; - - /** - * Creates a plain object from an AddSplitPointsRequest message. Also converts values to other types if specified. - * @param message AddSplitPointsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.AddSplitPointsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AddSplitPointsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AddSplitPointsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an AddSplitPointsResponse. */ - interface IAddSplitPointsResponse { - } - - /** Represents an AddSplitPointsResponse. */ - class AddSplitPointsResponse implements IAddSplitPointsResponse { - - /** - * Constructs a new AddSplitPointsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IAddSplitPointsResponse); - - /** - * Creates a new AddSplitPointsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns AddSplitPointsResponse instance - */ - public static create(properties?: google.spanner.admin.database.v1.IAddSplitPointsResponse): google.spanner.admin.database.v1.AddSplitPointsResponse; - - /** - * Encodes the specified AddSplitPointsResponse message. Does not implicitly {@link google.spanner.admin.database.v1.AddSplitPointsResponse.verify|verify} messages. - * @param message AddSplitPointsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IAddSplitPointsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AddSplitPointsResponse message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.AddSplitPointsResponse.verify|verify} messages. - * @param message AddSplitPointsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IAddSplitPointsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AddSplitPointsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AddSplitPointsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.AddSplitPointsResponse; - - /** - * Decodes an AddSplitPointsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AddSplitPointsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.AddSplitPointsResponse; - - /** - * Verifies an AddSplitPointsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an AddSplitPointsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AddSplitPointsResponse - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.AddSplitPointsResponse; - - /** - * Creates a plain object from an AddSplitPointsResponse message. Also converts values to other types if specified. - * @param message AddSplitPointsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.AddSplitPointsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AddSplitPointsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AddSplitPointsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a SplitPoints. */ - interface ISplitPoints { - - /** SplitPoints table */ - table?: (string|null); - - /** SplitPoints index */ - index?: (string|null); - - /** SplitPoints keys */ - keys?: (google.spanner.admin.database.v1.SplitPoints.IKey[]|null); - - /** SplitPoints expireTime */ - expireTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a SplitPoints. */ - class SplitPoints implements ISplitPoints { - - /** - * Constructs a new SplitPoints. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.ISplitPoints); - - /** SplitPoints table. */ - public table: string; - - /** SplitPoints index. */ - public index: string; - - /** SplitPoints keys. */ - public keys: google.spanner.admin.database.v1.SplitPoints.IKey[]; - - /** SplitPoints expireTime. */ - public expireTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new SplitPoints instance using the specified properties. - * @param [properties] Properties to set - * @returns SplitPoints instance - */ - public static create(properties?: google.spanner.admin.database.v1.ISplitPoints): google.spanner.admin.database.v1.SplitPoints; - - /** - * Encodes the specified SplitPoints message. Does not implicitly {@link google.spanner.admin.database.v1.SplitPoints.verify|verify} messages. - * @param message SplitPoints message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.ISplitPoints, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SplitPoints message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.SplitPoints.verify|verify} messages. - * @param message SplitPoints message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.ISplitPoints, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SplitPoints message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SplitPoints - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.SplitPoints; - - /** - * Decodes a SplitPoints message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SplitPoints - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.SplitPoints; - - /** - * Verifies a SplitPoints message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SplitPoints message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SplitPoints - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.SplitPoints; - - /** - * Creates a plain object from a SplitPoints message. Also converts values to other types if specified. - * @param message SplitPoints - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.SplitPoints, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SplitPoints to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SplitPoints - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace SplitPoints { - - /** Properties of a Key. */ - interface IKey { - - /** Key keyParts */ - keyParts?: (google.protobuf.IListValue|null); - } - - /** Represents a Key. */ - class Key implements IKey { - - /** - * Constructs a new Key. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.SplitPoints.IKey); - - /** Key keyParts. */ - public keyParts?: (google.protobuf.IListValue|null); - - /** - * Creates a new Key instance using the specified properties. - * @param [properties] Properties to set - * @returns Key instance - */ - public static create(properties?: google.spanner.admin.database.v1.SplitPoints.IKey): google.spanner.admin.database.v1.SplitPoints.Key; - - /** - * Encodes the specified Key message. Does not implicitly {@link google.spanner.admin.database.v1.SplitPoints.Key.verify|verify} messages. - * @param message Key message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.SplitPoints.IKey, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Key message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.SplitPoints.Key.verify|verify} messages. - * @param message Key message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.SplitPoints.IKey, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Key message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Key - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.SplitPoints.Key; - - /** - * Decodes a Key message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Key - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.SplitPoints.Key; - - /** - * Verifies a Key message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Key message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Key - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.SplitPoints.Key; - - /** - * Creates a plain object from a Key message. Also converts values to other types if specified. - * @param message Key - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.SplitPoints.Key, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Key to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Key - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an InternalUpdateGraphOperationRequest. */ - interface IInternalUpdateGraphOperationRequest { - - /** InternalUpdateGraphOperationRequest database */ - database?: (string|null); - - /** InternalUpdateGraphOperationRequest operationId */ - operationId?: (string|null); - - /** InternalUpdateGraphOperationRequest vmIdentityToken */ - vmIdentityToken?: (string|null); - - /** InternalUpdateGraphOperationRequest progress */ - progress?: (number|null); - - /** InternalUpdateGraphOperationRequest status */ - status?: (google.rpc.IStatus|null); - } - - /** Represents an InternalUpdateGraphOperationRequest. */ - class InternalUpdateGraphOperationRequest implements IInternalUpdateGraphOperationRequest { - - /** - * Constructs a new InternalUpdateGraphOperationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IInternalUpdateGraphOperationRequest); - - /** InternalUpdateGraphOperationRequest database. */ - public database: string; - - /** InternalUpdateGraphOperationRequest operationId. */ - public operationId: string; - - /** InternalUpdateGraphOperationRequest vmIdentityToken. */ - public vmIdentityToken: string; - - /** InternalUpdateGraphOperationRequest progress. */ - public progress: number; - - /** InternalUpdateGraphOperationRequest status. */ - public status?: (google.rpc.IStatus|null); - - /** - * Creates a new InternalUpdateGraphOperationRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns InternalUpdateGraphOperationRequest instance - */ - public static create(properties?: google.spanner.admin.database.v1.IInternalUpdateGraphOperationRequest): google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest; - - /** - * Encodes the specified InternalUpdateGraphOperationRequest message. Does not implicitly {@link google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest.verify|verify} messages. - * @param message InternalUpdateGraphOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IInternalUpdateGraphOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified InternalUpdateGraphOperationRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest.verify|verify} messages. - * @param message InternalUpdateGraphOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IInternalUpdateGraphOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an InternalUpdateGraphOperationRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns InternalUpdateGraphOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest; - - /** - * Decodes an InternalUpdateGraphOperationRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns InternalUpdateGraphOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest; - - /** - * Verifies an InternalUpdateGraphOperationRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an InternalUpdateGraphOperationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns InternalUpdateGraphOperationRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest; - - /** - * Creates a plain object from an InternalUpdateGraphOperationRequest message. Also converts values to other types if specified. - * @param message InternalUpdateGraphOperationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this InternalUpdateGraphOperationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for InternalUpdateGraphOperationRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an InternalUpdateGraphOperationResponse. */ - interface IInternalUpdateGraphOperationResponse { - } - - /** Represents an InternalUpdateGraphOperationResponse. */ - class InternalUpdateGraphOperationResponse implements IInternalUpdateGraphOperationResponse { - - /** - * Constructs a new InternalUpdateGraphOperationResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IInternalUpdateGraphOperationResponse); - - /** - * Creates a new InternalUpdateGraphOperationResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns InternalUpdateGraphOperationResponse instance - */ - public static create(properties?: google.spanner.admin.database.v1.IInternalUpdateGraphOperationResponse): google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse; - - /** - * Encodes the specified InternalUpdateGraphOperationResponse message. Does not implicitly {@link google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse.verify|verify} messages. - * @param message InternalUpdateGraphOperationResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IInternalUpdateGraphOperationResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified InternalUpdateGraphOperationResponse message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse.verify|verify} messages. - * @param message InternalUpdateGraphOperationResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IInternalUpdateGraphOperationResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an InternalUpdateGraphOperationResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns InternalUpdateGraphOperationResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse; - - /** - * Decodes an InternalUpdateGraphOperationResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns InternalUpdateGraphOperationResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse; - - /** - * Verifies an InternalUpdateGraphOperationResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an InternalUpdateGraphOperationResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns InternalUpdateGraphOperationResponse - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse; - - /** - * Creates a plain object from an InternalUpdateGraphOperationResponse message. Also converts values to other types if specified. - * @param message InternalUpdateGraphOperationResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this InternalUpdateGraphOperationResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for InternalUpdateGraphOperationResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - } - } - } - - /** Namespace api. */ - namespace api { - - /** FieldBehavior enum. */ - enum FieldBehavior { - FIELD_BEHAVIOR_UNSPECIFIED = 0, - OPTIONAL = 1, - REQUIRED = 2, - OUTPUT_ONLY = 3, - INPUT_ONLY = 4, - IMMUTABLE = 5, - UNORDERED_LIST = 6, - NON_EMPTY_DEFAULT = 7, - IDENTIFIER = 8 - } - - /** Properties of a ResourceDescriptor. */ - interface IResourceDescriptor { - - /** ResourceDescriptor type */ - type?: (string|null); - - /** ResourceDescriptor pattern */ - pattern?: (string[]|null); - - /** ResourceDescriptor nameField */ - nameField?: (string|null); - - /** ResourceDescriptor history */ - history?: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History|null); - - /** ResourceDescriptor plural */ - plural?: (string|null); - - /** ResourceDescriptor singular */ - singular?: (string|null); - - /** ResourceDescriptor style */ - style?: (google.api.ResourceDescriptor.Style[]|null); - } - - /** Represents a ResourceDescriptor. */ - class ResourceDescriptor implements IResourceDescriptor { - - /** - * Constructs a new ResourceDescriptor. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IResourceDescriptor); - - /** ResourceDescriptor type. */ - public type: string; - - /** ResourceDescriptor pattern. */ - public pattern: string[]; - - /** ResourceDescriptor nameField. */ - public nameField: string; - - /** ResourceDescriptor history. */ - public history: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History); - - /** ResourceDescriptor plural. */ - public plural: string; - - /** ResourceDescriptor singular. */ - public singular: string; - - /** ResourceDescriptor style. */ - public style: google.api.ResourceDescriptor.Style[]; - - /** - * Creates a new ResourceDescriptor instance using the specified properties. - * @param [properties] Properties to set - * @returns ResourceDescriptor instance - */ - public static create(properties?: google.api.IResourceDescriptor): google.api.ResourceDescriptor; - - /** - * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. - * @param message ResourceDescriptor message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. - * @param message ResourceDescriptor message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ResourceDescriptor message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ResourceDescriptor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceDescriptor; - - /** - * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ResourceDescriptor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceDescriptor; - - /** - * Verifies a ResourceDescriptor message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ResourceDescriptor - */ - public static fromObject(object: { [k: string]: any }): google.api.ResourceDescriptor; - - /** - * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. - * @param message ResourceDescriptor - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.ResourceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ResourceDescriptor to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ResourceDescriptor - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ResourceDescriptor { - - /** History enum. */ - enum History { - HISTORY_UNSPECIFIED = 0, - ORIGINALLY_SINGLE_PATTERN = 1, - FUTURE_MULTI_PATTERN = 2 - } - - /** Style enum. */ - enum Style { - STYLE_UNSPECIFIED = 0, - DECLARATIVE_FRIENDLY = 1 - } - } - - /** Properties of a ResourceReference. */ - interface IResourceReference { - - /** ResourceReference type */ - type?: (string|null); - - /** ResourceReference childType */ - childType?: (string|null); - } - - /** Represents a ResourceReference. */ - class ResourceReference implements IResourceReference { - - /** - * Constructs a new ResourceReference. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IResourceReference); - - /** ResourceReference type. */ - public type: string; - - /** ResourceReference childType. */ - public childType: string; - - /** - * Creates a new ResourceReference instance using the specified properties. - * @param [properties] Properties to set - * @returns ResourceReference instance - */ - public static create(properties?: google.api.IResourceReference): google.api.ResourceReference; - - /** - * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. - * @param message ResourceReference message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. - * @param message ResourceReference message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ResourceReference message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ResourceReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceReference; - - /** - * Decodes a ResourceReference message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ResourceReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceReference; - - /** - * Verifies a ResourceReference message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ResourceReference - */ - public static fromObject(object: { [k: string]: any }): google.api.ResourceReference; - - /** - * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. - * @param message ResourceReference - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.ResourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ResourceReference to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ResourceReference - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Http. */ - interface IHttp { - - /** Http rules */ - rules?: (google.api.IHttpRule[]|null); - - /** Http fullyDecodeReservedExpansion */ - fullyDecodeReservedExpansion?: (boolean|null); - } - - /** Represents a Http. */ - class Http implements IHttp { - - /** - * Constructs a new Http. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IHttp); - - /** Http rules. */ - public rules: google.api.IHttpRule[]; - - /** Http fullyDecodeReservedExpansion. */ - public fullyDecodeReservedExpansion: boolean; - - /** - * Creates a new Http instance using the specified properties. - * @param [properties] Properties to set - * @returns Http instance - */ - public static create(properties?: google.api.IHttp): google.api.Http; - - /** - * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @param message Http message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @param message Http message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Http message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Http - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Http; - - /** - * Decodes a Http message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Http - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Http; - - /** - * Verifies a Http message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Http message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Http - */ - public static fromObject(object: { [k: string]: any }): google.api.Http; - - /** - * Creates a plain object from a Http message. Also converts values to other types if specified. - * @param message Http - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Http to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Http - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a HttpRule. */ - interface IHttpRule { - - /** HttpRule selector */ - selector?: (string|null); - - /** HttpRule get */ - get?: (string|null); - - /** HttpRule put */ - put?: (string|null); - - /** HttpRule post */ - post?: (string|null); - - /** HttpRule delete */ - "delete"?: (string|null); - - /** HttpRule patch */ - patch?: (string|null); - - /** HttpRule custom */ - custom?: (google.api.ICustomHttpPattern|null); - - /** HttpRule body */ - body?: (string|null); - - /** HttpRule responseBody */ - responseBody?: (string|null); - - /** HttpRule additionalBindings */ - additionalBindings?: (google.api.IHttpRule[]|null); - } - - /** Represents a HttpRule. */ - class HttpRule implements IHttpRule { - - /** - * Constructs a new HttpRule. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IHttpRule); - - /** HttpRule selector. */ - public selector: string; - - /** HttpRule get. */ - public get?: (string|null); - - /** HttpRule put. */ - public put?: (string|null); - - /** HttpRule post. */ - public post?: (string|null); - - /** HttpRule delete. */ - public delete?: (string|null); - - /** HttpRule patch. */ - public patch?: (string|null); - - /** HttpRule custom. */ - public custom?: (google.api.ICustomHttpPattern|null); - - /** HttpRule body. */ - public body: string; - - /** HttpRule responseBody. */ - public responseBody: string; - - /** HttpRule additionalBindings. */ - public additionalBindings: google.api.IHttpRule[]; - - /** HttpRule pattern. */ - public pattern?: ("get"|"put"|"post"|"delete"|"patch"|"custom"); - - /** - * Creates a new HttpRule instance using the specified properties. - * @param [properties] Properties to set - * @returns HttpRule instance - */ - public static create(properties?: google.api.IHttpRule): google.api.HttpRule; - - /** - * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @param message HttpRule message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @param message HttpRule message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a HttpRule message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns HttpRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.HttpRule; - - /** - * Decodes a HttpRule message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns HttpRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.HttpRule; - - /** - * Verifies a HttpRule message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns HttpRule - */ - public static fromObject(object: { [k: string]: any }): google.api.HttpRule; - - /** - * Creates a plain object from a HttpRule message. Also converts values to other types if specified. - * @param message HttpRule - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.HttpRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this HttpRule to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for HttpRule - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CustomHttpPattern. */ - interface ICustomHttpPattern { - - /** CustomHttpPattern kind */ - kind?: (string|null); - - /** CustomHttpPattern path */ - path?: (string|null); - } - - /** Represents a CustomHttpPattern. */ - class CustomHttpPattern implements ICustomHttpPattern { - - /** - * Constructs a new CustomHttpPattern. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.ICustomHttpPattern); - - /** CustomHttpPattern kind. */ - public kind: string; - - /** CustomHttpPattern path. */ - public path: string; - - /** - * Creates a new CustomHttpPattern instance using the specified properties. - * @param [properties] Properties to set - * @returns CustomHttpPattern instance - */ - public static create(properties?: google.api.ICustomHttpPattern): google.api.CustomHttpPattern; - - /** - * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. - * @param message CustomHttpPattern message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. - * @param message CustomHttpPattern message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CustomHttpPattern message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CustomHttpPattern - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CustomHttpPattern; - - /** - * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CustomHttpPattern - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CustomHttpPattern; - - /** - * Verifies a CustomHttpPattern message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CustomHttpPattern - */ - public static fromObject(object: { [k: string]: any }): google.api.CustomHttpPattern; - - /** - * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. - * @param message CustomHttpPattern - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.CustomHttpPattern, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CustomHttpPattern to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CustomHttpPattern - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CommonLanguageSettings. */ - interface ICommonLanguageSettings { - - /** CommonLanguageSettings referenceDocsUri */ - referenceDocsUri?: (string|null); - - /** CommonLanguageSettings destinations */ - destinations?: (google.api.ClientLibraryDestination[]|null); - } - - /** Represents a CommonLanguageSettings. */ - class CommonLanguageSettings implements ICommonLanguageSettings { - - /** - * Constructs a new CommonLanguageSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.ICommonLanguageSettings); - - /** CommonLanguageSettings referenceDocsUri. */ - public referenceDocsUri: string; - - /** CommonLanguageSettings destinations. */ - public destinations: google.api.ClientLibraryDestination[]; - - /** - * Creates a new CommonLanguageSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns CommonLanguageSettings instance - */ - public static create(properties?: google.api.ICommonLanguageSettings): google.api.CommonLanguageSettings; - - /** - * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. - * @param message CommonLanguageSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. - * @param message CommonLanguageSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CommonLanguageSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CommonLanguageSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CommonLanguageSettings; - - /** - * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CommonLanguageSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CommonLanguageSettings; - - /** - * Verifies a CommonLanguageSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CommonLanguageSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.CommonLanguageSettings; - - /** - * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. - * @param message CommonLanguageSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.CommonLanguageSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CommonLanguageSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CommonLanguageSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ClientLibrarySettings. */ - interface IClientLibrarySettings { - - /** ClientLibrarySettings version */ - version?: (string|null); - - /** ClientLibrarySettings launchStage */ - launchStage?: (google.api.LaunchStage|keyof typeof google.api.LaunchStage|null); - - /** ClientLibrarySettings restNumericEnums */ - restNumericEnums?: (boolean|null); - - /** ClientLibrarySettings javaSettings */ - javaSettings?: (google.api.IJavaSettings|null); - - /** ClientLibrarySettings cppSettings */ - cppSettings?: (google.api.ICppSettings|null); - - /** ClientLibrarySettings phpSettings */ - phpSettings?: (google.api.IPhpSettings|null); - - /** ClientLibrarySettings pythonSettings */ - pythonSettings?: (google.api.IPythonSettings|null); - - /** ClientLibrarySettings nodeSettings */ - nodeSettings?: (google.api.INodeSettings|null); - - /** ClientLibrarySettings dotnetSettings */ - dotnetSettings?: (google.api.IDotnetSettings|null); - - /** ClientLibrarySettings rubySettings */ - rubySettings?: (google.api.IRubySettings|null); - - /** ClientLibrarySettings goSettings */ - goSettings?: (google.api.IGoSettings|null); - } - - /** Represents a ClientLibrarySettings. */ - class ClientLibrarySettings implements IClientLibrarySettings { - - /** - * Constructs a new ClientLibrarySettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IClientLibrarySettings); - - /** ClientLibrarySettings version. */ - public version: string; - - /** ClientLibrarySettings launchStage. */ - public launchStage: (google.api.LaunchStage|keyof typeof google.api.LaunchStage); - - /** ClientLibrarySettings restNumericEnums. */ - public restNumericEnums: boolean; - - /** ClientLibrarySettings javaSettings. */ - public javaSettings?: (google.api.IJavaSettings|null); - - /** ClientLibrarySettings cppSettings. */ - public cppSettings?: (google.api.ICppSettings|null); - - /** ClientLibrarySettings phpSettings. */ - public phpSettings?: (google.api.IPhpSettings|null); - - /** ClientLibrarySettings pythonSettings. */ - public pythonSettings?: (google.api.IPythonSettings|null); - - /** ClientLibrarySettings nodeSettings. */ - public nodeSettings?: (google.api.INodeSettings|null); - - /** ClientLibrarySettings dotnetSettings. */ - public dotnetSettings?: (google.api.IDotnetSettings|null); - - /** ClientLibrarySettings rubySettings. */ - public rubySettings?: (google.api.IRubySettings|null); - - /** ClientLibrarySettings goSettings. */ - public goSettings?: (google.api.IGoSettings|null); - - /** - * Creates a new ClientLibrarySettings instance using the specified properties. - * @param [properties] Properties to set - * @returns ClientLibrarySettings instance - */ - public static create(properties?: google.api.IClientLibrarySettings): google.api.ClientLibrarySettings; - - /** - * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. - * @param message ClientLibrarySettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. - * @param message ClientLibrarySettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ClientLibrarySettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ClientLibrarySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ClientLibrarySettings; - - /** - * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ClientLibrarySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ClientLibrarySettings; - - /** - * Verifies a ClientLibrarySettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ClientLibrarySettings - */ - public static fromObject(object: { [k: string]: any }): google.api.ClientLibrarySettings; - - /** - * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. - * @param message ClientLibrarySettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.ClientLibrarySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ClientLibrarySettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ClientLibrarySettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Publishing. */ - interface IPublishing { - - /** Publishing methodSettings */ - methodSettings?: (google.api.IMethodSettings[]|null); - - /** Publishing newIssueUri */ - newIssueUri?: (string|null); - - /** Publishing documentationUri */ - documentationUri?: (string|null); - - /** Publishing apiShortName */ - apiShortName?: (string|null); - - /** Publishing githubLabel */ - githubLabel?: (string|null); - - /** Publishing codeownerGithubTeams */ - codeownerGithubTeams?: (string[]|null); - - /** Publishing docTagPrefix */ - docTagPrefix?: (string|null); - - /** Publishing organization */ - organization?: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization|null); - - /** Publishing librarySettings */ - librarySettings?: (google.api.IClientLibrarySettings[]|null); - - /** Publishing protoReferenceDocumentationUri */ - protoReferenceDocumentationUri?: (string|null); - - /** Publishing restReferenceDocumentationUri */ - restReferenceDocumentationUri?: (string|null); - } - - /** Represents a Publishing. */ - class Publishing implements IPublishing { - - /** - * Constructs a new Publishing. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IPublishing); - - /** Publishing methodSettings. */ - public methodSettings: google.api.IMethodSettings[]; - - /** Publishing newIssueUri. */ - public newIssueUri: string; - - /** Publishing documentationUri. */ - public documentationUri: string; - - /** Publishing apiShortName. */ - public apiShortName: string; - - /** Publishing githubLabel. */ - public githubLabel: string; - - /** Publishing codeownerGithubTeams. */ - public codeownerGithubTeams: string[]; - - /** Publishing docTagPrefix. */ - public docTagPrefix: string; - - /** Publishing organization. */ - public organization: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization); - - /** Publishing librarySettings. */ - public librarySettings: google.api.IClientLibrarySettings[]; - - /** Publishing protoReferenceDocumentationUri. */ - public protoReferenceDocumentationUri: string; - - /** Publishing restReferenceDocumentationUri. */ - public restReferenceDocumentationUri: string; - - /** - * Creates a new Publishing instance using the specified properties. - * @param [properties] Properties to set - * @returns Publishing instance - */ - public static create(properties?: google.api.IPublishing): google.api.Publishing; - - /** - * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. - * @param message Publishing message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. - * @param message Publishing message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Publishing message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Publishing - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Publishing; - - /** - * Decodes a Publishing message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Publishing - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Publishing; - - /** - * Verifies a Publishing message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Publishing message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Publishing - */ - public static fromObject(object: { [k: string]: any }): google.api.Publishing; - - /** - * Creates a plain object from a Publishing message. Also converts values to other types if specified. - * @param message Publishing - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.Publishing, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Publishing to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Publishing - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a JavaSettings. */ - interface IJavaSettings { - - /** JavaSettings libraryPackage */ - libraryPackage?: (string|null); - - /** JavaSettings serviceClassNames */ - serviceClassNames?: ({ [k: string]: string }|null); - - /** JavaSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a JavaSettings. */ - class JavaSettings implements IJavaSettings { - - /** - * Constructs a new JavaSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IJavaSettings); - - /** JavaSettings libraryPackage. */ - public libraryPackage: string; - - /** JavaSettings serviceClassNames. */ - public serviceClassNames: { [k: string]: string }; - - /** JavaSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new JavaSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns JavaSettings instance - */ - public static create(properties?: google.api.IJavaSettings): google.api.JavaSettings; - - /** - * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. - * @param message JavaSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. - * @param message JavaSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a JavaSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns JavaSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.JavaSettings; - - /** - * Decodes a JavaSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns JavaSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.JavaSettings; - - /** - * Verifies a JavaSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns JavaSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.JavaSettings; - - /** - * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. - * @param message JavaSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.JavaSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this JavaSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for JavaSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CppSettings. */ - interface ICppSettings { - - /** CppSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a CppSettings. */ - class CppSettings implements ICppSettings { - - /** - * Constructs a new CppSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.ICppSettings); - - /** CppSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new CppSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns CppSettings instance - */ - public static create(properties?: google.api.ICppSettings): google.api.CppSettings; - - /** - * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. - * @param message CppSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. - * @param message CppSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CppSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CppSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CppSettings; - - /** - * Decodes a CppSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CppSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CppSettings; - - /** - * Verifies a CppSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CppSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.CppSettings; - - /** - * Creates a plain object from a CppSettings message. Also converts values to other types if specified. - * @param message CppSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.CppSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CppSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CppSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PhpSettings. */ - interface IPhpSettings { - - /** PhpSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a PhpSettings. */ - class PhpSettings implements IPhpSettings { - - /** - * Constructs a new PhpSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IPhpSettings); - - /** PhpSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new PhpSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns PhpSettings instance - */ - public static create(properties?: google.api.IPhpSettings): google.api.PhpSettings; - - /** - * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. - * @param message PhpSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. - * @param message PhpSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PhpSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PhpSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PhpSettings; - - /** - * Decodes a PhpSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PhpSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PhpSettings; - - /** - * Verifies a PhpSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PhpSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.PhpSettings; - - /** - * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. - * @param message PhpSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.PhpSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PhpSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PhpSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PythonSettings. */ - interface IPythonSettings { - - /** PythonSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a PythonSettings. */ - class PythonSettings implements IPythonSettings { - - /** - * Constructs a new PythonSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IPythonSettings); - - /** PythonSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new PythonSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns PythonSettings instance - */ - public static create(properties?: google.api.IPythonSettings): google.api.PythonSettings; - - /** - * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. - * @param message PythonSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. - * @param message PythonSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PythonSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PythonSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PythonSettings; - - /** - * Decodes a PythonSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PythonSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PythonSettings; - - /** - * Verifies a PythonSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PythonSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.PythonSettings; - - /** - * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. - * @param message PythonSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.PythonSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PythonSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PythonSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a NodeSettings. */ - interface INodeSettings { - - /** NodeSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a NodeSettings. */ - class NodeSettings implements INodeSettings { - - /** - * Constructs a new NodeSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.INodeSettings); - - /** NodeSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new NodeSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns NodeSettings instance - */ - public static create(properties?: google.api.INodeSettings): google.api.NodeSettings; - - /** - * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. - * @param message NodeSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. - * @param message NodeSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a NodeSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns NodeSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.NodeSettings; - - /** - * Decodes a NodeSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns NodeSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.NodeSettings; - - /** - * Verifies a NodeSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns NodeSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.NodeSettings; - - /** - * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. - * @param message NodeSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.NodeSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this NodeSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for NodeSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DotnetSettings. */ - interface IDotnetSettings { - - /** DotnetSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - - /** DotnetSettings renamedServices */ - renamedServices?: ({ [k: string]: string }|null); - - /** DotnetSettings renamedResources */ - renamedResources?: ({ [k: string]: string }|null); - - /** DotnetSettings ignoredResources */ - ignoredResources?: (string[]|null); - - /** DotnetSettings forcedNamespaceAliases */ - forcedNamespaceAliases?: (string[]|null); - - /** DotnetSettings handwrittenSignatures */ - handwrittenSignatures?: (string[]|null); - } - - /** Represents a DotnetSettings. */ - class DotnetSettings implements IDotnetSettings { - - /** - * Constructs a new DotnetSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IDotnetSettings); - - /** DotnetSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** DotnetSettings renamedServices. */ - public renamedServices: { [k: string]: string }; - - /** DotnetSettings renamedResources. */ - public renamedResources: { [k: string]: string }; - - /** DotnetSettings ignoredResources. */ - public ignoredResources: string[]; - - /** DotnetSettings forcedNamespaceAliases. */ - public forcedNamespaceAliases: string[]; - - /** DotnetSettings handwrittenSignatures. */ - public handwrittenSignatures: string[]; - - /** - * Creates a new DotnetSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns DotnetSettings instance - */ - public static create(properties?: google.api.IDotnetSettings): google.api.DotnetSettings; - - /** - * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. - * @param message DotnetSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. - * @param message DotnetSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DotnetSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DotnetSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.DotnetSettings; - - /** - * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DotnetSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.DotnetSettings; - - /** - * Verifies a DotnetSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DotnetSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.DotnetSettings; - - /** - * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. - * @param message DotnetSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.DotnetSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DotnetSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DotnetSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RubySettings. */ - interface IRubySettings { - - /** RubySettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a RubySettings. */ - class RubySettings implements IRubySettings { - - /** - * Constructs a new RubySettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IRubySettings); - - /** RubySettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new RubySettings instance using the specified properties. - * @param [properties] Properties to set - * @returns RubySettings instance - */ - public static create(properties?: google.api.IRubySettings): google.api.RubySettings; - - /** - * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. - * @param message RubySettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. - * @param message RubySettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RubySettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RubySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.RubySettings; - - /** - * Decodes a RubySettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RubySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.RubySettings; - - /** - * Verifies a RubySettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RubySettings - */ - public static fromObject(object: { [k: string]: any }): google.api.RubySettings; - - /** - * Creates a plain object from a RubySettings message. Also converts values to other types if specified. - * @param message RubySettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.RubySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RubySettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RubySettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GoSettings. */ - interface IGoSettings { - - /** GoSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a GoSettings. */ - class GoSettings implements IGoSettings { - - /** - * Constructs a new GoSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IGoSettings); - - /** GoSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new GoSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns GoSettings instance - */ - public static create(properties?: google.api.IGoSettings): google.api.GoSettings; - - /** - * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. - * @param message GoSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. - * @param message GoSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GoSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GoSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.GoSettings; - - /** - * Decodes a GoSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GoSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.GoSettings; - - /** - * Verifies a GoSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GoSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.GoSettings; - - /** - * Creates a plain object from a GoSettings message. Also converts values to other types if specified. - * @param message GoSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.GoSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GoSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GoSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a MethodSettings. */ - interface IMethodSettings { - - /** MethodSettings selector */ - selector?: (string|null); - - /** MethodSettings longRunning */ - longRunning?: (google.api.MethodSettings.ILongRunning|null); - - /** MethodSettings autoPopulatedFields */ - autoPopulatedFields?: (string[]|null); - } - - /** Represents a MethodSettings. */ - class MethodSettings implements IMethodSettings { - - /** - * Constructs a new MethodSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IMethodSettings); - - /** MethodSettings selector. */ - public selector: string; - - /** MethodSettings longRunning. */ - public longRunning?: (google.api.MethodSettings.ILongRunning|null); - - /** MethodSettings autoPopulatedFields. */ - public autoPopulatedFields: string[]; - - /** - * Creates a new MethodSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns MethodSettings instance - */ - public static create(properties?: google.api.IMethodSettings): google.api.MethodSettings; - - /** - * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. - * @param message MethodSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. - * @param message MethodSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MethodSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MethodSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.MethodSettings; - - /** - * Decodes a MethodSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MethodSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.MethodSettings; - - /** - * Verifies a MethodSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MethodSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.MethodSettings; - - /** - * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. - * @param message MethodSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.MethodSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MethodSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MethodSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace MethodSettings { - - /** Properties of a LongRunning. */ - interface ILongRunning { - - /** LongRunning initialPollDelay */ - initialPollDelay?: (google.protobuf.IDuration|null); - - /** LongRunning pollDelayMultiplier */ - pollDelayMultiplier?: (number|null); - - /** LongRunning maxPollDelay */ - maxPollDelay?: (google.protobuf.IDuration|null); - - /** LongRunning totalPollTimeout */ - totalPollTimeout?: (google.protobuf.IDuration|null); - } - - /** Represents a LongRunning. */ - class LongRunning implements ILongRunning { - - /** - * Constructs a new LongRunning. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.MethodSettings.ILongRunning); - - /** LongRunning initialPollDelay. */ - public initialPollDelay?: (google.protobuf.IDuration|null); - - /** LongRunning pollDelayMultiplier. */ - public pollDelayMultiplier: number; - - /** LongRunning maxPollDelay. */ - public maxPollDelay?: (google.protobuf.IDuration|null); - - /** LongRunning totalPollTimeout. */ - public totalPollTimeout?: (google.protobuf.IDuration|null); - - /** - * Creates a new LongRunning instance using the specified properties. - * @param [properties] Properties to set - * @returns LongRunning instance - */ - public static create(properties?: google.api.MethodSettings.ILongRunning): google.api.MethodSettings.LongRunning; - - /** - * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. - * @param message LongRunning message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. - * @param message LongRunning message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a LongRunning message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns LongRunning - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.MethodSettings.LongRunning; - - /** - * Decodes a LongRunning message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns LongRunning - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.MethodSettings.LongRunning; - - /** - * Verifies a LongRunning message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LongRunning - */ - public static fromObject(object: { [k: string]: any }): google.api.MethodSettings.LongRunning; - - /** - * Creates a plain object from a LongRunning message. Also converts values to other types if specified. - * @param message LongRunning - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.MethodSettings.LongRunning, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this LongRunning to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for LongRunning - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** ClientLibraryOrganization enum. */ - enum ClientLibraryOrganization { - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0, - CLOUD = 1, - ADS = 2, - PHOTOS = 3, - STREET_VIEW = 4, - SHOPPING = 5, - GEO = 6, - GENERATIVE_AI = 7 - } - - /** ClientLibraryDestination enum. */ - enum ClientLibraryDestination { - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0, - GITHUB = 10, - PACKAGE_MANAGER = 20 - } - - /** LaunchStage enum. */ - enum LaunchStage { - LAUNCH_STAGE_UNSPECIFIED = 0, - UNIMPLEMENTED = 6, - PRELAUNCH = 7, - EARLY_ACCESS = 1, - ALPHA = 2, - BETA = 3, - GA = 4, - DEPRECATED = 5 - } - } - - /** Namespace protobuf. */ - namespace protobuf { - - /** Properties of a FileDescriptorSet. */ - interface IFileDescriptorSet { - - /** FileDescriptorSet file */ - file?: (google.protobuf.IFileDescriptorProto[]|null); - } - - /** Represents a FileDescriptorSet. */ - class FileDescriptorSet implements IFileDescriptorSet { - - /** - * Constructs a new FileDescriptorSet. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFileDescriptorSet); - - /** FileDescriptorSet file. */ - public file: google.protobuf.IFileDescriptorProto[]; - - /** - * Creates a new FileDescriptorSet instance using the specified properties. - * @param [properties] Properties to set - * @returns FileDescriptorSet instance - */ - public static create(properties?: google.protobuf.IFileDescriptorSet): google.protobuf.FileDescriptorSet; - - /** - * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. - * @param message FileDescriptorSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. - * @param message FileDescriptorSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FileDescriptorSet message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FileDescriptorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorSet; - - /** - * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FileDescriptorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorSet; - - /** - * Verifies a FileDescriptorSet message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FileDescriptorSet - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorSet; - - /** - * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. - * @param message FileDescriptorSet - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FileDescriptorSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FileDescriptorSet to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FileDescriptorSet - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Edition enum. */ - enum Edition { - EDITION_UNKNOWN = 0, - EDITION_PROTO2 = 998, - EDITION_PROTO3 = 999, - EDITION_2023 = 1000, - EDITION_2024 = 1001, - EDITION_1_TEST_ONLY = 1, - EDITION_2_TEST_ONLY = 2, - EDITION_99997_TEST_ONLY = 99997, - EDITION_99998_TEST_ONLY = 99998, - EDITION_99999_TEST_ONLY = 99999, - EDITION_MAX = 2147483647 - } - - /** Properties of a FileDescriptorProto. */ - interface IFileDescriptorProto { - - /** FileDescriptorProto name */ - name?: (string|null); - - /** FileDescriptorProto package */ - "package"?: (string|null); - - /** FileDescriptorProto dependency */ - dependency?: (string[]|null); - - /** FileDescriptorProto publicDependency */ - publicDependency?: (number[]|null); - - /** FileDescriptorProto weakDependency */ - weakDependency?: (number[]|null); - - /** FileDescriptorProto messageType */ - messageType?: (google.protobuf.IDescriptorProto[]|null); - - /** FileDescriptorProto enumType */ - enumType?: (google.protobuf.IEnumDescriptorProto[]|null); - - /** FileDescriptorProto service */ - service?: (google.protobuf.IServiceDescriptorProto[]|null); - - /** FileDescriptorProto extension */ - extension?: (google.protobuf.IFieldDescriptorProto[]|null); - - /** FileDescriptorProto options */ - options?: (google.protobuf.IFileOptions|null); - - /** FileDescriptorProto sourceCodeInfo */ - sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); - - /** FileDescriptorProto syntax */ - syntax?: (string|null); - - /** FileDescriptorProto edition */ - edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - } - - /** Represents a FileDescriptorProto. */ - class FileDescriptorProto implements IFileDescriptorProto { - - /** - * Constructs a new FileDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFileDescriptorProto); - - /** FileDescriptorProto name. */ - public name: string; - - /** FileDescriptorProto package. */ - public package: string; - - /** FileDescriptorProto dependency. */ - public dependency: string[]; - - /** FileDescriptorProto publicDependency. */ - public publicDependency: number[]; - - /** FileDescriptorProto weakDependency. */ - public weakDependency: number[]; - - /** FileDescriptorProto messageType. */ - public messageType: google.protobuf.IDescriptorProto[]; - - /** FileDescriptorProto enumType. */ - public enumType: google.protobuf.IEnumDescriptorProto[]; - - /** FileDescriptorProto service. */ - public service: google.protobuf.IServiceDescriptorProto[]; - - /** FileDescriptorProto extension. */ - public extension: google.protobuf.IFieldDescriptorProto[]; - - /** FileDescriptorProto options. */ - public options?: (google.protobuf.IFileOptions|null); - - /** FileDescriptorProto sourceCodeInfo. */ - public sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); - - /** FileDescriptorProto syntax. */ - public syntax: string; - - /** FileDescriptorProto edition. */ - public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** - * Creates a new FileDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns FileDescriptorProto instance - */ - public static create(properties?: google.protobuf.IFileDescriptorProto): google.protobuf.FileDescriptorProto; - - /** - * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @param message FileDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @param message FileDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorProto; - - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorProto; - - /** - * Verifies a FileDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FileDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorProto; - - /** - * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. - * @param message FileDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FileDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FileDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FileDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DescriptorProto. */ - interface IDescriptorProto { - - /** DescriptorProto name */ - name?: (string|null); - - /** DescriptorProto field */ - field?: (google.protobuf.IFieldDescriptorProto[]|null); - - /** DescriptorProto extension */ - extension?: (google.protobuf.IFieldDescriptorProto[]|null); - - /** DescriptorProto nestedType */ - nestedType?: (google.protobuf.IDescriptorProto[]|null); - - /** DescriptorProto enumType */ - enumType?: (google.protobuf.IEnumDescriptorProto[]|null); - - /** DescriptorProto extensionRange */ - extensionRange?: (google.protobuf.DescriptorProto.IExtensionRange[]|null); - - /** DescriptorProto oneofDecl */ - oneofDecl?: (google.protobuf.IOneofDescriptorProto[]|null); - - /** DescriptorProto options */ - options?: (google.protobuf.IMessageOptions|null); - - /** DescriptorProto reservedRange */ - reservedRange?: (google.protobuf.DescriptorProto.IReservedRange[]|null); - - /** DescriptorProto reservedName */ - reservedName?: (string[]|null); - } - - /** Represents a DescriptorProto. */ - class DescriptorProto implements IDescriptorProto { - - /** - * Constructs a new DescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IDescriptorProto); - - /** DescriptorProto name. */ - public name: string; - - /** DescriptorProto field. */ - public field: google.protobuf.IFieldDescriptorProto[]; - - /** DescriptorProto extension. */ - public extension: google.protobuf.IFieldDescriptorProto[]; - - /** DescriptorProto nestedType. */ - public nestedType: google.protobuf.IDescriptorProto[]; - - /** DescriptorProto enumType. */ - public enumType: google.protobuf.IEnumDescriptorProto[]; - - /** DescriptorProto extensionRange. */ - public extensionRange: google.protobuf.DescriptorProto.IExtensionRange[]; - - /** DescriptorProto oneofDecl. */ - public oneofDecl: google.protobuf.IOneofDescriptorProto[]; - - /** DescriptorProto options. */ - public options?: (google.protobuf.IMessageOptions|null); - - /** DescriptorProto reservedRange. */ - public reservedRange: google.protobuf.DescriptorProto.IReservedRange[]; - - /** DescriptorProto reservedName. */ - public reservedName: string[]; - - /** - * Creates a new DescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns DescriptorProto instance - */ - public static create(properties?: google.protobuf.IDescriptorProto): google.protobuf.DescriptorProto; - - /** - * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @param message DescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @param message DescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto; - - /** - * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto; - - /** - * Verifies a DescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto; - - /** - * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. - * @param message DescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.DescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace DescriptorProto { - - /** Properties of an ExtensionRange. */ - interface IExtensionRange { - - /** ExtensionRange start */ - start?: (number|null); - - /** ExtensionRange end */ - end?: (number|null); - - /** ExtensionRange options */ - options?: (google.protobuf.IExtensionRangeOptions|null); - } - - /** Represents an ExtensionRange. */ - class ExtensionRange implements IExtensionRange { - - /** - * Constructs a new ExtensionRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange); - - /** ExtensionRange start. */ - public start: number; - - /** ExtensionRange end. */ - public end: number; - - /** ExtensionRange options. */ - public options?: (google.protobuf.IExtensionRangeOptions|null); - - /** - * Creates a new ExtensionRange instance using the specified properties. - * @param [properties] Properties to set - * @returns ExtensionRange instance - */ - public static create(properties?: google.protobuf.DescriptorProto.IExtensionRange): google.protobuf.DescriptorProto.ExtensionRange; - - /** - * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @param message ExtensionRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @param message ExtensionRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExtensionRange message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ExtensionRange; - - /** - * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ExtensionRange; - - /** - * Verifies an ExtensionRange message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExtensionRange - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ExtensionRange; - - /** - * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. - * @param message ExtensionRange - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.DescriptorProto.ExtensionRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExtensionRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExtensionRange - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ReservedRange. */ - interface IReservedRange { - - /** ReservedRange start */ - start?: (number|null); - - /** ReservedRange end */ - end?: (number|null); - } - - /** Represents a ReservedRange. */ - class ReservedRange implements IReservedRange { - - /** - * Constructs a new ReservedRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.DescriptorProto.IReservedRange); - - /** ReservedRange start. */ - public start: number; - - /** ReservedRange end. */ - public end: number; - - /** - * Creates a new ReservedRange instance using the specified properties. - * @param [properties] Properties to set - * @returns ReservedRange instance - */ - public static create(properties?: google.protobuf.DescriptorProto.IReservedRange): google.protobuf.DescriptorProto.ReservedRange; - - /** - * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @param message ReservedRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @param message ReservedRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ReservedRange message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ReservedRange; - - /** - * Decodes a ReservedRange message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ReservedRange; - - /** - * Verifies a ReservedRange message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ReservedRange - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ReservedRange; - - /** - * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. - * @param message ReservedRange - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.DescriptorProto.ReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ReservedRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ReservedRange - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an ExtensionRangeOptions. */ - interface IExtensionRangeOptions { - - /** ExtensionRangeOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** ExtensionRangeOptions declaration */ - declaration?: (google.protobuf.ExtensionRangeOptions.IDeclaration[]|null); - - /** ExtensionRangeOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** ExtensionRangeOptions verification */ - verification?: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState|null); - } - - /** Represents an ExtensionRangeOptions. */ - class ExtensionRangeOptions implements IExtensionRangeOptions { - - /** - * Constructs a new ExtensionRangeOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IExtensionRangeOptions); - - /** ExtensionRangeOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** ExtensionRangeOptions declaration. */ - public declaration: google.protobuf.ExtensionRangeOptions.IDeclaration[]; - - /** ExtensionRangeOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** ExtensionRangeOptions verification. */ - public verification: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState); - - /** - * Creates a new ExtensionRangeOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns ExtensionRangeOptions instance - */ - public static create(properties?: google.protobuf.IExtensionRangeOptions): google.protobuf.ExtensionRangeOptions; - - /** - * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. - * @param message ExtensionRangeOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. - * @param message ExtensionRangeOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExtensionRangeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions; - - /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExtensionRangeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions; - - /** - * Verifies an ExtensionRangeOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExtensionRangeOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions; - - /** - * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. - * @param message ExtensionRangeOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ExtensionRangeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExtensionRangeOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExtensionRangeOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ExtensionRangeOptions { - - /** Properties of a Declaration. */ - interface IDeclaration { - - /** Declaration number */ - number?: (number|null); - - /** Declaration fullName */ - fullName?: (string|null); - - /** Declaration type */ - type?: (string|null); - - /** Declaration reserved */ - reserved?: (boolean|null); - - /** Declaration repeated */ - repeated?: (boolean|null); - } - - /** Represents a Declaration. */ - class Declaration implements IDeclaration { - - /** - * Constructs a new Declaration. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration); - - /** Declaration number. */ - public number: number; - - /** Declaration fullName. */ - public fullName: string; - - /** Declaration type. */ - public type: string; - - /** Declaration reserved. */ - public reserved: boolean; - - /** Declaration repeated. */ - public repeated: boolean; - - /** - * Creates a new Declaration instance using the specified properties. - * @param [properties] Properties to set - * @returns Declaration instance - */ - public static create(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration): google.protobuf.ExtensionRangeOptions.Declaration; - - /** - * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. - * @param message Declaration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. - * @param message Declaration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Declaration message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Declaration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions.Declaration; - - /** - * Decodes a Declaration message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Declaration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions.Declaration; - - /** - * Verifies a Declaration message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Declaration message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Declaration - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions.Declaration; - - /** - * Creates a plain object from a Declaration message. Also converts values to other types if specified. - * @param message Declaration - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ExtensionRangeOptions.Declaration, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Declaration to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Declaration - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** VerificationState enum. */ - enum VerificationState { - DECLARATION = 0, - UNVERIFIED = 1 - } - } - - /** Properties of a FieldDescriptorProto. */ - interface IFieldDescriptorProto { - - /** FieldDescriptorProto name */ - name?: (string|null); - - /** FieldDescriptorProto number */ - number?: (number|null); - - /** FieldDescriptorProto label */ - label?: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label|null); - - /** FieldDescriptorProto type */ - type?: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type|null); - - /** FieldDescriptorProto typeName */ - typeName?: (string|null); - - /** FieldDescriptorProto extendee */ - extendee?: (string|null); - - /** FieldDescriptorProto defaultValue */ - defaultValue?: (string|null); - - /** FieldDescriptorProto oneofIndex */ - oneofIndex?: (number|null); - - /** FieldDescriptorProto jsonName */ - jsonName?: (string|null); - - /** FieldDescriptorProto options */ - options?: (google.protobuf.IFieldOptions|null); - - /** FieldDescriptorProto proto3Optional */ - proto3Optional?: (boolean|null); - } - - /** Represents a FieldDescriptorProto. */ - class FieldDescriptorProto implements IFieldDescriptorProto { - - /** - * Constructs a new FieldDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFieldDescriptorProto); - - /** FieldDescriptorProto name. */ - public name: string; - - /** FieldDescriptorProto number. */ - public number: number; - - /** FieldDescriptorProto label. */ - public label: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label); - - /** FieldDescriptorProto type. */ - public type: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type); - - /** FieldDescriptorProto typeName. */ - public typeName: string; - - /** FieldDescriptorProto extendee. */ - public extendee: string; - - /** FieldDescriptorProto defaultValue. */ - public defaultValue: string; - - /** FieldDescriptorProto oneofIndex. */ - public oneofIndex: number; - - /** FieldDescriptorProto jsonName. */ - public jsonName: string; - - /** FieldDescriptorProto options. */ - public options?: (google.protobuf.IFieldOptions|null); - - /** FieldDescriptorProto proto3Optional. */ - public proto3Optional: boolean; - - /** - * Creates a new FieldDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns FieldDescriptorProto instance - */ - public static create(properties?: google.protobuf.IFieldDescriptorProto): google.protobuf.FieldDescriptorProto; - - /** - * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @param message FieldDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @param message FieldDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldDescriptorProto; - - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldDescriptorProto; - - /** - * Verifies a FieldDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FieldDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto; - - /** - * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. - * @param message FieldDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FieldDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FieldDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FieldDescriptorProto { - - /** Type enum. */ - enum Type { - TYPE_DOUBLE = 1, - TYPE_FLOAT = 2, - TYPE_INT64 = 3, - TYPE_UINT64 = 4, - TYPE_INT32 = 5, - TYPE_FIXED64 = 6, - TYPE_FIXED32 = 7, - TYPE_BOOL = 8, - TYPE_STRING = 9, - TYPE_GROUP = 10, - TYPE_MESSAGE = 11, - TYPE_BYTES = 12, - TYPE_UINT32 = 13, - TYPE_ENUM = 14, - TYPE_SFIXED32 = 15, - TYPE_SFIXED64 = 16, - TYPE_SINT32 = 17, - TYPE_SINT64 = 18 - } - - /** Label enum. */ - enum Label { - LABEL_OPTIONAL = 1, - LABEL_REPEATED = 3, - LABEL_REQUIRED = 2 - } - } - - /** Properties of an OneofDescriptorProto. */ - interface IOneofDescriptorProto { - - /** OneofDescriptorProto name */ - name?: (string|null); - - /** OneofDescriptorProto options */ - options?: (google.protobuf.IOneofOptions|null); - } - - /** Represents an OneofDescriptorProto. */ - class OneofDescriptorProto implements IOneofDescriptorProto { - - /** - * Constructs a new OneofDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IOneofDescriptorProto); - - /** OneofDescriptorProto name. */ - public name: string; - - /** OneofDescriptorProto options. */ - public options?: (google.protobuf.IOneofOptions|null); - - /** - * Creates a new OneofDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns OneofDescriptorProto instance - */ - public static create(properties?: google.protobuf.IOneofDescriptorProto): google.protobuf.OneofDescriptorProto; - - /** - * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @param message OneofDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @param message OneofDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofDescriptorProto; - - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofDescriptorProto; - - /** - * Verifies an OneofDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OneofDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.OneofDescriptorProto; - - /** - * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. - * @param message OneofDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.OneofDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OneofDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for OneofDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EnumDescriptorProto. */ - interface IEnumDescriptorProto { - - /** EnumDescriptorProto name */ - name?: (string|null); - - /** EnumDescriptorProto value */ - value?: (google.protobuf.IEnumValueDescriptorProto[]|null); - - /** EnumDescriptorProto options */ - options?: (google.protobuf.IEnumOptions|null); - - /** EnumDescriptorProto reservedRange */ - reservedRange?: (google.protobuf.EnumDescriptorProto.IEnumReservedRange[]|null); - - /** EnumDescriptorProto reservedName */ - reservedName?: (string[]|null); - } - - /** Represents an EnumDescriptorProto. */ - class EnumDescriptorProto implements IEnumDescriptorProto { - - /** - * Constructs a new EnumDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumDescriptorProto); - - /** EnumDescriptorProto name. */ - public name: string; - - /** EnumDescriptorProto value. */ - public value: google.protobuf.IEnumValueDescriptorProto[]; - - /** EnumDescriptorProto options. */ - public options?: (google.protobuf.IEnumOptions|null); - - /** EnumDescriptorProto reservedRange. */ - public reservedRange: google.protobuf.EnumDescriptorProto.IEnumReservedRange[]; - - /** EnumDescriptorProto reservedName. */ - public reservedName: string[]; - - /** - * Creates a new EnumDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumDescriptorProto instance - */ - public static create(properties?: google.protobuf.IEnumDescriptorProto): google.protobuf.EnumDescriptorProto; - - /** - * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @param message EnumDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @param message EnumDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto; - - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto; - - /** - * Verifies an EnumDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto; - - /** - * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. - * @param message EnumDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace EnumDescriptorProto { - - /** Properties of an EnumReservedRange. */ - interface IEnumReservedRange { - - /** EnumReservedRange start */ - start?: (number|null); - - /** EnumReservedRange end */ - end?: (number|null); - } - - /** Represents an EnumReservedRange. */ - class EnumReservedRange implements IEnumReservedRange { - - /** - * Constructs a new EnumReservedRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange); - - /** EnumReservedRange start. */ - public start: number; - - /** EnumReservedRange end. */ - public end: number; - - /** - * Creates a new EnumReservedRange instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumReservedRange instance - */ - public static create(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange): google.protobuf.EnumDescriptorProto.EnumReservedRange; - - /** - * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. - * @param message EnumReservedRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. - * @param message EnumReservedRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumReservedRange message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto.EnumReservedRange; - - /** - * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto.EnumReservedRange; - - /** - * Verifies an EnumReservedRange message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumReservedRange - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto.EnumReservedRange; - - /** - * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. - * @param message EnumReservedRange - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumDescriptorProto.EnumReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumReservedRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumReservedRange - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an EnumValueDescriptorProto. */ - interface IEnumValueDescriptorProto { - - /** EnumValueDescriptorProto name */ - name?: (string|null); - - /** EnumValueDescriptorProto number */ - number?: (number|null); - - /** EnumValueDescriptorProto options */ - options?: (google.protobuf.IEnumValueOptions|null); - } - - /** Represents an EnumValueDescriptorProto. */ - class EnumValueDescriptorProto implements IEnumValueDescriptorProto { - - /** - * Constructs a new EnumValueDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumValueDescriptorProto); - - /** EnumValueDescriptorProto name. */ - public name: string; - - /** EnumValueDescriptorProto number. */ - public number: number; - - /** EnumValueDescriptorProto options. */ - public options?: (google.protobuf.IEnumValueOptions|null); - - /** - * Creates a new EnumValueDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumValueDescriptorProto instance - */ - public static create(properties?: google.protobuf.IEnumValueDescriptorProto): google.protobuf.EnumValueDescriptorProto; - - /** - * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @param message EnumValueDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @param message EnumValueDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueDescriptorProto; - - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueDescriptorProto; - - /** - * Verifies an EnumValueDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumValueDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueDescriptorProto; - - /** - * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. - * @param message EnumValueDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumValueDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumValueDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumValueDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ServiceDescriptorProto. */ - interface IServiceDescriptorProto { - - /** ServiceDescriptorProto name */ - name?: (string|null); - - /** ServiceDescriptorProto method */ - method?: (google.protobuf.IMethodDescriptorProto[]|null); - - /** ServiceDescriptorProto options */ - options?: (google.protobuf.IServiceOptions|null); - } - - /** Represents a ServiceDescriptorProto. */ - class ServiceDescriptorProto implements IServiceDescriptorProto { - - /** - * Constructs a new ServiceDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IServiceDescriptorProto); - - /** ServiceDescriptorProto name. */ - public name: string; - - /** ServiceDescriptorProto method. */ - public method: google.protobuf.IMethodDescriptorProto[]; - - /** ServiceDescriptorProto options. */ - public options?: (google.protobuf.IServiceOptions|null); - - /** - * Creates a new ServiceDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns ServiceDescriptorProto instance - */ - public static create(properties?: google.protobuf.IServiceDescriptorProto): google.protobuf.ServiceDescriptorProto; - - /** - * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @param message ServiceDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @param message ServiceDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceDescriptorProto; - - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceDescriptorProto; - - /** - * Verifies a ServiceDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ServiceDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceDescriptorProto; - - /** - * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. - * @param message ServiceDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ServiceDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ServiceDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ServiceDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a MethodDescriptorProto. */ - interface IMethodDescriptorProto { - - /** MethodDescriptorProto name */ - name?: (string|null); - - /** MethodDescriptorProto inputType */ - inputType?: (string|null); - - /** MethodDescriptorProto outputType */ - outputType?: (string|null); - - /** MethodDescriptorProto options */ - options?: (google.protobuf.IMethodOptions|null); - - /** MethodDescriptorProto clientStreaming */ - clientStreaming?: (boolean|null); - - /** MethodDescriptorProto serverStreaming */ - serverStreaming?: (boolean|null); - } - - /** Represents a MethodDescriptorProto. */ - class MethodDescriptorProto implements IMethodDescriptorProto { - - /** - * Constructs a new MethodDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IMethodDescriptorProto); - - /** MethodDescriptorProto name. */ - public name: string; - - /** MethodDescriptorProto inputType. */ - public inputType: string; - - /** MethodDescriptorProto outputType. */ - public outputType: string; - - /** MethodDescriptorProto options. */ - public options?: (google.protobuf.IMethodOptions|null); - - /** MethodDescriptorProto clientStreaming. */ - public clientStreaming: boolean; - - /** MethodDescriptorProto serverStreaming. */ - public serverStreaming: boolean; - - /** - * Creates a new MethodDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns MethodDescriptorProto instance - */ - public static create(properties?: google.protobuf.IMethodDescriptorProto): google.protobuf.MethodDescriptorProto; - - /** - * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @param message MethodDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @param message MethodDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodDescriptorProto; - - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodDescriptorProto; - - /** - * Verifies a MethodDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MethodDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.MethodDescriptorProto; - - /** - * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. - * @param message MethodDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.MethodDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MethodDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MethodDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a FileOptions. */ - interface IFileOptions { - - /** FileOptions javaPackage */ - javaPackage?: (string|null); - - /** FileOptions javaOuterClassname */ - javaOuterClassname?: (string|null); - - /** FileOptions javaMultipleFiles */ - javaMultipleFiles?: (boolean|null); - - /** FileOptions javaGenerateEqualsAndHash */ - javaGenerateEqualsAndHash?: (boolean|null); - - /** FileOptions javaStringCheckUtf8 */ - javaStringCheckUtf8?: (boolean|null); - - /** FileOptions optimizeFor */ - optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode|null); - - /** FileOptions goPackage */ - goPackage?: (string|null); - - /** FileOptions ccGenericServices */ - ccGenericServices?: (boolean|null); - - /** FileOptions javaGenericServices */ - javaGenericServices?: (boolean|null); - - /** FileOptions pyGenericServices */ - pyGenericServices?: (boolean|null); - - /** FileOptions deprecated */ - deprecated?: (boolean|null); - - /** FileOptions ccEnableArenas */ - ccEnableArenas?: (boolean|null); - - /** FileOptions objcClassPrefix */ - objcClassPrefix?: (string|null); - - /** FileOptions csharpNamespace */ - csharpNamespace?: (string|null); - - /** FileOptions swiftPrefix */ - swiftPrefix?: (string|null); - - /** FileOptions phpClassPrefix */ - phpClassPrefix?: (string|null); - - /** FileOptions phpNamespace */ - phpNamespace?: (string|null); - - /** FileOptions phpMetadataNamespace */ - phpMetadataNamespace?: (string|null); - - /** FileOptions rubyPackage */ - rubyPackage?: (string|null); - - /** FileOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** FileOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** FileOptions .google.api.resourceDefinition */ - ".google.api.resourceDefinition"?: (google.api.IResourceDescriptor[]|null); - } - - /** Represents a FileOptions. */ - class FileOptions implements IFileOptions { - - /** - * Constructs a new FileOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFileOptions); - - /** FileOptions javaPackage. */ - public javaPackage: string; - - /** FileOptions javaOuterClassname. */ - public javaOuterClassname: string; - - /** FileOptions javaMultipleFiles. */ - public javaMultipleFiles: boolean; - - /** FileOptions javaGenerateEqualsAndHash. */ - public javaGenerateEqualsAndHash: boolean; - - /** FileOptions javaStringCheckUtf8. */ - public javaStringCheckUtf8: boolean; - - /** FileOptions optimizeFor. */ - public optimizeFor: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode); - - /** FileOptions goPackage. */ - public goPackage: string; - - /** FileOptions ccGenericServices. */ - public ccGenericServices: boolean; - - /** FileOptions javaGenericServices. */ - public javaGenericServices: boolean; - - /** FileOptions pyGenericServices. */ - public pyGenericServices: boolean; - - /** FileOptions deprecated. */ - public deprecated: boolean; - - /** FileOptions ccEnableArenas. */ - public ccEnableArenas: boolean; - - /** FileOptions objcClassPrefix. */ - public objcClassPrefix: string; - - /** FileOptions csharpNamespace. */ - public csharpNamespace: string; - - /** FileOptions swiftPrefix. */ - public swiftPrefix: string; - - /** FileOptions phpClassPrefix. */ - public phpClassPrefix: string; - - /** FileOptions phpNamespace. */ - public phpNamespace: string; - - /** FileOptions phpMetadataNamespace. */ - public phpMetadataNamespace: string; - - /** FileOptions rubyPackage. */ - public rubyPackage: string; - - /** FileOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** FileOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new FileOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns FileOptions instance - */ - public static create(properties?: google.protobuf.IFileOptions): google.protobuf.FileOptions; - - /** - * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @param message FileOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @param message FileOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FileOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileOptions; - - /** - * Decodes a FileOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileOptions; - - /** - * Verifies a FileOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FileOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FileOptions; - - /** - * Creates a plain object from a FileOptions message. Also converts values to other types if specified. - * @param message FileOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FileOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FileOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FileOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FileOptions { - - /** OptimizeMode enum. */ - enum OptimizeMode { - SPEED = 1, - CODE_SIZE = 2, - LITE_RUNTIME = 3 - } - } - - /** Properties of a MessageOptions. */ - interface IMessageOptions { - - /** MessageOptions messageSetWireFormat */ - messageSetWireFormat?: (boolean|null); - - /** MessageOptions noStandardDescriptorAccessor */ - noStandardDescriptorAccessor?: (boolean|null); - - /** MessageOptions deprecated */ - deprecated?: (boolean|null); - - /** MessageOptions mapEntry */ - mapEntry?: (boolean|null); - - /** MessageOptions deprecatedLegacyJsonFieldConflicts */ - deprecatedLegacyJsonFieldConflicts?: (boolean|null); - - /** MessageOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** MessageOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** MessageOptions .google.api.resource */ - ".google.api.resource"?: (google.api.IResourceDescriptor|null); - } - - /** Represents a MessageOptions. */ - class MessageOptions implements IMessageOptions { - - /** - * Constructs a new MessageOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IMessageOptions); - - /** MessageOptions messageSetWireFormat. */ - public messageSetWireFormat: boolean; - - /** MessageOptions noStandardDescriptorAccessor. */ - public noStandardDescriptorAccessor: boolean; - - /** MessageOptions deprecated. */ - public deprecated: boolean; - - /** MessageOptions mapEntry. */ - public mapEntry: boolean; - - /** MessageOptions deprecatedLegacyJsonFieldConflicts. */ - public deprecatedLegacyJsonFieldConflicts: boolean; - - /** MessageOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** MessageOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new MessageOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns MessageOptions instance - */ - public static create(properties?: google.protobuf.IMessageOptions): google.protobuf.MessageOptions; - - /** - * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @param message MessageOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @param message MessageOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MessageOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MessageOptions; - - /** - * Decodes a MessageOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MessageOptions; - - /** - * Verifies a MessageOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MessageOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.MessageOptions; - - /** - * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. - * @param message MessageOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.MessageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MessageOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MessageOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a FieldOptions. */ - interface IFieldOptions { - - /** FieldOptions ctype */ - ctype?: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType|null); - - /** FieldOptions packed */ - packed?: (boolean|null); - - /** FieldOptions jstype */ - jstype?: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType|null); - - /** FieldOptions lazy */ - lazy?: (boolean|null); - - /** FieldOptions unverifiedLazy */ - unverifiedLazy?: (boolean|null); - - /** FieldOptions deprecated */ - deprecated?: (boolean|null); - - /** FieldOptions weak */ - weak?: (boolean|null); - - /** FieldOptions debugRedact */ - debugRedact?: (boolean|null); - - /** FieldOptions retention */ - retention?: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention|null); - - /** FieldOptions targets */ - targets?: (google.protobuf.FieldOptions.OptionTargetType[]|null); - - /** FieldOptions editionDefaults */ - editionDefaults?: (google.protobuf.FieldOptions.IEditionDefault[]|null); - - /** FieldOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** FieldOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** FieldOptions .google.api.fieldBehavior */ - ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); - - /** FieldOptions .google.api.resourceReference */ - ".google.api.resourceReference"?: (google.api.IResourceReference|null); - } - - /** Represents a FieldOptions. */ - class FieldOptions implements IFieldOptions { - - /** - * Constructs a new FieldOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFieldOptions); - - /** FieldOptions ctype. */ - public ctype: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType); - - /** FieldOptions packed. */ - public packed: boolean; - - /** FieldOptions jstype. */ - public jstype: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType); - - /** FieldOptions lazy. */ - public lazy: boolean; - - /** FieldOptions unverifiedLazy. */ - public unverifiedLazy: boolean; - - /** FieldOptions deprecated. */ - public deprecated: boolean; - - /** FieldOptions weak. */ - public weak: boolean; - - /** FieldOptions debugRedact. */ - public debugRedact: boolean; - - /** FieldOptions retention. */ - public retention: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention); - - /** FieldOptions targets. */ - public targets: google.protobuf.FieldOptions.OptionTargetType[]; - - /** FieldOptions editionDefaults. */ - public editionDefaults: google.protobuf.FieldOptions.IEditionDefault[]; - - /** FieldOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** FieldOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new FieldOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns FieldOptions instance - */ - public static create(properties?: google.protobuf.IFieldOptions): google.protobuf.FieldOptions; - - /** - * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @param message FieldOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @param message FieldOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FieldOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions; - - /** - * Decodes a FieldOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions; - - /** - * Verifies a FieldOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FieldOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions; - - /** - * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. - * @param message FieldOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FieldOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FieldOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FieldOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FieldOptions { - - /** CType enum. */ - enum CType { - STRING = 0, - CORD = 1, - STRING_PIECE = 2 - } - - /** JSType enum. */ - enum JSType { - JS_NORMAL = 0, - JS_STRING = 1, - JS_NUMBER = 2 - } - - /** OptionRetention enum. */ - enum OptionRetention { - RETENTION_UNKNOWN = 0, - RETENTION_RUNTIME = 1, - RETENTION_SOURCE = 2 - } - - /** OptionTargetType enum. */ - enum OptionTargetType { - TARGET_TYPE_UNKNOWN = 0, - TARGET_TYPE_FILE = 1, - TARGET_TYPE_EXTENSION_RANGE = 2, - TARGET_TYPE_MESSAGE = 3, - TARGET_TYPE_FIELD = 4, - TARGET_TYPE_ONEOF = 5, - TARGET_TYPE_ENUM = 6, - TARGET_TYPE_ENUM_ENTRY = 7, - TARGET_TYPE_SERVICE = 8, - TARGET_TYPE_METHOD = 9 - } - - /** Properties of an EditionDefault. */ - interface IEditionDefault { - - /** EditionDefault edition */ - edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - - /** EditionDefault value */ - value?: (string|null); - } - - /** Represents an EditionDefault. */ - class EditionDefault implements IEditionDefault { - - /** - * Constructs a new EditionDefault. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.FieldOptions.IEditionDefault); - - /** EditionDefault edition. */ - public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** EditionDefault value. */ - public value: string; - - /** - * Creates a new EditionDefault instance using the specified properties. - * @param [properties] Properties to set - * @returns EditionDefault instance - */ - public static create(properties?: google.protobuf.FieldOptions.IEditionDefault): google.protobuf.FieldOptions.EditionDefault; - - /** - * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. - * @param message EditionDefault message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. - * @param message EditionDefault message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EditionDefault message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions.EditionDefault; - - /** - * Decodes an EditionDefault message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions.EditionDefault; - - /** - * Verifies an EditionDefault message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EditionDefault - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions.EditionDefault; - - /** - * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. - * @param message EditionDefault - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FieldOptions.EditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EditionDefault to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EditionDefault - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an OneofOptions. */ - interface IOneofOptions { - - /** OneofOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** OneofOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - } - - /** Represents an OneofOptions. */ - class OneofOptions implements IOneofOptions { - - /** - * Constructs a new OneofOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IOneofOptions); - - /** OneofOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** OneofOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new OneofOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns OneofOptions instance - */ - public static create(properties?: google.protobuf.IOneofOptions): google.protobuf.OneofOptions; - - /** - * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @param message OneofOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @param message OneofOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OneofOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofOptions; - - /** - * Decodes an OneofOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofOptions; - - /** - * Verifies an OneofOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OneofOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.OneofOptions; - - /** - * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. - * @param message OneofOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.OneofOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OneofOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for OneofOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EnumOptions. */ - interface IEnumOptions { - - /** EnumOptions allowAlias */ - allowAlias?: (boolean|null); - - /** EnumOptions deprecated */ - deprecated?: (boolean|null); - - /** EnumOptions deprecatedLegacyJsonFieldConflicts */ - deprecatedLegacyJsonFieldConflicts?: (boolean|null); - - /** EnumOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** EnumOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - } - - /** Represents an EnumOptions. */ - class EnumOptions implements IEnumOptions { - - /** - * Constructs a new EnumOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumOptions); - - /** EnumOptions allowAlias. */ - public allowAlias: boolean; - - /** EnumOptions deprecated. */ - public deprecated: boolean; - - /** EnumOptions deprecatedLegacyJsonFieldConflicts. */ - public deprecatedLegacyJsonFieldConflicts: boolean; - - /** EnumOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** EnumOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new EnumOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumOptions instance - */ - public static create(properties?: google.protobuf.IEnumOptions): google.protobuf.EnumOptions; - - /** - * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @param message EnumOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @param message EnumOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumOptions; - - /** - * Decodes an EnumOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumOptions; - - /** - * Verifies an EnumOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumOptions; - - /** - * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. - * @param message EnumOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EnumValueOptions. */ - interface IEnumValueOptions { - - /** EnumValueOptions deprecated */ - deprecated?: (boolean|null); - - /** EnumValueOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** EnumValueOptions debugRedact */ - debugRedact?: (boolean|null); - - /** EnumValueOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - } - - /** Represents an EnumValueOptions. */ - class EnumValueOptions implements IEnumValueOptions { - - /** - * Constructs a new EnumValueOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumValueOptions); - - /** EnumValueOptions deprecated. */ - public deprecated: boolean; - - /** EnumValueOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** EnumValueOptions debugRedact. */ - public debugRedact: boolean; - - /** EnumValueOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new EnumValueOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumValueOptions instance - */ - public static create(properties?: google.protobuf.IEnumValueOptions): google.protobuf.EnumValueOptions; - - /** - * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @param message EnumValueOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @param message EnumValueOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumValueOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumValueOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueOptions; - - /** - * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumValueOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueOptions; - - /** - * Verifies an EnumValueOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumValueOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueOptions; - - /** - * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. - * @param message EnumValueOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumValueOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumValueOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ServiceOptions. */ - interface IServiceOptions { - - /** ServiceOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** ServiceOptions deprecated */ - deprecated?: (boolean|null); - - /** ServiceOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** ServiceOptions .google.api.defaultHost */ - ".google.api.defaultHost"?: (string|null); - - /** ServiceOptions .google.api.oauthScopes */ - ".google.api.oauthScopes"?: (string|null); - - /** ServiceOptions .google.api.apiVersion */ - ".google.api.apiVersion"?: (string|null); - } - - /** Represents a ServiceOptions. */ - class ServiceOptions implements IServiceOptions { - - /** - * Constructs a new ServiceOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IServiceOptions); - - /** ServiceOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** ServiceOptions deprecated. */ - public deprecated: boolean; - - /** ServiceOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new ServiceOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns ServiceOptions instance - */ - public static create(properties?: google.protobuf.IServiceOptions): google.protobuf.ServiceOptions; - - /** - * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @param message ServiceOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @param message ServiceOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ServiceOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceOptions; - - /** - * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceOptions; - - /** - * Verifies a ServiceOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ServiceOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; - - /** - * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. - * @param message ServiceOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ServiceOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ServiceOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a MethodOptions. */ - interface IMethodOptions { - - /** MethodOptions deprecated */ - deprecated?: (boolean|null); - - /** MethodOptions idempotencyLevel */ - idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); - - /** MethodOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** MethodOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** MethodOptions .google.api.http */ - ".google.api.http"?: (google.api.IHttpRule|null); - - /** MethodOptions .google.api.methodSignature */ - ".google.api.methodSignature"?: (string[]|null); - - /** MethodOptions .google.longrunning.operationInfo */ - ".google.longrunning.operationInfo"?: (google.longrunning.IOperationInfo|null); - } - - /** Represents a MethodOptions. */ - class MethodOptions implements IMethodOptions { - - /** - * Constructs a new MethodOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IMethodOptions); - - /** MethodOptions deprecated. */ - public deprecated: boolean; - - /** MethodOptions idempotencyLevel. */ - public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); - - /** MethodOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** MethodOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new MethodOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns MethodOptions instance - */ - public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; - - /** - * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @param message MethodOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @param message MethodOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MethodOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MethodOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodOptions; - - /** - * Decodes a MethodOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MethodOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodOptions; - - /** - * Verifies a MethodOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MethodOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; - - /** - * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. - * @param message MethodOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MethodOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MethodOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace MethodOptions { - - /** IdempotencyLevel enum. */ - enum IdempotencyLevel { - IDEMPOTENCY_UNKNOWN = 0, - NO_SIDE_EFFECTS = 1, - IDEMPOTENT = 2 - } - } - - /** Properties of an UninterpretedOption. */ - interface IUninterpretedOption { - - /** UninterpretedOption name */ - name?: (google.protobuf.UninterpretedOption.INamePart[]|null); - - /** UninterpretedOption identifierValue */ - identifierValue?: (string|null); - - /** UninterpretedOption positiveIntValue */ - positiveIntValue?: (number|Long|string|null); - - /** UninterpretedOption negativeIntValue */ - negativeIntValue?: (number|Long|string|null); - - /** UninterpretedOption doubleValue */ - doubleValue?: (number|null); - - /** UninterpretedOption stringValue */ - stringValue?: (Uint8Array|Buffer|string|null); - - /** UninterpretedOption aggregateValue */ - aggregateValue?: (string|null); - } - - /** Represents an UninterpretedOption. */ - class UninterpretedOption implements IUninterpretedOption { - - /** - * Constructs a new UninterpretedOption. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IUninterpretedOption); - - /** UninterpretedOption name. */ - public name: google.protobuf.UninterpretedOption.INamePart[]; - - /** UninterpretedOption identifierValue. */ - public identifierValue: string; - - /** UninterpretedOption positiveIntValue. */ - public positiveIntValue: (number|Long|string); - - /** UninterpretedOption negativeIntValue. */ - public negativeIntValue: (number|Long|string); - - /** UninterpretedOption doubleValue. */ - public doubleValue: number; - - /** UninterpretedOption stringValue. */ - public stringValue: (Uint8Array|Buffer|string); - - /** UninterpretedOption aggregateValue. */ - public aggregateValue: string; - - /** - * Creates a new UninterpretedOption instance using the specified properties. - * @param [properties] Properties to set - * @returns UninterpretedOption instance - */ - public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; - - /** - * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @param message UninterpretedOption message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @param message UninterpretedOption message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption; - - /** - * Verifies an UninterpretedOption message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UninterpretedOption - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; - - /** - * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. - * @param message UninterpretedOption - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UninterpretedOption to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UninterpretedOption - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace UninterpretedOption { - - /** Properties of a NamePart. */ - interface INamePart { - - /** NamePart namePart */ - namePart: string; - - /** NamePart isExtension */ - isExtension: boolean; - } - - /** Represents a NamePart. */ - class NamePart implements INamePart { - - /** - * Constructs a new NamePart. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.UninterpretedOption.INamePart); - - /** NamePart namePart. */ - public namePart: string; - - /** NamePart isExtension. */ - public isExtension: boolean; - - /** - * Creates a new NamePart instance using the specified properties. - * @param [properties] Properties to set - * @returns NamePart instance - */ - public static create(properties?: google.protobuf.UninterpretedOption.INamePart): google.protobuf.UninterpretedOption.NamePart; - - /** - * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @param message NamePart message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @param message NamePart message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a NamePart message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption.NamePart; - - /** - * Decodes a NamePart message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption.NamePart; - - /** - * Verifies a NamePart message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a NamePart message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns NamePart - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; - - /** - * Creates a plain object from a NamePart message. Also converts values to other types if specified. - * @param message NamePart - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this NamePart to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for NamePart - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a FeatureSet. */ - interface IFeatureSet { - - /** FeatureSet fieldPresence */ - fieldPresence?: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence|null); - - /** FeatureSet enumType */ - enumType?: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType|null); - - /** FeatureSet repeatedFieldEncoding */ - repeatedFieldEncoding?: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding|null); - - /** FeatureSet utf8Validation */ - utf8Validation?: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation|null); - - /** FeatureSet messageEncoding */ - messageEncoding?: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding|null); - - /** FeatureSet jsonFormat */ - jsonFormat?: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat|null); - } - - /** Represents a FeatureSet. */ - class FeatureSet implements IFeatureSet { - - /** - * Constructs a new FeatureSet. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFeatureSet); - - /** FeatureSet fieldPresence. */ - public fieldPresence: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence); - - /** FeatureSet enumType. */ - public enumType: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType); - - /** FeatureSet repeatedFieldEncoding. */ - public repeatedFieldEncoding: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding); - - /** FeatureSet utf8Validation. */ - public utf8Validation: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation); - - /** FeatureSet messageEncoding. */ - public messageEncoding: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding); - - /** FeatureSet jsonFormat. */ - public jsonFormat: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat); - - /** - * Creates a new FeatureSet instance using the specified properties. - * @param [properties] Properties to set - * @returns FeatureSet instance - */ - public static create(properties?: google.protobuf.IFeatureSet): google.protobuf.FeatureSet; - - /** - * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. - * @param message FeatureSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. - * @param message FeatureSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FeatureSet message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FeatureSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSet; - - /** - * Decodes a FeatureSet message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FeatureSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSet; - - /** - * Verifies a FeatureSet message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FeatureSet - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSet; - - /** - * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. - * @param message FeatureSet - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FeatureSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FeatureSet to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FeatureSet - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FeatureSet { - - /** FieldPresence enum. */ - enum FieldPresence { - FIELD_PRESENCE_UNKNOWN = 0, - EXPLICIT = 1, - IMPLICIT = 2, - LEGACY_REQUIRED = 3 - } - - /** EnumType enum. */ - enum EnumType { - ENUM_TYPE_UNKNOWN = 0, - OPEN = 1, - CLOSED = 2 - } - - /** RepeatedFieldEncoding enum. */ - enum RepeatedFieldEncoding { - REPEATED_FIELD_ENCODING_UNKNOWN = 0, - PACKED = 1, - EXPANDED = 2 - } - - /** Utf8Validation enum. */ - enum Utf8Validation { - UTF8_VALIDATION_UNKNOWN = 0, - VERIFY = 2, - NONE = 3 - } - - /** MessageEncoding enum. */ - enum MessageEncoding { - MESSAGE_ENCODING_UNKNOWN = 0, - LENGTH_PREFIXED = 1, - DELIMITED = 2 - } - - /** JsonFormat enum. */ - enum JsonFormat { - JSON_FORMAT_UNKNOWN = 0, - ALLOW = 1, - LEGACY_BEST_EFFORT = 2 - } - } - - /** Properties of a FeatureSetDefaults. */ - interface IFeatureSetDefaults { - - /** FeatureSetDefaults defaults */ - defaults?: (google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]|null); - - /** FeatureSetDefaults minimumEdition */ - minimumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - - /** FeatureSetDefaults maximumEdition */ - maximumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - } - - /** Represents a FeatureSetDefaults. */ - class FeatureSetDefaults implements IFeatureSetDefaults { - - /** - * Constructs a new FeatureSetDefaults. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFeatureSetDefaults); - - /** FeatureSetDefaults defaults. */ - public defaults: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]; - - /** FeatureSetDefaults minimumEdition. */ - public minimumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** FeatureSetDefaults maximumEdition. */ - public maximumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** - * Creates a new FeatureSetDefaults instance using the specified properties. - * @param [properties] Properties to set - * @returns FeatureSetDefaults instance - */ - public static create(properties?: google.protobuf.IFeatureSetDefaults): google.protobuf.FeatureSetDefaults; - - /** - * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. - * @param message FeatureSetDefaults message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. - * @param message FeatureSetDefaults message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FeatureSetDefaults message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FeatureSetDefaults - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSetDefaults; - - /** - * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FeatureSetDefaults - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSetDefaults; - - /** - * Verifies a FeatureSetDefaults message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FeatureSetDefaults - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults; - - /** - * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. - * @param message FeatureSetDefaults - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FeatureSetDefaults, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FeatureSetDefaults to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FeatureSetDefaults - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FeatureSetDefaults { - - /** Properties of a FeatureSetEditionDefault. */ - interface IFeatureSetEditionDefault { - - /** FeatureSetEditionDefault edition */ - edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - - /** FeatureSetEditionDefault features */ - features?: (google.protobuf.IFeatureSet|null); - } - - /** Represents a FeatureSetEditionDefault. */ - class FeatureSetEditionDefault implements IFeatureSetEditionDefault { - - /** - * Constructs a new FeatureSetEditionDefault. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault); - - /** FeatureSetEditionDefault edition. */ - public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** FeatureSetEditionDefault features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** - * Creates a new FeatureSetEditionDefault instance using the specified properties. - * @param [properties] Properties to set - * @returns FeatureSetEditionDefault instance - */ - public static create(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; - - /** - * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. - * @param message FeatureSetEditionDefault message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. - * @param message FeatureSetEditionDefault message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FeatureSetEditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; - - /** - * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FeatureSetEditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; - - /** - * Verifies a FeatureSetEditionDefault message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FeatureSetEditionDefault - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; - - /** - * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. - * @param message FeatureSetEditionDefault - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FeatureSetEditionDefault to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FeatureSetEditionDefault - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a SourceCodeInfo. */ - interface ISourceCodeInfo { - - /** SourceCodeInfo location */ - location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); - } - - /** Represents a SourceCodeInfo. */ - class SourceCodeInfo implements ISourceCodeInfo { - - /** - * Constructs a new SourceCodeInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.ISourceCodeInfo); - - /** SourceCodeInfo location. */ - public location: google.protobuf.SourceCodeInfo.ILocation[]; - - /** - * Creates a new SourceCodeInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns SourceCodeInfo instance - */ - public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; - - /** - * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @param message SourceCodeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @param message SourceCodeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo; - - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo; - - /** - * Verifies a SourceCodeInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SourceCodeInfo - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; - - /** - * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. - * @param message SourceCodeInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SourceCodeInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SourceCodeInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace SourceCodeInfo { - - /** Properties of a Location. */ - interface ILocation { - - /** Location path */ - path?: (number[]|null); - - /** Location span */ - span?: (number[]|null); - - /** Location leadingComments */ - leadingComments?: (string|null); - - /** Location trailingComments */ - trailingComments?: (string|null); - - /** Location leadingDetachedComments */ - leadingDetachedComments?: (string[]|null); - } - - /** Represents a Location. */ - class Location implements ILocation { - - /** - * Constructs a new Location. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); - - /** Location path. */ - public path: number[]; - - /** Location span. */ - public span: number[]; - - /** Location leadingComments. */ - public leadingComments: string; - - /** Location trailingComments. */ - public trailingComments: string; - - /** Location leadingDetachedComments. */ - public leadingDetachedComments: string[]; - - /** - * Creates a new Location instance using the specified properties. - * @param [properties] Properties to set - * @returns Location instance - */ - public static create(properties?: google.protobuf.SourceCodeInfo.ILocation): google.protobuf.SourceCodeInfo.Location; - - /** - * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @param message Location message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @param message Location message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Location message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo.Location; - - /** - * Decodes a Location message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo.Location; - - /** - * Verifies a Location message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Location message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Location - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; - - /** - * Creates a plain object from a Location message. Also converts values to other types if specified. - * @param message Location - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Location to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Location - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a GeneratedCodeInfo. */ - interface IGeneratedCodeInfo { - - /** GeneratedCodeInfo annotation */ - annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); - } - - /** Represents a GeneratedCodeInfo. */ - class GeneratedCodeInfo implements IGeneratedCodeInfo { - - /** - * Constructs a new GeneratedCodeInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IGeneratedCodeInfo); - - /** GeneratedCodeInfo annotation. */ - public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; - - /** - * Creates a new GeneratedCodeInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns GeneratedCodeInfo instance - */ - public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; - - /** - * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @param message GeneratedCodeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @param message GeneratedCodeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo; - - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo; - - /** - * Verifies a GeneratedCodeInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GeneratedCodeInfo - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; - - /** - * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. - * @param message GeneratedCodeInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GeneratedCodeInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GeneratedCodeInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace GeneratedCodeInfo { - - /** Properties of an Annotation. */ - interface IAnnotation { - - /** Annotation path */ - path?: (number[]|null); - - /** Annotation sourceFile */ - sourceFile?: (string|null); - - /** Annotation begin */ - begin?: (number|null); - - /** Annotation end */ - end?: (number|null); - - /** Annotation semantic */ - semantic?: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null); - } - - /** Represents an Annotation. */ - class Annotation implements IAnnotation { - - /** - * Constructs a new Annotation. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); - - /** Annotation path. */ - public path: number[]; - - /** Annotation sourceFile. */ - public sourceFile: string; - - /** Annotation begin. */ - public begin: number; - - /** Annotation end. */ - public end: number; - - /** Annotation semantic. */ - public semantic: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic); - - /** - * Creates a new Annotation instance using the specified properties. - * @param [properties] Properties to set - * @returns Annotation instance - */ - public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation; - - /** - * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @param message Annotation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @param message Annotation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Annotation message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo.Annotation; - - /** - * Decodes an Annotation message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo.Annotation; - - /** - * Verifies an Annotation message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Annotation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Annotation - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; - - /** - * Creates a plain object from an Annotation message. Also converts values to other types if specified. - * @param message Annotation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Annotation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Annotation - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Annotation { - - /** Semantic enum. */ - enum Semantic { - NONE = 0, - SET = 1, - ALIAS = 2 - } - } - } - - /** Properties of a Duration. */ - interface IDuration { - - /** Duration seconds */ - seconds?: (number|Long|string|null); - - /** Duration nanos */ - nanos?: (number|null); - } - - /** Represents a Duration. */ - class Duration implements IDuration { - - /** - * Constructs a new Duration. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IDuration); - - /** Duration seconds. */ - public seconds: (number|Long|string); - - /** Duration nanos. */ - public nanos: number; - - /** - * Creates a new Duration instance using the specified properties. - * @param [properties] Properties to set - * @returns Duration instance - */ - public static create(properties?: google.protobuf.IDuration): google.protobuf.Duration; - - /** - * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @param message Duration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @param message Duration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Duration message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Duration; - - /** - * Decodes a Duration message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Duration; - - /** - * Verifies a Duration message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Duration message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Duration - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; - - /** - * Creates a plain object from a Duration message. Also converts values to other types if specified. - * @param message Duration - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Duration to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Duration - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an Any. */ - interface IAny { - - /** Any type_url */ - type_url?: (string|null); - - /** Any value */ - value?: (Uint8Array|Buffer|string|null); - } - - /** Represents an Any. */ - class Any implements IAny { - - /** - * Constructs a new Any. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IAny); - - /** Any type_url. */ - public type_url: string; - - /** Any value. */ - public value: (Uint8Array|Buffer|string); - - /** - * Creates a new Any instance using the specified properties. - * @param [properties] Properties to set - * @returns Any instance - */ - public static create(properties?: google.protobuf.IAny): google.protobuf.Any; - - /** - * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. - * @param message Any message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. - * @param message Any message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Any message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Any - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Any; - - /** - * Decodes an Any message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Any - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Any; - - /** - * Verifies an Any message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Any message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Any - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Any; - - /** - * Creates a plain object from an Any message. Also converts values to other types if specified. - * @param message Any - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Any, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Any to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Any - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an Empty. */ - interface IEmpty { - } - - /** Represents an Empty. */ - class Empty implements IEmpty { - - /** - * Constructs a new Empty. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEmpty); - - /** - * Creates a new Empty instance using the specified properties. - * @param [properties] Properties to set - * @returns Empty instance - */ - public static create(properties?: google.protobuf.IEmpty): google.protobuf.Empty; - - /** - * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. - * @param message Empty message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. - * @param message Empty message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Empty message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Empty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Empty; - - /** - * Decodes an Empty message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Empty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Empty; - - /** - * Verifies an Empty message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Empty message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Empty - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Empty; - - /** - * Creates a plain object from an Empty message. Also converts values to other types if specified. - * @param message Empty - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Empty to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Empty - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a FieldMask. */ - interface IFieldMask { - - /** FieldMask paths */ - paths?: (string[]|null); - } - - /** Represents a FieldMask. */ - class FieldMask implements IFieldMask { - - /** - * Constructs a new FieldMask. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFieldMask); - - /** FieldMask paths. */ - public paths: string[]; - - /** - * Creates a new FieldMask instance using the specified properties. - * @param [properties] Properties to set - * @returns FieldMask instance - */ - public static create(properties?: google.protobuf.IFieldMask): google.protobuf.FieldMask; - - /** - * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. - * @param message FieldMask message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. - * @param message FieldMask message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FieldMask message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FieldMask - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldMask; - - /** - * Decodes a FieldMask message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FieldMask - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldMask; - - /** - * Verifies a FieldMask message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FieldMask - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldMask; - - /** - * Creates a plain object from a FieldMask message. Also converts values to other types if specified. - * @param message FieldMask - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FieldMask, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FieldMask to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FieldMask - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Timestamp. */ - interface ITimestamp { - - /** Timestamp seconds */ - seconds?: (number|Long|string|null); - - /** Timestamp nanos */ - nanos?: (number|null); - } - - /** Represents a Timestamp. */ - class Timestamp implements ITimestamp { - - /** - * Constructs a new Timestamp. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.ITimestamp); - - /** Timestamp seconds. */ - public seconds: (number|Long|string); - - /** Timestamp nanos. */ - public nanos: number; - - /** - * Creates a new Timestamp instance using the specified properties. - * @param [properties] Properties to set - * @returns Timestamp instance - */ - public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp; - - /** - * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @param message Timestamp message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @param message Timestamp message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Timestamp message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Timestamp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Timestamp; - - /** - * Decodes a Timestamp message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Timestamp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Timestamp; - - /** - * Verifies a Timestamp message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Timestamp - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; - - /** - * Creates a plain object from a Timestamp message. Also converts values to other types if specified. - * @param message Timestamp - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Timestamp to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Timestamp - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Struct. */ - interface IStruct { - - /** Struct fields */ - fields?: ({ [k: string]: google.protobuf.IValue }|null); - } - - /** Represents a Struct. */ - class Struct implements IStruct { - - /** - * Constructs a new Struct. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IStruct); - - /** Struct fields. */ - public fields: { [k: string]: google.protobuf.IValue }; - - /** - * Creates a new Struct instance using the specified properties. - * @param [properties] Properties to set - * @returns Struct instance - */ - public static create(properties?: google.protobuf.IStruct): google.protobuf.Struct; - - /** - * Encodes the specified Struct message. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. - * @param message Struct message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IStruct, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Struct message, length delimited. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. - * @param message Struct message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IStruct, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Struct message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Struct - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Struct; - - /** - * Decodes a Struct message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Struct - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Struct; - - /** - * Verifies a Struct message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Struct message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Struct - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Struct; - - /** - * Creates a plain object from a Struct message. Also converts values to other types if specified. - * @param message Struct - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Struct, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Struct to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Struct - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Value. */ - interface IValue { - - /** Value nullValue */ - nullValue?: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue|null); - - /** Value numberValue */ - numberValue?: (number|null); - - /** Value stringValue */ - stringValue?: (string|null); - - /** Value boolValue */ - boolValue?: (boolean|null); - - /** Value structValue */ - structValue?: (google.protobuf.IStruct|null); - - /** Value listValue */ - listValue?: (google.protobuf.IListValue|null); - } - - /** Represents a Value. */ - class Value implements IValue { - - /** - * Constructs a new Value. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IValue); - - /** Value nullValue. */ - public nullValue?: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue|null); - - /** Value numberValue. */ - public numberValue?: (number|null); - - /** Value stringValue. */ - public stringValue?: (string|null); - - /** Value boolValue. */ - public boolValue?: (boolean|null); - - /** Value structValue. */ - public structValue?: (google.protobuf.IStruct|null); - - /** Value listValue. */ - public listValue?: (google.protobuf.IListValue|null); - - /** Value kind. */ - public kind?: ("nullValue"|"numberValue"|"stringValue"|"boolValue"|"structValue"|"listValue"); - - /** - * Creates a new Value instance using the specified properties. - * @param [properties] Properties to set - * @returns Value instance - */ - public static create(properties?: google.protobuf.IValue): google.protobuf.Value; - - /** - * Encodes the specified Value message. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. - * @param message Value message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Value message, length delimited. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. - * @param message Value message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Value message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Value; - - /** - * Decodes a Value message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Value; - - /** - * Verifies a Value message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Value message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Value - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Value; - - /** - * Creates a plain object from a Value message. Also converts values to other types if specified. - * @param message Value - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Value to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Value - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** NullValue enum. */ - enum NullValue { - NULL_VALUE = 0 - } - - /** Properties of a ListValue. */ - interface IListValue { - - /** ListValue values */ - values?: (google.protobuf.IValue[]|null); - } - - /** Represents a ListValue. */ - class ListValue implements IListValue { - - /** - * Constructs a new ListValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IListValue); - - /** ListValue values. */ - public values: google.protobuf.IValue[]; - - /** - * Creates a new ListValue instance using the specified properties. - * @param [properties] Properties to set - * @returns ListValue instance - */ - public static create(properties?: google.protobuf.IListValue): google.protobuf.ListValue; - - /** - * Encodes the specified ListValue message. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. - * @param message ListValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IListValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListValue message, length delimited. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. - * @param message ListValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IListValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListValue message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListValue - * @throws {Error} If the payload is not 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.ListValue; - - /** - * Decodes a ListValue message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListValue - * @throws {Error} If the payload 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.ListValue; - - /** - * Verifies a ListValue message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListValue - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ListValue; - - /** - * Creates a plain object from a ListValue message. Also converts values to other types if specified. - * @param message ListValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ListValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListValue - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Namespace longrunning. */ - namespace longrunning { - - /** Represents an Operations */ - class Operations extends $protobuf.rpc.Service { - - /** - * Constructs a new Operations service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - - /** - * Creates new Operations service using the specified rpc implementation. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - * @returns RPC service. Useful where requests and/or responses are streamed. - */ - public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Operations; - - /** - * Calls ListOperations. - * @param request ListOperationsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListOperationsResponse - */ - public listOperations(request: google.longrunning.IListOperationsRequest, callback: google.longrunning.Operations.ListOperationsCallback): void; - - /** - * Calls ListOperations. - * @param request ListOperationsRequest message or plain object - * @returns Promise - */ - public listOperations(request: google.longrunning.IListOperationsRequest): Promise; - - /** - * Calls GetOperation. - * @param request GetOperationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public getOperation(request: google.longrunning.IGetOperationRequest, callback: google.longrunning.Operations.GetOperationCallback): void; - - /** - * Calls GetOperation. - * @param request GetOperationRequest message or plain object - * @returns Promise - */ - public getOperation(request: google.longrunning.IGetOperationRequest): Promise; - - /** - * Calls DeleteOperation. - * @param request DeleteOperationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteOperation(request: google.longrunning.IDeleteOperationRequest, callback: google.longrunning.Operations.DeleteOperationCallback): void; - - /** - * Calls DeleteOperation. - * @param request DeleteOperationRequest message or plain object - * @returns Promise - */ - public deleteOperation(request: google.longrunning.IDeleteOperationRequest): Promise; - - /** - * Calls CancelOperation. - * @param request CancelOperationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public cancelOperation(request: google.longrunning.ICancelOperationRequest, callback: google.longrunning.Operations.CancelOperationCallback): void; - - /** - * Calls CancelOperation. - * @param request CancelOperationRequest message or plain object - * @returns Promise - */ - public cancelOperation(request: google.longrunning.ICancelOperationRequest): Promise; - - /** - * Calls WaitOperation. - * @param request WaitOperationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public waitOperation(request: google.longrunning.IWaitOperationRequest, callback: google.longrunning.Operations.WaitOperationCallback): void; - - /** - * Calls WaitOperation. - * @param request WaitOperationRequest message or plain object - * @returns Promise - */ - public waitOperation(request: google.longrunning.IWaitOperationRequest): Promise; - } - - namespace Operations { - - /** - * Callback as used by {@link google.longrunning.Operations|listOperations}. - * @param error Error, if any - * @param [response] ListOperationsResponse - */ - type ListOperationsCallback = (error: (Error|null), response?: google.longrunning.ListOperationsResponse) => void; - - /** - * Callback as used by {@link google.longrunning.Operations|getOperation}. - * @param error Error, if any - * @param [response] Operation - */ - type GetOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.longrunning.Operations|deleteOperation}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.longrunning.Operations|cancelOperation}. - * @param error Error, if any - * @param [response] Empty - */ - type CancelOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.longrunning.Operations|waitOperation}. - * @param error Error, if any - * @param [response] Operation - */ - type WaitOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - } - - /** Properties of an Operation. */ - interface IOperation { - - /** Operation name */ - name?: (string|null); - - /** Operation metadata */ - metadata?: (google.protobuf.IAny|null); - - /** Operation done */ - done?: (boolean|null); - - /** Operation error */ - error?: (google.rpc.IStatus|null); - - /** Operation response */ - response?: (google.protobuf.IAny|null); - } - - /** Represents an Operation. */ - class Operation implements IOperation { - - /** - * Constructs a new Operation. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IOperation); - - /** Operation name. */ - public name: string; - - /** Operation metadata. */ - public metadata?: (google.protobuf.IAny|null); - - /** Operation done. */ - public done: boolean; - - /** Operation error. */ - public error?: (google.rpc.IStatus|null); - - /** Operation response. */ - public response?: (google.protobuf.IAny|null); - - /** Operation result. */ - public result?: ("error"|"response"); - - /** - * Creates a new Operation instance using the specified properties. - * @param [properties] Properties to set - * @returns Operation instance - */ - public static create(properties?: google.longrunning.IOperation): google.longrunning.Operation; - - /** - * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. - * @param message Operation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. - * @param message Operation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Operation message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Operation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.Operation; - - /** - * Decodes an Operation message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Operation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.Operation; - - /** - * Verifies an Operation message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Operation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Operation - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.Operation; - - /** - * Creates a plain object from an Operation message. Also converts values to other types if specified. - * @param message Operation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.Operation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Operation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Operation - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetOperationRequest. */ - interface IGetOperationRequest { - - /** GetOperationRequest name */ - name?: (string|null); - } - - /** Represents a GetOperationRequest. */ - class GetOperationRequest implements IGetOperationRequest { - - /** - * Constructs a new GetOperationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IGetOperationRequest); - - /** GetOperationRequest name. */ - public name: string; - - /** - * Creates a new GetOperationRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetOperationRequest instance - */ - public static create(properties?: google.longrunning.IGetOperationRequest): google.longrunning.GetOperationRequest; - - /** - * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. - * @param message GetOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. - * @param message GetOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetOperationRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.GetOperationRequest; - - /** - * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.GetOperationRequest; - - /** - * Verifies a GetOperationRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetOperationRequest - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.GetOperationRequest; - - /** - * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. - * @param message GetOperationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.GetOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetOperationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetOperationRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListOperationsRequest. */ - interface IListOperationsRequest { - - /** ListOperationsRequest name */ - name?: (string|null); - - /** ListOperationsRequest filter */ - filter?: (string|null); - - /** ListOperationsRequest pageSize */ - pageSize?: (number|null); - - /** ListOperationsRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListOperationsRequest. */ - class ListOperationsRequest implements IListOperationsRequest { - - /** - * Constructs a new ListOperationsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IListOperationsRequest); - - /** ListOperationsRequest name. */ - public name: string; - - /** ListOperationsRequest filter. */ - public filter: string; - - /** ListOperationsRequest pageSize. */ - public pageSize: number; - - /** ListOperationsRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListOperationsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListOperationsRequest instance - */ - public static create(properties?: google.longrunning.IListOperationsRequest): google.longrunning.ListOperationsRequest; - - /** - * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. - * @param message ListOperationsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. - * @param message ListOperationsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListOperationsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListOperationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsRequest; - - /** - * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListOperationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsRequest; - - /** - * Verifies a ListOperationsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListOperationsRequest - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsRequest; - - /** - * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. - * @param message ListOperationsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.ListOperationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListOperationsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListOperationsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListOperationsResponse. */ - interface IListOperationsResponse { - - /** ListOperationsResponse operations */ - operations?: (google.longrunning.IOperation[]|null); - - /** ListOperationsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListOperationsResponse. */ - class ListOperationsResponse implements IListOperationsResponse { - - /** - * Constructs a new ListOperationsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IListOperationsResponse); - - /** ListOperationsResponse operations. */ - public operations: google.longrunning.IOperation[]; - - /** ListOperationsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListOperationsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListOperationsResponse instance - */ - public static create(properties?: google.longrunning.IListOperationsResponse): google.longrunning.ListOperationsResponse; - - /** - * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. - * @param message ListOperationsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. - * @param message ListOperationsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListOperationsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListOperationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsResponse; - - /** - * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListOperationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsResponse; - - /** - * Verifies a ListOperationsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListOperationsResponse - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsResponse; - - /** - * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. - * @param message ListOperationsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.ListOperationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListOperationsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListOperationsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CancelOperationRequest. */ - interface ICancelOperationRequest { - - /** CancelOperationRequest name */ - name?: (string|null); - } - - /** Represents a CancelOperationRequest. */ - class CancelOperationRequest implements ICancelOperationRequest { - - /** - * Constructs a new CancelOperationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.ICancelOperationRequest); - - /** CancelOperationRequest name. */ - public name: string; - - /** - * Creates a new CancelOperationRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CancelOperationRequest instance - */ - public static create(properties?: google.longrunning.ICancelOperationRequest): google.longrunning.CancelOperationRequest; - - /** - * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. - * @param message CancelOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. - * @param message CancelOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CancelOperationRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CancelOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.CancelOperationRequest; - - /** - * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CancelOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.CancelOperationRequest; - - /** - * Verifies a CancelOperationRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CancelOperationRequest - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.CancelOperationRequest; - - /** - * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. - * @param message CancelOperationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.CancelOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CancelOperationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CancelOperationRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteOperationRequest. */ - interface IDeleteOperationRequest { - - /** DeleteOperationRequest name */ - name?: (string|null); - } - - /** Represents a DeleteOperationRequest. */ - class DeleteOperationRequest implements IDeleteOperationRequest { - - /** - * Constructs a new DeleteOperationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IDeleteOperationRequest); - - /** DeleteOperationRequest name. */ - public name: string; - - /** - * Creates a new DeleteOperationRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteOperationRequest instance - */ - public static create(properties?: google.longrunning.IDeleteOperationRequest): google.longrunning.DeleteOperationRequest; - - /** - * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. - * @param message DeleteOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. - * @param message DeleteOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteOperationRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.DeleteOperationRequest; - - /** - * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.DeleteOperationRequest; - - /** - * Verifies a DeleteOperationRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteOperationRequest - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.DeleteOperationRequest; - - /** - * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. - * @param message DeleteOperationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.DeleteOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteOperationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteOperationRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a WaitOperationRequest. */ - interface IWaitOperationRequest { - - /** WaitOperationRequest name */ - name?: (string|null); - - /** WaitOperationRequest timeout */ - timeout?: (google.protobuf.IDuration|null); - } - - /** Represents a WaitOperationRequest. */ - class WaitOperationRequest implements IWaitOperationRequest { - - /** - * Constructs a new WaitOperationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IWaitOperationRequest); - - /** WaitOperationRequest name. */ - public name: string; - - /** WaitOperationRequest timeout. */ - public timeout?: (google.protobuf.IDuration|null); - - /** - * Creates a new WaitOperationRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns WaitOperationRequest instance - */ - public static create(properties?: google.longrunning.IWaitOperationRequest): google.longrunning.WaitOperationRequest; - - /** - * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. - * @param message WaitOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. - * @param message WaitOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a WaitOperationRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns WaitOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.WaitOperationRequest; - - /** - * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns WaitOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.WaitOperationRequest; - - /** - * Verifies a WaitOperationRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns WaitOperationRequest - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.WaitOperationRequest; - - /** - * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. - * @param message WaitOperationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.WaitOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this WaitOperationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for WaitOperationRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an OperationInfo. */ - interface IOperationInfo { - - /** OperationInfo responseType */ - responseType?: (string|null); - - /** OperationInfo metadataType */ - metadataType?: (string|null); - } - - /** Represents an OperationInfo. */ - class OperationInfo implements IOperationInfo { - - /** - * Constructs a new OperationInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IOperationInfo); - - /** OperationInfo responseType. */ - public responseType: string; - - /** OperationInfo metadataType. */ - public metadataType: string; - - /** - * Creates a new OperationInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns OperationInfo instance - */ - public static create(properties?: google.longrunning.IOperationInfo): google.longrunning.OperationInfo; - - /** - * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. - * @param message OperationInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. - * @param message OperationInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OperationInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OperationInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.OperationInfo; - - /** - * Decodes an OperationInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OperationInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.OperationInfo; - - /** - * Verifies an OperationInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OperationInfo - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.OperationInfo; - - /** - * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. - * @param message OperationInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.OperationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OperationInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for OperationInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Namespace rpc. */ - namespace rpc { - - /** Properties of a Status. */ - interface IStatus { - - /** Status code */ - code?: (number|null); - - /** Status message */ - message?: (string|null); - - /** Status details */ - details?: (google.protobuf.IAny[]|null); - } - - /** Represents a Status. */ - class Status implements IStatus { - - /** - * Constructs a new Status. - * @param [properties] Properties to set - */ - constructor(properties?: google.rpc.IStatus); - - /** Status code. */ - public code: number; - - /** Status message. */ - public message: string; - - /** Status details. */ - public details: google.protobuf.IAny[]; - - /** - * Creates a new Status instance using the specified properties. - * @param [properties] Properties to set - * @returns Status instance - */ - public static create(properties?: google.rpc.IStatus): google.rpc.Status; - - /** - * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. - * @param message Status message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. - * @param message Status message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Status message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Status - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.rpc.Status; - - /** - * Decodes a Status message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Status - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.rpc.Status; - - /** - * Verifies a Status message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Status message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Status - */ - public static fromObject(object: { [k: string]: any }): google.rpc.Status; - - /** - * Creates a plain object from a Status message. Also converts values to other types if specified. - * @param message Status - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.rpc.Status, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Status to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Status - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Namespace iam. */ - namespace iam { - - /** Namespace v1. */ - namespace v1 { - - /** Represents a IAMPolicy */ - class IAMPolicy extends $protobuf.rpc.Service { - - /** - * Constructs a new IAMPolicy service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - - /** - * Creates new IAMPolicy service using the specified rpc implementation. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - * @returns RPC service. Useful where requests and/or responses are streamed. - */ - public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): IAMPolicy; - - /** - * Calls SetIamPolicy. - * @param request SetIamPolicyRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Policy - */ - public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest, callback: google.iam.v1.IAMPolicy.SetIamPolicyCallback): void; - - /** - * Calls SetIamPolicy. - * @param request SetIamPolicyRequest message or plain object - * @returns Promise - */ - public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest): Promise; - - /** - * Calls GetIamPolicy. - * @param request GetIamPolicyRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Policy - */ - public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest, callback: google.iam.v1.IAMPolicy.GetIamPolicyCallback): void; - - /** - * Calls GetIamPolicy. - * @param request GetIamPolicyRequest message or plain object - * @returns Promise - */ - public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest): Promise; - - /** - * Calls TestIamPermissions. - * @param request TestIamPermissionsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and TestIamPermissionsResponse - */ - public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest, callback: google.iam.v1.IAMPolicy.TestIamPermissionsCallback): void; - - /** - * Calls TestIamPermissions. - * @param request TestIamPermissionsRequest message or plain object - * @returns Promise - */ - public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest): Promise; - } - - namespace IAMPolicy { - - /** - * Callback as used by {@link google.iam.v1.IAMPolicy|setIamPolicy}. - * @param error Error, if any - * @param [response] Policy - */ - type SetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; - - /** - * Callback as used by {@link google.iam.v1.IAMPolicy|getIamPolicy}. - * @param error Error, if any - * @param [response] Policy - */ - type GetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; - - /** - * Callback as used by {@link google.iam.v1.IAMPolicy|testIamPermissions}. - * @param error Error, if any - * @param [response] TestIamPermissionsResponse - */ - type TestIamPermissionsCallback = (error: (Error|null), response?: google.iam.v1.TestIamPermissionsResponse) => void; - } - - /** Properties of a SetIamPolicyRequest. */ - interface ISetIamPolicyRequest { - - /** SetIamPolicyRequest resource */ - resource?: (string|null); - - /** SetIamPolicyRequest policy */ - policy?: (google.iam.v1.IPolicy|null); - - /** SetIamPolicyRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - } - - /** Represents a SetIamPolicyRequest. */ - class SetIamPolicyRequest implements ISetIamPolicyRequest { - - /** - * Constructs a new SetIamPolicyRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.ISetIamPolicyRequest); - - /** SetIamPolicyRequest resource. */ - public resource: string; - - /** SetIamPolicyRequest policy. */ - public policy?: (google.iam.v1.IPolicy|null); - - /** SetIamPolicyRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** - * Creates a new SetIamPolicyRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns SetIamPolicyRequest instance - */ - public static create(properties?: google.iam.v1.ISetIamPolicyRequest): google.iam.v1.SetIamPolicyRequest; - - /** - * Encodes the specified SetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. - * @param message SetIamPolicyRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.ISetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. - * @param message SetIamPolicyRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.ISetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SetIamPolicyRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SetIamPolicyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.SetIamPolicyRequest; - - /** - * Decodes a SetIamPolicyRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SetIamPolicyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.SetIamPolicyRequest; - - /** - * Verifies a SetIamPolicyRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SetIamPolicyRequest - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.SetIamPolicyRequest; - - /** - * Creates a plain object from a SetIamPolicyRequest message. Also converts values to other types if specified. - * @param message SetIamPolicyRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.SetIamPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SetIamPolicyRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SetIamPolicyRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetIamPolicyRequest. */ - interface IGetIamPolicyRequest { - - /** GetIamPolicyRequest resource */ - resource?: (string|null); - - /** GetIamPolicyRequest options */ - options?: (google.iam.v1.IGetPolicyOptions|null); - } - - /** Represents a GetIamPolicyRequest. */ - class GetIamPolicyRequest implements IGetIamPolicyRequest { - - /** - * Constructs a new GetIamPolicyRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.IGetIamPolicyRequest); - - /** GetIamPolicyRequest resource. */ - public resource: string; - - /** GetIamPolicyRequest options. */ - public options?: (google.iam.v1.IGetPolicyOptions|null); - - /** - * Creates a new GetIamPolicyRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetIamPolicyRequest instance - */ - public static create(properties?: google.iam.v1.IGetIamPolicyRequest): google.iam.v1.GetIamPolicyRequest; - - /** - * Encodes the specified GetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. - * @param message GetIamPolicyRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.IGetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. - * @param message GetIamPolicyRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.IGetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetIamPolicyRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetIamPolicyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.GetIamPolicyRequest; - - /** - * Decodes a GetIamPolicyRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetIamPolicyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.GetIamPolicyRequest; - - /** - * Verifies a GetIamPolicyRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetIamPolicyRequest - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.GetIamPolicyRequest; - - /** - * Creates a plain object from a GetIamPolicyRequest message. Also converts values to other types if specified. - * @param message GetIamPolicyRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.GetIamPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetIamPolicyRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetIamPolicyRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a TestIamPermissionsRequest. */ - interface ITestIamPermissionsRequest { - - /** TestIamPermissionsRequest resource */ - resource?: (string|null); - - /** TestIamPermissionsRequest permissions */ - permissions?: (string[]|null); - } - - /** Represents a TestIamPermissionsRequest. */ - class TestIamPermissionsRequest implements ITestIamPermissionsRequest { - - /** - * Constructs a new TestIamPermissionsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.ITestIamPermissionsRequest); - - /** TestIamPermissionsRequest resource. */ - public resource: string; - - /** TestIamPermissionsRequest permissions. */ - public permissions: string[]; - - /** - * Creates a new TestIamPermissionsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns TestIamPermissionsRequest instance - */ - public static create(properties?: google.iam.v1.ITestIamPermissionsRequest): google.iam.v1.TestIamPermissionsRequest; - - /** - * Encodes the specified TestIamPermissionsRequest message. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. - * @param message TestIamPermissionsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.ITestIamPermissionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TestIamPermissionsRequest message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. - * @param message TestIamPermissionsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.ITestIamPermissionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TestIamPermissionsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TestIamPermissionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.TestIamPermissionsRequest; - - /** - * Decodes a TestIamPermissionsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TestIamPermissionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.TestIamPermissionsRequest; - - /** - * Verifies a TestIamPermissionsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TestIamPermissionsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TestIamPermissionsRequest - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.TestIamPermissionsRequest; - - /** - * Creates a plain object from a TestIamPermissionsRequest message. Also converts values to other types if specified. - * @param message TestIamPermissionsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.TestIamPermissionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TestIamPermissionsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TestIamPermissionsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a TestIamPermissionsResponse. */ - interface ITestIamPermissionsResponse { - - /** TestIamPermissionsResponse permissions */ - permissions?: (string[]|null); - } - - /** Represents a TestIamPermissionsResponse. */ - class TestIamPermissionsResponse implements ITestIamPermissionsResponse { - - /** - * Constructs a new TestIamPermissionsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.ITestIamPermissionsResponse); - - /** TestIamPermissionsResponse permissions. */ - public permissions: string[]; - - /** - * Creates a new TestIamPermissionsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns TestIamPermissionsResponse instance - */ - public static create(properties?: google.iam.v1.ITestIamPermissionsResponse): google.iam.v1.TestIamPermissionsResponse; - - /** - * Encodes the specified TestIamPermissionsResponse message. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. - * @param message TestIamPermissionsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.ITestIamPermissionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TestIamPermissionsResponse message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. - * @param message TestIamPermissionsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.ITestIamPermissionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TestIamPermissionsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TestIamPermissionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.TestIamPermissionsResponse; - - /** - * Decodes a TestIamPermissionsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TestIamPermissionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.TestIamPermissionsResponse; - - /** - * Verifies a TestIamPermissionsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TestIamPermissionsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TestIamPermissionsResponse - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.TestIamPermissionsResponse; - - /** - * Creates a plain object from a TestIamPermissionsResponse message. Also converts values to other types if specified. - * @param message TestIamPermissionsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.TestIamPermissionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TestIamPermissionsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TestIamPermissionsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetPolicyOptions. */ - interface IGetPolicyOptions { - - /** GetPolicyOptions requestedPolicyVersion */ - requestedPolicyVersion?: (number|null); - } - - /** Represents a GetPolicyOptions. */ - class GetPolicyOptions implements IGetPolicyOptions { - - /** - * Constructs a new GetPolicyOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.IGetPolicyOptions); - - /** GetPolicyOptions requestedPolicyVersion. */ - public requestedPolicyVersion: number; - - /** - * Creates a new GetPolicyOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns GetPolicyOptions instance - */ - public static create(properties?: google.iam.v1.IGetPolicyOptions): google.iam.v1.GetPolicyOptions; - - /** - * Encodes the specified GetPolicyOptions message. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages. - * @param message GetPolicyOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.IGetPolicyOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetPolicyOptions message, length delimited. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages. - * @param message GetPolicyOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.IGetPolicyOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetPolicyOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetPolicyOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.GetPolicyOptions; - - /** - * Decodes a GetPolicyOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetPolicyOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.GetPolicyOptions; - - /** - * Verifies a GetPolicyOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetPolicyOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetPolicyOptions - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.GetPolicyOptions; - - /** - * Creates a plain object from a GetPolicyOptions message. Also converts values to other types if specified. - * @param message GetPolicyOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.GetPolicyOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetPolicyOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetPolicyOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Policy. */ - interface IPolicy { - - /** Policy version */ - version?: (number|null); - - /** Policy bindings */ - bindings?: (google.iam.v1.IBinding[]|null); - - /** Policy auditConfigs */ - auditConfigs?: (google.iam.v1.IAuditConfig[]|null); - - /** Policy etag */ - etag?: (Uint8Array|Buffer|string|null); - } - - /** Represents a Policy. */ - class Policy implements IPolicy { - - /** - * Constructs a new Policy. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.IPolicy); - - /** Policy version. */ - public version: number; - - /** Policy bindings. */ - public bindings: google.iam.v1.IBinding[]; - - /** Policy auditConfigs. */ - public auditConfigs: google.iam.v1.IAuditConfig[]; - - /** Policy etag. */ - public etag: (Uint8Array|Buffer|string); - - /** - * Creates a new Policy instance using the specified properties. - * @param [properties] Properties to set - * @returns Policy instance - */ - public static create(properties?: google.iam.v1.IPolicy): google.iam.v1.Policy; - - /** - * Encodes the specified Policy message. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. - * @param message Policy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.IPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Policy message, length delimited. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. - * @param message Policy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.IPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Policy message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Policy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.Policy; - - /** - * Decodes a Policy message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Policy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.Policy; - - /** - * Verifies a Policy message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Policy message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Policy - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.Policy; - - /** - * Creates a plain object from a Policy message. Also converts values to other types if specified. - * @param message Policy - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.Policy, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Policy to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Policy - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Binding. */ - interface IBinding { - - /** Binding role */ - role?: (string|null); - - /** Binding members */ - members?: (string[]|null); - - /** Binding condition */ - condition?: (google.type.IExpr|null); - } - - /** Represents a Binding. */ - class Binding implements IBinding { - - /** - * Constructs a new Binding. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.IBinding); - - /** Binding role. */ - public role: string; - - /** Binding members. */ - public members: string[]; - - /** Binding condition. */ - public condition?: (google.type.IExpr|null); - - /** - * Creates a new Binding instance using the specified properties. - * @param [properties] Properties to set - * @returns Binding instance - */ - public static create(properties?: google.iam.v1.IBinding): google.iam.v1.Binding; - - /** - * Encodes the specified Binding message. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. - * @param message Binding message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.IBinding, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Binding message, length delimited. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. - * @param message Binding message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.IBinding, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Binding message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Binding - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.Binding; - - /** - * Decodes a Binding message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Binding - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.Binding; - - /** - * Verifies a Binding message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Binding message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Binding - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.Binding; - - /** - * Creates a plain object from a Binding message. Also converts values to other types if specified. - * @param message Binding - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.Binding, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Binding to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Binding - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an AuditConfig. */ - interface IAuditConfig { - - /** AuditConfig service */ - service?: (string|null); - - /** AuditConfig auditLogConfigs */ - auditLogConfigs?: (google.iam.v1.IAuditLogConfig[]|null); - } - - /** Represents an AuditConfig. */ - class AuditConfig implements IAuditConfig { - - /** - * Constructs a new AuditConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.IAuditConfig); - - /** AuditConfig service. */ - public service: string; - - /** AuditConfig auditLogConfigs. */ - public auditLogConfigs: google.iam.v1.IAuditLogConfig[]; - - /** - * Creates a new AuditConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns AuditConfig instance - */ - public static create(properties?: google.iam.v1.IAuditConfig): google.iam.v1.AuditConfig; - - /** - * Encodes the specified AuditConfig message. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. - * @param message AuditConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.IAuditConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AuditConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. - * @param message AuditConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.IAuditConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AuditConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AuditConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.AuditConfig; - - /** - * Decodes an AuditConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AuditConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.AuditConfig; - - /** - * Verifies an AuditConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an AuditConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AuditConfig - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditConfig; - - /** - * Creates a plain object from an AuditConfig message. Also converts values to other types if specified. - * @param message AuditConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.AuditConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AuditConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AuditConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an AuditLogConfig. */ - interface IAuditLogConfig { - - /** AuditLogConfig logType */ - logType?: (google.iam.v1.AuditLogConfig.LogType|keyof typeof google.iam.v1.AuditLogConfig.LogType|null); - - /** AuditLogConfig exemptedMembers */ - exemptedMembers?: (string[]|null); - } - - /** Represents an AuditLogConfig. */ - class AuditLogConfig implements IAuditLogConfig { - - /** - * Constructs a new AuditLogConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.IAuditLogConfig); - - /** AuditLogConfig logType. */ - public logType: (google.iam.v1.AuditLogConfig.LogType|keyof typeof google.iam.v1.AuditLogConfig.LogType); - - /** AuditLogConfig exemptedMembers. */ - public exemptedMembers: string[]; - - /** - * Creates a new AuditLogConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns AuditLogConfig instance - */ - public static create(properties?: google.iam.v1.IAuditLogConfig): google.iam.v1.AuditLogConfig; - - /** - * Encodes the specified AuditLogConfig message. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. - * @param message AuditLogConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.IAuditLogConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AuditLogConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. - * @param message AuditLogConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.IAuditLogConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AuditLogConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AuditLogConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.AuditLogConfig; - - /** - * Decodes an AuditLogConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AuditLogConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.AuditLogConfig; - - /** - * Verifies an AuditLogConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an AuditLogConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AuditLogConfig - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditLogConfig; - - /** - * Creates a plain object from an AuditLogConfig message. Also converts values to other types if specified. - * @param message AuditLogConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.AuditLogConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AuditLogConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AuditLogConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace AuditLogConfig { - - /** LogType enum. */ - enum LogType { - LOG_TYPE_UNSPECIFIED = 0, - ADMIN_READ = 1, - DATA_WRITE = 2, - DATA_READ = 3 - } - } - - /** Properties of a PolicyDelta. */ - interface IPolicyDelta { - - /** PolicyDelta bindingDeltas */ - bindingDeltas?: (google.iam.v1.IBindingDelta[]|null); - - /** PolicyDelta auditConfigDeltas */ - auditConfigDeltas?: (google.iam.v1.IAuditConfigDelta[]|null); - } - - /** Represents a PolicyDelta. */ - class PolicyDelta implements IPolicyDelta { - - /** - * Constructs a new PolicyDelta. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.IPolicyDelta); - - /** PolicyDelta bindingDeltas. */ - public bindingDeltas: google.iam.v1.IBindingDelta[]; - - /** PolicyDelta auditConfigDeltas. */ - public auditConfigDeltas: google.iam.v1.IAuditConfigDelta[]; - - /** - * Creates a new PolicyDelta instance using the specified properties. - * @param [properties] Properties to set - * @returns PolicyDelta instance - */ - public static create(properties?: google.iam.v1.IPolicyDelta): google.iam.v1.PolicyDelta; - - /** - * Encodes the specified PolicyDelta message. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. - * @param message PolicyDelta message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.IPolicyDelta, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PolicyDelta message, length delimited. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. - * @param message PolicyDelta message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.IPolicyDelta, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PolicyDelta message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PolicyDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.PolicyDelta; - - /** - * Decodes a PolicyDelta message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PolicyDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.PolicyDelta; - - /** - * Verifies a PolicyDelta message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PolicyDelta message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PolicyDelta - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.PolicyDelta; - - /** - * Creates a plain object from a PolicyDelta message. Also converts values to other types if specified. - * @param message PolicyDelta - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.PolicyDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PolicyDelta to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PolicyDelta - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BindingDelta. */ - interface IBindingDelta { - - /** BindingDelta action */ - action?: (google.iam.v1.BindingDelta.Action|keyof typeof google.iam.v1.BindingDelta.Action|null); - - /** BindingDelta role */ - role?: (string|null); - - /** BindingDelta member */ - member?: (string|null); - - /** BindingDelta condition */ - condition?: (google.type.IExpr|null); - } - - /** Represents a BindingDelta. */ - class BindingDelta implements IBindingDelta { - - /** - * Constructs a new BindingDelta. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.IBindingDelta); - - /** BindingDelta action. */ - public action: (google.iam.v1.BindingDelta.Action|keyof typeof google.iam.v1.BindingDelta.Action); - - /** BindingDelta role. */ - public role: string; - - /** BindingDelta member. */ - public member: string; - - /** BindingDelta condition. */ - public condition?: (google.type.IExpr|null); - - /** - * Creates a new BindingDelta instance using the specified properties. - * @param [properties] Properties to set - * @returns BindingDelta instance - */ - public static create(properties?: google.iam.v1.IBindingDelta): google.iam.v1.BindingDelta; - - /** - * Encodes the specified BindingDelta message. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. - * @param message BindingDelta message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.IBindingDelta, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BindingDelta message, length delimited. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. - * @param message BindingDelta message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.IBindingDelta, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BindingDelta message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BindingDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.BindingDelta; - - /** - * Decodes a BindingDelta message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BindingDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.BindingDelta; - - /** - * Verifies a BindingDelta message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BindingDelta message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BindingDelta - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.BindingDelta; - - /** - * Creates a plain object from a BindingDelta message. Also converts values to other types if specified. - * @param message BindingDelta - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.BindingDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BindingDelta to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BindingDelta - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace BindingDelta { - - /** Action enum. */ - enum Action { - ACTION_UNSPECIFIED = 0, - ADD = 1, - REMOVE = 2 - } - } - - /** Properties of an AuditConfigDelta. */ - interface IAuditConfigDelta { - - /** AuditConfigDelta action */ - action?: (google.iam.v1.AuditConfigDelta.Action|keyof typeof google.iam.v1.AuditConfigDelta.Action|null); - - /** AuditConfigDelta service */ - service?: (string|null); - - /** AuditConfigDelta exemptedMember */ - exemptedMember?: (string|null); - - /** AuditConfigDelta logType */ - logType?: (string|null); - } - - /** Represents an AuditConfigDelta. */ - class AuditConfigDelta implements IAuditConfigDelta { - - /** - * Constructs a new AuditConfigDelta. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.IAuditConfigDelta); - - /** AuditConfigDelta action. */ - public action: (google.iam.v1.AuditConfigDelta.Action|keyof typeof google.iam.v1.AuditConfigDelta.Action); - - /** AuditConfigDelta service. */ - public service: string; - - /** AuditConfigDelta exemptedMember. */ - public exemptedMember: string; - - /** AuditConfigDelta logType. */ - public logType: string; - - /** - * Creates a new AuditConfigDelta instance using the specified properties. - * @param [properties] Properties to set - * @returns AuditConfigDelta instance - */ - public static create(properties?: google.iam.v1.IAuditConfigDelta): google.iam.v1.AuditConfigDelta; - - /** - * Encodes the specified AuditConfigDelta message. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. - * @param message AuditConfigDelta message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.IAuditConfigDelta, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AuditConfigDelta message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. - * @param message AuditConfigDelta message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.IAuditConfigDelta, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AuditConfigDelta message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AuditConfigDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.AuditConfigDelta; - - /** - * Decodes an AuditConfigDelta message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AuditConfigDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.AuditConfigDelta; - - /** - * Verifies an AuditConfigDelta message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an AuditConfigDelta message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AuditConfigDelta - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditConfigDelta; - - /** - * Creates a plain object from an AuditConfigDelta message. Also converts values to other types if specified. - * @param message AuditConfigDelta - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.AuditConfigDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AuditConfigDelta to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AuditConfigDelta - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace AuditConfigDelta { - - /** Action enum. */ - enum Action { - ACTION_UNSPECIFIED = 0, - ADD = 1, - REMOVE = 2 - } - } - } - } - - /** Namespace type. */ - namespace type { - - /** Properties of an Expr. */ - interface IExpr { - - /** Expr expression */ - expression?: (string|null); - - /** Expr title */ - title?: (string|null); - - /** Expr description */ - description?: (string|null); - - /** Expr location */ - location?: (string|null); - } - - /** Represents an Expr. */ - class Expr implements IExpr { - - /** - * Constructs a new Expr. - * @param [properties] Properties to set - */ - constructor(properties?: google.type.IExpr); - - /** Expr expression. */ - public expression: string; - - /** Expr title. */ - public title: string; - - /** Expr description. */ - public description: string; - - /** Expr location. */ - public location: string; - - /** - * Creates a new Expr instance using the specified properties. - * @param [properties] Properties to set - * @returns Expr instance - */ - public static create(properties?: google.type.IExpr): google.type.Expr; - - /** - * Encodes the specified Expr message. Does not implicitly {@link google.type.Expr.verify|verify} messages. - * @param message Expr message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.type.IExpr, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Expr message, length delimited. Does not implicitly {@link google.type.Expr.verify|verify} messages. - * @param message Expr message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.type.IExpr, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Expr message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Expr - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.type.Expr; - - /** - * Decodes an Expr message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Expr - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.type.Expr; - - /** - * Verifies an Expr message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Expr message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Expr - */ - public static fromObject(object: { [k: string]: any }): google.type.Expr; - - /** - * Creates a plain object from an Expr message. Also converts values to other types if specified. - * @param message Expr - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.type.Expr, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Expr to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Expr - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } -} diff --git a/owl-bot-staging/admin/database/v1/protos/protos.js b/owl-bot-staging/admin/database/v1/protos/protos.js deleted file mode 100644 index b8aa818b1..000000000 --- a/owl-bot-staging/admin/database/v1/protos/protos.js +++ /dev/null @@ -1,43422 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ -(function(global, factory) { /* global define, require, module */ - - /* AMD */ if (typeof define === 'function' && define.amd) - define(["protobufjs/minimal"], factory); - - /* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports) - module.exports = factory(require("google-gax/build/src/protobuf").protobufMinimal); - -})(this, function($protobuf) { - "use strict"; - - // Common aliases - var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; - - // Exported root namespace - var $root = $protobuf.roots._google_cloud_spanner_protos || ($protobuf.roots._google_cloud_spanner_protos = {}); - - $root.google = (function() { - - /** - * Namespace google. - * @exports google - * @namespace - */ - var google = {}; - - google.spanner = (function() { - - /** - * Namespace spanner. - * @memberof google - * @namespace - */ - var spanner = {}; - - spanner.admin = (function() { - - /** - * Namespace admin. - * @memberof google.spanner - * @namespace - */ - var admin = {}; - - admin.database = (function() { - - /** - * Namespace database. - * @memberof google.spanner.admin - * @namespace - */ - var database = {}; - - database.v1 = (function() { - - /** - * Namespace v1. - * @memberof google.spanner.admin.database - * @namespace - */ - var v1 = {}; - - v1.Backup = (function() { - - /** - * Properties of a Backup. - * @memberof google.spanner.admin.database.v1 - * @interface IBackup - * @property {string|null} [database] Backup database - * @property {google.protobuf.ITimestamp|null} [versionTime] Backup versionTime - * @property {google.protobuf.ITimestamp|null} [expireTime] Backup expireTime - * @property {string|null} [name] Backup name - * @property {google.protobuf.ITimestamp|null} [createTime] Backup createTime - * @property {number|Long|null} [sizeBytes] Backup sizeBytes - * @property {number|Long|null} [freeableSizeBytes] Backup freeableSizeBytes - * @property {number|Long|null} [exclusiveSizeBytes] Backup exclusiveSizeBytes - * @property {google.spanner.admin.database.v1.Backup.State|null} [state] Backup state - * @property {Array.|null} [referencingDatabases] Backup referencingDatabases - * @property {google.spanner.admin.database.v1.IEncryptionInfo|null} [encryptionInfo] Backup encryptionInfo - * @property {Array.|null} [encryptionInformation] Backup encryptionInformation - * @property {google.spanner.admin.database.v1.DatabaseDialect|null} [databaseDialect] Backup databaseDialect - * @property {Array.|null} [referencingBackups] Backup referencingBackups - * @property {google.protobuf.ITimestamp|null} [maxExpireTime] Backup maxExpireTime - * @property {Array.|null} [backupSchedules] Backup backupSchedules - * @property {string|null} [incrementalBackupChainId] Backup incrementalBackupChainId - * @property {google.protobuf.ITimestamp|null} [oldestVersionTime] Backup oldestVersionTime - * @property {Array.|null} [instancePartitions] Backup instancePartitions - */ - - /** - * Constructs a new Backup. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents a Backup. - * @implements IBackup - * @constructor - * @param {google.spanner.admin.database.v1.IBackup=} [properties] Properties to set - */ - function Backup(properties) { - this.referencingDatabases = []; - this.encryptionInformation = []; - this.referencingBackups = []; - this.backupSchedules = []; - this.instancePartitions = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Backup database. - * @member {string} database - * @memberof google.spanner.admin.database.v1.Backup - * @instance - */ - Backup.prototype.database = ""; - - /** - * Backup versionTime. - * @member {google.protobuf.ITimestamp|null|undefined} versionTime - * @memberof google.spanner.admin.database.v1.Backup - * @instance - */ - Backup.prototype.versionTime = null; - - /** - * Backup expireTime. - * @member {google.protobuf.ITimestamp|null|undefined} expireTime - * @memberof google.spanner.admin.database.v1.Backup - * @instance - */ - Backup.prototype.expireTime = null; - - /** - * Backup name. - * @member {string} name - * @memberof google.spanner.admin.database.v1.Backup - * @instance - */ - Backup.prototype.name = ""; - - /** - * Backup createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.spanner.admin.database.v1.Backup - * @instance - */ - Backup.prototype.createTime = null; - - /** - * Backup sizeBytes. - * @member {number|Long} sizeBytes - * @memberof google.spanner.admin.database.v1.Backup - * @instance - */ - Backup.prototype.sizeBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Backup freeableSizeBytes. - * @member {number|Long} freeableSizeBytes - * @memberof google.spanner.admin.database.v1.Backup - * @instance - */ - Backup.prototype.freeableSizeBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Backup exclusiveSizeBytes. - * @member {number|Long} exclusiveSizeBytes - * @memberof google.spanner.admin.database.v1.Backup - * @instance - */ - Backup.prototype.exclusiveSizeBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Backup state. - * @member {google.spanner.admin.database.v1.Backup.State} state - * @memberof google.spanner.admin.database.v1.Backup - * @instance - */ - Backup.prototype.state = 0; - - /** - * Backup referencingDatabases. - * @member {Array.} referencingDatabases - * @memberof google.spanner.admin.database.v1.Backup - * @instance - */ - Backup.prototype.referencingDatabases = $util.emptyArray; - - /** - * Backup encryptionInfo. - * @member {google.spanner.admin.database.v1.IEncryptionInfo|null|undefined} encryptionInfo - * @memberof google.spanner.admin.database.v1.Backup - * @instance - */ - Backup.prototype.encryptionInfo = null; - - /** - * Backup encryptionInformation. - * @member {Array.} encryptionInformation - * @memberof google.spanner.admin.database.v1.Backup - * @instance - */ - Backup.prototype.encryptionInformation = $util.emptyArray; - - /** - * Backup databaseDialect. - * @member {google.spanner.admin.database.v1.DatabaseDialect} databaseDialect - * @memberof google.spanner.admin.database.v1.Backup - * @instance - */ - Backup.prototype.databaseDialect = 0; - - /** - * Backup referencingBackups. - * @member {Array.} referencingBackups - * @memberof google.spanner.admin.database.v1.Backup - * @instance - */ - Backup.prototype.referencingBackups = $util.emptyArray; - - /** - * Backup maxExpireTime. - * @member {google.protobuf.ITimestamp|null|undefined} maxExpireTime - * @memberof google.spanner.admin.database.v1.Backup - * @instance - */ - Backup.prototype.maxExpireTime = null; - - /** - * Backup backupSchedules. - * @member {Array.} backupSchedules - * @memberof google.spanner.admin.database.v1.Backup - * @instance - */ - Backup.prototype.backupSchedules = $util.emptyArray; - - /** - * Backup incrementalBackupChainId. - * @member {string} incrementalBackupChainId - * @memberof google.spanner.admin.database.v1.Backup - * @instance - */ - Backup.prototype.incrementalBackupChainId = ""; - - /** - * Backup oldestVersionTime. - * @member {google.protobuf.ITimestamp|null|undefined} oldestVersionTime - * @memberof google.spanner.admin.database.v1.Backup - * @instance - */ - Backup.prototype.oldestVersionTime = null; - - /** - * Backup instancePartitions. - * @member {Array.} instancePartitions - * @memberof google.spanner.admin.database.v1.Backup - * @instance - */ - Backup.prototype.instancePartitions = $util.emptyArray; - - /** - * Creates a new Backup instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.Backup - * @static - * @param {google.spanner.admin.database.v1.IBackup=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.Backup} Backup instance - */ - Backup.create = function create(properties) { - return new Backup(properties); - }; - - /** - * Encodes the specified Backup message. Does not implicitly {@link google.spanner.admin.database.v1.Backup.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.Backup - * @static - * @param {google.spanner.admin.database.v1.IBackup} message Backup message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Backup.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.database != null && Object.hasOwnProperty.call(message, "database")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.database); - if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) - $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.sizeBytes != null && Object.hasOwnProperty.call(message, "sizeBytes")) - writer.uint32(/* id 5, wireType 0 =*/40).int64(message.sizeBytes); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.state); - if (message.referencingDatabases != null && message.referencingDatabases.length) - for (var i = 0; i < message.referencingDatabases.length; ++i) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.referencingDatabases[i]); - if (message.encryptionInfo != null && Object.hasOwnProperty.call(message, "encryptionInfo")) - $root.google.spanner.admin.database.v1.EncryptionInfo.encode(message.encryptionInfo, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.versionTime != null && Object.hasOwnProperty.call(message, "versionTime")) - $root.google.protobuf.Timestamp.encode(message.versionTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.databaseDialect != null && Object.hasOwnProperty.call(message, "databaseDialect")) - writer.uint32(/* id 10, wireType 0 =*/80).int32(message.databaseDialect); - if (message.referencingBackups != null && message.referencingBackups.length) - for (var i = 0; i < message.referencingBackups.length; ++i) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.referencingBackups[i]); - if (message.maxExpireTime != null && Object.hasOwnProperty.call(message, "maxExpireTime")) - $root.google.protobuf.Timestamp.encode(message.maxExpireTime, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - if (message.encryptionInformation != null && message.encryptionInformation.length) - for (var i = 0; i < message.encryptionInformation.length; ++i) - $root.google.spanner.admin.database.v1.EncryptionInfo.encode(message.encryptionInformation[i], writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); - if (message.backupSchedules != null && message.backupSchedules.length) - for (var i = 0; i < message.backupSchedules.length; ++i) - writer.uint32(/* id 14, wireType 2 =*/114).string(message.backupSchedules[i]); - if (message.freeableSizeBytes != null && Object.hasOwnProperty.call(message, "freeableSizeBytes")) - writer.uint32(/* id 15, wireType 0 =*/120).int64(message.freeableSizeBytes); - if (message.exclusiveSizeBytes != null && Object.hasOwnProperty.call(message, "exclusiveSizeBytes")) - writer.uint32(/* id 16, wireType 0 =*/128).int64(message.exclusiveSizeBytes); - if (message.incrementalBackupChainId != null && Object.hasOwnProperty.call(message, "incrementalBackupChainId")) - writer.uint32(/* id 17, wireType 2 =*/138).string(message.incrementalBackupChainId); - if (message.oldestVersionTime != null && Object.hasOwnProperty.call(message, "oldestVersionTime")) - $root.google.protobuf.Timestamp.encode(message.oldestVersionTime, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); - if (message.instancePartitions != null && message.instancePartitions.length) - for (var i = 0; i < message.instancePartitions.length; ++i) - $root.google.spanner.admin.database.v1.BackupInstancePartition.encode(message.instancePartitions[i], writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Backup message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.Backup.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.Backup - * @static - * @param {google.spanner.admin.database.v1.IBackup} message Backup message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Backup.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Backup message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.Backup - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.Backup} Backup - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Backup.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.Backup(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - message.database = reader.string(); - break; - } - case 9: { - message.versionTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 3: { - message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 1: { - message.name = reader.string(); - break; - } - case 4: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 5: { - message.sizeBytes = reader.int64(); - break; - } - case 15: { - message.freeableSizeBytes = reader.int64(); - break; - } - case 16: { - message.exclusiveSizeBytes = reader.int64(); - break; - } - case 6: { - message.state = reader.int32(); - break; - } - case 7: { - if (!(message.referencingDatabases && message.referencingDatabases.length)) - message.referencingDatabases = []; - message.referencingDatabases.push(reader.string()); - break; - } - case 8: { - message.encryptionInfo = $root.google.spanner.admin.database.v1.EncryptionInfo.decode(reader, reader.uint32()); - break; - } - case 13: { - if (!(message.encryptionInformation && message.encryptionInformation.length)) - message.encryptionInformation = []; - message.encryptionInformation.push($root.google.spanner.admin.database.v1.EncryptionInfo.decode(reader, reader.uint32())); - break; - } - case 10: { - message.databaseDialect = reader.int32(); - break; - } - case 11: { - if (!(message.referencingBackups && message.referencingBackups.length)) - message.referencingBackups = []; - message.referencingBackups.push(reader.string()); - break; - } - case 12: { - message.maxExpireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 14: { - if (!(message.backupSchedules && message.backupSchedules.length)) - message.backupSchedules = []; - message.backupSchedules.push(reader.string()); - break; - } - case 17: { - message.incrementalBackupChainId = reader.string(); - break; - } - case 18: { - message.oldestVersionTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 19: { - if (!(message.instancePartitions && message.instancePartitions.length)) - message.instancePartitions = []; - message.instancePartitions.push($root.google.spanner.admin.database.v1.BackupInstancePartition.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Backup message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.Backup - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.Backup} Backup - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Backup.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Backup message. - * @function verify - * @memberof google.spanner.admin.database.v1.Backup - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Backup.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.database != null && message.hasOwnProperty("database")) - if (!$util.isString(message.database)) - return "database: string expected"; - if (message.versionTime != null && message.hasOwnProperty("versionTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.versionTime); - if (error) - return "versionTime." + error; - } - if (message.expireTime != null && message.hasOwnProperty("expireTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.expireTime); - if (error) - return "expireTime." + error; - } - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.sizeBytes != null && message.hasOwnProperty("sizeBytes")) - if (!$util.isInteger(message.sizeBytes) && !(message.sizeBytes && $util.isInteger(message.sizeBytes.low) && $util.isInteger(message.sizeBytes.high))) - return "sizeBytes: integer|Long expected"; - if (message.freeableSizeBytes != null && message.hasOwnProperty("freeableSizeBytes")) - if (!$util.isInteger(message.freeableSizeBytes) && !(message.freeableSizeBytes && $util.isInteger(message.freeableSizeBytes.low) && $util.isInteger(message.freeableSizeBytes.high))) - return "freeableSizeBytes: integer|Long expected"; - if (message.exclusiveSizeBytes != null && message.hasOwnProperty("exclusiveSizeBytes")) - if (!$util.isInteger(message.exclusiveSizeBytes) && !(message.exclusiveSizeBytes && $util.isInteger(message.exclusiveSizeBytes.low) && $util.isInteger(message.exclusiveSizeBytes.high))) - return "exclusiveSizeBytes: integer|Long expected"; - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.referencingDatabases != null && message.hasOwnProperty("referencingDatabases")) { - if (!Array.isArray(message.referencingDatabases)) - return "referencingDatabases: array expected"; - for (var i = 0; i < message.referencingDatabases.length; ++i) - if (!$util.isString(message.referencingDatabases[i])) - return "referencingDatabases: string[] expected"; - } - if (message.encryptionInfo != null && message.hasOwnProperty("encryptionInfo")) { - var error = $root.google.spanner.admin.database.v1.EncryptionInfo.verify(message.encryptionInfo); - if (error) - return "encryptionInfo." + error; - } - if (message.encryptionInformation != null && message.hasOwnProperty("encryptionInformation")) { - if (!Array.isArray(message.encryptionInformation)) - return "encryptionInformation: array expected"; - for (var i = 0; i < message.encryptionInformation.length; ++i) { - var error = $root.google.spanner.admin.database.v1.EncryptionInfo.verify(message.encryptionInformation[i]); - if (error) - return "encryptionInformation." + error; - } - } - if (message.databaseDialect != null && message.hasOwnProperty("databaseDialect")) - switch (message.databaseDialect) { - default: - return "databaseDialect: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.referencingBackups != null && message.hasOwnProperty("referencingBackups")) { - if (!Array.isArray(message.referencingBackups)) - return "referencingBackups: array expected"; - for (var i = 0; i < message.referencingBackups.length; ++i) - if (!$util.isString(message.referencingBackups[i])) - return "referencingBackups: string[] expected"; - } - if (message.maxExpireTime != null && message.hasOwnProperty("maxExpireTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.maxExpireTime); - if (error) - return "maxExpireTime." + error; - } - if (message.backupSchedules != null && message.hasOwnProperty("backupSchedules")) { - if (!Array.isArray(message.backupSchedules)) - return "backupSchedules: array expected"; - for (var i = 0; i < message.backupSchedules.length; ++i) - if (!$util.isString(message.backupSchedules[i])) - return "backupSchedules: string[] expected"; - } - if (message.incrementalBackupChainId != null && message.hasOwnProperty("incrementalBackupChainId")) - if (!$util.isString(message.incrementalBackupChainId)) - return "incrementalBackupChainId: string expected"; - if (message.oldestVersionTime != null && message.hasOwnProperty("oldestVersionTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.oldestVersionTime); - if (error) - return "oldestVersionTime." + error; - } - if (message.instancePartitions != null && message.hasOwnProperty("instancePartitions")) { - if (!Array.isArray(message.instancePartitions)) - return "instancePartitions: array expected"; - for (var i = 0; i < message.instancePartitions.length; ++i) { - var error = $root.google.spanner.admin.database.v1.BackupInstancePartition.verify(message.instancePartitions[i]); - if (error) - return "instancePartitions." + error; - } - } - return null; - }; - - /** - * Creates a Backup message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.Backup - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.Backup} Backup - */ - Backup.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.Backup) - return object; - var message = new $root.google.spanner.admin.database.v1.Backup(); - if (object.database != null) - message.database = String(object.database); - if (object.versionTime != null) { - if (typeof object.versionTime !== "object") - throw TypeError(".google.spanner.admin.database.v1.Backup.versionTime: object expected"); - message.versionTime = $root.google.protobuf.Timestamp.fromObject(object.versionTime); - } - if (object.expireTime != null) { - if (typeof object.expireTime !== "object") - throw TypeError(".google.spanner.admin.database.v1.Backup.expireTime: object expected"); - message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); - } - if (object.name != null) - message.name = String(object.name); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.spanner.admin.database.v1.Backup.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.sizeBytes != null) - if ($util.Long) - (message.sizeBytes = $util.Long.fromValue(object.sizeBytes)).unsigned = false; - else if (typeof object.sizeBytes === "string") - message.sizeBytes = parseInt(object.sizeBytes, 10); - else if (typeof object.sizeBytes === "number") - message.sizeBytes = object.sizeBytes; - else if (typeof object.sizeBytes === "object") - message.sizeBytes = new $util.LongBits(object.sizeBytes.low >>> 0, object.sizeBytes.high >>> 0).toNumber(); - if (object.freeableSizeBytes != null) - if ($util.Long) - (message.freeableSizeBytes = $util.Long.fromValue(object.freeableSizeBytes)).unsigned = false; - else if (typeof object.freeableSizeBytes === "string") - message.freeableSizeBytes = parseInt(object.freeableSizeBytes, 10); - else if (typeof object.freeableSizeBytes === "number") - message.freeableSizeBytes = object.freeableSizeBytes; - else if (typeof object.freeableSizeBytes === "object") - message.freeableSizeBytes = new $util.LongBits(object.freeableSizeBytes.low >>> 0, object.freeableSizeBytes.high >>> 0).toNumber(); - if (object.exclusiveSizeBytes != null) - if ($util.Long) - (message.exclusiveSizeBytes = $util.Long.fromValue(object.exclusiveSizeBytes)).unsigned = false; - else if (typeof object.exclusiveSizeBytes === "string") - message.exclusiveSizeBytes = parseInt(object.exclusiveSizeBytes, 10); - else if (typeof object.exclusiveSizeBytes === "number") - message.exclusiveSizeBytes = object.exclusiveSizeBytes; - else if (typeof object.exclusiveSizeBytes === "object") - message.exclusiveSizeBytes = new $util.LongBits(object.exclusiveSizeBytes.low >>> 0, object.exclusiveSizeBytes.high >>> 0).toNumber(); - switch (object.state) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "CREATING": - case 1: - message.state = 1; - break; - case "READY": - case 2: - message.state = 2; - break; - } - if (object.referencingDatabases) { - if (!Array.isArray(object.referencingDatabases)) - throw TypeError(".google.spanner.admin.database.v1.Backup.referencingDatabases: array expected"); - message.referencingDatabases = []; - for (var i = 0; i < object.referencingDatabases.length; ++i) - message.referencingDatabases[i] = String(object.referencingDatabases[i]); - } - if (object.encryptionInfo != null) { - if (typeof object.encryptionInfo !== "object") - throw TypeError(".google.spanner.admin.database.v1.Backup.encryptionInfo: object expected"); - message.encryptionInfo = $root.google.spanner.admin.database.v1.EncryptionInfo.fromObject(object.encryptionInfo); - } - if (object.encryptionInformation) { - if (!Array.isArray(object.encryptionInformation)) - throw TypeError(".google.spanner.admin.database.v1.Backup.encryptionInformation: array expected"); - message.encryptionInformation = []; - for (var i = 0; i < object.encryptionInformation.length; ++i) { - if (typeof object.encryptionInformation[i] !== "object") - throw TypeError(".google.spanner.admin.database.v1.Backup.encryptionInformation: object expected"); - message.encryptionInformation[i] = $root.google.spanner.admin.database.v1.EncryptionInfo.fromObject(object.encryptionInformation[i]); - } - } - switch (object.databaseDialect) { - default: - if (typeof object.databaseDialect === "number") { - message.databaseDialect = object.databaseDialect; - break; - } - break; - case "DATABASE_DIALECT_UNSPECIFIED": - case 0: - message.databaseDialect = 0; - break; - case "GOOGLE_STANDARD_SQL": - case 1: - message.databaseDialect = 1; - break; - case "POSTGRESQL": - case 2: - message.databaseDialect = 2; - break; - } - if (object.referencingBackups) { - if (!Array.isArray(object.referencingBackups)) - throw TypeError(".google.spanner.admin.database.v1.Backup.referencingBackups: array expected"); - message.referencingBackups = []; - for (var i = 0; i < object.referencingBackups.length; ++i) - message.referencingBackups[i] = String(object.referencingBackups[i]); - } - if (object.maxExpireTime != null) { - if (typeof object.maxExpireTime !== "object") - throw TypeError(".google.spanner.admin.database.v1.Backup.maxExpireTime: object expected"); - message.maxExpireTime = $root.google.protobuf.Timestamp.fromObject(object.maxExpireTime); - } - if (object.backupSchedules) { - if (!Array.isArray(object.backupSchedules)) - throw TypeError(".google.spanner.admin.database.v1.Backup.backupSchedules: array expected"); - message.backupSchedules = []; - for (var i = 0; i < object.backupSchedules.length; ++i) - message.backupSchedules[i] = String(object.backupSchedules[i]); - } - if (object.incrementalBackupChainId != null) - message.incrementalBackupChainId = String(object.incrementalBackupChainId); - if (object.oldestVersionTime != null) { - if (typeof object.oldestVersionTime !== "object") - throw TypeError(".google.spanner.admin.database.v1.Backup.oldestVersionTime: object expected"); - message.oldestVersionTime = $root.google.protobuf.Timestamp.fromObject(object.oldestVersionTime); - } - if (object.instancePartitions) { - if (!Array.isArray(object.instancePartitions)) - throw TypeError(".google.spanner.admin.database.v1.Backup.instancePartitions: array expected"); - message.instancePartitions = []; - for (var i = 0; i < object.instancePartitions.length; ++i) { - if (typeof object.instancePartitions[i] !== "object") - throw TypeError(".google.spanner.admin.database.v1.Backup.instancePartitions: object expected"); - message.instancePartitions[i] = $root.google.spanner.admin.database.v1.BackupInstancePartition.fromObject(object.instancePartitions[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a Backup message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.Backup - * @static - * @param {google.spanner.admin.database.v1.Backup} message Backup - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Backup.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.referencingDatabases = []; - object.referencingBackups = []; - object.encryptionInformation = []; - object.backupSchedules = []; - object.instancePartitions = []; - } - if (options.defaults) { - object.name = ""; - object.database = ""; - object.expireTime = null; - object.createTime = null; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.sizeBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.sizeBytes = options.longs === String ? "0" : 0; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.encryptionInfo = null; - object.versionTime = null; - object.databaseDialect = options.enums === String ? "DATABASE_DIALECT_UNSPECIFIED" : 0; - object.maxExpireTime = null; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.freeableSizeBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.freeableSizeBytes = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.exclusiveSizeBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.exclusiveSizeBytes = options.longs === String ? "0" : 0; - object.incrementalBackupChainId = ""; - object.oldestVersionTime = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.database != null && message.hasOwnProperty("database")) - object.database = message.database; - if (message.expireTime != null && message.hasOwnProperty("expireTime")) - object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.sizeBytes != null && message.hasOwnProperty("sizeBytes")) - if (typeof message.sizeBytes === "number") - object.sizeBytes = options.longs === String ? String(message.sizeBytes) : message.sizeBytes; - else - object.sizeBytes = options.longs === String ? $util.Long.prototype.toString.call(message.sizeBytes) : options.longs === Number ? new $util.LongBits(message.sizeBytes.low >>> 0, message.sizeBytes.high >>> 0).toNumber() : message.sizeBytes; - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.spanner.admin.database.v1.Backup.State[message.state] === undefined ? message.state : $root.google.spanner.admin.database.v1.Backup.State[message.state] : message.state; - if (message.referencingDatabases && message.referencingDatabases.length) { - object.referencingDatabases = []; - for (var j = 0; j < message.referencingDatabases.length; ++j) - object.referencingDatabases[j] = message.referencingDatabases[j]; - } - if (message.encryptionInfo != null && message.hasOwnProperty("encryptionInfo")) - object.encryptionInfo = $root.google.spanner.admin.database.v1.EncryptionInfo.toObject(message.encryptionInfo, options); - if (message.versionTime != null && message.hasOwnProperty("versionTime")) - object.versionTime = $root.google.protobuf.Timestamp.toObject(message.versionTime, options); - if (message.databaseDialect != null && message.hasOwnProperty("databaseDialect")) - object.databaseDialect = options.enums === String ? $root.google.spanner.admin.database.v1.DatabaseDialect[message.databaseDialect] === undefined ? message.databaseDialect : $root.google.spanner.admin.database.v1.DatabaseDialect[message.databaseDialect] : message.databaseDialect; - if (message.referencingBackups && message.referencingBackups.length) { - object.referencingBackups = []; - for (var j = 0; j < message.referencingBackups.length; ++j) - object.referencingBackups[j] = message.referencingBackups[j]; - } - if (message.maxExpireTime != null && message.hasOwnProperty("maxExpireTime")) - object.maxExpireTime = $root.google.protobuf.Timestamp.toObject(message.maxExpireTime, options); - if (message.encryptionInformation && message.encryptionInformation.length) { - object.encryptionInformation = []; - for (var j = 0; j < message.encryptionInformation.length; ++j) - object.encryptionInformation[j] = $root.google.spanner.admin.database.v1.EncryptionInfo.toObject(message.encryptionInformation[j], options); - } - if (message.backupSchedules && message.backupSchedules.length) { - object.backupSchedules = []; - for (var j = 0; j < message.backupSchedules.length; ++j) - object.backupSchedules[j] = message.backupSchedules[j]; - } - if (message.freeableSizeBytes != null && message.hasOwnProperty("freeableSizeBytes")) - if (typeof message.freeableSizeBytes === "number") - object.freeableSizeBytes = options.longs === String ? String(message.freeableSizeBytes) : message.freeableSizeBytes; - else - object.freeableSizeBytes = options.longs === String ? $util.Long.prototype.toString.call(message.freeableSizeBytes) : options.longs === Number ? new $util.LongBits(message.freeableSizeBytes.low >>> 0, message.freeableSizeBytes.high >>> 0).toNumber() : message.freeableSizeBytes; - if (message.exclusiveSizeBytes != null && message.hasOwnProperty("exclusiveSizeBytes")) - if (typeof message.exclusiveSizeBytes === "number") - object.exclusiveSizeBytes = options.longs === String ? String(message.exclusiveSizeBytes) : message.exclusiveSizeBytes; - else - object.exclusiveSizeBytes = options.longs === String ? $util.Long.prototype.toString.call(message.exclusiveSizeBytes) : options.longs === Number ? new $util.LongBits(message.exclusiveSizeBytes.low >>> 0, message.exclusiveSizeBytes.high >>> 0).toNumber() : message.exclusiveSizeBytes; - if (message.incrementalBackupChainId != null && message.hasOwnProperty("incrementalBackupChainId")) - object.incrementalBackupChainId = message.incrementalBackupChainId; - if (message.oldestVersionTime != null && message.hasOwnProperty("oldestVersionTime")) - object.oldestVersionTime = $root.google.protobuf.Timestamp.toObject(message.oldestVersionTime, options); - if (message.instancePartitions && message.instancePartitions.length) { - object.instancePartitions = []; - for (var j = 0; j < message.instancePartitions.length; ++j) - object.instancePartitions[j] = $root.google.spanner.admin.database.v1.BackupInstancePartition.toObject(message.instancePartitions[j], options); - } - return object; - }; - - /** - * Converts this Backup to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.Backup - * @instance - * @returns {Object.} JSON object - */ - Backup.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Backup - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.Backup - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Backup.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.Backup"; - }; - - /** - * State enum. - * @name google.spanner.admin.database.v1.Backup.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} CREATING=1 CREATING value - * @property {number} READY=2 READY value - */ - Backup.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "CREATING"] = 1; - values[valuesById[2] = "READY"] = 2; - return values; - })(); - - return Backup; - })(); - - v1.CreateBackupRequest = (function() { - - /** - * Properties of a CreateBackupRequest. - * @memberof google.spanner.admin.database.v1 - * @interface ICreateBackupRequest - * @property {string|null} [parent] CreateBackupRequest parent - * @property {string|null} [backupId] CreateBackupRequest backupId - * @property {google.spanner.admin.database.v1.IBackup|null} [backup] CreateBackupRequest backup - * @property {google.spanner.admin.database.v1.ICreateBackupEncryptionConfig|null} [encryptionConfig] CreateBackupRequest encryptionConfig - */ - - /** - * Constructs a new CreateBackupRequest. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents a CreateBackupRequest. - * @implements ICreateBackupRequest - * @constructor - * @param {google.spanner.admin.database.v1.ICreateBackupRequest=} [properties] Properties to set - */ - function CreateBackupRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateBackupRequest parent. - * @member {string} parent - * @memberof google.spanner.admin.database.v1.CreateBackupRequest - * @instance - */ - CreateBackupRequest.prototype.parent = ""; - - /** - * CreateBackupRequest backupId. - * @member {string} backupId - * @memberof google.spanner.admin.database.v1.CreateBackupRequest - * @instance - */ - CreateBackupRequest.prototype.backupId = ""; - - /** - * CreateBackupRequest backup. - * @member {google.spanner.admin.database.v1.IBackup|null|undefined} backup - * @memberof google.spanner.admin.database.v1.CreateBackupRequest - * @instance - */ - CreateBackupRequest.prototype.backup = null; - - /** - * CreateBackupRequest encryptionConfig. - * @member {google.spanner.admin.database.v1.ICreateBackupEncryptionConfig|null|undefined} encryptionConfig - * @memberof google.spanner.admin.database.v1.CreateBackupRequest - * @instance - */ - CreateBackupRequest.prototype.encryptionConfig = null; - - /** - * Creates a new CreateBackupRequest instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.CreateBackupRequest - * @static - * @param {google.spanner.admin.database.v1.ICreateBackupRequest=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.CreateBackupRequest} CreateBackupRequest instance - */ - CreateBackupRequest.create = function create(properties) { - return new CreateBackupRequest(properties); - }; - - /** - * Encodes the specified CreateBackupRequest message. Does not implicitly {@link google.spanner.admin.database.v1.CreateBackupRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.CreateBackupRequest - * @static - * @param {google.spanner.admin.database.v1.ICreateBackupRequest} message CreateBackupRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateBackupRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.backupId != null && Object.hasOwnProperty.call(message, "backupId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.backupId); - if (message.backup != null && Object.hasOwnProperty.call(message, "backup")) - $root.google.spanner.admin.database.v1.Backup.encode(message.backup, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) - $root.google.spanner.admin.database.v1.CreateBackupEncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CreateBackupRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.CreateBackupRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.CreateBackupRequest - * @static - * @param {google.spanner.admin.database.v1.ICreateBackupRequest} message CreateBackupRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateBackupRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.CreateBackupRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.CreateBackupRequest} CreateBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateBackupRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.CreateBackupRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.backupId = reader.string(); - break; - } - case 3: { - message.backup = $root.google.spanner.admin.database.v1.Backup.decode(reader, reader.uint32()); - break; - } - case 4: { - message.encryptionConfig = $root.google.spanner.admin.database.v1.CreateBackupEncryptionConfig.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateBackupRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.CreateBackupRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.CreateBackupRequest} CreateBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateBackupRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateBackupRequest message. - * @function verify - * @memberof google.spanner.admin.database.v1.CreateBackupRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateBackupRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.backupId != null && message.hasOwnProperty("backupId")) - if (!$util.isString(message.backupId)) - return "backupId: string expected"; - if (message.backup != null && message.hasOwnProperty("backup")) { - var error = $root.google.spanner.admin.database.v1.Backup.verify(message.backup); - if (error) - return "backup." + error; - } - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { - var error = $root.google.spanner.admin.database.v1.CreateBackupEncryptionConfig.verify(message.encryptionConfig); - if (error) - return "encryptionConfig." + error; - } - return null; - }; - - /** - * Creates a CreateBackupRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.CreateBackupRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.CreateBackupRequest} CreateBackupRequest - */ - CreateBackupRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.CreateBackupRequest) - return object; - var message = new $root.google.spanner.admin.database.v1.CreateBackupRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.backupId != null) - message.backupId = String(object.backupId); - if (object.backup != null) { - if (typeof object.backup !== "object") - throw TypeError(".google.spanner.admin.database.v1.CreateBackupRequest.backup: object expected"); - message.backup = $root.google.spanner.admin.database.v1.Backup.fromObject(object.backup); - } - if (object.encryptionConfig != null) { - if (typeof object.encryptionConfig !== "object") - throw TypeError(".google.spanner.admin.database.v1.CreateBackupRequest.encryptionConfig: object expected"); - message.encryptionConfig = $root.google.spanner.admin.database.v1.CreateBackupEncryptionConfig.fromObject(object.encryptionConfig); - } - return message; - }; - - /** - * Creates a plain object from a CreateBackupRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.CreateBackupRequest - * @static - * @param {google.spanner.admin.database.v1.CreateBackupRequest} message CreateBackupRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateBackupRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.backupId = ""; - object.backup = null; - object.encryptionConfig = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.backupId != null && message.hasOwnProperty("backupId")) - object.backupId = message.backupId; - if (message.backup != null && message.hasOwnProperty("backup")) - object.backup = $root.google.spanner.admin.database.v1.Backup.toObject(message.backup, options); - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) - object.encryptionConfig = $root.google.spanner.admin.database.v1.CreateBackupEncryptionConfig.toObject(message.encryptionConfig, options); - return object; - }; - - /** - * Converts this CreateBackupRequest to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.CreateBackupRequest - * @instance - * @returns {Object.} JSON object - */ - CreateBackupRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateBackupRequest - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.CreateBackupRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.CreateBackupRequest"; - }; - - return CreateBackupRequest; - })(); - - v1.CreateBackupMetadata = (function() { - - /** - * Properties of a CreateBackupMetadata. - * @memberof google.spanner.admin.database.v1 - * @interface ICreateBackupMetadata - * @property {string|null} [name] CreateBackupMetadata name - * @property {string|null} [database] CreateBackupMetadata database - * @property {google.spanner.admin.database.v1.IOperationProgress|null} [progress] CreateBackupMetadata progress - * @property {google.protobuf.ITimestamp|null} [cancelTime] CreateBackupMetadata cancelTime - */ - - /** - * Constructs a new CreateBackupMetadata. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents a CreateBackupMetadata. - * @implements ICreateBackupMetadata - * @constructor - * @param {google.spanner.admin.database.v1.ICreateBackupMetadata=} [properties] Properties to set - */ - function CreateBackupMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateBackupMetadata name. - * @member {string} name - * @memberof google.spanner.admin.database.v1.CreateBackupMetadata - * @instance - */ - CreateBackupMetadata.prototype.name = ""; - - /** - * CreateBackupMetadata database. - * @member {string} database - * @memberof google.spanner.admin.database.v1.CreateBackupMetadata - * @instance - */ - CreateBackupMetadata.prototype.database = ""; - - /** - * CreateBackupMetadata progress. - * @member {google.spanner.admin.database.v1.IOperationProgress|null|undefined} progress - * @memberof google.spanner.admin.database.v1.CreateBackupMetadata - * @instance - */ - CreateBackupMetadata.prototype.progress = null; - - /** - * CreateBackupMetadata cancelTime. - * @member {google.protobuf.ITimestamp|null|undefined} cancelTime - * @memberof google.spanner.admin.database.v1.CreateBackupMetadata - * @instance - */ - CreateBackupMetadata.prototype.cancelTime = null; - - /** - * Creates a new CreateBackupMetadata instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.CreateBackupMetadata - * @static - * @param {google.spanner.admin.database.v1.ICreateBackupMetadata=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.CreateBackupMetadata} CreateBackupMetadata instance - */ - CreateBackupMetadata.create = function create(properties) { - return new CreateBackupMetadata(properties); - }; - - /** - * Encodes the specified CreateBackupMetadata message. Does not implicitly {@link google.spanner.admin.database.v1.CreateBackupMetadata.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.CreateBackupMetadata - * @static - * @param {google.spanner.admin.database.v1.ICreateBackupMetadata} message CreateBackupMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateBackupMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.database != null && Object.hasOwnProperty.call(message, "database")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.database); - if (message.progress != null && Object.hasOwnProperty.call(message, "progress")) - $root.google.spanner.admin.database.v1.OperationProgress.encode(message.progress, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.cancelTime != null && Object.hasOwnProperty.call(message, "cancelTime")) - $root.google.protobuf.Timestamp.encode(message.cancelTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CreateBackupMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.CreateBackupMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.CreateBackupMetadata - * @static - * @param {google.spanner.admin.database.v1.ICreateBackupMetadata} message CreateBackupMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateBackupMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateBackupMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.CreateBackupMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.CreateBackupMetadata} CreateBackupMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateBackupMetadata.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.CreateBackupMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.database = reader.string(); - break; - } - case 3: { - message.progress = $root.google.spanner.admin.database.v1.OperationProgress.decode(reader, reader.uint32()); - break; - } - case 4: { - message.cancelTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateBackupMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.CreateBackupMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.CreateBackupMetadata} CreateBackupMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateBackupMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateBackupMetadata message. - * @function verify - * @memberof google.spanner.admin.database.v1.CreateBackupMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateBackupMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.database != null && message.hasOwnProperty("database")) - if (!$util.isString(message.database)) - return "database: string expected"; - if (message.progress != null && message.hasOwnProperty("progress")) { - var error = $root.google.spanner.admin.database.v1.OperationProgress.verify(message.progress); - if (error) - return "progress." + error; - } - if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.cancelTime); - if (error) - return "cancelTime." + error; - } - return null; - }; - - /** - * Creates a CreateBackupMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.CreateBackupMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.CreateBackupMetadata} CreateBackupMetadata - */ - CreateBackupMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.CreateBackupMetadata) - return object; - var message = new $root.google.spanner.admin.database.v1.CreateBackupMetadata(); - if (object.name != null) - message.name = String(object.name); - if (object.database != null) - message.database = String(object.database); - if (object.progress != null) { - if (typeof object.progress !== "object") - throw TypeError(".google.spanner.admin.database.v1.CreateBackupMetadata.progress: object expected"); - message.progress = $root.google.spanner.admin.database.v1.OperationProgress.fromObject(object.progress); - } - if (object.cancelTime != null) { - if (typeof object.cancelTime !== "object") - throw TypeError(".google.spanner.admin.database.v1.CreateBackupMetadata.cancelTime: object expected"); - message.cancelTime = $root.google.protobuf.Timestamp.fromObject(object.cancelTime); - } - return message; - }; - - /** - * Creates a plain object from a CreateBackupMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.CreateBackupMetadata - * @static - * @param {google.spanner.admin.database.v1.CreateBackupMetadata} message CreateBackupMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateBackupMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.database = ""; - object.progress = null; - object.cancelTime = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.database != null && message.hasOwnProperty("database")) - object.database = message.database; - if (message.progress != null && message.hasOwnProperty("progress")) - object.progress = $root.google.spanner.admin.database.v1.OperationProgress.toObject(message.progress, options); - if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) - object.cancelTime = $root.google.protobuf.Timestamp.toObject(message.cancelTime, options); - return object; - }; - - /** - * Converts this CreateBackupMetadata to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.CreateBackupMetadata - * @instance - * @returns {Object.} JSON object - */ - CreateBackupMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateBackupMetadata - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.CreateBackupMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateBackupMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.CreateBackupMetadata"; - }; - - return CreateBackupMetadata; - })(); - - v1.CopyBackupRequest = (function() { - - /** - * Properties of a CopyBackupRequest. - * @memberof google.spanner.admin.database.v1 - * @interface ICopyBackupRequest - * @property {string|null} [parent] CopyBackupRequest parent - * @property {string|null} [backupId] CopyBackupRequest backupId - * @property {string|null} [sourceBackup] CopyBackupRequest sourceBackup - * @property {google.protobuf.ITimestamp|null} [expireTime] CopyBackupRequest expireTime - * @property {google.spanner.admin.database.v1.ICopyBackupEncryptionConfig|null} [encryptionConfig] CopyBackupRequest encryptionConfig - */ - - /** - * Constructs a new CopyBackupRequest. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents a CopyBackupRequest. - * @implements ICopyBackupRequest - * @constructor - * @param {google.spanner.admin.database.v1.ICopyBackupRequest=} [properties] Properties to set - */ - function CopyBackupRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CopyBackupRequest parent. - * @member {string} parent - * @memberof google.spanner.admin.database.v1.CopyBackupRequest - * @instance - */ - CopyBackupRequest.prototype.parent = ""; - - /** - * CopyBackupRequest backupId. - * @member {string} backupId - * @memberof google.spanner.admin.database.v1.CopyBackupRequest - * @instance - */ - CopyBackupRequest.prototype.backupId = ""; - - /** - * CopyBackupRequest sourceBackup. - * @member {string} sourceBackup - * @memberof google.spanner.admin.database.v1.CopyBackupRequest - * @instance - */ - CopyBackupRequest.prototype.sourceBackup = ""; - - /** - * CopyBackupRequest expireTime. - * @member {google.protobuf.ITimestamp|null|undefined} expireTime - * @memberof google.spanner.admin.database.v1.CopyBackupRequest - * @instance - */ - CopyBackupRequest.prototype.expireTime = null; - - /** - * CopyBackupRequest encryptionConfig. - * @member {google.spanner.admin.database.v1.ICopyBackupEncryptionConfig|null|undefined} encryptionConfig - * @memberof google.spanner.admin.database.v1.CopyBackupRequest - * @instance - */ - CopyBackupRequest.prototype.encryptionConfig = null; - - /** - * Creates a new CopyBackupRequest instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.CopyBackupRequest - * @static - * @param {google.spanner.admin.database.v1.ICopyBackupRequest=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.CopyBackupRequest} CopyBackupRequest instance - */ - CopyBackupRequest.create = function create(properties) { - return new CopyBackupRequest(properties); - }; - - /** - * Encodes the specified CopyBackupRequest message. Does not implicitly {@link google.spanner.admin.database.v1.CopyBackupRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.CopyBackupRequest - * @static - * @param {google.spanner.admin.database.v1.ICopyBackupRequest} message CopyBackupRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CopyBackupRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.backupId != null && Object.hasOwnProperty.call(message, "backupId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.backupId); - if (message.sourceBackup != null && Object.hasOwnProperty.call(message, "sourceBackup")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.sourceBackup); - if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) - $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) - $root.google.spanner.admin.database.v1.CopyBackupEncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CopyBackupRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.CopyBackupRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.CopyBackupRequest - * @static - * @param {google.spanner.admin.database.v1.ICopyBackupRequest} message CopyBackupRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CopyBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CopyBackupRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.CopyBackupRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.CopyBackupRequest} CopyBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CopyBackupRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.CopyBackupRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.backupId = reader.string(); - break; - } - case 3: { - message.sourceBackup = reader.string(); - break; - } - case 4: { - message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 5: { - message.encryptionConfig = $root.google.spanner.admin.database.v1.CopyBackupEncryptionConfig.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CopyBackupRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.CopyBackupRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.CopyBackupRequest} CopyBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CopyBackupRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CopyBackupRequest message. - * @function verify - * @memberof google.spanner.admin.database.v1.CopyBackupRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CopyBackupRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.backupId != null && message.hasOwnProperty("backupId")) - if (!$util.isString(message.backupId)) - return "backupId: string expected"; - if (message.sourceBackup != null && message.hasOwnProperty("sourceBackup")) - if (!$util.isString(message.sourceBackup)) - return "sourceBackup: string expected"; - if (message.expireTime != null && message.hasOwnProperty("expireTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.expireTime); - if (error) - return "expireTime." + error; - } - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { - var error = $root.google.spanner.admin.database.v1.CopyBackupEncryptionConfig.verify(message.encryptionConfig); - if (error) - return "encryptionConfig." + error; - } - return null; - }; - - /** - * Creates a CopyBackupRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.CopyBackupRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.CopyBackupRequest} CopyBackupRequest - */ - CopyBackupRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.CopyBackupRequest) - return object; - var message = new $root.google.spanner.admin.database.v1.CopyBackupRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.backupId != null) - message.backupId = String(object.backupId); - if (object.sourceBackup != null) - message.sourceBackup = String(object.sourceBackup); - if (object.expireTime != null) { - if (typeof object.expireTime !== "object") - throw TypeError(".google.spanner.admin.database.v1.CopyBackupRequest.expireTime: object expected"); - message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); - } - if (object.encryptionConfig != null) { - if (typeof object.encryptionConfig !== "object") - throw TypeError(".google.spanner.admin.database.v1.CopyBackupRequest.encryptionConfig: object expected"); - message.encryptionConfig = $root.google.spanner.admin.database.v1.CopyBackupEncryptionConfig.fromObject(object.encryptionConfig); - } - return message; - }; - - /** - * Creates a plain object from a CopyBackupRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.CopyBackupRequest - * @static - * @param {google.spanner.admin.database.v1.CopyBackupRequest} message CopyBackupRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CopyBackupRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.backupId = ""; - object.sourceBackup = ""; - object.expireTime = null; - object.encryptionConfig = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.backupId != null && message.hasOwnProperty("backupId")) - object.backupId = message.backupId; - if (message.sourceBackup != null && message.hasOwnProperty("sourceBackup")) - object.sourceBackup = message.sourceBackup; - if (message.expireTime != null && message.hasOwnProperty("expireTime")) - object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) - object.encryptionConfig = $root.google.spanner.admin.database.v1.CopyBackupEncryptionConfig.toObject(message.encryptionConfig, options); - return object; - }; - - /** - * Converts this CopyBackupRequest to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.CopyBackupRequest - * @instance - * @returns {Object.} JSON object - */ - CopyBackupRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CopyBackupRequest - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.CopyBackupRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CopyBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.CopyBackupRequest"; - }; - - return CopyBackupRequest; - })(); - - v1.CopyBackupMetadata = (function() { - - /** - * Properties of a CopyBackupMetadata. - * @memberof google.spanner.admin.database.v1 - * @interface ICopyBackupMetadata - * @property {string|null} [name] CopyBackupMetadata name - * @property {string|null} [sourceBackup] CopyBackupMetadata sourceBackup - * @property {google.spanner.admin.database.v1.IOperationProgress|null} [progress] CopyBackupMetadata progress - * @property {google.protobuf.ITimestamp|null} [cancelTime] CopyBackupMetadata cancelTime - */ - - /** - * Constructs a new CopyBackupMetadata. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents a CopyBackupMetadata. - * @implements ICopyBackupMetadata - * @constructor - * @param {google.spanner.admin.database.v1.ICopyBackupMetadata=} [properties] Properties to set - */ - function CopyBackupMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CopyBackupMetadata name. - * @member {string} name - * @memberof google.spanner.admin.database.v1.CopyBackupMetadata - * @instance - */ - CopyBackupMetadata.prototype.name = ""; - - /** - * CopyBackupMetadata sourceBackup. - * @member {string} sourceBackup - * @memberof google.spanner.admin.database.v1.CopyBackupMetadata - * @instance - */ - CopyBackupMetadata.prototype.sourceBackup = ""; - - /** - * CopyBackupMetadata progress. - * @member {google.spanner.admin.database.v1.IOperationProgress|null|undefined} progress - * @memberof google.spanner.admin.database.v1.CopyBackupMetadata - * @instance - */ - CopyBackupMetadata.prototype.progress = null; - - /** - * CopyBackupMetadata cancelTime. - * @member {google.protobuf.ITimestamp|null|undefined} cancelTime - * @memberof google.spanner.admin.database.v1.CopyBackupMetadata - * @instance - */ - CopyBackupMetadata.prototype.cancelTime = null; - - /** - * Creates a new CopyBackupMetadata instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.CopyBackupMetadata - * @static - * @param {google.spanner.admin.database.v1.ICopyBackupMetadata=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.CopyBackupMetadata} CopyBackupMetadata instance - */ - CopyBackupMetadata.create = function create(properties) { - return new CopyBackupMetadata(properties); - }; - - /** - * Encodes the specified CopyBackupMetadata message. Does not implicitly {@link google.spanner.admin.database.v1.CopyBackupMetadata.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.CopyBackupMetadata - * @static - * @param {google.spanner.admin.database.v1.ICopyBackupMetadata} message CopyBackupMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CopyBackupMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.sourceBackup != null && Object.hasOwnProperty.call(message, "sourceBackup")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceBackup); - if (message.progress != null && Object.hasOwnProperty.call(message, "progress")) - $root.google.spanner.admin.database.v1.OperationProgress.encode(message.progress, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.cancelTime != null && Object.hasOwnProperty.call(message, "cancelTime")) - $root.google.protobuf.Timestamp.encode(message.cancelTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CopyBackupMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.CopyBackupMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.CopyBackupMetadata - * @static - * @param {google.spanner.admin.database.v1.ICopyBackupMetadata} message CopyBackupMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CopyBackupMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CopyBackupMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.CopyBackupMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.CopyBackupMetadata} CopyBackupMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CopyBackupMetadata.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.CopyBackupMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.sourceBackup = reader.string(); - break; - } - case 3: { - message.progress = $root.google.spanner.admin.database.v1.OperationProgress.decode(reader, reader.uint32()); - break; - } - case 4: { - message.cancelTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CopyBackupMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.CopyBackupMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.CopyBackupMetadata} CopyBackupMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CopyBackupMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CopyBackupMetadata message. - * @function verify - * @memberof google.spanner.admin.database.v1.CopyBackupMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CopyBackupMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.sourceBackup != null && message.hasOwnProperty("sourceBackup")) - if (!$util.isString(message.sourceBackup)) - return "sourceBackup: string expected"; - if (message.progress != null && message.hasOwnProperty("progress")) { - var error = $root.google.spanner.admin.database.v1.OperationProgress.verify(message.progress); - if (error) - return "progress." + error; - } - if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.cancelTime); - if (error) - return "cancelTime." + error; - } - return null; - }; - - /** - * Creates a CopyBackupMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.CopyBackupMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.CopyBackupMetadata} CopyBackupMetadata - */ - CopyBackupMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.CopyBackupMetadata) - return object; - var message = new $root.google.spanner.admin.database.v1.CopyBackupMetadata(); - if (object.name != null) - message.name = String(object.name); - if (object.sourceBackup != null) - message.sourceBackup = String(object.sourceBackup); - if (object.progress != null) { - if (typeof object.progress !== "object") - throw TypeError(".google.spanner.admin.database.v1.CopyBackupMetadata.progress: object expected"); - message.progress = $root.google.spanner.admin.database.v1.OperationProgress.fromObject(object.progress); - } - if (object.cancelTime != null) { - if (typeof object.cancelTime !== "object") - throw TypeError(".google.spanner.admin.database.v1.CopyBackupMetadata.cancelTime: object expected"); - message.cancelTime = $root.google.protobuf.Timestamp.fromObject(object.cancelTime); - } - return message; - }; - - /** - * Creates a plain object from a CopyBackupMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.CopyBackupMetadata - * @static - * @param {google.spanner.admin.database.v1.CopyBackupMetadata} message CopyBackupMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CopyBackupMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.sourceBackup = ""; - object.progress = null; - object.cancelTime = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.sourceBackup != null && message.hasOwnProperty("sourceBackup")) - object.sourceBackup = message.sourceBackup; - if (message.progress != null && message.hasOwnProperty("progress")) - object.progress = $root.google.spanner.admin.database.v1.OperationProgress.toObject(message.progress, options); - if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) - object.cancelTime = $root.google.protobuf.Timestamp.toObject(message.cancelTime, options); - return object; - }; - - /** - * Converts this CopyBackupMetadata to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.CopyBackupMetadata - * @instance - * @returns {Object.} JSON object - */ - CopyBackupMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CopyBackupMetadata - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.CopyBackupMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CopyBackupMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.CopyBackupMetadata"; - }; - - return CopyBackupMetadata; - })(); - - v1.UpdateBackupRequest = (function() { - - /** - * Properties of an UpdateBackupRequest. - * @memberof google.spanner.admin.database.v1 - * @interface IUpdateBackupRequest - * @property {google.spanner.admin.database.v1.IBackup|null} [backup] UpdateBackupRequest backup - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateBackupRequest updateMask - */ - - /** - * Constructs a new UpdateBackupRequest. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents an UpdateBackupRequest. - * @implements IUpdateBackupRequest - * @constructor - * @param {google.spanner.admin.database.v1.IUpdateBackupRequest=} [properties] Properties to set - */ - function UpdateBackupRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateBackupRequest backup. - * @member {google.spanner.admin.database.v1.IBackup|null|undefined} backup - * @memberof google.spanner.admin.database.v1.UpdateBackupRequest - * @instance - */ - UpdateBackupRequest.prototype.backup = null; - - /** - * UpdateBackupRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.spanner.admin.database.v1.UpdateBackupRequest - * @instance - */ - UpdateBackupRequest.prototype.updateMask = null; - - /** - * Creates a new UpdateBackupRequest instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.UpdateBackupRequest - * @static - * @param {google.spanner.admin.database.v1.IUpdateBackupRequest=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.UpdateBackupRequest} UpdateBackupRequest instance - */ - UpdateBackupRequest.create = function create(properties) { - return new UpdateBackupRequest(properties); - }; - - /** - * Encodes the specified UpdateBackupRequest message. Does not implicitly {@link google.spanner.admin.database.v1.UpdateBackupRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.UpdateBackupRequest - * @static - * @param {google.spanner.admin.database.v1.IUpdateBackupRequest} message UpdateBackupRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateBackupRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.backup != null && Object.hasOwnProperty.call(message, "backup")) - $root.google.spanner.admin.database.v1.Backup.encode(message.backup, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified UpdateBackupRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.UpdateBackupRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.UpdateBackupRequest - * @static - * @param {google.spanner.admin.database.v1.IUpdateBackupRequest} message UpdateBackupRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateBackupRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.UpdateBackupRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.UpdateBackupRequest} UpdateBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateBackupRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.UpdateBackupRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.backup = $root.google.spanner.admin.database.v1.Backup.decode(reader, reader.uint32()); - break; - } - case 2: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateBackupRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.UpdateBackupRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.UpdateBackupRequest} UpdateBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateBackupRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateBackupRequest message. - * @function verify - * @memberof google.spanner.admin.database.v1.UpdateBackupRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateBackupRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.backup != null && message.hasOwnProperty("backup")) { - var error = $root.google.spanner.admin.database.v1.Backup.verify(message.backup); - if (error) - return "backup." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - return null; - }; - - /** - * Creates an UpdateBackupRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.UpdateBackupRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.UpdateBackupRequest} UpdateBackupRequest - */ - UpdateBackupRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.UpdateBackupRequest) - return object; - var message = new $root.google.spanner.admin.database.v1.UpdateBackupRequest(); - if (object.backup != null) { - if (typeof object.backup !== "object") - throw TypeError(".google.spanner.admin.database.v1.UpdateBackupRequest.backup: object expected"); - message.backup = $root.google.spanner.admin.database.v1.Backup.fromObject(object.backup); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.spanner.admin.database.v1.UpdateBackupRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - return message; - }; - - /** - * Creates a plain object from an UpdateBackupRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.UpdateBackupRequest - * @static - * @param {google.spanner.admin.database.v1.UpdateBackupRequest} message UpdateBackupRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateBackupRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.backup = null; - object.updateMask = null; - } - if (message.backup != null && message.hasOwnProperty("backup")) - object.backup = $root.google.spanner.admin.database.v1.Backup.toObject(message.backup, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - return object; - }; - - /** - * Converts this UpdateBackupRequest to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.UpdateBackupRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateBackupRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateBackupRequest - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.UpdateBackupRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.UpdateBackupRequest"; - }; - - return UpdateBackupRequest; - })(); - - v1.GetBackupRequest = (function() { - - /** - * Properties of a GetBackupRequest. - * @memberof google.spanner.admin.database.v1 - * @interface IGetBackupRequest - * @property {string|null} [name] GetBackupRequest name - */ - - /** - * Constructs a new GetBackupRequest. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents a GetBackupRequest. - * @implements IGetBackupRequest - * @constructor - * @param {google.spanner.admin.database.v1.IGetBackupRequest=} [properties] Properties to set - */ - function GetBackupRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetBackupRequest name. - * @member {string} name - * @memberof google.spanner.admin.database.v1.GetBackupRequest - * @instance - */ - GetBackupRequest.prototype.name = ""; - - /** - * Creates a new GetBackupRequest instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.GetBackupRequest - * @static - * @param {google.spanner.admin.database.v1.IGetBackupRequest=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.GetBackupRequest} GetBackupRequest instance - */ - GetBackupRequest.create = function create(properties) { - return new GetBackupRequest(properties); - }; - - /** - * Encodes the specified GetBackupRequest message. Does not implicitly {@link google.spanner.admin.database.v1.GetBackupRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.GetBackupRequest - * @static - * @param {google.spanner.admin.database.v1.IGetBackupRequest} message GetBackupRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetBackupRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; - - /** - * Encodes the specified GetBackupRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.GetBackupRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.GetBackupRequest - * @static - * @param {google.spanner.admin.database.v1.IGetBackupRequest} message GetBackupRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetBackupRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.GetBackupRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.GetBackupRequest} GetBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetBackupRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.GetBackupRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetBackupRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.GetBackupRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.GetBackupRequest} GetBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetBackupRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetBackupRequest message. - * @function verify - * @memberof google.spanner.admin.database.v1.GetBackupRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetBackupRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; - - /** - * Creates a GetBackupRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.GetBackupRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.GetBackupRequest} GetBackupRequest - */ - GetBackupRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.GetBackupRequest) - return object; - var message = new $root.google.spanner.admin.database.v1.GetBackupRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetBackupRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.GetBackupRequest - * @static - * @param {google.spanner.admin.database.v1.GetBackupRequest} message GetBackupRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetBackupRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; - - /** - * Converts this GetBackupRequest to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.GetBackupRequest - * @instance - * @returns {Object.} JSON object - */ - GetBackupRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetBackupRequest - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.GetBackupRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.GetBackupRequest"; - }; - - return GetBackupRequest; - })(); - - v1.DeleteBackupRequest = (function() { - - /** - * Properties of a DeleteBackupRequest. - * @memberof google.spanner.admin.database.v1 - * @interface IDeleteBackupRequest - * @property {string|null} [name] DeleteBackupRequest name - */ - - /** - * Constructs a new DeleteBackupRequest. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents a DeleteBackupRequest. - * @implements IDeleteBackupRequest - * @constructor - * @param {google.spanner.admin.database.v1.IDeleteBackupRequest=} [properties] Properties to set - */ - function DeleteBackupRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteBackupRequest name. - * @member {string} name - * @memberof google.spanner.admin.database.v1.DeleteBackupRequest - * @instance - */ - DeleteBackupRequest.prototype.name = ""; - - /** - * Creates a new DeleteBackupRequest instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.DeleteBackupRequest - * @static - * @param {google.spanner.admin.database.v1.IDeleteBackupRequest=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.DeleteBackupRequest} DeleteBackupRequest instance - */ - DeleteBackupRequest.create = function create(properties) { - return new DeleteBackupRequest(properties); - }; - - /** - * Encodes the specified DeleteBackupRequest message. Does not implicitly {@link google.spanner.admin.database.v1.DeleteBackupRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.DeleteBackupRequest - * @static - * @param {google.spanner.admin.database.v1.IDeleteBackupRequest} message DeleteBackupRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteBackupRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; - - /** - * Encodes the specified DeleteBackupRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.DeleteBackupRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.DeleteBackupRequest - * @static - * @param {google.spanner.admin.database.v1.IDeleteBackupRequest} message DeleteBackupRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteBackupRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.DeleteBackupRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.DeleteBackupRequest} DeleteBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteBackupRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.DeleteBackupRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteBackupRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.DeleteBackupRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.DeleteBackupRequest} DeleteBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteBackupRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteBackupRequest message. - * @function verify - * @memberof google.spanner.admin.database.v1.DeleteBackupRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteBackupRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; - - /** - * Creates a DeleteBackupRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.DeleteBackupRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.DeleteBackupRequest} DeleteBackupRequest - */ - DeleteBackupRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.DeleteBackupRequest) - return object; - var message = new $root.google.spanner.admin.database.v1.DeleteBackupRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a DeleteBackupRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.DeleteBackupRequest - * @static - * @param {google.spanner.admin.database.v1.DeleteBackupRequest} message DeleteBackupRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteBackupRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; - - /** - * Converts this DeleteBackupRequest to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.DeleteBackupRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteBackupRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteBackupRequest - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.DeleteBackupRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.DeleteBackupRequest"; - }; - - return DeleteBackupRequest; - })(); - - v1.ListBackupsRequest = (function() { - - /** - * Properties of a ListBackupsRequest. - * @memberof google.spanner.admin.database.v1 - * @interface IListBackupsRequest - * @property {string|null} [parent] ListBackupsRequest parent - * @property {string|null} [filter] ListBackupsRequest filter - * @property {number|null} [pageSize] ListBackupsRequest pageSize - * @property {string|null} [pageToken] ListBackupsRequest pageToken - */ - - /** - * Constructs a new ListBackupsRequest. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents a ListBackupsRequest. - * @implements IListBackupsRequest - * @constructor - * @param {google.spanner.admin.database.v1.IListBackupsRequest=} [properties] Properties to set - */ - function ListBackupsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListBackupsRequest parent. - * @member {string} parent - * @memberof google.spanner.admin.database.v1.ListBackupsRequest - * @instance - */ - ListBackupsRequest.prototype.parent = ""; - - /** - * ListBackupsRequest filter. - * @member {string} filter - * @memberof google.spanner.admin.database.v1.ListBackupsRequest - * @instance - */ - ListBackupsRequest.prototype.filter = ""; - - /** - * ListBackupsRequest pageSize. - * @member {number} pageSize - * @memberof google.spanner.admin.database.v1.ListBackupsRequest - * @instance - */ - ListBackupsRequest.prototype.pageSize = 0; - - /** - * ListBackupsRequest pageToken. - * @member {string} pageToken - * @memberof google.spanner.admin.database.v1.ListBackupsRequest - * @instance - */ - ListBackupsRequest.prototype.pageToken = ""; - - /** - * Creates a new ListBackupsRequest instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.ListBackupsRequest - * @static - * @param {google.spanner.admin.database.v1.IListBackupsRequest=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.ListBackupsRequest} ListBackupsRequest instance - */ - ListBackupsRequest.create = function create(properties) { - return new ListBackupsRequest(properties); - }; - - /** - * Encodes the specified ListBackupsRequest message. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupsRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.ListBackupsRequest - * @static - * @param {google.spanner.admin.database.v1.IListBackupsRequest} message ListBackupsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListBackupsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); - return writer; - }; - - /** - * Encodes the specified ListBackupsRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.ListBackupsRequest - * @static - * @param {google.spanner.admin.database.v1.IListBackupsRequest} message ListBackupsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListBackupsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListBackupsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.ListBackupsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.ListBackupsRequest} ListBackupsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListBackupsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.ListBackupsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.filter = reader.string(); - break; - } - case 3: { - message.pageSize = reader.int32(); - break; - } - case 4: { - message.pageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListBackupsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.ListBackupsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.ListBackupsRequest} ListBackupsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListBackupsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListBackupsRequest message. - * @function verify - * @memberof google.spanner.admin.database.v1.ListBackupsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListBackupsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - return null; - }; - - /** - * Creates a ListBackupsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.ListBackupsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.ListBackupsRequest} ListBackupsRequest - */ - ListBackupsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.ListBackupsRequest) - return object; - var message = new $root.google.spanner.admin.database.v1.ListBackupsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.filter != null) - message.filter = String(object.filter); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - return message; - }; - - /** - * Creates a plain object from a ListBackupsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.ListBackupsRequest - * @static - * @param {google.spanner.admin.database.v1.ListBackupsRequest} message ListBackupsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListBackupsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.filter = ""; - object.pageSize = 0; - object.pageToken = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - return object; - }; - - /** - * Converts this ListBackupsRequest to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.ListBackupsRequest - * @instance - * @returns {Object.} JSON object - */ - ListBackupsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListBackupsRequest - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.ListBackupsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListBackupsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.ListBackupsRequest"; - }; - - return ListBackupsRequest; - })(); - - v1.ListBackupsResponse = (function() { - - /** - * Properties of a ListBackupsResponse. - * @memberof google.spanner.admin.database.v1 - * @interface IListBackupsResponse - * @property {Array.|null} [backups] ListBackupsResponse backups - * @property {string|null} [nextPageToken] ListBackupsResponse nextPageToken - */ - - /** - * Constructs a new ListBackupsResponse. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents a ListBackupsResponse. - * @implements IListBackupsResponse - * @constructor - * @param {google.spanner.admin.database.v1.IListBackupsResponse=} [properties] Properties to set - */ - function ListBackupsResponse(properties) { - this.backups = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListBackupsResponse backups. - * @member {Array.} backups - * @memberof google.spanner.admin.database.v1.ListBackupsResponse - * @instance - */ - ListBackupsResponse.prototype.backups = $util.emptyArray; - - /** - * ListBackupsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.spanner.admin.database.v1.ListBackupsResponse - * @instance - */ - ListBackupsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListBackupsResponse instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.ListBackupsResponse - * @static - * @param {google.spanner.admin.database.v1.IListBackupsResponse=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.ListBackupsResponse} ListBackupsResponse instance - */ - ListBackupsResponse.create = function create(properties) { - return new ListBackupsResponse(properties); - }; - - /** - * Encodes the specified ListBackupsResponse message. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupsResponse.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.ListBackupsResponse - * @static - * @param {google.spanner.admin.database.v1.IListBackupsResponse} message ListBackupsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListBackupsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.backups != null && message.backups.length) - for (var i = 0; i < message.backups.length; ++i) - $root.google.spanner.admin.database.v1.Backup.encode(message.backups[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - return writer; - }; - - /** - * Encodes the specified ListBackupsResponse message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.ListBackupsResponse - * @static - * @param {google.spanner.admin.database.v1.IListBackupsResponse} message ListBackupsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListBackupsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListBackupsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.ListBackupsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.ListBackupsResponse} ListBackupsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListBackupsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.ListBackupsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.backups && message.backups.length)) - message.backups = []; - message.backups.push($root.google.spanner.admin.database.v1.Backup.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListBackupsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.ListBackupsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.ListBackupsResponse} ListBackupsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListBackupsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListBackupsResponse message. - * @function verify - * @memberof google.spanner.admin.database.v1.ListBackupsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListBackupsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.backups != null && message.hasOwnProperty("backups")) { - if (!Array.isArray(message.backups)) - return "backups: array expected"; - for (var i = 0; i < message.backups.length; ++i) { - var error = $root.google.spanner.admin.database.v1.Backup.verify(message.backups[i]); - if (error) - return "backups." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListBackupsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.ListBackupsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.ListBackupsResponse} ListBackupsResponse - */ - ListBackupsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.ListBackupsResponse) - return object; - var message = new $root.google.spanner.admin.database.v1.ListBackupsResponse(); - if (object.backups) { - if (!Array.isArray(object.backups)) - throw TypeError(".google.spanner.admin.database.v1.ListBackupsResponse.backups: array expected"); - message.backups = []; - for (var i = 0; i < object.backups.length; ++i) { - if (typeof object.backups[i] !== "object") - throw TypeError(".google.spanner.admin.database.v1.ListBackupsResponse.backups: object expected"); - message.backups[i] = $root.google.spanner.admin.database.v1.Backup.fromObject(object.backups[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListBackupsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.ListBackupsResponse - * @static - * @param {google.spanner.admin.database.v1.ListBackupsResponse} message ListBackupsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListBackupsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.backups = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.backups && message.backups.length) { - object.backups = []; - for (var j = 0; j < message.backups.length; ++j) - object.backups[j] = $root.google.spanner.admin.database.v1.Backup.toObject(message.backups[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListBackupsResponse to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.ListBackupsResponse - * @instance - * @returns {Object.} JSON object - */ - ListBackupsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListBackupsResponse - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.ListBackupsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListBackupsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.ListBackupsResponse"; - }; - - return ListBackupsResponse; - })(); - - v1.ListBackupOperationsRequest = (function() { - - /** - * Properties of a ListBackupOperationsRequest. - * @memberof google.spanner.admin.database.v1 - * @interface IListBackupOperationsRequest - * @property {string|null} [parent] ListBackupOperationsRequest parent - * @property {string|null} [filter] ListBackupOperationsRequest filter - * @property {number|null} [pageSize] ListBackupOperationsRequest pageSize - * @property {string|null} [pageToken] ListBackupOperationsRequest pageToken - */ - - /** - * Constructs a new ListBackupOperationsRequest. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents a ListBackupOperationsRequest. - * @implements IListBackupOperationsRequest - * @constructor - * @param {google.spanner.admin.database.v1.IListBackupOperationsRequest=} [properties] Properties to set - */ - function ListBackupOperationsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListBackupOperationsRequest parent. - * @member {string} parent - * @memberof google.spanner.admin.database.v1.ListBackupOperationsRequest - * @instance - */ - ListBackupOperationsRequest.prototype.parent = ""; - - /** - * ListBackupOperationsRequest filter. - * @member {string} filter - * @memberof google.spanner.admin.database.v1.ListBackupOperationsRequest - * @instance - */ - ListBackupOperationsRequest.prototype.filter = ""; - - /** - * ListBackupOperationsRequest pageSize. - * @member {number} pageSize - * @memberof google.spanner.admin.database.v1.ListBackupOperationsRequest - * @instance - */ - ListBackupOperationsRequest.prototype.pageSize = 0; - - /** - * ListBackupOperationsRequest pageToken. - * @member {string} pageToken - * @memberof google.spanner.admin.database.v1.ListBackupOperationsRequest - * @instance - */ - ListBackupOperationsRequest.prototype.pageToken = ""; - - /** - * Creates a new ListBackupOperationsRequest instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.ListBackupOperationsRequest - * @static - * @param {google.spanner.admin.database.v1.IListBackupOperationsRequest=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.ListBackupOperationsRequest} ListBackupOperationsRequest instance - */ - ListBackupOperationsRequest.create = function create(properties) { - return new ListBackupOperationsRequest(properties); - }; - - /** - * Encodes the specified ListBackupOperationsRequest message. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupOperationsRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.ListBackupOperationsRequest - * @static - * @param {google.spanner.admin.database.v1.IListBackupOperationsRequest} message ListBackupOperationsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListBackupOperationsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); - return writer; - }; - - /** - * Encodes the specified ListBackupOperationsRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupOperationsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.ListBackupOperationsRequest - * @static - * @param {google.spanner.admin.database.v1.IListBackupOperationsRequest} message ListBackupOperationsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListBackupOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListBackupOperationsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.ListBackupOperationsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.ListBackupOperationsRequest} ListBackupOperationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListBackupOperationsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.ListBackupOperationsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.filter = reader.string(); - break; - } - case 3: { - message.pageSize = reader.int32(); - break; - } - case 4: { - message.pageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListBackupOperationsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.ListBackupOperationsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.ListBackupOperationsRequest} ListBackupOperationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListBackupOperationsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListBackupOperationsRequest message. - * @function verify - * @memberof google.spanner.admin.database.v1.ListBackupOperationsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListBackupOperationsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.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 ListBackupOperationsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.ListBackupOperationsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.ListBackupOperationsRequest} ListBackupOperationsRequest - */ - ListBackupOperationsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.ListBackupOperationsRequest) - return object; - var message = new $root.google.spanner.admin.database.v1.ListBackupOperationsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.filter != null) - message.filter = String(object.filter); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - return message; - }; - - /** - * Creates a plain object from a ListBackupOperationsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.ListBackupOperationsRequest - * @static - * @param {google.spanner.admin.database.v1.ListBackupOperationsRequest} message ListBackupOperationsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListBackupOperationsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.filter = ""; - object.pageSize = 0; - object.pageToken = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - return object; - }; - - /** - * Converts this ListBackupOperationsRequest to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.ListBackupOperationsRequest - * @instance - * @returns {Object.} JSON object - */ - ListBackupOperationsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListBackupOperationsRequest - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.ListBackupOperationsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListBackupOperationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.ListBackupOperationsRequest"; - }; - - return ListBackupOperationsRequest; - })(); - - v1.ListBackupOperationsResponse = (function() { - - /** - * Properties of a ListBackupOperationsResponse. - * @memberof google.spanner.admin.database.v1 - * @interface IListBackupOperationsResponse - * @property {Array.|null} [operations] ListBackupOperationsResponse operations - * @property {string|null} [nextPageToken] ListBackupOperationsResponse nextPageToken - */ - - /** - * Constructs a new ListBackupOperationsResponse. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents a ListBackupOperationsResponse. - * @implements IListBackupOperationsResponse - * @constructor - * @param {google.spanner.admin.database.v1.IListBackupOperationsResponse=} [properties] Properties to set - */ - function ListBackupOperationsResponse(properties) { - this.operations = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListBackupOperationsResponse operations. - * @member {Array.} operations - * @memberof google.spanner.admin.database.v1.ListBackupOperationsResponse - * @instance - */ - ListBackupOperationsResponse.prototype.operations = $util.emptyArray; - - /** - * ListBackupOperationsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.spanner.admin.database.v1.ListBackupOperationsResponse - * @instance - */ - ListBackupOperationsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListBackupOperationsResponse instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.ListBackupOperationsResponse - * @static - * @param {google.spanner.admin.database.v1.IListBackupOperationsResponse=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.ListBackupOperationsResponse} ListBackupOperationsResponse instance - */ - ListBackupOperationsResponse.create = function create(properties) { - return new ListBackupOperationsResponse(properties); - }; - - /** - * Encodes the specified ListBackupOperationsResponse message. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupOperationsResponse.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.ListBackupOperationsResponse - * @static - * @param {google.spanner.admin.database.v1.IListBackupOperationsResponse} message ListBackupOperationsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListBackupOperationsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.operations != null && message.operations.length) - for (var i = 0; i < message.operations.length; ++i) - $root.google.longrunning.Operation.encode(message.operations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - return writer; - }; - - /** - * Encodes the specified ListBackupOperationsResponse message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupOperationsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.ListBackupOperationsResponse - * @static - * @param {google.spanner.admin.database.v1.IListBackupOperationsResponse} message ListBackupOperationsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListBackupOperationsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListBackupOperationsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.ListBackupOperationsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.ListBackupOperationsResponse} ListBackupOperationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListBackupOperationsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.ListBackupOperationsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.operations && message.operations.length)) - message.operations = []; - message.operations.push($root.google.longrunning.Operation.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListBackupOperationsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.ListBackupOperationsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.ListBackupOperationsResponse} ListBackupOperationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListBackupOperationsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListBackupOperationsResponse message. - * @function verify - * @memberof google.spanner.admin.database.v1.ListBackupOperationsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListBackupOperationsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.operations != null && message.hasOwnProperty("operations")) { - if (!Array.isArray(message.operations)) - return "operations: array expected"; - for (var i = 0; i < message.operations.length; ++i) { - var error = $root.google.longrunning.Operation.verify(message.operations[i]); - if (error) - return "operations." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListBackupOperationsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.ListBackupOperationsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.ListBackupOperationsResponse} ListBackupOperationsResponse - */ - ListBackupOperationsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.ListBackupOperationsResponse) - return object; - var message = new $root.google.spanner.admin.database.v1.ListBackupOperationsResponse(); - if (object.operations) { - if (!Array.isArray(object.operations)) - throw TypeError(".google.spanner.admin.database.v1.ListBackupOperationsResponse.operations: array expected"); - message.operations = []; - for (var i = 0; i < object.operations.length; ++i) { - if (typeof object.operations[i] !== "object") - throw TypeError(".google.spanner.admin.database.v1.ListBackupOperationsResponse.operations: object expected"); - message.operations[i] = $root.google.longrunning.Operation.fromObject(object.operations[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListBackupOperationsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.ListBackupOperationsResponse - * @static - * @param {google.spanner.admin.database.v1.ListBackupOperationsResponse} message ListBackupOperationsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListBackupOperationsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.operations = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.operations && message.operations.length) { - object.operations = []; - for (var j = 0; j < message.operations.length; ++j) - object.operations[j] = $root.google.longrunning.Operation.toObject(message.operations[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListBackupOperationsResponse to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.ListBackupOperationsResponse - * @instance - * @returns {Object.} JSON object - */ - ListBackupOperationsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListBackupOperationsResponse - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.ListBackupOperationsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListBackupOperationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.ListBackupOperationsResponse"; - }; - - return ListBackupOperationsResponse; - })(); - - v1.BackupInfo = (function() { - - /** - * Properties of a BackupInfo. - * @memberof google.spanner.admin.database.v1 - * @interface IBackupInfo - * @property {string|null} [backup] BackupInfo backup - * @property {google.protobuf.ITimestamp|null} [versionTime] BackupInfo versionTime - * @property {google.protobuf.ITimestamp|null} [createTime] BackupInfo createTime - * @property {string|null} [sourceDatabase] BackupInfo sourceDatabase - */ - - /** - * Constructs a new BackupInfo. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents a BackupInfo. - * @implements IBackupInfo - * @constructor - * @param {google.spanner.admin.database.v1.IBackupInfo=} [properties] Properties to set - */ - function BackupInfo(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BackupInfo backup. - * @member {string} backup - * @memberof google.spanner.admin.database.v1.BackupInfo - * @instance - */ - BackupInfo.prototype.backup = ""; - - /** - * BackupInfo versionTime. - * @member {google.protobuf.ITimestamp|null|undefined} versionTime - * @memberof google.spanner.admin.database.v1.BackupInfo - * @instance - */ - BackupInfo.prototype.versionTime = null; - - /** - * BackupInfo createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.spanner.admin.database.v1.BackupInfo - * @instance - */ - BackupInfo.prototype.createTime = null; - - /** - * BackupInfo sourceDatabase. - * @member {string} sourceDatabase - * @memberof google.spanner.admin.database.v1.BackupInfo - * @instance - */ - BackupInfo.prototype.sourceDatabase = ""; - - /** - * Creates a new BackupInfo instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.BackupInfo - * @static - * @param {google.spanner.admin.database.v1.IBackupInfo=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.BackupInfo} BackupInfo instance - */ - BackupInfo.create = function create(properties) { - return new BackupInfo(properties); - }; - - /** - * Encodes the specified BackupInfo message. Does not implicitly {@link google.spanner.admin.database.v1.BackupInfo.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.BackupInfo - * @static - * @param {google.spanner.admin.database.v1.IBackupInfo} message BackupInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BackupInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.backup != null && Object.hasOwnProperty.call(message, "backup")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.backup); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.sourceDatabase != null && Object.hasOwnProperty.call(message, "sourceDatabase")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.sourceDatabase); - if (message.versionTime != null && Object.hasOwnProperty.call(message, "versionTime")) - $root.google.protobuf.Timestamp.encode(message.versionTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified BackupInfo message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.BackupInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.BackupInfo - * @static - * @param {google.spanner.admin.database.v1.IBackupInfo} message BackupInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BackupInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BackupInfo message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.BackupInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.BackupInfo} BackupInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BackupInfo.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.BackupInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.backup = reader.string(); - break; - } - case 4: { - message.versionTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 2: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 3: { - message.sourceDatabase = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BackupInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.BackupInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.BackupInfo} BackupInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BackupInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BackupInfo message. - * @function verify - * @memberof google.spanner.admin.database.v1.BackupInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BackupInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.backup != null && message.hasOwnProperty("backup")) - if (!$util.isString(message.backup)) - return "backup: string expected"; - if (message.versionTime != null && message.hasOwnProperty("versionTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.versionTime); - if (error) - return "versionTime." + error; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.sourceDatabase != null && message.hasOwnProperty("sourceDatabase")) - if (!$util.isString(message.sourceDatabase)) - return "sourceDatabase: string expected"; - return null; - }; - - /** - * Creates a BackupInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.BackupInfo - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.BackupInfo} BackupInfo - */ - BackupInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.BackupInfo) - return object; - var message = new $root.google.spanner.admin.database.v1.BackupInfo(); - if (object.backup != null) - message.backup = String(object.backup); - if (object.versionTime != null) { - if (typeof object.versionTime !== "object") - throw TypeError(".google.spanner.admin.database.v1.BackupInfo.versionTime: object expected"); - message.versionTime = $root.google.protobuf.Timestamp.fromObject(object.versionTime); - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.spanner.admin.database.v1.BackupInfo.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.sourceDatabase != null) - message.sourceDatabase = String(object.sourceDatabase); - return message; - }; - - /** - * Creates a plain object from a BackupInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.BackupInfo - * @static - * @param {google.spanner.admin.database.v1.BackupInfo} message BackupInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BackupInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.backup = ""; - object.createTime = null; - object.sourceDatabase = ""; - object.versionTime = null; - } - if (message.backup != null && message.hasOwnProperty("backup")) - object.backup = message.backup; - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.sourceDatabase != null && message.hasOwnProperty("sourceDatabase")) - object.sourceDatabase = message.sourceDatabase; - if (message.versionTime != null && message.hasOwnProperty("versionTime")) - object.versionTime = $root.google.protobuf.Timestamp.toObject(message.versionTime, options); - return object; - }; - - /** - * Converts this BackupInfo to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.BackupInfo - * @instance - * @returns {Object.} JSON object - */ - BackupInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BackupInfo - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.BackupInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BackupInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.BackupInfo"; - }; - - return BackupInfo; - })(); - - v1.CreateBackupEncryptionConfig = (function() { - - /** - * Properties of a CreateBackupEncryptionConfig. - * @memberof google.spanner.admin.database.v1 - * @interface ICreateBackupEncryptionConfig - * @property {google.spanner.admin.database.v1.CreateBackupEncryptionConfig.EncryptionType|null} [encryptionType] CreateBackupEncryptionConfig encryptionType - * @property {string|null} [kmsKeyName] CreateBackupEncryptionConfig kmsKeyName - * @property {Array.|null} [kmsKeyNames] CreateBackupEncryptionConfig kmsKeyNames - */ - - /** - * Constructs a new CreateBackupEncryptionConfig. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents a CreateBackupEncryptionConfig. - * @implements ICreateBackupEncryptionConfig - * @constructor - * @param {google.spanner.admin.database.v1.ICreateBackupEncryptionConfig=} [properties] Properties to set - */ - function CreateBackupEncryptionConfig(properties) { - this.kmsKeyNames = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateBackupEncryptionConfig encryptionType. - * @member {google.spanner.admin.database.v1.CreateBackupEncryptionConfig.EncryptionType} encryptionType - * @memberof google.spanner.admin.database.v1.CreateBackupEncryptionConfig - * @instance - */ - CreateBackupEncryptionConfig.prototype.encryptionType = 0; - - /** - * CreateBackupEncryptionConfig kmsKeyName. - * @member {string} kmsKeyName - * @memberof google.spanner.admin.database.v1.CreateBackupEncryptionConfig - * @instance - */ - CreateBackupEncryptionConfig.prototype.kmsKeyName = ""; - - /** - * CreateBackupEncryptionConfig kmsKeyNames. - * @member {Array.} kmsKeyNames - * @memberof google.spanner.admin.database.v1.CreateBackupEncryptionConfig - * @instance - */ - CreateBackupEncryptionConfig.prototype.kmsKeyNames = $util.emptyArray; - - /** - * Creates a new CreateBackupEncryptionConfig instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.CreateBackupEncryptionConfig - * @static - * @param {google.spanner.admin.database.v1.ICreateBackupEncryptionConfig=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.CreateBackupEncryptionConfig} CreateBackupEncryptionConfig instance - */ - CreateBackupEncryptionConfig.create = function create(properties) { - return new CreateBackupEncryptionConfig(properties); - }; - - /** - * Encodes the specified CreateBackupEncryptionConfig message. Does not implicitly {@link google.spanner.admin.database.v1.CreateBackupEncryptionConfig.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.CreateBackupEncryptionConfig - * @static - * @param {google.spanner.admin.database.v1.ICreateBackupEncryptionConfig} message CreateBackupEncryptionConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateBackupEncryptionConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.encryptionType != null && Object.hasOwnProperty.call(message, "encryptionType")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.encryptionType); - if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.kmsKeyName); - if (message.kmsKeyNames != null && message.kmsKeyNames.length) - for (var i = 0; i < message.kmsKeyNames.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.kmsKeyNames[i]); - return writer; - }; - - /** - * Encodes the specified CreateBackupEncryptionConfig message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.CreateBackupEncryptionConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.CreateBackupEncryptionConfig - * @static - * @param {google.spanner.admin.database.v1.ICreateBackupEncryptionConfig} message CreateBackupEncryptionConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateBackupEncryptionConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateBackupEncryptionConfig message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.CreateBackupEncryptionConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.CreateBackupEncryptionConfig} CreateBackupEncryptionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateBackupEncryptionConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.CreateBackupEncryptionConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.encryptionType = reader.int32(); - break; - } - case 2: { - message.kmsKeyName = reader.string(); - break; - } - case 3: { - if (!(message.kmsKeyNames && message.kmsKeyNames.length)) - message.kmsKeyNames = []; - message.kmsKeyNames.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateBackupEncryptionConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.CreateBackupEncryptionConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.CreateBackupEncryptionConfig} CreateBackupEncryptionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateBackupEncryptionConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateBackupEncryptionConfig message. - * @function verify - * @memberof google.spanner.admin.database.v1.CreateBackupEncryptionConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateBackupEncryptionConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.encryptionType != null && message.hasOwnProperty("encryptionType")) - switch (message.encryptionType) { - default: - return "encryptionType: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) - if (!$util.isString(message.kmsKeyName)) - return "kmsKeyName: string expected"; - if (message.kmsKeyNames != null && message.hasOwnProperty("kmsKeyNames")) { - if (!Array.isArray(message.kmsKeyNames)) - return "kmsKeyNames: array expected"; - for (var i = 0; i < message.kmsKeyNames.length; ++i) - if (!$util.isString(message.kmsKeyNames[i])) - return "kmsKeyNames: string[] expected"; - } - return null; - }; - - /** - * Creates a CreateBackupEncryptionConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.CreateBackupEncryptionConfig - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.CreateBackupEncryptionConfig} CreateBackupEncryptionConfig - */ - CreateBackupEncryptionConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.CreateBackupEncryptionConfig) - return object; - var message = new $root.google.spanner.admin.database.v1.CreateBackupEncryptionConfig(); - switch (object.encryptionType) { - default: - if (typeof object.encryptionType === "number") { - message.encryptionType = object.encryptionType; - break; - } - break; - case "ENCRYPTION_TYPE_UNSPECIFIED": - case 0: - message.encryptionType = 0; - break; - case "USE_DATABASE_ENCRYPTION": - case 1: - message.encryptionType = 1; - break; - case "GOOGLE_DEFAULT_ENCRYPTION": - case 2: - message.encryptionType = 2; - break; - case "CUSTOMER_MANAGED_ENCRYPTION": - case 3: - message.encryptionType = 3; - break; - } - if (object.kmsKeyName != null) - message.kmsKeyName = String(object.kmsKeyName); - if (object.kmsKeyNames) { - if (!Array.isArray(object.kmsKeyNames)) - throw TypeError(".google.spanner.admin.database.v1.CreateBackupEncryptionConfig.kmsKeyNames: array expected"); - message.kmsKeyNames = []; - for (var i = 0; i < object.kmsKeyNames.length; ++i) - message.kmsKeyNames[i] = String(object.kmsKeyNames[i]); - } - return message; - }; - - /** - * Creates a plain object from a CreateBackupEncryptionConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.CreateBackupEncryptionConfig - * @static - * @param {google.spanner.admin.database.v1.CreateBackupEncryptionConfig} message CreateBackupEncryptionConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateBackupEncryptionConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.kmsKeyNames = []; - if (options.defaults) { - object.encryptionType = options.enums === String ? "ENCRYPTION_TYPE_UNSPECIFIED" : 0; - object.kmsKeyName = ""; - } - if (message.encryptionType != null && message.hasOwnProperty("encryptionType")) - object.encryptionType = options.enums === String ? $root.google.spanner.admin.database.v1.CreateBackupEncryptionConfig.EncryptionType[message.encryptionType] === undefined ? message.encryptionType : $root.google.spanner.admin.database.v1.CreateBackupEncryptionConfig.EncryptionType[message.encryptionType] : message.encryptionType; - if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) - object.kmsKeyName = message.kmsKeyName; - if (message.kmsKeyNames && message.kmsKeyNames.length) { - object.kmsKeyNames = []; - for (var j = 0; j < message.kmsKeyNames.length; ++j) - object.kmsKeyNames[j] = message.kmsKeyNames[j]; - } - return object; - }; - - /** - * Converts this CreateBackupEncryptionConfig to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.CreateBackupEncryptionConfig - * @instance - * @returns {Object.} JSON object - */ - CreateBackupEncryptionConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateBackupEncryptionConfig - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.CreateBackupEncryptionConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateBackupEncryptionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.CreateBackupEncryptionConfig"; - }; - - /** - * EncryptionType enum. - * @name google.spanner.admin.database.v1.CreateBackupEncryptionConfig.EncryptionType - * @enum {number} - * @property {number} ENCRYPTION_TYPE_UNSPECIFIED=0 ENCRYPTION_TYPE_UNSPECIFIED value - * @property {number} USE_DATABASE_ENCRYPTION=1 USE_DATABASE_ENCRYPTION value - * @property {number} GOOGLE_DEFAULT_ENCRYPTION=2 GOOGLE_DEFAULT_ENCRYPTION value - * @property {number} CUSTOMER_MANAGED_ENCRYPTION=3 CUSTOMER_MANAGED_ENCRYPTION value - */ - CreateBackupEncryptionConfig.EncryptionType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ENCRYPTION_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "USE_DATABASE_ENCRYPTION"] = 1; - values[valuesById[2] = "GOOGLE_DEFAULT_ENCRYPTION"] = 2; - values[valuesById[3] = "CUSTOMER_MANAGED_ENCRYPTION"] = 3; - return values; - })(); - - return CreateBackupEncryptionConfig; - })(); - - v1.CopyBackupEncryptionConfig = (function() { - - /** - * Properties of a CopyBackupEncryptionConfig. - * @memberof google.spanner.admin.database.v1 - * @interface ICopyBackupEncryptionConfig - * @property {google.spanner.admin.database.v1.CopyBackupEncryptionConfig.EncryptionType|null} [encryptionType] CopyBackupEncryptionConfig encryptionType - * @property {string|null} [kmsKeyName] CopyBackupEncryptionConfig kmsKeyName - * @property {Array.|null} [kmsKeyNames] CopyBackupEncryptionConfig kmsKeyNames - */ - - /** - * Constructs a new CopyBackupEncryptionConfig. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents a CopyBackupEncryptionConfig. - * @implements ICopyBackupEncryptionConfig - * @constructor - * @param {google.spanner.admin.database.v1.ICopyBackupEncryptionConfig=} [properties] Properties to set - */ - function CopyBackupEncryptionConfig(properties) { - this.kmsKeyNames = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CopyBackupEncryptionConfig encryptionType. - * @member {google.spanner.admin.database.v1.CopyBackupEncryptionConfig.EncryptionType} encryptionType - * @memberof google.spanner.admin.database.v1.CopyBackupEncryptionConfig - * @instance - */ - CopyBackupEncryptionConfig.prototype.encryptionType = 0; - - /** - * CopyBackupEncryptionConfig kmsKeyName. - * @member {string} kmsKeyName - * @memberof google.spanner.admin.database.v1.CopyBackupEncryptionConfig - * @instance - */ - CopyBackupEncryptionConfig.prototype.kmsKeyName = ""; - - /** - * CopyBackupEncryptionConfig kmsKeyNames. - * @member {Array.} kmsKeyNames - * @memberof google.spanner.admin.database.v1.CopyBackupEncryptionConfig - * @instance - */ - CopyBackupEncryptionConfig.prototype.kmsKeyNames = $util.emptyArray; - - /** - * Creates a new CopyBackupEncryptionConfig instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.CopyBackupEncryptionConfig - * @static - * @param {google.spanner.admin.database.v1.ICopyBackupEncryptionConfig=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.CopyBackupEncryptionConfig} CopyBackupEncryptionConfig instance - */ - CopyBackupEncryptionConfig.create = function create(properties) { - return new CopyBackupEncryptionConfig(properties); - }; - - /** - * Encodes the specified CopyBackupEncryptionConfig message. Does not implicitly {@link google.spanner.admin.database.v1.CopyBackupEncryptionConfig.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.CopyBackupEncryptionConfig - * @static - * @param {google.spanner.admin.database.v1.ICopyBackupEncryptionConfig} message CopyBackupEncryptionConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CopyBackupEncryptionConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.encryptionType != null && Object.hasOwnProperty.call(message, "encryptionType")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.encryptionType); - if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.kmsKeyName); - if (message.kmsKeyNames != null && message.kmsKeyNames.length) - for (var i = 0; i < message.kmsKeyNames.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.kmsKeyNames[i]); - return writer; - }; - - /** - * Encodes the specified CopyBackupEncryptionConfig message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.CopyBackupEncryptionConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.CopyBackupEncryptionConfig - * @static - * @param {google.spanner.admin.database.v1.ICopyBackupEncryptionConfig} message CopyBackupEncryptionConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CopyBackupEncryptionConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CopyBackupEncryptionConfig message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.CopyBackupEncryptionConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.CopyBackupEncryptionConfig} CopyBackupEncryptionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CopyBackupEncryptionConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.CopyBackupEncryptionConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.encryptionType = reader.int32(); - break; - } - case 2: { - message.kmsKeyName = reader.string(); - break; - } - case 3: { - if (!(message.kmsKeyNames && message.kmsKeyNames.length)) - message.kmsKeyNames = []; - message.kmsKeyNames.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CopyBackupEncryptionConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.CopyBackupEncryptionConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.CopyBackupEncryptionConfig} CopyBackupEncryptionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CopyBackupEncryptionConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CopyBackupEncryptionConfig message. - * @function verify - * @memberof google.spanner.admin.database.v1.CopyBackupEncryptionConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CopyBackupEncryptionConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.encryptionType != null && message.hasOwnProperty("encryptionType")) - switch (message.encryptionType) { - default: - return "encryptionType: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) - if (!$util.isString(message.kmsKeyName)) - return "kmsKeyName: string expected"; - if (message.kmsKeyNames != null && message.hasOwnProperty("kmsKeyNames")) { - if (!Array.isArray(message.kmsKeyNames)) - return "kmsKeyNames: array expected"; - for (var i = 0; i < message.kmsKeyNames.length; ++i) - if (!$util.isString(message.kmsKeyNames[i])) - return "kmsKeyNames: string[] expected"; - } - return null; - }; - - /** - * Creates a CopyBackupEncryptionConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.CopyBackupEncryptionConfig - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.CopyBackupEncryptionConfig} CopyBackupEncryptionConfig - */ - CopyBackupEncryptionConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.CopyBackupEncryptionConfig) - return object; - var message = new $root.google.spanner.admin.database.v1.CopyBackupEncryptionConfig(); - switch (object.encryptionType) { - default: - if (typeof object.encryptionType === "number") { - message.encryptionType = object.encryptionType; - break; - } - break; - case "ENCRYPTION_TYPE_UNSPECIFIED": - case 0: - message.encryptionType = 0; - break; - case "USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION": - case 1: - message.encryptionType = 1; - break; - case "GOOGLE_DEFAULT_ENCRYPTION": - case 2: - message.encryptionType = 2; - break; - case "CUSTOMER_MANAGED_ENCRYPTION": - case 3: - message.encryptionType = 3; - break; - } - if (object.kmsKeyName != null) - message.kmsKeyName = String(object.kmsKeyName); - if (object.kmsKeyNames) { - if (!Array.isArray(object.kmsKeyNames)) - throw TypeError(".google.spanner.admin.database.v1.CopyBackupEncryptionConfig.kmsKeyNames: array expected"); - message.kmsKeyNames = []; - for (var i = 0; i < object.kmsKeyNames.length; ++i) - message.kmsKeyNames[i] = String(object.kmsKeyNames[i]); - } - return message; - }; - - /** - * Creates a plain object from a CopyBackupEncryptionConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.CopyBackupEncryptionConfig - * @static - * @param {google.spanner.admin.database.v1.CopyBackupEncryptionConfig} message CopyBackupEncryptionConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CopyBackupEncryptionConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.kmsKeyNames = []; - if (options.defaults) { - object.encryptionType = options.enums === String ? "ENCRYPTION_TYPE_UNSPECIFIED" : 0; - object.kmsKeyName = ""; - } - if (message.encryptionType != null && message.hasOwnProperty("encryptionType")) - object.encryptionType = options.enums === String ? $root.google.spanner.admin.database.v1.CopyBackupEncryptionConfig.EncryptionType[message.encryptionType] === undefined ? message.encryptionType : $root.google.spanner.admin.database.v1.CopyBackupEncryptionConfig.EncryptionType[message.encryptionType] : message.encryptionType; - if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) - object.kmsKeyName = message.kmsKeyName; - if (message.kmsKeyNames && message.kmsKeyNames.length) { - object.kmsKeyNames = []; - for (var j = 0; j < message.kmsKeyNames.length; ++j) - object.kmsKeyNames[j] = message.kmsKeyNames[j]; - } - return object; - }; - - /** - * Converts this CopyBackupEncryptionConfig to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.CopyBackupEncryptionConfig - * @instance - * @returns {Object.} JSON object - */ - CopyBackupEncryptionConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CopyBackupEncryptionConfig - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.CopyBackupEncryptionConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CopyBackupEncryptionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.CopyBackupEncryptionConfig"; - }; - - /** - * EncryptionType enum. - * @name google.spanner.admin.database.v1.CopyBackupEncryptionConfig.EncryptionType - * @enum {number} - * @property {number} ENCRYPTION_TYPE_UNSPECIFIED=0 ENCRYPTION_TYPE_UNSPECIFIED value - * @property {number} USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION=1 USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION value - * @property {number} GOOGLE_DEFAULT_ENCRYPTION=2 GOOGLE_DEFAULT_ENCRYPTION value - * @property {number} CUSTOMER_MANAGED_ENCRYPTION=3 CUSTOMER_MANAGED_ENCRYPTION value - */ - CopyBackupEncryptionConfig.EncryptionType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ENCRYPTION_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION"] = 1; - values[valuesById[2] = "GOOGLE_DEFAULT_ENCRYPTION"] = 2; - values[valuesById[3] = "CUSTOMER_MANAGED_ENCRYPTION"] = 3; - return values; - })(); - - return CopyBackupEncryptionConfig; - })(); - - v1.FullBackupSpec = (function() { - - /** - * Properties of a FullBackupSpec. - * @memberof google.spanner.admin.database.v1 - * @interface IFullBackupSpec - */ - - /** - * Constructs a new FullBackupSpec. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents a FullBackupSpec. - * @implements IFullBackupSpec - * @constructor - * @param {google.spanner.admin.database.v1.IFullBackupSpec=} [properties] Properties to set - */ - function FullBackupSpec(properties) { - if (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 FullBackupSpec instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.FullBackupSpec - * @static - * @param {google.spanner.admin.database.v1.IFullBackupSpec=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.FullBackupSpec} FullBackupSpec instance - */ - FullBackupSpec.create = function create(properties) { - return new FullBackupSpec(properties); - }; - - /** - * Encodes the specified FullBackupSpec message. Does not implicitly {@link google.spanner.admin.database.v1.FullBackupSpec.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.FullBackupSpec - * @static - * @param {google.spanner.admin.database.v1.IFullBackupSpec} message FullBackupSpec message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FullBackupSpec.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified FullBackupSpec message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.FullBackupSpec.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.FullBackupSpec - * @static - * @param {google.spanner.admin.database.v1.IFullBackupSpec} message FullBackupSpec message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FullBackupSpec.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FullBackupSpec message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.FullBackupSpec - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.FullBackupSpec} FullBackupSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FullBackupSpec.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.FullBackupSpec(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FullBackupSpec message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.FullBackupSpec - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.FullBackupSpec} FullBackupSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FullBackupSpec.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FullBackupSpec message. - * @function verify - * @memberof google.spanner.admin.database.v1.FullBackupSpec - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FullBackupSpec.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a FullBackupSpec message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.FullBackupSpec - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.FullBackupSpec} FullBackupSpec - */ - FullBackupSpec.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.FullBackupSpec) - return object; - return new $root.google.spanner.admin.database.v1.FullBackupSpec(); - }; - - /** - * Creates a plain object from a FullBackupSpec message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.FullBackupSpec - * @static - * @param {google.spanner.admin.database.v1.FullBackupSpec} message FullBackupSpec - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FullBackupSpec.toObject = function toObject() { - return {}; - }; - - /** - * Converts this FullBackupSpec to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.FullBackupSpec - * @instance - * @returns {Object.} JSON object - */ - FullBackupSpec.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FullBackupSpec - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.FullBackupSpec - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FullBackupSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.FullBackupSpec"; - }; - - return FullBackupSpec; - })(); - - v1.IncrementalBackupSpec = (function() { - - /** - * Properties of an IncrementalBackupSpec. - * @memberof google.spanner.admin.database.v1 - * @interface IIncrementalBackupSpec - */ - - /** - * Constructs a new IncrementalBackupSpec. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents an IncrementalBackupSpec. - * @implements IIncrementalBackupSpec - * @constructor - * @param {google.spanner.admin.database.v1.IIncrementalBackupSpec=} [properties] Properties to set - */ - function IncrementalBackupSpec(properties) { - if (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 IncrementalBackupSpec instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.IncrementalBackupSpec - * @static - * @param {google.spanner.admin.database.v1.IIncrementalBackupSpec=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.IncrementalBackupSpec} IncrementalBackupSpec instance - */ - IncrementalBackupSpec.create = function create(properties) { - return new IncrementalBackupSpec(properties); - }; - - /** - * Encodes the specified IncrementalBackupSpec message. Does not implicitly {@link google.spanner.admin.database.v1.IncrementalBackupSpec.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.IncrementalBackupSpec - * @static - * @param {google.spanner.admin.database.v1.IIncrementalBackupSpec} message IncrementalBackupSpec message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IncrementalBackupSpec.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified IncrementalBackupSpec message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.IncrementalBackupSpec.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.IncrementalBackupSpec - * @static - * @param {google.spanner.admin.database.v1.IIncrementalBackupSpec} message IncrementalBackupSpec message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IncrementalBackupSpec.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an IncrementalBackupSpec message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.IncrementalBackupSpec - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.IncrementalBackupSpec} IncrementalBackupSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IncrementalBackupSpec.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.IncrementalBackupSpec(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an IncrementalBackupSpec message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.IncrementalBackupSpec - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.IncrementalBackupSpec} IncrementalBackupSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IncrementalBackupSpec.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an IncrementalBackupSpec message. - * @function verify - * @memberof google.spanner.admin.database.v1.IncrementalBackupSpec - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - IncrementalBackupSpec.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates an IncrementalBackupSpec message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.IncrementalBackupSpec - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.IncrementalBackupSpec} IncrementalBackupSpec - */ - IncrementalBackupSpec.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.IncrementalBackupSpec) - return object; - return new $root.google.spanner.admin.database.v1.IncrementalBackupSpec(); - }; - - /** - * Creates a plain object from an IncrementalBackupSpec message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.IncrementalBackupSpec - * @static - * @param {google.spanner.admin.database.v1.IncrementalBackupSpec} message IncrementalBackupSpec - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - IncrementalBackupSpec.toObject = function toObject() { - return {}; - }; - - /** - * Converts this IncrementalBackupSpec to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.IncrementalBackupSpec - * @instance - * @returns {Object.} JSON object - */ - IncrementalBackupSpec.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for IncrementalBackupSpec - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.IncrementalBackupSpec - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - IncrementalBackupSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.IncrementalBackupSpec"; - }; - - return IncrementalBackupSpec; - })(); - - v1.BackupInstancePartition = (function() { - - /** - * Properties of a BackupInstancePartition. - * @memberof google.spanner.admin.database.v1 - * @interface IBackupInstancePartition - * @property {string|null} [instancePartition] BackupInstancePartition instancePartition - */ - - /** - * Constructs a new BackupInstancePartition. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents a BackupInstancePartition. - * @implements IBackupInstancePartition - * @constructor - * @param {google.spanner.admin.database.v1.IBackupInstancePartition=} [properties] Properties to set - */ - function BackupInstancePartition(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BackupInstancePartition instancePartition. - * @member {string} instancePartition - * @memberof google.spanner.admin.database.v1.BackupInstancePartition - * @instance - */ - BackupInstancePartition.prototype.instancePartition = ""; - - /** - * Creates a new BackupInstancePartition instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.BackupInstancePartition - * @static - * @param {google.spanner.admin.database.v1.IBackupInstancePartition=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.BackupInstancePartition} BackupInstancePartition instance - */ - BackupInstancePartition.create = function create(properties) { - return new BackupInstancePartition(properties); - }; - - /** - * Encodes the specified BackupInstancePartition message. Does not implicitly {@link google.spanner.admin.database.v1.BackupInstancePartition.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.BackupInstancePartition - * @static - * @param {google.spanner.admin.database.v1.IBackupInstancePartition} message BackupInstancePartition message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BackupInstancePartition.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.instancePartition != null && Object.hasOwnProperty.call(message, "instancePartition")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.instancePartition); - return writer; - }; - - /** - * Encodes the specified BackupInstancePartition message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.BackupInstancePartition.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.BackupInstancePartition - * @static - * @param {google.spanner.admin.database.v1.IBackupInstancePartition} message BackupInstancePartition message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BackupInstancePartition.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BackupInstancePartition message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.BackupInstancePartition - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.BackupInstancePartition} BackupInstancePartition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BackupInstancePartition.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.BackupInstancePartition(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.instancePartition = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BackupInstancePartition message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.BackupInstancePartition - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.BackupInstancePartition} BackupInstancePartition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BackupInstancePartition.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BackupInstancePartition message. - * @function verify - * @memberof google.spanner.admin.database.v1.BackupInstancePartition - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BackupInstancePartition.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.instancePartition != null && message.hasOwnProperty("instancePartition")) - if (!$util.isString(message.instancePartition)) - return "instancePartition: string expected"; - return null; - }; - - /** - * Creates a BackupInstancePartition message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.BackupInstancePartition - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.BackupInstancePartition} BackupInstancePartition - */ - BackupInstancePartition.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.BackupInstancePartition) - return object; - var message = new $root.google.spanner.admin.database.v1.BackupInstancePartition(); - if (object.instancePartition != null) - message.instancePartition = String(object.instancePartition); - return message; - }; - - /** - * Creates a plain object from a BackupInstancePartition message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.BackupInstancePartition - * @static - * @param {google.spanner.admin.database.v1.BackupInstancePartition} message BackupInstancePartition - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BackupInstancePartition.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.instancePartition = ""; - if (message.instancePartition != null && message.hasOwnProperty("instancePartition")) - object.instancePartition = message.instancePartition; - return object; - }; - - /** - * Converts this BackupInstancePartition to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.BackupInstancePartition - * @instance - * @returns {Object.} JSON object - */ - BackupInstancePartition.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BackupInstancePartition - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.BackupInstancePartition - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BackupInstancePartition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.BackupInstancePartition"; - }; - - return BackupInstancePartition; - })(); - - v1.OperationProgress = (function() { - - /** - * Properties of an OperationProgress. - * @memberof google.spanner.admin.database.v1 - * @interface IOperationProgress - * @property {number|null} [progressPercent] OperationProgress progressPercent - * @property {google.protobuf.ITimestamp|null} [startTime] OperationProgress startTime - * @property {google.protobuf.ITimestamp|null} [endTime] OperationProgress endTime - */ - - /** - * Constructs a new OperationProgress. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents an OperationProgress. - * @implements IOperationProgress - * @constructor - * @param {google.spanner.admin.database.v1.IOperationProgress=} [properties] Properties to set - */ - function OperationProgress(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * OperationProgress progressPercent. - * @member {number} progressPercent - * @memberof google.spanner.admin.database.v1.OperationProgress - * @instance - */ - OperationProgress.prototype.progressPercent = 0; - - /** - * OperationProgress startTime. - * @member {google.protobuf.ITimestamp|null|undefined} startTime - * @memberof google.spanner.admin.database.v1.OperationProgress - * @instance - */ - OperationProgress.prototype.startTime = null; - - /** - * OperationProgress endTime. - * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.spanner.admin.database.v1.OperationProgress - * @instance - */ - OperationProgress.prototype.endTime = null; - - /** - * Creates a new OperationProgress instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.OperationProgress - * @static - * @param {google.spanner.admin.database.v1.IOperationProgress=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.OperationProgress} OperationProgress instance - */ - OperationProgress.create = function create(properties) { - return new OperationProgress(properties); - }; - - /** - * Encodes the specified OperationProgress message. Does not implicitly {@link google.spanner.admin.database.v1.OperationProgress.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.OperationProgress - * @static - * @param {google.spanner.admin.database.v1.IOperationProgress} message OperationProgress message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OperationProgress.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.progressPercent != null && Object.hasOwnProperty.call(message, "progressPercent")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.progressPercent); - if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) - $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) - $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified OperationProgress message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.OperationProgress.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.OperationProgress - * @static - * @param {google.spanner.admin.database.v1.IOperationProgress} message OperationProgress message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OperationProgress.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OperationProgress message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.OperationProgress - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.OperationProgress} OperationProgress - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OperationProgress.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.OperationProgress(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.progressPercent = reader.int32(); - break; - } - case 2: { - message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 3: { - message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OperationProgress message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.OperationProgress - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.OperationProgress} OperationProgress - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OperationProgress.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OperationProgress message. - * @function verify - * @memberof google.spanner.admin.database.v1.OperationProgress - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OperationProgress.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.progressPercent != null && message.hasOwnProperty("progressPercent")) - if (!$util.isInteger(message.progressPercent)) - return "progressPercent: integer expected"; - if (message.startTime != null && message.hasOwnProperty("startTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.startTime); - if (error) - return "startTime." + error; - } - if (message.endTime != null && message.hasOwnProperty("endTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.endTime); - if (error) - return "endTime." + error; - } - return null; - }; - - /** - * Creates an OperationProgress message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.OperationProgress - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.OperationProgress} OperationProgress - */ - OperationProgress.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.OperationProgress) - return object; - var message = new $root.google.spanner.admin.database.v1.OperationProgress(); - if (object.progressPercent != null) - message.progressPercent = object.progressPercent | 0; - if (object.startTime != null) { - if (typeof object.startTime !== "object") - throw TypeError(".google.spanner.admin.database.v1.OperationProgress.startTime: object expected"); - message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); - } - if (object.endTime != null) { - if (typeof object.endTime !== "object") - throw TypeError(".google.spanner.admin.database.v1.OperationProgress.endTime: object expected"); - message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); - } - return message; - }; - - /** - * Creates a plain object from an OperationProgress message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.OperationProgress - * @static - * @param {google.spanner.admin.database.v1.OperationProgress} message OperationProgress - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OperationProgress.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.progressPercent = 0; - object.startTime = null; - object.endTime = null; - } - if (message.progressPercent != null && message.hasOwnProperty("progressPercent")) - object.progressPercent = message.progressPercent; - if (message.startTime != null && message.hasOwnProperty("startTime")) - object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); - if (message.endTime != null && message.hasOwnProperty("endTime")) - object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); - return object; - }; - - /** - * Converts this OperationProgress to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.OperationProgress - * @instance - * @returns {Object.} JSON object - */ - OperationProgress.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OperationProgress - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.OperationProgress - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OperationProgress.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.OperationProgress"; - }; - - return OperationProgress; - })(); - - v1.EncryptionConfig = (function() { - - /** - * Properties of an EncryptionConfig. - * @memberof google.spanner.admin.database.v1 - * @interface IEncryptionConfig - * @property {string|null} [kmsKeyName] EncryptionConfig kmsKeyName - * @property {Array.|null} [kmsKeyNames] EncryptionConfig kmsKeyNames - */ - - /** - * Constructs a new EncryptionConfig. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents an EncryptionConfig. - * @implements IEncryptionConfig - * @constructor - * @param {google.spanner.admin.database.v1.IEncryptionConfig=} [properties] Properties to set - */ - function EncryptionConfig(properties) { - this.kmsKeyNames = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EncryptionConfig kmsKeyName. - * @member {string} kmsKeyName - * @memberof google.spanner.admin.database.v1.EncryptionConfig - * @instance - */ - EncryptionConfig.prototype.kmsKeyName = ""; - - /** - * EncryptionConfig kmsKeyNames. - * @member {Array.} kmsKeyNames - * @memberof google.spanner.admin.database.v1.EncryptionConfig - * @instance - */ - EncryptionConfig.prototype.kmsKeyNames = $util.emptyArray; - - /** - * Creates a new EncryptionConfig instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.EncryptionConfig - * @static - * @param {google.spanner.admin.database.v1.IEncryptionConfig=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.EncryptionConfig} EncryptionConfig instance - */ - EncryptionConfig.create = function create(properties) { - return new EncryptionConfig(properties); - }; - - /** - * Encodes the specified EncryptionConfig message. Does not implicitly {@link google.spanner.admin.database.v1.EncryptionConfig.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.EncryptionConfig - * @static - * @param {google.spanner.admin.database.v1.IEncryptionConfig} message EncryptionConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EncryptionConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.kmsKeyName); - if (message.kmsKeyNames != null && message.kmsKeyNames.length) - for (var i = 0; i < message.kmsKeyNames.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.kmsKeyNames[i]); - return writer; - }; - - /** - * Encodes the specified EncryptionConfig message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.EncryptionConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.EncryptionConfig - * @static - * @param {google.spanner.admin.database.v1.IEncryptionConfig} message EncryptionConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EncryptionConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EncryptionConfig message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.EncryptionConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.EncryptionConfig} EncryptionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EncryptionConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.EncryptionConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - message.kmsKeyName = reader.string(); - break; - } - case 3: { - if (!(message.kmsKeyNames && message.kmsKeyNames.length)) - message.kmsKeyNames = []; - message.kmsKeyNames.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EncryptionConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.EncryptionConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.EncryptionConfig} EncryptionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EncryptionConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EncryptionConfig message. - * @function verify - * @memberof google.spanner.admin.database.v1.EncryptionConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EncryptionConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) - if (!$util.isString(message.kmsKeyName)) - return "kmsKeyName: string expected"; - if (message.kmsKeyNames != null && message.hasOwnProperty("kmsKeyNames")) { - if (!Array.isArray(message.kmsKeyNames)) - return "kmsKeyNames: array expected"; - for (var i = 0; i < message.kmsKeyNames.length; ++i) - if (!$util.isString(message.kmsKeyNames[i])) - return "kmsKeyNames: string[] expected"; - } - return null; - }; - - /** - * Creates an EncryptionConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.EncryptionConfig - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.EncryptionConfig} EncryptionConfig - */ - EncryptionConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.EncryptionConfig) - return object; - var message = new $root.google.spanner.admin.database.v1.EncryptionConfig(); - if (object.kmsKeyName != null) - message.kmsKeyName = String(object.kmsKeyName); - if (object.kmsKeyNames) { - if (!Array.isArray(object.kmsKeyNames)) - throw TypeError(".google.spanner.admin.database.v1.EncryptionConfig.kmsKeyNames: array expected"); - message.kmsKeyNames = []; - for (var i = 0; i < object.kmsKeyNames.length; ++i) - message.kmsKeyNames[i] = String(object.kmsKeyNames[i]); - } - return message; - }; - - /** - * Creates a plain object from an EncryptionConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.EncryptionConfig - * @static - * @param {google.spanner.admin.database.v1.EncryptionConfig} message EncryptionConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EncryptionConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.kmsKeyNames = []; - if (options.defaults) - object.kmsKeyName = ""; - if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) - object.kmsKeyName = message.kmsKeyName; - if (message.kmsKeyNames && message.kmsKeyNames.length) { - object.kmsKeyNames = []; - for (var j = 0; j < message.kmsKeyNames.length; ++j) - object.kmsKeyNames[j] = message.kmsKeyNames[j]; - } - return object; - }; - - /** - * Converts this EncryptionConfig to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.EncryptionConfig - * @instance - * @returns {Object.} JSON object - */ - EncryptionConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EncryptionConfig - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.EncryptionConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EncryptionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.EncryptionConfig"; - }; - - return EncryptionConfig; - })(); - - v1.EncryptionInfo = (function() { - - /** - * Properties of an EncryptionInfo. - * @memberof google.spanner.admin.database.v1 - * @interface IEncryptionInfo - * @property {google.spanner.admin.database.v1.EncryptionInfo.Type|null} [encryptionType] EncryptionInfo encryptionType - * @property {google.rpc.IStatus|null} [encryptionStatus] EncryptionInfo encryptionStatus - * @property {string|null} [kmsKeyVersion] EncryptionInfo kmsKeyVersion - */ - - /** - * Constructs a new EncryptionInfo. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents an EncryptionInfo. - * @implements IEncryptionInfo - * @constructor - * @param {google.spanner.admin.database.v1.IEncryptionInfo=} [properties] Properties to set - */ - function EncryptionInfo(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EncryptionInfo encryptionType. - * @member {google.spanner.admin.database.v1.EncryptionInfo.Type} encryptionType - * @memberof google.spanner.admin.database.v1.EncryptionInfo - * @instance - */ - EncryptionInfo.prototype.encryptionType = 0; - - /** - * EncryptionInfo encryptionStatus. - * @member {google.rpc.IStatus|null|undefined} encryptionStatus - * @memberof google.spanner.admin.database.v1.EncryptionInfo - * @instance - */ - EncryptionInfo.prototype.encryptionStatus = null; - - /** - * EncryptionInfo kmsKeyVersion. - * @member {string} kmsKeyVersion - * @memberof google.spanner.admin.database.v1.EncryptionInfo - * @instance - */ - EncryptionInfo.prototype.kmsKeyVersion = ""; - - /** - * Creates a new EncryptionInfo instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.EncryptionInfo - * @static - * @param {google.spanner.admin.database.v1.IEncryptionInfo=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.EncryptionInfo} EncryptionInfo instance - */ - EncryptionInfo.create = function create(properties) { - return new EncryptionInfo(properties); - }; - - /** - * Encodes the specified EncryptionInfo message. Does not implicitly {@link google.spanner.admin.database.v1.EncryptionInfo.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.EncryptionInfo - * @static - * @param {google.spanner.admin.database.v1.IEncryptionInfo} message EncryptionInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EncryptionInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.kmsKeyVersion != null && Object.hasOwnProperty.call(message, "kmsKeyVersion")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.kmsKeyVersion); - if (message.encryptionType != null && Object.hasOwnProperty.call(message, "encryptionType")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.encryptionType); - if (message.encryptionStatus != null && Object.hasOwnProperty.call(message, "encryptionStatus")) - $root.google.rpc.Status.encode(message.encryptionStatus, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EncryptionInfo message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.EncryptionInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.EncryptionInfo - * @static - * @param {google.spanner.admin.database.v1.IEncryptionInfo} message EncryptionInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EncryptionInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EncryptionInfo message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.EncryptionInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.EncryptionInfo} EncryptionInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EncryptionInfo.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.EncryptionInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 3: { - message.encryptionType = reader.int32(); - break; - } - case 4: { - message.encryptionStatus = $root.google.rpc.Status.decode(reader, reader.uint32()); - break; - } - case 2: { - message.kmsKeyVersion = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EncryptionInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.EncryptionInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.EncryptionInfo} EncryptionInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EncryptionInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EncryptionInfo message. - * @function verify - * @memberof google.spanner.admin.database.v1.EncryptionInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EncryptionInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.encryptionType != null && message.hasOwnProperty("encryptionType")) - switch (message.encryptionType) { - default: - return "encryptionType: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.encryptionStatus != null && message.hasOwnProperty("encryptionStatus")) { - var error = $root.google.rpc.Status.verify(message.encryptionStatus); - if (error) - return "encryptionStatus." + error; - } - if (message.kmsKeyVersion != null && message.hasOwnProperty("kmsKeyVersion")) - if (!$util.isString(message.kmsKeyVersion)) - return "kmsKeyVersion: string expected"; - return null; - }; - - /** - * Creates an EncryptionInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.EncryptionInfo - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.EncryptionInfo} EncryptionInfo - */ - EncryptionInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.EncryptionInfo) - return object; - var message = new $root.google.spanner.admin.database.v1.EncryptionInfo(); - switch (object.encryptionType) { - default: - if (typeof object.encryptionType === "number") { - message.encryptionType = object.encryptionType; - break; - } - break; - case "TYPE_UNSPECIFIED": - case 0: - message.encryptionType = 0; - break; - case "GOOGLE_DEFAULT_ENCRYPTION": - case 1: - message.encryptionType = 1; - break; - case "CUSTOMER_MANAGED_ENCRYPTION": - case 2: - message.encryptionType = 2; - break; - } - if (object.encryptionStatus != null) { - if (typeof object.encryptionStatus !== "object") - throw TypeError(".google.spanner.admin.database.v1.EncryptionInfo.encryptionStatus: object expected"); - message.encryptionStatus = $root.google.rpc.Status.fromObject(object.encryptionStatus); - } - if (object.kmsKeyVersion != null) - message.kmsKeyVersion = String(object.kmsKeyVersion); - return message; - }; - - /** - * Creates a plain object from an EncryptionInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.EncryptionInfo - * @static - * @param {google.spanner.admin.database.v1.EncryptionInfo} message EncryptionInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EncryptionInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.kmsKeyVersion = ""; - object.encryptionType = options.enums === String ? "TYPE_UNSPECIFIED" : 0; - object.encryptionStatus = null; - } - if (message.kmsKeyVersion != null && message.hasOwnProperty("kmsKeyVersion")) - object.kmsKeyVersion = message.kmsKeyVersion; - if (message.encryptionType != null && message.hasOwnProperty("encryptionType")) - object.encryptionType = options.enums === String ? $root.google.spanner.admin.database.v1.EncryptionInfo.Type[message.encryptionType] === undefined ? message.encryptionType : $root.google.spanner.admin.database.v1.EncryptionInfo.Type[message.encryptionType] : message.encryptionType; - if (message.encryptionStatus != null && message.hasOwnProperty("encryptionStatus")) - object.encryptionStatus = $root.google.rpc.Status.toObject(message.encryptionStatus, options); - return object; - }; - - /** - * Converts this EncryptionInfo to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.EncryptionInfo - * @instance - * @returns {Object.} JSON object - */ - EncryptionInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EncryptionInfo - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.EncryptionInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EncryptionInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.EncryptionInfo"; - }; - - /** - * Type enum. - * @name google.spanner.admin.database.v1.EncryptionInfo.Type - * @enum {number} - * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value - * @property {number} GOOGLE_DEFAULT_ENCRYPTION=1 GOOGLE_DEFAULT_ENCRYPTION value - * @property {number} CUSTOMER_MANAGED_ENCRYPTION=2 CUSTOMER_MANAGED_ENCRYPTION value - */ - EncryptionInfo.Type = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "GOOGLE_DEFAULT_ENCRYPTION"] = 1; - values[valuesById[2] = "CUSTOMER_MANAGED_ENCRYPTION"] = 2; - return values; - })(); - - return EncryptionInfo; - })(); - - /** - * DatabaseDialect enum. - * @name google.spanner.admin.database.v1.DatabaseDialect - * @enum {number} - * @property {number} DATABASE_DIALECT_UNSPECIFIED=0 DATABASE_DIALECT_UNSPECIFIED value - * @property {number} GOOGLE_STANDARD_SQL=1 GOOGLE_STANDARD_SQL value - * @property {number} POSTGRESQL=2 POSTGRESQL value - */ - v1.DatabaseDialect = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "DATABASE_DIALECT_UNSPECIFIED"] = 0; - values[valuesById[1] = "GOOGLE_STANDARD_SQL"] = 1; - values[valuesById[2] = "POSTGRESQL"] = 2; - return values; - })(); - - v1.BackupScheduleSpec = (function() { - - /** - * Properties of a BackupScheduleSpec. - * @memberof google.spanner.admin.database.v1 - * @interface IBackupScheduleSpec - * @property {google.spanner.admin.database.v1.ICrontabSpec|null} [cronSpec] BackupScheduleSpec cronSpec - */ - - /** - * Constructs a new BackupScheduleSpec. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents a BackupScheduleSpec. - * @implements IBackupScheduleSpec - * @constructor - * @param {google.spanner.admin.database.v1.IBackupScheduleSpec=} [properties] Properties to set - */ - function BackupScheduleSpec(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BackupScheduleSpec cronSpec. - * @member {google.spanner.admin.database.v1.ICrontabSpec|null|undefined} cronSpec - * @memberof google.spanner.admin.database.v1.BackupScheduleSpec - * @instance - */ - BackupScheduleSpec.prototype.cronSpec = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * BackupScheduleSpec scheduleSpec. - * @member {"cronSpec"|undefined} scheduleSpec - * @memberof google.spanner.admin.database.v1.BackupScheduleSpec - * @instance - */ - Object.defineProperty(BackupScheduleSpec.prototype, "scheduleSpec", { - get: $util.oneOfGetter($oneOfFields = ["cronSpec"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new BackupScheduleSpec instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.BackupScheduleSpec - * @static - * @param {google.spanner.admin.database.v1.IBackupScheduleSpec=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.BackupScheduleSpec} BackupScheduleSpec instance - */ - BackupScheduleSpec.create = function create(properties) { - return new BackupScheduleSpec(properties); - }; - - /** - * Encodes the specified BackupScheduleSpec message. Does not implicitly {@link google.spanner.admin.database.v1.BackupScheduleSpec.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.BackupScheduleSpec - * @static - * @param {google.spanner.admin.database.v1.IBackupScheduleSpec} message BackupScheduleSpec message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BackupScheduleSpec.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.cronSpec != null && Object.hasOwnProperty.call(message, "cronSpec")) - $root.google.spanner.admin.database.v1.CrontabSpec.encode(message.cronSpec, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified BackupScheduleSpec message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.BackupScheduleSpec.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.BackupScheduleSpec - * @static - * @param {google.spanner.admin.database.v1.IBackupScheduleSpec} message BackupScheduleSpec message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BackupScheduleSpec.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BackupScheduleSpec message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.BackupScheduleSpec - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.BackupScheduleSpec} BackupScheduleSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BackupScheduleSpec.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.BackupScheduleSpec(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.cronSpec = $root.google.spanner.admin.database.v1.CrontabSpec.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BackupScheduleSpec message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.BackupScheduleSpec - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.BackupScheduleSpec} BackupScheduleSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BackupScheduleSpec.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BackupScheduleSpec message. - * @function verify - * @memberof google.spanner.admin.database.v1.BackupScheduleSpec - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BackupScheduleSpec.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.cronSpec != null && message.hasOwnProperty("cronSpec")) { - properties.scheduleSpec = 1; - { - var error = $root.google.spanner.admin.database.v1.CrontabSpec.verify(message.cronSpec); - if (error) - return "cronSpec." + error; - } - } - return null; - }; - - /** - * Creates a BackupScheduleSpec message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.BackupScheduleSpec - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.BackupScheduleSpec} BackupScheduleSpec - */ - BackupScheduleSpec.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.BackupScheduleSpec) - return object; - var message = new $root.google.spanner.admin.database.v1.BackupScheduleSpec(); - if (object.cronSpec != null) { - if (typeof object.cronSpec !== "object") - throw TypeError(".google.spanner.admin.database.v1.BackupScheduleSpec.cronSpec: object expected"); - message.cronSpec = $root.google.spanner.admin.database.v1.CrontabSpec.fromObject(object.cronSpec); - } - return message; - }; - - /** - * Creates a plain object from a BackupScheduleSpec message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.BackupScheduleSpec - * @static - * @param {google.spanner.admin.database.v1.BackupScheduleSpec} message BackupScheduleSpec - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BackupScheduleSpec.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.cronSpec != null && message.hasOwnProperty("cronSpec")) { - object.cronSpec = $root.google.spanner.admin.database.v1.CrontabSpec.toObject(message.cronSpec, options); - if (options.oneofs) - object.scheduleSpec = "cronSpec"; - } - return object; - }; - - /** - * Converts this BackupScheduleSpec to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.BackupScheduleSpec - * @instance - * @returns {Object.} JSON object - */ - BackupScheduleSpec.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BackupScheduleSpec - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.BackupScheduleSpec - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BackupScheduleSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.BackupScheduleSpec"; - }; - - return BackupScheduleSpec; - })(); - - v1.BackupSchedule = (function() { - - /** - * Properties of a BackupSchedule. - * @memberof google.spanner.admin.database.v1 - * @interface IBackupSchedule - * @property {string|null} [name] BackupSchedule name - * @property {google.spanner.admin.database.v1.IBackupScheduleSpec|null} [spec] BackupSchedule spec - * @property {google.protobuf.IDuration|null} [retentionDuration] BackupSchedule retentionDuration - * @property {google.spanner.admin.database.v1.ICreateBackupEncryptionConfig|null} [encryptionConfig] BackupSchedule encryptionConfig - * @property {google.spanner.admin.database.v1.IFullBackupSpec|null} [fullBackupSpec] BackupSchedule fullBackupSpec - * @property {google.spanner.admin.database.v1.IIncrementalBackupSpec|null} [incrementalBackupSpec] BackupSchedule incrementalBackupSpec - * @property {google.protobuf.ITimestamp|null} [updateTime] BackupSchedule updateTime - */ - - /** - * Constructs a new BackupSchedule. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents a BackupSchedule. - * @implements IBackupSchedule - * @constructor - * @param {google.spanner.admin.database.v1.IBackupSchedule=} [properties] Properties to set - */ - function BackupSchedule(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BackupSchedule name. - * @member {string} name - * @memberof google.spanner.admin.database.v1.BackupSchedule - * @instance - */ - BackupSchedule.prototype.name = ""; - - /** - * BackupSchedule spec. - * @member {google.spanner.admin.database.v1.IBackupScheduleSpec|null|undefined} spec - * @memberof google.spanner.admin.database.v1.BackupSchedule - * @instance - */ - BackupSchedule.prototype.spec = null; - - /** - * BackupSchedule retentionDuration. - * @member {google.protobuf.IDuration|null|undefined} retentionDuration - * @memberof google.spanner.admin.database.v1.BackupSchedule - * @instance - */ - BackupSchedule.prototype.retentionDuration = null; - - /** - * BackupSchedule encryptionConfig. - * @member {google.spanner.admin.database.v1.ICreateBackupEncryptionConfig|null|undefined} encryptionConfig - * @memberof google.spanner.admin.database.v1.BackupSchedule - * @instance - */ - BackupSchedule.prototype.encryptionConfig = null; - - /** - * BackupSchedule fullBackupSpec. - * @member {google.spanner.admin.database.v1.IFullBackupSpec|null|undefined} fullBackupSpec - * @memberof google.spanner.admin.database.v1.BackupSchedule - * @instance - */ - BackupSchedule.prototype.fullBackupSpec = null; - - /** - * BackupSchedule incrementalBackupSpec. - * @member {google.spanner.admin.database.v1.IIncrementalBackupSpec|null|undefined} incrementalBackupSpec - * @memberof google.spanner.admin.database.v1.BackupSchedule - * @instance - */ - BackupSchedule.prototype.incrementalBackupSpec = null; - - /** - * BackupSchedule updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.spanner.admin.database.v1.BackupSchedule - * @instance - */ - BackupSchedule.prototype.updateTime = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * BackupSchedule backupTypeSpec. - * @member {"fullBackupSpec"|"incrementalBackupSpec"|undefined} backupTypeSpec - * @memberof google.spanner.admin.database.v1.BackupSchedule - * @instance - */ - Object.defineProperty(BackupSchedule.prototype, "backupTypeSpec", { - get: $util.oneOfGetter($oneOfFields = ["fullBackupSpec", "incrementalBackupSpec"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new BackupSchedule instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.BackupSchedule - * @static - * @param {google.spanner.admin.database.v1.IBackupSchedule=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.BackupSchedule} BackupSchedule instance - */ - BackupSchedule.create = function create(properties) { - return new BackupSchedule(properties); - }; - - /** - * Encodes the specified BackupSchedule message. Does not implicitly {@link google.spanner.admin.database.v1.BackupSchedule.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.BackupSchedule - * @static - * @param {google.spanner.admin.database.v1.IBackupSchedule} message BackupSchedule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BackupSchedule.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.retentionDuration != null && Object.hasOwnProperty.call(message, "retentionDuration")) - $root.google.protobuf.Duration.encode(message.retentionDuration, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) - $root.google.spanner.admin.database.v1.CreateBackupEncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.spec != null && Object.hasOwnProperty.call(message, "spec")) - $root.google.spanner.admin.database.v1.BackupScheduleSpec.encode(message.spec, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.fullBackupSpec != null && Object.hasOwnProperty.call(message, "fullBackupSpec")) - $root.google.spanner.admin.database.v1.FullBackupSpec.encode(message.fullBackupSpec, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.incrementalBackupSpec != null && Object.hasOwnProperty.call(message, "incrementalBackupSpec")) - $root.google.spanner.admin.database.v1.IncrementalBackupSpec.encode(message.incrementalBackupSpec, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified BackupSchedule message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.BackupSchedule.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.BackupSchedule - * @static - * @param {google.spanner.admin.database.v1.IBackupSchedule} message BackupSchedule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BackupSchedule.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BackupSchedule message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.BackupSchedule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.BackupSchedule} BackupSchedule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BackupSchedule.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.BackupSchedule(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 6: { - message.spec = $root.google.spanner.admin.database.v1.BackupScheduleSpec.decode(reader, reader.uint32()); - break; - } - case 3: { - message.retentionDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 4: { - message.encryptionConfig = $root.google.spanner.admin.database.v1.CreateBackupEncryptionConfig.decode(reader, reader.uint32()); - break; - } - case 7: { - message.fullBackupSpec = $root.google.spanner.admin.database.v1.FullBackupSpec.decode(reader, reader.uint32()); - break; - } - case 8: { - message.incrementalBackupSpec = $root.google.spanner.admin.database.v1.IncrementalBackupSpec.decode(reader, reader.uint32()); - break; - } - case 9: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BackupSchedule message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.BackupSchedule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.BackupSchedule} BackupSchedule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BackupSchedule.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BackupSchedule message. - * @function verify - * @memberof google.spanner.admin.database.v1.BackupSchedule - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BackupSchedule.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.spec != null && message.hasOwnProperty("spec")) { - var error = $root.google.spanner.admin.database.v1.BackupScheduleSpec.verify(message.spec); - if (error) - return "spec." + error; - } - if (message.retentionDuration != null && message.hasOwnProperty("retentionDuration")) { - var error = $root.google.protobuf.Duration.verify(message.retentionDuration); - if (error) - return "retentionDuration." + error; - } - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { - var error = $root.google.spanner.admin.database.v1.CreateBackupEncryptionConfig.verify(message.encryptionConfig); - if (error) - return "encryptionConfig." + error; - } - if (message.fullBackupSpec != null && message.hasOwnProperty("fullBackupSpec")) { - properties.backupTypeSpec = 1; - { - var error = $root.google.spanner.admin.database.v1.FullBackupSpec.verify(message.fullBackupSpec); - if (error) - return "fullBackupSpec." + error; - } - } - if (message.incrementalBackupSpec != null && message.hasOwnProperty("incrementalBackupSpec")) { - if (properties.backupTypeSpec === 1) - return "backupTypeSpec: multiple values"; - properties.backupTypeSpec = 1; - { - var error = $root.google.spanner.admin.database.v1.IncrementalBackupSpec.verify(message.incrementalBackupSpec); - if (error) - return "incrementalBackupSpec." + error; - } - } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); - if (error) - return "updateTime." + error; - } - return null; - }; - - /** - * Creates a BackupSchedule message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.BackupSchedule - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.BackupSchedule} BackupSchedule - */ - BackupSchedule.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.BackupSchedule) - return object; - var message = new $root.google.spanner.admin.database.v1.BackupSchedule(); - if (object.name != null) - message.name = String(object.name); - if (object.spec != null) { - if (typeof object.spec !== "object") - throw TypeError(".google.spanner.admin.database.v1.BackupSchedule.spec: object expected"); - message.spec = $root.google.spanner.admin.database.v1.BackupScheduleSpec.fromObject(object.spec); - } - if (object.retentionDuration != null) { - if (typeof object.retentionDuration !== "object") - throw TypeError(".google.spanner.admin.database.v1.BackupSchedule.retentionDuration: object expected"); - message.retentionDuration = $root.google.protobuf.Duration.fromObject(object.retentionDuration); - } - if (object.encryptionConfig != null) { - if (typeof object.encryptionConfig !== "object") - throw TypeError(".google.spanner.admin.database.v1.BackupSchedule.encryptionConfig: object expected"); - message.encryptionConfig = $root.google.spanner.admin.database.v1.CreateBackupEncryptionConfig.fromObject(object.encryptionConfig); - } - if (object.fullBackupSpec != null) { - if (typeof object.fullBackupSpec !== "object") - throw TypeError(".google.spanner.admin.database.v1.BackupSchedule.fullBackupSpec: object expected"); - message.fullBackupSpec = $root.google.spanner.admin.database.v1.FullBackupSpec.fromObject(object.fullBackupSpec); - } - if (object.incrementalBackupSpec != null) { - if (typeof object.incrementalBackupSpec !== "object") - throw TypeError(".google.spanner.admin.database.v1.BackupSchedule.incrementalBackupSpec: object expected"); - message.incrementalBackupSpec = $root.google.spanner.admin.database.v1.IncrementalBackupSpec.fromObject(object.incrementalBackupSpec); - } - if (object.updateTime != null) { - if (typeof object.updateTime !== "object") - throw TypeError(".google.spanner.admin.database.v1.BackupSchedule.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - return message; - }; - - /** - * Creates a plain object from a BackupSchedule message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.BackupSchedule - * @static - * @param {google.spanner.admin.database.v1.BackupSchedule} message BackupSchedule - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BackupSchedule.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.retentionDuration = null; - object.encryptionConfig = null; - object.spec = null; - object.updateTime = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.retentionDuration != null && message.hasOwnProperty("retentionDuration")) - object.retentionDuration = $root.google.protobuf.Duration.toObject(message.retentionDuration, options); - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) - object.encryptionConfig = $root.google.spanner.admin.database.v1.CreateBackupEncryptionConfig.toObject(message.encryptionConfig, options); - if (message.spec != null && message.hasOwnProperty("spec")) - object.spec = $root.google.spanner.admin.database.v1.BackupScheduleSpec.toObject(message.spec, options); - if (message.fullBackupSpec != null && message.hasOwnProperty("fullBackupSpec")) { - object.fullBackupSpec = $root.google.spanner.admin.database.v1.FullBackupSpec.toObject(message.fullBackupSpec, options); - if (options.oneofs) - object.backupTypeSpec = "fullBackupSpec"; - } - if (message.incrementalBackupSpec != null && message.hasOwnProperty("incrementalBackupSpec")) { - object.incrementalBackupSpec = $root.google.spanner.admin.database.v1.IncrementalBackupSpec.toObject(message.incrementalBackupSpec, options); - if (options.oneofs) - object.backupTypeSpec = "incrementalBackupSpec"; - } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); - return object; - }; - - /** - * Converts this BackupSchedule to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.BackupSchedule - * @instance - * @returns {Object.} JSON object - */ - BackupSchedule.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BackupSchedule - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.BackupSchedule - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BackupSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.BackupSchedule"; - }; - - return BackupSchedule; - })(); - - v1.CrontabSpec = (function() { - - /** - * Properties of a CrontabSpec. - * @memberof google.spanner.admin.database.v1 - * @interface ICrontabSpec - * @property {string|null} [text] CrontabSpec text - * @property {string|null} [timeZone] CrontabSpec timeZone - * @property {google.protobuf.IDuration|null} [creationWindow] CrontabSpec creationWindow - */ - - /** - * Constructs a new CrontabSpec. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents a CrontabSpec. - * @implements ICrontabSpec - * @constructor - * @param {google.spanner.admin.database.v1.ICrontabSpec=} [properties] Properties to set - */ - function CrontabSpec(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CrontabSpec text. - * @member {string} text - * @memberof google.spanner.admin.database.v1.CrontabSpec - * @instance - */ - CrontabSpec.prototype.text = ""; - - /** - * CrontabSpec timeZone. - * @member {string} timeZone - * @memberof google.spanner.admin.database.v1.CrontabSpec - * @instance - */ - CrontabSpec.prototype.timeZone = ""; - - /** - * CrontabSpec creationWindow. - * @member {google.protobuf.IDuration|null|undefined} creationWindow - * @memberof google.spanner.admin.database.v1.CrontabSpec - * @instance - */ - CrontabSpec.prototype.creationWindow = null; - - /** - * Creates a new CrontabSpec instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.CrontabSpec - * @static - * @param {google.spanner.admin.database.v1.ICrontabSpec=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.CrontabSpec} CrontabSpec instance - */ - CrontabSpec.create = function create(properties) { - return new CrontabSpec(properties); - }; - - /** - * Encodes the specified CrontabSpec message. Does not implicitly {@link google.spanner.admin.database.v1.CrontabSpec.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.CrontabSpec - * @static - * @param {google.spanner.admin.database.v1.ICrontabSpec} message CrontabSpec message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CrontabSpec.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.text != null && Object.hasOwnProperty.call(message, "text")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); - if (message.timeZone != null && Object.hasOwnProperty.call(message, "timeZone")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.timeZone); - if (message.creationWindow != null && Object.hasOwnProperty.call(message, "creationWindow")) - $root.google.protobuf.Duration.encode(message.creationWindow, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CrontabSpec message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.CrontabSpec.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.CrontabSpec - * @static - * @param {google.spanner.admin.database.v1.ICrontabSpec} message CrontabSpec message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CrontabSpec.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CrontabSpec message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.CrontabSpec - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.CrontabSpec} CrontabSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CrontabSpec.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.CrontabSpec(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.text = reader.string(); - break; - } - case 2: { - message.timeZone = reader.string(); - break; - } - case 3: { - message.creationWindow = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CrontabSpec message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.CrontabSpec - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.CrontabSpec} CrontabSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CrontabSpec.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CrontabSpec message. - * @function verify - * @memberof google.spanner.admin.database.v1.CrontabSpec - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CrontabSpec.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.text != null && message.hasOwnProperty("text")) - if (!$util.isString(message.text)) - return "text: string expected"; - if (message.timeZone != null && message.hasOwnProperty("timeZone")) - if (!$util.isString(message.timeZone)) - return "timeZone: string expected"; - if (message.creationWindow != null && message.hasOwnProperty("creationWindow")) { - var error = $root.google.protobuf.Duration.verify(message.creationWindow); - if (error) - return "creationWindow." + error; - } - return null; - }; - - /** - * Creates a CrontabSpec message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.CrontabSpec - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.CrontabSpec} CrontabSpec - */ - CrontabSpec.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.CrontabSpec) - return object; - var message = new $root.google.spanner.admin.database.v1.CrontabSpec(); - if (object.text != null) - message.text = String(object.text); - if (object.timeZone != null) - message.timeZone = String(object.timeZone); - if (object.creationWindow != null) { - if (typeof object.creationWindow !== "object") - throw TypeError(".google.spanner.admin.database.v1.CrontabSpec.creationWindow: object expected"); - message.creationWindow = $root.google.protobuf.Duration.fromObject(object.creationWindow); - } - return message; - }; - - /** - * Creates a plain object from a CrontabSpec message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.CrontabSpec - * @static - * @param {google.spanner.admin.database.v1.CrontabSpec} message CrontabSpec - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CrontabSpec.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.text = ""; - object.timeZone = ""; - object.creationWindow = null; - } - if (message.text != null && message.hasOwnProperty("text")) - object.text = message.text; - if (message.timeZone != null && message.hasOwnProperty("timeZone")) - object.timeZone = message.timeZone; - if (message.creationWindow != null && message.hasOwnProperty("creationWindow")) - object.creationWindow = $root.google.protobuf.Duration.toObject(message.creationWindow, options); - return object; - }; - - /** - * Converts this CrontabSpec to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.CrontabSpec - * @instance - * @returns {Object.} JSON object - */ - CrontabSpec.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CrontabSpec - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.CrontabSpec - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CrontabSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.CrontabSpec"; - }; - - return CrontabSpec; - })(); - - v1.CreateBackupScheduleRequest = (function() { - - /** - * Properties of a CreateBackupScheduleRequest. - * @memberof google.spanner.admin.database.v1 - * @interface ICreateBackupScheduleRequest - * @property {string|null} [parent] CreateBackupScheduleRequest parent - * @property {string|null} [backupScheduleId] CreateBackupScheduleRequest backupScheduleId - * @property {google.spanner.admin.database.v1.IBackupSchedule|null} [backupSchedule] CreateBackupScheduleRequest backupSchedule - */ - - /** - * Constructs a new CreateBackupScheduleRequest. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents a CreateBackupScheduleRequest. - * @implements ICreateBackupScheduleRequest - * @constructor - * @param {google.spanner.admin.database.v1.ICreateBackupScheduleRequest=} [properties] Properties to set - */ - function CreateBackupScheduleRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateBackupScheduleRequest parent. - * @member {string} parent - * @memberof google.spanner.admin.database.v1.CreateBackupScheduleRequest - * @instance - */ - CreateBackupScheduleRequest.prototype.parent = ""; - - /** - * CreateBackupScheduleRequest backupScheduleId. - * @member {string} backupScheduleId - * @memberof google.spanner.admin.database.v1.CreateBackupScheduleRequest - * @instance - */ - CreateBackupScheduleRequest.prototype.backupScheduleId = ""; - - /** - * CreateBackupScheduleRequest backupSchedule. - * @member {google.spanner.admin.database.v1.IBackupSchedule|null|undefined} backupSchedule - * @memberof google.spanner.admin.database.v1.CreateBackupScheduleRequest - * @instance - */ - CreateBackupScheduleRequest.prototype.backupSchedule = null; - - /** - * Creates a new CreateBackupScheduleRequest instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.CreateBackupScheduleRequest - * @static - * @param {google.spanner.admin.database.v1.ICreateBackupScheduleRequest=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.CreateBackupScheduleRequest} CreateBackupScheduleRequest instance - */ - CreateBackupScheduleRequest.create = function create(properties) { - return new CreateBackupScheduleRequest(properties); - }; - - /** - * Encodes the specified CreateBackupScheduleRequest message. Does not implicitly {@link google.spanner.admin.database.v1.CreateBackupScheduleRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.CreateBackupScheduleRequest - * @static - * @param {google.spanner.admin.database.v1.ICreateBackupScheduleRequest} message CreateBackupScheduleRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateBackupScheduleRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.backupScheduleId != null && Object.hasOwnProperty.call(message, "backupScheduleId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.backupScheduleId); - if (message.backupSchedule != null && Object.hasOwnProperty.call(message, "backupSchedule")) - $root.google.spanner.admin.database.v1.BackupSchedule.encode(message.backupSchedule, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CreateBackupScheduleRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.CreateBackupScheduleRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.CreateBackupScheduleRequest - * @static - * @param {google.spanner.admin.database.v1.ICreateBackupScheduleRequest} message CreateBackupScheduleRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateBackupScheduleRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateBackupScheduleRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.CreateBackupScheduleRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.CreateBackupScheduleRequest} CreateBackupScheduleRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateBackupScheduleRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.CreateBackupScheduleRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.backupScheduleId = reader.string(); - break; - } - case 3: { - message.backupSchedule = $root.google.spanner.admin.database.v1.BackupSchedule.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateBackupScheduleRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.CreateBackupScheduleRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.CreateBackupScheduleRequest} CreateBackupScheduleRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateBackupScheduleRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateBackupScheduleRequest message. - * @function verify - * @memberof google.spanner.admin.database.v1.CreateBackupScheduleRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateBackupScheduleRequest.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.backupScheduleId != null && message.hasOwnProperty("backupScheduleId")) - if (!$util.isString(message.backupScheduleId)) - return "backupScheduleId: string expected"; - if (message.backupSchedule != null && message.hasOwnProperty("backupSchedule")) { - var error = $root.google.spanner.admin.database.v1.BackupSchedule.verify(message.backupSchedule); - if (error) - return "backupSchedule." + error; - } - return null; - }; - - /** - * Creates a CreateBackupScheduleRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.CreateBackupScheduleRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.CreateBackupScheduleRequest} CreateBackupScheduleRequest - */ - CreateBackupScheduleRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.CreateBackupScheduleRequest) - return object; - var message = new $root.google.spanner.admin.database.v1.CreateBackupScheduleRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.backupScheduleId != null) - message.backupScheduleId = String(object.backupScheduleId); - if (object.backupSchedule != null) { - if (typeof object.backupSchedule !== "object") - throw TypeError(".google.spanner.admin.database.v1.CreateBackupScheduleRequest.backupSchedule: object expected"); - message.backupSchedule = $root.google.spanner.admin.database.v1.BackupSchedule.fromObject(object.backupSchedule); - } - return message; - }; - - /** - * Creates a plain object from a CreateBackupScheduleRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.CreateBackupScheduleRequest - * @static - * @param {google.spanner.admin.database.v1.CreateBackupScheduleRequest} message CreateBackupScheduleRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateBackupScheduleRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.backupScheduleId = ""; - object.backupSchedule = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.backupScheduleId != null && message.hasOwnProperty("backupScheduleId")) - object.backupScheduleId = message.backupScheduleId; - if (message.backupSchedule != null && message.hasOwnProperty("backupSchedule")) - object.backupSchedule = $root.google.spanner.admin.database.v1.BackupSchedule.toObject(message.backupSchedule, options); - return object; - }; - - /** - * Converts this CreateBackupScheduleRequest to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.CreateBackupScheduleRequest - * @instance - * @returns {Object.} JSON object - */ - CreateBackupScheduleRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateBackupScheduleRequest - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.CreateBackupScheduleRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateBackupScheduleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.CreateBackupScheduleRequest"; - }; - - return CreateBackupScheduleRequest; - })(); - - v1.GetBackupScheduleRequest = (function() { - - /** - * Properties of a GetBackupScheduleRequest. - * @memberof google.spanner.admin.database.v1 - * @interface IGetBackupScheduleRequest - * @property {string|null} [name] GetBackupScheduleRequest name - */ - - /** - * Constructs a new GetBackupScheduleRequest. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents a GetBackupScheduleRequest. - * @implements IGetBackupScheduleRequest - * @constructor - * @param {google.spanner.admin.database.v1.IGetBackupScheduleRequest=} [properties] Properties to set - */ - function GetBackupScheduleRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetBackupScheduleRequest name. - * @member {string} name - * @memberof google.spanner.admin.database.v1.GetBackupScheduleRequest - * @instance - */ - GetBackupScheduleRequest.prototype.name = ""; - - /** - * Creates a new GetBackupScheduleRequest instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.GetBackupScheduleRequest - * @static - * @param {google.spanner.admin.database.v1.IGetBackupScheduleRequest=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.GetBackupScheduleRequest} GetBackupScheduleRequest instance - */ - GetBackupScheduleRequest.create = function create(properties) { - return new GetBackupScheduleRequest(properties); - }; - - /** - * Encodes the specified GetBackupScheduleRequest message. Does not implicitly {@link google.spanner.admin.database.v1.GetBackupScheduleRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.GetBackupScheduleRequest - * @static - * @param {google.spanner.admin.database.v1.IGetBackupScheduleRequest} message GetBackupScheduleRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetBackupScheduleRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; - - /** - * Encodes the specified GetBackupScheduleRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.GetBackupScheduleRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.GetBackupScheduleRequest - * @static - * @param {google.spanner.admin.database.v1.IGetBackupScheduleRequest} message GetBackupScheduleRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetBackupScheduleRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetBackupScheduleRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.GetBackupScheduleRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.GetBackupScheduleRequest} GetBackupScheduleRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetBackupScheduleRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.GetBackupScheduleRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetBackupScheduleRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.GetBackupScheduleRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.GetBackupScheduleRequest} GetBackupScheduleRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetBackupScheduleRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetBackupScheduleRequest message. - * @function verify - * @memberof google.spanner.admin.database.v1.GetBackupScheduleRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetBackupScheduleRequest.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 GetBackupScheduleRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.GetBackupScheduleRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.GetBackupScheduleRequest} GetBackupScheduleRequest - */ - GetBackupScheduleRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.GetBackupScheduleRequest) - return object; - var message = new $root.google.spanner.admin.database.v1.GetBackupScheduleRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetBackupScheduleRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.GetBackupScheduleRequest - * @static - * @param {google.spanner.admin.database.v1.GetBackupScheduleRequest} message GetBackupScheduleRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetBackupScheduleRequest.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 GetBackupScheduleRequest to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.GetBackupScheduleRequest - * @instance - * @returns {Object.} JSON object - */ - GetBackupScheduleRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetBackupScheduleRequest - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.GetBackupScheduleRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetBackupScheduleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.GetBackupScheduleRequest"; - }; - - return GetBackupScheduleRequest; - })(); - - v1.DeleteBackupScheduleRequest = (function() { - - /** - * Properties of a DeleteBackupScheduleRequest. - * @memberof google.spanner.admin.database.v1 - * @interface IDeleteBackupScheduleRequest - * @property {string|null} [name] DeleteBackupScheduleRequest name - */ - - /** - * Constructs a new DeleteBackupScheduleRequest. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents a DeleteBackupScheduleRequest. - * @implements IDeleteBackupScheduleRequest - * @constructor - * @param {google.spanner.admin.database.v1.IDeleteBackupScheduleRequest=} [properties] Properties to set - */ - function DeleteBackupScheduleRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteBackupScheduleRequest name. - * @member {string} name - * @memberof google.spanner.admin.database.v1.DeleteBackupScheduleRequest - * @instance - */ - DeleteBackupScheduleRequest.prototype.name = ""; - - /** - * Creates a new DeleteBackupScheduleRequest instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.DeleteBackupScheduleRequest - * @static - * @param {google.spanner.admin.database.v1.IDeleteBackupScheduleRequest=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.DeleteBackupScheduleRequest} DeleteBackupScheduleRequest instance - */ - DeleteBackupScheduleRequest.create = function create(properties) { - return new DeleteBackupScheduleRequest(properties); - }; - - /** - * Encodes the specified DeleteBackupScheduleRequest message. Does not implicitly {@link google.spanner.admin.database.v1.DeleteBackupScheduleRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.DeleteBackupScheduleRequest - * @static - * @param {google.spanner.admin.database.v1.IDeleteBackupScheduleRequest} message DeleteBackupScheduleRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteBackupScheduleRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; - - /** - * Encodes the specified DeleteBackupScheduleRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.DeleteBackupScheduleRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.DeleteBackupScheduleRequest - * @static - * @param {google.spanner.admin.database.v1.IDeleteBackupScheduleRequest} message DeleteBackupScheduleRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteBackupScheduleRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteBackupScheduleRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.DeleteBackupScheduleRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.DeleteBackupScheduleRequest} DeleteBackupScheduleRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteBackupScheduleRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.DeleteBackupScheduleRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteBackupScheduleRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.DeleteBackupScheduleRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.DeleteBackupScheduleRequest} DeleteBackupScheduleRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteBackupScheduleRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteBackupScheduleRequest message. - * @function verify - * @memberof google.spanner.admin.database.v1.DeleteBackupScheduleRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteBackupScheduleRequest.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 DeleteBackupScheduleRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.DeleteBackupScheduleRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.DeleteBackupScheduleRequest} DeleteBackupScheduleRequest - */ - DeleteBackupScheduleRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.DeleteBackupScheduleRequest) - return object; - var message = new $root.google.spanner.admin.database.v1.DeleteBackupScheduleRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a DeleteBackupScheduleRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.DeleteBackupScheduleRequest - * @static - * @param {google.spanner.admin.database.v1.DeleteBackupScheduleRequest} message DeleteBackupScheduleRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteBackupScheduleRequest.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 DeleteBackupScheduleRequest to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.DeleteBackupScheduleRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteBackupScheduleRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteBackupScheduleRequest - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.DeleteBackupScheduleRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteBackupScheduleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.DeleteBackupScheduleRequest"; - }; - - return DeleteBackupScheduleRequest; - })(); - - v1.ListBackupSchedulesRequest = (function() { - - /** - * Properties of a ListBackupSchedulesRequest. - * @memberof google.spanner.admin.database.v1 - * @interface IListBackupSchedulesRequest - * @property {string|null} [parent] ListBackupSchedulesRequest parent - * @property {number|null} [pageSize] ListBackupSchedulesRequest pageSize - * @property {string|null} [pageToken] ListBackupSchedulesRequest pageToken - */ - - /** - * Constructs a new ListBackupSchedulesRequest. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents a ListBackupSchedulesRequest. - * @implements IListBackupSchedulesRequest - * @constructor - * @param {google.spanner.admin.database.v1.IListBackupSchedulesRequest=} [properties] Properties to set - */ - function ListBackupSchedulesRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListBackupSchedulesRequest parent. - * @member {string} parent - * @memberof google.spanner.admin.database.v1.ListBackupSchedulesRequest - * @instance - */ - ListBackupSchedulesRequest.prototype.parent = ""; - - /** - * ListBackupSchedulesRequest pageSize. - * @member {number} pageSize - * @memberof google.spanner.admin.database.v1.ListBackupSchedulesRequest - * @instance - */ - ListBackupSchedulesRequest.prototype.pageSize = 0; - - /** - * ListBackupSchedulesRequest pageToken. - * @member {string} pageToken - * @memberof google.spanner.admin.database.v1.ListBackupSchedulesRequest - * @instance - */ - ListBackupSchedulesRequest.prototype.pageToken = ""; - - /** - * Creates a new ListBackupSchedulesRequest instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.ListBackupSchedulesRequest - * @static - * @param {google.spanner.admin.database.v1.IListBackupSchedulesRequest=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.ListBackupSchedulesRequest} ListBackupSchedulesRequest instance - */ - ListBackupSchedulesRequest.create = function create(properties) { - return new ListBackupSchedulesRequest(properties); - }; - - /** - * Encodes the specified ListBackupSchedulesRequest message. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupSchedulesRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.ListBackupSchedulesRequest - * @static - * @param {google.spanner.admin.database.v1.IListBackupSchedulesRequest} message ListBackupSchedulesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListBackupSchedulesRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); - return writer; - }; - - /** - * Encodes the specified ListBackupSchedulesRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupSchedulesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.ListBackupSchedulesRequest - * @static - * @param {google.spanner.admin.database.v1.IListBackupSchedulesRequest} message ListBackupSchedulesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListBackupSchedulesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListBackupSchedulesRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.ListBackupSchedulesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.ListBackupSchedulesRequest} ListBackupSchedulesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListBackupSchedulesRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.ListBackupSchedulesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 4: { - message.pageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListBackupSchedulesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.ListBackupSchedulesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.ListBackupSchedulesRequest} ListBackupSchedulesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListBackupSchedulesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListBackupSchedulesRequest message. - * @function verify - * @memberof google.spanner.admin.database.v1.ListBackupSchedulesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListBackupSchedulesRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - return null; - }; - - /** - * Creates a ListBackupSchedulesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.ListBackupSchedulesRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.ListBackupSchedulesRequest} ListBackupSchedulesRequest - */ - ListBackupSchedulesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.ListBackupSchedulesRequest) - return object; - var message = new $root.google.spanner.admin.database.v1.ListBackupSchedulesRequest(); - 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 ListBackupSchedulesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.ListBackupSchedulesRequest - * @static - * @param {google.spanner.admin.database.v1.ListBackupSchedulesRequest} message ListBackupSchedulesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListBackupSchedulesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - return object; - }; - - /** - * Converts this ListBackupSchedulesRequest to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.ListBackupSchedulesRequest - * @instance - * @returns {Object.} JSON object - */ - ListBackupSchedulesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListBackupSchedulesRequest - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.ListBackupSchedulesRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListBackupSchedulesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.ListBackupSchedulesRequest"; - }; - - return ListBackupSchedulesRequest; - })(); - - v1.ListBackupSchedulesResponse = (function() { - - /** - * Properties of a ListBackupSchedulesResponse. - * @memberof google.spanner.admin.database.v1 - * @interface IListBackupSchedulesResponse - * @property {Array.|null} [backupSchedules] ListBackupSchedulesResponse backupSchedules - * @property {string|null} [nextPageToken] ListBackupSchedulesResponse nextPageToken - */ - - /** - * Constructs a new ListBackupSchedulesResponse. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents a ListBackupSchedulesResponse. - * @implements IListBackupSchedulesResponse - * @constructor - * @param {google.spanner.admin.database.v1.IListBackupSchedulesResponse=} [properties] Properties to set - */ - function ListBackupSchedulesResponse(properties) { - this.backupSchedules = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListBackupSchedulesResponse backupSchedules. - * @member {Array.} backupSchedules - * @memberof google.spanner.admin.database.v1.ListBackupSchedulesResponse - * @instance - */ - ListBackupSchedulesResponse.prototype.backupSchedules = $util.emptyArray; - - /** - * ListBackupSchedulesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.spanner.admin.database.v1.ListBackupSchedulesResponse - * @instance - */ - ListBackupSchedulesResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListBackupSchedulesResponse instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.ListBackupSchedulesResponse - * @static - * @param {google.spanner.admin.database.v1.IListBackupSchedulesResponse=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.ListBackupSchedulesResponse} ListBackupSchedulesResponse instance - */ - ListBackupSchedulesResponse.create = function create(properties) { - return new ListBackupSchedulesResponse(properties); - }; - - /** - * Encodes the specified ListBackupSchedulesResponse message. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupSchedulesResponse.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.ListBackupSchedulesResponse - * @static - * @param {google.spanner.admin.database.v1.IListBackupSchedulesResponse} message ListBackupSchedulesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListBackupSchedulesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.backupSchedules != null && message.backupSchedules.length) - for (var i = 0; i < message.backupSchedules.length; ++i) - $root.google.spanner.admin.database.v1.BackupSchedule.encode(message.backupSchedules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - return writer; - }; - - /** - * Encodes the specified ListBackupSchedulesResponse message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupSchedulesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.ListBackupSchedulesResponse - * @static - * @param {google.spanner.admin.database.v1.IListBackupSchedulesResponse} message ListBackupSchedulesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListBackupSchedulesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListBackupSchedulesResponse message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.ListBackupSchedulesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.ListBackupSchedulesResponse} ListBackupSchedulesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListBackupSchedulesResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.ListBackupSchedulesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.backupSchedules && message.backupSchedules.length)) - message.backupSchedules = []; - message.backupSchedules.push($root.google.spanner.admin.database.v1.BackupSchedule.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListBackupSchedulesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.ListBackupSchedulesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.ListBackupSchedulesResponse} ListBackupSchedulesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListBackupSchedulesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListBackupSchedulesResponse message. - * @function verify - * @memberof google.spanner.admin.database.v1.ListBackupSchedulesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListBackupSchedulesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.backupSchedules != null && message.hasOwnProperty("backupSchedules")) { - if (!Array.isArray(message.backupSchedules)) - return "backupSchedules: array expected"; - for (var i = 0; i < message.backupSchedules.length; ++i) { - var error = $root.google.spanner.admin.database.v1.BackupSchedule.verify(message.backupSchedules[i]); - if (error) - return "backupSchedules." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListBackupSchedulesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.ListBackupSchedulesResponse - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.ListBackupSchedulesResponse} ListBackupSchedulesResponse - */ - ListBackupSchedulesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.ListBackupSchedulesResponse) - return object; - var message = new $root.google.spanner.admin.database.v1.ListBackupSchedulesResponse(); - if (object.backupSchedules) { - if (!Array.isArray(object.backupSchedules)) - throw TypeError(".google.spanner.admin.database.v1.ListBackupSchedulesResponse.backupSchedules: array expected"); - message.backupSchedules = []; - for (var i = 0; i < object.backupSchedules.length; ++i) { - if (typeof object.backupSchedules[i] !== "object") - throw TypeError(".google.spanner.admin.database.v1.ListBackupSchedulesResponse.backupSchedules: object expected"); - message.backupSchedules[i] = $root.google.spanner.admin.database.v1.BackupSchedule.fromObject(object.backupSchedules[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListBackupSchedulesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.ListBackupSchedulesResponse - * @static - * @param {google.spanner.admin.database.v1.ListBackupSchedulesResponse} message ListBackupSchedulesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListBackupSchedulesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.backupSchedules = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.backupSchedules && message.backupSchedules.length) { - object.backupSchedules = []; - for (var j = 0; j < message.backupSchedules.length; ++j) - object.backupSchedules[j] = $root.google.spanner.admin.database.v1.BackupSchedule.toObject(message.backupSchedules[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListBackupSchedulesResponse to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.ListBackupSchedulesResponse - * @instance - * @returns {Object.} JSON object - */ - ListBackupSchedulesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListBackupSchedulesResponse - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.ListBackupSchedulesResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListBackupSchedulesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.ListBackupSchedulesResponse"; - }; - - return ListBackupSchedulesResponse; - })(); - - v1.UpdateBackupScheduleRequest = (function() { - - /** - * Properties of an UpdateBackupScheduleRequest. - * @memberof google.spanner.admin.database.v1 - * @interface IUpdateBackupScheduleRequest - * @property {google.spanner.admin.database.v1.IBackupSchedule|null} [backupSchedule] UpdateBackupScheduleRequest backupSchedule - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateBackupScheduleRequest updateMask - */ - - /** - * Constructs a new UpdateBackupScheduleRequest. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents an UpdateBackupScheduleRequest. - * @implements IUpdateBackupScheduleRequest - * @constructor - * @param {google.spanner.admin.database.v1.IUpdateBackupScheduleRequest=} [properties] Properties to set - */ - function UpdateBackupScheduleRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateBackupScheduleRequest backupSchedule. - * @member {google.spanner.admin.database.v1.IBackupSchedule|null|undefined} backupSchedule - * @memberof google.spanner.admin.database.v1.UpdateBackupScheduleRequest - * @instance - */ - UpdateBackupScheduleRequest.prototype.backupSchedule = null; - - /** - * UpdateBackupScheduleRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.spanner.admin.database.v1.UpdateBackupScheduleRequest - * @instance - */ - UpdateBackupScheduleRequest.prototype.updateMask = null; - - /** - * Creates a new UpdateBackupScheduleRequest instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.UpdateBackupScheduleRequest - * @static - * @param {google.spanner.admin.database.v1.IUpdateBackupScheduleRequest=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.UpdateBackupScheduleRequest} UpdateBackupScheduleRequest instance - */ - UpdateBackupScheduleRequest.create = function create(properties) { - return new UpdateBackupScheduleRequest(properties); - }; - - /** - * Encodes the specified UpdateBackupScheduleRequest message. Does not implicitly {@link google.spanner.admin.database.v1.UpdateBackupScheduleRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.UpdateBackupScheduleRequest - * @static - * @param {google.spanner.admin.database.v1.IUpdateBackupScheduleRequest} message UpdateBackupScheduleRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateBackupScheduleRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.backupSchedule != null && Object.hasOwnProperty.call(message, "backupSchedule")) - $root.google.spanner.admin.database.v1.BackupSchedule.encode(message.backupSchedule, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified UpdateBackupScheduleRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.UpdateBackupScheduleRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.UpdateBackupScheduleRequest - * @static - * @param {google.spanner.admin.database.v1.IUpdateBackupScheduleRequest} message UpdateBackupScheduleRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateBackupScheduleRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateBackupScheduleRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.UpdateBackupScheduleRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.UpdateBackupScheduleRequest} UpdateBackupScheduleRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateBackupScheduleRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.UpdateBackupScheduleRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.backupSchedule = $root.google.spanner.admin.database.v1.BackupSchedule.decode(reader, reader.uint32()); - break; - } - case 2: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateBackupScheduleRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.UpdateBackupScheduleRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.UpdateBackupScheduleRequest} UpdateBackupScheduleRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateBackupScheduleRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateBackupScheduleRequest message. - * @function verify - * @memberof google.spanner.admin.database.v1.UpdateBackupScheduleRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateBackupScheduleRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.backupSchedule != null && message.hasOwnProperty("backupSchedule")) { - var error = $root.google.spanner.admin.database.v1.BackupSchedule.verify(message.backupSchedule); - if (error) - return "backupSchedule." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - return null; - }; - - /** - * Creates an UpdateBackupScheduleRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.UpdateBackupScheduleRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.UpdateBackupScheduleRequest} UpdateBackupScheduleRequest - */ - UpdateBackupScheduleRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.UpdateBackupScheduleRequest) - return object; - var message = new $root.google.spanner.admin.database.v1.UpdateBackupScheduleRequest(); - if (object.backupSchedule != null) { - if (typeof object.backupSchedule !== "object") - throw TypeError(".google.spanner.admin.database.v1.UpdateBackupScheduleRequest.backupSchedule: object expected"); - message.backupSchedule = $root.google.spanner.admin.database.v1.BackupSchedule.fromObject(object.backupSchedule); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.spanner.admin.database.v1.UpdateBackupScheduleRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - return message; - }; - - /** - * Creates a plain object from an UpdateBackupScheduleRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.UpdateBackupScheduleRequest - * @static - * @param {google.spanner.admin.database.v1.UpdateBackupScheduleRequest} message UpdateBackupScheduleRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateBackupScheduleRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.backupSchedule = null; - object.updateMask = null; - } - if (message.backupSchedule != null && message.hasOwnProperty("backupSchedule")) - object.backupSchedule = $root.google.spanner.admin.database.v1.BackupSchedule.toObject(message.backupSchedule, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - return object; - }; - - /** - * Converts this UpdateBackupScheduleRequest to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.UpdateBackupScheduleRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateBackupScheduleRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateBackupScheduleRequest - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.UpdateBackupScheduleRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateBackupScheduleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.UpdateBackupScheduleRequest"; - }; - - return UpdateBackupScheduleRequest; - })(); - - v1.DatabaseAdmin = (function() { - - /** - * Constructs a new DatabaseAdmin service. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents a DatabaseAdmin - * @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 DatabaseAdmin(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (DatabaseAdmin.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = DatabaseAdmin; - - /** - * Creates new DatabaseAdmin service using the specified rpc implementation. - * @function create - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @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 {DatabaseAdmin} RPC service. Useful where requests and/or responses are streamed. - */ - DatabaseAdmin.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|listDatabases}. - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @typedef ListDatabasesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.spanner.admin.database.v1.ListDatabasesResponse} [response] ListDatabasesResponse - */ - - /** - * Calls ListDatabases. - * @function listDatabases - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.IListDatabasesRequest} request ListDatabasesRequest message or plain object - * @param {google.spanner.admin.database.v1.DatabaseAdmin.ListDatabasesCallback} callback Node-style callback called with the error, if any, and ListDatabasesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DatabaseAdmin.prototype.listDatabases = function listDatabases(request, callback) { - return this.rpcCall(listDatabases, $root.google.spanner.admin.database.v1.ListDatabasesRequest, $root.google.spanner.admin.database.v1.ListDatabasesResponse, request, callback); - }, "name", { value: "ListDatabases" }); - - /** - * Calls ListDatabases. - * @function listDatabases - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.IListDatabasesRequest} request ListDatabasesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|createDatabase}. - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @typedef CreateDatabaseCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls CreateDatabase. - * @function createDatabase - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.ICreateDatabaseRequest} request CreateDatabaseRequest message or plain object - * @param {google.spanner.admin.database.v1.DatabaseAdmin.CreateDatabaseCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DatabaseAdmin.prototype.createDatabase = function createDatabase(request, callback) { - return this.rpcCall(createDatabase, $root.google.spanner.admin.database.v1.CreateDatabaseRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "CreateDatabase" }); - - /** - * Calls CreateDatabase. - * @function createDatabase - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.ICreateDatabaseRequest} request CreateDatabaseRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|getDatabase}. - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @typedef GetDatabaseCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.spanner.admin.database.v1.Database} [response] Database - */ - - /** - * Calls GetDatabase. - * @function getDatabase - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.IGetDatabaseRequest} request GetDatabaseRequest message or plain object - * @param {google.spanner.admin.database.v1.DatabaseAdmin.GetDatabaseCallback} callback Node-style callback called with the error, if any, and Database - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DatabaseAdmin.prototype.getDatabase = function getDatabase(request, callback) { - return this.rpcCall(getDatabase, $root.google.spanner.admin.database.v1.GetDatabaseRequest, $root.google.spanner.admin.database.v1.Database, request, callback); - }, "name", { value: "GetDatabase" }); - - /** - * Calls GetDatabase. - * @function getDatabase - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.IGetDatabaseRequest} request GetDatabaseRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|updateDatabase}. - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @typedef UpdateDatabaseCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls UpdateDatabase. - * @function updateDatabase - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.IUpdateDatabaseRequest} request UpdateDatabaseRequest message or plain object - * @param {google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DatabaseAdmin.prototype.updateDatabase = function updateDatabase(request, callback) { - return this.rpcCall(updateDatabase, $root.google.spanner.admin.database.v1.UpdateDatabaseRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "UpdateDatabase" }); - - /** - * Calls UpdateDatabase. - * @function updateDatabase - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.IUpdateDatabaseRequest} request UpdateDatabaseRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|updateDatabaseDdl}. - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @typedef UpdateDatabaseDdlCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls UpdateDatabaseDdl. - * @function updateDatabaseDdl - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.IUpdateDatabaseDdlRequest} request UpdateDatabaseDdlRequest message or plain object - * @param {google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdlCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DatabaseAdmin.prototype.updateDatabaseDdl = function updateDatabaseDdl(request, callback) { - return this.rpcCall(updateDatabaseDdl, $root.google.spanner.admin.database.v1.UpdateDatabaseDdlRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "UpdateDatabaseDdl" }); - - /** - * Calls UpdateDatabaseDdl. - * @function updateDatabaseDdl - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.IUpdateDatabaseDdlRequest} request UpdateDatabaseDdlRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|dropDatabase}. - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @typedef DropDatabaseCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DropDatabase. - * @function dropDatabase - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.IDropDatabaseRequest} request DropDatabaseRequest message or plain object - * @param {google.spanner.admin.database.v1.DatabaseAdmin.DropDatabaseCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DatabaseAdmin.prototype.dropDatabase = function dropDatabase(request, callback) { - return this.rpcCall(dropDatabase, $root.google.spanner.admin.database.v1.DropDatabaseRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DropDatabase" }); - - /** - * Calls DropDatabase. - * @function dropDatabase - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.IDropDatabaseRequest} request DropDatabaseRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|getDatabaseDdl}. - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @typedef GetDatabaseDdlCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.spanner.admin.database.v1.GetDatabaseDdlResponse} [response] GetDatabaseDdlResponse - */ - - /** - * Calls GetDatabaseDdl. - * @function getDatabaseDdl - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.IGetDatabaseDdlRequest} request GetDatabaseDdlRequest message or plain object - * @param {google.spanner.admin.database.v1.DatabaseAdmin.GetDatabaseDdlCallback} callback Node-style callback called with the error, if any, and GetDatabaseDdlResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DatabaseAdmin.prototype.getDatabaseDdl = function getDatabaseDdl(request, callback) { - return this.rpcCall(getDatabaseDdl, $root.google.spanner.admin.database.v1.GetDatabaseDdlRequest, $root.google.spanner.admin.database.v1.GetDatabaseDdlResponse, request, callback); - }, "name", { value: "GetDatabaseDdl" }); - - /** - * Calls GetDatabaseDdl. - * @function getDatabaseDdl - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.IGetDatabaseDdlRequest} request GetDatabaseDdlRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|setIamPolicy}. - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @typedef SetIamPolicyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.iam.v1.Policy} [response] Policy - */ - - /** - * Calls SetIamPolicy. - * @function setIamPolicy - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object - * @param {google.spanner.admin.database.v1.DatabaseAdmin.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DatabaseAdmin.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.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|getIamPolicy}. - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @typedef GetIamPolicyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.iam.v1.Policy} [response] Policy - */ - - /** - * Calls GetIamPolicy. - * @function getIamPolicy - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object - * @param {google.spanner.admin.database.v1.DatabaseAdmin.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DatabaseAdmin.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.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|testIamPermissions}. - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @typedef TestIamPermissionsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.iam.v1.TestIamPermissionsResponse} [response] TestIamPermissionsResponse - */ - - /** - * Calls TestIamPermissions. - * @function testIamPermissions - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object - * @param {google.spanner.admin.database.v1.DatabaseAdmin.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestIamPermissionsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DatabaseAdmin.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.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|createBackup}. - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @typedef CreateBackupCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls CreateBackup. - * @function createBackup - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.ICreateBackupRequest} request CreateBackupRequest message or plain object - * @param {google.spanner.admin.database.v1.DatabaseAdmin.CreateBackupCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DatabaseAdmin.prototype.createBackup = function createBackup(request, callback) { - return this.rpcCall(createBackup, $root.google.spanner.admin.database.v1.CreateBackupRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "CreateBackup" }); - - /** - * Calls CreateBackup. - * @function createBackup - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.ICreateBackupRequest} request CreateBackupRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|copyBackup}. - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @typedef CopyBackupCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls CopyBackup. - * @function copyBackup - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.ICopyBackupRequest} request CopyBackupRequest message or plain object - * @param {google.spanner.admin.database.v1.DatabaseAdmin.CopyBackupCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DatabaseAdmin.prototype.copyBackup = function copyBackup(request, callback) { - return this.rpcCall(copyBackup, $root.google.spanner.admin.database.v1.CopyBackupRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "CopyBackup" }); - - /** - * Calls CopyBackup. - * @function copyBackup - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.ICopyBackupRequest} request CopyBackupRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|getBackup}. - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @typedef GetBackupCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.spanner.admin.database.v1.Backup} [response] Backup - */ - - /** - * Calls GetBackup. - * @function getBackup - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.IGetBackupRequest} request GetBackupRequest message or plain object - * @param {google.spanner.admin.database.v1.DatabaseAdmin.GetBackupCallback} callback Node-style callback called with the error, if any, and Backup - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DatabaseAdmin.prototype.getBackup = function getBackup(request, callback) { - return this.rpcCall(getBackup, $root.google.spanner.admin.database.v1.GetBackupRequest, $root.google.spanner.admin.database.v1.Backup, request, callback); - }, "name", { value: "GetBackup" }); - - /** - * Calls GetBackup. - * @function getBackup - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.IGetBackupRequest} request GetBackupRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|updateBackup}. - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @typedef UpdateBackupCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.spanner.admin.database.v1.Backup} [response] Backup - */ - - /** - * Calls UpdateBackup. - * @function updateBackup - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.IUpdateBackupRequest} request UpdateBackupRequest message or plain object - * @param {google.spanner.admin.database.v1.DatabaseAdmin.UpdateBackupCallback} callback Node-style callback called with the error, if any, and Backup - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DatabaseAdmin.prototype.updateBackup = function updateBackup(request, callback) { - return this.rpcCall(updateBackup, $root.google.spanner.admin.database.v1.UpdateBackupRequest, $root.google.spanner.admin.database.v1.Backup, request, callback); - }, "name", { value: "UpdateBackup" }); - - /** - * Calls UpdateBackup. - * @function updateBackup - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.IUpdateBackupRequest} request UpdateBackupRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|deleteBackup}. - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @typedef DeleteBackupCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteBackup. - * @function deleteBackup - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.IDeleteBackupRequest} request DeleteBackupRequest message or plain object - * @param {google.spanner.admin.database.v1.DatabaseAdmin.DeleteBackupCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DatabaseAdmin.prototype.deleteBackup = function deleteBackup(request, callback) { - return this.rpcCall(deleteBackup, $root.google.spanner.admin.database.v1.DeleteBackupRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteBackup" }); - - /** - * Calls DeleteBackup. - * @function deleteBackup - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.IDeleteBackupRequest} request DeleteBackupRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|listBackups}. - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @typedef ListBackupsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.spanner.admin.database.v1.ListBackupsResponse} [response] ListBackupsResponse - */ - - /** - * Calls ListBackups. - * @function listBackups - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.IListBackupsRequest} request ListBackupsRequest message or plain object - * @param {google.spanner.admin.database.v1.DatabaseAdmin.ListBackupsCallback} callback Node-style callback called with the error, if any, and ListBackupsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DatabaseAdmin.prototype.listBackups = function listBackups(request, callback) { - return this.rpcCall(listBackups, $root.google.spanner.admin.database.v1.ListBackupsRequest, $root.google.spanner.admin.database.v1.ListBackupsResponse, request, callback); - }, "name", { value: "ListBackups" }); - - /** - * Calls ListBackups. - * @function listBackups - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.IListBackupsRequest} request ListBackupsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|restoreDatabase}. - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @typedef RestoreDatabaseCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls RestoreDatabase. - * @function restoreDatabase - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.IRestoreDatabaseRequest} request RestoreDatabaseRequest message or plain object - * @param {google.spanner.admin.database.v1.DatabaseAdmin.RestoreDatabaseCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DatabaseAdmin.prototype.restoreDatabase = function restoreDatabase(request, callback) { - return this.rpcCall(restoreDatabase, $root.google.spanner.admin.database.v1.RestoreDatabaseRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "RestoreDatabase" }); - - /** - * Calls RestoreDatabase. - * @function restoreDatabase - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.IRestoreDatabaseRequest} request RestoreDatabaseRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|listDatabaseOperations}. - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @typedef ListDatabaseOperationsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.spanner.admin.database.v1.ListDatabaseOperationsResponse} [response] ListDatabaseOperationsResponse - */ - - /** - * Calls ListDatabaseOperations. - * @function listDatabaseOperations - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.IListDatabaseOperationsRequest} request ListDatabaseOperationsRequest message or plain object - * @param {google.spanner.admin.database.v1.DatabaseAdmin.ListDatabaseOperationsCallback} callback Node-style callback called with the error, if any, and ListDatabaseOperationsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DatabaseAdmin.prototype.listDatabaseOperations = function listDatabaseOperations(request, callback) { - return this.rpcCall(listDatabaseOperations, $root.google.spanner.admin.database.v1.ListDatabaseOperationsRequest, $root.google.spanner.admin.database.v1.ListDatabaseOperationsResponse, request, callback); - }, "name", { value: "ListDatabaseOperations" }); - - /** - * Calls ListDatabaseOperations. - * @function listDatabaseOperations - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.IListDatabaseOperationsRequest} request ListDatabaseOperationsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|listBackupOperations}. - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @typedef ListBackupOperationsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.spanner.admin.database.v1.ListBackupOperationsResponse} [response] ListBackupOperationsResponse - */ - - /** - * Calls ListBackupOperations. - * @function listBackupOperations - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.IListBackupOperationsRequest} request ListBackupOperationsRequest message or plain object - * @param {google.spanner.admin.database.v1.DatabaseAdmin.ListBackupOperationsCallback} callback Node-style callback called with the error, if any, and ListBackupOperationsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DatabaseAdmin.prototype.listBackupOperations = function listBackupOperations(request, callback) { - return this.rpcCall(listBackupOperations, $root.google.spanner.admin.database.v1.ListBackupOperationsRequest, $root.google.spanner.admin.database.v1.ListBackupOperationsResponse, request, callback); - }, "name", { value: "ListBackupOperations" }); - - /** - * Calls ListBackupOperations. - * @function listBackupOperations - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.IListBackupOperationsRequest} request ListBackupOperationsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|listDatabaseRoles}. - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @typedef ListDatabaseRolesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.spanner.admin.database.v1.ListDatabaseRolesResponse} [response] ListDatabaseRolesResponse - */ - - /** - * Calls ListDatabaseRoles. - * @function listDatabaseRoles - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.IListDatabaseRolesRequest} request ListDatabaseRolesRequest message or plain object - * @param {google.spanner.admin.database.v1.DatabaseAdmin.ListDatabaseRolesCallback} callback Node-style callback called with the error, if any, and ListDatabaseRolesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DatabaseAdmin.prototype.listDatabaseRoles = function listDatabaseRoles(request, callback) { - return this.rpcCall(listDatabaseRoles, $root.google.spanner.admin.database.v1.ListDatabaseRolesRequest, $root.google.spanner.admin.database.v1.ListDatabaseRolesResponse, request, callback); - }, "name", { value: "ListDatabaseRoles" }); - - /** - * Calls ListDatabaseRoles. - * @function listDatabaseRoles - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.IListDatabaseRolesRequest} request ListDatabaseRolesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|addSplitPoints}. - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @typedef AddSplitPointsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.spanner.admin.database.v1.AddSplitPointsResponse} [response] AddSplitPointsResponse - */ - - /** - * Calls AddSplitPoints. - * @function addSplitPoints - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.IAddSplitPointsRequest} request AddSplitPointsRequest message or plain object - * @param {google.spanner.admin.database.v1.DatabaseAdmin.AddSplitPointsCallback} callback Node-style callback called with the error, if any, and AddSplitPointsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DatabaseAdmin.prototype.addSplitPoints = function addSplitPoints(request, callback) { - return this.rpcCall(addSplitPoints, $root.google.spanner.admin.database.v1.AddSplitPointsRequest, $root.google.spanner.admin.database.v1.AddSplitPointsResponse, request, callback); - }, "name", { value: "AddSplitPoints" }); - - /** - * Calls AddSplitPoints. - * @function addSplitPoints - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.IAddSplitPointsRequest} request AddSplitPointsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|createBackupSchedule}. - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @typedef CreateBackupScheduleCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.spanner.admin.database.v1.BackupSchedule} [response] BackupSchedule - */ - - /** - * Calls CreateBackupSchedule. - * @function createBackupSchedule - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.ICreateBackupScheduleRequest} request CreateBackupScheduleRequest message or plain object - * @param {google.spanner.admin.database.v1.DatabaseAdmin.CreateBackupScheduleCallback} callback Node-style callback called with the error, if any, and BackupSchedule - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DatabaseAdmin.prototype.createBackupSchedule = function createBackupSchedule(request, callback) { - return this.rpcCall(createBackupSchedule, $root.google.spanner.admin.database.v1.CreateBackupScheduleRequest, $root.google.spanner.admin.database.v1.BackupSchedule, request, callback); - }, "name", { value: "CreateBackupSchedule" }); - - /** - * Calls CreateBackupSchedule. - * @function createBackupSchedule - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.ICreateBackupScheduleRequest} request CreateBackupScheduleRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|getBackupSchedule}. - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @typedef GetBackupScheduleCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.spanner.admin.database.v1.BackupSchedule} [response] BackupSchedule - */ - - /** - * Calls GetBackupSchedule. - * @function getBackupSchedule - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.IGetBackupScheduleRequest} request GetBackupScheduleRequest message or plain object - * @param {google.spanner.admin.database.v1.DatabaseAdmin.GetBackupScheduleCallback} callback Node-style callback called with the error, if any, and BackupSchedule - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DatabaseAdmin.prototype.getBackupSchedule = function getBackupSchedule(request, callback) { - return this.rpcCall(getBackupSchedule, $root.google.spanner.admin.database.v1.GetBackupScheduleRequest, $root.google.spanner.admin.database.v1.BackupSchedule, request, callback); - }, "name", { value: "GetBackupSchedule" }); - - /** - * Calls GetBackupSchedule. - * @function getBackupSchedule - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.IGetBackupScheduleRequest} request GetBackupScheduleRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|updateBackupSchedule}. - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @typedef UpdateBackupScheduleCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.spanner.admin.database.v1.BackupSchedule} [response] BackupSchedule - */ - - /** - * Calls UpdateBackupSchedule. - * @function updateBackupSchedule - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.IUpdateBackupScheduleRequest} request UpdateBackupScheduleRequest message or plain object - * @param {google.spanner.admin.database.v1.DatabaseAdmin.UpdateBackupScheduleCallback} callback Node-style callback called with the error, if any, and BackupSchedule - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DatabaseAdmin.prototype.updateBackupSchedule = function updateBackupSchedule(request, callback) { - return this.rpcCall(updateBackupSchedule, $root.google.spanner.admin.database.v1.UpdateBackupScheduleRequest, $root.google.spanner.admin.database.v1.BackupSchedule, request, callback); - }, "name", { value: "UpdateBackupSchedule" }); - - /** - * Calls UpdateBackupSchedule. - * @function updateBackupSchedule - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.IUpdateBackupScheduleRequest} request UpdateBackupScheduleRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|deleteBackupSchedule}. - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @typedef DeleteBackupScheduleCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteBackupSchedule. - * @function deleteBackupSchedule - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.IDeleteBackupScheduleRequest} request DeleteBackupScheduleRequest message or plain object - * @param {google.spanner.admin.database.v1.DatabaseAdmin.DeleteBackupScheduleCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DatabaseAdmin.prototype.deleteBackupSchedule = function deleteBackupSchedule(request, callback) { - return this.rpcCall(deleteBackupSchedule, $root.google.spanner.admin.database.v1.DeleteBackupScheduleRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteBackupSchedule" }); - - /** - * Calls DeleteBackupSchedule. - * @function deleteBackupSchedule - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.IDeleteBackupScheduleRequest} request DeleteBackupScheduleRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|listBackupSchedules}. - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @typedef ListBackupSchedulesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.spanner.admin.database.v1.ListBackupSchedulesResponse} [response] ListBackupSchedulesResponse - */ - - /** - * Calls ListBackupSchedules. - * @function listBackupSchedules - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.IListBackupSchedulesRequest} request ListBackupSchedulesRequest message or plain object - * @param {google.spanner.admin.database.v1.DatabaseAdmin.ListBackupSchedulesCallback} callback Node-style callback called with the error, if any, and ListBackupSchedulesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DatabaseAdmin.prototype.listBackupSchedules = function listBackupSchedules(request, callback) { - return this.rpcCall(listBackupSchedules, $root.google.spanner.admin.database.v1.ListBackupSchedulesRequest, $root.google.spanner.admin.database.v1.ListBackupSchedulesResponse, request, callback); - }, "name", { value: "ListBackupSchedules" }); - - /** - * Calls ListBackupSchedules. - * @function listBackupSchedules - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.IListBackupSchedulesRequest} request ListBackupSchedulesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|internalUpdateGraphOperation}. - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @typedef InternalUpdateGraphOperationCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse} [response] InternalUpdateGraphOperationResponse - */ - - /** - * Calls InternalUpdateGraphOperation. - * @function internalUpdateGraphOperation - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.IInternalUpdateGraphOperationRequest} request InternalUpdateGraphOperationRequest message or plain object - * @param {google.spanner.admin.database.v1.DatabaseAdmin.InternalUpdateGraphOperationCallback} callback Node-style callback called with the error, if any, and InternalUpdateGraphOperationResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DatabaseAdmin.prototype.internalUpdateGraphOperation = function internalUpdateGraphOperation(request, callback) { - return this.rpcCall(internalUpdateGraphOperation, $root.google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest, $root.google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse, request, callback); - }, "name", { value: "InternalUpdateGraphOperation" }); - - /** - * Calls InternalUpdateGraphOperation. - * @function internalUpdateGraphOperation - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.IInternalUpdateGraphOperationRequest} request InternalUpdateGraphOperationRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return DatabaseAdmin; - })(); - - v1.RestoreInfo = (function() { - - /** - * Properties of a RestoreInfo. - * @memberof google.spanner.admin.database.v1 - * @interface IRestoreInfo - * @property {google.spanner.admin.database.v1.RestoreSourceType|null} [sourceType] RestoreInfo sourceType - * @property {google.spanner.admin.database.v1.IBackupInfo|null} [backupInfo] RestoreInfo backupInfo - */ - - /** - * Constructs a new RestoreInfo. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents a RestoreInfo. - * @implements IRestoreInfo - * @constructor - * @param {google.spanner.admin.database.v1.IRestoreInfo=} [properties] Properties to set - */ - function RestoreInfo(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RestoreInfo sourceType. - * @member {google.spanner.admin.database.v1.RestoreSourceType} sourceType - * @memberof google.spanner.admin.database.v1.RestoreInfo - * @instance - */ - RestoreInfo.prototype.sourceType = 0; - - /** - * RestoreInfo backupInfo. - * @member {google.spanner.admin.database.v1.IBackupInfo|null|undefined} backupInfo - * @memberof google.spanner.admin.database.v1.RestoreInfo - * @instance - */ - RestoreInfo.prototype.backupInfo = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * RestoreInfo sourceInfo. - * @member {"backupInfo"|undefined} sourceInfo - * @memberof google.spanner.admin.database.v1.RestoreInfo - * @instance - */ - Object.defineProperty(RestoreInfo.prototype, "sourceInfo", { - get: $util.oneOfGetter($oneOfFields = ["backupInfo"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new RestoreInfo instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.RestoreInfo - * @static - * @param {google.spanner.admin.database.v1.IRestoreInfo=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.RestoreInfo} RestoreInfo instance - */ - RestoreInfo.create = function create(properties) { - return new RestoreInfo(properties); - }; - - /** - * Encodes the specified RestoreInfo message. Does not implicitly {@link google.spanner.admin.database.v1.RestoreInfo.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.RestoreInfo - * @static - * @param {google.spanner.admin.database.v1.IRestoreInfo} message RestoreInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RestoreInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.sourceType != null && Object.hasOwnProperty.call(message, "sourceType")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.sourceType); - if (message.backupInfo != null && Object.hasOwnProperty.call(message, "backupInfo")) - $root.google.spanner.admin.database.v1.BackupInfo.encode(message.backupInfo, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified RestoreInfo message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.RestoreInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.RestoreInfo - * @static - * @param {google.spanner.admin.database.v1.IRestoreInfo} message RestoreInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RestoreInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RestoreInfo message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.RestoreInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.RestoreInfo} RestoreInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RestoreInfo.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.RestoreInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.sourceType = reader.int32(); - break; - } - case 2: { - message.backupInfo = $root.google.spanner.admin.database.v1.BackupInfo.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RestoreInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.RestoreInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.RestoreInfo} RestoreInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RestoreInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RestoreInfo message. - * @function verify - * @memberof google.spanner.admin.database.v1.RestoreInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RestoreInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.sourceType != null && message.hasOwnProperty("sourceType")) - switch (message.sourceType) { - default: - return "sourceType: enum value expected"; - case 0: - case 1: - break; - } - if (message.backupInfo != null && message.hasOwnProperty("backupInfo")) { - properties.sourceInfo = 1; - { - var error = $root.google.spanner.admin.database.v1.BackupInfo.verify(message.backupInfo); - if (error) - return "backupInfo." + error; - } - } - return null; - }; - - /** - * Creates a RestoreInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.RestoreInfo - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.RestoreInfo} RestoreInfo - */ - RestoreInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.RestoreInfo) - return object; - var message = new $root.google.spanner.admin.database.v1.RestoreInfo(); - switch (object.sourceType) { - default: - if (typeof object.sourceType === "number") { - message.sourceType = object.sourceType; - break; - } - break; - case "TYPE_UNSPECIFIED": - case 0: - message.sourceType = 0; - break; - case "BACKUP": - case 1: - message.sourceType = 1; - break; - } - if (object.backupInfo != null) { - if (typeof object.backupInfo !== "object") - throw TypeError(".google.spanner.admin.database.v1.RestoreInfo.backupInfo: object expected"); - message.backupInfo = $root.google.spanner.admin.database.v1.BackupInfo.fromObject(object.backupInfo); - } - return message; - }; - - /** - * Creates a plain object from a RestoreInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.RestoreInfo - * @static - * @param {google.spanner.admin.database.v1.RestoreInfo} message RestoreInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RestoreInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.sourceType = options.enums === String ? "TYPE_UNSPECIFIED" : 0; - if (message.sourceType != null && message.hasOwnProperty("sourceType")) - object.sourceType = options.enums === String ? $root.google.spanner.admin.database.v1.RestoreSourceType[message.sourceType] === undefined ? message.sourceType : $root.google.spanner.admin.database.v1.RestoreSourceType[message.sourceType] : message.sourceType; - if (message.backupInfo != null && message.hasOwnProperty("backupInfo")) { - object.backupInfo = $root.google.spanner.admin.database.v1.BackupInfo.toObject(message.backupInfo, options); - if (options.oneofs) - object.sourceInfo = "backupInfo"; - } - return object; - }; - - /** - * Converts this RestoreInfo to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.RestoreInfo - * @instance - * @returns {Object.} JSON object - */ - RestoreInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RestoreInfo - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.RestoreInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RestoreInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.RestoreInfo"; - }; - - return RestoreInfo; - })(); - - v1.Database = (function() { - - /** - * Properties of a Database. - * @memberof google.spanner.admin.database.v1 - * @interface IDatabase - * @property {string|null} [name] Database name - * @property {google.spanner.admin.database.v1.Database.State|null} [state] Database state - * @property {google.protobuf.ITimestamp|null} [createTime] Database createTime - * @property {google.spanner.admin.database.v1.IRestoreInfo|null} [restoreInfo] Database restoreInfo - * @property {google.spanner.admin.database.v1.IEncryptionConfig|null} [encryptionConfig] Database encryptionConfig - * @property {Array.|null} [encryptionInfo] Database encryptionInfo - * @property {string|null} [versionRetentionPeriod] Database versionRetentionPeriod - * @property {google.protobuf.ITimestamp|null} [earliestVersionTime] Database earliestVersionTime - * @property {string|null} [defaultLeader] Database defaultLeader - * @property {google.spanner.admin.database.v1.DatabaseDialect|null} [databaseDialect] Database databaseDialect - * @property {boolean|null} [enableDropProtection] Database enableDropProtection - * @property {boolean|null} [reconciling] Database reconciling - */ - - /** - * Constructs a new Database. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents a Database. - * @implements IDatabase - * @constructor - * @param {google.spanner.admin.database.v1.IDatabase=} [properties] Properties to set - */ - function Database(properties) { - this.encryptionInfo = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Database name. - * @member {string} name - * @memberof google.spanner.admin.database.v1.Database - * @instance - */ - Database.prototype.name = ""; - - /** - * Database state. - * @member {google.spanner.admin.database.v1.Database.State} state - * @memberof google.spanner.admin.database.v1.Database - * @instance - */ - Database.prototype.state = 0; - - /** - * Database createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.spanner.admin.database.v1.Database - * @instance - */ - Database.prototype.createTime = null; - - /** - * Database restoreInfo. - * @member {google.spanner.admin.database.v1.IRestoreInfo|null|undefined} restoreInfo - * @memberof google.spanner.admin.database.v1.Database - * @instance - */ - Database.prototype.restoreInfo = null; - - /** - * Database encryptionConfig. - * @member {google.spanner.admin.database.v1.IEncryptionConfig|null|undefined} encryptionConfig - * @memberof google.spanner.admin.database.v1.Database - * @instance - */ - Database.prototype.encryptionConfig = null; - - /** - * Database encryptionInfo. - * @member {Array.} encryptionInfo - * @memberof google.spanner.admin.database.v1.Database - * @instance - */ - Database.prototype.encryptionInfo = $util.emptyArray; - - /** - * Database versionRetentionPeriod. - * @member {string} versionRetentionPeriod - * @memberof google.spanner.admin.database.v1.Database - * @instance - */ - Database.prototype.versionRetentionPeriod = ""; - - /** - * Database earliestVersionTime. - * @member {google.protobuf.ITimestamp|null|undefined} earliestVersionTime - * @memberof google.spanner.admin.database.v1.Database - * @instance - */ - Database.prototype.earliestVersionTime = null; - - /** - * Database defaultLeader. - * @member {string} defaultLeader - * @memberof google.spanner.admin.database.v1.Database - * @instance - */ - Database.prototype.defaultLeader = ""; - - /** - * Database databaseDialect. - * @member {google.spanner.admin.database.v1.DatabaseDialect} databaseDialect - * @memberof google.spanner.admin.database.v1.Database - * @instance - */ - Database.prototype.databaseDialect = 0; - - /** - * Database enableDropProtection. - * @member {boolean} enableDropProtection - * @memberof google.spanner.admin.database.v1.Database - * @instance - */ - Database.prototype.enableDropProtection = false; - - /** - * Database reconciling. - * @member {boolean} reconciling - * @memberof google.spanner.admin.database.v1.Database - * @instance - */ - Database.prototype.reconciling = false; - - /** - * Creates a new Database instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.Database - * @static - * @param {google.spanner.admin.database.v1.IDatabase=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.Database} Database instance - */ - Database.create = function create(properties) { - return new Database(properties); - }; - - /** - * Encodes the specified Database message. Does not implicitly {@link google.spanner.admin.database.v1.Database.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.Database - * @static - * @param {google.spanner.admin.database.v1.IDatabase} message Database message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Database.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.restoreInfo != null && Object.hasOwnProperty.call(message, "restoreInfo")) - $root.google.spanner.admin.database.v1.RestoreInfo.encode(message.restoreInfo, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) - $root.google.spanner.admin.database.v1.EncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.versionRetentionPeriod != null && Object.hasOwnProperty.call(message, "versionRetentionPeriod")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.versionRetentionPeriod); - if (message.earliestVersionTime != null && Object.hasOwnProperty.call(message, "earliestVersionTime")) - $root.google.protobuf.Timestamp.encode(message.earliestVersionTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.encryptionInfo != null && message.encryptionInfo.length) - for (var i = 0; i < message.encryptionInfo.length; ++i) - $root.google.spanner.admin.database.v1.EncryptionInfo.encode(message.encryptionInfo[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.defaultLeader != null && Object.hasOwnProperty.call(message, "defaultLeader")) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.defaultLeader); - if (message.databaseDialect != null && Object.hasOwnProperty.call(message, "databaseDialect")) - writer.uint32(/* id 10, wireType 0 =*/80).int32(message.databaseDialect); - if (message.enableDropProtection != null && Object.hasOwnProperty.call(message, "enableDropProtection")) - writer.uint32(/* id 11, wireType 0 =*/88).bool(message.enableDropProtection); - if (message.reconciling != null && Object.hasOwnProperty.call(message, "reconciling")) - writer.uint32(/* id 12, wireType 0 =*/96).bool(message.reconciling); - return writer; - }; - - /** - * Encodes the specified Database message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.Database.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.Database - * @static - * @param {google.spanner.admin.database.v1.IDatabase} message Database message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Database.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Database message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.Database - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.Database} Database - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Database.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.Database(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.state = reader.int32(); - break; - } - case 3: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 4: { - message.restoreInfo = $root.google.spanner.admin.database.v1.RestoreInfo.decode(reader, reader.uint32()); - break; - } - case 5: { - message.encryptionConfig = $root.google.spanner.admin.database.v1.EncryptionConfig.decode(reader, reader.uint32()); - break; - } - case 8: { - if (!(message.encryptionInfo && message.encryptionInfo.length)) - message.encryptionInfo = []; - message.encryptionInfo.push($root.google.spanner.admin.database.v1.EncryptionInfo.decode(reader, reader.uint32())); - break; - } - case 6: { - message.versionRetentionPeriod = reader.string(); - break; - } - case 7: { - message.earliestVersionTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 9: { - message.defaultLeader = reader.string(); - break; - } - case 10: { - message.databaseDialect = reader.int32(); - break; - } - case 11: { - message.enableDropProtection = reader.bool(); - break; - } - case 12: { - message.reconciling = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Database message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.Database - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.Database} Database - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Database.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Database message. - * @function verify - * @memberof google.spanner.admin.database.v1.Database - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Database.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.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.restoreInfo != null && message.hasOwnProperty("restoreInfo")) { - var error = $root.google.spanner.admin.database.v1.RestoreInfo.verify(message.restoreInfo); - if (error) - return "restoreInfo." + error; - } - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { - var error = $root.google.spanner.admin.database.v1.EncryptionConfig.verify(message.encryptionConfig); - if (error) - return "encryptionConfig." + error; - } - if (message.encryptionInfo != null && message.hasOwnProperty("encryptionInfo")) { - if (!Array.isArray(message.encryptionInfo)) - return "encryptionInfo: array expected"; - for (var i = 0; i < message.encryptionInfo.length; ++i) { - var error = $root.google.spanner.admin.database.v1.EncryptionInfo.verify(message.encryptionInfo[i]); - if (error) - return "encryptionInfo." + error; - } - } - if (message.versionRetentionPeriod != null && message.hasOwnProperty("versionRetentionPeriod")) - if (!$util.isString(message.versionRetentionPeriod)) - return "versionRetentionPeriod: string expected"; - if (message.earliestVersionTime != null && message.hasOwnProperty("earliestVersionTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.earliestVersionTime); - if (error) - return "earliestVersionTime." + error; - } - if (message.defaultLeader != null && message.hasOwnProperty("defaultLeader")) - if (!$util.isString(message.defaultLeader)) - return "defaultLeader: string expected"; - if (message.databaseDialect != null && message.hasOwnProperty("databaseDialect")) - switch (message.databaseDialect) { - default: - return "databaseDialect: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.enableDropProtection != null && message.hasOwnProperty("enableDropProtection")) - if (typeof message.enableDropProtection !== "boolean") - return "enableDropProtection: boolean expected"; - if (message.reconciling != null && message.hasOwnProperty("reconciling")) - if (typeof message.reconciling !== "boolean") - return "reconciling: boolean expected"; - return null; - }; - - /** - * Creates a Database message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.Database - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.Database} Database - */ - Database.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.Database) - return object; - var message = new $root.google.spanner.admin.database.v1.Database(); - if (object.name != null) - message.name = String(object.name); - switch (object.state) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "CREATING": - case 1: - message.state = 1; - break; - case "READY": - case 2: - message.state = 2; - break; - case "READY_OPTIMIZING": - case 3: - message.state = 3; - break; - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.spanner.admin.database.v1.Database.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.restoreInfo != null) { - if (typeof object.restoreInfo !== "object") - throw TypeError(".google.spanner.admin.database.v1.Database.restoreInfo: object expected"); - message.restoreInfo = $root.google.spanner.admin.database.v1.RestoreInfo.fromObject(object.restoreInfo); - } - if (object.encryptionConfig != null) { - if (typeof object.encryptionConfig !== "object") - throw TypeError(".google.spanner.admin.database.v1.Database.encryptionConfig: object expected"); - message.encryptionConfig = $root.google.spanner.admin.database.v1.EncryptionConfig.fromObject(object.encryptionConfig); - } - if (object.encryptionInfo) { - if (!Array.isArray(object.encryptionInfo)) - throw TypeError(".google.spanner.admin.database.v1.Database.encryptionInfo: array expected"); - message.encryptionInfo = []; - for (var i = 0; i < object.encryptionInfo.length; ++i) { - if (typeof object.encryptionInfo[i] !== "object") - throw TypeError(".google.spanner.admin.database.v1.Database.encryptionInfo: object expected"); - message.encryptionInfo[i] = $root.google.spanner.admin.database.v1.EncryptionInfo.fromObject(object.encryptionInfo[i]); - } - } - if (object.versionRetentionPeriod != null) - message.versionRetentionPeriod = String(object.versionRetentionPeriod); - if (object.earliestVersionTime != null) { - if (typeof object.earliestVersionTime !== "object") - throw TypeError(".google.spanner.admin.database.v1.Database.earliestVersionTime: object expected"); - message.earliestVersionTime = $root.google.protobuf.Timestamp.fromObject(object.earliestVersionTime); - } - if (object.defaultLeader != null) - message.defaultLeader = String(object.defaultLeader); - switch (object.databaseDialect) { - default: - if (typeof object.databaseDialect === "number") { - message.databaseDialect = object.databaseDialect; - break; - } - break; - case "DATABASE_DIALECT_UNSPECIFIED": - case 0: - message.databaseDialect = 0; - break; - case "GOOGLE_STANDARD_SQL": - case 1: - message.databaseDialect = 1; - break; - case "POSTGRESQL": - case 2: - message.databaseDialect = 2; - break; - } - if (object.enableDropProtection != null) - message.enableDropProtection = Boolean(object.enableDropProtection); - if (object.reconciling != null) - message.reconciling = Boolean(object.reconciling); - return message; - }; - - /** - * Creates a plain object from a Database message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.Database - * @static - * @param {google.spanner.admin.database.v1.Database} message Database - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Database.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.encryptionInfo = []; - if (options.defaults) { - object.name = ""; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.createTime = null; - object.restoreInfo = null; - object.encryptionConfig = null; - object.versionRetentionPeriod = ""; - object.earliestVersionTime = null; - object.defaultLeader = ""; - object.databaseDialect = options.enums === String ? "DATABASE_DIALECT_UNSPECIFIED" : 0; - object.enableDropProtection = false; - object.reconciling = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.spanner.admin.database.v1.Database.State[message.state] === undefined ? message.state : $root.google.spanner.admin.database.v1.Database.State[message.state] : message.state; - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.restoreInfo != null && message.hasOwnProperty("restoreInfo")) - object.restoreInfo = $root.google.spanner.admin.database.v1.RestoreInfo.toObject(message.restoreInfo, options); - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) - object.encryptionConfig = $root.google.spanner.admin.database.v1.EncryptionConfig.toObject(message.encryptionConfig, options); - if (message.versionRetentionPeriod != null && message.hasOwnProperty("versionRetentionPeriod")) - object.versionRetentionPeriod = message.versionRetentionPeriod; - if (message.earliestVersionTime != null && message.hasOwnProperty("earliestVersionTime")) - object.earliestVersionTime = $root.google.protobuf.Timestamp.toObject(message.earliestVersionTime, options); - if (message.encryptionInfo && message.encryptionInfo.length) { - object.encryptionInfo = []; - for (var j = 0; j < message.encryptionInfo.length; ++j) - object.encryptionInfo[j] = $root.google.spanner.admin.database.v1.EncryptionInfo.toObject(message.encryptionInfo[j], options); - } - if (message.defaultLeader != null && message.hasOwnProperty("defaultLeader")) - object.defaultLeader = message.defaultLeader; - if (message.databaseDialect != null && message.hasOwnProperty("databaseDialect")) - object.databaseDialect = options.enums === String ? $root.google.spanner.admin.database.v1.DatabaseDialect[message.databaseDialect] === undefined ? message.databaseDialect : $root.google.spanner.admin.database.v1.DatabaseDialect[message.databaseDialect] : message.databaseDialect; - if (message.enableDropProtection != null && message.hasOwnProperty("enableDropProtection")) - object.enableDropProtection = message.enableDropProtection; - if (message.reconciling != null && message.hasOwnProperty("reconciling")) - object.reconciling = message.reconciling; - return object; - }; - - /** - * Converts this Database to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.Database - * @instance - * @returns {Object.} JSON object - */ - Database.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Database - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.Database - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Database.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.Database"; - }; - - /** - * State enum. - * @name google.spanner.admin.database.v1.Database.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} CREATING=1 CREATING value - * @property {number} READY=2 READY value - * @property {number} READY_OPTIMIZING=3 READY_OPTIMIZING value - */ - Database.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "CREATING"] = 1; - values[valuesById[2] = "READY"] = 2; - values[valuesById[3] = "READY_OPTIMIZING"] = 3; - return values; - })(); - - return Database; - })(); - - v1.ListDatabasesRequest = (function() { - - /** - * Properties of a ListDatabasesRequest. - * @memberof google.spanner.admin.database.v1 - * @interface IListDatabasesRequest - * @property {string|null} [parent] ListDatabasesRequest parent - * @property {number|null} [pageSize] ListDatabasesRequest pageSize - * @property {string|null} [pageToken] ListDatabasesRequest pageToken - */ - - /** - * Constructs a new ListDatabasesRequest. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents a ListDatabasesRequest. - * @implements IListDatabasesRequest - * @constructor - * @param {google.spanner.admin.database.v1.IListDatabasesRequest=} [properties] Properties to set - */ - function ListDatabasesRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListDatabasesRequest parent. - * @member {string} parent - * @memberof google.spanner.admin.database.v1.ListDatabasesRequest - * @instance - */ - ListDatabasesRequest.prototype.parent = ""; - - /** - * ListDatabasesRequest pageSize. - * @member {number} pageSize - * @memberof google.spanner.admin.database.v1.ListDatabasesRequest - * @instance - */ - ListDatabasesRequest.prototype.pageSize = 0; - - /** - * ListDatabasesRequest pageToken. - * @member {string} pageToken - * @memberof google.spanner.admin.database.v1.ListDatabasesRequest - * @instance - */ - ListDatabasesRequest.prototype.pageToken = ""; - - /** - * Creates a new ListDatabasesRequest instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.ListDatabasesRequest - * @static - * @param {google.spanner.admin.database.v1.IListDatabasesRequest=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.ListDatabasesRequest} ListDatabasesRequest instance - */ - ListDatabasesRequest.create = function create(properties) { - return new ListDatabasesRequest(properties); - }; - - /** - * Encodes the specified ListDatabasesRequest message. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabasesRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.ListDatabasesRequest - * @static - * @param {google.spanner.admin.database.v1.IListDatabasesRequest} message ListDatabasesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListDatabasesRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); - return writer; - }; - - /** - * Encodes the specified ListDatabasesRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabasesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.ListDatabasesRequest - * @static - * @param {google.spanner.admin.database.v1.IListDatabasesRequest} message ListDatabasesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListDatabasesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListDatabasesRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.ListDatabasesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.ListDatabasesRequest} ListDatabasesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListDatabasesRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.ListDatabasesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 3: { - message.pageSize = reader.int32(); - break; - } - case 4: { - message.pageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListDatabasesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.ListDatabasesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.ListDatabasesRequest} ListDatabasesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListDatabasesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListDatabasesRequest message. - * @function verify - * @memberof google.spanner.admin.database.v1.ListDatabasesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListDatabasesRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - return null; - }; - - /** - * Creates a ListDatabasesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.ListDatabasesRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.ListDatabasesRequest} ListDatabasesRequest - */ - ListDatabasesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.ListDatabasesRequest) - return object; - var message = new $root.google.spanner.admin.database.v1.ListDatabasesRequest(); - 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 ListDatabasesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.ListDatabasesRequest - * @static - * @param {google.spanner.admin.database.v1.ListDatabasesRequest} message ListDatabasesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListDatabasesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - return object; - }; - - /** - * Converts this ListDatabasesRequest to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.ListDatabasesRequest - * @instance - * @returns {Object.} JSON object - */ - ListDatabasesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListDatabasesRequest - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.ListDatabasesRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListDatabasesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.ListDatabasesRequest"; - }; - - return ListDatabasesRequest; - })(); - - v1.ListDatabasesResponse = (function() { - - /** - * Properties of a ListDatabasesResponse. - * @memberof google.spanner.admin.database.v1 - * @interface IListDatabasesResponse - * @property {Array.|null} [databases] ListDatabasesResponse databases - * @property {string|null} [nextPageToken] ListDatabasesResponse nextPageToken - */ - - /** - * Constructs a new ListDatabasesResponse. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents a ListDatabasesResponse. - * @implements IListDatabasesResponse - * @constructor - * @param {google.spanner.admin.database.v1.IListDatabasesResponse=} [properties] Properties to set - */ - function ListDatabasesResponse(properties) { - this.databases = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListDatabasesResponse databases. - * @member {Array.} databases - * @memberof google.spanner.admin.database.v1.ListDatabasesResponse - * @instance - */ - ListDatabasesResponse.prototype.databases = $util.emptyArray; - - /** - * ListDatabasesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.spanner.admin.database.v1.ListDatabasesResponse - * @instance - */ - ListDatabasesResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListDatabasesResponse instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.ListDatabasesResponse - * @static - * @param {google.spanner.admin.database.v1.IListDatabasesResponse=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.ListDatabasesResponse} ListDatabasesResponse instance - */ - ListDatabasesResponse.create = function create(properties) { - return new ListDatabasesResponse(properties); - }; - - /** - * Encodes the specified ListDatabasesResponse message. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabasesResponse.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.ListDatabasesResponse - * @static - * @param {google.spanner.admin.database.v1.IListDatabasesResponse} message ListDatabasesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListDatabasesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.databases != null && message.databases.length) - for (var i = 0; i < message.databases.length; ++i) - $root.google.spanner.admin.database.v1.Database.encode(message.databases[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - return writer; - }; - - /** - * Encodes the specified ListDatabasesResponse message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabasesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.ListDatabasesResponse - * @static - * @param {google.spanner.admin.database.v1.IListDatabasesResponse} message ListDatabasesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListDatabasesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListDatabasesResponse message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.ListDatabasesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.ListDatabasesResponse} ListDatabasesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListDatabasesResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.ListDatabasesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.databases && message.databases.length)) - message.databases = []; - message.databases.push($root.google.spanner.admin.database.v1.Database.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListDatabasesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.ListDatabasesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.ListDatabasesResponse} ListDatabasesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListDatabasesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListDatabasesResponse message. - * @function verify - * @memberof google.spanner.admin.database.v1.ListDatabasesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListDatabasesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.databases != null && message.hasOwnProperty("databases")) { - if (!Array.isArray(message.databases)) - return "databases: array expected"; - for (var i = 0; i < message.databases.length; ++i) { - var error = $root.google.spanner.admin.database.v1.Database.verify(message.databases[i]); - if (error) - return "databases." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListDatabasesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.ListDatabasesResponse - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.ListDatabasesResponse} ListDatabasesResponse - */ - ListDatabasesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.ListDatabasesResponse) - return object; - var message = new $root.google.spanner.admin.database.v1.ListDatabasesResponse(); - if (object.databases) { - if (!Array.isArray(object.databases)) - throw TypeError(".google.spanner.admin.database.v1.ListDatabasesResponse.databases: array expected"); - message.databases = []; - for (var i = 0; i < object.databases.length; ++i) { - if (typeof object.databases[i] !== "object") - throw TypeError(".google.spanner.admin.database.v1.ListDatabasesResponse.databases: object expected"); - message.databases[i] = $root.google.spanner.admin.database.v1.Database.fromObject(object.databases[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListDatabasesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.ListDatabasesResponse - * @static - * @param {google.spanner.admin.database.v1.ListDatabasesResponse} message ListDatabasesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListDatabasesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.databases = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.databases && message.databases.length) { - object.databases = []; - for (var j = 0; j < message.databases.length; ++j) - object.databases[j] = $root.google.spanner.admin.database.v1.Database.toObject(message.databases[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListDatabasesResponse to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.ListDatabasesResponse - * @instance - * @returns {Object.} JSON object - */ - ListDatabasesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListDatabasesResponse - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.ListDatabasesResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListDatabasesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.ListDatabasesResponse"; - }; - - return ListDatabasesResponse; - })(); - - v1.CreateDatabaseRequest = (function() { - - /** - * Properties of a CreateDatabaseRequest. - * @memberof google.spanner.admin.database.v1 - * @interface ICreateDatabaseRequest - * @property {string|null} [parent] CreateDatabaseRequest parent - * @property {string|null} [createStatement] CreateDatabaseRequest createStatement - * @property {Array.|null} [extraStatements] CreateDatabaseRequest extraStatements - * @property {google.spanner.admin.database.v1.IEncryptionConfig|null} [encryptionConfig] CreateDatabaseRequest encryptionConfig - * @property {google.spanner.admin.database.v1.DatabaseDialect|null} [databaseDialect] CreateDatabaseRequest databaseDialect - * @property {Uint8Array|null} [protoDescriptors] CreateDatabaseRequest protoDescriptors - */ - - /** - * Constructs a new CreateDatabaseRequest. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents a CreateDatabaseRequest. - * @implements ICreateDatabaseRequest - * @constructor - * @param {google.spanner.admin.database.v1.ICreateDatabaseRequest=} [properties] Properties to set - */ - function CreateDatabaseRequest(properties) { - this.extraStatements = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateDatabaseRequest parent. - * @member {string} parent - * @memberof google.spanner.admin.database.v1.CreateDatabaseRequest - * @instance - */ - CreateDatabaseRequest.prototype.parent = ""; - - /** - * CreateDatabaseRequest createStatement. - * @member {string} createStatement - * @memberof google.spanner.admin.database.v1.CreateDatabaseRequest - * @instance - */ - CreateDatabaseRequest.prototype.createStatement = ""; - - /** - * CreateDatabaseRequest extraStatements. - * @member {Array.} extraStatements - * @memberof google.spanner.admin.database.v1.CreateDatabaseRequest - * @instance - */ - CreateDatabaseRequest.prototype.extraStatements = $util.emptyArray; - - /** - * CreateDatabaseRequest encryptionConfig. - * @member {google.spanner.admin.database.v1.IEncryptionConfig|null|undefined} encryptionConfig - * @memberof google.spanner.admin.database.v1.CreateDatabaseRequest - * @instance - */ - CreateDatabaseRequest.prototype.encryptionConfig = null; - - /** - * CreateDatabaseRequest databaseDialect. - * @member {google.spanner.admin.database.v1.DatabaseDialect} databaseDialect - * @memberof google.spanner.admin.database.v1.CreateDatabaseRequest - * @instance - */ - CreateDatabaseRequest.prototype.databaseDialect = 0; - - /** - * CreateDatabaseRequest protoDescriptors. - * @member {Uint8Array} protoDescriptors - * @memberof google.spanner.admin.database.v1.CreateDatabaseRequest - * @instance - */ - CreateDatabaseRequest.prototype.protoDescriptors = $util.newBuffer([]); - - /** - * Creates a new CreateDatabaseRequest instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.CreateDatabaseRequest - * @static - * @param {google.spanner.admin.database.v1.ICreateDatabaseRequest=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.CreateDatabaseRequest} CreateDatabaseRequest instance - */ - CreateDatabaseRequest.create = function create(properties) { - return new CreateDatabaseRequest(properties); - }; - - /** - * Encodes the specified CreateDatabaseRequest message. Does not implicitly {@link google.spanner.admin.database.v1.CreateDatabaseRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.CreateDatabaseRequest - * @static - * @param {google.spanner.admin.database.v1.ICreateDatabaseRequest} message CreateDatabaseRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateDatabaseRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.createStatement != null && Object.hasOwnProperty.call(message, "createStatement")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.createStatement); - if (message.extraStatements != null && message.extraStatements.length) - for (var i = 0; i < message.extraStatements.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.extraStatements[i]); - if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) - $root.google.spanner.admin.database.v1.EncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.databaseDialect != null && Object.hasOwnProperty.call(message, "databaseDialect")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.databaseDialect); - if (message.protoDescriptors != null && Object.hasOwnProperty.call(message, "protoDescriptors")) - writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.protoDescriptors); - return writer; - }; - - /** - * Encodes the specified CreateDatabaseRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.CreateDatabaseRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.CreateDatabaseRequest - * @static - * @param {google.spanner.admin.database.v1.ICreateDatabaseRequest} message CreateDatabaseRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateDatabaseRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateDatabaseRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.CreateDatabaseRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.CreateDatabaseRequest} CreateDatabaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateDatabaseRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.CreateDatabaseRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.createStatement = reader.string(); - break; - } - case 3: { - if (!(message.extraStatements && message.extraStatements.length)) - message.extraStatements = []; - message.extraStatements.push(reader.string()); - break; - } - case 4: { - message.encryptionConfig = $root.google.spanner.admin.database.v1.EncryptionConfig.decode(reader, reader.uint32()); - break; - } - case 5: { - message.databaseDialect = reader.int32(); - break; - } - case 6: { - message.protoDescriptors = reader.bytes(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateDatabaseRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.CreateDatabaseRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.CreateDatabaseRequest} CreateDatabaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateDatabaseRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateDatabaseRequest message. - * @function verify - * @memberof google.spanner.admin.database.v1.CreateDatabaseRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateDatabaseRequest.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.createStatement != null && message.hasOwnProperty("createStatement")) - if (!$util.isString(message.createStatement)) - return "createStatement: string expected"; - if (message.extraStatements != null && message.hasOwnProperty("extraStatements")) { - if (!Array.isArray(message.extraStatements)) - return "extraStatements: array expected"; - for (var i = 0; i < message.extraStatements.length; ++i) - if (!$util.isString(message.extraStatements[i])) - return "extraStatements: string[] expected"; - } - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { - var error = $root.google.spanner.admin.database.v1.EncryptionConfig.verify(message.encryptionConfig); - if (error) - return "encryptionConfig." + error; - } - if (message.databaseDialect != null && message.hasOwnProperty("databaseDialect")) - switch (message.databaseDialect) { - default: - return "databaseDialect: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.protoDescriptors != null && message.hasOwnProperty("protoDescriptors")) - if (!(message.protoDescriptors && typeof message.protoDescriptors.length === "number" || $util.isString(message.protoDescriptors))) - return "protoDescriptors: buffer expected"; - return null; - }; - - /** - * Creates a CreateDatabaseRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.CreateDatabaseRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.CreateDatabaseRequest} CreateDatabaseRequest - */ - CreateDatabaseRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.CreateDatabaseRequest) - return object; - var message = new $root.google.spanner.admin.database.v1.CreateDatabaseRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.createStatement != null) - message.createStatement = String(object.createStatement); - if (object.extraStatements) { - if (!Array.isArray(object.extraStatements)) - throw TypeError(".google.spanner.admin.database.v1.CreateDatabaseRequest.extraStatements: array expected"); - message.extraStatements = []; - for (var i = 0; i < object.extraStatements.length; ++i) - message.extraStatements[i] = String(object.extraStatements[i]); - } - if (object.encryptionConfig != null) { - if (typeof object.encryptionConfig !== "object") - throw TypeError(".google.spanner.admin.database.v1.CreateDatabaseRequest.encryptionConfig: object expected"); - message.encryptionConfig = $root.google.spanner.admin.database.v1.EncryptionConfig.fromObject(object.encryptionConfig); - } - switch (object.databaseDialect) { - default: - if (typeof object.databaseDialect === "number") { - message.databaseDialect = object.databaseDialect; - break; - } - break; - case "DATABASE_DIALECT_UNSPECIFIED": - case 0: - message.databaseDialect = 0; - break; - case "GOOGLE_STANDARD_SQL": - case 1: - message.databaseDialect = 1; - break; - case "POSTGRESQL": - case 2: - message.databaseDialect = 2; - break; - } - if (object.protoDescriptors != null) - if (typeof object.protoDescriptors === "string") - $util.base64.decode(object.protoDescriptors, message.protoDescriptors = $util.newBuffer($util.base64.length(object.protoDescriptors)), 0); - else if (object.protoDescriptors.length >= 0) - message.protoDescriptors = object.protoDescriptors; - return message; - }; - - /** - * Creates a plain object from a CreateDatabaseRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.CreateDatabaseRequest - * @static - * @param {google.spanner.admin.database.v1.CreateDatabaseRequest} message CreateDatabaseRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateDatabaseRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.extraStatements = []; - if (options.defaults) { - object.parent = ""; - object.createStatement = ""; - object.encryptionConfig = null; - object.databaseDialect = options.enums === String ? "DATABASE_DIALECT_UNSPECIFIED" : 0; - if (options.bytes === String) - object.protoDescriptors = ""; - else { - object.protoDescriptors = []; - if (options.bytes !== Array) - object.protoDescriptors = $util.newBuffer(object.protoDescriptors); - } - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.createStatement != null && message.hasOwnProperty("createStatement")) - object.createStatement = message.createStatement; - if (message.extraStatements && message.extraStatements.length) { - object.extraStatements = []; - for (var j = 0; j < message.extraStatements.length; ++j) - object.extraStatements[j] = message.extraStatements[j]; - } - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) - object.encryptionConfig = $root.google.spanner.admin.database.v1.EncryptionConfig.toObject(message.encryptionConfig, options); - if (message.databaseDialect != null && message.hasOwnProperty("databaseDialect")) - object.databaseDialect = options.enums === String ? $root.google.spanner.admin.database.v1.DatabaseDialect[message.databaseDialect] === undefined ? message.databaseDialect : $root.google.spanner.admin.database.v1.DatabaseDialect[message.databaseDialect] : message.databaseDialect; - if (message.protoDescriptors != null && message.hasOwnProperty("protoDescriptors")) - object.protoDescriptors = options.bytes === String ? $util.base64.encode(message.protoDescriptors, 0, message.protoDescriptors.length) : options.bytes === Array ? Array.prototype.slice.call(message.protoDescriptors) : message.protoDescriptors; - return object; - }; - - /** - * Converts this CreateDatabaseRequest to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.CreateDatabaseRequest - * @instance - * @returns {Object.} JSON object - */ - CreateDatabaseRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateDatabaseRequest - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.CreateDatabaseRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateDatabaseRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.CreateDatabaseRequest"; - }; - - return CreateDatabaseRequest; - })(); - - v1.CreateDatabaseMetadata = (function() { - - /** - * Properties of a CreateDatabaseMetadata. - * @memberof google.spanner.admin.database.v1 - * @interface ICreateDatabaseMetadata - * @property {string|null} [database] CreateDatabaseMetadata database - */ - - /** - * Constructs a new CreateDatabaseMetadata. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents a CreateDatabaseMetadata. - * @implements ICreateDatabaseMetadata - * @constructor - * @param {google.spanner.admin.database.v1.ICreateDatabaseMetadata=} [properties] Properties to set - */ - function CreateDatabaseMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateDatabaseMetadata database. - * @member {string} database - * @memberof google.spanner.admin.database.v1.CreateDatabaseMetadata - * @instance - */ - CreateDatabaseMetadata.prototype.database = ""; - - /** - * Creates a new CreateDatabaseMetadata instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.CreateDatabaseMetadata - * @static - * @param {google.spanner.admin.database.v1.ICreateDatabaseMetadata=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.CreateDatabaseMetadata} CreateDatabaseMetadata instance - */ - CreateDatabaseMetadata.create = function create(properties) { - return new CreateDatabaseMetadata(properties); - }; - - /** - * Encodes the specified CreateDatabaseMetadata message. Does not implicitly {@link google.spanner.admin.database.v1.CreateDatabaseMetadata.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.CreateDatabaseMetadata - * @static - * @param {google.spanner.admin.database.v1.ICreateDatabaseMetadata} message CreateDatabaseMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateDatabaseMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.database != null && Object.hasOwnProperty.call(message, "database")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.database); - return writer; - }; - - /** - * Encodes the specified CreateDatabaseMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.CreateDatabaseMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.CreateDatabaseMetadata - * @static - * @param {google.spanner.admin.database.v1.ICreateDatabaseMetadata} message CreateDatabaseMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateDatabaseMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateDatabaseMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.CreateDatabaseMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.CreateDatabaseMetadata} CreateDatabaseMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateDatabaseMetadata.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.CreateDatabaseMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.database = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateDatabaseMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.CreateDatabaseMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.CreateDatabaseMetadata} CreateDatabaseMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateDatabaseMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateDatabaseMetadata message. - * @function verify - * @memberof google.spanner.admin.database.v1.CreateDatabaseMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateDatabaseMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.database != null && message.hasOwnProperty("database")) - if (!$util.isString(message.database)) - return "database: string expected"; - return null; - }; - - /** - * Creates a CreateDatabaseMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.CreateDatabaseMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.CreateDatabaseMetadata} CreateDatabaseMetadata - */ - CreateDatabaseMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.CreateDatabaseMetadata) - return object; - var message = new $root.google.spanner.admin.database.v1.CreateDatabaseMetadata(); - if (object.database != null) - message.database = String(object.database); - return message; - }; - - /** - * Creates a plain object from a CreateDatabaseMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.CreateDatabaseMetadata - * @static - * @param {google.spanner.admin.database.v1.CreateDatabaseMetadata} message CreateDatabaseMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateDatabaseMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.database = ""; - if (message.database != null && message.hasOwnProperty("database")) - object.database = message.database; - return object; - }; - - /** - * Converts this CreateDatabaseMetadata to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.CreateDatabaseMetadata - * @instance - * @returns {Object.} JSON object - */ - CreateDatabaseMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateDatabaseMetadata - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.CreateDatabaseMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateDatabaseMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.CreateDatabaseMetadata"; - }; - - return CreateDatabaseMetadata; - })(); - - v1.GetDatabaseRequest = (function() { - - /** - * Properties of a GetDatabaseRequest. - * @memberof google.spanner.admin.database.v1 - * @interface IGetDatabaseRequest - * @property {string|null} [name] GetDatabaseRequest name - */ - - /** - * Constructs a new GetDatabaseRequest. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents a GetDatabaseRequest. - * @implements IGetDatabaseRequest - * @constructor - * @param {google.spanner.admin.database.v1.IGetDatabaseRequest=} [properties] Properties to set - */ - function GetDatabaseRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetDatabaseRequest name. - * @member {string} name - * @memberof google.spanner.admin.database.v1.GetDatabaseRequest - * @instance - */ - GetDatabaseRequest.prototype.name = ""; - - /** - * Creates a new GetDatabaseRequest instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.GetDatabaseRequest - * @static - * @param {google.spanner.admin.database.v1.IGetDatabaseRequest=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.GetDatabaseRequest} GetDatabaseRequest instance - */ - GetDatabaseRequest.create = function create(properties) { - return new GetDatabaseRequest(properties); - }; - - /** - * Encodes the specified GetDatabaseRequest message. Does not implicitly {@link google.spanner.admin.database.v1.GetDatabaseRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.GetDatabaseRequest - * @static - * @param {google.spanner.admin.database.v1.IGetDatabaseRequest} message GetDatabaseRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDatabaseRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; - - /** - * Encodes the specified GetDatabaseRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.GetDatabaseRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.GetDatabaseRequest - * @static - * @param {google.spanner.admin.database.v1.IGetDatabaseRequest} message GetDatabaseRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDatabaseRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetDatabaseRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.GetDatabaseRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.GetDatabaseRequest} GetDatabaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDatabaseRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.GetDatabaseRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetDatabaseRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.GetDatabaseRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.GetDatabaseRequest} GetDatabaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDatabaseRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetDatabaseRequest message. - * @function verify - * @memberof google.spanner.admin.database.v1.GetDatabaseRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetDatabaseRequest.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 GetDatabaseRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.GetDatabaseRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.GetDatabaseRequest} GetDatabaseRequest - */ - GetDatabaseRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.GetDatabaseRequest) - return object; - var message = new $root.google.spanner.admin.database.v1.GetDatabaseRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetDatabaseRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.GetDatabaseRequest - * @static - * @param {google.spanner.admin.database.v1.GetDatabaseRequest} message GetDatabaseRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetDatabaseRequest.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 GetDatabaseRequest to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.GetDatabaseRequest - * @instance - * @returns {Object.} JSON object - */ - GetDatabaseRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetDatabaseRequest - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.GetDatabaseRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetDatabaseRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.GetDatabaseRequest"; - }; - - return GetDatabaseRequest; - })(); - - v1.UpdateDatabaseRequest = (function() { - - /** - * Properties of an UpdateDatabaseRequest. - * @memberof google.spanner.admin.database.v1 - * @interface IUpdateDatabaseRequest - * @property {google.spanner.admin.database.v1.IDatabase|null} [database] UpdateDatabaseRequest database - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateDatabaseRequest updateMask - */ - - /** - * Constructs a new UpdateDatabaseRequest. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents an UpdateDatabaseRequest. - * @implements IUpdateDatabaseRequest - * @constructor - * @param {google.spanner.admin.database.v1.IUpdateDatabaseRequest=} [properties] Properties to set - */ - function UpdateDatabaseRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateDatabaseRequest database. - * @member {google.spanner.admin.database.v1.IDatabase|null|undefined} database - * @memberof google.spanner.admin.database.v1.UpdateDatabaseRequest - * @instance - */ - UpdateDatabaseRequest.prototype.database = null; - - /** - * UpdateDatabaseRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.spanner.admin.database.v1.UpdateDatabaseRequest - * @instance - */ - UpdateDatabaseRequest.prototype.updateMask = null; - - /** - * Creates a new UpdateDatabaseRequest instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.UpdateDatabaseRequest - * @static - * @param {google.spanner.admin.database.v1.IUpdateDatabaseRequest=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.UpdateDatabaseRequest} UpdateDatabaseRequest instance - */ - UpdateDatabaseRequest.create = function create(properties) { - return new UpdateDatabaseRequest(properties); - }; - - /** - * Encodes the specified UpdateDatabaseRequest message. Does not implicitly {@link google.spanner.admin.database.v1.UpdateDatabaseRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.UpdateDatabaseRequest - * @static - * @param {google.spanner.admin.database.v1.IUpdateDatabaseRequest} message UpdateDatabaseRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateDatabaseRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.database != null && Object.hasOwnProperty.call(message, "database")) - $root.google.spanner.admin.database.v1.Database.encode(message.database, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified UpdateDatabaseRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.UpdateDatabaseRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.UpdateDatabaseRequest - * @static - * @param {google.spanner.admin.database.v1.IUpdateDatabaseRequest} message UpdateDatabaseRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateDatabaseRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateDatabaseRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.UpdateDatabaseRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.UpdateDatabaseRequest} UpdateDatabaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateDatabaseRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.UpdateDatabaseRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.database = $root.google.spanner.admin.database.v1.Database.decode(reader, reader.uint32()); - break; - } - case 2: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateDatabaseRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.UpdateDatabaseRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.UpdateDatabaseRequest} UpdateDatabaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateDatabaseRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateDatabaseRequest message. - * @function verify - * @memberof google.spanner.admin.database.v1.UpdateDatabaseRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateDatabaseRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.database != null && message.hasOwnProperty("database")) { - var error = $root.google.spanner.admin.database.v1.Database.verify(message.database); - if (error) - return "database." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - return null; - }; - - /** - * Creates an UpdateDatabaseRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.UpdateDatabaseRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.UpdateDatabaseRequest} UpdateDatabaseRequest - */ - UpdateDatabaseRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.UpdateDatabaseRequest) - return object; - var message = new $root.google.spanner.admin.database.v1.UpdateDatabaseRequest(); - if (object.database != null) { - if (typeof object.database !== "object") - throw TypeError(".google.spanner.admin.database.v1.UpdateDatabaseRequest.database: object expected"); - message.database = $root.google.spanner.admin.database.v1.Database.fromObject(object.database); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.spanner.admin.database.v1.UpdateDatabaseRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - return message; - }; - - /** - * Creates a plain object from an UpdateDatabaseRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.UpdateDatabaseRequest - * @static - * @param {google.spanner.admin.database.v1.UpdateDatabaseRequest} message UpdateDatabaseRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateDatabaseRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.database = null; - object.updateMask = null; - } - if (message.database != null && message.hasOwnProperty("database")) - object.database = $root.google.spanner.admin.database.v1.Database.toObject(message.database, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - return object; - }; - - /** - * Converts this UpdateDatabaseRequest to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.UpdateDatabaseRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateDatabaseRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateDatabaseRequest - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.UpdateDatabaseRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateDatabaseRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.UpdateDatabaseRequest"; - }; - - return UpdateDatabaseRequest; - })(); - - v1.UpdateDatabaseMetadata = (function() { - - /** - * Properties of an UpdateDatabaseMetadata. - * @memberof google.spanner.admin.database.v1 - * @interface IUpdateDatabaseMetadata - * @property {google.spanner.admin.database.v1.IUpdateDatabaseRequest|null} [request] UpdateDatabaseMetadata request - * @property {google.spanner.admin.database.v1.IOperationProgress|null} [progress] UpdateDatabaseMetadata progress - * @property {google.protobuf.ITimestamp|null} [cancelTime] UpdateDatabaseMetadata cancelTime - */ - - /** - * Constructs a new UpdateDatabaseMetadata. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents an UpdateDatabaseMetadata. - * @implements IUpdateDatabaseMetadata - * @constructor - * @param {google.spanner.admin.database.v1.IUpdateDatabaseMetadata=} [properties] Properties to set - */ - function UpdateDatabaseMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateDatabaseMetadata request. - * @member {google.spanner.admin.database.v1.IUpdateDatabaseRequest|null|undefined} request - * @memberof google.spanner.admin.database.v1.UpdateDatabaseMetadata - * @instance - */ - UpdateDatabaseMetadata.prototype.request = null; - - /** - * UpdateDatabaseMetadata progress. - * @member {google.spanner.admin.database.v1.IOperationProgress|null|undefined} progress - * @memberof google.spanner.admin.database.v1.UpdateDatabaseMetadata - * @instance - */ - UpdateDatabaseMetadata.prototype.progress = null; - - /** - * UpdateDatabaseMetadata cancelTime. - * @member {google.protobuf.ITimestamp|null|undefined} cancelTime - * @memberof google.spanner.admin.database.v1.UpdateDatabaseMetadata - * @instance - */ - UpdateDatabaseMetadata.prototype.cancelTime = null; - - /** - * Creates a new UpdateDatabaseMetadata instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.UpdateDatabaseMetadata - * @static - * @param {google.spanner.admin.database.v1.IUpdateDatabaseMetadata=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.UpdateDatabaseMetadata} UpdateDatabaseMetadata instance - */ - UpdateDatabaseMetadata.create = function create(properties) { - return new UpdateDatabaseMetadata(properties); - }; - - /** - * Encodes the specified UpdateDatabaseMetadata message. Does not implicitly {@link google.spanner.admin.database.v1.UpdateDatabaseMetadata.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.UpdateDatabaseMetadata - * @static - * @param {google.spanner.admin.database.v1.IUpdateDatabaseMetadata} message UpdateDatabaseMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateDatabaseMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.request != null && Object.hasOwnProperty.call(message, "request")) - $root.google.spanner.admin.database.v1.UpdateDatabaseRequest.encode(message.request, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.progress != null && Object.hasOwnProperty.call(message, "progress")) - $root.google.spanner.admin.database.v1.OperationProgress.encode(message.progress, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.cancelTime != null && Object.hasOwnProperty.call(message, "cancelTime")) - $root.google.protobuf.Timestamp.encode(message.cancelTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified UpdateDatabaseMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.UpdateDatabaseMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.UpdateDatabaseMetadata - * @static - * @param {google.spanner.admin.database.v1.IUpdateDatabaseMetadata} message UpdateDatabaseMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateDatabaseMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateDatabaseMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.UpdateDatabaseMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.UpdateDatabaseMetadata} UpdateDatabaseMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateDatabaseMetadata.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.UpdateDatabaseMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.request = $root.google.spanner.admin.database.v1.UpdateDatabaseRequest.decode(reader, reader.uint32()); - break; - } - case 2: { - message.progress = $root.google.spanner.admin.database.v1.OperationProgress.decode(reader, reader.uint32()); - break; - } - case 3: { - message.cancelTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateDatabaseMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.UpdateDatabaseMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.UpdateDatabaseMetadata} UpdateDatabaseMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateDatabaseMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateDatabaseMetadata message. - * @function verify - * @memberof google.spanner.admin.database.v1.UpdateDatabaseMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateDatabaseMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.request != null && message.hasOwnProperty("request")) { - var error = $root.google.spanner.admin.database.v1.UpdateDatabaseRequest.verify(message.request); - if (error) - return "request." + error; - } - if (message.progress != null && message.hasOwnProperty("progress")) { - var error = $root.google.spanner.admin.database.v1.OperationProgress.verify(message.progress); - if (error) - return "progress." + error; - } - if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.cancelTime); - if (error) - return "cancelTime." + error; - } - return null; - }; - - /** - * Creates an UpdateDatabaseMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.UpdateDatabaseMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.UpdateDatabaseMetadata} UpdateDatabaseMetadata - */ - UpdateDatabaseMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.UpdateDatabaseMetadata) - return object; - var message = new $root.google.spanner.admin.database.v1.UpdateDatabaseMetadata(); - if (object.request != null) { - if (typeof object.request !== "object") - throw TypeError(".google.spanner.admin.database.v1.UpdateDatabaseMetadata.request: object expected"); - message.request = $root.google.spanner.admin.database.v1.UpdateDatabaseRequest.fromObject(object.request); - } - if (object.progress != null) { - if (typeof object.progress !== "object") - throw TypeError(".google.spanner.admin.database.v1.UpdateDatabaseMetadata.progress: object expected"); - message.progress = $root.google.spanner.admin.database.v1.OperationProgress.fromObject(object.progress); - } - if (object.cancelTime != null) { - if (typeof object.cancelTime !== "object") - throw TypeError(".google.spanner.admin.database.v1.UpdateDatabaseMetadata.cancelTime: object expected"); - message.cancelTime = $root.google.protobuf.Timestamp.fromObject(object.cancelTime); - } - return message; - }; - - /** - * Creates a plain object from an UpdateDatabaseMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.UpdateDatabaseMetadata - * @static - * @param {google.spanner.admin.database.v1.UpdateDatabaseMetadata} message UpdateDatabaseMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateDatabaseMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.request = null; - object.progress = null; - object.cancelTime = null; - } - if (message.request != null && message.hasOwnProperty("request")) - object.request = $root.google.spanner.admin.database.v1.UpdateDatabaseRequest.toObject(message.request, options); - if (message.progress != null && message.hasOwnProperty("progress")) - object.progress = $root.google.spanner.admin.database.v1.OperationProgress.toObject(message.progress, options); - if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) - object.cancelTime = $root.google.protobuf.Timestamp.toObject(message.cancelTime, options); - return object; - }; - - /** - * Converts this UpdateDatabaseMetadata to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.UpdateDatabaseMetadata - * @instance - * @returns {Object.} JSON object - */ - UpdateDatabaseMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateDatabaseMetadata - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.UpdateDatabaseMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateDatabaseMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.UpdateDatabaseMetadata"; - }; - - return UpdateDatabaseMetadata; - })(); - - v1.UpdateDatabaseDdlRequest = (function() { - - /** - * Properties of an UpdateDatabaseDdlRequest. - * @memberof google.spanner.admin.database.v1 - * @interface IUpdateDatabaseDdlRequest - * @property {string|null} [database] UpdateDatabaseDdlRequest database - * @property {Array.|null} [statements] UpdateDatabaseDdlRequest statements - * @property {string|null} [operationId] UpdateDatabaseDdlRequest operationId - * @property {Uint8Array|null} [protoDescriptors] UpdateDatabaseDdlRequest protoDescriptors - * @property {boolean|null} [throughputMode] UpdateDatabaseDdlRequest throughputMode - */ - - /** - * Constructs a new UpdateDatabaseDdlRequest. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents an UpdateDatabaseDdlRequest. - * @implements IUpdateDatabaseDdlRequest - * @constructor - * @param {google.spanner.admin.database.v1.IUpdateDatabaseDdlRequest=} [properties] Properties to set - */ - function UpdateDatabaseDdlRequest(properties) { - this.statements = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateDatabaseDdlRequest database. - * @member {string} database - * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlRequest - * @instance - */ - UpdateDatabaseDdlRequest.prototype.database = ""; - - /** - * UpdateDatabaseDdlRequest statements. - * @member {Array.} statements - * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlRequest - * @instance - */ - UpdateDatabaseDdlRequest.prototype.statements = $util.emptyArray; - - /** - * UpdateDatabaseDdlRequest operationId. - * @member {string} operationId - * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlRequest - * @instance - */ - UpdateDatabaseDdlRequest.prototype.operationId = ""; - - /** - * UpdateDatabaseDdlRequest protoDescriptors. - * @member {Uint8Array} protoDescriptors - * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlRequest - * @instance - */ - UpdateDatabaseDdlRequest.prototype.protoDescriptors = $util.newBuffer([]); - - /** - * UpdateDatabaseDdlRequest throughputMode. - * @member {boolean} throughputMode - * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlRequest - * @instance - */ - UpdateDatabaseDdlRequest.prototype.throughputMode = false; - - /** - * Creates a new UpdateDatabaseDdlRequest instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlRequest - * @static - * @param {google.spanner.admin.database.v1.IUpdateDatabaseDdlRequest=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.UpdateDatabaseDdlRequest} UpdateDatabaseDdlRequest instance - */ - UpdateDatabaseDdlRequest.create = function create(properties) { - return new UpdateDatabaseDdlRequest(properties); - }; - - /** - * Encodes the specified UpdateDatabaseDdlRequest message. Does not implicitly {@link google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlRequest - * @static - * @param {google.spanner.admin.database.v1.IUpdateDatabaseDdlRequest} message UpdateDatabaseDdlRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateDatabaseDdlRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.database != null && Object.hasOwnProperty.call(message, "database")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.database); - if (message.statements != null && message.statements.length) - for (var i = 0; i < message.statements.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.statements[i]); - if (message.operationId != null && Object.hasOwnProperty.call(message, "operationId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.operationId); - if (message.protoDescriptors != null && Object.hasOwnProperty.call(message, "protoDescriptors")) - writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.protoDescriptors); - if (message.throughputMode != null && Object.hasOwnProperty.call(message, "throughputMode")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.throughputMode); - return writer; - }; - - /** - * Encodes the specified UpdateDatabaseDdlRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlRequest - * @static - * @param {google.spanner.admin.database.v1.IUpdateDatabaseDdlRequest} message UpdateDatabaseDdlRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateDatabaseDdlRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateDatabaseDdlRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.UpdateDatabaseDdlRequest} UpdateDatabaseDdlRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateDatabaseDdlRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.UpdateDatabaseDdlRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.database = reader.string(); - break; - } - case 2: { - if (!(message.statements && message.statements.length)) - message.statements = []; - message.statements.push(reader.string()); - break; - } - case 3: { - message.operationId = reader.string(); - break; - } - case 4: { - message.protoDescriptors = reader.bytes(); - break; - } - case 5: { - message.throughputMode = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateDatabaseDdlRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.UpdateDatabaseDdlRequest} UpdateDatabaseDdlRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateDatabaseDdlRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateDatabaseDdlRequest message. - * @function verify - * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateDatabaseDdlRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.database != null && message.hasOwnProperty("database")) - if (!$util.isString(message.database)) - return "database: string expected"; - if (message.statements != null && message.hasOwnProperty("statements")) { - if (!Array.isArray(message.statements)) - return "statements: array expected"; - for (var i = 0; i < message.statements.length; ++i) - if (!$util.isString(message.statements[i])) - return "statements: string[] expected"; - } - if (message.operationId != null && message.hasOwnProperty("operationId")) - if (!$util.isString(message.operationId)) - return "operationId: string expected"; - if (message.protoDescriptors != null && message.hasOwnProperty("protoDescriptors")) - if (!(message.protoDescriptors && typeof message.protoDescriptors.length === "number" || $util.isString(message.protoDescriptors))) - return "protoDescriptors: buffer expected"; - if (message.throughputMode != null && message.hasOwnProperty("throughputMode")) - if (typeof message.throughputMode !== "boolean") - return "throughputMode: boolean expected"; - return null; - }; - - /** - * Creates an UpdateDatabaseDdlRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.UpdateDatabaseDdlRequest} UpdateDatabaseDdlRequest - */ - UpdateDatabaseDdlRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.UpdateDatabaseDdlRequest) - return object; - var message = new $root.google.spanner.admin.database.v1.UpdateDatabaseDdlRequest(); - if (object.database != null) - message.database = String(object.database); - if (object.statements) { - if (!Array.isArray(object.statements)) - throw TypeError(".google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.statements: array expected"); - message.statements = []; - for (var i = 0; i < object.statements.length; ++i) - message.statements[i] = String(object.statements[i]); - } - if (object.operationId != null) - message.operationId = String(object.operationId); - if (object.protoDescriptors != null) - if (typeof object.protoDescriptors === "string") - $util.base64.decode(object.protoDescriptors, message.protoDescriptors = $util.newBuffer($util.base64.length(object.protoDescriptors)), 0); - else if (object.protoDescriptors.length >= 0) - message.protoDescriptors = object.protoDescriptors; - if (object.throughputMode != null) - message.throughputMode = Boolean(object.throughputMode); - return message; - }; - - /** - * Creates a plain object from an UpdateDatabaseDdlRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlRequest - * @static - * @param {google.spanner.admin.database.v1.UpdateDatabaseDdlRequest} message UpdateDatabaseDdlRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateDatabaseDdlRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.statements = []; - if (options.defaults) { - object.database = ""; - object.operationId = ""; - if (options.bytes === String) - object.protoDescriptors = ""; - else { - object.protoDescriptors = []; - if (options.bytes !== Array) - object.protoDescriptors = $util.newBuffer(object.protoDescriptors); - } - object.throughputMode = false; - } - if (message.database != null && message.hasOwnProperty("database")) - object.database = message.database; - if (message.statements && message.statements.length) { - object.statements = []; - for (var j = 0; j < message.statements.length; ++j) - object.statements[j] = message.statements[j]; - } - if (message.operationId != null && message.hasOwnProperty("operationId")) - object.operationId = message.operationId; - if (message.protoDescriptors != null && message.hasOwnProperty("protoDescriptors")) - object.protoDescriptors = options.bytes === String ? $util.base64.encode(message.protoDescriptors, 0, message.protoDescriptors.length) : options.bytes === Array ? Array.prototype.slice.call(message.protoDescriptors) : message.protoDescriptors; - if (message.throughputMode != null && message.hasOwnProperty("throughputMode")) - object.throughputMode = message.throughputMode; - return object; - }; - - /** - * Converts this UpdateDatabaseDdlRequest to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateDatabaseDdlRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateDatabaseDdlRequest - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateDatabaseDdlRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.UpdateDatabaseDdlRequest"; - }; - - return UpdateDatabaseDdlRequest; - })(); - - v1.DdlStatementActionInfo = (function() { - - /** - * Properties of a DdlStatementActionInfo. - * @memberof google.spanner.admin.database.v1 - * @interface IDdlStatementActionInfo - * @property {string|null} [action] DdlStatementActionInfo action - * @property {string|null} [entityType] DdlStatementActionInfo entityType - * @property {Array.|null} [entityNames] DdlStatementActionInfo entityNames - */ - - /** - * Constructs a new DdlStatementActionInfo. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents a DdlStatementActionInfo. - * @implements IDdlStatementActionInfo - * @constructor - * @param {google.spanner.admin.database.v1.IDdlStatementActionInfo=} [properties] Properties to set - */ - function DdlStatementActionInfo(properties) { - this.entityNames = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DdlStatementActionInfo action. - * @member {string} action - * @memberof google.spanner.admin.database.v1.DdlStatementActionInfo - * @instance - */ - DdlStatementActionInfo.prototype.action = ""; - - /** - * DdlStatementActionInfo entityType. - * @member {string} entityType - * @memberof google.spanner.admin.database.v1.DdlStatementActionInfo - * @instance - */ - DdlStatementActionInfo.prototype.entityType = ""; - - /** - * DdlStatementActionInfo entityNames. - * @member {Array.} entityNames - * @memberof google.spanner.admin.database.v1.DdlStatementActionInfo - * @instance - */ - DdlStatementActionInfo.prototype.entityNames = $util.emptyArray; - - /** - * Creates a new DdlStatementActionInfo instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.DdlStatementActionInfo - * @static - * @param {google.spanner.admin.database.v1.IDdlStatementActionInfo=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.DdlStatementActionInfo} DdlStatementActionInfo instance - */ - DdlStatementActionInfo.create = function create(properties) { - return new DdlStatementActionInfo(properties); - }; - - /** - * Encodes the specified DdlStatementActionInfo message. Does not implicitly {@link google.spanner.admin.database.v1.DdlStatementActionInfo.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.DdlStatementActionInfo - * @static - * @param {google.spanner.admin.database.v1.IDdlStatementActionInfo} message DdlStatementActionInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DdlStatementActionInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.action != null && Object.hasOwnProperty.call(message, "action")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.action); - if (message.entityType != null && Object.hasOwnProperty.call(message, "entityType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.entityType); - if (message.entityNames != null && message.entityNames.length) - for (var i = 0; i < message.entityNames.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.entityNames[i]); - return writer; - }; - - /** - * Encodes the specified DdlStatementActionInfo message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.DdlStatementActionInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.DdlStatementActionInfo - * @static - * @param {google.spanner.admin.database.v1.IDdlStatementActionInfo} message DdlStatementActionInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DdlStatementActionInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DdlStatementActionInfo message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.DdlStatementActionInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.DdlStatementActionInfo} DdlStatementActionInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DdlStatementActionInfo.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.DdlStatementActionInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.action = reader.string(); - break; - } - case 2: { - message.entityType = reader.string(); - break; - } - case 3: { - if (!(message.entityNames && message.entityNames.length)) - message.entityNames = []; - message.entityNames.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DdlStatementActionInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.DdlStatementActionInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.DdlStatementActionInfo} DdlStatementActionInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DdlStatementActionInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DdlStatementActionInfo message. - * @function verify - * @memberof google.spanner.admin.database.v1.DdlStatementActionInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DdlStatementActionInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.action != null && message.hasOwnProperty("action")) - if (!$util.isString(message.action)) - return "action: string expected"; - if (message.entityType != null && message.hasOwnProperty("entityType")) - if (!$util.isString(message.entityType)) - return "entityType: string expected"; - if (message.entityNames != null && message.hasOwnProperty("entityNames")) { - if (!Array.isArray(message.entityNames)) - return "entityNames: array expected"; - for (var i = 0; i < message.entityNames.length; ++i) - if (!$util.isString(message.entityNames[i])) - return "entityNames: string[] expected"; - } - return null; - }; - - /** - * Creates a DdlStatementActionInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.DdlStatementActionInfo - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.DdlStatementActionInfo} DdlStatementActionInfo - */ - DdlStatementActionInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.DdlStatementActionInfo) - return object; - var message = new $root.google.spanner.admin.database.v1.DdlStatementActionInfo(); - if (object.action != null) - message.action = String(object.action); - if (object.entityType != null) - message.entityType = String(object.entityType); - if (object.entityNames) { - if (!Array.isArray(object.entityNames)) - throw TypeError(".google.spanner.admin.database.v1.DdlStatementActionInfo.entityNames: array expected"); - message.entityNames = []; - for (var i = 0; i < object.entityNames.length; ++i) - message.entityNames[i] = String(object.entityNames[i]); - } - return message; - }; - - /** - * Creates a plain object from a DdlStatementActionInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.DdlStatementActionInfo - * @static - * @param {google.spanner.admin.database.v1.DdlStatementActionInfo} message DdlStatementActionInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DdlStatementActionInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.entityNames = []; - if (options.defaults) { - object.action = ""; - object.entityType = ""; - } - if (message.action != null && message.hasOwnProperty("action")) - object.action = message.action; - if (message.entityType != null && message.hasOwnProperty("entityType")) - object.entityType = message.entityType; - if (message.entityNames && message.entityNames.length) { - object.entityNames = []; - for (var j = 0; j < message.entityNames.length; ++j) - object.entityNames[j] = message.entityNames[j]; - } - return object; - }; - - /** - * Converts this DdlStatementActionInfo to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.DdlStatementActionInfo - * @instance - * @returns {Object.} JSON object - */ - DdlStatementActionInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DdlStatementActionInfo - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.DdlStatementActionInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DdlStatementActionInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.DdlStatementActionInfo"; - }; - - return DdlStatementActionInfo; - })(); - - v1.UpdateDatabaseDdlMetadata = (function() { - - /** - * Properties of an UpdateDatabaseDdlMetadata. - * @memberof google.spanner.admin.database.v1 - * @interface IUpdateDatabaseDdlMetadata - * @property {string|null} [database] UpdateDatabaseDdlMetadata database - * @property {Array.|null} [statements] UpdateDatabaseDdlMetadata statements - * @property {Array.|null} [commitTimestamps] UpdateDatabaseDdlMetadata commitTimestamps - * @property {boolean|null} [throttled] UpdateDatabaseDdlMetadata throttled - * @property {Array.|null} [progress] UpdateDatabaseDdlMetadata progress - * @property {Array.|null} [actions] UpdateDatabaseDdlMetadata actions - */ - - /** - * Constructs a new UpdateDatabaseDdlMetadata. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents an UpdateDatabaseDdlMetadata. - * @implements IUpdateDatabaseDdlMetadata - * @constructor - * @param {google.spanner.admin.database.v1.IUpdateDatabaseDdlMetadata=} [properties] Properties to set - */ - function UpdateDatabaseDdlMetadata(properties) { - this.statements = []; - this.commitTimestamps = []; - this.progress = []; - this.actions = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateDatabaseDdlMetadata database. - * @member {string} database - * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata - * @instance - */ - UpdateDatabaseDdlMetadata.prototype.database = ""; - - /** - * UpdateDatabaseDdlMetadata statements. - * @member {Array.} statements - * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata - * @instance - */ - UpdateDatabaseDdlMetadata.prototype.statements = $util.emptyArray; - - /** - * UpdateDatabaseDdlMetadata commitTimestamps. - * @member {Array.} commitTimestamps - * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata - * @instance - */ - UpdateDatabaseDdlMetadata.prototype.commitTimestamps = $util.emptyArray; - - /** - * UpdateDatabaseDdlMetadata throttled. - * @member {boolean} throttled - * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata - * @instance - */ - UpdateDatabaseDdlMetadata.prototype.throttled = false; - - /** - * UpdateDatabaseDdlMetadata progress. - * @member {Array.} progress - * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata - * @instance - */ - UpdateDatabaseDdlMetadata.prototype.progress = $util.emptyArray; - - /** - * UpdateDatabaseDdlMetadata actions. - * @member {Array.} actions - * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata - * @instance - */ - UpdateDatabaseDdlMetadata.prototype.actions = $util.emptyArray; - - /** - * Creates a new UpdateDatabaseDdlMetadata instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata - * @static - * @param {google.spanner.admin.database.v1.IUpdateDatabaseDdlMetadata=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata} UpdateDatabaseDdlMetadata instance - */ - UpdateDatabaseDdlMetadata.create = function create(properties) { - return new UpdateDatabaseDdlMetadata(properties); - }; - - /** - * Encodes the specified UpdateDatabaseDdlMetadata message. Does not implicitly {@link google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata - * @static - * @param {google.spanner.admin.database.v1.IUpdateDatabaseDdlMetadata} message UpdateDatabaseDdlMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateDatabaseDdlMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.database != null && Object.hasOwnProperty.call(message, "database")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.database); - if (message.statements != null && message.statements.length) - for (var i = 0; i < message.statements.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.statements[i]); - if (message.commitTimestamps != null && message.commitTimestamps.length) - for (var i = 0; i < message.commitTimestamps.length; ++i) - $root.google.protobuf.Timestamp.encode(message.commitTimestamps[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.throttled != null && Object.hasOwnProperty.call(message, "throttled")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.throttled); - if (message.progress != null && message.progress.length) - for (var i = 0; i < message.progress.length; ++i) - $root.google.spanner.admin.database.v1.OperationProgress.encode(message.progress[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.actions != null && message.actions.length) - for (var i = 0; i < message.actions.length; ++i) - $root.google.spanner.admin.database.v1.DdlStatementActionInfo.encode(message.actions[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified UpdateDatabaseDdlMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata - * @static - * @param {google.spanner.admin.database.v1.IUpdateDatabaseDdlMetadata} message UpdateDatabaseDdlMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateDatabaseDdlMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateDatabaseDdlMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata} UpdateDatabaseDdlMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateDatabaseDdlMetadata.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.database = reader.string(); - break; - } - case 2: { - if (!(message.statements && message.statements.length)) - message.statements = []; - message.statements.push(reader.string()); - break; - } - case 3: { - if (!(message.commitTimestamps && message.commitTimestamps.length)) - message.commitTimestamps = []; - message.commitTimestamps.push($root.google.protobuf.Timestamp.decode(reader, reader.uint32())); - break; - } - case 4: { - message.throttled = reader.bool(); - break; - } - case 5: { - if (!(message.progress && message.progress.length)) - message.progress = []; - message.progress.push($root.google.spanner.admin.database.v1.OperationProgress.decode(reader, reader.uint32())); - break; - } - case 6: { - if (!(message.actions && message.actions.length)) - message.actions = []; - message.actions.push($root.google.spanner.admin.database.v1.DdlStatementActionInfo.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateDatabaseDdlMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata} UpdateDatabaseDdlMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateDatabaseDdlMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateDatabaseDdlMetadata message. - * @function verify - * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateDatabaseDdlMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.database != null && message.hasOwnProperty("database")) - if (!$util.isString(message.database)) - return "database: string expected"; - if (message.statements != null && message.hasOwnProperty("statements")) { - if (!Array.isArray(message.statements)) - return "statements: array expected"; - for (var i = 0; i < message.statements.length; ++i) - if (!$util.isString(message.statements[i])) - return "statements: string[] expected"; - } - if (message.commitTimestamps != null && message.hasOwnProperty("commitTimestamps")) { - if (!Array.isArray(message.commitTimestamps)) - return "commitTimestamps: array expected"; - for (var i = 0; i < message.commitTimestamps.length; ++i) { - var error = $root.google.protobuf.Timestamp.verify(message.commitTimestamps[i]); - if (error) - return "commitTimestamps." + error; - } - } - if (message.throttled != null && message.hasOwnProperty("throttled")) - if (typeof message.throttled !== "boolean") - return "throttled: boolean expected"; - if (message.progress != null && message.hasOwnProperty("progress")) { - if (!Array.isArray(message.progress)) - return "progress: array expected"; - for (var i = 0; i < message.progress.length; ++i) { - var error = $root.google.spanner.admin.database.v1.OperationProgress.verify(message.progress[i]); - if (error) - return "progress." + error; - } - } - if (message.actions != null && message.hasOwnProperty("actions")) { - if (!Array.isArray(message.actions)) - return "actions: array expected"; - for (var i = 0; i < message.actions.length; ++i) { - var error = $root.google.spanner.admin.database.v1.DdlStatementActionInfo.verify(message.actions[i]); - if (error) - return "actions." + error; - } - } - return null; - }; - - /** - * Creates an UpdateDatabaseDdlMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata} UpdateDatabaseDdlMetadata - */ - UpdateDatabaseDdlMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata) - return object; - var message = new $root.google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata(); - if (object.database != null) - message.database = String(object.database); - if (object.statements) { - if (!Array.isArray(object.statements)) - throw TypeError(".google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata.statements: array expected"); - message.statements = []; - for (var i = 0; i < object.statements.length; ++i) - message.statements[i] = String(object.statements[i]); - } - if (object.commitTimestamps) { - if (!Array.isArray(object.commitTimestamps)) - throw TypeError(".google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata.commitTimestamps: array expected"); - message.commitTimestamps = []; - for (var i = 0; i < object.commitTimestamps.length; ++i) { - if (typeof object.commitTimestamps[i] !== "object") - throw TypeError(".google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata.commitTimestamps: object expected"); - message.commitTimestamps[i] = $root.google.protobuf.Timestamp.fromObject(object.commitTimestamps[i]); - } - } - if (object.throttled != null) - message.throttled = Boolean(object.throttled); - if (object.progress) { - if (!Array.isArray(object.progress)) - throw TypeError(".google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata.progress: array expected"); - message.progress = []; - for (var i = 0; i < object.progress.length; ++i) { - if (typeof object.progress[i] !== "object") - throw TypeError(".google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata.progress: object expected"); - message.progress[i] = $root.google.spanner.admin.database.v1.OperationProgress.fromObject(object.progress[i]); - } - } - if (object.actions) { - if (!Array.isArray(object.actions)) - throw TypeError(".google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata.actions: array expected"); - message.actions = []; - for (var i = 0; i < object.actions.length; ++i) { - if (typeof object.actions[i] !== "object") - throw TypeError(".google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata.actions: object expected"); - message.actions[i] = $root.google.spanner.admin.database.v1.DdlStatementActionInfo.fromObject(object.actions[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an UpdateDatabaseDdlMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata - * @static - * @param {google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata} message UpdateDatabaseDdlMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateDatabaseDdlMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.statements = []; - object.commitTimestamps = []; - object.progress = []; - object.actions = []; - } - if (options.defaults) { - object.database = ""; - object.throttled = false; - } - if (message.database != null && message.hasOwnProperty("database")) - object.database = message.database; - if (message.statements && message.statements.length) { - object.statements = []; - for (var j = 0; j < message.statements.length; ++j) - object.statements[j] = message.statements[j]; - } - if (message.commitTimestamps && message.commitTimestamps.length) { - object.commitTimestamps = []; - for (var j = 0; j < message.commitTimestamps.length; ++j) - object.commitTimestamps[j] = $root.google.protobuf.Timestamp.toObject(message.commitTimestamps[j], options); - } - if (message.throttled != null && message.hasOwnProperty("throttled")) - object.throttled = message.throttled; - if (message.progress && message.progress.length) { - object.progress = []; - for (var j = 0; j < message.progress.length; ++j) - object.progress[j] = $root.google.spanner.admin.database.v1.OperationProgress.toObject(message.progress[j], options); - } - if (message.actions && message.actions.length) { - object.actions = []; - for (var j = 0; j < message.actions.length; ++j) - object.actions[j] = $root.google.spanner.admin.database.v1.DdlStatementActionInfo.toObject(message.actions[j], options); - } - return object; - }; - - /** - * Converts this UpdateDatabaseDdlMetadata to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata - * @instance - * @returns {Object.} JSON object - */ - UpdateDatabaseDdlMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateDatabaseDdlMetadata - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateDatabaseDdlMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata"; - }; - - return UpdateDatabaseDdlMetadata; - })(); - - v1.DropDatabaseRequest = (function() { - - /** - * Properties of a DropDatabaseRequest. - * @memberof google.spanner.admin.database.v1 - * @interface IDropDatabaseRequest - * @property {string|null} [database] DropDatabaseRequest database - */ - - /** - * Constructs a new DropDatabaseRequest. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents a DropDatabaseRequest. - * @implements IDropDatabaseRequest - * @constructor - * @param {google.spanner.admin.database.v1.IDropDatabaseRequest=} [properties] Properties to set - */ - function DropDatabaseRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DropDatabaseRequest database. - * @member {string} database - * @memberof google.spanner.admin.database.v1.DropDatabaseRequest - * @instance - */ - DropDatabaseRequest.prototype.database = ""; - - /** - * Creates a new DropDatabaseRequest instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.DropDatabaseRequest - * @static - * @param {google.spanner.admin.database.v1.IDropDatabaseRequest=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.DropDatabaseRequest} DropDatabaseRequest instance - */ - DropDatabaseRequest.create = function create(properties) { - return new DropDatabaseRequest(properties); - }; - - /** - * Encodes the specified DropDatabaseRequest message. Does not implicitly {@link google.spanner.admin.database.v1.DropDatabaseRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.DropDatabaseRequest - * @static - * @param {google.spanner.admin.database.v1.IDropDatabaseRequest} message DropDatabaseRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DropDatabaseRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.database != null && Object.hasOwnProperty.call(message, "database")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.database); - return writer; - }; - - /** - * Encodes the specified DropDatabaseRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.DropDatabaseRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.DropDatabaseRequest - * @static - * @param {google.spanner.admin.database.v1.IDropDatabaseRequest} message DropDatabaseRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DropDatabaseRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DropDatabaseRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.DropDatabaseRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.DropDatabaseRequest} DropDatabaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DropDatabaseRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.DropDatabaseRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.database = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DropDatabaseRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.DropDatabaseRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.DropDatabaseRequest} DropDatabaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DropDatabaseRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DropDatabaseRequest message. - * @function verify - * @memberof google.spanner.admin.database.v1.DropDatabaseRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DropDatabaseRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.database != null && message.hasOwnProperty("database")) - if (!$util.isString(message.database)) - return "database: string expected"; - return null; - }; - - /** - * Creates a DropDatabaseRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.DropDatabaseRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.DropDatabaseRequest} DropDatabaseRequest - */ - DropDatabaseRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.DropDatabaseRequest) - return object; - var message = new $root.google.spanner.admin.database.v1.DropDatabaseRequest(); - if (object.database != null) - message.database = String(object.database); - return message; - }; - - /** - * Creates a plain object from a DropDatabaseRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.DropDatabaseRequest - * @static - * @param {google.spanner.admin.database.v1.DropDatabaseRequest} message DropDatabaseRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DropDatabaseRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.database = ""; - if (message.database != null && message.hasOwnProperty("database")) - object.database = message.database; - return object; - }; - - /** - * Converts this DropDatabaseRequest to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.DropDatabaseRequest - * @instance - * @returns {Object.} JSON object - */ - DropDatabaseRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DropDatabaseRequest - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.DropDatabaseRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DropDatabaseRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.DropDatabaseRequest"; - }; - - return DropDatabaseRequest; - })(); - - v1.GetDatabaseDdlRequest = (function() { - - /** - * Properties of a GetDatabaseDdlRequest. - * @memberof google.spanner.admin.database.v1 - * @interface IGetDatabaseDdlRequest - * @property {string|null} [database] GetDatabaseDdlRequest database - */ - - /** - * Constructs a new GetDatabaseDdlRequest. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents a GetDatabaseDdlRequest. - * @implements IGetDatabaseDdlRequest - * @constructor - * @param {google.spanner.admin.database.v1.IGetDatabaseDdlRequest=} [properties] Properties to set - */ - function GetDatabaseDdlRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetDatabaseDdlRequest database. - * @member {string} database - * @memberof google.spanner.admin.database.v1.GetDatabaseDdlRequest - * @instance - */ - GetDatabaseDdlRequest.prototype.database = ""; - - /** - * Creates a new GetDatabaseDdlRequest instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.GetDatabaseDdlRequest - * @static - * @param {google.spanner.admin.database.v1.IGetDatabaseDdlRequest=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.GetDatabaseDdlRequest} GetDatabaseDdlRequest instance - */ - GetDatabaseDdlRequest.create = function create(properties) { - return new GetDatabaseDdlRequest(properties); - }; - - /** - * Encodes the specified GetDatabaseDdlRequest message. Does not implicitly {@link google.spanner.admin.database.v1.GetDatabaseDdlRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.GetDatabaseDdlRequest - * @static - * @param {google.spanner.admin.database.v1.IGetDatabaseDdlRequest} message GetDatabaseDdlRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDatabaseDdlRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.database != null && Object.hasOwnProperty.call(message, "database")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.database); - return writer; - }; - - /** - * Encodes the specified GetDatabaseDdlRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.GetDatabaseDdlRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.GetDatabaseDdlRequest - * @static - * @param {google.spanner.admin.database.v1.IGetDatabaseDdlRequest} message GetDatabaseDdlRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDatabaseDdlRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetDatabaseDdlRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.GetDatabaseDdlRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.GetDatabaseDdlRequest} GetDatabaseDdlRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDatabaseDdlRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.GetDatabaseDdlRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.database = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetDatabaseDdlRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.GetDatabaseDdlRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.GetDatabaseDdlRequest} GetDatabaseDdlRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDatabaseDdlRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetDatabaseDdlRequest message. - * @function verify - * @memberof google.spanner.admin.database.v1.GetDatabaseDdlRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetDatabaseDdlRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.database != null && message.hasOwnProperty("database")) - if (!$util.isString(message.database)) - return "database: string expected"; - return null; - }; - - /** - * Creates a GetDatabaseDdlRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.GetDatabaseDdlRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.GetDatabaseDdlRequest} GetDatabaseDdlRequest - */ - GetDatabaseDdlRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.GetDatabaseDdlRequest) - return object; - var message = new $root.google.spanner.admin.database.v1.GetDatabaseDdlRequest(); - if (object.database != null) - message.database = String(object.database); - return message; - }; - - /** - * Creates a plain object from a GetDatabaseDdlRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.GetDatabaseDdlRequest - * @static - * @param {google.spanner.admin.database.v1.GetDatabaseDdlRequest} message GetDatabaseDdlRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetDatabaseDdlRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.database = ""; - if (message.database != null && message.hasOwnProperty("database")) - object.database = message.database; - return object; - }; - - /** - * Converts this GetDatabaseDdlRequest to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.GetDatabaseDdlRequest - * @instance - * @returns {Object.} JSON object - */ - GetDatabaseDdlRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetDatabaseDdlRequest - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.GetDatabaseDdlRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetDatabaseDdlRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.GetDatabaseDdlRequest"; - }; - - return GetDatabaseDdlRequest; - })(); - - v1.GetDatabaseDdlResponse = (function() { - - /** - * Properties of a GetDatabaseDdlResponse. - * @memberof google.spanner.admin.database.v1 - * @interface IGetDatabaseDdlResponse - * @property {Array.|null} [statements] GetDatabaseDdlResponse statements - * @property {Uint8Array|null} [protoDescriptors] GetDatabaseDdlResponse protoDescriptors - */ - - /** - * Constructs a new GetDatabaseDdlResponse. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents a GetDatabaseDdlResponse. - * @implements IGetDatabaseDdlResponse - * @constructor - * @param {google.spanner.admin.database.v1.IGetDatabaseDdlResponse=} [properties] Properties to set - */ - function GetDatabaseDdlResponse(properties) { - this.statements = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetDatabaseDdlResponse statements. - * @member {Array.} statements - * @memberof google.spanner.admin.database.v1.GetDatabaseDdlResponse - * @instance - */ - GetDatabaseDdlResponse.prototype.statements = $util.emptyArray; - - /** - * GetDatabaseDdlResponse protoDescriptors. - * @member {Uint8Array} protoDescriptors - * @memberof google.spanner.admin.database.v1.GetDatabaseDdlResponse - * @instance - */ - GetDatabaseDdlResponse.prototype.protoDescriptors = $util.newBuffer([]); - - /** - * Creates a new GetDatabaseDdlResponse instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.GetDatabaseDdlResponse - * @static - * @param {google.spanner.admin.database.v1.IGetDatabaseDdlResponse=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.GetDatabaseDdlResponse} GetDatabaseDdlResponse instance - */ - GetDatabaseDdlResponse.create = function create(properties) { - return new GetDatabaseDdlResponse(properties); - }; - - /** - * Encodes the specified GetDatabaseDdlResponse message. Does not implicitly {@link google.spanner.admin.database.v1.GetDatabaseDdlResponse.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.GetDatabaseDdlResponse - * @static - * @param {google.spanner.admin.database.v1.IGetDatabaseDdlResponse} message GetDatabaseDdlResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDatabaseDdlResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.statements != null && message.statements.length) - for (var i = 0; i < message.statements.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.statements[i]); - if (message.protoDescriptors != null && Object.hasOwnProperty.call(message, "protoDescriptors")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.protoDescriptors); - return writer; - }; - - /** - * Encodes the specified GetDatabaseDdlResponse message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.GetDatabaseDdlResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.GetDatabaseDdlResponse - * @static - * @param {google.spanner.admin.database.v1.IGetDatabaseDdlResponse} message GetDatabaseDdlResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDatabaseDdlResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetDatabaseDdlResponse message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.GetDatabaseDdlResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.GetDatabaseDdlResponse} GetDatabaseDdlResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDatabaseDdlResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.GetDatabaseDdlResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.statements && message.statements.length)) - message.statements = []; - message.statements.push(reader.string()); - break; - } - case 2: { - message.protoDescriptors = reader.bytes(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetDatabaseDdlResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.GetDatabaseDdlResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.GetDatabaseDdlResponse} GetDatabaseDdlResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDatabaseDdlResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetDatabaseDdlResponse message. - * @function verify - * @memberof google.spanner.admin.database.v1.GetDatabaseDdlResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetDatabaseDdlResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.statements != null && message.hasOwnProperty("statements")) { - if (!Array.isArray(message.statements)) - return "statements: array expected"; - for (var i = 0; i < message.statements.length; ++i) - if (!$util.isString(message.statements[i])) - return "statements: string[] expected"; - } - if (message.protoDescriptors != null && message.hasOwnProperty("protoDescriptors")) - if (!(message.protoDescriptors && typeof message.protoDescriptors.length === "number" || $util.isString(message.protoDescriptors))) - return "protoDescriptors: buffer expected"; - return null; - }; - - /** - * Creates a GetDatabaseDdlResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.GetDatabaseDdlResponse - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.GetDatabaseDdlResponse} GetDatabaseDdlResponse - */ - GetDatabaseDdlResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.GetDatabaseDdlResponse) - return object; - var message = new $root.google.spanner.admin.database.v1.GetDatabaseDdlResponse(); - if (object.statements) { - if (!Array.isArray(object.statements)) - throw TypeError(".google.spanner.admin.database.v1.GetDatabaseDdlResponse.statements: array expected"); - message.statements = []; - for (var i = 0; i < object.statements.length; ++i) - message.statements[i] = String(object.statements[i]); - } - if (object.protoDescriptors != null) - if (typeof object.protoDescriptors === "string") - $util.base64.decode(object.protoDescriptors, message.protoDescriptors = $util.newBuffer($util.base64.length(object.protoDescriptors)), 0); - else if (object.protoDescriptors.length >= 0) - message.protoDescriptors = object.protoDescriptors; - return message; - }; - - /** - * Creates a plain object from a GetDatabaseDdlResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.GetDatabaseDdlResponse - * @static - * @param {google.spanner.admin.database.v1.GetDatabaseDdlResponse} message GetDatabaseDdlResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetDatabaseDdlResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.statements = []; - if (options.defaults) - if (options.bytes === String) - object.protoDescriptors = ""; - else { - object.protoDescriptors = []; - if (options.bytes !== Array) - object.protoDescriptors = $util.newBuffer(object.protoDescriptors); - } - if (message.statements && message.statements.length) { - object.statements = []; - for (var j = 0; j < message.statements.length; ++j) - object.statements[j] = message.statements[j]; - } - if (message.protoDescriptors != null && message.hasOwnProperty("protoDescriptors")) - object.protoDescriptors = options.bytes === String ? $util.base64.encode(message.protoDescriptors, 0, message.protoDescriptors.length) : options.bytes === Array ? Array.prototype.slice.call(message.protoDescriptors) : message.protoDescriptors; - return object; - }; - - /** - * Converts this GetDatabaseDdlResponse to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.GetDatabaseDdlResponse - * @instance - * @returns {Object.} JSON object - */ - GetDatabaseDdlResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetDatabaseDdlResponse - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.GetDatabaseDdlResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetDatabaseDdlResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.GetDatabaseDdlResponse"; - }; - - return GetDatabaseDdlResponse; - })(); - - v1.ListDatabaseOperationsRequest = (function() { - - /** - * Properties of a ListDatabaseOperationsRequest. - * @memberof google.spanner.admin.database.v1 - * @interface IListDatabaseOperationsRequest - * @property {string|null} [parent] ListDatabaseOperationsRequest parent - * @property {string|null} [filter] ListDatabaseOperationsRequest filter - * @property {number|null} [pageSize] ListDatabaseOperationsRequest pageSize - * @property {string|null} [pageToken] ListDatabaseOperationsRequest pageToken - */ - - /** - * Constructs a new ListDatabaseOperationsRequest. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents a ListDatabaseOperationsRequest. - * @implements IListDatabaseOperationsRequest - * @constructor - * @param {google.spanner.admin.database.v1.IListDatabaseOperationsRequest=} [properties] Properties to set - */ - function ListDatabaseOperationsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListDatabaseOperationsRequest parent. - * @member {string} parent - * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsRequest - * @instance - */ - ListDatabaseOperationsRequest.prototype.parent = ""; - - /** - * ListDatabaseOperationsRequest filter. - * @member {string} filter - * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsRequest - * @instance - */ - ListDatabaseOperationsRequest.prototype.filter = ""; - - /** - * ListDatabaseOperationsRequest pageSize. - * @member {number} pageSize - * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsRequest - * @instance - */ - ListDatabaseOperationsRequest.prototype.pageSize = 0; - - /** - * ListDatabaseOperationsRequest pageToken. - * @member {string} pageToken - * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsRequest - * @instance - */ - ListDatabaseOperationsRequest.prototype.pageToken = ""; - - /** - * Creates a new ListDatabaseOperationsRequest instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsRequest - * @static - * @param {google.spanner.admin.database.v1.IListDatabaseOperationsRequest=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.ListDatabaseOperationsRequest} ListDatabaseOperationsRequest instance - */ - ListDatabaseOperationsRequest.create = function create(properties) { - return new ListDatabaseOperationsRequest(properties); - }; - - /** - * Encodes the specified ListDatabaseOperationsRequest message. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabaseOperationsRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsRequest - * @static - * @param {google.spanner.admin.database.v1.IListDatabaseOperationsRequest} message ListDatabaseOperationsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListDatabaseOperationsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); - return writer; - }; - - /** - * Encodes the specified ListDatabaseOperationsRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabaseOperationsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsRequest - * @static - * @param {google.spanner.admin.database.v1.IListDatabaseOperationsRequest} message ListDatabaseOperationsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListDatabaseOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListDatabaseOperationsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.ListDatabaseOperationsRequest} ListDatabaseOperationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListDatabaseOperationsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.ListDatabaseOperationsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.filter = reader.string(); - break; - } - case 3: { - message.pageSize = reader.int32(); - break; - } - case 4: { - message.pageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListDatabaseOperationsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.ListDatabaseOperationsRequest} ListDatabaseOperationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListDatabaseOperationsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListDatabaseOperationsRequest message. - * @function verify - * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListDatabaseOperationsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.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 ListDatabaseOperationsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.ListDatabaseOperationsRequest} ListDatabaseOperationsRequest - */ - ListDatabaseOperationsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.ListDatabaseOperationsRequest) - return object; - var message = new $root.google.spanner.admin.database.v1.ListDatabaseOperationsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.filter != null) - message.filter = String(object.filter); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - return message; - }; - - /** - * Creates a plain object from a ListDatabaseOperationsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsRequest - * @static - * @param {google.spanner.admin.database.v1.ListDatabaseOperationsRequest} message ListDatabaseOperationsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListDatabaseOperationsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.filter = ""; - object.pageSize = 0; - object.pageToken = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - return object; - }; - - /** - * Converts this ListDatabaseOperationsRequest to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsRequest - * @instance - * @returns {Object.} JSON object - */ - ListDatabaseOperationsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListDatabaseOperationsRequest - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListDatabaseOperationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.ListDatabaseOperationsRequest"; - }; - - return ListDatabaseOperationsRequest; - })(); - - v1.ListDatabaseOperationsResponse = (function() { - - /** - * Properties of a ListDatabaseOperationsResponse. - * @memberof google.spanner.admin.database.v1 - * @interface IListDatabaseOperationsResponse - * @property {Array.|null} [operations] ListDatabaseOperationsResponse operations - * @property {string|null} [nextPageToken] ListDatabaseOperationsResponse nextPageToken - */ - - /** - * Constructs a new ListDatabaseOperationsResponse. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents a ListDatabaseOperationsResponse. - * @implements IListDatabaseOperationsResponse - * @constructor - * @param {google.spanner.admin.database.v1.IListDatabaseOperationsResponse=} [properties] Properties to set - */ - function ListDatabaseOperationsResponse(properties) { - this.operations = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListDatabaseOperationsResponse operations. - * @member {Array.} operations - * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsResponse - * @instance - */ - ListDatabaseOperationsResponse.prototype.operations = $util.emptyArray; - - /** - * ListDatabaseOperationsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsResponse - * @instance - */ - ListDatabaseOperationsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListDatabaseOperationsResponse instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsResponse - * @static - * @param {google.spanner.admin.database.v1.IListDatabaseOperationsResponse=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.ListDatabaseOperationsResponse} ListDatabaseOperationsResponse instance - */ - ListDatabaseOperationsResponse.create = function create(properties) { - return new ListDatabaseOperationsResponse(properties); - }; - - /** - * Encodes the specified ListDatabaseOperationsResponse message. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabaseOperationsResponse.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsResponse - * @static - * @param {google.spanner.admin.database.v1.IListDatabaseOperationsResponse} message ListDatabaseOperationsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListDatabaseOperationsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.operations != null && message.operations.length) - for (var i = 0; i < message.operations.length; ++i) - $root.google.longrunning.Operation.encode(message.operations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - return writer; - }; - - /** - * Encodes the specified ListDatabaseOperationsResponse message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabaseOperationsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsResponse - * @static - * @param {google.spanner.admin.database.v1.IListDatabaseOperationsResponse} message ListDatabaseOperationsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListDatabaseOperationsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListDatabaseOperationsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.ListDatabaseOperationsResponse} ListDatabaseOperationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListDatabaseOperationsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.ListDatabaseOperationsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.operations && message.operations.length)) - message.operations = []; - message.operations.push($root.google.longrunning.Operation.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListDatabaseOperationsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.ListDatabaseOperationsResponse} ListDatabaseOperationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListDatabaseOperationsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListDatabaseOperationsResponse message. - * @function verify - * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListDatabaseOperationsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.operations != null && message.hasOwnProperty("operations")) { - if (!Array.isArray(message.operations)) - return "operations: array expected"; - for (var i = 0; i < message.operations.length; ++i) { - var error = $root.google.longrunning.Operation.verify(message.operations[i]); - if (error) - return "operations." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListDatabaseOperationsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.ListDatabaseOperationsResponse} ListDatabaseOperationsResponse - */ - ListDatabaseOperationsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.ListDatabaseOperationsResponse) - return object; - var message = new $root.google.spanner.admin.database.v1.ListDatabaseOperationsResponse(); - if (object.operations) { - if (!Array.isArray(object.operations)) - throw TypeError(".google.spanner.admin.database.v1.ListDatabaseOperationsResponse.operations: array expected"); - message.operations = []; - for (var i = 0; i < object.operations.length; ++i) { - if (typeof object.operations[i] !== "object") - throw TypeError(".google.spanner.admin.database.v1.ListDatabaseOperationsResponse.operations: object expected"); - message.operations[i] = $root.google.longrunning.Operation.fromObject(object.operations[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListDatabaseOperationsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsResponse - * @static - * @param {google.spanner.admin.database.v1.ListDatabaseOperationsResponse} message ListDatabaseOperationsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListDatabaseOperationsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.operations = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.operations && message.operations.length) { - object.operations = []; - for (var j = 0; j < message.operations.length; ++j) - object.operations[j] = $root.google.longrunning.Operation.toObject(message.operations[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListDatabaseOperationsResponse to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsResponse - * @instance - * @returns {Object.} JSON object - */ - ListDatabaseOperationsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListDatabaseOperationsResponse - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListDatabaseOperationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.ListDatabaseOperationsResponse"; - }; - - return ListDatabaseOperationsResponse; - })(); - - v1.RestoreDatabaseRequest = (function() { - - /** - * Properties of a RestoreDatabaseRequest. - * @memberof google.spanner.admin.database.v1 - * @interface IRestoreDatabaseRequest - * @property {string|null} [parent] RestoreDatabaseRequest parent - * @property {string|null} [databaseId] RestoreDatabaseRequest databaseId - * @property {string|null} [backup] RestoreDatabaseRequest backup - * @property {google.spanner.admin.database.v1.IRestoreDatabaseEncryptionConfig|null} [encryptionConfig] RestoreDatabaseRequest encryptionConfig - */ - - /** - * Constructs a new RestoreDatabaseRequest. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents a RestoreDatabaseRequest. - * @implements IRestoreDatabaseRequest - * @constructor - * @param {google.spanner.admin.database.v1.IRestoreDatabaseRequest=} [properties] Properties to set - */ - function RestoreDatabaseRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RestoreDatabaseRequest parent. - * @member {string} parent - * @memberof google.spanner.admin.database.v1.RestoreDatabaseRequest - * @instance - */ - RestoreDatabaseRequest.prototype.parent = ""; - - /** - * RestoreDatabaseRequest databaseId. - * @member {string} databaseId - * @memberof google.spanner.admin.database.v1.RestoreDatabaseRequest - * @instance - */ - RestoreDatabaseRequest.prototype.databaseId = ""; - - /** - * RestoreDatabaseRequest backup. - * @member {string|null|undefined} backup - * @memberof google.spanner.admin.database.v1.RestoreDatabaseRequest - * @instance - */ - RestoreDatabaseRequest.prototype.backup = null; - - /** - * RestoreDatabaseRequest encryptionConfig. - * @member {google.spanner.admin.database.v1.IRestoreDatabaseEncryptionConfig|null|undefined} encryptionConfig - * @memberof google.spanner.admin.database.v1.RestoreDatabaseRequest - * @instance - */ - RestoreDatabaseRequest.prototype.encryptionConfig = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * RestoreDatabaseRequest source. - * @member {"backup"|undefined} source - * @memberof google.spanner.admin.database.v1.RestoreDatabaseRequest - * @instance - */ - Object.defineProperty(RestoreDatabaseRequest.prototype, "source", { - get: $util.oneOfGetter($oneOfFields = ["backup"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new RestoreDatabaseRequest instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.RestoreDatabaseRequest - * @static - * @param {google.spanner.admin.database.v1.IRestoreDatabaseRequest=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.RestoreDatabaseRequest} RestoreDatabaseRequest instance - */ - RestoreDatabaseRequest.create = function create(properties) { - return new RestoreDatabaseRequest(properties); - }; - - /** - * Encodes the specified RestoreDatabaseRequest message. Does not implicitly {@link google.spanner.admin.database.v1.RestoreDatabaseRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.RestoreDatabaseRequest - * @static - * @param {google.spanner.admin.database.v1.IRestoreDatabaseRequest} message RestoreDatabaseRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RestoreDatabaseRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.databaseId != null && Object.hasOwnProperty.call(message, "databaseId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.databaseId); - if (message.backup != null && Object.hasOwnProperty.call(message, "backup")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.backup); - if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) - $root.google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified RestoreDatabaseRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.RestoreDatabaseRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.RestoreDatabaseRequest - * @static - * @param {google.spanner.admin.database.v1.IRestoreDatabaseRequest} message RestoreDatabaseRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RestoreDatabaseRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RestoreDatabaseRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.RestoreDatabaseRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.RestoreDatabaseRequest} RestoreDatabaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RestoreDatabaseRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.RestoreDatabaseRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.databaseId = reader.string(); - break; - } - case 3: { - message.backup = reader.string(); - break; - } - case 4: { - message.encryptionConfig = $root.google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RestoreDatabaseRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.RestoreDatabaseRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.RestoreDatabaseRequest} RestoreDatabaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RestoreDatabaseRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RestoreDatabaseRequest message. - * @function verify - * @memberof google.spanner.admin.database.v1.RestoreDatabaseRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RestoreDatabaseRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.databaseId != null && message.hasOwnProperty("databaseId")) - if (!$util.isString(message.databaseId)) - return "databaseId: string expected"; - if (message.backup != null && message.hasOwnProperty("backup")) { - properties.source = 1; - if (!$util.isString(message.backup)) - return "backup: string expected"; - } - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { - var error = $root.google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.verify(message.encryptionConfig); - if (error) - return "encryptionConfig." + error; - } - return null; - }; - - /** - * Creates a RestoreDatabaseRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.RestoreDatabaseRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.RestoreDatabaseRequest} RestoreDatabaseRequest - */ - RestoreDatabaseRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.RestoreDatabaseRequest) - return object; - var message = new $root.google.spanner.admin.database.v1.RestoreDatabaseRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.databaseId != null) - message.databaseId = String(object.databaseId); - if (object.backup != null) - message.backup = String(object.backup); - if (object.encryptionConfig != null) { - if (typeof object.encryptionConfig !== "object") - throw TypeError(".google.spanner.admin.database.v1.RestoreDatabaseRequest.encryptionConfig: object expected"); - message.encryptionConfig = $root.google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.fromObject(object.encryptionConfig); - } - return message; - }; - - /** - * Creates a plain object from a RestoreDatabaseRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.RestoreDatabaseRequest - * @static - * @param {google.spanner.admin.database.v1.RestoreDatabaseRequest} message RestoreDatabaseRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RestoreDatabaseRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.databaseId = ""; - object.encryptionConfig = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.databaseId != null && message.hasOwnProperty("databaseId")) - object.databaseId = message.databaseId; - if (message.backup != null && message.hasOwnProperty("backup")) { - object.backup = message.backup; - if (options.oneofs) - object.source = "backup"; - } - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) - object.encryptionConfig = $root.google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.toObject(message.encryptionConfig, options); - return object; - }; - - /** - * Converts this RestoreDatabaseRequest to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.RestoreDatabaseRequest - * @instance - * @returns {Object.} JSON object - */ - RestoreDatabaseRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RestoreDatabaseRequest - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.RestoreDatabaseRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RestoreDatabaseRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.RestoreDatabaseRequest"; - }; - - return RestoreDatabaseRequest; - })(); - - v1.RestoreDatabaseEncryptionConfig = (function() { - - /** - * Properties of a RestoreDatabaseEncryptionConfig. - * @memberof google.spanner.admin.database.v1 - * @interface IRestoreDatabaseEncryptionConfig - * @property {google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.EncryptionType|null} [encryptionType] RestoreDatabaseEncryptionConfig encryptionType - * @property {string|null} [kmsKeyName] RestoreDatabaseEncryptionConfig kmsKeyName - * @property {Array.|null} [kmsKeyNames] RestoreDatabaseEncryptionConfig kmsKeyNames - */ - - /** - * Constructs a new RestoreDatabaseEncryptionConfig. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents a RestoreDatabaseEncryptionConfig. - * @implements IRestoreDatabaseEncryptionConfig - * @constructor - * @param {google.spanner.admin.database.v1.IRestoreDatabaseEncryptionConfig=} [properties] Properties to set - */ - function RestoreDatabaseEncryptionConfig(properties) { - this.kmsKeyNames = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RestoreDatabaseEncryptionConfig encryptionType. - * @member {google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.EncryptionType} encryptionType - * @memberof google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig - * @instance - */ - RestoreDatabaseEncryptionConfig.prototype.encryptionType = 0; - - /** - * RestoreDatabaseEncryptionConfig kmsKeyName. - * @member {string} kmsKeyName - * @memberof google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig - * @instance - */ - RestoreDatabaseEncryptionConfig.prototype.kmsKeyName = ""; - - /** - * RestoreDatabaseEncryptionConfig kmsKeyNames. - * @member {Array.} kmsKeyNames - * @memberof google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig - * @instance - */ - RestoreDatabaseEncryptionConfig.prototype.kmsKeyNames = $util.emptyArray; - - /** - * Creates a new RestoreDatabaseEncryptionConfig instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig - * @static - * @param {google.spanner.admin.database.v1.IRestoreDatabaseEncryptionConfig=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig} RestoreDatabaseEncryptionConfig instance - */ - RestoreDatabaseEncryptionConfig.create = function create(properties) { - return new RestoreDatabaseEncryptionConfig(properties); - }; - - /** - * Encodes the specified RestoreDatabaseEncryptionConfig message. Does not implicitly {@link google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig - * @static - * @param {google.spanner.admin.database.v1.IRestoreDatabaseEncryptionConfig} message RestoreDatabaseEncryptionConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RestoreDatabaseEncryptionConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.encryptionType != null && Object.hasOwnProperty.call(message, "encryptionType")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.encryptionType); - if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.kmsKeyName); - if (message.kmsKeyNames != null && message.kmsKeyNames.length) - for (var i = 0; i < message.kmsKeyNames.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.kmsKeyNames[i]); - return writer; - }; - - /** - * Encodes the specified RestoreDatabaseEncryptionConfig message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig - * @static - * @param {google.spanner.admin.database.v1.IRestoreDatabaseEncryptionConfig} message RestoreDatabaseEncryptionConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RestoreDatabaseEncryptionConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RestoreDatabaseEncryptionConfig message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig} RestoreDatabaseEncryptionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RestoreDatabaseEncryptionConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.encryptionType = reader.int32(); - break; - } - case 2: { - message.kmsKeyName = reader.string(); - break; - } - case 3: { - if (!(message.kmsKeyNames && message.kmsKeyNames.length)) - message.kmsKeyNames = []; - message.kmsKeyNames.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RestoreDatabaseEncryptionConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig} RestoreDatabaseEncryptionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RestoreDatabaseEncryptionConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RestoreDatabaseEncryptionConfig message. - * @function verify - * @memberof google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RestoreDatabaseEncryptionConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.encryptionType != null && message.hasOwnProperty("encryptionType")) - switch (message.encryptionType) { - default: - return "encryptionType: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) - if (!$util.isString(message.kmsKeyName)) - return "kmsKeyName: string expected"; - if (message.kmsKeyNames != null && message.hasOwnProperty("kmsKeyNames")) { - if (!Array.isArray(message.kmsKeyNames)) - return "kmsKeyNames: array expected"; - for (var i = 0; i < message.kmsKeyNames.length; ++i) - if (!$util.isString(message.kmsKeyNames[i])) - return "kmsKeyNames: string[] expected"; - } - return null; - }; - - /** - * Creates a RestoreDatabaseEncryptionConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig} RestoreDatabaseEncryptionConfig - */ - RestoreDatabaseEncryptionConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig) - return object; - var message = new $root.google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig(); - switch (object.encryptionType) { - default: - if (typeof object.encryptionType === "number") { - message.encryptionType = object.encryptionType; - break; - } - break; - case "ENCRYPTION_TYPE_UNSPECIFIED": - case 0: - message.encryptionType = 0; - break; - case "USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION": - case 1: - message.encryptionType = 1; - break; - case "GOOGLE_DEFAULT_ENCRYPTION": - case 2: - message.encryptionType = 2; - break; - case "CUSTOMER_MANAGED_ENCRYPTION": - case 3: - message.encryptionType = 3; - break; - } - if (object.kmsKeyName != null) - message.kmsKeyName = String(object.kmsKeyName); - if (object.kmsKeyNames) { - if (!Array.isArray(object.kmsKeyNames)) - throw TypeError(".google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.kmsKeyNames: array expected"); - message.kmsKeyNames = []; - for (var i = 0; i < object.kmsKeyNames.length; ++i) - message.kmsKeyNames[i] = String(object.kmsKeyNames[i]); - } - return message; - }; - - /** - * Creates a plain object from a RestoreDatabaseEncryptionConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig - * @static - * @param {google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig} message RestoreDatabaseEncryptionConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RestoreDatabaseEncryptionConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.kmsKeyNames = []; - if (options.defaults) { - object.encryptionType = options.enums === String ? "ENCRYPTION_TYPE_UNSPECIFIED" : 0; - object.kmsKeyName = ""; - } - if (message.encryptionType != null && message.hasOwnProperty("encryptionType")) - object.encryptionType = options.enums === String ? $root.google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.EncryptionType[message.encryptionType] === undefined ? message.encryptionType : $root.google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.EncryptionType[message.encryptionType] : message.encryptionType; - if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) - object.kmsKeyName = message.kmsKeyName; - if (message.kmsKeyNames && message.kmsKeyNames.length) { - object.kmsKeyNames = []; - for (var j = 0; j < message.kmsKeyNames.length; ++j) - object.kmsKeyNames[j] = message.kmsKeyNames[j]; - } - return object; - }; - - /** - * Converts this RestoreDatabaseEncryptionConfig to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig - * @instance - * @returns {Object.} JSON object - */ - RestoreDatabaseEncryptionConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RestoreDatabaseEncryptionConfig - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RestoreDatabaseEncryptionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig"; - }; - - /** - * EncryptionType enum. - * @name google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.EncryptionType - * @enum {number} - * @property {number} ENCRYPTION_TYPE_UNSPECIFIED=0 ENCRYPTION_TYPE_UNSPECIFIED value - * @property {number} USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION=1 USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION value - * @property {number} GOOGLE_DEFAULT_ENCRYPTION=2 GOOGLE_DEFAULT_ENCRYPTION value - * @property {number} CUSTOMER_MANAGED_ENCRYPTION=3 CUSTOMER_MANAGED_ENCRYPTION value - */ - RestoreDatabaseEncryptionConfig.EncryptionType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ENCRYPTION_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION"] = 1; - values[valuesById[2] = "GOOGLE_DEFAULT_ENCRYPTION"] = 2; - values[valuesById[3] = "CUSTOMER_MANAGED_ENCRYPTION"] = 3; - return values; - })(); - - return RestoreDatabaseEncryptionConfig; - })(); - - v1.RestoreDatabaseMetadata = (function() { - - /** - * Properties of a RestoreDatabaseMetadata. - * @memberof google.spanner.admin.database.v1 - * @interface IRestoreDatabaseMetadata - * @property {string|null} [name] RestoreDatabaseMetadata name - * @property {google.spanner.admin.database.v1.RestoreSourceType|null} [sourceType] RestoreDatabaseMetadata sourceType - * @property {google.spanner.admin.database.v1.IBackupInfo|null} [backupInfo] RestoreDatabaseMetadata backupInfo - * @property {google.spanner.admin.database.v1.IOperationProgress|null} [progress] RestoreDatabaseMetadata progress - * @property {google.protobuf.ITimestamp|null} [cancelTime] RestoreDatabaseMetadata cancelTime - * @property {string|null} [optimizeDatabaseOperationName] RestoreDatabaseMetadata optimizeDatabaseOperationName - */ - - /** - * Constructs a new RestoreDatabaseMetadata. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents a RestoreDatabaseMetadata. - * @implements IRestoreDatabaseMetadata - * @constructor - * @param {google.spanner.admin.database.v1.IRestoreDatabaseMetadata=} [properties] Properties to set - */ - function RestoreDatabaseMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RestoreDatabaseMetadata name. - * @member {string} name - * @memberof google.spanner.admin.database.v1.RestoreDatabaseMetadata - * @instance - */ - RestoreDatabaseMetadata.prototype.name = ""; - - /** - * RestoreDatabaseMetadata sourceType. - * @member {google.spanner.admin.database.v1.RestoreSourceType} sourceType - * @memberof google.spanner.admin.database.v1.RestoreDatabaseMetadata - * @instance - */ - RestoreDatabaseMetadata.prototype.sourceType = 0; - - /** - * RestoreDatabaseMetadata backupInfo. - * @member {google.spanner.admin.database.v1.IBackupInfo|null|undefined} backupInfo - * @memberof google.spanner.admin.database.v1.RestoreDatabaseMetadata - * @instance - */ - RestoreDatabaseMetadata.prototype.backupInfo = null; - - /** - * RestoreDatabaseMetadata progress. - * @member {google.spanner.admin.database.v1.IOperationProgress|null|undefined} progress - * @memberof google.spanner.admin.database.v1.RestoreDatabaseMetadata - * @instance - */ - RestoreDatabaseMetadata.prototype.progress = null; - - /** - * RestoreDatabaseMetadata cancelTime. - * @member {google.protobuf.ITimestamp|null|undefined} cancelTime - * @memberof google.spanner.admin.database.v1.RestoreDatabaseMetadata - * @instance - */ - RestoreDatabaseMetadata.prototype.cancelTime = null; - - /** - * RestoreDatabaseMetadata optimizeDatabaseOperationName. - * @member {string} optimizeDatabaseOperationName - * @memberof google.spanner.admin.database.v1.RestoreDatabaseMetadata - * @instance - */ - RestoreDatabaseMetadata.prototype.optimizeDatabaseOperationName = ""; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * RestoreDatabaseMetadata sourceInfo. - * @member {"backupInfo"|undefined} sourceInfo - * @memberof google.spanner.admin.database.v1.RestoreDatabaseMetadata - * @instance - */ - Object.defineProperty(RestoreDatabaseMetadata.prototype, "sourceInfo", { - get: $util.oneOfGetter($oneOfFields = ["backupInfo"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new RestoreDatabaseMetadata instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.RestoreDatabaseMetadata - * @static - * @param {google.spanner.admin.database.v1.IRestoreDatabaseMetadata=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.RestoreDatabaseMetadata} RestoreDatabaseMetadata instance - */ - RestoreDatabaseMetadata.create = function create(properties) { - return new RestoreDatabaseMetadata(properties); - }; - - /** - * Encodes the specified RestoreDatabaseMetadata message. Does not implicitly {@link google.spanner.admin.database.v1.RestoreDatabaseMetadata.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.RestoreDatabaseMetadata - * @static - * @param {google.spanner.admin.database.v1.IRestoreDatabaseMetadata} message RestoreDatabaseMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RestoreDatabaseMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.sourceType != null && Object.hasOwnProperty.call(message, "sourceType")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.sourceType); - if (message.backupInfo != null && Object.hasOwnProperty.call(message, "backupInfo")) - $root.google.spanner.admin.database.v1.BackupInfo.encode(message.backupInfo, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.progress != null && Object.hasOwnProperty.call(message, "progress")) - $root.google.spanner.admin.database.v1.OperationProgress.encode(message.progress, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.cancelTime != null && Object.hasOwnProperty.call(message, "cancelTime")) - $root.google.protobuf.Timestamp.encode(message.cancelTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.optimizeDatabaseOperationName != null && Object.hasOwnProperty.call(message, "optimizeDatabaseOperationName")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.optimizeDatabaseOperationName); - return writer; - }; - - /** - * Encodes the specified RestoreDatabaseMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.RestoreDatabaseMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.RestoreDatabaseMetadata - * @static - * @param {google.spanner.admin.database.v1.IRestoreDatabaseMetadata} message RestoreDatabaseMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RestoreDatabaseMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RestoreDatabaseMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.RestoreDatabaseMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.RestoreDatabaseMetadata} RestoreDatabaseMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RestoreDatabaseMetadata.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.RestoreDatabaseMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.sourceType = reader.int32(); - break; - } - case 3: { - message.backupInfo = $root.google.spanner.admin.database.v1.BackupInfo.decode(reader, reader.uint32()); - break; - } - case 4: { - message.progress = $root.google.spanner.admin.database.v1.OperationProgress.decode(reader, reader.uint32()); - break; - } - case 5: { - message.cancelTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 6: { - message.optimizeDatabaseOperationName = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RestoreDatabaseMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.RestoreDatabaseMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.RestoreDatabaseMetadata} RestoreDatabaseMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RestoreDatabaseMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RestoreDatabaseMetadata message. - * @function verify - * @memberof google.spanner.admin.database.v1.RestoreDatabaseMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RestoreDatabaseMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.sourceType != null && message.hasOwnProperty("sourceType")) - switch (message.sourceType) { - default: - return "sourceType: enum value expected"; - case 0: - case 1: - break; - } - if (message.backupInfo != null && message.hasOwnProperty("backupInfo")) { - properties.sourceInfo = 1; - { - var error = $root.google.spanner.admin.database.v1.BackupInfo.verify(message.backupInfo); - if (error) - return "backupInfo." + error; - } - } - if (message.progress != null && message.hasOwnProperty("progress")) { - var error = $root.google.spanner.admin.database.v1.OperationProgress.verify(message.progress); - if (error) - return "progress." + error; - } - if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.cancelTime); - if (error) - return "cancelTime." + error; - } - if (message.optimizeDatabaseOperationName != null && message.hasOwnProperty("optimizeDatabaseOperationName")) - if (!$util.isString(message.optimizeDatabaseOperationName)) - return "optimizeDatabaseOperationName: string expected"; - return null; - }; - - /** - * Creates a RestoreDatabaseMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.RestoreDatabaseMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.RestoreDatabaseMetadata} RestoreDatabaseMetadata - */ - RestoreDatabaseMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.RestoreDatabaseMetadata) - return object; - var message = new $root.google.spanner.admin.database.v1.RestoreDatabaseMetadata(); - if (object.name != null) - message.name = String(object.name); - switch (object.sourceType) { - default: - if (typeof object.sourceType === "number") { - message.sourceType = object.sourceType; - break; - } - break; - case "TYPE_UNSPECIFIED": - case 0: - message.sourceType = 0; - break; - case "BACKUP": - case 1: - message.sourceType = 1; - break; - } - if (object.backupInfo != null) { - if (typeof object.backupInfo !== "object") - throw TypeError(".google.spanner.admin.database.v1.RestoreDatabaseMetadata.backupInfo: object expected"); - message.backupInfo = $root.google.spanner.admin.database.v1.BackupInfo.fromObject(object.backupInfo); - } - if (object.progress != null) { - if (typeof object.progress !== "object") - throw TypeError(".google.spanner.admin.database.v1.RestoreDatabaseMetadata.progress: object expected"); - message.progress = $root.google.spanner.admin.database.v1.OperationProgress.fromObject(object.progress); - } - if (object.cancelTime != null) { - if (typeof object.cancelTime !== "object") - throw TypeError(".google.spanner.admin.database.v1.RestoreDatabaseMetadata.cancelTime: object expected"); - message.cancelTime = $root.google.protobuf.Timestamp.fromObject(object.cancelTime); - } - if (object.optimizeDatabaseOperationName != null) - message.optimizeDatabaseOperationName = String(object.optimizeDatabaseOperationName); - return message; - }; - - /** - * Creates a plain object from a RestoreDatabaseMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.RestoreDatabaseMetadata - * @static - * @param {google.spanner.admin.database.v1.RestoreDatabaseMetadata} message RestoreDatabaseMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RestoreDatabaseMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.sourceType = options.enums === String ? "TYPE_UNSPECIFIED" : 0; - object.progress = null; - object.cancelTime = null; - object.optimizeDatabaseOperationName = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.sourceType != null && message.hasOwnProperty("sourceType")) - object.sourceType = options.enums === String ? $root.google.spanner.admin.database.v1.RestoreSourceType[message.sourceType] === undefined ? message.sourceType : $root.google.spanner.admin.database.v1.RestoreSourceType[message.sourceType] : message.sourceType; - if (message.backupInfo != null && message.hasOwnProperty("backupInfo")) { - object.backupInfo = $root.google.spanner.admin.database.v1.BackupInfo.toObject(message.backupInfo, options); - if (options.oneofs) - object.sourceInfo = "backupInfo"; - } - if (message.progress != null && message.hasOwnProperty("progress")) - object.progress = $root.google.spanner.admin.database.v1.OperationProgress.toObject(message.progress, options); - if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) - object.cancelTime = $root.google.protobuf.Timestamp.toObject(message.cancelTime, options); - if (message.optimizeDatabaseOperationName != null && message.hasOwnProperty("optimizeDatabaseOperationName")) - object.optimizeDatabaseOperationName = message.optimizeDatabaseOperationName; - return object; - }; - - /** - * Converts this RestoreDatabaseMetadata to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.RestoreDatabaseMetadata - * @instance - * @returns {Object.} JSON object - */ - RestoreDatabaseMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RestoreDatabaseMetadata - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.RestoreDatabaseMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RestoreDatabaseMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.RestoreDatabaseMetadata"; - }; - - return RestoreDatabaseMetadata; - })(); - - v1.OptimizeRestoredDatabaseMetadata = (function() { - - /** - * Properties of an OptimizeRestoredDatabaseMetadata. - * @memberof google.spanner.admin.database.v1 - * @interface IOptimizeRestoredDatabaseMetadata - * @property {string|null} [name] OptimizeRestoredDatabaseMetadata name - * @property {google.spanner.admin.database.v1.IOperationProgress|null} [progress] OptimizeRestoredDatabaseMetadata progress - */ - - /** - * Constructs a new OptimizeRestoredDatabaseMetadata. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents an OptimizeRestoredDatabaseMetadata. - * @implements IOptimizeRestoredDatabaseMetadata - * @constructor - * @param {google.spanner.admin.database.v1.IOptimizeRestoredDatabaseMetadata=} [properties] Properties to set - */ - function OptimizeRestoredDatabaseMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * OptimizeRestoredDatabaseMetadata name. - * @member {string} name - * @memberof google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata - * @instance - */ - OptimizeRestoredDatabaseMetadata.prototype.name = ""; - - /** - * OptimizeRestoredDatabaseMetadata progress. - * @member {google.spanner.admin.database.v1.IOperationProgress|null|undefined} progress - * @memberof google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata - * @instance - */ - OptimizeRestoredDatabaseMetadata.prototype.progress = null; - - /** - * Creates a new OptimizeRestoredDatabaseMetadata instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata - * @static - * @param {google.spanner.admin.database.v1.IOptimizeRestoredDatabaseMetadata=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata} OptimizeRestoredDatabaseMetadata instance - */ - OptimizeRestoredDatabaseMetadata.create = function create(properties) { - return new OptimizeRestoredDatabaseMetadata(properties); - }; - - /** - * Encodes the specified OptimizeRestoredDatabaseMetadata message. Does not implicitly {@link google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata - * @static - * @param {google.spanner.admin.database.v1.IOptimizeRestoredDatabaseMetadata} message OptimizeRestoredDatabaseMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OptimizeRestoredDatabaseMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.progress != null && Object.hasOwnProperty.call(message, "progress")) - $root.google.spanner.admin.database.v1.OperationProgress.encode(message.progress, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified OptimizeRestoredDatabaseMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata - * @static - * @param {google.spanner.admin.database.v1.IOptimizeRestoredDatabaseMetadata} message OptimizeRestoredDatabaseMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OptimizeRestoredDatabaseMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OptimizeRestoredDatabaseMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata} OptimizeRestoredDatabaseMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OptimizeRestoredDatabaseMetadata.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.progress = $root.google.spanner.admin.database.v1.OperationProgress.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OptimizeRestoredDatabaseMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata} OptimizeRestoredDatabaseMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OptimizeRestoredDatabaseMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OptimizeRestoredDatabaseMetadata message. - * @function verify - * @memberof google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OptimizeRestoredDatabaseMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.progress != null && message.hasOwnProperty("progress")) { - var error = $root.google.spanner.admin.database.v1.OperationProgress.verify(message.progress); - if (error) - return "progress." + error; - } - return null; - }; - - /** - * Creates an OptimizeRestoredDatabaseMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata} OptimizeRestoredDatabaseMetadata - */ - OptimizeRestoredDatabaseMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata) - return object; - var message = new $root.google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata(); - if (object.name != null) - message.name = String(object.name); - if (object.progress != null) { - if (typeof object.progress !== "object") - throw TypeError(".google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata.progress: object expected"); - message.progress = $root.google.spanner.admin.database.v1.OperationProgress.fromObject(object.progress); - } - return message; - }; - - /** - * Creates a plain object from an OptimizeRestoredDatabaseMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata - * @static - * @param {google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata} message OptimizeRestoredDatabaseMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OptimizeRestoredDatabaseMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.progress = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.progress != null && message.hasOwnProperty("progress")) - object.progress = $root.google.spanner.admin.database.v1.OperationProgress.toObject(message.progress, options); - return object; - }; - - /** - * Converts this OptimizeRestoredDatabaseMetadata to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata - * @instance - * @returns {Object.} JSON object - */ - OptimizeRestoredDatabaseMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OptimizeRestoredDatabaseMetadata - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OptimizeRestoredDatabaseMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata"; - }; - - return OptimizeRestoredDatabaseMetadata; - })(); - - /** - * RestoreSourceType enum. - * @name google.spanner.admin.database.v1.RestoreSourceType - * @enum {number} - * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value - * @property {number} BACKUP=1 BACKUP value - */ - v1.RestoreSourceType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "BACKUP"] = 1; - return values; - })(); - - v1.DatabaseRole = (function() { - - /** - * Properties of a DatabaseRole. - * @memberof google.spanner.admin.database.v1 - * @interface IDatabaseRole - * @property {string|null} [name] DatabaseRole name - */ - - /** - * Constructs a new DatabaseRole. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents a DatabaseRole. - * @implements IDatabaseRole - * @constructor - * @param {google.spanner.admin.database.v1.IDatabaseRole=} [properties] Properties to set - */ - function DatabaseRole(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DatabaseRole name. - * @member {string} name - * @memberof google.spanner.admin.database.v1.DatabaseRole - * @instance - */ - DatabaseRole.prototype.name = ""; - - /** - * Creates a new DatabaseRole instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.DatabaseRole - * @static - * @param {google.spanner.admin.database.v1.IDatabaseRole=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.DatabaseRole} DatabaseRole instance - */ - DatabaseRole.create = function create(properties) { - return new DatabaseRole(properties); - }; - - /** - * Encodes the specified DatabaseRole message. Does not implicitly {@link google.spanner.admin.database.v1.DatabaseRole.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.DatabaseRole - * @static - * @param {google.spanner.admin.database.v1.IDatabaseRole} message DatabaseRole message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DatabaseRole.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; - - /** - * Encodes the specified DatabaseRole message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.DatabaseRole.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.DatabaseRole - * @static - * @param {google.spanner.admin.database.v1.IDatabaseRole} message DatabaseRole message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DatabaseRole.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DatabaseRole message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.DatabaseRole - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.DatabaseRole} DatabaseRole - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DatabaseRole.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.DatabaseRole(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DatabaseRole message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.DatabaseRole - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.DatabaseRole} DatabaseRole - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DatabaseRole.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DatabaseRole message. - * @function verify - * @memberof google.spanner.admin.database.v1.DatabaseRole - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DatabaseRole.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 DatabaseRole message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.DatabaseRole - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.DatabaseRole} DatabaseRole - */ - DatabaseRole.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.DatabaseRole) - return object; - var message = new $root.google.spanner.admin.database.v1.DatabaseRole(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a DatabaseRole message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.DatabaseRole - * @static - * @param {google.spanner.admin.database.v1.DatabaseRole} message DatabaseRole - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DatabaseRole.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 DatabaseRole to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.DatabaseRole - * @instance - * @returns {Object.} JSON object - */ - DatabaseRole.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DatabaseRole - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.DatabaseRole - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DatabaseRole.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.DatabaseRole"; - }; - - return DatabaseRole; - })(); - - v1.ListDatabaseRolesRequest = (function() { - - /** - * Properties of a ListDatabaseRolesRequest. - * @memberof google.spanner.admin.database.v1 - * @interface IListDatabaseRolesRequest - * @property {string|null} [parent] ListDatabaseRolesRequest parent - * @property {number|null} [pageSize] ListDatabaseRolesRequest pageSize - * @property {string|null} [pageToken] ListDatabaseRolesRequest pageToken - */ - - /** - * Constructs a new ListDatabaseRolesRequest. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents a ListDatabaseRolesRequest. - * @implements IListDatabaseRolesRequest - * @constructor - * @param {google.spanner.admin.database.v1.IListDatabaseRolesRequest=} [properties] Properties to set - */ - function ListDatabaseRolesRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListDatabaseRolesRequest parent. - * @member {string} parent - * @memberof google.spanner.admin.database.v1.ListDatabaseRolesRequest - * @instance - */ - ListDatabaseRolesRequest.prototype.parent = ""; - - /** - * ListDatabaseRolesRequest pageSize. - * @member {number} pageSize - * @memberof google.spanner.admin.database.v1.ListDatabaseRolesRequest - * @instance - */ - ListDatabaseRolesRequest.prototype.pageSize = 0; - - /** - * ListDatabaseRolesRequest pageToken. - * @member {string} pageToken - * @memberof google.spanner.admin.database.v1.ListDatabaseRolesRequest - * @instance - */ - ListDatabaseRolesRequest.prototype.pageToken = ""; - - /** - * Creates a new ListDatabaseRolesRequest instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.ListDatabaseRolesRequest - * @static - * @param {google.spanner.admin.database.v1.IListDatabaseRolesRequest=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.ListDatabaseRolesRequest} ListDatabaseRolesRequest instance - */ - ListDatabaseRolesRequest.create = function create(properties) { - return new ListDatabaseRolesRequest(properties); - }; - - /** - * Encodes the specified ListDatabaseRolesRequest message. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabaseRolesRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.ListDatabaseRolesRequest - * @static - * @param {google.spanner.admin.database.v1.IListDatabaseRolesRequest} message ListDatabaseRolesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListDatabaseRolesRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - return writer; - }; - - /** - * Encodes the specified ListDatabaseRolesRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabaseRolesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.ListDatabaseRolesRequest - * @static - * @param {google.spanner.admin.database.v1.IListDatabaseRolesRequest} message ListDatabaseRolesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListDatabaseRolesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListDatabaseRolesRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.ListDatabaseRolesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.ListDatabaseRolesRequest} ListDatabaseRolesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListDatabaseRolesRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.ListDatabaseRolesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListDatabaseRolesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.ListDatabaseRolesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.ListDatabaseRolesRequest} ListDatabaseRolesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListDatabaseRolesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListDatabaseRolesRequest message. - * @function verify - * @memberof google.spanner.admin.database.v1.ListDatabaseRolesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListDatabaseRolesRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - return null; - }; - - /** - * Creates a ListDatabaseRolesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.ListDatabaseRolesRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.ListDatabaseRolesRequest} ListDatabaseRolesRequest - */ - ListDatabaseRolesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.ListDatabaseRolesRequest) - return object; - var message = new $root.google.spanner.admin.database.v1.ListDatabaseRolesRequest(); - 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 ListDatabaseRolesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.ListDatabaseRolesRequest - * @static - * @param {google.spanner.admin.database.v1.ListDatabaseRolesRequest} message ListDatabaseRolesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListDatabaseRolesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - return object; - }; - - /** - * Converts this ListDatabaseRolesRequest to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.ListDatabaseRolesRequest - * @instance - * @returns {Object.} JSON object - */ - ListDatabaseRolesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListDatabaseRolesRequest - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.ListDatabaseRolesRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListDatabaseRolesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.ListDatabaseRolesRequest"; - }; - - return ListDatabaseRolesRequest; - })(); - - v1.ListDatabaseRolesResponse = (function() { - - /** - * Properties of a ListDatabaseRolesResponse. - * @memberof google.spanner.admin.database.v1 - * @interface IListDatabaseRolesResponse - * @property {Array.|null} [databaseRoles] ListDatabaseRolesResponse databaseRoles - * @property {string|null} [nextPageToken] ListDatabaseRolesResponse nextPageToken - */ - - /** - * Constructs a new ListDatabaseRolesResponse. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents a ListDatabaseRolesResponse. - * @implements IListDatabaseRolesResponse - * @constructor - * @param {google.spanner.admin.database.v1.IListDatabaseRolesResponse=} [properties] Properties to set - */ - function ListDatabaseRolesResponse(properties) { - this.databaseRoles = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListDatabaseRolesResponse databaseRoles. - * @member {Array.} databaseRoles - * @memberof google.spanner.admin.database.v1.ListDatabaseRolesResponse - * @instance - */ - ListDatabaseRolesResponse.prototype.databaseRoles = $util.emptyArray; - - /** - * ListDatabaseRolesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.spanner.admin.database.v1.ListDatabaseRolesResponse - * @instance - */ - ListDatabaseRolesResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListDatabaseRolesResponse instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.ListDatabaseRolesResponse - * @static - * @param {google.spanner.admin.database.v1.IListDatabaseRolesResponse=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.ListDatabaseRolesResponse} ListDatabaseRolesResponse instance - */ - ListDatabaseRolesResponse.create = function create(properties) { - return new ListDatabaseRolesResponse(properties); - }; - - /** - * Encodes the specified ListDatabaseRolesResponse message. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabaseRolesResponse.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.ListDatabaseRolesResponse - * @static - * @param {google.spanner.admin.database.v1.IListDatabaseRolesResponse} message ListDatabaseRolesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListDatabaseRolesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.databaseRoles != null && message.databaseRoles.length) - for (var i = 0; i < message.databaseRoles.length; ++i) - $root.google.spanner.admin.database.v1.DatabaseRole.encode(message.databaseRoles[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - return writer; - }; - - /** - * Encodes the specified ListDatabaseRolesResponse message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabaseRolesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.ListDatabaseRolesResponse - * @static - * @param {google.spanner.admin.database.v1.IListDatabaseRolesResponse} message ListDatabaseRolesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListDatabaseRolesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListDatabaseRolesResponse message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.ListDatabaseRolesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.ListDatabaseRolesResponse} ListDatabaseRolesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListDatabaseRolesResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.ListDatabaseRolesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.databaseRoles && message.databaseRoles.length)) - message.databaseRoles = []; - message.databaseRoles.push($root.google.spanner.admin.database.v1.DatabaseRole.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListDatabaseRolesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.ListDatabaseRolesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.ListDatabaseRolesResponse} ListDatabaseRolesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListDatabaseRolesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListDatabaseRolesResponse message. - * @function verify - * @memberof google.spanner.admin.database.v1.ListDatabaseRolesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListDatabaseRolesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.databaseRoles != null && message.hasOwnProperty("databaseRoles")) { - if (!Array.isArray(message.databaseRoles)) - return "databaseRoles: array expected"; - for (var i = 0; i < message.databaseRoles.length; ++i) { - var error = $root.google.spanner.admin.database.v1.DatabaseRole.verify(message.databaseRoles[i]); - if (error) - return "databaseRoles." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListDatabaseRolesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.ListDatabaseRolesResponse - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.ListDatabaseRolesResponse} ListDatabaseRolesResponse - */ - ListDatabaseRolesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.ListDatabaseRolesResponse) - return object; - var message = new $root.google.spanner.admin.database.v1.ListDatabaseRolesResponse(); - if (object.databaseRoles) { - if (!Array.isArray(object.databaseRoles)) - throw TypeError(".google.spanner.admin.database.v1.ListDatabaseRolesResponse.databaseRoles: array expected"); - message.databaseRoles = []; - for (var i = 0; i < object.databaseRoles.length; ++i) { - if (typeof object.databaseRoles[i] !== "object") - throw TypeError(".google.spanner.admin.database.v1.ListDatabaseRolesResponse.databaseRoles: object expected"); - message.databaseRoles[i] = $root.google.spanner.admin.database.v1.DatabaseRole.fromObject(object.databaseRoles[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListDatabaseRolesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.ListDatabaseRolesResponse - * @static - * @param {google.spanner.admin.database.v1.ListDatabaseRolesResponse} message ListDatabaseRolesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListDatabaseRolesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.databaseRoles = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.databaseRoles && message.databaseRoles.length) { - object.databaseRoles = []; - for (var j = 0; j < message.databaseRoles.length; ++j) - object.databaseRoles[j] = $root.google.spanner.admin.database.v1.DatabaseRole.toObject(message.databaseRoles[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListDatabaseRolesResponse to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.ListDatabaseRolesResponse - * @instance - * @returns {Object.} JSON object - */ - ListDatabaseRolesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListDatabaseRolesResponse - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.ListDatabaseRolesResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListDatabaseRolesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.ListDatabaseRolesResponse"; - }; - - return ListDatabaseRolesResponse; - })(); - - v1.AddSplitPointsRequest = (function() { - - /** - * Properties of an AddSplitPointsRequest. - * @memberof google.spanner.admin.database.v1 - * @interface IAddSplitPointsRequest - * @property {string|null} [database] AddSplitPointsRequest database - * @property {Array.|null} [splitPoints] AddSplitPointsRequest splitPoints - * @property {string|null} [initiator] AddSplitPointsRequest initiator - */ - - /** - * Constructs a new AddSplitPointsRequest. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents an AddSplitPointsRequest. - * @implements IAddSplitPointsRequest - * @constructor - * @param {google.spanner.admin.database.v1.IAddSplitPointsRequest=} [properties] Properties to set - */ - function AddSplitPointsRequest(properties) { - this.splitPoints = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AddSplitPointsRequest database. - * @member {string} database - * @memberof google.spanner.admin.database.v1.AddSplitPointsRequest - * @instance - */ - AddSplitPointsRequest.prototype.database = ""; - - /** - * AddSplitPointsRequest splitPoints. - * @member {Array.} splitPoints - * @memberof google.spanner.admin.database.v1.AddSplitPointsRequest - * @instance - */ - AddSplitPointsRequest.prototype.splitPoints = $util.emptyArray; - - /** - * AddSplitPointsRequest initiator. - * @member {string} initiator - * @memberof google.spanner.admin.database.v1.AddSplitPointsRequest - * @instance - */ - AddSplitPointsRequest.prototype.initiator = ""; - - /** - * Creates a new AddSplitPointsRequest instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.AddSplitPointsRequest - * @static - * @param {google.spanner.admin.database.v1.IAddSplitPointsRequest=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.AddSplitPointsRequest} AddSplitPointsRequest instance - */ - AddSplitPointsRequest.create = function create(properties) { - return new AddSplitPointsRequest(properties); - }; - - /** - * Encodes the specified AddSplitPointsRequest message. Does not implicitly {@link google.spanner.admin.database.v1.AddSplitPointsRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.AddSplitPointsRequest - * @static - * @param {google.spanner.admin.database.v1.IAddSplitPointsRequest} message AddSplitPointsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AddSplitPointsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.database != null && Object.hasOwnProperty.call(message, "database")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.database); - if (message.splitPoints != null && message.splitPoints.length) - for (var i = 0; i < message.splitPoints.length; ++i) - $root.google.spanner.admin.database.v1.SplitPoints.encode(message.splitPoints[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.initiator != null && Object.hasOwnProperty.call(message, "initiator")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.initiator); - return writer; - }; - - /** - * Encodes the specified AddSplitPointsRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.AddSplitPointsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.AddSplitPointsRequest - * @static - * @param {google.spanner.admin.database.v1.IAddSplitPointsRequest} message AddSplitPointsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AddSplitPointsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AddSplitPointsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.AddSplitPointsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.AddSplitPointsRequest} AddSplitPointsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AddSplitPointsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.AddSplitPointsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.database = reader.string(); - break; - } - case 2: { - if (!(message.splitPoints && message.splitPoints.length)) - message.splitPoints = []; - message.splitPoints.push($root.google.spanner.admin.database.v1.SplitPoints.decode(reader, reader.uint32())); - break; - } - case 3: { - message.initiator = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AddSplitPointsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.AddSplitPointsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.AddSplitPointsRequest} AddSplitPointsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AddSplitPointsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AddSplitPointsRequest message. - * @function verify - * @memberof google.spanner.admin.database.v1.AddSplitPointsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AddSplitPointsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.database != null && message.hasOwnProperty("database")) - if (!$util.isString(message.database)) - return "database: string expected"; - if (message.splitPoints != null && message.hasOwnProperty("splitPoints")) { - if (!Array.isArray(message.splitPoints)) - return "splitPoints: array expected"; - for (var i = 0; i < message.splitPoints.length; ++i) { - var error = $root.google.spanner.admin.database.v1.SplitPoints.verify(message.splitPoints[i]); - if (error) - return "splitPoints." + error; - } - } - if (message.initiator != null && message.hasOwnProperty("initiator")) - if (!$util.isString(message.initiator)) - return "initiator: string expected"; - return null; - }; - - /** - * Creates an AddSplitPointsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.AddSplitPointsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.AddSplitPointsRequest} AddSplitPointsRequest - */ - AddSplitPointsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.AddSplitPointsRequest) - return object; - var message = new $root.google.spanner.admin.database.v1.AddSplitPointsRequest(); - if (object.database != null) - message.database = String(object.database); - if (object.splitPoints) { - if (!Array.isArray(object.splitPoints)) - throw TypeError(".google.spanner.admin.database.v1.AddSplitPointsRequest.splitPoints: array expected"); - message.splitPoints = []; - for (var i = 0; i < object.splitPoints.length; ++i) { - if (typeof object.splitPoints[i] !== "object") - throw TypeError(".google.spanner.admin.database.v1.AddSplitPointsRequest.splitPoints: object expected"); - message.splitPoints[i] = $root.google.spanner.admin.database.v1.SplitPoints.fromObject(object.splitPoints[i]); - } - } - if (object.initiator != null) - message.initiator = String(object.initiator); - return message; - }; - - /** - * Creates a plain object from an AddSplitPointsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.AddSplitPointsRequest - * @static - * @param {google.spanner.admin.database.v1.AddSplitPointsRequest} message AddSplitPointsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AddSplitPointsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.splitPoints = []; - if (options.defaults) { - object.database = ""; - object.initiator = ""; - } - if (message.database != null && message.hasOwnProperty("database")) - object.database = message.database; - if (message.splitPoints && message.splitPoints.length) { - object.splitPoints = []; - for (var j = 0; j < message.splitPoints.length; ++j) - object.splitPoints[j] = $root.google.spanner.admin.database.v1.SplitPoints.toObject(message.splitPoints[j], options); - } - if (message.initiator != null && message.hasOwnProperty("initiator")) - object.initiator = message.initiator; - return object; - }; - - /** - * Converts this AddSplitPointsRequest to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.AddSplitPointsRequest - * @instance - * @returns {Object.} JSON object - */ - AddSplitPointsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AddSplitPointsRequest - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.AddSplitPointsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AddSplitPointsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.AddSplitPointsRequest"; - }; - - return AddSplitPointsRequest; - })(); - - v1.AddSplitPointsResponse = (function() { - - /** - * Properties of an AddSplitPointsResponse. - * @memberof google.spanner.admin.database.v1 - * @interface IAddSplitPointsResponse - */ - - /** - * Constructs a new AddSplitPointsResponse. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents an AddSplitPointsResponse. - * @implements IAddSplitPointsResponse - * @constructor - * @param {google.spanner.admin.database.v1.IAddSplitPointsResponse=} [properties] Properties to set - */ - function AddSplitPointsResponse(properties) { - if (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 AddSplitPointsResponse instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.AddSplitPointsResponse - * @static - * @param {google.spanner.admin.database.v1.IAddSplitPointsResponse=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.AddSplitPointsResponse} AddSplitPointsResponse instance - */ - AddSplitPointsResponse.create = function create(properties) { - return new AddSplitPointsResponse(properties); - }; - - /** - * Encodes the specified AddSplitPointsResponse message. Does not implicitly {@link google.spanner.admin.database.v1.AddSplitPointsResponse.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.AddSplitPointsResponse - * @static - * @param {google.spanner.admin.database.v1.IAddSplitPointsResponse} message AddSplitPointsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AddSplitPointsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified AddSplitPointsResponse message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.AddSplitPointsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.AddSplitPointsResponse - * @static - * @param {google.spanner.admin.database.v1.IAddSplitPointsResponse} message AddSplitPointsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AddSplitPointsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AddSplitPointsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.AddSplitPointsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.AddSplitPointsResponse} AddSplitPointsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AddSplitPointsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.AddSplitPointsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AddSplitPointsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.AddSplitPointsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.AddSplitPointsResponse} AddSplitPointsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AddSplitPointsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AddSplitPointsResponse message. - * @function verify - * @memberof google.spanner.admin.database.v1.AddSplitPointsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AddSplitPointsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates an AddSplitPointsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.AddSplitPointsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.AddSplitPointsResponse} AddSplitPointsResponse - */ - AddSplitPointsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.AddSplitPointsResponse) - return object; - return new $root.google.spanner.admin.database.v1.AddSplitPointsResponse(); - }; - - /** - * Creates a plain object from an AddSplitPointsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.AddSplitPointsResponse - * @static - * @param {google.spanner.admin.database.v1.AddSplitPointsResponse} message AddSplitPointsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AddSplitPointsResponse.toObject = function toObject() { - return {}; - }; - - /** - * Converts this AddSplitPointsResponse to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.AddSplitPointsResponse - * @instance - * @returns {Object.} JSON object - */ - AddSplitPointsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AddSplitPointsResponse - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.AddSplitPointsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AddSplitPointsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.AddSplitPointsResponse"; - }; - - return AddSplitPointsResponse; - })(); - - v1.SplitPoints = (function() { - - /** - * Properties of a SplitPoints. - * @memberof google.spanner.admin.database.v1 - * @interface ISplitPoints - * @property {string|null} [table] SplitPoints table - * @property {string|null} [index] SplitPoints index - * @property {Array.|null} [keys] SplitPoints keys - * @property {google.protobuf.ITimestamp|null} [expireTime] SplitPoints expireTime - */ - - /** - * Constructs a new SplitPoints. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents a SplitPoints. - * @implements ISplitPoints - * @constructor - * @param {google.spanner.admin.database.v1.ISplitPoints=} [properties] Properties to set - */ - function SplitPoints(properties) { - this.keys = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SplitPoints table. - * @member {string} table - * @memberof google.spanner.admin.database.v1.SplitPoints - * @instance - */ - SplitPoints.prototype.table = ""; - - /** - * SplitPoints index. - * @member {string} index - * @memberof google.spanner.admin.database.v1.SplitPoints - * @instance - */ - SplitPoints.prototype.index = ""; - - /** - * SplitPoints keys. - * @member {Array.} keys - * @memberof google.spanner.admin.database.v1.SplitPoints - * @instance - */ - SplitPoints.prototype.keys = $util.emptyArray; - - /** - * SplitPoints expireTime. - * @member {google.protobuf.ITimestamp|null|undefined} expireTime - * @memberof google.spanner.admin.database.v1.SplitPoints - * @instance - */ - SplitPoints.prototype.expireTime = null; - - /** - * Creates a new SplitPoints instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.SplitPoints - * @static - * @param {google.spanner.admin.database.v1.ISplitPoints=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.SplitPoints} SplitPoints instance - */ - SplitPoints.create = function create(properties) { - return new SplitPoints(properties); - }; - - /** - * Encodes the specified SplitPoints message. Does not implicitly {@link google.spanner.admin.database.v1.SplitPoints.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.SplitPoints - * @static - * @param {google.spanner.admin.database.v1.ISplitPoints} message SplitPoints message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SplitPoints.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.table != null && Object.hasOwnProperty.call(message, "table")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.table); - if (message.index != null && Object.hasOwnProperty.call(message, "index")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.index); - if (message.keys != null && message.keys.length) - for (var i = 0; i < message.keys.length; ++i) - $root.google.spanner.admin.database.v1.SplitPoints.Key.encode(message.keys[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) - $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified SplitPoints message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.SplitPoints.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.SplitPoints - * @static - * @param {google.spanner.admin.database.v1.ISplitPoints} message SplitPoints message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SplitPoints.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SplitPoints message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.SplitPoints - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.SplitPoints} SplitPoints - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SplitPoints.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.SplitPoints(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.table = reader.string(); - break; - } - case 2: { - message.index = reader.string(); - break; - } - case 3: { - if (!(message.keys && message.keys.length)) - message.keys = []; - message.keys.push($root.google.spanner.admin.database.v1.SplitPoints.Key.decode(reader, reader.uint32())); - break; - } - case 5: { - message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SplitPoints message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.SplitPoints - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.SplitPoints} SplitPoints - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SplitPoints.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SplitPoints message. - * @function verify - * @memberof google.spanner.admin.database.v1.SplitPoints - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SplitPoints.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.table != null && message.hasOwnProperty("table")) - if (!$util.isString(message.table)) - return "table: string expected"; - if (message.index != null && message.hasOwnProperty("index")) - if (!$util.isString(message.index)) - return "index: string expected"; - if (message.keys != null && message.hasOwnProperty("keys")) { - if (!Array.isArray(message.keys)) - return "keys: array expected"; - for (var i = 0; i < message.keys.length; ++i) { - var error = $root.google.spanner.admin.database.v1.SplitPoints.Key.verify(message.keys[i]); - if (error) - return "keys." + error; - } - } - if (message.expireTime != null && message.hasOwnProperty("expireTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.expireTime); - if (error) - return "expireTime." + error; - } - return null; - }; - - /** - * Creates a SplitPoints message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.SplitPoints - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.SplitPoints} SplitPoints - */ - SplitPoints.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.SplitPoints) - return object; - var message = new $root.google.spanner.admin.database.v1.SplitPoints(); - if (object.table != null) - message.table = String(object.table); - if (object.index != null) - message.index = String(object.index); - if (object.keys) { - if (!Array.isArray(object.keys)) - throw TypeError(".google.spanner.admin.database.v1.SplitPoints.keys: array expected"); - message.keys = []; - for (var i = 0; i < object.keys.length; ++i) { - if (typeof object.keys[i] !== "object") - throw TypeError(".google.spanner.admin.database.v1.SplitPoints.keys: object expected"); - message.keys[i] = $root.google.spanner.admin.database.v1.SplitPoints.Key.fromObject(object.keys[i]); - } - } - if (object.expireTime != null) { - if (typeof object.expireTime !== "object") - throw TypeError(".google.spanner.admin.database.v1.SplitPoints.expireTime: object expected"); - message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); - } - return message; - }; - - /** - * Creates a plain object from a SplitPoints message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.SplitPoints - * @static - * @param {google.spanner.admin.database.v1.SplitPoints} message SplitPoints - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SplitPoints.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.keys = []; - if (options.defaults) { - object.table = ""; - object.index = ""; - object.expireTime = null; - } - if (message.table != null && message.hasOwnProperty("table")) - object.table = message.table; - if (message.index != null && message.hasOwnProperty("index")) - object.index = message.index; - if (message.keys && message.keys.length) { - object.keys = []; - for (var j = 0; j < message.keys.length; ++j) - object.keys[j] = $root.google.spanner.admin.database.v1.SplitPoints.Key.toObject(message.keys[j], options); - } - if (message.expireTime != null && message.hasOwnProperty("expireTime")) - object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); - return object; - }; - - /** - * Converts this SplitPoints to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.SplitPoints - * @instance - * @returns {Object.} JSON object - */ - SplitPoints.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SplitPoints - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.SplitPoints - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SplitPoints.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.SplitPoints"; - }; - - SplitPoints.Key = (function() { - - /** - * Properties of a Key. - * @memberof google.spanner.admin.database.v1.SplitPoints - * @interface IKey - * @property {google.protobuf.IListValue|null} [keyParts] Key keyParts - */ - - /** - * Constructs a new Key. - * @memberof google.spanner.admin.database.v1.SplitPoints - * @classdesc Represents a Key. - * @implements IKey - * @constructor - * @param {google.spanner.admin.database.v1.SplitPoints.IKey=} [properties] Properties to set - */ - function Key(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Key keyParts. - * @member {google.protobuf.IListValue|null|undefined} keyParts - * @memberof google.spanner.admin.database.v1.SplitPoints.Key - * @instance - */ - Key.prototype.keyParts = null; - - /** - * Creates a new Key instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.SplitPoints.Key - * @static - * @param {google.spanner.admin.database.v1.SplitPoints.IKey=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.SplitPoints.Key} Key instance - */ - Key.create = function create(properties) { - return new Key(properties); - }; - - /** - * Encodes the specified Key message. Does not implicitly {@link google.spanner.admin.database.v1.SplitPoints.Key.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.SplitPoints.Key - * @static - * @param {google.spanner.admin.database.v1.SplitPoints.IKey} message Key message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Key.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.keyParts != null && Object.hasOwnProperty.call(message, "keyParts")) - $root.google.protobuf.ListValue.encode(message.keyParts, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Key message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.SplitPoints.Key.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.SplitPoints.Key - * @static - * @param {google.spanner.admin.database.v1.SplitPoints.IKey} message Key message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Key.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Key message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.SplitPoints.Key - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.SplitPoints.Key} Key - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Key.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.SplitPoints.Key(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.keyParts = $root.google.protobuf.ListValue.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Key message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.SplitPoints.Key - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.SplitPoints.Key} Key - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Key.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Key message. - * @function verify - * @memberof google.spanner.admin.database.v1.SplitPoints.Key - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Key.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.keyParts != null && message.hasOwnProperty("keyParts")) { - var error = $root.google.protobuf.ListValue.verify(message.keyParts); - if (error) - return "keyParts." + error; - } - return null; - }; - - /** - * Creates a Key message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.SplitPoints.Key - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.SplitPoints.Key} Key - */ - Key.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.SplitPoints.Key) - return object; - var message = new $root.google.spanner.admin.database.v1.SplitPoints.Key(); - if (object.keyParts != null) { - if (typeof object.keyParts !== "object") - throw TypeError(".google.spanner.admin.database.v1.SplitPoints.Key.keyParts: object expected"); - message.keyParts = $root.google.protobuf.ListValue.fromObject(object.keyParts); - } - return message; - }; - - /** - * Creates a plain object from a Key message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.SplitPoints.Key - * @static - * @param {google.spanner.admin.database.v1.SplitPoints.Key} message Key - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Key.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.keyParts = null; - if (message.keyParts != null && message.hasOwnProperty("keyParts")) - object.keyParts = $root.google.protobuf.ListValue.toObject(message.keyParts, options); - return object; - }; - - /** - * Converts this Key to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.SplitPoints.Key - * @instance - * @returns {Object.} JSON object - */ - Key.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Key - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.SplitPoints.Key - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Key.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.SplitPoints.Key"; - }; - - return Key; - })(); - - return SplitPoints; - })(); - - v1.InternalUpdateGraphOperationRequest = (function() { - - /** - * Properties of an InternalUpdateGraphOperationRequest. - * @memberof google.spanner.admin.database.v1 - * @interface IInternalUpdateGraphOperationRequest - * @property {string|null} [database] InternalUpdateGraphOperationRequest database - * @property {string|null} [operationId] InternalUpdateGraphOperationRequest operationId - * @property {string|null} [vmIdentityToken] InternalUpdateGraphOperationRequest vmIdentityToken - * @property {number|null} [progress] InternalUpdateGraphOperationRequest progress - * @property {google.rpc.IStatus|null} [status] InternalUpdateGraphOperationRequest status - */ - - /** - * Constructs a new InternalUpdateGraphOperationRequest. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents an InternalUpdateGraphOperationRequest. - * @implements IInternalUpdateGraphOperationRequest - * @constructor - * @param {google.spanner.admin.database.v1.IInternalUpdateGraphOperationRequest=} [properties] Properties to set - */ - function InternalUpdateGraphOperationRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * InternalUpdateGraphOperationRequest database. - * @member {string} database - * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest - * @instance - */ - InternalUpdateGraphOperationRequest.prototype.database = ""; - - /** - * InternalUpdateGraphOperationRequest operationId. - * @member {string} operationId - * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest - * @instance - */ - InternalUpdateGraphOperationRequest.prototype.operationId = ""; - - /** - * InternalUpdateGraphOperationRequest vmIdentityToken. - * @member {string} vmIdentityToken - * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest - * @instance - */ - InternalUpdateGraphOperationRequest.prototype.vmIdentityToken = ""; - - /** - * InternalUpdateGraphOperationRequest progress. - * @member {number} progress - * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest - * @instance - */ - InternalUpdateGraphOperationRequest.prototype.progress = 0; - - /** - * InternalUpdateGraphOperationRequest status. - * @member {google.rpc.IStatus|null|undefined} status - * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest - * @instance - */ - InternalUpdateGraphOperationRequest.prototype.status = null; - - /** - * Creates a new InternalUpdateGraphOperationRequest instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest - * @static - * @param {google.spanner.admin.database.v1.IInternalUpdateGraphOperationRequest=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest} InternalUpdateGraphOperationRequest instance - */ - InternalUpdateGraphOperationRequest.create = function create(properties) { - return new InternalUpdateGraphOperationRequest(properties); - }; - - /** - * Encodes the specified InternalUpdateGraphOperationRequest message. Does not implicitly {@link google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest - * @static - * @param {google.spanner.admin.database.v1.IInternalUpdateGraphOperationRequest} message InternalUpdateGraphOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InternalUpdateGraphOperationRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.database != null && Object.hasOwnProperty.call(message, "database")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.database); - if (message.operationId != null && Object.hasOwnProperty.call(message, "operationId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.operationId); - if (message.progress != null && Object.hasOwnProperty.call(message, "progress")) - writer.uint32(/* id 3, wireType 1 =*/25).double(message.progress); - if (message.vmIdentityToken != null && Object.hasOwnProperty.call(message, "vmIdentityToken")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.vmIdentityToken); - if (message.status != null && Object.hasOwnProperty.call(message, "status")) - $root.google.rpc.Status.encode(message.status, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified InternalUpdateGraphOperationRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest - * @static - * @param {google.spanner.admin.database.v1.IInternalUpdateGraphOperationRequest} message InternalUpdateGraphOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InternalUpdateGraphOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an InternalUpdateGraphOperationRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest} InternalUpdateGraphOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InternalUpdateGraphOperationRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.database = reader.string(); - break; - } - case 2: { - message.operationId = reader.string(); - break; - } - case 5: { - message.vmIdentityToken = reader.string(); - break; - } - case 3: { - message.progress = reader.double(); - break; - } - case 6: { - message.status = $root.google.rpc.Status.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an InternalUpdateGraphOperationRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest} InternalUpdateGraphOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InternalUpdateGraphOperationRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an InternalUpdateGraphOperationRequest message. - * @function verify - * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - InternalUpdateGraphOperationRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.database != null && message.hasOwnProperty("database")) - if (!$util.isString(message.database)) - return "database: string expected"; - if (message.operationId != null && message.hasOwnProperty("operationId")) - if (!$util.isString(message.operationId)) - return "operationId: string expected"; - if (message.vmIdentityToken != null && message.hasOwnProperty("vmIdentityToken")) - if (!$util.isString(message.vmIdentityToken)) - return "vmIdentityToken: string expected"; - if (message.progress != null && message.hasOwnProperty("progress")) - if (typeof message.progress !== "number") - return "progress: number expected"; - if (message.status != null && message.hasOwnProperty("status")) { - var error = $root.google.rpc.Status.verify(message.status); - if (error) - return "status." + error; - } - return null; - }; - - /** - * Creates an InternalUpdateGraphOperationRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest} InternalUpdateGraphOperationRequest - */ - InternalUpdateGraphOperationRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest) - return object; - var message = new $root.google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest(); - if (object.database != null) - message.database = String(object.database); - if (object.operationId != null) - message.operationId = String(object.operationId); - if (object.vmIdentityToken != null) - message.vmIdentityToken = String(object.vmIdentityToken); - if (object.progress != null) - message.progress = Number(object.progress); - if (object.status != null) { - if (typeof object.status !== "object") - throw TypeError(".google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest.status: object expected"); - message.status = $root.google.rpc.Status.fromObject(object.status); - } - return message; - }; - - /** - * Creates a plain object from an InternalUpdateGraphOperationRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest - * @static - * @param {google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest} message InternalUpdateGraphOperationRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - InternalUpdateGraphOperationRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.database = ""; - object.operationId = ""; - object.progress = 0; - object.vmIdentityToken = ""; - object.status = null; - } - if (message.database != null && message.hasOwnProperty("database")) - object.database = message.database; - if (message.operationId != null && message.hasOwnProperty("operationId")) - object.operationId = message.operationId; - if (message.progress != null && message.hasOwnProperty("progress")) - object.progress = options.json && !isFinite(message.progress) ? String(message.progress) : message.progress; - if (message.vmIdentityToken != null && message.hasOwnProperty("vmIdentityToken")) - object.vmIdentityToken = message.vmIdentityToken; - if (message.status != null && message.hasOwnProperty("status")) - object.status = $root.google.rpc.Status.toObject(message.status, options); - return object; - }; - - /** - * Converts this InternalUpdateGraphOperationRequest to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest - * @instance - * @returns {Object.} JSON object - */ - InternalUpdateGraphOperationRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for InternalUpdateGraphOperationRequest - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - InternalUpdateGraphOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest"; - }; - - return InternalUpdateGraphOperationRequest; - })(); - - v1.InternalUpdateGraphOperationResponse = (function() { - - /** - * Properties of an InternalUpdateGraphOperationResponse. - * @memberof google.spanner.admin.database.v1 - * @interface IInternalUpdateGraphOperationResponse - */ - - /** - * Constructs a new InternalUpdateGraphOperationResponse. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents an InternalUpdateGraphOperationResponse. - * @implements IInternalUpdateGraphOperationResponse - * @constructor - * @param {google.spanner.admin.database.v1.IInternalUpdateGraphOperationResponse=} [properties] Properties to set - */ - function InternalUpdateGraphOperationResponse(properties) { - if (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 InternalUpdateGraphOperationResponse instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse - * @static - * @param {google.spanner.admin.database.v1.IInternalUpdateGraphOperationResponse=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse} InternalUpdateGraphOperationResponse instance - */ - InternalUpdateGraphOperationResponse.create = function create(properties) { - return new InternalUpdateGraphOperationResponse(properties); - }; - - /** - * Encodes the specified InternalUpdateGraphOperationResponse message. Does not implicitly {@link google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse - * @static - * @param {google.spanner.admin.database.v1.IInternalUpdateGraphOperationResponse} message InternalUpdateGraphOperationResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InternalUpdateGraphOperationResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified InternalUpdateGraphOperationResponse message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse - * @static - * @param {google.spanner.admin.database.v1.IInternalUpdateGraphOperationResponse} message InternalUpdateGraphOperationResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InternalUpdateGraphOperationResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an InternalUpdateGraphOperationResponse message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse} InternalUpdateGraphOperationResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InternalUpdateGraphOperationResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an InternalUpdateGraphOperationResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse} InternalUpdateGraphOperationResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InternalUpdateGraphOperationResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an InternalUpdateGraphOperationResponse message. - * @function verify - * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - InternalUpdateGraphOperationResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates an InternalUpdateGraphOperationResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse} InternalUpdateGraphOperationResponse - */ - InternalUpdateGraphOperationResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse) - return object; - return new $root.google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse(); - }; - - /** - * Creates a plain object from an InternalUpdateGraphOperationResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse - * @static - * @param {google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse} message InternalUpdateGraphOperationResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - InternalUpdateGraphOperationResponse.toObject = function toObject() { - return {}; - }; - - /** - * Converts this InternalUpdateGraphOperationResponse to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse - * @instance - * @returns {Object.} JSON object - */ - InternalUpdateGraphOperationResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for InternalUpdateGraphOperationResponse - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - InternalUpdateGraphOperationResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse"; - }; - - return InternalUpdateGraphOperationResponse; - })(); - - return v1; - })(); - - return database; - })(); - - return admin; - })(); - - return spanner; - })(); - - google.api = (function() { - - /** - * Namespace api. - * @memberof google - * @namespace - */ - var api = {}; - - /** - * FieldBehavior enum. - * @name google.api.FieldBehavior - * @enum {number} - * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value - * @property {number} OPTIONAL=1 OPTIONAL value - * @property {number} REQUIRED=2 REQUIRED value - * @property {number} OUTPUT_ONLY=3 OUTPUT_ONLY value - * @property {number} INPUT_ONLY=4 INPUT_ONLY value - * @property {number} IMMUTABLE=5 IMMUTABLE value - * @property {number} UNORDERED_LIST=6 UNORDERED_LIST value - * @property {number} NON_EMPTY_DEFAULT=7 NON_EMPTY_DEFAULT value - * @property {number} IDENTIFIER=8 IDENTIFIER value - */ - api.FieldBehavior = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "FIELD_BEHAVIOR_UNSPECIFIED"] = 0; - values[valuesById[1] = "OPTIONAL"] = 1; - values[valuesById[2] = "REQUIRED"] = 2; - values[valuesById[3] = "OUTPUT_ONLY"] = 3; - values[valuesById[4] = "INPUT_ONLY"] = 4; - values[valuesById[5] = "IMMUTABLE"] = 5; - values[valuesById[6] = "UNORDERED_LIST"] = 6; - values[valuesById[7] = "NON_EMPTY_DEFAULT"] = 7; - values[valuesById[8] = "IDENTIFIER"] = 8; - return values; - })(); - - api.ResourceDescriptor = (function() { - - /** - * Properties of a ResourceDescriptor. - * @memberof google.api - * @interface IResourceDescriptor - * @property {string|null} [type] ResourceDescriptor type - * @property {Array.|null} [pattern] ResourceDescriptor pattern - * @property {string|null} [nameField] ResourceDescriptor nameField - * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history - * @property {string|null} [plural] ResourceDescriptor plural - * @property {string|null} [singular] ResourceDescriptor singular - * @property {Array.|null} [style] ResourceDescriptor style - */ - - /** - * Constructs a new ResourceDescriptor. - * @memberof google.api - * @classdesc Represents a ResourceDescriptor. - * @implements IResourceDescriptor - * @constructor - * @param {google.api.IResourceDescriptor=} [properties] Properties to set - */ - function ResourceDescriptor(properties) { - this.pattern = []; - this.style = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ResourceDescriptor type. - * @member {string} type - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.type = ""; - - /** - * ResourceDescriptor pattern. - * @member {Array.} pattern - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.pattern = $util.emptyArray; - - /** - * ResourceDescriptor nameField. - * @member {string} nameField - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.nameField = ""; - - /** - * ResourceDescriptor history. - * @member {google.api.ResourceDescriptor.History} history - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.history = 0; - - /** - * ResourceDescriptor plural. - * @member {string} plural - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.plural = ""; - - /** - * ResourceDescriptor singular. - * @member {string} singular - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.singular = ""; - - /** - * ResourceDescriptor style. - * @member {Array.} style - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.style = $util.emptyArray; - - /** - * Creates a new ResourceDescriptor instance using the specified properties. - * @function create - * @memberof google.api.ResourceDescriptor - * @static - * @param {google.api.IResourceDescriptor=} [properties] Properties to set - * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance - */ - ResourceDescriptor.create = function create(properties) { - return new ResourceDescriptor(properties); - }; - - /** - * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. - * @function encode - * @memberof google.api.ResourceDescriptor - * @static - * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceDescriptor.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); - if (message.pattern != null && message.pattern.length) - for (var i = 0; i < message.pattern.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.pattern[i]); - if (message.nameField != null && Object.hasOwnProperty.call(message, "nameField")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); - if (message.history != null && Object.hasOwnProperty.call(message, "history")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); - if (message.plural != null && Object.hasOwnProperty.call(message, "plural")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); - if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); - if (message.style != null && message.style.length) { - writer.uint32(/* id 10, wireType 2 =*/82).fork(); - for (var i = 0; i < message.style.length; ++i) - writer.int32(message.style[i]); - writer.ldelim(); - } - return writer; - }; - - /** - * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.ResourceDescriptor - * @static - * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ResourceDescriptor message from the specified reader or buffer. - * @function decode - * @memberof google.api.ResourceDescriptor - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.ResourceDescriptor} ResourceDescriptor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceDescriptor.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceDescriptor(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.type = reader.string(); - break; - } - case 2: { - if (!(message.pattern && message.pattern.length)) - message.pattern = []; - message.pattern.push(reader.string()); - break; - } - case 3: { - message.nameField = reader.string(); - break; - } - case 4: { - message.history = reader.int32(); - break; - } - case 5: { - message.plural = reader.string(); - break; - } - case 6: { - message.singular = reader.string(); - break; - } - case 10: { - if (!(message.style && message.style.length)) - message.style = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.style.push(reader.int32()); - } else - message.style.push(reader.int32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.ResourceDescriptor - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.ResourceDescriptor} ResourceDescriptor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ResourceDescriptor message. - * @function verify - * @memberof google.api.ResourceDescriptor - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ResourceDescriptor.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.pattern != null && message.hasOwnProperty("pattern")) { - if (!Array.isArray(message.pattern)) - return "pattern: array expected"; - for (var i = 0; i < message.pattern.length; ++i) - if (!$util.isString(message.pattern[i])) - return "pattern: string[] expected"; - } - if (message.nameField != null && message.hasOwnProperty("nameField")) - if (!$util.isString(message.nameField)) - return "nameField: string expected"; - if (message.history != null && message.hasOwnProperty("history")) - switch (message.history) { - default: - return "history: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.plural != null && message.hasOwnProperty("plural")) - if (!$util.isString(message.plural)) - return "plural: string expected"; - if (message.singular != null && message.hasOwnProperty("singular")) - if (!$util.isString(message.singular)) - return "singular: string expected"; - if (message.style != null && message.hasOwnProperty("style")) { - if (!Array.isArray(message.style)) - return "style: array expected"; - for (var i = 0; i < message.style.length; ++i) - switch (message.style[i]) { - default: - return "style: enum value[] expected"; - case 0: - case 1: - break; - } - } - return null; - }; - - /** - * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.ResourceDescriptor - * @static - * @param {Object.} object Plain object - * @returns {google.api.ResourceDescriptor} ResourceDescriptor - */ - ResourceDescriptor.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.ResourceDescriptor) - return object; - var message = new $root.google.api.ResourceDescriptor(); - if (object.type != null) - message.type = String(object.type); - if (object.pattern) { - if (!Array.isArray(object.pattern)) - throw TypeError(".google.api.ResourceDescriptor.pattern: array expected"); - message.pattern = []; - for (var i = 0; i < object.pattern.length; ++i) - message.pattern[i] = String(object.pattern[i]); - } - if (object.nameField != null) - message.nameField = String(object.nameField); - switch (object.history) { - default: - if (typeof object.history === "number") { - message.history = object.history; - break; - } - break; - case "HISTORY_UNSPECIFIED": - case 0: - message.history = 0; - break; - case "ORIGINALLY_SINGLE_PATTERN": - case 1: - message.history = 1; - break; - case "FUTURE_MULTI_PATTERN": - case 2: - message.history = 2; - break; - } - if (object.plural != null) - message.plural = String(object.plural); - if (object.singular != null) - message.singular = String(object.singular); - if (object.style) { - if (!Array.isArray(object.style)) - throw TypeError(".google.api.ResourceDescriptor.style: array expected"); - message.style = []; - for (var i = 0; i < object.style.length; ++i) - switch (object.style[i]) { - default: - if (typeof object.style[i] === "number") { - message.style[i] = object.style[i]; - break; - } - case "STYLE_UNSPECIFIED": - case 0: - message.style[i] = 0; - break; - case "DECLARATIVE_FRIENDLY": - case 1: - message.style[i] = 1; - break; - } - } - return message; - }; - - /** - * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.ResourceDescriptor - * @static - * @param {google.api.ResourceDescriptor} message ResourceDescriptor - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResourceDescriptor.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.pattern = []; - object.style = []; - } - if (options.defaults) { - object.type = ""; - object.nameField = ""; - object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; - object.plural = ""; - object.singular = ""; - } - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.pattern && message.pattern.length) { - object.pattern = []; - for (var j = 0; j < message.pattern.length; ++j) - object.pattern[j] = message.pattern[j]; - } - if (message.nameField != null && message.hasOwnProperty("nameField")) - object.nameField = message.nameField; - if (message.history != null && message.hasOwnProperty("history")) - object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] === undefined ? message.history : $root.google.api.ResourceDescriptor.History[message.history] : message.history; - if (message.plural != null && message.hasOwnProperty("plural")) - object.plural = message.plural; - if (message.singular != null && message.hasOwnProperty("singular")) - object.singular = message.singular; - if (message.style && message.style.length) { - object.style = []; - for (var j = 0; j < message.style.length; ++j) - object.style[j] = options.enums === String ? $root.google.api.ResourceDescriptor.Style[message.style[j]] === undefined ? message.style[j] : $root.google.api.ResourceDescriptor.Style[message.style[j]] : message.style[j]; - } - return object; - }; - - /** - * Converts this ResourceDescriptor to JSON. - * @function toJSON - * @memberof google.api.ResourceDescriptor - * @instance - * @returns {Object.} JSON object - */ - ResourceDescriptor.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ResourceDescriptor - * @function getTypeUrl - * @memberof google.api.ResourceDescriptor - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ResourceDescriptor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.ResourceDescriptor"; - }; - - /** - * History enum. - * @name google.api.ResourceDescriptor.History - * @enum {number} - * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value - * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value - * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value - */ - ResourceDescriptor.History = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "HISTORY_UNSPECIFIED"] = 0; - values[valuesById[1] = "ORIGINALLY_SINGLE_PATTERN"] = 1; - values[valuesById[2] = "FUTURE_MULTI_PATTERN"] = 2; - return values; - })(); - - /** - * Style enum. - * @name google.api.ResourceDescriptor.Style - * @enum {number} - * @property {number} STYLE_UNSPECIFIED=0 STYLE_UNSPECIFIED value - * @property {number} DECLARATIVE_FRIENDLY=1 DECLARATIVE_FRIENDLY value - */ - ResourceDescriptor.Style = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STYLE_UNSPECIFIED"] = 0; - values[valuesById[1] = "DECLARATIVE_FRIENDLY"] = 1; - return values; - })(); - - return ResourceDescriptor; - })(); - - api.ResourceReference = (function() { - - /** - * Properties of a ResourceReference. - * @memberof google.api - * @interface IResourceReference - * @property {string|null} [type] ResourceReference type - * @property {string|null} [childType] ResourceReference childType - */ - - /** - * Constructs a new ResourceReference. - * @memberof google.api - * @classdesc Represents a ResourceReference. - * @implements IResourceReference - * @constructor - * @param {google.api.IResourceReference=} [properties] Properties to set - */ - function ResourceReference(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ResourceReference type. - * @member {string} type - * @memberof google.api.ResourceReference - * @instance - */ - ResourceReference.prototype.type = ""; - - /** - * ResourceReference childType. - * @member {string} childType - * @memberof google.api.ResourceReference - * @instance - */ - ResourceReference.prototype.childType = ""; - - /** - * Creates a new ResourceReference instance using the specified properties. - * @function create - * @memberof google.api.ResourceReference - * @static - * @param {google.api.IResourceReference=} [properties] Properties to set - * @returns {google.api.ResourceReference} ResourceReference instance - */ - ResourceReference.create = function create(properties) { - return new ResourceReference(properties); - }; - - /** - * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. - * @function encode - * @memberof google.api.ResourceReference - * @static - * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceReference.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); - if (message.childType != null && Object.hasOwnProperty.call(message, "childType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); - return writer; - }; - - /** - * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.ResourceReference - * @static - * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ResourceReference message from the specified reader or buffer. - * @function decode - * @memberof google.api.ResourceReference - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.ResourceReference} ResourceReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceReference.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceReference(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.type = reader.string(); - break; - } - case 2: { - message.childType = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ResourceReference message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.ResourceReference - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.ResourceReference} ResourceReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceReference.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ResourceReference message. - * @function verify - * @memberof google.api.ResourceReference - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ResourceReference.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.childType != null && message.hasOwnProperty("childType")) - if (!$util.isString(message.childType)) - return "childType: string expected"; - return null; - }; - - /** - * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.ResourceReference - * @static - * @param {Object.} object Plain object - * @returns {google.api.ResourceReference} ResourceReference - */ - ResourceReference.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.ResourceReference) - return object; - var message = new $root.google.api.ResourceReference(); - if (object.type != null) - message.type = String(object.type); - if (object.childType != null) - message.childType = String(object.childType); - return message; - }; - - /** - * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.ResourceReference - * @static - * @param {google.api.ResourceReference} message ResourceReference - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResourceReference.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.type = ""; - object.childType = ""; - } - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.childType != null && message.hasOwnProperty("childType")) - object.childType = message.childType; - return object; - }; - - /** - * Converts this ResourceReference to JSON. - * @function toJSON - * @memberof google.api.ResourceReference - * @instance - * @returns {Object.} JSON object - */ - ResourceReference.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ResourceReference - * @function getTypeUrl - * @memberof google.api.ResourceReference - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ResourceReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.ResourceReference"; - }; - - return ResourceReference; - })(); - - api.Http = (function() { - - /** - * Properties of a Http. - * @memberof google.api - * @interface IHttp - * @property {Array.|null} [rules] Http rules - * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion - */ - - /** - * Constructs a new Http. - * @memberof google.api - * @classdesc Represents a Http. - * @implements IHttp - * @constructor - * @param {google.api.IHttp=} [properties] Properties to set - */ - function Http(properties) { - this.rules = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Http rules. - * @member {Array.} rules - * @memberof google.api.Http - * @instance - */ - Http.prototype.rules = $util.emptyArray; - - /** - * Http fullyDecodeReservedExpansion. - * @member {boolean} fullyDecodeReservedExpansion - * @memberof google.api.Http - * @instance - */ - Http.prototype.fullyDecodeReservedExpansion = false; - - /** - * Creates a new Http instance using the specified properties. - * @function create - * @memberof google.api.Http - * @static - * @param {google.api.IHttp=} [properties] Properties to set - * @returns {google.api.Http} Http instance - */ - Http.create = function create(properties) { - return new Http(properties); - }; - - /** - * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @function encode - * @memberof google.api.Http - * @static - * @param {google.api.IHttp} message Http message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Http.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.rules != null && message.rules.length) - for (var i = 0; i < message.rules.length; ++i) - $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); - return writer; - }; - - /** - * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.Http - * @static - * @param {google.api.IHttp} message Http message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Http.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Http message from the specified reader or buffer. - * @function decode - * @memberof google.api.Http - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.Http} Http - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Http.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.rules && message.rules.length)) - message.rules = []; - message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); - break; - } - case 2: { - message.fullyDecodeReservedExpansion = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Http message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.Http - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.Http} Http - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Http.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Http message. - * @function verify - * @memberof google.api.Http - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Http.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.rules != null && message.hasOwnProperty("rules")) { - if (!Array.isArray(message.rules)) - return "rules: array expected"; - for (var i = 0; i < message.rules.length; ++i) { - var error = $root.google.api.HttpRule.verify(message.rules[i]); - if (error) - return "rules." + error; - } - } - if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) - if (typeof message.fullyDecodeReservedExpansion !== "boolean") - return "fullyDecodeReservedExpansion: boolean expected"; - return null; - }; - - /** - * Creates a Http message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.Http - * @static - * @param {Object.} object Plain object - * @returns {google.api.Http} Http - */ - Http.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.Http) - return object; - var message = new $root.google.api.Http(); - if (object.rules) { - if (!Array.isArray(object.rules)) - throw TypeError(".google.api.Http.rules: array expected"); - message.rules = []; - for (var i = 0; i < object.rules.length; ++i) { - if (typeof object.rules[i] !== "object") - throw TypeError(".google.api.Http.rules: object expected"); - message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); - } - } - if (object.fullyDecodeReservedExpansion != null) - message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); - return message; - }; - - /** - * Creates a plain object from a Http message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.Http - * @static - * @param {google.api.Http} message Http - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Http.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.rules = []; - if (options.defaults) - object.fullyDecodeReservedExpansion = false; - if (message.rules && message.rules.length) { - object.rules = []; - for (var j = 0; j < message.rules.length; ++j) - object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); - } - if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) - object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; - return object; - }; - - /** - * Converts this Http to JSON. - * @function toJSON - * @memberof google.api.Http - * @instance - * @returns {Object.} JSON object - */ - Http.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Http - * @function getTypeUrl - * @memberof google.api.Http - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Http.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.Http"; - }; - - return Http; - })(); - - api.HttpRule = (function() { - - /** - * Properties of a HttpRule. - * @memberof google.api - * @interface IHttpRule - * @property {string|null} [selector] HttpRule selector - * @property {string|null} [get] HttpRule get - * @property {string|null} [put] HttpRule put - * @property {string|null} [post] HttpRule post - * @property {string|null} ["delete"] HttpRule delete - * @property {string|null} [patch] HttpRule patch - * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom - * @property {string|null} [body] HttpRule body - * @property {string|null} [responseBody] HttpRule responseBody - * @property {Array.|null} [additionalBindings] HttpRule additionalBindings - */ - - /** - * Constructs a new HttpRule. - * @memberof google.api - * @classdesc Represents a HttpRule. - * @implements IHttpRule - * @constructor - * @param {google.api.IHttpRule=} [properties] Properties to set - */ - function HttpRule(properties) { - this.additionalBindings = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * HttpRule selector. - * @member {string} selector - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.selector = ""; - - /** - * HttpRule get. - * @member {string|null|undefined} get - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.get = null; - - /** - * HttpRule put. - * @member {string|null|undefined} put - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.put = null; - - /** - * HttpRule post. - * @member {string|null|undefined} post - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.post = null; - - /** - * HttpRule delete. - * @member {string|null|undefined} delete - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype["delete"] = null; - - /** - * HttpRule patch. - * @member {string|null|undefined} patch - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.patch = null; - - /** - * HttpRule custom. - * @member {google.api.ICustomHttpPattern|null|undefined} custom - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.custom = null; - - /** - * HttpRule body. - * @member {string} body - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.body = ""; - - /** - * HttpRule responseBody. - * @member {string} responseBody - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.responseBody = ""; - - /** - * HttpRule additionalBindings. - * @member {Array.} additionalBindings - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.additionalBindings = $util.emptyArray; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * HttpRule pattern. - * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern - * @memberof google.api.HttpRule - * @instance - */ - Object.defineProperty(HttpRule.prototype, "pattern", { - get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new HttpRule instance using the specified properties. - * @function create - * @memberof google.api.HttpRule - * @static - * @param {google.api.IHttpRule=} [properties] Properties to set - * @returns {google.api.HttpRule} HttpRule instance - */ - HttpRule.create = function create(properties) { - return new HttpRule(properties); - }; - - /** - * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @function encode - * @memberof google.api.HttpRule - * @static - * @param {google.api.IHttpRule} message HttpRule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HttpRule.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); - if (message.get != null && Object.hasOwnProperty.call(message, "get")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); - if (message.put != null && Object.hasOwnProperty.call(message, "put")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); - if (message.post != null && Object.hasOwnProperty.call(message, "post")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); - if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); - if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); - if (message.body != null && Object.hasOwnProperty.call(message, "body")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); - if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) - $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.additionalBindings != null && message.additionalBindings.length) - for (var i = 0; i < message.additionalBindings.length; ++i) - $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); - return writer; - }; - - /** - * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.HttpRule - * @static - * @param {google.api.IHttpRule} message HttpRule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HttpRule.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a HttpRule message from the specified reader or buffer. - * @function decode - * @memberof google.api.HttpRule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.HttpRule} HttpRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HttpRule.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.selector = reader.string(); - break; - } - case 2: { - message.get = reader.string(); - break; - } - case 3: { - message.put = reader.string(); - break; - } - case 4: { - message.post = reader.string(); - break; - } - case 5: { - message["delete"] = reader.string(); - break; - } - case 6: { - message.patch = reader.string(); - break; - } - case 8: { - message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); - break; - } - case 7: { - message.body = reader.string(); - break; - } - case 12: { - message.responseBody = reader.string(); - break; - } - case 11: { - if (!(message.additionalBindings && message.additionalBindings.length)) - message.additionalBindings = []; - message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a HttpRule message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.HttpRule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.HttpRule} HttpRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HttpRule.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a HttpRule message. - * @function verify - * @memberof google.api.HttpRule - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - HttpRule.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.selector != null && message.hasOwnProperty("selector")) - if (!$util.isString(message.selector)) - return "selector: string expected"; - if (message.get != null && message.hasOwnProperty("get")) { - properties.pattern = 1; - if (!$util.isString(message.get)) - return "get: string expected"; - } - if (message.put != null && message.hasOwnProperty("put")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message.put)) - return "put: string expected"; - } - if (message.post != null && message.hasOwnProperty("post")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message.post)) - return "post: string expected"; - } - if (message["delete"] != null && message.hasOwnProperty("delete")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message["delete"])) - return "delete: string expected"; - } - if (message.patch != null && message.hasOwnProperty("patch")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message.patch)) - return "patch: string expected"; - } - if (message.custom != null && message.hasOwnProperty("custom")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - { - var error = $root.google.api.CustomHttpPattern.verify(message.custom); - if (error) - return "custom." + error; - } - } - if (message.body != null && message.hasOwnProperty("body")) - if (!$util.isString(message.body)) - return "body: string expected"; - if (message.responseBody != null && message.hasOwnProperty("responseBody")) - if (!$util.isString(message.responseBody)) - return "responseBody: string expected"; - if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) { - if (!Array.isArray(message.additionalBindings)) - return "additionalBindings: array expected"; - for (var i = 0; i < message.additionalBindings.length; ++i) { - var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]); - if (error) - return "additionalBindings." + error; - } - } - return null; - }; - - /** - * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.HttpRule - * @static - * @param {Object.} object Plain object - * @returns {google.api.HttpRule} HttpRule - */ - HttpRule.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.HttpRule) - return object; - var message = new $root.google.api.HttpRule(); - if (object.selector != null) - message.selector = String(object.selector); - if (object.get != null) - message.get = String(object.get); - if (object.put != null) - message.put = String(object.put); - if (object.post != null) - message.post = String(object.post); - if (object["delete"] != null) - message["delete"] = String(object["delete"]); - if (object.patch != null) - message.patch = String(object.patch); - if (object.custom != null) { - if (typeof object.custom !== "object") - throw TypeError(".google.api.HttpRule.custom: object expected"); - message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); - } - if (object.body != null) - message.body = String(object.body); - if (object.responseBody != null) - message.responseBody = String(object.responseBody); - if (object.additionalBindings) { - if (!Array.isArray(object.additionalBindings)) - throw TypeError(".google.api.HttpRule.additionalBindings: array expected"); - message.additionalBindings = []; - for (var i = 0; i < object.additionalBindings.length; ++i) { - if (typeof object.additionalBindings[i] !== "object") - throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); - message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a HttpRule message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.HttpRule - * @static - * @param {google.api.HttpRule} message HttpRule - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - HttpRule.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.additionalBindings = []; - if (options.defaults) { - object.selector = ""; - object.body = ""; - object.responseBody = ""; - } - if (message.selector != null && message.hasOwnProperty("selector")) - object.selector = message.selector; - if (message.get != null && message.hasOwnProperty("get")) { - object.get = message.get; - if (options.oneofs) - object.pattern = "get"; - } - if (message.put != null && message.hasOwnProperty("put")) { - object.put = message.put; - if (options.oneofs) - object.pattern = "put"; - } - if (message.post != null && message.hasOwnProperty("post")) { - object.post = message.post; - if (options.oneofs) - object.pattern = "post"; - } - if (message["delete"] != null && message.hasOwnProperty("delete")) { - object["delete"] = message["delete"]; - if (options.oneofs) - object.pattern = "delete"; - } - if (message.patch != null && message.hasOwnProperty("patch")) { - object.patch = message.patch; - if (options.oneofs) - object.pattern = "patch"; - } - if (message.body != null && message.hasOwnProperty("body")) - object.body = message.body; - if (message.custom != null && message.hasOwnProperty("custom")) { - object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); - if (options.oneofs) - object.pattern = "custom"; - } - if (message.additionalBindings && message.additionalBindings.length) { - object.additionalBindings = []; - for (var j = 0; j < message.additionalBindings.length; ++j) - object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options); - } - if (message.responseBody != null && message.hasOwnProperty("responseBody")) - object.responseBody = message.responseBody; - return object; - }; - - /** - * Converts this HttpRule to JSON. - * @function toJSON - * @memberof google.api.HttpRule - * @instance - * @returns {Object.} JSON object - */ - HttpRule.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for HttpRule - * @function getTypeUrl - * @memberof google.api.HttpRule - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - HttpRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.HttpRule"; - }; - - return HttpRule; - })(); - - api.CustomHttpPattern = (function() { - - /** - * Properties of a CustomHttpPattern. - * @memberof google.api - * @interface ICustomHttpPattern - * @property {string|null} [kind] CustomHttpPattern kind - * @property {string|null} [path] CustomHttpPattern path - */ - - /** - * Constructs a new CustomHttpPattern. - * @memberof google.api - * @classdesc Represents a CustomHttpPattern. - * @implements ICustomHttpPattern - * @constructor - * @param {google.api.ICustomHttpPattern=} [properties] Properties to set - */ - function CustomHttpPattern(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CustomHttpPattern kind. - * @member {string} kind - * @memberof google.api.CustomHttpPattern - * @instance - */ - CustomHttpPattern.prototype.kind = ""; - - /** - * CustomHttpPattern path. - * @member {string} path - * @memberof google.api.CustomHttpPattern - * @instance - */ - CustomHttpPattern.prototype.path = ""; - - /** - * Creates a new CustomHttpPattern instance using the specified properties. - * @function create - * @memberof google.api.CustomHttpPattern - * @static - * @param {google.api.ICustomHttpPattern=} [properties] Properties to set - * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance - */ - CustomHttpPattern.create = function create(properties) { - return new CustomHttpPattern(properties); - }; - - /** - * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. - * @function encode - * @memberof google.api.CustomHttpPattern - * @static - * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CustomHttpPattern.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); - if (message.path != null && Object.hasOwnProperty.call(message, "path")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); - return writer; - }; - - /** - * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.CustomHttpPattern - * @static - * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CustomHttpPattern message from the specified reader or buffer. - * @function decode - * @memberof google.api.CustomHttpPattern - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.CustomHttpPattern} CustomHttpPattern - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CustomHttpPattern.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.kind = reader.string(); - break; - } - case 2: { - message.path = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.CustomHttpPattern - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.CustomHttpPattern} CustomHttpPattern - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CustomHttpPattern message. - * @function verify - * @memberof google.api.CustomHttpPattern - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CustomHttpPattern.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.kind != null && message.hasOwnProperty("kind")) - if (!$util.isString(message.kind)) - return "kind: string expected"; - if (message.path != null && message.hasOwnProperty("path")) - if (!$util.isString(message.path)) - return "path: string expected"; - return null; - }; - - /** - * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.CustomHttpPattern - * @static - * @param {Object.} object Plain object - * @returns {google.api.CustomHttpPattern} CustomHttpPattern - */ - CustomHttpPattern.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.CustomHttpPattern) - return object; - var message = new $root.google.api.CustomHttpPattern(); - if (object.kind != null) - message.kind = String(object.kind); - if (object.path != null) - message.path = String(object.path); - return message; - }; - - /** - * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.CustomHttpPattern - * @static - * @param {google.api.CustomHttpPattern} message CustomHttpPattern - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CustomHttpPattern.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.kind = ""; - object.path = ""; - } - if (message.kind != null && message.hasOwnProperty("kind")) - object.kind = message.kind; - if (message.path != null && message.hasOwnProperty("path")) - object.path = message.path; - return object; - }; - - /** - * Converts this CustomHttpPattern to JSON. - * @function toJSON - * @memberof google.api.CustomHttpPattern - * @instance - * @returns {Object.} JSON object - */ - CustomHttpPattern.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CustomHttpPattern - * @function getTypeUrl - * @memberof google.api.CustomHttpPattern - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CustomHttpPattern.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.CustomHttpPattern"; - }; - - return CustomHttpPattern; - })(); - - api.CommonLanguageSettings = (function() { - - /** - * Properties of a CommonLanguageSettings. - * @memberof google.api - * @interface ICommonLanguageSettings - * @property {string|null} [referenceDocsUri] CommonLanguageSettings referenceDocsUri - * @property {Array.|null} [destinations] CommonLanguageSettings destinations - */ - - /** - * Constructs a new CommonLanguageSettings. - * @memberof google.api - * @classdesc Represents a CommonLanguageSettings. - * @implements ICommonLanguageSettings - * @constructor - * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set - */ - function CommonLanguageSettings(properties) { - this.destinations = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CommonLanguageSettings referenceDocsUri. - * @member {string} referenceDocsUri - * @memberof google.api.CommonLanguageSettings - * @instance - */ - CommonLanguageSettings.prototype.referenceDocsUri = ""; - - /** - * CommonLanguageSettings destinations. - * @member {Array.} destinations - * @memberof google.api.CommonLanguageSettings - * @instance - */ - CommonLanguageSettings.prototype.destinations = $util.emptyArray; - - /** - * Creates a new CommonLanguageSettings instance using the specified properties. - * @function create - * @memberof google.api.CommonLanguageSettings - * @static - * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set - * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings instance - */ - CommonLanguageSettings.create = function create(properties) { - return new CommonLanguageSettings(properties); - }; - - /** - * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. - * @function encode - * @memberof google.api.CommonLanguageSettings - * @static - * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CommonLanguageSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.referenceDocsUri != null && Object.hasOwnProperty.call(message, "referenceDocsUri")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.referenceDocsUri); - if (message.destinations != null && message.destinations.length) { - writer.uint32(/* id 2, wireType 2 =*/18).fork(); - for (var i = 0; i < message.destinations.length; ++i) - writer.int32(message.destinations[i]); - writer.ldelim(); - } - return writer; - }; - - /** - * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.CommonLanguageSettings - * @static - * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CommonLanguageSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CommonLanguageSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.CommonLanguageSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CommonLanguageSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CommonLanguageSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.referenceDocsUri = reader.string(); - break; - } - case 2: { - if (!(message.destinations && message.destinations.length)) - message.destinations = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.destinations.push(reader.int32()); - } else - message.destinations.push(reader.int32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.CommonLanguageSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CommonLanguageSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CommonLanguageSettings message. - * @function verify - * @memberof google.api.CommonLanguageSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CommonLanguageSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) - if (!$util.isString(message.referenceDocsUri)) - return "referenceDocsUri: string expected"; - if (message.destinations != null && message.hasOwnProperty("destinations")) { - if (!Array.isArray(message.destinations)) - return "destinations: array expected"; - for (var i = 0; i < message.destinations.length; ++i) - switch (message.destinations[i]) { - default: - return "destinations: enum value[] expected"; - case 0: - case 10: - case 20: - break; - } - } - return null; - }; - - /** - * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.CommonLanguageSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings - */ - CommonLanguageSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.CommonLanguageSettings) - return object; - var message = new $root.google.api.CommonLanguageSettings(); - if (object.referenceDocsUri != null) - message.referenceDocsUri = String(object.referenceDocsUri); - if (object.destinations) { - if (!Array.isArray(object.destinations)) - throw TypeError(".google.api.CommonLanguageSettings.destinations: array expected"); - message.destinations = []; - for (var i = 0; i < object.destinations.length; ++i) - switch (object.destinations[i]) { - default: - if (typeof object.destinations[i] === "number") { - message.destinations[i] = object.destinations[i]; - break; - } - case "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": - case 0: - message.destinations[i] = 0; - break; - case "GITHUB": - case 10: - message.destinations[i] = 10; - break; - case "PACKAGE_MANAGER": - case 20: - message.destinations[i] = 20; - break; - } - } - return message; - }; - - /** - * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.CommonLanguageSettings - * @static - * @param {google.api.CommonLanguageSettings} message CommonLanguageSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CommonLanguageSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.destinations = []; - if (options.defaults) - object.referenceDocsUri = ""; - if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) - object.referenceDocsUri = message.referenceDocsUri; - if (message.destinations && message.destinations.length) { - object.destinations = []; - for (var j = 0; j < message.destinations.length; ++j) - object.destinations[j] = options.enums === String ? $root.google.api.ClientLibraryDestination[message.destinations[j]] === undefined ? message.destinations[j] : $root.google.api.ClientLibraryDestination[message.destinations[j]] : message.destinations[j]; - } - return object; - }; - - /** - * Converts this CommonLanguageSettings to JSON. - * @function toJSON - * @memberof google.api.CommonLanguageSettings - * @instance - * @returns {Object.} JSON object - */ - CommonLanguageSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CommonLanguageSettings - * @function getTypeUrl - * @memberof google.api.CommonLanguageSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CommonLanguageSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.CommonLanguageSettings"; - }; - - return CommonLanguageSettings; - })(); - - api.ClientLibrarySettings = (function() { - - /** - * Properties of a ClientLibrarySettings. - * @memberof google.api - * @interface IClientLibrarySettings - * @property {string|null} [version] ClientLibrarySettings version - * @property {google.api.LaunchStage|null} [launchStage] ClientLibrarySettings launchStage - * @property {boolean|null} [restNumericEnums] ClientLibrarySettings restNumericEnums - * @property {google.api.IJavaSettings|null} [javaSettings] ClientLibrarySettings javaSettings - * @property {google.api.ICppSettings|null} [cppSettings] ClientLibrarySettings cppSettings - * @property {google.api.IPhpSettings|null} [phpSettings] ClientLibrarySettings phpSettings - * @property {google.api.IPythonSettings|null} [pythonSettings] ClientLibrarySettings pythonSettings - * @property {google.api.INodeSettings|null} [nodeSettings] ClientLibrarySettings nodeSettings - * @property {google.api.IDotnetSettings|null} [dotnetSettings] ClientLibrarySettings dotnetSettings - * @property {google.api.IRubySettings|null} [rubySettings] ClientLibrarySettings rubySettings - * @property {google.api.IGoSettings|null} [goSettings] ClientLibrarySettings goSettings - */ - - /** - * Constructs a new ClientLibrarySettings. - * @memberof google.api - * @classdesc Represents a ClientLibrarySettings. - * @implements IClientLibrarySettings - * @constructor - * @param {google.api.IClientLibrarySettings=} [properties] Properties to set - */ - function ClientLibrarySettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ClientLibrarySettings version. - * @member {string} version - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.version = ""; - - /** - * ClientLibrarySettings launchStage. - * @member {google.api.LaunchStage} launchStage - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.launchStage = 0; - - /** - * ClientLibrarySettings restNumericEnums. - * @member {boolean} restNumericEnums - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.restNumericEnums = false; - - /** - * ClientLibrarySettings javaSettings. - * @member {google.api.IJavaSettings|null|undefined} javaSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.javaSettings = null; - - /** - * ClientLibrarySettings cppSettings. - * @member {google.api.ICppSettings|null|undefined} cppSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.cppSettings = null; - - /** - * ClientLibrarySettings phpSettings. - * @member {google.api.IPhpSettings|null|undefined} phpSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.phpSettings = null; - - /** - * ClientLibrarySettings pythonSettings. - * @member {google.api.IPythonSettings|null|undefined} pythonSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.pythonSettings = null; - - /** - * ClientLibrarySettings nodeSettings. - * @member {google.api.INodeSettings|null|undefined} nodeSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.nodeSettings = null; - - /** - * ClientLibrarySettings dotnetSettings. - * @member {google.api.IDotnetSettings|null|undefined} dotnetSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.dotnetSettings = null; - - /** - * ClientLibrarySettings rubySettings. - * @member {google.api.IRubySettings|null|undefined} rubySettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.rubySettings = null; - - /** - * ClientLibrarySettings goSettings. - * @member {google.api.IGoSettings|null|undefined} goSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.goSettings = null; - - /** - * Creates a new ClientLibrarySettings instance using the specified properties. - * @function create - * @memberof google.api.ClientLibrarySettings - * @static - * @param {google.api.IClientLibrarySettings=} [properties] Properties to set - * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings instance - */ - ClientLibrarySettings.create = function create(properties) { - return new ClientLibrarySettings(properties); - }; - - /** - * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. - * @function encode - * @memberof google.api.ClientLibrarySettings - * @static - * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClientLibrarySettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); - if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.launchStage); - if (message.restNumericEnums != null && Object.hasOwnProperty.call(message, "restNumericEnums")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.restNumericEnums); - if (message.javaSettings != null && Object.hasOwnProperty.call(message, "javaSettings")) - $root.google.api.JavaSettings.encode(message.javaSettings, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); - if (message.cppSettings != null && Object.hasOwnProperty.call(message, "cppSettings")) - $root.google.api.CppSettings.encode(message.cppSettings, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); - if (message.phpSettings != null && Object.hasOwnProperty.call(message, "phpSettings")) - $root.google.api.PhpSettings.encode(message.phpSettings, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); - if (message.pythonSettings != null && Object.hasOwnProperty.call(message, "pythonSettings")) - $root.google.api.PythonSettings.encode(message.pythonSettings, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); - if (message.nodeSettings != null && Object.hasOwnProperty.call(message, "nodeSettings")) - $root.google.api.NodeSettings.encode(message.nodeSettings, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); - if (message.dotnetSettings != null && Object.hasOwnProperty.call(message, "dotnetSettings")) - $root.google.api.DotnetSettings.encode(message.dotnetSettings, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); - if (message.rubySettings != null && Object.hasOwnProperty.call(message, "rubySettings")) - $root.google.api.RubySettings.encode(message.rubySettings, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); - if (message.goSettings != null && Object.hasOwnProperty.call(message, "goSettings")) - $root.google.api.GoSettings.encode(message.goSettings, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.ClientLibrarySettings - * @static - * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClientLibrarySettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ClientLibrarySettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.ClientLibrarySettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClientLibrarySettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ClientLibrarySettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.version = reader.string(); - break; - } - case 2: { - message.launchStage = reader.int32(); - break; - } - case 3: { - message.restNumericEnums = reader.bool(); - break; - } - case 21: { - message.javaSettings = $root.google.api.JavaSettings.decode(reader, reader.uint32()); - break; - } - case 22: { - message.cppSettings = $root.google.api.CppSettings.decode(reader, reader.uint32()); - break; - } - case 23: { - message.phpSettings = $root.google.api.PhpSettings.decode(reader, reader.uint32()); - break; - } - case 24: { - message.pythonSettings = $root.google.api.PythonSettings.decode(reader, reader.uint32()); - break; - } - case 25: { - message.nodeSettings = $root.google.api.NodeSettings.decode(reader, reader.uint32()); - break; - } - case 26: { - message.dotnetSettings = $root.google.api.DotnetSettings.decode(reader, reader.uint32()); - break; - } - case 27: { - message.rubySettings = $root.google.api.RubySettings.decode(reader, reader.uint32()); - break; - } - case 28: { - message.goSettings = $root.google.api.GoSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.ClientLibrarySettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClientLibrarySettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ClientLibrarySettings message. - * @function verify - * @memberof google.api.ClientLibrarySettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ClientLibrarySettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.version != null && message.hasOwnProperty("version")) - if (!$util.isString(message.version)) - return "version: string expected"; - if (message.launchStage != null && message.hasOwnProperty("launchStage")) - switch (message.launchStage) { - default: - return "launchStage: enum value expected"; - case 0: - case 6: - case 7: - case 1: - case 2: - case 3: - case 4: - case 5: - break; - } - if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) - if (typeof message.restNumericEnums !== "boolean") - return "restNumericEnums: boolean expected"; - if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) { - var error = $root.google.api.JavaSettings.verify(message.javaSettings); - if (error) - return "javaSettings." + error; - } - if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) { - var error = $root.google.api.CppSettings.verify(message.cppSettings); - if (error) - return "cppSettings." + error; - } - if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) { - var error = $root.google.api.PhpSettings.verify(message.phpSettings); - if (error) - return "phpSettings." + error; - } - if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) { - var error = $root.google.api.PythonSettings.verify(message.pythonSettings); - if (error) - return "pythonSettings." + error; - } - if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) { - var error = $root.google.api.NodeSettings.verify(message.nodeSettings); - if (error) - return "nodeSettings." + error; - } - if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) { - var error = $root.google.api.DotnetSettings.verify(message.dotnetSettings); - if (error) - return "dotnetSettings." + error; - } - if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) { - var error = $root.google.api.RubySettings.verify(message.rubySettings); - if (error) - return "rubySettings." + error; - } - if (message.goSettings != null && message.hasOwnProperty("goSettings")) { - var error = $root.google.api.GoSettings.verify(message.goSettings); - if (error) - return "goSettings." + error; - } - return null; - }; - - /** - * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.ClientLibrarySettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings - */ - ClientLibrarySettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.ClientLibrarySettings) - return object; - var message = new $root.google.api.ClientLibrarySettings(); - if (object.version != null) - message.version = String(object.version); - switch (object.launchStage) { - default: - if (typeof object.launchStage === "number") { - message.launchStage = object.launchStage; - break; - } - break; - case "LAUNCH_STAGE_UNSPECIFIED": - case 0: - message.launchStage = 0; - break; - case "UNIMPLEMENTED": - case 6: - message.launchStage = 6; - break; - case "PRELAUNCH": - case 7: - message.launchStage = 7; - break; - case "EARLY_ACCESS": - case 1: - message.launchStage = 1; - break; - case "ALPHA": - case 2: - message.launchStage = 2; - break; - case "BETA": - case 3: - message.launchStage = 3; - break; - case "GA": - case 4: - message.launchStage = 4; - break; - case "DEPRECATED": - case 5: - message.launchStage = 5; - break; - } - if (object.restNumericEnums != null) - message.restNumericEnums = Boolean(object.restNumericEnums); - if (object.javaSettings != null) { - if (typeof object.javaSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.javaSettings: object expected"); - message.javaSettings = $root.google.api.JavaSettings.fromObject(object.javaSettings); - } - if (object.cppSettings != null) { - if (typeof object.cppSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.cppSettings: object expected"); - message.cppSettings = $root.google.api.CppSettings.fromObject(object.cppSettings); - } - if (object.phpSettings != null) { - if (typeof object.phpSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.phpSettings: object expected"); - message.phpSettings = $root.google.api.PhpSettings.fromObject(object.phpSettings); - } - if (object.pythonSettings != null) { - if (typeof object.pythonSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.pythonSettings: object expected"); - message.pythonSettings = $root.google.api.PythonSettings.fromObject(object.pythonSettings); - } - if (object.nodeSettings != null) { - if (typeof object.nodeSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.nodeSettings: object expected"); - message.nodeSettings = $root.google.api.NodeSettings.fromObject(object.nodeSettings); - } - if (object.dotnetSettings != null) { - if (typeof object.dotnetSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.dotnetSettings: object expected"); - message.dotnetSettings = $root.google.api.DotnetSettings.fromObject(object.dotnetSettings); - } - if (object.rubySettings != null) { - if (typeof object.rubySettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.rubySettings: object expected"); - message.rubySettings = $root.google.api.RubySettings.fromObject(object.rubySettings); - } - if (object.goSettings != null) { - if (typeof object.goSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.goSettings: object expected"); - message.goSettings = $root.google.api.GoSettings.fromObject(object.goSettings); - } - return message; - }; - - /** - * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.ClientLibrarySettings - * @static - * @param {google.api.ClientLibrarySettings} message ClientLibrarySettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ClientLibrarySettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.version = ""; - object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; - object.restNumericEnums = false; - object.javaSettings = null; - object.cppSettings = null; - object.phpSettings = null; - object.pythonSettings = null; - object.nodeSettings = null; - object.dotnetSettings = null; - object.rubySettings = null; - object.goSettings = null; - } - if (message.version != null && message.hasOwnProperty("version")) - object.version = message.version; - if (message.launchStage != null && message.hasOwnProperty("launchStage")) - object.launchStage = options.enums === String ? $root.google.api.LaunchStage[message.launchStage] === undefined ? message.launchStage : $root.google.api.LaunchStage[message.launchStage] : message.launchStage; - if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) - object.restNumericEnums = message.restNumericEnums; - if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) - object.javaSettings = $root.google.api.JavaSettings.toObject(message.javaSettings, options); - if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) - object.cppSettings = $root.google.api.CppSettings.toObject(message.cppSettings, options); - if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) - object.phpSettings = $root.google.api.PhpSettings.toObject(message.phpSettings, options); - if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) - object.pythonSettings = $root.google.api.PythonSettings.toObject(message.pythonSettings, options); - if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) - object.nodeSettings = $root.google.api.NodeSettings.toObject(message.nodeSettings, options); - if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) - object.dotnetSettings = $root.google.api.DotnetSettings.toObject(message.dotnetSettings, options); - if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) - object.rubySettings = $root.google.api.RubySettings.toObject(message.rubySettings, options); - if (message.goSettings != null && message.hasOwnProperty("goSettings")) - object.goSettings = $root.google.api.GoSettings.toObject(message.goSettings, options); - return object; - }; - - /** - * Converts this ClientLibrarySettings to JSON. - * @function toJSON - * @memberof google.api.ClientLibrarySettings - * @instance - * @returns {Object.} JSON object - */ - ClientLibrarySettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ClientLibrarySettings - * @function getTypeUrl - * @memberof google.api.ClientLibrarySettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ClientLibrarySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.ClientLibrarySettings"; - }; - - return ClientLibrarySettings; - })(); - - api.Publishing = (function() { - - /** - * Properties of a Publishing. - * @memberof google.api - * @interface IPublishing - * @property {Array.|null} [methodSettings] Publishing methodSettings - * @property {string|null} [newIssueUri] Publishing newIssueUri - * @property {string|null} [documentationUri] Publishing documentationUri - * @property {string|null} [apiShortName] Publishing apiShortName - * @property {string|null} [githubLabel] Publishing githubLabel - * @property {Array.|null} [codeownerGithubTeams] Publishing codeownerGithubTeams - * @property {string|null} [docTagPrefix] Publishing docTagPrefix - * @property {google.api.ClientLibraryOrganization|null} [organization] Publishing organization - * @property {Array.|null} [librarySettings] Publishing librarySettings - * @property {string|null} [protoReferenceDocumentationUri] Publishing protoReferenceDocumentationUri - * @property {string|null} [restReferenceDocumentationUri] Publishing restReferenceDocumentationUri - */ - - /** - * Constructs a new Publishing. - * @memberof google.api - * @classdesc Represents a Publishing. - * @implements IPublishing - * @constructor - * @param {google.api.IPublishing=} [properties] Properties to set - */ - function Publishing(properties) { - this.methodSettings = []; - this.codeownerGithubTeams = []; - this.librarySettings = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Publishing methodSettings. - * @member {Array.} methodSettings - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.methodSettings = $util.emptyArray; - - /** - * Publishing newIssueUri. - * @member {string} newIssueUri - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.newIssueUri = ""; - - /** - * Publishing documentationUri. - * @member {string} documentationUri - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.documentationUri = ""; - - /** - * Publishing apiShortName. - * @member {string} apiShortName - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.apiShortName = ""; - - /** - * Publishing githubLabel. - * @member {string} githubLabel - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.githubLabel = ""; - - /** - * Publishing codeownerGithubTeams. - * @member {Array.} codeownerGithubTeams - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.codeownerGithubTeams = $util.emptyArray; - - /** - * Publishing docTagPrefix. - * @member {string} docTagPrefix - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.docTagPrefix = ""; - - /** - * Publishing organization. - * @member {google.api.ClientLibraryOrganization} organization - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.organization = 0; - - /** - * Publishing librarySettings. - * @member {Array.} librarySettings - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.librarySettings = $util.emptyArray; - - /** - * Publishing protoReferenceDocumentationUri. - * @member {string} protoReferenceDocumentationUri - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.protoReferenceDocumentationUri = ""; - - /** - * Publishing restReferenceDocumentationUri. - * @member {string} restReferenceDocumentationUri - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.restReferenceDocumentationUri = ""; - - /** - * Creates a new Publishing instance using the specified properties. - * @function create - * @memberof google.api.Publishing - * @static - * @param {google.api.IPublishing=} [properties] Properties to set - * @returns {google.api.Publishing} Publishing instance - */ - Publishing.create = function create(properties) { - return new Publishing(properties); - }; - - /** - * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. - * @function encode - * @memberof google.api.Publishing - * @static - * @param {google.api.IPublishing} message Publishing message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Publishing.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.methodSettings != null && message.methodSettings.length) - for (var i = 0; i < message.methodSettings.length; ++i) - $root.google.api.MethodSettings.encode(message.methodSettings[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.newIssueUri != null && Object.hasOwnProperty.call(message, "newIssueUri")) - writer.uint32(/* id 101, wireType 2 =*/810).string(message.newIssueUri); - if (message.documentationUri != null && Object.hasOwnProperty.call(message, "documentationUri")) - writer.uint32(/* id 102, wireType 2 =*/818).string(message.documentationUri); - if (message.apiShortName != null && Object.hasOwnProperty.call(message, "apiShortName")) - writer.uint32(/* id 103, wireType 2 =*/826).string(message.apiShortName); - if (message.githubLabel != null && Object.hasOwnProperty.call(message, "githubLabel")) - writer.uint32(/* id 104, wireType 2 =*/834).string(message.githubLabel); - if (message.codeownerGithubTeams != null && message.codeownerGithubTeams.length) - for (var i = 0; i < message.codeownerGithubTeams.length; ++i) - writer.uint32(/* id 105, wireType 2 =*/842).string(message.codeownerGithubTeams[i]); - if (message.docTagPrefix != null && Object.hasOwnProperty.call(message, "docTagPrefix")) - writer.uint32(/* id 106, wireType 2 =*/850).string(message.docTagPrefix); - if (message.organization != null && Object.hasOwnProperty.call(message, "organization")) - writer.uint32(/* id 107, wireType 0 =*/856).int32(message.organization); - if (message.librarySettings != null && message.librarySettings.length) - for (var i = 0; i < message.librarySettings.length; ++i) - $root.google.api.ClientLibrarySettings.encode(message.librarySettings[i], writer.uint32(/* id 109, wireType 2 =*/874).fork()).ldelim(); - if (message.protoReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "protoReferenceDocumentationUri")) - writer.uint32(/* id 110, wireType 2 =*/882).string(message.protoReferenceDocumentationUri); - if (message.restReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "restReferenceDocumentationUri")) - writer.uint32(/* id 111, wireType 2 =*/890).string(message.restReferenceDocumentationUri); - return writer; - }; - - /** - * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.Publishing - * @static - * @param {google.api.IPublishing} message Publishing message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Publishing.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Publishing message from the specified reader or buffer. - * @function decode - * @memberof google.api.Publishing - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.Publishing} Publishing - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Publishing.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Publishing(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - if (!(message.methodSettings && message.methodSettings.length)) - message.methodSettings = []; - message.methodSettings.push($root.google.api.MethodSettings.decode(reader, reader.uint32())); - break; - } - case 101: { - message.newIssueUri = reader.string(); - break; - } - case 102: { - message.documentationUri = reader.string(); - break; - } - case 103: { - message.apiShortName = reader.string(); - break; - } - case 104: { - message.githubLabel = reader.string(); - break; - } - case 105: { - if (!(message.codeownerGithubTeams && message.codeownerGithubTeams.length)) - message.codeownerGithubTeams = []; - message.codeownerGithubTeams.push(reader.string()); - break; - } - case 106: { - message.docTagPrefix = reader.string(); - break; - } - case 107: { - message.organization = reader.int32(); - break; - } - case 109: { - if (!(message.librarySettings && message.librarySettings.length)) - message.librarySettings = []; - message.librarySettings.push($root.google.api.ClientLibrarySettings.decode(reader, reader.uint32())); - break; - } - case 110: { - message.protoReferenceDocumentationUri = reader.string(); - break; - } - case 111: { - message.restReferenceDocumentationUri = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Publishing message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.Publishing - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.Publishing} Publishing - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Publishing.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Publishing message. - * @function verify - * @memberof google.api.Publishing - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Publishing.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.methodSettings != null && message.hasOwnProperty("methodSettings")) { - if (!Array.isArray(message.methodSettings)) - return "methodSettings: array expected"; - for (var i = 0; i < message.methodSettings.length; ++i) { - var error = $root.google.api.MethodSettings.verify(message.methodSettings[i]); - if (error) - return "methodSettings." + error; - } - } - if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) - if (!$util.isString(message.newIssueUri)) - return "newIssueUri: string expected"; - if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) - if (!$util.isString(message.documentationUri)) - return "documentationUri: string expected"; - if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) - if (!$util.isString(message.apiShortName)) - return "apiShortName: string expected"; - if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) - if (!$util.isString(message.githubLabel)) - return "githubLabel: string expected"; - if (message.codeownerGithubTeams != null && message.hasOwnProperty("codeownerGithubTeams")) { - if (!Array.isArray(message.codeownerGithubTeams)) - return "codeownerGithubTeams: array expected"; - for (var i = 0; i < message.codeownerGithubTeams.length; ++i) - if (!$util.isString(message.codeownerGithubTeams[i])) - return "codeownerGithubTeams: string[] expected"; - } - if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) - if (!$util.isString(message.docTagPrefix)) - return "docTagPrefix: string expected"; - if (message.organization != null && message.hasOwnProperty("organization")) - switch (message.organization) { - default: - return "organization: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - break; - } - if (message.librarySettings != null && message.hasOwnProperty("librarySettings")) { - if (!Array.isArray(message.librarySettings)) - return "librarySettings: array expected"; - for (var i = 0; i < message.librarySettings.length; ++i) { - var error = $root.google.api.ClientLibrarySettings.verify(message.librarySettings[i]); - if (error) - return "librarySettings." + error; - } - } - if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) - if (!$util.isString(message.protoReferenceDocumentationUri)) - return "protoReferenceDocumentationUri: string expected"; - if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) - if (!$util.isString(message.restReferenceDocumentationUri)) - return "restReferenceDocumentationUri: string expected"; - return null; - }; - - /** - * Creates a Publishing message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.Publishing - * @static - * @param {Object.} object Plain object - * @returns {google.api.Publishing} Publishing - */ - Publishing.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.Publishing) - return object; - var message = new $root.google.api.Publishing(); - if (object.methodSettings) { - if (!Array.isArray(object.methodSettings)) - throw TypeError(".google.api.Publishing.methodSettings: array expected"); - message.methodSettings = []; - for (var i = 0; i < object.methodSettings.length; ++i) { - if (typeof object.methodSettings[i] !== "object") - throw TypeError(".google.api.Publishing.methodSettings: object expected"); - message.methodSettings[i] = $root.google.api.MethodSettings.fromObject(object.methodSettings[i]); - } - } - if (object.newIssueUri != null) - message.newIssueUri = String(object.newIssueUri); - if (object.documentationUri != null) - message.documentationUri = String(object.documentationUri); - if (object.apiShortName != null) - message.apiShortName = String(object.apiShortName); - if (object.githubLabel != null) - message.githubLabel = String(object.githubLabel); - if (object.codeownerGithubTeams) { - if (!Array.isArray(object.codeownerGithubTeams)) - throw TypeError(".google.api.Publishing.codeownerGithubTeams: array expected"); - message.codeownerGithubTeams = []; - for (var i = 0; i < object.codeownerGithubTeams.length; ++i) - message.codeownerGithubTeams[i] = String(object.codeownerGithubTeams[i]); - } - if (object.docTagPrefix != null) - message.docTagPrefix = String(object.docTagPrefix); - switch (object.organization) { - default: - if (typeof object.organization === "number") { - message.organization = object.organization; - break; - } - break; - case "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": - case 0: - message.organization = 0; - break; - case "CLOUD": - case 1: - message.organization = 1; - break; - case "ADS": - case 2: - message.organization = 2; - break; - case "PHOTOS": - case 3: - message.organization = 3; - break; - case "STREET_VIEW": - case 4: - message.organization = 4; - break; - case "SHOPPING": - case 5: - message.organization = 5; - break; - case "GEO": - case 6: - message.organization = 6; - break; - case "GENERATIVE_AI": - case 7: - message.organization = 7; - break; - } - if (object.librarySettings) { - if (!Array.isArray(object.librarySettings)) - throw TypeError(".google.api.Publishing.librarySettings: array expected"); - message.librarySettings = []; - for (var i = 0; i < object.librarySettings.length; ++i) { - if (typeof object.librarySettings[i] !== "object") - throw TypeError(".google.api.Publishing.librarySettings: object expected"); - message.librarySettings[i] = $root.google.api.ClientLibrarySettings.fromObject(object.librarySettings[i]); - } - } - if (object.protoReferenceDocumentationUri != null) - message.protoReferenceDocumentationUri = String(object.protoReferenceDocumentationUri); - if (object.restReferenceDocumentationUri != null) - message.restReferenceDocumentationUri = String(object.restReferenceDocumentationUri); - return message; - }; - - /** - * Creates a plain object from a Publishing message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.Publishing - * @static - * @param {google.api.Publishing} message Publishing - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Publishing.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.methodSettings = []; - object.codeownerGithubTeams = []; - object.librarySettings = []; - } - if (options.defaults) { - object.newIssueUri = ""; - object.documentationUri = ""; - object.apiShortName = ""; - object.githubLabel = ""; - object.docTagPrefix = ""; - object.organization = options.enums === String ? "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED" : 0; - object.protoReferenceDocumentationUri = ""; - object.restReferenceDocumentationUri = ""; - } - if (message.methodSettings && message.methodSettings.length) { - object.methodSettings = []; - for (var j = 0; j < message.methodSettings.length; ++j) - object.methodSettings[j] = $root.google.api.MethodSettings.toObject(message.methodSettings[j], options); - } - if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) - object.newIssueUri = message.newIssueUri; - if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) - object.documentationUri = message.documentationUri; - if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) - object.apiShortName = message.apiShortName; - if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) - object.githubLabel = message.githubLabel; - if (message.codeownerGithubTeams && message.codeownerGithubTeams.length) { - object.codeownerGithubTeams = []; - for (var j = 0; j < message.codeownerGithubTeams.length; ++j) - object.codeownerGithubTeams[j] = message.codeownerGithubTeams[j]; - } - if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) - object.docTagPrefix = message.docTagPrefix; - if (message.organization != null && message.hasOwnProperty("organization")) - object.organization = options.enums === String ? $root.google.api.ClientLibraryOrganization[message.organization] === undefined ? message.organization : $root.google.api.ClientLibraryOrganization[message.organization] : message.organization; - if (message.librarySettings && message.librarySettings.length) { - object.librarySettings = []; - for (var j = 0; j < message.librarySettings.length; ++j) - object.librarySettings[j] = $root.google.api.ClientLibrarySettings.toObject(message.librarySettings[j], options); - } - if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) - object.protoReferenceDocumentationUri = message.protoReferenceDocumentationUri; - if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) - object.restReferenceDocumentationUri = message.restReferenceDocumentationUri; - return object; - }; - - /** - * Converts this Publishing to JSON. - * @function toJSON - * @memberof google.api.Publishing - * @instance - * @returns {Object.} JSON object - */ - Publishing.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Publishing - * @function getTypeUrl - * @memberof google.api.Publishing - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Publishing.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.Publishing"; - }; - - return Publishing; - })(); - - api.JavaSettings = (function() { - - /** - * Properties of a JavaSettings. - * @memberof google.api - * @interface IJavaSettings - * @property {string|null} [libraryPackage] JavaSettings libraryPackage - * @property {Object.|null} [serviceClassNames] JavaSettings serviceClassNames - * @property {google.api.ICommonLanguageSettings|null} [common] JavaSettings common - */ - - /** - * Constructs a new JavaSettings. - * @memberof google.api - * @classdesc Represents a JavaSettings. - * @implements IJavaSettings - * @constructor - * @param {google.api.IJavaSettings=} [properties] Properties to set - */ - function JavaSettings(properties) { - this.serviceClassNames = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * JavaSettings libraryPackage. - * @member {string} libraryPackage - * @memberof google.api.JavaSettings - * @instance - */ - JavaSettings.prototype.libraryPackage = ""; - - /** - * JavaSettings serviceClassNames. - * @member {Object.} serviceClassNames - * @memberof google.api.JavaSettings - * @instance - */ - JavaSettings.prototype.serviceClassNames = $util.emptyObject; - - /** - * JavaSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.JavaSettings - * @instance - */ - JavaSettings.prototype.common = null; - - /** - * Creates a new JavaSettings instance using the specified properties. - * @function create - * @memberof google.api.JavaSettings - * @static - * @param {google.api.IJavaSettings=} [properties] Properties to set - * @returns {google.api.JavaSettings} JavaSettings instance - */ - JavaSettings.create = function create(properties) { - return new JavaSettings(properties); - }; - - /** - * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. - * @function encode - * @memberof google.api.JavaSettings - * @static - * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - JavaSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.libraryPackage != null && Object.hasOwnProperty.call(message, "libraryPackage")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.libraryPackage); - if (message.serviceClassNames != null && Object.hasOwnProperty.call(message, "serviceClassNames")) - for (var keys = Object.keys(message.serviceClassNames), i = 0; i < keys.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.serviceClassNames[keys[i]]).ldelim(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.JavaSettings - * @static - * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - JavaSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a JavaSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.JavaSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.JavaSettings} JavaSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - JavaSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.JavaSettings(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.libraryPackage = reader.string(); - break; - } - case 2: { - if (message.serviceClassNames === $util.emptyObject) - message.serviceClassNames = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.serviceClassNames[key] = value; - break; - } - case 3: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a JavaSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.JavaSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.JavaSettings} JavaSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - JavaSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a JavaSettings message. - * @function verify - * @memberof google.api.JavaSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - JavaSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) - if (!$util.isString(message.libraryPackage)) - return "libraryPackage: string expected"; - if (message.serviceClassNames != null && message.hasOwnProperty("serviceClassNames")) { - if (!$util.isObject(message.serviceClassNames)) - return "serviceClassNames: object expected"; - var key = Object.keys(message.serviceClassNames); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.serviceClassNames[key[i]])) - return "serviceClassNames: string{k:string} expected"; - } - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.JavaSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.JavaSettings} JavaSettings - */ - JavaSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.JavaSettings) - return object; - var message = new $root.google.api.JavaSettings(); - if (object.libraryPackage != null) - message.libraryPackage = String(object.libraryPackage); - if (object.serviceClassNames) { - if (typeof object.serviceClassNames !== "object") - throw TypeError(".google.api.JavaSettings.serviceClassNames: object expected"); - message.serviceClassNames = {}; - for (var keys = Object.keys(object.serviceClassNames), i = 0; i < keys.length; ++i) - message.serviceClassNames[keys[i]] = String(object.serviceClassNames[keys[i]]); - } - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.JavaSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.JavaSettings - * @static - * @param {google.api.JavaSettings} message JavaSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - JavaSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.serviceClassNames = {}; - if (options.defaults) { - object.libraryPackage = ""; - object.common = null; - } - if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) - object.libraryPackage = message.libraryPackage; - var keys2; - if (message.serviceClassNames && (keys2 = Object.keys(message.serviceClassNames)).length) { - object.serviceClassNames = {}; - for (var j = 0; j < keys2.length; ++j) - object.serviceClassNames[keys2[j]] = message.serviceClassNames[keys2[j]]; - } - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this JavaSettings to JSON. - * @function toJSON - * @memberof google.api.JavaSettings - * @instance - * @returns {Object.} JSON object - */ - JavaSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for JavaSettings - * @function getTypeUrl - * @memberof google.api.JavaSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - JavaSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.JavaSettings"; - }; - - return JavaSettings; - })(); - - api.CppSettings = (function() { - - /** - * Properties of a CppSettings. - * @memberof google.api - * @interface ICppSettings - * @property {google.api.ICommonLanguageSettings|null} [common] CppSettings common - */ - - /** - * Constructs a new CppSettings. - * @memberof google.api - * @classdesc Represents a CppSettings. - * @implements ICppSettings - * @constructor - * @param {google.api.ICppSettings=} [properties] Properties to set - */ - function CppSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CppSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.CppSettings - * @instance - */ - CppSettings.prototype.common = null; - - /** - * Creates a new CppSettings instance using the specified properties. - * @function create - * @memberof google.api.CppSettings - * @static - * @param {google.api.ICppSettings=} [properties] Properties to set - * @returns {google.api.CppSettings} CppSettings instance - */ - CppSettings.create = function create(properties) { - return new CppSettings(properties); - }; - - /** - * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. - * @function encode - * @memberof google.api.CppSettings - * @static - * @param {google.api.ICppSettings} message CppSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CppSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.CppSettings - * @static - * @param {google.api.ICppSettings} message CppSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CppSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CppSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.CppSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.CppSettings} CppSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CppSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CppSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CppSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.CppSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.CppSettings} CppSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CppSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CppSettings message. - * @function verify - * @memberof google.api.CppSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CppSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.CppSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.CppSettings} CppSettings - */ - CppSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.CppSettings) - return object; - var message = new $root.google.api.CppSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.CppSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a CppSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.CppSettings - * @static - * @param {google.api.CppSettings} message CppSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CppSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this CppSettings to JSON. - * @function toJSON - * @memberof google.api.CppSettings - * @instance - * @returns {Object.} JSON object - */ - CppSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CppSettings - * @function getTypeUrl - * @memberof google.api.CppSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CppSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.CppSettings"; - }; - - return CppSettings; - })(); - - api.PhpSettings = (function() { - - /** - * Properties of a PhpSettings. - * @memberof google.api - * @interface IPhpSettings - * @property {google.api.ICommonLanguageSettings|null} [common] PhpSettings common - */ - - /** - * Constructs a new PhpSettings. - * @memberof google.api - * @classdesc Represents a PhpSettings. - * @implements IPhpSettings - * @constructor - * @param {google.api.IPhpSettings=} [properties] Properties to set - */ - function PhpSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PhpSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.PhpSettings - * @instance - */ - PhpSettings.prototype.common = null; - - /** - * Creates a new PhpSettings instance using the specified properties. - * @function create - * @memberof google.api.PhpSettings - * @static - * @param {google.api.IPhpSettings=} [properties] Properties to set - * @returns {google.api.PhpSettings} PhpSettings instance - */ - PhpSettings.create = function create(properties) { - return new PhpSettings(properties); - }; - - /** - * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. - * @function encode - * @memberof google.api.PhpSettings - * @static - * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PhpSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.PhpSettings - * @static - * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PhpSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PhpSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.PhpSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.PhpSettings} PhpSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PhpSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PhpSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PhpSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.PhpSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.PhpSettings} PhpSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PhpSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PhpSettings message. - * @function verify - * @memberof google.api.PhpSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PhpSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.PhpSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.PhpSettings} PhpSettings - */ - PhpSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.PhpSettings) - return object; - var message = new $root.google.api.PhpSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.PhpSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.PhpSettings - * @static - * @param {google.api.PhpSettings} message PhpSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PhpSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this PhpSettings to JSON. - * @function toJSON - * @memberof google.api.PhpSettings - * @instance - * @returns {Object.} JSON object - */ - PhpSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PhpSettings - * @function getTypeUrl - * @memberof google.api.PhpSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PhpSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.PhpSettings"; - }; - - return PhpSettings; - })(); - - api.PythonSettings = (function() { - - /** - * Properties of a PythonSettings. - * @memberof google.api - * @interface IPythonSettings - * @property {google.api.ICommonLanguageSettings|null} [common] PythonSettings common - */ - - /** - * Constructs a new PythonSettings. - * @memberof google.api - * @classdesc Represents a PythonSettings. - * @implements IPythonSettings - * @constructor - * @param {google.api.IPythonSettings=} [properties] Properties to set - */ - function PythonSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PythonSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.PythonSettings - * @instance - */ - PythonSettings.prototype.common = null; - - /** - * Creates a new PythonSettings instance using the specified properties. - * @function create - * @memberof google.api.PythonSettings - * @static - * @param {google.api.IPythonSettings=} [properties] Properties to set - * @returns {google.api.PythonSettings} PythonSettings instance - */ - PythonSettings.create = function create(properties) { - return new PythonSettings(properties); - }; - - /** - * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. - * @function encode - * @memberof google.api.PythonSettings - * @static - * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PythonSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.PythonSettings - * @static - * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PythonSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PythonSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.PythonSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.PythonSettings} PythonSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PythonSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PythonSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PythonSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.PythonSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.PythonSettings} PythonSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PythonSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PythonSettings message. - * @function verify - * @memberof google.api.PythonSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PythonSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.PythonSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.PythonSettings} PythonSettings - */ - PythonSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.PythonSettings) - return object; - var message = new $root.google.api.PythonSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.PythonSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.PythonSettings - * @static - * @param {google.api.PythonSettings} message PythonSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PythonSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this PythonSettings to JSON. - * @function toJSON - * @memberof google.api.PythonSettings - * @instance - * @returns {Object.} JSON object - */ - PythonSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PythonSettings - * @function getTypeUrl - * @memberof google.api.PythonSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PythonSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.PythonSettings"; - }; - - return PythonSettings; - })(); - - api.NodeSettings = (function() { - - /** - * Properties of a NodeSettings. - * @memberof google.api - * @interface INodeSettings - * @property {google.api.ICommonLanguageSettings|null} [common] NodeSettings common - */ - - /** - * Constructs a new NodeSettings. - * @memberof google.api - * @classdesc Represents a NodeSettings. - * @implements INodeSettings - * @constructor - * @param {google.api.INodeSettings=} [properties] Properties to set - */ - function NodeSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * NodeSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.NodeSettings - * @instance - */ - NodeSettings.prototype.common = null; - - /** - * Creates a new NodeSettings instance using the specified properties. - * @function create - * @memberof google.api.NodeSettings - * @static - * @param {google.api.INodeSettings=} [properties] Properties to set - * @returns {google.api.NodeSettings} NodeSettings instance - */ - NodeSettings.create = function create(properties) { - return new NodeSettings(properties); - }; - - /** - * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. - * @function encode - * @memberof google.api.NodeSettings - * @static - * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NodeSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.NodeSettings - * @static - * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NodeSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a NodeSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.NodeSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.NodeSettings} NodeSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NodeSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.NodeSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a NodeSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.NodeSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.NodeSettings} NodeSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NodeSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a NodeSettings message. - * @function verify - * @memberof google.api.NodeSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - NodeSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.NodeSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.NodeSettings} NodeSettings - */ - NodeSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.NodeSettings) - return object; - var message = new $root.google.api.NodeSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.NodeSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.NodeSettings - * @static - * @param {google.api.NodeSettings} message NodeSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - NodeSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this NodeSettings to JSON. - * @function toJSON - * @memberof google.api.NodeSettings - * @instance - * @returns {Object.} JSON object - */ - NodeSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for NodeSettings - * @function getTypeUrl - * @memberof google.api.NodeSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - NodeSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.NodeSettings"; - }; - - return NodeSettings; - })(); - - api.DotnetSettings = (function() { - - /** - * Properties of a DotnetSettings. - * @memberof google.api - * @interface IDotnetSettings - * @property {google.api.ICommonLanguageSettings|null} [common] DotnetSettings common - * @property {Object.|null} [renamedServices] DotnetSettings renamedServices - * @property {Object.|null} [renamedResources] DotnetSettings renamedResources - * @property {Array.|null} [ignoredResources] DotnetSettings ignoredResources - * @property {Array.|null} [forcedNamespaceAliases] DotnetSettings forcedNamespaceAliases - * @property {Array.|null} [handwrittenSignatures] DotnetSettings handwrittenSignatures - */ - - /** - * Constructs a new DotnetSettings. - * @memberof google.api - * @classdesc Represents a DotnetSettings. - * @implements IDotnetSettings - * @constructor - * @param {google.api.IDotnetSettings=} [properties] Properties to set - */ - function DotnetSettings(properties) { - this.renamedServices = {}; - this.renamedResources = {}; - this.ignoredResources = []; - this.forcedNamespaceAliases = []; - this.handwrittenSignatures = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DotnetSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.common = null; - - /** - * DotnetSettings renamedServices. - * @member {Object.} renamedServices - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.renamedServices = $util.emptyObject; - - /** - * DotnetSettings renamedResources. - * @member {Object.} renamedResources - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.renamedResources = $util.emptyObject; - - /** - * DotnetSettings ignoredResources. - * @member {Array.} ignoredResources - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.ignoredResources = $util.emptyArray; - - /** - * DotnetSettings forcedNamespaceAliases. - * @member {Array.} forcedNamespaceAliases - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.forcedNamespaceAliases = $util.emptyArray; - - /** - * DotnetSettings handwrittenSignatures. - * @member {Array.} handwrittenSignatures - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.handwrittenSignatures = $util.emptyArray; - - /** - * Creates a new DotnetSettings instance using the specified properties. - * @function create - * @memberof google.api.DotnetSettings - * @static - * @param {google.api.IDotnetSettings=} [properties] Properties to set - * @returns {google.api.DotnetSettings} DotnetSettings instance - */ - DotnetSettings.create = function create(properties) { - return new DotnetSettings(properties); - }; - - /** - * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. - * @function encode - * @memberof google.api.DotnetSettings - * @static - * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DotnetSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.renamedServices != null && Object.hasOwnProperty.call(message, "renamedServices")) - for (var keys = Object.keys(message.renamedServices), i = 0; i < keys.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedServices[keys[i]]).ldelim(); - if (message.renamedResources != null && Object.hasOwnProperty.call(message, "renamedResources")) - for (var keys = Object.keys(message.renamedResources), i = 0; i < keys.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedResources[keys[i]]).ldelim(); - if (message.ignoredResources != null && message.ignoredResources.length) - for (var i = 0; i < message.ignoredResources.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.ignoredResources[i]); - if (message.forcedNamespaceAliases != null && message.forcedNamespaceAliases.length) - for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.forcedNamespaceAliases[i]); - if (message.handwrittenSignatures != null && message.handwrittenSignatures.length) - for (var i = 0; i < message.handwrittenSignatures.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.handwrittenSignatures[i]); - return writer; - }; - - /** - * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.DotnetSettings - * @static - * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DotnetSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DotnetSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.DotnetSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.DotnetSettings} DotnetSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DotnetSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.DotnetSettings(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - case 2: { - if (message.renamedServices === $util.emptyObject) - message.renamedServices = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.renamedServices[key] = value; - break; - } - case 3: { - if (message.renamedResources === $util.emptyObject) - message.renamedResources = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.renamedResources[key] = value; - break; - } - case 4: { - if (!(message.ignoredResources && message.ignoredResources.length)) - message.ignoredResources = []; - message.ignoredResources.push(reader.string()); - break; - } - case 5: { - if (!(message.forcedNamespaceAliases && message.forcedNamespaceAliases.length)) - message.forcedNamespaceAliases = []; - message.forcedNamespaceAliases.push(reader.string()); - break; - } - case 6: { - if (!(message.handwrittenSignatures && message.handwrittenSignatures.length)) - message.handwrittenSignatures = []; - message.handwrittenSignatures.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.DotnetSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.DotnetSettings} DotnetSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DotnetSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DotnetSettings message. - * @function verify - * @memberof google.api.DotnetSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DotnetSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - if (message.renamedServices != null && message.hasOwnProperty("renamedServices")) { - if (!$util.isObject(message.renamedServices)) - return "renamedServices: object expected"; - var key = Object.keys(message.renamedServices); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.renamedServices[key[i]])) - return "renamedServices: string{k:string} expected"; - } - if (message.renamedResources != null && message.hasOwnProperty("renamedResources")) { - if (!$util.isObject(message.renamedResources)) - return "renamedResources: object expected"; - var key = Object.keys(message.renamedResources); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.renamedResources[key[i]])) - return "renamedResources: string{k:string} expected"; - } - if (message.ignoredResources != null && message.hasOwnProperty("ignoredResources")) { - if (!Array.isArray(message.ignoredResources)) - return "ignoredResources: array expected"; - for (var i = 0; i < message.ignoredResources.length; ++i) - if (!$util.isString(message.ignoredResources[i])) - return "ignoredResources: string[] expected"; - } - if (message.forcedNamespaceAliases != null && message.hasOwnProperty("forcedNamespaceAliases")) { - if (!Array.isArray(message.forcedNamespaceAliases)) - return "forcedNamespaceAliases: array expected"; - for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) - if (!$util.isString(message.forcedNamespaceAliases[i])) - return "forcedNamespaceAliases: string[] expected"; - } - if (message.handwrittenSignatures != null && message.hasOwnProperty("handwrittenSignatures")) { - if (!Array.isArray(message.handwrittenSignatures)) - return "handwrittenSignatures: array expected"; - for (var i = 0; i < message.handwrittenSignatures.length; ++i) - if (!$util.isString(message.handwrittenSignatures[i])) - return "handwrittenSignatures: string[] expected"; - } - return null; - }; - - /** - * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.DotnetSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.DotnetSettings} DotnetSettings - */ - DotnetSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.DotnetSettings) - return object; - var message = new $root.google.api.DotnetSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.DotnetSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - if (object.renamedServices) { - if (typeof object.renamedServices !== "object") - throw TypeError(".google.api.DotnetSettings.renamedServices: object expected"); - message.renamedServices = {}; - for (var keys = Object.keys(object.renamedServices), i = 0; i < keys.length; ++i) - message.renamedServices[keys[i]] = String(object.renamedServices[keys[i]]); - } - if (object.renamedResources) { - if (typeof object.renamedResources !== "object") - throw TypeError(".google.api.DotnetSettings.renamedResources: object expected"); - message.renamedResources = {}; - for (var keys = Object.keys(object.renamedResources), i = 0; i < keys.length; ++i) - message.renamedResources[keys[i]] = String(object.renamedResources[keys[i]]); - } - if (object.ignoredResources) { - if (!Array.isArray(object.ignoredResources)) - throw TypeError(".google.api.DotnetSettings.ignoredResources: array expected"); - message.ignoredResources = []; - for (var i = 0; i < object.ignoredResources.length; ++i) - message.ignoredResources[i] = String(object.ignoredResources[i]); - } - if (object.forcedNamespaceAliases) { - if (!Array.isArray(object.forcedNamespaceAliases)) - throw TypeError(".google.api.DotnetSettings.forcedNamespaceAliases: array expected"); - message.forcedNamespaceAliases = []; - for (var i = 0; i < object.forcedNamespaceAliases.length; ++i) - message.forcedNamespaceAliases[i] = String(object.forcedNamespaceAliases[i]); - } - if (object.handwrittenSignatures) { - if (!Array.isArray(object.handwrittenSignatures)) - throw TypeError(".google.api.DotnetSettings.handwrittenSignatures: array expected"); - message.handwrittenSignatures = []; - for (var i = 0; i < object.handwrittenSignatures.length; ++i) - message.handwrittenSignatures[i] = String(object.handwrittenSignatures[i]); - } - return message; - }; - - /** - * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.DotnetSettings - * @static - * @param {google.api.DotnetSettings} message DotnetSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DotnetSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.ignoredResources = []; - object.forcedNamespaceAliases = []; - object.handwrittenSignatures = []; - } - if (options.objects || options.defaults) { - object.renamedServices = {}; - object.renamedResources = {}; - } - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - var keys2; - if (message.renamedServices && (keys2 = Object.keys(message.renamedServices)).length) { - object.renamedServices = {}; - for (var j = 0; j < keys2.length; ++j) - object.renamedServices[keys2[j]] = message.renamedServices[keys2[j]]; - } - if (message.renamedResources && (keys2 = Object.keys(message.renamedResources)).length) { - object.renamedResources = {}; - for (var j = 0; j < keys2.length; ++j) - object.renamedResources[keys2[j]] = message.renamedResources[keys2[j]]; - } - if (message.ignoredResources && message.ignoredResources.length) { - object.ignoredResources = []; - for (var j = 0; j < message.ignoredResources.length; ++j) - object.ignoredResources[j] = message.ignoredResources[j]; - } - if (message.forcedNamespaceAliases && message.forcedNamespaceAliases.length) { - object.forcedNamespaceAliases = []; - for (var j = 0; j < message.forcedNamespaceAliases.length; ++j) - object.forcedNamespaceAliases[j] = message.forcedNamespaceAliases[j]; - } - if (message.handwrittenSignatures && message.handwrittenSignatures.length) { - object.handwrittenSignatures = []; - for (var j = 0; j < message.handwrittenSignatures.length; ++j) - object.handwrittenSignatures[j] = message.handwrittenSignatures[j]; - } - return object; - }; - - /** - * Converts this DotnetSettings to JSON. - * @function toJSON - * @memberof google.api.DotnetSettings - * @instance - * @returns {Object.} JSON object - */ - DotnetSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DotnetSettings - * @function getTypeUrl - * @memberof google.api.DotnetSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DotnetSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.DotnetSettings"; - }; - - return DotnetSettings; - })(); - - api.RubySettings = (function() { - - /** - * Properties of a RubySettings. - * @memberof google.api - * @interface IRubySettings - * @property {google.api.ICommonLanguageSettings|null} [common] RubySettings common - */ - - /** - * Constructs a new RubySettings. - * @memberof google.api - * @classdesc Represents a RubySettings. - * @implements IRubySettings - * @constructor - * @param {google.api.IRubySettings=} [properties] Properties to set - */ - function RubySettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RubySettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.RubySettings - * @instance - */ - RubySettings.prototype.common = null; - - /** - * Creates a new RubySettings instance using the specified properties. - * @function create - * @memberof google.api.RubySettings - * @static - * @param {google.api.IRubySettings=} [properties] Properties to set - * @returns {google.api.RubySettings} RubySettings instance - */ - RubySettings.create = function create(properties) { - return new RubySettings(properties); - }; - - /** - * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. - * @function encode - * @memberof google.api.RubySettings - * @static - * @param {google.api.IRubySettings} message RubySettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RubySettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.RubySettings - * @static - * @param {google.api.IRubySettings} message RubySettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RubySettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RubySettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.RubySettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.RubySettings} RubySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RubySettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.RubySettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RubySettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.RubySettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.RubySettings} RubySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RubySettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RubySettings message. - * @function verify - * @memberof google.api.RubySettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RubySettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.RubySettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.RubySettings} RubySettings - */ - RubySettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.RubySettings) - return object; - var message = new $root.google.api.RubySettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.RubySettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a RubySettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.RubySettings - * @static - * @param {google.api.RubySettings} message RubySettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RubySettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this RubySettings to JSON. - * @function toJSON - * @memberof google.api.RubySettings - * @instance - * @returns {Object.} JSON object - */ - RubySettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RubySettings - * @function getTypeUrl - * @memberof google.api.RubySettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RubySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.RubySettings"; - }; - - return RubySettings; - })(); - - api.GoSettings = (function() { - - /** - * Properties of a GoSettings. - * @memberof google.api - * @interface IGoSettings - * @property {google.api.ICommonLanguageSettings|null} [common] GoSettings common - */ - - /** - * Constructs a new GoSettings. - * @memberof google.api - * @classdesc Represents a GoSettings. - * @implements IGoSettings - * @constructor - * @param {google.api.IGoSettings=} [properties] Properties to set - */ - function GoSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GoSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.GoSettings - * @instance - */ - GoSettings.prototype.common = null; - - /** - * Creates a new GoSettings instance using the specified properties. - * @function create - * @memberof google.api.GoSettings - * @static - * @param {google.api.IGoSettings=} [properties] Properties to set - * @returns {google.api.GoSettings} GoSettings instance - */ - GoSettings.create = function create(properties) { - return new GoSettings(properties); - }; - - /** - * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. - * @function encode - * @memberof google.api.GoSettings - * @static - * @param {google.api.IGoSettings} message GoSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GoSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.GoSettings - * @static - * @param {google.api.IGoSettings} message GoSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GoSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GoSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.GoSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.GoSettings} GoSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GoSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.GoSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GoSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.GoSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.GoSettings} GoSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GoSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GoSettings message. - * @function verify - * @memberof google.api.GoSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GoSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.GoSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.GoSettings} GoSettings - */ - GoSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.GoSettings) - return object; - var message = new $root.google.api.GoSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.GoSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a GoSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.GoSettings - * @static - * @param {google.api.GoSettings} message GoSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GoSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this GoSettings to JSON. - * @function toJSON - * @memberof google.api.GoSettings - * @instance - * @returns {Object.} JSON object - */ - GoSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GoSettings - * @function getTypeUrl - * @memberof google.api.GoSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GoSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.GoSettings"; - }; - - return GoSettings; - })(); - - api.MethodSettings = (function() { - - /** - * Properties of a MethodSettings. - * @memberof google.api - * @interface IMethodSettings - * @property {string|null} [selector] MethodSettings selector - * @property {google.api.MethodSettings.ILongRunning|null} [longRunning] MethodSettings longRunning - * @property {Array.|null} [autoPopulatedFields] MethodSettings autoPopulatedFields - */ - - /** - * Constructs a new MethodSettings. - * @memberof google.api - * @classdesc Represents a MethodSettings. - * @implements IMethodSettings - * @constructor - * @param {google.api.IMethodSettings=} [properties] Properties to set - */ - function MethodSettings(properties) { - this.autoPopulatedFields = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MethodSettings selector. - * @member {string} selector - * @memberof google.api.MethodSettings - * @instance - */ - MethodSettings.prototype.selector = ""; - - /** - * MethodSettings longRunning. - * @member {google.api.MethodSettings.ILongRunning|null|undefined} longRunning - * @memberof google.api.MethodSettings - * @instance - */ - MethodSettings.prototype.longRunning = null; - - /** - * MethodSettings autoPopulatedFields. - * @member {Array.} autoPopulatedFields - * @memberof google.api.MethodSettings - * @instance - */ - MethodSettings.prototype.autoPopulatedFields = $util.emptyArray; - - /** - * Creates a new MethodSettings instance using the specified properties. - * @function create - * @memberof google.api.MethodSettings - * @static - * @param {google.api.IMethodSettings=} [properties] Properties to set - * @returns {google.api.MethodSettings} MethodSettings instance - */ - MethodSettings.create = function create(properties) { - return new MethodSettings(properties); - }; - - /** - * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. - * @function encode - * @memberof google.api.MethodSettings - * @static - * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); - if (message.longRunning != null && Object.hasOwnProperty.call(message, "longRunning")) - $root.google.api.MethodSettings.LongRunning.encode(message.longRunning, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.autoPopulatedFields != null && message.autoPopulatedFields.length) - for (var i = 0; i < message.autoPopulatedFields.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.autoPopulatedFields[i]); - return writer; - }; - - /** - * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.MethodSettings - * @static - * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MethodSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.MethodSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.MethodSettings} MethodSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.selector = reader.string(); - break; - } - case 2: { - message.longRunning = $root.google.api.MethodSettings.LongRunning.decode(reader, reader.uint32()); - break; - } - case 3: { - if (!(message.autoPopulatedFields && message.autoPopulatedFields.length)) - message.autoPopulatedFields = []; - message.autoPopulatedFields.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MethodSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.MethodSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.MethodSettings} MethodSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MethodSettings message. - * @function verify - * @memberof google.api.MethodSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MethodSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.selector != null && message.hasOwnProperty("selector")) - if (!$util.isString(message.selector)) - return "selector: string expected"; - if (message.longRunning != null && message.hasOwnProperty("longRunning")) { - var error = $root.google.api.MethodSettings.LongRunning.verify(message.longRunning); - if (error) - return "longRunning." + error; - } - if (message.autoPopulatedFields != null && message.hasOwnProperty("autoPopulatedFields")) { - if (!Array.isArray(message.autoPopulatedFields)) - return "autoPopulatedFields: array expected"; - for (var i = 0; i < message.autoPopulatedFields.length; ++i) - if (!$util.isString(message.autoPopulatedFields[i])) - return "autoPopulatedFields: string[] expected"; - } - return null; - }; - - /** - * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.MethodSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.MethodSettings} MethodSettings - */ - MethodSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.MethodSettings) - return object; - var message = new $root.google.api.MethodSettings(); - if (object.selector != null) - message.selector = String(object.selector); - if (object.longRunning != null) { - if (typeof object.longRunning !== "object") - throw TypeError(".google.api.MethodSettings.longRunning: object expected"); - message.longRunning = $root.google.api.MethodSettings.LongRunning.fromObject(object.longRunning); - } - if (object.autoPopulatedFields) { - if (!Array.isArray(object.autoPopulatedFields)) - throw TypeError(".google.api.MethodSettings.autoPopulatedFields: array expected"); - message.autoPopulatedFields = []; - for (var i = 0; i < object.autoPopulatedFields.length; ++i) - message.autoPopulatedFields[i] = String(object.autoPopulatedFields[i]); - } - return message; - }; - - /** - * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.MethodSettings - * @static - * @param {google.api.MethodSettings} message MethodSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MethodSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.autoPopulatedFields = []; - if (options.defaults) { - object.selector = ""; - object.longRunning = null; - } - if (message.selector != null && message.hasOwnProperty("selector")) - object.selector = message.selector; - if (message.longRunning != null && message.hasOwnProperty("longRunning")) - object.longRunning = $root.google.api.MethodSettings.LongRunning.toObject(message.longRunning, options); - if (message.autoPopulatedFields && message.autoPopulatedFields.length) { - object.autoPopulatedFields = []; - for (var j = 0; j < message.autoPopulatedFields.length; ++j) - object.autoPopulatedFields[j] = message.autoPopulatedFields[j]; - } - return object; - }; - - /** - * Converts this MethodSettings to JSON. - * @function toJSON - * @memberof google.api.MethodSettings - * @instance - * @returns {Object.} JSON object - */ - MethodSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MethodSettings - * @function getTypeUrl - * @memberof google.api.MethodSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MethodSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.MethodSettings"; - }; - - MethodSettings.LongRunning = (function() { - - /** - * Properties of a LongRunning. - * @memberof google.api.MethodSettings - * @interface ILongRunning - * @property {google.protobuf.IDuration|null} [initialPollDelay] LongRunning initialPollDelay - * @property {number|null} [pollDelayMultiplier] LongRunning pollDelayMultiplier - * @property {google.protobuf.IDuration|null} [maxPollDelay] LongRunning maxPollDelay - * @property {google.protobuf.IDuration|null} [totalPollTimeout] LongRunning totalPollTimeout - */ - - /** - * Constructs a new LongRunning. - * @memberof google.api.MethodSettings - * @classdesc Represents a LongRunning. - * @implements ILongRunning - * @constructor - * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set - */ - function LongRunning(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * LongRunning initialPollDelay. - * @member {google.protobuf.IDuration|null|undefined} initialPollDelay - * @memberof google.api.MethodSettings.LongRunning - * @instance - */ - LongRunning.prototype.initialPollDelay = null; - - /** - * LongRunning pollDelayMultiplier. - * @member {number} pollDelayMultiplier - * @memberof google.api.MethodSettings.LongRunning - * @instance - */ - LongRunning.prototype.pollDelayMultiplier = 0; - - /** - * LongRunning maxPollDelay. - * @member {google.protobuf.IDuration|null|undefined} maxPollDelay - * @memberof google.api.MethodSettings.LongRunning - * @instance - */ - LongRunning.prototype.maxPollDelay = null; - - /** - * LongRunning totalPollTimeout. - * @member {google.protobuf.IDuration|null|undefined} totalPollTimeout - * @memberof google.api.MethodSettings.LongRunning - * @instance - */ - LongRunning.prototype.totalPollTimeout = null; - - /** - * Creates a new LongRunning instance using the specified properties. - * @function create - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set - * @returns {google.api.MethodSettings.LongRunning} LongRunning instance - */ - LongRunning.create = function create(properties) { - return new LongRunning(properties); - }; - - /** - * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. - * @function encode - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LongRunning.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.initialPollDelay != null && Object.hasOwnProperty.call(message, "initialPollDelay")) - $root.google.protobuf.Duration.encode(message.initialPollDelay, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.pollDelayMultiplier != null && Object.hasOwnProperty.call(message, "pollDelayMultiplier")) - writer.uint32(/* id 2, wireType 5 =*/21).float(message.pollDelayMultiplier); - if (message.maxPollDelay != null && Object.hasOwnProperty.call(message, "maxPollDelay")) - $root.google.protobuf.Duration.encode(message.maxPollDelay, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.totalPollTimeout != null && Object.hasOwnProperty.call(message, "totalPollTimeout")) - $root.google.protobuf.Duration.encode(message.totalPollTimeout, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LongRunning.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a LongRunning message from the specified reader or buffer. - * @function decode - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.MethodSettings.LongRunning} LongRunning - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LongRunning.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings.LongRunning(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.initialPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 2: { - message.pollDelayMultiplier = reader.float(); - break; - } - case 3: { - message.maxPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 4: { - message.totalPollTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a LongRunning message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.MethodSettings.LongRunning} LongRunning - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LongRunning.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a LongRunning message. - * @function verify - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LongRunning.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) { - var error = $root.google.protobuf.Duration.verify(message.initialPollDelay); - if (error) - return "initialPollDelay." + error; - } - if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) - if (typeof message.pollDelayMultiplier !== "number") - return "pollDelayMultiplier: number expected"; - if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) { - var error = $root.google.protobuf.Duration.verify(message.maxPollDelay); - if (error) - return "maxPollDelay." + error; - } - if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) { - var error = $root.google.protobuf.Duration.verify(message.totalPollTimeout); - if (error) - return "totalPollTimeout." + error; - } - return null; - }; - - /** - * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {Object.} object Plain object - * @returns {google.api.MethodSettings.LongRunning} LongRunning - */ - LongRunning.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.MethodSettings.LongRunning) - return object; - var message = new $root.google.api.MethodSettings.LongRunning(); - if (object.initialPollDelay != null) { - if (typeof object.initialPollDelay !== "object") - throw TypeError(".google.api.MethodSettings.LongRunning.initialPollDelay: object expected"); - message.initialPollDelay = $root.google.protobuf.Duration.fromObject(object.initialPollDelay); - } - if (object.pollDelayMultiplier != null) - message.pollDelayMultiplier = Number(object.pollDelayMultiplier); - if (object.maxPollDelay != null) { - if (typeof object.maxPollDelay !== "object") - throw TypeError(".google.api.MethodSettings.LongRunning.maxPollDelay: object expected"); - message.maxPollDelay = $root.google.protobuf.Duration.fromObject(object.maxPollDelay); - } - if (object.totalPollTimeout != null) { - if (typeof object.totalPollTimeout !== "object") - throw TypeError(".google.api.MethodSettings.LongRunning.totalPollTimeout: object expected"); - message.totalPollTimeout = $root.google.protobuf.Duration.fromObject(object.totalPollTimeout); - } - return message; - }; - - /** - * Creates a plain object from a LongRunning message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {google.api.MethodSettings.LongRunning} message LongRunning - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LongRunning.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.initialPollDelay = null; - object.pollDelayMultiplier = 0; - object.maxPollDelay = null; - object.totalPollTimeout = null; - } - if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) - object.initialPollDelay = $root.google.protobuf.Duration.toObject(message.initialPollDelay, options); - if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) - object.pollDelayMultiplier = options.json && !isFinite(message.pollDelayMultiplier) ? String(message.pollDelayMultiplier) : message.pollDelayMultiplier; - if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) - object.maxPollDelay = $root.google.protobuf.Duration.toObject(message.maxPollDelay, options); - if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) - object.totalPollTimeout = $root.google.protobuf.Duration.toObject(message.totalPollTimeout, options); - return object; - }; - - /** - * Converts this LongRunning to JSON. - * @function toJSON - * @memberof google.api.MethodSettings.LongRunning - * @instance - * @returns {Object.} JSON object - */ - LongRunning.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for LongRunning - * @function getTypeUrl - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - LongRunning.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.MethodSettings.LongRunning"; - }; - - return LongRunning; - })(); - - return MethodSettings; - })(); - - /** - * ClientLibraryOrganization enum. - * @name google.api.ClientLibraryOrganization - * @enum {number} - * @property {number} CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED=0 CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED value - * @property {number} CLOUD=1 CLOUD value - * @property {number} ADS=2 ADS value - * @property {number} PHOTOS=3 PHOTOS value - * @property {number} STREET_VIEW=4 STREET_VIEW value - * @property {number} SHOPPING=5 SHOPPING value - * @property {number} GEO=6 GEO value - * @property {number} GENERATIVE_AI=7 GENERATIVE_AI value - */ - api.ClientLibraryOrganization = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED"] = 0; - values[valuesById[1] = "CLOUD"] = 1; - values[valuesById[2] = "ADS"] = 2; - values[valuesById[3] = "PHOTOS"] = 3; - values[valuesById[4] = "STREET_VIEW"] = 4; - values[valuesById[5] = "SHOPPING"] = 5; - values[valuesById[6] = "GEO"] = 6; - values[valuesById[7] = "GENERATIVE_AI"] = 7; - return values; - })(); - - /** - * ClientLibraryDestination enum. - * @name google.api.ClientLibraryDestination - * @enum {number} - * @property {number} CLIENT_LIBRARY_DESTINATION_UNSPECIFIED=0 CLIENT_LIBRARY_DESTINATION_UNSPECIFIED value - * @property {number} GITHUB=10 GITHUB value - * @property {number} PACKAGE_MANAGER=20 PACKAGE_MANAGER value - */ - api.ClientLibraryDestination = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED"] = 0; - values[valuesById[10] = "GITHUB"] = 10; - values[valuesById[20] = "PACKAGE_MANAGER"] = 20; - return values; - })(); - - /** - * LaunchStage enum. - * @name google.api.LaunchStage - * @enum {number} - * @property {number} LAUNCH_STAGE_UNSPECIFIED=0 LAUNCH_STAGE_UNSPECIFIED value - * @property {number} UNIMPLEMENTED=6 UNIMPLEMENTED value - * @property {number} PRELAUNCH=7 PRELAUNCH value - * @property {number} EARLY_ACCESS=1 EARLY_ACCESS value - * @property {number} ALPHA=2 ALPHA value - * @property {number} BETA=3 BETA value - * @property {number} GA=4 GA value - * @property {number} DEPRECATED=5 DEPRECATED value - */ - api.LaunchStage = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "LAUNCH_STAGE_UNSPECIFIED"] = 0; - values[valuesById[6] = "UNIMPLEMENTED"] = 6; - values[valuesById[7] = "PRELAUNCH"] = 7; - values[valuesById[1] = "EARLY_ACCESS"] = 1; - values[valuesById[2] = "ALPHA"] = 2; - values[valuesById[3] = "BETA"] = 3; - values[valuesById[4] = "GA"] = 4; - values[valuesById[5] = "DEPRECATED"] = 5; - return values; - })(); - - return api; - })(); - - google.protobuf = (function() { - - /** - * Namespace protobuf. - * @memberof google - * @namespace - */ - var protobuf = {}; - - protobuf.FileDescriptorSet = (function() { - - /** - * Properties of a FileDescriptorSet. - * @memberof google.protobuf - * @interface IFileDescriptorSet - * @property {Array.|null} [file] FileDescriptorSet file - */ - - /** - * Constructs a new FileDescriptorSet. - * @memberof google.protobuf - * @classdesc Represents a FileDescriptorSet. - * @implements IFileDescriptorSet - * @constructor - * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set - */ - function FileDescriptorSet(properties) { - this.file = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FileDescriptorSet file. - * @member {Array.} file - * @memberof google.protobuf.FileDescriptorSet - * @instance - */ - FileDescriptorSet.prototype.file = $util.emptyArray; - - /** - * Creates a new FileDescriptorSet instance using the specified properties. - * @function create - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance - */ - FileDescriptorSet.create = function create(properties) { - return new FileDescriptorSet(properties); - }; - - /** - * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorSet.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.file != null && message.file.length) - for (var i = 0; i < message.file.length; ++i) - $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FileDescriptorSet message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorSet.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.file && message.file.length)) - message.file = []; - message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FileDescriptorSet message. - * @function verify - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FileDescriptorSet.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.file != null && message.hasOwnProperty("file")) { - if (!Array.isArray(message.file)) - return "file: array expected"; - for (var i = 0; i < message.file.length; ++i) { - var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]); - if (error) - return "file." + error; - } - } - return null; - }; - - /** - * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet - */ - FileDescriptorSet.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FileDescriptorSet) - return object; - var message = new $root.google.protobuf.FileDescriptorSet(); - if (object.file) { - if (!Array.isArray(object.file)) - throw TypeError(".google.protobuf.FileDescriptorSet.file: array expected"); - message.file = []; - for (var i = 0; i < object.file.length; ++i) { - if (typeof object.file[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected"); - message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FileDescriptorSet.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.file = []; - if (message.file && message.file.length) { - object.file = []; - for (var j = 0; j < message.file.length; ++j) - object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options); - } - return object; - }; - - /** - * Converts this FileDescriptorSet to JSON. - * @function toJSON - * @memberof google.protobuf.FileDescriptorSet - * @instance - * @returns {Object.} JSON object - */ - FileDescriptorSet.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FileDescriptorSet - * @function getTypeUrl - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FileDescriptorSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FileDescriptorSet"; - }; - - return FileDescriptorSet; - })(); - - /** - * Edition enum. - * @name google.protobuf.Edition - * @enum {number} - * @property {number} EDITION_UNKNOWN=0 EDITION_UNKNOWN value - * @property {number} EDITION_PROTO2=998 EDITION_PROTO2 value - * @property {number} EDITION_PROTO3=999 EDITION_PROTO3 value - * @property {number} EDITION_2023=1000 EDITION_2023 value - * @property {number} EDITION_2024=1001 EDITION_2024 value - * @property {number} EDITION_1_TEST_ONLY=1 EDITION_1_TEST_ONLY value - * @property {number} EDITION_2_TEST_ONLY=2 EDITION_2_TEST_ONLY value - * @property {number} EDITION_99997_TEST_ONLY=99997 EDITION_99997_TEST_ONLY value - * @property {number} EDITION_99998_TEST_ONLY=99998 EDITION_99998_TEST_ONLY value - * @property {number} EDITION_99999_TEST_ONLY=99999 EDITION_99999_TEST_ONLY value - * @property {number} EDITION_MAX=2147483647 EDITION_MAX value - */ - protobuf.Edition = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "EDITION_UNKNOWN"] = 0; - values[valuesById[998] = "EDITION_PROTO2"] = 998; - values[valuesById[999] = "EDITION_PROTO3"] = 999; - values[valuesById[1000] = "EDITION_2023"] = 1000; - values[valuesById[1001] = "EDITION_2024"] = 1001; - values[valuesById[1] = "EDITION_1_TEST_ONLY"] = 1; - values[valuesById[2] = "EDITION_2_TEST_ONLY"] = 2; - values[valuesById[99997] = "EDITION_99997_TEST_ONLY"] = 99997; - values[valuesById[99998] = "EDITION_99998_TEST_ONLY"] = 99998; - values[valuesById[99999] = "EDITION_99999_TEST_ONLY"] = 99999; - values[valuesById[2147483647] = "EDITION_MAX"] = 2147483647; - return values; - })(); - - protobuf.FileDescriptorProto = (function() { - - /** - * Properties of a FileDescriptorProto. - * @memberof google.protobuf - * @interface IFileDescriptorProto - * @property {string|null} [name] FileDescriptorProto name - * @property {string|null} ["package"] FileDescriptorProto package - * @property {Array.|null} [dependency] FileDescriptorProto dependency - * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency - * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency - * @property {Array.|null} [messageType] FileDescriptorProto messageType - * @property {Array.|null} [enumType] FileDescriptorProto enumType - * @property {Array.|null} [service] FileDescriptorProto service - * @property {Array.|null} [extension] FileDescriptorProto extension - * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options - * @property {google.protobuf.ISourceCodeInfo|null} [sourceCodeInfo] FileDescriptorProto sourceCodeInfo - * @property {string|null} [syntax] FileDescriptorProto syntax - * @property {google.protobuf.Edition|null} [edition] FileDescriptorProto edition - */ - - /** - * Constructs a new FileDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a FileDescriptorProto. - * @implements IFileDescriptorProto - * @constructor - * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set - */ - function FileDescriptorProto(properties) { - this.dependency = []; - this.publicDependency = []; - this.weakDependency = []; - this.messageType = []; - this.enumType = []; - this.service = []; - this.extension = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FileDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.name = ""; - - /** - * FileDescriptorProto package. - * @member {string} package - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype["package"] = ""; - - /** - * FileDescriptorProto dependency. - * @member {Array.} dependency - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.dependency = $util.emptyArray; - - /** - * FileDescriptorProto publicDependency. - * @member {Array.} publicDependency - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.publicDependency = $util.emptyArray; - - /** - * FileDescriptorProto weakDependency. - * @member {Array.} weakDependency - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.weakDependency = $util.emptyArray; - - /** - * FileDescriptorProto messageType. - * @member {Array.} messageType - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.messageType = $util.emptyArray; - - /** - * FileDescriptorProto enumType. - * @member {Array.} enumType - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.enumType = $util.emptyArray; - - /** - * FileDescriptorProto service. - * @member {Array.} service - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.service = $util.emptyArray; - - /** - * FileDescriptorProto extension. - * @member {Array.} extension - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.extension = $util.emptyArray; - - /** - * FileDescriptorProto options. - * @member {google.protobuf.IFileOptions|null|undefined} options - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.options = null; - - /** - * FileDescriptorProto sourceCodeInfo. - * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.sourceCodeInfo = null; - - /** - * FileDescriptorProto syntax. - * @member {string} syntax - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.syntax = ""; - - /** - * FileDescriptorProto edition. - * @member {google.protobuf.Edition} edition - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.edition = 0; - - /** - * Creates a new FileDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance - */ - FileDescriptorProto.create = function create(properties) { - return new FileDescriptorProto(properties); - }; - - /** - * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); - if (message.dependency != null && message.dependency.length) - for (var i = 0; i < message.dependency.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); - if (message.messageType != null && message.messageType.length) - for (var i = 0; i < message.messageType.length; ++i) - $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.enumType != null && message.enumType.length) - for (var i = 0; i < message.enumType.length; ++i) - $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.service != null && message.service.length) - for (var i = 0; i < message.service.length; ++i) - $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.extension != null && message.extension.length) - for (var i = 0; i < message.extension.length; ++i) - $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo")) - $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.publicDependency != null && message.publicDependency.length) - for (var i = 0; i < message.publicDependency.length; ++i) - writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]); - if (message.weakDependency != null && message.weakDependency.length) - for (var i = 0; i < message.weakDependency.length; ++i) - writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); - if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); - if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) - writer.uint32(/* id 14, wireType 0 =*/112).int32(message.edition); - return writer; - }; - - /** - * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorProto.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message["package"] = reader.string(); - break; - } - case 3: { - if (!(message.dependency && message.dependency.length)) - message.dependency = []; - message.dependency.push(reader.string()); - break; - } - case 10: { - if (!(message.publicDependency && message.publicDependency.length)) - message.publicDependency = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.publicDependency.push(reader.int32()); - } else - message.publicDependency.push(reader.int32()); - break; - } - case 11: { - if (!(message.weakDependency && message.weakDependency.length)) - message.weakDependency = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.weakDependency.push(reader.int32()); - } else - message.weakDependency.push(reader.int32()); - break; - } - case 4: { - if (!(message.messageType && message.messageType.length)) - message.messageType = []; - message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); - break; - } - case 5: { - if (!(message.enumType && message.enumType.length)) - message.enumType = []; - message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 6: { - if (!(message.service && message.service.length)) - message.service = []; - message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 7: { - if (!(message.extension && message.extension.length)) - message.extension = []; - message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 8: { - message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32()); - break; - } - case 9: { - message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32()); - break; - } - case 12: { - message.syntax = reader.string(); - break; - } - case 14: { - message.edition = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FileDescriptorProto message. - * @function verify - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FileDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message["package"] != null && message.hasOwnProperty("package")) - if (!$util.isString(message["package"])) - return "package: string expected"; - if (message.dependency != null && message.hasOwnProperty("dependency")) { - if (!Array.isArray(message.dependency)) - return "dependency: array expected"; - for (var i = 0; i < message.dependency.length; ++i) - if (!$util.isString(message.dependency[i])) - return "dependency: string[] expected"; - } - if (message.publicDependency != null && message.hasOwnProperty("publicDependency")) { - if (!Array.isArray(message.publicDependency)) - return "publicDependency: array expected"; - for (var i = 0; i < message.publicDependency.length; ++i) - if (!$util.isInteger(message.publicDependency[i])) - return "publicDependency: integer[] expected"; - } - if (message.weakDependency != null && message.hasOwnProperty("weakDependency")) { - if (!Array.isArray(message.weakDependency)) - return "weakDependency: array expected"; - for (var i = 0; i < message.weakDependency.length; ++i) - if (!$util.isInteger(message.weakDependency[i])) - return "weakDependency: integer[] expected"; - } - if (message.messageType != null && message.hasOwnProperty("messageType")) { - if (!Array.isArray(message.messageType)) - return "messageType: array expected"; - for (var i = 0; i < message.messageType.length; ++i) { - var error = $root.google.protobuf.DescriptorProto.verify(message.messageType[i]); - if (error) - return "messageType." + error; - } - } - if (message.enumType != null && message.hasOwnProperty("enumType")) { - if (!Array.isArray(message.enumType)) - return "enumType: array expected"; - for (var i = 0; i < message.enumType.length; ++i) { - var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); - if (error) - return "enumType." + error; - } - } - if (message.service != null && message.hasOwnProperty("service")) { - if (!Array.isArray(message.service)) - return "service: array expected"; - for (var i = 0; i < message.service.length; ++i) { - var error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i]); - if (error) - return "service." + error; - } - } - if (message.extension != null && message.hasOwnProperty("extension")) { - if (!Array.isArray(message.extension)) - return "extension: array expected"; - for (var i = 0; i < message.extension.length; ++i) { - var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); - if (error) - return "extension." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.FileOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) { - var error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo); - if (error) - return "sourceCodeInfo." + error; - } - if (message.syntax != null && message.hasOwnProperty("syntax")) - if (!$util.isString(message.syntax)) - return "syntax: string expected"; - if (message.edition != null && message.hasOwnProperty("edition")) - switch (message.edition) { - default: - return "edition: enum value expected"; - case 0: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - return null; - }; - - /** - * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto - */ - FileDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FileDescriptorProto) - return object; - var message = new $root.google.protobuf.FileDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object["package"] != null) - message["package"] = String(object["package"]); - if (object.dependency) { - if (!Array.isArray(object.dependency)) - throw TypeError(".google.protobuf.FileDescriptorProto.dependency: array expected"); - message.dependency = []; - for (var i = 0; i < object.dependency.length; ++i) - message.dependency[i] = String(object.dependency[i]); - } - if (object.publicDependency) { - if (!Array.isArray(object.publicDependency)) - throw TypeError(".google.protobuf.FileDescriptorProto.publicDependency: array expected"); - message.publicDependency = []; - for (var i = 0; i < object.publicDependency.length; ++i) - message.publicDependency[i] = object.publicDependency[i] | 0; - } - if (object.weakDependency) { - if (!Array.isArray(object.weakDependency)) - throw TypeError(".google.protobuf.FileDescriptorProto.weakDependency: array expected"); - message.weakDependency = []; - for (var i = 0; i < object.weakDependency.length; ++i) - message.weakDependency[i] = object.weakDependency[i] | 0; - } - if (object.messageType) { - if (!Array.isArray(object.messageType)) - throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); - message.messageType = []; - for (var i = 0; i < object.messageType.length; ++i) { - if (typeof object.messageType[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.messageType: object expected"); - message.messageType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.messageType[i]); - } - } - if (object.enumType) { - if (!Array.isArray(object.enumType)) - throw TypeError(".google.protobuf.FileDescriptorProto.enumType: array expected"); - message.enumType = []; - for (var i = 0; i < object.enumType.length; ++i) { - if (typeof object.enumType[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.enumType: object expected"); - message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); - } - } - if (object.service) { - if (!Array.isArray(object.service)) - throw TypeError(".google.protobuf.FileDescriptorProto.service: array expected"); - message.service = []; - for (var i = 0; i < object.service.length; ++i) { - if (typeof object.service[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.service: object expected"); - message.service[i] = $root.google.protobuf.ServiceDescriptorProto.fromObject(object.service[i]); - } - } - if (object.extension) { - if (!Array.isArray(object.extension)) - throw TypeError(".google.protobuf.FileDescriptorProto.extension: array expected"); - message.extension = []; - for (var i = 0; i < object.extension.length; ++i) { - if (typeof object.extension[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.extension: object expected"); - message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.FileOptions.fromObject(object.options); - } - if (object.sourceCodeInfo != null) { - if (typeof object.sourceCodeInfo !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.sourceCodeInfo: object expected"); - message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.fromObject(object.sourceCodeInfo); - } - if (object.syntax != null) - message.syntax = String(object.syntax); - switch (object.edition) { - default: - if (typeof object.edition === "number") { - message.edition = object.edition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.edition = 0; - break; - case "EDITION_PROTO2": - case 998: - message.edition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.edition = 999; - break; - case "EDITION_2023": - case 1000: - message.edition = 1000; - break; - case "EDITION_2024": - case 1001: - message.edition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.edition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.edition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.edition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.edition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.edition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.edition = 2147483647; - break; - } - return message; - }; - - /** - * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FileDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.dependency = []; - object.messageType = []; - object.enumType = []; - object.service = []; - object.extension = []; - object.publicDependency = []; - object.weakDependency = []; - } - if (options.defaults) { - object.name = ""; - object["package"] = ""; - object.options = null; - object.sourceCodeInfo = null; - object.syntax = ""; - object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message["package"] != null && message.hasOwnProperty("package")) - object["package"] = message["package"]; - if (message.dependency && message.dependency.length) { - object.dependency = []; - for (var j = 0; j < message.dependency.length; ++j) - object.dependency[j] = message.dependency[j]; - } - if (message.messageType && message.messageType.length) { - object.messageType = []; - for (var j = 0; j < message.messageType.length; ++j) - object.messageType[j] = $root.google.protobuf.DescriptorProto.toObject(message.messageType[j], options); - } - if (message.enumType && message.enumType.length) { - object.enumType = []; - for (var j = 0; j < message.enumType.length; ++j) - object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); - } - if (message.service && message.service.length) { - object.service = []; - for (var j = 0; j < message.service.length; ++j) - object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options); - } - if (message.extension && message.extension.length) { - object.extension = []; - for (var j = 0; j < message.extension.length; ++j) - object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.FileOptions.toObject(message.options, options); - if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) - object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options); - if (message.publicDependency && message.publicDependency.length) { - object.publicDependency = []; - for (var j = 0; j < message.publicDependency.length; ++j) - object.publicDependency[j] = message.publicDependency[j]; - } - if (message.weakDependency && message.weakDependency.length) { - object.weakDependency = []; - for (var j = 0; j < message.weakDependency.length; ++j) - object.weakDependency[j] = message.weakDependency[j]; - } - if (message.syntax != null && message.hasOwnProperty("syntax")) - object.syntax = message.syntax; - if (message.edition != null && message.hasOwnProperty("edition")) - object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; - return object; - }; - - /** - * Converts this FileDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.FileDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - FileDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FileDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FileDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FileDescriptorProto"; - }; - - return FileDescriptorProto; - })(); - - protobuf.DescriptorProto = (function() { - - /** - * Properties of a DescriptorProto. - * @memberof google.protobuf - * @interface IDescriptorProto - * @property {string|null} [name] DescriptorProto name - * @property {Array.|null} [field] DescriptorProto field - * @property {Array.|null} [extension] DescriptorProto extension - * @property {Array.|null} [nestedType] DescriptorProto nestedType - * @property {Array.|null} [enumType] DescriptorProto enumType - * @property {Array.|null} [extensionRange] DescriptorProto extensionRange - * @property {Array.|null} [oneofDecl] DescriptorProto oneofDecl - * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options - * @property {Array.|null} [reservedRange] DescriptorProto reservedRange - * @property {Array.|null} [reservedName] DescriptorProto reservedName - */ - - /** - * Constructs a new DescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a DescriptorProto. - * @implements IDescriptorProto - * @constructor - * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set - */ - function DescriptorProto(properties) { - this.field = []; - this.extension = []; - this.nestedType = []; - this.enumType = []; - this.extensionRange = []; - this.oneofDecl = []; - this.reservedRange = []; - this.reservedName = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DescriptorProto name. - * @member {string} name - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.name = ""; - - /** - * DescriptorProto field. - * @member {Array.} field - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.field = $util.emptyArray; - - /** - * DescriptorProto extension. - * @member {Array.} extension - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.extension = $util.emptyArray; - - /** - * DescriptorProto nestedType. - * @member {Array.} nestedType - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.nestedType = $util.emptyArray; - - /** - * DescriptorProto enumType. - * @member {Array.} enumType - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.enumType = $util.emptyArray; - - /** - * DescriptorProto extensionRange. - * @member {Array.} extensionRange - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.extensionRange = $util.emptyArray; - - /** - * DescriptorProto oneofDecl. - * @member {Array.} oneofDecl - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.oneofDecl = $util.emptyArray; - - /** - * DescriptorProto options. - * @member {google.protobuf.IMessageOptions|null|undefined} options - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.options = null; - - /** - * DescriptorProto reservedRange. - * @member {Array.} reservedRange - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.reservedRange = $util.emptyArray; - - /** - * DescriptorProto reservedName. - * @member {Array.} reservedName - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.reservedName = $util.emptyArray; - - /** - * Creates a new DescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.DescriptorProto - * @static - * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.DescriptorProto} DescriptorProto instance - */ - DescriptorProto.create = function create(properties) { - return new DescriptorProto(properties); - }; - - /** - * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.DescriptorProto - * @static - * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.field != null && message.field.length) - for (var i = 0; i < message.field.length; ++i) - $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.nestedType != null && message.nestedType.length) - for (var i = 0; i < message.nestedType.length; ++i) - $root.google.protobuf.DescriptorProto.encode(message.nestedType[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.enumType != null && message.enumType.length) - for (var i = 0; i < message.enumType.length; ++i) - $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.extensionRange != null && message.extensionRange.length) - for (var i = 0; i < message.extensionRange.length; ++i) - $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extensionRange[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.extension != null && message.extension.length) - for (var i = 0; i < message.extension.length; ++i) - $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.oneofDecl != null && message.oneofDecl.length) - for (var i = 0; i < message.oneofDecl.length; ++i) - $root.google.protobuf.OneofDescriptorProto.encode(message.oneofDecl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.reservedRange != null && message.reservedRange.length) - for (var i = 0; i < message.reservedRange.length; ++i) - $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.reservedName != null && message.reservedName.length) - for (var i = 0; i < message.reservedName.length; ++i) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); - return writer; - }; - - /** - * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.DescriptorProto - * @static - * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.DescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DescriptorProto} DescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DescriptorProto.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - if (!(message.field && message.field.length)) - message.field = []; - message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 6: { - if (!(message.extension && message.extension.length)) - message.extension = []; - message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 3: { - if (!(message.nestedType && message.nestedType.length)) - message.nestedType = []; - message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); - break; - } - case 4: { - if (!(message.enumType && message.enumType.length)) - message.enumType = []; - message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 5: { - if (!(message.extensionRange && message.extensionRange.length)) - message.extensionRange = []; - message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32())); - break; - } - case 8: { - if (!(message.oneofDecl && message.oneofDecl.length)) - message.oneofDecl = []; - message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 7: { - message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32()); - break; - } - case 9: { - if (!(message.reservedRange && message.reservedRange.length)) - message.reservedRange = []; - message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32())); - break; - } - case 10: { - if (!(message.reservedName && message.reservedName.length)) - message.reservedName = []; - message.reservedName.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.DescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DescriptorProto} DescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DescriptorProto message. - * @function verify - * @memberof google.protobuf.DescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.field != null && message.hasOwnProperty("field")) { - if (!Array.isArray(message.field)) - return "field: array expected"; - for (var i = 0; i < message.field.length; ++i) { - var error = $root.google.protobuf.FieldDescriptorProto.verify(message.field[i]); - if (error) - return "field." + error; - } - } - if (message.extension != null && message.hasOwnProperty("extension")) { - if (!Array.isArray(message.extension)) - return "extension: array expected"; - for (var i = 0; i < message.extension.length; ++i) { - var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); - if (error) - return "extension." + error; - } - } - if (message.nestedType != null && message.hasOwnProperty("nestedType")) { - if (!Array.isArray(message.nestedType)) - return "nestedType: array expected"; - for (var i = 0; i < message.nestedType.length; ++i) { - var error = $root.google.protobuf.DescriptorProto.verify(message.nestedType[i]); - if (error) - return "nestedType." + error; - } - } - if (message.enumType != null && message.hasOwnProperty("enumType")) { - if (!Array.isArray(message.enumType)) - return "enumType: array expected"; - for (var i = 0; i < message.enumType.length; ++i) { - var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); - if (error) - return "enumType." + error; - } - } - if (message.extensionRange != null && message.hasOwnProperty("extensionRange")) { - if (!Array.isArray(message.extensionRange)) - return "extensionRange: array expected"; - for (var i = 0; i < message.extensionRange.length; ++i) { - var error = $root.google.protobuf.DescriptorProto.ExtensionRange.verify(message.extensionRange[i]); - if (error) - return "extensionRange." + error; - } - } - if (message.oneofDecl != null && message.hasOwnProperty("oneofDecl")) { - if (!Array.isArray(message.oneofDecl)) - return "oneofDecl: array expected"; - for (var i = 0; i < message.oneofDecl.length; ++i) { - var error = $root.google.protobuf.OneofDescriptorProto.verify(message.oneofDecl[i]); - if (error) - return "oneofDecl." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.MessageOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { - if (!Array.isArray(message.reservedRange)) - return "reservedRange: array expected"; - for (var i = 0; i < message.reservedRange.length; ++i) { - var error = $root.google.protobuf.DescriptorProto.ReservedRange.verify(message.reservedRange[i]); - if (error) - return "reservedRange." + error; - } - } - if (message.reservedName != null && message.hasOwnProperty("reservedName")) { - if (!Array.isArray(message.reservedName)) - return "reservedName: array expected"; - for (var i = 0; i < message.reservedName.length; ++i) - if (!$util.isString(message.reservedName[i])) - return "reservedName: string[] expected"; - } - return null; - }; - - /** - * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.DescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.DescriptorProto} DescriptorProto - */ - DescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DescriptorProto) - return object; - var message = new $root.google.protobuf.DescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.field) { - if (!Array.isArray(object.field)) - throw TypeError(".google.protobuf.DescriptorProto.field: array expected"); - message.field = []; - for (var i = 0; i < object.field.length; ++i) { - if (typeof object.field[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.field: object expected"); - message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i]); - } - } - if (object.extension) { - if (!Array.isArray(object.extension)) - throw TypeError(".google.protobuf.DescriptorProto.extension: array expected"); - message.extension = []; - for (var i = 0; i < object.extension.length; ++i) { - if (typeof object.extension[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.extension: object expected"); - message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); - } - } - if (object.nestedType) { - if (!Array.isArray(object.nestedType)) - throw TypeError(".google.protobuf.DescriptorProto.nestedType: array expected"); - message.nestedType = []; - for (var i = 0; i < object.nestedType.length; ++i) { - if (typeof object.nestedType[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.nestedType: object expected"); - message.nestedType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nestedType[i]); - } - } - if (object.enumType) { - if (!Array.isArray(object.enumType)) - throw TypeError(".google.protobuf.DescriptorProto.enumType: array expected"); - message.enumType = []; - for (var i = 0; i < object.enumType.length; ++i) { - if (typeof object.enumType[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.enumType: object expected"); - message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); - } - } - if (object.extensionRange) { - if (!Array.isArray(object.extensionRange)) - throw TypeError(".google.protobuf.DescriptorProto.extensionRange: array expected"); - message.extensionRange = []; - for (var i = 0; i < object.extensionRange.length; ++i) { - if (typeof object.extensionRange[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.extensionRange: object expected"); - message.extensionRange[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extensionRange[i]); - } - } - if (object.oneofDecl) { - if (!Array.isArray(object.oneofDecl)) - throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: array expected"); - message.oneofDecl = []; - for (var i = 0; i < object.oneofDecl.length; ++i) { - if (typeof object.oneofDecl[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: object expected"); - message.oneofDecl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneofDecl[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.DescriptorProto.options: object expected"); - message.options = $root.google.protobuf.MessageOptions.fromObject(object.options); - } - if (object.reservedRange) { - if (!Array.isArray(object.reservedRange)) - throw TypeError(".google.protobuf.DescriptorProto.reservedRange: array expected"); - message.reservedRange = []; - for (var i = 0; i < object.reservedRange.length; ++i) { - if (typeof object.reservedRange[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.reservedRange: object expected"); - message.reservedRange[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reservedRange[i]); - } - } - if (object.reservedName) { - if (!Array.isArray(object.reservedName)) - throw TypeError(".google.protobuf.DescriptorProto.reservedName: array expected"); - message.reservedName = []; - for (var i = 0; i < object.reservedName.length; ++i) - message.reservedName[i] = String(object.reservedName[i]); - } - return message; - }; - - /** - * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.DescriptorProto - * @static - * @param {google.protobuf.DescriptorProto} message DescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.field = []; - object.nestedType = []; - object.enumType = []; - object.extensionRange = []; - object.extension = []; - object.oneofDecl = []; - object.reservedRange = []; - object.reservedName = []; - } - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.field && message.field.length) { - object.field = []; - for (var j = 0; j < message.field.length; ++j) - object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options); - } - if (message.nestedType && message.nestedType.length) { - object.nestedType = []; - for (var j = 0; j < message.nestedType.length; ++j) - object.nestedType[j] = $root.google.protobuf.DescriptorProto.toObject(message.nestedType[j], options); - } - if (message.enumType && message.enumType.length) { - object.enumType = []; - for (var j = 0; j < message.enumType.length; ++j) - object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); - } - if (message.extensionRange && message.extensionRange.length) { - object.extensionRange = []; - for (var j = 0; j < message.extensionRange.length; ++j) - object.extensionRange[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extensionRange[j], options); - } - if (message.extension && message.extension.length) { - object.extension = []; - for (var j = 0; j < message.extension.length; ++j) - object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options); - if (message.oneofDecl && message.oneofDecl.length) { - object.oneofDecl = []; - for (var j = 0; j < message.oneofDecl.length; ++j) - object.oneofDecl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneofDecl[j], options); - } - if (message.reservedRange && message.reservedRange.length) { - object.reservedRange = []; - for (var j = 0; j < message.reservedRange.length; ++j) - object.reservedRange[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reservedRange[j], options); - } - if (message.reservedName && message.reservedName.length) { - object.reservedName = []; - for (var j = 0; j < message.reservedName.length; ++j) - object.reservedName[j] = message.reservedName[j]; - } - return object; - }; - - /** - * Converts this DescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.DescriptorProto - * @instance - * @returns {Object.} JSON object - */ - DescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.DescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.DescriptorProto"; - }; - - DescriptorProto.ExtensionRange = (function() { - - /** - * Properties of an ExtensionRange. - * @memberof google.protobuf.DescriptorProto - * @interface IExtensionRange - * @property {number|null} [start] ExtensionRange start - * @property {number|null} [end] ExtensionRange end - * @property {google.protobuf.IExtensionRangeOptions|null} [options] ExtensionRange options - */ - - /** - * Constructs a new ExtensionRange. - * @memberof google.protobuf.DescriptorProto - * @classdesc Represents an ExtensionRange. - * @implements IExtensionRange - * @constructor - * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set - */ - function ExtensionRange(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExtensionRange start. - * @member {number} start - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - */ - ExtensionRange.prototype.start = 0; - - /** - * ExtensionRange end. - * @member {number} end - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - */ - ExtensionRange.prototype.end = 0; - - /** - * ExtensionRange options. - * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - */ - ExtensionRange.prototype.options = null; - - /** - * Creates a new ExtensionRange instance using the specified properties. - * @function create - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance - */ - ExtensionRange.create = function create(properties) { - return new ExtensionRange(properties); - }; - - /** - * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @function encode - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtensionRange.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.start != null && Object.hasOwnProperty.call(message, "start")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExtensionRange message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtensionRange.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.start = reader.int32(); - break; - } - case 2: { - message.end = reader.int32(); - break; - } - case 3: { - message.options = $root.google.protobuf.ExtensionRangeOptions.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtensionRange.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExtensionRange message. - * @function verify - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExtensionRange.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.start != null && message.hasOwnProperty("start")) - if (!$util.isInteger(message.start)) - return "start: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.ExtensionRangeOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange - */ - ExtensionRange.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange) - return object; - var message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); - if (object.start != null) - message.start = object.start | 0; - if (object.end != null) - message.end = object.end | 0; - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange.options: object expected"); - message.options = $root.google.protobuf.ExtensionRangeOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExtensionRange.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.start = 0; - object.end = 0; - object.options = null; - } - if (message.start != null && message.hasOwnProperty("start")) - object.start = message.start; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.ExtensionRangeOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this ExtensionRange to JSON. - * @function toJSON - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - * @returns {Object.} JSON object - */ - ExtensionRange.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExtensionRange - * @function getTypeUrl - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExtensionRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.DescriptorProto.ExtensionRange"; - }; - - return ExtensionRange; - })(); - - DescriptorProto.ReservedRange = (function() { - - /** - * Properties of a ReservedRange. - * @memberof google.protobuf.DescriptorProto - * @interface IReservedRange - * @property {number|null} [start] ReservedRange start - * @property {number|null} [end] ReservedRange end - */ - - /** - * Constructs a new ReservedRange. - * @memberof google.protobuf.DescriptorProto - * @classdesc Represents a ReservedRange. - * @implements IReservedRange - * @constructor - * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set - */ - function ReservedRange(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ReservedRange start. - * @member {number} start - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @instance - */ - ReservedRange.prototype.start = 0; - - /** - * ReservedRange end. - * @member {number} end - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @instance - */ - ReservedRange.prototype.end = 0; - - /** - * Creates a new ReservedRange instance using the specified properties. - * @function create - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance - */ - ReservedRange.create = function create(properties) { - return new ReservedRange(properties); - }; - - /** - * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @function encode - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReservedRange.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.start != null && Object.hasOwnProperty.call(message, "start")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); - return writer; - }; - - /** - * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ReservedRange message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReservedRange.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ReservedRange(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.start = reader.int32(); - break; - } - case 2: { - message.end = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ReservedRange message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReservedRange.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ReservedRange message. - * @function verify - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ReservedRange.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.start != null && message.hasOwnProperty("start")) - if (!$util.isInteger(message.start)) - return "start: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - return null; - }; - - /** - * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange - */ - ReservedRange.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange) - return object; - var message = new $root.google.protobuf.DescriptorProto.ReservedRange(); - if (object.start != null) - message.start = object.start | 0; - if (object.end != null) - message.end = object.end | 0; - return message; - }; - - /** - * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ReservedRange.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.start = 0; - object.end = 0; - } - if (message.start != null && message.hasOwnProperty("start")) - object.start = message.start; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - return object; - }; - - /** - * Converts this ReservedRange to JSON. - * @function toJSON - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @instance - * @returns {Object.} JSON object - */ - ReservedRange.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ReservedRange - * @function getTypeUrl - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.DescriptorProto.ReservedRange"; - }; - - return ReservedRange; - })(); - - return DescriptorProto; - })(); - - protobuf.ExtensionRangeOptions = (function() { - - /** - * Properties of an ExtensionRangeOptions. - * @memberof google.protobuf - * @interface IExtensionRangeOptions - * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption - * @property {Array.|null} [declaration] ExtensionRangeOptions declaration - * @property {google.protobuf.IFeatureSet|null} [features] ExtensionRangeOptions features - * @property {google.protobuf.ExtensionRangeOptions.VerificationState|null} [verification] ExtensionRangeOptions verification - */ - - /** - * Constructs a new ExtensionRangeOptions. - * @memberof google.protobuf - * @classdesc Represents an ExtensionRangeOptions. - * @implements IExtensionRangeOptions - * @constructor - * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set - */ - function ExtensionRangeOptions(properties) { - this.uninterpretedOption = []; - this.declaration = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExtensionRangeOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - */ - ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * ExtensionRangeOptions declaration. - * @member {Array.} declaration - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - */ - ExtensionRangeOptions.prototype.declaration = $util.emptyArray; - - /** - * ExtensionRangeOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - */ - ExtensionRangeOptions.prototype.features = null; - - /** - * ExtensionRangeOptions verification. - * @member {google.protobuf.ExtensionRangeOptions.VerificationState} verification - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - */ - ExtensionRangeOptions.prototype.verification = 1; - - /** - * Creates a new ExtensionRangeOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions instance - */ - ExtensionRangeOptions.create = function create(properties) { - return new ExtensionRangeOptions(properties); - }; - - /** - * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtensionRangeOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.declaration != null && message.declaration.length) - for (var i = 0; i < message.declaration.length; ++i) - $root.google.protobuf.ExtensionRangeOptions.Declaration.encode(message.declaration[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.verification != null && Object.hasOwnProperty.call(message, "verification")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.verification); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtensionRangeOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 2: { - if (!(message.declaration && message.declaration.length)) - message.declaration = []; - message.declaration.push($root.google.protobuf.ExtensionRangeOptions.Declaration.decode(reader, reader.uint32())); - break; - } - case 50: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 3: { - message.verification = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtensionRangeOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExtensionRangeOptions message. - * @function verify - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExtensionRangeOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message.declaration != null && message.hasOwnProperty("declaration")) { - if (!Array.isArray(message.declaration)) - return "declaration: array expected"; - for (var i = 0; i < message.declaration.length; ++i) { - var error = $root.google.protobuf.ExtensionRangeOptions.Declaration.verify(message.declaration[i]); - if (error) - return "declaration." + error; - } - } - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.verification != null && message.hasOwnProperty("verification")) - switch (message.verification) { - default: - return "verification: enum value expected"; - case 0: - case 1: - break; - } - return null; - }; - - /** - * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions - */ - ExtensionRangeOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ExtensionRangeOptions) - return object; - var message = new $root.google.protobuf.ExtensionRangeOptions(); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object.declaration) { - if (!Array.isArray(object.declaration)) - throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: array expected"); - message.declaration = []; - for (var i = 0; i < object.declaration.length; ++i) { - if (typeof object.declaration[i] !== "object") - throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: object expected"); - message.declaration[i] = $root.google.protobuf.ExtensionRangeOptions.Declaration.fromObject(object.declaration[i]); - } - } - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.ExtensionRangeOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - switch (object.verification) { - case "DECLARATION": - case 0: - message.verification = 0; - break; - default: - if (typeof object.verification === "number") { - message.verification = object.verification; - break; - } - break; - case "UNVERIFIED": - case 1: - message.verification = 1; - break; - } - return message; - }; - - /** - * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExtensionRangeOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.declaration = []; - object.uninterpretedOption = []; - } - if (options.defaults) { - object.verification = options.enums === String ? "UNVERIFIED" : 1; - object.features = null; - } - if (message.declaration && message.declaration.length) { - object.declaration = []; - for (var j = 0; j < message.declaration.length; ++j) - object.declaration[j] = $root.google.protobuf.ExtensionRangeOptions.Declaration.toObject(message.declaration[j], options); - } - if (message.verification != null && message.hasOwnProperty("verification")) - object.verification = options.enums === String ? $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] === undefined ? message.verification : $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] : message.verification; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; - - /** - * Converts this ExtensionRangeOptions to JSON. - * @function toJSON - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - * @returns {Object.} JSON object - */ - ExtensionRangeOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExtensionRangeOptions - * @function getTypeUrl - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExtensionRangeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions"; - }; - - ExtensionRangeOptions.Declaration = (function() { - - /** - * Properties of a Declaration. - * @memberof google.protobuf.ExtensionRangeOptions - * @interface IDeclaration - * @property {number|null} [number] Declaration number - * @property {string|null} [fullName] Declaration fullName - * @property {string|null} [type] Declaration type - * @property {boolean|null} [reserved] Declaration reserved - * @property {boolean|null} [repeated] Declaration repeated - */ - - /** - * Constructs a new Declaration. - * @memberof google.protobuf.ExtensionRangeOptions - * @classdesc Represents a Declaration. - * @implements IDeclaration - * @constructor - * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set - */ - function Declaration(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Declaration number. - * @member {number} number - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.number = 0; - - /** - * Declaration fullName. - * @member {string} fullName - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.fullName = ""; - - /** - * Declaration type. - * @member {string} type - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.type = ""; - - /** - * Declaration reserved. - * @member {boolean} reserved - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.reserved = false; - - /** - * Declaration repeated. - * @member {boolean} repeated - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.repeated = false; - - /** - * Creates a new Declaration instance using the specified properties. - * @function create - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set - * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration instance - */ - Declaration.create = function create(properties) { - return new Declaration(properties); - }; - - /** - * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Declaration.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.number != null && Object.hasOwnProperty.call(message, "number")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.number); - if (message.fullName != null && Object.hasOwnProperty.call(message, "fullName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.fullName); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.type); - if (message.reserved != null && Object.hasOwnProperty.call(message, "reserved")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.reserved); - if (message.repeated != null && Object.hasOwnProperty.call(message, "repeated")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.repeated); - return writer; - }; - - /** - * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Declaration.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Declaration message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Declaration.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.number = reader.int32(); - break; - } - case 2: { - message.fullName = reader.string(); - break; - } - case 3: { - message.type = reader.string(); - break; - } - case 5: { - message.reserved = reader.bool(); - break; - } - case 6: { - message.repeated = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Declaration message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Declaration.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Declaration message. - * @function verify - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Declaration.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.number != null && message.hasOwnProperty("number")) - if (!$util.isInteger(message.number)) - return "number: integer expected"; - if (message.fullName != null && message.hasOwnProperty("fullName")) - if (!$util.isString(message.fullName)) - return "fullName: string expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.reserved != null && message.hasOwnProperty("reserved")) - if (typeof message.reserved !== "boolean") - return "reserved: boolean expected"; - if (message.repeated != null && message.hasOwnProperty("repeated")) - if (typeof message.repeated !== "boolean") - return "repeated: boolean expected"; - return null; - }; - - /** - * Creates a Declaration message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration - */ - Declaration.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ExtensionRangeOptions.Declaration) - return object; - var message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); - if (object.number != null) - message.number = object.number | 0; - if (object.fullName != null) - message.fullName = String(object.fullName); - if (object.type != null) - message.type = String(object.type); - if (object.reserved != null) - message.reserved = Boolean(object.reserved); - if (object.repeated != null) - message.repeated = Boolean(object.repeated); - return message; - }; - - /** - * Creates a plain object from a Declaration message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {google.protobuf.ExtensionRangeOptions.Declaration} message Declaration - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Declaration.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.number = 0; - object.fullName = ""; - object.type = ""; - object.reserved = false; - object.repeated = false; - } - if (message.number != null && message.hasOwnProperty("number")) - object.number = message.number; - if (message.fullName != null && message.hasOwnProperty("fullName")) - object.fullName = message.fullName; - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.reserved != null && message.hasOwnProperty("reserved")) - object.reserved = message.reserved; - if (message.repeated != null && message.hasOwnProperty("repeated")) - object.repeated = message.repeated; - return object; - }; - - /** - * Converts this Declaration to JSON. - * @function toJSON - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - * @returns {Object.} JSON object - */ - Declaration.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Declaration - * @function getTypeUrl - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Declaration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions.Declaration"; - }; - - return Declaration; - })(); - - /** - * VerificationState enum. - * @name google.protobuf.ExtensionRangeOptions.VerificationState - * @enum {number} - * @property {number} DECLARATION=0 DECLARATION value - * @property {number} UNVERIFIED=1 UNVERIFIED value - */ - ExtensionRangeOptions.VerificationState = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "DECLARATION"] = 0; - values[valuesById[1] = "UNVERIFIED"] = 1; - return values; - })(); - - return ExtensionRangeOptions; - })(); - - protobuf.FieldDescriptorProto = (function() { - - /** - * Properties of a FieldDescriptorProto. - * @memberof google.protobuf - * @interface IFieldDescriptorProto - * @property {string|null} [name] FieldDescriptorProto name - * @property {number|null} [number] FieldDescriptorProto number - * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label - * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type - * @property {string|null} [typeName] FieldDescriptorProto typeName - * @property {string|null} [extendee] FieldDescriptorProto extendee - * @property {string|null} [defaultValue] FieldDescriptorProto defaultValue - * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex - * @property {string|null} [jsonName] FieldDescriptorProto jsonName - * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options - * @property {boolean|null} [proto3Optional] FieldDescriptorProto proto3Optional - */ - - /** - * Constructs a new FieldDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a FieldDescriptorProto. - * @implements IFieldDescriptorProto - * @constructor - * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set - */ - function FieldDescriptorProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FieldDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.name = ""; - - /** - * FieldDescriptorProto number. - * @member {number} number - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.number = 0; - - /** - * FieldDescriptorProto label. - * @member {google.protobuf.FieldDescriptorProto.Label} label - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.label = 1; - - /** - * FieldDescriptorProto type. - * @member {google.protobuf.FieldDescriptorProto.Type} type - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.type = 1; - - /** - * FieldDescriptorProto typeName. - * @member {string} typeName - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.typeName = ""; - - /** - * FieldDescriptorProto extendee. - * @member {string} extendee - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.extendee = ""; - - /** - * FieldDescriptorProto defaultValue. - * @member {string} defaultValue - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.defaultValue = ""; - - /** - * FieldDescriptorProto oneofIndex. - * @member {number} oneofIndex - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.oneofIndex = 0; - - /** - * FieldDescriptorProto jsonName. - * @member {string} jsonName - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.jsonName = ""; - - /** - * FieldDescriptorProto options. - * @member {google.protobuf.IFieldOptions|null|undefined} options - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.options = null; - - /** - * FieldDescriptorProto proto3Optional. - * @member {boolean} proto3Optional - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.proto3Optional = false; - - /** - * Creates a new FieldDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance - */ - FieldDescriptorProto.create = function create(properties) { - return new FieldDescriptorProto(properties); - }; - - /** - * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); - if (message.number != null && Object.hasOwnProperty.call(message, "number")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); - if (message.label != null && Object.hasOwnProperty.call(message, "label")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); - if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); - if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); - if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); - if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) - writer.uint32(/* id 17, wireType 0 =*/136).bool(message.proto3Optional); - return writer; - }; - - /** - * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldDescriptorProto.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 3: { - message.number = reader.int32(); - break; - } - case 4: { - message.label = reader.int32(); - break; - } - case 5: { - message.type = reader.int32(); - break; - } - case 6: { - message.typeName = reader.string(); - break; - } - case 2: { - message.extendee = reader.string(); - break; - } - case 7: { - message.defaultValue = reader.string(); - break; - } - case 9: { - message.oneofIndex = reader.int32(); - break; - } - case 10: { - message.jsonName = reader.string(); - break; - } - case 8: { - message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); - break; - } - case 17: { - message.proto3Optional = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FieldDescriptorProto message. - * @function verify - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FieldDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.number != null && message.hasOwnProperty("number")) - if (!$util.isInteger(message.number)) - return "number: integer expected"; - if (message.label != null && message.hasOwnProperty("label")) - switch (message.label) { - default: - return "label: enum value expected"; - case 1: - case 3: - case 2: - break; - } - if (message.type != null && message.hasOwnProperty("type")) - switch (message.type) { - default: - return "type: enum value expected"; - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - case 10: - case 11: - case 12: - case 13: - case 14: - case 15: - case 16: - case 17: - case 18: - break; - } - if (message.typeName != null && message.hasOwnProperty("typeName")) - if (!$util.isString(message.typeName)) - return "typeName: string expected"; - if (message.extendee != null && message.hasOwnProperty("extendee")) - if (!$util.isString(message.extendee)) - return "extendee: string expected"; - if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) - if (!$util.isString(message.defaultValue)) - return "defaultValue: string expected"; - if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) - if (!$util.isInteger(message.oneofIndex)) - return "oneofIndex: integer expected"; - if (message.jsonName != null && message.hasOwnProperty("jsonName")) - if (!$util.isString(message.jsonName)) - return "jsonName: string expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.FieldOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) - if (typeof message.proto3Optional !== "boolean") - return "proto3Optional: boolean expected"; - return null; - }; - - /** - * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto - */ - FieldDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldDescriptorProto) - return object; - var message = new $root.google.protobuf.FieldDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.number != null) - message.number = object.number | 0; - switch (object.label) { - default: - if (typeof object.label === "number") { - message.label = object.label; - break; - } - break; - case "LABEL_OPTIONAL": - case 1: - message.label = 1; - break; - case "LABEL_REPEATED": - case 3: - message.label = 3; - break; - case "LABEL_REQUIRED": - case 2: - message.label = 2; - break; - } - switch (object.type) { - default: - if (typeof object.type === "number") { - message.type = object.type; - break; - } - break; - case "TYPE_DOUBLE": - case 1: - message.type = 1; - break; - case "TYPE_FLOAT": - case 2: - message.type = 2; - break; - case "TYPE_INT64": - case 3: - message.type = 3; - break; - case "TYPE_UINT64": - case 4: - message.type = 4; - break; - case "TYPE_INT32": - case 5: - message.type = 5; - break; - case "TYPE_FIXED64": - case 6: - message.type = 6; - break; - case "TYPE_FIXED32": - case 7: - message.type = 7; - break; - case "TYPE_BOOL": - case 8: - message.type = 8; - break; - case "TYPE_STRING": - case 9: - message.type = 9; - break; - case "TYPE_GROUP": - case 10: - message.type = 10; - break; - case "TYPE_MESSAGE": - case 11: - message.type = 11; - break; - case "TYPE_BYTES": - case 12: - message.type = 12; - break; - case "TYPE_UINT32": - case 13: - message.type = 13; - break; - case "TYPE_ENUM": - case 14: - message.type = 14; - break; - case "TYPE_SFIXED32": - case 15: - message.type = 15; - break; - case "TYPE_SFIXED64": - case 16: - message.type = 16; - break; - case "TYPE_SINT32": - case 17: - message.type = 17; - break; - case "TYPE_SINT64": - case 18: - message.type = 18; - break; - } - if (object.typeName != null) - message.typeName = String(object.typeName); - if (object.extendee != null) - message.extendee = String(object.extendee); - if (object.defaultValue != null) - message.defaultValue = String(object.defaultValue); - if (object.oneofIndex != null) - message.oneofIndex = object.oneofIndex | 0; - if (object.jsonName != null) - message.jsonName = String(object.jsonName); - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.FieldOptions.fromObject(object.options); - } - if (object.proto3Optional != null) - message.proto3Optional = Boolean(object.proto3Optional); - return message; - }; - - /** - * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FieldDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.extendee = ""; - object.number = 0; - object.label = options.enums === String ? "LABEL_OPTIONAL" : 1; - object.type = options.enums === String ? "TYPE_DOUBLE" : 1; - object.typeName = ""; - object.defaultValue = ""; - object.options = null; - object.oneofIndex = 0; - object.jsonName = ""; - object.proto3Optional = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.extendee != null && message.hasOwnProperty("extendee")) - object.extendee = message.extendee; - if (message.number != null && message.hasOwnProperty("number")) - object.number = message.number; - if (message.label != null && message.hasOwnProperty("label")) - object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] === undefined ? message.label : $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] === undefined ? message.type : $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; - if (message.typeName != null && message.hasOwnProperty("typeName")) - object.typeName = message.typeName; - if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) - object.defaultValue = message.defaultValue; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options); - if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) - object.oneofIndex = message.oneofIndex; - if (message.jsonName != null && message.hasOwnProperty("jsonName")) - object.jsonName = message.jsonName; - if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) - object.proto3Optional = message.proto3Optional; - return object; - }; - - /** - * Converts this FieldDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.FieldDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - FieldDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FieldDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FieldDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FieldDescriptorProto"; - }; - - /** - * Type enum. - * @name google.protobuf.FieldDescriptorProto.Type - * @enum {number} - * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value - * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value - * @property {number} TYPE_INT64=3 TYPE_INT64 value - * @property {number} TYPE_UINT64=4 TYPE_UINT64 value - * @property {number} TYPE_INT32=5 TYPE_INT32 value - * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value - * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value - * @property {number} TYPE_BOOL=8 TYPE_BOOL value - * @property {number} TYPE_STRING=9 TYPE_STRING value - * @property {number} TYPE_GROUP=10 TYPE_GROUP value - * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value - * @property {number} TYPE_BYTES=12 TYPE_BYTES value - * @property {number} TYPE_UINT32=13 TYPE_UINT32 value - * @property {number} TYPE_ENUM=14 TYPE_ENUM value - * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value - * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value - * @property {number} TYPE_SINT32=17 TYPE_SINT32 value - * @property {number} TYPE_SINT64=18 TYPE_SINT64 value - */ - FieldDescriptorProto.Type = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[1] = "TYPE_DOUBLE"] = 1; - values[valuesById[2] = "TYPE_FLOAT"] = 2; - values[valuesById[3] = "TYPE_INT64"] = 3; - values[valuesById[4] = "TYPE_UINT64"] = 4; - values[valuesById[5] = "TYPE_INT32"] = 5; - values[valuesById[6] = "TYPE_FIXED64"] = 6; - values[valuesById[7] = "TYPE_FIXED32"] = 7; - values[valuesById[8] = "TYPE_BOOL"] = 8; - values[valuesById[9] = "TYPE_STRING"] = 9; - values[valuesById[10] = "TYPE_GROUP"] = 10; - values[valuesById[11] = "TYPE_MESSAGE"] = 11; - values[valuesById[12] = "TYPE_BYTES"] = 12; - values[valuesById[13] = "TYPE_UINT32"] = 13; - values[valuesById[14] = "TYPE_ENUM"] = 14; - values[valuesById[15] = "TYPE_SFIXED32"] = 15; - values[valuesById[16] = "TYPE_SFIXED64"] = 16; - values[valuesById[17] = "TYPE_SINT32"] = 17; - values[valuesById[18] = "TYPE_SINT64"] = 18; - return values; - })(); - - /** - * Label enum. - * @name google.protobuf.FieldDescriptorProto.Label - * @enum {number} - * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value - * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value - * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value - */ - FieldDescriptorProto.Label = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[1] = "LABEL_OPTIONAL"] = 1; - values[valuesById[3] = "LABEL_REPEATED"] = 3; - values[valuesById[2] = "LABEL_REQUIRED"] = 2; - return values; - })(); - - return FieldDescriptorProto; - })(); - - protobuf.OneofDescriptorProto = (function() { - - /** - * Properties of an OneofDescriptorProto. - * @memberof google.protobuf - * @interface IOneofDescriptorProto - * @property {string|null} [name] OneofDescriptorProto name - * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options - */ - - /** - * Constructs a new OneofDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents an OneofDescriptorProto. - * @implements IOneofDescriptorProto - * @constructor - * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set - */ - function OneofDescriptorProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * OneofDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.OneofDescriptorProto - * @instance - */ - OneofDescriptorProto.prototype.name = ""; - - /** - * OneofDescriptorProto options. - * @member {google.protobuf.IOneofOptions|null|undefined} options - * @memberof google.protobuf.OneofDescriptorProto - * @instance - */ - OneofDescriptorProto.prototype.options = null; - - /** - * Creates a new OneofDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance - */ - OneofDescriptorProto.create = function create(properties) { - return new OneofDescriptorProto(properties); - }; - - /** - * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofDescriptorProto.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OneofDescriptorProto message. - * @function verify - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OneofDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.OneofOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto - */ - OneofDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.OneofDescriptorProto) - return object; - var message = new $root.google.protobuf.OneofDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.OneofOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OneofDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this OneofDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.OneofDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - OneofDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OneofDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OneofDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.OneofDescriptorProto"; - }; - - return OneofDescriptorProto; - })(); - - protobuf.EnumDescriptorProto = (function() { - - /** - * Properties of an EnumDescriptorProto. - * @memberof google.protobuf - * @interface IEnumDescriptorProto - * @property {string|null} [name] EnumDescriptorProto name - * @property {Array.|null} [value] EnumDescriptorProto value - * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options - * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange - * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName - */ - - /** - * Constructs a new EnumDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents an EnumDescriptorProto. - * @implements IEnumDescriptorProto - * @constructor - * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set - */ - function EnumDescriptorProto(properties) { - this.value = []; - this.reservedRange = []; - this.reservedName = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.name = ""; - - /** - * EnumDescriptorProto value. - * @member {Array.} value - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.value = $util.emptyArray; - - /** - * EnumDescriptorProto options. - * @member {google.protobuf.IEnumOptions|null|undefined} options - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.options = null; - - /** - * EnumDescriptorProto reservedRange. - * @member {Array.} reservedRange - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; - - /** - * EnumDescriptorProto reservedName. - * @member {Array.} reservedName - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.reservedName = $util.emptyArray; - - /** - * Creates a new EnumDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance - */ - EnumDescriptorProto.create = function create(properties) { - return new EnumDescriptorProto(properties); - }; - - /** - * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.value != null && message.value.length) - for (var i = 0; i < message.value.length; ++i) - $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.reservedRange != null && message.reservedRange.length) - for (var i = 0; i < message.reservedRange.length; ++i) - $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.reservedName != null && message.reservedName.length) - for (var i = 0; i < message.reservedName.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); - return writer; - }; - - /** - * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumDescriptorProto.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - if (!(message.value && message.value.length)) - message.value = []; - message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 3: { - message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); - break; - } - case 4: { - if (!(message.reservedRange && message.reservedRange.length)) - message.reservedRange = []; - message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32())); - break; - } - case 5: { - if (!(message.reservedName && message.reservedName.length)) - message.reservedName = []; - message.reservedName.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumDescriptorProto message. - * @function verify - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.value != null && message.hasOwnProperty("value")) { - if (!Array.isArray(message.value)) - return "value: array expected"; - for (var i = 0; i < message.value.length; ++i) { - var error = $root.google.protobuf.EnumValueDescriptorProto.verify(message.value[i]); - if (error) - return "value." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.EnumOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { - if (!Array.isArray(message.reservedRange)) - return "reservedRange: array expected"; - for (var i = 0; i < message.reservedRange.length; ++i) { - var error = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.verify(message.reservedRange[i]); - if (error) - return "reservedRange." + error; - } - } - if (message.reservedName != null && message.hasOwnProperty("reservedName")) { - if (!Array.isArray(message.reservedName)) - return "reservedName: array expected"; - for (var i = 0; i < message.reservedName.length; ++i) - if (!$util.isString(message.reservedName[i])) - return "reservedName: string[] expected"; - } - return null; - }; - - /** - * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto - */ - EnumDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumDescriptorProto) - return object; - var message = new $root.google.protobuf.EnumDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.value) { - if (!Array.isArray(object.value)) - throw TypeError(".google.protobuf.EnumDescriptorProto.value: array expected"); - message.value = []; - for (var i = 0; i < object.value.length; ++i) { - if (typeof object.value[i] !== "object") - throw TypeError(".google.protobuf.EnumDescriptorProto.value: object expected"); - message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.EnumDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.EnumOptions.fromObject(object.options); - } - if (object.reservedRange) { - if (!Array.isArray(object.reservedRange)) - throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: array expected"); - message.reservedRange = []; - for (var i = 0; i < object.reservedRange.length; ++i) { - if (typeof object.reservedRange[i] !== "object") - throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: object expected"); - message.reservedRange[i] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.fromObject(object.reservedRange[i]); - } - } - if (object.reservedName) { - if (!Array.isArray(object.reservedName)) - throw TypeError(".google.protobuf.EnumDescriptorProto.reservedName: array expected"); - message.reservedName = []; - for (var i = 0; i < object.reservedName.length; ++i) - message.reservedName[i] = String(object.reservedName[i]); - } - return message; - }; - - /** - * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.value = []; - object.reservedRange = []; - object.reservedName = []; - } - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.value && message.value.length) { - object.value = []; - for (var j = 0; j < message.value.length; ++j) - object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options); - if (message.reservedRange && message.reservedRange.length) { - object.reservedRange = []; - for (var j = 0; j < message.reservedRange.length; ++j) - object.reservedRange[j] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.toObject(message.reservedRange[j], options); - } - if (message.reservedName && message.reservedName.length) { - object.reservedName = []; - for (var j = 0; j < message.reservedName.length; ++j) - object.reservedName[j] = message.reservedName[j]; - } - return object; - }; - - /** - * Converts this EnumDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.EnumDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - EnumDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto"; - }; - - EnumDescriptorProto.EnumReservedRange = (function() { - - /** - * Properties of an EnumReservedRange. - * @memberof google.protobuf.EnumDescriptorProto - * @interface IEnumReservedRange - * @property {number|null} [start] EnumReservedRange start - * @property {number|null} [end] EnumReservedRange end - */ - - /** - * Constructs a new EnumReservedRange. - * @memberof google.protobuf.EnumDescriptorProto - * @classdesc Represents an EnumReservedRange. - * @implements IEnumReservedRange - * @constructor - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set - */ - function EnumReservedRange(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumReservedRange start. - * @member {number} start - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @instance - */ - EnumReservedRange.prototype.start = 0; - - /** - * EnumReservedRange end. - * @member {number} end - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @instance - */ - EnumReservedRange.prototype.end = 0; - - /** - * Creates a new EnumReservedRange instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set - * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance - */ - EnumReservedRange.create = function create(properties) { - return new EnumReservedRange(properties); - }; - - /** - * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumReservedRange.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.start != null && Object.hasOwnProperty.call(message, "start")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); - return writer; - }; - - /** - * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumReservedRange message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumReservedRange.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.start = reader.int32(); - break; - } - case 2: { - message.end = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumReservedRange.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumReservedRange message. - * @function verify - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumReservedRange.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.start != null && message.hasOwnProperty("start")) - if (!$util.isInteger(message.start)) - return "start: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - return null; - }; - - /** - * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange - */ - EnumReservedRange.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumDescriptorProto.EnumReservedRange) - return object; - var message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); - if (object.start != null) - message.start = object.start | 0; - if (object.end != null) - message.end = object.end | 0; - return message; - }; - - /** - * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {google.protobuf.EnumDescriptorProto.EnumReservedRange} message EnumReservedRange - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumReservedRange.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.start = 0; - object.end = 0; - } - if (message.start != null && message.hasOwnProperty("start")) - object.start = message.start; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - return object; - }; - - /** - * Converts this EnumReservedRange to JSON. - * @function toJSON - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @instance - * @returns {Object.} JSON object - */ - EnumReservedRange.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumReservedRange - * @function getTypeUrl - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto.EnumReservedRange"; - }; - - return EnumReservedRange; - })(); - - return EnumDescriptorProto; - })(); - - protobuf.EnumValueDescriptorProto = (function() { - - /** - * Properties of an EnumValueDescriptorProto. - * @memberof google.protobuf - * @interface IEnumValueDescriptorProto - * @property {string|null} [name] EnumValueDescriptorProto name - * @property {number|null} [number] EnumValueDescriptorProto number - * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options - */ - - /** - * Constructs a new EnumValueDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents an EnumValueDescriptorProto. - * @implements IEnumValueDescriptorProto - * @constructor - * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set - */ - function EnumValueDescriptorProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumValueDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - */ - EnumValueDescriptorProto.prototype.name = ""; - - /** - * EnumValueDescriptorProto number. - * @member {number} number - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - */ - EnumValueDescriptorProto.prototype.number = 0; - - /** - * EnumValueDescriptorProto options. - * @member {google.protobuf.IEnumValueOptions|null|undefined} options - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - */ - EnumValueDescriptorProto.prototype.options = null; - - /** - * Creates a new EnumValueDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance - */ - EnumValueDescriptorProto.create = function create(properties) { - return new EnumValueDescriptorProto(properties); - }; - - /** - * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.number != null && Object.hasOwnProperty.call(message, "number")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueDescriptorProto.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.number = reader.int32(); - break; - } - case 3: { - message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumValueDescriptorProto message. - * @function verify - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumValueDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.number != null && message.hasOwnProperty("number")) - if (!$util.isInteger(message.number)) - return "number: integer expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.EnumValueOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto - */ - EnumValueDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) - return object; - var message = new $root.google.protobuf.EnumValueDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.number != null) - message.number = object.number | 0; - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumValueDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.number = 0; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.number != null && message.hasOwnProperty("number")) - object.number = message.number; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this EnumValueDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - EnumValueDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumValueDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumValueDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumValueDescriptorProto"; - }; - - return EnumValueDescriptorProto; - })(); - - protobuf.ServiceDescriptorProto = (function() { - - /** - * Properties of a ServiceDescriptorProto. - * @memberof google.protobuf - * @interface IServiceDescriptorProto - * @property {string|null} [name] ServiceDescriptorProto name - * @property {Array.|null} [method] ServiceDescriptorProto method - * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options - */ - - /** - * Constructs a new ServiceDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a ServiceDescriptorProto. - * @implements IServiceDescriptorProto - * @constructor - * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set - */ - function ServiceDescriptorProto(properties) { - this.method = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ServiceDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - */ - ServiceDescriptorProto.prototype.name = ""; - - /** - * ServiceDescriptorProto method. - * @member {Array.} method - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - */ - ServiceDescriptorProto.prototype.method = $util.emptyArray; - - /** - * ServiceDescriptorProto options. - * @member {google.protobuf.IServiceOptions|null|undefined} options - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - */ - ServiceDescriptorProto.prototype.options = null; - - /** - * Creates a new ServiceDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance - */ - ServiceDescriptorProto.create = function create(properties) { - return new ServiceDescriptorProto(properties); - }; - - /** - * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.method != null && message.method.length) - for (var i = 0; i < message.method.length; ++i) - $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceDescriptorProto.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - if (!(message.method && message.method.length)) - message.method = []; - message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 3: { - message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ServiceDescriptorProto message. - * @function verify - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ServiceDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.method != null && message.hasOwnProperty("method")) { - if (!Array.isArray(message.method)) - return "method: array expected"; - for (var i = 0; i < message.method.length; ++i) { - var error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i]); - if (error) - return "method." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.ServiceOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto - */ - ServiceDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ServiceDescriptorProto) - return object; - var message = new $root.google.protobuf.ServiceDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.method) { - if (!Array.isArray(object.method)) - throw TypeError(".google.protobuf.ServiceDescriptorProto.method: array expected"); - message.method = []; - for (var i = 0; i < object.method.length; ++i) { - if (typeof object.method[i] !== "object") - throw TypeError(".google.protobuf.ServiceDescriptorProto.method: object expected"); - message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ServiceDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.method = []; - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.method && message.method.length) { - object.method = []; - for (var j = 0; j < message.method.length; ++j) - object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this ServiceDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - ServiceDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ServiceDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ServiceDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.ServiceDescriptorProto"; - }; - - return ServiceDescriptorProto; - })(); - - protobuf.MethodDescriptorProto = (function() { - - /** - * Properties of a MethodDescriptorProto. - * @memberof google.protobuf - * @interface IMethodDescriptorProto - * @property {string|null} [name] MethodDescriptorProto name - * @property {string|null} [inputType] MethodDescriptorProto inputType - * @property {string|null} [outputType] MethodDescriptorProto outputType - * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options - * @property {boolean|null} [clientStreaming] MethodDescriptorProto clientStreaming - * @property {boolean|null} [serverStreaming] MethodDescriptorProto serverStreaming - */ - - /** - * Constructs a new MethodDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a MethodDescriptorProto. - * @implements IMethodDescriptorProto - * @constructor - * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set - */ - function MethodDescriptorProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MethodDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.name = ""; - - /** - * MethodDescriptorProto inputType. - * @member {string} inputType - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.inputType = ""; - - /** - * MethodDescriptorProto outputType. - * @member {string} outputType - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.outputType = ""; - - /** - * MethodDescriptorProto options. - * @member {google.protobuf.IMethodOptions|null|undefined} options - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.options = null; - - /** - * MethodDescriptorProto clientStreaming. - * @member {boolean} clientStreaming - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.clientStreaming = false; - - /** - * MethodDescriptorProto serverStreaming. - * @member {boolean} serverStreaming - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.serverStreaming = false; - - /** - * Creates a new MethodDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance - */ - MethodDescriptorProto.create = function create(properties) { - return new MethodDescriptorProto(properties); - }; - - /** - * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); - if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); - if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); - return writer; - }; - - /** - * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodDescriptorProto.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.inputType = reader.string(); - break; - } - case 3: { - message.outputType = reader.string(); - break; - } - case 4: { - message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); - break; - } - case 5: { - message.clientStreaming = reader.bool(); - break; - } - case 6: { - message.serverStreaming = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MethodDescriptorProto message. - * @function verify - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MethodDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.inputType != null && message.hasOwnProperty("inputType")) - if (!$util.isString(message.inputType)) - return "inputType: string expected"; - if (message.outputType != null && message.hasOwnProperty("outputType")) - if (!$util.isString(message.outputType)) - return "outputType: string expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.MethodOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) - if (typeof message.clientStreaming !== "boolean") - return "clientStreaming: boolean expected"; - if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) - if (typeof message.serverStreaming !== "boolean") - return "serverStreaming: boolean expected"; - return null; - }; - - /** - * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto - */ - MethodDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.MethodDescriptorProto) - return object; - var message = new $root.google.protobuf.MethodDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.inputType != null) - message.inputType = String(object.inputType); - if (object.outputType != null) - message.outputType = String(object.outputType); - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.MethodOptions.fromObject(object.options); - } - if (object.clientStreaming != null) - message.clientStreaming = Boolean(object.clientStreaming); - if (object.serverStreaming != null) - message.serverStreaming = Boolean(object.serverStreaming); - return message; - }; - - /** - * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MethodDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.inputType = ""; - object.outputType = ""; - object.options = null; - object.clientStreaming = false; - object.serverStreaming = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.inputType != null && message.hasOwnProperty("inputType")) - object.inputType = message.inputType; - if (message.outputType != null && message.hasOwnProperty("outputType")) - object.outputType = message.outputType; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options); - if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) - object.clientStreaming = message.clientStreaming; - if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) - object.serverStreaming = message.serverStreaming; - return object; - }; - - /** - * Converts this MethodDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.MethodDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - MethodDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MethodDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MethodDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.MethodDescriptorProto"; - }; - - return MethodDescriptorProto; - })(); - - protobuf.FileOptions = (function() { - - /** - * Properties of a FileOptions. - * @memberof google.protobuf - * @interface IFileOptions - * @property {string|null} [javaPackage] FileOptions javaPackage - * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname - * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles - * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash - * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8 - * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor - * @property {string|null} [goPackage] FileOptions goPackage - * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices - * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices - * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices - * @property {boolean|null} [deprecated] FileOptions deprecated - * @property {boolean|null} [ccEnableArenas] FileOptions ccEnableArenas - * @property {string|null} [objcClassPrefix] FileOptions objcClassPrefix - * @property {string|null} [csharpNamespace] FileOptions csharpNamespace - * @property {string|null} [swiftPrefix] FileOptions swiftPrefix - * @property {string|null} [phpClassPrefix] FileOptions phpClassPrefix - * @property {string|null} [phpNamespace] FileOptions phpNamespace - * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace - * @property {string|null} [rubyPackage] FileOptions rubyPackage - * @property {google.protobuf.IFeatureSet|null} [features] FileOptions features - * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption - * @property {Array.|null} [".google.api.resourceDefinition"] FileOptions .google.api.resourceDefinition - */ - - /** - * Constructs a new FileOptions. - * @memberof google.protobuf - * @classdesc Represents a FileOptions. - * @implements IFileOptions - * @constructor - * @param {google.protobuf.IFileOptions=} [properties] Properties to set - */ - function FileOptions(properties) { - this.uninterpretedOption = []; - this[".google.api.resourceDefinition"] = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FileOptions javaPackage. - * @member {string} javaPackage - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaPackage = ""; - - /** - * FileOptions javaOuterClassname. - * @member {string} javaOuterClassname - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaOuterClassname = ""; - - /** - * FileOptions javaMultipleFiles. - * @member {boolean} javaMultipleFiles - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaMultipleFiles = false; - - /** - * FileOptions javaGenerateEqualsAndHash. - * @member {boolean} javaGenerateEqualsAndHash - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaGenerateEqualsAndHash = false; - - /** - * FileOptions javaStringCheckUtf8. - * @member {boolean} javaStringCheckUtf8 - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaStringCheckUtf8 = false; - - /** - * FileOptions optimizeFor. - * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.optimizeFor = 1; - - /** - * FileOptions goPackage. - * @member {string} goPackage - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.goPackage = ""; - - /** - * FileOptions ccGenericServices. - * @member {boolean} ccGenericServices - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.ccGenericServices = false; - - /** - * FileOptions javaGenericServices. - * @member {boolean} javaGenericServices - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaGenericServices = false; - - /** - * FileOptions pyGenericServices. - * @member {boolean} pyGenericServices - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.pyGenericServices = false; - - /** - * FileOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.deprecated = false; - - /** - * FileOptions ccEnableArenas. - * @member {boolean} ccEnableArenas - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.ccEnableArenas = true; - - /** - * FileOptions objcClassPrefix. - * @member {string} objcClassPrefix - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.objcClassPrefix = ""; - - /** - * FileOptions csharpNamespace. - * @member {string} csharpNamespace - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.csharpNamespace = ""; - - /** - * FileOptions swiftPrefix. - * @member {string} swiftPrefix - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.swiftPrefix = ""; - - /** - * FileOptions phpClassPrefix. - * @member {string} phpClassPrefix - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.phpClassPrefix = ""; - - /** - * FileOptions phpNamespace. - * @member {string} phpNamespace - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.phpNamespace = ""; - - /** - * FileOptions phpMetadataNamespace. - * @member {string} phpMetadataNamespace - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.phpMetadataNamespace = ""; - - /** - * FileOptions rubyPackage. - * @member {string} rubyPackage - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.rubyPackage = ""; - - /** - * FileOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.features = null; - - /** - * FileOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * FileOptions .google.api.resourceDefinition. - * @member {Array.} .google.api.resourceDefinition - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray; - - /** - * Creates a new FileOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.FileOptions - * @static - * @param {google.protobuf.IFileOptions=} [properties] Properties to set - * @returns {google.protobuf.FileOptions} FileOptions instance - */ - FileOptions.create = function create(properties) { - return new FileOptions(properties); - }; - - /** - * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FileOptions - * @static - * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); - if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); - if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); - if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) - writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); - if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); - if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) - writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); - if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) - writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); - if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) - writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); - if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) - writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); - if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) - writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); - if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) - writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); - if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) - writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); - if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) - writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); - if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) - writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); - if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) - writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); - if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) - writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); - if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) - writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); - if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) - writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.resourceDefinition"] != null && message[".google.api.resourceDefinition"].length) - for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) - $root.google.api.ResourceDescriptor.encode(message[".google.api.resourceDefinition"][i], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FileOptions - * @static - * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FileOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FileOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FileOptions} FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.javaPackage = reader.string(); - break; - } - case 8: { - message.javaOuterClassname = reader.string(); - break; - } - case 10: { - message.javaMultipleFiles = reader.bool(); - break; - } - case 20: { - message.javaGenerateEqualsAndHash = reader.bool(); - break; - } - case 27: { - message.javaStringCheckUtf8 = reader.bool(); - break; - } - case 9: { - message.optimizeFor = reader.int32(); - break; - } - case 11: { - message.goPackage = reader.string(); - break; - } - case 16: { - message.ccGenericServices = reader.bool(); - break; - } - case 17: { - message.javaGenericServices = reader.bool(); - break; - } - case 18: { - message.pyGenericServices = reader.bool(); - break; - } - case 23: { - message.deprecated = reader.bool(); - break; - } - case 31: { - message.ccEnableArenas = reader.bool(); - break; - } - case 36: { - message.objcClassPrefix = reader.string(); - break; - } - case 37: { - message.csharpNamespace = reader.string(); - break; - } - case 39: { - message.swiftPrefix = reader.string(); - break; - } - case 40: { - message.phpClassPrefix = reader.string(); - break; - } - case 41: { - message.phpNamespace = reader.string(); - break; - } - case 44: { - message.phpMetadataNamespace = reader.string(); - break; - } - case 45: { - message.rubyPackage = reader.string(); - break; - } - case 50: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 1053: { - if (!(message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length)) - message[".google.api.resourceDefinition"] = []; - message[".google.api.resourceDefinition"].push($root.google.api.ResourceDescriptor.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FileOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FileOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FileOptions} FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FileOptions message. - * @function verify - * @memberof google.protobuf.FileOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FileOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) - if (!$util.isString(message.javaPackage)) - return "javaPackage: string expected"; - if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) - if (!$util.isString(message.javaOuterClassname)) - return "javaOuterClassname: string expected"; - if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) - if (typeof message.javaMultipleFiles !== "boolean") - return "javaMultipleFiles: boolean expected"; - if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) - if (typeof message.javaGenerateEqualsAndHash !== "boolean") - return "javaGenerateEqualsAndHash: boolean expected"; - if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) - if (typeof message.javaStringCheckUtf8 !== "boolean") - return "javaStringCheckUtf8: boolean expected"; - if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) - switch (message.optimizeFor) { - default: - return "optimizeFor: enum value expected"; - case 1: - case 2: - case 3: - break; - } - if (message.goPackage != null && message.hasOwnProperty("goPackage")) - if (!$util.isString(message.goPackage)) - return "goPackage: string expected"; - if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) - if (typeof message.ccGenericServices !== "boolean") - return "ccGenericServices: boolean expected"; - if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) - if (typeof message.javaGenericServices !== "boolean") - return "javaGenericServices: boolean expected"; - if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) - if (typeof message.pyGenericServices !== "boolean") - return "pyGenericServices: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) - if (typeof message.ccEnableArenas !== "boolean") - return "ccEnableArenas: boolean expected"; - if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) - if (!$util.isString(message.objcClassPrefix)) - return "objcClassPrefix: string expected"; - if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) - if (!$util.isString(message.csharpNamespace)) - return "csharpNamespace: string expected"; - if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) - if (!$util.isString(message.swiftPrefix)) - return "swiftPrefix: string expected"; - if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) - if (!$util.isString(message.phpClassPrefix)) - return "phpClassPrefix: string expected"; - if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) - if (!$util.isString(message.phpNamespace)) - return "phpNamespace: string expected"; - if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) - if (!$util.isString(message.phpMetadataNamespace)) - return "phpMetadataNamespace: string expected"; - if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) - if (!$util.isString(message.rubyPackage)) - return "rubyPackage: string expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".google.api.resourceDefinition"] != null && message.hasOwnProperty(".google.api.resourceDefinition")) { - if (!Array.isArray(message[".google.api.resourceDefinition"])) - return ".google.api.resourceDefinition: array expected"; - for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) { - var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resourceDefinition"][i]); - if (error) - return ".google.api.resourceDefinition." + error; - } - } - return null; - }; - - /** - * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FileOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FileOptions} FileOptions - */ - FileOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FileOptions) - return object; - var message = new $root.google.protobuf.FileOptions(); - if (object.javaPackage != null) - message.javaPackage = String(object.javaPackage); - if (object.javaOuterClassname != null) - message.javaOuterClassname = String(object.javaOuterClassname); - if (object.javaMultipleFiles != null) - message.javaMultipleFiles = Boolean(object.javaMultipleFiles); - if (object.javaGenerateEqualsAndHash != null) - message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash); - if (object.javaStringCheckUtf8 != null) - message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); - switch (object.optimizeFor) { - default: - if (typeof object.optimizeFor === "number") { - message.optimizeFor = object.optimizeFor; - break; - } - break; - case "SPEED": - case 1: - message.optimizeFor = 1; - break; - case "CODE_SIZE": - case 2: - message.optimizeFor = 2; - break; - case "LITE_RUNTIME": - case 3: - message.optimizeFor = 3; - break; - } - if (object.goPackage != null) - message.goPackage = String(object.goPackage); - if (object.ccGenericServices != null) - message.ccGenericServices = Boolean(object.ccGenericServices); - if (object.javaGenericServices != null) - message.javaGenericServices = Boolean(object.javaGenericServices); - if (object.pyGenericServices != null) - message.pyGenericServices = Boolean(object.pyGenericServices); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.ccEnableArenas != null) - message.ccEnableArenas = Boolean(object.ccEnableArenas); - if (object.objcClassPrefix != null) - message.objcClassPrefix = String(object.objcClassPrefix); - if (object.csharpNamespace != null) - message.csharpNamespace = String(object.csharpNamespace); - if (object.swiftPrefix != null) - message.swiftPrefix = String(object.swiftPrefix); - if (object.phpClassPrefix != null) - message.phpClassPrefix = String(object.phpClassPrefix); - if (object.phpNamespace != null) - message.phpNamespace = String(object.phpNamespace); - if (object.phpMetadataNamespace != null) - message.phpMetadataNamespace = String(object.phpMetadataNamespace); - if (object.rubyPackage != null) - message.rubyPackage = String(object.rubyPackage); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.FileOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".google.api.resourceDefinition"]) { - if (!Array.isArray(object[".google.api.resourceDefinition"])) - throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: array expected"); - message[".google.api.resourceDefinition"] = []; - for (var i = 0; i < object[".google.api.resourceDefinition"].length; ++i) { - if (typeof object[".google.api.resourceDefinition"][i] !== "object") - throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: object expected"); - message[".google.api.resourceDefinition"][i] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resourceDefinition"][i]); - } - } - return message; - }; - - /** - * Creates a plain object from a FileOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FileOptions - * @static - * @param {google.protobuf.FileOptions} message FileOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FileOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.uninterpretedOption = []; - object[".google.api.resourceDefinition"] = []; - } - if (options.defaults) { - object.javaPackage = ""; - object.javaOuterClassname = ""; - object.optimizeFor = options.enums === String ? "SPEED" : 1; - object.javaMultipleFiles = false; - object.goPackage = ""; - object.ccGenericServices = false; - object.javaGenericServices = false; - object.pyGenericServices = false; - object.javaGenerateEqualsAndHash = false; - object.deprecated = false; - object.javaStringCheckUtf8 = false; - object.ccEnableArenas = true; - object.objcClassPrefix = ""; - object.csharpNamespace = ""; - object.swiftPrefix = ""; - object.phpClassPrefix = ""; - object.phpNamespace = ""; - object.phpMetadataNamespace = ""; - object.rubyPackage = ""; - object.features = null; - } - if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) - object.javaPackage = message.javaPackage; - if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) - object.javaOuterClassname = message.javaOuterClassname; - if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) - object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] === undefined ? message.optimizeFor : $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; - if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) - object.javaMultipleFiles = message.javaMultipleFiles; - if (message.goPackage != null && message.hasOwnProperty("goPackage")) - object.goPackage = message.goPackage; - if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) - object.ccGenericServices = message.ccGenericServices; - if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) - object.javaGenericServices = message.javaGenericServices; - if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) - object.pyGenericServices = message.pyGenericServices; - if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) - object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) - object.javaStringCheckUtf8 = message.javaStringCheckUtf8; - if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) - object.ccEnableArenas = message.ccEnableArenas; - if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) - object.objcClassPrefix = message.objcClassPrefix; - if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) - object.csharpNamespace = message.csharpNamespace; - if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) - object.swiftPrefix = message.swiftPrefix; - if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) - object.phpClassPrefix = message.phpClassPrefix; - if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) - object.phpNamespace = message.phpNamespace; - if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) - object.phpMetadataNamespace = message.phpMetadataNamespace; - if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) - object.rubyPackage = message.rubyPackage; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length) { - object[".google.api.resourceDefinition"] = []; - for (var j = 0; j < message[".google.api.resourceDefinition"].length; ++j) - object[".google.api.resourceDefinition"][j] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resourceDefinition"][j], options); - } - return object; - }; - - /** - * Converts this FileOptions to JSON. - * @function toJSON - * @memberof google.protobuf.FileOptions - * @instance - * @returns {Object.} JSON object - */ - FileOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FileOptions - * @function getTypeUrl - * @memberof google.protobuf.FileOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FileOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FileOptions"; - }; - - /** - * OptimizeMode enum. - * @name google.protobuf.FileOptions.OptimizeMode - * @enum {number} - * @property {number} SPEED=1 SPEED value - * @property {number} CODE_SIZE=2 CODE_SIZE value - * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value - */ - FileOptions.OptimizeMode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[1] = "SPEED"] = 1; - values[valuesById[2] = "CODE_SIZE"] = 2; - values[valuesById[3] = "LITE_RUNTIME"] = 3; - return values; - })(); - - return FileOptions; - })(); - - protobuf.MessageOptions = (function() { - - /** - * Properties of a MessageOptions. - * @memberof google.protobuf - * @interface IMessageOptions - * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat - * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor - * @property {boolean|null} [deprecated] MessageOptions deprecated - * @property {boolean|null} [mapEntry] MessageOptions mapEntry - * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] MessageOptions deprecatedLegacyJsonFieldConflicts - * @property {google.protobuf.IFeatureSet|null} [features] MessageOptions features - * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption - * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource - */ - - /** - * Constructs a new MessageOptions. - * @memberof google.protobuf - * @classdesc Represents a MessageOptions. - * @implements IMessageOptions - * @constructor - * @param {google.protobuf.IMessageOptions=} [properties] Properties to set - */ - function MessageOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MessageOptions messageSetWireFormat. - * @member {boolean} messageSetWireFormat - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.messageSetWireFormat = false; - - /** - * MessageOptions noStandardDescriptorAccessor. - * @member {boolean} noStandardDescriptorAccessor - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.noStandardDescriptorAccessor = false; - - /** - * MessageOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.deprecated = false; - - /** - * MessageOptions mapEntry. - * @member {boolean} mapEntry - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.mapEntry = false; - - /** - * MessageOptions deprecatedLegacyJsonFieldConflicts. - * @member {boolean} deprecatedLegacyJsonFieldConflicts - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; - - /** - * MessageOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.features = null; - - /** - * MessageOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * MessageOptions .google.api.resource. - * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".google.api.resource"] = null; - - /** - * Creates a new MessageOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.IMessageOptions=} [properties] Properties to set - * @returns {google.protobuf.MessageOptions} MessageOptions instance - */ - MessageOptions.create = function create(properties) { - return new MessageOptions(properties); - }; - - /** - * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MessageOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); - if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) - writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); - if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) - writer.uint32(/* id 11, wireType 0 =*/88).bool(message.deprecatedLegacyJsonFieldConflicts); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.resource"] != null && Object.hasOwnProperty.call(message, ".google.api.resource")) - $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MessageOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.MessageOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.MessageOptions} MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MessageOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.messageSetWireFormat = reader.bool(); - break; - } - case 2: { - message.noStandardDescriptorAccessor = reader.bool(); - break; - } - case 3: { - message.deprecated = reader.bool(); - break; - } - case 7: { - message.mapEntry = reader.bool(); - break; - } - case 11: { - message.deprecatedLegacyJsonFieldConflicts = reader.bool(); - break; - } - case 12: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 1053: { - message[".google.api.resource"] = $root.google.api.ResourceDescriptor.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MessageOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.MessageOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.MessageOptions} MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MessageOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MessageOptions message. - * @function verify - * @memberof google.protobuf.MessageOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MessageOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) - if (typeof message.messageSetWireFormat !== "boolean") - return "messageSetWireFormat: boolean expected"; - if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) - if (typeof message.noStandardDescriptorAccessor !== "boolean") - return "noStandardDescriptorAccessor: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) - if (typeof message.mapEntry !== "boolean") - return "mapEntry: boolean expected"; - if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) - if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") - return "deprecatedLegacyJsonFieldConflicts: boolean expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) { - var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resource"]); - if (error) - return ".google.api.resource." + error; - } - return null; - }; - - /** - * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.MessageOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.MessageOptions} MessageOptions - */ - MessageOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.MessageOptions) - return object; - var message = new $root.google.protobuf.MessageOptions(); - if (object.messageSetWireFormat != null) - message.messageSetWireFormat = Boolean(object.messageSetWireFormat); - if (object.noStandardDescriptorAccessor != null) - message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.mapEntry != null) - message.mapEntry = Boolean(object.mapEntry); - if (object.deprecatedLegacyJsonFieldConflicts != null) - message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.MessageOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".google.api.resource"] != null) { - if (typeof object[".google.api.resource"] !== "object") - throw TypeError(".google.protobuf.MessageOptions..google.api.resource: object expected"); - message[".google.api.resource"] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resource"]); - } - return message; - }; - - /** - * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.MessageOptions} message MessageOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MessageOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) { - object.messageSetWireFormat = false; - object.noStandardDescriptorAccessor = false; - object.deprecated = false; - object.mapEntry = false; - object.deprecatedLegacyJsonFieldConflicts = false; - object.features = null; - object[".google.api.resource"] = null; - } - if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) - object.messageSetWireFormat = message.messageSetWireFormat; - if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) - object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) - object.mapEntry = message.mapEntry; - if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) - object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) - object[".google.api.resource"] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resource"], options); - return object; - }; - - /** - * Converts this MessageOptions to JSON. - * @function toJSON - * @memberof google.protobuf.MessageOptions - * @instance - * @returns {Object.} JSON object - */ - MessageOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MessageOptions - * @function getTypeUrl - * @memberof google.protobuf.MessageOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MessageOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.MessageOptions"; - }; - - return MessageOptions; - })(); - - protobuf.FieldOptions = (function() { - - /** - * Properties of a FieldOptions. - * @memberof google.protobuf - * @interface IFieldOptions - * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype - * @property {boolean|null} [packed] FieldOptions packed - * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype - * @property {boolean|null} [lazy] FieldOptions lazy - * @property {boolean|null} [unverifiedLazy] FieldOptions unverifiedLazy - * @property {boolean|null} [deprecated] FieldOptions deprecated - * @property {boolean|null} [weak] FieldOptions weak - * @property {boolean|null} [debugRedact] FieldOptions debugRedact - * @property {google.protobuf.FieldOptions.OptionRetention|null} [retention] FieldOptions retention - * @property {Array.|null} [targets] FieldOptions targets - * @property {Array.|null} [editionDefaults] FieldOptions editionDefaults - * @property {google.protobuf.IFeatureSet|null} [features] FieldOptions features - * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption - * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior - * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference - */ - - /** - * Constructs a new FieldOptions. - * @memberof google.protobuf - * @classdesc Represents a FieldOptions. - * @implements IFieldOptions - * @constructor - * @param {google.protobuf.IFieldOptions=} [properties] Properties to set - */ - function FieldOptions(properties) { - this.targets = []; - this.editionDefaults = []; - this.uninterpretedOption = []; - this[".google.api.fieldBehavior"] = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FieldOptions ctype. - * @member {google.protobuf.FieldOptions.CType} ctype - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.ctype = 0; - - /** - * FieldOptions packed. - * @member {boolean} packed - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.packed = false; - - /** - * FieldOptions jstype. - * @member {google.protobuf.FieldOptions.JSType} jstype - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.jstype = 0; - - /** - * FieldOptions lazy. - * @member {boolean} lazy - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.lazy = false; - - /** - * FieldOptions unverifiedLazy. - * @member {boolean} unverifiedLazy - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.unverifiedLazy = false; - - /** - * FieldOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.deprecated = false; - - /** - * FieldOptions weak. - * @member {boolean} weak - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.weak = false; - - /** - * FieldOptions debugRedact. - * @member {boolean} debugRedact - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.debugRedact = false; - - /** - * FieldOptions retention. - * @member {google.protobuf.FieldOptions.OptionRetention} retention - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.retention = 0; - - /** - * FieldOptions targets. - * @member {Array.} targets - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.targets = $util.emptyArray; - - /** - * FieldOptions editionDefaults. - * @member {Array.} editionDefaults - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.editionDefaults = $util.emptyArray; - - /** - * FieldOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.features = null; - - /** - * FieldOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * FieldOptions .google.api.fieldBehavior. - * @member {Array.} .google.api.fieldBehavior - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; - - /** - * FieldOptions .google.api.resourceReference. - * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".google.api.resourceReference"] = null; - - /** - * Creates a new FieldOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.IFieldOptions=} [properties] Properties to set - * @returns {google.protobuf.FieldOptions} FieldOptions instance - */ - FieldOptions.create = function create(properties) { - return new FieldOptions(properties); - }; - - /** - * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); - if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); - if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); - if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) - writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); - if (message.unverifiedLazy != null && Object.hasOwnProperty.call(message, "unverifiedLazy")) - writer.uint32(/* id 15, wireType 0 =*/120).bool(message.unverifiedLazy); - if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) - writer.uint32(/* id 16, wireType 0 =*/128).bool(message.debugRedact); - if (message.retention != null && Object.hasOwnProperty.call(message, "retention")) - writer.uint32(/* id 17, wireType 0 =*/136).int32(message.retention); - if (message.targets != null && message.targets.length) - for (var i = 0; i < message.targets.length; ++i) - writer.uint32(/* id 19, wireType 0 =*/152).int32(message.targets[i]); - if (message.editionDefaults != null && message.editionDefaults.length) - for (var i = 0; i < message.editionDefaults.length; ++i) - $root.google.protobuf.FieldOptions.EditionDefault.encode(message.editionDefaults[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) - for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) - writer.uint32(/* id 1052, wireType 0 =*/8416).int32(message[".google.api.fieldBehavior"][i]); - if (message[".google.api.resourceReference"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceReference")) - $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FieldOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FieldOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldOptions} FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.ctype = reader.int32(); - break; - } - case 2: { - message.packed = reader.bool(); - break; - } - case 6: { - message.jstype = reader.int32(); - break; - } - case 5: { - message.lazy = reader.bool(); - break; - } - case 15: { - message.unverifiedLazy = reader.bool(); - break; - } - case 3: { - message.deprecated = reader.bool(); - break; - } - case 10: { - message.weak = reader.bool(); - break; - } - case 16: { - message.debugRedact = reader.bool(); - break; - } - case 17: { - message.retention = reader.int32(); - break; - } - case 19: { - if (!(message.targets && message.targets.length)) - message.targets = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.targets.push(reader.int32()); - } else - message.targets.push(reader.int32()); - break; - } - case 20: { - if (!(message.editionDefaults && message.editionDefaults.length)) - message.editionDefaults = []; - message.editionDefaults.push($root.google.protobuf.FieldOptions.EditionDefault.decode(reader, reader.uint32())); - break; - } - case 21: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 1052: { - if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) - message[".google.api.fieldBehavior"] = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message[".google.api.fieldBehavior"].push(reader.int32()); - } else - message[".google.api.fieldBehavior"].push(reader.int32()); - break; - } - case 1055: { - message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FieldOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FieldOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldOptions} FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FieldOptions message. - * @function verify - * @memberof google.protobuf.FieldOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FieldOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.ctype != null && message.hasOwnProperty("ctype")) - switch (message.ctype) { - default: - return "ctype: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.packed != null && message.hasOwnProperty("packed")) - if (typeof message.packed !== "boolean") - return "packed: boolean expected"; - if (message.jstype != null && message.hasOwnProperty("jstype")) - switch (message.jstype) { - default: - return "jstype: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.lazy != null && message.hasOwnProperty("lazy")) - if (typeof message.lazy !== "boolean") - return "lazy: boolean expected"; - if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) - if (typeof message.unverifiedLazy !== "boolean") - return "unverifiedLazy: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.weak != null && message.hasOwnProperty("weak")) - if (typeof message.weak !== "boolean") - return "weak: boolean expected"; - if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) - if (typeof message.debugRedact !== "boolean") - return "debugRedact: boolean expected"; - if (message.retention != null && message.hasOwnProperty("retention")) - switch (message.retention) { - default: - return "retention: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.targets != null && message.hasOwnProperty("targets")) { - if (!Array.isArray(message.targets)) - return "targets: array expected"; - for (var i = 0; i < message.targets.length; ++i) - switch (message.targets[i]) { - default: - return "targets: enum value[] expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - break; - } - } - if (message.editionDefaults != null && message.hasOwnProperty("editionDefaults")) { - if (!Array.isArray(message.editionDefaults)) - return "editionDefaults: array expected"; - for (var i = 0; i < message.editionDefaults.length; ++i) { - var error = $root.google.protobuf.FieldOptions.EditionDefault.verify(message.editionDefaults[i]); - if (error) - return "editionDefaults." + error; - } - } - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".google.api.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) { - if (!Array.isArray(message[".google.api.fieldBehavior"])) - return ".google.api.fieldBehavior: array expected"; - for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) - switch (message[".google.api.fieldBehavior"][i]) { - default: - return ".google.api.fieldBehavior: enum value[] expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - break; - } - } - if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) { - var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"]); - if (error) - return ".google.api.resourceReference." + error; - } - return null; - }; - - /** - * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FieldOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FieldOptions} FieldOptions - */ - FieldOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldOptions) - return object; - var message = new $root.google.protobuf.FieldOptions(); - switch (object.ctype) { - default: - if (typeof object.ctype === "number") { - message.ctype = object.ctype; - break; - } - break; - case "STRING": - case 0: - message.ctype = 0; - break; - case "CORD": - case 1: - message.ctype = 1; - break; - case "STRING_PIECE": - case 2: - message.ctype = 2; - break; - } - if (object.packed != null) - message.packed = Boolean(object.packed); - switch (object.jstype) { - default: - if (typeof object.jstype === "number") { - message.jstype = object.jstype; - break; - } - break; - case "JS_NORMAL": - case 0: - message.jstype = 0; - break; - case "JS_STRING": - case 1: - message.jstype = 1; - break; - case "JS_NUMBER": - case 2: - message.jstype = 2; - break; - } - if (object.lazy != null) - message.lazy = Boolean(object.lazy); - if (object.unverifiedLazy != null) - message.unverifiedLazy = Boolean(object.unverifiedLazy); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.weak != null) - message.weak = Boolean(object.weak); - if (object.debugRedact != null) - message.debugRedact = Boolean(object.debugRedact); - switch (object.retention) { - default: - if (typeof object.retention === "number") { - message.retention = object.retention; - break; - } - break; - case "RETENTION_UNKNOWN": - case 0: - message.retention = 0; - break; - case "RETENTION_RUNTIME": - case 1: - message.retention = 1; - break; - case "RETENTION_SOURCE": - case 2: - message.retention = 2; - break; - } - if (object.targets) { - if (!Array.isArray(object.targets)) - throw TypeError(".google.protobuf.FieldOptions.targets: array expected"); - message.targets = []; - for (var i = 0; i < object.targets.length; ++i) - switch (object.targets[i]) { - default: - if (typeof object.targets[i] === "number") { - message.targets[i] = object.targets[i]; - break; - } - case "TARGET_TYPE_UNKNOWN": - case 0: - message.targets[i] = 0; - break; - case "TARGET_TYPE_FILE": - case 1: - message.targets[i] = 1; - break; - case "TARGET_TYPE_EXTENSION_RANGE": - case 2: - message.targets[i] = 2; - break; - case "TARGET_TYPE_MESSAGE": - case 3: - message.targets[i] = 3; - break; - case "TARGET_TYPE_FIELD": - case 4: - message.targets[i] = 4; - break; - case "TARGET_TYPE_ONEOF": - case 5: - message.targets[i] = 5; - break; - case "TARGET_TYPE_ENUM": - case 6: - message.targets[i] = 6; - break; - case "TARGET_TYPE_ENUM_ENTRY": - case 7: - message.targets[i] = 7; - break; - case "TARGET_TYPE_SERVICE": - case 8: - message.targets[i] = 8; - break; - case "TARGET_TYPE_METHOD": - case 9: - message.targets[i] = 9; - break; - } - } - if (object.editionDefaults) { - if (!Array.isArray(object.editionDefaults)) - throw TypeError(".google.protobuf.FieldOptions.editionDefaults: array expected"); - message.editionDefaults = []; - for (var i = 0; i < object.editionDefaults.length; ++i) { - if (typeof object.editionDefaults[i] !== "object") - throw TypeError(".google.protobuf.FieldOptions.editionDefaults: object expected"); - message.editionDefaults[i] = $root.google.protobuf.FieldOptions.EditionDefault.fromObject(object.editionDefaults[i]); - } - } - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.FieldOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".google.api.fieldBehavior"]) { - if (!Array.isArray(object[".google.api.fieldBehavior"])) - throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected"); - message[".google.api.fieldBehavior"] = []; - for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i) - switch (object[".google.api.fieldBehavior"][i]) { - default: - if (typeof object[".google.api.fieldBehavior"][i] === "number") { - message[".google.api.fieldBehavior"][i] = object[".google.api.fieldBehavior"][i]; - break; - } - case "FIELD_BEHAVIOR_UNSPECIFIED": - case 0: - message[".google.api.fieldBehavior"][i] = 0; - break; - case "OPTIONAL": - case 1: - message[".google.api.fieldBehavior"][i] = 1; - break; - case "REQUIRED": - case 2: - message[".google.api.fieldBehavior"][i] = 2; - break; - case "OUTPUT_ONLY": - case 3: - message[".google.api.fieldBehavior"][i] = 3; - break; - case "INPUT_ONLY": - case 4: - message[".google.api.fieldBehavior"][i] = 4; - break; - case "IMMUTABLE": - case 5: - message[".google.api.fieldBehavior"][i] = 5; - break; - case "UNORDERED_LIST": - case 6: - message[".google.api.fieldBehavior"][i] = 6; - break; - case "NON_EMPTY_DEFAULT": - case 7: - message[".google.api.fieldBehavior"][i] = 7; - break; - case "IDENTIFIER": - case 8: - message[".google.api.fieldBehavior"][i] = 8; - break; - } - } - if (object[".google.api.resourceReference"] != null) { - if (typeof object[".google.api.resourceReference"] !== "object") - throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected"); - message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"]); - } - return message; - }; - - /** - * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.FieldOptions} message FieldOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FieldOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.targets = []; - object.editionDefaults = []; - object.uninterpretedOption = []; - object[".google.api.fieldBehavior"] = []; - } - if (options.defaults) { - object.ctype = options.enums === String ? "STRING" : 0; - object.packed = false; - object.deprecated = false; - object.lazy = false; - object.jstype = options.enums === String ? "JS_NORMAL" : 0; - object.weak = false; - object.unverifiedLazy = false; - object.debugRedact = false; - object.retention = options.enums === String ? "RETENTION_UNKNOWN" : 0; - object.features = null; - object[".google.api.resourceReference"] = null; - } - if (message.ctype != null && message.hasOwnProperty("ctype")) - object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] === undefined ? message.ctype : $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; - if (message.packed != null && message.hasOwnProperty("packed")) - object.packed = message.packed; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.lazy != null && message.hasOwnProperty("lazy")) - object.lazy = message.lazy; - if (message.jstype != null && message.hasOwnProperty("jstype")) - object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] === undefined ? message.jstype : $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; - if (message.weak != null && message.hasOwnProperty("weak")) - object.weak = message.weak; - if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) - object.unverifiedLazy = message.unverifiedLazy; - if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) - object.debugRedact = message.debugRedact; - if (message.retention != null && message.hasOwnProperty("retention")) - object.retention = options.enums === String ? $root.google.protobuf.FieldOptions.OptionRetention[message.retention] === undefined ? message.retention : $root.google.protobuf.FieldOptions.OptionRetention[message.retention] : message.retention; - if (message.targets && message.targets.length) { - object.targets = []; - for (var j = 0; j < message.targets.length; ++j) - object.targets[j] = options.enums === String ? $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] === undefined ? message.targets[j] : $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] : message.targets[j]; - } - if (message.editionDefaults && message.editionDefaults.length) { - object.editionDefaults = []; - for (var j = 0; j < message.editionDefaults.length; ++j) - object.editionDefaults[j] = $root.google.protobuf.FieldOptions.EditionDefault.toObject(message.editionDefaults[j], options); - } - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length) { - object[".google.api.fieldBehavior"] = []; - for (var j = 0; j < message[".google.api.fieldBehavior"].length; ++j) - object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] === undefined ? message[".google.api.fieldBehavior"][j] : $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; - } - if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) - object[".google.api.resourceReference"] = $root.google.api.ResourceReference.toObject(message[".google.api.resourceReference"], options); - return object; - }; - - /** - * Converts this FieldOptions to JSON. - * @function toJSON - * @memberof google.protobuf.FieldOptions - * @instance - * @returns {Object.} JSON object - */ - FieldOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FieldOptions - * @function getTypeUrl - * @memberof google.protobuf.FieldOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FieldOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FieldOptions"; - }; - - /** - * CType enum. - * @name google.protobuf.FieldOptions.CType - * @enum {number} - * @property {number} STRING=0 STRING value - * @property {number} CORD=1 CORD value - * @property {number} STRING_PIECE=2 STRING_PIECE value - */ - FieldOptions.CType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STRING"] = 0; - values[valuesById[1] = "CORD"] = 1; - values[valuesById[2] = "STRING_PIECE"] = 2; - return values; - })(); - - /** - * JSType enum. - * @name google.protobuf.FieldOptions.JSType - * @enum {number} - * @property {number} JS_NORMAL=0 JS_NORMAL value - * @property {number} JS_STRING=1 JS_STRING value - * @property {number} JS_NUMBER=2 JS_NUMBER value - */ - FieldOptions.JSType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "JS_NORMAL"] = 0; - values[valuesById[1] = "JS_STRING"] = 1; - values[valuesById[2] = "JS_NUMBER"] = 2; - return values; - })(); - - /** - * OptionRetention enum. - * @name google.protobuf.FieldOptions.OptionRetention - * @enum {number} - * @property {number} RETENTION_UNKNOWN=0 RETENTION_UNKNOWN value - * @property {number} RETENTION_RUNTIME=1 RETENTION_RUNTIME value - * @property {number} RETENTION_SOURCE=2 RETENTION_SOURCE value - */ - FieldOptions.OptionRetention = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "RETENTION_UNKNOWN"] = 0; - values[valuesById[1] = "RETENTION_RUNTIME"] = 1; - values[valuesById[2] = "RETENTION_SOURCE"] = 2; - return values; - })(); - - /** - * OptionTargetType enum. - * @name google.protobuf.FieldOptions.OptionTargetType - * @enum {number} - * @property {number} TARGET_TYPE_UNKNOWN=0 TARGET_TYPE_UNKNOWN value - * @property {number} TARGET_TYPE_FILE=1 TARGET_TYPE_FILE value - * @property {number} TARGET_TYPE_EXTENSION_RANGE=2 TARGET_TYPE_EXTENSION_RANGE value - * @property {number} TARGET_TYPE_MESSAGE=3 TARGET_TYPE_MESSAGE value - * @property {number} TARGET_TYPE_FIELD=4 TARGET_TYPE_FIELD value - * @property {number} TARGET_TYPE_ONEOF=5 TARGET_TYPE_ONEOF value - * @property {number} TARGET_TYPE_ENUM=6 TARGET_TYPE_ENUM value - * @property {number} TARGET_TYPE_ENUM_ENTRY=7 TARGET_TYPE_ENUM_ENTRY value - * @property {number} TARGET_TYPE_SERVICE=8 TARGET_TYPE_SERVICE value - * @property {number} TARGET_TYPE_METHOD=9 TARGET_TYPE_METHOD value - */ - FieldOptions.OptionTargetType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TARGET_TYPE_UNKNOWN"] = 0; - values[valuesById[1] = "TARGET_TYPE_FILE"] = 1; - values[valuesById[2] = "TARGET_TYPE_EXTENSION_RANGE"] = 2; - values[valuesById[3] = "TARGET_TYPE_MESSAGE"] = 3; - values[valuesById[4] = "TARGET_TYPE_FIELD"] = 4; - values[valuesById[5] = "TARGET_TYPE_ONEOF"] = 5; - values[valuesById[6] = "TARGET_TYPE_ENUM"] = 6; - values[valuesById[7] = "TARGET_TYPE_ENUM_ENTRY"] = 7; - values[valuesById[8] = "TARGET_TYPE_SERVICE"] = 8; - values[valuesById[9] = "TARGET_TYPE_METHOD"] = 9; - return values; - })(); - - FieldOptions.EditionDefault = (function() { - - /** - * Properties of an EditionDefault. - * @memberof google.protobuf.FieldOptions - * @interface IEditionDefault - * @property {google.protobuf.Edition|null} [edition] EditionDefault edition - * @property {string|null} [value] EditionDefault value - */ - - /** - * Constructs a new EditionDefault. - * @memberof google.protobuf.FieldOptions - * @classdesc Represents an EditionDefault. - * @implements IEditionDefault - * @constructor - * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set - */ - function EditionDefault(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EditionDefault edition. - * @member {google.protobuf.Edition} edition - * @memberof google.protobuf.FieldOptions.EditionDefault - * @instance - */ - EditionDefault.prototype.edition = 0; - - /** - * EditionDefault value. - * @member {string} value - * @memberof google.protobuf.FieldOptions.EditionDefault - * @instance - */ - EditionDefault.prototype.value = ""; - - /** - * Creates a new EditionDefault instance using the specified properties. - * @function create - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set - * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault instance - */ - EditionDefault.create = function create(properties) { - return new EditionDefault(properties); - }; - - /** - * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EditionDefault.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); - if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); - return writer; - }; - - /** - * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EditionDefault.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EditionDefault message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EditionDefault.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions.EditionDefault(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 3: { - message.edition = reader.int32(); - break; - } - case 2: { - message.value = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EditionDefault message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EditionDefault.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EditionDefault message. - * @function verify - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EditionDefault.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.edition != null && message.hasOwnProperty("edition")) - switch (message.edition) { - default: - return "edition: enum value expected"; - case 0: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isString(message.value)) - return "value: string expected"; - return null; - }; - - /** - * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault - */ - EditionDefault.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldOptions.EditionDefault) - return object; - var message = new $root.google.protobuf.FieldOptions.EditionDefault(); - switch (object.edition) { - default: - if (typeof object.edition === "number") { - message.edition = object.edition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.edition = 0; - break; - case "EDITION_PROTO2": - case 998: - message.edition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.edition = 999; - break; - case "EDITION_2023": - case 1000: - message.edition = 1000; - break; - case "EDITION_2024": - case 1001: - message.edition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.edition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.edition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.edition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.edition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.edition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.edition = 2147483647; - break; - } - if (object.value != null) - message.value = String(object.value); - return message; - }; - - /** - * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {google.protobuf.FieldOptions.EditionDefault} message EditionDefault - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EditionDefault.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.value = ""; - object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; - } - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - if (message.edition != null && message.hasOwnProperty("edition")) - object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; - return object; - }; - - /** - * Converts this EditionDefault to JSON. - * @function toJSON - * @memberof google.protobuf.FieldOptions.EditionDefault - * @instance - * @returns {Object.} JSON object - */ - EditionDefault.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EditionDefault - * @function getTypeUrl - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FieldOptions.EditionDefault"; - }; - - return EditionDefault; - })(); - - return FieldOptions; - })(); - - protobuf.OneofOptions = (function() { - - /** - * Properties of an OneofOptions. - * @memberof google.protobuf - * @interface IOneofOptions - * @property {google.protobuf.IFeatureSet|null} [features] OneofOptions features - * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption - */ - - /** - * Constructs a new OneofOptions. - * @memberof google.protobuf - * @classdesc Represents an OneofOptions. - * @implements IOneofOptions - * @constructor - * @param {google.protobuf.IOneofOptions=} [properties] Properties to set - */ - function OneofOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * OneofOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.OneofOptions - * @instance - */ - OneofOptions.prototype.features = null; - - /** - * OneofOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.OneofOptions - * @instance - */ - OneofOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * Creates a new OneofOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.IOneofOptions=} [properties] Properties to set - * @returns {google.protobuf.OneofOptions} OneofOptions instance - */ - OneofOptions.create = function create(properties) { - return new OneofOptions(properties); - }; - - /** - * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OneofOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.OneofOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.OneofOptions} OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OneofOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.OneofOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.OneofOptions} OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OneofOptions message. - * @function verify - * @memberof google.protobuf.OneofOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OneofOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - return null; - }; - - /** - * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.OneofOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.OneofOptions} OneofOptions - */ - OneofOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.OneofOptions) - return object; - var message = new $root.google.protobuf.OneofOptions(); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.OneofOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.OneofOptions} message OneofOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OneofOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) - object.features = null; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; - - /** - * Converts this OneofOptions to JSON. - * @function toJSON - * @memberof google.protobuf.OneofOptions - * @instance - * @returns {Object.} JSON object - */ - OneofOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OneofOptions - * @function getTypeUrl - * @memberof google.protobuf.OneofOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OneofOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.OneofOptions"; - }; - - return OneofOptions; - })(); - - protobuf.EnumOptions = (function() { - - /** - * Properties of an EnumOptions. - * @memberof google.protobuf - * @interface IEnumOptions - * @property {boolean|null} [allowAlias] EnumOptions allowAlias - * @property {boolean|null} [deprecated] EnumOptions deprecated - * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] EnumOptions deprecatedLegacyJsonFieldConflicts - * @property {google.protobuf.IFeatureSet|null} [features] EnumOptions features - * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption - */ - - /** - * Constructs a new EnumOptions. - * @memberof google.protobuf - * @classdesc Represents an EnumOptions. - * @implements IEnumOptions - * @constructor - * @param {google.protobuf.IEnumOptions=} [properties] Properties to set - */ - function EnumOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumOptions allowAlias. - * @member {boolean} allowAlias - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.allowAlias = false; - - /** - * EnumOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.deprecated = false; - - /** - * EnumOptions deprecatedLegacyJsonFieldConflicts. - * @member {boolean} deprecatedLegacyJsonFieldConflicts - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; - - /** - * EnumOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.features = null; - - /** - * EnumOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * Creates a new EnumOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.IEnumOptions=} [properties] Properties to set - * @returns {google.protobuf.EnumOptions} EnumOptions instance - */ - EnumOptions.create = function create(properties) { - return new EnumOptions(properties); - }; - - /** - * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.deprecatedLegacyJsonFieldConflicts); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumOptions} EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - message.allowAlias = reader.bool(); - break; - } - case 3: { - message.deprecated = reader.bool(); - break; - } - case 6: { - message.deprecatedLegacyJsonFieldConflicts = reader.bool(); - break; - } - case 7: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumOptions} EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumOptions message. - * @function verify - * @memberof google.protobuf.EnumOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) - if (typeof message.allowAlias !== "boolean") - return "allowAlias: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) - if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") - return "deprecatedLegacyJsonFieldConflicts: boolean expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - return null; - }; - - /** - * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumOptions} EnumOptions - */ - EnumOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumOptions) - return object; - var message = new $root.google.protobuf.EnumOptions(); - if (object.allowAlias != null) - message.allowAlias = Boolean(object.allowAlias); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.deprecatedLegacyJsonFieldConflicts != null) - message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.EnumOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.EnumOptions} message EnumOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) { - object.allowAlias = false; - object.deprecated = false; - object.deprecatedLegacyJsonFieldConflicts = false; - object.features = null; - } - if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) - object.allowAlias = message.allowAlias; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) - object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; - - /** - * Converts this EnumOptions to JSON. - * @function toJSON - * @memberof google.protobuf.EnumOptions - * @instance - * @returns {Object.} JSON object - */ - EnumOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumOptions - * @function getTypeUrl - * @memberof google.protobuf.EnumOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumOptions"; - }; - - return EnumOptions; - })(); - - protobuf.EnumValueOptions = (function() { - - /** - * Properties of an EnumValueOptions. - * @memberof google.protobuf - * @interface IEnumValueOptions - * @property {boolean|null} [deprecated] EnumValueOptions deprecated - * @property {google.protobuf.IFeatureSet|null} [features] EnumValueOptions features - * @property {boolean|null} [debugRedact] EnumValueOptions debugRedact - * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption - */ - - /** - * Constructs a new EnumValueOptions. - * @memberof google.protobuf - * @classdesc Represents an EnumValueOptions. - * @implements IEnumValueOptions - * @constructor - * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set - */ - function EnumValueOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumValueOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.deprecated = false; - - /** - * EnumValueOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.features = null; - - /** - * EnumValueOptions debugRedact. - * @member {boolean} debugRedact - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.debugRedact = false; - - /** - * EnumValueOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * Creates a new EnumValueOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance - */ - EnumValueOptions.create = function create(properties) { - return new EnumValueOptions(properties); - }; - - /** - * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.debugRedact); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumValueOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.deprecated = reader.bool(); - break; - } - case 2: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 3: { - message.debugRedact = reader.bool(); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumValueOptions message. - * @function verify - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumValueOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) - if (typeof message.debugRedact !== "boolean") - return "debugRedact: boolean expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - return null; - }; - - /** - * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions - */ - EnumValueOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumValueOptions) - return object; - var message = new $root.google.protobuf.EnumValueOptions(); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.EnumValueOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.debugRedact != null) - message.debugRedact = Boolean(object.debugRedact); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.EnumValueOptions} message EnumValueOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumValueOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) { - object.deprecated = false; - object.features = null; - object.debugRedact = false; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) - object.debugRedact = message.debugRedact; - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; - - /** - * Converts this EnumValueOptions to JSON. - * @function toJSON - * @memberof google.protobuf.EnumValueOptions - * @instance - * @returns {Object.} JSON object - */ - EnumValueOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumValueOptions - * @function getTypeUrl - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumValueOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumValueOptions"; - }; - - return EnumValueOptions; - })(); - - protobuf.ServiceOptions = (function() { - - /** - * Properties of a ServiceOptions. - * @memberof google.protobuf - * @interface IServiceOptions - * @property {google.protobuf.IFeatureSet|null} [features] ServiceOptions features - * @property {boolean|null} [deprecated] ServiceOptions deprecated - * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption - * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost - * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes - * @property {string|null} [".google.api.apiVersion"] ServiceOptions .google.api.apiVersion - */ - - /** - * Constructs a new ServiceOptions. - * @memberof google.protobuf - * @classdesc Represents a ServiceOptions. - * @implements IServiceOptions - * @constructor - * @param {google.protobuf.IServiceOptions=} [properties] Properties to set - */ - function ServiceOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ServiceOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype.features = null; - - /** - * ServiceOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype.deprecated = false; - - /** - * ServiceOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * ServiceOptions .google.api.defaultHost. - * @member {string} .google.api.defaultHost - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype[".google.api.defaultHost"] = ""; - - /** - * ServiceOptions .google.api.oauthScopes. - * @member {string} .google.api.oauthScopes - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype[".google.api.oauthScopes"] = ""; - - /** - * ServiceOptions .google.api.apiVersion. - * @member {string} .google.api.apiVersion - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype[".google.api.apiVersion"] = ""; - - /** - * Creates a new ServiceOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.IServiceOptions=} [properties] Properties to set - * @returns {google.protobuf.ServiceOptions} ServiceOptions instance - */ - ServiceOptions.create = function create(properties) { - return new ServiceOptions(properties); - }; - - /** - * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 34, wireType 2 =*/274).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) - writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); - if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) - writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); - if (message[".google.api.apiVersion"] != null && Object.hasOwnProperty.call(message, ".google.api.apiVersion")) - writer.uint32(/* id 525000001, wireType 2 =*/4200000010).string(message[".google.api.apiVersion"]); - return writer; - }; - - /** - * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ServiceOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ServiceOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ServiceOptions} ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 34: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 33: { - message.deprecated = reader.bool(); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 1049: { - message[".google.api.defaultHost"] = reader.string(); - break; - } - case 1050: { - message[".google.api.oauthScopes"] = reader.string(); - break; - } - case 525000001: { - message[".google.api.apiVersion"] = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ServiceOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ServiceOptions} ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ServiceOptions message. - * @function verify - * @memberof google.protobuf.ServiceOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ServiceOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) - if (!$util.isString(message[".google.api.defaultHost"])) - return ".google.api.defaultHost: string expected"; - if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) - if (!$util.isString(message[".google.api.oauthScopes"])) - return ".google.api.oauthScopes: string expected"; - if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) - if (!$util.isString(message[".google.api.apiVersion"])) - return ".google.api.apiVersion: string expected"; - return null; - }; - - /** - * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ServiceOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ServiceOptions} ServiceOptions - */ - ServiceOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ServiceOptions) - return object; - var message = new $root.google.protobuf.ServiceOptions(); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.ServiceOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".google.api.defaultHost"] != null) - message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); - if (object[".google.api.oauthScopes"] != null) - message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); - if (object[".google.api.apiVersion"] != null) - message[".google.api.apiVersion"] = String(object[".google.api.apiVersion"]); - return message; - }; - - /** - * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.ServiceOptions} message ServiceOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ServiceOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) { - object.deprecated = false; - object.features = null; - object[".google.api.defaultHost"] = ""; - object[".google.api.oauthScopes"] = ""; - object[".google.api.apiVersion"] = ""; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) - object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; - if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) - object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; - if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) - object[".google.api.apiVersion"] = message[".google.api.apiVersion"]; - return object; - }; - - /** - * Converts this ServiceOptions to JSON. - * @function toJSON - * @memberof google.protobuf.ServiceOptions - * @instance - * @returns {Object.} JSON object - */ - ServiceOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ServiceOptions - * @function getTypeUrl - * @memberof google.protobuf.ServiceOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.ServiceOptions"; - }; - - return ServiceOptions; - })(); - - protobuf.MethodOptions = (function() { - - /** - * Properties of a MethodOptions. - * @memberof google.protobuf - * @interface IMethodOptions - * @property {boolean|null} [deprecated] MethodOptions deprecated - * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel - * @property {google.protobuf.IFeatureSet|null} [features] MethodOptions features - * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption - * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http - * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature - * @property {google.longrunning.IOperationInfo|null} [".google.longrunning.operationInfo"] MethodOptions .google.longrunning.operationInfo - */ - - /** - * Constructs a new MethodOptions. - * @memberof google.protobuf - * @classdesc Represents a MethodOptions. - * @implements IMethodOptions - * @constructor - * @param {google.protobuf.IMethodOptions=} [properties] Properties to set - */ - function MethodOptions(properties) { - this.uninterpretedOption = []; - this[".google.api.methodSignature"] = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MethodOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype.deprecated = false; - - /** - * MethodOptions idempotencyLevel. - * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype.idempotencyLevel = 0; - - /** - * MethodOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype.features = null; - - /** - * MethodOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * MethodOptions .google.api.http. - * @member {google.api.IHttpRule|null|undefined} .google.api.http - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype[".google.api.http"] = null; - - /** - * MethodOptions .google.api.methodSignature. - * @member {Array.} .google.api.methodSignature - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; - - /** - * MethodOptions .google.longrunning.operationInfo. - * @member {google.longrunning.IOperationInfo|null|undefined} .google.longrunning.operationInfo - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype[".google.longrunning.operationInfo"] = null; - - /** - * Creates a new MethodOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.MethodOptions - * @static - * @param {google.protobuf.IMethodOptions=} [properties] Properties to set - * @returns {google.protobuf.MethodOptions} MethodOptions instance - */ - MethodOptions.create = function create(properties) { - return new MethodOptions(properties); - }; - - /** - * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.MethodOptions - * @static - * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); - if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel")) - writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 35, wireType 2 =*/282).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.longrunning.operationInfo"] != null && Object.hasOwnProperty.call(message, ".google.longrunning.operationInfo")) - $root.google.longrunning.OperationInfo.encode(message[".google.longrunning.operationInfo"], writer.uint32(/* id 1049, wireType 2 =*/8394).fork()).ldelim(); - if (message[".google.api.methodSignature"] != null && message[".google.api.methodSignature"].length) - for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) - writer.uint32(/* id 1051, wireType 2 =*/8410).string(message[".google.api.methodSignature"][i]); - if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http")) - $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.MethodOptions - * @static - * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MethodOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.MethodOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.MethodOptions} MethodOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 33: { - message.deprecated = reader.bool(); - break; - } - case 34: { - message.idempotencyLevel = reader.int32(); - break; - } - case 35: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 72295728: { - message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); - break; - } - case 1051: { - if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) - message[".google.api.methodSignature"] = []; - message[".google.api.methodSignature"].push(reader.string()); - break; - } - case 1049: { - message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MethodOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.MethodOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.MethodOptions} MethodOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MethodOptions message. - * @function verify - * @memberof google.protobuf.MethodOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MethodOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) - switch (message.idempotencyLevel) { - default: - return "idempotencyLevel: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) { - var error = $root.google.api.HttpRule.verify(message[".google.api.http"]); - if (error) - return ".google.api.http." + error; - } - if (message[".google.api.methodSignature"] != null && message.hasOwnProperty(".google.api.methodSignature")) { - if (!Array.isArray(message[".google.api.methodSignature"])) - return ".google.api.methodSignature: array expected"; - for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) - if (!$util.isString(message[".google.api.methodSignature"][i])) - return ".google.api.methodSignature: string[] expected"; - } - if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) { - var error = $root.google.longrunning.OperationInfo.verify(message[".google.longrunning.operationInfo"]); - if (error) - return ".google.longrunning.operationInfo." + error; - } - return null; - }; - - /** - * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.MethodOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.MethodOptions} MethodOptions - */ - MethodOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.MethodOptions) - return object; - var message = new $root.google.protobuf.MethodOptions(); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - switch (object.idempotencyLevel) { - default: - if (typeof object.idempotencyLevel === "number") { - message.idempotencyLevel = object.idempotencyLevel; - break; - } - break; - case "IDEMPOTENCY_UNKNOWN": - case 0: - message.idempotencyLevel = 0; - break; - case "NO_SIDE_EFFECTS": - case 1: - message.idempotencyLevel = 1; - break; - case "IDEMPOTENT": - case 2: - message.idempotencyLevel = 2; - break; - } - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.MethodOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".google.api.http"] != null) { - if (typeof object[".google.api.http"] !== "object") - throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected"); - message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"]); - } - if (object[".google.api.methodSignature"]) { - if (!Array.isArray(object[".google.api.methodSignature"])) - throw TypeError(".google.protobuf.MethodOptions..google.api.methodSignature: array expected"); - message[".google.api.methodSignature"] = []; - for (var i = 0; i < object[".google.api.methodSignature"].length; ++i) - message[".google.api.methodSignature"][i] = String(object[".google.api.methodSignature"][i]); - } - if (object[".google.longrunning.operationInfo"] != null) { - if (typeof object[".google.longrunning.operationInfo"] !== "object") - throw TypeError(".google.protobuf.MethodOptions..google.longrunning.operationInfo: object expected"); - message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.fromObject(object[".google.longrunning.operationInfo"]); - } - return message; - }; - - /** - * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.MethodOptions - * @static - * @param {google.protobuf.MethodOptions} message MethodOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MethodOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.uninterpretedOption = []; - object[".google.api.methodSignature"] = []; - } - if (options.defaults) { - object.deprecated = false; - object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0; - object.features = null; - object[".google.longrunning.operationInfo"] = null; - object[".google.api.http"] = null; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) - object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] === undefined ? message.idempotencyLevel : $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) - object[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.toObject(message[".google.longrunning.operationInfo"], options); - if (message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length) { - object[".google.api.methodSignature"] = []; - for (var j = 0; j < message[".google.api.methodSignature"].length; ++j) - object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j]; - } - if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) - object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); - return object; - }; - - /** - * Converts this MethodOptions to JSON. - * @function toJSON - * @memberof google.protobuf.MethodOptions - * @instance - * @returns {Object.} JSON object - */ - MethodOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MethodOptions - * @function getTypeUrl - * @memberof google.protobuf.MethodOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MethodOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.MethodOptions"; - }; - - /** - * IdempotencyLevel enum. - * @name google.protobuf.MethodOptions.IdempotencyLevel - * @enum {number} - * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value - * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value - * @property {number} IDEMPOTENT=2 IDEMPOTENT value - */ - MethodOptions.IdempotencyLevel = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0; - values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1; - values[valuesById[2] = "IDEMPOTENT"] = 2; - return values; - })(); - - return MethodOptions; - })(); - - protobuf.UninterpretedOption = (function() { - - /** - * Properties of an UninterpretedOption. - * @memberof google.protobuf - * @interface IUninterpretedOption - * @property {Array.|null} [name] UninterpretedOption name - * @property {string|null} [identifierValue] UninterpretedOption identifierValue - * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue - * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue - * @property {number|null} [doubleValue] UninterpretedOption doubleValue - * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue - * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue - */ - - /** - * Constructs a new UninterpretedOption. - * @memberof google.protobuf - * @classdesc Represents an UninterpretedOption. - * @implements IUninterpretedOption - * @constructor - * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set - */ - function UninterpretedOption(properties) { - this.name = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UninterpretedOption name. - * @member {Array.} name - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.name = $util.emptyArray; - - /** - * UninterpretedOption identifierValue. - * @member {string} identifierValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.identifierValue = ""; - - /** - * UninterpretedOption positiveIntValue. - * @member {number|Long} positiveIntValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * UninterpretedOption negativeIntValue. - * @member {number|Long} negativeIntValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * UninterpretedOption doubleValue. - * @member {number} doubleValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.doubleValue = 0; - - /** - * UninterpretedOption stringValue. - * @member {Uint8Array} stringValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.stringValue = $util.newBuffer([]); - - /** - * UninterpretedOption aggregateValue. - * @member {string} aggregateValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.aggregateValue = ""; - - /** - * Creates a new UninterpretedOption instance using the specified properties. - * @function create - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance - */ - UninterpretedOption.create = function create(properties) { - return new UninterpretedOption(properties); - }; - - /** - * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @function encode - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UninterpretedOption.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && message.name.length) - for (var i = 0; i < message.name.length; ++i) - $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); - if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) - writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); - if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) - writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); - if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) - writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); - if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) - writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); - if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); - return writer; - }; - - /** - * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UninterpretedOption.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - if (!(message.name && message.name.length)) - message.name = []; - message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); - break; - } - case 3: { - message.identifierValue = reader.string(); - break; - } - case 4: { - message.positiveIntValue = reader.uint64(); - break; - } - case 5: { - message.negativeIntValue = reader.int64(); - break; - } - case 6: { - message.doubleValue = reader.double(); - break; - } - case 7: { - message.stringValue = reader.bytes(); - break; - } - case 8: { - message.aggregateValue = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UninterpretedOption message. - * @function verify - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UninterpretedOption.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) { - if (!Array.isArray(message.name)) - return "name: array expected"; - for (var i = 0; i < message.name.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]); - if (error) - return "name." + error; - } - } - if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) - if (!$util.isString(message.identifierValue)) - return "identifierValue: string expected"; - if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) - if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high))) - return "positiveIntValue: integer|Long expected"; - if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) - if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high))) - return "negativeIntValue: integer|Long expected"; - if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) - if (typeof message.doubleValue !== "number") - return "doubleValue: number expected"; - if (message.stringValue != null && message.hasOwnProperty("stringValue")) - if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue))) - return "stringValue: buffer expected"; - if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) - if (!$util.isString(message.aggregateValue)) - return "aggregateValue: string expected"; - return null; - }; - - /** - * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption - */ - UninterpretedOption.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.UninterpretedOption) - return object; - var message = new $root.google.protobuf.UninterpretedOption(); - if (object.name) { - if (!Array.isArray(object.name)) - throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); - message.name = []; - for (var i = 0; i < object.name.length; ++i) { - if (typeof object.name[i] !== "object") - throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); - message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); - } - } - if (object.identifierValue != null) - message.identifierValue = String(object.identifierValue); - if (object.positiveIntValue != null) - if ($util.Long) - (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; - else if (typeof object.positiveIntValue === "string") - message.positiveIntValue = parseInt(object.positiveIntValue, 10); - else if (typeof object.positiveIntValue === "number") - message.positiveIntValue = object.positiveIntValue; - else if (typeof object.positiveIntValue === "object") - message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); - if (object.negativeIntValue != null) - if ($util.Long) - (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false; - else if (typeof object.negativeIntValue === "string") - message.negativeIntValue = parseInt(object.negativeIntValue, 10); - else if (typeof object.negativeIntValue === "number") - message.negativeIntValue = object.negativeIntValue; - else if (typeof object.negativeIntValue === "object") - message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); - if (object.doubleValue != null) - message.doubleValue = Number(object.doubleValue); - if (object.stringValue != null) - if (typeof object.stringValue === "string") - $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); - else if (object.stringValue.length >= 0) - message.stringValue = object.stringValue; - if (object.aggregateValue != null) - message.aggregateValue = String(object.aggregateValue); - return message; - }; - - /** - * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.UninterpretedOption} message UninterpretedOption - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UninterpretedOption.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.name = []; - if (options.defaults) { - object.identifierValue = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.positiveIntValue = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.negativeIntValue = options.longs === String ? "0" : 0; - object.doubleValue = 0; - if (options.bytes === String) - object.stringValue = ""; - else { - object.stringValue = []; - if (options.bytes !== Array) - object.stringValue = $util.newBuffer(object.stringValue); - } - object.aggregateValue = ""; - } - if (message.name && message.name.length) { - object.name = []; - for (var j = 0; j < message.name.length; ++j) - object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); - } - if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) - object.identifierValue = message.identifierValue; - if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) - if (typeof message.positiveIntValue === "number") - object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue; - else - object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue; - if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) - if (typeof message.negativeIntValue === "number") - object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue; - else - object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue; - if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) - object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; - if (message.stringValue != null && message.hasOwnProperty("stringValue")) - object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue; - if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) - object.aggregateValue = message.aggregateValue; - return object; - }; - - /** - * Converts this UninterpretedOption to JSON. - * @function toJSON - * @memberof google.protobuf.UninterpretedOption - * @instance - * @returns {Object.} JSON object - */ - UninterpretedOption.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UninterpretedOption - * @function getTypeUrl - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UninterpretedOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.UninterpretedOption"; - }; - - UninterpretedOption.NamePart = (function() { - - /** - * Properties of a NamePart. - * @memberof google.protobuf.UninterpretedOption - * @interface INamePart - * @property {string} namePart NamePart namePart - * @property {boolean} isExtension NamePart isExtension - */ - - /** - * Constructs a new NamePart. - * @memberof google.protobuf.UninterpretedOption - * @classdesc Represents a NamePart. - * @implements INamePart - * @constructor - * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set - */ - function NamePart(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * NamePart namePart. - * @member {string} namePart - * @memberof google.protobuf.UninterpretedOption.NamePart - * @instance - */ - NamePart.prototype.namePart = ""; - - /** - * NamePart isExtension. - * @member {boolean} isExtension - * @memberof google.protobuf.UninterpretedOption.NamePart - * @instance - */ - NamePart.prototype.isExtension = false; - - /** - * Creates a new NamePart instance using the specified properties. - * @function create - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance - */ - NamePart.create = function create(properties) { - return new NamePart(properties); - }; - - /** - * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @function encode - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NamePart.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart); - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension); - return writer; - }; - - /** - * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NamePart.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a NamePart message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NamePart.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.namePart = reader.string(); - break; - } - case 2: { - message.isExtension = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - if (!message.hasOwnProperty("namePart")) - throw $util.ProtocolError("missing required 'namePart'", { instance: message }); - if (!message.hasOwnProperty("isExtension")) - throw $util.ProtocolError("missing required 'isExtension'", { instance: message }); - return message; - }; - - /** - * Decodes a NamePart message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NamePart.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a NamePart message. - * @function verify - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - NamePart.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (!$util.isString(message.namePart)) - return "namePart: string expected"; - if (typeof message.isExtension !== "boolean") - return "isExtension: boolean expected"; - return null; - }; - - /** - * Creates a NamePart message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart - */ - NamePart.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) - return object; - var message = new $root.google.protobuf.UninterpretedOption.NamePart(); - if (object.namePart != null) - message.namePart = String(object.namePart); - if (object.isExtension != null) - message.isExtension = Boolean(object.isExtension); - return message; - }; - - /** - * Creates a plain object from a NamePart message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - NamePart.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.namePart = ""; - object.isExtension = false; - } - if (message.namePart != null && message.hasOwnProperty("namePart")) - object.namePart = message.namePart; - if (message.isExtension != null && message.hasOwnProperty("isExtension")) - object.isExtension = message.isExtension; - return object; - }; - - /** - * Converts this NamePart to JSON. - * @function toJSON - * @memberof google.protobuf.UninterpretedOption.NamePart - * @instance - * @returns {Object.} JSON object - */ - NamePart.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for NamePart - * @function getTypeUrl - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - NamePart.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.UninterpretedOption.NamePart"; - }; - - return NamePart; - })(); - - return UninterpretedOption; - })(); - - protobuf.FeatureSet = (function() { - - /** - * Properties of a FeatureSet. - * @memberof google.protobuf - * @interface IFeatureSet - * @property {google.protobuf.FeatureSet.FieldPresence|null} [fieldPresence] FeatureSet fieldPresence - * @property {google.protobuf.FeatureSet.EnumType|null} [enumType] FeatureSet enumType - * @property {google.protobuf.FeatureSet.RepeatedFieldEncoding|null} [repeatedFieldEncoding] FeatureSet repeatedFieldEncoding - * @property {google.protobuf.FeatureSet.Utf8Validation|null} [utf8Validation] FeatureSet utf8Validation - * @property {google.protobuf.FeatureSet.MessageEncoding|null} [messageEncoding] FeatureSet messageEncoding - * @property {google.protobuf.FeatureSet.JsonFormat|null} [jsonFormat] FeatureSet jsonFormat - */ - - /** - * Constructs a new FeatureSet. - * @memberof google.protobuf - * @classdesc Represents a FeatureSet. - * @implements IFeatureSet - * @constructor - * @param {google.protobuf.IFeatureSet=} [properties] Properties to set - */ - function FeatureSet(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FeatureSet fieldPresence. - * @member {google.protobuf.FeatureSet.FieldPresence} fieldPresence - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.fieldPresence = 0; - - /** - * FeatureSet enumType. - * @member {google.protobuf.FeatureSet.EnumType} enumType - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.enumType = 0; - - /** - * FeatureSet repeatedFieldEncoding. - * @member {google.protobuf.FeatureSet.RepeatedFieldEncoding} repeatedFieldEncoding - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.repeatedFieldEncoding = 0; - - /** - * FeatureSet utf8Validation. - * @member {google.protobuf.FeatureSet.Utf8Validation} utf8Validation - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.utf8Validation = 0; - - /** - * FeatureSet messageEncoding. - * @member {google.protobuf.FeatureSet.MessageEncoding} messageEncoding - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.messageEncoding = 0; - - /** - * FeatureSet jsonFormat. - * @member {google.protobuf.FeatureSet.JsonFormat} jsonFormat - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.jsonFormat = 0; - - /** - * Creates a new FeatureSet instance using the specified properties. - * @function create - * @memberof google.protobuf.FeatureSet - * @static - * @param {google.protobuf.IFeatureSet=} [properties] Properties to set - * @returns {google.protobuf.FeatureSet} FeatureSet instance - */ - FeatureSet.create = function create(properties) { - return new FeatureSet(properties); - }; - - /** - * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FeatureSet - * @static - * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSet.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.fieldPresence != null && Object.hasOwnProperty.call(message, "fieldPresence")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.fieldPresence); - if (message.enumType != null && Object.hasOwnProperty.call(message, "enumType")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.enumType); - if (message.repeatedFieldEncoding != null && Object.hasOwnProperty.call(message, "repeatedFieldEncoding")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.repeatedFieldEncoding); - if (message.utf8Validation != null && Object.hasOwnProperty.call(message, "utf8Validation")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.utf8Validation); - if (message.messageEncoding != null && Object.hasOwnProperty.call(message, "messageEncoding")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.messageEncoding); - if (message.jsonFormat != null && Object.hasOwnProperty.call(message, "jsonFormat")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jsonFormat); - return writer; - }; - - /** - * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FeatureSet - * @static - * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSet.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FeatureSet message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FeatureSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FeatureSet} FeatureSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSet.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSet(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.fieldPresence = reader.int32(); - break; - } - case 2: { - message.enumType = reader.int32(); - break; - } - case 3: { - message.repeatedFieldEncoding = reader.int32(); - break; - } - case 4: { - message.utf8Validation = reader.int32(); - break; - } - case 5: { - message.messageEncoding = reader.int32(); - break; - } - case 6: { - message.jsonFormat = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FeatureSet message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FeatureSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FeatureSet} FeatureSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSet.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FeatureSet message. - * @function verify - * @memberof google.protobuf.FeatureSet - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FeatureSet.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) - switch (message.fieldPresence) { - default: - return "fieldPresence: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.enumType != null && message.hasOwnProperty("enumType")) - switch (message.enumType) { - default: - return "enumType: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) - switch (message.repeatedFieldEncoding) { - default: - return "repeatedFieldEncoding: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) - switch (message.utf8Validation) { - default: - return "utf8Validation: enum value expected"; - case 0: - case 2: - case 3: - break; - } - if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) - switch (message.messageEncoding) { - default: - return "messageEncoding: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) - switch (message.jsonFormat) { - default: - return "jsonFormat: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FeatureSet - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FeatureSet} FeatureSet - */ - FeatureSet.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FeatureSet) - return object; - var message = new $root.google.protobuf.FeatureSet(); - switch (object.fieldPresence) { - default: - if (typeof object.fieldPresence === "number") { - message.fieldPresence = object.fieldPresence; - break; - } - break; - case "FIELD_PRESENCE_UNKNOWN": - case 0: - message.fieldPresence = 0; - break; - case "EXPLICIT": - case 1: - message.fieldPresence = 1; - break; - case "IMPLICIT": - case 2: - message.fieldPresence = 2; - break; - case "LEGACY_REQUIRED": - case 3: - message.fieldPresence = 3; - break; - } - switch (object.enumType) { - default: - if (typeof object.enumType === "number") { - message.enumType = object.enumType; - break; - } - break; - case "ENUM_TYPE_UNKNOWN": - case 0: - message.enumType = 0; - break; - case "OPEN": - case 1: - message.enumType = 1; - break; - case "CLOSED": - case 2: - message.enumType = 2; - break; - } - switch (object.repeatedFieldEncoding) { - default: - if (typeof object.repeatedFieldEncoding === "number") { - message.repeatedFieldEncoding = object.repeatedFieldEncoding; - break; - } - break; - case "REPEATED_FIELD_ENCODING_UNKNOWN": - case 0: - message.repeatedFieldEncoding = 0; - break; - case "PACKED": - case 1: - message.repeatedFieldEncoding = 1; - break; - case "EXPANDED": - case 2: - message.repeatedFieldEncoding = 2; - break; - } - switch (object.utf8Validation) { - default: - if (typeof object.utf8Validation === "number") { - message.utf8Validation = object.utf8Validation; - break; - } - break; - case "UTF8_VALIDATION_UNKNOWN": - case 0: - message.utf8Validation = 0; - break; - case "VERIFY": - case 2: - message.utf8Validation = 2; - break; - case "NONE": - case 3: - message.utf8Validation = 3; - break; - } - switch (object.messageEncoding) { - default: - if (typeof object.messageEncoding === "number") { - message.messageEncoding = object.messageEncoding; - break; - } - break; - case "MESSAGE_ENCODING_UNKNOWN": - case 0: - message.messageEncoding = 0; - break; - case "LENGTH_PREFIXED": - case 1: - message.messageEncoding = 1; - break; - case "DELIMITED": - case 2: - message.messageEncoding = 2; - break; - } - switch (object.jsonFormat) { - default: - if (typeof object.jsonFormat === "number") { - message.jsonFormat = object.jsonFormat; - break; - } - break; - case "JSON_FORMAT_UNKNOWN": - case 0: - message.jsonFormat = 0; - break; - case "ALLOW": - case 1: - message.jsonFormat = 1; - break; - case "LEGACY_BEST_EFFORT": - case 2: - message.jsonFormat = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FeatureSet - * @static - * @param {google.protobuf.FeatureSet} message FeatureSet - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FeatureSet.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.fieldPresence = options.enums === String ? "FIELD_PRESENCE_UNKNOWN" : 0; - object.enumType = options.enums === String ? "ENUM_TYPE_UNKNOWN" : 0; - object.repeatedFieldEncoding = options.enums === String ? "REPEATED_FIELD_ENCODING_UNKNOWN" : 0; - object.utf8Validation = options.enums === String ? "UTF8_VALIDATION_UNKNOWN" : 0; - object.messageEncoding = options.enums === String ? "MESSAGE_ENCODING_UNKNOWN" : 0; - object.jsonFormat = options.enums === String ? "JSON_FORMAT_UNKNOWN" : 0; - } - if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) - object.fieldPresence = options.enums === String ? $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] === undefined ? message.fieldPresence : $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] : message.fieldPresence; - if (message.enumType != null && message.hasOwnProperty("enumType")) - object.enumType = options.enums === String ? $root.google.protobuf.FeatureSet.EnumType[message.enumType] === undefined ? message.enumType : $root.google.protobuf.FeatureSet.EnumType[message.enumType] : message.enumType; - if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) - object.repeatedFieldEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] === undefined ? message.repeatedFieldEncoding : $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] : message.repeatedFieldEncoding; - if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) - object.utf8Validation = options.enums === String ? $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] === undefined ? message.utf8Validation : $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] : message.utf8Validation; - if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) - object.messageEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] === undefined ? message.messageEncoding : $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] : message.messageEncoding; - if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) - object.jsonFormat = options.enums === String ? $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] === undefined ? message.jsonFormat : $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] : message.jsonFormat; - return object; - }; - - /** - * Converts this FeatureSet to JSON. - * @function toJSON - * @memberof google.protobuf.FeatureSet - * @instance - * @returns {Object.} JSON object - */ - FeatureSet.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FeatureSet - * @function getTypeUrl - * @memberof google.protobuf.FeatureSet - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FeatureSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FeatureSet"; - }; - - /** - * FieldPresence enum. - * @name google.protobuf.FeatureSet.FieldPresence - * @enum {number} - * @property {number} FIELD_PRESENCE_UNKNOWN=0 FIELD_PRESENCE_UNKNOWN value - * @property {number} EXPLICIT=1 EXPLICIT value - * @property {number} IMPLICIT=2 IMPLICIT value - * @property {number} LEGACY_REQUIRED=3 LEGACY_REQUIRED value - */ - FeatureSet.FieldPresence = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "FIELD_PRESENCE_UNKNOWN"] = 0; - values[valuesById[1] = "EXPLICIT"] = 1; - values[valuesById[2] = "IMPLICIT"] = 2; - values[valuesById[3] = "LEGACY_REQUIRED"] = 3; - return values; - })(); - - /** - * EnumType enum. - * @name google.protobuf.FeatureSet.EnumType - * @enum {number} - * @property {number} ENUM_TYPE_UNKNOWN=0 ENUM_TYPE_UNKNOWN value - * @property {number} OPEN=1 OPEN value - * @property {number} CLOSED=2 CLOSED value - */ - FeatureSet.EnumType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ENUM_TYPE_UNKNOWN"] = 0; - values[valuesById[1] = "OPEN"] = 1; - values[valuesById[2] = "CLOSED"] = 2; - return values; - })(); - - /** - * RepeatedFieldEncoding enum. - * @name google.protobuf.FeatureSet.RepeatedFieldEncoding - * @enum {number} - * @property {number} REPEATED_FIELD_ENCODING_UNKNOWN=0 REPEATED_FIELD_ENCODING_UNKNOWN value - * @property {number} PACKED=1 PACKED value - * @property {number} EXPANDED=2 EXPANDED value - */ - FeatureSet.RepeatedFieldEncoding = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "REPEATED_FIELD_ENCODING_UNKNOWN"] = 0; - values[valuesById[1] = "PACKED"] = 1; - values[valuesById[2] = "EXPANDED"] = 2; - return values; - })(); - - /** - * Utf8Validation enum. - * @name google.protobuf.FeatureSet.Utf8Validation - * @enum {number} - * @property {number} UTF8_VALIDATION_UNKNOWN=0 UTF8_VALIDATION_UNKNOWN value - * @property {number} VERIFY=2 VERIFY value - * @property {number} NONE=3 NONE value - */ - FeatureSet.Utf8Validation = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "UTF8_VALIDATION_UNKNOWN"] = 0; - values[valuesById[2] = "VERIFY"] = 2; - values[valuesById[3] = "NONE"] = 3; - return values; - })(); - - /** - * MessageEncoding enum. - * @name google.protobuf.FeatureSet.MessageEncoding - * @enum {number} - * @property {number} MESSAGE_ENCODING_UNKNOWN=0 MESSAGE_ENCODING_UNKNOWN value - * @property {number} LENGTH_PREFIXED=1 LENGTH_PREFIXED value - * @property {number} DELIMITED=2 DELIMITED value - */ - FeatureSet.MessageEncoding = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "MESSAGE_ENCODING_UNKNOWN"] = 0; - values[valuesById[1] = "LENGTH_PREFIXED"] = 1; - values[valuesById[2] = "DELIMITED"] = 2; - return values; - })(); - - /** - * JsonFormat enum. - * @name google.protobuf.FeatureSet.JsonFormat - * @enum {number} - * @property {number} JSON_FORMAT_UNKNOWN=0 JSON_FORMAT_UNKNOWN value - * @property {number} ALLOW=1 ALLOW value - * @property {number} LEGACY_BEST_EFFORT=2 LEGACY_BEST_EFFORT value - */ - FeatureSet.JsonFormat = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "JSON_FORMAT_UNKNOWN"] = 0; - values[valuesById[1] = "ALLOW"] = 1; - values[valuesById[2] = "LEGACY_BEST_EFFORT"] = 2; - return values; - })(); - - return FeatureSet; - })(); - - protobuf.FeatureSetDefaults = (function() { - - /** - * Properties of a FeatureSetDefaults. - * @memberof google.protobuf - * @interface IFeatureSetDefaults - * @property {Array.|null} [defaults] FeatureSetDefaults defaults - * @property {google.protobuf.Edition|null} [minimumEdition] FeatureSetDefaults minimumEdition - * @property {google.protobuf.Edition|null} [maximumEdition] FeatureSetDefaults maximumEdition - */ - - /** - * Constructs a new FeatureSetDefaults. - * @memberof google.protobuf - * @classdesc Represents a FeatureSetDefaults. - * @implements IFeatureSetDefaults - * @constructor - * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set - */ - function FeatureSetDefaults(properties) { - this.defaults = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FeatureSetDefaults defaults. - * @member {Array.} defaults - * @memberof google.protobuf.FeatureSetDefaults - * @instance - */ - FeatureSetDefaults.prototype.defaults = $util.emptyArray; - - /** - * FeatureSetDefaults minimumEdition. - * @member {google.protobuf.Edition} minimumEdition - * @memberof google.protobuf.FeatureSetDefaults - * @instance - */ - FeatureSetDefaults.prototype.minimumEdition = 0; - - /** - * FeatureSetDefaults maximumEdition. - * @member {google.protobuf.Edition} maximumEdition - * @memberof google.protobuf.FeatureSetDefaults - * @instance - */ - FeatureSetDefaults.prototype.maximumEdition = 0; - - /** - * Creates a new FeatureSetDefaults instance using the specified properties. - * @function create - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set - * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults instance - */ - FeatureSetDefaults.create = function create(properties) { - return new FeatureSetDefaults(properties); - }; - - /** - * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSetDefaults.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.defaults != null && message.defaults.length) - for (var i = 0; i < message.defaults.length; ++i) - $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.encode(message.defaults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.minimumEdition != null && Object.hasOwnProperty.call(message, "minimumEdition")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.minimumEdition); - if (message.maximumEdition != null && Object.hasOwnProperty.call(message, "maximumEdition")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maximumEdition); - return writer; - }; - - /** - * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSetDefaults.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FeatureSetDefaults message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSetDefaults.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.defaults && message.defaults.length)) - message.defaults = []; - message.defaults.push($root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.decode(reader, reader.uint32())); - break; - } - case 4: { - message.minimumEdition = reader.int32(); - break; - } - case 5: { - message.maximumEdition = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSetDefaults.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FeatureSetDefaults message. - * @function verify - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FeatureSetDefaults.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.defaults != null && message.hasOwnProperty("defaults")) { - if (!Array.isArray(message.defaults)) - return "defaults: array expected"; - for (var i = 0; i < message.defaults.length; ++i) { - var error = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify(message.defaults[i]); - if (error) - return "defaults." + error; - } - } - if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) - switch (message.minimumEdition) { - default: - return "minimumEdition: enum value expected"; - case 0: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) - switch (message.maximumEdition) { - default: - return "maximumEdition: enum value expected"; - case 0: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - return null; - }; - - /** - * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults - */ - FeatureSetDefaults.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FeatureSetDefaults) - return object; - var message = new $root.google.protobuf.FeatureSetDefaults(); - if (object.defaults) { - if (!Array.isArray(object.defaults)) - throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: array expected"); - message.defaults = []; - for (var i = 0; i < object.defaults.length; ++i) { - if (typeof object.defaults[i] !== "object") - throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: object expected"); - message.defaults[i] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fromObject(object.defaults[i]); - } - } - switch (object.minimumEdition) { - default: - if (typeof object.minimumEdition === "number") { - message.minimumEdition = object.minimumEdition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.minimumEdition = 0; - break; - case "EDITION_PROTO2": - case 998: - message.minimumEdition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.minimumEdition = 999; - break; - case "EDITION_2023": - case 1000: - message.minimumEdition = 1000; - break; - case "EDITION_2024": - case 1001: - message.minimumEdition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.minimumEdition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.minimumEdition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.minimumEdition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.minimumEdition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.minimumEdition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.minimumEdition = 2147483647; - break; - } - switch (object.maximumEdition) { - default: - if (typeof object.maximumEdition === "number") { - message.maximumEdition = object.maximumEdition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.maximumEdition = 0; - break; - case "EDITION_PROTO2": - case 998: - message.maximumEdition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.maximumEdition = 999; - break; - case "EDITION_2023": - case 1000: - message.maximumEdition = 1000; - break; - case "EDITION_2024": - case 1001: - message.maximumEdition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.maximumEdition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.maximumEdition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.maximumEdition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.maximumEdition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.maximumEdition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.maximumEdition = 2147483647; - break; - } - return message; - }; - - /** - * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {google.protobuf.FeatureSetDefaults} message FeatureSetDefaults - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FeatureSetDefaults.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.defaults = []; - if (options.defaults) { - object.minimumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; - object.maximumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; - } - if (message.defaults && message.defaults.length) { - object.defaults = []; - for (var j = 0; j < message.defaults.length; ++j) - object.defaults[j] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.toObject(message.defaults[j], options); - } - if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) - object.minimumEdition = options.enums === String ? $root.google.protobuf.Edition[message.minimumEdition] === undefined ? message.minimumEdition : $root.google.protobuf.Edition[message.minimumEdition] : message.minimumEdition; - if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) - object.maximumEdition = options.enums === String ? $root.google.protobuf.Edition[message.maximumEdition] === undefined ? message.maximumEdition : $root.google.protobuf.Edition[message.maximumEdition] : message.maximumEdition; - return object; - }; - - /** - * Converts this FeatureSetDefaults to JSON. - * @function toJSON - * @memberof google.protobuf.FeatureSetDefaults - * @instance - * @returns {Object.} JSON object - */ - FeatureSetDefaults.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FeatureSetDefaults - * @function getTypeUrl - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FeatureSetDefaults.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults"; - }; - - FeatureSetDefaults.FeatureSetEditionDefault = (function() { - - /** - * Properties of a FeatureSetEditionDefault. - * @memberof google.protobuf.FeatureSetDefaults - * @interface IFeatureSetEditionDefault - * @property {google.protobuf.Edition|null} [edition] FeatureSetEditionDefault edition - * @property {google.protobuf.IFeatureSet|null} [features] FeatureSetEditionDefault features - */ - - /** - * Constructs a new FeatureSetEditionDefault. - * @memberof google.protobuf.FeatureSetDefaults - * @classdesc Represents a FeatureSetEditionDefault. - * @implements IFeatureSetEditionDefault - * @constructor - * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set - */ - function FeatureSetEditionDefault(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FeatureSetEditionDefault edition. - * @member {google.protobuf.Edition} edition - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @instance - */ - FeatureSetEditionDefault.prototype.edition = 0; - - /** - * FeatureSetEditionDefault features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @instance - */ - FeatureSetEditionDefault.prototype.features = null; - - /** - * Creates a new FeatureSetEditionDefault instance using the specified properties. - * @function create - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set - * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault instance - */ - FeatureSetEditionDefault.create = function create(properties) { - return new FeatureSetEditionDefault(properties); - }; - - /** - * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSetEditionDefault.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); - return writer; - }; - - /** - * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSetEditionDefault.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSetEditionDefault.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 3: { - message.edition = reader.int32(); - break; - } - case 2: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSetEditionDefault.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FeatureSetEditionDefault message. - * @function verify - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FeatureSetEditionDefault.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.edition != null && message.hasOwnProperty("edition")) - switch (message.edition) { - default: - return "edition: enum value expected"; - case 0: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - return null; - }; - - /** - * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault - */ - FeatureSetEditionDefault.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault) - return object; - var message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); - switch (object.edition) { - default: - if (typeof object.edition === "number") { - message.edition = object.edition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.edition = 0; - break; - case "EDITION_PROTO2": - case 998: - message.edition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.edition = 999; - break; - case "EDITION_2023": - case 1000: - message.edition = 1000; - break; - case "EDITION_2024": - case 1001: - message.edition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.edition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.edition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.edition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.edition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.edition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.edition = 2147483647; - break; - } - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - return message; - }; - - /** - * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} message FeatureSetEditionDefault - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FeatureSetEditionDefault.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.features = null; - object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; - } - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.edition != null && message.hasOwnProperty("edition")) - object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; - return object; - }; - - /** - * Converts this FeatureSetEditionDefault to JSON. - * @function toJSON - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @instance - * @returns {Object.} JSON object - */ - FeatureSetEditionDefault.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FeatureSetEditionDefault - * @function getTypeUrl - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FeatureSetEditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault"; - }; - - return FeatureSetEditionDefault; - })(); - - return FeatureSetDefaults; - })(); - - protobuf.SourceCodeInfo = (function() { - - /** - * Properties of a SourceCodeInfo. - * @memberof google.protobuf - * @interface ISourceCodeInfo - * @property {Array.|null} [location] SourceCodeInfo location - */ - - /** - * Constructs a new SourceCodeInfo. - * @memberof google.protobuf - * @classdesc Represents a SourceCodeInfo. - * @implements ISourceCodeInfo - * @constructor - * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set - */ - function SourceCodeInfo(properties) { - this.location = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SourceCodeInfo location. - * @member {Array.} location - * @memberof google.protobuf.SourceCodeInfo - * @instance - */ - SourceCodeInfo.prototype.location = $util.emptyArray; - - /** - * Creates a new SourceCodeInfo instance using the specified properties. - * @function create - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance - */ - SourceCodeInfo.create = function create(properties) { - return new SourceCodeInfo(properties); - }; - - /** - * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @function encode - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SourceCodeInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.location != null && message.location.length) - for (var i = 0; i < message.location.length; ++i) - $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SourceCodeInfo.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.location && message.location.length)) - message.location = []; - message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SourceCodeInfo message. - * @function verify - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SourceCodeInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.location != null && message.hasOwnProperty("location")) { - if (!Array.isArray(message.location)) - return "location: array expected"; - for (var i = 0; i < message.location.length; ++i) { - var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]); - if (error) - return "location." + error; - } - } - return null; - }; - - /** - * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo - */ - SourceCodeInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.SourceCodeInfo) - return object; - var message = new $root.google.protobuf.SourceCodeInfo(); - if (object.location) { - if (!Array.isArray(object.location)) - throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); - message.location = []; - for (var i = 0; i < object.location.length; ++i) { - if (typeof object.location[i] !== "object") - throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); - message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SourceCodeInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.location = []; - if (message.location && message.location.length) { - object.location = []; - for (var j = 0; j < message.location.length; ++j) - object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options); - } - return object; - }; - - /** - * Converts this SourceCodeInfo to JSON. - * @function toJSON - * @memberof google.protobuf.SourceCodeInfo - * @instance - * @returns {Object.} JSON object - */ - SourceCodeInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SourceCodeInfo - * @function getTypeUrl - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SourceCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.SourceCodeInfo"; - }; - - SourceCodeInfo.Location = (function() { - - /** - * Properties of a Location. - * @memberof google.protobuf.SourceCodeInfo - * @interface ILocation - * @property {Array.|null} [path] Location path - * @property {Array.|null} [span] Location span - * @property {string|null} [leadingComments] Location leadingComments - * @property {string|null} [trailingComments] Location trailingComments - * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments - */ - - /** - * Constructs a new Location. - * @memberof google.protobuf.SourceCodeInfo - * @classdesc Represents a Location. - * @implements ILocation - * @constructor - * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set - */ - function Location(properties) { - this.path = []; - this.span = []; - this.leadingDetachedComments = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Location path. - * @member {Array.} path - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.path = $util.emptyArray; - - /** - * Location span. - * @member {Array.} span - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.span = $util.emptyArray; - - /** - * Location leadingComments. - * @member {string} leadingComments - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.leadingComments = ""; - - /** - * Location trailingComments. - * @member {string} trailingComments - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.trailingComments = ""; - - /** - * Location leadingDetachedComments. - * @member {Array.} leadingDetachedComments - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.leadingDetachedComments = $util.emptyArray; - - /** - * Creates a new Location instance using the specified properties. - * @function create - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set - * @returns {google.protobuf.SourceCodeInfo.Location} Location instance - */ - Location.create = function create(properties) { - return new Location(properties); - }; - - /** - * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @function encode - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Location.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && message.path.length) { - writer.uint32(/* id 1, wireType 2 =*/10).fork(); - for (var i = 0; i < message.path.length; ++i) - writer.int32(message.path[i]); - writer.ldelim(); - } - if (message.span != null && message.span.length) { - writer.uint32(/* id 2, wireType 2 =*/18).fork(); - for (var i = 0; i < message.span.length; ++i) - writer.int32(message.span[i]); - writer.ldelim(); - } - if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); - if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); - if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) - for (var i = 0; i < message.leadingDetachedComments.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); - return writer; - }; - - /** - * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Location.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Location message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.SourceCodeInfo.Location} Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Location.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.path && message.path.length)) - message.path = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.path.push(reader.int32()); - } else - message.path.push(reader.int32()); - break; - } - case 2: { - if (!(message.span && message.span.length)) - message.span = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.span.push(reader.int32()); - } else - message.span.push(reader.int32()); - break; - } - case 3: { - message.leadingComments = reader.string(); - break; - } - case 4: { - message.trailingComments = reader.string(); - break; - } - case 6: { - if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) - message.leadingDetachedComments = []; - message.leadingDetachedComments.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Location message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.SourceCodeInfo.Location} Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Location.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Location message. - * @function verify - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Location.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) { - if (!Array.isArray(message.path)) - return "path: array expected"; - for (var i = 0; i < message.path.length; ++i) - if (!$util.isInteger(message.path[i])) - return "path: integer[] expected"; - } - if (message.span != null && message.hasOwnProperty("span")) { - if (!Array.isArray(message.span)) - return "span: array expected"; - for (var i = 0; i < message.span.length; ++i) - if (!$util.isInteger(message.span[i])) - return "span: integer[] expected"; - } - if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) - if (!$util.isString(message.leadingComments)) - return "leadingComments: string expected"; - if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) - if (!$util.isString(message.trailingComments)) - return "trailingComments: string expected"; - if (message.leadingDetachedComments != null && message.hasOwnProperty("leadingDetachedComments")) { - if (!Array.isArray(message.leadingDetachedComments)) - return "leadingDetachedComments: array expected"; - for (var i = 0; i < message.leadingDetachedComments.length; ++i) - if (!$util.isString(message.leadingDetachedComments[i])) - return "leadingDetachedComments: string[] expected"; - } - return null; - }; - - /** - * Creates a Location message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.SourceCodeInfo.Location} Location - */ - Location.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) - return object; - var message = new $root.google.protobuf.SourceCodeInfo.Location(); - if (object.path) { - if (!Array.isArray(object.path)) - throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); - message.path = []; - for (var i = 0; i < object.path.length; ++i) - message.path[i] = object.path[i] | 0; - } - if (object.span) { - if (!Array.isArray(object.span)) - throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); - message.span = []; - for (var i = 0; i < object.span.length; ++i) - message.span[i] = object.span[i] | 0; - } - if (object.leadingComments != null) - message.leadingComments = String(object.leadingComments); - if (object.trailingComments != null) - message.trailingComments = String(object.trailingComments); - if (object.leadingDetachedComments) { - if (!Array.isArray(object.leadingDetachedComments)) - throw TypeError(".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected"); - message.leadingDetachedComments = []; - for (var i = 0; i < object.leadingDetachedComments.length; ++i) - message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]); - } - return message; - }; - - /** - * Creates a plain object from a Location message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.Location} message Location - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Location.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.path = []; - object.span = []; - object.leadingDetachedComments = []; - } - if (options.defaults) { - object.leadingComments = ""; - object.trailingComments = ""; - } - if (message.path && message.path.length) { - object.path = []; - for (var j = 0; j < message.path.length; ++j) - object.path[j] = message.path[j]; - } - if (message.span && message.span.length) { - object.span = []; - for (var j = 0; j < message.span.length; ++j) - object.span[j] = message.span[j]; - } - if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) - object.leadingComments = message.leadingComments; - if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) - object.trailingComments = message.trailingComments; - if (message.leadingDetachedComments && message.leadingDetachedComments.length) { - object.leadingDetachedComments = []; - for (var j = 0; j < message.leadingDetachedComments.length; ++j) - object.leadingDetachedComments[j] = message.leadingDetachedComments[j]; - } - return object; - }; - - /** - * Converts this Location to JSON. - * @function toJSON - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - * @returns {Object.} JSON object - */ - Location.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Location - * @function getTypeUrl - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Location.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.SourceCodeInfo.Location"; - }; - - return Location; - })(); - - return SourceCodeInfo; - })(); - - protobuf.GeneratedCodeInfo = (function() { - - /** - * Properties of a GeneratedCodeInfo. - * @memberof google.protobuf - * @interface IGeneratedCodeInfo - * @property {Array.|null} [annotation] GeneratedCodeInfo annotation - */ - - /** - * Constructs a new GeneratedCodeInfo. - * @memberof google.protobuf - * @classdesc Represents a GeneratedCodeInfo. - * @implements IGeneratedCodeInfo - * @constructor - * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set - */ - function GeneratedCodeInfo(properties) { - this.annotation = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GeneratedCodeInfo annotation. - * @member {Array.} annotation - * @memberof google.protobuf.GeneratedCodeInfo - * @instance - */ - GeneratedCodeInfo.prototype.annotation = $util.emptyArray; - - /** - * Creates a new GeneratedCodeInfo instance using the specified properties. - * @function create - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance - */ - GeneratedCodeInfo.create = function create(properties) { - return new GeneratedCodeInfo(properties); - }; - - /** - * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @function encode - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GeneratedCodeInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.annotation != null && message.annotation.length) - for (var i = 0; i < message.annotation.length; ++i) - $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GeneratedCodeInfo.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.annotation && message.annotation.length)) - message.annotation = []; - message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GeneratedCodeInfo message. - * @function verify - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GeneratedCodeInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.annotation != null && message.hasOwnProperty("annotation")) { - if (!Array.isArray(message.annotation)) - return "annotation: array expected"; - for (var i = 0; i < message.annotation.length; ++i) { - var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]); - if (error) - return "annotation." + error; - } - } - return null; - }; - - /** - * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo - */ - GeneratedCodeInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.GeneratedCodeInfo) - return object; - var message = new $root.google.protobuf.GeneratedCodeInfo(); - if (object.annotation) { - if (!Array.isArray(object.annotation)) - throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); - message.annotation = []; - for (var i = 0; i < object.annotation.length; ++i) { - if (typeof object.annotation[i] !== "object") - throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); - message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GeneratedCodeInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.annotation = []; - if (message.annotation && message.annotation.length) { - object.annotation = []; - for (var j = 0; j < message.annotation.length; ++j) - object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options); - } - return object; - }; - - /** - * Converts this GeneratedCodeInfo to JSON. - * @function toJSON - * @memberof google.protobuf.GeneratedCodeInfo - * @instance - * @returns {Object.} JSON object - */ - GeneratedCodeInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GeneratedCodeInfo - * @function getTypeUrl - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GeneratedCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo"; - }; - - GeneratedCodeInfo.Annotation = (function() { - - /** - * Properties of an Annotation. - * @memberof google.protobuf.GeneratedCodeInfo - * @interface IAnnotation - * @property {Array.|null} [path] Annotation path - * @property {string|null} [sourceFile] Annotation sourceFile - * @property {number|null} [begin] Annotation begin - * @property {number|null} [end] Annotation end - * @property {google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null} [semantic] Annotation semantic - */ - - /** - * Constructs a new Annotation. - * @memberof google.protobuf.GeneratedCodeInfo - * @classdesc Represents an Annotation. - * @implements IAnnotation - * @constructor - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set - */ - function Annotation(properties) { - this.path = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Annotation path. - * @member {Array.} path - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.path = $util.emptyArray; - - /** - * Annotation sourceFile. - * @member {string} sourceFile - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.sourceFile = ""; - - /** - * Annotation begin. - * @member {number} begin - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.begin = 0; - - /** - * Annotation end. - * @member {number} end - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.end = 0; - - /** - * Annotation semantic. - * @member {google.protobuf.GeneratedCodeInfo.Annotation.Semantic} semantic - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.semantic = 0; - - /** - * Creates a new Annotation instance using the specified properties. - * @function create - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance - */ - Annotation.create = function create(properties) { - return new Annotation(properties); - }; - - /** - * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @function encode - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Annotation.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && message.path.length) { - writer.uint32(/* id 1, wireType 2 =*/10).fork(); - for (var i = 0; i < message.path.length; ++i) - writer.int32(message.path[i]); - writer.ldelim(); - } - if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); - if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); - if (message.semantic != null && Object.hasOwnProperty.call(message, "semantic")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.semantic); - return writer; - }; - - /** - * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Annotation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Annotation message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Annotation.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.path && message.path.length)) - message.path = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.path.push(reader.int32()); - } else - message.path.push(reader.int32()); - break; - } - case 2: { - message.sourceFile = reader.string(); - break; - } - case 3: { - message.begin = reader.int32(); - break; - } - case 4: { - message.end = reader.int32(); - break; - } - case 5: { - message.semantic = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Annotation message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Annotation.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Annotation message. - * @function verify - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Annotation.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) { - if (!Array.isArray(message.path)) - return "path: array expected"; - for (var i = 0; i < message.path.length; ++i) - if (!$util.isInteger(message.path[i])) - return "path: integer[] expected"; - } - if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) - if (!$util.isString(message.sourceFile)) - return "sourceFile: string expected"; - if (message.begin != null && message.hasOwnProperty("begin")) - if (!$util.isInteger(message.begin)) - return "begin: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - if (message.semantic != null && message.hasOwnProperty("semantic")) - switch (message.semantic) { - default: - return "semantic: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates an Annotation message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation - */ - Annotation.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) - return object; - var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); - if (object.path) { - if (!Array.isArray(object.path)) - throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); - message.path = []; - for (var i = 0; i < object.path.length; ++i) - message.path[i] = object.path[i] | 0; - } - if (object.sourceFile != null) - message.sourceFile = String(object.sourceFile); - if (object.begin != null) - message.begin = object.begin | 0; - if (object.end != null) - message.end = object.end | 0; - switch (object.semantic) { - default: - if (typeof object.semantic === "number") { - message.semantic = object.semantic; - break; - } - break; - case "NONE": - case 0: - message.semantic = 0; - break; - case "SET": - case 1: - message.semantic = 1; - break; - case "ALIAS": - case 2: - message.semantic = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from an Annotation message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Annotation.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.path = []; - if (options.defaults) { - object.sourceFile = ""; - object.begin = 0; - object.end = 0; - object.semantic = options.enums === String ? "NONE" : 0; - } - if (message.path && message.path.length) { - object.path = []; - for (var j = 0; j < message.path.length; ++j) - object.path[j] = message.path[j]; - } - if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) - object.sourceFile = message.sourceFile; - if (message.begin != null && message.hasOwnProperty("begin")) - object.begin = message.begin; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - if (message.semantic != null && message.hasOwnProperty("semantic")) - object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] === undefined ? message.semantic : $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic; - return object; - }; - - /** - * Converts this Annotation to JSON. - * @function toJSON - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - * @returns {Object.} JSON object - */ - Annotation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Annotation - * @function getTypeUrl - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Annotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo.Annotation"; - }; - - /** - * Semantic enum. - * @name google.protobuf.GeneratedCodeInfo.Annotation.Semantic - * @enum {number} - * @property {number} NONE=0 NONE value - * @property {number} SET=1 SET value - * @property {number} ALIAS=2 ALIAS value - */ - Annotation.Semantic = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "NONE"] = 0; - values[valuesById[1] = "SET"] = 1; - values[valuesById[2] = "ALIAS"] = 2; - return values; - })(); - - return Annotation; - })(); - - return GeneratedCodeInfo; - })(); - - protobuf.Duration = (function() { - - /** - * Properties of a Duration. - * @memberof google.protobuf - * @interface IDuration - * @property {number|Long|null} [seconds] Duration seconds - * @property {number|null} [nanos] Duration nanos - */ - - /** - * Constructs a new Duration. - * @memberof google.protobuf - * @classdesc Represents a Duration. - * @implements IDuration - * @constructor - * @param {google.protobuf.IDuration=} [properties] Properties to set - */ - function Duration(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Duration seconds. - * @member {number|Long} seconds - * @memberof google.protobuf.Duration - * @instance - */ - Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Duration nanos. - * @member {number} nanos - * @memberof google.protobuf.Duration - * @instance - */ - Duration.prototype.nanos = 0; - - /** - * Creates a new Duration instance using the specified properties. - * @function create - * @memberof google.protobuf.Duration - * @static - * @param {google.protobuf.IDuration=} [properties] Properties to set - * @returns {google.protobuf.Duration} Duration instance - */ - Duration.create = function create(properties) { - return new Duration(properties); - }; - - /** - * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Duration - * @static - * @param {google.protobuf.IDuration} message Duration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Duration.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); - if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); - return writer; - }; - - /** - * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Duration - * @static - * @param {google.protobuf.IDuration} message Duration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Duration.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Duration message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Duration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Duration} Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Duration.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.seconds = reader.int64(); - break; - } - case 2: { - message.nanos = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Duration message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Duration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Duration} Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Duration.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Duration message. - * @function verify - * @memberof google.protobuf.Duration - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Duration.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) - return "seconds: integer|Long expected"; - if (message.nanos != null && message.hasOwnProperty("nanos")) - if (!$util.isInteger(message.nanos)) - return "nanos: integer expected"; - return null; - }; - - /** - * Creates a Duration message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Duration - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Duration} Duration - */ - Duration.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Duration) - return object; - var message = new $root.google.protobuf.Duration(); - if (object.seconds != null) - if ($util.Long) - (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; - else if (typeof object.seconds === "string") - message.seconds = parseInt(object.seconds, 10); - else if (typeof object.seconds === "number") - message.seconds = object.seconds; - else if (typeof object.seconds === "object") - message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); - if (object.nanos != null) - message.nanos = object.nanos | 0; - return message; - }; - - /** - * Creates a plain object from a Duration message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Duration - * @static - * @param {google.protobuf.Duration} message Duration - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Duration.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.seconds = options.longs === String ? "0" : 0; - object.nanos = 0; - } - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (typeof message.seconds === "number") - object.seconds = options.longs === String ? String(message.seconds) : message.seconds; - else - object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; - if (message.nanos != null && message.hasOwnProperty("nanos")) - object.nanos = message.nanos; - return object; - }; - - /** - * Converts this Duration to JSON. - * @function toJSON - * @memberof google.protobuf.Duration - * @instance - * @returns {Object.} JSON object - */ - Duration.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Duration - * @function getTypeUrl - * @memberof google.protobuf.Duration - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Duration"; - }; - - return Duration; - })(); - - protobuf.Any = (function() { - - /** - * Properties of an Any. - * @memberof google.protobuf - * @interface IAny - * @property {string|null} [type_url] Any type_url - * @property {Uint8Array|null} [value] Any value - */ - - /** - * Constructs a new Any. - * @memberof google.protobuf - * @classdesc Represents an Any. - * @implements IAny - * @constructor - * @param {google.protobuf.IAny=} [properties] Properties to set - */ - function Any(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Any type_url. - * @member {string} type_url - * @memberof google.protobuf.Any - * @instance - */ - Any.prototype.type_url = ""; - - /** - * Any value. - * @member {Uint8Array} value - * @memberof google.protobuf.Any - * @instance - */ - Any.prototype.value = $util.newBuffer([]); - - /** - * Creates a new Any instance using the specified properties. - * @function create - * @memberof google.protobuf.Any - * @static - * @param {google.protobuf.IAny=} [properties] Properties to set - * @returns {google.protobuf.Any} Any instance - */ - Any.create = function create(properties) { - return new Any(properties); - }; - - /** - * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Any - * @static - * @param {google.protobuf.IAny} message Any message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Any.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); - return writer; - }; - - /** - * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Any - * @static - * @param {google.protobuf.IAny} message Any message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Any.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Any message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Any - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Any} Any - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Any.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.type_url = reader.string(); - break; - } - case 2: { - message.value = reader.bytes(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Any message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Any - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Any} Any - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Any.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Any message. - * @function verify - * @memberof google.protobuf.Any - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Any.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.type_url != null && message.hasOwnProperty("type_url")) - if (!$util.isString(message.type_url)) - return "type_url: string expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) - return "value: buffer expected"; - return null; - }; - - /** - * Creates an Any message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Any - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Any} Any - */ - Any.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Any) - return object; - var message = new $root.google.protobuf.Any(); - if (object.type_url != null) - message.type_url = String(object.type_url); - if (object.value != null) - if (typeof object.value === "string") - $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); - else if (object.value.length >= 0) - message.value = object.value; - return message; - }; - - /** - * Creates a plain object from an Any message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Any - * @static - * @param {google.protobuf.Any} message Any - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Any.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.type_url = ""; - if (options.bytes === String) - object.value = ""; - else { - object.value = []; - if (options.bytes !== Array) - object.value = $util.newBuffer(object.value); - } - } - if (message.type_url != null && message.hasOwnProperty("type_url")) - object.type_url = message.type_url; - if (message.value != null && message.hasOwnProperty("value")) - object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; - return object; - }; - - /** - * Converts this Any to JSON. - * @function toJSON - * @memberof google.protobuf.Any - * @instance - * @returns {Object.} JSON object - */ - Any.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Any - * @function getTypeUrl - * @memberof google.protobuf.Any - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Any.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Any"; - }; - - return Any; - })(); - - protobuf.Empty = (function() { - - /** - * Properties of an Empty. - * @memberof google.protobuf - * @interface IEmpty - */ - - /** - * Constructs a new Empty. - * @memberof google.protobuf - * @classdesc Represents an Empty. - * @implements IEmpty - * @constructor - * @param {google.protobuf.IEmpty=} [properties] Properties to set - */ - function Empty(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Creates a new Empty instance using the specified properties. - * @function create - * @memberof google.protobuf.Empty - * @static - * @param {google.protobuf.IEmpty=} [properties] Properties to set - * @returns {google.protobuf.Empty} Empty instance - */ - Empty.create = function create(properties) { - return new Empty(properties); - }; - - /** - * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Empty - * @static - * @param {google.protobuf.IEmpty} message Empty message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Empty.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Empty - * @static - * @param {google.protobuf.IEmpty} message Empty message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Empty.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Empty message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Empty - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Empty} Empty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Empty.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Empty message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Empty - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Empty} Empty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Empty.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Empty message. - * @function verify - * @memberof google.protobuf.Empty - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Empty.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates an Empty message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Empty - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Empty} Empty - */ - Empty.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Empty) - return object; - return new $root.google.protobuf.Empty(); - }; - - /** - * Creates a plain object from an Empty message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Empty - * @static - * @param {google.protobuf.Empty} message Empty - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Empty.toObject = function toObject() { - return {}; - }; - - /** - * Converts this Empty to JSON. - * @function toJSON - * @memberof google.protobuf.Empty - * @instance - * @returns {Object.} JSON object - */ - Empty.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Empty - * @function getTypeUrl - * @memberof google.protobuf.Empty - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Empty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Empty"; - }; - - return Empty; - })(); - - protobuf.FieldMask = (function() { - - /** - * Properties of a FieldMask. - * @memberof google.protobuf - * @interface IFieldMask - * @property {Array.|null} [paths] FieldMask paths - */ - - /** - * Constructs a new FieldMask. - * @memberof google.protobuf - * @classdesc Represents a FieldMask. - * @implements IFieldMask - * @constructor - * @param {google.protobuf.IFieldMask=} [properties] Properties to set - */ - function FieldMask(properties) { - this.paths = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FieldMask paths. - * @member {Array.} paths - * @memberof google.protobuf.FieldMask - * @instance - */ - FieldMask.prototype.paths = $util.emptyArray; - - /** - * Creates a new FieldMask instance using the specified properties. - * @function create - * @memberof google.protobuf.FieldMask - * @static - * @param {google.protobuf.IFieldMask=} [properties] Properties to set - * @returns {google.protobuf.FieldMask} FieldMask instance - */ - FieldMask.create = function create(properties) { - return new FieldMask(properties); - }; - - /** - * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FieldMask - * @static - * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldMask.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.paths != null && message.paths.length) - for (var i = 0; i < message.paths.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.paths[i]); - return writer; - }; - - /** - * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FieldMask - * @static - * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldMask.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FieldMask message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FieldMask - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldMask} FieldMask - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldMask.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldMask(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.paths && message.paths.length)) - message.paths = []; - message.paths.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FieldMask message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FieldMask - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldMask} FieldMask - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldMask.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FieldMask message. - * @function verify - * @memberof google.protobuf.FieldMask - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FieldMask.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.paths != null && message.hasOwnProperty("paths")) { - if (!Array.isArray(message.paths)) - return "paths: array expected"; - for (var i = 0; i < message.paths.length; ++i) - if (!$util.isString(message.paths[i])) - return "paths: string[] expected"; - } - return null; - }; - - /** - * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FieldMask - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FieldMask} FieldMask - */ - FieldMask.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldMask) - return object; - var message = new $root.google.protobuf.FieldMask(); - if (object.paths) { - if (!Array.isArray(object.paths)) - throw TypeError(".google.protobuf.FieldMask.paths: array expected"); - message.paths = []; - for (var i = 0; i < object.paths.length; ++i) - message.paths[i] = String(object.paths[i]); - } - return message; - }; - - /** - * Creates a plain object from a FieldMask message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FieldMask - * @static - * @param {google.protobuf.FieldMask} message FieldMask - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FieldMask.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.paths = []; - if (message.paths && message.paths.length) { - object.paths = []; - for (var j = 0; j < message.paths.length; ++j) - object.paths[j] = message.paths[j]; - } - return object; - }; - - /** - * Converts this FieldMask to JSON. - * @function toJSON - * @memberof google.protobuf.FieldMask - * @instance - * @returns {Object.} JSON object - */ - FieldMask.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FieldMask - * @function getTypeUrl - * @memberof google.protobuf.FieldMask - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FieldMask.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FieldMask"; - }; - - return FieldMask; - })(); - - protobuf.Timestamp = (function() { - - /** - * Properties of a Timestamp. - * @memberof google.protobuf - * @interface ITimestamp - * @property {number|Long|null} [seconds] Timestamp seconds - * @property {number|null} [nanos] Timestamp nanos - */ - - /** - * Constructs a new Timestamp. - * @memberof google.protobuf - * @classdesc Represents a Timestamp. - * @implements ITimestamp - * @constructor - * @param {google.protobuf.ITimestamp=} [properties] Properties to set - */ - function Timestamp(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Timestamp seconds. - * @member {number|Long} seconds - * @memberof google.protobuf.Timestamp - * @instance - */ - Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Timestamp nanos. - * @member {number} nanos - * @memberof google.protobuf.Timestamp - * @instance - */ - Timestamp.prototype.nanos = 0; - - /** - * Creates a new Timestamp instance using the specified properties. - * @function create - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.ITimestamp=} [properties] Properties to set - * @returns {google.protobuf.Timestamp} Timestamp instance - */ - Timestamp.create = function create(properties) { - return new Timestamp(properties); - }; - - /** - * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Timestamp.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); - if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); - return writer; - }; - - /** - * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Timestamp.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Timestamp message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Timestamp - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Timestamp} Timestamp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Timestamp.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.seconds = reader.int64(); - break; - } - case 2: { - message.nanos = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Timestamp message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Timestamp - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Timestamp} Timestamp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Timestamp.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Timestamp message. - * @function verify - * @memberof google.protobuf.Timestamp - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Timestamp.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) - return "seconds: integer|Long expected"; - if (message.nanos != null && message.hasOwnProperty("nanos")) - if (!$util.isInteger(message.nanos)) - return "nanos: integer expected"; - return null; - }; - - /** - * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Timestamp - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Timestamp} Timestamp - */ - Timestamp.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Timestamp) - return object; - var message = new $root.google.protobuf.Timestamp(); - if (object.seconds != null) - if ($util.Long) - (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; - else if (typeof object.seconds === "string") - message.seconds = parseInt(object.seconds, 10); - else if (typeof object.seconds === "number") - message.seconds = object.seconds; - else if (typeof object.seconds === "object") - message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); - if (object.nanos != null) - message.nanos = object.nanos | 0; - return message; - }; - - /** - * Creates a plain object from a Timestamp message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.Timestamp} message Timestamp - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Timestamp.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.seconds = options.longs === String ? "0" : 0; - object.nanos = 0; - } - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (typeof message.seconds === "number") - object.seconds = options.longs === String ? String(message.seconds) : message.seconds; - else - object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; - if (message.nanos != null && message.hasOwnProperty("nanos")) - object.nanos = message.nanos; - return object; - }; - - /** - * Converts this Timestamp to JSON. - * @function toJSON - * @memberof google.protobuf.Timestamp - * @instance - * @returns {Object.} JSON object - */ - Timestamp.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Timestamp - * @function getTypeUrl - * @memberof google.protobuf.Timestamp - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Timestamp"; - }; - - return Timestamp; - })(); - - protobuf.Struct = (function() { - - /** - * Properties of a Struct. - * @memberof google.protobuf - * @interface IStruct - * @property {Object.|null} [fields] Struct fields - */ - - /** - * Constructs a new Struct. - * @memberof google.protobuf - * @classdesc Represents a Struct. - * @implements IStruct - * @constructor - * @param {google.protobuf.IStruct=} [properties] Properties to set - */ - function Struct(properties) { - this.fields = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Struct fields. - * @member {Object.} fields - * @memberof google.protobuf.Struct - * @instance - */ - Struct.prototype.fields = $util.emptyObject; - - /** - * Creates a new Struct instance using the specified properties. - * @function create - * @memberof google.protobuf.Struct - * @static - * @param {google.protobuf.IStruct=} [properties] Properties to set - * @returns {google.protobuf.Struct} Struct instance - */ - Struct.create = function create(properties) { - return new Struct(properties); - }; - - /** - * Encodes the specified Struct message. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Struct - * @static - * @param {google.protobuf.IStruct} message Struct message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Struct.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.fields != null && Object.hasOwnProperty.call(message, "fields")) - for (var keys = Object.keys(message.fields), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.protobuf.Value.encode(message.fields[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - return writer; - }; - - /** - * Encodes the specified Struct message, length delimited. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Struct - * @static - * @param {google.protobuf.IStruct} message Struct message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Struct.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Struct message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Struct - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Struct} Struct - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Struct.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Struct(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (message.fields === $util.emptyObject) - message.fields = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = null; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = $root.google.protobuf.Value.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.fields[key] = value; - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Struct message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Struct - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Struct} Struct - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Struct.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Struct message. - * @function verify - * @memberof google.protobuf.Struct - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Struct.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.fields != null && message.hasOwnProperty("fields")) { - if (!$util.isObject(message.fields)) - return "fields: object expected"; - var key = Object.keys(message.fields); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.protobuf.Value.verify(message.fields[key[i]]); - if (error) - return "fields." + error; - } - } - return null; - }; - - /** - * Creates a Struct message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Struct - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Struct} Struct - */ - Struct.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Struct) - return object; - var message = new $root.google.protobuf.Struct(); - if (object.fields) { - if (typeof object.fields !== "object") - throw TypeError(".google.protobuf.Struct.fields: object expected"); - message.fields = {}; - for (var keys = Object.keys(object.fields), i = 0; i < keys.length; ++i) { - if (typeof object.fields[keys[i]] !== "object") - throw TypeError(".google.protobuf.Struct.fields: object expected"); - message.fields[keys[i]] = $root.google.protobuf.Value.fromObject(object.fields[keys[i]]); - } - } - return message; - }; - - /** - * Creates a plain object from a Struct message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Struct - * @static - * @param {google.protobuf.Struct} message Struct - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Struct.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.fields = {}; - var keys2; - if (message.fields && (keys2 = Object.keys(message.fields)).length) { - object.fields = {}; - for (var j = 0; j < keys2.length; ++j) - object.fields[keys2[j]] = $root.google.protobuf.Value.toObject(message.fields[keys2[j]], options); - } - return object; - }; - - /** - * Converts this Struct to JSON. - * @function toJSON - * @memberof google.protobuf.Struct - * @instance - * @returns {Object.} JSON object - */ - Struct.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Struct - * @function getTypeUrl - * @memberof google.protobuf.Struct - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Struct.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Struct"; - }; - - return Struct; - })(); - - protobuf.Value = (function() { - - /** - * Properties of a Value. - * @memberof google.protobuf - * @interface IValue - * @property {google.protobuf.NullValue|null} [nullValue] Value nullValue - * @property {number|null} [numberValue] Value numberValue - * @property {string|null} [stringValue] Value stringValue - * @property {boolean|null} [boolValue] Value boolValue - * @property {google.protobuf.IStruct|null} [structValue] Value structValue - * @property {google.protobuf.IListValue|null} [listValue] Value listValue - */ - - /** - * Constructs a new Value. - * @memberof google.protobuf - * @classdesc Represents a Value. - * @implements IValue - * @constructor - * @param {google.protobuf.IValue=} [properties] Properties to set - */ - function Value(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Value nullValue. - * @member {google.protobuf.NullValue|null|undefined} nullValue - * @memberof google.protobuf.Value - * @instance - */ - Value.prototype.nullValue = null; - - /** - * Value numberValue. - * @member {number|null|undefined} numberValue - * @memberof google.protobuf.Value - * @instance - */ - Value.prototype.numberValue = null; - - /** - * Value stringValue. - * @member {string|null|undefined} stringValue - * @memberof google.protobuf.Value - * @instance - */ - Value.prototype.stringValue = null; - - /** - * Value boolValue. - * @member {boolean|null|undefined} boolValue - * @memberof google.protobuf.Value - * @instance - */ - Value.prototype.boolValue = null; - - /** - * Value structValue. - * @member {google.protobuf.IStruct|null|undefined} structValue - * @memberof google.protobuf.Value - * @instance - */ - Value.prototype.structValue = null; - - /** - * Value listValue. - * @member {google.protobuf.IListValue|null|undefined} listValue - * @memberof google.protobuf.Value - * @instance - */ - Value.prototype.listValue = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Value kind. - * @member {"nullValue"|"numberValue"|"stringValue"|"boolValue"|"structValue"|"listValue"|undefined} kind - * @memberof google.protobuf.Value - * @instance - */ - Object.defineProperty(Value.prototype, "kind", { - get: $util.oneOfGetter($oneOfFields = ["nullValue", "numberValue", "stringValue", "boolValue", "structValue", "listValue"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Value instance using the specified properties. - * @function create - * @memberof google.protobuf.Value - * @static - * @param {google.protobuf.IValue=} [properties] Properties to set - * @returns {google.protobuf.Value} Value instance - */ - Value.create = function create(properties) { - return new Value(properties); - }; - - /** - * Encodes the specified Value message. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Value - * @static - * @param {google.protobuf.IValue} message Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Value.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.nullValue != null && Object.hasOwnProperty.call(message, "nullValue")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.nullValue); - if (message.numberValue != null && Object.hasOwnProperty.call(message, "numberValue")) - writer.uint32(/* id 2, wireType 1 =*/17).double(message.numberValue); - if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.stringValue); - if (message.boolValue != null && Object.hasOwnProperty.call(message, "boolValue")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.boolValue); - if (message.structValue != null && Object.hasOwnProperty.call(message, "structValue")) - $root.google.protobuf.Struct.encode(message.structValue, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.listValue != null && Object.hasOwnProperty.call(message, "listValue")) - $root.google.protobuf.ListValue.encode(message.listValue, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Value message, length delimited. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Value - * @static - * @param {google.protobuf.IValue} message Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Value.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Value message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Value} Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Value.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Value(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.nullValue = reader.int32(); - break; - } - case 2: { - message.numberValue = reader.double(); - break; - } - case 3: { - message.stringValue = reader.string(); - break; - } - case 4: { - message.boolValue = reader.bool(); - break; - } - case 5: { - message.structValue = $root.google.protobuf.Struct.decode(reader, reader.uint32()); - break; - } - case 6: { - message.listValue = $root.google.protobuf.ListValue.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Value message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Value} Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Value.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Value message. - * @function verify - * @memberof google.protobuf.Value - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Value.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.nullValue != null && message.hasOwnProperty("nullValue")) { - properties.kind = 1; - switch (message.nullValue) { - default: - return "nullValue: enum value expected"; - case 0: - break; - } - } - if (message.numberValue != null && message.hasOwnProperty("numberValue")) { - if (properties.kind === 1) - return "kind: multiple values"; - properties.kind = 1; - if (typeof message.numberValue !== "number") - return "numberValue: number expected"; - } - if (message.stringValue != null && message.hasOwnProperty("stringValue")) { - if (properties.kind === 1) - return "kind: multiple values"; - properties.kind = 1; - if (!$util.isString(message.stringValue)) - return "stringValue: string expected"; - } - if (message.boolValue != null && message.hasOwnProperty("boolValue")) { - if (properties.kind === 1) - return "kind: multiple values"; - properties.kind = 1; - if (typeof message.boolValue !== "boolean") - return "boolValue: boolean expected"; - } - if (message.structValue != null && message.hasOwnProperty("structValue")) { - if (properties.kind === 1) - return "kind: multiple values"; - properties.kind = 1; - { - var error = $root.google.protobuf.Struct.verify(message.structValue); - if (error) - return "structValue." + error; - } - } - if (message.listValue != null && message.hasOwnProperty("listValue")) { - if (properties.kind === 1) - return "kind: multiple values"; - properties.kind = 1; - { - var error = $root.google.protobuf.ListValue.verify(message.listValue); - if (error) - return "listValue." + error; - } - } - return null; - }; - - /** - * Creates a Value message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Value - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Value} Value - */ - Value.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Value) - return object; - var message = new $root.google.protobuf.Value(); - switch (object.nullValue) { - default: - if (typeof object.nullValue === "number") { - message.nullValue = object.nullValue; - break; - } - break; - case "NULL_VALUE": - case 0: - message.nullValue = 0; - break; - } - if (object.numberValue != null) - message.numberValue = Number(object.numberValue); - if (object.stringValue != null) - message.stringValue = String(object.stringValue); - if (object.boolValue != null) - message.boolValue = Boolean(object.boolValue); - if (object.structValue != null) { - if (typeof object.structValue !== "object") - throw TypeError(".google.protobuf.Value.structValue: object expected"); - message.structValue = $root.google.protobuf.Struct.fromObject(object.structValue); - } - if (object.listValue != null) { - if (typeof object.listValue !== "object") - throw TypeError(".google.protobuf.Value.listValue: object expected"); - message.listValue = $root.google.protobuf.ListValue.fromObject(object.listValue); - } - return message; - }; - - /** - * Creates a plain object from a Value message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Value - * @static - * @param {google.protobuf.Value} message Value - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Value.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.nullValue != null && message.hasOwnProperty("nullValue")) { - object.nullValue = options.enums === String ? $root.google.protobuf.NullValue[message.nullValue] === undefined ? message.nullValue : $root.google.protobuf.NullValue[message.nullValue] : message.nullValue; - if (options.oneofs) - object.kind = "nullValue"; - } - if (message.numberValue != null && message.hasOwnProperty("numberValue")) { - object.numberValue = options.json && !isFinite(message.numberValue) ? String(message.numberValue) : message.numberValue; - if (options.oneofs) - object.kind = "numberValue"; - } - if (message.stringValue != null && message.hasOwnProperty("stringValue")) { - object.stringValue = message.stringValue; - if (options.oneofs) - object.kind = "stringValue"; - } - if (message.boolValue != null && message.hasOwnProperty("boolValue")) { - object.boolValue = message.boolValue; - if (options.oneofs) - object.kind = "boolValue"; - } - if (message.structValue != null && message.hasOwnProperty("structValue")) { - object.structValue = $root.google.protobuf.Struct.toObject(message.structValue, options); - if (options.oneofs) - object.kind = "structValue"; - } - if (message.listValue != null && message.hasOwnProperty("listValue")) { - object.listValue = $root.google.protobuf.ListValue.toObject(message.listValue, options); - if (options.oneofs) - object.kind = "listValue"; - } - return object; - }; - - /** - * Converts this Value to JSON. - * @function toJSON - * @memberof google.protobuf.Value - * @instance - * @returns {Object.} JSON object - */ - Value.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Value - * @function getTypeUrl - * @memberof google.protobuf.Value - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Value"; - }; - - return Value; - })(); - - /** - * NullValue enum. - * @name google.protobuf.NullValue - * @enum {number} - * @property {number} NULL_VALUE=0 NULL_VALUE value - */ - protobuf.NullValue = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "NULL_VALUE"] = 0; - return values; - })(); - - protobuf.ListValue = (function() { - - /** - * Properties of a ListValue. - * @memberof google.protobuf - * @interface IListValue - * @property {Array.|null} [values] ListValue values - */ - - /** - * Constructs a new ListValue. - * @memberof google.protobuf - * @classdesc Represents a ListValue. - * @implements IListValue - * @constructor - * @param {google.protobuf.IListValue=} [properties] Properties to set - */ - function ListValue(properties) { - this.values = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListValue values. - * @member {Array.} values - * @memberof google.protobuf.ListValue - * @instance - */ - ListValue.prototype.values = $util.emptyArray; - - /** - * Creates a new ListValue instance using the specified properties. - * @function create - * @memberof google.protobuf.ListValue - * @static - * @param {google.protobuf.IListValue=} [properties] Properties to set - * @returns {google.protobuf.ListValue} ListValue instance - */ - ListValue.create = function create(properties) { - return new ListValue(properties); - }; - - /** - * Encodes the specified ListValue message. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ListValue - * @static - * @param {google.protobuf.IListValue} message ListValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListValue.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.values != null && message.values.length) - for (var i = 0; i < message.values.length; ++i) - $root.google.protobuf.Value.encode(message.values[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ListValue message, length delimited. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ListValue - * @static - * @param {google.protobuf.IListValue} message ListValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListValue message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ListValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ListValue} ListValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListValue.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ListValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.values && message.values.length)) - message.values = []; - message.values.push($root.google.protobuf.Value.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ListValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ListValue} ListValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListValue message. - * @function verify - * @memberof google.protobuf.ListValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListValue.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.values != null && message.hasOwnProperty("values")) { - if (!Array.isArray(message.values)) - return "values: array expected"; - for (var i = 0; i < message.values.length; ++i) { - var error = $root.google.protobuf.Value.verify(message.values[i]); - if (error) - return "values." + error; - } - } - return null; - }; - - /** - * Creates a ListValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ListValue - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ListValue} ListValue - */ - ListValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ListValue) - return object; - var message = new $root.google.protobuf.ListValue(); - if (object.values) { - if (!Array.isArray(object.values)) - throw TypeError(".google.protobuf.ListValue.values: array expected"); - message.values = []; - for (var i = 0; i < object.values.length; ++i) { - if (typeof object.values[i] !== "object") - throw TypeError(".google.protobuf.ListValue.values: object expected"); - message.values[i] = $root.google.protobuf.Value.fromObject(object.values[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a ListValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ListValue - * @static - * @param {google.protobuf.ListValue} message ListValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListValue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.values = []; - if (message.values && message.values.length) { - object.values = []; - for (var j = 0; j < message.values.length; ++j) - object.values[j] = $root.google.protobuf.Value.toObject(message.values[j], options); - } - return object; - }; - - /** - * Converts this ListValue to JSON. - * @function toJSON - * @memberof google.protobuf.ListValue - * @instance - * @returns {Object.} JSON object - */ - ListValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListValue - * @function getTypeUrl - * @memberof google.protobuf.ListValue - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.ListValue"; - }; - - return ListValue; - })(); - - return protobuf; - })(); - - google.longrunning = (function() { - - /** - * Namespace longrunning. - * @memberof google - * @namespace - */ - var longrunning = {}; - - longrunning.Operations = (function() { - - /** - * Constructs a new Operations service. - * @memberof google.longrunning - * @classdesc Represents an Operations - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function Operations(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (Operations.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Operations; - - /** - * Creates new Operations service using the specified rpc implementation. - * @function create - * @memberof google.longrunning.Operations - * @static - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - * @returns {Operations} RPC service. Useful where requests and/or responses are streamed. - */ - Operations.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.longrunning.Operations|listOperations}. - * @memberof google.longrunning.Operations - * @typedef ListOperationsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.ListOperationsResponse} [response] ListOperationsResponse - */ - - /** - * Calls ListOperations. - * @function listOperations - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object - * @param {google.longrunning.Operations.ListOperationsCallback} callback Node-style callback called with the error, if any, and ListOperationsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Operations.prototype.listOperations = function listOperations(request, callback) { - return this.rpcCall(listOperations, $root.google.longrunning.ListOperationsRequest, $root.google.longrunning.ListOperationsResponse, request, callback); - }, "name", { value: "ListOperations" }); - - /** - * Calls ListOperations. - * @function listOperations - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.longrunning.Operations|getOperation}. - * @memberof google.longrunning.Operations - * @typedef GetOperationCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls GetOperation. - * @function getOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object - * @param {google.longrunning.Operations.GetOperationCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Operations.prototype.getOperation = function getOperation(request, callback) { - return this.rpcCall(getOperation, $root.google.longrunning.GetOperationRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "GetOperation" }); - - /** - * Calls GetOperation. - * @function getOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.longrunning.Operations|deleteOperation}. - * @memberof google.longrunning.Operations - * @typedef DeleteOperationCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteOperation. - * @function deleteOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object - * @param {google.longrunning.Operations.DeleteOperationCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Operations.prototype.deleteOperation = function deleteOperation(request, callback) { - return this.rpcCall(deleteOperation, $root.google.longrunning.DeleteOperationRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteOperation" }); - - /** - * Calls DeleteOperation. - * @function deleteOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.longrunning.Operations|cancelOperation}. - * @memberof google.longrunning.Operations - * @typedef CancelOperationCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls CancelOperation. - * @function cancelOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object - * @param {google.longrunning.Operations.CancelOperationCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Operations.prototype.cancelOperation = function cancelOperation(request, callback) { - return this.rpcCall(cancelOperation, $root.google.longrunning.CancelOperationRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "CancelOperation" }); - - /** - * Calls CancelOperation. - * @function cancelOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.longrunning.Operations|waitOperation}. - * @memberof google.longrunning.Operations - * @typedef WaitOperationCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls WaitOperation. - * @function waitOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object - * @param {google.longrunning.Operations.WaitOperationCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Operations.prototype.waitOperation = function waitOperation(request, callback) { - return this.rpcCall(waitOperation, $root.google.longrunning.WaitOperationRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "WaitOperation" }); - - /** - * Calls WaitOperation. - * @function waitOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return Operations; - })(); - - longrunning.Operation = (function() { - - /** - * Properties of an Operation. - * @memberof google.longrunning - * @interface IOperation - * @property {string|null} [name] Operation name - * @property {google.protobuf.IAny|null} [metadata] Operation metadata - * @property {boolean|null} [done] Operation done - * @property {google.rpc.IStatus|null} [error] Operation error - * @property {google.protobuf.IAny|null} [response] Operation response - */ - - /** - * Constructs a new Operation. - * @memberof google.longrunning - * @classdesc Represents an Operation. - * @implements IOperation - * @constructor - * @param {google.longrunning.IOperation=} [properties] Properties to set - */ - function Operation(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Operation name. - * @member {string} name - * @memberof google.longrunning.Operation - * @instance - */ - Operation.prototype.name = ""; - - /** - * Operation metadata. - * @member {google.protobuf.IAny|null|undefined} metadata - * @memberof google.longrunning.Operation - * @instance - */ - Operation.prototype.metadata = null; - - /** - * Operation done. - * @member {boolean} done - * @memberof google.longrunning.Operation - * @instance - */ - Operation.prototype.done = false; - - /** - * Operation error. - * @member {google.rpc.IStatus|null|undefined} error - * @memberof google.longrunning.Operation - * @instance - */ - Operation.prototype.error = null; - - /** - * Operation response. - * @member {google.protobuf.IAny|null|undefined} response - * @memberof google.longrunning.Operation - * @instance - */ - Operation.prototype.response = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Operation result. - * @member {"error"|"response"|undefined} result - * @memberof google.longrunning.Operation - * @instance - */ - Object.defineProperty(Operation.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["error", "response"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Operation instance using the specified properties. - * @function create - * @memberof google.longrunning.Operation - * @static - * @param {google.longrunning.IOperation=} [properties] Properties to set - * @returns {google.longrunning.Operation} Operation instance - */ - Operation.create = function create(properties) { - return new Operation(properties); - }; - - /** - * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. - * @function encode - * @memberof google.longrunning.Operation - * @static - * @param {google.longrunning.IOperation} message Operation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Operation.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.google.protobuf.Any.encode(message.metadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.done != null && Object.hasOwnProperty.call(message, "done")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.done); - if (message.error != null && Object.hasOwnProperty.call(message, "error")) - $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.response != null && Object.hasOwnProperty.call(message, "response")) - $root.google.protobuf.Any.encode(message.response, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.Operation - * @static - * @param {google.longrunning.IOperation} message Operation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Operation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Operation message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.Operation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.Operation} Operation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Operation.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.Operation(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.metadata = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - } - case 3: { - message.done = reader.bool(); - break; - } - case 4: { - message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); - break; - } - case 5: { - message.response = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Operation message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.Operation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.Operation} Operation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Operation.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Operation message. - * @function verify - * @memberof google.longrunning.Operation - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Operation.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.google.protobuf.Any.verify(message.metadata); - if (error) - return "metadata." + error; - } - if (message.done != null && message.hasOwnProperty("done")) - if (typeof message.done !== "boolean") - return "done: boolean expected"; - if (message.error != null && message.hasOwnProperty("error")) { - properties.result = 1; - { - var error = $root.google.rpc.Status.verify(message.error); - if (error) - return "error." + error; - } - } - if (message.response != null && message.hasOwnProperty("response")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.google.protobuf.Any.verify(message.response); - if (error) - return "response." + error; - } - } - return null; - }; - - /** - * Creates an Operation message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.Operation - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.Operation} Operation - */ - Operation.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.Operation) - return object; - var message = new $root.google.longrunning.Operation(); - if (object.name != null) - message.name = String(object.name); - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".google.longrunning.Operation.metadata: object expected"); - message.metadata = $root.google.protobuf.Any.fromObject(object.metadata); - } - if (object.done != null) - message.done = Boolean(object.done); - if (object.error != null) { - if (typeof object.error !== "object") - throw TypeError(".google.longrunning.Operation.error: object expected"); - message.error = $root.google.rpc.Status.fromObject(object.error); - } - if (object.response != null) { - if (typeof object.response !== "object") - throw TypeError(".google.longrunning.Operation.response: object expected"); - message.response = $root.google.protobuf.Any.fromObject(object.response); - } - return message; - }; - - /** - * Creates a plain object from an Operation message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.Operation - * @static - * @param {google.longrunning.Operation} message Operation - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Operation.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.metadata = null; - object.done = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.google.protobuf.Any.toObject(message.metadata, options); - if (message.done != null && message.hasOwnProperty("done")) - object.done = message.done; - if (message.error != null && message.hasOwnProperty("error")) { - object.error = $root.google.rpc.Status.toObject(message.error, options); - if (options.oneofs) - object.result = "error"; - } - if (message.response != null && message.hasOwnProperty("response")) { - object.response = $root.google.protobuf.Any.toObject(message.response, options); - if (options.oneofs) - object.result = "response"; - } - return object; - }; - - /** - * Converts this Operation to JSON. - * @function toJSON - * @memberof google.longrunning.Operation - * @instance - * @returns {Object.} JSON object - */ - Operation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Operation - * @function getTypeUrl - * @memberof google.longrunning.Operation - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Operation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.Operation"; - }; - - return Operation; - })(); - - longrunning.GetOperationRequest = (function() { - - /** - * Properties of a GetOperationRequest. - * @memberof google.longrunning - * @interface IGetOperationRequest - * @property {string|null} [name] GetOperationRequest name - */ - - /** - * Constructs a new GetOperationRequest. - * @memberof google.longrunning - * @classdesc Represents a GetOperationRequest. - * @implements IGetOperationRequest - * @constructor - * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set - */ - function GetOperationRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetOperationRequest name. - * @member {string} name - * @memberof google.longrunning.GetOperationRequest - * @instance - */ - GetOperationRequest.prototype.name = ""; - - /** - * Creates a new GetOperationRequest instance using the specified properties. - * @function create - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set - * @returns {google.longrunning.GetOperationRequest} GetOperationRequest instance - */ - GetOperationRequest.create = function create(properties) { - return new GetOperationRequest(properties); - }; - - /** - * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. - * @function encode - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetOperationRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; - - /** - * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetOperationRequest message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.GetOperationRequest} GetOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetOperationRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.GetOperationRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.GetOperationRequest} GetOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetOperationRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetOperationRequest message. - * @function verify - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetOperationRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; - - /** - * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.GetOperationRequest} GetOperationRequest - */ - GetOperationRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.GetOperationRequest) - return object; - var message = new $root.google.longrunning.GetOperationRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {google.longrunning.GetOperationRequest} message GetOperationRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetOperationRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; - - /** - * Converts this GetOperationRequest to JSON. - * @function toJSON - * @memberof google.longrunning.GetOperationRequest - * @instance - * @returns {Object.} JSON object - */ - GetOperationRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetOperationRequest - * @function getTypeUrl - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.GetOperationRequest"; - }; - - return GetOperationRequest; - })(); - - longrunning.ListOperationsRequest = (function() { - - /** - * Properties of a ListOperationsRequest. - * @memberof google.longrunning - * @interface IListOperationsRequest - * @property {string|null} [name] ListOperationsRequest name - * @property {string|null} [filter] ListOperationsRequest filter - * @property {number|null} [pageSize] ListOperationsRequest pageSize - * @property {string|null} [pageToken] ListOperationsRequest pageToken - */ - - /** - * Constructs a new ListOperationsRequest. - * @memberof google.longrunning - * @classdesc Represents a ListOperationsRequest. - * @implements IListOperationsRequest - * @constructor - * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set - */ - function ListOperationsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListOperationsRequest name. - * @member {string} name - * @memberof google.longrunning.ListOperationsRequest - * @instance - */ - ListOperationsRequest.prototype.name = ""; - - /** - * ListOperationsRequest filter. - * @member {string} filter - * @memberof google.longrunning.ListOperationsRequest - * @instance - */ - ListOperationsRequest.prototype.filter = ""; - - /** - * ListOperationsRequest pageSize. - * @member {number} pageSize - * @memberof google.longrunning.ListOperationsRequest - * @instance - */ - ListOperationsRequest.prototype.pageSize = 0; - - /** - * ListOperationsRequest pageToken. - * @member {string} pageToken - * @memberof google.longrunning.ListOperationsRequest - * @instance - */ - ListOperationsRequest.prototype.pageToken = ""; - - /** - * Creates a new ListOperationsRequest instance using the specified properties. - * @function create - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set - * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest instance - */ - ListOperationsRequest.create = function create(properties) { - return new ListOperationsRequest(properties); - }; - - /** - * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. - * @function encode - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListOperationsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); - return writer; - }; - - /** - * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListOperationsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListOperationsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 4: { - message.name = reader.string(); - break; - } - case 1: { - message.filter = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListOperationsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListOperationsRequest message. - * @function verify - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListOperationsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - return null; - }; - - /** - * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest - */ - ListOperationsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.ListOperationsRequest) - return object; - var message = new $root.google.longrunning.ListOperationsRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.filter != null) - message.filter = String(object.filter); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - return message; - }; - - /** - * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {google.longrunning.ListOperationsRequest} message ListOperationsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListOperationsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.filter = ""; - object.pageSize = 0; - object.pageToken = ""; - object.name = ""; - } - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; - - /** - * Converts this ListOperationsRequest to JSON. - * @function toJSON - * @memberof google.longrunning.ListOperationsRequest - * @instance - * @returns {Object.} JSON object - */ - ListOperationsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListOperationsRequest - * @function getTypeUrl - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListOperationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.ListOperationsRequest"; - }; - - return ListOperationsRequest; - })(); - - longrunning.ListOperationsResponse = (function() { - - /** - * Properties of a ListOperationsResponse. - * @memberof google.longrunning - * @interface IListOperationsResponse - * @property {Array.|null} [operations] ListOperationsResponse operations - * @property {string|null} [nextPageToken] ListOperationsResponse nextPageToken - */ - - /** - * Constructs a new ListOperationsResponse. - * @memberof google.longrunning - * @classdesc Represents a ListOperationsResponse. - * @implements IListOperationsResponse - * @constructor - * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set - */ - function ListOperationsResponse(properties) { - this.operations = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListOperationsResponse operations. - * @member {Array.} operations - * @memberof google.longrunning.ListOperationsResponse - * @instance - */ - ListOperationsResponse.prototype.operations = $util.emptyArray; - - /** - * ListOperationsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.longrunning.ListOperationsResponse - * @instance - */ - ListOperationsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListOperationsResponse instance using the specified properties. - * @function create - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set - * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse instance - */ - ListOperationsResponse.create = function create(properties) { - return new ListOperationsResponse(properties); - }; - - /** - * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. - * @function encode - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListOperationsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.operations != null && message.operations.length) - for (var i = 0; i < message.operations.length; ++i) - $root.google.longrunning.Operation.encode(message.operations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - return writer; - }; - - /** - * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListOperationsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListOperationsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListOperationsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.operations && message.operations.length)) - message.operations = []; - message.operations.push($root.google.longrunning.Operation.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListOperationsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListOperationsResponse message. - * @function verify - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListOperationsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.operations != null && message.hasOwnProperty("operations")) { - if (!Array.isArray(message.operations)) - return "operations: array expected"; - for (var i = 0; i < message.operations.length; ++i) { - var error = $root.google.longrunning.Operation.verify(message.operations[i]); - if (error) - return "operations." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse - */ - ListOperationsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.ListOperationsResponse) - return object; - var message = new $root.google.longrunning.ListOperationsResponse(); - if (object.operations) { - if (!Array.isArray(object.operations)) - throw TypeError(".google.longrunning.ListOperationsResponse.operations: array expected"); - message.operations = []; - for (var i = 0; i < object.operations.length; ++i) { - if (typeof object.operations[i] !== "object") - throw TypeError(".google.longrunning.ListOperationsResponse.operations: object expected"); - message.operations[i] = $root.google.longrunning.Operation.fromObject(object.operations[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {google.longrunning.ListOperationsResponse} message ListOperationsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListOperationsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.operations = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.operations && message.operations.length) { - object.operations = []; - for (var j = 0; j < message.operations.length; ++j) - object.operations[j] = $root.google.longrunning.Operation.toObject(message.operations[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListOperationsResponse to JSON. - * @function toJSON - * @memberof google.longrunning.ListOperationsResponse - * @instance - * @returns {Object.} JSON object - */ - ListOperationsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListOperationsResponse - * @function getTypeUrl - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListOperationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.ListOperationsResponse"; - }; - - return ListOperationsResponse; - })(); - - longrunning.CancelOperationRequest = (function() { - - /** - * Properties of a CancelOperationRequest. - * @memberof google.longrunning - * @interface ICancelOperationRequest - * @property {string|null} [name] CancelOperationRequest name - */ - - /** - * Constructs a new CancelOperationRequest. - * @memberof google.longrunning - * @classdesc Represents a CancelOperationRequest. - * @implements ICancelOperationRequest - * @constructor - * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set - */ - function CancelOperationRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CancelOperationRequest name. - * @member {string} name - * @memberof google.longrunning.CancelOperationRequest - * @instance - */ - CancelOperationRequest.prototype.name = ""; - - /** - * Creates a new CancelOperationRequest instance using the specified properties. - * @function create - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set - * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest instance - */ - CancelOperationRequest.create = function create(properties) { - return new CancelOperationRequest(properties); - }; - - /** - * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. - * @function encode - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CancelOperationRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; - - /** - * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CancelOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CancelOperationRequest message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CancelOperationRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.CancelOperationRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CancelOperationRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CancelOperationRequest message. - * @function verify - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CancelOperationRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; - - /** - * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest - */ - CancelOperationRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.CancelOperationRequest) - return object; - var message = new $root.google.longrunning.CancelOperationRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {google.longrunning.CancelOperationRequest} message CancelOperationRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CancelOperationRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; - - /** - * Converts this CancelOperationRequest to JSON. - * @function toJSON - * @memberof google.longrunning.CancelOperationRequest - * @instance - * @returns {Object.} JSON object - */ - CancelOperationRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CancelOperationRequest - * @function getTypeUrl - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CancelOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.CancelOperationRequest"; - }; - - return CancelOperationRequest; - })(); - - longrunning.DeleteOperationRequest = (function() { - - /** - * Properties of a DeleteOperationRequest. - * @memberof google.longrunning - * @interface IDeleteOperationRequest - * @property {string|null} [name] DeleteOperationRequest name - */ - - /** - * Constructs a new DeleteOperationRequest. - * @memberof google.longrunning - * @classdesc Represents a DeleteOperationRequest. - * @implements IDeleteOperationRequest - * @constructor - * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set - */ - function DeleteOperationRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteOperationRequest name. - * @member {string} name - * @memberof google.longrunning.DeleteOperationRequest - * @instance - */ - DeleteOperationRequest.prototype.name = ""; - - /** - * Creates a new DeleteOperationRequest instance using the specified properties. - * @function create - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set - * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest instance - */ - DeleteOperationRequest.create = function create(properties) { - return new DeleteOperationRequest(properties); - }; - - /** - * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. - * @function encode - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteOperationRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; - - /** - * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteOperationRequest message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteOperationRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.DeleteOperationRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteOperationRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteOperationRequest message. - * @function verify - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteOperationRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; - - /** - * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest - */ - DeleteOperationRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.DeleteOperationRequest) - return object; - var message = new $root.google.longrunning.DeleteOperationRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {google.longrunning.DeleteOperationRequest} message DeleteOperationRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteOperationRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; - - /** - * Converts this DeleteOperationRequest to JSON. - * @function toJSON - * @memberof google.longrunning.DeleteOperationRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteOperationRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteOperationRequest - * @function getTypeUrl - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.DeleteOperationRequest"; - }; - - return DeleteOperationRequest; - })(); - - longrunning.WaitOperationRequest = (function() { - - /** - * Properties of a WaitOperationRequest. - * @memberof google.longrunning - * @interface IWaitOperationRequest - * @property {string|null} [name] WaitOperationRequest name - * @property {google.protobuf.IDuration|null} [timeout] WaitOperationRequest timeout - */ - - /** - * Constructs a new WaitOperationRequest. - * @memberof google.longrunning - * @classdesc Represents a WaitOperationRequest. - * @implements IWaitOperationRequest - * @constructor - * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set - */ - function WaitOperationRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * WaitOperationRequest name. - * @member {string} name - * @memberof google.longrunning.WaitOperationRequest - * @instance - */ - WaitOperationRequest.prototype.name = ""; - - /** - * WaitOperationRequest timeout. - * @member {google.protobuf.IDuration|null|undefined} timeout - * @memberof google.longrunning.WaitOperationRequest - * @instance - */ - WaitOperationRequest.prototype.timeout = null; - - /** - * Creates a new WaitOperationRequest instance using the specified properties. - * @function create - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set - * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest instance - */ - WaitOperationRequest.create = function create(properties) { - return new WaitOperationRequest(properties); - }; - - /** - * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. - * @function encode - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WaitOperationRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) - $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WaitOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a WaitOperationRequest message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WaitOperationRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.WaitOperationRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WaitOperationRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a WaitOperationRequest message. - * @function verify - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - WaitOperationRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.timeout != null && message.hasOwnProperty("timeout")) { - var error = $root.google.protobuf.Duration.verify(message.timeout); - if (error) - return "timeout." + error; - } - return null; - }; - - /** - * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest - */ - WaitOperationRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.WaitOperationRequest) - return object; - var message = new $root.google.longrunning.WaitOperationRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.timeout != null) { - if (typeof object.timeout !== "object") - throw TypeError(".google.longrunning.WaitOperationRequest.timeout: object expected"); - message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); - } - return message; - }; - - /** - * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {google.longrunning.WaitOperationRequest} message WaitOperationRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - WaitOperationRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.timeout = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.timeout != null && message.hasOwnProperty("timeout")) - object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); - return object; - }; - - /** - * Converts this WaitOperationRequest to JSON. - * @function toJSON - * @memberof google.longrunning.WaitOperationRequest - * @instance - * @returns {Object.} JSON object - */ - WaitOperationRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for WaitOperationRequest - * @function getTypeUrl - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - WaitOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.WaitOperationRequest"; - }; - - return WaitOperationRequest; - })(); - - longrunning.OperationInfo = (function() { - - /** - * Properties of an OperationInfo. - * @memberof google.longrunning - * @interface IOperationInfo - * @property {string|null} [responseType] OperationInfo responseType - * @property {string|null} [metadataType] OperationInfo metadataType - */ - - /** - * Constructs a new OperationInfo. - * @memberof google.longrunning - * @classdesc Represents an OperationInfo. - * @implements IOperationInfo - * @constructor - * @param {google.longrunning.IOperationInfo=} [properties] Properties to set - */ - function OperationInfo(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * OperationInfo responseType. - * @member {string} responseType - * @memberof google.longrunning.OperationInfo - * @instance - */ - OperationInfo.prototype.responseType = ""; - - /** - * OperationInfo metadataType. - * @member {string} metadataType - * @memberof google.longrunning.OperationInfo - * @instance - */ - OperationInfo.prototype.metadataType = ""; - - /** - * Creates a new OperationInfo instance using the specified properties. - * @function create - * @memberof google.longrunning.OperationInfo - * @static - * @param {google.longrunning.IOperationInfo=} [properties] Properties to set - * @returns {google.longrunning.OperationInfo} OperationInfo instance - */ - OperationInfo.create = function create(properties) { - return new OperationInfo(properties); - }; - - /** - * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. - * @function encode - * @memberof google.longrunning.OperationInfo - * @static - * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OperationInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.responseType != null && Object.hasOwnProperty.call(message, "responseType")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseType); - if (message.metadataType != null && Object.hasOwnProperty.call(message, "metadataType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.metadataType); - return writer; - }; - - /** - * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.OperationInfo - * @static - * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OperationInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OperationInfo message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.OperationInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.OperationInfo} OperationInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OperationInfo.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.OperationInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.responseType = reader.string(); - break; - } - case 2: { - message.metadataType = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OperationInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.OperationInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.OperationInfo} OperationInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OperationInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OperationInfo message. - * @function verify - * @memberof google.longrunning.OperationInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OperationInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.responseType != null && message.hasOwnProperty("responseType")) - if (!$util.isString(message.responseType)) - return "responseType: string expected"; - if (message.metadataType != null && message.hasOwnProperty("metadataType")) - if (!$util.isString(message.metadataType)) - return "metadataType: string expected"; - return null; - }; - - /** - * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.OperationInfo - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.OperationInfo} OperationInfo - */ - OperationInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.OperationInfo) - return object; - var message = new $root.google.longrunning.OperationInfo(); - if (object.responseType != null) - message.responseType = String(object.responseType); - if (object.metadataType != null) - message.metadataType = String(object.metadataType); - return message; - }; - - /** - * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.OperationInfo - * @static - * @param {google.longrunning.OperationInfo} message OperationInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OperationInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.responseType = ""; - object.metadataType = ""; - } - if (message.responseType != null && message.hasOwnProperty("responseType")) - object.responseType = message.responseType; - if (message.metadataType != null && message.hasOwnProperty("metadataType")) - object.metadataType = message.metadataType; - return object; - }; - - /** - * Converts this OperationInfo to JSON. - * @function toJSON - * @memberof google.longrunning.OperationInfo - * @instance - * @returns {Object.} JSON object - */ - OperationInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OperationInfo - * @function getTypeUrl - * @memberof google.longrunning.OperationInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OperationInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.OperationInfo"; - }; - - return OperationInfo; - })(); - - return longrunning; - })(); - - google.rpc = (function() { - - /** - * Namespace rpc. - * @memberof google - * @namespace - */ - var rpc = {}; - - rpc.Status = (function() { - - /** - * Properties of a Status. - * @memberof google.rpc - * @interface IStatus - * @property {number|null} [code] Status code - * @property {string|null} [message] Status message - * @property {Array.|null} [details] Status details - */ - - /** - * Constructs a new Status. - * @memberof google.rpc - * @classdesc Represents a Status. - * @implements IStatus - * @constructor - * @param {google.rpc.IStatus=} [properties] Properties to set - */ - function Status(properties) { - this.details = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Status code. - * @member {number} code - * @memberof google.rpc.Status - * @instance - */ - Status.prototype.code = 0; - - /** - * Status message. - * @member {string} message - * @memberof google.rpc.Status - * @instance - */ - Status.prototype.message = ""; - - /** - * Status details. - * @member {Array.} details - * @memberof google.rpc.Status - * @instance - */ - Status.prototype.details = $util.emptyArray; - - /** - * Creates a new Status instance using the specified properties. - * @function create - * @memberof google.rpc.Status - * @static - * @param {google.rpc.IStatus=} [properties] Properties to set - * @returns {google.rpc.Status} Status instance - */ - Status.create = function create(properties) { - return new Status(properties); - }; - - /** - * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. - * @function encode - * @memberof google.rpc.Status - * @static - * @param {google.rpc.IStatus} message Status message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Status.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.code != null && Object.hasOwnProperty.call(message, "code")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); - if (message.message != null && Object.hasOwnProperty.call(message, "message")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); - if (message.details != null && message.details.length) - for (var i = 0; i < message.details.length; ++i) - $root.google.protobuf.Any.encode(message.details[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. - * @function encodeDelimited - * @memberof google.rpc.Status - * @static - * @param {google.rpc.IStatus} message Status message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Status.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Status message from the specified reader or buffer. - * @function decode - * @memberof google.rpc.Status - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.rpc.Status} Status - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Status.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.rpc.Status(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.code = reader.int32(); - break; - } - case 2: { - message.message = reader.string(); - break; - } - case 3: { - if (!(message.details && message.details.length)) - message.details = []; - message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Status message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.rpc.Status - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.rpc.Status} Status - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Status.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Status message. - * @function verify - * @memberof google.rpc.Status - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Status.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.code != null && message.hasOwnProperty("code")) - if (!$util.isInteger(message.code)) - return "code: integer expected"; - if (message.message != null && message.hasOwnProperty("message")) - if (!$util.isString(message.message)) - return "message: string expected"; - if (message.details != null && message.hasOwnProperty("details")) { - if (!Array.isArray(message.details)) - return "details: array expected"; - for (var i = 0; i < message.details.length; ++i) { - var error = $root.google.protobuf.Any.verify(message.details[i]); - if (error) - return "details." + error; - } - } - return null; - }; - - /** - * Creates a Status message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.rpc.Status - * @static - * @param {Object.} object Plain object - * @returns {google.rpc.Status} Status - */ - Status.fromObject = function fromObject(object) { - if (object instanceof $root.google.rpc.Status) - return object; - var message = new $root.google.rpc.Status(); - if (object.code != null) - message.code = object.code | 0; - if (object.message != null) - message.message = String(object.message); - if (object.details) { - if (!Array.isArray(object.details)) - throw TypeError(".google.rpc.Status.details: array expected"); - message.details = []; - for (var i = 0; i < object.details.length; ++i) { - if (typeof object.details[i] !== "object") - throw TypeError(".google.rpc.Status.details: object expected"); - message.details[i] = $root.google.protobuf.Any.fromObject(object.details[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a Status message. Also converts values to other types if specified. - * @function toObject - * @memberof google.rpc.Status - * @static - * @param {google.rpc.Status} message Status - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Status.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.details = []; - if (options.defaults) { - object.code = 0; - object.message = ""; - } - if (message.code != null && message.hasOwnProperty("code")) - object.code = message.code; - if (message.message != null && message.hasOwnProperty("message")) - object.message = message.message; - if (message.details && message.details.length) { - object.details = []; - for (var j = 0; j < message.details.length; ++j) - object.details[j] = $root.google.protobuf.Any.toObject(message.details[j], options); - } - return object; - }; - - /** - * Converts this Status to JSON. - * @function toJSON - * @memberof google.rpc.Status - * @instance - * @returns {Object.} JSON object - */ - Status.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Status - * @function getTypeUrl - * @memberof google.rpc.Status - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Status.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.rpc.Status"; - }; - - return Status; - })(); - - return rpc; - })(); - - google.iam = (function() { - - /** - * Namespace iam. - * @memberof google - * @namespace - */ - var iam = {}; - - iam.v1 = (function() { - - /** - * Namespace v1. - * @memberof google.iam - * @namespace - */ - var v1 = {}; - - v1.IAMPolicy = (function() { - - /** - * Constructs a new IAMPolicy service. - * @memberof google.iam.v1 - * @classdesc Represents a IAMPolicy - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function IAMPolicy(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (IAMPolicy.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = IAMPolicy; - - /** - * Creates new IAMPolicy service using the specified rpc implementation. - * @function create - * @memberof google.iam.v1.IAMPolicy - * @static - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - * @returns {IAMPolicy} RPC service. Useful where requests and/or responses are streamed. - */ - IAMPolicy.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.iam.v1.IAMPolicy|setIamPolicy}. - * @memberof google.iam.v1.IAMPolicy - * @typedef SetIamPolicyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.iam.v1.Policy} [response] Policy - */ - - /** - * Calls SetIamPolicy. - * @function setIamPolicy - * @memberof google.iam.v1.IAMPolicy - * @instance - * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object - * @param {google.iam.v1.IAMPolicy.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(IAMPolicy.prototype.setIamPolicy = function setIamPolicy(request, callback) { - return this.rpcCall(setIamPolicy, $root.google.iam.v1.SetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); - }, "name", { value: "SetIamPolicy" }); - - /** - * Calls SetIamPolicy. - * @function setIamPolicy - * @memberof google.iam.v1.IAMPolicy - * @instance - * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.iam.v1.IAMPolicy|getIamPolicy}. - * @memberof google.iam.v1.IAMPolicy - * @typedef GetIamPolicyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.iam.v1.Policy} [response] Policy - */ - - /** - * Calls GetIamPolicy. - * @function getIamPolicy - * @memberof google.iam.v1.IAMPolicy - * @instance - * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object - * @param {google.iam.v1.IAMPolicy.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(IAMPolicy.prototype.getIamPolicy = function getIamPolicy(request, callback) { - return this.rpcCall(getIamPolicy, $root.google.iam.v1.GetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); - }, "name", { value: "GetIamPolicy" }); - - /** - * Calls GetIamPolicy. - * @function getIamPolicy - * @memberof google.iam.v1.IAMPolicy - * @instance - * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.iam.v1.IAMPolicy|testIamPermissions}. - * @memberof google.iam.v1.IAMPolicy - * @typedef TestIamPermissionsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.iam.v1.TestIamPermissionsResponse} [response] TestIamPermissionsResponse - */ - - /** - * Calls TestIamPermissions. - * @function testIamPermissions - * @memberof google.iam.v1.IAMPolicy - * @instance - * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object - * @param {google.iam.v1.IAMPolicy.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestIamPermissionsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(IAMPolicy.prototype.testIamPermissions = function testIamPermissions(request, callback) { - return this.rpcCall(testIamPermissions, $root.google.iam.v1.TestIamPermissionsRequest, $root.google.iam.v1.TestIamPermissionsResponse, request, callback); - }, "name", { value: "TestIamPermissions" }); - - /** - * Calls TestIamPermissions. - * @function testIamPermissions - * @memberof google.iam.v1.IAMPolicy - * @instance - * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return IAMPolicy; - })(); - - v1.SetIamPolicyRequest = (function() { - - /** - * Properties of a SetIamPolicyRequest. - * @memberof google.iam.v1 - * @interface ISetIamPolicyRequest - * @property {string|null} [resource] SetIamPolicyRequest resource - * @property {google.iam.v1.IPolicy|null} [policy] SetIamPolicyRequest policy - * @property {google.protobuf.IFieldMask|null} [updateMask] SetIamPolicyRequest updateMask - */ - - /** - * Constructs a new SetIamPolicyRequest. - * @memberof google.iam.v1 - * @classdesc Represents a SetIamPolicyRequest. - * @implements ISetIamPolicyRequest - * @constructor - * @param {google.iam.v1.ISetIamPolicyRequest=} [properties] Properties to set - */ - function SetIamPolicyRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SetIamPolicyRequest resource. - * @member {string} resource - * @memberof google.iam.v1.SetIamPolicyRequest - * @instance - */ - SetIamPolicyRequest.prototype.resource = ""; - - /** - * SetIamPolicyRequest policy. - * @member {google.iam.v1.IPolicy|null|undefined} policy - * @memberof google.iam.v1.SetIamPolicyRequest - * @instance - */ - SetIamPolicyRequest.prototype.policy = null; - - /** - * SetIamPolicyRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.iam.v1.SetIamPolicyRequest - * @instance - */ - SetIamPolicyRequest.prototype.updateMask = null; - - /** - * Creates a new SetIamPolicyRequest instance using the specified properties. - * @function create - * @memberof google.iam.v1.SetIamPolicyRequest - * @static - * @param {google.iam.v1.ISetIamPolicyRequest=} [properties] Properties to set - * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest instance - */ - SetIamPolicyRequest.create = function create(properties) { - return new SetIamPolicyRequest(properties); - }; - - /** - * Encodes the specified SetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. - * @function encode - * @memberof google.iam.v1.SetIamPolicyRequest - * @static - * @param {google.iam.v1.ISetIamPolicyRequest} message SetIamPolicyRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SetIamPolicyRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); - if (message.policy != null && Object.hasOwnProperty.call(message, "policy")) - $root.google.iam.v1.Policy.encode(message.policy, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified SetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.iam.v1.SetIamPolicyRequest - * @static - * @param {google.iam.v1.ISetIamPolicyRequest} message SetIamPolicyRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SetIamPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SetIamPolicyRequest message from the specified reader or buffer. - * @function decode - * @memberof google.iam.v1.SetIamPolicyRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SetIamPolicyRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.SetIamPolicyRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.resource = reader.string(); - break; - } - case 2: { - message.policy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); - break; - } - case 3: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SetIamPolicyRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.iam.v1.SetIamPolicyRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SetIamPolicyRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SetIamPolicyRequest message. - * @function verify - * @memberof google.iam.v1.SetIamPolicyRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SetIamPolicyRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.resource != null && message.hasOwnProperty("resource")) - if (!$util.isString(message.resource)) - return "resource: string expected"; - if (message.policy != null && message.hasOwnProperty("policy")) { - var error = $root.google.iam.v1.Policy.verify(message.policy); - if (error) - return "policy." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - return null; - }; - - /** - * Creates a SetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.iam.v1.SetIamPolicyRequest - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest - */ - SetIamPolicyRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.SetIamPolicyRequest) - return object; - var message = new $root.google.iam.v1.SetIamPolicyRequest(); - if (object.resource != null) - message.resource = String(object.resource); - if (object.policy != null) { - if (typeof object.policy !== "object") - throw TypeError(".google.iam.v1.SetIamPolicyRequest.policy: object expected"); - message.policy = $root.google.iam.v1.Policy.fromObject(object.policy); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.iam.v1.SetIamPolicyRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - return message; - }; - - /** - * Creates a plain object from a SetIamPolicyRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.iam.v1.SetIamPolicyRequest - * @static - * @param {google.iam.v1.SetIamPolicyRequest} message SetIamPolicyRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SetIamPolicyRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.resource = ""; - object.policy = null; - object.updateMask = null; - } - if (message.resource != null && message.hasOwnProperty("resource")) - object.resource = message.resource; - if (message.policy != null && message.hasOwnProperty("policy")) - object.policy = $root.google.iam.v1.Policy.toObject(message.policy, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - return object; - }; - - /** - * Converts this SetIamPolicyRequest to JSON. - * @function toJSON - * @memberof google.iam.v1.SetIamPolicyRequest - * @instance - * @returns {Object.} JSON object - */ - SetIamPolicyRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SetIamPolicyRequest - * @function getTypeUrl - * @memberof google.iam.v1.SetIamPolicyRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SetIamPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.iam.v1.SetIamPolicyRequest"; - }; - - return SetIamPolicyRequest; - })(); - - v1.GetIamPolicyRequest = (function() { - - /** - * Properties of a GetIamPolicyRequest. - * @memberof google.iam.v1 - * @interface IGetIamPolicyRequest - * @property {string|null} [resource] GetIamPolicyRequest resource - * @property {google.iam.v1.IGetPolicyOptions|null} [options] GetIamPolicyRequest options - */ - - /** - * Constructs a new GetIamPolicyRequest. - * @memberof google.iam.v1 - * @classdesc Represents a GetIamPolicyRequest. - * @implements IGetIamPolicyRequest - * @constructor - * @param {google.iam.v1.IGetIamPolicyRequest=} [properties] Properties to set - */ - function GetIamPolicyRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIamPolicyRequest resource. - * @member {string} resource - * @memberof google.iam.v1.GetIamPolicyRequest - * @instance - */ - GetIamPolicyRequest.prototype.resource = ""; - - /** - * GetIamPolicyRequest options. - * @member {google.iam.v1.IGetPolicyOptions|null|undefined} options - * @memberof google.iam.v1.GetIamPolicyRequest - * @instance - */ - GetIamPolicyRequest.prototype.options = null; - - /** - * Creates a new GetIamPolicyRequest instance using the specified properties. - * @function create - * @memberof google.iam.v1.GetIamPolicyRequest - * @static - * @param {google.iam.v1.IGetIamPolicyRequest=} [properties] Properties to set - * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest instance - */ - GetIamPolicyRequest.create = function create(properties) { - return new GetIamPolicyRequest(properties); - }; - - /** - * Encodes the specified GetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. - * @function encode - * @memberof google.iam.v1.GetIamPolicyRequest - * @static - * @param {google.iam.v1.IGetIamPolicyRequest} message GetIamPolicyRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIamPolicyRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.iam.v1.GetPolicyOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.iam.v1.GetIamPolicyRequest - * @static - * @param {google.iam.v1.IGetIamPolicyRequest} message GetIamPolicyRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIamPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIamPolicyRequest message from the specified reader or buffer. - * @function decode - * @memberof google.iam.v1.GetIamPolicyRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIamPolicyRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.GetIamPolicyRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.resource = reader.string(); - break; - } - case 2: { - message.options = $root.google.iam.v1.GetPolicyOptions.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIamPolicyRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.iam.v1.GetIamPolicyRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIamPolicyRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIamPolicyRequest message. - * @function verify - * @memberof google.iam.v1.GetIamPolicyRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIamPolicyRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.resource != null && message.hasOwnProperty("resource")) - if (!$util.isString(message.resource)) - return "resource: string expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.iam.v1.GetPolicyOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates a GetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.iam.v1.GetIamPolicyRequest - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest - */ - GetIamPolicyRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.GetIamPolicyRequest) - return object; - var message = new $root.google.iam.v1.GetIamPolicyRequest(); - if (object.resource != null) - message.resource = String(object.resource); - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.iam.v1.GetIamPolicyRequest.options: object expected"); - message.options = $root.google.iam.v1.GetPolicyOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from a GetIamPolicyRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.iam.v1.GetIamPolicyRequest - * @static - * @param {google.iam.v1.GetIamPolicyRequest} message GetIamPolicyRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIamPolicyRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.resource = ""; - object.options = null; - } - if (message.resource != null && message.hasOwnProperty("resource")) - object.resource = message.resource; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.iam.v1.GetPolicyOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this GetIamPolicyRequest to JSON. - * @function toJSON - * @memberof google.iam.v1.GetIamPolicyRequest - * @instance - * @returns {Object.} JSON object - */ - GetIamPolicyRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetIamPolicyRequest - * @function getTypeUrl - * @memberof google.iam.v1.GetIamPolicyRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetIamPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.iam.v1.GetIamPolicyRequest"; - }; - - return GetIamPolicyRequest; - })(); - - v1.TestIamPermissionsRequest = (function() { - - /** - * Properties of a TestIamPermissionsRequest. - * @memberof google.iam.v1 - * @interface ITestIamPermissionsRequest - * @property {string|null} [resource] TestIamPermissionsRequest resource - * @property {Array.|null} [permissions] TestIamPermissionsRequest permissions - */ - - /** - * Constructs a new TestIamPermissionsRequest. - * @memberof google.iam.v1 - * @classdesc Represents a TestIamPermissionsRequest. - * @implements ITestIamPermissionsRequest - * @constructor - * @param {google.iam.v1.ITestIamPermissionsRequest=} [properties] Properties to set - */ - function TestIamPermissionsRequest(properties) { - this.permissions = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TestIamPermissionsRequest resource. - * @member {string} resource - * @memberof google.iam.v1.TestIamPermissionsRequest - * @instance - */ - TestIamPermissionsRequest.prototype.resource = ""; - - /** - * TestIamPermissionsRequest permissions. - * @member {Array.} permissions - * @memberof google.iam.v1.TestIamPermissionsRequest - * @instance - */ - TestIamPermissionsRequest.prototype.permissions = $util.emptyArray; - - /** - * Creates a new TestIamPermissionsRequest instance using the specified properties. - * @function create - * @memberof google.iam.v1.TestIamPermissionsRequest - * @static - * @param {google.iam.v1.ITestIamPermissionsRequest=} [properties] Properties to set - * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest instance - */ - TestIamPermissionsRequest.create = function create(properties) { - return new TestIamPermissionsRequest(properties); - }; - - /** - * Encodes the specified TestIamPermissionsRequest message. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. - * @function encode - * @memberof google.iam.v1.TestIamPermissionsRequest - * @static - * @param {google.iam.v1.ITestIamPermissionsRequest} message TestIamPermissionsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TestIamPermissionsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); - if (message.permissions != null && message.permissions.length) - for (var i = 0; i < message.permissions.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.permissions[i]); - return writer; - }; - - /** - * Encodes the specified TestIamPermissionsRequest message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.iam.v1.TestIamPermissionsRequest - * @static - * @param {google.iam.v1.ITestIamPermissionsRequest} message TestIamPermissionsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TestIamPermissionsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TestIamPermissionsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.iam.v1.TestIamPermissionsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TestIamPermissionsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.TestIamPermissionsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.resource = reader.string(); - break; - } - case 2: { - if (!(message.permissions && message.permissions.length)) - message.permissions = []; - message.permissions.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TestIamPermissionsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.iam.v1.TestIamPermissionsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TestIamPermissionsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TestIamPermissionsRequest message. - * @function verify - * @memberof google.iam.v1.TestIamPermissionsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TestIamPermissionsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.resource != null && message.hasOwnProperty("resource")) - if (!$util.isString(message.resource)) - return "resource: string expected"; - if (message.permissions != null && message.hasOwnProperty("permissions")) { - if (!Array.isArray(message.permissions)) - return "permissions: array expected"; - for (var i = 0; i < message.permissions.length; ++i) - if (!$util.isString(message.permissions[i])) - return "permissions: string[] expected"; - } - return null; - }; - - /** - * Creates a TestIamPermissionsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.iam.v1.TestIamPermissionsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest - */ - TestIamPermissionsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.TestIamPermissionsRequest) - return object; - var message = new $root.google.iam.v1.TestIamPermissionsRequest(); - if (object.resource != null) - message.resource = String(object.resource); - if (object.permissions) { - if (!Array.isArray(object.permissions)) - throw TypeError(".google.iam.v1.TestIamPermissionsRequest.permissions: array expected"); - message.permissions = []; - for (var i = 0; i < object.permissions.length; ++i) - message.permissions[i] = String(object.permissions[i]); - } - return message; - }; - - /** - * Creates a plain object from a TestIamPermissionsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.iam.v1.TestIamPermissionsRequest - * @static - * @param {google.iam.v1.TestIamPermissionsRequest} message TestIamPermissionsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TestIamPermissionsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.permissions = []; - if (options.defaults) - object.resource = ""; - if (message.resource != null && message.hasOwnProperty("resource")) - object.resource = message.resource; - if (message.permissions && message.permissions.length) { - object.permissions = []; - for (var j = 0; j < message.permissions.length; ++j) - object.permissions[j] = message.permissions[j]; - } - return object; - }; - - /** - * Converts this TestIamPermissionsRequest to JSON. - * @function toJSON - * @memberof google.iam.v1.TestIamPermissionsRequest - * @instance - * @returns {Object.} JSON object - */ - TestIamPermissionsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TestIamPermissionsRequest - * @function getTypeUrl - * @memberof google.iam.v1.TestIamPermissionsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TestIamPermissionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.iam.v1.TestIamPermissionsRequest"; - }; - - return TestIamPermissionsRequest; - })(); - - v1.TestIamPermissionsResponse = (function() { - - /** - * Properties of a TestIamPermissionsResponse. - * @memberof google.iam.v1 - * @interface ITestIamPermissionsResponse - * @property {Array.|null} [permissions] TestIamPermissionsResponse permissions - */ - - /** - * Constructs a new TestIamPermissionsResponse. - * @memberof google.iam.v1 - * @classdesc Represents a TestIamPermissionsResponse. - * @implements ITestIamPermissionsResponse - * @constructor - * @param {google.iam.v1.ITestIamPermissionsResponse=} [properties] Properties to set - */ - function TestIamPermissionsResponse(properties) { - this.permissions = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TestIamPermissionsResponse permissions. - * @member {Array.} permissions - * @memberof google.iam.v1.TestIamPermissionsResponse - * @instance - */ - TestIamPermissionsResponse.prototype.permissions = $util.emptyArray; - - /** - * Creates a new TestIamPermissionsResponse instance using the specified properties. - * @function create - * @memberof google.iam.v1.TestIamPermissionsResponse - * @static - * @param {google.iam.v1.ITestIamPermissionsResponse=} [properties] Properties to set - * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse instance - */ - TestIamPermissionsResponse.create = function create(properties) { - return new TestIamPermissionsResponse(properties); - }; - - /** - * Encodes the specified TestIamPermissionsResponse message. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. - * @function encode - * @memberof google.iam.v1.TestIamPermissionsResponse - * @static - * @param {google.iam.v1.ITestIamPermissionsResponse} message TestIamPermissionsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TestIamPermissionsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.permissions != null && message.permissions.length) - for (var i = 0; i < message.permissions.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.permissions[i]); - return writer; - }; - - /** - * Encodes the specified TestIamPermissionsResponse message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.iam.v1.TestIamPermissionsResponse - * @static - * @param {google.iam.v1.ITestIamPermissionsResponse} message TestIamPermissionsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TestIamPermissionsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TestIamPermissionsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.iam.v1.TestIamPermissionsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TestIamPermissionsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.TestIamPermissionsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.permissions && message.permissions.length)) - message.permissions = []; - message.permissions.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TestIamPermissionsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.iam.v1.TestIamPermissionsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TestIamPermissionsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TestIamPermissionsResponse message. - * @function verify - * @memberof google.iam.v1.TestIamPermissionsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TestIamPermissionsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.permissions != null && message.hasOwnProperty("permissions")) { - if (!Array.isArray(message.permissions)) - return "permissions: array expected"; - for (var i = 0; i < message.permissions.length; ++i) - if (!$util.isString(message.permissions[i])) - return "permissions: string[] expected"; - } - return null; - }; - - /** - * Creates a TestIamPermissionsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.iam.v1.TestIamPermissionsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse - */ - TestIamPermissionsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.TestIamPermissionsResponse) - return object; - var message = new $root.google.iam.v1.TestIamPermissionsResponse(); - if (object.permissions) { - if (!Array.isArray(object.permissions)) - throw TypeError(".google.iam.v1.TestIamPermissionsResponse.permissions: array expected"); - message.permissions = []; - for (var i = 0; i < object.permissions.length; ++i) - message.permissions[i] = String(object.permissions[i]); - } - return message; - }; - - /** - * Creates a plain object from a TestIamPermissionsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.iam.v1.TestIamPermissionsResponse - * @static - * @param {google.iam.v1.TestIamPermissionsResponse} message TestIamPermissionsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TestIamPermissionsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.permissions = []; - if (message.permissions && message.permissions.length) { - object.permissions = []; - for (var j = 0; j < message.permissions.length; ++j) - object.permissions[j] = message.permissions[j]; - } - return object; - }; - - /** - * Converts this TestIamPermissionsResponse to JSON. - * @function toJSON - * @memberof google.iam.v1.TestIamPermissionsResponse - * @instance - * @returns {Object.} JSON object - */ - TestIamPermissionsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TestIamPermissionsResponse - * @function getTypeUrl - * @memberof google.iam.v1.TestIamPermissionsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TestIamPermissionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.iam.v1.TestIamPermissionsResponse"; - }; - - return TestIamPermissionsResponse; - })(); - - v1.GetPolicyOptions = (function() { - - /** - * Properties of a GetPolicyOptions. - * @memberof google.iam.v1 - * @interface IGetPolicyOptions - * @property {number|null} [requestedPolicyVersion] GetPolicyOptions requestedPolicyVersion - */ - - /** - * Constructs a new GetPolicyOptions. - * @memberof google.iam.v1 - * @classdesc Represents a GetPolicyOptions. - * @implements IGetPolicyOptions - * @constructor - * @param {google.iam.v1.IGetPolicyOptions=} [properties] Properties to set - */ - function GetPolicyOptions(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetPolicyOptions requestedPolicyVersion. - * @member {number} requestedPolicyVersion - * @memberof google.iam.v1.GetPolicyOptions - * @instance - */ - GetPolicyOptions.prototype.requestedPolicyVersion = 0; - - /** - * Creates a new GetPolicyOptions instance using the specified properties. - * @function create - * @memberof google.iam.v1.GetPolicyOptions - * @static - * @param {google.iam.v1.IGetPolicyOptions=} [properties] Properties to set - * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions instance - */ - GetPolicyOptions.create = function create(properties) { - return new GetPolicyOptions(properties); - }; - - /** - * Encodes the specified GetPolicyOptions message. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages. - * @function encode - * @memberof google.iam.v1.GetPolicyOptions - * @static - * @param {google.iam.v1.IGetPolicyOptions} message GetPolicyOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetPolicyOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.requestedPolicyVersion != null && Object.hasOwnProperty.call(message, "requestedPolicyVersion")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.requestedPolicyVersion); - return writer; - }; - - /** - * Encodes the specified GetPolicyOptions message, length delimited. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.iam.v1.GetPolicyOptions - * @static - * @param {google.iam.v1.IGetPolicyOptions} message GetPolicyOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetPolicyOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetPolicyOptions message from the specified reader or buffer. - * @function decode - * @memberof google.iam.v1.GetPolicyOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetPolicyOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.GetPolicyOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.requestedPolicyVersion = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetPolicyOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.iam.v1.GetPolicyOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetPolicyOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetPolicyOptions message. - * @function verify - * @memberof google.iam.v1.GetPolicyOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetPolicyOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.requestedPolicyVersion != null && message.hasOwnProperty("requestedPolicyVersion")) - if (!$util.isInteger(message.requestedPolicyVersion)) - return "requestedPolicyVersion: integer expected"; - return null; - }; - - /** - * Creates a GetPolicyOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.iam.v1.GetPolicyOptions - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions - */ - GetPolicyOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.GetPolicyOptions) - return object; - var message = new $root.google.iam.v1.GetPolicyOptions(); - if (object.requestedPolicyVersion != null) - message.requestedPolicyVersion = object.requestedPolicyVersion | 0; - return message; - }; - - /** - * Creates a plain object from a GetPolicyOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.iam.v1.GetPolicyOptions - * @static - * @param {google.iam.v1.GetPolicyOptions} message GetPolicyOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetPolicyOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.requestedPolicyVersion = 0; - if (message.requestedPolicyVersion != null && message.hasOwnProperty("requestedPolicyVersion")) - object.requestedPolicyVersion = message.requestedPolicyVersion; - return object; - }; - - /** - * Converts this GetPolicyOptions to JSON. - * @function toJSON - * @memberof google.iam.v1.GetPolicyOptions - * @instance - * @returns {Object.} JSON object - */ - GetPolicyOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetPolicyOptions - * @function getTypeUrl - * @memberof google.iam.v1.GetPolicyOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetPolicyOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.iam.v1.GetPolicyOptions"; - }; - - return GetPolicyOptions; - })(); - - v1.Policy = (function() { - - /** - * Properties of a Policy. - * @memberof google.iam.v1 - * @interface IPolicy - * @property {number|null} [version] Policy version - * @property {Array.|null} [bindings] Policy bindings - * @property {Array.|null} [auditConfigs] Policy auditConfigs - * @property {Uint8Array|null} [etag] Policy etag - */ - - /** - * Constructs a new Policy. - * @memberof google.iam.v1 - * @classdesc Represents a Policy. - * @implements IPolicy - * @constructor - * @param {google.iam.v1.IPolicy=} [properties] Properties to set - */ - function Policy(properties) { - this.bindings = []; - this.auditConfigs = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Policy version. - * @member {number} version - * @memberof google.iam.v1.Policy - * @instance - */ - Policy.prototype.version = 0; - - /** - * Policy bindings. - * @member {Array.} bindings - * @memberof google.iam.v1.Policy - * @instance - */ - Policy.prototype.bindings = $util.emptyArray; - - /** - * Policy auditConfigs. - * @member {Array.} auditConfigs - * @memberof google.iam.v1.Policy - * @instance - */ - Policy.prototype.auditConfigs = $util.emptyArray; - - /** - * Policy etag. - * @member {Uint8Array} etag - * @memberof google.iam.v1.Policy - * @instance - */ - Policy.prototype.etag = $util.newBuffer([]); - - /** - * Creates a new Policy instance using the specified properties. - * @function create - * @memberof google.iam.v1.Policy - * @static - * @param {google.iam.v1.IPolicy=} [properties] Properties to set - * @returns {google.iam.v1.Policy} Policy instance - */ - Policy.create = function create(properties) { - return new Policy(properties); - }; - - /** - * Encodes the specified Policy message. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. - * @function encode - * @memberof google.iam.v1.Policy - * @static - * @param {google.iam.v1.IPolicy} message Policy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Policy.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.version); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.etag); - if (message.bindings != null && message.bindings.length) - for (var i = 0; i < message.bindings.length; ++i) - $root.google.iam.v1.Binding.encode(message.bindings[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.auditConfigs != null && message.auditConfigs.length) - for (var i = 0; i < message.auditConfigs.length; ++i) - $root.google.iam.v1.AuditConfig.encode(message.auditConfigs[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Policy message, length delimited. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. - * @function encodeDelimited - * @memberof google.iam.v1.Policy - * @static - * @param {google.iam.v1.IPolicy} message Policy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Policy.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Policy message from the specified reader or buffer. - * @function decode - * @memberof google.iam.v1.Policy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.Policy} Policy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Policy.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.Policy(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.version = reader.int32(); - break; - } - case 4: { - if (!(message.bindings && message.bindings.length)) - message.bindings = []; - message.bindings.push($root.google.iam.v1.Binding.decode(reader, reader.uint32())); - break; - } - case 6: { - if (!(message.auditConfigs && message.auditConfigs.length)) - message.auditConfigs = []; - message.auditConfigs.push($root.google.iam.v1.AuditConfig.decode(reader, reader.uint32())); - break; - } - case 3: { - message.etag = reader.bytes(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Policy message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.iam.v1.Policy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.Policy} Policy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Policy.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Policy message. - * @function verify - * @memberof google.iam.v1.Policy - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Policy.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.version != null && message.hasOwnProperty("version")) - if (!$util.isInteger(message.version)) - return "version: integer expected"; - if (message.bindings != null && message.hasOwnProperty("bindings")) { - if (!Array.isArray(message.bindings)) - return "bindings: array expected"; - for (var i = 0; i < message.bindings.length; ++i) { - var error = $root.google.iam.v1.Binding.verify(message.bindings[i]); - if (error) - return "bindings." + error; - } - } - if (message.auditConfigs != null && message.hasOwnProperty("auditConfigs")) { - if (!Array.isArray(message.auditConfigs)) - return "auditConfigs: array expected"; - for (var i = 0; i < message.auditConfigs.length; ++i) { - var error = $root.google.iam.v1.AuditConfig.verify(message.auditConfigs[i]); - if (error) - return "auditConfigs." + error; - } - } - if (message.etag != null && message.hasOwnProperty("etag")) - if (!(message.etag && typeof message.etag.length === "number" || $util.isString(message.etag))) - return "etag: buffer expected"; - return null; - }; - - /** - * Creates a Policy message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.iam.v1.Policy - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v1.Policy} Policy - */ - Policy.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.Policy) - return object; - var message = new $root.google.iam.v1.Policy(); - if (object.version != null) - message.version = object.version | 0; - if (object.bindings) { - if (!Array.isArray(object.bindings)) - throw TypeError(".google.iam.v1.Policy.bindings: array expected"); - message.bindings = []; - for (var i = 0; i < object.bindings.length; ++i) { - if (typeof object.bindings[i] !== "object") - throw TypeError(".google.iam.v1.Policy.bindings: object expected"); - message.bindings[i] = $root.google.iam.v1.Binding.fromObject(object.bindings[i]); - } - } - if (object.auditConfigs) { - if (!Array.isArray(object.auditConfigs)) - throw TypeError(".google.iam.v1.Policy.auditConfigs: array expected"); - message.auditConfigs = []; - for (var i = 0; i < object.auditConfigs.length; ++i) { - if (typeof object.auditConfigs[i] !== "object") - throw TypeError(".google.iam.v1.Policy.auditConfigs: object expected"); - message.auditConfigs[i] = $root.google.iam.v1.AuditConfig.fromObject(object.auditConfigs[i]); - } - } - if (object.etag != null) - if (typeof object.etag === "string") - $util.base64.decode(object.etag, message.etag = $util.newBuffer($util.base64.length(object.etag)), 0); - else if (object.etag.length >= 0) - message.etag = object.etag; - return message; - }; - - /** - * Creates a plain object from a Policy message. Also converts values to other types if specified. - * @function toObject - * @memberof google.iam.v1.Policy - * @static - * @param {google.iam.v1.Policy} message Policy - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Policy.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.bindings = []; - object.auditConfigs = []; - } - if (options.defaults) { - object.version = 0; - if (options.bytes === String) - object.etag = ""; - else { - object.etag = []; - if (options.bytes !== Array) - object.etag = $util.newBuffer(object.etag); - } - } - if (message.version != null && message.hasOwnProperty("version")) - object.version = message.version; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = options.bytes === String ? $util.base64.encode(message.etag, 0, message.etag.length) : options.bytes === Array ? Array.prototype.slice.call(message.etag) : message.etag; - if (message.bindings && message.bindings.length) { - object.bindings = []; - for (var j = 0; j < message.bindings.length; ++j) - object.bindings[j] = $root.google.iam.v1.Binding.toObject(message.bindings[j], options); - } - if (message.auditConfigs && message.auditConfigs.length) { - object.auditConfigs = []; - for (var j = 0; j < message.auditConfigs.length; ++j) - object.auditConfigs[j] = $root.google.iam.v1.AuditConfig.toObject(message.auditConfigs[j], options); - } - return object; - }; - - /** - * Converts this Policy to JSON. - * @function toJSON - * @memberof google.iam.v1.Policy - * @instance - * @returns {Object.} JSON object - */ - Policy.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Policy - * @function getTypeUrl - * @memberof google.iam.v1.Policy - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Policy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.iam.v1.Policy"; - }; - - return Policy; - })(); - - v1.Binding = (function() { - - /** - * Properties of a Binding. - * @memberof google.iam.v1 - * @interface IBinding - * @property {string|null} [role] Binding role - * @property {Array.|null} [members] Binding members - * @property {google.type.IExpr|null} [condition] Binding condition - */ - - /** - * Constructs a new Binding. - * @memberof google.iam.v1 - * @classdesc Represents a Binding. - * @implements IBinding - * @constructor - * @param {google.iam.v1.IBinding=} [properties] Properties to set - */ - function Binding(properties) { - this.members = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Binding role. - * @member {string} role - * @memberof google.iam.v1.Binding - * @instance - */ - Binding.prototype.role = ""; - - /** - * Binding members. - * @member {Array.} members - * @memberof google.iam.v1.Binding - * @instance - */ - Binding.prototype.members = $util.emptyArray; - - /** - * Binding condition. - * @member {google.type.IExpr|null|undefined} condition - * @memberof google.iam.v1.Binding - * @instance - */ - Binding.prototype.condition = null; - - /** - * Creates a new Binding instance using the specified properties. - * @function create - * @memberof google.iam.v1.Binding - * @static - * @param {google.iam.v1.IBinding=} [properties] Properties to set - * @returns {google.iam.v1.Binding} Binding instance - */ - Binding.create = function create(properties) { - return new Binding(properties); - }; - - /** - * Encodes the specified Binding message. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. - * @function encode - * @memberof google.iam.v1.Binding - * @static - * @param {google.iam.v1.IBinding} message Binding message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Binding.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.role != null && Object.hasOwnProperty.call(message, "role")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.role); - if (message.members != null && message.members.length) - for (var i = 0; i < message.members.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.members[i]); - if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) - $root.google.type.Expr.encode(message.condition, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Binding message, length delimited. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. - * @function encodeDelimited - * @memberof google.iam.v1.Binding - * @static - * @param {google.iam.v1.IBinding} message Binding message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Binding.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Binding message from the specified reader or buffer. - * @function decode - * @memberof google.iam.v1.Binding - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.Binding} Binding - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Binding.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.Binding(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.role = reader.string(); - break; - } - case 2: { - if (!(message.members && message.members.length)) - message.members = []; - message.members.push(reader.string()); - break; - } - case 3: { - message.condition = $root.google.type.Expr.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Binding message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.iam.v1.Binding - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.Binding} Binding - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Binding.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Binding message. - * @function verify - * @memberof google.iam.v1.Binding - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Binding.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.role != null && message.hasOwnProperty("role")) - if (!$util.isString(message.role)) - return "role: string expected"; - if (message.members != null && message.hasOwnProperty("members")) { - if (!Array.isArray(message.members)) - return "members: array expected"; - for (var i = 0; i < message.members.length; ++i) - if (!$util.isString(message.members[i])) - return "members: string[] expected"; - } - if (message.condition != null && message.hasOwnProperty("condition")) { - var error = $root.google.type.Expr.verify(message.condition); - if (error) - return "condition." + error; - } - return null; - }; - - /** - * Creates a Binding message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.iam.v1.Binding - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v1.Binding} Binding - */ - Binding.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.Binding) - return object; - var message = new $root.google.iam.v1.Binding(); - if (object.role != null) - message.role = String(object.role); - if (object.members) { - if (!Array.isArray(object.members)) - throw TypeError(".google.iam.v1.Binding.members: array expected"); - message.members = []; - for (var i = 0; i < object.members.length; ++i) - message.members[i] = String(object.members[i]); - } - if (object.condition != null) { - if (typeof object.condition !== "object") - throw TypeError(".google.iam.v1.Binding.condition: object expected"); - message.condition = $root.google.type.Expr.fromObject(object.condition); - } - return message; - }; - - /** - * Creates a plain object from a Binding message. Also converts values to other types if specified. - * @function toObject - * @memberof google.iam.v1.Binding - * @static - * @param {google.iam.v1.Binding} message Binding - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Binding.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.members = []; - if (options.defaults) { - object.role = ""; - object.condition = null; - } - if (message.role != null && message.hasOwnProperty("role")) - object.role = message.role; - if (message.members && message.members.length) { - object.members = []; - for (var j = 0; j < message.members.length; ++j) - object.members[j] = message.members[j]; - } - if (message.condition != null && message.hasOwnProperty("condition")) - object.condition = $root.google.type.Expr.toObject(message.condition, options); - return object; - }; - - /** - * Converts this Binding to JSON. - * @function toJSON - * @memberof google.iam.v1.Binding - * @instance - * @returns {Object.} JSON object - */ - Binding.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Binding - * @function getTypeUrl - * @memberof google.iam.v1.Binding - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Binding.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.iam.v1.Binding"; - }; - - return Binding; - })(); - - v1.AuditConfig = (function() { - - /** - * Properties of an AuditConfig. - * @memberof google.iam.v1 - * @interface IAuditConfig - * @property {string|null} [service] AuditConfig service - * @property {Array.|null} [auditLogConfigs] AuditConfig auditLogConfigs - */ - - /** - * Constructs a new AuditConfig. - * @memberof google.iam.v1 - * @classdesc Represents an AuditConfig. - * @implements IAuditConfig - * @constructor - * @param {google.iam.v1.IAuditConfig=} [properties] Properties to set - */ - function AuditConfig(properties) { - this.auditLogConfigs = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AuditConfig service. - * @member {string} service - * @memberof google.iam.v1.AuditConfig - * @instance - */ - AuditConfig.prototype.service = ""; - - /** - * AuditConfig auditLogConfigs. - * @member {Array.} auditLogConfigs - * @memberof google.iam.v1.AuditConfig - * @instance - */ - AuditConfig.prototype.auditLogConfigs = $util.emptyArray; - - /** - * Creates a new AuditConfig instance using the specified properties. - * @function create - * @memberof google.iam.v1.AuditConfig - * @static - * @param {google.iam.v1.IAuditConfig=} [properties] Properties to set - * @returns {google.iam.v1.AuditConfig} AuditConfig instance - */ - AuditConfig.create = function create(properties) { - return new AuditConfig(properties); - }; - - /** - * Encodes the specified AuditConfig message. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. - * @function encode - * @memberof google.iam.v1.AuditConfig - * @static - * @param {google.iam.v1.IAuditConfig} message AuditConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AuditConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.service != null && Object.hasOwnProperty.call(message, "service")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.service); - if (message.auditLogConfigs != null && message.auditLogConfigs.length) - for (var i = 0; i < message.auditLogConfigs.length; ++i) - $root.google.iam.v1.AuditLogConfig.encode(message.auditLogConfigs[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified AuditConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.iam.v1.AuditConfig - * @static - * @param {google.iam.v1.IAuditConfig} message AuditConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AuditConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AuditConfig message from the specified reader or buffer. - * @function decode - * @memberof google.iam.v1.AuditConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.AuditConfig} AuditConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AuditConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.AuditConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.service = reader.string(); - break; - } - case 3: { - if (!(message.auditLogConfigs && message.auditLogConfigs.length)) - message.auditLogConfigs = []; - message.auditLogConfigs.push($root.google.iam.v1.AuditLogConfig.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AuditConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.iam.v1.AuditConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.AuditConfig} AuditConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AuditConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AuditConfig message. - * @function verify - * @memberof google.iam.v1.AuditConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AuditConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.service != null && message.hasOwnProperty("service")) - if (!$util.isString(message.service)) - return "service: string expected"; - if (message.auditLogConfigs != null && message.hasOwnProperty("auditLogConfigs")) { - if (!Array.isArray(message.auditLogConfigs)) - return "auditLogConfigs: array expected"; - for (var i = 0; i < message.auditLogConfigs.length; ++i) { - var error = $root.google.iam.v1.AuditLogConfig.verify(message.auditLogConfigs[i]); - if (error) - return "auditLogConfigs." + error; - } - } - return null; - }; - - /** - * Creates an AuditConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.iam.v1.AuditConfig - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v1.AuditConfig} AuditConfig - */ - AuditConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.AuditConfig) - return object; - var message = new $root.google.iam.v1.AuditConfig(); - if (object.service != null) - message.service = String(object.service); - if (object.auditLogConfigs) { - if (!Array.isArray(object.auditLogConfigs)) - throw TypeError(".google.iam.v1.AuditConfig.auditLogConfigs: array expected"); - message.auditLogConfigs = []; - for (var i = 0; i < object.auditLogConfigs.length; ++i) { - if (typeof object.auditLogConfigs[i] !== "object") - throw TypeError(".google.iam.v1.AuditConfig.auditLogConfigs: object expected"); - message.auditLogConfigs[i] = $root.google.iam.v1.AuditLogConfig.fromObject(object.auditLogConfigs[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an AuditConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.iam.v1.AuditConfig - * @static - * @param {google.iam.v1.AuditConfig} message AuditConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AuditConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.auditLogConfigs = []; - if (options.defaults) - object.service = ""; - if (message.service != null && message.hasOwnProperty("service")) - object.service = message.service; - if (message.auditLogConfigs && message.auditLogConfigs.length) { - object.auditLogConfigs = []; - for (var j = 0; j < message.auditLogConfigs.length; ++j) - object.auditLogConfigs[j] = $root.google.iam.v1.AuditLogConfig.toObject(message.auditLogConfigs[j], options); - } - return object; - }; - - /** - * Converts this AuditConfig to JSON. - * @function toJSON - * @memberof google.iam.v1.AuditConfig - * @instance - * @returns {Object.} JSON object - */ - AuditConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AuditConfig - * @function getTypeUrl - * @memberof google.iam.v1.AuditConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AuditConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.iam.v1.AuditConfig"; - }; - - return AuditConfig; - })(); - - v1.AuditLogConfig = (function() { - - /** - * Properties of an AuditLogConfig. - * @memberof google.iam.v1 - * @interface IAuditLogConfig - * @property {google.iam.v1.AuditLogConfig.LogType|null} [logType] AuditLogConfig logType - * @property {Array.|null} [exemptedMembers] AuditLogConfig exemptedMembers - */ - - /** - * Constructs a new AuditLogConfig. - * @memberof google.iam.v1 - * @classdesc Represents an AuditLogConfig. - * @implements IAuditLogConfig - * @constructor - * @param {google.iam.v1.IAuditLogConfig=} [properties] Properties to set - */ - function AuditLogConfig(properties) { - this.exemptedMembers = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AuditLogConfig logType. - * @member {google.iam.v1.AuditLogConfig.LogType} logType - * @memberof google.iam.v1.AuditLogConfig - * @instance - */ - AuditLogConfig.prototype.logType = 0; - - /** - * AuditLogConfig exemptedMembers. - * @member {Array.} exemptedMembers - * @memberof google.iam.v1.AuditLogConfig - * @instance - */ - AuditLogConfig.prototype.exemptedMembers = $util.emptyArray; - - /** - * Creates a new AuditLogConfig instance using the specified properties. - * @function create - * @memberof google.iam.v1.AuditLogConfig - * @static - * @param {google.iam.v1.IAuditLogConfig=} [properties] Properties to set - * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig instance - */ - AuditLogConfig.create = function create(properties) { - return new AuditLogConfig(properties); - }; - - /** - * Encodes the specified AuditLogConfig message. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. - * @function encode - * @memberof google.iam.v1.AuditLogConfig - * @static - * @param {google.iam.v1.IAuditLogConfig} message AuditLogConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AuditLogConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.logType != null && Object.hasOwnProperty.call(message, "logType")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.logType); - if (message.exemptedMembers != null && message.exemptedMembers.length) - for (var i = 0; i < message.exemptedMembers.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.exemptedMembers[i]); - return writer; - }; - - /** - * Encodes the specified AuditLogConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.iam.v1.AuditLogConfig - * @static - * @param {google.iam.v1.IAuditLogConfig} message AuditLogConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AuditLogConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AuditLogConfig message from the specified reader or buffer. - * @function decode - * @memberof google.iam.v1.AuditLogConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AuditLogConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.AuditLogConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.logType = reader.int32(); - break; - } - case 2: { - if (!(message.exemptedMembers && message.exemptedMembers.length)) - message.exemptedMembers = []; - message.exemptedMembers.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AuditLogConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.iam.v1.AuditLogConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AuditLogConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AuditLogConfig message. - * @function verify - * @memberof google.iam.v1.AuditLogConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AuditLogConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.logType != null && message.hasOwnProperty("logType")) - switch (message.logType) { - default: - return "logType: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.exemptedMembers != null && message.hasOwnProperty("exemptedMembers")) { - if (!Array.isArray(message.exemptedMembers)) - return "exemptedMembers: array expected"; - for (var i = 0; i < message.exemptedMembers.length; ++i) - if (!$util.isString(message.exemptedMembers[i])) - return "exemptedMembers: string[] expected"; - } - return null; - }; - - /** - * Creates an AuditLogConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.iam.v1.AuditLogConfig - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig - */ - AuditLogConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.AuditLogConfig) - return object; - var message = new $root.google.iam.v1.AuditLogConfig(); - switch (object.logType) { - default: - if (typeof object.logType === "number") { - message.logType = object.logType; - break; - } - break; - case "LOG_TYPE_UNSPECIFIED": - case 0: - message.logType = 0; - break; - case "ADMIN_READ": - case 1: - message.logType = 1; - break; - case "DATA_WRITE": - case 2: - message.logType = 2; - break; - case "DATA_READ": - case 3: - message.logType = 3; - break; - } - if (object.exemptedMembers) { - if (!Array.isArray(object.exemptedMembers)) - throw TypeError(".google.iam.v1.AuditLogConfig.exemptedMembers: array expected"); - message.exemptedMembers = []; - for (var i = 0; i < object.exemptedMembers.length; ++i) - message.exemptedMembers[i] = String(object.exemptedMembers[i]); - } - return message; - }; - - /** - * Creates a plain object from an AuditLogConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.iam.v1.AuditLogConfig - * @static - * @param {google.iam.v1.AuditLogConfig} message AuditLogConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AuditLogConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.exemptedMembers = []; - if (options.defaults) - object.logType = options.enums === String ? "LOG_TYPE_UNSPECIFIED" : 0; - if (message.logType != null && message.hasOwnProperty("logType")) - object.logType = options.enums === String ? $root.google.iam.v1.AuditLogConfig.LogType[message.logType] === undefined ? message.logType : $root.google.iam.v1.AuditLogConfig.LogType[message.logType] : message.logType; - if (message.exemptedMembers && message.exemptedMembers.length) { - object.exemptedMembers = []; - for (var j = 0; j < message.exemptedMembers.length; ++j) - object.exemptedMembers[j] = message.exemptedMembers[j]; - } - return object; - }; - - /** - * Converts this AuditLogConfig to JSON. - * @function toJSON - * @memberof google.iam.v1.AuditLogConfig - * @instance - * @returns {Object.} JSON object - */ - AuditLogConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AuditLogConfig - * @function getTypeUrl - * @memberof google.iam.v1.AuditLogConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AuditLogConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.iam.v1.AuditLogConfig"; - }; - - /** - * LogType enum. - * @name google.iam.v1.AuditLogConfig.LogType - * @enum {number} - * @property {number} LOG_TYPE_UNSPECIFIED=0 LOG_TYPE_UNSPECIFIED value - * @property {number} ADMIN_READ=1 ADMIN_READ value - * @property {number} DATA_WRITE=2 DATA_WRITE value - * @property {number} DATA_READ=3 DATA_READ value - */ - AuditLogConfig.LogType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "LOG_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "ADMIN_READ"] = 1; - values[valuesById[2] = "DATA_WRITE"] = 2; - values[valuesById[3] = "DATA_READ"] = 3; - return values; - })(); - - return AuditLogConfig; - })(); - - v1.PolicyDelta = (function() { - - /** - * Properties of a PolicyDelta. - * @memberof google.iam.v1 - * @interface IPolicyDelta - * @property {Array.|null} [bindingDeltas] PolicyDelta bindingDeltas - * @property {Array.|null} [auditConfigDeltas] PolicyDelta auditConfigDeltas - */ - - /** - * Constructs a new PolicyDelta. - * @memberof google.iam.v1 - * @classdesc Represents a PolicyDelta. - * @implements IPolicyDelta - * @constructor - * @param {google.iam.v1.IPolicyDelta=} [properties] Properties to set - */ - function PolicyDelta(properties) { - this.bindingDeltas = []; - this.auditConfigDeltas = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PolicyDelta bindingDeltas. - * @member {Array.} bindingDeltas - * @memberof google.iam.v1.PolicyDelta - * @instance - */ - PolicyDelta.prototype.bindingDeltas = $util.emptyArray; - - /** - * PolicyDelta auditConfigDeltas. - * @member {Array.} auditConfigDeltas - * @memberof google.iam.v1.PolicyDelta - * @instance - */ - PolicyDelta.prototype.auditConfigDeltas = $util.emptyArray; - - /** - * Creates a new PolicyDelta instance using the specified properties. - * @function create - * @memberof google.iam.v1.PolicyDelta - * @static - * @param {google.iam.v1.IPolicyDelta=} [properties] Properties to set - * @returns {google.iam.v1.PolicyDelta} PolicyDelta instance - */ - PolicyDelta.create = function create(properties) { - return new PolicyDelta(properties); - }; - - /** - * Encodes the specified PolicyDelta message. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. - * @function encode - * @memberof google.iam.v1.PolicyDelta - * @static - * @param {google.iam.v1.IPolicyDelta} message PolicyDelta message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PolicyDelta.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.bindingDeltas != null && message.bindingDeltas.length) - for (var i = 0; i < message.bindingDeltas.length; ++i) - $root.google.iam.v1.BindingDelta.encode(message.bindingDeltas[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.auditConfigDeltas != null && message.auditConfigDeltas.length) - for (var i = 0; i < message.auditConfigDeltas.length; ++i) - $root.google.iam.v1.AuditConfigDelta.encode(message.auditConfigDeltas[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified PolicyDelta message, length delimited. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. - * @function encodeDelimited - * @memberof google.iam.v1.PolicyDelta - * @static - * @param {google.iam.v1.IPolicyDelta} message PolicyDelta message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PolicyDelta.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PolicyDelta message from the specified reader or buffer. - * @function decode - * @memberof google.iam.v1.PolicyDelta - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.PolicyDelta} PolicyDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PolicyDelta.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.PolicyDelta(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.bindingDeltas && message.bindingDeltas.length)) - message.bindingDeltas = []; - message.bindingDeltas.push($root.google.iam.v1.BindingDelta.decode(reader, reader.uint32())); - break; - } - case 2: { - if (!(message.auditConfigDeltas && message.auditConfigDeltas.length)) - message.auditConfigDeltas = []; - message.auditConfigDeltas.push($root.google.iam.v1.AuditConfigDelta.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PolicyDelta message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.iam.v1.PolicyDelta - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.PolicyDelta} PolicyDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PolicyDelta.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PolicyDelta message. - * @function verify - * @memberof google.iam.v1.PolicyDelta - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PolicyDelta.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.bindingDeltas != null && message.hasOwnProperty("bindingDeltas")) { - if (!Array.isArray(message.bindingDeltas)) - return "bindingDeltas: array expected"; - for (var i = 0; i < message.bindingDeltas.length; ++i) { - var error = $root.google.iam.v1.BindingDelta.verify(message.bindingDeltas[i]); - if (error) - return "bindingDeltas." + error; - } - } - if (message.auditConfigDeltas != null && message.hasOwnProperty("auditConfigDeltas")) { - if (!Array.isArray(message.auditConfigDeltas)) - return "auditConfigDeltas: array expected"; - for (var i = 0; i < message.auditConfigDeltas.length; ++i) { - var error = $root.google.iam.v1.AuditConfigDelta.verify(message.auditConfigDeltas[i]); - if (error) - return "auditConfigDeltas." + error; - } - } - return null; - }; - - /** - * Creates a PolicyDelta message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.iam.v1.PolicyDelta - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v1.PolicyDelta} PolicyDelta - */ - PolicyDelta.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.PolicyDelta) - return object; - var message = new $root.google.iam.v1.PolicyDelta(); - if (object.bindingDeltas) { - if (!Array.isArray(object.bindingDeltas)) - throw TypeError(".google.iam.v1.PolicyDelta.bindingDeltas: array expected"); - message.bindingDeltas = []; - for (var i = 0; i < object.bindingDeltas.length; ++i) { - if (typeof object.bindingDeltas[i] !== "object") - throw TypeError(".google.iam.v1.PolicyDelta.bindingDeltas: object expected"); - message.bindingDeltas[i] = $root.google.iam.v1.BindingDelta.fromObject(object.bindingDeltas[i]); - } - } - if (object.auditConfigDeltas) { - if (!Array.isArray(object.auditConfigDeltas)) - throw TypeError(".google.iam.v1.PolicyDelta.auditConfigDeltas: array expected"); - message.auditConfigDeltas = []; - for (var i = 0; i < object.auditConfigDeltas.length; ++i) { - if (typeof object.auditConfigDeltas[i] !== "object") - throw TypeError(".google.iam.v1.PolicyDelta.auditConfigDeltas: object expected"); - message.auditConfigDeltas[i] = $root.google.iam.v1.AuditConfigDelta.fromObject(object.auditConfigDeltas[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a PolicyDelta message. Also converts values to other types if specified. - * @function toObject - * @memberof google.iam.v1.PolicyDelta - * @static - * @param {google.iam.v1.PolicyDelta} message PolicyDelta - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PolicyDelta.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.bindingDeltas = []; - object.auditConfigDeltas = []; - } - if (message.bindingDeltas && message.bindingDeltas.length) { - object.bindingDeltas = []; - for (var j = 0; j < message.bindingDeltas.length; ++j) - object.bindingDeltas[j] = $root.google.iam.v1.BindingDelta.toObject(message.bindingDeltas[j], options); - } - if (message.auditConfigDeltas && message.auditConfigDeltas.length) { - object.auditConfigDeltas = []; - for (var j = 0; j < message.auditConfigDeltas.length; ++j) - object.auditConfigDeltas[j] = $root.google.iam.v1.AuditConfigDelta.toObject(message.auditConfigDeltas[j], options); - } - return object; - }; - - /** - * Converts this PolicyDelta to JSON. - * @function toJSON - * @memberof google.iam.v1.PolicyDelta - * @instance - * @returns {Object.} JSON object - */ - PolicyDelta.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PolicyDelta - * @function getTypeUrl - * @memberof google.iam.v1.PolicyDelta - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PolicyDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.iam.v1.PolicyDelta"; - }; - - return PolicyDelta; - })(); - - v1.BindingDelta = (function() { - - /** - * Properties of a BindingDelta. - * @memberof google.iam.v1 - * @interface IBindingDelta - * @property {google.iam.v1.BindingDelta.Action|null} [action] BindingDelta action - * @property {string|null} [role] BindingDelta role - * @property {string|null} [member] BindingDelta member - * @property {google.type.IExpr|null} [condition] BindingDelta condition - */ - - /** - * Constructs a new BindingDelta. - * @memberof google.iam.v1 - * @classdesc Represents a BindingDelta. - * @implements IBindingDelta - * @constructor - * @param {google.iam.v1.IBindingDelta=} [properties] Properties to set - */ - function BindingDelta(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BindingDelta action. - * @member {google.iam.v1.BindingDelta.Action} action - * @memberof google.iam.v1.BindingDelta - * @instance - */ - BindingDelta.prototype.action = 0; - - /** - * BindingDelta role. - * @member {string} role - * @memberof google.iam.v1.BindingDelta - * @instance - */ - BindingDelta.prototype.role = ""; - - /** - * BindingDelta member. - * @member {string} member - * @memberof google.iam.v1.BindingDelta - * @instance - */ - BindingDelta.prototype.member = ""; - - /** - * BindingDelta condition. - * @member {google.type.IExpr|null|undefined} condition - * @memberof google.iam.v1.BindingDelta - * @instance - */ - BindingDelta.prototype.condition = null; - - /** - * Creates a new BindingDelta instance using the specified properties. - * @function create - * @memberof google.iam.v1.BindingDelta - * @static - * @param {google.iam.v1.IBindingDelta=} [properties] Properties to set - * @returns {google.iam.v1.BindingDelta} BindingDelta instance - */ - BindingDelta.create = function create(properties) { - return new BindingDelta(properties); - }; - - /** - * Encodes the specified BindingDelta message. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. - * @function encode - * @memberof google.iam.v1.BindingDelta - * @static - * @param {google.iam.v1.IBindingDelta} message BindingDelta message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BindingDelta.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.action != null && Object.hasOwnProperty.call(message, "action")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); - if (message.role != null && Object.hasOwnProperty.call(message, "role")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.role); - if (message.member != null && Object.hasOwnProperty.call(message, "member")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.member); - if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) - $root.google.type.Expr.encode(message.condition, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified BindingDelta message, length delimited. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. - * @function encodeDelimited - * @memberof google.iam.v1.BindingDelta - * @static - * @param {google.iam.v1.IBindingDelta} message BindingDelta message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BindingDelta.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BindingDelta message from the specified reader or buffer. - * @function decode - * @memberof google.iam.v1.BindingDelta - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.BindingDelta} BindingDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BindingDelta.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.BindingDelta(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.action = reader.int32(); - break; - } - case 2: { - message.role = reader.string(); - break; - } - case 3: { - message.member = reader.string(); - break; - } - case 4: { - message.condition = $root.google.type.Expr.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BindingDelta message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.iam.v1.BindingDelta - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.BindingDelta} BindingDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BindingDelta.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BindingDelta message. - * @function verify - * @memberof google.iam.v1.BindingDelta - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BindingDelta.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.action != null && message.hasOwnProperty("action")) - switch (message.action) { - default: - return "action: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.role != null && message.hasOwnProperty("role")) - if (!$util.isString(message.role)) - return "role: string expected"; - if (message.member != null && message.hasOwnProperty("member")) - if (!$util.isString(message.member)) - return "member: string expected"; - if (message.condition != null && message.hasOwnProperty("condition")) { - var error = $root.google.type.Expr.verify(message.condition); - if (error) - return "condition." + error; - } - return null; - }; - - /** - * Creates a BindingDelta message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.iam.v1.BindingDelta - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v1.BindingDelta} BindingDelta - */ - BindingDelta.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.BindingDelta) - return object; - var message = new $root.google.iam.v1.BindingDelta(); - switch (object.action) { - default: - if (typeof object.action === "number") { - message.action = object.action; - break; - } - break; - case "ACTION_UNSPECIFIED": - case 0: - message.action = 0; - break; - case "ADD": - case 1: - message.action = 1; - break; - case "REMOVE": - case 2: - message.action = 2; - break; - } - if (object.role != null) - message.role = String(object.role); - if (object.member != null) - message.member = String(object.member); - if (object.condition != null) { - if (typeof object.condition !== "object") - throw TypeError(".google.iam.v1.BindingDelta.condition: object expected"); - message.condition = $root.google.type.Expr.fromObject(object.condition); - } - return message; - }; - - /** - * Creates a plain object from a BindingDelta message. Also converts values to other types if specified. - * @function toObject - * @memberof google.iam.v1.BindingDelta - * @static - * @param {google.iam.v1.BindingDelta} message BindingDelta - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BindingDelta.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.action = options.enums === String ? "ACTION_UNSPECIFIED" : 0; - object.role = ""; - object.member = ""; - object.condition = null; - } - if (message.action != null && message.hasOwnProperty("action")) - object.action = options.enums === String ? $root.google.iam.v1.BindingDelta.Action[message.action] === undefined ? message.action : $root.google.iam.v1.BindingDelta.Action[message.action] : message.action; - if (message.role != null && message.hasOwnProperty("role")) - object.role = message.role; - if (message.member != null && message.hasOwnProperty("member")) - object.member = message.member; - if (message.condition != null && message.hasOwnProperty("condition")) - object.condition = $root.google.type.Expr.toObject(message.condition, options); - return object; - }; - - /** - * Converts this BindingDelta to JSON. - * @function toJSON - * @memberof google.iam.v1.BindingDelta - * @instance - * @returns {Object.} JSON object - */ - BindingDelta.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BindingDelta - * @function getTypeUrl - * @memberof google.iam.v1.BindingDelta - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BindingDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.iam.v1.BindingDelta"; - }; - - /** - * Action enum. - * @name google.iam.v1.BindingDelta.Action - * @enum {number} - * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value - * @property {number} ADD=1 ADD value - * @property {number} REMOVE=2 REMOVE value - */ - BindingDelta.Action = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ACTION_UNSPECIFIED"] = 0; - values[valuesById[1] = "ADD"] = 1; - values[valuesById[2] = "REMOVE"] = 2; - return values; - })(); - - return BindingDelta; - })(); - - v1.AuditConfigDelta = (function() { - - /** - * Properties of an AuditConfigDelta. - * @memberof google.iam.v1 - * @interface IAuditConfigDelta - * @property {google.iam.v1.AuditConfigDelta.Action|null} [action] AuditConfigDelta action - * @property {string|null} [service] AuditConfigDelta service - * @property {string|null} [exemptedMember] AuditConfigDelta exemptedMember - * @property {string|null} [logType] AuditConfigDelta logType - */ - - /** - * Constructs a new AuditConfigDelta. - * @memberof google.iam.v1 - * @classdesc Represents an AuditConfigDelta. - * @implements IAuditConfigDelta - * @constructor - * @param {google.iam.v1.IAuditConfigDelta=} [properties] Properties to set - */ - function AuditConfigDelta(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AuditConfigDelta action. - * @member {google.iam.v1.AuditConfigDelta.Action} action - * @memberof google.iam.v1.AuditConfigDelta - * @instance - */ - AuditConfigDelta.prototype.action = 0; - - /** - * AuditConfigDelta service. - * @member {string} service - * @memberof google.iam.v1.AuditConfigDelta - * @instance - */ - AuditConfigDelta.prototype.service = ""; - - /** - * AuditConfigDelta exemptedMember. - * @member {string} exemptedMember - * @memberof google.iam.v1.AuditConfigDelta - * @instance - */ - AuditConfigDelta.prototype.exemptedMember = ""; - - /** - * AuditConfigDelta logType. - * @member {string} logType - * @memberof google.iam.v1.AuditConfigDelta - * @instance - */ - AuditConfigDelta.prototype.logType = ""; - - /** - * Creates a new AuditConfigDelta instance using the specified properties. - * @function create - * @memberof google.iam.v1.AuditConfigDelta - * @static - * @param {google.iam.v1.IAuditConfigDelta=} [properties] Properties to set - * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta instance - */ - AuditConfigDelta.create = function create(properties) { - return new AuditConfigDelta(properties); - }; - - /** - * Encodes the specified AuditConfigDelta message. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. - * @function encode - * @memberof google.iam.v1.AuditConfigDelta - * @static - * @param {google.iam.v1.IAuditConfigDelta} message AuditConfigDelta message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AuditConfigDelta.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.action != null && Object.hasOwnProperty.call(message, "action")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); - if (message.service != null && Object.hasOwnProperty.call(message, "service")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.service); - if (message.exemptedMember != null && Object.hasOwnProperty.call(message, "exemptedMember")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.exemptedMember); - if (message.logType != null && Object.hasOwnProperty.call(message, "logType")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.logType); - return writer; - }; - - /** - * Encodes the specified AuditConfigDelta message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. - * @function encodeDelimited - * @memberof google.iam.v1.AuditConfigDelta - * @static - * @param {google.iam.v1.IAuditConfigDelta} message AuditConfigDelta message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AuditConfigDelta.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AuditConfigDelta message from the specified reader or buffer. - * @function decode - * @memberof google.iam.v1.AuditConfigDelta - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AuditConfigDelta.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.AuditConfigDelta(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.action = reader.int32(); - break; - } - case 2: { - message.service = reader.string(); - break; - } - case 3: { - message.exemptedMember = reader.string(); - break; - } - case 4: { - message.logType = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AuditConfigDelta message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.iam.v1.AuditConfigDelta - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AuditConfigDelta.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AuditConfigDelta message. - * @function verify - * @memberof google.iam.v1.AuditConfigDelta - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AuditConfigDelta.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.action != null && message.hasOwnProperty("action")) - switch (message.action) { - default: - return "action: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.service != null && message.hasOwnProperty("service")) - if (!$util.isString(message.service)) - return "service: string expected"; - if (message.exemptedMember != null && message.hasOwnProperty("exemptedMember")) - if (!$util.isString(message.exemptedMember)) - return "exemptedMember: string expected"; - if (message.logType != null && message.hasOwnProperty("logType")) - if (!$util.isString(message.logType)) - return "logType: string expected"; - return null; - }; - - /** - * Creates an AuditConfigDelta message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.iam.v1.AuditConfigDelta - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta - */ - AuditConfigDelta.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.AuditConfigDelta) - return object; - var message = new $root.google.iam.v1.AuditConfigDelta(); - switch (object.action) { - default: - if (typeof object.action === "number") { - message.action = object.action; - break; - } - break; - case "ACTION_UNSPECIFIED": - case 0: - message.action = 0; - break; - case "ADD": - case 1: - message.action = 1; - break; - case "REMOVE": - case 2: - message.action = 2; - break; - } - if (object.service != null) - message.service = String(object.service); - if (object.exemptedMember != null) - message.exemptedMember = String(object.exemptedMember); - if (object.logType != null) - message.logType = String(object.logType); - return message; - }; - - /** - * Creates a plain object from an AuditConfigDelta message. Also converts values to other types if specified. - * @function toObject - * @memberof google.iam.v1.AuditConfigDelta - * @static - * @param {google.iam.v1.AuditConfigDelta} message AuditConfigDelta - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AuditConfigDelta.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.action = options.enums === String ? "ACTION_UNSPECIFIED" : 0; - object.service = ""; - object.exemptedMember = ""; - object.logType = ""; - } - if (message.action != null && message.hasOwnProperty("action")) - object.action = options.enums === String ? $root.google.iam.v1.AuditConfigDelta.Action[message.action] === undefined ? message.action : $root.google.iam.v1.AuditConfigDelta.Action[message.action] : message.action; - if (message.service != null && message.hasOwnProperty("service")) - object.service = message.service; - if (message.exemptedMember != null && message.hasOwnProperty("exemptedMember")) - object.exemptedMember = message.exemptedMember; - if (message.logType != null && message.hasOwnProperty("logType")) - object.logType = message.logType; - return object; - }; - - /** - * Converts this AuditConfigDelta to JSON. - * @function toJSON - * @memberof google.iam.v1.AuditConfigDelta - * @instance - * @returns {Object.} JSON object - */ - AuditConfigDelta.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AuditConfigDelta - * @function getTypeUrl - * @memberof google.iam.v1.AuditConfigDelta - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AuditConfigDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.iam.v1.AuditConfigDelta"; - }; - - /** - * Action enum. - * @name google.iam.v1.AuditConfigDelta.Action - * @enum {number} - * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value - * @property {number} ADD=1 ADD value - * @property {number} REMOVE=2 REMOVE value - */ - AuditConfigDelta.Action = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ACTION_UNSPECIFIED"] = 0; - values[valuesById[1] = "ADD"] = 1; - values[valuesById[2] = "REMOVE"] = 2; - return values; - })(); - - return AuditConfigDelta; - })(); - - return v1; - })(); - - return iam; - })(); - - google.type = (function() { - - /** - * Namespace type. - * @memberof google - * @namespace - */ - var type = {}; - - type.Expr = (function() { - - /** - * Properties of an Expr. - * @memberof google.type - * @interface IExpr - * @property {string|null} [expression] Expr expression - * @property {string|null} [title] Expr title - * @property {string|null} [description] Expr description - * @property {string|null} [location] Expr location - */ - - /** - * Constructs a new Expr. - * @memberof google.type - * @classdesc Represents an Expr. - * @implements IExpr - * @constructor - * @param {google.type.IExpr=} [properties] Properties to set - */ - function Expr(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Expr expression. - * @member {string} expression - * @memberof google.type.Expr - * @instance - */ - Expr.prototype.expression = ""; - - /** - * Expr title. - * @member {string} title - * @memberof google.type.Expr - * @instance - */ - Expr.prototype.title = ""; - - /** - * Expr description. - * @member {string} description - * @memberof google.type.Expr - * @instance - */ - Expr.prototype.description = ""; - - /** - * Expr location. - * @member {string} location - * @memberof google.type.Expr - * @instance - */ - Expr.prototype.location = ""; - - /** - * Creates a new Expr instance using the specified properties. - * @function create - * @memberof google.type.Expr - * @static - * @param {google.type.IExpr=} [properties] Properties to set - * @returns {google.type.Expr} Expr instance - */ - Expr.create = function create(properties) { - return new Expr(properties); - }; - - /** - * Encodes the specified Expr message. Does not implicitly {@link google.type.Expr.verify|verify} messages. - * @function encode - * @memberof google.type.Expr - * @static - * @param {google.type.IExpr} message Expr message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Expr.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.expression != null && Object.hasOwnProperty.call(message, "expression")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.expression); - if (message.title != null && Object.hasOwnProperty.call(message, "title")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.title); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); - if (message.location != null && Object.hasOwnProperty.call(message, "location")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.location); - return writer; - }; - - /** - * Encodes the specified Expr message, length delimited. Does not implicitly {@link google.type.Expr.verify|verify} messages. - * @function encodeDelimited - * @memberof google.type.Expr - * @static - * @param {google.type.IExpr} message Expr message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Expr.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Expr message from the specified reader or buffer. - * @function decode - * @memberof google.type.Expr - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.type.Expr} Expr - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Expr.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.Expr(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.expression = reader.string(); - break; - } - case 2: { - message.title = reader.string(); - break; - } - case 3: { - message.description = reader.string(); - break; - } - case 4: { - message.location = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Expr message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.type.Expr - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.type.Expr} Expr - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Expr.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Expr message. - * @function verify - * @memberof google.type.Expr - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Expr.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.expression != null && message.hasOwnProperty("expression")) - if (!$util.isString(message.expression)) - return "expression: string expected"; - if (message.title != null && message.hasOwnProperty("title")) - if (!$util.isString(message.title)) - return "title: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.location != null && message.hasOwnProperty("location")) - if (!$util.isString(message.location)) - return "location: string expected"; - return null; - }; - - /** - * Creates an Expr message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.type.Expr - * @static - * @param {Object.} object Plain object - * @returns {google.type.Expr} Expr - */ - Expr.fromObject = function fromObject(object) { - if (object instanceof $root.google.type.Expr) - return object; - var message = new $root.google.type.Expr(); - if (object.expression != null) - message.expression = String(object.expression); - if (object.title != null) - message.title = String(object.title); - if (object.description != null) - message.description = String(object.description); - if (object.location != null) - message.location = String(object.location); - return message; - }; - - /** - * Creates a plain object from an Expr message. Also converts values to other types if specified. - * @function toObject - * @memberof google.type.Expr - * @static - * @param {google.type.Expr} message Expr - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Expr.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.expression = ""; - object.title = ""; - object.description = ""; - object.location = ""; - } - if (message.expression != null && message.hasOwnProperty("expression")) - object.expression = message.expression; - if (message.title != null && message.hasOwnProperty("title")) - object.title = message.title; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.location != null && message.hasOwnProperty("location")) - object.location = message.location; - return object; - }; - - /** - * Converts this Expr to JSON. - * @function toJSON - * @memberof google.type.Expr - * @instance - * @returns {Object.} JSON object - */ - Expr.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Expr - * @function getTypeUrl - * @memberof google.type.Expr - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Expr.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.type.Expr"; - }; - - return Expr; - })(); - - return type; - })(); - - return google; - })(); - - return $root; -}); diff --git a/owl-bot-staging/admin/database/v1/protos/protos.json b/owl-bot-staging/admin/database/v1/protos/protos.json deleted file mode 100644 index 46977cdbc..000000000 --- a/owl-bot-staging/admin/database/v1/protos/protos.json +++ /dev/null @@ -1,4651 +0,0 @@ -{ - "nested": { - "google": { - "nested": { - "spanner": { - "nested": { - "admin": { - "nested": { - "database": { - "nested": { - "v1": { - "options": { - "csharp_namespace": "Google.Cloud.Spanner.Admin.Database.V1", - "go_package": "cloud.google.com/go/spanner/admin/database/apiv1/databasepb;databasepb", - "java_multiple_files": true, - "java_outer_classname": "SpannerDatabaseAdminProto", - "java_package": "com.google.spanner.admin.database.v1", - "php_namespace": "Google\\Cloud\\Spanner\\Admin\\Database\\V1", - "ruby_package": "Google::Cloud::Spanner::Admin::Database::V1", - "(google.api.resource_definition).type": "spanner.googleapis.com/InstancePartition", - "(google.api.resource_definition).pattern": "projects/{project}/instances/{instance}/instancePartitions/{instance_partition}" - }, - "nested": { - "Backup": { - "options": { - "(google.api.resource).type": "spanner.googleapis.com/Backup", - "(google.api.resource).pattern": "projects/{project}/instances/{instance}/backups/{backup}" - }, - "fields": { - "database": { - "type": "string", - "id": 2, - "options": { - "(google.api.resource_reference).type": "spanner.googleapis.com/Database" - } - }, - "versionTime": { - "type": "google.protobuf.Timestamp", - "id": 9 - }, - "expireTime": { - "type": "google.protobuf.Timestamp", - "id": 3 - }, - "name": { - "type": "string", - "id": 1 - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "sizeBytes": { - "type": "int64", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "freeableSizeBytes": { - "type": "int64", - "id": 15, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "exclusiveSizeBytes": { - "type": "int64", - "id": 16, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "state": { - "type": "State", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "referencingDatabases": { - "rule": "repeated", - "type": "string", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "(google.api.resource_reference).type": "spanner.googleapis.com/Database" - } - }, - "encryptionInfo": { - "type": "EncryptionInfo", - "id": 8, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "encryptionInformation": { - "rule": "repeated", - "type": "EncryptionInfo", - "id": 13, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "databaseDialect": { - "type": "DatabaseDialect", - "id": 10, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "referencingBackups": { - "rule": "repeated", - "type": "string", - "id": 11, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "(google.api.resource_reference).type": "spanner.googleapis.com/Backup" - } - }, - "maxExpireTime": { - "type": "google.protobuf.Timestamp", - "id": 12, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "backupSchedules": { - "rule": "repeated", - "type": "string", - "id": 14, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "(google.api.resource_reference).type": "spanner.googleapis.com/BackupSchedule" - } - }, - "incrementalBackupChainId": { - "type": "string", - "id": 17, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "oldestVersionTime": { - "type": "google.protobuf.Timestamp", - "id": 18, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "instancePartitions": { - "rule": "repeated", - "type": "BackupInstancePartition", - "id": 19, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - }, - "nested": { - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "CREATING": 1, - "READY": 2 - } - } - } - }, - "CreateBackupRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/Instance" - } - }, - "backupId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "backup": { - "type": "Backup", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "encryptionConfig": { - "type": "CreateBackupEncryptionConfig", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "CreateBackupMetadata": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.resource_reference).type": "spanner.googleapis.com/Backup" - } - }, - "database": { - "type": "string", - "id": 2, - "options": { - "(google.api.resource_reference).type": "spanner.googleapis.com/Database" - } - }, - "progress": { - "type": "OperationProgress", - "id": 3 - }, - "cancelTime": { - "type": "google.protobuf.Timestamp", - "id": 4 - } - } - }, - "CopyBackupRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/Instance" - } - }, - "backupId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "sourceBackup": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/Backup" - } - }, - "expireTime": { - "type": "google.protobuf.Timestamp", - "id": 4, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "encryptionConfig": { - "type": "CopyBackupEncryptionConfig", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "CopyBackupMetadata": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.resource_reference).type": "spanner.googleapis.com/Backup" - } - }, - "sourceBackup": { - "type": "string", - "id": 2, - "options": { - "(google.api.resource_reference).type": "spanner.googleapis.com/Backup" - } - }, - "progress": { - "type": "OperationProgress", - "id": 3 - }, - "cancelTime": { - "type": "google.protobuf.Timestamp", - "id": 4 - } - } - }, - "UpdateBackupRequest": { - "fields": { - "backup": { - "type": "Backup", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "GetBackupRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/Backup" - } - } - } - }, - "DeleteBackupRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/Backup" - } - } - } - }, - "ListBackupsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/Instance" - } - }, - "filter": { - "type": "string", - "id": 2 - }, - "pageSize": { - "type": "int32", - "id": 3 - }, - "pageToken": { - "type": "string", - "id": 4 - } - } - }, - "ListBackupsResponse": { - "fields": { - "backups": { - "rule": "repeated", - "type": "Backup", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "ListBackupOperationsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/Instance" - } - }, - "filter": { - "type": "string", - "id": 2 - }, - "pageSize": { - "type": "int32", - "id": 3 - }, - "pageToken": { - "type": "string", - "id": 4 - } - } - }, - "ListBackupOperationsResponse": { - "fields": { - "operations": { - "rule": "repeated", - "type": "google.longrunning.Operation", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "BackupInfo": { - "fields": { - "backup": { - "type": "string", - "id": 1, - "options": { - "(google.api.resource_reference).type": "spanner.googleapis.com/Backup" - } - }, - "versionTime": { - "type": "google.protobuf.Timestamp", - "id": 4 - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 2 - }, - "sourceDatabase": { - "type": "string", - "id": 3, - "options": { - "(google.api.resource_reference).type": "spanner.googleapis.com/Database" - } - } - } - }, - "CreateBackupEncryptionConfig": { - "fields": { - "encryptionType": { - "type": "EncryptionType", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "kmsKeyName": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" - } - }, - "kmsKeyNames": { - "rule": "repeated", - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" - } - } - }, - "nested": { - "EncryptionType": { - "values": { - "ENCRYPTION_TYPE_UNSPECIFIED": 0, - "USE_DATABASE_ENCRYPTION": 1, - "GOOGLE_DEFAULT_ENCRYPTION": 2, - "CUSTOMER_MANAGED_ENCRYPTION": 3 - } - } - } - }, - "CopyBackupEncryptionConfig": { - "fields": { - "encryptionType": { - "type": "EncryptionType", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "kmsKeyName": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" - } - }, - "kmsKeyNames": { - "rule": "repeated", - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" - } - } - }, - "nested": { - "EncryptionType": { - "values": { - "ENCRYPTION_TYPE_UNSPECIFIED": 0, - "USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION": 1, - "GOOGLE_DEFAULT_ENCRYPTION": 2, - "CUSTOMER_MANAGED_ENCRYPTION": 3 - } - } - } - }, - "FullBackupSpec": { - "fields": {} - }, - "IncrementalBackupSpec": { - "fields": {} - }, - "BackupInstancePartition": { - "fields": { - "instancePartition": { - "type": "string", - "id": 1, - "options": { - "(google.api.resource_reference).type": "spanner.googleapis.com/InstancePartition" - } - } - } - }, - "OperationProgress": { - "fields": { - "progressPercent": { - "type": "int32", - "id": 1 - }, - "startTime": { - "type": "google.protobuf.Timestamp", - "id": 2 - }, - "endTime": { - "type": "google.protobuf.Timestamp", - "id": 3 - } - } - }, - "EncryptionConfig": { - "fields": { - "kmsKeyName": { - "type": "string", - "id": 2, - "options": { - "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" - } - }, - "kmsKeyNames": { - "rule": "repeated", - "type": "string", - "id": 3, - "options": { - "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" - } - } - } - }, - "EncryptionInfo": { - "fields": { - "encryptionType": { - "type": "Type", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "encryptionStatus": { - "type": "google.rpc.Status", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "kmsKeyVersion": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKeyVersion" - } - } - }, - "nested": { - "Type": { - "values": { - "TYPE_UNSPECIFIED": 0, - "GOOGLE_DEFAULT_ENCRYPTION": 1, - "CUSTOMER_MANAGED_ENCRYPTION": 2 - } - } - } - }, - "DatabaseDialect": { - "values": { - "DATABASE_DIALECT_UNSPECIFIED": 0, - "GOOGLE_STANDARD_SQL": 1, - "POSTGRESQL": 2 - } - }, - "BackupScheduleSpec": { - "oneofs": { - "scheduleSpec": { - "oneof": [ - "cronSpec" - ] - } - }, - "fields": { - "cronSpec": { - "type": "CrontabSpec", - "id": 1 - } - } - }, - "BackupSchedule": { - "options": { - "(google.api.resource).type": "spanner.googleapis.com/BackupSchedule", - "(google.api.resource).pattern": "projects/{project}/instances/{instance}/databases/{database}/backupSchedules/{schedule}", - "(google.api.resource).plural": "backupSchedules", - "(google.api.resource).singular": "backupSchedule" - }, - "oneofs": { - "backupTypeSpec": { - "oneof": [ - "fullBackupSpec", - "incrementalBackupSpec" - ] - } - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER" - } - }, - "spec": { - "type": "BackupScheduleSpec", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "retentionDuration": { - "type": "google.protobuf.Duration", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "encryptionConfig": { - "type": "CreateBackupEncryptionConfig", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "fullBackupSpec": { - "type": "FullBackupSpec", - "id": 7 - }, - "incrementalBackupSpec": { - "type": "IncrementalBackupSpec", - "id": 8 - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 9, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "CrontabSpec": { - "fields": { - "text": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "timeZone": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "creationWindow": { - "type": "google.protobuf.Duration", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "CreateBackupScheduleRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/Database" - } - }, - "backupScheduleId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "backupSchedule": { - "type": "BackupSchedule", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "GetBackupScheduleRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/BackupSchedule" - } - } - } - }, - "DeleteBackupScheduleRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/BackupSchedule" - } - } - } - }, - "ListBackupSchedulesRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/Database" - } - }, - "pageSize": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pageToken": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListBackupSchedulesResponse": { - "fields": { - "backupSchedules": { - "rule": "repeated", - "type": "BackupSchedule", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "UpdateBackupScheduleRequest": { - "fields": { - "backupSchedule": { - "type": "BackupSchedule", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "DatabaseAdmin": { - "options": { - "(google.api.default_host)": "spanner.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/spanner.admin" - }, - "methods": { - "ListDatabases": { - "requestType": "ListDatabasesRequest", - "responseType": "ListDatabasesResponse", - "options": { - "(google.api.http).get": "/v1/{parent=projects/*/instances/*}/databases", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=projects/*/instances/*}/databases" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "CreateDatabase": { - "requestType": "CreateDatabaseRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1/{parent=projects/*/instances/*}/databases", - "(google.api.http).body": "*", - "(google.api.method_signature)": "parent,create_statement", - "(google.longrunning.operation_info).response_type": "google.spanner.admin.database.v1.Database", - "(google.longrunning.operation_info).metadata_type": "google.spanner.admin.database.v1.CreateDatabaseMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{parent=projects/*/instances/*}/databases", - "body": "*" - } - }, - { - "(google.api.method_signature)": "parent,create_statement" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "google.spanner.admin.database.v1.Database", - "metadata_type": "google.spanner.admin.database.v1.CreateDatabaseMetadata" - } - } - ] - }, - "GetDatabase": { - "requestType": "GetDatabaseRequest", - "responseType": "Database", - "options": { - "(google.api.http).get": "/v1/{name=projects/*/instances/*/databases/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=projects/*/instances/*/databases/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "UpdateDatabase": { - "requestType": "UpdateDatabaseRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).patch": "/v1/{database.name=projects/*/instances/*/databases/*}", - "(google.api.http).body": "database", - "(google.api.method_signature)": "database,update_mask", - "(google.longrunning.operation_info).response_type": "Database", - "(google.longrunning.operation_info).metadata_type": "UpdateDatabaseMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v1/{database.name=projects/*/instances/*/databases/*}", - "body": "database" - } - }, - { - "(google.api.method_signature)": "database,update_mask" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "Database", - "metadata_type": "UpdateDatabaseMetadata" - } - } - ] - }, - "UpdateDatabaseDdl": { - "requestType": "UpdateDatabaseDdlRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).patch": "/v1/{database=projects/*/instances/*/databases/*}/ddl", - "(google.api.http).body": "*", - "(google.api.method_signature)": "database,statements", - "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", - "(google.longrunning.operation_info).metadata_type": "google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v1/{database=projects/*/instances/*/databases/*}/ddl", - "body": "*" - } - }, - { - "(google.api.method_signature)": "database,statements" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "google.protobuf.Empty", - "metadata_type": "google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata" - } - } - ] - }, - "DropDatabase": { - "requestType": "DropDatabaseRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v1/{database=projects/*/instances/*/databases/*}", - "(google.api.method_signature)": "database" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1/{database=projects/*/instances/*/databases/*}" - } - }, - { - "(google.api.method_signature)": "database" - } - ] - }, - "GetDatabaseDdl": { - "requestType": "GetDatabaseDdlRequest", - "responseType": "GetDatabaseDdlResponse", - "options": { - "(google.api.http).get": "/v1/{database=projects/*/instances/*/databases/*}/ddl", - "(google.api.method_signature)": "database" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{database=projects/*/instances/*/databases/*}/ddl" - } - }, - { - "(google.api.method_signature)": "database" - } - ] - }, - "SetIamPolicy": { - "requestType": "google.iam.v1.SetIamPolicyRequest", - "responseType": "google.iam.v1.Policy", - "options": { - "(google.api.http).post": "/v1/{resource=projects/*/instances/*/databases/*}:setIamPolicy", - "(google.api.http).body": "*", - "(google.api.http).additional_bindings.post": "/v1/{resource=projects/*/instances/*/databases/*/backupSchedules/*}:setIamPolicy", - "(google.api.http).additional_bindings.body": "*", - "(google.api.method_signature)": "resource,policy" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{resource=projects/*/instances/*/databases/*}:setIamPolicy", - "body": "*", - "additional_bindings": [ - { - "post": "/v1/{resource=projects/*/instances/*/backups/*}:setIamPolicy", - "body": "*" - }, - { - "post": "/v1/{resource=projects/*/instances/*/databases/*/backupSchedules/*}:setIamPolicy", - "body": "*" - } - ] - } - }, - { - "(google.api.method_signature)": "resource,policy" - } - ] - }, - "GetIamPolicy": { - "requestType": "google.iam.v1.GetIamPolicyRequest", - "responseType": "google.iam.v1.Policy", - "options": { - "(google.api.http).post": "/v1/{resource=projects/*/instances/*/databases/*}:getIamPolicy", - "(google.api.http).body": "*", - "(google.api.http).additional_bindings.post": "/v1/{resource=projects/*/instances/*/databases/*/backupSchedules/*}:getIamPolicy", - "(google.api.http).additional_bindings.body": "*", - "(google.api.method_signature)": "resource" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{resource=projects/*/instances/*/databases/*}:getIamPolicy", - "body": "*", - "additional_bindings": [ - { - "post": "/v1/{resource=projects/*/instances/*/backups/*}:getIamPolicy", - "body": "*" - }, - { - "post": "/v1/{resource=projects/*/instances/*/databases/*/backupSchedules/*}:getIamPolicy", - "body": "*" - } - ] - } - }, - { - "(google.api.method_signature)": "resource" - } - ] - }, - "TestIamPermissions": { - "requestType": "google.iam.v1.TestIamPermissionsRequest", - "responseType": "google.iam.v1.TestIamPermissionsResponse", - "options": { - "(google.api.http).post": "/v1/{resource=projects/*/instances/*/databases/*}:testIamPermissions", - "(google.api.http).body": "*", - "(google.api.http).additional_bindings.post": "/v1/{resource=projects/*/instances/*/databases/*/databaseRoles/*}:testIamPermissions", - "(google.api.http).additional_bindings.body": "*", - "(google.api.method_signature)": "resource,permissions" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{resource=projects/*/instances/*/databases/*}:testIamPermissions", - "body": "*", - "additional_bindings": [ - { - "post": "/v1/{resource=projects/*/instances/*/backups/*}:testIamPermissions", - "body": "*" - }, - { - "post": "/v1/{resource=projects/*/instances/*/databases/*/backupSchedules/*}:testIamPermissions", - "body": "*" - }, - { - "post": "/v1/{resource=projects/*/instances/*/databases/*/databaseRoles/*}:testIamPermissions", - "body": "*" - } - ] - } - }, - { - "(google.api.method_signature)": "resource,permissions" - } - ] - }, - "CreateBackup": { - "requestType": "CreateBackupRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1/{parent=projects/*/instances/*}/backups", - "(google.api.http).body": "backup", - "(google.api.method_signature)": "parent,backup,backup_id", - "(google.longrunning.operation_info).response_type": "google.spanner.admin.database.v1.Backup", - "(google.longrunning.operation_info).metadata_type": "google.spanner.admin.database.v1.CreateBackupMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{parent=projects/*/instances/*}/backups", - "body": "backup" - } - }, - { - "(google.api.method_signature)": "parent,backup,backup_id" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "google.spanner.admin.database.v1.Backup", - "metadata_type": "google.spanner.admin.database.v1.CreateBackupMetadata" - } - } - ] - }, - "CopyBackup": { - "requestType": "CopyBackupRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1/{parent=projects/*/instances/*}/backups:copy", - "(google.api.http).body": "*", - "(google.api.method_signature)": "parent,backup_id,source_backup,expire_time", - "(google.longrunning.operation_info).response_type": "google.spanner.admin.database.v1.Backup", - "(google.longrunning.operation_info).metadata_type": "google.spanner.admin.database.v1.CopyBackupMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{parent=projects/*/instances/*}/backups:copy", - "body": "*" - } - }, - { - "(google.api.method_signature)": "parent,backup_id,source_backup,expire_time" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "google.spanner.admin.database.v1.Backup", - "metadata_type": "google.spanner.admin.database.v1.CopyBackupMetadata" - } - } - ] - }, - "GetBackup": { - "requestType": "GetBackupRequest", - "responseType": "Backup", - "options": { - "(google.api.http).get": "/v1/{name=projects/*/instances/*/backups/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=projects/*/instances/*/backups/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "UpdateBackup": { - "requestType": "UpdateBackupRequest", - "responseType": "Backup", - "options": { - "(google.api.http).patch": "/v1/{backup.name=projects/*/instances/*/backups/*}", - "(google.api.http).body": "backup", - "(google.api.method_signature)": "backup,update_mask" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v1/{backup.name=projects/*/instances/*/backups/*}", - "body": "backup" - } - }, - { - "(google.api.method_signature)": "backup,update_mask" - } - ] - }, - "DeleteBackup": { - "requestType": "DeleteBackupRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v1/{name=projects/*/instances/*/backups/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1/{name=projects/*/instances/*/backups/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListBackups": { - "requestType": "ListBackupsRequest", - "responseType": "ListBackupsResponse", - "options": { - "(google.api.http).get": "/v1/{parent=projects/*/instances/*}/backups", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=projects/*/instances/*}/backups" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "RestoreDatabase": { - "requestType": "RestoreDatabaseRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1/{parent=projects/*/instances/*}/databases:restore", - "(google.api.http).body": "*", - "(google.api.method_signature)": "parent,database_id,backup", - "(google.longrunning.operation_info).response_type": "google.spanner.admin.database.v1.Database", - "(google.longrunning.operation_info).metadata_type": "google.spanner.admin.database.v1.RestoreDatabaseMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{parent=projects/*/instances/*}/databases:restore", - "body": "*" - } - }, - { - "(google.api.method_signature)": "parent,database_id,backup" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "google.spanner.admin.database.v1.Database", - "metadata_type": "google.spanner.admin.database.v1.RestoreDatabaseMetadata" - } - } - ] - }, - "ListDatabaseOperations": { - "requestType": "ListDatabaseOperationsRequest", - "responseType": "ListDatabaseOperationsResponse", - "options": { - "(google.api.http).get": "/v1/{parent=projects/*/instances/*}/databaseOperations", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=projects/*/instances/*}/databaseOperations" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "ListBackupOperations": { - "requestType": "ListBackupOperationsRequest", - "responseType": "ListBackupOperationsResponse", - "options": { - "(google.api.http).get": "/v1/{parent=projects/*/instances/*}/backupOperations", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=projects/*/instances/*}/backupOperations" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "ListDatabaseRoles": { - "requestType": "ListDatabaseRolesRequest", - "responseType": "ListDatabaseRolesResponse", - "options": { - "(google.api.http).get": "/v1/{parent=projects/*/instances/*/databases/*}/databaseRoles", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=projects/*/instances/*/databases/*}/databaseRoles" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "AddSplitPoints": { - "requestType": "AddSplitPointsRequest", - "responseType": "AddSplitPointsResponse", - "options": { - "(google.api.http).post": "/v1/{database=projects/*/instances/*/databases/*}:addSplitPoints", - "(google.api.http).body": "*", - "(google.api.method_signature)": "database,split_points" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{database=projects/*/instances/*/databases/*}:addSplitPoints", - "body": "*" - } - }, - { - "(google.api.method_signature)": "database,split_points" - } - ] - }, - "CreateBackupSchedule": { - "requestType": "CreateBackupScheduleRequest", - "responseType": "BackupSchedule", - "options": { - "(google.api.http).post": "/v1/{parent=projects/*/instances/*/databases/*}/backupSchedules", - "(google.api.http).body": "backup_schedule", - "(google.api.method_signature)": "parent,backup_schedule,backup_schedule_id" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{parent=projects/*/instances/*/databases/*}/backupSchedules", - "body": "backup_schedule" - } - }, - { - "(google.api.method_signature)": "parent,backup_schedule,backup_schedule_id" - } - ] - }, - "GetBackupSchedule": { - "requestType": "GetBackupScheduleRequest", - "responseType": "BackupSchedule", - "options": { - "(google.api.http).get": "/v1/{name=projects/*/instances/*/databases/*/backupSchedules/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=projects/*/instances/*/databases/*/backupSchedules/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "UpdateBackupSchedule": { - "requestType": "UpdateBackupScheduleRequest", - "responseType": "BackupSchedule", - "options": { - "(google.api.http).patch": "/v1/{backup_schedule.name=projects/*/instances/*/databases/*/backupSchedules/*}", - "(google.api.http).body": "backup_schedule", - "(google.api.method_signature)": "backup_schedule,update_mask" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v1/{backup_schedule.name=projects/*/instances/*/databases/*/backupSchedules/*}", - "body": "backup_schedule" - } - }, - { - "(google.api.method_signature)": "backup_schedule,update_mask" - } - ] - }, - "DeleteBackupSchedule": { - "requestType": "DeleteBackupScheduleRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v1/{name=projects/*/instances/*/databases/*/backupSchedules/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1/{name=projects/*/instances/*/databases/*/backupSchedules/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListBackupSchedules": { - "requestType": "ListBackupSchedulesRequest", - "responseType": "ListBackupSchedulesResponse", - "options": { - "(google.api.http).get": "/v1/{parent=projects/*/instances/*/databases/*}/backupSchedules", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=projects/*/instances/*/databases/*}/backupSchedules" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "InternalUpdateGraphOperation": { - "requestType": "InternalUpdateGraphOperationRequest", - "responseType": "InternalUpdateGraphOperationResponse", - "options": { - "(google.api.method_signature)": "database,operation_id" - }, - "parsedOptions": [ - { - "(google.api.method_signature)": "database,operation_id" - } - ] - } - } - }, - "RestoreInfo": { - "oneofs": { - "sourceInfo": { - "oneof": [ - "backupInfo" - ] - } - }, - "fields": { - "sourceType": { - "type": "RestoreSourceType", - "id": 1 - }, - "backupInfo": { - "type": "BackupInfo", - "id": 2 - } - } - }, - "Database": { - "options": { - "(google.api.resource).type": "spanner.googleapis.com/Database", - "(google.api.resource).pattern": "projects/{project}/instances/{instance}/databases/{database}" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "state": { - "type": "State", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "restoreInfo": { - "type": "RestoreInfo", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "encryptionConfig": { - "type": "EncryptionConfig", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "encryptionInfo": { - "rule": "repeated", - "type": "EncryptionInfo", - "id": 8, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "versionRetentionPeriod": { - "type": "string", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "earliestVersionTime": { - "type": "google.protobuf.Timestamp", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "defaultLeader": { - "type": "string", - "id": 9, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "databaseDialect": { - "type": "DatabaseDialect", - "id": 10, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "enableDropProtection": { - "type": "bool", - "id": 11 - }, - "reconciling": { - "type": "bool", - "id": 12, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - }, - "nested": { - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "CREATING": 1, - "READY": 2, - "READY_OPTIMIZING": 3 - } - } - } - }, - "ListDatabasesRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/Instance" - } - }, - "pageSize": { - "type": "int32", - "id": 3 - }, - "pageToken": { - "type": "string", - "id": 4 - } - } - }, - "ListDatabasesResponse": { - "fields": { - "databases": { - "rule": "repeated", - "type": "Database", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "CreateDatabaseRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/Instance" - } - }, - "createStatement": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "extraStatements": { - "rule": "repeated", - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "encryptionConfig": { - "type": "EncryptionConfig", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "databaseDialect": { - "type": "DatabaseDialect", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "protoDescriptors": { - "type": "bytes", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "CreateDatabaseMetadata": { - "fields": { - "database": { - "type": "string", - "id": 1, - "options": { - "(google.api.resource_reference).type": "spanner.googleapis.com/Database" - } - } - } - }, - "GetDatabaseRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/Database" - } - } - } - }, - "UpdateDatabaseRequest": { - "fields": { - "database": { - "type": "Database", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "UpdateDatabaseMetadata": { - "fields": { - "request": { - "type": "UpdateDatabaseRequest", - "id": 1 - }, - "progress": { - "type": "OperationProgress", - "id": 2 - }, - "cancelTime": { - "type": "google.protobuf.Timestamp", - "id": 3 - } - } - }, - "UpdateDatabaseDdlRequest": { - "fields": { - "database": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/Database" - } - }, - "statements": { - "rule": "repeated", - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "operationId": { - "type": "string", - "id": 3 - }, - "protoDescriptors": { - "type": "bytes", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "throughputMode": { - "type": "bool", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "DdlStatementActionInfo": { - "fields": { - "action": { - "type": "string", - "id": 1 - }, - "entityType": { - "type": "string", - "id": 2 - }, - "entityNames": { - "rule": "repeated", - "type": "string", - "id": 3 - } - } - }, - "UpdateDatabaseDdlMetadata": { - "fields": { - "database": { - "type": "string", - "id": 1, - "options": { - "(google.api.resource_reference).type": "spanner.googleapis.com/Database" - } - }, - "statements": { - "rule": "repeated", - "type": "string", - "id": 2 - }, - "commitTimestamps": { - "rule": "repeated", - "type": "google.protobuf.Timestamp", - "id": 3 - }, - "throttled": { - "type": "bool", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "progress": { - "rule": "repeated", - "type": "OperationProgress", - "id": 5 - }, - "actions": { - "rule": "repeated", - "type": "DdlStatementActionInfo", - "id": 6 - } - } - }, - "DropDatabaseRequest": { - "fields": { - "database": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/Database" - } - } - } - }, - "GetDatabaseDdlRequest": { - "fields": { - "database": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/Database" - } - } - } - }, - "GetDatabaseDdlResponse": { - "fields": { - "statements": { - "rule": "repeated", - "type": "string", - "id": 1 - }, - "protoDescriptors": { - "type": "bytes", - "id": 2 - } - } - }, - "ListDatabaseOperationsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/Instance" - } - }, - "filter": { - "type": "string", - "id": 2 - }, - "pageSize": { - "type": "int32", - "id": 3 - }, - "pageToken": { - "type": "string", - "id": 4 - } - } - }, - "ListDatabaseOperationsResponse": { - "fields": { - "operations": { - "rule": "repeated", - "type": "google.longrunning.Operation", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "RestoreDatabaseRequest": { - "oneofs": { - "source": { - "oneof": [ - "backup" - ] - } - }, - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/Instance" - } - }, - "databaseId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "backup": { - "type": "string", - "id": 3, - "options": { - "(google.api.resource_reference).type": "spanner.googleapis.com/Backup" - } - }, - "encryptionConfig": { - "type": "RestoreDatabaseEncryptionConfig", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "RestoreDatabaseEncryptionConfig": { - "fields": { - "encryptionType": { - "type": "EncryptionType", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "kmsKeyName": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" - } - }, - "kmsKeyNames": { - "rule": "repeated", - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" - } - } - }, - "nested": { - "EncryptionType": { - "values": { - "ENCRYPTION_TYPE_UNSPECIFIED": 0, - "USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION": 1, - "GOOGLE_DEFAULT_ENCRYPTION": 2, - "CUSTOMER_MANAGED_ENCRYPTION": 3 - } - } - } - }, - "RestoreDatabaseMetadata": { - "oneofs": { - "sourceInfo": { - "oneof": [ - "backupInfo" - ] - } - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.resource_reference).type": "spanner.googleapis.com/Database" - } - }, - "sourceType": { - "type": "RestoreSourceType", - "id": 2 - }, - "backupInfo": { - "type": "BackupInfo", - "id": 3 - }, - "progress": { - "type": "OperationProgress", - "id": 4 - }, - "cancelTime": { - "type": "google.protobuf.Timestamp", - "id": 5 - }, - "optimizeDatabaseOperationName": { - "type": "string", - "id": 6 - } - } - }, - "OptimizeRestoredDatabaseMetadata": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.resource_reference).type": "spanner.googleapis.com/Database" - } - }, - "progress": { - "type": "OperationProgress", - "id": 2 - } - } - }, - "RestoreSourceType": { - "values": { - "TYPE_UNSPECIFIED": 0, - "BACKUP": 1 - } - }, - "DatabaseRole": { - "options": { - "(google.api.resource).type": "spanner.googleapis.com/DatabaseRole", - "(google.api.resource).pattern": "projects/{project}/instances/{instance}/databases/{database}/databaseRoles/{role}" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "ListDatabaseRolesRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/Database" - } - }, - "pageSize": { - "type": "int32", - "id": 2 - }, - "pageToken": { - "type": "string", - "id": 3 - } - } - }, - "ListDatabaseRolesResponse": { - "fields": { - "databaseRoles": { - "rule": "repeated", - "type": "DatabaseRole", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "AddSplitPointsRequest": { - "fields": { - "database": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/Database" - } - }, - "splitPoints": { - "rule": "repeated", - "type": "SplitPoints", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "initiator": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "AddSplitPointsResponse": { - "fields": {} - }, - "SplitPoints": { - "fields": { - "table": { - "type": "string", - "id": 1 - }, - "index": { - "type": "string", - "id": 2 - }, - "keys": { - "rule": "repeated", - "type": "Key", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "expireTime": { - "type": "google.protobuf.Timestamp", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "Key": { - "fields": { - "keyParts": { - "type": "google.protobuf.ListValue", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - } - } - }, - "InternalUpdateGraphOperationRequest": { - "fields": { - "database": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/Database" - } - }, - "operationId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "vmIdentityToken": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "progress": { - "type": "double", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "status": { - "type": "google.rpc.Status", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "InternalUpdateGraphOperationResponse": { - "fields": {} - } - } - } - } - } - } - } - } - }, - "api": { - "options": { - "go_package": "google.golang.org/genproto/googleapis/api;api", - "java_multiple_files": true, - "java_outer_classname": "LaunchStageProto", - "java_package": "com.google.api", - "objc_class_prefix": "GAPI", - "cc_enable_arenas": true - }, - "nested": { - "fieldBehavior": { - "rule": "repeated", - "type": "google.api.FieldBehavior", - "id": 1052, - "extend": "google.protobuf.FieldOptions", - "options": { - "packed": false - } - }, - "FieldBehavior": { - "values": { - "FIELD_BEHAVIOR_UNSPECIFIED": 0, - "OPTIONAL": 1, - "REQUIRED": 2, - "OUTPUT_ONLY": 3, - "INPUT_ONLY": 4, - "IMMUTABLE": 5, - "UNORDERED_LIST": 6, - "NON_EMPTY_DEFAULT": 7, - "IDENTIFIER": 8 - } - }, - "resourceReference": { - "type": "google.api.ResourceReference", - "id": 1055, - "extend": "google.protobuf.FieldOptions" - }, - "resourceDefinition": { - "rule": "repeated", - "type": "google.api.ResourceDescriptor", - "id": 1053, - "extend": "google.protobuf.FileOptions" - }, - "resource": { - "type": "google.api.ResourceDescriptor", - "id": 1053, - "extend": "google.protobuf.MessageOptions" - }, - "ResourceDescriptor": { - "fields": { - "type": { - "type": "string", - "id": 1 - }, - "pattern": { - "rule": "repeated", - "type": "string", - "id": 2 - }, - "nameField": { - "type": "string", - "id": 3 - }, - "history": { - "type": "History", - "id": 4 - }, - "plural": { - "type": "string", - "id": 5 - }, - "singular": { - "type": "string", - "id": 6 - }, - "style": { - "rule": "repeated", - "type": "Style", - "id": 10 - } - }, - "nested": { - "History": { - "values": { - "HISTORY_UNSPECIFIED": 0, - "ORIGINALLY_SINGLE_PATTERN": 1, - "FUTURE_MULTI_PATTERN": 2 - } - }, - "Style": { - "values": { - "STYLE_UNSPECIFIED": 0, - "DECLARATIVE_FRIENDLY": 1 - } - } - } - }, - "ResourceReference": { - "fields": { - "type": { - "type": "string", - "id": 1 - }, - "childType": { - "type": "string", - "id": 2 - } - } - }, - "http": { - "type": "HttpRule", - "id": 72295728, - "extend": "google.protobuf.MethodOptions" - }, - "Http": { - "fields": { - "rules": { - "rule": "repeated", - "type": "HttpRule", - "id": 1 - }, - "fullyDecodeReservedExpansion": { - "type": "bool", - "id": 2 - } - } - }, - "HttpRule": { - "oneofs": { - "pattern": { - "oneof": [ - "get", - "put", - "post", - "delete", - "patch", - "custom" - ] - } - }, - "fields": { - "selector": { - "type": "string", - "id": 1 - }, - "get": { - "type": "string", - "id": 2 - }, - "put": { - "type": "string", - "id": 3 - }, - "post": { - "type": "string", - "id": 4 - }, - "delete": { - "type": "string", - "id": 5 - }, - "patch": { - "type": "string", - "id": 6 - }, - "custom": { - "type": "CustomHttpPattern", - "id": 8 - }, - "body": { - "type": "string", - "id": 7 - }, - "responseBody": { - "type": "string", - "id": 12 - }, - "additionalBindings": { - "rule": "repeated", - "type": "HttpRule", - "id": 11 - } - } - }, - "CustomHttpPattern": { - "fields": { - "kind": { - "type": "string", - "id": 1 - }, - "path": { - "type": "string", - "id": 2 - } - } - }, - "methodSignature": { - "rule": "repeated", - "type": "string", - "id": 1051, - "extend": "google.protobuf.MethodOptions" - }, - "defaultHost": { - "type": "string", - "id": 1049, - "extend": "google.protobuf.ServiceOptions" - }, - "oauthScopes": { - "type": "string", - "id": 1050, - "extend": "google.protobuf.ServiceOptions" - }, - "apiVersion": { - "type": "string", - "id": 525000001, - "extend": "google.protobuf.ServiceOptions" - }, - "CommonLanguageSettings": { - "fields": { - "referenceDocsUri": { - "type": "string", - "id": 1, - "options": { - "deprecated": true - } - }, - "destinations": { - "rule": "repeated", - "type": "ClientLibraryDestination", - "id": 2 - } - } - }, - "ClientLibrarySettings": { - "fields": { - "version": { - "type": "string", - "id": 1 - }, - "launchStage": { - "type": "LaunchStage", - "id": 2 - }, - "restNumericEnums": { - "type": "bool", - "id": 3 - }, - "javaSettings": { - "type": "JavaSettings", - "id": 21 - }, - "cppSettings": { - "type": "CppSettings", - "id": 22 - }, - "phpSettings": { - "type": "PhpSettings", - "id": 23 - }, - "pythonSettings": { - "type": "PythonSettings", - "id": 24 - }, - "nodeSettings": { - "type": "NodeSettings", - "id": 25 - }, - "dotnetSettings": { - "type": "DotnetSettings", - "id": 26 - }, - "rubySettings": { - "type": "RubySettings", - "id": 27 - }, - "goSettings": { - "type": "GoSettings", - "id": 28 - } - } - }, - "Publishing": { - "fields": { - "methodSettings": { - "rule": "repeated", - "type": "MethodSettings", - "id": 2 - }, - "newIssueUri": { - "type": "string", - "id": 101 - }, - "documentationUri": { - "type": "string", - "id": 102 - }, - "apiShortName": { - "type": "string", - "id": 103 - }, - "githubLabel": { - "type": "string", - "id": 104 - }, - "codeownerGithubTeams": { - "rule": "repeated", - "type": "string", - "id": 105 - }, - "docTagPrefix": { - "type": "string", - "id": 106 - }, - "organization": { - "type": "ClientLibraryOrganization", - "id": 107 - }, - "librarySettings": { - "rule": "repeated", - "type": "ClientLibrarySettings", - "id": 109 - }, - "protoReferenceDocumentationUri": { - "type": "string", - "id": 110 - }, - "restReferenceDocumentationUri": { - "type": "string", - "id": 111 - } - } - }, - "JavaSettings": { - "fields": { - "libraryPackage": { - "type": "string", - "id": 1 - }, - "serviceClassNames": { - "keyType": "string", - "type": "string", - "id": 2 - }, - "common": { - "type": "CommonLanguageSettings", - "id": 3 - } - } - }, - "CppSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "PhpSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "PythonSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "NodeSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "DotnetSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - }, - "renamedServices": { - "keyType": "string", - "type": "string", - "id": 2 - }, - "renamedResources": { - "keyType": "string", - "type": "string", - "id": 3 - }, - "ignoredResources": { - "rule": "repeated", - "type": "string", - "id": 4 - }, - "forcedNamespaceAliases": { - "rule": "repeated", - "type": "string", - "id": 5 - }, - "handwrittenSignatures": { - "rule": "repeated", - "type": "string", - "id": 6 - } - } - }, - "RubySettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "GoSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "MethodSettings": { - "fields": { - "selector": { - "type": "string", - "id": 1 - }, - "longRunning": { - "type": "LongRunning", - "id": 2 - }, - "autoPopulatedFields": { - "rule": "repeated", - "type": "string", - "id": 3 - } - }, - "nested": { - "LongRunning": { - "fields": { - "initialPollDelay": { - "type": "google.protobuf.Duration", - "id": 1 - }, - "pollDelayMultiplier": { - "type": "float", - "id": 2 - }, - "maxPollDelay": { - "type": "google.protobuf.Duration", - "id": 3 - }, - "totalPollTimeout": { - "type": "google.protobuf.Duration", - "id": 4 - } - } - } - } - }, - "ClientLibraryOrganization": { - "values": { - "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": 0, - "CLOUD": 1, - "ADS": 2, - "PHOTOS": 3, - "STREET_VIEW": 4, - "SHOPPING": 5, - "GEO": 6, - "GENERATIVE_AI": 7 - } - }, - "ClientLibraryDestination": { - "values": { - "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": 0, - "GITHUB": 10, - "PACKAGE_MANAGER": 20 - } - }, - "LaunchStage": { - "values": { - "LAUNCH_STAGE_UNSPECIFIED": 0, - "UNIMPLEMENTED": 6, - "PRELAUNCH": 7, - "EARLY_ACCESS": 1, - "ALPHA": 2, - "BETA": 3, - "GA": 4, - "DEPRECATED": 5 - } - } - } - }, - "protobuf": { - "options": { - "go_package": "google.golang.org/protobuf/types/descriptorpb", - "java_package": "com.google.protobuf", - "java_outer_classname": "DescriptorProtos", - "csharp_namespace": "Google.Protobuf.Reflection", - "objc_class_prefix": "GPB", - "cc_enable_arenas": true, - "optimize_for": "SPEED" - }, - "nested": { - "FileDescriptorSet": { - "edition": "proto2", - "fields": { - "file": { - "rule": "repeated", - "type": "FileDescriptorProto", - "id": 1 - } - } - }, - "Edition": { - "edition": "proto2", - "values": { - "EDITION_UNKNOWN": 0, - "EDITION_PROTO2": 998, - "EDITION_PROTO3": 999, - "EDITION_2023": 1000, - "EDITION_2024": 1001, - "EDITION_1_TEST_ONLY": 1, - "EDITION_2_TEST_ONLY": 2, - "EDITION_99997_TEST_ONLY": 99997, - "EDITION_99998_TEST_ONLY": 99998, - "EDITION_99999_TEST_ONLY": 99999, - "EDITION_MAX": 2147483647 - } - }, - "FileDescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "package": { - "type": "string", - "id": 2 - }, - "dependency": { - "rule": "repeated", - "type": "string", - "id": 3 - }, - "publicDependency": { - "rule": "repeated", - "type": "int32", - "id": 10 - }, - "weakDependency": { - "rule": "repeated", - "type": "int32", - "id": 11 - }, - "messageType": { - "rule": "repeated", - "type": "DescriptorProto", - "id": 4 - }, - "enumType": { - "rule": "repeated", - "type": "EnumDescriptorProto", - "id": 5 - }, - "service": { - "rule": "repeated", - "type": "ServiceDescriptorProto", - "id": 6 - }, - "extension": { - "rule": "repeated", - "type": "FieldDescriptorProto", - "id": 7 - }, - "options": { - "type": "FileOptions", - "id": 8 - }, - "sourceCodeInfo": { - "type": "SourceCodeInfo", - "id": 9 - }, - "syntax": { - "type": "string", - "id": 12 - }, - "edition": { - "type": "Edition", - "id": 14 - } - } - }, - "DescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "field": { - "rule": "repeated", - "type": "FieldDescriptorProto", - "id": 2 - }, - "extension": { - "rule": "repeated", - "type": "FieldDescriptorProto", - "id": 6 - }, - "nestedType": { - "rule": "repeated", - "type": "DescriptorProto", - "id": 3 - }, - "enumType": { - "rule": "repeated", - "type": "EnumDescriptorProto", - "id": 4 - }, - "extensionRange": { - "rule": "repeated", - "type": "ExtensionRange", - "id": 5 - }, - "oneofDecl": { - "rule": "repeated", - "type": "OneofDescriptorProto", - "id": 8 - }, - "options": { - "type": "MessageOptions", - "id": 7 - }, - "reservedRange": { - "rule": "repeated", - "type": "ReservedRange", - "id": 9 - }, - "reservedName": { - "rule": "repeated", - "type": "string", - "id": 10 - } - }, - "nested": { - "ExtensionRange": { - "fields": { - "start": { - "type": "int32", - "id": 1 - }, - "end": { - "type": "int32", - "id": 2 - }, - "options": { - "type": "ExtensionRangeOptions", - "id": 3 - } - } - }, - "ReservedRange": { - "fields": { - "start": { - "type": "int32", - "id": 1 - }, - "end": { - "type": "int32", - "id": 2 - } - } - } - } - }, - "ExtensionRangeOptions": { - "edition": "proto2", - "fields": { - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - }, - "declaration": { - "rule": "repeated", - "type": "Declaration", - "id": 2, - "options": { - "retention": "RETENTION_SOURCE" - } - }, - "features": { - "type": "FeatureSet", - "id": 50 - }, - "verification": { - "type": "VerificationState", - "id": 3, - "options": { - "default": "UNVERIFIED", - "retention": "RETENTION_SOURCE" - } - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "nested": { - "Declaration": { - "fields": { - "number": { - "type": "int32", - "id": 1 - }, - "fullName": { - "type": "string", - "id": 2 - }, - "type": { - "type": "string", - "id": 3 - }, - "reserved": { - "type": "bool", - "id": 5 - }, - "repeated": { - "type": "bool", - "id": 6 - } - }, - "reserved": [ - [ - 4, - 4 - ] - ] - }, - "VerificationState": { - "values": { - "DECLARATION": 0, - "UNVERIFIED": 1 - } - } - } - }, - "FieldDescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "number": { - "type": "int32", - "id": 3 - }, - "label": { - "type": "Label", - "id": 4 - }, - "type": { - "type": "Type", - "id": 5 - }, - "typeName": { - "type": "string", - "id": 6 - }, - "extendee": { - "type": "string", - "id": 2 - }, - "defaultValue": { - "type": "string", - "id": 7 - }, - "oneofIndex": { - "type": "int32", - "id": 9 - }, - "jsonName": { - "type": "string", - "id": 10 - }, - "options": { - "type": "FieldOptions", - "id": 8 - }, - "proto3Optional": { - "type": "bool", - "id": 17 - } - }, - "nested": { - "Type": { - "values": { - "TYPE_DOUBLE": 1, - "TYPE_FLOAT": 2, - "TYPE_INT64": 3, - "TYPE_UINT64": 4, - "TYPE_INT32": 5, - "TYPE_FIXED64": 6, - "TYPE_FIXED32": 7, - "TYPE_BOOL": 8, - "TYPE_STRING": 9, - "TYPE_GROUP": 10, - "TYPE_MESSAGE": 11, - "TYPE_BYTES": 12, - "TYPE_UINT32": 13, - "TYPE_ENUM": 14, - "TYPE_SFIXED32": 15, - "TYPE_SFIXED64": 16, - "TYPE_SINT32": 17, - "TYPE_SINT64": 18 - } - }, - "Label": { - "values": { - "LABEL_OPTIONAL": 1, - "LABEL_REPEATED": 3, - "LABEL_REQUIRED": 2 - } - } - } - }, - "OneofDescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "options": { - "type": "OneofOptions", - "id": 2 - } - } - }, - "EnumDescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "value": { - "rule": "repeated", - "type": "EnumValueDescriptorProto", - "id": 2 - }, - "options": { - "type": "EnumOptions", - "id": 3 - }, - "reservedRange": { - "rule": "repeated", - "type": "EnumReservedRange", - "id": 4 - }, - "reservedName": { - "rule": "repeated", - "type": "string", - "id": 5 - } - }, - "nested": { - "EnumReservedRange": { - "fields": { - "start": { - "type": "int32", - "id": 1 - }, - "end": { - "type": "int32", - "id": 2 - } - } - } - } - }, - "EnumValueDescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "number": { - "type": "int32", - "id": 2 - }, - "options": { - "type": "EnumValueOptions", - "id": 3 - } - } - }, - "ServiceDescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "method": { - "rule": "repeated", - "type": "MethodDescriptorProto", - "id": 2 - }, - "options": { - "type": "ServiceOptions", - "id": 3 - } - } - }, - "MethodDescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "inputType": { - "type": "string", - "id": 2 - }, - "outputType": { - "type": "string", - "id": 3 - }, - "options": { - "type": "MethodOptions", - "id": 4 - }, - "clientStreaming": { - "type": "bool", - "id": 5, - "options": { - "default": false - } - }, - "serverStreaming": { - "type": "bool", - "id": 6, - "options": { - "default": false - } - } - } - }, - "FileOptions": { - "edition": "proto2", - "fields": { - "javaPackage": { - "type": "string", - "id": 1 - }, - "javaOuterClassname": { - "type": "string", - "id": 8 - }, - "javaMultipleFiles": { - "type": "bool", - "id": 10, - "options": { - "default": false - } - }, - "javaGenerateEqualsAndHash": { - "type": "bool", - "id": 20, - "options": { - "deprecated": true - } - }, - "javaStringCheckUtf8": { - "type": "bool", - "id": 27, - "options": { - "default": false - } - }, - "optimizeFor": { - "type": "OptimizeMode", - "id": 9, - "options": { - "default": "SPEED" - } - }, - "goPackage": { - "type": "string", - "id": 11 - }, - "ccGenericServices": { - "type": "bool", - "id": 16, - "options": { - "default": false - } - }, - "javaGenericServices": { - "type": "bool", - "id": 17, - "options": { - "default": false - } - }, - "pyGenericServices": { - "type": "bool", - "id": 18, - "options": { - "default": false - } - }, - "deprecated": { - "type": "bool", - "id": 23, - "options": { - "default": false - } - }, - "ccEnableArenas": { - "type": "bool", - "id": 31, - "options": { - "default": true - } - }, - "objcClassPrefix": { - "type": "string", - "id": 36 - }, - "csharpNamespace": { - "type": "string", - "id": 37 - }, - "swiftPrefix": { - "type": "string", - "id": 39 - }, - "phpClassPrefix": { - "type": "string", - "id": 40 - }, - "phpNamespace": { - "type": "string", - "id": 41 - }, - "phpMetadataNamespace": { - "type": "string", - "id": 44 - }, - "rubyPackage": { - "type": "string", - "id": 45 - }, - "features": { - "type": "FeatureSet", - "id": 50 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "reserved": [ - [ - 42, - 42 - ], - [ - 38, - 38 - ] - ], - "nested": { - "OptimizeMode": { - "values": { - "SPEED": 1, - "CODE_SIZE": 2, - "LITE_RUNTIME": 3 - } - } - } - }, - "MessageOptions": { - "edition": "proto2", - "fields": { - "messageSetWireFormat": { - "type": "bool", - "id": 1, - "options": { - "default": false - } - }, - "noStandardDescriptorAccessor": { - "type": "bool", - "id": 2, - "options": { - "default": false - } - }, - "deprecated": { - "type": "bool", - "id": 3, - "options": { - "default": false - } - }, - "mapEntry": { - "type": "bool", - "id": 7 - }, - "deprecatedLegacyJsonFieldConflicts": { - "type": "bool", - "id": 11, - "options": { - "deprecated": true - } - }, - "features": { - "type": "FeatureSet", - "id": 12 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "reserved": [ - [ - 4, - 4 - ], - [ - 5, - 5 - ], - [ - 6, - 6 - ], - [ - 8, - 8 - ], - [ - 9, - 9 - ] - ] - }, - "FieldOptions": { - "edition": "proto2", - "fields": { - "ctype": { - "type": "CType", - "id": 1, - "options": { - "default": "STRING" - } - }, - "packed": { - "type": "bool", - "id": 2 - }, - "jstype": { - "type": "JSType", - "id": 6, - "options": { - "default": "JS_NORMAL" - } - }, - "lazy": { - "type": "bool", - "id": 5, - "options": { - "default": false - } - }, - "unverifiedLazy": { - "type": "bool", - "id": 15, - "options": { - "default": false - } - }, - "deprecated": { - "type": "bool", - "id": 3, - "options": { - "default": false - } - }, - "weak": { - "type": "bool", - "id": 10, - "options": { - "default": false - } - }, - "debugRedact": { - "type": "bool", - "id": 16, - "options": { - "default": false - } - }, - "retention": { - "type": "OptionRetention", - "id": 17 - }, - "targets": { - "rule": "repeated", - "type": "OptionTargetType", - "id": 19 - }, - "editionDefaults": { - "rule": "repeated", - "type": "EditionDefault", - "id": 20 - }, - "features": { - "type": "FeatureSet", - "id": 21 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "reserved": [ - [ - 4, - 4 - ], - [ - 18, - 18 - ] - ], - "nested": { - "CType": { - "values": { - "STRING": 0, - "CORD": 1, - "STRING_PIECE": 2 - } - }, - "JSType": { - "values": { - "JS_NORMAL": 0, - "JS_STRING": 1, - "JS_NUMBER": 2 - } - }, - "OptionRetention": { - "values": { - "RETENTION_UNKNOWN": 0, - "RETENTION_RUNTIME": 1, - "RETENTION_SOURCE": 2 - } - }, - "OptionTargetType": { - "values": { - "TARGET_TYPE_UNKNOWN": 0, - "TARGET_TYPE_FILE": 1, - "TARGET_TYPE_EXTENSION_RANGE": 2, - "TARGET_TYPE_MESSAGE": 3, - "TARGET_TYPE_FIELD": 4, - "TARGET_TYPE_ONEOF": 5, - "TARGET_TYPE_ENUM": 6, - "TARGET_TYPE_ENUM_ENTRY": 7, - "TARGET_TYPE_SERVICE": 8, - "TARGET_TYPE_METHOD": 9 - } - }, - "EditionDefault": { - "fields": { - "edition": { - "type": "Edition", - "id": 3 - }, - "value": { - "type": "string", - "id": 2 - } - } - } - } - }, - "OneofOptions": { - "edition": "proto2", - "fields": { - "features": { - "type": "FeatureSet", - "id": 1 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ] - }, - "EnumOptions": { - "edition": "proto2", - "fields": { - "allowAlias": { - "type": "bool", - "id": 2 - }, - "deprecated": { - "type": "bool", - "id": 3, - "options": { - "default": false - } - }, - "deprecatedLegacyJsonFieldConflicts": { - "type": "bool", - "id": 6, - "options": { - "deprecated": true - } - }, - "features": { - "type": "FeatureSet", - "id": 7 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "reserved": [ - [ - 5, - 5 - ] - ] - }, - "EnumValueOptions": { - "edition": "proto2", - "fields": { - "deprecated": { - "type": "bool", - "id": 1, - "options": { - "default": false - } - }, - "features": { - "type": "FeatureSet", - "id": 2 - }, - "debugRedact": { - "type": "bool", - "id": 3, - "options": { - "default": false - } - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ] - }, - "ServiceOptions": { - "edition": "proto2", - "fields": { - "features": { - "type": "FeatureSet", - "id": 34 - }, - "deprecated": { - "type": "bool", - "id": 33, - "options": { - "default": false - } - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ] - }, - "MethodOptions": { - "edition": "proto2", - "fields": { - "deprecated": { - "type": "bool", - "id": 33, - "options": { - "default": false - } - }, - "idempotencyLevel": { - "type": "IdempotencyLevel", - "id": 34, - "options": { - "default": "IDEMPOTENCY_UNKNOWN" - } - }, - "features": { - "type": "FeatureSet", - "id": 35 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "nested": { - "IdempotencyLevel": { - "values": { - "IDEMPOTENCY_UNKNOWN": 0, - "NO_SIDE_EFFECTS": 1, - "IDEMPOTENT": 2 - } - } - } - }, - "UninterpretedOption": { - "edition": "proto2", - "fields": { - "name": { - "rule": "repeated", - "type": "NamePart", - "id": 2 - }, - "identifierValue": { - "type": "string", - "id": 3 - }, - "positiveIntValue": { - "type": "uint64", - "id": 4 - }, - "negativeIntValue": { - "type": "int64", - "id": 5 - }, - "doubleValue": { - "type": "double", - "id": 6 - }, - "stringValue": { - "type": "bytes", - "id": 7 - }, - "aggregateValue": { - "type": "string", - "id": 8 - } - }, - "nested": { - "NamePart": { - "fields": { - "namePart": { - "rule": "required", - "type": "string", - "id": 1 - }, - "isExtension": { - "rule": "required", - "type": "bool", - "id": 2 - } - } - } - } - }, - "FeatureSet": { - "edition": "proto2", - "fields": { - "fieldPresence": { - "type": "FieldPresence", - "id": 1, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_2023", - "edition_defaults.value": "EXPLICIT" - } - }, - "enumType": { - "type": "EnumType", - "id": 2, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO3", - "edition_defaults.value": "OPEN" - } - }, - "repeatedFieldEncoding": { - "type": "RepeatedFieldEncoding", - "id": 3, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO3", - "edition_defaults.value": "PACKED" - } - }, - "utf8Validation": { - "type": "Utf8Validation", - "id": 4, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO3", - "edition_defaults.value": "VERIFY" - } - }, - "messageEncoding": { - "type": "MessageEncoding", - "id": 5, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO2", - "edition_defaults.value": "LENGTH_PREFIXED" - } - }, - "jsonFormat": { - "type": "JsonFormat", - "id": 6, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO3", - "edition_defaults.value": "ALLOW" - } - } - }, - "extensions": [ - [ - 1000, - 1000 - ], - [ - 1001, - 1001 - ], - [ - 1002, - 1002 - ], - [ - 9990, - 9990 - ], - [ - 9995, - 9999 - ], - [ - 10000, - 10000 - ] - ], - "reserved": [ - [ - 999, - 999 - ] - ], - "nested": { - "FieldPresence": { - "values": { - "FIELD_PRESENCE_UNKNOWN": 0, - "EXPLICIT": 1, - "IMPLICIT": 2, - "LEGACY_REQUIRED": 3 - } - }, - "EnumType": { - "values": { - "ENUM_TYPE_UNKNOWN": 0, - "OPEN": 1, - "CLOSED": 2 - } - }, - "RepeatedFieldEncoding": { - "values": { - "REPEATED_FIELD_ENCODING_UNKNOWN": 0, - "PACKED": 1, - "EXPANDED": 2 - } - }, - "Utf8Validation": { - "values": { - "UTF8_VALIDATION_UNKNOWN": 0, - "VERIFY": 2, - "NONE": 3 - } - }, - "MessageEncoding": { - "values": { - "MESSAGE_ENCODING_UNKNOWN": 0, - "LENGTH_PREFIXED": 1, - "DELIMITED": 2 - } - }, - "JsonFormat": { - "values": { - "JSON_FORMAT_UNKNOWN": 0, - "ALLOW": 1, - "LEGACY_BEST_EFFORT": 2 - } - } - } - }, - "FeatureSetDefaults": { - "edition": "proto2", - "fields": { - "defaults": { - "rule": "repeated", - "type": "FeatureSetEditionDefault", - "id": 1 - }, - "minimumEdition": { - "type": "Edition", - "id": 4 - }, - "maximumEdition": { - "type": "Edition", - "id": 5 - } - }, - "nested": { - "FeatureSetEditionDefault": { - "fields": { - "edition": { - "type": "Edition", - "id": 3 - }, - "features": { - "type": "FeatureSet", - "id": 2 - } - } - } - } - }, - "SourceCodeInfo": { - "edition": "proto2", - "fields": { - "location": { - "rule": "repeated", - "type": "Location", - "id": 1 - } - }, - "nested": { - "Location": { - "fields": { - "path": { - "rule": "repeated", - "type": "int32", - "id": 1, - "options": { - "packed": true - } - }, - "span": { - "rule": "repeated", - "type": "int32", - "id": 2, - "options": { - "packed": true - } - }, - "leadingComments": { - "type": "string", - "id": 3 - }, - "trailingComments": { - "type": "string", - "id": 4 - }, - "leadingDetachedComments": { - "rule": "repeated", - "type": "string", - "id": 6 - } - } - } - } - }, - "GeneratedCodeInfo": { - "edition": "proto2", - "fields": { - "annotation": { - "rule": "repeated", - "type": "Annotation", - "id": 1 - } - }, - "nested": { - "Annotation": { - "fields": { - "path": { - "rule": "repeated", - "type": "int32", - "id": 1, - "options": { - "packed": true - } - }, - "sourceFile": { - "type": "string", - "id": 2 - }, - "begin": { - "type": "int32", - "id": 3 - }, - "end": { - "type": "int32", - "id": 4 - }, - "semantic": { - "type": "Semantic", - "id": 5 - } - }, - "nested": { - "Semantic": { - "values": { - "NONE": 0, - "SET": 1, - "ALIAS": 2 - } - } - } - } - } - }, - "Duration": { - "fields": { - "seconds": { - "type": "int64", - "id": 1 - }, - "nanos": { - "type": "int32", - "id": 2 - } - } - }, - "Any": { - "fields": { - "type_url": { - "type": "string", - "id": 1 - }, - "value": { - "type": "bytes", - "id": 2 - } - } - }, - "Empty": { - "fields": {} - }, - "FieldMask": { - "fields": { - "paths": { - "rule": "repeated", - "type": "string", - "id": 1 - } - } - }, - "Timestamp": { - "fields": { - "seconds": { - "type": "int64", - "id": 1 - }, - "nanos": { - "type": "int32", - "id": 2 - } - } - }, - "Struct": { - "fields": { - "fields": { - "keyType": "string", - "type": "Value", - "id": 1 - } - } - }, - "Value": { - "oneofs": { - "kind": { - "oneof": [ - "nullValue", - "numberValue", - "stringValue", - "boolValue", - "structValue", - "listValue" - ] - } - }, - "fields": { - "nullValue": { - "type": "NullValue", - "id": 1 - }, - "numberValue": { - "type": "double", - "id": 2 - }, - "stringValue": { - "type": "string", - "id": 3 - }, - "boolValue": { - "type": "bool", - "id": 4 - }, - "structValue": { - "type": "Struct", - "id": 5 - }, - "listValue": { - "type": "ListValue", - "id": 6 - } - } - }, - "NullValue": { - "values": { - "NULL_VALUE": 0 - } - }, - "ListValue": { - "fields": { - "values": { - "rule": "repeated", - "type": "Value", - "id": 1 - } - } - } - } - }, - "longrunning": { - "options": { - "cc_enable_arenas": true, - "csharp_namespace": "Google.LongRunning", - "go_package": "cloud.google.com/go/longrunning/autogen/longrunningpb;longrunningpb", - "java_multiple_files": true, - "java_outer_classname": "OperationsProto", - "java_package": "com.google.longrunning", - "php_namespace": "Google\\LongRunning" - }, - "nested": { - "operationInfo": { - "type": "google.longrunning.OperationInfo", - "id": 1049, - "extend": "google.protobuf.MethodOptions" - }, - "Operations": { - "options": { - "(google.api.default_host)": "longrunning.googleapis.com" - }, - "methods": { - "ListOperations": { - "requestType": "ListOperationsRequest", - "responseType": "ListOperationsResponse", - "options": { - "(google.api.http).get": "/v1/{name=operations}", - "(google.api.method_signature)": "name,filter" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=operations}" - } - }, - { - "(google.api.method_signature)": "name,filter" - } - ] - }, - "GetOperation": { - "requestType": "GetOperationRequest", - "responseType": "Operation", - "options": { - "(google.api.http).get": "/v1/{name=operations/**}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=operations/**}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "DeleteOperation": { - "requestType": "DeleteOperationRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v1/{name=operations/**}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1/{name=operations/**}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "CancelOperation": { - "requestType": "CancelOperationRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).post": "/v1/{name=operations/**}:cancel", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{name=operations/**}:cancel", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "WaitOperation": { - "requestType": "WaitOperationRequest", - "responseType": "Operation" - } - } - }, - "Operation": { - "oneofs": { - "result": { - "oneof": [ - "error", - "response" - ] - } - }, - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "metadata": { - "type": "google.protobuf.Any", - "id": 2 - }, - "done": { - "type": "bool", - "id": 3 - }, - "error": { - "type": "google.rpc.Status", - "id": 4 - }, - "response": { - "type": "google.protobuf.Any", - "id": 5 - } - } - }, - "GetOperationRequest": { - "fields": { - "name": { - "type": "string", - "id": 1 - } - } - }, - "ListOperationsRequest": { - "fields": { - "name": { - "type": "string", - "id": 4 - }, - "filter": { - "type": "string", - "id": 1 - }, - "pageSize": { - "type": "int32", - "id": 2 - }, - "pageToken": { - "type": "string", - "id": 3 - } - } - }, - "ListOperationsResponse": { - "fields": { - "operations": { - "rule": "repeated", - "type": "Operation", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "CancelOperationRequest": { - "fields": { - "name": { - "type": "string", - "id": 1 - } - } - }, - "DeleteOperationRequest": { - "fields": { - "name": { - "type": "string", - "id": 1 - } - } - }, - "WaitOperationRequest": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "timeout": { - "type": "google.protobuf.Duration", - "id": 2 - } - } - }, - "OperationInfo": { - "fields": { - "responseType": { - "type": "string", - "id": 1 - }, - "metadataType": { - "type": "string", - "id": 2 - } - } - } - } - }, - "rpc": { - "options": { - "cc_enable_arenas": true, - "go_package": "google.golang.org/genproto/googleapis/rpc/status;status", - "java_multiple_files": true, - "java_outer_classname": "StatusProto", - "java_package": "com.google.rpc", - "objc_class_prefix": "RPC" - }, - "nested": { - "Status": { - "fields": { - "code": { - "type": "int32", - "id": 1 - }, - "message": { - "type": "string", - "id": 2 - }, - "details": { - "rule": "repeated", - "type": "google.protobuf.Any", - "id": 3 - } - } - } - } - }, - "iam": { - "nested": { - "v1": { - "options": { - "cc_enable_arenas": true, - "csharp_namespace": "Google.Cloud.Iam.V1", - "go_package": "cloud.google.com/go/iam/apiv1/iampb;iampb", - "java_multiple_files": true, - "java_outer_classname": "PolicyProto", - "java_package": "com.google.iam.v1", - "php_namespace": "Google\\Cloud\\Iam\\V1" - }, - "nested": { - "IAMPolicy": { - "options": { - "(google.api.default_host)": "iam-meta-api.googleapis.com" - }, - "methods": { - "SetIamPolicy": { - "requestType": "SetIamPolicyRequest", - "responseType": "Policy", - "options": { - "(google.api.http).post": "/v1/{resource=**}:setIamPolicy", - "(google.api.http).body": "*" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{resource=**}:setIamPolicy", - "body": "*" - } - } - ] - }, - "GetIamPolicy": { - "requestType": "GetIamPolicyRequest", - "responseType": "Policy", - "options": { - "(google.api.http).post": "/v1/{resource=**}:getIamPolicy", - "(google.api.http).body": "*" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{resource=**}:getIamPolicy", - "body": "*" - } - } - ] - }, - "TestIamPermissions": { - "requestType": "TestIamPermissionsRequest", - "responseType": "TestIamPermissionsResponse", - "options": { - "(google.api.http).post": "/v1/{resource=**}:testIamPermissions", - "(google.api.http).body": "*" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{resource=**}:testIamPermissions", - "body": "*" - } - } - ] - } - } - }, - "SetIamPolicyRequest": { - "fields": { - "resource": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "*" - } - }, - "policy": { - "type": "Policy", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 3 - } - } - }, - "GetIamPolicyRequest": { - "fields": { - "resource": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "*" - } - }, - "options": { - "type": "GetPolicyOptions", - "id": 2 - } - } - }, - "TestIamPermissionsRequest": { - "fields": { - "resource": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "*" - } - }, - "permissions": { - "rule": "repeated", - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "TestIamPermissionsResponse": { - "fields": { - "permissions": { - "rule": "repeated", - "type": "string", - "id": 1 - } - } - }, - "GetPolicyOptions": { - "fields": { - "requestedPolicyVersion": { - "type": "int32", - "id": 1 - } - } - }, - "Policy": { - "fields": { - "version": { - "type": "int32", - "id": 1 - }, - "bindings": { - "rule": "repeated", - "type": "Binding", - "id": 4 - }, - "auditConfigs": { - "rule": "repeated", - "type": "AuditConfig", - "id": 6 - }, - "etag": { - "type": "bytes", - "id": 3 - } - } - }, - "Binding": { - "fields": { - "role": { - "type": "string", - "id": 1 - }, - "members": { - "rule": "repeated", - "type": "string", - "id": 2 - }, - "condition": { - "type": "google.type.Expr", - "id": 3 - } - } - }, - "AuditConfig": { - "fields": { - "service": { - "type": "string", - "id": 1 - }, - "auditLogConfigs": { - "rule": "repeated", - "type": "AuditLogConfig", - "id": 3 - } - } - }, - "AuditLogConfig": { - "fields": { - "logType": { - "type": "LogType", - "id": 1 - }, - "exemptedMembers": { - "rule": "repeated", - "type": "string", - "id": 2 - } - }, - "nested": { - "LogType": { - "values": { - "LOG_TYPE_UNSPECIFIED": 0, - "ADMIN_READ": 1, - "DATA_WRITE": 2, - "DATA_READ": 3 - } - } - } - }, - "PolicyDelta": { - "fields": { - "bindingDeltas": { - "rule": "repeated", - "type": "BindingDelta", - "id": 1 - }, - "auditConfigDeltas": { - "rule": "repeated", - "type": "AuditConfigDelta", - "id": 2 - } - } - }, - "BindingDelta": { - "fields": { - "action": { - "type": "Action", - "id": 1 - }, - "role": { - "type": "string", - "id": 2 - }, - "member": { - "type": "string", - "id": 3 - }, - "condition": { - "type": "google.type.Expr", - "id": 4 - } - }, - "nested": { - "Action": { - "values": { - "ACTION_UNSPECIFIED": 0, - "ADD": 1, - "REMOVE": 2 - } - } - } - }, - "AuditConfigDelta": { - "fields": { - "action": { - "type": "Action", - "id": 1 - }, - "service": { - "type": "string", - "id": 2 - }, - "exemptedMember": { - "type": "string", - "id": 3 - }, - "logType": { - "type": "string", - "id": 4 - } - }, - "nested": { - "Action": { - "values": { - "ACTION_UNSPECIFIED": 0, - "ADD": 1, - "REMOVE": 2 - } - } - } - } - } - } - } - }, - "type": { - "options": { - "go_package": "google.golang.org/genproto/googleapis/type/expr;expr", - "java_multiple_files": true, - "java_outer_classname": "ExprProto", - "java_package": "com.google.type", - "objc_class_prefix": "GTP" - }, - "nested": { - "Expr": { - "fields": { - "expression": { - "type": "string", - "id": 1 - }, - "title": { - "type": "string", - "id": 2 - }, - "description": { - "type": "string", - "id": 3 - }, - "location": { - "type": "string", - "id": 4 - } - } - } - } - } - } - } - } -} \ No newline at end of file diff --git a/owl-bot-staging/admin/database/v1/src/index.ts b/owl-bot-staging/admin/database/v1/src/index.ts deleted file mode 100644 index 20347cf74..000000000 --- a/owl-bot-staging/admin/database/v1/src/index.ts +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as v1 from './v1'; -const DatabaseAdminClient = v1.DatabaseAdminClient; -type DatabaseAdminClient = v1.DatabaseAdminClient; -export {v1, DatabaseAdminClient}; -export default {v1, DatabaseAdminClient}; -import * as protos from '../protos/protos'; -export {protos} diff --git a/owl-bot-staging/admin/database/v1/src/v1/database_admin_client.ts b/owl-bot-staging/admin/database/v1/src/v1/database_admin_client.ts deleted file mode 100644 index bbc6b09d5..000000000 --- a/owl-bot-staging/admin/database/v1/src/v1/database_admin_client.ts +++ /dev/null @@ -1,5071 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -/* global window */ -import type * as gax from 'google-gax'; -import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall} from 'google-gax'; -import {Transform} from 'stream'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; - -/** - * Client JSON configuration object, loaded from - * `src/v1/database_admin_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './database_admin_client_config.json'; -const version = require('../../../package.json').version; - -/** - * Cloud Spanner Database Admin API - * - * The Cloud Spanner Database Admin API can be used to: - * * create, drop, and list databases - * * update the schema of pre-existing databases - * * create, delete, copy and list backups for a database - * * restore a database from an existing backup - * @class - * @memberof v1 - */ -export class DatabaseAdminClient { - private _terminated = false; - private _opts: ClientOptions; - private _providedCustomServicePath: boolean; - private _gaxModule: typeof gax | typeof gax.fallback; - private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; - private _protos: {}; - private _defaults: {[method: string]: gax.CallSettings}; - private _universeDomain: string; - private _servicePath: string; - private _log = logging.log('spanner'); - - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - pathTemplates: {[name: string]: gax.PathTemplate}; - operationsClient: gax.OperationsClient; - databaseAdminStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of DatabaseAdminClient. - * - * @param {object} [options] - The configuration object. - * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). - * The common options are: - * @param {object} [options.credentials] - Credentials object. - * @param {string} [options.credentials.client_email] - * @param {string} [options.credentials.private_key] - * @param {string} [options.email] - Account email address. Required when - * using a .pem or .p12 keyFilename. - * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or - * .p12 key downloaded from the Google Developers Console. If you provide - * a path to a JSON file, the projectId option below is not necessary. - * NOTE: .pem and .p12 require you to specify options.email as well. - * @param {number} [options.port] - The port on which to connect to - * the remote host. - * @param {string} [options.projectId] - The project ID from the Google - * Developer's Console, e.g. 'grape-spaceship-123'. We will also check - * the environment variable GCLOUD_PROJECT for your project ID. If your - * app is running in an environment which supports - * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. - * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. - * For more information, please check the - * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. - * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you - * need to avoid loading the default gRPC version and want to use the fallback - * HTTP implementation. Load only fallback version and pass it to the constructor: - * ``` - * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new DatabaseAdminClient({fallback: true}, gax); - * ``` - */ - constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { - // Ensure that options include all the required fields. - const staticMembers = this.constructor as typeof DatabaseAdminClient; - if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { - throw new Error('Please set either universe_domain or universeDomain, but not both.'); - } - const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; - this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; - this._servicePath = 'spanner.' + this._universeDomain; - const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; - this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); - const port = opts?.port || staticMembers.port; - const clientConfig = opts?.clientConfig ?? {}; - const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); - opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); - - // Request numeric enum values if REST transport is used. - opts.numericEnums = true; - - // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. - if (servicePath !== this._servicePath && !('scopes' in opts)) { - opts['scopes'] = staticMembers.scopes; - } - - // Load google-gax module synchronously if needed - if (!gaxInstance) { - gaxInstance = require('google-gax') as typeof gax; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; - - // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. - this._gaxGrpc = new this._gaxModule.GrpcClient(opts); - - // Save options to use in initialize() method. - this._opts = opts; - - // Save the auth object to the client, for use by other methods. - this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); - - // Set useJWTAccessWithScope on the auth object. - this.auth.useJWTAccessWithScope = true; - - // Set defaultServicePath on the auth object. - this.auth.defaultServicePath = this._servicePath; - - // Set the default scopes in auth client if needed. - if (servicePath === this._servicePath) { - this.auth.defaultScopes = staticMembers.scopes; - } - - // Determine the client header string. - const clientHeader = [ - `gax/${this._gaxModule.version}`, - `gapic/${version}`, - ]; - if (typeof process === 'object' && 'versions' in process) { - clientHeader.push(`gl-node/${process.versions.node}`); - } else { - clientHeader.push(`gl-web/${this._gaxModule.version}`); - } - if (!opts.fallback) { - clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else { - clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); - } - if (opts.libName && opts.libVersion) { - clientHeader.push(`${opts.libName}/${opts.libVersion}`); - } - // Load the applicable protos. - this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); - - // This API contains "path templates"; forward-slash-separated - // identifiers to uniquely identify resources within the API. - // Create useful helper objects for these. - this.pathTemplates = { - backupPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/instances/{instance}/backups/{backup}' - ), - backupSchedulePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/instances/{instance}/databases/{database}/backupSchedules/{schedule}' - ), - cryptoKeyPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}' - ), - databasePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/instances/{instance}/databases/{database}' - ), - databaseRolePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/instances/{instance}/databases/{database}/databaseRoles/{role}' - ), - instancePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/instances/{instance}' - ), - }; - - // 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 = { - listDatabases: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'databases'), - listBackups: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'backups'), - listDatabaseOperations: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'operations'), - listBackupOperations: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'operations'), - listDatabaseRoles: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'databaseRoles'), - listBackupSchedules: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'backupSchedules') - }; - - const protoFilesRoot = this._gaxModule.protobufFromJSON(jsonProtos); - // This API contains "long-running operations", which return a - // an Operation object that allows for tracking of the operation, - // rather than holding a request open. - const lroOptions: GrpcClientOptions = { - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined - }; - if (opts.fallback) { - lroOptions.protoJson = protoFilesRoot; - lroOptions.httpRules = [{selector: 'google.longrunning.Operations.CancelOperation',post: '/v1/{name=projects/*/instances/*/databases/*/operations/*}:cancel',additional_bindings: [{post: '/v1/{name=projects/*/instances/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/instances/*/backups/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/instanceConfigs/*/operations/*}:cancel',}], - },{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/v1/{name=projects/*/instances/*/databases/*/operations/*}',additional_bindings: [{delete: '/v1/{name=projects/*/instances/*/operations/*}',},{delete: '/v1/{name=projects/*/instances/*/backups/*/operations/*}',},{delete: '/v1/{name=projects/*/instanceConfigs/*/operations/*}',}], - },{selector: 'google.longrunning.Operations.GetOperation',get: '/v1/{name=projects/*/instances/*/databases/*/operations/*}',additional_bindings: [{get: '/v1/{name=projects/*/instances/*/operations/*}',},{get: '/v1/{name=projects/*/instances/*/backups/*/operations/*}',},{get: '/v1/{name=projects/*/instanceConfigs/*/operations/*}',}], - },{selector: 'google.longrunning.Operations.ListOperations',get: '/v1/{name=projects/*/instances/*/databases/*/operations}',additional_bindings: [{get: '/v1/{name=projects/*/instances/*/operations}',},{get: '/v1/{name=projects/*/instances/*/backups/*/operations}',},{get: '/v1/{name=projects/*/instanceConfigs/*/operations}',}], - }]; - } - this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); - const createDatabaseResponse = protoFilesRoot.lookup( - '.google.spanner.admin.database.v1.Database') as gax.protobuf.Type; - const createDatabaseMetadata = protoFilesRoot.lookup( - '.google.spanner.admin.database.v1.CreateDatabaseMetadata') as gax.protobuf.Type; - const updateDatabaseResponse = protoFilesRoot.lookup( - '.google.spanner.admin.database.v1.Database') as gax.protobuf.Type; - const updateDatabaseMetadata = protoFilesRoot.lookup( - '.google.spanner.admin.database.v1.UpdateDatabaseMetadata') as gax.protobuf.Type; - const updateDatabaseDdlResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; - const updateDatabaseDdlMetadata = protoFilesRoot.lookup( - '.google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata') as gax.protobuf.Type; - const createBackupResponse = protoFilesRoot.lookup( - '.google.spanner.admin.database.v1.Backup') as gax.protobuf.Type; - const createBackupMetadata = protoFilesRoot.lookup( - '.google.spanner.admin.database.v1.CreateBackupMetadata') as gax.protobuf.Type; - const copyBackupResponse = protoFilesRoot.lookup( - '.google.spanner.admin.database.v1.Backup') as gax.protobuf.Type; - const copyBackupMetadata = protoFilesRoot.lookup( - '.google.spanner.admin.database.v1.CopyBackupMetadata') as gax.protobuf.Type; - const restoreDatabaseResponse = protoFilesRoot.lookup( - '.google.spanner.admin.database.v1.Database') as gax.protobuf.Type; - const restoreDatabaseMetadata = protoFilesRoot.lookup( - '.google.spanner.admin.database.v1.RestoreDatabaseMetadata') as gax.protobuf.Type; - - this.descriptors.longrunning = { - createDatabase: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - createDatabaseResponse.decode.bind(createDatabaseResponse), - createDatabaseMetadata.decode.bind(createDatabaseMetadata)), - updateDatabase: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - updateDatabaseResponse.decode.bind(updateDatabaseResponse), - updateDatabaseMetadata.decode.bind(updateDatabaseMetadata)), - updateDatabaseDdl: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - updateDatabaseDdlResponse.decode.bind(updateDatabaseDdlResponse), - updateDatabaseDdlMetadata.decode.bind(updateDatabaseDdlMetadata)), - createBackup: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - createBackupResponse.decode.bind(createBackupResponse), - createBackupMetadata.decode.bind(createBackupMetadata)), - copyBackup: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - copyBackupResponse.decode.bind(copyBackupResponse), - copyBackupMetadata.decode.bind(copyBackupMetadata)), - restoreDatabase: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - restoreDatabaseResponse.decode.bind(restoreDatabaseResponse), - restoreDatabaseMetadata.decode.bind(restoreDatabaseMetadata)) - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.spanner.admin.database.v1.DatabaseAdmin', gapicConfig as gax.ClientConfig, - opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); - - // Set up a dictionary of "inner API calls"; the core implementation - // of calling the API is handled in `google-gax`, with this code - // merely providing the destination and request information. - this.innerApiCalls = {}; - - // Add a warn function to the client constructor so it can be easily tested. - this.warn = this._gaxModule.warn; - } - - /** - * Initialize the client. - * Performs asynchronous operations (such as authentication) and prepares the client. - * This function will be called automatically when any class method is called for the - * first time, but if you need to initialize it before calling an actual method, - * feel free to call initialize() directly. - * - * You can await on this method if you want to make sure the client is initialized. - * - * @returns {Promise} A promise that resolves to an authenticated service stub. - */ - initialize() { - // If the client stub promise is already initialized, return immediately. - if (this.databaseAdminStub) { - return this.databaseAdminStub; - } - - // Put together the "service stub" for - // google.spanner.admin.database.v1.DatabaseAdmin. - this.databaseAdminStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.spanner.admin.database.v1.DatabaseAdmin') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.spanner.admin.database.v1.DatabaseAdmin, - this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; - - // Iterate over each of the methods that the service provides - // and create an API call method for each. - const databaseAdminStubMethods = - ['listDatabases', 'createDatabase', 'getDatabase', 'updateDatabase', 'updateDatabaseDdl', 'dropDatabase', 'getDatabaseDdl', 'setIamPolicy', 'getIamPolicy', 'testIamPermissions', 'createBackup', 'copyBackup', 'getBackup', 'updateBackup', 'deleteBackup', 'listBackups', 'restoreDatabase', 'listDatabaseOperations', 'listBackupOperations', 'listDatabaseRoles', 'addSplitPoints', 'createBackupSchedule', 'getBackupSchedule', 'updateBackupSchedule', 'deleteBackupSchedule', 'listBackupSchedules', 'internalUpdateGraphOperation']; - for (const methodName of databaseAdminStubMethods) { - const callPromise = this.databaseAdminStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, - (err: Error|null|undefined) => () => { - throw err; - }); - - const descriptor = - this.descriptors.page[methodName] || - this.descriptors.longrunning[methodName] || - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor, - this._opts.fallback - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.databaseAdminStub; - } - - /** - * The DNS address for this API service. - * @deprecated Use the apiEndpoint method of the client instance. - * @returns {string} The DNS address for this service. - */ - static get servicePath() { - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); - } - return 'spanner.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath. - * @deprecated Use the apiEndpoint method of the client instance. - * @returns {string} The DNS address for this service. - */ - static get apiEndpoint() { - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); - } - return 'spanner.googleapis.com'; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - get apiEndpoint() { - return this._servicePath; - } - - get universeDomain() { - return this._universeDomain; - } - - /** - * The port for this API service. - * @returns {number} The default port for this service. - */ - static get port() { - return 443; - } - - /** - * The scopes needed to make gRPC calls for every method defined - * in this service. - * @returns {string[]} List of default scopes. - */ - static get scopes() { - return [ - 'https://www.googleapis.com/auth/cloud-platform', - 'https://www.googleapis.com/auth/spanner.admin' - ]; - } - - getProjectId(): Promise; - getProjectId(callback: Callback): void; - /** - * Return the project ID used by this class. - * @returns {Promise} A promise that resolves to string containing the project ID. - */ - getProjectId(callback?: Callback): - Promise|void { - if (callback) { - this.auth.getProjectId(callback); - return; - } - return this.auth.getProjectId(); - } - - // ------------------- - // -- Service calls -- - // ------------------- -/** - * Gets the state of a Cloud Spanner database. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the requested database. Values are of the form - * `projects//instances//databases/`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.spanner.admin.database.v1.Database|Database}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - */ - getDatabase( - request?: protos.google.spanner.admin.database.v1.IGetDatabaseRequest, - options?: CallOptions): - Promise<[ - protos.google.spanner.admin.database.v1.IDatabase, - protos.google.spanner.admin.database.v1.IGetDatabaseRequest|undefined, {}|undefined - ]>; - getDatabase( - request: protos.google.spanner.admin.database.v1.IGetDatabaseRequest, - options: CallOptions, - callback: Callback< - protos.google.spanner.admin.database.v1.IDatabase, - protos.google.spanner.admin.database.v1.IGetDatabaseRequest|null|undefined, - {}|null|undefined>): void; - getDatabase( - request: protos.google.spanner.admin.database.v1.IGetDatabaseRequest, - callback: Callback< - protos.google.spanner.admin.database.v1.IDatabase, - protos.google.spanner.admin.database.v1.IGetDatabaseRequest|null|undefined, - {}|null|undefined>): void; - getDatabase( - request?: protos.google.spanner.admin.database.v1.IGetDatabaseRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.spanner.admin.database.v1.IDatabase, - protos.google.spanner.admin.database.v1.IGetDatabaseRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.spanner.admin.database.v1.IDatabase, - protos.google.spanner.admin.database.v1.IGetDatabaseRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.spanner.admin.database.v1.IDatabase, - protos.google.spanner.admin.database.v1.IGetDatabaseRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('getDatabase request %j', request); - const wrappedCallback: Callback< - protos.google.spanner.admin.database.v1.IDatabase, - protos.google.spanner.admin.database.v1.IGetDatabaseRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getDatabase response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getDatabase(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.spanner.admin.database.v1.IDatabase, - protos.google.spanner.admin.database.v1.IGetDatabaseRequest|undefined, - {}|undefined - ]) => { - this._log.info('getDatabase response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Drops (aka deletes) a Cloud Spanner database. - * Completed backups for the database will be retained according to their - * `expire_time`. - * Note: Cloud Spanner might continue to accept requests for a few seconds - * after the database has been deleted. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.database - * Required. The database to be dropped. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - */ - dropDatabase( - request?: protos.google.spanner.admin.database.v1.IDropDatabaseRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.spanner.admin.database.v1.IDropDatabaseRequest|undefined, {}|undefined - ]>; - dropDatabase( - request: protos.google.spanner.admin.database.v1.IDropDatabaseRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.spanner.admin.database.v1.IDropDatabaseRequest|null|undefined, - {}|null|undefined>): void; - dropDatabase( - request: protos.google.spanner.admin.database.v1.IDropDatabaseRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.spanner.admin.database.v1.IDropDatabaseRequest|null|undefined, - {}|null|undefined>): void; - dropDatabase( - request?: protos.google.spanner.admin.database.v1.IDropDatabaseRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.spanner.admin.database.v1.IDropDatabaseRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.spanner.admin.database.v1.IDropDatabaseRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.spanner.admin.database.v1.IDropDatabaseRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'database': request.database ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('dropDatabase request %j', request); - const wrappedCallback: Callback< - protos.google.protobuf.IEmpty, - protos.google.spanner.admin.database.v1.IDropDatabaseRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('dropDatabase response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.dropDatabase(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.protobuf.IEmpty, - protos.google.spanner.admin.database.v1.IDropDatabaseRequest|undefined, - {}|undefined - ]) => { - this._log.info('dropDatabase response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Returns the schema of a Cloud Spanner database as a list of formatted - * DDL statements. This method does not show pending schema updates, those may - * be queried using the {@link protos.google.longrunning.Operations|Operations} API. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.database - * Required. The database whose schema we wish to get. - * Values are of the form - * `projects//instances//databases/` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.spanner.admin.database.v1.GetDatabaseDdlResponse|GetDatabaseDdlResponse}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - */ - getDatabaseDdl( - request?: protos.google.spanner.admin.database.v1.IGetDatabaseDdlRequest, - options?: CallOptions): - Promise<[ - protos.google.spanner.admin.database.v1.IGetDatabaseDdlResponse, - protos.google.spanner.admin.database.v1.IGetDatabaseDdlRequest|undefined, {}|undefined - ]>; - getDatabaseDdl( - request: protos.google.spanner.admin.database.v1.IGetDatabaseDdlRequest, - options: CallOptions, - callback: Callback< - protos.google.spanner.admin.database.v1.IGetDatabaseDdlResponse, - protos.google.spanner.admin.database.v1.IGetDatabaseDdlRequest|null|undefined, - {}|null|undefined>): void; - getDatabaseDdl( - request: protos.google.spanner.admin.database.v1.IGetDatabaseDdlRequest, - callback: Callback< - protos.google.spanner.admin.database.v1.IGetDatabaseDdlResponse, - protos.google.spanner.admin.database.v1.IGetDatabaseDdlRequest|null|undefined, - {}|null|undefined>): void; - getDatabaseDdl( - request?: protos.google.spanner.admin.database.v1.IGetDatabaseDdlRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.spanner.admin.database.v1.IGetDatabaseDdlResponse, - protos.google.spanner.admin.database.v1.IGetDatabaseDdlRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.spanner.admin.database.v1.IGetDatabaseDdlResponse, - protos.google.spanner.admin.database.v1.IGetDatabaseDdlRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.spanner.admin.database.v1.IGetDatabaseDdlResponse, - protos.google.spanner.admin.database.v1.IGetDatabaseDdlRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'database': request.database ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('getDatabaseDdl request %j', request); - const wrappedCallback: Callback< - protos.google.spanner.admin.database.v1.IGetDatabaseDdlResponse, - protos.google.spanner.admin.database.v1.IGetDatabaseDdlRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getDatabaseDdl response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getDatabaseDdl(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.spanner.admin.database.v1.IGetDatabaseDdlResponse, - protos.google.spanner.admin.database.v1.IGetDatabaseDdlRequest|undefined, - {}|undefined - ]) => { - this._log.info('getDatabaseDdl response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Sets the access control policy on a database or backup resource. - * Replaces any existing policy. - * - * Authorization requires `spanner.databases.setIamPolicy` - * permission on {@link protos.google.iam.v1.SetIamPolicyRequest.resource|resource}. - * For backups, authorization requires `spanner.backups.setIamPolicy` - * permission on {@link protos.google.iam.v1.SetIamPolicyRequest.resource|resource}. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy is being specified. - * See the operation documentation for the appropriate value for this field. - * @param {google.iam.v1.Policy} request.policy - * REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a - * valid policy but certain Cloud Platform services (such as Projects) - * might reject them. - * @param {google.protobuf.FieldMask} request.updateMask - * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - * the fields in the mask will be modified. If no mask is provided, the - * following default mask is used: - * - * `paths: "bindings, etag"` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.iam.v1.Policy|Policy}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - */ - setIamPolicy( - request?: protos.google.iam.v1.ISetIamPolicyRequest, - options?: CallOptions): - Promise<[ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|undefined, {}|undefined - ]>; - setIamPolicy( - request: protos.google.iam.v1.ISetIamPolicyRequest, - options: CallOptions, - callback: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, - {}|null|undefined>): void; - setIamPolicy( - request: protos.google.iam.v1.ISetIamPolicyRequest, - callback: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, - {}|null|undefined>): void; - setIamPolicy( - request?: protos.google.iam.v1.ISetIamPolicyRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'resource': request.resource ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('setIamPolicy request %j', request); - const wrappedCallback: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('setIamPolicy response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.setIamPolicy(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|undefined, - {}|undefined - ]) => { - this._log.info('setIamPolicy response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Gets the access control policy for a database or backup resource. - * Returns an empty policy if a database or backup exists but does not have a - * policy set. - * - * Authorization requires `spanner.databases.getIamPolicy` permission on - * {@link protos.google.iam.v1.GetIamPolicyRequest.resource|resource}. - * For backups, authorization requires `spanner.backups.getIamPolicy` - * permission on {@link protos.google.iam.v1.GetIamPolicyRequest.resource|resource}. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {google.iam.v1.GetPolicyOptions} request.options - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.iam.v1.Policy|Policy}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - */ - getIamPolicy( - request?: protos.google.iam.v1.IGetIamPolicyRequest, - options?: CallOptions): - Promise<[ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|undefined, {}|undefined - ]>; - getIamPolicy( - request: protos.google.iam.v1.IGetIamPolicyRequest, - options: CallOptions, - callback: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, - {}|null|undefined>): void; - getIamPolicy( - request: protos.google.iam.v1.IGetIamPolicyRequest, - callback: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, - {}|null|undefined>): void; - getIamPolicy( - request?: protos.google.iam.v1.IGetIamPolicyRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'resource': request.resource ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('getIamPolicy request %j', request); - const wrappedCallback: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getIamPolicy response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getIamPolicy(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|undefined, - {}|undefined - ]) => { - this._log.info('getIamPolicy response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Returns permissions that the caller has on the specified database or backup - * resource. - * - * Attempting this RPC on a non-existent Cloud Spanner database will - * result in a NOT_FOUND error if the user has - * `spanner.databases.list` permission on the containing Cloud - * Spanner instance. Otherwise returns an empty set of permissions. - * Calling this method on a backup that does not exist will - * result in a NOT_FOUND error if the user has - * `spanner.backups.list` permission on the containing instance. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.iam.v1.TestIamPermissionsResponse|TestIamPermissionsResponse}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - */ - testIamPermissions( - request?: protos.google.iam.v1.ITestIamPermissionsRequest, - options?: CallOptions): - Promise<[ - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|undefined, {}|undefined - ]>; - testIamPermissions( - request: protos.google.iam.v1.ITestIamPermissionsRequest, - options: CallOptions, - callback: Callback< - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, - {}|null|undefined>): void; - testIamPermissions( - request: protos.google.iam.v1.ITestIamPermissionsRequest, - callback: Callback< - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, - {}|null|undefined>): void; - testIamPermissions( - request?: protos.google.iam.v1.ITestIamPermissionsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'resource': request.resource ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('testIamPermissions request %j', request); - const wrappedCallback: Callback< - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('testIamPermissions response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.testIamPermissions(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|undefined, - {}|undefined - ]) => { - this._log.info('testIamPermissions response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Gets metadata on a pending or completed - * {@link protos.google.spanner.admin.database.v1.Backup|Backup}. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Name of the backup. - * Values are of the form - * `projects//instances//backups/`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.spanner.admin.database.v1.Backup|Backup}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - */ - getBackup( - request?: protos.google.spanner.admin.database.v1.IGetBackupRequest, - options?: CallOptions): - Promise<[ - protos.google.spanner.admin.database.v1.IBackup, - protos.google.spanner.admin.database.v1.IGetBackupRequest|undefined, {}|undefined - ]>; - getBackup( - request: protos.google.spanner.admin.database.v1.IGetBackupRequest, - options: CallOptions, - callback: Callback< - protos.google.spanner.admin.database.v1.IBackup, - protos.google.spanner.admin.database.v1.IGetBackupRequest|null|undefined, - {}|null|undefined>): void; - getBackup( - request: protos.google.spanner.admin.database.v1.IGetBackupRequest, - callback: Callback< - protos.google.spanner.admin.database.v1.IBackup, - protos.google.spanner.admin.database.v1.IGetBackupRequest|null|undefined, - {}|null|undefined>): void; - getBackup( - request?: protos.google.spanner.admin.database.v1.IGetBackupRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.spanner.admin.database.v1.IBackup, - protos.google.spanner.admin.database.v1.IGetBackupRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.spanner.admin.database.v1.IBackup, - protos.google.spanner.admin.database.v1.IGetBackupRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.spanner.admin.database.v1.IBackup, - protos.google.spanner.admin.database.v1.IGetBackupRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('getBackup request %j', request); - const wrappedCallback: Callback< - protos.google.spanner.admin.database.v1.IBackup, - protos.google.spanner.admin.database.v1.IGetBackupRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getBackup response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getBackup(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.spanner.admin.database.v1.IBackup, - protos.google.spanner.admin.database.v1.IGetBackupRequest|undefined, - {}|undefined - ]) => { - this._log.info('getBackup response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Updates a pending or completed - * {@link protos.google.spanner.admin.database.v1.Backup|Backup}. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.spanner.admin.database.v1.Backup} request.backup - * Required. The backup to update. `backup.name`, and the fields to be updated - * as specified by `update_mask` are required. Other fields are ignored. - * Update is only supported for the following fields: - * * `backup.expire_time`. - * @param {google.protobuf.FieldMask} request.updateMask - * Required. A mask specifying which fields (e.g. `expire_time`) in the - * Backup resource should be updated. This mask is relative to the Backup - * resource, not to the request message. The field mask must always be - * specified; this prevents any future fields from being erased accidentally - * by clients that do not know about them. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.spanner.admin.database.v1.Backup|Backup}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - */ - updateBackup( - request?: protos.google.spanner.admin.database.v1.IUpdateBackupRequest, - options?: CallOptions): - Promise<[ - protos.google.spanner.admin.database.v1.IBackup, - protos.google.spanner.admin.database.v1.IUpdateBackupRequest|undefined, {}|undefined - ]>; - updateBackup( - request: protos.google.spanner.admin.database.v1.IUpdateBackupRequest, - options: CallOptions, - callback: Callback< - protos.google.spanner.admin.database.v1.IBackup, - protos.google.spanner.admin.database.v1.IUpdateBackupRequest|null|undefined, - {}|null|undefined>): void; - updateBackup( - request: protos.google.spanner.admin.database.v1.IUpdateBackupRequest, - callback: Callback< - protos.google.spanner.admin.database.v1.IBackup, - protos.google.spanner.admin.database.v1.IUpdateBackupRequest|null|undefined, - {}|null|undefined>): void; - updateBackup( - request?: protos.google.spanner.admin.database.v1.IUpdateBackupRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.spanner.admin.database.v1.IBackup, - protos.google.spanner.admin.database.v1.IUpdateBackupRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.spanner.admin.database.v1.IBackup, - protos.google.spanner.admin.database.v1.IUpdateBackupRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.spanner.admin.database.v1.IBackup, - protos.google.spanner.admin.database.v1.IUpdateBackupRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'backup.name': request.backup!.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('updateBackup request %j', request); - const wrappedCallback: Callback< - protos.google.spanner.admin.database.v1.IBackup, - protos.google.spanner.admin.database.v1.IUpdateBackupRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('updateBackup response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.updateBackup(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.spanner.admin.database.v1.IBackup, - protos.google.spanner.admin.database.v1.IUpdateBackupRequest|undefined, - {}|undefined - ]) => { - this._log.info('updateBackup response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Deletes a pending or completed - * {@link protos.google.spanner.admin.database.v1.Backup|Backup}. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Name of the backup to delete. - * Values are of the form - * `projects//instances//backups/`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - */ - deleteBackup( - request?: protos.google.spanner.admin.database.v1.IDeleteBackupRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.spanner.admin.database.v1.IDeleteBackupRequest|undefined, {}|undefined - ]>; - deleteBackup( - request: protos.google.spanner.admin.database.v1.IDeleteBackupRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.spanner.admin.database.v1.IDeleteBackupRequest|null|undefined, - {}|null|undefined>): void; - deleteBackup( - request: protos.google.spanner.admin.database.v1.IDeleteBackupRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.spanner.admin.database.v1.IDeleteBackupRequest|null|undefined, - {}|null|undefined>): void; - deleteBackup( - request?: protos.google.spanner.admin.database.v1.IDeleteBackupRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.spanner.admin.database.v1.IDeleteBackupRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.spanner.admin.database.v1.IDeleteBackupRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.spanner.admin.database.v1.IDeleteBackupRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('deleteBackup request %j', request); - const wrappedCallback: Callback< - protos.google.protobuf.IEmpty, - protos.google.spanner.admin.database.v1.IDeleteBackupRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('deleteBackup response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.deleteBackup(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.protobuf.IEmpty, - protos.google.spanner.admin.database.v1.IDeleteBackupRequest|undefined, - {}|undefined - ]) => { - this._log.info('deleteBackup response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Adds split points to specified tables, indexes of a database. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.database - * Required. The database on whose tables/indexes split points are to be - * added. Values are of the form - * `projects//instances//databases/`. - * @param {number[]} request.splitPoints - * Required. The split points to add. - * @param {string} [request.initiator] - * Optional. A user-supplied tag associated with the split points. - * For example, "intital_data_load", "special_event_1". - * Defaults to "CloudAddSplitPointsAPI" if not specified. - * The length of the tag must not exceed 50 characters,else will be trimmed. - * Only valid UTF8 characters are allowed. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.spanner.admin.database.v1.AddSplitPointsResponse|AddSplitPointsResponse}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - */ - addSplitPoints( - request?: protos.google.spanner.admin.database.v1.IAddSplitPointsRequest, - options?: CallOptions): - Promise<[ - protos.google.spanner.admin.database.v1.IAddSplitPointsResponse, - protos.google.spanner.admin.database.v1.IAddSplitPointsRequest|undefined, {}|undefined - ]>; - addSplitPoints( - request: protos.google.spanner.admin.database.v1.IAddSplitPointsRequest, - options: CallOptions, - callback: Callback< - protos.google.spanner.admin.database.v1.IAddSplitPointsResponse, - protos.google.spanner.admin.database.v1.IAddSplitPointsRequest|null|undefined, - {}|null|undefined>): void; - addSplitPoints( - request: protos.google.spanner.admin.database.v1.IAddSplitPointsRequest, - callback: Callback< - protos.google.spanner.admin.database.v1.IAddSplitPointsResponse, - protos.google.spanner.admin.database.v1.IAddSplitPointsRequest|null|undefined, - {}|null|undefined>): void; - addSplitPoints( - request?: protos.google.spanner.admin.database.v1.IAddSplitPointsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.spanner.admin.database.v1.IAddSplitPointsResponse, - protos.google.spanner.admin.database.v1.IAddSplitPointsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.spanner.admin.database.v1.IAddSplitPointsResponse, - protos.google.spanner.admin.database.v1.IAddSplitPointsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.spanner.admin.database.v1.IAddSplitPointsResponse, - protos.google.spanner.admin.database.v1.IAddSplitPointsRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'database': request.database ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('addSplitPoints request %j', request); - const wrappedCallback: Callback< - protos.google.spanner.admin.database.v1.IAddSplitPointsResponse, - protos.google.spanner.admin.database.v1.IAddSplitPointsRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('addSplitPoints response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.addSplitPoints(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.spanner.admin.database.v1.IAddSplitPointsResponse, - protos.google.spanner.admin.database.v1.IAddSplitPointsRequest|undefined, - {}|undefined - ]) => { - this._log.info('addSplitPoints response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Creates a new backup schedule. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the database that this backup schedule applies to. - * @param {string} request.backupScheduleId - * Required. The Id to use for the backup schedule. The `backup_schedule_id` - * appended to `parent` forms the full backup schedule name of the form - * `projects//instances//databases//backupSchedules/`. - * @param {google.spanner.admin.database.v1.BackupSchedule} request.backupSchedule - * Required. The backup schedule to create. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.spanner.admin.database.v1.BackupSchedule|BackupSchedule}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - */ - createBackupSchedule( - request?: protos.google.spanner.admin.database.v1.ICreateBackupScheduleRequest, - options?: CallOptions): - Promise<[ - protos.google.spanner.admin.database.v1.IBackupSchedule, - protos.google.spanner.admin.database.v1.ICreateBackupScheduleRequest|undefined, {}|undefined - ]>; - createBackupSchedule( - request: protos.google.spanner.admin.database.v1.ICreateBackupScheduleRequest, - options: CallOptions, - callback: Callback< - protos.google.spanner.admin.database.v1.IBackupSchedule, - protos.google.spanner.admin.database.v1.ICreateBackupScheduleRequest|null|undefined, - {}|null|undefined>): void; - createBackupSchedule( - request: protos.google.spanner.admin.database.v1.ICreateBackupScheduleRequest, - callback: Callback< - protos.google.spanner.admin.database.v1.IBackupSchedule, - protos.google.spanner.admin.database.v1.ICreateBackupScheduleRequest|null|undefined, - {}|null|undefined>): void; - createBackupSchedule( - request?: protos.google.spanner.admin.database.v1.ICreateBackupScheduleRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.spanner.admin.database.v1.IBackupSchedule, - protos.google.spanner.admin.database.v1.ICreateBackupScheduleRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.spanner.admin.database.v1.IBackupSchedule, - protos.google.spanner.admin.database.v1.ICreateBackupScheduleRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.spanner.admin.database.v1.IBackupSchedule, - protos.google.spanner.admin.database.v1.ICreateBackupScheduleRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('createBackupSchedule request %j', request); - const wrappedCallback: Callback< - protos.google.spanner.admin.database.v1.IBackupSchedule, - protos.google.spanner.admin.database.v1.ICreateBackupScheduleRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('createBackupSchedule response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.createBackupSchedule(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.spanner.admin.database.v1.IBackupSchedule, - protos.google.spanner.admin.database.v1.ICreateBackupScheduleRequest|undefined, - {}|undefined - ]) => { - this._log.info('createBackupSchedule response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Gets backup schedule for the input schedule name. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the schedule to retrieve. - * Values are of the form - * `projects//instances//databases//backupSchedules/`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.spanner.admin.database.v1.BackupSchedule|BackupSchedule}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - */ - getBackupSchedule( - request?: protos.google.spanner.admin.database.v1.IGetBackupScheduleRequest, - options?: CallOptions): - Promise<[ - protos.google.spanner.admin.database.v1.IBackupSchedule, - protos.google.spanner.admin.database.v1.IGetBackupScheduleRequest|undefined, {}|undefined - ]>; - getBackupSchedule( - request: protos.google.spanner.admin.database.v1.IGetBackupScheduleRequest, - options: CallOptions, - callback: Callback< - protos.google.spanner.admin.database.v1.IBackupSchedule, - protos.google.spanner.admin.database.v1.IGetBackupScheduleRequest|null|undefined, - {}|null|undefined>): void; - getBackupSchedule( - request: protos.google.spanner.admin.database.v1.IGetBackupScheduleRequest, - callback: Callback< - protos.google.spanner.admin.database.v1.IBackupSchedule, - protos.google.spanner.admin.database.v1.IGetBackupScheduleRequest|null|undefined, - {}|null|undefined>): void; - getBackupSchedule( - request?: protos.google.spanner.admin.database.v1.IGetBackupScheduleRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.spanner.admin.database.v1.IBackupSchedule, - protos.google.spanner.admin.database.v1.IGetBackupScheduleRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.spanner.admin.database.v1.IBackupSchedule, - protos.google.spanner.admin.database.v1.IGetBackupScheduleRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.spanner.admin.database.v1.IBackupSchedule, - protos.google.spanner.admin.database.v1.IGetBackupScheduleRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('getBackupSchedule request %j', request); - const wrappedCallback: Callback< - protos.google.spanner.admin.database.v1.IBackupSchedule, - protos.google.spanner.admin.database.v1.IGetBackupScheduleRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getBackupSchedule response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getBackupSchedule(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.spanner.admin.database.v1.IBackupSchedule, - protos.google.spanner.admin.database.v1.IGetBackupScheduleRequest|undefined, - {}|undefined - ]) => { - this._log.info('getBackupSchedule response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Updates a backup schedule. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.spanner.admin.database.v1.BackupSchedule} request.backupSchedule - * Required. The backup schedule to update. `backup_schedule.name`, and the - * fields to be updated as specified by `update_mask` are required. Other - * fields are ignored. - * @param {google.protobuf.FieldMask} request.updateMask - * Required. A mask specifying which fields in the BackupSchedule resource - * should be updated. This mask is relative to the BackupSchedule resource, - * not to the request message. The field mask must always be - * specified; this prevents any future fields from being erased - * accidentally. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.spanner.admin.database.v1.BackupSchedule|BackupSchedule}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - */ - updateBackupSchedule( - request?: protos.google.spanner.admin.database.v1.IUpdateBackupScheduleRequest, - options?: CallOptions): - Promise<[ - protos.google.spanner.admin.database.v1.IBackupSchedule, - protos.google.spanner.admin.database.v1.IUpdateBackupScheduleRequest|undefined, {}|undefined - ]>; - updateBackupSchedule( - request: protos.google.spanner.admin.database.v1.IUpdateBackupScheduleRequest, - options: CallOptions, - callback: Callback< - protos.google.spanner.admin.database.v1.IBackupSchedule, - protos.google.spanner.admin.database.v1.IUpdateBackupScheduleRequest|null|undefined, - {}|null|undefined>): void; - updateBackupSchedule( - request: protos.google.spanner.admin.database.v1.IUpdateBackupScheduleRequest, - callback: Callback< - protos.google.spanner.admin.database.v1.IBackupSchedule, - protos.google.spanner.admin.database.v1.IUpdateBackupScheduleRequest|null|undefined, - {}|null|undefined>): void; - updateBackupSchedule( - request?: protos.google.spanner.admin.database.v1.IUpdateBackupScheduleRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.spanner.admin.database.v1.IBackupSchedule, - protos.google.spanner.admin.database.v1.IUpdateBackupScheduleRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.spanner.admin.database.v1.IBackupSchedule, - protos.google.spanner.admin.database.v1.IUpdateBackupScheduleRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.spanner.admin.database.v1.IBackupSchedule, - protos.google.spanner.admin.database.v1.IUpdateBackupScheduleRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'backup_schedule.name': request.backupSchedule!.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('updateBackupSchedule request %j', request); - const wrappedCallback: Callback< - protos.google.spanner.admin.database.v1.IBackupSchedule, - protos.google.spanner.admin.database.v1.IUpdateBackupScheduleRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('updateBackupSchedule response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.updateBackupSchedule(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.spanner.admin.database.v1.IBackupSchedule, - protos.google.spanner.admin.database.v1.IUpdateBackupScheduleRequest|undefined, - {}|undefined - ]) => { - this._log.info('updateBackupSchedule response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Deletes a backup schedule. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the schedule to delete. - * Values are of the form - * `projects//instances//databases//backupSchedules/`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - */ - deleteBackupSchedule( - request?: protos.google.spanner.admin.database.v1.IDeleteBackupScheduleRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.spanner.admin.database.v1.IDeleteBackupScheduleRequest|undefined, {}|undefined - ]>; - deleteBackupSchedule( - request: protos.google.spanner.admin.database.v1.IDeleteBackupScheduleRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.spanner.admin.database.v1.IDeleteBackupScheduleRequest|null|undefined, - {}|null|undefined>): void; - deleteBackupSchedule( - request: protos.google.spanner.admin.database.v1.IDeleteBackupScheduleRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.spanner.admin.database.v1.IDeleteBackupScheduleRequest|null|undefined, - {}|null|undefined>): void; - deleteBackupSchedule( - request?: protos.google.spanner.admin.database.v1.IDeleteBackupScheduleRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.spanner.admin.database.v1.IDeleteBackupScheduleRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.spanner.admin.database.v1.IDeleteBackupScheduleRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.spanner.admin.database.v1.IDeleteBackupScheduleRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('deleteBackupSchedule request %j', request); - const wrappedCallback: Callback< - protos.google.protobuf.IEmpty, - protos.google.spanner.admin.database.v1.IDeleteBackupScheduleRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('deleteBackupSchedule response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.deleteBackupSchedule(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.protobuf.IEmpty, - protos.google.spanner.admin.database.v1.IDeleteBackupScheduleRequest|undefined, - {}|undefined - ]) => { - this._log.info('deleteBackupSchedule response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * This is an internal API called by Spanner Graph jobs. You should never need - * to call this API directly. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.database - * Internal field, do not use directly. - * @param {string} request.operationId - * Internal field, do not use directly. - * @param {string} request.vmIdentityToken - * Internal field, do not use directly. - * @param {number} [request.progress] - * Internal field, do not use directly. - * @param {google.rpc.Status} [request.status] - * Internal field, do not use directly. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse|InternalUpdateGraphOperationResponse}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - */ - internalUpdateGraphOperation( - request?: protos.google.spanner.admin.database.v1.IInternalUpdateGraphOperationRequest, - options?: CallOptions): - Promise<[ - protos.google.spanner.admin.database.v1.IInternalUpdateGraphOperationResponse, - protos.google.spanner.admin.database.v1.IInternalUpdateGraphOperationRequest|undefined, {}|undefined - ]>; - internalUpdateGraphOperation( - request: protos.google.spanner.admin.database.v1.IInternalUpdateGraphOperationRequest, - options: CallOptions, - callback: Callback< - protos.google.spanner.admin.database.v1.IInternalUpdateGraphOperationResponse, - protos.google.spanner.admin.database.v1.IInternalUpdateGraphOperationRequest|null|undefined, - {}|null|undefined>): void; - internalUpdateGraphOperation( - request: protos.google.spanner.admin.database.v1.IInternalUpdateGraphOperationRequest, - callback: Callback< - protos.google.spanner.admin.database.v1.IInternalUpdateGraphOperationResponse, - protos.google.spanner.admin.database.v1.IInternalUpdateGraphOperationRequest|null|undefined, - {}|null|undefined>): void; - internalUpdateGraphOperation( - request?: protos.google.spanner.admin.database.v1.IInternalUpdateGraphOperationRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.spanner.admin.database.v1.IInternalUpdateGraphOperationResponse, - protos.google.spanner.admin.database.v1.IInternalUpdateGraphOperationRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.spanner.admin.database.v1.IInternalUpdateGraphOperationResponse, - protos.google.spanner.admin.database.v1.IInternalUpdateGraphOperationRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.spanner.admin.database.v1.IInternalUpdateGraphOperationResponse, - protos.google.spanner.admin.database.v1.IInternalUpdateGraphOperationRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - this.initialize().catch(err => {throw err}); - this._log.info('internalUpdateGraphOperation request %j', request); - const wrappedCallback: Callback< - protos.google.spanner.admin.database.v1.IInternalUpdateGraphOperationResponse, - protos.google.spanner.admin.database.v1.IInternalUpdateGraphOperationRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('internalUpdateGraphOperation response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.internalUpdateGraphOperation(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.spanner.admin.database.v1.IInternalUpdateGraphOperationResponse, - protos.google.spanner.admin.database.v1.IInternalUpdateGraphOperationRequest|undefined, - {}|undefined - ]) => { - this._log.info('internalUpdateGraphOperation response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } - -/** - * Creates a new Cloud Spanner database and starts to prepare it for serving. - * The returned {@link protos.google.longrunning.Operation|long-running operation} will - * have a name of the format `/operations/` and - * can be used to track preparation of the database. The - * {@link protos.google.longrunning.Operation.metadata|metadata} field type is - * {@link protos.google.spanner.admin.database.v1.CreateDatabaseMetadata|CreateDatabaseMetadata}. - * The {@link protos.google.longrunning.Operation.response|response} field type is - * {@link protos.google.spanner.admin.database.v1.Database|Database}, if successful. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the instance that will serve the new database. - * Values are of the form `projects//instances/`. - * @param {string} request.createStatement - * Required. A `CREATE DATABASE` statement, which specifies the ID of the - * new database. The database ID must conform to the regular expression - * `{@link protos.a-z0-9_\-|a-z}*[a-z0-9]` and be between 2 and 30 characters in length. - * If the database ID is a reserved word or if it contains a hyphen, the - * database ID must be enclosed in backticks (`` ` ``). - * @param {string[]} [request.extraStatements] - * Optional. A list of DDL statements to run inside the newly created - * database. Statements can create tables, indexes, etc. These - * statements execute atomically with the creation of the database: - * if there is an error in any statement, the database is not created. - * @param {google.spanner.admin.database.v1.EncryptionConfig} [request.encryptionConfig] - * Optional. The encryption configuration for the database. If this field is - * not specified, Cloud Spanner will encrypt/decrypt all data at rest using - * Google default encryption. - * @param {google.spanner.admin.database.v1.DatabaseDialect} [request.databaseDialect] - * Optional. The dialect of the Cloud Spanner Database. - * @param {Buffer} [request.protoDescriptors] - * Optional. Proto descriptors used by CREATE/ALTER PROTO BUNDLE statements in - * 'extra_statements' above. - * Contains a protobuf-serialized - * [google.protobuf.FileDescriptorSet](https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/descriptor.proto). - * To generate it, [install](https://grpc.io/docs/protoc-installation/) and - * run `protoc` with --include_imports and --descriptor_set_out. For example, - * to generate for moon/shot/app.proto, run - * ``` - * $protoc --proto_path=/app_path --proto_path=/lib_path \ - * --include_imports \ - * --descriptor_set_out=descriptors.data \ - * moon/shot/app.proto - * ``` - * For more details, see protobuffer [self - * description](https://developers.google.com/protocol-buffers/docs/techniques#self-description). - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - */ - createDatabase( - request?: protos.google.spanner.admin.database.v1.ICreateDatabaseRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - createDatabase( - request: protos.google.spanner.admin.database.v1.ICreateDatabaseRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createDatabase( - request: protos.google.spanner.admin.database.v1.ICreateDatabaseRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createDatabase( - request?: protos.google.spanner.admin.database.v1.ICreateDatabaseRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('createDatabase response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('createDatabase request %j', request); - return this.innerApiCalls.createDatabase(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('createDatabase response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `createDatabase()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - */ - async checkCreateDatabaseProgress(name: string): Promise>{ - this._log.info('createDatabase long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createDatabase, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Updates a Cloud Spanner database. The returned - * {@link protos.google.longrunning.Operation|long-running operation} can be used to track - * the progress of updating the database. If the named database does not - * exist, returns `NOT_FOUND`. - * - * While the operation is pending: - * - * * The database's - * {@link protos.google.spanner.admin.database.v1.Database.reconciling|reconciling} - * field is set to true. - * * Cancelling the operation is best-effort. If the cancellation succeeds, - * the operation metadata's - * {@link protos.google.spanner.admin.database.v1.UpdateDatabaseMetadata.cancel_time|cancel_time} - * is set, the updates are reverted, and the operation terminates with a - * `CANCELLED` status. - * * New UpdateDatabase requests will return a `FAILED_PRECONDITION` error - * until the pending operation is done (returns successfully or with - * error). - * * Reading the database via the API continues to give the pre-request - * values. - * - * Upon completion of the returned operation: - * - * * The new values are in effect and readable via the API. - * * The database's - * {@link protos.google.spanner.admin.database.v1.Database.reconciling|reconciling} - * field becomes false. - * - * The returned {@link protos.google.longrunning.Operation|long-running operation} will - * have a name of the format - * `projects//instances//databases//operations/` - * and can be used to track the database modification. The - * {@link protos.google.longrunning.Operation.metadata|metadata} field type is - * {@link protos.google.spanner.admin.database.v1.UpdateDatabaseMetadata|UpdateDatabaseMetadata}. - * The {@link protos.google.longrunning.Operation.response|response} field type is - * {@link protos.google.spanner.admin.database.v1.Database|Database}, if successful. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.spanner.admin.database.v1.Database} request.database - * Required. The database to update. - * The `name` field of the database is of the form - * `projects//instances//databases/`. - * @param {google.protobuf.FieldMask} request.updateMask - * Required. The list of fields to update. Currently, only - * `enable_drop_protection` field can be updated. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - */ - updateDatabase( - request?: protos.google.spanner.admin.database.v1.IUpdateDatabaseRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - updateDatabase( - request: protos.google.spanner.admin.database.v1.IUpdateDatabaseRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateDatabase( - request: protos.google.spanner.admin.database.v1.IUpdateDatabaseRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateDatabase( - request?: protos.google.spanner.admin.database.v1.IUpdateDatabaseRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'database.name': request.database!.name ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('updateDatabase response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('updateDatabase request %j', request); - return this.innerApiCalls.updateDatabase(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('updateDatabase response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `updateDatabase()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - */ - async checkUpdateDatabaseProgress(name: string): Promise>{ - this._log.info('updateDatabase long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateDatabase, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Updates the schema of a Cloud Spanner database by - * creating/altering/dropping tables, columns, indexes, etc. The returned - * {@link protos.google.longrunning.Operation|long-running operation} will have a name of - * the format `/operations/` and can be used to - * track execution of the schema change(s). The - * {@link protos.google.longrunning.Operation.metadata|metadata} field type is - * {@link protos.google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata|UpdateDatabaseDdlMetadata}. - * The operation has no response. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.database - * Required. The database to update. - * @param {string[]} request.statements - * Required. DDL statements to be applied to the database. - * @param {string} request.operationId - * If empty, the new update request is assigned an - * automatically-generated operation ID. Otherwise, `operation_id` - * is used to construct the name of the resulting - * {@link protos.google.longrunning.Operation|Operation}. - * - * Specifying an explicit operation ID simplifies determining - * whether the statements were executed in the event that the - * {@link protos.google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl|UpdateDatabaseDdl} - * call is replayed, or the return value is otherwise lost: the - * {@link protos.google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.database|database} - * and `operation_id` fields can be combined to form the - * {@link protos.google.longrunning.Operation.name|name} of the resulting - * {@link protos.google.longrunning.Operation|longrunning.Operation}: - * `/operations/`. - * - * `operation_id` should be unique within the database, and must be - * a valid identifier: `{@link protos.a-z0-9_|a-z}*`. Note that - * automatically-generated operation IDs always begin with an - * underscore. If the named operation already exists, - * {@link protos.google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl|UpdateDatabaseDdl} - * returns `ALREADY_EXISTS`. - * @param {Buffer} [request.protoDescriptors] - * Optional. Proto descriptors used by CREATE/ALTER PROTO BUNDLE statements. - * Contains a protobuf-serialized - * [google.protobuf.FileDescriptorSet](https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/descriptor.proto). - * To generate it, [install](https://grpc.io/docs/protoc-installation/) and - * run `protoc` with --include_imports and --descriptor_set_out. For example, - * to generate for moon/shot/app.proto, run - * ``` - * $protoc --proto_path=/app_path --proto_path=/lib_path \ - * --include_imports \ - * --descriptor_set_out=descriptors.data \ - * moon/shot/app.proto - * ``` - * For more details, see protobuffer [self - * description](https://developers.google.com/protocol-buffers/docs/techniques#self-description). - * @param {boolean} [request.throughputMode] - * Optional. This field is exposed to be used by the Spanner Migration Tool. - * For more details, see - * [SMT](https://github.com/GoogleCloudPlatform/spanner-migration-tool). - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - */ - updateDatabaseDdl( - request?: protos.google.spanner.admin.database.v1.IUpdateDatabaseDdlRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - updateDatabaseDdl( - request: protos.google.spanner.admin.database.v1.IUpdateDatabaseDdlRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateDatabaseDdl( - request: protos.google.spanner.admin.database.v1.IUpdateDatabaseDdlRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateDatabaseDdl( - request?: protos.google.spanner.admin.database.v1.IUpdateDatabaseDdlRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'database': request.database ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('updateDatabaseDdl response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('updateDatabaseDdl request %j', request); - return this.innerApiCalls.updateDatabaseDdl(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('updateDatabaseDdl response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `updateDatabaseDdl()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - */ - async checkUpdateDatabaseDdlProgress(name: string): Promise>{ - this._log.info('updateDatabaseDdl long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateDatabaseDdl, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Starts creating a new Cloud Spanner Backup. - * The returned backup {@link protos.google.longrunning.Operation|long-running operation} - * will have a name of the format - * `projects//instances//backups//operations/` - * and can be used to track creation of the backup. The - * {@link protos.google.longrunning.Operation.metadata|metadata} field type is - * {@link protos.google.spanner.admin.database.v1.CreateBackupMetadata|CreateBackupMetadata}. - * The {@link protos.google.longrunning.Operation.response|response} field type is - * {@link protos.google.spanner.admin.database.v1.Backup|Backup}, if successful. - * Cancelling the returned operation will stop the creation and delete the - * backup. There can be only one pending backup creation per database. Backup - * creation of different databases can run concurrently. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the instance in which the backup will be - * created. This must be the same instance that contains the database the - * backup will be created from. The backup will be stored in the - * location(s) specified in the instance configuration of this - * instance. Values are of the form - * `projects//instances/`. - * @param {string} request.backupId - * Required. The id of the backup to be created. The `backup_id` appended to - * `parent` forms the full backup name of the form - * `projects//instances//backups/`. - * @param {google.spanner.admin.database.v1.Backup} request.backup - * Required. The backup to create. - * @param {google.spanner.admin.database.v1.CreateBackupEncryptionConfig} [request.encryptionConfig] - * Optional. The encryption configuration used to encrypt the backup. If this - * field is not specified, the backup will use the same encryption - * configuration as the database by default, namely - * {@link protos.google.spanner.admin.database.v1.CreateBackupEncryptionConfig.encryption_type|encryption_type} - * = `USE_DATABASE_ENCRYPTION`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - */ - createBackup( - request?: protos.google.spanner.admin.database.v1.ICreateBackupRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - createBackup( - request: protos.google.spanner.admin.database.v1.ICreateBackupRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createBackup( - request: protos.google.spanner.admin.database.v1.ICreateBackupRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createBackup( - request?: protos.google.spanner.admin.database.v1.ICreateBackupRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('createBackup response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('createBackup request %j', request); - return this.innerApiCalls.createBackup(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('createBackup response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `createBackup()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - */ - async checkCreateBackupProgress(name: string): Promise>{ - this._log.info('createBackup long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createBackup, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Starts copying a Cloud Spanner Backup. - * The returned backup {@link protos.google.longrunning.Operation|long-running operation} - * will have a name of the format - * `projects//instances//backups//operations/` - * and can be used to track copying of the backup. The operation is associated - * with the destination backup. - * The {@link protos.google.longrunning.Operation.metadata|metadata} field type is - * {@link protos.google.spanner.admin.database.v1.CopyBackupMetadata|CopyBackupMetadata}. - * The {@link protos.google.longrunning.Operation.response|response} field type is - * {@link protos.google.spanner.admin.database.v1.Backup|Backup}, if successful. - * Cancelling the returned operation will stop the copying and delete the - * destination backup. Concurrent CopyBackup requests can run on the same - * source backup. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the destination instance that will contain the backup - * copy. Values are of the form: `projects//instances/`. - * @param {string} request.backupId - * Required. The id of the backup copy. - * The `backup_id` appended to `parent` forms the full backup_uri of the form - * `projects//instances//backups/`. - * @param {string} request.sourceBackup - * Required. The source backup to be copied. - * The source backup needs to be in READY state for it to be copied. - * Once CopyBackup is in progress, the source backup cannot be deleted or - * cleaned up on expiration until CopyBackup is finished. - * Values are of the form: - * `projects//instances//backups/`. - * @param {google.protobuf.Timestamp} request.expireTime - * Required. The expiration time of the backup in microsecond granularity. - * The expiration time must be at least 6 hours and at most 366 days - * from the `create_time` of the source backup. Once the `expire_time` has - * passed, the backup is eligible to be automatically deleted by Cloud Spanner - * to free the resources used by the backup. - * @param {google.spanner.admin.database.v1.CopyBackupEncryptionConfig} [request.encryptionConfig] - * Optional. The encryption configuration used to encrypt the backup. If this - * field is not specified, the backup will use the same encryption - * configuration as the source backup by default, namely - * {@link protos.google.spanner.admin.database.v1.CopyBackupEncryptionConfig.encryption_type|encryption_type} - * = `USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - */ - copyBackup( - request?: protos.google.spanner.admin.database.v1.ICopyBackupRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - copyBackup( - request: protos.google.spanner.admin.database.v1.ICopyBackupRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - copyBackup( - request: protos.google.spanner.admin.database.v1.ICopyBackupRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - copyBackup( - request?: protos.google.spanner.admin.database.v1.ICopyBackupRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('copyBackup response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('copyBackup request %j', request); - return this.innerApiCalls.copyBackup(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('copyBackup response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `copyBackup()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - */ - async checkCopyBackupProgress(name: string): Promise>{ - this._log.info('copyBackup long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.copyBackup, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Create a new database by restoring from a completed backup. The new - * database must be in the same project and in an instance with the same - * instance configuration as the instance containing - * the backup. The returned database [long-running - * operation][google.longrunning.Operation] has a name of the format - * `projects//instances//databases//operations/`, - * and can be used to track the progress of the operation, and to cancel it. - * The {@link protos.google.longrunning.Operation.metadata|metadata} field type is - * {@link protos.google.spanner.admin.database.v1.RestoreDatabaseMetadata|RestoreDatabaseMetadata}. - * The {@link protos.google.longrunning.Operation.response|response} type - * is {@link protos.google.spanner.admin.database.v1.Database|Database}, if - * successful. Cancelling the returned operation will stop the restore and - * delete the database. - * There can be only one database being restored into an instance at a time. - * Once the restore operation completes, a new restore operation can be - * initiated, without waiting for the optimize operation associated with the - * first restore to complete. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the instance in which to create the - * restored database. This instance must be in the same project and - * have the same instance configuration as the instance containing - * the source backup. Values are of the form - * `projects//instances/`. - * @param {string} request.databaseId - * Required. The id of the database to create and restore to. This - * database must not already exist. The `database_id` appended to - * `parent` forms the full database name of the form - * `projects//instances//databases/`. - * @param {string} request.backup - * Name of the backup from which to restore. Values are of the form - * `projects//instances//backups/`. - * @param {google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig} [request.encryptionConfig] - * Optional. An encryption configuration describing the encryption type and - * key resources in Cloud KMS used to encrypt/decrypt the database to restore - * to. If this field is not specified, the restored database will use the same - * encryption configuration as the backup by default, namely - * {@link protos.google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.encryption_type|encryption_type} - * = `USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - */ - restoreDatabase( - request?: protos.google.spanner.admin.database.v1.IRestoreDatabaseRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - restoreDatabase( - request: protos.google.spanner.admin.database.v1.IRestoreDatabaseRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - restoreDatabase( - request: protos.google.spanner.admin.database.v1.IRestoreDatabaseRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - restoreDatabase( - request?: protos.google.spanner.admin.database.v1.IRestoreDatabaseRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('restoreDatabase response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('restoreDatabase request %j', request); - return this.innerApiCalls.restoreDatabase(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('restoreDatabase response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `restoreDatabase()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - */ - async checkRestoreDatabaseProgress(name: string): Promise>{ - this._log.info('restoreDatabase long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.restoreDatabase, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } - /** - * Lists Cloud Spanner databases. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The instance whose databases should be listed. - * Values are of the form `projects//instances/`. - * @param {number} request.pageSize - * Number of databases to be returned in the response. If 0 or less, - * defaults to the server's maximum allowed page size. - * @param {string} request.pageToken - * If non-empty, `page_token` should contain a - * {@link protos.google.spanner.admin.database.v1.ListDatabasesResponse.next_page_token|next_page_token} - * from a previous - * {@link protos.google.spanner.admin.database.v1.ListDatabasesResponse|ListDatabasesResponse}. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.spanner.admin.database.v1.Database|Database}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listDatabasesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listDatabases( - request?: protos.google.spanner.admin.database.v1.IListDatabasesRequest, - options?: CallOptions): - Promise<[ - protos.google.spanner.admin.database.v1.IDatabase[], - protos.google.spanner.admin.database.v1.IListDatabasesRequest|null, - protos.google.spanner.admin.database.v1.IListDatabasesResponse - ]>; - listDatabases( - request: protos.google.spanner.admin.database.v1.IListDatabasesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.spanner.admin.database.v1.IListDatabasesRequest, - protos.google.spanner.admin.database.v1.IListDatabasesResponse|null|undefined, - protos.google.spanner.admin.database.v1.IDatabase>): void; - listDatabases( - request: protos.google.spanner.admin.database.v1.IListDatabasesRequest, - callback: PaginationCallback< - protos.google.spanner.admin.database.v1.IListDatabasesRequest, - protos.google.spanner.admin.database.v1.IListDatabasesResponse|null|undefined, - protos.google.spanner.admin.database.v1.IDatabase>): void; - listDatabases( - request?: protos.google.spanner.admin.database.v1.IListDatabasesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.spanner.admin.database.v1.IListDatabasesRequest, - protos.google.spanner.admin.database.v1.IListDatabasesResponse|null|undefined, - protos.google.spanner.admin.database.v1.IDatabase>, - callback?: PaginationCallback< - protos.google.spanner.admin.database.v1.IListDatabasesRequest, - protos.google.spanner.admin.database.v1.IListDatabasesResponse|null|undefined, - protos.google.spanner.admin.database.v1.IDatabase>): - Promise<[ - protos.google.spanner.admin.database.v1.IDatabase[], - protos.google.spanner.admin.database.v1.IListDatabasesRequest|null, - protos.google.spanner.admin.database.v1.IListDatabasesResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.spanner.admin.database.v1.IListDatabasesRequest, - protos.google.spanner.admin.database.v1.IListDatabasesResponse|null|undefined, - protos.google.spanner.admin.database.v1.IDatabase>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listDatabases values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listDatabases request %j', request); - return this.innerApiCalls - .listDatabases(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.spanner.admin.database.v1.IDatabase[], - protos.google.spanner.admin.database.v1.IListDatabasesRequest|null, - protos.google.spanner.admin.database.v1.IListDatabasesResponse - ]) => { - this._log.info('listDatabases values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listDatabases`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The instance whose databases should be listed. - * Values are of the form `projects//instances/`. - * @param {number} request.pageSize - * Number of databases to be returned in the response. If 0 or less, - * defaults to the server's maximum allowed page size. - * @param {string} request.pageToken - * If non-empty, `page_token` should contain a - * {@link protos.google.spanner.admin.database.v1.ListDatabasesResponse.next_page_token|next_page_token} - * from a previous - * {@link protos.google.spanner.admin.database.v1.ListDatabasesResponse|ListDatabasesResponse}. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.spanner.admin.database.v1.Database|Database} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listDatabasesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listDatabasesStream( - request?: protos.google.spanner.admin.database.v1.IListDatabasesRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listDatabases']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listDatabases stream %j', request); - return this.descriptors.page.listDatabases.createStream( - this.innerApiCalls.listDatabases as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listDatabases`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The instance whose databases should be listed. - * Values are of the form `projects//instances/`. - * @param {number} request.pageSize - * Number of databases to be returned in the response. If 0 or less, - * defaults to the server's maximum allowed page size. - * @param {string} request.pageToken - * If non-empty, `page_token` should contain a - * {@link protos.google.spanner.admin.database.v1.ListDatabasesResponse.next_page_token|next_page_token} - * from a previous - * {@link protos.google.spanner.admin.database.v1.ListDatabasesResponse|ListDatabasesResponse}. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.spanner.admin.database.v1.Database|Database}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listDatabasesAsync( - request?: protos.google.spanner.admin.database.v1.IListDatabasesRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listDatabases']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listDatabases iterate %j', request); - return this.descriptors.page.listDatabases.asyncIterate( - this.innerApiCalls['listDatabases'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Lists completed and pending backups. - * Backups returned are ordered by `create_time` in descending order, - * starting from the most recent `create_time`. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The instance to list backups from. Values are of the - * form `projects//instances/`. - * @param {string} request.filter - * An expression that filters the list of returned backups. - * - * A filter expression consists of a field name, a comparison operator, and a - * value for filtering. - * The value must be a string, a number, or a boolean. The comparison operator - * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. - * Colon `:` is the contains operator. Filter rules are not case sensitive. - * - * The following fields in the - * {@link protos.google.spanner.admin.database.v1.Backup|Backup} are eligible for - * filtering: - * - * * `name` - * * `database` - * * `state` - * * `create_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) - * * `expire_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) - * * `version_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) - * * `size_bytes` - * * `backup_schedules` - * - * You can combine multiple expressions by enclosing each expression in - * parentheses. By default, expressions are combined with AND logic, but - * you can specify AND, OR, and NOT logic explicitly. - * - * Here are a few examples: - * - * * `name:Howl` - The backup's name contains the string "howl". - * * `database:prod` - * - The database's name contains the string "prod". - * * `state:CREATING` - The backup is pending creation. - * * `state:READY` - The backup is fully created and ready for use. - * * `(name:howl) AND (create_time < \"2018-03-28T14:50:00Z\")` - * - The backup name contains the string "howl" and `create_time` - * of the backup is before 2018-03-28T14:50:00Z. - * * `expire_time < \"2018-03-28T14:50:00Z\"` - * - The backup `expire_time` is before 2018-03-28T14:50:00Z. - * * `size_bytes > 10000000000` - The backup's size is greater than 10GB - * * `backup_schedules:daily` - * - The backup is created from a schedule with "daily" in its name. - * @param {number} request.pageSize - * Number of backups to be returned in the response. If 0 or - * less, defaults to the server's maximum allowed page size. - * @param {string} request.pageToken - * If non-empty, `page_token` should contain a - * {@link protos.google.spanner.admin.database.v1.ListBackupsResponse.next_page_token|next_page_token} - * from a previous - * {@link protos.google.spanner.admin.database.v1.ListBackupsResponse|ListBackupsResponse} - * to the same `parent` and with the same `filter`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.spanner.admin.database.v1.Backup|Backup}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listBackupsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listBackups( - request?: protos.google.spanner.admin.database.v1.IListBackupsRequest, - options?: CallOptions): - Promise<[ - protos.google.spanner.admin.database.v1.IBackup[], - protos.google.spanner.admin.database.v1.IListBackupsRequest|null, - protos.google.spanner.admin.database.v1.IListBackupsResponse - ]>; - listBackups( - request: protos.google.spanner.admin.database.v1.IListBackupsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.spanner.admin.database.v1.IListBackupsRequest, - protos.google.spanner.admin.database.v1.IListBackupsResponse|null|undefined, - protos.google.spanner.admin.database.v1.IBackup>): void; - listBackups( - request: protos.google.spanner.admin.database.v1.IListBackupsRequest, - callback: PaginationCallback< - protos.google.spanner.admin.database.v1.IListBackupsRequest, - protos.google.spanner.admin.database.v1.IListBackupsResponse|null|undefined, - protos.google.spanner.admin.database.v1.IBackup>): void; - listBackups( - request?: protos.google.spanner.admin.database.v1.IListBackupsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.spanner.admin.database.v1.IListBackupsRequest, - protos.google.spanner.admin.database.v1.IListBackupsResponse|null|undefined, - protos.google.spanner.admin.database.v1.IBackup>, - callback?: PaginationCallback< - protos.google.spanner.admin.database.v1.IListBackupsRequest, - protos.google.spanner.admin.database.v1.IListBackupsResponse|null|undefined, - protos.google.spanner.admin.database.v1.IBackup>): - Promise<[ - protos.google.spanner.admin.database.v1.IBackup[], - protos.google.spanner.admin.database.v1.IListBackupsRequest|null, - protos.google.spanner.admin.database.v1.IListBackupsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.spanner.admin.database.v1.IListBackupsRequest, - protos.google.spanner.admin.database.v1.IListBackupsResponse|null|undefined, - protos.google.spanner.admin.database.v1.IBackup>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listBackups values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listBackups request %j', request); - return this.innerApiCalls - .listBackups(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.spanner.admin.database.v1.IBackup[], - protos.google.spanner.admin.database.v1.IListBackupsRequest|null, - protos.google.spanner.admin.database.v1.IListBackupsResponse - ]) => { - this._log.info('listBackups values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listBackups`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The instance to list backups from. Values are of the - * form `projects//instances/`. - * @param {string} request.filter - * An expression that filters the list of returned backups. - * - * A filter expression consists of a field name, a comparison operator, and a - * value for filtering. - * The value must be a string, a number, or a boolean. The comparison operator - * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. - * Colon `:` is the contains operator. Filter rules are not case sensitive. - * - * The following fields in the - * {@link protos.google.spanner.admin.database.v1.Backup|Backup} are eligible for - * filtering: - * - * * `name` - * * `database` - * * `state` - * * `create_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) - * * `expire_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) - * * `version_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) - * * `size_bytes` - * * `backup_schedules` - * - * You can combine multiple expressions by enclosing each expression in - * parentheses. By default, expressions are combined with AND logic, but - * you can specify AND, OR, and NOT logic explicitly. - * - * Here are a few examples: - * - * * `name:Howl` - The backup's name contains the string "howl". - * * `database:prod` - * - The database's name contains the string "prod". - * * `state:CREATING` - The backup is pending creation. - * * `state:READY` - The backup is fully created and ready for use. - * * `(name:howl) AND (create_time < \"2018-03-28T14:50:00Z\")` - * - The backup name contains the string "howl" and `create_time` - * of the backup is before 2018-03-28T14:50:00Z. - * * `expire_time < \"2018-03-28T14:50:00Z\"` - * - The backup `expire_time` is before 2018-03-28T14:50:00Z. - * * `size_bytes > 10000000000` - The backup's size is greater than 10GB - * * `backup_schedules:daily` - * - The backup is created from a schedule with "daily" in its name. - * @param {number} request.pageSize - * Number of backups to be returned in the response. If 0 or - * less, defaults to the server's maximum allowed page size. - * @param {string} request.pageToken - * If non-empty, `page_token` should contain a - * {@link protos.google.spanner.admin.database.v1.ListBackupsResponse.next_page_token|next_page_token} - * from a previous - * {@link protos.google.spanner.admin.database.v1.ListBackupsResponse|ListBackupsResponse} - * to the same `parent` and with the same `filter`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.spanner.admin.database.v1.Backup|Backup} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listBackupsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listBackupsStream( - request?: protos.google.spanner.admin.database.v1.IListBackupsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listBackups']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listBackups stream %j', request); - return this.descriptors.page.listBackups.createStream( - this.innerApiCalls.listBackups as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listBackups`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The instance to list backups from. Values are of the - * form `projects//instances/`. - * @param {string} request.filter - * An expression that filters the list of returned backups. - * - * A filter expression consists of a field name, a comparison operator, and a - * value for filtering. - * The value must be a string, a number, or a boolean. The comparison operator - * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. - * Colon `:` is the contains operator. Filter rules are not case sensitive. - * - * The following fields in the - * {@link protos.google.spanner.admin.database.v1.Backup|Backup} are eligible for - * filtering: - * - * * `name` - * * `database` - * * `state` - * * `create_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) - * * `expire_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) - * * `version_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) - * * `size_bytes` - * * `backup_schedules` - * - * You can combine multiple expressions by enclosing each expression in - * parentheses. By default, expressions are combined with AND logic, but - * you can specify AND, OR, and NOT logic explicitly. - * - * Here are a few examples: - * - * * `name:Howl` - The backup's name contains the string "howl". - * * `database:prod` - * - The database's name contains the string "prod". - * * `state:CREATING` - The backup is pending creation. - * * `state:READY` - The backup is fully created and ready for use. - * * `(name:howl) AND (create_time < \"2018-03-28T14:50:00Z\")` - * - The backup name contains the string "howl" and `create_time` - * of the backup is before 2018-03-28T14:50:00Z. - * * `expire_time < \"2018-03-28T14:50:00Z\"` - * - The backup `expire_time` is before 2018-03-28T14:50:00Z. - * * `size_bytes > 10000000000` - The backup's size is greater than 10GB - * * `backup_schedules:daily` - * - The backup is created from a schedule with "daily" in its name. - * @param {number} request.pageSize - * Number of backups to be returned in the response. If 0 or - * less, defaults to the server's maximum allowed page size. - * @param {string} request.pageToken - * If non-empty, `page_token` should contain a - * {@link protos.google.spanner.admin.database.v1.ListBackupsResponse.next_page_token|next_page_token} - * from a previous - * {@link protos.google.spanner.admin.database.v1.ListBackupsResponse|ListBackupsResponse} - * to the same `parent` and with the same `filter`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.spanner.admin.database.v1.Backup|Backup}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listBackupsAsync( - request?: protos.google.spanner.admin.database.v1.IListBackupsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listBackups']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listBackups iterate %j', request); - return this.descriptors.page.listBackups.asyncIterate( - this.innerApiCalls['listBackups'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Lists database {@link protos.google.longrunning.Operation|longrunning-operations}. - * A database operation has a name of the form - * `projects//instances//databases//operations/`. - * The long-running operation - * {@link protos.google.longrunning.Operation.metadata|metadata} field type - * `metadata.type_url` describes the type of the metadata. Operations returned - * include those that have completed/failed/canceled within the last 7 days, - * and pending operations. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The instance of the database operations. - * Values are of the form `projects//instances/`. - * @param {string} request.filter - * An expression that filters the list of returned operations. - * - * A filter expression consists of a field name, a - * comparison operator, and a value for filtering. - * The value must be a string, a number, or a boolean. The comparison operator - * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. - * Colon `:` is the contains operator. Filter rules are not case sensitive. - * - * The following fields in the {@link protos.google.longrunning.Operation|Operation} - * are eligible for filtering: - * - * * `name` - The name of the long-running operation - * * `done` - False if the operation is in progress, else true. - * * `metadata.@type` - the type of metadata. For example, the type string - * for - * {@link protos.google.spanner.admin.database.v1.RestoreDatabaseMetadata|RestoreDatabaseMetadata} - * is - * `type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata`. - * * `metadata.` - any field in metadata.value. - * `metadata.@type` must be specified first, if filtering on metadata - * fields. - * * `error` - Error associated with the long-running operation. - * * `response.@type` - the type of response. - * * `response.` - any field in response.value. - * - * You can combine multiple expressions by enclosing each expression in - * parentheses. By default, expressions are combined with AND logic. However, - * you can specify AND, OR, and NOT logic explicitly. - * - * Here are a few examples: - * - * * `done:true` - The operation is complete. - * * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata) AND` \ - * `(metadata.source_type:BACKUP) AND` \ - * `(metadata.backup_info.backup:backup_howl) AND` \ - * `(metadata.name:restored_howl) AND` \ - * `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \ - * `(error:*)` - Return operations where: - * * The operation's metadata type is - * {@link protos.google.spanner.admin.database.v1.RestoreDatabaseMetadata|RestoreDatabaseMetadata}. - * * The database is restored from a backup. - * * The backup name contains "backup_howl". - * * The restored database's name contains "restored_howl". - * * The operation started before 2018-03-28T14:50:00Z. - * * The operation resulted in an error. - * @param {number} request.pageSize - * Number of operations to be returned in the response. If 0 or - * less, defaults to the server's maximum allowed page size. - * @param {string} request.pageToken - * If non-empty, `page_token` should contain a - * {@link protos.google.spanner.admin.database.v1.ListDatabaseOperationsResponse.next_page_token|next_page_token} - * from a previous - * {@link protos.google.spanner.admin.database.v1.ListDatabaseOperationsResponse|ListDatabaseOperationsResponse} - * to the same `parent` and with the same `filter`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.longrunning.Operation|Operation}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listDatabaseOperationsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listDatabaseOperations( - request?: protos.google.spanner.admin.database.v1.IListDatabaseOperationsRequest, - options?: CallOptions): - Promise<[ - protos.google.longrunning.IOperation[], - protos.google.spanner.admin.database.v1.IListDatabaseOperationsRequest|null, - protos.google.spanner.admin.database.v1.IListDatabaseOperationsResponse - ]>; - listDatabaseOperations( - request: protos.google.spanner.admin.database.v1.IListDatabaseOperationsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.spanner.admin.database.v1.IListDatabaseOperationsRequest, - protos.google.spanner.admin.database.v1.IListDatabaseOperationsResponse|null|undefined, - protos.google.longrunning.IOperation>): void; - listDatabaseOperations( - request: protos.google.spanner.admin.database.v1.IListDatabaseOperationsRequest, - callback: PaginationCallback< - protos.google.spanner.admin.database.v1.IListDatabaseOperationsRequest, - protos.google.spanner.admin.database.v1.IListDatabaseOperationsResponse|null|undefined, - protos.google.longrunning.IOperation>): void; - listDatabaseOperations( - request?: protos.google.spanner.admin.database.v1.IListDatabaseOperationsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.spanner.admin.database.v1.IListDatabaseOperationsRequest, - protos.google.spanner.admin.database.v1.IListDatabaseOperationsResponse|null|undefined, - protos.google.longrunning.IOperation>, - callback?: PaginationCallback< - protos.google.spanner.admin.database.v1.IListDatabaseOperationsRequest, - protos.google.spanner.admin.database.v1.IListDatabaseOperationsResponse|null|undefined, - protos.google.longrunning.IOperation>): - Promise<[ - protos.google.longrunning.IOperation[], - protos.google.spanner.admin.database.v1.IListDatabaseOperationsRequest|null, - protos.google.spanner.admin.database.v1.IListDatabaseOperationsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.spanner.admin.database.v1.IListDatabaseOperationsRequest, - protos.google.spanner.admin.database.v1.IListDatabaseOperationsResponse|null|undefined, - protos.google.longrunning.IOperation>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listDatabaseOperations values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listDatabaseOperations request %j', request); - return this.innerApiCalls - .listDatabaseOperations(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.longrunning.IOperation[], - protos.google.spanner.admin.database.v1.IListDatabaseOperationsRequest|null, - protos.google.spanner.admin.database.v1.IListDatabaseOperationsResponse - ]) => { - this._log.info('listDatabaseOperations values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listDatabaseOperations`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The instance of the database operations. - * Values are of the form `projects//instances/`. - * @param {string} request.filter - * An expression that filters the list of returned operations. - * - * A filter expression consists of a field name, a - * comparison operator, and a value for filtering. - * The value must be a string, a number, or a boolean. The comparison operator - * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. - * Colon `:` is the contains operator. Filter rules are not case sensitive. - * - * The following fields in the {@link protos.google.longrunning.Operation|Operation} - * are eligible for filtering: - * - * * `name` - The name of the long-running operation - * * `done` - False if the operation is in progress, else true. - * * `metadata.@type` - the type of metadata. For example, the type string - * for - * {@link protos.google.spanner.admin.database.v1.RestoreDatabaseMetadata|RestoreDatabaseMetadata} - * is - * `type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata`. - * * `metadata.` - any field in metadata.value. - * `metadata.@type` must be specified first, if filtering on metadata - * fields. - * * `error` - Error associated with the long-running operation. - * * `response.@type` - the type of response. - * * `response.` - any field in response.value. - * - * You can combine multiple expressions by enclosing each expression in - * parentheses. By default, expressions are combined with AND logic. However, - * you can specify AND, OR, and NOT logic explicitly. - * - * Here are a few examples: - * - * * `done:true` - The operation is complete. - * * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata) AND` \ - * `(metadata.source_type:BACKUP) AND` \ - * `(metadata.backup_info.backup:backup_howl) AND` \ - * `(metadata.name:restored_howl) AND` \ - * `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \ - * `(error:*)` - Return operations where: - * * The operation's metadata type is - * {@link protos.google.spanner.admin.database.v1.RestoreDatabaseMetadata|RestoreDatabaseMetadata}. - * * The database is restored from a backup. - * * The backup name contains "backup_howl". - * * The restored database's name contains "restored_howl". - * * The operation started before 2018-03-28T14:50:00Z. - * * The operation resulted in an error. - * @param {number} request.pageSize - * Number of operations to be returned in the response. If 0 or - * less, defaults to the server's maximum allowed page size. - * @param {string} request.pageToken - * If non-empty, `page_token` should contain a - * {@link protos.google.spanner.admin.database.v1.ListDatabaseOperationsResponse.next_page_token|next_page_token} - * from a previous - * {@link protos.google.spanner.admin.database.v1.ListDatabaseOperationsResponse|ListDatabaseOperationsResponse} - * to the same `parent` and with the same `filter`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.longrunning.Operation|Operation} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listDatabaseOperationsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listDatabaseOperationsStream( - request?: protos.google.spanner.admin.database.v1.IListDatabaseOperationsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listDatabaseOperations']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listDatabaseOperations stream %j', request); - return this.descriptors.page.listDatabaseOperations.createStream( - this.innerApiCalls.listDatabaseOperations as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listDatabaseOperations`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The instance of the database operations. - * Values are of the form `projects//instances/`. - * @param {string} request.filter - * An expression that filters the list of returned operations. - * - * A filter expression consists of a field name, a - * comparison operator, and a value for filtering. - * The value must be a string, a number, or a boolean. The comparison operator - * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. - * Colon `:` is the contains operator. Filter rules are not case sensitive. - * - * The following fields in the {@link protos.google.longrunning.Operation|Operation} - * are eligible for filtering: - * - * * `name` - The name of the long-running operation - * * `done` - False if the operation is in progress, else true. - * * `metadata.@type` - the type of metadata. For example, the type string - * for - * {@link protos.google.spanner.admin.database.v1.RestoreDatabaseMetadata|RestoreDatabaseMetadata} - * is - * `type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata`. - * * `metadata.` - any field in metadata.value. - * `metadata.@type` must be specified first, if filtering on metadata - * fields. - * * `error` - Error associated with the long-running operation. - * * `response.@type` - the type of response. - * * `response.` - any field in response.value. - * - * You can combine multiple expressions by enclosing each expression in - * parentheses. By default, expressions are combined with AND logic. However, - * you can specify AND, OR, and NOT logic explicitly. - * - * Here are a few examples: - * - * * `done:true` - The operation is complete. - * * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata) AND` \ - * `(metadata.source_type:BACKUP) AND` \ - * `(metadata.backup_info.backup:backup_howl) AND` \ - * `(metadata.name:restored_howl) AND` \ - * `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \ - * `(error:*)` - Return operations where: - * * The operation's metadata type is - * {@link protos.google.spanner.admin.database.v1.RestoreDatabaseMetadata|RestoreDatabaseMetadata}. - * * The database is restored from a backup. - * * The backup name contains "backup_howl". - * * The restored database's name contains "restored_howl". - * * The operation started before 2018-03-28T14:50:00Z. - * * The operation resulted in an error. - * @param {number} request.pageSize - * Number of operations to be returned in the response. If 0 or - * less, defaults to the server's maximum allowed page size. - * @param {string} request.pageToken - * If non-empty, `page_token` should contain a - * {@link protos.google.spanner.admin.database.v1.ListDatabaseOperationsResponse.next_page_token|next_page_token} - * from a previous - * {@link protos.google.spanner.admin.database.v1.ListDatabaseOperationsResponse|ListDatabaseOperationsResponse} - * to the same `parent` and with the same `filter`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.longrunning.Operation|Operation}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listDatabaseOperationsAsync( - request?: protos.google.spanner.admin.database.v1.IListDatabaseOperationsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listDatabaseOperations']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listDatabaseOperations iterate %j', request); - return this.descriptors.page.listDatabaseOperations.asyncIterate( - this.innerApiCalls['listDatabaseOperations'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Lists the backup {@link protos.google.longrunning.Operation|long-running operations} in - * the given instance. A backup operation has a name of the form - * `projects//instances//backups//operations/`. - * The long-running operation - * {@link protos.google.longrunning.Operation.metadata|metadata} field type - * `metadata.type_url` describes the type of the metadata. Operations returned - * include those that have completed/failed/canceled within the last 7 days, - * and pending operations. Operations returned are ordered by - * `operation.metadata.value.progress.start_time` in descending order starting - * from the most recently started operation. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The instance of the backup operations. Values are of - * the form `projects//instances/`. - * @param {string} request.filter - * An expression that filters the list of returned backup operations. - * - * A filter expression consists of a field name, a - * comparison operator, and a value for filtering. - * The value must be a string, a number, or a boolean. The comparison operator - * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. - * Colon `:` is the contains operator. Filter rules are not case sensitive. - * - * The following fields in the {@link protos.google.longrunning.Operation|operation} - * are eligible for filtering: - * - * * `name` - The name of the long-running operation - * * `done` - False if the operation is in progress, else true. - * * `metadata.@type` - the type of metadata. For example, the type string - * for - * {@link protos.google.spanner.admin.database.v1.CreateBackupMetadata|CreateBackupMetadata} - * is - * `type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata`. - * * `metadata.` - any field in metadata.value. - * `metadata.@type` must be specified first if filtering on metadata - * fields. - * * `error` - Error associated with the long-running operation. - * * `response.@type` - the type of response. - * * `response.` - any field in response.value. - * - * You can combine multiple expressions by enclosing each expression in - * parentheses. By default, expressions are combined with AND logic, but - * you can specify AND, OR, and NOT logic explicitly. - * - * Here are a few examples: - * - * * `done:true` - The operation is complete. - * * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \ - * `metadata.database:prod` - Returns operations where: - * * The operation's metadata type is - * {@link protos.google.spanner.admin.database.v1.CreateBackupMetadata|CreateBackupMetadata}. - * * The source database name of backup contains the string "prod". - * * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \ - * `(metadata.name:howl) AND` \ - * `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \ - * `(error:*)` - Returns operations where: - * * The operation's metadata type is - * {@link protos.google.spanner.admin.database.v1.CreateBackupMetadata|CreateBackupMetadata}. - * * The backup name contains the string "howl". - * * The operation started before 2018-03-28T14:50:00Z. - * * The operation resulted in an error. - * * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CopyBackupMetadata) AND` \ - * `(metadata.source_backup:test) AND` \ - * `(metadata.progress.start_time < \"2022-01-18T14:50:00Z\") AND` \ - * `(error:*)` - Returns operations where: - * * The operation's metadata type is - * {@link protos.google.spanner.admin.database.v1.CopyBackupMetadata|CopyBackupMetadata}. - * * The source backup name contains the string "test". - * * The operation started before 2022-01-18T14:50:00Z. - * * The operation resulted in an error. - * * `((metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \ - * `(metadata.database:test_db)) OR` \ - * `((metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CopyBackupMetadata) - * AND` \ - * `(metadata.source_backup:test_bkp)) AND` \ - * `(error:*)` - Returns operations where: - * * The operation's metadata matches either of criteria: - * * The operation's metadata type is - * {@link protos.google.spanner.admin.database.v1.CreateBackupMetadata|CreateBackupMetadata} - * AND the source database name of the backup contains the string - * "test_db" - * * The operation's metadata type is - * {@link protos.google.spanner.admin.database.v1.CopyBackupMetadata|CopyBackupMetadata} - * AND the source backup name contains the string "test_bkp" - * * The operation resulted in an error. - * @param {number} request.pageSize - * Number of operations to be returned in the response. If 0 or - * less, defaults to the server's maximum allowed page size. - * @param {string} request.pageToken - * If non-empty, `page_token` should contain a - * {@link protos.google.spanner.admin.database.v1.ListBackupOperationsResponse.next_page_token|next_page_token} - * from a previous - * {@link protos.google.spanner.admin.database.v1.ListBackupOperationsResponse|ListBackupOperationsResponse} - * to the same `parent` and with the same `filter`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.longrunning.Operation|Operation}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listBackupOperationsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listBackupOperations( - request?: protos.google.spanner.admin.database.v1.IListBackupOperationsRequest, - options?: CallOptions): - Promise<[ - protos.google.longrunning.IOperation[], - protos.google.spanner.admin.database.v1.IListBackupOperationsRequest|null, - protos.google.spanner.admin.database.v1.IListBackupOperationsResponse - ]>; - listBackupOperations( - request: protos.google.spanner.admin.database.v1.IListBackupOperationsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.spanner.admin.database.v1.IListBackupOperationsRequest, - protos.google.spanner.admin.database.v1.IListBackupOperationsResponse|null|undefined, - protos.google.longrunning.IOperation>): void; - listBackupOperations( - request: protos.google.spanner.admin.database.v1.IListBackupOperationsRequest, - callback: PaginationCallback< - protos.google.spanner.admin.database.v1.IListBackupOperationsRequest, - protos.google.spanner.admin.database.v1.IListBackupOperationsResponse|null|undefined, - protos.google.longrunning.IOperation>): void; - listBackupOperations( - request?: protos.google.spanner.admin.database.v1.IListBackupOperationsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.spanner.admin.database.v1.IListBackupOperationsRequest, - protos.google.spanner.admin.database.v1.IListBackupOperationsResponse|null|undefined, - protos.google.longrunning.IOperation>, - callback?: PaginationCallback< - protos.google.spanner.admin.database.v1.IListBackupOperationsRequest, - protos.google.spanner.admin.database.v1.IListBackupOperationsResponse|null|undefined, - protos.google.longrunning.IOperation>): - Promise<[ - protos.google.longrunning.IOperation[], - protos.google.spanner.admin.database.v1.IListBackupOperationsRequest|null, - protos.google.spanner.admin.database.v1.IListBackupOperationsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.spanner.admin.database.v1.IListBackupOperationsRequest, - protos.google.spanner.admin.database.v1.IListBackupOperationsResponse|null|undefined, - protos.google.longrunning.IOperation>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listBackupOperations values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listBackupOperations request %j', request); - return this.innerApiCalls - .listBackupOperations(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.longrunning.IOperation[], - protos.google.spanner.admin.database.v1.IListBackupOperationsRequest|null, - protos.google.spanner.admin.database.v1.IListBackupOperationsResponse - ]) => { - this._log.info('listBackupOperations values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listBackupOperations`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The instance of the backup operations. Values are of - * the form `projects//instances/`. - * @param {string} request.filter - * An expression that filters the list of returned backup operations. - * - * A filter expression consists of a field name, a - * comparison operator, and a value for filtering. - * The value must be a string, a number, or a boolean. The comparison operator - * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. - * Colon `:` is the contains operator. Filter rules are not case sensitive. - * - * The following fields in the {@link protos.google.longrunning.Operation|operation} - * are eligible for filtering: - * - * * `name` - The name of the long-running operation - * * `done` - False if the operation is in progress, else true. - * * `metadata.@type` - the type of metadata. For example, the type string - * for - * {@link protos.google.spanner.admin.database.v1.CreateBackupMetadata|CreateBackupMetadata} - * is - * `type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata`. - * * `metadata.` - any field in metadata.value. - * `metadata.@type` must be specified first if filtering on metadata - * fields. - * * `error` - Error associated with the long-running operation. - * * `response.@type` - the type of response. - * * `response.` - any field in response.value. - * - * You can combine multiple expressions by enclosing each expression in - * parentheses. By default, expressions are combined with AND logic, but - * you can specify AND, OR, and NOT logic explicitly. - * - * Here are a few examples: - * - * * `done:true` - The operation is complete. - * * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \ - * `metadata.database:prod` - Returns operations where: - * * The operation's metadata type is - * {@link protos.google.spanner.admin.database.v1.CreateBackupMetadata|CreateBackupMetadata}. - * * The source database name of backup contains the string "prod". - * * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \ - * `(metadata.name:howl) AND` \ - * `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \ - * `(error:*)` - Returns operations where: - * * The operation's metadata type is - * {@link protos.google.spanner.admin.database.v1.CreateBackupMetadata|CreateBackupMetadata}. - * * The backup name contains the string "howl". - * * The operation started before 2018-03-28T14:50:00Z. - * * The operation resulted in an error. - * * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CopyBackupMetadata) AND` \ - * `(metadata.source_backup:test) AND` \ - * `(metadata.progress.start_time < \"2022-01-18T14:50:00Z\") AND` \ - * `(error:*)` - Returns operations where: - * * The operation's metadata type is - * {@link protos.google.spanner.admin.database.v1.CopyBackupMetadata|CopyBackupMetadata}. - * * The source backup name contains the string "test". - * * The operation started before 2022-01-18T14:50:00Z. - * * The operation resulted in an error. - * * `((metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \ - * `(metadata.database:test_db)) OR` \ - * `((metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CopyBackupMetadata) - * AND` \ - * `(metadata.source_backup:test_bkp)) AND` \ - * `(error:*)` - Returns operations where: - * * The operation's metadata matches either of criteria: - * * The operation's metadata type is - * {@link protos.google.spanner.admin.database.v1.CreateBackupMetadata|CreateBackupMetadata} - * AND the source database name of the backup contains the string - * "test_db" - * * The operation's metadata type is - * {@link protos.google.spanner.admin.database.v1.CopyBackupMetadata|CopyBackupMetadata} - * AND the source backup name contains the string "test_bkp" - * * The operation resulted in an error. - * @param {number} request.pageSize - * Number of operations to be returned in the response. If 0 or - * less, defaults to the server's maximum allowed page size. - * @param {string} request.pageToken - * If non-empty, `page_token` should contain a - * {@link protos.google.spanner.admin.database.v1.ListBackupOperationsResponse.next_page_token|next_page_token} - * from a previous - * {@link protos.google.spanner.admin.database.v1.ListBackupOperationsResponse|ListBackupOperationsResponse} - * to the same `parent` and with the same `filter`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.longrunning.Operation|Operation} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listBackupOperationsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listBackupOperationsStream( - request?: protos.google.spanner.admin.database.v1.IListBackupOperationsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listBackupOperations']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listBackupOperations stream %j', request); - return this.descriptors.page.listBackupOperations.createStream( - this.innerApiCalls.listBackupOperations as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listBackupOperations`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The instance of the backup operations. Values are of - * the form `projects//instances/`. - * @param {string} request.filter - * An expression that filters the list of returned backup operations. - * - * A filter expression consists of a field name, a - * comparison operator, and a value for filtering. - * The value must be a string, a number, or a boolean. The comparison operator - * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. - * Colon `:` is the contains operator. Filter rules are not case sensitive. - * - * The following fields in the {@link protos.google.longrunning.Operation|operation} - * are eligible for filtering: - * - * * `name` - The name of the long-running operation - * * `done` - False if the operation is in progress, else true. - * * `metadata.@type` - the type of metadata. For example, the type string - * for - * {@link protos.google.spanner.admin.database.v1.CreateBackupMetadata|CreateBackupMetadata} - * is - * `type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata`. - * * `metadata.` - any field in metadata.value. - * `metadata.@type` must be specified first if filtering on metadata - * fields. - * * `error` - Error associated with the long-running operation. - * * `response.@type` - the type of response. - * * `response.` - any field in response.value. - * - * You can combine multiple expressions by enclosing each expression in - * parentheses. By default, expressions are combined with AND logic, but - * you can specify AND, OR, and NOT logic explicitly. - * - * Here are a few examples: - * - * * `done:true` - The operation is complete. - * * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \ - * `metadata.database:prod` - Returns operations where: - * * The operation's metadata type is - * {@link protos.google.spanner.admin.database.v1.CreateBackupMetadata|CreateBackupMetadata}. - * * The source database name of backup contains the string "prod". - * * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \ - * `(metadata.name:howl) AND` \ - * `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \ - * `(error:*)` - Returns operations where: - * * The operation's metadata type is - * {@link protos.google.spanner.admin.database.v1.CreateBackupMetadata|CreateBackupMetadata}. - * * The backup name contains the string "howl". - * * The operation started before 2018-03-28T14:50:00Z. - * * The operation resulted in an error. - * * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CopyBackupMetadata) AND` \ - * `(metadata.source_backup:test) AND` \ - * `(metadata.progress.start_time < \"2022-01-18T14:50:00Z\") AND` \ - * `(error:*)` - Returns operations where: - * * The operation's metadata type is - * {@link protos.google.spanner.admin.database.v1.CopyBackupMetadata|CopyBackupMetadata}. - * * The source backup name contains the string "test". - * * The operation started before 2022-01-18T14:50:00Z. - * * The operation resulted in an error. - * * `((metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \ - * `(metadata.database:test_db)) OR` \ - * `((metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CopyBackupMetadata) - * AND` \ - * `(metadata.source_backup:test_bkp)) AND` \ - * `(error:*)` - Returns operations where: - * * The operation's metadata matches either of criteria: - * * The operation's metadata type is - * {@link protos.google.spanner.admin.database.v1.CreateBackupMetadata|CreateBackupMetadata} - * AND the source database name of the backup contains the string - * "test_db" - * * The operation's metadata type is - * {@link protos.google.spanner.admin.database.v1.CopyBackupMetadata|CopyBackupMetadata} - * AND the source backup name contains the string "test_bkp" - * * The operation resulted in an error. - * @param {number} request.pageSize - * Number of operations to be returned in the response. If 0 or - * less, defaults to the server's maximum allowed page size. - * @param {string} request.pageToken - * If non-empty, `page_token` should contain a - * {@link protos.google.spanner.admin.database.v1.ListBackupOperationsResponse.next_page_token|next_page_token} - * from a previous - * {@link protos.google.spanner.admin.database.v1.ListBackupOperationsResponse|ListBackupOperationsResponse} - * to the same `parent` and with the same `filter`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.longrunning.Operation|Operation}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listBackupOperationsAsync( - request?: protos.google.spanner.admin.database.v1.IListBackupOperationsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listBackupOperations']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listBackupOperations iterate %j', request); - return this.descriptors.page.listBackupOperations.asyncIterate( - this.innerApiCalls['listBackupOperations'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Lists Cloud Spanner database roles. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The database whose roles should be listed. - * Values are of the form - * `projects//instances//databases/`. - * @param {number} request.pageSize - * Number of database roles to be returned in the response. If 0 or less, - * defaults to the server's maximum allowed page size. - * @param {string} request.pageToken - * If non-empty, `page_token` should contain a - * {@link protos.google.spanner.admin.database.v1.ListDatabaseRolesResponse.next_page_token|next_page_token} - * from a previous - * {@link protos.google.spanner.admin.database.v1.ListDatabaseRolesResponse|ListDatabaseRolesResponse}. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.spanner.admin.database.v1.DatabaseRole|DatabaseRole}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listDatabaseRolesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listDatabaseRoles( - request?: protos.google.spanner.admin.database.v1.IListDatabaseRolesRequest, - options?: CallOptions): - Promise<[ - protos.google.spanner.admin.database.v1.IDatabaseRole[], - protos.google.spanner.admin.database.v1.IListDatabaseRolesRequest|null, - protos.google.spanner.admin.database.v1.IListDatabaseRolesResponse - ]>; - listDatabaseRoles( - request: protos.google.spanner.admin.database.v1.IListDatabaseRolesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.spanner.admin.database.v1.IListDatabaseRolesRequest, - protos.google.spanner.admin.database.v1.IListDatabaseRolesResponse|null|undefined, - protos.google.spanner.admin.database.v1.IDatabaseRole>): void; - listDatabaseRoles( - request: protos.google.spanner.admin.database.v1.IListDatabaseRolesRequest, - callback: PaginationCallback< - protos.google.spanner.admin.database.v1.IListDatabaseRolesRequest, - protos.google.spanner.admin.database.v1.IListDatabaseRolesResponse|null|undefined, - protos.google.spanner.admin.database.v1.IDatabaseRole>): void; - listDatabaseRoles( - request?: protos.google.spanner.admin.database.v1.IListDatabaseRolesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.spanner.admin.database.v1.IListDatabaseRolesRequest, - protos.google.spanner.admin.database.v1.IListDatabaseRolesResponse|null|undefined, - protos.google.spanner.admin.database.v1.IDatabaseRole>, - callback?: PaginationCallback< - protos.google.spanner.admin.database.v1.IListDatabaseRolesRequest, - protos.google.spanner.admin.database.v1.IListDatabaseRolesResponse|null|undefined, - protos.google.spanner.admin.database.v1.IDatabaseRole>): - Promise<[ - protos.google.spanner.admin.database.v1.IDatabaseRole[], - protos.google.spanner.admin.database.v1.IListDatabaseRolesRequest|null, - protos.google.spanner.admin.database.v1.IListDatabaseRolesResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.spanner.admin.database.v1.IListDatabaseRolesRequest, - protos.google.spanner.admin.database.v1.IListDatabaseRolesResponse|null|undefined, - protos.google.spanner.admin.database.v1.IDatabaseRole>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listDatabaseRoles values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listDatabaseRoles request %j', request); - return this.innerApiCalls - .listDatabaseRoles(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.spanner.admin.database.v1.IDatabaseRole[], - protos.google.spanner.admin.database.v1.IListDatabaseRolesRequest|null, - protos.google.spanner.admin.database.v1.IListDatabaseRolesResponse - ]) => { - this._log.info('listDatabaseRoles values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listDatabaseRoles`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The database whose roles should be listed. - * Values are of the form - * `projects//instances//databases/`. - * @param {number} request.pageSize - * Number of database roles to be returned in the response. If 0 or less, - * defaults to the server's maximum allowed page size. - * @param {string} request.pageToken - * If non-empty, `page_token` should contain a - * {@link protos.google.spanner.admin.database.v1.ListDatabaseRolesResponse.next_page_token|next_page_token} - * from a previous - * {@link protos.google.spanner.admin.database.v1.ListDatabaseRolesResponse|ListDatabaseRolesResponse}. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.spanner.admin.database.v1.DatabaseRole|DatabaseRole} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listDatabaseRolesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listDatabaseRolesStream( - request?: protos.google.spanner.admin.database.v1.IListDatabaseRolesRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listDatabaseRoles']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listDatabaseRoles stream %j', request); - return this.descriptors.page.listDatabaseRoles.createStream( - this.innerApiCalls.listDatabaseRoles as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listDatabaseRoles`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The database whose roles should be listed. - * Values are of the form - * `projects//instances//databases/`. - * @param {number} request.pageSize - * Number of database roles to be returned in the response. If 0 or less, - * defaults to the server's maximum allowed page size. - * @param {string} request.pageToken - * If non-empty, `page_token` should contain a - * {@link protos.google.spanner.admin.database.v1.ListDatabaseRolesResponse.next_page_token|next_page_token} - * from a previous - * {@link protos.google.spanner.admin.database.v1.ListDatabaseRolesResponse|ListDatabaseRolesResponse}. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.spanner.admin.database.v1.DatabaseRole|DatabaseRole}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listDatabaseRolesAsync( - request?: protos.google.spanner.admin.database.v1.IListDatabaseRolesRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listDatabaseRoles']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listDatabaseRoles iterate %j', request); - return this.descriptors.page.listDatabaseRoles.asyncIterate( - this.innerApiCalls['listDatabaseRoles'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Lists all the backup schedules for the database. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Database is the parent resource whose backup schedules should be - * listed. Values are of the form - * projects//instances//databases/ - * @param {number} [request.pageSize] - * Optional. Number of backup schedules to be returned in the response. If 0 - * or less, defaults to the server's maximum allowed page size. - * @param {string} [request.pageToken] - * Optional. If non-empty, `page_token` should contain a - * {@link protos.google.spanner.admin.database.v1.ListBackupSchedulesResponse.next_page_token|next_page_token} - * from a previous - * {@link protos.google.spanner.admin.database.v1.ListBackupSchedulesResponse|ListBackupSchedulesResponse} - * to the same `parent`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.spanner.admin.database.v1.BackupSchedule|BackupSchedule}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listBackupSchedulesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listBackupSchedules( - request?: protos.google.spanner.admin.database.v1.IListBackupSchedulesRequest, - options?: CallOptions): - Promise<[ - protos.google.spanner.admin.database.v1.IBackupSchedule[], - protos.google.spanner.admin.database.v1.IListBackupSchedulesRequest|null, - protos.google.spanner.admin.database.v1.IListBackupSchedulesResponse - ]>; - listBackupSchedules( - request: protos.google.spanner.admin.database.v1.IListBackupSchedulesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.spanner.admin.database.v1.IListBackupSchedulesRequest, - protos.google.spanner.admin.database.v1.IListBackupSchedulesResponse|null|undefined, - protos.google.spanner.admin.database.v1.IBackupSchedule>): void; - listBackupSchedules( - request: protos.google.spanner.admin.database.v1.IListBackupSchedulesRequest, - callback: PaginationCallback< - protos.google.spanner.admin.database.v1.IListBackupSchedulesRequest, - protos.google.spanner.admin.database.v1.IListBackupSchedulesResponse|null|undefined, - protos.google.spanner.admin.database.v1.IBackupSchedule>): void; - listBackupSchedules( - request?: protos.google.spanner.admin.database.v1.IListBackupSchedulesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.spanner.admin.database.v1.IListBackupSchedulesRequest, - protos.google.spanner.admin.database.v1.IListBackupSchedulesResponse|null|undefined, - protos.google.spanner.admin.database.v1.IBackupSchedule>, - callback?: PaginationCallback< - protos.google.spanner.admin.database.v1.IListBackupSchedulesRequest, - protos.google.spanner.admin.database.v1.IListBackupSchedulesResponse|null|undefined, - protos.google.spanner.admin.database.v1.IBackupSchedule>): - Promise<[ - protos.google.spanner.admin.database.v1.IBackupSchedule[], - protos.google.spanner.admin.database.v1.IListBackupSchedulesRequest|null, - protos.google.spanner.admin.database.v1.IListBackupSchedulesResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.spanner.admin.database.v1.IListBackupSchedulesRequest, - protos.google.spanner.admin.database.v1.IListBackupSchedulesResponse|null|undefined, - protos.google.spanner.admin.database.v1.IBackupSchedule>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listBackupSchedules values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listBackupSchedules request %j', request); - return this.innerApiCalls - .listBackupSchedules(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.spanner.admin.database.v1.IBackupSchedule[], - protos.google.spanner.admin.database.v1.IListBackupSchedulesRequest|null, - protos.google.spanner.admin.database.v1.IListBackupSchedulesResponse - ]) => { - this._log.info('listBackupSchedules values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listBackupSchedules`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Database is the parent resource whose backup schedules should be - * listed. Values are of the form - * projects//instances//databases/ - * @param {number} [request.pageSize] - * Optional. Number of backup schedules to be returned in the response. If 0 - * or less, defaults to the server's maximum allowed page size. - * @param {string} [request.pageToken] - * Optional. If non-empty, `page_token` should contain a - * {@link protos.google.spanner.admin.database.v1.ListBackupSchedulesResponse.next_page_token|next_page_token} - * from a previous - * {@link protos.google.spanner.admin.database.v1.ListBackupSchedulesResponse|ListBackupSchedulesResponse} - * to the same `parent`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.spanner.admin.database.v1.BackupSchedule|BackupSchedule} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listBackupSchedulesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listBackupSchedulesStream( - request?: protos.google.spanner.admin.database.v1.IListBackupSchedulesRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listBackupSchedules']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listBackupSchedules stream %j', request); - return this.descriptors.page.listBackupSchedules.createStream( - this.innerApiCalls.listBackupSchedules as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listBackupSchedules`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Database is the parent resource whose backup schedules should be - * listed. Values are of the form - * projects//instances//databases/ - * @param {number} [request.pageSize] - * Optional. Number of backup schedules to be returned in the response. If 0 - * or less, defaults to the server's maximum allowed page size. - * @param {string} [request.pageToken] - * Optional. If non-empty, `page_token` should contain a - * {@link protos.google.spanner.admin.database.v1.ListBackupSchedulesResponse.next_page_token|next_page_token} - * from a previous - * {@link protos.google.spanner.admin.database.v1.ListBackupSchedulesResponse|ListBackupSchedulesResponse} - * to the same `parent`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.spanner.admin.database.v1.BackupSchedule|BackupSchedule}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listBackupSchedulesAsync( - request?: protos.google.spanner.admin.database.v1.IListBackupSchedulesRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listBackupSchedules']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listBackupSchedules iterate %j', request); - return this.descriptors.page.listBackupSchedules.asyncIterate( - this.innerApiCalls['listBackupSchedules'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } -/** - * Gets the latest state of a long-running operation. Clients can use this - * method to poll the operation result at intervals as recommended by the API - * service. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} - * 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 - * {@link google.longrunning.Operation | google.longrunning.Operation}. - * @return {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * {@link google.longrunning.Operation | google.longrunning.Operation}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * const name = ''; - * const [response] = await client.getOperation({name}); - * // doThingsWith(response) - * ``` - */ - getOperation( - request: protos.google.longrunning.GetOperationRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - > - ): Promise<[protos.google.longrunning.Operation]> { - 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'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.getOperation(request, options, callback); - } - /** - * Lists operations that match the specified filter in the request. If the - * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. - * - * For-await-of syntax is used with the iterable to recursively get response element on-demand. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation collection. - * @param {string} request.filter - The standard list filter. - * @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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the - * details. - * @returns {Object} - * An iterable Object that conforms to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | iteration protocols}. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * for await (const response of client.listOperationsAsync(request)); - * // doThingsWith(response) - * ``` - */ - listOperationsAsync( - request: protos.google.longrunning.ListOperationsRequest, - options?: gax.CallOptions - ): AsyncIterable { - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.listOperationsAsync(request, options); - } - /** - * Starts asynchronous cancellation on a long-running operation. The server - * makes a best effort to cancel the operation, but success is not - * guaranteed. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. Clients can use - * {@link Operations.GetOperation} or - * other methods to check whether the cancellation succeeded or whether the - * operation completed despite cancellation. On successful cancellation, - * the operation is not deleted; instead, it becomes an operation with - * an {@link Operation.error} value with a {@link google.rpc.Status.code} of - * 1, corresponding to `Code.CANCELLED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be cancelled. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the - * details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.cancelOperation({name: ''}); - * ``` - */ - cancelOperation( - request: protos.google.longrunning.CancelOperationRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - >, - callback?: Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - > - ): Promise { - 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'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.cancelOperation(request, options, callback); - } - - /** - * Deletes a long-running operation. This method indicates that the client is - * no longer interested in the operation result. It does not cancel the - * operation. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be deleted. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} - * for the details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.deleteOperation({name: ''}); - * ``` - */ - deleteOperation( - request: protos.google.longrunning.DeleteOperationRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - > - ): Promise { - 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'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.deleteOperation(request, options, callback); - } - - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified backup resource name string. - * - * @param {string} project - * @param {string} instance - * @param {string} backup - * @returns {string} Resource name string. - */ - backupPath(project:string,instance:string,backup:string) { - return this.pathTemplates.backupPathTemplate.render({ - project: project, - instance: instance, - backup: backup, - }); - } - - /** - * Parse the project from Backup resource. - * - * @param {string} backupName - * A fully-qualified path representing Backup resource. - * @returns {string} A string representing the project. - */ - matchProjectFromBackupName(backupName: string) { - return this.pathTemplates.backupPathTemplate.match(backupName).project; - } - - /** - * Parse the instance from Backup resource. - * - * @param {string} backupName - * A fully-qualified path representing Backup resource. - * @returns {string} A string representing the instance. - */ - matchInstanceFromBackupName(backupName: string) { - return this.pathTemplates.backupPathTemplate.match(backupName).instance; - } - - /** - * Parse the backup from Backup resource. - * - * @param {string} backupName - * A fully-qualified path representing Backup resource. - * @returns {string} A string representing the backup. - */ - matchBackupFromBackupName(backupName: string) { - return this.pathTemplates.backupPathTemplate.match(backupName).backup; - } - - /** - * Return a fully-qualified backupSchedule resource name string. - * - * @param {string} project - * @param {string} instance - * @param {string} database - * @param {string} schedule - * @returns {string} Resource name string. - */ - backupSchedulePath(project:string,instance:string,database:string,schedule:string) { - return this.pathTemplates.backupSchedulePathTemplate.render({ - project: project, - instance: instance, - database: database, - schedule: schedule, - }); - } - - /** - * Parse the project from BackupSchedule resource. - * - * @param {string} backupScheduleName - * A fully-qualified path representing BackupSchedule resource. - * @returns {string} A string representing the project. - */ - matchProjectFromBackupScheduleName(backupScheduleName: string) { - return this.pathTemplates.backupSchedulePathTemplate.match(backupScheduleName).project; - } - - /** - * Parse the instance from BackupSchedule resource. - * - * @param {string} backupScheduleName - * A fully-qualified path representing BackupSchedule resource. - * @returns {string} A string representing the instance. - */ - matchInstanceFromBackupScheduleName(backupScheduleName: string) { - return this.pathTemplates.backupSchedulePathTemplate.match(backupScheduleName).instance; - } - - /** - * Parse the database from BackupSchedule resource. - * - * @param {string} backupScheduleName - * A fully-qualified path representing BackupSchedule resource. - * @returns {string} A string representing the database. - */ - matchDatabaseFromBackupScheduleName(backupScheduleName: string) { - return this.pathTemplates.backupSchedulePathTemplate.match(backupScheduleName).database; - } - - /** - * Parse the schedule from BackupSchedule resource. - * - * @param {string} backupScheduleName - * A fully-qualified path representing BackupSchedule resource. - * @returns {string} A string representing the schedule. - */ - matchScheduleFromBackupScheduleName(backupScheduleName: string) { - return this.pathTemplates.backupSchedulePathTemplate.match(backupScheduleName).schedule; - } - - /** - * Return a fully-qualified cryptoKey resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} key_ring - * @param {string} crypto_key - * @returns {string} Resource name string. - */ - cryptoKeyPath(project:string,location:string,keyRing:string,cryptoKey:string) { - return this.pathTemplates.cryptoKeyPathTemplate.render({ - project: project, - location: location, - key_ring: keyRing, - crypto_key: cryptoKey, - }); - } - - /** - * Parse the project from CryptoKey resource. - * - * @param {string} cryptoKeyName - * A fully-qualified path representing CryptoKey resource. - * @returns {string} A string representing the project. - */ - matchProjectFromCryptoKeyName(cryptoKeyName: string) { - return this.pathTemplates.cryptoKeyPathTemplate.match(cryptoKeyName).project; - } - - /** - * Parse the location from CryptoKey resource. - * - * @param {string} cryptoKeyName - * A fully-qualified path representing CryptoKey resource. - * @returns {string} A string representing the location. - */ - matchLocationFromCryptoKeyName(cryptoKeyName: string) { - return this.pathTemplates.cryptoKeyPathTemplate.match(cryptoKeyName).location; - } - - /** - * Parse the key_ring from CryptoKey resource. - * - * @param {string} cryptoKeyName - * A fully-qualified path representing CryptoKey resource. - * @returns {string} A string representing the key_ring. - */ - matchKeyRingFromCryptoKeyName(cryptoKeyName: string) { - return this.pathTemplates.cryptoKeyPathTemplate.match(cryptoKeyName).key_ring; - } - - /** - * Parse the crypto_key from CryptoKey resource. - * - * @param {string} cryptoKeyName - * A fully-qualified path representing CryptoKey resource. - * @returns {string} A string representing the crypto_key. - */ - matchCryptoKeyFromCryptoKeyName(cryptoKeyName: string) { - return this.pathTemplates.cryptoKeyPathTemplate.match(cryptoKeyName).crypto_key; - } - - /** - * Return a fully-qualified database resource name string. - * - * @param {string} project - * @param {string} instance - * @param {string} database - * @returns {string} Resource name string. - */ - databasePath(project:string,instance:string,database:string) { - return this.pathTemplates.databasePathTemplate.render({ - project: project, - instance: instance, - database: database, - }); - } - - /** - * Parse the project from Database resource. - * - * @param {string} databaseName - * A fully-qualified path representing Database resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDatabaseName(databaseName: string) { - return this.pathTemplates.databasePathTemplate.match(databaseName).project; - } - - /** - * Parse the instance from Database resource. - * - * @param {string} databaseName - * A fully-qualified path representing Database resource. - * @returns {string} A string representing the instance. - */ - matchInstanceFromDatabaseName(databaseName: string) { - return this.pathTemplates.databasePathTemplate.match(databaseName).instance; - } - - /** - * Parse the database from Database resource. - * - * @param {string} databaseName - * A fully-qualified path representing Database resource. - * @returns {string} A string representing the database. - */ - matchDatabaseFromDatabaseName(databaseName: string) { - return this.pathTemplates.databasePathTemplate.match(databaseName).database; - } - - /** - * Return a fully-qualified databaseRole resource name string. - * - * @param {string} project - * @param {string} instance - * @param {string} database - * @param {string} role - * @returns {string} Resource name string. - */ - databaseRolePath(project:string,instance:string,database:string,role:string) { - return this.pathTemplates.databaseRolePathTemplate.render({ - project: project, - instance: instance, - database: database, - role: role, - }); - } - - /** - * Parse the project from DatabaseRole resource. - * - * @param {string} databaseRoleName - * A fully-qualified path representing DatabaseRole resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDatabaseRoleName(databaseRoleName: string) { - return this.pathTemplates.databaseRolePathTemplate.match(databaseRoleName).project; - } - - /** - * Parse the instance from DatabaseRole resource. - * - * @param {string} databaseRoleName - * A fully-qualified path representing DatabaseRole resource. - * @returns {string} A string representing the instance. - */ - matchInstanceFromDatabaseRoleName(databaseRoleName: string) { - return this.pathTemplates.databaseRolePathTemplate.match(databaseRoleName).instance; - } - - /** - * Parse the database from DatabaseRole resource. - * - * @param {string} databaseRoleName - * A fully-qualified path representing DatabaseRole resource. - * @returns {string} A string representing the database. - */ - matchDatabaseFromDatabaseRoleName(databaseRoleName: string) { - return this.pathTemplates.databaseRolePathTemplate.match(databaseRoleName).database; - } - - /** - * Parse the role from DatabaseRole resource. - * - * @param {string} databaseRoleName - * A fully-qualified path representing DatabaseRole resource. - * @returns {string} A string representing the role. - */ - matchRoleFromDatabaseRoleName(databaseRoleName: string) { - return this.pathTemplates.databaseRolePathTemplate.match(databaseRoleName).role; - } - - /** - * Return a fully-qualified instance resource name string. - * - * @param {string} project - * @param {string} instance - * @returns {string} Resource name string. - */ - instancePath(project:string,instance:string) { - return this.pathTemplates.instancePathTemplate.render({ - project: project, - instance: instance, - }); - } - - /** - * Parse the project from Instance resource. - * - * @param {string} instanceName - * A fully-qualified path representing Instance resource. - * @returns {string} A string representing the project. - */ - matchProjectFromInstanceName(instanceName: string) { - return this.pathTemplates.instancePathTemplate.match(instanceName).project; - } - - /** - * Parse the instance from Instance resource. - * - * @param {string} instanceName - * A fully-qualified path representing Instance resource. - * @returns {string} A string representing the instance. - */ - matchInstanceFromInstanceName(instanceName: string) { - return this.pathTemplates.instancePathTemplate.match(instanceName).instance; - } - - /** - * Terminate the gRPC channel and close the client. - * - * The client will no longer be usable and all future behavior is undefined. - * @returns {Promise} A promise that resolves when the client is closed. - */ - close(): Promise { - if (this.databaseAdminStub && !this._terminated) { - return this.databaseAdminStub.then(stub => { - this._log.info('ending gRPC channel'); - this._terminated = true; - stub.close(); - void this.operationsClient.close(); - }); - } - return Promise.resolve(); - } -} \ No newline at end of file diff --git a/owl-bot-staging/admin/database/v1/src/v1/database_admin_client_config.json b/owl-bot-staging/admin/database/v1/src/v1/database_admin_client_config.json deleted file mode 100644 index 5b58878bc..000000000 --- a/owl-bot-staging/admin/database/v1/src/v1/database_admin_client_config.json +++ /dev/null @@ -1,169 +0,0 @@ -{ - "interfaces": { - "google.spanner.admin.database.v1.DatabaseAdmin": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - }, - "e9fafda332ce8a1702dc1575de3ca81c4feb4799": { - "initial_retry_delay_millis": 1000, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 32000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "ListDatabases": { - "timeout_millis": 3600000, - "retry_codes_name": "idempotent", - "retry_params_name": "e9fafda332ce8a1702dc1575de3ca81c4feb4799" - }, - "CreateDatabase": { - "timeout_millis": 3600000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetDatabase": { - "timeout_millis": 3600000, - "retry_codes_name": "idempotent", - "retry_params_name": "e9fafda332ce8a1702dc1575de3ca81c4feb4799" - }, - "UpdateDatabase": { - "timeout_millis": 3600000, - "retry_codes_name": "idempotent", - "retry_params_name": "e9fafda332ce8a1702dc1575de3ca81c4feb4799" - }, - "UpdateDatabaseDdl": { - "timeout_millis": 3600000, - "retry_codes_name": "idempotent", - "retry_params_name": "e9fafda332ce8a1702dc1575de3ca81c4feb4799" - }, - "DropDatabase": { - "timeout_millis": 3600000, - "retry_codes_name": "idempotent", - "retry_params_name": "e9fafda332ce8a1702dc1575de3ca81c4feb4799" - }, - "GetDatabaseDdl": { - "timeout_millis": 3600000, - "retry_codes_name": "idempotent", - "retry_params_name": "e9fafda332ce8a1702dc1575de3ca81c4feb4799" - }, - "SetIamPolicy": { - "timeout_millis": 30000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetIamPolicy": { - "timeout_millis": 30000, - "retry_codes_name": "idempotent", - "retry_params_name": "e9fafda332ce8a1702dc1575de3ca81c4feb4799" - }, - "TestIamPermissions": { - "timeout_millis": 30000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CreateBackup": { - "timeout_millis": 3600000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CopyBackup": { - "timeout_millis": 3600000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetBackup": { - "timeout_millis": 3600000, - "retry_codes_name": "idempotent", - "retry_params_name": "e9fafda332ce8a1702dc1575de3ca81c4feb4799" - }, - "UpdateBackup": { - "timeout_millis": 3600000, - "retry_codes_name": "idempotent", - "retry_params_name": "e9fafda332ce8a1702dc1575de3ca81c4feb4799" - }, - "DeleteBackup": { - "timeout_millis": 3600000, - "retry_codes_name": "idempotent", - "retry_params_name": "e9fafda332ce8a1702dc1575de3ca81c4feb4799" - }, - "ListBackups": { - "timeout_millis": 3600000, - "retry_codes_name": "idempotent", - "retry_params_name": "e9fafda332ce8a1702dc1575de3ca81c4feb4799" - }, - "RestoreDatabase": { - "timeout_millis": 3600000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListDatabaseOperations": { - "timeout_millis": 3600000, - "retry_codes_name": "idempotent", - "retry_params_name": "e9fafda332ce8a1702dc1575de3ca81c4feb4799" - }, - "ListBackupOperations": { - "timeout_millis": 3600000, - "retry_codes_name": "idempotent", - "retry_params_name": "e9fafda332ce8a1702dc1575de3ca81c4feb4799" - }, - "ListDatabaseRoles": { - "timeout_millis": 3600000, - "retry_codes_name": "idempotent", - "retry_params_name": "e9fafda332ce8a1702dc1575de3ca81c4feb4799" - }, - "AddSplitPoints": { - "timeout_millis": 3600000, - "retry_codes_name": "idempotent", - "retry_params_name": "e9fafda332ce8a1702dc1575de3ca81c4feb4799" - }, - "CreateBackupSchedule": { - "timeout_millis": 3600000, - "retry_codes_name": "idempotent", - "retry_params_name": "e9fafda332ce8a1702dc1575de3ca81c4feb4799" - }, - "GetBackupSchedule": { - "timeout_millis": 3600000, - "retry_codes_name": "idempotent", - "retry_params_name": "e9fafda332ce8a1702dc1575de3ca81c4feb4799" - }, - "UpdateBackupSchedule": { - "timeout_millis": 3600000, - "retry_codes_name": "idempotent", - "retry_params_name": "e9fafda332ce8a1702dc1575de3ca81c4feb4799" - }, - "DeleteBackupSchedule": { - "timeout_millis": 3600000, - "retry_codes_name": "idempotent", - "retry_params_name": "e9fafda332ce8a1702dc1575de3ca81c4feb4799" - }, - "ListBackupSchedules": { - "timeout_millis": 3600000, - "retry_codes_name": "idempotent", - "retry_params_name": "e9fafda332ce8a1702dc1575de3ca81c4feb4799" - }, - "InternalUpdateGraphOperation": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/admin/database/v1/src/v1/database_admin_proto_list.json b/owl-bot-staging/admin/database/v1/src/v1/database_admin_proto_list.json deleted file mode 100644 index 8d5db481c..000000000 --- a/owl-bot-staging/admin/database/v1/src/v1/database_admin_proto_list.json +++ /dev/null @@ -1,6 +0,0 @@ -[ - "../../protos/google/spanner/admin/database/v1/backup.proto", - "../../protos/google/spanner/admin/database/v1/backup_schedule.proto", - "../../protos/google/spanner/admin/database/v1/common.proto", - "../../protos/google/spanner/admin/database/v1/spanner_database_admin.proto" -] diff --git a/owl-bot-staging/admin/database/v1/src/v1/gapic_metadata.json b/owl-bot-staging/admin/database/v1/src/v1/gapic_metadata.json deleted file mode 100644 index ee4064fc1..000000000 --- a/owl-bot-staging/admin/database/v1/src/v1/gapic_metadata.json +++ /dev/null @@ -1,317 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "typescript", - "protoPackage": "google.spanner.admin.database.v1", - "libraryPackage": "@google-cloud/spanner", - "services": { - "DatabaseAdmin": { - "clients": { - "grpc": { - "libraryClient": "DatabaseAdminClient", - "rpcs": { - "GetDatabase": { - "methods": [ - "getDatabase" - ] - }, - "DropDatabase": { - "methods": [ - "dropDatabase" - ] - }, - "GetDatabaseDdl": { - "methods": [ - "getDatabaseDdl" - ] - }, - "SetIamPolicy": { - "methods": [ - "setIamPolicy" - ] - }, - "GetIamPolicy": { - "methods": [ - "getIamPolicy" - ] - }, - "TestIamPermissions": { - "methods": [ - "testIamPermissions" - ] - }, - "GetBackup": { - "methods": [ - "getBackup" - ] - }, - "UpdateBackup": { - "methods": [ - "updateBackup" - ] - }, - "DeleteBackup": { - "methods": [ - "deleteBackup" - ] - }, - "AddSplitPoints": { - "methods": [ - "addSplitPoints" - ] - }, - "CreateBackupSchedule": { - "methods": [ - "createBackupSchedule" - ] - }, - "GetBackupSchedule": { - "methods": [ - "getBackupSchedule" - ] - }, - "UpdateBackupSchedule": { - "methods": [ - "updateBackupSchedule" - ] - }, - "DeleteBackupSchedule": { - "methods": [ - "deleteBackupSchedule" - ] - }, - "InternalUpdateGraphOperation": { - "methods": [ - "internalUpdateGraphOperation" - ] - }, - "CreateDatabase": { - "methods": [ - "createDatabase" - ] - }, - "UpdateDatabase": { - "methods": [ - "updateDatabase" - ] - }, - "UpdateDatabaseDdl": { - "methods": [ - "updateDatabaseDdl" - ] - }, - "CreateBackup": { - "methods": [ - "createBackup" - ] - }, - "CopyBackup": { - "methods": [ - "copyBackup" - ] - }, - "RestoreDatabase": { - "methods": [ - "restoreDatabase" - ] - }, - "ListDatabases": { - "methods": [ - "listDatabases", - "listDatabasesStream", - "listDatabasesAsync" - ] - }, - "ListBackups": { - "methods": [ - "listBackups", - "listBackupsStream", - "listBackupsAsync" - ] - }, - "ListDatabaseOperations": { - "methods": [ - "listDatabaseOperations", - "listDatabaseOperationsStream", - "listDatabaseOperationsAsync" - ] - }, - "ListBackupOperations": { - "methods": [ - "listBackupOperations", - "listBackupOperationsStream", - "listBackupOperationsAsync" - ] - }, - "ListDatabaseRoles": { - "methods": [ - "listDatabaseRoles", - "listDatabaseRolesStream", - "listDatabaseRolesAsync" - ] - }, - "ListBackupSchedules": { - "methods": [ - "listBackupSchedules", - "listBackupSchedulesStream", - "listBackupSchedulesAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "DatabaseAdminClient", - "rpcs": { - "GetDatabase": { - "methods": [ - "getDatabase" - ] - }, - "DropDatabase": { - "methods": [ - "dropDatabase" - ] - }, - "GetDatabaseDdl": { - "methods": [ - "getDatabaseDdl" - ] - }, - "SetIamPolicy": { - "methods": [ - "setIamPolicy" - ] - }, - "GetIamPolicy": { - "methods": [ - "getIamPolicy" - ] - }, - "TestIamPermissions": { - "methods": [ - "testIamPermissions" - ] - }, - "GetBackup": { - "methods": [ - "getBackup" - ] - }, - "UpdateBackup": { - "methods": [ - "updateBackup" - ] - }, - "DeleteBackup": { - "methods": [ - "deleteBackup" - ] - }, - "AddSplitPoints": { - "methods": [ - "addSplitPoints" - ] - }, - "CreateBackupSchedule": { - "methods": [ - "createBackupSchedule" - ] - }, - "GetBackupSchedule": { - "methods": [ - "getBackupSchedule" - ] - }, - "UpdateBackupSchedule": { - "methods": [ - "updateBackupSchedule" - ] - }, - "DeleteBackupSchedule": { - "methods": [ - "deleteBackupSchedule" - ] - }, - "InternalUpdateGraphOperation": { - "methods": [ - "internalUpdateGraphOperation" - ] - }, - "CreateDatabase": { - "methods": [ - "createDatabase" - ] - }, - "UpdateDatabase": { - "methods": [ - "updateDatabase" - ] - }, - "UpdateDatabaseDdl": { - "methods": [ - "updateDatabaseDdl" - ] - }, - "CreateBackup": { - "methods": [ - "createBackup" - ] - }, - "CopyBackup": { - "methods": [ - "copyBackup" - ] - }, - "RestoreDatabase": { - "methods": [ - "restoreDatabase" - ] - }, - "ListDatabases": { - "methods": [ - "listDatabases", - "listDatabasesStream", - "listDatabasesAsync" - ] - }, - "ListBackups": { - "methods": [ - "listBackups", - "listBackupsStream", - "listBackupsAsync" - ] - }, - "ListDatabaseOperations": { - "methods": [ - "listDatabaseOperations", - "listDatabaseOperationsStream", - "listDatabaseOperationsAsync" - ] - }, - "ListBackupOperations": { - "methods": [ - "listBackupOperations", - "listBackupOperationsStream", - "listBackupOperationsAsync" - ] - }, - "ListDatabaseRoles": { - "methods": [ - "listDatabaseRoles", - "listDatabaseRolesStream", - "listDatabaseRolesAsync" - ] - }, - "ListBackupSchedules": { - "methods": [ - "listBackupSchedules", - "listBackupSchedulesStream", - "listBackupSchedulesAsync" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/admin/database/v1/src/v1/index.ts b/owl-bot-staging/admin/database/v1/src/v1/index.ts deleted file mode 100644 index 125ff6efe..000000000 --- a/owl-bot-staging/admin/database/v1/src/v1/index.ts +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -export {DatabaseAdminClient} from './database_admin_client'; diff --git a/owl-bot-staging/admin/database/v1/test/gapic_database_admin_v1.ts b/owl-bot-staging/admin/database/v1/test/gapic_database_admin_v1.ts deleted file mode 100644 index b208d07b4..000000000 --- a/owl-bot-staging/admin/database/v1/test/gapic_database_admin_v1.ts +++ /dev/null @@ -1,4820 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as protos from '../protos/protos'; -import * as assert from 'assert'; -import * as sinon from 'sinon'; -import {SinonStub} from 'sinon'; -import {describe, it} from 'mocha'; -import * as databaseadminModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf, LROperation, operationsProtos} from 'google-gax'; - -// Dynamically loaded proto JSON is needed to get the type information -// to fill in default values for request objects -const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); - -// eslint-disable-next-line @typescript-eslint/no-unused-vars -function getTypeDefaultValue(typeName: string, fields: string[]) { - let type = root.lookupType(typeName) as protobuf.Type; - for (const field of fields.slice(0, -1)) { - type = type.fields[field]?.resolvedType as protobuf.Type; - } - return type.fields[fields[fields.length - 1]]?.defaultValue; -} - -function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message) - .toObject(instance as protobuf.Message, {defaults: true}); - return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; -} - -function stubSimpleCall(response?: ResponseType, error?: Error) { - return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); -} - -function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { - return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); -} - -function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); -} - -function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); -} - -function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { - const pagingStub = sinon.stub(); - if (responses) { - for (let i = 0; i < responses.length; ++i) { - pagingStub.onCall(i).callsArgWith(2, null, responses[i]); - } - } - const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; - const mockStream = new PassThrough({ - objectMode: true, - transform: transformStub, - }); - // trigger as many responses as needed - if (responses) { - for (let i = 0; i < responses.length; ++i) { - setImmediate(() => { mockStream.write({}); }); - } - setImmediate(() => { mockStream.end(); }); - } else { - setImmediate(() => { mockStream.write({}); }); - setImmediate(() => { mockStream.end(); }); - } - return sinon.stub().returns(mockStream); -} - -function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { - let counter = 0; - const asyncIterable = { - [Symbol.asyncIterator]() { - return { - async next() { - if (error) { - return Promise.reject(error); - } - if (counter >= responses!.length) { - return Promise.resolve({done: true, value: undefined}); - } - return Promise.resolve({done: false, value: responses![counter++]}); - } - }; - } - }; - return sinon.stub().returns(asyncIterable); -} - -describe('v1.DatabaseAdminClient', () => { - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new databaseadminModule.v1.DatabaseAdminClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'spanner.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new databaseadminModule.v1.DatabaseAdminClient(); - const universeDomain = client.universeDomain; - assert.strictEqual(universeDomain, "googleapis.com"); - }); - - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - it('throws DeprecationWarning if static servicePath is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const servicePath = databaseadminModule.v1.DatabaseAdminClient.servicePath; - assert.strictEqual(servicePath, 'spanner.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - - it('throws DeprecationWarning if static apiEndpoint is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const apiEndpoint = databaseadminModule.v1.DatabaseAdminClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'spanner.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({universeDomain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'spanner.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({universe_domain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'spanner.example.com'); - }); - - if (typeof process === 'object' && 'env' in process) { - describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { - it('sets apiEndpoint from environment variable', () => { - const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; - const client = new databaseadminModule.v1.DatabaseAdminClient(); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'spanner.example.com'); - if (saved) { - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; - } else { - delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - } - }); - - it('value configured in code has priority over environment variable', () => { - const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; - const client = new databaseadminModule.v1.DatabaseAdminClient({universeDomain: 'configured.example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'spanner.configured.example.com'); - if (saved) { - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; - } else { - delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - } - }); - }); - } - it('does not allow setting both universeDomain and universe_domain', () => { - assert.throws(() => { new databaseadminModule.v1.DatabaseAdminClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); - }); - - it('has port', () => { - const port = databaseadminModule.v1.DatabaseAdminClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new databaseadminModule.v1.DatabaseAdminClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.databaseAdminStub, undefined); - await client.initialize(); - assert(client.databaseAdminStub); - }); - - it('has close method for the initialized client', done => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize().catch(err => {throw err}); - assert(client.databaseAdminStub); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has close method for the non-initialized client', done => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.databaseAdminStub, undefined); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); - const result = await client.getProjectId(); - assert.strictEqual(result, fakeProjectId); - assert((client.auth.getProjectId as SinonStub).calledWithExactly()); - }); - - it('has getProjectId method with callback', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); - const promise = new Promise((resolve, reject) => { - client.getProjectId((err?: Error|null, projectId?: string|null) => { - if (err) { - reject(err); - } else { - resolve(projectId); - } - }); - }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); - }); - }); - - describe('getDatabase', () => { - it('invokes getDatabase without error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.GetDatabaseRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.GetDatabaseRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.spanner.admin.database.v1.Database() - ); - client.innerApiCalls.getDatabase = stubSimpleCall(expectedResponse); - const [response] = await client.getDatabase(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getDatabase as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getDatabase as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getDatabase without error using callback', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.GetDatabaseRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.GetDatabaseRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.spanner.admin.database.v1.Database() - ); - client.innerApiCalls.getDatabase = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getDatabase( - request, - (err?: Error|null, result?: protos.google.spanner.admin.database.v1.IDatabase|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getDatabase as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getDatabase as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getDatabase with error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.GetDatabaseRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.GetDatabaseRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.getDatabase = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getDatabase(request), expectedError); - const actualRequest = (client.innerApiCalls.getDatabase as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getDatabase as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getDatabase with closed client', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.GetDatabaseRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.GetDatabaseRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getDatabase(request), expectedError); - }); - }); - - describe('dropDatabase', () => { - it('invokes dropDatabase without error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.DropDatabaseRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.DropDatabaseRequest', ['database']); - request.database = defaultValue1; - const expectedHeaderRequestParams = `database=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.dropDatabase = stubSimpleCall(expectedResponse); - const [response] = await client.dropDatabase(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.dropDatabase as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.dropDatabase as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes dropDatabase without error using callback', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.DropDatabaseRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.DropDatabaseRequest', ['database']); - request.database = defaultValue1; - const expectedHeaderRequestParams = `database=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.dropDatabase = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.dropDatabase( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.dropDatabase as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.dropDatabase as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes dropDatabase with error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.DropDatabaseRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.DropDatabaseRequest', ['database']); - request.database = defaultValue1; - const expectedHeaderRequestParams = `database=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.dropDatabase = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.dropDatabase(request), expectedError); - const actualRequest = (client.innerApiCalls.dropDatabase as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.dropDatabase as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes dropDatabase with closed client', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.DropDatabaseRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.DropDatabaseRequest', ['database']); - request.database = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.dropDatabase(request), expectedError); - }); - }); - - describe('getDatabaseDdl', () => { - it('invokes getDatabaseDdl without error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.GetDatabaseDdlRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.GetDatabaseDdlRequest', ['database']); - request.database = defaultValue1; - const expectedHeaderRequestParams = `database=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.spanner.admin.database.v1.GetDatabaseDdlResponse() - ); - client.innerApiCalls.getDatabaseDdl = stubSimpleCall(expectedResponse); - const [response] = await client.getDatabaseDdl(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getDatabaseDdl as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getDatabaseDdl as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getDatabaseDdl without error using callback', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.GetDatabaseDdlRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.GetDatabaseDdlRequest', ['database']); - request.database = defaultValue1; - const expectedHeaderRequestParams = `database=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.spanner.admin.database.v1.GetDatabaseDdlResponse() - ); - client.innerApiCalls.getDatabaseDdl = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getDatabaseDdl( - request, - (err?: Error|null, result?: protos.google.spanner.admin.database.v1.IGetDatabaseDdlResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getDatabaseDdl as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getDatabaseDdl as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getDatabaseDdl with error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.GetDatabaseDdlRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.GetDatabaseDdlRequest', ['database']); - request.database = defaultValue1; - const expectedHeaderRequestParams = `database=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.getDatabaseDdl = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getDatabaseDdl(request), expectedError); - const actualRequest = (client.innerApiCalls.getDatabaseDdl as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getDatabaseDdl as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getDatabaseDdl with closed client', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.GetDatabaseDdlRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.GetDatabaseDdlRequest', ['database']); - request.database = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getDatabaseDdl(request), expectedError); - }); - }); - - describe('setIamPolicy', () => { - it('invokes setIamPolicy without error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.SetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.SetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.iam.v1.Policy() - ); - client.innerApiCalls.setIamPolicy = stubSimpleCall(expectedResponse); - const [response] = await client.setIamPolicy(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setIamPolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setIamPolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setIamPolicy without error using callback', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.SetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.SetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.iam.v1.Policy() - ); - client.innerApiCalls.setIamPolicy = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setIamPolicy( - request, - (err?: Error|null, result?: protos.google.iam.v1.IPolicy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setIamPolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setIamPolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setIamPolicy with error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.SetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.SetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.setIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setIamPolicy(request), expectedError); - const actualRequest = (client.innerApiCalls.setIamPolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setIamPolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setIamPolicy with closed client', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.SetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.SetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.setIamPolicy(request), expectedError); - }); - }); - - describe('getIamPolicy', () => { - it('invokes getIamPolicy without error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.GetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.GetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.iam.v1.Policy() - ); - client.innerApiCalls.getIamPolicy = stubSimpleCall(expectedResponse); - const [response] = await client.getIamPolicy(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getIamPolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getIamPolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getIamPolicy without error using callback', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.GetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.GetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.iam.v1.Policy() - ); - client.innerApiCalls.getIamPolicy = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getIamPolicy( - request, - (err?: Error|null, result?: protos.google.iam.v1.IPolicy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getIamPolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getIamPolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getIamPolicy with error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.GetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.GetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.getIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getIamPolicy(request), expectedError); - const actualRequest = (client.innerApiCalls.getIamPolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getIamPolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getIamPolicy with closed client', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.GetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.GetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getIamPolicy(request), expectedError); - }); - }); - - describe('testIamPermissions', () => { - it('invokes testIamPermissions without error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.TestIamPermissionsRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsResponse() - ); - client.innerApiCalls.testIamPermissions = stubSimpleCall(expectedResponse); - const [response] = await client.testIamPermissions(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.testIamPermissions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.testIamPermissions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes testIamPermissions without error using callback', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.TestIamPermissionsRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsResponse() - ); - client.innerApiCalls.testIamPermissions = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.testIamPermissions( - request, - (err?: Error|null, result?: protos.google.iam.v1.ITestIamPermissionsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.testIamPermissions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.testIamPermissions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes testIamPermissions with error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.TestIamPermissionsRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.testIamPermissions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.testIamPermissions(request), expectedError); - const actualRequest = (client.innerApiCalls.testIamPermissions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.testIamPermissions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes testIamPermissions with closed client', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.TestIamPermissionsRequest', ['resource']); - request.resource = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.testIamPermissions(request), expectedError); - }); - }); - - describe('getBackup', () => { - it('invokes getBackup without error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.GetBackupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.GetBackupRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.spanner.admin.database.v1.Backup() - ); - client.innerApiCalls.getBackup = stubSimpleCall(expectedResponse); - const [response] = await client.getBackup(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getBackup without error using callback', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.GetBackupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.GetBackupRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.spanner.admin.database.v1.Backup() - ); - client.innerApiCalls.getBackup = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getBackup( - request, - (err?: Error|null, result?: protos.google.spanner.admin.database.v1.IBackup|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getBackup with error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.GetBackupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.GetBackupRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.getBackup = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getBackup(request), expectedError); - const actualRequest = (client.innerApiCalls.getBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getBackup with closed client', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.GetBackupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.GetBackupRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getBackup(request), expectedError); - }); - }); - - describe('updateBackup', () => { - it('invokes updateBackup without error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.UpdateBackupRequest() - ); - request.backup ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.UpdateBackupRequest', ['backup', 'name']); - request.backup.name = defaultValue1; - const expectedHeaderRequestParams = `backup.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.spanner.admin.database.v1.Backup() - ); - client.innerApiCalls.updateBackup = stubSimpleCall(expectedResponse); - const [response] = await client.updateBackup(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateBackup without error using callback', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.UpdateBackupRequest() - ); - request.backup ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.UpdateBackupRequest', ['backup', 'name']); - request.backup.name = defaultValue1; - const expectedHeaderRequestParams = `backup.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.spanner.admin.database.v1.Backup() - ); - client.innerApiCalls.updateBackup = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateBackup( - request, - (err?: Error|null, result?: protos.google.spanner.admin.database.v1.IBackup|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateBackup with error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.UpdateBackupRequest() - ); - request.backup ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.UpdateBackupRequest', ['backup', 'name']); - request.backup.name = defaultValue1; - const expectedHeaderRequestParams = `backup.name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateBackup = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateBackup(request), expectedError); - const actualRequest = (client.innerApiCalls.updateBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateBackup with closed client', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.UpdateBackupRequest() - ); - request.backup ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.UpdateBackupRequest', ['backup', 'name']); - request.backup.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.updateBackup(request), expectedError); - }); - }); - - describe('deleteBackup', () => { - it('invokes deleteBackup without error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.DeleteBackupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.DeleteBackupRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteBackup = stubSimpleCall(expectedResponse); - const [response] = await client.deleteBackup(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteBackup without error using callback', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.DeleteBackupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.DeleteBackupRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteBackup = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteBackup( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteBackup with error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.DeleteBackupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.DeleteBackupRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteBackup = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteBackup(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteBackup with closed client', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.DeleteBackupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.DeleteBackupRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.deleteBackup(request), expectedError); - }); - }); - - describe('addSplitPoints', () => { - it('invokes addSplitPoints without error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.AddSplitPointsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.AddSplitPointsRequest', ['database']); - request.database = defaultValue1; - const expectedHeaderRequestParams = `database=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.spanner.admin.database.v1.AddSplitPointsResponse() - ); - client.innerApiCalls.addSplitPoints = stubSimpleCall(expectedResponse); - const [response] = await client.addSplitPoints(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.addSplitPoints as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.addSplitPoints as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes addSplitPoints without error using callback', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.AddSplitPointsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.AddSplitPointsRequest', ['database']); - request.database = defaultValue1; - const expectedHeaderRequestParams = `database=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.spanner.admin.database.v1.AddSplitPointsResponse() - ); - client.innerApiCalls.addSplitPoints = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.addSplitPoints( - request, - (err?: Error|null, result?: protos.google.spanner.admin.database.v1.IAddSplitPointsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.addSplitPoints as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.addSplitPoints as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes addSplitPoints with error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.AddSplitPointsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.AddSplitPointsRequest', ['database']); - request.database = defaultValue1; - const expectedHeaderRequestParams = `database=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.addSplitPoints = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.addSplitPoints(request), expectedError); - const actualRequest = (client.innerApiCalls.addSplitPoints as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.addSplitPoints as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes addSplitPoints with closed client', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.AddSplitPointsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.AddSplitPointsRequest', ['database']); - request.database = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.addSplitPoints(request), expectedError); - }); - }); - - describe('createBackupSchedule', () => { - it('invokes createBackupSchedule without error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.CreateBackupScheduleRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.CreateBackupScheduleRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.spanner.admin.database.v1.BackupSchedule() - ); - client.innerApiCalls.createBackupSchedule = stubSimpleCall(expectedResponse); - const [response] = await client.createBackupSchedule(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createBackupSchedule as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createBackupSchedule as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createBackupSchedule without error using callback', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.CreateBackupScheduleRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.CreateBackupScheduleRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.spanner.admin.database.v1.BackupSchedule() - ); - client.innerApiCalls.createBackupSchedule = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createBackupSchedule( - request, - (err?: Error|null, result?: protos.google.spanner.admin.database.v1.IBackupSchedule|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createBackupSchedule as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createBackupSchedule as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createBackupSchedule with error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.CreateBackupScheduleRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.CreateBackupScheduleRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.createBackupSchedule = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createBackupSchedule(request), expectedError); - const actualRequest = (client.innerApiCalls.createBackupSchedule as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createBackupSchedule as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createBackupSchedule with closed client', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.CreateBackupScheduleRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.CreateBackupScheduleRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.createBackupSchedule(request), expectedError); - }); - }); - - describe('getBackupSchedule', () => { - it('invokes getBackupSchedule without error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.GetBackupScheduleRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.GetBackupScheduleRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.spanner.admin.database.v1.BackupSchedule() - ); - client.innerApiCalls.getBackupSchedule = stubSimpleCall(expectedResponse); - const [response] = await client.getBackupSchedule(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getBackupSchedule as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getBackupSchedule as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getBackupSchedule without error using callback', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.GetBackupScheduleRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.GetBackupScheduleRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.spanner.admin.database.v1.BackupSchedule() - ); - client.innerApiCalls.getBackupSchedule = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getBackupSchedule( - request, - (err?: Error|null, result?: protos.google.spanner.admin.database.v1.IBackupSchedule|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getBackupSchedule as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getBackupSchedule as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getBackupSchedule with error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.GetBackupScheduleRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.GetBackupScheduleRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.getBackupSchedule = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getBackupSchedule(request), expectedError); - const actualRequest = (client.innerApiCalls.getBackupSchedule as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getBackupSchedule as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getBackupSchedule with closed client', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.GetBackupScheduleRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.GetBackupScheduleRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getBackupSchedule(request), expectedError); - }); - }); - - describe('updateBackupSchedule', () => { - it('invokes updateBackupSchedule without error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.UpdateBackupScheduleRequest() - ); - request.backupSchedule ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.UpdateBackupScheduleRequest', ['backupSchedule', 'name']); - request.backupSchedule.name = defaultValue1; - const expectedHeaderRequestParams = `backup_schedule.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.spanner.admin.database.v1.BackupSchedule() - ); - client.innerApiCalls.updateBackupSchedule = stubSimpleCall(expectedResponse); - const [response] = await client.updateBackupSchedule(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateBackupSchedule as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateBackupSchedule as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateBackupSchedule without error using callback', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.UpdateBackupScheduleRequest() - ); - request.backupSchedule ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.UpdateBackupScheduleRequest', ['backupSchedule', 'name']); - request.backupSchedule.name = defaultValue1; - const expectedHeaderRequestParams = `backup_schedule.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.spanner.admin.database.v1.BackupSchedule() - ); - client.innerApiCalls.updateBackupSchedule = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateBackupSchedule( - request, - (err?: Error|null, result?: protos.google.spanner.admin.database.v1.IBackupSchedule|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateBackupSchedule as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateBackupSchedule as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateBackupSchedule with error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.UpdateBackupScheduleRequest() - ); - request.backupSchedule ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.UpdateBackupScheduleRequest', ['backupSchedule', 'name']); - request.backupSchedule.name = defaultValue1; - const expectedHeaderRequestParams = `backup_schedule.name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateBackupSchedule = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateBackupSchedule(request), expectedError); - const actualRequest = (client.innerApiCalls.updateBackupSchedule as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateBackupSchedule as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateBackupSchedule with closed client', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.UpdateBackupScheduleRequest() - ); - request.backupSchedule ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.UpdateBackupScheduleRequest', ['backupSchedule', 'name']); - request.backupSchedule.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.updateBackupSchedule(request), expectedError); - }); - }); - - describe('deleteBackupSchedule', () => { - it('invokes deleteBackupSchedule without error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.DeleteBackupScheduleRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.DeleteBackupScheduleRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteBackupSchedule = stubSimpleCall(expectedResponse); - const [response] = await client.deleteBackupSchedule(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteBackupSchedule as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteBackupSchedule as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteBackupSchedule without error using callback', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.DeleteBackupScheduleRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.DeleteBackupScheduleRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteBackupSchedule = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteBackupSchedule( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteBackupSchedule as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteBackupSchedule as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteBackupSchedule with error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.DeleteBackupScheduleRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.DeleteBackupScheduleRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteBackupSchedule = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteBackupSchedule(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteBackupSchedule as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteBackupSchedule as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteBackupSchedule with closed client', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.DeleteBackupScheduleRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.DeleteBackupScheduleRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.deleteBackupSchedule(request), expectedError); - }); - }); - - describe('internalUpdateGraphOperation', () => { - it('invokes internalUpdateGraphOperation without error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse() - ); - client.innerApiCalls.internalUpdateGraphOperation = stubSimpleCall(expectedResponse); - const [response] = await client.internalUpdateGraphOperation(request); - assert.deepStrictEqual(response, expectedResponse); - }); - - it('invokes internalUpdateGraphOperation without error using callback', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse() - ); - client.innerApiCalls.internalUpdateGraphOperation = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.internalUpdateGraphOperation( - request, - (err?: Error|null, result?: protos.google.spanner.admin.database.v1.IInternalUpdateGraphOperationResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - }); - - it('invokes internalUpdateGraphOperation with error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest() - ); - const expectedError = new Error('expected'); - client.innerApiCalls.internalUpdateGraphOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.internalUpdateGraphOperation(request), expectedError); - }); - - it('invokes internalUpdateGraphOperation with closed client', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest() - ); - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.internalUpdateGraphOperation(request), expectedError); - }); - }); - - describe('createDatabase', () => { - it('invokes createDatabase without error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.CreateDatabaseRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.CreateDatabaseRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createDatabase = stubLongRunningCall(expectedResponse); - const [operation] = await client.createDatabase(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createDatabase as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createDatabase as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createDatabase without error using callback', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.CreateDatabaseRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.CreateDatabaseRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createDatabase = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createDatabase( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createDatabase as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createDatabase as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createDatabase with call error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.CreateDatabaseRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.CreateDatabaseRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.createDatabase = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createDatabase(request), expectedError); - const actualRequest = (client.innerApiCalls.createDatabase as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createDatabase as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createDatabase with LRO error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.CreateDatabaseRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.CreateDatabaseRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.createDatabase = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createDatabase(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.createDatabase as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createDatabase as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkCreateDatabaseProgress without error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkCreateDatabaseProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkCreateDatabaseProgress with error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkCreateDatabaseProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('updateDatabase', () => { - it('invokes updateDatabase without error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.UpdateDatabaseRequest() - ); - request.database ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.UpdateDatabaseRequest', ['database', 'name']); - request.database.name = defaultValue1; - const expectedHeaderRequestParams = `database.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.updateDatabase = stubLongRunningCall(expectedResponse); - const [operation] = await client.updateDatabase(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateDatabase as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateDatabase as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateDatabase without error using callback', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.UpdateDatabaseRequest() - ); - request.database ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.UpdateDatabaseRequest', ['database', 'name']); - request.database.name = defaultValue1; - const expectedHeaderRequestParams = `database.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.updateDatabase = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateDatabase( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateDatabase as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateDatabase as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateDatabase with call error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.UpdateDatabaseRequest() - ); - request.database ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.UpdateDatabaseRequest', ['database', 'name']); - request.database.name = defaultValue1; - const expectedHeaderRequestParams = `database.name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateDatabase = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.updateDatabase(request), expectedError); - const actualRequest = (client.innerApiCalls.updateDatabase as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateDatabase as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateDatabase with LRO error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.UpdateDatabaseRequest() - ); - request.database ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.UpdateDatabaseRequest', ['database', 'name']); - request.database.name = defaultValue1; - const expectedHeaderRequestParams = `database.name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateDatabase = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.updateDatabase(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.updateDatabase as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateDatabase as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkUpdateDatabaseProgress without error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkUpdateDatabaseProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkUpdateDatabaseProgress with error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkUpdateDatabaseProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('updateDatabaseDdl', () => { - it('invokes updateDatabaseDdl without error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.UpdateDatabaseDdlRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.UpdateDatabaseDdlRequest', ['database']); - request.database = defaultValue1; - const expectedHeaderRequestParams = `database=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.updateDatabaseDdl = stubLongRunningCall(expectedResponse); - const [operation] = await client.updateDatabaseDdl(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateDatabaseDdl as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateDatabaseDdl as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateDatabaseDdl without error using callback', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.UpdateDatabaseDdlRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.UpdateDatabaseDdlRequest', ['database']); - request.database = defaultValue1; - const expectedHeaderRequestParams = `database=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.updateDatabaseDdl = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateDatabaseDdl( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateDatabaseDdl as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateDatabaseDdl as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateDatabaseDdl with call error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.UpdateDatabaseDdlRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.UpdateDatabaseDdlRequest', ['database']); - request.database = defaultValue1; - const expectedHeaderRequestParams = `database=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateDatabaseDdl = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.updateDatabaseDdl(request), expectedError); - const actualRequest = (client.innerApiCalls.updateDatabaseDdl as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateDatabaseDdl as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateDatabaseDdl with LRO error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.UpdateDatabaseDdlRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.UpdateDatabaseDdlRequest', ['database']); - request.database = defaultValue1; - const expectedHeaderRequestParams = `database=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateDatabaseDdl = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.updateDatabaseDdl(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.updateDatabaseDdl as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateDatabaseDdl as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkUpdateDatabaseDdlProgress without error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkUpdateDatabaseDdlProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkUpdateDatabaseDdlProgress with error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkUpdateDatabaseDdlProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('createBackup', () => { - it('invokes createBackup without error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.CreateBackupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.CreateBackupRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createBackup = stubLongRunningCall(expectedResponse); - const [operation] = await client.createBackup(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createBackup without error using callback', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.CreateBackupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.CreateBackupRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createBackup = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createBackup( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createBackup with call error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.CreateBackupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.CreateBackupRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.createBackup = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createBackup(request), expectedError); - const actualRequest = (client.innerApiCalls.createBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createBackup with LRO error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.CreateBackupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.CreateBackupRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.createBackup = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createBackup(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.createBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkCreateBackupProgress without error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkCreateBackupProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkCreateBackupProgress with error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkCreateBackupProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('copyBackup', () => { - it('invokes copyBackup without error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.CopyBackupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.CopyBackupRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.copyBackup = stubLongRunningCall(expectedResponse); - const [operation] = await client.copyBackup(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.copyBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.copyBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes copyBackup without error using callback', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.CopyBackupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.CopyBackupRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.copyBackup = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.copyBackup( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.copyBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.copyBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes copyBackup with call error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.CopyBackupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.CopyBackupRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.copyBackup = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.copyBackup(request), expectedError); - const actualRequest = (client.innerApiCalls.copyBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.copyBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes copyBackup with LRO error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.CopyBackupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.CopyBackupRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.copyBackup = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.copyBackup(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.copyBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.copyBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkCopyBackupProgress without error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkCopyBackupProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkCopyBackupProgress with error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkCopyBackupProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('restoreDatabase', () => { - it('invokes restoreDatabase without error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.RestoreDatabaseRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.RestoreDatabaseRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.restoreDatabase = stubLongRunningCall(expectedResponse); - const [operation] = await client.restoreDatabase(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.restoreDatabase as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.restoreDatabase as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes restoreDatabase without error using callback', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.RestoreDatabaseRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.RestoreDatabaseRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.restoreDatabase = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.restoreDatabase( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.restoreDatabase as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.restoreDatabase as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes restoreDatabase with call error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.RestoreDatabaseRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.RestoreDatabaseRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.restoreDatabase = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.restoreDatabase(request), expectedError); - const actualRequest = (client.innerApiCalls.restoreDatabase as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.restoreDatabase as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes restoreDatabase with LRO error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.RestoreDatabaseRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.RestoreDatabaseRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.restoreDatabase = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.restoreDatabase(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.restoreDatabase as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.restoreDatabase as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkRestoreDatabaseProgress without error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkRestoreDatabaseProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkRestoreDatabaseProgress with error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkRestoreDatabaseProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('listDatabases', () => { - it('invokes listDatabases without error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.ListDatabasesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.ListDatabasesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.spanner.admin.database.v1.Database()), - generateSampleMessage(new protos.google.spanner.admin.database.v1.Database()), - generateSampleMessage(new protos.google.spanner.admin.database.v1.Database()), - ]; - client.innerApiCalls.listDatabases = stubSimpleCall(expectedResponse); - const [response] = await client.listDatabases(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listDatabases as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listDatabases as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listDatabases without error using callback', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.ListDatabasesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.ListDatabasesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.spanner.admin.database.v1.Database()), - generateSampleMessage(new protos.google.spanner.admin.database.v1.Database()), - generateSampleMessage(new protos.google.spanner.admin.database.v1.Database()), - ]; - client.innerApiCalls.listDatabases = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listDatabases( - request, - (err?: Error|null, result?: protos.google.spanner.admin.database.v1.IDatabase[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listDatabases as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listDatabases as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listDatabases with error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.ListDatabasesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.ListDatabasesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.listDatabases = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listDatabases(request), expectedError); - const actualRequest = (client.innerApiCalls.listDatabases as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listDatabases as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listDatabasesStream without error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.ListDatabasesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.ListDatabasesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.spanner.admin.database.v1.Database()), - generateSampleMessage(new protos.google.spanner.admin.database.v1.Database()), - generateSampleMessage(new protos.google.spanner.admin.database.v1.Database()), - ]; - client.descriptors.page.listDatabases.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listDatabasesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.spanner.admin.database.v1.Database[] = []; - stream.on('data', (response: protos.google.spanner.admin.database.v1.Database) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listDatabases.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listDatabases, request)); - assert( - (client.descriptors.page.listDatabases.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listDatabasesStream with error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.ListDatabasesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.ListDatabasesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listDatabases.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listDatabasesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.spanner.admin.database.v1.Database[] = []; - stream.on('data', (response: protos.google.spanner.admin.database.v1.Database) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listDatabases.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listDatabases, request)); - assert( - (client.descriptors.page.listDatabases.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listDatabases without error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.ListDatabasesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.ListDatabasesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.spanner.admin.database.v1.Database()), - generateSampleMessage(new protos.google.spanner.admin.database.v1.Database()), - generateSampleMessage(new protos.google.spanner.admin.database.v1.Database()), - ]; - client.descriptors.page.listDatabases.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.spanner.admin.database.v1.IDatabase[] = []; - const iterable = client.listDatabasesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listDatabases.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listDatabases.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listDatabases with error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.ListDatabasesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.ListDatabasesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listDatabases.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listDatabasesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.spanner.admin.database.v1.IDatabase[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listDatabases.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listDatabases.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listBackups', () => { - it('invokes listBackups without error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.ListBackupsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.ListBackupsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.spanner.admin.database.v1.Backup()), - generateSampleMessage(new protos.google.spanner.admin.database.v1.Backup()), - generateSampleMessage(new protos.google.spanner.admin.database.v1.Backup()), - ]; - client.innerApiCalls.listBackups = stubSimpleCall(expectedResponse); - const [response] = await client.listBackups(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listBackups as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listBackups as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listBackups without error using callback', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.ListBackupsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.ListBackupsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.spanner.admin.database.v1.Backup()), - generateSampleMessage(new protos.google.spanner.admin.database.v1.Backup()), - generateSampleMessage(new protos.google.spanner.admin.database.v1.Backup()), - ]; - client.innerApiCalls.listBackups = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listBackups( - request, - (err?: Error|null, result?: protos.google.spanner.admin.database.v1.IBackup[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listBackups as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listBackups as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listBackups with error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.ListBackupsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.ListBackupsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.listBackups = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listBackups(request), expectedError); - const actualRequest = (client.innerApiCalls.listBackups as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listBackups as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listBackupsStream without error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.ListBackupsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.ListBackupsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.spanner.admin.database.v1.Backup()), - generateSampleMessage(new protos.google.spanner.admin.database.v1.Backup()), - generateSampleMessage(new protos.google.spanner.admin.database.v1.Backup()), - ]; - client.descriptors.page.listBackups.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listBackupsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.spanner.admin.database.v1.Backup[] = []; - stream.on('data', (response: protos.google.spanner.admin.database.v1.Backup) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listBackups.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listBackups, request)); - assert( - (client.descriptors.page.listBackups.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listBackupsStream with error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.ListBackupsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.ListBackupsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listBackups.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listBackupsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.spanner.admin.database.v1.Backup[] = []; - stream.on('data', (response: protos.google.spanner.admin.database.v1.Backup) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listBackups.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listBackups, request)); - assert( - (client.descriptors.page.listBackups.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listBackups without error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.ListBackupsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.ListBackupsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.spanner.admin.database.v1.Backup()), - generateSampleMessage(new protos.google.spanner.admin.database.v1.Backup()), - generateSampleMessage(new protos.google.spanner.admin.database.v1.Backup()), - ]; - client.descriptors.page.listBackups.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.spanner.admin.database.v1.IBackup[] = []; - const iterable = client.listBackupsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listBackups.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listBackups.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listBackups with error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.ListBackupsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.ListBackupsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listBackups.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listBackupsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.spanner.admin.database.v1.IBackup[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listBackups.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listBackups.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listDatabaseOperations', () => { - it('invokes listDatabaseOperations without error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.ListDatabaseOperationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.ListDatabaseOperationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.longrunning.Operation()), - generateSampleMessage(new protos.google.longrunning.Operation()), - generateSampleMessage(new protos.google.longrunning.Operation()), - ]; - client.innerApiCalls.listDatabaseOperations = stubSimpleCall(expectedResponse); - const [response] = await client.listDatabaseOperations(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listDatabaseOperations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listDatabaseOperations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listDatabaseOperations without error using callback', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.ListDatabaseOperationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.ListDatabaseOperationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.longrunning.Operation()), - generateSampleMessage(new protos.google.longrunning.Operation()), - generateSampleMessage(new protos.google.longrunning.Operation()), - ]; - client.innerApiCalls.listDatabaseOperations = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listDatabaseOperations( - request, - (err?: Error|null, result?: protos.google.longrunning.IOperation[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listDatabaseOperations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listDatabaseOperations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listDatabaseOperations with error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.ListDatabaseOperationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.ListDatabaseOperationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.listDatabaseOperations = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listDatabaseOperations(request), expectedError); - const actualRequest = (client.innerApiCalls.listDatabaseOperations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listDatabaseOperations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listDatabaseOperationsStream without error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.ListDatabaseOperationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.ListDatabaseOperationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.longrunning.Operation()), - generateSampleMessage(new protos.google.longrunning.Operation()), - generateSampleMessage(new protos.google.longrunning.Operation()), - ]; - client.descriptors.page.listDatabaseOperations.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listDatabaseOperationsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.longrunning.Operation[] = []; - stream.on('data', (response: protos.google.longrunning.Operation) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listDatabaseOperations.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listDatabaseOperations, request)); - assert( - (client.descriptors.page.listDatabaseOperations.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listDatabaseOperationsStream with error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.ListDatabaseOperationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.ListDatabaseOperationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listDatabaseOperations.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listDatabaseOperationsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.longrunning.Operation[] = []; - stream.on('data', (response: protos.google.longrunning.Operation) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listDatabaseOperations.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listDatabaseOperations, request)); - assert( - (client.descriptors.page.listDatabaseOperations.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listDatabaseOperations without error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.ListDatabaseOperationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.ListDatabaseOperationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.longrunning.Operation()), - generateSampleMessage(new protos.google.longrunning.Operation()), - generateSampleMessage(new protos.google.longrunning.Operation()), - ]; - client.descriptors.page.listDatabaseOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.longrunning.IOperation[] = []; - const iterable = client.listDatabaseOperationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listDatabaseOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listDatabaseOperations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listDatabaseOperations with error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.ListDatabaseOperationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.ListDatabaseOperationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listDatabaseOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listDatabaseOperationsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.longrunning.IOperation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listDatabaseOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listDatabaseOperations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listBackupOperations', () => { - it('invokes listBackupOperations without error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.ListBackupOperationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.ListBackupOperationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.longrunning.Operation()), - generateSampleMessage(new protos.google.longrunning.Operation()), - generateSampleMessage(new protos.google.longrunning.Operation()), - ]; - client.innerApiCalls.listBackupOperations = stubSimpleCall(expectedResponse); - const [response] = await client.listBackupOperations(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listBackupOperations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listBackupOperations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listBackupOperations without error using callback', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.ListBackupOperationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.ListBackupOperationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.longrunning.Operation()), - generateSampleMessage(new protos.google.longrunning.Operation()), - generateSampleMessage(new protos.google.longrunning.Operation()), - ]; - client.innerApiCalls.listBackupOperations = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listBackupOperations( - request, - (err?: Error|null, result?: protos.google.longrunning.IOperation[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listBackupOperations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listBackupOperations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listBackupOperations with error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.ListBackupOperationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.ListBackupOperationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.listBackupOperations = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listBackupOperations(request), expectedError); - const actualRequest = (client.innerApiCalls.listBackupOperations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listBackupOperations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listBackupOperationsStream without error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.ListBackupOperationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.ListBackupOperationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.longrunning.Operation()), - generateSampleMessage(new protos.google.longrunning.Operation()), - generateSampleMessage(new protos.google.longrunning.Operation()), - ]; - client.descriptors.page.listBackupOperations.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listBackupOperationsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.longrunning.Operation[] = []; - stream.on('data', (response: protos.google.longrunning.Operation) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listBackupOperations.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listBackupOperations, request)); - assert( - (client.descriptors.page.listBackupOperations.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listBackupOperationsStream with error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.ListBackupOperationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.ListBackupOperationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listBackupOperations.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listBackupOperationsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.longrunning.Operation[] = []; - stream.on('data', (response: protos.google.longrunning.Operation) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listBackupOperations.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listBackupOperations, request)); - assert( - (client.descriptors.page.listBackupOperations.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listBackupOperations without error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.ListBackupOperationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.ListBackupOperationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.longrunning.Operation()), - generateSampleMessage(new protos.google.longrunning.Operation()), - generateSampleMessage(new protos.google.longrunning.Operation()), - ]; - client.descriptors.page.listBackupOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.longrunning.IOperation[] = []; - const iterable = client.listBackupOperationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listBackupOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listBackupOperations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listBackupOperations with error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.ListBackupOperationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.ListBackupOperationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listBackupOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listBackupOperationsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.longrunning.IOperation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listBackupOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listBackupOperations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listDatabaseRoles', () => { - it('invokes listDatabaseRoles without error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.ListDatabaseRolesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.ListDatabaseRolesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.spanner.admin.database.v1.DatabaseRole()), - generateSampleMessage(new protos.google.spanner.admin.database.v1.DatabaseRole()), - generateSampleMessage(new protos.google.spanner.admin.database.v1.DatabaseRole()), - ]; - client.innerApiCalls.listDatabaseRoles = stubSimpleCall(expectedResponse); - const [response] = await client.listDatabaseRoles(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listDatabaseRoles as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listDatabaseRoles as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listDatabaseRoles without error using callback', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.ListDatabaseRolesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.ListDatabaseRolesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.spanner.admin.database.v1.DatabaseRole()), - generateSampleMessage(new protos.google.spanner.admin.database.v1.DatabaseRole()), - generateSampleMessage(new protos.google.spanner.admin.database.v1.DatabaseRole()), - ]; - client.innerApiCalls.listDatabaseRoles = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listDatabaseRoles( - request, - (err?: Error|null, result?: protos.google.spanner.admin.database.v1.IDatabaseRole[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listDatabaseRoles as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listDatabaseRoles as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listDatabaseRoles with error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.ListDatabaseRolesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.ListDatabaseRolesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.listDatabaseRoles = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listDatabaseRoles(request), expectedError); - const actualRequest = (client.innerApiCalls.listDatabaseRoles as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listDatabaseRoles as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listDatabaseRolesStream without error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.ListDatabaseRolesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.ListDatabaseRolesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.spanner.admin.database.v1.DatabaseRole()), - generateSampleMessage(new protos.google.spanner.admin.database.v1.DatabaseRole()), - generateSampleMessage(new protos.google.spanner.admin.database.v1.DatabaseRole()), - ]; - client.descriptors.page.listDatabaseRoles.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listDatabaseRolesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.spanner.admin.database.v1.DatabaseRole[] = []; - stream.on('data', (response: protos.google.spanner.admin.database.v1.DatabaseRole) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listDatabaseRoles.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listDatabaseRoles, request)); - assert( - (client.descriptors.page.listDatabaseRoles.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listDatabaseRolesStream with error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.ListDatabaseRolesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.ListDatabaseRolesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listDatabaseRoles.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listDatabaseRolesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.spanner.admin.database.v1.DatabaseRole[] = []; - stream.on('data', (response: protos.google.spanner.admin.database.v1.DatabaseRole) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listDatabaseRoles.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listDatabaseRoles, request)); - assert( - (client.descriptors.page.listDatabaseRoles.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listDatabaseRoles without error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.ListDatabaseRolesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.ListDatabaseRolesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.spanner.admin.database.v1.DatabaseRole()), - generateSampleMessage(new protos.google.spanner.admin.database.v1.DatabaseRole()), - generateSampleMessage(new protos.google.spanner.admin.database.v1.DatabaseRole()), - ]; - client.descriptors.page.listDatabaseRoles.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.spanner.admin.database.v1.IDatabaseRole[] = []; - const iterable = client.listDatabaseRolesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listDatabaseRoles.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listDatabaseRoles.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listDatabaseRoles with error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.ListDatabaseRolesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.ListDatabaseRolesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listDatabaseRoles.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listDatabaseRolesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.spanner.admin.database.v1.IDatabaseRole[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listDatabaseRoles.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listDatabaseRoles.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listBackupSchedules', () => { - it('invokes listBackupSchedules without error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.ListBackupSchedulesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.ListBackupSchedulesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.spanner.admin.database.v1.BackupSchedule()), - generateSampleMessage(new protos.google.spanner.admin.database.v1.BackupSchedule()), - generateSampleMessage(new protos.google.spanner.admin.database.v1.BackupSchedule()), - ]; - client.innerApiCalls.listBackupSchedules = stubSimpleCall(expectedResponse); - const [response] = await client.listBackupSchedules(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listBackupSchedules as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listBackupSchedules as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listBackupSchedules without error using callback', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.ListBackupSchedulesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.ListBackupSchedulesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.spanner.admin.database.v1.BackupSchedule()), - generateSampleMessage(new protos.google.spanner.admin.database.v1.BackupSchedule()), - generateSampleMessage(new protos.google.spanner.admin.database.v1.BackupSchedule()), - ]; - client.innerApiCalls.listBackupSchedules = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listBackupSchedules( - request, - (err?: Error|null, result?: protos.google.spanner.admin.database.v1.IBackupSchedule[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listBackupSchedules as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listBackupSchedules as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listBackupSchedules with error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.ListBackupSchedulesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.ListBackupSchedulesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.listBackupSchedules = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listBackupSchedules(request), expectedError); - const actualRequest = (client.innerApiCalls.listBackupSchedules as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listBackupSchedules as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listBackupSchedulesStream without error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.ListBackupSchedulesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.ListBackupSchedulesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.spanner.admin.database.v1.BackupSchedule()), - generateSampleMessage(new protos.google.spanner.admin.database.v1.BackupSchedule()), - generateSampleMessage(new protos.google.spanner.admin.database.v1.BackupSchedule()), - ]; - client.descriptors.page.listBackupSchedules.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listBackupSchedulesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.spanner.admin.database.v1.BackupSchedule[] = []; - stream.on('data', (response: protos.google.spanner.admin.database.v1.BackupSchedule) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listBackupSchedules.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listBackupSchedules, request)); - assert( - (client.descriptors.page.listBackupSchedules.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listBackupSchedulesStream with error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.ListBackupSchedulesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.ListBackupSchedulesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listBackupSchedules.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listBackupSchedulesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.spanner.admin.database.v1.BackupSchedule[] = []; - stream.on('data', (response: protos.google.spanner.admin.database.v1.BackupSchedule) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listBackupSchedules.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listBackupSchedules, request)); - assert( - (client.descriptors.page.listBackupSchedules.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listBackupSchedules without error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.ListBackupSchedulesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.ListBackupSchedulesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.spanner.admin.database.v1.BackupSchedule()), - generateSampleMessage(new protos.google.spanner.admin.database.v1.BackupSchedule()), - generateSampleMessage(new protos.google.spanner.admin.database.v1.BackupSchedule()), - ]; - client.descriptors.page.listBackupSchedules.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.spanner.admin.database.v1.IBackupSchedule[] = []; - const iterable = client.listBackupSchedulesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listBackupSchedules.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listBackupSchedules.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listBackupSchedules with error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.database.v1.ListBackupSchedulesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.database.v1.ListBackupSchedulesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listBackupSchedules.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listBackupSchedulesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.spanner.admin.database.v1.IBackupSchedule[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listBackupSchedules.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listBackupSchedules.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getOperation', () => { - it('invokes getOperation without error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const response = await client.getOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes getOperation without error using callback', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.getOperation( - request, - undefined, - ( - err?: Error | null, - result?: operationsProtos.google.longrunning.Operation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - it('invokes getOperation with error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.getOperation(request)}, expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('cancelOperation', () => { - it('invokes cancelOperation without error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); - const response = await client.cancelOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes cancelOperation without error using callback', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.cancelOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0)); - }); - it('invokes cancelOperation with error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('deleteOperation', () => { - it('invokes deleteOperation without error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); - const response = await client.deleteOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes deleteOperation without error using callback', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.deleteOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0)); - }); - it('invokes deleteOperation with error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('listOperationsAsync', () => { - it('uses async iteration with listOperations without error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedResponse = [ - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - ]; - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: operationsProtos.google.longrunning.IOperation[] = []; - const iterable = client.operationsClient.listOperationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - it('uses async iteration with listOperations with error', async () => { - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.operationsClient.listOperationsAsync(request); - await assert.rejects(async () => { - const responses: operationsProtos.google.longrunning.IOperation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - }); - - describe('Path templates', () => { - - describe('backup', async () => { - const fakePath = "/rendered/path/backup"; - const expectedParameters = { - project: "projectValue", - instance: "instanceValue", - backup: "backupValue", - }; - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.backupPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.backupPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('backupPath', () => { - const result = client.backupPath("projectValue", "instanceValue", "backupValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.backupPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromBackupName', () => { - const result = client.matchProjectFromBackupName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.backupPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchInstanceFromBackupName', () => { - const result = client.matchInstanceFromBackupName(fakePath); - assert.strictEqual(result, "instanceValue"); - assert((client.pathTemplates.backupPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchBackupFromBackupName', () => { - const result = client.matchBackupFromBackupName(fakePath); - assert.strictEqual(result, "backupValue"); - assert((client.pathTemplates.backupPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('backupSchedule', async () => { - const fakePath = "/rendered/path/backupSchedule"; - const expectedParameters = { - project: "projectValue", - instance: "instanceValue", - database: "databaseValue", - schedule: "scheduleValue", - }; - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.backupSchedulePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.backupSchedulePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('backupSchedulePath', () => { - const result = client.backupSchedulePath("projectValue", "instanceValue", "databaseValue", "scheduleValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.backupSchedulePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromBackupScheduleName', () => { - const result = client.matchProjectFromBackupScheduleName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.backupSchedulePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchInstanceFromBackupScheduleName', () => { - const result = client.matchInstanceFromBackupScheduleName(fakePath); - assert.strictEqual(result, "instanceValue"); - assert((client.pathTemplates.backupSchedulePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatabaseFromBackupScheduleName', () => { - const result = client.matchDatabaseFromBackupScheduleName(fakePath); - assert.strictEqual(result, "databaseValue"); - assert((client.pathTemplates.backupSchedulePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchScheduleFromBackupScheduleName', () => { - const result = client.matchScheduleFromBackupScheduleName(fakePath); - assert.strictEqual(result, "scheduleValue"); - assert((client.pathTemplates.backupSchedulePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('cryptoKey', async () => { - const fakePath = "/rendered/path/cryptoKey"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - key_ring: "keyRingValue", - crypto_key: "cryptoKeyValue", - }; - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.cryptoKeyPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.cryptoKeyPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('cryptoKeyPath', () => { - const result = client.cryptoKeyPath("projectValue", "locationValue", "keyRingValue", "cryptoKeyValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.cryptoKeyPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromCryptoKeyName', () => { - const result = client.matchProjectFromCryptoKeyName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.cryptoKeyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromCryptoKeyName', () => { - const result = client.matchLocationFromCryptoKeyName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.cryptoKeyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchKeyRingFromCryptoKeyName', () => { - const result = client.matchKeyRingFromCryptoKeyName(fakePath); - assert.strictEqual(result, "keyRingValue"); - assert((client.pathTemplates.cryptoKeyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCryptoKeyFromCryptoKeyName', () => { - const result = client.matchCryptoKeyFromCryptoKeyName(fakePath); - assert.strictEqual(result, "cryptoKeyValue"); - assert((client.pathTemplates.cryptoKeyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('database', async () => { - const fakePath = "/rendered/path/database"; - const expectedParameters = { - project: "projectValue", - instance: "instanceValue", - database: "databaseValue", - }; - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.databasePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.databasePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('databasePath', () => { - const result = client.databasePath("projectValue", "instanceValue", "databaseValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.databasePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDatabaseName', () => { - const result = client.matchProjectFromDatabaseName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.databasePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchInstanceFromDatabaseName', () => { - const result = client.matchInstanceFromDatabaseName(fakePath); - assert.strictEqual(result, "instanceValue"); - assert((client.pathTemplates.databasePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatabaseFromDatabaseName', () => { - const result = client.matchDatabaseFromDatabaseName(fakePath); - assert.strictEqual(result, "databaseValue"); - assert((client.pathTemplates.databasePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('databaseRole', async () => { - const fakePath = "/rendered/path/databaseRole"; - const expectedParameters = { - project: "projectValue", - instance: "instanceValue", - database: "databaseValue", - role: "roleValue", - }; - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.databaseRolePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.databaseRolePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('databaseRolePath', () => { - const result = client.databaseRolePath("projectValue", "instanceValue", "databaseValue", "roleValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.databaseRolePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDatabaseRoleName', () => { - const result = client.matchProjectFromDatabaseRoleName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.databaseRolePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchInstanceFromDatabaseRoleName', () => { - const result = client.matchInstanceFromDatabaseRoleName(fakePath); - assert.strictEqual(result, "instanceValue"); - assert((client.pathTemplates.databaseRolePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatabaseFromDatabaseRoleName', () => { - const result = client.matchDatabaseFromDatabaseRoleName(fakePath); - assert.strictEqual(result, "databaseValue"); - assert((client.pathTemplates.databaseRolePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRoleFromDatabaseRoleName', () => { - const result = client.matchRoleFromDatabaseRoleName(fakePath); - assert.strictEqual(result, "roleValue"); - assert((client.pathTemplates.databaseRolePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('instance', async () => { - const fakePath = "/rendered/path/instance"; - const expectedParameters = { - project: "projectValue", - instance: "instanceValue", - }; - const client = new databaseadminModule.v1.DatabaseAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.instancePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.instancePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('instancePath', () => { - const result = client.instancePath("projectValue", "instanceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.instancePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromInstanceName', () => { - const result = client.matchProjectFromInstanceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.instancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchInstanceFromInstanceName', () => { - const result = client.matchInstanceFromInstanceName(fakePath); - assert.strictEqual(result, "instanceValue"); - assert((client.pathTemplates.instancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/admin/database/v1/tsconfig.json b/owl-bot-staging/admin/database/v1/tsconfig.json deleted file mode 100644 index ca73e7bfc..000000000 --- a/owl-bot-staging/admin/database/v1/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "extends": "./node_modules/gts/tsconfig-google.json", - "compilerOptions": { - "rootDir": ".", - "outDir": "build", - "resolveJsonModule": true, - "lib": [ - "es2023", - "dom" - ] - }, - "include": [ - "src/*.ts", - "src/**/*.ts", - "test/*.ts", - "test/**/*.ts", - "system-test/*.ts", - "src/**/*.json", - "samples/**/*.json", - "protos/protos.json" - ] -} diff --git a/owl-bot-staging/admin/database/v1/webpack.config.js b/owl-bot-staging/admin/database/v1/webpack.config.js deleted file mode 100644 index ef04209ca..000000000 --- a/owl-bot-staging/admin/database/v1/webpack.config.js +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -const path = require('path'); - -module.exports = { - entry: './src/index.ts', - output: { - library: 'DatabaseAdmin', - filename: './database-admin.js', - }, - node: { - child_process: 'empty', - fs: 'empty', - crypto: 'empty', - }, - resolve: { - alias: { - '../../../package.json': path.resolve(__dirname, 'package.json'), - }, - extensions: ['.js', '.json', '.ts'], - }, - module: { - rules: [ - { - test: /\.tsx?$/, - use: 'ts-loader', - exclude: /node_modules/ - }, - { - test: /node_modules[\\/]@grpc[\\/]grpc-js/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]grpc/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]retry-request/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]https?-proxy-agent/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]gtoken/, - use: 'null-loader' - }, - ], - }, - mode: 'production', -}; diff --git a/owl-bot-staging/admin/instance/v1/.OwlBot.yaml b/owl-bot-staging/admin/instance/v1/.OwlBot.yaml deleted file mode 100644 index b3fd66363..000000000 --- a/owl-bot-staging/admin/instance/v1/.OwlBot.yaml +++ /dev/null @@ -1,19 +0,0 @@ -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -deep-copy-regex: - - source: /google/spanner/admin/instance/google-spanner-admin-instance-nodejs - dest: /owl-bot-staging/google-spanner-admin-instance - -api-name: instance \ No newline at end of file diff --git a/owl-bot-staging/admin/instance/v1/.eslintignore b/owl-bot-staging/admin/instance/v1/.eslintignore deleted file mode 100644 index cfc348ec4..000000000 --- a/owl-bot-staging/admin/instance/v1/.eslintignore +++ /dev/null @@ -1,7 +0,0 @@ -**/node_modules -**/.coverage -build/ -docs/ -protos/ -system-test/ -samples/generated/ diff --git a/owl-bot-staging/admin/instance/v1/.eslintrc.json b/owl-bot-staging/admin/instance/v1/.eslintrc.json deleted file mode 100644 index 782153495..000000000 --- a/owl-bot-staging/admin/instance/v1/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./node_modules/gts" -} diff --git a/owl-bot-staging/admin/instance/v1/.gitattributes b/owl-bot-staging/admin/instance/v1/.gitattributes deleted file mode 100644 index 33739cb74..000000000 --- a/owl-bot-staging/admin/instance/v1/.gitattributes +++ /dev/null @@ -1,4 +0,0 @@ -*.ts text eol=lf -*.js text eol=lf -protos/* linguist-generated -**/api-extractor.json linguist-language=JSON-with-Comments diff --git a/owl-bot-staging/admin/instance/v1/.gitignore b/owl-bot-staging/admin/instance/v1/.gitignore deleted file mode 100644 index d4f03a0df..000000000 --- a/owl-bot-staging/admin/instance/v1/.gitignore +++ /dev/null @@ -1,14 +0,0 @@ -**/*.log -**/node_modules -/.coverage -/coverage -/.nyc_output -/docs/ -/out/ -/build/ -system-test/secrets.js -system-test/*key.json -*.lock -.DS_Store -package-lock.json -__pycache__ diff --git a/owl-bot-staging/admin/instance/v1/.jsdoc.js b/owl-bot-staging/admin/instance/v1/.jsdoc.js deleted file mode 100644 index 89dbb7cd9..000000000 --- a/owl-bot-staging/admin/instance/v1/.jsdoc.js +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -'use strict'; - -module.exports = { - opts: { - readme: './README.md', - package: './package.json', - template: './node_modules/jsdoc-fresh', - recurse: true, - verbose: true, - destination: './docs/' - }, - plugins: [ - 'plugins/markdown', - 'jsdoc-region-tag' - ], - source: { - excludePattern: '(^|\\/|\\\\)[._]', - include: [ - 'build/src', - 'protos' - ], - includePattern: '\\.js$' - }, - templates: { - copyright: 'Copyright 2026 Google LLC', - includeDate: false, - sourceFiles: false, - systemName: '@google-cloud/spanner', - theme: 'lumen', - default: { - outputSourceFiles: false - } - }, - markdown: { - idInHeadings: true - } -}; diff --git a/owl-bot-staging/admin/instance/v1/.mocharc.js b/owl-bot-staging/admin/instance/v1/.mocharc.js deleted file mode 100644 index 5eb34e86c..000000000 --- a/owl-bot-staging/admin/instance/v1/.mocharc.js +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -const config = { - "enable-source-maps": true, - "throw-deprecation": true, - "timeout": 10000 -} -if (process.env.MOCHA_THROW_DEPRECATION === 'false') { - delete config['throw-deprecation']; -} -if (process.env.MOCHA_REPORTER) { - config.reporter = process.env.MOCHA_REPORTER; -} -if (process.env.MOCHA_REPORTER_OUTPUT) { - config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; -} -module.exports = config diff --git a/owl-bot-staging/admin/instance/v1/.nycrc b/owl-bot-staging/admin/instance/v1/.nycrc deleted file mode 100644 index 81a95fc94..000000000 --- a/owl-bot-staging/admin/instance/v1/.nycrc +++ /dev/null @@ -1,24 +0,0 @@ -{ - "report-dir": "./.coverage", - "reporter": ["text", "lcov"], - "exclude": [ - "**/*-test", - "**/.coverage", - "**/apis", - "**/benchmark", - "**/conformance", - "**/docs", - "**/samples", - "**/scripts", - "**/protos", - "**/test", - "**/*.d.ts", - ".jsdoc.js", - "**/.jsdoc.js", - "karma.conf.js", - "webpack-tests.config.js", - "webpack.config.js" - ], - "exclude-after-remap": false, - "all": true -} \ No newline at end of file diff --git a/owl-bot-staging/admin/instance/v1/.prettierignore b/owl-bot-staging/admin/instance/v1/.prettierignore deleted file mode 100644 index 9340ad9b8..000000000 --- a/owl-bot-staging/admin/instance/v1/.prettierignore +++ /dev/null @@ -1,6 +0,0 @@ -**/node_modules -**/coverage -test/fixtures -build/ -docs/ -protos/ diff --git a/owl-bot-staging/admin/instance/v1/.prettierrc.js b/owl-bot-staging/admin/instance/v1/.prettierrc.js deleted file mode 100644 index 7649ee3c2..000000000 --- a/owl-bot-staging/admin/instance/v1/.prettierrc.js +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - -module.exports = { - ...require('gts/.prettierrc.json') -} diff --git a/owl-bot-staging/admin/instance/v1/CODE_OF_CONDUCT.md b/owl-bot-staging/admin/instance/v1/CODE_OF_CONDUCT.md deleted file mode 100644 index 2add2547a..000000000 --- a/owl-bot-staging/admin/instance/v1/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,94 +0,0 @@ - -# Code of Conduct - -## Our Pledge - -In the interest of fostering an open and welcoming environment, we as -contributors and maintainers pledge to making participation in our project and -our community a harassment-free experience for everyone, regardless of age, body -size, disability, ethnicity, gender identity and expression, level of -experience, education, socio-economic status, nationality, personal appearance, -race, religion, or sexual identity and orientation. - -## Our Standards - -Examples of behavior that contributes to creating a positive environment -include: - -* Using welcoming and inclusive language -* Being respectful of differing viewpoints and experiences -* Gracefully accepting constructive criticism -* Focusing on what is best for the community -* Showing empathy towards other community members - -Examples of unacceptable behavior by participants include: - -* The use of sexualized language or imagery and unwelcome sexual attention or - advances -* Trolling, insulting/derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or electronic - address, without explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting - -## Our Responsibilities - -Project maintainers are responsible for clarifying the standards of acceptable -behavior and are expected to take appropriate and fair corrective action in -response to any instances of unacceptable behavior. - -Project maintainers have the right and responsibility to remove, edit, or reject -comments, commits, code, wiki edits, issues, and other contributions that are -not aligned to this Code of Conduct, or to ban temporarily or permanently any -contributor for other behaviors that they deem inappropriate, threatening, -offensive, or harmful. - -## Scope - -This Code of Conduct applies both within project spaces and in public spaces -when an individual is representing the project or its community. Examples of -representing a project or community include using an official project e-mail -address, posting via an official social media account, or acting as an appointed -representative at an online or offline event. Representation of a project may be -further defined and clarified by project maintainers. - -This Code of Conduct also applies outside the project spaces when the Project -Steward has a reasonable belief that an individual's behavior may have a -negative impact on the project or its community. - -## Conflict Resolution - -We do not believe that all conflict is bad; healthy debate and disagreement -often yield positive results. However, it is never okay to be disrespectful or -to engage in behavior that violates the project’s code of conduct. - -If you see someone violating the code of conduct, you are encouraged to address -the behavior directly with those involved. Many issues can be resolved quickly -and easily, and this gives people more control over the outcome of their -dispute. If you are unable to resolve the matter for any reason, or if the -behavior is threatening or harassing, report it. We are dedicated to providing -an environment where participants feel welcome and safe. - -Reports should be directed to *googleapis-stewards@google.com*, the -Project Steward(s) for *Google Cloud Client Libraries*. It is the Project Steward’s duty to -receive and address reported violations of the code of conduct. They will then -work with a committee consisting of representatives from the Open Source -Programs Office and the Google Open Source Strategy team. If for any reason you -are uncomfortable reaching out to the Project Steward, please email -opensource@google.com. - -We will investigate every complaint, but you may not receive a direct response. -We will use our discretion in determining when and how to follow up on reported -incidents, which may range from not taking action to permanent expulsion from -the project and project-sponsored spaces. We will notify the accused of the -report and provide them an opportunity to discuss it before any action is taken. -The identity of the reporter will be omitted from the details of the report -supplied to the accused. In potentially harmful situations, such as ongoing -harassment or threats to anyone's safety, we may take action without notice. - -## Attribution - -This Code of Conduct is adapted from the Contributor Covenant, version 1.4, -available at -https://www.contributor-covenant.org/version/1/4/code-of-conduct.html \ No newline at end of file diff --git a/owl-bot-staging/admin/instance/v1/CONTRIBUTING.md b/owl-bot-staging/admin/instance/v1/CONTRIBUTING.md deleted file mode 100644 index bc72d8a26..000000000 --- a/owl-bot-staging/admin/instance/v1/CONTRIBUTING.md +++ /dev/null @@ -1,76 +0,0 @@ -# How to become a contributor and submit your own code - -**Table of contents** - -* [Contributor License Agreements](#contributor-license-agreements) -* [Contributing a patch](#contributing-a-patch) -* [Running the tests](#running-the-tests) -* [Releasing the library](#releasing-the-library) - -## Contributor License Agreements - -We'd love to accept your sample apps and patches! Before we can take them, we -have to jump a couple of legal hurdles. - -Please fill out either the individual or corporate Contributor License Agreement -(CLA). - - * If you are an individual writing original source code and you're sure you - own the intellectual property, then you'll need to sign an [individual CLA](https://developers.google.com/open-source/cla/individual). - * If you work for a company that wants to allow you to contribute your work, - then you'll need to sign a [corporate CLA](https://developers.google.com/open-source/cla/corporate). - -Follow either of the two links above to access the appropriate CLA and -instructions for how to sign and return it. Once we receive it, we'll be able to -accept your pull requests. - -## Contributing A Patch - -1. Submit an issue describing your proposed change to the repo in question. -1. The repo owner will respond to your issue promptly. -1. If your proposed change is accepted, and you haven't already done so, sign a - Contributor License Agreement (see details above). -1. Fork the desired repo, develop and test your code changes. -1. Ensure that your code adheres to the existing style in the code to which - you are contributing. -1. Ensure that your code has an appropriate set of tests which all pass. -1. Title your pull request following [Conventional Commits](https://www.conventionalcommits.org/) styling. -1. Submit a pull request. - -### Before you begin - -1. [Select or create a Cloud Platform project][projects]. -1. [Enable billing for your project][billing]. -1. [Enable the Instance API][enable_api]. -1. [Set up authentication with a service account][auth] so you can access the - API from your local workstation. - - -## Running the tests - -1. [Prepare your environment for Node.js setup][setup]. - -1. Install dependencies: - - npm install - -1. Run the tests: - - # Run unit tests. - npm test - - # Run sample integration tests. - npm run samples-test - - # Run all system tests. - npm run system-test - -1. Lint (and maybe fix) any changes: - - npm run fix - -[setup]: https://cloud.google.com/nodejs/docs/setup -[projects]: https://console.cloud.google.com/project -[billing]: https://support.google.com/cloud/answer/6293499#enable-billing -[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=spanner.googleapis.com -[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/owl-bot-staging/admin/instance/v1/LICENSE b/owl-bot-staging/admin/instance/v1/LICENSE deleted file mode 100644 index d64569567..000000000 --- a/owl-bot-staging/admin/instance/v1/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/owl-bot-staging/admin/instance/v1/README.md b/owl-bot-staging/admin/instance/v1/README.md deleted file mode 100644 index d6dda670d..000000000 --- a/owl-bot-staging/admin/instance/v1/README.md +++ /dev/null @@ -1,108 +0,0 @@ -[//]: # "This README.md file is auto-generated, all changes to this file will be lost." -[//]: # "The comments you see below are used to generate those parts of the template in later states." -Google Cloud Platform logo - -# [Cloud Spanner API: Nodejs Client][homepage] - -[//]: # "releaseLevel" - -[![npm version](https://img.shields.io/npm/v/@google-cloud/spanner.svg)](https://www.npmjs.org/package/@google-cloud/spanner) - -Cloud Spanner API client for Node.js - -[//]: # "partials.introduction" - -A comprehensive list of changes in each version may be found in -[the CHANGELOG][homepage_changelog]. - -* [Cloud Spanner API Nodejs Client API Reference](https://cloud.google.com/nodejs/docs/reference/instance/latest) -* [Cloud Spanner API Documentation](https://cloud.google.com/spanner/) - -Read more about the client libraries for Cloud APIs, including the older -Google APIs Client Libraries, in [Client Libraries Explained][explained]. - -[explained]: https://cloud.google.com/apis/docs/client-libraries-explained - -**Table of contents:** - -* [Quickstart](#quickstart) - * [Before you begin](#before-you-begin) - * [Installing the client library](#installing-the-client-library) - -* [Versioning](#versioning) -* [Contributing](#contributing) -* [License](#license) - -## Quickstart -### Before you begin - -1. [Select or create a Cloud Platform project][projects]. -1. [Enable billing for your project][billing]. -1. [Enable the Cloud Spanner API API][enable_api]. -1. [Set up authentication][auth] so you can access the - API from your local workstation. -### Installing the client library - -```bash -npm install @google-cloud/spanner -``` - -[//]: # "partials.body" - -## Samples - -Samples are in the [`samples/`][homepage_samples] directory. Each sample's `README.md` has instructions for running its sample. - -[//]: # "samples" - -## Supported Node.js Versions - -Our client libraries follow the [Node.js release schedule](https://github.com/nodejs/release#release-schedule). -Libraries are compatible with all current _active_ and _maintenance_ versions of -Node.js. -If you are using an end-of-life version of Node.js, we recommend that you update -as soon as possible to an actively supported LTS version. - -Google's client libraries support legacy versions of Node.js runtimes on a -best-efforts basis with the following warnings: - -* Legacy versions are not tested in continuous integration. -* Some security patches and features cannot be backported. -* Dependencies cannot be kept up-to-date. - -Client libraries targeting some end-of-life versions of Node.js are available, and -can be installed through npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). -The dist-tags follow the naming convention `legacy-(version)`. -For example, `npm install @google-cloud/spanner@legacy-8` installs client libraries -for versions compatible with Node.js 8. - -## Versioning - -This library follows [Semantic Versioning](http://semver.org/). - -More Information: [Google Cloud Platform Launch Stages][launch_stages] - -[launch_stages]: https://cloud.google.com/terms/launch-stages - -## Contributing - -Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-spanner-admin-instance/CONTRIBUTING.md). - -Please note that this `README.md` -and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) -are generated from a central template. - -## License - -Apache Version 2.0 - -See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-spanner-admin-instance/LICENSE) - -[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png -[projects]: https://console.cloud.google.com/project -[billing]: https://support.google.com/cloud/answer/6293499#enable-billing -[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=spanner.googleapis.com -[auth]: https://cloud.google.com/docs/authentication/external/set-up-adc-local -[homepage_samples]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-spanner-admin-instance/samples -[homepage_changelog]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-spanner-admin-instance/CHANGELOG.md -[homepage]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-spanner-admin-instance diff --git a/owl-bot-staging/admin/instance/v1/package.json b/owl-bot-staging/admin/instance/v1/package.json deleted file mode 100644 index 46b2931c2..000000000 --- a/owl-bot-staging/admin/instance/v1/package.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "name": "@google-cloud/spanner", - "version": "0.1.0", - "description": "Instance client for Node.js", - "repository": "googleapis/nodejs-instance", - "license": "Apache-2.0", - "author": "Google LLC", - "main": "build/src/index.js", - "files": [ - "build/src", - "build/protos" - ], - "keywords": [ - "google apis client", - "google api client", - "google apis", - "google api", - "google", - "google cloud platform", - "google cloud", - "cloud", - "google instance", - "instance", - "instance admin" - ], - "scripts": { - "clean": "gts clean", - "compile": "tsc -p . && cp -r protos build/ && minifyProtoJson", - "compile-protos": "compileProtos src", - "docs": "jsdoc -c .jsdoc.js", - "fix": "gts fix", - "lint": "gts check", - "prepare": "npm run compile-protos && npm run compile", - "system-test": "c8 mocha build/system-test", - "test": "c8 mocha build/test" - }, - "dependencies": { - "google-gax": "^5.1.1-rc.1" - }, - "devDependencies": { - "@types/mocha": "^10.0.10", - "@types/node": "^22.18.12", - "@types/sinon": "^17.0.4", - "c8": "^10.1.3", - "gapic-tools": "^1.0.3", - "gts": "^6.0.2", - "jsdoc": "^4.0.5", - "jsdoc-fresh": "^5.0.2", - "jsdoc-region-tag": "^4.0.1", - "mocha": "^11.7.4", - "pack-n-play": "^4.2.1", - "typescript": "5.8.3", - "sinon": "^21.0.0" - }, - "engines": { - "node": ">=v18" - } -} diff --git a/owl-bot-staging/admin/instance/v1/protos/google/spanner/admin/instance/v1/common.proto b/owl-bot-staging/admin/instance/v1/protos/google/spanner/admin/instance/v1/common.proto deleted file mode 100644 index 0b5282c7d..000000000 --- a/owl-bot-staging/admin/instance/v1/protos/google/spanner/admin/instance/v1/common.proto +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.spanner.admin.instance.v1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.Spanner.Admin.Instance.V1"; -option go_package = "cloud.google.com/go/spanner/admin/instance/apiv1/instancepb;instancepb"; -option java_multiple_files = true; -option java_outer_classname = "CommonProto"; -option java_package = "com.google.spanner.admin.instance.v1"; -option php_namespace = "Google\\Cloud\\Spanner\\Admin\\Instance\\V1"; -option ruby_package = "Google::Cloud::Spanner::Admin::Instance::V1"; - -// Encapsulates progress related information for a Cloud Spanner long -// running instance operations. -message OperationProgress { - // Percent completion of the operation. - // Values are between 0 and 100 inclusive. - int32 progress_percent = 1; - - // Time the request was received. - google.protobuf.Timestamp start_time = 2; - - // If set, the time at which this operation failed or was completed - // successfully. - google.protobuf.Timestamp end_time = 3; -} - -// Indicates the expected fulfillment period of an operation. -enum FulfillmentPeriod { - // Not specified. - FULFILLMENT_PERIOD_UNSPECIFIED = 0; - - // Normal fulfillment period. The operation is expected to complete within - // minutes. - FULFILLMENT_PERIOD_NORMAL = 1; - - // Extended fulfillment period. It can take up to an hour for the operation - // to complete. - FULFILLMENT_PERIOD_EXTENDED = 2; -} - -// ReplicaSelection identifies replicas with common properties. -message ReplicaSelection { - // Required. Name of the location of the replicas (e.g., "us-central1"). - string location = 1 [(google.api.field_behavior) = REQUIRED]; -} diff --git a/owl-bot-staging/admin/instance/v1/protos/google/spanner/admin/instance/v1/spanner_instance_admin.proto b/owl-bot-staging/admin/instance/v1/protos/google/spanner/admin/instance/v1/spanner_instance_admin.proto deleted file mode 100644 index d16ab2ca5..000000000 --- a/owl-bot-staging/admin/instance/v1/protos/google/spanner/admin/instance/v1/spanner_instance_admin.proto +++ /dev/null @@ -1,2184 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.spanner.admin.instance.v1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/iam/v1/iam_policy.proto"; -import "google/iam/v1/policy.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/empty.proto"; -import "google/protobuf/field_mask.proto"; -import "google/protobuf/timestamp.proto"; -import "google/spanner/admin/instance/v1/common.proto"; - -option csharp_namespace = "Google.Cloud.Spanner.Admin.Instance.V1"; -option go_package = "cloud.google.com/go/spanner/admin/instance/apiv1/instancepb;instancepb"; -option java_multiple_files = true; -option java_outer_classname = "SpannerInstanceAdminProto"; -option java_package = "com.google.spanner.admin.instance.v1"; -option php_namespace = "Google\\Cloud\\Spanner\\Admin\\Instance\\V1"; -option ruby_package = "Google::Cloud::Spanner::Admin::Instance::V1"; - -// Cloud Spanner Instance Admin API -// -// The Cloud Spanner Instance Admin API can be used to create, delete, -// modify and list instances. Instances are dedicated Cloud Spanner serving -// and storage resources to be used by Cloud Spanner databases. -// -// Each instance has a "configuration", which dictates where the -// serving resources for the Cloud Spanner instance are located (e.g., -// US-central, Europe). Configurations are created by Google based on -// resource availability. -// -// Cloud Spanner billing is based on the instances that exist and their -// sizes. After an instance exists, there are no additional -// per-database or per-operation charges for use of the instance -// (though there may be additional network bandwidth charges). -// Instances offer isolation: problems with databases in one instance -// will not affect other instances. However, within an instance -// databases can affect each other. For example, if one database in an -// instance receives a lot of requests and consumes most of the -// instance resources, fewer resources are available for other -// databases in that instance, and their performance may suffer. -service InstanceAdmin { - option (google.api.default_host) = "spanner.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform," - "https://www.googleapis.com/auth/spanner.admin"; - - // Lists the supported instance configurations for a given project. - // - // Returns both Google-managed configurations and user-managed - // configurations. - rpc ListInstanceConfigs(ListInstanceConfigsRequest) - returns (ListInstanceConfigsResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*}/instanceConfigs" - }; - option (google.api.method_signature) = "parent"; - } - - // Gets information about a particular instance configuration. - rpc GetInstanceConfig(GetInstanceConfigRequest) returns (InstanceConfig) { - option (google.api.http) = { - get: "/v1/{name=projects/*/instanceConfigs/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Creates an instance configuration and begins preparing it to be used. The - // returned long-running operation - // can be used to track the progress of preparing the new - // instance configuration. The instance configuration name is assigned by the - // caller. If the named instance configuration already exists, - // `CreateInstanceConfig` returns `ALREADY_EXISTS`. - // - // Immediately after the request returns: - // - // * The instance configuration is readable via the API, with all requested - // attributes. The instance configuration's - // [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling] - // field is set to true. Its state is `CREATING`. - // - // While the operation is pending: - // - // * Cancelling the operation renders the instance configuration immediately - // unreadable via the API. - // * Except for deleting the creating resource, all other attempts to modify - // the instance configuration are rejected. - // - // Upon completion of the returned operation: - // - // * Instances can be created using the instance configuration. - // * The instance configuration's - // [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling] - // field becomes false. Its state becomes `READY`. - // - // The returned long-running operation will - // have a name of the format - // `/operations/` and can be used to track - // creation of the instance configuration. The - // metadata field type is - // [CreateInstanceConfigMetadata][google.spanner.admin.instance.v1.CreateInstanceConfigMetadata]. - // The response field type is - // [InstanceConfig][google.spanner.admin.instance.v1.InstanceConfig], if - // successful. - // - // Authorization requires `spanner.instanceConfigs.create` permission on - // the resource - // [parent][google.spanner.admin.instance.v1.CreateInstanceConfigRequest.parent]. - rpc CreateInstanceConfig(CreateInstanceConfigRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{parent=projects/*}/instanceConfigs" - body: "*" - }; - option (google.api.method_signature) = - "parent,instance_config,instance_config_id"; - option (google.longrunning.operation_info) = { - response_type: "google.spanner.admin.instance.v1.InstanceConfig" - metadata_type: "google.spanner.admin.instance.v1.CreateInstanceConfigMetadata" - }; - } - - // Updates an instance configuration. The returned - // long-running operation can be used to track - // the progress of updating the instance. If the named instance configuration - // does not exist, returns `NOT_FOUND`. - // - // Only user-managed configurations can be updated. - // - // Immediately after the request returns: - // - // * The instance configuration's - // [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling] - // field is set to true. - // - // While the operation is pending: - // - // * Cancelling the operation sets its metadata's - // [cancel_time][google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata.cancel_time]. - // The operation is guaranteed to succeed at undoing all changes, after - // which point it terminates with a `CANCELLED` status. - // * All other attempts to modify the instance configuration are rejected. - // * Reading the instance configuration via the API continues to give the - // pre-request values. - // - // Upon completion of the returned operation: - // - // * Creating instances using the instance configuration uses the new - // values. - // * The new values of the instance configuration are readable via the API. - // * The instance configuration's - // [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling] - // field becomes false. - // - // The returned long-running operation will - // have a name of the format - // `/operations/` and can be used to track - // the instance configuration modification. The - // metadata field type is - // [UpdateInstanceConfigMetadata][google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata]. - // The response field type is - // [InstanceConfig][google.spanner.admin.instance.v1.InstanceConfig], if - // successful. - // - // Authorization requires `spanner.instanceConfigs.update` permission on - // the resource [name][google.spanner.admin.instance.v1.InstanceConfig.name]. - rpc UpdateInstanceConfig(UpdateInstanceConfigRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - patch: "/v1/{instance_config.name=projects/*/instanceConfigs/*}" - body: "*" - }; - option (google.api.method_signature) = "instance_config,update_mask"; - option (google.longrunning.operation_info) = { - response_type: "google.spanner.admin.instance.v1.InstanceConfig" - metadata_type: "google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata" - }; - } - - // Deletes the instance configuration. Deletion is only allowed when no - // instances are using the configuration. If any instances are using - // the configuration, returns `FAILED_PRECONDITION`. - // - // Only user-managed configurations can be deleted. - // - // Authorization requires `spanner.instanceConfigs.delete` permission on - // the resource [name][google.spanner.admin.instance.v1.InstanceConfig.name]. - rpc DeleteInstanceConfig(DeleteInstanceConfigRequest) - returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/instanceConfigs/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists the user-managed instance configuration long-running - // operations in the given project. An instance - // configuration operation has a name of the form - // `projects//instanceConfigs//operations/`. - // The long-running operation - // metadata field type - // `metadata.type_url` describes the type of the metadata. Operations returned - // include those that have completed/failed/canceled within the last 7 days, - // and pending operations. Operations returned are ordered by - // `operation.metadata.value.start_time` in descending order starting - // from the most recently started operation. - rpc ListInstanceConfigOperations(ListInstanceConfigOperationsRequest) - returns (ListInstanceConfigOperationsResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*}/instanceConfigOperations" - }; - option (google.api.method_signature) = "parent"; - } - - // Lists all instances in the given project. - rpc ListInstances(ListInstancesRequest) returns (ListInstancesResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*}/instances" - }; - option (google.api.method_signature) = "parent"; - } - - // Lists all instance partitions for the given instance. - rpc ListInstancePartitions(ListInstancePartitionsRequest) - returns (ListInstancePartitionsResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/instances/*}/instancePartitions" - }; - option (google.api.method_signature) = "parent"; - } - - // Gets information about a particular instance. - rpc GetInstance(GetInstanceRequest) returns (Instance) { - option (google.api.http) = { - get: "/v1/{name=projects/*/instances/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Creates an instance and begins preparing it to begin serving. The - // returned long-running operation - // can be used to track the progress of preparing the new - // instance. The instance name is assigned by the caller. If the - // named instance already exists, `CreateInstance` returns - // `ALREADY_EXISTS`. - // - // Immediately upon completion of this request: - // - // * The instance is readable via the API, with all requested attributes - // but no allocated resources. Its state is `CREATING`. - // - // Until completion of the returned operation: - // - // * Cancelling the operation renders the instance immediately unreadable - // via the API. - // * The instance can be deleted. - // * All other attempts to modify the instance are rejected. - // - // Upon completion of the returned operation: - // - // * Billing for all successfully-allocated resources begins (some types - // may have lower than the requested levels). - // * Databases can be created in the instance. - // * The instance's allocated resource levels are readable via the API. - // * The instance's state becomes `READY`. - // - // The returned long-running operation will - // have a name of the format `/operations/` and - // can be used to track creation of the instance. The - // metadata field type is - // [CreateInstanceMetadata][google.spanner.admin.instance.v1.CreateInstanceMetadata]. - // The response field type is - // [Instance][google.spanner.admin.instance.v1.Instance], if successful. - rpc CreateInstance(CreateInstanceRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{parent=projects/*}/instances" - body: "*" - }; - option (google.api.method_signature) = "parent,instance_id,instance"; - option (google.longrunning.operation_info) = { - response_type: "google.spanner.admin.instance.v1.Instance" - metadata_type: "google.spanner.admin.instance.v1.CreateInstanceMetadata" - }; - } - - // Updates an instance, and begins allocating or releasing resources - // as requested. The returned long-running operation can be used to track the - // progress of updating the instance. If the named instance does not - // exist, returns `NOT_FOUND`. - // - // Immediately upon completion of this request: - // - // * For resource types for which a decrease in the instance's allocation - // has been requested, billing is based on the newly-requested level. - // - // Until completion of the returned operation: - // - // * Cancelling the operation sets its metadata's - // [cancel_time][google.spanner.admin.instance.v1.UpdateInstanceMetadata.cancel_time], - // and begins restoring resources to their pre-request values. The - // operation is guaranteed to succeed at undoing all resource changes, - // after which point it terminates with a `CANCELLED` status. - // * All other attempts to modify the instance are rejected. - // * Reading the instance via the API continues to give the pre-request - // resource levels. - // - // Upon completion of the returned operation: - // - // * Billing begins for all successfully-allocated resources (some types - // may have lower than the requested levels). - // * All newly-reserved resources are available for serving the instance's - // tables. - // * The instance's new resource levels are readable via the API. - // - // The returned long-running operation will - // have a name of the format `/operations/` and - // can be used to track the instance modification. The - // metadata field type is - // [UpdateInstanceMetadata][google.spanner.admin.instance.v1.UpdateInstanceMetadata]. - // The response field type is - // [Instance][google.spanner.admin.instance.v1.Instance], if successful. - // - // Authorization requires `spanner.instances.update` permission on - // the resource [name][google.spanner.admin.instance.v1.Instance.name]. - rpc UpdateInstance(UpdateInstanceRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - patch: "/v1/{instance.name=projects/*/instances/*}" - body: "*" - }; - option (google.api.method_signature) = "instance,field_mask"; - option (google.longrunning.operation_info) = { - response_type: "google.spanner.admin.instance.v1.Instance" - metadata_type: "google.spanner.admin.instance.v1.UpdateInstanceMetadata" - }; - } - - // Deletes an instance. - // - // Immediately upon completion of the request: - // - // * Billing ceases for all of the instance's reserved resources. - // - // Soon afterward: - // - // * The instance and *all of its databases* immediately and - // irrevocably disappear from the API. All data in the databases - // is permanently deleted. - rpc DeleteInstance(DeleteInstanceRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/instances/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Sets the access control policy on an instance resource. Replaces any - // existing policy. - // - // Authorization requires `spanner.instances.setIamPolicy` on - // [resource][google.iam.v1.SetIamPolicyRequest.resource]. - rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) - returns (google.iam.v1.Policy) { - option (google.api.http) = { - post: "/v1/{resource=projects/*/instances/*}:setIamPolicy" - body: "*" - }; - option (google.api.method_signature) = "resource,policy"; - } - - // Gets the access control policy for an instance resource. Returns an empty - // policy if an instance exists but does not have a policy set. - // - // Authorization requires `spanner.instances.getIamPolicy` on - // [resource][google.iam.v1.GetIamPolicyRequest.resource]. - rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) - returns (google.iam.v1.Policy) { - option (google.api.http) = { - post: "/v1/{resource=projects/*/instances/*}:getIamPolicy" - body: "*" - }; - option (google.api.method_signature) = "resource"; - } - - // Returns permissions that the caller has on the specified instance resource. - // - // Attempting this RPC on a non-existent Cloud Spanner instance resource will - // result in a NOT_FOUND error if the user has `spanner.instances.list` - // permission on the containing Google Cloud Project. Otherwise returns an - // empty set of permissions. - rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) - returns (google.iam.v1.TestIamPermissionsResponse) { - option (google.api.http) = { - post: "/v1/{resource=projects/*/instances/*}:testIamPermissions" - body: "*" - }; - option (google.api.method_signature) = "resource,permissions"; - } - - // Gets information about a particular instance partition. - rpc GetInstancePartition(GetInstancePartitionRequest) - returns (InstancePartition) { - option (google.api.http) = { - get: "/v1/{name=projects/*/instances/*/instancePartitions/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Creates an instance partition and begins preparing it to be used. The - // returned long-running operation - // can be used to track the progress of preparing the new instance partition. - // The instance partition name is assigned by the caller. If the named - // instance partition already exists, `CreateInstancePartition` returns - // `ALREADY_EXISTS`. - // - // Immediately upon completion of this request: - // - // * The instance partition is readable via the API, with all requested - // attributes but no allocated resources. Its state is `CREATING`. - // - // Until completion of the returned operation: - // - // * Cancelling the operation renders the instance partition immediately - // unreadable via the API. - // * The instance partition can be deleted. - // * All other attempts to modify the instance partition are rejected. - // - // Upon completion of the returned operation: - // - // * Billing for all successfully-allocated resources begins (some types - // may have lower than the requested levels). - // * Databases can start using this instance partition. - // * The instance partition's allocated resource levels are readable via the - // API. - // * The instance partition's state becomes `READY`. - // - // The returned long-running operation will - // have a name of the format - // `/operations/` and can be used to - // track creation of the instance partition. The - // metadata field type is - // [CreateInstancePartitionMetadata][google.spanner.admin.instance.v1.CreateInstancePartitionMetadata]. - // The response field type is - // [InstancePartition][google.spanner.admin.instance.v1.InstancePartition], if - // successful. - rpc CreateInstancePartition(CreateInstancePartitionRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/instances/*}/instancePartitions" - body: "*" - }; - option (google.api.method_signature) = - "parent,instance_partition,instance_partition_id"; - option (google.longrunning.operation_info) = { - response_type: "google.spanner.admin.instance.v1.InstancePartition" - metadata_type: "google.spanner.admin.instance.v1.CreateInstancePartitionMetadata" - }; - } - - // Deletes an existing instance partition. Requires that the - // instance partition is not used by any database or backup and is not the - // default instance partition of an instance. - // - // Authorization requires `spanner.instancePartitions.delete` permission on - // the resource - // [name][google.spanner.admin.instance.v1.InstancePartition.name]. - rpc DeleteInstancePartition(DeleteInstancePartitionRequest) - returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/instances/*/instancePartitions/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Updates an instance partition, and begins allocating or releasing resources - // as requested. The returned long-running operation can be used to track the - // progress of updating the instance partition. If the named instance - // partition does not exist, returns `NOT_FOUND`. - // - // Immediately upon completion of this request: - // - // * For resource types for which a decrease in the instance partition's - // allocation has been requested, billing is based on the newly-requested - // level. - // - // Until completion of the returned operation: - // - // * Cancelling the operation sets its metadata's - // [cancel_time][google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata.cancel_time], - // and begins restoring resources to their pre-request values. The - // operation is guaranteed to succeed at undoing all resource changes, - // after which point it terminates with a `CANCELLED` status. - // * All other attempts to modify the instance partition are rejected. - // * Reading the instance partition via the API continues to give the - // pre-request resource levels. - // - // Upon completion of the returned operation: - // - // * Billing begins for all successfully-allocated resources (some types - // may have lower than the requested levels). - // * All newly-reserved resources are available for serving the instance - // partition's tables. - // * The instance partition's new resource levels are readable via the API. - // - // The returned long-running operation will - // have a name of the format - // `/operations/` and can be used to - // track the instance partition modification. The - // metadata field type is - // [UpdateInstancePartitionMetadata][google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata]. - // The response field type is - // [InstancePartition][google.spanner.admin.instance.v1.InstancePartition], if - // successful. - // - // Authorization requires `spanner.instancePartitions.update` permission on - // the resource - // [name][google.spanner.admin.instance.v1.InstancePartition.name]. - rpc UpdateInstancePartition(UpdateInstancePartitionRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - patch: "/v1/{instance_partition.name=projects/*/instances/*/instancePartitions/*}" - body: "*" - }; - option (google.api.method_signature) = "instance_partition,field_mask"; - option (google.longrunning.operation_info) = { - response_type: "google.spanner.admin.instance.v1.InstancePartition" - metadata_type: "google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata" - }; - } - - // Lists instance partition long-running operations in the given instance. - // An instance partition operation has a name of the form - // `projects//instances//instancePartitions//operations/`. - // The long-running operation - // metadata field type - // `metadata.type_url` describes the type of the metadata. Operations returned - // include those that have completed/failed/canceled within the last 7 days, - // and pending operations. Operations returned are ordered by - // `operation.metadata.value.start_time` in descending order starting from the - // most recently started operation. - // - // Authorization requires `spanner.instancePartitionOperations.list` - // permission on the resource - // [parent][google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest.parent]. - rpc ListInstancePartitionOperations(ListInstancePartitionOperationsRequest) - returns (ListInstancePartitionOperationsResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/instances/*}/instancePartitionOperations" - }; - option (google.api.method_signature) = "parent"; - } - - // Moves an instance to the target instance configuration. You can use the - // returned long-running operation to track - // the progress of moving the instance. - // - // `MoveInstance` returns `FAILED_PRECONDITION` if the instance meets any of - // the following criteria: - // - // * Is undergoing a move to a different instance configuration - // * Has backups - // * Has an ongoing update - // * Contains any CMEK-enabled databases - // * Is a free trial instance - // - // While the operation is pending: - // - // * All other attempts to modify the instance, including changes to its - // compute capacity, are rejected. - // * The following database and backup admin operations are rejected: - // - // * `DatabaseAdmin.CreateDatabase` - // * `DatabaseAdmin.UpdateDatabaseDdl` (disabled if default_leader is - // specified in the request.) - // * `DatabaseAdmin.RestoreDatabase` - // * `DatabaseAdmin.CreateBackup` - // * `DatabaseAdmin.CopyBackup` - // - // * Both the source and target instance configurations are subject to - // hourly compute and storage charges. - // * The instance might experience higher read-write latencies and a higher - // transaction abort rate. However, moving an instance doesn't cause any - // downtime. - // - // The returned long-running operation has - // a name of the format - // `/operations/` and can be used to track - // the move instance operation. The - // metadata field type is - // [MoveInstanceMetadata][google.spanner.admin.instance.v1.MoveInstanceMetadata]. - // The response field type is - // [Instance][google.spanner.admin.instance.v1.Instance], - // if successful. - // Cancelling the operation sets its metadata's - // [cancel_time][google.spanner.admin.instance.v1.MoveInstanceMetadata.cancel_time]. - // Cancellation is not immediate because it involves moving any data - // previously moved to the target instance configuration back to the original - // instance configuration. You can use this operation to track the progress of - // the cancellation. Upon successful completion of the cancellation, the - // operation terminates with `CANCELLED` status. - // - // If not cancelled, upon completion of the returned operation: - // - // * The instance successfully moves to the target instance - // configuration. - // * You are billed for compute and storage in target instance - // configuration. - // - // Authorization requires the `spanner.instances.update` permission on - // the resource [instance][google.spanner.admin.instance.v1.Instance]. - // - // For more details, see - // [Move an instance](https://cloud.google.com/spanner/docs/move-instance). - rpc MoveInstance(MoveInstanceRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{name=projects/*/instances/*}:move" - body: "*" - }; - option (google.longrunning.operation_info) = { - response_type: "google.spanner.admin.instance.v1.MoveInstanceResponse" - metadata_type: "google.spanner.admin.instance.v1.MoveInstanceMetadata" - }; - } -} - -message ReplicaInfo { - // Indicates the type of replica. See the [replica types - // documentation](https://cloud.google.com/spanner/docs/replication#replica_types) - // for more details. - enum ReplicaType { - // Not specified. - TYPE_UNSPECIFIED = 0; - - // Read-write replicas support both reads and writes. These replicas: - // - // * Maintain a full copy of your data. - // * Serve reads. - // * Can vote whether to commit a write. - // * Participate in leadership election. - // * Are eligible to become a leader. - READ_WRITE = 1; - - // Read-only replicas only support reads (not writes). Read-only replicas: - // - // * Maintain a full copy of your data. - // * Serve reads. - // * Do not participate in voting to commit writes. - // * Are not eligible to become a leader. - READ_ONLY = 2; - - // Witness replicas don't support reads but do participate in voting to - // commit writes. Witness replicas: - // - // * Do not maintain a full copy of data. - // * Do not serve reads. - // * Vote whether to commit writes. - // * Participate in leader election but are not eligible to become leader. - WITNESS = 3; - } - - // The location of the serving resources, e.g., "us-central1". - string location = 1; - - // The type of replica. - ReplicaType type = 2; - - // If true, this location is designated as the default leader location where - // leader replicas are placed. See the [region types - // documentation](https://cloud.google.com/spanner/docs/instances#region_types) - // for more details. - bool default_leader_location = 3; -} - -// A possible configuration for a Cloud Spanner instance. Configurations -// define the geographic placement of nodes and their replication. -message InstanceConfig { - option (google.api.resource) = { - type: "spanner.googleapis.com/InstanceConfig" - pattern: "projects/{project}/instanceConfigs/{instance_config}" - plural: "instanceConfigs" - singular: "instanceConfig" - }; - - // The type of this configuration. - enum Type { - // Unspecified. - TYPE_UNSPECIFIED = 0; - - // Google-managed configuration. - GOOGLE_MANAGED = 1; - - // User-managed configuration. - USER_MANAGED = 2; - } - - // Indicates the current state of the instance configuration. - enum State { - // Not specified. - STATE_UNSPECIFIED = 0; - - // The instance configuration is still being created. - CREATING = 1; - - // The instance configuration is fully created and ready to be used to - // create instances. - READY = 2; - } - - // Describes the availability for free instances to be created in an instance - // configuration. - enum FreeInstanceAvailability { - // Not specified. - FREE_INSTANCE_AVAILABILITY_UNSPECIFIED = 0; - - // Indicates that free instances are available to be created in this - // instance configuration. - AVAILABLE = 1; - - // Indicates that free instances are not supported in this instance - // configuration. - UNSUPPORTED = 2; - - // Indicates that free instances are currently not available to be created - // in this instance configuration. - DISABLED = 3; - - // Indicates that additional free instances cannot be created in this - // instance configuration because the project has reached its limit of free - // instances. - QUOTA_EXCEEDED = 4; - } - - // Indicates the quorum type of this instance configuration. - enum QuorumType { - // Quorum type not specified. - QUORUM_TYPE_UNSPECIFIED = 0; - - // An instance configuration tagged with `REGION` quorum type forms a write - // quorum in a single region. - REGION = 1; - - // An instance configuration tagged with the `DUAL_REGION` quorum type forms - // a write quorum with exactly two read-write regions in a multi-region - // configuration. - // - // This instance configuration requires failover in the event of - // regional failures. - DUAL_REGION = 2; - - // An instance configuration tagged with the `MULTI_REGION` quorum type - // forms a write quorum from replicas that are spread across more than one - // region in a multi-region configuration. - MULTI_REGION = 3; - } - - // A unique identifier for the instance configuration. Values - // are of the form - // `projects//instanceConfigs/[a-z][-a-z0-9]*`. - // - // User instance configuration must start with `custom-`. - string name = 1; - - // The name of this instance configuration as it appears in UIs. - string display_name = 2; - - // Output only. Whether this instance configuration is a Google-managed or - // user-managed configuration. - Type config_type = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The geographic placement of nodes in this instance configuration and their - // replication properties. - // - // To create user-managed configurations, input - // `replicas` must include all replicas in `replicas` of the `base_config` - // and include one or more replicas in the `optional_replicas` of the - // `base_config`. - repeated ReplicaInfo replicas = 3; - - // Output only. The available optional replicas to choose from for - // user-managed configurations. Populated for Google-managed configurations. - repeated ReplicaInfo optional_replicas = 6 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Base configuration name, e.g. projects//instanceConfigs/nam3, - // based on which this configuration is created. Only set for user-managed - // configurations. `base_config` must refer to a configuration of type - // `GOOGLE_MANAGED` in the same project as this configuration. - string base_config = 7 [(google.api.resource_reference) = { - type: "spanner.googleapis.com/InstanceConfig" - }]; - - // Cloud Labels are a flexible and lightweight mechanism for organizing cloud - // resources into groups that reflect a customer's organizational needs and - // deployment strategies. Cloud Labels can be used to filter collections of - // resources. They can be used to control how resource metrics are aggregated. - // And they can be used as arguments to policy management rules (e.g. route, - // firewall, load balancing, etc.). - // - // * Label keys must be between 1 and 63 characters long and must conform to - // the following regular expression: `[a-z][a-z0-9_-]{0,62}`. - // * Label values must be between 0 and 63 characters long and must conform - // to the regular expression `[a-z0-9_-]{0,63}`. - // * No more than 64 labels can be associated with a given resource. - // - // See https://goo.gl/xmQnxf for more information on and examples of labels. - // - // If you plan to use labels in your own code, please note that additional - // characters may be allowed in the future. Therefore, you are advised to use - // an internal label representation, such as JSON, which doesn't rely upon - // specific characters being disallowed. For example, representing labels - // as the string: name + "_" + value would prove problematic if we were to - // allow "_" in a future release. - map labels = 8; - - // etag is used for optimistic concurrency control as a way - // to help prevent simultaneous updates of a instance configuration from - // overwriting each other. It is strongly suggested that systems make use of - // the etag in the read-modify-write cycle to perform instance configuration - // updates in order to avoid race conditions: An etag is returned in the - // response which contains instance configurations, and systems are expected - // to put that etag in the request to update instance configuration to ensure - // that their change is applied to the same version of the instance - // configuration. If no etag is provided in the call to update the instance - // configuration, then the existing instance configuration is overwritten - // blindly. - string etag = 9; - - // Allowed values of the "default_leader" schema option for databases in - // instances that use this instance configuration. - repeated string leader_options = 4; - - // Output only. If true, the instance configuration is being created or - // updated. If false, there are no ongoing operations for the instance - // configuration. - bool reconciling = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The current instance configuration state. Applicable only for - // `USER_MANAGED` configurations. - State state = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Describes whether free instances are available to be created - // in this instance configuration. - FreeInstanceAvailability free_instance_availability = 12 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The `QuorumType` of the instance configuration. - QuorumType quorum_type = 18 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The storage limit in bytes per processing unit. - int64 storage_limit_per_processing_unit = 19 - [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// ReplicaComputeCapacity describes the amount of server resources that are -// allocated to each replica identified by the replica selection. -message ReplicaComputeCapacity { - // Required. Identifies replicas by specified properties. - // All replicas in the selection have the same amount of compute capacity. - ReplicaSelection replica_selection = 1 - [(google.api.field_behavior) = REQUIRED]; - - // Compute capacity allocated to each replica identified by the specified - // selection. - // The unit is selected based on the unit used to specify the instance size - // for non-autoscaling instances, or the unit used in autoscaling limit for - // autoscaling instances. - oneof compute_capacity { - // The number of nodes allocated to each replica. - // - // This may be zero in API responses for instances that are not yet in - // state `READY`. - int32 node_count = 2; - - // The number of processing units allocated to each replica. - // - // This may be zero in API responses for instances that are not yet in - // state `READY`. - int32 processing_units = 3; - } -} - -// Autoscaling configuration for an instance. -message AutoscalingConfig { - // The autoscaling limits for the instance. Users can define the minimum and - // maximum compute capacity allocated to the instance, and the autoscaler will - // only scale within that range. Users can either use nodes or processing - // units to specify the limits, but should use the same unit to set both the - // min_limit and max_limit. - message AutoscalingLimits { - // The minimum compute capacity for the instance. - oneof min_limit { - // Minimum number of nodes allocated to the instance. If set, this number - // should be greater than or equal to 1. - int32 min_nodes = 1; - - // Minimum number of processing units allocated to the instance. If set, - // this number should be multiples of 1000. - int32 min_processing_units = 2; - } - - // The maximum compute capacity for the instance. The maximum compute - // capacity should be less than or equal to 10X the minimum compute - // capacity. - oneof max_limit { - // Maximum number of nodes allocated to the instance. If set, this number - // should be greater than or equal to min_nodes. - int32 max_nodes = 3; - - // Maximum number of processing units allocated to the instance. If set, - // this number should be multiples of 1000 and be greater than or equal to - // min_processing_units. - int32 max_processing_units = 4; - } - } - - // The autoscaling targets for an instance. - message AutoscalingTargets { - // Optional. The target high priority cpu utilization percentage that the - // autoscaler should be trying to achieve for the instance. This number is - // on a scale from 0 (no utilization) to 100 (full utilization). The valid - // range is [10, 90] inclusive. If not specified or set to 0, the autoscaler - // skips scaling based on high priority CPU utilization. - int32 high_priority_cpu_utilization_percent = 1 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The target total CPU utilization percentage that the autoscaler - // should be trying to achieve for the instance. This number is on a scale - // from 0 (no utilization) to 100 (full utilization). The valid range is - // [10, 90] inclusive. If not specified or set to 0, the autoscaler skips - // scaling based on total CPU utilization. If both - // `high_priority_cpu_utilization_percent` and - // `total_cpu_utilization_percent` are specified, the autoscaler provisions - // the larger of the two required compute capacities to satisfy both - // targets. - int32 total_cpu_utilization_percent = 4 - [(google.api.field_behavior) = OPTIONAL]; - - // Required. The target storage utilization percentage that the autoscaler - // should be trying to achieve for the instance. This number is on a scale - // from 0 (no utilization) to 100 (full utilization). The valid range is - // [10, 99] inclusive. - int32 storage_utilization_percent = 2 - [(google.api.field_behavior) = REQUIRED]; - } - - // AsymmetricAutoscalingOption specifies the scaling of replicas identified by - // the given selection. - message AsymmetricAutoscalingOption { - // Overrides the top-level autoscaling configuration for the replicas - // identified by `replica_selection`. All fields in this message are - // optional. Any unspecified fields will use the corresponding values from - // the top-level autoscaling configuration. - message AutoscalingConfigOverrides { - // Optional. If specified, overrides the min/max limit in the top-level - // autoscaling configuration for the selected replicas. - AutoscalingLimits autoscaling_limits = 1 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If specified, overrides the autoscaling target - // high_priority_cpu_utilization_percent in the top-level autoscaling - // configuration for the selected replicas. - int32 autoscaling_target_high_priority_cpu_utilization_percent = 2 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If specified, overrides the - // autoscaling target `total_cpu_utilization_percent` - // in the top-level autoscaling configuration for the selected replicas. - int32 autoscaling_target_total_cpu_utilization_percent = 4 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If true, disables high priority CPU autoscaling for the - // selected replicas and ignores - // [high_priority_cpu_utilization_percent][google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets.high_priority_cpu_utilization_percent] - // in the top-level autoscaling configuration. - // - // When setting this field to true, setting - // [autoscaling_target_high_priority_cpu_utilization_percent][google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides.autoscaling_target_high_priority_cpu_utilization_percent] - // field to a non-zero value for the same replica is not supported. - // - // If false, the - // [autoscaling_target_high_priority_cpu_utilization_percent][google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides.autoscaling_target_high_priority_cpu_utilization_percent] - // field in the replica will be used if set to a non-zero value. - // Otherwise, the - // [high_priority_cpu_utilization_percent][google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets.high_priority_cpu_utilization_percent] - // field in the top-level autoscaling configuration will be used. - // - // Setting both - // [disable_high_priority_cpu_autoscaling][google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides.disable_high_priority_cpu_autoscaling] - // and - // [disable_total_cpu_autoscaling][google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides.disable_total_cpu_autoscaling] - // to true for the same replica is not supported. - bool disable_high_priority_cpu_autoscaling = 5 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If true, disables total CPU autoscaling for the selected - // replicas and ignores - // [total_cpu_utilization_percent][google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets.total_cpu_utilization_percent] - // in the top-level autoscaling configuration. - // - // When setting this field to true, setting - // [autoscaling_target_total_cpu_utilization_percent][google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides.autoscaling_target_total_cpu_utilization_percent] - // field to a non-zero value for the same replica is not supported. - // - // If false, the - // [autoscaling_target_total_cpu_utilization_percent][google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides.autoscaling_target_total_cpu_utilization_percent] - // field in the replica will be used if set to a non-zero value. - // Otherwise, the - // [total_cpu_utilization_percent][google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets.total_cpu_utilization_percent] - // field in the top-level autoscaling configuration will be used. - // - // Setting both - // [disable_high_priority_cpu_autoscaling][google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides.disable_high_priority_cpu_autoscaling] - // and - // [disable_total_cpu_autoscaling][google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides.disable_total_cpu_autoscaling] - // to true for the same replica is not supported. - bool disable_total_cpu_autoscaling = 6 - [(google.api.field_behavior) = OPTIONAL]; - } - - // Required. Selects the replicas to which this AsymmetricAutoscalingOption - // applies. Only read-only replicas are supported. - ReplicaSelection replica_selection = 1 - [(google.api.field_behavior) = REQUIRED]; - - // Optional. Overrides applied to the top-level autoscaling configuration - // for the selected replicas. - AutoscalingConfigOverrides overrides = 2 - [(google.api.field_behavior) = OPTIONAL]; - } - - // Required. Autoscaling limits for an instance. - AutoscalingLimits autoscaling_limits = 1 - [(google.api.field_behavior) = REQUIRED]; - - // Required. The autoscaling targets for an instance. - AutoscalingTargets autoscaling_targets = 2 - [(google.api.field_behavior) = REQUIRED]; - - // Optional. Optional asymmetric autoscaling options. - // Replicas matching the replica selection criteria will be autoscaled - // independently from other replicas. The autoscaler will scale the replicas - // based on the utilization of replicas identified by the replica selection. - // Replica selections should not overlap with each other. - // - // Other replicas (those do not match any replica selection) will be - // autoscaled together and will have the same compute capacity allocated to - // them. - repeated AsymmetricAutoscalingOption asymmetric_autoscaling_options = 3 - [(google.api.field_behavior) = OPTIONAL]; -} - -// An isolated set of Cloud Spanner resources on which databases can be hosted. -message Instance { - option (google.api.resource) = { - type: "spanner.googleapis.com/Instance" - pattern: "projects/{project}/instances/{instance}" - plural: "instances" - singular: "instance" - }; - - // Indicates the current state of the instance. - enum State { - // Not specified. - STATE_UNSPECIFIED = 0; - - // The instance is still being created. Resources may not be - // available yet, and operations such as database creation may not - // work. - CREATING = 1; - - // The instance is fully created and ready to do work such as - // creating databases. - READY = 2; - } - - // The type of this instance. The type can be used to distinguish product - // variants, that can affect aspects like: usage restrictions, quotas and - // billing. Currently this is used to distinguish FREE_INSTANCE vs PROVISIONED - // instances. - enum InstanceType { - // Not specified. - INSTANCE_TYPE_UNSPECIFIED = 0; - - // Provisioned instances have dedicated resources, standard usage limits and - // support. - PROVISIONED = 1; - - // Free instances provide no guarantee for dedicated resources, - // [node_count, processing_units] should be 0. They come - // with stricter usage limits and limited support. - FREE_INSTANCE = 2; - } - - // The edition selected for this instance. Different editions provide - // different capabilities at different price points. - enum Edition { - // Edition not specified. - EDITION_UNSPECIFIED = 0; - - // Standard edition. - STANDARD = 1; - - // Enterprise edition. - ENTERPRISE = 2; - - // Enterprise Plus edition. - ENTERPRISE_PLUS = 3; - } - - // Indicates the - // [default backup - // schedule](https://cloud.google.com/spanner/docs/backup#default-backup-schedules) - // behavior for new databases within the instance. - enum DefaultBackupScheduleType { - // Not specified. - DEFAULT_BACKUP_SCHEDULE_TYPE_UNSPECIFIED = 0; - - // A default backup schedule isn't created automatically when a new database - // is created in the instance. - NONE = 1; - - // A default backup schedule is created automatically when a new database - // is created in the instance. The default backup schedule creates a full - // backup every 24 hours. These full backups are retained for 7 days. - // You can edit or delete the default backup schedule once it's created. - AUTOMATIC = 2; - } - - // Required. A unique identifier for the instance, which cannot be changed - // after the instance is created. Values are of the form - // `projects//instances/[a-z][-a-z0-9]*[a-z0-9]`. The final - // segment of the name must be between 2 and 64 characters in length. - string name = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The name of the instance's configuration. Values are of the form - // `projects//instanceConfigs/`. See - // also [InstanceConfig][google.spanner.admin.instance.v1.InstanceConfig] and - // [ListInstanceConfigs][google.spanner.admin.instance.v1.InstanceAdmin.ListInstanceConfigs]. - string config = 2 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "spanner.googleapis.com/InstanceConfig" - } - ]; - - // Required. The descriptive name for this instance as it appears in UIs. - // Must be unique per project and between 4 and 30 characters in length. - string display_name = 3 [(google.api.field_behavior) = REQUIRED]; - - // The number of nodes allocated to this instance. At most, one of either - // `node_count` or `processing_units` should be present in the message. - // - // Users can set the `node_count` field to specify the target number of nodes - // allocated to the instance. - // - // If autoscaling is enabled, `node_count` is treated as an `OUTPUT_ONLY` - // field and reflects the current number of nodes allocated to the instance. - // - // This might be zero in API responses for instances that are not yet in the - // `READY` state. - // - // - // For more information, see - // [Compute capacity, nodes, and processing - // units](https://cloud.google.com/spanner/docs/compute-capacity). - int32 node_count = 5; - - // The number of processing units allocated to this instance. At most, one of - // either `processing_units` or `node_count` should be present in the message. - // - // Users can set the `processing_units` field to specify the target number of - // processing units allocated to the instance. - // - // If autoscaling is enabled, `processing_units` is treated as an - // `OUTPUT_ONLY` field and reflects the current number of processing units - // allocated to the instance. - // - // This might be zero in API responses for instances that are not yet in the - // `READY` state. - // - // - // For more information, see - // [Compute capacity, nodes and processing - // units](https://cloud.google.com/spanner/docs/compute-capacity). - int32 processing_units = 9; - - // Output only. Lists the compute capacity per ReplicaSelection. A replica - // selection identifies a set of replicas with common properties. Replicas - // identified by a ReplicaSelection are scaled with the same compute capacity. - repeated ReplicaComputeCapacity replica_compute_capacity = 19 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. The autoscaling configuration. Autoscaling is enabled if this - // field is set. When autoscaling is enabled, node_count and processing_units - // are treated as OUTPUT_ONLY fields and reflect the current compute capacity - // allocated to the instance. - AutoscalingConfig autoscaling_config = 17 - [(google.api.field_behavior) = OPTIONAL]; - - // Output only. The current instance state. For - // [CreateInstance][google.spanner.admin.instance.v1.InstanceAdmin.CreateInstance], - // the state must be either omitted or set to `CREATING`. For - // [UpdateInstance][google.spanner.admin.instance.v1.InstanceAdmin.UpdateInstance], - // the state must be either omitted or set to `READY`. - State state = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Cloud Labels are a flexible and lightweight mechanism for organizing cloud - // resources into groups that reflect a customer's organizational needs and - // deployment strategies. Cloud Labels can be used to filter collections of - // resources. They can be used to control how resource metrics are aggregated. - // And they can be used as arguments to policy management rules (e.g. route, - // firewall, load balancing, etc.). - // - // * Label keys must be between 1 and 63 characters long and must conform to - // the following regular expression: `[a-z][a-z0-9_-]{0,62}`. - // * Label values must be between 0 and 63 characters long and must conform - // to the regular expression `[a-z0-9_-]{0,63}`. - // * No more than 64 labels can be associated with a given resource. - // - // See https://goo.gl/xmQnxf for more information on and examples of labels. - // - // If you plan to use labels in your own code, please note that additional - // characters may be allowed in the future. And so you are advised to use an - // internal label representation, such as JSON, which doesn't rely upon - // specific characters being disallowed. For example, representing labels - // as the string: name + "_" + value would prove problematic if we were to - // allow "_" in a future release. - map labels = 7; - - // The `InstanceType` of the current instance. - InstanceType instance_type = 10; - - // Deprecated. This field is not populated. - repeated string endpoint_uris = 8; - - // Output only. The time at which the instance was created. - google.protobuf.Timestamp create_time = 11 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The time at which the instance was most recently updated. - google.protobuf.Timestamp update_time = 12 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Free instance metadata. Only populated for free instances. - FreeInstanceMetadata free_instance_metadata = 13; - - // Optional. The `Edition` of the current instance. - Edition edition = 20 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Controls the default backup schedule behavior for new databases - // within the instance. By default, a backup schedule is created automatically - // when a new database is created in a new instance. - // - // Note that the `AUTOMATIC` value isn't permitted for free instances, - // as backups and backup schedules aren't supported for free instances. - // - // In the `GetInstance` or `ListInstances` response, if the value of - // `default_backup_schedule_type` isn't set, or set to `NONE`, Spanner doesn't - // create a default backup schedule for new databases in the instance. - DefaultBackupScheduleType default_backup_schedule_type = 23 - [(google.api.field_behavior) = OPTIONAL]; -} - -// The request for -// [ListInstanceConfigs][google.spanner.admin.instance.v1.InstanceAdmin.ListInstanceConfigs]. -message ListInstanceConfigsRequest { - // Required. The name of the project for which a list of supported instance - // configurations is requested. Values are of the form - // `projects/`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudresourcemanager.googleapis.com/Project" - } - ]; - - // Number of instance configurations to be returned in the response. If 0 or - // less, defaults to the server's maximum allowed page size. - int32 page_size = 2; - - // If non-empty, `page_token` should contain a - // [next_page_token][google.spanner.admin.instance.v1.ListInstanceConfigsResponse.next_page_token] - // from a previous - // [ListInstanceConfigsResponse][google.spanner.admin.instance.v1.ListInstanceConfigsResponse]. - string page_token = 3; -} - -// The response for -// [ListInstanceConfigs][google.spanner.admin.instance.v1.InstanceAdmin.ListInstanceConfigs]. -message ListInstanceConfigsResponse { - // The list of requested instance configurations. - repeated InstanceConfig instance_configs = 1; - - // `next_page_token` can be sent in a subsequent - // [ListInstanceConfigs][google.spanner.admin.instance.v1.InstanceAdmin.ListInstanceConfigs] - // call to fetch more of the matching instance configurations. - string next_page_token = 2; -} - -// The request for -// [GetInstanceConfigRequest][google.spanner.admin.instance.v1.InstanceAdmin.GetInstanceConfig]. -message GetInstanceConfigRequest { - // Required. The name of the requested instance configuration. Values are of - // the form `projects//instanceConfigs/`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "spanner.googleapis.com/InstanceConfig" - } - ]; -} - -// The request for -// [CreateInstanceConfig][google.spanner.admin.instance.v1.InstanceAdmin.CreateInstanceConfig]. -message CreateInstanceConfigRequest { - // Required. The name of the project in which to create the instance - // configuration. Values are of the form `projects/`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudresourcemanager.googleapis.com/Project" - } - ]; - - // Required. The ID of the instance configuration to create. Valid identifiers - // are of the form `custom-[-a-z0-9]*[a-z0-9]` and must be between 2 and 64 - // characters in length. The `custom-` prefix is required to avoid name - // conflicts with Google-managed configurations. - string instance_config_id = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The `InstanceConfig` proto of the configuration to create. - // `instance_config.name` must be - // `/instanceConfigs/`. - // `instance_config.base_config` must be a Google-managed configuration name, - // e.g. /instanceConfigs/us-east1, /instanceConfigs/nam3. - InstanceConfig instance_config = 3 [(google.api.field_behavior) = REQUIRED]; - - // An option to validate, but not actually execute, a request, - // and provide the same response. - bool validate_only = 4; -} - -// The request for -// [UpdateInstanceConfig][google.spanner.admin.instance.v1.InstanceAdmin.UpdateInstanceConfig]. -message UpdateInstanceConfigRequest { - // Required. The user instance configuration to update, which must always - // include the instance configuration name. Otherwise, only fields mentioned - // in - // [update_mask][google.spanner.admin.instance.v1.UpdateInstanceConfigRequest.update_mask] - // need be included. To prevent conflicts of concurrent updates, - // [etag][google.spanner.admin.instance.v1.InstanceConfig.reconciling] can - // be used. - InstanceConfig instance_config = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. A mask specifying which fields in - // [InstanceConfig][google.spanner.admin.instance.v1.InstanceConfig] should be - // updated. The field mask must always be specified; this prevents any future - // fields in [InstanceConfig][google.spanner.admin.instance.v1.InstanceConfig] - // from being erased accidentally by clients that do not know about them. Only - // display_name and labels can be updated. - google.protobuf.FieldMask update_mask = 2 - [(google.api.field_behavior) = REQUIRED]; - - // An option to validate, but not actually execute, a request, - // and provide the same response. - bool validate_only = 3; -} - -// The request for -// [DeleteInstanceConfig][google.spanner.admin.instance.v1.InstanceAdmin.DeleteInstanceConfig]. -message DeleteInstanceConfigRequest { - // Required. The name of the instance configuration to be deleted. - // Values are of the form - // `projects//instanceConfigs/` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "spanner.googleapis.com/InstanceConfig" - } - ]; - - // Used for optimistic concurrency control as a way to help prevent - // simultaneous deletes of an instance configuration from overwriting each - // other. If not empty, the API - // only deletes the instance configuration when the etag provided matches the - // current status of the requested instance configuration. Otherwise, deletes - // the instance configuration without checking the current status of the - // requested instance configuration. - string etag = 2; - - // An option to validate, but not actually execute, a request, - // and provide the same response. - bool validate_only = 3; -} - -// The request for -// [ListInstanceConfigOperations][google.spanner.admin.instance.v1.InstanceAdmin.ListInstanceConfigOperations]. -message ListInstanceConfigOperationsRequest { - // Required. The project of the instance configuration operations. - // Values are of the form `projects/`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudresourcemanager.googleapis.com/Project" - } - ]; - - // An expression that filters the list of returned operations. - // - // A filter expression consists of a field name, a - // comparison operator, and a value for filtering. - // The value must be a string, a number, or a boolean. The comparison operator - // must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. - // Colon `:` is the contains operator. Filter rules are not case sensitive. - // - // The following fields in the Operation are eligible for filtering: - // - // * `name` - The name of the long-running operation - // * `done` - False if the operation is in progress, else true. - // * `metadata.@type` - the type of metadata. For example, the type string - // for - // [CreateInstanceConfigMetadata][google.spanner.admin.instance.v1.CreateInstanceConfigMetadata] - // is - // `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstanceConfigMetadata`. - // * `metadata.` - any field in metadata.value. - // `metadata.@type` must be specified first, if filtering on metadata - // fields. - // * `error` - Error associated with the long-running operation. - // * `response.@type` - the type of response. - // * `response.` - any field in response.value. - // - // You can combine multiple expressions by enclosing each expression in - // parentheses. By default, expressions are combined with AND logic. However, - // you can specify AND, OR, and NOT logic explicitly. - // - // Here are a few examples: - // - // * `done:true` - The operation is complete. - // * `(metadata.@type=` \ - // `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstanceConfigMetadata) - // AND` \ - // `(metadata.instance_config.name:custom-config) AND` \ - // `(metadata.progress.start_time < \"2021-03-28T14:50:00Z\") AND` \ - // `(error:*)` - Return operations where: - // * The operation's metadata type is - // [CreateInstanceConfigMetadata][google.spanner.admin.instance.v1.CreateInstanceConfigMetadata]. - // * The instance configuration name contains "custom-config". - // * The operation started before 2021-03-28T14:50:00Z. - // * The operation resulted in an error. - string filter = 2; - - // Number of operations to be returned in the response. If 0 or - // less, defaults to the server's maximum allowed page size. - int32 page_size = 3; - - // If non-empty, `page_token` should contain a - // [next_page_token][google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse.next_page_token] - // from a previous - // [ListInstanceConfigOperationsResponse][google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse] - // to the same `parent` and with the same `filter`. - string page_token = 4; -} - -// The response for -// [ListInstanceConfigOperations][google.spanner.admin.instance.v1.InstanceAdmin.ListInstanceConfigOperations]. -message ListInstanceConfigOperationsResponse { - // The list of matching instance configuration long-running operations. Each - // operation's name will be - // prefixed by the name of the instance configuration. The operation's - // metadata field type - // `metadata.type_url` describes the type of the metadata. - repeated google.longrunning.Operation operations = 1; - - // `next_page_token` can be sent in a subsequent - // [ListInstanceConfigOperations][google.spanner.admin.instance.v1.InstanceAdmin.ListInstanceConfigOperations] - // call to fetch more of the matching metadata. - string next_page_token = 2; -} - -// The request for -// [GetInstance][google.spanner.admin.instance.v1.InstanceAdmin.GetInstance]. -message GetInstanceRequest { - // Required. The name of the requested instance. Values are of the form - // `projects//instances/`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "spanner.googleapis.com/Instance" - } - ]; - - // If field_mask is present, specifies the subset of - // [Instance][google.spanner.admin.instance.v1.Instance] fields that should be - // returned. If absent, all - // [Instance][google.spanner.admin.instance.v1.Instance] fields are returned. - google.protobuf.FieldMask field_mask = 2; -} - -// The request for -// [CreateInstance][google.spanner.admin.instance.v1.InstanceAdmin.CreateInstance]. -message CreateInstanceRequest { - // Required. The name of the project in which to create the instance. Values - // are of the form `projects/`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudresourcemanager.googleapis.com/Project" - } - ]; - - // Required. The ID of the instance to create. Valid identifiers are of the - // form `[a-z][-a-z0-9]*[a-z0-9]` and must be between 2 and 64 characters in - // length. - string instance_id = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The instance to create. The name may be omitted, but if - // specified must be `/instances/`. - Instance instance = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// The request for -// [ListInstances][google.spanner.admin.instance.v1.InstanceAdmin.ListInstances]. -message ListInstancesRequest { - // Required. The name of the project for which a list of instances is - // requested. Values are of the form `projects/`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudresourcemanager.googleapis.com/Project" - } - ]; - - // Number of instances to be returned in the response. If 0 or less, defaults - // to the server's maximum allowed page size. - int32 page_size = 2; - - // If non-empty, `page_token` should contain a - // [next_page_token][google.spanner.admin.instance.v1.ListInstancesResponse.next_page_token] - // from a previous - // [ListInstancesResponse][google.spanner.admin.instance.v1.ListInstancesResponse]. - string page_token = 3; - - // An expression for filtering the results of the request. Filter rules are - // case insensitive. The fields eligible for filtering are: - // - // * `name` - // * `display_name` - // * `labels.key` where key is the name of a label - // - // Some examples of using filters are: - // - // * `name:*` --> The instance has a name. - // * `name:Howl` --> The instance's name contains the string "howl". - // * `name:HOWL` --> Equivalent to above. - // * `NAME:howl` --> Equivalent to above. - // * `labels.env:*` --> The instance has the label "env". - // * `labels.env:dev` --> The instance has the label "env" and the value of - // the label contains the string "dev". - // * `name:howl labels.env:dev` --> The instance's name contains "howl" and - // it has the label "env" with its value - // containing "dev". - string filter = 4; - - // Deadline used while retrieving metadata for instances. - // Instances whose metadata cannot be retrieved within this deadline will be - // added to - // [unreachable][google.spanner.admin.instance.v1.ListInstancesResponse.unreachable] - // in - // [ListInstancesResponse][google.spanner.admin.instance.v1.ListInstancesResponse]. - google.protobuf.Timestamp instance_deadline = 5; -} - -// The response for -// [ListInstances][google.spanner.admin.instance.v1.InstanceAdmin.ListInstances]. -message ListInstancesResponse { - // The list of requested instances. - repeated Instance instances = 1; - - // `next_page_token` can be sent in a subsequent - // [ListInstances][google.spanner.admin.instance.v1.InstanceAdmin.ListInstances] - // call to fetch more of the matching instances. - string next_page_token = 2; - - // The list of unreachable instances. - // It includes the names of instances whose metadata could not be retrieved - // within - // [instance_deadline][google.spanner.admin.instance.v1.ListInstancesRequest.instance_deadline]. - repeated string unreachable = 3; -} - -// The request for -// [UpdateInstance][google.spanner.admin.instance.v1.InstanceAdmin.UpdateInstance]. -message UpdateInstanceRequest { - // Required. The instance to update, which must always include the instance - // name. Otherwise, only fields mentioned in - // [field_mask][google.spanner.admin.instance.v1.UpdateInstanceRequest.field_mask] - // need be included. - Instance instance = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. A mask specifying which fields in - // [Instance][google.spanner.admin.instance.v1.Instance] should be updated. - // The field mask must always be specified; this prevents any future fields in - // [Instance][google.spanner.admin.instance.v1.Instance] from being erased - // accidentally by clients that do not know about them. - google.protobuf.FieldMask field_mask = 2 - [(google.api.field_behavior) = REQUIRED]; -} - -// The request for -// [DeleteInstance][google.spanner.admin.instance.v1.InstanceAdmin.DeleteInstance]. -message DeleteInstanceRequest { - // Required. The name of the instance to be deleted. Values are of the form - // `projects//instances/` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "spanner.googleapis.com/Instance" - } - ]; -} - -// Metadata type for the operation returned by -// [CreateInstance][google.spanner.admin.instance.v1.InstanceAdmin.CreateInstance]. -message CreateInstanceMetadata { - // The instance being created. - Instance instance = 1; - - // The time at which the - // [CreateInstance][google.spanner.admin.instance.v1.InstanceAdmin.CreateInstance] - // request was received. - google.protobuf.Timestamp start_time = 2; - - // The time at which this operation was cancelled. If set, this operation is - // in the process of undoing itself (which is guaranteed to succeed) and - // cannot be cancelled again. - google.protobuf.Timestamp cancel_time = 3; - - // The time at which this operation failed or was completed successfully. - google.protobuf.Timestamp end_time = 4; - - // The expected fulfillment period of this create operation. - FulfillmentPeriod expected_fulfillment_period = 5; -} - -// Metadata type for the operation returned by -// [UpdateInstance][google.spanner.admin.instance.v1.InstanceAdmin.UpdateInstance]. -message UpdateInstanceMetadata { - // The desired end state of the update. - Instance instance = 1; - - // The time at which - // [UpdateInstance][google.spanner.admin.instance.v1.InstanceAdmin.UpdateInstance] - // request was received. - google.protobuf.Timestamp start_time = 2; - - // The time at which this operation was cancelled. If set, this operation is - // in the process of undoing itself (which is guaranteed to succeed) and - // cannot be cancelled again. - google.protobuf.Timestamp cancel_time = 3; - - // The time at which this operation failed or was completed successfully. - google.protobuf.Timestamp end_time = 4; - - // The expected fulfillment period of this update operation. - FulfillmentPeriod expected_fulfillment_period = 5; -} - -// Free instance specific metadata that is kept even after an instance has been -// upgraded for tracking purposes. -message FreeInstanceMetadata { - // Allows users to change behavior when a free instance expires. - enum ExpireBehavior { - // Not specified. - EXPIRE_BEHAVIOR_UNSPECIFIED = 0; - - // When the free instance expires, upgrade the instance to a provisioned - // instance. - FREE_TO_PROVISIONED = 1; - - // When the free instance expires, disable the instance, and delete it - // after the grace period passes if it has not been upgraded. - REMOVE_AFTER_GRACE_PERIOD = 2; - } - - // Output only. Timestamp after which the instance will either be upgraded or - // scheduled for deletion after a grace period. ExpireBehavior is used to - // choose between upgrading or scheduling the free instance for deletion. This - // timestamp is set during the creation of a free instance. - google.protobuf.Timestamp expire_time = 1 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. If present, the timestamp at which the free instance was - // upgraded to a provisioned instance. - google.protobuf.Timestamp upgrade_time = 2 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Specifies the expiration behavior of a free instance. The default of - // ExpireBehavior is `REMOVE_AFTER_GRACE_PERIOD`. This can be modified during - // or after creation, and before expiration. - ExpireBehavior expire_behavior = 3; -} - -// Metadata type for the operation returned by -// [CreateInstanceConfig][google.spanner.admin.instance.v1.InstanceAdmin.CreateInstanceConfig]. -message CreateInstanceConfigMetadata { - // The target instance configuration end state. - InstanceConfig instance_config = 1; - - // The progress of the - // [CreateInstanceConfig][google.spanner.admin.instance.v1.InstanceAdmin.CreateInstanceConfig] - // operation. - OperationProgress progress = 2; - - // The time at which this operation was cancelled. - google.protobuf.Timestamp cancel_time = 3; -} - -// Metadata type for the operation returned by -// [UpdateInstanceConfig][google.spanner.admin.instance.v1.InstanceAdmin.UpdateInstanceConfig]. -message UpdateInstanceConfigMetadata { - // The desired instance configuration after updating. - InstanceConfig instance_config = 1; - - // The progress of the - // [UpdateInstanceConfig][google.spanner.admin.instance.v1.InstanceAdmin.UpdateInstanceConfig] - // operation. - OperationProgress progress = 2; - - // The time at which this operation was cancelled. - google.protobuf.Timestamp cancel_time = 3; -} - -// An isolated set of Cloud Spanner resources that databases can define -// placements on. -message InstancePartition { - option (google.api.resource) = { - type: "spanner.googleapis.com/InstancePartition" - pattern: "projects/{project}/instances/{instance}/instancePartitions/{instance_partition}" - plural: "instancePartitions" - singular: "instancePartition" - }; - - // Indicates the current state of the instance partition. - enum State { - // Not specified. - STATE_UNSPECIFIED = 0; - - // The instance partition is still being created. Resources may not be - // available yet, and operations such as creating placements using this - // instance partition may not work. - CREATING = 1; - - // The instance partition is fully created and ready to do work such as - // creating placements and using in databases. - READY = 2; - } - - // Required. A unique identifier for the instance partition. Values are of the - // form - // `projects//instances//instancePartitions/[a-z][-a-z0-9]*[a-z0-9]`. - // The final segment of the name must be between 2 and 64 characters in - // length. An instance partition's name cannot be changed after the instance - // partition is created. - string name = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The name of the instance partition's configuration. Values are of - // the form `projects//instanceConfigs/`. See also - // [InstanceConfig][google.spanner.admin.instance.v1.InstanceConfig] and - // [ListInstanceConfigs][google.spanner.admin.instance.v1.InstanceAdmin.ListInstanceConfigs]. - string config = 2 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "spanner.googleapis.com/InstanceConfig" - } - ]; - - // Required. The descriptive name for this instance partition as it appears in - // UIs. Must be unique per project and between 4 and 30 characters in length. - string display_name = 3 [(google.api.field_behavior) = REQUIRED]; - - // Compute capacity defines amount of server and storage resources that are - // available to the databases in an instance partition. At most, one of either - // `node_count` or` processing_units` should be present in the message. For - // more information, see - // [Compute capacity, nodes, and processing - // units](https://cloud.google.com/spanner/docs/compute-capacity). - oneof compute_capacity { - // The number of nodes allocated to this instance partition. - // - // Users can set the `node_count` field to specify the target number of - // nodes allocated to the instance partition. - // - // This may be zero in API responses for instance partitions that are not - // yet in state `READY`. - int32 node_count = 5; - - // The number of processing units allocated to this instance partition. - // - // Users can set the `processing_units` field to specify the target number - // of processing units allocated to the instance partition. - // - // This might be zero in API responses for instance partitions that are not - // yet in the `READY` state. - int32 processing_units = 6; - } - - // Optional. The autoscaling configuration. Autoscaling is enabled if this - // field is set. When autoscaling is enabled, fields in compute_capacity are - // treated as OUTPUT_ONLY fields and reflect the current compute capacity - // allocated to the instance partition. - AutoscalingConfig autoscaling_config = 13 - [(google.api.field_behavior) = OPTIONAL]; - - // Output only. The current instance partition state. - State state = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The time at which the instance partition was created. - google.protobuf.Timestamp create_time = 8 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The time at which the instance partition was most recently - // updated. - google.protobuf.Timestamp update_time = 9 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The names of the databases that reference this - // instance partition. Referencing databases should share the parent instance. - // The existence of any referencing database prevents the instance partition - // from being deleted. - repeated string referencing_databases = 10 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Deprecated: This field is not populated. - // Output only. The names of the backups that reference this instance - // partition. Referencing backups should share the parent instance. The - // existence of any referencing backup prevents the instance partition from - // being deleted. - repeated string referencing_backups = 11 - [deprecated = true, (google.api.field_behavior) = OUTPUT_ONLY]; - - // Used for optimistic concurrency control as a way - // to help prevent simultaneous updates of a instance partition from - // overwriting each other. It is strongly suggested that systems make use of - // the etag in the read-modify-write cycle to perform instance partition - // updates in order to avoid race conditions: An etag is returned in the - // response which contains instance partitions, and systems are expected to - // put that etag in the request to update instance partitions to ensure that - // their change will be applied to the same version of the instance partition. - // If no etag is provided in the call to update instance partition, then the - // existing instance partition is overwritten blindly. - string etag = 12; -} - -// Metadata type for the operation returned by -// [CreateInstancePartition][google.spanner.admin.instance.v1.InstanceAdmin.CreateInstancePartition]. -message CreateInstancePartitionMetadata { - // The instance partition being created. - InstancePartition instance_partition = 1; - - // The time at which the - // [CreateInstancePartition][google.spanner.admin.instance.v1.InstanceAdmin.CreateInstancePartition] - // request was received. - google.protobuf.Timestamp start_time = 2; - - // The time at which this operation was cancelled. If set, this operation is - // in the process of undoing itself (which is guaranteed to succeed) and - // cannot be cancelled again. - google.protobuf.Timestamp cancel_time = 3; - - // The time at which this operation failed or was completed successfully. - google.protobuf.Timestamp end_time = 4; -} - -// The request for -// [CreateInstancePartition][google.spanner.admin.instance.v1.InstanceAdmin.CreateInstancePartition]. -message CreateInstancePartitionRequest { - // Required. The name of the instance in which to create the instance - // partition. Values are of the form - // `projects//instances/`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "spanner.googleapis.com/Instance" - } - ]; - - // Required. The ID of the instance partition to create. Valid identifiers are - // of the form `[a-z][-a-z0-9]*[a-z0-9]` and must be between 2 and 64 - // characters in length. - string instance_partition_id = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The instance partition to create. The instance_partition.name may - // be omitted, but if specified must be - // `/instancePartitions/`. - InstancePartition instance_partition = 3 - [(google.api.field_behavior) = REQUIRED]; -} - -// The request for -// [DeleteInstancePartition][google.spanner.admin.instance.v1.InstanceAdmin.DeleteInstancePartition]. -message DeleteInstancePartitionRequest { - // Required. The name of the instance partition to be deleted. - // Values are of the form - // `projects/{project}/instances/{instance}/instancePartitions/{instance_partition}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "spanner.googleapis.com/InstancePartition" - } - ]; - - // Optional. If not empty, the API only deletes the instance partition when - // the etag provided matches the current status of the requested instance - // partition. Otherwise, deletes the instance partition without checking the - // current status of the requested instance partition. - string etag = 2; -} - -// The request for -// [GetInstancePartition][google.spanner.admin.instance.v1.InstanceAdmin.GetInstancePartition]. -message GetInstancePartitionRequest { - // Required. The name of the requested instance partition. Values are of - // the form - // `projects/{project}/instances/{instance}/instancePartitions/{instance_partition}`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "spanner.googleapis.com/InstancePartition" - } - ]; -} - -// The request for -// [UpdateInstancePartition][google.spanner.admin.instance.v1.InstanceAdmin.UpdateInstancePartition]. -message UpdateInstancePartitionRequest { - // Required. The instance partition to update, which must always include the - // instance partition name. Otherwise, only fields mentioned in - // [field_mask][google.spanner.admin.instance.v1.UpdateInstancePartitionRequest.field_mask] - // need be included. - InstancePartition instance_partition = 1 - [(google.api.field_behavior) = REQUIRED]; - - // Required. A mask specifying which fields in - // [InstancePartition][google.spanner.admin.instance.v1.InstancePartition] - // should be updated. The field mask must always be specified; this prevents - // any future fields in - // [InstancePartition][google.spanner.admin.instance.v1.InstancePartition] - // from being erased accidentally by clients that do not know about them. - google.protobuf.FieldMask field_mask = 2 - [(google.api.field_behavior) = REQUIRED]; -} - -// Metadata type for the operation returned by -// [UpdateInstancePartition][google.spanner.admin.instance.v1.InstanceAdmin.UpdateInstancePartition]. -message UpdateInstancePartitionMetadata { - // The desired end state of the update. - InstancePartition instance_partition = 1; - - // The time at which - // [UpdateInstancePartition][google.spanner.admin.instance.v1.InstanceAdmin.UpdateInstancePartition] - // request was received. - google.protobuf.Timestamp start_time = 2; - - // The time at which this operation was cancelled. If set, this operation is - // in the process of undoing itself (which is guaranteed to succeed) and - // cannot be cancelled again. - google.protobuf.Timestamp cancel_time = 3; - - // The time at which this operation failed or was completed successfully. - google.protobuf.Timestamp end_time = 4; -} - -// The request for -// [ListInstancePartitions][google.spanner.admin.instance.v1.InstanceAdmin.ListInstancePartitions]. -message ListInstancePartitionsRequest { - // Required. The instance whose instance partitions should be listed. Values - // are of the form `projects//instances/`. Use `{instance} - // = '-'` to list instance partitions for all Instances in a project, e.g., - // `projects/myproject/instances/-`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "spanner.googleapis.com/Instance" - } - ]; - - // Number of instance partitions to be returned in the response. If 0 or less, - // defaults to the server's maximum allowed page size. - int32 page_size = 2; - - // If non-empty, `page_token` should contain a - // [next_page_token][google.spanner.admin.instance.v1.ListInstancePartitionsResponse.next_page_token] - // from a previous - // [ListInstancePartitionsResponse][google.spanner.admin.instance.v1.ListInstancePartitionsResponse]. - string page_token = 3; - - // Optional. Deadline used while retrieving metadata for instance partitions. - // Instance partitions whose metadata cannot be retrieved within this deadline - // will be added to - // [unreachable][google.spanner.admin.instance.v1.ListInstancePartitionsResponse.unreachable] - // in - // [ListInstancePartitionsResponse][google.spanner.admin.instance.v1.ListInstancePartitionsResponse]. - google.protobuf.Timestamp instance_partition_deadline = 4 - [(google.api.field_behavior) = OPTIONAL]; -} - -// The response for -// [ListInstancePartitions][google.spanner.admin.instance.v1.InstanceAdmin.ListInstancePartitions]. -message ListInstancePartitionsResponse { - // The list of requested instancePartitions. - repeated InstancePartition instance_partitions = 1; - - // `next_page_token` can be sent in a subsequent - // [ListInstancePartitions][google.spanner.admin.instance.v1.InstanceAdmin.ListInstancePartitions] - // call to fetch more of the matching instance partitions. - string next_page_token = 2; - - // The list of unreachable instances or instance partitions. - // It includes the names of instances or instance partitions whose metadata - // could not be retrieved within - // [instance_partition_deadline][google.spanner.admin.instance.v1.ListInstancePartitionsRequest.instance_partition_deadline]. - repeated string unreachable = 3; -} - -// The request for -// [ListInstancePartitionOperations][google.spanner.admin.instance.v1.InstanceAdmin.ListInstancePartitionOperations]. -message ListInstancePartitionOperationsRequest { - // Required. The parent instance of the instance partition operations. - // Values are of the form `projects//instances/`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "spanner.googleapis.com/Instance" - } - ]; - - // Optional. An expression that filters the list of returned operations. - // - // A filter expression consists of a field name, a - // comparison operator, and a value for filtering. - // The value must be a string, a number, or a boolean. The comparison operator - // must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. - // Colon `:` is the contains operator. Filter rules are not case sensitive. - // - // The following fields in the Operation are eligible for filtering: - // - // * `name` - The name of the long-running operation - // * `done` - False if the operation is in progress, else true. - // * `metadata.@type` - the type of metadata. For example, the type string - // for - // [CreateInstancePartitionMetadata][google.spanner.admin.instance.v1.CreateInstancePartitionMetadata] - // is - // `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstancePartitionMetadata`. - // * `metadata.` - any field in metadata.value. - // `metadata.@type` must be specified first, if filtering on metadata - // fields. - // * `error` - Error associated with the long-running operation. - // * `response.@type` - the type of response. - // * `response.` - any field in response.value. - // - // You can combine multiple expressions by enclosing each expression in - // parentheses. By default, expressions are combined with AND logic. However, - // you can specify AND, OR, and NOT logic explicitly. - // - // Here are a few examples: - // - // * `done:true` - The operation is complete. - // * `(metadata.@type=` \ - // `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstancePartitionMetadata) - // AND` \ - // `(metadata.instance_partition.name:custom-instance-partition) AND` \ - // `(metadata.start_time < \"2021-03-28T14:50:00Z\") AND` \ - // `(error:*)` - Return operations where: - // * The operation's metadata type is - // [CreateInstancePartitionMetadata][google.spanner.admin.instance.v1.CreateInstancePartitionMetadata]. - // * The instance partition name contains "custom-instance-partition". - // * The operation started before 2021-03-28T14:50:00Z. - // * The operation resulted in an error. - string filter = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Number of operations to be returned in the response. If 0 or - // less, defaults to the server's maximum allowed page size. - int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If non-empty, `page_token` should contain a - // [next_page_token][google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse.next_page_token] - // from a previous - // [ListInstancePartitionOperationsResponse][google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse] - // to the same `parent` and with the same `filter`. - string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Deadline used while retrieving metadata for instance partition - // operations. Instance partitions whose operation metadata cannot be - // retrieved within this deadline will be added to - // [unreachable_instance_partitions][google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse.unreachable_instance_partitions] - // in - // [ListInstancePartitionOperationsResponse][google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse]. - google.protobuf.Timestamp instance_partition_deadline = 5 - [(google.api.field_behavior) = OPTIONAL]; -} - -// The response for -// [ListInstancePartitionOperations][google.spanner.admin.instance.v1.InstanceAdmin.ListInstancePartitionOperations]. -message ListInstancePartitionOperationsResponse { - // The list of matching instance partition long-running operations. Each - // operation's name will be - // prefixed by the instance partition's name. The operation's - // metadata field type - // `metadata.type_url` describes the type of the metadata. - repeated google.longrunning.Operation operations = 1; - - // `next_page_token` can be sent in a subsequent - // [ListInstancePartitionOperations][google.spanner.admin.instance.v1.InstanceAdmin.ListInstancePartitionOperations] - // call to fetch more of the matching metadata. - string next_page_token = 2; - - // The list of unreachable instance partitions. - // It includes the names of instance partitions whose operation metadata could - // not be retrieved within - // [instance_partition_deadline][google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest.instance_partition_deadline]. - repeated string unreachable_instance_partitions = 3; -} - -// The request for -// [MoveInstance][google.spanner.admin.instance.v1.InstanceAdmin.MoveInstance]. -message MoveInstanceRequest { - // Required. The instance to move. - // Values are of the form `projects//instances/`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "spanner.googleapis.com/Instance" - } - ]; - - // Required. The target instance configuration where to move the instance. - // Values are of the form `projects//instanceConfigs/`. - string target_config = 2 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "spanner.googleapis.com/InstanceConfig" - } - ]; -} - -// The response for -// [MoveInstance][google.spanner.admin.instance.v1.InstanceAdmin.MoveInstance]. -message MoveInstanceResponse {} - -// Metadata type for the operation returned by -// [MoveInstance][google.spanner.admin.instance.v1.InstanceAdmin.MoveInstance]. -message MoveInstanceMetadata { - // The target instance configuration where to move the instance. - // Values are of the form `projects//instanceConfigs/`. - string target_config = 1; - - // The progress of the - // [MoveInstance][google.spanner.admin.instance.v1.InstanceAdmin.MoveInstance] - // operation. - // [progress_percent][google.spanner.admin.instance.v1.OperationProgress.progress_percent] - // is reset when cancellation is requested. - OperationProgress progress = 2; - - // The time at which this operation was cancelled. - google.protobuf.Timestamp cancel_time = 3; -} diff --git a/owl-bot-staging/admin/instance/v1/protos/protos.d.ts b/owl-bot-staging/admin/instance/v1/protos/protos.d.ts deleted file mode 100644 index 3610433c9..000000000 --- a/owl-bot-staging/admin/instance/v1/protos/protos.d.ts +++ /dev/null @@ -1,14931 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -import type {protobuf as $protobuf} from "google-gax"; -import Long = require("long"); -/** Namespace google. */ -export namespace google { - - /** Namespace spanner. */ - namespace spanner { - - /** Namespace admin. */ - namespace admin { - - /** Namespace instance. */ - namespace instance { - - /** Namespace v1. */ - namespace v1 { - - /** Properties of an OperationProgress. */ - interface IOperationProgress { - - /** OperationProgress progressPercent */ - progressPercent?: (number|null); - - /** OperationProgress startTime */ - startTime?: (google.protobuf.ITimestamp|null); - - /** OperationProgress endTime */ - endTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents an OperationProgress. */ - class OperationProgress implements IOperationProgress { - - /** - * Constructs a new OperationProgress. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.instance.v1.IOperationProgress); - - /** OperationProgress progressPercent. */ - public progressPercent: number; - - /** OperationProgress startTime. */ - public startTime?: (google.protobuf.ITimestamp|null); - - /** OperationProgress endTime. */ - public endTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new OperationProgress instance using the specified properties. - * @param [properties] Properties to set - * @returns OperationProgress instance - */ - public static create(properties?: google.spanner.admin.instance.v1.IOperationProgress): google.spanner.admin.instance.v1.OperationProgress; - - /** - * Encodes the specified OperationProgress message. Does not implicitly {@link google.spanner.admin.instance.v1.OperationProgress.verify|verify} messages. - * @param message OperationProgress message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.instance.v1.IOperationProgress, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OperationProgress message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.OperationProgress.verify|verify} messages. - * @param message OperationProgress message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.instance.v1.IOperationProgress, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OperationProgress message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OperationProgress - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.OperationProgress; - - /** - * Decodes an OperationProgress message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OperationProgress - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.OperationProgress; - - /** - * Verifies an OperationProgress message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an OperationProgress message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OperationProgress - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.OperationProgress; - - /** - * Creates a plain object from an OperationProgress message. Also converts values to other types if specified. - * @param message OperationProgress - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.instance.v1.OperationProgress, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OperationProgress to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for OperationProgress - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** FulfillmentPeriod enum. */ - enum FulfillmentPeriod { - FULFILLMENT_PERIOD_UNSPECIFIED = 0, - FULFILLMENT_PERIOD_NORMAL = 1, - FULFILLMENT_PERIOD_EXTENDED = 2 - } - - /** Properties of a ReplicaSelection. */ - interface IReplicaSelection { - - /** ReplicaSelection location */ - location?: (string|null); - } - - /** Represents a ReplicaSelection. */ - class ReplicaSelection implements IReplicaSelection { - - /** - * Constructs a new ReplicaSelection. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.instance.v1.IReplicaSelection); - - /** ReplicaSelection location. */ - public location: string; - - /** - * Creates a new ReplicaSelection instance using the specified properties. - * @param [properties] Properties to set - * @returns ReplicaSelection instance - */ - public static create(properties?: google.spanner.admin.instance.v1.IReplicaSelection): google.spanner.admin.instance.v1.ReplicaSelection; - - /** - * Encodes the specified ReplicaSelection message. Does not implicitly {@link google.spanner.admin.instance.v1.ReplicaSelection.verify|verify} messages. - * @param message ReplicaSelection message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.instance.v1.IReplicaSelection, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ReplicaSelection message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ReplicaSelection.verify|verify} messages. - * @param message ReplicaSelection message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.instance.v1.IReplicaSelection, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ReplicaSelection message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ReplicaSelection - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.ReplicaSelection; - - /** - * Decodes a ReplicaSelection message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ReplicaSelection - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.ReplicaSelection; - - /** - * Verifies a ReplicaSelection message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ReplicaSelection message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ReplicaSelection - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.ReplicaSelection; - - /** - * Creates a plain object from a ReplicaSelection message. Also converts values to other types if specified. - * @param message ReplicaSelection - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.instance.v1.ReplicaSelection, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ReplicaSelection to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ReplicaSelection - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Represents an InstanceAdmin */ - class InstanceAdmin extends $protobuf.rpc.Service { - - /** - * Constructs a new InstanceAdmin service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - - /** - * Creates new InstanceAdmin 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): InstanceAdmin; - - /** - * Calls ListInstanceConfigs. - * @param request ListInstanceConfigsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListInstanceConfigsResponse - */ - public listInstanceConfigs(request: google.spanner.admin.instance.v1.IListInstanceConfigsRequest, callback: google.spanner.admin.instance.v1.InstanceAdmin.ListInstanceConfigsCallback): void; - - /** - * Calls ListInstanceConfigs. - * @param request ListInstanceConfigsRequest message or plain object - * @returns Promise - */ - public listInstanceConfigs(request: google.spanner.admin.instance.v1.IListInstanceConfigsRequest): Promise; - - /** - * Calls GetInstanceConfig. - * @param request GetInstanceConfigRequest message or plain object - * @param callback Node-style callback called with the error, if any, and InstanceConfig - */ - public getInstanceConfig(request: google.spanner.admin.instance.v1.IGetInstanceConfigRequest, callback: google.spanner.admin.instance.v1.InstanceAdmin.GetInstanceConfigCallback): void; - - /** - * Calls GetInstanceConfig. - * @param request GetInstanceConfigRequest message or plain object - * @returns Promise - */ - public getInstanceConfig(request: google.spanner.admin.instance.v1.IGetInstanceConfigRequest): Promise; - - /** - * Calls CreateInstanceConfig. - * @param request CreateInstanceConfigRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public createInstanceConfig(request: google.spanner.admin.instance.v1.ICreateInstanceConfigRequest, callback: google.spanner.admin.instance.v1.InstanceAdmin.CreateInstanceConfigCallback): void; - - /** - * Calls CreateInstanceConfig. - * @param request CreateInstanceConfigRequest message or plain object - * @returns Promise - */ - public createInstanceConfig(request: google.spanner.admin.instance.v1.ICreateInstanceConfigRequest): Promise; - - /** - * Calls UpdateInstanceConfig. - * @param request UpdateInstanceConfigRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public updateInstanceConfig(request: google.spanner.admin.instance.v1.IUpdateInstanceConfigRequest, callback: google.spanner.admin.instance.v1.InstanceAdmin.UpdateInstanceConfigCallback): void; - - /** - * Calls UpdateInstanceConfig. - * @param request UpdateInstanceConfigRequest message or plain object - * @returns Promise - */ - public updateInstanceConfig(request: google.spanner.admin.instance.v1.IUpdateInstanceConfigRequest): Promise; - - /** - * Calls DeleteInstanceConfig. - * @param request DeleteInstanceConfigRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteInstanceConfig(request: google.spanner.admin.instance.v1.IDeleteInstanceConfigRequest, callback: google.spanner.admin.instance.v1.InstanceAdmin.DeleteInstanceConfigCallback): void; - - /** - * Calls DeleteInstanceConfig. - * @param request DeleteInstanceConfigRequest message or plain object - * @returns Promise - */ - public deleteInstanceConfig(request: google.spanner.admin.instance.v1.IDeleteInstanceConfigRequest): Promise; - - /** - * Calls ListInstanceConfigOperations. - * @param request ListInstanceConfigOperationsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListInstanceConfigOperationsResponse - */ - public listInstanceConfigOperations(request: google.spanner.admin.instance.v1.IListInstanceConfigOperationsRequest, callback: google.spanner.admin.instance.v1.InstanceAdmin.ListInstanceConfigOperationsCallback): void; - - /** - * Calls ListInstanceConfigOperations. - * @param request ListInstanceConfigOperationsRequest message or plain object - * @returns Promise - */ - public listInstanceConfigOperations(request: google.spanner.admin.instance.v1.IListInstanceConfigOperationsRequest): Promise; - - /** - * Calls ListInstances. - * @param request ListInstancesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListInstancesResponse - */ - public listInstances(request: google.spanner.admin.instance.v1.IListInstancesRequest, callback: google.spanner.admin.instance.v1.InstanceAdmin.ListInstancesCallback): void; - - /** - * Calls ListInstances. - * @param request ListInstancesRequest message or plain object - * @returns Promise - */ - public listInstances(request: google.spanner.admin.instance.v1.IListInstancesRequest): Promise; - - /** - * Calls ListInstancePartitions. - * @param request ListInstancePartitionsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListInstancePartitionsResponse - */ - public listInstancePartitions(request: google.spanner.admin.instance.v1.IListInstancePartitionsRequest, callback: google.spanner.admin.instance.v1.InstanceAdmin.ListInstancePartitionsCallback): void; - - /** - * Calls ListInstancePartitions. - * @param request ListInstancePartitionsRequest message or plain object - * @returns Promise - */ - public listInstancePartitions(request: google.spanner.admin.instance.v1.IListInstancePartitionsRequest): Promise; - - /** - * Calls GetInstance. - * @param request GetInstanceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Instance - */ - public getInstance(request: google.spanner.admin.instance.v1.IGetInstanceRequest, callback: google.spanner.admin.instance.v1.InstanceAdmin.GetInstanceCallback): void; - - /** - * Calls GetInstance. - * @param request GetInstanceRequest message or plain object - * @returns Promise - */ - public getInstance(request: google.spanner.admin.instance.v1.IGetInstanceRequest): Promise; - - /** - * 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.spanner.admin.instance.v1.ICreateInstanceRequest, callback: google.spanner.admin.instance.v1.InstanceAdmin.CreateInstanceCallback): void; - - /** - * Calls CreateInstance. - * @param request CreateInstanceRequest message or plain object - * @returns Promise - */ - public createInstance(request: google.spanner.admin.instance.v1.ICreateInstanceRequest): Promise; - - /** - * Calls UpdateInstance. - * @param request UpdateInstanceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public updateInstance(request: google.spanner.admin.instance.v1.IUpdateInstanceRequest, callback: google.spanner.admin.instance.v1.InstanceAdmin.UpdateInstanceCallback): void; - - /** - * Calls UpdateInstance. - * @param request UpdateInstanceRequest message or plain object - * @returns Promise - */ - public updateInstance(request: google.spanner.admin.instance.v1.IUpdateInstanceRequest): Promise; - - /** - * Calls DeleteInstance. - * @param request DeleteInstanceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteInstance(request: google.spanner.admin.instance.v1.IDeleteInstanceRequest, callback: google.spanner.admin.instance.v1.InstanceAdmin.DeleteInstanceCallback): void; - - /** - * Calls DeleteInstance. - * @param request DeleteInstanceRequest message or plain object - * @returns Promise - */ - public deleteInstance(request: google.spanner.admin.instance.v1.IDeleteInstanceRequest): Promise; - - /** - * Calls SetIamPolicy. - * @param request SetIamPolicyRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Policy - */ - public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest, callback: google.spanner.admin.instance.v1.InstanceAdmin.SetIamPolicyCallback): void; - - /** - * Calls SetIamPolicy. - * @param request SetIamPolicyRequest message or plain object - * @returns Promise - */ - public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest): Promise; - - /** - * Calls GetIamPolicy. - * @param request GetIamPolicyRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Policy - */ - public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest, callback: google.spanner.admin.instance.v1.InstanceAdmin.GetIamPolicyCallback): void; - - /** - * Calls GetIamPolicy. - * @param request GetIamPolicyRequest message or plain object - * @returns Promise - */ - public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest): Promise; - - /** - * Calls TestIamPermissions. - * @param request TestIamPermissionsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and TestIamPermissionsResponse - */ - public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest, callback: google.spanner.admin.instance.v1.InstanceAdmin.TestIamPermissionsCallback): void; - - /** - * Calls TestIamPermissions. - * @param request TestIamPermissionsRequest message or plain object - * @returns Promise - */ - public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest): Promise; - - /** - * Calls GetInstancePartition. - * @param request GetInstancePartitionRequest message or plain object - * @param callback Node-style callback called with the error, if any, and InstancePartition - */ - public getInstancePartition(request: google.spanner.admin.instance.v1.IGetInstancePartitionRequest, callback: google.spanner.admin.instance.v1.InstanceAdmin.GetInstancePartitionCallback): void; - - /** - * Calls GetInstancePartition. - * @param request GetInstancePartitionRequest message or plain object - * @returns Promise - */ - public getInstancePartition(request: google.spanner.admin.instance.v1.IGetInstancePartitionRequest): Promise; - - /** - * Calls CreateInstancePartition. - * @param request CreateInstancePartitionRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public createInstancePartition(request: google.spanner.admin.instance.v1.ICreateInstancePartitionRequest, callback: google.spanner.admin.instance.v1.InstanceAdmin.CreateInstancePartitionCallback): void; - - /** - * Calls CreateInstancePartition. - * @param request CreateInstancePartitionRequest message or plain object - * @returns Promise - */ - public createInstancePartition(request: google.spanner.admin.instance.v1.ICreateInstancePartitionRequest): Promise; - - /** - * Calls DeleteInstancePartition. - * @param request DeleteInstancePartitionRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteInstancePartition(request: google.spanner.admin.instance.v1.IDeleteInstancePartitionRequest, callback: google.spanner.admin.instance.v1.InstanceAdmin.DeleteInstancePartitionCallback): void; - - /** - * Calls DeleteInstancePartition. - * @param request DeleteInstancePartitionRequest message or plain object - * @returns Promise - */ - public deleteInstancePartition(request: google.spanner.admin.instance.v1.IDeleteInstancePartitionRequest): Promise; - - /** - * Calls UpdateInstancePartition. - * @param request UpdateInstancePartitionRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public updateInstancePartition(request: google.spanner.admin.instance.v1.IUpdateInstancePartitionRequest, callback: google.spanner.admin.instance.v1.InstanceAdmin.UpdateInstancePartitionCallback): void; - - /** - * Calls UpdateInstancePartition. - * @param request UpdateInstancePartitionRequest message or plain object - * @returns Promise - */ - public updateInstancePartition(request: google.spanner.admin.instance.v1.IUpdateInstancePartitionRequest): Promise; - - /** - * Calls ListInstancePartitionOperations. - * @param request ListInstancePartitionOperationsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListInstancePartitionOperationsResponse - */ - public listInstancePartitionOperations(request: google.spanner.admin.instance.v1.IListInstancePartitionOperationsRequest, callback: google.spanner.admin.instance.v1.InstanceAdmin.ListInstancePartitionOperationsCallback): void; - - /** - * Calls ListInstancePartitionOperations. - * @param request ListInstancePartitionOperationsRequest message or plain object - * @returns Promise - */ - public listInstancePartitionOperations(request: google.spanner.admin.instance.v1.IListInstancePartitionOperationsRequest): Promise; - - /** - * Calls MoveInstance. - * @param request MoveInstanceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public moveInstance(request: google.spanner.admin.instance.v1.IMoveInstanceRequest, callback: google.spanner.admin.instance.v1.InstanceAdmin.MoveInstanceCallback): void; - - /** - * Calls MoveInstance. - * @param request MoveInstanceRequest message or plain object - * @returns Promise - */ - public moveInstance(request: google.spanner.admin.instance.v1.IMoveInstanceRequest): Promise; - } - - namespace InstanceAdmin { - - /** - * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|listInstanceConfigs}. - * @param error Error, if any - * @param [response] ListInstanceConfigsResponse - */ - type ListInstanceConfigsCallback = (error: (Error|null), response?: google.spanner.admin.instance.v1.ListInstanceConfigsResponse) => void; - - /** - * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|getInstanceConfig}. - * @param error Error, if any - * @param [response] InstanceConfig - */ - type GetInstanceConfigCallback = (error: (Error|null), response?: google.spanner.admin.instance.v1.InstanceConfig) => void; - - /** - * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|createInstanceConfig}. - * @param error Error, if any - * @param [response] Operation - */ - type CreateInstanceConfigCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|updateInstanceConfig}. - * @param error Error, if any - * @param [response] Operation - */ - type UpdateInstanceConfigCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|deleteInstanceConfig}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteInstanceConfigCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|listInstanceConfigOperations}. - * @param error Error, if any - * @param [response] ListInstanceConfigOperationsResponse - */ - type ListInstanceConfigOperationsCallback = (error: (Error|null), response?: google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse) => void; - - /** - * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|listInstances}. - * @param error Error, if any - * @param [response] ListInstancesResponse - */ - type ListInstancesCallback = (error: (Error|null), response?: google.spanner.admin.instance.v1.ListInstancesResponse) => void; - - /** - * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|listInstancePartitions}. - * @param error Error, if any - * @param [response] ListInstancePartitionsResponse - */ - type ListInstancePartitionsCallback = (error: (Error|null), response?: google.spanner.admin.instance.v1.ListInstancePartitionsResponse) => void; - - /** - * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|getInstance}. - * @param error Error, if any - * @param [response] Instance - */ - type GetInstanceCallback = (error: (Error|null), response?: google.spanner.admin.instance.v1.Instance) => void; - - /** - * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|createInstance}. - * @param error Error, if any - * @param [response] Operation - */ - type CreateInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|updateInstance}. - * @param error Error, if any - * @param [response] Operation - */ - type UpdateInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|deleteInstance}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteInstanceCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|setIamPolicy}. - * @param error Error, if any - * @param [response] Policy - */ - type SetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; - - /** - * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|getIamPolicy}. - * @param error Error, if any - * @param [response] Policy - */ - type GetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; - - /** - * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|testIamPermissions}. - * @param error Error, if any - * @param [response] TestIamPermissionsResponse - */ - type TestIamPermissionsCallback = (error: (Error|null), response?: google.iam.v1.TestIamPermissionsResponse) => void; - - /** - * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|getInstancePartition}. - * @param error Error, if any - * @param [response] InstancePartition - */ - type GetInstancePartitionCallback = (error: (Error|null), response?: google.spanner.admin.instance.v1.InstancePartition) => void; - - /** - * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|createInstancePartition}. - * @param error Error, if any - * @param [response] Operation - */ - type CreateInstancePartitionCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|deleteInstancePartition}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteInstancePartitionCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|updateInstancePartition}. - * @param error Error, if any - * @param [response] Operation - */ - type UpdateInstancePartitionCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|listInstancePartitionOperations}. - * @param error Error, if any - * @param [response] ListInstancePartitionOperationsResponse - */ - type ListInstancePartitionOperationsCallback = (error: (Error|null), response?: google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse) => void; - - /** - * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|moveInstance}. - * @param error Error, if any - * @param [response] Operation - */ - type MoveInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - } - - /** Properties of a ReplicaInfo. */ - interface IReplicaInfo { - - /** ReplicaInfo location */ - location?: (string|null); - - /** ReplicaInfo type */ - type?: (google.spanner.admin.instance.v1.ReplicaInfo.ReplicaType|keyof typeof google.spanner.admin.instance.v1.ReplicaInfo.ReplicaType|null); - - /** ReplicaInfo defaultLeaderLocation */ - defaultLeaderLocation?: (boolean|null); - } - - /** Represents a ReplicaInfo. */ - class ReplicaInfo implements IReplicaInfo { - - /** - * Constructs a new ReplicaInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.instance.v1.IReplicaInfo); - - /** ReplicaInfo location. */ - public location: string; - - /** ReplicaInfo type. */ - public type: (google.spanner.admin.instance.v1.ReplicaInfo.ReplicaType|keyof typeof google.spanner.admin.instance.v1.ReplicaInfo.ReplicaType); - - /** ReplicaInfo defaultLeaderLocation. */ - public defaultLeaderLocation: boolean; - - /** - * Creates a new ReplicaInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns ReplicaInfo instance - */ - public static create(properties?: google.spanner.admin.instance.v1.IReplicaInfo): google.spanner.admin.instance.v1.ReplicaInfo; - - /** - * Encodes the specified ReplicaInfo message. Does not implicitly {@link google.spanner.admin.instance.v1.ReplicaInfo.verify|verify} messages. - * @param message ReplicaInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.instance.v1.IReplicaInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ReplicaInfo message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ReplicaInfo.verify|verify} messages. - * @param message ReplicaInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.instance.v1.IReplicaInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ReplicaInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ReplicaInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.ReplicaInfo; - - /** - * Decodes a ReplicaInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ReplicaInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.ReplicaInfo; - - /** - * Verifies a ReplicaInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ReplicaInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ReplicaInfo - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.ReplicaInfo; - - /** - * Creates a plain object from a ReplicaInfo message. Also converts values to other types if specified. - * @param message ReplicaInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.instance.v1.ReplicaInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ReplicaInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ReplicaInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ReplicaInfo { - - /** ReplicaType enum. */ - enum ReplicaType { - TYPE_UNSPECIFIED = 0, - READ_WRITE = 1, - READ_ONLY = 2, - WITNESS = 3 - } - } - - /** Properties of an InstanceConfig. */ - interface IInstanceConfig { - - /** InstanceConfig name */ - name?: (string|null); - - /** InstanceConfig displayName */ - displayName?: (string|null); - - /** InstanceConfig configType */ - configType?: (google.spanner.admin.instance.v1.InstanceConfig.Type|keyof typeof google.spanner.admin.instance.v1.InstanceConfig.Type|null); - - /** InstanceConfig replicas */ - replicas?: (google.spanner.admin.instance.v1.IReplicaInfo[]|null); - - /** InstanceConfig optionalReplicas */ - optionalReplicas?: (google.spanner.admin.instance.v1.IReplicaInfo[]|null); - - /** InstanceConfig baseConfig */ - baseConfig?: (string|null); - - /** InstanceConfig labels */ - labels?: ({ [k: string]: string }|null); - - /** InstanceConfig etag */ - etag?: (string|null); - - /** InstanceConfig leaderOptions */ - leaderOptions?: (string[]|null); - - /** InstanceConfig reconciling */ - reconciling?: (boolean|null); - - /** InstanceConfig state */ - state?: (google.spanner.admin.instance.v1.InstanceConfig.State|keyof typeof google.spanner.admin.instance.v1.InstanceConfig.State|null); - - /** InstanceConfig freeInstanceAvailability */ - freeInstanceAvailability?: (google.spanner.admin.instance.v1.InstanceConfig.FreeInstanceAvailability|keyof typeof google.spanner.admin.instance.v1.InstanceConfig.FreeInstanceAvailability|null); - - /** InstanceConfig quorumType */ - quorumType?: (google.spanner.admin.instance.v1.InstanceConfig.QuorumType|keyof typeof google.spanner.admin.instance.v1.InstanceConfig.QuorumType|null); - - /** InstanceConfig storageLimitPerProcessingUnit */ - storageLimitPerProcessingUnit?: (number|Long|string|null); - } - - /** Represents an InstanceConfig. */ - class InstanceConfig implements IInstanceConfig { - - /** - * Constructs a new InstanceConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.instance.v1.IInstanceConfig); - - /** InstanceConfig name. */ - public name: string; - - /** InstanceConfig displayName. */ - public displayName: string; - - /** InstanceConfig configType. */ - public configType: (google.spanner.admin.instance.v1.InstanceConfig.Type|keyof typeof google.spanner.admin.instance.v1.InstanceConfig.Type); - - /** InstanceConfig replicas. */ - public replicas: google.spanner.admin.instance.v1.IReplicaInfo[]; - - /** InstanceConfig optionalReplicas. */ - public optionalReplicas: google.spanner.admin.instance.v1.IReplicaInfo[]; - - /** InstanceConfig baseConfig. */ - public baseConfig: string; - - /** InstanceConfig labels. */ - public labels: { [k: string]: string }; - - /** InstanceConfig etag. */ - public etag: string; - - /** InstanceConfig leaderOptions. */ - public leaderOptions: string[]; - - /** InstanceConfig reconciling. */ - public reconciling: boolean; - - /** InstanceConfig state. */ - public state: (google.spanner.admin.instance.v1.InstanceConfig.State|keyof typeof google.spanner.admin.instance.v1.InstanceConfig.State); - - /** InstanceConfig freeInstanceAvailability. */ - public freeInstanceAvailability: (google.spanner.admin.instance.v1.InstanceConfig.FreeInstanceAvailability|keyof typeof google.spanner.admin.instance.v1.InstanceConfig.FreeInstanceAvailability); - - /** InstanceConfig quorumType. */ - public quorumType: (google.spanner.admin.instance.v1.InstanceConfig.QuorumType|keyof typeof google.spanner.admin.instance.v1.InstanceConfig.QuorumType); - - /** InstanceConfig storageLimitPerProcessingUnit. */ - public storageLimitPerProcessingUnit: (number|Long|string); - - /** - * Creates a new InstanceConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns InstanceConfig instance - */ - public static create(properties?: google.spanner.admin.instance.v1.IInstanceConfig): google.spanner.admin.instance.v1.InstanceConfig; - - /** - * Encodes the specified InstanceConfig message. Does not implicitly {@link google.spanner.admin.instance.v1.InstanceConfig.verify|verify} messages. - * @param message InstanceConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.instance.v1.IInstanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified InstanceConfig message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.InstanceConfig.verify|verify} messages. - * @param message InstanceConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.instance.v1.IInstanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an InstanceConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns InstanceConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.InstanceConfig; - - /** - * Decodes an InstanceConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns InstanceConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.InstanceConfig; - - /** - * Verifies an InstanceConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an InstanceConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns InstanceConfig - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.InstanceConfig; - - /** - * Creates a plain object from an InstanceConfig message. Also converts values to other types if specified. - * @param message InstanceConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.instance.v1.InstanceConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this InstanceConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for InstanceConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace InstanceConfig { - - /** Type enum. */ - enum Type { - TYPE_UNSPECIFIED = 0, - GOOGLE_MANAGED = 1, - USER_MANAGED = 2 - } - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - CREATING = 1, - READY = 2 - } - - /** FreeInstanceAvailability enum. */ - enum FreeInstanceAvailability { - FREE_INSTANCE_AVAILABILITY_UNSPECIFIED = 0, - AVAILABLE = 1, - UNSUPPORTED = 2, - DISABLED = 3, - QUOTA_EXCEEDED = 4 - } - - /** QuorumType enum. */ - enum QuorumType { - QUORUM_TYPE_UNSPECIFIED = 0, - REGION = 1, - DUAL_REGION = 2, - MULTI_REGION = 3 - } - } - - /** Properties of a ReplicaComputeCapacity. */ - interface IReplicaComputeCapacity { - - /** ReplicaComputeCapacity replicaSelection */ - replicaSelection?: (google.spanner.admin.instance.v1.IReplicaSelection|null); - - /** ReplicaComputeCapacity nodeCount */ - nodeCount?: (number|null); - - /** ReplicaComputeCapacity processingUnits */ - processingUnits?: (number|null); - } - - /** Represents a ReplicaComputeCapacity. */ - class ReplicaComputeCapacity implements IReplicaComputeCapacity { - - /** - * Constructs a new ReplicaComputeCapacity. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.instance.v1.IReplicaComputeCapacity); - - /** ReplicaComputeCapacity replicaSelection. */ - public replicaSelection?: (google.spanner.admin.instance.v1.IReplicaSelection|null); - - /** ReplicaComputeCapacity nodeCount. */ - public nodeCount?: (number|null); - - /** ReplicaComputeCapacity processingUnits. */ - public processingUnits?: (number|null); - - /** ReplicaComputeCapacity computeCapacity. */ - public computeCapacity?: ("nodeCount"|"processingUnits"); - - /** - * Creates a new ReplicaComputeCapacity instance using the specified properties. - * @param [properties] Properties to set - * @returns ReplicaComputeCapacity instance - */ - public static create(properties?: google.spanner.admin.instance.v1.IReplicaComputeCapacity): google.spanner.admin.instance.v1.ReplicaComputeCapacity; - - /** - * Encodes the specified ReplicaComputeCapacity message. Does not implicitly {@link google.spanner.admin.instance.v1.ReplicaComputeCapacity.verify|verify} messages. - * @param message ReplicaComputeCapacity message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.instance.v1.IReplicaComputeCapacity, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ReplicaComputeCapacity message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ReplicaComputeCapacity.verify|verify} messages. - * @param message ReplicaComputeCapacity message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.instance.v1.IReplicaComputeCapacity, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ReplicaComputeCapacity message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ReplicaComputeCapacity - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.ReplicaComputeCapacity; - - /** - * Decodes a ReplicaComputeCapacity message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ReplicaComputeCapacity - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.ReplicaComputeCapacity; - - /** - * Verifies a ReplicaComputeCapacity message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ReplicaComputeCapacity message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ReplicaComputeCapacity - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.ReplicaComputeCapacity; - - /** - * Creates a plain object from a ReplicaComputeCapacity message. Also converts values to other types if specified. - * @param message ReplicaComputeCapacity - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.instance.v1.ReplicaComputeCapacity, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ReplicaComputeCapacity to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ReplicaComputeCapacity - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an AutoscalingConfig. */ - interface IAutoscalingConfig { - - /** AutoscalingConfig autoscalingLimits */ - autoscalingLimits?: (google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingLimits|null); - - /** AutoscalingConfig autoscalingTargets */ - autoscalingTargets?: (google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingTargets|null); - - /** AutoscalingConfig asymmetricAutoscalingOptions */ - asymmetricAutoscalingOptions?: (google.spanner.admin.instance.v1.AutoscalingConfig.IAsymmetricAutoscalingOption[]|null); - } - - /** Represents an AutoscalingConfig. */ - class AutoscalingConfig implements IAutoscalingConfig { - - /** - * Constructs a new AutoscalingConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.instance.v1.IAutoscalingConfig); - - /** AutoscalingConfig autoscalingLimits. */ - public autoscalingLimits?: (google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingLimits|null); - - /** AutoscalingConfig autoscalingTargets. */ - public autoscalingTargets?: (google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingTargets|null); - - /** AutoscalingConfig asymmetricAutoscalingOptions. */ - public asymmetricAutoscalingOptions: google.spanner.admin.instance.v1.AutoscalingConfig.IAsymmetricAutoscalingOption[]; - - /** - * Creates a new AutoscalingConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns AutoscalingConfig instance - */ - public static create(properties?: google.spanner.admin.instance.v1.IAutoscalingConfig): google.spanner.admin.instance.v1.AutoscalingConfig; - - /** - * Encodes the specified AutoscalingConfig message. Does not implicitly {@link google.spanner.admin.instance.v1.AutoscalingConfig.verify|verify} messages. - * @param message AutoscalingConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.instance.v1.IAutoscalingConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AutoscalingConfig message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.AutoscalingConfig.verify|verify} messages. - * @param message AutoscalingConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.instance.v1.IAutoscalingConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AutoscalingConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AutoscalingConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.AutoscalingConfig; - - /** - * Decodes an AutoscalingConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AutoscalingConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.AutoscalingConfig; - - /** - * Verifies an AutoscalingConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an AutoscalingConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AutoscalingConfig - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.AutoscalingConfig; - - /** - * Creates a plain object from an AutoscalingConfig message. Also converts values to other types if specified. - * @param message AutoscalingConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.instance.v1.AutoscalingConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AutoscalingConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AutoscalingConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace AutoscalingConfig { - - /** Properties of an AutoscalingLimits. */ - interface IAutoscalingLimits { - - /** AutoscalingLimits minNodes */ - minNodes?: (number|null); - - /** AutoscalingLimits minProcessingUnits */ - minProcessingUnits?: (number|null); - - /** AutoscalingLimits maxNodes */ - maxNodes?: (number|null); - - /** AutoscalingLimits maxProcessingUnits */ - maxProcessingUnits?: (number|null); - } - - /** Represents an AutoscalingLimits. */ - class AutoscalingLimits implements IAutoscalingLimits { - - /** - * Constructs a new AutoscalingLimits. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingLimits); - - /** AutoscalingLimits minNodes. */ - public minNodes?: (number|null); - - /** AutoscalingLimits minProcessingUnits. */ - public minProcessingUnits?: (number|null); - - /** AutoscalingLimits maxNodes. */ - public maxNodes?: (number|null); - - /** AutoscalingLimits maxProcessingUnits. */ - public maxProcessingUnits?: (number|null); - - /** AutoscalingLimits minLimit. */ - public minLimit?: ("minNodes"|"minProcessingUnits"); - - /** AutoscalingLimits maxLimit. */ - public maxLimit?: ("maxNodes"|"maxProcessingUnits"); - - /** - * Creates a new AutoscalingLimits instance using the specified properties. - * @param [properties] Properties to set - * @returns AutoscalingLimits instance - */ - public static create(properties?: google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingLimits): google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits; - - /** - * Encodes the specified AutoscalingLimits message. Does not implicitly {@link google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits.verify|verify} messages. - * @param message AutoscalingLimits message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingLimits, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AutoscalingLimits message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits.verify|verify} messages. - * @param message AutoscalingLimits message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingLimits, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AutoscalingLimits message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AutoscalingLimits - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits; - - /** - * Decodes an AutoscalingLimits message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AutoscalingLimits - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits; - - /** - * Verifies an AutoscalingLimits message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an AutoscalingLimits message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AutoscalingLimits - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits; - - /** - * Creates a plain object from an AutoscalingLimits message. Also converts values to other types if specified. - * @param message AutoscalingLimits - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AutoscalingLimits to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AutoscalingLimits - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an AutoscalingTargets. */ - interface IAutoscalingTargets { - - /** AutoscalingTargets highPriorityCpuUtilizationPercent */ - highPriorityCpuUtilizationPercent?: (number|null); - - /** AutoscalingTargets totalCpuUtilizationPercent */ - totalCpuUtilizationPercent?: (number|null); - - /** AutoscalingTargets storageUtilizationPercent */ - storageUtilizationPercent?: (number|null); - } - - /** Represents an AutoscalingTargets. */ - class AutoscalingTargets implements IAutoscalingTargets { - - /** - * Constructs a new AutoscalingTargets. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingTargets); - - /** AutoscalingTargets highPriorityCpuUtilizationPercent. */ - public highPriorityCpuUtilizationPercent: number; - - /** AutoscalingTargets totalCpuUtilizationPercent. */ - public totalCpuUtilizationPercent: number; - - /** AutoscalingTargets storageUtilizationPercent. */ - public storageUtilizationPercent: number; - - /** - * Creates a new AutoscalingTargets instance using the specified properties. - * @param [properties] Properties to set - * @returns AutoscalingTargets instance - */ - public static create(properties?: google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingTargets): google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets; - - /** - * Encodes the specified AutoscalingTargets message. Does not implicitly {@link google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets.verify|verify} messages. - * @param message AutoscalingTargets message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingTargets, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AutoscalingTargets message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets.verify|verify} messages. - * @param message AutoscalingTargets message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingTargets, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AutoscalingTargets message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AutoscalingTargets - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets; - - /** - * Decodes an AutoscalingTargets message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AutoscalingTargets - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets; - - /** - * Verifies an AutoscalingTargets message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an AutoscalingTargets message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AutoscalingTargets - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets; - - /** - * Creates a plain object from an AutoscalingTargets message. Also converts values to other types if specified. - * @param message AutoscalingTargets - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AutoscalingTargets to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AutoscalingTargets - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an AsymmetricAutoscalingOption. */ - interface IAsymmetricAutoscalingOption { - - /** AsymmetricAutoscalingOption replicaSelection */ - replicaSelection?: (google.spanner.admin.instance.v1.IReplicaSelection|null); - - /** AsymmetricAutoscalingOption overrides */ - overrides?: (google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.IAutoscalingConfigOverrides|null); - } - - /** Represents an AsymmetricAutoscalingOption. */ - class AsymmetricAutoscalingOption implements IAsymmetricAutoscalingOption { - - /** - * Constructs a new AsymmetricAutoscalingOption. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.instance.v1.AutoscalingConfig.IAsymmetricAutoscalingOption); - - /** AsymmetricAutoscalingOption replicaSelection. */ - public replicaSelection?: (google.spanner.admin.instance.v1.IReplicaSelection|null); - - /** AsymmetricAutoscalingOption overrides. */ - public overrides?: (google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.IAutoscalingConfigOverrides|null); - - /** - * Creates a new AsymmetricAutoscalingOption instance using the specified properties. - * @param [properties] Properties to set - * @returns AsymmetricAutoscalingOption instance - */ - public static create(properties?: google.spanner.admin.instance.v1.AutoscalingConfig.IAsymmetricAutoscalingOption): google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption; - - /** - * Encodes the specified AsymmetricAutoscalingOption message. Does not implicitly {@link google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.verify|verify} messages. - * @param message AsymmetricAutoscalingOption message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.instance.v1.AutoscalingConfig.IAsymmetricAutoscalingOption, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AsymmetricAutoscalingOption message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.verify|verify} messages. - * @param message AsymmetricAutoscalingOption message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.instance.v1.AutoscalingConfig.IAsymmetricAutoscalingOption, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AsymmetricAutoscalingOption message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AsymmetricAutoscalingOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption; - - /** - * Decodes an AsymmetricAutoscalingOption message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AsymmetricAutoscalingOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption; - - /** - * Verifies an AsymmetricAutoscalingOption message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an AsymmetricAutoscalingOption message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AsymmetricAutoscalingOption - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption; - - /** - * Creates a plain object from an AsymmetricAutoscalingOption message. Also converts values to other types if specified. - * @param message AsymmetricAutoscalingOption - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AsymmetricAutoscalingOption to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AsymmetricAutoscalingOption - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace AsymmetricAutoscalingOption { - - /** Properties of an AutoscalingConfigOverrides. */ - interface IAutoscalingConfigOverrides { - - /** AutoscalingConfigOverrides autoscalingLimits */ - autoscalingLimits?: (google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingLimits|null); - - /** AutoscalingConfigOverrides autoscalingTargetHighPriorityCpuUtilizationPercent */ - autoscalingTargetHighPriorityCpuUtilizationPercent?: (number|null); - - /** AutoscalingConfigOverrides autoscalingTargetTotalCpuUtilizationPercent */ - autoscalingTargetTotalCpuUtilizationPercent?: (number|null); - - /** AutoscalingConfigOverrides disableHighPriorityCpuAutoscaling */ - disableHighPriorityCpuAutoscaling?: (boolean|null); - - /** AutoscalingConfigOverrides disableTotalCpuAutoscaling */ - disableTotalCpuAutoscaling?: (boolean|null); - } - - /** Represents an AutoscalingConfigOverrides. */ - class AutoscalingConfigOverrides implements IAutoscalingConfigOverrides { - - /** - * Constructs a new AutoscalingConfigOverrides. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.IAutoscalingConfigOverrides); - - /** AutoscalingConfigOverrides autoscalingLimits. */ - public autoscalingLimits?: (google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingLimits|null); - - /** AutoscalingConfigOverrides autoscalingTargetHighPriorityCpuUtilizationPercent. */ - public autoscalingTargetHighPriorityCpuUtilizationPercent: number; - - /** AutoscalingConfigOverrides autoscalingTargetTotalCpuUtilizationPercent. */ - public autoscalingTargetTotalCpuUtilizationPercent: number; - - /** AutoscalingConfigOverrides disableHighPriorityCpuAutoscaling. */ - public disableHighPriorityCpuAutoscaling: boolean; - - /** AutoscalingConfigOverrides disableTotalCpuAutoscaling. */ - public disableTotalCpuAutoscaling: boolean; - - /** - * Creates a new AutoscalingConfigOverrides instance using the specified properties. - * @param [properties] Properties to set - * @returns AutoscalingConfigOverrides instance - */ - public static create(properties?: google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.IAutoscalingConfigOverrides): google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides; - - /** - * Encodes the specified AutoscalingConfigOverrides message. Does not implicitly {@link google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides.verify|verify} messages. - * @param message AutoscalingConfigOverrides message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.IAutoscalingConfigOverrides, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AutoscalingConfigOverrides message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides.verify|verify} messages. - * @param message AutoscalingConfigOverrides message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.IAutoscalingConfigOverrides, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AutoscalingConfigOverrides message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AutoscalingConfigOverrides - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides; - - /** - * Decodes an AutoscalingConfigOverrides message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AutoscalingConfigOverrides - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides; - - /** - * Verifies an AutoscalingConfigOverrides message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an AutoscalingConfigOverrides message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AutoscalingConfigOverrides - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides; - - /** - * Creates a plain object from an AutoscalingConfigOverrides message. Also converts values to other types if specified. - * @param message AutoscalingConfigOverrides - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AutoscalingConfigOverrides to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AutoscalingConfigOverrides - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - } - - /** Properties of an Instance. */ - interface IInstance { - - /** Instance name */ - name?: (string|null); - - /** Instance config */ - config?: (string|null); - - /** Instance displayName */ - displayName?: (string|null); - - /** Instance nodeCount */ - nodeCount?: (number|null); - - /** Instance processingUnits */ - processingUnits?: (number|null); - - /** Instance replicaComputeCapacity */ - replicaComputeCapacity?: (google.spanner.admin.instance.v1.IReplicaComputeCapacity[]|null); - - /** Instance autoscalingConfig */ - autoscalingConfig?: (google.spanner.admin.instance.v1.IAutoscalingConfig|null); - - /** Instance state */ - state?: (google.spanner.admin.instance.v1.Instance.State|keyof typeof google.spanner.admin.instance.v1.Instance.State|null); - - /** Instance labels */ - labels?: ({ [k: string]: string }|null); - - /** Instance instanceType */ - instanceType?: (google.spanner.admin.instance.v1.Instance.InstanceType|keyof typeof google.spanner.admin.instance.v1.Instance.InstanceType|null); - - /** Instance endpointUris */ - endpointUris?: (string[]|null); - - /** Instance createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** Instance updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** Instance freeInstanceMetadata */ - freeInstanceMetadata?: (google.spanner.admin.instance.v1.IFreeInstanceMetadata|null); - - /** Instance edition */ - edition?: (google.spanner.admin.instance.v1.Instance.Edition|keyof typeof google.spanner.admin.instance.v1.Instance.Edition|null); - - /** Instance defaultBackupScheduleType */ - defaultBackupScheduleType?: (google.spanner.admin.instance.v1.Instance.DefaultBackupScheduleType|keyof typeof google.spanner.admin.instance.v1.Instance.DefaultBackupScheduleType|null); - } - - /** Represents an Instance. */ - class Instance implements IInstance { - - /** - * Constructs a new Instance. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.instance.v1.IInstance); - - /** Instance name. */ - public name: string; - - /** Instance config. */ - public config: string; - - /** Instance displayName. */ - public displayName: string; - - /** Instance nodeCount. */ - public nodeCount: number; - - /** Instance processingUnits. */ - public processingUnits: number; - - /** Instance replicaComputeCapacity. */ - public replicaComputeCapacity: google.spanner.admin.instance.v1.IReplicaComputeCapacity[]; - - /** Instance autoscalingConfig. */ - public autoscalingConfig?: (google.spanner.admin.instance.v1.IAutoscalingConfig|null); - - /** Instance state. */ - public state: (google.spanner.admin.instance.v1.Instance.State|keyof typeof google.spanner.admin.instance.v1.Instance.State); - - /** Instance labels. */ - public labels: { [k: string]: string }; - - /** Instance instanceType. */ - public instanceType: (google.spanner.admin.instance.v1.Instance.InstanceType|keyof typeof google.spanner.admin.instance.v1.Instance.InstanceType); - - /** Instance endpointUris. */ - public endpointUris: string[]; - - /** Instance createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** Instance updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** Instance freeInstanceMetadata. */ - public freeInstanceMetadata?: (google.spanner.admin.instance.v1.IFreeInstanceMetadata|null); - - /** Instance edition. */ - public edition: (google.spanner.admin.instance.v1.Instance.Edition|keyof typeof google.spanner.admin.instance.v1.Instance.Edition); - - /** Instance defaultBackupScheduleType. */ - public defaultBackupScheduleType: (google.spanner.admin.instance.v1.Instance.DefaultBackupScheduleType|keyof typeof google.spanner.admin.instance.v1.Instance.DefaultBackupScheduleType); - - /** - * Creates a new Instance instance using the specified properties. - * @param [properties] Properties to set - * @returns Instance instance - */ - public static create(properties?: google.spanner.admin.instance.v1.IInstance): google.spanner.admin.instance.v1.Instance; - - /** - * Encodes the specified Instance message. Does not implicitly {@link google.spanner.admin.instance.v1.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.spanner.admin.instance.v1.IInstance, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Instance message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.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.spanner.admin.instance.v1.IInstance, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Instance message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Instance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.Instance; - - /** - * Decodes an Instance message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Instance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.Instance; - - /** - * Verifies an Instance message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Instance message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Instance - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.Instance; - - /** - * Creates a plain object from an Instance message. Also converts values to other types if specified. - * @param message Instance - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.instance.v1.Instance, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Instance to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Instance - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Instance { - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - CREATING = 1, - READY = 2 - } - - /** InstanceType enum. */ - enum InstanceType { - INSTANCE_TYPE_UNSPECIFIED = 0, - PROVISIONED = 1, - FREE_INSTANCE = 2 - } - - /** Edition enum. */ - enum Edition { - EDITION_UNSPECIFIED = 0, - STANDARD = 1, - ENTERPRISE = 2, - ENTERPRISE_PLUS = 3 - } - - /** DefaultBackupScheduleType enum. */ - enum DefaultBackupScheduleType { - DEFAULT_BACKUP_SCHEDULE_TYPE_UNSPECIFIED = 0, - NONE = 1, - AUTOMATIC = 2 - } - } - - /** Properties of a ListInstanceConfigsRequest. */ - interface IListInstanceConfigsRequest { - - /** ListInstanceConfigsRequest parent */ - parent?: (string|null); - - /** ListInstanceConfigsRequest pageSize */ - pageSize?: (number|null); - - /** ListInstanceConfigsRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListInstanceConfigsRequest. */ - class ListInstanceConfigsRequest implements IListInstanceConfigsRequest { - - /** - * Constructs a new ListInstanceConfigsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.instance.v1.IListInstanceConfigsRequest); - - /** ListInstanceConfigsRequest parent. */ - public parent: string; - - /** ListInstanceConfigsRequest pageSize. */ - public pageSize: number; - - /** ListInstanceConfigsRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListInstanceConfigsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListInstanceConfigsRequest instance - */ - public static create(properties?: google.spanner.admin.instance.v1.IListInstanceConfigsRequest): google.spanner.admin.instance.v1.ListInstanceConfigsRequest; - - /** - * Encodes the specified ListInstanceConfigsRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstanceConfigsRequest.verify|verify} messages. - * @param message ListInstanceConfigsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.instance.v1.IListInstanceConfigsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListInstanceConfigsRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstanceConfigsRequest.verify|verify} messages. - * @param message ListInstanceConfigsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.instance.v1.IListInstanceConfigsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListInstanceConfigsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListInstanceConfigsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.ListInstanceConfigsRequest; - - /** - * Decodes a ListInstanceConfigsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListInstanceConfigsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.ListInstanceConfigsRequest; - - /** - * Verifies a ListInstanceConfigsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListInstanceConfigsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListInstanceConfigsRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.ListInstanceConfigsRequest; - - /** - * Creates a plain object from a ListInstanceConfigsRequest message. Also converts values to other types if specified. - * @param message ListInstanceConfigsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.instance.v1.ListInstanceConfigsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListInstanceConfigsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListInstanceConfigsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListInstanceConfigsResponse. */ - interface IListInstanceConfigsResponse { - - /** ListInstanceConfigsResponse instanceConfigs */ - instanceConfigs?: (google.spanner.admin.instance.v1.IInstanceConfig[]|null); - - /** ListInstanceConfigsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListInstanceConfigsResponse. */ - class ListInstanceConfigsResponse implements IListInstanceConfigsResponse { - - /** - * Constructs a new ListInstanceConfigsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.instance.v1.IListInstanceConfigsResponse); - - /** ListInstanceConfigsResponse instanceConfigs. */ - public instanceConfigs: google.spanner.admin.instance.v1.IInstanceConfig[]; - - /** ListInstanceConfigsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListInstanceConfigsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListInstanceConfigsResponse instance - */ - public static create(properties?: google.spanner.admin.instance.v1.IListInstanceConfigsResponse): google.spanner.admin.instance.v1.ListInstanceConfigsResponse; - - /** - * Encodes the specified ListInstanceConfigsResponse message. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstanceConfigsResponse.verify|verify} messages. - * @param message ListInstanceConfigsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.instance.v1.IListInstanceConfigsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListInstanceConfigsResponse message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstanceConfigsResponse.verify|verify} messages. - * @param message ListInstanceConfigsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.instance.v1.IListInstanceConfigsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListInstanceConfigsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListInstanceConfigsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.ListInstanceConfigsResponse; - - /** - * Decodes a ListInstanceConfigsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListInstanceConfigsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.ListInstanceConfigsResponse; - - /** - * Verifies a ListInstanceConfigsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListInstanceConfigsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListInstanceConfigsResponse - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.ListInstanceConfigsResponse; - - /** - * Creates a plain object from a ListInstanceConfigsResponse message. Also converts values to other types if specified. - * @param message ListInstanceConfigsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.instance.v1.ListInstanceConfigsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListInstanceConfigsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListInstanceConfigsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetInstanceConfigRequest. */ - interface IGetInstanceConfigRequest { - - /** GetInstanceConfigRequest name */ - name?: (string|null); - } - - /** Represents a GetInstanceConfigRequest. */ - class GetInstanceConfigRequest implements IGetInstanceConfigRequest { - - /** - * Constructs a new GetInstanceConfigRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.instance.v1.IGetInstanceConfigRequest); - - /** GetInstanceConfigRequest name. */ - public name: string; - - /** - * Creates a new GetInstanceConfigRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetInstanceConfigRequest instance - */ - public static create(properties?: google.spanner.admin.instance.v1.IGetInstanceConfigRequest): google.spanner.admin.instance.v1.GetInstanceConfigRequest; - - /** - * Encodes the specified GetInstanceConfigRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.GetInstanceConfigRequest.verify|verify} messages. - * @param message GetInstanceConfigRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.instance.v1.IGetInstanceConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetInstanceConfigRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.GetInstanceConfigRequest.verify|verify} messages. - * @param message GetInstanceConfigRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.instance.v1.IGetInstanceConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetInstanceConfigRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetInstanceConfigRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.GetInstanceConfigRequest; - - /** - * Decodes a GetInstanceConfigRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetInstanceConfigRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.GetInstanceConfigRequest; - - /** - * Verifies a GetInstanceConfigRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetInstanceConfigRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetInstanceConfigRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.GetInstanceConfigRequest; - - /** - * Creates a plain object from a GetInstanceConfigRequest message. Also converts values to other types if specified. - * @param message GetInstanceConfigRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.instance.v1.GetInstanceConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetInstanceConfigRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetInstanceConfigRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateInstanceConfigRequest. */ - interface ICreateInstanceConfigRequest { - - /** CreateInstanceConfigRequest parent */ - parent?: (string|null); - - /** CreateInstanceConfigRequest instanceConfigId */ - instanceConfigId?: (string|null); - - /** CreateInstanceConfigRequest instanceConfig */ - instanceConfig?: (google.spanner.admin.instance.v1.IInstanceConfig|null); - - /** CreateInstanceConfigRequest validateOnly */ - validateOnly?: (boolean|null); - } - - /** Represents a CreateInstanceConfigRequest. */ - class CreateInstanceConfigRequest implements ICreateInstanceConfigRequest { - - /** - * Constructs a new CreateInstanceConfigRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.instance.v1.ICreateInstanceConfigRequest); - - /** CreateInstanceConfigRequest parent. */ - public parent: string; - - /** CreateInstanceConfigRequest instanceConfigId. */ - public instanceConfigId: string; - - /** CreateInstanceConfigRequest instanceConfig. */ - public instanceConfig?: (google.spanner.admin.instance.v1.IInstanceConfig|null); - - /** CreateInstanceConfigRequest validateOnly. */ - public validateOnly: boolean; - - /** - * Creates a new CreateInstanceConfigRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateInstanceConfigRequest instance - */ - public static create(properties?: google.spanner.admin.instance.v1.ICreateInstanceConfigRequest): google.spanner.admin.instance.v1.CreateInstanceConfigRequest; - - /** - * Encodes the specified CreateInstanceConfigRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.CreateInstanceConfigRequest.verify|verify} messages. - * @param message CreateInstanceConfigRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.instance.v1.ICreateInstanceConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateInstanceConfigRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.CreateInstanceConfigRequest.verify|verify} messages. - * @param message CreateInstanceConfigRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.instance.v1.ICreateInstanceConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateInstanceConfigRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateInstanceConfigRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.CreateInstanceConfigRequest; - - /** - * Decodes a CreateInstanceConfigRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateInstanceConfigRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.CreateInstanceConfigRequest; - - /** - * Verifies a CreateInstanceConfigRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateInstanceConfigRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateInstanceConfigRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.CreateInstanceConfigRequest; - - /** - * Creates a plain object from a CreateInstanceConfigRequest message. Also converts values to other types if specified. - * @param message CreateInstanceConfigRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.instance.v1.CreateInstanceConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateInstanceConfigRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateInstanceConfigRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateInstanceConfigRequest. */ - interface IUpdateInstanceConfigRequest { - - /** UpdateInstanceConfigRequest instanceConfig */ - instanceConfig?: (google.spanner.admin.instance.v1.IInstanceConfig|null); - - /** UpdateInstanceConfigRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - - /** UpdateInstanceConfigRequest validateOnly */ - validateOnly?: (boolean|null); - } - - /** Represents an UpdateInstanceConfigRequest. */ - class UpdateInstanceConfigRequest implements IUpdateInstanceConfigRequest { - - /** - * Constructs a new UpdateInstanceConfigRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.instance.v1.IUpdateInstanceConfigRequest); - - /** UpdateInstanceConfigRequest instanceConfig. */ - public instanceConfig?: (google.spanner.admin.instance.v1.IInstanceConfig|null); - - /** UpdateInstanceConfigRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** UpdateInstanceConfigRequest validateOnly. */ - public validateOnly: boolean; - - /** - * Creates a new UpdateInstanceConfigRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateInstanceConfigRequest instance - */ - public static create(properties?: google.spanner.admin.instance.v1.IUpdateInstanceConfigRequest): google.spanner.admin.instance.v1.UpdateInstanceConfigRequest; - - /** - * Encodes the specified UpdateInstanceConfigRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.UpdateInstanceConfigRequest.verify|verify} messages. - * @param message UpdateInstanceConfigRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.instance.v1.IUpdateInstanceConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateInstanceConfigRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.UpdateInstanceConfigRequest.verify|verify} messages. - * @param message UpdateInstanceConfigRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.instance.v1.IUpdateInstanceConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateInstanceConfigRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateInstanceConfigRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.UpdateInstanceConfigRequest; - - /** - * Decodes an UpdateInstanceConfigRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateInstanceConfigRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.UpdateInstanceConfigRequest; - - /** - * Verifies an UpdateInstanceConfigRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UpdateInstanceConfigRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateInstanceConfigRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.UpdateInstanceConfigRequest; - - /** - * Creates a plain object from an UpdateInstanceConfigRequest message. Also converts values to other types if specified. - * @param message UpdateInstanceConfigRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.instance.v1.UpdateInstanceConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateInstanceConfigRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateInstanceConfigRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteInstanceConfigRequest. */ - interface IDeleteInstanceConfigRequest { - - /** DeleteInstanceConfigRequest name */ - name?: (string|null); - - /** DeleteInstanceConfigRequest etag */ - etag?: (string|null); - - /** DeleteInstanceConfigRequest validateOnly */ - validateOnly?: (boolean|null); - } - - /** Represents a DeleteInstanceConfigRequest. */ - class DeleteInstanceConfigRequest implements IDeleteInstanceConfigRequest { - - /** - * Constructs a new DeleteInstanceConfigRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.instance.v1.IDeleteInstanceConfigRequest); - - /** DeleteInstanceConfigRequest name. */ - public name: string; - - /** DeleteInstanceConfigRequest etag. */ - public etag: string; - - /** DeleteInstanceConfigRequest validateOnly. */ - public validateOnly: boolean; - - /** - * Creates a new DeleteInstanceConfigRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteInstanceConfigRequest instance - */ - public static create(properties?: google.spanner.admin.instance.v1.IDeleteInstanceConfigRequest): google.spanner.admin.instance.v1.DeleteInstanceConfigRequest; - - /** - * Encodes the specified DeleteInstanceConfigRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.DeleteInstanceConfigRequest.verify|verify} messages. - * @param message DeleteInstanceConfigRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.instance.v1.IDeleteInstanceConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteInstanceConfigRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.DeleteInstanceConfigRequest.verify|verify} messages. - * @param message DeleteInstanceConfigRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.instance.v1.IDeleteInstanceConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteInstanceConfigRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteInstanceConfigRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.DeleteInstanceConfigRequest; - - /** - * Decodes a DeleteInstanceConfigRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteInstanceConfigRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.DeleteInstanceConfigRequest; - - /** - * Verifies a DeleteInstanceConfigRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteInstanceConfigRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteInstanceConfigRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.DeleteInstanceConfigRequest; - - /** - * Creates a plain object from a DeleteInstanceConfigRequest message. Also converts values to other types if specified. - * @param message DeleteInstanceConfigRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.instance.v1.DeleteInstanceConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteInstanceConfigRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteInstanceConfigRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListInstanceConfigOperationsRequest. */ - interface IListInstanceConfigOperationsRequest { - - /** ListInstanceConfigOperationsRequest parent */ - parent?: (string|null); - - /** ListInstanceConfigOperationsRequest filter */ - filter?: (string|null); - - /** ListInstanceConfigOperationsRequest pageSize */ - pageSize?: (number|null); - - /** ListInstanceConfigOperationsRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListInstanceConfigOperationsRequest. */ - class ListInstanceConfigOperationsRequest implements IListInstanceConfigOperationsRequest { - - /** - * Constructs a new ListInstanceConfigOperationsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.instance.v1.IListInstanceConfigOperationsRequest); - - /** ListInstanceConfigOperationsRequest parent. */ - public parent: string; - - /** ListInstanceConfigOperationsRequest filter. */ - public filter: string; - - /** ListInstanceConfigOperationsRequest pageSize. */ - public pageSize: number; - - /** ListInstanceConfigOperationsRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListInstanceConfigOperationsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListInstanceConfigOperationsRequest instance - */ - public static create(properties?: google.spanner.admin.instance.v1.IListInstanceConfigOperationsRequest): google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest; - - /** - * Encodes the specified ListInstanceConfigOperationsRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest.verify|verify} messages. - * @param message ListInstanceConfigOperationsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.instance.v1.IListInstanceConfigOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListInstanceConfigOperationsRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest.verify|verify} messages. - * @param message ListInstanceConfigOperationsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.instance.v1.IListInstanceConfigOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListInstanceConfigOperationsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListInstanceConfigOperationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest; - - /** - * Decodes a ListInstanceConfigOperationsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListInstanceConfigOperationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest; - - /** - * Verifies a ListInstanceConfigOperationsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListInstanceConfigOperationsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListInstanceConfigOperationsRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest; - - /** - * Creates a plain object from a ListInstanceConfigOperationsRequest message. Also converts values to other types if specified. - * @param message ListInstanceConfigOperationsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListInstanceConfigOperationsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListInstanceConfigOperationsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListInstanceConfigOperationsResponse. */ - interface IListInstanceConfigOperationsResponse { - - /** ListInstanceConfigOperationsResponse operations */ - operations?: (google.longrunning.IOperation[]|null); - - /** ListInstanceConfigOperationsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListInstanceConfigOperationsResponse. */ - class ListInstanceConfigOperationsResponse implements IListInstanceConfigOperationsResponse { - - /** - * Constructs a new ListInstanceConfigOperationsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.instance.v1.IListInstanceConfigOperationsResponse); - - /** ListInstanceConfigOperationsResponse operations. */ - public operations: google.longrunning.IOperation[]; - - /** ListInstanceConfigOperationsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListInstanceConfigOperationsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListInstanceConfigOperationsResponse instance - */ - public static create(properties?: google.spanner.admin.instance.v1.IListInstanceConfigOperationsResponse): google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse; - - /** - * Encodes the specified ListInstanceConfigOperationsResponse message. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse.verify|verify} messages. - * @param message ListInstanceConfigOperationsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.instance.v1.IListInstanceConfigOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListInstanceConfigOperationsResponse message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse.verify|verify} messages. - * @param message ListInstanceConfigOperationsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.instance.v1.IListInstanceConfigOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListInstanceConfigOperationsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListInstanceConfigOperationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse; - - /** - * Decodes a ListInstanceConfigOperationsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListInstanceConfigOperationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse; - - /** - * Verifies a ListInstanceConfigOperationsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListInstanceConfigOperationsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListInstanceConfigOperationsResponse - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse; - - /** - * Creates a plain object from a ListInstanceConfigOperationsResponse message. Also converts values to other types if specified. - * @param message ListInstanceConfigOperationsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListInstanceConfigOperationsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListInstanceConfigOperationsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetInstanceRequest. */ - interface IGetInstanceRequest { - - /** GetInstanceRequest name */ - name?: (string|null); - - /** GetInstanceRequest fieldMask */ - fieldMask?: (google.protobuf.IFieldMask|null); - } - - /** Represents a GetInstanceRequest. */ - class GetInstanceRequest implements IGetInstanceRequest { - - /** - * Constructs a new GetInstanceRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.instance.v1.IGetInstanceRequest); - - /** GetInstanceRequest name. */ - public name: string; - - /** GetInstanceRequest fieldMask. */ - public fieldMask?: (google.protobuf.IFieldMask|null); - - /** - * Creates a new GetInstanceRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetInstanceRequest instance - */ - public static create(properties?: google.spanner.admin.instance.v1.IGetInstanceRequest): google.spanner.admin.instance.v1.GetInstanceRequest; - - /** - * Encodes the specified GetInstanceRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.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.spanner.admin.instance.v1.IGetInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetInstanceRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.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.spanner.admin.instance.v1.IGetInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetInstanceRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.GetInstanceRequest; - - /** - * Decodes a GetInstanceRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.GetInstanceRequest; - - /** - * Verifies a GetInstanceRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetInstanceRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetInstanceRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.GetInstanceRequest; - - /** - * Creates a plain object from a GetInstanceRequest message. Also converts values to other types if specified. - * @param message GetInstanceRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.instance.v1.GetInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetInstanceRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetInstanceRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateInstanceRequest. */ - interface ICreateInstanceRequest { - - /** CreateInstanceRequest parent */ - parent?: (string|null); - - /** CreateInstanceRequest instanceId */ - instanceId?: (string|null); - - /** CreateInstanceRequest instance */ - instance?: (google.spanner.admin.instance.v1.IInstance|null); - } - - /** Represents a CreateInstanceRequest. */ - class CreateInstanceRequest implements ICreateInstanceRequest { - - /** - * Constructs a new CreateInstanceRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.instance.v1.ICreateInstanceRequest); - - /** CreateInstanceRequest parent. */ - public parent: string; - - /** CreateInstanceRequest instanceId. */ - public instanceId: string; - - /** CreateInstanceRequest instance. */ - public instance?: (google.spanner.admin.instance.v1.IInstance|null); - - /** - * Creates a new CreateInstanceRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateInstanceRequest instance - */ - public static create(properties?: google.spanner.admin.instance.v1.ICreateInstanceRequest): google.spanner.admin.instance.v1.CreateInstanceRequest; - - /** - * Encodes the specified CreateInstanceRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.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.spanner.admin.instance.v1.ICreateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateInstanceRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.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.spanner.admin.instance.v1.ICreateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateInstanceRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.CreateInstanceRequest; - - /** - * Decodes a CreateInstanceRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.CreateInstanceRequest; - - /** - * Verifies a CreateInstanceRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateInstanceRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateInstanceRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.CreateInstanceRequest; - - /** - * Creates a plain object from a CreateInstanceRequest message. Also converts values to other types if specified. - * @param message CreateInstanceRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.instance.v1.CreateInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateInstanceRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateInstanceRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListInstancesRequest. */ - interface IListInstancesRequest { - - /** ListInstancesRequest parent */ - parent?: (string|null); - - /** ListInstancesRequest pageSize */ - pageSize?: (number|null); - - /** ListInstancesRequest pageToken */ - pageToken?: (string|null); - - /** ListInstancesRequest filter */ - filter?: (string|null); - - /** ListInstancesRequest instanceDeadline */ - instanceDeadline?: (google.protobuf.ITimestamp|null); - } - - /** Represents a ListInstancesRequest. */ - class ListInstancesRequest implements IListInstancesRequest { - - /** - * Constructs a new ListInstancesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.instance.v1.IListInstancesRequest); - - /** ListInstancesRequest parent. */ - public parent: string; - - /** ListInstancesRequest pageSize. */ - public pageSize: number; - - /** ListInstancesRequest pageToken. */ - public pageToken: string; - - /** ListInstancesRequest filter. */ - public filter: string; - - /** ListInstancesRequest instanceDeadline. */ - public instanceDeadline?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new ListInstancesRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListInstancesRequest instance - */ - public static create(properties?: google.spanner.admin.instance.v1.IListInstancesRequest): google.spanner.admin.instance.v1.ListInstancesRequest; - - /** - * Encodes the specified ListInstancesRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancesRequest.verify|verify} messages. - * @param message ListInstancesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.instance.v1.IListInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListInstancesRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancesRequest.verify|verify} messages. - * @param message ListInstancesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.instance.v1.IListInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListInstancesRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListInstancesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.ListInstancesRequest; - - /** - * Decodes a ListInstancesRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListInstancesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.ListInstancesRequest; - - /** - * Verifies a ListInstancesRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListInstancesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListInstancesRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.ListInstancesRequest; - - /** - * Creates a plain object from a ListInstancesRequest message. Also converts values to other types if specified. - * @param message ListInstancesRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.instance.v1.ListInstancesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListInstancesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListInstancesRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListInstancesResponse. */ - interface IListInstancesResponse { - - /** ListInstancesResponse instances */ - instances?: (google.spanner.admin.instance.v1.IInstance[]|null); - - /** ListInstancesResponse nextPageToken */ - nextPageToken?: (string|null); - - /** ListInstancesResponse unreachable */ - unreachable?: (string[]|null); - } - - /** Represents a ListInstancesResponse. */ - class ListInstancesResponse implements IListInstancesResponse { - - /** - * Constructs a new ListInstancesResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.instance.v1.IListInstancesResponse); - - /** ListInstancesResponse instances. */ - public instances: google.spanner.admin.instance.v1.IInstance[]; - - /** ListInstancesResponse nextPageToken. */ - public nextPageToken: string; - - /** ListInstancesResponse unreachable. */ - public unreachable: string[]; - - /** - * Creates a new ListInstancesResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListInstancesResponse instance - */ - public static create(properties?: google.spanner.admin.instance.v1.IListInstancesResponse): google.spanner.admin.instance.v1.ListInstancesResponse; - - /** - * Encodes the specified ListInstancesResponse message. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancesResponse.verify|verify} messages. - * @param message ListInstancesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.instance.v1.IListInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListInstancesResponse message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancesResponse.verify|verify} messages. - * @param message ListInstancesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.instance.v1.IListInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListInstancesResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListInstancesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.ListInstancesResponse; - - /** - * Decodes a ListInstancesResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListInstancesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.ListInstancesResponse; - - /** - * Verifies a ListInstancesResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListInstancesResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListInstancesResponse - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.ListInstancesResponse; - - /** - * Creates a plain object from a ListInstancesResponse message. Also converts values to other types if specified. - * @param message ListInstancesResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.instance.v1.ListInstancesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListInstancesResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListInstancesResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateInstanceRequest. */ - interface IUpdateInstanceRequest { - - /** UpdateInstanceRequest instance */ - instance?: (google.spanner.admin.instance.v1.IInstance|null); - - /** UpdateInstanceRequest fieldMask */ - fieldMask?: (google.protobuf.IFieldMask|null); - } - - /** Represents an UpdateInstanceRequest. */ - class UpdateInstanceRequest implements IUpdateInstanceRequest { - - /** - * Constructs a new UpdateInstanceRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.instance.v1.IUpdateInstanceRequest); - - /** UpdateInstanceRequest instance. */ - public instance?: (google.spanner.admin.instance.v1.IInstance|null); - - /** UpdateInstanceRequest fieldMask. */ - public fieldMask?: (google.protobuf.IFieldMask|null); - - /** - * Creates a new UpdateInstanceRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateInstanceRequest instance - */ - public static create(properties?: google.spanner.admin.instance.v1.IUpdateInstanceRequest): google.spanner.admin.instance.v1.UpdateInstanceRequest; - - /** - * Encodes the specified UpdateInstanceRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.UpdateInstanceRequest.verify|verify} messages. - * @param message UpdateInstanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.instance.v1.IUpdateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateInstanceRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.UpdateInstanceRequest.verify|verify} messages. - * @param message UpdateInstanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.instance.v1.IUpdateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateInstanceRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.UpdateInstanceRequest; - - /** - * Decodes an UpdateInstanceRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.UpdateInstanceRequest; - - /** - * Verifies an UpdateInstanceRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UpdateInstanceRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateInstanceRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.UpdateInstanceRequest; - - /** - * Creates a plain object from an UpdateInstanceRequest message. Also converts values to other types if specified. - * @param message UpdateInstanceRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.instance.v1.UpdateInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateInstanceRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateInstanceRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteInstanceRequest. */ - interface IDeleteInstanceRequest { - - /** DeleteInstanceRequest name */ - name?: (string|null); - } - - /** Represents a DeleteInstanceRequest. */ - class DeleteInstanceRequest implements IDeleteInstanceRequest { - - /** - * Constructs a new DeleteInstanceRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.instance.v1.IDeleteInstanceRequest); - - /** DeleteInstanceRequest name. */ - public name: string; - - /** - * Creates a new DeleteInstanceRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteInstanceRequest instance - */ - public static create(properties?: google.spanner.admin.instance.v1.IDeleteInstanceRequest): google.spanner.admin.instance.v1.DeleteInstanceRequest; - - /** - * Encodes the specified DeleteInstanceRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.DeleteInstanceRequest.verify|verify} messages. - * @param message DeleteInstanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.instance.v1.IDeleteInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteInstanceRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.DeleteInstanceRequest.verify|verify} messages. - * @param message DeleteInstanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.instance.v1.IDeleteInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteInstanceRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.DeleteInstanceRequest; - - /** - * Decodes a DeleteInstanceRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.DeleteInstanceRequest; - - /** - * Verifies a DeleteInstanceRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteInstanceRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteInstanceRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.DeleteInstanceRequest; - - /** - * Creates a plain object from a DeleteInstanceRequest message. Also converts values to other types if specified. - * @param message DeleteInstanceRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.instance.v1.DeleteInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteInstanceRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteInstanceRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateInstanceMetadata. */ - interface ICreateInstanceMetadata { - - /** CreateInstanceMetadata instance */ - instance?: (google.spanner.admin.instance.v1.IInstance|null); - - /** CreateInstanceMetadata startTime */ - startTime?: (google.protobuf.ITimestamp|null); - - /** CreateInstanceMetadata cancelTime */ - cancelTime?: (google.protobuf.ITimestamp|null); - - /** CreateInstanceMetadata endTime */ - endTime?: (google.protobuf.ITimestamp|null); - - /** CreateInstanceMetadata expectedFulfillmentPeriod */ - expectedFulfillmentPeriod?: (google.spanner.admin.instance.v1.FulfillmentPeriod|keyof typeof google.spanner.admin.instance.v1.FulfillmentPeriod|null); - } - - /** Represents a CreateInstanceMetadata. */ - class CreateInstanceMetadata implements ICreateInstanceMetadata { - - /** - * Constructs a new CreateInstanceMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.instance.v1.ICreateInstanceMetadata); - - /** CreateInstanceMetadata instance. */ - public instance?: (google.spanner.admin.instance.v1.IInstance|null); - - /** CreateInstanceMetadata startTime. */ - public startTime?: (google.protobuf.ITimestamp|null); - - /** CreateInstanceMetadata cancelTime. */ - public cancelTime?: (google.protobuf.ITimestamp|null); - - /** CreateInstanceMetadata endTime. */ - public endTime?: (google.protobuf.ITimestamp|null); - - /** CreateInstanceMetadata expectedFulfillmentPeriod. */ - public expectedFulfillmentPeriod: (google.spanner.admin.instance.v1.FulfillmentPeriod|keyof typeof google.spanner.admin.instance.v1.FulfillmentPeriod); - - /** - * Creates a new CreateInstanceMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateInstanceMetadata instance - */ - public static create(properties?: google.spanner.admin.instance.v1.ICreateInstanceMetadata): google.spanner.admin.instance.v1.CreateInstanceMetadata; - - /** - * Encodes the specified CreateInstanceMetadata message. Does not implicitly {@link google.spanner.admin.instance.v1.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.spanner.admin.instance.v1.ICreateInstanceMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateInstanceMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.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.spanner.admin.instance.v1.ICreateInstanceMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateInstanceMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateInstanceMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.CreateInstanceMetadata; - - /** - * Decodes a CreateInstanceMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateInstanceMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.CreateInstanceMetadata; - - /** - * Verifies a CreateInstanceMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateInstanceMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateInstanceMetadata - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.CreateInstanceMetadata; - - /** - * Creates a plain object from a CreateInstanceMetadata message. Also converts values to other types if specified. - * @param message CreateInstanceMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.instance.v1.CreateInstanceMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateInstanceMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateInstanceMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateInstanceMetadata. */ - interface IUpdateInstanceMetadata { - - /** UpdateInstanceMetadata instance */ - instance?: (google.spanner.admin.instance.v1.IInstance|null); - - /** UpdateInstanceMetadata startTime */ - startTime?: (google.protobuf.ITimestamp|null); - - /** UpdateInstanceMetadata cancelTime */ - cancelTime?: (google.protobuf.ITimestamp|null); - - /** UpdateInstanceMetadata endTime */ - endTime?: (google.protobuf.ITimestamp|null); - - /** UpdateInstanceMetadata expectedFulfillmentPeriod */ - expectedFulfillmentPeriod?: (google.spanner.admin.instance.v1.FulfillmentPeriod|keyof typeof google.spanner.admin.instance.v1.FulfillmentPeriod|null); - } - - /** Represents an UpdateInstanceMetadata. */ - class UpdateInstanceMetadata implements IUpdateInstanceMetadata { - - /** - * Constructs a new UpdateInstanceMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.instance.v1.IUpdateInstanceMetadata); - - /** UpdateInstanceMetadata instance. */ - public instance?: (google.spanner.admin.instance.v1.IInstance|null); - - /** UpdateInstanceMetadata startTime. */ - public startTime?: (google.protobuf.ITimestamp|null); - - /** UpdateInstanceMetadata cancelTime. */ - public cancelTime?: (google.protobuf.ITimestamp|null); - - /** UpdateInstanceMetadata endTime. */ - public endTime?: (google.protobuf.ITimestamp|null); - - /** UpdateInstanceMetadata expectedFulfillmentPeriod. */ - public expectedFulfillmentPeriod: (google.spanner.admin.instance.v1.FulfillmentPeriod|keyof typeof google.spanner.admin.instance.v1.FulfillmentPeriod); - - /** - * Creates a new UpdateInstanceMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateInstanceMetadata instance - */ - public static create(properties?: google.spanner.admin.instance.v1.IUpdateInstanceMetadata): google.spanner.admin.instance.v1.UpdateInstanceMetadata; - - /** - * Encodes the specified UpdateInstanceMetadata message. Does not implicitly {@link google.spanner.admin.instance.v1.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.spanner.admin.instance.v1.IUpdateInstanceMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateInstanceMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.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.spanner.admin.instance.v1.IUpdateInstanceMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateInstanceMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateInstanceMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.UpdateInstanceMetadata; - - /** - * Decodes an UpdateInstanceMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateInstanceMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.UpdateInstanceMetadata; - - /** - * Verifies an UpdateInstanceMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UpdateInstanceMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateInstanceMetadata - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.UpdateInstanceMetadata; - - /** - * Creates a plain object from an UpdateInstanceMetadata message. Also converts values to other types if specified. - * @param message UpdateInstanceMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.instance.v1.UpdateInstanceMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateInstanceMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateInstanceMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a FreeInstanceMetadata. */ - interface IFreeInstanceMetadata { - - /** FreeInstanceMetadata expireTime */ - expireTime?: (google.protobuf.ITimestamp|null); - - /** FreeInstanceMetadata upgradeTime */ - upgradeTime?: (google.protobuf.ITimestamp|null); - - /** FreeInstanceMetadata expireBehavior */ - expireBehavior?: (google.spanner.admin.instance.v1.FreeInstanceMetadata.ExpireBehavior|keyof typeof google.spanner.admin.instance.v1.FreeInstanceMetadata.ExpireBehavior|null); - } - - /** Represents a FreeInstanceMetadata. */ - class FreeInstanceMetadata implements IFreeInstanceMetadata { - - /** - * Constructs a new FreeInstanceMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.instance.v1.IFreeInstanceMetadata); - - /** FreeInstanceMetadata expireTime. */ - public expireTime?: (google.protobuf.ITimestamp|null); - - /** FreeInstanceMetadata upgradeTime. */ - public upgradeTime?: (google.protobuf.ITimestamp|null); - - /** FreeInstanceMetadata expireBehavior. */ - public expireBehavior: (google.spanner.admin.instance.v1.FreeInstanceMetadata.ExpireBehavior|keyof typeof google.spanner.admin.instance.v1.FreeInstanceMetadata.ExpireBehavior); - - /** - * Creates a new FreeInstanceMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns FreeInstanceMetadata instance - */ - public static create(properties?: google.spanner.admin.instance.v1.IFreeInstanceMetadata): google.spanner.admin.instance.v1.FreeInstanceMetadata; - - /** - * Encodes the specified FreeInstanceMetadata message. Does not implicitly {@link google.spanner.admin.instance.v1.FreeInstanceMetadata.verify|verify} messages. - * @param message FreeInstanceMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.instance.v1.IFreeInstanceMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FreeInstanceMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.FreeInstanceMetadata.verify|verify} messages. - * @param message FreeInstanceMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.instance.v1.IFreeInstanceMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FreeInstanceMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FreeInstanceMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.FreeInstanceMetadata; - - /** - * Decodes a FreeInstanceMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FreeInstanceMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.FreeInstanceMetadata; - - /** - * Verifies a FreeInstanceMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FreeInstanceMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FreeInstanceMetadata - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.FreeInstanceMetadata; - - /** - * Creates a plain object from a FreeInstanceMetadata message. Also converts values to other types if specified. - * @param message FreeInstanceMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.instance.v1.FreeInstanceMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FreeInstanceMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FreeInstanceMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FreeInstanceMetadata { - - /** ExpireBehavior enum. */ - enum ExpireBehavior { - EXPIRE_BEHAVIOR_UNSPECIFIED = 0, - FREE_TO_PROVISIONED = 1, - REMOVE_AFTER_GRACE_PERIOD = 2 - } - } - - /** Properties of a CreateInstanceConfigMetadata. */ - interface ICreateInstanceConfigMetadata { - - /** CreateInstanceConfigMetadata instanceConfig */ - instanceConfig?: (google.spanner.admin.instance.v1.IInstanceConfig|null); - - /** CreateInstanceConfigMetadata progress */ - progress?: (google.spanner.admin.instance.v1.IOperationProgress|null); - - /** CreateInstanceConfigMetadata cancelTime */ - cancelTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a CreateInstanceConfigMetadata. */ - class CreateInstanceConfigMetadata implements ICreateInstanceConfigMetadata { - - /** - * Constructs a new CreateInstanceConfigMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.instance.v1.ICreateInstanceConfigMetadata); - - /** CreateInstanceConfigMetadata instanceConfig. */ - public instanceConfig?: (google.spanner.admin.instance.v1.IInstanceConfig|null); - - /** CreateInstanceConfigMetadata progress. */ - public progress?: (google.spanner.admin.instance.v1.IOperationProgress|null); - - /** CreateInstanceConfigMetadata cancelTime. */ - public cancelTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new CreateInstanceConfigMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateInstanceConfigMetadata instance - */ - public static create(properties?: google.spanner.admin.instance.v1.ICreateInstanceConfigMetadata): google.spanner.admin.instance.v1.CreateInstanceConfigMetadata; - - /** - * Encodes the specified CreateInstanceConfigMetadata message. Does not implicitly {@link google.spanner.admin.instance.v1.CreateInstanceConfigMetadata.verify|verify} messages. - * @param message CreateInstanceConfigMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.instance.v1.ICreateInstanceConfigMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateInstanceConfigMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.CreateInstanceConfigMetadata.verify|verify} messages. - * @param message CreateInstanceConfigMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.instance.v1.ICreateInstanceConfigMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateInstanceConfigMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateInstanceConfigMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.CreateInstanceConfigMetadata; - - /** - * Decodes a CreateInstanceConfigMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateInstanceConfigMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.CreateInstanceConfigMetadata; - - /** - * Verifies a CreateInstanceConfigMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateInstanceConfigMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateInstanceConfigMetadata - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.CreateInstanceConfigMetadata; - - /** - * Creates a plain object from a CreateInstanceConfigMetadata message. Also converts values to other types if specified. - * @param message CreateInstanceConfigMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.instance.v1.CreateInstanceConfigMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateInstanceConfigMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateInstanceConfigMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateInstanceConfigMetadata. */ - interface IUpdateInstanceConfigMetadata { - - /** UpdateInstanceConfigMetadata instanceConfig */ - instanceConfig?: (google.spanner.admin.instance.v1.IInstanceConfig|null); - - /** UpdateInstanceConfigMetadata progress */ - progress?: (google.spanner.admin.instance.v1.IOperationProgress|null); - - /** UpdateInstanceConfigMetadata cancelTime */ - cancelTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents an UpdateInstanceConfigMetadata. */ - class UpdateInstanceConfigMetadata implements IUpdateInstanceConfigMetadata { - - /** - * Constructs a new UpdateInstanceConfigMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.instance.v1.IUpdateInstanceConfigMetadata); - - /** UpdateInstanceConfigMetadata instanceConfig. */ - public instanceConfig?: (google.spanner.admin.instance.v1.IInstanceConfig|null); - - /** UpdateInstanceConfigMetadata progress. */ - public progress?: (google.spanner.admin.instance.v1.IOperationProgress|null); - - /** UpdateInstanceConfigMetadata cancelTime. */ - public cancelTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new UpdateInstanceConfigMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateInstanceConfigMetadata instance - */ - public static create(properties?: google.spanner.admin.instance.v1.IUpdateInstanceConfigMetadata): google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata; - - /** - * Encodes the specified UpdateInstanceConfigMetadata message. Does not implicitly {@link google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata.verify|verify} messages. - * @param message UpdateInstanceConfigMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.instance.v1.IUpdateInstanceConfigMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateInstanceConfigMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata.verify|verify} messages. - * @param message UpdateInstanceConfigMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.instance.v1.IUpdateInstanceConfigMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateInstanceConfigMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateInstanceConfigMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata; - - /** - * Decodes an UpdateInstanceConfigMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateInstanceConfigMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata; - - /** - * Verifies an UpdateInstanceConfigMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UpdateInstanceConfigMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateInstanceConfigMetadata - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata; - - /** - * Creates a plain object from an UpdateInstanceConfigMetadata message. Also converts values to other types if specified. - * @param message UpdateInstanceConfigMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateInstanceConfigMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateInstanceConfigMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an InstancePartition. */ - interface IInstancePartition { - - /** InstancePartition name */ - name?: (string|null); - - /** InstancePartition config */ - config?: (string|null); - - /** InstancePartition displayName */ - displayName?: (string|null); - - /** InstancePartition nodeCount */ - nodeCount?: (number|null); - - /** InstancePartition processingUnits */ - processingUnits?: (number|null); - - /** InstancePartition autoscalingConfig */ - autoscalingConfig?: (google.spanner.admin.instance.v1.IAutoscalingConfig|null); - - /** InstancePartition state */ - state?: (google.spanner.admin.instance.v1.InstancePartition.State|keyof typeof google.spanner.admin.instance.v1.InstancePartition.State|null); - - /** InstancePartition createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** InstancePartition updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** InstancePartition referencingDatabases */ - referencingDatabases?: (string[]|null); - - /** InstancePartition referencingBackups */ - referencingBackups?: (string[]|null); - - /** InstancePartition etag */ - etag?: (string|null); - } - - /** Represents an InstancePartition. */ - class InstancePartition implements IInstancePartition { - - /** - * Constructs a new InstancePartition. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.instance.v1.IInstancePartition); - - /** InstancePartition name. */ - public name: string; - - /** InstancePartition config. */ - public config: string; - - /** InstancePartition displayName. */ - public displayName: string; - - /** InstancePartition nodeCount. */ - public nodeCount?: (number|null); - - /** InstancePartition processingUnits. */ - public processingUnits?: (number|null); - - /** InstancePartition autoscalingConfig. */ - public autoscalingConfig?: (google.spanner.admin.instance.v1.IAutoscalingConfig|null); - - /** InstancePartition state. */ - public state: (google.spanner.admin.instance.v1.InstancePartition.State|keyof typeof google.spanner.admin.instance.v1.InstancePartition.State); - - /** InstancePartition createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** InstancePartition updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** InstancePartition referencingDatabases. */ - public referencingDatabases: string[]; - - /** InstancePartition referencingBackups. */ - public referencingBackups: string[]; - - /** InstancePartition etag. */ - public etag: string; - - /** InstancePartition computeCapacity. */ - public computeCapacity?: ("nodeCount"|"processingUnits"); - - /** - * Creates a new InstancePartition instance using the specified properties. - * @param [properties] Properties to set - * @returns InstancePartition instance - */ - public static create(properties?: google.spanner.admin.instance.v1.IInstancePartition): google.spanner.admin.instance.v1.InstancePartition; - - /** - * Encodes the specified InstancePartition message. Does not implicitly {@link google.spanner.admin.instance.v1.InstancePartition.verify|verify} messages. - * @param message InstancePartition message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.instance.v1.IInstancePartition, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified InstancePartition message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.InstancePartition.verify|verify} messages. - * @param message InstancePartition message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.instance.v1.IInstancePartition, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an InstancePartition message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns InstancePartition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.InstancePartition; - - /** - * Decodes an InstancePartition message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns InstancePartition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.InstancePartition; - - /** - * Verifies an InstancePartition message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an InstancePartition message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns InstancePartition - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.InstancePartition; - - /** - * Creates a plain object from an InstancePartition message. Also converts values to other types if specified. - * @param message InstancePartition - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.instance.v1.InstancePartition, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this InstancePartition to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for InstancePartition - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace InstancePartition { - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - CREATING = 1, - READY = 2 - } - } - - /** Properties of a CreateInstancePartitionMetadata. */ - interface ICreateInstancePartitionMetadata { - - /** CreateInstancePartitionMetadata instancePartition */ - instancePartition?: (google.spanner.admin.instance.v1.IInstancePartition|null); - - /** CreateInstancePartitionMetadata startTime */ - startTime?: (google.protobuf.ITimestamp|null); - - /** CreateInstancePartitionMetadata cancelTime */ - cancelTime?: (google.protobuf.ITimestamp|null); - - /** CreateInstancePartitionMetadata endTime */ - endTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a CreateInstancePartitionMetadata. */ - class CreateInstancePartitionMetadata implements ICreateInstancePartitionMetadata { - - /** - * Constructs a new CreateInstancePartitionMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.instance.v1.ICreateInstancePartitionMetadata); - - /** CreateInstancePartitionMetadata instancePartition. */ - public instancePartition?: (google.spanner.admin.instance.v1.IInstancePartition|null); - - /** CreateInstancePartitionMetadata startTime. */ - public startTime?: (google.protobuf.ITimestamp|null); - - /** CreateInstancePartitionMetadata cancelTime. */ - public cancelTime?: (google.protobuf.ITimestamp|null); - - /** CreateInstancePartitionMetadata endTime. */ - public endTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new CreateInstancePartitionMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateInstancePartitionMetadata instance - */ - public static create(properties?: google.spanner.admin.instance.v1.ICreateInstancePartitionMetadata): google.spanner.admin.instance.v1.CreateInstancePartitionMetadata; - - /** - * Encodes the specified CreateInstancePartitionMetadata message. Does not implicitly {@link google.spanner.admin.instance.v1.CreateInstancePartitionMetadata.verify|verify} messages. - * @param message CreateInstancePartitionMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.instance.v1.ICreateInstancePartitionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateInstancePartitionMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.CreateInstancePartitionMetadata.verify|verify} messages. - * @param message CreateInstancePartitionMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.instance.v1.ICreateInstancePartitionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateInstancePartitionMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateInstancePartitionMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.CreateInstancePartitionMetadata; - - /** - * Decodes a CreateInstancePartitionMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateInstancePartitionMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.CreateInstancePartitionMetadata; - - /** - * Verifies a CreateInstancePartitionMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateInstancePartitionMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateInstancePartitionMetadata - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.CreateInstancePartitionMetadata; - - /** - * Creates a plain object from a CreateInstancePartitionMetadata message. Also converts values to other types if specified. - * @param message CreateInstancePartitionMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.instance.v1.CreateInstancePartitionMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateInstancePartitionMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateInstancePartitionMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateInstancePartitionRequest. */ - interface ICreateInstancePartitionRequest { - - /** CreateInstancePartitionRequest parent */ - parent?: (string|null); - - /** CreateInstancePartitionRequest instancePartitionId */ - instancePartitionId?: (string|null); - - /** CreateInstancePartitionRequest instancePartition */ - instancePartition?: (google.spanner.admin.instance.v1.IInstancePartition|null); - } - - /** Represents a CreateInstancePartitionRequest. */ - class CreateInstancePartitionRequest implements ICreateInstancePartitionRequest { - - /** - * Constructs a new CreateInstancePartitionRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.instance.v1.ICreateInstancePartitionRequest); - - /** CreateInstancePartitionRequest parent. */ - public parent: string; - - /** CreateInstancePartitionRequest instancePartitionId. */ - public instancePartitionId: string; - - /** CreateInstancePartitionRequest instancePartition. */ - public instancePartition?: (google.spanner.admin.instance.v1.IInstancePartition|null); - - /** - * Creates a new CreateInstancePartitionRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateInstancePartitionRequest instance - */ - public static create(properties?: google.spanner.admin.instance.v1.ICreateInstancePartitionRequest): google.spanner.admin.instance.v1.CreateInstancePartitionRequest; - - /** - * Encodes the specified CreateInstancePartitionRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.CreateInstancePartitionRequest.verify|verify} messages. - * @param message CreateInstancePartitionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.instance.v1.ICreateInstancePartitionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateInstancePartitionRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.CreateInstancePartitionRequest.verify|verify} messages. - * @param message CreateInstancePartitionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.instance.v1.ICreateInstancePartitionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateInstancePartitionRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateInstancePartitionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.CreateInstancePartitionRequest; - - /** - * Decodes a CreateInstancePartitionRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateInstancePartitionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.CreateInstancePartitionRequest; - - /** - * Verifies a CreateInstancePartitionRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateInstancePartitionRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateInstancePartitionRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.CreateInstancePartitionRequest; - - /** - * Creates a plain object from a CreateInstancePartitionRequest message. Also converts values to other types if specified. - * @param message CreateInstancePartitionRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.instance.v1.CreateInstancePartitionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateInstancePartitionRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateInstancePartitionRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteInstancePartitionRequest. */ - interface IDeleteInstancePartitionRequest { - - /** DeleteInstancePartitionRequest name */ - name?: (string|null); - - /** DeleteInstancePartitionRequest etag */ - etag?: (string|null); - } - - /** Represents a DeleteInstancePartitionRequest. */ - class DeleteInstancePartitionRequest implements IDeleteInstancePartitionRequest { - - /** - * Constructs a new DeleteInstancePartitionRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.instance.v1.IDeleteInstancePartitionRequest); - - /** DeleteInstancePartitionRequest name. */ - public name: string; - - /** DeleteInstancePartitionRequest etag. */ - public etag: string; - - /** - * Creates a new DeleteInstancePartitionRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteInstancePartitionRequest instance - */ - public static create(properties?: google.spanner.admin.instance.v1.IDeleteInstancePartitionRequest): google.spanner.admin.instance.v1.DeleteInstancePartitionRequest; - - /** - * Encodes the specified DeleteInstancePartitionRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.DeleteInstancePartitionRequest.verify|verify} messages. - * @param message DeleteInstancePartitionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.instance.v1.IDeleteInstancePartitionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteInstancePartitionRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.DeleteInstancePartitionRequest.verify|verify} messages. - * @param message DeleteInstancePartitionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.instance.v1.IDeleteInstancePartitionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteInstancePartitionRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteInstancePartitionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.DeleteInstancePartitionRequest; - - /** - * Decodes a DeleteInstancePartitionRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteInstancePartitionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.DeleteInstancePartitionRequest; - - /** - * Verifies a DeleteInstancePartitionRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteInstancePartitionRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteInstancePartitionRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.DeleteInstancePartitionRequest; - - /** - * Creates a plain object from a DeleteInstancePartitionRequest message. Also converts values to other types if specified. - * @param message DeleteInstancePartitionRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.instance.v1.DeleteInstancePartitionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteInstancePartitionRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteInstancePartitionRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetInstancePartitionRequest. */ - interface IGetInstancePartitionRequest { - - /** GetInstancePartitionRequest name */ - name?: (string|null); - } - - /** Represents a GetInstancePartitionRequest. */ - class GetInstancePartitionRequest implements IGetInstancePartitionRequest { - - /** - * Constructs a new GetInstancePartitionRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.instance.v1.IGetInstancePartitionRequest); - - /** GetInstancePartitionRequest name. */ - public name: string; - - /** - * Creates a new GetInstancePartitionRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetInstancePartitionRequest instance - */ - public static create(properties?: google.spanner.admin.instance.v1.IGetInstancePartitionRequest): google.spanner.admin.instance.v1.GetInstancePartitionRequest; - - /** - * Encodes the specified GetInstancePartitionRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.GetInstancePartitionRequest.verify|verify} messages. - * @param message GetInstancePartitionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.instance.v1.IGetInstancePartitionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetInstancePartitionRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.GetInstancePartitionRequest.verify|verify} messages. - * @param message GetInstancePartitionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.instance.v1.IGetInstancePartitionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetInstancePartitionRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetInstancePartitionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.GetInstancePartitionRequest; - - /** - * Decodes a GetInstancePartitionRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetInstancePartitionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.GetInstancePartitionRequest; - - /** - * Verifies a GetInstancePartitionRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetInstancePartitionRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetInstancePartitionRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.GetInstancePartitionRequest; - - /** - * Creates a plain object from a GetInstancePartitionRequest message. Also converts values to other types if specified. - * @param message GetInstancePartitionRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.instance.v1.GetInstancePartitionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetInstancePartitionRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetInstancePartitionRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateInstancePartitionRequest. */ - interface IUpdateInstancePartitionRequest { - - /** UpdateInstancePartitionRequest instancePartition */ - instancePartition?: (google.spanner.admin.instance.v1.IInstancePartition|null); - - /** UpdateInstancePartitionRequest fieldMask */ - fieldMask?: (google.protobuf.IFieldMask|null); - } - - /** Represents an UpdateInstancePartitionRequest. */ - class UpdateInstancePartitionRequest implements IUpdateInstancePartitionRequest { - - /** - * Constructs a new UpdateInstancePartitionRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.instance.v1.IUpdateInstancePartitionRequest); - - /** UpdateInstancePartitionRequest instancePartition. */ - public instancePartition?: (google.spanner.admin.instance.v1.IInstancePartition|null); - - /** UpdateInstancePartitionRequest fieldMask. */ - public fieldMask?: (google.protobuf.IFieldMask|null); - - /** - * Creates a new UpdateInstancePartitionRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateInstancePartitionRequest instance - */ - public static create(properties?: google.spanner.admin.instance.v1.IUpdateInstancePartitionRequest): google.spanner.admin.instance.v1.UpdateInstancePartitionRequest; - - /** - * Encodes the specified UpdateInstancePartitionRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.UpdateInstancePartitionRequest.verify|verify} messages. - * @param message UpdateInstancePartitionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.instance.v1.IUpdateInstancePartitionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateInstancePartitionRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.UpdateInstancePartitionRequest.verify|verify} messages. - * @param message UpdateInstancePartitionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.instance.v1.IUpdateInstancePartitionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateInstancePartitionRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateInstancePartitionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.UpdateInstancePartitionRequest; - - /** - * Decodes an UpdateInstancePartitionRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateInstancePartitionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.UpdateInstancePartitionRequest; - - /** - * Verifies an UpdateInstancePartitionRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UpdateInstancePartitionRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateInstancePartitionRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.UpdateInstancePartitionRequest; - - /** - * Creates a plain object from an UpdateInstancePartitionRequest message. Also converts values to other types if specified. - * @param message UpdateInstancePartitionRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.instance.v1.UpdateInstancePartitionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateInstancePartitionRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateInstancePartitionRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateInstancePartitionMetadata. */ - interface IUpdateInstancePartitionMetadata { - - /** UpdateInstancePartitionMetadata instancePartition */ - instancePartition?: (google.spanner.admin.instance.v1.IInstancePartition|null); - - /** UpdateInstancePartitionMetadata startTime */ - startTime?: (google.protobuf.ITimestamp|null); - - /** UpdateInstancePartitionMetadata cancelTime */ - cancelTime?: (google.protobuf.ITimestamp|null); - - /** UpdateInstancePartitionMetadata endTime */ - endTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents an UpdateInstancePartitionMetadata. */ - class UpdateInstancePartitionMetadata implements IUpdateInstancePartitionMetadata { - - /** - * Constructs a new UpdateInstancePartitionMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.instance.v1.IUpdateInstancePartitionMetadata); - - /** UpdateInstancePartitionMetadata instancePartition. */ - public instancePartition?: (google.spanner.admin.instance.v1.IInstancePartition|null); - - /** UpdateInstancePartitionMetadata startTime. */ - public startTime?: (google.protobuf.ITimestamp|null); - - /** UpdateInstancePartitionMetadata cancelTime. */ - public cancelTime?: (google.protobuf.ITimestamp|null); - - /** UpdateInstancePartitionMetadata endTime. */ - public endTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new UpdateInstancePartitionMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateInstancePartitionMetadata instance - */ - public static create(properties?: google.spanner.admin.instance.v1.IUpdateInstancePartitionMetadata): google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata; - - /** - * Encodes the specified UpdateInstancePartitionMetadata message. Does not implicitly {@link google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata.verify|verify} messages. - * @param message UpdateInstancePartitionMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.instance.v1.IUpdateInstancePartitionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateInstancePartitionMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata.verify|verify} messages. - * @param message UpdateInstancePartitionMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.instance.v1.IUpdateInstancePartitionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateInstancePartitionMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateInstancePartitionMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata; - - /** - * Decodes an UpdateInstancePartitionMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateInstancePartitionMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata; - - /** - * Verifies an UpdateInstancePartitionMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UpdateInstancePartitionMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateInstancePartitionMetadata - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata; - - /** - * Creates a plain object from an UpdateInstancePartitionMetadata message. Also converts values to other types if specified. - * @param message UpdateInstancePartitionMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateInstancePartitionMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateInstancePartitionMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListInstancePartitionsRequest. */ - interface IListInstancePartitionsRequest { - - /** ListInstancePartitionsRequest parent */ - parent?: (string|null); - - /** ListInstancePartitionsRequest pageSize */ - pageSize?: (number|null); - - /** ListInstancePartitionsRequest pageToken */ - pageToken?: (string|null); - - /** ListInstancePartitionsRequest instancePartitionDeadline */ - instancePartitionDeadline?: (google.protobuf.ITimestamp|null); - } - - /** Represents a ListInstancePartitionsRequest. */ - class ListInstancePartitionsRequest implements IListInstancePartitionsRequest { - - /** - * Constructs a new ListInstancePartitionsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.instance.v1.IListInstancePartitionsRequest); - - /** ListInstancePartitionsRequest parent. */ - public parent: string; - - /** ListInstancePartitionsRequest pageSize. */ - public pageSize: number; - - /** ListInstancePartitionsRequest pageToken. */ - public pageToken: string; - - /** ListInstancePartitionsRequest instancePartitionDeadline. */ - public instancePartitionDeadline?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new ListInstancePartitionsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListInstancePartitionsRequest instance - */ - public static create(properties?: google.spanner.admin.instance.v1.IListInstancePartitionsRequest): google.spanner.admin.instance.v1.ListInstancePartitionsRequest; - - /** - * Encodes the specified ListInstancePartitionsRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancePartitionsRequest.verify|verify} messages. - * @param message ListInstancePartitionsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.instance.v1.IListInstancePartitionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListInstancePartitionsRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancePartitionsRequest.verify|verify} messages. - * @param message ListInstancePartitionsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.instance.v1.IListInstancePartitionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListInstancePartitionsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListInstancePartitionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.ListInstancePartitionsRequest; - - /** - * Decodes a ListInstancePartitionsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListInstancePartitionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.ListInstancePartitionsRequest; - - /** - * Verifies a ListInstancePartitionsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListInstancePartitionsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListInstancePartitionsRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.ListInstancePartitionsRequest; - - /** - * Creates a plain object from a ListInstancePartitionsRequest message. Also converts values to other types if specified. - * @param message ListInstancePartitionsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.instance.v1.ListInstancePartitionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListInstancePartitionsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListInstancePartitionsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListInstancePartitionsResponse. */ - interface IListInstancePartitionsResponse { - - /** ListInstancePartitionsResponse instancePartitions */ - instancePartitions?: (google.spanner.admin.instance.v1.IInstancePartition[]|null); - - /** ListInstancePartitionsResponse nextPageToken */ - nextPageToken?: (string|null); - - /** ListInstancePartitionsResponse unreachable */ - unreachable?: (string[]|null); - } - - /** Represents a ListInstancePartitionsResponse. */ - class ListInstancePartitionsResponse implements IListInstancePartitionsResponse { - - /** - * Constructs a new ListInstancePartitionsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.instance.v1.IListInstancePartitionsResponse); - - /** ListInstancePartitionsResponse instancePartitions. */ - public instancePartitions: google.spanner.admin.instance.v1.IInstancePartition[]; - - /** ListInstancePartitionsResponse nextPageToken. */ - public nextPageToken: string; - - /** ListInstancePartitionsResponse unreachable. */ - public unreachable: string[]; - - /** - * Creates a new ListInstancePartitionsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListInstancePartitionsResponse instance - */ - public static create(properties?: google.spanner.admin.instance.v1.IListInstancePartitionsResponse): google.spanner.admin.instance.v1.ListInstancePartitionsResponse; - - /** - * Encodes the specified ListInstancePartitionsResponse message. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancePartitionsResponse.verify|verify} messages. - * @param message ListInstancePartitionsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.instance.v1.IListInstancePartitionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListInstancePartitionsResponse message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancePartitionsResponse.verify|verify} messages. - * @param message ListInstancePartitionsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.instance.v1.IListInstancePartitionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListInstancePartitionsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListInstancePartitionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.ListInstancePartitionsResponse; - - /** - * Decodes a ListInstancePartitionsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListInstancePartitionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.ListInstancePartitionsResponse; - - /** - * Verifies a ListInstancePartitionsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListInstancePartitionsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListInstancePartitionsResponse - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.ListInstancePartitionsResponse; - - /** - * Creates a plain object from a ListInstancePartitionsResponse message. Also converts values to other types if specified. - * @param message ListInstancePartitionsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.instance.v1.ListInstancePartitionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListInstancePartitionsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListInstancePartitionsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListInstancePartitionOperationsRequest. */ - interface IListInstancePartitionOperationsRequest { - - /** ListInstancePartitionOperationsRequest parent */ - parent?: (string|null); - - /** ListInstancePartitionOperationsRequest filter */ - filter?: (string|null); - - /** ListInstancePartitionOperationsRequest pageSize */ - pageSize?: (number|null); - - /** ListInstancePartitionOperationsRequest pageToken */ - pageToken?: (string|null); - - /** ListInstancePartitionOperationsRequest instancePartitionDeadline */ - instancePartitionDeadline?: (google.protobuf.ITimestamp|null); - } - - /** Represents a ListInstancePartitionOperationsRequest. */ - class ListInstancePartitionOperationsRequest implements IListInstancePartitionOperationsRequest { - - /** - * Constructs a new ListInstancePartitionOperationsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.instance.v1.IListInstancePartitionOperationsRequest); - - /** ListInstancePartitionOperationsRequest parent. */ - public parent: string; - - /** ListInstancePartitionOperationsRequest filter. */ - public filter: string; - - /** ListInstancePartitionOperationsRequest pageSize. */ - public pageSize: number; - - /** ListInstancePartitionOperationsRequest pageToken. */ - public pageToken: string; - - /** ListInstancePartitionOperationsRequest instancePartitionDeadline. */ - public instancePartitionDeadline?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new ListInstancePartitionOperationsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListInstancePartitionOperationsRequest instance - */ - public static create(properties?: google.spanner.admin.instance.v1.IListInstancePartitionOperationsRequest): google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest; - - /** - * Encodes the specified ListInstancePartitionOperationsRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest.verify|verify} messages. - * @param message ListInstancePartitionOperationsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.instance.v1.IListInstancePartitionOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListInstancePartitionOperationsRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest.verify|verify} messages. - * @param message ListInstancePartitionOperationsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.instance.v1.IListInstancePartitionOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListInstancePartitionOperationsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListInstancePartitionOperationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest; - - /** - * Decodes a ListInstancePartitionOperationsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListInstancePartitionOperationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest; - - /** - * Verifies a ListInstancePartitionOperationsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListInstancePartitionOperationsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListInstancePartitionOperationsRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest; - - /** - * Creates a plain object from a ListInstancePartitionOperationsRequest message. Also converts values to other types if specified. - * @param message ListInstancePartitionOperationsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListInstancePartitionOperationsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListInstancePartitionOperationsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListInstancePartitionOperationsResponse. */ - interface IListInstancePartitionOperationsResponse { - - /** ListInstancePartitionOperationsResponse operations */ - operations?: (google.longrunning.IOperation[]|null); - - /** ListInstancePartitionOperationsResponse nextPageToken */ - nextPageToken?: (string|null); - - /** ListInstancePartitionOperationsResponse unreachableInstancePartitions */ - unreachableInstancePartitions?: (string[]|null); - } - - /** Represents a ListInstancePartitionOperationsResponse. */ - class ListInstancePartitionOperationsResponse implements IListInstancePartitionOperationsResponse { - - /** - * Constructs a new ListInstancePartitionOperationsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.instance.v1.IListInstancePartitionOperationsResponse); - - /** ListInstancePartitionOperationsResponse operations. */ - public operations: google.longrunning.IOperation[]; - - /** ListInstancePartitionOperationsResponse nextPageToken. */ - public nextPageToken: string; - - /** ListInstancePartitionOperationsResponse unreachableInstancePartitions. */ - public unreachableInstancePartitions: string[]; - - /** - * Creates a new ListInstancePartitionOperationsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListInstancePartitionOperationsResponse instance - */ - public static create(properties?: google.spanner.admin.instance.v1.IListInstancePartitionOperationsResponse): google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse; - - /** - * Encodes the specified ListInstancePartitionOperationsResponse message. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse.verify|verify} messages. - * @param message ListInstancePartitionOperationsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.instance.v1.IListInstancePartitionOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListInstancePartitionOperationsResponse message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse.verify|verify} messages. - * @param message ListInstancePartitionOperationsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.instance.v1.IListInstancePartitionOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListInstancePartitionOperationsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListInstancePartitionOperationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse; - - /** - * Decodes a ListInstancePartitionOperationsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListInstancePartitionOperationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse; - - /** - * Verifies a ListInstancePartitionOperationsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListInstancePartitionOperationsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListInstancePartitionOperationsResponse - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse; - - /** - * Creates a plain object from a ListInstancePartitionOperationsResponse message. Also converts values to other types if specified. - * @param message ListInstancePartitionOperationsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListInstancePartitionOperationsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListInstancePartitionOperationsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a MoveInstanceRequest. */ - interface IMoveInstanceRequest { - - /** MoveInstanceRequest name */ - name?: (string|null); - - /** MoveInstanceRequest targetConfig */ - targetConfig?: (string|null); - } - - /** Represents a MoveInstanceRequest. */ - class MoveInstanceRequest implements IMoveInstanceRequest { - - /** - * Constructs a new MoveInstanceRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.instance.v1.IMoveInstanceRequest); - - /** MoveInstanceRequest name. */ - public name: string; - - /** MoveInstanceRequest targetConfig. */ - public targetConfig: string; - - /** - * Creates a new MoveInstanceRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns MoveInstanceRequest instance - */ - public static create(properties?: google.spanner.admin.instance.v1.IMoveInstanceRequest): google.spanner.admin.instance.v1.MoveInstanceRequest; - - /** - * Encodes the specified MoveInstanceRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.MoveInstanceRequest.verify|verify} messages. - * @param message MoveInstanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.instance.v1.IMoveInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MoveInstanceRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.MoveInstanceRequest.verify|verify} messages. - * @param message MoveInstanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.instance.v1.IMoveInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MoveInstanceRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MoveInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.MoveInstanceRequest; - - /** - * Decodes a MoveInstanceRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MoveInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.MoveInstanceRequest; - - /** - * Verifies a MoveInstanceRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MoveInstanceRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MoveInstanceRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.MoveInstanceRequest; - - /** - * Creates a plain object from a MoveInstanceRequest message. Also converts values to other types if specified. - * @param message MoveInstanceRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.instance.v1.MoveInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MoveInstanceRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MoveInstanceRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a MoveInstanceResponse. */ - interface IMoveInstanceResponse { - } - - /** Represents a MoveInstanceResponse. */ - class MoveInstanceResponse implements IMoveInstanceResponse { - - /** - * Constructs a new MoveInstanceResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.instance.v1.IMoveInstanceResponse); - - /** - * Creates a new MoveInstanceResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns MoveInstanceResponse instance - */ - public static create(properties?: google.spanner.admin.instance.v1.IMoveInstanceResponse): google.spanner.admin.instance.v1.MoveInstanceResponse; - - /** - * Encodes the specified MoveInstanceResponse message. Does not implicitly {@link google.spanner.admin.instance.v1.MoveInstanceResponse.verify|verify} messages. - * @param message MoveInstanceResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.instance.v1.IMoveInstanceResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MoveInstanceResponse message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.MoveInstanceResponse.verify|verify} messages. - * @param message MoveInstanceResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.instance.v1.IMoveInstanceResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MoveInstanceResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MoveInstanceResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.MoveInstanceResponse; - - /** - * Decodes a MoveInstanceResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MoveInstanceResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.MoveInstanceResponse; - - /** - * Verifies a MoveInstanceResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MoveInstanceResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MoveInstanceResponse - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.MoveInstanceResponse; - - /** - * Creates a plain object from a MoveInstanceResponse message. Also converts values to other types if specified. - * @param message MoveInstanceResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.instance.v1.MoveInstanceResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MoveInstanceResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MoveInstanceResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a MoveInstanceMetadata. */ - interface IMoveInstanceMetadata { - - /** MoveInstanceMetadata targetConfig */ - targetConfig?: (string|null); - - /** MoveInstanceMetadata progress */ - progress?: (google.spanner.admin.instance.v1.IOperationProgress|null); - - /** MoveInstanceMetadata cancelTime */ - cancelTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a MoveInstanceMetadata. */ - class MoveInstanceMetadata implements IMoveInstanceMetadata { - - /** - * Constructs a new MoveInstanceMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.instance.v1.IMoveInstanceMetadata); - - /** MoveInstanceMetadata targetConfig. */ - public targetConfig: string; - - /** MoveInstanceMetadata progress. */ - public progress?: (google.spanner.admin.instance.v1.IOperationProgress|null); - - /** MoveInstanceMetadata cancelTime. */ - public cancelTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new MoveInstanceMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns MoveInstanceMetadata instance - */ - public static create(properties?: google.spanner.admin.instance.v1.IMoveInstanceMetadata): google.spanner.admin.instance.v1.MoveInstanceMetadata; - - /** - * Encodes the specified MoveInstanceMetadata message. Does not implicitly {@link google.spanner.admin.instance.v1.MoveInstanceMetadata.verify|verify} messages. - * @param message MoveInstanceMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.instance.v1.IMoveInstanceMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MoveInstanceMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.MoveInstanceMetadata.verify|verify} messages. - * @param message MoveInstanceMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.instance.v1.IMoveInstanceMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MoveInstanceMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MoveInstanceMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.MoveInstanceMetadata; - - /** - * Decodes a MoveInstanceMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MoveInstanceMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.MoveInstanceMetadata; - - /** - * Verifies a MoveInstanceMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MoveInstanceMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MoveInstanceMetadata - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.MoveInstanceMetadata; - - /** - * Creates a plain object from a MoveInstanceMetadata message. Also converts values to other types if specified. - * @param message MoveInstanceMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.instance.v1.MoveInstanceMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MoveInstanceMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MoveInstanceMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - } - } - } - - /** Namespace api. */ - namespace api { - - /** FieldBehavior enum. */ - enum FieldBehavior { - FIELD_BEHAVIOR_UNSPECIFIED = 0, - OPTIONAL = 1, - REQUIRED = 2, - OUTPUT_ONLY = 3, - INPUT_ONLY = 4, - IMMUTABLE = 5, - UNORDERED_LIST = 6, - NON_EMPTY_DEFAULT = 7, - IDENTIFIER = 8 - } - - /** Properties of a ResourceDescriptor. */ - interface IResourceDescriptor { - - /** ResourceDescriptor type */ - type?: (string|null); - - /** ResourceDescriptor pattern */ - pattern?: (string[]|null); - - /** ResourceDescriptor nameField */ - nameField?: (string|null); - - /** ResourceDescriptor history */ - history?: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History|null); - - /** ResourceDescriptor plural */ - plural?: (string|null); - - /** ResourceDescriptor singular */ - singular?: (string|null); - - /** ResourceDescriptor style */ - style?: (google.api.ResourceDescriptor.Style[]|null); - } - - /** Represents a ResourceDescriptor. */ - class ResourceDescriptor implements IResourceDescriptor { - - /** - * Constructs a new ResourceDescriptor. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IResourceDescriptor); - - /** ResourceDescriptor type. */ - public type: string; - - /** ResourceDescriptor pattern. */ - public pattern: string[]; - - /** ResourceDescriptor nameField. */ - public nameField: string; - - /** ResourceDescriptor history. */ - public history: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History); - - /** ResourceDescriptor plural. */ - public plural: string; - - /** ResourceDescriptor singular. */ - public singular: string; - - /** ResourceDescriptor style. */ - public style: google.api.ResourceDescriptor.Style[]; - - /** - * Creates a new ResourceDescriptor instance using the specified properties. - * @param [properties] Properties to set - * @returns ResourceDescriptor instance - */ - public static create(properties?: google.api.IResourceDescriptor): google.api.ResourceDescriptor; - - /** - * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. - * @param message ResourceDescriptor message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. - * @param message ResourceDescriptor message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ResourceDescriptor message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ResourceDescriptor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceDescriptor; - - /** - * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ResourceDescriptor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceDescriptor; - - /** - * Verifies a ResourceDescriptor message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ResourceDescriptor - */ - public static fromObject(object: { [k: string]: any }): google.api.ResourceDescriptor; - - /** - * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. - * @param message ResourceDescriptor - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.ResourceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ResourceDescriptor to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ResourceDescriptor - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ResourceDescriptor { - - /** History enum. */ - enum History { - HISTORY_UNSPECIFIED = 0, - ORIGINALLY_SINGLE_PATTERN = 1, - FUTURE_MULTI_PATTERN = 2 - } - - /** Style enum. */ - enum Style { - STYLE_UNSPECIFIED = 0, - DECLARATIVE_FRIENDLY = 1 - } - } - - /** Properties of a ResourceReference. */ - interface IResourceReference { - - /** ResourceReference type */ - type?: (string|null); - - /** ResourceReference childType */ - childType?: (string|null); - } - - /** Represents a ResourceReference. */ - class ResourceReference implements IResourceReference { - - /** - * Constructs a new ResourceReference. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IResourceReference); - - /** ResourceReference type. */ - public type: string; - - /** ResourceReference childType. */ - public childType: string; - - /** - * Creates a new ResourceReference instance using the specified properties. - * @param [properties] Properties to set - * @returns ResourceReference instance - */ - public static create(properties?: google.api.IResourceReference): google.api.ResourceReference; - - /** - * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. - * @param message ResourceReference message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. - * @param message ResourceReference message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ResourceReference message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ResourceReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceReference; - - /** - * Decodes a ResourceReference message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ResourceReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceReference; - - /** - * Verifies a ResourceReference message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ResourceReference - */ - public static fromObject(object: { [k: string]: any }): google.api.ResourceReference; - - /** - * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. - * @param message ResourceReference - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.ResourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ResourceReference to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ResourceReference - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Http. */ - interface IHttp { - - /** Http rules */ - rules?: (google.api.IHttpRule[]|null); - - /** Http fullyDecodeReservedExpansion */ - fullyDecodeReservedExpansion?: (boolean|null); - } - - /** Represents a Http. */ - class Http implements IHttp { - - /** - * Constructs a new Http. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IHttp); - - /** Http rules. */ - public rules: google.api.IHttpRule[]; - - /** Http fullyDecodeReservedExpansion. */ - public fullyDecodeReservedExpansion: boolean; - - /** - * Creates a new Http instance using the specified properties. - * @param [properties] Properties to set - * @returns Http instance - */ - public static create(properties?: google.api.IHttp): google.api.Http; - - /** - * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @param message Http message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @param message Http message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Http message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Http - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Http; - - /** - * Decodes a Http message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Http - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Http; - - /** - * Verifies a Http message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Http message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Http - */ - public static fromObject(object: { [k: string]: any }): google.api.Http; - - /** - * Creates a plain object from a Http message. Also converts values to other types if specified. - * @param message Http - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Http to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Http - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a HttpRule. */ - interface IHttpRule { - - /** HttpRule selector */ - selector?: (string|null); - - /** HttpRule get */ - get?: (string|null); - - /** HttpRule put */ - put?: (string|null); - - /** HttpRule post */ - post?: (string|null); - - /** HttpRule delete */ - "delete"?: (string|null); - - /** HttpRule patch */ - patch?: (string|null); - - /** HttpRule custom */ - custom?: (google.api.ICustomHttpPattern|null); - - /** HttpRule body */ - body?: (string|null); - - /** HttpRule responseBody */ - responseBody?: (string|null); - - /** HttpRule additionalBindings */ - additionalBindings?: (google.api.IHttpRule[]|null); - } - - /** Represents a HttpRule. */ - class HttpRule implements IHttpRule { - - /** - * Constructs a new HttpRule. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IHttpRule); - - /** HttpRule selector. */ - public selector: string; - - /** HttpRule get. */ - public get?: (string|null); - - /** HttpRule put. */ - public put?: (string|null); - - /** HttpRule post. */ - public post?: (string|null); - - /** HttpRule delete. */ - public delete?: (string|null); - - /** HttpRule patch. */ - public patch?: (string|null); - - /** HttpRule custom. */ - public custom?: (google.api.ICustomHttpPattern|null); - - /** HttpRule body. */ - public body: string; - - /** HttpRule responseBody. */ - public responseBody: string; - - /** HttpRule additionalBindings. */ - public additionalBindings: google.api.IHttpRule[]; - - /** HttpRule pattern. */ - public pattern?: ("get"|"put"|"post"|"delete"|"patch"|"custom"); - - /** - * Creates a new HttpRule instance using the specified properties. - * @param [properties] Properties to set - * @returns HttpRule instance - */ - public static create(properties?: google.api.IHttpRule): google.api.HttpRule; - - /** - * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @param message HttpRule message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @param message HttpRule message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a HttpRule message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns HttpRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.HttpRule; - - /** - * Decodes a HttpRule message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns HttpRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.HttpRule; - - /** - * Verifies a HttpRule message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns HttpRule - */ - public static fromObject(object: { [k: string]: any }): google.api.HttpRule; - - /** - * Creates a plain object from a HttpRule message. Also converts values to other types if specified. - * @param message HttpRule - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.HttpRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this HttpRule to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for HttpRule - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CustomHttpPattern. */ - interface ICustomHttpPattern { - - /** CustomHttpPattern kind */ - kind?: (string|null); - - /** CustomHttpPattern path */ - path?: (string|null); - } - - /** Represents a CustomHttpPattern. */ - class CustomHttpPattern implements ICustomHttpPattern { - - /** - * Constructs a new CustomHttpPattern. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.ICustomHttpPattern); - - /** CustomHttpPattern kind. */ - public kind: string; - - /** CustomHttpPattern path. */ - public path: string; - - /** - * Creates a new CustomHttpPattern instance using the specified properties. - * @param [properties] Properties to set - * @returns CustomHttpPattern instance - */ - public static create(properties?: google.api.ICustomHttpPattern): google.api.CustomHttpPattern; - - /** - * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. - * @param message CustomHttpPattern message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. - * @param message CustomHttpPattern message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CustomHttpPattern message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CustomHttpPattern - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CustomHttpPattern; - - /** - * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CustomHttpPattern - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CustomHttpPattern; - - /** - * Verifies a CustomHttpPattern message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CustomHttpPattern - */ - public static fromObject(object: { [k: string]: any }): google.api.CustomHttpPattern; - - /** - * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. - * @param message CustomHttpPattern - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.CustomHttpPattern, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CustomHttpPattern to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CustomHttpPattern - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CommonLanguageSettings. */ - interface ICommonLanguageSettings { - - /** CommonLanguageSettings referenceDocsUri */ - referenceDocsUri?: (string|null); - - /** CommonLanguageSettings destinations */ - destinations?: (google.api.ClientLibraryDestination[]|null); - } - - /** Represents a CommonLanguageSettings. */ - class CommonLanguageSettings implements ICommonLanguageSettings { - - /** - * Constructs a new CommonLanguageSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.ICommonLanguageSettings); - - /** CommonLanguageSettings referenceDocsUri. */ - public referenceDocsUri: string; - - /** CommonLanguageSettings destinations. */ - public destinations: google.api.ClientLibraryDestination[]; - - /** - * Creates a new CommonLanguageSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns CommonLanguageSettings instance - */ - public static create(properties?: google.api.ICommonLanguageSettings): google.api.CommonLanguageSettings; - - /** - * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. - * @param message CommonLanguageSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. - * @param message CommonLanguageSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CommonLanguageSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CommonLanguageSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CommonLanguageSettings; - - /** - * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CommonLanguageSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CommonLanguageSettings; - - /** - * Verifies a CommonLanguageSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CommonLanguageSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.CommonLanguageSettings; - - /** - * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. - * @param message CommonLanguageSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.CommonLanguageSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CommonLanguageSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CommonLanguageSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ClientLibrarySettings. */ - interface IClientLibrarySettings { - - /** ClientLibrarySettings version */ - version?: (string|null); - - /** ClientLibrarySettings launchStage */ - launchStage?: (google.api.LaunchStage|keyof typeof google.api.LaunchStage|null); - - /** ClientLibrarySettings restNumericEnums */ - restNumericEnums?: (boolean|null); - - /** ClientLibrarySettings javaSettings */ - javaSettings?: (google.api.IJavaSettings|null); - - /** ClientLibrarySettings cppSettings */ - cppSettings?: (google.api.ICppSettings|null); - - /** ClientLibrarySettings phpSettings */ - phpSettings?: (google.api.IPhpSettings|null); - - /** ClientLibrarySettings pythonSettings */ - pythonSettings?: (google.api.IPythonSettings|null); - - /** ClientLibrarySettings nodeSettings */ - nodeSettings?: (google.api.INodeSettings|null); - - /** ClientLibrarySettings dotnetSettings */ - dotnetSettings?: (google.api.IDotnetSettings|null); - - /** ClientLibrarySettings rubySettings */ - rubySettings?: (google.api.IRubySettings|null); - - /** ClientLibrarySettings goSettings */ - goSettings?: (google.api.IGoSettings|null); - } - - /** Represents a ClientLibrarySettings. */ - class ClientLibrarySettings implements IClientLibrarySettings { - - /** - * Constructs a new ClientLibrarySettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IClientLibrarySettings); - - /** ClientLibrarySettings version. */ - public version: string; - - /** ClientLibrarySettings launchStage. */ - public launchStage: (google.api.LaunchStage|keyof typeof google.api.LaunchStage); - - /** ClientLibrarySettings restNumericEnums. */ - public restNumericEnums: boolean; - - /** ClientLibrarySettings javaSettings. */ - public javaSettings?: (google.api.IJavaSettings|null); - - /** ClientLibrarySettings cppSettings. */ - public cppSettings?: (google.api.ICppSettings|null); - - /** ClientLibrarySettings phpSettings. */ - public phpSettings?: (google.api.IPhpSettings|null); - - /** ClientLibrarySettings pythonSettings. */ - public pythonSettings?: (google.api.IPythonSettings|null); - - /** ClientLibrarySettings nodeSettings. */ - public nodeSettings?: (google.api.INodeSettings|null); - - /** ClientLibrarySettings dotnetSettings. */ - public dotnetSettings?: (google.api.IDotnetSettings|null); - - /** ClientLibrarySettings rubySettings. */ - public rubySettings?: (google.api.IRubySettings|null); - - /** ClientLibrarySettings goSettings. */ - public goSettings?: (google.api.IGoSettings|null); - - /** - * Creates a new ClientLibrarySettings instance using the specified properties. - * @param [properties] Properties to set - * @returns ClientLibrarySettings instance - */ - public static create(properties?: google.api.IClientLibrarySettings): google.api.ClientLibrarySettings; - - /** - * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. - * @param message ClientLibrarySettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. - * @param message ClientLibrarySettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ClientLibrarySettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ClientLibrarySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ClientLibrarySettings; - - /** - * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ClientLibrarySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ClientLibrarySettings; - - /** - * Verifies a ClientLibrarySettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ClientLibrarySettings - */ - public static fromObject(object: { [k: string]: any }): google.api.ClientLibrarySettings; - - /** - * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. - * @param message ClientLibrarySettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.ClientLibrarySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ClientLibrarySettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ClientLibrarySettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Publishing. */ - interface IPublishing { - - /** Publishing methodSettings */ - methodSettings?: (google.api.IMethodSettings[]|null); - - /** Publishing newIssueUri */ - newIssueUri?: (string|null); - - /** Publishing documentationUri */ - documentationUri?: (string|null); - - /** Publishing apiShortName */ - apiShortName?: (string|null); - - /** Publishing githubLabel */ - githubLabel?: (string|null); - - /** Publishing codeownerGithubTeams */ - codeownerGithubTeams?: (string[]|null); - - /** Publishing docTagPrefix */ - docTagPrefix?: (string|null); - - /** Publishing organization */ - organization?: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization|null); - - /** Publishing librarySettings */ - librarySettings?: (google.api.IClientLibrarySettings[]|null); - - /** Publishing protoReferenceDocumentationUri */ - protoReferenceDocumentationUri?: (string|null); - - /** Publishing restReferenceDocumentationUri */ - restReferenceDocumentationUri?: (string|null); - } - - /** Represents a Publishing. */ - class Publishing implements IPublishing { - - /** - * Constructs a new Publishing. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IPublishing); - - /** Publishing methodSettings. */ - public methodSettings: google.api.IMethodSettings[]; - - /** Publishing newIssueUri. */ - public newIssueUri: string; - - /** Publishing documentationUri. */ - public documentationUri: string; - - /** Publishing apiShortName. */ - public apiShortName: string; - - /** Publishing githubLabel. */ - public githubLabel: string; - - /** Publishing codeownerGithubTeams. */ - public codeownerGithubTeams: string[]; - - /** Publishing docTagPrefix. */ - public docTagPrefix: string; - - /** Publishing organization. */ - public organization: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization); - - /** Publishing librarySettings. */ - public librarySettings: google.api.IClientLibrarySettings[]; - - /** Publishing protoReferenceDocumentationUri. */ - public protoReferenceDocumentationUri: string; - - /** Publishing restReferenceDocumentationUri. */ - public restReferenceDocumentationUri: string; - - /** - * Creates a new Publishing instance using the specified properties. - * @param [properties] Properties to set - * @returns Publishing instance - */ - public static create(properties?: google.api.IPublishing): google.api.Publishing; - - /** - * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. - * @param message Publishing message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. - * @param message Publishing message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Publishing message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Publishing - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Publishing; - - /** - * Decodes a Publishing message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Publishing - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Publishing; - - /** - * Verifies a Publishing message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Publishing message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Publishing - */ - public static fromObject(object: { [k: string]: any }): google.api.Publishing; - - /** - * Creates a plain object from a Publishing message. Also converts values to other types if specified. - * @param message Publishing - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.Publishing, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Publishing to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Publishing - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a JavaSettings. */ - interface IJavaSettings { - - /** JavaSettings libraryPackage */ - libraryPackage?: (string|null); - - /** JavaSettings serviceClassNames */ - serviceClassNames?: ({ [k: string]: string }|null); - - /** JavaSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a JavaSettings. */ - class JavaSettings implements IJavaSettings { - - /** - * Constructs a new JavaSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IJavaSettings); - - /** JavaSettings libraryPackage. */ - public libraryPackage: string; - - /** JavaSettings serviceClassNames. */ - public serviceClassNames: { [k: string]: string }; - - /** JavaSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new JavaSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns JavaSettings instance - */ - public static create(properties?: google.api.IJavaSettings): google.api.JavaSettings; - - /** - * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. - * @param message JavaSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. - * @param message JavaSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a JavaSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns JavaSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.JavaSettings; - - /** - * Decodes a JavaSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns JavaSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.JavaSettings; - - /** - * Verifies a JavaSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns JavaSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.JavaSettings; - - /** - * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. - * @param message JavaSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.JavaSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this JavaSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for JavaSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CppSettings. */ - interface ICppSettings { - - /** CppSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a CppSettings. */ - class CppSettings implements ICppSettings { - - /** - * Constructs a new CppSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.ICppSettings); - - /** CppSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new CppSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns CppSettings instance - */ - public static create(properties?: google.api.ICppSettings): google.api.CppSettings; - - /** - * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. - * @param message CppSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. - * @param message CppSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CppSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CppSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CppSettings; - - /** - * Decodes a CppSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CppSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CppSettings; - - /** - * Verifies a CppSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CppSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.CppSettings; - - /** - * Creates a plain object from a CppSettings message. Also converts values to other types if specified. - * @param message CppSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.CppSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CppSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CppSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PhpSettings. */ - interface IPhpSettings { - - /** PhpSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a PhpSettings. */ - class PhpSettings implements IPhpSettings { - - /** - * Constructs a new PhpSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IPhpSettings); - - /** PhpSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new PhpSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns PhpSettings instance - */ - public static create(properties?: google.api.IPhpSettings): google.api.PhpSettings; - - /** - * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. - * @param message PhpSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. - * @param message PhpSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PhpSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PhpSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PhpSettings; - - /** - * Decodes a PhpSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PhpSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PhpSettings; - - /** - * Verifies a PhpSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PhpSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.PhpSettings; - - /** - * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. - * @param message PhpSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.PhpSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PhpSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PhpSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PythonSettings. */ - interface IPythonSettings { - - /** PythonSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a PythonSettings. */ - class PythonSettings implements IPythonSettings { - - /** - * Constructs a new PythonSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IPythonSettings); - - /** PythonSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new PythonSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns PythonSettings instance - */ - public static create(properties?: google.api.IPythonSettings): google.api.PythonSettings; - - /** - * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. - * @param message PythonSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. - * @param message PythonSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PythonSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PythonSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PythonSettings; - - /** - * Decodes a PythonSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PythonSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PythonSettings; - - /** - * Verifies a PythonSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PythonSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.PythonSettings; - - /** - * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. - * @param message PythonSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.PythonSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PythonSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PythonSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a NodeSettings. */ - interface INodeSettings { - - /** NodeSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a NodeSettings. */ - class NodeSettings implements INodeSettings { - - /** - * Constructs a new NodeSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.INodeSettings); - - /** NodeSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new NodeSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns NodeSettings instance - */ - public static create(properties?: google.api.INodeSettings): google.api.NodeSettings; - - /** - * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. - * @param message NodeSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. - * @param message NodeSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a NodeSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns NodeSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.NodeSettings; - - /** - * Decodes a NodeSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns NodeSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.NodeSettings; - - /** - * Verifies a NodeSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns NodeSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.NodeSettings; - - /** - * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. - * @param message NodeSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.NodeSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this NodeSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for NodeSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DotnetSettings. */ - interface IDotnetSettings { - - /** DotnetSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - - /** DotnetSettings renamedServices */ - renamedServices?: ({ [k: string]: string }|null); - - /** DotnetSettings renamedResources */ - renamedResources?: ({ [k: string]: string }|null); - - /** DotnetSettings ignoredResources */ - ignoredResources?: (string[]|null); - - /** DotnetSettings forcedNamespaceAliases */ - forcedNamespaceAliases?: (string[]|null); - - /** DotnetSettings handwrittenSignatures */ - handwrittenSignatures?: (string[]|null); - } - - /** Represents a DotnetSettings. */ - class DotnetSettings implements IDotnetSettings { - - /** - * Constructs a new DotnetSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IDotnetSettings); - - /** DotnetSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** DotnetSettings renamedServices. */ - public renamedServices: { [k: string]: string }; - - /** DotnetSettings renamedResources. */ - public renamedResources: { [k: string]: string }; - - /** DotnetSettings ignoredResources. */ - public ignoredResources: string[]; - - /** DotnetSettings forcedNamespaceAliases. */ - public forcedNamespaceAliases: string[]; - - /** DotnetSettings handwrittenSignatures. */ - public handwrittenSignatures: string[]; - - /** - * Creates a new DotnetSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns DotnetSettings instance - */ - public static create(properties?: google.api.IDotnetSettings): google.api.DotnetSettings; - - /** - * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. - * @param message DotnetSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. - * @param message DotnetSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DotnetSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DotnetSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.DotnetSettings; - - /** - * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DotnetSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.DotnetSettings; - - /** - * Verifies a DotnetSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DotnetSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.DotnetSettings; - - /** - * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. - * @param message DotnetSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.DotnetSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DotnetSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DotnetSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RubySettings. */ - interface IRubySettings { - - /** RubySettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a RubySettings. */ - class RubySettings implements IRubySettings { - - /** - * Constructs a new RubySettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IRubySettings); - - /** RubySettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new RubySettings instance using the specified properties. - * @param [properties] Properties to set - * @returns RubySettings instance - */ - public static create(properties?: google.api.IRubySettings): google.api.RubySettings; - - /** - * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. - * @param message RubySettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. - * @param message RubySettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RubySettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RubySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.RubySettings; - - /** - * Decodes a RubySettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RubySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.RubySettings; - - /** - * Verifies a RubySettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RubySettings - */ - public static fromObject(object: { [k: string]: any }): google.api.RubySettings; - - /** - * Creates a plain object from a RubySettings message. Also converts values to other types if specified. - * @param message RubySettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.RubySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RubySettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RubySettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GoSettings. */ - interface IGoSettings { - - /** GoSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a GoSettings. */ - class GoSettings implements IGoSettings { - - /** - * Constructs a new GoSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IGoSettings); - - /** GoSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new GoSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns GoSettings instance - */ - public static create(properties?: google.api.IGoSettings): google.api.GoSettings; - - /** - * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. - * @param message GoSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. - * @param message GoSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GoSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GoSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.GoSettings; - - /** - * Decodes a GoSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GoSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.GoSettings; - - /** - * Verifies a GoSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GoSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.GoSettings; - - /** - * Creates a plain object from a GoSettings message. Also converts values to other types if specified. - * @param message GoSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.GoSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GoSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GoSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a MethodSettings. */ - interface IMethodSettings { - - /** MethodSettings selector */ - selector?: (string|null); - - /** MethodSettings longRunning */ - longRunning?: (google.api.MethodSettings.ILongRunning|null); - - /** MethodSettings autoPopulatedFields */ - autoPopulatedFields?: (string[]|null); - } - - /** Represents a MethodSettings. */ - class MethodSettings implements IMethodSettings { - - /** - * Constructs a new MethodSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IMethodSettings); - - /** MethodSettings selector. */ - public selector: string; - - /** MethodSettings longRunning. */ - public longRunning?: (google.api.MethodSettings.ILongRunning|null); - - /** MethodSettings autoPopulatedFields. */ - public autoPopulatedFields: string[]; - - /** - * Creates a new MethodSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns MethodSettings instance - */ - public static create(properties?: google.api.IMethodSettings): google.api.MethodSettings; - - /** - * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. - * @param message MethodSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. - * @param message MethodSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MethodSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MethodSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.MethodSettings; - - /** - * Decodes a MethodSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MethodSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.MethodSettings; - - /** - * Verifies a MethodSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MethodSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.MethodSettings; - - /** - * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. - * @param message MethodSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.MethodSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MethodSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MethodSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace MethodSettings { - - /** Properties of a LongRunning. */ - interface ILongRunning { - - /** LongRunning initialPollDelay */ - initialPollDelay?: (google.protobuf.IDuration|null); - - /** LongRunning pollDelayMultiplier */ - pollDelayMultiplier?: (number|null); - - /** LongRunning maxPollDelay */ - maxPollDelay?: (google.protobuf.IDuration|null); - - /** LongRunning totalPollTimeout */ - totalPollTimeout?: (google.protobuf.IDuration|null); - } - - /** Represents a LongRunning. */ - class LongRunning implements ILongRunning { - - /** - * Constructs a new LongRunning. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.MethodSettings.ILongRunning); - - /** LongRunning initialPollDelay. */ - public initialPollDelay?: (google.protobuf.IDuration|null); - - /** LongRunning pollDelayMultiplier. */ - public pollDelayMultiplier: number; - - /** LongRunning maxPollDelay. */ - public maxPollDelay?: (google.protobuf.IDuration|null); - - /** LongRunning totalPollTimeout. */ - public totalPollTimeout?: (google.protobuf.IDuration|null); - - /** - * Creates a new LongRunning instance using the specified properties. - * @param [properties] Properties to set - * @returns LongRunning instance - */ - public static create(properties?: google.api.MethodSettings.ILongRunning): google.api.MethodSettings.LongRunning; - - /** - * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. - * @param message LongRunning message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. - * @param message LongRunning message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a LongRunning message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns LongRunning - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.MethodSettings.LongRunning; - - /** - * Decodes a LongRunning message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns LongRunning - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.MethodSettings.LongRunning; - - /** - * Verifies a LongRunning message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LongRunning - */ - public static fromObject(object: { [k: string]: any }): google.api.MethodSettings.LongRunning; - - /** - * Creates a plain object from a LongRunning message. Also converts values to other types if specified. - * @param message LongRunning - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.MethodSettings.LongRunning, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this LongRunning to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for LongRunning - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** ClientLibraryOrganization enum. */ - enum ClientLibraryOrganization { - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0, - CLOUD = 1, - ADS = 2, - PHOTOS = 3, - STREET_VIEW = 4, - SHOPPING = 5, - GEO = 6, - GENERATIVE_AI = 7 - } - - /** ClientLibraryDestination enum. */ - enum ClientLibraryDestination { - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0, - GITHUB = 10, - PACKAGE_MANAGER = 20 - } - - /** LaunchStage enum. */ - enum LaunchStage { - LAUNCH_STAGE_UNSPECIFIED = 0, - UNIMPLEMENTED = 6, - PRELAUNCH = 7, - EARLY_ACCESS = 1, - ALPHA = 2, - BETA = 3, - GA = 4, - DEPRECATED = 5 - } - } - - /** Namespace protobuf. */ - namespace protobuf { - - /** Properties of a FileDescriptorSet. */ - interface IFileDescriptorSet { - - /** FileDescriptorSet file */ - file?: (google.protobuf.IFileDescriptorProto[]|null); - } - - /** Represents a FileDescriptorSet. */ - class FileDescriptorSet implements IFileDescriptorSet { - - /** - * Constructs a new FileDescriptorSet. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFileDescriptorSet); - - /** FileDescriptorSet file. */ - public file: google.protobuf.IFileDescriptorProto[]; - - /** - * Creates a new FileDescriptorSet instance using the specified properties. - * @param [properties] Properties to set - * @returns FileDescriptorSet instance - */ - public static create(properties?: google.protobuf.IFileDescriptorSet): google.protobuf.FileDescriptorSet; - - /** - * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. - * @param message FileDescriptorSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. - * @param message FileDescriptorSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FileDescriptorSet message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FileDescriptorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorSet; - - /** - * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FileDescriptorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorSet; - - /** - * Verifies a FileDescriptorSet message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FileDescriptorSet - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorSet; - - /** - * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. - * @param message FileDescriptorSet - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FileDescriptorSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FileDescriptorSet to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FileDescriptorSet - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Edition enum. */ - enum Edition { - EDITION_UNKNOWN = 0, - EDITION_PROTO2 = 998, - EDITION_PROTO3 = 999, - EDITION_2023 = 1000, - EDITION_2024 = 1001, - EDITION_1_TEST_ONLY = 1, - EDITION_2_TEST_ONLY = 2, - EDITION_99997_TEST_ONLY = 99997, - EDITION_99998_TEST_ONLY = 99998, - EDITION_99999_TEST_ONLY = 99999, - EDITION_MAX = 2147483647 - } - - /** Properties of a FileDescriptorProto. */ - interface IFileDescriptorProto { - - /** FileDescriptorProto name */ - name?: (string|null); - - /** FileDescriptorProto package */ - "package"?: (string|null); - - /** FileDescriptorProto dependency */ - dependency?: (string[]|null); - - /** FileDescriptorProto publicDependency */ - publicDependency?: (number[]|null); - - /** FileDescriptorProto weakDependency */ - weakDependency?: (number[]|null); - - /** FileDescriptorProto messageType */ - messageType?: (google.protobuf.IDescriptorProto[]|null); - - /** FileDescriptorProto enumType */ - enumType?: (google.protobuf.IEnumDescriptorProto[]|null); - - /** FileDescriptorProto service */ - service?: (google.protobuf.IServiceDescriptorProto[]|null); - - /** FileDescriptorProto extension */ - extension?: (google.protobuf.IFieldDescriptorProto[]|null); - - /** FileDescriptorProto options */ - options?: (google.protobuf.IFileOptions|null); - - /** FileDescriptorProto sourceCodeInfo */ - sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); - - /** FileDescriptorProto syntax */ - syntax?: (string|null); - - /** FileDescriptorProto edition */ - edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - } - - /** Represents a FileDescriptorProto. */ - class FileDescriptorProto implements IFileDescriptorProto { - - /** - * Constructs a new FileDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFileDescriptorProto); - - /** FileDescriptorProto name. */ - public name: string; - - /** FileDescriptorProto package. */ - public package: string; - - /** FileDescriptorProto dependency. */ - public dependency: string[]; - - /** FileDescriptorProto publicDependency. */ - public publicDependency: number[]; - - /** FileDescriptorProto weakDependency. */ - public weakDependency: number[]; - - /** FileDescriptorProto messageType. */ - public messageType: google.protobuf.IDescriptorProto[]; - - /** FileDescriptorProto enumType. */ - public enumType: google.protobuf.IEnumDescriptorProto[]; - - /** FileDescriptorProto service. */ - public service: google.protobuf.IServiceDescriptorProto[]; - - /** FileDescriptorProto extension. */ - public extension: google.protobuf.IFieldDescriptorProto[]; - - /** FileDescriptorProto options. */ - public options?: (google.protobuf.IFileOptions|null); - - /** FileDescriptorProto sourceCodeInfo. */ - public sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); - - /** FileDescriptorProto syntax. */ - public syntax: string; - - /** FileDescriptorProto edition. */ - public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** - * Creates a new FileDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns FileDescriptorProto instance - */ - public static create(properties?: google.protobuf.IFileDescriptorProto): google.protobuf.FileDescriptorProto; - - /** - * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @param message FileDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @param message FileDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorProto; - - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorProto; - - /** - * Verifies a FileDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FileDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorProto; - - /** - * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. - * @param message FileDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FileDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FileDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FileDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DescriptorProto. */ - interface IDescriptorProto { - - /** DescriptorProto name */ - name?: (string|null); - - /** DescriptorProto field */ - field?: (google.protobuf.IFieldDescriptorProto[]|null); - - /** DescriptorProto extension */ - extension?: (google.protobuf.IFieldDescriptorProto[]|null); - - /** DescriptorProto nestedType */ - nestedType?: (google.protobuf.IDescriptorProto[]|null); - - /** DescriptorProto enumType */ - enumType?: (google.protobuf.IEnumDescriptorProto[]|null); - - /** DescriptorProto extensionRange */ - extensionRange?: (google.protobuf.DescriptorProto.IExtensionRange[]|null); - - /** DescriptorProto oneofDecl */ - oneofDecl?: (google.protobuf.IOneofDescriptorProto[]|null); - - /** DescriptorProto options */ - options?: (google.protobuf.IMessageOptions|null); - - /** DescriptorProto reservedRange */ - reservedRange?: (google.protobuf.DescriptorProto.IReservedRange[]|null); - - /** DescriptorProto reservedName */ - reservedName?: (string[]|null); - } - - /** Represents a DescriptorProto. */ - class DescriptorProto implements IDescriptorProto { - - /** - * Constructs a new DescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IDescriptorProto); - - /** DescriptorProto name. */ - public name: string; - - /** DescriptorProto field. */ - public field: google.protobuf.IFieldDescriptorProto[]; - - /** DescriptorProto extension. */ - public extension: google.protobuf.IFieldDescriptorProto[]; - - /** DescriptorProto nestedType. */ - public nestedType: google.protobuf.IDescriptorProto[]; - - /** DescriptorProto enumType. */ - public enumType: google.protobuf.IEnumDescriptorProto[]; - - /** DescriptorProto extensionRange. */ - public extensionRange: google.protobuf.DescriptorProto.IExtensionRange[]; - - /** DescriptorProto oneofDecl. */ - public oneofDecl: google.protobuf.IOneofDescriptorProto[]; - - /** DescriptorProto options. */ - public options?: (google.protobuf.IMessageOptions|null); - - /** DescriptorProto reservedRange. */ - public reservedRange: google.protobuf.DescriptorProto.IReservedRange[]; - - /** DescriptorProto reservedName. */ - public reservedName: string[]; - - /** - * Creates a new DescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns DescriptorProto instance - */ - public static create(properties?: google.protobuf.IDescriptorProto): google.protobuf.DescriptorProto; - - /** - * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @param message DescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @param message DescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto; - - /** - * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto; - - /** - * Verifies a DescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto; - - /** - * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. - * @param message DescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.DescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace DescriptorProto { - - /** Properties of an ExtensionRange. */ - interface IExtensionRange { - - /** ExtensionRange start */ - start?: (number|null); - - /** ExtensionRange end */ - end?: (number|null); - - /** ExtensionRange options */ - options?: (google.protobuf.IExtensionRangeOptions|null); - } - - /** Represents an ExtensionRange. */ - class ExtensionRange implements IExtensionRange { - - /** - * Constructs a new ExtensionRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange); - - /** ExtensionRange start. */ - public start: number; - - /** ExtensionRange end. */ - public end: number; - - /** ExtensionRange options. */ - public options?: (google.protobuf.IExtensionRangeOptions|null); - - /** - * Creates a new ExtensionRange instance using the specified properties. - * @param [properties] Properties to set - * @returns ExtensionRange instance - */ - public static create(properties?: google.protobuf.DescriptorProto.IExtensionRange): google.protobuf.DescriptorProto.ExtensionRange; - - /** - * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @param message ExtensionRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @param message ExtensionRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExtensionRange message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ExtensionRange; - - /** - * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ExtensionRange; - - /** - * Verifies an ExtensionRange message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExtensionRange - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ExtensionRange; - - /** - * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. - * @param message ExtensionRange - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.DescriptorProto.ExtensionRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExtensionRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExtensionRange - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ReservedRange. */ - interface IReservedRange { - - /** ReservedRange start */ - start?: (number|null); - - /** ReservedRange end */ - end?: (number|null); - } - - /** Represents a ReservedRange. */ - class ReservedRange implements IReservedRange { - - /** - * Constructs a new ReservedRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.DescriptorProto.IReservedRange); - - /** ReservedRange start. */ - public start: number; - - /** ReservedRange end. */ - public end: number; - - /** - * Creates a new ReservedRange instance using the specified properties. - * @param [properties] Properties to set - * @returns ReservedRange instance - */ - public static create(properties?: google.protobuf.DescriptorProto.IReservedRange): google.protobuf.DescriptorProto.ReservedRange; - - /** - * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @param message ReservedRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @param message ReservedRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ReservedRange message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ReservedRange; - - /** - * Decodes a ReservedRange message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ReservedRange; - - /** - * Verifies a ReservedRange message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ReservedRange - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ReservedRange; - - /** - * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. - * @param message ReservedRange - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.DescriptorProto.ReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ReservedRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ReservedRange - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an ExtensionRangeOptions. */ - interface IExtensionRangeOptions { - - /** ExtensionRangeOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** ExtensionRangeOptions declaration */ - declaration?: (google.protobuf.ExtensionRangeOptions.IDeclaration[]|null); - - /** ExtensionRangeOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** ExtensionRangeOptions verification */ - verification?: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState|null); - } - - /** Represents an ExtensionRangeOptions. */ - class ExtensionRangeOptions implements IExtensionRangeOptions { - - /** - * Constructs a new ExtensionRangeOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IExtensionRangeOptions); - - /** ExtensionRangeOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** ExtensionRangeOptions declaration. */ - public declaration: google.protobuf.ExtensionRangeOptions.IDeclaration[]; - - /** ExtensionRangeOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** ExtensionRangeOptions verification. */ - public verification: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState); - - /** - * Creates a new ExtensionRangeOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns ExtensionRangeOptions instance - */ - public static create(properties?: google.protobuf.IExtensionRangeOptions): google.protobuf.ExtensionRangeOptions; - - /** - * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. - * @param message ExtensionRangeOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. - * @param message ExtensionRangeOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExtensionRangeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions; - - /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExtensionRangeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions; - - /** - * Verifies an ExtensionRangeOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExtensionRangeOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions; - - /** - * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. - * @param message ExtensionRangeOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ExtensionRangeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExtensionRangeOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExtensionRangeOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ExtensionRangeOptions { - - /** Properties of a Declaration. */ - interface IDeclaration { - - /** Declaration number */ - number?: (number|null); - - /** Declaration fullName */ - fullName?: (string|null); - - /** Declaration type */ - type?: (string|null); - - /** Declaration reserved */ - reserved?: (boolean|null); - - /** Declaration repeated */ - repeated?: (boolean|null); - } - - /** Represents a Declaration. */ - class Declaration implements IDeclaration { - - /** - * Constructs a new Declaration. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration); - - /** Declaration number. */ - public number: number; - - /** Declaration fullName. */ - public fullName: string; - - /** Declaration type. */ - public type: string; - - /** Declaration reserved. */ - public reserved: boolean; - - /** Declaration repeated. */ - public repeated: boolean; - - /** - * Creates a new Declaration instance using the specified properties. - * @param [properties] Properties to set - * @returns Declaration instance - */ - public static create(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration): google.protobuf.ExtensionRangeOptions.Declaration; - - /** - * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. - * @param message Declaration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. - * @param message Declaration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Declaration message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Declaration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions.Declaration; - - /** - * Decodes a Declaration message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Declaration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions.Declaration; - - /** - * Verifies a Declaration message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Declaration message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Declaration - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions.Declaration; - - /** - * Creates a plain object from a Declaration message. Also converts values to other types if specified. - * @param message Declaration - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ExtensionRangeOptions.Declaration, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Declaration to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Declaration - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** VerificationState enum. */ - enum VerificationState { - DECLARATION = 0, - UNVERIFIED = 1 - } - } - - /** Properties of a FieldDescriptorProto. */ - interface IFieldDescriptorProto { - - /** FieldDescriptorProto name */ - name?: (string|null); - - /** FieldDescriptorProto number */ - number?: (number|null); - - /** FieldDescriptorProto label */ - label?: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label|null); - - /** FieldDescriptorProto type */ - type?: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type|null); - - /** FieldDescriptorProto typeName */ - typeName?: (string|null); - - /** FieldDescriptorProto extendee */ - extendee?: (string|null); - - /** FieldDescriptorProto defaultValue */ - defaultValue?: (string|null); - - /** FieldDescriptorProto oneofIndex */ - oneofIndex?: (number|null); - - /** FieldDescriptorProto jsonName */ - jsonName?: (string|null); - - /** FieldDescriptorProto options */ - options?: (google.protobuf.IFieldOptions|null); - - /** FieldDescriptorProto proto3Optional */ - proto3Optional?: (boolean|null); - } - - /** Represents a FieldDescriptorProto. */ - class FieldDescriptorProto implements IFieldDescriptorProto { - - /** - * Constructs a new FieldDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFieldDescriptorProto); - - /** FieldDescriptorProto name. */ - public name: string; - - /** FieldDescriptorProto number. */ - public number: number; - - /** FieldDescriptorProto label. */ - public label: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label); - - /** FieldDescriptorProto type. */ - public type: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type); - - /** FieldDescriptorProto typeName. */ - public typeName: string; - - /** FieldDescriptorProto extendee. */ - public extendee: string; - - /** FieldDescriptorProto defaultValue. */ - public defaultValue: string; - - /** FieldDescriptorProto oneofIndex. */ - public oneofIndex: number; - - /** FieldDescriptorProto jsonName. */ - public jsonName: string; - - /** FieldDescriptorProto options. */ - public options?: (google.protobuf.IFieldOptions|null); - - /** FieldDescriptorProto proto3Optional. */ - public proto3Optional: boolean; - - /** - * Creates a new FieldDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns FieldDescriptorProto instance - */ - public static create(properties?: google.protobuf.IFieldDescriptorProto): google.protobuf.FieldDescriptorProto; - - /** - * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @param message FieldDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @param message FieldDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldDescriptorProto; - - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldDescriptorProto; - - /** - * Verifies a FieldDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FieldDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto; - - /** - * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. - * @param message FieldDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FieldDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FieldDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FieldDescriptorProto { - - /** Type enum. */ - enum Type { - TYPE_DOUBLE = 1, - TYPE_FLOAT = 2, - TYPE_INT64 = 3, - TYPE_UINT64 = 4, - TYPE_INT32 = 5, - TYPE_FIXED64 = 6, - TYPE_FIXED32 = 7, - TYPE_BOOL = 8, - TYPE_STRING = 9, - TYPE_GROUP = 10, - TYPE_MESSAGE = 11, - TYPE_BYTES = 12, - TYPE_UINT32 = 13, - TYPE_ENUM = 14, - TYPE_SFIXED32 = 15, - TYPE_SFIXED64 = 16, - TYPE_SINT32 = 17, - TYPE_SINT64 = 18 - } - - /** Label enum. */ - enum Label { - LABEL_OPTIONAL = 1, - LABEL_REPEATED = 3, - LABEL_REQUIRED = 2 - } - } - - /** Properties of an OneofDescriptorProto. */ - interface IOneofDescriptorProto { - - /** OneofDescriptorProto name */ - name?: (string|null); - - /** OneofDescriptorProto options */ - options?: (google.protobuf.IOneofOptions|null); - } - - /** Represents an OneofDescriptorProto. */ - class OneofDescriptorProto implements IOneofDescriptorProto { - - /** - * Constructs a new OneofDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IOneofDescriptorProto); - - /** OneofDescriptorProto name. */ - public name: string; - - /** OneofDescriptorProto options. */ - public options?: (google.protobuf.IOneofOptions|null); - - /** - * Creates a new OneofDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns OneofDescriptorProto instance - */ - public static create(properties?: google.protobuf.IOneofDescriptorProto): google.protobuf.OneofDescriptorProto; - - /** - * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @param message OneofDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @param message OneofDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofDescriptorProto; - - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofDescriptorProto; - - /** - * Verifies an OneofDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OneofDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.OneofDescriptorProto; - - /** - * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. - * @param message OneofDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.OneofDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OneofDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for OneofDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EnumDescriptorProto. */ - interface IEnumDescriptorProto { - - /** EnumDescriptorProto name */ - name?: (string|null); - - /** EnumDescriptorProto value */ - value?: (google.protobuf.IEnumValueDescriptorProto[]|null); - - /** EnumDescriptorProto options */ - options?: (google.protobuf.IEnumOptions|null); - - /** EnumDescriptorProto reservedRange */ - reservedRange?: (google.protobuf.EnumDescriptorProto.IEnumReservedRange[]|null); - - /** EnumDescriptorProto reservedName */ - reservedName?: (string[]|null); - } - - /** Represents an EnumDescriptorProto. */ - class EnumDescriptorProto implements IEnumDescriptorProto { - - /** - * Constructs a new EnumDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumDescriptorProto); - - /** EnumDescriptorProto name. */ - public name: string; - - /** EnumDescriptorProto value. */ - public value: google.protobuf.IEnumValueDescriptorProto[]; - - /** EnumDescriptorProto options. */ - public options?: (google.protobuf.IEnumOptions|null); - - /** EnumDescriptorProto reservedRange. */ - public reservedRange: google.protobuf.EnumDescriptorProto.IEnumReservedRange[]; - - /** EnumDescriptorProto reservedName. */ - public reservedName: string[]; - - /** - * Creates a new EnumDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumDescriptorProto instance - */ - public static create(properties?: google.protobuf.IEnumDescriptorProto): google.protobuf.EnumDescriptorProto; - - /** - * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @param message EnumDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @param message EnumDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto; - - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto; - - /** - * Verifies an EnumDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto; - - /** - * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. - * @param message EnumDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace EnumDescriptorProto { - - /** Properties of an EnumReservedRange. */ - interface IEnumReservedRange { - - /** EnumReservedRange start */ - start?: (number|null); - - /** EnumReservedRange end */ - end?: (number|null); - } - - /** Represents an EnumReservedRange. */ - class EnumReservedRange implements IEnumReservedRange { - - /** - * Constructs a new EnumReservedRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange); - - /** EnumReservedRange start. */ - public start: number; - - /** EnumReservedRange end. */ - public end: number; - - /** - * Creates a new EnumReservedRange instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumReservedRange instance - */ - public static create(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange): google.protobuf.EnumDescriptorProto.EnumReservedRange; - - /** - * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. - * @param message EnumReservedRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. - * @param message EnumReservedRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumReservedRange message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto.EnumReservedRange; - - /** - * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto.EnumReservedRange; - - /** - * Verifies an EnumReservedRange message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumReservedRange - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto.EnumReservedRange; - - /** - * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. - * @param message EnumReservedRange - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumDescriptorProto.EnumReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumReservedRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumReservedRange - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an EnumValueDescriptorProto. */ - interface IEnumValueDescriptorProto { - - /** EnumValueDescriptorProto name */ - name?: (string|null); - - /** EnumValueDescriptorProto number */ - number?: (number|null); - - /** EnumValueDescriptorProto options */ - options?: (google.protobuf.IEnumValueOptions|null); - } - - /** Represents an EnumValueDescriptorProto. */ - class EnumValueDescriptorProto implements IEnumValueDescriptorProto { - - /** - * Constructs a new EnumValueDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumValueDescriptorProto); - - /** EnumValueDescriptorProto name. */ - public name: string; - - /** EnumValueDescriptorProto number. */ - public number: number; - - /** EnumValueDescriptorProto options. */ - public options?: (google.protobuf.IEnumValueOptions|null); - - /** - * Creates a new EnumValueDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumValueDescriptorProto instance - */ - public static create(properties?: google.protobuf.IEnumValueDescriptorProto): google.protobuf.EnumValueDescriptorProto; - - /** - * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @param message EnumValueDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @param message EnumValueDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueDescriptorProto; - - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueDescriptorProto; - - /** - * Verifies an EnumValueDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumValueDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueDescriptorProto; - - /** - * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. - * @param message EnumValueDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumValueDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumValueDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumValueDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ServiceDescriptorProto. */ - interface IServiceDescriptorProto { - - /** ServiceDescriptorProto name */ - name?: (string|null); - - /** ServiceDescriptorProto method */ - method?: (google.protobuf.IMethodDescriptorProto[]|null); - - /** ServiceDescriptorProto options */ - options?: (google.protobuf.IServiceOptions|null); - } - - /** Represents a ServiceDescriptorProto. */ - class ServiceDescriptorProto implements IServiceDescriptorProto { - - /** - * Constructs a new ServiceDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IServiceDescriptorProto); - - /** ServiceDescriptorProto name. */ - public name: string; - - /** ServiceDescriptorProto method. */ - public method: google.protobuf.IMethodDescriptorProto[]; - - /** ServiceDescriptorProto options. */ - public options?: (google.protobuf.IServiceOptions|null); - - /** - * Creates a new ServiceDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns ServiceDescriptorProto instance - */ - public static create(properties?: google.protobuf.IServiceDescriptorProto): google.protobuf.ServiceDescriptorProto; - - /** - * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @param message ServiceDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @param message ServiceDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceDescriptorProto; - - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceDescriptorProto; - - /** - * Verifies a ServiceDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ServiceDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceDescriptorProto; - - /** - * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. - * @param message ServiceDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ServiceDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ServiceDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ServiceDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a MethodDescriptorProto. */ - interface IMethodDescriptorProto { - - /** MethodDescriptorProto name */ - name?: (string|null); - - /** MethodDescriptorProto inputType */ - inputType?: (string|null); - - /** MethodDescriptorProto outputType */ - outputType?: (string|null); - - /** MethodDescriptorProto options */ - options?: (google.protobuf.IMethodOptions|null); - - /** MethodDescriptorProto clientStreaming */ - clientStreaming?: (boolean|null); - - /** MethodDescriptorProto serverStreaming */ - serverStreaming?: (boolean|null); - } - - /** Represents a MethodDescriptorProto. */ - class MethodDescriptorProto implements IMethodDescriptorProto { - - /** - * Constructs a new MethodDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IMethodDescriptorProto); - - /** MethodDescriptorProto name. */ - public name: string; - - /** MethodDescriptorProto inputType. */ - public inputType: string; - - /** MethodDescriptorProto outputType. */ - public outputType: string; - - /** MethodDescriptorProto options. */ - public options?: (google.protobuf.IMethodOptions|null); - - /** MethodDescriptorProto clientStreaming. */ - public clientStreaming: boolean; - - /** MethodDescriptorProto serverStreaming. */ - public serverStreaming: boolean; - - /** - * Creates a new MethodDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns MethodDescriptorProto instance - */ - public static create(properties?: google.protobuf.IMethodDescriptorProto): google.protobuf.MethodDescriptorProto; - - /** - * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @param message MethodDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @param message MethodDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodDescriptorProto; - - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodDescriptorProto; - - /** - * Verifies a MethodDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MethodDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.MethodDescriptorProto; - - /** - * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. - * @param message MethodDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.MethodDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MethodDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MethodDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a FileOptions. */ - interface IFileOptions { - - /** FileOptions javaPackage */ - javaPackage?: (string|null); - - /** FileOptions javaOuterClassname */ - javaOuterClassname?: (string|null); - - /** FileOptions javaMultipleFiles */ - javaMultipleFiles?: (boolean|null); - - /** FileOptions javaGenerateEqualsAndHash */ - javaGenerateEqualsAndHash?: (boolean|null); - - /** FileOptions javaStringCheckUtf8 */ - javaStringCheckUtf8?: (boolean|null); - - /** FileOptions optimizeFor */ - optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode|null); - - /** FileOptions goPackage */ - goPackage?: (string|null); - - /** FileOptions ccGenericServices */ - ccGenericServices?: (boolean|null); - - /** FileOptions javaGenericServices */ - javaGenericServices?: (boolean|null); - - /** FileOptions pyGenericServices */ - pyGenericServices?: (boolean|null); - - /** FileOptions deprecated */ - deprecated?: (boolean|null); - - /** FileOptions ccEnableArenas */ - ccEnableArenas?: (boolean|null); - - /** FileOptions objcClassPrefix */ - objcClassPrefix?: (string|null); - - /** FileOptions csharpNamespace */ - csharpNamespace?: (string|null); - - /** FileOptions swiftPrefix */ - swiftPrefix?: (string|null); - - /** FileOptions phpClassPrefix */ - phpClassPrefix?: (string|null); - - /** FileOptions phpNamespace */ - phpNamespace?: (string|null); - - /** FileOptions phpMetadataNamespace */ - phpMetadataNamespace?: (string|null); - - /** FileOptions rubyPackage */ - rubyPackage?: (string|null); - - /** FileOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** FileOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** FileOptions .google.api.resourceDefinition */ - ".google.api.resourceDefinition"?: (google.api.IResourceDescriptor[]|null); - } - - /** Represents a FileOptions. */ - class FileOptions implements IFileOptions { - - /** - * Constructs a new FileOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFileOptions); - - /** FileOptions javaPackage. */ - public javaPackage: string; - - /** FileOptions javaOuterClassname. */ - public javaOuterClassname: string; - - /** FileOptions javaMultipleFiles. */ - public javaMultipleFiles: boolean; - - /** FileOptions javaGenerateEqualsAndHash. */ - public javaGenerateEqualsAndHash: boolean; - - /** FileOptions javaStringCheckUtf8. */ - public javaStringCheckUtf8: boolean; - - /** FileOptions optimizeFor. */ - public optimizeFor: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode); - - /** FileOptions goPackage. */ - public goPackage: string; - - /** FileOptions ccGenericServices. */ - public ccGenericServices: boolean; - - /** FileOptions javaGenericServices. */ - public javaGenericServices: boolean; - - /** FileOptions pyGenericServices. */ - public pyGenericServices: boolean; - - /** FileOptions deprecated. */ - public deprecated: boolean; - - /** FileOptions ccEnableArenas. */ - public ccEnableArenas: boolean; - - /** FileOptions objcClassPrefix. */ - public objcClassPrefix: string; - - /** FileOptions csharpNamespace. */ - public csharpNamespace: string; - - /** FileOptions swiftPrefix. */ - public swiftPrefix: string; - - /** FileOptions phpClassPrefix. */ - public phpClassPrefix: string; - - /** FileOptions phpNamespace. */ - public phpNamespace: string; - - /** FileOptions phpMetadataNamespace. */ - public phpMetadataNamespace: string; - - /** FileOptions rubyPackage. */ - public rubyPackage: string; - - /** FileOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** FileOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new FileOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns FileOptions instance - */ - public static create(properties?: google.protobuf.IFileOptions): google.protobuf.FileOptions; - - /** - * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @param message FileOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @param message FileOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FileOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileOptions; - - /** - * Decodes a FileOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileOptions; - - /** - * Verifies a FileOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FileOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FileOptions; - - /** - * Creates a plain object from a FileOptions message. Also converts values to other types if specified. - * @param message FileOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FileOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FileOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FileOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FileOptions { - - /** OptimizeMode enum. */ - enum OptimizeMode { - SPEED = 1, - CODE_SIZE = 2, - LITE_RUNTIME = 3 - } - } - - /** Properties of a MessageOptions. */ - interface IMessageOptions { - - /** MessageOptions messageSetWireFormat */ - messageSetWireFormat?: (boolean|null); - - /** MessageOptions noStandardDescriptorAccessor */ - noStandardDescriptorAccessor?: (boolean|null); - - /** MessageOptions deprecated */ - deprecated?: (boolean|null); - - /** MessageOptions mapEntry */ - mapEntry?: (boolean|null); - - /** MessageOptions deprecatedLegacyJsonFieldConflicts */ - deprecatedLegacyJsonFieldConflicts?: (boolean|null); - - /** MessageOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** MessageOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** MessageOptions .google.api.resource */ - ".google.api.resource"?: (google.api.IResourceDescriptor|null); - } - - /** Represents a MessageOptions. */ - class MessageOptions implements IMessageOptions { - - /** - * Constructs a new MessageOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IMessageOptions); - - /** MessageOptions messageSetWireFormat. */ - public messageSetWireFormat: boolean; - - /** MessageOptions noStandardDescriptorAccessor. */ - public noStandardDescriptorAccessor: boolean; - - /** MessageOptions deprecated. */ - public deprecated: boolean; - - /** MessageOptions mapEntry. */ - public mapEntry: boolean; - - /** MessageOptions deprecatedLegacyJsonFieldConflicts. */ - public deprecatedLegacyJsonFieldConflicts: boolean; - - /** MessageOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** MessageOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new MessageOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns MessageOptions instance - */ - public static create(properties?: google.protobuf.IMessageOptions): google.protobuf.MessageOptions; - - /** - * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @param message MessageOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @param message MessageOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MessageOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MessageOptions; - - /** - * Decodes a MessageOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MessageOptions; - - /** - * Verifies a MessageOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MessageOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.MessageOptions; - - /** - * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. - * @param message MessageOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.MessageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MessageOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MessageOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a FieldOptions. */ - interface IFieldOptions { - - /** FieldOptions ctype */ - ctype?: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType|null); - - /** FieldOptions packed */ - packed?: (boolean|null); - - /** FieldOptions jstype */ - jstype?: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType|null); - - /** FieldOptions lazy */ - lazy?: (boolean|null); - - /** FieldOptions unverifiedLazy */ - unverifiedLazy?: (boolean|null); - - /** FieldOptions deprecated */ - deprecated?: (boolean|null); - - /** FieldOptions weak */ - weak?: (boolean|null); - - /** FieldOptions debugRedact */ - debugRedact?: (boolean|null); - - /** FieldOptions retention */ - retention?: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention|null); - - /** FieldOptions targets */ - targets?: (google.protobuf.FieldOptions.OptionTargetType[]|null); - - /** FieldOptions editionDefaults */ - editionDefaults?: (google.protobuf.FieldOptions.IEditionDefault[]|null); - - /** FieldOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** FieldOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** FieldOptions .google.api.fieldBehavior */ - ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); - - /** FieldOptions .google.api.resourceReference */ - ".google.api.resourceReference"?: (google.api.IResourceReference|null); - } - - /** Represents a FieldOptions. */ - class FieldOptions implements IFieldOptions { - - /** - * Constructs a new FieldOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFieldOptions); - - /** FieldOptions ctype. */ - public ctype: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType); - - /** FieldOptions packed. */ - public packed: boolean; - - /** FieldOptions jstype. */ - public jstype: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType); - - /** FieldOptions lazy. */ - public lazy: boolean; - - /** FieldOptions unverifiedLazy. */ - public unverifiedLazy: boolean; - - /** FieldOptions deprecated. */ - public deprecated: boolean; - - /** FieldOptions weak. */ - public weak: boolean; - - /** FieldOptions debugRedact. */ - public debugRedact: boolean; - - /** FieldOptions retention. */ - public retention: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention); - - /** FieldOptions targets. */ - public targets: google.protobuf.FieldOptions.OptionTargetType[]; - - /** FieldOptions editionDefaults. */ - public editionDefaults: google.protobuf.FieldOptions.IEditionDefault[]; - - /** FieldOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** FieldOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new FieldOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns FieldOptions instance - */ - public static create(properties?: google.protobuf.IFieldOptions): google.protobuf.FieldOptions; - - /** - * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @param message FieldOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @param message FieldOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FieldOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions; - - /** - * Decodes a FieldOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions; - - /** - * Verifies a FieldOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FieldOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions; - - /** - * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. - * @param message FieldOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FieldOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FieldOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FieldOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FieldOptions { - - /** CType enum. */ - enum CType { - STRING = 0, - CORD = 1, - STRING_PIECE = 2 - } - - /** JSType enum. */ - enum JSType { - JS_NORMAL = 0, - JS_STRING = 1, - JS_NUMBER = 2 - } - - /** OptionRetention enum. */ - enum OptionRetention { - RETENTION_UNKNOWN = 0, - RETENTION_RUNTIME = 1, - RETENTION_SOURCE = 2 - } - - /** OptionTargetType enum. */ - enum OptionTargetType { - TARGET_TYPE_UNKNOWN = 0, - TARGET_TYPE_FILE = 1, - TARGET_TYPE_EXTENSION_RANGE = 2, - TARGET_TYPE_MESSAGE = 3, - TARGET_TYPE_FIELD = 4, - TARGET_TYPE_ONEOF = 5, - TARGET_TYPE_ENUM = 6, - TARGET_TYPE_ENUM_ENTRY = 7, - TARGET_TYPE_SERVICE = 8, - TARGET_TYPE_METHOD = 9 - } - - /** Properties of an EditionDefault. */ - interface IEditionDefault { - - /** EditionDefault edition */ - edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - - /** EditionDefault value */ - value?: (string|null); - } - - /** Represents an EditionDefault. */ - class EditionDefault implements IEditionDefault { - - /** - * Constructs a new EditionDefault. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.FieldOptions.IEditionDefault); - - /** EditionDefault edition. */ - public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** EditionDefault value. */ - public value: string; - - /** - * Creates a new EditionDefault instance using the specified properties. - * @param [properties] Properties to set - * @returns EditionDefault instance - */ - public static create(properties?: google.protobuf.FieldOptions.IEditionDefault): google.protobuf.FieldOptions.EditionDefault; - - /** - * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. - * @param message EditionDefault message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. - * @param message EditionDefault message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EditionDefault message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions.EditionDefault; - - /** - * Decodes an EditionDefault message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions.EditionDefault; - - /** - * Verifies an EditionDefault message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EditionDefault - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions.EditionDefault; - - /** - * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. - * @param message EditionDefault - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FieldOptions.EditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EditionDefault to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EditionDefault - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an OneofOptions. */ - interface IOneofOptions { - - /** OneofOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** OneofOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - } - - /** Represents an OneofOptions. */ - class OneofOptions implements IOneofOptions { - - /** - * Constructs a new OneofOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IOneofOptions); - - /** OneofOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** OneofOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new OneofOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns OneofOptions instance - */ - public static create(properties?: google.protobuf.IOneofOptions): google.protobuf.OneofOptions; - - /** - * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @param message OneofOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @param message OneofOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OneofOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofOptions; - - /** - * Decodes an OneofOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofOptions; - - /** - * Verifies an OneofOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OneofOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.OneofOptions; - - /** - * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. - * @param message OneofOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.OneofOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OneofOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for OneofOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EnumOptions. */ - interface IEnumOptions { - - /** EnumOptions allowAlias */ - allowAlias?: (boolean|null); - - /** EnumOptions deprecated */ - deprecated?: (boolean|null); - - /** EnumOptions deprecatedLegacyJsonFieldConflicts */ - deprecatedLegacyJsonFieldConflicts?: (boolean|null); - - /** EnumOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** EnumOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - } - - /** Represents an EnumOptions. */ - class EnumOptions implements IEnumOptions { - - /** - * Constructs a new EnumOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumOptions); - - /** EnumOptions allowAlias. */ - public allowAlias: boolean; - - /** EnumOptions deprecated. */ - public deprecated: boolean; - - /** EnumOptions deprecatedLegacyJsonFieldConflicts. */ - public deprecatedLegacyJsonFieldConflicts: boolean; - - /** EnumOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** EnumOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new EnumOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumOptions instance - */ - public static create(properties?: google.protobuf.IEnumOptions): google.protobuf.EnumOptions; - - /** - * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @param message EnumOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @param message EnumOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumOptions; - - /** - * Decodes an EnumOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumOptions; - - /** - * Verifies an EnumOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumOptions; - - /** - * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. - * @param message EnumOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EnumValueOptions. */ - interface IEnumValueOptions { - - /** EnumValueOptions deprecated */ - deprecated?: (boolean|null); - - /** EnumValueOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** EnumValueOptions debugRedact */ - debugRedact?: (boolean|null); - - /** EnumValueOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - } - - /** Represents an EnumValueOptions. */ - class EnumValueOptions implements IEnumValueOptions { - - /** - * Constructs a new EnumValueOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumValueOptions); - - /** EnumValueOptions deprecated. */ - public deprecated: boolean; - - /** EnumValueOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** EnumValueOptions debugRedact. */ - public debugRedact: boolean; - - /** EnumValueOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new EnumValueOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumValueOptions instance - */ - public static create(properties?: google.protobuf.IEnumValueOptions): google.protobuf.EnumValueOptions; - - /** - * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @param message EnumValueOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @param message EnumValueOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumValueOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumValueOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueOptions; - - /** - * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumValueOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueOptions; - - /** - * Verifies an EnumValueOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumValueOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueOptions; - - /** - * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. - * @param message EnumValueOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumValueOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumValueOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ServiceOptions. */ - interface IServiceOptions { - - /** ServiceOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** ServiceOptions deprecated */ - deprecated?: (boolean|null); - - /** ServiceOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** ServiceOptions .google.api.defaultHost */ - ".google.api.defaultHost"?: (string|null); - - /** ServiceOptions .google.api.oauthScopes */ - ".google.api.oauthScopes"?: (string|null); - - /** ServiceOptions .google.api.apiVersion */ - ".google.api.apiVersion"?: (string|null); - } - - /** Represents a ServiceOptions. */ - class ServiceOptions implements IServiceOptions { - - /** - * Constructs a new ServiceOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IServiceOptions); - - /** ServiceOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** ServiceOptions deprecated. */ - public deprecated: boolean; - - /** ServiceOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new ServiceOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns ServiceOptions instance - */ - public static create(properties?: google.protobuf.IServiceOptions): google.protobuf.ServiceOptions; - - /** - * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @param message ServiceOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @param message ServiceOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ServiceOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceOptions; - - /** - * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceOptions; - - /** - * Verifies a ServiceOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ServiceOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; - - /** - * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. - * @param message ServiceOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ServiceOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ServiceOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a MethodOptions. */ - interface IMethodOptions { - - /** MethodOptions deprecated */ - deprecated?: (boolean|null); - - /** MethodOptions idempotencyLevel */ - idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); - - /** MethodOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** MethodOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** MethodOptions .google.api.http */ - ".google.api.http"?: (google.api.IHttpRule|null); - - /** MethodOptions .google.api.methodSignature */ - ".google.api.methodSignature"?: (string[]|null); - - /** MethodOptions .google.longrunning.operationInfo */ - ".google.longrunning.operationInfo"?: (google.longrunning.IOperationInfo|null); - } - - /** Represents a MethodOptions. */ - class MethodOptions implements IMethodOptions { - - /** - * Constructs a new MethodOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IMethodOptions); - - /** MethodOptions deprecated. */ - public deprecated: boolean; - - /** MethodOptions idempotencyLevel. */ - public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); - - /** MethodOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** MethodOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new MethodOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns MethodOptions instance - */ - public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; - - /** - * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @param message MethodOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @param message MethodOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MethodOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MethodOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodOptions; - - /** - * Decodes a MethodOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MethodOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodOptions; - - /** - * Verifies a MethodOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MethodOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; - - /** - * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. - * @param message MethodOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MethodOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MethodOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace MethodOptions { - - /** IdempotencyLevel enum. */ - enum IdempotencyLevel { - IDEMPOTENCY_UNKNOWN = 0, - NO_SIDE_EFFECTS = 1, - IDEMPOTENT = 2 - } - } - - /** Properties of an UninterpretedOption. */ - interface IUninterpretedOption { - - /** UninterpretedOption name */ - name?: (google.protobuf.UninterpretedOption.INamePart[]|null); - - /** UninterpretedOption identifierValue */ - identifierValue?: (string|null); - - /** UninterpretedOption positiveIntValue */ - positiveIntValue?: (number|Long|string|null); - - /** UninterpretedOption negativeIntValue */ - negativeIntValue?: (number|Long|string|null); - - /** UninterpretedOption doubleValue */ - doubleValue?: (number|null); - - /** UninterpretedOption stringValue */ - stringValue?: (Uint8Array|Buffer|string|null); - - /** UninterpretedOption aggregateValue */ - aggregateValue?: (string|null); - } - - /** Represents an UninterpretedOption. */ - class UninterpretedOption implements IUninterpretedOption { - - /** - * Constructs a new UninterpretedOption. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IUninterpretedOption); - - /** UninterpretedOption name. */ - public name: google.protobuf.UninterpretedOption.INamePart[]; - - /** UninterpretedOption identifierValue. */ - public identifierValue: string; - - /** UninterpretedOption positiveIntValue. */ - public positiveIntValue: (number|Long|string); - - /** UninterpretedOption negativeIntValue. */ - public negativeIntValue: (number|Long|string); - - /** UninterpretedOption doubleValue. */ - public doubleValue: number; - - /** UninterpretedOption stringValue. */ - public stringValue: (Uint8Array|Buffer|string); - - /** UninterpretedOption aggregateValue. */ - public aggregateValue: string; - - /** - * Creates a new UninterpretedOption instance using the specified properties. - * @param [properties] Properties to set - * @returns UninterpretedOption instance - */ - public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; - - /** - * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @param message UninterpretedOption message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @param message UninterpretedOption message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption; - - /** - * Verifies an UninterpretedOption message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UninterpretedOption - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; - - /** - * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. - * @param message UninterpretedOption - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UninterpretedOption to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UninterpretedOption - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace UninterpretedOption { - - /** Properties of a NamePart. */ - interface INamePart { - - /** NamePart namePart */ - namePart: string; - - /** NamePart isExtension */ - isExtension: boolean; - } - - /** Represents a NamePart. */ - class NamePart implements INamePart { - - /** - * Constructs a new NamePart. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.UninterpretedOption.INamePart); - - /** NamePart namePart. */ - public namePart: string; - - /** NamePart isExtension. */ - public isExtension: boolean; - - /** - * Creates a new NamePart instance using the specified properties. - * @param [properties] Properties to set - * @returns NamePart instance - */ - public static create(properties?: google.protobuf.UninterpretedOption.INamePart): google.protobuf.UninterpretedOption.NamePart; - - /** - * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @param message NamePart message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @param message NamePart message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a NamePart message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption.NamePart; - - /** - * Decodes a NamePart message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption.NamePart; - - /** - * Verifies a NamePart message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a NamePart message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns NamePart - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; - - /** - * Creates a plain object from a NamePart message. Also converts values to other types if specified. - * @param message NamePart - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this NamePart to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for NamePart - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a FeatureSet. */ - interface IFeatureSet { - - /** FeatureSet fieldPresence */ - fieldPresence?: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence|null); - - /** FeatureSet enumType */ - enumType?: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType|null); - - /** FeatureSet repeatedFieldEncoding */ - repeatedFieldEncoding?: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding|null); - - /** FeatureSet utf8Validation */ - utf8Validation?: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation|null); - - /** FeatureSet messageEncoding */ - messageEncoding?: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding|null); - - /** FeatureSet jsonFormat */ - jsonFormat?: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat|null); - } - - /** Represents a FeatureSet. */ - class FeatureSet implements IFeatureSet { - - /** - * Constructs a new FeatureSet. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFeatureSet); - - /** FeatureSet fieldPresence. */ - public fieldPresence: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence); - - /** FeatureSet enumType. */ - public enumType: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType); - - /** FeatureSet repeatedFieldEncoding. */ - public repeatedFieldEncoding: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding); - - /** FeatureSet utf8Validation. */ - public utf8Validation: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation); - - /** FeatureSet messageEncoding. */ - public messageEncoding: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding); - - /** FeatureSet jsonFormat. */ - public jsonFormat: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat); - - /** - * Creates a new FeatureSet instance using the specified properties. - * @param [properties] Properties to set - * @returns FeatureSet instance - */ - public static create(properties?: google.protobuf.IFeatureSet): google.protobuf.FeatureSet; - - /** - * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. - * @param message FeatureSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. - * @param message FeatureSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FeatureSet message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FeatureSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSet; - - /** - * Decodes a FeatureSet message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FeatureSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSet; - - /** - * Verifies a FeatureSet message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FeatureSet - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSet; - - /** - * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. - * @param message FeatureSet - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FeatureSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FeatureSet to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FeatureSet - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FeatureSet { - - /** FieldPresence enum. */ - enum FieldPresence { - FIELD_PRESENCE_UNKNOWN = 0, - EXPLICIT = 1, - IMPLICIT = 2, - LEGACY_REQUIRED = 3 - } - - /** EnumType enum. */ - enum EnumType { - ENUM_TYPE_UNKNOWN = 0, - OPEN = 1, - CLOSED = 2 - } - - /** RepeatedFieldEncoding enum. */ - enum RepeatedFieldEncoding { - REPEATED_FIELD_ENCODING_UNKNOWN = 0, - PACKED = 1, - EXPANDED = 2 - } - - /** Utf8Validation enum. */ - enum Utf8Validation { - UTF8_VALIDATION_UNKNOWN = 0, - VERIFY = 2, - NONE = 3 - } - - /** MessageEncoding enum. */ - enum MessageEncoding { - MESSAGE_ENCODING_UNKNOWN = 0, - LENGTH_PREFIXED = 1, - DELIMITED = 2 - } - - /** JsonFormat enum. */ - enum JsonFormat { - JSON_FORMAT_UNKNOWN = 0, - ALLOW = 1, - LEGACY_BEST_EFFORT = 2 - } - } - - /** Properties of a FeatureSetDefaults. */ - interface IFeatureSetDefaults { - - /** FeatureSetDefaults defaults */ - defaults?: (google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]|null); - - /** FeatureSetDefaults minimumEdition */ - minimumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - - /** FeatureSetDefaults maximumEdition */ - maximumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - } - - /** Represents a FeatureSetDefaults. */ - class FeatureSetDefaults implements IFeatureSetDefaults { - - /** - * Constructs a new FeatureSetDefaults. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFeatureSetDefaults); - - /** FeatureSetDefaults defaults. */ - public defaults: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]; - - /** FeatureSetDefaults minimumEdition. */ - public minimumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** FeatureSetDefaults maximumEdition. */ - public maximumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** - * Creates a new FeatureSetDefaults instance using the specified properties. - * @param [properties] Properties to set - * @returns FeatureSetDefaults instance - */ - public static create(properties?: google.protobuf.IFeatureSetDefaults): google.protobuf.FeatureSetDefaults; - - /** - * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. - * @param message FeatureSetDefaults message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. - * @param message FeatureSetDefaults message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FeatureSetDefaults message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FeatureSetDefaults - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSetDefaults; - - /** - * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FeatureSetDefaults - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSetDefaults; - - /** - * Verifies a FeatureSetDefaults message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FeatureSetDefaults - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults; - - /** - * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. - * @param message FeatureSetDefaults - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FeatureSetDefaults, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FeatureSetDefaults to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FeatureSetDefaults - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FeatureSetDefaults { - - /** Properties of a FeatureSetEditionDefault. */ - interface IFeatureSetEditionDefault { - - /** FeatureSetEditionDefault edition */ - edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - - /** FeatureSetEditionDefault features */ - features?: (google.protobuf.IFeatureSet|null); - } - - /** Represents a FeatureSetEditionDefault. */ - class FeatureSetEditionDefault implements IFeatureSetEditionDefault { - - /** - * Constructs a new FeatureSetEditionDefault. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault); - - /** FeatureSetEditionDefault edition. */ - public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** FeatureSetEditionDefault features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** - * Creates a new FeatureSetEditionDefault instance using the specified properties. - * @param [properties] Properties to set - * @returns FeatureSetEditionDefault instance - */ - public static create(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; - - /** - * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. - * @param message FeatureSetEditionDefault message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. - * @param message FeatureSetEditionDefault message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FeatureSetEditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; - - /** - * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FeatureSetEditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; - - /** - * Verifies a FeatureSetEditionDefault message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FeatureSetEditionDefault - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; - - /** - * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. - * @param message FeatureSetEditionDefault - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FeatureSetEditionDefault to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FeatureSetEditionDefault - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a SourceCodeInfo. */ - interface ISourceCodeInfo { - - /** SourceCodeInfo location */ - location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); - } - - /** Represents a SourceCodeInfo. */ - class SourceCodeInfo implements ISourceCodeInfo { - - /** - * Constructs a new SourceCodeInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.ISourceCodeInfo); - - /** SourceCodeInfo location. */ - public location: google.protobuf.SourceCodeInfo.ILocation[]; - - /** - * Creates a new SourceCodeInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns SourceCodeInfo instance - */ - public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; - - /** - * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @param message SourceCodeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @param message SourceCodeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo; - - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo; - - /** - * Verifies a SourceCodeInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SourceCodeInfo - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; - - /** - * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. - * @param message SourceCodeInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SourceCodeInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SourceCodeInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace SourceCodeInfo { - - /** Properties of a Location. */ - interface ILocation { - - /** Location path */ - path?: (number[]|null); - - /** Location span */ - span?: (number[]|null); - - /** Location leadingComments */ - leadingComments?: (string|null); - - /** Location trailingComments */ - trailingComments?: (string|null); - - /** Location leadingDetachedComments */ - leadingDetachedComments?: (string[]|null); - } - - /** Represents a Location. */ - class Location implements ILocation { - - /** - * Constructs a new Location. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); - - /** Location path. */ - public path: number[]; - - /** Location span. */ - public span: number[]; - - /** Location leadingComments. */ - public leadingComments: string; - - /** Location trailingComments. */ - public trailingComments: string; - - /** Location leadingDetachedComments. */ - public leadingDetachedComments: string[]; - - /** - * Creates a new Location instance using the specified properties. - * @param [properties] Properties to set - * @returns Location instance - */ - public static create(properties?: google.protobuf.SourceCodeInfo.ILocation): google.protobuf.SourceCodeInfo.Location; - - /** - * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @param message Location message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @param message Location message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Location message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo.Location; - - /** - * Decodes a Location message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo.Location; - - /** - * Verifies a Location message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Location message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Location - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; - - /** - * Creates a plain object from a Location message. Also converts values to other types if specified. - * @param message Location - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Location to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Location - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a GeneratedCodeInfo. */ - interface IGeneratedCodeInfo { - - /** GeneratedCodeInfo annotation */ - annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); - } - - /** Represents a GeneratedCodeInfo. */ - class GeneratedCodeInfo implements IGeneratedCodeInfo { - - /** - * Constructs a new GeneratedCodeInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IGeneratedCodeInfo); - - /** GeneratedCodeInfo annotation. */ - public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; - - /** - * Creates a new GeneratedCodeInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns GeneratedCodeInfo instance - */ - public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; - - /** - * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @param message GeneratedCodeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @param message GeneratedCodeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo; - - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo; - - /** - * Verifies a GeneratedCodeInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GeneratedCodeInfo - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; - - /** - * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. - * @param message GeneratedCodeInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GeneratedCodeInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GeneratedCodeInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace GeneratedCodeInfo { - - /** Properties of an Annotation. */ - interface IAnnotation { - - /** Annotation path */ - path?: (number[]|null); - - /** Annotation sourceFile */ - sourceFile?: (string|null); - - /** Annotation begin */ - begin?: (number|null); - - /** Annotation end */ - end?: (number|null); - - /** Annotation semantic */ - semantic?: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null); - } - - /** Represents an Annotation. */ - class Annotation implements IAnnotation { - - /** - * Constructs a new Annotation. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); - - /** Annotation path. */ - public path: number[]; - - /** Annotation sourceFile. */ - public sourceFile: string; - - /** Annotation begin. */ - public begin: number; - - /** Annotation end. */ - public end: number; - - /** Annotation semantic. */ - public semantic: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic); - - /** - * Creates a new Annotation instance using the specified properties. - * @param [properties] Properties to set - * @returns Annotation instance - */ - public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation; - - /** - * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @param message Annotation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @param message Annotation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Annotation message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo.Annotation; - - /** - * Decodes an Annotation message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo.Annotation; - - /** - * Verifies an Annotation message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Annotation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Annotation - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; - - /** - * Creates a plain object from an Annotation message. Also converts values to other types if specified. - * @param message Annotation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Annotation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Annotation - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Annotation { - - /** Semantic enum. */ - enum Semantic { - NONE = 0, - SET = 1, - ALIAS = 2 - } - } - } - - /** Properties of a Timestamp. */ - interface ITimestamp { - - /** Timestamp seconds */ - seconds?: (number|Long|string|null); - - /** Timestamp nanos */ - nanos?: (number|null); - } - - /** Represents a Timestamp. */ - class Timestamp implements ITimestamp { - - /** - * Constructs a new Timestamp. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.ITimestamp); - - /** Timestamp seconds. */ - public seconds: (number|Long|string); - - /** Timestamp nanos. */ - public nanos: number; - - /** - * Creates a new Timestamp instance using the specified properties. - * @param [properties] Properties to set - * @returns Timestamp instance - */ - public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp; - - /** - * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @param message Timestamp message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @param message Timestamp message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Timestamp message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Timestamp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Timestamp; - - /** - * Decodes a Timestamp message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Timestamp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Timestamp; - - /** - * Verifies a Timestamp message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Timestamp - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; - - /** - * Creates a plain object from a Timestamp message. Also converts values to other types if specified. - * @param message Timestamp - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Timestamp to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Timestamp - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Duration. */ - interface IDuration { - - /** Duration seconds */ - seconds?: (number|Long|string|null); - - /** Duration nanos */ - nanos?: (number|null); - } - - /** Represents a Duration. */ - class Duration implements IDuration { - - /** - * Constructs a new Duration. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IDuration); - - /** Duration seconds. */ - public seconds: (number|Long|string); - - /** Duration nanos. */ - public nanos: number; - - /** - * Creates a new Duration instance using the specified properties. - * @param [properties] Properties to set - * @returns Duration instance - */ - public static create(properties?: google.protobuf.IDuration): google.protobuf.Duration; - - /** - * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @param message Duration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @param message Duration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Duration message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Duration; - - /** - * Decodes a Duration message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Duration; - - /** - * Verifies a Duration message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Duration message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Duration - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; - - /** - * Creates a plain object from a Duration message. Also converts values to other types if specified. - * @param message Duration - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Duration to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Duration - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a FieldMask. */ - interface IFieldMask { - - /** FieldMask paths */ - paths?: (string[]|null); - } - - /** Represents a FieldMask. */ - class FieldMask implements IFieldMask { - - /** - * Constructs a new FieldMask. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFieldMask); - - /** FieldMask paths. */ - public paths: string[]; - - /** - * Creates a new FieldMask instance using the specified properties. - * @param [properties] Properties to set - * @returns FieldMask instance - */ - public static create(properties?: google.protobuf.IFieldMask): google.protobuf.FieldMask; - - /** - * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. - * @param message FieldMask message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. - * @param message FieldMask message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FieldMask message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FieldMask - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldMask; - - /** - * Decodes a FieldMask message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FieldMask - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldMask; - - /** - * Verifies a FieldMask message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FieldMask - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldMask; - - /** - * Creates a plain object from a FieldMask message. Also converts values to other types if specified. - * @param message FieldMask - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FieldMask, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FieldMask to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FieldMask - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an Any. */ - interface IAny { - - /** Any type_url */ - type_url?: (string|null); - - /** Any value */ - value?: (Uint8Array|Buffer|string|null); - } - - /** Represents an Any. */ - class Any implements IAny { - - /** - * Constructs a new Any. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IAny); - - /** Any type_url. */ - public type_url: string; - - /** Any value. */ - public value: (Uint8Array|Buffer|string); - - /** - * Creates a new Any instance using the specified properties. - * @param [properties] Properties to set - * @returns Any instance - */ - public static create(properties?: google.protobuf.IAny): google.protobuf.Any; - - /** - * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. - * @param message Any message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. - * @param message Any message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Any message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Any - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Any; - - /** - * Decodes an Any message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Any - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Any; - - /** - * Verifies an Any message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Any message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Any - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Any; - - /** - * Creates a plain object from an Any message. Also converts values to other types if specified. - * @param message Any - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Any, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Any to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Any - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an Empty. */ - interface IEmpty { - } - - /** Represents an Empty. */ - class Empty implements IEmpty { - - /** - * Constructs a new Empty. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEmpty); - - /** - * Creates a new Empty instance using the specified properties. - * @param [properties] Properties to set - * @returns Empty instance - */ - public static create(properties?: google.protobuf.IEmpty): google.protobuf.Empty; - - /** - * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. - * @param message Empty message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. - * @param message Empty message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Empty message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Empty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Empty; - - /** - * Decodes an Empty message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Empty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Empty; - - /** - * Verifies an Empty message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Empty message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Empty - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Empty; - - /** - * Creates a plain object from an Empty message. Also converts values to other types if specified. - * @param message Empty - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Empty to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Empty - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Namespace iam. */ - namespace iam { - - /** Namespace v1. */ - namespace v1 { - - /** Represents a IAMPolicy */ - class IAMPolicy extends $protobuf.rpc.Service { - - /** - * Constructs a new IAMPolicy service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - - /** - * Creates new IAMPolicy service using the specified rpc implementation. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - * @returns RPC service. Useful where requests and/or responses are streamed. - */ - public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): IAMPolicy; - - /** - * Calls SetIamPolicy. - * @param request SetIamPolicyRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Policy - */ - public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest, callback: google.iam.v1.IAMPolicy.SetIamPolicyCallback): void; - - /** - * Calls SetIamPolicy. - * @param request SetIamPolicyRequest message or plain object - * @returns Promise - */ - public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest): Promise; - - /** - * Calls GetIamPolicy. - * @param request GetIamPolicyRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Policy - */ - public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest, callback: google.iam.v1.IAMPolicy.GetIamPolicyCallback): void; - - /** - * Calls GetIamPolicy. - * @param request GetIamPolicyRequest message or plain object - * @returns Promise - */ - public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest): Promise; - - /** - * Calls TestIamPermissions. - * @param request TestIamPermissionsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and TestIamPermissionsResponse - */ - public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest, callback: google.iam.v1.IAMPolicy.TestIamPermissionsCallback): void; - - /** - * Calls TestIamPermissions. - * @param request TestIamPermissionsRequest message or plain object - * @returns Promise - */ - public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest): Promise; - } - - namespace IAMPolicy { - - /** - * Callback as used by {@link google.iam.v1.IAMPolicy|setIamPolicy}. - * @param error Error, if any - * @param [response] Policy - */ - type SetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; - - /** - * Callback as used by {@link google.iam.v1.IAMPolicy|getIamPolicy}. - * @param error Error, if any - * @param [response] Policy - */ - type GetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; - - /** - * Callback as used by {@link google.iam.v1.IAMPolicy|testIamPermissions}. - * @param error Error, if any - * @param [response] TestIamPermissionsResponse - */ - type TestIamPermissionsCallback = (error: (Error|null), response?: google.iam.v1.TestIamPermissionsResponse) => void; - } - - /** Properties of a SetIamPolicyRequest. */ - interface ISetIamPolicyRequest { - - /** SetIamPolicyRequest resource */ - resource?: (string|null); - - /** SetIamPolicyRequest policy */ - policy?: (google.iam.v1.IPolicy|null); - - /** SetIamPolicyRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - } - - /** Represents a SetIamPolicyRequest. */ - class SetIamPolicyRequest implements ISetIamPolicyRequest { - - /** - * Constructs a new SetIamPolicyRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.ISetIamPolicyRequest); - - /** SetIamPolicyRequest resource. */ - public resource: string; - - /** SetIamPolicyRequest policy. */ - public policy?: (google.iam.v1.IPolicy|null); - - /** SetIamPolicyRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** - * Creates a new SetIamPolicyRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns SetIamPolicyRequest instance - */ - public static create(properties?: google.iam.v1.ISetIamPolicyRequest): google.iam.v1.SetIamPolicyRequest; - - /** - * Encodes the specified SetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. - * @param message SetIamPolicyRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.ISetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. - * @param message SetIamPolicyRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.ISetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SetIamPolicyRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SetIamPolicyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.SetIamPolicyRequest; - - /** - * Decodes a SetIamPolicyRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SetIamPolicyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.SetIamPolicyRequest; - - /** - * Verifies a SetIamPolicyRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SetIamPolicyRequest - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.SetIamPolicyRequest; - - /** - * Creates a plain object from a SetIamPolicyRequest message. Also converts values to other types if specified. - * @param message SetIamPolicyRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.SetIamPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SetIamPolicyRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SetIamPolicyRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetIamPolicyRequest. */ - interface IGetIamPolicyRequest { - - /** GetIamPolicyRequest resource */ - resource?: (string|null); - - /** GetIamPolicyRequest options */ - options?: (google.iam.v1.IGetPolicyOptions|null); - } - - /** Represents a GetIamPolicyRequest. */ - class GetIamPolicyRequest implements IGetIamPolicyRequest { - - /** - * Constructs a new GetIamPolicyRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.IGetIamPolicyRequest); - - /** GetIamPolicyRequest resource. */ - public resource: string; - - /** GetIamPolicyRequest options. */ - public options?: (google.iam.v1.IGetPolicyOptions|null); - - /** - * Creates a new GetIamPolicyRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetIamPolicyRequest instance - */ - public static create(properties?: google.iam.v1.IGetIamPolicyRequest): google.iam.v1.GetIamPolicyRequest; - - /** - * Encodes the specified GetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. - * @param message GetIamPolicyRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.IGetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. - * @param message GetIamPolicyRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.IGetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetIamPolicyRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetIamPolicyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.GetIamPolicyRequest; - - /** - * Decodes a GetIamPolicyRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetIamPolicyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.GetIamPolicyRequest; - - /** - * Verifies a GetIamPolicyRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetIamPolicyRequest - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.GetIamPolicyRequest; - - /** - * Creates a plain object from a GetIamPolicyRequest message. Also converts values to other types if specified. - * @param message GetIamPolicyRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.GetIamPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetIamPolicyRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetIamPolicyRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a TestIamPermissionsRequest. */ - interface ITestIamPermissionsRequest { - - /** TestIamPermissionsRequest resource */ - resource?: (string|null); - - /** TestIamPermissionsRequest permissions */ - permissions?: (string[]|null); - } - - /** Represents a TestIamPermissionsRequest. */ - class TestIamPermissionsRequest implements ITestIamPermissionsRequest { - - /** - * Constructs a new TestIamPermissionsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.ITestIamPermissionsRequest); - - /** TestIamPermissionsRequest resource. */ - public resource: string; - - /** TestIamPermissionsRequest permissions. */ - public permissions: string[]; - - /** - * Creates a new TestIamPermissionsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns TestIamPermissionsRequest instance - */ - public static create(properties?: google.iam.v1.ITestIamPermissionsRequest): google.iam.v1.TestIamPermissionsRequest; - - /** - * Encodes the specified TestIamPermissionsRequest message. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. - * @param message TestIamPermissionsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.ITestIamPermissionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TestIamPermissionsRequest message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. - * @param message TestIamPermissionsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.ITestIamPermissionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TestIamPermissionsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TestIamPermissionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.TestIamPermissionsRequest; - - /** - * Decodes a TestIamPermissionsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TestIamPermissionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.TestIamPermissionsRequest; - - /** - * Verifies a TestIamPermissionsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TestIamPermissionsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TestIamPermissionsRequest - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.TestIamPermissionsRequest; - - /** - * Creates a plain object from a TestIamPermissionsRequest message. Also converts values to other types if specified. - * @param message TestIamPermissionsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.TestIamPermissionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TestIamPermissionsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TestIamPermissionsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a TestIamPermissionsResponse. */ - interface ITestIamPermissionsResponse { - - /** TestIamPermissionsResponse permissions */ - permissions?: (string[]|null); - } - - /** Represents a TestIamPermissionsResponse. */ - class TestIamPermissionsResponse implements ITestIamPermissionsResponse { - - /** - * Constructs a new TestIamPermissionsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.ITestIamPermissionsResponse); - - /** TestIamPermissionsResponse permissions. */ - public permissions: string[]; - - /** - * Creates a new TestIamPermissionsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns TestIamPermissionsResponse instance - */ - public static create(properties?: google.iam.v1.ITestIamPermissionsResponse): google.iam.v1.TestIamPermissionsResponse; - - /** - * Encodes the specified TestIamPermissionsResponse message. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. - * @param message TestIamPermissionsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.ITestIamPermissionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TestIamPermissionsResponse message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. - * @param message TestIamPermissionsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.ITestIamPermissionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TestIamPermissionsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TestIamPermissionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.TestIamPermissionsResponse; - - /** - * Decodes a TestIamPermissionsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TestIamPermissionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.TestIamPermissionsResponse; - - /** - * Verifies a TestIamPermissionsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TestIamPermissionsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TestIamPermissionsResponse - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.TestIamPermissionsResponse; - - /** - * Creates a plain object from a TestIamPermissionsResponse message. Also converts values to other types if specified. - * @param message TestIamPermissionsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.TestIamPermissionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TestIamPermissionsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TestIamPermissionsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetPolicyOptions. */ - interface IGetPolicyOptions { - - /** GetPolicyOptions requestedPolicyVersion */ - requestedPolicyVersion?: (number|null); - } - - /** Represents a GetPolicyOptions. */ - class GetPolicyOptions implements IGetPolicyOptions { - - /** - * Constructs a new GetPolicyOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.IGetPolicyOptions); - - /** GetPolicyOptions requestedPolicyVersion. */ - public requestedPolicyVersion: number; - - /** - * Creates a new GetPolicyOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns GetPolicyOptions instance - */ - public static create(properties?: google.iam.v1.IGetPolicyOptions): google.iam.v1.GetPolicyOptions; - - /** - * Encodes the specified GetPolicyOptions message. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages. - * @param message GetPolicyOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.IGetPolicyOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetPolicyOptions message, length delimited. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages. - * @param message GetPolicyOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.IGetPolicyOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetPolicyOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetPolicyOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.GetPolicyOptions; - - /** - * Decodes a GetPolicyOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetPolicyOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.GetPolicyOptions; - - /** - * Verifies a GetPolicyOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetPolicyOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetPolicyOptions - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.GetPolicyOptions; - - /** - * Creates a plain object from a GetPolicyOptions message. Also converts values to other types if specified. - * @param message GetPolicyOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.GetPolicyOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetPolicyOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetPolicyOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Policy. */ - interface IPolicy { - - /** Policy version */ - version?: (number|null); - - /** Policy bindings */ - bindings?: (google.iam.v1.IBinding[]|null); - - /** Policy auditConfigs */ - auditConfigs?: (google.iam.v1.IAuditConfig[]|null); - - /** Policy etag */ - etag?: (Uint8Array|Buffer|string|null); - } - - /** Represents a Policy. */ - class Policy implements IPolicy { - - /** - * Constructs a new Policy. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.IPolicy); - - /** Policy version. */ - public version: number; - - /** Policy bindings. */ - public bindings: google.iam.v1.IBinding[]; - - /** Policy auditConfigs. */ - public auditConfigs: google.iam.v1.IAuditConfig[]; - - /** Policy etag. */ - public etag: (Uint8Array|Buffer|string); - - /** - * Creates a new Policy instance using the specified properties. - * @param [properties] Properties to set - * @returns Policy instance - */ - public static create(properties?: google.iam.v1.IPolicy): google.iam.v1.Policy; - - /** - * Encodes the specified Policy message. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. - * @param message Policy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.IPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Policy message, length delimited. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. - * @param message Policy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.IPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Policy message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Policy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.Policy; - - /** - * Decodes a Policy message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Policy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.Policy; - - /** - * Verifies a Policy message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Policy message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Policy - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.Policy; - - /** - * Creates a plain object from a Policy message. Also converts values to other types if specified. - * @param message Policy - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.Policy, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Policy to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Policy - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Binding. */ - interface IBinding { - - /** Binding role */ - role?: (string|null); - - /** Binding members */ - members?: (string[]|null); - - /** Binding condition */ - condition?: (google.type.IExpr|null); - } - - /** Represents a Binding. */ - class Binding implements IBinding { - - /** - * Constructs a new Binding. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.IBinding); - - /** Binding role. */ - public role: string; - - /** Binding members. */ - public members: string[]; - - /** Binding condition. */ - public condition?: (google.type.IExpr|null); - - /** - * Creates a new Binding instance using the specified properties. - * @param [properties] Properties to set - * @returns Binding instance - */ - public static create(properties?: google.iam.v1.IBinding): google.iam.v1.Binding; - - /** - * Encodes the specified Binding message. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. - * @param message Binding message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.IBinding, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Binding message, length delimited. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. - * @param message Binding message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.IBinding, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Binding message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Binding - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.Binding; - - /** - * Decodes a Binding message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Binding - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.Binding; - - /** - * Verifies a Binding message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Binding message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Binding - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.Binding; - - /** - * Creates a plain object from a Binding message. Also converts values to other types if specified. - * @param message Binding - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.Binding, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Binding to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Binding - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an AuditConfig. */ - interface IAuditConfig { - - /** AuditConfig service */ - service?: (string|null); - - /** AuditConfig auditLogConfigs */ - auditLogConfigs?: (google.iam.v1.IAuditLogConfig[]|null); - } - - /** Represents an AuditConfig. */ - class AuditConfig implements IAuditConfig { - - /** - * Constructs a new AuditConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.IAuditConfig); - - /** AuditConfig service. */ - public service: string; - - /** AuditConfig auditLogConfigs. */ - public auditLogConfigs: google.iam.v1.IAuditLogConfig[]; - - /** - * Creates a new AuditConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns AuditConfig instance - */ - public static create(properties?: google.iam.v1.IAuditConfig): google.iam.v1.AuditConfig; - - /** - * Encodes the specified AuditConfig message. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. - * @param message AuditConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.IAuditConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AuditConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. - * @param message AuditConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.IAuditConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AuditConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AuditConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.AuditConfig; - - /** - * Decodes an AuditConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AuditConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.AuditConfig; - - /** - * Verifies an AuditConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an AuditConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AuditConfig - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditConfig; - - /** - * Creates a plain object from an AuditConfig message. Also converts values to other types if specified. - * @param message AuditConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.AuditConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AuditConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AuditConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an AuditLogConfig. */ - interface IAuditLogConfig { - - /** AuditLogConfig logType */ - logType?: (google.iam.v1.AuditLogConfig.LogType|keyof typeof google.iam.v1.AuditLogConfig.LogType|null); - - /** AuditLogConfig exemptedMembers */ - exemptedMembers?: (string[]|null); - } - - /** Represents an AuditLogConfig. */ - class AuditLogConfig implements IAuditLogConfig { - - /** - * Constructs a new AuditLogConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.IAuditLogConfig); - - /** AuditLogConfig logType. */ - public logType: (google.iam.v1.AuditLogConfig.LogType|keyof typeof google.iam.v1.AuditLogConfig.LogType); - - /** AuditLogConfig exemptedMembers. */ - public exemptedMembers: string[]; - - /** - * Creates a new AuditLogConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns AuditLogConfig instance - */ - public static create(properties?: google.iam.v1.IAuditLogConfig): google.iam.v1.AuditLogConfig; - - /** - * Encodes the specified AuditLogConfig message. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. - * @param message AuditLogConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.IAuditLogConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AuditLogConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. - * @param message AuditLogConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.IAuditLogConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AuditLogConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AuditLogConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.AuditLogConfig; - - /** - * Decodes an AuditLogConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AuditLogConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.AuditLogConfig; - - /** - * Verifies an AuditLogConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an AuditLogConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AuditLogConfig - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditLogConfig; - - /** - * Creates a plain object from an AuditLogConfig message. Also converts values to other types if specified. - * @param message AuditLogConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.AuditLogConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AuditLogConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AuditLogConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace AuditLogConfig { - - /** LogType enum. */ - enum LogType { - LOG_TYPE_UNSPECIFIED = 0, - ADMIN_READ = 1, - DATA_WRITE = 2, - DATA_READ = 3 - } - } - - /** Properties of a PolicyDelta. */ - interface IPolicyDelta { - - /** PolicyDelta bindingDeltas */ - bindingDeltas?: (google.iam.v1.IBindingDelta[]|null); - - /** PolicyDelta auditConfigDeltas */ - auditConfigDeltas?: (google.iam.v1.IAuditConfigDelta[]|null); - } - - /** Represents a PolicyDelta. */ - class PolicyDelta implements IPolicyDelta { - - /** - * Constructs a new PolicyDelta. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.IPolicyDelta); - - /** PolicyDelta bindingDeltas. */ - public bindingDeltas: google.iam.v1.IBindingDelta[]; - - /** PolicyDelta auditConfigDeltas. */ - public auditConfigDeltas: google.iam.v1.IAuditConfigDelta[]; - - /** - * Creates a new PolicyDelta instance using the specified properties. - * @param [properties] Properties to set - * @returns PolicyDelta instance - */ - public static create(properties?: google.iam.v1.IPolicyDelta): google.iam.v1.PolicyDelta; - - /** - * Encodes the specified PolicyDelta message. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. - * @param message PolicyDelta message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.IPolicyDelta, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PolicyDelta message, length delimited. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. - * @param message PolicyDelta message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.IPolicyDelta, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PolicyDelta message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PolicyDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.PolicyDelta; - - /** - * Decodes a PolicyDelta message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PolicyDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.PolicyDelta; - - /** - * Verifies a PolicyDelta message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PolicyDelta message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PolicyDelta - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.PolicyDelta; - - /** - * Creates a plain object from a PolicyDelta message. Also converts values to other types if specified. - * @param message PolicyDelta - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.PolicyDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PolicyDelta to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PolicyDelta - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BindingDelta. */ - interface IBindingDelta { - - /** BindingDelta action */ - action?: (google.iam.v1.BindingDelta.Action|keyof typeof google.iam.v1.BindingDelta.Action|null); - - /** BindingDelta role */ - role?: (string|null); - - /** BindingDelta member */ - member?: (string|null); - - /** BindingDelta condition */ - condition?: (google.type.IExpr|null); - } - - /** Represents a BindingDelta. */ - class BindingDelta implements IBindingDelta { - - /** - * Constructs a new BindingDelta. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.IBindingDelta); - - /** BindingDelta action. */ - public action: (google.iam.v1.BindingDelta.Action|keyof typeof google.iam.v1.BindingDelta.Action); - - /** BindingDelta role. */ - public role: string; - - /** BindingDelta member. */ - public member: string; - - /** BindingDelta condition. */ - public condition?: (google.type.IExpr|null); - - /** - * Creates a new BindingDelta instance using the specified properties. - * @param [properties] Properties to set - * @returns BindingDelta instance - */ - public static create(properties?: google.iam.v1.IBindingDelta): google.iam.v1.BindingDelta; - - /** - * Encodes the specified BindingDelta message. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. - * @param message BindingDelta message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.IBindingDelta, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BindingDelta message, length delimited. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. - * @param message BindingDelta message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.IBindingDelta, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BindingDelta message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BindingDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.BindingDelta; - - /** - * Decodes a BindingDelta message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BindingDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.BindingDelta; - - /** - * Verifies a BindingDelta message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BindingDelta message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BindingDelta - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.BindingDelta; - - /** - * Creates a plain object from a BindingDelta message. Also converts values to other types if specified. - * @param message BindingDelta - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.BindingDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BindingDelta to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BindingDelta - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace BindingDelta { - - /** Action enum. */ - enum Action { - ACTION_UNSPECIFIED = 0, - ADD = 1, - REMOVE = 2 - } - } - - /** Properties of an AuditConfigDelta. */ - interface IAuditConfigDelta { - - /** AuditConfigDelta action */ - action?: (google.iam.v1.AuditConfigDelta.Action|keyof typeof google.iam.v1.AuditConfigDelta.Action|null); - - /** AuditConfigDelta service */ - service?: (string|null); - - /** AuditConfigDelta exemptedMember */ - exemptedMember?: (string|null); - - /** AuditConfigDelta logType */ - logType?: (string|null); - } - - /** Represents an AuditConfigDelta. */ - class AuditConfigDelta implements IAuditConfigDelta { - - /** - * Constructs a new AuditConfigDelta. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.IAuditConfigDelta); - - /** AuditConfigDelta action. */ - public action: (google.iam.v1.AuditConfigDelta.Action|keyof typeof google.iam.v1.AuditConfigDelta.Action); - - /** AuditConfigDelta service. */ - public service: string; - - /** AuditConfigDelta exemptedMember. */ - public exemptedMember: string; - - /** AuditConfigDelta logType. */ - public logType: string; - - /** - * Creates a new AuditConfigDelta instance using the specified properties. - * @param [properties] Properties to set - * @returns AuditConfigDelta instance - */ - public static create(properties?: google.iam.v1.IAuditConfigDelta): google.iam.v1.AuditConfigDelta; - - /** - * Encodes the specified AuditConfigDelta message. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. - * @param message AuditConfigDelta message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.IAuditConfigDelta, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AuditConfigDelta message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. - * @param message AuditConfigDelta message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.IAuditConfigDelta, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AuditConfigDelta message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AuditConfigDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.AuditConfigDelta; - - /** - * Decodes an AuditConfigDelta message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AuditConfigDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.AuditConfigDelta; - - /** - * Verifies an AuditConfigDelta message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an AuditConfigDelta message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AuditConfigDelta - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditConfigDelta; - - /** - * Creates a plain object from an AuditConfigDelta message. Also converts values to other types if specified. - * @param message AuditConfigDelta - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.AuditConfigDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AuditConfigDelta to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AuditConfigDelta - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace AuditConfigDelta { - - /** Action enum. */ - enum Action { - ACTION_UNSPECIFIED = 0, - ADD = 1, - REMOVE = 2 - } - } - } - } - - /** Namespace type. */ - namespace type { - - /** Properties of an Expr. */ - interface IExpr { - - /** Expr expression */ - expression?: (string|null); - - /** Expr title */ - title?: (string|null); - - /** Expr description */ - description?: (string|null); - - /** Expr location */ - location?: (string|null); - } - - /** Represents an Expr. */ - class Expr implements IExpr { - - /** - * Constructs a new Expr. - * @param [properties] Properties to set - */ - constructor(properties?: google.type.IExpr); - - /** Expr expression. */ - public expression: string; - - /** Expr title. */ - public title: string; - - /** Expr description. */ - public description: string; - - /** Expr location. */ - public location: string; - - /** - * Creates a new Expr instance using the specified properties. - * @param [properties] Properties to set - * @returns Expr instance - */ - public static create(properties?: google.type.IExpr): google.type.Expr; - - /** - * Encodes the specified Expr message. Does not implicitly {@link google.type.Expr.verify|verify} messages. - * @param message Expr message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.type.IExpr, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Expr message, length delimited. Does not implicitly {@link google.type.Expr.verify|verify} messages. - * @param message Expr message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.type.IExpr, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Expr message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Expr - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.type.Expr; - - /** - * Decodes an Expr message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Expr - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.type.Expr; - - /** - * Verifies an Expr message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Expr message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Expr - */ - public static fromObject(object: { [k: string]: any }): google.type.Expr; - - /** - * Creates a plain object from an Expr message. Also converts values to other types if specified. - * @param message Expr - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.type.Expr, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Expr to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Expr - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Namespace longrunning. */ - namespace longrunning { - - /** Represents an Operations */ - class Operations extends $protobuf.rpc.Service { - - /** - * Constructs a new Operations service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - - /** - * Creates new Operations service using the specified rpc implementation. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - * @returns RPC service. Useful where requests and/or responses are streamed. - */ - public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Operations; - - /** - * Calls ListOperations. - * @param request ListOperationsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListOperationsResponse - */ - public listOperations(request: google.longrunning.IListOperationsRequest, callback: google.longrunning.Operations.ListOperationsCallback): void; - - /** - * Calls ListOperations. - * @param request ListOperationsRequest message or plain object - * @returns Promise - */ - public listOperations(request: google.longrunning.IListOperationsRequest): Promise; - - /** - * Calls GetOperation. - * @param request GetOperationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public getOperation(request: google.longrunning.IGetOperationRequest, callback: google.longrunning.Operations.GetOperationCallback): void; - - /** - * Calls GetOperation. - * @param request GetOperationRequest message or plain object - * @returns Promise - */ - public getOperation(request: google.longrunning.IGetOperationRequest): Promise; - - /** - * Calls DeleteOperation. - * @param request DeleteOperationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteOperation(request: google.longrunning.IDeleteOperationRequest, callback: google.longrunning.Operations.DeleteOperationCallback): void; - - /** - * Calls DeleteOperation. - * @param request DeleteOperationRequest message or plain object - * @returns Promise - */ - public deleteOperation(request: google.longrunning.IDeleteOperationRequest): Promise; - - /** - * Calls CancelOperation. - * @param request CancelOperationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public cancelOperation(request: google.longrunning.ICancelOperationRequest, callback: google.longrunning.Operations.CancelOperationCallback): void; - - /** - * Calls CancelOperation. - * @param request CancelOperationRequest message or plain object - * @returns Promise - */ - public cancelOperation(request: google.longrunning.ICancelOperationRequest): Promise; - - /** - * Calls WaitOperation. - * @param request WaitOperationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public waitOperation(request: google.longrunning.IWaitOperationRequest, callback: google.longrunning.Operations.WaitOperationCallback): void; - - /** - * Calls WaitOperation. - * @param request WaitOperationRequest message or plain object - * @returns Promise - */ - public waitOperation(request: google.longrunning.IWaitOperationRequest): Promise; - } - - namespace Operations { - - /** - * Callback as used by {@link google.longrunning.Operations|listOperations}. - * @param error Error, if any - * @param [response] ListOperationsResponse - */ - type ListOperationsCallback = (error: (Error|null), response?: google.longrunning.ListOperationsResponse) => void; - - /** - * Callback as used by {@link google.longrunning.Operations|getOperation}. - * @param error Error, if any - * @param [response] Operation - */ - type GetOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.longrunning.Operations|deleteOperation}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.longrunning.Operations|cancelOperation}. - * @param error Error, if any - * @param [response] Empty - */ - type CancelOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.longrunning.Operations|waitOperation}. - * @param error Error, if any - * @param [response] Operation - */ - type WaitOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - } - - /** Properties of an Operation. */ - interface IOperation { - - /** Operation name */ - name?: (string|null); - - /** Operation metadata */ - metadata?: (google.protobuf.IAny|null); - - /** Operation done */ - done?: (boolean|null); - - /** Operation error */ - error?: (google.rpc.IStatus|null); - - /** Operation response */ - response?: (google.protobuf.IAny|null); - } - - /** Represents an Operation. */ - class Operation implements IOperation { - - /** - * Constructs a new Operation. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IOperation); - - /** Operation name. */ - public name: string; - - /** Operation metadata. */ - public metadata?: (google.protobuf.IAny|null); - - /** Operation done. */ - public done: boolean; - - /** Operation error. */ - public error?: (google.rpc.IStatus|null); - - /** Operation response. */ - public response?: (google.protobuf.IAny|null); - - /** Operation result. */ - public result?: ("error"|"response"); - - /** - * Creates a new Operation instance using the specified properties. - * @param [properties] Properties to set - * @returns Operation instance - */ - public static create(properties?: google.longrunning.IOperation): google.longrunning.Operation; - - /** - * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. - * @param message Operation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. - * @param message Operation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Operation message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Operation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.Operation; - - /** - * Decodes an Operation message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Operation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.Operation; - - /** - * Verifies an Operation message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Operation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Operation - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.Operation; - - /** - * Creates a plain object from an Operation message. Also converts values to other types if specified. - * @param message Operation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.Operation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Operation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Operation - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetOperationRequest. */ - interface IGetOperationRequest { - - /** GetOperationRequest name */ - name?: (string|null); - } - - /** Represents a GetOperationRequest. */ - class GetOperationRequest implements IGetOperationRequest { - - /** - * Constructs a new GetOperationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IGetOperationRequest); - - /** GetOperationRequest name. */ - public name: string; - - /** - * Creates a new GetOperationRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetOperationRequest instance - */ - public static create(properties?: google.longrunning.IGetOperationRequest): google.longrunning.GetOperationRequest; - - /** - * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. - * @param message GetOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. - * @param message GetOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetOperationRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.GetOperationRequest; - - /** - * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.GetOperationRequest; - - /** - * Verifies a GetOperationRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetOperationRequest - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.GetOperationRequest; - - /** - * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. - * @param message GetOperationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.GetOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetOperationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetOperationRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListOperationsRequest. */ - interface IListOperationsRequest { - - /** ListOperationsRequest name */ - name?: (string|null); - - /** ListOperationsRequest filter */ - filter?: (string|null); - - /** ListOperationsRequest pageSize */ - pageSize?: (number|null); - - /** ListOperationsRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListOperationsRequest. */ - class ListOperationsRequest implements IListOperationsRequest { - - /** - * Constructs a new ListOperationsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IListOperationsRequest); - - /** ListOperationsRequest name. */ - public name: string; - - /** ListOperationsRequest filter. */ - public filter: string; - - /** ListOperationsRequest pageSize. */ - public pageSize: number; - - /** ListOperationsRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListOperationsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListOperationsRequest instance - */ - public static create(properties?: google.longrunning.IListOperationsRequest): google.longrunning.ListOperationsRequest; - - /** - * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. - * @param message ListOperationsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. - * @param message ListOperationsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListOperationsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListOperationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsRequest; - - /** - * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListOperationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsRequest; - - /** - * Verifies a ListOperationsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListOperationsRequest - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsRequest; - - /** - * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. - * @param message ListOperationsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.ListOperationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListOperationsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListOperationsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListOperationsResponse. */ - interface IListOperationsResponse { - - /** ListOperationsResponse operations */ - operations?: (google.longrunning.IOperation[]|null); - - /** ListOperationsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListOperationsResponse. */ - class ListOperationsResponse implements IListOperationsResponse { - - /** - * Constructs a new ListOperationsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IListOperationsResponse); - - /** ListOperationsResponse operations. */ - public operations: google.longrunning.IOperation[]; - - /** ListOperationsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListOperationsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListOperationsResponse instance - */ - public static create(properties?: google.longrunning.IListOperationsResponse): google.longrunning.ListOperationsResponse; - - /** - * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. - * @param message ListOperationsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. - * @param message ListOperationsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListOperationsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListOperationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsResponse; - - /** - * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListOperationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsResponse; - - /** - * Verifies a ListOperationsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListOperationsResponse - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsResponse; - - /** - * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. - * @param message ListOperationsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.ListOperationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListOperationsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListOperationsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CancelOperationRequest. */ - interface ICancelOperationRequest { - - /** CancelOperationRequest name */ - name?: (string|null); - } - - /** Represents a CancelOperationRequest. */ - class CancelOperationRequest implements ICancelOperationRequest { - - /** - * Constructs a new CancelOperationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.ICancelOperationRequest); - - /** CancelOperationRequest name. */ - public name: string; - - /** - * Creates a new CancelOperationRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CancelOperationRequest instance - */ - public static create(properties?: google.longrunning.ICancelOperationRequest): google.longrunning.CancelOperationRequest; - - /** - * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. - * @param message CancelOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. - * @param message CancelOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CancelOperationRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CancelOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.CancelOperationRequest; - - /** - * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CancelOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.CancelOperationRequest; - - /** - * Verifies a CancelOperationRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CancelOperationRequest - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.CancelOperationRequest; - - /** - * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. - * @param message CancelOperationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.CancelOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CancelOperationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CancelOperationRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteOperationRequest. */ - interface IDeleteOperationRequest { - - /** DeleteOperationRequest name */ - name?: (string|null); - } - - /** Represents a DeleteOperationRequest. */ - class DeleteOperationRequest implements IDeleteOperationRequest { - - /** - * Constructs a new DeleteOperationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IDeleteOperationRequest); - - /** DeleteOperationRequest name. */ - public name: string; - - /** - * Creates a new DeleteOperationRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteOperationRequest instance - */ - public static create(properties?: google.longrunning.IDeleteOperationRequest): google.longrunning.DeleteOperationRequest; - - /** - * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. - * @param message DeleteOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. - * @param message DeleteOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteOperationRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.DeleteOperationRequest; - - /** - * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.DeleteOperationRequest; - - /** - * Verifies a DeleteOperationRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteOperationRequest - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.DeleteOperationRequest; - - /** - * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. - * @param message DeleteOperationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.DeleteOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteOperationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteOperationRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a WaitOperationRequest. */ - interface IWaitOperationRequest { - - /** WaitOperationRequest name */ - name?: (string|null); - - /** WaitOperationRequest timeout */ - timeout?: (google.protobuf.IDuration|null); - } - - /** Represents a WaitOperationRequest. */ - class WaitOperationRequest implements IWaitOperationRequest { - - /** - * Constructs a new WaitOperationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IWaitOperationRequest); - - /** WaitOperationRequest name. */ - public name: string; - - /** WaitOperationRequest timeout. */ - public timeout?: (google.protobuf.IDuration|null); - - /** - * Creates a new WaitOperationRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns WaitOperationRequest instance - */ - public static create(properties?: google.longrunning.IWaitOperationRequest): google.longrunning.WaitOperationRequest; - - /** - * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. - * @param message WaitOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. - * @param message WaitOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a WaitOperationRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns WaitOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.WaitOperationRequest; - - /** - * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns WaitOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.WaitOperationRequest; - - /** - * Verifies a WaitOperationRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns WaitOperationRequest - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.WaitOperationRequest; - - /** - * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. - * @param message WaitOperationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.WaitOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this WaitOperationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for WaitOperationRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an OperationInfo. */ - interface IOperationInfo { - - /** OperationInfo responseType */ - responseType?: (string|null); - - /** OperationInfo metadataType */ - metadataType?: (string|null); - } - - /** Represents an OperationInfo. */ - class OperationInfo implements IOperationInfo { - - /** - * Constructs a new OperationInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IOperationInfo); - - /** OperationInfo responseType. */ - public responseType: string; - - /** OperationInfo metadataType. */ - public metadataType: string; - - /** - * Creates a new OperationInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns OperationInfo instance - */ - public static create(properties?: google.longrunning.IOperationInfo): google.longrunning.OperationInfo; - - /** - * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. - * @param message OperationInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. - * @param message OperationInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OperationInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OperationInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.OperationInfo; - - /** - * Decodes an OperationInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OperationInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.OperationInfo; - - /** - * Verifies an OperationInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OperationInfo - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.OperationInfo; - - /** - * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. - * @param message OperationInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.OperationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OperationInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for OperationInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Namespace rpc. */ - namespace rpc { - - /** Properties of a Status. */ - interface IStatus { - - /** Status code */ - code?: (number|null); - - /** Status message */ - message?: (string|null); - - /** Status details */ - details?: (google.protobuf.IAny[]|null); - } - - /** Represents a Status. */ - class Status implements IStatus { - - /** - * Constructs a new Status. - * @param [properties] Properties to set - */ - constructor(properties?: google.rpc.IStatus); - - /** Status code. */ - public code: number; - - /** Status message. */ - public message: string; - - /** Status details. */ - public details: google.protobuf.IAny[]; - - /** - * Creates a new Status instance using the specified properties. - * @param [properties] Properties to set - * @returns Status instance - */ - public static create(properties?: google.rpc.IStatus): google.rpc.Status; - - /** - * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. - * @param message Status message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. - * @param message Status message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Status message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Status - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.rpc.Status; - - /** - * Decodes a Status message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Status - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.rpc.Status; - - /** - * Verifies a Status message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Status message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Status - */ - public static fromObject(object: { [k: string]: any }): google.rpc.Status; - - /** - * Creates a plain object from a Status message. Also converts values to other types if specified. - * @param message Status - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.rpc.Status, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Status to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Status - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } -} diff --git a/owl-bot-staging/admin/instance/v1/protos/protos.js b/owl-bot-staging/admin/instance/v1/protos/protos.js deleted file mode 100644 index 06d864f7a..000000000 --- a/owl-bot-staging/admin/instance/v1/protos/protos.js +++ /dev/null @@ -1,38901 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ -(function(global, factory) { /* global define, require, module */ - - /* AMD */ if (typeof define === 'function' && define.amd) - define(["protobufjs/minimal"], factory); - - /* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports) - module.exports = factory(require("google-gax/build/src/protobuf").protobufMinimal); - -})(this, function($protobuf) { - "use strict"; - - // Common aliases - var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; - - // Exported root namespace - var $root = $protobuf.roots._google_cloud_spanner_protos || ($protobuf.roots._google_cloud_spanner_protos = {}); - - $root.google = (function() { - - /** - * Namespace google. - * @exports google - * @namespace - */ - var google = {}; - - google.spanner = (function() { - - /** - * Namespace spanner. - * @memberof google - * @namespace - */ - var spanner = {}; - - spanner.admin = (function() { - - /** - * Namespace admin. - * @memberof google.spanner - * @namespace - */ - var admin = {}; - - admin.instance = (function() { - - /** - * Namespace instance. - * @memberof google.spanner.admin - * @namespace - */ - var instance = {}; - - instance.v1 = (function() { - - /** - * Namespace v1. - * @memberof google.spanner.admin.instance - * @namespace - */ - var v1 = {}; - - v1.OperationProgress = (function() { - - /** - * Properties of an OperationProgress. - * @memberof google.spanner.admin.instance.v1 - * @interface IOperationProgress - * @property {number|null} [progressPercent] OperationProgress progressPercent - * @property {google.protobuf.ITimestamp|null} [startTime] OperationProgress startTime - * @property {google.protobuf.ITimestamp|null} [endTime] OperationProgress endTime - */ - - /** - * Constructs a new OperationProgress. - * @memberof google.spanner.admin.instance.v1 - * @classdesc Represents an OperationProgress. - * @implements IOperationProgress - * @constructor - * @param {google.spanner.admin.instance.v1.IOperationProgress=} [properties] Properties to set - */ - function OperationProgress(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * OperationProgress progressPercent. - * @member {number} progressPercent - * @memberof google.spanner.admin.instance.v1.OperationProgress - * @instance - */ - OperationProgress.prototype.progressPercent = 0; - - /** - * OperationProgress startTime. - * @member {google.protobuf.ITimestamp|null|undefined} startTime - * @memberof google.spanner.admin.instance.v1.OperationProgress - * @instance - */ - OperationProgress.prototype.startTime = null; - - /** - * OperationProgress endTime. - * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.spanner.admin.instance.v1.OperationProgress - * @instance - */ - OperationProgress.prototype.endTime = null; - - /** - * Creates a new OperationProgress instance using the specified properties. - * @function create - * @memberof google.spanner.admin.instance.v1.OperationProgress - * @static - * @param {google.spanner.admin.instance.v1.IOperationProgress=} [properties] Properties to set - * @returns {google.spanner.admin.instance.v1.OperationProgress} OperationProgress instance - */ - OperationProgress.create = function create(properties) { - return new OperationProgress(properties); - }; - - /** - * Encodes the specified OperationProgress message. Does not implicitly {@link google.spanner.admin.instance.v1.OperationProgress.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.instance.v1.OperationProgress - * @static - * @param {google.spanner.admin.instance.v1.IOperationProgress} message OperationProgress message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OperationProgress.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.progressPercent != null && Object.hasOwnProperty.call(message, "progressPercent")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.progressPercent); - if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) - $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) - $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified OperationProgress message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.OperationProgress.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.instance.v1.OperationProgress - * @static - * @param {google.spanner.admin.instance.v1.IOperationProgress} message OperationProgress message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OperationProgress.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OperationProgress message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.instance.v1.OperationProgress - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.instance.v1.OperationProgress} OperationProgress - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OperationProgress.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.OperationProgress(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.progressPercent = reader.int32(); - break; - } - case 2: { - message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 3: { - message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OperationProgress message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.instance.v1.OperationProgress - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.instance.v1.OperationProgress} OperationProgress - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OperationProgress.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OperationProgress message. - * @function verify - * @memberof google.spanner.admin.instance.v1.OperationProgress - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OperationProgress.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.progressPercent != null && message.hasOwnProperty("progressPercent")) - if (!$util.isInteger(message.progressPercent)) - return "progressPercent: integer expected"; - if (message.startTime != null && message.hasOwnProperty("startTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.startTime); - if (error) - return "startTime." + error; - } - if (message.endTime != null && message.hasOwnProperty("endTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.endTime); - if (error) - return "endTime." + error; - } - return null; - }; - - /** - * Creates an OperationProgress message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.instance.v1.OperationProgress - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.instance.v1.OperationProgress} OperationProgress - */ - OperationProgress.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.instance.v1.OperationProgress) - return object; - var message = new $root.google.spanner.admin.instance.v1.OperationProgress(); - if (object.progressPercent != null) - message.progressPercent = object.progressPercent | 0; - if (object.startTime != null) { - if (typeof object.startTime !== "object") - throw TypeError(".google.spanner.admin.instance.v1.OperationProgress.startTime: object expected"); - message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); - } - if (object.endTime != null) { - if (typeof object.endTime !== "object") - throw TypeError(".google.spanner.admin.instance.v1.OperationProgress.endTime: object expected"); - message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); - } - return message; - }; - - /** - * Creates a plain object from an OperationProgress message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.instance.v1.OperationProgress - * @static - * @param {google.spanner.admin.instance.v1.OperationProgress} message OperationProgress - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OperationProgress.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.progressPercent = 0; - object.startTime = null; - object.endTime = null; - } - if (message.progressPercent != null && message.hasOwnProperty("progressPercent")) - object.progressPercent = message.progressPercent; - if (message.startTime != null && message.hasOwnProperty("startTime")) - object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); - if (message.endTime != null && message.hasOwnProperty("endTime")) - object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); - return object; - }; - - /** - * Converts this OperationProgress to JSON. - * @function toJSON - * @memberof google.spanner.admin.instance.v1.OperationProgress - * @instance - * @returns {Object.} JSON object - */ - OperationProgress.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OperationProgress - * @function getTypeUrl - * @memberof google.spanner.admin.instance.v1.OperationProgress - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OperationProgress.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.instance.v1.OperationProgress"; - }; - - return OperationProgress; - })(); - - /** - * FulfillmentPeriod enum. - * @name google.spanner.admin.instance.v1.FulfillmentPeriod - * @enum {number} - * @property {number} FULFILLMENT_PERIOD_UNSPECIFIED=0 FULFILLMENT_PERIOD_UNSPECIFIED value - * @property {number} FULFILLMENT_PERIOD_NORMAL=1 FULFILLMENT_PERIOD_NORMAL value - * @property {number} FULFILLMENT_PERIOD_EXTENDED=2 FULFILLMENT_PERIOD_EXTENDED value - */ - v1.FulfillmentPeriod = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "FULFILLMENT_PERIOD_UNSPECIFIED"] = 0; - values[valuesById[1] = "FULFILLMENT_PERIOD_NORMAL"] = 1; - values[valuesById[2] = "FULFILLMENT_PERIOD_EXTENDED"] = 2; - return values; - })(); - - v1.ReplicaSelection = (function() { - - /** - * Properties of a ReplicaSelection. - * @memberof google.spanner.admin.instance.v1 - * @interface IReplicaSelection - * @property {string|null} [location] ReplicaSelection location - */ - - /** - * Constructs a new ReplicaSelection. - * @memberof google.spanner.admin.instance.v1 - * @classdesc Represents a ReplicaSelection. - * @implements IReplicaSelection - * @constructor - * @param {google.spanner.admin.instance.v1.IReplicaSelection=} [properties] Properties to set - */ - function ReplicaSelection(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ReplicaSelection location. - * @member {string} location - * @memberof google.spanner.admin.instance.v1.ReplicaSelection - * @instance - */ - ReplicaSelection.prototype.location = ""; - - /** - * Creates a new ReplicaSelection instance using the specified properties. - * @function create - * @memberof google.spanner.admin.instance.v1.ReplicaSelection - * @static - * @param {google.spanner.admin.instance.v1.IReplicaSelection=} [properties] Properties to set - * @returns {google.spanner.admin.instance.v1.ReplicaSelection} ReplicaSelection instance - */ - ReplicaSelection.create = function create(properties) { - return new ReplicaSelection(properties); - }; - - /** - * Encodes the specified ReplicaSelection message. Does not implicitly {@link google.spanner.admin.instance.v1.ReplicaSelection.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.instance.v1.ReplicaSelection - * @static - * @param {google.spanner.admin.instance.v1.IReplicaSelection} message ReplicaSelection message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReplicaSelection.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.location != null && Object.hasOwnProperty.call(message, "location")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.location); - return writer; - }; - - /** - * Encodes the specified ReplicaSelection message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ReplicaSelection.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.instance.v1.ReplicaSelection - * @static - * @param {google.spanner.admin.instance.v1.IReplicaSelection} message ReplicaSelection message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReplicaSelection.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ReplicaSelection message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.instance.v1.ReplicaSelection - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.instance.v1.ReplicaSelection} ReplicaSelection - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReplicaSelection.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.ReplicaSelection(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.location = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ReplicaSelection message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.instance.v1.ReplicaSelection - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.instance.v1.ReplicaSelection} ReplicaSelection - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReplicaSelection.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ReplicaSelection message. - * @function verify - * @memberof google.spanner.admin.instance.v1.ReplicaSelection - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ReplicaSelection.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.location != null && message.hasOwnProperty("location")) - if (!$util.isString(message.location)) - return "location: string expected"; - return null; - }; - - /** - * Creates a ReplicaSelection message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.instance.v1.ReplicaSelection - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.instance.v1.ReplicaSelection} ReplicaSelection - */ - ReplicaSelection.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.instance.v1.ReplicaSelection) - return object; - var message = new $root.google.spanner.admin.instance.v1.ReplicaSelection(); - if (object.location != null) - message.location = String(object.location); - return message; - }; - - /** - * Creates a plain object from a ReplicaSelection message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.instance.v1.ReplicaSelection - * @static - * @param {google.spanner.admin.instance.v1.ReplicaSelection} message ReplicaSelection - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ReplicaSelection.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.location = ""; - if (message.location != null && message.hasOwnProperty("location")) - object.location = message.location; - return object; - }; - - /** - * Converts this ReplicaSelection to JSON. - * @function toJSON - * @memberof google.spanner.admin.instance.v1.ReplicaSelection - * @instance - * @returns {Object.} JSON object - */ - ReplicaSelection.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ReplicaSelection - * @function getTypeUrl - * @memberof google.spanner.admin.instance.v1.ReplicaSelection - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ReplicaSelection.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.instance.v1.ReplicaSelection"; - }; - - return ReplicaSelection; - })(); - - v1.InstanceAdmin = (function() { - - /** - * Constructs a new InstanceAdmin service. - * @memberof google.spanner.admin.instance.v1 - * @classdesc Represents an InstanceAdmin - * @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 InstanceAdmin(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (InstanceAdmin.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = InstanceAdmin; - - /** - * Creates new InstanceAdmin service using the specified rpc implementation. - * @function create - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @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 {InstanceAdmin} RPC service. Useful where requests and/or responses are streamed. - */ - InstanceAdmin.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|listInstanceConfigs}. - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @typedef ListInstanceConfigsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.spanner.admin.instance.v1.ListInstanceConfigsResponse} [response] ListInstanceConfigsResponse - */ - - /** - * Calls ListInstanceConfigs. - * @function listInstanceConfigs - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @instance - * @param {google.spanner.admin.instance.v1.IListInstanceConfigsRequest} request ListInstanceConfigsRequest message or plain object - * @param {google.spanner.admin.instance.v1.InstanceAdmin.ListInstanceConfigsCallback} callback Node-style callback called with the error, if any, and ListInstanceConfigsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(InstanceAdmin.prototype.listInstanceConfigs = function listInstanceConfigs(request, callback) { - return this.rpcCall(listInstanceConfigs, $root.google.spanner.admin.instance.v1.ListInstanceConfigsRequest, $root.google.spanner.admin.instance.v1.ListInstanceConfigsResponse, request, callback); - }, "name", { value: "ListInstanceConfigs" }); - - /** - * Calls ListInstanceConfigs. - * @function listInstanceConfigs - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @instance - * @param {google.spanner.admin.instance.v1.IListInstanceConfigsRequest} request ListInstanceConfigsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|getInstanceConfig}. - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @typedef GetInstanceConfigCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.spanner.admin.instance.v1.InstanceConfig} [response] InstanceConfig - */ - - /** - * Calls GetInstanceConfig. - * @function getInstanceConfig - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @instance - * @param {google.spanner.admin.instance.v1.IGetInstanceConfigRequest} request GetInstanceConfigRequest message or plain object - * @param {google.spanner.admin.instance.v1.InstanceAdmin.GetInstanceConfigCallback} callback Node-style callback called with the error, if any, and InstanceConfig - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(InstanceAdmin.prototype.getInstanceConfig = function getInstanceConfig(request, callback) { - return this.rpcCall(getInstanceConfig, $root.google.spanner.admin.instance.v1.GetInstanceConfigRequest, $root.google.spanner.admin.instance.v1.InstanceConfig, request, callback); - }, "name", { value: "GetInstanceConfig" }); - - /** - * Calls GetInstanceConfig. - * @function getInstanceConfig - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @instance - * @param {google.spanner.admin.instance.v1.IGetInstanceConfigRequest} request GetInstanceConfigRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|createInstanceConfig}. - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @typedef CreateInstanceConfigCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls CreateInstanceConfig. - * @function createInstanceConfig - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @instance - * @param {google.spanner.admin.instance.v1.ICreateInstanceConfigRequest} request CreateInstanceConfigRequest message or plain object - * @param {google.spanner.admin.instance.v1.InstanceAdmin.CreateInstanceConfigCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(InstanceAdmin.prototype.createInstanceConfig = function createInstanceConfig(request, callback) { - return this.rpcCall(createInstanceConfig, $root.google.spanner.admin.instance.v1.CreateInstanceConfigRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "CreateInstanceConfig" }); - - /** - * Calls CreateInstanceConfig. - * @function createInstanceConfig - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @instance - * @param {google.spanner.admin.instance.v1.ICreateInstanceConfigRequest} request CreateInstanceConfigRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|updateInstanceConfig}. - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @typedef UpdateInstanceConfigCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls UpdateInstanceConfig. - * @function updateInstanceConfig - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @instance - * @param {google.spanner.admin.instance.v1.IUpdateInstanceConfigRequest} request UpdateInstanceConfigRequest message or plain object - * @param {google.spanner.admin.instance.v1.InstanceAdmin.UpdateInstanceConfigCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(InstanceAdmin.prototype.updateInstanceConfig = function updateInstanceConfig(request, callback) { - return this.rpcCall(updateInstanceConfig, $root.google.spanner.admin.instance.v1.UpdateInstanceConfigRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "UpdateInstanceConfig" }); - - /** - * Calls UpdateInstanceConfig. - * @function updateInstanceConfig - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @instance - * @param {google.spanner.admin.instance.v1.IUpdateInstanceConfigRequest} request UpdateInstanceConfigRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|deleteInstanceConfig}. - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @typedef DeleteInstanceConfigCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteInstanceConfig. - * @function deleteInstanceConfig - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @instance - * @param {google.spanner.admin.instance.v1.IDeleteInstanceConfigRequest} request DeleteInstanceConfigRequest message or plain object - * @param {google.spanner.admin.instance.v1.InstanceAdmin.DeleteInstanceConfigCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(InstanceAdmin.prototype.deleteInstanceConfig = function deleteInstanceConfig(request, callback) { - return this.rpcCall(deleteInstanceConfig, $root.google.spanner.admin.instance.v1.DeleteInstanceConfigRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteInstanceConfig" }); - - /** - * Calls DeleteInstanceConfig. - * @function deleteInstanceConfig - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @instance - * @param {google.spanner.admin.instance.v1.IDeleteInstanceConfigRequest} request DeleteInstanceConfigRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|listInstanceConfigOperations}. - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @typedef ListInstanceConfigOperationsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse} [response] ListInstanceConfigOperationsResponse - */ - - /** - * Calls ListInstanceConfigOperations. - * @function listInstanceConfigOperations - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @instance - * @param {google.spanner.admin.instance.v1.IListInstanceConfigOperationsRequest} request ListInstanceConfigOperationsRequest message or plain object - * @param {google.spanner.admin.instance.v1.InstanceAdmin.ListInstanceConfigOperationsCallback} callback Node-style callback called with the error, if any, and ListInstanceConfigOperationsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(InstanceAdmin.prototype.listInstanceConfigOperations = function listInstanceConfigOperations(request, callback) { - return this.rpcCall(listInstanceConfigOperations, $root.google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest, $root.google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse, request, callback); - }, "name", { value: "ListInstanceConfigOperations" }); - - /** - * Calls ListInstanceConfigOperations. - * @function listInstanceConfigOperations - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @instance - * @param {google.spanner.admin.instance.v1.IListInstanceConfigOperationsRequest} request ListInstanceConfigOperationsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|listInstances}. - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @typedef ListInstancesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.spanner.admin.instance.v1.ListInstancesResponse} [response] ListInstancesResponse - */ - - /** - * Calls ListInstances. - * @function listInstances - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @instance - * @param {google.spanner.admin.instance.v1.IListInstancesRequest} request ListInstancesRequest message or plain object - * @param {google.spanner.admin.instance.v1.InstanceAdmin.ListInstancesCallback} callback Node-style callback called with the error, if any, and ListInstancesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(InstanceAdmin.prototype.listInstances = function listInstances(request, callback) { - return this.rpcCall(listInstances, $root.google.spanner.admin.instance.v1.ListInstancesRequest, $root.google.spanner.admin.instance.v1.ListInstancesResponse, request, callback); - }, "name", { value: "ListInstances" }); - - /** - * Calls ListInstances. - * @function listInstances - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @instance - * @param {google.spanner.admin.instance.v1.IListInstancesRequest} request ListInstancesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|listInstancePartitions}. - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @typedef ListInstancePartitionsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.spanner.admin.instance.v1.ListInstancePartitionsResponse} [response] ListInstancePartitionsResponse - */ - - /** - * Calls ListInstancePartitions. - * @function listInstancePartitions - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @instance - * @param {google.spanner.admin.instance.v1.IListInstancePartitionsRequest} request ListInstancePartitionsRequest message or plain object - * @param {google.spanner.admin.instance.v1.InstanceAdmin.ListInstancePartitionsCallback} callback Node-style callback called with the error, if any, and ListInstancePartitionsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(InstanceAdmin.prototype.listInstancePartitions = function listInstancePartitions(request, callback) { - return this.rpcCall(listInstancePartitions, $root.google.spanner.admin.instance.v1.ListInstancePartitionsRequest, $root.google.spanner.admin.instance.v1.ListInstancePartitionsResponse, request, callback); - }, "name", { value: "ListInstancePartitions" }); - - /** - * Calls ListInstancePartitions. - * @function listInstancePartitions - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @instance - * @param {google.spanner.admin.instance.v1.IListInstancePartitionsRequest} request ListInstancePartitionsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|getInstance}. - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @typedef GetInstanceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.spanner.admin.instance.v1.Instance} [response] Instance - */ - - /** - * Calls GetInstance. - * @function getInstance - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @instance - * @param {google.spanner.admin.instance.v1.IGetInstanceRequest} request GetInstanceRequest message or plain object - * @param {google.spanner.admin.instance.v1.InstanceAdmin.GetInstanceCallback} callback Node-style callback called with the error, if any, and Instance - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(InstanceAdmin.prototype.getInstance = function getInstance(request, callback) { - return this.rpcCall(getInstance, $root.google.spanner.admin.instance.v1.GetInstanceRequest, $root.google.spanner.admin.instance.v1.Instance, request, callback); - }, "name", { value: "GetInstance" }); - - /** - * Calls GetInstance. - * @function getInstance - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @instance - * @param {google.spanner.admin.instance.v1.IGetInstanceRequest} request GetInstanceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|createInstance}. - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @typedef CreateInstanceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls CreateInstance. - * @function createInstance - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @instance - * @param {google.spanner.admin.instance.v1.ICreateInstanceRequest} request CreateInstanceRequest message or plain object - * @param {google.spanner.admin.instance.v1.InstanceAdmin.CreateInstanceCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(InstanceAdmin.prototype.createInstance = function createInstance(request, callback) { - return this.rpcCall(createInstance, $root.google.spanner.admin.instance.v1.CreateInstanceRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "CreateInstance" }); - - /** - * Calls CreateInstance. - * @function createInstance - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @instance - * @param {google.spanner.admin.instance.v1.ICreateInstanceRequest} request CreateInstanceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|updateInstance}. - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @typedef UpdateInstanceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls UpdateInstance. - * @function updateInstance - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @instance - * @param {google.spanner.admin.instance.v1.IUpdateInstanceRequest} request UpdateInstanceRequest message or plain object - * @param {google.spanner.admin.instance.v1.InstanceAdmin.UpdateInstanceCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(InstanceAdmin.prototype.updateInstance = function updateInstance(request, callback) { - return this.rpcCall(updateInstance, $root.google.spanner.admin.instance.v1.UpdateInstanceRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "UpdateInstance" }); - - /** - * Calls UpdateInstance. - * @function updateInstance - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @instance - * @param {google.spanner.admin.instance.v1.IUpdateInstanceRequest} request UpdateInstanceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|deleteInstance}. - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @typedef DeleteInstanceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteInstance. - * @function deleteInstance - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @instance - * @param {google.spanner.admin.instance.v1.IDeleteInstanceRequest} request DeleteInstanceRequest message or plain object - * @param {google.spanner.admin.instance.v1.InstanceAdmin.DeleteInstanceCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(InstanceAdmin.prototype.deleteInstance = function deleteInstance(request, callback) { - return this.rpcCall(deleteInstance, $root.google.spanner.admin.instance.v1.DeleteInstanceRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteInstance" }); - - /** - * Calls DeleteInstance. - * @function deleteInstance - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @instance - * @param {google.spanner.admin.instance.v1.IDeleteInstanceRequest} request DeleteInstanceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|setIamPolicy}. - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @typedef SetIamPolicyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.iam.v1.Policy} [response] Policy - */ - - /** - * Calls SetIamPolicy. - * @function setIamPolicy - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @instance - * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object - * @param {google.spanner.admin.instance.v1.InstanceAdmin.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(InstanceAdmin.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.spanner.admin.instance.v1.InstanceAdmin - * @instance - * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|getIamPolicy}. - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @typedef GetIamPolicyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.iam.v1.Policy} [response] Policy - */ - - /** - * Calls GetIamPolicy. - * @function getIamPolicy - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @instance - * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object - * @param {google.spanner.admin.instance.v1.InstanceAdmin.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(InstanceAdmin.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.spanner.admin.instance.v1.InstanceAdmin - * @instance - * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|testIamPermissions}. - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @typedef TestIamPermissionsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.iam.v1.TestIamPermissionsResponse} [response] TestIamPermissionsResponse - */ - - /** - * Calls TestIamPermissions. - * @function testIamPermissions - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @instance - * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object - * @param {google.spanner.admin.instance.v1.InstanceAdmin.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestIamPermissionsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(InstanceAdmin.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.spanner.admin.instance.v1.InstanceAdmin - * @instance - * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|getInstancePartition}. - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @typedef GetInstancePartitionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.spanner.admin.instance.v1.InstancePartition} [response] InstancePartition - */ - - /** - * Calls GetInstancePartition. - * @function getInstancePartition - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @instance - * @param {google.spanner.admin.instance.v1.IGetInstancePartitionRequest} request GetInstancePartitionRequest message or plain object - * @param {google.spanner.admin.instance.v1.InstanceAdmin.GetInstancePartitionCallback} callback Node-style callback called with the error, if any, and InstancePartition - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(InstanceAdmin.prototype.getInstancePartition = function getInstancePartition(request, callback) { - return this.rpcCall(getInstancePartition, $root.google.spanner.admin.instance.v1.GetInstancePartitionRequest, $root.google.spanner.admin.instance.v1.InstancePartition, request, callback); - }, "name", { value: "GetInstancePartition" }); - - /** - * Calls GetInstancePartition. - * @function getInstancePartition - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @instance - * @param {google.spanner.admin.instance.v1.IGetInstancePartitionRequest} request GetInstancePartitionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|createInstancePartition}. - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @typedef CreateInstancePartitionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls CreateInstancePartition. - * @function createInstancePartition - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @instance - * @param {google.spanner.admin.instance.v1.ICreateInstancePartitionRequest} request CreateInstancePartitionRequest message or plain object - * @param {google.spanner.admin.instance.v1.InstanceAdmin.CreateInstancePartitionCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(InstanceAdmin.prototype.createInstancePartition = function createInstancePartition(request, callback) { - return this.rpcCall(createInstancePartition, $root.google.spanner.admin.instance.v1.CreateInstancePartitionRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "CreateInstancePartition" }); - - /** - * Calls CreateInstancePartition. - * @function createInstancePartition - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @instance - * @param {google.spanner.admin.instance.v1.ICreateInstancePartitionRequest} request CreateInstancePartitionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|deleteInstancePartition}. - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @typedef DeleteInstancePartitionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteInstancePartition. - * @function deleteInstancePartition - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @instance - * @param {google.spanner.admin.instance.v1.IDeleteInstancePartitionRequest} request DeleteInstancePartitionRequest message or plain object - * @param {google.spanner.admin.instance.v1.InstanceAdmin.DeleteInstancePartitionCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(InstanceAdmin.prototype.deleteInstancePartition = function deleteInstancePartition(request, callback) { - return this.rpcCall(deleteInstancePartition, $root.google.spanner.admin.instance.v1.DeleteInstancePartitionRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteInstancePartition" }); - - /** - * Calls DeleteInstancePartition. - * @function deleteInstancePartition - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @instance - * @param {google.spanner.admin.instance.v1.IDeleteInstancePartitionRequest} request DeleteInstancePartitionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|updateInstancePartition}. - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @typedef UpdateInstancePartitionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls UpdateInstancePartition. - * @function updateInstancePartition - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @instance - * @param {google.spanner.admin.instance.v1.IUpdateInstancePartitionRequest} request UpdateInstancePartitionRequest message or plain object - * @param {google.spanner.admin.instance.v1.InstanceAdmin.UpdateInstancePartitionCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(InstanceAdmin.prototype.updateInstancePartition = function updateInstancePartition(request, callback) { - return this.rpcCall(updateInstancePartition, $root.google.spanner.admin.instance.v1.UpdateInstancePartitionRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "UpdateInstancePartition" }); - - /** - * Calls UpdateInstancePartition. - * @function updateInstancePartition - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @instance - * @param {google.spanner.admin.instance.v1.IUpdateInstancePartitionRequest} request UpdateInstancePartitionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|listInstancePartitionOperations}. - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @typedef ListInstancePartitionOperationsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse} [response] ListInstancePartitionOperationsResponse - */ - - /** - * Calls ListInstancePartitionOperations. - * @function listInstancePartitionOperations - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @instance - * @param {google.spanner.admin.instance.v1.IListInstancePartitionOperationsRequest} request ListInstancePartitionOperationsRequest message or plain object - * @param {google.spanner.admin.instance.v1.InstanceAdmin.ListInstancePartitionOperationsCallback} callback Node-style callback called with the error, if any, and ListInstancePartitionOperationsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(InstanceAdmin.prototype.listInstancePartitionOperations = function listInstancePartitionOperations(request, callback) { - return this.rpcCall(listInstancePartitionOperations, $root.google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest, $root.google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse, request, callback); - }, "name", { value: "ListInstancePartitionOperations" }); - - /** - * Calls ListInstancePartitionOperations. - * @function listInstancePartitionOperations - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @instance - * @param {google.spanner.admin.instance.v1.IListInstancePartitionOperationsRequest} request ListInstancePartitionOperationsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|moveInstance}. - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @typedef MoveInstanceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls MoveInstance. - * @function moveInstance - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @instance - * @param {google.spanner.admin.instance.v1.IMoveInstanceRequest} request MoveInstanceRequest message or plain object - * @param {google.spanner.admin.instance.v1.InstanceAdmin.MoveInstanceCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(InstanceAdmin.prototype.moveInstance = function moveInstance(request, callback) { - return this.rpcCall(moveInstance, $root.google.spanner.admin.instance.v1.MoveInstanceRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "MoveInstance" }); - - /** - * Calls MoveInstance. - * @function moveInstance - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @instance - * @param {google.spanner.admin.instance.v1.IMoveInstanceRequest} request MoveInstanceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return InstanceAdmin; - })(); - - v1.ReplicaInfo = (function() { - - /** - * Properties of a ReplicaInfo. - * @memberof google.spanner.admin.instance.v1 - * @interface IReplicaInfo - * @property {string|null} [location] ReplicaInfo location - * @property {google.spanner.admin.instance.v1.ReplicaInfo.ReplicaType|null} [type] ReplicaInfo type - * @property {boolean|null} [defaultLeaderLocation] ReplicaInfo defaultLeaderLocation - */ - - /** - * Constructs a new ReplicaInfo. - * @memberof google.spanner.admin.instance.v1 - * @classdesc Represents a ReplicaInfo. - * @implements IReplicaInfo - * @constructor - * @param {google.spanner.admin.instance.v1.IReplicaInfo=} [properties] Properties to set - */ - function ReplicaInfo(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ReplicaInfo location. - * @member {string} location - * @memberof google.spanner.admin.instance.v1.ReplicaInfo - * @instance - */ - ReplicaInfo.prototype.location = ""; - - /** - * ReplicaInfo type. - * @member {google.spanner.admin.instance.v1.ReplicaInfo.ReplicaType} type - * @memberof google.spanner.admin.instance.v1.ReplicaInfo - * @instance - */ - ReplicaInfo.prototype.type = 0; - - /** - * ReplicaInfo defaultLeaderLocation. - * @member {boolean} defaultLeaderLocation - * @memberof google.spanner.admin.instance.v1.ReplicaInfo - * @instance - */ - ReplicaInfo.prototype.defaultLeaderLocation = false; - - /** - * Creates a new ReplicaInfo instance using the specified properties. - * @function create - * @memberof google.spanner.admin.instance.v1.ReplicaInfo - * @static - * @param {google.spanner.admin.instance.v1.IReplicaInfo=} [properties] Properties to set - * @returns {google.spanner.admin.instance.v1.ReplicaInfo} ReplicaInfo instance - */ - ReplicaInfo.create = function create(properties) { - return new ReplicaInfo(properties); - }; - - /** - * Encodes the specified ReplicaInfo message. Does not implicitly {@link google.spanner.admin.instance.v1.ReplicaInfo.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.instance.v1.ReplicaInfo - * @static - * @param {google.spanner.admin.instance.v1.IReplicaInfo} message ReplicaInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReplicaInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.location != null && Object.hasOwnProperty.call(message, "location")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.location); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.type); - if (message.defaultLeaderLocation != null && Object.hasOwnProperty.call(message, "defaultLeaderLocation")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.defaultLeaderLocation); - return writer; - }; - - /** - * Encodes the specified ReplicaInfo message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ReplicaInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.instance.v1.ReplicaInfo - * @static - * @param {google.spanner.admin.instance.v1.IReplicaInfo} message ReplicaInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReplicaInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ReplicaInfo message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.instance.v1.ReplicaInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.instance.v1.ReplicaInfo} ReplicaInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReplicaInfo.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.ReplicaInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.location = reader.string(); - break; - } - case 2: { - message.type = reader.int32(); - break; - } - case 3: { - message.defaultLeaderLocation = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ReplicaInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.instance.v1.ReplicaInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.instance.v1.ReplicaInfo} ReplicaInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReplicaInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ReplicaInfo message. - * @function verify - * @memberof google.spanner.admin.instance.v1.ReplicaInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ReplicaInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.location != null && message.hasOwnProperty("location")) - if (!$util.isString(message.location)) - return "location: string expected"; - if (message.type != null && message.hasOwnProperty("type")) - switch (message.type) { - default: - return "type: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.defaultLeaderLocation != null && message.hasOwnProperty("defaultLeaderLocation")) - if (typeof message.defaultLeaderLocation !== "boolean") - return "defaultLeaderLocation: boolean expected"; - return null; - }; - - /** - * Creates a ReplicaInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.instance.v1.ReplicaInfo - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.instance.v1.ReplicaInfo} ReplicaInfo - */ - ReplicaInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.instance.v1.ReplicaInfo) - return object; - var message = new $root.google.spanner.admin.instance.v1.ReplicaInfo(); - if (object.location != null) - message.location = String(object.location); - switch (object.type) { - default: - if (typeof object.type === "number") { - message.type = object.type; - break; - } - break; - case "TYPE_UNSPECIFIED": - case 0: - message.type = 0; - break; - case "READ_WRITE": - case 1: - message.type = 1; - break; - case "READ_ONLY": - case 2: - message.type = 2; - break; - case "WITNESS": - case 3: - message.type = 3; - break; - } - if (object.defaultLeaderLocation != null) - message.defaultLeaderLocation = Boolean(object.defaultLeaderLocation); - return message; - }; - - /** - * Creates a plain object from a ReplicaInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.instance.v1.ReplicaInfo - * @static - * @param {google.spanner.admin.instance.v1.ReplicaInfo} message ReplicaInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ReplicaInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.location = ""; - object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; - object.defaultLeaderLocation = false; - } - if (message.location != null && message.hasOwnProperty("location")) - object.location = message.location; - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.spanner.admin.instance.v1.ReplicaInfo.ReplicaType[message.type] === undefined ? message.type : $root.google.spanner.admin.instance.v1.ReplicaInfo.ReplicaType[message.type] : message.type; - if (message.defaultLeaderLocation != null && message.hasOwnProperty("defaultLeaderLocation")) - object.defaultLeaderLocation = message.defaultLeaderLocation; - return object; - }; - - /** - * Converts this ReplicaInfo to JSON. - * @function toJSON - * @memberof google.spanner.admin.instance.v1.ReplicaInfo - * @instance - * @returns {Object.} JSON object - */ - ReplicaInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ReplicaInfo - * @function getTypeUrl - * @memberof google.spanner.admin.instance.v1.ReplicaInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ReplicaInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.instance.v1.ReplicaInfo"; - }; - - /** - * ReplicaType enum. - * @name google.spanner.admin.instance.v1.ReplicaInfo.ReplicaType - * @enum {number} - * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value - * @property {number} READ_WRITE=1 READ_WRITE value - * @property {number} READ_ONLY=2 READ_ONLY value - * @property {number} WITNESS=3 WITNESS value - */ - ReplicaInfo.ReplicaType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "READ_WRITE"] = 1; - values[valuesById[2] = "READ_ONLY"] = 2; - values[valuesById[3] = "WITNESS"] = 3; - return values; - })(); - - return ReplicaInfo; - })(); - - v1.InstanceConfig = (function() { - - /** - * Properties of an InstanceConfig. - * @memberof google.spanner.admin.instance.v1 - * @interface IInstanceConfig - * @property {string|null} [name] InstanceConfig name - * @property {string|null} [displayName] InstanceConfig displayName - * @property {google.spanner.admin.instance.v1.InstanceConfig.Type|null} [configType] InstanceConfig configType - * @property {Array.|null} [replicas] InstanceConfig replicas - * @property {Array.|null} [optionalReplicas] InstanceConfig optionalReplicas - * @property {string|null} [baseConfig] InstanceConfig baseConfig - * @property {Object.|null} [labels] InstanceConfig labels - * @property {string|null} [etag] InstanceConfig etag - * @property {Array.|null} [leaderOptions] InstanceConfig leaderOptions - * @property {boolean|null} [reconciling] InstanceConfig reconciling - * @property {google.spanner.admin.instance.v1.InstanceConfig.State|null} [state] InstanceConfig state - * @property {google.spanner.admin.instance.v1.InstanceConfig.FreeInstanceAvailability|null} [freeInstanceAvailability] InstanceConfig freeInstanceAvailability - * @property {google.spanner.admin.instance.v1.InstanceConfig.QuorumType|null} [quorumType] InstanceConfig quorumType - * @property {number|Long|null} [storageLimitPerProcessingUnit] InstanceConfig storageLimitPerProcessingUnit - */ - - /** - * Constructs a new InstanceConfig. - * @memberof google.spanner.admin.instance.v1 - * @classdesc Represents an InstanceConfig. - * @implements IInstanceConfig - * @constructor - * @param {google.spanner.admin.instance.v1.IInstanceConfig=} [properties] Properties to set - */ - function InstanceConfig(properties) { - this.replicas = []; - this.optionalReplicas = []; - this.labels = {}; - this.leaderOptions = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * InstanceConfig name. - * @member {string} name - * @memberof google.spanner.admin.instance.v1.InstanceConfig - * @instance - */ - InstanceConfig.prototype.name = ""; - - /** - * InstanceConfig displayName. - * @member {string} displayName - * @memberof google.spanner.admin.instance.v1.InstanceConfig - * @instance - */ - InstanceConfig.prototype.displayName = ""; - - /** - * InstanceConfig configType. - * @member {google.spanner.admin.instance.v1.InstanceConfig.Type} configType - * @memberof google.spanner.admin.instance.v1.InstanceConfig - * @instance - */ - InstanceConfig.prototype.configType = 0; - - /** - * InstanceConfig replicas. - * @member {Array.} replicas - * @memberof google.spanner.admin.instance.v1.InstanceConfig - * @instance - */ - InstanceConfig.prototype.replicas = $util.emptyArray; - - /** - * InstanceConfig optionalReplicas. - * @member {Array.} optionalReplicas - * @memberof google.spanner.admin.instance.v1.InstanceConfig - * @instance - */ - InstanceConfig.prototype.optionalReplicas = $util.emptyArray; - - /** - * InstanceConfig baseConfig. - * @member {string} baseConfig - * @memberof google.spanner.admin.instance.v1.InstanceConfig - * @instance - */ - InstanceConfig.prototype.baseConfig = ""; - - /** - * InstanceConfig labels. - * @member {Object.} labels - * @memberof google.spanner.admin.instance.v1.InstanceConfig - * @instance - */ - InstanceConfig.prototype.labels = $util.emptyObject; - - /** - * InstanceConfig etag. - * @member {string} etag - * @memberof google.spanner.admin.instance.v1.InstanceConfig - * @instance - */ - InstanceConfig.prototype.etag = ""; - - /** - * InstanceConfig leaderOptions. - * @member {Array.} leaderOptions - * @memberof google.spanner.admin.instance.v1.InstanceConfig - * @instance - */ - InstanceConfig.prototype.leaderOptions = $util.emptyArray; - - /** - * InstanceConfig reconciling. - * @member {boolean} reconciling - * @memberof google.spanner.admin.instance.v1.InstanceConfig - * @instance - */ - InstanceConfig.prototype.reconciling = false; - - /** - * InstanceConfig state. - * @member {google.spanner.admin.instance.v1.InstanceConfig.State} state - * @memberof google.spanner.admin.instance.v1.InstanceConfig - * @instance - */ - InstanceConfig.prototype.state = 0; - - /** - * InstanceConfig freeInstanceAvailability. - * @member {google.spanner.admin.instance.v1.InstanceConfig.FreeInstanceAvailability} freeInstanceAvailability - * @memberof google.spanner.admin.instance.v1.InstanceConfig - * @instance - */ - InstanceConfig.prototype.freeInstanceAvailability = 0; - - /** - * InstanceConfig quorumType. - * @member {google.spanner.admin.instance.v1.InstanceConfig.QuorumType} quorumType - * @memberof google.spanner.admin.instance.v1.InstanceConfig - * @instance - */ - InstanceConfig.prototype.quorumType = 0; - - /** - * InstanceConfig storageLimitPerProcessingUnit. - * @member {number|Long} storageLimitPerProcessingUnit - * @memberof google.spanner.admin.instance.v1.InstanceConfig - * @instance - */ - InstanceConfig.prototype.storageLimitPerProcessingUnit = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Creates a new InstanceConfig instance using the specified properties. - * @function create - * @memberof google.spanner.admin.instance.v1.InstanceConfig - * @static - * @param {google.spanner.admin.instance.v1.IInstanceConfig=} [properties] Properties to set - * @returns {google.spanner.admin.instance.v1.InstanceConfig} InstanceConfig instance - */ - InstanceConfig.create = function create(properties) { - return new InstanceConfig(properties); - }; - - /** - * Encodes the specified InstanceConfig message. Does not implicitly {@link google.spanner.admin.instance.v1.InstanceConfig.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.instance.v1.InstanceConfig - * @static - * @param {google.spanner.admin.instance.v1.IInstanceConfig} message InstanceConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InstanceConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); - if (message.replicas != null && message.replicas.length) - for (var i = 0; i < message.replicas.length; ++i) - $root.google.spanner.admin.instance.v1.ReplicaInfo.encode(message.replicas[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.leaderOptions != null && message.leaderOptions.length) - for (var i = 0; i < message.leaderOptions.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.leaderOptions[i]); - if (message.configType != null && Object.hasOwnProperty.call(message, "configType")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.configType); - if (message.optionalReplicas != null && message.optionalReplicas.length) - for (var i = 0; i < message.optionalReplicas.length; ++i) - $root.google.spanner.admin.instance.v1.ReplicaInfo.encode(message.optionalReplicas[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.baseConfig != null && Object.hasOwnProperty.call(message, "baseConfig")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.baseConfig); - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 8, wireType 2 =*/66).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.etag); - if (message.reconciling != null && Object.hasOwnProperty.call(message, "reconciling")) - writer.uint32(/* id 10, wireType 0 =*/80).bool(message.reconciling); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 11, wireType 0 =*/88).int32(message.state); - if (message.freeInstanceAvailability != null && Object.hasOwnProperty.call(message, "freeInstanceAvailability")) - writer.uint32(/* id 12, wireType 0 =*/96).int32(message.freeInstanceAvailability); - if (message.quorumType != null && Object.hasOwnProperty.call(message, "quorumType")) - writer.uint32(/* id 18, wireType 0 =*/144).int32(message.quorumType); - if (message.storageLimitPerProcessingUnit != null && Object.hasOwnProperty.call(message, "storageLimitPerProcessingUnit")) - writer.uint32(/* id 19, wireType 0 =*/152).int64(message.storageLimitPerProcessingUnit); - return writer; - }; - - /** - * Encodes the specified InstanceConfig message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.InstanceConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.instance.v1.InstanceConfig - * @static - * @param {google.spanner.admin.instance.v1.IInstanceConfig} message InstanceConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InstanceConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an InstanceConfig message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.instance.v1.InstanceConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.instance.v1.InstanceConfig} InstanceConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InstanceConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.InstanceConfig(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.displayName = reader.string(); - break; - } - case 5: { - message.configType = reader.int32(); - break; - } - case 3: { - if (!(message.replicas && message.replicas.length)) - message.replicas = []; - message.replicas.push($root.google.spanner.admin.instance.v1.ReplicaInfo.decode(reader, reader.uint32())); - break; - } - case 6: { - if (!(message.optionalReplicas && message.optionalReplicas.length)) - message.optionalReplicas = []; - message.optionalReplicas.push($root.google.spanner.admin.instance.v1.ReplicaInfo.decode(reader, reader.uint32())); - break; - } - case 7: { - message.baseConfig = reader.string(); - break; - } - case 8: { - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.labels[key] = value; - break; - } - case 9: { - message.etag = reader.string(); - break; - } - case 4: { - if (!(message.leaderOptions && message.leaderOptions.length)) - message.leaderOptions = []; - message.leaderOptions.push(reader.string()); - break; - } - case 10: { - message.reconciling = reader.bool(); - break; - } - case 11: { - message.state = reader.int32(); - break; - } - case 12: { - message.freeInstanceAvailability = reader.int32(); - break; - } - case 18: { - message.quorumType = reader.int32(); - break; - } - case 19: { - message.storageLimitPerProcessingUnit = reader.int64(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an InstanceConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.instance.v1.InstanceConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.instance.v1.InstanceConfig} InstanceConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InstanceConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an InstanceConfig message. - * @function verify - * @memberof google.spanner.admin.instance.v1.InstanceConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - InstanceConfig.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.configType != null && message.hasOwnProperty("configType")) - switch (message.configType) { - default: - return "configType: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.replicas != null && message.hasOwnProperty("replicas")) { - if (!Array.isArray(message.replicas)) - return "replicas: array expected"; - for (var i = 0; i < message.replicas.length; ++i) { - var error = $root.google.spanner.admin.instance.v1.ReplicaInfo.verify(message.replicas[i]); - if (error) - return "replicas." + error; - } - } - if (message.optionalReplicas != null && message.hasOwnProperty("optionalReplicas")) { - if (!Array.isArray(message.optionalReplicas)) - return "optionalReplicas: array expected"; - for (var i = 0; i < message.optionalReplicas.length; ++i) { - var error = $root.google.spanner.admin.instance.v1.ReplicaInfo.verify(message.optionalReplicas[i]); - if (error) - return "optionalReplicas." + error; - } - } - if (message.baseConfig != null && message.hasOwnProperty("baseConfig")) - if (!$util.isString(message.baseConfig)) - return "baseConfig: string expected"; - if (message.labels != null && message.hasOwnProperty("labels")) { - if (!$util.isObject(message.labels)) - return "labels: object expected"; - var key = Object.keys(message.labels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.labels[key[i]])) - return "labels: string{k:string} expected"; - } - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - if (message.leaderOptions != null && message.hasOwnProperty("leaderOptions")) { - if (!Array.isArray(message.leaderOptions)) - return "leaderOptions: array expected"; - for (var i = 0; i < message.leaderOptions.length; ++i) - if (!$util.isString(message.leaderOptions[i])) - return "leaderOptions: string[] expected"; - } - if (message.reconciling != null && message.hasOwnProperty("reconciling")) - if (typeof message.reconciling !== "boolean") - return "reconciling: boolean 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.freeInstanceAvailability != null && message.hasOwnProperty("freeInstanceAvailability")) - switch (message.freeInstanceAvailability) { - default: - return "freeInstanceAvailability: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - if (message.quorumType != null && message.hasOwnProperty("quorumType")) - switch (message.quorumType) { - default: - return "quorumType: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.storageLimitPerProcessingUnit != null && message.hasOwnProperty("storageLimitPerProcessingUnit")) - if (!$util.isInteger(message.storageLimitPerProcessingUnit) && !(message.storageLimitPerProcessingUnit && $util.isInteger(message.storageLimitPerProcessingUnit.low) && $util.isInteger(message.storageLimitPerProcessingUnit.high))) - return "storageLimitPerProcessingUnit: integer|Long expected"; - return null; - }; - - /** - * Creates an InstanceConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.instance.v1.InstanceConfig - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.instance.v1.InstanceConfig} InstanceConfig - */ - InstanceConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.instance.v1.InstanceConfig) - return object; - var message = new $root.google.spanner.admin.instance.v1.InstanceConfig(); - if (object.name != null) - message.name = String(object.name); - if (object.displayName != null) - message.displayName = String(object.displayName); - switch (object.configType) { - default: - if (typeof object.configType === "number") { - message.configType = object.configType; - break; - } - break; - case "TYPE_UNSPECIFIED": - case 0: - message.configType = 0; - break; - case "GOOGLE_MANAGED": - case 1: - message.configType = 1; - break; - case "USER_MANAGED": - case 2: - message.configType = 2; - break; - } - if (object.replicas) { - if (!Array.isArray(object.replicas)) - throw TypeError(".google.spanner.admin.instance.v1.InstanceConfig.replicas: array expected"); - message.replicas = []; - for (var i = 0; i < object.replicas.length; ++i) { - if (typeof object.replicas[i] !== "object") - throw TypeError(".google.spanner.admin.instance.v1.InstanceConfig.replicas: object expected"); - message.replicas[i] = $root.google.spanner.admin.instance.v1.ReplicaInfo.fromObject(object.replicas[i]); - } - } - if (object.optionalReplicas) { - if (!Array.isArray(object.optionalReplicas)) - throw TypeError(".google.spanner.admin.instance.v1.InstanceConfig.optionalReplicas: array expected"); - message.optionalReplicas = []; - for (var i = 0; i < object.optionalReplicas.length; ++i) { - if (typeof object.optionalReplicas[i] !== "object") - throw TypeError(".google.spanner.admin.instance.v1.InstanceConfig.optionalReplicas: object expected"); - message.optionalReplicas[i] = $root.google.spanner.admin.instance.v1.ReplicaInfo.fromObject(object.optionalReplicas[i]); - } - } - if (object.baseConfig != null) - message.baseConfig = String(object.baseConfig); - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.spanner.admin.instance.v1.InstanceConfig.labels: object expected"); - message.labels = {}; - for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) - message.labels[keys[i]] = String(object.labels[keys[i]]); - } - if (object.etag != null) - message.etag = String(object.etag); - if (object.leaderOptions) { - if (!Array.isArray(object.leaderOptions)) - throw TypeError(".google.spanner.admin.instance.v1.InstanceConfig.leaderOptions: array expected"); - message.leaderOptions = []; - for (var i = 0; i < object.leaderOptions.length; ++i) - message.leaderOptions[i] = String(object.leaderOptions[i]); - } - if (object.reconciling != null) - message.reconciling = Boolean(object.reconciling); - switch (object.state) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "CREATING": - case 1: - message.state = 1; - break; - case "READY": - case 2: - message.state = 2; - break; - } - switch (object.freeInstanceAvailability) { - default: - if (typeof object.freeInstanceAvailability === "number") { - message.freeInstanceAvailability = object.freeInstanceAvailability; - break; - } - break; - case "FREE_INSTANCE_AVAILABILITY_UNSPECIFIED": - case 0: - message.freeInstanceAvailability = 0; - break; - case "AVAILABLE": - case 1: - message.freeInstanceAvailability = 1; - break; - case "UNSUPPORTED": - case 2: - message.freeInstanceAvailability = 2; - break; - case "DISABLED": - case 3: - message.freeInstanceAvailability = 3; - break; - case "QUOTA_EXCEEDED": - case 4: - message.freeInstanceAvailability = 4; - break; - } - switch (object.quorumType) { - default: - if (typeof object.quorumType === "number") { - message.quorumType = object.quorumType; - break; - } - break; - case "QUORUM_TYPE_UNSPECIFIED": - case 0: - message.quorumType = 0; - break; - case "REGION": - case 1: - message.quorumType = 1; - break; - case "DUAL_REGION": - case 2: - message.quorumType = 2; - break; - case "MULTI_REGION": - case 3: - message.quorumType = 3; - break; - } - if (object.storageLimitPerProcessingUnit != null) - if ($util.Long) - (message.storageLimitPerProcessingUnit = $util.Long.fromValue(object.storageLimitPerProcessingUnit)).unsigned = false; - else if (typeof object.storageLimitPerProcessingUnit === "string") - message.storageLimitPerProcessingUnit = parseInt(object.storageLimitPerProcessingUnit, 10); - else if (typeof object.storageLimitPerProcessingUnit === "number") - message.storageLimitPerProcessingUnit = object.storageLimitPerProcessingUnit; - else if (typeof object.storageLimitPerProcessingUnit === "object") - message.storageLimitPerProcessingUnit = new $util.LongBits(object.storageLimitPerProcessingUnit.low >>> 0, object.storageLimitPerProcessingUnit.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from an InstanceConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.instance.v1.InstanceConfig - * @static - * @param {google.spanner.admin.instance.v1.InstanceConfig} message InstanceConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - InstanceConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.replicas = []; - object.leaderOptions = []; - object.optionalReplicas = []; - } - if (options.objects || options.defaults) - object.labels = {}; - if (options.defaults) { - object.name = ""; - object.displayName = ""; - object.configType = options.enums === String ? "TYPE_UNSPECIFIED" : 0; - object.baseConfig = ""; - object.etag = ""; - object.reconciling = false; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.freeInstanceAvailability = options.enums === String ? "FREE_INSTANCE_AVAILABILITY_UNSPECIFIED" : 0; - object.quorumType = options.enums === String ? "QUORUM_TYPE_UNSPECIFIED" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.storageLimitPerProcessingUnit = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.storageLimitPerProcessingUnit = options.longs === String ? "0" : 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.replicas && message.replicas.length) { - object.replicas = []; - for (var j = 0; j < message.replicas.length; ++j) - object.replicas[j] = $root.google.spanner.admin.instance.v1.ReplicaInfo.toObject(message.replicas[j], options); - } - if (message.leaderOptions && message.leaderOptions.length) { - object.leaderOptions = []; - for (var j = 0; j < message.leaderOptions.length; ++j) - object.leaderOptions[j] = message.leaderOptions[j]; - } - if (message.configType != null && message.hasOwnProperty("configType")) - object.configType = options.enums === String ? $root.google.spanner.admin.instance.v1.InstanceConfig.Type[message.configType] === undefined ? message.configType : $root.google.spanner.admin.instance.v1.InstanceConfig.Type[message.configType] : message.configType; - if (message.optionalReplicas && message.optionalReplicas.length) { - object.optionalReplicas = []; - for (var j = 0; j < message.optionalReplicas.length; ++j) - object.optionalReplicas[j] = $root.google.spanner.admin.instance.v1.ReplicaInfo.toObject(message.optionalReplicas[j], options); - } - if (message.baseConfig != null && message.hasOwnProperty("baseConfig")) - object.baseConfig = message.baseConfig; - 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.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - if (message.reconciling != null && message.hasOwnProperty("reconciling")) - object.reconciling = message.reconciling; - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.spanner.admin.instance.v1.InstanceConfig.State[message.state] === undefined ? message.state : $root.google.spanner.admin.instance.v1.InstanceConfig.State[message.state] : message.state; - if (message.freeInstanceAvailability != null && message.hasOwnProperty("freeInstanceAvailability")) - object.freeInstanceAvailability = options.enums === String ? $root.google.spanner.admin.instance.v1.InstanceConfig.FreeInstanceAvailability[message.freeInstanceAvailability] === undefined ? message.freeInstanceAvailability : $root.google.spanner.admin.instance.v1.InstanceConfig.FreeInstanceAvailability[message.freeInstanceAvailability] : message.freeInstanceAvailability; - if (message.quorumType != null && message.hasOwnProperty("quorumType")) - object.quorumType = options.enums === String ? $root.google.spanner.admin.instance.v1.InstanceConfig.QuorumType[message.quorumType] === undefined ? message.quorumType : $root.google.spanner.admin.instance.v1.InstanceConfig.QuorumType[message.quorumType] : message.quorumType; - if (message.storageLimitPerProcessingUnit != null && message.hasOwnProperty("storageLimitPerProcessingUnit")) - if (typeof message.storageLimitPerProcessingUnit === "number") - object.storageLimitPerProcessingUnit = options.longs === String ? String(message.storageLimitPerProcessingUnit) : message.storageLimitPerProcessingUnit; - else - object.storageLimitPerProcessingUnit = options.longs === String ? $util.Long.prototype.toString.call(message.storageLimitPerProcessingUnit) : options.longs === Number ? new $util.LongBits(message.storageLimitPerProcessingUnit.low >>> 0, message.storageLimitPerProcessingUnit.high >>> 0).toNumber() : message.storageLimitPerProcessingUnit; - return object; - }; - - /** - * Converts this InstanceConfig to JSON. - * @function toJSON - * @memberof google.spanner.admin.instance.v1.InstanceConfig - * @instance - * @returns {Object.} JSON object - */ - InstanceConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for InstanceConfig - * @function getTypeUrl - * @memberof google.spanner.admin.instance.v1.InstanceConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - InstanceConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.instance.v1.InstanceConfig"; - }; - - /** - * Type enum. - * @name google.spanner.admin.instance.v1.InstanceConfig.Type - * @enum {number} - * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value - * @property {number} GOOGLE_MANAGED=1 GOOGLE_MANAGED value - * @property {number} USER_MANAGED=2 USER_MANAGED value - */ - InstanceConfig.Type = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "GOOGLE_MANAGED"] = 1; - values[valuesById[2] = "USER_MANAGED"] = 2; - return values; - })(); - - /** - * State enum. - * @name google.spanner.admin.instance.v1.InstanceConfig.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} CREATING=1 CREATING value - * @property {number} READY=2 READY value - */ - InstanceConfig.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "CREATING"] = 1; - values[valuesById[2] = "READY"] = 2; - return values; - })(); - - /** - * FreeInstanceAvailability enum. - * @name google.spanner.admin.instance.v1.InstanceConfig.FreeInstanceAvailability - * @enum {number} - * @property {number} FREE_INSTANCE_AVAILABILITY_UNSPECIFIED=0 FREE_INSTANCE_AVAILABILITY_UNSPECIFIED value - * @property {number} AVAILABLE=1 AVAILABLE value - * @property {number} UNSUPPORTED=2 UNSUPPORTED value - * @property {number} DISABLED=3 DISABLED value - * @property {number} QUOTA_EXCEEDED=4 QUOTA_EXCEEDED value - */ - InstanceConfig.FreeInstanceAvailability = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "FREE_INSTANCE_AVAILABILITY_UNSPECIFIED"] = 0; - values[valuesById[1] = "AVAILABLE"] = 1; - values[valuesById[2] = "UNSUPPORTED"] = 2; - values[valuesById[3] = "DISABLED"] = 3; - values[valuesById[4] = "QUOTA_EXCEEDED"] = 4; - return values; - })(); - - /** - * QuorumType enum. - * @name google.spanner.admin.instance.v1.InstanceConfig.QuorumType - * @enum {number} - * @property {number} QUORUM_TYPE_UNSPECIFIED=0 QUORUM_TYPE_UNSPECIFIED value - * @property {number} REGION=1 REGION value - * @property {number} DUAL_REGION=2 DUAL_REGION value - * @property {number} MULTI_REGION=3 MULTI_REGION value - */ - InstanceConfig.QuorumType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "QUORUM_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "REGION"] = 1; - values[valuesById[2] = "DUAL_REGION"] = 2; - values[valuesById[3] = "MULTI_REGION"] = 3; - return values; - })(); - - return InstanceConfig; - })(); - - v1.ReplicaComputeCapacity = (function() { - - /** - * Properties of a ReplicaComputeCapacity. - * @memberof google.spanner.admin.instance.v1 - * @interface IReplicaComputeCapacity - * @property {google.spanner.admin.instance.v1.IReplicaSelection|null} [replicaSelection] ReplicaComputeCapacity replicaSelection - * @property {number|null} [nodeCount] ReplicaComputeCapacity nodeCount - * @property {number|null} [processingUnits] ReplicaComputeCapacity processingUnits - */ - - /** - * Constructs a new ReplicaComputeCapacity. - * @memberof google.spanner.admin.instance.v1 - * @classdesc Represents a ReplicaComputeCapacity. - * @implements IReplicaComputeCapacity - * @constructor - * @param {google.spanner.admin.instance.v1.IReplicaComputeCapacity=} [properties] Properties to set - */ - function ReplicaComputeCapacity(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ReplicaComputeCapacity replicaSelection. - * @member {google.spanner.admin.instance.v1.IReplicaSelection|null|undefined} replicaSelection - * @memberof google.spanner.admin.instance.v1.ReplicaComputeCapacity - * @instance - */ - ReplicaComputeCapacity.prototype.replicaSelection = null; - - /** - * ReplicaComputeCapacity nodeCount. - * @member {number|null|undefined} nodeCount - * @memberof google.spanner.admin.instance.v1.ReplicaComputeCapacity - * @instance - */ - ReplicaComputeCapacity.prototype.nodeCount = null; - - /** - * ReplicaComputeCapacity processingUnits. - * @member {number|null|undefined} processingUnits - * @memberof google.spanner.admin.instance.v1.ReplicaComputeCapacity - * @instance - */ - ReplicaComputeCapacity.prototype.processingUnits = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * ReplicaComputeCapacity computeCapacity. - * @member {"nodeCount"|"processingUnits"|undefined} computeCapacity - * @memberof google.spanner.admin.instance.v1.ReplicaComputeCapacity - * @instance - */ - Object.defineProperty(ReplicaComputeCapacity.prototype, "computeCapacity", { - get: $util.oneOfGetter($oneOfFields = ["nodeCount", "processingUnits"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new ReplicaComputeCapacity instance using the specified properties. - * @function create - * @memberof google.spanner.admin.instance.v1.ReplicaComputeCapacity - * @static - * @param {google.spanner.admin.instance.v1.IReplicaComputeCapacity=} [properties] Properties to set - * @returns {google.spanner.admin.instance.v1.ReplicaComputeCapacity} ReplicaComputeCapacity instance - */ - ReplicaComputeCapacity.create = function create(properties) { - return new ReplicaComputeCapacity(properties); - }; - - /** - * Encodes the specified ReplicaComputeCapacity message. Does not implicitly {@link google.spanner.admin.instance.v1.ReplicaComputeCapacity.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.instance.v1.ReplicaComputeCapacity - * @static - * @param {google.spanner.admin.instance.v1.IReplicaComputeCapacity} message ReplicaComputeCapacity message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReplicaComputeCapacity.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.replicaSelection != null && Object.hasOwnProperty.call(message, "replicaSelection")) - $root.google.spanner.admin.instance.v1.ReplicaSelection.encode(message.replicaSelection, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nodeCount != null && Object.hasOwnProperty.call(message, "nodeCount")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nodeCount); - if (message.processingUnits != null && Object.hasOwnProperty.call(message, "processingUnits")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.processingUnits); - return writer; - }; - - /** - * Encodes the specified ReplicaComputeCapacity message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ReplicaComputeCapacity.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.instance.v1.ReplicaComputeCapacity - * @static - * @param {google.spanner.admin.instance.v1.IReplicaComputeCapacity} message ReplicaComputeCapacity message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReplicaComputeCapacity.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ReplicaComputeCapacity message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.instance.v1.ReplicaComputeCapacity - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.instance.v1.ReplicaComputeCapacity} ReplicaComputeCapacity - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReplicaComputeCapacity.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.ReplicaComputeCapacity(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.replicaSelection = $root.google.spanner.admin.instance.v1.ReplicaSelection.decode(reader, reader.uint32()); - break; - } - case 2: { - message.nodeCount = reader.int32(); - break; - } - case 3: { - message.processingUnits = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ReplicaComputeCapacity message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.instance.v1.ReplicaComputeCapacity - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.instance.v1.ReplicaComputeCapacity} ReplicaComputeCapacity - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReplicaComputeCapacity.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ReplicaComputeCapacity message. - * @function verify - * @memberof google.spanner.admin.instance.v1.ReplicaComputeCapacity - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ReplicaComputeCapacity.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.replicaSelection != null && message.hasOwnProperty("replicaSelection")) { - var error = $root.google.spanner.admin.instance.v1.ReplicaSelection.verify(message.replicaSelection); - if (error) - return "replicaSelection." + error; - } - if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) { - properties.computeCapacity = 1; - if (!$util.isInteger(message.nodeCount)) - return "nodeCount: integer expected"; - } - if (message.processingUnits != null && message.hasOwnProperty("processingUnits")) { - if (properties.computeCapacity === 1) - return "computeCapacity: multiple values"; - properties.computeCapacity = 1; - if (!$util.isInteger(message.processingUnits)) - return "processingUnits: integer expected"; - } - return null; - }; - - /** - * Creates a ReplicaComputeCapacity message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.instance.v1.ReplicaComputeCapacity - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.instance.v1.ReplicaComputeCapacity} ReplicaComputeCapacity - */ - ReplicaComputeCapacity.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.instance.v1.ReplicaComputeCapacity) - return object; - var message = new $root.google.spanner.admin.instance.v1.ReplicaComputeCapacity(); - if (object.replicaSelection != null) { - if (typeof object.replicaSelection !== "object") - throw TypeError(".google.spanner.admin.instance.v1.ReplicaComputeCapacity.replicaSelection: object expected"); - message.replicaSelection = $root.google.spanner.admin.instance.v1.ReplicaSelection.fromObject(object.replicaSelection); - } - if (object.nodeCount != null) - message.nodeCount = object.nodeCount | 0; - if (object.processingUnits != null) - message.processingUnits = object.processingUnits | 0; - return message; - }; - - /** - * Creates a plain object from a ReplicaComputeCapacity message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.instance.v1.ReplicaComputeCapacity - * @static - * @param {google.spanner.admin.instance.v1.ReplicaComputeCapacity} message ReplicaComputeCapacity - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ReplicaComputeCapacity.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.replicaSelection = null; - if (message.replicaSelection != null && message.hasOwnProperty("replicaSelection")) - object.replicaSelection = $root.google.spanner.admin.instance.v1.ReplicaSelection.toObject(message.replicaSelection, options); - if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) { - object.nodeCount = message.nodeCount; - if (options.oneofs) - object.computeCapacity = "nodeCount"; - } - if (message.processingUnits != null && message.hasOwnProperty("processingUnits")) { - object.processingUnits = message.processingUnits; - if (options.oneofs) - object.computeCapacity = "processingUnits"; - } - return object; - }; - - /** - * Converts this ReplicaComputeCapacity to JSON. - * @function toJSON - * @memberof google.spanner.admin.instance.v1.ReplicaComputeCapacity - * @instance - * @returns {Object.} JSON object - */ - ReplicaComputeCapacity.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ReplicaComputeCapacity - * @function getTypeUrl - * @memberof google.spanner.admin.instance.v1.ReplicaComputeCapacity - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ReplicaComputeCapacity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.instance.v1.ReplicaComputeCapacity"; - }; - - return ReplicaComputeCapacity; - })(); - - v1.AutoscalingConfig = (function() { - - /** - * Properties of an AutoscalingConfig. - * @memberof google.spanner.admin.instance.v1 - * @interface IAutoscalingConfig - * @property {google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingLimits|null} [autoscalingLimits] AutoscalingConfig autoscalingLimits - * @property {google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingTargets|null} [autoscalingTargets] AutoscalingConfig autoscalingTargets - * @property {Array.|null} [asymmetricAutoscalingOptions] AutoscalingConfig asymmetricAutoscalingOptions - */ - - /** - * Constructs a new AutoscalingConfig. - * @memberof google.spanner.admin.instance.v1 - * @classdesc Represents an AutoscalingConfig. - * @implements IAutoscalingConfig - * @constructor - * @param {google.spanner.admin.instance.v1.IAutoscalingConfig=} [properties] Properties to set - */ - function AutoscalingConfig(properties) { - this.asymmetricAutoscalingOptions = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AutoscalingConfig autoscalingLimits. - * @member {google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingLimits|null|undefined} autoscalingLimits - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig - * @instance - */ - AutoscalingConfig.prototype.autoscalingLimits = null; - - /** - * AutoscalingConfig autoscalingTargets. - * @member {google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingTargets|null|undefined} autoscalingTargets - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig - * @instance - */ - AutoscalingConfig.prototype.autoscalingTargets = null; - - /** - * AutoscalingConfig asymmetricAutoscalingOptions. - * @member {Array.} asymmetricAutoscalingOptions - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig - * @instance - */ - AutoscalingConfig.prototype.asymmetricAutoscalingOptions = $util.emptyArray; - - /** - * Creates a new AutoscalingConfig instance using the specified properties. - * @function create - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig - * @static - * @param {google.spanner.admin.instance.v1.IAutoscalingConfig=} [properties] Properties to set - * @returns {google.spanner.admin.instance.v1.AutoscalingConfig} AutoscalingConfig instance - */ - AutoscalingConfig.create = function create(properties) { - return new AutoscalingConfig(properties); - }; - - /** - * Encodes the specified AutoscalingConfig message. Does not implicitly {@link google.spanner.admin.instance.v1.AutoscalingConfig.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig - * @static - * @param {google.spanner.admin.instance.v1.IAutoscalingConfig} message AutoscalingConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AutoscalingConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.autoscalingLimits != null && Object.hasOwnProperty.call(message, "autoscalingLimits")) - $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits.encode(message.autoscalingLimits, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.autoscalingTargets != null && Object.hasOwnProperty.call(message, "autoscalingTargets")) - $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets.encode(message.autoscalingTargets, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.asymmetricAutoscalingOptions != null && message.asymmetricAutoscalingOptions.length) - for (var i = 0; i < message.asymmetricAutoscalingOptions.length; ++i) - $root.google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.encode(message.asymmetricAutoscalingOptions[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified AutoscalingConfig message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.AutoscalingConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig - * @static - * @param {google.spanner.admin.instance.v1.IAutoscalingConfig} message AutoscalingConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AutoscalingConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AutoscalingConfig message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.instance.v1.AutoscalingConfig} AutoscalingConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AutoscalingConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.AutoscalingConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.autoscalingLimits = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits.decode(reader, reader.uint32()); - break; - } - case 2: { - message.autoscalingTargets = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets.decode(reader, reader.uint32()); - break; - } - case 3: { - if (!(message.asymmetricAutoscalingOptions && message.asymmetricAutoscalingOptions.length)) - message.asymmetricAutoscalingOptions = []; - message.asymmetricAutoscalingOptions.push($root.google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AutoscalingConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.instance.v1.AutoscalingConfig} AutoscalingConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AutoscalingConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AutoscalingConfig message. - * @function verify - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AutoscalingConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.autoscalingLimits != null && message.hasOwnProperty("autoscalingLimits")) { - var error = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits.verify(message.autoscalingLimits); - if (error) - return "autoscalingLimits." + error; - } - if (message.autoscalingTargets != null && message.hasOwnProperty("autoscalingTargets")) { - var error = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets.verify(message.autoscalingTargets); - if (error) - return "autoscalingTargets." + error; - } - if (message.asymmetricAutoscalingOptions != null && message.hasOwnProperty("asymmetricAutoscalingOptions")) { - if (!Array.isArray(message.asymmetricAutoscalingOptions)) - return "asymmetricAutoscalingOptions: array expected"; - for (var i = 0; i < message.asymmetricAutoscalingOptions.length; ++i) { - var error = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.verify(message.asymmetricAutoscalingOptions[i]); - if (error) - return "asymmetricAutoscalingOptions." + error; - } - } - return null; - }; - - /** - * Creates an AutoscalingConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.instance.v1.AutoscalingConfig} AutoscalingConfig - */ - AutoscalingConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.instance.v1.AutoscalingConfig) - return object; - var message = new $root.google.spanner.admin.instance.v1.AutoscalingConfig(); - if (object.autoscalingLimits != null) { - if (typeof object.autoscalingLimits !== "object") - throw TypeError(".google.spanner.admin.instance.v1.AutoscalingConfig.autoscalingLimits: object expected"); - message.autoscalingLimits = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits.fromObject(object.autoscalingLimits); - } - if (object.autoscalingTargets != null) { - if (typeof object.autoscalingTargets !== "object") - throw TypeError(".google.spanner.admin.instance.v1.AutoscalingConfig.autoscalingTargets: object expected"); - message.autoscalingTargets = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets.fromObject(object.autoscalingTargets); - } - if (object.asymmetricAutoscalingOptions) { - if (!Array.isArray(object.asymmetricAutoscalingOptions)) - throw TypeError(".google.spanner.admin.instance.v1.AutoscalingConfig.asymmetricAutoscalingOptions: array expected"); - message.asymmetricAutoscalingOptions = []; - for (var i = 0; i < object.asymmetricAutoscalingOptions.length; ++i) { - if (typeof object.asymmetricAutoscalingOptions[i] !== "object") - throw TypeError(".google.spanner.admin.instance.v1.AutoscalingConfig.asymmetricAutoscalingOptions: object expected"); - message.asymmetricAutoscalingOptions[i] = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.fromObject(object.asymmetricAutoscalingOptions[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an AutoscalingConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig - * @static - * @param {google.spanner.admin.instance.v1.AutoscalingConfig} message AutoscalingConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AutoscalingConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.asymmetricAutoscalingOptions = []; - if (options.defaults) { - object.autoscalingLimits = null; - object.autoscalingTargets = null; - } - if (message.autoscalingLimits != null && message.hasOwnProperty("autoscalingLimits")) - object.autoscalingLimits = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits.toObject(message.autoscalingLimits, options); - if (message.autoscalingTargets != null && message.hasOwnProperty("autoscalingTargets")) - object.autoscalingTargets = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets.toObject(message.autoscalingTargets, options); - if (message.asymmetricAutoscalingOptions && message.asymmetricAutoscalingOptions.length) { - object.asymmetricAutoscalingOptions = []; - for (var j = 0; j < message.asymmetricAutoscalingOptions.length; ++j) - object.asymmetricAutoscalingOptions[j] = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.toObject(message.asymmetricAutoscalingOptions[j], options); - } - return object; - }; - - /** - * Converts this AutoscalingConfig to JSON. - * @function toJSON - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig - * @instance - * @returns {Object.} JSON object - */ - AutoscalingConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AutoscalingConfig - * @function getTypeUrl - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AutoscalingConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.instance.v1.AutoscalingConfig"; - }; - - AutoscalingConfig.AutoscalingLimits = (function() { - - /** - * Properties of an AutoscalingLimits. - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig - * @interface IAutoscalingLimits - * @property {number|null} [minNodes] AutoscalingLimits minNodes - * @property {number|null} [minProcessingUnits] AutoscalingLimits minProcessingUnits - * @property {number|null} [maxNodes] AutoscalingLimits maxNodes - * @property {number|null} [maxProcessingUnits] AutoscalingLimits maxProcessingUnits - */ - - /** - * Constructs a new AutoscalingLimits. - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig - * @classdesc Represents an AutoscalingLimits. - * @implements IAutoscalingLimits - * @constructor - * @param {google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingLimits=} [properties] Properties to set - */ - function AutoscalingLimits(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AutoscalingLimits minNodes. - * @member {number|null|undefined} minNodes - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits - * @instance - */ - AutoscalingLimits.prototype.minNodes = null; - - /** - * AutoscalingLimits minProcessingUnits. - * @member {number|null|undefined} minProcessingUnits - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits - * @instance - */ - AutoscalingLimits.prototype.minProcessingUnits = null; - - /** - * AutoscalingLimits maxNodes. - * @member {number|null|undefined} maxNodes - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits - * @instance - */ - AutoscalingLimits.prototype.maxNodes = null; - - /** - * AutoscalingLimits maxProcessingUnits. - * @member {number|null|undefined} maxProcessingUnits - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits - * @instance - */ - AutoscalingLimits.prototype.maxProcessingUnits = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * AutoscalingLimits minLimit. - * @member {"minNodes"|"minProcessingUnits"|undefined} minLimit - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits - * @instance - */ - Object.defineProperty(AutoscalingLimits.prototype, "minLimit", { - get: $util.oneOfGetter($oneOfFields = ["minNodes", "minProcessingUnits"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * AutoscalingLimits maxLimit. - * @member {"maxNodes"|"maxProcessingUnits"|undefined} maxLimit - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits - * @instance - */ - Object.defineProperty(AutoscalingLimits.prototype, "maxLimit", { - get: $util.oneOfGetter($oneOfFields = ["maxNodes", "maxProcessingUnits"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new AutoscalingLimits instance using the specified properties. - * @function create - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits - * @static - * @param {google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingLimits=} [properties] Properties to set - * @returns {google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits} AutoscalingLimits instance - */ - AutoscalingLimits.create = function create(properties) { - return new AutoscalingLimits(properties); - }; - - /** - * Encodes the specified AutoscalingLimits message. Does not implicitly {@link google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits - * @static - * @param {google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingLimits} message AutoscalingLimits message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AutoscalingLimits.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.minNodes != null && Object.hasOwnProperty.call(message, "minNodes")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.minNodes); - if (message.minProcessingUnits != null && Object.hasOwnProperty.call(message, "minProcessingUnits")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.minProcessingUnits); - if (message.maxNodes != null && Object.hasOwnProperty.call(message, "maxNodes")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.maxNodes); - if (message.maxProcessingUnits != null && Object.hasOwnProperty.call(message, "maxProcessingUnits")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.maxProcessingUnits); - return writer; - }; - - /** - * Encodes the specified AutoscalingLimits message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits - * @static - * @param {google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingLimits} message AutoscalingLimits message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AutoscalingLimits.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AutoscalingLimits message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits} AutoscalingLimits - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AutoscalingLimits.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.minNodes = reader.int32(); - break; - } - case 2: { - message.minProcessingUnits = reader.int32(); - break; - } - case 3: { - message.maxNodes = reader.int32(); - break; - } - case 4: { - message.maxProcessingUnits = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AutoscalingLimits message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits} AutoscalingLimits - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AutoscalingLimits.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AutoscalingLimits message. - * @function verify - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AutoscalingLimits.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.minNodes != null && message.hasOwnProperty("minNodes")) { - properties.minLimit = 1; - if (!$util.isInteger(message.minNodes)) - return "minNodes: integer expected"; - } - if (message.minProcessingUnits != null && message.hasOwnProperty("minProcessingUnits")) { - if (properties.minLimit === 1) - return "minLimit: multiple values"; - properties.minLimit = 1; - if (!$util.isInteger(message.minProcessingUnits)) - return "minProcessingUnits: integer expected"; - } - if (message.maxNodes != null && message.hasOwnProperty("maxNodes")) { - properties.maxLimit = 1; - if (!$util.isInteger(message.maxNodes)) - return "maxNodes: integer expected"; - } - if (message.maxProcessingUnits != null && message.hasOwnProperty("maxProcessingUnits")) { - if (properties.maxLimit === 1) - return "maxLimit: multiple values"; - properties.maxLimit = 1; - if (!$util.isInteger(message.maxProcessingUnits)) - return "maxProcessingUnits: integer expected"; - } - return null; - }; - - /** - * Creates an AutoscalingLimits message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits} AutoscalingLimits - */ - AutoscalingLimits.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits) - return object; - var message = new $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits(); - if (object.minNodes != null) - message.minNodes = object.minNodes | 0; - if (object.minProcessingUnits != null) - message.minProcessingUnits = object.minProcessingUnits | 0; - if (object.maxNodes != null) - message.maxNodes = object.maxNodes | 0; - if (object.maxProcessingUnits != null) - message.maxProcessingUnits = object.maxProcessingUnits | 0; - return message; - }; - - /** - * Creates a plain object from an AutoscalingLimits message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits - * @static - * @param {google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits} message AutoscalingLimits - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AutoscalingLimits.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.minNodes != null && message.hasOwnProperty("minNodes")) { - object.minNodes = message.minNodes; - if (options.oneofs) - object.minLimit = "minNodes"; - } - if (message.minProcessingUnits != null && message.hasOwnProperty("minProcessingUnits")) { - object.minProcessingUnits = message.minProcessingUnits; - if (options.oneofs) - object.minLimit = "minProcessingUnits"; - } - if (message.maxNodes != null && message.hasOwnProperty("maxNodes")) { - object.maxNodes = message.maxNodes; - if (options.oneofs) - object.maxLimit = "maxNodes"; - } - if (message.maxProcessingUnits != null && message.hasOwnProperty("maxProcessingUnits")) { - object.maxProcessingUnits = message.maxProcessingUnits; - if (options.oneofs) - object.maxLimit = "maxProcessingUnits"; - } - return object; - }; - - /** - * Converts this AutoscalingLimits to JSON. - * @function toJSON - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits - * @instance - * @returns {Object.} JSON object - */ - AutoscalingLimits.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AutoscalingLimits - * @function getTypeUrl - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AutoscalingLimits.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits"; - }; - - return AutoscalingLimits; - })(); - - AutoscalingConfig.AutoscalingTargets = (function() { - - /** - * Properties of an AutoscalingTargets. - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig - * @interface IAutoscalingTargets - * @property {number|null} [highPriorityCpuUtilizationPercent] AutoscalingTargets highPriorityCpuUtilizationPercent - * @property {number|null} [totalCpuUtilizationPercent] AutoscalingTargets totalCpuUtilizationPercent - * @property {number|null} [storageUtilizationPercent] AutoscalingTargets storageUtilizationPercent - */ - - /** - * Constructs a new AutoscalingTargets. - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig - * @classdesc Represents an AutoscalingTargets. - * @implements IAutoscalingTargets - * @constructor - * @param {google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingTargets=} [properties] Properties to set - */ - function AutoscalingTargets(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AutoscalingTargets highPriorityCpuUtilizationPercent. - * @member {number} highPriorityCpuUtilizationPercent - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets - * @instance - */ - AutoscalingTargets.prototype.highPriorityCpuUtilizationPercent = 0; - - /** - * AutoscalingTargets totalCpuUtilizationPercent. - * @member {number} totalCpuUtilizationPercent - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets - * @instance - */ - AutoscalingTargets.prototype.totalCpuUtilizationPercent = 0; - - /** - * AutoscalingTargets storageUtilizationPercent. - * @member {number} storageUtilizationPercent - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets - * @instance - */ - AutoscalingTargets.prototype.storageUtilizationPercent = 0; - - /** - * Creates a new AutoscalingTargets instance using the specified properties. - * @function create - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets - * @static - * @param {google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingTargets=} [properties] Properties to set - * @returns {google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets} AutoscalingTargets instance - */ - AutoscalingTargets.create = function create(properties) { - return new AutoscalingTargets(properties); - }; - - /** - * Encodes the specified AutoscalingTargets message. Does not implicitly {@link google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets - * @static - * @param {google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingTargets} message AutoscalingTargets message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AutoscalingTargets.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.highPriorityCpuUtilizationPercent != null && Object.hasOwnProperty.call(message, "highPriorityCpuUtilizationPercent")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.highPriorityCpuUtilizationPercent); - if (message.storageUtilizationPercent != null && Object.hasOwnProperty.call(message, "storageUtilizationPercent")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.storageUtilizationPercent); - if (message.totalCpuUtilizationPercent != null && Object.hasOwnProperty.call(message, "totalCpuUtilizationPercent")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.totalCpuUtilizationPercent); - return writer; - }; - - /** - * Encodes the specified AutoscalingTargets message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets - * @static - * @param {google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingTargets} message AutoscalingTargets message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AutoscalingTargets.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AutoscalingTargets message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets} AutoscalingTargets - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AutoscalingTargets.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.highPriorityCpuUtilizationPercent = reader.int32(); - break; - } - case 4: { - message.totalCpuUtilizationPercent = reader.int32(); - break; - } - case 2: { - message.storageUtilizationPercent = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AutoscalingTargets message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets} AutoscalingTargets - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AutoscalingTargets.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AutoscalingTargets message. - * @function verify - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AutoscalingTargets.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.highPriorityCpuUtilizationPercent != null && message.hasOwnProperty("highPriorityCpuUtilizationPercent")) - if (!$util.isInteger(message.highPriorityCpuUtilizationPercent)) - return "highPriorityCpuUtilizationPercent: integer expected"; - if (message.totalCpuUtilizationPercent != null && message.hasOwnProperty("totalCpuUtilizationPercent")) - if (!$util.isInteger(message.totalCpuUtilizationPercent)) - return "totalCpuUtilizationPercent: integer expected"; - if (message.storageUtilizationPercent != null && message.hasOwnProperty("storageUtilizationPercent")) - if (!$util.isInteger(message.storageUtilizationPercent)) - return "storageUtilizationPercent: integer expected"; - return null; - }; - - /** - * Creates an AutoscalingTargets message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets} AutoscalingTargets - */ - AutoscalingTargets.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets) - return object; - var message = new $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets(); - if (object.highPriorityCpuUtilizationPercent != null) - message.highPriorityCpuUtilizationPercent = object.highPriorityCpuUtilizationPercent | 0; - if (object.totalCpuUtilizationPercent != null) - message.totalCpuUtilizationPercent = object.totalCpuUtilizationPercent | 0; - if (object.storageUtilizationPercent != null) - message.storageUtilizationPercent = object.storageUtilizationPercent | 0; - return message; - }; - - /** - * Creates a plain object from an AutoscalingTargets message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets - * @static - * @param {google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets} message AutoscalingTargets - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AutoscalingTargets.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.highPriorityCpuUtilizationPercent = 0; - object.storageUtilizationPercent = 0; - object.totalCpuUtilizationPercent = 0; - } - if (message.highPriorityCpuUtilizationPercent != null && message.hasOwnProperty("highPriorityCpuUtilizationPercent")) - object.highPriorityCpuUtilizationPercent = message.highPriorityCpuUtilizationPercent; - if (message.storageUtilizationPercent != null && message.hasOwnProperty("storageUtilizationPercent")) - object.storageUtilizationPercent = message.storageUtilizationPercent; - if (message.totalCpuUtilizationPercent != null && message.hasOwnProperty("totalCpuUtilizationPercent")) - object.totalCpuUtilizationPercent = message.totalCpuUtilizationPercent; - return object; - }; - - /** - * Converts this AutoscalingTargets to JSON. - * @function toJSON - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets - * @instance - * @returns {Object.} JSON object - */ - AutoscalingTargets.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AutoscalingTargets - * @function getTypeUrl - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AutoscalingTargets.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets"; - }; - - return AutoscalingTargets; - })(); - - AutoscalingConfig.AsymmetricAutoscalingOption = (function() { - - /** - * Properties of an AsymmetricAutoscalingOption. - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig - * @interface IAsymmetricAutoscalingOption - * @property {google.spanner.admin.instance.v1.IReplicaSelection|null} [replicaSelection] AsymmetricAutoscalingOption replicaSelection - * @property {google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.IAutoscalingConfigOverrides|null} [overrides] AsymmetricAutoscalingOption overrides - */ - - /** - * Constructs a new AsymmetricAutoscalingOption. - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig - * @classdesc Represents an AsymmetricAutoscalingOption. - * @implements IAsymmetricAutoscalingOption - * @constructor - * @param {google.spanner.admin.instance.v1.AutoscalingConfig.IAsymmetricAutoscalingOption=} [properties] Properties to set - */ - function AsymmetricAutoscalingOption(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AsymmetricAutoscalingOption replicaSelection. - * @member {google.spanner.admin.instance.v1.IReplicaSelection|null|undefined} replicaSelection - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption - * @instance - */ - AsymmetricAutoscalingOption.prototype.replicaSelection = null; - - /** - * AsymmetricAutoscalingOption overrides. - * @member {google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.IAutoscalingConfigOverrides|null|undefined} overrides - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption - * @instance - */ - AsymmetricAutoscalingOption.prototype.overrides = null; - - /** - * Creates a new AsymmetricAutoscalingOption instance using the specified properties. - * @function create - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption - * @static - * @param {google.spanner.admin.instance.v1.AutoscalingConfig.IAsymmetricAutoscalingOption=} [properties] Properties to set - * @returns {google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption} AsymmetricAutoscalingOption instance - */ - AsymmetricAutoscalingOption.create = function create(properties) { - return new AsymmetricAutoscalingOption(properties); - }; - - /** - * Encodes the specified AsymmetricAutoscalingOption message. Does not implicitly {@link google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption - * @static - * @param {google.spanner.admin.instance.v1.AutoscalingConfig.IAsymmetricAutoscalingOption} message AsymmetricAutoscalingOption message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AsymmetricAutoscalingOption.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.replicaSelection != null && Object.hasOwnProperty.call(message, "replicaSelection")) - $root.google.spanner.admin.instance.v1.ReplicaSelection.encode(message.replicaSelection, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.overrides != null && Object.hasOwnProperty.call(message, "overrides")) - $root.google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides.encode(message.overrides, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified AsymmetricAutoscalingOption message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption - * @static - * @param {google.spanner.admin.instance.v1.AutoscalingConfig.IAsymmetricAutoscalingOption} message AsymmetricAutoscalingOption message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AsymmetricAutoscalingOption.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AsymmetricAutoscalingOption message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption} AsymmetricAutoscalingOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AsymmetricAutoscalingOption.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.replicaSelection = $root.google.spanner.admin.instance.v1.ReplicaSelection.decode(reader, reader.uint32()); - break; - } - case 2: { - message.overrides = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AsymmetricAutoscalingOption message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption} AsymmetricAutoscalingOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AsymmetricAutoscalingOption.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AsymmetricAutoscalingOption message. - * @function verify - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AsymmetricAutoscalingOption.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.replicaSelection != null && message.hasOwnProperty("replicaSelection")) { - var error = $root.google.spanner.admin.instance.v1.ReplicaSelection.verify(message.replicaSelection); - if (error) - return "replicaSelection." + error; - } - if (message.overrides != null && message.hasOwnProperty("overrides")) { - var error = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides.verify(message.overrides); - if (error) - return "overrides." + error; - } - return null; - }; - - /** - * Creates an AsymmetricAutoscalingOption message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption} AsymmetricAutoscalingOption - */ - AsymmetricAutoscalingOption.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption) - return object; - var message = new $root.google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption(); - if (object.replicaSelection != null) { - if (typeof object.replicaSelection !== "object") - throw TypeError(".google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.replicaSelection: object expected"); - message.replicaSelection = $root.google.spanner.admin.instance.v1.ReplicaSelection.fromObject(object.replicaSelection); - } - if (object.overrides != null) { - if (typeof object.overrides !== "object") - throw TypeError(".google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.overrides: object expected"); - message.overrides = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides.fromObject(object.overrides); - } - return message; - }; - - /** - * Creates a plain object from an AsymmetricAutoscalingOption message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption - * @static - * @param {google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption} message AsymmetricAutoscalingOption - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AsymmetricAutoscalingOption.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.replicaSelection = null; - object.overrides = null; - } - if (message.replicaSelection != null && message.hasOwnProperty("replicaSelection")) - object.replicaSelection = $root.google.spanner.admin.instance.v1.ReplicaSelection.toObject(message.replicaSelection, options); - if (message.overrides != null && message.hasOwnProperty("overrides")) - object.overrides = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides.toObject(message.overrides, options); - return object; - }; - - /** - * Converts this AsymmetricAutoscalingOption to JSON. - * @function toJSON - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption - * @instance - * @returns {Object.} JSON object - */ - AsymmetricAutoscalingOption.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AsymmetricAutoscalingOption - * @function getTypeUrl - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AsymmetricAutoscalingOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption"; - }; - - AsymmetricAutoscalingOption.AutoscalingConfigOverrides = (function() { - - /** - * Properties of an AutoscalingConfigOverrides. - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption - * @interface IAutoscalingConfigOverrides - * @property {google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingLimits|null} [autoscalingLimits] AutoscalingConfigOverrides autoscalingLimits - * @property {number|null} [autoscalingTargetHighPriorityCpuUtilizationPercent] AutoscalingConfigOverrides autoscalingTargetHighPriorityCpuUtilizationPercent - * @property {number|null} [autoscalingTargetTotalCpuUtilizationPercent] AutoscalingConfigOverrides autoscalingTargetTotalCpuUtilizationPercent - * @property {boolean|null} [disableHighPriorityCpuAutoscaling] AutoscalingConfigOverrides disableHighPriorityCpuAutoscaling - * @property {boolean|null} [disableTotalCpuAutoscaling] AutoscalingConfigOverrides disableTotalCpuAutoscaling - */ - - /** - * Constructs a new AutoscalingConfigOverrides. - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption - * @classdesc Represents an AutoscalingConfigOverrides. - * @implements IAutoscalingConfigOverrides - * @constructor - * @param {google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.IAutoscalingConfigOverrides=} [properties] Properties to set - */ - function AutoscalingConfigOverrides(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AutoscalingConfigOverrides autoscalingLimits. - * @member {google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingLimits|null|undefined} autoscalingLimits - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides - * @instance - */ - AutoscalingConfigOverrides.prototype.autoscalingLimits = null; - - /** - * AutoscalingConfigOverrides autoscalingTargetHighPriorityCpuUtilizationPercent. - * @member {number} autoscalingTargetHighPriorityCpuUtilizationPercent - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides - * @instance - */ - AutoscalingConfigOverrides.prototype.autoscalingTargetHighPriorityCpuUtilizationPercent = 0; - - /** - * AutoscalingConfigOverrides autoscalingTargetTotalCpuUtilizationPercent. - * @member {number} autoscalingTargetTotalCpuUtilizationPercent - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides - * @instance - */ - AutoscalingConfigOverrides.prototype.autoscalingTargetTotalCpuUtilizationPercent = 0; - - /** - * AutoscalingConfigOverrides disableHighPriorityCpuAutoscaling. - * @member {boolean} disableHighPriorityCpuAutoscaling - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides - * @instance - */ - AutoscalingConfigOverrides.prototype.disableHighPriorityCpuAutoscaling = false; - - /** - * AutoscalingConfigOverrides disableTotalCpuAutoscaling. - * @member {boolean} disableTotalCpuAutoscaling - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides - * @instance - */ - AutoscalingConfigOverrides.prototype.disableTotalCpuAutoscaling = false; - - /** - * Creates a new AutoscalingConfigOverrides instance using the specified properties. - * @function create - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides - * @static - * @param {google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.IAutoscalingConfigOverrides=} [properties] Properties to set - * @returns {google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides} AutoscalingConfigOverrides instance - */ - AutoscalingConfigOverrides.create = function create(properties) { - return new AutoscalingConfigOverrides(properties); - }; - - /** - * Encodes the specified AutoscalingConfigOverrides message. Does not implicitly {@link google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides - * @static - * @param {google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.IAutoscalingConfigOverrides} message AutoscalingConfigOverrides message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AutoscalingConfigOverrides.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.autoscalingLimits != null && Object.hasOwnProperty.call(message, "autoscalingLimits")) - $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits.encode(message.autoscalingLimits, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.autoscalingTargetHighPriorityCpuUtilizationPercent != null && Object.hasOwnProperty.call(message, "autoscalingTargetHighPriorityCpuUtilizationPercent")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.autoscalingTargetHighPriorityCpuUtilizationPercent); - if (message.autoscalingTargetTotalCpuUtilizationPercent != null && Object.hasOwnProperty.call(message, "autoscalingTargetTotalCpuUtilizationPercent")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.autoscalingTargetTotalCpuUtilizationPercent); - if (message.disableHighPriorityCpuAutoscaling != null && Object.hasOwnProperty.call(message, "disableHighPriorityCpuAutoscaling")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.disableHighPriorityCpuAutoscaling); - if (message.disableTotalCpuAutoscaling != null && Object.hasOwnProperty.call(message, "disableTotalCpuAutoscaling")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.disableTotalCpuAutoscaling); - return writer; - }; - - /** - * Encodes the specified AutoscalingConfigOverrides message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides - * @static - * @param {google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.IAutoscalingConfigOverrides} message AutoscalingConfigOverrides message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AutoscalingConfigOverrides.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AutoscalingConfigOverrides message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides} AutoscalingConfigOverrides - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AutoscalingConfigOverrides.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.autoscalingLimits = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits.decode(reader, reader.uint32()); - break; - } - case 2: { - message.autoscalingTargetHighPriorityCpuUtilizationPercent = reader.int32(); - break; - } - case 4: { - message.autoscalingTargetTotalCpuUtilizationPercent = reader.int32(); - break; - } - case 5: { - message.disableHighPriorityCpuAutoscaling = reader.bool(); - break; - } - case 6: { - message.disableTotalCpuAutoscaling = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AutoscalingConfigOverrides message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides} AutoscalingConfigOverrides - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AutoscalingConfigOverrides.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AutoscalingConfigOverrides message. - * @function verify - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AutoscalingConfigOverrides.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.autoscalingLimits != null && message.hasOwnProperty("autoscalingLimits")) { - var error = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits.verify(message.autoscalingLimits); - if (error) - return "autoscalingLimits." + error; - } - if (message.autoscalingTargetHighPriorityCpuUtilizationPercent != null && message.hasOwnProperty("autoscalingTargetHighPriorityCpuUtilizationPercent")) - if (!$util.isInteger(message.autoscalingTargetHighPriorityCpuUtilizationPercent)) - return "autoscalingTargetHighPriorityCpuUtilizationPercent: integer expected"; - if (message.autoscalingTargetTotalCpuUtilizationPercent != null && message.hasOwnProperty("autoscalingTargetTotalCpuUtilizationPercent")) - if (!$util.isInteger(message.autoscalingTargetTotalCpuUtilizationPercent)) - return "autoscalingTargetTotalCpuUtilizationPercent: integer expected"; - if (message.disableHighPriorityCpuAutoscaling != null && message.hasOwnProperty("disableHighPriorityCpuAutoscaling")) - if (typeof message.disableHighPriorityCpuAutoscaling !== "boolean") - return "disableHighPriorityCpuAutoscaling: boolean expected"; - if (message.disableTotalCpuAutoscaling != null && message.hasOwnProperty("disableTotalCpuAutoscaling")) - if (typeof message.disableTotalCpuAutoscaling !== "boolean") - return "disableTotalCpuAutoscaling: boolean expected"; - return null; - }; - - /** - * Creates an AutoscalingConfigOverrides message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides} AutoscalingConfigOverrides - */ - AutoscalingConfigOverrides.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides) - return object; - var message = new $root.google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides(); - if (object.autoscalingLimits != null) { - if (typeof object.autoscalingLimits !== "object") - throw TypeError(".google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides.autoscalingLimits: object expected"); - message.autoscalingLimits = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits.fromObject(object.autoscalingLimits); - } - if (object.autoscalingTargetHighPriorityCpuUtilizationPercent != null) - message.autoscalingTargetHighPriorityCpuUtilizationPercent = object.autoscalingTargetHighPriorityCpuUtilizationPercent | 0; - if (object.autoscalingTargetTotalCpuUtilizationPercent != null) - message.autoscalingTargetTotalCpuUtilizationPercent = object.autoscalingTargetTotalCpuUtilizationPercent | 0; - if (object.disableHighPriorityCpuAutoscaling != null) - message.disableHighPriorityCpuAutoscaling = Boolean(object.disableHighPriorityCpuAutoscaling); - if (object.disableTotalCpuAutoscaling != null) - message.disableTotalCpuAutoscaling = Boolean(object.disableTotalCpuAutoscaling); - return message; - }; - - /** - * Creates a plain object from an AutoscalingConfigOverrides message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides - * @static - * @param {google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides} message AutoscalingConfigOverrides - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AutoscalingConfigOverrides.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.autoscalingLimits = null; - object.autoscalingTargetHighPriorityCpuUtilizationPercent = 0; - object.autoscalingTargetTotalCpuUtilizationPercent = 0; - object.disableHighPriorityCpuAutoscaling = false; - object.disableTotalCpuAutoscaling = false; - } - if (message.autoscalingLimits != null && message.hasOwnProperty("autoscalingLimits")) - object.autoscalingLimits = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits.toObject(message.autoscalingLimits, options); - if (message.autoscalingTargetHighPriorityCpuUtilizationPercent != null && message.hasOwnProperty("autoscalingTargetHighPriorityCpuUtilizationPercent")) - object.autoscalingTargetHighPriorityCpuUtilizationPercent = message.autoscalingTargetHighPriorityCpuUtilizationPercent; - if (message.autoscalingTargetTotalCpuUtilizationPercent != null && message.hasOwnProperty("autoscalingTargetTotalCpuUtilizationPercent")) - object.autoscalingTargetTotalCpuUtilizationPercent = message.autoscalingTargetTotalCpuUtilizationPercent; - if (message.disableHighPriorityCpuAutoscaling != null && message.hasOwnProperty("disableHighPriorityCpuAutoscaling")) - object.disableHighPriorityCpuAutoscaling = message.disableHighPriorityCpuAutoscaling; - if (message.disableTotalCpuAutoscaling != null && message.hasOwnProperty("disableTotalCpuAutoscaling")) - object.disableTotalCpuAutoscaling = message.disableTotalCpuAutoscaling; - return object; - }; - - /** - * Converts this AutoscalingConfigOverrides to JSON. - * @function toJSON - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides - * @instance - * @returns {Object.} JSON object - */ - AutoscalingConfigOverrides.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AutoscalingConfigOverrides - * @function getTypeUrl - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AutoscalingConfigOverrides.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides"; - }; - - return AutoscalingConfigOverrides; - })(); - - return AsymmetricAutoscalingOption; - })(); - - return AutoscalingConfig; - })(); - - v1.Instance = (function() { - - /** - * Properties of an Instance. - * @memberof google.spanner.admin.instance.v1 - * @interface IInstance - * @property {string|null} [name] Instance name - * @property {string|null} [config] Instance config - * @property {string|null} [displayName] Instance displayName - * @property {number|null} [nodeCount] Instance nodeCount - * @property {number|null} [processingUnits] Instance processingUnits - * @property {Array.|null} [replicaComputeCapacity] Instance replicaComputeCapacity - * @property {google.spanner.admin.instance.v1.IAutoscalingConfig|null} [autoscalingConfig] Instance autoscalingConfig - * @property {google.spanner.admin.instance.v1.Instance.State|null} [state] Instance state - * @property {Object.|null} [labels] Instance labels - * @property {google.spanner.admin.instance.v1.Instance.InstanceType|null} [instanceType] Instance instanceType - * @property {Array.|null} [endpointUris] Instance endpointUris - * @property {google.protobuf.ITimestamp|null} [createTime] Instance createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] Instance updateTime - * @property {google.spanner.admin.instance.v1.IFreeInstanceMetadata|null} [freeInstanceMetadata] Instance freeInstanceMetadata - * @property {google.spanner.admin.instance.v1.Instance.Edition|null} [edition] Instance edition - * @property {google.spanner.admin.instance.v1.Instance.DefaultBackupScheduleType|null} [defaultBackupScheduleType] Instance defaultBackupScheduleType - */ - - /** - * Constructs a new Instance. - * @memberof google.spanner.admin.instance.v1 - * @classdesc Represents an Instance. - * @implements IInstance - * @constructor - * @param {google.spanner.admin.instance.v1.IInstance=} [properties] Properties to set - */ - function Instance(properties) { - this.replicaComputeCapacity = []; - this.labels = {}; - this.endpointUris = []; - if (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.spanner.admin.instance.v1.Instance - * @instance - */ - Instance.prototype.name = ""; - - /** - * Instance config. - * @member {string} config - * @memberof google.spanner.admin.instance.v1.Instance - * @instance - */ - Instance.prototype.config = ""; - - /** - * Instance displayName. - * @member {string} displayName - * @memberof google.spanner.admin.instance.v1.Instance - * @instance - */ - Instance.prototype.displayName = ""; - - /** - * Instance nodeCount. - * @member {number} nodeCount - * @memberof google.spanner.admin.instance.v1.Instance - * @instance - */ - Instance.prototype.nodeCount = 0; - - /** - * Instance processingUnits. - * @member {number} processingUnits - * @memberof google.spanner.admin.instance.v1.Instance - * @instance - */ - Instance.prototype.processingUnits = 0; - - /** - * Instance replicaComputeCapacity. - * @member {Array.} replicaComputeCapacity - * @memberof google.spanner.admin.instance.v1.Instance - * @instance - */ - Instance.prototype.replicaComputeCapacity = $util.emptyArray; - - /** - * Instance autoscalingConfig. - * @member {google.spanner.admin.instance.v1.IAutoscalingConfig|null|undefined} autoscalingConfig - * @memberof google.spanner.admin.instance.v1.Instance - * @instance - */ - Instance.prototype.autoscalingConfig = null; - - /** - * Instance state. - * @member {google.spanner.admin.instance.v1.Instance.State} state - * @memberof google.spanner.admin.instance.v1.Instance - * @instance - */ - Instance.prototype.state = 0; - - /** - * Instance labels. - * @member {Object.} labels - * @memberof google.spanner.admin.instance.v1.Instance - * @instance - */ - Instance.prototype.labels = $util.emptyObject; - - /** - * Instance instanceType. - * @member {google.spanner.admin.instance.v1.Instance.InstanceType} instanceType - * @memberof google.spanner.admin.instance.v1.Instance - * @instance - */ - Instance.prototype.instanceType = 0; - - /** - * Instance endpointUris. - * @member {Array.} endpointUris - * @memberof google.spanner.admin.instance.v1.Instance - * @instance - */ - Instance.prototype.endpointUris = $util.emptyArray; - - /** - * Instance createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.spanner.admin.instance.v1.Instance - * @instance - */ - Instance.prototype.createTime = null; - - /** - * Instance updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.spanner.admin.instance.v1.Instance - * @instance - */ - Instance.prototype.updateTime = null; - - /** - * Instance freeInstanceMetadata. - * @member {google.spanner.admin.instance.v1.IFreeInstanceMetadata|null|undefined} freeInstanceMetadata - * @memberof google.spanner.admin.instance.v1.Instance - * @instance - */ - Instance.prototype.freeInstanceMetadata = null; - - /** - * Instance edition. - * @member {google.spanner.admin.instance.v1.Instance.Edition} edition - * @memberof google.spanner.admin.instance.v1.Instance - * @instance - */ - Instance.prototype.edition = 0; - - /** - * Instance defaultBackupScheduleType. - * @member {google.spanner.admin.instance.v1.Instance.DefaultBackupScheduleType} defaultBackupScheduleType - * @memberof google.spanner.admin.instance.v1.Instance - * @instance - */ - Instance.prototype.defaultBackupScheduleType = 0; - - /** - * Creates a new Instance instance using the specified properties. - * @function create - * @memberof google.spanner.admin.instance.v1.Instance - * @static - * @param {google.spanner.admin.instance.v1.IInstance=} [properties] Properties to set - * @returns {google.spanner.admin.instance.v1.Instance} Instance instance - */ - Instance.create = function create(properties) { - return new Instance(properties); - }; - - /** - * Encodes the specified Instance message. Does not implicitly {@link google.spanner.admin.instance.v1.Instance.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.instance.v1.Instance - * @static - * @param {google.spanner.admin.instance.v1.IInstance} message Instance message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Instance.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.config != null && Object.hasOwnProperty.call(message, "config")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.config); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.displayName); - if (message.nodeCount != null && Object.hasOwnProperty.call(message, "nodeCount")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.nodeCount); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.state); - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.endpointUris != null && message.endpointUris.length) - for (var i = 0; i < message.endpointUris.length; ++i) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.endpointUris[i]); - if (message.processingUnits != null && Object.hasOwnProperty.call(message, "processingUnits")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.processingUnits); - if (message.instanceType != null && Object.hasOwnProperty.call(message, "instanceType")) - writer.uint32(/* id 10, wireType 0 =*/80).int32(message.instanceType); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - if (message.freeInstanceMetadata != null && Object.hasOwnProperty.call(message, "freeInstanceMetadata")) - $root.google.spanner.admin.instance.v1.FreeInstanceMetadata.encode(message.freeInstanceMetadata, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); - if (message.autoscalingConfig != null && Object.hasOwnProperty.call(message, "autoscalingConfig")) - $root.google.spanner.admin.instance.v1.AutoscalingConfig.encode(message.autoscalingConfig, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); - if (message.replicaComputeCapacity != null && message.replicaComputeCapacity.length) - for (var i = 0; i < message.replicaComputeCapacity.length; ++i) - $root.google.spanner.admin.instance.v1.ReplicaComputeCapacity.encode(message.replicaComputeCapacity[i], writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); - if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) - writer.uint32(/* id 20, wireType 0 =*/160).int32(message.edition); - if (message.defaultBackupScheduleType != null && Object.hasOwnProperty.call(message, "defaultBackupScheduleType")) - writer.uint32(/* id 23, wireType 0 =*/184).int32(message.defaultBackupScheduleType); - return writer; - }; - - /** - * Encodes the specified Instance message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.Instance.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.instance.v1.Instance - * @static - * @param {google.spanner.admin.instance.v1.IInstance} message Instance message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Instance.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Instance message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.instance.v1.Instance - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.instance.v1.Instance} Instance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Instance.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.Instance(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.config = reader.string(); - break; - } - case 3: { - message.displayName = reader.string(); - break; - } - case 5: { - message.nodeCount = reader.int32(); - break; - } - case 9: { - message.processingUnits = reader.int32(); - break; - } - case 19: { - if (!(message.replicaComputeCapacity && message.replicaComputeCapacity.length)) - message.replicaComputeCapacity = []; - message.replicaComputeCapacity.push($root.google.spanner.admin.instance.v1.ReplicaComputeCapacity.decode(reader, reader.uint32())); - break; - } - case 17: { - message.autoscalingConfig = $root.google.spanner.admin.instance.v1.AutoscalingConfig.decode(reader, reader.uint32()); - break; - } - case 6: { - message.state = reader.int32(); - break; - } - case 7: { - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.labels[key] = value; - break; - } - case 10: { - message.instanceType = reader.int32(); - break; - } - case 8: { - if (!(message.endpointUris && message.endpointUris.length)) - message.endpointUris = []; - message.endpointUris.push(reader.string()); - break; - } - case 11: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 12: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 13: { - message.freeInstanceMetadata = $root.google.spanner.admin.instance.v1.FreeInstanceMetadata.decode(reader, reader.uint32()); - break; - } - case 20: { - message.edition = reader.int32(); - break; - } - case 23: { - message.defaultBackupScheduleType = reader.int32(); - 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.spanner.admin.instance.v1.Instance - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.instance.v1.Instance} Instance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Instance.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Instance message. - * @function verify - * @memberof google.spanner.admin.instance.v1.Instance - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Instance.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.config != null && message.hasOwnProperty("config")) - if (!$util.isString(message.config)) - return "config: string expected"; - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) - if (!$util.isInteger(message.nodeCount)) - return "nodeCount: integer expected"; - if (message.processingUnits != null && message.hasOwnProperty("processingUnits")) - if (!$util.isInteger(message.processingUnits)) - return "processingUnits: integer expected"; - if (message.replicaComputeCapacity != null && message.hasOwnProperty("replicaComputeCapacity")) { - if (!Array.isArray(message.replicaComputeCapacity)) - return "replicaComputeCapacity: array expected"; - for (var i = 0; i < message.replicaComputeCapacity.length; ++i) { - var error = $root.google.spanner.admin.instance.v1.ReplicaComputeCapacity.verify(message.replicaComputeCapacity[i]); - if (error) - return "replicaComputeCapacity." + error; - } - } - if (message.autoscalingConfig != null && message.hasOwnProperty("autoscalingConfig")) { - var error = $root.google.spanner.admin.instance.v1.AutoscalingConfig.verify(message.autoscalingConfig); - if (error) - return "autoscalingConfig." + 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.labels != null && message.hasOwnProperty("labels")) { - if (!$util.isObject(message.labels)) - return "labels: object expected"; - var key = Object.keys(message.labels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.labels[key[i]])) - return "labels: string{k:string} expected"; - } - if (message.instanceType != null && message.hasOwnProperty("instanceType")) - switch (message.instanceType) { - default: - return "instanceType: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.endpointUris != null && message.hasOwnProperty("endpointUris")) { - if (!Array.isArray(message.endpointUris)) - return "endpointUris: array expected"; - for (var i = 0; i < message.endpointUris.length; ++i) - if (!$util.isString(message.endpointUris[i])) - return "endpointUris: string[] expected"; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); - if (error) - return "updateTime." + error; - } - if (message.freeInstanceMetadata != null && message.hasOwnProperty("freeInstanceMetadata")) { - var error = $root.google.spanner.admin.instance.v1.FreeInstanceMetadata.verify(message.freeInstanceMetadata); - if (error) - return "freeInstanceMetadata." + error; - } - if (message.edition != null && message.hasOwnProperty("edition")) - switch (message.edition) { - default: - return "edition: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.defaultBackupScheduleType != null && message.hasOwnProperty("defaultBackupScheduleType")) - switch (message.defaultBackupScheduleType) { - default: - return "defaultBackupScheduleType: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates an Instance message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.instance.v1.Instance - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.instance.v1.Instance} Instance - */ - Instance.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.instance.v1.Instance) - return object; - var message = new $root.google.spanner.admin.instance.v1.Instance(); - if (object.name != null) - message.name = String(object.name); - if (object.config != null) - message.config = String(object.config); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.nodeCount != null) - message.nodeCount = object.nodeCount | 0; - if (object.processingUnits != null) - message.processingUnits = object.processingUnits | 0; - if (object.replicaComputeCapacity) { - if (!Array.isArray(object.replicaComputeCapacity)) - throw TypeError(".google.spanner.admin.instance.v1.Instance.replicaComputeCapacity: array expected"); - message.replicaComputeCapacity = []; - for (var i = 0; i < object.replicaComputeCapacity.length; ++i) { - if (typeof object.replicaComputeCapacity[i] !== "object") - throw TypeError(".google.spanner.admin.instance.v1.Instance.replicaComputeCapacity: object expected"); - message.replicaComputeCapacity[i] = $root.google.spanner.admin.instance.v1.ReplicaComputeCapacity.fromObject(object.replicaComputeCapacity[i]); - } - } - if (object.autoscalingConfig != null) { - if (typeof object.autoscalingConfig !== "object") - throw TypeError(".google.spanner.admin.instance.v1.Instance.autoscalingConfig: object expected"); - message.autoscalingConfig = $root.google.spanner.admin.instance.v1.AutoscalingConfig.fromObject(object.autoscalingConfig); - } - switch (object.state) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "CREATING": - case 1: - message.state = 1; - break; - case "READY": - case 2: - message.state = 2; - break; - } - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.spanner.admin.instance.v1.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]]); - } - switch (object.instanceType) { - default: - if (typeof object.instanceType === "number") { - message.instanceType = object.instanceType; - break; - } - break; - case "INSTANCE_TYPE_UNSPECIFIED": - case 0: - message.instanceType = 0; - break; - case "PROVISIONED": - case 1: - message.instanceType = 1; - break; - case "FREE_INSTANCE": - case 2: - message.instanceType = 2; - break; - } - if (object.endpointUris) { - if (!Array.isArray(object.endpointUris)) - throw TypeError(".google.spanner.admin.instance.v1.Instance.endpointUris: array expected"); - message.endpointUris = []; - for (var i = 0; i < object.endpointUris.length; ++i) - message.endpointUris[i] = String(object.endpointUris[i]); - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.spanner.admin.instance.v1.Instance.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.updateTime != null) { - if (typeof object.updateTime !== "object") - throw TypeError(".google.spanner.admin.instance.v1.Instance.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.freeInstanceMetadata != null) { - if (typeof object.freeInstanceMetadata !== "object") - throw TypeError(".google.spanner.admin.instance.v1.Instance.freeInstanceMetadata: object expected"); - message.freeInstanceMetadata = $root.google.spanner.admin.instance.v1.FreeInstanceMetadata.fromObject(object.freeInstanceMetadata); - } - switch (object.edition) { - default: - if (typeof object.edition === "number") { - message.edition = object.edition; - break; - } - break; - case "EDITION_UNSPECIFIED": - case 0: - message.edition = 0; - break; - case "STANDARD": - case 1: - message.edition = 1; - break; - case "ENTERPRISE": - case 2: - message.edition = 2; - break; - case "ENTERPRISE_PLUS": - case 3: - message.edition = 3; - break; - } - switch (object.defaultBackupScheduleType) { - default: - if (typeof object.defaultBackupScheduleType === "number") { - message.defaultBackupScheduleType = object.defaultBackupScheduleType; - break; - } - break; - case "DEFAULT_BACKUP_SCHEDULE_TYPE_UNSPECIFIED": - case 0: - message.defaultBackupScheduleType = 0; - break; - case "NONE": - case 1: - message.defaultBackupScheduleType = 1; - break; - case "AUTOMATIC": - case 2: - message.defaultBackupScheduleType = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from an Instance message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.instance.v1.Instance - * @static - * @param {google.spanner.admin.instance.v1.Instance} message Instance - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Instance.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.endpointUris = []; - object.replicaComputeCapacity = []; - } - if (options.objects || options.defaults) - object.labels = {}; - if (options.defaults) { - object.name = ""; - object.config = ""; - object.displayName = ""; - object.nodeCount = 0; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.processingUnits = 0; - object.instanceType = options.enums === String ? "INSTANCE_TYPE_UNSPECIFIED" : 0; - object.createTime = null; - object.updateTime = null; - object.freeInstanceMetadata = null; - object.autoscalingConfig = null; - object.edition = options.enums === String ? "EDITION_UNSPECIFIED" : 0; - object.defaultBackupScheduleType = options.enums === String ? "DEFAULT_BACKUP_SCHEDULE_TYPE_UNSPECIFIED" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.config != null && message.hasOwnProperty("config")) - object.config = message.config; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) - object.nodeCount = message.nodeCount; - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.spanner.admin.instance.v1.Instance.State[message.state] === undefined ? message.state : $root.google.spanner.admin.instance.v1.Instance.State[message.state] : message.state; - 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.endpointUris && message.endpointUris.length) { - object.endpointUris = []; - for (var j = 0; j < message.endpointUris.length; ++j) - object.endpointUris[j] = message.endpointUris[j]; - } - if (message.processingUnits != null && message.hasOwnProperty("processingUnits")) - object.processingUnits = message.processingUnits; - if (message.instanceType != null && message.hasOwnProperty("instanceType")) - object.instanceType = options.enums === String ? $root.google.spanner.admin.instance.v1.Instance.InstanceType[message.instanceType] === undefined ? message.instanceType : $root.google.spanner.admin.instance.v1.Instance.InstanceType[message.instanceType] : message.instanceType; - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.updateTime != null && message.hasOwnProperty("updateTime")) - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); - if (message.freeInstanceMetadata != null && message.hasOwnProperty("freeInstanceMetadata")) - object.freeInstanceMetadata = $root.google.spanner.admin.instance.v1.FreeInstanceMetadata.toObject(message.freeInstanceMetadata, options); - if (message.autoscalingConfig != null && message.hasOwnProperty("autoscalingConfig")) - object.autoscalingConfig = $root.google.spanner.admin.instance.v1.AutoscalingConfig.toObject(message.autoscalingConfig, options); - if (message.replicaComputeCapacity && message.replicaComputeCapacity.length) { - object.replicaComputeCapacity = []; - for (var j = 0; j < message.replicaComputeCapacity.length; ++j) - object.replicaComputeCapacity[j] = $root.google.spanner.admin.instance.v1.ReplicaComputeCapacity.toObject(message.replicaComputeCapacity[j], options); - } - if (message.edition != null && message.hasOwnProperty("edition")) - object.edition = options.enums === String ? $root.google.spanner.admin.instance.v1.Instance.Edition[message.edition] === undefined ? message.edition : $root.google.spanner.admin.instance.v1.Instance.Edition[message.edition] : message.edition; - if (message.defaultBackupScheduleType != null && message.hasOwnProperty("defaultBackupScheduleType")) - object.defaultBackupScheduleType = options.enums === String ? $root.google.spanner.admin.instance.v1.Instance.DefaultBackupScheduleType[message.defaultBackupScheduleType] === undefined ? message.defaultBackupScheduleType : $root.google.spanner.admin.instance.v1.Instance.DefaultBackupScheduleType[message.defaultBackupScheduleType] : message.defaultBackupScheduleType; - return object; - }; - - /** - * Converts this Instance to JSON. - * @function toJSON - * @memberof google.spanner.admin.instance.v1.Instance - * @instance - * @returns {Object.} JSON object - */ - Instance.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Instance - * @function getTypeUrl - * @memberof google.spanner.admin.instance.v1.Instance - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Instance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.instance.v1.Instance"; - }; - - /** - * State enum. - * @name google.spanner.admin.instance.v1.Instance.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} CREATING=1 CREATING value - * @property {number} READY=2 READY value - */ - Instance.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "CREATING"] = 1; - values[valuesById[2] = "READY"] = 2; - return values; - })(); - - /** - * InstanceType enum. - * @name google.spanner.admin.instance.v1.Instance.InstanceType - * @enum {number} - * @property {number} INSTANCE_TYPE_UNSPECIFIED=0 INSTANCE_TYPE_UNSPECIFIED value - * @property {number} PROVISIONED=1 PROVISIONED value - * @property {number} FREE_INSTANCE=2 FREE_INSTANCE value - */ - Instance.InstanceType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "INSTANCE_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "PROVISIONED"] = 1; - values[valuesById[2] = "FREE_INSTANCE"] = 2; - return values; - })(); - - /** - * Edition enum. - * @name google.spanner.admin.instance.v1.Instance.Edition - * @enum {number} - * @property {number} EDITION_UNSPECIFIED=0 EDITION_UNSPECIFIED value - * @property {number} STANDARD=1 STANDARD value - * @property {number} ENTERPRISE=2 ENTERPRISE value - * @property {number} ENTERPRISE_PLUS=3 ENTERPRISE_PLUS value - */ - Instance.Edition = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "EDITION_UNSPECIFIED"] = 0; - values[valuesById[1] = "STANDARD"] = 1; - values[valuesById[2] = "ENTERPRISE"] = 2; - values[valuesById[3] = "ENTERPRISE_PLUS"] = 3; - return values; - })(); - - /** - * DefaultBackupScheduleType enum. - * @name google.spanner.admin.instance.v1.Instance.DefaultBackupScheduleType - * @enum {number} - * @property {number} DEFAULT_BACKUP_SCHEDULE_TYPE_UNSPECIFIED=0 DEFAULT_BACKUP_SCHEDULE_TYPE_UNSPECIFIED value - * @property {number} NONE=1 NONE value - * @property {number} AUTOMATIC=2 AUTOMATIC value - */ - Instance.DefaultBackupScheduleType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "DEFAULT_BACKUP_SCHEDULE_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "NONE"] = 1; - values[valuesById[2] = "AUTOMATIC"] = 2; - return values; - })(); - - return Instance; - })(); - - v1.ListInstanceConfigsRequest = (function() { - - /** - * Properties of a ListInstanceConfigsRequest. - * @memberof google.spanner.admin.instance.v1 - * @interface IListInstanceConfigsRequest - * @property {string|null} [parent] ListInstanceConfigsRequest parent - * @property {number|null} [pageSize] ListInstanceConfigsRequest pageSize - * @property {string|null} [pageToken] ListInstanceConfigsRequest pageToken - */ - - /** - * Constructs a new ListInstanceConfigsRequest. - * @memberof google.spanner.admin.instance.v1 - * @classdesc Represents a ListInstanceConfigsRequest. - * @implements IListInstanceConfigsRequest - * @constructor - * @param {google.spanner.admin.instance.v1.IListInstanceConfigsRequest=} [properties] Properties to set - */ - function ListInstanceConfigsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListInstanceConfigsRequest parent. - * @member {string} parent - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsRequest - * @instance - */ - ListInstanceConfigsRequest.prototype.parent = ""; - - /** - * ListInstanceConfigsRequest pageSize. - * @member {number} pageSize - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsRequest - * @instance - */ - ListInstanceConfigsRequest.prototype.pageSize = 0; - - /** - * ListInstanceConfigsRequest pageToken. - * @member {string} pageToken - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsRequest - * @instance - */ - ListInstanceConfigsRequest.prototype.pageToken = ""; - - /** - * Creates a new ListInstanceConfigsRequest instance using the specified properties. - * @function create - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsRequest - * @static - * @param {google.spanner.admin.instance.v1.IListInstanceConfigsRequest=} [properties] Properties to set - * @returns {google.spanner.admin.instance.v1.ListInstanceConfigsRequest} ListInstanceConfigsRequest instance - */ - ListInstanceConfigsRequest.create = function create(properties) { - return new ListInstanceConfigsRequest(properties); - }; - - /** - * Encodes the specified ListInstanceConfigsRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstanceConfigsRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsRequest - * @static - * @param {google.spanner.admin.instance.v1.IListInstanceConfigsRequest} message ListInstanceConfigsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListInstanceConfigsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - return writer; - }; - - /** - * Encodes the specified ListInstanceConfigsRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstanceConfigsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsRequest - * @static - * @param {google.spanner.admin.instance.v1.IListInstanceConfigsRequest} message ListInstanceConfigsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListInstanceConfigsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListInstanceConfigsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.instance.v1.ListInstanceConfigsRequest} ListInstanceConfigsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListInstanceConfigsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.ListInstanceConfigsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListInstanceConfigsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.instance.v1.ListInstanceConfigsRequest} ListInstanceConfigsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListInstanceConfigsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListInstanceConfigsRequest message. - * @function verify - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListInstanceConfigsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - return null; - }; - - /** - * Creates a ListInstanceConfigsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.instance.v1.ListInstanceConfigsRequest} ListInstanceConfigsRequest - */ - ListInstanceConfigsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.instance.v1.ListInstanceConfigsRequest) - return object; - var message = new $root.google.spanner.admin.instance.v1.ListInstanceConfigsRequest(); - 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 ListInstanceConfigsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsRequest - * @static - * @param {google.spanner.admin.instance.v1.ListInstanceConfigsRequest} message ListInstanceConfigsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListInstanceConfigsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - return object; - }; - - /** - * Converts this ListInstanceConfigsRequest to JSON. - * @function toJSON - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsRequest - * @instance - * @returns {Object.} JSON object - */ - ListInstanceConfigsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListInstanceConfigsRequest - * @function getTypeUrl - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListInstanceConfigsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.instance.v1.ListInstanceConfigsRequest"; - }; - - return ListInstanceConfigsRequest; - })(); - - v1.ListInstanceConfigsResponse = (function() { - - /** - * Properties of a ListInstanceConfigsResponse. - * @memberof google.spanner.admin.instance.v1 - * @interface IListInstanceConfigsResponse - * @property {Array.|null} [instanceConfigs] ListInstanceConfigsResponse instanceConfigs - * @property {string|null} [nextPageToken] ListInstanceConfigsResponse nextPageToken - */ - - /** - * Constructs a new ListInstanceConfigsResponse. - * @memberof google.spanner.admin.instance.v1 - * @classdesc Represents a ListInstanceConfigsResponse. - * @implements IListInstanceConfigsResponse - * @constructor - * @param {google.spanner.admin.instance.v1.IListInstanceConfigsResponse=} [properties] Properties to set - */ - function ListInstanceConfigsResponse(properties) { - this.instanceConfigs = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListInstanceConfigsResponse instanceConfigs. - * @member {Array.} instanceConfigs - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsResponse - * @instance - */ - ListInstanceConfigsResponse.prototype.instanceConfigs = $util.emptyArray; - - /** - * ListInstanceConfigsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsResponse - * @instance - */ - ListInstanceConfigsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListInstanceConfigsResponse instance using the specified properties. - * @function create - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsResponse - * @static - * @param {google.spanner.admin.instance.v1.IListInstanceConfigsResponse=} [properties] Properties to set - * @returns {google.spanner.admin.instance.v1.ListInstanceConfigsResponse} ListInstanceConfigsResponse instance - */ - ListInstanceConfigsResponse.create = function create(properties) { - return new ListInstanceConfigsResponse(properties); - }; - - /** - * Encodes the specified ListInstanceConfigsResponse message. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstanceConfigsResponse.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsResponse - * @static - * @param {google.spanner.admin.instance.v1.IListInstanceConfigsResponse} message ListInstanceConfigsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListInstanceConfigsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.instanceConfigs != null && message.instanceConfigs.length) - for (var i = 0; i < message.instanceConfigs.length; ++i) - $root.google.spanner.admin.instance.v1.InstanceConfig.encode(message.instanceConfigs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - return writer; - }; - - /** - * Encodes the specified ListInstanceConfigsResponse message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstanceConfigsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsResponse - * @static - * @param {google.spanner.admin.instance.v1.IListInstanceConfigsResponse} message ListInstanceConfigsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListInstanceConfigsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListInstanceConfigsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.instance.v1.ListInstanceConfigsResponse} ListInstanceConfigsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListInstanceConfigsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.ListInstanceConfigsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.instanceConfigs && message.instanceConfigs.length)) - message.instanceConfigs = []; - message.instanceConfigs.push($root.google.spanner.admin.instance.v1.InstanceConfig.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListInstanceConfigsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.instance.v1.ListInstanceConfigsResponse} ListInstanceConfigsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListInstanceConfigsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListInstanceConfigsResponse message. - * @function verify - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListInstanceConfigsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.instanceConfigs != null && message.hasOwnProperty("instanceConfigs")) { - if (!Array.isArray(message.instanceConfigs)) - return "instanceConfigs: array expected"; - for (var i = 0; i < message.instanceConfigs.length; ++i) { - var error = $root.google.spanner.admin.instance.v1.InstanceConfig.verify(message.instanceConfigs[i]); - if (error) - return "instanceConfigs." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListInstanceConfigsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.instance.v1.ListInstanceConfigsResponse} ListInstanceConfigsResponse - */ - ListInstanceConfigsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.instance.v1.ListInstanceConfigsResponse) - return object; - var message = new $root.google.spanner.admin.instance.v1.ListInstanceConfigsResponse(); - if (object.instanceConfigs) { - if (!Array.isArray(object.instanceConfigs)) - throw TypeError(".google.spanner.admin.instance.v1.ListInstanceConfigsResponse.instanceConfigs: array expected"); - message.instanceConfigs = []; - for (var i = 0; i < object.instanceConfigs.length; ++i) { - if (typeof object.instanceConfigs[i] !== "object") - throw TypeError(".google.spanner.admin.instance.v1.ListInstanceConfigsResponse.instanceConfigs: object expected"); - message.instanceConfigs[i] = $root.google.spanner.admin.instance.v1.InstanceConfig.fromObject(object.instanceConfigs[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListInstanceConfigsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsResponse - * @static - * @param {google.spanner.admin.instance.v1.ListInstanceConfigsResponse} message ListInstanceConfigsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListInstanceConfigsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.instanceConfigs = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.instanceConfigs && message.instanceConfigs.length) { - object.instanceConfigs = []; - for (var j = 0; j < message.instanceConfigs.length; ++j) - object.instanceConfigs[j] = $root.google.spanner.admin.instance.v1.InstanceConfig.toObject(message.instanceConfigs[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListInstanceConfigsResponse to JSON. - * @function toJSON - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsResponse - * @instance - * @returns {Object.} JSON object - */ - ListInstanceConfigsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListInstanceConfigsResponse - * @function getTypeUrl - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListInstanceConfigsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.instance.v1.ListInstanceConfigsResponse"; - }; - - return ListInstanceConfigsResponse; - })(); - - v1.GetInstanceConfigRequest = (function() { - - /** - * Properties of a GetInstanceConfigRequest. - * @memberof google.spanner.admin.instance.v1 - * @interface IGetInstanceConfigRequest - * @property {string|null} [name] GetInstanceConfigRequest name - */ - - /** - * Constructs a new GetInstanceConfigRequest. - * @memberof google.spanner.admin.instance.v1 - * @classdesc Represents a GetInstanceConfigRequest. - * @implements IGetInstanceConfigRequest - * @constructor - * @param {google.spanner.admin.instance.v1.IGetInstanceConfigRequest=} [properties] Properties to set - */ - function GetInstanceConfigRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetInstanceConfigRequest name. - * @member {string} name - * @memberof google.spanner.admin.instance.v1.GetInstanceConfigRequest - * @instance - */ - GetInstanceConfigRequest.prototype.name = ""; - - /** - * Creates a new GetInstanceConfigRequest instance using the specified properties. - * @function create - * @memberof google.spanner.admin.instance.v1.GetInstanceConfigRequest - * @static - * @param {google.spanner.admin.instance.v1.IGetInstanceConfigRequest=} [properties] Properties to set - * @returns {google.spanner.admin.instance.v1.GetInstanceConfigRequest} GetInstanceConfigRequest instance - */ - GetInstanceConfigRequest.create = function create(properties) { - return new GetInstanceConfigRequest(properties); - }; - - /** - * Encodes the specified GetInstanceConfigRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.GetInstanceConfigRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.instance.v1.GetInstanceConfigRequest - * @static - * @param {google.spanner.admin.instance.v1.IGetInstanceConfigRequest} message GetInstanceConfigRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetInstanceConfigRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; - - /** - * Encodes the specified GetInstanceConfigRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.GetInstanceConfigRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.instance.v1.GetInstanceConfigRequest - * @static - * @param {google.spanner.admin.instance.v1.IGetInstanceConfigRequest} message GetInstanceConfigRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetInstanceConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetInstanceConfigRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.instance.v1.GetInstanceConfigRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.instance.v1.GetInstanceConfigRequest} GetInstanceConfigRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetInstanceConfigRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.GetInstanceConfigRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetInstanceConfigRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.instance.v1.GetInstanceConfigRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.instance.v1.GetInstanceConfigRequest} GetInstanceConfigRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetInstanceConfigRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetInstanceConfigRequest message. - * @function verify - * @memberof google.spanner.admin.instance.v1.GetInstanceConfigRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetInstanceConfigRequest.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 GetInstanceConfigRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.instance.v1.GetInstanceConfigRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.instance.v1.GetInstanceConfigRequest} GetInstanceConfigRequest - */ - GetInstanceConfigRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.instance.v1.GetInstanceConfigRequest) - return object; - var message = new $root.google.spanner.admin.instance.v1.GetInstanceConfigRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetInstanceConfigRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.instance.v1.GetInstanceConfigRequest - * @static - * @param {google.spanner.admin.instance.v1.GetInstanceConfigRequest} message GetInstanceConfigRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetInstanceConfigRequest.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 GetInstanceConfigRequest to JSON. - * @function toJSON - * @memberof google.spanner.admin.instance.v1.GetInstanceConfigRequest - * @instance - * @returns {Object.} JSON object - */ - GetInstanceConfigRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetInstanceConfigRequest - * @function getTypeUrl - * @memberof google.spanner.admin.instance.v1.GetInstanceConfigRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetInstanceConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.instance.v1.GetInstanceConfigRequest"; - }; - - return GetInstanceConfigRequest; - })(); - - v1.CreateInstanceConfigRequest = (function() { - - /** - * Properties of a CreateInstanceConfigRequest. - * @memberof google.spanner.admin.instance.v1 - * @interface ICreateInstanceConfigRequest - * @property {string|null} [parent] CreateInstanceConfigRequest parent - * @property {string|null} [instanceConfigId] CreateInstanceConfigRequest instanceConfigId - * @property {google.spanner.admin.instance.v1.IInstanceConfig|null} [instanceConfig] CreateInstanceConfigRequest instanceConfig - * @property {boolean|null} [validateOnly] CreateInstanceConfigRequest validateOnly - */ - - /** - * Constructs a new CreateInstanceConfigRequest. - * @memberof google.spanner.admin.instance.v1 - * @classdesc Represents a CreateInstanceConfigRequest. - * @implements ICreateInstanceConfigRequest - * @constructor - * @param {google.spanner.admin.instance.v1.ICreateInstanceConfigRequest=} [properties] Properties to set - */ - function CreateInstanceConfigRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateInstanceConfigRequest parent. - * @member {string} parent - * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigRequest - * @instance - */ - CreateInstanceConfigRequest.prototype.parent = ""; - - /** - * CreateInstanceConfigRequest instanceConfigId. - * @member {string} instanceConfigId - * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigRequest - * @instance - */ - CreateInstanceConfigRequest.prototype.instanceConfigId = ""; - - /** - * CreateInstanceConfigRequest instanceConfig. - * @member {google.spanner.admin.instance.v1.IInstanceConfig|null|undefined} instanceConfig - * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigRequest - * @instance - */ - CreateInstanceConfigRequest.prototype.instanceConfig = null; - - /** - * CreateInstanceConfigRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigRequest - * @instance - */ - CreateInstanceConfigRequest.prototype.validateOnly = false; - - /** - * Creates a new CreateInstanceConfigRequest instance using the specified properties. - * @function create - * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigRequest - * @static - * @param {google.spanner.admin.instance.v1.ICreateInstanceConfigRequest=} [properties] Properties to set - * @returns {google.spanner.admin.instance.v1.CreateInstanceConfigRequest} CreateInstanceConfigRequest instance - */ - CreateInstanceConfigRequest.create = function create(properties) { - return new CreateInstanceConfigRequest(properties); - }; - - /** - * Encodes the specified CreateInstanceConfigRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.CreateInstanceConfigRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigRequest - * @static - * @param {google.spanner.admin.instance.v1.ICreateInstanceConfigRequest} message CreateInstanceConfigRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateInstanceConfigRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.instanceConfigId != null && Object.hasOwnProperty.call(message, "instanceConfigId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.instanceConfigId); - if (message.instanceConfig != null && Object.hasOwnProperty.call(message, "instanceConfig")) - $root.google.spanner.admin.instance.v1.InstanceConfig.encode(message.instanceConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); - return writer; - }; - - /** - * Encodes the specified CreateInstanceConfigRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.CreateInstanceConfigRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigRequest - * @static - * @param {google.spanner.admin.instance.v1.ICreateInstanceConfigRequest} message CreateInstanceConfigRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateInstanceConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateInstanceConfigRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.instance.v1.CreateInstanceConfigRequest} CreateInstanceConfigRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateInstanceConfigRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.CreateInstanceConfigRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.instanceConfigId = reader.string(); - break; - } - case 3: { - message.instanceConfig = $root.google.spanner.admin.instance.v1.InstanceConfig.decode(reader, reader.uint32()); - break; - } - case 4: { - message.validateOnly = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateInstanceConfigRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.instance.v1.CreateInstanceConfigRequest} CreateInstanceConfigRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateInstanceConfigRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateInstanceConfigRequest message. - * @function verify - * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateInstanceConfigRequest.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.instanceConfigId != null && message.hasOwnProperty("instanceConfigId")) - if (!$util.isString(message.instanceConfigId)) - return "instanceConfigId: string expected"; - if (message.instanceConfig != null && message.hasOwnProperty("instanceConfig")) { - var error = $root.google.spanner.admin.instance.v1.InstanceConfig.verify(message.instanceConfig); - if (error) - return "instanceConfig." + error; - } - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - return null; - }; - - /** - * Creates a CreateInstanceConfigRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.instance.v1.CreateInstanceConfigRequest} CreateInstanceConfigRequest - */ - CreateInstanceConfigRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.instance.v1.CreateInstanceConfigRequest) - return object; - var message = new $root.google.spanner.admin.instance.v1.CreateInstanceConfigRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.instanceConfigId != null) - message.instanceConfigId = String(object.instanceConfigId); - if (object.instanceConfig != null) { - if (typeof object.instanceConfig !== "object") - throw TypeError(".google.spanner.admin.instance.v1.CreateInstanceConfigRequest.instanceConfig: object expected"); - message.instanceConfig = $root.google.spanner.admin.instance.v1.InstanceConfig.fromObject(object.instanceConfig); - } - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - return message; - }; - - /** - * Creates a plain object from a CreateInstanceConfigRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigRequest - * @static - * @param {google.spanner.admin.instance.v1.CreateInstanceConfigRequest} message CreateInstanceConfigRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateInstanceConfigRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.instanceConfigId = ""; - object.instanceConfig = null; - object.validateOnly = false; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.instanceConfigId != null && message.hasOwnProperty("instanceConfigId")) - object.instanceConfigId = message.instanceConfigId; - if (message.instanceConfig != null && message.hasOwnProperty("instanceConfig")) - object.instanceConfig = $root.google.spanner.admin.instance.v1.InstanceConfig.toObject(message.instanceConfig, options); - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - return object; - }; - - /** - * Converts this CreateInstanceConfigRequest to JSON. - * @function toJSON - * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigRequest - * @instance - * @returns {Object.} JSON object - */ - CreateInstanceConfigRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateInstanceConfigRequest - * @function getTypeUrl - * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateInstanceConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.instance.v1.CreateInstanceConfigRequest"; - }; - - return CreateInstanceConfigRequest; - })(); - - v1.UpdateInstanceConfigRequest = (function() { - - /** - * Properties of an UpdateInstanceConfigRequest. - * @memberof google.spanner.admin.instance.v1 - * @interface IUpdateInstanceConfigRequest - * @property {google.spanner.admin.instance.v1.IInstanceConfig|null} [instanceConfig] UpdateInstanceConfigRequest instanceConfig - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateInstanceConfigRequest updateMask - * @property {boolean|null} [validateOnly] UpdateInstanceConfigRequest validateOnly - */ - - /** - * Constructs a new UpdateInstanceConfigRequest. - * @memberof google.spanner.admin.instance.v1 - * @classdesc Represents an UpdateInstanceConfigRequest. - * @implements IUpdateInstanceConfigRequest - * @constructor - * @param {google.spanner.admin.instance.v1.IUpdateInstanceConfigRequest=} [properties] Properties to set - */ - function UpdateInstanceConfigRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateInstanceConfigRequest instanceConfig. - * @member {google.spanner.admin.instance.v1.IInstanceConfig|null|undefined} instanceConfig - * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigRequest - * @instance - */ - UpdateInstanceConfigRequest.prototype.instanceConfig = null; - - /** - * UpdateInstanceConfigRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigRequest - * @instance - */ - UpdateInstanceConfigRequest.prototype.updateMask = null; - - /** - * UpdateInstanceConfigRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigRequest - * @instance - */ - UpdateInstanceConfigRequest.prototype.validateOnly = false; - - /** - * Creates a new UpdateInstanceConfigRequest instance using the specified properties. - * @function create - * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigRequest - * @static - * @param {google.spanner.admin.instance.v1.IUpdateInstanceConfigRequest=} [properties] Properties to set - * @returns {google.spanner.admin.instance.v1.UpdateInstanceConfigRequest} UpdateInstanceConfigRequest instance - */ - UpdateInstanceConfigRequest.create = function create(properties) { - return new UpdateInstanceConfigRequest(properties); - }; - - /** - * Encodes the specified UpdateInstanceConfigRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.UpdateInstanceConfigRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigRequest - * @static - * @param {google.spanner.admin.instance.v1.IUpdateInstanceConfigRequest} message UpdateInstanceConfigRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateInstanceConfigRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.instanceConfig != null && Object.hasOwnProperty.call(message, "instanceConfig")) - $root.google.spanner.admin.instance.v1.InstanceConfig.encode(message.instanceConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); - return writer; - }; - - /** - * Encodes the specified UpdateInstanceConfigRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.UpdateInstanceConfigRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigRequest - * @static - * @param {google.spanner.admin.instance.v1.IUpdateInstanceConfigRequest} message UpdateInstanceConfigRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateInstanceConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateInstanceConfigRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.instance.v1.UpdateInstanceConfigRequest} UpdateInstanceConfigRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateInstanceConfigRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.UpdateInstanceConfigRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.instanceConfig = $root.google.spanner.admin.instance.v1.InstanceConfig.decode(reader, reader.uint32()); - break; - } - case 2: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - case 3: { - message.validateOnly = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateInstanceConfigRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.instance.v1.UpdateInstanceConfigRequest} UpdateInstanceConfigRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateInstanceConfigRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateInstanceConfigRequest message. - * @function verify - * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateInstanceConfigRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.instanceConfig != null && message.hasOwnProperty("instanceConfig")) { - var error = $root.google.spanner.admin.instance.v1.InstanceConfig.verify(message.instanceConfig); - if (error) - return "instanceConfig." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - return null; - }; - - /** - * Creates an UpdateInstanceConfigRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.instance.v1.UpdateInstanceConfigRequest} UpdateInstanceConfigRequest - */ - UpdateInstanceConfigRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.instance.v1.UpdateInstanceConfigRequest) - return object; - var message = new $root.google.spanner.admin.instance.v1.UpdateInstanceConfigRequest(); - if (object.instanceConfig != null) { - if (typeof object.instanceConfig !== "object") - throw TypeError(".google.spanner.admin.instance.v1.UpdateInstanceConfigRequest.instanceConfig: object expected"); - message.instanceConfig = $root.google.spanner.admin.instance.v1.InstanceConfig.fromObject(object.instanceConfig); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.spanner.admin.instance.v1.UpdateInstanceConfigRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - return message; - }; - - /** - * Creates a plain object from an UpdateInstanceConfigRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigRequest - * @static - * @param {google.spanner.admin.instance.v1.UpdateInstanceConfigRequest} message UpdateInstanceConfigRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateInstanceConfigRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.instanceConfig = null; - object.updateMask = null; - object.validateOnly = false; - } - if (message.instanceConfig != null && message.hasOwnProperty("instanceConfig")) - object.instanceConfig = $root.google.spanner.admin.instance.v1.InstanceConfig.toObject(message.instanceConfig, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - return object; - }; - - /** - * Converts this UpdateInstanceConfigRequest to JSON. - * @function toJSON - * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateInstanceConfigRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateInstanceConfigRequest - * @function getTypeUrl - * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateInstanceConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.instance.v1.UpdateInstanceConfigRequest"; - }; - - return UpdateInstanceConfigRequest; - })(); - - v1.DeleteInstanceConfigRequest = (function() { - - /** - * Properties of a DeleteInstanceConfigRequest. - * @memberof google.spanner.admin.instance.v1 - * @interface IDeleteInstanceConfigRequest - * @property {string|null} [name] DeleteInstanceConfigRequest name - * @property {string|null} [etag] DeleteInstanceConfigRequest etag - * @property {boolean|null} [validateOnly] DeleteInstanceConfigRequest validateOnly - */ - - /** - * Constructs a new DeleteInstanceConfigRequest. - * @memberof google.spanner.admin.instance.v1 - * @classdesc Represents a DeleteInstanceConfigRequest. - * @implements IDeleteInstanceConfigRequest - * @constructor - * @param {google.spanner.admin.instance.v1.IDeleteInstanceConfigRequest=} [properties] Properties to set - */ - function DeleteInstanceConfigRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteInstanceConfigRequest name. - * @member {string} name - * @memberof google.spanner.admin.instance.v1.DeleteInstanceConfigRequest - * @instance - */ - DeleteInstanceConfigRequest.prototype.name = ""; - - /** - * DeleteInstanceConfigRequest etag. - * @member {string} etag - * @memberof google.spanner.admin.instance.v1.DeleteInstanceConfigRequest - * @instance - */ - DeleteInstanceConfigRequest.prototype.etag = ""; - - /** - * DeleteInstanceConfigRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.spanner.admin.instance.v1.DeleteInstanceConfigRequest - * @instance - */ - DeleteInstanceConfigRequest.prototype.validateOnly = false; - - /** - * Creates a new DeleteInstanceConfigRequest instance using the specified properties. - * @function create - * @memberof google.spanner.admin.instance.v1.DeleteInstanceConfigRequest - * @static - * @param {google.spanner.admin.instance.v1.IDeleteInstanceConfigRequest=} [properties] Properties to set - * @returns {google.spanner.admin.instance.v1.DeleteInstanceConfigRequest} DeleteInstanceConfigRequest instance - */ - DeleteInstanceConfigRequest.create = function create(properties) { - return new DeleteInstanceConfigRequest(properties); - }; - - /** - * Encodes the specified DeleteInstanceConfigRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.DeleteInstanceConfigRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.instance.v1.DeleteInstanceConfigRequest - * @static - * @param {google.spanner.admin.instance.v1.IDeleteInstanceConfigRequest} message DeleteInstanceConfigRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteInstanceConfigRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.etag); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); - return writer; - }; - - /** - * Encodes the specified DeleteInstanceConfigRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.DeleteInstanceConfigRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.instance.v1.DeleteInstanceConfigRequest - * @static - * @param {google.spanner.admin.instance.v1.IDeleteInstanceConfigRequest} message DeleteInstanceConfigRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteInstanceConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteInstanceConfigRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.instance.v1.DeleteInstanceConfigRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.instance.v1.DeleteInstanceConfigRequest} DeleteInstanceConfigRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteInstanceConfigRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.DeleteInstanceConfigRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.etag = reader.string(); - break; - } - case 3: { - message.validateOnly = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteInstanceConfigRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.instance.v1.DeleteInstanceConfigRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.instance.v1.DeleteInstanceConfigRequest} DeleteInstanceConfigRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteInstanceConfigRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteInstanceConfigRequest message. - * @function verify - * @memberof google.spanner.admin.instance.v1.DeleteInstanceConfigRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteInstanceConfigRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - return null; - }; - - /** - * Creates a DeleteInstanceConfigRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.instance.v1.DeleteInstanceConfigRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.instance.v1.DeleteInstanceConfigRequest} DeleteInstanceConfigRequest - */ - DeleteInstanceConfigRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.instance.v1.DeleteInstanceConfigRequest) - return object; - var message = new $root.google.spanner.admin.instance.v1.DeleteInstanceConfigRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.etag != null) - message.etag = String(object.etag); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - return message; - }; - - /** - * Creates a plain object from a DeleteInstanceConfigRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.instance.v1.DeleteInstanceConfigRequest - * @static - * @param {google.spanner.admin.instance.v1.DeleteInstanceConfigRequest} message DeleteInstanceConfigRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteInstanceConfigRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.etag = ""; - object.validateOnly = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - return object; - }; - - /** - * Converts this DeleteInstanceConfigRequest to JSON. - * @function toJSON - * @memberof google.spanner.admin.instance.v1.DeleteInstanceConfigRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteInstanceConfigRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteInstanceConfigRequest - * @function getTypeUrl - * @memberof google.spanner.admin.instance.v1.DeleteInstanceConfigRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteInstanceConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.instance.v1.DeleteInstanceConfigRequest"; - }; - - return DeleteInstanceConfigRequest; - })(); - - v1.ListInstanceConfigOperationsRequest = (function() { - - /** - * Properties of a ListInstanceConfigOperationsRequest. - * @memberof google.spanner.admin.instance.v1 - * @interface IListInstanceConfigOperationsRequest - * @property {string|null} [parent] ListInstanceConfigOperationsRequest parent - * @property {string|null} [filter] ListInstanceConfigOperationsRequest filter - * @property {number|null} [pageSize] ListInstanceConfigOperationsRequest pageSize - * @property {string|null} [pageToken] ListInstanceConfigOperationsRequest pageToken - */ - - /** - * Constructs a new ListInstanceConfigOperationsRequest. - * @memberof google.spanner.admin.instance.v1 - * @classdesc Represents a ListInstanceConfigOperationsRequest. - * @implements IListInstanceConfigOperationsRequest - * @constructor - * @param {google.spanner.admin.instance.v1.IListInstanceConfigOperationsRequest=} [properties] Properties to set - */ - function ListInstanceConfigOperationsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListInstanceConfigOperationsRequest parent. - * @member {string} parent - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest - * @instance - */ - ListInstanceConfigOperationsRequest.prototype.parent = ""; - - /** - * ListInstanceConfigOperationsRequest filter. - * @member {string} filter - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest - * @instance - */ - ListInstanceConfigOperationsRequest.prototype.filter = ""; - - /** - * ListInstanceConfigOperationsRequest pageSize. - * @member {number} pageSize - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest - * @instance - */ - ListInstanceConfigOperationsRequest.prototype.pageSize = 0; - - /** - * ListInstanceConfigOperationsRequest pageToken. - * @member {string} pageToken - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest - * @instance - */ - ListInstanceConfigOperationsRequest.prototype.pageToken = ""; - - /** - * Creates a new ListInstanceConfigOperationsRequest instance using the specified properties. - * @function create - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest - * @static - * @param {google.spanner.admin.instance.v1.IListInstanceConfigOperationsRequest=} [properties] Properties to set - * @returns {google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest} ListInstanceConfigOperationsRequest instance - */ - ListInstanceConfigOperationsRequest.create = function create(properties) { - return new ListInstanceConfigOperationsRequest(properties); - }; - - /** - * Encodes the specified ListInstanceConfigOperationsRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest - * @static - * @param {google.spanner.admin.instance.v1.IListInstanceConfigOperationsRequest} message ListInstanceConfigOperationsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListInstanceConfigOperationsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); - return writer; - }; - - /** - * Encodes the specified ListInstanceConfigOperationsRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest - * @static - * @param {google.spanner.admin.instance.v1.IListInstanceConfigOperationsRequest} message ListInstanceConfigOperationsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListInstanceConfigOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListInstanceConfigOperationsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest} ListInstanceConfigOperationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListInstanceConfigOperationsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.filter = reader.string(); - break; - } - case 3: { - message.pageSize = reader.int32(); - break; - } - case 4: { - message.pageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListInstanceConfigOperationsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest} ListInstanceConfigOperationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListInstanceConfigOperationsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListInstanceConfigOperationsRequest message. - * @function verify - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListInstanceConfigOperationsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.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 ListInstanceConfigOperationsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest} ListInstanceConfigOperationsRequest - */ - ListInstanceConfigOperationsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest) - return object; - var message = new $root.google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.filter != null) - message.filter = String(object.filter); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - return message; - }; - - /** - * Creates a plain object from a ListInstanceConfigOperationsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest - * @static - * @param {google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest} message ListInstanceConfigOperationsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListInstanceConfigOperationsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.filter = ""; - object.pageSize = 0; - object.pageToken = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - return object; - }; - - /** - * Converts this ListInstanceConfigOperationsRequest to JSON. - * @function toJSON - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest - * @instance - * @returns {Object.} JSON object - */ - ListInstanceConfigOperationsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListInstanceConfigOperationsRequest - * @function getTypeUrl - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListInstanceConfigOperationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest"; - }; - - return ListInstanceConfigOperationsRequest; - })(); - - v1.ListInstanceConfigOperationsResponse = (function() { - - /** - * Properties of a ListInstanceConfigOperationsResponse. - * @memberof google.spanner.admin.instance.v1 - * @interface IListInstanceConfigOperationsResponse - * @property {Array.|null} [operations] ListInstanceConfigOperationsResponse operations - * @property {string|null} [nextPageToken] ListInstanceConfigOperationsResponse nextPageToken - */ - - /** - * Constructs a new ListInstanceConfigOperationsResponse. - * @memberof google.spanner.admin.instance.v1 - * @classdesc Represents a ListInstanceConfigOperationsResponse. - * @implements IListInstanceConfigOperationsResponse - * @constructor - * @param {google.spanner.admin.instance.v1.IListInstanceConfigOperationsResponse=} [properties] Properties to set - */ - function ListInstanceConfigOperationsResponse(properties) { - this.operations = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListInstanceConfigOperationsResponse operations. - * @member {Array.} operations - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse - * @instance - */ - ListInstanceConfigOperationsResponse.prototype.operations = $util.emptyArray; - - /** - * ListInstanceConfigOperationsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse - * @instance - */ - ListInstanceConfigOperationsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListInstanceConfigOperationsResponse instance using the specified properties. - * @function create - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse - * @static - * @param {google.spanner.admin.instance.v1.IListInstanceConfigOperationsResponse=} [properties] Properties to set - * @returns {google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse} ListInstanceConfigOperationsResponse instance - */ - ListInstanceConfigOperationsResponse.create = function create(properties) { - return new ListInstanceConfigOperationsResponse(properties); - }; - - /** - * Encodes the specified ListInstanceConfigOperationsResponse message. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse - * @static - * @param {google.spanner.admin.instance.v1.IListInstanceConfigOperationsResponse} message ListInstanceConfigOperationsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListInstanceConfigOperationsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.operations != null && message.operations.length) - for (var i = 0; i < message.operations.length; ++i) - $root.google.longrunning.Operation.encode(message.operations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - return writer; - }; - - /** - * Encodes the specified ListInstanceConfigOperationsResponse message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse - * @static - * @param {google.spanner.admin.instance.v1.IListInstanceConfigOperationsResponse} message ListInstanceConfigOperationsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListInstanceConfigOperationsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListInstanceConfigOperationsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse} ListInstanceConfigOperationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListInstanceConfigOperationsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.operations && message.operations.length)) - message.operations = []; - message.operations.push($root.google.longrunning.Operation.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListInstanceConfigOperationsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse} ListInstanceConfigOperationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListInstanceConfigOperationsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListInstanceConfigOperationsResponse message. - * @function verify - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListInstanceConfigOperationsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.operations != null && message.hasOwnProperty("operations")) { - if (!Array.isArray(message.operations)) - return "operations: array expected"; - for (var i = 0; i < message.operations.length; ++i) { - var error = $root.google.longrunning.Operation.verify(message.operations[i]); - if (error) - return "operations." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListInstanceConfigOperationsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse} ListInstanceConfigOperationsResponse - */ - ListInstanceConfigOperationsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse) - return object; - var message = new $root.google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse(); - if (object.operations) { - if (!Array.isArray(object.operations)) - throw TypeError(".google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse.operations: array expected"); - message.operations = []; - for (var i = 0; i < object.operations.length; ++i) { - if (typeof object.operations[i] !== "object") - throw TypeError(".google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse.operations: object expected"); - message.operations[i] = $root.google.longrunning.Operation.fromObject(object.operations[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListInstanceConfigOperationsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse - * @static - * @param {google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse} message ListInstanceConfigOperationsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListInstanceConfigOperationsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.operations = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.operations && message.operations.length) { - object.operations = []; - for (var j = 0; j < message.operations.length; ++j) - object.operations[j] = $root.google.longrunning.Operation.toObject(message.operations[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListInstanceConfigOperationsResponse to JSON. - * @function toJSON - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse - * @instance - * @returns {Object.} JSON object - */ - ListInstanceConfigOperationsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListInstanceConfigOperationsResponse - * @function getTypeUrl - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListInstanceConfigOperationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse"; - }; - - return ListInstanceConfigOperationsResponse; - })(); - - v1.GetInstanceRequest = (function() { - - /** - * Properties of a GetInstanceRequest. - * @memberof google.spanner.admin.instance.v1 - * @interface IGetInstanceRequest - * @property {string|null} [name] GetInstanceRequest name - * @property {google.protobuf.IFieldMask|null} [fieldMask] GetInstanceRequest fieldMask - */ - - /** - * Constructs a new GetInstanceRequest. - * @memberof google.spanner.admin.instance.v1 - * @classdesc Represents a GetInstanceRequest. - * @implements IGetInstanceRequest - * @constructor - * @param {google.spanner.admin.instance.v1.IGetInstanceRequest=} [properties] Properties to set - */ - function GetInstanceRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetInstanceRequest name. - * @member {string} name - * @memberof google.spanner.admin.instance.v1.GetInstanceRequest - * @instance - */ - GetInstanceRequest.prototype.name = ""; - - /** - * GetInstanceRequest fieldMask. - * @member {google.protobuf.IFieldMask|null|undefined} fieldMask - * @memberof google.spanner.admin.instance.v1.GetInstanceRequest - * @instance - */ - GetInstanceRequest.prototype.fieldMask = null; - - /** - * Creates a new GetInstanceRequest instance using the specified properties. - * @function create - * @memberof google.spanner.admin.instance.v1.GetInstanceRequest - * @static - * @param {google.spanner.admin.instance.v1.IGetInstanceRequest=} [properties] Properties to set - * @returns {google.spanner.admin.instance.v1.GetInstanceRequest} GetInstanceRequest instance - */ - GetInstanceRequest.create = function create(properties) { - return new GetInstanceRequest(properties); - }; - - /** - * Encodes the specified GetInstanceRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.GetInstanceRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.instance.v1.GetInstanceRequest - * @static - * @param {google.spanner.admin.instance.v1.IGetInstanceRequest} message GetInstanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetInstanceRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.fieldMask != null && Object.hasOwnProperty.call(message, "fieldMask")) - $root.google.protobuf.FieldMask.encode(message.fieldMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetInstanceRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.GetInstanceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.instance.v1.GetInstanceRequest - * @static - * @param {google.spanner.admin.instance.v1.IGetInstanceRequest} message GetInstanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetInstanceRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.instance.v1.GetInstanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.instance.v1.GetInstanceRequest} GetInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetInstanceRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.GetInstanceRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.fieldMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - 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.spanner.admin.instance.v1.GetInstanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.instance.v1.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.spanner.admin.instance.v1.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"; - if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.fieldMask); - if (error) - return "fieldMask." + error; - } - return null; - }; - - /** - * Creates a GetInstanceRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.instance.v1.GetInstanceRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.instance.v1.GetInstanceRequest} GetInstanceRequest - */ - GetInstanceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.instance.v1.GetInstanceRequest) - return object; - var message = new $root.google.spanner.admin.instance.v1.GetInstanceRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.fieldMask != null) { - if (typeof object.fieldMask !== "object") - throw TypeError(".google.spanner.admin.instance.v1.GetInstanceRequest.fieldMask: object expected"); - message.fieldMask = $root.google.protobuf.FieldMask.fromObject(object.fieldMask); - } - return message; - }; - - /** - * Creates a plain object from a GetInstanceRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.instance.v1.GetInstanceRequest - * @static - * @param {google.spanner.admin.instance.v1.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 = ""; - object.fieldMask = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) - object.fieldMask = $root.google.protobuf.FieldMask.toObject(message.fieldMask, options); - return object; - }; - - /** - * Converts this GetInstanceRequest to JSON. - * @function toJSON - * @memberof google.spanner.admin.instance.v1.GetInstanceRequest - * @instance - * @returns {Object.} JSON object - */ - GetInstanceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetInstanceRequest - * @function getTypeUrl - * @memberof google.spanner.admin.instance.v1.GetInstanceRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.instance.v1.GetInstanceRequest"; - }; - - return GetInstanceRequest; - })(); - - v1.CreateInstanceRequest = (function() { - - /** - * Properties of a CreateInstanceRequest. - * @memberof google.spanner.admin.instance.v1 - * @interface ICreateInstanceRequest - * @property {string|null} [parent] CreateInstanceRequest parent - * @property {string|null} [instanceId] CreateInstanceRequest instanceId - * @property {google.spanner.admin.instance.v1.IInstance|null} [instance] CreateInstanceRequest instance - */ - - /** - * Constructs a new CreateInstanceRequest. - * @memberof google.spanner.admin.instance.v1 - * @classdesc Represents a CreateInstanceRequest. - * @implements ICreateInstanceRequest - * @constructor - * @param {google.spanner.admin.instance.v1.ICreateInstanceRequest=} [properties] Properties to set - */ - function CreateInstanceRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateInstanceRequest parent. - * @member {string} parent - * @memberof google.spanner.admin.instance.v1.CreateInstanceRequest - * @instance - */ - CreateInstanceRequest.prototype.parent = ""; - - /** - * CreateInstanceRequest instanceId. - * @member {string} instanceId - * @memberof google.spanner.admin.instance.v1.CreateInstanceRequest - * @instance - */ - CreateInstanceRequest.prototype.instanceId = ""; - - /** - * CreateInstanceRequest instance. - * @member {google.spanner.admin.instance.v1.IInstance|null|undefined} instance - * @memberof google.spanner.admin.instance.v1.CreateInstanceRequest - * @instance - */ - CreateInstanceRequest.prototype.instance = null; - - /** - * Creates a new CreateInstanceRequest instance using the specified properties. - * @function create - * @memberof google.spanner.admin.instance.v1.CreateInstanceRequest - * @static - * @param {google.spanner.admin.instance.v1.ICreateInstanceRequest=} [properties] Properties to set - * @returns {google.spanner.admin.instance.v1.CreateInstanceRequest} CreateInstanceRequest instance - */ - CreateInstanceRequest.create = function create(properties) { - return new CreateInstanceRequest(properties); - }; - - /** - * Encodes the specified CreateInstanceRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.CreateInstanceRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.instance.v1.CreateInstanceRequest - * @static - * @param {google.spanner.admin.instance.v1.ICreateInstanceRequest} message CreateInstanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateInstanceRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.instanceId); - if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) - $root.google.spanner.admin.instance.v1.Instance.encode(message.instance, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CreateInstanceRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.CreateInstanceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.instance.v1.CreateInstanceRequest - * @static - * @param {google.spanner.admin.instance.v1.ICreateInstanceRequest} message CreateInstanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateInstanceRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.instance.v1.CreateInstanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.instance.v1.CreateInstanceRequest} CreateInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateInstanceRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.CreateInstanceRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.instanceId = reader.string(); - break; - } - case 3: { - message.instance = $root.google.spanner.admin.instance.v1.Instance.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateInstanceRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.instance.v1.CreateInstanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.instance.v1.CreateInstanceRequest} CreateInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateInstanceRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateInstanceRequest message. - * @function verify - * @memberof google.spanner.admin.instance.v1.CreateInstanceRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateInstanceRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.instanceId != null && message.hasOwnProperty("instanceId")) - if (!$util.isString(message.instanceId)) - return "instanceId: string expected"; - if (message.instance != null && message.hasOwnProperty("instance")) { - var error = $root.google.spanner.admin.instance.v1.Instance.verify(message.instance); - if (error) - return "instance." + error; - } - return null; - }; - - /** - * Creates a CreateInstanceRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.instance.v1.CreateInstanceRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.instance.v1.CreateInstanceRequest} CreateInstanceRequest - */ - CreateInstanceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.instance.v1.CreateInstanceRequest) - return object; - var message = new $root.google.spanner.admin.instance.v1.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.spanner.admin.instance.v1.CreateInstanceRequest.instance: object expected"); - message.instance = $root.google.spanner.admin.instance.v1.Instance.fromObject(object.instance); - } - return message; - }; - - /** - * Creates a plain object from a CreateInstanceRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.instance.v1.CreateInstanceRequest - * @static - * @param {google.spanner.admin.instance.v1.CreateInstanceRequest} message CreateInstanceRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateInstanceRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.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.spanner.admin.instance.v1.Instance.toObject(message.instance, options); - return object; - }; - - /** - * Converts this CreateInstanceRequest to JSON. - * @function toJSON - * @memberof google.spanner.admin.instance.v1.CreateInstanceRequest - * @instance - * @returns {Object.} JSON object - */ - CreateInstanceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateInstanceRequest - * @function getTypeUrl - * @memberof google.spanner.admin.instance.v1.CreateInstanceRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.instance.v1.CreateInstanceRequest"; - }; - - return CreateInstanceRequest; - })(); - - v1.ListInstancesRequest = (function() { - - /** - * Properties of a ListInstancesRequest. - * @memberof google.spanner.admin.instance.v1 - * @interface IListInstancesRequest - * @property {string|null} [parent] ListInstancesRequest parent - * @property {number|null} [pageSize] ListInstancesRequest pageSize - * @property {string|null} [pageToken] ListInstancesRequest pageToken - * @property {string|null} [filter] ListInstancesRequest filter - * @property {google.protobuf.ITimestamp|null} [instanceDeadline] ListInstancesRequest instanceDeadline - */ - - /** - * Constructs a new ListInstancesRequest. - * @memberof google.spanner.admin.instance.v1 - * @classdesc Represents a ListInstancesRequest. - * @implements IListInstancesRequest - * @constructor - * @param {google.spanner.admin.instance.v1.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.spanner.admin.instance.v1.ListInstancesRequest - * @instance - */ - ListInstancesRequest.prototype.parent = ""; - - /** - * ListInstancesRequest pageSize. - * @member {number} pageSize - * @memberof google.spanner.admin.instance.v1.ListInstancesRequest - * @instance - */ - ListInstancesRequest.prototype.pageSize = 0; - - /** - * ListInstancesRequest pageToken. - * @member {string} pageToken - * @memberof google.spanner.admin.instance.v1.ListInstancesRequest - * @instance - */ - ListInstancesRequest.prototype.pageToken = ""; - - /** - * ListInstancesRequest filter. - * @member {string} filter - * @memberof google.spanner.admin.instance.v1.ListInstancesRequest - * @instance - */ - ListInstancesRequest.prototype.filter = ""; - - /** - * ListInstancesRequest instanceDeadline. - * @member {google.protobuf.ITimestamp|null|undefined} instanceDeadline - * @memberof google.spanner.admin.instance.v1.ListInstancesRequest - * @instance - */ - ListInstancesRequest.prototype.instanceDeadline = null; - - /** - * Creates a new ListInstancesRequest instance using the specified properties. - * @function create - * @memberof google.spanner.admin.instance.v1.ListInstancesRequest - * @static - * @param {google.spanner.admin.instance.v1.IListInstancesRequest=} [properties] Properties to set - * @returns {google.spanner.admin.instance.v1.ListInstancesRequest} ListInstancesRequest instance - */ - ListInstancesRequest.create = function create(properties) { - return new ListInstancesRequest(properties); - }; - - /** - * Encodes the specified ListInstancesRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancesRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.instance.v1.ListInstancesRequest - * @static - * @param {google.spanner.admin.instance.v1.IListInstancesRequest} message ListInstancesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListInstancesRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); - if (message.instanceDeadline != null && Object.hasOwnProperty.call(message, "instanceDeadline")) - $root.google.protobuf.Timestamp.encode(message.instanceDeadline, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ListInstancesRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.instance.v1.ListInstancesRequest - * @static - * @param {google.spanner.admin.instance.v1.IListInstancesRequest} message ListInstancesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListInstancesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListInstancesRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.instance.v1.ListInstancesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.instance.v1.ListInstancesRequest} ListInstancesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListInstancesRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.ListInstancesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - case 4: { - message.filter = reader.string(); - break; - } - case 5: { - message.instanceDeadline = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListInstancesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.instance.v1.ListInstancesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.instance.v1.ListInstancesRequest} ListInstancesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListInstancesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListInstancesRequest message. - * @function verify - * @memberof google.spanner.admin.instance.v1.ListInstancesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListInstancesRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.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.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.instanceDeadline != null && message.hasOwnProperty("instanceDeadline")) { - var error = $root.google.protobuf.Timestamp.verify(message.instanceDeadline); - if (error) - return "instanceDeadline." + error; - } - return null; - }; - - /** - * Creates a ListInstancesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.instance.v1.ListInstancesRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.instance.v1.ListInstancesRequest} ListInstancesRequest - */ - ListInstancesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.instance.v1.ListInstancesRequest) - return object; - var message = new $root.google.spanner.admin.instance.v1.ListInstancesRequest(); - 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); - if (object.filter != null) - message.filter = String(object.filter); - if (object.instanceDeadline != null) { - if (typeof object.instanceDeadline !== "object") - throw TypeError(".google.spanner.admin.instance.v1.ListInstancesRequest.instanceDeadline: object expected"); - message.instanceDeadline = $root.google.protobuf.Timestamp.fromObject(object.instanceDeadline); - } - return message; - }; - - /** - * Creates a plain object from a ListInstancesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.instance.v1.ListInstancesRequest - * @static - * @param {google.spanner.admin.instance.v1.ListInstancesRequest} message ListInstancesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListInstancesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.filter = ""; - object.instanceDeadline = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.instanceDeadline != null && message.hasOwnProperty("instanceDeadline")) - object.instanceDeadline = $root.google.protobuf.Timestamp.toObject(message.instanceDeadline, options); - return object; - }; - - /** - * Converts this ListInstancesRequest to JSON. - * @function toJSON - * @memberof google.spanner.admin.instance.v1.ListInstancesRequest - * @instance - * @returns {Object.} JSON object - */ - ListInstancesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListInstancesRequest - * @function getTypeUrl - * @memberof google.spanner.admin.instance.v1.ListInstancesRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListInstancesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.instance.v1.ListInstancesRequest"; - }; - - return ListInstancesRequest; - })(); - - v1.ListInstancesResponse = (function() { - - /** - * Properties of a ListInstancesResponse. - * @memberof google.spanner.admin.instance.v1 - * @interface IListInstancesResponse - * @property {Array.|null} [instances] ListInstancesResponse instances - * @property {string|null} [nextPageToken] ListInstancesResponse nextPageToken - * @property {Array.|null} [unreachable] ListInstancesResponse unreachable - */ - - /** - * Constructs a new ListInstancesResponse. - * @memberof google.spanner.admin.instance.v1 - * @classdesc Represents a ListInstancesResponse. - * @implements IListInstancesResponse - * @constructor - * @param {google.spanner.admin.instance.v1.IListInstancesResponse=} [properties] Properties to set - */ - function ListInstancesResponse(properties) { - this.instances = []; - this.unreachable = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListInstancesResponse instances. - * @member {Array.} instances - * @memberof google.spanner.admin.instance.v1.ListInstancesResponse - * @instance - */ - ListInstancesResponse.prototype.instances = $util.emptyArray; - - /** - * ListInstancesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.spanner.admin.instance.v1.ListInstancesResponse - * @instance - */ - ListInstancesResponse.prototype.nextPageToken = ""; - - /** - * ListInstancesResponse unreachable. - * @member {Array.} unreachable - * @memberof google.spanner.admin.instance.v1.ListInstancesResponse - * @instance - */ - ListInstancesResponse.prototype.unreachable = $util.emptyArray; - - /** - * Creates a new ListInstancesResponse instance using the specified properties. - * @function create - * @memberof google.spanner.admin.instance.v1.ListInstancesResponse - * @static - * @param {google.spanner.admin.instance.v1.IListInstancesResponse=} [properties] Properties to set - * @returns {google.spanner.admin.instance.v1.ListInstancesResponse} ListInstancesResponse instance - */ - ListInstancesResponse.create = function create(properties) { - return new ListInstancesResponse(properties); - }; - - /** - * Encodes the specified ListInstancesResponse message. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancesResponse.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.instance.v1.ListInstancesResponse - * @static - * @param {google.spanner.admin.instance.v1.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.spanner.admin.instance.v1.Instance.encode(message.instances[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - if (message.unreachable != null && message.unreachable.length) - for (var i = 0; i < message.unreachable.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); - return writer; - }; - - /** - * Encodes the specified ListInstancesResponse message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.instance.v1.ListInstancesResponse - * @static - * @param {google.spanner.admin.instance.v1.IListInstancesResponse} message ListInstancesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListInstancesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListInstancesResponse message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.instance.v1.ListInstancesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.instance.v1.ListInstancesResponse} ListInstancesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListInstancesResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.ListInstancesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.instances && message.instances.length)) - message.instances = []; - message.instances.push($root.google.spanner.admin.instance.v1.Instance.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - case 3: { - if (!(message.unreachable && message.unreachable.length)) - message.unreachable = []; - message.unreachable.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListInstancesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.instance.v1.ListInstancesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.instance.v1.ListInstancesResponse} ListInstancesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListInstancesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListInstancesResponse message. - * @function verify - * @memberof google.spanner.admin.instance.v1.ListInstancesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListInstancesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.instances != null && message.hasOwnProperty("instances")) { - if (!Array.isArray(message.instances)) - return "instances: array expected"; - for (var i = 0; i < message.instances.length; ++i) { - var error = $root.google.spanner.admin.instance.v1.Instance.verify(message.instances[i]); - if (error) - return "instances." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - if (message.unreachable != null && message.hasOwnProperty("unreachable")) { - if (!Array.isArray(message.unreachable)) - return "unreachable: array expected"; - for (var i = 0; i < message.unreachable.length; ++i) - if (!$util.isString(message.unreachable[i])) - return "unreachable: string[] expected"; - } - return null; - }; - - /** - * Creates a ListInstancesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.instance.v1.ListInstancesResponse - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.instance.v1.ListInstancesResponse} ListInstancesResponse - */ - ListInstancesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.instance.v1.ListInstancesResponse) - return object; - var message = new $root.google.spanner.admin.instance.v1.ListInstancesResponse(); - if (object.instances) { - if (!Array.isArray(object.instances)) - throw TypeError(".google.spanner.admin.instance.v1.ListInstancesResponse.instances: array expected"); - message.instances = []; - for (var i = 0; i < object.instances.length; ++i) { - if (typeof object.instances[i] !== "object") - throw TypeError(".google.spanner.admin.instance.v1.ListInstancesResponse.instances: object expected"); - message.instances[i] = $root.google.spanner.admin.instance.v1.Instance.fromObject(object.instances[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.unreachable) { - if (!Array.isArray(object.unreachable)) - throw TypeError(".google.spanner.admin.instance.v1.ListInstancesResponse.unreachable: array expected"); - message.unreachable = []; - for (var i = 0; i < object.unreachable.length; ++i) - message.unreachable[i] = String(object.unreachable[i]); - } - return message; - }; - - /** - * Creates a plain object from a ListInstancesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.instance.v1.ListInstancesResponse - * @static - * @param {google.spanner.admin.instance.v1.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.unreachable = []; - } - 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.spanner.admin.instance.v1.Instance.toObject(message.instances[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - if (message.unreachable && message.unreachable.length) { - object.unreachable = []; - for (var j = 0; j < message.unreachable.length; ++j) - object.unreachable[j] = message.unreachable[j]; - } - return object; - }; - - /** - * Converts this ListInstancesResponse to JSON. - * @function toJSON - * @memberof google.spanner.admin.instance.v1.ListInstancesResponse - * @instance - * @returns {Object.} JSON object - */ - ListInstancesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListInstancesResponse - * @function getTypeUrl - * @memberof google.spanner.admin.instance.v1.ListInstancesResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListInstancesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.instance.v1.ListInstancesResponse"; - }; - - return ListInstancesResponse; - })(); - - v1.UpdateInstanceRequest = (function() { - - /** - * Properties of an UpdateInstanceRequest. - * @memberof google.spanner.admin.instance.v1 - * @interface IUpdateInstanceRequest - * @property {google.spanner.admin.instance.v1.IInstance|null} [instance] UpdateInstanceRequest instance - * @property {google.protobuf.IFieldMask|null} [fieldMask] UpdateInstanceRequest fieldMask - */ - - /** - * Constructs a new UpdateInstanceRequest. - * @memberof google.spanner.admin.instance.v1 - * @classdesc Represents an UpdateInstanceRequest. - * @implements IUpdateInstanceRequest - * @constructor - * @param {google.spanner.admin.instance.v1.IUpdateInstanceRequest=} [properties] Properties to set - */ - function UpdateInstanceRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateInstanceRequest instance. - * @member {google.spanner.admin.instance.v1.IInstance|null|undefined} instance - * @memberof google.spanner.admin.instance.v1.UpdateInstanceRequest - * @instance - */ - UpdateInstanceRequest.prototype.instance = null; - - /** - * UpdateInstanceRequest fieldMask. - * @member {google.protobuf.IFieldMask|null|undefined} fieldMask - * @memberof google.spanner.admin.instance.v1.UpdateInstanceRequest - * @instance - */ - UpdateInstanceRequest.prototype.fieldMask = null; - - /** - * Creates a new UpdateInstanceRequest instance using the specified properties. - * @function create - * @memberof google.spanner.admin.instance.v1.UpdateInstanceRequest - * @static - * @param {google.spanner.admin.instance.v1.IUpdateInstanceRequest=} [properties] Properties to set - * @returns {google.spanner.admin.instance.v1.UpdateInstanceRequest} UpdateInstanceRequest instance - */ - UpdateInstanceRequest.create = function create(properties) { - return new UpdateInstanceRequest(properties); - }; - - /** - * Encodes the specified UpdateInstanceRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.UpdateInstanceRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.instance.v1.UpdateInstanceRequest - * @static - * @param {google.spanner.admin.instance.v1.IUpdateInstanceRequest} message UpdateInstanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateInstanceRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) - $root.google.spanner.admin.instance.v1.Instance.encode(message.instance, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.fieldMask != null && Object.hasOwnProperty.call(message, "fieldMask")) - $root.google.protobuf.FieldMask.encode(message.fieldMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified UpdateInstanceRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.UpdateInstanceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.instance.v1.UpdateInstanceRequest - * @static - * @param {google.spanner.admin.instance.v1.IUpdateInstanceRequest} message UpdateInstanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateInstanceRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.instance.v1.UpdateInstanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.instance.v1.UpdateInstanceRequest} UpdateInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateInstanceRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.UpdateInstanceRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.instance = $root.google.spanner.admin.instance.v1.Instance.decode(reader, reader.uint32()); - break; - } - case 2: { - message.fieldMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateInstanceRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.instance.v1.UpdateInstanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.instance.v1.UpdateInstanceRequest} UpdateInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateInstanceRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateInstanceRequest message. - * @function verify - * @memberof google.spanner.admin.instance.v1.UpdateInstanceRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateInstanceRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.instance != null && message.hasOwnProperty("instance")) { - var error = $root.google.spanner.admin.instance.v1.Instance.verify(message.instance); - if (error) - return "instance." + error; - } - if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.fieldMask); - if (error) - return "fieldMask." + error; - } - return null; - }; - - /** - * Creates an UpdateInstanceRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.instance.v1.UpdateInstanceRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.instance.v1.UpdateInstanceRequest} UpdateInstanceRequest - */ - UpdateInstanceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.instance.v1.UpdateInstanceRequest) - return object; - var message = new $root.google.spanner.admin.instance.v1.UpdateInstanceRequest(); - if (object.instance != null) { - if (typeof object.instance !== "object") - throw TypeError(".google.spanner.admin.instance.v1.UpdateInstanceRequest.instance: object expected"); - message.instance = $root.google.spanner.admin.instance.v1.Instance.fromObject(object.instance); - } - if (object.fieldMask != null) { - if (typeof object.fieldMask !== "object") - throw TypeError(".google.spanner.admin.instance.v1.UpdateInstanceRequest.fieldMask: object expected"); - message.fieldMask = $root.google.protobuf.FieldMask.fromObject(object.fieldMask); - } - return message; - }; - - /** - * Creates a plain object from an UpdateInstanceRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.instance.v1.UpdateInstanceRequest - * @static - * @param {google.spanner.admin.instance.v1.UpdateInstanceRequest} message UpdateInstanceRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateInstanceRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.instance = null; - object.fieldMask = null; - } - if (message.instance != null && message.hasOwnProperty("instance")) - object.instance = $root.google.spanner.admin.instance.v1.Instance.toObject(message.instance, options); - if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) - object.fieldMask = $root.google.protobuf.FieldMask.toObject(message.fieldMask, options); - return object; - }; - - /** - * Converts this UpdateInstanceRequest to JSON. - * @function toJSON - * @memberof google.spanner.admin.instance.v1.UpdateInstanceRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateInstanceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateInstanceRequest - * @function getTypeUrl - * @memberof google.spanner.admin.instance.v1.UpdateInstanceRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.instance.v1.UpdateInstanceRequest"; - }; - - return UpdateInstanceRequest; - })(); - - v1.DeleteInstanceRequest = (function() { - - /** - * Properties of a DeleteInstanceRequest. - * @memberof google.spanner.admin.instance.v1 - * @interface IDeleteInstanceRequest - * @property {string|null} [name] DeleteInstanceRequest name - */ - - /** - * Constructs a new DeleteInstanceRequest. - * @memberof google.spanner.admin.instance.v1 - * @classdesc Represents a DeleteInstanceRequest. - * @implements IDeleteInstanceRequest - * @constructor - * @param {google.spanner.admin.instance.v1.IDeleteInstanceRequest=} [properties] Properties to set - */ - function DeleteInstanceRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteInstanceRequest name. - * @member {string} name - * @memberof google.spanner.admin.instance.v1.DeleteInstanceRequest - * @instance - */ - DeleteInstanceRequest.prototype.name = ""; - - /** - * Creates a new DeleteInstanceRequest instance using the specified properties. - * @function create - * @memberof google.spanner.admin.instance.v1.DeleteInstanceRequest - * @static - * @param {google.spanner.admin.instance.v1.IDeleteInstanceRequest=} [properties] Properties to set - * @returns {google.spanner.admin.instance.v1.DeleteInstanceRequest} DeleteInstanceRequest instance - */ - DeleteInstanceRequest.create = function create(properties) { - return new DeleteInstanceRequest(properties); - }; - - /** - * Encodes the specified DeleteInstanceRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.DeleteInstanceRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.instance.v1.DeleteInstanceRequest - * @static - * @param {google.spanner.admin.instance.v1.IDeleteInstanceRequest} message DeleteInstanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteInstanceRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; - - /** - * Encodes the specified DeleteInstanceRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.DeleteInstanceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.instance.v1.DeleteInstanceRequest - * @static - * @param {google.spanner.admin.instance.v1.IDeleteInstanceRequest} message DeleteInstanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteInstanceRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.instance.v1.DeleteInstanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.instance.v1.DeleteInstanceRequest} DeleteInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteInstanceRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.DeleteInstanceRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteInstanceRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.instance.v1.DeleteInstanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.instance.v1.DeleteInstanceRequest} DeleteInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteInstanceRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteInstanceRequest message. - * @function verify - * @memberof google.spanner.admin.instance.v1.DeleteInstanceRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteInstanceRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; - - /** - * Creates a DeleteInstanceRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.instance.v1.DeleteInstanceRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.instance.v1.DeleteInstanceRequest} DeleteInstanceRequest - */ - DeleteInstanceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.instance.v1.DeleteInstanceRequest) - return object; - var message = new $root.google.spanner.admin.instance.v1.DeleteInstanceRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a DeleteInstanceRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.instance.v1.DeleteInstanceRequest - * @static - * @param {google.spanner.admin.instance.v1.DeleteInstanceRequest} message DeleteInstanceRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteInstanceRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; - - /** - * Converts this DeleteInstanceRequest to JSON. - * @function toJSON - * @memberof google.spanner.admin.instance.v1.DeleteInstanceRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteInstanceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteInstanceRequest - * @function getTypeUrl - * @memberof google.spanner.admin.instance.v1.DeleteInstanceRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.instance.v1.DeleteInstanceRequest"; - }; - - return DeleteInstanceRequest; - })(); - - v1.CreateInstanceMetadata = (function() { - - /** - * Properties of a CreateInstanceMetadata. - * @memberof google.spanner.admin.instance.v1 - * @interface ICreateInstanceMetadata - * @property {google.spanner.admin.instance.v1.IInstance|null} [instance] CreateInstanceMetadata instance - * @property {google.protobuf.ITimestamp|null} [startTime] CreateInstanceMetadata startTime - * @property {google.protobuf.ITimestamp|null} [cancelTime] CreateInstanceMetadata cancelTime - * @property {google.protobuf.ITimestamp|null} [endTime] CreateInstanceMetadata endTime - * @property {google.spanner.admin.instance.v1.FulfillmentPeriod|null} [expectedFulfillmentPeriod] CreateInstanceMetadata expectedFulfillmentPeriod - */ - - /** - * Constructs a new CreateInstanceMetadata. - * @memberof google.spanner.admin.instance.v1 - * @classdesc Represents a CreateInstanceMetadata. - * @implements ICreateInstanceMetadata - * @constructor - * @param {google.spanner.admin.instance.v1.ICreateInstanceMetadata=} [properties] Properties to set - */ - function CreateInstanceMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateInstanceMetadata instance. - * @member {google.spanner.admin.instance.v1.IInstance|null|undefined} instance - * @memberof google.spanner.admin.instance.v1.CreateInstanceMetadata - * @instance - */ - CreateInstanceMetadata.prototype.instance = null; - - /** - * CreateInstanceMetadata startTime. - * @member {google.protobuf.ITimestamp|null|undefined} startTime - * @memberof google.spanner.admin.instance.v1.CreateInstanceMetadata - * @instance - */ - CreateInstanceMetadata.prototype.startTime = null; - - /** - * CreateInstanceMetadata cancelTime. - * @member {google.protobuf.ITimestamp|null|undefined} cancelTime - * @memberof google.spanner.admin.instance.v1.CreateInstanceMetadata - * @instance - */ - CreateInstanceMetadata.prototype.cancelTime = null; - - /** - * CreateInstanceMetadata endTime. - * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.spanner.admin.instance.v1.CreateInstanceMetadata - * @instance - */ - CreateInstanceMetadata.prototype.endTime = null; - - /** - * CreateInstanceMetadata expectedFulfillmentPeriod. - * @member {google.spanner.admin.instance.v1.FulfillmentPeriod} expectedFulfillmentPeriod - * @memberof google.spanner.admin.instance.v1.CreateInstanceMetadata - * @instance - */ - CreateInstanceMetadata.prototype.expectedFulfillmentPeriod = 0; - - /** - * Creates a new CreateInstanceMetadata instance using the specified properties. - * @function create - * @memberof google.spanner.admin.instance.v1.CreateInstanceMetadata - * @static - * @param {google.spanner.admin.instance.v1.ICreateInstanceMetadata=} [properties] Properties to set - * @returns {google.spanner.admin.instance.v1.CreateInstanceMetadata} CreateInstanceMetadata instance - */ - CreateInstanceMetadata.create = function create(properties) { - return new CreateInstanceMetadata(properties); - }; - - /** - * Encodes the specified CreateInstanceMetadata message. Does not implicitly {@link google.spanner.admin.instance.v1.CreateInstanceMetadata.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.instance.v1.CreateInstanceMetadata - * @static - * @param {google.spanner.admin.instance.v1.ICreateInstanceMetadata} message CreateInstanceMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateInstanceMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) - $root.google.spanner.admin.instance.v1.Instance.encode(message.instance, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) - $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.cancelTime != null && Object.hasOwnProperty.call(message, "cancelTime")) - $root.google.protobuf.Timestamp.encode(message.cancelTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) - $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.expectedFulfillmentPeriod != null && Object.hasOwnProperty.call(message, "expectedFulfillmentPeriod")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.expectedFulfillmentPeriod); - return writer; - }; - - /** - * Encodes the specified CreateInstanceMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.CreateInstanceMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.instance.v1.CreateInstanceMetadata - * @static - * @param {google.spanner.admin.instance.v1.ICreateInstanceMetadata} message CreateInstanceMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateInstanceMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateInstanceMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.instance.v1.CreateInstanceMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.instance.v1.CreateInstanceMetadata} CreateInstanceMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateInstanceMetadata.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.CreateInstanceMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.instance = $root.google.spanner.admin.instance.v1.Instance.decode(reader, reader.uint32()); - break; - } - case 2: { - message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 3: { - message.cancelTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 4: { - message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 5: { - message.expectedFulfillmentPeriod = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateInstanceMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.instance.v1.CreateInstanceMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.instance.v1.CreateInstanceMetadata} CreateInstanceMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateInstanceMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateInstanceMetadata message. - * @function verify - * @memberof google.spanner.admin.instance.v1.CreateInstanceMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateInstanceMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.instance != null && message.hasOwnProperty("instance")) { - var error = $root.google.spanner.admin.instance.v1.Instance.verify(message.instance); - if (error) - return "instance." + error; - } - if (message.startTime != null && message.hasOwnProperty("startTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.startTime); - if (error) - return "startTime." + error; - } - if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.cancelTime); - if (error) - return "cancelTime." + error; - } - if (message.endTime != null && message.hasOwnProperty("endTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.endTime); - if (error) - return "endTime." + error; - } - if (message.expectedFulfillmentPeriod != null && message.hasOwnProperty("expectedFulfillmentPeriod")) - switch (message.expectedFulfillmentPeriod) { - default: - return "expectedFulfillmentPeriod: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a CreateInstanceMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.instance.v1.CreateInstanceMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.instance.v1.CreateInstanceMetadata} CreateInstanceMetadata - */ - CreateInstanceMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.instance.v1.CreateInstanceMetadata) - return object; - var message = new $root.google.spanner.admin.instance.v1.CreateInstanceMetadata(); - if (object.instance != null) { - if (typeof object.instance !== "object") - throw TypeError(".google.spanner.admin.instance.v1.CreateInstanceMetadata.instance: object expected"); - message.instance = $root.google.spanner.admin.instance.v1.Instance.fromObject(object.instance); - } - if (object.startTime != null) { - if (typeof object.startTime !== "object") - throw TypeError(".google.spanner.admin.instance.v1.CreateInstanceMetadata.startTime: object expected"); - message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); - } - if (object.cancelTime != null) { - if (typeof object.cancelTime !== "object") - throw TypeError(".google.spanner.admin.instance.v1.CreateInstanceMetadata.cancelTime: object expected"); - message.cancelTime = $root.google.protobuf.Timestamp.fromObject(object.cancelTime); - } - if (object.endTime != null) { - if (typeof object.endTime !== "object") - throw TypeError(".google.spanner.admin.instance.v1.CreateInstanceMetadata.endTime: object expected"); - message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); - } - switch (object.expectedFulfillmentPeriod) { - default: - if (typeof object.expectedFulfillmentPeriod === "number") { - message.expectedFulfillmentPeriod = object.expectedFulfillmentPeriod; - break; - } - break; - case "FULFILLMENT_PERIOD_UNSPECIFIED": - case 0: - message.expectedFulfillmentPeriod = 0; - break; - case "FULFILLMENT_PERIOD_NORMAL": - case 1: - message.expectedFulfillmentPeriod = 1; - break; - case "FULFILLMENT_PERIOD_EXTENDED": - case 2: - message.expectedFulfillmentPeriod = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a CreateInstanceMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.instance.v1.CreateInstanceMetadata - * @static - * @param {google.spanner.admin.instance.v1.CreateInstanceMetadata} message CreateInstanceMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateInstanceMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.instance = null; - object.startTime = null; - object.cancelTime = null; - object.endTime = null; - object.expectedFulfillmentPeriod = options.enums === String ? "FULFILLMENT_PERIOD_UNSPECIFIED" : 0; - } - if (message.instance != null && message.hasOwnProperty("instance")) - object.instance = $root.google.spanner.admin.instance.v1.Instance.toObject(message.instance, options); - if (message.startTime != null && message.hasOwnProperty("startTime")) - object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); - if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) - object.cancelTime = $root.google.protobuf.Timestamp.toObject(message.cancelTime, options); - if (message.endTime != null && message.hasOwnProperty("endTime")) - object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); - if (message.expectedFulfillmentPeriod != null && message.hasOwnProperty("expectedFulfillmentPeriod")) - object.expectedFulfillmentPeriod = options.enums === String ? $root.google.spanner.admin.instance.v1.FulfillmentPeriod[message.expectedFulfillmentPeriod] === undefined ? message.expectedFulfillmentPeriod : $root.google.spanner.admin.instance.v1.FulfillmentPeriod[message.expectedFulfillmentPeriod] : message.expectedFulfillmentPeriod; - return object; - }; - - /** - * Converts this CreateInstanceMetadata to JSON. - * @function toJSON - * @memberof google.spanner.admin.instance.v1.CreateInstanceMetadata - * @instance - * @returns {Object.} JSON object - */ - CreateInstanceMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateInstanceMetadata - * @function getTypeUrl - * @memberof google.spanner.admin.instance.v1.CreateInstanceMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateInstanceMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.instance.v1.CreateInstanceMetadata"; - }; - - return CreateInstanceMetadata; - })(); - - v1.UpdateInstanceMetadata = (function() { - - /** - * Properties of an UpdateInstanceMetadata. - * @memberof google.spanner.admin.instance.v1 - * @interface IUpdateInstanceMetadata - * @property {google.spanner.admin.instance.v1.IInstance|null} [instance] UpdateInstanceMetadata instance - * @property {google.protobuf.ITimestamp|null} [startTime] UpdateInstanceMetadata startTime - * @property {google.protobuf.ITimestamp|null} [cancelTime] UpdateInstanceMetadata cancelTime - * @property {google.protobuf.ITimestamp|null} [endTime] UpdateInstanceMetadata endTime - * @property {google.spanner.admin.instance.v1.FulfillmentPeriod|null} [expectedFulfillmentPeriod] UpdateInstanceMetadata expectedFulfillmentPeriod - */ - - /** - * Constructs a new UpdateInstanceMetadata. - * @memberof google.spanner.admin.instance.v1 - * @classdesc Represents an UpdateInstanceMetadata. - * @implements IUpdateInstanceMetadata - * @constructor - * @param {google.spanner.admin.instance.v1.IUpdateInstanceMetadata=} [properties] Properties to set - */ - function UpdateInstanceMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateInstanceMetadata instance. - * @member {google.spanner.admin.instance.v1.IInstance|null|undefined} instance - * @memberof google.spanner.admin.instance.v1.UpdateInstanceMetadata - * @instance - */ - UpdateInstanceMetadata.prototype.instance = null; - - /** - * UpdateInstanceMetadata startTime. - * @member {google.protobuf.ITimestamp|null|undefined} startTime - * @memberof google.spanner.admin.instance.v1.UpdateInstanceMetadata - * @instance - */ - UpdateInstanceMetadata.prototype.startTime = null; - - /** - * UpdateInstanceMetadata cancelTime. - * @member {google.protobuf.ITimestamp|null|undefined} cancelTime - * @memberof google.spanner.admin.instance.v1.UpdateInstanceMetadata - * @instance - */ - UpdateInstanceMetadata.prototype.cancelTime = null; - - /** - * UpdateInstanceMetadata endTime. - * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.spanner.admin.instance.v1.UpdateInstanceMetadata - * @instance - */ - UpdateInstanceMetadata.prototype.endTime = null; - - /** - * UpdateInstanceMetadata expectedFulfillmentPeriod. - * @member {google.spanner.admin.instance.v1.FulfillmentPeriod} expectedFulfillmentPeriod - * @memberof google.spanner.admin.instance.v1.UpdateInstanceMetadata - * @instance - */ - UpdateInstanceMetadata.prototype.expectedFulfillmentPeriod = 0; - - /** - * Creates a new UpdateInstanceMetadata instance using the specified properties. - * @function create - * @memberof google.spanner.admin.instance.v1.UpdateInstanceMetadata - * @static - * @param {google.spanner.admin.instance.v1.IUpdateInstanceMetadata=} [properties] Properties to set - * @returns {google.spanner.admin.instance.v1.UpdateInstanceMetadata} UpdateInstanceMetadata instance - */ - UpdateInstanceMetadata.create = function create(properties) { - return new UpdateInstanceMetadata(properties); - }; - - /** - * Encodes the specified UpdateInstanceMetadata message. Does not implicitly {@link google.spanner.admin.instance.v1.UpdateInstanceMetadata.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.instance.v1.UpdateInstanceMetadata - * @static - * @param {google.spanner.admin.instance.v1.IUpdateInstanceMetadata} message UpdateInstanceMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateInstanceMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) - $root.google.spanner.admin.instance.v1.Instance.encode(message.instance, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) - $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.cancelTime != null && Object.hasOwnProperty.call(message, "cancelTime")) - $root.google.protobuf.Timestamp.encode(message.cancelTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) - $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.expectedFulfillmentPeriod != null && Object.hasOwnProperty.call(message, "expectedFulfillmentPeriod")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.expectedFulfillmentPeriod); - return writer; - }; - - /** - * Encodes the specified UpdateInstanceMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.UpdateInstanceMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.instance.v1.UpdateInstanceMetadata - * @static - * @param {google.spanner.admin.instance.v1.IUpdateInstanceMetadata} message UpdateInstanceMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateInstanceMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateInstanceMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.instance.v1.UpdateInstanceMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.instance.v1.UpdateInstanceMetadata} UpdateInstanceMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateInstanceMetadata.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.UpdateInstanceMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.instance = $root.google.spanner.admin.instance.v1.Instance.decode(reader, reader.uint32()); - break; - } - case 2: { - message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 3: { - message.cancelTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 4: { - message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 5: { - message.expectedFulfillmentPeriod = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateInstanceMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.instance.v1.UpdateInstanceMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.instance.v1.UpdateInstanceMetadata} UpdateInstanceMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateInstanceMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateInstanceMetadata message. - * @function verify - * @memberof google.spanner.admin.instance.v1.UpdateInstanceMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateInstanceMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.instance != null && message.hasOwnProperty("instance")) { - var error = $root.google.spanner.admin.instance.v1.Instance.verify(message.instance); - if (error) - return "instance." + error; - } - if (message.startTime != null && message.hasOwnProperty("startTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.startTime); - if (error) - return "startTime." + error; - } - if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.cancelTime); - if (error) - return "cancelTime." + error; - } - if (message.endTime != null && message.hasOwnProperty("endTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.endTime); - if (error) - return "endTime." + error; - } - if (message.expectedFulfillmentPeriod != null && message.hasOwnProperty("expectedFulfillmentPeriod")) - switch (message.expectedFulfillmentPeriod) { - default: - return "expectedFulfillmentPeriod: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates an UpdateInstanceMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.instance.v1.UpdateInstanceMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.instance.v1.UpdateInstanceMetadata} UpdateInstanceMetadata - */ - UpdateInstanceMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.instance.v1.UpdateInstanceMetadata) - return object; - var message = new $root.google.spanner.admin.instance.v1.UpdateInstanceMetadata(); - if (object.instance != null) { - if (typeof object.instance !== "object") - throw TypeError(".google.spanner.admin.instance.v1.UpdateInstanceMetadata.instance: object expected"); - message.instance = $root.google.spanner.admin.instance.v1.Instance.fromObject(object.instance); - } - if (object.startTime != null) { - if (typeof object.startTime !== "object") - throw TypeError(".google.spanner.admin.instance.v1.UpdateInstanceMetadata.startTime: object expected"); - message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); - } - if (object.cancelTime != null) { - if (typeof object.cancelTime !== "object") - throw TypeError(".google.spanner.admin.instance.v1.UpdateInstanceMetadata.cancelTime: object expected"); - message.cancelTime = $root.google.protobuf.Timestamp.fromObject(object.cancelTime); - } - if (object.endTime != null) { - if (typeof object.endTime !== "object") - throw TypeError(".google.spanner.admin.instance.v1.UpdateInstanceMetadata.endTime: object expected"); - message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); - } - switch (object.expectedFulfillmentPeriod) { - default: - if (typeof object.expectedFulfillmentPeriod === "number") { - message.expectedFulfillmentPeriod = object.expectedFulfillmentPeriod; - break; - } - break; - case "FULFILLMENT_PERIOD_UNSPECIFIED": - case 0: - message.expectedFulfillmentPeriod = 0; - break; - case "FULFILLMENT_PERIOD_NORMAL": - case 1: - message.expectedFulfillmentPeriod = 1; - break; - case "FULFILLMENT_PERIOD_EXTENDED": - case 2: - message.expectedFulfillmentPeriod = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from an UpdateInstanceMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.instance.v1.UpdateInstanceMetadata - * @static - * @param {google.spanner.admin.instance.v1.UpdateInstanceMetadata} message UpdateInstanceMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateInstanceMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.instance = null; - object.startTime = null; - object.cancelTime = null; - object.endTime = null; - object.expectedFulfillmentPeriod = options.enums === String ? "FULFILLMENT_PERIOD_UNSPECIFIED" : 0; - } - if (message.instance != null && message.hasOwnProperty("instance")) - object.instance = $root.google.spanner.admin.instance.v1.Instance.toObject(message.instance, options); - if (message.startTime != null && message.hasOwnProperty("startTime")) - object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); - if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) - object.cancelTime = $root.google.protobuf.Timestamp.toObject(message.cancelTime, options); - if (message.endTime != null && message.hasOwnProperty("endTime")) - object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); - if (message.expectedFulfillmentPeriod != null && message.hasOwnProperty("expectedFulfillmentPeriod")) - object.expectedFulfillmentPeriod = options.enums === String ? $root.google.spanner.admin.instance.v1.FulfillmentPeriod[message.expectedFulfillmentPeriod] === undefined ? message.expectedFulfillmentPeriod : $root.google.spanner.admin.instance.v1.FulfillmentPeriod[message.expectedFulfillmentPeriod] : message.expectedFulfillmentPeriod; - return object; - }; - - /** - * Converts this UpdateInstanceMetadata to JSON. - * @function toJSON - * @memberof google.spanner.admin.instance.v1.UpdateInstanceMetadata - * @instance - * @returns {Object.} JSON object - */ - UpdateInstanceMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateInstanceMetadata - * @function getTypeUrl - * @memberof google.spanner.admin.instance.v1.UpdateInstanceMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateInstanceMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.instance.v1.UpdateInstanceMetadata"; - }; - - return UpdateInstanceMetadata; - })(); - - v1.FreeInstanceMetadata = (function() { - - /** - * Properties of a FreeInstanceMetadata. - * @memberof google.spanner.admin.instance.v1 - * @interface IFreeInstanceMetadata - * @property {google.protobuf.ITimestamp|null} [expireTime] FreeInstanceMetadata expireTime - * @property {google.protobuf.ITimestamp|null} [upgradeTime] FreeInstanceMetadata upgradeTime - * @property {google.spanner.admin.instance.v1.FreeInstanceMetadata.ExpireBehavior|null} [expireBehavior] FreeInstanceMetadata expireBehavior - */ - - /** - * Constructs a new FreeInstanceMetadata. - * @memberof google.spanner.admin.instance.v1 - * @classdesc Represents a FreeInstanceMetadata. - * @implements IFreeInstanceMetadata - * @constructor - * @param {google.spanner.admin.instance.v1.IFreeInstanceMetadata=} [properties] Properties to set - */ - function FreeInstanceMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FreeInstanceMetadata expireTime. - * @member {google.protobuf.ITimestamp|null|undefined} expireTime - * @memberof google.spanner.admin.instance.v1.FreeInstanceMetadata - * @instance - */ - FreeInstanceMetadata.prototype.expireTime = null; - - /** - * FreeInstanceMetadata upgradeTime. - * @member {google.protobuf.ITimestamp|null|undefined} upgradeTime - * @memberof google.spanner.admin.instance.v1.FreeInstanceMetadata - * @instance - */ - FreeInstanceMetadata.prototype.upgradeTime = null; - - /** - * FreeInstanceMetadata expireBehavior. - * @member {google.spanner.admin.instance.v1.FreeInstanceMetadata.ExpireBehavior} expireBehavior - * @memberof google.spanner.admin.instance.v1.FreeInstanceMetadata - * @instance - */ - FreeInstanceMetadata.prototype.expireBehavior = 0; - - /** - * Creates a new FreeInstanceMetadata instance using the specified properties. - * @function create - * @memberof google.spanner.admin.instance.v1.FreeInstanceMetadata - * @static - * @param {google.spanner.admin.instance.v1.IFreeInstanceMetadata=} [properties] Properties to set - * @returns {google.spanner.admin.instance.v1.FreeInstanceMetadata} FreeInstanceMetadata instance - */ - FreeInstanceMetadata.create = function create(properties) { - return new FreeInstanceMetadata(properties); - }; - - /** - * Encodes the specified FreeInstanceMetadata message. Does not implicitly {@link google.spanner.admin.instance.v1.FreeInstanceMetadata.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.instance.v1.FreeInstanceMetadata - * @static - * @param {google.spanner.admin.instance.v1.IFreeInstanceMetadata} message FreeInstanceMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FreeInstanceMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) - $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.upgradeTime != null && Object.hasOwnProperty.call(message, "upgradeTime")) - $root.google.protobuf.Timestamp.encode(message.upgradeTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.expireBehavior != null && Object.hasOwnProperty.call(message, "expireBehavior")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.expireBehavior); - return writer; - }; - - /** - * Encodes the specified FreeInstanceMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.FreeInstanceMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.instance.v1.FreeInstanceMetadata - * @static - * @param {google.spanner.admin.instance.v1.IFreeInstanceMetadata} message FreeInstanceMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FreeInstanceMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FreeInstanceMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.instance.v1.FreeInstanceMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.instance.v1.FreeInstanceMetadata} FreeInstanceMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FreeInstanceMetadata.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.FreeInstanceMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 2: { - message.upgradeTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 3: { - message.expireBehavior = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FreeInstanceMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.instance.v1.FreeInstanceMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.instance.v1.FreeInstanceMetadata} FreeInstanceMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FreeInstanceMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FreeInstanceMetadata message. - * @function verify - * @memberof google.spanner.admin.instance.v1.FreeInstanceMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FreeInstanceMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.expireTime != null && message.hasOwnProperty("expireTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.expireTime); - if (error) - return "expireTime." + error; - } - if (message.upgradeTime != null && message.hasOwnProperty("upgradeTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.upgradeTime); - if (error) - return "upgradeTime." + error; - } - if (message.expireBehavior != null && message.hasOwnProperty("expireBehavior")) - switch (message.expireBehavior) { - default: - return "expireBehavior: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a FreeInstanceMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.instance.v1.FreeInstanceMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.instance.v1.FreeInstanceMetadata} FreeInstanceMetadata - */ - FreeInstanceMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.instance.v1.FreeInstanceMetadata) - return object; - var message = new $root.google.spanner.admin.instance.v1.FreeInstanceMetadata(); - if (object.expireTime != null) { - if (typeof object.expireTime !== "object") - throw TypeError(".google.spanner.admin.instance.v1.FreeInstanceMetadata.expireTime: object expected"); - message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); - } - if (object.upgradeTime != null) { - if (typeof object.upgradeTime !== "object") - throw TypeError(".google.spanner.admin.instance.v1.FreeInstanceMetadata.upgradeTime: object expected"); - message.upgradeTime = $root.google.protobuf.Timestamp.fromObject(object.upgradeTime); - } - switch (object.expireBehavior) { - default: - if (typeof object.expireBehavior === "number") { - message.expireBehavior = object.expireBehavior; - break; - } - break; - case "EXPIRE_BEHAVIOR_UNSPECIFIED": - case 0: - message.expireBehavior = 0; - break; - case "FREE_TO_PROVISIONED": - case 1: - message.expireBehavior = 1; - break; - case "REMOVE_AFTER_GRACE_PERIOD": - case 2: - message.expireBehavior = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a FreeInstanceMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.instance.v1.FreeInstanceMetadata - * @static - * @param {google.spanner.admin.instance.v1.FreeInstanceMetadata} message FreeInstanceMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FreeInstanceMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.expireTime = null; - object.upgradeTime = null; - object.expireBehavior = options.enums === String ? "EXPIRE_BEHAVIOR_UNSPECIFIED" : 0; - } - if (message.expireTime != null && message.hasOwnProperty("expireTime")) - object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); - if (message.upgradeTime != null && message.hasOwnProperty("upgradeTime")) - object.upgradeTime = $root.google.protobuf.Timestamp.toObject(message.upgradeTime, options); - if (message.expireBehavior != null && message.hasOwnProperty("expireBehavior")) - object.expireBehavior = options.enums === String ? $root.google.spanner.admin.instance.v1.FreeInstanceMetadata.ExpireBehavior[message.expireBehavior] === undefined ? message.expireBehavior : $root.google.spanner.admin.instance.v1.FreeInstanceMetadata.ExpireBehavior[message.expireBehavior] : message.expireBehavior; - return object; - }; - - /** - * Converts this FreeInstanceMetadata to JSON. - * @function toJSON - * @memberof google.spanner.admin.instance.v1.FreeInstanceMetadata - * @instance - * @returns {Object.} JSON object - */ - FreeInstanceMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FreeInstanceMetadata - * @function getTypeUrl - * @memberof google.spanner.admin.instance.v1.FreeInstanceMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FreeInstanceMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.instance.v1.FreeInstanceMetadata"; - }; - - /** - * ExpireBehavior enum. - * @name google.spanner.admin.instance.v1.FreeInstanceMetadata.ExpireBehavior - * @enum {number} - * @property {number} EXPIRE_BEHAVIOR_UNSPECIFIED=0 EXPIRE_BEHAVIOR_UNSPECIFIED value - * @property {number} FREE_TO_PROVISIONED=1 FREE_TO_PROVISIONED value - * @property {number} REMOVE_AFTER_GRACE_PERIOD=2 REMOVE_AFTER_GRACE_PERIOD value - */ - FreeInstanceMetadata.ExpireBehavior = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "EXPIRE_BEHAVIOR_UNSPECIFIED"] = 0; - values[valuesById[1] = "FREE_TO_PROVISIONED"] = 1; - values[valuesById[2] = "REMOVE_AFTER_GRACE_PERIOD"] = 2; - return values; - })(); - - return FreeInstanceMetadata; - })(); - - v1.CreateInstanceConfigMetadata = (function() { - - /** - * Properties of a CreateInstanceConfigMetadata. - * @memberof google.spanner.admin.instance.v1 - * @interface ICreateInstanceConfigMetadata - * @property {google.spanner.admin.instance.v1.IInstanceConfig|null} [instanceConfig] CreateInstanceConfigMetadata instanceConfig - * @property {google.spanner.admin.instance.v1.IOperationProgress|null} [progress] CreateInstanceConfigMetadata progress - * @property {google.protobuf.ITimestamp|null} [cancelTime] CreateInstanceConfigMetadata cancelTime - */ - - /** - * Constructs a new CreateInstanceConfigMetadata. - * @memberof google.spanner.admin.instance.v1 - * @classdesc Represents a CreateInstanceConfigMetadata. - * @implements ICreateInstanceConfigMetadata - * @constructor - * @param {google.spanner.admin.instance.v1.ICreateInstanceConfigMetadata=} [properties] Properties to set - */ - function CreateInstanceConfigMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateInstanceConfigMetadata instanceConfig. - * @member {google.spanner.admin.instance.v1.IInstanceConfig|null|undefined} instanceConfig - * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigMetadata - * @instance - */ - CreateInstanceConfigMetadata.prototype.instanceConfig = null; - - /** - * CreateInstanceConfigMetadata progress. - * @member {google.spanner.admin.instance.v1.IOperationProgress|null|undefined} progress - * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigMetadata - * @instance - */ - CreateInstanceConfigMetadata.prototype.progress = null; - - /** - * CreateInstanceConfigMetadata cancelTime. - * @member {google.protobuf.ITimestamp|null|undefined} cancelTime - * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigMetadata - * @instance - */ - CreateInstanceConfigMetadata.prototype.cancelTime = null; - - /** - * Creates a new CreateInstanceConfigMetadata instance using the specified properties. - * @function create - * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigMetadata - * @static - * @param {google.spanner.admin.instance.v1.ICreateInstanceConfigMetadata=} [properties] Properties to set - * @returns {google.spanner.admin.instance.v1.CreateInstanceConfigMetadata} CreateInstanceConfigMetadata instance - */ - CreateInstanceConfigMetadata.create = function create(properties) { - return new CreateInstanceConfigMetadata(properties); - }; - - /** - * Encodes the specified CreateInstanceConfigMetadata message. Does not implicitly {@link google.spanner.admin.instance.v1.CreateInstanceConfigMetadata.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigMetadata - * @static - * @param {google.spanner.admin.instance.v1.ICreateInstanceConfigMetadata} message CreateInstanceConfigMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateInstanceConfigMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.instanceConfig != null && Object.hasOwnProperty.call(message, "instanceConfig")) - $root.google.spanner.admin.instance.v1.InstanceConfig.encode(message.instanceConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.progress != null && Object.hasOwnProperty.call(message, "progress")) - $root.google.spanner.admin.instance.v1.OperationProgress.encode(message.progress, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.cancelTime != null && Object.hasOwnProperty.call(message, "cancelTime")) - $root.google.protobuf.Timestamp.encode(message.cancelTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CreateInstanceConfigMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.CreateInstanceConfigMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigMetadata - * @static - * @param {google.spanner.admin.instance.v1.ICreateInstanceConfigMetadata} message CreateInstanceConfigMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateInstanceConfigMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateInstanceConfigMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.instance.v1.CreateInstanceConfigMetadata} CreateInstanceConfigMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateInstanceConfigMetadata.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.CreateInstanceConfigMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.instanceConfig = $root.google.spanner.admin.instance.v1.InstanceConfig.decode(reader, reader.uint32()); - break; - } - case 2: { - message.progress = $root.google.spanner.admin.instance.v1.OperationProgress.decode(reader, reader.uint32()); - break; - } - case 3: { - message.cancelTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateInstanceConfigMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.instance.v1.CreateInstanceConfigMetadata} CreateInstanceConfigMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateInstanceConfigMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateInstanceConfigMetadata message. - * @function verify - * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateInstanceConfigMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.instanceConfig != null && message.hasOwnProperty("instanceConfig")) { - var error = $root.google.spanner.admin.instance.v1.InstanceConfig.verify(message.instanceConfig); - if (error) - return "instanceConfig." + error; - } - if (message.progress != null && message.hasOwnProperty("progress")) { - var error = $root.google.spanner.admin.instance.v1.OperationProgress.verify(message.progress); - if (error) - return "progress." + error; - } - if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.cancelTime); - if (error) - return "cancelTime." + error; - } - return null; - }; - - /** - * Creates a CreateInstanceConfigMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.instance.v1.CreateInstanceConfigMetadata} CreateInstanceConfigMetadata - */ - CreateInstanceConfigMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.instance.v1.CreateInstanceConfigMetadata) - return object; - var message = new $root.google.spanner.admin.instance.v1.CreateInstanceConfigMetadata(); - if (object.instanceConfig != null) { - if (typeof object.instanceConfig !== "object") - throw TypeError(".google.spanner.admin.instance.v1.CreateInstanceConfigMetadata.instanceConfig: object expected"); - message.instanceConfig = $root.google.spanner.admin.instance.v1.InstanceConfig.fromObject(object.instanceConfig); - } - if (object.progress != null) { - if (typeof object.progress !== "object") - throw TypeError(".google.spanner.admin.instance.v1.CreateInstanceConfigMetadata.progress: object expected"); - message.progress = $root.google.spanner.admin.instance.v1.OperationProgress.fromObject(object.progress); - } - if (object.cancelTime != null) { - if (typeof object.cancelTime !== "object") - throw TypeError(".google.spanner.admin.instance.v1.CreateInstanceConfigMetadata.cancelTime: object expected"); - message.cancelTime = $root.google.protobuf.Timestamp.fromObject(object.cancelTime); - } - return message; - }; - - /** - * Creates a plain object from a CreateInstanceConfigMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigMetadata - * @static - * @param {google.spanner.admin.instance.v1.CreateInstanceConfigMetadata} message CreateInstanceConfigMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateInstanceConfigMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.instanceConfig = null; - object.progress = null; - object.cancelTime = null; - } - if (message.instanceConfig != null && message.hasOwnProperty("instanceConfig")) - object.instanceConfig = $root.google.spanner.admin.instance.v1.InstanceConfig.toObject(message.instanceConfig, options); - if (message.progress != null && message.hasOwnProperty("progress")) - object.progress = $root.google.spanner.admin.instance.v1.OperationProgress.toObject(message.progress, options); - if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) - object.cancelTime = $root.google.protobuf.Timestamp.toObject(message.cancelTime, options); - return object; - }; - - /** - * Converts this CreateInstanceConfigMetadata to JSON. - * @function toJSON - * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigMetadata - * @instance - * @returns {Object.} JSON object - */ - CreateInstanceConfigMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateInstanceConfigMetadata - * @function getTypeUrl - * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateInstanceConfigMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.instance.v1.CreateInstanceConfigMetadata"; - }; - - return CreateInstanceConfigMetadata; - })(); - - v1.UpdateInstanceConfigMetadata = (function() { - - /** - * Properties of an UpdateInstanceConfigMetadata. - * @memberof google.spanner.admin.instance.v1 - * @interface IUpdateInstanceConfigMetadata - * @property {google.spanner.admin.instance.v1.IInstanceConfig|null} [instanceConfig] UpdateInstanceConfigMetadata instanceConfig - * @property {google.spanner.admin.instance.v1.IOperationProgress|null} [progress] UpdateInstanceConfigMetadata progress - * @property {google.protobuf.ITimestamp|null} [cancelTime] UpdateInstanceConfigMetadata cancelTime - */ - - /** - * Constructs a new UpdateInstanceConfigMetadata. - * @memberof google.spanner.admin.instance.v1 - * @classdesc Represents an UpdateInstanceConfigMetadata. - * @implements IUpdateInstanceConfigMetadata - * @constructor - * @param {google.spanner.admin.instance.v1.IUpdateInstanceConfigMetadata=} [properties] Properties to set - */ - function UpdateInstanceConfigMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateInstanceConfigMetadata instanceConfig. - * @member {google.spanner.admin.instance.v1.IInstanceConfig|null|undefined} instanceConfig - * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata - * @instance - */ - UpdateInstanceConfigMetadata.prototype.instanceConfig = null; - - /** - * UpdateInstanceConfigMetadata progress. - * @member {google.spanner.admin.instance.v1.IOperationProgress|null|undefined} progress - * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata - * @instance - */ - UpdateInstanceConfigMetadata.prototype.progress = null; - - /** - * UpdateInstanceConfigMetadata cancelTime. - * @member {google.protobuf.ITimestamp|null|undefined} cancelTime - * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata - * @instance - */ - UpdateInstanceConfigMetadata.prototype.cancelTime = null; - - /** - * Creates a new UpdateInstanceConfigMetadata instance using the specified properties. - * @function create - * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata - * @static - * @param {google.spanner.admin.instance.v1.IUpdateInstanceConfigMetadata=} [properties] Properties to set - * @returns {google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata} UpdateInstanceConfigMetadata instance - */ - UpdateInstanceConfigMetadata.create = function create(properties) { - return new UpdateInstanceConfigMetadata(properties); - }; - - /** - * Encodes the specified UpdateInstanceConfigMetadata message. Does not implicitly {@link google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata - * @static - * @param {google.spanner.admin.instance.v1.IUpdateInstanceConfigMetadata} message UpdateInstanceConfigMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateInstanceConfigMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.instanceConfig != null && Object.hasOwnProperty.call(message, "instanceConfig")) - $root.google.spanner.admin.instance.v1.InstanceConfig.encode(message.instanceConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.progress != null && Object.hasOwnProperty.call(message, "progress")) - $root.google.spanner.admin.instance.v1.OperationProgress.encode(message.progress, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.cancelTime != null && Object.hasOwnProperty.call(message, "cancelTime")) - $root.google.protobuf.Timestamp.encode(message.cancelTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified UpdateInstanceConfigMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata - * @static - * @param {google.spanner.admin.instance.v1.IUpdateInstanceConfigMetadata} message UpdateInstanceConfigMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateInstanceConfigMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateInstanceConfigMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata} UpdateInstanceConfigMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateInstanceConfigMetadata.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.instanceConfig = $root.google.spanner.admin.instance.v1.InstanceConfig.decode(reader, reader.uint32()); - break; - } - case 2: { - message.progress = $root.google.spanner.admin.instance.v1.OperationProgress.decode(reader, reader.uint32()); - break; - } - case 3: { - message.cancelTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateInstanceConfigMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata} UpdateInstanceConfigMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateInstanceConfigMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateInstanceConfigMetadata message. - * @function verify - * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateInstanceConfigMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.instanceConfig != null && message.hasOwnProperty("instanceConfig")) { - var error = $root.google.spanner.admin.instance.v1.InstanceConfig.verify(message.instanceConfig); - if (error) - return "instanceConfig." + error; - } - if (message.progress != null && message.hasOwnProperty("progress")) { - var error = $root.google.spanner.admin.instance.v1.OperationProgress.verify(message.progress); - if (error) - return "progress." + error; - } - if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.cancelTime); - if (error) - return "cancelTime." + error; - } - return null; - }; - - /** - * Creates an UpdateInstanceConfigMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata} UpdateInstanceConfigMetadata - */ - UpdateInstanceConfigMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata) - return object; - var message = new $root.google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata(); - if (object.instanceConfig != null) { - if (typeof object.instanceConfig !== "object") - throw TypeError(".google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata.instanceConfig: object expected"); - message.instanceConfig = $root.google.spanner.admin.instance.v1.InstanceConfig.fromObject(object.instanceConfig); - } - if (object.progress != null) { - if (typeof object.progress !== "object") - throw TypeError(".google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata.progress: object expected"); - message.progress = $root.google.spanner.admin.instance.v1.OperationProgress.fromObject(object.progress); - } - if (object.cancelTime != null) { - if (typeof object.cancelTime !== "object") - throw TypeError(".google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata.cancelTime: object expected"); - message.cancelTime = $root.google.protobuf.Timestamp.fromObject(object.cancelTime); - } - return message; - }; - - /** - * Creates a plain object from an UpdateInstanceConfigMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata - * @static - * @param {google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata} message UpdateInstanceConfigMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateInstanceConfigMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.instanceConfig = null; - object.progress = null; - object.cancelTime = null; - } - if (message.instanceConfig != null && message.hasOwnProperty("instanceConfig")) - object.instanceConfig = $root.google.spanner.admin.instance.v1.InstanceConfig.toObject(message.instanceConfig, options); - if (message.progress != null && message.hasOwnProperty("progress")) - object.progress = $root.google.spanner.admin.instance.v1.OperationProgress.toObject(message.progress, options); - if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) - object.cancelTime = $root.google.protobuf.Timestamp.toObject(message.cancelTime, options); - return object; - }; - - /** - * Converts this UpdateInstanceConfigMetadata to JSON. - * @function toJSON - * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata - * @instance - * @returns {Object.} JSON object - */ - UpdateInstanceConfigMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateInstanceConfigMetadata - * @function getTypeUrl - * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateInstanceConfigMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata"; - }; - - return UpdateInstanceConfigMetadata; - })(); - - v1.InstancePartition = (function() { - - /** - * Properties of an InstancePartition. - * @memberof google.spanner.admin.instance.v1 - * @interface IInstancePartition - * @property {string|null} [name] InstancePartition name - * @property {string|null} [config] InstancePartition config - * @property {string|null} [displayName] InstancePartition displayName - * @property {number|null} [nodeCount] InstancePartition nodeCount - * @property {number|null} [processingUnits] InstancePartition processingUnits - * @property {google.spanner.admin.instance.v1.IAutoscalingConfig|null} [autoscalingConfig] InstancePartition autoscalingConfig - * @property {google.spanner.admin.instance.v1.InstancePartition.State|null} [state] InstancePartition state - * @property {google.protobuf.ITimestamp|null} [createTime] InstancePartition createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] InstancePartition updateTime - * @property {Array.|null} [referencingDatabases] InstancePartition referencingDatabases - * @property {Array.|null} [referencingBackups] InstancePartition referencingBackups - * @property {string|null} [etag] InstancePartition etag - */ - - /** - * Constructs a new InstancePartition. - * @memberof google.spanner.admin.instance.v1 - * @classdesc Represents an InstancePartition. - * @implements IInstancePartition - * @constructor - * @param {google.spanner.admin.instance.v1.IInstancePartition=} [properties] Properties to set - */ - function InstancePartition(properties) { - this.referencingDatabases = []; - this.referencingBackups = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * InstancePartition name. - * @member {string} name - * @memberof google.spanner.admin.instance.v1.InstancePartition - * @instance - */ - InstancePartition.prototype.name = ""; - - /** - * InstancePartition config. - * @member {string} config - * @memberof google.spanner.admin.instance.v1.InstancePartition - * @instance - */ - InstancePartition.prototype.config = ""; - - /** - * InstancePartition displayName. - * @member {string} displayName - * @memberof google.spanner.admin.instance.v1.InstancePartition - * @instance - */ - InstancePartition.prototype.displayName = ""; - - /** - * InstancePartition nodeCount. - * @member {number|null|undefined} nodeCount - * @memberof google.spanner.admin.instance.v1.InstancePartition - * @instance - */ - InstancePartition.prototype.nodeCount = null; - - /** - * InstancePartition processingUnits. - * @member {number|null|undefined} processingUnits - * @memberof google.spanner.admin.instance.v1.InstancePartition - * @instance - */ - InstancePartition.prototype.processingUnits = null; - - /** - * InstancePartition autoscalingConfig. - * @member {google.spanner.admin.instance.v1.IAutoscalingConfig|null|undefined} autoscalingConfig - * @memberof google.spanner.admin.instance.v1.InstancePartition - * @instance - */ - InstancePartition.prototype.autoscalingConfig = null; - - /** - * InstancePartition state. - * @member {google.spanner.admin.instance.v1.InstancePartition.State} state - * @memberof google.spanner.admin.instance.v1.InstancePartition - * @instance - */ - InstancePartition.prototype.state = 0; - - /** - * InstancePartition createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.spanner.admin.instance.v1.InstancePartition - * @instance - */ - InstancePartition.prototype.createTime = null; - - /** - * InstancePartition updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.spanner.admin.instance.v1.InstancePartition - * @instance - */ - InstancePartition.prototype.updateTime = null; - - /** - * InstancePartition referencingDatabases. - * @member {Array.} referencingDatabases - * @memberof google.spanner.admin.instance.v1.InstancePartition - * @instance - */ - InstancePartition.prototype.referencingDatabases = $util.emptyArray; - - /** - * InstancePartition referencingBackups. - * @member {Array.} referencingBackups - * @memberof google.spanner.admin.instance.v1.InstancePartition - * @instance - */ - InstancePartition.prototype.referencingBackups = $util.emptyArray; - - /** - * InstancePartition etag. - * @member {string} etag - * @memberof google.spanner.admin.instance.v1.InstancePartition - * @instance - */ - InstancePartition.prototype.etag = ""; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * InstancePartition computeCapacity. - * @member {"nodeCount"|"processingUnits"|undefined} computeCapacity - * @memberof google.spanner.admin.instance.v1.InstancePartition - * @instance - */ - Object.defineProperty(InstancePartition.prototype, "computeCapacity", { - get: $util.oneOfGetter($oneOfFields = ["nodeCount", "processingUnits"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new InstancePartition instance using the specified properties. - * @function create - * @memberof google.spanner.admin.instance.v1.InstancePartition - * @static - * @param {google.spanner.admin.instance.v1.IInstancePartition=} [properties] Properties to set - * @returns {google.spanner.admin.instance.v1.InstancePartition} InstancePartition instance - */ - InstancePartition.create = function create(properties) { - return new InstancePartition(properties); - }; - - /** - * Encodes the specified InstancePartition message. Does not implicitly {@link google.spanner.admin.instance.v1.InstancePartition.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.instance.v1.InstancePartition - * @static - * @param {google.spanner.admin.instance.v1.IInstancePartition} message InstancePartition message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InstancePartition.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.config != null && Object.hasOwnProperty.call(message, "config")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.config); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.displayName); - if (message.nodeCount != null && Object.hasOwnProperty.call(message, "nodeCount")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.nodeCount); - if (message.processingUnits != null && Object.hasOwnProperty.call(message, "processingUnits")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.processingUnits); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 7, wireType 0 =*/56).int32(message.state); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.referencingDatabases != null && message.referencingDatabases.length) - for (var i = 0; i < message.referencingDatabases.length; ++i) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.referencingDatabases[i]); - if (message.referencingBackups != null && message.referencingBackups.length) - for (var i = 0; i < message.referencingBackups.length; ++i) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.referencingBackups[i]); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.etag); - if (message.autoscalingConfig != null && Object.hasOwnProperty.call(message, "autoscalingConfig")) - $root.google.spanner.admin.instance.v1.AutoscalingConfig.encode(message.autoscalingConfig, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified InstancePartition message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.InstancePartition.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.instance.v1.InstancePartition - * @static - * @param {google.spanner.admin.instance.v1.IInstancePartition} message InstancePartition message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InstancePartition.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an InstancePartition message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.instance.v1.InstancePartition - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.instance.v1.InstancePartition} InstancePartition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InstancePartition.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.InstancePartition(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.config = reader.string(); - break; - } - case 3: { - message.displayName = reader.string(); - break; - } - case 5: { - message.nodeCount = reader.int32(); - break; - } - case 6: { - message.processingUnits = reader.int32(); - break; - } - case 13: { - message.autoscalingConfig = $root.google.spanner.admin.instance.v1.AutoscalingConfig.decode(reader, reader.uint32()); - break; - } - case 7: { - message.state = reader.int32(); - break; - } - case 8: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 9: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 10: { - if (!(message.referencingDatabases && message.referencingDatabases.length)) - message.referencingDatabases = []; - message.referencingDatabases.push(reader.string()); - break; - } - case 11: { - if (!(message.referencingBackups && message.referencingBackups.length)) - message.referencingBackups = []; - message.referencingBackups.push(reader.string()); - break; - } - case 12: { - message.etag = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an InstancePartition message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.instance.v1.InstancePartition - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.instance.v1.InstancePartition} InstancePartition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InstancePartition.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an InstancePartition message. - * @function verify - * @memberof google.spanner.admin.instance.v1.InstancePartition - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - InstancePartition.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.config != null && message.hasOwnProperty("config")) - if (!$util.isString(message.config)) - return "config: string expected"; - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) { - properties.computeCapacity = 1; - if (!$util.isInteger(message.nodeCount)) - return "nodeCount: integer expected"; - } - if (message.processingUnits != null && message.hasOwnProperty("processingUnits")) { - if (properties.computeCapacity === 1) - return "computeCapacity: multiple values"; - properties.computeCapacity = 1; - if (!$util.isInteger(message.processingUnits)) - return "processingUnits: integer expected"; - } - if (message.autoscalingConfig != null && message.hasOwnProperty("autoscalingConfig")) { - var error = $root.google.spanner.admin.instance.v1.AutoscalingConfig.verify(message.autoscalingConfig); - if (error) - return "autoscalingConfig." + 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.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); - if (error) - return "updateTime." + error; - } - if (message.referencingDatabases != null && message.hasOwnProperty("referencingDatabases")) { - if (!Array.isArray(message.referencingDatabases)) - return "referencingDatabases: array expected"; - for (var i = 0; i < message.referencingDatabases.length; ++i) - if (!$util.isString(message.referencingDatabases[i])) - return "referencingDatabases: string[] expected"; - } - if (message.referencingBackups != null && message.hasOwnProperty("referencingBackups")) { - if (!Array.isArray(message.referencingBackups)) - return "referencingBackups: array expected"; - for (var i = 0; i < message.referencingBackups.length; ++i) - if (!$util.isString(message.referencingBackups[i])) - return "referencingBackups: string[] expected"; - } - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - return null; - }; - - /** - * Creates an InstancePartition message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.instance.v1.InstancePartition - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.instance.v1.InstancePartition} InstancePartition - */ - InstancePartition.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.instance.v1.InstancePartition) - return object; - var message = new $root.google.spanner.admin.instance.v1.InstancePartition(); - if (object.name != null) - message.name = String(object.name); - if (object.config != null) - message.config = String(object.config); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.nodeCount != null) - message.nodeCount = object.nodeCount | 0; - if (object.processingUnits != null) - message.processingUnits = object.processingUnits | 0; - if (object.autoscalingConfig != null) { - if (typeof object.autoscalingConfig !== "object") - throw TypeError(".google.spanner.admin.instance.v1.InstancePartition.autoscalingConfig: object expected"); - message.autoscalingConfig = $root.google.spanner.admin.instance.v1.AutoscalingConfig.fromObject(object.autoscalingConfig); - } - switch (object.state) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "CREATING": - case 1: - message.state = 1; - break; - case "READY": - case 2: - message.state = 2; - break; - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.spanner.admin.instance.v1.InstancePartition.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.updateTime != null) { - if (typeof object.updateTime !== "object") - throw TypeError(".google.spanner.admin.instance.v1.InstancePartition.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.referencingDatabases) { - if (!Array.isArray(object.referencingDatabases)) - throw TypeError(".google.spanner.admin.instance.v1.InstancePartition.referencingDatabases: array expected"); - message.referencingDatabases = []; - for (var i = 0; i < object.referencingDatabases.length; ++i) - message.referencingDatabases[i] = String(object.referencingDatabases[i]); - } - if (object.referencingBackups) { - if (!Array.isArray(object.referencingBackups)) - throw TypeError(".google.spanner.admin.instance.v1.InstancePartition.referencingBackups: array expected"); - message.referencingBackups = []; - for (var i = 0; i < object.referencingBackups.length; ++i) - message.referencingBackups[i] = String(object.referencingBackups[i]); - } - if (object.etag != null) - message.etag = String(object.etag); - return message; - }; - - /** - * Creates a plain object from an InstancePartition message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.instance.v1.InstancePartition - * @static - * @param {google.spanner.admin.instance.v1.InstancePartition} message InstancePartition - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - InstancePartition.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.referencingDatabases = []; - object.referencingBackups = []; - } - if (options.defaults) { - object.name = ""; - object.config = ""; - object.displayName = ""; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.createTime = null; - object.updateTime = null; - object.etag = ""; - object.autoscalingConfig = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.config != null && message.hasOwnProperty("config")) - object.config = message.config; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) { - object.nodeCount = message.nodeCount; - if (options.oneofs) - object.computeCapacity = "nodeCount"; - } - if (message.processingUnits != null && message.hasOwnProperty("processingUnits")) { - object.processingUnits = message.processingUnits; - if (options.oneofs) - object.computeCapacity = "processingUnits"; - } - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.spanner.admin.instance.v1.InstancePartition.State[message.state] === undefined ? message.state : $root.google.spanner.admin.instance.v1.InstancePartition.State[message.state] : message.state; - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.updateTime != null && message.hasOwnProperty("updateTime")) - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); - if (message.referencingDatabases && message.referencingDatabases.length) { - object.referencingDatabases = []; - for (var j = 0; j < message.referencingDatabases.length; ++j) - object.referencingDatabases[j] = message.referencingDatabases[j]; - } - if (message.referencingBackups && message.referencingBackups.length) { - object.referencingBackups = []; - for (var j = 0; j < message.referencingBackups.length; ++j) - object.referencingBackups[j] = message.referencingBackups[j]; - } - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - if (message.autoscalingConfig != null && message.hasOwnProperty("autoscalingConfig")) - object.autoscalingConfig = $root.google.spanner.admin.instance.v1.AutoscalingConfig.toObject(message.autoscalingConfig, options); - return object; - }; - - /** - * Converts this InstancePartition to JSON. - * @function toJSON - * @memberof google.spanner.admin.instance.v1.InstancePartition - * @instance - * @returns {Object.} JSON object - */ - InstancePartition.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for InstancePartition - * @function getTypeUrl - * @memberof google.spanner.admin.instance.v1.InstancePartition - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - InstancePartition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.instance.v1.InstancePartition"; - }; - - /** - * State enum. - * @name google.spanner.admin.instance.v1.InstancePartition.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} CREATING=1 CREATING value - * @property {number} READY=2 READY value - */ - InstancePartition.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "CREATING"] = 1; - values[valuesById[2] = "READY"] = 2; - return values; - })(); - - return InstancePartition; - })(); - - v1.CreateInstancePartitionMetadata = (function() { - - /** - * Properties of a CreateInstancePartitionMetadata. - * @memberof google.spanner.admin.instance.v1 - * @interface ICreateInstancePartitionMetadata - * @property {google.spanner.admin.instance.v1.IInstancePartition|null} [instancePartition] CreateInstancePartitionMetadata instancePartition - * @property {google.protobuf.ITimestamp|null} [startTime] CreateInstancePartitionMetadata startTime - * @property {google.protobuf.ITimestamp|null} [cancelTime] CreateInstancePartitionMetadata cancelTime - * @property {google.protobuf.ITimestamp|null} [endTime] CreateInstancePartitionMetadata endTime - */ - - /** - * Constructs a new CreateInstancePartitionMetadata. - * @memberof google.spanner.admin.instance.v1 - * @classdesc Represents a CreateInstancePartitionMetadata. - * @implements ICreateInstancePartitionMetadata - * @constructor - * @param {google.spanner.admin.instance.v1.ICreateInstancePartitionMetadata=} [properties] Properties to set - */ - function CreateInstancePartitionMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateInstancePartitionMetadata instancePartition. - * @member {google.spanner.admin.instance.v1.IInstancePartition|null|undefined} instancePartition - * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionMetadata - * @instance - */ - CreateInstancePartitionMetadata.prototype.instancePartition = null; - - /** - * CreateInstancePartitionMetadata startTime. - * @member {google.protobuf.ITimestamp|null|undefined} startTime - * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionMetadata - * @instance - */ - CreateInstancePartitionMetadata.prototype.startTime = null; - - /** - * CreateInstancePartitionMetadata cancelTime. - * @member {google.protobuf.ITimestamp|null|undefined} cancelTime - * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionMetadata - * @instance - */ - CreateInstancePartitionMetadata.prototype.cancelTime = null; - - /** - * CreateInstancePartitionMetadata endTime. - * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionMetadata - * @instance - */ - CreateInstancePartitionMetadata.prototype.endTime = null; - - /** - * Creates a new CreateInstancePartitionMetadata instance using the specified properties. - * @function create - * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionMetadata - * @static - * @param {google.spanner.admin.instance.v1.ICreateInstancePartitionMetadata=} [properties] Properties to set - * @returns {google.spanner.admin.instance.v1.CreateInstancePartitionMetadata} CreateInstancePartitionMetadata instance - */ - CreateInstancePartitionMetadata.create = function create(properties) { - return new CreateInstancePartitionMetadata(properties); - }; - - /** - * Encodes the specified CreateInstancePartitionMetadata message. Does not implicitly {@link google.spanner.admin.instance.v1.CreateInstancePartitionMetadata.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionMetadata - * @static - * @param {google.spanner.admin.instance.v1.ICreateInstancePartitionMetadata} message CreateInstancePartitionMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateInstancePartitionMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.instancePartition != null && Object.hasOwnProperty.call(message, "instancePartition")) - $root.google.spanner.admin.instance.v1.InstancePartition.encode(message.instancePartition, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) - $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.cancelTime != null && Object.hasOwnProperty.call(message, "cancelTime")) - $root.google.protobuf.Timestamp.encode(message.cancelTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) - $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CreateInstancePartitionMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.CreateInstancePartitionMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionMetadata - * @static - * @param {google.spanner.admin.instance.v1.ICreateInstancePartitionMetadata} message CreateInstancePartitionMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateInstancePartitionMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateInstancePartitionMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.instance.v1.CreateInstancePartitionMetadata} CreateInstancePartitionMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateInstancePartitionMetadata.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.CreateInstancePartitionMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.instancePartition = $root.google.spanner.admin.instance.v1.InstancePartition.decode(reader, reader.uint32()); - break; - } - case 2: { - message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 3: { - message.cancelTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 4: { - message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateInstancePartitionMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.instance.v1.CreateInstancePartitionMetadata} CreateInstancePartitionMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateInstancePartitionMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateInstancePartitionMetadata message. - * @function verify - * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateInstancePartitionMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.instancePartition != null && message.hasOwnProperty("instancePartition")) { - var error = $root.google.spanner.admin.instance.v1.InstancePartition.verify(message.instancePartition); - if (error) - return "instancePartition." + error; - } - if (message.startTime != null && message.hasOwnProperty("startTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.startTime); - if (error) - return "startTime." + error; - } - if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.cancelTime); - if (error) - return "cancelTime." + error; - } - if (message.endTime != null && message.hasOwnProperty("endTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.endTime); - if (error) - return "endTime." + error; - } - return null; - }; - - /** - * Creates a CreateInstancePartitionMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.instance.v1.CreateInstancePartitionMetadata} CreateInstancePartitionMetadata - */ - CreateInstancePartitionMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.instance.v1.CreateInstancePartitionMetadata) - return object; - var message = new $root.google.spanner.admin.instance.v1.CreateInstancePartitionMetadata(); - if (object.instancePartition != null) { - if (typeof object.instancePartition !== "object") - throw TypeError(".google.spanner.admin.instance.v1.CreateInstancePartitionMetadata.instancePartition: object expected"); - message.instancePartition = $root.google.spanner.admin.instance.v1.InstancePartition.fromObject(object.instancePartition); - } - if (object.startTime != null) { - if (typeof object.startTime !== "object") - throw TypeError(".google.spanner.admin.instance.v1.CreateInstancePartitionMetadata.startTime: object expected"); - message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); - } - if (object.cancelTime != null) { - if (typeof object.cancelTime !== "object") - throw TypeError(".google.spanner.admin.instance.v1.CreateInstancePartitionMetadata.cancelTime: object expected"); - message.cancelTime = $root.google.protobuf.Timestamp.fromObject(object.cancelTime); - } - if (object.endTime != null) { - if (typeof object.endTime !== "object") - throw TypeError(".google.spanner.admin.instance.v1.CreateInstancePartitionMetadata.endTime: object expected"); - message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); - } - return message; - }; - - /** - * Creates a plain object from a CreateInstancePartitionMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionMetadata - * @static - * @param {google.spanner.admin.instance.v1.CreateInstancePartitionMetadata} message CreateInstancePartitionMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateInstancePartitionMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.instancePartition = null; - object.startTime = null; - object.cancelTime = null; - object.endTime = null; - } - if (message.instancePartition != null && message.hasOwnProperty("instancePartition")) - object.instancePartition = $root.google.spanner.admin.instance.v1.InstancePartition.toObject(message.instancePartition, options); - if (message.startTime != null && message.hasOwnProperty("startTime")) - object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); - if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) - object.cancelTime = $root.google.protobuf.Timestamp.toObject(message.cancelTime, options); - if (message.endTime != null && message.hasOwnProperty("endTime")) - object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); - return object; - }; - - /** - * Converts this CreateInstancePartitionMetadata to JSON. - * @function toJSON - * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionMetadata - * @instance - * @returns {Object.} JSON object - */ - CreateInstancePartitionMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateInstancePartitionMetadata - * @function getTypeUrl - * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateInstancePartitionMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.instance.v1.CreateInstancePartitionMetadata"; - }; - - return CreateInstancePartitionMetadata; - })(); - - v1.CreateInstancePartitionRequest = (function() { - - /** - * Properties of a CreateInstancePartitionRequest. - * @memberof google.spanner.admin.instance.v1 - * @interface ICreateInstancePartitionRequest - * @property {string|null} [parent] CreateInstancePartitionRequest parent - * @property {string|null} [instancePartitionId] CreateInstancePartitionRequest instancePartitionId - * @property {google.spanner.admin.instance.v1.IInstancePartition|null} [instancePartition] CreateInstancePartitionRequest instancePartition - */ - - /** - * Constructs a new CreateInstancePartitionRequest. - * @memberof google.spanner.admin.instance.v1 - * @classdesc Represents a CreateInstancePartitionRequest. - * @implements ICreateInstancePartitionRequest - * @constructor - * @param {google.spanner.admin.instance.v1.ICreateInstancePartitionRequest=} [properties] Properties to set - */ - function CreateInstancePartitionRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateInstancePartitionRequest parent. - * @member {string} parent - * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionRequest - * @instance - */ - CreateInstancePartitionRequest.prototype.parent = ""; - - /** - * CreateInstancePartitionRequest instancePartitionId. - * @member {string} instancePartitionId - * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionRequest - * @instance - */ - CreateInstancePartitionRequest.prototype.instancePartitionId = ""; - - /** - * CreateInstancePartitionRequest instancePartition. - * @member {google.spanner.admin.instance.v1.IInstancePartition|null|undefined} instancePartition - * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionRequest - * @instance - */ - CreateInstancePartitionRequest.prototype.instancePartition = null; - - /** - * Creates a new CreateInstancePartitionRequest instance using the specified properties. - * @function create - * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionRequest - * @static - * @param {google.spanner.admin.instance.v1.ICreateInstancePartitionRequest=} [properties] Properties to set - * @returns {google.spanner.admin.instance.v1.CreateInstancePartitionRequest} CreateInstancePartitionRequest instance - */ - CreateInstancePartitionRequest.create = function create(properties) { - return new CreateInstancePartitionRequest(properties); - }; - - /** - * Encodes the specified CreateInstancePartitionRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.CreateInstancePartitionRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionRequest - * @static - * @param {google.spanner.admin.instance.v1.ICreateInstancePartitionRequest} message CreateInstancePartitionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateInstancePartitionRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.instancePartitionId != null && Object.hasOwnProperty.call(message, "instancePartitionId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.instancePartitionId); - if (message.instancePartition != null && Object.hasOwnProperty.call(message, "instancePartition")) - $root.google.spanner.admin.instance.v1.InstancePartition.encode(message.instancePartition, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CreateInstancePartitionRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.CreateInstancePartitionRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionRequest - * @static - * @param {google.spanner.admin.instance.v1.ICreateInstancePartitionRequest} message CreateInstancePartitionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateInstancePartitionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateInstancePartitionRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.instance.v1.CreateInstancePartitionRequest} CreateInstancePartitionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateInstancePartitionRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.CreateInstancePartitionRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.instancePartitionId = reader.string(); - break; - } - case 3: { - message.instancePartition = $root.google.spanner.admin.instance.v1.InstancePartition.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateInstancePartitionRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.instance.v1.CreateInstancePartitionRequest} CreateInstancePartitionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateInstancePartitionRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateInstancePartitionRequest message. - * @function verify - * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateInstancePartitionRequest.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.instancePartitionId != null && message.hasOwnProperty("instancePartitionId")) - if (!$util.isString(message.instancePartitionId)) - return "instancePartitionId: string expected"; - if (message.instancePartition != null && message.hasOwnProperty("instancePartition")) { - var error = $root.google.spanner.admin.instance.v1.InstancePartition.verify(message.instancePartition); - if (error) - return "instancePartition." + error; - } - return null; - }; - - /** - * Creates a CreateInstancePartitionRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.instance.v1.CreateInstancePartitionRequest} CreateInstancePartitionRequest - */ - CreateInstancePartitionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.instance.v1.CreateInstancePartitionRequest) - return object; - var message = new $root.google.spanner.admin.instance.v1.CreateInstancePartitionRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.instancePartitionId != null) - message.instancePartitionId = String(object.instancePartitionId); - if (object.instancePartition != null) { - if (typeof object.instancePartition !== "object") - throw TypeError(".google.spanner.admin.instance.v1.CreateInstancePartitionRequest.instancePartition: object expected"); - message.instancePartition = $root.google.spanner.admin.instance.v1.InstancePartition.fromObject(object.instancePartition); - } - return message; - }; - - /** - * Creates a plain object from a CreateInstancePartitionRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionRequest - * @static - * @param {google.spanner.admin.instance.v1.CreateInstancePartitionRequest} message CreateInstancePartitionRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateInstancePartitionRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.instancePartitionId = ""; - object.instancePartition = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.instancePartitionId != null && message.hasOwnProperty("instancePartitionId")) - object.instancePartitionId = message.instancePartitionId; - if (message.instancePartition != null && message.hasOwnProperty("instancePartition")) - object.instancePartition = $root.google.spanner.admin.instance.v1.InstancePartition.toObject(message.instancePartition, options); - return object; - }; - - /** - * Converts this CreateInstancePartitionRequest to JSON. - * @function toJSON - * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionRequest - * @instance - * @returns {Object.} JSON object - */ - CreateInstancePartitionRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateInstancePartitionRequest - * @function getTypeUrl - * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateInstancePartitionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.instance.v1.CreateInstancePartitionRequest"; - }; - - return CreateInstancePartitionRequest; - })(); - - v1.DeleteInstancePartitionRequest = (function() { - - /** - * Properties of a DeleteInstancePartitionRequest. - * @memberof google.spanner.admin.instance.v1 - * @interface IDeleteInstancePartitionRequest - * @property {string|null} [name] DeleteInstancePartitionRequest name - * @property {string|null} [etag] DeleteInstancePartitionRequest etag - */ - - /** - * Constructs a new DeleteInstancePartitionRequest. - * @memberof google.spanner.admin.instance.v1 - * @classdesc Represents a DeleteInstancePartitionRequest. - * @implements IDeleteInstancePartitionRequest - * @constructor - * @param {google.spanner.admin.instance.v1.IDeleteInstancePartitionRequest=} [properties] Properties to set - */ - function DeleteInstancePartitionRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteInstancePartitionRequest name. - * @member {string} name - * @memberof google.spanner.admin.instance.v1.DeleteInstancePartitionRequest - * @instance - */ - DeleteInstancePartitionRequest.prototype.name = ""; - - /** - * DeleteInstancePartitionRequest etag. - * @member {string} etag - * @memberof google.spanner.admin.instance.v1.DeleteInstancePartitionRequest - * @instance - */ - DeleteInstancePartitionRequest.prototype.etag = ""; - - /** - * Creates a new DeleteInstancePartitionRequest instance using the specified properties. - * @function create - * @memberof google.spanner.admin.instance.v1.DeleteInstancePartitionRequest - * @static - * @param {google.spanner.admin.instance.v1.IDeleteInstancePartitionRequest=} [properties] Properties to set - * @returns {google.spanner.admin.instance.v1.DeleteInstancePartitionRequest} DeleteInstancePartitionRequest instance - */ - DeleteInstancePartitionRequest.create = function create(properties) { - return new DeleteInstancePartitionRequest(properties); - }; - - /** - * Encodes the specified DeleteInstancePartitionRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.DeleteInstancePartitionRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.instance.v1.DeleteInstancePartitionRequest - * @static - * @param {google.spanner.admin.instance.v1.IDeleteInstancePartitionRequest} message DeleteInstancePartitionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteInstancePartitionRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.etag); - return writer; - }; - - /** - * Encodes the specified DeleteInstancePartitionRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.DeleteInstancePartitionRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.instance.v1.DeleteInstancePartitionRequest - * @static - * @param {google.spanner.admin.instance.v1.IDeleteInstancePartitionRequest} message DeleteInstancePartitionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteInstancePartitionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteInstancePartitionRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.instance.v1.DeleteInstancePartitionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.instance.v1.DeleteInstancePartitionRequest} DeleteInstancePartitionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteInstancePartitionRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.DeleteInstancePartitionRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.etag = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteInstancePartitionRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.instance.v1.DeleteInstancePartitionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.instance.v1.DeleteInstancePartitionRequest} DeleteInstancePartitionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteInstancePartitionRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteInstancePartitionRequest message. - * @function verify - * @memberof google.spanner.admin.instance.v1.DeleteInstancePartitionRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteInstancePartitionRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - return null; - }; - - /** - * Creates a DeleteInstancePartitionRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.instance.v1.DeleteInstancePartitionRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.instance.v1.DeleteInstancePartitionRequest} DeleteInstancePartitionRequest - */ - DeleteInstancePartitionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.instance.v1.DeleteInstancePartitionRequest) - return object; - var message = new $root.google.spanner.admin.instance.v1.DeleteInstancePartitionRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.etag != null) - message.etag = String(object.etag); - return message; - }; - - /** - * Creates a plain object from a DeleteInstancePartitionRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.instance.v1.DeleteInstancePartitionRequest - * @static - * @param {google.spanner.admin.instance.v1.DeleteInstancePartitionRequest} message DeleteInstancePartitionRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteInstancePartitionRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.etag = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - return object; - }; - - /** - * Converts this DeleteInstancePartitionRequest to JSON. - * @function toJSON - * @memberof google.spanner.admin.instance.v1.DeleteInstancePartitionRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteInstancePartitionRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteInstancePartitionRequest - * @function getTypeUrl - * @memberof google.spanner.admin.instance.v1.DeleteInstancePartitionRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteInstancePartitionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.instance.v1.DeleteInstancePartitionRequest"; - }; - - return DeleteInstancePartitionRequest; - })(); - - v1.GetInstancePartitionRequest = (function() { - - /** - * Properties of a GetInstancePartitionRequest. - * @memberof google.spanner.admin.instance.v1 - * @interface IGetInstancePartitionRequest - * @property {string|null} [name] GetInstancePartitionRequest name - */ - - /** - * Constructs a new GetInstancePartitionRequest. - * @memberof google.spanner.admin.instance.v1 - * @classdesc Represents a GetInstancePartitionRequest. - * @implements IGetInstancePartitionRequest - * @constructor - * @param {google.spanner.admin.instance.v1.IGetInstancePartitionRequest=} [properties] Properties to set - */ - function GetInstancePartitionRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetInstancePartitionRequest name. - * @member {string} name - * @memberof google.spanner.admin.instance.v1.GetInstancePartitionRequest - * @instance - */ - GetInstancePartitionRequest.prototype.name = ""; - - /** - * Creates a new GetInstancePartitionRequest instance using the specified properties. - * @function create - * @memberof google.spanner.admin.instance.v1.GetInstancePartitionRequest - * @static - * @param {google.spanner.admin.instance.v1.IGetInstancePartitionRequest=} [properties] Properties to set - * @returns {google.spanner.admin.instance.v1.GetInstancePartitionRequest} GetInstancePartitionRequest instance - */ - GetInstancePartitionRequest.create = function create(properties) { - return new GetInstancePartitionRequest(properties); - }; - - /** - * Encodes the specified GetInstancePartitionRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.GetInstancePartitionRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.instance.v1.GetInstancePartitionRequest - * @static - * @param {google.spanner.admin.instance.v1.IGetInstancePartitionRequest} message GetInstancePartitionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetInstancePartitionRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; - - /** - * Encodes the specified GetInstancePartitionRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.GetInstancePartitionRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.instance.v1.GetInstancePartitionRequest - * @static - * @param {google.spanner.admin.instance.v1.IGetInstancePartitionRequest} message GetInstancePartitionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetInstancePartitionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetInstancePartitionRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.instance.v1.GetInstancePartitionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.instance.v1.GetInstancePartitionRequest} GetInstancePartitionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetInstancePartitionRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.GetInstancePartitionRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetInstancePartitionRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.instance.v1.GetInstancePartitionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.instance.v1.GetInstancePartitionRequest} GetInstancePartitionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetInstancePartitionRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetInstancePartitionRequest message. - * @function verify - * @memberof google.spanner.admin.instance.v1.GetInstancePartitionRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetInstancePartitionRequest.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 GetInstancePartitionRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.instance.v1.GetInstancePartitionRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.instance.v1.GetInstancePartitionRequest} GetInstancePartitionRequest - */ - GetInstancePartitionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.instance.v1.GetInstancePartitionRequest) - return object; - var message = new $root.google.spanner.admin.instance.v1.GetInstancePartitionRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetInstancePartitionRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.instance.v1.GetInstancePartitionRequest - * @static - * @param {google.spanner.admin.instance.v1.GetInstancePartitionRequest} message GetInstancePartitionRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetInstancePartitionRequest.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 GetInstancePartitionRequest to JSON. - * @function toJSON - * @memberof google.spanner.admin.instance.v1.GetInstancePartitionRequest - * @instance - * @returns {Object.} JSON object - */ - GetInstancePartitionRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetInstancePartitionRequest - * @function getTypeUrl - * @memberof google.spanner.admin.instance.v1.GetInstancePartitionRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetInstancePartitionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.instance.v1.GetInstancePartitionRequest"; - }; - - return GetInstancePartitionRequest; - })(); - - v1.UpdateInstancePartitionRequest = (function() { - - /** - * Properties of an UpdateInstancePartitionRequest. - * @memberof google.spanner.admin.instance.v1 - * @interface IUpdateInstancePartitionRequest - * @property {google.spanner.admin.instance.v1.IInstancePartition|null} [instancePartition] UpdateInstancePartitionRequest instancePartition - * @property {google.protobuf.IFieldMask|null} [fieldMask] UpdateInstancePartitionRequest fieldMask - */ - - /** - * Constructs a new UpdateInstancePartitionRequest. - * @memberof google.spanner.admin.instance.v1 - * @classdesc Represents an UpdateInstancePartitionRequest. - * @implements IUpdateInstancePartitionRequest - * @constructor - * @param {google.spanner.admin.instance.v1.IUpdateInstancePartitionRequest=} [properties] Properties to set - */ - function UpdateInstancePartitionRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateInstancePartitionRequest instancePartition. - * @member {google.spanner.admin.instance.v1.IInstancePartition|null|undefined} instancePartition - * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionRequest - * @instance - */ - UpdateInstancePartitionRequest.prototype.instancePartition = null; - - /** - * UpdateInstancePartitionRequest fieldMask. - * @member {google.protobuf.IFieldMask|null|undefined} fieldMask - * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionRequest - * @instance - */ - UpdateInstancePartitionRequest.prototype.fieldMask = null; - - /** - * Creates a new UpdateInstancePartitionRequest instance using the specified properties. - * @function create - * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionRequest - * @static - * @param {google.spanner.admin.instance.v1.IUpdateInstancePartitionRequest=} [properties] Properties to set - * @returns {google.spanner.admin.instance.v1.UpdateInstancePartitionRequest} UpdateInstancePartitionRequest instance - */ - UpdateInstancePartitionRequest.create = function create(properties) { - return new UpdateInstancePartitionRequest(properties); - }; - - /** - * Encodes the specified UpdateInstancePartitionRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.UpdateInstancePartitionRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionRequest - * @static - * @param {google.spanner.admin.instance.v1.IUpdateInstancePartitionRequest} message UpdateInstancePartitionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateInstancePartitionRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.instancePartition != null && Object.hasOwnProperty.call(message, "instancePartition")) - $root.google.spanner.admin.instance.v1.InstancePartition.encode(message.instancePartition, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.fieldMask != null && Object.hasOwnProperty.call(message, "fieldMask")) - $root.google.protobuf.FieldMask.encode(message.fieldMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified UpdateInstancePartitionRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.UpdateInstancePartitionRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionRequest - * @static - * @param {google.spanner.admin.instance.v1.IUpdateInstancePartitionRequest} message UpdateInstancePartitionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateInstancePartitionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateInstancePartitionRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.instance.v1.UpdateInstancePartitionRequest} UpdateInstancePartitionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateInstancePartitionRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.UpdateInstancePartitionRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.instancePartition = $root.google.spanner.admin.instance.v1.InstancePartition.decode(reader, reader.uint32()); - break; - } - case 2: { - message.fieldMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateInstancePartitionRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.instance.v1.UpdateInstancePartitionRequest} UpdateInstancePartitionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateInstancePartitionRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateInstancePartitionRequest message. - * @function verify - * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateInstancePartitionRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.instancePartition != null && message.hasOwnProperty("instancePartition")) { - var error = $root.google.spanner.admin.instance.v1.InstancePartition.verify(message.instancePartition); - if (error) - return "instancePartition." + error; - } - if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.fieldMask); - if (error) - return "fieldMask." + error; - } - return null; - }; - - /** - * Creates an UpdateInstancePartitionRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.instance.v1.UpdateInstancePartitionRequest} UpdateInstancePartitionRequest - */ - UpdateInstancePartitionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.instance.v1.UpdateInstancePartitionRequest) - return object; - var message = new $root.google.spanner.admin.instance.v1.UpdateInstancePartitionRequest(); - if (object.instancePartition != null) { - if (typeof object.instancePartition !== "object") - throw TypeError(".google.spanner.admin.instance.v1.UpdateInstancePartitionRequest.instancePartition: object expected"); - message.instancePartition = $root.google.spanner.admin.instance.v1.InstancePartition.fromObject(object.instancePartition); - } - if (object.fieldMask != null) { - if (typeof object.fieldMask !== "object") - throw TypeError(".google.spanner.admin.instance.v1.UpdateInstancePartitionRequest.fieldMask: object expected"); - message.fieldMask = $root.google.protobuf.FieldMask.fromObject(object.fieldMask); - } - return message; - }; - - /** - * Creates a plain object from an UpdateInstancePartitionRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionRequest - * @static - * @param {google.spanner.admin.instance.v1.UpdateInstancePartitionRequest} message UpdateInstancePartitionRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateInstancePartitionRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.instancePartition = null; - object.fieldMask = null; - } - if (message.instancePartition != null && message.hasOwnProperty("instancePartition")) - object.instancePartition = $root.google.spanner.admin.instance.v1.InstancePartition.toObject(message.instancePartition, options); - if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) - object.fieldMask = $root.google.protobuf.FieldMask.toObject(message.fieldMask, options); - return object; - }; - - /** - * Converts this UpdateInstancePartitionRequest to JSON. - * @function toJSON - * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateInstancePartitionRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateInstancePartitionRequest - * @function getTypeUrl - * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateInstancePartitionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.instance.v1.UpdateInstancePartitionRequest"; - }; - - return UpdateInstancePartitionRequest; - })(); - - v1.UpdateInstancePartitionMetadata = (function() { - - /** - * Properties of an UpdateInstancePartitionMetadata. - * @memberof google.spanner.admin.instance.v1 - * @interface IUpdateInstancePartitionMetadata - * @property {google.spanner.admin.instance.v1.IInstancePartition|null} [instancePartition] UpdateInstancePartitionMetadata instancePartition - * @property {google.protobuf.ITimestamp|null} [startTime] UpdateInstancePartitionMetadata startTime - * @property {google.protobuf.ITimestamp|null} [cancelTime] UpdateInstancePartitionMetadata cancelTime - * @property {google.protobuf.ITimestamp|null} [endTime] UpdateInstancePartitionMetadata endTime - */ - - /** - * Constructs a new UpdateInstancePartitionMetadata. - * @memberof google.spanner.admin.instance.v1 - * @classdesc Represents an UpdateInstancePartitionMetadata. - * @implements IUpdateInstancePartitionMetadata - * @constructor - * @param {google.spanner.admin.instance.v1.IUpdateInstancePartitionMetadata=} [properties] Properties to set - */ - function UpdateInstancePartitionMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateInstancePartitionMetadata instancePartition. - * @member {google.spanner.admin.instance.v1.IInstancePartition|null|undefined} instancePartition - * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata - * @instance - */ - UpdateInstancePartitionMetadata.prototype.instancePartition = null; - - /** - * UpdateInstancePartitionMetadata startTime. - * @member {google.protobuf.ITimestamp|null|undefined} startTime - * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata - * @instance - */ - UpdateInstancePartitionMetadata.prototype.startTime = null; - - /** - * UpdateInstancePartitionMetadata cancelTime. - * @member {google.protobuf.ITimestamp|null|undefined} cancelTime - * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata - * @instance - */ - UpdateInstancePartitionMetadata.prototype.cancelTime = null; - - /** - * UpdateInstancePartitionMetadata endTime. - * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata - * @instance - */ - UpdateInstancePartitionMetadata.prototype.endTime = null; - - /** - * Creates a new UpdateInstancePartitionMetadata instance using the specified properties. - * @function create - * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata - * @static - * @param {google.spanner.admin.instance.v1.IUpdateInstancePartitionMetadata=} [properties] Properties to set - * @returns {google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata} UpdateInstancePartitionMetadata instance - */ - UpdateInstancePartitionMetadata.create = function create(properties) { - return new UpdateInstancePartitionMetadata(properties); - }; - - /** - * Encodes the specified UpdateInstancePartitionMetadata message. Does not implicitly {@link google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata - * @static - * @param {google.spanner.admin.instance.v1.IUpdateInstancePartitionMetadata} message UpdateInstancePartitionMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateInstancePartitionMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.instancePartition != null && Object.hasOwnProperty.call(message, "instancePartition")) - $root.google.spanner.admin.instance.v1.InstancePartition.encode(message.instancePartition, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) - $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.cancelTime != null && Object.hasOwnProperty.call(message, "cancelTime")) - $root.google.protobuf.Timestamp.encode(message.cancelTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) - $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified UpdateInstancePartitionMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata - * @static - * @param {google.spanner.admin.instance.v1.IUpdateInstancePartitionMetadata} message UpdateInstancePartitionMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateInstancePartitionMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateInstancePartitionMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata} UpdateInstancePartitionMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateInstancePartitionMetadata.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.instancePartition = $root.google.spanner.admin.instance.v1.InstancePartition.decode(reader, reader.uint32()); - break; - } - case 2: { - message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 3: { - message.cancelTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 4: { - message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateInstancePartitionMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata} UpdateInstancePartitionMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateInstancePartitionMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateInstancePartitionMetadata message. - * @function verify - * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateInstancePartitionMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.instancePartition != null && message.hasOwnProperty("instancePartition")) { - var error = $root.google.spanner.admin.instance.v1.InstancePartition.verify(message.instancePartition); - if (error) - return "instancePartition." + error; - } - if (message.startTime != null && message.hasOwnProperty("startTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.startTime); - if (error) - return "startTime." + error; - } - if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.cancelTime); - if (error) - return "cancelTime." + error; - } - if (message.endTime != null && message.hasOwnProperty("endTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.endTime); - if (error) - return "endTime." + error; - } - return null; - }; - - /** - * Creates an UpdateInstancePartitionMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata} UpdateInstancePartitionMetadata - */ - UpdateInstancePartitionMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata) - return object; - var message = new $root.google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata(); - if (object.instancePartition != null) { - if (typeof object.instancePartition !== "object") - throw TypeError(".google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata.instancePartition: object expected"); - message.instancePartition = $root.google.spanner.admin.instance.v1.InstancePartition.fromObject(object.instancePartition); - } - if (object.startTime != null) { - if (typeof object.startTime !== "object") - throw TypeError(".google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata.startTime: object expected"); - message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); - } - if (object.cancelTime != null) { - if (typeof object.cancelTime !== "object") - throw TypeError(".google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata.cancelTime: object expected"); - message.cancelTime = $root.google.protobuf.Timestamp.fromObject(object.cancelTime); - } - if (object.endTime != null) { - if (typeof object.endTime !== "object") - throw TypeError(".google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata.endTime: object expected"); - message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); - } - return message; - }; - - /** - * Creates a plain object from an UpdateInstancePartitionMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata - * @static - * @param {google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata} message UpdateInstancePartitionMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateInstancePartitionMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.instancePartition = null; - object.startTime = null; - object.cancelTime = null; - object.endTime = null; - } - if (message.instancePartition != null && message.hasOwnProperty("instancePartition")) - object.instancePartition = $root.google.spanner.admin.instance.v1.InstancePartition.toObject(message.instancePartition, options); - if (message.startTime != null && message.hasOwnProperty("startTime")) - object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); - if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) - object.cancelTime = $root.google.protobuf.Timestamp.toObject(message.cancelTime, options); - if (message.endTime != null && message.hasOwnProperty("endTime")) - object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); - return object; - }; - - /** - * Converts this UpdateInstancePartitionMetadata to JSON. - * @function toJSON - * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata - * @instance - * @returns {Object.} JSON object - */ - UpdateInstancePartitionMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateInstancePartitionMetadata - * @function getTypeUrl - * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateInstancePartitionMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata"; - }; - - return UpdateInstancePartitionMetadata; - })(); - - v1.ListInstancePartitionsRequest = (function() { - - /** - * Properties of a ListInstancePartitionsRequest. - * @memberof google.spanner.admin.instance.v1 - * @interface IListInstancePartitionsRequest - * @property {string|null} [parent] ListInstancePartitionsRequest parent - * @property {number|null} [pageSize] ListInstancePartitionsRequest pageSize - * @property {string|null} [pageToken] ListInstancePartitionsRequest pageToken - * @property {google.protobuf.ITimestamp|null} [instancePartitionDeadline] ListInstancePartitionsRequest instancePartitionDeadline - */ - - /** - * Constructs a new ListInstancePartitionsRequest. - * @memberof google.spanner.admin.instance.v1 - * @classdesc Represents a ListInstancePartitionsRequest. - * @implements IListInstancePartitionsRequest - * @constructor - * @param {google.spanner.admin.instance.v1.IListInstancePartitionsRequest=} [properties] Properties to set - */ - function ListInstancePartitionsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListInstancePartitionsRequest parent. - * @member {string} parent - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsRequest - * @instance - */ - ListInstancePartitionsRequest.prototype.parent = ""; - - /** - * ListInstancePartitionsRequest pageSize. - * @member {number} pageSize - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsRequest - * @instance - */ - ListInstancePartitionsRequest.prototype.pageSize = 0; - - /** - * ListInstancePartitionsRequest pageToken. - * @member {string} pageToken - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsRequest - * @instance - */ - ListInstancePartitionsRequest.prototype.pageToken = ""; - - /** - * ListInstancePartitionsRequest instancePartitionDeadline. - * @member {google.protobuf.ITimestamp|null|undefined} instancePartitionDeadline - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsRequest - * @instance - */ - ListInstancePartitionsRequest.prototype.instancePartitionDeadline = null; - - /** - * Creates a new ListInstancePartitionsRequest instance using the specified properties. - * @function create - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsRequest - * @static - * @param {google.spanner.admin.instance.v1.IListInstancePartitionsRequest=} [properties] Properties to set - * @returns {google.spanner.admin.instance.v1.ListInstancePartitionsRequest} ListInstancePartitionsRequest instance - */ - ListInstancePartitionsRequest.create = function create(properties) { - return new ListInstancePartitionsRequest(properties); - }; - - /** - * Encodes the specified ListInstancePartitionsRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancePartitionsRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsRequest - * @static - * @param {google.spanner.admin.instance.v1.IListInstancePartitionsRequest} message ListInstancePartitionsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListInstancePartitionsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.instancePartitionDeadline != null && Object.hasOwnProperty.call(message, "instancePartitionDeadline")) - $root.google.protobuf.Timestamp.encode(message.instancePartitionDeadline, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ListInstancePartitionsRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancePartitionsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsRequest - * @static - * @param {google.spanner.admin.instance.v1.IListInstancePartitionsRequest} message ListInstancePartitionsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListInstancePartitionsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListInstancePartitionsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.instance.v1.ListInstancePartitionsRequest} ListInstancePartitionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListInstancePartitionsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.ListInstancePartitionsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - case 4: { - message.instancePartitionDeadline = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListInstancePartitionsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.instance.v1.ListInstancePartitionsRequest} ListInstancePartitionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListInstancePartitionsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListInstancePartitionsRequest message. - * @function verify - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListInstancePartitionsRequest.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.instancePartitionDeadline != null && message.hasOwnProperty("instancePartitionDeadline")) { - var error = $root.google.protobuf.Timestamp.verify(message.instancePartitionDeadline); - if (error) - return "instancePartitionDeadline." + error; - } - return null; - }; - - /** - * Creates a ListInstancePartitionsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.instance.v1.ListInstancePartitionsRequest} ListInstancePartitionsRequest - */ - ListInstancePartitionsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.instance.v1.ListInstancePartitionsRequest) - return object; - var message = new $root.google.spanner.admin.instance.v1.ListInstancePartitionsRequest(); - 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); - if (object.instancePartitionDeadline != null) { - if (typeof object.instancePartitionDeadline !== "object") - throw TypeError(".google.spanner.admin.instance.v1.ListInstancePartitionsRequest.instancePartitionDeadline: object expected"); - message.instancePartitionDeadline = $root.google.protobuf.Timestamp.fromObject(object.instancePartitionDeadline); - } - return message; - }; - - /** - * Creates a plain object from a ListInstancePartitionsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsRequest - * @static - * @param {google.spanner.admin.instance.v1.ListInstancePartitionsRequest} message ListInstancePartitionsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListInstancePartitionsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.instancePartitionDeadline = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.instancePartitionDeadline != null && message.hasOwnProperty("instancePartitionDeadline")) - object.instancePartitionDeadline = $root.google.protobuf.Timestamp.toObject(message.instancePartitionDeadline, options); - return object; - }; - - /** - * Converts this ListInstancePartitionsRequest to JSON. - * @function toJSON - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsRequest - * @instance - * @returns {Object.} JSON object - */ - ListInstancePartitionsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListInstancePartitionsRequest - * @function getTypeUrl - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListInstancePartitionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.instance.v1.ListInstancePartitionsRequest"; - }; - - return ListInstancePartitionsRequest; - })(); - - v1.ListInstancePartitionsResponse = (function() { - - /** - * Properties of a ListInstancePartitionsResponse. - * @memberof google.spanner.admin.instance.v1 - * @interface IListInstancePartitionsResponse - * @property {Array.|null} [instancePartitions] ListInstancePartitionsResponse instancePartitions - * @property {string|null} [nextPageToken] ListInstancePartitionsResponse nextPageToken - * @property {Array.|null} [unreachable] ListInstancePartitionsResponse unreachable - */ - - /** - * Constructs a new ListInstancePartitionsResponse. - * @memberof google.spanner.admin.instance.v1 - * @classdesc Represents a ListInstancePartitionsResponse. - * @implements IListInstancePartitionsResponse - * @constructor - * @param {google.spanner.admin.instance.v1.IListInstancePartitionsResponse=} [properties] Properties to set - */ - function ListInstancePartitionsResponse(properties) { - this.instancePartitions = []; - this.unreachable = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListInstancePartitionsResponse instancePartitions. - * @member {Array.} instancePartitions - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsResponse - * @instance - */ - ListInstancePartitionsResponse.prototype.instancePartitions = $util.emptyArray; - - /** - * ListInstancePartitionsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsResponse - * @instance - */ - ListInstancePartitionsResponse.prototype.nextPageToken = ""; - - /** - * ListInstancePartitionsResponse unreachable. - * @member {Array.} unreachable - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsResponse - * @instance - */ - ListInstancePartitionsResponse.prototype.unreachable = $util.emptyArray; - - /** - * Creates a new ListInstancePartitionsResponse instance using the specified properties. - * @function create - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsResponse - * @static - * @param {google.spanner.admin.instance.v1.IListInstancePartitionsResponse=} [properties] Properties to set - * @returns {google.spanner.admin.instance.v1.ListInstancePartitionsResponse} ListInstancePartitionsResponse instance - */ - ListInstancePartitionsResponse.create = function create(properties) { - return new ListInstancePartitionsResponse(properties); - }; - - /** - * Encodes the specified ListInstancePartitionsResponse message. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancePartitionsResponse.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsResponse - * @static - * @param {google.spanner.admin.instance.v1.IListInstancePartitionsResponse} message ListInstancePartitionsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListInstancePartitionsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.instancePartitions != null && message.instancePartitions.length) - for (var i = 0; i < message.instancePartitions.length; ++i) - $root.google.spanner.admin.instance.v1.InstancePartition.encode(message.instancePartitions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - if (message.unreachable != null && message.unreachable.length) - for (var i = 0; i < message.unreachable.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); - return writer; - }; - - /** - * Encodes the specified ListInstancePartitionsResponse message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancePartitionsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsResponse - * @static - * @param {google.spanner.admin.instance.v1.IListInstancePartitionsResponse} message ListInstancePartitionsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListInstancePartitionsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListInstancePartitionsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.instance.v1.ListInstancePartitionsResponse} ListInstancePartitionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListInstancePartitionsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.ListInstancePartitionsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.instancePartitions && message.instancePartitions.length)) - message.instancePartitions = []; - message.instancePartitions.push($root.google.spanner.admin.instance.v1.InstancePartition.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - case 3: { - if (!(message.unreachable && message.unreachable.length)) - message.unreachable = []; - message.unreachable.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListInstancePartitionsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.instance.v1.ListInstancePartitionsResponse} ListInstancePartitionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListInstancePartitionsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListInstancePartitionsResponse message. - * @function verify - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListInstancePartitionsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.instancePartitions != null && message.hasOwnProperty("instancePartitions")) { - if (!Array.isArray(message.instancePartitions)) - return "instancePartitions: array expected"; - for (var i = 0; i < message.instancePartitions.length; ++i) { - var error = $root.google.spanner.admin.instance.v1.InstancePartition.verify(message.instancePartitions[i]); - if (error) - return "instancePartitions." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - if (message.unreachable != null && message.hasOwnProperty("unreachable")) { - if (!Array.isArray(message.unreachable)) - return "unreachable: array expected"; - for (var i = 0; i < message.unreachable.length; ++i) - if (!$util.isString(message.unreachable[i])) - return "unreachable: string[] expected"; - } - return null; - }; - - /** - * Creates a ListInstancePartitionsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.instance.v1.ListInstancePartitionsResponse} ListInstancePartitionsResponse - */ - ListInstancePartitionsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.instance.v1.ListInstancePartitionsResponse) - return object; - var message = new $root.google.spanner.admin.instance.v1.ListInstancePartitionsResponse(); - if (object.instancePartitions) { - if (!Array.isArray(object.instancePartitions)) - throw TypeError(".google.spanner.admin.instance.v1.ListInstancePartitionsResponse.instancePartitions: array expected"); - message.instancePartitions = []; - for (var i = 0; i < object.instancePartitions.length; ++i) { - if (typeof object.instancePartitions[i] !== "object") - throw TypeError(".google.spanner.admin.instance.v1.ListInstancePartitionsResponse.instancePartitions: object expected"); - message.instancePartitions[i] = $root.google.spanner.admin.instance.v1.InstancePartition.fromObject(object.instancePartitions[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.unreachable) { - if (!Array.isArray(object.unreachable)) - throw TypeError(".google.spanner.admin.instance.v1.ListInstancePartitionsResponse.unreachable: array expected"); - message.unreachable = []; - for (var i = 0; i < object.unreachable.length; ++i) - message.unreachable[i] = String(object.unreachable[i]); - } - return message; - }; - - /** - * Creates a plain object from a ListInstancePartitionsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsResponse - * @static - * @param {google.spanner.admin.instance.v1.ListInstancePartitionsResponse} message ListInstancePartitionsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListInstancePartitionsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.instancePartitions = []; - object.unreachable = []; - } - if (options.defaults) - object.nextPageToken = ""; - if (message.instancePartitions && message.instancePartitions.length) { - object.instancePartitions = []; - for (var j = 0; j < message.instancePartitions.length; ++j) - object.instancePartitions[j] = $root.google.spanner.admin.instance.v1.InstancePartition.toObject(message.instancePartitions[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - if (message.unreachable && message.unreachable.length) { - object.unreachable = []; - for (var j = 0; j < message.unreachable.length; ++j) - object.unreachable[j] = message.unreachable[j]; - } - return object; - }; - - /** - * Converts this ListInstancePartitionsResponse to JSON. - * @function toJSON - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsResponse - * @instance - * @returns {Object.} JSON object - */ - ListInstancePartitionsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListInstancePartitionsResponse - * @function getTypeUrl - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListInstancePartitionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.instance.v1.ListInstancePartitionsResponse"; - }; - - return ListInstancePartitionsResponse; - })(); - - v1.ListInstancePartitionOperationsRequest = (function() { - - /** - * Properties of a ListInstancePartitionOperationsRequest. - * @memberof google.spanner.admin.instance.v1 - * @interface IListInstancePartitionOperationsRequest - * @property {string|null} [parent] ListInstancePartitionOperationsRequest parent - * @property {string|null} [filter] ListInstancePartitionOperationsRequest filter - * @property {number|null} [pageSize] ListInstancePartitionOperationsRequest pageSize - * @property {string|null} [pageToken] ListInstancePartitionOperationsRequest pageToken - * @property {google.protobuf.ITimestamp|null} [instancePartitionDeadline] ListInstancePartitionOperationsRequest instancePartitionDeadline - */ - - /** - * Constructs a new ListInstancePartitionOperationsRequest. - * @memberof google.spanner.admin.instance.v1 - * @classdesc Represents a ListInstancePartitionOperationsRequest. - * @implements IListInstancePartitionOperationsRequest - * @constructor - * @param {google.spanner.admin.instance.v1.IListInstancePartitionOperationsRequest=} [properties] Properties to set - */ - function ListInstancePartitionOperationsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListInstancePartitionOperationsRequest parent. - * @member {string} parent - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest - * @instance - */ - ListInstancePartitionOperationsRequest.prototype.parent = ""; - - /** - * ListInstancePartitionOperationsRequest filter. - * @member {string} filter - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest - * @instance - */ - ListInstancePartitionOperationsRequest.prototype.filter = ""; - - /** - * ListInstancePartitionOperationsRequest pageSize. - * @member {number} pageSize - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest - * @instance - */ - ListInstancePartitionOperationsRequest.prototype.pageSize = 0; - - /** - * ListInstancePartitionOperationsRequest pageToken. - * @member {string} pageToken - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest - * @instance - */ - ListInstancePartitionOperationsRequest.prototype.pageToken = ""; - - /** - * ListInstancePartitionOperationsRequest instancePartitionDeadline. - * @member {google.protobuf.ITimestamp|null|undefined} instancePartitionDeadline - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest - * @instance - */ - ListInstancePartitionOperationsRequest.prototype.instancePartitionDeadline = null; - - /** - * Creates a new ListInstancePartitionOperationsRequest instance using the specified properties. - * @function create - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest - * @static - * @param {google.spanner.admin.instance.v1.IListInstancePartitionOperationsRequest=} [properties] Properties to set - * @returns {google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest} ListInstancePartitionOperationsRequest instance - */ - ListInstancePartitionOperationsRequest.create = function create(properties) { - return new ListInstancePartitionOperationsRequest(properties); - }; - - /** - * Encodes the specified ListInstancePartitionOperationsRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest - * @static - * @param {google.spanner.admin.instance.v1.IListInstancePartitionOperationsRequest} message ListInstancePartitionOperationsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListInstancePartitionOperationsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); - if (message.instancePartitionDeadline != null && Object.hasOwnProperty.call(message, "instancePartitionDeadline")) - $root.google.protobuf.Timestamp.encode(message.instancePartitionDeadline, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ListInstancePartitionOperationsRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest - * @static - * @param {google.spanner.admin.instance.v1.IListInstancePartitionOperationsRequest} message ListInstancePartitionOperationsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListInstancePartitionOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListInstancePartitionOperationsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest} ListInstancePartitionOperationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListInstancePartitionOperationsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.filter = reader.string(); - break; - } - case 3: { - message.pageSize = reader.int32(); - break; - } - case 4: { - message.pageToken = reader.string(); - break; - } - case 5: { - message.instancePartitionDeadline = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListInstancePartitionOperationsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest} ListInstancePartitionOperationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListInstancePartitionOperationsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListInstancePartitionOperationsRequest message. - * @function verify - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListInstancePartitionOperationsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.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.instancePartitionDeadline != null && message.hasOwnProperty("instancePartitionDeadline")) { - var error = $root.google.protobuf.Timestamp.verify(message.instancePartitionDeadline); - if (error) - return "instancePartitionDeadline." + error; - } - return null; - }; - - /** - * Creates a ListInstancePartitionOperationsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest} ListInstancePartitionOperationsRequest - */ - ListInstancePartitionOperationsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest) - return object; - var message = new $root.google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.filter != null) - message.filter = String(object.filter); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.instancePartitionDeadline != null) { - if (typeof object.instancePartitionDeadline !== "object") - throw TypeError(".google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest.instancePartitionDeadline: object expected"); - message.instancePartitionDeadline = $root.google.protobuf.Timestamp.fromObject(object.instancePartitionDeadline); - } - return message; - }; - - /** - * Creates a plain object from a ListInstancePartitionOperationsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest - * @static - * @param {google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest} message ListInstancePartitionOperationsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListInstancePartitionOperationsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.filter = ""; - object.pageSize = 0; - object.pageToken = ""; - object.instancePartitionDeadline = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.instancePartitionDeadline != null && message.hasOwnProperty("instancePartitionDeadline")) - object.instancePartitionDeadline = $root.google.protobuf.Timestamp.toObject(message.instancePartitionDeadline, options); - return object; - }; - - /** - * Converts this ListInstancePartitionOperationsRequest to JSON. - * @function toJSON - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest - * @instance - * @returns {Object.} JSON object - */ - ListInstancePartitionOperationsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListInstancePartitionOperationsRequest - * @function getTypeUrl - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListInstancePartitionOperationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest"; - }; - - return ListInstancePartitionOperationsRequest; - })(); - - v1.ListInstancePartitionOperationsResponse = (function() { - - /** - * Properties of a ListInstancePartitionOperationsResponse. - * @memberof google.spanner.admin.instance.v1 - * @interface IListInstancePartitionOperationsResponse - * @property {Array.|null} [operations] ListInstancePartitionOperationsResponse operations - * @property {string|null} [nextPageToken] ListInstancePartitionOperationsResponse nextPageToken - * @property {Array.|null} [unreachableInstancePartitions] ListInstancePartitionOperationsResponse unreachableInstancePartitions - */ - - /** - * Constructs a new ListInstancePartitionOperationsResponse. - * @memberof google.spanner.admin.instance.v1 - * @classdesc Represents a ListInstancePartitionOperationsResponse. - * @implements IListInstancePartitionOperationsResponse - * @constructor - * @param {google.spanner.admin.instance.v1.IListInstancePartitionOperationsResponse=} [properties] Properties to set - */ - function ListInstancePartitionOperationsResponse(properties) { - this.operations = []; - this.unreachableInstancePartitions = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListInstancePartitionOperationsResponse operations. - * @member {Array.} operations - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse - * @instance - */ - ListInstancePartitionOperationsResponse.prototype.operations = $util.emptyArray; - - /** - * ListInstancePartitionOperationsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse - * @instance - */ - ListInstancePartitionOperationsResponse.prototype.nextPageToken = ""; - - /** - * ListInstancePartitionOperationsResponse unreachableInstancePartitions. - * @member {Array.} unreachableInstancePartitions - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse - * @instance - */ - ListInstancePartitionOperationsResponse.prototype.unreachableInstancePartitions = $util.emptyArray; - - /** - * Creates a new ListInstancePartitionOperationsResponse instance using the specified properties. - * @function create - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse - * @static - * @param {google.spanner.admin.instance.v1.IListInstancePartitionOperationsResponse=} [properties] Properties to set - * @returns {google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse} ListInstancePartitionOperationsResponse instance - */ - ListInstancePartitionOperationsResponse.create = function create(properties) { - return new ListInstancePartitionOperationsResponse(properties); - }; - - /** - * Encodes the specified ListInstancePartitionOperationsResponse message. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse - * @static - * @param {google.spanner.admin.instance.v1.IListInstancePartitionOperationsResponse} message ListInstancePartitionOperationsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListInstancePartitionOperationsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.operations != null && message.operations.length) - for (var i = 0; i < message.operations.length; ++i) - $root.google.longrunning.Operation.encode(message.operations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - if (message.unreachableInstancePartitions != null && message.unreachableInstancePartitions.length) - for (var i = 0; i < message.unreachableInstancePartitions.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachableInstancePartitions[i]); - return writer; - }; - - /** - * Encodes the specified ListInstancePartitionOperationsResponse message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse - * @static - * @param {google.spanner.admin.instance.v1.IListInstancePartitionOperationsResponse} message ListInstancePartitionOperationsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListInstancePartitionOperationsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListInstancePartitionOperationsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse} ListInstancePartitionOperationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListInstancePartitionOperationsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.operations && message.operations.length)) - message.operations = []; - message.operations.push($root.google.longrunning.Operation.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - case 3: { - if (!(message.unreachableInstancePartitions && message.unreachableInstancePartitions.length)) - message.unreachableInstancePartitions = []; - message.unreachableInstancePartitions.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListInstancePartitionOperationsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse} ListInstancePartitionOperationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListInstancePartitionOperationsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListInstancePartitionOperationsResponse message. - * @function verify - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListInstancePartitionOperationsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.operations != null && message.hasOwnProperty("operations")) { - if (!Array.isArray(message.operations)) - return "operations: array expected"; - for (var i = 0; i < message.operations.length; ++i) { - var error = $root.google.longrunning.Operation.verify(message.operations[i]); - if (error) - return "operations." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - if (message.unreachableInstancePartitions != null && message.hasOwnProperty("unreachableInstancePartitions")) { - if (!Array.isArray(message.unreachableInstancePartitions)) - return "unreachableInstancePartitions: array expected"; - for (var i = 0; i < message.unreachableInstancePartitions.length; ++i) - if (!$util.isString(message.unreachableInstancePartitions[i])) - return "unreachableInstancePartitions: string[] expected"; - } - return null; - }; - - /** - * Creates a ListInstancePartitionOperationsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse} ListInstancePartitionOperationsResponse - */ - ListInstancePartitionOperationsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse) - return object; - var message = new $root.google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse(); - if (object.operations) { - if (!Array.isArray(object.operations)) - throw TypeError(".google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse.operations: array expected"); - message.operations = []; - for (var i = 0; i < object.operations.length; ++i) { - if (typeof object.operations[i] !== "object") - throw TypeError(".google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse.operations: object expected"); - message.operations[i] = $root.google.longrunning.Operation.fromObject(object.operations[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.unreachableInstancePartitions) { - if (!Array.isArray(object.unreachableInstancePartitions)) - throw TypeError(".google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse.unreachableInstancePartitions: array expected"); - message.unreachableInstancePartitions = []; - for (var i = 0; i < object.unreachableInstancePartitions.length; ++i) - message.unreachableInstancePartitions[i] = String(object.unreachableInstancePartitions[i]); - } - return message; - }; - - /** - * Creates a plain object from a ListInstancePartitionOperationsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse - * @static - * @param {google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse} message ListInstancePartitionOperationsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListInstancePartitionOperationsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.operations = []; - object.unreachableInstancePartitions = []; - } - if (options.defaults) - object.nextPageToken = ""; - if (message.operations && message.operations.length) { - object.operations = []; - for (var j = 0; j < message.operations.length; ++j) - object.operations[j] = $root.google.longrunning.Operation.toObject(message.operations[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - if (message.unreachableInstancePartitions && message.unreachableInstancePartitions.length) { - object.unreachableInstancePartitions = []; - for (var j = 0; j < message.unreachableInstancePartitions.length; ++j) - object.unreachableInstancePartitions[j] = message.unreachableInstancePartitions[j]; - } - return object; - }; - - /** - * Converts this ListInstancePartitionOperationsResponse to JSON. - * @function toJSON - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse - * @instance - * @returns {Object.} JSON object - */ - ListInstancePartitionOperationsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListInstancePartitionOperationsResponse - * @function getTypeUrl - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListInstancePartitionOperationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse"; - }; - - return ListInstancePartitionOperationsResponse; - })(); - - v1.MoveInstanceRequest = (function() { - - /** - * Properties of a MoveInstanceRequest. - * @memberof google.spanner.admin.instance.v1 - * @interface IMoveInstanceRequest - * @property {string|null} [name] MoveInstanceRequest name - * @property {string|null} [targetConfig] MoveInstanceRequest targetConfig - */ - - /** - * Constructs a new MoveInstanceRequest. - * @memberof google.spanner.admin.instance.v1 - * @classdesc Represents a MoveInstanceRequest. - * @implements IMoveInstanceRequest - * @constructor - * @param {google.spanner.admin.instance.v1.IMoveInstanceRequest=} [properties] Properties to set - */ - function MoveInstanceRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MoveInstanceRequest name. - * @member {string} name - * @memberof google.spanner.admin.instance.v1.MoveInstanceRequest - * @instance - */ - MoveInstanceRequest.prototype.name = ""; - - /** - * MoveInstanceRequest targetConfig. - * @member {string} targetConfig - * @memberof google.spanner.admin.instance.v1.MoveInstanceRequest - * @instance - */ - MoveInstanceRequest.prototype.targetConfig = ""; - - /** - * Creates a new MoveInstanceRequest instance using the specified properties. - * @function create - * @memberof google.spanner.admin.instance.v1.MoveInstanceRequest - * @static - * @param {google.spanner.admin.instance.v1.IMoveInstanceRequest=} [properties] Properties to set - * @returns {google.spanner.admin.instance.v1.MoveInstanceRequest} MoveInstanceRequest instance - */ - MoveInstanceRequest.create = function create(properties) { - return new MoveInstanceRequest(properties); - }; - - /** - * Encodes the specified MoveInstanceRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.MoveInstanceRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.instance.v1.MoveInstanceRequest - * @static - * @param {google.spanner.admin.instance.v1.IMoveInstanceRequest} message MoveInstanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MoveInstanceRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.targetConfig != null && Object.hasOwnProperty.call(message, "targetConfig")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.targetConfig); - return writer; - }; - - /** - * Encodes the specified MoveInstanceRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.MoveInstanceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.instance.v1.MoveInstanceRequest - * @static - * @param {google.spanner.admin.instance.v1.IMoveInstanceRequest} message MoveInstanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MoveInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MoveInstanceRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.instance.v1.MoveInstanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.instance.v1.MoveInstanceRequest} MoveInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MoveInstanceRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.MoveInstanceRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.targetConfig = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MoveInstanceRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.instance.v1.MoveInstanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.instance.v1.MoveInstanceRequest} MoveInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MoveInstanceRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MoveInstanceRequest message. - * @function verify - * @memberof google.spanner.admin.instance.v1.MoveInstanceRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MoveInstanceRequest.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.targetConfig != null && message.hasOwnProperty("targetConfig")) - if (!$util.isString(message.targetConfig)) - return "targetConfig: string expected"; - return null; - }; - - /** - * Creates a MoveInstanceRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.instance.v1.MoveInstanceRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.instance.v1.MoveInstanceRequest} MoveInstanceRequest - */ - MoveInstanceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.instance.v1.MoveInstanceRequest) - return object; - var message = new $root.google.spanner.admin.instance.v1.MoveInstanceRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.targetConfig != null) - message.targetConfig = String(object.targetConfig); - return message; - }; - - /** - * Creates a plain object from a MoveInstanceRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.instance.v1.MoveInstanceRequest - * @static - * @param {google.spanner.admin.instance.v1.MoveInstanceRequest} message MoveInstanceRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MoveInstanceRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.targetConfig = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.targetConfig != null && message.hasOwnProperty("targetConfig")) - object.targetConfig = message.targetConfig; - return object; - }; - - /** - * Converts this MoveInstanceRequest to JSON. - * @function toJSON - * @memberof google.spanner.admin.instance.v1.MoveInstanceRequest - * @instance - * @returns {Object.} JSON object - */ - MoveInstanceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MoveInstanceRequest - * @function getTypeUrl - * @memberof google.spanner.admin.instance.v1.MoveInstanceRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MoveInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.instance.v1.MoveInstanceRequest"; - }; - - return MoveInstanceRequest; - })(); - - v1.MoveInstanceResponse = (function() { - - /** - * Properties of a MoveInstanceResponse. - * @memberof google.spanner.admin.instance.v1 - * @interface IMoveInstanceResponse - */ - - /** - * Constructs a new MoveInstanceResponse. - * @memberof google.spanner.admin.instance.v1 - * @classdesc Represents a MoveInstanceResponse. - * @implements IMoveInstanceResponse - * @constructor - * @param {google.spanner.admin.instance.v1.IMoveInstanceResponse=} [properties] Properties to set - */ - function MoveInstanceResponse(properties) { - if (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 MoveInstanceResponse instance using the specified properties. - * @function create - * @memberof google.spanner.admin.instance.v1.MoveInstanceResponse - * @static - * @param {google.spanner.admin.instance.v1.IMoveInstanceResponse=} [properties] Properties to set - * @returns {google.spanner.admin.instance.v1.MoveInstanceResponse} MoveInstanceResponse instance - */ - MoveInstanceResponse.create = function create(properties) { - return new MoveInstanceResponse(properties); - }; - - /** - * Encodes the specified MoveInstanceResponse message. Does not implicitly {@link google.spanner.admin.instance.v1.MoveInstanceResponse.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.instance.v1.MoveInstanceResponse - * @static - * @param {google.spanner.admin.instance.v1.IMoveInstanceResponse} message MoveInstanceResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MoveInstanceResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified MoveInstanceResponse message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.MoveInstanceResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.instance.v1.MoveInstanceResponse - * @static - * @param {google.spanner.admin.instance.v1.IMoveInstanceResponse} message MoveInstanceResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MoveInstanceResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MoveInstanceResponse message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.instance.v1.MoveInstanceResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.instance.v1.MoveInstanceResponse} MoveInstanceResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MoveInstanceResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.MoveInstanceResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MoveInstanceResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.instance.v1.MoveInstanceResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.instance.v1.MoveInstanceResponse} MoveInstanceResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MoveInstanceResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MoveInstanceResponse message. - * @function verify - * @memberof google.spanner.admin.instance.v1.MoveInstanceResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MoveInstanceResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a MoveInstanceResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.instance.v1.MoveInstanceResponse - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.instance.v1.MoveInstanceResponse} MoveInstanceResponse - */ - MoveInstanceResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.instance.v1.MoveInstanceResponse) - return object; - return new $root.google.spanner.admin.instance.v1.MoveInstanceResponse(); - }; - - /** - * Creates a plain object from a MoveInstanceResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.instance.v1.MoveInstanceResponse - * @static - * @param {google.spanner.admin.instance.v1.MoveInstanceResponse} message MoveInstanceResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MoveInstanceResponse.toObject = function toObject() { - return {}; - }; - - /** - * Converts this MoveInstanceResponse to JSON. - * @function toJSON - * @memberof google.spanner.admin.instance.v1.MoveInstanceResponse - * @instance - * @returns {Object.} JSON object - */ - MoveInstanceResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MoveInstanceResponse - * @function getTypeUrl - * @memberof google.spanner.admin.instance.v1.MoveInstanceResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MoveInstanceResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.instance.v1.MoveInstanceResponse"; - }; - - return MoveInstanceResponse; - })(); - - v1.MoveInstanceMetadata = (function() { - - /** - * Properties of a MoveInstanceMetadata. - * @memberof google.spanner.admin.instance.v1 - * @interface IMoveInstanceMetadata - * @property {string|null} [targetConfig] MoveInstanceMetadata targetConfig - * @property {google.spanner.admin.instance.v1.IOperationProgress|null} [progress] MoveInstanceMetadata progress - * @property {google.protobuf.ITimestamp|null} [cancelTime] MoveInstanceMetadata cancelTime - */ - - /** - * Constructs a new MoveInstanceMetadata. - * @memberof google.spanner.admin.instance.v1 - * @classdesc Represents a MoveInstanceMetadata. - * @implements IMoveInstanceMetadata - * @constructor - * @param {google.spanner.admin.instance.v1.IMoveInstanceMetadata=} [properties] Properties to set - */ - function MoveInstanceMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MoveInstanceMetadata targetConfig. - * @member {string} targetConfig - * @memberof google.spanner.admin.instance.v1.MoveInstanceMetadata - * @instance - */ - MoveInstanceMetadata.prototype.targetConfig = ""; - - /** - * MoveInstanceMetadata progress. - * @member {google.spanner.admin.instance.v1.IOperationProgress|null|undefined} progress - * @memberof google.spanner.admin.instance.v1.MoveInstanceMetadata - * @instance - */ - MoveInstanceMetadata.prototype.progress = null; - - /** - * MoveInstanceMetadata cancelTime. - * @member {google.protobuf.ITimestamp|null|undefined} cancelTime - * @memberof google.spanner.admin.instance.v1.MoveInstanceMetadata - * @instance - */ - MoveInstanceMetadata.prototype.cancelTime = null; - - /** - * Creates a new MoveInstanceMetadata instance using the specified properties. - * @function create - * @memberof google.spanner.admin.instance.v1.MoveInstanceMetadata - * @static - * @param {google.spanner.admin.instance.v1.IMoveInstanceMetadata=} [properties] Properties to set - * @returns {google.spanner.admin.instance.v1.MoveInstanceMetadata} MoveInstanceMetadata instance - */ - MoveInstanceMetadata.create = function create(properties) { - return new MoveInstanceMetadata(properties); - }; - - /** - * Encodes the specified MoveInstanceMetadata message. Does not implicitly {@link google.spanner.admin.instance.v1.MoveInstanceMetadata.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.instance.v1.MoveInstanceMetadata - * @static - * @param {google.spanner.admin.instance.v1.IMoveInstanceMetadata} message MoveInstanceMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MoveInstanceMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.targetConfig != null && Object.hasOwnProperty.call(message, "targetConfig")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.targetConfig); - if (message.progress != null && Object.hasOwnProperty.call(message, "progress")) - $root.google.spanner.admin.instance.v1.OperationProgress.encode(message.progress, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.cancelTime != null && Object.hasOwnProperty.call(message, "cancelTime")) - $root.google.protobuf.Timestamp.encode(message.cancelTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified MoveInstanceMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.MoveInstanceMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.instance.v1.MoveInstanceMetadata - * @static - * @param {google.spanner.admin.instance.v1.IMoveInstanceMetadata} message MoveInstanceMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MoveInstanceMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MoveInstanceMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.instance.v1.MoveInstanceMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.instance.v1.MoveInstanceMetadata} MoveInstanceMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MoveInstanceMetadata.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.MoveInstanceMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.targetConfig = reader.string(); - break; - } - case 2: { - message.progress = $root.google.spanner.admin.instance.v1.OperationProgress.decode(reader, reader.uint32()); - break; - } - case 3: { - message.cancelTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MoveInstanceMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.instance.v1.MoveInstanceMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.instance.v1.MoveInstanceMetadata} MoveInstanceMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MoveInstanceMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MoveInstanceMetadata message. - * @function verify - * @memberof google.spanner.admin.instance.v1.MoveInstanceMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MoveInstanceMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.targetConfig != null && message.hasOwnProperty("targetConfig")) - if (!$util.isString(message.targetConfig)) - return "targetConfig: string expected"; - if (message.progress != null && message.hasOwnProperty("progress")) { - var error = $root.google.spanner.admin.instance.v1.OperationProgress.verify(message.progress); - if (error) - return "progress." + error; - } - if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.cancelTime); - if (error) - return "cancelTime." + error; - } - return null; - }; - - /** - * Creates a MoveInstanceMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.instance.v1.MoveInstanceMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.instance.v1.MoveInstanceMetadata} MoveInstanceMetadata - */ - MoveInstanceMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.instance.v1.MoveInstanceMetadata) - return object; - var message = new $root.google.spanner.admin.instance.v1.MoveInstanceMetadata(); - if (object.targetConfig != null) - message.targetConfig = String(object.targetConfig); - if (object.progress != null) { - if (typeof object.progress !== "object") - throw TypeError(".google.spanner.admin.instance.v1.MoveInstanceMetadata.progress: object expected"); - message.progress = $root.google.spanner.admin.instance.v1.OperationProgress.fromObject(object.progress); - } - if (object.cancelTime != null) { - if (typeof object.cancelTime !== "object") - throw TypeError(".google.spanner.admin.instance.v1.MoveInstanceMetadata.cancelTime: object expected"); - message.cancelTime = $root.google.protobuf.Timestamp.fromObject(object.cancelTime); - } - return message; - }; - - /** - * Creates a plain object from a MoveInstanceMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.instance.v1.MoveInstanceMetadata - * @static - * @param {google.spanner.admin.instance.v1.MoveInstanceMetadata} message MoveInstanceMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MoveInstanceMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.targetConfig = ""; - object.progress = null; - object.cancelTime = null; - } - if (message.targetConfig != null && message.hasOwnProperty("targetConfig")) - object.targetConfig = message.targetConfig; - if (message.progress != null && message.hasOwnProperty("progress")) - object.progress = $root.google.spanner.admin.instance.v1.OperationProgress.toObject(message.progress, options); - if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) - object.cancelTime = $root.google.protobuf.Timestamp.toObject(message.cancelTime, options); - return object; - }; - - /** - * Converts this MoveInstanceMetadata to JSON. - * @function toJSON - * @memberof google.spanner.admin.instance.v1.MoveInstanceMetadata - * @instance - * @returns {Object.} JSON object - */ - MoveInstanceMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MoveInstanceMetadata - * @function getTypeUrl - * @memberof google.spanner.admin.instance.v1.MoveInstanceMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MoveInstanceMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.instance.v1.MoveInstanceMetadata"; - }; - - return MoveInstanceMetadata; - })(); - - return v1; - })(); - - return instance; - })(); - - return admin; - })(); - - return spanner; - })(); - - google.api = (function() { - - /** - * Namespace api. - * @memberof google - * @namespace - */ - var api = {}; - - /** - * FieldBehavior enum. - * @name google.api.FieldBehavior - * @enum {number} - * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value - * @property {number} OPTIONAL=1 OPTIONAL value - * @property {number} REQUIRED=2 REQUIRED value - * @property {number} OUTPUT_ONLY=3 OUTPUT_ONLY value - * @property {number} INPUT_ONLY=4 INPUT_ONLY value - * @property {number} IMMUTABLE=5 IMMUTABLE value - * @property {number} UNORDERED_LIST=6 UNORDERED_LIST value - * @property {number} NON_EMPTY_DEFAULT=7 NON_EMPTY_DEFAULT value - * @property {number} IDENTIFIER=8 IDENTIFIER value - */ - api.FieldBehavior = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "FIELD_BEHAVIOR_UNSPECIFIED"] = 0; - values[valuesById[1] = "OPTIONAL"] = 1; - values[valuesById[2] = "REQUIRED"] = 2; - values[valuesById[3] = "OUTPUT_ONLY"] = 3; - values[valuesById[4] = "INPUT_ONLY"] = 4; - values[valuesById[5] = "IMMUTABLE"] = 5; - values[valuesById[6] = "UNORDERED_LIST"] = 6; - values[valuesById[7] = "NON_EMPTY_DEFAULT"] = 7; - values[valuesById[8] = "IDENTIFIER"] = 8; - return values; - })(); - - api.ResourceDescriptor = (function() { - - /** - * Properties of a ResourceDescriptor. - * @memberof google.api - * @interface IResourceDescriptor - * @property {string|null} [type] ResourceDescriptor type - * @property {Array.|null} [pattern] ResourceDescriptor pattern - * @property {string|null} [nameField] ResourceDescriptor nameField - * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history - * @property {string|null} [plural] ResourceDescriptor plural - * @property {string|null} [singular] ResourceDescriptor singular - * @property {Array.|null} [style] ResourceDescriptor style - */ - - /** - * Constructs a new ResourceDescriptor. - * @memberof google.api - * @classdesc Represents a ResourceDescriptor. - * @implements IResourceDescriptor - * @constructor - * @param {google.api.IResourceDescriptor=} [properties] Properties to set - */ - function ResourceDescriptor(properties) { - this.pattern = []; - this.style = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ResourceDescriptor type. - * @member {string} type - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.type = ""; - - /** - * ResourceDescriptor pattern. - * @member {Array.} pattern - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.pattern = $util.emptyArray; - - /** - * ResourceDescriptor nameField. - * @member {string} nameField - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.nameField = ""; - - /** - * ResourceDescriptor history. - * @member {google.api.ResourceDescriptor.History} history - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.history = 0; - - /** - * ResourceDescriptor plural. - * @member {string} plural - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.plural = ""; - - /** - * ResourceDescriptor singular. - * @member {string} singular - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.singular = ""; - - /** - * ResourceDescriptor style. - * @member {Array.} style - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.style = $util.emptyArray; - - /** - * Creates a new ResourceDescriptor instance using the specified properties. - * @function create - * @memberof google.api.ResourceDescriptor - * @static - * @param {google.api.IResourceDescriptor=} [properties] Properties to set - * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance - */ - ResourceDescriptor.create = function create(properties) { - return new ResourceDescriptor(properties); - }; - - /** - * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. - * @function encode - * @memberof google.api.ResourceDescriptor - * @static - * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceDescriptor.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); - if (message.pattern != null && message.pattern.length) - for (var i = 0; i < message.pattern.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.pattern[i]); - if (message.nameField != null && Object.hasOwnProperty.call(message, "nameField")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); - if (message.history != null && Object.hasOwnProperty.call(message, "history")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); - if (message.plural != null && Object.hasOwnProperty.call(message, "plural")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); - if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); - if (message.style != null && message.style.length) { - writer.uint32(/* id 10, wireType 2 =*/82).fork(); - for (var i = 0; i < message.style.length; ++i) - writer.int32(message.style[i]); - writer.ldelim(); - } - return writer; - }; - - /** - * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.ResourceDescriptor - * @static - * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ResourceDescriptor message from the specified reader or buffer. - * @function decode - * @memberof google.api.ResourceDescriptor - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.ResourceDescriptor} ResourceDescriptor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceDescriptor.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceDescriptor(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.type = reader.string(); - break; - } - case 2: { - if (!(message.pattern && message.pattern.length)) - message.pattern = []; - message.pattern.push(reader.string()); - break; - } - case 3: { - message.nameField = reader.string(); - break; - } - case 4: { - message.history = reader.int32(); - break; - } - case 5: { - message.plural = reader.string(); - break; - } - case 6: { - message.singular = reader.string(); - break; - } - case 10: { - if (!(message.style && message.style.length)) - message.style = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.style.push(reader.int32()); - } else - message.style.push(reader.int32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.ResourceDescriptor - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.ResourceDescriptor} ResourceDescriptor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ResourceDescriptor message. - * @function verify - * @memberof google.api.ResourceDescriptor - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ResourceDescriptor.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.pattern != null && message.hasOwnProperty("pattern")) { - if (!Array.isArray(message.pattern)) - return "pattern: array expected"; - for (var i = 0; i < message.pattern.length; ++i) - if (!$util.isString(message.pattern[i])) - return "pattern: string[] expected"; - } - if (message.nameField != null && message.hasOwnProperty("nameField")) - if (!$util.isString(message.nameField)) - return "nameField: string expected"; - if (message.history != null && message.hasOwnProperty("history")) - switch (message.history) { - default: - return "history: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.plural != null && message.hasOwnProperty("plural")) - if (!$util.isString(message.plural)) - return "plural: string expected"; - if (message.singular != null && message.hasOwnProperty("singular")) - if (!$util.isString(message.singular)) - return "singular: string expected"; - if (message.style != null && message.hasOwnProperty("style")) { - if (!Array.isArray(message.style)) - return "style: array expected"; - for (var i = 0; i < message.style.length; ++i) - switch (message.style[i]) { - default: - return "style: enum value[] expected"; - case 0: - case 1: - break; - } - } - return null; - }; - - /** - * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.ResourceDescriptor - * @static - * @param {Object.} object Plain object - * @returns {google.api.ResourceDescriptor} ResourceDescriptor - */ - ResourceDescriptor.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.ResourceDescriptor) - return object; - var message = new $root.google.api.ResourceDescriptor(); - if (object.type != null) - message.type = String(object.type); - if (object.pattern) { - if (!Array.isArray(object.pattern)) - throw TypeError(".google.api.ResourceDescriptor.pattern: array expected"); - message.pattern = []; - for (var i = 0; i < object.pattern.length; ++i) - message.pattern[i] = String(object.pattern[i]); - } - if (object.nameField != null) - message.nameField = String(object.nameField); - switch (object.history) { - default: - if (typeof object.history === "number") { - message.history = object.history; - break; - } - break; - case "HISTORY_UNSPECIFIED": - case 0: - message.history = 0; - break; - case "ORIGINALLY_SINGLE_PATTERN": - case 1: - message.history = 1; - break; - case "FUTURE_MULTI_PATTERN": - case 2: - message.history = 2; - break; - } - if (object.plural != null) - message.plural = String(object.plural); - if (object.singular != null) - message.singular = String(object.singular); - if (object.style) { - if (!Array.isArray(object.style)) - throw TypeError(".google.api.ResourceDescriptor.style: array expected"); - message.style = []; - for (var i = 0; i < object.style.length; ++i) - switch (object.style[i]) { - default: - if (typeof object.style[i] === "number") { - message.style[i] = object.style[i]; - break; - } - case "STYLE_UNSPECIFIED": - case 0: - message.style[i] = 0; - break; - case "DECLARATIVE_FRIENDLY": - case 1: - message.style[i] = 1; - break; - } - } - return message; - }; - - /** - * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.ResourceDescriptor - * @static - * @param {google.api.ResourceDescriptor} message ResourceDescriptor - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResourceDescriptor.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.pattern = []; - object.style = []; - } - if (options.defaults) { - object.type = ""; - object.nameField = ""; - object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; - object.plural = ""; - object.singular = ""; - } - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.pattern && message.pattern.length) { - object.pattern = []; - for (var j = 0; j < message.pattern.length; ++j) - object.pattern[j] = message.pattern[j]; - } - if (message.nameField != null && message.hasOwnProperty("nameField")) - object.nameField = message.nameField; - if (message.history != null && message.hasOwnProperty("history")) - object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] === undefined ? message.history : $root.google.api.ResourceDescriptor.History[message.history] : message.history; - if (message.plural != null && message.hasOwnProperty("plural")) - object.plural = message.plural; - if (message.singular != null && message.hasOwnProperty("singular")) - object.singular = message.singular; - if (message.style && message.style.length) { - object.style = []; - for (var j = 0; j < message.style.length; ++j) - object.style[j] = options.enums === String ? $root.google.api.ResourceDescriptor.Style[message.style[j]] === undefined ? message.style[j] : $root.google.api.ResourceDescriptor.Style[message.style[j]] : message.style[j]; - } - return object; - }; - - /** - * Converts this ResourceDescriptor to JSON. - * @function toJSON - * @memberof google.api.ResourceDescriptor - * @instance - * @returns {Object.} JSON object - */ - ResourceDescriptor.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ResourceDescriptor - * @function getTypeUrl - * @memberof google.api.ResourceDescriptor - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ResourceDescriptor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.ResourceDescriptor"; - }; - - /** - * History enum. - * @name google.api.ResourceDescriptor.History - * @enum {number} - * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value - * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value - * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value - */ - ResourceDescriptor.History = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "HISTORY_UNSPECIFIED"] = 0; - values[valuesById[1] = "ORIGINALLY_SINGLE_PATTERN"] = 1; - values[valuesById[2] = "FUTURE_MULTI_PATTERN"] = 2; - return values; - })(); - - /** - * Style enum. - * @name google.api.ResourceDescriptor.Style - * @enum {number} - * @property {number} STYLE_UNSPECIFIED=0 STYLE_UNSPECIFIED value - * @property {number} DECLARATIVE_FRIENDLY=1 DECLARATIVE_FRIENDLY value - */ - ResourceDescriptor.Style = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STYLE_UNSPECIFIED"] = 0; - values[valuesById[1] = "DECLARATIVE_FRIENDLY"] = 1; - return values; - })(); - - return ResourceDescriptor; - })(); - - api.ResourceReference = (function() { - - /** - * Properties of a ResourceReference. - * @memberof google.api - * @interface IResourceReference - * @property {string|null} [type] ResourceReference type - * @property {string|null} [childType] ResourceReference childType - */ - - /** - * Constructs a new ResourceReference. - * @memberof google.api - * @classdesc Represents a ResourceReference. - * @implements IResourceReference - * @constructor - * @param {google.api.IResourceReference=} [properties] Properties to set - */ - function ResourceReference(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ResourceReference type. - * @member {string} type - * @memberof google.api.ResourceReference - * @instance - */ - ResourceReference.prototype.type = ""; - - /** - * ResourceReference childType. - * @member {string} childType - * @memberof google.api.ResourceReference - * @instance - */ - ResourceReference.prototype.childType = ""; - - /** - * Creates a new ResourceReference instance using the specified properties. - * @function create - * @memberof google.api.ResourceReference - * @static - * @param {google.api.IResourceReference=} [properties] Properties to set - * @returns {google.api.ResourceReference} ResourceReference instance - */ - ResourceReference.create = function create(properties) { - return new ResourceReference(properties); - }; - - /** - * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. - * @function encode - * @memberof google.api.ResourceReference - * @static - * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceReference.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); - if (message.childType != null && Object.hasOwnProperty.call(message, "childType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); - return writer; - }; - - /** - * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.ResourceReference - * @static - * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ResourceReference message from the specified reader or buffer. - * @function decode - * @memberof google.api.ResourceReference - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.ResourceReference} ResourceReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceReference.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceReference(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.type = reader.string(); - break; - } - case 2: { - message.childType = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ResourceReference message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.ResourceReference - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.ResourceReference} ResourceReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceReference.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ResourceReference message. - * @function verify - * @memberof google.api.ResourceReference - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ResourceReference.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.childType != null && message.hasOwnProperty("childType")) - if (!$util.isString(message.childType)) - return "childType: string expected"; - return null; - }; - - /** - * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.ResourceReference - * @static - * @param {Object.} object Plain object - * @returns {google.api.ResourceReference} ResourceReference - */ - ResourceReference.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.ResourceReference) - return object; - var message = new $root.google.api.ResourceReference(); - if (object.type != null) - message.type = String(object.type); - if (object.childType != null) - message.childType = String(object.childType); - return message; - }; - - /** - * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.ResourceReference - * @static - * @param {google.api.ResourceReference} message ResourceReference - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResourceReference.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.type = ""; - object.childType = ""; - } - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.childType != null && message.hasOwnProperty("childType")) - object.childType = message.childType; - return object; - }; - - /** - * Converts this ResourceReference to JSON. - * @function toJSON - * @memberof google.api.ResourceReference - * @instance - * @returns {Object.} JSON object - */ - ResourceReference.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ResourceReference - * @function getTypeUrl - * @memberof google.api.ResourceReference - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ResourceReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.ResourceReference"; - }; - - return ResourceReference; - })(); - - api.Http = (function() { - - /** - * Properties of a Http. - * @memberof google.api - * @interface IHttp - * @property {Array.|null} [rules] Http rules - * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion - */ - - /** - * Constructs a new Http. - * @memberof google.api - * @classdesc Represents a Http. - * @implements IHttp - * @constructor - * @param {google.api.IHttp=} [properties] Properties to set - */ - function Http(properties) { - this.rules = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Http rules. - * @member {Array.} rules - * @memberof google.api.Http - * @instance - */ - Http.prototype.rules = $util.emptyArray; - - /** - * Http fullyDecodeReservedExpansion. - * @member {boolean} fullyDecodeReservedExpansion - * @memberof google.api.Http - * @instance - */ - Http.prototype.fullyDecodeReservedExpansion = false; - - /** - * Creates a new Http instance using the specified properties. - * @function create - * @memberof google.api.Http - * @static - * @param {google.api.IHttp=} [properties] Properties to set - * @returns {google.api.Http} Http instance - */ - Http.create = function create(properties) { - return new Http(properties); - }; - - /** - * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @function encode - * @memberof google.api.Http - * @static - * @param {google.api.IHttp} message Http message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Http.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.rules != null && message.rules.length) - for (var i = 0; i < message.rules.length; ++i) - $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); - return writer; - }; - - /** - * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.Http - * @static - * @param {google.api.IHttp} message Http message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Http.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Http message from the specified reader or buffer. - * @function decode - * @memberof google.api.Http - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.Http} Http - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Http.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.rules && message.rules.length)) - message.rules = []; - message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); - break; - } - case 2: { - message.fullyDecodeReservedExpansion = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Http message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.Http - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.Http} Http - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Http.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Http message. - * @function verify - * @memberof google.api.Http - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Http.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.rules != null && message.hasOwnProperty("rules")) { - if (!Array.isArray(message.rules)) - return "rules: array expected"; - for (var i = 0; i < message.rules.length; ++i) { - var error = $root.google.api.HttpRule.verify(message.rules[i]); - if (error) - return "rules." + error; - } - } - if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) - if (typeof message.fullyDecodeReservedExpansion !== "boolean") - return "fullyDecodeReservedExpansion: boolean expected"; - return null; - }; - - /** - * Creates a Http message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.Http - * @static - * @param {Object.} object Plain object - * @returns {google.api.Http} Http - */ - Http.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.Http) - return object; - var message = new $root.google.api.Http(); - if (object.rules) { - if (!Array.isArray(object.rules)) - throw TypeError(".google.api.Http.rules: array expected"); - message.rules = []; - for (var i = 0; i < object.rules.length; ++i) { - if (typeof object.rules[i] !== "object") - throw TypeError(".google.api.Http.rules: object expected"); - message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); - } - } - if (object.fullyDecodeReservedExpansion != null) - message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); - return message; - }; - - /** - * Creates a plain object from a Http message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.Http - * @static - * @param {google.api.Http} message Http - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Http.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.rules = []; - if (options.defaults) - object.fullyDecodeReservedExpansion = false; - if (message.rules && message.rules.length) { - object.rules = []; - for (var j = 0; j < message.rules.length; ++j) - object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); - } - if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) - object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; - return object; - }; - - /** - * Converts this Http to JSON. - * @function toJSON - * @memberof google.api.Http - * @instance - * @returns {Object.} JSON object - */ - Http.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Http - * @function getTypeUrl - * @memberof google.api.Http - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Http.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.Http"; - }; - - return Http; - })(); - - api.HttpRule = (function() { - - /** - * Properties of a HttpRule. - * @memberof google.api - * @interface IHttpRule - * @property {string|null} [selector] HttpRule selector - * @property {string|null} [get] HttpRule get - * @property {string|null} [put] HttpRule put - * @property {string|null} [post] HttpRule post - * @property {string|null} ["delete"] HttpRule delete - * @property {string|null} [patch] HttpRule patch - * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom - * @property {string|null} [body] HttpRule body - * @property {string|null} [responseBody] HttpRule responseBody - * @property {Array.|null} [additionalBindings] HttpRule additionalBindings - */ - - /** - * Constructs a new HttpRule. - * @memberof google.api - * @classdesc Represents a HttpRule. - * @implements IHttpRule - * @constructor - * @param {google.api.IHttpRule=} [properties] Properties to set - */ - function HttpRule(properties) { - this.additionalBindings = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * HttpRule selector. - * @member {string} selector - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.selector = ""; - - /** - * HttpRule get. - * @member {string|null|undefined} get - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.get = null; - - /** - * HttpRule put. - * @member {string|null|undefined} put - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.put = null; - - /** - * HttpRule post. - * @member {string|null|undefined} post - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.post = null; - - /** - * HttpRule delete. - * @member {string|null|undefined} delete - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype["delete"] = null; - - /** - * HttpRule patch. - * @member {string|null|undefined} patch - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.patch = null; - - /** - * HttpRule custom. - * @member {google.api.ICustomHttpPattern|null|undefined} custom - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.custom = null; - - /** - * HttpRule body. - * @member {string} body - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.body = ""; - - /** - * HttpRule responseBody. - * @member {string} responseBody - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.responseBody = ""; - - /** - * HttpRule additionalBindings. - * @member {Array.} additionalBindings - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.additionalBindings = $util.emptyArray; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * HttpRule pattern. - * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern - * @memberof google.api.HttpRule - * @instance - */ - Object.defineProperty(HttpRule.prototype, "pattern", { - get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new HttpRule instance using the specified properties. - * @function create - * @memberof google.api.HttpRule - * @static - * @param {google.api.IHttpRule=} [properties] Properties to set - * @returns {google.api.HttpRule} HttpRule instance - */ - HttpRule.create = function create(properties) { - return new HttpRule(properties); - }; - - /** - * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @function encode - * @memberof google.api.HttpRule - * @static - * @param {google.api.IHttpRule} message HttpRule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HttpRule.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); - if (message.get != null && Object.hasOwnProperty.call(message, "get")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); - if (message.put != null && Object.hasOwnProperty.call(message, "put")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); - if (message.post != null && Object.hasOwnProperty.call(message, "post")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); - if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); - if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); - if (message.body != null && Object.hasOwnProperty.call(message, "body")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); - if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) - $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.additionalBindings != null && message.additionalBindings.length) - for (var i = 0; i < message.additionalBindings.length; ++i) - $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); - return writer; - }; - - /** - * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.HttpRule - * @static - * @param {google.api.IHttpRule} message HttpRule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HttpRule.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a HttpRule message from the specified reader or buffer. - * @function decode - * @memberof google.api.HttpRule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.HttpRule} HttpRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HttpRule.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.selector = reader.string(); - break; - } - case 2: { - message.get = reader.string(); - break; - } - case 3: { - message.put = reader.string(); - break; - } - case 4: { - message.post = reader.string(); - break; - } - case 5: { - message["delete"] = reader.string(); - break; - } - case 6: { - message.patch = reader.string(); - break; - } - case 8: { - message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); - break; - } - case 7: { - message.body = reader.string(); - break; - } - case 12: { - message.responseBody = reader.string(); - break; - } - case 11: { - if (!(message.additionalBindings && message.additionalBindings.length)) - message.additionalBindings = []; - message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a HttpRule message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.HttpRule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.HttpRule} HttpRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HttpRule.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a HttpRule message. - * @function verify - * @memberof google.api.HttpRule - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - HttpRule.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.selector != null && message.hasOwnProperty("selector")) - if (!$util.isString(message.selector)) - return "selector: string expected"; - if (message.get != null && message.hasOwnProperty("get")) { - properties.pattern = 1; - if (!$util.isString(message.get)) - return "get: string expected"; - } - if (message.put != null && message.hasOwnProperty("put")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message.put)) - return "put: string expected"; - } - if (message.post != null && message.hasOwnProperty("post")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message.post)) - return "post: string expected"; - } - if (message["delete"] != null && message.hasOwnProperty("delete")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message["delete"])) - return "delete: string expected"; - } - if (message.patch != null && message.hasOwnProperty("patch")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message.patch)) - return "patch: string expected"; - } - if (message.custom != null && message.hasOwnProperty("custom")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - { - var error = $root.google.api.CustomHttpPattern.verify(message.custom); - if (error) - return "custom." + error; - } - } - if (message.body != null && message.hasOwnProperty("body")) - if (!$util.isString(message.body)) - return "body: string expected"; - if (message.responseBody != null && message.hasOwnProperty("responseBody")) - if (!$util.isString(message.responseBody)) - return "responseBody: string expected"; - if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) { - if (!Array.isArray(message.additionalBindings)) - return "additionalBindings: array expected"; - for (var i = 0; i < message.additionalBindings.length; ++i) { - var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]); - if (error) - return "additionalBindings." + error; - } - } - return null; - }; - - /** - * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.HttpRule - * @static - * @param {Object.} object Plain object - * @returns {google.api.HttpRule} HttpRule - */ - HttpRule.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.HttpRule) - return object; - var message = new $root.google.api.HttpRule(); - if (object.selector != null) - message.selector = String(object.selector); - if (object.get != null) - message.get = String(object.get); - if (object.put != null) - message.put = String(object.put); - if (object.post != null) - message.post = String(object.post); - if (object["delete"] != null) - message["delete"] = String(object["delete"]); - if (object.patch != null) - message.patch = String(object.patch); - if (object.custom != null) { - if (typeof object.custom !== "object") - throw TypeError(".google.api.HttpRule.custom: object expected"); - message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); - } - if (object.body != null) - message.body = String(object.body); - if (object.responseBody != null) - message.responseBody = String(object.responseBody); - if (object.additionalBindings) { - if (!Array.isArray(object.additionalBindings)) - throw TypeError(".google.api.HttpRule.additionalBindings: array expected"); - message.additionalBindings = []; - for (var i = 0; i < object.additionalBindings.length; ++i) { - if (typeof object.additionalBindings[i] !== "object") - throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); - message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a HttpRule message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.HttpRule - * @static - * @param {google.api.HttpRule} message HttpRule - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - HttpRule.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.additionalBindings = []; - if (options.defaults) { - object.selector = ""; - object.body = ""; - object.responseBody = ""; - } - if (message.selector != null && message.hasOwnProperty("selector")) - object.selector = message.selector; - if (message.get != null && message.hasOwnProperty("get")) { - object.get = message.get; - if (options.oneofs) - object.pattern = "get"; - } - if (message.put != null && message.hasOwnProperty("put")) { - object.put = message.put; - if (options.oneofs) - object.pattern = "put"; - } - if (message.post != null && message.hasOwnProperty("post")) { - object.post = message.post; - if (options.oneofs) - object.pattern = "post"; - } - if (message["delete"] != null && message.hasOwnProperty("delete")) { - object["delete"] = message["delete"]; - if (options.oneofs) - object.pattern = "delete"; - } - if (message.patch != null && message.hasOwnProperty("patch")) { - object.patch = message.patch; - if (options.oneofs) - object.pattern = "patch"; - } - if (message.body != null && message.hasOwnProperty("body")) - object.body = message.body; - if (message.custom != null && message.hasOwnProperty("custom")) { - object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); - if (options.oneofs) - object.pattern = "custom"; - } - if (message.additionalBindings && message.additionalBindings.length) { - object.additionalBindings = []; - for (var j = 0; j < message.additionalBindings.length; ++j) - object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options); - } - if (message.responseBody != null && message.hasOwnProperty("responseBody")) - object.responseBody = message.responseBody; - return object; - }; - - /** - * Converts this HttpRule to JSON. - * @function toJSON - * @memberof google.api.HttpRule - * @instance - * @returns {Object.} JSON object - */ - HttpRule.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for HttpRule - * @function getTypeUrl - * @memberof google.api.HttpRule - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - HttpRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.HttpRule"; - }; - - return HttpRule; - })(); - - api.CustomHttpPattern = (function() { - - /** - * Properties of a CustomHttpPattern. - * @memberof google.api - * @interface ICustomHttpPattern - * @property {string|null} [kind] CustomHttpPattern kind - * @property {string|null} [path] CustomHttpPattern path - */ - - /** - * Constructs a new CustomHttpPattern. - * @memberof google.api - * @classdesc Represents a CustomHttpPattern. - * @implements ICustomHttpPattern - * @constructor - * @param {google.api.ICustomHttpPattern=} [properties] Properties to set - */ - function CustomHttpPattern(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CustomHttpPattern kind. - * @member {string} kind - * @memberof google.api.CustomHttpPattern - * @instance - */ - CustomHttpPattern.prototype.kind = ""; - - /** - * CustomHttpPattern path. - * @member {string} path - * @memberof google.api.CustomHttpPattern - * @instance - */ - CustomHttpPattern.prototype.path = ""; - - /** - * Creates a new CustomHttpPattern instance using the specified properties. - * @function create - * @memberof google.api.CustomHttpPattern - * @static - * @param {google.api.ICustomHttpPattern=} [properties] Properties to set - * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance - */ - CustomHttpPattern.create = function create(properties) { - return new CustomHttpPattern(properties); - }; - - /** - * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. - * @function encode - * @memberof google.api.CustomHttpPattern - * @static - * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CustomHttpPattern.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); - if (message.path != null && Object.hasOwnProperty.call(message, "path")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); - return writer; - }; - - /** - * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.CustomHttpPattern - * @static - * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CustomHttpPattern message from the specified reader or buffer. - * @function decode - * @memberof google.api.CustomHttpPattern - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.CustomHttpPattern} CustomHttpPattern - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CustomHttpPattern.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.kind = reader.string(); - break; - } - case 2: { - message.path = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.CustomHttpPattern - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.CustomHttpPattern} CustomHttpPattern - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CustomHttpPattern message. - * @function verify - * @memberof google.api.CustomHttpPattern - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CustomHttpPattern.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.kind != null && message.hasOwnProperty("kind")) - if (!$util.isString(message.kind)) - return "kind: string expected"; - if (message.path != null && message.hasOwnProperty("path")) - if (!$util.isString(message.path)) - return "path: string expected"; - return null; - }; - - /** - * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.CustomHttpPattern - * @static - * @param {Object.} object Plain object - * @returns {google.api.CustomHttpPattern} CustomHttpPattern - */ - CustomHttpPattern.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.CustomHttpPattern) - return object; - var message = new $root.google.api.CustomHttpPattern(); - if (object.kind != null) - message.kind = String(object.kind); - if (object.path != null) - message.path = String(object.path); - return message; - }; - - /** - * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.CustomHttpPattern - * @static - * @param {google.api.CustomHttpPattern} message CustomHttpPattern - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CustomHttpPattern.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.kind = ""; - object.path = ""; - } - if (message.kind != null && message.hasOwnProperty("kind")) - object.kind = message.kind; - if (message.path != null && message.hasOwnProperty("path")) - object.path = message.path; - return object; - }; - - /** - * Converts this CustomHttpPattern to JSON. - * @function toJSON - * @memberof google.api.CustomHttpPattern - * @instance - * @returns {Object.} JSON object - */ - CustomHttpPattern.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CustomHttpPattern - * @function getTypeUrl - * @memberof google.api.CustomHttpPattern - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CustomHttpPattern.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.CustomHttpPattern"; - }; - - return CustomHttpPattern; - })(); - - api.CommonLanguageSettings = (function() { - - /** - * Properties of a CommonLanguageSettings. - * @memberof google.api - * @interface ICommonLanguageSettings - * @property {string|null} [referenceDocsUri] CommonLanguageSettings referenceDocsUri - * @property {Array.|null} [destinations] CommonLanguageSettings destinations - */ - - /** - * Constructs a new CommonLanguageSettings. - * @memberof google.api - * @classdesc Represents a CommonLanguageSettings. - * @implements ICommonLanguageSettings - * @constructor - * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set - */ - function CommonLanguageSettings(properties) { - this.destinations = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CommonLanguageSettings referenceDocsUri. - * @member {string} referenceDocsUri - * @memberof google.api.CommonLanguageSettings - * @instance - */ - CommonLanguageSettings.prototype.referenceDocsUri = ""; - - /** - * CommonLanguageSettings destinations. - * @member {Array.} destinations - * @memberof google.api.CommonLanguageSettings - * @instance - */ - CommonLanguageSettings.prototype.destinations = $util.emptyArray; - - /** - * Creates a new CommonLanguageSettings instance using the specified properties. - * @function create - * @memberof google.api.CommonLanguageSettings - * @static - * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set - * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings instance - */ - CommonLanguageSettings.create = function create(properties) { - return new CommonLanguageSettings(properties); - }; - - /** - * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. - * @function encode - * @memberof google.api.CommonLanguageSettings - * @static - * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CommonLanguageSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.referenceDocsUri != null && Object.hasOwnProperty.call(message, "referenceDocsUri")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.referenceDocsUri); - if (message.destinations != null && message.destinations.length) { - writer.uint32(/* id 2, wireType 2 =*/18).fork(); - for (var i = 0; i < message.destinations.length; ++i) - writer.int32(message.destinations[i]); - writer.ldelim(); - } - return writer; - }; - - /** - * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.CommonLanguageSettings - * @static - * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CommonLanguageSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CommonLanguageSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.CommonLanguageSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CommonLanguageSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CommonLanguageSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.referenceDocsUri = reader.string(); - break; - } - case 2: { - if (!(message.destinations && message.destinations.length)) - message.destinations = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.destinations.push(reader.int32()); - } else - message.destinations.push(reader.int32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.CommonLanguageSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CommonLanguageSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CommonLanguageSettings message. - * @function verify - * @memberof google.api.CommonLanguageSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CommonLanguageSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) - if (!$util.isString(message.referenceDocsUri)) - return "referenceDocsUri: string expected"; - if (message.destinations != null && message.hasOwnProperty("destinations")) { - if (!Array.isArray(message.destinations)) - return "destinations: array expected"; - for (var i = 0; i < message.destinations.length; ++i) - switch (message.destinations[i]) { - default: - return "destinations: enum value[] expected"; - case 0: - case 10: - case 20: - break; - } - } - return null; - }; - - /** - * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.CommonLanguageSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings - */ - CommonLanguageSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.CommonLanguageSettings) - return object; - var message = new $root.google.api.CommonLanguageSettings(); - if (object.referenceDocsUri != null) - message.referenceDocsUri = String(object.referenceDocsUri); - if (object.destinations) { - if (!Array.isArray(object.destinations)) - throw TypeError(".google.api.CommonLanguageSettings.destinations: array expected"); - message.destinations = []; - for (var i = 0; i < object.destinations.length; ++i) - switch (object.destinations[i]) { - default: - if (typeof object.destinations[i] === "number") { - message.destinations[i] = object.destinations[i]; - break; - } - case "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": - case 0: - message.destinations[i] = 0; - break; - case "GITHUB": - case 10: - message.destinations[i] = 10; - break; - case "PACKAGE_MANAGER": - case 20: - message.destinations[i] = 20; - break; - } - } - return message; - }; - - /** - * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.CommonLanguageSettings - * @static - * @param {google.api.CommonLanguageSettings} message CommonLanguageSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CommonLanguageSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.destinations = []; - if (options.defaults) - object.referenceDocsUri = ""; - if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) - object.referenceDocsUri = message.referenceDocsUri; - if (message.destinations && message.destinations.length) { - object.destinations = []; - for (var j = 0; j < message.destinations.length; ++j) - object.destinations[j] = options.enums === String ? $root.google.api.ClientLibraryDestination[message.destinations[j]] === undefined ? message.destinations[j] : $root.google.api.ClientLibraryDestination[message.destinations[j]] : message.destinations[j]; - } - return object; - }; - - /** - * Converts this CommonLanguageSettings to JSON. - * @function toJSON - * @memberof google.api.CommonLanguageSettings - * @instance - * @returns {Object.} JSON object - */ - CommonLanguageSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CommonLanguageSettings - * @function getTypeUrl - * @memberof google.api.CommonLanguageSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CommonLanguageSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.CommonLanguageSettings"; - }; - - return CommonLanguageSettings; - })(); - - api.ClientLibrarySettings = (function() { - - /** - * Properties of a ClientLibrarySettings. - * @memberof google.api - * @interface IClientLibrarySettings - * @property {string|null} [version] ClientLibrarySettings version - * @property {google.api.LaunchStage|null} [launchStage] ClientLibrarySettings launchStage - * @property {boolean|null} [restNumericEnums] ClientLibrarySettings restNumericEnums - * @property {google.api.IJavaSettings|null} [javaSettings] ClientLibrarySettings javaSettings - * @property {google.api.ICppSettings|null} [cppSettings] ClientLibrarySettings cppSettings - * @property {google.api.IPhpSettings|null} [phpSettings] ClientLibrarySettings phpSettings - * @property {google.api.IPythonSettings|null} [pythonSettings] ClientLibrarySettings pythonSettings - * @property {google.api.INodeSettings|null} [nodeSettings] ClientLibrarySettings nodeSettings - * @property {google.api.IDotnetSettings|null} [dotnetSettings] ClientLibrarySettings dotnetSettings - * @property {google.api.IRubySettings|null} [rubySettings] ClientLibrarySettings rubySettings - * @property {google.api.IGoSettings|null} [goSettings] ClientLibrarySettings goSettings - */ - - /** - * Constructs a new ClientLibrarySettings. - * @memberof google.api - * @classdesc Represents a ClientLibrarySettings. - * @implements IClientLibrarySettings - * @constructor - * @param {google.api.IClientLibrarySettings=} [properties] Properties to set - */ - function ClientLibrarySettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ClientLibrarySettings version. - * @member {string} version - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.version = ""; - - /** - * ClientLibrarySettings launchStage. - * @member {google.api.LaunchStage} launchStage - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.launchStage = 0; - - /** - * ClientLibrarySettings restNumericEnums. - * @member {boolean} restNumericEnums - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.restNumericEnums = false; - - /** - * ClientLibrarySettings javaSettings. - * @member {google.api.IJavaSettings|null|undefined} javaSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.javaSettings = null; - - /** - * ClientLibrarySettings cppSettings. - * @member {google.api.ICppSettings|null|undefined} cppSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.cppSettings = null; - - /** - * ClientLibrarySettings phpSettings. - * @member {google.api.IPhpSettings|null|undefined} phpSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.phpSettings = null; - - /** - * ClientLibrarySettings pythonSettings. - * @member {google.api.IPythonSettings|null|undefined} pythonSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.pythonSettings = null; - - /** - * ClientLibrarySettings nodeSettings. - * @member {google.api.INodeSettings|null|undefined} nodeSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.nodeSettings = null; - - /** - * ClientLibrarySettings dotnetSettings. - * @member {google.api.IDotnetSettings|null|undefined} dotnetSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.dotnetSettings = null; - - /** - * ClientLibrarySettings rubySettings. - * @member {google.api.IRubySettings|null|undefined} rubySettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.rubySettings = null; - - /** - * ClientLibrarySettings goSettings. - * @member {google.api.IGoSettings|null|undefined} goSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.goSettings = null; - - /** - * Creates a new ClientLibrarySettings instance using the specified properties. - * @function create - * @memberof google.api.ClientLibrarySettings - * @static - * @param {google.api.IClientLibrarySettings=} [properties] Properties to set - * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings instance - */ - ClientLibrarySettings.create = function create(properties) { - return new ClientLibrarySettings(properties); - }; - - /** - * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. - * @function encode - * @memberof google.api.ClientLibrarySettings - * @static - * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClientLibrarySettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); - if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.launchStage); - if (message.restNumericEnums != null && Object.hasOwnProperty.call(message, "restNumericEnums")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.restNumericEnums); - if (message.javaSettings != null && Object.hasOwnProperty.call(message, "javaSettings")) - $root.google.api.JavaSettings.encode(message.javaSettings, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); - if (message.cppSettings != null && Object.hasOwnProperty.call(message, "cppSettings")) - $root.google.api.CppSettings.encode(message.cppSettings, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); - if (message.phpSettings != null && Object.hasOwnProperty.call(message, "phpSettings")) - $root.google.api.PhpSettings.encode(message.phpSettings, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); - if (message.pythonSettings != null && Object.hasOwnProperty.call(message, "pythonSettings")) - $root.google.api.PythonSettings.encode(message.pythonSettings, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); - if (message.nodeSettings != null && Object.hasOwnProperty.call(message, "nodeSettings")) - $root.google.api.NodeSettings.encode(message.nodeSettings, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); - if (message.dotnetSettings != null && Object.hasOwnProperty.call(message, "dotnetSettings")) - $root.google.api.DotnetSettings.encode(message.dotnetSettings, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); - if (message.rubySettings != null && Object.hasOwnProperty.call(message, "rubySettings")) - $root.google.api.RubySettings.encode(message.rubySettings, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); - if (message.goSettings != null && Object.hasOwnProperty.call(message, "goSettings")) - $root.google.api.GoSettings.encode(message.goSettings, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.ClientLibrarySettings - * @static - * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClientLibrarySettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ClientLibrarySettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.ClientLibrarySettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClientLibrarySettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ClientLibrarySettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.version = reader.string(); - break; - } - case 2: { - message.launchStage = reader.int32(); - break; - } - case 3: { - message.restNumericEnums = reader.bool(); - break; - } - case 21: { - message.javaSettings = $root.google.api.JavaSettings.decode(reader, reader.uint32()); - break; - } - case 22: { - message.cppSettings = $root.google.api.CppSettings.decode(reader, reader.uint32()); - break; - } - case 23: { - message.phpSettings = $root.google.api.PhpSettings.decode(reader, reader.uint32()); - break; - } - case 24: { - message.pythonSettings = $root.google.api.PythonSettings.decode(reader, reader.uint32()); - break; - } - case 25: { - message.nodeSettings = $root.google.api.NodeSettings.decode(reader, reader.uint32()); - break; - } - case 26: { - message.dotnetSettings = $root.google.api.DotnetSettings.decode(reader, reader.uint32()); - break; - } - case 27: { - message.rubySettings = $root.google.api.RubySettings.decode(reader, reader.uint32()); - break; - } - case 28: { - message.goSettings = $root.google.api.GoSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.ClientLibrarySettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClientLibrarySettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ClientLibrarySettings message. - * @function verify - * @memberof google.api.ClientLibrarySettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ClientLibrarySettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.version != null && message.hasOwnProperty("version")) - if (!$util.isString(message.version)) - return "version: string expected"; - if (message.launchStage != null && message.hasOwnProperty("launchStage")) - switch (message.launchStage) { - default: - return "launchStage: enum value expected"; - case 0: - case 6: - case 7: - case 1: - case 2: - case 3: - case 4: - case 5: - break; - } - if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) - if (typeof message.restNumericEnums !== "boolean") - return "restNumericEnums: boolean expected"; - if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) { - var error = $root.google.api.JavaSettings.verify(message.javaSettings); - if (error) - return "javaSettings." + error; - } - if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) { - var error = $root.google.api.CppSettings.verify(message.cppSettings); - if (error) - return "cppSettings." + error; - } - if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) { - var error = $root.google.api.PhpSettings.verify(message.phpSettings); - if (error) - return "phpSettings." + error; - } - if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) { - var error = $root.google.api.PythonSettings.verify(message.pythonSettings); - if (error) - return "pythonSettings." + error; - } - if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) { - var error = $root.google.api.NodeSettings.verify(message.nodeSettings); - if (error) - return "nodeSettings." + error; - } - if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) { - var error = $root.google.api.DotnetSettings.verify(message.dotnetSettings); - if (error) - return "dotnetSettings." + error; - } - if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) { - var error = $root.google.api.RubySettings.verify(message.rubySettings); - if (error) - return "rubySettings." + error; - } - if (message.goSettings != null && message.hasOwnProperty("goSettings")) { - var error = $root.google.api.GoSettings.verify(message.goSettings); - if (error) - return "goSettings." + error; - } - return null; - }; - - /** - * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.ClientLibrarySettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings - */ - ClientLibrarySettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.ClientLibrarySettings) - return object; - var message = new $root.google.api.ClientLibrarySettings(); - if (object.version != null) - message.version = String(object.version); - switch (object.launchStage) { - default: - if (typeof object.launchStage === "number") { - message.launchStage = object.launchStage; - break; - } - break; - case "LAUNCH_STAGE_UNSPECIFIED": - case 0: - message.launchStage = 0; - break; - case "UNIMPLEMENTED": - case 6: - message.launchStage = 6; - break; - case "PRELAUNCH": - case 7: - message.launchStage = 7; - break; - case "EARLY_ACCESS": - case 1: - message.launchStage = 1; - break; - case "ALPHA": - case 2: - message.launchStage = 2; - break; - case "BETA": - case 3: - message.launchStage = 3; - break; - case "GA": - case 4: - message.launchStage = 4; - break; - case "DEPRECATED": - case 5: - message.launchStage = 5; - break; - } - if (object.restNumericEnums != null) - message.restNumericEnums = Boolean(object.restNumericEnums); - if (object.javaSettings != null) { - if (typeof object.javaSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.javaSettings: object expected"); - message.javaSettings = $root.google.api.JavaSettings.fromObject(object.javaSettings); - } - if (object.cppSettings != null) { - if (typeof object.cppSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.cppSettings: object expected"); - message.cppSettings = $root.google.api.CppSettings.fromObject(object.cppSettings); - } - if (object.phpSettings != null) { - if (typeof object.phpSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.phpSettings: object expected"); - message.phpSettings = $root.google.api.PhpSettings.fromObject(object.phpSettings); - } - if (object.pythonSettings != null) { - if (typeof object.pythonSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.pythonSettings: object expected"); - message.pythonSettings = $root.google.api.PythonSettings.fromObject(object.pythonSettings); - } - if (object.nodeSettings != null) { - if (typeof object.nodeSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.nodeSettings: object expected"); - message.nodeSettings = $root.google.api.NodeSettings.fromObject(object.nodeSettings); - } - if (object.dotnetSettings != null) { - if (typeof object.dotnetSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.dotnetSettings: object expected"); - message.dotnetSettings = $root.google.api.DotnetSettings.fromObject(object.dotnetSettings); - } - if (object.rubySettings != null) { - if (typeof object.rubySettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.rubySettings: object expected"); - message.rubySettings = $root.google.api.RubySettings.fromObject(object.rubySettings); - } - if (object.goSettings != null) { - if (typeof object.goSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.goSettings: object expected"); - message.goSettings = $root.google.api.GoSettings.fromObject(object.goSettings); - } - return message; - }; - - /** - * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.ClientLibrarySettings - * @static - * @param {google.api.ClientLibrarySettings} message ClientLibrarySettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ClientLibrarySettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.version = ""; - object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; - object.restNumericEnums = false; - object.javaSettings = null; - object.cppSettings = null; - object.phpSettings = null; - object.pythonSettings = null; - object.nodeSettings = null; - object.dotnetSettings = null; - object.rubySettings = null; - object.goSettings = null; - } - if (message.version != null && message.hasOwnProperty("version")) - object.version = message.version; - if (message.launchStage != null && message.hasOwnProperty("launchStage")) - object.launchStage = options.enums === String ? $root.google.api.LaunchStage[message.launchStage] === undefined ? message.launchStage : $root.google.api.LaunchStage[message.launchStage] : message.launchStage; - if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) - object.restNumericEnums = message.restNumericEnums; - if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) - object.javaSettings = $root.google.api.JavaSettings.toObject(message.javaSettings, options); - if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) - object.cppSettings = $root.google.api.CppSettings.toObject(message.cppSettings, options); - if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) - object.phpSettings = $root.google.api.PhpSettings.toObject(message.phpSettings, options); - if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) - object.pythonSettings = $root.google.api.PythonSettings.toObject(message.pythonSettings, options); - if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) - object.nodeSettings = $root.google.api.NodeSettings.toObject(message.nodeSettings, options); - if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) - object.dotnetSettings = $root.google.api.DotnetSettings.toObject(message.dotnetSettings, options); - if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) - object.rubySettings = $root.google.api.RubySettings.toObject(message.rubySettings, options); - if (message.goSettings != null && message.hasOwnProperty("goSettings")) - object.goSettings = $root.google.api.GoSettings.toObject(message.goSettings, options); - return object; - }; - - /** - * Converts this ClientLibrarySettings to JSON. - * @function toJSON - * @memberof google.api.ClientLibrarySettings - * @instance - * @returns {Object.} JSON object - */ - ClientLibrarySettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ClientLibrarySettings - * @function getTypeUrl - * @memberof google.api.ClientLibrarySettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ClientLibrarySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.ClientLibrarySettings"; - }; - - return ClientLibrarySettings; - })(); - - api.Publishing = (function() { - - /** - * Properties of a Publishing. - * @memberof google.api - * @interface IPublishing - * @property {Array.|null} [methodSettings] Publishing methodSettings - * @property {string|null} [newIssueUri] Publishing newIssueUri - * @property {string|null} [documentationUri] Publishing documentationUri - * @property {string|null} [apiShortName] Publishing apiShortName - * @property {string|null} [githubLabel] Publishing githubLabel - * @property {Array.|null} [codeownerGithubTeams] Publishing codeownerGithubTeams - * @property {string|null} [docTagPrefix] Publishing docTagPrefix - * @property {google.api.ClientLibraryOrganization|null} [organization] Publishing organization - * @property {Array.|null} [librarySettings] Publishing librarySettings - * @property {string|null} [protoReferenceDocumentationUri] Publishing protoReferenceDocumentationUri - * @property {string|null} [restReferenceDocumentationUri] Publishing restReferenceDocumentationUri - */ - - /** - * Constructs a new Publishing. - * @memberof google.api - * @classdesc Represents a Publishing. - * @implements IPublishing - * @constructor - * @param {google.api.IPublishing=} [properties] Properties to set - */ - function Publishing(properties) { - this.methodSettings = []; - this.codeownerGithubTeams = []; - this.librarySettings = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Publishing methodSettings. - * @member {Array.} methodSettings - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.methodSettings = $util.emptyArray; - - /** - * Publishing newIssueUri. - * @member {string} newIssueUri - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.newIssueUri = ""; - - /** - * Publishing documentationUri. - * @member {string} documentationUri - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.documentationUri = ""; - - /** - * Publishing apiShortName. - * @member {string} apiShortName - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.apiShortName = ""; - - /** - * Publishing githubLabel. - * @member {string} githubLabel - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.githubLabel = ""; - - /** - * Publishing codeownerGithubTeams. - * @member {Array.} codeownerGithubTeams - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.codeownerGithubTeams = $util.emptyArray; - - /** - * Publishing docTagPrefix. - * @member {string} docTagPrefix - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.docTagPrefix = ""; - - /** - * Publishing organization. - * @member {google.api.ClientLibraryOrganization} organization - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.organization = 0; - - /** - * Publishing librarySettings. - * @member {Array.} librarySettings - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.librarySettings = $util.emptyArray; - - /** - * Publishing protoReferenceDocumentationUri. - * @member {string} protoReferenceDocumentationUri - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.protoReferenceDocumentationUri = ""; - - /** - * Publishing restReferenceDocumentationUri. - * @member {string} restReferenceDocumentationUri - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.restReferenceDocumentationUri = ""; - - /** - * Creates a new Publishing instance using the specified properties. - * @function create - * @memberof google.api.Publishing - * @static - * @param {google.api.IPublishing=} [properties] Properties to set - * @returns {google.api.Publishing} Publishing instance - */ - Publishing.create = function create(properties) { - return new Publishing(properties); - }; - - /** - * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. - * @function encode - * @memberof google.api.Publishing - * @static - * @param {google.api.IPublishing} message Publishing message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Publishing.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.methodSettings != null && message.methodSettings.length) - for (var i = 0; i < message.methodSettings.length; ++i) - $root.google.api.MethodSettings.encode(message.methodSettings[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.newIssueUri != null && Object.hasOwnProperty.call(message, "newIssueUri")) - writer.uint32(/* id 101, wireType 2 =*/810).string(message.newIssueUri); - if (message.documentationUri != null && Object.hasOwnProperty.call(message, "documentationUri")) - writer.uint32(/* id 102, wireType 2 =*/818).string(message.documentationUri); - if (message.apiShortName != null && Object.hasOwnProperty.call(message, "apiShortName")) - writer.uint32(/* id 103, wireType 2 =*/826).string(message.apiShortName); - if (message.githubLabel != null && Object.hasOwnProperty.call(message, "githubLabel")) - writer.uint32(/* id 104, wireType 2 =*/834).string(message.githubLabel); - if (message.codeownerGithubTeams != null && message.codeownerGithubTeams.length) - for (var i = 0; i < message.codeownerGithubTeams.length; ++i) - writer.uint32(/* id 105, wireType 2 =*/842).string(message.codeownerGithubTeams[i]); - if (message.docTagPrefix != null && Object.hasOwnProperty.call(message, "docTagPrefix")) - writer.uint32(/* id 106, wireType 2 =*/850).string(message.docTagPrefix); - if (message.organization != null && Object.hasOwnProperty.call(message, "organization")) - writer.uint32(/* id 107, wireType 0 =*/856).int32(message.organization); - if (message.librarySettings != null && message.librarySettings.length) - for (var i = 0; i < message.librarySettings.length; ++i) - $root.google.api.ClientLibrarySettings.encode(message.librarySettings[i], writer.uint32(/* id 109, wireType 2 =*/874).fork()).ldelim(); - if (message.protoReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "protoReferenceDocumentationUri")) - writer.uint32(/* id 110, wireType 2 =*/882).string(message.protoReferenceDocumentationUri); - if (message.restReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "restReferenceDocumentationUri")) - writer.uint32(/* id 111, wireType 2 =*/890).string(message.restReferenceDocumentationUri); - return writer; - }; - - /** - * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.Publishing - * @static - * @param {google.api.IPublishing} message Publishing message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Publishing.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Publishing message from the specified reader or buffer. - * @function decode - * @memberof google.api.Publishing - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.Publishing} Publishing - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Publishing.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Publishing(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - if (!(message.methodSettings && message.methodSettings.length)) - message.methodSettings = []; - message.methodSettings.push($root.google.api.MethodSettings.decode(reader, reader.uint32())); - break; - } - case 101: { - message.newIssueUri = reader.string(); - break; - } - case 102: { - message.documentationUri = reader.string(); - break; - } - case 103: { - message.apiShortName = reader.string(); - break; - } - case 104: { - message.githubLabel = reader.string(); - break; - } - case 105: { - if (!(message.codeownerGithubTeams && message.codeownerGithubTeams.length)) - message.codeownerGithubTeams = []; - message.codeownerGithubTeams.push(reader.string()); - break; - } - case 106: { - message.docTagPrefix = reader.string(); - break; - } - case 107: { - message.organization = reader.int32(); - break; - } - case 109: { - if (!(message.librarySettings && message.librarySettings.length)) - message.librarySettings = []; - message.librarySettings.push($root.google.api.ClientLibrarySettings.decode(reader, reader.uint32())); - break; - } - case 110: { - message.protoReferenceDocumentationUri = reader.string(); - break; - } - case 111: { - message.restReferenceDocumentationUri = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Publishing message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.Publishing - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.Publishing} Publishing - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Publishing.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Publishing message. - * @function verify - * @memberof google.api.Publishing - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Publishing.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.methodSettings != null && message.hasOwnProperty("methodSettings")) { - if (!Array.isArray(message.methodSettings)) - return "methodSettings: array expected"; - for (var i = 0; i < message.methodSettings.length; ++i) { - var error = $root.google.api.MethodSettings.verify(message.methodSettings[i]); - if (error) - return "methodSettings." + error; - } - } - if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) - if (!$util.isString(message.newIssueUri)) - return "newIssueUri: string expected"; - if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) - if (!$util.isString(message.documentationUri)) - return "documentationUri: string expected"; - if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) - if (!$util.isString(message.apiShortName)) - return "apiShortName: string expected"; - if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) - if (!$util.isString(message.githubLabel)) - return "githubLabel: string expected"; - if (message.codeownerGithubTeams != null && message.hasOwnProperty("codeownerGithubTeams")) { - if (!Array.isArray(message.codeownerGithubTeams)) - return "codeownerGithubTeams: array expected"; - for (var i = 0; i < message.codeownerGithubTeams.length; ++i) - if (!$util.isString(message.codeownerGithubTeams[i])) - return "codeownerGithubTeams: string[] expected"; - } - if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) - if (!$util.isString(message.docTagPrefix)) - return "docTagPrefix: string expected"; - if (message.organization != null && message.hasOwnProperty("organization")) - switch (message.organization) { - default: - return "organization: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - break; - } - if (message.librarySettings != null && message.hasOwnProperty("librarySettings")) { - if (!Array.isArray(message.librarySettings)) - return "librarySettings: array expected"; - for (var i = 0; i < message.librarySettings.length; ++i) { - var error = $root.google.api.ClientLibrarySettings.verify(message.librarySettings[i]); - if (error) - return "librarySettings." + error; - } - } - if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) - if (!$util.isString(message.protoReferenceDocumentationUri)) - return "protoReferenceDocumentationUri: string expected"; - if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) - if (!$util.isString(message.restReferenceDocumentationUri)) - return "restReferenceDocumentationUri: string expected"; - return null; - }; - - /** - * Creates a Publishing message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.Publishing - * @static - * @param {Object.} object Plain object - * @returns {google.api.Publishing} Publishing - */ - Publishing.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.Publishing) - return object; - var message = new $root.google.api.Publishing(); - if (object.methodSettings) { - if (!Array.isArray(object.methodSettings)) - throw TypeError(".google.api.Publishing.methodSettings: array expected"); - message.methodSettings = []; - for (var i = 0; i < object.methodSettings.length; ++i) { - if (typeof object.methodSettings[i] !== "object") - throw TypeError(".google.api.Publishing.methodSettings: object expected"); - message.methodSettings[i] = $root.google.api.MethodSettings.fromObject(object.methodSettings[i]); - } - } - if (object.newIssueUri != null) - message.newIssueUri = String(object.newIssueUri); - if (object.documentationUri != null) - message.documentationUri = String(object.documentationUri); - if (object.apiShortName != null) - message.apiShortName = String(object.apiShortName); - if (object.githubLabel != null) - message.githubLabel = String(object.githubLabel); - if (object.codeownerGithubTeams) { - if (!Array.isArray(object.codeownerGithubTeams)) - throw TypeError(".google.api.Publishing.codeownerGithubTeams: array expected"); - message.codeownerGithubTeams = []; - for (var i = 0; i < object.codeownerGithubTeams.length; ++i) - message.codeownerGithubTeams[i] = String(object.codeownerGithubTeams[i]); - } - if (object.docTagPrefix != null) - message.docTagPrefix = String(object.docTagPrefix); - switch (object.organization) { - default: - if (typeof object.organization === "number") { - message.organization = object.organization; - break; - } - break; - case "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": - case 0: - message.organization = 0; - break; - case "CLOUD": - case 1: - message.organization = 1; - break; - case "ADS": - case 2: - message.organization = 2; - break; - case "PHOTOS": - case 3: - message.organization = 3; - break; - case "STREET_VIEW": - case 4: - message.organization = 4; - break; - case "SHOPPING": - case 5: - message.organization = 5; - break; - case "GEO": - case 6: - message.organization = 6; - break; - case "GENERATIVE_AI": - case 7: - message.organization = 7; - break; - } - if (object.librarySettings) { - if (!Array.isArray(object.librarySettings)) - throw TypeError(".google.api.Publishing.librarySettings: array expected"); - message.librarySettings = []; - for (var i = 0; i < object.librarySettings.length; ++i) { - if (typeof object.librarySettings[i] !== "object") - throw TypeError(".google.api.Publishing.librarySettings: object expected"); - message.librarySettings[i] = $root.google.api.ClientLibrarySettings.fromObject(object.librarySettings[i]); - } - } - if (object.protoReferenceDocumentationUri != null) - message.protoReferenceDocumentationUri = String(object.protoReferenceDocumentationUri); - if (object.restReferenceDocumentationUri != null) - message.restReferenceDocumentationUri = String(object.restReferenceDocumentationUri); - return message; - }; - - /** - * Creates a plain object from a Publishing message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.Publishing - * @static - * @param {google.api.Publishing} message Publishing - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Publishing.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.methodSettings = []; - object.codeownerGithubTeams = []; - object.librarySettings = []; - } - if (options.defaults) { - object.newIssueUri = ""; - object.documentationUri = ""; - object.apiShortName = ""; - object.githubLabel = ""; - object.docTagPrefix = ""; - object.organization = options.enums === String ? "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED" : 0; - object.protoReferenceDocumentationUri = ""; - object.restReferenceDocumentationUri = ""; - } - if (message.methodSettings && message.methodSettings.length) { - object.methodSettings = []; - for (var j = 0; j < message.methodSettings.length; ++j) - object.methodSettings[j] = $root.google.api.MethodSettings.toObject(message.methodSettings[j], options); - } - if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) - object.newIssueUri = message.newIssueUri; - if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) - object.documentationUri = message.documentationUri; - if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) - object.apiShortName = message.apiShortName; - if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) - object.githubLabel = message.githubLabel; - if (message.codeownerGithubTeams && message.codeownerGithubTeams.length) { - object.codeownerGithubTeams = []; - for (var j = 0; j < message.codeownerGithubTeams.length; ++j) - object.codeownerGithubTeams[j] = message.codeownerGithubTeams[j]; - } - if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) - object.docTagPrefix = message.docTagPrefix; - if (message.organization != null && message.hasOwnProperty("organization")) - object.organization = options.enums === String ? $root.google.api.ClientLibraryOrganization[message.organization] === undefined ? message.organization : $root.google.api.ClientLibraryOrganization[message.organization] : message.organization; - if (message.librarySettings && message.librarySettings.length) { - object.librarySettings = []; - for (var j = 0; j < message.librarySettings.length; ++j) - object.librarySettings[j] = $root.google.api.ClientLibrarySettings.toObject(message.librarySettings[j], options); - } - if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) - object.protoReferenceDocumentationUri = message.protoReferenceDocumentationUri; - if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) - object.restReferenceDocumentationUri = message.restReferenceDocumentationUri; - return object; - }; - - /** - * Converts this Publishing to JSON. - * @function toJSON - * @memberof google.api.Publishing - * @instance - * @returns {Object.} JSON object - */ - Publishing.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Publishing - * @function getTypeUrl - * @memberof google.api.Publishing - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Publishing.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.Publishing"; - }; - - return Publishing; - })(); - - api.JavaSettings = (function() { - - /** - * Properties of a JavaSettings. - * @memberof google.api - * @interface IJavaSettings - * @property {string|null} [libraryPackage] JavaSettings libraryPackage - * @property {Object.|null} [serviceClassNames] JavaSettings serviceClassNames - * @property {google.api.ICommonLanguageSettings|null} [common] JavaSettings common - */ - - /** - * Constructs a new JavaSettings. - * @memberof google.api - * @classdesc Represents a JavaSettings. - * @implements IJavaSettings - * @constructor - * @param {google.api.IJavaSettings=} [properties] Properties to set - */ - function JavaSettings(properties) { - this.serviceClassNames = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * JavaSettings libraryPackage. - * @member {string} libraryPackage - * @memberof google.api.JavaSettings - * @instance - */ - JavaSettings.prototype.libraryPackage = ""; - - /** - * JavaSettings serviceClassNames. - * @member {Object.} serviceClassNames - * @memberof google.api.JavaSettings - * @instance - */ - JavaSettings.prototype.serviceClassNames = $util.emptyObject; - - /** - * JavaSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.JavaSettings - * @instance - */ - JavaSettings.prototype.common = null; - - /** - * Creates a new JavaSettings instance using the specified properties. - * @function create - * @memberof google.api.JavaSettings - * @static - * @param {google.api.IJavaSettings=} [properties] Properties to set - * @returns {google.api.JavaSettings} JavaSettings instance - */ - JavaSettings.create = function create(properties) { - return new JavaSettings(properties); - }; - - /** - * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. - * @function encode - * @memberof google.api.JavaSettings - * @static - * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - JavaSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.libraryPackage != null && Object.hasOwnProperty.call(message, "libraryPackage")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.libraryPackage); - if (message.serviceClassNames != null && Object.hasOwnProperty.call(message, "serviceClassNames")) - for (var keys = Object.keys(message.serviceClassNames), i = 0; i < keys.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.serviceClassNames[keys[i]]).ldelim(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.JavaSettings - * @static - * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - JavaSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a JavaSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.JavaSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.JavaSettings} JavaSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - JavaSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.JavaSettings(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.libraryPackage = reader.string(); - break; - } - case 2: { - if (message.serviceClassNames === $util.emptyObject) - message.serviceClassNames = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.serviceClassNames[key] = value; - break; - } - case 3: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a JavaSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.JavaSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.JavaSettings} JavaSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - JavaSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a JavaSettings message. - * @function verify - * @memberof google.api.JavaSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - JavaSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) - if (!$util.isString(message.libraryPackage)) - return "libraryPackage: string expected"; - if (message.serviceClassNames != null && message.hasOwnProperty("serviceClassNames")) { - if (!$util.isObject(message.serviceClassNames)) - return "serviceClassNames: object expected"; - var key = Object.keys(message.serviceClassNames); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.serviceClassNames[key[i]])) - return "serviceClassNames: string{k:string} expected"; - } - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.JavaSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.JavaSettings} JavaSettings - */ - JavaSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.JavaSettings) - return object; - var message = new $root.google.api.JavaSettings(); - if (object.libraryPackage != null) - message.libraryPackage = String(object.libraryPackage); - if (object.serviceClassNames) { - if (typeof object.serviceClassNames !== "object") - throw TypeError(".google.api.JavaSettings.serviceClassNames: object expected"); - message.serviceClassNames = {}; - for (var keys = Object.keys(object.serviceClassNames), i = 0; i < keys.length; ++i) - message.serviceClassNames[keys[i]] = String(object.serviceClassNames[keys[i]]); - } - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.JavaSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.JavaSettings - * @static - * @param {google.api.JavaSettings} message JavaSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - JavaSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.serviceClassNames = {}; - if (options.defaults) { - object.libraryPackage = ""; - object.common = null; - } - if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) - object.libraryPackage = message.libraryPackage; - var keys2; - if (message.serviceClassNames && (keys2 = Object.keys(message.serviceClassNames)).length) { - object.serviceClassNames = {}; - for (var j = 0; j < keys2.length; ++j) - object.serviceClassNames[keys2[j]] = message.serviceClassNames[keys2[j]]; - } - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this JavaSettings to JSON. - * @function toJSON - * @memberof google.api.JavaSettings - * @instance - * @returns {Object.} JSON object - */ - JavaSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for JavaSettings - * @function getTypeUrl - * @memberof google.api.JavaSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - JavaSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.JavaSettings"; - }; - - return JavaSettings; - })(); - - api.CppSettings = (function() { - - /** - * Properties of a CppSettings. - * @memberof google.api - * @interface ICppSettings - * @property {google.api.ICommonLanguageSettings|null} [common] CppSettings common - */ - - /** - * Constructs a new CppSettings. - * @memberof google.api - * @classdesc Represents a CppSettings. - * @implements ICppSettings - * @constructor - * @param {google.api.ICppSettings=} [properties] Properties to set - */ - function CppSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CppSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.CppSettings - * @instance - */ - CppSettings.prototype.common = null; - - /** - * Creates a new CppSettings instance using the specified properties. - * @function create - * @memberof google.api.CppSettings - * @static - * @param {google.api.ICppSettings=} [properties] Properties to set - * @returns {google.api.CppSettings} CppSettings instance - */ - CppSettings.create = function create(properties) { - return new CppSettings(properties); - }; - - /** - * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. - * @function encode - * @memberof google.api.CppSettings - * @static - * @param {google.api.ICppSettings} message CppSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CppSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.CppSettings - * @static - * @param {google.api.ICppSettings} message CppSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CppSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CppSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.CppSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.CppSettings} CppSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CppSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CppSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CppSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.CppSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.CppSettings} CppSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CppSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CppSettings message. - * @function verify - * @memberof google.api.CppSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CppSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.CppSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.CppSettings} CppSettings - */ - CppSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.CppSettings) - return object; - var message = new $root.google.api.CppSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.CppSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a CppSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.CppSettings - * @static - * @param {google.api.CppSettings} message CppSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CppSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this CppSettings to JSON. - * @function toJSON - * @memberof google.api.CppSettings - * @instance - * @returns {Object.} JSON object - */ - CppSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CppSettings - * @function getTypeUrl - * @memberof google.api.CppSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CppSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.CppSettings"; - }; - - return CppSettings; - })(); - - api.PhpSettings = (function() { - - /** - * Properties of a PhpSettings. - * @memberof google.api - * @interface IPhpSettings - * @property {google.api.ICommonLanguageSettings|null} [common] PhpSettings common - */ - - /** - * Constructs a new PhpSettings. - * @memberof google.api - * @classdesc Represents a PhpSettings. - * @implements IPhpSettings - * @constructor - * @param {google.api.IPhpSettings=} [properties] Properties to set - */ - function PhpSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PhpSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.PhpSettings - * @instance - */ - PhpSettings.prototype.common = null; - - /** - * Creates a new PhpSettings instance using the specified properties. - * @function create - * @memberof google.api.PhpSettings - * @static - * @param {google.api.IPhpSettings=} [properties] Properties to set - * @returns {google.api.PhpSettings} PhpSettings instance - */ - PhpSettings.create = function create(properties) { - return new PhpSettings(properties); - }; - - /** - * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. - * @function encode - * @memberof google.api.PhpSettings - * @static - * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PhpSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.PhpSettings - * @static - * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PhpSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PhpSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.PhpSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.PhpSettings} PhpSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PhpSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PhpSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PhpSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.PhpSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.PhpSettings} PhpSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PhpSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PhpSettings message. - * @function verify - * @memberof google.api.PhpSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PhpSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.PhpSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.PhpSettings} PhpSettings - */ - PhpSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.PhpSettings) - return object; - var message = new $root.google.api.PhpSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.PhpSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.PhpSettings - * @static - * @param {google.api.PhpSettings} message PhpSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PhpSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this PhpSettings to JSON. - * @function toJSON - * @memberof google.api.PhpSettings - * @instance - * @returns {Object.} JSON object - */ - PhpSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PhpSettings - * @function getTypeUrl - * @memberof google.api.PhpSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PhpSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.PhpSettings"; - }; - - return PhpSettings; - })(); - - api.PythonSettings = (function() { - - /** - * Properties of a PythonSettings. - * @memberof google.api - * @interface IPythonSettings - * @property {google.api.ICommonLanguageSettings|null} [common] PythonSettings common - */ - - /** - * Constructs a new PythonSettings. - * @memberof google.api - * @classdesc Represents a PythonSettings. - * @implements IPythonSettings - * @constructor - * @param {google.api.IPythonSettings=} [properties] Properties to set - */ - function PythonSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PythonSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.PythonSettings - * @instance - */ - PythonSettings.prototype.common = null; - - /** - * Creates a new PythonSettings instance using the specified properties. - * @function create - * @memberof google.api.PythonSettings - * @static - * @param {google.api.IPythonSettings=} [properties] Properties to set - * @returns {google.api.PythonSettings} PythonSettings instance - */ - PythonSettings.create = function create(properties) { - return new PythonSettings(properties); - }; - - /** - * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. - * @function encode - * @memberof google.api.PythonSettings - * @static - * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PythonSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.PythonSettings - * @static - * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PythonSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PythonSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.PythonSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.PythonSettings} PythonSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PythonSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PythonSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PythonSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.PythonSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.PythonSettings} PythonSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PythonSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PythonSettings message. - * @function verify - * @memberof google.api.PythonSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PythonSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.PythonSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.PythonSettings} PythonSettings - */ - PythonSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.PythonSettings) - return object; - var message = new $root.google.api.PythonSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.PythonSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.PythonSettings - * @static - * @param {google.api.PythonSettings} message PythonSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PythonSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this PythonSettings to JSON. - * @function toJSON - * @memberof google.api.PythonSettings - * @instance - * @returns {Object.} JSON object - */ - PythonSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PythonSettings - * @function getTypeUrl - * @memberof google.api.PythonSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PythonSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.PythonSettings"; - }; - - return PythonSettings; - })(); - - api.NodeSettings = (function() { - - /** - * Properties of a NodeSettings. - * @memberof google.api - * @interface INodeSettings - * @property {google.api.ICommonLanguageSettings|null} [common] NodeSettings common - */ - - /** - * Constructs a new NodeSettings. - * @memberof google.api - * @classdesc Represents a NodeSettings. - * @implements INodeSettings - * @constructor - * @param {google.api.INodeSettings=} [properties] Properties to set - */ - function NodeSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * NodeSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.NodeSettings - * @instance - */ - NodeSettings.prototype.common = null; - - /** - * Creates a new NodeSettings instance using the specified properties. - * @function create - * @memberof google.api.NodeSettings - * @static - * @param {google.api.INodeSettings=} [properties] Properties to set - * @returns {google.api.NodeSettings} NodeSettings instance - */ - NodeSettings.create = function create(properties) { - return new NodeSettings(properties); - }; - - /** - * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. - * @function encode - * @memberof google.api.NodeSettings - * @static - * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NodeSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.NodeSettings - * @static - * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NodeSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a NodeSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.NodeSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.NodeSettings} NodeSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NodeSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.NodeSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a NodeSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.NodeSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.NodeSettings} NodeSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NodeSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a NodeSettings message. - * @function verify - * @memberof google.api.NodeSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - NodeSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.NodeSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.NodeSettings} NodeSettings - */ - NodeSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.NodeSettings) - return object; - var message = new $root.google.api.NodeSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.NodeSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.NodeSettings - * @static - * @param {google.api.NodeSettings} message NodeSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - NodeSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this NodeSettings to JSON. - * @function toJSON - * @memberof google.api.NodeSettings - * @instance - * @returns {Object.} JSON object - */ - NodeSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for NodeSettings - * @function getTypeUrl - * @memberof google.api.NodeSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - NodeSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.NodeSettings"; - }; - - return NodeSettings; - })(); - - api.DotnetSettings = (function() { - - /** - * Properties of a DotnetSettings. - * @memberof google.api - * @interface IDotnetSettings - * @property {google.api.ICommonLanguageSettings|null} [common] DotnetSettings common - * @property {Object.|null} [renamedServices] DotnetSettings renamedServices - * @property {Object.|null} [renamedResources] DotnetSettings renamedResources - * @property {Array.|null} [ignoredResources] DotnetSettings ignoredResources - * @property {Array.|null} [forcedNamespaceAliases] DotnetSettings forcedNamespaceAliases - * @property {Array.|null} [handwrittenSignatures] DotnetSettings handwrittenSignatures - */ - - /** - * Constructs a new DotnetSettings. - * @memberof google.api - * @classdesc Represents a DotnetSettings. - * @implements IDotnetSettings - * @constructor - * @param {google.api.IDotnetSettings=} [properties] Properties to set - */ - function DotnetSettings(properties) { - this.renamedServices = {}; - this.renamedResources = {}; - this.ignoredResources = []; - this.forcedNamespaceAliases = []; - this.handwrittenSignatures = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DotnetSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.common = null; - - /** - * DotnetSettings renamedServices. - * @member {Object.} renamedServices - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.renamedServices = $util.emptyObject; - - /** - * DotnetSettings renamedResources. - * @member {Object.} renamedResources - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.renamedResources = $util.emptyObject; - - /** - * DotnetSettings ignoredResources. - * @member {Array.} ignoredResources - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.ignoredResources = $util.emptyArray; - - /** - * DotnetSettings forcedNamespaceAliases. - * @member {Array.} forcedNamespaceAliases - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.forcedNamespaceAliases = $util.emptyArray; - - /** - * DotnetSettings handwrittenSignatures. - * @member {Array.} handwrittenSignatures - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.handwrittenSignatures = $util.emptyArray; - - /** - * Creates a new DotnetSettings instance using the specified properties. - * @function create - * @memberof google.api.DotnetSettings - * @static - * @param {google.api.IDotnetSettings=} [properties] Properties to set - * @returns {google.api.DotnetSettings} DotnetSettings instance - */ - DotnetSettings.create = function create(properties) { - return new DotnetSettings(properties); - }; - - /** - * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. - * @function encode - * @memberof google.api.DotnetSettings - * @static - * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DotnetSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.renamedServices != null && Object.hasOwnProperty.call(message, "renamedServices")) - for (var keys = Object.keys(message.renamedServices), i = 0; i < keys.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedServices[keys[i]]).ldelim(); - if (message.renamedResources != null && Object.hasOwnProperty.call(message, "renamedResources")) - for (var keys = Object.keys(message.renamedResources), i = 0; i < keys.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedResources[keys[i]]).ldelim(); - if (message.ignoredResources != null && message.ignoredResources.length) - for (var i = 0; i < message.ignoredResources.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.ignoredResources[i]); - if (message.forcedNamespaceAliases != null && message.forcedNamespaceAliases.length) - for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.forcedNamespaceAliases[i]); - if (message.handwrittenSignatures != null && message.handwrittenSignatures.length) - for (var i = 0; i < message.handwrittenSignatures.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.handwrittenSignatures[i]); - return writer; - }; - - /** - * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.DotnetSettings - * @static - * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DotnetSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DotnetSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.DotnetSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.DotnetSettings} DotnetSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DotnetSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.DotnetSettings(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - case 2: { - if (message.renamedServices === $util.emptyObject) - message.renamedServices = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.renamedServices[key] = value; - break; - } - case 3: { - if (message.renamedResources === $util.emptyObject) - message.renamedResources = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.renamedResources[key] = value; - break; - } - case 4: { - if (!(message.ignoredResources && message.ignoredResources.length)) - message.ignoredResources = []; - message.ignoredResources.push(reader.string()); - break; - } - case 5: { - if (!(message.forcedNamespaceAliases && message.forcedNamespaceAliases.length)) - message.forcedNamespaceAliases = []; - message.forcedNamespaceAliases.push(reader.string()); - break; - } - case 6: { - if (!(message.handwrittenSignatures && message.handwrittenSignatures.length)) - message.handwrittenSignatures = []; - message.handwrittenSignatures.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.DotnetSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.DotnetSettings} DotnetSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DotnetSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DotnetSettings message. - * @function verify - * @memberof google.api.DotnetSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DotnetSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - if (message.renamedServices != null && message.hasOwnProperty("renamedServices")) { - if (!$util.isObject(message.renamedServices)) - return "renamedServices: object expected"; - var key = Object.keys(message.renamedServices); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.renamedServices[key[i]])) - return "renamedServices: string{k:string} expected"; - } - if (message.renamedResources != null && message.hasOwnProperty("renamedResources")) { - if (!$util.isObject(message.renamedResources)) - return "renamedResources: object expected"; - var key = Object.keys(message.renamedResources); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.renamedResources[key[i]])) - return "renamedResources: string{k:string} expected"; - } - if (message.ignoredResources != null && message.hasOwnProperty("ignoredResources")) { - if (!Array.isArray(message.ignoredResources)) - return "ignoredResources: array expected"; - for (var i = 0; i < message.ignoredResources.length; ++i) - if (!$util.isString(message.ignoredResources[i])) - return "ignoredResources: string[] expected"; - } - if (message.forcedNamespaceAliases != null && message.hasOwnProperty("forcedNamespaceAliases")) { - if (!Array.isArray(message.forcedNamespaceAliases)) - return "forcedNamespaceAliases: array expected"; - for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) - if (!$util.isString(message.forcedNamespaceAliases[i])) - return "forcedNamespaceAliases: string[] expected"; - } - if (message.handwrittenSignatures != null && message.hasOwnProperty("handwrittenSignatures")) { - if (!Array.isArray(message.handwrittenSignatures)) - return "handwrittenSignatures: array expected"; - for (var i = 0; i < message.handwrittenSignatures.length; ++i) - if (!$util.isString(message.handwrittenSignatures[i])) - return "handwrittenSignatures: string[] expected"; - } - return null; - }; - - /** - * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.DotnetSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.DotnetSettings} DotnetSettings - */ - DotnetSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.DotnetSettings) - return object; - var message = new $root.google.api.DotnetSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.DotnetSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - if (object.renamedServices) { - if (typeof object.renamedServices !== "object") - throw TypeError(".google.api.DotnetSettings.renamedServices: object expected"); - message.renamedServices = {}; - for (var keys = Object.keys(object.renamedServices), i = 0; i < keys.length; ++i) - message.renamedServices[keys[i]] = String(object.renamedServices[keys[i]]); - } - if (object.renamedResources) { - if (typeof object.renamedResources !== "object") - throw TypeError(".google.api.DotnetSettings.renamedResources: object expected"); - message.renamedResources = {}; - for (var keys = Object.keys(object.renamedResources), i = 0; i < keys.length; ++i) - message.renamedResources[keys[i]] = String(object.renamedResources[keys[i]]); - } - if (object.ignoredResources) { - if (!Array.isArray(object.ignoredResources)) - throw TypeError(".google.api.DotnetSettings.ignoredResources: array expected"); - message.ignoredResources = []; - for (var i = 0; i < object.ignoredResources.length; ++i) - message.ignoredResources[i] = String(object.ignoredResources[i]); - } - if (object.forcedNamespaceAliases) { - if (!Array.isArray(object.forcedNamespaceAliases)) - throw TypeError(".google.api.DotnetSettings.forcedNamespaceAliases: array expected"); - message.forcedNamespaceAliases = []; - for (var i = 0; i < object.forcedNamespaceAliases.length; ++i) - message.forcedNamespaceAliases[i] = String(object.forcedNamespaceAliases[i]); - } - if (object.handwrittenSignatures) { - if (!Array.isArray(object.handwrittenSignatures)) - throw TypeError(".google.api.DotnetSettings.handwrittenSignatures: array expected"); - message.handwrittenSignatures = []; - for (var i = 0; i < object.handwrittenSignatures.length; ++i) - message.handwrittenSignatures[i] = String(object.handwrittenSignatures[i]); - } - return message; - }; - - /** - * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.DotnetSettings - * @static - * @param {google.api.DotnetSettings} message DotnetSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DotnetSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.ignoredResources = []; - object.forcedNamespaceAliases = []; - object.handwrittenSignatures = []; - } - if (options.objects || options.defaults) { - object.renamedServices = {}; - object.renamedResources = {}; - } - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - var keys2; - if (message.renamedServices && (keys2 = Object.keys(message.renamedServices)).length) { - object.renamedServices = {}; - for (var j = 0; j < keys2.length; ++j) - object.renamedServices[keys2[j]] = message.renamedServices[keys2[j]]; - } - if (message.renamedResources && (keys2 = Object.keys(message.renamedResources)).length) { - object.renamedResources = {}; - for (var j = 0; j < keys2.length; ++j) - object.renamedResources[keys2[j]] = message.renamedResources[keys2[j]]; - } - if (message.ignoredResources && message.ignoredResources.length) { - object.ignoredResources = []; - for (var j = 0; j < message.ignoredResources.length; ++j) - object.ignoredResources[j] = message.ignoredResources[j]; - } - if (message.forcedNamespaceAliases && message.forcedNamespaceAliases.length) { - object.forcedNamespaceAliases = []; - for (var j = 0; j < message.forcedNamespaceAliases.length; ++j) - object.forcedNamespaceAliases[j] = message.forcedNamespaceAliases[j]; - } - if (message.handwrittenSignatures && message.handwrittenSignatures.length) { - object.handwrittenSignatures = []; - for (var j = 0; j < message.handwrittenSignatures.length; ++j) - object.handwrittenSignatures[j] = message.handwrittenSignatures[j]; - } - return object; - }; - - /** - * Converts this DotnetSettings to JSON. - * @function toJSON - * @memberof google.api.DotnetSettings - * @instance - * @returns {Object.} JSON object - */ - DotnetSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DotnetSettings - * @function getTypeUrl - * @memberof google.api.DotnetSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DotnetSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.DotnetSettings"; - }; - - return DotnetSettings; - })(); - - api.RubySettings = (function() { - - /** - * Properties of a RubySettings. - * @memberof google.api - * @interface IRubySettings - * @property {google.api.ICommonLanguageSettings|null} [common] RubySettings common - */ - - /** - * Constructs a new RubySettings. - * @memberof google.api - * @classdesc Represents a RubySettings. - * @implements IRubySettings - * @constructor - * @param {google.api.IRubySettings=} [properties] Properties to set - */ - function RubySettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RubySettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.RubySettings - * @instance - */ - RubySettings.prototype.common = null; - - /** - * Creates a new RubySettings instance using the specified properties. - * @function create - * @memberof google.api.RubySettings - * @static - * @param {google.api.IRubySettings=} [properties] Properties to set - * @returns {google.api.RubySettings} RubySettings instance - */ - RubySettings.create = function create(properties) { - return new RubySettings(properties); - }; - - /** - * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. - * @function encode - * @memberof google.api.RubySettings - * @static - * @param {google.api.IRubySettings} message RubySettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RubySettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.RubySettings - * @static - * @param {google.api.IRubySettings} message RubySettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RubySettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RubySettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.RubySettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.RubySettings} RubySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RubySettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.RubySettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RubySettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.RubySettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.RubySettings} RubySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RubySettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RubySettings message. - * @function verify - * @memberof google.api.RubySettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RubySettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.RubySettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.RubySettings} RubySettings - */ - RubySettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.RubySettings) - return object; - var message = new $root.google.api.RubySettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.RubySettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a RubySettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.RubySettings - * @static - * @param {google.api.RubySettings} message RubySettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RubySettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this RubySettings to JSON. - * @function toJSON - * @memberof google.api.RubySettings - * @instance - * @returns {Object.} JSON object - */ - RubySettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RubySettings - * @function getTypeUrl - * @memberof google.api.RubySettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RubySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.RubySettings"; - }; - - return RubySettings; - })(); - - api.GoSettings = (function() { - - /** - * Properties of a GoSettings. - * @memberof google.api - * @interface IGoSettings - * @property {google.api.ICommonLanguageSettings|null} [common] GoSettings common - */ - - /** - * Constructs a new GoSettings. - * @memberof google.api - * @classdesc Represents a GoSettings. - * @implements IGoSettings - * @constructor - * @param {google.api.IGoSettings=} [properties] Properties to set - */ - function GoSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GoSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.GoSettings - * @instance - */ - GoSettings.prototype.common = null; - - /** - * Creates a new GoSettings instance using the specified properties. - * @function create - * @memberof google.api.GoSettings - * @static - * @param {google.api.IGoSettings=} [properties] Properties to set - * @returns {google.api.GoSettings} GoSettings instance - */ - GoSettings.create = function create(properties) { - return new GoSettings(properties); - }; - - /** - * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. - * @function encode - * @memberof google.api.GoSettings - * @static - * @param {google.api.IGoSettings} message GoSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GoSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.GoSettings - * @static - * @param {google.api.IGoSettings} message GoSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GoSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GoSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.GoSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.GoSettings} GoSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GoSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.GoSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GoSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.GoSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.GoSettings} GoSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GoSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GoSettings message. - * @function verify - * @memberof google.api.GoSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GoSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.GoSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.GoSettings} GoSettings - */ - GoSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.GoSettings) - return object; - var message = new $root.google.api.GoSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.GoSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a GoSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.GoSettings - * @static - * @param {google.api.GoSettings} message GoSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GoSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this GoSettings to JSON. - * @function toJSON - * @memberof google.api.GoSettings - * @instance - * @returns {Object.} JSON object - */ - GoSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GoSettings - * @function getTypeUrl - * @memberof google.api.GoSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GoSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.GoSettings"; - }; - - return GoSettings; - })(); - - api.MethodSettings = (function() { - - /** - * Properties of a MethodSettings. - * @memberof google.api - * @interface IMethodSettings - * @property {string|null} [selector] MethodSettings selector - * @property {google.api.MethodSettings.ILongRunning|null} [longRunning] MethodSettings longRunning - * @property {Array.|null} [autoPopulatedFields] MethodSettings autoPopulatedFields - */ - - /** - * Constructs a new MethodSettings. - * @memberof google.api - * @classdesc Represents a MethodSettings. - * @implements IMethodSettings - * @constructor - * @param {google.api.IMethodSettings=} [properties] Properties to set - */ - function MethodSettings(properties) { - this.autoPopulatedFields = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MethodSettings selector. - * @member {string} selector - * @memberof google.api.MethodSettings - * @instance - */ - MethodSettings.prototype.selector = ""; - - /** - * MethodSettings longRunning. - * @member {google.api.MethodSettings.ILongRunning|null|undefined} longRunning - * @memberof google.api.MethodSettings - * @instance - */ - MethodSettings.prototype.longRunning = null; - - /** - * MethodSettings autoPopulatedFields. - * @member {Array.} autoPopulatedFields - * @memberof google.api.MethodSettings - * @instance - */ - MethodSettings.prototype.autoPopulatedFields = $util.emptyArray; - - /** - * Creates a new MethodSettings instance using the specified properties. - * @function create - * @memberof google.api.MethodSettings - * @static - * @param {google.api.IMethodSettings=} [properties] Properties to set - * @returns {google.api.MethodSettings} MethodSettings instance - */ - MethodSettings.create = function create(properties) { - return new MethodSettings(properties); - }; - - /** - * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. - * @function encode - * @memberof google.api.MethodSettings - * @static - * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); - if (message.longRunning != null && Object.hasOwnProperty.call(message, "longRunning")) - $root.google.api.MethodSettings.LongRunning.encode(message.longRunning, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.autoPopulatedFields != null && message.autoPopulatedFields.length) - for (var i = 0; i < message.autoPopulatedFields.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.autoPopulatedFields[i]); - return writer; - }; - - /** - * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.MethodSettings - * @static - * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MethodSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.MethodSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.MethodSettings} MethodSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.selector = reader.string(); - break; - } - case 2: { - message.longRunning = $root.google.api.MethodSettings.LongRunning.decode(reader, reader.uint32()); - break; - } - case 3: { - if (!(message.autoPopulatedFields && message.autoPopulatedFields.length)) - message.autoPopulatedFields = []; - message.autoPopulatedFields.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MethodSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.MethodSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.MethodSettings} MethodSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MethodSettings message. - * @function verify - * @memberof google.api.MethodSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MethodSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.selector != null && message.hasOwnProperty("selector")) - if (!$util.isString(message.selector)) - return "selector: string expected"; - if (message.longRunning != null && message.hasOwnProperty("longRunning")) { - var error = $root.google.api.MethodSettings.LongRunning.verify(message.longRunning); - if (error) - return "longRunning." + error; - } - if (message.autoPopulatedFields != null && message.hasOwnProperty("autoPopulatedFields")) { - if (!Array.isArray(message.autoPopulatedFields)) - return "autoPopulatedFields: array expected"; - for (var i = 0; i < message.autoPopulatedFields.length; ++i) - if (!$util.isString(message.autoPopulatedFields[i])) - return "autoPopulatedFields: string[] expected"; - } - return null; - }; - - /** - * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.MethodSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.MethodSettings} MethodSettings - */ - MethodSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.MethodSettings) - return object; - var message = new $root.google.api.MethodSettings(); - if (object.selector != null) - message.selector = String(object.selector); - if (object.longRunning != null) { - if (typeof object.longRunning !== "object") - throw TypeError(".google.api.MethodSettings.longRunning: object expected"); - message.longRunning = $root.google.api.MethodSettings.LongRunning.fromObject(object.longRunning); - } - if (object.autoPopulatedFields) { - if (!Array.isArray(object.autoPopulatedFields)) - throw TypeError(".google.api.MethodSettings.autoPopulatedFields: array expected"); - message.autoPopulatedFields = []; - for (var i = 0; i < object.autoPopulatedFields.length; ++i) - message.autoPopulatedFields[i] = String(object.autoPopulatedFields[i]); - } - return message; - }; - - /** - * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.MethodSettings - * @static - * @param {google.api.MethodSettings} message MethodSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MethodSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.autoPopulatedFields = []; - if (options.defaults) { - object.selector = ""; - object.longRunning = null; - } - if (message.selector != null && message.hasOwnProperty("selector")) - object.selector = message.selector; - if (message.longRunning != null && message.hasOwnProperty("longRunning")) - object.longRunning = $root.google.api.MethodSettings.LongRunning.toObject(message.longRunning, options); - if (message.autoPopulatedFields && message.autoPopulatedFields.length) { - object.autoPopulatedFields = []; - for (var j = 0; j < message.autoPopulatedFields.length; ++j) - object.autoPopulatedFields[j] = message.autoPopulatedFields[j]; - } - return object; - }; - - /** - * Converts this MethodSettings to JSON. - * @function toJSON - * @memberof google.api.MethodSettings - * @instance - * @returns {Object.} JSON object - */ - MethodSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MethodSettings - * @function getTypeUrl - * @memberof google.api.MethodSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MethodSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.MethodSettings"; - }; - - MethodSettings.LongRunning = (function() { - - /** - * Properties of a LongRunning. - * @memberof google.api.MethodSettings - * @interface ILongRunning - * @property {google.protobuf.IDuration|null} [initialPollDelay] LongRunning initialPollDelay - * @property {number|null} [pollDelayMultiplier] LongRunning pollDelayMultiplier - * @property {google.protobuf.IDuration|null} [maxPollDelay] LongRunning maxPollDelay - * @property {google.protobuf.IDuration|null} [totalPollTimeout] LongRunning totalPollTimeout - */ - - /** - * Constructs a new LongRunning. - * @memberof google.api.MethodSettings - * @classdesc Represents a LongRunning. - * @implements ILongRunning - * @constructor - * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set - */ - function LongRunning(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * LongRunning initialPollDelay. - * @member {google.protobuf.IDuration|null|undefined} initialPollDelay - * @memberof google.api.MethodSettings.LongRunning - * @instance - */ - LongRunning.prototype.initialPollDelay = null; - - /** - * LongRunning pollDelayMultiplier. - * @member {number} pollDelayMultiplier - * @memberof google.api.MethodSettings.LongRunning - * @instance - */ - LongRunning.prototype.pollDelayMultiplier = 0; - - /** - * LongRunning maxPollDelay. - * @member {google.protobuf.IDuration|null|undefined} maxPollDelay - * @memberof google.api.MethodSettings.LongRunning - * @instance - */ - LongRunning.prototype.maxPollDelay = null; - - /** - * LongRunning totalPollTimeout. - * @member {google.protobuf.IDuration|null|undefined} totalPollTimeout - * @memberof google.api.MethodSettings.LongRunning - * @instance - */ - LongRunning.prototype.totalPollTimeout = null; - - /** - * Creates a new LongRunning instance using the specified properties. - * @function create - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set - * @returns {google.api.MethodSettings.LongRunning} LongRunning instance - */ - LongRunning.create = function create(properties) { - return new LongRunning(properties); - }; - - /** - * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. - * @function encode - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LongRunning.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.initialPollDelay != null && Object.hasOwnProperty.call(message, "initialPollDelay")) - $root.google.protobuf.Duration.encode(message.initialPollDelay, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.pollDelayMultiplier != null && Object.hasOwnProperty.call(message, "pollDelayMultiplier")) - writer.uint32(/* id 2, wireType 5 =*/21).float(message.pollDelayMultiplier); - if (message.maxPollDelay != null && Object.hasOwnProperty.call(message, "maxPollDelay")) - $root.google.protobuf.Duration.encode(message.maxPollDelay, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.totalPollTimeout != null && Object.hasOwnProperty.call(message, "totalPollTimeout")) - $root.google.protobuf.Duration.encode(message.totalPollTimeout, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LongRunning.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a LongRunning message from the specified reader or buffer. - * @function decode - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.MethodSettings.LongRunning} LongRunning - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LongRunning.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings.LongRunning(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.initialPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 2: { - message.pollDelayMultiplier = reader.float(); - break; - } - case 3: { - message.maxPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 4: { - message.totalPollTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a LongRunning message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.MethodSettings.LongRunning} LongRunning - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LongRunning.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a LongRunning message. - * @function verify - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LongRunning.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) { - var error = $root.google.protobuf.Duration.verify(message.initialPollDelay); - if (error) - return "initialPollDelay." + error; - } - if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) - if (typeof message.pollDelayMultiplier !== "number") - return "pollDelayMultiplier: number expected"; - if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) { - var error = $root.google.protobuf.Duration.verify(message.maxPollDelay); - if (error) - return "maxPollDelay." + error; - } - if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) { - var error = $root.google.protobuf.Duration.verify(message.totalPollTimeout); - if (error) - return "totalPollTimeout." + error; - } - return null; - }; - - /** - * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {Object.} object Plain object - * @returns {google.api.MethodSettings.LongRunning} LongRunning - */ - LongRunning.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.MethodSettings.LongRunning) - return object; - var message = new $root.google.api.MethodSettings.LongRunning(); - if (object.initialPollDelay != null) { - if (typeof object.initialPollDelay !== "object") - throw TypeError(".google.api.MethodSettings.LongRunning.initialPollDelay: object expected"); - message.initialPollDelay = $root.google.protobuf.Duration.fromObject(object.initialPollDelay); - } - if (object.pollDelayMultiplier != null) - message.pollDelayMultiplier = Number(object.pollDelayMultiplier); - if (object.maxPollDelay != null) { - if (typeof object.maxPollDelay !== "object") - throw TypeError(".google.api.MethodSettings.LongRunning.maxPollDelay: object expected"); - message.maxPollDelay = $root.google.protobuf.Duration.fromObject(object.maxPollDelay); - } - if (object.totalPollTimeout != null) { - if (typeof object.totalPollTimeout !== "object") - throw TypeError(".google.api.MethodSettings.LongRunning.totalPollTimeout: object expected"); - message.totalPollTimeout = $root.google.protobuf.Duration.fromObject(object.totalPollTimeout); - } - return message; - }; - - /** - * Creates a plain object from a LongRunning message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {google.api.MethodSettings.LongRunning} message LongRunning - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LongRunning.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.initialPollDelay = null; - object.pollDelayMultiplier = 0; - object.maxPollDelay = null; - object.totalPollTimeout = null; - } - if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) - object.initialPollDelay = $root.google.protobuf.Duration.toObject(message.initialPollDelay, options); - if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) - object.pollDelayMultiplier = options.json && !isFinite(message.pollDelayMultiplier) ? String(message.pollDelayMultiplier) : message.pollDelayMultiplier; - if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) - object.maxPollDelay = $root.google.protobuf.Duration.toObject(message.maxPollDelay, options); - if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) - object.totalPollTimeout = $root.google.protobuf.Duration.toObject(message.totalPollTimeout, options); - return object; - }; - - /** - * Converts this LongRunning to JSON. - * @function toJSON - * @memberof google.api.MethodSettings.LongRunning - * @instance - * @returns {Object.} JSON object - */ - LongRunning.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for LongRunning - * @function getTypeUrl - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - LongRunning.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.MethodSettings.LongRunning"; - }; - - return LongRunning; - })(); - - return MethodSettings; - })(); - - /** - * ClientLibraryOrganization enum. - * @name google.api.ClientLibraryOrganization - * @enum {number} - * @property {number} CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED=0 CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED value - * @property {number} CLOUD=1 CLOUD value - * @property {number} ADS=2 ADS value - * @property {number} PHOTOS=3 PHOTOS value - * @property {number} STREET_VIEW=4 STREET_VIEW value - * @property {number} SHOPPING=5 SHOPPING value - * @property {number} GEO=6 GEO value - * @property {number} GENERATIVE_AI=7 GENERATIVE_AI value - */ - api.ClientLibraryOrganization = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED"] = 0; - values[valuesById[1] = "CLOUD"] = 1; - values[valuesById[2] = "ADS"] = 2; - values[valuesById[3] = "PHOTOS"] = 3; - values[valuesById[4] = "STREET_VIEW"] = 4; - values[valuesById[5] = "SHOPPING"] = 5; - values[valuesById[6] = "GEO"] = 6; - values[valuesById[7] = "GENERATIVE_AI"] = 7; - return values; - })(); - - /** - * ClientLibraryDestination enum. - * @name google.api.ClientLibraryDestination - * @enum {number} - * @property {number} CLIENT_LIBRARY_DESTINATION_UNSPECIFIED=0 CLIENT_LIBRARY_DESTINATION_UNSPECIFIED value - * @property {number} GITHUB=10 GITHUB value - * @property {number} PACKAGE_MANAGER=20 PACKAGE_MANAGER value - */ - api.ClientLibraryDestination = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED"] = 0; - values[valuesById[10] = "GITHUB"] = 10; - values[valuesById[20] = "PACKAGE_MANAGER"] = 20; - return values; - })(); - - /** - * LaunchStage enum. - * @name google.api.LaunchStage - * @enum {number} - * @property {number} LAUNCH_STAGE_UNSPECIFIED=0 LAUNCH_STAGE_UNSPECIFIED value - * @property {number} UNIMPLEMENTED=6 UNIMPLEMENTED value - * @property {number} PRELAUNCH=7 PRELAUNCH value - * @property {number} EARLY_ACCESS=1 EARLY_ACCESS value - * @property {number} ALPHA=2 ALPHA value - * @property {number} BETA=3 BETA value - * @property {number} GA=4 GA value - * @property {number} DEPRECATED=5 DEPRECATED value - */ - api.LaunchStage = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "LAUNCH_STAGE_UNSPECIFIED"] = 0; - values[valuesById[6] = "UNIMPLEMENTED"] = 6; - values[valuesById[7] = "PRELAUNCH"] = 7; - values[valuesById[1] = "EARLY_ACCESS"] = 1; - values[valuesById[2] = "ALPHA"] = 2; - values[valuesById[3] = "BETA"] = 3; - values[valuesById[4] = "GA"] = 4; - values[valuesById[5] = "DEPRECATED"] = 5; - return values; - })(); - - return api; - })(); - - google.protobuf = (function() { - - /** - * Namespace protobuf. - * @memberof google - * @namespace - */ - var protobuf = {}; - - protobuf.FileDescriptorSet = (function() { - - /** - * Properties of a FileDescriptorSet. - * @memberof google.protobuf - * @interface IFileDescriptorSet - * @property {Array.|null} [file] FileDescriptorSet file - */ - - /** - * Constructs a new FileDescriptorSet. - * @memberof google.protobuf - * @classdesc Represents a FileDescriptorSet. - * @implements IFileDescriptorSet - * @constructor - * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set - */ - function FileDescriptorSet(properties) { - this.file = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FileDescriptorSet file. - * @member {Array.} file - * @memberof google.protobuf.FileDescriptorSet - * @instance - */ - FileDescriptorSet.prototype.file = $util.emptyArray; - - /** - * Creates a new FileDescriptorSet instance using the specified properties. - * @function create - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance - */ - FileDescriptorSet.create = function create(properties) { - return new FileDescriptorSet(properties); - }; - - /** - * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorSet.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.file != null && message.file.length) - for (var i = 0; i < message.file.length; ++i) - $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FileDescriptorSet message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorSet.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.file && message.file.length)) - message.file = []; - message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FileDescriptorSet message. - * @function verify - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FileDescriptorSet.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.file != null && message.hasOwnProperty("file")) { - if (!Array.isArray(message.file)) - return "file: array expected"; - for (var i = 0; i < message.file.length; ++i) { - var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]); - if (error) - return "file." + error; - } - } - return null; - }; - - /** - * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet - */ - FileDescriptorSet.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FileDescriptorSet) - return object; - var message = new $root.google.protobuf.FileDescriptorSet(); - if (object.file) { - if (!Array.isArray(object.file)) - throw TypeError(".google.protobuf.FileDescriptorSet.file: array expected"); - message.file = []; - for (var i = 0; i < object.file.length; ++i) { - if (typeof object.file[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected"); - message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FileDescriptorSet.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.file = []; - if (message.file && message.file.length) { - object.file = []; - for (var j = 0; j < message.file.length; ++j) - object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options); - } - return object; - }; - - /** - * Converts this FileDescriptorSet to JSON. - * @function toJSON - * @memberof google.protobuf.FileDescriptorSet - * @instance - * @returns {Object.} JSON object - */ - FileDescriptorSet.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FileDescriptorSet - * @function getTypeUrl - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FileDescriptorSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FileDescriptorSet"; - }; - - return FileDescriptorSet; - })(); - - /** - * Edition enum. - * @name google.protobuf.Edition - * @enum {number} - * @property {number} EDITION_UNKNOWN=0 EDITION_UNKNOWN value - * @property {number} EDITION_PROTO2=998 EDITION_PROTO2 value - * @property {number} EDITION_PROTO3=999 EDITION_PROTO3 value - * @property {number} EDITION_2023=1000 EDITION_2023 value - * @property {number} EDITION_2024=1001 EDITION_2024 value - * @property {number} EDITION_1_TEST_ONLY=1 EDITION_1_TEST_ONLY value - * @property {number} EDITION_2_TEST_ONLY=2 EDITION_2_TEST_ONLY value - * @property {number} EDITION_99997_TEST_ONLY=99997 EDITION_99997_TEST_ONLY value - * @property {number} EDITION_99998_TEST_ONLY=99998 EDITION_99998_TEST_ONLY value - * @property {number} EDITION_99999_TEST_ONLY=99999 EDITION_99999_TEST_ONLY value - * @property {number} EDITION_MAX=2147483647 EDITION_MAX value - */ - protobuf.Edition = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "EDITION_UNKNOWN"] = 0; - values[valuesById[998] = "EDITION_PROTO2"] = 998; - values[valuesById[999] = "EDITION_PROTO3"] = 999; - values[valuesById[1000] = "EDITION_2023"] = 1000; - values[valuesById[1001] = "EDITION_2024"] = 1001; - values[valuesById[1] = "EDITION_1_TEST_ONLY"] = 1; - values[valuesById[2] = "EDITION_2_TEST_ONLY"] = 2; - values[valuesById[99997] = "EDITION_99997_TEST_ONLY"] = 99997; - values[valuesById[99998] = "EDITION_99998_TEST_ONLY"] = 99998; - values[valuesById[99999] = "EDITION_99999_TEST_ONLY"] = 99999; - values[valuesById[2147483647] = "EDITION_MAX"] = 2147483647; - return values; - })(); - - protobuf.FileDescriptorProto = (function() { - - /** - * Properties of a FileDescriptorProto. - * @memberof google.protobuf - * @interface IFileDescriptorProto - * @property {string|null} [name] FileDescriptorProto name - * @property {string|null} ["package"] FileDescriptorProto package - * @property {Array.|null} [dependency] FileDescriptorProto dependency - * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency - * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency - * @property {Array.|null} [messageType] FileDescriptorProto messageType - * @property {Array.|null} [enumType] FileDescriptorProto enumType - * @property {Array.|null} [service] FileDescriptorProto service - * @property {Array.|null} [extension] FileDescriptorProto extension - * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options - * @property {google.protobuf.ISourceCodeInfo|null} [sourceCodeInfo] FileDescriptorProto sourceCodeInfo - * @property {string|null} [syntax] FileDescriptorProto syntax - * @property {google.protobuf.Edition|null} [edition] FileDescriptorProto edition - */ - - /** - * Constructs a new FileDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a FileDescriptorProto. - * @implements IFileDescriptorProto - * @constructor - * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set - */ - function FileDescriptorProto(properties) { - this.dependency = []; - this.publicDependency = []; - this.weakDependency = []; - this.messageType = []; - this.enumType = []; - this.service = []; - this.extension = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FileDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.name = ""; - - /** - * FileDescriptorProto package. - * @member {string} package - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype["package"] = ""; - - /** - * FileDescriptorProto dependency. - * @member {Array.} dependency - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.dependency = $util.emptyArray; - - /** - * FileDescriptorProto publicDependency. - * @member {Array.} publicDependency - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.publicDependency = $util.emptyArray; - - /** - * FileDescriptorProto weakDependency. - * @member {Array.} weakDependency - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.weakDependency = $util.emptyArray; - - /** - * FileDescriptorProto messageType. - * @member {Array.} messageType - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.messageType = $util.emptyArray; - - /** - * FileDescriptorProto enumType. - * @member {Array.} enumType - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.enumType = $util.emptyArray; - - /** - * FileDescriptorProto service. - * @member {Array.} service - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.service = $util.emptyArray; - - /** - * FileDescriptorProto extension. - * @member {Array.} extension - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.extension = $util.emptyArray; - - /** - * FileDescriptorProto options. - * @member {google.protobuf.IFileOptions|null|undefined} options - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.options = null; - - /** - * FileDescriptorProto sourceCodeInfo. - * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.sourceCodeInfo = null; - - /** - * FileDescriptorProto syntax. - * @member {string} syntax - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.syntax = ""; - - /** - * FileDescriptorProto edition. - * @member {google.protobuf.Edition} edition - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.edition = 0; - - /** - * Creates a new FileDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance - */ - FileDescriptorProto.create = function create(properties) { - return new FileDescriptorProto(properties); - }; - - /** - * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); - if (message.dependency != null && message.dependency.length) - for (var i = 0; i < message.dependency.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); - if (message.messageType != null && message.messageType.length) - for (var i = 0; i < message.messageType.length; ++i) - $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.enumType != null && message.enumType.length) - for (var i = 0; i < message.enumType.length; ++i) - $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.service != null && message.service.length) - for (var i = 0; i < message.service.length; ++i) - $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.extension != null && message.extension.length) - for (var i = 0; i < message.extension.length; ++i) - $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo")) - $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.publicDependency != null && message.publicDependency.length) - for (var i = 0; i < message.publicDependency.length; ++i) - writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]); - if (message.weakDependency != null && message.weakDependency.length) - for (var i = 0; i < message.weakDependency.length; ++i) - writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); - if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); - if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) - writer.uint32(/* id 14, wireType 0 =*/112).int32(message.edition); - return writer; - }; - - /** - * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorProto.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message["package"] = reader.string(); - break; - } - case 3: { - if (!(message.dependency && message.dependency.length)) - message.dependency = []; - message.dependency.push(reader.string()); - break; - } - case 10: { - if (!(message.publicDependency && message.publicDependency.length)) - message.publicDependency = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.publicDependency.push(reader.int32()); - } else - message.publicDependency.push(reader.int32()); - break; - } - case 11: { - if (!(message.weakDependency && message.weakDependency.length)) - message.weakDependency = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.weakDependency.push(reader.int32()); - } else - message.weakDependency.push(reader.int32()); - break; - } - case 4: { - if (!(message.messageType && message.messageType.length)) - message.messageType = []; - message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); - break; - } - case 5: { - if (!(message.enumType && message.enumType.length)) - message.enumType = []; - message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 6: { - if (!(message.service && message.service.length)) - message.service = []; - message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 7: { - if (!(message.extension && message.extension.length)) - message.extension = []; - message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 8: { - message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32()); - break; - } - case 9: { - message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32()); - break; - } - case 12: { - message.syntax = reader.string(); - break; - } - case 14: { - message.edition = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FileDescriptorProto message. - * @function verify - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FileDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message["package"] != null && message.hasOwnProperty("package")) - if (!$util.isString(message["package"])) - return "package: string expected"; - if (message.dependency != null && message.hasOwnProperty("dependency")) { - if (!Array.isArray(message.dependency)) - return "dependency: array expected"; - for (var i = 0; i < message.dependency.length; ++i) - if (!$util.isString(message.dependency[i])) - return "dependency: string[] expected"; - } - if (message.publicDependency != null && message.hasOwnProperty("publicDependency")) { - if (!Array.isArray(message.publicDependency)) - return "publicDependency: array expected"; - for (var i = 0; i < message.publicDependency.length; ++i) - if (!$util.isInteger(message.publicDependency[i])) - return "publicDependency: integer[] expected"; - } - if (message.weakDependency != null && message.hasOwnProperty("weakDependency")) { - if (!Array.isArray(message.weakDependency)) - return "weakDependency: array expected"; - for (var i = 0; i < message.weakDependency.length; ++i) - if (!$util.isInteger(message.weakDependency[i])) - return "weakDependency: integer[] expected"; - } - if (message.messageType != null && message.hasOwnProperty("messageType")) { - if (!Array.isArray(message.messageType)) - return "messageType: array expected"; - for (var i = 0; i < message.messageType.length; ++i) { - var error = $root.google.protobuf.DescriptorProto.verify(message.messageType[i]); - if (error) - return "messageType." + error; - } - } - if (message.enumType != null && message.hasOwnProperty("enumType")) { - if (!Array.isArray(message.enumType)) - return "enumType: array expected"; - for (var i = 0; i < message.enumType.length; ++i) { - var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); - if (error) - return "enumType." + error; - } - } - if (message.service != null && message.hasOwnProperty("service")) { - if (!Array.isArray(message.service)) - return "service: array expected"; - for (var i = 0; i < message.service.length; ++i) { - var error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i]); - if (error) - return "service." + error; - } - } - if (message.extension != null && message.hasOwnProperty("extension")) { - if (!Array.isArray(message.extension)) - return "extension: array expected"; - for (var i = 0; i < message.extension.length; ++i) { - var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); - if (error) - return "extension." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.FileOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) { - var error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo); - if (error) - return "sourceCodeInfo." + error; - } - if (message.syntax != null && message.hasOwnProperty("syntax")) - if (!$util.isString(message.syntax)) - return "syntax: string expected"; - if (message.edition != null && message.hasOwnProperty("edition")) - switch (message.edition) { - default: - return "edition: enum value expected"; - case 0: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - return null; - }; - - /** - * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto - */ - FileDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FileDescriptorProto) - return object; - var message = new $root.google.protobuf.FileDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object["package"] != null) - message["package"] = String(object["package"]); - if (object.dependency) { - if (!Array.isArray(object.dependency)) - throw TypeError(".google.protobuf.FileDescriptorProto.dependency: array expected"); - message.dependency = []; - for (var i = 0; i < object.dependency.length; ++i) - message.dependency[i] = String(object.dependency[i]); - } - if (object.publicDependency) { - if (!Array.isArray(object.publicDependency)) - throw TypeError(".google.protobuf.FileDescriptorProto.publicDependency: array expected"); - message.publicDependency = []; - for (var i = 0; i < object.publicDependency.length; ++i) - message.publicDependency[i] = object.publicDependency[i] | 0; - } - if (object.weakDependency) { - if (!Array.isArray(object.weakDependency)) - throw TypeError(".google.protobuf.FileDescriptorProto.weakDependency: array expected"); - message.weakDependency = []; - for (var i = 0; i < object.weakDependency.length; ++i) - message.weakDependency[i] = object.weakDependency[i] | 0; - } - if (object.messageType) { - if (!Array.isArray(object.messageType)) - throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); - message.messageType = []; - for (var i = 0; i < object.messageType.length; ++i) { - if (typeof object.messageType[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.messageType: object expected"); - message.messageType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.messageType[i]); - } - } - if (object.enumType) { - if (!Array.isArray(object.enumType)) - throw TypeError(".google.protobuf.FileDescriptorProto.enumType: array expected"); - message.enumType = []; - for (var i = 0; i < object.enumType.length; ++i) { - if (typeof object.enumType[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.enumType: object expected"); - message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); - } - } - if (object.service) { - if (!Array.isArray(object.service)) - throw TypeError(".google.protobuf.FileDescriptorProto.service: array expected"); - message.service = []; - for (var i = 0; i < object.service.length; ++i) { - if (typeof object.service[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.service: object expected"); - message.service[i] = $root.google.protobuf.ServiceDescriptorProto.fromObject(object.service[i]); - } - } - if (object.extension) { - if (!Array.isArray(object.extension)) - throw TypeError(".google.protobuf.FileDescriptorProto.extension: array expected"); - message.extension = []; - for (var i = 0; i < object.extension.length; ++i) { - if (typeof object.extension[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.extension: object expected"); - message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.FileOptions.fromObject(object.options); - } - if (object.sourceCodeInfo != null) { - if (typeof object.sourceCodeInfo !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.sourceCodeInfo: object expected"); - message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.fromObject(object.sourceCodeInfo); - } - if (object.syntax != null) - message.syntax = String(object.syntax); - switch (object.edition) { - default: - if (typeof object.edition === "number") { - message.edition = object.edition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.edition = 0; - break; - case "EDITION_PROTO2": - case 998: - message.edition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.edition = 999; - break; - case "EDITION_2023": - case 1000: - message.edition = 1000; - break; - case "EDITION_2024": - case 1001: - message.edition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.edition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.edition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.edition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.edition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.edition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.edition = 2147483647; - break; - } - return message; - }; - - /** - * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FileDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.dependency = []; - object.messageType = []; - object.enumType = []; - object.service = []; - object.extension = []; - object.publicDependency = []; - object.weakDependency = []; - } - if (options.defaults) { - object.name = ""; - object["package"] = ""; - object.options = null; - object.sourceCodeInfo = null; - object.syntax = ""; - object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message["package"] != null && message.hasOwnProperty("package")) - object["package"] = message["package"]; - if (message.dependency && message.dependency.length) { - object.dependency = []; - for (var j = 0; j < message.dependency.length; ++j) - object.dependency[j] = message.dependency[j]; - } - if (message.messageType && message.messageType.length) { - object.messageType = []; - for (var j = 0; j < message.messageType.length; ++j) - object.messageType[j] = $root.google.protobuf.DescriptorProto.toObject(message.messageType[j], options); - } - if (message.enumType && message.enumType.length) { - object.enumType = []; - for (var j = 0; j < message.enumType.length; ++j) - object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); - } - if (message.service && message.service.length) { - object.service = []; - for (var j = 0; j < message.service.length; ++j) - object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options); - } - if (message.extension && message.extension.length) { - object.extension = []; - for (var j = 0; j < message.extension.length; ++j) - object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.FileOptions.toObject(message.options, options); - if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) - object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options); - if (message.publicDependency && message.publicDependency.length) { - object.publicDependency = []; - for (var j = 0; j < message.publicDependency.length; ++j) - object.publicDependency[j] = message.publicDependency[j]; - } - if (message.weakDependency && message.weakDependency.length) { - object.weakDependency = []; - for (var j = 0; j < message.weakDependency.length; ++j) - object.weakDependency[j] = message.weakDependency[j]; - } - if (message.syntax != null && message.hasOwnProperty("syntax")) - object.syntax = message.syntax; - if (message.edition != null && message.hasOwnProperty("edition")) - object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; - return object; - }; - - /** - * Converts this FileDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.FileDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - FileDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FileDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FileDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FileDescriptorProto"; - }; - - return FileDescriptorProto; - })(); - - protobuf.DescriptorProto = (function() { - - /** - * Properties of a DescriptorProto. - * @memberof google.protobuf - * @interface IDescriptorProto - * @property {string|null} [name] DescriptorProto name - * @property {Array.|null} [field] DescriptorProto field - * @property {Array.|null} [extension] DescriptorProto extension - * @property {Array.|null} [nestedType] DescriptorProto nestedType - * @property {Array.|null} [enumType] DescriptorProto enumType - * @property {Array.|null} [extensionRange] DescriptorProto extensionRange - * @property {Array.|null} [oneofDecl] DescriptorProto oneofDecl - * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options - * @property {Array.|null} [reservedRange] DescriptorProto reservedRange - * @property {Array.|null} [reservedName] DescriptorProto reservedName - */ - - /** - * Constructs a new DescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a DescriptorProto. - * @implements IDescriptorProto - * @constructor - * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set - */ - function DescriptorProto(properties) { - this.field = []; - this.extension = []; - this.nestedType = []; - this.enumType = []; - this.extensionRange = []; - this.oneofDecl = []; - this.reservedRange = []; - this.reservedName = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DescriptorProto name. - * @member {string} name - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.name = ""; - - /** - * DescriptorProto field. - * @member {Array.} field - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.field = $util.emptyArray; - - /** - * DescriptorProto extension. - * @member {Array.} extension - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.extension = $util.emptyArray; - - /** - * DescriptorProto nestedType. - * @member {Array.} nestedType - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.nestedType = $util.emptyArray; - - /** - * DescriptorProto enumType. - * @member {Array.} enumType - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.enumType = $util.emptyArray; - - /** - * DescriptorProto extensionRange. - * @member {Array.} extensionRange - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.extensionRange = $util.emptyArray; - - /** - * DescriptorProto oneofDecl. - * @member {Array.} oneofDecl - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.oneofDecl = $util.emptyArray; - - /** - * DescriptorProto options. - * @member {google.protobuf.IMessageOptions|null|undefined} options - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.options = null; - - /** - * DescriptorProto reservedRange. - * @member {Array.} reservedRange - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.reservedRange = $util.emptyArray; - - /** - * DescriptorProto reservedName. - * @member {Array.} reservedName - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.reservedName = $util.emptyArray; - - /** - * Creates a new DescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.DescriptorProto - * @static - * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.DescriptorProto} DescriptorProto instance - */ - DescriptorProto.create = function create(properties) { - return new DescriptorProto(properties); - }; - - /** - * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.DescriptorProto - * @static - * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.field != null && message.field.length) - for (var i = 0; i < message.field.length; ++i) - $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.nestedType != null && message.nestedType.length) - for (var i = 0; i < message.nestedType.length; ++i) - $root.google.protobuf.DescriptorProto.encode(message.nestedType[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.enumType != null && message.enumType.length) - for (var i = 0; i < message.enumType.length; ++i) - $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.extensionRange != null && message.extensionRange.length) - for (var i = 0; i < message.extensionRange.length; ++i) - $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extensionRange[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.extension != null && message.extension.length) - for (var i = 0; i < message.extension.length; ++i) - $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.oneofDecl != null && message.oneofDecl.length) - for (var i = 0; i < message.oneofDecl.length; ++i) - $root.google.protobuf.OneofDescriptorProto.encode(message.oneofDecl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.reservedRange != null && message.reservedRange.length) - for (var i = 0; i < message.reservedRange.length; ++i) - $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.reservedName != null && message.reservedName.length) - for (var i = 0; i < message.reservedName.length; ++i) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); - return writer; - }; - - /** - * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.DescriptorProto - * @static - * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.DescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DescriptorProto} DescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DescriptorProto.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - if (!(message.field && message.field.length)) - message.field = []; - message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 6: { - if (!(message.extension && message.extension.length)) - message.extension = []; - message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 3: { - if (!(message.nestedType && message.nestedType.length)) - message.nestedType = []; - message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); - break; - } - case 4: { - if (!(message.enumType && message.enumType.length)) - message.enumType = []; - message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 5: { - if (!(message.extensionRange && message.extensionRange.length)) - message.extensionRange = []; - message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32())); - break; - } - case 8: { - if (!(message.oneofDecl && message.oneofDecl.length)) - message.oneofDecl = []; - message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 7: { - message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32()); - break; - } - case 9: { - if (!(message.reservedRange && message.reservedRange.length)) - message.reservedRange = []; - message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32())); - break; - } - case 10: { - if (!(message.reservedName && message.reservedName.length)) - message.reservedName = []; - message.reservedName.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.DescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DescriptorProto} DescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DescriptorProto message. - * @function verify - * @memberof google.protobuf.DescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.field != null && message.hasOwnProperty("field")) { - if (!Array.isArray(message.field)) - return "field: array expected"; - for (var i = 0; i < message.field.length; ++i) { - var error = $root.google.protobuf.FieldDescriptorProto.verify(message.field[i]); - if (error) - return "field." + error; - } - } - if (message.extension != null && message.hasOwnProperty("extension")) { - if (!Array.isArray(message.extension)) - return "extension: array expected"; - for (var i = 0; i < message.extension.length; ++i) { - var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); - if (error) - return "extension." + error; - } - } - if (message.nestedType != null && message.hasOwnProperty("nestedType")) { - if (!Array.isArray(message.nestedType)) - return "nestedType: array expected"; - for (var i = 0; i < message.nestedType.length; ++i) { - var error = $root.google.protobuf.DescriptorProto.verify(message.nestedType[i]); - if (error) - return "nestedType." + error; - } - } - if (message.enumType != null && message.hasOwnProperty("enumType")) { - if (!Array.isArray(message.enumType)) - return "enumType: array expected"; - for (var i = 0; i < message.enumType.length; ++i) { - var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); - if (error) - return "enumType." + error; - } - } - if (message.extensionRange != null && message.hasOwnProperty("extensionRange")) { - if (!Array.isArray(message.extensionRange)) - return "extensionRange: array expected"; - for (var i = 0; i < message.extensionRange.length; ++i) { - var error = $root.google.protobuf.DescriptorProto.ExtensionRange.verify(message.extensionRange[i]); - if (error) - return "extensionRange." + error; - } - } - if (message.oneofDecl != null && message.hasOwnProperty("oneofDecl")) { - if (!Array.isArray(message.oneofDecl)) - return "oneofDecl: array expected"; - for (var i = 0; i < message.oneofDecl.length; ++i) { - var error = $root.google.protobuf.OneofDescriptorProto.verify(message.oneofDecl[i]); - if (error) - return "oneofDecl." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.MessageOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { - if (!Array.isArray(message.reservedRange)) - return "reservedRange: array expected"; - for (var i = 0; i < message.reservedRange.length; ++i) { - var error = $root.google.protobuf.DescriptorProto.ReservedRange.verify(message.reservedRange[i]); - if (error) - return "reservedRange." + error; - } - } - if (message.reservedName != null && message.hasOwnProperty("reservedName")) { - if (!Array.isArray(message.reservedName)) - return "reservedName: array expected"; - for (var i = 0; i < message.reservedName.length; ++i) - if (!$util.isString(message.reservedName[i])) - return "reservedName: string[] expected"; - } - return null; - }; - - /** - * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.DescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.DescriptorProto} DescriptorProto - */ - DescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DescriptorProto) - return object; - var message = new $root.google.protobuf.DescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.field) { - if (!Array.isArray(object.field)) - throw TypeError(".google.protobuf.DescriptorProto.field: array expected"); - message.field = []; - for (var i = 0; i < object.field.length; ++i) { - if (typeof object.field[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.field: object expected"); - message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i]); - } - } - if (object.extension) { - if (!Array.isArray(object.extension)) - throw TypeError(".google.protobuf.DescriptorProto.extension: array expected"); - message.extension = []; - for (var i = 0; i < object.extension.length; ++i) { - if (typeof object.extension[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.extension: object expected"); - message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); - } - } - if (object.nestedType) { - if (!Array.isArray(object.nestedType)) - throw TypeError(".google.protobuf.DescriptorProto.nestedType: array expected"); - message.nestedType = []; - for (var i = 0; i < object.nestedType.length; ++i) { - if (typeof object.nestedType[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.nestedType: object expected"); - message.nestedType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nestedType[i]); - } - } - if (object.enumType) { - if (!Array.isArray(object.enumType)) - throw TypeError(".google.protobuf.DescriptorProto.enumType: array expected"); - message.enumType = []; - for (var i = 0; i < object.enumType.length; ++i) { - if (typeof object.enumType[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.enumType: object expected"); - message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); - } - } - if (object.extensionRange) { - if (!Array.isArray(object.extensionRange)) - throw TypeError(".google.protobuf.DescriptorProto.extensionRange: array expected"); - message.extensionRange = []; - for (var i = 0; i < object.extensionRange.length; ++i) { - if (typeof object.extensionRange[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.extensionRange: object expected"); - message.extensionRange[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extensionRange[i]); - } - } - if (object.oneofDecl) { - if (!Array.isArray(object.oneofDecl)) - throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: array expected"); - message.oneofDecl = []; - for (var i = 0; i < object.oneofDecl.length; ++i) { - if (typeof object.oneofDecl[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: object expected"); - message.oneofDecl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneofDecl[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.DescriptorProto.options: object expected"); - message.options = $root.google.protobuf.MessageOptions.fromObject(object.options); - } - if (object.reservedRange) { - if (!Array.isArray(object.reservedRange)) - throw TypeError(".google.protobuf.DescriptorProto.reservedRange: array expected"); - message.reservedRange = []; - for (var i = 0; i < object.reservedRange.length; ++i) { - if (typeof object.reservedRange[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.reservedRange: object expected"); - message.reservedRange[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reservedRange[i]); - } - } - if (object.reservedName) { - if (!Array.isArray(object.reservedName)) - throw TypeError(".google.protobuf.DescriptorProto.reservedName: array expected"); - message.reservedName = []; - for (var i = 0; i < object.reservedName.length; ++i) - message.reservedName[i] = String(object.reservedName[i]); - } - return message; - }; - - /** - * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.DescriptorProto - * @static - * @param {google.protobuf.DescriptorProto} message DescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.field = []; - object.nestedType = []; - object.enumType = []; - object.extensionRange = []; - object.extension = []; - object.oneofDecl = []; - object.reservedRange = []; - object.reservedName = []; - } - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.field && message.field.length) { - object.field = []; - for (var j = 0; j < message.field.length; ++j) - object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options); - } - if (message.nestedType && message.nestedType.length) { - object.nestedType = []; - for (var j = 0; j < message.nestedType.length; ++j) - object.nestedType[j] = $root.google.protobuf.DescriptorProto.toObject(message.nestedType[j], options); - } - if (message.enumType && message.enumType.length) { - object.enumType = []; - for (var j = 0; j < message.enumType.length; ++j) - object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); - } - if (message.extensionRange && message.extensionRange.length) { - object.extensionRange = []; - for (var j = 0; j < message.extensionRange.length; ++j) - object.extensionRange[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extensionRange[j], options); - } - if (message.extension && message.extension.length) { - object.extension = []; - for (var j = 0; j < message.extension.length; ++j) - object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options); - if (message.oneofDecl && message.oneofDecl.length) { - object.oneofDecl = []; - for (var j = 0; j < message.oneofDecl.length; ++j) - object.oneofDecl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneofDecl[j], options); - } - if (message.reservedRange && message.reservedRange.length) { - object.reservedRange = []; - for (var j = 0; j < message.reservedRange.length; ++j) - object.reservedRange[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reservedRange[j], options); - } - if (message.reservedName && message.reservedName.length) { - object.reservedName = []; - for (var j = 0; j < message.reservedName.length; ++j) - object.reservedName[j] = message.reservedName[j]; - } - return object; - }; - - /** - * Converts this DescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.DescriptorProto - * @instance - * @returns {Object.} JSON object - */ - DescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.DescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.DescriptorProto"; - }; - - DescriptorProto.ExtensionRange = (function() { - - /** - * Properties of an ExtensionRange. - * @memberof google.protobuf.DescriptorProto - * @interface IExtensionRange - * @property {number|null} [start] ExtensionRange start - * @property {number|null} [end] ExtensionRange end - * @property {google.protobuf.IExtensionRangeOptions|null} [options] ExtensionRange options - */ - - /** - * Constructs a new ExtensionRange. - * @memberof google.protobuf.DescriptorProto - * @classdesc Represents an ExtensionRange. - * @implements IExtensionRange - * @constructor - * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set - */ - function ExtensionRange(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExtensionRange start. - * @member {number} start - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - */ - ExtensionRange.prototype.start = 0; - - /** - * ExtensionRange end. - * @member {number} end - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - */ - ExtensionRange.prototype.end = 0; - - /** - * ExtensionRange options. - * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - */ - ExtensionRange.prototype.options = null; - - /** - * Creates a new ExtensionRange instance using the specified properties. - * @function create - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance - */ - ExtensionRange.create = function create(properties) { - return new ExtensionRange(properties); - }; - - /** - * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @function encode - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtensionRange.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.start != null && Object.hasOwnProperty.call(message, "start")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExtensionRange message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtensionRange.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.start = reader.int32(); - break; - } - case 2: { - message.end = reader.int32(); - break; - } - case 3: { - message.options = $root.google.protobuf.ExtensionRangeOptions.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtensionRange.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExtensionRange message. - * @function verify - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExtensionRange.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.start != null && message.hasOwnProperty("start")) - if (!$util.isInteger(message.start)) - return "start: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.ExtensionRangeOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange - */ - ExtensionRange.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange) - return object; - var message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); - if (object.start != null) - message.start = object.start | 0; - if (object.end != null) - message.end = object.end | 0; - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange.options: object expected"); - message.options = $root.google.protobuf.ExtensionRangeOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExtensionRange.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.start = 0; - object.end = 0; - object.options = null; - } - if (message.start != null && message.hasOwnProperty("start")) - object.start = message.start; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.ExtensionRangeOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this ExtensionRange to JSON. - * @function toJSON - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - * @returns {Object.} JSON object - */ - ExtensionRange.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExtensionRange - * @function getTypeUrl - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExtensionRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.DescriptorProto.ExtensionRange"; - }; - - return ExtensionRange; - })(); - - DescriptorProto.ReservedRange = (function() { - - /** - * Properties of a ReservedRange. - * @memberof google.protobuf.DescriptorProto - * @interface IReservedRange - * @property {number|null} [start] ReservedRange start - * @property {number|null} [end] ReservedRange end - */ - - /** - * Constructs a new ReservedRange. - * @memberof google.protobuf.DescriptorProto - * @classdesc Represents a ReservedRange. - * @implements IReservedRange - * @constructor - * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set - */ - function ReservedRange(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ReservedRange start. - * @member {number} start - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @instance - */ - ReservedRange.prototype.start = 0; - - /** - * ReservedRange end. - * @member {number} end - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @instance - */ - ReservedRange.prototype.end = 0; - - /** - * Creates a new ReservedRange instance using the specified properties. - * @function create - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance - */ - ReservedRange.create = function create(properties) { - return new ReservedRange(properties); - }; - - /** - * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @function encode - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReservedRange.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.start != null && Object.hasOwnProperty.call(message, "start")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); - return writer; - }; - - /** - * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ReservedRange message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReservedRange.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ReservedRange(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.start = reader.int32(); - break; - } - case 2: { - message.end = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ReservedRange message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReservedRange.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ReservedRange message. - * @function verify - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ReservedRange.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.start != null && message.hasOwnProperty("start")) - if (!$util.isInteger(message.start)) - return "start: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - return null; - }; - - /** - * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange - */ - ReservedRange.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange) - return object; - var message = new $root.google.protobuf.DescriptorProto.ReservedRange(); - if (object.start != null) - message.start = object.start | 0; - if (object.end != null) - message.end = object.end | 0; - return message; - }; - - /** - * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ReservedRange.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.start = 0; - object.end = 0; - } - if (message.start != null && message.hasOwnProperty("start")) - object.start = message.start; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - return object; - }; - - /** - * Converts this ReservedRange to JSON. - * @function toJSON - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @instance - * @returns {Object.} JSON object - */ - ReservedRange.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ReservedRange - * @function getTypeUrl - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.DescriptorProto.ReservedRange"; - }; - - return ReservedRange; - })(); - - return DescriptorProto; - })(); - - protobuf.ExtensionRangeOptions = (function() { - - /** - * Properties of an ExtensionRangeOptions. - * @memberof google.protobuf - * @interface IExtensionRangeOptions - * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption - * @property {Array.|null} [declaration] ExtensionRangeOptions declaration - * @property {google.protobuf.IFeatureSet|null} [features] ExtensionRangeOptions features - * @property {google.protobuf.ExtensionRangeOptions.VerificationState|null} [verification] ExtensionRangeOptions verification - */ - - /** - * Constructs a new ExtensionRangeOptions. - * @memberof google.protobuf - * @classdesc Represents an ExtensionRangeOptions. - * @implements IExtensionRangeOptions - * @constructor - * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set - */ - function ExtensionRangeOptions(properties) { - this.uninterpretedOption = []; - this.declaration = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExtensionRangeOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - */ - ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * ExtensionRangeOptions declaration. - * @member {Array.} declaration - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - */ - ExtensionRangeOptions.prototype.declaration = $util.emptyArray; - - /** - * ExtensionRangeOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - */ - ExtensionRangeOptions.prototype.features = null; - - /** - * ExtensionRangeOptions verification. - * @member {google.protobuf.ExtensionRangeOptions.VerificationState} verification - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - */ - ExtensionRangeOptions.prototype.verification = 1; - - /** - * Creates a new ExtensionRangeOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions instance - */ - ExtensionRangeOptions.create = function create(properties) { - return new ExtensionRangeOptions(properties); - }; - - /** - * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtensionRangeOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.declaration != null && message.declaration.length) - for (var i = 0; i < message.declaration.length; ++i) - $root.google.protobuf.ExtensionRangeOptions.Declaration.encode(message.declaration[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.verification != null && Object.hasOwnProperty.call(message, "verification")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.verification); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtensionRangeOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 2: { - if (!(message.declaration && message.declaration.length)) - message.declaration = []; - message.declaration.push($root.google.protobuf.ExtensionRangeOptions.Declaration.decode(reader, reader.uint32())); - break; - } - case 50: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 3: { - message.verification = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtensionRangeOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExtensionRangeOptions message. - * @function verify - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExtensionRangeOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message.declaration != null && message.hasOwnProperty("declaration")) { - if (!Array.isArray(message.declaration)) - return "declaration: array expected"; - for (var i = 0; i < message.declaration.length; ++i) { - var error = $root.google.protobuf.ExtensionRangeOptions.Declaration.verify(message.declaration[i]); - if (error) - return "declaration." + error; - } - } - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.verification != null && message.hasOwnProperty("verification")) - switch (message.verification) { - default: - return "verification: enum value expected"; - case 0: - case 1: - break; - } - return null; - }; - - /** - * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions - */ - ExtensionRangeOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ExtensionRangeOptions) - return object; - var message = new $root.google.protobuf.ExtensionRangeOptions(); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object.declaration) { - if (!Array.isArray(object.declaration)) - throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: array expected"); - message.declaration = []; - for (var i = 0; i < object.declaration.length; ++i) { - if (typeof object.declaration[i] !== "object") - throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: object expected"); - message.declaration[i] = $root.google.protobuf.ExtensionRangeOptions.Declaration.fromObject(object.declaration[i]); - } - } - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.ExtensionRangeOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - switch (object.verification) { - case "DECLARATION": - case 0: - message.verification = 0; - break; - default: - if (typeof object.verification === "number") { - message.verification = object.verification; - break; - } - break; - case "UNVERIFIED": - case 1: - message.verification = 1; - break; - } - return message; - }; - - /** - * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExtensionRangeOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.declaration = []; - object.uninterpretedOption = []; - } - if (options.defaults) { - object.verification = options.enums === String ? "UNVERIFIED" : 1; - object.features = null; - } - if (message.declaration && message.declaration.length) { - object.declaration = []; - for (var j = 0; j < message.declaration.length; ++j) - object.declaration[j] = $root.google.protobuf.ExtensionRangeOptions.Declaration.toObject(message.declaration[j], options); - } - if (message.verification != null && message.hasOwnProperty("verification")) - object.verification = options.enums === String ? $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] === undefined ? message.verification : $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] : message.verification; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; - - /** - * Converts this ExtensionRangeOptions to JSON. - * @function toJSON - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - * @returns {Object.} JSON object - */ - ExtensionRangeOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExtensionRangeOptions - * @function getTypeUrl - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExtensionRangeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions"; - }; - - ExtensionRangeOptions.Declaration = (function() { - - /** - * Properties of a Declaration. - * @memberof google.protobuf.ExtensionRangeOptions - * @interface IDeclaration - * @property {number|null} [number] Declaration number - * @property {string|null} [fullName] Declaration fullName - * @property {string|null} [type] Declaration type - * @property {boolean|null} [reserved] Declaration reserved - * @property {boolean|null} [repeated] Declaration repeated - */ - - /** - * Constructs a new Declaration. - * @memberof google.protobuf.ExtensionRangeOptions - * @classdesc Represents a Declaration. - * @implements IDeclaration - * @constructor - * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set - */ - function Declaration(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Declaration number. - * @member {number} number - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.number = 0; - - /** - * Declaration fullName. - * @member {string} fullName - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.fullName = ""; - - /** - * Declaration type. - * @member {string} type - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.type = ""; - - /** - * Declaration reserved. - * @member {boolean} reserved - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.reserved = false; - - /** - * Declaration repeated. - * @member {boolean} repeated - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.repeated = false; - - /** - * Creates a new Declaration instance using the specified properties. - * @function create - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set - * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration instance - */ - Declaration.create = function create(properties) { - return new Declaration(properties); - }; - - /** - * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Declaration.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.number != null && Object.hasOwnProperty.call(message, "number")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.number); - if (message.fullName != null && Object.hasOwnProperty.call(message, "fullName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.fullName); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.type); - if (message.reserved != null && Object.hasOwnProperty.call(message, "reserved")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.reserved); - if (message.repeated != null && Object.hasOwnProperty.call(message, "repeated")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.repeated); - return writer; - }; - - /** - * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Declaration.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Declaration message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Declaration.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.number = reader.int32(); - break; - } - case 2: { - message.fullName = reader.string(); - break; - } - case 3: { - message.type = reader.string(); - break; - } - case 5: { - message.reserved = reader.bool(); - break; - } - case 6: { - message.repeated = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Declaration message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Declaration.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Declaration message. - * @function verify - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Declaration.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.number != null && message.hasOwnProperty("number")) - if (!$util.isInteger(message.number)) - return "number: integer expected"; - if (message.fullName != null && message.hasOwnProperty("fullName")) - if (!$util.isString(message.fullName)) - return "fullName: string expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.reserved != null && message.hasOwnProperty("reserved")) - if (typeof message.reserved !== "boolean") - return "reserved: boolean expected"; - if (message.repeated != null && message.hasOwnProperty("repeated")) - if (typeof message.repeated !== "boolean") - return "repeated: boolean expected"; - return null; - }; - - /** - * Creates a Declaration message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration - */ - Declaration.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ExtensionRangeOptions.Declaration) - return object; - var message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); - if (object.number != null) - message.number = object.number | 0; - if (object.fullName != null) - message.fullName = String(object.fullName); - if (object.type != null) - message.type = String(object.type); - if (object.reserved != null) - message.reserved = Boolean(object.reserved); - if (object.repeated != null) - message.repeated = Boolean(object.repeated); - return message; - }; - - /** - * Creates a plain object from a Declaration message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {google.protobuf.ExtensionRangeOptions.Declaration} message Declaration - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Declaration.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.number = 0; - object.fullName = ""; - object.type = ""; - object.reserved = false; - object.repeated = false; - } - if (message.number != null && message.hasOwnProperty("number")) - object.number = message.number; - if (message.fullName != null && message.hasOwnProperty("fullName")) - object.fullName = message.fullName; - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.reserved != null && message.hasOwnProperty("reserved")) - object.reserved = message.reserved; - if (message.repeated != null && message.hasOwnProperty("repeated")) - object.repeated = message.repeated; - return object; - }; - - /** - * Converts this Declaration to JSON. - * @function toJSON - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - * @returns {Object.} JSON object - */ - Declaration.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Declaration - * @function getTypeUrl - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Declaration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions.Declaration"; - }; - - return Declaration; - })(); - - /** - * VerificationState enum. - * @name google.protobuf.ExtensionRangeOptions.VerificationState - * @enum {number} - * @property {number} DECLARATION=0 DECLARATION value - * @property {number} UNVERIFIED=1 UNVERIFIED value - */ - ExtensionRangeOptions.VerificationState = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "DECLARATION"] = 0; - values[valuesById[1] = "UNVERIFIED"] = 1; - return values; - })(); - - return ExtensionRangeOptions; - })(); - - protobuf.FieldDescriptorProto = (function() { - - /** - * Properties of a FieldDescriptorProto. - * @memberof google.protobuf - * @interface IFieldDescriptorProto - * @property {string|null} [name] FieldDescriptorProto name - * @property {number|null} [number] FieldDescriptorProto number - * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label - * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type - * @property {string|null} [typeName] FieldDescriptorProto typeName - * @property {string|null} [extendee] FieldDescriptorProto extendee - * @property {string|null} [defaultValue] FieldDescriptorProto defaultValue - * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex - * @property {string|null} [jsonName] FieldDescriptorProto jsonName - * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options - * @property {boolean|null} [proto3Optional] FieldDescriptorProto proto3Optional - */ - - /** - * Constructs a new FieldDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a FieldDescriptorProto. - * @implements IFieldDescriptorProto - * @constructor - * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set - */ - function FieldDescriptorProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FieldDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.name = ""; - - /** - * FieldDescriptorProto number. - * @member {number} number - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.number = 0; - - /** - * FieldDescriptorProto label. - * @member {google.protobuf.FieldDescriptorProto.Label} label - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.label = 1; - - /** - * FieldDescriptorProto type. - * @member {google.protobuf.FieldDescriptorProto.Type} type - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.type = 1; - - /** - * FieldDescriptorProto typeName. - * @member {string} typeName - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.typeName = ""; - - /** - * FieldDescriptorProto extendee. - * @member {string} extendee - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.extendee = ""; - - /** - * FieldDescriptorProto defaultValue. - * @member {string} defaultValue - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.defaultValue = ""; - - /** - * FieldDescriptorProto oneofIndex. - * @member {number} oneofIndex - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.oneofIndex = 0; - - /** - * FieldDescriptorProto jsonName. - * @member {string} jsonName - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.jsonName = ""; - - /** - * FieldDescriptorProto options. - * @member {google.protobuf.IFieldOptions|null|undefined} options - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.options = null; - - /** - * FieldDescriptorProto proto3Optional. - * @member {boolean} proto3Optional - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.proto3Optional = false; - - /** - * Creates a new FieldDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance - */ - FieldDescriptorProto.create = function create(properties) { - return new FieldDescriptorProto(properties); - }; - - /** - * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); - if (message.number != null && Object.hasOwnProperty.call(message, "number")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); - if (message.label != null && Object.hasOwnProperty.call(message, "label")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); - if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); - if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); - if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); - if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) - writer.uint32(/* id 17, wireType 0 =*/136).bool(message.proto3Optional); - return writer; - }; - - /** - * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldDescriptorProto.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 3: { - message.number = reader.int32(); - break; - } - case 4: { - message.label = reader.int32(); - break; - } - case 5: { - message.type = reader.int32(); - break; - } - case 6: { - message.typeName = reader.string(); - break; - } - case 2: { - message.extendee = reader.string(); - break; - } - case 7: { - message.defaultValue = reader.string(); - break; - } - case 9: { - message.oneofIndex = reader.int32(); - break; - } - case 10: { - message.jsonName = reader.string(); - break; - } - case 8: { - message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); - break; - } - case 17: { - message.proto3Optional = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FieldDescriptorProto message. - * @function verify - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FieldDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.number != null && message.hasOwnProperty("number")) - if (!$util.isInteger(message.number)) - return "number: integer expected"; - if (message.label != null && message.hasOwnProperty("label")) - switch (message.label) { - default: - return "label: enum value expected"; - case 1: - case 3: - case 2: - break; - } - if (message.type != null && message.hasOwnProperty("type")) - switch (message.type) { - default: - return "type: enum value expected"; - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - case 10: - case 11: - case 12: - case 13: - case 14: - case 15: - case 16: - case 17: - case 18: - break; - } - if (message.typeName != null && message.hasOwnProperty("typeName")) - if (!$util.isString(message.typeName)) - return "typeName: string expected"; - if (message.extendee != null && message.hasOwnProperty("extendee")) - if (!$util.isString(message.extendee)) - return "extendee: string expected"; - if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) - if (!$util.isString(message.defaultValue)) - return "defaultValue: string expected"; - if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) - if (!$util.isInteger(message.oneofIndex)) - return "oneofIndex: integer expected"; - if (message.jsonName != null && message.hasOwnProperty("jsonName")) - if (!$util.isString(message.jsonName)) - return "jsonName: string expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.FieldOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) - if (typeof message.proto3Optional !== "boolean") - return "proto3Optional: boolean expected"; - return null; - }; - - /** - * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto - */ - FieldDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldDescriptorProto) - return object; - var message = new $root.google.protobuf.FieldDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.number != null) - message.number = object.number | 0; - switch (object.label) { - default: - if (typeof object.label === "number") { - message.label = object.label; - break; - } - break; - case "LABEL_OPTIONAL": - case 1: - message.label = 1; - break; - case "LABEL_REPEATED": - case 3: - message.label = 3; - break; - case "LABEL_REQUIRED": - case 2: - message.label = 2; - break; - } - switch (object.type) { - default: - if (typeof object.type === "number") { - message.type = object.type; - break; - } - break; - case "TYPE_DOUBLE": - case 1: - message.type = 1; - break; - case "TYPE_FLOAT": - case 2: - message.type = 2; - break; - case "TYPE_INT64": - case 3: - message.type = 3; - break; - case "TYPE_UINT64": - case 4: - message.type = 4; - break; - case "TYPE_INT32": - case 5: - message.type = 5; - break; - case "TYPE_FIXED64": - case 6: - message.type = 6; - break; - case "TYPE_FIXED32": - case 7: - message.type = 7; - break; - case "TYPE_BOOL": - case 8: - message.type = 8; - break; - case "TYPE_STRING": - case 9: - message.type = 9; - break; - case "TYPE_GROUP": - case 10: - message.type = 10; - break; - case "TYPE_MESSAGE": - case 11: - message.type = 11; - break; - case "TYPE_BYTES": - case 12: - message.type = 12; - break; - case "TYPE_UINT32": - case 13: - message.type = 13; - break; - case "TYPE_ENUM": - case 14: - message.type = 14; - break; - case "TYPE_SFIXED32": - case 15: - message.type = 15; - break; - case "TYPE_SFIXED64": - case 16: - message.type = 16; - break; - case "TYPE_SINT32": - case 17: - message.type = 17; - break; - case "TYPE_SINT64": - case 18: - message.type = 18; - break; - } - if (object.typeName != null) - message.typeName = String(object.typeName); - if (object.extendee != null) - message.extendee = String(object.extendee); - if (object.defaultValue != null) - message.defaultValue = String(object.defaultValue); - if (object.oneofIndex != null) - message.oneofIndex = object.oneofIndex | 0; - if (object.jsonName != null) - message.jsonName = String(object.jsonName); - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.FieldOptions.fromObject(object.options); - } - if (object.proto3Optional != null) - message.proto3Optional = Boolean(object.proto3Optional); - return message; - }; - - /** - * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FieldDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.extendee = ""; - object.number = 0; - object.label = options.enums === String ? "LABEL_OPTIONAL" : 1; - object.type = options.enums === String ? "TYPE_DOUBLE" : 1; - object.typeName = ""; - object.defaultValue = ""; - object.options = null; - object.oneofIndex = 0; - object.jsonName = ""; - object.proto3Optional = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.extendee != null && message.hasOwnProperty("extendee")) - object.extendee = message.extendee; - if (message.number != null && message.hasOwnProperty("number")) - object.number = message.number; - if (message.label != null && message.hasOwnProperty("label")) - object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] === undefined ? message.label : $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] === undefined ? message.type : $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; - if (message.typeName != null && message.hasOwnProperty("typeName")) - object.typeName = message.typeName; - if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) - object.defaultValue = message.defaultValue; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options); - if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) - object.oneofIndex = message.oneofIndex; - if (message.jsonName != null && message.hasOwnProperty("jsonName")) - object.jsonName = message.jsonName; - if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) - object.proto3Optional = message.proto3Optional; - return object; - }; - - /** - * Converts this FieldDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.FieldDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - FieldDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FieldDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FieldDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FieldDescriptorProto"; - }; - - /** - * Type enum. - * @name google.protobuf.FieldDescriptorProto.Type - * @enum {number} - * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value - * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value - * @property {number} TYPE_INT64=3 TYPE_INT64 value - * @property {number} TYPE_UINT64=4 TYPE_UINT64 value - * @property {number} TYPE_INT32=5 TYPE_INT32 value - * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value - * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value - * @property {number} TYPE_BOOL=8 TYPE_BOOL value - * @property {number} TYPE_STRING=9 TYPE_STRING value - * @property {number} TYPE_GROUP=10 TYPE_GROUP value - * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value - * @property {number} TYPE_BYTES=12 TYPE_BYTES value - * @property {number} TYPE_UINT32=13 TYPE_UINT32 value - * @property {number} TYPE_ENUM=14 TYPE_ENUM value - * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value - * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value - * @property {number} TYPE_SINT32=17 TYPE_SINT32 value - * @property {number} TYPE_SINT64=18 TYPE_SINT64 value - */ - FieldDescriptorProto.Type = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[1] = "TYPE_DOUBLE"] = 1; - values[valuesById[2] = "TYPE_FLOAT"] = 2; - values[valuesById[3] = "TYPE_INT64"] = 3; - values[valuesById[4] = "TYPE_UINT64"] = 4; - values[valuesById[5] = "TYPE_INT32"] = 5; - values[valuesById[6] = "TYPE_FIXED64"] = 6; - values[valuesById[7] = "TYPE_FIXED32"] = 7; - values[valuesById[8] = "TYPE_BOOL"] = 8; - values[valuesById[9] = "TYPE_STRING"] = 9; - values[valuesById[10] = "TYPE_GROUP"] = 10; - values[valuesById[11] = "TYPE_MESSAGE"] = 11; - values[valuesById[12] = "TYPE_BYTES"] = 12; - values[valuesById[13] = "TYPE_UINT32"] = 13; - values[valuesById[14] = "TYPE_ENUM"] = 14; - values[valuesById[15] = "TYPE_SFIXED32"] = 15; - values[valuesById[16] = "TYPE_SFIXED64"] = 16; - values[valuesById[17] = "TYPE_SINT32"] = 17; - values[valuesById[18] = "TYPE_SINT64"] = 18; - return values; - })(); - - /** - * Label enum. - * @name google.protobuf.FieldDescriptorProto.Label - * @enum {number} - * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value - * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value - * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value - */ - FieldDescriptorProto.Label = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[1] = "LABEL_OPTIONAL"] = 1; - values[valuesById[3] = "LABEL_REPEATED"] = 3; - values[valuesById[2] = "LABEL_REQUIRED"] = 2; - return values; - })(); - - return FieldDescriptorProto; - })(); - - protobuf.OneofDescriptorProto = (function() { - - /** - * Properties of an OneofDescriptorProto. - * @memberof google.protobuf - * @interface IOneofDescriptorProto - * @property {string|null} [name] OneofDescriptorProto name - * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options - */ - - /** - * Constructs a new OneofDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents an OneofDescriptorProto. - * @implements IOneofDescriptorProto - * @constructor - * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set - */ - function OneofDescriptorProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * OneofDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.OneofDescriptorProto - * @instance - */ - OneofDescriptorProto.prototype.name = ""; - - /** - * OneofDescriptorProto options. - * @member {google.protobuf.IOneofOptions|null|undefined} options - * @memberof google.protobuf.OneofDescriptorProto - * @instance - */ - OneofDescriptorProto.prototype.options = null; - - /** - * Creates a new OneofDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance - */ - OneofDescriptorProto.create = function create(properties) { - return new OneofDescriptorProto(properties); - }; - - /** - * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofDescriptorProto.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OneofDescriptorProto message. - * @function verify - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OneofDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.OneofOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto - */ - OneofDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.OneofDescriptorProto) - return object; - var message = new $root.google.protobuf.OneofDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.OneofOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OneofDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this OneofDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.OneofDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - OneofDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OneofDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OneofDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.OneofDescriptorProto"; - }; - - return OneofDescriptorProto; - })(); - - protobuf.EnumDescriptorProto = (function() { - - /** - * Properties of an EnumDescriptorProto. - * @memberof google.protobuf - * @interface IEnumDescriptorProto - * @property {string|null} [name] EnumDescriptorProto name - * @property {Array.|null} [value] EnumDescriptorProto value - * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options - * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange - * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName - */ - - /** - * Constructs a new EnumDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents an EnumDescriptorProto. - * @implements IEnumDescriptorProto - * @constructor - * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set - */ - function EnumDescriptorProto(properties) { - this.value = []; - this.reservedRange = []; - this.reservedName = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.name = ""; - - /** - * EnumDescriptorProto value. - * @member {Array.} value - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.value = $util.emptyArray; - - /** - * EnumDescriptorProto options. - * @member {google.protobuf.IEnumOptions|null|undefined} options - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.options = null; - - /** - * EnumDescriptorProto reservedRange. - * @member {Array.} reservedRange - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; - - /** - * EnumDescriptorProto reservedName. - * @member {Array.} reservedName - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.reservedName = $util.emptyArray; - - /** - * Creates a new EnumDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance - */ - EnumDescriptorProto.create = function create(properties) { - return new EnumDescriptorProto(properties); - }; - - /** - * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.value != null && message.value.length) - for (var i = 0; i < message.value.length; ++i) - $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.reservedRange != null && message.reservedRange.length) - for (var i = 0; i < message.reservedRange.length; ++i) - $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.reservedName != null && message.reservedName.length) - for (var i = 0; i < message.reservedName.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); - return writer; - }; - - /** - * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumDescriptorProto.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - if (!(message.value && message.value.length)) - message.value = []; - message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 3: { - message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); - break; - } - case 4: { - if (!(message.reservedRange && message.reservedRange.length)) - message.reservedRange = []; - message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32())); - break; - } - case 5: { - if (!(message.reservedName && message.reservedName.length)) - message.reservedName = []; - message.reservedName.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumDescriptorProto message. - * @function verify - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.value != null && message.hasOwnProperty("value")) { - if (!Array.isArray(message.value)) - return "value: array expected"; - for (var i = 0; i < message.value.length; ++i) { - var error = $root.google.protobuf.EnumValueDescriptorProto.verify(message.value[i]); - if (error) - return "value." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.EnumOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { - if (!Array.isArray(message.reservedRange)) - return "reservedRange: array expected"; - for (var i = 0; i < message.reservedRange.length; ++i) { - var error = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.verify(message.reservedRange[i]); - if (error) - return "reservedRange." + error; - } - } - if (message.reservedName != null && message.hasOwnProperty("reservedName")) { - if (!Array.isArray(message.reservedName)) - return "reservedName: array expected"; - for (var i = 0; i < message.reservedName.length; ++i) - if (!$util.isString(message.reservedName[i])) - return "reservedName: string[] expected"; - } - return null; - }; - - /** - * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto - */ - EnumDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumDescriptorProto) - return object; - var message = new $root.google.protobuf.EnumDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.value) { - if (!Array.isArray(object.value)) - throw TypeError(".google.protobuf.EnumDescriptorProto.value: array expected"); - message.value = []; - for (var i = 0; i < object.value.length; ++i) { - if (typeof object.value[i] !== "object") - throw TypeError(".google.protobuf.EnumDescriptorProto.value: object expected"); - message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.EnumDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.EnumOptions.fromObject(object.options); - } - if (object.reservedRange) { - if (!Array.isArray(object.reservedRange)) - throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: array expected"); - message.reservedRange = []; - for (var i = 0; i < object.reservedRange.length; ++i) { - if (typeof object.reservedRange[i] !== "object") - throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: object expected"); - message.reservedRange[i] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.fromObject(object.reservedRange[i]); - } - } - if (object.reservedName) { - if (!Array.isArray(object.reservedName)) - throw TypeError(".google.protobuf.EnumDescriptorProto.reservedName: array expected"); - message.reservedName = []; - for (var i = 0; i < object.reservedName.length; ++i) - message.reservedName[i] = String(object.reservedName[i]); - } - return message; - }; - - /** - * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.value = []; - object.reservedRange = []; - object.reservedName = []; - } - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.value && message.value.length) { - object.value = []; - for (var j = 0; j < message.value.length; ++j) - object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options); - if (message.reservedRange && message.reservedRange.length) { - object.reservedRange = []; - for (var j = 0; j < message.reservedRange.length; ++j) - object.reservedRange[j] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.toObject(message.reservedRange[j], options); - } - if (message.reservedName && message.reservedName.length) { - object.reservedName = []; - for (var j = 0; j < message.reservedName.length; ++j) - object.reservedName[j] = message.reservedName[j]; - } - return object; - }; - - /** - * Converts this EnumDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.EnumDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - EnumDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto"; - }; - - EnumDescriptorProto.EnumReservedRange = (function() { - - /** - * Properties of an EnumReservedRange. - * @memberof google.protobuf.EnumDescriptorProto - * @interface IEnumReservedRange - * @property {number|null} [start] EnumReservedRange start - * @property {number|null} [end] EnumReservedRange end - */ - - /** - * Constructs a new EnumReservedRange. - * @memberof google.protobuf.EnumDescriptorProto - * @classdesc Represents an EnumReservedRange. - * @implements IEnumReservedRange - * @constructor - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set - */ - function EnumReservedRange(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumReservedRange start. - * @member {number} start - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @instance - */ - EnumReservedRange.prototype.start = 0; - - /** - * EnumReservedRange end. - * @member {number} end - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @instance - */ - EnumReservedRange.prototype.end = 0; - - /** - * Creates a new EnumReservedRange instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set - * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance - */ - EnumReservedRange.create = function create(properties) { - return new EnumReservedRange(properties); - }; - - /** - * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumReservedRange.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.start != null && Object.hasOwnProperty.call(message, "start")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); - return writer; - }; - - /** - * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumReservedRange message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumReservedRange.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.start = reader.int32(); - break; - } - case 2: { - message.end = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumReservedRange.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumReservedRange message. - * @function verify - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumReservedRange.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.start != null && message.hasOwnProperty("start")) - if (!$util.isInteger(message.start)) - return "start: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - return null; - }; - - /** - * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange - */ - EnumReservedRange.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumDescriptorProto.EnumReservedRange) - return object; - var message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); - if (object.start != null) - message.start = object.start | 0; - if (object.end != null) - message.end = object.end | 0; - return message; - }; - - /** - * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {google.protobuf.EnumDescriptorProto.EnumReservedRange} message EnumReservedRange - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumReservedRange.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.start = 0; - object.end = 0; - } - if (message.start != null && message.hasOwnProperty("start")) - object.start = message.start; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - return object; - }; - - /** - * Converts this EnumReservedRange to JSON. - * @function toJSON - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @instance - * @returns {Object.} JSON object - */ - EnumReservedRange.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumReservedRange - * @function getTypeUrl - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto.EnumReservedRange"; - }; - - return EnumReservedRange; - })(); - - return EnumDescriptorProto; - })(); - - protobuf.EnumValueDescriptorProto = (function() { - - /** - * Properties of an EnumValueDescriptorProto. - * @memberof google.protobuf - * @interface IEnumValueDescriptorProto - * @property {string|null} [name] EnumValueDescriptorProto name - * @property {number|null} [number] EnumValueDescriptorProto number - * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options - */ - - /** - * Constructs a new EnumValueDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents an EnumValueDescriptorProto. - * @implements IEnumValueDescriptorProto - * @constructor - * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set - */ - function EnumValueDescriptorProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumValueDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - */ - EnumValueDescriptorProto.prototype.name = ""; - - /** - * EnumValueDescriptorProto number. - * @member {number} number - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - */ - EnumValueDescriptorProto.prototype.number = 0; - - /** - * EnumValueDescriptorProto options. - * @member {google.protobuf.IEnumValueOptions|null|undefined} options - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - */ - EnumValueDescriptorProto.prototype.options = null; - - /** - * Creates a new EnumValueDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance - */ - EnumValueDescriptorProto.create = function create(properties) { - return new EnumValueDescriptorProto(properties); - }; - - /** - * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.number != null && Object.hasOwnProperty.call(message, "number")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueDescriptorProto.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.number = reader.int32(); - break; - } - case 3: { - message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumValueDescriptorProto message. - * @function verify - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumValueDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.number != null && message.hasOwnProperty("number")) - if (!$util.isInteger(message.number)) - return "number: integer expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.EnumValueOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto - */ - EnumValueDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) - return object; - var message = new $root.google.protobuf.EnumValueDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.number != null) - message.number = object.number | 0; - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumValueDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.number = 0; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.number != null && message.hasOwnProperty("number")) - object.number = message.number; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this EnumValueDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - EnumValueDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumValueDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumValueDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumValueDescriptorProto"; - }; - - return EnumValueDescriptorProto; - })(); - - protobuf.ServiceDescriptorProto = (function() { - - /** - * Properties of a ServiceDescriptorProto. - * @memberof google.protobuf - * @interface IServiceDescriptorProto - * @property {string|null} [name] ServiceDescriptorProto name - * @property {Array.|null} [method] ServiceDescriptorProto method - * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options - */ - - /** - * Constructs a new ServiceDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a ServiceDescriptorProto. - * @implements IServiceDescriptorProto - * @constructor - * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set - */ - function ServiceDescriptorProto(properties) { - this.method = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ServiceDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - */ - ServiceDescriptorProto.prototype.name = ""; - - /** - * ServiceDescriptorProto method. - * @member {Array.} method - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - */ - ServiceDescriptorProto.prototype.method = $util.emptyArray; - - /** - * ServiceDescriptorProto options. - * @member {google.protobuf.IServiceOptions|null|undefined} options - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - */ - ServiceDescriptorProto.prototype.options = null; - - /** - * Creates a new ServiceDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance - */ - ServiceDescriptorProto.create = function create(properties) { - return new ServiceDescriptorProto(properties); - }; - - /** - * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.method != null && message.method.length) - for (var i = 0; i < message.method.length; ++i) - $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceDescriptorProto.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - if (!(message.method && message.method.length)) - message.method = []; - message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 3: { - message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ServiceDescriptorProto message. - * @function verify - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ServiceDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.method != null && message.hasOwnProperty("method")) { - if (!Array.isArray(message.method)) - return "method: array expected"; - for (var i = 0; i < message.method.length; ++i) { - var error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i]); - if (error) - return "method." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.ServiceOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto - */ - ServiceDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ServiceDescriptorProto) - return object; - var message = new $root.google.protobuf.ServiceDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.method) { - if (!Array.isArray(object.method)) - throw TypeError(".google.protobuf.ServiceDescriptorProto.method: array expected"); - message.method = []; - for (var i = 0; i < object.method.length; ++i) { - if (typeof object.method[i] !== "object") - throw TypeError(".google.protobuf.ServiceDescriptorProto.method: object expected"); - message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ServiceDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.method = []; - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.method && message.method.length) { - object.method = []; - for (var j = 0; j < message.method.length; ++j) - object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this ServiceDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - ServiceDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ServiceDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ServiceDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.ServiceDescriptorProto"; - }; - - return ServiceDescriptorProto; - })(); - - protobuf.MethodDescriptorProto = (function() { - - /** - * Properties of a MethodDescriptorProto. - * @memberof google.protobuf - * @interface IMethodDescriptorProto - * @property {string|null} [name] MethodDescriptorProto name - * @property {string|null} [inputType] MethodDescriptorProto inputType - * @property {string|null} [outputType] MethodDescriptorProto outputType - * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options - * @property {boolean|null} [clientStreaming] MethodDescriptorProto clientStreaming - * @property {boolean|null} [serverStreaming] MethodDescriptorProto serverStreaming - */ - - /** - * Constructs a new MethodDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a MethodDescriptorProto. - * @implements IMethodDescriptorProto - * @constructor - * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set - */ - function MethodDescriptorProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MethodDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.name = ""; - - /** - * MethodDescriptorProto inputType. - * @member {string} inputType - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.inputType = ""; - - /** - * MethodDescriptorProto outputType. - * @member {string} outputType - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.outputType = ""; - - /** - * MethodDescriptorProto options. - * @member {google.protobuf.IMethodOptions|null|undefined} options - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.options = null; - - /** - * MethodDescriptorProto clientStreaming. - * @member {boolean} clientStreaming - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.clientStreaming = false; - - /** - * MethodDescriptorProto serverStreaming. - * @member {boolean} serverStreaming - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.serverStreaming = false; - - /** - * Creates a new MethodDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance - */ - MethodDescriptorProto.create = function create(properties) { - return new MethodDescriptorProto(properties); - }; - - /** - * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); - if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); - if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); - return writer; - }; - - /** - * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodDescriptorProto.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.inputType = reader.string(); - break; - } - case 3: { - message.outputType = reader.string(); - break; - } - case 4: { - message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); - break; - } - case 5: { - message.clientStreaming = reader.bool(); - break; - } - case 6: { - message.serverStreaming = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MethodDescriptorProto message. - * @function verify - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MethodDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.inputType != null && message.hasOwnProperty("inputType")) - if (!$util.isString(message.inputType)) - return "inputType: string expected"; - if (message.outputType != null && message.hasOwnProperty("outputType")) - if (!$util.isString(message.outputType)) - return "outputType: string expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.MethodOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) - if (typeof message.clientStreaming !== "boolean") - return "clientStreaming: boolean expected"; - if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) - if (typeof message.serverStreaming !== "boolean") - return "serverStreaming: boolean expected"; - return null; - }; - - /** - * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto - */ - MethodDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.MethodDescriptorProto) - return object; - var message = new $root.google.protobuf.MethodDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.inputType != null) - message.inputType = String(object.inputType); - if (object.outputType != null) - message.outputType = String(object.outputType); - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.MethodOptions.fromObject(object.options); - } - if (object.clientStreaming != null) - message.clientStreaming = Boolean(object.clientStreaming); - if (object.serverStreaming != null) - message.serverStreaming = Boolean(object.serverStreaming); - return message; - }; - - /** - * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MethodDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.inputType = ""; - object.outputType = ""; - object.options = null; - object.clientStreaming = false; - object.serverStreaming = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.inputType != null && message.hasOwnProperty("inputType")) - object.inputType = message.inputType; - if (message.outputType != null && message.hasOwnProperty("outputType")) - object.outputType = message.outputType; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options); - if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) - object.clientStreaming = message.clientStreaming; - if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) - object.serverStreaming = message.serverStreaming; - return object; - }; - - /** - * Converts this MethodDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.MethodDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - MethodDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MethodDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MethodDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.MethodDescriptorProto"; - }; - - return MethodDescriptorProto; - })(); - - protobuf.FileOptions = (function() { - - /** - * Properties of a FileOptions. - * @memberof google.protobuf - * @interface IFileOptions - * @property {string|null} [javaPackage] FileOptions javaPackage - * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname - * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles - * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash - * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8 - * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor - * @property {string|null} [goPackage] FileOptions goPackage - * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices - * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices - * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices - * @property {boolean|null} [deprecated] FileOptions deprecated - * @property {boolean|null} [ccEnableArenas] FileOptions ccEnableArenas - * @property {string|null} [objcClassPrefix] FileOptions objcClassPrefix - * @property {string|null} [csharpNamespace] FileOptions csharpNamespace - * @property {string|null} [swiftPrefix] FileOptions swiftPrefix - * @property {string|null} [phpClassPrefix] FileOptions phpClassPrefix - * @property {string|null} [phpNamespace] FileOptions phpNamespace - * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace - * @property {string|null} [rubyPackage] FileOptions rubyPackage - * @property {google.protobuf.IFeatureSet|null} [features] FileOptions features - * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption - * @property {Array.|null} [".google.api.resourceDefinition"] FileOptions .google.api.resourceDefinition - */ - - /** - * Constructs a new FileOptions. - * @memberof google.protobuf - * @classdesc Represents a FileOptions. - * @implements IFileOptions - * @constructor - * @param {google.protobuf.IFileOptions=} [properties] Properties to set - */ - function FileOptions(properties) { - this.uninterpretedOption = []; - this[".google.api.resourceDefinition"] = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FileOptions javaPackage. - * @member {string} javaPackage - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaPackage = ""; - - /** - * FileOptions javaOuterClassname. - * @member {string} javaOuterClassname - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaOuterClassname = ""; - - /** - * FileOptions javaMultipleFiles. - * @member {boolean} javaMultipleFiles - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaMultipleFiles = false; - - /** - * FileOptions javaGenerateEqualsAndHash. - * @member {boolean} javaGenerateEqualsAndHash - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaGenerateEqualsAndHash = false; - - /** - * FileOptions javaStringCheckUtf8. - * @member {boolean} javaStringCheckUtf8 - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaStringCheckUtf8 = false; - - /** - * FileOptions optimizeFor. - * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.optimizeFor = 1; - - /** - * FileOptions goPackage. - * @member {string} goPackage - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.goPackage = ""; - - /** - * FileOptions ccGenericServices. - * @member {boolean} ccGenericServices - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.ccGenericServices = false; - - /** - * FileOptions javaGenericServices. - * @member {boolean} javaGenericServices - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaGenericServices = false; - - /** - * FileOptions pyGenericServices. - * @member {boolean} pyGenericServices - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.pyGenericServices = false; - - /** - * FileOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.deprecated = false; - - /** - * FileOptions ccEnableArenas. - * @member {boolean} ccEnableArenas - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.ccEnableArenas = true; - - /** - * FileOptions objcClassPrefix. - * @member {string} objcClassPrefix - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.objcClassPrefix = ""; - - /** - * FileOptions csharpNamespace. - * @member {string} csharpNamespace - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.csharpNamespace = ""; - - /** - * FileOptions swiftPrefix. - * @member {string} swiftPrefix - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.swiftPrefix = ""; - - /** - * FileOptions phpClassPrefix. - * @member {string} phpClassPrefix - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.phpClassPrefix = ""; - - /** - * FileOptions phpNamespace. - * @member {string} phpNamespace - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.phpNamespace = ""; - - /** - * FileOptions phpMetadataNamespace. - * @member {string} phpMetadataNamespace - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.phpMetadataNamespace = ""; - - /** - * FileOptions rubyPackage. - * @member {string} rubyPackage - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.rubyPackage = ""; - - /** - * FileOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.features = null; - - /** - * FileOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * FileOptions .google.api.resourceDefinition. - * @member {Array.} .google.api.resourceDefinition - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray; - - /** - * Creates a new FileOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.FileOptions - * @static - * @param {google.protobuf.IFileOptions=} [properties] Properties to set - * @returns {google.protobuf.FileOptions} FileOptions instance - */ - FileOptions.create = function create(properties) { - return new FileOptions(properties); - }; - - /** - * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FileOptions - * @static - * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); - if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); - if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); - if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) - writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); - if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); - if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) - writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); - if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) - writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); - if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) - writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); - if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) - writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); - if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) - writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); - if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) - writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); - if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) - writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); - if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) - writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); - if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) - writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); - if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) - writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); - if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) - writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); - if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) - writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); - if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) - writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.resourceDefinition"] != null && message[".google.api.resourceDefinition"].length) - for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) - $root.google.api.ResourceDescriptor.encode(message[".google.api.resourceDefinition"][i], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FileOptions - * @static - * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FileOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FileOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FileOptions} FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.javaPackage = reader.string(); - break; - } - case 8: { - message.javaOuterClassname = reader.string(); - break; - } - case 10: { - message.javaMultipleFiles = reader.bool(); - break; - } - case 20: { - message.javaGenerateEqualsAndHash = reader.bool(); - break; - } - case 27: { - message.javaStringCheckUtf8 = reader.bool(); - break; - } - case 9: { - message.optimizeFor = reader.int32(); - break; - } - case 11: { - message.goPackage = reader.string(); - break; - } - case 16: { - message.ccGenericServices = reader.bool(); - break; - } - case 17: { - message.javaGenericServices = reader.bool(); - break; - } - case 18: { - message.pyGenericServices = reader.bool(); - break; - } - case 23: { - message.deprecated = reader.bool(); - break; - } - case 31: { - message.ccEnableArenas = reader.bool(); - break; - } - case 36: { - message.objcClassPrefix = reader.string(); - break; - } - case 37: { - message.csharpNamespace = reader.string(); - break; - } - case 39: { - message.swiftPrefix = reader.string(); - break; - } - case 40: { - message.phpClassPrefix = reader.string(); - break; - } - case 41: { - message.phpNamespace = reader.string(); - break; - } - case 44: { - message.phpMetadataNamespace = reader.string(); - break; - } - case 45: { - message.rubyPackage = reader.string(); - break; - } - case 50: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 1053: { - if (!(message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length)) - message[".google.api.resourceDefinition"] = []; - message[".google.api.resourceDefinition"].push($root.google.api.ResourceDescriptor.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FileOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FileOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FileOptions} FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FileOptions message. - * @function verify - * @memberof google.protobuf.FileOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FileOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) - if (!$util.isString(message.javaPackage)) - return "javaPackage: string expected"; - if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) - if (!$util.isString(message.javaOuterClassname)) - return "javaOuterClassname: string expected"; - if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) - if (typeof message.javaMultipleFiles !== "boolean") - return "javaMultipleFiles: boolean expected"; - if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) - if (typeof message.javaGenerateEqualsAndHash !== "boolean") - return "javaGenerateEqualsAndHash: boolean expected"; - if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) - if (typeof message.javaStringCheckUtf8 !== "boolean") - return "javaStringCheckUtf8: boolean expected"; - if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) - switch (message.optimizeFor) { - default: - return "optimizeFor: enum value expected"; - case 1: - case 2: - case 3: - break; - } - if (message.goPackage != null && message.hasOwnProperty("goPackage")) - if (!$util.isString(message.goPackage)) - return "goPackage: string expected"; - if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) - if (typeof message.ccGenericServices !== "boolean") - return "ccGenericServices: boolean expected"; - if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) - if (typeof message.javaGenericServices !== "boolean") - return "javaGenericServices: boolean expected"; - if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) - if (typeof message.pyGenericServices !== "boolean") - return "pyGenericServices: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) - if (typeof message.ccEnableArenas !== "boolean") - return "ccEnableArenas: boolean expected"; - if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) - if (!$util.isString(message.objcClassPrefix)) - return "objcClassPrefix: string expected"; - if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) - if (!$util.isString(message.csharpNamespace)) - return "csharpNamespace: string expected"; - if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) - if (!$util.isString(message.swiftPrefix)) - return "swiftPrefix: string expected"; - if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) - if (!$util.isString(message.phpClassPrefix)) - return "phpClassPrefix: string expected"; - if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) - if (!$util.isString(message.phpNamespace)) - return "phpNamespace: string expected"; - if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) - if (!$util.isString(message.phpMetadataNamespace)) - return "phpMetadataNamespace: string expected"; - if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) - if (!$util.isString(message.rubyPackage)) - return "rubyPackage: string expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".google.api.resourceDefinition"] != null && message.hasOwnProperty(".google.api.resourceDefinition")) { - if (!Array.isArray(message[".google.api.resourceDefinition"])) - return ".google.api.resourceDefinition: array expected"; - for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) { - var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resourceDefinition"][i]); - if (error) - return ".google.api.resourceDefinition." + error; - } - } - return null; - }; - - /** - * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FileOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FileOptions} FileOptions - */ - FileOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FileOptions) - return object; - var message = new $root.google.protobuf.FileOptions(); - if (object.javaPackage != null) - message.javaPackage = String(object.javaPackage); - if (object.javaOuterClassname != null) - message.javaOuterClassname = String(object.javaOuterClassname); - if (object.javaMultipleFiles != null) - message.javaMultipleFiles = Boolean(object.javaMultipleFiles); - if (object.javaGenerateEqualsAndHash != null) - message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash); - if (object.javaStringCheckUtf8 != null) - message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); - switch (object.optimizeFor) { - default: - if (typeof object.optimizeFor === "number") { - message.optimizeFor = object.optimizeFor; - break; - } - break; - case "SPEED": - case 1: - message.optimizeFor = 1; - break; - case "CODE_SIZE": - case 2: - message.optimizeFor = 2; - break; - case "LITE_RUNTIME": - case 3: - message.optimizeFor = 3; - break; - } - if (object.goPackage != null) - message.goPackage = String(object.goPackage); - if (object.ccGenericServices != null) - message.ccGenericServices = Boolean(object.ccGenericServices); - if (object.javaGenericServices != null) - message.javaGenericServices = Boolean(object.javaGenericServices); - if (object.pyGenericServices != null) - message.pyGenericServices = Boolean(object.pyGenericServices); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.ccEnableArenas != null) - message.ccEnableArenas = Boolean(object.ccEnableArenas); - if (object.objcClassPrefix != null) - message.objcClassPrefix = String(object.objcClassPrefix); - if (object.csharpNamespace != null) - message.csharpNamespace = String(object.csharpNamespace); - if (object.swiftPrefix != null) - message.swiftPrefix = String(object.swiftPrefix); - if (object.phpClassPrefix != null) - message.phpClassPrefix = String(object.phpClassPrefix); - if (object.phpNamespace != null) - message.phpNamespace = String(object.phpNamespace); - if (object.phpMetadataNamespace != null) - message.phpMetadataNamespace = String(object.phpMetadataNamespace); - if (object.rubyPackage != null) - message.rubyPackage = String(object.rubyPackage); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.FileOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".google.api.resourceDefinition"]) { - if (!Array.isArray(object[".google.api.resourceDefinition"])) - throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: array expected"); - message[".google.api.resourceDefinition"] = []; - for (var i = 0; i < object[".google.api.resourceDefinition"].length; ++i) { - if (typeof object[".google.api.resourceDefinition"][i] !== "object") - throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: object expected"); - message[".google.api.resourceDefinition"][i] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resourceDefinition"][i]); - } - } - return message; - }; - - /** - * Creates a plain object from a FileOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FileOptions - * @static - * @param {google.protobuf.FileOptions} message FileOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FileOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.uninterpretedOption = []; - object[".google.api.resourceDefinition"] = []; - } - if (options.defaults) { - object.javaPackage = ""; - object.javaOuterClassname = ""; - object.optimizeFor = options.enums === String ? "SPEED" : 1; - object.javaMultipleFiles = false; - object.goPackage = ""; - object.ccGenericServices = false; - object.javaGenericServices = false; - object.pyGenericServices = false; - object.javaGenerateEqualsAndHash = false; - object.deprecated = false; - object.javaStringCheckUtf8 = false; - object.ccEnableArenas = true; - object.objcClassPrefix = ""; - object.csharpNamespace = ""; - object.swiftPrefix = ""; - object.phpClassPrefix = ""; - object.phpNamespace = ""; - object.phpMetadataNamespace = ""; - object.rubyPackage = ""; - object.features = null; - } - if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) - object.javaPackage = message.javaPackage; - if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) - object.javaOuterClassname = message.javaOuterClassname; - if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) - object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] === undefined ? message.optimizeFor : $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; - if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) - object.javaMultipleFiles = message.javaMultipleFiles; - if (message.goPackage != null && message.hasOwnProperty("goPackage")) - object.goPackage = message.goPackage; - if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) - object.ccGenericServices = message.ccGenericServices; - if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) - object.javaGenericServices = message.javaGenericServices; - if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) - object.pyGenericServices = message.pyGenericServices; - if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) - object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) - object.javaStringCheckUtf8 = message.javaStringCheckUtf8; - if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) - object.ccEnableArenas = message.ccEnableArenas; - if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) - object.objcClassPrefix = message.objcClassPrefix; - if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) - object.csharpNamespace = message.csharpNamespace; - if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) - object.swiftPrefix = message.swiftPrefix; - if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) - object.phpClassPrefix = message.phpClassPrefix; - if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) - object.phpNamespace = message.phpNamespace; - if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) - object.phpMetadataNamespace = message.phpMetadataNamespace; - if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) - object.rubyPackage = message.rubyPackage; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length) { - object[".google.api.resourceDefinition"] = []; - for (var j = 0; j < message[".google.api.resourceDefinition"].length; ++j) - object[".google.api.resourceDefinition"][j] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resourceDefinition"][j], options); - } - return object; - }; - - /** - * Converts this FileOptions to JSON. - * @function toJSON - * @memberof google.protobuf.FileOptions - * @instance - * @returns {Object.} JSON object - */ - FileOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FileOptions - * @function getTypeUrl - * @memberof google.protobuf.FileOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FileOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FileOptions"; - }; - - /** - * OptimizeMode enum. - * @name google.protobuf.FileOptions.OptimizeMode - * @enum {number} - * @property {number} SPEED=1 SPEED value - * @property {number} CODE_SIZE=2 CODE_SIZE value - * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value - */ - FileOptions.OptimizeMode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[1] = "SPEED"] = 1; - values[valuesById[2] = "CODE_SIZE"] = 2; - values[valuesById[3] = "LITE_RUNTIME"] = 3; - return values; - })(); - - return FileOptions; - })(); - - protobuf.MessageOptions = (function() { - - /** - * Properties of a MessageOptions. - * @memberof google.protobuf - * @interface IMessageOptions - * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat - * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor - * @property {boolean|null} [deprecated] MessageOptions deprecated - * @property {boolean|null} [mapEntry] MessageOptions mapEntry - * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] MessageOptions deprecatedLegacyJsonFieldConflicts - * @property {google.protobuf.IFeatureSet|null} [features] MessageOptions features - * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption - * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource - */ - - /** - * Constructs a new MessageOptions. - * @memberof google.protobuf - * @classdesc Represents a MessageOptions. - * @implements IMessageOptions - * @constructor - * @param {google.protobuf.IMessageOptions=} [properties] Properties to set - */ - function MessageOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MessageOptions messageSetWireFormat. - * @member {boolean} messageSetWireFormat - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.messageSetWireFormat = false; - - /** - * MessageOptions noStandardDescriptorAccessor. - * @member {boolean} noStandardDescriptorAccessor - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.noStandardDescriptorAccessor = false; - - /** - * MessageOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.deprecated = false; - - /** - * MessageOptions mapEntry. - * @member {boolean} mapEntry - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.mapEntry = false; - - /** - * MessageOptions deprecatedLegacyJsonFieldConflicts. - * @member {boolean} deprecatedLegacyJsonFieldConflicts - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; - - /** - * MessageOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.features = null; - - /** - * MessageOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * MessageOptions .google.api.resource. - * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".google.api.resource"] = null; - - /** - * Creates a new MessageOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.IMessageOptions=} [properties] Properties to set - * @returns {google.protobuf.MessageOptions} MessageOptions instance - */ - MessageOptions.create = function create(properties) { - return new MessageOptions(properties); - }; - - /** - * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MessageOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); - if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) - writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); - if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) - writer.uint32(/* id 11, wireType 0 =*/88).bool(message.deprecatedLegacyJsonFieldConflicts); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.resource"] != null && Object.hasOwnProperty.call(message, ".google.api.resource")) - $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MessageOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.MessageOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.MessageOptions} MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MessageOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.messageSetWireFormat = reader.bool(); - break; - } - case 2: { - message.noStandardDescriptorAccessor = reader.bool(); - break; - } - case 3: { - message.deprecated = reader.bool(); - break; - } - case 7: { - message.mapEntry = reader.bool(); - break; - } - case 11: { - message.deprecatedLegacyJsonFieldConflicts = reader.bool(); - break; - } - case 12: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 1053: { - message[".google.api.resource"] = $root.google.api.ResourceDescriptor.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MessageOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.MessageOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.MessageOptions} MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MessageOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MessageOptions message. - * @function verify - * @memberof google.protobuf.MessageOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MessageOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) - if (typeof message.messageSetWireFormat !== "boolean") - return "messageSetWireFormat: boolean expected"; - if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) - if (typeof message.noStandardDescriptorAccessor !== "boolean") - return "noStandardDescriptorAccessor: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) - if (typeof message.mapEntry !== "boolean") - return "mapEntry: boolean expected"; - if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) - if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") - return "deprecatedLegacyJsonFieldConflicts: boolean expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) { - var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resource"]); - if (error) - return ".google.api.resource." + error; - } - return null; - }; - - /** - * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.MessageOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.MessageOptions} MessageOptions - */ - MessageOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.MessageOptions) - return object; - var message = new $root.google.protobuf.MessageOptions(); - if (object.messageSetWireFormat != null) - message.messageSetWireFormat = Boolean(object.messageSetWireFormat); - if (object.noStandardDescriptorAccessor != null) - message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.mapEntry != null) - message.mapEntry = Boolean(object.mapEntry); - if (object.deprecatedLegacyJsonFieldConflicts != null) - message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.MessageOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".google.api.resource"] != null) { - if (typeof object[".google.api.resource"] !== "object") - throw TypeError(".google.protobuf.MessageOptions..google.api.resource: object expected"); - message[".google.api.resource"] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resource"]); - } - return message; - }; - - /** - * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.MessageOptions} message MessageOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MessageOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) { - object.messageSetWireFormat = false; - object.noStandardDescriptorAccessor = false; - object.deprecated = false; - object.mapEntry = false; - object.deprecatedLegacyJsonFieldConflicts = false; - object.features = null; - object[".google.api.resource"] = null; - } - if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) - object.messageSetWireFormat = message.messageSetWireFormat; - if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) - object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) - object.mapEntry = message.mapEntry; - if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) - object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) - object[".google.api.resource"] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resource"], options); - return object; - }; - - /** - * Converts this MessageOptions to JSON. - * @function toJSON - * @memberof google.protobuf.MessageOptions - * @instance - * @returns {Object.} JSON object - */ - MessageOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MessageOptions - * @function getTypeUrl - * @memberof google.protobuf.MessageOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MessageOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.MessageOptions"; - }; - - return MessageOptions; - })(); - - protobuf.FieldOptions = (function() { - - /** - * Properties of a FieldOptions. - * @memberof google.protobuf - * @interface IFieldOptions - * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype - * @property {boolean|null} [packed] FieldOptions packed - * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype - * @property {boolean|null} [lazy] FieldOptions lazy - * @property {boolean|null} [unverifiedLazy] FieldOptions unverifiedLazy - * @property {boolean|null} [deprecated] FieldOptions deprecated - * @property {boolean|null} [weak] FieldOptions weak - * @property {boolean|null} [debugRedact] FieldOptions debugRedact - * @property {google.protobuf.FieldOptions.OptionRetention|null} [retention] FieldOptions retention - * @property {Array.|null} [targets] FieldOptions targets - * @property {Array.|null} [editionDefaults] FieldOptions editionDefaults - * @property {google.protobuf.IFeatureSet|null} [features] FieldOptions features - * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption - * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior - * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference - */ - - /** - * Constructs a new FieldOptions. - * @memberof google.protobuf - * @classdesc Represents a FieldOptions. - * @implements IFieldOptions - * @constructor - * @param {google.protobuf.IFieldOptions=} [properties] Properties to set - */ - function FieldOptions(properties) { - this.targets = []; - this.editionDefaults = []; - this.uninterpretedOption = []; - this[".google.api.fieldBehavior"] = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FieldOptions ctype. - * @member {google.protobuf.FieldOptions.CType} ctype - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.ctype = 0; - - /** - * FieldOptions packed. - * @member {boolean} packed - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.packed = false; - - /** - * FieldOptions jstype. - * @member {google.protobuf.FieldOptions.JSType} jstype - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.jstype = 0; - - /** - * FieldOptions lazy. - * @member {boolean} lazy - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.lazy = false; - - /** - * FieldOptions unverifiedLazy. - * @member {boolean} unverifiedLazy - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.unverifiedLazy = false; - - /** - * FieldOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.deprecated = false; - - /** - * FieldOptions weak. - * @member {boolean} weak - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.weak = false; - - /** - * FieldOptions debugRedact. - * @member {boolean} debugRedact - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.debugRedact = false; - - /** - * FieldOptions retention. - * @member {google.protobuf.FieldOptions.OptionRetention} retention - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.retention = 0; - - /** - * FieldOptions targets. - * @member {Array.} targets - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.targets = $util.emptyArray; - - /** - * FieldOptions editionDefaults. - * @member {Array.} editionDefaults - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.editionDefaults = $util.emptyArray; - - /** - * FieldOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.features = null; - - /** - * FieldOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * FieldOptions .google.api.fieldBehavior. - * @member {Array.} .google.api.fieldBehavior - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; - - /** - * FieldOptions .google.api.resourceReference. - * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".google.api.resourceReference"] = null; - - /** - * Creates a new FieldOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.IFieldOptions=} [properties] Properties to set - * @returns {google.protobuf.FieldOptions} FieldOptions instance - */ - FieldOptions.create = function create(properties) { - return new FieldOptions(properties); - }; - - /** - * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); - if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); - if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); - if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) - writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); - if (message.unverifiedLazy != null && Object.hasOwnProperty.call(message, "unverifiedLazy")) - writer.uint32(/* id 15, wireType 0 =*/120).bool(message.unverifiedLazy); - if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) - writer.uint32(/* id 16, wireType 0 =*/128).bool(message.debugRedact); - if (message.retention != null && Object.hasOwnProperty.call(message, "retention")) - writer.uint32(/* id 17, wireType 0 =*/136).int32(message.retention); - if (message.targets != null && message.targets.length) - for (var i = 0; i < message.targets.length; ++i) - writer.uint32(/* id 19, wireType 0 =*/152).int32(message.targets[i]); - if (message.editionDefaults != null && message.editionDefaults.length) - for (var i = 0; i < message.editionDefaults.length; ++i) - $root.google.protobuf.FieldOptions.EditionDefault.encode(message.editionDefaults[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) - for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) - writer.uint32(/* id 1052, wireType 0 =*/8416).int32(message[".google.api.fieldBehavior"][i]); - if (message[".google.api.resourceReference"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceReference")) - $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FieldOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FieldOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldOptions} FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.ctype = reader.int32(); - break; - } - case 2: { - message.packed = reader.bool(); - break; - } - case 6: { - message.jstype = reader.int32(); - break; - } - case 5: { - message.lazy = reader.bool(); - break; - } - case 15: { - message.unverifiedLazy = reader.bool(); - break; - } - case 3: { - message.deprecated = reader.bool(); - break; - } - case 10: { - message.weak = reader.bool(); - break; - } - case 16: { - message.debugRedact = reader.bool(); - break; - } - case 17: { - message.retention = reader.int32(); - break; - } - case 19: { - if (!(message.targets && message.targets.length)) - message.targets = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.targets.push(reader.int32()); - } else - message.targets.push(reader.int32()); - break; - } - case 20: { - if (!(message.editionDefaults && message.editionDefaults.length)) - message.editionDefaults = []; - message.editionDefaults.push($root.google.protobuf.FieldOptions.EditionDefault.decode(reader, reader.uint32())); - break; - } - case 21: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 1052: { - if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) - message[".google.api.fieldBehavior"] = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message[".google.api.fieldBehavior"].push(reader.int32()); - } else - message[".google.api.fieldBehavior"].push(reader.int32()); - break; - } - case 1055: { - message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FieldOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FieldOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldOptions} FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FieldOptions message. - * @function verify - * @memberof google.protobuf.FieldOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FieldOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.ctype != null && message.hasOwnProperty("ctype")) - switch (message.ctype) { - default: - return "ctype: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.packed != null && message.hasOwnProperty("packed")) - if (typeof message.packed !== "boolean") - return "packed: boolean expected"; - if (message.jstype != null && message.hasOwnProperty("jstype")) - switch (message.jstype) { - default: - return "jstype: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.lazy != null && message.hasOwnProperty("lazy")) - if (typeof message.lazy !== "boolean") - return "lazy: boolean expected"; - if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) - if (typeof message.unverifiedLazy !== "boolean") - return "unverifiedLazy: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.weak != null && message.hasOwnProperty("weak")) - if (typeof message.weak !== "boolean") - return "weak: boolean expected"; - if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) - if (typeof message.debugRedact !== "boolean") - return "debugRedact: boolean expected"; - if (message.retention != null && message.hasOwnProperty("retention")) - switch (message.retention) { - default: - return "retention: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.targets != null && message.hasOwnProperty("targets")) { - if (!Array.isArray(message.targets)) - return "targets: array expected"; - for (var i = 0; i < message.targets.length; ++i) - switch (message.targets[i]) { - default: - return "targets: enum value[] expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - break; - } - } - if (message.editionDefaults != null && message.hasOwnProperty("editionDefaults")) { - if (!Array.isArray(message.editionDefaults)) - return "editionDefaults: array expected"; - for (var i = 0; i < message.editionDefaults.length; ++i) { - var error = $root.google.protobuf.FieldOptions.EditionDefault.verify(message.editionDefaults[i]); - if (error) - return "editionDefaults." + error; - } - } - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".google.api.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) { - if (!Array.isArray(message[".google.api.fieldBehavior"])) - return ".google.api.fieldBehavior: array expected"; - for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) - switch (message[".google.api.fieldBehavior"][i]) { - default: - return ".google.api.fieldBehavior: enum value[] expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - break; - } - } - if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) { - var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"]); - if (error) - return ".google.api.resourceReference." + error; - } - return null; - }; - - /** - * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FieldOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FieldOptions} FieldOptions - */ - FieldOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldOptions) - return object; - var message = new $root.google.protobuf.FieldOptions(); - switch (object.ctype) { - default: - if (typeof object.ctype === "number") { - message.ctype = object.ctype; - break; - } - break; - case "STRING": - case 0: - message.ctype = 0; - break; - case "CORD": - case 1: - message.ctype = 1; - break; - case "STRING_PIECE": - case 2: - message.ctype = 2; - break; - } - if (object.packed != null) - message.packed = Boolean(object.packed); - switch (object.jstype) { - default: - if (typeof object.jstype === "number") { - message.jstype = object.jstype; - break; - } - break; - case "JS_NORMAL": - case 0: - message.jstype = 0; - break; - case "JS_STRING": - case 1: - message.jstype = 1; - break; - case "JS_NUMBER": - case 2: - message.jstype = 2; - break; - } - if (object.lazy != null) - message.lazy = Boolean(object.lazy); - if (object.unverifiedLazy != null) - message.unverifiedLazy = Boolean(object.unverifiedLazy); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.weak != null) - message.weak = Boolean(object.weak); - if (object.debugRedact != null) - message.debugRedact = Boolean(object.debugRedact); - switch (object.retention) { - default: - if (typeof object.retention === "number") { - message.retention = object.retention; - break; - } - break; - case "RETENTION_UNKNOWN": - case 0: - message.retention = 0; - break; - case "RETENTION_RUNTIME": - case 1: - message.retention = 1; - break; - case "RETENTION_SOURCE": - case 2: - message.retention = 2; - break; - } - if (object.targets) { - if (!Array.isArray(object.targets)) - throw TypeError(".google.protobuf.FieldOptions.targets: array expected"); - message.targets = []; - for (var i = 0; i < object.targets.length; ++i) - switch (object.targets[i]) { - default: - if (typeof object.targets[i] === "number") { - message.targets[i] = object.targets[i]; - break; - } - case "TARGET_TYPE_UNKNOWN": - case 0: - message.targets[i] = 0; - break; - case "TARGET_TYPE_FILE": - case 1: - message.targets[i] = 1; - break; - case "TARGET_TYPE_EXTENSION_RANGE": - case 2: - message.targets[i] = 2; - break; - case "TARGET_TYPE_MESSAGE": - case 3: - message.targets[i] = 3; - break; - case "TARGET_TYPE_FIELD": - case 4: - message.targets[i] = 4; - break; - case "TARGET_TYPE_ONEOF": - case 5: - message.targets[i] = 5; - break; - case "TARGET_TYPE_ENUM": - case 6: - message.targets[i] = 6; - break; - case "TARGET_TYPE_ENUM_ENTRY": - case 7: - message.targets[i] = 7; - break; - case "TARGET_TYPE_SERVICE": - case 8: - message.targets[i] = 8; - break; - case "TARGET_TYPE_METHOD": - case 9: - message.targets[i] = 9; - break; - } - } - if (object.editionDefaults) { - if (!Array.isArray(object.editionDefaults)) - throw TypeError(".google.protobuf.FieldOptions.editionDefaults: array expected"); - message.editionDefaults = []; - for (var i = 0; i < object.editionDefaults.length; ++i) { - if (typeof object.editionDefaults[i] !== "object") - throw TypeError(".google.protobuf.FieldOptions.editionDefaults: object expected"); - message.editionDefaults[i] = $root.google.protobuf.FieldOptions.EditionDefault.fromObject(object.editionDefaults[i]); - } - } - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.FieldOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".google.api.fieldBehavior"]) { - if (!Array.isArray(object[".google.api.fieldBehavior"])) - throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected"); - message[".google.api.fieldBehavior"] = []; - for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i) - switch (object[".google.api.fieldBehavior"][i]) { - default: - if (typeof object[".google.api.fieldBehavior"][i] === "number") { - message[".google.api.fieldBehavior"][i] = object[".google.api.fieldBehavior"][i]; - break; - } - case "FIELD_BEHAVIOR_UNSPECIFIED": - case 0: - message[".google.api.fieldBehavior"][i] = 0; - break; - case "OPTIONAL": - case 1: - message[".google.api.fieldBehavior"][i] = 1; - break; - case "REQUIRED": - case 2: - message[".google.api.fieldBehavior"][i] = 2; - break; - case "OUTPUT_ONLY": - case 3: - message[".google.api.fieldBehavior"][i] = 3; - break; - case "INPUT_ONLY": - case 4: - message[".google.api.fieldBehavior"][i] = 4; - break; - case "IMMUTABLE": - case 5: - message[".google.api.fieldBehavior"][i] = 5; - break; - case "UNORDERED_LIST": - case 6: - message[".google.api.fieldBehavior"][i] = 6; - break; - case "NON_EMPTY_DEFAULT": - case 7: - message[".google.api.fieldBehavior"][i] = 7; - break; - case "IDENTIFIER": - case 8: - message[".google.api.fieldBehavior"][i] = 8; - break; - } - } - if (object[".google.api.resourceReference"] != null) { - if (typeof object[".google.api.resourceReference"] !== "object") - throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected"); - message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"]); - } - return message; - }; - - /** - * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.FieldOptions} message FieldOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FieldOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.targets = []; - object.editionDefaults = []; - object.uninterpretedOption = []; - object[".google.api.fieldBehavior"] = []; - } - if (options.defaults) { - object.ctype = options.enums === String ? "STRING" : 0; - object.packed = false; - object.deprecated = false; - object.lazy = false; - object.jstype = options.enums === String ? "JS_NORMAL" : 0; - object.weak = false; - object.unverifiedLazy = false; - object.debugRedact = false; - object.retention = options.enums === String ? "RETENTION_UNKNOWN" : 0; - object.features = null; - object[".google.api.resourceReference"] = null; - } - if (message.ctype != null && message.hasOwnProperty("ctype")) - object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] === undefined ? message.ctype : $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; - if (message.packed != null && message.hasOwnProperty("packed")) - object.packed = message.packed; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.lazy != null && message.hasOwnProperty("lazy")) - object.lazy = message.lazy; - if (message.jstype != null && message.hasOwnProperty("jstype")) - object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] === undefined ? message.jstype : $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; - if (message.weak != null && message.hasOwnProperty("weak")) - object.weak = message.weak; - if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) - object.unverifiedLazy = message.unverifiedLazy; - if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) - object.debugRedact = message.debugRedact; - if (message.retention != null && message.hasOwnProperty("retention")) - object.retention = options.enums === String ? $root.google.protobuf.FieldOptions.OptionRetention[message.retention] === undefined ? message.retention : $root.google.protobuf.FieldOptions.OptionRetention[message.retention] : message.retention; - if (message.targets && message.targets.length) { - object.targets = []; - for (var j = 0; j < message.targets.length; ++j) - object.targets[j] = options.enums === String ? $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] === undefined ? message.targets[j] : $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] : message.targets[j]; - } - if (message.editionDefaults && message.editionDefaults.length) { - object.editionDefaults = []; - for (var j = 0; j < message.editionDefaults.length; ++j) - object.editionDefaults[j] = $root.google.protobuf.FieldOptions.EditionDefault.toObject(message.editionDefaults[j], options); - } - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length) { - object[".google.api.fieldBehavior"] = []; - for (var j = 0; j < message[".google.api.fieldBehavior"].length; ++j) - object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] === undefined ? message[".google.api.fieldBehavior"][j] : $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; - } - if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) - object[".google.api.resourceReference"] = $root.google.api.ResourceReference.toObject(message[".google.api.resourceReference"], options); - return object; - }; - - /** - * Converts this FieldOptions to JSON. - * @function toJSON - * @memberof google.protobuf.FieldOptions - * @instance - * @returns {Object.} JSON object - */ - FieldOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FieldOptions - * @function getTypeUrl - * @memberof google.protobuf.FieldOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FieldOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FieldOptions"; - }; - - /** - * CType enum. - * @name google.protobuf.FieldOptions.CType - * @enum {number} - * @property {number} STRING=0 STRING value - * @property {number} CORD=1 CORD value - * @property {number} STRING_PIECE=2 STRING_PIECE value - */ - FieldOptions.CType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STRING"] = 0; - values[valuesById[1] = "CORD"] = 1; - values[valuesById[2] = "STRING_PIECE"] = 2; - return values; - })(); - - /** - * JSType enum. - * @name google.protobuf.FieldOptions.JSType - * @enum {number} - * @property {number} JS_NORMAL=0 JS_NORMAL value - * @property {number} JS_STRING=1 JS_STRING value - * @property {number} JS_NUMBER=2 JS_NUMBER value - */ - FieldOptions.JSType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "JS_NORMAL"] = 0; - values[valuesById[1] = "JS_STRING"] = 1; - values[valuesById[2] = "JS_NUMBER"] = 2; - return values; - })(); - - /** - * OptionRetention enum. - * @name google.protobuf.FieldOptions.OptionRetention - * @enum {number} - * @property {number} RETENTION_UNKNOWN=0 RETENTION_UNKNOWN value - * @property {number} RETENTION_RUNTIME=1 RETENTION_RUNTIME value - * @property {number} RETENTION_SOURCE=2 RETENTION_SOURCE value - */ - FieldOptions.OptionRetention = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "RETENTION_UNKNOWN"] = 0; - values[valuesById[1] = "RETENTION_RUNTIME"] = 1; - values[valuesById[2] = "RETENTION_SOURCE"] = 2; - return values; - })(); - - /** - * OptionTargetType enum. - * @name google.protobuf.FieldOptions.OptionTargetType - * @enum {number} - * @property {number} TARGET_TYPE_UNKNOWN=0 TARGET_TYPE_UNKNOWN value - * @property {number} TARGET_TYPE_FILE=1 TARGET_TYPE_FILE value - * @property {number} TARGET_TYPE_EXTENSION_RANGE=2 TARGET_TYPE_EXTENSION_RANGE value - * @property {number} TARGET_TYPE_MESSAGE=3 TARGET_TYPE_MESSAGE value - * @property {number} TARGET_TYPE_FIELD=4 TARGET_TYPE_FIELD value - * @property {number} TARGET_TYPE_ONEOF=5 TARGET_TYPE_ONEOF value - * @property {number} TARGET_TYPE_ENUM=6 TARGET_TYPE_ENUM value - * @property {number} TARGET_TYPE_ENUM_ENTRY=7 TARGET_TYPE_ENUM_ENTRY value - * @property {number} TARGET_TYPE_SERVICE=8 TARGET_TYPE_SERVICE value - * @property {number} TARGET_TYPE_METHOD=9 TARGET_TYPE_METHOD value - */ - FieldOptions.OptionTargetType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TARGET_TYPE_UNKNOWN"] = 0; - values[valuesById[1] = "TARGET_TYPE_FILE"] = 1; - values[valuesById[2] = "TARGET_TYPE_EXTENSION_RANGE"] = 2; - values[valuesById[3] = "TARGET_TYPE_MESSAGE"] = 3; - values[valuesById[4] = "TARGET_TYPE_FIELD"] = 4; - values[valuesById[5] = "TARGET_TYPE_ONEOF"] = 5; - values[valuesById[6] = "TARGET_TYPE_ENUM"] = 6; - values[valuesById[7] = "TARGET_TYPE_ENUM_ENTRY"] = 7; - values[valuesById[8] = "TARGET_TYPE_SERVICE"] = 8; - values[valuesById[9] = "TARGET_TYPE_METHOD"] = 9; - return values; - })(); - - FieldOptions.EditionDefault = (function() { - - /** - * Properties of an EditionDefault. - * @memberof google.protobuf.FieldOptions - * @interface IEditionDefault - * @property {google.protobuf.Edition|null} [edition] EditionDefault edition - * @property {string|null} [value] EditionDefault value - */ - - /** - * Constructs a new EditionDefault. - * @memberof google.protobuf.FieldOptions - * @classdesc Represents an EditionDefault. - * @implements IEditionDefault - * @constructor - * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set - */ - function EditionDefault(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EditionDefault edition. - * @member {google.protobuf.Edition} edition - * @memberof google.protobuf.FieldOptions.EditionDefault - * @instance - */ - EditionDefault.prototype.edition = 0; - - /** - * EditionDefault value. - * @member {string} value - * @memberof google.protobuf.FieldOptions.EditionDefault - * @instance - */ - EditionDefault.prototype.value = ""; - - /** - * Creates a new EditionDefault instance using the specified properties. - * @function create - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set - * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault instance - */ - EditionDefault.create = function create(properties) { - return new EditionDefault(properties); - }; - - /** - * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EditionDefault.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); - if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); - return writer; - }; - - /** - * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EditionDefault.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EditionDefault message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EditionDefault.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions.EditionDefault(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 3: { - message.edition = reader.int32(); - break; - } - case 2: { - message.value = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EditionDefault message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EditionDefault.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EditionDefault message. - * @function verify - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EditionDefault.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.edition != null && message.hasOwnProperty("edition")) - switch (message.edition) { - default: - return "edition: enum value expected"; - case 0: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isString(message.value)) - return "value: string expected"; - return null; - }; - - /** - * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault - */ - EditionDefault.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldOptions.EditionDefault) - return object; - var message = new $root.google.protobuf.FieldOptions.EditionDefault(); - switch (object.edition) { - default: - if (typeof object.edition === "number") { - message.edition = object.edition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.edition = 0; - break; - case "EDITION_PROTO2": - case 998: - message.edition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.edition = 999; - break; - case "EDITION_2023": - case 1000: - message.edition = 1000; - break; - case "EDITION_2024": - case 1001: - message.edition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.edition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.edition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.edition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.edition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.edition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.edition = 2147483647; - break; - } - if (object.value != null) - message.value = String(object.value); - return message; - }; - - /** - * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {google.protobuf.FieldOptions.EditionDefault} message EditionDefault - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EditionDefault.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.value = ""; - object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; - } - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - if (message.edition != null && message.hasOwnProperty("edition")) - object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; - return object; - }; - - /** - * Converts this EditionDefault to JSON. - * @function toJSON - * @memberof google.protobuf.FieldOptions.EditionDefault - * @instance - * @returns {Object.} JSON object - */ - EditionDefault.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EditionDefault - * @function getTypeUrl - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FieldOptions.EditionDefault"; - }; - - return EditionDefault; - })(); - - return FieldOptions; - })(); - - protobuf.OneofOptions = (function() { - - /** - * Properties of an OneofOptions. - * @memberof google.protobuf - * @interface IOneofOptions - * @property {google.protobuf.IFeatureSet|null} [features] OneofOptions features - * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption - */ - - /** - * Constructs a new OneofOptions. - * @memberof google.protobuf - * @classdesc Represents an OneofOptions. - * @implements IOneofOptions - * @constructor - * @param {google.protobuf.IOneofOptions=} [properties] Properties to set - */ - function OneofOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * OneofOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.OneofOptions - * @instance - */ - OneofOptions.prototype.features = null; - - /** - * OneofOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.OneofOptions - * @instance - */ - OneofOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * Creates a new OneofOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.IOneofOptions=} [properties] Properties to set - * @returns {google.protobuf.OneofOptions} OneofOptions instance - */ - OneofOptions.create = function create(properties) { - return new OneofOptions(properties); - }; - - /** - * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OneofOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.OneofOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.OneofOptions} OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OneofOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.OneofOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.OneofOptions} OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OneofOptions message. - * @function verify - * @memberof google.protobuf.OneofOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OneofOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - return null; - }; - - /** - * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.OneofOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.OneofOptions} OneofOptions - */ - OneofOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.OneofOptions) - return object; - var message = new $root.google.protobuf.OneofOptions(); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.OneofOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.OneofOptions} message OneofOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OneofOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) - object.features = null; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; - - /** - * Converts this OneofOptions to JSON. - * @function toJSON - * @memberof google.protobuf.OneofOptions - * @instance - * @returns {Object.} JSON object - */ - OneofOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OneofOptions - * @function getTypeUrl - * @memberof google.protobuf.OneofOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OneofOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.OneofOptions"; - }; - - return OneofOptions; - })(); - - protobuf.EnumOptions = (function() { - - /** - * Properties of an EnumOptions. - * @memberof google.protobuf - * @interface IEnumOptions - * @property {boolean|null} [allowAlias] EnumOptions allowAlias - * @property {boolean|null} [deprecated] EnumOptions deprecated - * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] EnumOptions deprecatedLegacyJsonFieldConflicts - * @property {google.protobuf.IFeatureSet|null} [features] EnumOptions features - * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption - */ - - /** - * Constructs a new EnumOptions. - * @memberof google.protobuf - * @classdesc Represents an EnumOptions. - * @implements IEnumOptions - * @constructor - * @param {google.protobuf.IEnumOptions=} [properties] Properties to set - */ - function EnumOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumOptions allowAlias. - * @member {boolean} allowAlias - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.allowAlias = false; - - /** - * EnumOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.deprecated = false; - - /** - * EnumOptions deprecatedLegacyJsonFieldConflicts. - * @member {boolean} deprecatedLegacyJsonFieldConflicts - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; - - /** - * EnumOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.features = null; - - /** - * EnumOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * Creates a new EnumOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.IEnumOptions=} [properties] Properties to set - * @returns {google.protobuf.EnumOptions} EnumOptions instance - */ - EnumOptions.create = function create(properties) { - return new EnumOptions(properties); - }; - - /** - * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.deprecatedLegacyJsonFieldConflicts); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumOptions} EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - message.allowAlias = reader.bool(); - break; - } - case 3: { - message.deprecated = reader.bool(); - break; - } - case 6: { - message.deprecatedLegacyJsonFieldConflicts = reader.bool(); - break; - } - case 7: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumOptions} EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumOptions message. - * @function verify - * @memberof google.protobuf.EnumOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) - if (typeof message.allowAlias !== "boolean") - return "allowAlias: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) - if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") - return "deprecatedLegacyJsonFieldConflicts: boolean expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - return null; - }; - - /** - * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumOptions} EnumOptions - */ - EnumOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumOptions) - return object; - var message = new $root.google.protobuf.EnumOptions(); - if (object.allowAlias != null) - message.allowAlias = Boolean(object.allowAlias); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.deprecatedLegacyJsonFieldConflicts != null) - message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.EnumOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.EnumOptions} message EnumOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) { - object.allowAlias = false; - object.deprecated = false; - object.deprecatedLegacyJsonFieldConflicts = false; - object.features = null; - } - if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) - object.allowAlias = message.allowAlias; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) - object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; - - /** - * Converts this EnumOptions to JSON. - * @function toJSON - * @memberof google.protobuf.EnumOptions - * @instance - * @returns {Object.} JSON object - */ - EnumOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumOptions - * @function getTypeUrl - * @memberof google.protobuf.EnumOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumOptions"; - }; - - return EnumOptions; - })(); - - protobuf.EnumValueOptions = (function() { - - /** - * Properties of an EnumValueOptions. - * @memberof google.protobuf - * @interface IEnumValueOptions - * @property {boolean|null} [deprecated] EnumValueOptions deprecated - * @property {google.protobuf.IFeatureSet|null} [features] EnumValueOptions features - * @property {boolean|null} [debugRedact] EnumValueOptions debugRedact - * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption - */ - - /** - * Constructs a new EnumValueOptions. - * @memberof google.protobuf - * @classdesc Represents an EnumValueOptions. - * @implements IEnumValueOptions - * @constructor - * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set - */ - function EnumValueOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumValueOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.deprecated = false; - - /** - * EnumValueOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.features = null; - - /** - * EnumValueOptions debugRedact. - * @member {boolean} debugRedact - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.debugRedact = false; - - /** - * EnumValueOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * Creates a new EnumValueOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance - */ - EnumValueOptions.create = function create(properties) { - return new EnumValueOptions(properties); - }; - - /** - * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.debugRedact); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumValueOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.deprecated = reader.bool(); - break; - } - case 2: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 3: { - message.debugRedact = reader.bool(); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumValueOptions message. - * @function verify - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumValueOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) - if (typeof message.debugRedact !== "boolean") - return "debugRedact: boolean expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - return null; - }; - - /** - * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions - */ - EnumValueOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumValueOptions) - return object; - var message = new $root.google.protobuf.EnumValueOptions(); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.EnumValueOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.debugRedact != null) - message.debugRedact = Boolean(object.debugRedact); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.EnumValueOptions} message EnumValueOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumValueOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) { - object.deprecated = false; - object.features = null; - object.debugRedact = false; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) - object.debugRedact = message.debugRedact; - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; - - /** - * Converts this EnumValueOptions to JSON. - * @function toJSON - * @memberof google.protobuf.EnumValueOptions - * @instance - * @returns {Object.} JSON object - */ - EnumValueOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumValueOptions - * @function getTypeUrl - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumValueOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumValueOptions"; - }; - - return EnumValueOptions; - })(); - - protobuf.ServiceOptions = (function() { - - /** - * Properties of a ServiceOptions. - * @memberof google.protobuf - * @interface IServiceOptions - * @property {google.protobuf.IFeatureSet|null} [features] ServiceOptions features - * @property {boolean|null} [deprecated] ServiceOptions deprecated - * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption - * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost - * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes - * @property {string|null} [".google.api.apiVersion"] ServiceOptions .google.api.apiVersion - */ - - /** - * Constructs a new ServiceOptions. - * @memberof google.protobuf - * @classdesc Represents a ServiceOptions. - * @implements IServiceOptions - * @constructor - * @param {google.protobuf.IServiceOptions=} [properties] Properties to set - */ - function ServiceOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ServiceOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype.features = null; - - /** - * ServiceOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype.deprecated = false; - - /** - * ServiceOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * ServiceOptions .google.api.defaultHost. - * @member {string} .google.api.defaultHost - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype[".google.api.defaultHost"] = ""; - - /** - * ServiceOptions .google.api.oauthScopes. - * @member {string} .google.api.oauthScopes - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype[".google.api.oauthScopes"] = ""; - - /** - * ServiceOptions .google.api.apiVersion. - * @member {string} .google.api.apiVersion - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype[".google.api.apiVersion"] = ""; - - /** - * Creates a new ServiceOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.IServiceOptions=} [properties] Properties to set - * @returns {google.protobuf.ServiceOptions} ServiceOptions instance - */ - ServiceOptions.create = function create(properties) { - return new ServiceOptions(properties); - }; - - /** - * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 34, wireType 2 =*/274).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) - writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); - if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) - writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); - if (message[".google.api.apiVersion"] != null && Object.hasOwnProperty.call(message, ".google.api.apiVersion")) - writer.uint32(/* id 525000001, wireType 2 =*/4200000010).string(message[".google.api.apiVersion"]); - return writer; - }; - - /** - * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ServiceOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ServiceOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ServiceOptions} ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 34: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 33: { - message.deprecated = reader.bool(); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 1049: { - message[".google.api.defaultHost"] = reader.string(); - break; - } - case 1050: { - message[".google.api.oauthScopes"] = reader.string(); - break; - } - case 525000001: { - message[".google.api.apiVersion"] = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ServiceOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ServiceOptions} ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ServiceOptions message. - * @function verify - * @memberof google.protobuf.ServiceOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ServiceOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) - if (!$util.isString(message[".google.api.defaultHost"])) - return ".google.api.defaultHost: string expected"; - if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) - if (!$util.isString(message[".google.api.oauthScopes"])) - return ".google.api.oauthScopes: string expected"; - if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) - if (!$util.isString(message[".google.api.apiVersion"])) - return ".google.api.apiVersion: string expected"; - return null; - }; - - /** - * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ServiceOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ServiceOptions} ServiceOptions - */ - ServiceOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ServiceOptions) - return object; - var message = new $root.google.protobuf.ServiceOptions(); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.ServiceOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".google.api.defaultHost"] != null) - message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); - if (object[".google.api.oauthScopes"] != null) - message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); - if (object[".google.api.apiVersion"] != null) - message[".google.api.apiVersion"] = String(object[".google.api.apiVersion"]); - return message; - }; - - /** - * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.ServiceOptions} message ServiceOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ServiceOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) { - object.deprecated = false; - object.features = null; - object[".google.api.defaultHost"] = ""; - object[".google.api.oauthScopes"] = ""; - object[".google.api.apiVersion"] = ""; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) - object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; - if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) - object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; - if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) - object[".google.api.apiVersion"] = message[".google.api.apiVersion"]; - return object; - }; - - /** - * Converts this ServiceOptions to JSON. - * @function toJSON - * @memberof google.protobuf.ServiceOptions - * @instance - * @returns {Object.} JSON object - */ - ServiceOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ServiceOptions - * @function getTypeUrl - * @memberof google.protobuf.ServiceOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.ServiceOptions"; - }; - - return ServiceOptions; - })(); - - protobuf.MethodOptions = (function() { - - /** - * Properties of a MethodOptions. - * @memberof google.protobuf - * @interface IMethodOptions - * @property {boolean|null} [deprecated] MethodOptions deprecated - * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel - * @property {google.protobuf.IFeatureSet|null} [features] MethodOptions features - * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption - * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http - * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature - * @property {google.longrunning.IOperationInfo|null} [".google.longrunning.operationInfo"] MethodOptions .google.longrunning.operationInfo - */ - - /** - * Constructs a new MethodOptions. - * @memberof google.protobuf - * @classdesc Represents a MethodOptions. - * @implements IMethodOptions - * @constructor - * @param {google.protobuf.IMethodOptions=} [properties] Properties to set - */ - function MethodOptions(properties) { - this.uninterpretedOption = []; - this[".google.api.methodSignature"] = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MethodOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype.deprecated = false; - - /** - * MethodOptions idempotencyLevel. - * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype.idempotencyLevel = 0; - - /** - * MethodOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype.features = null; - - /** - * MethodOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * MethodOptions .google.api.http. - * @member {google.api.IHttpRule|null|undefined} .google.api.http - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype[".google.api.http"] = null; - - /** - * MethodOptions .google.api.methodSignature. - * @member {Array.} .google.api.methodSignature - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; - - /** - * MethodOptions .google.longrunning.operationInfo. - * @member {google.longrunning.IOperationInfo|null|undefined} .google.longrunning.operationInfo - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype[".google.longrunning.operationInfo"] = null; - - /** - * Creates a new MethodOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.MethodOptions - * @static - * @param {google.protobuf.IMethodOptions=} [properties] Properties to set - * @returns {google.protobuf.MethodOptions} MethodOptions instance - */ - MethodOptions.create = function create(properties) { - return new MethodOptions(properties); - }; - - /** - * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.MethodOptions - * @static - * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); - if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel")) - writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 35, wireType 2 =*/282).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.longrunning.operationInfo"] != null && Object.hasOwnProperty.call(message, ".google.longrunning.operationInfo")) - $root.google.longrunning.OperationInfo.encode(message[".google.longrunning.operationInfo"], writer.uint32(/* id 1049, wireType 2 =*/8394).fork()).ldelim(); - if (message[".google.api.methodSignature"] != null && message[".google.api.methodSignature"].length) - for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) - writer.uint32(/* id 1051, wireType 2 =*/8410).string(message[".google.api.methodSignature"][i]); - if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http")) - $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.MethodOptions - * @static - * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MethodOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.MethodOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.MethodOptions} MethodOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 33: { - message.deprecated = reader.bool(); - break; - } - case 34: { - message.idempotencyLevel = reader.int32(); - break; - } - case 35: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 72295728: { - message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); - break; - } - case 1051: { - if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) - message[".google.api.methodSignature"] = []; - message[".google.api.methodSignature"].push(reader.string()); - break; - } - case 1049: { - message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MethodOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.MethodOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.MethodOptions} MethodOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MethodOptions message. - * @function verify - * @memberof google.protobuf.MethodOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MethodOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) - switch (message.idempotencyLevel) { - default: - return "idempotencyLevel: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) { - var error = $root.google.api.HttpRule.verify(message[".google.api.http"]); - if (error) - return ".google.api.http." + error; - } - if (message[".google.api.methodSignature"] != null && message.hasOwnProperty(".google.api.methodSignature")) { - if (!Array.isArray(message[".google.api.methodSignature"])) - return ".google.api.methodSignature: array expected"; - for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) - if (!$util.isString(message[".google.api.methodSignature"][i])) - return ".google.api.methodSignature: string[] expected"; - } - if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) { - var error = $root.google.longrunning.OperationInfo.verify(message[".google.longrunning.operationInfo"]); - if (error) - return ".google.longrunning.operationInfo." + error; - } - return null; - }; - - /** - * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.MethodOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.MethodOptions} MethodOptions - */ - MethodOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.MethodOptions) - return object; - var message = new $root.google.protobuf.MethodOptions(); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - switch (object.idempotencyLevel) { - default: - if (typeof object.idempotencyLevel === "number") { - message.idempotencyLevel = object.idempotencyLevel; - break; - } - break; - case "IDEMPOTENCY_UNKNOWN": - case 0: - message.idempotencyLevel = 0; - break; - case "NO_SIDE_EFFECTS": - case 1: - message.idempotencyLevel = 1; - break; - case "IDEMPOTENT": - case 2: - message.idempotencyLevel = 2; - break; - } - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.MethodOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".google.api.http"] != null) { - if (typeof object[".google.api.http"] !== "object") - throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected"); - message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"]); - } - if (object[".google.api.methodSignature"]) { - if (!Array.isArray(object[".google.api.methodSignature"])) - throw TypeError(".google.protobuf.MethodOptions..google.api.methodSignature: array expected"); - message[".google.api.methodSignature"] = []; - for (var i = 0; i < object[".google.api.methodSignature"].length; ++i) - message[".google.api.methodSignature"][i] = String(object[".google.api.methodSignature"][i]); - } - if (object[".google.longrunning.operationInfo"] != null) { - if (typeof object[".google.longrunning.operationInfo"] !== "object") - throw TypeError(".google.protobuf.MethodOptions..google.longrunning.operationInfo: object expected"); - message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.fromObject(object[".google.longrunning.operationInfo"]); - } - return message; - }; - - /** - * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.MethodOptions - * @static - * @param {google.protobuf.MethodOptions} message MethodOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MethodOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.uninterpretedOption = []; - object[".google.api.methodSignature"] = []; - } - if (options.defaults) { - object.deprecated = false; - object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0; - object.features = null; - object[".google.longrunning.operationInfo"] = null; - object[".google.api.http"] = null; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) - object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] === undefined ? message.idempotencyLevel : $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) - object[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.toObject(message[".google.longrunning.operationInfo"], options); - if (message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length) { - object[".google.api.methodSignature"] = []; - for (var j = 0; j < message[".google.api.methodSignature"].length; ++j) - object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j]; - } - if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) - object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); - return object; - }; - - /** - * Converts this MethodOptions to JSON. - * @function toJSON - * @memberof google.protobuf.MethodOptions - * @instance - * @returns {Object.} JSON object - */ - MethodOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MethodOptions - * @function getTypeUrl - * @memberof google.protobuf.MethodOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MethodOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.MethodOptions"; - }; - - /** - * IdempotencyLevel enum. - * @name google.protobuf.MethodOptions.IdempotencyLevel - * @enum {number} - * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value - * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value - * @property {number} IDEMPOTENT=2 IDEMPOTENT value - */ - MethodOptions.IdempotencyLevel = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0; - values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1; - values[valuesById[2] = "IDEMPOTENT"] = 2; - return values; - })(); - - return MethodOptions; - })(); - - protobuf.UninterpretedOption = (function() { - - /** - * Properties of an UninterpretedOption. - * @memberof google.protobuf - * @interface IUninterpretedOption - * @property {Array.|null} [name] UninterpretedOption name - * @property {string|null} [identifierValue] UninterpretedOption identifierValue - * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue - * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue - * @property {number|null} [doubleValue] UninterpretedOption doubleValue - * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue - * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue - */ - - /** - * Constructs a new UninterpretedOption. - * @memberof google.protobuf - * @classdesc Represents an UninterpretedOption. - * @implements IUninterpretedOption - * @constructor - * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set - */ - function UninterpretedOption(properties) { - this.name = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UninterpretedOption name. - * @member {Array.} name - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.name = $util.emptyArray; - - /** - * UninterpretedOption identifierValue. - * @member {string} identifierValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.identifierValue = ""; - - /** - * UninterpretedOption positiveIntValue. - * @member {number|Long} positiveIntValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * UninterpretedOption negativeIntValue. - * @member {number|Long} negativeIntValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * UninterpretedOption doubleValue. - * @member {number} doubleValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.doubleValue = 0; - - /** - * UninterpretedOption stringValue. - * @member {Uint8Array} stringValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.stringValue = $util.newBuffer([]); - - /** - * UninterpretedOption aggregateValue. - * @member {string} aggregateValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.aggregateValue = ""; - - /** - * Creates a new UninterpretedOption instance using the specified properties. - * @function create - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance - */ - UninterpretedOption.create = function create(properties) { - return new UninterpretedOption(properties); - }; - - /** - * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @function encode - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UninterpretedOption.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && message.name.length) - for (var i = 0; i < message.name.length; ++i) - $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); - if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) - writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); - if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) - writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); - if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) - writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); - if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) - writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); - if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); - return writer; - }; - - /** - * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UninterpretedOption.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - if (!(message.name && message.name.length)) - message.name = []; - message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); - break; - } - case 3: { - message.identifierValue = reader.string(); - break; - } - case 4: { - message.positiveIntValue = reader.uint64(); - break; - } - case 5: { - message.negativeIntValue = reader.int64(); - break; - } - case 6: { - message.doubleValue = reader.double(); - break; - } - case 7: { - message.stringValue = reader.bytes(); - break; - } - case 8: { - message.aggregateValue = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UninterpretedOption message. - * @function verify - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UninterpretedOption.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) { - if (!Array.isArray(message.name)) - return "name: array expected"; - for (var i = 0; i < message.name.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]); - if (error) - return "name." + error; - } - } - if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) - if (!$util.isString(message.identifierValue)) - return "identifierValue: string expected"; - if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) - if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high))) - return "positiveIntValue: integer|Long expected"; - if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) - if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high))) - return "negativeIntValue: integer|Long expected"; - if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) - if (typeof message.doubleValue !== "number") - return "doubleValue: number expected"; - if (message.stringValue != null && message.hasOwnProperty("stringValue")) - if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue))) - return "stringValue: buffer expected"; - if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) - if (!$util.isString(message.aggregateValue)) - return "aggregateValue: string expected"; - return null; - }; - - /** - * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption - */ - UninterpretedOption.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.UninterpretedOption) - return object; - var message = new $root.google.protobuf.UninterpretedOption(); - if (object.name) { - if (!Array.isArray(object.name)) - throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); - message.name = []; - for (var i = 0; i < object.name.length; ++i) { - if (typeof object.name[i] !== "object") - throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); - message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); - } - } - if (object.identifierValue != null) - message.identifierValue = String(object.identifierValue); - if (object.positiveIntValue != null) - if ($util.Long) - (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; - else if (typeof object.positiveIntValue === "string") - message.positiveIntValue = parseInt(object.positiveIntValue, 10); - else if (typeof object.positiveIntValue === "number") - message.positiveIntValue = object.positiveIntValue; - else if (typeof object.positiveIntValue === "object") - message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); - if (object.negativeIntValue != null) - if ($util.Long) - (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false; - else if (typeof object.negativeIntValue === "string") - message.negativeIntValue = parseInt(object.negativeIntValue, 10); - else if (typeof object.negativeIntValue === "number") - message.negativeIntValue = object.negativeIntValue; - else if (typeof object.negativeIntValue === "object") - message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); - if (object.doubleValue != null) - message.doubleValue = Number(object.doubleValue); - if (object.stringValue != null) - if (typeof object.stringValue === "string") - $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); - else if (object.stringValue.length >= 0) - message.stringValue = object.stringValue; - if (object.aggregateValue != null) - message.aggregateValue = String(object.aggregateValue); - return message; - }; - - /** - * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.UninterpretedOption} message UninterpretedOption - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UninterpretedOption.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.name = []; - if (options.defaults) { - object.identifierValue = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.positiveIntValue = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.negativeIntValue = options.longs === String ? "0" : 0; - object.doubleValue = 0; - if (options.bytes === String) - object.stringValue = ""; - else { - object.stringValue = []; - if (options.bytes !== Array) - object.stringValue = $util.newBuffer(object.stringValue); - } - object.aggregateValue = ""; - } - if (message.name && message.name.length) { - object.name = []; - for (var j = 0; j < message.name.length; ++j) - object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); - } - if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) - object.identifierValue = message.identifierValue; - if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) - if (typeof message.positiveIntValue === "number") - object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue; - else - object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue; - if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) - if (typeof message.negativeIntValue === "number") - object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue; - else - object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue; - if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) - object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; - if (message.stringValue != null && message.hasOwnProperty("stringValue")) - object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue; - if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) - object.aggregateValue = message.aggregateValue; - return object; - }; - - /** - * Converts this UninterpretedOption to JSON. - * @function toJSON - * @memberof google.protobuf.UninterpretedOption - * @instance - * @returns {Object.} JSON object - */ - UninterpretedOption.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UninterpretedOption - * @function getTypeUrl - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UninterpretedOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.UninterpretedOption"; - }; - - UninterpretedOption.NamePart = (function() { - - /** - * Properties of a NamePart. - * @memberof google.protobuf.UninterpretedOption - * @interface INamePart - * @property {string} namePart NamePart namePart - * @property {boolean} isExtension NamePart isExtension - */ - - /** - * Constructs a new NamePart. - * @memberof google.protobuf.UninterpretedOption - * @classdesc Represents a NamePart. - * @implements INamePart - * @constructor - * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set - */ - function NamePart(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * NamePart namePart. - * @member {string} namePart - * @memberof google.protobuf.UninterpretedOption.NamePart - * @instance - */ - NamePart.prototype.namePart = ""; - - /** - * NamePart isExtension. - * @member {boolean} isExtension - * @memberof google.protobuf.UninterpretedOption.NamePart - * @instance - */ - NamePart.prototype.isExtension = false; - - /** - * Creates a new NamePart instance using the specified properties. - * @function create - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance - */ - NamePart.create = function create(properties) { - return new NamePart(properties); - }; - - /** - * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @function encode - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NamePart.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart); - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension); - return writer; - }; - - /** - * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NamePart.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a NamePart message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NamePart.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.namePart = reader.string(); - break; - } - case 2: { - message.isExtension = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - if (!message.hasOwnProperty("namePart")) - throw $util.ProtocolError("missing required 'namePart'", { instance: message }); - if (!message.hasOwnProperty("isExtension")) - throw $util.ProtocolError("missing required 'isExtension'", { instance: message }); - return message; - }; - - /** - * Decodes a NamePart message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NamePart.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a NamePart message. - * @function verify - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - NamePart.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (!$util.isString(message.namePart)) - return "namePart: string expected"; - if (typeof message.isExtension !== "boolean") - return "isExtension: boolean expected"; - return null; - }; - - /** - * Creates a NamePart message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart - */ - NamePart.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) - return object; - var message = new $root.google.protobuf.UninterpretedOption.NamePart(); - if (object.namePart != null) - message.namePart = String(object.namePart); - if (object.isExtension != null) - message.isExtension = Boolean(object.isExtension); - return message; - }; - - /** - * Creates a plain object from a NamePart message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - NamePart.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.namePart = ""; - object.isExtension = false; - } - if (message.namePart != null && message.hasOwnProperty("namePart")) - object.namePart = message.namePart; - if (message.isExtension != null && message.hasOwnProperty("isExtension")) - object.isExtension = message.isExtension; - return object; - }; - - /** - * Converts this NamePart to JSON. - * @function toJSON - * @memberof google.protobuf.UninterpretedOption.NamePart - * @instance - * @returns {Object.} JSON object - */ - NamePart.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for NamePart - * @function getTypeUrl - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - NamePart.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.UninterpretedOption.NamePart"; - }; - - return NamePart; - })(); - - return UninterpretedOption; - })(); - - protobuf.FeatureSet = (function() { - - /** - * Properties of a FeatureSet. - * @memberof google.protobuf - * @interface IFeatureSet - * @property {google.protobuf.FeatureSet.FieldPresence|null} [fieldPresence] FeatureSet fieldPresence - * @property {google.protobuf.FeatureSet.EnumType|null} [enumType] FeatureSet enumType - * @property {google.protobuf.FeatureSet.RepeatedFieldEncoding|null} [repeatedFieldEncoding] FeatureSet repeatedFieldEncoding - * @property {google.protobuf.FeatureSet.Utf8Validation|null} [utf8Validation] FeatureSet utf8Validation - * @property {google.protobuf.FeatureSet.MessageEncoding|null} [messageEncoding] FeatureSet messageEncoding - * @property {google.protobuf.FeatureSet.JsonFormat|null} [jsonFormat] FeatureSet jsonFormat - */ - - /** - * Constructs a new FeatureSet. - * @memberof google.protobuf - * @classdesc Represents a FeatureSet. - * @implements IFeatureSet - * @constructor - * @param {google.protobuf.IFeatureSet=} [properties] Properties to set - */ - function FeatureSet(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FeatureSet fieldPresence. - * @member {google.protobuf.FeatureSet.FieldPresence} fieldPresence - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.fieldPresence = 0; - - /** - * FeatureSet enumType. - * @member {google.protobuf.FeatureSet.EnumType} enumType - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.enumType = 0; - - /** - * FeatureSet repeatedFieldEncoding. - * @member {google.protobuf.FeatureSet.RepeatedFieldEncoding} repeatedFieldEncoding - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.repeatedFieldEncoding = 0; - - /** - * FeatureSet utf8Validation. - * @member {google.protobuf.FeatureSet.Utf8Validation} utf8Validation - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.utf8Validation = 0; - - /** - * FeatureSet messageEncoding. - * @member {google.protobuf.FeatureSet.MessageEncoding} messageEncoding - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.messageEncoding = 0; - - /** - * FeatureSet jsonFormat. - * @member {google.protobuf.FeatureSet.JsonFormat} jsonFormat - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.jsonFormat = 0; - - /** - * Creates a new FeatureSet instance using the specified properties. - * @function create - * @memberof google.protobuf.FeatureSet - * @static - * @param {google.protobuf.IFeatureSet=} [properties] Properties to set - * @returns {google.protobuf.FeatureSet} FeatureSet instance - */ - FeatureSet.create = function create(properties) { - return new FeatureSet(properties); - }; - - /** - * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FeatureSet - * @static - * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSet.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.fieldPresence != null && Object.hasOwnProperty.call(message, "fieldPresence")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.fieldPresence); - if (message.enumType != null && Object.hasOwnProperty.call(message, "enumType")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.enumType); - if (message.repeatedFieldEncoding != null && Object.hasOwnProperty.call(message, "repeatedFieldEncoding")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.repeatedFieldEncoding); - if (message.utf8Validation != null && Object.hasOwnProperty.call(message, "utf8Validation")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.utf8Validation); - if (message.messageEncoding != null && Object.hasOwnProperty.call(message, "messageEncoding")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.messageEncoding); - if (message.jsonFormat != null && Object.hasOwnProperty.call(message, "jsonFormat")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jsonFormat); - return writer; - }; - - /** - * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FeatureSet - * @static - * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSet.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FeatureSet message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FeatureSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FeatureSet} FeatureSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSet.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSet(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.fieldPresence = reader.int32(); - break; - } - case 2: { - message.enumType = reader.int32(); - break; - } - case 3: { - message.repeatedFieldEncoding = reader.int32(); - break; - } - case 4: { - message.utf8Validation = reader.int32(); - break; - } - case 5: { - message.messageEncoding = reader.int32(); - break; - } - case 6: { - message.jsonFormat = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FeatureSet message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FeatureSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FeatureSet} FeatureSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSet.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FeatureSet message. - * @function verify - * @memberof google.protobuf.FeatureSet - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FeatureSet.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) - switch (message.fieldPresence) { - default: - return "fieldPresence: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.enumType != null && message.hasOwnProperty("enumType")) - switch (message.enumType) { - default: - return "enumType: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) - switch (message.repeatedFieldEncoding) { - default: - return "repeatedFieldEncoding: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) - switch (message.utf8Validation) { - default: - return "utf8Validation: enum value expected"; - case 0: - case 2: - case 3: - break; - } - if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) - switch (message.messageEncoding) { - default: - return "messageEncoding: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) - switch (message.jsonFormat) { - default: - return "jsonFormat: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FeatureSet - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FeatureSet} FeatureSet - */ - FeatureSet.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FeatureSet) - return object; - var message = new $root.google.protobuf.FeatureSet(); - switch (object.fieldPresence) { - default: - if (typeof object.fieldPresence === "number") { - message.fieldPresence = object.fieldPresence; - break; - } - break; - case "FIELD_PRESENCE_UNKNOWN": - case 0: - message.fieldPresence = 0; - break; - case "EXPLICIT": - case 1: - message.fieldPresence = 1; - break; - case "IMPLICIT": - case 2: - message.fieldPresence = 2; - break; - case "LEGACY_REQUIRED": - case 3: - message.fieldPresence = 3; - break; - } - switch (object.enumType) { - default: - if (typeof object.enumType === "number") { - message.enumType = object.enumType; - break; - } - break; - case "ENUM_TYPE_UNKNOWN": - case 0: - message.enumType = 0; - break; - case "OPEN": - case 1: - message.enumType = 1; - break; - case "CLOSED": - case 2: - message.enumType = 2; - break; - } - switch (object.repeatedFieldEncoding) { - default: - if (typeof object.repeatedFieldEncoding === "number") { - message.repeatedFieldEncoding = object.repeatedFieldEncoding; - break; - } - break; - case "REPEATED_FIELD_ENCODING_UNKNOWN": - case 0: - message.repeatedFieldEncoding = 0; - break; - case "PACKED": - case 1: - message.repeatedFieldEncoding = 1; - break; - case "EXPANDED": - case 2: - message.repeatedFieldEncoding = 2; - break; - } - switch (object.utf8Validation) { - default: - if (typeof object.utf8Validation === "number") { - message.utf8Validation = object.utf8Validation; - break; - } - break; - case "UTF8_VALIDATION_UNKNOWN": - case 0: - message.utf8Validation = 0; - break; - case "VERIFY": - case 2: - message.utf8Validation = 2; - break; - case "NONE": - case 3: - message.utf8Validation = 3; - break; - } - switch (object.messageEncoding) { - default: - if (typeof object.messageEncoding === "number") { - message.messageEncoding = object.messageEncoding; - break; - } - break; - case "MESSAGE_ENCODING_UNKNOWN": - case 0: - message.messageEncoding = 0; - break; - case "LENGTH_PREFIXED": - case 1: - message.messageEncoding = 1; - break; - case "DELIMITED": - case 2: - message.messageEncoding = 2; - break; - } - switch (object.jsonFormat) { - default: - if (typeof object.jsonFormat === "number") { - message.jsonFormat = object.jsonFormat; - break; - } - break; - case "JSON_FORMAT_UNKNOWN": - case 0: - message.jsonFormat = 0; - break; - case "ALLOW": - case 1: - message.jsonFormat = 1; - break; - case "LEGACY_BEST_EFFORT": - case 2: - message.jsonFormat = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FeatureSet - * @static - * @param {google.protobuf.FeatureSet} message FeatureSet - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FeatureSet.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.fieldPresence = options.enums === String ? "FIELD_PRESENCE_UNKNOWN" : 0; - object.enumType = options.enums === String ? "ENUM_TYPE_UNKNOWN" : 0; - object.repeatedFieldEncoding = options.enums === String ? "REPEATED_FIELD_ENCODING_UNKNOWN" : 0; - object.utf8Validation = options.enums === String ? "UTF8_VALIDATION_UNKNOWN" : 0; - object.messageEncoding = options.enums === String ? "MESSAGE_ENCODING_UNKNOWN" : 0; - object.jsonFormat = options.enums === String ? "JSON_FORMAT_UNKNOWN" : 0; - } - if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) - object.fieldPresence = options.enums === String ? $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] === undefined ? message.fieldPresence : $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] : message.fieldPresence; - if (message.enumType != null && message.hasOwnProperty("enumType")) - object.enumType = options.enums === String ? $root.google.protobuf.FeatureSet.EnumType[message.enumType] === undefined ? message.enumType : $root.google.protobuf.FeatureSet.EnumType[message.enumType] : message.enumType; - if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) - object.repeatedFieldEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] === undefined ? message.repeatedFieldEncoding : $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] : message.repeatedFieldEncoding; - if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) - object.utf8Validation = options.enums === String ? $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] === undefined ? message.utf8Validation : $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] : message.utf8Validation; - if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) - object.messageEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] === undefined ? message.messageEncoding : $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] : message.messageEncoding; - if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) - object.jsonFormat = options.enums === String ? $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] === undefined ? message.jsonFormat : $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] : message.jsonFormat; - return object; - }; - - /** - * Converts this FeatureSet to JSON. - * @function toJSON - * @memberof google.protobuf.FeatureSet - * @instance - * @returns {Object.} JSON object - */ - FeatureSet.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FeatureSet - * @function getTypeUrl - * @memberof google.protobuf.FeatureSet - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FeatureSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FeatureSet"; - }; - - /** - * FieldPresence enum. - * @name google.protobuf.FeatureSet.FieldPresence - * @enum {number} - * @property {number} FIELD_PRESENCE_UNKNOWN=0 FIELD_PRESENCE_UNKNOWN value - * @property {number} EXPLICIT=1 EXPLICIT value - * @property {number} IMPLICIT=2 IMPLICIT value - * @property {number} LEGACY_REQUIRED=3 LEGACY_REQUIRED value - */ - FeatureSet.FieldPresence = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "FIELD_PRESENCE_UNKNOWN"] = 0; - values[valuesById[1] = "EXPLICIT"] = 1; - values[valuesById[2] = "IMPLICIT"] = 2; - values[valuesById[3] = "LEGACY_REQUIRED"] = 3; - return values; - })(); - - /** - * EnumType enum. - * @name google.protobuf.FeatureSet.EnumType - * @enum {number} - * @property {number} ENUM_TYPE_UNKNOWN=0 ENUM_TYPE_UNKNOWN value - * @property {number} OPEN=1 OPEN value - * @property {number} CLOSED=2 CLOSED value - */ - FeatureSet.EnumType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ENUM_TYPE_UNKNOWN"] = 0; - values[valuesById[1] = "OPEN"] = 1; - values[valuesById[2] = "CLOSED"] = 2; - return values; - })(); - - /** - * RepeatedFieldEncoding enum. - * @name google.protobuf.FeatureSet.RepeatedFieldEncoding - * @enum {number} - * @property {number} REPEATED_FIELD_ENCODING_UNKNOWN=0 REPEATED_FIELD_ENCODING_UNKNOWN value - * @property {number} PACKED=1 PACKED value - * @property {number} EXPANDED=2 EXPANDED value - */ - FeatureSet.RepeatedFieldEncoding = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "REPEATED_FIELD_ENCODING_UNKNOWN"] = 0; - values[valuesById[1] = "PACKED"] = 1; - values[valuesById[2] = "EXPANDED"] = 2; - return values; - })(); - - /** - * Utf8Validation enum. - * @name google.protobuf.FeatureSet.Utf8Validation - * @enum {number} - * @property {number} UTF8_VALIDATION_UNKNOWN=0 UTF8_VALIDATION_UNKNOWN value - * @property {number} VERIFY=2 VERIFY value - * @property {number} NONE=3 NONE value - */ - FeatureSet.Utf8Validation = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "UTF8_VALIDATION_UNKNOWN"] = 0; - values[valuesById[2] = "VERIFY"] = 2; - values[valuesById[3] = "NONE"] = 3; - return values; - })(); - - /** - * MessageEncoding enum. - * @name google.protobuf.FeatureSet.MessageEncoding - * @enum {number} - * @property {number} MESSAGE_ENCODING_UNKNOWN=0 MESSAGE_ENCODING_UNKNOWN value - * @property {number} LENGTH_PREFIXED=1 LENGTH_PREFIXED value - * @property {number} DELIMITED=2 DELIMITED value - */ - FeatureSet.MessageEncoding = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "MESSAGE_ENCODING_UNKNOWN"] = 0; - values[valuesById[1] = "LENGTH_PREFIXED"] = 1; - values[valuesById[2] = "DELIMITED"] = 2; - return values; - })(); - - /** - * JsonFormat enum. - * @name google.protobuf.FeatureSet.JsonFormat - * @enum {number} - * @property {number} JSON_FORMAT_UNKNOWN=0 JSON_FORMAT_UNKNOWN value - * @property {number} ALLOW=1 ALLOW value - * @property {number} LEGACY_BEST_EFFORT=2 LEGACY_BEST_EFFORT value - */ - FeatureSet.JsonFormat = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "JSON_FORMAT_UNKNOWN"] = 0; - values[valuesById[1] = "ALLOW"] = 1; - values[valuesById[2] = "LEGACY_BEST_EFFORT"] = 2; - return values; - })(); - - return FeatureSet; - })(); - - protobuf.FeatureSetDefaults = (function() { - - /** - * Properties of a FeatureSetDefaults. - * @memberof google.protobuf - * @interface IFeatureSetDefaults - * @property {Array.|null} [defaults] FeatureSetDefaults defaults - * @property {google.protobuf.Edition|null} [minimumEdition] FeatureSetDefaults minimumEdition - * @property {google.protobuf.Edition|null} [maximumEdition] FeatureSetDefaults maximumEdition - */ - - /** - * Constructs a new FeatureSetDefaults. - * @memberof google.protobuf - * @classdesc Represents a FeatureSetDefaults. - * @implements IFeatureSetDefaults - * @constructor - * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set - */ - function FeatureSetDefaults(properties) { - this.defaults = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FeatureSetDefaults defaults. - * @member {Array.} defaults - * @memberof google.protobuf.FeatureSetDefaults - * @instance - */ - FeatureSetDefaults.prototype.defaults = $util.emptyArray; - - /** - * FeatureSetDefaults minimumEdition. - * @member {google.protobuf.Edition} minimumEdition - * @memberof google.protobuf.FeatureSetDefaults - * @instance - */ - FeatureSetDefaults.prototype.minimumEdition = 0; - - /** - * FeatureSetDefaults maximumEdition. - * @member {google.protobuf.Edition} maximumEdition - * @memberof google.protobuf.FeatureSetDefaults - * @instance - */ - FeatureSetDefaults.prototype.maximumEdition = 0; - - /** - * Creates a new FeatureSetDefaults instance using the specified properties. - * @function create - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set - * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults instance - */ - FeatureSetDefaults.create = function create(properties) { - return new FeatureSetDefaults(properties); - }; - - /** - * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSetDefaults.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.defaults != null && message.defaults.length) - for (var i = 0; i < message.defaults.length; ++i) - $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.encode(message.defaults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.minimumEdition != null && Object.hasOwnProperty.call(message, "minimumEdition")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.minimumEdition); - if (message.maximumEdition != null && Object.hasOwnProperty.call(message, "maximumEdition")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maximumEdition); - return writer; - }; - - /** - * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSetDefaults.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FeatureSetDefaults message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSetDefaults.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.defaults && message.defaults.length)) - message.defaults = []; - message.defaults.push($root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.decode(reader, reader.uint32())); - break; - } - case 4: { - message.minimumEdition = reader.int32(); - break; - } - case 5: { - message.maximumEdition = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSetDefaults.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FeatureSetDefaults message. - * @function verify - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FeatureSetDefaults.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.defaults != null && message.hasOwnProperty("defaults")) { - if (!Array.isArray(message.defaults)) - return "defaults: array expected"; - for (var i = 0; i < message.defaults.length; ++i) { - var error = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify(message.defaults[i]); - if (error) - return "defaults." + error; - } - } - if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) - switch (message.minimumEdition) { - default: - return "minimumEdition: enum value expected"; - case 0: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) - switch (message.maximumEdition) { - default: - return "maximumEdition: enum value expected"; - case 0: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - return null; - }; - - /** - * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults - */ - FeatureSetDefaults.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FeatureSetDefaults) - return object; - var message = new $root.google.protobuf.FeatureSetDefaults(); - if (object.defaults) { - if (!Array.isArray(object.defaults)) - throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: array expected"); - message.defaults = []; - for (var i = 0; i < object.defaults.length; ++i) { - if (typeof object.defaults[i] !== "object") - throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: object expected"); - message.defaults[i] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fromObject(object.defaults[i]); - } - } - switch (object.minimumEdition) { - default: - if (typeof object.minimumEdition === "number") { - message.minimumEdition = object.minimumEdition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.minimumEdition = 0; - break; - case "EDITION_PROTO2": - case 998: - message.minimumEdition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.minimumEdition = 999; - break; - case "EDITION_2023": - case 1000: - message.minimumEdition = 1000; - break; - case "EDITION_2024": - case 1001: - message.minimumEdition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.minimumEdition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.minimumEdition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.minimumEdition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.minimumEdition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.minimumEdition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.minimumEdition = 2147483647; - break; - } - switch (object.maximumEdition) { - default: - if (typeof object.maximumEdition === "number") { - message.maximumEdition = object.maximumEdition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.maximumEdition = 0; - break; - case "EDITION_PROTO2": - case 998: - message.maximumEdition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.maximumEdition = 999; - break; - case "EDITION_2023": - case 1000: - message.maximumEdition = 1000; - break; - case "EDITION_2024": - case 1001: - message.maximumEdition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.maximumEdition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.maximumEdition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.maximumEdition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.maximumEdition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.maximumEdition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.maximumEdition = 2147483647; - break; - } - return message; - }; - - /** - * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {google.protobuf.FeatureSetDefaults} message FeatureSetDefaults - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FeatureSetDefaults.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.defaults = []; - if (options.defaults) { - object.minimumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; - object.maximumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; - } - if (message.defaults && message.defaults.length) { - object.defaults = []; - for (var j = 0; j < message.defaults.length; ++j) - object.defaults[j] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.toObject(message.defaults[j], options); - } - if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) - object.minimumEdition = options.enums === String ? $root.google.protobuf.Edition[message.minimumEdition] === undefined ? message.minimumEdition : $root.google.protobuf.Edition[message.minimumEdition] : message.minimumEdition; - if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) - object.maximumEdition = options.enums === String ? $root.google.protobuf.Edition[message.maximumEdition] === undefined ? message.maximumEdition : $root.google.protobuf.Edition[message.maximumEdition] : message.maximumEdition; - return object; - }; - - /** - * Converts this FeatureSetDefaults to JSON. - * @function toJSON - * @memberof google.protobuf.FeatureSetDefaults - * @instance - * @returns {Object.} JSON object - */ - FeatureSetDefaults.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FeatureSetDefaults - * @function getTypeUrl - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FeatureSetDefaults.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults"; - }; - - FeatureSetDefaults.FeatureSetEditionDefault = (function() { - - /** - * Properties of a FeatureSetEditionDefault. - * @memberof google.protobuf.FeatureSetDefaults - * @interface IFeatureSetEditionDefault - * @property {google.protobuf.Edition|null} [edition] FeatureSetEditionDefault edition - * @property {google.protobuf.IFeatureSet|null} [features] FeatureSetEditionDefault features - */ - - /** - * Constructs a new FeatureSetEditionDefault. - * @memberof google.protobuf.FeatureSetDefaults - * @classdesc Represents a FeatureSetEditionDefault. - * @implements IFeatureSetEditionDefault - * @constructor - * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set - */ - function FeatureSetEditionDefault(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FeatureSetEditionDefault edition. - * @member {google.protobuf.Edition} edition - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @instance - */ - FeatureSetEditionDefault.prototype.edition = 0; - - /** - * FeatureSetEditionDefault features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @instance - */ - FeatureSetEditionDefault.prototype.features = null; - - /** - * Creates a new FeatureSetEditionDefault instance using the specified properties. - * @function create - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set - * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault instance - */ - FeatureSetEditionDefault.create = function create(properties) { - return new FeatureSetEditionDefault(properties); - }; - - /** - * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSetEditionDefault.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); - return writer; - }; - - /** - * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSetEditionDefault.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSetEditionDefault.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 3: { - message.edition = reader.int32(); - break; - } - case 2: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSetEditionDefault.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FeatureSetEditionDefault message. - * @function verify - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FeatureSetEditionDefault.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.edition != null && message.hasOwnProperty("edition")) - switch (message.edition) { - default: - return "edition: enum value expected"; - case 0: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - return null; - }; - - /** - * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault - */ - FeatureSetEditionDefault.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault) - return object; - var message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); - switch (object.edition) { - default: - if (typeof object.edition === "number") { - message.edition = object.edition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.edition = 0; - break; - case "EDITION_PROTO2": - case 998: - message.edition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.edition = 999; - break; - case "EDITION_2023": - case 1000: - message.edition = 1000; - break; - case "EDITION_2024": - case 1001: - message.edition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.edition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.edition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.edition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.edition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.edition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.edition = 2147483647; - break; - } - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - return message; - }; - - /** - * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} message FeatureSetEditionDefault - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FeatureSetEditionDefault.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.features = null; - object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; - } - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.edition != null && message.hasOwnProperty("edition")) - object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; - return object; - }; - - /** - * Converts this FeatureSetEditionDefault to JSON. - * @function toJSON - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @instance - * @returns {Object.} JSON object - */ - FeatureSetEditionDefault.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FeatureSetEditionDefault - * @function getTypeUrl - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FeatureSetEditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault"; - }; - - return FeatureSetEditionDefault; - })(); - - return FeatureSetDefaults; - })(); - - protobuf.SourceCodeInfo = (function() { - - /** - * Properties of a SourceCodeInfo. - * @memberof google.protobuf - * @interface ISourceCodeInfo - * @property {Array.|null} [location] SourceCodeInfo location - */ - - /** - * Constructs a new SourceCodeInfo. - * @memberof google.protobuf - * @classdesc Represents a SourceCodeInfo. - * @implements ISourceCodeInfo - * @constructor - * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set - */ - function SourceCodeInfo(properties) { - this.location = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SourceCodeInfo location. - * @member {Array.} location - * @memberof google.protobuf.SourceCodeInfo - * @instance - */ - SourceCodeInfo.prototype.location = $util.emptyArray; - - /** - * Creates a new SourceCodeInfo instance using the specified properties. - * @function create - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance - */ - SourceCodeInfo.create = function create(properties) { - return new SourceCodeInfo(properties); - }; - - /** - * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @function encode - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SourceCodeInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.location != null && message.location.length) - for (var i = 0; i < message.location.length; ++i) - $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SourceCodeInfo.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.location && message.location.length)) - message.location = []; - message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SourceCodeInfo message. - * @function verify - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SourceCodeInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.location != null && message.hasOwnProperty("location")) { - if (!Array.isArray(message.location)) - return "location: array expected"; - for (var i = 0; i < message.location.length; ++i) { - var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]); - if (error) - return "location." + error; - } - } - return null; - }; - - /** - * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo - */ - SourceCodeInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.SourceCodeInfo) - return object; - var message = new $root.google.protobuf.SourceCodeInfo(); - if (object.location) { - if (!Array.isArray(object.location)) - throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); - message.location = []; - for (var i = 0; i < object.location.length; ++i) { - if (typeof object.location[i] !== "object") - throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); - message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SourceCodeInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.location = []; - if (message.location && message.location.length) { - object.location = []; - for (var j = 0; j < message.location.length; ++j) - object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options); - } - return object; - }; - - /** - * Converts this SourceCodeInfo to JSON. - * @function toJSON - * @memberof google.protobuf.SourceCodeInfo - * @instance - * @returns {Object.} JSON object - */ - SourceCodeInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SourceCodeInfo - * @function getTypeUrl - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SourceCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.SourceCodeInfo"; - }; - - SourceCodeInfo.Location = (function() { - - /** - * Properties of a Location. - * @memberof google.protobuf.SourceCodeInfo - * @interface ILocation - * @property {Array.|null} [path] Location path - * @property {Array.|null} [span] Location span - * @property {string|null} [leadingComments] Location leadingComments - * @property {string|null} [trailingComments] Location trailingComments - * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments - */ - - /** - * Constructs a new Location. - * @memberof google.protobuf.SourceCodeInfo - * @classdesc Represents a Location. - * @implements ILocation - * @constructor - * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set - */ - function Location(properties) { - this.path = []; - this.span = []; - this.leadingDetachedComments = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Location path. - * @member {Array.} path - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.path = $util.emptyArray; - - /** - * Location span. - * @member {Array.} span - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.span = $util.emptyArray; - - /** - * Location leadingComments. - * @member {string} leadingComments - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.leadingComments = ""; - - /** - * Location trailingComments. - * @member {string} trailingComments - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.trailingComments = ""; - - /** - * Location leadingDetachedComments. - * @member {Array.} leadingDetachedComments - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.leadingDetachedComments = $util.emptyArray; - - /** - * Creates a new Location instance using the specified properties. - * @function create - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set - * @returns {google.protobuf.SourceCodeInfo.Location} Location instance - */ - Location.create = function create(properties) { - return new Location(properties); - }; - - /** - * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @function encode - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Location.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && message.path.length) { - writer.uint32(/* id 1, wireType 2 =*/10).fork(); - for (var i = 0; i < message.path.length; ++i) - writer.int32(message.path[i]); - writer.ldelim(); - } - if (message.span != null && message.span.length) { - writer.uint32(/* id 2, wireType 2 =*/18).fork(); - for (var i = 0; i < message.span.length; ++i) - writer.int32(message.span[i]); - writer.ldelim(); - } - if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); - if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); - if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) - for (var i = 0; i < message.leadingDetachedComments.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); - return writer; - }; - - /** - * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Location.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Location message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.SourceCodeInfo.Location} Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Location.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.path && message.path.length)) - message.path = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.path.push(reader.int32()); - } else - message.path.push(reader.int32()); - break; - } - case 2: { - if (!(message.span && message.span.length)) - message.span = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.span.push(reader.int32()); - } else - message.span.push(reader.int32()); - break; - } - case 3: { - message.leadingComments = reader.string(); - break; - } - case 4: { - message.trailingComments = reader.string(); - break; - } - case 6: { - if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) - message.leadingDetachedComments = []; - message.leadingDetachedComments.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Location message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.SourceCodeInfo.Location} Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Location.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Location message. - * @function verify - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Location.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) { - if (!Array.isArray(message.path)) - return "path: array expected"; - for (var i = 0; i < message.path.length; ++i) - if (!$util.isInteger(message.path[i])) - return "path: integer[] expected"; - } - if (message.span != null && message.hasOwnProperty("span")) { - if (!Array.isArray(message.span)) - return "span: array expected"; - for (var i = 0; i < message.span.length; ++i) - if (!$util.isInteger(message.span[i])) - return "span: integer[] expected"; - } - if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) - if (!$util.isString(message.leadingComments)) - return "leadingComments: string expected"; - if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) - if (!$util.isString(message.trailingComments)) - return "trailingComments: string expected"; - if (message.leadingDetachedComments != null && message.hasOwnProperty("leadingDetachedComments")) { - if (!Array.isArray(message.leadingDetachedComments)) - return "leadingDetachedComments: array expected"; - for (var i = 0; i < message.leadingDetachedComments.length; ++i) - if (!$util.isString(message.leadingDetachedComments[i])) - return "leadingDetachedComments: string[] expected"; - } - return null; - }; - - /** - * Creates a Location message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.SourceCodeInfo.Location} Location - */ - Location.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) - return object; - var message = new $root.google.protobuf.SourceCodeInfo.Location(); - if (object.path) { - if (!Array.isArray(object.path)) - throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); - message.path = []; - for (var i = 0; i < object.path.length; ++i) - message.path[i] = object.path[i] | 0; - } - if (object.span) { - if (!Array.isArray(object.span)) - throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); - message.span = []; - for (var i = 0; i < object.span.length; ++i) - message.span[i] = object.span[i] | 0; - } - if (object.leadingComments != null) - message.leadingComments = String(object.leadingComments); - if (object.trailingComments != null) - message.trailingComments = String(object.trailingComments); - if (object.leadingDetachedComments) { - if (!Array.isArray(object.leadingDetachedComments)) - throw TypeError(".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected"); - message.leadingDetachedComments = []; - for (var i = 0; i < object.leadingDetachedComments.length; ++i) - message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]); - } - return message; - }; - - /** - * Creates a plain object from a Location message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.Location} message Location - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Location.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.path = []; - object.span = []; - object.leadingDetachedComments = []; - } - if (options.defaults) { - object.leadingComments = ""; - object.trailingComments = ""; - } - if (message.path && message.path.length) { - object.path = []; - for (var j = 0; j < message.path.length; ++j) - object.path[j] = message.path[j]; - } - if (message.span && message.span.length) { - object.span = []; - for (var j = 0; j < message.span.length; ++j) - object.span[j] = message.span[j]; - } - if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) - object.leadingComments = message.leadingComments; - if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) - object.trailingComments = message.trailingComments; - if (message.leadingDetachedComments && message.leadingDetachedComments.length) { - object.leadingDetachedComments = []; - for (var j = 0; j < message.leadingDetachedComments.length; ++j) - object.leadingDetachedComments[j] = message.leadingDetachedComments[j]; - } - return object; - }; - - /** - * Converts this Location to JSON. - * @function toJSON - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - * @returns {Object.} JSON object - */ - Location.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Location - * @function getTypeUrl - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Location.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.SourceCodeInfo.Location"; - }; - - return Location; - })(); - - return SourceCodeInfo; - })(); - - protobuf.GeneratedCodeInfo = (function() { - - /** - * Properties of a GeneratedCodeInfo. - * @memberof google.protobuf - * @interface IGeneratedCodeInfo - * @property {Array.|null} [annotation] GeneratedCodeInfo annotation - */ - - /** - * Constructs a new GeneratedCodeInfo. - * @memberof google.protobuf - * @classdesc Represents a GeneratedCodeInfo. - * @implements IGeneratedCodeInfo - * @constructor - * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set - */ - function GeneratedCodeInfo(properties) { - this.annotation = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GeneratedCodeInfo annotation. - * @member {Array.} annotation - * @memberof google.protobuf.GeneratedCodeInfo - * @instance - */ - GeneratedCodeInfo.prototype.annotation = $util.emptyArray; - - /** - * Creates a new GeneratedCodeInfo instance using the specified properties. - * @function create - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance - */ - GeneratedCodeInfo.create = function create(properties) { - return new GeneratedCodeInfo(properties); - }; - - /** - * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @function encode - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GeneratedCodeInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.annotation != null && message.annotation.length) - for (var i = 0; i < message.annotation.length; ++i) - $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GeneratedCodeInfo.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.annotation && message.annotation.length)) - message.annotation = []; - message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GeneratedCodeInfo message. - * @function verify - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GeneratedCodeInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.annotation != null && message.hasOwnProperty("annotation")) { - if (!Array.isArray(message.annotation)) - return "annotation: array expected"; - for (var i = 0; i < message.annotation.length; ++i) { - var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]); - if (error) - return "annotation." + error; - } - } - return null; - }; - - /** - * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo - */ - GeneratedCodeInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.GeneratedCodeInfo) - return object; - var message = new $root.google.protobuf.GeneratedCodeInfo(); - if (object.annotation) { - if (!Array.isArray(object.annotation)) - throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); - message.annotation = []; - for (var i = 0; i < object.annotation.length; ++i) { - if (typeof object.annotation[i] !== "object") - throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); - message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GeneratedCodeInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.annotation = []; - if (message.annotation && message.annotation.length) { - object.annotation = []; - for (var j = 0; j < message.annotation.length; ++j) - object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options); - } - return object; - }; - - /** - * Converts this GeneratedCodeInfo to JSON. - * @function toJSON - * @memberof google.protobuf.GeneratedCodeInfo - * @instance - * @returns {Object.} JSON object - */ - GeneratedCodeInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GeneratedCodeInfo - * @function getTypeUrl - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GeneratedCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo"; - }; - - GeneratedCodeInfo.Annotation = (function() { - - /** - * Properties of an Annotation. - * @memberof google.protobuf.GeneratedCodeInfo - * @interface IAnnotation - * @property {Array.|null} [path] Annotation path - * @property {string|null} [sourceFile] Annotation sourceFile - * @property {number|null} [begin] Annotation begin - * @property {number|null} [end] Annotation end - * @property {google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null} [semantic] Annotation semantic - */ - - /** - * Constructs a new Annotation. - * @memberof google.protobuf.GeneratedCodeInfo - * @classdesc Represents an Annotation. - * @implements IAnnotation - * @constructor - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set - */ - function Annotation(properties) { - this.path = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Annotation path. - * @member {Array.} path - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.path = $util.emptyArray; - - /** - * Annotation sourceFile. - * @member {string} sourceFile - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.sourceFile = ""; - - /** - * Annotation begin. - * @member {number} begin - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.begin = 0; - - /** - * Annotation end. - * @member {number} end - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.end = 0; - - /** - * Annotation semantic. - * @member {google.protobuf.GeneratedCodeInfo.Annotation.Semantic} semantic - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.semantic = 0; - - /** - * Creates a new Annotation instance using the specified properties. - * @function create - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance - */ - Annotation.create = function create(properties) { - return new Annotation(properties); - }; - - /** - * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @function encode - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Annotation.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && message.path.length) { - writer.uint32(/* id 1, wireType 2 =*/10).fork(); - for (var i = 0; i < message.path.length; ++i) - writer.int32(message.path[i]); - writer.ldelim(); - } - if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); - if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); - if (message.semantic != null && Object.hasOwnProperty.call(message, "semantic")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.semantic); - return writer; - }; - - /** - * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Annotation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Annotation message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Annotation.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.path && message.path.length)) - message.path = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.path.push(reader.int32()); - } else - message.path.push(reader.int32()); - break; - } - case 2: { - message.sourceFile = reader.string(); - break; - } - case 3: { - message.begin = reader.int32(); - break; - } - case 4: { - message.end = reader.int32(); - break; - } - case 5: { - message.semantic = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Annotation message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Annotation.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Annotation message. - * @function verify - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Annotation.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) { - if (!Array.isArray(message.path)) - return "path: array expected"; - for (var i = 0; i < message.path.length; ++i) - if (!$util.isInteger(message.path[i])) - return "path: integer[] expected"; - } - if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) - if (!$util.isString(message.sourceFile)) - return "sourceFile: string expected"; - if (message.begin != null && message.hasOwnProperty("begin")) - if (!$util.isInteger(message.begin)) - return "begin: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - if (message.semantic != null && message.hasOwnProperty("semantic")) - switch (message.semantic) { - default: - return "semantic: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates an Annotation message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation - */ - Annotation.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) - return object; - var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); - if (object.path) { - if (!Array.isArray(object.path)) - throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); - message.path = []; - for (var i = 0; i < object.path.length; ++i) - message.path[i] = object.path[i] | 0; - } - if (object.sourceFile != null) - message.sourceFile = String(object.sourceFile); - if (object.begin != null) - message.begin = object.begin | 0; - if (object.end != null) - message.end = object.end | 0; - switch (object.semantic) { - default: - if (typeof object.semantic === "number") { - message.semantic = object.semantic; - break; - } - break; - case "NONE": - case 0: - message.semantic = 0; - break; - case "SET": - case 1: - message.semantic = 1; - break; - case "ALIAS": - case 2: - message.semantic = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from an Annotation message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Annotation.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.path = []; - if (options.defaults) { - object.sourceFile = ""; - object.begin = 0; - object.end = 0; - object.semantic = options.enums === String ? "NONE" : 0; - } - if (message.path && message.path.length) { - object.path = []; - for (var j = 0; j < message.path.length; ++j) - object.path[j] = message.path[j]; - } - if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) - object.sourceFile = message.sourceFile; - if (message.begin != null && message.hasOwnProperty("begin")) - object.begin = message.begin; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - if (message.semantic != null && message.hasOwnProperty("semantic")) - object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] === undefined ? message.semantic : $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic; - return object; - }; - - /** - * Converts this Annotation to JSON. - * @function toJSON - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - * @returns {Object.} JSON object - */ - Annotation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Annotation - * @function getTypeUrl - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Annotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo.Annotation"; - }; - - /** - * Semantic enum. - * @name google.protobuf.GeneratedCodeInfo.Annotation.Semantic - * @enum {number} - * @property {number} NONE=0 NONE value - * @property {number} SET=1 SET value - * @property {number} ALIAS=2 ALIAS value - */ - Annotation.Semantic = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "NONE"] = 0; - values[valuesById[1] = "SET"] = 1; - values[valuesById[2] = "ALIAS"] = 2; - return values; - })(); - - return Annotation; - })(); - - return GeneratedCodeInfo; - })(); - - protobuf.Timestamp = (function() { - - /** - * Properties of a Timestamp. - * @memberof google.protobuf - * @interface ITimestamp - * @property {number|Long|null} [seconds] Timestamp seconds - * @property {number|null} [nanos] Timestamp nanos - */ - - /** - * Constructs a new Timestamp. - * @memberof google.protobuf - * @classdesc Represents a Timestamp. - * @implements ITimestamp - * @constructor - * @param {google.protobuf.ITimestamp=} [properties] Properties to set - */ - function Timestamp(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Timestamp seconds. - * @member {number|Long} seconds - * @memberof google.protobuf.Timestamp - * @instance - */ - Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Timestamp nanos. - * @member {number} nanos - * @memberof google.protobuf.Timestamp - * @instance - */ - Timestamp.prototype.nanos = 0; - - /** - * Creates a new Timestamp instance using the specified properties. - * @function create - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.ITimestamp=} [properties] Properties to set - * @returns {google.protobuf.Timestamp} Timestamp instance - */ - Timestamp.create = function create(properties) { - return new Timestamp(properties); - }; - - /** - * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Timestamp.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); - if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); - return writer; - }; - - /** - * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Timestamp.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Timestamp message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Timestamp - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Timestamp} Timestamp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Timestamp.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.seconds = reader.int64(); - break; - } - case 2: { - message.nanos = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Timestamp message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Timestamp - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Timestamp} Timestamp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Timestamp.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Timestamp message. - * @function verify - * @memberof google.protobuf.Timestamp - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Timestamp.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) - return "seconds: integer|Long expected"; - if (message.nanos != null && message.hasOwnProperty("nanos")) - if (!$util.isInteger(message.nanos)) - return "nanos: integer expected"; - return null; - }; - - /** - * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Timestamp - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Timestamp} Timestamp - */ - Timestamp.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Timestamp) - return object; - var message = new $root.google.protobuf.Timestamp(); - if (object.seconds != null) - if ($util.Long) - (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; - else if (typeof object.seconds === "string") - message.seconds = parseInt(object.seconds, 10); - else if (typeof object.seconds === "number") - message.seconds = object.seconds; - else if (typeof object.seconds === "object") - message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); - if (object.nanos != null) - message.nanos = object.nanos | 0; - return message; - }; - - /** - * Creates a plain object from a Timestamp message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.Timestamp} message Timestamp - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Timestamp.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.seconds = options.longs === String ? "0" : 0; - object.nanos = 0; - } - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (typeof message.seconds === "number") - object.seconds = options.longs === String ? String(message.seconds) : message.seconds; - else - object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; - if (message.nanos != null && message.hasOwnProperty("nanos")) - object.nanos = message.nanos; - return object; - }; - - /** - * Converts this Timestamp to JSON. - * @function toJSON - * @memberof google.protobuf.Timestamp - * @instance - * @returns {Object.} JSON object - */ - Timestamp.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Timestamp - * @function getTypeUrl - * @memberof google.protobuf.Timestamp - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Timestamp"; - }; - - return Timestamp; - })(); - - protobuf.Duration = (function() { - - /** - * Properties of a Duration. - * @memberof google.protobuf - * @interface IDuration - * @property {number|Long|null} [seconds] Duration seconds - * @property {number|null} [nanos] Duration nanos - */ - - /** - * Constructs a new Duration. - * @memberof google.protobuf - * @classdesc Represents a Duration. - * @implements IDuration - * @constructor - * @param {google.protobuf.IDuration=} [properties] Properties to set - */ - function Duration(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Duration seconds. - * @member {number|Long} seconds - * @memberof google.protobuf.Duration - * @instance - */ - Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Duration nanos. - * @member {number} nanos - * @memberof google.protobuf.Duration - * @instance - */ - Duration.prototype.nanos = 0; - - /** - * Creates a new Duration instance using the specified properties. - * @function create - * @memberof google.protobuf.Duration - * @static - * @param {google.protobuf.IDuration=} [properties] Properties to set - * @returns {google.protobuf.Duration} Duration instance - */ - Duration.create = function create(properties) { - return new Duration(properties); - }; - - /** - * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Duration - * @static - * @param {google.protobuf.IDuration} message Duration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Duration.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); - if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); - return writer; - }; - - /** - * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Duration - * @static - * @param {google.protobuf.IDuration} message Duration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Duration.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Duration message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Duration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Duration} Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Duration.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.seconds = reader.int64(); - break; - } - case 2: { - message.nanos = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Duration message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Duration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Duration} Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Duration.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Duration message. - * @function verify - * @memberof google.protobuf.Duration - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Duration.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) - return "seconds: integer|Long expected"; - if (message.nanos != null && message.hasOwnProperty("nanos")) - if (!$util.isInteger(message.nanos)) - return "nanos: integer expected"; - return null; - }; - - /** - * Creates a Duration message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Duration - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Duration} Duration - */ - Duration.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Duration) - return object; - var message = new $root.google.protobuf.Duration(); - if (object.seconds != null) - if ($util.Long) - (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; - else if (typeof object.seconds === "string") - message.seconds = parseInt(object.seconds, 10); - else if (typeof object.seconds === "number") - message.seconds = object.seconds; - else if (typeof object.seconds === "object") - message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); - if (object.nanos != null) - message.nanos = object.nanos | 0; - return message; - }; - - /** - * Creates a plain object from a Duration message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Duration - * @static - * @param {google.protobuf.Duration} message Duration - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Duration.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.seconds = options.longs === String ? "0" : 0; - object.nanos = 0; - } - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (typeof message.seconds === "number") - object.seconds = options.longs === String ? String(message.seconds) : message.seconds; - else - object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; - if (message.nanos != null && message.hasOwnProperty("nanos")) - object.nanos = message.nanos; - return object; - }; - - /** - * Converts this Duration to JSON. - * @function toJSON - * @memberof google.protobuf.Duration - * @instance - * @returns {Object.} JSON object - */ - Duration.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Duration - * @function getTypeUrl - * @memberof google.protobuf.Duration - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Duration"; - }; - - return Duration; - })(); - - protobuf.FieldMask = (function() { - - /** - * Properties of a FieldMask. - * @memberof google.protobuf - * @interface IFieldMask - * @property {Array.|null} [paths] FieldMask paths - */ - - /** - * Constructs a new FieldMask. - * @memberof google.protobuf - * @classdesc Represents a FieldMask. - * @implements IFieldMask - * @constructor - * @param {google.protobuf.IFieldMask=} [properties] Properties to set - */ - function FieldMask(properties) { - this.paths = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FieldMask paths. - * @member {Array.} paths - * @memberof google.protobuf.FieldMask - * @instance - */ - FieldMask.prototype.paths = $util.emptyArray; - - /** - * Creates a new FieldMask instance using the specified properties. - * @function create - * @memberof google.protobuf.FieldMask - * @static - * @param {google.protobuf.IFieldMask=} [properties] Properties to set - * @returns {google.protobuf.FieldMask} FieldMask instance - */ - FieldMask.create = function create(properties) { - return new FieldMask(properties); - }; - - /** - * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FieldMask - * @static - * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldMask.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.paths != null && message.paths.length) - for (var i = 0; i < message.paths.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.paths[i]); - return writer; - }; - - /** - * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FieldMask - * @static - * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldMask.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FieldMask message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FieldMask - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldMask} FieldMask - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldMask.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldMask(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.paths && message.paths.length)) - message.paths = []; - message.paths.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FieldMask message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FieldMask - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldMask} FieldMask - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldMask.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FieldMask message. - * @function verify - * @memberof google.protobuf.FieldMask - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FieldMask.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.paths != null && message.hasOwnProperty("paths")) { - if (!Array.isArray(message.paths)) - return "paths: array expected"; - for (var i = 0; i < message.paths.length; ++i) - if (!$util.isString(message.paths[i])) - return "paths: string[] expected"; - } - return null; - }; - - /** - * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FieldMask - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FieldMask} FieldMask - */ - FieldMask.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldMask) - return object; - var message = new $root.google.protobuf.FieldMask(); - if (object.paths) { - if (!Array.isArray(object.paths)) - throw TypeError(".google.protobuf.FieldMask.paths: array expected"); - message.paths = []; - for (var i = 0; i < object.paths.length; ++i) - message.paths[i] = String(object.paths[i]); - } - return message; - }; - - /** - * Creates a plain object from a FieldMask message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FieldMask - * @static - * @param {google.protobuf.FieldMask} message FieldMask - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FieldMask.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.paths = []; - if (message.paths && message.paths.length) { - object.paths = []; - for (var j = 0; j < message.paths.length; ++j) - object.paths[j] = message.paths[j]; - } - return object; - }; - - /** - * Converts this FieldMask to JSON. - * @function toJSON - * @memberof google.protobuf.FieldMask - * @instance - * @returns {Object.} JSON object - */ - FieldMask.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FieldMask - * @function getTypeUrl - * @memberof google.protobuf.FieldMask - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FieldMask.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FieldMask"; - }; - - return FieldMask; - })(); - - protobuf.Any = (function() { - - /** - * Properties of an Any. - * @memberof google.protobuf - * @interface IAny - * @property {string|null} [type_url] Any type_url - * @property {Uint8Array|null} [value] Any value - */ - - /** - * Constructs a new Any. - * @memberof google.protobuf - * @classdesc Represents an Any. - * @implements IAny - * @constructor - * @param {google.protobuf.IAny=} [properties] Properties to set - */ - function Any(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Any type_url. - * @member {string} type_url - * @memberof google.protobuf.Any - * @instance - */ - Any.prototype.type_url = ""; - - /** - * Any value. - * @member {Uint8Array} value - * @memberof google.protobuf.Any - * @instance - */ - Any.prototype.value = $util.newBuffer([]); - - /** - * Creates a new Any instance using the specified properties. - * @function create - * @memberof google.protobuf.Any - * @static - * @param {google.protobuf.IAny=} [properties] Properties to set - * @returns {google.protobuf.Any} Any instance - */ - Any.create = function create(properties) { - return new Any(properties); - }; - - /** - * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Any - * @static - * @param {google.protobuf.IAny} message Any message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Any.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); - return writer; - }; - - /** - * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Any - * @static - * @param {google.protobuf.IAny} message Any message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Any.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Any message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Any - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Any} Any - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Any.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.type_url = reader.string(); - break; - } - case 2: { - message.value = reader.bytes(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Any message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Any - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Any} Any - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Any.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Any message. - * @function verify - * @memberof google.protobuf.Any - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Any.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.type_url != null && message.hasOwnProperty("type_url")) - if (!$util.isString(message.type_url)) - return "type_url: string expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) - return "value: buffer expected"; - return null; - }; - - /** - * Creates an Any message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Any - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Any} Any - */ - Any.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Any) - return object; - var message = new $root.google.protobuf.Any(); - if (object.type_url != null) - message.type_url = String(object.type_url); - if (object.value != null) - if (typeof object.value === "string") - $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); - else if (object.value.length >= 0) - message.value = object.value; - return message; - }; - - /** - * Creates a plain object from an Any message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Any - * @static - * @param {google.protobuf.Any} message Any - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Any.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.type_url = ""; - if (options.bytes === String) - object.value = ""; - else { - object.value = []; - if (options.bytes !== Array) - object.value = $util.newBuffer(object.value); - } - } - if (message.type_url != null && message.hasOwnProperty("type_url")) - object.type_url = message.type_url; - if (message.value != null && message.hasOwnProperty("value")) - object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; - return object; - }; - - /** - * Converts this Any to JSON. - * @function toJSON - * @memberof google.protobuf.Any - * @instance - * @returns {Object.} JSON object - */ - Any.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Any - * @function getTypeUrl - * @memberof google.protobuf.Any - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Any.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Any"; - }; - - return Any; - })(); - - protobuf.Empty = (function() { - - /** - * Properties of an Empty. - * @memberof google.protobuf - * @interface IEmpty - */ - - /** - * Constructs a new Empty. - * @memberof google.protobuf - * @classdesc Represents an Empty. - * @implements IEmpty - * @constructor - * @param {google.protobuf.IEmpty=} [properties] Properties to set - */ - function Empty(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Creates a new Empty instance using the specified properties. - * @function create - * @memberof google.protobuf.Empty - * @static - * @param {google.protobuf.IEmpty=} [properties] Properties to set - * @returns {google.protobuf.Empty} Empty instance - */ - Empty.create = function create(properties) { - return new Empty(properties); - }; - - /** - * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Empty - * @static - * @param {google.protobuf.IEmpty} message Empty message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Empty.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Empty - * @static - * @param {google.protobuf.IEmpty} message Empty message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Empty.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Empty message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Empty - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Empty} Empty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Empty.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Empty message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Empty - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Empty} Empty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Empty.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Empty message. - * @function verify - * @memberof google.protobuf.Empty - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Empty.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates an Empty message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Empty - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Empty} Empty - */ - Empty.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Empty) - return object; - return new $root.google.protobuf.Empty(); - }; - - /** - * Creates a plain object from an Empty message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Empty - * @static - * @param {google.protobuf.Empty} message Empty - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Empty.toObject = function toObject() { - return {}; - }; - - /** - * Converts this Empty to JSON. - * @function toJSON - * @memberof google.protobuf.Empty - * @instance - * @returns {Object.} JSON object - */ - Empty.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Empty - * @function getTypeUrl - * @memberof google.protobuf.Empty - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Empty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Empty"; - }; - - return Empty; - })(); - - return protobuf; - })(); - - google.iam = (function() { - - /** - * Namespace iam. - * @memberof google - * @namespace - */ - var iam = {}; - - iam.v1 = (function() { - - /** - * Namespace v1. - * @memberof google.iam - * @namespace - */ - var v1 = {}; - - v1.IAMPolicy = (function() { - - /** - * Constructs a new IAMPolicy service. - * @memberof google.iam.v1 - * @classdesc Represents a IAMPolicy - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function IAMPolicy(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (IAMPolicy.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = IAMPolicy; - - /** - * Creates new IAMPolicy service using the specified rpc implementation. - * @function create - * @memberof google.iam.v1.IAMPolicy - * @static - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - * @returns {IAMPolicy} RPC service. Useful where requests and/or responses are streamed. - */ - IAMPolicy.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.iam.v1.IAMPolicy|setIamPolicy}. - * @memberof google.iam.v1.IAMPolicy - * @typedef SetIamPolicyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.iam.v1.Policy} [response] Policy - */ - - /** - * Calls SetIamPolicy. - * @function setIamPolicy - * @memberof google.iam.v1.IAMPolicy - * @instance - * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object - * @param {google.iam.v1.IAMPolicy.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(IAMPolicy.prototype.setIamPolicy = function setIamPolicy(request, callback) { - return this.rpcCall(setIamPolicy, $root.google.iam.v1.SetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); - }, "name", { value: "SetIamPolicy" }); - - /** - * Calls SetIamPolicy. - * @function setIamPolicy - * @memberof google.iam.v1.IAMPolicy - * @instance - * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.iam.v1.IAMPolicy|getIamPolicy}. - * @memberof google.iam.v1.IAMPolicy - * @typedef GetIamPolicyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.iam.v1.Policy} [response] Policy - */ - - /** - * Calls GetIamPolicy. - * @function getIamPolicy - * @memberof google.iam.v1.IAMPolicy - * @instance - * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object - * @param {google.iam.v1.IAMPolicy.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(IAMPolicy.prototype.getIamPolicy = function getIamPolicy(request, callback) { - return this.rpcCall(getIamPolicy, $root.google.iam.v1.GetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); - }, "name", { value: "GetIamPolicy" }); - - /** - * Calls GetIamPolicy. - * @function getIamPolicy - * @memberof google.iam.v1.IAMPolicy - * @instance - * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.iam.v1.IAMPolicy|testIamPermissions}. - * @memberof google.iam.v1.IAMPolicy - * @typedef TestIamPermissionsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.iam.v1.TestIamPermissionsResponse} [response] TestIamPermissionsResponse - */ - - /** - * Calls TestIamPermissions. - * @function testIamPermissions - * @memberof google.iam.v1.IAMPolicy - * @instance - * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object - * @param {google.iam.v1.IAMPolicy.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestIamPermissionsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(IAMPolicy.prototype.testIamPermissions = function testIamPermissions(request, callback) { - return this.rpcCall(testIamPermissions, $root.google.iam.v1.TestIamPermissionsRequest, $root.google.iam.v1.TestIamPermissionsResponse, request, callback); - }, "name", { value: "TestIamPermissions" }); - - /** - * Calls TestIamPermissions. - * @function testIamPermissions - * @memberof google.iam.v1.IAMPolicy - * @instance - * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return IAMPolicy; - })(); - - v1.SetIamPolicyRequest = (function() { - - /** - * Properties of a SetIamPolicyRequest. - * @memberof google.iam.v1 - * @interface ISetIamPolicyRequest - * @property {string|null} [resource] SetIamPolicyRequest resource - * @property {google.iam.v1.IPolicy|null} [policy] SetIamPolicyRequest policy - * @property {google.protobuf.IFieldMask|null} [updateMask] SetIamPolicyRequest updateMask - */ - - /** - * Constructs a new SetIamPolicyRequest. - * @memberof google.iam.v1 - * @classdesc Represents a SetIamPolicyRequest. - * @implements ISetIamPolicyRequest - * @constructor - * @param {google.iam.v1.ISetIamPolicyRequest=} [properties] Properties to set - */ - function SetIamPolicyRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SetIamPolicyRequest resource. - * @member {string} resource - * @memberof google.iam.v1.SetIamPolicyRequest - * @instance - */ - SetIamPolicyRequest.prototype.resource = ""; - - /** - * SetIamPolicyRequest policy. - * @member {google.iam.v1.IPolicy|null|undefined} policy - * @memberof google.iam.v1.SetIamPolicyRequest - * @instance - */ - SetIamPolicyRequest.prototype.policy = null; - - /** - * SetIamPolicyRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.iam.v1.SetIamPolicyRequest - * @instance - */ - SetIamPolicyRequest.prototype.updateMask = null; - - /** - * Creates a new SetIamPolicyRequest instance using the specified properties. - * @function create - * @memberof google.iam.v1.SetIamPolicyRequest - * @static - * @param {google.iam.v1.ISetIamPolicyRequest=} [properties] Properties to set - * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest instance - */ - SetIamPolicyRequest.create = function create(properties) { - return new SetIamPolicyRequest(properties); - }; - - /** - * Encodes the specified SetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. - * @function encode - * @memberof google.iam.v1.SetIamPolicyRequest - * @static - * @param {google.iam.v1.ISetIamPolicyRequest} message SetIamPolicyRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SetIamPolicyRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); - if (message.policy != null && Object.hasOwnProperty.call(message, "policy")) - $root.google.iam.v1.Policy.encode(message.policy, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified SetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.iam.v1.SetIamPolicyRequest - * @static - * @param {google.iam.v1.ISetIamPolicyRequest} message SetIamPolicyRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SetIamPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SetIamPolicyRequest message from the specified reader or buffer. - * @function decode - * @memberof google.iam.v1.SetIamPolicyRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SetIamPolicyRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.SetIamPolicyRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.resource = reader.string(); - break; - } - case 2: { - message.policy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); - break; - } - case 3: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SetIamPolicyRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.iam.v1.SetIamPolicyRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SetIamPolicyRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SetIamPolicyRequest message. - * @function verify - * @memberof google.iam.v1.SetIamPolicyRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SetIamPolicyRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.resource != null && message.hasOwnProperty("resource")) - if (!$util.isString(message.resource)) - return "resource: string expected"; - if (message.policy != null && message.hasOwnProperty("policy")) { - var error = $root.google.iam.v1.Policy.verify(message.policy); - if (error) - return "policy." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - return null; - }; - - /** - * Creates a SetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.iam.v1.SetIamPolicyRequest - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest - */ - SetIamPolicyRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.SetIamPolicyRequest) - return object; - var message = new $root.google.iam.v1.SetIamPolicyRequest(); - if (object.resource != null) - message.resource = String(object.resource); - if (object.policy != null) { - if (typeof object.policy !== "object") - throw TypeError(".google.iam.v1.SetIamPolicyRequest.policy: object expected"); - message.policy = $root.google.iam.v1.Policy.fromObject(object.policy); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.iam.v1.SetIamPolicyRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - return message; - }; - - /** - * Creates a plain object from a SetIamPolicyRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.iam.v1.SetIamPolicyRequest - * @static - * @param {google.iam.v1.SetIamPolicyRequest} message SetIamPolicyRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SetIamPolicyRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.resource = ""; - object.policy = null; - object.updateMask = null; - } - if (message.resource != null && message.hasOwnProperty("resource")) - object.resource = message.resource; - if (message.policy != null && message.hasOwnProperty("policy")) - object.policy = $root.google.iam.v1.Policy.toObject(message.policy, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - return object; - }; - - /** - * Converts this SetIamPolicyRequest to JSON. - * @function toJSON - * @memberof google.iam.v1.SetIamPolicyRequest - * @instance - * @returns {Object.} JSON object - */ - SetIamPolicyRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SetIamPolicyRequest - * @function getTypeUrl - * @memberof google.iam.v1.SetIamPolicyRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SetIamPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.iam.v1.SetIamPolicyRequest"; - }; - - return SetIamPolicyRequest; - })(); - - v1.GetIamPolicyRequest = (function() { - - /** - * Properties of a GetIamPolicyRequest. - * @memberof google.iam.v1 - * @interface IGetIamPolicyRequest - * @property {string|null} [resource] GetIamPolicyRequest resource - * @property {google.iam.v1.IGetPolicyOptions|null} [options] GetIamPolicyRequest options - */ - - /** - * Constructs a new GetIamPolicyRequest. - * @memberof google.iam.v1 - * @classdesc Represents a GetIamPolicyRequest. - * @implements IGetIamPolicyRequest - * @constructor - * @param {google.iam.v1.IGetIamPolicyRequest=} [properties] Properties to set - */ - function GetIamPolicyRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIamPolicyRequest resource. - * @member {string} resource - * @memberof google.iam.v1.GetIamPolicyRequest - * @instance - */ - GetIamPolicyRequest.prototype.resource = ""; - - /** - * GetIamPolicyRequest options. - * @member {google.iam.v1.IGetPolicyOptions|null|undefined} options - * @memberof google.iam.v1.GetIamPolicyRequest - * @instance - */ - GetIamPolicyRequest.prototype.options = null; - - /** - * Creates a new GetIamPolicyRequest instance using the specified properties. - * @function create - * @memberof google.iam.v1.GetIamPolicyRequest - * @static - * @param {google.iam.v1.IGetIamPolicyRequest=} [properties] Properties to set - * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest instance - */ - GetIamPolicyRequest.create = function create(properties) { - return new GetIamPolicyRequest(properties); - }; - - /** - * Encodes the specified GetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. - * @function encode - * @memberof google.iam.v1.GetIamPolicyRequest - * @static - * @param {google.iam.v1.IGetIamPolicyRequest} message GetIamPolicyRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIamPolicyRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.iam.v1.GetPolicyOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.iam.v1.GetIamPolicyRequest - * @static - * @param {google.iam.v1.IGetIamPolicyRequest} message GetIamPolicyRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIamPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIamPolicyRequest message from the specified reader or buffer. - * @function decode - * @memberof google.iam.v1.GetIamPolicyRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIamPolicyRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.GetIamPolicyRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.resource = reader.string(); - break; - } - case 2: { - message.options = $root.google.iam.v1.GetPolicyOptions.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIamPolicyRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.iam.v1.GetIamPolicyRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIamPolicyRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIamPolicyRequest message. - * @function verify - * @memberof google.iam.v1.GetIamPolicyRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIamPolicyRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.resource != null && message.hasOwnProperty("resource")) - if (!$util.isString(message.resource)) - return "resource: string expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.iam.v1.GetPolicyOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates a GetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.iam.v1.GetIamPolicyRequest - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest - */ - GetIamPolicyRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.GetIamPolicyRequest) - return object; - var message = new $root.google.iam.v1.GetIamPolicyRequest(); - if (object.resource != null) - message.resource = String(object.resource); - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.iam.v1.GetIamPolicyRequest.options: object expected"); - message.options = $root.google.iam.v1.GetPolicyOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from a GetIamPolicyRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.iam.v1.GetIamPolicyRequest - * @static - * @param {google.iam.v1.GetIamPolicyRequest} message GetIamPolicyRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIamPolicyRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.resource = ""; - object.options = null; - } - if (message.resource != null && message.hasOwnProperty("resource")) - object.resource = message.resource; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.iam.v1.GetPolicyOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this GetIamPolicyRequest to JSON. - * @function toJSON - * @memberof google.iam.v1.GetIamPolicyRequest - * @instance - * @returns {Object.} JSON object - */ - GetIamPolicyRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetIamPolicyRequest - * @function getTypeUrl - * @memberof google.iam.v1.GetIamPolicyRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetIamPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.iam.v1.GetIamPolicyRequest"; - }; - - return GetIamPolicyRequest; - })(); - - v1.TestIamPermissionsRequest = (function() { - - /** - * Properties of a TestIamPermissionsRequest. - * @memberof google.iam.v1 - * @interface ITestIamPermissionsRequest - * @property {string|null} [resource] TestIamPermissionsRequest resource - * @property {Array.|null} [permissions] TestIamPermissionsRequest permissions - */ - - /** - * Constructs a new TestIamPermissionsRequest. - * @memberof google.iam.v1 - * @classdesc Represents a TestIamPermissionsRequest. - * @implements ITestIamPermissionsRequest - * @constructor - * @param {google.iam.v1.ITestIamPermissionsRequest=} [properties] Properties to set - */ - function TestIamPermissionsRequest(properties) { - this.permissions = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TestIamPermissionsRequest resource. - * @member {string} resource - * @memberof google.iam.v1.TestIamPermissionsRequest - * @instance - */ - TestIamPermissionsRequest.prototype.resource = ""; - - /** - * TestIamPermissionsRequest permissions. - * @member {Array.} permissions - * @memberof google.iam.v1.TestIamPermissionsRequest - * @instance - */ - TestIamPermissionsRequest.prototype.permissions = $util.emptyArray; - - /** - * Creates a new TestIamPermissionsRequest instance using the specified properties. - * @function create - * @memberof google.iam.v1.TestIamPermissionsRequest - * @static - * @param {google.iam.v1.ITestIamPermissionsRequest=} [properties] Properties to set - * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest instance - */ - TestIamPermissionsRequest.create = function create(properties) { - return new TestIamPermissionsRequest(properties); - }; - - /** - * Encodes the specified TestIamPermissionsRequest message. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. - * @function encode - * @memberof google.iam.v1.TestIamPermissionsRequest - * @static - * @param {google.iam.v1.ITestIamPermissionsRequest} message TestIamPermissionsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TestIamPermissionsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); - if (message.permissions != null && message.permissions.length) - for (var i = 0; i < message.permissions.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.permissions[i]); - return writer; - }; - - /** - * Encodes the specified TestIamPermissionsRequest message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.iam.v1.TestIamPermissionsRequest - * @static - * @param {google.iam.v1.ITestIamPermissionsRequest} message TestIamPermissionsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TestIamPermissionsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TestIamPermissionsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.iam.v1.TestIamPermissionsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TestIamPermissionsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.TestIamPermissionsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.resource = reader.string(); - break; - } - case 2: { - if (!(message.permissions && message.permissions.length)) - message.permissions = []; - message.permissions.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TestIamPermissionsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.iam.v1.TestIamPermissionsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TestIamPermissionsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TestIamPermissionsRequest message. - * @function verify - * @memberof google.iam.v1.TestIamPermissionsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TestIamPermissionsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.resource != null && message.hasOwnProperty("resource")) - if (!$util.isString(message.resource)) - return "resource: string expected"; - if (message.permissions != null && message.hasOwnProperty("permissions")) { - if (!Array.isArray(message.permissions)) - return "permissions: array expected"; - for (var i = 0; i < message.permissions.length; ++i) - if (!$util.isString(message.permissions[i])) - return "permissions: string[] expected"; - } - return null; - }; - - /** - * Creates a TestIamPermissionsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.iam.v1.TestIamPermissionsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest - */ - TestIamPermissionsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.TestIamPermissionsRequest) - return object; - var message = new $root.google.iam.v1.TestIamPermissionsRequest(); - if (object.resource != null) - message.resource = String(object.resource); - if (object.permissions) { - if (!Array.isArray(object.permissions)) - throw TypeError(".google.iam.v1.TestIamPermissionsRequest.permissions: array expected"); - message.permissions = []; - for (var i = 0; i < object.permissions.length; ++i) - message.permissions[i] = String(object.permissions[i]); - } - return message; - }; - - /** - * Creates a plain object from a TestIamPermissionsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.iam.v1.TestIamPermissionsRequest - * @static - * @param {google.iam.v1.TestIamPermissionsRequest} message TestIamPermissionsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TestIamPermissionsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.permissions = []; - if (options.defaults) - object.resource = ""; - if (message.resource != null && message.hasOwnProperty("resource")) - object.resource = message.resource; - if (message.permissions && message.permissions.length) { - object.permissions = []; - for (var j = 0; j < message.permissions.length; ++j) - object.permissions[j] = message.permissions[j]; - } - return object; - }; - - /** - * Converts this TestIamPermissionsRequest to JSON. - * @function toJSON - * @memberof google.iam.v1.TestIamPermissionsRequest - * @instance - * @returns {Object.} JSON object - */ - TestIamPermissionsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TestIamPermissionsRequest - * @function getTypeUrl - * @memberof google.iam.v1.TestIamPermissionsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TestIamPermissionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.iam.v1.TestIamPermissionsRequest"; - }; - - return TestIamPermissionsRequest; - })(); - - v1.TestIamPermissionsResponse = (function() { - - /** - * Properties of a TestIamPermissionsResponse. - * @memberof google.iam.v1 - * @interface ITestIamPermissionsResponse - * @property {Array.|null} [permissions] TestIamPermissionsResponse permissions - */ - - /** - * Constructs a new TestIamPermissionsResponse. - * @memberof google.iam.v1 - * @classdesc Represents a TestIamPermissionsResponse. - * @implements ITestIamPermissionsResponse - * @constructor - * @param {google.iam.v1.ITestIamPermissionsResponse=} [properties] Properties to set - */ - function TestIamPermissionsResponse(properties) { - this.permissions = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TestIamPermissionsResponse permissions. - * @member {Array.} permissions - * @memberof google.iam.v1.TestIamPermissionsResponse - * @instance - */ - TestIamPermissionsResponse.prototype.permissions = $util.emptyArray; - - /** - * Creates a new TestIamPermissionsResponse instance using the specified properties. - * @function create - * @memberof google.iam.v1.TestIamPermissionsResponse - * @static - * @param {google.iam.v1.ITestIamPermissionsResponse=} [properties] Properties to set - * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse instance - */ - TestIamPermissionsResponse.create = function create(properties) { - return new TestIamPermissionsResponse(properties); - }; - - /** - * Encodes the specified TestIamPermissionsResponse message. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. - * @function encode - * @memberof google.iam.v1.TestIamPermissionsResponse - * @static - * @param {google.iam.v1.ITestIamPermissionsResponse} message TestIamPermissionsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TestIamPermissionsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.permissions != null && message.permissions.length) - for (var i = 0; i < message.permissions.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.permissions[i]); - return writer; - }; - - /** - * Encodes the specified TestIamPermissionsResponse message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.iam.v1.TestIamPermissionsResponse - * @static - * @param {google.iam.v1.ITestIamPermissionsResponse} message TestIamPermissionsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TestIamPermissionsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TestIamPermissionsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.iam.v1.TestIamPermissionsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TestIamPermissionsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.TestIamPermissionsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.permissions && message.permissions.length)) - message.permissions = []; - message.permissions.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TestIamPermissionsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.iam.v1.TestIamPermissionsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TestIamPermissionsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TestIamPermissionsResponse message. - * @function verify - * @memberof google.iam.v1.TestIamPermissionsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TestIamPermissionsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.permissions != null && message.hasOwnProperty("permissions")) { - if (!Array.isArray(message.permissions)) - return "permissions: array expected"; - for (var i = 0; i < message.permissions.length; ++i) - if (!$util.isString(message.permissions[i])) - return "permissions: string[] expected"; - } - return null; - }; - - /** - * Creates a TestIamPermissionsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.iam.v1.TestIamPermissionsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse - */ - TestIamPermissionsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.TestIamPermissionsResponse) - return object; - var message = new $root.google.iam.v1.TestIamPermissionsResponse(); - if (object.permissions) { - if (!Array.isArray(object.permissions)) - throw TypeError(".google.iam.v1.TestIamPermissionsResponse.permissions: array expected"); - message.permissions = []; - for (var i = 0; i < object.permissions.length; ++i) - message.permissions[i] = String(object.permissions[i]); - } - return message; - }; - - /** - * Creates a plain object from a TestIamPermissionsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.iam.v1.TestIamPermissionsResponse - * @static - * @param {google.iam.v1.TestIamPermissionsResponse} message TestIamPermissionsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TestIamPermissionsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.permissions = []; - if (message.permissions && message.permissions.length) { - object.permissions = []; - for (var j = 0; j < message.permissions.length; ++j) - object.permissions[j] = message.permissions[j]; - } - return object; - }; - - /** - * Converts this TestIamPermissionsResponse to JSON. - * @function toJSON - * @memberof google.iam.v1.TestIamPermissionsResponse - * @instance - * @returns {Object.} JSON object - */ - TestIamPermissionsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TestIamPermissionsResponse - * @function getTypeUrl - * @memberof google.iam.v1.TestIamPermissionsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TestIamPermissionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.iam.v1.TestIamPermissionsResponse"; - }; - - return TestIamPermissionsResponse; - })(); - - v1.GetPolicyOptions = (function() { - - /** - * Properties of a GetPolicyOptions. - * @memberof google.iam.v1 - * @interface IGetPolicyOptions - * @property {number|null} [requestedPolicyVersion] GetPolicyOptions requestedPolicyVersion - */ - - /** - * Constructs a new GetPolicyOptions. - * @memberof google.iam.v1 - * @classdesc Represents a GetPolicyOptions. - * @implements IGetPolicyOptions - * @constructor - * @param {google.iam.v1.IGetPolicyOptions=} [properties] Properties to set - */ - function GetPolicyOptions(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetPolicyOptions requestedPolicyVersion. - * @member {number} requestedPolicyVersion - * @memberof google.iam.v1.GetPolicyOptions - * @instance - */ - GetPolicyOptions.prototype.requestedPolicyVersion = 0; - - /** - * Creates a new GetPolicyOptions instance using the specified properties. - * @function create - * @memberof google.iam.v1.GetPolicyOptions - * @static - * @param {google.iam.v1.IGetPolicyOptions=} [properties] Properties to set - * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions instance - */ - GetPolicyOptions.create = function create(properties) { - return new GetPolicyOptions(properties); - }; - - /** - * Encodes the specified GetPolicyOptions message. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages. - * @function encode - * @memberof google.iam.v1.GetPolicyOptions - * @static - * @param {google.iam.v1.IGetPolicyOptions} message GetPolicyOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetPolicyOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.requestedPolicyVersion != null && Object.hasOwnProperty.call(message, "requestedPolicyVersion")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.requestedPolicyVersion); - return writer; - }; - - /** - * Encodes the specified GetPolicyOptions message, length delimited. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.iam.v1.GetPolicyOptions - * @static - * @param {google.iam.v1.IGetPolicyOptions} message GetPolicyOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetPolicyOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetPolicyOptions message from the specified reader or buffer. - * @function decode - * @memberof google.iam.v1.GetPolicyOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetPolicyOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.GetPolicyOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.requestedPolicyVersion = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetPolicyOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.iam.v1.GetPolicyOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetPolicyOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetPolicyOptions message. - * @function verify - * @memberof google.iam.v1.GetPolicyOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetPolicyOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.requestedPolicyVersion != null && message.hasOwnProperty("requestedPolicyVersion")) - if (!$util.isInteger(message.requestedPolicyVersion)) - return "requestedPolicyVersion: integer expected"; - return null; - }; - - /** - * Creates a GetPolicyOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.iam.v1.GetPolicyOptions - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions - */ - GetPolicyOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.GetPolicyOptions) - return object; - var message = new $root.google.iam.v1.GetPolicyOptions(); - if (object.requestedPolicyVersion != null) - message.requestedPolicyVersion = object.requestedPolicyVersion | 0; - return message; - }; - - /** - * Creates a plain object from a GetPolicyOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.iam.v1.GetPolicyOptions - * @static - * @param {google.iam.v1.GetPolicyOptions} message GetPolicyOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetPolicyOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.requestedPolicyVersion = 0; - if (message.requestedPolicyVersion != null && message.hasOwnProperty("requestedPolicyVersion")) - object.requestedPolicyVersion = message.requestedPolicyVersion; - return object; - }; - - /** - * Converts this GetPolicyOptions to JSON. - * @function toJSON - * @memberof google.iam.v1.GetPolicyOptions - * @instance - * @returns {Object.} JSON object - */ - GetPolicyOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetPolicyOptions - * @function getTypeUrl - * @memberof google.iam.v1.GetPolicyOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetPolicyOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.iam.v1.GetPolicyOptions"; - }; - - return GetPolicyOptions; - })(); - - v1.Policy = (function() { - - /** - * Properties of a Policy. - * @memberof google.iam.v1 - * @interface IPolicy - * @property {number|null} [version] Policy version - * @property {Array.|null} [bindings] Policy bindings - * @property {Array.|null} [auditConfigs] Policy auditConfigs - * @property {Uint8Array|null} [etag] Policy etag - */ - - /** - * Constructs a new Policy. - * @memberof google.iam.v1 - * @classdesc Represents a Policy. - * @implements IPolicy - * @constructor - * @param {google.iam.v1.IPolicy=} [properties] Properties to set - */ - function Policy(properties) { - this.bindings = []; - this.auditConfigs = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Policy version. - * @member {number} version - * @memberof google.iam.v1.Policy - * @instance - */ - Policy.prototype.version = 0; - - /** - * Policy bindings. - * @member {Array.} bindings - * @memberof google.iam.v1.Policy - * @instance - */ - Policy.prototype.bindings = $util.emptyArray; - - /** - * Policy auditConfigs. - * @member {Array.} auditConfigs - * @memberof google.iam.v1.Policy - * @instance - */ - Policy.prototype.auditConfigs = $util.emptyArray; - - /** - * Policy etag. - * @member {Uint8Array} etag - * @memberof google.iam.v1.Policy - * @instance - */ - Policy.prototype.etag = $util.newBuffer([]); - - /** - * Creates a new Policy instance using the specified properties. - * @function create - * @memberof google.iam.v1.Policy - * @static - * @param {google.iam.v1.IPolicy=} [properties] Properties to set - * @returns {google.iam.v1.Policy} Policy instance - */ - Policy.create = function create(properties) { - return new Policy(properties); - }; - - /** - * Encodes the specified Policy message. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. - * @function encode - * @memberof google.iam.v1.Policy - * @static - * @param {google.iam.v1.IPolicy} message Policy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Policy.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.version); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.etag); - if (message.bindings != null && message.bindings.length) - for (var i = 0; i < message.bindings.length; ++i) - $root.google.iam.v1.Binding.encode(message.bindings[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.auditConfigs != null && message.auditConfigs.length) - for (var i = 0; i < message.auditConfigs.length; ++i) - $root.google.iam.v1.AuditConfig.encode(message.auditConfigs[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Policy message, length delimited. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. - * @function encodeDelimited - * @memberof google.iam.v1.Policy - * @static - * @param {google.iam.v1.IPolicy} message Policy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Policy.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Policy message from the specified reader or buffer. - * @function decode - * @memberof google.iam.v1.Policy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.Policy} Policy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Policy.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.Policy(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.version = reader.int32(); - break; - } - case 4: { - if (!(message.bindings && message.bindings.length)) - message.bindings = []; - message.bindings.push($root.google.iam.v1.Binding.decode(reader, reader.uint32())); - break; - } - case 6: { - if (!(message.auditConfigs && message.auditConfigs.length)) - message.auditConfigs = []; - message.auditConfigs.push($root.google.iam.v1.AuditConfig.decode(reader, reader.uint32())); - break; - } - case 3: { - message.etag = reader.bytes(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Policy message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.iam.v1.Policy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.Policy} Policy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Policy.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Policy message. - * @function verify - * @memberof google.iam.v1.Policy - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Policy.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.version != null && message.hasOwnProperty("version")) - if (!$util.isInteger(message.version)) - return "version: integer expected"; - if (message.bindings != null && message.hasOwnProperty("bindings")) { - if (!Array.isArray(message.bindings)) - return "bindings: array expected"; - for (var i = 0; i < message.bindings.length; ++i) { - var error = $root.google.iam.v1.Binding.verify(message.bindings[i]); - if (error) - return "bindings." + error; - } - } - if (message.auditConfigs != null && message.hasOwnProperty("auditConfigs")) { - if (!Array.isArray(message.auditConfigs)) - return "auditConfigs: array expected"; - for (var i = 0; i < message.auditConfigs.length; ++i) { - var error = $root.google.iam.v1.AuditConfig.verify(message.auditConfigs[i]); - if (error) - return "auditConfigs." + error; - } - } - if (message.etag != null && message.hasOwnProperty("etag")) - if (!(message.etag && typeof message.etag.length === "number" || $util.isString(message.etag))) - return "etag: buffer expected"; - return null; - }; - - /** - * Creates a Policy message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.iam.v1.Policy - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v1.Policy} Policy - */ - Policy.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.Policy) - return object; - var message = new $root.google.iam.v1.Policy(); - if (object.version != null) - message.version = object.version | 0; - if (object.bindings) { - if (!Array.isArray(object.bindings)) - throw TypeError(".google.iam.v1.Policy.bindings: array expected"); - message.bindings = []; - for (var i = 0; i < object.bindings.length; ++i) { - if (typeof object.bindings[i] !== "object") - throw TypeError(".google.iam.v1.Policy.bindings: object expected"); - message.bindings[i] = $root.google.iam.v1.Binding.fromObject(object.bindings[i]); - } - } - if (object.auditConfigs) { - if (!Array.isArray(object.auditConfigs)) - throw TypeError(".google.iam.v1.Policy.auditConfigs: array expected"); - message.auditConfigs = []; - for (var i = 0; i < object.auditConfigs.length; ++i) { - if (typeof object.auditConfigs[i] !== "object") - throw TypeError(".google.iam.v1.Policy.auditConfigs: object expected"); - message.auditConfigs[i] = $root.google.iam.v1.AuditConfig.fromObject(object.auditConfigs[i]); - } - } - if (object.etag != null) - if (typeof object.etag === "string") - $util.base64.decode(object.etag, message.etag = $util.newBuffer($util.base64.length(object.etag)), 0); - else if (object.etag.length >= 0) - message.etag = object.etag; - return message; - }; - - /** - * Creates a plain object from a Policy message. Also converts values to other types if specified. - * @function toObject - * @memberof google.iam.v1.Policy - * @static - * @param {google.iam.v1.Policy} message Policy - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Policy.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.bindings = []; - object.auditConfigs = []; - } - if (options.defaults) { - object.version = 0; - if (options.bytes === String) - object.etag = ""; - else { - object.etag = []; - if (options.bytes !== Array) - object.etag = $util.newBuffer(object.etag); - } - } - if (message.version != null && message.hasOwnProperty("version")) - object.version = message.version; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = options.bytes === String ? $util.base64.encode(message.etag, 0, message.etag.length) : options.bytes === Array ? Array.prototype.slice.call(message.etag) : message.etag; - if (message.bindings && message.bindings.length) { - object.bindings = []; - for (var j = 0; j < message.bindings.length; ++j) - object.bindings[j] = $root.google.iam.v1.Binding.toObject(message.bindings[j], options); - } - if (message.auditConfigs && message.auditConfigs.length) { - object.auditConfigs = []; - for (var j = 0; j < message.auditConfigs.length; ++j) - object.auditConfigs[j] = $root.google.iam.v1.AuditConfig.toObject(message.auditConfigs[j], options); - } - return object; - }; - - /** - * Converts this Policy to JSON. - * @function toJSON - * @memberof google.iam.v1.Policy - * @instance - * @returns {Object.} JSON object - */ - Policy.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Policy - * @function getTypeUrl - * @memberof google.iam.v1.Policy - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Policy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.iam.v1.Policy"; - }; - - return Policy; - })(); - - v1.Binding = (function() { - - /** - * Properties of a Binding. - * @memberof google.iam.v1 - * @interface IBinding - * @property {string|null} [role] Binding role - * @property {Array.|null} [members] Binding members - * @property {google.type.IExpr|null} [condition] Binding condition - */ - - /** - * Constructs a new Binding. - * @memberof google.iam.v1 - * @classdesc Represents a Binding. - * @implements IBinding - * @constructor - * @param {google.iam.v1.IBinding=} [properties] Properties to set - */ - function Binding(properties) { - this.members = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Binding role. - * @member {string} role - * @memberof google.iam.v1.Binding - * @instance - */ - Binding.prototype.role = ""; - - /** - * Binding members. - * @member {Array.} members - * @memberof google.iam.v1.Binding - * @instance - */ - Binding.prototype.members = $util.emptyArray; - - /** - * Binding condition. - * @member {google.type.IExpr|null|undefined} condition - * @memberof google.iam.v1.Binding - * @instance - */ - Binding.prototype.condition = null; - - /** - * Creates a new Binding instance using the specified properties. - * @function create - * @memberof google.iam.v1.Binding - * @static - * @param {google.iam.v1.IBinding=} [properties] Properties to set - * @returns {google.iam.v1.Binding} Binding instance - */ - Binding.create = function create(properties) { - return new Binding(properties); - }; - - /** - * Encodes the specified Binding message. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. - * @function encode - * @memberof google.iam.v1.Binding - * @static - * @param {google.iam.v1.IBinding} message Binding message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Binding.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.role != null && Object.hasOwnProperty.call(message, "role")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.role); - if (message.members != null && message.members.length) - for (var i = 0; i < message.members.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.members[i]); - if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) - $root.google.type.Expr.encode(message.condition, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Binding message, length delimited. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. - * @function encodeDelimited - * @memberof google.iam.v1.Binding - * @static - * @param {google.iam.v1.IBinding} message Binding message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Binding.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Binding message from the specified reader or buffer. - * @function decode - * @memberof google.iam.v1.Binding - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.Binding} Binding - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Binding.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.Binding(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.role = reader.string(); - break; - } - case 2: { - if (!(message.members && message.members.length)) - message.members = []; - message.members.push(reader.string()); - break; - } - case 3: { - message.condition = $root.google.type.Expr.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Binding message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.iam.v1.Binding - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.Binding} Binding - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Binding.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Binding message. - * @function verify - * @memberof google.iam.v1.Binding - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Binding.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.role != null && message.hasOwnProperty("role")) - if (!$util.isString(message.role)) - return "role: string expected"; - if (message.members != null && message.hasOwnProperty("members")) { - if (!Array.isArray(message.members)) - return "members: array expected"; - for (var i = 0; i < message.members.length; ++i) - if (!$util.isString(message.members[i])) - return "members: string[] expected"; - } - if (message.condition != null && message.hasOwnProperty("condition")) { - var error = $root.google.type.Expr.verify(message.condition); - if (error) - return "condition." + error; - } - return null; - }; - - /** - * Creates a Binding message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.iam.v1.Binding - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v1.Binding} Binding - */ - Binding.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.Binding) - return object; - var message = new $root.google.iam.v1.Binding(); - if (object.role != null) - message.role = String(object.role); - if (object.members) { - if (!Array.isArray(object.members)) - throw TypeError(".google.iam.v1.Binding.members: array expected"); - message.members = []; - for (var i = 0; i < object.members.length; ++i) - message.members[i] = String(object.members[i]); - } - if (object.condition != null) { - if (typeof object.condition !== "object") - throw TypeError(".google.iam.v1.Binding.condition: object expected"); - message.condition = $root.google.type.Expr.fromObject(object.condition); - } - return message; - }; - - /** - * Creates a plain object from a Binding message. Also converts values to other types if specified. - * @function toObject - * @memberof google.iam.v1.Binding - * @static - * @param {google.iam.v1.Binding} message Binding - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Binding.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.members = []; - if (options.defaults) { - object.role = ""; - object.condition = null; - } - if (message.role != null && message.hasOwnProperty("role")) - object.role = message.role; - if (message.members && message.members.length) { - object.members = []; - for (var j = 0; j < message.members.length; ++j) - object.members[j] = message.members[j]; - } - if (message.condition != null && message.hasOwnProperty("condition")) - object.condition = $root.google.type.Expr.toObject(message.condition, options); - return object; - }; - - /** - * Converts this Binding to JSON. - * @function toJSON - * @memberof google.iam.v1.Binding - * @instance - * @returns {Object.} JSON object - */ - Binding.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Binding - * @function getTypeUrl - * @memberof google.iam.v1.Binding - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Binding.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.iam.v1.Binding"; - }; - - return Binding; - })(); - - v1.AuditConfig = (function() { - - /** - * Properties of an AuditConfig. - * @memberof google.iam.v1 - * @interface IAuditConfig - * @property {string|null} [service] AuditConfig service - * @property {Array.|null} [auditLogConfigs] AuditConfig auditLogConfigs - */ - - /** - * Constructs a new AuditConfig. - * @memberof google.iam.v1 - * @classdesc Represents an AuditConfig. - * @implements IAuditConfig - * @constructor - * @param {google.iam.v1.IAuditConfig=} [properties] Properties to set - */ - function AuditConfig(properties) { - this.auditLogConfigs = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AuditConfig service. - * @member {string} service - * @memberof google.iam.v1.AuditConfig - * @instance - */ - AuditConfig.prototype.service = ""; - - /** - * AuditConfig auditLogConfigs. - * @member {Array.} auditLogConfigs - * @memberof google.iam.v1.AuditConfig - * @instance - */ - AuditConfig.prototype.auditLogConfigs = $util.emptyArray; - - /** - * Creates a new AuditConfig instance using the specified properties. - * @function create - * @memberof google.iam.v1.AuditConfig - * @static - * @param {google.iam.v1.IAuditConfig=} [properties] Properties to set - * @returns {google.iam.v1.AuditConfig} AuditConfig instance - */ - AuditConfig.create = function create(properties) { - return new AuditConfig(properties); - }; - - /** - * Encodes the specified AuditConfig message. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. - * @function encode - * @memberof google.iam.v1.AuditConfig - * @static - * @param {google.iam.v1.IAuditConfig} message AuditConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AuditConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.service != null && Object.hasOwnProperty.call(message, "service")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.service); - if (message.auditLogConfigs != null && message.auditLogConfigs.length) - for (var i = 0; i < message.auditLogConfigs.length; ++i) - $root.google.iam.v1.AuditLogConfig.encode(message.auditLogConfigs[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified AuditConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.iam.v1.AuditConfig - * @static - * @param {google.iam.v1.IAuditConfig} message AuditConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AuditConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AuditConfig message from the specified reader or buffer. - * @function decode - * @memberof google.iam.v1.AuditConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.AuditConfig} AuditConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AuditConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.AuditConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.service = reader.string(); - break; - } - case 3: { - if (!(message.auditLogConfigs && message.auditLogConfigs.length)) - message.auditLogConfigs = []; - message.auditLogConfigs.push($root.google.iam.v1.AuditLogConfig.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AuditConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.iam.v1.AuditConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.AuditConfig} AuditConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AuditConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AuditConfig message. - * @function verify - * @memberof google.iam.v1.AuditConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AuditConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.service != null && message.hasOwnProperty("service")) - if (!$util.isString(message.service)) - return "service: string expected"; - if (message.auditLogConfigs != null && message.hasOwnProperty("auditLogConfigs")) { - if (!Array.isArray(message.auditLogConfigs)) - return "auditLogConfigs: array expected"; - for (var i = 0; i < message.auditLogConfigs.length; ++i) { - var error = $root.google.iam.v1.AuditLogConfig.verify(message.auditLogConfigs[i]); - if (error) - return "auditLogConfigs." + error; - } - } - return null; - }; - - /** - * Creates an AuditConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.iam.v1.AuditConfig - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v1.AuditConfig} AuditConfig - */ - AuditConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.AuditConfig) - return object; - var message = new $root.google.iam.v1.AuditConfig(); - if (object.service != null) - message.service = String(object.service); - if (object.auditLogConfigs) { - if (!Array.isArray(object.auditLogConfigs)) - throw TypeError(".google.iam.v1.AuditConfig.auditLogConfigs: array expected"); - message.auditLogConfigs = []; - for (var i = 0; i < object.auditLogConfigs.length; ++i) { - if (typeof object.auditLogConfigs[i] !== "object") - throw TypeError(".google.iam.v1.AuditConfig.auditLogConfigs: object expected"); - message.auditLogConfigs[i] = $root.google.iam.v1.AuditLogConfig.fromObject(object.auditLogConfigs[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an AuditConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.iam.v1.AuditConfig - * @static - * @param {google.iam.v1.AuditConfig} message AuditConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AuditConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.auditLogConfigs = []; - if (options.defaults) - object.service = ""; - if (message.service != null && message.hasOwnProperty("service")) - object.service = message.service; - if (message.auditLogConfigs && message.auditLogConfigs.length) { - object.auditLogConfigs = []; - for (var j = 0; j < message.auditLogConfigs.length; ++j) - object.auditLogConfigs[j] = $root.google.iam.v1.AuditLogConfig.toObject(message.auditLogConfigs[j], options); - } - return object; - }; - - /** - * Converts this AuditConfig to JSON. - * @function toJSON - * @memberof google.iam.v1.AuditConfig - * @instance - * @returns {Object.} JSON object - */ - AuditConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AuditConfig - * @function getTypeUrl - * @memberof google.iam.v1.AuditConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AuditConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.iam.v1.AuditConfig"; - }; - - return AuditConfig; - })(); - - v1.AuditLogConfig = (function() { - - /** - * Properties of an AuditLogConfig. - * @memberof google.iam.v1 - * @interface IAuditLogConfig - * @property {google.iam.v1.AuditLogConfig.LogType|null} [logType] AuditLogConfig logType - * @property {Array.|null} [exemptedMembers] AuditLogConfig exemptedMembers - */ - - /** - * Constructs a new AuditLogConfig. - * @memberof google.iam.v1 - * @classdesc Represents an AuditLogConfig. - * @implements IAuditLogConfig - * @constructor - * @param {google.iam.v1.IAuditLogConfig=} [properties] Properties to set - */ - function AuditLogConfig(properties) { - this.exemptedMembers = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AuditLogConfig logType. - * @member {google.iam.v1.AuditLogConfig.LogType} logType - * @memberof google.iam.v1.AuditLogConfig - * @instance - */ - AuditLogConfig.prototype.logType = 0; - - /** - * AuditLogConfig exemptedMembers. - * @member {Array.} exemptedMembers - * @memberof google.iam.v1.AuditLogConfig - * @instance - */ - AuditLogConfig.prototype.exemptedMembers = $util.emptyArray; - - /** - * Creates a new AuditLogConfig instance using the specified properties. - * @function create - * @memberof google.iam.v1.AuditLogConfig - * @static - * @param {google.iam.v1.IAuditLogConfig=} [properties] Properties to set - * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig instance - */ - AuditLogConfig.create = function create(properties) { - return new AuditLogConfig(properties); - }; - - /** - * Encodes the specified AuditLogConfig message. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. - * @function encode - * @memberof google.iam.v1.AuditLogConfig - * @static - * @param {google.iam.v1.IAuditLogConfig} message AuditLogConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AuditLogConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.logType != null && Object.hasOwnProperty.call(message, "logType")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.logType); - if (message.exemptedMembers != null && message.exemptedMembers.length) - for (var i = 0; i < message.exemptedMembers.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.exemptedMembers[i]); - return writer; - }; - - /** - * Encodes the specified AuditLogConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.iam.v1.AuditLogConfig - * @static - * @param {google.iam.v1.IAuditLogConfig} message AuditLogConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AuditLogConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AuditLogConfig message from the specified reader or buffer. - * @function decode - * @memberof google.iam.v1.AuditLogConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AuditLogConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.AuditLogConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.logType = reader.int32(); - break; - } - case 2: { - if (!(message.exemptedMembers && message.exemptedMembers.length)) - message.exemptedMembers = []; - message.exemptedMembers.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AuditLogConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.iam.v1.AuditLogConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AuditLogConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AuditLogConfig message. - * @function verify - * @memberof google.iam.v1.AuditLogConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AuditLogConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.logType != null && message.hasOwnProperty("logType")) - switch (message.logType) { - default: - return "logType: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.exemptedMembers != null && message.hasOwnProperty("exemptedMembers")) { - if (!Array.isArray(message.exemptedMembers)) - return "exemptedMembers: array expected"; - for (var i = 0; i < message.exemptedMembers.length; ++i) - if (!$util.isString(message.exemptedMembers[i])) - return "exemptedMembers: string[] expected"; - } - return null; - }; - - /** - * Creates an AuditLogConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.iam.v1.AuditLogConfig - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig - */ - AuditLogConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.AuditLogConfig) - return object; - var message = new $root.google.iam.v1.AuditLogConfig(); - switch (object.logType) { - default: - if (typeof object.logType === "number") { - message.logType = object.logType; - break; - } - break; - case "LOG_TYPE_UNSPECIFIED": - case 0: - message.logType = 0; - break; - case "ADMIN_READ": - case 1: - message.logType = 1; - break; - case "DATA_WRITE": - case 2: - message.logType = 2; - break; - case "DATA_READ": - case 3: - message.logType = 3; - break; - } - if (object.exemptedMembers) { - if (!Array.isArray(object.exemptedMembers)) - throw TypeError(".google.iam.v1.AuditLogConfig.exemptedMembers: array expected"); - message.exemptedMembers = []; - for (var i = 0; i < object.exemptedMembers.length; ++i) - message.exemptedMembers[i] = String(object.exemptedMembers[i]); - } - return message; - }; - - /** - * Creates a plain object from an AuditLogConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.iam.v1.AuditLogConfig - * @static - * @param {google.iam.v1.AuditLogConfig} message AuditLogConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AuditLogConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.exemptedMembers = []; - if (options.defaults) - object.logType = options.enums === String ? "LOG_TYPE_UNSPECIFIED" : 0; - if (message.logType != null && message.hasOwnProperty("logType")) - object.logType = options.enums === String ? $root.google.iam.v1.AuditLogConfig.LogType[message.logType] === undefined ? message.logType : $root.google.iam.v1.AuditLogConfig.LogType[message.logType] : message.logType; - if (message.exemptedMembers && message.exemptedMembers.length) { - object.exemptedMembers = []; - for (var j = 0; j < message.exemptedMembers.length; ++j) - object.exemptedMembers[j] = message.exemptedMembers[j]; - } - return object; - }; - - /** - * Converts this AuditLogConfig to JSON. - * @function toJSON - * @memberof google.iam.v1.AuditLogConfig - * @instance - * @returns {Object.} JSON object - */ - AuditLogConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AuditLogConfig - * @function getTypeUrl - * @memberof google.iam.v1.AuditLogConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AuditLogConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.iam.v1.AuditLogConfig"; - }; - - /** - * LogType enum. - * @name google.iam.v1.AuditLogConfig.LogType - * @enum {number} - * @property {number} LOG_TYPE_UNSPECIFIED=0 LOG_TYPE_UNSPECIFIED value - * @property {number} ADMIN_READ=1 ADMIN_READ value - * @property {number} DATA_WRITE=2 DATA_WRITE value - * @property {number} DATA_READ=3 DATA_READ value - */ - AuditLogConfig.LogType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "LOG_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "ADMIN_READ"] = 1; - values[valuesById[2] = "DATA_WRITE"] = 2; - values[valuesById[3] = "DATA_READ"] = 3; - return values; - })(); - - return AuditLogConfig; - })(); - - v1.PolicyDelta = (function() { - - /** - * Properties of a PolicyDelta. - * @memberof google.iam.v1 - * @interface IPolicyDelta - * @property {Array.|null} [bindingDeltas] PolicyDelta bindingDeltas - * @property {Array.|null} [auditConfigDeltas] PolicyDelta auditConfigDeltas - */ - - /** - * Constructs a new PolicyDelta. - * @memberof google.iam.v1 - * @classdesc Represents a PolicyDelta. - * @implements IPolicyDelta - * @constructor - * @param {google.iam.v1.IPolicyDelta=} [properties] Properties to set - */ - function PolicyDelta(properties) { - this.bindingDeltas = []; - this.auditConfigDeltas = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PolicyDelta bindingDeltas. - * @member {Array.} bindingDeltas - * @memberof google.iam.v1.PolicyDelta - * @instance - */ - PolicyDelta.prototype.bindingDeltas = $util.emptyArray; - - /** - * PolicyDelta auditConfigDeltas. - * @member {Array.} auditConfigDeltas - * @memberof google.iam.v1.PolicyDelta - * @instance - */ - PolicyDelta.prototype.auditConfigDeltas = $util.emptyArray; - - /** - * Creates a new PolicyDelta instance using the specified properties. - * @function create - * @memberof google.iam.v1.PolicyDelta - * @static - * @param {google.iam.v1.IPolicyDelta=} [properties] Properties to set - * @returns {google.iam.v1.PolicyDelta} PolicyDelta instance - */ - PolicyDelta.create = function create(properties) { - return new PolicyDelta(properties); - }; - - /** - * Encodes the specified PolicyDelta message. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. - * @function encode - * @memberof google.iam.v1.PolicyDelta - * @static - * @param {google.iam.v1.IPolicyDelta} message PolicyDelta message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PolicyDelta.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.bindingDeltas != null && message.bindingDeltas.length) - for (var i = 0; i < message.bindingDeltas.length; ++i) - $root.google.iam.v1.BindingDelta.encode(message.bindingDeltas[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.auditConfigDeltas != null && message.auditConfigDeltas.length) - for (var i = 0; i < message.auditConfigDeltas.length; ++i) - $root.google.iam.v1.AuditConfigDelta.encode(message.auditConfigDeltas[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified PolicyDelta message, length delimited. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. - * @function encodeDelimited - * @memberof google.iam.v1.PolicyDelta - * @static - * @param {google.iam.v1.IPolicyDelta} message PolicyDelta message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PolicyDelta.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PolicyDelta message from the specified reader or buffer. - * @function decode - * @memberof google.iam.v1.PolicyDelta - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.PolicyDelta} PolicyDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PolicyDelta.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.PolicyDelta(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.bindingDeltas && message.bindingDeltas.length)) - message.bindingDeltas = []; - message.bindingDeltas.push($root.google.iam.v1.BindingDelta.decode(reader, reader.uint32())); - break; - } - case 2: { - if (!(message.auditConfigDeltas && message.auditConfigDeltas.length)) - message.auditConfigDeltas = []; - message.auditConfigDeltas.push($root.google.iam.v1.AuditConfigDelta.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PolicyDelta message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.iam.v1.PolicyDelta - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.PolicyDelta} PolicyDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PolicyDelta.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PolicyDelta message. - * @function verify - * @memberof google.iam.v1.PolicyDelta - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PolicyDelta.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.bindingDeltas != null && message.hasOwnProperty("bindingDeltas")) { - if (!Array.isArray(message.bindingDeltas)) - return "bindingDeltas: array expected"; - for (var i = 0; i < message.bindingDeltas.length; ++i) { - var error = $root.google.iam.v1.BindingDelta.verify(message.bindingDeltas[i]); - if (error) - return "bindingDeltas." + error; - } - } - if (message.auditConfigDeltas != null && message.hasOwnProperty("auditConfigDeltas")) { - if (!Array.isArray(message.auditConfigDeltas)) - return "auditConfigDeltas: array expected"; - for (var i = 0; i < message.auditConfigDeltas.length; ++i) { - var error = $root.google.iam.v1.AuditConfigDelta.verify(message.auditConfigDeltas[i]); - if (error) - return "auditConfigDeltas." + error; - } - } - return null; - }; - - /** - * Creates a PolicyDelta message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.iam.v1.PolicyDelta - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v1.PolicyDelta} PolicyDelta - */ - PolicyDelta.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.PolicyDelta) - return object; - var message = new $root.google.iam.v1.PolicyDelta(); - if (object.bindingDeltas) { - if (!Array.isArray(object.bindingDeltas)) - throw TypeError(".google.iam.v1.PolicyDelta.bindingDeltas: array expected"); - message.bindingDeltas = []; - for (var i = 0; i < object.bindingDeltas.length; ++i) { - if (typeof object.bindingDeltas[i] !== "object") - throw TypeError(".google.iam.v1.PolicyDelta.bindingDeltas: object expected"); - message.bindingDeltas[i] = $root.google.iam.v1.BindingDelta.fromObject(object.bindingDeltas[i]); - } - } - if (object.auditConfigDeltas) { - if (!Array.isArray(object.auditConfigDeltas)) - throw TypeError(".google.iam.v1.PolicyDelta.auditConfigDeltas: array expected"); - message.auditConfigDeltas = []; - for (var i = 0; i < object.auditConfigDeltas.length; ++i) { - if (typeof object.auditConfigDeltas[i] !== "object") - throw TypeError(".google.iam.v1.PolicyDelta.auditConfigDeltas: object expected"); - message.auditConfigDeltas[i] = $root.google.iam.v1.AuditConfigDelta.fromObject(object.auditConfigDeltas[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a PolicyDelta message. Also converts values to other types if specified. - * @function toObject - * @memberof google.iam.v1.PolicyDelta - * @static - * @param {google.iam.v1.PolicyDelta} message PolicyDelta - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PolicyDelta.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.bindingDeltas = []; - object.auditConfigDeltas = []; - } - if (message.bindingDeltas && message.bindingDeltas.length) { - object.bindingDeltas = []; - for (var j = 0; j < message.bindingDeltas.length; ++j) - object.bindingDeltas[j] = $root.google.iam.v1.BindingDelta.toObject(message.bindingDeltas[j], options); - } - if (message.auditConfigDeltas && message.auditConfigDeltas.length) { - object.auditConfigDeltas = []; - for (var j = 0; j < message.auditConfigDeltas.length; ++j) - object.auditConfigDeltas[j] = $root.google.iam.v1.AuditConfigDelta.toObject(message.auditConfigDeltas[j], options); - } - return object; - }; - - /** - * Converts this PolicyDelta to JSON. - * @function toJSON - * @memberof google.iam.v1.PolicyDelta - * @instance - * @returns {Object.} JSON object - */ - PolicyDelta.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PolicyDelta - * @function getTypeUrl - * @memberof google.iam.v1.PolicyDelta - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PolicyDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.iam.v1.PolicyDelta"; - }; - - return PolicyDelta; - })(); - - v1.BindingDelta = (function() { - - /** - * Properties of a BindingDelta. - * @memberof google.iam.v1 - * @interface IBindingDelta - * @property {google.iam.v1.BindingDelta.Action|null} [action] BindingDelta action - * @property {string|null} [role] BindingDelta role - * @property {string|null} [member] BindingDelta member - * @property {google.type.IExpr|null} [condition] BindingDelta condition - */ - - /** - * Constructs a new BindingDelta. - * @memberof google.iam.v1 - * @classdesc Represents a BindingDelta. - * @implements IBindingDelta - * @constructor - * @param {google.iam.v1.IBindingDelta=} [properties] Properties to set - */ - function BindingDelta(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BindingDelta action. - * @member {google.iam.v1.BindingDelta.Action} action - * @memberof google.iam.v1.BindingDelta - * @instance - */ - BindingDelta.prototype.action = 0; - - /** - * BindingDelta role. - * @member {string} role - * @memberof google.iam.v1.BindingDelta - * @instance - */ - BindingDelta.prototype.role = ""; - - /** - * BindingDelta member. - * @member {string} member - * @memberof google.iam.v1.BindingDelta - * @instance - */ - BindingDelta.prototype.member = ""; - - /** - * BindingDelta condition. - * @member {google.type.IExpr|null|undefined} condition - * @memberof google.iam.v1.BindingDelta - * @instance - */ - BindingDelta.prototype.condition = null; - - /** - * Creates a new BindingDelta instance using the specified properties. - * @function create - * @memberof google.iam.v1.BindingDelta - * @static - * @param {google.iam.v1.IBindingDelta=} [properties] Properties to set - * @returns {google.iam.v1.BindingDelta} BindingDelta instance - */ - BindingDelta.create = function create(properties) { - return new BindingDelta(properties); - }; - - /** - * Encodes the specified BindingDelta message. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. - * @function encode - * @memberof google.iam.v1.BindingDelta - * @static - * @param {google.iam.v1.IBindingDelta} message BindingDelta message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BindingDelta.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.action != null && Object.hasOwnProperty.call(message, "action")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); - if (message.role != null && Object.hasOwnProperty.call(message, "role")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.role); - if (message.member != null && Object.hasOwnProperty.call(message, "member")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.member); - if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) - $root.google.type.Expr.encode(message.condition, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified BindingDelta message, length delimited. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. - * @function encodeDelimited - * @memberof google.iam.v1.BindingDelta - * @static - * @param {google.iam.v1.IBindingDelta} message BindingDelta message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BindingDelta.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BindingDelta message from the specified reader or buffer. - * @function decode - * @memberof google.iam.v1.BindingDelta - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.BindingDelta} BindingDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BindingDelta.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.BindingDelta(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.action = reader.int32(); - break; - } - case 2: { - message.role = reader.string(); - break; - } - case 3: { - message.member = reader.string(); - break; - } - case 4: { - message.condition = $root.google.type.Expr.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BindingDelta message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.iam.v1.BindingDelta - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.BindingDelta} BindingDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BindingDelta.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BindingDelta message. - * @function verify - * @memberof google.iam.v1.BindingDelta - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BindingDelta.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.action != null && message.hasOwnProperty("action")) - switch (message.action) { - default: - return "action: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.role != null && message.hasOwnProperty("role")) - if (!$util.isString(message.role)) - return "role: string expected"; - if (message.member != null && message.hasOwnProperty("member")) - if (!$util.isString(message.member)) - return "member: string expected"; - if (message.condition != null && message.hasOwnProperty("condition")) { - var error = $root.google.type.Expr.verify(message.condition); - if (error) - return "condition." + error; - } - return null; - }; - - /** - * Creates a BindingDelta message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.iam.v1.BindingDelta - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v1.BindingDelta} BindingDelta - */ - BindingDelta.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.BindingDelta) - return object; - var message = new $root.google.iam.v1.BindingDelta(); - switch (object.action) { - default: - if (typeof object.action === "number") { - message.action = object.action; - break; - } - break; - case "ACTION_UNSPECIFIED": - case 0: - message.action = 0; - break; - case "ADD": - case 1: - message.action = 1; - break; - case "REMOVE": - case 2: - message.action = 2; - break; - } - if (object.role != null) - message.role = String(object.role); - if (object.member != null) - message.member = String(object.member); - if (object.condition != null) { - if (typeof object.condition !== "object") - throw TypeError(".google.iam.v1.BindingDelta.condition: object expected"); - message.condition = $root.google.type.Expr.fromObject(object.condition); - } - return message; - }; - - /** - * Creates a plain object from a BindingDelta message. Also converts values to other types if specified. - * @function toObject - * @memberof google.iam.v1.BindingDelta - * @static - * @param {google.iam.v1.BindingDelta} message BindingDelta - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BindingDelta.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.action = options.enums === String ? "ACTION_UNSPECIFIED" : 0; - object.role = ""; - object.member = ""; - object.condition = null; - } - if (message.action != null && message.hasOwnProperty("action")) - object.action = options.enums === String ? $root.google.iam.v1.BindingDelta.Action[message.action] === undefined ? message.action : $root.google.iam.v1.BindingDelta.Action[message.action] : message.action; - if (message.role != null && message.hasOwnProperty("role")) - object.role = message.role; - if (message.member != null && message.hasOwnProperty("member")) - object.member = message.member; - if (message.condition != null && message.hasOwnProperty("condition")) - object.condition = $root.google.type.Expr.toObject(message.condition, options); - return object; - }; - - /** - * Converts this BindingDelta to JSON. - * @function toJSON - * @memberof google.iam.v1.BindingDelta - * @instance - * @returns {Object.} JSON object - */ - BindingDelta.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BindingDelta - * @function getTypeUrl - * @memberof google.iam.v1.BindingDelta - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BindingDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.iam.v1.BindingDelta"; - }; - - /** - * Action enum. - * @name google.iam.v1.BindingDelta.Action - * @enum {number} - * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value - * @property {number} ADD=1 ADD value - * @property {number} REMOVE=2 REMOVE value - */ - BindingDelta.Action = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ACTION_UNSPECIFIED"] = 0; - values[valuesById[1] = "ADD"] = 1; - values[valuesById[2] = "REMOVE"] = 2; - return values; - })(); - - return BindingDelta; - })(); - - v1.AuditConfigDelta = (function() { - - /** - * Properties of an AuditConfigDelta. - * @memberof google.iam.v1 - * @interface IAuditConfigDelta - * @property {google.iam.v1.AuditConfigDelta.Action|null} [action] AuditConfigDelta action - * @property {string|null} [service] AuditConfigDelta service - * @property {string|null} [exemptedMember] AuditConfigDelta exemptedMember - * @property {string|null} [logType] AuditConfigDelta logType - */ - - /** - * Constructs a new AuditConfigDelta. - * @memberof google.iam.v1 - * @classdesc Represents an AuditConfigDelta. - * @implements IAuditConfigDelta - * @constructor - * @param {google.iam.v1.IAuditConfigDelta=} [properties] Properties to set - */ - function AuditConfigDelta(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AuditConfigDelta action. - * @member {google.iam.v1.AuditConfigDelta.Action} action - * @memberof google.iam.v1.AuditConfigDelta - * @instance - */ - AuditConfigDelta.prototype.action = 0; - - /** - * AuditConfigDelta service. - * @member {string} service - * @memberof google.iam.v1.AuditConfigDelta - * @instance - */ - AuditConfigDelta.prototype.service = ""; - - /** - * AuditConfigDelta exemptedMember. - * @member {string} exemptedMember - * @memberof google.iam.v1.AuditConfigDelta - * @instance - */ - AuditConfigDelta.prototype.exemptedMember = ""; - - /** - * AuditConfigDelta logType. - * @member {string} logType - * @memberof google.iam.v1.AuditConfigDelta - * @instance - */ - AuditConfigDelta.prototype.logType = ""; - - /** - * Creates a new AuditConfigDelta instance using the specified properties. - * @function create - * @memberof google.iam.v1.AuditConfigDelta - * @static - * @param {google.iam.v1.IAuditConfigDelta=} [properties] Properties to set - * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta instance - */ - AuditConfigDelta.create = function create(properties) { - return new AuditConfigDelta(properties); - }; - - /** - * Encodes the specified AuditConfigDelta message. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. - * @function encode - * @memberof google.iam.v1.AuditConfigDelta - * @static - * @param {google.iam.v1.IAuditConfigDelta} message AuditConfigDelta message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AuditConfigDelta.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.action != null && Object.hasOwnProperty.call(message, "action")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); - if (message.service != null && Object.hasOwnProperty.call(message, "service")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.service); - if (message.exemptedMember != null && Object.hasOwnProperty.call(message, "exemptedMember")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.exemptedMember); - if (message.logType != null && Object.hasOwnProperty.call(message, "logType")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.logType); - return writer; - }; - - /** - * Encodes the specified AuditConfigDelta message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. - * @function encodeDelimited - * @memberof google.iam.v1.AuditConfigDelta - * @static - * @param {google.iam.v1.IAuditConfigDelta} message AuditConfigDelta message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AuditConfigDelta.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AuditConfigDelta message from the specified reader or buffer. - * @function decode - * @memberof google.iam.v1.AuditConfigDelta - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AuditConfigDelta.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.AuditConfigDelta(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.action = reader.int32(); - break; - } - case 2: { - message.service = reader.string(); - break; - } - case 3: { - message.exemptedMember = reader.string(); - break; - } - case 4: { - message.logType = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AuditConfigDelta message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.iam.v1.AuditConfigDelta - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AuditConfigDelta.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AuditConfigDelta message. - * @function verify - * @memberof google.iam.v1.AuditConfigDelta - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AuditConfigDelta.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.action != null && message.hasOwnProperty("action")) - switch (message.action) { - default: - return "action: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.service != null && message.hasOwnProperty("service")) - if (!$util.isString(message.service)) - return "service: string expected"; - if (message.exemptedMember != null && message.hasOwnProperty("exemptedMember")) - if (!$util.isString(message.exemptedMember)) - return "exemptedMember: string expected"; - if (message.logType != null && message.hasOwnProperty("logType")) - if (!$util.isString(message.logType)) - return "logType: string expected"; - return null; - }; - - /** - * Creates an AuditConfigDelta message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.iam.v1.AuditConfigDelta - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta - */ - AuditConfigDelta.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.AuditConfigDelta) - return object; - var message = new $root.google.iam.v1.AuditConfigDelta(); - switch (object.action) { - default: - if (typeof object.action === "number") { - message.action = object.action; - break; - } - break; - case "ACTION_UNSPECIFIED": - case 0: - message.action = 0; - break; - case "ADD": - case 1: - message.action = 1; - break; - case "REMOVE": - case 2: - message.action = 2; - break; - } - if (object.service != null) - message.service = String(object.service); - if (object.exemptedMember != null) - message.exemptedMember = String(object.exemptedMember); - if (object.logType != null) - message.logType = String(object.logType); - return message; - }; - - /** - * Creates a plain object from an AuditConfigDelta message. Also converts values to other types if specified. - * @function toObject - * @memberof google.iam.v1.AuditConfigDelta - * @static - * @param {google.iam.v1.AuditConfigDelta} message AuditConfigDelta - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AuditConfigDelta.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.action = options.enums === String ? "ACTION_UNSPECIFIED" : 0; - object.service = ""; - object.exemptedMember = ""; - object.logType = ""; - } - if (message.action != null && message.hasOwnProperty("action")) - object.action = options.enums === String ? $root.google.iam.v1.AuditConfigDelta.Action[message.action] === undefined ? message.action : $root.google.iam.v1.AuditConfigDelta.Action[message.action] : message.action; - if (message.service != null && message.hasOwnProperty("service")) - object.service = message.service; - if (message.exemptedMember != null && message.hasOwnProperty("exemptedMember")) - object.exemptedMember = message.exemptedMember; - if (message.logType != null && message.hasOwnProperty("logType")) - object.logType = message.logType; - return object; - }; - - /** - * Converts this AuditConfigDelta to JSON. - * @function toJSON - * @memberof google.iam.v1.AuditConfigDelta - * @instance - * @returns {Object.} JSON object - */ - AuditConfigDelta.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AuditConfigDelta - * @function getTypeUrl - * @memberof google.iam.v1.AuditConfigDelta - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AuditConfigDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.iam.v1.AuditConfigDelta"; - }; - - /** - * Action enum. - * @name google.iam.v1.AuditConfigDelta.Action - * @enum {number} - * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value - * @property {number} ADD=1 ADD value - * @property {number} REMOVE=2 REMOVE value - */ - AuditConfigDelta.Action = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ACTION_UNSPECIFIED"] = 0; - values[valuesById[1] = "ADD"] = 1; - values[valuesById[2] = "REMOVE"] = 2; - return values; - })(); - - return AuditConfigDelta; - })(); - - return v1; - })(); - - return iam; - })(); - - google.type = (function() { - - /** - * Namespace type. - * @memberof google - * @namespace - */ - var type = {}; - - type.Expr = (function() { - - /** - * Properties of an Expr. - * @memberof google.type - * @interface IExpr - * @property {string|null} [expression] Expr expression - * @property {string|null} [title] Expr title - * @property {string|null} [description] Expr description - * @property {string|null} [location] Expr location - */ - - /** - * Constructs a new Expr. - * @memberof google.type - * @classdesc Represents an Expr. - * @implements IExpr - * @constructor - * @param {google.type.IExpr=} [properties] Properties to set - */ - function Expr(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Expr expression. - * @member {string} expression - * @memberof google.type.Expr - * @instance - */ - Expr.prototype.expression = ""; - - /** - * Expr title. - * @member {string} title - * @memberof google.type.Expr - * @instance - */ - Expr.prototype.title = ""; - - /** - * Expr description. - * @member {string} description - * @memberof google.type.Expr - * @instance - */ - Expr.prototype.description = ""; - - /** - * Expr location. - * @member {string} location - * @memberof google.type.Expr - * @instance - */ - Expr.prototype.location = ""; - - /** - * Creates a new Expr instance using the specified properties. - * @function create - * @memberof google.type.Expr - * @static - * @param {google.type.IExpr=} [properties] Properties to set - * @returns {google.type.Expr} Expr instance - */ - Expr.create = function create(properties) { - return new Expr(properties); - }; - - /** - * Encodes the specified Expr message. Does not implicitly {@link google.type.Expr.verify|verify} messages. - * @function encode - * @memberof google.type.Expr - * @static - * @param {google.type.IExpr} message Expr message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Expr.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.expression != null && Object.hasOwnProperty.call(message, "expression")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.expression); - if (message.title != null && Object.hasOwnProperty.call(message, "title")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.title); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); - if (message.location != null && Object.hasOwnProperty.call(message, "location")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.location); - return writer; - }; - - /** - * Encodes the specified Expr message, length delimited. Does not implicitly {@link google.type.Expr.verify|verify} messages. - * @function encodeDelimited - * @memberof google.type.Expr - * @static - * @param {google.type.IExpr} message Expr message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Expr.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Expr message from the specified reader or buffer. - * @function decode - * @memberof google.type.Expr - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.type.Expr} Expr - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Expr.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.Expr(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.expression = reader.string(); - break; - } - case 2: { - message.title = reader.string(); - break; - } - case 3: { - message.description = reader.string(); - break; - } - case 4: { - message.location = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Expr message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.type.Expr - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.type.Expr} Expr - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Expr.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Expr message. - * @function verify - * @memberof google.type.Expr - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Expr.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.expression != null && message.hasOwnProperty("expression")) - if (!$util.isString(message.expression)) - return "expression: string expected"; - if (message.title != null && message.hasOwnProperty("title")) - if (!$util.isString(message.title)) - return "title: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.location != null && message.hasOwnProperty("location")) - if (!$util.isString(message.location)) - return "location: string expected"; - return null; - }; - - /** - * Creates an Expr message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.type.Expr - * @static - * @param {Object.} object Plain object - * @returns {google.type.Expr} Expr - */ - Expr.fromObject = function fromObject(object) { - if (object instanceof $root.google.type.Expr) - return object; - var message = new $root.google.type.Expr(); - if (object.expression != null) - message.expression = String(object.expression); - if (object.title != null) - message.title = String(object.title); - if (object.description != null) - message.description = String(object.description); - if (object.location != null) - message.location = String(object.location); - return message; - }; - - /** - * Creates a plain object from an Expr message. Also converts values to other types if specified. - * @function toObject - * @memberof google.type.Expr - * @static - * @param {google.type.Expr} message Expr - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Expr.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.expression = ""; - object.title = ""; - object.description = ""; - object.location = ""; - } - if (message.expression != null && message.hasOwnProperty("expression")) - object.expression = message.expression; - if (message.title != null && message.hasOwnProperty("title")) - object.title = message.title; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.location != null && message.hasOwnProperty("location")) - object.location = message.location; - return object; - }; - - /** - * Converts this Expr to JSON. - * @function toJSON - * @memberof google.type.Expr - * @instance - * @returns {Object.} JSON object - */ - Expr.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Expr - * @function getTypeUrl - * @memberof google.type.Expr - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Expr.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.type.Expr"; - }; - - return Expr; - })(); - - return type; - })(); - - google.longrunning = (function() { - - /** - * Namespace longrunning. - * @memberof google - * @namespace - */ - var longrunning = {}; - - longrunning.Operations = (function() { - - /** - * Constructs a new Operations service. - * @memberof google.longrunning - * @classdesc Represents an Operations - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function Operations(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (Operations.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Operations; - - /** - * Creates new Operations service using the specified rpc implementation. - * @function create - * @memberof google.longrunning.Operations - * @static - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - * @returns {Operations} RPC service. Useful where requests and/or responses are streamed. - */ - Operations.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.longrunning.Operations|listOperations}. - * @memberof google.longrunning.Operations - * @typedef ListOperationsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.ListOperationsResponse} [response] ListOperationsResponse - */ - - /** - * Calls ListOperations. - * @function listOperations - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object - * @param {google.longrunning.Operations.ListOperationsCallback} callback Node-style callback called with the error, if any, and ListOperationsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Operations.prototype.listOperations = function listOperations(request, callback) { - return this.rpcCall(listOperations, $root.google.longrunning.ListOperationsRequest, $root.google.longrunning.ListOperationsResponse, request, callback); - }, "name", { value: "ListOperations" }); - - /** - * Calls ListOperations. - * @function listOperations - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.longrunning.Operations|getOperation}. - * @memberof google.longrunning.Operations - * @typedef GetOperationCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls GetOperation. - * @function getOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object - * @param {google.longrunning.Operations.GetOperationCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Operations.prototype.getOperation = function getOperation(request, callback) { - return this.rpcCall(getOperation, $root.google.longrunning.GetOperationRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "GetOperation" }); - - /** - * Calls GetOperation. - * @function getOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.longrunning.Operations|deleteOperation}. - * @memberof google.longrunning.Operations - * @typedef DeleteOperationCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteOperation. - * @function deleteOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object - * @param {google.longrunning.Operations.DeleteOperationCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Operations.prototype.deleteOperation = function deleteOperation(request, callback) { - return this.rpcCall(deleteOperation, $root.google.longrunning.DeleteOperationRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteOperation" }); - - /** - * Calls DeleteOperation. - * @function deleteOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.longrunning.Operations|cancelOperation}. - * @memberof google.longrunning.Operations - * @typedef CancelOperationCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls CancelOperation. - * @function cancelOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object - * @param {google.longrunning.Operations.CancelOperationCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Operations.prototype.cancelOperation = function cancelOperation(request, callback) { - return this.rpcCall(cancelOperation, $root.google.longrunning.CancelOperationRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "CancelOperation" }); - - /** - * Calls CancelOperation. - * @function cancelOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.longrunning.Operations|waitOperation}. - * @memberof google.longrunning.Operations - * @typedef WaitOperationCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls WaitOperation. - * @function waitOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object - * @param {google.longrunning.Operations.WaitOperationCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Operations.prototype.waitOperation = function waitOperation(request, callback) { - return this.rpcCall(waitOperation, $root.google.longrunning.WaitOperationRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "WaitOperation" }); - - /** - * Calls WaitOperation. - * @function waitOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return Operations; - })(); - - longrunning.Operation = (function() { - - /** - * Properties of an Operation. - * @memberof google.longrunning - * @interface IOperation - * @property {string|null} [name] Operation name - * @property {google.protobuf.IAny|null} [metadata] Operation metadata - * @property {boolean|null} [done] Operation done - * @property {google.rpc.IStatus|null} [error] Operation error - * @property {google.protobuf.IAny|null} [response] Operation response - */ - - /** - * Constructs a new Operation. - * @memberof google.longrunning - * @classdesc Represents an Operation. - * @implements IOperation - * @constructor - * @param {google.longrunning.IOperation=} [properties] Properties to set - */ - function Operation(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Operation name. - * @member {string} name - * @memberof google.longrunning.Operation - * @instance - */ - Operation.prototype.name = ""; - - /** - * Operation metadata. - * @member {google.protobuf.IAny|null|undefined} metadata - * @memberof google.longrunning.Operation - * @instance - */ - Operation.prototype.metadata = null; - - /** - * Operation done. - * @member {boolean} done - * @memberof google.longrunning.Operation - * @instance - */ - Operation.prototype.done = false; - - /** - * Operation error. - * @member {google.rpc.IStatus|null|undefined} error - * @memberof google.longrunning.Operation - * @instance - */ - Operation.prototype.error = null; - - /** - * Operation response. - * @member {google.protobuf.IAny|null|undefined} response - * @memberof google.longrunning.Operation - * @instance - */ - Operation.prototype.response = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Operation result. - * @member {"error"|"response"|undefined} result - * @memberof google.longrunning.Operation - * @instance - */ - Object.defineProperty(Operation.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["error", "response"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Operation instance using the specified properties. - * @function create - * @memberof google.longrunning.Operation - * @static - * @param {google.longrunning.IOperation=} [properties] Properties to set - * @returns {google.longrunning.Operation} Operation instance - */ - Operation.create = function create(properties) { - return new Operation(properties); - }; - - /** - * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. - * @function encode - * @memberof google.longrunning.Operation - * @static - * @param {google.longrunning.IOperation} message Operation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Operation.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.google.protobuf.Any.encode(message.metadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.done != null && Object.hasOwnProperty.call(message, "done")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.done); - if (message.error != null && Object.hasOwnProperty.call(message, "error")) - $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.response != null && Object.hasOwnProperty.call(message, "response")) - $root.google.protobuf.Any.encode(message.response, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.Operation - * @static - * @param {google.longrunning.IOperation} message Operation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Operation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Operation message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.Operation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.Operation} Operation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Operation.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.Operation(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.metadata = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - } - case 3: { - message.done = reader.bool(); - break; - } - case 4: { - message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); - break; - } - case 5: { - message.response = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Operation message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.Operation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.Operation} Operation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Operation.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Operation message. - * @function verify - * @memberof google.longrunning.Operation - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Operation.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.google.protobuf.Any.verify(message.metadata); - if (error) - return "metadata." + error; - } - if (message.done != null && message.hasOwnProperty("done")) - if (typeof message.done !== "boolean") - return "done: boolean expected"; - if (message.error != null && message.hasOwnProperty("error")) { - properties.result = 1; - { - var error = $root.google.rpc.Status.verify(message.error); - if (error) - return "error." + error; - } - } - if (message.response != null && message.hasOwnProperty("response")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.google.protobuf.Any.verify(message.response); - if (error) - return "response." + error; - } - } - return null; - }; - - /** - * Creates an Operation message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.Operation - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.Operation} Operation - */ - Operation.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.Operation) - return object; - var message = new $root.google.longrunning.Operation(); - if (object.name != null) - message.name = String(object.name); - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".google.longrunning.Operation.metadata: object expected"); - message.metadata = $root.google.protobuf.Any.fromObject(object.metadata); - } - if (object.done != null) - message.done = Boolean(object.done); - if (object.error != null) { - if (typeof object.error !== "object") - throw TypeError(".google.longrunning.Operation.error: object expected"); - message.error = $root.google.rpc.Status.fromObject(object.error); - } - if (object.response != null) { - if (typeof object.response !== "object") - throw TypeError(".google.longrunning.Operation.response: object expected"); - message.response = $root.google.protobuf.Any.fromObject(object.response); - } - return message; - }; - - /** - * Creates a plain object from an Operation message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.Operation - * @static - * @param {google.longrunning.Operation} message Operation - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Operation.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.metadata = null; - object.done = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.google.protobuf.Any.toObject(message.metadata, options); - if (message.done != null && message.hasOwnProperty("done")) - object.done = message.done; - if (message.error != null && message.hasOwnProperty("error")) { - object.error = $root.google.rpc.Status.toObject(message.error, options); - if (options.oneofs) - object.result = "error"; - } - if (message.response != null && message.hasOwnProperty("response")) { - object.response = $root.google.protobuf.Any.toObject(message.response, options); - if (options.oneofs) - object.result = "response"; - } - return object; - }; - - /** - * Converts this Operation to JSON. - * @function toJSON - * @memberof google.longrunning.Operation - * @instance - * @returns {Object.} JSON object - */ - Operation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Operation - * @function getTypeUrl - * @memberof google.longrunning.Operation - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Operation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.Operation"; - }; - - return Operation; - })(); - - longrunning.GetOperationRequest = (function() { - - /** - * Properties of a GetOperationRequest. - * @memberof google.longrunning - * @interface IGetOperationRequest - * @property {string|null} [name] GetOperationRequest name - */ - - /** - * Constructs a new GetOperationRequest. - * @memberof google.longrunning - * @classdesc Represents a GetOperationRequest. - * @implements IGetOperationRequest - * @constructor - * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set - */ - function GetOperationRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetOperationRequest name. - * @member {string} name - * @memberof google.longrunning.GetOperationRequest - * @instance - */ - GetOperationRequest.prototype.name = ""; - - /** - * Creates a new GetOperationRequest instance using the specified properties. - * @function create - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set - * @returns {google.longrunning.GetOperationRequest} GetOperationRequest instance - */ - GetOperationRequest.create = function create(properties) { - return new GetOperationRequest(properties); - }; - - /** - * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. - * @function encode - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetOperationRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; - - /** - * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetOperationRequest message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.GetOperationRequest} GetOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetOperationRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.GetOperationRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.GetOperationRequest} GetOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetOperationRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetOperationRequest message. - * @function verify - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetOperationRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; - - /** - * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.GetOperationRequest} GetOperationRequest - */ - GetOperationRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.GetOperationRequest) - return object; - var message = new $root.google.longrunning.GetOperationRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {google.longrunning.GetOperationRequest} message GetOperationRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetOperationRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; - - /** - * Converts this GetOperationRequest to JSON. - * @function toJSON - * @memberof google.longrunning.GetOperationRequest - * @instance - * @returns {Object.} JSON object - */ - GetOperationRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetOperationRequest - * @function getTypeUrl - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.GetOperationRequest"; - }; - - return GetOperationRequest; - })(); - - longrunning.ListOperationsRequest = (function() { - - /** - * Properties of a ListOperationsRequest. - * @memberof google.longrunning - * @interface IListOperationsRequest - * @property {string|null} [name] ListOperationsRequest name - * @property {string|null} [filter] ListOperationsRequest filter - * @property {number|null} [pageSize] ListOperationsRequest pageSize - * @property {string|null} [pageToken] ListOperationsRequest pageToken - */ - - /** - * Constructs a new ListOperationsRequest. - * @memberof google.longrunning - * @classdesc Represents a ListOperationsRequest. - * @implements IListOperationsRequest - * @constructor - * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set - */ - function ListOperationsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListOperationsRequest name. - * @member {string} name - * @memberof google.longrunning.ListOperationsRequest - * @instance - */ - ListOperationsRequest.prototype.name = ""; - - /** - * ListOperationsRequest filter. - * @member {string} filter - * @memberof google.longrunning.ListOperationsRequest - * @instance - */ - ListOperationsRequest.prototype.filter = ""; - - /** - * ListOperationsRequest pageSize. - * @member {number} pageSize - * @memberof google.longrunning.ListOperationsRequest - * @instance - */ - ListOperationsRequest.prototype.pageSize = 0; - - /** - * ListOperationsRequest pageToken. - * @member {string} pageToken - * @memberof google.longrunning.ListOperationsRequest - * @instance - */ - ListOperationsRequest.prototype.pageToken = ""; - - /** - * Creates a new ListOperationsRequest instance using the specified properties. - * @function create - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set - * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest instance - */ - ListOperationsRequest.create = function create(properties) { - return new ListOperationsRequest(properties); - }; - - /** - * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. - * @function encode - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListOperationsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); - return writer; - }; - - /** - * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListOperationsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListOperationsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 4: { - message.name = reader.string(); - break; - } - case 1: { - message.filter = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListOperationsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListOperationsRequest message. - * @function verify - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListOperationsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - return null; - }; - - /** - * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest - */ - ListOperationsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.ListOperationsRequest) - return object; - var message = new $root.google.longrunning.ListOperationsRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.filter != null) - message.filter = String(object.filter); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - return message; - }; - - /** - * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {google.longrunning.ListOperationsRequest} message ListOperationsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListOperationsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.filter = ""; - object.pageSize = 0; - object.pageToken = ""; - object.name = ""; - } - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; - - /** - * Converts this ListOperationsRequest to JSON. - * @function toJSON - * @memberof google.longrunning.ListOperationsRequest - * @instance - * @returns {Object.} JSON object - */ - ListOperationsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListOperationsRequest - * @function getTypeUrl - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListOperationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.ListOperationsRequest"; - }; - - return ListOperationsRequest; - })(); - - longrunning.ListOperationsResponse = (function() { - - /** - * Properties of a ListOperationsResponse. - * @memberof google.longrunning - * @interface IListOperationsResponse - * @property {Array.|null} [operations] ListOperationsResponse operations - * @property {string|null} [nextPageToken] ListOperationsResponse nextPageToken - */ - - /** - * Constructs a new ListOperationsResponse. - * @memberof google.longrunning - * @classdesc Represents a ListOperationsResponse. - * @implements IListOperationsResponse - * @constructor - * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set - */ - function ListOperationsResponse(properties) { - this.operations = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListOperationsResponse operations. - * @member {Array.} operations - * @memberof google.longrunning.ListOperationsResponse - * @instance - */ - ListOperationsResponse.prototype.operations = $util.emptyArray; - - /** - * ListOperationsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.longrunning.ListOperationsResponse - * @instance - */ - ListOperationsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListOperationsResponse instance using the specified properties. - * @function create - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set - * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse instance - */ - ListOperationsResponse.create = function create(properties) { - return new ListOperationsResponse(properties); - }; - - /** - * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. - * @function encode - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListOperationsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.operations != null && message.operations.length) - for (var i = 0; i < message.operations.length; ++i) - $root.google.longrunning.Operation.encode(message.operations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - return writer; - }; - - /** - * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListOperationsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListOperationsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListOperationsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.operations && message.operations.length)) - message.operations = []; - message.operations.push($root.google.longrunning.Operation.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListOperationsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListOperationsResponse message. - * @function verify - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListOperationsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.operations != null && message.hasOwnProperty("operations")) { - if (!Array.isArray(message.operations)) - return "operations: array expected"; - for (var i = 0; i < message.operations.length; ++i) { - var error = $root.google.longrunning.Operation.verify(message.operations[i]); - if (error) - return "operations." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse - */ - ListOperationsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.ListOperationsResponse) - return object; - var message = new $root.google.longrunning.ListOperationsResponse(); - if (object.operations) { - if (!Array.isArray(object.operations)) - throw TypeError(".google.longrunning.ListOperationsResponse.operations: array expected"); - message.operations = []; - for (var i = 0; i < object.operations.length; ++i) { - if (typeof object.operations[i] !== "object") - throw TypeError(".google.longrunning.ListOperationsResponse.operations: object expected"); - message.operations[i] = $root.google.longrunning.Operation.fromObject(object.operations[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {google.longrunning.ListOperationsResponse} message ListOperationsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListOperationsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.operations = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.operations && message.operations.length) { - object.operations = []; - for (var j = 0; j < message.operations.length; ++j) - object.operations[j] = $root.google.longrunning.Operation.toObject(message.operations[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListOperationsResponse to JSON. - * @function toJSON - * @memberof google.longrunning.ListOperationsResponse - * @instance - * @returns {Object.} JSON object - */ - ListOperationsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListOperationsResponse - * @function getTypeUrl - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListOperationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.ListOperationsResponse"; - }; - - return ListOperationsResponse; - })(); - - longrunning.CancelOperationRequest = (function() { - - /** - * Properties of a CancelOperationRequest. - * @memberof google.longrunning - * @interface ICancelOperationRequest - * @property {string|null} [name] CancelOperationRequest name - */ - - /** - * Constructs a new CancelOperationRequest. - * @memberof google.longrunning - * @classdesc Represents a CancelOperationRequest. - * @implements ICancelOperationRequest - * @constructor - * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set - */ - function CancelOperationRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CancelOperationRequest name. - * @member {string} name - * @memberof google.longrunning.CancelOperationRequest - * @instance - */ - CancelOperationRequest.prototype.name = ""; - - /** - * Creates a new CancelOperationRequest instance using the specified properties. - * @function create - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set - * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest instance - */ - CancelOperationRequest.create = function create(properties) { - return new CancelOperationRequest(properties); - }; - - /** - * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. - * @function encode - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CancelOperationRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; - - /** - * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CancelOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CancelOperationRequest message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CancelOperationRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.CancelOperationRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CancelOperationRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CancelOperationRequest message. - * @function verify - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CancelOperationRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; - - /** - * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest - */ - CancelOperationRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.CancelOperationRequest) - return object; - var message = new $root.google.longrunning.CancelOperationRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {google.longrunning.CancelOperationRequest} message CancelOperationRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CancelOperationRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; - - /** - * Converts this CancelOperationRequest to JSON. - * @function toJSON - * @memberof google.longrunning.CancelOperationRequest - * @instance - * @returns {Object.} JSON object - */ - CancelOperationRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CancelOperationRequest - * @function getTypeUrl - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CancelOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.CancelOperationRequest"; - }; - - return CancelOperationRequest; - })(); - - longrunning.DeleteOperationRequest = (function() { - - /** - * Properties of a DeleteOperationRequest. - * @memberof google.longrunning - * @interface IDeleteOperationRequest - * @property {string|null} [name] DeleteOperationRequest name - */ - - /** - * Constructs a new DeleteOperationRequest. - * @memberof google.longrunning - * @classdesc Represents a DeleteOperationRequest. - * @implements IDeleteOperationRequest - * @constructor - * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set - */ - function DeleteOperationRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteOperationRequest name. - * @member {string} name - * @memberof google.longrunning.DeleteOperationRequest - * @instance - */ - DeleteOperationRequest.prototype.name = ""; - - /** - * Creates a new DeleteOperationRequest instance using the specified properties. - * @function create - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set - * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest instance - */ - DeleteOperationRequest.create = function create(properties) { - return new DeleteOperationRequest(properties); - }; - - /** - * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. - * @function encode - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteOperationRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; - - /** - * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteOperationRequest message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteOperationRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.DeleteOperationRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteOperationRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteOperationRequest message. - * @function verify - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteOperationRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; - - /** - * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest - */ - DeleteOperationRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.DeleteOperationRequest) - return object; - var message = new $root.google.longrunning.DeleteOperationRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {google.longrunning.DeleteOperationRequest} message DeleteOperationRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteOperationRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; - - /** - * Converts this DeleteOperationRequest to JSON. - * @function toJSON - * @memberof google.longrunning.DeleteOperationRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteOperationRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteOperationRequest - * @function getTypeUrl - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.DeleteOperationRequest"; - }; - - return DeleteOperationRequest; - })(); - - longrunning.WaitOperationRequest = (function() { - - /** - * Properties of a WaitOperationRequest. - * @memberof google.longrunning - * @interface IWaitOperationRequest - * @property {string|null} [name] WaitOperationRequest name - * @property {google.protobuf.IDuration|null} [timeout] WaitOperationRequest timeout - */ - - /** - * Constructs a new WaitOperationRequest. - * @memberof google.longrunning - * @classdesc Represents a WaitOperationRequest. - * @implements IWaitOperationRequest - * @constructor - * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set - */ - function WaitOperationRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * WaitOperationRequest name. - * @member {string} name - * @memberof google.longrunning.WaitOperationRequest - * @instance - */ - WaitOperationRequest.prototype.name = ""; - - /** - * WaitOperationRequest timeout. - * @member {google.protobuf.IDuration|null|undefined} timeout - * @memberof google.longrunning.WaitOperationRequest - * @instance - */ - WaitOperationRequest.prototype.timeout = null; - - /** - * Creates a new WaitOperationRequest instance using the specified properties. - * @function create - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set - * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest instance - */ - WaitOperationRequest.create = function create(properties) { - return new WaitOperationRequest(properties); - }; - - /** - * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. - * @function encode - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WaitOperationRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) - $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WaitOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a WaitOperationRequest message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WaitOperationRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.WaitOperationRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WaitOperationRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a WaitOperationRequest message. - * @function verify - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - WaitOperationRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.timeout != null && message.hasOwnProperty("timeout")) { - var error = $root.google.protobuf.Duration.verify(message.timeout); - if (error) - return "timeout." + error; - } - return null; - }; - - /** - * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest - */ - WaitOperationRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.WaitOperationRequest) - return object; - var message = new $root.google.longrunning.WaitOperationRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.timeout != null) { - if (typeof object.timeout !== "object") - throw TypeError(".google.longrunning.WaitOperationRequest.timeout: object expected"); - message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); - } - return message; - }; - - /** - * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {google.longrunning.WaitOperationRequest} message WaitOperationRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - WaitOperationRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.timeout = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.timeout != null && message.hasOwnProperty("timeout")) - object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); - return object; - }; - - /** - * Converts this WaitOperationRequest to JSON. - * @function toJSON - * @memberof google.longrunning.WaitOperationRequest - * @instance - * @returns {Object.} JSON object - */ - WaitOperationRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for WaitOperationRequest - * @function getTypeUrl - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - WaitOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.WaitOperationRequest"; - }; - - return WaitOperationRequest; - })(); - - longrunning.OperationInfo = (function() { - - /** - * Properties of an OperationInfo. - * @memberof google.longrunning - * @interface IOperationInfo - * @property {string|null} [responseType] OperationInfo responseType - * @property {string|null} [metadataType] OperationInfo metadataType - */ - - /** - * Constructs a new OperationInfo. - * @memberof google.longrunning - * @classdesc Represents an OperationInfo. - * @implements IOperationInfo - * @constructor - * @param {google.longrunning.IOperationInfo=} [properties] Properties to set - */ - function OperationInfo(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * OperationInfo responseType. - * @member {string} responseType - * @memberof google.longrunning.OperationInfo - * @instance - */ - OperationInfo.prototype.responseType = ""; - - /** - * OperationInfo metadataType. - * @member {string} metadataType - * @memberof google.longrunning.OperationInfo - * @instance - */ - OperationInfo.prototype.metadataType = ""; - - /** - * Creates a new OperationInfo instance using the specified properties. - * @function create - * @memberof google.longrunning.OperationInfo - * @static - * @param {google.longrunning.IOperationInfo=} [properties] Properties to set - * @returns {google.longrunning.OperationInfo} OperationInfo instance - */ - OperationInfo.create = function create(properties) { - return new OperationInfo(properties); - }; - - /** - * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. - * @function encode - * @memberof google.longrunning.OperationInfo - * @static - * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OperationInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.responseType != null && Object.hasOwnProperty.call(message, "responseType")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseType); - if (message.metadataType != null && Object.hasOwnProperty.call(message, "metadataType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.metadataType); - return writer; - }; - - /** - * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.OperationInfo - * @static - * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OperationInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OperationInfo message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.OperationInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.OperationInfo} OperationInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OperationInfo.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.OperationInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.responseType = reader.string(); - break; - } - case 2: { - message.metadataType = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OperationInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.OperationInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.OperationInfo} OperationInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OperationInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OperationInfo message. - * @function verify - * @memberof google.longrunning.OperationInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OperationInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.responseType != null && message.hasOwnProperty("responseType")) - if (!$util.isString(message.responseType)) - return "responseType: string expected"; - if (message.metadataType != null && message.hasOwnProperty("metadataType")) - if (!$util.isString(message.metadataType)) - return "metadataType: string expected"; - return null; - }; - - /** - * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.OperationInfo - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.OperationInfo} OperationInfo - */ - OperationInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.OperationInfo) - return object; - var message = new $root.google.longrunning.OperationInfo(); - if (object.responseType != null) - message.responseType = String(object.responseType); - if (object.metadataType != null) - message.metadataType = String(object.metadataType); - return message; - }; - - /** - * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.OperationInfo - * @static - * @param {google.longrunning.OperationInfo} message OperationInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OperationInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.responseType = ""; - object.metadataType = ""; - } - if (message.responseType != null && message.hasOwnProperty("responseType")) - object.responseType = message.responseType; - if (message.metadataType != null && message.hasOwnProperty("metadataType")) - object.metadataType = message.metadataType; - return object; - }; - - /** - * Converts this OperationInfo to JSON. - * @function toJSON - * @memberof google.longrunning.OperationInfo - * @instance - * @returns {Object.} JSON object - */ - OperationInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OperationInfo - * @function getTypeUrl - * @memberof google.longrunning.OperationInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OperationInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.OperationInfo"; - }; - - return OperationInfo; - })(); - - return longrunning; - })(); - - google.rpc = (function() { - - /** - * Namespace rpc. - * @memberof google - * @namespace - */ - var rpc = {}; - - rpc.Status = (function() { - - /** - * Properties of a Status. - * @memberof google.rpc - * @interface IStatus - * @property {number|null} [code] Status code - * @property {string|null} [message] Status message - * @property {Array.|null} [details] Status details - */ - - /** - * Constructs a new Status. - * @memberof google.rpc - * @classdesc Represents a Status. - * @implements IStatus - * @constructor - * @param {google.rpc.IStatus=} [properties] Properties to set - */ - function Status(properties) { - this.details = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Status code. - * @member {number} code - * @memberof google.rpc.Status - * @instance - */ - Status.prototype.code = 0; - - /** - * Status message. - * @member {string} message - * @memberof google.rpc.Status - * @instance - */ - Status.prototype.message = ""; - - /** - * Status details. - * @member {Array.} details - * @memberof google.rpc.Status - * @instance - */ - Status.prototype.details = $util.emptyArray; - - /** - * Creates a new Status instance using the specified properties. - * @function create - * @memberof google.rpc.Status - * @static - * @param {google.rpc.IStatus=} [properties] Properties to set - * @returns {google.rpc.Status} Status instance - */ - Status.create = function create(properties) { - return new Status(properties); - }; - - /** - * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. - * @function encode - * @memberof google.rpc.Status - * @static - * @param {google.rpc.IStatus} message Status message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Status.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.code != null && Object.hasOwnProperty.call(message, "code")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); - if (message.message != null && Object.hasOwnProperty.call(message, "message")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); - if (message.details != null && message.details.length) - for (var i = 0; i < message.details.length; ++i) - $root.google.protobuf.Any.encode(message.details[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. - * @function encodeDelimited - * @memberof google.rpc.Status - * @static - * @param {google.rpc.IStatus} message Status message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Status.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Status message from the specified reader or buffer. - * @function decode - * @memberof google.rpc.Status - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.rpc.Status} Status - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Status.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.rpc.Status(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.code = reader.int32(); - break; - } - case 2: { - message.message = reader.string(); - break; - } - case 3: { - if (!(message.details && message.details.length)) - message.details = []; - message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Status message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.rpc.Status - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.rpc.Status} Status - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Status.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Status message. - * @function verify - * @memberof google.rpc.Status - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Status.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.code != null && message.hasOwnProperty("code")) - if (!$util.isInteger(message.code)) - return "code: integer expected"; - if (message.message != null && message.hasOwnProperty("message")) - if (!$util.isString(message.message)) - return "message: string expected"; - if (message.details != null && message.hasOwnProperty("details")) { - if (!Array.isArray(message.details)) - return "details: array expected"; - for (var i = 0; i < message.details.length; ++i) { - var error = $root.google.protobuf.Any.verify(message.details[i]); - if (error) - return "details." + error; - } - } - return null; - }; - - /** - * Creates a Status message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.rpc.Status - * @static - * @param {Object.} object Plain object - * @returns {google.rpc.Status} Status - */ - Status.fromObject = function fromObject(object) { - if (object instanceof $root.google.rpc.Status) - return object; - var message = new $root.google.rpc.Status(); - if (object.code != null) - message.code = object.code | 0; - if (object.message != null) - message.message = String(object.message); - if (object.details) { - if (!Array.isArray(object.details)) - throw TypeError(".google.rpc.Status.details: array expected"); - message.details = []; - for (var i = 0; i < object.details.length; ++i) { - if (typeof object.details[i] !== "object") - throw TypeError(".google.rpc.Status.details: object expected"); - message.details[i] = $root.google.protobuf.Any.fromObject(object.details[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a Status message. Also converts values to other types if specified. - * @function toObject - * @memberof google.rpc.Status - * @static - * @param {google.rpc.Status} message Status - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Status.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.details = []; - if (options.defaults) { - object.code = 0; - object.message = ""; - } - if (message.code != null && message.hasOwnProperty("code")) - object.code = message.code; - if (message.message != null && message.hasOwnProperty("message")) - object.message = message.message; - if (message.details && message.details.length) { - object.details = []; - for (var j = 0; j < message.details.length; ++j) - object.details[j] = $root.google.protobuf.Any.toObject(message.details[j], options); - } - return object; - }; - - /** - * Converts this Status to JSON. - * @function toJSON - * @memberof google.rpc.Status - * @instance - * @returns {Object.} JSON object - */ - Status.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Status - * @function getTypeUrl - * @memberof google.rpc.Status - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Status.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.rpc.Status"; - }; - - return Status; - })(); - - return rpc; - })(); - - return google; - })(); - - return $root; -}); diff --git a/owl-bot-staging/admin/instance/v1/protos/protos.json b/owl-bot-staging/admin/instance/v1/protos/protos.json deleted file mode 100644 index 5baf92e47..000000000 --- a/owl-bot-staging/admin/instance/v1/protos/protos.json +++ /dev/null @@ -1,4167 +0,0 @@ -{ - "nested": { - "google": { - "nested": { - "spanner": { - "nested": { - "admin": { - "nested": { - "instance": { - "nested": { - "v1": { - "options": { - "csharp_namespace": "Google.Cloud.Spanner.Admin.Instance.V1", - "go_package": "cloud.google.com/go/spanner/admin/instance/apiv1/instancepb;instancepb", - "java_multiple_files": true, - "java_outer_classname": "SpannerInstanceAdminProto", - "java_package": "com.google.spanner.admin.instance.v1", - "php_namespace": "Google\\Cloud\\Spanner\\Admin\\Instance\\V1", - "ruby_package": "Google::Cloud::Spanner::Admin::Instance::V1" - }, - "nested": { - "OperationProgress": { - "fields": { - "progressPercent": { - "type": "int32", - "id": 1 - }, - "startTime": { - "type": "google.protobuf.Timestamp", - "id": 2 - }, - "endTime": { - "type": "google.protobuf.Timestamp", - "id": 3 - } - } - }, - "FulfillmentPeriod": { - "values": { - "FULFILLMENT_PERIOD_UNSPECIFIED": 0, - "FULFILLMENT_PERIOD_NORMAL": 1, - "FULFILLMENT_PERIOD_EXTENDED": 2 - } - }, - "ReplicaSelection": { - "fields": { - "location": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "InstanceAdmin": { - "options": { - "(google.api.default_host)": "spanner.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/spanner.admin" - }, - "methods": { - "ListInstanceConfigs": { - "requestType": "ListInstanceConfigsRequest", - "responseType": "ListInstanceConfigsResponse", - "options": { - "(google.api.http).get": "/v1/{parent=projects/*}/instanceConfigs", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=projects/*}/instanceConfigs" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "GetInstanceConfig": { - "requestType": "GetInstanceConfigRequest", - "responseType": "InstanceConfig", - "options": { - "(google.api.http).get": "/v1/{name=projects/*/instanceConfigs/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=projects/*/instanceConfigs/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "CreateInstanceConfig": { - "requestType": "CreateInstanceConfigRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1/{parent=projects/*}/instanceConfigs", - "(google.api.http).body": "*", - "(google.api.method_signature)": "parent,instance_config,instance_config_id", - "(google.longrunning.operation_info).response_type": "google.spanner.admin.instance.v1.InstanceConfig", - "(google.longrunning.operation_info).metadata_type": "google.spanner.admin.instance.v1.CreateInstanceConfigMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{parent=projects/*}/instanceConfigs", - "body": "*" - } - }, - { - "(google.api.method_signature)": "parent,instance_config,instance_config_id" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "google.spanner.admin.instance.v1.InstanceConfig", - "metadata_type": "google.spanner.admin.instance.v1.CreateInstanceConfigMetadata" - } - } - ] - }, - "UpdateInstanceConfig": { - "requestType": "UpdateInstanceConfigRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).patch": "/v1/{instance_config.name=projects/*/instanceConfigs/*}", - "(google.api.http).body": "*", - "(google.api.method_signature)": "instance_config,update_mask", - "(google.longrunning.operation_info).response_type": "google.spanner.admin.instance.v1.InstanceConfig", - "(google.longrunning.operation_info).metadata_type": "google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v1/{instance_config.name=projects/*/instanceConfigs/*}", - "body": "*" - } - }, - { - "(google.api.method_signature)": "instance_config,update_mask" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "google.spanner.admin.instance.v1.InstanceConfig", - "metadata_type": "google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata" - } - } - ] - }, - "DeleteInstanceConfig": { - "requestType": "DeleteInstanceConfigRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v1/{name=projects/*/instanceConfigs/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1/{name=projects/*/instanceConfigs/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListInstanceConfigOperations": { - "requestType": "ListInstanceConfigOperationsRequest", - "responseType": "ListInstanceConfigOperationsResponse", - "options": { - "(google.api.http).get": "/v1/{parent=projects/*}/instanceConfigOperations", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=projects/*}/instanceConfigOperations" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "ListInstances": { - "requestType": "ListInstancesRequest", - "responseType": "ListInstancesResponse", - "options": { - "(google.api.http).get": "/v1/{parent=projects/*}/instances", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=projects/*}/instances" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "ListInstancePartitions": { - "requestType": "ListInstancePartitionsRequest", - "responseType": "ListInstancePartitionsResponse", - "options": { - "(google.api.http).get": "/v1/{parent=projects/*/instances/*}/instancePartitions", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=projects/*/instances/*}/instancePartitions" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "GetInstance": { - "requestType": "GetInstanceRequest", - "responseType": "Instance", - "options": { - "(google.api.http).get": "/v1/{name=projects/*/instances/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=projects/*/instances/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "CreateInstance": { - "requestType": "CreateInstanceRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1/{parent=projects/*}/instances", - "(google.api.http).body": "*", - "(google.api.method_signature)": "parent,instance_id,instance", - "(google.longrunning.operation_info).response_type": "google.spanner.admin.instance.v1.Instance", - "(google.longrunning.operation_info).metadata_type": "google.spanner.admin.instance.v1.CreateInstanceMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{parent=projects/*}/instances", - "body": "*" - } - }, - { - "(google.api.method_signature)": "parent,instance_id,instance" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "google.spanner.admin.instance.v1.Instance", - "metadata_type": "google.spanner.admin.instance.v1.CreateInstanceMetadata" - } - } - ] - }, - "UpdateInstance": { - "requestType": "UpdateInstanceRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).patch": "/v1/{instance.name=projects/*/instances/*}", - "(google.api.http).body": "*", - "(google.api.method_signature)": "instance,field_mask", - "(google.longrunning.operation_info).response_type": "google.spanner.admin.instance.v1.Instance", - "(google.longrunning.operation_info).metadata_type": "google.spanner.admin.instance.v1.UpdateInstanceMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v1/{instance.name=projects/*/instances/*}", - "body": "*" - } - }, - { - "(google.api.method_signature)": "instance,field_mask" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "google.spanner.admin.instance.v1.Instance", - "metadata_type": "google.spanner.admin.instance.v1.UpdateInstanceMetadata" - } - } - ] - }, - "DeleteInstance": { - "requestType": "DeleteInstanceRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v1/{name=projects/*/instances/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1/{name=projects/*/instances/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "SetIamPolicy": { - "requestType": "google.iam.v1.SetIamPolicyRequest", - "responseType": "google.iam.v1.Policy", - "options": { - "(google.api.http).post": "/v1/{resource=projects/*/instances/*}:setIamPolicy", - "(google.api.http).body": "*", - "(google.api.method_signature)": "resource,policy" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{resource=projects/*/instances/*}:setIamPolicy", - "body": "*" - } - }, - { - "(google.api.method_signature)": "resource,policy" - } - ] - }, - "GetIamPolicy": { - "requestType": "google.iam.v1.GetIamPolicyRequest", - "responseType": "google.iam.v1.Policy", - "options": { - "(google.api.http).post": "/v1/{resource=projects/*/instances/*}:getIamPolicy", - "(google.api.http).body": "*", - "(google.api.method_signature)": "resource" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{resource=projects/*/instances/*}:getIamPolicy", - "body": "*" - } - }, - { - "(google.api.method_signature)": "resource" - } - ] - }, - "TestIamPermissions": { - "requestType": "google.iam.v1.TestIamPermissionsRequest", - "responseType": "google.iam.v1.TestIamPermissionsResponse", - "options": { - "(google.api.http).post": "/v1/{resource=projects/*/instances/*}:testIamPermissions", - "(google.api.http).body": "*", - "(google.api.method_signature)": "resource,permissions" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{resource=projects/*/instances/*}:testIamPermissions", - "body": "*" - } - }, - { - "(google.api.method_signature)": "resource,permissions" - } - ] - }, - "GetInstancePartition": { - "requestType": "GetInstancePartitionRequest", - "responseType": "InstancePartition", - "options": { - "(google.api.http).get": "/v1/{name=projects/*/instances/*/instancePartitions/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=projects/*/instances/*/instancePartitions/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "CreateInstancePartition": { - "requestType": "CreateInstancePartitionRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1/{parent=projects/*/instances/*}/instancePartitions", - "(google.api.http).body": "*", - "(google.api.method_signature)": "parent,instance_partition,instance_partition_id", - "(google.longrunning.operation_info).response_type": "google.spanner.admin.instance.v1.InstancePartition", - "(google.longrunning.operation_info).metadata_type": "google.spanner.admin.instance.v1.CreateInstancePartitionMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{parent=projects/*/instances/*}/instancePartitions", - "body": "*" - } - }, - { - "(google.api.method_signature)": "parent,instance_partition,instance_partition_id" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "google.spanner.admin.instance.v1.InstancePartition", - "metadata_type": "google.spanner.admin.instance.v1.CreateInstancePartitionMetadata" - } - } - ] - }, - "DeleteInstancePartition": { - "requestType": "DeleteInstancePartitionRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v1/{name=projects/*/instances/*/instancePartitions/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1/{name=projects/*/instances/*/instancePartitions/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "UpdateInstancePartition": { - "requestType": "UpdateInstancePartitionRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).patch": "/v1/{instance_partition.name=projects/*/instances/*/instancePartitions/*}", - "(google.api.http).body": "*", - "(google.api.method_signature)": "instance_partition,field_mask", - "(google.longrunning.operation_info).response_type": "google.spanner.admin.instance.v1.InstancePartition", - "(google.longrunning.operation_info).metadata_type": "google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v1/{instance_partition.name=projects/*/instances/*/instancePartitions/*}", - "body": "*" - } - }, - { - "(google.api.method_signature)": "instance_partition,field_mask" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "google.spanner.admin.instance.v1.InstancePartition", - "metadata_type": "google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata" - } - } - ] - }, - "ListInstancePartitionOperations": { - "requestType": "ListInstancePartitionOperationsRequest", - "responseType": "ListInstancePartitionOperationsResponse", - "options": { - "(google.api.http).get": "/v1/{parent=projects/*/instances/*}/instancePartitionOperations", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=projects/*/instances/*}/instancePartitionOperations" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "MoveInstance": { - "requestType": "MoveInstanceRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1/{name=projects/*/instances/*}:move", - "(google.api.http).body": "*", - "(google.longrunning.operation_info).response_type": "google.spanner.admin.instance.v1.MoveInstanceResponse", - "(google.longrunning.operation_info).metadata_type": "google.spanner.admin.instance.v1.MoveInstanceMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{name=projects/*/instances/*}:move", - "body": "*" - } - }, - { - "(google.longrunning.operation_info)": { - "response_type": "google.spanner.admin.instance.v1.MoveInstanceResponse", - "metadata_type": "google.spanner.admin.instance.v1.MoveInstanceMetadata" - } - } - ] - } - } - }, - "ReplicaInfo": { - "fields": { - "location": { - "type": "string", - "id": 1 - }, - "type": { - "type": "ReplicaType", - "id": 2 - }, - "defaultLeaderLocation": { - "type": "bool", - "id": 3 - } - }, - "nested": { - "ReplicaType": { - "values": { - "TYPE_UNSPECIFIED": 0, - "READ_WRITE": 1, - "READ_ONLY": 2, - "WITNESS": 3 - } - } - } - }, - "InstanceConfig": { - "options": { - "(google.api.resource).type": "spanner.googleapis.com/InstanceConfig", - "(google.api.resource).pattern": "projects/{project}/instanceConfigs/{instance_config}", - "(google.api.resource).plural": "instanceConfigs", - "(google.api.resource).singular": "instanceConfig" - }, - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "displayName": { - "type": "string", - "id": 2 - }, - "configType": { - "type": "Type", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "replicas": { - "rule": "repeated", - "type": "ReplicaInfo", - "id": 3 - }, - "optionalReplicas": { - "rule": "repeated", - "type": "ReplicaInfo", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "baseConfig": { - "type": "string", - "id": 7, - "options": { - "(google.api.resource_reference).type": "spanner.googleapis.com/InstanceConfig" - } - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 8 - }, - "etag": { - "type": "string", - "id": 9 - }, - "leaderOptions": { - "rule": "repeated", - "type": "string", - "id": 4 - }, - "reconciling": { - "type": "bool", - "id": 10, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "state": { - "type": "State", - "id": 11, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "freeInstanceAvailability": { - "type": "FreeInstanceAvailability", - "id": 12, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "quorumType": { - "type": "QuorumType", - "id": 18, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "storageLimitPerProcessingUnit": { - "type": "int64", - "id": 19, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - }, - "nested": { - "Type": { - "values": { - "TYPE_UNSPECIFIED": 0, - "GOOGLE_MANAGED": 1, - "USER_MANAGED": 2 - } - }, - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "CREATING": 1, - "READY": 2 - } - }, - "FreeInstanceAvailability": { - "values": { - "FREE_INSTANCE_AVAILABILITY_UNSPECIFIED": 0, - "AVAILABLE": 1, - "UNSUPPORTED": 2, - "DISABLED": 3, - "QUOTA_EXCEEDED": 4 - } - }, - "QuorumType": { - "values": { - "QUORUM_TYPE_UNSPECIFIED": 0, - "REGION": 1, - "DUAL_REGION": 2, - "MULTI_REGION": 3 - } - } - } - }, - "ReplicaComputeCapacity": { - "oneofs": { - "computeCapacity": { - "oneof": [ - "nodeCount", - "processingUnits" - ] - } - }, - "fields": { - "replicaSelection": { - "type": "ReplicaSelection", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "nodeCount": { - "type": "int32", - "id": 2 - }, - "processingUnits": { - "type": "int32", - "id": 3 - } - } - }, - "AutoscalingConfig": { - "fields": { - "autoscalingLimits": { - "type": "AutoscalingLimits", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "autoscalingTargets": { - "type": "AutoscalingTargets", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "asymmetricAutoscalingOptions": { - "rule": "repeated", - "type": "AsymmetricAutoscalingOption", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "AutoscalingLimits": { - "oneofs": { - "minLimit": { - "oneof": [ - "minNodes", - "minProcessingUnits" - ] - }, - "maxLimit": { - "oneof": [ - "maxNodes", - "maxProcessingUnits" - ] - } - }, - "fields": { - "minNodes": { - "type": "int32", - "id": 1 - }, - "minProcessingUnits": { - "type": "int32", - "id": 2 - }, - "maxNodes": { - "type": "int32", - "id": 3 - }, - "maxProcessingUnits": { - "type": "int32", - "id": 4 - } - } - }, - "AutoscalingTargets": { - "fields": { - "highPriorityCpuUtilizationPercent": { - "type": "int32", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "totalCpuUtilizationPercent": { - "type": "int32", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "storageUtilizationPercent": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "AsymmetricAutoscalingOption": { - "fields": { - "replicaSelection": { - "type": "ReplicaSelection", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "overrides": { - "type": "AutoscalingConfigOverrides", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "AutoscalingConfigOverrides": { - "fields": { - "autoscalingLimits": { - "type": "AutoscalingLimits", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "autoscalingTargetHighPriorityCpuUtilizationPercent": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "autoscalingTargetTotalCpuUtilizationPercent": { - "type": "int32", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "disableHighPriorityCpuAutoscaling": { - "type": "bool", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "disableTotalCpuAutoscaling": { - "type": "bool", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - } - } - } - } - }, - "Instance": { - "options": { - "(google.api.resource).type": "spanner.googleapis.com/Instance", - "(google.api.resource).pattern": "projects/{project}/instances/{instance}", - "(google.api.resource).plural": "instances", - "(google.api.resource).singular": "instance" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "config": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/InstanceConfig" - } - }, - "displayName": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "nodeCount": { - "type": "int32", - "id": 5 - }, - "processingUnits": { - "type": "int32", - "id": 9 - }, - "replicaComputeCapacity": { - "rule": "repeated", - "type": "ReplicaComputeCapacity", - "id": 19, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "autoscalingConfig": { - "type": "AutoscalingConfig", - "id": 17, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "state": { - "type": "State", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 7 - }, - "instanceType": { - "type": "InstanceType", - "id": 10 - }, - "endpointUris": { - "rule": "repeated", - "type": "string", - "id": 8 - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 11, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 12, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "freeInstanceMetadata": { - "type": "FreeInstanceMetadata", - "id": 13 - }, - "edition": { - "type": "Edition", - "id": 20, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "defaultBackupScheduleType": { - "type": "DefaultBackupScheduleType", - "id": 23, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "CREATING": 1, - "READY": 2 - } - }, - "InstanceType": { - "values": { - "INSTANCE_TYPE_UNSPECIFIED": 0, - "PROVISIONED": 1, - "FREE_INSTANCE": 2 - } - }, - "Edition": { - "values": { - "EDITION_UNSPECIFIED": 0, - "STANDARD": 1, - "ENTERPRISE": 2, - "ENTERPRISE_PLUS": 3 - } - }, - "DefaultBackupScheduleType": { - "values": { - "DEFAULT_BACKUP_SCHEDULE_TYPE_UNSPECIFIED": 0, - "NONE": 1, - "AUTOMATIC": 2 - } - } - } - }, - "ListInstanceConfigsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" - } - }, - "pageSize": { - "type": "int32", - "id": 2 - }, - "pageToken": { - "type": "string", - "id": 3 - } - } - }, - "ListInstanceConfigsResponse": { - "fields": { - "instanceConfigs": { - "rule": "repeated", - "type": "InstanceConfig", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "GetInstanceConfigRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/InstanceConfig" - } - } - } - }, - "CreateInstanceConfigRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" - } - }, - "instanceConfigId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "instanceConfig": { - "type": "InstanceConfig", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "validateOnly": { - "type": "bool", - "id": 4 - } - } - }, - "UpdateInstanceConfigRequest": { - "fields": { - "instanceConfig": { - "type": "InstanceConfig", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "validateOnly": { - "type": "bool", - "id": 3 - } - } - }, - "DeleteInstanceConfigRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/InstanceConfig" - } - }, - "etag": { - "type": "string", - "id": 2 - }, - "validateOnly": { - "type": "bool", - "id": 3 - } - } - }, - "ListInstanceConfigOperationsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" - } - }, - "filter": { - "type": "string", - "id": 2 - }, - "pageSize": { - "type": "int32", - "id": 3 - }, - "pageToken": { - "type": "string", - "id": 4 - } - } - }, - "ListInstanceConfigOperationsResponse": { - "fields": { - "operations": { - "rule": "repeated", - "type": "google.longrunning.Operation", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "GetInstanceRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/Instance" - } - }, - "fieldMask": { - "type": "google.protobuf.FieldMask", - "id": 2 - } - } - }, - "CreateInstanceRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" - } - }, - "instanceId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "instance": { - "type": "Instance", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "ListInstancesRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" - } - }, - "pageSize": { - "type": "int32", - "id": 2 - }, - "pageToken": { - "type": "string", - "id": 3 - }, - "filter": { - "type": "string", - "id": 4 - }, - "instanceDeadline": { - "type": "google.protobuf.Timestamp", - "id": 5 - } - } - }, - "ListInstancesResponse": { - "fields": { - "instances": { - "rule": "repeated", - "type": "Instance", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - }, - "unreachable": { - "rule": "repeated", - "type": "string", - "id": 3 - } - } - }, - "UpdateInstanceRequest": { - "fields": { - "instance": { - "type": "Instance", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "fieldMask": { - "type": "google.protobuf.FieldMask", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "DeleteInstanceRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/Instance" - } - } - } - }, - "CreateInstanceMetadata": { - "fields": { - "instance": { - "type": "Instance", - "id": 1 - }, - "startTime": { - "type": "google.protobuf.Timestamp", - "id": 2 - }, - "cancelTime": { - "type": "google.protobuf.Timestamp", - "id": 3 - }, - "endTime": { - "type": "google.protobuf.Timestamp", - "id": 4 - }, - "expectedFulfillmentPeriod": { - "type": "FulfillmentPeriod", - "id": 5 - } - } - }, - "UpdateInstanceMetadata": { - "fields": { - "instance": { - "type": "Instance", - "id": 1 - }, - "startTime": { - "type": "google.protobuf.Timestamp", - "id": 2 - }, - "cancelTime": { - "type": "google.protobuf.Timestamp", - "id": 3 - }, - "endTime": { - "type": "google.protobuf.Timestamp", - "id": 4 - }, - "expectedFulfillmentPeriod": { - "type": "FulfillmentPeriod", - "id": 5 - } - } - }, - "FreeInstanceMetadata": { - "fields": { - "expireTime": { - "type": "google.protobuf.Timestamp", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "upgradeTime": { - "type": "google.protobuf.Timestamp", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "expireBehavior": { - "type": "ExpireBehavior", - "id": 3 - } - }, - "nested": { - "ExpireBehavior": { - "values": { - "EXPIRE_BEHAVIOR_UNSPECIFIED": 0, - "FREE_TO_PROVISIONED": 1, - "REMOVE_AFTER_GRACE_PERIOD": 2 - } - } - } - }, - "CreateInstanceConfigMetadata": { - "fields": { - "instanceConfig": { - "type": "InstanceConfig", - "id": 1 - }, - "progress": { - "type": "OperationProgress", - "id": 2 - }, - "cancelTime": { - "type": "google.protobuf.Timestamp", - "id": 3 - } - } - }, - "UpdateInstanceConfigMetadata": { - "fields": { - "instanceConfig": { - "type": "InstanceConfig", - "id": 1 - }, - "progress": { - "type": "OperationProgress", - "id": 2 - }, - "cancelTime": { - "type": "google.protobuf.Timestamp", - "id": 3 - } - } - }, - "InstancePartition": { - "options": { - "(google.api.resource).type": "spanner.googleapis.com/InstancePartition", - "(google.api.resource).pattern": "projects/{project}/instances/{instance}/instancePartitions/{instance_partition}", - "(google.api.resource).plural": "instancePartitions", - "(google.api.resource).singular": "instancePartition" - }, - "oneofs": { - "computeCapacity": { - "oneof": [ - "nodeCount", - "processingUnits" - ] - } - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "config": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/InstanceConfig" - } - }, - "displayName": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "nodeCount": { - "type": "int32", - "id": 5 - }, - "processingUnits": { - "type": "int32", - "id": 6 - }, - "autoscalingConfig": { - "type": "AutoscalingConfig", - "id": 13, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "state": { - "type": "State", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 8, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 9, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "referencingDatabases": { - "rule": "repeated", - "type": "string", - "id": 10, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "referencingBackups": { - "rule": "repeated", - "type": "string", - "id": 11, - "options": { - "deprecated": true, - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "etag": { - "type": "string", - "id": 12 - } - }, - "nested": { - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "CREATING": 1, - "READY": 2 - } - } - } - }, - "CreateInstancePartitionMetadata": { - "fields": { - "instancePartition": { - "type": "InstancePartition", - "id": 1 - }, - "startTime": { - "type": "google.protobuf.Timestamp", - "id": 2 - }, - "cancelTime": { - "type": "google.protobuf.Timestamp", - "id": 3 - }, - "endTime": { - "type": "google.protobuf.Timestamp", - "id": 4 - } - } - }, - "CreateInstancePartitionRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/Instance" - } - }, - "instancePartitionId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "instancePartition": { - "type": "InstancePartition", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "DeleteInstancePartitionRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/InstancePartition" - } - }, - "etag": { - "type": "string", - "id": 2 - } - } - }, - "GetInstancePartitionRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/InstancePartition" - } - } - } - }, - "UpdateInstancePartitionRequest": { - "fields": { - "instancePartition": { - "type": "InstancePartition", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "fieldMask": { - "type": "google.protobuf.FieldMask", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "UpdateInstancePartitionMetadata": { - "fields": { - "instancePartition": { - "type": "InstancePartition", - "id": 1 - }, - "startTime": { - "type": "google.protobuf.Timestamp", - "id": 2 - }, - "cancelTime": { - "type": "google.protobuf.Timestamp", - "id": 3 - }, - "endTime": { - "type": "google.protobuf.Timestamp", - "id": 4 - } - } - }, - "ListInstancePartitionsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/Instance" - } - }, - "pageSize": { - "type": "int32", - "id": 2 - }, - "pageToken": { - "type": "string", - "id": 3 - }, - "instancePartitionDeadline": { - "type": "google.protobuf.Timestamp", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListInstancePartitionsResponse": { - "fields": { - "instancePartitions": { - "rule": "repeated", - "type": "InstancePartition", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - }, - "unreachable": { - "rule": "repeated", - "type": "string", - "id": 3 - } - } - }, - "ListInstancePartitionOperationsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/Instance" - } - }, - "filter": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pageSize": { - "type": "int32", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pageToken": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "instancePartitionDeadline": { - "type": "google.protobuf.Timestamp", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListInstancePartitionOperationsResponse": { - "fields": { - "operations": { - "rule": "repeated", - "type": "google.longrunning.Operation", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - }, - "unreachableInstancePartitions": { - "rule": "repeated", - "type": "string", - "id": 3 - } - } - }, - "MoveInstanceRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/Instance" - } - }, - "targetConfig": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/InstanceConfig" - } - } - } - }, - "MoveInstanceResponse": { - "fields": {} - }, - "MoveInstanceMetadata": { - "fields": { - "targetConfig": { - "type": "string", - "id": 1 - }, - "progress": { - "type": "OperationProgress", - "id": 2 - }, - "cancelTime": { - "type": "google.protobuf.Timestamp", - "id": 3 - } - } - } - } - } - } - } - } - } - } - }, - "api": { - "options": { - "go_package": "google.golang.org/genproto/googleapis/api;api", - "java_multiple_files": true, - "java_outer_classname": "LaunchStageProto", - "java_package": "com.google.api", - "objc_class_prefix": "GAPI", - "cc_enable_arenas": true - }, - "nested": { - "fieldBehavior": { - "rule": "repeated", - "type": "google.api.FieldBehavior", - "id": 1052, - "extend": "google.protobuf.FieldOptions", - "options": { - "packed": false - } - }, - "FieldBehavior": { - "values": { - "FIELD_BEHAVIOR_UNSPECIFIED": 0, - "OPTIONAL": 1, - "REQUIRED": 2, - "OUTPUT_ONLY": 3, - "INPUT_ONLY": 4, - "IMMUTABLE": 5, - "UNORDERED_LIST": 6, - "NON_EMPTY_DEFAULT": 7, - "IDENTIFIER": 8 - } - }, - "resourceReference": { - "type": "google.api.ResourceReference", - "id": 1055, - "extend": "google.protobuf.FieldOptions" - }, - "resourceDefinition": { - "rule": "repeated", - "type": "google.api.ResourceDescriptor", - "id": 1053, - "extend": "google.protobuf.FileOptions" - }, - "resource": { - "type": "google.api.ResourceDescriptor", - "id": 1053, - "extend": "google.protobuf.MessageOptions" - }, - "ResourceDescriptor": { - "fields": { - "type": { - "type": "string", - "id": 1 - }, - "pattern": { - "rule": "repeated", - "type": "string", - "id": 2 - }, - "nameField": { - "type": "string", - "id": 3 - }, - "history": { - "type": "History", - "id": 4 - }, - "plural": { - "type": "string", - "id": 5 - }, - "singular": { - "type": "string", - "id": 6 - }, - "style": { - "rule": "repeated", - "type": "Style", - "id": 10 - } - }, - "nested": { - "History": { - "values": { - "HISTORY_UNSPECIFIED": 0, - "ORIGINALLY_SINGLE_PATTERN": 1, - "FUTURE_MULTI_PATTERN": 2 - } - }, - "Style": { - "values": { - "STYLE_UNSPECIFIED": 0, - "DECLARATIVE_FRIENDLY": 1 - } - } - } - }, - "ResourceReference": { - "fields": { - "type": { - "type": "string", - "id": 1 - }, - "childType": { - "type": "string", - "id": 2 - } - } - }, - "http": { - "type": "HttpRule", - "id": 72295728, - "extend": "google.protobuf.MethodOptions" - }, - "Http": { - "fields": { - "rules": { - "rule": "repeated", - "type": "HttpRule", - "id": 1 - }, - "fullyDecodeReservedExpansion": { - "type": "bool", - "id": 2 - } - } - }, - "HttpRule": { - "oneofs": { - "pattern": { - "oneof": [ - "get", - "put", - "post", - "delete", - "patch", - "custom" - ] - } - }, - "fields": { - "selector": { - "type": "string", - "id": 1 - }, - "get": { - "type": "string", - "id": 2 - }, - "put": { - "type": "string", - "id": 3 - }, - "post": { - "type": "string", - "id": 4 - }, - "delete": { - "type": "string", - "id": 5 - }, - "patch": { - "type": "string", - "id": 6 - }, - "custom": { - "type": "CustomHttpPattern", - "id": 8 - }, - "body": { - "type": "string", - "id": 7 - }, - "responseBody": { - "type": "string", - "id": 12 - }, - "additionalBindings": { - "rule": "repeated", - "type": "HttpRule", - "id": 11 - } - } - }, - "CustomHttpPattern": { - "fields": { - "kind": { - "type": "string", - "id": 1 - }, - "path": { - "type": "string", - "id": 2 - } - } - }, - "methodSignature": { - "rule": "repeated", - "type": "string", - "id": 1051, - "extend": "google.protobuf.MethodOptions" - }, - "defaultHost": { - "type": "string", - "id": 1049, - "extend": "google.protobuf.ServiceOptions" - }, - "oauthScopes": { - "type": "string", - "id": 1050, - "extend": "google.protobuf.ServiceOptions" - }, - "apiVersion": { - "type": "string", - "id": 525000001, - "extend": "google.protobuf.ServiceOptions" - }, - "CommonLanguageSettings": { - "fields": { - "referenceDocsUri": { - "type": "string", - "id": 1, - "options": { - "deprecated": true - } - }, - "destinations": { - "rule": "repeated", - "type": "ClientLibraryDestination", - "id": 2 - } - } - }, - "ClientLibrarySettings": { - "fields": { - "version": { - "type": "string", - "id": 1 - }, - "launchStage": { - "type": "LaunchStage", - "id": 2 - }, - "restNumericEnums": { - "type": "bool", - "id": 3 - }, - "javaSettings": { - "type": "JavaSettings", - "id": 21 - }, - "cppSettings": { - "type": "CppSettings", - "id": 22 - }, - "phpSettings": { - "type": "PhpSettings", - "id": 23 - }, - "pythonSettings": { - "type": "PythonSettings", - "id": 24 - }, - "nodeSettings": { - "type": "NodeSettings", - "id": 25 - }, - "dotnetSettings": { - "type": "DotnetSettings", - "id": 26 - }, - "rubySettings": { - "type": "RubySettings", - "id": 27 - }, - "goSettings": { - "type": "GoSettings", - "id": 28 - } - } - }, - "Publishing": { - "fields": { - "methodSettings": { - "rule": "repeated", - "type": "MethodSettings", - "id": 2 - }, - "newIssueUri": { - "type": "string", - "id": 101 - }, - "documentationUri": { - "type": "string", - "id": 102 - }, - "apiShortName": { - "type": "string", - "id": 103 - }, - "githubLabel": { - "type": "string", - "id": 104 - }, - "codeownerGithubTeams": { - "rule": "repeated", - "type": "string", - "id": 105 - }, - "docTagPrefix": { - "type": "string", - "id": 106 - }, - "organization": { - "type": "ClientLibraryOrganization", - "id": 107 - }, - "librarySettings": { - "rule": "repeated", - "type": "ClientLibrarySettings", - "id": 109 - }, - "protoReferenceDocumentationUri": { - "type": "string", - "id": 110 - }, - "restReferenceDocumentationUri": { - "type": "string", - "id": 111 - } - } - }, - "JavaSettings": { - "fields": { - "libraryPackage": { - "type": "string", - "id": 1 - }, - "serviceClassNames": { - "keyType": "string", - "type": "string", - "id": 2 - }, - "common": { - "type": "CommonLanguageSettings", - "id": 3 - } - } - }, - "CppSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "PhpSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "PythonSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "NodeSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "DotnetSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - }, - "renamedServices": { - "keyType": "string", - "type": "string", - "id": 2 - }, - "renamedResources": { - "keyType": "string", - "type": "string", - "id": 3 - }, - "ignoredResources": { - "rule": "repeated", - "type": "string", - "id": 4 - }, - "forcedNamespaceAliases": { - "rule": "repeated", - "type": "string", - "id": 5 - }, - "handwrittenSignatures": { - "rule": "repeated", - "type": "string", - "id": 6 - } - } - }, - "RubySettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "GoSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "MethodSettings": { - "fields": { - "selector": { - "type": "string", - "id": 1 - }, - "longRunning": { - "type": "LongRunning", - "id": 2 - }, - "autoPopulatedFields": { - "rule": "repeated", - "type": "string", - "id": 3 - } - }, - "nested": { - "LongRunning": { - "fields": { - "initialPollDelay": { - "type": "google.protobuf.Duration", - "id": 1 - }, - "pollDelayMultiplier": { - "type": "float", - "id": 2 - }, - "maxPollDelay": { - "type": "google.protobuf.Duration", - "id": 3 - }, - "totalPollTimeout": { - "type": "google.protobuf.Duration", - "id": 4 - } - } - } - } - }, - "ClientLibraryOrganization": { - "values": { - "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": 0, - "CLOUD": 1, - "ADS": 2, - "PHOTOS": 3, - "STREET_VIEW": 4, - "SHOPPING": 5, - "GEO": 6, - "GENERATIVE_AI": 7 - } - }, - "ClientLibraryDestination": { - "values": { - "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": 0, - "GITHUB": 10, - "PACKAGE_MANAGER": 20 - } - }, - "LaunchStage": { - "values": { - "LAUNCH_STAGE_UNSPECIFIED": 0, - "UNIMPLEMENTED": 6, - "PRELAUNCH": 7, - "EARLY_ACCESS": 1, - "ALPHA": 2, - "BETA": 3, - "GA": 4, - "DEPRECATED": 5 - } - } - } - }, - "protobuf": { - "options": { - "go_package": "google.golang.org/protobuf/types/descriptorpb", - "java_package": "com.google.protobuf", - "java_outer_classname": "DescriptorProtos", - "csharp_namespace": "Google.Protobuf.Reflection", - "objc_class_prefix": "GPB", - "cc_enable_arenas": true, - "optimize_for": "SPEED" - }, - "nested": { - "FileDescriptorSet": { - "edition": "proto2", - "fields": { - "file": { - "rule": "repeated", - "type": "FileDescriptorProto", - "id": 1 - } - } - }, - "Edition": { - "edition": "proto2", - "values": { - "EDITION_UNKNOWN": 0, - "EDITION_PROTO2": 998, - "EDITION_PROTO3": 999, - "EDITION_2023": 1000, - "EDITION_2024": 1001, - "EDITION_1_TEST_ONLY": 1, - "EDITION_2_TEST_ONLY": 2, - "EDITION_99997_TEST_ONLY": 99997, - "EDITION_99998_TEST_ONLY": 99998, - "EDITION_99999_TEST_ONLY": 99999, - "EDITION_MAX": 2147483647 - } - }, - "FileDescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "package": { - "type": "string", - "id": 2 - }, - "dependency": { - "rule": "repeated", - "type": "string", - "id": 3 - }, - "publicDependency": { - "rule": "repeated", - "type": "int32", - "id": 10 - }, - "weakDependency": { - "rule": "repeated", - "type": "int32", - "id": 11 - }, - "messageType": { - "rule": "repeated", - "type": "DescriptorProto", - "id": 4 - }, - "enumType": { - "rule": "repeated", - "type": "EnumDescriptorProto", - "id": 5 - }, - "service": { - "rule": "repeated", - "type": "ServiceDescriptorProto", - "id": 6 - }, - "extension": { - "rule": "repeated", - "type": "FieldDescriptorProto", - "id": 7 - }, - "options": { - "type": "FileOptions", - "id": 8 - }, - "sourceCodeInfo": { - "type": "SourceCodeInfo", - "id": 9 - }, - "syntax": { - "type": "string", - "id": 12 - }, - "edition": { - "type": "Edition", - "id": 14 - } - } - }, - "DescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "field": { - "rule": "repeated", - "type": "FieldDescriptorProto", - "id": 2 - }, - "extension": { - "rule": "repeated", - "type": "FieldDescriptorProto", - "id": 6 - }, - "nestedType": { - "rule": "repeated", - "type": "DescriptorProto", - "id": 3 - }, - "enumType": { - "rule": "repeated", - "type": "EnumDescriptorProto", - "id": 4 - }, - "extensionRange": { - "rule": "repeated", - "type": "ExtensionRange", - "id": 5 - }, - "oneofDecl": { - "rule": "repeated", - "type": "OneofDescriptorProto", - "id": 8 - }, - "options": { - "type": "MessageOptions", - "id": 7 - }, - "reservedRange": { - "rule": "repeated", - "type": "ReservedRange", - "id": 9 - }, - "reservedName": { - "rule": "repeated", - "type": "string", - "id": 10 - } - }, - "nested": { - "ExtensionRange": { - "fields": { - "start": { - "type": "int32", - "id": 1 - }, - "end": { - "type": "int32", - "id": 2 - }, - "options": { - "type": "ExtensionRangeOptions", - "id": 3 - } - } - }, - "ReservedRange": { - "fields": { - "start": { - "type": "int32", - "id": 1 - }, - "end": { - "type": "int32", - "id": 2 - } - } - } - } - }, - "ExtensionRangeOptions": { - "edition": "proto2", - "fields": { - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - }, - "declaration": { - "rule": "repeated", - "type": "Declaration", - "id": 2, - "options": { - "retention": "RETENTION_SOURCE" - } - }, - "features": { - "type": "FeatureSet", - "id": 50 - }, - "verification": { - "type": "VerificationState", - "id": 3, - "options": { - "default": "UNVERIFIED", - "retention": "RETENTION_SOURCE" - } - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "nested": { - "Declaration": { - "fields": { - "number": { - "type": "int32", - "id": 1 - }, - "fullName": { - "type": "string", - "id": 2 - }, - "type": { - "type": "string", - "id": 3 - }, - "reserved": { - "type": "bool", - "id": 5 - }, - "repeated": { - "type": "bool", - "id": 6 - } - }, - "reserved": [ - [ - 4, - 4 - ] - ] - }, - "VerificationState": { - "values": { - "DECLARATION": 0, - "UNVERIFIED": 1 - } - } - } - }, - "FieldDescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "number": { - "type": "int32", - "id": 3 - }, - "label": { - "type": "Label", - "id": 4 - }, - "type": { - "type": "Type", - "id": 5 - }, - "typeName": { - "type": "string", - "id": 6 - }, - "extendee": { - "type": "string", - "id": 2 - }, - "defaultValue": { - "type": "string", - "id": 7 - }, - "oneofIndex": { - "type": "int32", - "id": 9 - }, - "jsonName": { - "type": "string", - "id": 10 - }, - "options": { - "type": "FieldOptions", - "id": 8 - }, - "proto3Optional": { - "type": "bool", - "id": 17 - } - }, - "nested": { - "Type": { - "values": { - "TYPE_DOUBLE": 1, - "TYPE_FLOAT": 2, - "TYPE_INT64": 3, - "TYPE_UINT64": 4, - "TYPE_INT32": 5, - "TYPE_FIXED64": 6, - "TYPE_FIXED32": 7, - "TYPE_BOOL": 8, - "TYPE_STRING": 9, - "TYPE_GROUP": 10, - "TYPE_MESSAGE": 11, - "TYPE_BYTES": 12, - "TYPE_UINT32": 13, - "TYPE_ENUM": 14, - "TYPE_SFIXED32": 15, - "TYPE_SFIXED64": 16, - "TYPE_SINT32": 17, - "TYPE_SINT64": 18 - } - }, - "Label": { - "values": { - "LABEL_OPTIONAL": 1, - "LABEL_REPEATED": 3, - "LABEL_REQUIRED": 2 - } - } - } - }, - "OneofDescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "options": { - "type": "OneofOptions", - "id": 2 - } - } - }, - "EnumDescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "value": { - "rule": "repeated", - "type": "EnumValueDescriptorProto", - "id": 2 - }, - "options": { - "type": "EnumOptions", - "id": 3 - }, - "reservedRange": { - "rule": "repeated", - "type": "EnumReservedRange", - "id": 4 - }, - "reservedName": { - "rule": "repeated", - "type": "string", - "id": 5 - } - }, - "nested": { - "EnumReservedRange": { - "fields": { - "start": { - "type": "int32", - "id": 1 - }, - "end": { - "type": "int32", - "id": 2 - } - } - } - } - }, - "EnumValueDescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "number": { - "type": "int32", - "id": 2 - }, - "options": { - "type": "EnumValueOptions", - "id": 3 - } - } - }, - "ServiceDescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "method": { - "rule": "repeated", - "type": "MethodDescriptorProto", - "id": 2 - }, - "options": { - "type": "ServiceOptions", - "id": 3 - } - } - }, - "MethodDescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "inputType": { - "type": "string", - "id": 2 - }, - "outputType": { - "type": "string", - "id": 3 - }, - "options": { - "type": "MethodOptions", - "id": 4 - }, - "clientStreaming": { - "type": "bool", - "id": 5, - "options": { - "default": false - } - }, - "serverStreaming": { - "type": "bool", - "id": 6, - "options": { - "default": false - } - } - } - }, - "FileOptions": { - "edition": "proto2", - "fields": { - "javaPackage": { - "type": "string", - "id": 1 - }, - "javaOuterClassname": { - "type": "string", - "id": 8 - }, - "javaMultipleFiles": { - "type": "bool", - "id": 10, - "options": { - "default": false - } - }, - "javaGenerateEqualsAndHash": { - "type": "bool", - "id": 20, - "options": { - "deprecated": true - } - }, - "javaStringCheckUtf8": { - "type": "bool", - "id": 27, - "options": { - "default": false - } - }, - "optimizeFor": { - "type": "OptimizeMode", - "id": 9, - "options": { - "default": "SPEED" - } - }, - "goPackage": { - "type": "string", - "id": 11 - }, - "ccGenericServices": { - "type": "bool", - "id": 16, - "options": { - "default": false - } - }, - "javaGenericServices": { - "type": "bool", - "id": 17, - "options": { - "default": false - } - }, - "pyGenericServices": { - "type": "bool", - "id": 18, - "options": { - "default": false - } - }, - "deprecated": { - "type": "bool", - "id": 23, - "options": { - "default": false - } - }, - "ccEnableArenas": { - "type": "bool", - "id": 31, - "options": { - "default": true - } - }, - "objcClassPrefix": { - "type": "string", - "id": 36 - }, - "csharpNamespace": { - "type": "string", - "id": 37 - }, - "swiftPrefix": { - "type": "string", - "id": 39 - }, - "phpClassPrefix": { - "type": "string", - "id": 40 - }, - "phpNamespace": { - "type": "string", - "id": 41 - }, - "phpMetadataNamespace": { - "type": "string", - "id": 44 - }, - "rubyPackage": { - "type": "string", - "id": 45 - }, - "features": { - "type": "FeatureSet", - "id": 50 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "reserved": [ - [ - 42, - 42 - ], - [ - 38, - 38 - ] - ], - "nested": { - "OptimizeMode": { - "values": { - "SPEED": 1, - "CODE_SIZE": 2, - "LITE_RUNTIME": 3 - } - } - } - }, - "MessageOptions": { - "edition": "proto2", - "fields": { - "messageSetWireFormat": { - "type": "bool", - "id": 1, - "options": { - "default": false - } - }, - "noStandardDescriptorAccessor": { - "type": "bool", - "id": 2, - "options": { - "default": false - } - }, - "deprecated": { - "type": "bool", - "id": 3, - "options": { - "default": false - } - }, - "mapEntry": { - "type": "bool", - "id": 7 - }, - "deprecatedLegacyJsonFieldConflicts": { - "type": "bool", - "id": 11, - "options": { - "deprecated": true - } - }, - "features": { - "type": "FeatureSet", - "id": 12 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "reserved": [ - [ - 4, - 4 - ], - [ - 5, - 5 - ], - [ - 6, - 6 - ], - [ - 8, - 8 - ], - [ - 9, - 9 - ] - ] - }, - "FieldOptions": { - "edition": "proto2", - "fields": { - "ctype": { - "type": "CType", - "id": 1, - "options": { - "default": "STRING" - } - }, - "packed": { - "type": "bool", - "id": 2 - }, - "jstype": { - "type": "JSType", - "id": 6, - "options": { - "default": "JS_NORMAL" - } - }, - "lazy": { - "type": "bool", - "id": 5, - "options": { - "default": false - } - }, - "unverifiedLazy": { - "type": "bool", - "id": 15, - "options": { - "default": false - } - }, - "deprecated": { - "type": "bool", - "id": 3, - "options": { - "default": false - } - }, - "weak": { - "type": "bool", - "id": 10, - "options": { - "default": false - } - }, - "debugRedact": { - "type": "bool", - "id": 16, - "options": { - "default": false - } - }, - "retention": { - "type": "OptionRetention", - "id": 17 - }, - "targets": { - "rule": "repeated", - "type": "OptionTargetType", - "id": 19 - }, - "editionDefaults": { - "rule": "repeated", - "type": "EditionDefault", - "id": 20 - }, - "features": { - "type": "FeatureSet", - "id": 21 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "reserved": [ - [ - 4, - 4 - ], - [ - 18, - 18 - ] - ], - "nested": { - "CType": { - "values": { - "STRING": 0, - "CORD": 1, - "STRING_PIECE": 2 - } - }, - "JSType": { - "values": { - "JS_NORMAL": 0, - "JS_STRING": 1, - "JS_NUMBER": 2 - } - }, - "OptionRetention": { - "values": { - "RETENTION_UNKNOWN": 0, - "RETENTION_RUNTIME": 1, - "RETENTION_SOURCE": 2 - } - }, - "OptionTargetType": { - "values": { - "TARGET_TYPE_UNKNOWN": 0, - "TARGET_TYPE_FILE": 1, - "TARGET_TYPE_EXTENSION_RANGE": 2, - "TARGET_TYPE_MESSAGE": 3, - "TARGET_TYPE_FIELD": 4, - "TARGET_TYPE_ONEOF": 5, - "TARGET_TYPE_ENUM": 6, - "TARGET_TYPE_ENUM_ENTRY": 7, - "TARGET_TYPE_SERVICE": 8, - "TARGET_TYPE_METHOD": 9 - } - }, - "EditionDefault": { - "fields": { - "edition": { - "type": "Edition", - "id": 3 - }, - "value": { - "type": "string", - "id": 2 - } - } - } - } - }, - "OneofOptions": { - "edition": "proto2", - "fields": { - "features": { - "type": "FeatureSet", - "id": 1 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ] - }, - "EnumOptions": { - "edition": "proto2", - "fields": { - "allowAlias": { - "type": "bool", - "id": 2 - }, - "deprecated": { - "type": "bool", - "id": 3, - "options": { - "default": false - } - }, - "deprecatedLegacyJsonFieldConflicts": { - "type": "bool", - "id": 6, - "options": { - "deprecated": true - } - }, - "features": { - "type": "FeatureSet", - "id": 7 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "reserved": [ - [ - 5, - 5 - ] - ] - }, - "EnumValueOptions": { - "edition": "proto2", - "fields": { - "deprecated": { - "type": "bool", - "id": 1, - "options": { - "default": false - } - }, - "features": { - "type": "FeatureSet", - "id": 2 - }, - "debugRedact": { - "type": "bool", - "id": 3, - "options": { - "default": false - } - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ] - }, - "ServiceOptions": { - "edition": "proto2", - "fields": { - "features": { - "type": "FeatureSet", - "id": 34 - }, - "deprecated": { - "type": "bool", - "id": 33, - "options": { - "default": false - } - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ] - }, - "MethodOptions": { - "edition": "proto2", - "fields": { - "deprecated": { - "type": "bool", - "id": 33, - "options": { - "default": false - } - }, - "idempotencyLevel": { - "type": "IdempotencyLevel", - "id": 34, - "options": { - "default": "IDEMPOTENCY_UNKNOWN" - } - }, - "features": { - "type": "FeatureSet", - "id": 35 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "nested": { - "IdempotencyLevel": { - "values": { - "IDEMPOTENCY_UNKNOWN": 0, - "NO_SIDE_EFFECTS": 1, - "IDEMPOTENT": 2 - } - } - } - }, - "UninterpretedOption": { - "edition": "proto2", - "fields": { - "name": { - "rule": "repeated", - "type": "NamePart", - "id": 2 - }, - "identifierValue": { - "type": "string", - "id": 3 - }, - "positiveIntValue": { - "type": "uint64", - "id": 4 - }, - "negativeIntValue": { - "type": "int64", - "id": 5 - }, - "doubleValue": { - "type": "double", - "id": 6 - }, - "stringValue": { - "type": "bytes", - "id": 7 - }, - "aggregateValue": { - "type": "string", - "id": 8 - } - }, - "nested": { - "NamePart": { - "fields": { - "namePart": { - "rule": "required", - "type": "string", - "id": 1 - }, - "isExtension": { - "rule": "required", - "type": "bool", - "id": 2 - } - } - } - } - }, - "FeatureSet": { - "edition": "proto2", - "fields": { - "fieldPresence": { - "type": "FieldPresence", - "id": 1, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_2023", - "edition_defaults.value": "EXPLICIT" - } - }, - "enumType": { - "type": "EnumType", - "id": 2, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO3", - "edition_defaults.value": "OPEN" - } - }, - "repeatedFieldEncoding": { - "type": "RepeatedFieldEncoding", - "id": 3, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO3", - "edition_defaults.value": "PACKED" - } - }, - "utf8Validation": { - "type": "Utf8Validation", - "id": 4, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO3", - "edition_defaults.value": "VERIFY" - } - }, - "messageEncoding": { - "type": "MessageEncoding", - "id": 5, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO2", - "edition_defaults.value": "LENGTH_PREFIXED" - } - }, - "jsonFormat": { - "type": "JsonFormat", - "id": 6, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO3", - "edition_defaults.value": "ALLOW" - } - } - }, - "extensions": [ - [ - 1000, - 1000 - ], - [ - 1001, - 1001 - ], - [ - 1002, - 1002 - ], - [ - 9990, - 9990 - ], - [ - 9995, - 9999 - ], - [ - 10000, - 10000 - ] - ], - "reserved": [ - [ - 999, - 999 - ] - ], - "nested": { - "FieldPresence": { - "values": { - "FIELD_PRESENCE_UNKNOWN": 0, - "EXPLICIT": 1, - "IMPLICIT": 2, - "LEGACY_REQUIRED": 3 - } - }, - "EnumType": { - "values": { - "ENUM_TYPE_UNKNOWN": 0, - "OPEN": 1, - "CLOSED": 2 - } - }, - "RepeatedFieldEncoding": { - "values": { - "REPEATED_FIELD_ENCODING_UNKNOWN": 0, - "PACKED": 1, - "EXPANDED": 2 - } - }, - "Utf8Validation": { - "values": { - "UTF8_VALIDATION_UNKNOWN": 0, - "VERIFY": 2, - "NONE": 3 - } - }, - "MessageEncoding": { - "values": { - "MESSAGE_ENCODING_UNKNOWN": 0, - "LENGTH_PREFIXED": 1, - "DELIMITED": 2 - } - }, - "JsonFormat": { - "values": { - "JSON_FORMAT_UNKNOWN": 0, - "ALLOW": 1, - "LEGACY_BEST_EFFORT": 2 - } - } - } - }, - "FeatureSetDefaults": { - "edition": "proto2", - "fields": { - "defaults": { - "rule": "repeated", - "type": "FeatureSetEditionDefault", - "id": 1 - }, - "minimumEdition": { - "type": "Edition", - "id": 4 - }, - "maximumEdition": { - "type": "Edition", - "id": 5 - } - }, - "nested": { - "FeatureSetEditionDefault": { - "fields": { - "edition": { - "type": "Edition", - "id": 3 - }, - "features": { - "type": "FeatureSet", - "id": 2 - } - } - } - } - }, - "SourceCodeInfo": { - "edition": "proto2", - "fields": { - "location": { - "rule": "repeated", - "type": "Location", - "id": 1 - } - }, - "nested": { - "Location": { - "fields": { - "path": { - "rule": "repeated", - "type": "int32", - "id": 1, - "options": { - "packed": true - } - }, - "span": { - "rule": "repeated", - "type": "int32", - "id": 2, - "options": { - "packed": true - } - }, - "leadingComments": { - "type": "string", - "id": 3 - }, - "trailingComments": { - "type": "string", - "id": 4 - }, - "leadingDetachedComments": { - "rule": "repeated", - "type": "string", - "id": 6 - } - } - } - } - }, - "GeneratedCodeInfo": { - "edition": "proto2", - "fields": { - "annotation": { - "rule": "repeated", - "type": "Annotation", - "id": 1 - } - }, - "nested": { - "Annotation": { - "fields": { - "path": { - "rule": "repeated", - "type": "int32", - "id": 1, - "options": { - "packed": true - } - }, - "sourceFile": { - "type": "string", - "id": 2 - }, - "begin": { - "type": "int32", - "id": 3 - }, - "end": { - "type": "int32", - "id": 4 - }, - "semantic": { - "type": "Semantic", - "id": 5 - } - }, - "nested": { - "Semantic": { - "values": { - "NONE": 0, - "SET": 1, - "ALIAS": 2 - } - } - } - } - } - }, - "Timestamp": { - "fields": { - "seconds": { - "type": "int64", - "id": 1 - }, - "nanos": { - "type": "int32", - "id": 2 - } - } - }, - "Duration": { - "fields": { - "seconds": { - "type": "int64", - "id": 1 - }, - "nanos": { - "type": "int32", - "id": 2 - } - } - }, - "FieldMask": { - "fields": { - "paths": { - "rule": "repeated", - "type": "string", - "id": 1 - } - } - }, - "Any": { - "fields": { - "type_url": { - "type": "string", - "id": 1 - }, - "value": { - "type": "bytes", - "id": 2 - } - } - }, - "Empty": { - "fields": {} - } - } - }, - "iam": { - "nested": { - "v1": { - "options": { - "cc_enable_arenas": true, - "csharp_namespace": "Google.Cloud.Iam.V1", - "go_package": "cloud.google.com/go/iam/apiv1/iampb;iampb", - "java_multiple_files": true, - "java_outer_classname": "PolicyProto", - "java_package": "com.google.iam.v1", - "php_namespace": "Google\\Cloud\\Iam\\V1" - }, - "nested": { - "IAMPolicy": { - "options": { - "(google.api.default_host)": "iam-meta-api.googleapis.com" - }, - "methods": { - "SetIamPolicy": { - "requestType": "SetIamPolicyRequest", - "responseType": "Policy", - "options": { - "(google.api.http).post": "/v1/{resource=**}:setIamPolicy", - "(google.api.http).body": "*" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{resource=**}:setIamPolicy", - "body": "*" - } - } - ] - }, - "GetIamPolicy": { - "requestType": "GetIamPolicyRequest", - "responseType": "Policy", - "options": { - "(google.api.http).post": "/v1/{resource=**}:getIamPolicy", - "(google.api.http).body": "*" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{resource=**}:getIamPolicy", - "body": "*" - } - } - ] - }, - "TestIamPermissions": { - "requestType": "TestIamPermissionsRequest", - "responseType": "TestIamPermissionsResponse", - "options": { - "(google.api.http).post": "/v1/{resource=**}:testIamPermissions", - "(google.api.http).body": "*" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{resource=**}:testIamPermissions", - "body": "*" - } - } - ] - } - } - }, - "SetIamPolicyRequest": { - "fields": { - "resource": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "*" - } - }, - "policy": { - "type": "Policy", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 3 - } - } - }, - "GetIamPolicyRequest": { - "fields": { - "resource": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "*" - } - }, - "options": { - "type": "GetPolicyOptions", - "id": 2 - } - } - }, - "TestIamPermissionsRequest": { - "fields": { - "resource": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "*" - } - }, - "permissions": { - "rule": "repeated", - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "TestIamPermissionsResponse": { - "fields": { - "permissions": { - "rule": "repeated", - "type": "string", - "id": 1 - } - } - }, - "GetPolicyOptions": { - "fields": { - "requestedPolicyVersion": { - "type": "int32", - "id": 1 - } - } - }, - "Policy": { - "fields": { - "version": { - "type": "int32", - "id": 1 - }, - "bindings": { - "rule": "repeated", - "type": "Binding", - "id": 4 - }, - "auditConfigs": { - "rule": "repeated", - "type": "AuditConfig", - "id": 6 - }, - "etag": { - "type": "bytes", - "id": 3 - } - } - }, - "Binding": { - "fields": { - "role": { - "type": "string", - "id": 1 - }, - "members": { - "rule": "repeated", - "type": "string", - "id": 2 - }, - "condition": { - "type": "google.type.Expr", - "id": 3 - } - } - }, - "AuditConfig": { - "fields": { - "service": { - "type": "string", - "id": 1 - }, - "auditLogConfigs": { - "rule": "repeated", - "type": "AuditLogConfig", - "id": 3 - } - } - }, - "AuditLogConfig": { - "fields": { - "logType": { - "type": "LogType", - "id": 1 - }, - "exemptedMembers": { - "rule": "repeated", - "type": "string", - "id": 2 - } - }, - "nested": { - "LogType": { - "values": { - "LOG_TYPE_UNSPECIFIED": 0, - "ADMIN_READ": 1, - "DATA_WRITE": 2, - "DATA_READ": 3 - } - } - } - }, - "PolicyDelta": { - "fields": { - "bindingDeltas": { - "rule": "repeated", - "type": "BindingDelta", - "id": 1 - }, - "auditConfigDeltas": { - "rule": "repeated", - "type": "AuditConfigDelta", - "id": 2 - } - } - }, - "BindingDelta": { - "fields": { - "action": { - "type": "Action", - "id": 1 - }, - "role": { - "type": "string", - "id": 2 - }, - "member": { - "type": "string", - "id": 3 - }, - "condition": { - "type": "google.type.Expr", - "id": 4 - } - }, - "nested": { - "Action": { - "values": { - "ACTION_UNSPECIFIED": 0, - "ADD": 1, - "REMOVE": 2 - } - } - } - }, - "AuditConfigDelta": { - "fields": { - "action": { - "type": "Action", - "id": 1 - }, - "service": { - "type": "string", - "id": 2 - }, - "exemptedMember": { - "type": "string", - "id": 3 - }, - "logType": { - "type": "string", - "id": 4 - } - }, - "nested": { - "Action": { - "values": { - "ACTION_UNSPECIFIED": 0, - "ADD": 1, - "REMOVE": 2 - } - } - } - } - } - } - } - }, - "type": { - "options": { - "go_package": "google.golang.org/genproto/googleapis/type/expr;expr", - "java_multiple_files": true, - "java_outer_classname": "ExprProto", - "java_package": "com.google.type", - "objc_class_prefix": "GTP" - }, - "nested": { - "Expr": { - "fields": { - "expression": { - "type": "string", - "id": 1 - }, - "title": { - "type": "string", - "id": 2 - }, - "description": { - "type": "string", - "id": 3 - }, - "location": { - "type": "string", - "id": 4 - } - } - } - } - }, - "longrunning": { - "options": { - "cc_enable_arenas": true, - "csharp_namespace": "Google.LongRunning", - "go_package": "cloud.google.com/go/longrunning/autogen/longrunningpb;longrunningpb", - "java_multiple_files": true, - "java_outer_classname": "OperationsProto", - "java_package": "com.google.longrunning", - "php_namespace": "Google\\LongRunning" - }, - "nested": { - "operationInfo": { - "type": "google.longrunning.OperationInfo", - "id": 1049, - "extend": "google.protobuf.MethodOptions" - }, - "Operations": { - "options": { - "(google.api.default_host)": "longrunning.googleapis.com" - }, - "methods": { - "ListOperations": { - "requestType": "ListOperationsRequest", - "responseType": "ListOperationsResponse", - "options": { - "(google.api.http).get": "/v1/{name=operations}", - "(google.api.method_signature)": "name,filter" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=operations}" - } - }, - { - "(google.api.method_signature)": "name,filter" - } - ] - }, - "GetOperation": { - "requestType": "GetOperationRequest", - "responseType": "Operation", - "options": { - "(google.api.http).get": "/v1/{name=operations/**}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=operations/**}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "DeleteOperation": { - "requestType": "DeleteOperationRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v1/{name=operations/**}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1/{name=operations/**}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "CancelOperation": { - "requestType": "CancelOperationRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).post": "/v1/{name=operations/**}:cancel", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{name=operations/**}:cancel", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "WaitOperation": { - "requestType": "WaitOperationRequest", - "responseType": "Operation" - } - } - }, - "Operation": { - "oneofs": { - "result": { - "oneof": [ - "error", - "response" - ] - } - }, - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "metadata": { - "type": "google.protobuf.Any", - "id": 2 - }, - "done": { - "type": "bool", - "id": 3 - }, - "error": { - "type": "google.rpc.Status", - "id": 4 - }, - "response": { - "type": "google.protobuf.Any", - "id": 5 - } - } - }, - "GetOperationRequest": { - "fields": { - "name": { - "type": "string", - "id": 1 - } - } - }, - "ListOperationsRequest": { - "fields": { - "name": { - "type": "string", - "id": 4 - }, - "filter": { - "type": "string", - "id": 1 - }, - "pageSize": { - "type": "int32", - "id": 2 - }, - "pageToken": { - "type": "string", - "id": 3 - } - } - }, - "ListOperationsResponse": { - "fields": { - "operations": { - "rule": "repeated", - "type": "Operation", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "CancelOperationRequest": { - "fields": { - "name": { - "type": "string", - "id": 1 - } - } - }, - "DeleteOperationRequest": { - "fields": { - "name": { - "type": "string", - "id": 1 - } - } - }, - "WaitOperationRequest": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "timeout": { - "type": "google.protobuf.Duration", - "id": 2 - } - } - }, - "OperationInfo": { - "fields": { - "responseType": { - "type": "string", - "id": 1 - }, - "metadataType": { - "type": "string", - "id": 2 - } - } - } - } - }, - "rpc": { - "options": { - "cc_enable_arenas": true, - "go_package": "google.golang.org/genproto/googleapis/rpc/status;status", - "java_multiple_files": true, - "java_outer_classname": "StatusProto", - "java_package": "com.google.rpc", - "objc_class_prefix": "RPC" - }, - "nested": { - "Status": { - "fields": { - "code": { - "type": "int32", - "id": 1 - }, - "message": { - "type": "string", - "id": 2 - }, - "details": { - "rule": "repeated", - "type": "google.protobuf.Any", - "id": 3 - } - } - } - } - } - } - } - } -} \ No newline at end of file diff --git a/owl-bot-staging/admin/instance/v1/src/index.ts b/owl-bot-staging/admin/instance/v1/src/index.ts deleted file mode 100644 index 52e6684f0..000000000 --- a/owl-bot-staging/admin/instance/v1/src/index.ts +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as v1 from './v1'; -const InstanceAdminClient = v1.InstanceAdminClient; -type InstanceAdminClient = v1.InstanceAdminClient; -export {v1, InstanceAdminClient}; -export default {v1, InstanceAdminClient}; -import * as protos from '../protos/protos'; -export {protos} diff --git a/owl-bot-staging/admin/instance/v1/src/v1/gapic_metadata.json b/owl-bot-staging/admin/instance/v1/src/v1/gapic_metadata.json deleted file mode 100644 index 88f7f07dc..000000000 --- a/owl-bot-staging/admin/instance/v1/src/v1/gapic_metadata.json +++ /dev/null @@ -1,253 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "typescript", - "protoPackage": "google.spanner.admin.instance.v1", - "libraryPackage": "@google-cloud/spanner", - "services": { - "InstanceAdmin": { - "clients": { - "grpc": { - "libraryClient": "InstanceAdminClient", - "rpcs": { - "GetInstanceConfig": { - "methods": [ - "getInstanceConfig" - ] - }, - "DeleteInstanceConfig": { - "methods": [ - "deleteInstanceConfig" - ] - }, - "GetInstance": { - "methods": [ - "getInstance" - ] - }, - "DeleteInstance": { - "methods": [ - "deleteInstance" - ] - }, - "SetIamPolicy": { - "methods": [ - "setIamPolicy" - ] - }, - "GetIamPolicy": { - "methods": [ - "getIamPolicy" - ] - }, - "TestIamPermissions": { - "methods": [ - "testIamPermissions" - ] - }, - "GetInstancePartition": { - "methods": [ - "getInstancePartition" - ] - }, - "DeleteInstancePartition": { - "methods": [ - "deleteInstancePartition" - ] - }, - "CreateInstanceConfig": { - "methods": [ - "createInstanceConfig" - ] - }, - "UpdateInstanceConfig": { - "methods": [ - "updateInstanceConfig" - ] - }, - "CreateInstance": { - "methods": [ - "createInstance" - ] - }, - "UpdateInstance": { - "methods": [ - "updateInstance" - ] - }, - "CreateInstancePartition": { - "methods": [ - "createInstancePartition" - ] - }, - "UpdateInstancePartition": { - "methods": [ - "updateInstancePartition" - ] - }, - "MoveInstance": { - "methods": [ - "moveInstance" - ] - }, - "ListInstanceConfigs": { - "methods": [ - "listInstanceConfigs", - "listInstanceConfigsStream", - "listInstanceConfigsAsync" - ] - }, - "ListInstanceConfigOperations": { - "methods": [ - "listInstanceConfigOperations", - "listInstanceConfigOperationsStream", - "listInstanceConfigOperationsAsync" - ] - }, - "ListInstances": { - "methods": [ - "listInstances", - "listInstancesStream", - "listInstancesAsync" - ] - }, - "ListInstancePartitions": { - "methods": [ - "listInstancePartitions", - "listInstancePartitionsStream", - "listInstancePartitionsAsync" - ] - }, - "ListInstancePartitionOperations": { - "methods": [ - "listInstancePartitionOperations", - "listInstancePartitionOperationsStream", - "listInstancePartitionOperationsAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "InstanceAdminClient", - "rpcs": { - "GetInstanceConfig": { - "methods": [ - "getInstanceConfig" - ] - }, - "DeleteInstanceConfig": { - "methods": [ - "deleteInstanceConfig" - ] - }, - "GetInstance": { - "methods": [ - "getInstance" - ] - }, - "DeleteInstance": { - "methods": [ - "deleteInstance" - ] - }, - "SetIamPolicy": { - "methods": [ - "setIamPolicy" - ] - }, - "GetIamPolicy": { - "methods": [ - "getIamPolicy" - ] - }, - "TestIamPermissions": { - "methods": [ - "testIamPermissions" - ] - }, - "GetInstancePartition": { - "methods": [ - "getInstancePartition" - ] - }, - "DeleteInstancePartition": { - "methods": [ - "deleteInstancePartition" - ] - }, - "CreateInstanceConfig": { - "methods": [ - "createInstanceConfig" - ] - }, - "UpdateInstanceConfig": { - "methods": [ - "updateInstanceConfig" - ] - }, - "CreateInstance": { - "methods": [ - "createInstance" - ] - }, - "UpdateInstance": { - "methods": [ - "updateInstance" - ] - }, - "CreateInstancePartition": { - "methods": [ - "createInstancePartition" - ] - }, - "UpdateInstancePartition": { - "methods": [ - "updateInstancePartition" - ] - }, - "MoveInstance": { - "methods": [ - "moveInstance" - ] - }, - "ListInstanceConfigs": { - "methods": [ - "listInstanceConfigs", - "listInstanceConfigsStream", - "listInstanceConfigsAsync" - ] - }, - "ListInstanceConfigOperations": { - "methods": [ - "listInstanceConfigOperations", - "listInstanceConfigOperationsStream", - "listInstanceConfigOperationsAsync" - ] - }, - "ListInstances": { - "methods": [ - "listInstances", - "listInstancesStream", - "listInstancesAsync" - ] - }, - "ListInstancePartitions": { - "methods": [ - "listInstancePartitions", - "listInstancePartitionsStream", - "listInstancePartitionsAsync" - ] - }, - "ListInstancePartitionOperations": { - "methods": [ - "listInstancePartitionOperations", - "listInstancePartitionOperationsStream", - "listInstancePartitionOperationsAsync" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/admin/instance/v1/src/v1/index.ts b/owl-bot-staging/admin/instance/v1/src/v1/index.ts deleted file mode 100644 index 2ec13d59f..000000000 --- a/owl-bot-staging/admin/instance/v1/src/v1/index.ts +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -export {InstanceAdminClient} from './instance_admin_client'; diff --git a/owl-bot-staging/admin/instance/v1/src/v1/instance_admin_client.ts b/owl-bot-staging/admin/instance/v1/src/v1/instance_admin_client.ts deleted file mode 100644 index 9803a71f5..000000000 --- a/owl-bot-staging/admin/instance/v1/src/v1/instance_admin_client.ts +++ /dev/null @@ -1,4289 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -/* global window */ -import type * as gax from 'google-gax'; -import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall} from 'google-gax'; -import {Transform} from 'stream'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; - -/** - * Client JSON configuration object, loaded from - * `src/v1/instance_admin_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './instance_admin_client_config.json'; -const version = require('../../../package.json').version; - -/** - * Cloud Spanner Instance Admin API - * - * The Cloud Spanner Instance Admin API can be used to create, delete, - * modify and list instances. Instances are dedicated Cloud Spanner serving - * and storage resources to be used by Cloud Spanner databases. - * - * Each instance has a "configuration", which dictates where the - * serving resources for the Cloud Spanner instance are located (e.g., - * US-central, Europe). Configurations are created by Google based on - * resource availability. - * - * Cloud Spanner billing is based on the instances that exist and their - * sizes. After an instance exists, there are no additional - * per-database or per-operation charges for use of the instance - * (though there may be additional network bandwidth charges). - * Instances offer isolation: problems with databases in one instance - * will not affect other instances. However, within an instance - * databases can affect each other. For example, if one database in an - * instance receives a lot of requests and consumes most of the - * instance resources, fewer resources are available for other - * databases in that instance, and their performance may suffer. - * @class - * @memberof v1 - */ -export class InstanceAdminClient { - private _terminated = false; - private _opts: ClientOptions; - private _providedCustomServicePath: boolean; - private _gaxModule: typeof gax | typeof gax.fallback; - private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; - private _protos: {}; - private _defaults: {[method: string]: gax.CallSettings}; - private _universeDomain: string; - private _servicePath: string; - private _log = logging.log('spanner'); - - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - pathTemplates: {[name: string]: gax.PathTemplate}; - operationsClient: gax.OperationsClient; - instanceAdminStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of InstanceAdminClient. - * - * @param {object} [options] - The configuration object. - * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). - * The common options are: - * @param {object} [options.credentials] - Credentials object. - * @param {string} [options.credentials.client_email] - * @param {string} [options.credentials.private_key] - * @param {string} [options.email] - Account email address. Required when - * using a .pem or .p12 keyFilename. - * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or - * .p12 key downloaded from the Google Developers Console. If you provide - * a path to a JSON file, the projectId option below is not necessary. - * NOTE: .pem and .p12 require you to specify options.email as well. - * @param {number} [options.port] - The port on which to connect to - * the remote host. - * @param {string} [options.projectId] - The project ID from the Google - * Developer's Console, e.g. 'grape-spaceship-123'. We will also check - * the environment variable GCLOUD_PROJECT for your project ID. If your - * app is running in an environment which supports - * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. - * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. - * For more information, please check the - * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. - * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you - * need to avoid loading the default gRPC version and want to use the fallback - * HTTP implementation. Load only fallback version and pass it to the constructor: - * ``` - * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new InstanceAdminClient({fallback: true}, gax); - * ``` - */ - constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { - // Ensure that options include all the required fields. - const staticMembers = this.constructor as typeof InstanceAdminClient; - if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { - throw new Error('Please set either universe_domain or universeDomain, but not both.'); - } - const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; - this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; - this._servicePath = 'spanner.' + this._universeDomain; - const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; - this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); - const port = opts?.port || staticMembers.port; - const clientConfig = opts?.clientConfig ?? {}; - const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); - opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); - - // Request numeric enum values if REST transport is used. - opts.numericEnums = true; - - // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. - if (servicePath !== this._servicePath && !('scopes' in opts)) { - opts['scopes'] = staticMembers.scopes; - } - - // Load google-gax module synchronously if needed - if (!gaxInstance) { - gaxInstance = require('google-gax') as typeof gax; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; - - // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. - this._gaxGrpc = new this._gaxModule.GrpcClient(opts); - - // Save options to use in initialize() method. - this._opts = opts; - - // Save the auth object to the client, for use by other methods. - this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); - - // Set useJWTAccessWithScope on the auth object. - this.auth.useJWTAccessWithScope = true; - - // Set defaultServicePath on the auth object. - this.auth.defaultServicePath = this._servicePath; - - // Set the default scopes in auth client if needed. - if (servicePath === this._servicePath) { - this.auth.defaultScopes = staticMembers.scopes; - } - - // Determine the client header string. - const clientHeader = [ - `gax/${this._gaxModule.version}`, - `gapic/${version}`, - ]; - if (typeof process === 'object' && 'versions' in process) { - clientHeader.push(`gl-node/${process.versions.node}`); - } else { - clientHeader.push(`gl-web/${this._gaxModule.version}`); - } - if (!opts.fallback) { - clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else { - clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); - } - if (opts.libName && opts.libVersion) { - clientHeader.push(`${opts.libName}/${opts.libVersion}`); - } - // Load the applicable protos. - this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); - - // This API contains "path templates"; forward-slash-separated - // identifiers to uniquely identify resources within the API. - // Create useful helper objects for these. - this.pathTemplates = { - instancePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/instances/{instance}' - ), - instanceConfigPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/instanceConfigs/{instance_config}' - ), - instancePartitionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/instances/{instance}/instancePartitions/{instance_partition}' - ), - projectPathTemplate: new this._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 = { - listInstanceConfigs: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'instanceConfigs'), - listInstanceConfigOperations: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'operations'), - listInstances: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'instances'), - listInstancePartitions: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'instancePartitions'), - listInstancePartitionOperations: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'operations') - }; - - const protoFilesRoot = this._gaxModule.protobufFromJSON(jsonProtos); - // This API contains "long-running operations", which return a - // an Operation object that allows for tracking of the operation, - // rather than holding a request open. - const lroOptions: GrpcClientOptions = { - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined - }; - if (opts.fallback) { - lroOptions.protoJson = protoFilesRoot; - lroOptions.httpRules = [{selector: 'google.longrunning.Operations.CancelOperation',post: '/v1/{name=projects/*/instances/*/databases/*/operations/*}:cancel',additional_bindings: [{post: '/v1/{name=projects/*/instances/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/instances/*/backups/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/instances/*/instancePartitions/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/instanceConfigs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/instanceConfigs/*/ssdCaches/*/operations/*}:cancel',}], - },{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/v1/{name=projects/*/instances/*/databases/*/operations/*}',additional_bindings: [{delete: '/v1/{name=projects/*/instances/*/operations/*}',},{delete: '/v1/{name=projects/*/instances/*/backups/*/operations/*}',},{delete: '/v1/{name=projects/*/instances/*/instancePartitions/*/operations/*}',},{delete: '/v1/{name=projects/*/instanceConfigs/*/operations/*}',},{delete: '/v1/{name=projects/*/instanceConfigs/*/ssdCaches/*/operations/*}',}], - },{selector: 'google.longrunning.Operations.GetOperation',get: '/v1/{name=projects/*/instances/*/databases/*/operations/*}',additional_bindings: [{get: '/v1/{name=projects/*/instances/*/operations/*}',},{get: '/v1/{name=projects/*/instances/*/backups/*/operations/*}',},{get: '/v1/{name=projects/*/instances/*/instancePartitions/*/operations/*}',},{get: '/v1/{name=projects/*/instanceConfigs/*/operations/*}',},{get: '/v1/{name=projects/*/instanceConfigs/*/ssdCaches/*/operations/*}',}], - },{selector: 'google.longrunning.Operations.ListOperations',get: '/v1/{name=projects/*/instances/*/databases/*/operations}',additional_bindings: [{get: '/v1/{name=projects/*/instances/*/operations}',},{get: '/v1/{name=projects/*/instances/*/backups/*/operations}',},{get: '/v1/{name=projects/*/instances/*/instancePartitions/*/operations}',},{get: '/v1/{name=projects/*/instanceConfigs/*/operations}',},{get: '/v1/{name=projects/*/instanceConfigs/*/ssdCaches/*/operations}',}], - }]; - } - this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); - const createInstanceConfigResponse = protoFilesRoot.lookup( - '.google.spanner.admin.instance.v1.InstanceConfig') as gax.protobuf.Type; - const createInstanceConfigMetadata = protoFilesRoot.lookup( - '.google.spanner.admin.instance.v1.CreateInstanceConfigMetadata') as gax.protobuf.Type; - const updateInstanceConfigResponse = protoFilesRoot.lookup( - '.google.spanner.admin.instance.v1.InstanceConfig') as gax.protobuf.Type; - const updateInstanceConfigMetadata = protoFilesRoot.lookup( - '.google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata') as gax.protobuf.Type; - const createInstanceResponse = protoFilesRoot.lookup( - '.google.spanner.admin.instance.v1.Instance') as gax.protobuf.Type; - const createInstanceMetadata = protoFilesRoot.lookup( - '.google.spanner.admin.instance.v1.CreateInstanceMetadata') as gax.protobuf.Type; - const updateInstanceResponse = protoFilesRoot.lookup( - '.google.spanner.admin.instance.v1.Instance') as gax.protobuf.Type; - const updateInstanceMetadata = protoFilesRoot.lookup( - '.google.spanner.admin.instance.v1.UpdateInstanceMetadata') as gax.protobuf.Type; - const createInstancePartitionResponse = protoFilesRoot.lookup( - '.google.spanner.admin.instance.v1.InstancePartition') as gax.protobuf.Type; - const createInstancePartitionMetadata = protoFilesRoot.lookup( - '.google.spanner.admin.instance.v1.CreateInstancePartitionMetadata') as gax.protobuf.Type; - const updateInstancePartitionResponse = protoFilesRoot.lookup( - '.google.spanner.admin.instance.v1.InstancePartition') as gax.protobuf.Type; - const updateInstancePartitionMetadata = protoFilesRoot.lookup( - '.google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata') as gax.protobuf.Type; - const moveInstanceResponse = protoFilesRoot.lookup( - '.google.spanner.admin.instance.v1.MoveInstanceResponse') as gax.protobuf.Type; - const moveInstanceMetadata = protoFilesRoot.lookup( - '.google.spanner.admin.instance.v1.MoveInstanceMetadata') as gax.protobuf.Type; - - this.descriptors.longrunning = { - createInstanceConfig: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - createInstanceConfigResponse.decode.bind(createInstanceConfigResponse), - createInstanceConfigMetadata.decode.bind(createInstanceConfigMetadata)), - updateInstanceConfig: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - updateInstanceConfigResponse.decode.bind(updateInstanceConfigResponse), - updateInstanceConfigMetadata.decode.bind(updateInstanceConfigMetadata)), - createInstance: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - createInstanceResponse.decode.bind(createInstanceResponse), - createInstanceMetadata.decode.bind(createInstanceMetadata)), - updateInstance: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - updateInstanceResponse.decode.bind(updateInstanceResponse), - updateInstanceMetadata.decode.bind(updateInstanceMetadata)), - createInstancePartition: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - createInstancePartitionResponse.decode.bind(createInstancePartitionResponse), - createInstancePartitionMetadata.decode.bind(createInstancePartitionMetadata)), - updateInstancePartition: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - updateInstancePartitionResponse.decode.bind(updateInstancePartitionResponse), - updateInstancePartitionMetadata.decode.bind(updateInstancePartitionMetadata)), - moveInstance: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - moveInstanceResponse.decode.bind(moveInstanceResponse), - moveInstanceMetadata.decode.bind(moveInstanceMetadata)) - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.spanner.admin.instance.v1.InstanceAdmin', gapicConfig as gax.ClientConfig, - opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); - - // Set up a dictionary of "inner API calls"; the core implementation - // of calling the API is handled in `google-gax`, with this code - // merely providing the destination and request information. - this.innerApiCalls = {}; - - // Add a warn function to the client constructor so it can be easily tested. - this.warn = this._gaxModule.warn; - } - - /** - * Initialize the client. - * Performs asynchronous operations (such as authentication) and prepares the client. - * This function will be called automatically when any class method is called for the - * first time, but if you need to initialize it before calling an actual method, - * feel free to call initialize() directly. - * - * You can await on this method if you want to make sure the client is initialized. - * - * @returns {Promise} A promise that resolves to an authenticated service stub. - */ - initialize() { - // If the client stub promise is already initialized, return immediately. - if (this.instanceAdminStub) { - return this.instanceAdminStub; - } - - // Put together the "service stub" for - // google.spanner.admin.instance.v1.InstanceAdmin. - this.instanceAdminStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.spanner.admin.instance.v1.InstanceAdmin') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.spanner.admin.instance.v1.InstanceAdmin, - this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; - - // Iterate over each of the methods that the service provides - // and create an API call method for each. - const instanceAdminStubMethods = - ['listInstanceConfigs', 'getInstanceConfig', 'createInstanceConfig', 'updateInstanceConfig', 'deleteInstanceConfig', 'listInstanceConfigOperations', 'listInstances', 'listInstancePartitions', 'getInstance', 'createInstance', 'updateInstance', 'deleteInstance', 'setIamPolicy', 'getIamPolicy', 'testIamPermissions', 'getInstancePartition', 'createInstancePartition', 'deleteInstancePartition', 'updateInstancePartition', 'listInstancePartitionOperations', 'moveInstance']; - for (const methodName of instanceAdminStubMethods) { - const callPromise = this.instanceAdminStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, - (err: Error|null|undefined) => () => { - throw err; - }); - - const descriptor = - this.descriptors.page[methodName] || - this.descriptors.longrunning[methodName] || - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor, - this._opts.fallback - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.instanceAdminStub; - } - - /** - * The DNS address for this API service. - * @deprecated Use the apiEndpoint method of the client instance. - * @returns {string} The DNS address for this service. - */ - static get servicePath() { - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); - } - return 'spanner.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath. - * @deprecated Use the apiEndpoint method of the client instance. - * @returns {string} The DNS address for this service. - */ - static get apiEndpoint() { - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); - } - return 'spanner.googleapis.com'; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - get apiEndpoint() { - return this._servicePath; - } - - get universeDomain() { - return this._universeDomain; - } - - /** - * The port for this API service. - * @returns {number} The default port for this service. - */ - static get port() { - return 443; - } - - /** - * The scopes needed to make gRPC calls for every method defined - * in this service. - * @returns {string[]} List of default scopes. - */ - static get scopes() { - return [ - 'https://www.googleapis.com/auth/cloud-platform', - 'https://www.googleapis.com/auth/spanner.admin' - ]; - } - - getProjectId(): Promise; - getProjectId(callback: Callback): void; - /** - * Return the project ID used by this class. - * @returns {Promise} A promise that resolves to string containing the project ID. - */ - getProjectId(callback?: Callback): - Promise|void { - if (callback) { - this.auth.getProjectId(callback); - return; - } - return this.auth.getProjectId(); - } - - // ------------------- - // -- Service calls -- - // ------------------- -/** - * Gets information about a particular instance configuration. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the requested instance configuration. Values are of - * the form `projects//instanceConfigs/`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.spanner.admin.instance.v1.InstanceConfig|InstanceConfig}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - */ - getInstanceConfig( - request?: protos.google.spanner.admin.instance.v1.IGetInstanceConfigRequest, - options?: CallOptions): - Promise<[ - protos.google.spanner.admin.instance.v1.IInstanceConfig, - protos.google.spanner.admin.instance.v1.IGetInstanceConfigRequest|undefined, {}|undefined - ]>; - getInstanceConfig( - request: protos.google.spanner.admin.instance.v1.IGetInstanceConfigRequest, - options: CallOptions, - callback: Callback< - protos.google.spanner.admin.instance.v1.IInstanceConfig, - protos.google.spanner.admin.instance.v1.IGetInstanceConfigRequest|null|undefined, - {}|null|undefined>): void; - getInstanceConfig( - request: protos.google.spanner.admin.instance.v1.IGetInstanceConfigRequest, - callback: Callback< - protos.google.spanner.admin.instance.v1.IInstanceConfig, - protos.google.spanner.admin.instance.v1.IGetInstanceConfigRequest|null|undefined, - {}|null|undefined>): void; - getInstanceConfig( - request?: protos.google.spanner.admin.instance.v1.IGetInstanceConfigRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.spanner.admin.instance.v1.IInstanceConfig, - protos.google.spanner.admin.instance.v1.IGetInstanceConfigRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.spanner.admin.instance.v1.IInstanceConfig, - protos.google.spanner.admin.instance.v1.IGetInstanceConfigRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.spanner.admin.instance.v1.IInstanceConfig, - protos.google.spanner.admin.instance.v1.IGetInstanceConfigRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('getInstanceConfig request %j', request); - const wrappedCallback: Callback< - protos.google.spanner.admin.instance.v1.IInstanceConfig, - protos.google.spanner.admin.instance.v1.IGetInstanceConfigRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getInstanceConfig response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getInstanceConfig(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.spanner.admin.instance.v1.IInstanceConfig, - protos.google.spanner.admin.instance.v1.IGetInstanceConfigRequest|undefined, - {}|undefined - ]) => { - this._log.info('getInstanceConfig response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Deletes the instance configuration. Deletion is only allowed when no - * instances are using the configuration. If any instances are using - * the configuration, returns `FAILED_PRECONDITION`. - * - * Only user-managed configurations can be deleted. - * - * Authorization requires `spanner.instanceConfigs.delete` permission on - * the resource {@link protos.google.spanner.admin.instance.v1.InstanceConfig.name|name}. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the instance configuration to be deleted. - * Values are of the form - * `projects//instanceConfigs/` - * @param {string} request.etag - * Used for optimistic concurrency control as a way to help prevent - * simultaneous deletes of an instance configuration from overwriting each - * other. If not empty, the API - * only deletes the instance configuration when the etag provided matches the - * current status of the requested instance configuration. Otherwise, deletes - * the instance configuration without checking the current status of the - * requested instance configuration. - * @param {boolean} request.validateOnly - * An option to validate, but not actually execute, a request, - * and provide the same response. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - */ - deleteInstanceConfig( - request?: protos.google.spanner.admin.instance.v1.IDeleteInstanceConfigRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.spanner.admin.instance.v1.IDeleteInstanceConfigRequest|undefined, {}|undefined - ]>; - deleteInstanceConfig( - request: protos.google.spanner.admin.instance.v1.IDeleteInstanceConfigRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.spanner.admin.instance.v1.IDeleteInstanceConfigRequest|null|undefined, - {}|null|undefined>): void; - deleteInstanceConfig( - request: protos.google.spanner.admin.instance.v1.IDeleteInstanceConfigRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.spanner.admin.instance.v1.IDeleteInstanceConfigRequest|null|undefined, - {}|null|undefined>): void; - deleteInstanceConfig( - request?: protos.google.spanner.admin.instance.v1.IDeleteInstanceConfigRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.spanner.admin.instance.v1.IDeleteInstanceConfigRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.spanner.admin.instance.v1.IDeleteInstanceConfigRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.spanner.admin.instance.v1.IDeleteInstanceConfigRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('deleteInstanceConfig request %j', request); - const wrappedCallback: Callback< - protos.google.protobuf.IEmpty, - protos.google.spanner.admin.instance.v1.IDeleteInstanceConfigRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('deleteInstanceConfig response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.deleteInstanceConfig(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.protobuf.IEmpty, - protos.google.spanner.admin.instance.v1.IDeleteInstanceConfigRequest|undefined, - {}|undefined - ]) => { - this._log.info('deleteInstanceConfig response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Gets information about a particular instance. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the requested instance. Values are of the form - * `projects//instances/`. - * @param {google.protobuf.FieldMask} request.fieldMask - * If field_mask is present, specifies the subset of - * {@link protos.google.spanner.admin.instance.v1.Instance|Instance} fields that should be - * returned. If absent, all - * {@link protos.google.spanner.admin.instance.v1.Instance|Instance} fields are returned. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.spanner.admin.instance.v1.Instance|Instance}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - */ - getInstance( - request?: protos.google.spanner.admin.instance.v1.IGetInstanceRequest, - options?: CallOptions): - Promise<[ - protos.google.spanner.admin.instance.v1.IInstance, - protos.google.spanner.admin.instance.v1.IGetInstanceRequest|undefined, {}|undefined - ]>; - getInstance( - request: protos.google.spanner.admin.instance.v1.IGetInstanceRequest, - options: CallOptions, - callback: Callback< - protos.google.spanner.admin.instance.v1.IInstance, - protos.google.spanner.admin.instance.v1.IGetInstanceRequest|null|undefined, - {}|null|undefined>): void; - getInstance( - request: protos.google.spanner.admin.instance.v1.IGetInstanceRequest, - callback: Callback< - protos.google.spanner.admin.instance.v1.IInstance, - protos.google.spanner.admin.instance.v1.IGetInstanceRequest|null|undefined, - {}|null|undefined>): void; - getInstance( - request?: protos.google.spanner.admin.instance.v1.IGetInstanceRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.spanner.admin.instance.v1.IInstance, - protos.google.spanner.admin.instance.v1.IGetInstanceRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.spanner.admin.instance.v1.IInstance, - protos.google.spanner.admin.instance.v1.IGetInstanceRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.spanner.admin.instance.v1.IInstance, - protos.google.spanner.admin.instance.v1.IGetInstanceRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('getInstance request %j', request); - const wrappedCallback: Callback< - protos.google.spanner.admin.instance.v1.IInstance, - protos.google.spanner.admin.instance.v1.IGetInstanceRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getInstance response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getInstance(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.spanner.admin.instance.v1.IInstance, - protos.google.spanner.admin.instance.v1.IGetInstanceRequest|undefined, - {}|undefined - ]) => { - this._log.info('getInstance response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Deletes an instance. - * - * Immediately upon completion of the request: - * - * * Billing ceases for all of the instance's reserved resources. - * - * Soon afterward: - * - * * The instance and *all of its databases* immediately and - * irrevocably disappear from the API. All data in the databases - * is permanently deleted. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the instance to be deleted. Values are of the form - * `projects//instances/` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - */ - deleteInstance( - request?: protos.google.spanner.admin.instance.v1.IDeleteInstanceRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.spanner.admin.instance.v1.IDeleteInstanceRequest|undefined, {}|undefined - ]>; - deleteInstance( - request: protos.google.spanner.admin.instance.v1.IDeleteInstanceRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.spanner.admin.instance.v1.IDeleteInstanceRequest|null|undefined, - {}|null|undefined>): void; - deleteInstance( - request: protos.google.spanner.admin.instance.v1.IDeleteInstanceRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.spanner.admin.instance.v1.IDeleteInstanceRequest|null|undefined, - {}|null|undefined>): void; - deleteInstance( - request?: protos.google.spanner.admin.instance.v1.IDeleteInstanceRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.spanner.admin.instance.v1.IDeleteInstanceRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.spanner.admin.instance.v1.IDeleteInstanceRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.spanner.admin.instance.v1.IDeleteInstanceRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('deleteInstance request %j', request); - const wrappedCallback: Callback< - protos.google.protobuf.IEmpty, - protos.google.spanner.admin.instance.v1.IDeleteInstanceRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('deleteInstance response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.deleteInstance(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.protobuf.IEmpty, - protos.google.spanner.admin.instance.v1.IDeleteInstanceRequest|undefined, - {}|undefined - ]) => { - this._log.info('deleteInstance response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Sets the access control policy on an instance resource. Replaces any - * existing policy. - * - * Authorization requires `spanner.instances.setIamPolicy` on - * {@link protos.google.iam.v1.SetIamPolicyRequest.resource|resource}. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy is being specified. - * See the operation documentation for the appropriate value for this field. - * @param {google.iam.v1.Policy} request.policy - * REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a - * valid policy but certain Cloud Platform services (such as Projects) - * might reject them. - * @param {google.protobuf.FieldMask} request.updateMask - * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - * the fields in the mask will be modified. If no mask is provided, the - * following default mask is used: - * - * `paths: "bindings, etag"` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.iam.v1.Policy|Policy}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - */ - setIamPolicy( - request?: protos.google.iam.v1.ISetIamPolicyRequest, - options?: CallOptions): - Promise<[ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|undefined, {}|undefined - ]>; - setIamPolicy( - request: protos.google.iam.v1.ISetIamPolicyRequest, - options: CallOptions, - callback: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, - {}|null|undefined>): void; - setIamPolicy( - request: protos.google.iam.v1.ISetIamPolicyRequest, - callback: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, - {}|null|undefined>): void; - setIamPolicy( - request?: protos.google.iam.v1.ISetIamPolicyRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'resource': request.resource ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('setIamPolicy request %j', request); - const wrappedCallback: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('setIamPolicy response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.setIamPolicy(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|undefined, - {}|undefined - ]) => { - this._log.info('setIamPolicy response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Gets the access control policy for an instance resource. Returns an empty - * policy if an instance exists but does not have a policy set. - * - * Authorization requires `spanner.instances.getIamPolicy` on - * {@link protos.google.iam.v1.GetIamPolicyRequest.resource|resource}. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {google.iam.v1.GetPolicyOptions} request.options - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.iam.v1.Policy|Policy}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - */ - getIamPolicy( - request?: protos.google.iam.v1.IGetIamPolicyRequest, - options?: CallOptions): - Promise<[ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|undefined, {}|undefined - ]>; - getIamPolicy( - request: protos.google.iam.v1.IGetIamPolicyRequest, - options: CallOptions, - callback: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, - {}|null|undefined>): void; - getIamPolicy( - request: protos.google.iam.v1.IGetIamPolicyRequest, - callback: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, - {}|null|undefined>): void; - getIamPolicy( - request?: protos.google.iam.v1.IGetIamPolicyRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'resource': request.resource ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('getIamPolicy request %j', request); - const wrappedCallback: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getIamPolicy response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getIamPolicy(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|undefined, - {}|undefined - ]) => { - this._log.info('getIamPolicy response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Returns permissions that the caller has on the specified instance resource. - * - * Attempting this RPC on a non-existent Cloud Spanner instance resource will - * result in a NOT_FOUND error if the user has `spanner.instances.list` - * permission on the containing Google Cloud Project. Otherwise returns an - * empty set of permissions. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.iam.v1.TestIamPermissionsResponse|TestIamPermissionsResponse}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - */ - testIamPermissions( - request?: protos.google.iam.v1.ITestIamPermissionsRequest, - options?: CallOptions): - Promise<[ - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|undefined, {}|undefined - ]>; - testIamPermissions( - request: protos.google.iam.v1.ITestIamPermissionsRequest, - options: CallOptions, - callback: Callback< - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, - {}|null|undefined>): void; - testIamPermissions( - request: protos.google.iam.v1.ITestIamPermissionsRequest, - callback: Callback< - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, - {}|null|undefined>): void; - testIamPermissions( - request?: protos.google.iam.v1.ITestIamPermissionsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'resource': request.resource ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('testIamPermissions request %j', request); - const wrappedCallback: Callback< - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('testIamPermissions response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.testIamPermissions(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|undefined, - {}|undefined - ]) => { - this._log.info('testIamPermissions response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Gets information about a particular instance partition. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the requested instance partition. Values are of - * the form - * `projects/{project}/instances/{instance}/instancePartitions/{instance_partition}`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.spanner.admin.instance.v1.InstancePartition|InstancePartition}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - */ - getInstancePartition( - request?: protos.google.spanner.admin.instance.v1.IGetInstancePartitionRequest, - options?: CallOptions): - Promise<[ - protos.google.spanner.admin.instance.v1.IInstancePartition, - protos.google.spanner.admin.instance.v1.IGetInstancePartitionRequest|undefined, {}|undefined - ]>; - getInstancePartition( - request: protos.google.spanner.admin.instance.v1.IGetInstancePartitionRequest, - options: CallOptions, - callback: Callback< - protos.google.spanner.admin.instance.v1.IInstancePartition, - protos.google.spanner.admin.instance.v1.IGetInstancePartitionRequest|null|undefined, - {}|null|undefined>): void; - getInstancePartition( - request: protos.google.spanner.admin.instance.v1.IGetInstancePartitionRequest, - callback: Callback< - protos.google.spanner.admin.instance.v1.IInstancePartition, - protos.google.spanner.admin.instance.v1.IGetInstancePartitionRequest|null|undefined, - {}|null|undefined>): void; - getInstancePartition( - request?: protos.google.spanner.admin.instance.v1.IGetInstancePartitionRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.spanner.admin.instance.v1.IInstancePartition, - protos.google.spanner.admin.instance.v1.IGetInstancePartitionRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.spanner.admin.instance.v1.IInstancePartition, - protos.google.spanner.admin.instance.v1.IGetInstancePartitionRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.spanner.admin.instance.v1.IInstancePartition, - protos.google.spanner.admin.instance.v1.IGetInstancePartitionRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('getInstancePartition request %j', request); - const wrappedCallback: Callback< - protos.google.spanner.admin.instance.v1.IInstancePartition, - protos.google.spanner.admin.instance.v1.IGetInstancePartitionRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getInstancePartition response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getInstancePartition(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.spanner.admin.instance.v1.IInstancePartition, - protos.google.spanner.admin.instance.v1.IGetInstancePartitionRequest|undefined, - {}|undefined - ]) => { - this._log.info('getInstancePartition response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Deletes an existing instance partition. Requires that the - * instance partition is not used by any database or backup and is not the - * default instance partition of an instance. - * - * Authorization requires `spanner.instancePartitions.delete` permission on - * the resource - * {@link protos.google.spanner.admin.instance.v1.InstancePartition.name|name}. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the instance partition to be deleted. - * Values are of the form - * `projects/{project}/instances/{instance}/instancePartitions/{instance_partition}` - * @param {string} request.etag - * Optional. If not empty, the API only deletes the instance partition when - * the etag provided matches the current status of the requested instance - * partition. Otherwise, deletes the instance partition without checking the - * current status of the requested instance partition. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - */ - deleteInstancePartition( - request?: protos.google.spanner.admin.instance.v1.IDeleteInstancePartitionRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.spanner.admin.instance.v1.IDeleteInstancePartitionRequest|undefined, {}|undefined - ]>; - deleteInstancePartition( - request: protos.google.spanner.admin.instance.v1.IDeleteInstancePartitionRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.spanner.admin.instance.v1.IDeleteInstancePartitionRequest|null|undefined, - {}|null|undefined>): void; - deleteInstancePartition( - request: protos.google.spanner.admin.instance.v1.IDeleteInstancePartitionRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.spanner.admin.instance.v1.IDeleteInstancePartitionRequest|null|undefined, - {}|null|undefined>): void; - deleteInstancePartition( - request?: protos.google.spanner.admin.instance.v1.IDeleteInstancePartitionRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.spanner.admin.instance.v1.IDeleteInstancePartitionRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.spanner.admin.instance.v1.IDeleteInstancePartitionRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.spanner.admin.instance.v1.IDeleteInstancePartitionRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('deleteInstancePartition request %j', request); - const wrappedCallback: Callback< - protos.google.protobuf.IEmpty, - protos.google.spanner.admin.instance.v1.IDeleteInstancePartitionRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('deleteInstancePartition response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.deleteInstancePartition(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.protobuf.IEmpty, - protos.google.spanner.admin.instance.v1.IDeleteInstancePartitionRequest|undefined, - {}|undefined - ]) => { - this._log.info('deleteInstancePartition response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } - -/** - * Creates an instance configuration and begins preparing it to be used. The - * returned long-running operation - * can be used to track the progress of preparing the new - * instance configuration. The instance configuration name is assigned by the - * caller. If the named instance configuration already exists, - * `CreateInstanceConfig` returns `ALREADY_EXISTS`. - * - * Immediately after the request returns: - * - * * The instance configuration is readable via the API, with all requested - * attributes. The instance configuration's - * {@link protos.google.spanner.admin.instance.v1.InstanceConfig.reconciling|reconciling} - * field is set to true. Its state is `CREATING`. - * - * While the operation is pending: - * - * * Cancelling the operation renders the instance configuration immediately - * unreadable via the API. - * * Except for deleting the creating resource, all other attempts to modify - * the instance configuration are rejected. - * - * Upon completion of the returned operation: - * - * * Instances can be created using the instance configuration. - * * The instance configuration's - * {@link protos.google.spanner.admin.instance.v1.InstanceConfig.reconciling|reconciling} - * field becomes false. Its state becomes `READY`. - * - * The returned long-running operation will - * have a name of the format - * `/operations/` and can be used to track - * creation of the instance configuration. The - * metadata field type is - * {@link protos.google.spanner.admin.instance.v1.CreateInstanceConfigMetadata|CreateInstanceConfigMetadata}. - * The response field type is - * {@link protos.google.spanner.admin.instance.v1.InstanceConfig|InstanceConfig}, if - * successful. - * - * Authorization requires `spanner.instanceConfigs.create` permission on - * the resource - * {@link protos.google.spanner.admin.instance.v1.CreateInstanceConfigRequest.parent|parent}. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the project in which to create the instance - * configuration. Values are of the form `projects/`. - * @param {string} request.instanceConfigId - * Required. The ID of the instance configuration to create. Valid identifiers - * are of the form `custom-[-a-z0-9]*[a-z0-9]` and must be between 2 and 64 - * characters in length. The `custom-` prefix is required to avoid name - * conflicts with Google-managed configurations. - * @param {google.spanner.admin.instance.v1.InstanceConfig} request.instanceConfig - * Required. The `InstanceConfig` proto of the configuration to create. - * `instance_config.name` must be - * `/instanceConfigs/`. - * `instance_config.base_config` must be a Google-managed configuration name, - * e.g. /instanceConfigs/us-east1, /instanceConfigs/nam3. - * @param {boolean} request.validateOnly - * An option to validate, but not actually execute, a request, - * and provide the same response. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - */ - createInstanceConfig( - request?: protos.google.spanner.admin.instance.v1.ICreateInstanceConfigRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - createInstanceConfig( - request: protos.google.spanner.admin.instance.v1.ICreateInstanceConfigRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createInstanceConfig( - request: protos.google.spanner.admin.instance.v1.ICreateInstanceConfigRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createInstanceConfig( - request?: protos.google.spanner.admin.instance.v1.ICreateInstanceConfigRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('createInstanceConfig response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('createInstanceConfig request %j', request); - return this.innerApiCalls.createInstanceConfig(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('createInstanceConfig response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `createInstanceConfig()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - */ - async checkCreateInstanceConfigProgress(name: string): Promise>{ - this._log.info('createInstanceConfig long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createInstanceConfig, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Updates an instance configuration. The returned - * long-running operation can be used to track - * the progress of updating the instance. If the named instance configuration - * does not exist, returns `NOT_FOUND`. - * - * Only user-managed configurations can be updated. - * - * Immediately after the request returns: - * - * * The instance configuration's - * {@link protos.google.spanner.admin.instance.v1.InstanceConfig.reconciling|reconciling} - * field is set to true. - * - * While the operation is pending: - * - * * Cancelling the operation sets its metadata's - * {@link protos.google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata.cancel_time|cancel_time}. - * The operation is guaranteed to succeed at undoing all changes, after - * which point it terminates with a `CANCELLED` status. - * * All other attempts to modify the instance configuration are rejected. - * * Reading the instance configuration via the API continues to give the - * pre-request values. - * - * Upon completion of the returned operation: - * - * * Creating instances using the instance configuration uses the new - * values. - * * The new values of the instance configuration are readable via the API. - * * The instance configuration's - * {@link protos.google.spanner.admin.instance.v1.InstanceConfig.reconciling|reconciling} - * field becomes false. - * - * The returned long-running operation will - * have a name of the format - * `/operations/` and can be used to track - * the instance configuration modification. The - * metadata field type is - * {@link protos.google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata|UpdateInstanceConfigMetadata}. - * The response field type is - * {@link protos.google.spanner.admin.instance.v1.InstanceConfig|InstanceConfig}, if - * successful. - * - * Authorization requires `spanner.instanceConfigs.update` permission on - * the resource {@link protos.google.spanner.admin.instance.v1.InstanceConfig.name|name}. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.spanner.admin.instance.v1.InstanceConfig} request.instanceConfig - * Required. The user instance configuration to update, which must always - * include the instance configuration name. Otherwise, only fields mentioned - * in - * {@link protos.google.spanner.admin.instance.v1.UpdateInstanceConfigRequest.update_mask|update_mask} - * need be included. To prevent conflicts of concurrent updates, - * {@link protos.google.spanner.admin.instance.v1.InstanceConfig.reconciling|etag} can - * be used. - * @param {google.protobuf.FieldMask} request.updateMask - * Required. A mask specifying which fields in - * {@link protos.google.spanner.admin.instance.v1.InstanceConfig|InstanceConfig} should be - * updated. The field mask must always be specified; this prevents any future - * fields in {@link protos.google.spanner.admin.instance.v1.InstanceConfig|InstanceConfig} - * from being erased accidentally by clients that do not know about them. Only - * display_name and labels can be updated. - * @param {boolean} request.validateOnly - * An option to validate, but not actually execute, a request, - * and provide the same response. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - */ - updateInstanceConfig( - request?: protos.google.spanner.admin.instance.v1.IUpdateInstanceConfigRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - updateInstanceConfig( - request: protos.google.spanner.admin.instance.v1.IUpdateInstanceConfigRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateInstanceConfig( - request: protos.google.spanner.admin.instance.v1.IUpdateInstanceConfigRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateInstanceConfig( - request?: protos.google.spanner.admin.instance.v1.IUpdateInstanceConfigRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'instance_config.name': request.instanceConfig!.name ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('updateInstanceConfig response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('updateInstanceConfig request %j', request); - return this.innerApiCalls.updateInstanceConfig(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('updateInstanceConfig response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `updateInstanceConfig()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - */ - async checkUpdateInstanceConfigProgress(name: string): Promise>{ - this._log.info('updateInstanceConfig long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateInstanceConfig, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Creates an instance and begins preparing it to begin serving. The - * returned long-running operation - * can be used to track the progress of preparing the new - * instance. The instance name is assigned by the caller. If the - * named instance already exists, `CreateInstance` returns - * `ALREADY_EXISTS`. - * - * Immediately upon completion of this request: - * - * * The instance is readable via the API, with all requested attributes - * but no allocated resources. Its state is `CREATING`. - * - * Until completion of the returned operation: - * - * * Cancelling the operation renders the instance immediately unreadable - * via the API. - * * The instance can be deleted. - * * All other attempts to modify the instance are rejected. - * - * Upon completion of the returned operation: - * - * * Billing for all successfully-allocated resources begins (some types - * may have lower than the requested levels). - * * Databases can be created in the instance. - * * The instance's allocated resource levels are readable via the API. - * * The instance's state becomes `READY`. - * - * The returned long-running operation will - * have a name of the format `/operations/` and - * can be used to track creation of the instance. The - * metadata field type is - * {@link protos.google.spanner.admin.instance.v1.CreateInstanceMetadata|CreateInstanceMetadata}. - * The response field type is - * {@link protos.google.spanner.admin.instance.v1.Instance|Instance}, if successful. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the project in which to create the instance. Values - * are of the form `projects/`. - * @param {string} request.instanceId - * Required. The ID of the instance to create. Valid identifiers are of the - * form `{@link protos.-a-z0-9|a-z}*[a-z0-9]` and must be between 2 and 64 characters in - * length. - * @param {google.spanner.admin.instance.v1.Instance} request.instance - * Required. The instance to create. The name may be omitted, but if - * specified must be `/instances/`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - */ - createInstance( - request?: protos.google.spanner.admin.instance.v1.ICreateInstanceRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - createInstance( - request: protos.google.spanner.admin.instance.v1.ICreateInstanceRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createInstance( - request: protos.google.spanner.admin.instance.v1.ICreateInstanceRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createInstance( - request?: protos.google.spanner.admin.instance.v1.ICreateInstanceRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('createInstance response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('createInstance request %j', request); - return this.innerApiCalls.createInstance(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('createInstance response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `createInstance()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - */ - async checkCreateInstanceProgress(name: string): Promise>{ - this._log.info('createInstance long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createInstance, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Updates an instance, and begins allocating or releasing resources - * as requested. The returned long-running operation can be used to track the - * progress of updating the instance. If the named instance does not - * exist, returns `NOT_FOUND`. - * - * Immediately upon completion of this request: - * - * * For resource types for which a decrease in the instance's allocation - * has been requested, billing is based on the newly-requested level. - * - * Until completion of the returned operation: - * - * * Cancelling the operation sets its metadata's - * {@link protos.google.spanner.admin.instance.v1.UpdateInstanceMetadata.cancel_time|cancel_time}, - * and begins restoring resources to their pre-request values. The - * operation is guaranteed to succeed at undoing all resource changes, - * after which point it terminates with a `CANCELLED` status. - * * All other attempts to modify the instance are rejected. - * * Reading the instance via the API continues to give the pre-request - * resource levels. - * - * Upon completion of the returned operation: - * - * * Billing begins for all successfully-allocated resources (some types - * may have lower than the requested levels). - * * All newly-reserved resources are available for serving the instance's - * tables. - * * The instance's new resource levels are readable via the API. - * - * The returned long-running operation will - * have a name of the format `/operations/` and - * can be used to track the instance modification. The - * metadata field type is - * {@link protos.google.spanner.admin.instance.v1.UpdateInstanceMetadata|UpdateInstanceMetadata}. - * The response field type is - * {@link protos.google.spanner.admin.instance.v1.Instance|Instance}, if successful. - * - * Authorization requires `spanner.instances.update` permission on - * the resource {@link protos.google.spanner.admin.instance.v1.Instance.name|name}. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.spanner.admin.instance.v1.Instance} request.instance - * Required. The instance to update, which must always include the instance - * name. Otherwise, only fields mentioned in - * {@link protos.google.spanner.admin.instance.v1.UpdateInstanceRequest.field_mask|field_mask} - * need be included. - * @param {google.protobuf.FieldMask} request.fieldMask - * Required. A mask specifying which fields in - * {@link protos.google.spanner.admin.instance.v1.Instance|Instance} should be updated. - * The field mask must always be specified; this prevents any future fields in - * {@link protos.google.spanner.admin.instance.v1.Instance|Instance} from being erased - * accidentally by clients that do not know about them. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - */ - updateInstance( - request?: protos.google.spanner.admin.instance.v1.IUpdateInstanceRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - updateInstance( - request: protos.google.spanner.admin.instance.v1.IUpdateInstanceRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateInstance( - request: protos.google.spanner.admin.instance.v1.IUpdateInstanceRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateInstance( - request?: protos.google.spanner.admin.instance.v1.IUpdateInstanceRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'instance.name': request.instance!.name ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('updateInstance response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('updateInstance request %j', request); - return this.innerApiCalls.updateInstance(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('updateInstance response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `updateInstance()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - */ - async checkUpdateInstanceProgress(name: string): Promise>{ - this._log.info('updateInstance long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateInstance, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Creates an instance partition and begins preparing it to be used. The - * returned long-running operation - * can be used to track the progress of preparing the new instance partition. - * The instance partition name is assigned by the caller. If the named - * instance partition already exists, `CreateInstancePartition` returns - * `ALREADY_EXISTS`. - * - * Immediately upon completion of this request: - * - * * The instance partition is readable via the API, with all requested - * attributes but no allocated resources. Its state is `CREATING`. - * - * Until completion of the returned operation: - * - * * Cancelling the operation renders the instance partition immediately - * unreadable via the API. - * * The instance partition can be deleted. - * * All other attempts to modify the instance partition are rejected. - * - * Upon completion of the returned operation: - * - * * Billing for all successfully-allocated resources begins (some types - * may have lower than the requested levels). - * * Databases can start using this instance partition. - * * The instance partition's allocated resource levels are readable via the - * API. - * * The instance partition's state becomes `READY`. - * - * The returned long-running operation will - * have a name of the format - * `/operations/` and can be used to - * track creation of the instance partition. The - * metadata field type is - * {@link protos.google.spanner.admin.instance.v1.CreateInstancePartitionMetadata|CreateInstancePartitionMetadata}. - * The response field type is - * {@link protos.google.spanner.admin.instance.v1.InstancePartition|InstancePartition}, if - * successful. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the instance in which to create the instance - * partition. Values are of the form - * `projects//instances/`. - * @param {string} request.instancePartitionId - * Required. The ID of the instance partition to create. Valid identifiers are - * of the form `{@link protos.-a-z0-9|a-z}*[a-z0-9]` and must be between 2 and 64 - * characters in length. - * @param {google.spanner.admin.instance.v1.InstancePartition} request.instancePartition - * Required. The instance partition to create. The instance_partition.name may - * be omitted, but if specified must be - * `/instancePartitions/`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - */ - createInstancePartition( - request?: protos.google.spanner.admin.instance.v1.ICreateInstancePartitionRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - createInstancePartition( - request: protos.google.spanner.admin.instance.v1.ICreateInstancePartitionRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createInstancePartition( - request: protos.google.spanner.admin.instance.v1.ICreateInstancePartitionRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createInstancePartition( - request?: protos.google.spanner.admin.instance.v1.ICreateInstancePartitionRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('createInstancePartition response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('createInstancePartition request %j', request); - return this.innerApiCalls.createInstancePartition(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('createInstancePartition response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `createInstancePartition()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - */ - async checkCreateInstancePartitionProgress(name: string): Promise>{ - this._log.info('createInstancePartition long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createInstancePartition, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Updates an instance partition, and begins allocating or releasing resources - * as requested. The returned long-running operation can be used to track the - * progress of updating the instance partition. If the named instance - * partition does not exist, returns `NOT_FOUND`. - * - * Immediately upon completion of this request: - * - * * For resource types for which a decrease in the instance partition's - * allocation has been requested, billing is based on the newly-requested - * level. - * - * Until completion of the returned operation: - * - * * Cancelling the operation sets its metadata's - * {@link protos.google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata.cancel_time|cancel_time}, - * and begins restoring resources to their pre-request values. The - * operation is guaranteed to succeed at undoing all resource changes, - * after which point it terminates with a `CANCELLED` status. - * * All other attempts to modify the instance partition are rejected. - * * Reading the instance partition via the API continues to give the - * pre-request resource levels. - * - * Upon completion of the returned operation: - * - * * Billing begins for all successfully-allocated resources (some types - * may have lower than the requested levels). - * * All newly-reserved resources are available for serving the instance - * partition's tables. - * * The instance partition's new resource levels are readable via the API. - * - * The returned long-running operation will - * have a name of the format - * `/operations/` and can be used to - * track the instance partition modification. The - * metadata field type is - * {@link protos.google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata|UpdateInstancePartitionMetadata}. - * The response field type is - * {@link protos.google.spanner.admin.instance.v1.InstancePartition|InstancePartition}, if - * successful. - * - * Authorization requires `spanner.instancePartitions.update` permission on - * the resource - * {@link protos.google.spanner.admin.instance.v1.InstancePartition.name|name}. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.spanner.admin.instance.v1.InstancePartition} request.instancePartition - * Required. The instance partition to update, which must always include the - * instance partition name. Otherwise, only fields mentioned in - * {@link protos.google.spanner.admin.instance.v1.UpdateInstancePartitionRequest.field_mask|field_mask} - * need be included. - * @param {google.protobuf.FieldMask} request.fieldMask - * Required. A mask specifying which fields in - * {@link protos.google.spanner.admin.instance.v1.InstancePartition|InstancePartition} - * should be updated. The field mask must always be specified; this prevents - * any future fields in - * {@link protos.google.spanner.admin.instance.v1.InstancePartition|InstancePartition} - * from being erased accidentally by clients that do not know about them. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - */ - updateInstancePartition( - request?: protos.google.spanner.admin.instance.v1.IUpdateInstancePartitionRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - updateInstancePartition( - request: protos.google.spanner.admin.instance.v1.IUpdateInstancePartitionRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateInstancePartition( - request: protos.google.spanner.admin.instance.v1.IUpdateInstancePartitionRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateInstancePartition( - request?: protos.google.spanner.admin.instance.v1.IUpdateInstancePartitionRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'instance_partition.name': request.instancePartition!.name ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('updateInstancePartition response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('updateInstancePartition request %j', request); - return this.innerApiCalls.updateInstancePartition(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('updateInstancePartition response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `updateInstancePartition()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - */ - async checkUpdateInstancePartitionProgress(name: string): Promise>{ - this._log.info('updateInstancePartition long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateInstancePartition, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Moves an instance to the target instance configuration. You can use the - * returned long-running operation to track - * the progress of moving the instance. - * - * `MoveInstance` returns `FAILED_PRECONDITION` if the instance meets any of - * the following criteria: - * - * * Is undergoing a move to a different instance configuration - * * Has backups - * * Has an ongoing update - * * Contains any CMEK-enabled databases - * * Is a free trial instance - * - * While the operation is pending: - * - * * All other attempts to modify the instance, including changes to its - * compute capacity, are rejected. - * * The following database and backup admin operations are rejected: - * - * * `DatabaseAdmin.CreateDatabase` - * * `DatabaseAdmin.UpdateDatabaseDdl` (disabled if default_leader is - * specified in the request.) - * * `DatabaseAdmin.RestoreDatabase` - * * `DatabaseAdmin.CreateBackup` - * * `DatabaseAdmin.CopyBackup` - * - * * Both the source and target instance configurations are subject to - * hourly compute and storage charges. - * * The instance might experience higher read-write latencies and a higher - * transaction abort rate. However, moving an instance doesn't cause any - * downtime. - * - * The returned long-running operation has - * a name of the format - * `/operations/` and can be used to track - * the move instance operation. The - * metadata field type is - * {@link protos.google.spanner.admin.instance.v1.MoveInstanceMetadata|MoveInstanceMetadata}. - * The response field type is - * {@link protos.google.spanner.admin.instance.v1.Instance|Instance}, - * if successful. - * Cancelling the operation sets its metadata's - * {@link protos.google.spanner.admin.instance.v1.MoveInstanceMetadata.cancel_time|cancel_time}. - * Cancellation is not immediate because it involves moving any data - * previously moved to the target instance configuration back to the original - * instance configuration. You can use this operation to track the progress of - * the cancellation. Upon successful completion of the cancellation, the - * operation terminates with `CANCELLED` status. - * - * If not cancelled, upon completion of the returned operation: - * - * * The instance successfully moves to the target instance - * configuration. - * * You are billed for compute and storage in target instance - * configuration. - * - * Authorization requires the `spanner.instances.update` permission on - * the resource {@link protos.google.spanner.admin.instance.v1.Instance|instance}. - * - * For more details, see - * [Move an instance](https://cloud.google.com/spanner/docs/move-instance). - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The instance to move. - * Values are of the form `projects//instances/`. - * @param {string} request.targetConfig - * Required. The target instance configuration where to move the instance. - * Values are of the form `projects//instanceConfigs/`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - */ - moveInstance( - request?: protos.google.spanner.admin.instance.v1.IMoveInstanceRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - moveInstance( - request: protos.google.spanner.admin.instance.v1.IMoveInstanceRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - moveInstance( - request: protos.google.spanner.admin.instance.v1.IMoveInstanceRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - moveInstance( - request?: protos.google.spanner.admin.instance.v1.IMoveInstanceRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('moveInstance response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('moveInstance request %j', request); - return this.innerApiCalls.moveInstance(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('moveInstance response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `moveInstance()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - */ - async checkMoveInstanceProgress(name: string): Promise>{ - this._log.info('moveInstance long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.moveInstance, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } - /** - * Lists the supported instance configurations for a given project. - * - * Returns both Google-managed configurations and user-managed - * configurations. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the project for which a list of supported instance - * configurations is requested. Values are of the form - * `projects/`. - * @param {number} request.pageSize - * Number of instance configurations to be returned in the response. If 0 or - * less, defaults to the server's maximum allowed page size. - * @param {string} request.pageToken - * If non-empty, `page_token` should contain a - * {@link protos.google.spanner.admin.instance.v1.ListInstanceConfigsResponse.next_page_token|next_page_token} - * from a previous - * {@link protos.google.spanner.admin.instance.v1.ListInstanceConfigsResponse|ListInstanceConfigsResponse}. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.spanner.admin.instance.v1.InstanceConfig|InstanceConfig}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listInstanceConfigsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listInstanceConfigs( - request?: protos.google.spanner.admin.instance.v1.IListInstanceConfigsRequest, - options?: CallOptions): - Promise<[ - protos.google.spanner.admin.instance.v1.IInstanceConfig[], - protos.google.spanner.admin.instance.v1.IListInstanceConfigsRequest|null, - protos.google.spanner.admin.instance.v1.IListInstanceConfigsResponse - ]>; - listInstanceConfigs( - request: protos.google.spanner.admin.instance.v1.IListInstanceConfigsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.spanner.admin.instance.v1.IListInstanceConfigsRequest, - protos.google.spanner.admin.instance.v1.IListInstanceConfigsResponse|null|undefined, - protos.google.spanner.admin.instance.v1.IInstanceConfig>): void; - listInstanceConfigs( - request: protos.google.spanner.admin.instance.v1.IListInstanceConfigsRequest, - callback: PaginationCallback< - protos.google.spanner.admin.instance.v1.IListInstanceConfigsRequest, - protos.google.spanner.admin.instance.v1.IListInstanceConfigsResponse|null|undefined, - protos.google.spanner.admin.instance.v1.IInstanceConfig>): void; - listInstanceConfigs( - request?: protos.google.spanner.admin.instance.v1.IListInstanceConfigsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.spanner.admin.instance.v1.IListInstanceConfigsRequest, - protos.google.spanner.admin.instance.v1.IListInstanceConfigsResponse|null|undefined, - protos.google.spanner.admin.instance.v1.IInstanceConfig>, - callback?: PaginationCallback< - protos.google.spanner.admin.instance.v1.IListInstanceConfigsRequest, - protos.google.spanner.admin.instance.v1.IListInstanceConfigsResponse|null|undefined, - protos.google.spanner.admin.instance.v1.IInstanceConfig>): - Promise<[ - protos.google.spanner.admin.instance.v1.IInstanceConfig[], - protos.google.spanner.admin.instance.v1.IListInstanceConfigsRequest|null, - protos.google.spanner.admin.instance.v1.IListInstanceConfigsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.spanner.admin.instance.v1.IListInstanceConfigsRequest, - protos.google.spanner.admin.instance.v1.IListInstanceConfigsResponse|null|undefined, - protos.google.spanner.admin.instance.v1.IInstanceConfig>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listInstanceConfigs values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listInstanceConfigs request %j', request); - return this.innerApiCalls - .listInstanceConfigs(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.spanner.admin.instance.v1.IInstanceConfig[], - protos.google.spanner.admin.instance.v1.IListInstanceConfigsRequest|null, - protos.google.spanner.admin.instance.v1.IListInstanceConfigsResponse - ]) => { - this._log.info('listInstanceConfigs values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listInstanceConfigs`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the project for which a list of supported instance - * configurations is requested. Values are of the form - * `projects/`. - * @param {number} request.pageSize - * Number of instance configurations to be returned in the response. If 0 or - * less, defaults to the server's maximum allowed page size. - * @param {string} request.pageToken - * If non-empty, `page_token` should contain a - * {@link protos.google.spanner.admin.instance.v1.ListInstanceConfigsResponse.next_page_token|next_page_token} - * from a previous - * {@link protos.google.spanner.admin.instance.v1.ListInstanceConfigsResponse|ListInstanceConfigsResponse}. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.spanner.admin.instance.v1.InstanceConfig|InstanceConfig} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listInstanceConfigsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listInstanceConfigsStream( - request?: protos.google.spanner.admin.instance.v1.IListInstanceConfigsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listInstanceConfigs']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listInstanceConfigs stream %j', request); - return this.descriptors.page.listInstanceConfigs.createStream( - this.innerApiCalls.listInstanceConfigs as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listInstanceConfigs`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the project for which a list of supported instance - * configurations is requested. Values are of the form - * `projects/`. - * @param {number} request.pageSize - * Number of instance configurations to be returned in the response. If 0 or - * less, defaults to the server's maximum allowed page size. - * @param {string} request.pageToken - * If non-empty, `page_token` should contain a - * {@link protos.google.spanner.admin.instance.v1.ListInstanceConfigsResponse.next_page_token|next_page_token} - * from a previous - * {@link protos.google.spanner.admin.instance.v1.ListInstanceConfigsResponse|ListInstanceConfigsResponse}. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.spanner.admin.instance.v1.InstanceConfig|InstanceConfig}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listInstanceConfigsAsync( - request?: protos.google.spanner.admin.instance.v1.IListInstanceConfigsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listInstanceConfigs']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listInstanceConfigs iterate %j', request); - return this.descriptors.page.listInstanceConfigs.asyncIterate( - this.innerApiCalls['listInstanceConfigs'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Lists the user-managed instance configuration long-running - * operations in the given project. An instance - * configuration operation has a name of the form - * `projects//instanceConfigs//operations/`. - * The long-running operation - * metadata field type - * `metadata.type_url` describes the type of the metadata. Operations returned - * include those that have completed/failed/canceled within the last 7 days, - * and pending operations. Operations returned are ordered by - * `operation.metadata.value.start_time` in descending order starting - * from the most recently started operation. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The project of the instance configuration operations. - * Values are of the form `projects/`. - * @param {string} request.filter - * An expression that filters the list of returned operations. - * - * A filter expression consists of a field name, a - * comparison operator, and a value for filtering. - * The value must be a string, a number, or a boolean. The comparison operator - * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. - * Colon `:` is the contains operator. Filter rules are not case sensitive. - * - * The following fields in the Operation are eligible for filtering: - * - * * `name` - The name of the long-running operation - * * `done` - False if the operation is in progress, else true. - * * `metadata.@type` - the type of metadata. For example, the type string - * for - * {@link protos.google.spanner.admin.instance.v1.CreateInstanceConfigMetadata|CreateInstanceConfigMetadata} - * is - * `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstanceConfigMetadata`. - * * `metadata.` - any field in metadata.value. - * `metadata.@type` must be specified first, if filtering on metadata - * fields. - * * `error` - Error associated with the long-running operation. - * * `response.@type` - the type of response. - * * `response.` - any field in response.value. - * - * You can combine multiple expressions by enclosing each expression in - * parentheses. By default, expressions are combined with AND logic. However, - * you can specify AND, OR, and NOT logic explicitly. - * - * Here are a few examples: - * - * * `done:true` - The operation is complete. - * * `(metadata.@type=` \ - * `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstanceConfigMetadata) - * AND` \ - * `(metadata.instance_config.name:custom-config) AND` \ - * `(metadata.progress.start_time < \"2021-03-28T14:50:00Z\") AND` \ - * `(error:*)` - Return operations where: - * * The operation's metadata type is - * {@link protos.google.spanner.admin.instance.v1.CreateInstanceConfigMetadata|CreateInstanceConfigMetadata}. - * * The instance configuration name contains "custom-config". - * * The operation started before 2021-03-28T14:50:00Z. - * * The operation resulted in an error. - * @param {number} request.pageSize - * Number of operations to be returned in the response. If 0 or - * less, defaults to the server's maximum allowed page size. - * @param {string} request.pageToken - * If non-empty, `page_token` should contain a - * {@link protos.google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse.next_page_token|next_page_token} - * from a previous - * {@link protos.google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse|ListInstanceConfigOperationsResponse} - * to the same `parent` and with the same `filter`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.longrunning.Operation|Operation}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listInstanceConfigOperationsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listInstanceConfigOperations( - request?: protos.google.spanner.admin.instance.v1.IListInstanceConfigOperationsRequest, - options?: CallOptions): - Promise<[ - protos.google.longrunning.IOperation[], - protos.google.spanner.admin.instance.v1.IListInstanceConfigOperationsRequest|null, - protos.google.spanner.admin.instance.v1.IListInstanceConfigOperationsResponse - ]>; - listInstanceConfigOperations( - request: protos.google.spanner.admin.instance.v1.IListInstanceConfigOperationsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.spanner.admin.instance.v1.IListInstanceConfigOperationsRequest, - protos.google.spanner.admin.instance.v1.IListInstanceConfigOperationsResponse|null|undefined, - protos.google.longrunning.IOperation>): void; - listInstanceConfigOperations( - request: protos.google.spanner.admin.instance.v1.IListInstanceConfigOperationsRequest, - callback: PaginationCallback< - protos.google.spanner.admin.instance.v1.IListInstanceConfigOperationsRequest, - protos.google.spanner.admin.instance.v1.IListInstanceConfigOperationsResponse|null|undefined, - protos.google.longrunning.IOperation>): void; - listInstanceConfigOperations( - request?: protos.google.spanner.admin.instance.v1.IListInstanceConfigOperationsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.spanner.admin.instance.v1.IListInstanceConfigOperationsRequest, - protos.google.spanner.admin.instance.v1.IListInstanceConfigOperationsResponse|null|undefined, - protos.google.longrunning.IOperation>, - callback?: PaginationCallback< - protos.google.spanner.admin.instance.v1.IListInstanceConfigOperationsRequest, - protos.google.spanner.admin.instance.v1.IListInstanceConfigOperationsResponse|null|undefined, - protos.google.longrunning.IOperation>): - Promise<[ - protos.google.longrunning.IOperation[], - protos.google.spanner.admin.instance.v1.IListInstanceConfigOperationsRequest|null, - protos.google.spanner.admin.instance.v1.IListInstanceConfigOperationsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.spanner.admin.instance.v1.IListInstanceConfigOperationsRequest, - protos.google.spanner.admin.instance.v1.IListInstanceConfigOperationsResponse|null|undefined, - protos.google.longrunning.IOperation>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listInstanceConfigOperations values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listInstanceConfigOperations request %j', request); - return this.innerApiCalls - .listInstanceConfigOperations(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.longrunning.IOperation[], - protos.google.spanner.admin.instance.v1.IListInstanceConfigOperationsRequest|null, - protos.google.spanner.admin.instance.v1.IListInstanceConfigOperationsResponse - ]) => { - this._log.info('listInstanceConfigOperations values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listInstanceConfigOperations`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The project of the instance configuration operations. - * Values are of the form `projects/`. - * @param {string} request.filter - * An expression that filters the list of returned operations. - * - * A filter expression consists of a field name, a - * comparison operator, and a value for filtering. - * The value must be a string, a number, or a boolean. The comparison operator - * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. - * Colon `:` is the contains operator. Filter rules are not case sensitive. - * - * The following fields in the Operation are eligible for filtering: - * - * * `name` - The name of the long-running operation - * * `done` - False if the operation is in progress, else true. - * * `metadata.@type` - the type of metadata. For example, the type string - * for - * {@link protos.google.spanner.admin.instance.v1.CreateInstanceConfigMetadata|CreateInstanceConfigMetadata} - * is - * `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstanceConfigMetadata`. - * * `metadata.` - any field in metadata.value. - * `metadata.@type` must be specified first, if filtering on metadata - * fields. - * * `error` - Error associated with the long-running operation. - * * `response.@type` - the type of response. - * * `response.` - any field in response.value. - * - * You can combine multiple expressions by enclosing each expression in - * parentheses. By default, expressions are combined with AND logic. However, - * you can specify AND, OR, and NOT logic explicitly. - * - * Here are a few examples: - * - * * `done:true` - The operation is complete. - * * `(metadata.@type=` \ - * `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstanceConfigMetadata) - * AND` \ - * `(metadata.instance_config.name:custom-config) AND` \ - * `(metadata.progress.start_time < \"2021-03-28T14:50:00Z\") AND` \ - * `(error:*)` - Return operations where: - * * The operation's metadata type is - * {@link protos.google.spanner.admin.instance.v1.CreateInstanceConfigMetadata|CreateInstanceConfigMetadata}. - * * The instance configuration name contains "custom-config". - * * The operation started before 2021-03-28T14:50:00Z. - * * The operation resulted in an error. - * @param {number} request.pageSize - * Number of operations to be returned in the response. If 0 or - * less, defaults to the server's maximum allowed page size. - * @param {string} request.pageToken - * If non-empty, `page_token` should contain a - * {@link protos.google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse.next_page_token|next_page_token} - * from a previous - * {@link protos.google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse|ListInstanceConfigOperationsResponse} - * to the same `parent` and with the same `filter`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.longrunning.Operation|Operation} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listInstanceConfigOperationsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listInstanceConfigOperationsStream( - request?: protos.google.spanner.admin.instance.v1.IListInstanceConfigOperationsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listInstanceConfigOperations']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listInstanceConfigOperations stream %j', request); - return this.descriptors.page.listInstanceConfigOperations.createStream( - this.innerApiCalls.listInstanceConfigOperations as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listInstanceConfigOperations`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The project of the instance configuration operations. - * Values are of the form `projects/`. - * @param {string} request.filter - * An expression that filters the list of returned operations. - * - * A filter expression consists of a field name, a - * comparison operator, and a value for filtering. - * The value must be a string, a number, or a boolean. The comparison operator - * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. - * Colon `:` is the contains operator. Filter rules are not case sensitive. - * - * The following fields in the Operation are eligible for filtering: - * - * * `name` - The name of the long-running operation - * * `done` - False if the operation is in progress, else true. - * * `metadata.@type` - the type of metadata. For example, the type string - * for - * {@link protos.google.spanner.admin.instance.v1.CreateInstanceConfigMetadata|CreateInstanceConfigMetadata} - * is - * `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstanceConfigMetadata`. - * * `metadata.` - any field in metadata.value. - * `metadata.@type` must be specified first, if filtering on metadata - * fields. - * * `error` - Error associated with the long-running operation. - * * `response.@type` - the type of response. - * * `response.` - any field in response.value. - * - * You can combine multiple expressions by enclosing each expression in - * parentheses. By default, expressions are combined with AND logic. However, - * you can specify AND, OR, and NOT logic explicitly. - * - * Here are a few examples: - * - * * `done:true` - The operation is complete. - * * `(metadata.@type=` \ - * `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstanceConfigMetadata) - * AND` \ - * `(metadata.instance_config.name:custom-config) AND` \ - * `(metadata.progress.start_time < \"2021-03-28T14:50:00Z\") AND` \ - * `(error:*)` - Return operations where: - * * The operation's metadata type is - * {@link protos.google.spanner.admin.instance.v1.CreateInstanceConfigMetadata|CreateInstanceConfigMetadata}. - * * The instance configuration name contains "custom-config". - * * The operation started before 2021-03-28T14:50:00Z. - * * The operation resulted in an error. - * @param {number} request.pageSize - * Number of operations to be returned in the response. If 0 or - * less, defaults to the server's maximum allowed page size. - * @param {string} request.pageToken - * If non-empty, `page_token` should contain a - * {@link protos.google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse.next_page_token|next_page_token} - * from a previous - * {@link protos.google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse|ListInstanceConfigOperationsResponse} - * to the same `parent` and with the same `filter`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.longrunning.Operation|Operation}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listInstanceConfigOperationsAsync( - request?: protos.google.spanner.admin.instance.v1.IListInstanceConfigOperationsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listInstanceConfigOperations']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listInstanceConfigOperations iterate %j', request); - return this.descriptors.page.listInstanceConfigOperations.asyncIterate( - this.innerApiCalls['listInstanceConfigOperations'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Lists all instances in the given project. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the project for which a list of instances is - * requested. Values are of the form `projects/`. - * @param {number} request.pageSize - * Number of instances to be returned in the response. If 0 or less, defaults - * to the server's maximum allowed page size. - * @param {string} request.pageToken - * If non-empty, `page_token` should contain a - * {@link protos.google.spanner.admin.instance.v1.ListInstancesResponse.next_page_token|next_page_token} - * from a previous - * {@link protos.google.spanner.admin.instance.v1.ListInstancesResponse|ListInstancesResponse}. - * @param {string} request.filter - * An expression for filtering the results of the request. Filter rules are - * case insensitive. The fields eligible for filtering are: - * - * * `name` - * * `display_name` - * * `labels.key` where key is the name of a label - * - * Some examples of using filters are: - * - * * `name:*` --> The instance has a name. - * * `name:Howl` --> The instance's name contains the string "howl". - * * `name:HOWL` --> Equivalent to above. - * * `NAME:howl` --> Equivalent to above. - * * `labels.env:*` --> The instance has the label "env". - * * `labels.env:dev` --> The instance has the label "env" and the value of - * the label contains the string "dev". - * * `name:howl labels.env:dev` --> The instance's name contains "howl" and - * it has the label "env" with its value - * containing "dev". - * @param {google.protobuf.Timestamp} request.instanceDeadline - * Deadline used while retrieving metadata for instances. - * Instances whose metadata cannot be retrieved within this deadline will be - * added to - * {@link protos.google.spanner.admin.instance.v1.ListInstancesResponse.unreachable|unreachable} - * in - * {@link protos.google.spanner.admin.instance.v1.ListInstancesResponse|ListInstancesResponse}. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.spanner.admin.instance.v1.Instance|Instance}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listInstancesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listInstances( - request?: protos.google.spanner.admin.instance.v1.IListInstancesRequest, - options?: CallOptions): - Promise<[ - protos.google.spanner.admin.instance.v1.IInstance[], - protos.google.spanner.admin.instance.v1.IListInstancesRequest|null, - protos.google.spanner.admin.instance.v1.IListInstancesResponse - ]>; - listInstances( - request: protos.google.spanner.admin.instance.v1.IListInstancesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.spanner.admin.instance.v1.IListInstancesRequest, - protos.google.spanner.admin.instance.v1.IListInstancesResponse|null|undefined, - protos.google.spanner.admin.instance.v1.IInstance>): void; - listInstances( - request: protos.google.spanner.admin.instance.v1.IListInstancesRequest, - callback: PaginationCallback< - protos.google.spanner.admin.instance.v1.IListInstancesRequest, - protos.google.spanner.admin.instance.v1.IListInstancesResponse|null|undefined, - protos.google.spanner.admin.instance.v1.IInstance>): void; - listInstances( - request?: protos.google.spanner.admin.instance.v1.IListInstancesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.spanner.admin.instance.v1.IListInstancesRequest, - protos.google.spanner.admin.instance.v1.IListInstancesResponse|null|undefined, - protos.google.spanner.admin.instance.v1.IInstance>, - callback?: PaginationCallback< - protos.google.spanner.admin.instance.v1.IListInstancesRequest, - protos.google.spanner.admin.instance.v1.IListInstancesResponse|null|undefined, - protos.google.spanner.admin.instance.v1.IInstance>): - Promise<[ - protos.google.spanner.admin.instance.v1.IInstance[], - protos.google.spanner.admin.instance.v1.IListInstancesRequest|null, - protos.google.spanner.admin.instance.v1.IListInstancesResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.spanner.admin.instance.v1.IListInstancesRequest, - protos.google.spanner.admin.instance.v1.IListInstancesResponse|null|undefined, - protos.google.spanner.admin.instance.v1.IInstance>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listInstances values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listInstances request %j', request); - return this.innerApiCalls - .listInstances(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.spanner.admin.instance.v1.IInstance[], - protos.google.spanner.admin.instance.v1.IListInstancesRequest|null, - protos.google.spanner.admin.instance.v1.IListInstancesResponse - ]) => { - this._log.info('listInstances values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listInstances`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the project for which a list of instances is - * requested. Values are of the form `projects/`. - * @param {number} request.pageSize - * Number of instances to be returned in the response. If 0 or less, defaults - * to the server's maximum allowed page size. - * @param {string} request.pageToken - * If non-empty, `page_token` should contain a - * {@link protos.google.spanner.admin.instance.v1.ListInstancesResponse.next_page_token|next_page_token} - * from a previous - * {@link protos.google.spanner.admin.instance.v1.ListInstancesResponse|ListInstancesResponse}. - * @param {string} request.filter - * An expression for filtering the results of the request. Filter rules are - * case insensitive. The fields eligible for filtering are: - * - * * `name` - * * `display_name` - * * `labels.key` where key is the name of a label - * - * Some examples of using filters are: - * - * * `name:*` --> The instance has a name. - * * `name:Howl` --> The instance's name contains the string "howl". - * * `name:HOWL` --> Equivalent to above. - * * `NAME:howl` --> Equivalent to above. - * * `labels.env:*` --> The instance has the label "env". - * * `labels.env:dev` --> The instance has the label "env" and the value of - * the label contains the string "dev". - * * `name:howl labels.env:dev` --> The instance's name contains "howl" and - * it has the label "env" with its value - * containing "dev". - * @param {google.protobuf.Timestamp} request.instanceDeadline - * Deadline used while retrieving metadata for instances. - * Instances whose metadata cannot be retrieved within this deadline will be - * added to - * {@link protos.google.spanner.admin.instance.v1.ListInstancesResponse.unreachable|unreachable} - * in - * {@link protos.google.spanner.admin.instance.v1.ListInstancesResponse|ListInstancesResponse}. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.spanner.admin.instance.v1.Instance|Instance} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listInstancesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listInstancesStream( - request?: protos.google.spanner.admin.instance.v1.IListInstancesRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listInstances']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listInstances stream %j', request); - return this.descriptors.page.listInstances.createStream( - this.innerApiCalls.listInstances as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listInstances`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the project for which a list of instances is - * requested. Values are of the form `projects/`. - * @param {number} request.pageSize - * Number of instances to be returned in the response. If 0 or less, defaults - * to the server's maximum allowed page size. - * @param {string} request.pageToken - * If non-empty, `page_token` should contain a - * {@link protos.google.spanner.admin.instance.v1.ListInstancesResponse.next_page_token|next_page_token} - * from a previous - * {@link protos.google.spanner.admin.instance.v1.ListInstancesResponse|ListInstancesResponse}. - * @param {string} request.filter - * An expression for filtering the results of the request. Filter rules are - * case insensitive. The fields eligible for filtering are: - * - * * `name` - * * `display_name` - * * `labels.key` where key is the name of a label - * - * Some examples of using filters are: - * - * * `name:*` --> The instance has a name. - * * `name:Howl` --> The instance's name contains the string "howl". - * * `name:HOWL` --> Equivalent to above. - * * `NAME:howl` --> Equivalent to above. - * * `labels.env:*` --> The instance has the label "env". - * * `labels.env:dev` --> The instance has the label "env" and the value of - * the label contains the string "dev". - * * `name:howl labels.env:dev` --> The instance's name contains "howl" and - * it has the label "env" with its value - * containing "dev". - * @param {google.protobuf.Timestamp} request.instanceDeadline - * Deadline used while retrieving metadata for instances. - * Instances whose metadata cannot be retrieved within this deadline will be - * added to - * {@link protos.google.spanner.admin.instance.v1.ListInstancesResponse.unreachable|unreachable} - * in - * {@link protos.google.spanner.admin.instance.v1.ListInstancesResponse|ListInstancesResponse}. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.spanner.admin.instance.v1.Instance|Instance}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listInstancesAsync( - request?: protos.google.spanner.admin.instance.v1.IListInstancesRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listInstances']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listInstances iterate %j', request); - return this.descriptors.page.listInstances.asyncIterate( - this.innerApiCalls['listInstances'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Lists all instance partitions for the given instance. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The instance whose instance partitions should be listed. Values - * are of the form `projects//instances/`. Use `{instance} - * = '-'` to list instance partitions for all Instances in a project, e.g., - * `projects/myproject/instances/-`. - * @param {number} request.pageSize - * Number of instance partitions to be returned in the response. If 0 or less, - * defaults to the server's maximum allowed page size. - * @param {string} request.pageToken - * If non-empty, `page_token` should contain a - * {@link protos.google.spanner.admin.instance.v1.ListInstancePartitionsResponse.next_page_token|next_page_token} - * from a previous - * {@link protos.google.spanner.admin.instance.v1.ListInstancePartitionsResponse|ListInstancePartitionsResponse}. - * @param {google.protobuf.Timestamp} [request.instancePartitionDeadline] - * Optional. Deadline used while retrieving metadata for instance partitions. - * Instance partitions whose metadata cannot be retrieved within this deadline - * will be added to - * {@link protos.google.spanner.admin.instance.v1.ListInstancePartitionsResponse.unreachable|unreachable} - * in - * {@link protos.google.spanner.admin.instance.v1.ListInstancePartitionsResponse|ListInstancePartitionsResponse}. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.spanner.admin.instance.v1.InstancePartition|InstancePartition}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listInstancePartitionsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listInstancePartitions( - request?: protos.google.spanner.admin.instance.v1.IListInstancePartitionsRequest, - options?: CallOptions): - Promise<[ - protos.google.spanner.admin.instance.v1.IInstancePartition[], - protos.google.spanner.admin.instance.v1.IListInstancePartitionsRequest|null, - protos.google.spanner.admin.instance.v1.IListInstancePartitionsResponse - ]>; - listInstancePartitions( - request: protos.google.spanner.admin.instance.v1.IListInstancePartitionsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.spanner.admin.instance.v1.IListInstancePartitionsRequest, - protos.google.spanner.admin.instance.v1.IListInstancePartitionsResponse|null|undefined, - protos.google.spanner.admin.instance.v1.IInstancePartition>): void; - listInstancePartitions( - request: protos.google.spanner.admin.instance.v1.IListInstancePartitionsRequest, - callback: PaginationCallback< - protos.google.spanner.admin.instance.v1.IListInstancePartitionsRequest, - protos.google.spanner.admin.instance.v1.IListInstancePartitionsResponse|null|undefined, - protos.google.spanner.admin.instance.v1.IInstancePartition>): void; - listInstancePartitions( - request?: protos.google.spanner.admin.instance.v1.IListInstancePartitionsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.spanner.admin.instance.v1.IListInstancePartitionsRequest, - protos.google.spanner.admin.instance.v1.IListInstancePartitionsResponse|null|undefined, - protos.google.spanner.admin.instance.v1.IInstancePartition>, - callback?: PaginationCallback< - protos.google.spanner.admin.instance.v1.IListInstancePartitionsRequest, - protos.google.spanner.admin.instance.v1.IListInstancePartitionsResponse|null|undefined, - protos.google.spanner.admin.instance.v1.IInstancePartition>): - Promise<[ - protos.google.spanner.admin.instance.v1.IInstancePartition[], - protos.google.spanner.admin.instance.v1.IListInstancePartitionsRequest|null, - protos.google.spanner.admin.instance.v1.IListInstancePartitionsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.spanner.admin.instance.v1.IListInstancePartitionsRequest, - protos.google.spanner.admin.instance.v1.IListInstancePartitionsResponse|null|undefined, - protos.google.spanner.admin.instance.v1.IInstancePartition>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listInstancePartitions values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listInstancePartitions request %j', request); - return this.innerApiCalls - .listInstancePartitions(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.spanner.admin.instance.v1.IInstancePartition[], - protos.google.spanner.admin.instance.v1.IListInstancePartitionsRequest|null, - protos.google.spanner.admin.instance.v1.IListInstancePartitionsResponse - ]) => { - this._log.info('listInstancePartitions values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listInstancePartitions`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The instance whose instance partitions should be listed. Values - * are of the form `projects//instances/`. Use `{instance} - * = '-'` to list instance partitions for all Instances in a project, e.g., - * `projects/myproject/instances/-`. - * @param {number} request.pageSize - * Number of instance partitions to be returned in the response. If 0 or less, - * defaults to the server's maximum allowed page size. - * @param {string} request.pageToken - * If non-empty, `page_token` should contain a - * {@link protos.google.spanner.admin.instance.v1.ListInstancePartitionsResponse.next_page_token|next_page_token} - * from a previous - * {@link protos.google.spanner.admin.instance.v1.ListInstancePartitionsResponse|ListInstancePartitionsResponse}. - * @param {google.protobuf.Timestamp} [request.instancePartitionDeadline] - * Optional. Deadline used while retrieving metadata for instance partitions. - * Instance partitions whose metadata cannot be retrieved within this deadline - * will be added to - * {@link protos.google.spanner.admin.instance.v1.ListInstancePartitionsResponse.unreachable|unreachable} - * in - * {@link protos.google.spanner.admin.instance.v1.ListInstancePartitionsResponse|ListInstancePartitionsResponse}. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.spanner.admin.instance.v1.InstancePartition|InstancePartition} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listInstancePartitionsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listInstancePartitionsStream( - request?: protos.google.spanner.admin.instance.v1.IListInstancePartitionsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listInstancePartitions']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listInstancePartitions stream %j', request); - return this.descriptors.page.listInstancePartitions.createStream( - this.innerApiCalls.listInstancePartitions as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listInstancePartitions`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The instance whose instance partitions should be listed. Values - * are of the form `projects//instances/`. Use `{instance} - * = '-'` to list instance partitions for all Instances in a project, e.g., - * `projects/myproject/instances/-`. - * @param {number} request.pageSize - * Number of instance partitions to be returned in the response. If 0 or less, - * defaults to the server's maximum allowed page size. - * @param {string} request.pageToken - * If non-empty, `page_token` should contain a - * {@link protos.google.spanner.admin.instance.v1.ListInstancePartitionsResponse.next_page_token|next_page_token} - * from a previous - * {@link protos.google.spanner.admin.instance.v1.ListInstancePartitionsResponse|ListInstancePartitionsResponse}. - * @param {google.protobuf.Timestamp} [request.instancePartitionDeadline] - * Optional. Deadline used while retrieving metadata for instance partitions. - * Instance partitions whose metadata cannot be retrieved within this deadline - * will be added to - * {@link protos.google.spanner.admin.instance.v1.ListInstancePartitionsResponse.unreachable|unreachable} - * in - * {@link protos.google.spanner.admin.instance.v1.ListInstancePartitionsResponse|ListInstancePartitionsResponse}. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.spanner.admin.instance.v1.InstancePartition|InstancePartition}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listInstancePartitionsAsync( - request?: protos.google.spanner.admin.instance.v1.IListInstancePartitionsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listInstancePartitions']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listInstancePartitions iterate %j', request); - return this.descriptors.page.listInstancePartitions.asyncIterate( - this.innerApiCalls['listInstancePartitions'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Lists instance partition long-running operations in the given instance. - * An instance partition operation has a name of the form - * `projects//instances//instancePartitions//operations/`. - * The long-running operation - * metadata field type - * `metadata.type_url` describes the type of the metadata. Operations returned - * include those that have completed/failed/canceled within the last 7 days, - * and pending operations. Operations returned are ordered by - * `operation.metadata.value.start_time` in descending order starting from the - * most recently started operation. - * - * Authorization requires `spanner.instancePartitionOperations.list` - * permission on the resource - * {@link protos.google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest.parent|parent}. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent instance of the instance partition operations. - * Values are of the form `projects//instances/`. - * @param {string} [request.filter] - * Optional. An expression that filters the list of returned operations. - * - * A filter expression consists of a field name, a - * comparison operator, and a value for filtering. - * The value must be a string, a number, or a boolean. The comparison operator - * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. - * Colon `:` is the contains operator. Filter rules are not case sensitive. - * - * The following fields in the Operation are eligible for filtering: - * - * * `name` - The name of the long-running operation - * * `done` - False if the operation is in progress, else true. - * * `metadata.@type` - the type of metadata. For example, the type string - * for - * {@link protos.google.spanner.admin.instance.v1.CreateInstancePartitionMetadata|CreateInstancePartitionMetadata} - * is - * `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstancePartitionMetadata`. - * * `metadata.` - any field in metadata.value. - * `metadata.@type` must be specified first, if filtering on metadata - * fields. - * * `error` - Error associated with the long-running operation. - * * `response.@type` - the type of response. - * * `response.` - any field in response.value. - * - * You can combine multiple expressions by enclosing each expression in - * parentheses. By default, expressions are combined with AND logic. However, - * you can specify AND, OR, and NOT logic explicitly. - * - * Here are a few examples: - * - * * `done:true` - The operation is complete. - * * `(metadata.@type=` \ - * `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstancePartitionMetadata) - * AND` \ - * `(metadata.instance_partition.name:custom-instance-partition) AND` \ - * `(metadata.start_time < \"2021-03-28T14:50:00Z\") AND` \ - * `(error:*)` - Return operations where: - * * The operation's metadata type is - * {@link protos.google.spanner.admin.instance.v1.CreateInstancePartitionMetadata|CreateInstancePartitionMetadata}. - * * The instance partition name contains "custom-instance-partition". - * * The operation started before 2021-03-28T14:50:00Z. - * * The operation resulted in an error. - * @param {number} [request.pageSize] - * Optional. Number of operations to be returned in the response. If 0 or - * less, defaults to the server's maximum allowed page size. - * @param {string} [request.pageToken] - * Optional. If non-empty, `page_token` should contain a - * {@link protos.google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse.next_page_token|next_page_token} - * from a previous - * {@link protos.google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse|ListInstancePartitionOperationsResponse} - * to the same `parent` and with the same `filter`. - * @param {google.protobuf.Timestamp} [request.instancePartitionDeadline] - * Optional. Deadline used while retrieving metadata for instance partition - * operations. Instance partitions whose operation metadata cannot be - * retrieved within this deadline will be added to - * {@link protos.google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse.unreachable_instance_partitions|unreachable_instance_partitions} - * in - * {@link protos.google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse|ListInstancePartitionOperationsResponse}. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.longrunning.Operation|Operation}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listInstancePartitionOperationsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listInstancePartitionOperations( - request?: protos.google.spanner.admin.instance.v1.IListInstancePartitionOperationsRequest, - options?: CallOptions): - Promise<[ - protos.google.longrunning.IOperation[], - protos.google.spanner.admin.instance.v1.IListInstancePartitionOperationsRequest|null, - protos.google.spanner.admin.instance.v1.IListInstancePartitionOperationsResponse - ]>; - listInstancePartitionOperations( - request: protos.google.spanner.admin.instance.v1.IListInstancePartitionOperationsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.spanner.admin.instance.v1.IListInstancePartitionOperationsRequest, - protos.google.spanner.admin.instance.v1.IListInstancePartitionOperationsResponse|null|undefined, - protos.google.longrunning.IOperation>): void; - listInstancePartitionOperations( - request: protos.google.spanner.admin.instance.v1.IListInstancePartitionOperationsRequest, - callback: PaginationCallback< - protos.google.spanner.admin.instance.v1.IListInstancePartitionOperationsRequest, - protos.google.spanner.admin.instance.v1.IListInstancePartitionOperationsResponse|null|undefined, - protos.google.longrunning.IOperation>): void; - listInstancePartitionOperations( - request?: protos.google.spanner.admin.instance.v1.IListInstancePartitionOperationsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.spanner.admin.instance.v1.IListInstancePartitionOperationsRequest, - protos.google.spanner.admin.instance.v1.IListInstancePartitionOperationsResponse|null|undefined, - protos.google.longrunning.IOperation>, - callback?: PaginationCallback< - protos.google.spanner.admin.instance.v1.IListInstancePartitionOperationsRequest, - protos.google.spanner.admin.instance.v1.IListInstancePartitionOperationsResponse|null|undefined, - protos.google.longrunning.IOperation>): - Promise<[ - protos.google.longrunning.IOperation[], - protos.google.spanner.admin.instance.v1.IListInstancePartitionOperationsRequest|null, - protos.google.spanner.admin.instance.v1.IListInstancePartitionOperationsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.spanner.admin.instance.v1.IListInstancePartitionOperationsRequest, - protos.google.spanner.admin.instance.v1.IListInstancePartitionOperationsResponse|null|undefined, - protos.google.longrunning.IOperation>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listInstancePartitionOperations values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listInstancePartitionOperations request %j', request); - return this.innerApiCalls - .listInstancePartitionOperations(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.longrunning.IOperation[], - protos.google.spanner.admin.instance.v1.IListInstancePartitionOperationsRequest|null, - protos.google.spanner.admin.instance.v1.IListInstancePartitionOperationsResponse - ]) => { - this._log.info('listInstancePartitionOperations values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listInstancePartitionOperations`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent instance of the instance partition operations. - * Values are of the form `projects//instances/`. - * @param {string} [request.filter] - * Optional. An expression that filters the list of returned operations. - * - * A filter expression consists of a field name, a - * comparison operator, and a value for filtering. - * The value must be a string, a number, or a boolean. The comparison operator - * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. - * Colon `:` is the contains operator. Filter rules are not case sensitive. - * - * The following fields in the Operation are eligible for filtering: - * - * * `name` - The name of the long-running operation - * * `done` - False if the operation is in progress, else true. - * * `metadata.@type` - the type of metadata. For example, the type string - * for - * {@link protos.google.spanner.admin.instance.v1.CreateInstancePartitionMetadata|CreateInstancePartitionMetadata} - * is - * `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstancePartitionMetadata`. - * * `metadata.` - any field in metadata.value. - * `metadata.@type` must be specified first, if filtering on metadata - * fields. - * * `error` - Error associated with the long-running operation. - * * `response.@type` - the type of response. - * * `response.` - any field in response.value. - * - * You can combine multiple expressions by enclosing each expression in - * parentheses. By default, expressions are combined with AND logic. However, - * you can specify AND, OR, and NOT logic explicitly. - * - * Here are a few examples: - * - * * `done:true` - The operation is complete. - * * `(metadata.@type=` \ - * `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstancePartitionMetadata) - * AND` \ - * `(metadata.instance_partition.name:custom-instance-partition) AND` \ - * `(metadata.start_time < \"2021-03-28T14:50:00Z\") AND` \ - * `(error:*)` - Return operations where: - * * The operation's metadata type is - * {@link protos.google.spanner.admin.instance.v1.CreateInstancePartitionMetadata|CreateInstancePartitionMetadata}. - * * The instance partition name contains "custom-instance-partition". - * * The operation started before 2021-03-28T14:50:00Z. - * * The operation resulted in an error. - * @param {number} [request.pageSize] - * Optional. Number of operations to be returned in the response. If 0 or - * less, defaults to the server's maximum allowed page size. - * @param {string} [request.pageToken] - * Optional. If non-empty, `page_token` should contain a - * {@link protos.google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse.next_page_token|next_page_token} - * from a previous - * {@link protos.google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse|ListInstancePartitionOperationsResponse} - * to the same `parent` and with the same `filter`. - * @param {google.protobuf.Timestamp} [request.instancePartitionDeadline] - * Optional. Deadline used while retrieving metadata for instance partition - * operations. Instance partitions whose operation metadata cannot be - * retrieved within this deadline will be added to - * {@link protos.google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse.unreachable_instance_partitions|unreachable_instance_partitions} - * in - * {@link protos.google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse|ListInstancePartitionOperationsResponse}. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.longrunning.Operation|Operation} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listInstancePartitionOperationsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listInstancePartitionOperationsStream( - request?: protos.google.spanner.admin.instance.v1.IListInstancePartitionOperationsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listInstancePartitionOperations']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listInstancePartitionOperations stream %j', request); - return this.descriptors.page.listInstancePartitionOperations.createStream( - this.innerApiCalls.listInstancePartitionOperations as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listInstancePartitionOperations`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent instance of the instance partition operations. - * Values are of the form `projects//instances/`. - * @param {string} [request.filter] - * Optional. An expression that filters the list of returned operations. - * - * A filter expression consists of a field name, a - * comparison operator, and a value for filtering. - * The value must be a string, a number, or a boolean. The comparison operator - * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. - * Colon `:` is the contains operator. Filter rules are not case sensitive. - * - * The following fields in the Operation are eligible for filtering: - * - * * `name` - The name of the long-running operation - * * `done` - False if the operation is in progress, else true. - * * `metadata.@type` - the type of metadata. For example, the type string - * for - * {@link protos.google.spanner.admin.instance.v1.CreateInstancePartitionMetadata|CreateInstancePartitionMetadata} - * is - * `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstancePartitionMetadata`. - * * `metadata.` - any field in metadata.value. - * `metadata.@type` must be specified first, if filtering on metadata - * fields. - * * `error` - Error associated with the long-running operation. - * * `response.@type` - the type of response. - * * `response.` - any field in response.value. - * - * You can combine multiple expressions by enclosing each expression in - * parentheses. By default, expressions are combined with AND logic. However, - * you can specify AND, OR, and NOT logic explicitly. - * - * Here are a few examples: - * - * * `done:true` - The operation is complete. - * * `(metadata.@type=` \ - * `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstancePartitionMetadata) - * AND` \ - * `(metadata.instance_partition.name:custom-instance-partition) AND` \ - * `(metadata.start_time < \"2021-03-28T14:50:00Z\") AND` \ - * `(error:*)` - Return operations where: - * * The operation's metadata type is - * {@link protos.google.spanner.admin.instance.v1.CreateInstancePartitionMetadata|CreateInstancePartitionMetadata}. - * * The instance partition name contains "custom-instance-partition". - * * The operation started before 2021-03-28T14:50:00Z. - * * The operation resulted in an error. - * @param {number} [request.pageSize] - * Optional. Number of operations to be returned in the response. If 0 or - * less, defaults to the server's maximum allowed page size. - * @param {string} [request.pageToken] - * Optional. If non-empty, `page_token` should contain a - * {@link protos.google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse.next_page_token|next_page_token} - * from a previous - * {@link protos.google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse|ListInstancePartitionOperationsResponse} - * to the same `parent` and with the same `filter`. - * @param {google.protobuf.Timestamp} [request.instancePartitionDeadline] - * Optional. Deadline used while retrieving metadata for instance partition - * operations. Instance partitions whose operation metadata cannot be - * retrieved within this deadline will be added to - * {@link protos.google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse.unreachable_instance_partitions|unreachable_instance_partitions} - * in - * {@link protos.google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse|ListInstancePartitionOperationsResponse}. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.longrunning.Operation|Operation}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listInstancePartitionOperationsAsync( - request?: protos.google.spanner.admin.instance.v1.IListInstancePartitionOperationsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listInstancePartitionOperations']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listInstancePartitionOperations iterate %j', request); - return this.descriptors.page.listInstancePartitionOperations.asyncIterate( - this.innerApiCalls['listInstancePartitionOperations'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } -/** - * Gets the latest state of a long-running operation. Clients can use this - * method to poll the operation result at intervals as recommended by the API - * service. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} - * 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 - * {@link google.longrunning.Operation | google.longrunning.Operation}. - * @return {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * {@link google.longrunning.Operation | google.longrunning.Operation}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * const name = ''; - * const [response] = await client.getOperation({name}); - * // doThingsWith(response) - * ``` - */ - getOperation( - request: protos.google.longrunning.GetOperationRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - > - ): Promise<[protos.google.longrunning.Operation]> { - 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'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.getOperation(request, options, callback); - } - /** - * Lists operations that match the specified filter in the request. If the - * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. - * - * For-await-of syntax is used with the iterable to recursively get response element on-demand. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation collection. - * @param {string} request.filter - The standard list filter. - * @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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the - * details. - * @returns {Object} - * An iterable Object that conforms to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | iteration protocols}. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * for await (const response of client.listOperationsAsync(request)); - * // doThingsWith(response) - * ``` - */ - listOperationsAsync( - request: protos.google.longrunning.ListOperationsRequest, - options?: gax.CallOptions - ): AsyncIterable { - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.listOperationsAsync(request, options); - } - /** - * Starts asynchronous cancellation on a long-running operation. The server - * makes a best effort to cancel the operation, but success is not - * guaranteed. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. Clients can use - * {@link Operations.GetOperation} or - * other methods to check whether the cancellation succeeded or whether the - * operation completed despite cancellation. On successful cancellation, - * the operation is not deleted; instead, it becomes an operation with - * an {@link Operation.error} value with a {@link google.rpc.Status.code} of - * 1, corresponding to `Code.CANCELLED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be cancelled. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the - * details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.cancelOperation({name: ''}); - * ``` - */ - cancelOperation( - request: protos.google.longrunning.CancelOperationRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - >, - callback?: Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - > - ): Promise { - 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'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.cancelOperation(request, options, callback); - } - - /** - * Deletes a long-running operation. This method indicates that the client is - * no longer interested in the operation result. It does not cancel the - * operation. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be deleted. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} - * for the details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.deleteOperation({name: ''}); - * ``` - */ - deleteOperation( - request: protos.google.longrunning.DeleteOperationRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - > - ): Promise { - 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'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.deleteOperation(request, options, callback); - } - - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified instance resource name string. - * - * @param {string} project - * @param {string} instance - * @returns {string} Resource name string. - */ - instancePath(project:string,instance:string) { - return this.pathTemplates.instancePathTemplate.render({ - project: project, - instance: instance, - }); - } - - /** - * Parse the project from Instance resource. - * - * @param {string} instanceName - * A fully-qualified path representing Instance resource. - * @returns {string} A string representing the project. - */ - matchProjectFromInstanceName(instanceName: string) { - return this.pathTemplates.instancePathTemplate.match(instanceName).project; - } - - /** - * Parse the instance from Instance resource. - * - * @param {string} instanceName - * A fully-qualified path representing Instance resource. - * @returns {string} A string representing the instance. - */ - matchInstanceFromInstanceName(instanceName: string) { - return this.pathTemplates.instancePathTemplate.match(instanceName).instance; - } - - /** - * Return a fully-qualified instanceConfig resource name string. - * - * @param {string} project - * @param {string} instance_config - * @returns {string} Resource name string. - */ - instanceConfigPath(project:string,instanceConfig:string) { - return this.pathTemplates.instanceConfigPathTemplate.render({ - project: project, - instance_config: instanceConfig, - }); - } - - /** - * Parse the project from InstanceConfig resource. - * - * @param {string} instanceConfigName - * A fully-qualified path representing InstanceConfig resource. - * @returns {string} A string representing the project. - */ - matchProjectFromInstanceConfigName(instanceConfigName: string) { - return this.pathTemplates.instanceConfigPathTemplate.match(instanceConfigName).project; - } - - /** - * Parse the instance_config from InstanceConfig resource. - * - * @param {string} instanceConfigName - * A fully-qualified path representing InstanceConfig resource. - * @returns {string} A string representing the instance_config. - */ - matchInstanceConfigFromInstanceConfigName(instanceConfigName: string) { - return this.pathTemplates.instanceConfigPathTemplate.match(instanceConfigName).instance_config; - } - - /** - * Return a fully-qualified instancePartition resource name string. - * - * @param {string} project - * @param {string} instance - * @param {string} instance_partition - * @returns {string} Resource name string. - */ - instancePartitionPath(project:string,instance:string,instancePartition:string) { - return this.pathTemplates.instancePartitionPathTemplate.render({ - project: project, - instance: instance, - instance_partition: instancePartition, - }); - } - - /** - * Parse the project from InstancePartition resource. - * - * @param {string} instancePartitionName - * A fully-qualified path representing InstancePartition resource. - * @returns {string} A string representing the project. - */ - matchProjectFromInstancePartitionName(instancePartitionName: string) { - return this.pathTemplates.instancePartitionPathTemplate.match(instancePartitionName).project; - } - - /** - * Parse the instance from InstancePartition resource. - * - * @param {string} instancePartitionName - * A fully-qualified path representing InstancePartition resource. - * @returns {string} A string representing the instance. - */ - matchInstanceFromInstancePartitionName(instancePartitionName: string) { - return this.pathTemplates.instancePartitionPathTemplate.match(instancePartitionName).instance; - } - - /** - * Parse the instance_partition from InstancePartition resource. - * - * @param {string} instancePartitionName - * A fully-qualified path representing InstancePartition resource. - * @returns {string} A string representing the instance_partition. - */ - matchInstancePartitionFromInstancePartitionName(instancePartitionName: string) { - return this.pathTemplates.instancePartitionPathTemplate.match(instancePartitionName).instance_partition; - } - - /** - * Return a fully-qualified project resource name string. - * - * @param {string} project - * @returns {string} Resource name string. - */ - projectPath(project:string) { - return this.pathTemplates.projectPathTemplate.render({ - project: project, - }); - } - - /** - * Parse the project from Project resource. - * - * @param {string} projectName - * A fully-qualified path representing Project resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectName(projectName: string) { - return this.pathTemplates.projectPathTemplate.match(projectName).project; - } - - /** - * Terminate the gRPC channel and close the client. - * - * The client will no longer be usable and all future behavior is undefined. - * @returns {Promise} A promise that resolves when the client is closed. - */ - close(): Promise { - if (this.instanceAdminStub && !this._terminated) { - return this.instanceAdminStub.then(stub => { - this._log.info('ending gRPC channel'); - this._terminated = true; - stub.close(); - void this.operationsClient.close(); - }); - } - return Promise.resolve(); - } -} \ No newline at end of file diff --git a/owl-bot-staging/admin/instance/v1/src/v1/instance_admin_client_config.json b/owl-bot-staging/admin/instance/v1/src/v1/instance_admin_client_config.json deleted file mode 100644 index cbe3ae620..000000000 --- a/owl-bot-staging/admin/instance/v1/src/v1/instance_admin_client_config.json +++ /dev/null @@ -1,129 +0,0 @@ -{ - "interfaces": { - "google.spanner.admin.instance.v1.InstanceAdmin": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - }, - "e9fafda332ce8a1702dc1575de3ca81c4feb4799": { - "initial_retry_delay_millis": 1000, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 32000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "ListInstanceConfigs": { - "timeout_millis": 3600000, - "retry_codes_name": "idempotent", - "retry_params_name": "e9fafda332ce8a1702dc1575de3ca81c4feb4799" - }, - "GetInstanceConfig": { - "timeout_millis": 3600000, - "retry_codes_name": "idempotent", - "retry_params_name": "e9fafda332ce8a1702dc1575de3ca81c4feb4799" - }, - "CreateInstanceConfig": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateInstanceConfig": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteInstanceConfig": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListInstanceConfigOperations": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListInstances": { - "timeout_millis": 3600000, - "retry_codes_name": "idempotent", - "retry_params_name": "e9fafda332ce8a1702dc1575de3ca81c4feb4799" - }, - "ListInstancePartitions": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetInstance": { - "timeout_millis": 3600000, - "retry_codes_name": "idempotent", - "retry_params_name": "e9fafda332ce8a1702dc1575de3ca81c4feb4799" - }, - "CreateInstance": { - "timeout_millis": 3600000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateInstance": { - "timeout_millis": 3600000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteInstance": { - "timeout_millis": 3600000, - "retry_codes_name": "idempotent", - "retry_params_name": "e9fafda332ce8a1702dc1575de3ca81c4feb4799" - }, - "SetIamPolicy": { - "timeout_millis": 30000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetIamPolicy": { - "timeout_millis": 30000, - "retry_codes_name": "idempotent", - "retry_params_name": "e9fafda332ce8a1702dc1575de3ca81c4feb4799" - }, - "TestIamPermissions": { - "timeout_millis": 30000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetInstancePartition": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CreateInstancePartition": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteInstancePartition": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateInstancePartition": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListInstancePartitionOperations": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "MoveInstance": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/admin/instance/v1/src/v1/instance_admin_proto_list.json b/owl-bot-staging/admin/instance/v1/src/v1/instance_admin_proto_list.json deleted file mode 100644 index ce2400d42..000000000 --- a/owl-bot-staging/admin/instance/v1/src/v1/instance_admin_proto_list.json +++ /dev/null @@ -1,4 +0,0 @@ -[ - "../../protos/google/spanner/admin/instance/v1/common.proto", - "../../protos/google/spanner/admin/instance/v1/spanner_instance_admin.proto" -] diff --git a/owl-bot-staging/admin/instance/v1/test/gapic_instance_admin_v1.ts b/owl-bot-staging/admin/instance/v1/test/gapic_instance_admin_v1.ts deleted file mode 100644 index 6da299055..000000000 --- a/owl-bot-staging/admin/instance/v1/test/gapic_instance_admin_v1.ts +++ /dev/null @@ -1,3974 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as protos from '../protos/protos'; -import * as assert from 'assert'; -import * as sinon from 'sinon'; -import {SinonStub} from 'sinon'; -import {describe, it} from 'mocha'; -import * as instanceadminModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf, LROperation, operationsProtos} from 'google-gax'; - -// Dynamically loaded proto JSON is needed to get the type information -// to fill in default values for request objects -const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); - -// eslint-disable-next-line @typescript-eslint/no-unused-vars -function getTypeDefaultValue(typeName: string, fields: string[]) { - let type = root.lookupType(typeName) as protobuf.Type; - for (const field of fields.slice(0, -1)) { - type = type.fields[field]?.resolvedType as protobuf.Type; - } - return type.fields[fields[fields.length - 1]]?.defaultValue; -} - -function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message) - .toObject(instance as protobuf.Message, {defaults: true}); - return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; -} - -function stubSimpleCall(response?: ResponseType, error?: Error) { - return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); -} - -function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { - return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); -} - -function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); -} - -function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); -} - -function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { - const pagingStub = sinon.stub(); - if (responses) { - for (let i = 0; i < responses.length; ++i) { - pagingStub.onCall(i).callsArgWith(2, null, responses[i]); - } - } - const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; - const mockStream = new PassThrough({ - objectMode: true, - transform: transformStub, - }); - // trigger as many responses as needed - if (responses) { - for (let i = 0; i < responses.length; ++i) { - setImmediate(() => { mockStream.write({}); }); - } - setImmediate(() => { mockStream.end(); }); - } else { - setImmediate(() => { mockStream.write({}); }); - setImmediate(() => { mockStream.end(); }); - } - return sinon.stub().returns(mockStream); -} - -function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { - let counter = 0; - const asyncIterable = { - [Symbol.asyncIterator]() { - return { - async next() { - if (error) { - return Promise.reject(error); - } - if (counter >= responses!.length) { - return Promise.resolve({done: true, value: undefined}); - } - return Promise.resolve({done: false, value: responses![counter++]}); - } - }; - } - }; - return sinon.stub().returns(asyncIterable); -} - -describe('v1.InstanceAdminClient', () => { - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new instanceadminModule.v1.InstanceAdminClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'spanner.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new instanceadminModule.v1.InstanceAdminClient(); - const universeDomain = client.universeDomain; - assert.strictEqual(universeDomain, "googleapis.com"); - }); - - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - it('throws DeprecationWarning if static servicePath is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const servicePath = instanceadminModule.v1.InstanceAdminClient.servicePath; - assert.strictEqual(servicePath, 'spanner.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - - it('throws DeprecationWarning if static apiEndpoint is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const apiEndpoint = instanceadminModule.v1.InstanceAdminClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'spanner.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new instanceadminModule.v1.InstanceAdminClient({universeDomain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'spanner.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new instanceadminModule.v1.InstanceAdminClient({universe_domain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'spanner.example.com'); - }); - - if (typeof process === 'object' && 'env' in process) { - describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { - it('sets apiEndpoint from environment variable', () => { - const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; - const client = new instanceadminModule.v1.InstanceAdminClient(); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'spanner.example.com'); - if (saved) { - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; - } else { - delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - } - }); - - it('value configured in code has priority over environment variable', () => { - const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; - const client = new instanceadminModule.v1.InstanceAdminClient({universeDomain: 'configured.example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'spanner.configured.example.com'); - if (saved) { - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; - } else { - delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - } - }); - }); - } - it('does not allow setting both universeDomain and universe_domain', () => { - assert.throws(() => { new instanceadminModule.v1.InstanceAdminClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); - }); - - it('has port', () => { - const port = instanceadminModule.v1.InstanceAdminClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new instanceadminModule.v1.InstanceAdminClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.instanceAdminStub, undefined); - await client.initialize(); - assert(client.instanceAdminStub); - }); - - it('has close method for the initialized client', done => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize().catch(err => {throw err}); - assert(client.instanceAdminStub); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has close method for the non-initialized client', done => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.instanceAdminStub, undefined); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); - const result = await client.getProjectId(); - assert.strictEqual(result, fakeProjectId); - assert((client.auth.getProjectId as SinonStub).calledWithExactly()); - }); - - it('has getProjectId method with callback', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); - const promise = new Promise((resolve, reject) => { - client.getProjectId((err?: Error|null, projectId?: string|null) => { - if (err) { - reject(err); - } else { - resolve(projectId); - } - }); - }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); - }); - }); - - describe('getInstanceConfig', () => { - it('invokes getInstanceConfig without error', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.instance.v1.GetInstanceConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.instance.v1.GetInstanceConfigRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.spanner.admin.instance.v1.InstanceConfig() - ); - client.innerApiCalls.getInstanceConfig = stubSimpleCall(expectedResponse); - const [response] = await client.getInstanceConfig(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getInstanceConfig as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getInstanceConfig as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getInstanceConfig without error using callback', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.instance.v1.GetInstanceConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.instance.v1.GetInstanceConfigRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.spanner.admin.instance.v1.InstanceConfig() - ); - client.innerApiCalls.getInstanceConfig = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getInstanceConfig( - request, - (err?: Error|null, result?: protos.google.spanner.admin.instance.v1.IInstanceConfig|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getInstanceConfig as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getInstanceConfig as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getInstanceConfig with error', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.instance.v1.GetInstanceConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.instance.v1.GetInstanceConfigRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.getInstanceConfig = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getInstanceConfig(request), expectedError); - const actualRequest = (client.innerApiCalls.getInstanceConfig as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getInstanceConfig as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getInstanceConfig with closed client', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.instance.v1.GetInstanceConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.instance.v1.GetInstanceConfigRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getInstanceConfig(request), expectedError); - }); - }); - - describe('deleteInstanceConfig', () => { - it('invokes deleteInstanceConfig without error', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.instance.v1.DeleteInstanceConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.instance.v1.DeleteInstanceConfigRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteInstanceConfig = stubSimpleCall(expectedResponse); - const [response] = await client.deleteInstanceConfig(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteInstanceConfig as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteInstanceConfig as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteInstanceConfig without error using callback', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.instance.v1.DeleteInstanceConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.instance.v1.DeleteInstanceConfigRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteInstanceConfig = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteInstanceConfig( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteInstanceConfig as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteInstanceConfig as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteInstanceConfig with error', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.instance.v1.DeleteInstanceConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.instance.v1.DeleteInstanceConfigRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteInstanceConfig = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteInstanceConfig(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteInstanceConfig as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteInstanceConfig as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteInstanceConfig with closed client', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.instance.v1.DeleteInstanceConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.instance.v1.DeleteInstanceConfigRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.deleteInstanceConfig(request), expectedError); - }); - }); - - describe('getInstance', () => { - it('invokes getInstance without error', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.instance.v1.GetInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.instance.v1.GetInstanceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.spanner.admin.instance.v1.Instance() - ); - client.innerApiCalls.getInstance = stubSimpleCall(expectedResponse); - const [response] = await client.getInstance(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getInstance without error using callback', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.instance.v1.GetInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.instance.v1.GetInstanceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.spanner.admin.instance.v1.Instance() - ); - client.innerApiCalls.getInstance = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getInstance( - request, - (err?: Error|null, result?: protos.google.spanner.admin.instance.v1.IInstance|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getInstance with error', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.instance.v1.GetInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.instance.v1.GetInstanceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.getInstance = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getInstance(request), expectedError); - const actualRequest = (client.innerApiCalls.getInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getInstance with closed client', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.instance.v1.GetInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.instance.v1.GetInstanceRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getInstance(request), expectedError); - }); - }); - - describe('deleteInstance', () => { - it('invokes deleteInstance without error', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.instance.v1.DeleteInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.instance.v1.DeleteInstanceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteInstance = stubSimpleCall(expectedResponse); - const [response] = await client.deleteInstance(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteInstance without error using callback', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.instance.v1.DeleteInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.instance.v1.DeleteInstanceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteInstance = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteInstance( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteInstance with error', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.instance.v1.DeleteInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.instance.v1.DeleteInstanceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteInstance = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteInstance(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteInstance with closed client', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.instance.v1.DeleteInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.instance.v1.DeleteInstanceRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.deleteInstance(request), expectedError); - }); - }); - - describe('setIamPolicy', () => { - it('invokes setIamPolicy without error', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.SetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.SetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.iam.v1.Policy() - ); - client.innerApiCalls.setIamPolicy = stubSimpleCall(expectedResponse); - const [response] = await client.setIamPolicy(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setIamPolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setIamPolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setIamPolicy without error using callback', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.SetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.SetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.iam.v1.Policy() - ); - client.innerApiCalls.setIamPolicy = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setIamPolicy( - request, - (err?: Error|null, result?: protos.google.iam.v1.IPolicy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setIamPolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setIamPolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setIamPolicy with error', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.SetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.SetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.setIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setIamPolicy(request), expectedError); - const actualRequest = (client.innerApiCalls.setIamPolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setIamPolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setIamPolicy with closed client', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.SetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.SetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.setIamPolicy(request), expectedError); - }); - }); - - describe('getIamPolicy', () => { - it('invokes getIamPolicy without error', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.GetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.GetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.iam.v1.Policy() - ); - client.innerApiCalls.getIamPolicy = stubSimpleCall(expectedResponse); - const [response] = await client.getIamPolicy(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getIamPolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getIamPolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getIamPolicy without error using callback', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.GetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.GetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.iam.v1.Policy() - ); - client.innerApiCalls.getIamPolicy = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getIamPolicy( - request, - (err?: Error|null, result?: protos.google.iam.v1.IPolicy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getIamPolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getIamPolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getIamPolicy with error', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.GetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.GetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.getIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getIamPolicy(request), expectedError); - const actualRequest = (client.innerApiCalls.getIamPolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getIamPolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getIamPolicy with closed client', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.GetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.GetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getIamPolicy(request), expectedError); - }); - }); - - describe('testIamPermissions', () => { - it('invokes testIamPermissions without error', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.TestIamPermissionsRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsResponse() - ); - client.innerApiCalls.testIamPermissions = stubSimpleCall(expectedResponse); - const [response] = await client.testIamPermissions(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.testIamPermissions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.testIamPermissions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes testIamPermissions without error using callback', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.TestIamPermissionsRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsResponse() - ); - client.innerApiCalls.testIamPermissions = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.testIamPermissions( - request, - (err?: Error|null, result?: protos.google.iam.v1.ITestIamPermissionsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.testIamPermissions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.testIamPermissions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes testIamPermissions with error', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.TestIamPermissionsRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.testIamPermissions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.testIamPermissions(request), expectedError); - const actualRequest = (client.innerApiCalls.testIamPermissions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.testIamPermissions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes testIamPermissions with closed client', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.TestIamPermissionsRequest', ['resource']); - request.resource = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.testIamPermissions(request), expectedError); - }); - }); - - describe('getInstancePartition', () => { - it('invokes getInstancePartition without error', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.instance.v1.GetInstancePartitionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.instance.v1.GetInstancePartitionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.spanner.admin.instance.v1.InstancePartition() - ); - client.innerApiCalls.getInstancePartition = stubSimpleCall(expectedResponse); - const [response] = await client.getInstancePartition(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getInstancePartition as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getInstancePartition as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getInstancePartition without error using callback', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.instance.v1.GetInstancePartitionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.instance.v1.GetInstancePartitionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.spanner.admin.instance.v1.InstancePartition() - ); - client.innerApiCalls.getInstancePartition = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getInstancePartition( - request, - (err?: Error|null, result?: protos.google.spanner.admin.instance.v1.IInstancePartition|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getInstancePartition as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getInstancePartition as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getInstancePartition with error', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.instance.v1.GetInstancePartitionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.instance.v1.GetInstancePartitionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.getInstancePartition = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getInstancePartition(request), expectedError); - const actualRequest = (client.innerApiCalls.getInstancePartition as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getInstancePartition as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getInstancePartition with closed client', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.instance.v1.GetInstancePartitionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.instance.v1.GetInstancePartitionRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getInstancePartition(request), expectedError); - }); - }); - - describe('deleteInstancePartition', () => { - it('invokes deleteInstancePartition without error', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.instance.v1.DeleteInstancePartitionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.instance.v1.DeleteInstancePartitionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteInstancePartition = stubSimpleCall(expectedResponse); - const [response] = await client.deleteInstancePartition(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteInstancePartition as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteInstancePartition as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteInstancePartition without error using callback', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.instance.v1.DeleteInstancePartitionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.instance.v1.DeleteInstancePartitionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteInstancePartition = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteInstancePartition( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteInstancePartition as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteInstancePartition as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteInstancePartition with error', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.instance.v1.DeleteInstancePartitionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.instance.v1.DeleteInstancePartitionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteInstancePartition = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteInstancePartition(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteInstancePartition as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteInstancePartition as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteInstancePartition with closed client', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.instance.v1.DeleteInstancePartitionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.instance.v1.DeleteInstancePartitionRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.deleteInstancePartition(request), expectedError); - }); - }); - - describe('createInstanceConfig', () => { - it('invokes createInstanceConfig without error', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.instance.v1.CreateInstanceConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.instance.v1.CreateInstanceConfigRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createInstanceConfig = stubLongRunningCall(expectedResponse); - const [operation] = await client.createInstanceConfig(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createInstanceConfig as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createInstanceConfig as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createInstanceConfig without error using callback', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.instance.v1.CreateInstanceConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.instance.v1.CreateInstanceConfigRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createInstanceConfig = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createInstanceConfig( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createInstanceConfig as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createInstanceConfig as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createInstanceConfig with call error', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.instance.v1.CreateInstanceConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.instance.v1.CreateInstanceConfigRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.createInstanceConfig = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createInstanceConfig(request), expectedError); - const actualRequest = (client.innerApiCalls.createInstanceConfig as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createInstanceConfig as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createInstanceConfig with LRO error', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.instance.v1.CreateInstanceConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.instance.v1.CreateInstanceConfigRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.createInstanceConfig = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createInstanceConfig(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.createInstanceConfig as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createInstanceConfig as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkCreateInstanceConfigProgress without error', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkCreateInstanceConfigProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkCreateInstanceConfigProgress with error', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkCreateInstanceConfigProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('updateInstanceConfig', () => { - it('invokes updateInstanceConfig without error', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.instance.v1.UpdateInstanceConfigRequest() - ); - request.instanceConfig ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.instance.v1.UpdateInstanceConfigRequest', ['instanceConfig', 'name']); - request.instanceConfig.name = defaultValue1; - const expectedHeaderRequestParams = `instance_config.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.updateInstanceConfig = stubLongRunningCall(expectedResponse); - const [operation] = await client.updateInstanceConfig(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateInstanceConfig as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateInstanceConfig as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateInstanceConfig without error using callback', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.instance.v1.UpdateInstanceConfigRequest() - ); - request.instanceConfig ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.instance.v1.UpdateInstanceConfigRequest', ['instanceConfig', 'name']); - request.instanceConfig.name = defaultValue1; - const expectedHeaderRequestParams = `instance_config.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.updateInstanceConfig = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateInstanceConfig( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateInstanceConfig as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateInstanceConfig as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateInstanceConfig with call error', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.instance.v1.UpdateInstanceConfigRequest() - ); - request.instanceConfig ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.instance.v1.UpdateInstanceConfigRequest', ['instanceConfig', 'name']); - request.instanceConfig.name = defaultValue1; - const expectedHeaderRequestParams = `instance_config.name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateInstanceConfig = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.updateInstanceConfig(request), expectedError); - const actualRequest = (client.innerApiCalls.updateInstanceConfig as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateInstanceConfig as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateInstanceConfig with LRO error', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.instance.v1.UpdateInstanceConfigRequest() - ); - request.instanceConfig ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.instance.v1.UpdateInstanceConfigRequest', ['instanceConfig', 'name']); - request.instanceConfig.name = defaultValue1; - const expectedHeaderRequestParams = `instance_config.name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateInstanceConfig = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.updateInstanceConfig(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.updateInstanceConfig as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateInstanceConfig as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkUpdateInstanceConfigProgress without error', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkUpdateInstanceConfigProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkUpdateInstanceConfigProgress with error', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkUpdateInstanceConfigProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('createInstance', () => { - it('invokes createInstance without error', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.instance.v1.CreateInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.instance.v1.CreateInstanceRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createInstance = stubLongRunningCall(expectedResponse); - const [operation] = await client.createInstance(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createInstance without error using callback', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.instance.v1.CreateInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.instance.v1.CreateInstanceRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createInstance = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createInstance( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createInstance with call error', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.instance.v1.CreateInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.instance.v1.CreateInstanceRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.createInstance = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createInstance(request), expectedError); - const actualRequest = (client.innerApiCalls.createInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createInstance with LRO error', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.instance.v1.CreateInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.instance.v1.CreateInstanceRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.createInstance = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createInstance(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.createInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkCreateInstanceProgress without error', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkCreateInstanceProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkCreateInstanceProgress with error', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkCreateInstanceProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('updateInstance', () => { - it('invokes updateInstance without error', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.instance.v1.UpdateInstanceRequest() - ); - request.instance ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.instance.v1.UpdateInstanceRequest', ['instance', 'name']); - request.instance.name = defaultValue1; - const expectedHeaderRequestParams = `instance.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.updateInstance = stubLongRunningCall(expectedResponse); - const [operation] = await client.updateInstance(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateInstance without error using callback', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.instance.v1.UpdateInstanceRequest() - ); - request.instance ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.instance.v1.UpdateInstanceRequest', ['instance', 'name']); - request.instance.name = defaultValue1; - const expectedHeaderRequestParams = `instance.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.updateInstance = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateInstance( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateInstance with call error', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.instance.v1.UpdateInstanceRequest() - ); - request.instance ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.instance.v1.UpdateInstanceRequest', ['instance', 'name']); - request.instance.name = defaultValue1; - const expectedHeaderRequestParams = `instance.name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateInstance = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.updateInstance(request), expectedError); - const actualRequest = (client.innerApiCalls.updateInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateInstance with LRO error', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.instance.v1.UpdateInstanceRequest() - ); - request.instance ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.instance.v1.UpdateInstanceRequest', ['instance', 'name']); - request.instance.name = defaultValue1; - const expectedHeaderRequestParams = `instance.name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateInstance = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.updateInstance(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.updateInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkUpdateInstanceProgress without error', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkUpdateInstanceProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkUpdateInstanceProgress with error', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkUpdateInstanceProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('createInstancePartition', () => { - it('invokes createInstancePartition without error', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.instance.v1.CreateInstancePartitionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.instance.v1.CreateInstancePartitionRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createInstancePartition = stubLongRunningCall(expectedResponse); - const [operation] = await client.createInstancePartition(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createInstancePartition as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createInstancePartition as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createInstancePartition without error using callback', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.instance.v1.CreateInstancePartitionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.instance.v1.CreateInstancePartitionRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createInstancePartition = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createInstancePartition( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createInstancePartition as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createInstancePartition as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createInstancePartition with call error', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.instance.v1.CreateInstancePartitionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.instance.v1.CreateInstancePartitionRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.createInstancePartition = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createInstancePartition(request), expectedError); - const actualRequest = (client.innerApiCalls.createInstancePartition as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createInstancePartition as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createInstancePartition with LRO error', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.instance.v1.CreateInstancePartitionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.instance.v1.CreateInstancePartitionRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.createInstancePartition = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createInstancePartition(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.createInstancePartition as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createInstancePartition as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkCreateInstancePartitionProgress without error', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkCreateInstancePartitionProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkCreateInstancePartitionProgress with error', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkCreateInstancePartitionProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('updateInstancePartition', () => { - it('invokes updateInstancePartition without error', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.instance.v1.UpdateInstancePartitionRequest() - ); - request.instancePartition ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.instance.v1.UpdateInstancePartitionRequest', ['instancePartition', 'name']); - request.instancePartition.name = defaultValue1; - const expectedHeaderRequestParams = `instance_partition.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.updateInstancePartition = stubLongRunningCall(expectedResponse); - const [operation] = await client.updateInstancePartition(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateInstancePartition as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateInstancePartition as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateInstancePartition without error using callback', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.instance.v1.UpdateInstancePartitionRequest() - ); - request.instancePartition ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.instance.v1.UpdateInstancePartitionRequest', ['instancePartition', 'name']); - request.instancePartition.name = defaultValue1; - const expectedHeaderRequestParams = `instance_partition.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.updateInstancePartition = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateInstancePartition( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateInstancePartition as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateInstancePartition as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateInstancePartition with call error', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.instance.v1.UpdateInstancePartitionRequest() - ); - request.instancePartition ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.instance.v1.UpdateInstancePartitionRequest', ['instancePartition', 'name']); - request.instancePartition.name = defaultValue1; - const expectedHeaderRequestParams = `instance_partition.name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateInstancePartition = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.updateInstancePartition(request), expectedError); - const actualRequest = (client.innerApiCalls.updateInstancePartition as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateInstancePartition as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateInstancePartition with LRO error', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.instance.v1.UpdateInstancePartitionRequest() - ); - request.instancePartition ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.instance.v1.UpdateInstancePartitionRequest', ['instancePartition', 'name']); - request.instancePartition.name = defaultValue1; - const expectedHeaderRequestParams = `instance_partition.name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateInstancePartition = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.updateInstancePartition(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.updateInstancePartition as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateInstancePartition as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkUpdateInstancePartitionProgress without error', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkUpdateInstancePartitionProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkUpdateInstancePartitionProgress with error', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkUpdateInstancePartitionProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('moveInstance', () => { - it('invokes moveInstance without error', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.instance.v1.MoveInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.instance.v1.MoveInstanceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.moveInstance = stubLongRunningCall(expectedResponse); - const [operation] = await client.moveInstance(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.moveInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.moveInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes moveInstance without error using callback', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.instance.v1.MoveInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.instance.v1.MoveInstanceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.moveInstance = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.moveInstance( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.moveInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.moveInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes moveInstance with call error', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.instance.v1.MoveInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.instance.v1.MoveInstanceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.moveInstance = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.moveInstance(request), expectedError); - const actualRequest = (client.innerApiCalls.moveInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.moveInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes moveInstance with LRO error', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.instance.v1.MoveInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.instance.v1.MoveInstanceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.moveInstance = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.moveInstance(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.moveInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.moveInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkMoveInstanceProgress without error', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkMoveInstanceProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkMoveInstanceProgress with error', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkMoveInstanceProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('listInstanceConfigs', () => { - it('invokes listInstanceConfigs without error', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.instance.v1.ListInstanceConfigsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.instance.v1.ListInstanceConfigsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.spanner.admin.instance.v1.InstanceConfig()), - generateSampleMessage(new protos.google.spanner.admin.instance.v1.InstanceConfig()), - generateSampleMessage(new protos.google.spanner.admin.instance.v1.InstanceConfig()), - ]; - client.innerApiCalls.listInstanceConfigs = stubSimpleCall(expectedResponse); - const [response] = await client.listInstanceConfigs(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listInstanceConfigs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listInstanceConfigs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listInstanceConfigs without error using callback', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.instance.v1.ListInstanceConfigsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.instance.v1.ListInstanceConfigsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.spanner.admin.instance.v1.InstanceConfig()), - generateSampleMessage(new protos.google.spanner.admin.instance.v1.InstanceConfig()), - generateSampleMessage(new protos.google.spanner.admin.instance.v1.InstanceConfig()), - ]; - client.innerApiCalls.listInstanceConfigs = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listInstanceConfigs( - request, - (err?: Error|null, result?: protos.google.spanner.admin.instance.v1.IInstanceConfig[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listInstanceConfigs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listInstanceConfigs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listInstanceConfigs with error', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.instance.v1.ListInstanceConfigsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.instance.v1.ListInstanceConfigsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.listInstanceConfigs = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listInstanceConfigs(request), expectedError); - const actualRequest = (client.innerApiCalls.listInstanceConfigs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listInstanceConfigs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listInstanceConfigsStream without error', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.instance.v1.ListInstanceConfigsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.instance.v1.ListInstanceConfigsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.spanner.admin.instance.v1.InstanceConfig()), - generateSampleMessage(new protos.google.spanner.admin.instance.v1.InstanceConfig()), - generateSampleMessage(new protos.google.spanner.admin.instance.v1.InstanceConfig()), - ]; - client.descriptors.page.listInstanceConfigs.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listInstanceConfigsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.spanner.admin.instance.v1.InstanceConfig[] = []; - stream.on('data', (response: protos.google.spanner.admin.instance.v1.InstanceConfig) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listInstanceConfigs.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listInstanceConfigs, request)); - assert( - (client.descriptors.page.listInstanceConfigs.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listInstanceConfigsStream with error', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.instance.v1.ListInstanceConfigsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.instance.v1.ListInstanceConfigsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listInstanceConfigs.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listInstanceConfigsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.spanner.admin.instance.v1.InstanceConfig[] = []; - stream.on('data', (response: protos.google.spanner.admin.instance.v1.InstanceConfig) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listInstanceConfigs.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listInstanceConfigs, request)); - assert( - (client.descriptors.page.listInstanceConfigs.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listInstanceConfigs without error', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.instance.v1.ListInstanceConfigsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.instance.v1.ListInstanceConfigsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.spanner.admin.instance.v1.InstanceConfig()), - generateSampleMessage(new protos.google.spanner.admin.instance.v1.InstanceConfig()), - generateSampleMessage(new protos.google.spanner.admin.instance.v1.InstanceConfig()), - ]; - client.descriptors.page.listInstanceConfigs.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.spanner.admin.instance.v1.IInstanceConfig[] = []; - const iterable = client.listInstanceConfigsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listInstanceConfigs.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listInstanceConfigs.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listInstanceConfigs with error', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.instance.v1.ListInstanceConfigsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.instance.v1.ListInstanceConfigsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listInstanceConfigs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listInstanceConfigsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.spanner.admin.instance.v1.IInstanceConfig[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listInstanceConfigs.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listInstanceConfigs.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listInstanceConfigOperations', () => { - it('invokes listInstanceConfigOperations without error', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.longrunning.Operation()), - generateSampleMessage(new protos.google.longrunning.Operation()), - generateSampleMessage(new protos.google.longrunning.Operation()), - ]; - client.innerApiCalls.listInstanceConfigOperations = stubSimpleCall(expectedResponse); - const [response] = await client.listInstanceConfigOperations(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listInstanceConfigOperations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listInstanceConfigOperations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listInstanceConfigOperations without error using callback', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.longrunning.Operation()), - generateSampleMessage(new protos.google.longrunning.Operation()), - generateSampleMessage(new protos.google.longrunning.Operation()), - ]; - client.innerApiCalls.listInstanceConfigOperations = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listInstanceConfigOperations( - request, - (err?: Error|null, result?: protos.google.longrunning.IOperation[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listInstanceConfigOperations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listInstanceConfigOperations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listInstanceConfigOperations with error', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.listInstanceConfigOperations = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listInstanceConfigOperations(request), expectedError); - const actualRequest = (client.innerApiCalls.listInstanceConfigOperations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listInstanceConfigOperations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listInstanceConfigOperationsStream without error', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.longrunning.Operation()), - generateSampleMessage(new protos.google.longrunning.Operation()), - generateSampleMessage(new protos.google.longrunning.Operation()), - ]; - client.descriptors.page.listInstanceConfigOperations.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listInstanceConfigOperationsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.longrunning.Operation[] = []; - stream.on('data', (response: protos.google.longrunning.Operation) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listInstanceConfigOperations.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listInstanceConfigOperations, request)); - assert( - (client.descriptors.page.listInstanceConfigOperations.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listInstanceConfigOperationsStream with error', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listInstanceConfigOperations.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listInstanceConfigOperationsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.longrunning.Operation[] = []; - stream.on('data', (response: protos.google.longrunning.Operation) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listInstanceConfigOperations.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listInstanceConfigOperations, request)); - assert( - (client.descriptors.page.listInstanceConfigOperations.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listInstanceConfigOperations without error', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.longrunning.Operation()), - generateSampleMessage(new protos.google.longrunning.Operation()), - generateSampleMessage(new protos.google.longrunning.Operation()), - ]; - client.descriptors.page.listInstanceConfigOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.longrunning.IOperation[] = []; - const iterable = client.listInstanceConfigOperationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listInstanceConfigOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listInstanceConfigOperations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listInstanceConfigOperations with error', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listInstanceConfigOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listInstanceConfigOperationsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.longrunning.IOperation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listInstanceConfigOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listInstanceConfigOperations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listInstances', () => { - it('invokes listInstances without error', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.instance.v1.ListInstancesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.instance.v1.ListInstancesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.spanner.admin.instance.v1.Instance()), - generateSampleMessage(new protos.google.spanner.admin.instance.v1.Instance()), - generateSampleMessage(new protos.google.spanner.admin.instance.v1.Instance()), - ]; - client.innerApiCalls.listInstances = stubSimpleCall(expectedResponse); - const [response] = await client.listInstances(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listInstances as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listInstances as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listInstances without error using callback', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.instance.v1.ListInstancesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.instance.v1.ListInstancesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.spanner.admin.instance.v1.Instance()), - generateSampleMessage(new protos.google.spanner.admin.instance.v1.Instance()), - generateSampleMessage(new protos.google.spanner.admin.instance.v1.Instance()), - ]; - client.innerApiCalls.listInstances = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listInstances( - request, - (err?: Error|null, result?: protos.google.spanner.admin.instance.v1.IInstance[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listInstances as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listInstances as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listInstances with error', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.instance.v1.ListInstancesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.instance.v1.ListInstancesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.listInstances = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listInstances(request), expectedError); - const actualRequest = (client.innerApiCalls.listInstances as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listInstances as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listInstancesStream without error', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.instance.v1.ListInstancesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.instance.v1.ListInstancesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.spanner.admin.instance.v1.Instance()), - generateSampleMessage(new protos.google.spanner.admin.instance.v1.Instance()), - generateSampleMessage(new protos.google.spanner.admin.instance.v1.Instance()), - ]; - client.descriptors.page.listInstances.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listInstancesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.spanner.admin.instance.v1.Instance[] = []; - stream.on('data', (response: protos.google.spanner.admin.instance.v1.Instance) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listInstances.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listInstances, request)); - assert( - (client.descriptors.page.listInstances.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listInstancesStream with error', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.instance.v1.ListInstancesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.instance.v1.ListInstancesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listInstances.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listInstancesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.spanner.admin.instance.v1.Instance[] = []; - stream.on('data', (response: protos.google.spanner.admin.instance.v1.Instance) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listInstances.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listInstances, request)); - assert( - (client.descriptors.page.listInstances.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listInstances without error', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.instance.v1.ListInstancesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.instance.v1.ListInstancesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.spanner.admin.instance.v1.Instance()), - generateSampleMessage(new protos.google.spanner.admin.instance.v1.Instance()), - generateSampleMessage(new protos.google.spanner.admin.instance.v1.Instance()), - ]; - client.descriptors.page.listInstances.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.spanner.admin.instance.v1.IInstance[] = []; - const iterable = client.listInstancesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listInstances.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listInstances.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listInstances with error', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.instance.v1.ListInstancesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.instance.v1.ListInstancesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listInstances.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listInstancesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.spanner.admin.instance.v1.IInstance[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listInstances.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listInstances.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listInstancePartitions', () => { - it('invokes listInstancePartitions without error', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.instance.v1.ListInstancePartitionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.instance.v1.ListInstancePartitionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.spanner.admin.instance.v1.InstancePartition()), - generateSampleMessage(new protos.google.spanner.admin.instance.v1.InstancePartition()), - generateSampleMessage(new protos.google.spanner.admin.instance.v1.InstancePartition()), - ]; - client.innerApiCalls.listInstancePartitions = stubSimpleCall(expectedResponse); - const [response] = await client.listInstancePartitions(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listInstancePartitions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listInstancePartitions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listInstancePartitions without error using callback', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.instance.v1.ListInstancePartitionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.instance.v1.ListInstancePartitionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.spanner.admin.instance.v1.InstancePartition()), - generateSampleMessage(new protos.google.spanner.admin.instance.v1.InstancePartition()), - generateSampleMessage(new protos.google.spanner.admin.instance.v1.InstancePartition()), - ]; - client.innerApiCalls.listInstancePartitions = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listInstancePartitions( - request, - (err?: Error|null, result?: protos.google.spanner.admin.instance.v1.IInstancePartition[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listInstancePartitions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listInstancePartitions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listInstancePartitions with error', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.instance.v1.ListInstancePartitionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.instance.v1.ListInstancePartitionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.listInstancePartitions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listInstancePartitions(request), expectedError); - const actualRequest = (client.innerApiCalls.listInstancePartitions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listInstancePartitions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listInstancePartitionsStream without error', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.instance.v1.ListInstancePartitionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.instance.v1.ListInstancePartitionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.spanner.admin.instance.v1.InstancePartition()), - generateSampleMessage(new protos.google.spanner.admin.instance.v1.InstancePartition()), - generateSampleMessage(new protos.google.spanner.admin.instance.v1.InstancePartition()), - ]; - client.descriptors.page.listInstancePartitions.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listInstancePartitionsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.spanner.admin.instance.v1.InstancePartition[] = []; - stream.on('data', (response: protos.google.spanner.admin.instance.v1.InstancePartition) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listInstancePartitions.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listInstancePartitions, request)); - assert( - (client.descriptors.page.listInstancePartitions.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listInstancePartitionsStream with error', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.instance.v1.ListInstancePartitionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.instance.v1.ListInstancePartitionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listInstancePartitions.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listInstancePartitionsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.spanner.admin.instance.v1.InstancePartition[] = []; - stream.on('data', (response: protos.google.spanner.admin.instance.v1.InstancePartition) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listInstancePartitions.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listInstancePartitions, request)); - assert( - (client.descriptors.page.listInstancePartitions.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listInstancePartitions without error', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.instance.v1.ListInstancePartitionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.instance.v1.ListInstancePartitionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.spanner.admin.instance.v1.InstancePartition()), - generateSampleMessage(new protos.google.spanner.admin.instance.v1.InstancePartition()), - generateSampleMessage(new protos.google.spanner.admin.instance.v1.InstancePartition()), - ]; - client.descriptors.page.listInstancePartitions.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.spanner.admin.instance.v1.IInstancePartition[] = []; - const iterable = client.listInstancePartitionsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listInstancePartitions.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listInstancePartitions.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listInstancePartitions with error', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.instance.v1.ListInstancePartitionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.instance.v1.ListInstancePartitionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listInstancePartitions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listInstancePartitionsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.spanner.admin.instance.v1.IInstancePartition[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listInstancePartitions.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listInstancePartitions.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listInstancePartitionOperations', () => { - it('invokes listInstancePartitionOperations without error', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.longrunning.Operation()), - generateSampleMessage(new protos.google.longrunning.Operation()), - generateSampleMessage(new protos.google.longrunning.Operation()), - ]; - client.innerApiCalls.listInstancePartitionOperations = stubSimpleCall(expectedResponse); - const [response] = await client.listInstancePartitionOperations(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listInstancePartitionOperations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listInstancePartitionOperations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listInstancePartitionOperations without error using callback', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.longrunning.Operation()), - generateSampleMessage(new protos.google.longrunning.Operation()), - generateSampleMessage(new protos.google.longrunning.Operation()), - ]; - client.innerApiCalls.listInstancePartitionOperations = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listInstancePartitionOperations( - request, - (err?: Error|null, result?: protos.google.longrunning.IOperation[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listInstancePartitionOperations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listInstancePartitionOperations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listInstancePartitionOperations with error', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.listInstancePartitionOperations = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listInstancePartitionOperations(request), expectedError); - const actualRequest = (client.innerApiCalls.listInstancePartitionOperations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listInstancePartitionOperations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listInstancePartitionOperationsStream without error', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.longrunning.Operation()), - generateSampleMessage(new protos.google.longrunning.Operation()), - generateSampleMessage(new protos.google.longrunning.Operation()), - ]; - client.descriptors.page.listInstancePartitionOperations.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listInstancePartitionOperationsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.longrunning.Operation[] = []; - stream.on('data', (response: protos.google.longrunning.Operation) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listInstancePartitionOperations.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listInstancePartitionOperations, request)); - assert( - (client.descriptors.page.listInstancePartitionOperations.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listInstancePartitionOperationsStream with error', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listInstancePartitionOperations.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listInstancePartitionOperationsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.longrunning.Operation[] = []; - stream.on('data', (response: protos.google.longrunning.Operation) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listInstancePartitionOperations.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listInstancePartitionOperations, request)); - assert( - (client.descriptors.page.listInstancePartitionOperations.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listInstancePartitionOperations without error', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.longrunning.Operation()), - generateSampleMessage(new protos.google.longrunning.Operation()), - generateSampleMessage(new protos.google.longrunning.Operation()), - ]; - client.descriptors.page.listInstancePartitionOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.longrunning.IOperation[] = []; - const iterable = client.listInstancePartitionOperationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listInstancePartitionOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listInstancePartitionOperations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listInstancePartitionOperations with error', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listInstancePartitionOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listInstancePartitionOperationsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.longrunning.IOperation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listInstancePartitionOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listInstancePartitionOperations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getOperation', () => { - it('invokes getOperation without error', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const response = await client.getOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes getOperation without error using callback', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.getOperation( - request, - undefined, - ( - err?: Error | null, - result?: operationsProtos.google.longrunning.Operation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - it('invokes getOperation with error', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.getOperation(request)}, expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('cancelOperation', () => { - it('invokes cancelOperation without error', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); - const response = await client.cancelOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes cancelOperation without error using callback', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.cancelOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0)); - }); - it('invokes cancelOperation with error', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('deleteOperation', () => { - it('invokes deleteOperation without error', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); - const response = await client.deleteOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes deleteOperation without error using callback', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.deleteOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0)); - }); - it('invokes deleteOperation with error', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('listOperationsAsync', () => { - it('uses async iteration with listOperations without error', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedResponse = [ - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - ]; - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: operationsProtos.google.longrunning.IOperation[] = []; - const iterable = client.operationsClient.listOperationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - it('uses async iteration with listOperations with error', async () => { - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.operationsClient.listOperationsAsync(request); - await assert.rejects(async () => { - const responses: operationsProtos.google.longrunning.IOperation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - }); - - describe('Path templates', () => { - - describe('instance', async () => { - const fakePath = "/rendered/path/instance"; - const expectedParameters = { - project: "projectValue", - instance: "instanceValue", - }; - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.instancePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.instancePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('instancePath', () => { - const result = client.instancePath("projectValue", "instanceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.instancePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromInstanceName', () => { - const result = client.matchProjectFromInstanceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.instancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchInstanceFromInstanceName', () => { - const result = client.matchInstanceFromInstanceName(fakePath); - assert.strictEqual(result, "instanceValue"); - assert((client.pathTemplates.instancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('instanceConfig', async () => { - const fakePath = "/rendered/path/instanceConfig"; - const expectedParameters = { - project: "projectValue", - instance_config: "instanceConfigValue", - }; - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.instanceConfigPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.instanceConfigPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('instanceConfigPath', () => { - const result = client.instanceConfigPath("projectValue", "instanceConfigValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.instanceConfigPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromInstanceConfigName', () => { - const result = client.matchProjectFromInstanceConfigName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.instanceConfigPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchInstanceConfigFromInstanceConfigName', () => { - const result = client.matchInstanceConfigFromInstanceConfigName(fakePath); - assert.strictEqual(result, "instanceConfigValue"); - assert((client.pathTemplates.instanceConfigPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('instancePartition', async () => { - const fakePath = "/rendered/path/instancePartition"; - const expectedParameters = { - project: "projectValue", - instance: "instanceValue", - instance_partition: "instancePartitionValue", - }; - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.instancePartitionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.instancePartitionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('instancePartitionPath', () => { - const result = client.instancePartitionPath("projectValue", "instanceValue", "instancePartitionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.instancePartitionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromInstancePartitionName', () => { - const result = client.matchProjectFromInstancePartitionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.instancePartitionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchInstanceFromInstancePartitionName', () => { - const result = client.matchInstanceFromInstancePartitionName(fakePath); - assert.strictEqual(result, "instanceValue"); - assert((client.pathTemplates.instancePartitionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchInstancePartitionFromInstancePartitionName', () => { - const result = client.matchInstancePartitionFromInstancePartitionName(fakePath); - assert.strictEqual(result, "instancePartitionValue"); - assert((client.pathTemplates.instancePartitionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('project', async () => { - const fakePath = "/rendered/path/project"; - const expectedParameters = { - project: "projectValue", - }; - const client = new instanceadminModule.v1.InstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectPath', () => { - const result = client.projectPath("projectValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectName', () => { - const result = client.matchProjectFromProjectName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/admin/instance/v1/tsconfig.json b/owl-bot-staging/admin/instance/v1/tsconfig.json deleted file mode 100644 index ca73e7bfc..000000000 --- a/owl-bot-staging/admin/instance/v1/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "extends": "./node_modules/gts/tsconfig-google.json", - "compilerOptions": { - "rootDir": ".", - "outDir": "build", - "resolveJsonModule": true, - "lib": [ - "es2023", - "dom" - ] - }, - "include": [ - "src/*.ts", - "src/**/*.ts", - "test/*.ts", - "test/**/*.ts", - "system-test/*.ts", - "src/**/*.json", - "samples/**/*.json", - "protos/protos.json" - ] -} diff --git a/owl-bot-staging/admin/instance/v1/webpack.config.js b/owl-bot-staging/admin/instance/v1/webpack.config.js deleted file mode 100644 index 9d3569000..000000000 --- a/owl-bot-staging/admin/instance/v1/webpack.config.js +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -const path = require('path'); - -module.exports = { - entry: './src/index.ts', - output: { - library: 'InstanceAdmin', - filename: './instance-admin.js', - }, - node: { - child_process: 'empty', - fs: 'empty', - crypto: 'empty', - }, - resolve: { - alias: { - '../../../package.json': path.resolve(__dirname, 'package.json'), - }, - extensions: ['.js', '.json', '.ts'], - }, - module: { - rules: [ - { - test: /\.tsx?$/, - use: 'ts-loader', - exclude: /node_modules/ - }, - { - test: /node_modules[\\/]@grpc[\\/]grpc-js/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]grpc/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]retry-request/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]https?-proxy-agent/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]gtoken/, - use: 'null-loader' - }, - ], - }, - mode: 'production', -}; diff --git a/owl-bot-staging/executor/v1/.OwlBot.yaml b/owl-bot-staging/executor/v1/.OwlBot.yaml deleted file mode 100644 index b80260f10..000000000 --- a/owl-bot-staging/executor/v1/.OwlBot.yaml +++ /dev/null @@ -1,19 +0,0 @@ -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -deep-copy-regex: - - source: /google/spanner/executor/google-spanner-executor-nodejs - dest: /owl-bot-staging/google-spanner-executor - -api-name: executor \ No newline at end of file diff --git a/owl-bot-staging/executor/v1/.eslintignore b/owl-bot-staging/executor/v1/.eslintignore deleted file mode 100644 index cfc348ec4..000000000 --- a/owl-bot-staging/executor/v1/.eslintignore +++ /dev/null @@ -1,7 +0,0 @@ -**/node_modules -**/.coverage -build/ -docs/ -protos/ -system-test/ -samples/generated/ diff --git a/owl-bot-staging/executor/v1/.eslintrc.json b/owl-bot-staging/executor/v1/.eslintrc.json deleted file mode 100644 index 782153495..000000000 --- a/owl-bot-staging/executor/v1/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./node_modules/gts" -} diff --git a/owl-bot-staging/executor/v1/.gitattributes b/owl-bot-staging/executor/v1/.gitattributes deleted file mode 100644 index 33739cb74..000000000 --- a/owl-bot-staging/executor/v1/.gitattributes +++ /dev/null @@ -1,4 +0,0 @@ -*.ts text eol=lf -*.js text eol=lf -protos/* linguist-generated -**/api-extractor.json linguist-language=JSON-with-Comments diff --git a/owl-bot-staging/executor/v1/.gitignore b/owl-bot-staging/executor/v1/.gitignore deleted file mode 100644 index d4f03a0df..000000000 --- a/owl-bot-staging/executor/v1/.gitignore +++ /dev/null @@ -1,14 +0,0 @@ -**/*.log -**/node_modules -/.coverage -/coverage -/.nyc_output -/docs/ -/out/ -/build/ -system-test/secrets.js -system-test/*key.json -*.lock -.DS_Store -package-lock.json -__pycache__ diff --git a/owl-bot-staging/executor/v1/.jsdoc.js b/owl-bot-staging/executor/v1/.jsdoc.js deleted file mode 100644 index ca8cf478f..000000000 --- a/owl-bot-staging/executor/v1/.jsdoc.js +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -'use strict'; - -module.exports = { - opts: { - readme: './README.md', - package: './package.json', - template: './node_modules/jsdoc-fresh', - recurse: true, - verbose: true, - destination: './docs/' - }, - plugins: [ - 'plugins/markdown', - 'jsdoc-region-tag' - ], - source: { - excludePattern: '(^|\\/|\\\\)[._]', - include: [ - 'build/src', - 'protos' - ], - includePattern: '\\.js$' - }, - templates: { - copyright: 'Copyright 2026 Google LLC', - includeDate: false, - sourceFiles: false, - systemName: '@google-cloud/executor', - theme: 'lumen', - default: { - outputSourceFiles: false - } - }, - markdown: { - idInHeadings: true - } -}; diff --git a/owl-bot-staging/executor/v1/.mocharc.js b/owl-bot-staging/executor/v1/.mocharc.js deleted file mode 100644 index 5eb34e86c..000000000 --- a/owl-bot-staging/executor/v1/.mocharc.js +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -const config = { - "enable-source-maps": true, - "throw-deprecation": true, - "timeout": 10000 -} -if (process.env.MOCHA_THROW_DEPRECATION === 'false') { - delete config['throw-deprecation']; -} -if (process.env.MOCHA_REPORTER) { - config.reporter = process.env.MOCHA_REPORTER; -} -if (process.env.MOCHA_REPORTER_OUTPUT) { - config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; -} -module.exports = config diff --git a/owl-bot-staging/executor/v1/.nycrc b/owl-bot-staging/executor/v1/.nycrc deleted file mode 100644 index 81a95fc94..000000000 --- a/owl-bot-staging/executor/v1/.nycrc +++ /dev/null @@ -1,24 +0,0 @@ -{ - "report-dir": "./.coverage", - "reporter": ["text", "lcov"], - "exclude": [ - "**/*-test", - "**/.coverage", - "**/apis", - "**/benchmark", - "**/conformance", - "**/docs", - "**/samples", - "**/scripts", - "**/protos", - "**/test", - "**/*.d.ts", - ".jsdoc.js", - "**/.jsdoc.js", - "karma.conf.js", - "webpack-tests.config.js", - "webpack.config.js" - ], - "exclude-after-remap": false, - "all": true -} \ No newline at end of file diff --git a/owl-bot-staging/executor/v1/.prettierignore b/owl-bot-staging/executor/v1/.prettierignore deleted file mode 100644 index 9340ad9b8..000000000 --- a/owl-bot-staging/executor/v1/.prettierignore +++ /dev/null @@ -1,6 +0,0 @@ -**/node_modules -**/coverage -test/fixtures -build/ -docs/ -protos/ diff --git a/owl-bot-staging/executor/v1/.prettierrc.js b/owl-bot-staging/executor/v1/.prettierrc.js deleted file mode 100644 index 7649ee3c2..000000000 --- a/owl-bot-staging/executor/v1/.prettierrc.js +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - -module.exports = { - ...require('gts/.prettierrc.json') -} diff --git a/owl-bot-staging/executor/v1/CODE_OF_CONDUCT.md b/owl-bot-staging/executor/v1/CODE_OF_CONDUCT.md deleted file mode 100644 index 2add2547a..000000000 --- a/owl-bot-staging/executor/v1/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,94 +0,0 @@ - -# Code of Conduct - -## Our Pledge - -In the interest of fostering an open and welcoming environment, we as -contributors and maintainers pledge to making participation in our project and -our community a harassment-free experience for everyone, regardless of age, body -size, disability, ethnicity, gender identity and expression, level of -experience, education, socio-economic status, nationality, personal appearance, -race, religion, or sexual identity and orientation. - -## Our Standards - -Examples of behavior that contributes to creating a positive environment -include: - -* Using welcoming and inclusive language -* Being respectful of differing viewpoints and experiences -* Gracefully accepting constructive criticism -* Focusing on what is best for the community -* Showing empathy towards other community members - -Examples of unacceptable behavior by participants include: - -* The use of sexualized language or imagery and unwelcome sexual attention or - advances -* Trolling, insulting/derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or electronic - address, without explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting - -## Our Responsibilities - -Project maintainers are responsible for clarifying the standards of acceptable -behavior and are expected to take appropriate and fair corrective action in -response to any instances of unacceptable behavior. - -Project maintainers have the right and responsibility to remove, edit, or reject -comments, commits, code, wiki edits, issues, and other contributions that are -not aligned to this Code of Conduct, or to ban temporarily or permanently any -contributor for other behaviors that they deem inappropriate, threatening, -offensive, or harmful. - -## Scope - -This Code of Conduct applies both within project spaces and in public spaces -when an individual is representing the project or its community. Examples of -representing a project or community include using an official project e-mail -address, posting via an official social media account, or acting as an appointed -representative at an online or offline event. Representation of a project may be -further defined and clarified by project maintainers. - -This Code of Conduct also applies outside the project spaces when the Project -Steward has a reasonable belief that an individual's behavior may have a -negative impact on the project or its community. - -## Conflict Resolution - -We do not believe that all conflict is bad; healthy debate and disagreement -often yield positive results. However, it is never okay to be disrespectful or -to engage in behavior that violates the project’s code of conduct. - -If you see someone violating the code of conduct, you are encouraged to address -the behavior directly with those involved. Many issues can be resolved quickly -and easily, and this gives people more control over the outcome of their -dispute. If you are unable to resolve the matter for any reason, or if the -behavior is threatening or harassing, report it. We are dedicated to providing -an environment where participants feel welcome and safe. - -Reports should be directed to *googleapis-stewards@google.com*, the -Project Steward(s) for *Google Cloud Client Libraries*. It is the Project Steward’s duty to -receive and address reported violations of the code of conduct. They will then -work with a committee consisting of representatives from the Open Source -Programs Office and the Google Open Source Strategy team. If for any reason you -are uncomfortable reaching out to the Project Steward, please email -opensource@google.com. - -We will investigate every complaint, but you may not receive a direct response. -We will use our discretion in determining when and how to follow up on reported -incidents, which may range from not taking action to permanent expulsion from -the project and project-sponsored spaces. We will notify the accused of the -report and provide them an opportunity to discuss it before any action is taken. -The identity of the reporter will be omitted from the details of the report -supplied to the accused. In potentially harmful situations, such as ongoing -harassment or threats to anyone's safety, we may take action without notice. - -## Attribution - -This Code of Conduct is adapted from the Contributor Covenant, version 1.4, -available at -https://www.contributor-covenant.org/version/1/4/code-of-conduct.html \ No newline at end of file diff --git a/owl-bot-staging/executor/v1/CONTRIBUTING.md b/owl-bot-staging/executor/v1/CONTRIBUTING.md deleted file mode 100644 index 830ae4e2c..000000000 --- a/owl-bot-staging/executor/v1/CONTRIBUTING.md +++ /dev/null @@ -1,76 +0,0 @@ -# How to become a contributor and submit your own code - -**Table of contents** - -* [Contributor License Agreements](#contributor-license-agreements) -* [Contributing a patch](#contributing-a-patch) -* [Running the tests](#running-the-tests) -* [Releasing the library](#releasing-the-library) - -## Contributor License Agreements - -We'd love to accept your sample apps and patches! Before we can take them, we -have to jump a couple of legal hurdles. - -Please fill out either the individual or corporate Contributor License Agreement -(CLA). - - * If you are an individual writing original source code and you're sure you - own the intellectual property, then you'll need to sign an [individual CLA](https://developers.google.com/open-source/cla/individual). - * If you work for a company that wants to allow you to contribute your work, - then you'll need to sign a [corporate CLA](https://developers.google.com/open-source/cla/corporate). - -Follow either of the two links above to access the appropriate CLA and -instructions for how to sign and return it. Once we receive it, we'll be able to -accept your pull requests. - -## Contributing A Patch - -1. Submit an issue describing your proposed change to the repo in question. -1. The repo owner will respond to your issue promptly. -1. If your proposed change is accepted, and you haven't already done so, sign a - Contributor License Agreement (see details above). -1. Fork the desired repo, develop and test your code changes. -1. Ensure that your code adheres to the existing style in the code to which - you are contributing. -1. Ensure that your code has an appropriate set of tests which all pass. -1. Title your pull request following [Conventional Commits](https://www.conventionalcommits.org/) styling. -1. Submit a pull request. - -### Before you begin - -1. [Select or create a Cloud Platform project][projects]. -1. [Enable billing for your project][billing]. -1. [Enable the Executor API][enable_api]. -1. [Set up authentication with a service account][auth] so you can access the - API from your local workstation. - - -## Running the tests - -1. [Prepare your environment for Node.js setup][setup]. - -1. Install dependencies: - - npm install - -1. Run the tests: - - # Run unit tests. - npm test - - # Run sample integration tests. - npm run samples-test - - # Run all system tests. - npm run system-test - -1. Lint (and maybe fix) any changes: - - npm run fix - -[setup]: https://cloud.google.com/nodejs/docs/setup -[projects]: https://console.cloud.google.com/project -[billing]: https://support.google.com/cloud/answer/6293499#enable-billing -[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=spanner-cloud-executor.googleapis.com -[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/owl-bot-staging/executor/v1/LICENSE b/owl-bot-staging/executor/v1/LICENSE deleted file mode 100644 index d64569567..000000000 --- a/owl-bot-staging/executor/v1/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/owl-bot-staging/executor/v1/README.md b/owl-bot-staging/executor/v1/README.md deleted file mode 100644 index e9a7f28db..000000000 --- a/owl-bot-staging/executor/v1/README.md +++ /dev/null @@ -1,108 +0,0 @@ -[//]: # "This README.md file is auto-generated, all changes to this file will be lost." -[//]: # "The comments you see below are used to generate those parts of the template in later states." -Google Cloud Platform logo - -# [Cloud Spanner Executor test API: Nodejs Client][homepage] - -[//]: # "releaseLevel" - -[![npm version](https://img.shields.io/npm/v/@google-cloud/executor.svg)](https://www.npmjs.org/package/@google-cloud/executor) - -Cloud Spanner Executor test API client for Node.js - -[//]: # "partials.introduction" - -A comprehensive list of changes in each version may be found in -[the CHANGELOG][homepage_changelog]. - -* [Cloud Spanner Executor test API Nodejs Client API Reference](https://cloud.google.com/nodejs/docs/reference/executor/latest) - - -Read more about the client libraries for Cloud APIs, including the older -Google APIs Client Libraries, in [Client Libraries Explained][explained]. - -[explained]: https://cloud.google.com/apis/docs/client-libraries-explained - -**Table of contents:** - -* [Quickstart](#quickstart) - * [Before you begin](#before-you-begin) - * [Installing the client library](#installing-the-client-library) - -* [Versioning](#versioning) -* [Contributing](#contributing) -* [License](#license) - -## Quickstart -### Before you begin - -1. [Select or create a Cloud Platform project][projects]. -1. [Enable billing for your project][billing]. -1. [Enable the Cloud Spanner Executor test API API][enable_api]. -1. [Set up authentication][auth] so you can access the - API from your local workstation. -### Installing the client library - -```bash -npm install @google-cloud/executor -``` - -[//]: # "partials.body" - -## Samples - -Samples are in the [`samples/`][homepage_samples] directory. Each sample's `README.md` has instructions for running its sample. - -[//]: # "samples" - -## Supported Node.js Versions - -Our client libraries follow the [Node.js release schedule](https://github.com/nodejs/release#release-schedule). -Libraries are compatible with all current _active_ and _maintenance_ versions of -Node.js. -If you are using an end-of-life version of Node.js, we recommend that you update -as soon as possible to an actively supported LTS version. - -Google's client libraries support legacy versions of Node.js runtimes on a -best-efforts basis with the following warnings: - -* Legacy versions are not tested in continuous integration. -* Some security patches and features cannot be backported. -* Dependencies cannot be kept up-to-date. - -Client libraries targeting some end-of-life versions of Node.js are available, and -can be installed through npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). -The dist-tags follow the naming convention `legacy-(version)`. -For example, `npm install @google-cloud/executor@legacy-8` installs client libraries -for versions compatible with Node.js 8. - -## Versioning - -This library follows [Semantic Versioning](http://semver.org/). - -More Information: [Google Cloud Platform Launch Stages][launch_stages] - -[launch_stages]: https://cloud.google.com/terms/launch-stages - -## Contributing - -Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-spanner-executor/CONTRIBUTING.md). - -Please note that this `README.md` -and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) -are generated from a central template. - -## License - -Apache Version 2.0 - -See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-spanner-executor/LICENSE) - -[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png -[projects]: https://console.cloud.google.com/project -[billing]: https://support.google.com/cloud/answer/6293499#enable-billing -[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=spanner-cloud-executor.googleapis.com -[auth]: https://cloud.google.com/docs/authentication/external/set-up-adc-local -[homepage_samples]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-spanner-executor/samples -[homepage_changelog]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-spanner-executor/CHANGELOG.md -[homepage]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-spanner-executor diff --git a/owl-bot-staging/executor/v1/package.json b/owl-bot-staging/executor/v1/package.json deleted file mode 100644 index 43dae9117..000000000 --- a/owl-bot-staging/executor/v1/package.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "name": "@google-cloud/executor", - "version": "0.1.0", - "description": "Executor client for Node.js", - "repository": "googleapis/nodejs-executor", - "license": "Apache-2.0", - "author": "Google LLC", - "main": "build/src/index.js", - "files": [ - "build/src", - "build/protos" - ], - "keywords": [ - "google apis client", - "google api client", - "google apis", - "google api", - "google", - "google cloud platform", - "google cloud", - "cloud", - "google executor", - "executor", - "database admin", - "instance admin", - "spanner", - "spanner executor proxy" - ], - "scripts": { - "clean": "gts clean", - "compile": "tsc -p . && cp -r protos build/ && minifyProtoJson", - "compile-protos": "compileProtos src", - "docs": "jsdoc -c .jsdoc.js", - "fix": "gts fix", - "lint": "gts check", - "prepare": "npm run compile-protos && npm run compile", - "system-test": "c8 mocha build/system-test", - "test": "c8 mocha build/test" - }, - "dependencies": { - "google-gax": "^5.1.1-rc.1" - }, - "devDependencies": { - "@types/mocha": "^10.0.10", - "@types/node": "^22.18.12", - "@types/sinon": "^17.0.4", - "c8": "^10.1.3", - "gapic-tools": "^1.0.3", - "gts": "^6.0.2", - "jsdoc": "^4.0.5", - "jsdoc-fresh": "^5.0.2", - "jsdoc-region-tag": "^4.0.1", - "mocha": "^11.7.4", - "pack-n-play": "^4.2.1", - "typescript": "5.8.3", - "sinon": "^21.0.0" - }, - "engines": { - "node": ">=v18" - } -} diff --git a/owl-bot-staging/executor/v1/protos/google/spanner/admin/database/v1/backup.proto b/owl-bot-staging/executor/v1/protos/google/spanner/admin/database/v1/backup.proto deleted file mode 100644 index 6898814c4..000000000 --- a/owl-bot-staging/executor/v1/protos/google/spanner/admin/database/v1/backup.proto +++ /dev/null @@ -1,773 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.spanner.admin.database.v1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/field_mask.proto"; -import "google/protobuf/timestamp.proto"; -import "google/spanner/admin/database/v1/common.proto"; - -option csharp_namespace = "Google.Cloud.Spanner.Admin.Database.V1"; -option go_package = "cloud.google.com/go/spanner/admin/database/apiv1/databasepb;databasepb"; -option java_multiple_files = true; -option java_outer_classname = "BackupProto"; -option java_package = "com.google.spanner.admin.database.v1"; -option php_namespace = "Google\\Cloud\\Spanner\\Admin\\Database\\V1"; -option ruby_package = "Google::Cloud::Spanner::Admin::Database::V1"; - -// A backup of a Cloud Spanner database. -message Backup { - option (google.api.resource) = { - type: "spanner.googleapis.com/Backup" - pattern: "projects/{project}/instances/{instance}/backups/{backup}" - }; - - // Indicates the current state of the backup. - enum State { - // Not specified. - STATE_UNSPECIFIED = 0; - - // The pending backup is still being created. Operations on the - // backup may fail with `FAILED_PRECONDITION` in this state. - CREATING = 1; - - // The backup is complete and ready for use. - READY = 2; - } - - // Required for the - // [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] - // operation. Name of the database from which this backup was created. This - // needs to be in the same instance as the backup. Values are of the form - // `projects//instances//databases/`. - string database = 2 [(google.api.resource_reference) = { - type: "spanner.googleapis.com/Database" - }]; - - // The backup will contain an externally consistent copy of the database at - // the timestamp specified by `version_time`. If `version_time` is not - // specified, the system will set `version_time` to the `create_time` of the - // backup. - google.protobuf.Timestamp version_time = 9; - - // Required for the - // [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] - // operation. The expiration time of the backup, with microseconds - // granularity that must be at least 6 hours and at most 366 days - // from the time the CreateBackup request is processed. Once the `expire_time` - // has passed, the backup is eligible to be automatically deleted by Cloud - // Spanner to free the resources used by the backup. - google.protobuf.Timestamp expire_time = 3; - - // Output only for the - // [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] - // operation. Required for the - // [UpdateBackup][google.spanner.admin.database.v1.DatabaseAdmin.UpdateBackup] - // operation. - // - // A globally unique identifier for the backup which cannot be - // changed. Values are of the form - // `projects//instances//backups/[a-z][a-z0-9_\-]*[a-z0-9]` - // The final segment of the name must be between 2 and 60 characters - // in length. - // - // The backup is stored in the location(s) specified in the instance - // configuration of the instance containing the backup, identified - // by the prefix of the backup name of the form - // `projects//instances/`. - string name = 1; - - // Output only. The time the - // [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] - // request is received. If the request does not specify `version_time`, the - // `version_time` of the backup will be equivalent to the `create_time`. - google.protobuf.Timestamp create_time = 4 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Size of the backup in bytes. - int64 size_bytes = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The number of bytes that will be freed by deleting this - // backup. This value will be zero if, for example, this backup is part of an - // incremental backup chain and younger backups in the chain require that we - // keep its data. For backups not in an incremental backup chain, this is - // always the size of the backup. This value may change if backups on the same - // chain get created, deleted or expired. - int64 freeable_size_bytes = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. For a backup in an incremental backup chain, this is the - // storage space needed to keep the data that has changed since the previous - // backup. For all other backups, this is always the size of the backup. This - // value may change if backups on the same chain get deleted or expired. - // - // This field can be used to calculate the total storage space used by a set - // of backups. For example, the total space used by all backups of a database - // can be computed by summing up this field. - int64 exclusive_size_bytes = 16 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The current state of the backup. - State state = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The names of the restored databases that reference the backup. - // The database names are of - // the form `projects//instances//databases/`. - // Referencing databases may exist in different instances. The existence of - // any referencing database prevents the backup from being deleted. When a - // restored database from the backup enters the `READY` state, the reference - // to the backup is removed. - repeated string referencing_databases = 7 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.resource_reference) = { - type: "spanner.googleapis.com/Database" - } - ]; - - // Output only. The encryption information for the backup. - EncryptionInfo encryption_info = 8 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The encryption information for the backup, whether it is - // protected by one or more KMS keys. The information includes all Cloud - // KMS key versions used to encrypt the backup. The `encryption_status' field - // inside of each `EncryptionInfo` is not populated. At least one of the key - // versions must be available for the backup to be restored. If a key version - // is revoked in the middle of a restore, the restore behavior is undefined. - repeated EncryptionInfo encryption_information = 13 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The database dialect information for the backup. - DatabaseDialect database_dialect = 10 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The names of the destination backups being created by copying - // this source backup. The backup names are of the form - // `projects//instances//backups/`. - // Referencing backups may exist in different instances. The existence of - // any referencing backup prevents the backup from being deleted. When the - // copy operation is done (either successfully completed or cancelled or the - // destination backup is deleted), the reference to the backup is removed. - repeated string referencing_backups = 11 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.resource_reference) = { type: "spanner.googleapis.com/Backup" } - ]; - - // Output only. The max allowed expiration time of the backup, with - // microseconds granularity. A backup's expiration time can be configured in - // multiple APIs: CreateBackup, UpdateBackup, CopyBackup. When updating or - // copying an existing backup, the expiration time specified must be - // less than `Backup.max_expire_time`. - google.protobuf.Timestamp max_expire_time = 12 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. List of backup schedule URIs that are associated with - // creating this backup. This is only applicable for scheduled backups, and - // is empty for on-demand backups. - // - // To optimize for storage, whenever possible, multiple schedules are - // collapsed together to create one backup. In such cases, this field captures - // the list of all backup schedule URIs that are associated with creating - // this backup. If collapsing is not done, then this field captures the - // single backup schedule URI associated with creating this backup. - repeated string backup_schedules = 14 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.resource_reference) = { - type: "spanner.googleapis.com/BackupSchedule" - } - ]; - - // Output only. Populated only for backups in an incremental backup chain. - // Backups share the same chain id if and only if they belong to the same - // incremental backup chain. Use this field to determine which backups are - // part of the same incremental backup chain. The ordering of backups in the - // chain can be determined by ordering the backup `version_time`. - string incremental_backup_chain_id = 17 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Data deleted at a time older than this is guaranteed not to be - // retained in order to support this backup. For a backup in an incremental - // backup chain, this is the version time of the oldest backup that exists or - // ever existed in the chain. For all other backups, this is the version time - // of the backup. This field can be used to understand what data is being - // retained by the backup system. - google.protobuf.Timestamp oldest_version_time = 18 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The instance partition(s) storing the backup. - // - // This is the same as the list of the instance partition(s) that the database - // had footprint in at the backup's `version_time`. - repeated BackupInstancePartition instance_partitions = 19 - [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// The request for -// [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup]. -message CreateBackupRequest { - // Required. The name of the instance in which the backup will be - // created. This must be the same instance that contains the database the - // backup will be created from. The backup will be stored in the - // location(s) specified in the instance configuration of this - // instance. Values are of the form - // `projects//instances/`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "spanner.googleapis.com/Instance" - } - ]; - - // Required. The id of the backup to be created. The `backup_id` appended to - // `parent` forms the full backup name of the form - // `projects//instances//backups/`. - string backup_id = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The backup to create. - Backup backup = 3 [(google.api.field_behavior) = REQUIRED]; - - // Optional. The encryption configuration used to encrypt the backup. If this - // field is not specified, the backup will use the same encryption - // configuration as the database by default, namely - // [encryption_type][google.spanner.admin.database.v1.CreateBackupEncryptionConfig.encryption_type] - // = `USE_DATABASE_ENCRYPTION`. - CreateBackupEncryptionConfig encryption_config = 4 - [(google.api.field_behavior) = OPTIONAL]; -} - -// Metadata type for the operation returned by -// [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup]. -message CreateBackupMetadata { - // The name of the backup being created. - string name = 1 [ - (google.api.resource_reference) = { type: "spanner.googleapis.com/Backup" } - ]; - - // The name of the database the backup is created from. - string database = 2 [(google.api.resource_reference) = { - type: "spanner.googleapis.com/Database" - }]; - - // The progress of the - // [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] - // operation. - OperationProgress progress = 3; - - // The time at which cancellation of this operation was received. - // [Operations.CancelOperation][google.longrunning.Operations.CancelOperation] - // starts asynchronous cancellation on a long-running operation. The server - // makes a best effort to cancel the operation, but success is not guaranteed. - // Clients can use - // [Operations.GetOperation][google.longrunning.Operations.GetOperation] or - // other methods to check whether the cancellation succeeded or whether the - // operation completed despite cancellation. On successful cancellation, - // the operation is not deleted; instead, it becomes an operation with - // an [Operation.error][google.longrunning.Operation.error] value with a - // [google.rpc.Status.code][google.rpc.Status.code] of 1, - // corresponding to `Code.CANCELLED`. - google.protobuf.Timestamp cancel_time = 4; -} - -// The request for -// [CopyBackup][google.spanner.admin.database.v1.DatabaseAdmin.CopyBackup]. -message CopyBackupRequest { - // Required. The name of the destination instance that will contain the backup - // copy. Values are of the form: `projects//instances/`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "spanner.googleapis.com/Instance" - } - ]; - - // Required. The id of the backup copy. - // The `backup_id` appended to `parent` forms the full backup_uri of the form - // `projects//instances//backups/`. - string backup_id = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The source backup to be copied. - // The source backup needs to be in READY state for it to be copied. - // Once CopyBackup is in progress, the source backup cannot be deleted or - // cleaned up on expiration until CopyBackup is finished. - // Values are of the form: - // `projects//instances//backups/`. - string source_backup = 3 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "spanner.googleapis.com/Backup" } - ]; - - // Required. The expiration time of the backup in microsecond granularity. - // The expiration time must be at least 6 hours and at most 366 days - // from the `create_time` of the source backup. Once the `expire_time` has - // passed, the backup is eligible to be automatically deleted by Cloud Spanner - // to free the resources used by the backup. - google.protobuf.Timestamp expire_time = 4 - [(google.api.field_behavior) = REQUIRED]; - - // Optional. The encryption configuration used to encrypt the backup. If this - // field is not specified, the backup will use the same encryption - // configuration as the source backup by default, namely - // [encryption_type][google.spanner.admin.database.v1.CopyBackupEncryptionConfig.encryption_type] - // = `USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION`. - CopyBackupEncryptionConfig encryption_config = 5 - [(google.api.field_behavior) = OPTIONAL]; -} - -// Metadata type for the operation returned by -// [CopyBackup][google.spanner.admin.database.v1.DatabaseAdmin.CopyBackup]. -message CopyBackupMetadata { - // The name of the backup being created through the copy operation. - // Values are of the form - // `projects//instances//backups/`. - string name = 1 [ - (google.api.resource_reference) = { type: "spanner.googleapis.com/Backup" } - ]; - - // The name of the source backup that is being copied. - // Values are of the form - // `projects//instances//backups/`. - string source_backup = 2 [ - (google.api.resource_reference) = { type: "spanner.googleapis.com/Backup" } - ]; - - // The progress of the - // [CopyBackup][google.spanner.admin.database.v1.DatabaseAdmin.CopyBackup] - // operation. - OperationProgress progress = 3; - - // The time at which cancellation of CopyBackup operation was received. - // [Operations.CancelOperation][google.longrunning.Operations.CancelOperation] - // starts asynchronous cancellation on a long-running operation. The server - // makes a best effort to cancel the operation, but success is not guaranteed. - // Clients can use - // [Operations.GetOperation][google.longrunning.Operations.GetOperation] or - // other methods to check whether the cancellation succeeded or whether the - // operation completed despite cancellation. On successful cancellation, - // the operation is not deleted; instead, it becomes an operation with - // an [Operation.error][google.longrunning.Operation.error] value with a - // [google.rpc.Status.code][google.rpc.Status.code] of 1, - // corresponding to `Code.CANCELLED`. - google.protobuf.Timestamp cancel_time = 4; -} - -// The request for -// [UpdateBackup][google.spanner.admin.database.v1.DatabaseAdmin.UpdateBackup]. -message UpdateBackupRequest { - // Required. The backup to update. `backup.name`, and the fields to be updated - // as specified by `update_mask` are required. Other fields are ignored. - // Update is only supported for the following fields: - // * `backup.expire_time`. - Backup backup = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. A mask specifying which fields (e.g. `expire_time`) in the - // Backup resource should be updated. This mask is relative to the Backup - // resource, not to the request message. The field mask must always be - // specified; this prevents any future fields from being erased accidentally - // by clients that do not know about them. - google.protobuf.FieldMask update_mask = 2 - [(google.api.field_behavior) = REQUIRED]; -} - -// The request for -// [GetBackup][google.spanner.admin.database.v1.DatabaseAdmin.GetBackup]. -message GetBackupRequest { - // Required. Name of the backup. - // Values are of the form - // `projects//instances//backups/`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "spanner.googleapis.com/Backup" } - ]; -} - -// The request for -// [DeleteBackup][google.spanner.admin.database.v1.DatabaseAdmin.DeleteBackup]. -message DeleteBackupRequest { - // Required. Name of the backup to delete. - // Values are of the form - // `projects//instances//backups/`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "spanner.googleapis.com/Backup" } - ]; -} - -// The request for -// [ListBackups][google.spanner.admin.database.v1.DatabaseAdmin.ListBackups]. -message ListBackupsRequest { - // Required. The instance to list backups from. Values are of the - // form `projects//instances/`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "spanner.googleapis.com/Instance" - } - ]; - - // An expression that filters the list of returned backups. - // - // A filter expression consists of a field name, a comparison operator, and a - // value for filtering. - // The value must be a string, a number, or a boolean. The comparison operator - // must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. - // Colon `:` is the contains operator. Filter rules are not case sensitive. - // - // The following fields in the - // [Backup][google.spanner.admin.database.v1.Backup] are eligible for - // filtering: - // - // * `name` - // * `database` - // * `state` - // * `create_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) - // * `expire_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) - // * `version_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) - // * `size_bytes` - // * `backup_schedules` - // - // You can combine multiple expressions by enclosing each expression in - // parentheses. By default, expressions are combined with AND logic, but - // you can specify AND, OR, and NOT logic explicitly. - // - // Here are a few examples: - // - // * `name:Howl` - The backup's name contains the string "howl". - // * `database:prod` - // - The database's name contains the string "prod". - // * `state:CREATING` - The backup is pending creation. - // * `state:READY` - The backup is fully created and ready for use. - // * `(name:howl) AND (create_time < \"2018-03-28T14:50:00Z\")` - // - The backup name contains the string "howl" and `create_time` - // of the backup is before 2018-03-28T14:50:00Z. - // * `expire_time < \"2018-03-28T14:50:00Z\"` - // - The backup `expire_time` is before 2018-03-28T14:50:00Z. - // * `size_bytes > 10000000000` - The backup's size is greater than 10GB - // * `backup_schedules:daily` - // - The backup is created from a schedule with "daily" in its name. - string filter = 2; - - // Number of backups to be returned in the response. If 0 or - // less, defaults to the server's maximum allowed page size. - int32 page_size = 3; - - // If non-empty, `page_token` should contain a - // [next_page_token][google.spanner.admin.database.v1.ListBackupsResponse.next_page_token] - // from a previous - // [ListBackupsResponse][google.spanner.admin.database.v1.ListBackupsResponse] - // to the same `parent` and with the same `filter`. - string page_token = 4; -} - -// The response for -// [ListBackups][google.spanner.admin.database.v1.DatabaseAdmin.ListBackups]. -message ListBackupsResponse { - // The list of matching backups. Backups returned are ordered by `create_time` - // in descending order, starting from the most recent `create_time`. - repeated Backup backups = 1; - - // `next_page_token` can be sent in a subsequent - // [ListBackups][google.spanner.admin.database.v1.DatabaseAdmin.ListBackups] - // call to fetch more of the matching backups. - string next_page_token = 2; -} - -// The request for -// [ListBackupOperations][google.spanner.admin.database.v1.DatabaseAdmin.ListBackupOperations]. -message ListBackupOperationsRequest { - // Required. The instance of the backup operations. Values are of - // the form `projects//instances/`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "spanner.googleapis.com/Instance" - } - ]; - - // An expression that filters the list of returned backup operations. - // - // A filter expression consists of a field name, a - // comparison operator, and a value for filtering. - // The value must be a string, a number, or a boolean. The comparison operator - // must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. - // Colon `:` is the contains operator. Filter rules are not case sensitive. - // - // The following fields in the [operation][google.longrunning.Operation] - // are eligible for filtering: - // - // * `name` - The name of the long-running operation - // * `done` - False if the operation is in progress, else true. - // * `metadata.@type` - the type of metadata. For example, the type string - // for - // [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata] - // is - // `type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata`. - // * `metadata.` - any field in metadata.value. - // `metadata.@type` must be specified first if filtering on metadata - // fields. - // * `error` - Error associated with the long-running operation. - // * `response.@type` - the type of response. - // * `response.` - any field in response.value. - // - // You can combine multiple expressions by enclosing each expression in - // parentheses. By default, expressions are combined with AND logic, but - // you can specify AND, OR, and NOT logic explicitly. - // - // Here are a few examples: - // - // * `done:true` - The operation is complete. - // * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \ - // `metadata.database:prod` - Returns operations where: - // * The operation's metadata type is - // [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. - // * The source database name of backup contains the string "prod". - // * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \ - // `(metadata.name:howl) AND` \ - // `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \ - // `(error:*)` - Returns operations where: - // * The operation's metadata type is - // [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. - // * The backup name contains the string "howl". - // * The operation started before 2018-03-28T14:50:00Z. - // * The operation resulted in an error. - // * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CopyBackupMetadata) AND` \ - // `(metadata.source_backup:test) AND` \ - // `(metadata.progress.start_time < \"2022-01-18T14:50:00Z\") AND` \ - // `(error:*)` - Returns operations where: - // * The operation's metadata type is - // [CopyBackupMetadata][google.spanner.admin.database.v1.CopyBackupMetadata]. - // * The source backup name contains the string "test". - // * The operation started before 2022-01-18T14:50:00Z. - // * The operation resulted in an error. - // * `((metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \ - // `(metadata.database:test_db)) OR` \ - // `((metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CopyBackupMetadata) - // AND` \ - // `(metadata.source_backup:test_bkp)) AND` \ - // `(error:*)` - Returns operations where: - // * The operation's metadata matches either of criteria: - // * The operation's metadata type is - // [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata] - // AND the source database name of the backup contains the string - // "test_db" - // * The operation's metadata type is - // [CopyBackupMetadata][google.spanner.admin.database.v1.CopyBackupMetadata] - // AND the source backup name contains the string "test_bkp" - // * The operation resulted in an error. - string filter = 2; - - // Number of operations to be returned in the response. If 0 or - // less, defaults to the server's maximum allowed page size. - int32 page_size = 3; - - // If non-empty, `page_token` should contain a - // [next_page_token][google.spanner.admin.database.v1.ListBackupOperationsResponse.next_page_token] - // from a previous - // [ListBackupOperationsResponse][google.spanner.admin.database.v1.ListBackupOperationsResponse] - // to the same `parent` and with the same `filter`. - string page_token = 4; -} - -// The response for -// [ListBackupOperations][google.spanner.admin.database.v1.DatabaseAdmin.ListBackupOperations]. -message ListBackupOperationsResponse { - // The list of matching backup [long-running - // operations][google.longrunning.Operation]. Each operation's name will be - // prefixed by the backup's name. The operation's - // [metadata][google.longrunning.Operation.metadata] field type - // `metadata.type_url` describes the type of the metadata. Operations returned - // include those that are pending or have completed/failed/canceled within the - // last 7 days. Operations returned are ordered by - // `operation.metadata.value.progress.start_time` in descending order starting - // from the most recently started operation. - repeated google.longrunning.Operation operations = 1; - - // `next_page_token` can be sent in a subsequent - // [ListBackupOperations][google.spanner.admin.database.v1.DatabaseAdmin.ListBackupOperations] - // call to fetch more of the matching metadata. - string next_page_token = 2; -} - -// Information about a backup. -message BackupInfo { - // Name of the backup. - string backup = 1 [ - (google.api.resource_reference) = { type: "spanner.googleapis.com/Backup" } - ]; - - // The backup contains an externally consistent copy of `source_database` at - // the timestamp specified by `version_time`. If the - // [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] - // request did not specify `version_time`, the `version_time` of the backup is - // equivalent to the `create_time`. - google.protobuf.Timestamp version_time = 4; - - // The time the - // [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] - // request was received. - google.protobuf.Timestamp create_time = 2; - - // Name of the database the backup was created from. - string source_database = 3 [(google.api.resource_reference) = { - type: "spanner.googleapis.com/Database" - }]; -} - -// Encryption configuration for the backup to create. -message CreateBackupEncryptionConfig { - // Encryption types for the backup. - enum EncryptionType { - // Unspecified. Do not use. - ENCRYPTION_TYPE_UNSPECIFIED = 0; - - // Use the same encryption configuration as the database. This is the - // default option when - // [encryption_config][google.spanner.admin.database.v1.CreateBackupEncryptionConfig] - // is empty. For example, if the database is using - // `Customer_Managed_Encryption`, the backup will be using the same Cloud - // KMS key as the database. - USE_DATABASE_ENCRYPTION = 1; - - // Use Google default encryption. - GOOGLE_DEFAULT_ENCRYPTION = 2; - - // Use customer managed encryption. If specified, `kms_key_name` - // must contain a valid Cloud KMS key. - CUSTOMER_MANAGED_ENCRYPTION = 3; - } - - // Required. The encryption type of the backup. - EncryptionType encryption_type = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. The Cloud KMS key that will be used to protect the backup. - // This field should be set only when - // [encryption_type][google.spanner.admin.database.v1.CreateBackupEncryptionConfig.encryption_type] - // is `CUSTOMER_MANAGED_ENCRYPTION`. Values are of the form - // `projects//locations//keyRings//cryptoKeys/`. - string kms_key_name = 2 [ - (google.api.field_behavior) = OPTIONAL, - (google.api.resource_reference) = { - type: "cloudkms.googleapis.com/CryptoKey" - } - ]; - - // Optional. Specifies the KMS configuration for the one or more keys used to - // protect the backup. Values are of the form - // `projects//locations//keyRings//cryptoKeys/`. - // - // The keys referenced by kms_key_names must fully cover all - // regions of the backup's instance configuration. Some examples: - // * For single region instance configs, specify a single regional - // location KMS key. - // * For multi-regional instance configs of type GOOGLE_MANAGED, - // either specify a multi-regional location KMS key or multiple regional - // location KMS keys that cover all regions in the instance config. - // * For an instance config of type USER_MANAGED, please specify only - // regional location KMS keys to cover each region in the instance config. - // Multi-regional location KMS keys are not supported for USER_MANAGED - // instance configs. - repeated string kms_key_names = 3 [ - (google.api.field_behavior) = OPTIONAL, - (google.api.resource_reference) = { - type: "cloudkms.googleapis.com/CryptoKey" - } - ]; -} - -// Encryption configuration for the copied backup. -message CopyBackupEncryptionConfig { - // Encryption types for the backup. - enum EncryptionType { - // Unspecified. Do not use. - ENCRYPTION_TYPE_UNSPECIFIED = 0; - - // This is the default option for - // [CopyBackup][google.spanner.admin.database.v1.DatabaseAdmin.CopyBackup] - // when - // [encryption_config][google.spanner.admin.database.v1.CopyBackupEncryptionConfig] - // is not specified. For example, if the source backup is using - // `Customer_Managed_Encryption`, the backup will be using the same Cloud - // KMS key as the source backup. - USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION = 1; - - // Use Google default encryption. - GOOGLE_DEFAULT_ENCRYPTION = 2; - - // Use customer managed encryption. If specified, either `kms_key_name` or - // `kms_key_names` must contain valid Cloud KMS key(s). - CUSTOMER_MANAGED_ENCRYPTION = 3; - } - - // Required. The encryption type of the backup. - EncryptionType encryption_type = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. The Cloud KMS key that will be used to protect the backup. - // This field should be set only when - // [encryption_type][google.spanner.admin.database.v1.CopyBackupEncryptionConfig.encryption_type] - // is `CUSTOMER_MANAGED_ENCRYPTION`. Values are of the form - // `projects//locations//keyRings//cryptoKeys/`. - string kms_key_name = 2 [ - (google.api.field_behavior) = OPTIONAL, - (google.api.resource_reference) = { - type: "cloudkms.googleapis.com/CryptoKey" - } - ]; - - // Optional. Specifies the KMS configuration for the one or more keys used to - // protect the backup. Values are of the form - // `projects//locations//keyRings//cryptoKeys/`. - // Kms keys specified can be in any order. - // - // The keys referenced by kms_key_names must fully cover all - // regions of the backup's instance configuration. Some examples: - // * For single region instance configs, specify a single regional - // location KMS key. - // * For multi-regional instance configs of type GOOGLE_MANAGED, - // either specify a multi-regional location KMS key or multiple regional - // location KMS keys that cover all regions in the instance config. - // * For an instance config of type USER_MANAGED, please specify only - // regional location KMS keys to cover each region in the instance config. - // Multi-regional location KMS keys are not supported for USER_MANAGED - // instance configs. - repeated string kms_key_names = 3 [ - (google.api.field_behavior) = OPTIONAL, - (google.api.resource_reference) = { - type: "cloudkms.googleapis.com/CryptoKey" - } - ]; -} - -// The specification for full backups. -// A full backup stores the entire contents of the database at a given -// version time. -message FullBackupSpec {} - -// The specification for incremental backup chains. -// An incremental backup stores the delta of changes between a previous -// backup and the database contents at a given version time. An -// incremental backup chain consists of a full backup and zero or more -// successive incremental backups. The first backup created for an -// incremental backup chain is always a full backup. -message IncrementalBackupSpec {} - -// Instance partition information for the backup. -message BackupInstancePartition { - // A unique identifier for the instance partition. Values are of the form - // `projects//instances//instancePartitions/` - string instance_partition = 1 [(google.api.resource_reference) = { - type: "spanner.googleapis.com/InstancePartition" - }]; -} diff --git a/owl-bot-staging/executor/v1/protos/google/spanner/admin/database/v1/backup_schedule.proto b/owl-bot-staging/executor/v1/protos/google/spanner/admin/database/v1/backup_schedule.proto deleted file mode 100644 index c273516ae..000000000 --- a/owl-bot-staging/executor/v1/protos/google/spanner/admin/database/v1/backup_schedule.proto +++ /dev/null @@ -1,230 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.spanner.admin.database.v1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/field_mask.proto"; -import "google/protobuf/timestamp.proto"; -import "google/spanner/admin/database/v1/backup.proto"; - -option csharp_namespace = "Google.Cloud.Spanner.Admin.Database.V1"; -option go_package = "cloud.google.com/go/spanner/admin/database/apiv1/databasepb;databasepb"; -option java_multiple_files = true; -option java_outer_classname = "BackupScheduleProto"; -option java_package = "com.google.spanner.admin.database.v1"; -option php_namespace = "Google\\Cloud\\Spanner\\Admin\\Database\\V1"; -option ruby_package = "Google::Cloud::Spanner::Admin::Database::V1"; - -// Defines specifications of the backup schedule. -message BackupScheduleSpec { - // Required. - oneof schedule_spec { - // Cron style schedule specification. - CrontabSpec cron_spec = 1; - } -} - -// BackupSchedule expresses the automated backup creation specification for a -// Spanner database. -// Next ID: 10 -message BackupSchedule { - option (google.api.resource) = { - type: "spanner.googleapis.com/BackupSchedule" - pattern: "projects/{project}/instances/{instance}/databases/{database}/backupSchedules/{schedule}" - plural: "backupSchedules" - singular: "backupSchedule" - }; - - // Identifier. Output only for the - // [CreateBackupSchedule][DatabaseAdmin.CreateBackupSchededule] operation. - // Required for the - // [UpdateBackupSchedule][google.spanner.admin.database.v1.DatabaseAdmin.UpdateBackupSchedule] - // operation. A globally unique identifier for the backup schedule which - // cannot be changed. Values are of the form - // `projects//instances//databases//backupSchedules/[a-z][a-z0-9_\-]*[a-z0-9]` - // The final segment of the name must be between 2 and 60 characters in - // length. - string name = 1 [(google.api.field_behavior) = IDENTIFIER]; - - // Optional. The schedule specification based on which the backup creations - // are triggered. - BackupScheduleSpec spec = 6 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The retention duration of a backup that must be at least 6 hours - // and at most 366 days. The backup is eligible to be automatically deleted - // once the retention period has elapsed. - google.protobuf.Duration retention_duration = 3 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The encryption configuration that will be used to encrypt the - // backup. If this field is not specified, the backup will use the same - // encryption configuration as the database. - CreateBackupEncryptionConfig encryption_config = 4 - [(google.api.field_behavior) = OPTIONAL]; - - // Required. Backup type spec determines the type of backup that is created by - // the backup schedule. Currently, only full backups are supported. - oneof backup_type_spec { - // The schedule creates only full backups. - FullBackupSpec full_backup_spec = 7; - - // The schedule creates incremental backup chains. - IncrementalBackupSpec incremental_backup_spec = 8; - } - - // Output only. The timestamp at which the schedule was last updated. - // If the schedule has never been updated, this field contains the timestamp - // when the schedule was first created. - google.protobuf.Timestamp update_time = 9 - [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// CrontabSpec can be used to specify the version time and frequency at -// which the backup should be created. -message CrontabSpec { - // Required. Textual representation of the crontab. User can customize the - // backup frequency and the backup version time using the cron - // expression. The version time must be in UTC timezone. - // - // The backup will contain an externally consistent copy of the - // database at the version time. Allowed frequencies are 12 hour, 1 day, - // 1 week and 1 month. Examples of valid cron specifications: - // * `0 2/12 * * * ` : every 12 hours at (2, 14) hours past midnight in UTC. - // * `0 2,14 * * * ` : every 12 hours at (2,14) hours past midnight in UTC. - // * `0 2 * * * ` : once a day at 2 past midnight in UTC. - // * `0 2 * * 0 ` : once a week every Sunday at 2 past midnight in UTC. - // * `0 2 8 * * ` : once a month on 8th day at 2 past midnight in UTC. - string text = 1 [(google.api.field_behavior) = REQUIRED]; - - // Output only. The time zone of the times in `CrontabSpec.text`. Currently - // only UTC is supported. - string time_zone = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Schedule backups will contain an externally consistent copy - // of the database at the version time specified in - // `schedule_spec.cron_spec`. However, Spanner may not initiate the creation - // of the scheduled backups at that version time. Spanner will initiate - // the creation of scheduled backups within the time window bounded by the - // version_time specified in `schedule_spec.cron_spec` and version_time + - // `creation_window`. - google.protobuf.Duration creation_window = 3 - [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// The request for -// [CreateBackupSchedule][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackupSchedule]. -message CreateBackupScheduleRequest { - // Required. The name of the database that this backup schedule applies to. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "spanner.googleapis.com/Database" - } - ]; - - // Required. The Id to use for the backup schedule. The `backup_schedule_id` - // appended to `parent` forms the full backup schedule name of the form - // `projects//instances//databases//backupSchedules/`. - string backup_schedule_id = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The backup schedule to create. - BackupSchedule backup_schedule = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// The request for -// [GetBackupSchedule][google.spanner.admin.database.v1.DatabaseAdmin.GetBackupSchedule]. -message GetBackupScheduleRequest { - // Required. The name of the schedule to retrieve. - // Values are of the form - // `projects//instances//databases//backupSchedules/`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "spanner.googleapis.com/BackupSchedule" - } - ]; -} - -// The request for -// [DeleteBackupSchedule][google.spanner.admin.database.v1.DatabaseAdmin.DeleteBackupSchedule]. -message DeleteBackupScheduleRequest { - // Required. The name of the schedule to delete. - // Values are of the form - // `projects//instances//databases//backupSchedules/`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "spanner.googleapis.com/BackupSchedule" - } - ]; -} - -// The request for -// [ListBackupSchedules][google.spanner.admin.database.v1.DatabaseAdmin.ListBackupSchedules]. -message ListBackupSchedulesRequest { - // Required. Database is the parent resource whose backup schedules should be - // listed. Values are of the form - // projects//instances//databases/ - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "spanner.googleapis.com/Database" - } - ]; - - // Optional. Number of backup schedules to be returned in the response. If 0 - // or less, defaults to the server's maximum allowed page size. - int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If non-empty, `page_token` should contain a - // [next_page_token][google.spanner.admin.database.v1.ListBackupSchedulesResponse.next_page_token] - // from a previous - // [ListBackupSchedulesResponse][google.spanner.admin.database.v1.ListBackupSchedulesResponse] - // to the same `parent`. - string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; -} - -// The response for -// [ListBackupSchedules][google.spanner.admin.database.v1.DatabaseAdmin.ListBackupSchedules]. -message ListBackupSchedulesResponse { - // The list of backup schedules for a database. - repeated BackupSchedule backup_schedules = 1; - - // `next_page_token` can be sent in a subsequent - // [ListBackupSchedules][google.spanner.admin.database.v1.DatabaseAdmin.ListBackupSchedules] - // call to fetch more of the schedules. - string next_page_token = 2; -} - -// The request for -// [UpdateBackupScheduleRequest][google.spanner.admin.database.v1.DatabaseAdmin.UpdateBackupSchedule]. -message UpdateBackupScheduleRequest { - // Required. The backup schedule to update. `backup_schedule.name`, and the - // fields to be updated as specified by `update_mask` are required. Other - // fields are ignored. - BackupSchedule backup_schedule = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. A mask specifying which fields in the BackupSchedule resource - // should be updated. This mask is relative to the BackupSchedule resource, - // not to the request message. The field mask must always be - // specified; this prevents any future fields from being erased - // accidentally. - google.protobuf.FieldMask update_mask = 2 - [(google.api.field_behavior) = REQUIRED]; -} diff --git a/owl-bot-staging/executor/v1/protos/google/spanner/admin/database/v1/common.proto b/owl-bot-staging/executor/v1/protos/google/spanner/admin/database/v1/common.proto deleted file mode 100644 index c494b8cf7..000000000 --- a/owl-bot-staging/executor/v1/protos/google/spanner/admin/database/v1/common.proto +++ /dev/null @@ -1,132 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.spanner.admin.database.v1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/protobuf/timestamp.proto"; -import "google/rpc/status.proto"; - -option csharp_namespace = "Google.Cloud.Spanner.Admin.Database.V1"; -option go_package = "cloud.google.com/go/spanner/admin/database/apiv1/databasepb;databasepb"; -option java_multiple_files = true; -option java_outer_classname = "CommonProto"; -option java_package = "com.google.spanner.admin.database.v1"; -option php_namespace = "Google\\Cloud\\Spanner\\Admin\\Database\\V1"; -option ruby_package = "Google::Cloud::Spanner::Admin::Database::V1"; -option (google.api.resource_definition) = { - type: "cloudkms.googleapis.com/CryptoKey" - pattern: "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}" -}; -option (google.api.resource_definition) = { - type: "cloudkms.googleapis.com/CryptoKeyVersion" - pattern: "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}" -}; - -// Encapsulates progress related information for a Cloud Spanner long -// running operation. -message OperationProgress { - // Percent completion of the operation. - // Values are between 0 and 100 inclusive. - int32 progress_percent = 1; - - // Time the request was received. - google.protobuf.Timestamp start_time = 2; - - // If set, the time at which this operation failed or was completed - // successfully. - google.protobuf.Timestamp end_time = 3; -} - -// Encryption configuration for a Cloud Spanner database. -message EncryptionConfig { - // The Cloud KMS key to be used for encrypting and decrypting - // the database. Values are of the form - // `projects//locations//keyRings//cryptoKeys/`. - string kms_key_name = 2 [(google.api.resource_reference) = { - type: "cloudkms.googleapis.com/CryptoKey" - }]; - - // Specifies the KMS configuration for the one or more keys used to encrypt - // the database. Values are of the form - // `projects//locations//keyRings//cryptoKeys/`. - // - // The keys referenced by kms_key_names must fully cover all - // regions of the database instance configuration. Some examples: - // * For single region database instance configs, specify a single regional - // location KMS key. - // * For multi-regional database instance configs of type GOOGLE_MANAGED, - // either specify a multi-regional location KMS key or multiple regional - // location KMS keys that cover all regions in the instance config. - // * For a database instance config of type USER_MANAGED, please specify only - // regional location KMS keys to cover each region in the instance config. - // Multi-regional location KMS keys are not supported for USER_MANAGED - // instance configs. - repeated string kms_key_names = 3 [(google.api.resource_reference) = { - type: "cloudkms.googleapis.com/CryptoKey" - }]; -} - -// Encryption information for a Cloud Spanner database or backup. -message EncryptionInfo { - // Possible encryption types. - enum Type { - // Encryption type was not specified, though data at rest remains encrypted. - TYPE_UNSPECIFIED = 0; - - // The data is encrypted at rest with a key that is - // fully managed by Google. No key version or status will be populated. - // This is the default state. - GOOGLE_DEFAULT_ENCRYPTION = 1; - - // The data is encrypted at rest with a key that is - // managed by the customer. The active version of the key. `kms_key_version` - // will be populated, and `encryption_status` may be populated. - CUSTOMER_MANAGED_ENCRYPTION = 2; - } - - // Output only. The type of encryption. - Type encryption_type = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. If present, the status of a recent encrypt/decrypt call on - // underlying data for this database or backup. Regardless of status, data is - // always encrypted at rest. - google.rpc.Status encryption_status = 4 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. A Cloud KMS key version that is being used to protect the - // database or backup. - string kms_key_version = 2 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.resource_reference) = { - type: "cloudkms.googleapis.com/CryptoKeyVersion" - } - ]; -} - -// Indicates the dialect type of a database. -enum DatabaseDialect { - // Default value. This value will create a database with the - // GOOGLE_STANDARD_SQL dialect. - DATABASE_DIALECT_UNSPECIFIED = 0; - - // GoogleSQL supported SQL. - GOOGLE_STANDARD_SQL = 1; - - // PostgreSQL supported SQL. - POSTGRESQL = 2; -} diff --git a/owl-bot-staging/executor/v1/protos/google/spanner/admin/database/v1/spanner_database_admin.proto b/owl-bot-staging/executor/v1/protos/google/spanner/admin/database/v1/spanner_database_admin.proto deleted file mode 100644 index d41a4114c..000000000 --- a/owl-bot-staging/executor/v1/protos/google/spanner/admin/database/v1/spanner_database_admin.proto +++ /dev/null @@ -1,1314 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.spanner.admin.database.v1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/iam/v1/iam_policy.proto"; -import "google/iam/v1/policy.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/empty.proto"; -import "google/protobuf/field_mask.proto"; -import "google/protobuf/struct.proto"; -import "google/protobuf/timestamp.proto"; -import "google/rpc/status.proto"; -import "google/spanner/admin/database/v1/backup.proto"; -import "google/spanner/admin/database/v1/backup_schedule.proto"; -import "google/spanner/admin/database/v1/common.proto"; - -option csharp_namespace = "Google.Cloud.Spanner.Admin.Database.V1"; -option go_package = "cloud.google.com/go/spanner/admin/database/apiv1/databasepb;databasepb"; -option java_multiple_files = true; -option java_outer_classname = "SpannerDatabaseAdminProto"; -option java_package = "com.google.spanner.admin.database.v1"; -option php_namespace = "Google\\Cloud\\Spanner\\Admin\\Database\\V1"; -option ruby_package = "Google::Cloud::Spanner::Admin::Database::V1"; -option (google.api.resource_definition) = { - type: "spanner.googleapis.com/Instance" - pattern: "projects/{project}/instances/{instance}" -}; -option (google.api.resource_definition) = { - type: "spanner.googleapis.com/InstancePartition" - pattern: "projects/{project}/instances/{instance}/instancePartitions/{instance_partition}" -}; - -// Cloud Spanner Database Admin API -// -// The Cloud Spanner Database Admin API can be used to: -// * create, drop, and list databases -// * update the schema of pre-existing databases -// * create, delete, copy and list backups for a database -// * restore a database from an existing backup -service DatabaseAdmin { - option (google.api.default_host) = "spanner.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform," - "https://www.googleapis.com/auth/spanner.admin"; - - // Lists Cloud Spanner databases. - rpc ListDatabases(ListDatabasesRequest) returns (ListDatabasesResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/instances/*}/databases" - }; - option (google.api.method_signature) = "parent"; - } - - // Creates a new Cloud Spanner database and starts to prepare it for serving. - // The returned [long-running operation][google.longrunning.Operation] will - // have a name of the format `/operations/` and - // can be used to track preparation of the database. The - // [metadata][google.longrunning.Operation.metadata] field type is - // [CreateDatabaseMetadata][google.spanner.admin.database.v1.CreateDatabaseMetadata]. - // The [response][google.longrunning.Operation.response] field type is - // [Database][google.spanner.admin.database.v1.Database], if successful. - rpc CreateDatabase(CreateDatabaseRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/instances/*}/databases" - body: "*" - }; - option (google.api.method_signature) = "parent,create_statement"; - option (google.longrunning.operation_info) = { - response_type: "google.spanner.admin.database.v1.Database" - metadata_type: "google.spanner.admin.database.v1.CreateDatabaseMetadata" - }; - } - - // Gets the state of a Cloud Spanner database. - rpc GetDatabase(GetDatabaseRequest) returns (Database) { - option (google.api.http) = { - get: "/v1/{name=projects/*/instances/*/databases/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Updates a Cloud Spanner database. The returned - // [long-running operation][google.longrunning.Operation] can be used to track - // the progress of updating the database. If the named database does not - // exist, returns `NOT_FOUND`. - // - // While the operation is pending: - // - // * The database's - // [reconciling][google.spanner.admin.database.v1.Database.reconciling] - // field is set to true. - // * Cancelling the operation is best-effort. If the cancellation succeeds, - // the operation metadata's - // [cancel_time][google.spanner.admin.database.v1.UpdateDatabaseMetadata.cancel_time] - // is set, the updates are reverted, and the operation terminates with a - // `CANCELLED` status. - // * New UpdateDatabase requests will return a `FAILED_PRECONDITION` error - // until the pending operation is done (returns successfully or with - // error). - // * Reading the database via the API continues to give the pre-request - // values. - // - // Upon completion of the returned operation: - // - // * The new values are in effect and readable via the API. - // * The database's - // [reconciling][google.spanner.admin.database.v1.Database.reconciling] - // field becomes false. - // - // The returned [long-running operation][google.longrunning.Operation] will - // have a name of the format - // `projects//instances//databases//operations/` - // and can be used to track the database modification. The - // [metadata][google.longrunning.Operation.metadata] field type is - // [UpdateDatabaseMetadata][google.spanner.admin.database.v1.UpdateDatabaseMetadata]. - // The [response][google.longrunning.Operation.response] field type is - // [Database][google.spanner.admin.database.v1.Database], if successful. - rpc UpdateDatabase(UpdateDatabaseRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - patch: "/v1/{database.name=projects/*/instances/*/databases/*}" - body: "database" - }; - option (google.api.method_signature) = "database,update_mask"; - option (google.longrunning.operation_info) = { - response_type: "Database" - metadata_type: "UpdateDatabaseMetadata" - }; - } - - // Updates the schema of a Cloud Spanner database by - // creating/altering/dropping tables, columns, indexes, etc. The returned - // [long-running operation][google.longrunning.Operation] will have a name of - // the format `/operations/` and can be used to - // track execution of the schema change(s). The - // [metadata][google.longrunning.Operation.metadata] field type is - // [UpdateDatabaseDdlMetadata][google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata]. - // The operation has no response. - rpc UpdateDatabaseDdl(UpdateDatabaseDdlRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - patch: "/v1/{database=projects/*/instances/*/databases/*}/ddl" - body: "*" - }; - option (google.api.method_signature) = "database,statements"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata" - }; - } - - // Drops (aka deletes) a Cloud Spanner database. - // Completed backups for the database will be retained according to their - // `expire_time`. - // Note: Cloud Spanner might continue to accept requests for a few seconds - // after the database has been deleted. - rpc DropDatabase(DropDatabaseRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1/{database=projects/*/instances/*/databases/*}" - }; - option (google.api.method_signature) = "database"; - } - - // Returns the schema of a Cloud Spanner database as a list of formatted - // DDL statements. This method does not show pending schema updates, those may - // be queried using the [Operations][google.longrunning.Operations] API. - rpc GetDatabaseDdl(GetDatabaseDdlRequest) returns (GetDatabaseDdlResponse) { - option (google.api.http) = { - get: "/v1/{database=projects/*/instances/*/databases/*}/ddl" - }; - option (google.api.method_signature) = "database"; - } - - // Sets the access control policy on a database or backup resource. - // Replaces any existing policy. - // - // Authorization requires `spanner.databases.setIamPolicy` - // permission on [resource][google.iam.v1.SetIamPolicyRequest.resource]. - // For backups, authorization requires `spanner.backups.setIamPolicy` - // permission on [resource][google.iam.v1.SetIamPolicyRequest.resource]. - rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) - returns (google.iam.v1.Policy) { - option (google.api.http) = { - post: "/v1/{resource=projects/*/instances/*/databases/*}:setIamPolicy" - body: "*" - additional_bindings { - post: "/v1/{resource=projects/*/instances/*/backups/*}:setIamPolicy" - body: "*" - } - additional_bindings { - post: "/v1/{resource=projects/*/instances/*/databases/*/backupSchedules/*}:setIamPolicy" - body: "*" - } - }; - option (google.api.method_signature) = "resource,policy"; - } - - // Gets the access control policy for a database or backup resource. - // Returns an empty policy if a database or backup exists but does not have a - // policy set. - // - // Authorization requires `spanner.databases.getIamPolicy` permission on - // [resource][google.iam.v1.GetIamPolicyRequest.resource]. - // For backups, authorization requires `spanner.backups.getIamPolicy` - // permission on [resource][google.iam.v1.GetIamPolicyRequest.resource]. - rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) - returns (google.iam.v1.Policy) { - option (google.api.http) = { - post: "/v1/{resource=projects/*/instances/*/databases/*}:getIamPolicy" - body: "*" - additional_bindings { - post: "/v1/{resource=projects/*/instances/*/backups/*}:getIamPolicy" - body: "*" - } - additional_bindings { - post: "/v1/{resource=projects/*/instances/*/databases/*/backupSchedules/*}:getIamPolicy" - body: "*" - } - }; - option (google.api.method_signature) = "resource"; - } - - // Returns permissions that the caller has on the specified database or backup - // resource. - // - // Attempting this RPC on a non-existent Cloud Spanner database will - // result in a NOT_FOUND error if the user has - // `spanner.databases.list` permission on the containing Cloud - // Spanner instance. Otherwise returns an empty set of permissions. - // Calling this method on a backup that does not exist will - // result in a NOT_FOUND error if the user has - // `spanner.backups.list` permission on the containing instance. - rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) - returns (google.iam.v1.TestIamPermissionsResponse) { - option (google.api.http) = { - post: "/v1/{resource=projects/*/instances/*/databases/*}:testIamPermissions" - body: "*" - additional_bindings { - post: "/v1/{resource=projects/*/instances/*/backups/*}:testIamPermissions" - body: "*" - } - additional_bindings { - post: "/v1/{resource=projects/*/instances/*/databases/*/backupSchedules/*}:testIamPermissions" - body: "*" - } - additional_bindings { - post: "/v1/{resource=projects/*/instances/*/databases/*/databaseRoles/*}:testIamPermissions" - body: "*" - } - }; - option (google.api.method_signature) = "resource,permissions"; - } - - // Starts creating a new Cloud Spanner Backup. - // The returned backup [long-running operation][google.longrunning.Operation] - // will have a name of the format - // `projects//instances//backups//operations/` - // and can be used to track creation of the backup. The - // [metadata][google.longrunning.Operation.metadata] field type is - // [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. - // The [response][google.longrunning.Operation.response] field type is - // [Backup][google.spanner.admin.database.v1.Backup], if successful. - // Cancelling the returned operation will stop the creation and delete the - // backup. There can be only one pending backup creation per database. Backup - // creation of different databases can run concurrently. - rpc CreateBackup(CreateBackupRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/instances/*}/backups" - body: "backup" - }; - option (google.api.method_signature) = "parent,backup,backup_id"; - option (google.longrunning.operation_info) = { - response_type: "google.spanner.admin.database.v1.Backup" - metadata_type: "google.spanner.admin.database.v1.CreateBackupMetadata" - }; - } - - // Starts copying a Cloud Spanner Backup. - // The returned backup [long-running operation][google.longrunning.Operation] - // will have a name of the format - // `projects//instances//backups//operations/` - // and can be used to track copying of the backup. The operation is associated - // with the destination backup. - // The [metadata][google.longrunning.Operation.metadata] field type is - // [CopyBackupMetadata][google.spanner.admin.database.v1.CopyBackupMetadata]. - // The [response][google.longrunning.Operation.response] field type is - // [Backup][google.spanner.admin.database.v1.Backup], if successful. - // Cancelling the returned operation will stop the copying and delete the - // destination backup. Concurrent CopyBackup requests can run on the same - // source backup. - rpc CopyBackup(CopyBackupRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/instances/*}/backups:copy" - body: "*" - }; - option (google.api.method_signature) = - "parent,backup_id,source_backup,expire_time"; - option (google.longrunning.operation_info) = { - response_type: "google.spanner.admin.database.v1.Backup" - metadata_type: "google.spanner.admin.database.v1.CopyBackupMetadata" - }; - } - - // Gets metadata on a pending or completed - // [Backup][google.spanner.admin.database.v1.Backup]. - rpc GetBackup(GetBackupRequest) returns (Backup) { - option (google.api.http) = { - get: "/v1/{name=projects/*/instances/*/backups/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Updates a pending or completed - // [Backup][google.spanner.admin.database.v1.Backup]. - rpc UpdateBackup(UpdateBackupRequest) returns (Backup) { - option (google.api.http) = { - patch: "/v1/{backup.name=projects/*/instances/*/backups/*}" - body: "backup" - }; - option (google.api.method_signature) = "backup,update_mask"; - } - - // Deletes a pending or completed - // [Backup][google.spanner.admin.database.v1.Backup]. - rpc DeleteBackup(DeleteBackupRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/instances/*/backups/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists completed and pending backups. - // Backups returned are ordered by `create_time` in descending order, - // starting from the most recent `create_time`. - rpc ListBackups(ListBackupsRequest) returns (ListBackupsResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/instances/*}/backups" - }; - option (google.api.method_signature) = "parent"; - } - - // Create a new database by restoring from a completed backup. The new - // database must be in the same project and in an instance with the same - // instance configuration as the instance containing - // the backup. The returned database [long-running - // operation][google.longrunning.Operation] has a name of the format - // `projects//instances//databases//operations/`, - // and can be used to track the progress of the operation, and to cancel it. - // The [metadata][google.longrunning.Operation.metadata] field type is - // [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata]. - // The [response][google.longrunning.Operation.response] type - // is [Database][google.spanner.admin.database.v1.Database], if - // successful. Cancelling the returned operation will stop the restore and - // delete the database. - // There can be only one database being restored into an instance at a time. - // Once the restore operation completes, a new restore operation can be - // initiated, without waiting for the optimize operation associated with the - // first restore to complete. - rpc RestoreDatabase(RestoreDatabaseRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/instances/*}/databases:restore" - body: "*" - }; - option (google.api.method_signature) = "parent,database_id,backup"; - option (google.longrunning.operation_info) = { - response_type: "google.spanner.admin.database.v1.Database" - metadata_type: "google.spanner.admin.database.v1.RestoreDatabaseMetadata" - }; - } - - // Lists database [longrunning-operations][google.longrunning.Operation]. - // A database operation has a name of the form - // `projects//instances//databases//operations/`. - // The long-running operation - // [metadata][google.longrunning.Operation.metadata] field type - // `metadata.type_url` describes the type of the metadata. Operations returned - // include those that have completed/failed/canceled within the last 7 days, - // and pending operations. - rpc ListDatabaseOperations(ListDatabaseOperationsRequest) - returns (ListDatabaseOperationsResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/instances/*}/databaseOperations" - }; - option (google.api.method_signature) = "parent"; - } - - // Lists the backup [long-running operations][google.longrunning.Operation] in - // the given instance. A backup operation has a name of the form - // `projects//instances//backups//operations/`. - // The long-running operation - // [metadata][google.longrunning.Operation.metadata] field type - // `metadata.type_url` describes the type of the metadata. Operations returned - // include those that have completed/failed/canceled within the last 7 days, - // and pending operations. Operations returned are ordered by - // `operation.metadata.value.progress.start_time` in descending order starting - // from the most recently started operation. - rpc ListBackupOperations(ListBackupOperationsRequest) - returns (ListBackupOperationsResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/instances/*}/backupOperations" - }; - option (google.api.method_signature) = "parent"; - } - - // Lists Cloud Spanner database roles. - rpc ListDatabaseRoles(ListDatabaseRolesRequest) - returns (ListDatabaseRolesResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/instances/*/databases/*}/databaseRoles" - }; - option (google.api.method_signature) = "parent"; - } - - // Adds split points to specified tables, indexes of a database. - rpc AddSplitPoints(AddSplitPointsRequest) returns (AddSplitPointsResponse) { - option (google.api.http) = { - post: "/v1/{database=projects/*/instances/*/databases/*}:addSplitPoints" - body: "*" - }; - option (google.api.method_signature) = "database,split_points"; - } - - // Creates a new backup schedule. - rpc CreateBackupSchedule(CreateBackupScheduleRequest) - returns (BackupSchedule) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/instances/*/databases/*}/backupSchedules" - body: "backup_schedule" - }; - option (google.api.method_signature) = - "parent,backup_schedule,backup_schedule_id"; - } - - // Gets backup schedule for the input schedule name. - rpc GetBackupSchedule(GetBackupScheduleRequest) returns (BackupSchedule) { - option (google.api.http) = { - get: "/v1/{name=projects/*/instances/*/databases/*/backupSchedules/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Updates a backup schedule. - rpc UpdateBackupSchedule(UpdateBackupScheduleRequest) - returns (BackupSchedule) { - option (google.api.http) = { - patch: "/v1/{backup_schedule.name=projects/*/instances/*/databases/*/backupSchedules/*}" - body: "backup_schedule" - }; - option (google.api.method_signature) = "backup_schedule,update_mask"; - } - - // Deletes a backup schedule. - rpc DeleteBackupSchedule(DeleteBackupScheduleRequest) - returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/instances/*/databases/*/backupSchedules/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists all the backup schedules for the database. - rpc ListBackupSchedules(ListBackupSchedulesRequest) - returns (ListBackupSchedulesResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/instances/*/databases/*}/backupSchedules" - }; - option (google.api.method_signature) = "parent"; - } - - // This is an internal API called by Spanner Graph jobs. You should never need - // to call this API directly. - rpc InternalUpdateGraphOperation(InternalUpdateGraphOperationRequest) - returns (InternalUpdateGraphOperationResponse) { - option (google.api.method_signature) = "database,operation_id"; - } -} - -// Information about the database restore. -message RestoreInfo { - // The type of the restore source. - RestoreSourceType source_type = 1; - - // Information about the source used to restore the database. - oneof source_info { - // Information about the backup used to restore the database. The backup - // may no longer exist. - BackupInfo backup_info = 2; - } -} - -// A Cloud Spanner database. -message Database { - option (google.api.resource) = { - type: "spanner.googleapis.com/Database" - pattern: "projects/{project}/instances/{instance}/databases/{database}" - }; - - // Indicates the current state of the database. - enum State { - // Not specified. - STATE_UNSPECIFIED = 0; - - // The database is still being created. Operations on the database may fail - // with `FAILED_PRECONDITION` in this state. - CREATING = 1; - - // The database is fully created and ready for use. - READY = 2; - - // The database is fully created and ready for use, but is still - // being optimized for performance and cannot handle full load. - // - // In this state, the database still references the backup - // it was restore from, preventing the backup - // from being deleted. When optimizations are complete, the full performance - // of the database will be restored, and the database will transition to - // `READY` state. - READY_OPTIMIZING = 3; - } - - // Required. The name of the database. Values are of the form - // `projects//instances//databases/`, - // where `` is as specified in the `CREATE DATABASE` - // statement. This name can be passed to other API methods to - // identify the database. - string name = 1 [(google.api.field_behavior) = REQUIRED]; - - // Output only. The current database state. - State state = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. If exists, the time at which the database creation started. - google.protobuf.Timestamp create_time = 3 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Applicable only for restored databases. Contains information - // about the restore source. - RestoreInfo restore_info = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. For databases that are using customer managed encryption, this - // field contains the encryption configuration for the database. - // For databases that are using Google default or other types of encryption, - // this field is empty. - EncryptionConfig encryption_config = 5 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. For databases that are using customer managed encryption, this - // field contains the encryption information for the database, such as - // all Cloud KMS key versions that are in use. The `encryption_status' field - // inside of each `EncryptionInfo` is not populated. - // - // For databases that are using Google default or other types of encryption, - // this field is empty. - // - // This field is propagated lazily from the backend. There might be a delay - // from when a key version is being used and when it appears in this field. - repeated EncryptionInfo encryption_info = 8 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The period in which Cloud Spanner retains all versions of data - // for the database. This is the same as the value of version_retention_period - // database option set using - // [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl]. - // Defaults to 1 hour, if not set. - string version_retention_period = 6 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Earliest timestamp at which older versions of the data can be - // read. This value is continuously updated by Cloud Spanner and becomes stale - // the moment it is queried. If you are using this value to recover data, make - // sure to account for the time from the moment when the value is queried to - // the moment when you initiate the recovery. - google.protobuf.Timestamp earliest_version_time = 7 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The read-write region which contains the database's leader - // replicas. - // - // This is the same as the value of default_leader - // database option set using DatabaseAdmin.CreateDatabase or - // DatabaseAdmin.UpdateDatabaseDdl. If not explicitly set, this is empty. - string default_leader = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The dialect of the Cloud Spanner Database. - DatabaseDialect database_dialect = 10 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Whether drop protection is enabled for this database. Defaults to false, - // if not set. For more details, please see how to [prevent accidental - // database - // deletion](https://cloud.google.com/spanner/docs/prevent-database-deletion). - bool enable_drop_protection = 11; - - // Output only. If true, the database is being updated. If false, there are no - // ongoing update operations for the database. - bool reconciling = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// The request for -// [ListDatabases][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabases]. -message ListDatabasesRequest { - // Required. The instance whose databases should be listed. - // Values are of the form `projects//instances/`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "spanner.googleapis.com/Instance" - } - ]; - - // Number of databases to be returned in the response. If 0 or less, - // defaults to the server's maximum allowed page size. - int32 page_size = 3; - - // If non-empty, `page_token` should contain a - // [next_page_token][google.spanner.admin.database.v1.ListDatabasesResponse.next_page_token] - // from a previous - // [ListDatabasesResponse][google.spanner.admin.database.v1.ListDatabasesResponse]. - string page_token = 4; -} - -// The response for -// [ListDatabases][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabases]. -message ListDatabasesResponse { - // Databases that matched the request. - repeated Database databases = 1; - - // `next_page_token` can be sent in a subsequent - // [ListDatabases][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabases] - // call to fetch more of the matching databases. - string next_page_token = 2; -} - -// The request for -// [CreateDatabase][google.spanner.admin.database.v1.DatabaseAdmin.CreateDatabase]. -message CreateDatabaseRequest { - // Required. The name of the instance that will serve the new database. - // Values are of the form `projects//instances/`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "spanner.googleapis.com/Instance" - } - ]; - - // Required. A `CREATE DATABASE` statement, which specifies the ID of the - // new database. The database ID must conform to the regular expression - // `[a-z][a-z0-9_\-]*[a-z0-9]` and be between 2 and 30 characters in length. - // If the database ID is a reserved word or if it contains a hyphen, the - // database ID must be enclosed in backticks (`` ` ``). - string create_statement = 2 [(google.api.field_behavior) = REQUIRED]; - - // Optional. A list of DDL statements to run inside the newly created - // database. Statements can create tables, indexes, etc. These - // statements execute atomically with the creation of the database: - // if there is an error in any statement, the database is not created. - repeated string extra_statements = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The encryption configuration for the database. If this field is - // not specified, Cloud Spanner will encrypt/decrypt all data at rest using - // Google default encryption. - EncryptionConfig encryption_config = 4 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The dialect of the Cloud Spanner Database. - DatabaseDialect database_dialect = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Proto descriptors used by CREATE/ALTER PROTO BUNDLE statements in - // 'extra_statements' above. - // Contains a protobuf-serialized - // [google.protobuf.FileDescriptorSet](https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/descriptor.proto). - // To generate it, [install](https://grpc.io/docs/protoc-installation/) and - // run `protoc` with --include_imports and --descriptor_set_out. For example, - // to generate for moon/shot/app.proto, run - // ``` - // $protoc --proto_path=/app_path --proto_path=/lib_path \ - // --include_imports \ - // --descriptor_set_out=descriptors.data \ - // moon/shot/app.proto - // ``` - // For more details, see protobuffer [self - // description](https://developers.google.com/protocol-buffers/docs/techniques#self-description). - bytes proto_descriptors = 6 [(google.api.field_behavior) = OPTIONAL]; -} - -// Metadata type for the operation returned by -// [CreateDatabase][google.spanner.admin.database.v1.DatabaseAdmin.CreateDatabase]. -message CreateDatabaseMetadata { - // The database being created. - string database = 1 [(google.api.resource_reference) = { - type: "spanner.googleapis.com/Database" - }]; -} - -// The request for -// [GetDatabase][google.spanner.admin.database.v1.DatabaseAdmin.GetDatabase]. -message GetDatabaseRequest { - // Required. The name of the requested database. Values are of the form - // `projects//instances//databases/`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "spanner.googleapis.com/Database" - } - ]; -} - -// The request for -// [UpdateDatabase][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabase]. -message UpdateDatabaseRequest { - // Required. The database to update. - // The `name` field of the database is of the form - // `projects//instances//databases/`. - Database database = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The list of fields to update. Currently, only - // `enable_drop_protection` field can be updated. - google.protobuf.FieldMask update_mask = 2 - [(google.api.field_behavior) = REQUIRED]; -} - -// Metadata type for the operation returned by -// [UpdateDatabase][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabase]. -message UpdateDatabaseMetadata { - // The request for - // [UpdateDatabase][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabase]. - UpdateDatabaseRequest request = 1; - - // The progress of the - // [UpdateDatabase][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabase] - // operation. - OperationProgress progress = 2; - - // The time at which this operation was cancelled. If set, this operation is - // in the process of undoing itself (which is best-effort). - google.protobuf.Timestamp cancel_time = 3; -} - -// Enqueues the given DDL statements to be applied, in order but not -// necessarily all at once, to the database schema at some point (or -// points) in the future. The server checks that the statements -// are executable (syntactically valid, name tables that exist, etc.) -// before enqueueing them, but they may still fail upon -// later execution (e.g., if a statement from another batch of -// statements is applied first and it conflicts in some way, or if -// there is some data-related problem like a `NULL` value in a column to -// which `NOT NULL` would be added). If a statement fails, all -// subsequent statements in the batch are automatically cancelled. -// -// Each batch of statements is assigned a name which can be used with -// the [Operations][google.longrunning.Operations] API to monitor -// progress. See the -// [operation_id][google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.operation_id] -// field for more details. -message UpdateDatabaseDdlRequest { - // Required. The database to update. - string database = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "spanner.googleapis.com/Database" - } - ]; - - // Required. DDL statements to be applied to the database. - repeated string statements = 2 [(google.api.field_behavior) = REQUIRED]; - - // If empty, the new update request is assigned an - // automatically-generated operation ID. Otherwise, `operation_id` - // is used to construct the name of the resulting - // [Operation][google.longrunning.Operation]. - // - // Specifying an explicit operation ID simplifies determining - // whether the statements were executed in the event that the - // [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl] - // call is replayed, or the return value is otherwise lost: the - // [database][google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.database] - // and `operation_id` fields can be combined to form the - // [name][google.longrunning.Operation.name] of the resulting - // [longrunning.Operation][google.longrunning.Operation]: - // `/operations/`. - // - // `operation_id` should be unique within the database, and must be - // a valid identifier: `[a-z][a-z0-9_]*`. Note that - // automatically-generated operation IDs always begin with an - // underscore. If the named operation already exists, - // [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl] - // returns `ALREADY_EXISTS`. - string operation_id = 3; - - // Optional. Proto descriptors used by CREATE/ALTER PROTO BUNDLE statements. - // Contains a protobuf-serialized - // [google.protobuf.FileDescriptorSet](https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/descriptor.proto). - // To generate it, [install](https://grpc.io/docs/protoc-installation/) and - // run `protoc` with --include_imports and --descriptor_set_out. For example, - // to generate for moon/shot/app.proto, run - // ``` - // $protoc --proto_path=/app_path --proto_path=/lib_path \ - // --include_imports \ - // --descriptor_set_out=descriptors.data \ - // moon/shot/app.proto - // ``` - // For more details, see protobuffer [self - // description](https://developers.google.com/protocol-buffers/docs/techniques#self-description). - bytes proto_descriptors = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. This field is exposed to be used by the Spanner Migration Tool. - // For more details, see - // [SMT](https://github.com/GoogleCloudPlatform/spanner-migration-tool). - bool throughput_mode = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// Action information extracted from a DDL statement. This proto is used to -// display the brief info of the DDL statement for the operation -// [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl]. -message DdlStatementActionInfo { - // The action for the DDL statement, e.g. CREATE, ALTER, DROP, GRANT, etc. - // This field is a non-empty string. - string action = 1; - - // The entity type for the DDL statement, e.g. TABLE, INDEX, VIEW, etc. - // This field can be empty string for some DDL statement, - // e.g. for statement "ANALYZE", `entity_type` = "". - string entity_type = 2; - - // The entity name(s) being operated on the DDL statement. - // E.g. - // 1. For statement "CREATE TABLE t1(...)", `entity_names` = ["t1"]. - // 2. For statement "GRANT ROLE r1, r2 ...", `entity_names` = ["r1", "r2"]. - // 3. For statement "ANALYZE", `entity_names` = []. - repeated string entity_names = 3; -} - -// Metadata type for the operation returned by -// [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl]. -message UpdateDatabaseDdlMetadata { - // The database being modified. - string database = 1 [(google.api.resource_reference) = { - type: "spanner.googleapis.com/Database" - }]; - - // For an update this list contains all the statements. For an - // individual statement, this list contains only that statement. - repeated string statements = 2; - - // Reports the commit timestamps of all statements that have - // succeeded so far, where `commit_timestamps[i]` is the commit - // timestamp for the statement `statements[i]`. - repeated google.protobuf.Timestamp commit_timestamps = 3; - - // Output only. When true, indicates that the operation is throttled e.g. - // due to resource constraints. When resources become available the operation - // will resume and this field will be false again. - bool throttled = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The progress of the - // [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl] - // operations. All DDL statements will have continuously updating progress, - // and `progress[i]` is the operation progress for `statements[i]`. Also, - // `progress[i]` will have start time and end time populated with commit - // timestamp of operation, as well as a progress of 100% once the operation - // has completed. - repeated OperationProgress progress = 5; - - // The brief action info for the DDL statements. - // `actions[i]` is the brief info for `statements[i]`. - repeated DdlStatementActionInfo actions = 6; -} - -// The request for -// [DropDatabase][google.spanner.admin.database.v1.DatabaseAdmin.DropDatabase]. -message DropDatabaseRequest { - // Required. The database to be dropped. - string database = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "spanner.googleapis.com/Database" - } - ]; -} - -// The request for -// [GetDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.GetDatabaseDdl]. -message GetDatabaseDdlRequest { - // Required. The database whose schema we wish to get. - // Values are of the form - // `projects//instances//databases/` - string database = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "spanner.googleapis.com/Database" - } - ]; -} - -// The response for -// [GetDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.GetDatabaseDdl]. -message GetDatabaseDdlResponse { - // A list of formatted DDL statements defining the schema of the database - // specified in the request. - repeated string statements = 1; - - // Proto descriptors stored in the database. - // Contains a protobuf-serialized - // [google.protobuf.FileDescriptorSet](https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/descriptor.proto). - // For more details, see protobuffer [self - // description](https://developers.google.com/protocol-buffers/docs/techniques#self-description). - bytes proto_descriptors = 2; -} - -// The request for -// [ListDatabaseOperations][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabaseOperations]. -message ListDatabaseOperationsRequest { - // Required. The instance of the database operations. - // Values are of the form `projects//instances/`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "spanner.googleapis.com/Instance" - } - ]; - - // An expression that filters the list of returned operations. - // - // A filter expression consists of a field name, a - // comparison operator, and a value for filtering. - // The value must be a string, a number, or a boolean. The comparison operator - // must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. - // Colon `:` is the contains operator. Filter rules are not case sensitive. - // - // The following fields in the [Operation][google.longrunning.Operation] - // are eligible for filtering: - // - // * `name` - The name of the long-running operation - // * `done` - False if the operation is in progress, else true. - // * `metadata.@type` - the type of metadata. For example, the type string - // for - // [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata] - // is - // `type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata`. - // * `metadata.` - any field in metadata.value. - // `metadata.@type` must be specified first, if filtering on metadata - // fields. - // * `error` - Error associated with the long-running operation. - // * `response.@type` - the type of response. - // * `response.` - any field in response.value. - // - // You can combine multiple expressions by enclosing each expression in - // parentheses. By default, expressions are combined with AND logic. However, - // you can specify AND, OR, and NOT logic explicitly. - // - // Here are a few examples: - // - // * `done:true` - The operation is complete. - // * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata) AND` \ - // `(metadata.source_type:BACKUP) AND` \ - // `(metadata.backup_info.backup:backup_howl) AND` \ - // `(metadata.name:restored_howl) AND` \ - // `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \ - // `(error:*)` - Return operations where: - // * The operation's metadata type is - // [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata]. - // * The database is restored from a backup. - // * The backup name contains "backup_howl". - // * The restored database's name contains "restored_howl". - // * The operation started before 2018-03-28T14:50:00Z. - // * The operation resulted in an error. - string filter = 2; - - // Number of operations to be returned in the response. If 0 or - // less, defaults to the server's maximum allowed page size. - int32 page_size = 3; - - // If non-empty, `page_token` should contain a - // [next_page_token][google.spanner.admin.database.v1.ListDatabaseOperationsResponse.next_page_token] - // from a previous - // [ListDatabaseOperationsResponse][google.spanner.admin.database.v1.ListDatabaseOperationsResponse] - // to the same `parent` and with the same `filter`. - string page_token = 4; -} - -// The response for -// [ListDatabaseOperations][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabaseOperations]. -message ListDatabaseOperationsResponse { - // The list of matching database [long-running - // operations][google.longrunning.Operation]. Each operation's name will be - // prefixed by the database's name. The operation's - // [metadata][google.longrunning.Operation.metadata] field type - // `metadata.type_url` describes the type of the metadata. - repeated google.longrunning.Operation operations = 1; - - // `next_page_token` can be sent in a subsequent - // [ListDatabaseOperations][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabaseOperations] - // call to fetch more of the matching metadata. - string next_page_token = 2; -} - -// The request for -// [RestoreDatabase][google.spanner.admin.database.v1.DatabaseAdmin.RestoreDatabase]. -message RestoreDatabaseRequest { - // Required. The name of the instance in which to create the - // restored database. This instance must be in the same project and - // have the same instance configuration as the instance containing - // the source backup. Values are of the form - // `projects//instances/`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "spanner.googleapis.com/Instance" - } - ]; - - // Required. The id of the database to create and restore to. This - // database must not already exist. The `database_id` appended to - // `parent` forms the full database name of the form - // `projects//instances//databases/`. - string database_id = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The source from which to restore. - oneof source { - // Name of the backup from which to restore. Values are of the form - // `projects//instances//backups/`. - string backup = 3 [(google.api.resource_reference) = { - type: "spanner.googleapis.com/Backup" - }]; - } - - // Optional. An encryption configuration describing the encryption type and - // key resources in Cloud KMS used to encrypt/decrypt the database to restore - // to. If this field is not specified, the restored database will use the same - // encryption configuration as the backup by default, namely - // [encryption_type][google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.encryption_type] - // = `USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION`. - RestoreDatabaseEncryptionConfig encryption_config = 4 - [(google.api.field_behavior) = OPTIONAL]; -} - -// Encryption configuration for the restored database. -message RestoreDatabaseEncryptionConfig { - // Encryption types for the database to be restored. - enum EncryptionType { - // Unspecified. Do not use. - ENCRYPTION_TYPE_UNSPECIFIED = 0; - - // This is the default option when - // [encryption_config][google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig] - // is not specified. - USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION = 1; - - // Use Google default encryption. - GOOGLE_DEFAULT_ENCRYPTION = 2; - - // Use customer managed encryption. If specified, `kms_key_name` must - // must contain a valid Cloud KMS key. - CUSTOMER_MANAGED_ENCRYPTION = 3; - } - - // Required. The encryption type of the restored database. - EncryptionType encryption_type = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. The Cloud KMS key that will be used to encrypt/decrypt the - // restored database. This field should be set only when - // [encryption_type][google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.encryption_type] - // is `CUSTOMER_MANAGED_ENCRYPTION`. Values are of the form - // `projects//locations//keyRings//cryptoKeys/`. - string kms_key_name = 2 [ - (google.api.field_behavior) = OPTIONAL, - (google.api.resource_reference) = { - type: "cloudkms.googleapis.com/CryptoKey" - } - ]; - - // Optional. Specifies the KMS configuration for the one or more keys used to - // encrypt the database. Values are of the form - // `projects//locations//keyRings//cryptoKeys/`. - // - // The keys referenced by kms_key_names must fully cover all - // regions of the database instance configuration. Some examples: - // * For single region database instance configs, specify a single regional - // location KMS key. - // * For multi-regional database instance configs of type GOOGLE_MANAGED, - // either specify a multi-regional location KMS key or multiple regional - // location KMS keys that cover all regions in the instance config. - // * For a database instance config of type USER_MANAGED, please specify only - // regional location KMS keys to cover each region in the instance config. - // Multi-regional location KMS keys are not supported for USER_MANAGED - // instance configs. - repeated string kms_key_names = 3 [ - (google.api.field_behavior) = OPTIONAL, - (google.api.resource_reference) = { - type: "cloudkms.googleapis.com/CryptoKey" - } - ]; -} - -// Metadata type for the long-running operation returned by -// [RestoreDatabase][google.spanner.admin.database.v1.DatabaseAdmin.RestoreDatabase]. -message RestoreDatabaseMetadata { - // Name of the database being created and restored to. - string name = 1 [(google.api.resource_reference) = { - type: "spanner.googleapis.com/Database" - }]; - - // The type of the restore source. - RestoreSourceType source_type = 2; - - // Information about the source used to restore the database, as specified by - // `source` in - // [RestoreDatabaseRequest][google.spanner.admin.database.v1.RestoreDatabaseRequest]. - oneof source_info { - // Information about the backup used to restore the database. - BackupInfo backup_info = 3; - } - - // The progress of the - // [RestoreDatabase][google.spanner.admin.database.v1.DatabaseAdmin.RestoreDatabase] - // operation. - OperationProgress progress = 4; - - // The time at which cancellation of this operation was received. - // [Operations.CancelOperation][google.longrunning.Operations.CancelOperation] - // starts asynchronous cancellation on a long-running operation. The server - // makes a best effort to cancel the operation, but success is not guaranteed. - // Clients can use - // [Operations.GetOperation][google.longrunning.Operations.GetOperation] or - // other methods to check whether the cancellation succeeded or whether the - // operation completed despite cancellation. On successful cancellation, - // the operation is not deleted; instead, it becomes an operation with - // an [Operation.error][google.longrunning.Operation.error] value with a - // [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - // `Code.CANCELLED`. - google.protobuf.Timestamp cancel_time = 5; - - // If exists, the name of the long-running operation that will be used to - // track the post-restore optimization process to optimize the performance of - // the restored database, and remove the dependency on the restore source. - // The name is of the form - // `projects//instances//databases//operations/` - // where the is the name of database being created and restored to. - // The metadata type of the long-running operation is - // [OptimizeRestoredDatabaseMetadata][google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata]. - // This long-running operation will be automatically created by the system - // after the RestoreDatabase long-running operation completes successfully. - // This operation will not be created if the restore was not successful. - string optimize_database_operation_name = 6; -} - -// Metadata type for the long-running operation used to track the progress -// of optimizations performed on a newly restored database. This long-running -// operation is automatically created by the system after the successful -// completion of a database restore, and cannot be cancelled. -message OptimizeRestoredDatabaseMetadata { - // Name of the restored database being optimized. - string name = 1 [(google.api.resource_reference) = { - type: "spanner.googleapis.com/Database" - }]; - - // The progress of the post-restore optimizations. - OperationProgress progress = 2; -} - -// Indicates the type of the restore source. -enum RestoreSourceType { - // No restore associated. - TYPE_UNSPECIFIED = 0; - - // A backup was used as the source of the restore. - BACKUP = 1; -} - -// A Cloud Spanner database role. -message DatabaseRole { - option (google.api.resource) = { - type: "spanner.googleapis.com/DatabaseRole" - pattern: "projects/{project}/instances/{instance}/databases/{database}/databaseRoles/{role}" - }; - - // Required. The name of the database role. Values are of the form - // `projects//instances//databases//databaseRoles/` - // where `` is as specified in the `CREATE ROLE` DDL statement. - string name = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// The request for -// [ListDatabaseRoles][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabaseRoles]. -message ListDatabaseRolesRequest { - // Required. The database whose roles should be listed. - // Values are of the form - // `projects//instances//databases/`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "spanner.googleapis.com/Database" - } - ]; - - // Number of database roles to be returned in the response. If 0 or less, - // defaults to the server's maximum allowed page size. - int32 page_size = 2; - - // If non-empty, `page_token` should contain a - // [next_page_token][google.spanner.admin.database.v1.ListDatabaseRolesResponse.next_page_token] - // from a previous - // [ListDatabaseRolesResponse][google.spanner.admin.database.v1.ListDatabaseRolesResponse]. - string page_token = 3; -} - -// The response for -// [ListDatabaseRoles][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabaseRoles]. -message ListDatabaseRolesResponse { - // Database roles that matched the request. - repeated DatabaseRole database_roles = 1; - - // `next_page_token` can be sent in a subsequent - // [ListDatabaseRoles][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabaseRoles] - // call to fetch more of the matching roles. - string next_page_token = 2; -} - -// The request for -// [AddSplitPoints][google.spanner.admin.database.v1.DatabaseAdmin.AddSplitPoints]. -message AddSplitPointsRequest { - // Required. The database on whose tables/indexes split points are to be - // added. Values are of the form - // `projects//instances//databases/`. - string database = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "spanner.googleapis.com/Database" - } - ]; - - // Required. The split points to add. - repeated SplitPoints split_points = 2 - [(google.api.field_behavior) = REQUIRED]; - - // Optional. A user-supplied tag associated with the split points. - // For example, "intital_data_load", "special_event_1". - // Defaults to "CloudAddSplitPointsAPI" if not specified. - // The length of the tag must not exceed 50 characters,else will be trimmed. - // Only valid UTF8 characters are allowed. - string initiator = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// The response for -// [AddSplitPoints][google.spanner.admin.database.v1.DatabaseAdmin.AddSplitPoints]. -message AddSplitPointsResponse {} - -// The split points of a table/index. -message SplitPoints { - // A split key. - message Key { - // Required. The column values making up the split key. - google.protobuf.ListValue key_parts = 1 - [(google.api.field_behavior) = REQUIRED]; - } - - // The table to split. - string table = 1; - - // The index to split. - // If specified, the `table` field must refer to the index's base table. - string index = 2; - - // Required. The list of split keys, i.e., the split boundaries. - repeated Key keys = 3 [(google.api.field_behavior) = REQUIRED]; - - // Optional. The expiration timestamp of the split points. - // A timestamp in the past means immediate expiration. - // The maximum value can be 30 days in the future. - // Defaults to 10 days in the future if not specified. - google.protobuf.Timestamp expire_time = 5 - [(google.api.field_behavior) = OPTIONAL]; -} - -// Internal request proto, do not use directly. -message InternalUpdateGraphOperationRequest { - // Internal field, do not use directly. - string database = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "spanner.googleapis.com/Database" - } - ]; - // Internal field, do not use directly. - string operation_id = 2 [(google.api.field_behavior) = REQUIRED]; - // Internal field, do not use directly. - string vm_identity_token = 5 [(google.api.field_behavior) = REQUIRED]; - // Internal field, do not use directly. - double progress = 3 [(google.api.field_behavior) = OPTIONAL]; - // Internal field, do not use directly. - google.rpc.Status status = 6 [(google.api.field_behavior) = OPTIONAL]; -} - -// Internal response proto, do not use directly. -message InternalUpdateGraphOperationResponse {} diff --git a/owl-bot-staging/executor/v1/protos/google/spanner/admin/instance/v1/common.proto b/owl-bot-staging/executor/v1/protos/google/spanner/admin/instance/v1/common.proto deleted file mode 100644 index 0b5282c7d..000000000 --- a/owl-bot-staging/executor/v1/protos/google/spanner/admin/instance/v1/common.proto +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.spanner.admin.instance.v1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.Spanner.Admin.Instance.V1"; -option go_package = "cloud.google.com/go/spanner/admin/instance/apiv1/instancepb;instancepb"; -option java_multiple_files = true; -option java_outer_classname = "CommonProto"; -option java_package = "com.google.spanner.admin.instance.v1"; -option php_namespace = "Google\\Cloud\\Spanner\\Admin\\Instance\\V1"; -option ruby_package = "Google::Cloud::Spanner::Admin::Instance::V1"; - -// Encapsulates progress related information for a Cloud Spanner long -// running instance operations. -message OperationProgress { - // Percent completion of the operation. - // Values are between 0 and 100 inclusive. - int32 progress_percent = 1; - - // Time the request was received. - google.protobuf.Timestamp start_time = 2; - - // If set, the time at which this operation failed or was completed - // successfully. - google.protobuf.Timestamp end_time = 3; -} - -// Indicates the expected fulfillment period of an operation. -enum FulfillmentPeriod { - // Not specified. - FULFILLMENT_PERIOD_UNSPECIFIED = 0; - - // Normal fulfillment period. The operation is expected to complete within - // minutes. - FULFILLMENT_PERIOD_NORMAL = 1; - - // Extended fulfillment period. It can take up to an hour for the operation - // to complete. - FULFILLMENT_PERIOD_EXTENDED = 2; -} - -// ReplicaSelection identifies replicas with common properties. -message ReplicaSelection { - // Required. Name of the location of the replicas (e.g., "us-central1"). - string location = 1 [(google.api.field_behavior) = REQUIRED]; -} diff --git a/owl-bot-staging/executor/v1/protos/google/spanner/admin/instance/v1/spanner_instance_admin.proto b/owl-bot-staging/executor/v1/protos/google/spanner/admin/instance/v1/spanner_instance_admin.proto deleted file mode 100644 index d16ab2ca5..000000000 --- a/owl-bot-staging/executor/v1/protos/google/spanner/admin/instance/v1/spanner_instance_admin.proto +++ /dev/null @@ -1,2184 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.spanner.admin.instance.v1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/iam/v1/iam_policy.proto"; -import "google/iam/v1/policy.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/empty.proto"; -import "google/protobuf/field_mask.proto"; -import "google/protobuf/timestamp.proto"; -import "google/spanner/admin/instance/v1/common.proto"; - -option csharp_namespace = "Google.Cloud.Spanner.Admin.Instance.V1"; -option go_package = "cloud.google.com/go/spanner/admin/instance/apiv1/instancepb;instancepb"; -option java_multiple_files = true; -option java_outer_classname = "SpannerInstanceAdminProto"; -option java_package = "com.google.spanner.admin.instance.v1"; -option php_namespace = "Google\\Cloud\\Spanner\\Admin\\Instance\\V1"; -option ruby_package = "Google::Cloud::Spanner::Admin::Instance::V1"; - -// Cloud Spanner Instance Admin API -// -// The Cloud Spanner Instance Admin API can be used to create, delete, -// modify and list instances. Instances are dedicated Cloud Spanner serving -// and storage resources to be used by Cloud Spanner databases. -// -// Each instance has a "configuration", which dictates where the -// serving resources for the Cloud Spanner instance are located (e.g., -// US-central, Europe). Configurations are created by Google based on -// resource availability. -// -// Cloud Spanner billing is based on the instances that exist and their -// sizes. After an instance exists, there are no additional -// per-database or per-operation charges for use of the instance -// (though there may be additional network bandwidth charges). -// Instances offer isolation: problems with databases in one instance -// will not affect other instances. However, within an instance -// databases can affect each other. For example, if one database in an -// instance receives a lot of requests and consumes most of the -// instance resources, fewer resources are available for other -// databases in that instance, and their performance may suffer. -service InstanceAdmin { - option (google.api.default_host) = "spanner.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform," - "https://www.googleapis.com/auth/spanner.admin"; - - // Lists the supported instance configurations for a given project. - // - // Returns both Google-managed configurations and user-managed - // configurations. - rpc ListInstanceConfigs(ListInstanceConfigsRequest) - returns (ListInstanceConfigsResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*}/instanceConfigs" - }; - option (google.api.method_signature) = "parent"; - } - - // Gets information about a particular instance configuration. - rpc GetInstanceConfig(GetInstanceConfigRequest) returns (InstanceConfig) { - option (google.api.http) = { - get: "/v1/{name=projects/*/instanceConfigs/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Creates an instance configuration and begins preparing it to be used. The - // returned long-running operation - // can be used to track the progress of preparing the new - // instance configuration. The instance configuration name is assigned by the - // caller. If the named instance configuration already exists, - // `CreateInstanceConfig` returns `ALREADY_EXISTS`. - // - // Immediately after the request returns: - // - // * The instance configuration is readable via the API, with all requested - // attributes. The instance configuration's - // [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling] - // field is set to true. Its state is `CREATING`. - // - // While the operation is pending: - // - // * Cancelling the operation renders the instance configuration immediately - // unreadable via the API. - // * Except for deleting the creating resource, all other attempts to modify - // the instance configuration are rejected. - // - // Upon completion of the returned operation: - // - // * Instances can be created using the instance configuration. - // * The instance configuration's - // [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling] - // field becomes false. Its state becomes `READY`. - // - // The returned long-running operation will - // have a name of the format - // `/operations/` and can be used to track - // creation of the instance configuration. The - // metadata field type is - // [CreateInstanceConfigMetadata][google.spanner.admin.instance.v1.CreateInstanceConfigMetadata]. - // The response field type is - // [InstanceConfig][google.spanner.admin.instance.v1.InstanceConfig], if - // successful. - // - // Authorization requires `spanner.instanceConfigs.create` permission on - // the resource - // [parent][google.spanner.admin.instance.v1.CreateInstanceConfigRequest.parent]. - rpc CreateInstanceConfig(CreateInstanceConfigRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{parent=projects/*}/instanceConfigs" - body: "*" - }; - option (google.api.method_signature) = - "parent,instance_config,instance_config_id"; - option (google.longrunning.operation_info) = { - response_type: "google.spanner.admin.instance.v1.InstanceConfig" - metadata_type: "google.spanner.admin.instance.v1.CreateInstanceConfigMetadata" - }; - } - - // Updates an instance configuration. The returned - // long-running operation can be used to track - // the progress of updating the instance. If the named instance configuration - // does not exist, returns `NOT_FOUND`. - // - // Only user-managed configurations can be updated. - // - // Immediately after the request returns: - // - // * The instance configuration's - // [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling] - // field is set to true. - // - // While the operation is pending: - // - // * Cancelling the operation sets its metadata's - // [cancel_time][google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata.cancel_time]. - // The operation is guaranteed to succeed at undoing all changes, after - // which point it terminates with a `CANCELLED` status. - // * All other attempts to modify the instance configuration are rejected. - // * Reading the instance configuration via the API continues to give the - // pre-request values. - // - // Upon completion of the returned operation: - // - // * Creating instances using the instance configuration uses the new - // values. - // * The new values of the instance configuration are readable via the API. - // * The instance configuration's - // [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling] - // field becomes false. - // - // The returned long-running operation will - // have a name of the format - // `/operations/` and can be used to track - // the instance configuration modification. The - // metadata field type is - // [UpdateInstanceConfigMetadata][google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata]. - // The response field type is - // [InstanceConfig][google.spanner.admin.instance.v1.InstanceConfig], if - // successful. - // - // Authorization requires `spanner.instanceConfigs.update` permission on - // the resource [name][google.spanner.admin.instance.v1.InstanceConfig.name]. - rpc UpdateInstanceConfig(UpdateInstanceConfigRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - patch: "/v1/{instance_config.name=projects/*/instanceConfigs/*}" - body: "*" - }; - option (google.api.method_signature) = "instance_config,update_mask"; - option (google.longrunning.operation_info) = { - response_type: "google.spanner.admin.instance.v1.InstanceConfig" - metadata_type: "google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata" - }; - } - - // Deletes the instance configuration. Deletion is only allowed when no - // instances are using the configuration. If any instances are using - // the configuration, returns `FAILED_PRECONDITION`. - // - // Only user-managed configurations can be deleted. - // - // Authorization requires `spanner.instanceConfigs.delete` permission on - // the resource [name][google.spanner.admin.instance.v1.InstanceConfig.name]. - rpc DeleteInstanceConfig(DeleteInstanceConfigRequest) - returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/instanceConfigs/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists the user-managed instance configuration long-running - // operations in the given project. An instance - // configuration operation has a name of the form - // `projects//instanceConfigs//operations/`. - // The long-running operation - // metadata field type - // `metadata.type_url` describes the type of the metadata. Operations returned - // include those that have completed/failed/canceled within the last 7 days, - // and pending operations. Operations returned are ordered by - // `operation.metadata.value.start_time` in descending order starting - // from the most recently started operation. - rpc ListInstanceConfigOperations(ListInstanceConfigOperationsRequest) - returns (ListInstanceConfigOperationsResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*}/instanceConfigOperations" - }; - option (google.api.method_signature) = "parent"; - } - - // Lists all instances in the given project. - rpc ListInstances(ListInstancesRequest) returns (ListInstancesResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*}/instances" - }; - option (google.api.method_signature) = "parent"; - } - - // Lists all instance partitions for the given instance. - rpc ListInstancePartitions(ListInstancePartitionsRequest) - returns (ListInstancePartitionsResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/instances/*}/instancePartitions" - }; - option (google.api.method_signature) = "parent"; - } - - // Gets information about a particular instance. - rpc GetInstance(GetInstanceRequest) returns (Instance) { - option (google.api.http) = { - get: "/v1/{name=projects/*/instances/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Creates an instance and begins preparing it to begin serving. The - // returned long-running operation - // can be used to track the progress of preparing the new - // instance. The instance name is assigned by the caller. If the - // named instance already exists, `CreateInstance` returns - // `ALREADY_EXISTS`. - // - // Immediately upon completion of this request: - // - // * The instance is readable via the API, with all requested attributes - // but no allocated resources. Its state is `CREATING`. - // - // Until completion of the returned operation: - // - // * Cancelling the operation renders the instance immediately unreadable - // via the API. - // * The instance can be deleted. - // * All other attempts to modify the instance are rejected. - // - // Upon completion of the returned operation: - // - // * Billing for all successfully-allocated resources begins (some types - // may have lower than the requested levels). - // * Databases can be created in the instance. - // * The instance's allocated resource levels are readable via the API. - // * The instance's state becomes `READY`. - // - // The returned long-running operation will - // have a name of the format `/operations/` and - // can be used to track creation of the instance. The - // metadata field type is - // [CreateInstanceMetadata][google.spanner.admin.instance.v1.CreateInstanceMetadata]. - // The response field type is - // [Instance][google.spanner.admin.instance.v1.Instance], if successful. - rpc CreateInstance(CreateInstanceRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{parent=projects/*}/instances" - body: "*" - }; - option (google.api.method_signature) = "parent,instance_id,instance"; - option (google.longrunning.operation_info) = { - response_type: "google.spanner.admin.instance.v1.Instance" - metadata_type: "google.spanner.admin.instance.v1.CreateInstanceMetadata" - }; - } - - // Updates an instance, and begins allocating or releasing resources - // as requested. The returned long-running operation can be used to track the - // progress of updating the instance. If the named instance does not - // exist, returns `NOT_FOUND`. - // - // Immediately upon completion of this request: - // - // * For resource types for which a decrease in the instance's allocation - // has been requested, billing is based on the newly-requested level. - // - // Until completion of the returned operation: - // - // * Cancelling the operation sets its metadata's - // [cancel_time][google.spanner.admin.instance.v1.UpdateInstanceMetadata.cancel_time], - // and begins restoring resources to their pre-request values. The - // operation is guaranteed to succeed at undoing all resource changes, - // after which point it terminates with a `CANCELLED` status. - // * All other attempts to modify the instance are rejected. - // * Reading the instance via the API continues to give the pre-request - // resource levels. - // - // Upon completion of the returned operation: - // - // * Billing begins for all successfully-allocated resources (some types - // may have lower than the requested levels). - // * All newly-reserved resources are available for serving the instance's - // tables. - // * The instance's new resource levels are readable via the API. - // - // The returned long-running operation will - // have a name of the format `/operations/` and - // can be used to track the instance modification. The - // metadata field type is - // [UpdateInstanceMetadata][google.spanner.admin.instance.v1.UpdateInstanceMetadata]. - // The response field type is - // [Instance][google.spanner.admin.instance.v1.Instance], if successful. - // - // Authorization requires `spanner.instances.update` permission on - // the resource [name][google.spanner.admin.instance.v1.Instance.name]. - rpc UpdateInstance(UpdateInstanceRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - patch: "/v1/{instance.name=projects/*/instances/*}" - body: "*" - }; - option (google.api.method_signature) = "instance,field_mask"; - option (google.longrunning.operation_info) = { - response_type: "google.spanner.admin.instance.v1.Instance" - metadata_type: "google.spanner.admin.instance.v1.UpdateInstanceMetadata" - }; - } - - // Deletes an instance. - // - // Immediately upon completion of the request: - // - // * Billing ceases for all of the instance's reserved resources. - // - // Soon afterward: - // - // * The instance and *all of its databases* immediately and - // irrevocably disappear from the API. All data in the databases - // is permanently deleted. - rpc DeleteInstance(DeleteInstanceRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/instances/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Sets the access control policy on an instance resource. Replaces any - // existing policy. - // - // Authorization requires `spanner.instances.setIamPolicy` on - // [resource][google.iam.v1.SetIamPolicyRequest.resource]. - rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) - returns (google.iam.v1.Policy) { - option (google.api.http) = { - post: "/v1/{resource=projects/*/instances/*}:setIamPolicy" - body: "*" - }; - option (google.api.method_signature) = "resource,policy"; - } - - // Gets the access control policy for an instance resource. Returns an empty - // policy if an instance exists but does not have a policy set. - // - // Authorization requires `spanner.instances.getIamPolicy` on - // [resource][google.iam.v1.GetIamPolicyRequest.resource]. - rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) - returns (google.iam.v1.Policy) { - option (google.api.http) = { - post: "/v1/{resource=projects/*/instances/*}:getIamPolicy" - body: "*" - }; - option (google.api.method_signature) = "resource"; - } - - // Returns permissions that the caller has on the specified instance resource. - // - // Attempting this RPC on a non-existent Cloud Spanner instance resource will - // result in a NOT_FOUND error if the user has `spanner.instances.list` - // permission on the containing Google Cloud Project. Otherwise returns an - // empty set of permissions. - rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) - returns (google.iam.v1.TestIamPermissionsResponse) { - option (google.api.http) = { - post: "/v1/{resource=projects/*/instances/*}:testIamPermissions" - body: "*" - }; - option (google.api.method_signature) = "resource,permissions"; - } - - // Gets information about a particular instance partition. - rpc GetInstancePartition(GetInstancePartitionRequest) - returns (InstancePartition) { - option (google.api.http) = { - get: "/v1/{name=projects/*/instances/*/instancePartitions/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Creates an instance partition and begins preparing it to be used. The - // returned long-running operation - // can be used to track the progress of preparing the new instance partition. - // The instance partition name is assigned by the caller. If the named - // instance partition already exists, `CreateInstancePartition` returns - // `ALREADY_EXISTS`. - // - // Immediately upon completion of this request: - // - // * The instance partition is readable via the API, with all requested - // attributes but no allocated resources. Its state is `CREATING`. - // - // Until completion of the returned operation: - // - // * Cancelling the operation renders the instance partition immediately - // unreadable via the API. - // * The instance partition can be deleted. - // * All other attempts to modify the instance partition are rejected. - // - // Upon completion of the returned operation: - // - // * Billing for all successfully-allocated resources begins (some types - // may have lower than the requested levels). - // * Databases can start using this instance partition. - // * The instance partition's allocated resource levels are readable via the - // API. - // * The instance partition's state becomes `READY`. - // - // The returned long-running operation will - // have a name of the format - // `/operations/` and can be used to - // track creation of the instance partition. The - // metadata field type is - // [CreateInstancePartitionMetadata][google.spanner.admin.instance.v1.CreateInstancePartitionMetadata]. - // The response field type is - // [InstancePartition][google.spanner.admin.instance.v1.InstancePartition], if - // successful. - rpc CreateInstancePartition(CreateInstancePartitionRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/instances/*}/instancePartitions" - body: "*" - }; - option (google.api.method_signature) = - "parent,instance_partition,instance_partition_id"; - option (google.longrunning.operation_info) = { - response_type: "google.spanner.admin.instance.v1.InstancePartition" - metadata_type: "google.spanner.admin.instance.v1.CreateInstancePartitionMetadata" - }; - } - - // Deletes an existing instance partition. Requires that the - // instance partition is not used by any database or backup and is not the - // default instance partition of an instance. - // - // Authorization requires `spanner.instancePartitions.delete` permission on - // the resource - // [name][google.spanner.admin.instance.v1.InstancePartition.name]. - rpc DeleteInstancePartition(DeleteInstancePartitionRequest) - returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/instances/*/instancePartitions/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Updates an instance partition, and begins allocating or releasing resources - // as requested. The returned long-running operation can be used to track the - // progress of updating the instance partition. If the named instance - // partition does not exist, returns `NOT_FOUND`. - // - // Immediately upon completion of this request: - // - // * For resource types for which a decrease in the instance partition's - // allocation has been requested, billing is based on the newly-requested - // level. - // - // Until completion of the returned operation: - // - // * Cancelling the operation sets its metadata's - // [cancel_time][google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata.cancel_time], - // and begins restoring resources to their pre-request values. The - // operation is guaranteed to succeed at undoing all resource changes, - // after which point it terminates with a `CANCELLED` status. - // * All other attempts to modify the instance partition are rejected. - // * Reading the instance partition via the API continues to give the - // pre-request resource levels. - // - // Upon completion of the returned operation: - // - // * Billing begins for all successfully-allocated resources (some types - // may have lower than the requested levels). - // * All newly-reserved resources are available for serving the instance - // partition's tables. - // * The instance partition's new resource levels are readable via the API. - // - // The returned long-running operation will - // have a name of the format - // `/operations/` and can be used to - // track the instance partition modification. The - // metadata field type is - // [UpdateInstancePartitionMetadata][google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata]. - // The response field type is - // [InstancePartition][google.spanner.admin.instance.v1.InstancePartition], if - // successful. - // - // Authorization requires `spanner.instancePartitions.update` permission on - // the resource - // [name][google.spanner.admin.instance.v1.InstancePartition.name]. - rpc UpdateInstancePartition(UpdateInstancePartitionRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - patch: "/v1/{instance_partition.name=projects/*/instances/*/instancePartitions/*}" - body: "*" - }; - option (google.api.method_signature) = "instance_partition,field_mask"; - option (google.longrunning.operation_info) = { - response_type: "google.spanner.admin.instance.v1.InstancePartition" - metadata_type: "google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata" - }; - } - - // Lists instance partition long-running operations in the given instance. - // An instance partition operation has a name of the form - // `projects//instances//instancePartitions//operations/`. - // The long-running operation - // metadata field type - // `metadata.type_url` describes the type of the metadata. Operations returned - // include those that have completed/failed/canceled within the last 7 days, - // and pending operations. Operations returned are ordered by - // `operation.metadata.value.start_time` in descending order starting from the - // most recently started operation. - // - // Authorization requires `spanner.instancePartitionOperations.list` - // permission on the resource - // [parent][google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest.parent]. - rpc ListInstancePartitionOperations(ListInstancePartitionOperationsRequest) - returns (ListInstancePartitionOperationsResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/instances/*}/instancePartitionOperations" - }; - option (google.api.method_signature) = "parent"; - } - - // Moves an instance to the target instance configuration. You can use the - // returned long-running operation to track - // the progress of moving the instance. - // - // `MoveInstance` returns `FAILED_PRECONDITION` if the instance meets any of - // the following criteria: - // - // * Is undergoing a move to a different instance configuration - // * Has backups - // * Has an ongoing update - // * Contains any CMEK-enabled databases - // * Is a free trial instance - // - // While the operation is pending: - // - // * All other attempts to modify the instance, including changes to its - // compute capacity, are rejected. - // * The following database and backup admin operations are rejected: - // - // * `DatabaseAdmin.CreateDatabase` - // * `DatabaseAdmin.UpdateDatabaseDdl` (disabled if default_leader is - // specified in the request.) - // * `DatabaseAdmin.RestoreDatabase` - // * `DatabaseAdmin.CreateBackup` - // * `DatabaseAdmin.CopyBackup` - // - // * Both the source and target instance configurations are subject to - // hourly compute and storage charges. - // * The instance might experience higher read-write latencies and a higher - // transaction abort rate. However, moving an instance doesn't cause any - // downtime. - // - // The returned long-running operation has - // a name of the format - // `/operations/` and can be used to track - // the move instance operation. The - // metadata field type is - // [MoveInstanceMetadata][google.spanner.admin.instance.v1.MoveInstanceMetadata]. - // The response field type is - // [Instance][google.spanner.admin.instance.v1.Instance], - // if successful. - // Cancelling the operation sets its metadata's - // [cancel_time][google.spanner.admin.instance.v1.MoveInstanceMetadata.cancel_time]. - // Cancellation is not immediate because it involves moving any data - // previously moved to the target instance configuration back to the original - // instance configuration. You can use this operation to track the progress of - // the cancellation. Upon successful completion of the cancellation, the - // operation terminates with `CANCELLED` status. - // - // If not cancelled, upon completion of the returned operation: - // - // * The instance successfully moves to the target instance - // configuration. - // * You are billed for compute and storage in target instance - // configuration. - // - // Authorization requires the `spanner.instances.update` permission on - // the resource [instance][google.spanner.admin.instance.v1.Instance]. - // - // For more details, see - // [Move an instance](https://cloud.google.com/spanner/docs/move-instance). - rpc MoveInstance(MoveInstanceRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{name=projects/*/instances/*}:move" - body: "*" - }; - option (google.longrunning.operation_info) = { - response_type: "google.spanner.admin.instance.v1.MoveInstanceResponse" - metadata_type: "google.spanner.admin.instance.v1.MoveInstanceMetadata" - }; - } -} - -message ReplicaInfo { - // Indicates the type of replica. See the [replica types - // documentation](https://cloud.google.com/spanner/docs/replication#replica_types) - // for more details. - enum ReplicaType { - // Not specified. - TYPE_UNSPECIFIED = 0; - - // Read-write replicas support both reads and writes. These replicas: - // - // * Maintain a full copy of your data. - // * Serve reads. - // * Can vote whether to commit a write. - // * Participate in leadership election. - // * Are eligible to become a leader. - READ_WRITE = 1; - - // Read-only replicas only support reads (not writes). Read-only replicas: - // - // * Maintain a full copy of your data. - // * Serve reads. - // * Do not participate in voting to commit writes. - // * Are not eligible to become a leader. - READ_ONLY = 2; - - // Witness replicas don't support reads but do participate in voting to - // commit writes. Witness replicas: - // - // * Do not maintain a full copy of data. - // * Do not serve reads. - // * Vote whether to commit writes. - // * Participate in leader election but are not eligible to become leader. - WITNESS = 3; - } - - // The location of the serving resources, e.g., "us-central1". - string location = 1; - - // The type of replica. - ReplicaType type = 2; - - // If true, this location is designated as the default leader location where - // leader replicas are placed. See the [region types - // documentation](https://cloud.google.com/spanner/docs/instances#region_types) - // for more details. - bool default_leader_location = 3; -} - -// A possible configuration for a Cloud Spanner instance. Configurations -// define the geographic placement of nodes and their replication. -message InstanceConfig { - option (google.api.resource) = { - type: "spanner.googleapis.com/InstanceConfig" - pattern: "projects/{project}/instanceConfigs/{instance_config}" - plural: "instanceConfigs" - singular: "instanceConfig" - }; - - // The type of this configuration. - enum Type { - // Unspecified. - TYPE_UNSPECIFIED = 0; - - // Google-managed configuration. - GOOGLE_MANAGED = 1; - - // User-managed configuration. - USER_MANAGED = 2; - } - - // Indicates the current state of the instance configuration. - enum State { - // Not specified. - STATE_UNSPECIFIED = 0; - - // The instance configuration is still being created. - CREATING = 1; - - // The instance configuration is fully created and ready to be used to - // create instances. - READY = 2; - } - - // Describes the availability for free instances to be created in an instance - // configuration. - enum FreeInstanceAvailability { - // Not specified. - FREE_INSTANCE_AVAILABILITY_UNSPECIFIED = 0; - - // Indicates that free instances are available to be created in this - // instance configuration. - AVAILABLE = 1; - - // Indicates that free instances are not supported in this instance - // configuration. - UNSUPPORTED = 2; - - // Indicates that free instances are currently not available to be created - // in this instance configuration. - DISABLED = 3; - - // Indicates that additional free instances cannot be created in this - // instance configuration because the project has reached its limit of free - // instances. - QUOTA_EXCEEDED = 4; - } - - // Indicates the quorum type of this instance configuration. - enum QuorumType { - // Quorum type not specified. - QUORUM_TYPE_UNSPECIFIED = 0; - - // An instance configuration tagged with `REGION` quorum type forms a write - // quorum in a single region. - REGION = 1; - - // An instance configuration tagged with the `DUAL_REGION` quorum type forms - // a write quorum with exactly two read-write regions in a multi-region - // configuration. - // - // This instance configuration requires failover in the event of - // regional failures. - DUAL_REGION = 2; - - // An instance configuration tagged with the `MULTI_REGION` quorum type - // forms a write quorum from replicas that are spread across more than one - // region in a multi-region configuration. - MULTI_REGION = 3; - } - - // A unique identifier for the instance configuration. Values - // are of the form - // `projects//instanceConfigs/[a-z][-a-z0-9]*`. - // - // User instance configuration must start with `custom-`. - string name = 1; - - // The name of this instance configuration as it appears in UIs. - string display_name = 2; - - // Output only. Whether this instance configuration is a Google-managed or - // user-managed configuration. - Type config_type = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The geographic placement of nodes in this instance configuration and their - // replication properties. - // - // To create user-managed configurations, input - // `replicas` must include all replicas in `replicas` of the `base_config` - // and include one or more replicas in the `optional_replicas` of the - // `base_config`. - repeated ReplicaInfo replicas = 3; - - // Output only. The available optional replicas to choose from for - // user-managed configurations. Populated for Google-managed configurations. - repeated ReplicaInfo optional_replicas = 6 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Base configuration name, e.g. projects//instanceConfigs/nam3, - // based on which this configuration is created. Only set for user-managed - // configurations. `base_config` must refer to a configuration of type - // `GOOGLE_MANAGED` in the same project as this configuration. - string base_config = 7 [(google.api.resource_reference) = { - type: "spanner.googleapis.com/InstanceConfig" - }]; - - // Cloud Labels are a flexible and lightweight mechanism for organizing cloud - // resources into groups that reflect a customer's organizational needs and - // deployment strategies. Cloud Labels can be used to filter collections of - // resources. They can be used to control how resource metrics are aggregated. - // And they can be used as arguments to policy management rules (e.g. route, - // firewall, load balancing, etc.). - // - // * Label keys must be between 1 and 63 characters long and must conform to - // the following regular expression: `[a-z][a-z0-9_-]{0,62}`. - // * Label values must be between 0 and 63 characters long and must conform - // to the regular expression `[a-z0-9_-]{0,63}`. - // * No more than 64 labels can be associated with a given resource. - // - // See https://goo.gl/xmQnxf for more information on and examples of labels. - // - // If you plan to use labels in your own code, please note that additional - // characters may be allowed in the future. Therefore, you are advised to use - // an internal label representation, such as JSON, which doesn't rely upon - // specific characters being disallowed. For example, representing labels - // as the string: name + "_" + value would prove problematic if we were to - // allow "_" in a future release. - map labels = 8; - - // etag is used for optimistic concurrency control as a way - // to help prevent simultaneous updates of a instance configuration from - // overwriting each other. It is strongly suggested that systems make use of - // the etag in the read-modify-write cycle to perform instance configuration - // updates in order to avoid race conditions: An etag is returned in the - // response which contains instance configurations, and systems are expected - // to put that etag in the request to update instance configuration to ensure - // that their change is applied to the same version of the instance - // configuration. If no etag is provided in the call to update the instance - // configuration, then the existing instance configuration is overwritten - // blindly. - string etag = 9; - - // Allowed values of the "default_leader" schema option for databases in - // instances that use this instance configuration. - repeated string leader_options = 4; - - // Output only. If true, the instance configuration is being created or - // updated. If false, there are no ongoing operations for the instance - // configuration. - bool reconciling = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The current instance configuration state. Applicable only for - // `USER_MANAGED` configurations. - State state = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Describes whether free instances are available to be created - // in this instance configuration. - FreeInstanceAvailability free_instance_availability = 12 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The `QuorumType` of the instance configuration. - QuorumType quorum_type = 18 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The storage limit in bytes per processing unit. - int64 storage_limit_per_processing_unit = 19 - [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// ReplicaComputeCapacity describes the amount of server resources that are -// allocated to each replica identified by the replica selection. -message ReplicaComputeCapacity { - // Required. Identifies replicas by specified properties. - // All replicas in the selection have the same amount of compute capacity. - ReplicaSelection replica_selection = 1 - [(google.api.field_behavior) = REQUIRED]; - - // Compute capacity allocated to each replica identified by the specified - // selection. - // The unit is selected based on the unit used to specify the instance size - // for non-autoscaling instances, or the unit used in autoscaling limit for - // autoscaling instances. - oneof compute_capacity { - // The number of nodes allocated to each replica. - // - // This may be zero in API responses for instances that are not yet in - // state `READY`. - int32 node_count = 2; - - // The number of processing units allocated to each replica. - // - // This may be zero in API responses for instances that are not yet in - // state `READY`. - int32 processing_units = 3; - } -} - -// Autoscaling configuration for an instance. -message AutoscalingConfig { - // The autoscaling limits for the instance. Users can define the minimum and - // maximum compute capacity allocated to the instance, and the autoscaler will - // only scale within that range. Users can either use nodes or processing - // units to specify the limits, but should use the same unit to set both the - // min_limit and max_limit. - message AutoscalingLimits { - // The minimum compute capacity for the instance. - oneof min_limit { - // Minimum number of nodes allocated to the instance. If set, this number - // should be greater than or equal to 1. - int32 min_nodes = 1; - - // Minimum number of processing units allocated to the instance. If set, - // this number should be multiples of 1000. - int32 min_processing_units = 2; - } - - // The maximum compute capacity for the instance. The maximum compute - // capacity should be less than or equal to 10X the minimum compute - // capacity. - oneof max_limit { - // Maximum number of nodes allocated to the instance. If set, this number - // should be greater than or equal to min_nodes. - int32 max_nodes = 3; - - // Maximum number of processing units allocated to the instance. If set, - // this number should be multiples of 1000 and be greater than or equal to - // min_processing_units. - int32 max_processing_units = 4; - } - } - - // The autoscaling targets for an instance. - message AutoscalingTargets { - // Optional. The target high priority cpu utilization percentage that the - // autoscaler should be trying to achieve for the instance. This number is - // on a scale from 0 (no utilization) to 100 (full utilization). The valid - // range is [10, 90] inclusive. If not specified or set to 0, the autoscaler - // skips scaling based on high priority CPU utilization. - int32 high_priority_cpu_utilization_percent = 1 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The target total CPU utilization percentage that the autoscaler - // should be trying to achieve for the instance. This number is on a scale - // from 0 (no utilization) to 100 (full utilization). The valid range is - // [10, 90] inclusive. If not specified or set to 0, the autoscaler skips - // scaling based on total CPU utilization. If both - // `high_priority_cpu_utilization_percent` and - // `total_cpu_utilization_percent` are specified, the autoscaler provisions - // the larger of the two required compute capacities to satisfy both - // targets. - int32 total_cpu_utilization_percent = 4 - [(google.api.field_behavior) = OPTIONAL]; - - // Required. The target storage utilization percentage that the autoscaler - // should be trying to achieve for the instance. This number is on a scale - // from 0 (no utilization) to 100 (full utilization). The valid range is - // [10, 99] inclusive. - int32 storage_utilization_percent = 2 - [(google.api.field_behavior) = REQUIRED]; - } - - // AsymmetricAutoscalingOption specifies the scaling of replicas identified by - // the given selection. - message AsymmetricAutoscalingOption { - // Overrides the top-level autoscaling configuration for the replicas - // identified by `replica_selection`. All fields in this message are - // optional. Any unspecified fields will use the corresponding values from - // the top-level autoscaling configuration. - message AutoscalingConfigOverrides { - // Optional. If specified, overrides the min/max limit in the top-level - // autoscaling configuration for the selected replicas. - AutoscalingLimits autoscaling_limits = 1 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If specified, overrides the autoscaling target - // high_priority_cpu_utilization_percent in the top-level autoscaling - // configuration for the selected replicas. - int32 autoscaling_target_high_priority_cpu_utilization_percent = 2 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If specified, overrides the - // autoscaling target `total_cpu_utilization_percent` - // in the top-level autoscaling configuration for the selected replicas. - int32 autoscaling_target_total_cpu_utilization_percent = 4 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If true, disables high priority CPU autoscaling for the - // selected replicas and ignores - // [high_priority_cpu_utilization_percent][google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets.high_priority_cpu_utilization_percent] - // in the top-level autoscaling configuration. - // - // When setting this field to true, setting - // [autoscaling_target_high_priority_cpu_utilization_percent][google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides.autoscaling_target_high_priority_cpu_utilization_percent] - // field to a non-zero value for the same replica is not supported. - // - // If false, the - // [autoscaling_target_high_priority_cpu_utilization_percent][google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides.autoscaling_target_high_priority_cpu_utilization_percent] - // field in the replica will be used if set to a non-zero value. - // Otherwise, the - // [high_priority_cpu_utilization_percent][google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets.high_priority_cpu_utilization_percent] - // field in the top-level autoscaling configuration will be used. - // - // Setting both - // [disable_high_priority_cpu_autoscaling][google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides.disable_high_priority_cpu_autoscaling] - // and - // [disable_total_cpu_autoscaling][google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides.disable_total_cpu_autoscaling] - // to true for the same replica is not supported. - bool disable_high_priority_cpu_autoscaling = 5 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If true, disables total CPU autoscaling for the selected - // replicas and ignores - // [total_cpu_utilization_percent][google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets.total_cpu_utilization_percent] - // in the top-level autoscaling configuration. - // - // When setting this field to true, setting - // [autoscaling_target_total_cpu_utilization_percent][google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides.autoscaling_target_total_cpu_utilization_percent] - // field to a non-zero value for the same replica is not supported. - // - // If false, the - // [autoscaling_target_total_cpu_utilization_percent][google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides.autoscaling_target_total_cpu_utilization_percent] - // field in the replica will be used if set to a non-zero value. - // Otherwise, the - // [total_cpu_utilization_percent][google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets.total_cpu_utilization_percent] - // field in the top-level autoscaling configuration will be used. - // - // Setting both - // [disable_high_priority_cpu_autoscaling][google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides.disable_high_priority_cpu_autoscaling] - // and - // [disable_total_cpu_autoscaling][google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides.disable_total_cpu_autoscaling] - // to true for the same replica is not supported. - bool disable_total_cpu_autoscaling = 6 - [(google.api.field_behavior) = OPTIONAL]; - } - - // Required. Selects the replicas to which this AsymmetricAutoscalingOption - // applies. Only read-only replicas are supported. - ReplicaSelection replica_selection = 1 - [(google.api.field_behavior) = REQUIRED]; - - // Optional. Overrides applied to the top-level autoscaling configuration - // for the selected replicas. - AutoscalingConfigOverrides overrides = 2 - [(google.api.field_behavior) = OPTIONAL]; - } - - // Required. Autoscaling limits for an instance. - AutoscalingLimits autoscaling_limits = 1 - [(google.api.field_behavior) = REQUIRED]; - - // Required. The autoscaling targets for an instance. - AutoscalingTargets autoscaling_targets = 2 - [(google.api.field_behavior) = REQUIRED]; - - // Optional. Optional asymmetric autoscaling options. - // Replicas matching the replica selection criteria will be autoscaled - // independently from other replicas. The autoscaler will scale the replicas - // based on the utilization of replicas identified by the replica selection. - // Replica selections should not overlap with each other. - // - // Other replicas (those do not match any replica selection) will be - // autoscaled together and will have the same compute capacity allocated to - // them. - repeated AsymmetricAutoscalingOption asymmetric_autoscaling_options = 3 - [(google.api.field_behavior) = OPTIONAL]; -} - -// An isolated set of Cloud Spanner resources on which databases can be hosted. -message Instance { - option (google.api.resource) = { - type: "spanner.googleapis.com/Instance" - pattern: "projects/{project}/instances/{instance}" - plural: "instances" - singular: "instance" - }; - - // Indicates the current state of the instance. - enum State { - // Not specified. - STATE_UNSPECIFIED = 0; - - // The instance is still being created. Resources may not be - // available yet, and operations such as database creation may not - // work. - CREATING = 1; - - // The instance is fully created and ready to do work such as - // creating databases. - READY = 2; - } - - // The type of this instance. The type can be used to distinguish product - // variants, that can affect aspects like: usage restrictions, quotas and - // billing. Currently this is used to distinguish FREE_INSTANCE vs PROVISIONED - // instances. - enum InstanceType { - // Not specified. - INSTANCE_TYPE_UNSPECIFIED = 0; - - // Provisioned instances have dedicated resources, standard usage limits and - // support. - PROVISIONED = 1; - - // Free instances provide no guarantee for dedicated resources, - // [node_count, processing_units] should be 0. They come - // with stricter usage limits and limited support. - FREE_INSTANCE = 2; - } - - // The edition selected for this instance. Different editions provide - // different capabilities at different price points. - enum Edition { - // Edition not specified. - EDITION_UNSPECIFIED = 0; - - // Standard edition. - STANDARD = 1; - - // Enterprise edition. - ENTERPRISE = 2; - - // Enterprise Plus edition. - ENTERPRISE_PLUS = 3; - } - - // Indicates the - // [default backup - // schedule](https://cloud.google.com/spanner/docs/backup#default-backup-schedules) - // behavior for new databases within the instance. - enum DefaultBackupScheduleType { - // Not specified. - DEFAULT_BACKUP_SCHEDULE_TYPE_UNSPECIFIED = 0; - - // A default backup schedule isn't created automatically when a new database - // is created in the instance. - NONE = 1; - - // A default backup schedule is created automatically when a new database - // is created in the instance. The default backup schedule creates a full - // backup every 24 hours. These full backups are retained for 7 days. - // You can edit or delete the default backup schedule once it's created. - AUTOMATIC = 2; - } - - // Required. A unique identifier for the instance, which cannot be changed - // after the instance is created. Values are of the form - // `projects//instances/[a-z][-a-z0-9]*[a-z0-9]`. The final - // segment of the name must be between 2 and 64 characters in length. - string name = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The name of the instance's configuration. Values are of the form - // `projects//instanceConfigs/`. See - // also [InstanceConfig][google.spanner.admin.instance.v1.InstanceConfig] and - // [ListInstanceConfigs][google.spanner.admin.instance.v1.InstanceAdmin.ListInstanceConfigs]. - string config = 2 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "spanner.googleapis.com/InstanceConfig" - } - ]; - - // Required. The descriptive name for this instance as it appears in UIs. - // Must be unique per project and between 4 and 30 characters in length. - string display_name = 3 [(google.api.field_behavior) = REQUIRED]; - - // The number of nodes allocated to this instance. At most, one of either - // `node_count` or `processing_units` should be present in the message. - // - // Users can set the `node_count` field to specify the target number of nodes - // allocated to the instance. - // - // If autoscaling is enabled, `node_count` is treated as an `OUTPUT_ONLY` - // field and reflects the current number of nodes allocated to the instance. - // - // This might be zero in API responses for instances that are not yet in the - // `READY` state. - // - // - // For more information, see - // [Compute capacity, nodes, and processing - // units](https://cloud.google.com/spanner/docs/compute-capacity). - int32 node_count = 5; - - // The number of processing units allocated to this instance. At most, one of - // either `processing_units` or `node_count` should be present in the message. - // - // Users can set the `processing_units` field to specify the target number of - // processing units allocated to the instance. - // - // If autoscaling is enabled, `processing_units` is treated as an - // `OUTPUT_ONLY` field and reflects the current number of processing units - // allocated to the instance. - // - // This might be zero in API responses for instances that are not yet in the - // `READY` state. - // - // - // For more information, see - // [Compute capacity, nodes and processing - // units](https://cloud.google.com/spanner/docs/compute-capacity). - int32 processing_units = 9; - - // Output only. Lists the compute capacity per ReplicaSelection. A replica - // selection identifies a set of replicas with common properties. Replicas - // identified by a ReplicaSelection are scaled with the same compute capacity. - repeated ReplicaComputeCapacity replica_compute_capacity = 19 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. The autoscaling configuration. Autoscaling is enabled if this - // field is set. When autoscaling is enabled, node_count and processing_units - // are treated as OUTPUT_ONLY fields and reflect the current compute capacity - // allocated to the instance. - AutoscalingConfig autoscaling_config = 17 - [(google.api.field_behavior) = OPTIONAL]; - - // Output only. The current instance state. For - // [CreateInstance][google.spanner.admin.instance.v1.InstanceAdmin.CreateInstance], - // the state must be either omitted or set to `CREATING`. For - // [UpdateInstance][google.spanner.admin.instance.v1.InstanceAdmin.UpdateInstance], - // the state must be either omitted or set to `READY`. - State state = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Cloud Labels are a flexible and lightweight mechanism for organizing cloud - // resources into groups that reflect a customer's organizational needs and - // deployment strategies. Cloud Labels can be used to filter collections of - // resources. They can be used to control how resource metrics are aggregated. - // And they can be used as arguments to policy management rules (e.g. route, - // firewall, load balancing, etc.). - // - // * Label keys must be between 1 and 63 characters long and must conform to - // the following regular expression: `[a-z][a-z0-9_-]{0,62}`. - // * Label values must be between 0 and 63 characters long and must conform - // to the regular expression `[a-z0-9_-]{0,63}`. - // * No more than 64 labels can be associated with a given resource. - // - // See https://goo.gl/xmQnxf for more information on and examples of labels. - // - // If you plan to use labels in your own code, please note that additional - // characters may be allowed in the future. And so you are advised to use an - // internal label representation, such as JSON, which doesn't rely upon - // specific characters being disallowed. For example, representing labels - // as the string: name + "_" + value would prove problematic if we were to - // allow "_" in a future release. - map labels = 7; - - // The `InstanceType` of the current instance. - InstanceType instance_type = 10; - - // Deprecated. This field is not populated. - repeated string endpoint_uris = 8; - - // Output only. The time at which the instance was created. - google.protobuf.Timestamp create_time = 11 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The time at which the instance was most recently updated. - google.protobuf.Timestamp update_time = 12 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Free instance metadata. Only populated for free instances. - FreeInstanceMetadata free_instance_metadata = 13; - - // Optional. The `Edition` of the current instance. - Edition edition = 20 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Controls the default backup schedule behavior for new databases - // within the instance. By default, a backup schedule is created automatically - // when a new database is created in a new instance. - // - // Note that the `AUTOMATIC` value isn't permitted for free instances, - // as backups and backup schedules aren't supported for free instances. - // - // In the `GetInstance` or `ListInstances` response, if the value of - // `default_backup_schedule_type` isn't set, or set to `NONE`, Spanner doesn't - // create a default backup schedule for new databases in the instance. - DefaultBackupScheduleType default_backup_schedule_type = 23 - [(google.api.field_behavior) = OPTIONAL]; -} - -// The request for -// [ListInstanceConfigs][google.spanner.admin.instance.v1.InstanceAdmin.ListInstanceConfigs]. -message ListInstanceConfigsRequest { - // Required. The name of the project for which a list of supported instance - // configurations is requested. Values are of the form - // `projects/`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudresourcemanager.googleapis.com/Project" - } - ]; - - // Number of instance configurations to be returned in the response. If 0 or - // less, defaults to the server's maximum allowed page size. - int32 page_size = 2; - - // If non-empty, `page_token` should contain a - // [next_page_token][google.spanner.admin.instance.v1.ListInstanceConfigsResponse.next_page_token] - // from a previous - // [ListInstanceConfigsResponse][google.spanner.admin.instance.v1.ListInstanceConfigsResponse]. - string page_token = 3; -} - -// The response for -// [ListInstanceConfigs][google.spanner.admin.instance.v1.InstanceAdmin.ListInstanceConfigs]. -message ListInstanceConfigsResponse { - // The list of requested instance configurations. - repeated InstanceConfig instance_configs = 1; - - // `next_page_token` can be sent in a subsequent - // [ListInstanceConfigs][google.spanner.admin.instance.v1.InstanceAdmin.ListInstanceConfigs] - // call to fetch more of the matching instance configurations. - string next_page_token = 2; -} - -// The request for -// [GetInstanceConfigRequest][google.spanner.admin.instance.v1.InstanceAdmin.GetInstanceConfig]. -message GetInstanceConfigRequest { - // Required. The name of the requested instance configuration. Values are of - // the form `projects//instanceConfigs/`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "spanner.googleapis.com/InstanceConfig" - } - ]; -} - -// The request for -// [CreateInstanceConfig][google.spanner.admin.instance.v1.InstanceAdmin.CreateInstanceConfig]. -message CreateInstanceConfigRequest { - // Required. The name of the project in which to create the instance - // configuration. Values are of the form `projects/`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudresourcemanager.googleapis.com/Project" - } - ]; - - // Required. The ID of the instance configuration to create. Valid identifiers - // are of the form `custom-[-a-z0-9]*[a-z0-9]` and must be between 2 and 64 - // characters in length. The `custom-` prefix is required to avoid name - // conflicts with Google-managed configurations. - string instance_config_id = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The `InstanceConfig` proto of the configuration to create. - // `instance_config.name` must be - // `/instanceConfigs/`. - // `instance_config.base_config` must be a Google-managed configuration name, - // e.g. /instanceConfigs/us-east1, /instanceConfigs/nam3. - InstanceConfig instance_config = 3 [(google.api.field_behavior) = REQUIRED]; - - // An option to validate, but not actually execute, a request, - // and provide the same response. - bool validate_only = 4; -} - -// The request for -// [UpdateInstanceConfig][google.spanner.admin.instance.v1.InstanceAdmin.UpdateInstanceConfig]. -message UpdateInstanceConfigRequest { - // Required. The user instance configuration to update, which must always - // include the instance configuration name. Otherwise, only fields mentioned - // in - // [update_mask][google.spanner.admin.instance.v1.UpdateInstanceConfigRequest.update_mask] - // need be included. To prevent conflicts of concurrent updates, - // [etag][google.spanner.admin.instance.v1.InstanceConfig.reconciling] can - // be used. - InstanceConfig instance_config = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. A mask specifying which fields in - // [InstanceConfig][google.spanner.admin.instance.v1.InstanceConfig] should be - // updated. The field mask must always be specified; this prevents any future - // fields in [InstanceConfig][google.spanner.admin.instance.v1.InstanceConfig] - // from being erased accidentally by clients that do not know about them. Only - // display_name and labels can be updated. - google.protobuf.FieldMask update_mask = 2 - [(google.api.field_behavior) = REQUIRED]; - - // An option to validate, but not actually execute, a request, - // and provide the same response. - bool validate_only = 3; -} - -// The request for -// [DeleteInstanceConfig][google.spanner.admin.instance.v1.InstanceAdmin.DeleteInstanceConfig]. -message DeleteInstanceConfigRequest { - // Required. The name of the instance configuration to be deleted. - // Values are of the form - // `projects//instanceConfigs/` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "spanner.googleapis.com/InstanceConfig" - } - ]; - - // Used for optimistic concurrency control as a way to help prevent - // simultaneous deletes of an instance configuration from overwriting each - // other. If not empty, the API - // only deletes the instance configuration when the etag provided matches the - // current status of the requested instance configuration. Otherwise, deletes - // the instance configuration without checking the current status of the - // requested instance configuration. - string etag = 2; - - // An option to validate, but not actually execute, a request, - // and provide the same response. - bool validate_only = 3; -} - -// The request for -// [ListInstanceConfigOperations][google.spanner.admin.instance.v1.InstanceAdmin.ListInstanceConfigOperations]. -message ListInstanceConfigOperationsRequest { - // Required. The project of the instance configuration operations. - // Values are of the form `projects/`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudresourcemanager.googleapis.com/Project" - } - ]; - - // An expression that filters the list of returned operations. - // - // A filter expression consists of a field name, a - // comparison operator, and a value for filtering. - // The value must be a string, a number, or a boolean. The comparison operator - // must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. - // Colon `:` is the contains operator. Filter rules are not case sensitive. - // - // The following fields in the Operation are eligible for filtering: - // - // * `name` - The name of the long-running operation - // * `done` - False if the operation is in progress, else true. - // * `metadata.@type` - the type of metadata. For example, the type string - // for - // [CreateInstanceConfigMetadata][google.spanner.admin.instance.v1.CreateInstanceConfigMetadata] - // is - // `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstanceConfigMetadata`. - // * `metadata.` - any field in metadata.value. - // `metadata.@type` must be specified first, if filtering on metadata - // fields. - // * `error` - Error associated with the long-running operation. - // * `response.@type` - the type of response. - // * `response.` - any field in response.value. - // - // You can combine multiple expressions by enclosing each expression in - // parentheses. By default, expressions are combined with AND logic. However, - // you can specify AND, OR, and NOT logic explicitly. - // - // Here are a few examples: - // - // * `done:true` - The operation is complete. - // * `(metadata.@type=` \ - // `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstanceConfigMetadata) - // AND` \ - // `(metadata.instance_config.name:custom-config) AND` \ - // `(metadata.progress.start_time < \"2021-03-28T14:50:00Z\") AND` \ - // `(error:*)` - Return operations where: - // * The operation's metadata type is - // [CreateInstanceConfigMetadata][google.spanner.admin.instance.v1.CreateInstanceConfigMetadata]. - // * The instance configuration name contains "custom-config". - // * The operation started before 2021-03-28T14:50:00Z. - // * The operation resulted in an error. - string filter = 2; - - // Number of operations to be returned in the response. If 0 or - // less, defaults to the server's maximum allowed page size. - int32 page_size = 3; - - // If non-empty, `page_token` should contain a - // [next_page_token][google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse.next_page_token] - // from a previous - // [ListInstanceConfigOperationsResponse][google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse] - // to the same `parent` and with the same `filter`. - string page_token = 4; -} - -// The response for -// [ListInstanceConfigOperations][google.spanner.admin.instance.v1.InstanceAdmin.ListInstanceConfigOperations]. -message ListInstanceConfigOperationsResponse { - // The list of matching instance configuration long-running operations. Each - // operation's name will be - // prefixed by the name of the instance configuration. The operation's - // metadata field type - // `metadata.type_url` describes the type of the metadata. - repeated google.longrunning.Operation operations = 1; - - // `next_page_token` can be sent in a subsequent - // [ListInstanceConfigOperations][google.spanner.admin.instance.v1.InstanceAdmin.ListInstanceConfigOperations] - // call to fetch more of the matching metadata. - string next_page_token = 2; -} - -// The request for -// [GetInstance][google.spanner.admin.instance.v1.InstanceAdmin.GetInstance]. -message GetInstanceRequest { - // Required. The name of the requested instance. Values are of the form - // `projects//instances/`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "spanner.googleapis.com/Instance" - } - ]; - - // If field_mask is present, specifies the subset of - // [Instance][google.spanner.admin.instance.v1.Instance] fields that should be - // returned. If absent, all - // [Instance][google.spanner.admin.instance.v1.Instance] fields are returned. - google.protobuf.FieldMask field_mask = 2; -} - -// The request for -// [CreateInstance][google.spanner.admin.instance.v1.InstanceAdmin.CreateInstance]. -message CreateInstanceRequest { - // Required. The name of the project in which to create the instance. Values - // are of the form `projects/`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudresourcemanager.googleapis.com/Project" - } - ]; - - // Required. The ID of the instance to create. Valid identifiers are of the - // form `[a-z][-a-z0-9]*[a-z0-9]` and must be between 2 and 64 characters in - // length. - string instance_id = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The instance to create. The name may be omitted, but if - // specified must be `/instances/`. - Instance instance = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// The request for -// [ListInstances][google.spanner.admin.instance.v1.InstanceAdmin.ListInstances]. -message ListInstancesRequest { - // Required. The name of the project for which a list of instances is - // requested. Values are of the form `projects/`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudresourcemanager.googleapis.com/Project" - } - ]; - - // Number of instances to be returned in the response. If 0 or less, defaults - // to the server's maximum allowed page size. - int32 page_size = 2; - - // If non-empty, `page_token` should contain a - // [next_page_token][google.spanner.admin.instance.v1.ListInstancesResponse.next_page_token] - // from a previous - // [ListInstancesResponse][google.spanner.admin.instance.v1.ListInstancesResponse]. - string page_token = 3; - - // An expression for filtering the results of the request. Filter rules are - // case insensitive. The fields eligible for filtering are: - // - // * `name` - // * `display_name` - // * `labels.key` where key is the name of a label - // - // Some examples of using filters are: - // - // * `name:*` --> The instance has a name. - // * `name:Howl` --> The instance's name contains the string "howl". - // * `name:HOWL` --> Equivalent to above. - // * `NAME:howl` --> Equivalent to above. - // * `labels.env:*` --> The instance has the label "env". - // * `labels.env:dev` --> The instance has the label "env" and the value of - // the label contains the string "dev". - // * `name:howl labels.env:dev` --> The instance's name contains "howl" and - // it has the label "env" with its value - // containing "dev". - string filter = 4; - - // Deadline used while retrieving metadata for instances. - // Instances whose metadata cannot be retrieved within this deadline will be - // added to - // [unreachable][google.spanner.admin.instance.v1.ListInstancesResponse.unreachable] - // in - // [ListInstancesResponse][google.spanner.admin.instance.v1.ListInstancesResponse]. - google.protobuf.Timestamp instance_deadline = 5; -} - -// The response for -// [ListInstances][google.spanner.admin.instance.v1.InstanceAdmin.ListInstances]. -message ListInstancesResponse { - // The list of requested instances. - repeated Instance instances = 1; - - // `next_page_token` can be sent in a subsequent - // [ListInstances][google.spanner.admin.instance.v1.InstanceAdmin.ListInstances] - // call to fetch more of the matching instances. - string next_page_token = 2; - - // The list of unreachable instances. - // It includes the names of instances whose metadata could not be retrieved - // within - // [instance_deadline][google.spanner.admin.instance.v1.ListInstancesRequest.instance_deadline]. - repeated string unreachable = 3; -} - -// The request for -// [UpdateInstance][google.spanner.admin.instance.v1.InstanceAdmin.UpdateInstance]. -message UpdateInstanceRequest { - // Required. The instance to update, which must always include the instance - // name. Otherwise, only fields mentioned in - // [field_mask][google.spanner.admin.instance.v1.UpdateInstanceRequest.field_mask] - // need be included. - Instance instance = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. A mask specifying which fields in - // [Instance][google.spanner.admin.instance.v1.Instance] should be updated. - // The field mask must always be specified; this prevents any future fields in - // [Instance][google.spanner.admin.instance.v1.Instance] from being erased - // accidentally by clients that do not know about them. - google.protobuf.FieldMask field_mask = 2 - [(google.api.field_behavior) = REQUIRED]; -} - -// The request for -// [DeleteInstance][google.spanner.admin.instance.v1.InstanceAdmin.DeleteInstance]. -message DeleteInstanceRequest { - // Required. The name of the instance to be deleted. Values are of the form - // `projects//instances/` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "spanner.googleapis.com/Instance" - } - ]; -} - -// Metadata type for the operation returned by -// [CreateInstance][google.spanner.admin.instance.v1.InstanceAdmin.CreateInstance]. -message CreateInstanceMetadata { - // The instance being created. - Instance instance = 1; - - // The time at which the - // [CreateInstance][google.spanner.admin.instance.v1.InstanceAdmin.CreateInstance] - // request was received. - google.protobuf.Timestamp start_time = 2; - - // The time at which this operation was cancelled. If set, this operation is - // in the process of undoing itself (which is guaranteed to succeed) and - // cannot be cancelled again. - google.protobuf.Timestamp cancel_time = 3; - - // The time at which this operation failed or was completed successfully. - google.protobuf.Timestamp end_time = 4; - - // The expected fulfillment period of this create operation. - FulfillmentPeriod expected_fulfillment_period = 5; -} - -// Metadata type for the operation returned by -// [UpdateInstance][google.spanner.admin.instance.v1.InstanceAdmin.UpdateInstance]. -message UpdateInstanceMetadata { - // The desired end state of the update. - Instance instance = 1; - - // The time at which - // [UpdateInstance][google.spanner.admin.instance.v1.InstanceAdmin.UpdateInstance] - // request was received. - google.protobuf.Timestamp start_time = 2; - - // The time at which this operation was cancelled. If set, this operation is - // in the process of undoing itself (which is guaranteed to succeed) and - // cannot be cancelled again. - google.protobuf.Timestamp cancel_time = 3; - - // The time at which this operation failed or was completed successfully. - google.protobuf.Timestamp end_time = 4; - - // The expected fulfillment period of this update operation. - FulfillmentPeriod expected_fulfillment_period = 5; -} - -// Free instance specific metadata that is kept even after an instance has been -// upgraded for tracking purposes. -message FreeInstanceMetadata { - // Allows users to change behavior when a free instance expires. - enum ExpireBehavior { - // Not specified. - EXPIRE_BEHAVIOR_UNSPECIFIED = 0; - - // When the free instance expires, upgrade the instance to a provisioned - // instance. - FREE_TO_PROVISIONED = 1; - - // When the free instance expires, disable the instance, and delete it - // after the grace period passes if it has not been upgraded. - REMOVE_AFTER_GRACE_PERIOD = 2; - } - - // Output only. Timestamp after which the instance will either be upgraded or - // scheduled for deletion after a grace period. ExpireBehavior is used to - // choose between upgrading or scheduling the free instance for deletion. This - // timestamp is set during the creation of a free instance. - google.protobuf.Timestamp expire_time = 1 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. If present, the timestamp at which the free instance was - // upgraded to a provisioned instance. - google.protobuf.Timestamp upgrade_time = 2 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Specifies the expiration behavior of a free instance. The default of - // ExpireBehavior is `REMOVE_AFTER_GRACE_PERIOD`. This can be modified during - // or after creation, and before expiration. - ExpireBehavior expire_behavior = 3; -} - -// Metadata type for the operation returned by -// [CreateInstanceConfig][google.spanner.admin.instance.v1.InstanceAdmin.CreateInstanceConfig]. -message CreateInstanceConfigMetadata { - // The target instance configuration end state. - InstanceConfig instance_config = 1; - - // The progress of the - // [CreateInstanceConfig][google.spanner.admin.instance.v1.InstanceAdmin.CreateInstanceConfig] - // operation. - OperationProgress progress = 2; - - // The time at which this operation was cancelled. - google.protobuf.Timestamp cancel_time = 3; -} - -// Metadata type for the operation returned by -// [UpdateInstanceConfig][google.spanner.admin.instance.v1.InstanceAdmin.UpdateInstanceConfig]. -message UpdateInstanceConfigMetadata { - // The desired instance configuration after updating. - InstanceConfig instance_config = 1; - - // The progress of the - // [UpdateInstanceConfig][google.spanner.admin.instance.v1.InstanceAdmin.UpdateInstanceConfig] - // operation. - OperationProgress progress = 2; - - // The time at which this operation was cancelled. - google.protobuf.Timestamp cancel_time = 3; -} - -// An isolated set of Cloud Spanner resources that databases can define -// placements on. -message InstancePartition { - option (google.api.resource) = { - type: "spanner.googleapis.com/InstancePartition" - pattern: "projects/{project}/instances/{instance}/instancePartitions/{instance_partition}" - plural: "instancePartitions" - singular: "instancePartition" - }; - - // Indicates the current state of the instance partition. - enum State { - // Not specified. - STATE_UNSPECIFIED = 0; - - // The instance partition is still being created. Resources may not be - // available yet, and operations such as creating placements using this - // instance partition may not work. - CREATING = 1; - - // The instance partition is fully created and ready to do work such as - // creating placements and using in databases. - READY = 2; - } - - // Required. A unique identifier for the instance partition. Values are of the - // form - // `projects//instances//instancePartitions/[a-z][-a-z0-9]*[a-z0-9]`. - // The final segment of the name must be between 2 and 64 characters in - // length. An instance partition's name cannot be changed after the instance - // partition is created. - string name = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The name of the instance partition's configuration. Values are of - // the form `projects//instanceConfigs/`. See also - // [InstanceConfig][google.spanner.admin.instance.v1.InstanceConfig] and - // [ListInstanceConfigs][google.spanner.admin.instance.v1.InstanceAdmin.ListInstanceConfigs]. - string config = 2 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "spanner.googleapis.com/InstanceConfig" - } - ]; - - // Required. The descriptive name for this instance partition as it appears in - // UIs. Must be unique per project and between 4 and 30 characters in length. - string display_name = 3 [(google.api.field_behavior) = REQUIRED]; - - // Compute capacity defines amount of server and storage resources that are - // available to the databases in an instance partition. At most, one of either - // `node_count` or` processing_units` should be present in the message. For - // more information, see - // [Compute capacity, nodes, and processing - // units](https://cloud.google.com/spanner/docs/compute-capacity). - oneof compute_capacity { - // The number of nodes allocated to this instance partition. - // - // Users can set the `node_count` field to specify the target number of - // nodes allocated to the instance partition. - // - // This may be zero in API responses for instance partitions that are not - // yet in state `READY`. - int32 node_count = 5; - - // The number of processing units allocated to this instance partition. - // - // Users can set the `processing_units` field to specify the target number - // of processing units allocated to the instance partition. - // - // This might be zero in API responses for instance partitions that are not - // yet in the `READY` state. - int32 processing_units = 6; - } - - // Optional. The autoscaling configuration. Autoscaling is enabled if this - // field is set. When autoscaling is enabled, fields in compute_capacity are - // treated as OUTPUT_ONLY fields and reflect the current compute capacity - // allocated to the instance partition. - AutoscalingConfig autoscaling_config = 13 - [(google.api.field_behavior) = OPTIONAL]; - - // Output only. The current instance partition state. - State state = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The time at which the instance partition was created. - google.protobuf.Timestamp create_time = 8 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The time at which the instance partition was most recently - // updated. - google.protobuf.Timestamp update_time = 9 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The names of the databases that reference this - // instance partition. Referencing databases should share the parent instance. - // The existence of any referencing database prevents the instance partition - // from being deleted. - repeated string referencing_databases = 10 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Deprecated: This field is not populated. - // Output only. The names of the backups that reference this instance - // partition. Referencing backups should share the parent instance. The - // existence of any referencing backup prevents the instance partition from - // being deleted. - repeated string referencing_backups = 11 - [deprecated = true, (google.api.field_behavior) = OUTPUT_ONLY]; - - // Used for optimistic concurrency control as a way - // to help prevent simultaneous updates of a instance partition from - // overwriting each other. It is strongly suggested that systems make use of - // the etag in the read-modify-write cycle to perform instance partition - // updates in order to avoid race conditions: An etag is returned in the - // response which contains instance partitions, and systems are expected to - // put that etag in the request to update instance partitions to ensure that - // their change will be applied to the same version of the instance partition. - // If no etag is provided in the call to update instance partition, then the - // existing instance partition is overwritten blindly. - string etag = 12; -} - -// Metadata type for the operation returned by -// [CreateInstancePartition][google.spanner.admin.instance.v1.InstanceAdmin.CreateInstancePartition]. -message CreateInstancePartitionMetadata { - // The instance partition being created. - InstancePartition instance_partition = 1; - - // The time at which the - // [CreateInstancePartition][google.spanner.admin.instance.v1.InstanceAdmin.CreateInstancePartition] - // request was received. - google.protobuf.Timestamp start_time = 2; - - // The time at which this operation was cancelled. If set, this operation is - // in the process of undoing itself (which is guaranteed to succeed) and - // cannot be cancelled again. - google.protobuf.Timestamp cancel_time = 3; - - // The time at which this operation failed or was completed successfully. - google.protobuf.Timestamp end_time = 4; -} - -// The request for -// [CreateInstancePartition][google.spanner.admin.instance.v1.InstanceAdmin.CreateInstancePartition]. -message CreateInstancePartitionRequest { - // Required. The name of the instance in which to create the instance - // partition. Values are of the form - // `projects//instances/`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "spanner.googleapis.com/Instance" - } - ]; - - // Required. The ID of the instance partition to create. Valid identifiers are - // of the form `[a-z][-a-z0-9]*[a-z0-9]` and must be between 2 and 64 - // characters in length. - string instance_partition_id = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The instance partition to create. The instance_partition.name may - // be omitted, but if specified must be - // `/instancePartitions/`. - InstancePartition instance_partition = 3 - [(google.api.field_behavior) = REQUIRED]; -} - -// The request for -// [DeleteInstancePartition][google.spanner.admin.instance.v1.InstanceAdmin.DeleteInstancePartition]. -message DeleteInstancePartitionRequest { - // Required. The name of the instance partition to be deleted. - // Values are of the form - // `projects/{project}/instances/{instance}/instancePartitions/{instance_partition}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "spanner.googleapis.com/InstancePartition" - } - ]; - - // Optional. If not empty, the API only deletes the instance partition when - // the etag provided matches the current status of the requested instance - // partition. Otherwise, deletes the instance partition without checking the - // current status of the requested instance partition. - string etag = 2; -} - -// The request for -// [GetInstancePartition][google.spanner.admin.instance.v1.InstanceAdmin.GetInstancePartition]. -message GetInstancePartitionRequest { - // Required. The name of the requested instance partition. Values are of - // the form - // `projects/{project}/instances/{instance}/instancePartitions/{instance_partition}`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "spanner.googleapis.com/InstancePartition" - } - ]; -} - -// The request for -// [UpdateInstancePartition][google.spanner.admin.instance.v1.InstanceAdmin.UpdateInstancePartition]. -message UpdateInstancePartitionRequest { - // Required. The instance partition to update, which must always include the - // instance partition name. Otherwise, only fields mentioned in - // [field_mask][google.spanner.admin.instance.v1.UpdateInstancePartitionRequest.field_mask] - // need be included. - InstancePartition instance_partition = 1 - [(google.api.field_behavior) = REQUIRED]; - - // Required. A mask specifying which fields in - // [InstancePartition][google.spanner.admin.instance.v1.InstancePartition] - // should be updated. The field mask must always be specified; this prevents - // any future fields in - // [InstancePartition][google.spanner.admin.instance.v1.InstancePartition] - // from being erased accidentally by clients that do not know about them. - google.protobuf.FieldMask field_mask = 2 - [(google.api.field_behavior) = REQUIRED]; -} - -// Metadata type for the operation returned by -// [UpdateInstancePartition][google.spanner.admin.instance.v1.InstanceAdmin.UpdateInstancePartition]. -message UpdateInstancePartitionMetadata { - // The desired end state of the update. - InstancePartition instance_partition = 1; - - // The time at which - // [UpdateInstancePartition][google.spanner.admin.instance.v1.InstanceAdmin.UpdateInstancePartition] - // request was received. - google.protobuf.Timestamp start_time = 2; - - // The time at which this operation was cancelled. If set, this operation is - // in the process of undoing itself (which is guaranteed to succeed) and - // cannot be cancelled again. - google.protobuf.Timestamp cancel_time = 3; - - // The time at which this operation failed or was completed successfully. - google.protobuf.Timestamp end_time = 4; -} - -// The request for -// [ListInstancePartitions][google.spanner.admin.instance.v1.InstanceAdmin.ListInstancePartitions]. -message ListInstancePartitionsRequest { - // Required. The instance whose instance partitions should be listed. Values - // are of the form `projects//instances/`. Use `{instance} - // = '-'` to list instance partitions for all Instances in a project, e.g., - // `projects/myproject/instances/-`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "spanner.googleapis.com/Instance" - } - ]; - - // Number of instance partitions to be returned in the response. If 0 or less, - // defaults to the server's maximum allowed page size. - int32 page_size = 2; - - // If non-empty, `page_token` should contain a - // [next_page_token][google.spanner.admin.instance.v1.ListInstancePartitionsResponse.next_page_token] - // from a previous - // [ListInstancePartitionsResponse][google.spanner.admin.instance.v1.ListInstancePartitionsResponse]. - string page_token = 3; - - // Optional. Deadline used while retrieving metadata for instance partitions. - // Instance partitions whose metadata cannot be retrieved within this deadline - // will be added to - // [unreachable][google.spanner.admin.instance.v1.ListInstancePartitionsResponse.unreachable] - // in - // [ListInstancePartitionsResponse][google.spanner.admin.instance.v1.ListInstancePartitionsResponse]. - google.protobuf.Timestamp instance_partition_deadline = 4 - [(google.api.field_behavior) = OPTIONAL]; -} - -// The response for -// [ListInstancePartitions][google.spanner.admin.instance.v1.InstanceAdmin.ListInstancePartitions]. -message ListInstancePartitionsResponse { - // The list of requested instancePartitions. - repeated InstancePartition instance_partitions = 1; - - // `next_page_token` can be sent in a subsequent - // [ListInstancePartitions][google.spanner.admin.instance.v1.InstanceAdmin.ListInstancePartitions] - // call to fetch more of the matching instance partitions. - string next_page_token = 2; - - // The list of unreachable instances or instance partitions. - // It includes the names of instances or instance partitions whose metadata - // could not be retrieved within - // [instance_partition_deadline][google.spanner.admin.instance.v1.ListInstancePartitionsRequest.instance_partition_deadline]. - repeated string unreachable = 3; -} - -// The request for -// [ListInstancePartitionOperations][google.spanner.admin.instance.v1.InstanceAdmin.ListInstancePartitionOperations]. -message ListInstancePartitionOperationsRequest { - // Required. The parent instance of the instance partition operations. - // Values are of the form `projects//instances/`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "spanner.googleapis.com/Instance" - } - ]; - - // Optional. An expression that filters the list of returned operations. - // - // A filter expression consists of a field name, a - // comparison operator, and a value for filtering. - // The value must be a string, a number, or a boolean. The comparison operator - // must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. - // Colon `:` is the contains operator. Filter rules are not case sensitive. - // - // The following fields in the Operation are eligible for filtering: - // - // * `name` - The name of the long-running operation - // * `done` - False if the operation is in progress, else true. - // * `metadata.@type` - the type of metadata. For example, the type string - // for - // [CreateInstancePartitionMetadata][google.spanner.admin.instance.v1.CreateInstancePartitionMetadata] - // is - // `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstancePartitionMetadata`. - // * `metadata.` - any field in metadata.value. - // `metadata.@type` must be specified first, if filtering on metadata - // fields. - // * `error` - Error associated with the long-running operation. - // * `response.@type` - the type of response. - // * `response.` - any field in response.value. - // - // You can combine multiple expressions by enclosing each expression in - // parentheses. By default, expressions are combined with AND logic. However, - // you can specify AND, OR, and NOT logic explicitly. - // - // Here are a few examples: - // - // * `done:true` - The operation is complete. - // * `(metadata.@type=` \ - // `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstancePartitionMetadata) - // AND` \ - // `(metadata.instance_partition.name:custom-instance-partition) AND` \ - // `(metadata.start_time < \"2021-03-28T14:50:00Z\") AND` \ - // `(error:*)` - Return operations where: - // * The operation's metadata type is - // [CreateInstancePartitionMetadata][google.spanner.admin.instance.v1.CreateInstancePartitionMetadata]. - // * The instance partition name contains "custom-instance-partition". - // * The operation started before 2021-03-28T14:50:00Z. - // * The operation resulted in an error. - string filter = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Number of operations to be returned in the response. If 0 or - // less, defaults to the server's maximum allowed page size. - int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If non-empty, `page_token` should contain a - // [next_page_token][google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse.next_page_token] - // from a previous - // [ListInstancePartitionOperationsResponse][google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse] - // to the same `parent` and with the same `filter`. - string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Deadline used while retrieving metadata for instance partition - // operations. Instance partitions whose operation metadata cannot be - // retrieved within this deadline will be added to - // [unreachable_instance_partitions][google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse.unreachable_instance_partitions] - // in - // [ListInstancePartitionOperationsResponse][google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse]. - google.protobuf.Timestamp instance_partition_deadline = 5 - [(google.api.field_behavior) = OPTIONAL]; -} - -// The response for -// [ListInstancePartitionOperations][google.spanner.admin.instance.v1.InstanceAdmin.ListInstancePartitionOperations]. -message ListInstancePartitionOperationsResponse { - // The list of matching instance partition long-running operations. Each - // operation's name will be - // prefixed by the instance partition's name. The operation's - // metadata field type - // `metadata.type_url` describes the type of the metadata. - repeated google.longrunning.Operation operations = 1; - - // `next_page_token` can be sent in a subsequent - // [ListInstancePartitionOperations][google.spanner.admin.instance.v1.InstanceAdmin.ListInstancePartitionOperations] - // call to fetch more of the matching metadata. - string next_page_token = 2; - - // The list of unreachable instance partitions. - // It includes the names of instance partitions whose operation metadata could - // not be retrieved within - // [instance_partition_deadline][google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest.instance_partition_deadline]. - repeated string unreachable_instance_partitions = 3; -} - -// The request for -// [MoveInstance][google.spanner.admin.instance.v1.InstanceAdmin.MoveInstance]. -message MoveInstanceRequest { - // Required. The instance to move. - // Values are of the form `projects//instances/`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "spanner.googleapis.com/Instance" - } - ]; - - // Required. The target instance configuration where to move the instance. - // Values are of the form `projects//instanceConfigs/`. - string target_config = 2 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "spanner.googleapis.com/InstanceConfig" - } - ]; -} - -// The response for -// [MoveInstance][google.spanner.admin.instance.v1.InstanceAdmin.MoveInstance]. -message MoveInstanceResponse {} - -// Metadata type for the operation returned by -// [MoveInstance][google.spanner.admin.instance.v1.InstanceAdmin.MoveInstance]. -message MoveInstanceMetadata { - // The target instance configuration where to move the instance. - // Values are of the form `projects//instanceConfigs/`. - string target_config = 1; - - // The progress of the - // [MoveInstance][google.spanner.admin.instance.v1.InstanceAdmin.MoveInstance] - // operation. - // [progress_percent][google.spanner.admin.instance.v1.OperationProgress.progress_percent] - // is reset when cancellation is requested. - OperationProgress progress = 2; - - // The time at which this operation was cancelled. - google.protobuf.Timestamp cancel_time = 3; -} diff --git a/owl-bot-staging/executor/v1/protos/google/spanner/executor/v1/cloud_executor.proto b/owl-bot-staging/executor/v1/protos/google/spanner/executor/v1/cloud_executor.proto deleted file mode 100644 index cf68519ef..000000000 --- a/owl-bot-staging/executor/v1/protos/google/spanner/executor/v1/cloud_executor.proto +++ /dev/null @@ -1,1520 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.spanner.executor.v1; - -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/timestamp.proto"; -import "google/rpc/status.proto"; -import "google/spanner/admin/database/v1/backup.proto"; -import "google/spanner/admin/database/v1/common.proto"; -import "google/spanner/admin/database/v1/spanner_database_admin.proto"; -import "google/spanner/admin/instance/v1/spanner_instance_admin.proto"; -import "google/spanner/v1/spanner.proto"; -import "google/spanner/v1/type.proto"; - -option go_package = "cloud.google.com/go/spanner/executor/apiv1/executorpb;executorpb"; -option java_multiple_files = true; -option java_outer_classname = "CloudExecutorProto"; -option java_package = "com.google.spanner.executor.v1"; - -// Service that executes SpannerActions asynchronously. -service SpannerExecutorProxy { - option (google.api.default_host) = "spanner-cloud-executor.googleapis.com"; - - // ExecuteActionAsync is a streaming call that starts executing a new Spanner - // action. - // - // For each request, the server will reply with one or more responses, but - // only the last response will contain status in the outcome. - // - // Responses can be matched to requests by action_id. It is allowed to have - // multiple actions in flight--in that case, actions are be executed in - // parallel. - rpc ExecuteActionAsync(stream SpannerAsyncActionRequest) - returns (stream SpannerAsyncActionResponse) {} -} - -// Request to executor service that start a new Spanner action. -message SpannerAsyncActionRequest { - // Action id to uniquely identify this action request. - int32 action_id = 1; - - // The actual SpannerAction to perform. - SpannerAction action = 2; -} - -// Response from executor service. -message SpannerAsyncActionResponse { - // Action id corresponds to the request. - int32 action_id = 1; - - // If action results are split into multiple responses, only the last response - // can and should contain status. - SpannerActionOutcome outcome = 2; -} - -// SpannerAction defines a primitive action that can be performed against -// Spanner, such as begin or commit a transaction, or perform a read or -// mutation. -message SpannerAction { - // Database against which to perform action. - // In a context where a series of actions take place, an action may omit - // database path if it applies to the same database as the previous action. - string database_path = 1; - - // Configuration options for Spanner backend - SpannerOptions spanner_options = 2; - - // Action represents a spanner action kind, there will only be one action kind - // per SpannerAction. - oneof action { - // Action to start a transaction. - StartTransactionAction start = 10; - - // Action to finish a transaction. - FinishTransactionAction finish = 11; - - // Action to do a normal read. - ReadAction read = 20; - - // Action to do a query. - QueryAction query = 21; - - // Action to buffer a mutation. - MutationAction mutation = 22; - - // Action to a DML. - DmlAction dml = 23; - - // Action to a batch DML. - BatchDmlAction batch_dml = 24; - - // Action to write a mutation. - WriteMutationsAction write = 25; - - // Action to a partitioned update. - PartitionedUpdateAction partitioned_update = 27; - - // Action that contains any administrative operation, like database, - // instance manipulation. - AdminAction admin = 30; - - // Action to start a batch transaction. - StartBatchTransactionAction start_batch_txn = 40; - - // Action to close a batch transaction. - CloseBatchTransactionAction close_batch_txn = 41; - - // Action to generate database partitions for batch read. - GenerateDbPartitionsForReadAction generate_db_partitions_read = 42; - - // Action to generate database partitions for batch query. - GenerateDbPartitionsForQueryAction generate_db_partitions_query = 43; - - // Action to execute batch actions on generated partitions. - ExecutePartitionAction execute_partition = 44; - - // Action to execute change stream query. - ExecuteChangeStreamQuery execute_change_stream_query = 50; - - // Query cancellation action for testing the cancellation of a query. - QueryCancellationAction query_cancellation = 51; - } -} - -// A single read request. -message ReadAction { - // The table to read at. - string table = 1; - - // The index to read at if it's an index read. - optional string index = 2; - - // List of columns must begin with the key columns used for the read. - repeated string column = 3; - - // Keys for performing this read. - KeySet keys = 4; - - // Limit on number of rows to read. If set, must be positive. - int32 limit = 5; -} - -// A SQL query request. -message QueryAction { - // Parameter that bind to placeholders in the SQL string - message Parameter { - // Name of the parameter (with no leading @). - string name = 1; - - // Type of the parameter. - google.spanner.v1.Type type = 2; - - // Value of the parameter. - Value value = 3; - } - - // The SQL string. - string sql = 1; - - // Parameters for the SQL string. - repeated Parameter params = 2; -} - -// A single DML statement. -message DmlAction { - // DML statement. - QueryAction update = 1; - - // Whether to autocommit the transaction after executing the DML statement, - // if the Executor supports autocommit. - optional bool autocommit_if_supported = 2; -} - -// Batch of DML statements invoked using batched execution. -message BatchDmlAction { - // DML statements. - repeated QueryAction updates = 1; -} - -// Value represents a single value that can be read or written to/from -// Spanner. -message Value { - // Exactly one of the following fields will be present. - oneof value_type { - // If is_null is set, then this value is null. - bool is_null = 1; - - // Int type value. It's used for all integer number types, like int32 and - // int64. - int64 int_value = 2; - - // Bool type value. - bool bool_value = 3; - - // Double type value. It's used for all float point types, like float and - // double. - double double_value = 4; - - // Bytes type value, stored in CORD. It's also used for PROTO type value. - bytes bytes_value = 5; - - // String type value, stored in CORD. - string string_value = 6; - - // Struct type value. It contains a ValueList representing the values in - // this struct. - ValueList struct_value = 7; - - // Timestamp type value. - google.protobuf.Timestamp timestamp_value = 8; - - // Date type value. Date is specified as a number of days since Unix epoch. - int32 date_days_value = 9; - - // If set, holds the sentinel value for the transaction CommitTimestamp. - bool is_commit_timestamp = 10; - - // Array type value. The underlying Valuelist should have values that have - // the same type. - ValueList array_value = 11; - } - - // Type of array element. Only set if value is an array. - optional google.spanner.v1.Type array_type = 12; -} - -// KeyRange represents a range of rows in a table or index. -// -// A range has a start key and an end key. These keys can be open or -// closed, indicating if the range includes rows with that key. -// -// Keys are represented by "ValueList", where the ith value in the list -// corresponds to the ith component of the table or index primary key. -message KeyRange { - // Type controls whether "start" and "limit" are open or closed. By default, - // "start" is closed, and "limit" is open. - enum Type { - // "TYPE_UNSPECIFIED" is equivalent to "CLOSED_OPEN". - TYPE_UNSPECIFIED = 0; - - // [start,limit] - CLOSED_CLOSED = 1; - - // [start,limit) - CLOSED_OPEN = 2; - - // (start,limit] - OPEN_CLOSED = 3; - - // (start,limit) - OPEN_OPEN = 4; - } - - // "start" and "limit" must have the same number of key parts, - // though they may name only a prefix of the table or index key. - // The start key of this KeyRange. - ValueList start = 1; - - // The end key of this KeyRange. - ValueList limit = 2; - - // "start" and "limit" type for this KeyRange. - optional Type type = 3; -} - -// KeySet defines a collection of Spanner keys and/or key ranges. All -// the keys are expected to be in the same table. The keys need not be -// sorted in any particular way. -message KeySet { - // A list of specific keys. Entries in "keys" should have exactly as - // many elements as there are columns in the primary or index key - // with which this "KeySet" is used. - repeated ValueList point = 1; - - // A list of key ranges. - repeated KeyRange range = 2; - - // For convenience "all" can be set to "true" to indicate that this - // "KeySet" matches all keys in the table or index. Note that any keys - // specified in "keys" or "ranges" are only yielded once. - bool all = 3; -} - -// List of values. -message ValueList { - // Values contained in this ValueList. - repeated Value value = 1; -} - -// A single mutation request. -message MutationAction { - // Arguments to Insert, InsertOrUpdate, and Replace operations. - message InsertArgs { - // The names of the columns to be written. - repeated string column = 1; - - // Type information for the "values" entries below. - repeated google.spanner.v1.Type type = 2; - - // The values to be written. - repeated ValueList values = 3; - } - - // Arguments to Update. - message UpdateArgs { - // The columns to be updated. Identical to InsertArgs.column. - repeated string column = 1; - - // Type information for "values". Identical to InsertArgs.type. - repeated google.spanner.v1.Type type = 2; - - // The values to be updated. Identical to InsertArgs.values. - repeated ValueList values = 3; - } - - // Mod represents the write action that will be perform to a table. Each mod - // will specify exactly one action, from insert, update, insert_or_update, - // replace and delete. - message Mod { - // The table to write. - string table = 1; - - // Exactly one of the remaining elements may be present. - // Insert new rows into "table". - InsertArgs insert = 2; - - // Update columns stored in existing rows of "table". - UpdateArgs update = 3; - - // Insert or update existing rows of "table". - InsertArgs insert_or_update = 4; - - // Replace existing rows of "table". - InsertArgs replace = 5; - - // Delete rows from "table". - KeySet delete_keys = 6; - } - - // Mods that contained in this mutation. - repeated Mod mod = 1; -} - -// WriteMutationAction defines an action of flushing the mutation so they -// are visible to subsequent operations in the transaction. -message WriteMutationsAction { - // The mutation to write. - MutationAction mutation = 1; -} - -// PartitionedUpdateAction defines an action to execute a partitioned DML -// which runs different partitions in parallel. -message PartitionedUpdateAction { - message ExecutePartitionedUpdateOptions { - // RPC Priority - optional google.spanner.v1.RequestOptions.Priority rpc_priority = 1; - - // Transaction tag - optional string tag = 2; - } - - // Options for partitioned update. - optional ExecutePartitionedUpdateOptions options = 1; - - // Partitioned dml query. - QueryAction update = 2; -} - -// StartTransactionAction defines an action of initializing a transaction. -message StartTransactionAction { - // Concurrency is for read-only transactions and must be omitted for - // read-write transactions. - optional Concurrency concurrency = 1; - - // Metadata about tables and columns that will be involved in this - // transaction. It is to convert values of key parts correctly. - repeated TableMetadata table = 2; - - // Transaction_seed contains workid and op pair for this transaction, used for - // testing. - string transaction_seed = 3; - - // Execution options (e.g., whether transaction is opaque, optimistic). - optional TransactionExecutionOptions execution_options = 4; -} - -// Concurrency for read-only transactions. -message Concurrency { - // Concurrency mode set for read-only transactions, exactly one mode below - // should be set. - oneof concurrency_mode { - // Indicates a read at a consistent timestamp that is specified relative to - // now. That is, if the caller has specified an exact staleness of s - // seconds, we will read at now - s. - double staleness_seconds = 1; - - // Indicates a boundedly stale read that reads at a timestamp >= T. - int64 min_read_timestamp_micros = 2; - - // Indicates a boundedly stale read that is at most N seconds stale. - double max_staleness_seconds = 3; - - // Indicates a read at a consistent timestamp. - int64 exact_timestamp_micros = 4; - - // Indicates a strong read, must only be set to true, or unset. - bool strong = 5; - - // Indicates a batch read, must only be set to true, or unset. - bool batch = 6; - } - - // True if exact_timestamp_micros is set, and the chosen timestamp is that of - // a snapshot epoch. - bool snapshot_epoch_read = 7; - - // If set, this is a snapshot epoch read constrained to read only the - // specified log scope root table, and its children. Will not be set for full - // database epochs. - string snapshot_epoch_root_table = 8; - - // Set only when batch is true. - int64 batch_read_timestamp_micros = 9; -} - -// TableMetadata contains metadata of a single table. -message TableMetadata { - // Table name. - string name = 1; - - // Columns, in the same order as in the schema. - repeated ColumnMetadata column = 2; - - // Keys, in order. Column name is currently not populated. - repeated ColumnMetadata key_column = 3; -} - -// ColumnMetadata represents metadata of a single column. -message ColumnMetadata { - // Column name. - string name = 1; - - // Column type. - google.spanner.v1.Type type = 2; -} - -// Options for executing the transaction. -message TransactionExecutionOptions { - // Whether optimistic concurrency should be used to execute this transaction. - bool optimistic = 1; -} - -// FinishTransactionAction defines an action of finishing a transaction. -message FinishTransactionAction { - // Mode indicates how the transaction should be finished. - enum Mode { - // "MODE_UNSPECIFIED" is equivalent to "COMMIT". - MODE_UNSPECIFIED = 0; - - // Commit the transaction. - COMMIT = 1; - - // Drop the transaction without committing it. - ABANDON = 2; - } - - // Defines how exactly the transaction should be completed, e.g. with - // commit or abortion. - Mode mode = 1; -} - -// AdminAction defines all the cloud spanner admin actions, including -// instance/database admin ops, backup ops and operation actions. -message AdminAction { - // Exactly one of the actions below will be performed in AdminAction. - oneof action { - // Action that creates a user instance config. - CreateUserInstanceConfigAction create_user_instance_config = 1; - - // Action that updates a user instance config. - UpdateUserInstanceConfigAction update_user_instance_config = 2; - - // Action that deletes a user instance config. - DeleteUserInstanceConfigAction delete_user_instance_config = 3; - - // Action that gets a user instance config. - GetCloudInstanceConfigAction get_cloud_instance_config = 4; - - // Action that lists user instance configs. - ListCloudInstanceConfigsAction list_instance_configs = 5; - - // Action that creates a Cloud Spanner instance. - CreateCloudInstanceAction create_cloud_instance = 6; - - // Action that updates a Cloud Spanner instance. - UpdateCloudInstanceAction update_cloud_instance = 7; - - // Action that deletes a Cloud Spanner instance. - DeleteCloudInstanceAction delete_cloud_instance = 8; - - // Action that lists Cloud Spanner instances. - ListCloudInstancesAction list_cloud_instances = 9; - - // Action that retrieves a Cloud Spanner instance. - GetCloudInstanceAction get_cloud_instance = 10; - - // Action that creates a Cloud Spanner database. - CreateCloudDatabaseAction create_cloud_database = 11; - - // Action that updates the schema of a Cloud Spanner database. - UpdateCloudDatabaseDdlAction update_cloud_database_ddl = 12; - - // Action that updates the schema of a Cloud Spanner database. - UpdateCloudDatabaseAction update_cloud_database = 27; - - // Action that drops a Cloud Spanner database. - DropCloudDatabaseAction drop_cloud_database = 13; - - // Action that lists Cloud Spanner databases. - ListCloudDatabasesAction list_cloud_databases = 14; - - // Action that lists Cloud Spanner database operations. - ListCloudDatabaseOperationsAction list_cloud_database_operations = 15; - - // Action that restores a Cloud Spanner database from a backup. - RestoreCloudDatabaseAction restore_cloud_database = 16; - - // Action that gets a Cloud Spanner database. - GetCloudDatabaseAction get_cloud_database = 17; - - // Action that creates a Cloud Spanner database backup. - CreateCloudBackupAction create_cloud_backup = 18; - - // Action that copies a Cloud Spanner database backup. - CopyCloudBackupAction copy_cloud_backup = 19; - - // Action that gets a Cloud Spanner database backup. - GetCloudBackupAction get_cloud_backup = 20; - - // Action that updates a Cloud Spanner database backup. - UpdateCloudBackupAction update_cloud_backup = 21; - - // Action that deletes a Cloud Spanner database backup. - DeleteCloudBackupAction delete_cloud_backup = 22; - - // Action that lists Cloud Spanner database backups. - ListCloudBackupsAction list_cloud_backups = 23; - - // Action that lists Cloud Spanner database backup operations. - ListCloudBackupOperationsAction list_cloud_backup_operations = 24; - - // Action that gets an operation. - GetOperationAction get_operation = 25; - - // Action that cancels an operation. - CancelOperationAction cancel_operation = 26; - - // Action that changes quorum of a Cloud Spanner database. - ChangeQuorumCloudDatabaseAction change_quorum_cloud_database = 28; - } -} - -// Action that creates a user instance config. -message CreateUserInstanceConfigAction { - // User instance config ID (not path), e.g. "custom-config". - string user_config_id = 1; - - // Cloud project ID, e.g. "spanner-cloud-systest". - string project_id = 2; - - // Base config ID, e.g. "test-config". - string base_config_id = 3; - - // Replicas that should be included in the user config. - repeated google.spanner.admin.instance.v1.ReplicaInfo replicas = 4; -} - -// Action that updates a user instance config. -message UpdateUserInstanceConfigAction { - // User instance config ID (not path), e.g. "custom-config". - string user_config_id = 1; - - // Cloud project ID, e.g. "spanner-cloud-systest". - string project_id = 2; - - // The descriptive name for this instance config as it appears in UIs. - optional string display_name = 3; - - // labels. - map labels = 4; -} - -// Action that gets a user instance config. -message GetCloudInstanceConfigAction { - // Instance config ID (not path), e.g. "custom-config". - string instance_config_id = 1; - - // Cloud project ID, e.g. "spanner-cloud-systest". - string project_id = 2; -} - -// Action that deletes a user instance configs. -message DeleteUserInstanceConfigAction { - // User instance config ID (not path), e.g. "custom-config". - string user_config_id = 1; - - // Cloud project ID, e.g. "spanner-cloud-systest". - string project_id = 2; -} - -// Action that lists user instance configs. -message ListCloudInstanceConfigsAction { - // Cloud project ID, e.g. "spanner-cloud-systest". - string project_id = 1; - - // Number of instance configs to be returned in the response. If 0 or - // less, defaults to the server's maximum allowed page size. - optional int32 page_size = 2; - - // If non-empty, "page_token" should contain a next_page_token - // from a previous ListInstanceConfigsResponse to the same "parent". - optional string page_token = 3; -} - -// Action that creates a Cloud Spanner instance. -message CreateCloudInstanceAction { - // Cloud instance ID (not path), e.g. "test-instance". - string instance_id = 1; - - // Cloud project ID, e.g. "spanner-cloud-systest". - string project_id = 2; - - // Instance config ID, e.g. "test-config". - string instance_config_id = 3; - - // Number of nodes (processing_units should not be set or set to 0 if used). - optional int32 node_count = 4; - - // Number of processing units (node_count should be set to 0 if used). - optional int32 processing_units = 6; - - // The autoscaling config for this instance. If non-empty, an autoscaling - // instance will be created (processing_units and node_count should be set to - // 0 if used). - optional google.spanner.admin.instance.v1.AutoscalingConfig - autoscaling_config = 7; - - // labels. - map labels = 5; -} - -// Action that updates a Cloud Spanner instance. -message UpdateCloudInstanceAction { - // Cloud instance ID (not path), e.g. "test-instance". - string instance_id = 1; - - // Cloud project ID, e.g. "spanner-cloud-systest". - string project_id = 2; - - // The descriptive name for this instance as it appears in UIs. - // Must be unique per project and between 4 and 30 characters in length. - optional string display_name = 3; - - // The number of nodes allocated to this instance. At most one of either - // node_count or processing_units should be present in the message. - optional int32 node_count = 4; - - // The number of processing units allocated to this instance. At most one of - // processing_units or node_count should be present in the message. - optional int32 processing_units = 5; - - // The autoscaling config for this instance. If non-empty, this instance is - // using autoscaling (processing_units and node_count should be set to - // 0 if used). - optional google.spanner.admin.instance.v1.AutoscalingConfig - autoscaling_config = 7; - - // labels. - map labels = 6; -} - -// Action that deletes a Cloud Spanner instance. -message DeleteCloudInstanceAction { - // Cloud instance ID (not path), e.g. "test-instance". - string instance_id = 1; - - // Cloud project ID, e.g. "spanner-cloud-systest". - string project_id = 2; -} - -// Action that creates a Cloud Spanner database. -message CreateCloudDatabaseAction { - // Cloud instance ID (not path), e.g. "test-instance". - string instance_id = 1; - - // Cloud project ID, e.g. "spanner-cloud-systest". - string project_id = 2; - - // Cloud database ID (not full path), e.g. "db0". - string database_id = 3; - - // SDL statements to apply to the new database. - repeated string sdl_statement = 4; - - // The KMS key used to encrypt the database to be created if the database - // should be CMEK protected. - google.spanner.admin.database.v1.EncryptionConfig encryption_config = 5; - - // Optional SQL dialect (GOOGLESQL or POSTGRESQL). Default: GOOGLESQL. - optional string dialect = 6; - - optional bytes proto_descriptors = 7; -} - -// Action that updates the schema of a Cloud Spanner database. -message UpdateCloudDatabaseDdlAction { - // Cloud instance ID (not path), e.g. "test-instance". - string instance_id = 1; - - // Cloud project ID, e.g. "spanner-cloud-systest". - string project_id = 2; - - // Cloud database ID (not full path), e.g. "db0". - string database_id = 3; - - // SDL statements to apply to the database. - repeated string sdl_statement = 4; - - // Op ID can be used to track progress of the update. If set, it must be - // unique per database. If not set, Cloud Spanner will generate operation ID - // automatically. - string operation_id = 5; - - optional bytes proto_descriptors = 6; -} - -// Action that updates a Cloud Spanner database. -message UpdateCloudDatabaseAction { - // Cloud instance ID (not path), e.g. "test-instance". - string instance_id = 1; - - // Cloud project ID, e.g. "spanner-cloud-systest". - string project_id = 2; - - // Cloud database name (not full path), e.g. "db0". - string database_name = 3; - - // Updated value of enable_drop_protection, this is the only field that has - // supported to be updated. - bool enable_drop_protection = 4; -} - -// Action that drops a Cloud Spanner database. -message DropCloudDatabaseAction { - // Cloud instance ID (not path), e.g. "test-instance". - string instance_id = 1; - - // Cloud project ID, e.g. "spanner-cloud-systest". - string project_id = 2; - - // Cloud database ID (not full path), e.g. "db0". - string database_id = 3; -} - -// Action that changes quorum of a Cloud Spanner database. -message ChangeQuorumCloudDatabaseAction { - // The fully qualified uri of the database whose quorum has to be changed. - optional string database_uri = 1; - - // The locations of the serving regions, e.g. "asia-south1". - repeated string serving_locations = 2; -} - -// Action that lists Cloud Spanner databases. -message ListCloudDatabasesAction { - // Cloud project ID, e.g. "spanner-cloud-systest". - string project_id = 1; - - // Cloud instance ID (not path) to list databases from, e.g. "test-instance". - string instance_id = 2; - - // Number of databases to be returned in the response. If 0 or - // less, defaults to the server's maximum allowed page size. - int32 page_size = 3; - - // If non-empty, "page_token" should contain a next_page_token - // from a previous ListDatabasesResponse to the same "parent" - // and with the same "filter". - string page_token = 4; -} - -// Action that lists Cloud Spanner databases. -message ListCloudInstancesAction { - // Cloud project ID, e.g. "spanner-cloud-systest". - string project_id = 1; - - // A filter expression that filters what operations are returned in the - // response. - // The expression must specify the field name, a comparison operator, - // and the value that you want to use for filtering. - // Refer spanner_instance_admin.proto.ListInstancesRequest for - // detail. - optional string filter = 2; - - // Number of instances to be returned in the response. If 0 or - // less, defaults to the server's maximum allowed page size. - optional int32 page_size = 3; - - // If non-empty, "page_token" should contain a next_page_token - // from a previous ListInstancesResponse to the same "parent" - // and with the same "filter". - optional string page_token = 4; -} - -// Action that retrieves a Cloud Spanner instance. -message GetCloudInstanceAction { - // Cloud project ID, e.g. "spanner-cloud-systest". - string project_id = 1; - - // Cloud instance ID (not path) to retrieve the instance from, - // e.g. "test-instance". - string instance_id = 2; -} - -// Action that lists Cloud Spanner database operations. -message ListCloudDatabaseOperationsAction { - // Cloud project ID, e.g. "spanner-cloud-systest". - string project_id = 1; - - // Cloud instance ID (not path) to list database operations from, - // e.g. "test-instance". - string instance_id = 2; - - // A filter expression that filters what operations are returned in the - // response. - // The expression must specify the field name, a comparison operator, - // and the value that you want to use for filtering. - // Refer spanner_database_admin.proto.ListDatabaseOperationsRequest for - // detail. - string filter = 3; - - // Number of databases to be returned in the response. If 0 or - // less, defaults to the server's maximum allowed page size. - int32 page_size = 4; - - // If non-empty, "page_token" should contain a next_page_token - // from a previous ListDatabaseOperationsResponse to the same "parent" - // and with the same "filter". - string page_token = 5; -} - -// Action that restores a Cloud Spanner database from a backup. -message RestoreCloudDatabaseAction { - // Cloud project ID, e.g. "spanner-cloud-systest". - string project_id = 1; - - // Cloud instance ID (not path) containing the backup, e.g. "backup-instance". - string backup_instance_id = 2; - - // The id of the backup from which to restore, e.g. "test-backup". - string backup_id = 3; - - // Cloud instance ID (not path) containing the database, e.g. - // "database-instance". - string database_instance_id = 4; - - // The id of the database to create and restore to, e.g. "db0". Note that this - // database must not already exist. - string database_id = 5; - - // The KMS key(s) used to encrypt the restored database to be created if the - // restored database should be CMEK protected. - google.spanner.admin.database.v1.EncryptionConfig encryption_config = 7; -} - -// Action that gets a Cloud Spanner database. -message GetCloudDatabaseAction { - // Cloud project ID, e.g. "spanner-cloud-systest". - string project_id = 1; - - // Cloud instance ID (not path), e.g. "test-instance". - string instance_id = 2; - - // The id of the database to get, e.g. "db0". - string database_id = 3; -} - -// Action that creates a Cloud Spanner database backup. -message CreateCloudBackupAction { - // Cloud project ID, e.g. "spanner-cloud-systest". - string project_id = 1; - - // Cloud instance ID (not path), e.g. "test-instance". - string instance_id = 2; - - // The id of the backup to be created, e.g. "test-backup". - string backup_id = 3; - - // The id of the database from which this backup was - // created, e.g. "db0". Note that this needs to be in the - // same instance as the backup. - string database_id = 4; - - // Output only. The expiration time of the backup, which must be at least 6 - // hours and at most 366 days from the time the request is received. - google.protobuf.Timestamp expire_time = 5 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The version time of the backup, which must be within the time range of - // [earliest_version_time, NOW], where earliest_version_time is retrieved by - // cloud spanner frontend API (See details: go/cs-pitr-lite-design). - optional google.protobuf.Timestamp version_time = 6; - - // The KMS key(s) used to encrypt the backup to be created if the backup - // should be CMEK protected. - google.spanner.admin.database.v1.EncryptionConfig encryption_config = 7; -} - -// Action that copies a Cloud Spanner database backup. -message CopyCloudBackupAction { - // Cloud project ID, e.g. "spanner-cloud-systest". - string project_id = 1; - - // Cloud instance ID (not path), e.g. "test-instance". - string instance_id = 2; - - // The id of the backup to be created, e.g. "test-backup". - string backup_id = 3; - - // The fully qualified uri of the source backup from which this - // backup was copied. eg. - // "projects//instances//backups/". - string source_backup = 4; - - // Output only. The expiration time of the backup, which must be at least 6 - // hours and at most 366 days from the time the request is received. - google.protobuf.Timestamp expire_time = 5 - [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Action that gets a Cloud Spanner database backup. -message GetCloudBackupAction { - // Cloud project ID, e.g. "spanner-cloud-systest". - string project_id = 1; - - // Cloud instance ID (not path), e.g. "test-instance". - string instance_id = 2; - - // The id of the backup to get, e.g. "test-backup". - string backup_id = 3; -} - -// Action that updates a Cloud Spanner database backup. -message UpdateCloudBackupAction { - // Cloud project ID, e.g. "spanner-cloud-systest". - string project_id = 1; - - // Cloud instance ID (not path), e.g. "test-instance". - string instance_id = 2; - - // The id of the backup to update, e.g. "test-backup". - string backup_id = 3; - - // Output only. Updated value of expire_time, this is the only field - // that supported to be updated. - google.protobuf.Timestamp expire_time = 4 - [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Action that deletes a Cloud Spanner database backup. -message DeleteCloudBackupAction { - // Cloud project ID, e.g. "spanner-cloud-systest". - string project_id = 1; - - // Cloud instance ID (not path), e.g. "test-instance". - string instance_id = 2; - - // The id of the backup to delete, e.g. "test-backup". - string backup_id = 3; -} - -// Action that lists Cloud Spanner database backups. -message ListCloudBackupsAction { - // Cloud project ID, e.g. "spanner-cloud-systest". - string project_id = 1; - - // Cloud instance ID (not path) to list backups from, e.g. "test-instance". - string instance_id = 2; - - // A filter expression that filters backups listed in the response. - // The expression must specify the field name, a comparison operator, - // and the value that you want to use for filtering. - // Refer backup.proto.ListBackupsRequest for detail. - string filter = 3; - - // Number of backups to be returned in the response. If 0 or - // less, defaults to the server's maximum allowed page size. - int32 page_size = 4; - - // If non-empty, "page_token" should contain a next_page_token - // from a previous ListBackupsResponse to the same "parent" - // and with the same "filter". - string page_token = 5; -} - -// Action that lists Cloud Spanner database backup operations. -message ListCloudBackupOperationsAction { - // Cloud project ID, e.g. "spanner-cloud-systest". - string project_id = 1; - - // Cloud instance ID (not path) to list backup operations from, - // e.g. "test-instance". - string instance_id = 2; - - // A filter expression that filters what operations are returned in the - // response. - // The expression must specify the field name, a comparison operator, - // and the value that you want to use for filtering. - // Refer backup.proto.ListBackupOperationsRequest for detail. - string filter = 3; - - // Number of backups to be returned in the response. If 0 or - // less, defaults to the server's maximum allowed page size. - int32 page_size = 4; - - // If non-empty, "page_token" should contain a next_page_token - // from a previous ListBackupOperationsResponse to the same "parent" - // and with the same "filter". - string page_token = 5; -} - -// Action that gets an operation. -message GetOperationAction { - // The name of the operation resource. - string operation = 1; -} - -// Query cancellation action defines the long running query and the cancel query -// format depening on the Cloud database dialect. -message QueryCancellationAction { - // Long running query. - string long_running_sql = 1; - - // Format of the cancel query for the cloud database dialect. - string cancel_query = 2; -} - -// Action that cancels an operation. -message CancelOperationAction { - // The name of the operation resource to be cancelled. - string operation = 1; -} - -// Starts a batch read-only transaction in executor. Successful outcomes of this -// action will contain batch_txn_id--the identificator that can be used to start -// the same transaction in other Executors to parallelize partition processing. -// -// Example of a batch read flow: -// 1. Start batch transaction with a timestamp (StartBatchTransactionAction) -// 2. Generate database partitions for a read or query -// (GenerateDbPartitionsForReadAction/GenerateDbPartitionsForQueryAction) -// 3. Call ExecutePartitionAction for some or all partitions, process rows -// 4. Clean up the transaction (CloseBatchTransactionAction). -// -// More sophisticated example, with parallel processing: -// 1. Start batch transaction with a timestamp (StartBatchTransactionAction), -// note the returned BatchTransactionId -// 2. Generate database partitions for a read or query -// (GenerateDbPartitionsForReadAction/GenerateDbPartitionsForQueryAction) -// 3. Distribute the partitions over a pool of workers, along with the -// transaction ID. -// -// In each worker: -// 4-1. StartBatchTransactionAction with the given transaction ID -// 4-2. ExecutePartitionAction for each partition it got, process read results -// 4-3. Close (not cleanup) the transaction (CloseBatchTransactionAction). -// -// When all workers are done: -// 5. Cleanup the transaction (CloseBatchTransactionAction). This can be done -// either by the last worker to finish the job, or by the main Executor that -// initialized this transaction in the first place. It is also possible to clean -// it up with a brand new Executor -- just execute StartBatchTransactionAction -// with the ID, then clean it up right away. -// -// Cleaning up is optional, but recommended. -message StartBatchTransactionAction { - // To start a new transaction, specify an exact timestamp. Alternatively, an - // existing batch transaction ID can be used. Either one of two must be - // set. - oneof param { - // The exact timestamp to start the batch transaction. - google.protobuf.Timestamp batch_txn_time = 1; - - // ID of a batch read-only transaction. It can be used to start the same - // batch transaction on multiple executors and parallelize partition - // processing. - bytes tid = 2; - } - - // Database role to assume while performing this action. Setting the - // database_role will enforce additional role-based access checks on this - // action. - string cloud_database_role = 3; -} - -// Closes or cleans up the currently opened batch read-only transaction. -// -// Once a transaction is closed, the Executor can be disposed of or used to -// start start another transaction. Closing a batch transaction in one Executor -// doesn't affect the transaction's state in other Executors that also read from -// it. -// -// When a transaction is cleaned up, it becomes globally invalid. Cleaning up is -// optional, but recommended. -message CloseBatchTransactionAction { - // Indicates whether the transaction needs to be cleaned up. - bool cleanup = 1; -} - -// Generate database partitions for the given read. Successful outcomes will -// contain database partitions in the db_partition field. -message GenerateDbPartitionsForReadAction { - // Read to generate partitions for. - ReadAction read = 1; - - // Metadata related to the tables involved in the read. - repeated TableMetadata table = 2; - - // Desired size of data in each partition. Spanner doesn't guarantee to - // respect this value. - optional int64 desired_bytes_per_partition = 3; - - // If set, the desired max number of partitions. Spanner doesn't guarantee to - // respect this value. - optional int64 max_partition_count = 4; -} - -// Generate database partitions for the given query. Successful outcomes will -// contain database partitions in the db_partition field. -message GenerateDbPartitionsForQueryAction { - // Query to generate partitions for. - QueryAction query = 1; - - // Desired size of data in each partition. Spanner doesn't guarantee to - // respect this value. - optional int64 desired_bytes_per_partition = 2; -} - -// Identifies a database partition generated for a particular read or query. To -// read rows from the partition, use ExecutePartitionAction. -message BatchPartition { - // Serialized Partition instance. - bytes partition = 1; - - // The partition token decrypted from partition. - bytes partition_token = 2; - - // Table name is set iff the partition was generated for a read (as opposed to - // a query). - optional string table = 3; - - // Index name if the partition was generated for an index read. - optional string index = 4; -} - -// Performs a read or query for the given partitions. This action must be -// executed in the context of the same transaction that was used to generate -// given partitions. -message ExecutePartitionAction { - // Batch partition to execute on. - BatchPartition partition = 1; -} - -// Execute a change stream TVF query. -message ExecuteChangeStreamQuery { - // Name for this change stream. - string name = 1; - - // Specifies that records with commit_timestamp greater than or equal to - // start_time should be returned. - google.protobuf.Timestamp start_time = 2; - - // Specifies that records with commit_timestamp less than or equal to - // end_time should be returned. - optional google.protobuf.Timestamp end_time = 3; - - // Specifies which change stream partition to query, based on the content of - // child partitions records. - optional string partition_token = 4; - - // Read options for this change stream query. - repeated string read_options = 5; - - // Determines how frequently a heartbeat ChangeRecord will be returned in case - // there are no transactions committed in this partition, in milliseconds. - optional int32 heartbeat_milliseconds = 6; - - // Deadline for this change stream query, in seconds. - optional int64 deadline_seconds = 7; - - // Database role to assume while performing this action. This should only be - // set for cloud requests. Setting the database role will enforce additional - // role-based access checks on this action. - optional string cloud_database_role = 8; -} - -// SpannerActionOutcome defines a result of execution of a single SpannerAction. -message SpannerActionOutcome { - // If an outcome is split into multiple parts, status will be set only in the - // last part. - optional google.rpc.Status status = 1; - - // Transaction timestamp. It must be set for successful committed actions. - optional google.protobuf.Timestamp commit_time = 2; - - // Result of a ReadAction. This field must be set for ReadActions even if - // no rows were read. - optional ReadResult read_result = 3; - - // Result of a Query. This field must be set for Queries even if no rows were - // read. - optional QueryResult query_result = 4; - - // This bit indicates that Spanner has restarted the current transaction. It - // means that the client should replay all the reads and writes. - // Setting it to true is only valid in the context of a read-write - // transaction, as an outcome of a committing FinishTransactionAction. - optional bool transaction_restarted = 5; - - // In successful StartBatchTransactionAction outcomes, this contains the ID of - // the transaction. - optional bytes batch_txn_id = 6; - - // Generated database partitions (result of a - // GenetageDbPartitionsForReadAction/GenerateDbPartitionsForQueryAction). - repeated BatchPartition db_partition = 7; - - // Result of admin related actions. - optional AdminResult admin_result = 8; - - // Stores rows modified by query in single DML or batch DML action. - // In case of batch DML action, stores 0 as row count of errored DML query. - repeated int64 dml_rows_modified = 9; - - // Change stream records returned by a change stream query. - repeated ChangeStreamRecord change_stream_records = 10; -} - -// AdminResult contains admin action results, for database/backup/operation. -message AdminResult { - // Results of cloud backup related actions. - CloudBackupResponse backup_response = 1; - - // Results of operation related actions. - OperationResponse operation_response = 2; - - // Results of database related actions. - CloudDatabaseResponse database_response = 3; - - // Results of instance related actions. - CloudInstanceResponse instance_response = 4; - - // Results of instance config related actions. - CloudInstanceConfigResponse instance_config_response = 5; -} - -// CloudBackupResponse contains results returned by cloud backup related -// actions. -message CloudBackupResponse { - // List of backups returned by ListCloudBackupsAction. - repeated google.spanner.admin.database.v1.Backup listed_backups = 1; - - // List of operations returned by ListCloudBackupOperationsAction. - repeated google.longrunning.Operation listed_backup_operations = 2; - - // "next_page_token" can be sent in a subsequent list action - // to fetch more of the matching data. - string next_page_token = 3; - - // Backup returned by GetCloudBackupAction/UpdateCloudBackupAction. - google.spanner.admin.database.v1.Backup backup = 4; -} - -// OperationResponse contains results returned by operation related actions. -message OperationResponse { - // List of operations returned by ListOperationsAction. - repeated google.longrunning.Operation listed_operations = 1; - - // "next_page_token" can be sent in a subsequent list action - // to fetch more of the matching data. - string next_page_token = 2; - - // Operation returned by GetOperationAction. - google.longrunning.Operation operation = 3; -} - -// CloudInstanceResponse contains results returned by cloud instance related -// actions. -message CloudInstanceResponse { - // List of instances returned by ListCloudInstancesAction. - repeated google.spanner.admin.instance.v1.Instance listed_instances = 1; - - // "next_page_token" can be sent in a subsequent list action - // to fetch more of the matching data. - string next_page_token = 2; - - // Instance returned by GetCloudInstanceAction - google.spanner.admin.instance.v1.Instance instance = 3; -} - -// CloudInstanceConfigResponse contains results returned by cloud instance -// config related actions. -message CloudInstanceConfigResponse { - // List of instance configs returned by ListCloudInstanceConfigsAction. - repeated google.spanner.admin.instance.v1.InstanceConfig - listed_instance_configs = 1; - - // "next_page_token" can be sent in a subsequent list action - // to fetch more of the matching data. - string next_page_token = 2; - - // Instance config returned by GetCloudInstanceConfigAction. - google.spanner.admin.instance.v1.InstanceConfig instance_config = 3; -} - -// CloudDatabaseResponse contains results returned by cloud database related -// actions. -message CloudDatabaseResponse { - // List of databases returned by ListCloudDatabasesAction. - repeated google.spanner.admin.database.v1.Database listed_databases = 1; - - // List of operations returned by ListCloudDatabaseOperationsAction. - repeated google.longrunning.Operation listed_database_operations = 2; - - // "next_page_token" can be sent in a subsequent list action - // to fetch more of the matching data. - string next_page_token = 3; - - // Database returned by GetCloudDatabaseAction - google.spanner.admin.database.v1.Database database = 4; -} - -// ReadResult contains rows read. -message ReadResult { - // Table name. - string table = 1; - - // Index name, if read from an index. - optional string index = 2; - - // Request index (multiread only). - optional int32 request_index = 3; - - // Rows read. Each row is a struct with multiple fields, one for each column - // in read result. All rows have the same type. - repeated ValueList row = 4; - - // The type of rows read. It must be set if at least one row was read. - optional google.spanner.v1.StructType row_type = 5; -} - -// QueryResult contains result of a Query. -message QueryResult { - // Rows read. Each row is a struct with multiple fields, one for each column - // in read result. All rows have the same type. - repeated ValueList row = 1; - - // The type of rows read. It must be set if at least one row was read. - optional google.spanner.v1.StructType row_type = 2; -} - -// Raw ChangeStream records. -// Encodes one of: DataChangeRecord, HeartbeatRecord, ChildPartitionsRecord -// returned from the ChangeStream API. -message ChangeStreamRecord { - // Record represents one type of the change stream record. - oneof record { - // Data change record. - DataChangeRecord data_change = 1; - - // Child partitions record. - ChildPartitionsRecord child_partition = 2; - - // Heartbeat record. - HeartbeatRecord heartbeat = 3; - } -} - -// ChangeStream data change record. -message DataChangeRecord { - // Column types. - message ColumnType { - // Column name. - string name = 1; - - // Column type in JSON. - string type = 2; - - // Whether the column is a primary key column. - bool is_primary_key = 3; - - // The position of the column as defined in the schema. - int64 ordinal_position = 4; - } - - // Describes the changes that were made. - message Mod { - // The primary key values in JSON. - string keys = 1; - - // The new values of the changed columns in JSON. Only contain the non-key - // columns. - string new_values = 2; - - // The old values of the changed columns in JSON. Only contain the non-key - // columns. - string old_values = 3; - } - - // The timestamp in which the change was committed. - google.protobuf.Timestamp commit_time = 1; - - // The sequence number for the record within the transaction. - string record_sequence = 2; - - // A globally unique string that represents the transaction in which the - // change was committed. - string transaction_id = 3; - - // Indicates whether this is the last record for a transaction in the current - // partition. - bool is_last_record = 4; - - // Name of the table affected by the change. - string table = 5; - - // Column types defined in the schema. - repeated ColumnType column_types = 6; - - // Changes made in the transaction. - repeated Mod mods = 7; - - // Describes the type of change. One of INSERT, UPDATE or DELETE. - string mod_type = 8; - - // One of value capture type: NEW_VALUES, OLD_VALUES, OLD_AND_NEW_VALUES. - string value_capture_type = 9; - - // Number of records in transactions. - int64 record_count = 10; - - // Number of partitions in transactions. - int64 partition_count = 11; - - // Transaction tag info. - string transaction_tag = 12; - - // Whether the transaction is a system transactionn. - bool is_system_transaction = 13; -} - -// ChangeStream child partition record. -message ChildPartitionsRecord { - // A single child partition. - message ChildPartition { - // Partition token string used to identify the child partition in queries. - string token = 1; - - // Parent partition tokens of this child partition. - repeated string parent_partition_tokens = 2; - } - - // Data change records returned from child partitions in this child partitions - // record will have a commit timestamp greater than or equal to start_time. - google.protobuf.Timestamp start_time = 1; - - // A monotonically increasing sequence number that can be used to define the - // ordering of the child partitions record when there are multiple child - // partitions records returned with the same start_time in a particular - // partition. - string record_sequence = 2; - - // A set of child partitions and their associated information. - repeated ChildPartition child_partitions = 3; -} - -// ChangeStream heartbeat record. -message HeartbeatRecord { - // Timestamp for this heartbeat check. - google.protobuf.Timestamp heartbeat_time = 1; -} - -// Options for Cloud Spanner Service. -message SpannerOptions { - // Options for configuring the session pool - SessionPoolOptions session_pool_options = 1; -} - -// Options for the session pool used by the DatabaseClient. -message SessionPoolOptions { - // passing this as true, will make applicable RPCs use multiplexed sessions - // instead of regular sessions - bool use_multiplexed = 1; -} diff --git a/owl-bot-staging/executor/v1/protos/google/spanner/v1/change_stream.proto b/owl-bot-staging/executor/v1/protos/google/spanner/v1/change_stream.proto deleted file mode 100644 index e7d12e608..000000000 --- a/owl-bot-staging/executor/v1/protos/google/spanner/v1/change_stream.proto +++ /dev/null @@ -1,451 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.spanner.v1; - -import "google/protobuf/struct.proto"; -import "google/protobuf/timestamp.proto"; -import "google/spanner/v1/type.proto"; - -option csharp_namespace = "Google.Cloud.Spanner.V1"; -option go_package = "cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb"; -option java_multiple_files = true; -option java_outer_classname = "ChangeStreamProto"; -option java_package = "com.google.spanner.v1"; -option php_namespace = "Google\\Cloud\\Spanner\\V1"; -option ruby_package = "Google::Cloud::Spanner::V1"; - -// Spanner Change Streams enable customers to capture and stream out changes to -// their Spanner databases in real-time. A change stream -// can be created with option partition_mode='IMMUTABLE_KEY_RANGE' or -// partition_mode='MUTABLE_KEY_RANGE'. -// -// This message is only used in Change Streams created with the option -// partition_mode='MUTABLE_KEY_RANGE'. Spanner automatically creates a special -// Table-Valued Function (TVF) along with each Change Streams. The function -// provides access to the change stream's records. The function is named -// READ_ (where is the -// name of the change stream), and it returns a table with only one column -// called ChangeRecord. -message ChangeStreamRecord { - // A data change record contains a set of changes to a table with the same - // modification type (insert, update, or delete) committed at the same commit - // timestamp in one change stream partition for the same transaction. Multiple - // data change records can be returned for the same transaction across - // multiple change stream partitions. - message DataChangeRecord { - // Metadata for a column. - message ColumnMetadata { - // Name of the column. - string name = 1; - - // Type of the column. - Type type = 2; - - // Indicates whether the column is a primary key column. - bool is_primary_key = 3; - - // Ordinal position of the column based on the original table definition - // in the schema starting with a value of 1. - int64 ordinal_position = 4; - } - - // Returns the value and associated metadata for a particular field of the - // [Mod][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod]. - message ModValue { - // Index within the repeated - // [column_metadata][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.column_metadata] - // field, to obtain the column metadata for the column that was modified. - int32 column_metadata_index = 1; - - // The value of the column. - google.protobuf.Value value = 2; - } - - // A mod describes all data changes in a watched table row. - message Mod { - // Returns the value of the primary key of the modified row. - repeated ModValue keys = 1; - - // Returns the old values before the change for the modified columns. - // Always empty for - // [INSERT][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType.INSERT], - // or if old values are not being captured specified by - // [value_capture_type][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ValueCaptureType]. - repeated ModValue old_values = 2; - - // Returns the new values after the change for the modified columns. - // Always empty for - // [DELETE][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType.DELETE]. - repeated ModValue new_values = 3; - } - - // Mod type describes the type of change Spanner applied to the data. For - // example, if the client submits an INSERT_OR_UPDATE request, Spanner will - // perform an insert if there is no existing row and return ModType INSERT. - // Alternatively, if there is an existing row, Spanner will perform an - // update and return ModType UPDATE. - enum ModType { - // Not specified. - MOD_TYPE_UNSPECIFIED = 0; - - // Indicates data was inserted. - INSERT = 10; - - // Indicates existing data was updated. - UPDATE = 20; - - // Indicates existing data was deleted. - DELETE = 30; - } - - // Value capture type describes which values are recorded in the data - // change record. - enum ValueCaptureType { - // Not specified. - VALUE_CAPTURE_TYPE_UNSPECIFIED = 0; - - // Records both old and new values of the modified watched columns. - OLD_AND_NEW_VALUES = 10; - - // Records only new values of the modified watched columns. - NEW_VALUES = 20; - - // Records new values of all watched columns, including modified and - // unmodified columns. - NEW_ROW = 30; - - // Records the new values of all watched columns, including modified and - // unmodified columns. Also records the old values of the modified - // columns. - NEW_ROW_AND_OLD_VALUES = 40; - } - - // Indicates the timestamp in which the change was committed. - // DataChangeRecord.commit_timestamps, - // PartitionStartRecord.start_timestamps, - // PartitionEventRecord.commit_timestamps, and - // PartitionEndRecord.end_timestamps can have the same value in the same - // partition. - google.protobuf.Timestamp commit_timestamp = 1; - - // Record sequence numbers are unique and monotonically increasing (but not - // necessarily contiguous) for a specific timestamp across record - // types in the same partition. To guarantee ordered processing, the reader - // should process records (of potentially different types) in - // record_sequence order for a specific timestamp in the same partition. - // - // The record sequence number ordering across partitions is only meaningful - // in the context of a specific transaction. Record sequence numbers are - // unique across partitions for a specific transaction. Sort the - // DataChangeRecords for the same - // [server_transaction_id][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.server_transaction_id] - // by - // [record_sequence][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.record_sequence] - // to reconstruct the ordering of the changes within the transaction. - string record_sequence = 2; - - // Provides a globally unique string that represents the transaction in - // which the change was committed. Multiple transactions can have the same - // commit timestamp, but each transaction has a unique - // server_transaction_id. - string server_transaction_id = 3; - - // Indicates whether this is the last record for a transaction in the - // current partition. Clients can use this field to determine when all - // records for a transaction in the current partition have been received. - bool is_last_record_in_transaction_in_partition = 4; - - // Name of the table affected by the change. - string table = 5; - - // Provides metadata describing the columns associated with the - // [mods][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.mods] listed - // below. - repeated ColumnMetadata column_metadata = 6; - - // Describes the changes that were made. - repeated Mod mods = 7; - - // Describes the type of change. - ModType mod_type = 8; - - // Describes the value capture type that was specified in the change stream - // configuration when this change was captured. - ValueCaptureType value_capture_type = 9; - - // Indicates the number of data change records that are part of this - // transaction across all change stream partitions. This value can be used - // to assemble all the records associated with a particular transaction. - int32 number_of_records_in_transaction = 10; - - // Indicates the number of partitions that return data change records for - // this transaction. This value can be helpful in assembling all records - // associated with a particular transaction. - int32 number_of_partitions_in_transaction = 11; - - // Indicates the transaction tag associated with this transaction. - string transaction_tag = 12; - - // Indicates whether the transaction is a system transaction. System - // transactions include those issued by time-to-live (TTL), column backfill, - // etc. - bool is_system_transaction = 13; - } - - // A heartbeat record is returned as a progress indicator, when there are no - // data changes or any other partition record types in the change stream - // partition. - message HeartbeatRecord { - // Indicates the timestamp at which the query has returned all the records - // in the change stream partition with timestamp <= heartbeat timestamp. - // The heartbeat timestamp will not be the same as the timestamps of other - // record types in the same partition. - google.protobuf.Timestamp timestamp = 1; - } - - // A partition start record serves as a notification that the client should - // schedule the partitions to be queried. PartitionStartRecord returns - // information about one or more partitions. - message PartitionStartRecord { - // Start timestamp at which the partitions should be queried to return - // change stream records with timestamps >= start_timestamp. - // DataChangeRecord.commit_timestamps, - // PartitionStartRecord.start_timestamps, - // PartitionEventRecord.commit_timestamps, and - // PartitionEndRecord.end_timestamps can have the same value in the same - // partition. - google.protobuf.Timestamp start_timestamp = 1; - - // Record sequence numbers are unique and monotonically increasing (but not - // necessarily contiguous) for a specific timestamp across record - // types in the same partition. To guarantee ordered processing, the reader - // should process records (of potentially different types) in - // record_sequence order for a specific timestamp in the same partition. - string record_sequence = 2; - - // Unique partition identifiers to be used in queries. - repeated string partition_tokens = 3; - } - - // A partition end record serves as a notification that the client should stop - // reading the partition. No further records are expected to be retrieved on - // it. - message PartitionEndRecord { - // End timestamp at which the change stream partition is terminated. All - // changes generated by this partition will have timestamps <= - // end_timestamp. DataChangeRecord.commit_timestamps, - // PartitionStartRecord.start_timestamps, - // PartitionEventRecord.commit_timestamps, and - // PartitionEndRecord.end_timestamps can have the same value in the same - // partition. PartitionEndRecord is the last record returned for a - // partition. - google.protobuf.Timestamp end_timestamp = 1; - - // Record sequence numbers are unique and monotonically increasing (but not - // necessarily contiguous) for a specific timestamp across record - // types in the same partition. To guarantee ordered processing, the reader - // should process records (of potentially different types) in - // record_sequence order for a specific timestamp in the same partition. - string record_sequence = 2; - - // Unique partition identifier describing the terminated change stream - // partition. - // [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEndRecord.partition_token] - // is equal to the partition token of the change stream partition currently - // queried to return this PartitionEndRecord. - string partition_token = 3; - } - - // A partition event record describes key range changes for a change stream - // partition. The changes to a row defined by its primary key can be captured - // in one change stream partition for a specific time range, and then be - // captured in a different change stream partition for a different time range. - // This movement of key ranges across change stream partitions is a reflection - // of activities, such as Spanner's dynamic splitting and load balancing, etc. - // Processing this event is needed if users want to guarantee processing of - // the changes for any key in timestamp order. If time ordered processing of - // changes for a primary key is not needed, this event can be ignored. - // To guarantee time ordered processing for each primary key, if the event - // describes move-ins, the reader of this partition needs to wait until the - // readers of the source partitions have processed all records with timestamps - // <= this PartitionEventRecord.commit_timestamp, before advancing beyond this - // PartitionEventRecord. If the event describes move-outs, the reader can - // notify the readers of the destination partitions that they can continue - // processing. - message PartitionEventRecord { - // Describes move-in of the key ranges into the change stream partition - // identified by - // [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token]. - // - // To maintain processing the changes for a particular key in timestamp - // order, the query processing the change stream partition identified by - // [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token] - // should not advance beyond the partition event record commit timestamp - // until the queries processing the source change stream partitions have - // processed all change stream records with timestamps <= the partition - // event record commit timestamp. - message MoveInEvent { - // An unique partition identifier describing the source change stream - // partition that recorded changes for the key range that is moving - // into this partition. - string source_partition_token = 1; - } - - // Describes move-out of the key ranges out of the change stream partition - // identified by - // [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token]. - // - // To maintain processing the changes for a particular key in timestamp - // order, the query processing the - // [MoveOutEvent][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent] - // in the partition identified by - // [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token] - // should inform the queries processing the destination partitions that - // they can unblock and proceed processing records past the - // [commit_timestamp][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.commit_timestamp]. - message MoveOutEvent { - // An unique partition identifier describing the destination change - // stream partition that will record changes for the key range that is - // moving out of this partition. - string destination_partition_token = 1; - } - - // Indicates the commit timestamp at which the key range change occurred. - // DataChangeRecord.commit_timestamps, - // PartitionStartRecord.start_timestamps, - // PartitionEventRecord.commit_timestamps, and - // PartitionEndRecord.end_timestamps can have the same value in the same - // partition. - google.protobuf.Timestamp commit_timestamp = 1; - - // Record sequence numbers are unique and monotonically increasing (but not - // necessarily contiguous) for a specific timestamp across record - // types in the same partition. To guarantee ordered processing, the reader - // should process records (of potentially different types) in - // record_sequence order for a specific timestamp in the same partition. - string record_sequence = 2; - - // Unique partition identifier describing the partition this event - // occurred on. - // [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token] - // is equal to the partition token of the change stream partition currently - // queried to return this PartitionEventRecord. - string partition_token = 3; - - // Set when one or more key ranges are moved into the change stream - // partition identified by - // [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token]. - // - // Example: Two key ranges are moved into partition (P1) from partition (P2) - // and partition (P3) in a single transaction at timestamp T. - // - // The PartitionEventRecord returned in P1 will reflect the move as: - // - // PartitionEventRecord { - // commit_timestamp: T - // partition_token: "P1" - // move_in_events { - // source_partition_token: "P2" - // } - // move_in_events { - // source_partition_token: "P3" - // } - // } - // - // The PartitionEventRecord returned in P2 will reflect the move as: - // - // PartitionEventRecord { - // commit_timestamp: T - // partition_token: "P2" - // move_out_events { - // destination_partition_token: "P1" - // } - // } - // - // The PartitionEventRecord returned in P3 will reflect the move as: - // - // PartitionEventRecord { - // commit_timestamp: T - // partition_token: "P3" - // move_out_events { - // destination_partition_token: "P1" - // } - // } - repeated MoveInEvent move_in_events = 4; - - // Set when one or more key ranges are moved out of the change stream - // partition identified by - // [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token]. - // - // Example: Two key ranges are moved out of partition (P1) to partition (P2) - // and partition (P3) in a single transaction at timestamp T. - // - // The PartitionEventRecord returned in P1 will reflect the move as: - // - // PartitionEventRecord { - // commit_timestamp: T - // partition_token: "P1" - // move_out_events { - // destination_partition_token: "P2" - // } - // move_out_events { - // destination_partition_token: "P3" - // } - // } - // - // The PartitionEventRecord returned in P2 will reflect the move as: - // - // PartitionEventRecord { - // commit_timestamp: T - // partition_token: "P2" - // move_in_events { - // source_partition_token: "P1" - // } - // } - // - // The PartitionEventRecord returned in P3 will reflect the move as: - // - // PartitionEventRecord { - // commit_timestamp: T - // partition_token: "P3" - // move_in_events { - // source_partition_token: "P1" - // } - // } - repeated MoveOutEvent move_out_events = 5; - } - - // One of the change stream subrecords. - oneof record { - // Data change record describing a data change for a change stream - // partition. - DataChangeRecord data_change_record = 1; - - // Heartbeat record describing a heartbeat for a change stream partition. - HeartbeatRecord heartbeat_record = 2; - - // Partition start record describing a new change stream partition. - PartitionStartRecord partition_start_record = 3; - - // Partition end record describing a terminated change stream partition. - PartitionEndRecord partition_end_record = 4; - - // Partition event record describing key range changes for a change stream - // partition. - PartitionEventRecord partition_event_record = 5; - } -} diff --git a/owl-bot-staging/executor/v1/protos/google/spanner/v1/commit_response.proto b/owl-bot-staging/executor/v1/protos/google/spanner/v1/commit_response.proto deleted file mode 100644 index 6e4459122..000000000 --- a/owl-bot-staging/executor/v1/protos/google/spanner/v1/commit_response.proto +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.spanner.v1; - -import "google/protobuf/timestamp.proto"; -import "google/spanner/v1/transaction.proto"; - -option csharp_namespace = "Google.Cloud.Spanner.V1"; -option go_package = "cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb"; -option java_multiple_files = true; -option java_outer_classname = "CommitResponseProto"; -option java_package = "com.google.spanner.v1"; -option php_namespace = "Google\\Cloud\\Spanner\\V1"; -option ruby_package = "Google::Cloud::Spanner::V1"; - -// The response for [Commit][google.spanner.v1.Spanner.Commit]. -message CommitResponse { - // Additional statistics about a commit. - message CommitStats { - // The total number of mutations for the transaction. Knowing the - // `mutation_count` value can help you maximize the number of mutations - // in a transaction and minimize the number of API round trips. You can - // also monitor this value to prevent transactions from exceeding the system - // [limit](https://cloud.google.com/spanner/quotas#limits_for_creating_reading_updating_and_deleting_data). - // If the number of mutations exceeds the limit, the server returns - // [INVALID_ARGUMENT](https://cloud.google.com/spanner/docs/reference/rest/v1/Code#ENUM_VALUES.INVALID_ARGUMENT). - int64 mutation_count = 1; - } - - // The Cloud Spanner timestamp at which the transaction committed. - google.protobuf.Timestamp commit_timestamp = 1; - - // The statistics about this `Commit`. Not returned by default. - // For more information, see - // [CommitRequest.return_commit_stats][google.spanner.v1.CommitRequest.return_commit_stats]. - CommitStats commit_stats = 2; - - // You must examine and retry the commit if the following is populated. - oneof MultiplexedSessionRetry { - // If specified, transaction has not committed yet. - // You must retry the commit with the new precommit token. - MultiplexedSessionPrecommitToken precommit_token = 4; - } - - // If `TransactionOptions.isolation_level` is set to - // `IsolationLevel.REPEATABLE_READ`, then the snapshot timestamp is the - // timestamp at which all reads in the transaction ran. This timestamp is - // never returned. - google.protobuf.Timestamp snapshot_timestamp = 5; -} diff --git a/owl-bot-staging/executor/v1/protos/google/spanner/v1/keys.proto b/owl-bot-staging/executor/v1/protos/google/spanner/v1/keys.proto deleted file mode 100644 index 5e30e831e..000000000 --- a/owl-bot-staging/executor/v1/protos/google/spanner/v1/keys.proto +++ /dev/null @@ -1,163 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.spanner.v1; - -import "google/protobuf/struct.proto"; - -option csharp_namespace = "Google.Cloud.Spanner.V1"; -option go_package = "cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb"; -option java_multiple_files = true; -option java_outer_classname = "KeysProto"; -option java_package = "com.google.spanner.v1"; -option php_namespace = "Google\\Cloud\\Spanner\\V1"; -option ruby_package = "Google::Cloud::Spanner::V1"; - -// KeyRange represents a range of rows in a table or index. -// -// A range has a start key and an end key. These keys can be open or -// closed, indicating if the range includes rows with that key. -// -// Keys are represented by lists, where the ith value in the list -// corresponds to the ith component of the table or index primary key. -// Individual values are encoded as described -// [here][google.spanner.v1.TypeCode]. -// -// For example, consider the following table definition: -// -// CREATE TABLE UserEvents ( -// UserName STRING(MAX), -// EventDate STRING(10) -// ) PRIMARY KEY(UserName, EventDate); -// -// The following keys name rows in this table: -// -// ["Bob", "2014-09-23"] -// ["Alfred", "2015-06-12"] -// -// Since the `UserEvents` table's `PRIMARY KEY` clause names two -// columns, each `UserEvents` key has two elements; the first is the -// `UserName`, and the second is the `EventDate`. -// -// Key ranges with multiple components are interpreted -// lexicographically by component using the table or index key's declared -// sort order. For example, the following range returns all events for -// user `"Bob"` that occurred in the year 2015: -// -// "start_closed": ["Bob", "2015-01-01"] -// "end_closed": ["Bob", "2015-12-31"] -// -// Start and end keys can omit trailing key components. This affects the -// inclusion and exclusion of rows that exactly match the provided key -// components: if the key is closed, then rows that exactly match the -// provided components are included; if the key is open, then rows -// that exactly match are not included. -// -// For example, the following range includes all events for `"Bob"` that -// occurred during and after the year 2000: -// -// "start_closed": ["Bob", "2000-01-01"] -// "end_closed": ["Bob"] -// -// The next example retrieves all events for `"Bob"`: -// -// "start_closed": ["Bob"] -// "end_closed": ["Bob"] -// -// To retrieve events before the year 2000: -// -// "start_closed": ["Bob"] -// "end_open": ["Bob", "2000-01-01"] -// -// The following range includes all rows in the table: -// -// "start_closed": [] -// "end_closed": [] -// -// This range returns all users whose `UserName` begins with any -// character from A to C: -// -// "start_closed": ["A"] -// "end_open": ["D"] -// -// This range returns all users whose `UserName` begins with B: -// -// "start_closed": ["B"] -// "end_open": ["C"] -// -// Key ranges honor column sort order. For example, suppose a table is -// defined as follows: -// -// CREATE TABLE DescendingSortedTable { -// Key INT64, -// ... -// ) PRIMARY KEY(Key DESC); -// -// The following range retrieves all rows with key values between 1 -// and 100 inclusive: -// -// "start_closed": ["100"] -// "end_closed": ["1"] -// -// Note that 100 is passed as the start, and 1 is passed as the end, -// because `Key` is a descending column in the schema. -message KeyRange { - // The start key must be provided. It can be either closed or open. - oneof start_key_type { - // If the start is closed, then the range includes all rows whose - // first `len(start_closed)` key columns exactly match `start_closed`. - google.protobuf.ListValue start_closed = 1; - - // If the start is open, then the range excludes rows whose first - // `len(start_open)` key columns exactly match `start_open`. - google.protobuf.ListValue start_open = 2; - } - - // The end key must be provided. It can be either closed or open. - oneof end_key_type { - // If the end is closed, then the range includes all rows whose - // first `len(end_closed)` key columns exactly match `end_closed`. - google.protobuf.ListValue end_closed = 3; - - // If the end is open, then the range excludes rows whose first - // `len(end_open)` key columns exactly match `end_open`. - google.protobuf.ListValue end_open = 4; - } -} - -// `KeySet` defines a collection of Cloud Spanner keys and/or key ranges. All -// the keys are expected to be in the same table or index. The keys need -// not be sorted in any particular way. -// -// If the same key is specified multiple times in the set (for example -// if two ranges, two keys, or a key and a range overlap), Cloud Spanner -// behaves as if the key were only specified once. -message KeySet { - // A list of specific keys. Entries in `keys` should have exactly as - // many elements as there are columns in the primary or index key - // with which this `KeySet` is used. Individual key values are - // encoded as described [here][google.spanner.v1.TypeCode]. - repeated google.protobuf.ListValue keys = 1; - - // A list of key ranges. See [KeyRange][google.spanner.v1.KeyRange] for more - // information about key range specifications. - repeated KeyRange ranges = 2; - - // For convenience `all` can be set to `true` to indicate that this - // `KeySet` matches all keys in the table or index. Note that any keys - // specified in `keys` or `ranges` are only yielded once. - bool all = 3; -} diff --git a/owl-bot-staging/executor/v1/protos/google/spanner/v1/location.proto b/owl-bot-staging/executor/v1/protos/google/spanner/v1/location.proto deleted file mode 100644 index 870dc0ec0..000000000 --- a/owl-bot-staging/executor/v1/protos/google/spanner/v1/location.proto +++ /dev/null @@ -1,388 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.spanner.v1; - -import "google/protobuf/struct.proto"; -import "google/spanner/v1/type.proto"; - -option csharp_namespace = "Google.Cloud.Spanner.V1"; -option go_package = "cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb"; -option java_multiple_files = true; -option java_outer_classname = "LocationProto"; -option java_package = "com.google.spanner.v1"; -option php_namespace = "Google\\Cloud\\Spanner\\V1"; -option ruby_package = "Google::Cloud::Spanner::V1"; - -// A `Range` represents a range of keys in a database. The keys themselves -// are encoded in "sortable string format", also known as ssformat. Consult -// Spanner's open source client libraries for details on the encoding. -// -// Each range represents a contiguous range of rows, possibly from multiple -// tables/indexes. Each range is associated with a single paxos group (known as -// a "group" throughout this API), a split (which names the exact range within -// the group), and a generation that can be used to determine whether a given -// `Range` represents a newer or older location for the key range. -message Range { - // The start key of the range, inclusive. Encoded in "sortable string format" - // (ssformat). - bytes start_key = 1; - - // The limit key of the range, exclusive. Encoded in "sortable string format" - // (ssformat). - bytes limit_key = 2; - - // The UID of the paxos group where this range is stored. UIDs are unique - // within the database. References `Group.group_uid`. - uint64 group_uid = 3; - - // A group can store multiple ranges of keys. Each key range is named by an - // ID (the split ID). Within a group, split IDs are unique. The `split_id` - // names the exact split in `group_uid` where this range is stored. - uint64 split_id = 4; - - // `generation` indicates the freshness of the range information contained - // in this proto. Generations can be compared lexicographically; if generation - // A is greater than generation B, then the `Range` corresponding to A is - // newer than the `Range` corresponding to B, and should be used - // preferentially. - bytes generation = 5; -} - -// A `Tablet` represents a single replica of a `Group`. A tablet is served by a -// single server at a time, and can move between servers due to server death or -// simply load balancing. -message Tablet { - // Indicates the role of the tablet. - enum Role { - // Not specified. - ROLE_UNSPECIFIED = 0; - - // The tablet can perform reads and (if elected leader) writes. - READ_WRITE = 1; - - // The tablet can only perform reads. - READ_ONLY = 2; - } - - // The UID of the tablet, unique within the database. Matches the - // `tablet_uids` and `leader_tablet_uid` fields in `Group`. - uint64 tablet_uid = 1; - - // The address of the server that is serving this tablet -- either an IP - // address or DNS hostname and a port number. - string server_address = 2; - - // Where this tablet is located. This is the name of a Google Cloud region, - // such as "us-central1". - string location = 3; - - // The role of the tablet. - Role role = 4; - - // `incarnation` indicates the freshness of the tablet information contained - // in this proto. Incarnations can be compared lexicographically; if - // incarnation A is greater than incarnation B, then the `Tablet` - // corresponding to A is newer than the `Tablet` corresponding to B, and - // should be used preferentially. - bytes incarnation = 5; - - // Distances help the client pick the closest tablet out of the list of - // tablets for a given request. Tablets with lower distances should generally - // be preferred. Tablets with the same distance are approximately equally - // close; the client can choose arbitrarily. - // - // Distances do not correspond precisely to expected latency, geographical - // distance, or anything else. Distances should be compared only between - // tablets of the same group; they are not meaningful between different - // groups. - // - // A value of zero indicates that the tablet may be in the same zone as - // the client, and have minimum network latency. A value less than or equal to - // five indicates that the tablet is thought to be in the same region as the - // client, and may have a few milliseconds of network latency. Values greater - // than five are most likely in a different region, with non-trivial network - // latency. - // - // Clients should use the following algorithm: - // * If the request is using a directed read, eliminate any tablets that - // do not match the directed read's target zone and/or replica type. - // * (Read-write transactions only) Choose leader tablet if it has an - // distance <=5. - // * Group and sort tablets by distance. Choose a random - // tablet with the lowest distance. If the request - // is not a directed read, only consider replicas with distances <=5. - // * Send the request to the fallback endpoint. - // - // The tablet picked by this algorithm may be skipped, either because it is - // marked as `skip` by the server or because the corresponding server is - // unreachable, flow controlled, etc. Skipped tablets should be added to the - // `skipped_tablet_uid` field in `RoutingHint`; the algorithm above should - // then be re-run without including the skipped tablet(s) to pick the next - // best tablet. - uint32 distance = 6; - - // If true, the tablet should not be chosen by the client. Typically, this - // signals that the tablet is unhealthy in some way. Tablets with `skip` - // set to true should be reported back to the server in - // `RoutingHint.skipped_tablet_uid`; this cues the server to send updated - // information for this tablet should it become usable again. - bool skip = 7; -} - -// A `Group` represents a paxos group in a database. A group is a set of -// tablets that are replicated across multiple servers. Groups may have a leader -// tablet. Groups store one (or sometimes more) ranges of keys. -message Group { - // The UID of the paxos group, unique within the database. Matches the - // `group_uid` field in `Range`. - uint64 group_uid = 1; - - // A list of tablets that are part of the group. Note that this list may not - // be exhaustive; it will only include tablets the server considers useful - // to the client. The returned list is ordered ascending by distance. - // - // Tablet UIDs reference `Tablet.tablet_uid`. - repeated Tablet tablets = 2; - - // The last known leader tablet of the group as an index into `tablets`. May - // be negative if the group has no known leader. - int32 leader_index = 3; - - // `generation` indicates the freshness of the group information (including - // leader information) contained in this proto. Generations can be compared - // lexicographically; if generation A is greater than generation B, then the - // `Group` corresponding to A is newer than the `Group` corresponding to B, - // and should be used preferentially. - bytes generation = 4; -} - -// A `KeyRecipe` provides the metadata required to translate reads, mutations, -// and queries into a byte array in "sortable string format" (ssformat)that can -// be used with `Range`s to route requests. Note that the client *must* tolerate -// `KeyRecipe`s that appear to be invalid, since the `KeyRecipe` format may -// change over time. Requests with invalid `KeyRecipe`s should be routed to a -// default server. -message KeyRecipe { - // An ssformat key is composed of a sequence of tag numbers and key column - // values. `Part` represents a single tag or key column value. - message Part { - // The remaining fields encode column values. - enum Order { - // Default value, equivalent to `ASCENDING`. - ORDER_UNSPECIFIED = 0; - - // The key is ascending - corresponds to `ASC` in the schema definition. - ASCENDING = 1; - - // The key is descending - corresponds to `DESC` in the schema definition. - DESCENDING = 2; - } - - // The null order of the key column. This dictates where NULL values sort - // in the sorted order. Note that columns which are `NOT NULL` can have a - // special encoding. - enum NullOrder { - // Default value. This value is unused. - NULL_ORDER_UNSPECIFIED = 0; - - // NULL values sort before any non-NULL values. - NULLS_FIRST = 1; - - // NULL values sort after any non-NULL values. - NULLS_LAST = 2; - - // The column does not support NULL values. - NOT_NULL = 3; - } - - // If non-zero, `tag` is the only field present in this `Part`. The part - // is encoded by appending `tag` to the ssformat key. - uint32 tag = 1; - - // Whether the key column is sorted ascending or descending. Only present - // if `tag` is zero. - Order order = 2; - - // How NULLs are represented in the encoded key part. Only present if `tag` - // is zero. - NullOrder null_order = 3; - - // The type of the key part. Only present if `tag` is zero. - Type type = 4; - - // Only present if `tag` is zero. - oneof value_type { - // `identifier` is the name of the column or query parameter. - string identifier = 5; - - // The constant value of the key part. - // It is present when query uses a constant as a part of the key. - google.protobuf.Value value = 6; - - // If true, the client is responsible to fill in the value randomly. - // It's relevant only for the INT64 type. - bool random = 8; - } - - // It is a repeated field to support fetching key columns from nested - // structs, such as `STRUCT` query parameters. - repeated int32 struct_identifiers = 7; - } - - // A recipe can be associated with a table, index, or query. Tables recipes - // are used to encode read and write keys; index recipes are used for index - // reads, and query recipes are used only for SQL queries. - oneof target { - // A table name, matching the name from the database schema. - string table_name = 1; - - // An index name, matching the name from the database schema. - string index_name = 2; - - // The UID of a query, matching the UID from `RoutingHint`. - uint64 operation_uid = 3; - } - - // Parts are in the order they should appear in the encoded key. - repeated Part part = 4; -} - -// A `RecipeList` contains a list of `KeyRecipe`s, which share the same -// schema generation. -message RecipeList { - // The schema generation of the recipes. To be sent to the server in - // `RoutingHint.schema_generation` whenever one of the recipes is used. - // `schema_generation` values are comparable with each other; if generation A - // compares greater than generation B, then A is a more recent schema than B. - // Clients should in general aim to cache only the latest schema generation, - // and discard more stale recipes. - bytes schema_generation = 1; - - // A list of recipes to be cached. - repeated KeyRecipe recipe = 3; -} - -// A `CacheUpdate` expresses a set of changes the client should incorporate into -// its location cache. These changes may or may not be newer than what the -// client has in its cache, and should be discarded if necessary. `CacheUpdate`s -// can be obtained in response to requests that included a `RoutingHint` -// field, but may also be obtained by explicit location-fetching RPCs which may -// be added in the future. -message CacheUpdate { - // An internal ID for the database. Database names can be reused if a database - // is deleted and re-created. Each time the database is re-created, it will - // get a new database ID, which will never be re-used for any other database. - uint64 database_id = 1; - - // A list of ranges to be cached. - repeated Range range = 2; - - // A list of groups to be cached. - repeated Group group = 3; - - // A list of recipes to be cached. - RecipeList key_recipes = 5; -} - -// `RoutingHint` can be optionally added to location-aware Spanner -// requests. It gives the server hints that can be used to route the request to -// an appropriate server, potentially significantly decreasing latency and -// improving throughput. To achieve improved performance, most fields must be -// filled in with accurate values. -// -// The presence of a valid `RoutingHint` tells the server that the client -// is location-aware. -// -// `RoutingHint` does not change the semantics of the request; it is -// purely a performance hint; the request will perform the same actions on the -// database's data as if `RoutingHint` were not present. However, if -// the `RoutingHint` is incomplete or incorrect, the response may include -// a `CacheUpdate` the client can use to correct its location cache. -message RoutingHint { - // A tablet that was skipped by the client. See `Tablet.tablet_uid` and - // `Tablet.incarnation`. - message SkippedTablet { - // The tablet UID of the tablet that was skipped. See `Tablet.tablet_uid`. - uint64 tablet_uid = 1; - - // The incarnation of the tablet that was skipped. See `Tablet.incarnation`. - bytes incarnation = 2; - } - - // A session-scoped unique ID for the operation, computed client-side. - // Requests with the same `operation_uid` should have a shared 'shape', - // meaning that some fields are expected to be the same, such as the SQL - // query, the target table/columns (for reads) etc. Requests with the same - // `operation_uid` are meant to differ only in fields like keys/key - // ranges/query parameters, transaction IDs, etc. - // - // `operation_uid` must be non-zero for `RoutingHint` to be valid. - uint64 operation_uid = 1; - - // The database ID of the database being accessed, see - // `CacheUpdate.database_id`. Should match the cache entries that were used - // to generate the rest of the fields in this `RoutingHint`. - uint64 database_id = 2; - - // The schema generation of the recipe that was used to generate `key` and - // `limit_key`. See also `RecipeList.schema_generation`. - bytes schema_generation = 3; - - // The key / key range that this request accesses. For operations that - // access a single key, `key` should be set and `limit_key` should be empty. - // For operations that access a key range, `key` and `limit_key` should both - // be set, to the inclusive start and exclusive end of the range respectively. - // - // The keys are encoded in "sortable string format" (ssformat), using a - // `KeyRecipe` that is appropriate for the request. See `KeyRecipe` for more - // details. - bytes key = 4; - - // If this request targets a key range, this is the exclusive end of the - // range. See `key` for more details. - bytes limit_key = 5; - - // The group UID of the group that the client believes serves the range - // defined by `key` and `limit_key`. See `Range.group_uid` for more details. - uint64 group_uid = 6; - - // The split ID of the split that the client believes contains the range - // defined by `key` and `limit_key`. See `Range.split_id` for more details. - uint64 split_id = 7; - - // The tablet UID of the tablet from group `group_uid` that the client - // believes is best to serve this request. See `Group.local_tablet_uids` and - // `Group.leader_tablet_uid`. - uint64 tablet_uid = 8; - - // If the client had multiple options for tablet selection, and some of its - // first choices were unhealthy (e.g., the server is unreachable, or - // `Tablet.skip` is true), this field will contain the tablet UIDs of those - // tablets, with their incarnations. The server may include a `CacheUpdate` - // with new locations for those tablets. - repeated SkippedTablet skipped_tablet_uid = 9; - - // If present, the client's current location. This should be the name of a - // Google Cloud zone or region, such as "us-central1". - // - // If absent, the client's location will be assumed to be the same as the - // location of the server the client ends up connected to. - // - // Locations are primarily valuable for clients that connect from regions - // other than the ones that contain the Spanner database. - string client_location = 10; -} diff --git a/owl-bot-staging/executor/v1/protos/google/spanner/v1/mutation.proto b/owl-bot-staging/executor/v1/protos/google/spanner/v1/mutation.proto deleted file mode 100644 index 7e3306a20..000000000 --- a/owl-bot-staging/executor/v1/protos/google/spanner/v1/mutation.proto +++ /dev/null @@ -1,156 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.spanner.v1; - -import "google/api/field_behavior.proto"; -import "google/protobuf/struct.proto"; -import "google/protobuf/timestamp.proto"; -import "google/spanner/v1/keys.proto"; - -option csharp_namespace = "Google.Cloud.Spanner.V1"; -option go_package = "cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb"; -option java_multiple_files = true; -option java_outer_classname = "MutationProto"; -option java_package = "com.google.spanner.v1"; -option php_namespace = "Google\\Cloud\\Spanner\\V1"; -option ruby_package = "Google::Cloud::Spanner::V1"; - -// A modification to one or more Cloud Spanner rows. Mutations can be -// applied to a Cloud Spanner database by sending them in a -// [Commit][google.spanner.v1.Spanner.Commit] call. -message Mutation { - // Arguments to [insert][google.spanner.v1.Mutation.insert], - // [update][google.spanner.v1.Mutation.update], - // [insert_or_update][google.spanner.v1.Mutation.insert_or_update], and - // [replace][google.spanner.v1.Mutation.replace] operations. - message Write { - // Required. The table whose rows will be written. - string table = 1 [(google.api.field_behavior) = REQUIRED]; - - // The names of the columns in - // [table][google.spanner.v1.Mutation.Write.table] to be written. - // - // The list of columns must contain enough columns to allow - // Cloud Spanner to derive values for all primary key columns in the - // row(s) to be modified. - repeated string columns = 2; - - // The values to be written. `values` can contain more than one - // list of values. If it does, then multiple rows are written, one - // for each entry in `values`. Each list in `values` must have - // exactly as many entries as there are entries in - // [columns][google.spanner.v1.Mutation.Write.columns] above. Sending - // multiple lists is equivalent to sending multiple `Mutation`s, each - // containing one `values` entry and repeating - // [table][google.spanner.v1.Mutation.Write.table] and - // [columns][google.spanner.v1.Mutation.Write.columns]. Individual values in - // each list are encoded as described [here][google.spanner.v1.TypeCode]. - repeated google.protobuf.ListValue values = 3; - } - - // Arguments to [delete][google.spanner.v1.Mutation.delete] operations. - message Delete { - // Required. The table whose rows will be deleted. - string table = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The primary keys of the rows within - // [table][google.spanner.v1.Mutation.Delete.table] to delete. The primary - // keys must be specified in the order in which they appear in the `PRIMARY - // KEY()` clause of the table's equivalent DDL statement (the DDL statement - // used to create the table). Delete is idempotent. The transaction will - // succeed even if some or all rows do not exist. - KeySet key_set = 2 [(google.api.field_behavior) = REQUIRED]; - } - - // Arguments to [send][google.spanner.v1.Mutation.send] operations. - message Send { - // Required. The queue to which the message will be sent. - string queue = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The primary key of the message to be sent. - google.protobuf.ListValue key = 2 [(google.api.field_behavior) = REQUIRED]; - - // The time at which Spanner will begin attempting to deliver the message. - // If `deliver_time` is not set, Spanner will deliver the message - // immediately. If `deliver_time` is in the past, Spanner will replace it - // with a value closer to the current time. - google.protobuf.Timestamp deliver_time = 3; - - // The payload of the message. - google.protobuf.Value payload = 4; - } - - // Arguments to [ack][google.spanner.v1.Mutation.ack] operations. - message Ack { - // Required. The queue where the message to be acked is stored. - string queue = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The primary key of the message to be acked. - google.protobuf.ListValue key = 2 [(google.api.field_behavior) = REQUIRED]; - - // By default, an attempt to ack a message that does not exist will fail - // with a `NOT_FOUND` error. With `ignore_not_found` set to true, the ack - // will succeed even if the message does not exist. This is useful for - // unconditionally acking a message, even if it is missing or has already - // been acked. - bool ignore_not_found = 3; - } - - // Required. The operation to perform. - oneof operation { - // Insert new rows in a table. If any of the rows already exist, - // the write or transaction fails with error `ALREADY_EXISTS`. - Write insert = 1; - - // Update existing rows in a table. If any of the rows does not - // already exist, the transaction fails with error `NOT_FOUND`. - Write update = 2; - - // Like [insert][google.spanner.v1.Mutation.insert], except that if the row - // already exists, then its column values are overwritten with the ones - // provided. Any column values not explicitly written are preserved. - // - // When using - // [insert_or_update][google.spanner.v1.Mutation.insert_or_update], just as - // when using [insert][google.spanner.v1.Mutation.insert], all `NOT NULL` - // columns in the table must be given a value. This holds true even when the - // row already exists and will therefore actually be updated. - Write insert_or_update = 3; - - // Like [insert][google.spanner.v1.Mutation.insert], except that if the row - // already exists, it is deleted, and the column values provided are - // inserted instead. Unlike - // [insert_or_update][google.spanner.v1.Mutation.insert_or_update], this - // means any values not explicitly written become `NULL`. - // - // In an interleaved table, if you create the child table with the - // `ON DELETE CASCADE` annotation, then replacing a parent row - // also deletes the child rows. Otherwise, you must delete the - // child rows before you replace the parent row. - Write replace = 4; - - // Delete rows from a table. Succeeds whether or not the named - // rows were present. - Delete delete = 5; - - // Send a message to a queue. - Send send = 6; - - // Ack a message from a queue. - Ack ack = 7; - } -} diff --git a/owl-bot-staging/executor/v1/protos/google/spanner/v1/query_plan.proto b/owl-bot-staging/executor/v1/protos/google/spanner/v1/query_plan.proto deleted file mode 100644 index 5850ff97f..000000000 --- a/owl-bot-staging/executor/v1/protos/google/spanner/v1/query_plan.proto +++ /dev/null @@ -1,156 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.spanner.v1; - -import "google/api/field_behavior.proto"; -import "google/protobuf/struct.proto"; - -option csharp_namespace = "Google.Cloud.Spanner.V1"; -option go_package = "cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb"; -option java_multiple_files = true; -option java_outer_classname = "QueryPlanProto"; -option java_package = "com.google.spanner.v1"; -option php_namespace = "Google\\Cloud\\Spanner\\V1"; -option ruby_package = "Google::Cloud::Spanner::V1"; - -// Node information for nodes appearing in a -// [QueryPlan.plan_nodes][google.spanner.v1.QueryPlan.plan_nodes]. -message PlanNode { - // The kind of [PlanNode][google.spanner.v1.PlanNode]. Distinguishes between - // the two different kinds of nodes that can appear in a query plan. - enum Kind { - // Not specified. - KIND_UNSPECIFIED = 0; - - // Denotes a Relational operator node in the expression tree. Relational - // operators represent iterative processing of rows during query execution. - // For example, a `TableScan` operation that reads rows from a table. - RELATIONAL = 1; - - // Denotes a Scalar node in the expression tree. Scalar nodes represent - // non-iterable entities in the query plan. For example, constants or - // arithmetic operators appearing inside predicate expressions or references - // to column names. - SCALAR = 2; - } - - // Metadata associated with a parent-child relationship appearing in a - // [PlanNode][google.spanner.v1.PlanNode]. - message ChildLink { - // The node to which the link points. - int32 child_index = 1; - - // The type of the link. For example, in Hash Joins this could be used to - // distinguish between the build child and the probe child, or in the case - // of the child being an output variable, to represent the tag associated - // with the output variable. - string type = 2; - - // Only present if the child node is - // [SCALAR][google.spanner.v1.PlanNode.Kind.SCALAR] and corresponds to an - // output variable of the parent node. The field carries the name of the - // output variable. For example, a `TableScan` operator that reads rows from - // a table will have child links to the `SCALAR` nodes representing the - // output variables created for each column that is read by the operator. - // The corresponding `variable` fields will be set to the variable names - // assigned to the columns. - string variable = 3; - } - - // Condensed representation of a node and its subtree. Only present for - // `SCALAR` [PlanNode(s)][google.spanner.v1.PlanNode]. - message ShortRepresentation { - // A string representation of the expression subtree rooted at this node. - string description = 1; - - // A mapping of (subquery variable name) -> (subquery node id) for cases - // where the `description` string of this node references a `SCALAR` - // subquery contained in the expression subtree rooted at this node. The - // referenced `SCALAR` subquery may not necessarily be a direct child of - // this node. - map subqueries = 2; - } - - // The `PlanNode`'s index in [node - // list][google.spanner.v1.QueryPlan.plan_nodes]. - int32 index = 1; - - // Used to determine the type of node. May be needed for visualizing - // different kinds of nodes differently. For example, If the node is a - // [SCALAR][google.spanner.v1.PlanNode.Kind.SCALAR] node, it will have a - // condensed representation which can be used to directly embed a description - // of the node in its parent. - Kind kind = 2; - - // The display name for the node. - string display_name = 3; - - // List of child node `index`es and their relationship to this parent. - repeated ChildLink child_links = 4; - - // Condensed representation for - // [SCALAR][google.spanner.v1.PlanNode.Kind.SCALAR] nodes. - ShortRepresentation short_representation = 5; - - // Attributes relevant to the node contained in a group of key-value pairs. - // For example, a Parameter Reference node could have the following - // information in its metadata: - // - // { - // "parameter_reference": "param1", - // "parameter_type": "array" - // } - google.protobuf.Struct metadata = 6; - - // The execution statistics associated with the node, contained in a group of - // key-value pairs. Only present if the plan was returned as a result of a - // profile query. For example, number of executions, number of rows/time per - // execution etc. - google.protobuf.Struct execution_stats = 7; -} - -// Output of query advisor analysis. -message QueryAdvisorResult { - // Recommendation to add new indexes to run queries more efficiently. - message IndexAdvice { - // Optional. DDL statements to add new indexes that will improve the query. - repeated string ddl = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Estimated latency improvement factor. For example if the query - // currently takes 500 ms to run and the estimated latency with new indexes - // is 100 ms this field will be 5. - double improvement_factor = 2 [(google.api.field_behavior) = OPTIONAL]; - } - - // Optional. Index Recommendation for a query. This is an optional field and - // the recommendation will only be available when the recommendation - // guarantees significant improvement in query performance. - repeated IndexAdvice index_advice = 1 - [(google.api.field_behavior) = OPTIONAL]; -} - -// Contains an ordered list of nodes appearing in the query plan. -message QueryPlan { - // The nodes in the query plan. Plan nodes are returned in pre-order starting - // with the plan root. Each [PlanNode][google.spanner.v1.PlanNode]'s `id` - // corresponds to its index in `plan_nodes`. - repeated PlanNode plan_nodes = 1; - - // Optional. The advise/recommendations for a query. Currently this field will - // be serving index recommendations for a query. - QueryAdvisorResult query_advice = 2 [(google.api.field_behavior) = OPTIONAL]; -} diff --git a/owl-bot-staging/executor/v1/protos/google/spanner/v1/result_set.proto b/owl-bot-staging/executor/v1/protos/google/spanner/v1/result_set.proto deleted file mode 100644 index 3851d688c..000000000 --- a/owl-bot-staging/executor/v1/protos/google/spanner/v1/result_set.proto +++ /dev/null @@ -1,260 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.spanner.v1; - -import "google/api/field_behavior.proto"; -import "google/protobuf/struct.proto"; -import "google/spanner/v1/location.proto"; -import "google/spanner/v1/query_plan.proto"; -import "google/spanner/v1/transaction.proto"; -import "google/spanner/v1/type.proto"; - -option csharp_namespace = "Google.Cloud.Spanner.V1"; -option go_package = "cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb"; -option java_multiple_files = true; -option java_outer_classname = "ResultSetProto"; -option java_package = "com.google.spanner.v1"; -option php_namespace = "Google\\Cloud\\Spanner\\V1"; -option ruby_package = "Google::Cloud::Spanner::V1"; - -// Results from [Read][google.spanner.v1.Spanner.Read] or -// [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql]. -message ResultSet { - // Metadata about the result set, such as row type information. - ResultSetMetadata metadata = 1; - - // Each element in `rows` is a row whose format is defined by - // [metadata.row_type][google.spanner.v1.ResultSetMetadata.row_type]. The ith - // element in each row matches the ith field in - // [metadata.row_type][google.spanner.v1.ResultSetMetadata.row_type]. Elements - // are encoded based on type as described [here][google.spanner.v1.TypeCode]. - repeated google.protobuf.ListValue rows = 2; - - // Query plan and execution statistics for the SQL statement that - // produced this result set. These can be requested by setting - // [ExecuteSqlRequest.query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode]. - // DML statements always produce stats containing the number of rows - // modified, unless executed using the - // [ExecuteSqlRequest.QueryMode.PLAN][google.spanner.v1.ExecuteSqlRequest.QueryMode.PLAN] - // [ExecuteSqlRequest.query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode]. - // Other fields might or might not be populated, based on the - // [ExecuteSqlRequest.query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode]. - ResultSetStats stats = 3; - - // Optional. A precommit token is included if the read-write transaction is on - // a multiplexed session. Pass the precommit token with the highest sequence - // number from this transaction attempt to the - // [Commit][google.spanner.v1.Spanner.Commit] request for this transaction. - MultiplexedSessionPrecommitToken precommit_token = 5 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A cache update expresses a set of changes the client should - // incorporate into its location cache. The client should discard the changes - // if they are older than the data it already has. This data can be obtained - // in response to requests that included a `RoutingHint` field, but may also - // be obtained by explicit location-fetching RPCs which may be added in the - // future. - CacheUpdate cache_update = 6 [(google.api.field_behavior) = OPTIONAL]; -} - -// Partial results from a streaming read or SQL query. Streaming reads and -// SQL queries better tolerate large result sets, large rows, and large -// values, but are a little trickier to consume. -message PartialResultSet { - // Metadata about the result set, such as row type information. - // Only present in the first response. - ResultSetMetadata metadata = 1; - - // A streamed result set consists of a stream of values, which might - // be split into many `PartialResultSet` messages to accommodate - // large rows and/or large values. Every N complete values defines a - // row, where N is equal to the number of entries in - // [metadata.row_type.fields][google.spanner.v1.StructType.fields]. - // - // Most values are encoded based on type as described - // [here][google.spanner.v1.TypeCode]. - // - // It's possible that the last value in values is "chunked", - // meaning that the rest of the value is sent in subsequent - // `PartialResultSet`(s). This is denoted by the - // [chunked_value][google.spanner.v1.PartialResultSet.chunked_value] field. - // Two or more chunked values can be merged to form a complete value as - // follows: - // - // * `bool/number/null`: can't be chunked - // * `string`: concatenate the strings - // * `list`: concatenate the lists. If the last element in a list is a - // `string`, `list`, or `object`, merge it with the first element in - // the next list by applying these rules recursively. - // * `object`: concatenate the (field name, field value) pairs. If a - // field name is duplicated, then apply these rules recursively - // to merge the field values. - // - // Some examples of merging: - // - // Strings are concatenated. - // "foo", "bar" => "foobar" - // - // Lists of non-strings are concatenated. - // [2, 3], [4] => [2, 3, 4] - // - // Lists are concatenated, but the last and first elements are merged - // because they are strings. - // ["a", "b"], ["c", "d"] => ["a", "bc", "d"] - // - // Lists are concatenated, but the last and first elements are merged - // because they are lists. Recursively, the last and first elements - // of the inner lists are merged because they are strings. - // ["a", ["b", "c"]], [["d"], "e"] => ["a", ["b", "cd"], "e"] - // - // Non-overlapping object fields are combined. - // {"a": "1"}, {"b": "2"} => {"a": "1", "b": 2"} - // - // Overlapping object fields are merged. - // {"a": "1"}, {"a": "2"} => {"a": "12"} - // - // Examples of merging objects containing lists of strings. - // {"a": ["1"]}, {"a": ["2"]} => {"a": ["12"]} - // - // For a more complete example, suppose a streaming SQL query is - // yielding a result set whose rows contain a single string - // field. The following `PartialResultSet`s might be yielded: - // - // { - // "metadata": { ... } - // "values": ["Hello", "W"] - // "chunked_value": true - // "resume_token": "Af65..." - // } - // { - // "values": ["orl"] - // "chunked_value": true - // } - // { - // "values": ["d"] - // "resume_token": "Zx1B..." - // } - // - // This sequence of `PartialResultSet`s encodes two rows, one - // containing the field value `"Hello"`, and a second containing the - // field value `"World" = "W" + "orl" + "d"`. - // - // Not all `PartialResultSet`s contain a `resume_token`. Execution can only be - // resumed from a previously yielded `resume_token`. For the above sequence of - // `PartialResultSet`s, resuming the query with `"resume_token": "Af65..."` - // yields results from the `PartialResultSet` with value "orl". - repeated google.protobuf.Value values = 2; - - // If true, then the final value in - // [values][google.spanner.v1.PartialResultSet.values] is chunked, and must be - // combined with more values from subsequent `PartialResultSet`s to obtain a - // complete field value. - bool chunked_value = 3; - - // Streaming calls might be interrupted for a variety of reasons, such - // as TCP connection loss. If this occurs, the stream of results can - // be resumed by re-sending the original request and including - // `resume_token`. Note that executing any other transaction in the - // same session invalidates the token. - bytes resume_token = 4; - - // Query plan and execution statistics for the statement that produced this - // streaming result set. These can be requested by setting - // [ExecuteSqlRequest.query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode] - // and are sent only once with the last response in the stream. This field is - // also present in the last response for DML statements. - ResultSetStats stats = 5; - - // Optional. A precommit token is included if the read-write transaction - // has multiplexed sessions enabled. Pass the precommit token with the highest - // sequence number from this transaction attempt to the - // [Commit][google.spanner.v1.Spanner.Commit] request for this transaction. - MultiplexedSessionPrecommitToken precommit_token = 8 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Indicates whether this is the last `PartialResultSet` in the - // stream. The server might optionally set this field. Clients shouldn't rely - // on this field being set in all cases. - bool last = 9 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A cache update expresses a set of changes the client should - // incorporate into its location cache. The client should discard the changes - // if they are older than the data it already has. This data can be obtained - // in response to requests that included a `RoutingHint` field, but may also - // be obtained by explicit location-fetching RPCs which may be added in the - // future. - CacheUpdate cache_update = 10 [(google.api.field_behavior) = OPTIONAL]; -} - -// Metadata about a [ResultSet][google.spanner.v1.ResultSet] or -// [PartialResultSet][google.spanner.v1.PartialResultSet]. -message ResultSetMetadata { - // Indicates the field names and types for the rows in the result - // set. For example, a SQL query like `"SELECT UserId, UserName FROM - // Users"` could return a `row_type` value like: - // - // "fields": [ - // { "name": "UserId", "type": { "code": "INT64" } }, - // { "name": "UserName", "type": { "code": "STRING" } }, - // ] - StructType row_type = 1; - - // If the read or SQL query began a transaction as a side-effect, the - // information about the new transaction is yielded here. - Transaction transaction = 2; - - // A SQL query can be parameterized. In PLAN mode, these parameters can be - // undeclared. This indicates the field names and types for those undeclared - // parameters in the SQL query. For example, a SQL query like `"SELECT * FROM - // Users where UserId = @userId and UserName = @userName "` could return a - // `undeclared_parameters` value like: - // - // "fields": [ - // { "name": "UserId", "type": { "code": "INT64" } }, - // { "name": "UserName", "type": { "code": "STRING" } }, - // ] - StructType undeclared_parameters = 3; -} - -// Additional statistics about a [ResultSet][google.spanner.v1.ResultSet] or -// [PartialResultSet][google.spanner.v1.PartialResultSet]. -message ResultSetStats { - // [QueryPlan][google.spanner.v1.QueryPlan] for the query associated with this - // result. - QueryPlan query_plan = 1; - - // Aggregated statistics from the execution of the query. Only present when - // the query is profiled. For example, a query could return the statistics as - // follows: - // - // { - // "rows_returned": "3", - // "elapsed_time": "1.22 secs", - // "cpu_time": "1.19 secs" - // } - google.protobuf.Struct query_stats = 2; - - // The number of rows modified by the DML statement. - oneof row_count { - // Standard DML returns an exact count of rows that were modified. - int64 row_count_exact = 3; - - // Partitioned DML doesn't offer exactly-once semantics, so it - // returns a lower bound of the rows modified. - int64 row_count_lower_bound = 4; - } -} diff --git a/owl-bot-staging/executor/v1/protos/google/spanner/v1/spanner.proto b/owl-bot-staging/executor/v1/protos/google/spanner/v1/spanner.proto deleted file mode 100644 index 525cc2ba4..000000000 --- a/owl-bot-staging/executor/v1/protos/google/spanner/v1/spanner.proto +++ /dev/null @@ -1,1419 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.spanner.v1; - -import public "google/spanner/v1/commit_response.proto"; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/empty.proto"; -import "google/protobuf/struct.proto"; -import "google/protobuf/timestamp.proto"; -import "google/rpc/status.proto"; -import "google/spanner/v1/keys.proto"; -import "google/spanner/v1/location.proto"; -import "google/spanner/v1/mutation.proto"; -import "google/spanner/v1/result_set.proto"; -import "google/spanner/v1/transaction.proto"; -import "google/spanner/v1/type.proto"; - -option csharp_namespace = "Google.Cloud.Spanner.V1"; -option go_package = "cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb"; -option java_multiple_files = true; -option java_outer_classname = "SpannerProto"; -option java_package = "com.google.spanner.v1"; -option php_namespace = "Google\\Cloud\\Spanner\\V1"; -option ruby_package = "Google::Cloud::Spanner::V1"; -option (google.api.resource_definition) = { - type: "spanner.googleapis.com/Database" - pattern: "projects/{project}/instances/{instance}/databases/{database}" -}; - -// Cloud Spanner API -// -// The Cloud Spanner API can be used to manage sessions and execute -// transactions on data stored in Cloud Spanner databases. -service Spanner { - option (google.api.default_host) = "spanner.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform," - "https://www.googleapis.com/auth/spanner.data"; - - // Creates a new session. A session can be used to perform - // transactions that read and/or modify data in a Cloud Spanner database. - // Sessions are meant to be reused for many consecutive - // transactions. - // - // Sessions can only execute one transaction at a time. To execute - // multiple concurrent read-write/write-only transactions, create - // multiple sessions. Note that standalone reads and queries use a - // transaction internally, and count toward the one transaction - // limit. - // - // Active sessions use additional server resources, so it's a good idea to - // delete idle and unneeded sessions. - // Aside from explicit deletes, Cloud Spanner can delete sessions when no - // operations are sent for more than an hour. If a session is deleted, - // requests to it return `NOT_FOUND`. - // - // Idle sessions can be kept alive by sending a trivial SQL query - // periodically, for example, `"SELECT 1"`. - rpc CreateSession(CreateSessionRequest) returns (Session) { - option (google.api.http) = { - post: "/v1/{database=projects/*/instances/*/databases/*}/sessions" - body: "*" - }; - option (google.api.method_signature) = "database"; - } - - // Creates multiple new sessions. - // - // This API can be used to initialize a session cache on the clients. - // See https://goo.gl/TgSFN2 for best practices on session cache management. - rpc BatchCreateSessions(BatchCreateSessionsRequest) - returns (BatchCreateSessionsResponse) { - option (google.api.http) = { - post: "/v1/{database=projects/*/instances/*/databases/*}/sessions:batchCreate" - body: "*" - }; - option (google.api.method_signature) = "database,session_count"; - } - - // Gets a session. Returns `NOT_FOUND` if the session doesn't exist. - // This is mainly useful for determining whether a session is still - // alive. - rpc GetSession(GetSessionRequest) returns (Session) { - option (google.api.http) = { - get: "/v1/{name=projects/*/instances/*/databases/*/sessions/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists all sessions in a given database. - rpc ListSessions(ListSessionsRequest) returns (ListSessionsResponse) { - option (google.api.http) = { - get: "/v1/{database=projects/*/instances/*/databases/*}/sessions" - }; - option (google.api.method_signature) = "database"; - } - - // Ends a session, releasing server resources associated with it. This - // asynchronously triggers the cancellation of any operations that are running - // with this session. - rpc DeleteSession(DeleteSessionRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/instances/*/databases/*/sessions/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Executes an SQL statement, returning all results in a single reply. This - // method can't be used to return a result set larger than 10 MiB; - // if the query yields more data than that, the query fails with - // a `FAILED_PRECONDITION` error. - // - // Operations inside read-write transactions might return `ABORTED`. If - // this occurs, the application should restart the transaction from - // the beginning. See [Transaction][google.spanner.v1.Transaction] for more - // details. - // - // Larger result sets can be fetched in streaming fashion by calling - // [ExecuteStreamingSql][google.spanner.v1.Spanner.ExecuteStreamingSql] - // instead. - // - // The query string can be SQL or [Graph Query Language - // (GQL)](https://cloud.google.com/spanner/docs/reference/standard-sql/graph-intro). - rpc ExecuteSql(ExecuteSqlRequest) returns (ResultSet) { - option (google.api.http) = { - post: "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:executeSql" - body: "*" - }; - } - - // Like [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql], except returns the - // result set as a stream. Unlike - // [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql], there is no limit on - // the size of the returned result set. However, no individual row in the - // result set can exceed 100 MiB, and no column value can exceed 10 MiB. - // - // The query string can be SQL or [Graph Query Language - // (GQL)](https://cloud.google.com/spanner/docs/reference/standard-sql/graph-intro). - rpc ExecuteStreamingSql(ExecuteSqlRequest) returns (stream PartialResultSet) { - option (google.api.http) = { - post: "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:executeStreamingSql" - body: "*" - }; - } - - // Executes a batch of SQL DML statements. This method allows many statements - // to be run with lower latency than submitting them sequentially with - // [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql]. - // - // Statements are executed in sequential order. A request can succeed even if - // a statement fails. The - // [ExecuteBatchDmlResponse.status][google.spanner.v1.ExecuteBatchDmlResponse.status] - // field in the response provides information about the statement that failed. - // Clients must inspect this field to determine whether an error occurred. - // - // Execution stops after the first failed statement; the remaining statements - // are not executed. - rpc ExecuteBatchDml(ExecuteBatchDmlRequest) - returns (ExecuteBatchDmlResponse) { - option (google.api.http) = { - post: "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:executeBatchDml" - body: "*" - }; - } - - // Reads rows from the database using key lookups and scans, as a - // simple key/value style alternative to - // [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql]. This method can't be - // used to return a result set larger than 10 MiB; if the read matches more - // data than that, the read fails with a `FAILED_PRECONDITION` - // error. - // - // Reads inside read-write transactions might return `ABORTED`. If - // this occurs, the application should restart the transaction from - // the beginning. See [Transaction][google.spanner.v1.Transaction] for more - // details. - // - // Larger result sets can be yielded in streaming fashion by calling - // [StreamingRead][google.spanner.v1.Spanner.StreamingRead] instead. - rpc Read(ReadRequest) returns (ResultSet) { - option (google.api.http) = { - post: "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:read" - body: "*" - }; - } - - // Like [Read][google.spanner.v1.Spanner.Read], except returns the result set - // as a stream. Unlike [Read][google.spanner.v1.Spanner.Read], there is no - // limit on the size of the returned result set. However, no individual row in - // the result set can exceed 100 MiB, and no column value can exceed - // 10 MiB. - rpc StreamingRead(ReadRequest) returns (stream PartialResultSet) { - option (google.api.http) = { - post: "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:streamingRead" - body: "*" - }; - } - - // Begins a new transaction. This step can often be skipped: - // [Read][google.spanner.v1.Spanner.Read], - // [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql] and - // [Commit][google.spanner.v1.Spanner.Commit] can begin a new transaction as a - // side-effect. - rpc BeginTransaction(BeginTransactionRequest) returns (Transaction) { - option (google.api.http) = { - post: "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:beginTransaction" - body: "*" - }; - option (google.api.method_signature) = "session,options"; - } - - // Commits a transaction. The request includes the mutations to be - // applied to rows in the database. - // - // `Commit` might return an `ABORTED` error. This can occur at any time; - // commonly, the cause is conflicts with concurrent - // transactions. However, it can also happen for a variety of other - // reasons. If `Commit` returns `ABORTED`, the caller should retry - // the transaction from the beginning, reusing the same session. - // - // On very rare occasions, `Commit` might return `UNKNOWN`. This can happen, - // for example, if the client job experiences a 1+ hour networking failure. - // At that point, Cloud Spanner has lost track of the transaction outcome and - // we recommend that you perform another read from the database to see the - // state of things as they are now. - rpc Commit(CommitRequest) returns (CommitResponse) { - option (google.api.http) = { - post: "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:commit" - body: "*" - }; - option (google.api.method_signature) = "session,transaction_id,mutations"; - option (google.api.method_signature) = - "session,single_use_transaction,mutations"; - } - - // Rolls back a transaction, releasing any locks it holds. It's a good - // idea to call this for any transaction that includes one or more - // [Read][google.spanner.v1.Spanner.Read] or - // [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql] requests and ultimately - // decides not to commit. - // - // `Rollback` returns `OK` if it successfully aborts the transaction, the - // transaction was already aborted, or the transaction isn't - // found. `Rollback` never returns `ABORTED`. - rpc Rollback(RollbackRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:rollback" - body: "*" - }; - option (google.api.method_signature) = "session,transaction_id"; - } - - // Creates a set of partition tokens that can be used to execute a query - // operation in parallel. Each of the returned partition tokens can be used - // by [ExecuteStreamingSql][google.spanner.v1.Spanner.ExecuteStreamingSql] to - // specify a subset of the query result to read. The same session and - // read-only transaction must be used by the `PartitionQueryRequest` used to - // create the partition tokens and the `ExecuteSqlRequests` that use the - // partition tokens. - // - // Partition tokens become invalid when the session used to create them - // is deleted, is idle for too long, begins a new transaction, or becomes too - // old. When any of these happen, it isn't possible to resume the query, and - // the whole operation must be restarted from the beginning. - rpc PartitionQuery(PartitionQueryRequest) returns (PartitionResponse) { - option (google.api.http) = { - post: "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:partitionQuery" - body: "*" - }; - } - - // Creates a set of partition tokens that can be used to execute a read - // operation in parallel. Each of the returned partition tokens can be used - // by [StreamingRead][google.spanner.v1.Spanner.StreamingRead] to specify a - // subset of the read result to read. The same session and read-only - // transaction must be used by the `PartitionReadRequest` used to create the - // partition tokens and the `ReadRequests` that use the partition tokens. - // There are no ordering guarantees on rows returned among the returned - // partition tokens, or even within each individual `StreamingRead` call - // issued with a `partition_token`. - // - // Partition tokens become invalid when the session used to create them - // is deleted, is idle for too long, begins a new transaction, or becomes too - // old. When any of these happen, it isn't possible to resume the read, and - // the whole operation must be restarted from the beginning. - rpc PartitionRead(PartitionReadRequest) returns (PartitionResponse) { - option (google.api.http) = { - post: "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:partitionRead" - body: "*" - }; - } - - // Batches the supplied mutation groups in a collection of efficient - // transactions. All mutations in a group are committed atomically. However, - // mutations across groups can be committed non-atomically in an unspecified - // order and thus, they must be independent of each other. Partial failure is - // possible, that is, some groups might have been committed successfully, - // while some might have failed. The results of individual batches are - // streamed into the response as the batches are applied. - // - // `BatchWrite` requests are not replay protected, meaning that each mutation - // group can be applied more than once. Replays of non-idempotent mutations - // can have undesirable effects. For example, replays of an insert mutation - // can produce an already exists error or if you use generated or commit - // timestamp-based keys, it can result in additional rows being added to the - // mutation's table. We recommend structuring your mutation groups to be - // idempotent to avoid this issue. - rpc BatchWrite(BatchWriteRequest) returns (stream BatchWriteResponse) { - option (google.api.http) = { - post: "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:batchWrite" - body: "*" - }; - option (google.api.method_signature) = "session,mutation_groups"; - } -} - -// The request for [CreateSession][google.spanner.v1.Spanner.CreateSession]. -message CreateSessionRequest { - // Required. The database in which the new session is created. - string database = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "spanner.googleapis.com/Database" - } - ]; - - // Required. The session to create. - Session session = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// The request for -// [BatchCreateSessions][google.spanner.v1.Spanner.BatchCreateSessions]. -message BatchCreateSessionsRequest { - // Required. The database in which the new sessions are created. - string database = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "spanner.googleapis.com/Database" - } - ]; - - // Parameters to apply to each created session. - Session session_template = 2; - - // Required. The number of sessions to be created in this batch call. At least - // one session is created. The API can return fewer than the requested number - // of sessions. If a specific number of sessions are desired, the client can - // make additional calls to `BatchCreateSessions` (adjusting - // [session_count][google.spanner.v1.BatchCreateSessionsRequest.session_count] - // as necessary). - int32 session_count = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// The response for -// [BatchCreateSessions][google.spanner.v1.Spanner.BatchCreateSessions]. -message BatchCreateSessionsResponse { - // The freshly created sessions. - repeated Session session = 1; -} - -// A session in the Cloud Spanner API. -message Session { - option (google.api.resource) = { - type: "spanner.googleapis.com/Session" - pattern: "projects/{project}/instances/{instance}/databases/{database}/sessions/{session}" - plural: "sessions" - singular: "session" - }; - - // Output only. The name of the session. This is always system-assigned. - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The labels for the session. - // - // * Label keys must be between 1 and 63 characters long and must conform to - // the following regular expression: `[a-z]([-a-z0-9]*[a-z0-9])?`. - // * Label values must be between 0 and 63 characters long and must conform - // to the regular expression `([a-z]([-a-z0-9]*[a-z0-9])?)?`. - // * No more than 64 labels can be associated with a given session. - // - // See https://goo.gl/xmQnxf for more information on and examples of labels. - map labels = 2; - - // Output only. The timestamp when the session is created. - google.protobuf.Timestamp create_time = 3 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The approximate timestamp when the session is last used. It's - // typically earlier than the actual last use time. - google.protobuf.Timestamp approximate_last_use_time = 4 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The database role which created this session. - string creator_role = 5; - - // Optional. If `true`, specifies a multiplexed session. Use a multiplexed - // session for multiple, concurrent operations including any combination of - // read-only and read-write transactions. Use - // [`sessions.create`][google.spanner.v1.Spanner.CreateSession] to create - // multiplexed sessions. Don't use - // [BatchCreateSessions][google.spanner.v1.Spanner.BatchCreateSessions] to - // create a multiplexed session. You can't delete or list multiplexed - // sessions. - bool multiplexed = 6 [(google.api.field_behavior) = OPTIONAL]; -} - -// The request for [GetSession][google.spanner.v1.Spanner.GetSession]. -message GetSessionRequest { - // Required. The name of the session to retrieve. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "spanner.googleapis.com/Session" } - ]; -} - -// The request for [ListSessions][google.spanner.v1.Spanner.ListSessions]. -message ListSessionsRequest { - // Required. The database in which to list sessions. - string database = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "spanner.googleapis.com/Database" - } - ]; - - // Number of sessions to be returned in the response. If 0 or less, defaults - // to the server's maximum allowed page size. - int32 page_size = 2; - - // If non-empty, `page_token` should contain a - // [next_page_token][google.spanner.v1.ListSessionsResponse.next_page_token] - // from a previous - // [ListSessionsResponse][google.spanner.v1.ListSessionsResponse]. - string page_token = 3; - - // An expression for filtering the results of the request. Filter rules are - // case insensitive. The fields eligible for filtering are: - // - // * `labels.key` where key is the name of a label - // - // Some examples of using filters are: - // - // * `labels.env:*` --> The session has the label "env". - // * `labels.env:dev` --> The session has the label "env" and the value of - // the label contains the string "dev". - string filter = 4; -} - -// The response for [ListSessions][google.spanner.v1.Spanner.ListSessions]. -message ListSessionsResponse { - // The list of requested sessions. - repeated Session sessions = 1; - - // `next_page_token` can be sent in a subsequent - // [ListSessions][google.spanner.v1.Spanner.ListSessions] call to fetch more - // of the matching sessions. - string next_page_token = 2; -} - -// The request for [DeleteSession][google.spanner.v1.Spanner.DeleteSession]. -message DeleteSessionRequest { - // Required. The name of the session to delete. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "spanner.googleapis.com/Session" } - ]; -} - -// Common request options for various APIs. -message RequestOptions { - // The relative priority for requests. Note that priority isn't applicable - // for [BeginTransaction][google.spanner.v1.Spanner.BeginTransaction]. - // - // The priority acts as a hint to the Cloud Spanner scheduler and doesn't - // guarantee priority or order of execution. For example: - // - // * Some parts of a write operation always execute at `PRIORITY_HIGH`, - // regardless of the specified priority. This can cause you to see an - // increase in high priority workload even when executing a low priority - // request. This can also potentially cause a priority inversion where a - // lower priority request is fulfilled ahead of a higher priority - // request. - // * If a transaction contains multiple operations with different priorities, - // Cloud Spanner doesn't guarantee to process the higher priority - // operations first. There might be other constraints to satisfy, such as - // the order of operations. - enum Priority { - // `PRIORITY_UNSPECIFIED` is equivalent to `PRIORITY_HIGH`. - PRIORITY_UNSPECIFIED = 0; - - // This specifies that the request is low priority. - PRIORITY_LOW = 1; - - // This specifies that the request is medium priority. - PRIORITY_MEDIUM = 2; - - // This specifies that the request is high priority. - PRIORITY_HIGH = 3; - } - - // Container for various pieces of client-owned context attached to a request. - message ClientContext { - // Optional. Map of parameter name to value for this request. These values - // will be returned by any SECURE_CONTEXT() calls invoked by this request - // (e.g., by queries against Parameterized Secure Views). - map secure_context = 1 - [(google.api.field_behavior) = OPTIONAL]; - } - - // Priority for the request. - Priority priority = 1; - - // A per-request tag which can be applied to queries or reads, used for - // statistics collection. - // Both `request_tag` and `transaction_tag` can be specified for a read or - // query that belongs to a transaction. - // This field is ignored for requests where it's not applicable (for example, - // `CommitRequest`). - // Legal characters for `request_tag` values are all printable characters - // (ASCII 32 - 126) and the length of a request_tag is limited to 50 - // characters. Values that exceed this limit are truncated. - // Any leading underscore (_) characters are removed from the string. - string request_tag = 2; - - // A tag used for statistics collection about this transaction. - // Both `request_tag` and `transaction_tag` can be specified for a read or - // query that belongs to a transaction. - // To enable tagging on a transaction, `transaction_tag` must be set to the - // same value for all requests belonging to the same transaction, including - // [BeginTransaction][google.spanner.v1.Spanner.BeginTransaction]. - // If this request doesn't belong to any transaction, `transaction_tag` is - // ignored. - // Legal characters for `transaction_tag` values are all printable characters - // (ASCII 32 - 126) and the length of a `transaction_tag` is limited to 50 - // characters. Values that exceed this limit are truncated. - // Any leading underscore (_) characters are removed from the string. - string transaction_tag = 3; - - // Optional. Optional context that may be needed for some requests. - ClientContext client_context = 4 [(google.api.field_behavior) = OPTIONAL]; -} - -// The `DirectedReadOptions` can be used to indicate which replicas or regions -// should be used for non-transactional reads or queries. -// -// `DirectedReadOptions` can only be specified for a read-only transaction, -// otherwise the API returns an `INVALID_ARGUMENT` error. -message DirectedReadOptions { - // The directed read replica selector. - // Callers must provide one or more of the following fields for replica - // selection: - // - // * `location` - The location must be one of the regions within the - // multi-region configuration of your database. - // * `type` - The type of the replica. - // - // Some examples of using replica_selectors are: - // - // * `location:us-east1` --> The "us-east1" replica(s) of any available type - // is used to process the request. - // * `type:READ_ONLY` --> The "READ_ONLY" type replica(s) in the nearest - // available location are used to process the - // request. - // * `location:us-east1 type:READ_ONLY` --> The "READ_ONLY" type replica(s) - // in location "us-east1" is used to process - // the request. - message ReplicaSelection { - // Indicates the type of replica. - enum Type { - // Not specified. - TYPE_UNSPECIFIED = 0; - - // Read-write replicas support both reads and writes. - READ_WRITE = 1; - - // Read-only replicas only support reads (not writes). - READ_ONLY = 2; - } - - // The location or region of the serving requests, for example, "us-east1". - string location = 1; - - // The type of replica. - Type type = 2; - } - - // An `IncludeReplicas` contains a repeated set of `ReplicaSelection` which - // indicates the order in which replicas should be considered. - message IncludeReplicas { - // The directed read replica selector. - repeated ReplicaSelection replica_selections = 1; - - // If `true`, Spanner doesn't route requests to a replica outside the - // <`include_replicas` list when all of the specified replicas are - // unavailable or unhealthy. Default value is `false`. - bool auto_failover_disabled = 2; - } - - // An ExcludeReplicas contains a repeated set of ReplicaSelection that should - // be excluded from serving requests. - message ExcludeReplicas { - // The directed read replica selector. - repeated ReplicaSelection replica_selections = 1; - } - - // Required. At most one of either `include_replicas` or `exclude_replicas` - // should be present in the message. - oneof replicas { - // `Include_replicas` indicates the order of replicas (as they appear in - // this list) to process the request. If `auto_failover_disabled` is set to - // `true` and all replicas are exhausted without finding a healthy replica, - // Spanner waits for a replica in the list to become available, requests - // might fail due to `DEADLINE_EXCEEDED` errors. - IncludeReplicas include_replicas = 1; - - // `Exclude_replicas` indicates that specified replicas should be excluded - // from serving requests. Spanner doesn't route requests to the replicas - // in this list. - ExcludeReplicas exclude_replicas = 2; - } -} - -// The request for [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql] and -// [ExecuteStreamingSql][google.spanner.v1.Spanner.ExecuteStreamingSql]. -message ExecuteSqlRequest { - // Mode in which the statement must be processed. - enum QueryMode { - // The default mode. Only the statement results are returned. - NORMAL = 0; - - // This mode returns only the query plan, without any results or - // execution statistics information. - PLAN = 1; - - // This mode returns the query plan, overall execution statistics, - // operator level execution statistics along with the results. This has a - // performance overhead compared to the other modes. It isn't recommended - // to use this mode for production traffic. - PROFILE = 2; - - // This mode returns the overall (but not operator-level) execution - // statistics along with the results. - WITH_STATS = 3; - - // This mode returns the query plan, overall (but not operator-level) - // execution statistics along with the results. - WITH_PLAN_AND_STATS = 4; - } - - // Query optimizer configuration. - message QueryOptions { - // An option to control the selection of optimizer version. - // - // This parameter allows individual queries to pick different query - // optimizer versions. - // - // Specifying `latest` as a value instructs Cloud Spanner to use the - // latest supported query optimizer version. If not specified, Cloud Spanner - // uses the optimizer version set at the database level options. Any other - // positive integer (from the list of supported optimizer versions) - // overrides the default optimizer version for query execution. - // - // The list of supported optimizer versions can be queried from - // `SPANNER_SYS.SUPPORTED_OPTIMIZER_VERSIONS`. - // - // Executing a SQL statement with an invalid optimizer version fails with - // an `INVALID_ARGUMENT` error. - // - // See - // https://cloud.google.com/spanner/docs/query-optimizer/manage-query-optimizer - // for more information on managing the query optimizer. - // - // The `optimizer_version` statement hint has precedence over this setting. - string optimizer_version = 1; - - // An option to control the selection of optimizer statistics package. - // - // This parameter allows individual queries to use a different query - // optimizer statistics package. - // - // Specifying `latest` as a value instructs Cloud Spanner to use the latest - // generated statistics package. If not specified, Cloud Spanner uses - // the statistics package set at the database level options, or the latest - // package if the database option isn't set. - // - // The statistics package requested by the query has to be exempt from - // garbage collection. This can be achieved with the following DDL - // statement: - // - // ```sql - // ALTER STATISTICS SET OPTIONS (allow_gc=false) - // ``` - // - // The list of available statistics packages can be queried from - // `INFORMATION_SCHEMA.SPANNER_STATISTICS`. - // - // Executing a SQL statement with an invalid optimizer statistics package - // or with a statistics package that allows garbage collection fails with - // an `INVALID_ARGUMENT` error. - string optimizer_statistics_package = 2; - } - - // Required. The session in which the SQL query should be performed. - string session = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "spanner.googleapis.com/Session" } - ]; - - // The transaction to use. - // - // For queries, if none is provided, the default is a temporary read-only - // transaction with strong concurrency. - // - // Standard DML statements require a read-write transaction. To protect - // against replays, single-use transactions are not supported. The caller - // must either supply an existing transaction ID or begin a new transaction. - // - // Partitioned DML requires an existing Partitioned DML transaction ID. - TransactionSelector transaction = 2; - - // Required. The SQL string. - string sql = 3 [(google.api.field_behavior) = REQUIRED]; - - // Parameter names and values that bind to placeholders in the SQL string. - // - // A parameter placeholder consists of the `@` character followed by the - // parameter name (for example, `@firstName`). Parameter names must conform - // to the naming requirements of identifiers as specified at - // https://cloud.google.com/spanner/docs/lexical#identifiers. - // - // Parameters can appear anywhere that a literal value is expected. The same - // parameter name can be used more than once, for example: - // - // `"WHERE id > @msg_id AND id < @msg_id + 100"` - // - // It's an error to execute a SQL statement with unbound parameters. - google.protobuf.Struct params = 4; - - // It isn't always possible for Cloud Spanner to infer the right SQL type - // from a JSON value. For example, values of type `BYTES` and values - // of type `STRING` both appear in - // [params][google.spanner.v1.ExecuteSqlRequest.params] as JSON strings. - // - // In these cases, you can use `param_types` to specify the exact - // SQL type for some or all of the SQL statement parameters. See the - // definition of [Type][google.spanner.v1.Type] for more information - // about SQL types. - map param_types = 5; - - // If this request is resuming a previously interrupted SQL statement - // execution, `resume_token` should be copied from the last - // [PartialResultSet][google.spanner.v1.PartialResultSet] yielded before the - // interruption. Doing this enables the new SQL statement execution to resume - // where the last one left off. The rest of the request parameters must - // exactly match the request that yielded this token. - bytes resume_token = 6; - - // Used to control the amount of debugging information returned in - // [ResultSetStats][google.spanner.v1.ResultSetStats]. If - // [partition_token][google.spanner.v1.ExecuteSqlRequest.partition_token] is - // set, [query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode] can only - // be set to - // [QueryMode.NORMAL][google.spanner.v1.ExecuteSqlRequest.QueryMode.NORMAL]. - QueryMode query_mode = 7; - - // If present, results are restricted to the specified partition - // previously created using `PartitionQuery`. There must be an exact - // match for the values of fields common to this message and the - // `PartitionQueryRequest` message used to create this `partition_token`. - bytes partition_token = 8; - - // A per-transaction sequence number used to identify this request. This field - // makes each request idempotent such that if the request is received multiple - // times, at most one succeeds. - // - // The sequence number must be monotonically increasing within the - // transaction. If a request arrives for the first time with an out-of-order - // sequence number, the transaction can be aborted. Replays of previously - // handled requests yield the same response as the first execution. - // - // Required for DML statements. Ignored for queries. - int64 seqno = 9; - - // Query optimizer configuration to use for the given query. - QueryOptions query_options = 10; - - // Common options for this request. - RequestOptions request_options = 11; - - // Directed read options for this request. - DirectedReadOptions directed_read_options = 15; - - // If this is for a partitioned query and this field is set to `true`, the - // request is executed with Spanner Data Boost independent compute resources. - // - // If the field is set to `true` but the request doesn't set - // `partition_token`, the API returns an `INVALID_ARGUMENT` error. - bool data_boost_enabled = 16; - - // Optional. If set to `true`, this statement marks the end of the - // transaction. After this statement executes, you must commit or abort the - // transaction. Attempts to execute any other requests against this - // transaction (including reads and queries) are rejected. - // - // For DML statements, setting this option might cause some error reporting to - // be deferred until commit time (for example, validation of unique - // constraints). Given this, successful execution of a DML statement shouldn't - // be assumed until a subsequent `Commit` call completes successfully. - bool last_statement = 17 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If present, it makes the Spanner requests location-aware. - // - // It gives the server hints that can be used to route the request - // to an appropriate server, potentially significantly decreasing latency and - // improving throughput. To achieve improved performance, most fields must be - // filled in with accurate values. - RoutingHint routing_hint = 18 [(google.api.field_behavior) = OPTIONAL]; -} - -// The request for [ExecuteBatchDml][google.spanner.v1.Spanner.ExecuteBatchDml]. -message ExecuteBatchDmlRequest { - // A single DML statement. - message Statement { - // Required. The DML string. - string sql = 1 [(google.api.field_behavior) = REQUIRED]; - - // Parameter names and values that bind to placeholders in the DML string. - // - // A parameter placeholder consists of the `@` character followed by the - // parameter name (for example, `@firstName`). Parameter names can contain - // letters, numbers, and underscores. - // - // Parameters can appear anywhere that a literal value is expected. The - // same parameter name can be used more than once, for example: - // - // `"WHERE id > @msg_id AND id < @msg_id + 100"` - // - // It's an error to execute a SQL statement with unbound parameters. - google.protobuf.Struct params = 2; - - // It isn't always possible for Cloud Spanner to infer the right SQL type - // from a JSON value. For example, values of type `BYTES` and values - // of type `STRING` both appear in - // [params][google.spanner.v1.ExecuteBatchDmlRequest.Statement.params] as - // JSON strings. - // - // In these cases, `param_types` can be used to specify the exact - // SQL type for some or all of the SQL statement parameters. See the - // definition of [Type][google.spanner.v1.Type] for more information - // about SQL types. - map param_types = 3; - } - - // Required. The session in which the DML statements should be performed. - string session = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "spanner.googleapis.com/Session" } - ]; - - // Required. The transaction to use. Must be a read-write transaction. - // - // To protect against replays, single-use transactions are not supported. The - // caller must either supply an existing transaction ID or begin a new - // transaction. - TransactionSelector transaction = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The list of statements to execute in this batch. Statements are - // executed serially, such that the effects of statement `i` are visible to - // statement `i+1`. Each statement must be a DML statement. Execution stops at - // the first failed statement; the remaining statements are not executed. - // - // Callers must provide at least one statement. - repeated Statement statements = 3 [(google.api.field_behavior) = REQUIRED]; - - // Required. A per-transaction sequence number used to identify this request. - // This field makes each request idempotent such that if the request is - // received multiple times, at most one succeeds. - // - // The sequence number must be monotonically increasing within the - // transaction. If a request arrives for the first time with an out-of-order - // sequence number, the transaction might be aborted. Replays of previously - // handled requests yield the same response as the first execution. - int64 seqno = 4 [(google.api.field_behavior) = REQUIRED]; - - // Common options for this request. - RequestOptions request_options = 5; - - // Optional. If set to `true`, this request marks the end of the transaction. - // After these statements execute, you must commit or abort the transaction. - // Attempts to execute any other requests against this transaction - // (including reads and queries) are rejected. - // - // Setting this option might cause some error reporting to be deferred until - // commit time (for example, validation of unique constraints). Given this, - // successful execution of statements shouldn't be assumed until a subsequent - // `Commit` call completes successfully. - bool last_statements = 6 [(google.api.field_behavior) = OPTIONAL]; -} - -// The response for -// [ExecuteBatchDml][google.spanner.v1.Spanner.ExecuteBatchDml]. Contains a list -// of [ResultSet][google.spanner.v1.ResultSet] messages, one for each DML -// statement that has successfully executed, in the same order as the statements -// in the request. If a statement fails, the status in the response body -// identifies the cause of the failure. -// -// To check for DML statements that failed, use the following approach: -// -// 1. Check the status in the response message. The -// [google.rpc.Code][google.rpc.Code] enum -// value `OK` indicates that all statements were executed successfully. -// 2. If the status was not `OK`, check the number of result sets in the -// response. If the response contains `N` -// [ResultSet][google.spanner.v1.ResultSet] messages, then statement `N+1` in -// the request failed. -// -// Example 1: -// -// * Request: 5 DML statements, all executed successfully. -// * Response: 5 [ResultSet][google.spanner.v1.ResultSet] messages, with the -// status `OK`. -// -// Example 2: -// -// * Request: 5 DML statements. The third statement has a syntax error. -// * Response: 2 [ResultSet][google.spanner.v1.ResultSet] messages, and a syntax -// error (`INVALID_ARGUMENT`) -// status. The number of [ResultSet][google.spanner.v1.ResultSet] messages -// indicates that the third statement failed, and the fourth and fifth -// statements were not executed. -message ExecuteBatchDmlResponse { - // One [ResultSet][google.spanner.v1.ResultSet] for each statement in the - // request that ran successfully, in the same order as the statements in the - // request. Each [ResultSet][google.spanner.v1.ResultSet] does not contain any - // rows. The [ResultSetStats][google.spanner.v1.ResultSetStats] in each - // [ResultSet][google.spanner.v1.ResultSet] contain the number of rows - // modified by the statement. - // - // Only the first [ResultSet][google.spanner.v1.ResultSet] in the response - // contains valid [ResultSetMetadata][google.spanner.v1.ResultSetMetadata]. - repeated ResultSet result_sets = 1; - - // If all DML statements are executed successfully, the status is `OK`. - // Otherwise, the error status of the first failed statement. - google.rpc.Status status = 2; - - // Optional. A precommit token is included if the read-write transaction - // is on a multiplexed session. Pass the precommit token with the highest - // sequence number from this transaction attempt should be passed to the - // [Commit][google.spanner.v1.Spanner.Commit] request for this transaction. - MultiplexedSessionPrecommitToken precommit_token = 3 - [(google.api.field_behavior) = OPTIONAL]; -} - -// Options for a `PartitionQueryRequest` and `PartitionReadRequest`. -message PartitionOptions { - // **Note:** This hint is currently ignored by `PartitionQuery` and - // `PartitionRead` requests. - // - // The desired data size for each partition generated. The default for this - // option is currently 1 GiB. This is only a hint. The actual size of each - // partition can be smaller or larger than this size request. - int64 partition_size_bytes = 1; - - // **Note:** This hint is currently ignored by `PartitionQuery` and - // `PartitionRead` requests. - // - // The desired maximum number of partitions to return. For example, this - // might be set to the number of workers available. The default for this - // option is currently 10,000. The maximum value is currently 200,000. This - // is only a hint. The actual number of partitions returned can be smaller or - // larger than this maximum count request. - int64 max_partitions = 2; -} - -// The request for [PartitionQuery][google.spanner.v1.Spanner.PartitionQuery] -message PartitionQueryRequest { - // Required. The session used to create the partitions. - string session = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "spanner.googleapis.com/Session" } - ]; - - // Read-only snapshot transactions are supported, read and write and - // single-use transactions are not. - TransactionSelector transaction = 2; - - // Required. The query request to generate partitions for. The request fails - // if the query isn't root partitionable. For a query to be root - // partitionable, it needs to satisfy a few conditions. For example, if the - // query execution plan contains a distributed union operator, then it must be - // the first operator in the plan. For more information about other - // conditions, see [Read data in - // parallel](https://cloud.google.com/spanner/docs/reads#read_data_in_parallel). - // - // The query request must not contain DML commands, such as `INSERT`, - // `UPDATE`, or `DELETE`. Use - // [`ExecuteStreamingSql`][google.spanner.v1.Spanner.ExecuteStreamingSql] with - // a `PartitionedDml` transaction for large, partition-friendly DML - // operations. - string sql = 3 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Parameter names and values that bind to placeholders in the SQL - // string. - // - // A parameter placeholder consists of the `@` character followed by the - // parameter name (for example, `@firstName`). Parameter names can contain - // letters, numbers, and underscores. - // - // Parameters can appear anywhere that a literal value is expected. The same - // parameter name can be used more than once, for example: - // - // `"WHERE id > @msg_id AND id < @msg_id + 100"` - // - // It's an error to execute a SQL statement with unbound parameters. - google.protobuf.Struct params = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. It isn't always possible for Cloud Spanner to infer the right SQL - // type from a JSON value. For example, values of type `BYTES` and values of - // type `STRING` both appear in - // [params][google.spanner.v1.PartitionQueryRequest.params] as JSON strings. - // - // In these cases, `param_types` can be used to specify the exact - // SQL type for some or all of the SQL query parameters. See the - // definition of [Type][google.spanner.v1.Type] for more information - // about SQL types. - map param_types = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Additional options that affect how many partitions are created. - PartitionOptions partition_options = 6; -} - -// The request for [PartitionRead][google.spanner.v1.Spanner.PartitionRead] -message PartitionReadRequest { - // Required. The session used to create the partitions. - string session = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "spanner.googleapis.com/Session" } - ]; - - // Read only snapshot transactions are supported, read/write and single use - // transactions are not. - TransactionSelector transaction = 2; - - // Required. The name of the table in the database to be read. - string table = 3 [(google.api.field_behavior) = REQUIRED]; - - // If non-empty, the name of an index on - // [table][google.spanner.v1.PartitionReadRequest.table]. This index is used - // instead of the table primary key when interpreting - // [key_set][google.spanner.v1.PartitionReadRequest.key_set] and sorting - // result rows. See [key_set][google.spanner.v1.PartitionReadRequest.key_set] - // for further information. - string index = 4; - - // The columns of [table][google.spanner.v1.PartitionReadRequest.table] to be - // returned for each row matching this request. - repeated string columns = 5; - - // Required. `key_set` identifies the rows to be yielded. `key_set` names the - // primary keys of the rows in - // [table][google.spanner.v1.PartitionReadRequest.table] to be yielded, unless - // [index][google.spanner.v1.PartitionReadRequest.index] is present. If - // [index][google.spanner.v1.PartitionReadRequest.index] is present, then - // [key_set][google.spanner.v1.PartitionReadRequest.key_set] instead names - // index keys in [index][google.spanner.v1.PartitionReadRequest.index]. - // - // It isn't an error for the `key_set` to name rows that don't - // exist in the database. Read yields nothing for nonexistent rows. - KeySet key_set = 6 [(google.api.field_behavior) = REQUIRED]; - - // Additional options that affect how many partitions are created. - PartitionOptions partition_options = 9; -} - -// Information returned for each partition returned in a -// PartitionResponse. -message Partition { - // This token can be passed to `Read`, `StreamingRead`, `ExecuteSql`, or - // `ExecuteStreamingSql` requests to restrict the results to those identified - // by this partition token. - bytes partition_token = 1; -} - -// The response for [PartitionQuery][google.spanner.v1.Spanner.PartitionQuery] -// or [PartitionRead][google.spanner.v1.Spanner.PartitionRead] -message PartitionResponse { - // Partitions created by this request. - repeated Partition partitions = 1; - - // Transaction created by this request. - Transaction transaction = 2; -} - -// The request for [Read][google.spanner.v1.Spanner.Read] and -// [StreamingRead][google.spanner.v1.Spanner.StreamingRead]. -message ReadRequest { - // An option to control the order in which rows are returned from a read. - enum OrderBy { - // Default value. - // - // `ORDER_BY_UNSPECIFIED` is equivalent to `ORDER_BY_PRIMARY_KEY`. - ORDER_BY_UNSPECIFIED = 0; - - // Read rows are returned in primary key order. - // - // In the event that this option is used in conjunction with the - // `partition_token` field, the API returns an `INVALID_ARGUMENT` error. - ORDER_BY_PRIMARY_KEY = 1; - - // Read rows are returned in any order. - ORDER_BY_NO_ORDER = 2; - } - - // A lock hint mechanism for reads done within a transaction. - enum LockHint { - // Default value. - // - // `LOCK_HINT_UNSPECIFIED` is equivalent to `LOCK_HINT_SHARED`. - LOCK_HINT_UNSPECIFIED = 0; - - // Acquire shared locks. - // - // By default when you perform a read as part of a read-write transaction, - // Spanner acquires shared read locks, which allows other reads to still - // access the data until your transaction is ready to commit. When your - // transaction is committing and writes are being applied, the transaction - // attempts to upgrade to an exclusive lock for any data you are writing. - // For more information about locks, see [Lock - // modes](https://cloud.google.com/spanner/docs/introspection/lock-statistics#explain-lock-modes). - LOCK_HINT_SHARED = 1; - - // Acquire exclusive locks. - // - // Requesting exclusive locks is beneficial if you observe high write - // contention, which means you notice that multiple transactions are - // concurrently trying to read and write to the same data, resulting in a - // large number of aborts. This problem occurs when two transactions - // initially acquire shared locks and then both try to upgrade to exclusive - // locks at the same time. In this situation both transactions are waiting - // for the other to give up their lock, resulting in a deadlocked situation. - // Spanner is able to detect this occurring and force one of the - // transactions to abort. However, this is a slow and expensive operation - // and results in lower performance. In this case it makes sense to acquire - // exclusive locks at the start of the transaction because then when - // multiple transactions try to act on the same data, they automatically get - // serialized. Each transaction waits its turn to acquire the lock and - // avoids getting into deadlock situations. - // - // Because the exclusive lock hint is just a hint, it shouldn't be - // considered equivalent to a mutex. In other words, you shouldn't use - // Spanner exclusive locks as a mutual exclusion mechanism for the execution - // of code outside of Spanner. - // - // **Note:** Request exclusive locks judiciously because they block others - // from reading that data for the entire transaction, rather than just when - // the writes are being performed. Unless you observe high write contention, - // you should use the default of shared read locks so you don't prematurely - // block other clients from reading the data that you're writing to. - LOCK_HINT_EXCLUSIVE = 2; - } - - // Required. The session in which the read should be performed. - string session = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "spanner.googleapis.com/Session" } - ]; - - // The transaction to use. If none is provided, the default is a - // temporary read-only transaction with strong concurrency. - TransactionSelector transaction = 2; - - // Required. The name of the table in the database to be read. - string table = 3 [(google.api.field_behavior) = REQUIRED]; - - // If non-empty, the name of an index on - // [table][google.spanner.v1.ReadRequest.table]. This index is used instead of - // the table primary key when interpreting - // [key_set][google.spanner.v1.ReadRequest.key_set] and sorting result rows. - // See [key_set][google.spanner.v1.ReadRequest.key_set] for further - // information. - string index = 4; - - // Required. The columns of [table][google.spanner.v1.ReadRequest.table] to be - // returned for each row matching this request. - repeated string columns = 5 [(google.api.field_behavior) = REQUIRED]; - - // Required. `key_set` identifies the rows to be yielded. `key_set` names the - // primary keys of the rows in [table][google.spanner.v1.ReadRequest.table] to - // be yielded, unless [index][google.spanner.v1.ReadRequest.index] is present. - // If [index][google.spanner.v1.ReadRequest.index] is present, then - // [key_set][google.spanner.v1.ReadRequest.key_set] instead names index keys - // in [index][google.spanner.v1.ReadRequest.index]. - // - // If the [partition_token][google.spanner.v1.ReadRequest.partition_token] - // field is empty, rows are yielded in table primary key order (if - // [index][google.spanner.v1.ReadRequest.index] is empty) or index key order - // (if [index][google.spanner.v1.ReadRequest.index] is non-empty). If the - // [partition_token][google.spanner.v1.ReadRequest.partition_token] field - // isn't empty, rows are yielded in an unspecified order. - // - // It isn't an error for the `key_set` to name rows that don't - // exist in the database. Read yields nothing for nonexistent rows. - KeySet key_set = 6 [(google.api.field_behavior) = REQUIRED]; - - // If greater than zero, only the first `limit` rows are yielded. If `limit` - // is zero, the default is no limit. A limit can't be specified if - // `partition_token` is set. - int64 limit = 8; - - // If this request is resuming a previously interrupted read, - // `resume_token` should be copied from the last - // [PartialResultSet][google.spanner.v1.PartialResultSet] yielded before the - // interruption. Doing this enables the new read to resume where the last read - // left off. The rest of the request parameters must exactly match the request - // that yielded this token. - bytes resume_token = 9; - - // If present, results are restricted to the specified partition - // previously created using `PartitionRead`. There must be an exact - // match for the values of fields common to this message and the - // PartitionReadRequest message used to create this partition_token. - bytes partition_token = 10; - - // Common options for this request. - RequestOptions request_options = 11; - - // Directed read options for this request. - DirectedReadOptions directed_read_options = 14; - - // If this is for a partitioned read and this field is set to `true`, the - // request is executed with Spanner Data Boost independent compute resources. - // - // If the field is set to `true` but the request doesn't set - // `partition_token`, the API returns an `INVALID_ARGUMENT` error. - bool data_boost_enabled = 15; - - // Optional. Order for the returned rows. - // - // By default, Spanner returns result rows in primary key order except for - // PartitionRead requests. For applications that don't require rows to be - // returned in primary key (`ORDER_BY_PRIMARY_KEY`) order, setting - // `ORDER_BY_NO_ORDER` option allows Spanner to optimize row retrieval, - // resulting in lower latencies in certain cases (for example, bulk point - // lookups). - OrderBy order_by = 16 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Lock Hint for the request, it can only be used with read-write - // transactions. - LockHint lock_hint = 17 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If present, it makes the Spanner requests location-aware. - // - // It gives the server hints that can be used to route the request - // to an appropriate server, potentially significantly decreasing latency and - // improving throughput. To achieve improved performance, most fields must be - // filled in with accurate values. - RoutingHint routing_hint = 18 [(google.api.field_behavior) = OPTIONAL]; -} - -// The request for -// [BeginTransaction][google.spanner.v1.Spanner.BeginTransaction]. -message BeginTransactionRequest { - // Required. The session in which the transaction runs. - string session = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "spanner.googleapis.com/Session" } - ]; - - // Required. Options for the new transaction. - TransactionOptions options = 2 [(google.api.field_behavior) = REQUIRED]; - - // Common options for this request. - // Priority is ignored for this request. Setting the priority in this - // `request_options` struct doesn't do anything. To set the priority for a - // transaction, set it on the reads and writes that are part of this - // transaction instead. - RequestOptions request_options = 3; - - // Optional. Required for read-write transactions on a multiplexed session - // that commit mutations but don't perform any reads or queries. You must - // randomly select one of the mutations from the mutation set and send it as a - // part of this request. - Mutation mutation_key = 4 [(google.api.field_behavior) = OPTIONAL]; -} - -// The request for [Commit][google.spanner.v1.Spanner.Commit]. -message CommitRequest { - // Required. The session in which the transaction to be committed is running. - string session = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "spanner.googleapis.com/Session" } - ]; - - // Required. The transaction in which to commit. - oneof transaction { - // Commit a previously-started transaction. - bytes transaction_id = 2; - - // Execute mutations in a temporary transaction. Note that unlike - // commit of a previously-started transaction, commit with a - // temporary transaction is non-idempotent. That is, if the - // `CommitRequest` is sent to Cloud Spanner more than once (for - // instance, due to retries in the application, or in the - // transport library), it's possible that the mutations are - // executed more than once. If this is undesirable, use - // [BeginTransaction][google.spanner.v1.Spanner.BeginTransaction] and - // [Commit][google.spanner.v1.Spanner.Commit] instead. - TransactionOptions single_use_transaction = 3; - } - - // The mutations to be executed when this transaction commits. All - // mutations are applied atomically, in the order they appear in - // this list. - repeated Mutation mutations = 4; - - // If `true`, then statistics related to the transaction is included in - // the [CommitResponse][google.spanner.v1.CommitResponse.commit_stats]. - // Default value is `false`. - bool return_commit_stats = 5; - - // Optional. The amount of latency this request is configured to incur in - // order to improve throughput. If this field isn't set, Spanner assumes - // requests are relatively latency sensitive and automatically determines an - // appropriate delay time. You can specify a commit delay value between 0 and - // 500 ms. - google.protobuf.Duration max_commit_delay = 8 - [(google.api.field_behavior) = OPTIONAL]; - - // Common options for this request. - RequestOptions request_options = 6; - - // Optional. If the read-write transaction was executed on a multiplexed - // session, then you must include the precommit token with the highest - // sequence number received in this transaction attempt. Failing to do so - // results in a `FailedPrecondition` error. - MultiplexedSessionPrecommitToken precommit_token = 9 - [(google.api.field_behavior) = OPTIONAL]; -} - -// The request for [Rollback][google.spanner.v1.Spanner.Rollback]. -message RollbackRequest { - // Required. The session in which the transaction to roll back is running. - string session = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "spanner.googleapis.com/Session" } - ]; - - // Required. The transaction to roll back. - bytes transaction_id = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// The request for [BatchWrite][google.spanner.v1.Spanner.BatchWrite]. -message BatchWriteRequest { - // A group of mutations to be committed together. Related mutations should be - // placed in a group. For example, two mutations inserting rows with the same - // primary key prefix in both parent and child tables are related. - message MutationGroup { - // Required. The mutations in this group. - repeated Mutation mutations = 1 [(google.api.field_behavior) = REQUIRED]; - } - - // Required. The session in which the batch request is to be run. - string session = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "spanner.googleapis.com/Session" } - ]; - - // Common options for this request. - RequestOptions request_options = 3; - - // Required. The groups of mutations to be applied. - repeated MutationGroup mutation_groups = 4 - [(google.api.field_behavior) = REQUIRED]; - - // Optional. If you don't set the `exclude_txn_from_change_streams` option or - // if it's set to `false`, then any change streams monitoring columns modified - // by transactions will capture the updates made within that transaction. - bool exclude_txn_from_change_streams = 5 - [(google.api.field_behavior) = OPTIONAL]; -} - -// The result of applying a batch of mutations. -message BatchWriteResponse { - // The mutation groups applied in this batch. The values index into the - // `mutation_groups` field in the corresponding `BatchWriteRequest`. - repeated int32 indexes = 1; - - // An `OK` status indicates success. Any other status indicates a failure. - google.rpc.Status status = 2; - - // The commit timestamp of the transaction that applied this batch. - // Present if status is OK and the mutation groups were applied, absent - // otherwise. - // - // For mutation groups with conditions, a status=OK and missing - // commit_timestamp means that the mutation groups were not applied due to the - // condition not being satisfied after evaluation. - google.protobuf.Timestamp commit_timestamp = 3; -} diff --git a/owl-bot-staging/executor/v1/protos/google/spanner/v1/transaction.proto b/owl-bot-staging/executor/v1/protos/google/spanner/v1/transaction.proto deleted file mode 100644 index dfdf3b11a..000000000 --- a/owl-bot-staging/executor/v1/protos/google/spanner/v1/transaction.proto +++ /dev/null @@ -1,309 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.spanner.v1; - -import "google/api/field_behavior.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.Spanner.V1"; -option go_package = "cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb"; -option java_multiple_files = true; -option java_outer_classname = "TransactionProto"; -option java_package = "com.google.spanner.v1"; -option php_namespace = "Google\\Cloud\\Spanner\\V1"; -option ruby_package = "Google::Cloud::Spanner::V1"; - -// Options to use for transactions. -message TransactionOptions { - // Message type to initiate a read-write transaction. Currently this - // transaction type has no options. - message ReadWrite { - // `ReadLockMode` is used to set the read lock mode for read-write - // transactions. - enum ReadLockMode { - // Default value. - // - // * If isolation level is - // [REPEATABLE_READ][google.spanner.v1.TransactionOptions.IsolationLevel.REPEATABLE_READ], - // then it is an error to specify `read_lock_mode`. Locking semantics - // default to `OPTIMISTIC`. No validation checks are done for reads, - // except to validate that the data that was served at the snapshot time - // is unchanged at commit time in the following cases: - // 1. reads done as part of queries that use `SELECT FOR UPDATE` - // 2. reads done as part of statements with a `LOCK_SCANNED_RANGES` - // hint - // 3. reads done as part of DML statements - // * At all other isolation levels, if `read_lock_mode` is the default - // value, then pessimistic read locks are used. - READ_LOCK_MODE_UNSPECIFIED = 0; - - // Pessimistic lock mode. - // - // Read locks are acquired immediately on read. - // Semantics described only applies to - // [SERIALIZABLE][google.spanner.v1.TransactionOptions.IsolationLevel.SERIALIZABLE] - // isolation. - PESSIMISTIC = 1; - - // Optimistic lock mode. - // - // Locks for reads within the transaction are not acquired on read. - // Instead the locks are acquired on a commit to validate that - // read/queried data has not changed since the transaction started. - // Semantics described only applies to - // [SERIALIZABLE][google.spanner.v1.TransactionOptions.IsolationLevel.SERIALIZABLE] - // isolation. - OPTIMISTIC = 2; - } - - // Read lock mode for the transaction. - ReadLockMode read_lock_mode = 1; - - // Optional. Clients should pass the transaction ID of the previous - // transaction attempt that was aborted if this transaction is being - // executed on a multiplexed session. - bytes multiplexed_session_previous_transaction_id = 2 - [(google.api.field_behavior) = OPTIONAL]; - } - - // Message type to initiate a Partitioned DML transaction. - message PartitionedDml {} - - // Message type to initiate a read-only transaction. - message ReadOnly { - // How to choose the timestamp for the read-only transaction. - oneof timestamp_bound { - // Read at a timestamp where all previously committed transactions - // are visible. - bool strong = 1; - - // Executes all reads at a timestamp >= `min_read_timestamp`. - // - // This is useful for requesting fresher data than some previous - // read, or data that is fresh enough to observe the effects of some - // previously committed transaction whose timestamp is known. - // - // Note that this option can only be used in single-use transactions. - // - // A timestamp in RFC3339 UTC \"Zulu\" format, accurate to nanoseconds. - // Example: `"2014-10-02T15:01:23.045123456Z"`. - google.protobuf.Timestamp min_read_timestamp = 2; - - // Read data at a timestamp >= `NOW - max_staleness` - // seconds. Guarantees that all writes that have committed more - // than the specified number of seconds ago are visible. Because - // Cloud Spanner chooses the exact timestamp, this mode works even if - // the client's local clock is substantially skewed from Cloud Spanner - // commit timestamps. - // - // Useful for reading the freshest data available at a nearby - // replica, while bounding the possible staleness if the local - // replica has fallen behind. - // - // Note that this option can only be used in single-use - // transactions. - google.protobuf.Duration max_staleness = 3; - - // Executes all reads at the given timestamp. Unlike other modes, - // reads at a specific timestamp are repeatable; the same read at - // the same timestamp always returns the same data. If the - // timestamp is in the future, the read is blocked until the - // specified timestamp, modulo the read's deadline. - // - // Useful for large scale consistent reads such as mapreduces, or - // for coordinating many reads against a consistent snapshot of the - // data. - // - // A timestamp in RFC3339 UTC \"Zulu\" format, accurate to nanoseconds. - // Example: `"2014-10-02T15:01:23.045123456Z"`. - google.protobuf.Timestamp read_timestamp = 4; - - // Executes all reads at a timestamp that is `exact_staleness` - // old. The timestamp is chosen soon after the read is started. - // - // Guarantees that all writes that have committed more than the - // specified number of seconds ago are visible. Because Cloud Spanner - // chooses the exact timestamp, this mode works even if the client's - // local clock is substantially skewed from Cloud Spanner commit - // timestamps. - // - // Useful for reading at nearby replicas without the distributed - // timestamp negotiation overhead of `max_staleness`. - google.protobuf.Duration exact_staleness = 5; - } - - // If true, the Cloud Spanner-selected read timestamp is included in - // the [Transaction][google.spanner.v1.Transaction] message that describes - // the transaction. - bool return_read_timestamp = 6; - } - - // `IsolationLevel` is used when setting the [isolation - // level](https://cloud.google.com/spanner/docs/isolation-levels) for a - // transaction. - enum IsolationLevel { - // Default value. - // - // If the value is not specified, the `SERIALIZABLE` isolation level is - // used. - ISOLATION_LEVEL_UNSPECIFIED = 0; - - // All transactions appear as if they executed in a serial order, even if - // some of the reads, writes, and other operations of distinct transactions - // actually occurred in parallel. Spanner assigns commit timestamps that - // reflect the order of committed transactions to implement this property. - // Spanner offers a stronger guarantee than serializability called external - // consistency. For more information, see - // [TrueTime and external - // consistency](https://cloud.google.com/spanner/docs/true-time-external-consistency#serializability). - SERIALIZABLE = 1; - - // All reads performed during the transaction observe a consistent snapshot - // of the database, and the transaction is only successfully committed in - // the absence of conflicts between its updates and any concurrent updates - // that have occurred since that snapshot. Consequently, in contrast to - // `SERIALIZABLE` transactions, only write-write conflicts are detected in - // snapshot transactions. - // - // This isolation level does not support read-only and partitioned DML - // transactions. - // - // When `REPEATABLE_READ` is specified on a read-write transaction, the - // locking semantics default to `OPTIMISTIC`. - REPEATABLE_READ = 2; - } - - // Required. The type of transaction. - oneof mode { - // Transaction may write. - // - // Authorization to begin a read-write transaction requires - // `spanner.databases.beginOrRollbackReadWriteTransaction` permission - // on the `session` resource. - ReadWrite read_write = 1; - - // Partitioned DML transaction. - // - // Authorization to begin a Partitioned DML transaction requires - // `spanner.databases.beginPartitionedDmlTransaction` permission - // on the `session` resource. - PartitionedDml partitioned_dml = 3; - - // Transaction does not write. - // - // Authorization to begin a read-only transaction requires - // `spanner.databases.beginReadOnlyTransaction` permission - // on the `session` resource. - ReadOnly read_only = 2; - } - - // When `exclude_txn_from_change_streams` is set to `true`, it prevents read - // or write transactions from being tracked in change streams. - // - // * If the DDL option `allow_txn_exclusion` is set to `true`, then the - // updates - // made within this transaction aren't recorded in the change stream. - // - // * If you don't set the DDL option `allow_txn_exclusion` or if it's - // set to `false`, then the updates made within this transaction are - // recorded in the change stream. - // - // When `exclude_txn_from_change_streams` is set to `false` or not set, - // modifications from this transaction are recorded in all change streams - // that are tracking columns modified by these transactions. - // - // The `exclude_txn_from_change_streams` option can only be specified - // for read-write or partitioned DML transactions, otherwise the API returns - // an `INVALID_ARGUMENT` error. - bool exclude_txn_from_change_streams = 5; - - // Isolation level for the transaction. - IsolationLevel isolation_level = 6; -} - -// A transaction. -message Transaction { - // `id` may be used to identify the transaction in subsequent - // [Read][google.spanner.v1.Spanner.Read], - // [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql], - // [Commit][google.spanner.v1.Spanner.Commit], or - // [Rollback][google.spanner.v1.Spanner.Rollback] calls. - // - // Single-use read-only transactions do not have IDs, because - // single-use transactions do not support multiple requests. - bytes id = 1; - - // For snapshot read-only transactions, the read timestamp chosen - // for the transaction. Not returned by default: see - // [TransactionOptions.ReadOnly.return_read_timestamp][google.spanner.v1.TransactionOptions.ReadOnly.return_read_timestamp]. - // - // A timestamp in RFC3339 UTC \"Zulu\" format, accurate to nanoseconds. - // Example: `"2014-10-02T15:01:23.045123456Z"`. - google.protobuf.Timestamp read_timestamp = 2; - - // A precommit token is included in the response of a BeginTransaction - // request if the read-write transaction is on a multiplexed session and - // a mutation_key was specified in the - // [BeginTransaction][google.spanner.v1.BeginTransactionRequest]. - // The precommit token with the highest sequence number from this transaction - // attempt should be passed to the [Commit][google.spanner.v1.Spanner.Commit] - // request for this transaction. - MultiplexedSessionPrecommitToken precommit_token = 3; -} - -// This message is used to select the transaction in which a -// [Read][google.spanner.v1.Spanner.Read] or -// [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql] call runs. -// -// See [TransactionOptions][google.spanner.v1.TransactionOptions] for more -// information about transactions. -message TransactionSelector { - // If no fields are set, the default is a single use transaction - // with strong concurrency. - oneof selector { - // Execute the read or SQL query in a temporary transaction. - // This is the most efficient way to execute a transaction that - // consists of a single SQL query. - TransactionOptions single_use = 1; - - // Execute the read or SQL query in a previously-started transaction. - bytes id = 2; - - // Begin a new transaction and execute this read or SQL query in - // it. The transaction ID of the new transaction is returned in - // [ResultSetMetadata.transaction][google.spanner.v1.ResultSetMetadata.transaction], - // which is a [Transaction][google.spanner.v1.Transaction]. - TransactionOptions begin = 3; - } -} - -// When a read-write transaction is executed on a multiplexed session, -// this precommit token is sent back to the client -// as a part of the [Transaction][google.spanner.v1.Transaction] message in the -// [BeginTransaction][google.spanner.v1.BeginTransactionRequest] response and -// also as a part of the [ResultSet][google.spanner.v1.ResultSet] and -// [PartialResultSet][google.spanner.v1.PartialResultSet] responses. -message MultiplexedSessionPrecommitToken { - // Opaque precommit token. - bytes precommit_token = 1; - - // An incrementing seq number is generated on every precommit token - // that is returned. Clients should remember the precommit token with the - // highest sequence number from the current transaction attempt. - int32 seq_num = 2; -} diff --git a/owl-bot-staging/executor/v1/protos/google/spanner/v1/type.proto b/owl-bot-staging/executor/v1/protos/google/spanner/v1/type.proto deleted file mode 100644 index e3e85a770..000000000 --- a/owl-bot-staging/executor/v1/protos/google/spanner/v1/type.proto +++ /dev/null @@ -1,214 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.spanner.v1; - -import "google/api/field_behavior.proto"; - -option csharp_namespace = "Google.Cloud.Spanner.V1"; -option go_package = "cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb"; -option java_multiple_files = true; -option java_outer_classname = "TypeProto"; -option java_package = "com.google.spanner.v1"; -option php_namespace = "Google\\Cloud\\Spanner\\V1"; -option ruby_package = "Google::Cloud::Spanner::V1"; - -// `Type` indicates the type of a Cloud Spanner value, as might be stored in a -// table cell or returned from an SQL query. -message Type { - // Required. The [TypeCode][google.spanner.v1.TypeCode] for this type. - TypeCode code = 1 [(google.api.field_behavior) = REQUIRED]; - - // If [code][google.spanner.v1.Type.code] == - // [ARRAY][google.spanner.v1.TypeCode.ARRAY], then `array_element_type` is the - // type of the array elements. - Type array_element_type = 2; - - // If [code][google.spanner.v1.Type.code] == - // [STRUCT][google.spanner.v1.TypeCode.STRUCT], then `struct_type` provides - // type information for the struct's fields. - StructType struct_type = 3; - - // The [TypeAnnotationCode][google.spanner.v1.TypeAnnotationCode] that - // disambiguates SQL type that Spanner will use to represent values of this - // type during query processing. This is necessary for some type codes because - // a single [TypeCode][google.spanner.v1.TypeCode] can be mapped to different - // SQL types depending on the SQL dialect. - // [type_annotation][google.spanner.v1.Type.type_annotation] typically is not - // needed to process the content of a value (it doesn't affect serialization) - // and clients can ignore it on the read path. - TypeAnnotationCode type_annotation = 4; - - // If [code][google.spanner.v1.Type.code] == - // [PROTO][google.spanner.v1.TypeCode.PROTO] or - // [code][google.spanner.v1.Type.code] == - // [ENUM][google.spanner.v1.TypeCode.ENUM], then `proto_type_fqn` is the fully - // qualified name of the proto type representing the proto/enum definition. - string proto_type_fqn = 5; -} - -// `StructType` defines the fields of a -// [STRUCT][google.spanner.v1.TypeCode.STRUCT] type. -message StructType { - // Message representing a single field of a struct. - message Field { - // The name of the field. For reads, this is the column name. For - // SQL queries, it is the column alias (e.g., `"Word"` in the - // query `"SELECT 'hello' AS Word"`), or the column name (e.g., - // `"ColName"` in the query `"SELECT ColName FROM Table"`). Some - // columns might have an empty name (e.g., `"SELECT - // UPPER(ColName)"`). Note that a query result can contain - // multiple fields with the same name. - string name = 1; - - // The type of the field. - Type type = 2; - } - - // The list of fields that make up this struct. Order is - // significant, because values of this struct type are represented as - // lists, where the order of field values matches the order of - // fields in the [StructType][google.spanner.v1.StructType]. In turn, the - // order of fields matches the order of columns in a read request, or the - // order of fields in the `SELECT` clause of a query. - repeated Field fields = 1; -} - -// `TypeCode` is used as part of [Type][google.spanner.v1.Type] to -// indicate the type of a Cloud Spanner value. -// -// Each legal value of a type can be encoded to or decoded from a JSON -// value, using the encodings described below. All Cloud Spanner values can -// be `null`, regardless of type; `null`s are always encoded as a JSON -// `null`. -enum TypeCode { - // Not specified. - TYPE_CODE_UNSPECIFIED = 0; - - // Encoded as JSON `true` or `false`. - BOOL = 1; - - // Encoded as `string`, in decimal format. - INT64 = 2; - - // Encoded as `number`, or the strings `"NaN"`, `"Infinity"`, or - // `"-Infinity"`. - FLOAT64 = 3; - - // Encoded as `number`, or the strings `"NaN"`, `"Infinity"`, or - // `"-Infinity"`. - FLOAT32 = 15; - - // Encoded as `string` in RFC 3339 timestamp format. The time zone - // must be present, and must be `"Z"`. - // - // If the schema has the column option - // `allow_commit_timestamp=true`, the placeholder string - // `"spanner.commit_timestamp()"` can be used to instruct the system - // to insert the commit timestamp associated with the transaction - // commit. - TIMESTAMP = 4; - - // Encoded as `string` in RFC 3339 date format. - DATE = 5; - - // Encoded as `string`. - STRING = 6; - - // Encoded as a base64-encoded `string`, as described in RFC 4648, - // section 4. - BYTES = 7; - - // Encoded as `list`, where the list elements are represented - // according to - // [array_element_type][google.spanner.v1.Type.array_element_type]. - ARRAY = 8; - - // Encoded as `list`, where list element `i` is represented according - // to [struct_type.fields[i]][google.spanner.v1.StructType.fields]. - STRUCT = 9; - - // Encoded as `string`, in decimal format or scientific notation format. - // Decimal format: - // `[+-]Digits[.[Digits]]` or - // `[+-][Digits].Digits` - // - // Scientific notation: - // `[+-]Digits[.[Digits]][ExponentIndicator[+-]Digits]` or - // `[+-][Digits].Digits[ExponentIndicator[+-]Digits]` - // (ExponentIndicator is `"e"` or `"E"`) - NUMERIC = 10; - - // Encoded as a JSON-formatted `string` as described in RFC 7159. The - // following rules are applied when parsing JSON input: - // - // - Whitespace characters are not preserved. - // - If a JSON object has duplicate keys, only the first key is preserved. - // - Members of a JSON object are not guaranteed to have their order - // preserved. - // - JSON array elements will have their order preserved. - JSON = 11; - - // Encoded as a base64-encoded `string`, as described in RFC 4648, - // section 4. - PROTO = 13; - - // Encoded as `string`, in decimal format. - ENUM = 14; - - // Encoded as `string`, in `ISO8601` duration format - - // `P[n]Y[n]M[n]DT[n]H[n]M[n[.fraction]]S` - // where `n` is an integer. - // For example, `P1Y2M3DT4H5M6.5S` represents time duration of 1 year, 2 - // months, 3 days, 4 hours, 5 minutes, and 6.5 seconds. - INTERVAL = 16; - - // Encoded as `string`, in lower-case hexa-decimal format, as described - // in RFC 9562, section 4. - UUID = 17; -} - -// `TypeAnnotationCode` is used as a part of [Type][google.spanner.v1.Type] to -// disambiguate SQL types that should be used for a given Cloud Spanner value. -// Disambiguation is needed because the same Cloud Spanner type can be mapped to -// different SQL types depending on SQL dialect. TypeAnnotationCode doesn't -// affect the way value is serialized. -enum TypeAnnotationCode { - // Not specified. - TYPE_ANNOTATION_CODE_UNSPECIFIED = 0; - - // PostgreSQL compatible NUMERIC type. This annotation needs to be applied to - // [Type][google.spanner.v1.Type] instances having - // [NUMERIC][google.spanner.v1.TypeCode.NUMERIC] type code to specify that - // values of this type should be treated as PostgreSQL NUMERIC values. - // Currently this annotation is always needed for - // [NUMERIC][google.spanner.v1.TypeCode.NUMERIC] when a client interacts with - // PostgreSQL-enabled Spanner databases. - PG_NUMERIC = 2; - - // PostgreSQL compatible JSONB type. This annotation needs to be applied to - // [Type][google.spanner.v1.Type] instances having - // [JSON][google.spanner.v1.TypeCode.JSON] type code to specify that values of - // this type should be treated as PostgreSQL JSONB values. Currently this - // annotation is always needed for [JSON][google.spanner.v1.TypeCode.JSON] - // when a client interacts with PostgreSQL-enabled Spanner databases. - PG_JSONB = 3; - - // PostgreSQL compatible OID type. This annotation can be used by a client - // interacting with PostgreSQL-enabled Spanner database to specify that a - // value should be treated using the semantics of the OID type. - PG_OID = 4; -} diff --git a/owl-bot-staging/executor/v1/protos/protos.d.ts b/owl-bot-staging/executor/v1/protos/protos.d.ts deleted file mode 100644 index c9f7706e2..000000000 --- a/owl-bot-staging/executor/v1/protos/protos.d.ts +++ /dev/null @@ -1,40265 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -import type {protobuf as $protobuf} from "google-gax"; -import Long = require("long"); -/** Namespace google. */ -export namespace google { - - /** Namespace spanner. */ - namespace spanner { - - /** Namespace admin. */ - namespace admin { - - /** Namespace database. */ - namespace database { - - /** Namespace v1. */ - namespace v1 { - - /** Properties of a Backup. */ - interface IBackup { - - /** Backup database */ - database?: (string|null); - - /** Backup versionTime */ - versionTime?: (google.protobuf.ITimestamp|null); - - /** Backup expireTime */ - expireTime?: (google.protobuf.ITimestamp|null); - - /** Backup name */ - name?: (string|null); - - /** Backup createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** Backup sizeBytes */ - sizeBytes?: (number|Long|string|null); - - /** Backup freeableSizeBytes */ - freeableSizeBytes?: (number|Long|string|null); - - /** Backup exclusiveSizeBytes */ - exclusiveSizeBytes?: (number|Long|string|null); - - /** Backup state */ - state?: (google.spanner.admin.database.v1.Backup.State|keyof typeof google.spanner.admin.database.v1.Backup.State|null); - - /** Backup referencingDatabases */ - referencingDatabases?: (string[]|null); - - /** Backup encryptionInfo */ - encryptionInfo?: (google.spanner.admin.database.v1.IEncryptionInfo|null); - - /** Backup encryptionInformation */ - encryptionInformation?: (google.spanner.admin.database.v1.IEncryptionInfo[]|null); - - /** Backup databaseDialect */ - databaseDialect?: (google.spanner.admin.database.v1.DatabaseDialect|keyof typeof google.spanner.admin.database.v1.DatabaseDialect|null); - - /** Backup referencingBackups */ - referencingBackups?: (string[]|null); - - /** Backup maxExpireTime */ - maxExpireTime?: (google.protobuf.ITimestamp|null); - - /** Backup backupSchedules */ - backupSchedules?: (string[]|null); - - /** Backup incrementalBackupChainId */ - incrementalBackupChainId?: (string|null); - - /** Backup oldestVersionTime */ - oldestVersionTime?: (google.protobuf.ITimestamp|null); - - /** Backup instancePartitions */ - instancePartitions?: (google.spanner.admin.database.v1.IBackupInstancePartition[]|null); - } - - /** Represents a Backup. */ - class Backup implements IBackup { - - /** - * Constructs a new Backup. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IBackup); - - /** Backup database. */ - public database: string; - - /** Backup versionTime. */ - public versionTime?: (google.protobuf.ITimestamp|null); - - /** Backup expireTime. */ - public expireTime?: (google.protobuf.ITimestamp|null); - - /** Backup name. */ - public name: string; - - /** Backup createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** Backup sizeBytes. */ - public sizeBytes: (number|Long|string); - - /** Backup freeableSizeBytes. */ - public freeableSizeBytes: (number|Long|string); - - /** Backup exclusiveSizeBytes. */ - public exclusiveSizeBytes: (number|Long|string); - - /** Backup state. */ - public state: (google.spanner.admin.database.v1.Backup.State|keyof typeof google.spanner.admin.database.v1.Backup.State); - - /** Backup referencingDatabases. */ - public referencingDatabases: string[]; - - /** Backup encryptionInfo. */ - public encryptionInfo?: (google.spanner.admin.database.v1.IEncryptionInfo|null); - - /** Backup encryptionInformation. */ - public encryptionInformation: google.spanner.admin.database.v1.IEncryptionInfo[]; - - /** Backup databaseDialect. */ - public databaseDialect: (google.spanner.admin.database.v1.DatabaseDialect|keyof typeof google.spanner.admin.database.v1.DatabaseDialect); - - /** Backup referencingBackups. */ - public referencingBackups: string[]; - - /** Backup maxExpireTime. */ - public maxExpireTime?: (google.protobuf.ITimestamp|null); - - /** Backup backupSchedules. */ - public backupSchedules: string[]; - - /** Backup incrementalBackupChainId. */ - public incrementalBackupChainId: string; - - /** Backup oldestVersionTime. */ - public oldestVersionTime?: (google.protobuf.ITimestamp|null); - - /** Backup instancePartitions. */ - public instancePartitions: google.spanner.admin.database.v1.IBackupInstancePartition[]; - - /** - * Creates a new Backup instance using the specified properties. - * @param [properties] Properties to set - * @returns Backup instance - */ - public static create(properties?: google.spanner.admin.database.v1.IBackup): google.spanner.admin.database.v1.Backup; - - /** - * Encodes the specified Backup message. Does not implicitly {@link google.spanner.admin.database.v1.Backup.verify|verify} messages. - * @param message Backup message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IBackup, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Backup message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.Backup.verify|verify} messages. - * @param message Backup message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IBackup, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Backup message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Backup - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.Backup; - - /** - * Decodes a Backup message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Backup - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.Backup; - - /** - * Verifies a Backup message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Backup message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Backup - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.Backup; - - /** - * Creates a plain object from a Backup message. Also converts values to other types if specified. - * @param message Backup - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.Backup, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Backup to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Backup - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Backup { - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - CREATING = 1, - READY = 2 - } - } - - /** Properties of a CreateBackupRequest. */ - interface ICreateBackupRequest { - - /** CreateBackupRequest parent */ - parent?: (string|null); - - /** CreateBackupRequest backupId */ - backupId?: (string|null); - - /** CreateBackupRequest backup */ - backup?: (google.spanner.admin.database.v1.IBackup|null); - - /** CreateBackupRequest encryptionConfig */ - encryptionConfig?: (google.spanner.admin.database.v1.ICreateBackupEncryptionConfig|null); - } - - /** Represents a CreateBackupRequest. */ - class CreateBackupRequest implements ICreateBackupRequest { - - /** - * Constructs a new CreateBackupRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.ICreateBackupRequest); - - /** CreateBackupRequest parent. */ - public parent: string; - - /** CreateBackupRequest backupId. */ - public backupId: string; - - /** CreateBackupRequest backup. */ - public backup?: (google.spanner.admin.database.v1.IBackup|null); - - /** CreateBackupRequest encryptionConfig. */ - public encryptionConfig?: (google.spanner.admin.database.v1.ICreateBackupEncryptionConfig|null); - - /** - * Creates a new CreateBackupRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateBackupRequest instance - */ - public static create(properties?: google.spanner.admin.database.v1.ICreateBackupRequest): google.spanner.admin.database.v1.CreateBackupRequest; - - /** - * Encodes the specified CreateBackupRequest message. Does not implicitly {@link google.spanner.admin.database.v1.CreateBackupRequest.verify|verify} messages. - * @param message CreateBackupRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.ICreateBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateBackupRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.CreateBackupRequest.verify|verify} messages. - * @param message CreateBackupRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.ICreateBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateBackupRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.CreateBackupRequest; - - /** - * Decodes a CreateBackupRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.CreateBackupRequest; - - /** - * Verifies a CreateBackupRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateBackupRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateBackupRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.CreateBackupRequest; - - /** - * Creates a plain object from a CreateBackupRequest message. Also converts values to other types if specified. - * @param message CreateBackupRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.CreateBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateBackupRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateBackupRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateBackupMetadata. */ - interface ICreateBackupMetadata { - - /** CreateBackupMetadata name */ - name?: (string|null); - - /** CreateBackupMetadata database */ - database?: (string|null); - - /** CreateBackupMetadata progress */ - progress?: (google.spanner.admin.database.v1.IOperationProgress|null); - - /** CreateBackupMetadata cancelTime */ - cancelTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a CreateBackupMetadata. */ - class CreateBackupMetadata implements ICreateBackupMetadata { - - /** - * Constructs a new CreateBackupMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.ICreateBackupMetadata); - - /** CreateBackupMetadata name. */ - public name: string; - - /** CreateBackupMetadata database. */ - public database: string; - - /** CreateBackupMetadata progress. */ - public progress?: (google.spanner.admin.database.v1.IOperationProgress|null); - - /** CreateBackupMetadata cancelTime. */ - public cancelTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new CreateBackupMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateBackupMetadata instance - */ - public static create(properties?: google.spanner.admin.database.v1.ICreateBackupMetadata): google.spanner.admin.database.v1.CreateBackupMetadata; - - /** - * Encodes the specified CreateBackupMetadata message. Does not implicitly {@link google.spanner.admin.database.v1.CreateBackupMetadata.verify|verify} messages. - * @param message CreateBackupMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.ICreateBackupMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateBackupMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.CreateBackupMetadata.verify|verify} messages. - * @param message CreateBackupMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.ICreateBackupMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateBackupMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateBackupMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.CreateBackupMetadata; - - /** - * Decodes a CreateBackupMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateBackupMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.CreateBackupMetadata; - - /** - * Verifies a CreateBackupMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateBackupMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateBackupMetadata - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.CreateBackupMetadata; - - /** - * Creates a plain object from a CreateBackupMetadata message. Also converts values to other types if specified. - * @param message CreateBackupMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.CreateBackupMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateBackupMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateBackupMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CopyBackupRequest. */ - interface ICopyBackupRequest { - - /** CopyBackupRequest parent */ - parent?: (string|null); - - /** CopyBackupRequest backupId */ - backupId?: (string|null); - - /** CopyBackupRequest sourceBackup */ - sourceBackup?: (string|null); - - /** CopyBackupRequest expireTime */ - expireTime?: (google.protobuf.ITimestamp|null); - - /** CopyBackupRequest encryptionConfig */ - encryptionConfig?: (google.spanner.admin.database.v1.ICopyBackupEncryptionConfig|null); - } - - /** Represents a CopyBackupRequest. */ - class CopyBackupRequest implements ICopyBackupRequest { - - /** - * Constructs a new CopyBackupRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.ICopyBackupRequest); - - /** CopyBackupRequest parent. */ - public parent: string; - - /** CopyBackupRequest backupId. */ - public backupId: string; - - /** CopyBackupRequest sourceBackup. */ - public sourceBackup: string; - - /** CopyBackupRequest expireTime. */ - public expireTime?: (google.protobuf.ITimestamp|null); - - /** CopyBackupRequest encryptionConfig. */ - public encryptionConfig?: (google.spanner.admin.database.v1.ICopyBackupEncryptionConfig|null); - - /** - * Creates a new CopyBackupRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CopyBackupRequest instance - */ - public static create(properties?: google.spanner.admin.database.v1.ICopyBackupRequest): google.spanner.admin.database.v1.CopyBackupRequest; - - /** - * Encodes the specified CopyBackupRequest message. Does not implicitly {@link google.spanner.admin.database.v1.CopyBackupRequest.verify|verify} messages. - * @param message CopyBackupRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.ICopyBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CopyBackupRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.CopyBackupRequest.verify|verify} messages. - * @param message CopyBackupRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.ICopyBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CopyBackupRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CopyBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.CopyBackupRequest; - - /** - * Decodes a CopyBackupRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CopyBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.CopyBackupRequest; - - /** - * Verifies a CopyBackupRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CopyBackupRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CopyBackupRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.CopyBackupRequest; - - /** - * Creates a plain object from a CopyBackupRequest message. Also converts values to other types if specified. - * @param message CopyBackupRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.CopyBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CopyBackupRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CopyBackupRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CopyBackupMetadata. */ - interface ICopyBackupMetadata { - - /** CopyBackupMetadata name */ - name?: (string|null); - - /** CopyBackupMetadata sourceBackup */ - sourceBackup?: (string|null); - - /** CopyBackupMetadata progress */ - progress?: (google.spanner.admin.database.v1.IOperationProgress|null); - - /** CopyBackupMetadata cancelTime */ - cancelTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a CopyBackupMetadata. */ - class CopyBackupMetadata implements ICopyBackupMetadata { - - /** - * Constructs a new CopyBackupMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.ICopyBackupMetadata); - - /** CopyBackupMetadata name. */ - public name: string; - - /** CopyBackupMetadata sourceBackup. */ - public sourceBackup: string; - - /** CopyBackupMetadata progress. */ - public progress?: (google.spanner.admin.database.v1.IOperationProgress|null); - - /** CopyBackupMetadata cancelTime. */ - public cancelTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new CopyBackupMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns CopyBackupMetadata instance - */ - public static create(properties?: google.spanner.admin.database.v1.ICopyBackupMetadata): google.spanner.admin.database.v1.CopyBackupMetadata; - - /** - * Encodes the specified CopyBackupMetadata message. Does not implicitly {@link google.spanner.admin.database.v1.CopyBackupMetadata.verify|verify} messages. - * @param message CopyBackupMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.ICopyBackupMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CopyBackupMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.CopyBackupMetadata.verify|verify} messages. - * @param message CopyBackupMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.ICopyBackupMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CopyBackupMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CopyBackupMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.CopyBackupMetadata; - - /** - * Decodes a CopyBackupMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CopyBackupMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.CopyBackupMetadata; - - /** - * Verifies a CopyBackupMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CopyBackupMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CopyBackupMetadata - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.CopyBackupMetadata; - - /** - * Creates a plain object from a CopyBackupMetadata message. Also converts values to other types if specified. - * @param message CopyBackupMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.CopyBackupMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CopyBackupMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CopyBackupMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateBackupRequest. */ - interface IUpdateBackupRequest { - - /** UpdateBackupRequest backup */ - backup?: (google.spanner.admin.database.v1.IBackup|null); - - /** UpdateBackupRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - } - - /** Represents an UpdateBackupRequest. */ - class UpdateBackupRequest implements IUpdateBackupRequest { - - /** - * Constructs a new UpdateBackupRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IUpdateBackupRequest); - - /** UpdateBackupRequest backup. */ - public backup?: (google.spanner.admin.database.v1.IBackup|null); - - /** UpdateBackupRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** - * Creates a new UpdateBackupRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateBackupRequest instance - */ - public static create(properties?: google.spanner.admin.database.v1.IUpdateBackupRequest): google.spanner.admin.database.v1.UpdateBackupRequest; - - /** - * Encodes the specified UpdateBackupRequest message. Does not implicitly {@link google.spanner.admin.database.v1.UpdateBackupRequest.verify|verify} messages. - * @param message UpdateBackupRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IUpdateBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateBackupRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.UpdateBackupRequest.verify|verify} messages. - * @param message UpdateBackupRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IUpdateBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateBackupRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.UpdateBackupRequest; - - /** - * Decodes an UpdateBackupRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.UpdateBackupRequest; - - /** - * Verifies an UpdateBackupRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UpdateBackupRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateBackupRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.UpdateBackupRequest; - - /** - * Creates a plain object from an UpdateBackupRequest message. Also converts values to other types if specified. - * @param message UpdateBackupRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.UpdateBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateBackupRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateBackupRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetBackupRequest. */ - interface IGetBackupRequest { - - /** GetBackupRequest name */ - name?: (string|null); - } - - /** Represents a GetBackupRequest. */ - class GetBackupRequest implements IGetBackupRequest { - - /** - * Constructs a new GetBackupRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IGetBackupRequest); - - /** GetBackupRequest name. */ - public name: string; - - /** - * Creates a new GetBackupRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetBackupRequest instance - */ - public static create(properties?: google.spanner.admin.database.v1.IGetBackupRequest): google.spanner.admin.database.v1.GetBackupRequest; - - /** - * Encodes the specified GetBackupRequest message. Does not implicitly {@link google.spanner.admin.database.v1.GetBackupRequest.verify|verify} messages. - * @param message GetBackupRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IGetBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetBackupRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.GetBackupRequest.verify|verify} messages. - * @param message GetBackupRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IGetBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetBackupRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.GetBackupRequest; - - /** - * Decodes a GetBackupRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.GetBackupRequest; - - /** - * Verifies a GetBackupRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetBackupRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetBackupRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.GetBackupRequest; - - /** - * Creates a plain object from a GetBackupRequest message. Also converts values to other types if specified. - * @param message GetBackupRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.GetBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetBackupRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetBackupRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteBackupRequest. */ - interface IDeleteBackupRequest { - - /** DeleteBackupRequest name */ - name?: (string|null); - } - - /** Represents a DeleteBackupRequest. */ - class DeleteBackupRequest implements IDeleteBackupRequest { - - /** - * Constructs a new DeleteBackupRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IDeleteBackupRequest); - - /** DeleteBackupRequest name. */ - public name: string; - - /** - * Creates a new DeleteBackupRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteBackupRequest instance - */ - public static create(properties?: google.spanner.admin.database.v1.IDeleteBackupRequest): google.spanner.admin.database.v1.DeleteBackupRequest; - - /** - * Encodes the specified DeleteBackupRequest message. Does not implicitly {@link google.spanner.admin.database.v1.DeleteBackupRequest.verify|verify} messages. - * @param message DeleteBackupRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IDeleteBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteBackupRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.DeleteBackupRequest.verify|verify} messages. - * @param message DeleteBackupRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IDeleteBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteBackupRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.DeleteBackupRequest; - - /** - * Decodes a DeleteBackupRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.DeleteBackupRequest; - - /** - * Verifies a DeleteBackupRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteBackupRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteBackupRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.DeleteBackupRequest; - - /** - * Creates a plain object from a DeleteBackupRequest message. Also converts values to other types if specified. - * @param message DeleteBackupRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.DeleteBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteBackupRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteBackupRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListBackupsRequest. */ - interface IListBackupsRequest { - - /** ListBackupsRequest parent */ - parent?: (string|null); - - /** ListBackupsRequest filter */ - filter?: (string|null); - - /** ListBackupsRequest pageSize */ - pageSize?: (number|null); - - /** ListBackupsRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListBackupsRequest. */ - class ListBackupsRequest implements IListBackupsRequest { - - /** - * Constructs a new ListBackupsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IListBackupsRequest); - - /** ListBackupsRequest parent. */ - public parent: string; - - /** ListBackupsRequest filter. */ - public filter: string; - - /** ListBackupsRequest pageSize. */ - public pageSize: number; - - /** ListBackupsRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListBackupsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListBackupsRequest instance - */ - public static create(properties?: google.spanner.admin.database.v1.IListBackupsRequest): google.spanner.admin.database.v1.ListBackupsRequest; - - /** - * Encodes the specified ListBackupsRequest message. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupsRequest.verify|verify} messages. - * @param message ListBackupsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IListBackupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListBackupsRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupsRequest.verify|verify} messages. - * @param message ListBackupsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IListBackupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListBackupsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListBackupsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.ListBackupsRequest; - - /** - * Decodes a ListBackupsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListBackupsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.ListBackupsRequest; - - /** - * Verifies a ListBackupsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListBackupsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListBackupsRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.ListBackupsRequest; - - /** - * Creates a plain object from a ListBackupsRequest message. Also converts values to other types if specified. - * @param message ListBackupsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.ListBackupsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListBackupsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListBackupsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListBackupsResponse. */ - interface IListBackupsResponse { - - /** ListBackupsResponse backups */ - backups?: (google.spanner.admin.database.v1.IBackup[]|null); - - /** ListBackupsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListBackupsResponse. */ - class ListBackupsResponse implements IListBackupsResponse { - - /** - * Constructs a new ListBackupsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IListBackupsResponse); - - /** ListBackupsResponse backups. */ - public backups: google.spanner.admin.database.v1.IBackup[]; - - /** ListBackupsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListBackupsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListBackupsResponse instance - */ - public static create(properties?: google.spanner.admin.database.v1.IListBackupsResponse): google.spanner.admin.database.v1.ListBackupsResponse; - - /** - * Encodes the specified ListBackupsResponse message. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupsResponse.verify|verify} messages. - * @param message ListBackupsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IListBackupsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListBackupsResponse message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupsResponse.verify|verify} messages. - * @param message ListBackupsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IListBackupsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListBackupsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListBackupsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.ListBackupsResponse; - - /** - * Decodes a ListBackupsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListBackupsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.ListBackupsResponse; - - /** - * Verifies a ListBackupsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListBackupsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListBackupsResponse - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.ListBackupsResponse; - - /** - * Creates a plain object from a ListBackupsResponse message. Also converts values to other types if specified. - * @param message ListBackupsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.ListBackupsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListBackupsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListBackupsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListBackupOperationsRequest. */ - interface IListBackupOperationsRequest { - - /** ListBackupOperationsRequest parent */ - parent?: (string|null); - - /** ListBackupOperationsRequest filter */ - filter?: (string|null); - - /** ListBackupOperationsRequest pageSize */ - pageSize?: (number|null); - - /** ListBackupOperationsRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListBackupOperationsRequest. */ - class ListBackupOperationsRequest implements IListBackupOperationsRequest { - - /** - * Constructs a new ListBackupOperationsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IListBackupOperationsRequest); - - /** ListBackupOperationsRequest parent. */ - public parent: string; - - /** ListBackupOperationsRequest filter. */ - public filter: string; - - /** ListBackupOperationsRequest pageSize. */ - public pageSize: number; - - /** ListBackupOperationsRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListBackupOperationsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListBackupOperationsRequest instance - */ - public static create(properties?: google.spanner.admin.database.v1.IListBackupOperationsRequest): google.spanner.admin.database.v1.ListBackupOperationsRequest; - - /** - * Encodes the specified ListBackupOperationsRequest message. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupOperationsRequest.verify|verify} messages. - * @param message ListBackupOperationsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IListBackupOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListBackupOperationsRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupOperationsRequest.verify|verify} messages. - * @param message ListBackupOperationsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IListBackupOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListBackupOperationsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListBackupOperationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.ListBackupOperationsRequest; - - /** - * Decodes a ListBackupOperationsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListBackupOperationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.ListBackupOperationsRequest; - - /** - * Verifies a ListBackupOperationsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListBackupOperationsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListBackupOperationsRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.ListBackupOperationsRequest; - - /** - * Creates a plain object from a ListBackupOperationsRequest message. Also converts values to other types if specified. - * @param message ListBackupOperationsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.ListBackupOperationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListBackupOperationsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListBackupOperationsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListBackupOperationsResponse. */ - interface IListBackupOperationsResponse { - - /** ListBackupOperationsResponse operations */ - operations?: (google.longrunning.IOperation[]|null); - - /** ListBackupOperationsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListBackupOperationsResponse. */ - class ListBackupOperationsResponse implements IListBackupOperationsResponse { - - /** - * Constructs a new ListBackupOperationsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IListBackupOperationsResponse); - - /** ListBackupOperationsResponse operations. */ - public operations: google.longrunning.IOperation[]; - - /** ListBackupOperationsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListBackupOperationsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListBackupOperationsResponse instance - */ - public static create(properties?: google.spanner.admin.database.v1.IListBackupOperationsResponse): google.spanner.admin.database.v1.ListBackupOperationsResponse; - - /** - * Encodes the specified ListBackupOperationsResponse message. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupOperationsResponse.verify|verify} messages. - * @param message ListBackupOperationsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IListBackupOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListBackupOperationsResponse message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupOperationsResponse.verify|verify} messages. - * @param message ListBackupOperationsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IListBackupOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListBackupOperationsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListBackupOperationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.ListBackupOperationsResponse; - - /** - * Decodes a ListBackupOperationsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListBackupOperationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.ListBackupOperationsResponse; - - /** - * Verifies a ListBackupOperationsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListBackupOperationsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListBackupOperationsResponse - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.ListBackupOperationsResponse; - - /** - * Creates a plain object from a ListBackupOperationsResponse message. Also converts values to other types if specified. - * @param message ListBackupOperationsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.ListBackupOperationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListBackupOperationsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListBackupOperationsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BackupInfo. */ - interface IBackupInfo { - - /** BackupInfo backup */ - backup?: (string|null); - - /** BackupInfo versionTime */ - versionTime?: (google.protobuf.ITimestamp|null); - - /** BackupInfo createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** BackupInfo sourceDatabase */ - sourceDatabase?: (string|null); - } - - /** Represents a BackupInfo. */ - class BackupInfo implements IBackupInfo { - - /** - * Constructs a new BackupInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IBackupInfo); - - /** BackupInfo backup. */ - public backup: string; - - /** BackupInfo versionTime. */ - public versionTime?: (google.protobuf.ITimestamp|null); - - /** BackupInfo createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** BackupInfo sourceDatabase. */ - public sourceDatabase: string; - - /** - * Creates a new BackupInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns BackupInfo instance - */ - public static create(properties?: google.spanner.admin.database.v1.IBackupInfo): google.spanner.admin.database.v1.BackupInfo; - - /** - * Encodes the specified BackupInfo message. Does not implicitly {@link google.spanner.admin.database.v1.BackupInfo.verify|verify} messages. - * @param message BackupInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IBackupInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BackupInfo message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.BackupInfo.verify|verify} messages. - * @param message BackupInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IBackupInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BackupInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BackupInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.BackupInfo; - - /** - * Decodes a BackupInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BackupInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.BackupInfo; - - /** - * Verifies a BackupInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BackupInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BackupInfo - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.BackupInfo; - - /** - * Creates a plain object from a BackupInfo message. Also converts values to other types if specified. - * @param message BackupInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.BackupInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BackupInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BackupInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateBackupEncryptionConfig. */ - interface ICreateBackupEncryptionConfig { - - /** CreateBackupEncryptionConfig encryptionType */ - encryptionType?: (google.spanner.admin.database.v1.CreateBackupEncryptionConfig.EncryptionType|keyof typeof google.spanner.admin.database.v1.CreateBackupEncryptionConfig.EncryptionType|null); - - /** CreateBackupEncryptionConfig kmsKeyName */ - kmsKeyName?: (string|null); - - /** CreateBackupEncryptionConfig kmsKeyNames */ - kmsKeyNames?: (string[]|null); - } - - /** Represents a CreateBackupEncryptionConfig. */ - class CreateBackupEncryptionConfig implements ICreateBackupEncryptionConfig { - - /** - * Constructs a new CreateBackupEncryptionConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.ICreateBackupEncryptionConfig); - - /** CreateBackupEncryptionConfig encryptionType. */ - public encryptionType: (google.spanner.admin.database.v1.CreateBackupEncryptionConfig.EncryptionType|keyof typeof google.spanner.admin.database.v1.CreateBackupEncryptionConfig.EncryptionType); - - /** CreateBackupEncryptionConfig kmsKeyName. */ - public kmsKeyName: string; - - /** CreateBackupEncryptionConfig kmsKeyNames. */ - public kmsKeyNames: string[]; - - /** - * Creates a new CreateBackupEncryptionConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateBackupEncryptionConfig instance - */ - public static create(properties?: google.spanner.admin.database.v1.ICreateBackupEncryptionConfig): google.spanner.admin.database.v1.CreateBackupEncryptionConfig; - - /** - * Encodes the specified CreateBackupEncryptionConfig message. Does not implicitly {@link google.spanner.admin.database.v1.CreateBackupEncryptionConfig.verify|verify} messages. - * @param message CreateBackupEncryptionConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.ICreateBackupEncryptionConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateBackupEncryptionConfig message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.CreateBackupEncryptionConfig.verify|verify} messages. - * @param message CreateBackupEncryptionConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.ICreateBackupEncryptionConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateBackupEncryptionConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateBackupEncryptionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.CreateBackupEncryptionConfig; - - /** - * Decodes a CreateBackupEncryptionConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateBackupEncryptionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.CreateBackupEncryptionConfig; - - /** - * Verifies a CreateBackupEncryptionConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateBackupEncryptionConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateBackupEncryptionConfig - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.CreateBackupEncryptionConfig; - - /** - * Creates a plain object from a CreateBackupEncryptionConfig message. Also converts values to other types if specified. - * @param message CreateBackupEncryptionConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.CreateBackupEncryptionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateBackupEncryptionConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateBackupEncryptionConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace CreateBackupEncryptionConfig { - - /** EncryptionType enum. */ - enum EncryptionType { - ENCRYPTION_TYPE_UNSPECIFIED = 0, - USE_DATABASE_ENCRYPTION = 1, - GOOGLE_DEFAULT_ENCRYPTION = 2, - CUSTOMER_MANAGED_ENCRYPTION = 3 - } - } - - /** Properties of a CopyBackupEncryptionConfig. */ - interface ICopyBackupEncryptionConfig { - - /** CopyBackupEncryptionConfig encryptionType */ - encryptionType?: (google.spanner.admin.database.v1.CopyBackupEncryptionConfig.EncryptionType|keyof typeof google.spanner.admin.database.v1.CopyBackupEncryptionConfig.EncryptionType|null); - - /** CopyBackupEncryptionConfig kmsKeyName */ - kmsKeyName?: (string|null); - - /** CopyBackupEncryptionConfig kmsKeyNames */ - kmsKeyNames?: (string[]|null); - } - - /** Represents a CopyBackupEncryptionConfig. */ - class CopyBackupEncryptionConfig implements ICopyBackupEncryptionConfig { - - /** - * Constructs a new CopyBackupEncryptionConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.ICopyBackupEncryptionConfig); - - /** CopyBackupEncryptionConfig encryptionType. */ - public encryptionType: (google.spanner.admin.database.v1.CopyBackupEncryptionConfig.EncryptionType|keyof typeof google.spanner.admin.database.v1.CopyBackupEncryptionConfig.EncryptionType); - - /** CopyBackupEncryptionConfig kmsKeyName. */ - public kmsKeyName: string; - - /** CopyBackupEncryptionConfig kmsKeyNames. */ - public kmsKeyNames: string[]; - - /** - * Creates a new CopyBackupEncryptionConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns CopyBackupEncryptionConfig instance - */ - public static create(properties?: google.spanner.admin.database.v1.ICopyBackupEncryptionConfig): google.spanner.admin.database.v1.CopyBackupEncryptionConfig; - - /** - * Encodes the specified CopyBackupEncryptionConfig message. Does not implicitly {@link google.spanner.admin.database.v1.CopyBackupEncryptionConfig.verify|verify} messages. - * @param message CopyBackupEncryptionConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.ICopyBackupEncryptionConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CopyBackupEncryptionConfig message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.CopyBackupEncryptionConfig.verify|verify} messages. - * @param message CopyBackupEncryptionConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.ICopyBackupEncryptionConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CopyBackupEncryptionConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CopyBackupEncryptionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.CopyBackupEncryptionConfig; - - /** - * Decodes a CopyBackupEncryptionConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CopyBackupEncryptionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.CopyBackupEncryptionConfig; - - /** - * Verifies a CopyBackupEncryptionConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CopyBackupEncryptionConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CopyBackupEncryptionConfig - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.CopyBackupEncryptionConfig; - - /** - * Creates a plain object from a CopyBackupEncryptionConfig message. Also converts values to other types if specified. - * @param message CopyBackupEncryptionConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.CopyBackupEncryptionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CopyBackupEncryptionConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CopyBackupEncryptionConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace CopyBackupEncryptionConfig { - - /** EncryptionType enum. */ - enum EncryptionType { - ENCRYPTION_TYPE_UNSPECIFIED = 0, - USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION = 1, - GOOGLE_DEFAULT_ENCRYPTION = 2, - CUSTOMER_MANAGED_ENCRYPTION = 3 - } - } - - /** Properties of a FullBackupSpec. */ - interface IFullBackupSpec { - } - - /** Represents a FullBackupSpec. */ - class FullBackupSpec implements IFullBackupSpec { - - /** - * Constructs a new FullBackupSpec. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IFullBackupSpec); - - /** - * Creates a new FullBackupSpec instance using the specified properties. - * @param [properties] Properties to set - * @returns FullBackupSpec instance - */ - public static create(properties?: google.spanner.admin.database.v1.IFullBackupSpec): google.spanner.admin.database.v1.FullBackupSpec; - - /** - * Encodes the specified FullBackupSpec message. Does not implicitly {@link google.spanner.admin.database.v1.FullBackupSpec.verify|verify} messages. - * @param message FullBackupSpec message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IFullBackupSpec, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FullBackupSpec message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.FullBackupSpec.verify|verify} messages. - * @param message FullBackupSpec message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IFullBackupSpec, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FullBackupSpec message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FullBackupSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.FullBackupSpec; - - /** - * Decodes a FullBackupSpec message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FullBackupSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.FullBackupSpec; - - /** - * Verifies a FullBackupSpec message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FullBackupSpec message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FullBackupSpec - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.FullBackupSpec; - - /** - * Creates a plain object from a FullBackupSpec message. Also converts values to other types if specified. - * @param message FullBackupSpec - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.FullBackupSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FullBackupSpec to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FullBackupSpec - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an IncrementalBackupSpec. */ - interface IIncrementalBackupSpec { - } - - /** Represents an IncrementalBackupSpec. */ - class IncrementalBackupSpec implements IIncrementalBackupSpec { - - /** - * Constructs a new IncrementalBackupSpec. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IIncrementalBackupSpec); - - /** - * Creates a new IncrementalBackupSpec instance using the specified properties. - * @param [properties] Properties to set - * @returns IncrementalBackupSpec instance - */ - public static create(properties?: google.spanner.admin.database.v1.IIncrementalBackupSpec): google.spanner.admin.database.v1.IncrementalBackupSpec; - - /** - * Encodes the specified IncrementalBackupSpec message. Does not implicitly {@link google.spanner.admin.database.v1.IncrementalBackupSpec.verify|verify} messages. - * @param message IncrementalBackupSpec message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IIncrementalBackupSpec, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified IncrementalBackupSpec message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.IncrementalBackupSpec.verify|verify} messages. - * @param message IncrementalBackupSpec message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IIncrementalBackupSpec, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an IncrementalBackupSpec message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns IncrementalBackupSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.IncrementalBackupSpec; - - /** - * Decodes an IncrementalBackupSpec message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns IncrementalBackupSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.IncrementalBackupSpec; - - /** - * Verifies an IncrementalBackupSpec message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an IncrementalBackupSpec message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns IncrementalBackupSpec - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.IncrementalBackupSpec; - - /** - * Creates a plain object from an IncrementalBackupSpec message. Also converts values to other types if specified. - * @param message IncrementalBackupSpec - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.IncrementalBackupSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this IncrementalBackupSpec to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for IncrementalBackupSpec - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BackupInstancePartition. */ - interface IBackupInstancePartition { - - /** BackupInstancePartition instancePartition */ - instancePartition?: (string|null); - } - - /** Represents a BackupInstancePartition. */ - class BackupInstancePartition implements IBackupInstancePartition { - - /** - * Constructs a new BackupInstancePartition. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IBackupInstancePartition); - - /** BackupInstancePartition instancePartition. */ - public instancePartition: string; - - /** - * Creates a new BackupInstancePartition instance using the specified properties. - * @param [properties] Properties to set - * @returns BackupInstancePartition instance - */ - public static create(properties?: google.spanner.admin.database.v1.IBackupInstancePartition): google.spanner.admin.database.v1.BackupInstancePartition; - - /** - * Encodes the specified BackupInstancePartition message. Does not implicitly {@link google.spanner.admin.database.v1.BackupInstancePartition.verify|verify} messages. - * @param message BackupInstancePartition message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IBackupInstancePartition, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BackupInstancePartition message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.BackupInstancePartition.verify|verify} messages. - * @param message BackupInstancePartition message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IBackupInstancePartition, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BackupInstancePartition message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BackupInstancePartition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.BackupInstancePartition; - - /** - * Decodes a BackupInstancePartition message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BackupInstancePartition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.BackupInstancePartition; - - /** - * Verifies a BackupInstancePartition message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BackupInstancePartition message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BackupInstancePartition - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.BackupInstancePartition; - - /** - * Creates a plain object from a BackupInstancePartition message. Also converts values to other types if specified. - * @param message BackupInstancePartition - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.BackupInstancePartition, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BackupInstancePartition to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BackupInstancePartition - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an OperationProgress. */ - interface IOperationProgress { - - /** OperationProgress progressPercent */ - progressPercent?: (number|null); - - /** OperationProgress startTime */ - startTime?: (google.protobuf.ITimestamp|null); - - /** OperationProgress endTime */ - endTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents an OperationProgress. */ - class OperationProgress implements IOperationProgress { - - /** - * Constructs a new OperationProgress. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IOperationProgress); - - /** OperationProgress progressPercent. */ - public progressPercent: number; - - /** OperationProgress startTime. */ - public startTime?: (google.protobuf.ITimestamp|null); - - /** OperationProgress endTime. */ - public endTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new OperationProgress instance using the specified properties. - * @param [properties] Properties to set - * @returns OperationProgress instance - */ - public static create(properties?: google.spanner.admin.database.v1.IOperationProgress): google.spanner.admin.database.v1.OperationProgress; - - /** - * Encodes the specified OperationProgress message. Does not implicitly {@link google.spanner.admin.database.v1.OperationProgress.verify|verify} messages. - * @param message OperationProgress message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IOperationProgress, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OperationProgress message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.OperationProgress.verify|verify} messages. - * @param message OperationProgress message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IOperationProgress, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OperationProgress message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OperationProgress - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.OperationProgress; - - /** - * Decodes an OperationProgress message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OperationProgress - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.OperationProgress; - - /** - * Verifies an OperationProgress message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an OperationProgress message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OperationProgress - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.OperationProgress; - - /** - * Creates a plain object from an OperationProgress message. Also converts values to other types if specified. - * @param message OperationProgress - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.OperationProgress, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OperationProgress to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for OperationProgress - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EncryptionConfig. */ - interface IEncryptionConfig { - - /** EncryptionConfig kmsKeyName */ - kmsKeyName?: (string|null); - - /** EncryptionConfig kmsKeyNames */ - kmsKeyNames?: (string[]|null); - } - - /** Represents an EncryptionConfig. */ - class EncryptionConfig implements IEncryptionConfig { - - /** - * Constructs a new EncryptionConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IEncryptionConfig); - - /** EncryptionConfig kmsKeyName. */ - public kmsKeyName: string; - - /** EncryptionConfig kmsKeyNames. */ - public kmsKeyNames: string[]; - - /** - * Creates a new EncryptionConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns EncryptionConfig instance - */ - public static create(properties?: google.spanner.admin.database.v1.IEncryptionConfig): google.spanner.admin.database.v1.EncryptionConfig; - - /** - * Encodes the specified EncryptionConfig message. Does not implicitly {@link google.spanner.admin.database.v1.EncryptionConfig.verify|verify} messages. - * @param message EncryptionConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IEncryptionConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EncryptionConfig message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.EncryptionConfig.verify|verify} messages. - * @param message EncryptionConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IEncryptionConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EncryptionConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EncryptionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.EncryptionConfig; - - /** - * Decodes an EncryptionConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EncryptionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.EncryptionConfig; - - /** - * Verifies an EncryptionConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EncryptionConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EncryptionConfig - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.EncryptionConfig; - - /** - * Creates a plain object from an EncryptionConfig message. Also converts values to other types if specified. - * @param message EncryptionConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.EncryptionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EncryptionConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EncryptionConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EncryptionInfo. */ - interface IEncryptionInfo { - - /** EncryptionInfo encryptionType */ - encryptionType?: (google.spanner.admin.database.v1.EncryptionInfo.Type|keyof typeof google.spanner.admin.database.v1.EncryptionInfo.Type|null); - - /** EncryptionInfo encryptionStatus */ - encryptionStatus?: (google.rpc.IStatus|null); - - /** EncryptionInfo kmsKeyVersion */ - kmsKeyVersion?: (string|null); - } - - /** Represents an EncryptionInfo. */ - class EncryptionInfo implements IEncryptionInfo { - - /** - * Constructs a new EncryptionInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IEncryptionInfo); - - /** EncryptionInfo encryptionType. */ - public encryptionType: (google.spanner.admin.database.v1.EncryptionInfo.Type|keyof typeof google.spanner.admin.database.v1.EncryptionInfo.Type); - - /** EncryptionInfo encryptionStatus. */ - public encryptionStatus?: (google.rpc.IStatus|null); - - /** EncryptionInfo kmsKeyVersion. */ - public kmsKeyVersion: string; - - /** - * Creates a new EncryptionInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns EncryptionInfo instance - */ - public static create(properties?: google.spanner.admin.database.v1.IEncryptionInfo): google.spanner.admin.database.v1.EncryptionInfo; - - /** - * Encodes the specified EncryptionInfo message. Does not implicitly {@link google.spanner.admin.database.v1.EncryptionInfo.verify|verify} messages. - * @param message EncryptionInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IEncryptionInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EncryptionInfo message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.EncryptionInfo.verify|verify} messages. - * @param message EncryptionInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IEncryptionInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EncryptionInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EncryptionInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.EncryptionInfo; - - /** - * Decodes an EncryptionInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EncryptionInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.EncryptionInfo; - - /** - * Verifies an EncryptionInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EncryptionInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EncryptionInfo - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.EncryptionInfo; - - /** - * Creates a plain object from an EncryptionInfo message. Also converts values to other types if specified. - * @param message EncryptionInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.EncryptionInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EncryptionInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EncryptionInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace EncryptionInfo { - - /** Type enum. */ - enum Type { - TYPE_UNSPECIFIED = 0, - GOOGLE_DEFAULT_ENCRYPTION = 1, - CUSTOMER_MANAGED_ENCRYPTION = 2 - } - } - - /** DatabaseDialect enum. */ - enum DatabaseDialect { - DATABASE_DIALECT_UNSPECIFIED = 0, - GOOGLE_STANDARD_SQL = 1, - POSTGRESQL = 2 - } - - /** Properties of a BackupScheduleSpec. */ - interface IBackupScheduleSpec { - - /** BackupScheduleSpec cronSpec */ - cronSpec?: (google.spanner.admin.database.v1.ICrontabSpec|null); - } - - /** Represents a BackupScheduleSpec. */ - class BackupScheduleSpec implements IBackupScheduleSpec { - - /** - * Constructs a new BackupScheduleSpec. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IBackupScheduleSpec); - - /** BackupScheduleSpec cronSpec. */ - public cronSpec?: (google.spanner.admin.database.v1.ICrontabSpec|null); - - /** BackupScheduleSpec scheduleSpec. */ - public scheduleSpec?: "cronSpec"; - - /** - * Creates a new BackupScheduleSpec instance using the specified properties. - * @param [properties] Properties to set - * @returns BackupScheduleSpec instance - */ - public static create(properties?: google.spanner.admin.database.v1.IBackupScheduleSpec): google.spanner.admin.database.v1.BackupScheduleSpec; - - /** - * Encodes the specified BackupScheduleSpec message. Does not implicitly {@link google.spanner.admin.database.v1.BackupScheduleSpec.verify|verify} messages. - * @param message BackupScheduleSpec message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IBackupScheduleSpec, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BackupScheduleSpec message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.BackupScheduleSpec.verify|verify} messages. - * @param message BackupScheduleSpec message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IBackupScheduleSpec, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BackupScheduleSpec message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BackupScheduleSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.BackupScheduleSpec; - - /** - * Decodes a BackupScheduleSpec message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BackupScheduleSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.BackupScheduleSpec; - - /** - * Verifies a BackupScheduleSpec message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BackupScheduleSpec message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BackupScheduleSpec - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.BackupScheduleSpec; - - /** - * Creates a plain object from a BackupScheduleSpec message. Also converts values to other types if specified. - * @param message BackupScheduleSpec - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.BackupScheduleSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BackupScheduleSpec to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BackupScheduleSpec - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BackupSchedule. */ - interface IBackupSchedule { - - /** BackupSchedule name */ - name?: (string|null); - - /** BackupSchedule spec */ - spec?: (google.spanner.admin.database.v1.IBackupScheduleSpec|null); - - /** BackupSchedule retentionDuration */ - retentionDuration?: (google.protobuf.IDuration|null); - - /** BackupSchedule encryptionConfig */ - encryptionConfig?: (google.spanner.admin.database.v1.ICreateBackupEncryptionConfig|null); - - /** BackupSchedule fullBackupSpec */ - fullBackupSpec?: (google.spanner.admin.database.v1.IFullBackupSpec|null); - - /** BackupSchedule incrementalBackupSpec */ - incrementalBackupSpec?: (google.spanner.admin.database.v1.IIncrementalBackupSpec|null); - - /** BackupSchedule updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a BackupSchedule. */ - class BackupSchedule implements IBackupSchedule { - - /** - * Constructs a new BackupSchedule. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IBackupSchedule); - - /** BackupSchedule name. */ - public name: string; - - /** BackupSchedule spec. */ - public spec?: (google.spanner.admin.database.v1.IBackupScheduleSpec|null); - - /** BackupSchedule retentionDuration. */ - public retentionDuration?: (google.protobuf.IDuration|null); - - /** BackupSchedule encryptionConfig. */ - public encryptionConfig?: (google.spanner.admin.database.v1.ICreateBackupEncryptionConfig|null); - - /** BackupSchedule fullBackupSpec. */ - public fullBackupSpec?: (google.spanner.admin.database.v1.IFullBackupSpec|null); - - /** BackupSchedule incrementalBackupSpec. */ - public incrementalBackupSpec?: (google.spanner.admin.database.v1.IIncrementalBackupSpec|null); - - /** BackupSchedule updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** BackupSchedule backupTypeSpec. */ - public backupTypeSpec?: ("fullBackupSpec"|"incrementalBackupSpec"); - - /** - * Creates a new BackupSchedule instance using the specified properties. - * @param [properties] Properties to set - * @returns BackupSchedule instance - */ - public static create(properties?: google.spanner.admin.database.v1.IBackupSchedule): google.spanner.admin.database.v1.BackupSchedule; - - /** - * Encodes the specified BackupSchedule message. Does not implicitly {@link google.spanner.admin.database.v1.BackupSchedule.verify|verify} messages. - * @param message BackupSchedule message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IBackupSchedule, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BackupSchedule message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.BackupSchedule.verify|verify} messages. - * @param message BackupSchedule message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IBackupSchedule, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BackupSchedule message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BackupSchedule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.BackupSchedule; - - /** - * Decodes a BackupSchedule message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BackupSchedule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.BackupSchedule; - - /** - * Verifies a BackupSchedule message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BackupSchedule message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BackupSchedule - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.BackupSchedule; - - /** - * Creates a plain object from a BackupSchedule message. Also converts values to other types if specified. - * @param message BackupSchedule - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.BackupSchedule, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BackupSchedule to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BackupSchedule - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CrontabSpec. */ - interface ICrontabSpec { - - /** CrontabSpec text */ - text?: (string|null); - - /** CrontabSpec timeZone */ - timeZone?: (string|null); - - /** CrontabSpec creationWindow */ - creationWindow?: (google.protobuf.IDuration|null); - } - - /** Represents a CrontabSpec. */ - class CrontabSpec implements ICrontabSpec { - - /** - * Constructs a new CrontabSpec. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.ICrontabSpec); - - /** CrontabSpec text. */ - public text: string; - - /** CrontabSpec timeZone. */ - public timeZone: string; - - /** CrontabSpec creationWindow. */ - public creationWindow?: (google.protobuf.IDuration|null); - - /** - * Creates a new CrontabSpec instance using the specified properties. - * @param [properties] Properties to set - * @returns CrontabSpec instance - */ - public static create(properties?: google.spanner.admin.database.v1.ICrontabSpec): google.spanner.admin.database.v1.CrontabSpec; - - /** - * Encodes the specified CrontabSpec message. Does not implicitly {@link google.spanner.admin.database.v1.CrontabSpec.verify|verify} messages. - * @param message CrontabSpec message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.ICrontabSpec, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CrontabSpec message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.CrontabSpec.verify|verify} messages. - * @param message CrontabSpec message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.ICrontabSpec, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CrontabSpec message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CrontabSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.CrontabSpec; - - /** - * Decodes a CrontabSpec message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CrontabSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.CrontabSpec; - - /** - * Verifies a CrontabSpec message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CrontabSpec message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CrontabSpec - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.CrontabSpec; - - /** - * Creates a plain object from a CrontabSpec message. Also converts values to other types if specified. - * @param message CrontabSpec - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.CrontabSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CrontabSpec to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CrontabSpec - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateBackupScheduleRequest. */ - interface ICreateBackupScheduleRequest { - - /** CreateBackupScheduleRequest parent */ - parent?: (string|null); - - /** CreateBackupScheduleRequest backupScheduleId */ - backupScheduleId?: (string|null); - - /** CreateBackupScheduleRequest backupSchedule */ - backupSchedule?: (google.spanner.admin.database.v1.IBackupSchedule|null); - } - - /** Represents a CreateBackupScheduleRequest. */ - class CreateBackupScheduleRequest implements ICreateBackupScheduleRequest { - - /** - * Constructs a new CreateBackupScheduleRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.ICreateBackupScheduleRequest); - - /** CreateBackupScheduleRequest parent. */ - public parent: string; - - /** CreateBackupScheduleRequest backupScheduleId. */ - public backupScheduleId: string; - - /** CreateBackupScheduleRequest backupSchedule. */ - public backupSchedule?: (google.spanner.admin.database.v1.IBackupSchedule|null); - - /** - * Creates a new CreateBackupScheduleRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateBackupScheduleRequest instance - */ - public static create(properties?: google.spanner.admin.database.v1.ICreateBackupScheduleRequest): google.spanner.admin.database.v1.CreateBackupScheduleRequest; - - /** - * Encodes the specified CreateBackupScheduleRequest message. Does not implicitly {@link google.spanner.admin.database.v1.CreateBackupScheduleRequest.verify|verify} messages. - * @param message CreateBackupScheduleRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.ICreateBackupScheduleRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateBackupScheduleRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.CreateBackupScheduleRequest.verify|verify} messages. - * @param message CreateBackupScheduleRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.ICreateBackupScheduleRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateBackupScheduleRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateBackupScheduleRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.CreateBackupScheduleRequest; - - /** - * Decodes a CreateBackupScheduleRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateBackupScheduleRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.CreateBackupScheduleRequest; - - /** - * Verifies a CreateBackupScheduleRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateBackupScheduleRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateBackupScheduleRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.CreateBackupScheduleRequest; - - /** - * Creates a plain object from a CreateBackupScheduleRequest message. Also converts values to other types if specified. - * @param message CreateBackupScheduleRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.CreateBackupScheduleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateBackupScheduleRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateBackupScheduleRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetBackupScheduleRequest. */ - interface IGetBackupScheduleRequest { - - /** GetBackupScheduleRequest name */ - name?: (string|null); - } - - /** Represents a GetBackupScheduleRequest. */ - class GetBackupScheduleRequest implements IGetBackupScheduleRequest { - - /** - * Constructs a new GetBackupScheduleRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IGetBackupScheduleRequest); - - /** GetBackupScheduleRequest name. */ - public name: string; - - /** - * Creates a new GetBackupScheduleRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetBackupScheduleRequest instance - */ - public static create(properties?: google.spanner.admin.database.v1.IGetBackupScheduleRequest): google.spanner.admin.database.v1.GetBackupScheduleRequest; - - /** - * Encodes the specified GetBackupScheduleRequest message. Does not implicitly {@link google.spanner.admin.database.v1.GetBackupScheduleRequest.verify|verify} messages. - * @param message GetBackupScheduleRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IGetBackupScheduleRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetBackupScheduleRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.GetBackupScheduleRequest.verify|verify} messages. - * @param message GetBackupScheduleRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IGetBackupScheduleRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetBackupScheduleRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetBackupScheduleRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.GetBackupScheduleRequest; - - /** - * Decodes a GetBackupScheduleRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetBackupScheduleRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.GetBackupScheduleRequest; - - /** - * Verifies a GetBackupScheduleRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetBackupScheduleRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetBackupScheduleRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.GetBackupScheduleRequest; - - /** - * Creates a plain object from a GetBackupScheduleRequest message. Also converts values to other types if specified. - * @param message GetBackupScheduleRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.GetBackupScheduleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetBackupScheduleRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetBackupScheduleRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteBackupScheduleRequest. */ - interface IDeleteBackupScheduleRequest { - - /** DeleteBackupScheduleRequest name */ - name?: (string|null); - } - - /** Represents a DeleteBackupScheduleRequest. */ - class DeleteBackupScheduleRequest implements IDeleteBackupScheduleRequest { - - /** - * Constructs a new DeleteBackupScheduleRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IDeleteBackupScheduleRequest); - - /** DeleteBackupScheduleRequest name. */ - public name: string; - - /** - * Creates a new DeleteBackupScheduleRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteBackupScheduleRequest instance - */ - public static create(properties?: google.spanner.admin.database.v1.IDeleteBackupScheduleRequest): google.spanner.admin.database.v1.DeleteBackupScheduleRequest; - - /** - * Encodes the specified DeleteBackupScheduleRequest message. Does not implicitly {@link google.spanner.admin.database.v1.DeleteBackupScheduleRequest.verify|verify} messages. - * @param message DeleteBackupScheduleRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IDeleteBackupScheduleRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteBackupScheduleRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.DeleteBackupScheduleRequest.verify|verify} messages. - * @param message DeleteBackupScheduleRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IDeleteBackupScheduleRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteBackupScheduleRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteBackupScheduleRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.DeleteBackupScheduleRequest; - - /** - * Decodes a DeleteBackupScheduleRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteBackupScheduleRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.DeleteBackupScheduleRequest; - - /** - * Verifies a DeleteBackupScheduleRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteBackupScheduleRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteBackupScheduleRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.DeleteBackupScheduleRequest; - - /** - * Creates a plain object from a DeleteBackupScheduleRequest message. Also converts values to other types if specified. - * @param message DeleteBackupScheduleRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.DeleteBackupScheduleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteBackupScheduleRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteBackupScheduleRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListBackupSchedulesRequest. */ - interface IListBackupSchedulesRequest { - - /** ListBackupSchedulesRequest parent */ - parent?: (string|null); - - /** ListBackupSchedulesRequest pageSize */ - pageSize?: (number|null); - - /** ListBackupSchedulesRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListBackupSchedulesRequest. */ - class ListBackupSchedulesRequest implements IListBackupSchedulesRequest { - - /** - * Constructs a new ListBackupSchedulesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IListBackupSchedulesRequest); - - /** ListBackupSchedulesRequest parent. */ - public parent: string; - - /** ListBackupSchedulesRequest pageSize. */ - public pageSize: number; - - /** ListBackupSchedulesRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListBackupSchedulesRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListBackupSchedulesRequest instance - */ - public static create(properties?: google.spanner.admin.database.v1.IListBackupSchedulesRequest): google.spanner.admin.database.v1.ListBackupSchedulesRequest; - - /** - * Encodes the specified ListBackupSchedulesRequest message. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupSchedulesRequest.verify|verify} messages. - * @param message ListBackupSchedulesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IListBackupSchedulesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListBackupSchedulesRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupSchedulesRequest.verify|verify} messages. - * @param message ListBackupSchedulesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IListBackupSchedulesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListBackupSchedulesRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListBackupSchedulesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.ListBackupSchedulesRequest; - - /** - * Decodes a ListBackupSchedulesRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListBackupSchedulesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.ListBackupSchedulesRequest; - - /** - * Verifies a ListBackupSchedulesRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListBackupSchedulesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListBackupSchedulesRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.ListBackupSchedulesRequest; - - /** - * Creates a plain object from a ListBackupSchedulesRequest message. Also converts values to other types if specified. - * @param message ListBackupSchedulesRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.ListBackupSchedulesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListBackupSchedulesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListBackupSchedulesRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListBackupSchedulesResponse. */ - interface IListBackupSchedulesResponse { - - /** ListBackupSchedulesResponse backupSchedules */ - backupSchedules?: (google.spanner.admin.database.v1.IBackupSchedule[]|null); - - /** ListBackupSchedulesResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListBackupSchedulesResponse. */ - class ListBackupSchedulesResponse implements IListBackupSchedulesResponse { - - /** - * Constructs a new ListBackupSchedulesResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IListBackupSchedulesResponse); - - /** ListBackupSchedulesResponse backupSchedules. */ - public backupSchedules: google.spanner.admin.database.v1.IBackupSchedule[]; - - /** ListBackupSchedulesResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListBackupSchedulesResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListBackupSchedulesResponse instance - */ - public static create(properties?: google.spanner.admin.database.v1.IListBackupSchedulesResponse): google.spanner.admin.database.v1.ListBackupSchedulesResponse; - - /** - * Encodes the specified ListBackupSchedulesResponse message. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupSchedulesResponse.verify|verify} messages. - * @param message ListBackupSchedulesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IListBackupSchedulesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListBackupSchedulesResponse message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupSchedulesResponse.verify|verify} messages. - * @param message ListBackupSchedulesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IListBackupSchedulesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListBackupSchedulesResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListBackupSchedulesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.ListBackupSchedulesResponse; - - /** - * Decodes a ListBackupSchedulesResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListBackupSchedulesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.ListBackupSchedulesResponse; - - /** - * Verifies a ListBackupSchedulesResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListBackupSchedulesResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListBackupSchedulesResponse - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.ListBackupSchedulesResponse; - - /** - * Creates a plain object from a ListBackupSchedulesResponse message. Also converts values to other types if specified. - * @param message ListBackupSchedulesResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.ListBackupSchedulesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListBackupSchedulesResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListBackupSchedulesResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateBackupScheduleRequest. */ - interface IUpdateBackupScheduleRequest { - - /** UpdateBackupScheduleRequest backupSchedule */ - backupSchedule?: (google.spanner.admin.database.v1.IBackupSchedule|null); - - /** UpdateBackupScheduleRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - } - - /** Represents an UpdateBackupScheduleRequest. */ - class UpdateBackupScheduleRequest implements IUpdateBackupScheduleRequest { - - /** - * Constructs a new UpdateBackupScheduleRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IUpdateBackupScheduleRequest); - - /** UpdateBackupScheduleRequest backupSchedule. */ - public backupSchedule?: (google.spanner.admin.database.v1.IBackupSchedule|null); - - /** UpdateBackupScheduleRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** - * Creates a new UpdateBackupScheduleRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateBackupScheduleRequest instance - */ - public static create(properties?: google.spanner.admin.database.v1.IUpdateBackupScheduleRequest): google.spanner.admin.database.v1.UpdateBackupScheduleRequest; - - /** - * Encodes the specified UpdateBackupScheduleRequest message. Does not implicitly {@link google.spanner.admin.database.v1.UpdateBackupScheduleRequest.verify|verify} messages. - * @param message UpdateBackupScheduleRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IUpdateBackupScheduleRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateBackupScheduleRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.UpdateBackupScheduleRequest.verify|verify} messages. - * @param message UpdateBackupScheduleRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IUpdateBackupScheduleRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateBackupScheduleRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateBackupScheduleRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.UpdateBackupScheduleRequest; - - /** - * Decodes an UpdateBackupScheduleRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateBackupScheduleRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.UpdateBackupScheduleRequest; - - /** - * Verifies an UpdateBackupScheduleRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UpdateBackupScheduleRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateBackupScheduleRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.UpdateBackupScheduleRequest; - - /** - * Creates a plain object from an UpdateBackupScheduleRequest message. Also converts values to other types if specified. - * @param message UpdateBackupScheduleRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.UpdateBackupScheduleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateBackupScheduleRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateBackupScheduleRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Represents a DatabaseAdmin */ - class DatabaseAdmin extends $protobuf.rpc.Service { - - /** - * Constructs a new DatabaseAdmin service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - - /** - * Creates new DatabaseAdmin 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): DatabaseAdmin; - - /** - * Calls ListDatabases. - * @param request ListDatabasesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListDatabasesResponse - */ - public listDatabases(request: google.spanner.admin.database.v1.IListDatabasesRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.ListDatabasesCallback): void; - - /** - * Calls ListDatabases. - * @param request ListDatabasesRequest message or plain object - * @returns Promise - */ - public listDatabases(request: google.spanner.admin.database.v1.IListDatabasesRequest): Promise; - - /** - * Calls CreateDatabase. - * @param request CreateDatabaseRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public createDatabase(request: google.spanner.admin.database.v1.ICreateDatabaseRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.CreateDatabaseCallback): void; - - /** - * Calls CreateDatabase. - * @param request CreateDatabaseRequest message or plain object - * @returns Promise - */ - public createDatabase(request: google.spanner.admin.database.v1.ICreateDatabaseRequest): Promise; - - /** - * Calls GetDatabase. - * @param request GetDatabaseRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Database - */ - public getDatabase(request: google.spanner.admin.database.v1.IGetDatabaseRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.GetDatabaseCallback): void; - - /** - * Calls GetDatabase. - * @param request GetDatabaseRequest message or plain object - * @returns Promise - */ - public getDatabase(request: google.spanner.admin.database.v1.IGetDatabaseRequest): Promise; - - /** - * Calls UpdateDatabase. - * @param request UpdateDatabaseRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public updateDatabase(request: google.spanner.admin.database.v1.IUpdateDatabaseRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseCallback): void; - - /** - * Calls UpdateDatabase. - * @param request UpdateDatabaseRequest message or plain object - * @returns Promise - */ - public updateDatabase(request: google.spanner.admin.database.v1.IUpdateDatabaseRequest): Promise; - - /** - * Calls UpdateDatabaseDdl. - * @param request UpdateDatabaseDdlRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public updateDatabaseDdl(request: google.spanner.admin.database.v1.IUpdateDatabaseDdlRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdlCallback): void; - - /** - * Calls UpdateDatabaseDdl. - * @param request UpdateDatabaseDdlRequest message or plain object - * @returns Promise - */ - public updateDatabaseDdl(request: google.spanner.admin.database.v1.IUpdateDatabaseDdlRequest): Promise; - - /** - * Calls DropDatabase. - * @param request DropDatabaseRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public dropDatabase(request: google.spanner.admin.database.v1.IDropDatabaseRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.DropDatabaseCallback): void; - - /** - * Calls DropDatabase. - * @param request DropDatabaseRequest message or plain object - * @returns Promise - */ - public dropDatabase(request: google.spanner.admin.database.v1.IDropDatabaseRequest): Promise; - - /** - * Calls GetDatabaseDdl. - * @param request GetDatabaseDdlRequest message or plain object - * @param callback Node-style callback called with the error, if any, and GetDatabaseDdlResponse - */ - public getDatabaseDdl(request: google.spanner.admin.database.v1.IGetDatabaseDdlRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.GetDatabaseDdlCallback): void; - - /** - * Calls GetDatabaseDdl. - * @param request GetDatabaseDdlRequest message or plain object - * @returns Promise - */ - public getDatabaseDdl(request: google.spanner.admin.database.v1.IGetDatabaseDdlRequest): Promise; - - /** - * Calls SetIamPolicy. - * @param request SetIamPolicyRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Policy - */ - public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.SetIamPolicyCallback): void; - - /** - * Calls SetIamPolicy. - * @param request SetIamPolicyRequest message or plain object - * @returns Promise - */ - public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest): Promise; - - /** - * Calls GetIamPolicy. - * @param request GetIamPolicyRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Policy - */ - public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.GetIamPolicyCallback): void; - - /** - * Calls GetIamPolicy. - * @param request GetIamPolicyRequest message or plain object - * @returns Promise - */ - public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest): Promise; - - /** - * Calls TestIamPermissions. - * @param request TestIamPermissionsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and TestIamPermissionsResponse - */ - public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.TestIamPermissionsCallback): void; - - /** - * Calls TestIamPermissions. - * @param request TestIamPermissionsRequest message or plain object - * @returns Promise - */ - public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest): Promise; - - /** - * Calls CreateBackup. - * @param request CreateBackupRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public createBackup(request: google.spanner.admin.database.v1.ICreateBackupRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.CreateBackupCallback): void; - - /** - * Calls CreateBackup. - * @param request CreateBackupRequest message or plain object - * @returns Promise - */ - public createBackup(request: google.spanner.admin.database.v1.ICreateBackupRequest): Promise; - - /** - * Calls CopyBackup. - * @param request CopyBackupRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public copyBackup(request: google.spanner.admin.database.v1.ICopyBackupRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.CopyBackupCallback): void; - - /** - * Calls CopyBackup. - * @param request CopyBackupRequest message or plain object - * @returns Promise - */ - public copyBackup(request: google.spanner.admin.database.v1.ICopyBackupRequest): Promise; - - /** - * Calls GetBackup. - * @param request GetBackupRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Backup - */ - public getBackup(request: google.spanner.admin.database.v1.IGetBackupRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.GetBackupCallback): void; - - /** - * Calls GetBackup. - * @param request GetBackupRequest message or plain object - * @returns Promise - */ - public getBackup(request: google.spanner.admin.database.v1.IGetBackupRequest): Promise; - - /** - * Calls UpdateBackup. - * @param request UpdateBackupRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Backup - */ - public updateBackup(request: google.spanner.admin.database.v1.IUpdateBackupRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.UpdateBackupCallback): void; - - /** - * Calls UpdateBackup. - * @param request UpdateBackupRequest message or plain object - * @returns Promise - */ - public updateBackup(request: google.spanner.admin.database.v1.IUpdateBackupRequest): Promise; - - /** - * Calls DeleteBackup. - * @param request DeleteBackupRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteBackup(request: google.spanner.admin.database.v1.IDeleteBackupRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.DeleteBackupCallback): void; - - /** - * Calls DeleteBackup. - * @param request DeleteBackupRequest message or plain object - * @returns Promise - */ - public deleteBackup(request: google.spanner.admin.database.v1.IDeleteBackupRequest): Promise; - - /** - * Calls ListBackups. - * @param request ListBackupsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListBackupsResponse - */ - public listBackups(request: google.spanner.admin.database.v1.IListBackupsRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.ListBackupsCallback): void; - - /** - * Calls ListBackups. - * @param request ListBackupsRequest message or plain object - * @returns Promise - */ - public listBackups(request: google.spanner.admin.database.v1.IListBackupsRequest): Promise; - - /** - * Calls RestoreDatabase. - * @param request RestoreDatabaseRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public restoreDatabase(request: google.spanner.admin.database.v1.IRestoreDatabaseRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.RestoreDatabaseCallback): void; - - /** - * Calls RestoreDatabase. - * @param request RestoreDatabaseRequest message or plain object - * @returns Promise - */ - public restoreDatabase(request: google.spanner.admin.database.v1.IRestoreDatabaseRequest): Promise; - - /** - * Calls ListDatabaseOperations. - * @param request ListDatabaseOperationsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListDatabaseOperationsResponse - */ - public listDatabaseOperations(request: google.spanner.admin.database.v1.IListDatabaseOperationsRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.ListDatabaseOperationsCallback): void; - - /** - * Calls ListDatabaseOperations. - * @param request ListDatabaseOperationsRequest message or plain object - * @returns Promise - */ - public listDatabaseOperations(request: google.spanner.admin.database.v1.IListDatabaseOperationsRequest): Promise; - - /** - * Calls ListBackupOperations. - * @param request ListBackupOperationsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListBackupOperationsResponse - */ - public listBackupOperations(request: google.spanner.admin.database.v1.IListBackupOperationsRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.ListBackupOperationsCallback): void; - - /** - * Calls ListBackupOperations. - * @param request ListBackupOperationsRequest message or plain object - * @returns Promise - */ - public listBackupOperations(request: google.spanner.admin.database.v1.IListBackupOperationsRequest): Promise; - - /** - * Calls ListDatabaseRoles. - * @param request ListDatabaseRolesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListDatabaseRolesResponse - */ - public listDatabaseRoles(request: google.spanner.admin.database.v1.IListDatabaseRolesRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.ListDatabaseRolesCallback): void; - - /** - * Calls ListDatabaseRoles. - * @param request ListDatabaseRolesRequest message or plain object - * @returns Promise - */ - public listDatabaseRoles(request: google.spanner.admin.database.v1.IListDatabaseRolesRequest): Promise; - - /** - * Calls AddSplitPoints. - * @param request AddSplitPointsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and AddSplitPointsResponse - */ - public addSplitPoints(request: google.spanner.admin.database.v1.IAddSplitPointsRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.AddSplitPointsCallback): void; - - /** - * Calls AddSplitPoints. - * @param request AddSplitPointsRequest message or plain object - * @returns Promise - */ - public addSplitPoints(request: google.spanner.admin.database.v1.IAddSplitPointsRequest): Promise; - - /** - * Calls CreateBackupSchedule. - * @param request CreateBackupScheduleRequest message or plain object - * @param callback Node-style callback called with the error, if any, and BackupSchedule - */ - public createBackupSchedule(request: google.spanner.admin.database.v1.ICreateBackupScheduleRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.CreateBackupScheduleCallback): void; - - /** - * Calls CreateBackupSchedule. - * @param request CreateBackupScheduleRequest message or plain object - * @returns Promise - */ - public createBackupSchedule(request: google.spanner.admin.database.v1.ICreateBackupScheduleRequest): Promise; - - /** - * Calls GetBackupSchedule. - * @param request GetBackupScheduleRequest message or plain object - * @param callback Node-style callback called with the error, if any, and BackupSchedule - */ - public getBackupSchedule(request: google.spanner.admin.database.v1.IGetBackupScheduleRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.GetBackupScheduleCallback): void; - - /** - * Calls GetBackupSchedule. - * @param request GetBackupScheduleRequest message or plain object - * @returns Promise - */ - public getBackupSchedule(request: google.spanner.admin.database.v1.IGetBackupScheduleRequest): Promise; - - /** - * Calls UpdateBackupSchedule. - * @param request UpdateBackupScheduleRequest message or plain object - * @param callback Node-style callback called with the error, if any, and BackupSchedule - */ - public updateBackupSchedule(request: google.spanner.admin.database.v1.IUpdateBackupScheduleRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.UpdateBackupScheduleCallback): void; - - /** - * Calls UpdateBackupSchedule. - * @param request UpdateBackupScheduleRequest message or plain object - * @returns Promise - */ - public updateBackupSchedule(request: google.spanner.admin.database.v1.IUpdateBackupScheduleRequest): Promise; - - /** - * Calls DeleteBackupSchedule. - * @param request DeleteBackupScheduleRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteBackupSchedule(request: google.spanner.admin.database.v1.IDeleteBackupScheduleRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.DeleteBackupScheduleCallback): void; - - /** - * Calls DeleteBackupSchedule. - * @param request DeleteBackupScheduleRequest message or plain object - * @returns Promise - */ - public deleteBackupSchedule(request: google.spanner.admin.database.v1.IDeleteBackupScheduleRequest): Promise; - - /** - * Calls ListBackupSchedules. - * @param request ListBackupSchedulesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListBackupSchedulesResponse - */ - public listBackupSchedules(request: google.spanner.admin.database.v1.IListBackupSchedulesRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.ListBackupSchedulesCallback): void; - - /** - * Calls ListBackupSchedules. - * @param request ListBackupSchedulesRequest message or plain object - * @returns Promise - */ - public listBackupSchedules(request: google.spanner.admin.database.v1.IListBackupSchedulesRequest): Promise; - - /** - * Calls InternalUpdateGraphOperation. - * @param request InternalUpdateGraphOperationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and InternalUpdateGraphOperationResponse - */ - public internalUpdateGraphOperation(request: google.spanner.admin.database.v1.IInternalUpdateGraphOperationRequest, callback: google.spanner.admin.database.v1.DatabaseAdmin.InternalUpdateGraphOperationCallback): void; - - /** - * Calls InternalUpdateGraphOperation. - * @param request InternalUpdateGraphOperationRequest message or plain object - * @returns Promise - */ - public internalUpdateGraphOperation(request: google.spanner.admin.database.v1.IInternalUpdateGraphOperationRequest): Promise; - } - - namespace DatabaseAdmin { - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|listDatabases}. - * @param error Error, if any - * @param [response] ListDatabasesResponse - */ - type ListDatabasesCallback = (error: (Error|null), response?: google.spanner.admin.database.v1.ListDatabasesResponse) => void; - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|createDatabase}. - * @param error Error, if any - * @param [response] Operation - */ - type CreateDatabaseCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|getDatabase}. - * @param error Error, if any - * @param [response] Database - */ - type GetDatabaseCallback = (error: (Error|null), response?: google.spanner.admin.database.v1.Database) => void; - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|updateDatabase}. - * @param error Error, if any - * @param [response] Operation - */ - type UpdateDatabaseCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|updateDatabaseDdl}. - * @param error Error, if any - * @param [response] Operation - */ - type UpdateDatabaseDdlCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|dropDatabase}. - * @param error Error, if any - * @param [response] Empty - */ - type DropDatabaseCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|getDatabaseDdl}. - * @param error Error, if any - * @param [response] GetDatabaseDdlResponse - */ - type GetDatabaseDdlCallback = (error: (Error|null), response?: google.spanner.admin.database.v1.GetDatabaseDdlResponse) => void; - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|setIamPolicy}. - * @param error Error, if any - * @param [response] Policy - */ - type SetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|getIamPolicy}. - * @param error Error, if any - * @param [response] Policy - */ - type GetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|testIamPermissions}. - * @param error Error, if any - * @param [response] TestIamPermissionsResponse - */ - type TestIamPermissionsCallback = (error: (Error|null), response?: google.iam.v1.TestIamPermissionsResponse) => void; - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|createBackup}. - * @param error Error, if any - * @param [response] Operation - */ - type CreateBackupCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|copyBackup}. - * @param error Error, if any - * @param [response] Operation - */ - type CopyBackupCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|getBackup}. - * @param error Error, if any - * @param [response] Backup - */ - type GetBackupCallback = (error: (Error|null), response?: google.spanner.admin.database.v1.Backup) => void; - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|updateBackup}. - * @param error Error, if any - * @param [response] Backup - */ - type UpdateBackupCallback = (error: (Error|null), response?: google.spanner.admin.database.v1.Backup) => void; - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|deleteBackup}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteBackupCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|listBackups}. - * @param error Error, if any - * @param [response] ListBackupsResponse - */ - type ListBackupsCallback = (error: (Error|null), response?: google.spanner.admin.database.v1.ListBackupsResponse) => void; - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|restoreDatabase}. - * @param error Error, if any - * @param [response] Operation - */ - type RestoreDatabaseCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|listDatabaseOperations}. - * @param error Error, if any - * @param [response] ListDatabaseOperationsResponse - */ - type ListDatabaseOperationsCallback = (error: (Error|null), response?: google.spanner.admin.database.v1.ListDatabaseOperationsResponse) => void; - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|listBackupOperations}. - * @param error Error, if any - * @param [response] ListBackupOperationsResponse - */ - type ListBackupOperationsCallback = (error: (Error|null), response?: google.spanner.admin.database.v1.ListBackupOperationsResponse) => void; - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|listDatabaseRoles}. - * @param error Error, if any - * @param [response] ListDatabaseRolesResponse - */ - type ListDatabaseRolesCallback = (error: (Error|null), response?: google.spanner.admin.database.v1.ListDatabaseRolesResponse) => void; - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|addSplitPoints}. - * @param error Error, if any - * @param [response] AddSplitPointsResponse - */ - type AddSplitPointsCallback = (error: (Error|null), response?: google.spanner.admin.database.v1.AddSplitPointsResponse) => void; - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|createBackupSchedule}. - * @param error Error, if any - * @param [response] BackupSchedule - */ - type CreateBackupScheduleCallback = (error: (Error|null), response?: google.spanner.admin.database.v1.BackupSchedule) => void; - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|getBackupSchedule}. - * @param error Error, if any - * @param [response] BackupSchedule - */ - type GetBackupScheduleCallback = (error: (Error|null), response?: google.spanner.admin.database.v1.BackupSchedule) => void; - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|updateBackupSchedule}. - * @param error Error, if any - * @param [response] BackupSchedule - */ - type UpdateBackupScheduleCallback = (error: (Error|null), response?: google.spanner.admin.database.v1.BackupSchedule) => void; - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|deleteBackupSchedule}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteBackupScheduleCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|listBackupSchedules}. - * @param error Error, if any - * @param [response] ListBackupSchedulesResponse - */ - type ListBackupSchedulesCallback = (error: (Error|null), response?: google.spanner.admin.database.v1.ListBackupSchedulesResponse) => void; - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|internalUpdateGraphOperation}. - * @param error Error, if any - * @param [response] InternalUpdateGraphOperationResponse - */ - type InternalUpdateGraphOperationCallback = (error: (Error|null), response?: google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse) => void; - } - - /** Properties of a RestoreInfo. */ - interface IRestoreInfo { - - /** RestoreInfo sourceType */ - sourceType?: (google.spanner.admin.database.v1.RestoreSourceType|keyof typeof google.spanner.admin.database.v1.RestoreSourceType|null); - - /** RestoreInfo backupInfo */ - backupInfo?: (google.spanner.admin.database.v1.IBackupInfo|null); - } - - /** Represents a RestoreInfo. */ - class RestoreInfo implements IRestoreInfo { - - /** - * Constructs a new RestoreInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IRestoreInfo); - - /** RestoreInfo sourceType. */ - public sourceType: (google.spanner.admin.database.v1.RestoreSourceType|keyof typeof google.spanner.admin.database.v1.RestoreSourceType); - - /** RestoreInfo backupInfo. */ - public backupInfo?: (google.spanner.admin.database.v1.IBackupInfo|null); - - /** RestoreInfo sourceInfo. */ - public sourceInfo?: "backupInfo"; - - /** - * Creates a new RestoreInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns RestoreInfo instance - */ - public static create(properties?: google.spanner.admin.database.v1.IRestoreInfo): google.spanner.admin.database.v1.RestoreInfo; - - /** - * Encodes the specified RestoreInfo message. Does not implicitly {@link google.spanner.admin.database.v1.RestoreInfo.verify|verify} messages. - * @param message RestoreInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IRestoreInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RestoreInfo message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.RestoreInfo.verify|verify} messages. - * @param message RestoreInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IRestoreInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RestoreInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RestoreInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.RestoreInfo; - - /** - * Decodes a RestoreInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RestoreInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.RestoreInfo; - - /** - * Verifies a RestoreInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RestoreInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RestoreInfo - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.RestoreInfo; - - /** - * Creates a plain object from a RestoreInfo message. Also converts values to other types if specified. - * @param message RestoreInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.RestoreInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RestoreInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RestoreInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Database. */ - interface IDatabase { - - /** Database name */ - name?: (string|null); - - /** Database state */ - state?: (google.spanner.admin.database.v1.Database.State|keyof typeof google.spanner.admin.database.v1.Database.State|null); - - /** Database createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** Database restoreInfo */ - restoreInfo?: (google.spanner.admin.database.v1.IRestoreInfo|null); - - /** Database encryptionConfig */ - encryptionConfig?: (google.spanner.admin.database.v1.IEncryptionConfig|null); - - /** Database encryptionInfo */ - encryptionInfo?: (google.spanner.admin.database.v1.IEncryptionInfo[]|null); - - /** Database versionRetentionPeriod */ - versionRetentionPeriod?: (string|null); - - /** Database earliestVersionTime */ - earliestVersionTime?: (google.protobuf.ITimestamp|null); - - /** Database defaultLeader */ - defaultLeader?: (string|null); - - /** Database databaseDialect */ - databaseDialect?: (google.spanner.admin.database.v1.DatabaseDialect|keyof typeof google.spanner.admin.database.v1.DatabaseDialect|null); - - /** Database enableDropProtection */ - enableDropProtection?: (boolean|null); - - /** Database reconciling */ - reconciling?: (boolean|null); - } - - /** Represents a Database. */ - class Database implements IDatabase { - - /** - * Constructs a new Database. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IDatabase); - - /** Database name. */ - public name: string; - - /** Database state. */ - public state: (google.spanner.admin.database.v1.Database.State|keyof typeof google.spanner.admin.database.v1.Database.State); - - /** Database createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** Database restoreInfo. */ - public restoreInfo?: (google.spanner.admin.database.v1.IRestoreInfo|null); - - /** Database encryptionConfig. */ - public encryptionConfig?: (google.spanner.admin.database.v1.IEncryptionConfig|null); - - /** Database encryptionInfo. */ - public encryptionInfo: google.spanner.admin.database.v1.IEncryptionInfo[]; - - /** Database versionRetentionPeriod. */ - public versionRetentionPeriod: string; - - /** Database earliestVersionTime. */ - public earliestVersionTime?: (google.protobuf.ITimestamp|null); - - /** Database defaultLeader. */ - public defaultLeader: string; - - /** Database databaseDialect. */ - public databaseDialect: (google.spanner.admin.database.v1.DatabaseDialect|keyof typeof google.spanner.admin.database.v1.DatabaseDialect); - - /** Database enableDropProtection. */ - public enableDropProtection: boolean; - - /** Database reconciling. */ - public reconciling: boolean; - - /** - * Creates a new Database instance using the specified properties. - * @param [properties] Properties to set - * @returns Database instance - */ - public static create(properties?: google.spanner.admin.database.v1.IDatabase): google.spanner.admin.database.v1.Database; - - /** - * Encodes the specified Database message. Does not implicitly {@link google.spanner.admin.database.v1.Database.verify|verify} messages. - * @param message Database message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IDatabase, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Database message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.Database.verify|verify} messages. - * @param message Database message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IDatabase, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Database message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Database - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.Database; - - /** - * Decodes a Database message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Database - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.Database; - - /** - * Verifies a Database message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Database message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Database - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.Database; - - /** - * Creates a plain object from a Database message. Also converts values to other types if specified. - * @param message Database - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.Database, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Database to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Database - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Database { - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - CREATING = 1, - READY = 2, - READY_OPTIMIZING = 3 - } - } - - /** Properties of a ListDatabasesRequest. */ - interface IListDatabasesRequest { - - /** ListDatabasesRequest parent */ - parent?: (string|null); - - /** ListDatabasesRequest pageSize */ - pageSize?: (number|null); - - /** ListDatabasesRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListDatabasesRequest. */ - class ListDatabasesRequest implements IListDatabasesRequest { - - /** - * Constructs a new ListDatabasesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IListDatabasesRequest); - - /** ListDatabasesRequest parent. */ - public parent: string; - - /** ListDatabasesRequest pageSize. */ - public pageSize: number; - - /** ListDatabasesRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListDatabasesRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListDatabasesRequest instance - */ - public static create(properties?: google.spanner.admin.database.v1.IListDatabasesRequest): google.spanner.admin.database.v1.ListDatabasesRequest; - - /** - * Encodes the specified ListDatabasesRequest message. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabasesRequest.verify|verify} messages. - * @param message ListDatabasesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IListDatabasesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListDatabasesRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabasesRequest.verify|verify} messages. - * @param message ListDatabasesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IListDatabasesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListDatabasesRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListDatabasesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.ListDatabasesRequest; - - /** - * Decodes a ListDatabasesRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListDatabasesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.ListDatabasesRequest; - - /** - * Verifies a ListDatabasesRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListDatabasesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListDatabasesRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.ListDatabasesRequest; - - /** - * Creates a plain object from a ListDatabasesRequest message. Also converts values to other types if specified. - * @param message ListDatabasesRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.ListDatabasesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListDatabasesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListDatabasesRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListDatabasesResponse. */ - interface IListDatabasesResponse { - - /** ListDatabasesResponse databases */ - databases?: (google.spanner.admin.database.v1.IDatabase[]|null); - - /** ListDatabasesResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListDatabasesResponse. */ - class ListDatabasesResponse implements IListDatabasesResponse { - - /** - * Constructs a new ListDatabasesResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IListDatabasesResponse); - - /** ListDatabasesResponse databases. */ - public databases: google.spanner.admin.database.v1.IDatabase[]; - - /** ListDatabasesResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListDatabasesResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListDatabasesResponse instance - */ - public static create(properties?: google.spanner.admin.database.v1.IListDatabasesResponse): google.spanner.admin.database.v1.ListDatabasesResponse; - - /** - * Encodes the specified ListDatabasesResponse message. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabasesResponse.verify|verify} messages. - * @param message ListDatabasesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IListDatabasesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListDatabasesResponse message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabasesResponse.verify|verify} messages. - * @param message ListDatabasesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IListDatabasesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListDatabasesResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListDatabasesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.ListDatabasesResponse; - - /** - * Decodes a ListDatabasesResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListDatabasesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.ListDatabasesResponse; - - /** - * Verifies a ListDatabasesResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListDatabasesResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListDatabasesResponse - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.ListDatabasesResponse; - - /** - * Creates a plain object from a ListDatabasesResponse message. Also converts values to other types if specified. - * @param message ListDatabasesResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.ListDatabasesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListDatabasesResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListDatabasesResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateDatabaseRequest. */ - interface ICreateDatabaseRequest { - - /** CreateDatabaseRequest parent */ - parent?: (string|null); - - /** CreateDatabaseRequest createStatement */ - createStatement?: (string|null); - - /** CreateDatabaseRequest extraStatements */ - extraStatements?: (string[]|null); - - /** CreateDatabaseRequest encryptionConfig */ - encryptionConfig?: (google.spanner.admin.database.v1.IEncryptionConfig|null); - - /** CreateDatabaseRequest databaseDialect */ - databaseDialect?: (google.spanner.admin.database.v1.DatabaseDialect|keyof typeof google.spanner.admin.database.v1.DatabaseDialect|null); - - /** CreateDatabaseRequest protoDescriptors */ - protoDescriptors?: (Uint8Array|Buffer|string|null); - } - - /** Represents a CreateDatabaseRequest. */ - class CreateDatabaseRequest implements ICreateDatabaseRequest { - - /** - * Constructs a new CreateDatabaseRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.ICreateDatabaseRequest); - - /** CreateDatabaseRequest parent. */ - public parent: string; - - /** CreateDatabaseRequest createStatement. */ - public createStatement: string; - - /** CreateDatabaseRequest extraStatements. */ - public extraStatements: string[]; - - /** CreateDatabaseRequest encryptionConfig. */ - public encryptionConfig?: (google.spanner.admin.database.v1.IEncryptionConfig|null); - - /** CreateDatabaseRequest databaseDialect. */ - public databaseDialect: (google.spanner.admin.database.v1.DatabaseDialect|keyof typeof google.spanner.admin.database.v1.DatabaseDialect); - - /** CreateDatabaseRequest protoDescriptors. */ - public protoDescriptors: (Uint8Array|Buffer|string); - - /** - * Creates a new CreateDatabaseRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateDatabaseRequest instance - */ - public static create(properties?: google.spanner.admin.database.v1.ICreateDatabaseRequest): google.spanner.admin.database.v1.CreateDatabaseRequest; - - /** - * Encodes the specified CreateDatabaseRequest message. Does not implicitly {@link google.spanner.admin.database.v1.CreateDatabaseRequest.verify|verify} messages. - * @param message CreateDatabaseRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.ICreateDatabaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateDatabaseRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.CreateDatabaseRequest.verify|verify} messages. - * @param message CreateDatabaseRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.ICreateDatabaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateDatabaseRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateDatabaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.CreateDatabaseRequest; - - /** - * Decodes a CreateDatabaseRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateDatabaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.CreateDatabaseRequest; - - /** - * Verifies a CreateDatabaseRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateDatabaseRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateDatabaseRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.CreateDatabaseRequest; - - /** - * Creates a plain object from a CreateDatabaseRequest message. Also converts values to other types if specified. - * @param message CreateDatabaseRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.CreateDatabaseRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateDatabaseRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateDatabaseRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateDatabaseMetadata. */ - interface ICreateDatabaseMetadata { - - /** CreateDatabaseMetadata database */ - database?: (string|null); - } - - /** Represents a CreateDatabaseMetadata. */ - class CreateDatabaseMetadata implements ICreateDatabaseMetadata { - - /** - * Constructs a new CreateDatabaseMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.ICreateDatabaseMetadata); - - /** CreateDatabaseMetadata database. */ - public database: string; - - /** - * Creates a new CreateDatabaseMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateDatabaseMetadata instance - */ - public static create(properties?: google.spanner.admin.database.v1.ICreateDatabaseMetadata): google.spanner.admin.database.v1.CreateDatabaseMetadata; - - /** - * Encodes the specified CreateDatabaseMetadata message. Does not implicitly {@link google.spanner.admin.database.v1.CreateDatabaseMetadata.verify|verify} messages. - * @param message CreateDatabaseMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.ICreateDatabaseMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateDatabaseMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.CreateDatabaseMetadata.verify|verify} messages. - * @param message CreateDatabaseMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.ICreateDatabaseMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateDatabaseMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateDatabaseMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.CreateDatabaseMetadata; - - /** - * Decodes a CreateDatabaseMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateDatabaseMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.CreateDatabaseMetadata; - - /** - * Verifies a CreateDatabaseMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateDatabaseMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateDatabaseMetadata - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.CreateDatabaseMetadata; - - /** - * Creates a plain object from a CreateDatabaseMetadata message. Also converts values to other types if specified. - * @param message CreateDatabaseMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.CreateDatabaseMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateDatabaseMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateDatabaseMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetDatabaseRequest. */ - interface IGetDatabaseRequest { - - /** GetDatabaseRequest name */ - name?: (string|null); - } - - /** Represents a GetDatabaseRequest. */ - class GetDatabaseRequest implements IGetDatabaseRequest { - - /** - * Constructs a new GetDatabaseRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IGetDatabaseRequest); - - /** GetDatabaseRequest name. */ - public name: string; - - /** - * Creates a new GetDatabaseRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetDatabaseRequest instance - */ - public static create(properties?: google.spanner.admin.database.v1.IGetDatabaseRequest): google.spanner.admin.database.v1.GetDatabaseRequest; - - /** - * Encodes the specified GetDatabaseRequest message. Does not implicitly {@link google.spanner.admin.database.v1.GetDatabaseRequest.verify|verify} messages. - * @param message GetDatabaseRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IGetDatabaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetDatabaseRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.GetDatabaseRequest.verify|verify} messages. - * @param message GetDatabaseRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IGetDatabaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetDatabaseRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetDatabaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.GetDatabaseRequest; - - /** - * Decodes a GetDatabaseRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetDatabaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.GetDatabaseRequest; - - /** - * Verifies a GetDatabaseRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetDatabaseRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetDatabaseRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.GetDatabaseRequest; - - /** - * Creates a plain object from a GetDatabaseRequest message. Also converts values to other types if specified. - * @param message GetDatabaseRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.GetDatabaseRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetDatabaseRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetDatabaseRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateDatabaseRequest. */ - interface IUpdateDatabaseRequest { - - /** UpdateDatabaseRequest database */ - database?: (google.spanner.admin.database.v1.IDatabase|null); - - /** UpdateDatabaseRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - } - - /** Represents an UpdateDatabaseRequest. */ - class UpdateDatabaseRequest implements IUpdateDatabaseRequest { - - /** - * Constructs a new UpdateDatabaseRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IUpdateDatabaseRequest); - - /** UpdateDatabaseRequest database. */ - public database?: (google.spanner.admin.database.v1.IDatabase|null); - - /** UpdateDatabaseRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** - * Creates a new UpdateDatabaseRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateDatabaseRequest instance - */ - public static create(properties?: google.spanner.admin.database.v1.IUpdateDatabaseRequest): google.spanner.admin.database.v1.UpdateDatabaseRequest; - - /** - * Encodes the specified UpdateDatabaseRequest message. Does not implicitly {@link google.spanner.admin.database.v1.UpdateDatabaseRequest.verify|verify} messages. - * @param message UpdateDatabaseRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IUpdateDatabaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateDatabaseRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.UpdateDatabaseRequest.verify|verify} messages. - * @param message UpdateDatabaseRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IUpdateDatabaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateDatabaseRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateDatabaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.UpdateDatabaseRequest; - - /** - * Decodes an UpdateDatabaseRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateDatabaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.UpdateDatabaseRequest; - - /** - * Verifies an UpdateDatabaseRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UpdateDatabaseRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateDatabaseRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.UpdateDatabaseRequest; - - /** - * Creates a plain object from an UpdateDatabaseRequest message. Also converts values to other types if specified. - * @param message UpdateDatabaseRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.UpdateDatabaseRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateDatabaseRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateDatabaseRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateDatabaseMetadata. */ - interface IUpdateDatabaseMetadata { - - /** UpdateDatabaseMetadata request */ - request?: (google.spanner.admin.database.v1.IUpdateDatabaseRequest|null); - - /** UpdateDatabaseMetadata progress */ - progress?: (google.spanner.admin.database.v1.IOperationProgress|null); - - /** UpdateDatabaseMetadata cancelTime */ - cancelTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents an UpdateDatabaseMetadata. */ - class UpdateDatabaseMetadata implements IUpdateDatabaseMetadata { - - /** - * Constructs a new UpdateDatabaseMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IUpdateDatabaseMetadata); - - /** UpdateDatabaseMetadata request. */ - public request?: (google.spanner.admin.database.v1.IUpdateDatabaseRequest|null); - - /** UpdateDatabaseMetadata progress. */ - public progress?: (google.spanner.admin.database.v1.IOperationProgress|null); - - /** UpdateDatabaseMetadata cancelTime. */ - public cancelTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new UpdateDatabaseMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateDatabaseMetadata instance - */ - public static create(properties?: google.spanner.admin.database.v1.IUpdateDatabaseMetadata): google.spanner.admin.database.v1.UpdateDatabaseMetadata; - - /** - * Encodes the specified UpdateDatabaseMetadata message. Does not implicitly {@link google.spanner.admin.database.v1.UpdateDatabaseMetadata.verify|verify} messages. - * @param message UpdateDatabaseMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IUpdateDatabaseMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateDatabaseMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.UpdateDatabaseMetadata.verify|verify} messages. - * @param message UpdateDatabaseMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IUpdateDatabaseMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateDatabaseMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateDatabaseMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.UpdateDatabaseMetadata; - - /** - * Decodes an UpdateDatabaseMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateDatabaseMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.UpdateDatabaseMetadata; - - /** - * Verifies an UpdateDatabaseMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UpdateDatabaseMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateDatabaseMetadata - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.UpdateDatabaseMetadata; - - /** - * Creates a plain object from an UpdateDatabaseMetadata message. Also converts values to other types if specified. - * @param message UpdateDatabaseMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.UpdateDatabaseMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateDatabaseMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateDatabaseMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateDatabaseDdlRequest. */ - interface IUpdateDatabaseDdlRequest { - - /** UpdateDatabaseDdlRequest database */ - database?: (string|null); - - /** UpdateDatabaseDdlRequest statements */ - statements?: (string[]|null); - - /** UpdateDatabaseDdlRequest operationId */ - operationId?: (string|null); - - /** UpdateDatabaseDdlRequest protoDescriptors */ - protoDescriptors?: (Uint8Array|Buffer|string|null); - - /** UpdateDatabaseDdlRequest throughputMode */ - throughputMode?: (boolean|null); - } - - /** Represents an UpdateDatabaseDdlRequest. */ - class UpdateDatabaseDdlRequest implements IUpdateDatabaseDdlRequest { - - /** - * Constructs a new UpdateDatabaseDdlRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IUpdateDatabaseDdlRequest); - - /** UpdateDatabaseDdlRequest database. */ - public database: string; - - /** UpdateDatabaseDdlRequest statements. */ - public statements: string[]; - - /** UpdateDatabaseDdlRequest operationId. */ - public operationId: string; - - /** UpdateDatabaseDdlRequest protoDescriptors. */ - public protoDescriptors: (Uint8Array|Buffer|string); - - /** UpdateDatabaseDdlRequest throughputMode. */ - public throughputMode: boolean; - - /** - * Creates a new UpdateDatabaseDdlRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateDatabaseDdlRequest instance - */ - public static create(properties?: google.spanner.admin.database.v1.IUpdateDatabaseDdlRequest): google.spanner.admin.database.v1.UpdateDatabaseDdlRequest; - - /** - * Encodes the specified UpdateDatabaseDdlRequest message. Does not implicitly {@link google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.verify|verify} messages. - * @param message UpdateDatabaseDdlRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IUpdateDatabaseDdlRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateDatabaseDdlRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.verify|verify} messages. - * @param message UpdateDatabaseDdlRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IUpdateDatabaseDdlRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateDatabaseDdlRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateDatabaseDdlRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.UpdateDatabaseDdlRequest; - - /** - * Decodes an UpdateDatabaseDdlRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateDatabaseDdlRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.UpdateDatabaseDdlRequest; - - /** - * Verifies an UpdateDatabaseDdlRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UpdateDatabaseDdlRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateDatabaseDdlRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.UpdateDatabaseDdlRequest; - - /** - * Creates a plain object from an UpdateDatabaseDdlRequest message. Also converts values to other types if specified. - * @param message UpdateDatabaseDdlRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.UpdateDatabaseDdlRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateDatabaseDdlRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateDatabaseDdlRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DdlStatementActionInfo. */ - interface IDdlStatementActionInfo { - - /** DdlStatementActionInfo action */ - action?: (string|null); - - /** DdlStatementActionInfo entityType */ - entityType?: (string|null); - - /** DdlStatementActionInfo entityNames */ - entityNames?: (string[]|null); - } - - /** Represents a DdlStatementActionInfo. */ - class DdlStatementActionInfo implements IDdlStatementActionInfo { - - /** - * Constructs a new DdlStatementActionInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IDdlStatementActionInfo); - - /** DdlStatementActionInfo action. */ - public action: string; - - /** DdlStatementActionInfo entityType. */ - public entityType: string; - - /** DdlStatementActionInfo entityNames. */ - public entityNames: string[]; - - /** - * Creates a new DdlStatementActionInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns DdlStatementActionInfo instance - */ - public static create(properties?: google.spanner.admin.database.v1.IDdlStatementActionInfo): google.spanner.admin.database.v1.DdlStatementActionInfo; - - /** - * Encodes the specified DdlStatementActionInfo message. Does not implicitly {@link google.spanner.admin.database.v1.DdlStatementActionInfo.verify|verify} messages. - * @param message DdlStatementActionInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IDdlStatementActionInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DdlStatementActionInfo message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.DdlStatementActionInfo.verify|verify} messages. - * @param message DdlStatementActionInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IDdlStatementActionInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DdlStatementActionInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DdlStatementActionInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.DdlStatementActionInfo; - - /** - * Decodes a DdlStatementActionInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DdlStatementActionInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.DdlStatementActionInfo; - - /** - * Verifies a DdlStatementActionInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DdlStatementActionInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DdlStatementActionInfo - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.DdlStatementActionInfo; - - /** - * Creates a plain object from a DdlStatementActionInfo message. Also converts values to other types if specified. - * @param message DdlStatementActionInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.DdlStatementActionInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DdlStatementActionInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DdlStatementActionInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateDatabaseDdlMetadata. */ - interface IUpdateDatabaseDdlMetadata { - - /** UpdateDatabaseDdlMetadata database */ - database?: (string|null); - - /** UpdateDatabaseDdlMetadata statements */ - statements?: (string[]|null); - - /** UpdateDatabaseDdlMetadata commitTimestamps */ - commitTimestamps?: (google.protobuf.ITimestamp[]|null); - - /** UpdateDatabaseDdlMetadata throttled */ - throttled?: (boolean|null); - - /** UpdateDatabaseDdlMetadata progress */ - progress?: (google.spanner.admin.database.v1.IOperationProgress[]|null); - - /** UpdateDatabaseDdlMetadata actions */ - actions?: (google.spanner.admin.database.v1.IDdlStatementActionInfo[]|null); - } - - /** Represents an UpdateDatabaseDdlMetadata. */ - class UpdateDatabaseDdlMetadata implements IUpdateDatabaseDdlMetadata { - - /** - * Constructs a new UpdateDatabaseDdlMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IUpdateDatabaseDdlMetadata); - - /** UpdateDatabaseDdlMetadata database. */ - public database: string; - - /** UpdateDatabaseDdlMetadata statements. */ - public statements: string[]; - - /** UpdateDatabaseDdlMetadata commitTimestamps. */ - public commitTimestamps: google.protobuf.ITimestamp[]; - - /** UpdateDatabaseDdlMetadata throttled. */ - public throttled: boolean; - - /** UpdateDatabaseDdlMetadata progress. */ - public progress: google.spanner.admin.database.v1.IOperationProgress[]; - - /** UpdateDatabaseDdlMetadata actions. */ - public actions: google.spanner.admin.database.v1.IDdlStatementActionInfo[]; - - /** - * Creates a new UpdateDatabaseDdlMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateDatabaseDdlMetadata instance - */ - public static create(properties?: google.spanner.admin.database.v1.IUpdateDatabaseDdlMetadata): google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata; - - /** - * Encodes the specified UpdateDatabaseDdlMetadata message. Does not implicitly {@link google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata.verify|verify} messages. - * @param message UpdateDatabaseDdlMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IUpdateDatabaseDdlMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateDatabaseDdlMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata.verify|verify} messages. - * @param message UpdateDatabaseDdlMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IUpdateDatabaseDdlMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateDatabaseDdlMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateDatabaseDdlMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata; - - /** - * Decodes an UpdateDatabaseDdlMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateDatabaseDdlMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata; - - /** - * Verifies an UpdateDatabaseDdlMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UpdateDatabaseDdlMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateDatabaseDdlMetadata - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata; - - /** - * Creates a plain object from an UpdateDatabaseDdlMetadata message. Also converts values to other types if specified. - * @param message UpdateDatabaseDdlMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateDatabaseDdlMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateDatabaseDdlMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DropDatabaseRequest. */ - interface IDropDatabaseRequest { - - /** DropDatabaseRequest database */ - database?: (string|null); - } - - /** Represents a DropDatabaseRequest. */ - class DropDatabaseRequest implements IDropDatabaseRequest { - - /** - * Constructs a new DropDatabaseRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IDropDatabaseRequest); - - /** DropDatabaseRequest database. */ - public database: string; - - /** - * Creates a new DropDatabaseRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DropDatabaseRequest instance - */ - public static create(properties?: google.spanner.admin.database.v1.IDropDatabaseRequest): google.spanner.admin.database.v1.DropDatabaseRequest; - - /** - * Encodes the specified DropDatabaseRequest message. Does not implicitly {@link google.spanner.admin.database.v1.DropDatabaseRequest.verify|verify} messages. - * @param message DropDatabaseRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IDropDatabaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DropDatabaseRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.DropDatabaseRequest.verify|verify} messages. - * @param message DropDatabaseRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IDropDatabaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DropDatabaseRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DropDatabaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.DropDatabaseRequest; - - /** - * Decodes a DropDatabaseRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DropDatabaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.DropDatabaseRequest; - - /** - * Verifies a DropDatabaseRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DropDatabaseRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DropDatabaseRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.DropDatabaseRequest; - - /** - * Creates a plain object from a DropDatabaseRequest message. Also converts values to other types if specified. - * @param message DropDatabaseRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.DropDatabaseRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DropDatabaseRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DropDatabaseRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetDatabaseDdlRequest. */ - interface IGetDatabaseDdlRequest { - - /** GetDatabaseDdlRequest database */ - database?: (string|null); - } - - /** Represents a GetDatabaseDdlRequest. */ - class GetDatabaseDdlRequest implements IGetDatabaseDdlRequest { - - /** - * Constructs a new GetDatabaseDdlRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IGetDatabaseDdlRequest); - - /** GetDatabaseDdlRequest database. */ - public database: string; - - /** - * Creates a new GetDatabaseDdlRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetDatabaseDdlRequest instance - */ - public static create(properties?: google.spanner.admin.database.v1.IGetDatabaseDdlRequest): google.spanner.admin.database.v1.GetDatabaseDdlRequest; - - /** - * Encodes the specified GetDatabaseDdlRequest message. Does not implicitly {@link google.spanner.admin.database.v1.GetDatabaseDdlRequest.verify|verify} messages. - * @param message GetDatabaseDdlRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IGetDatabaseDdlRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetDatabaseDdlRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.GetDatabaseDdlRequest.verify|verify} messages. - * @param message GetDatabaseDdlRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IGetDatabaseDdlRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetDatabaseDdlRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetDatabaseDdlRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.GetDatabaseDdlRequest; - - /** - * Decodes a GetDatabaseDdlRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetDatabaseDdlRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.GetDatabaseDdlRequest; - - /** - * Verifies a GetDatabaseDdlRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetDatabaseDdlRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetDatabaseDdlRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.GetDatabaseDdlRequest; - - /** - * Creates a plain object from a GetDatabaseDdlRequest message. Also converts values to other types if specified. - * @param message GetDatabaseDdlRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.GetDatabaseDdlRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetDatabaseDdlRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetDatabaseDdlRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetDatabaseDdlResponse. */ - interface IGetDatabaseDdlResponse { - - /** GetDatabaseDdlResponse statements */ - statements?: (string[]|null); - - /** GetDatabaseDdlResponse protoDescriptors */ - protoDescriptors?: (Uint8Array|Buffer|string|null); - } - - /** Represents a GetDatabaseDdlResponse. */ - class GetDatabaseDdlResponse implements IGetDatabaseDdlResponse { - - /** - * Constructs a new GetDatabaseDdlResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IGetDatabaseDdlResponse); - - /** GetDatabaseDdlResponse statements. */ - public statements: string[]; - - /** GetDatabaseDdlResponse protoDescriptors. */ - public protoDescriptors: (Uint8Array|Buffer|string); - - /** - * Creates a new GetDatabaseDdlResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns GetDatabaseDdlResponse instance - */ - public static create(properties?: google.spanner.admin.database.v1.IGetDatabaseDdlResponse): google.spanner.admin.database.v1.GetDatabaseDdlResponse; - - /** - * Encodes the specified GetDatabaseDdlResponse message. Does not implicitly {@link google.spanner.admin.database.v1.GetDatabaseDdlResponse.verify|verify} messages. - * @param message GetDatabaseDdlResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IGetDatabaseDdlResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetDatabaseDdlResponse message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.GetDatabaseDdlResponse.verify|verify} messages. - * @param message GetDatabaseDdlResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IGetDatabaseDdlResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetDatabaseDdlResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetDatabaseDdlResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.GetDatabaseDdlResponse; - - /** - * Decodes a GetDatabaseDdlResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetDatabaseDdlResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.GetDatabaseDdlResponse; - - /** - * Verifies a GetDatabaseDdlResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetDatabaseDdlResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetDatabaseDdlResponse - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.GetDatabaseDdlResponse; - - /** - * Creates a plain object from a GetDatabaseDdlResponse message. Also converts values to other types if specified. - * @param message GetDatabaseDdlResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.GetDatabaseDdlResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetDatabaseDdlResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetDatabaseDdlResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListDatabaseOperationsRequest. */ - interface IListDatabaseOperationsRequest { - - /** ListDatabaseOperationsRequest parent */ - parent?: (string|null); - - /** ListDatabaseOperationsRequest filter */ - filter?: (string|null); - - /** ListDatabaseOperationsRequest pageSize */ - pageSize?: (number|null); - - /** ListDatabaseOperationsRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListDatabaseOperationsRequest. */ - class ListDatabaseOperationsRequest implements IListDatabaseOperationsRequest { - - /** - * Constructs a new ListDatabaseOperationsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IListDatabaseOperationsRequest); - - /** ListDatabaseOperationsRequest parent. */ - public parent: string; - - /** ListDatabaseOperationsRequest filter. */ - public filter: string; - - /** ListDatabaseOperationsRequest pageSize. */ - public pageSize: number; - - /** ListDatabaseOperationsRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListDatabaseOperationsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListDatabaseOperationsRequest instance - */ - public static create(properties?: google.spanner.admin.database.v1.IListDatabaseOperationsRequest): google.spanner.admin.database.v1.ListDatabaseOperationsRequest; - - /** - * Encodes the specified ListDatabaseOperationsRequest message. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabaseOperationsRequest.verify|verify} messages. - * @param message ListDatabaseOperationsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IListDatabaseOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListDatabaseOperationsRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabaseOperationsRequest.verify|verify} messages. - * @param message ListDatabaseOperationsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IListDatabaseOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListDatabaseOperationsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListDatabaseOperationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.ListDatabaseOperationsRequest; - - /** - * Decodes a ListDatabaseOperationsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListDatabaseOperationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.ListDatabaseOperationsRequest; - - /** - * Verifies a ListDatabaseOperationsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListDatabaseOperationsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListDatabaseOperationsRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.ListDatabaseOperationsRequest; - - /** - * Creates a plain object from a ListDatabaseOperationsRequest message. Also converts values to other types if specified. - * @param message ListDatabaseOperationsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.ListDatabaseOperationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListDatabaseOperationsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListDatabaseOperationsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListDatabaseOperationsResponse. */ - interface IListDatabaseOperationsResponse { - - /** ListDatabaseOperationsResponse operations */ - operations?: (google.longrunning.IOperation[]|null); - - /** ListDatabaseOperationsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListDatabaseOperationsResponse. */ - class ListDatabaseOperationsResponse implements IListDatabaseOperationsResponse { - - /** - * Constructs a new ListDatabaseOperationsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IListDatabaseOperationsResponse); - - /** ListDatabaseOperationsResponse operations. */ - public operations: google.longrunning.IOperation[]; - - /** ListDatabaseOperationsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListDatabaseOperationsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListDatabaseOperationsResponse instance - */ - public static create(properties?: google.spanner.admin.database.v1.IListDatabaseOperationsResponse): google.spanner.admin.database.v1.ListDatabaseOperationsResponse; - - /** - * Encodes the specified ListDatabaseOperationsResponse message. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabaseOperationsResponse.verify|verify} messages. - * @param message ListDatabaseOperationsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IListDatabaseOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListDatabaseOperationsResponse message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabaseOperationsResponse.verify|verify} messages. - * @param message ListDatabaseOperationsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IListDatabaseOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListDatabaseOperationsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListDatabaseOperationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.ListDatabaseOperationsResponse; - - /** - * Decodes a ListDatabaseOperationsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListDatabaseOperationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.ListDatabaseOperationsResponse; - - /** - * Verifies a ListDatabaseOperationsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListDatabaseOperationsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListDatabaseOperationsResponse - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.ListDatabaseOperationsResponse; - - /** - * Creates a plain object from a ListDatabaseOperationsResponse message. Also converts values to other types if specified. - * @param message ListDatabaseOperationsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.ListDatabaseOperationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListDatabaseOperationsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListDatabaseOperationsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RestoreDatabaseRequest. */ - interface IRestoreDatabaseRequest { - - /** RestoreDatabaseRequest parent */ - parent?: (string|null); - - /** RestoreDatabaseRequest databaseId */ - databaseId?: (string|null); - - /** RestoreDatabaseRequest backup */ - backup?: (string|null); - - /** RestoreDatabaseRequest encryptionConfig */ - encryptionConfig?: (google.spanner.admin.database.v1.IRestoreDatabaseEncryptionConfig|null); - } - - /** Represents a RestoreDatabaseRequest. */ - class RestoreDatabaseRequest implements IRestoreDatabaseRequest { - - /** - * Constructs a new RestoreDatabaseRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IRestoreDatabaseRequest); - - /** RestoreDatabaseRequest parent. */ - public parent: string; - - /** RestoreDatabaseRequest databaseId. */ - public databaseId: string; - - /** RestoreDatabaseRequest backup. */ - public backup?: (string|null); - - /** RestoreDatabaseRequest encryptionConfig. */ - public encryptionConfig?: (google.spanner.admin.database.v1.IRestoreDatabaseEncryptionConfig|null); - - /** RestoreDatabaseRequest source. */ - public source?: "backup"; - - /** - * Creates a new RestoreDatabaseRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns RestoreDatabaseRequest instance - */ - public static create(properties?: google.spanner.admin.database.v1.IRestoreDatabaseRequest): google.spanner.admin.database.v1.RestoreDatabaseRequest; - - /** - * Encodes the specified RestoreDatabaseRequest message. Does not implicitly {@link google.spanner.admin.database.v1.RestoreDatabaseRequest.verify|verify} messages. - * @param message RestoreDatabaseRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IRestoreDatabaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RestoreDatabaseRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.RestoreDatabaseRequest.verify|verify} messages. - * @param message RestoreDatabaseRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IRestoreDatabaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RestoreDatabaseRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RestoreDatabaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.RestoreDatabaseRequest; - - /** - * Decodes a RestoreDatabaseRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RestoreDatabaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.RestoreDatabaseRequest; - - /** - * Verifies a RestoreDatabaseRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RestoreDatabaseRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RestoreDatabaseRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.RestoreDatabaseRequest; - - /** - * Creates a plain object from a RestoreDatabaseRequest message. Also converts values to other types if specified. - * @param message RestoreDatabaseRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.RestoreDatabaseRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RestoreDatabaseRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RestoreDatabaseRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RestoreDatabaseEncryptionConfig. */ - interface IRestoreDatabaseEncryptionConfig { - - /** RestoreDatabaseEncryptionConfig encryptionType */ - encryptionType?: (google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.EncryptionType|keyof typeof google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.EncryptionType|null); - - /** RestoreDatabaseEncryptionConfig kmsKeyName */ - kmsKeyName?: (string|null); - - /** RestoreDatabaseEncryptionConfig kmsKeyNames */ - kmsKeyNames?: (string[]|null); - } - - /** Represents a RestoreDatabaseEncryptionConfig. */ - class RestoreDatabaseEncryptionConfig implements IRestoreDatabaseEncryptionConfig { - - /** - * Constructs a new RestoreDatabaseEncryptionConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IRestoreDatabaseEncryptionConfig); - - /** RestoreDatabaseEncryptionConfig encryptionType. */ - public encryptionType: (google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.EncryptionType|keyof typeof google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.EncryptionType); - - /** RestoreDatabaseEncryptionConfig kmsKeyName. */ - public kmsKeyName: string; - - /** RestoreDatabaseEncryptionConfig kmsKeyNames. */ - public kmsKeyNames: string[]; - - /** - * Creates a new RestoreDatabaseEncryptionConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns RestoreDatabaseEncryptionConfig instance - */ - public static create(properties?: google.spanner.admin.database.v1.IRestoreDatabaseEncryptionConfig): google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig; - - /** - * Encodes the specified RestoreDatabaseEncryptionConfig message. Does not implicitly {@link google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.verify|verify} messages. - * @param message RestoreDatabaseEncryptionConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IRestoreDatabaseEncryptionConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RestoreDatabaseEncryptionConfig message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.verify|verify} messages. - * @param message RestoreDatabaseEncryptionConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IRestoreDatabaseEncryptionConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RestoreDatabaseEncryptionConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RestoreDatabaseEncryptionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig; - - /** - * Decodes a RestoreDatabaseEncryptionConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RestoreDatabaseEncryptionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig; - - /** - * Verifies a RestoreDatabaseEncryptionConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RestoreDatabaseEncryptionConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RestoreDatabaseEncryptionConfig - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig; - - /** - * Creates a plain object from a RestoreDatabaseEncryptionConfig message. Also converts values to other types if specified. - * @param message RestoreDatabaseEncryptionConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RestoreDatabaseEncryptionConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RestoreDatabaseEncryptionConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace RestoreDatabaseEncryptionConfig { - - /** EncryptionType enum. */ - enum EncryptionType { - ENCRYPTION_TYPE_UNSPECIFIED = 0, - USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION = 1, - GOOGLE_DEFAULT_ENCRYPTION = 2, - CUSTOMER_MANAGED_ENCRYPTION = 3 - } - } - - /** Properties of a RestoreDatabaseMetadata. */ - interface IRestoreDatabaseMetadata { - - /** RestoreDatabaseMetadata name */ - name?: (string|null); - - /** RestoreDatabaseMetadata sourceType */ - sourceType?: (google.spanner.admin.database.v1.RestoreSourceType|keyof typeof google.spanner.admin.database.v1.RestoreSourceType|null); - - /** RestoreDatabaseMetadata backupInfo */ - backupInfo?: (google.spanner.admin.database.v1.IBackupInfo|null); - - /** RestoreDatabaseMetadata progress */ - progress?: (google.spanner.admin.database.v1.IOperationProgress|null); - - /** RestoreDatabaseMetadata cancelTime */ - cancelTime?: (google.protobuf.ITimestamp|null); - - /** RestoreDatabaseMetadata optimizeDatabaseOperationName */ - optimizeDatabaseOperationName?: (string|null); - } - - /** Represents a RestoreDatabaseMetadata. */ - class RestoreDatabaseMetadata implements IRestoreDatabaseMetadata { - - /** - * Constructs a new RestoreDatabaseMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IRestoreDatabaseMetadata); - - /** RestoreDatabaseMetadata name. */ - public name: string; - - /** RestoreDatabaseMetadata sourceType. */ - public sourceType: (google.spanner.admin.database.v1.RestoreSourceType|keyof typeof google.spanner.admin.database.v1.RestoreSourceType); - - /** RestoreDatabaseMetadata backupInfo. */ - public backupInfo?: (google.spanner.admin.database.v1.IBackupInfo|null); - - /** RestoreDatabaseMetadata progress. */ - public progress?: (google.spanner.admin.database.v1.IOperationProgress|null); - - /** RestoreDatabaseMetadata cancelTime. */ - public cancelTime?: (google.protobuf.ITimestamp|null); - - /** RestoreDatabaseMetadata optimizeDatabaseOperationName. */ - public optimizeDatabaseOperationName: string; - - /** RestoreDatabaseMetadata sourceInfo. */ - public sourceInfo?: "backupInfo"; - - /** - * Creates a new RestoreDatabaseMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns RestoreDatabaseMetadata instance - */ - public static create(properties?: google.spanner.admin.database.v1.IRestoreDatabaseMetadata): google.spanner.admin.database.v1.RestoreDatabaseMetadata; - - /** - * Encodes the specified RestoreDatabaseMetadata message. Does not implicitly {@link google.spanner.admin.database.v1.RestoreDatabaseMetadata.verify|verify} messages. - * @param message RestoreDatabaseMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IRestoreDatabaseMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RestoreDatabaseMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.RestoreDatabaseMetadata.verify|verify} messages. - * @param message RestoreDatabaseMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IRestoreDatabaseMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RestoreDatabaseMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RestoreDatabaseMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.RestoreDatabaseMetadata; - - /** - * Decodes a RestoreDatabaseMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RestoreDatabaseMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.RestoreDatabaseMetadata; - - /** - * Verifies a RestoreDatabaseMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RestoreDatabaseMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RestoreDatabaseMetadata - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.RestoreDatabaseMetadata; - - /** - * Creates a plain object from a RestoreDatabaseMetadata message. Also converts values to other types if specified. - * @param message RestoreDatabaseMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.RestoreDatabaseMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RestoreDatabaseMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RestoreDatabaseMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an OptimizeRestoredDatabaseMetadata. */ - interface IOptimizeRestoredDatabaseMetadata { - - /** OptimizeRestoredDatabaseMetadata name */ - name?: (string|null); - - /** OptimizeRestoredDatabaseMetadata progress */ - progress?: (google.spanner.admin.database.v1.IOperationProgress|null); - } - - /** Represents an OptimizeRestoredDatabaseMetadata. */ - class OptimizeRestoredDatabaseMetadata implements IOptimizeRestoredDatabaseMetadata { - - /** - * Constructs a new OptimizeRestoredDatabaseMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IOptimizeRestoredDatabaseMetadata); - - /** OptimizeRestoredDatabaseMetadata name. */ - public name: string; - - /** OptimizeRestoredDatabaseMetadata progress. */ - public progress?: (google.spanner.admin.database.v1.IOperationProgress|null); - - /** - * Creates a new OptimizeRestoredDatabaseMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns OptimizeRestoredDatabaseMetadata instance - */ - public static create(properties?: google.spanner.admin.database.v1.IOptimizeRestoredDatabaseMetadata): google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata; - - /** - * Encodes the specified OptimizeRestoredDatabaseMetadata message. Does not implicitly {@link google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata.verify|verify} messages. - * @param message OptimizeRestoredDatabaseMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IOptimizeRestoredDatabaseMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OptimizeRestoredDatabaseMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata.verify|verify} messages. - * @param message OptimizeRestoredDatabaseMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IOptimizeRestoredDatabaseMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OptimizeRestoredDatabaseMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OptimizeRestoredDatabaseMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata; - - /** - * Decodes an OptimizeRestoredDatabaseMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OptimizeRestoredDatabaseMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata; - - /** - * Verifies an OptimizeRestoredDatabaseMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an OptimizeRestoredDatabaseMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OptimizeRestoredDatabaseMetadata - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata; - - /** - * Creates a plain object from an OptimizeRestoredDatabaseMetadata message. Also converts values to other types if specified. - * @param message OptimizeRestoredDatabaseMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OptimizeRestoredDatabaseMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for OptimizeRestoredDatabaseMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** RestoreSourceType enum. */ - enum RestoreSourceType { - TYPE_UNSPECIFIED = 0, - BACKUP = 1 - } - - /** Properties of a DatabaseRole. */ - interface IDatabaseRole { - - /** DatabaseRole name */ - name?: (string|null); - } - - /** Represents a DatabaseRole. */ - class DatabaseRole implements IDatabaseRole { - - /** - * Constructs a new DatabaseRole. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IDatabaseRole); - - /** DatabaseRole name. */ - public name: string; - - /** - * Creates a new DatabaseRole instance using the specified properties. - * @param [properties] Properties to set - * @returns DatabaseRole instance - */ - public static create(properties?: google.spanner.admin.database.v1.IDatabaseRole): google.spanner.admin.database.v1.DatabaseRole; - - /** - * Encodes the specified DatabaseRole message. Does not implicitly {@link google.spanner.admin.database.v1.DatabaseRole.verify|verify} messages. - * @param message DatabaseRole message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IDatabaseRole, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DatabaseRole message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.DatabaseRole.verify|verify} messages. - * @param message DatabaseRole message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IDatabaseRole, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DatabaseRole message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DatabaseRole - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.DatabaseRole; - - /** - * Decodes a DatabaseRole message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DatabaseRole - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.DatabaseRole; - - /** - * Verifies a DatabaseRole message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DatabaseRole message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DatabaseRole - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.DatabaseRole; - - /** - * Creates a plain object from a DatabaseRole message. Also converts values to other types if specified. - * @param message DatabaseRole - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.DatabaseRole, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DatabaseRole to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DatabaseRole - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListDatabaseRolesRequest. */ - interface IListDatabaseRolesRequest { - - /** ListDatabaseRolesRequest parent */ - parent?: (string|null); - - /** ListDatabaseRolesRequest pageSize */ - pageSize?: (number|null); - - /** ListDatabaseRolesRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListDatabaseRolesRequest. */ - class ListDatabaseRolesRequest implements IListDatabaseRolesRequest { - - /** - * Constructs a new ListDatabaseRolesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IListDatabaseRolesRequest); - - /** ListDatabaseRolesRequest parent. */ - public parent: string; - - /** ListDatabaseRolesRequest pageSize. */ - public pageSize: number; - - /** ListDatabaseRolesRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListDatabaseRolesRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListDatabaseRolesRequest instance - */ - public static create(properties?: google.spanner.admin.database.v1.IListDatabaseRolesRequest): google.spanner.admin.database.v1.ListDatabaseRolesRequest; - - /** - * Encodes the specified ListDatabaseRolesRequest message. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabaseRolesRequest.verify|verify} messages. - * @param message ListDatabaseRolesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IListDatabaseRolesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListDatabaseRolesRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabaseRolesRequest.verify|verify} messages. - * @param message ListDatabaseRolesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IListDatabaseRolesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListDatabaseRolesRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListDatabaseRolesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.ListDatabaseRolesRequest; - - /** - * Decodes a ListDatabaseRolesRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListDatabaseRolesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.ListDatabaseRolesRequest; - - /** - * Verifies a ListDatabaseRolesRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListDatabaseRolesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListDatabaseRolesRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.ListDatabaseRolesRequest; - - /** - * Creates a plain object from a ListDatabaseRolesRequest message. Also converts values to other types if specified. - * @param message ListDatabaseRolesRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.ListDatabaseRolesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListDatabaseRolesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListDatabaseRolesRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListDatabaseRolesResponse. */ - interface IListDatabaseRolesResponse { - - /** ListDatabaseRolesResponse databaseRoles */ - databaseRoles?: (google.spanner.admin.database.v1.IDatabaseRole[]|null); - - /** ListDatabaseRolesResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListDatabaseRolesResponse. */ - class ListDatabaseRolesResponse implements IListDatabaseRolesResponse { - - /** - * Constructs a new ListDatabaseRolesResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IListDatabaseRolesResponse); - - /** ListDatabaseRolesResponse databaseRoles. */ - public databaseRoles: google.spanner.admin.database.v1.IDatabaseRole[]; - - /** ListDatabaseRolesResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListDatabaseRolesResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListDatabaseRolesResponse instance - */ - public static create(properties?: google.spanner.admin.database.v1.IListDatabaseRolesResponse): google.spanner.admin.database.v1.ListDatabaseRolesResponse; - - /** - * Encodes the specified ListDatabaseRolesResponse message. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabaseRolesResponse.verify|verify} messages. - * @param message ListDatabaseRolesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IListDatabaseRolesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListDatabaseRolesResponse message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabaseRolesResponse.verify|verify} messages. - * @param message ListDatabaseRolesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IListDatabaseRolesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListDatabaseRolesResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListDatabaseRolesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.ListDatabaseRolesResponse; - - /** - * Decodes a ListDatabaseRolesResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListDatabaseRolesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.ListDatabaseRolesResponse; - - /** - * Verifies a ListDatabaseRolesResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListDatabaseRolesResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListDatabaseRolesResponse - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.ListDatabaseRolesResponse; - - /** - * Creates a plain object from a ListDatabaseRolesResponse message. Also converts values to other types if specified. - * @param message ListDatabaseRolesResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.ListDatabaseRolesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListDatabaseRolesResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListDatabaseRolesResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an AddSplitPointsRequest. */ - interface IAddSplitPointsRequest { - - /** AddSplitPointsRequest database */ - database?: (string|null); - - /** AddSplitPointsRequest splitPoints */ - splitPoints?: (google.spanner.admin.database.v1.ISplitPoints[]|null); - - /** AddSplitPointsRequest initiator */ - initiator?: (string|null); - } - - /** Represents an AddSplitPointsRequest. */ - class AddSplitPointsRequest implements IAddSplitPointsRequest { - - /** - * Constructs a new AddSplitPointsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IAddSplitPointsRequest); - - /** AddSplitPointsRequest database. */ - public database: string; - - /** AddSplitPointsRequest splitPoints. */ - public splitPoints: google.spanner.admin.database.v1.ISplitPoints[]; - - /** AddSplitPointsRequest initiator. */ - public initiator: string; - - /** - * Creates a new AddSplitPointsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns AddSplitPointsRequest instance - */ - public static create(properties?: google.spanner.admin.database.v1.IAddSplitPointsRequest): google.spanner.admin.database.v1.AddSplitPointsRequest; - - /** - * Encodes the specified AddSplitPointsRequest message. Does not implicitly {@link google.spanner.admin.database.v1.AddSplitPointsRequest.verify|verify} messages. - * @param message AddSplitPointsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IAddSplitPointsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AddSplitPointsRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.AddSplitPointsRequest.verify|verify} messages. - * @param message AddSplitPointsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IAddSplitPointsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AddSplitPointsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AddSplitPointsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.AddSplitPointsRequest; - - /** - * Decodes an AddSplitPointsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AddSplitPointsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.AddSplitPointsRequest; - - /** - * Verifies an AddSplitPointsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an AddSplitPointsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AddSplitPointsRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.AddSplitPointsRequest; - - /** - * Creates a plain object from an AddSplitPointsRequest message. Also converts values to other types if specified. - * @param message AddSplitPointsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.AddSplitPointsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AddSplitPointsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AddSplitPointsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an AddSplitPointsResponse. */ - interface IAddSplitPointsResponse { - } - - /** Represents an AddSplitPointsResponse. */ - class AddSplitPointsResponse implements IAddSplitPointsResponse { - - /** - * Constructs a new AddSplitPointsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IAddSplitPointsResponse); - - /** - * Creates a new AddSplitPointsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns AddSplitPointsResponse instance - */ - public static create(properties?: google.spanner.admin.database.v1.IAddSplitPointsResponse): google.spanner.admin.database.v1.AddSplitPointsResponse; - - /** - * Encodes the specified AddSplitPointsResponse message. Does not implicitly {@link google.spanner.admin.database.v1.AddSplitPointsResponse.verify|verify} messages. - * @param message AddSplitPointsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IAddSplitPointsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AddSplitPointsResponse message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.AddSplitPointsResponse.verify|verify} messages. - * @param message AddSplitPointsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IAddSplitPointsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AddSplitPointsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AddSplitPointsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.AddSplitPointsResponse; - - /** - * Decodes an AddSplitPointsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AddSplitPointsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.AddSplitPointsResponse; - - /** - * Verifies an AddSplitPointsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an AddSplitPointsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AddSplitPointsResponse - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.AddSplitPointsResponse; - - /** - * Creates a plain object from an AddSplitPointsResponse message. Also converts values to other types if specified. - * @param message AddSplitPointsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.AddSplitPointsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AddSplitPointsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AddSplitPointsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a SplitPoints. */ - interface ISplitPoints { - - /** SplitPoints table */ - table?: (string|null); - - /** SplitPoints index */ - index?: (string|null); - - /** SplitPoints keys */ - keys?: (google.spanner.admin.database.v1.SplitPoints.IKey[]|null); - - /** SplitPoints expireTime */ - expireTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a SplitPoints. */ - class SplitPoints implements ISplitPoints { - - /** - * Constructs a new SplitPoints. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.ISplitPoints); - - /** SplitPoints table. */ - public table: string; - - /** SplitPoints index. */ - public index: string; - - /** SplitPoints keys. */ - public keys: google.spanner.admin.database.v1.SplitPoints.IKey[]; - - /** SplitPoints expireTime. */ - public expireTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new SplitPoints instance using the specified properties. - * @param [properties] Properties to set - * @returns SplitPoints instance - */ - public static create(properties?: google.spanner.admin.database.v1.ISplitPoints): google.spanner.admin.database.v1.SplitPoints; - - /** - * Encodes the specified SplitPoints message. Does not implicitly {@link google.spanner.admin.database.v1.SplitPoints.verify|verify} messages. - * @param message SplitPoints message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.ISplitPoints, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SplitPoints message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.SplitPoints.verify|verify} messages. - * @param message SplitPoints message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.ISplitPoints, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SplitPoints message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SplitPoints - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.SplitPoints; - - /** - * Decodes a SplitPoints message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SplitPoints - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.SplitPoints; - - /** - * Verifies a SplitPoints message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SplitPoints message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SplitPoints - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.SplitPoints; - - /** - * Creates a plain object from a SplitPoints message. Also converts values to other types if specified. - * @param message SplitPoints - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.SplitPoints, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SplitPoints to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SplitPoints - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace SplitPoints { - - /** Properties of a Key. */ - interface IKey { - - /** Key keyParts */ - keyParts?: (google.protobuf.IListValue|null); - } - - /** Represents a Key. */ - class Key implements IKey { - - /** - * Constructs a new Key. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.SplitPoints.IKey); - - /** Key keyParts. */ - public keyParts?: (google.protobuf.IListValue|null); - - /** - * Creates a new Key instance using the specified properties. - * @param [properties] Properties to set - * @returns Key instance - */ - public static create(properties?: google.spanner.admin.database.v1.SplitPoints.IKey): google.spanner.admin.database.v1.SplitPoints.Key; - - /** - * Encodes the specified Key message. Does not implicitly {@link google.spanner.admin.database.v1.SplitPoints.Key.verify|verify} messages. - * @param message Key message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.SplitPoints.IKey, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Key message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.SplitPoints.Key.verify|verify} messages. - * @param message Key message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.SplitPoints.IKey, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Key message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Key - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.SplitPoints.Key; - - /** - * Decodes a Key message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Key - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.SplitPoints.Key; - - /** - * Verifies a Key message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Key message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Key - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.SplitPoints.Key; - - /** - * Creates a plain object from a Key message. Also converts values to other types if specified. - * @param message Key - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.SplitPoints.Key, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Key to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Key - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an InternalUpdateGraphOperationRequest. */ - interface IInternalUpdateGraphOperationRequest { - - /** InternalUpdateGraphOperationRequest database */ - database?: (string|null); - - /** InternalUpdateGraphOperationRequest operationId */ - operationId?: (string|null); - - /** InternalUpdateGraphOperationRequest vmIdentityToken */ - vmIdentityToken?: (string|null); - - /** InternalUpdateGraphOperationRequest progress */ - progress?: (number|null); - - /** InternalUpdateGraphOperationRequest status */ - status?: (google.rpc.IStatus|null); - } - - /** Represents an InternalUpdateGraphOperationRequest. */ - class InternalUpdateGraphOperationRequest implements IInternalUpdateGraphOperationRequest { - - /** - * Constructs a new InternalUpdateGraphOperationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IInternalUpdateGraphOperationRequest); - - /** InternalUpdateGraphOperationRequest database. */ - public database: string; - - /** InternalUpdateGraphOperationRequest operationId. */ - public operationId: string; - - /** InternalUpdateGraphOperationRequest vmIdentityToken. */ - public vmIdentityToken: string; - - /** InternalUpdateGraphOperationRequest progress. */ - public progress: number; - - /** InternalUpdateGraphOperationRequest status. */ - public status?: (google.rpc.IStatus|null); - - /** - * Creates a new InternalUpdateGraphOperationRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns InternalUpdateGraphOperationRequest instance - */ - public static create(properties?: google.spanner.admin.database.v1.IInternalUpdateGraphOperationRequest): google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest; - - /** - * Encodes the specified InternalUpdateGraphOperationRequest message. Does not implicitly {@link google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest.verify|verify} messages. - * @param message InternalUpdateGraphOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IInternalUpdateGraphOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified InternalUpdateGraphOperationRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest.verify|verify} messages. - * @param message InternalUpdateGraphOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IInternalUpdateGraphOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an InternalUpdateGraphOperationRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns InternalUpdateGraphOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest; - - /** - * Decodes an InternalUpdateGraphOperationRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns InternalUpdateGraphOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest; - - /** - * Verifies an InternalUpdateGraphOperationRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an InternalUpdateGraphOperationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns InternalUpdateGraphOperationRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest; - - /** - * Creates a plain object from an InternalUpdateGraphOperationRequest message. Also converts values to other types if specified. - * @param message InternalUpdateGraphOperationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this InternalUpdateGraphOperationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for InternalUpdateGraphOperationRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an InternalUpdateGraphOperationResponse. */ - interface IInternalUpdateGraphOperationResponse { - } - - /** Represents an InternalUpdateGraphOperationResponse. */ - class InternalUpdateGraphOperationResponse implements IInternalUpdateGraphOperationResponse { - - /** - * Constructs a new InternalUpdateGraphOperationResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.database.v1.IInternalUpdateGraphOperationResponse); - - /** - * Creates a new InternalUpdateGraphOperationResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns InternalUpdateGraphOperationResponse instance - */ - public static create(properties?: google.spanner.admin.database.v1.IInternalUpdateGraphOperationResponse): google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse; - - /** - * Encodes the specified InternalUpdateGraphOperationResponse message. Does not implicitly {@link google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse.verify|verify} messages. - * @param message InternalUpdateGraphOperationResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.database.v1.IInternalUpdateGraphOperationResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified InternalUpdateGraphOperationResponse message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse.verify|verify} messages. - * @param message InternalUpdateGraphOperationResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.database.v1.IInternalUpdateGraphOperationResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an InternalUpdateGraphOperationResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns InternalUpdateGraphOperationResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse; - - /** - * Decodes an InternalUpdateGraphOperationResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns InternalUpdateGraphOperationResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse; - - /** - * Verifies an InternalUpdateGraphOperationResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an InternalUpdateGraphOperationResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns InternalUpdateGraphOperationResponse - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse; - - /** - * Creates a plain object from an InternalUpdateGraphOperationResponse message. Also converts values to other types if specified. - * @param message InternalUpdateGraphOperationResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this InternalUpdateGraphOperationResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for InternalUpdateGraphOperationResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - } - - /** Namespace instance. */ - namespace instance { - - /** Namespace v1. */ - namespace v1 { - - /** Properties of an OperationProgress. */ - interface IOperationProgress { - - /** OperationProgress progressPercent */ - progressPercent?: (number|null); - - /** OperationProgress startTime */ - startTime?: (google.protobuf.ITimestamp|null); - - /** OperationProgress endTime */ - endTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents an OperationProgress. */ - class OperationProgress implements IOperationProgress { - - /** - * Constructs a new OperationProgress. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.instance.v1.IOperationProgress); - - /** OperationProgress progressPercent. */ - public progressPercent: number; - - /** OperationProgress startTime. */ - public startTime?: (google.protobuf.ITimestamp|null); - - /** OperationProgress endTime. */ - public endTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new OperationProgress instance using the specified properties. - * @param [properties] Properties to set - * @returns OperationProgress instance - */ - public static create(properties?: google.spanner.admin.instance.v1.IOperationProgress): google.spanner.admin.instance.v1.OperationProgress; - - /** - * Encodes the specified OperationProgress message. Does not implicitly {@link google.spanner.admin.instance.v1.OperationProgress.verify|verify} messages. - * @param message OperationProgress message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.instance.v1.IOperationProgress, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OperationProgress message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.OperationProgress.verify|verify} messages. - * @param message OperationProgress message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.instance.v1.IOperationProgress, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OperationProgress message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OperationProgress - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.OperationProgress; - - /** - * Decodes an OperationProgress message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OperationProgress - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.OperationProgress; - - /** - * Verifies an OperationProgress message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an OperationProgress message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OperationProgress - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.OperationProgress; - - /** - * Creates a plain object from an OperationProgress message. Also converts values to other types if specified. - * @param message OperationProgress - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.instance.v1.OperationProgress, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OperationProgress to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for OperationProgress - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** FulfillmentPeriod enum. */ - enum FulfillmentPeriod { - FULFILLMENT_PERIOD_UNSPECIFIED = 0, - FULFILLMENT_PERIOD_NORMAL = 1, - FULFILLMENT_PERIOD_EXTENDED = 2 - } - - /** Properties of a ReplicaSelection. */ - interface IReplicaSelection { - - /** ReplicaSelection location */ - location?: (string|null); - } - - /** Represents a ReplicaSelection. */ - class ReplicaSelection implements IReplicaSelection { - - /** - * Constructs a new ReplicaSelection. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.instance.v1.IReplicaSelection); - - /** ReplicaSelection location. */ - public location: string; - - /** - * Creates a new ReplicaSelection instance using the specified properties. - * @param [properties] Properties to set - * @returns ReplicaSelection instance - */ - public static create(properties?: google.spanner.admin.instance.v1.IReplicaSelection): google.spanner.admin.instance.v1.ReplicaSelection; - - /** - * Encodes the specified ReplicaSelection message. Does not implicitly {@link google.spanner.admin.instance.v1.ReplicaSelection.verify|verify} messages. - * @param message ReplicaSelection message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.instance.v1.IReplicaSelection, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ReplicaSelection message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ReplicaSelection.verify|verify} messages. - * @param message ReplicaSelection message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.instance.v1.IReplicaSelection, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ReplicaSelection message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ReplicaSelection - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.ReplicaSelection; - - /** - * Decodes a ReplicaSelection message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ReplicaSelection - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.ReplicaSelection; - - /** - * Verifies a ReplicaSelection message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ReplicaSelection message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ReplicaSelection - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.ReplicaSelection; - - /** - * Creates a plain object from a ReplicaSelection message. Also converts values to other types if specified. - * @param message ReplicaSelection - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.instance.v1.ReplicaSelection, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ReplicaSelection to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ReplicaSelection - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Represents an InstanceAdmin */ - class InstanceAdmin extends $protobuf.rpc.Service { - - /** - * Constructs a new InstanceAdmin service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - - /** - * Creates new InstanceAdmin 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): InstanceAdmin; - - /** - * Calls ListInstanceConfigs. - * @param request ListInstanceConfigsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListInstanceConfigsResponse - */ - public listInstanceConfigs(request: google.spanner.admin.instance.v1.IListInstanceConfigsRequest, callback: google.spanner.admin.instance.v1.InstanceAdmin.ListInstanceConfigsCallback): void; - - /** - * Calls ListInstanceConfigs. - * @param request ListInstanceConfigsRequest message or plain object - * @returns Promise - */ - public listInstanceConfigs(request: google.spanner.admin.instance.v1.IListInstanceConfigsRequest): Promise; - - /** - * Calls GetInstanceConfig. - * @param request GetInstanceConfigRequest message or plain object - * @param callback Node-style callback called with the error, if any, and InstanceConfig - */ - public getInstanceConfig(request: google.spanner.admin.instance.v1.IGetInstanceConfigRequest, callback: google.spanner.admin.instance.v1.InstanceAdmin.GetInstanceConfigCallback): void; - - /** - * Calls GetInstanceConfig. - * @param request GetInstanceConfigRequest message or plain object - * @returns Promise - */ - public getInstanceConfig(request: google.spanner.admin.instance.v1.IGetInstanceConfigRequest): Promise; - - /** - * Calls CreateInstanceConfig. - * @param request CreateInstanceConfigRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public createInstanceConfig(request: google.spanner.admin.instance.v1.ICreateInstanceConfigRequest, callback: google.spanner.admin.instance.v1.InstanceAdmin.CreateInstanceConfigCallback): void; - - /** - * Calls CreateInstanceConfig. - * @param request CreateInstanceConfigRequest message or plain object - * @returns Promise - */ - public createInstanceConfig(request: google.spanner.admin.instance.v1.ICreateInstanceConfigRequest): Promise; - - /** - * Calls UpdateInstanceConfig. - * @param request UpdateInstanceConfigRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public updateInstanceConfig(request: google.spanner.admin.instance.v1.IUpdateInstanceConfigRequest, callback: google.spanner.admin.instance.v1.InstanceAdmin.UpdateInstanceConfigCallback): void; - - /** - * Calls UpdateInstanceConfig. - * @param request UpdateInstanceConfigRequest message or plain object - * @returns Promise - */ - public updateInstanceConfig(request: google.spanner.admin.instance.v1.IUpdateInstanceConfigRequest): Promise; - - /** - * Calls DeleteInstanceConfig. - * @param request DeleteInstanceConfigRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteInstanceConfig(request: google.spanner.admin.instance.v1.IDeleteInstanceConfigRequest, callback: google.spanner.admin.instance.v1.InstanceAdmin.DeleteInstanceConfigCallback): void; - - /** - * Calls DeleteInstanceConfig. - * @param request DeleteInstanceConfigRequest message or plain object - * @returns Promise - */ - public deleteInstanceConfig(request: google.spanner.admin.instance.v1.IDeleteInstanceConfigRequest): Promise; - - /** - * Calls ListInstanceConfigOperations. - * @param request ListInstanceConfigOperationsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListInstanceConfigOperationsResponse - */ - public listInstanceConfigOperations(request: google.spanner.admin.instance.v1.IListInstanceConfigOperationsRequest, callback: google.spanner.admin.instance.v1.InstanceAdmin.ListInstanceConfigOperationsCallback): void; - - /** - * Calls ListInstanceConfigOperations. - * @param request ListInstanceConfigOperationsRequest message or plain object - * @returns Promise - */ - public listInstanceConfigOperations(request: google.spanner.admin.instance.v1.IListInstanceConfigOperationsRequest): Promise; - - /** - * Calls ListInstances. - * @param request ListInstancesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListInstancesResponse - */ - public listInstances(request: google.spanner.admin.instance.v1.IListInstancesRequest, callback: google.spanner.admin.instance.v1.InstanceAdmin.ListInstancesCallback): void; - - /** - * Calls ListInstances. - * @param request ListInstancesRequest message or plain object - * @returns Promise - */ - public listInstances(request: google.spanner.admin.instance.v1.IListInstancesRequest): Promise; - - /** - * Calls ListInstancePartitions. - * @param request ListInstancePartitionsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListInstancePartitionsResponse - */ - public listInstancePartitions(request: google.spanner.admin.instance.v1.IListInstancePartitionsRequest, callback: google.spanner.admin.instance.v1.InstanceAdmin.ListInstancePartitionsCallback): void; - - /** - * Calls ListInstancePartitions. - * @param request ListInstancePartitionsRequest message or plain object - * @returns Promise - */ - public listInstancePartitions(request: google.spanner.admin.instance.v1.IListInstancePartitionsRequest): Promise; - - /** - * Calls GetInstance. - * @param request GetInstanceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Instance - */ - public getInstance(request: google.spanner.admin.instance.v1.IGetInstanceRequest, callback: google.spanner.admin.instance.v1.InstanceAdmin.GetInstanceCallback): void; - - /** - * Calls GetInstance. - * @param request GetInstanceRequest message or plain object - * @returns Promise - */ - public getInstance(request: google.spanner.admin.instance.v1.IGetInstanceRequest): Promise; - - /** - * 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.spanner.admin.instance.v1.ICreateInstanceRequest, callback: google.spanner.admin.instance.v1.InstanceAdmin.CreateInstanceCallback): void; - - /** - * Calls CreateInstance. - * @param request CreateInstanceRequest message or plain object - * @returns Promise - */ - public createInstance(request: google.spanner.admin.instance.v1.ICreateInstanceRequest): Promise; - - /** - * Calls UpdateInstance. - * @param request UpdateInstanceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public updateInstance(request: google.spanner.admin.instance.v1.IUpdateInstanceRequest, callback: google.spanner.admin.instance.v1.InstanceAdmin.UpdateInstanceCallback): void; - - /** - * Calls UpdateInstance. - * @param request UpdateInstanceRequest message or plain object - * @returns Promise - */ - public updateInstance(request: google.spanner.admin.instance.v1.IUpdateInstanceRequest): Promise; - - /** - * Calls DeleteInstance. - * @param request DeleteInstanceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteInstance(request: google.spanner.admin.instance.v1.IDeleteInstanceRequest, callback: google.spanner.admin.instance.v1.InstanceAdmin.DeleteInstanceCallback): void; - - /** - * Calls DeleteInstance. - * @param request DeleteInstanceRequest message or plain object - * @returns Promise - */ - public deleteInstance(request: google.spanner.admin.instance.v1.IDeleteInstanceRequest): Promise; - - /** - * Calls SetIamPolicy. - * @param request SetIamPolicyRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Policy - */ - public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest, callback: google.spanner.admin.instance.v1.InstanceAdmin.SetIamPolicyCallback): void; - - /** - * Calls SetIamPolicy. - * @param request SetIamPolicyRequest message or plain object - * @returns Promise - */ - public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest): Promise; - - /** - * Calls GetIamPolicy. - * @param request GetIamPolicyRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Policy - */ - public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest, callback: google.spanner.admin.instance.v1.InstanceAdmin.GetIamPolicyCallback): void; - - /** - * Calls GetIamPolicy. - * @param request GetIamPolicyRequest message or plain object - * @returns Promise - */ - public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest): Promise; - - /** - * Calls TestIamPermissions. - * @param request TestIamPermissionsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and TestIamPermissionsResponse - */ - public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest, callback: google.spanner.admin.instance.v1.InstanceAdmin.TestIamPermissionsCallback): void; - - /** - * Calls TestIamPermissions. - * @param request TestIamPermissionsRequest message or plain object - * @returns Promise - */ - public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest): Promise; - - /** - * Calls GetInstancePartition. - * @param request GetInstancePartitionRequest message or plain object - * @param callback Node-style callback called with the error, if any, and InstancePartition - */ - public getInstancePartition(request: google.spanner.admin.instance.v1.IGetInstancePartitionRequest, callback: google.spanner.admin.instance.v1.InstanceAdmin.GetInstancePartitionCallback): void; - - /** - * Calls GetInstancePartition. - * @param request GetInstancePartitionRequest message or plain object - * @returns Promise - */ - public getInstancePartition(request: google.spanner.admin.instance.v1.IGetInstancePartitionRequest): Promise; - - /** - * Calls CreateInstancePartition. - * @param request CreateInstancePartitionRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public createInstancePartition(request: google.spanner.admin.instance.v1.ICreateInstancePartitionRequest, callback: google.spanner.admin.instance.v1.InstanceAdmin.CreateInstancePartitionCallback): void; - - /** - * Calls CreateInstancePartition. - * @param request CreateInstancePartitionRequest message or plain object - * @returns Promise - */ - public createInstancePartition(request: google.spanner.admin.instance.v1.ICreateInstancePartitionRequest): Promise; - - /** - * Calls DeleteInstancePartition. - * @param request DeleteInstancePartitionRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteInstancePartition(request: google.spanner.admin.instance.v1.IDeleteInstancePartitionRequest, callback: google.spanner.admin.instance.v1.InstanceAdmin.DeleteInstancePartitionCallback): void; - - /** - * Calls DeleteInstancePartition. - * @param request DeleteInstancePartitionRequest message or plain object - * @returns Promise - */ - public deleteInstancePartition(request: google.spanner.admin.instance.v1.IDeleteInstancePartitionRequest): Promise; - - /** - * Calls UpdateInstancePartition. - * @param request UpdateInstancePartitionRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public updateInstancePartition(request: google.spanner.admin.instance.v1.IUpdateInstancePartitionRequest, callback: google.spanner.admin.instance.v1.InstanceAdmin.UpdateInstancePartitionCallback): void; - - /** - * Calls UpdateInstancePartition. - * @param request UpdateInstancePartitionRequest message or plain object - * @returns Promise - */ - public updateInstancePartition(request: google.spanner.admin.instance.v1.IUpdateInstancePartitionRequest): Promise; - - /** - * Calls ListInstancePartitionOperations. - * @param request ListInstancePartitionOperationsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListInstancePartitionOperationsResponse - */ - public listInstancePartitionOperations(request: google.spanner.admin.instance.v1.IListInstancePartitionOperationsRequest, callback: google.spanner.admin.instance.v1.InstanceAdmin.ListInstancePartitionOperationsCallback): void; - - /** - * Calls ListInstancePartitionOperations. - * @param request ListInstancePartitionOperationsRequest message or plain object - * @returns Promise - */ - public listInstancePartitionOperations(request: google.spanner.admin.instance.v1.IListInstancePartitionOperationsRequest): Promise; - - /** - * Calls MoveInstance. - * @param request MoveInstanceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public moveInstance(request: google.spanner.admin.instance.v1.IMoveInstanceRequest, callback: google.spanner.admin.instance.v1.InstanceAdmin.MoveInstanceCallback): void; - - /** - * Calls MoveInstance. - * @param request MoveInstanceRequest message or plain object - * @returns Promise - */ - public moveInstance(request: google.spanner.admin.instance.v1.IMoveInstanceRequest): Promise; - } - - namespace InstanceAdmin { - - /** - * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|listInstanceConfigs}. - * @param error Error, if any - * @param [response] ListInstanceConfigsResponse - */ - type ListInstanceConfigsCallback = (error: (Error|null), response?: google.spanner.admin.instance.v1.ListInstanceConfigsResponse) => void; - - /** - * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|getInstanceConfig}. - * @param error Error, if any - * @param [response] InstanceConfig - */ - type GetInstanceConfigCallback = (error: (Error|null), response?: google.spanner.admin.instance.v1.InstanceConfig) => void; - - /** - * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|createInstanceConfig}. - * @param error Error, if any - * @param [response] Operation - */ - type CreateInstanceConfigCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|updateInstanceConfig}. - * @param error Error, if any - * @param [response] Operation - */ - type UpdateInstanceConfigCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|deleteInstanceConfig}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteInstanceConfigCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|listInstanceConfigOperations}. - * @param error Error, if any - * @param [response] ListInstanceConfigOperationsResponse - */ - type ListInstanceConfigOperationsCallback = (error: (Error|null), response?: google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse) => void; - - /** - * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|listInstances}. - * @param error Error, if any - * @param [response] ListInstancesResponse - */ - type ListInstancesCallback = (error: (Error|null), response?: google.spanner.admin.instance.v1.ListInstancesResponse) => void; - - /** - * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|listInstancePartitions}. - * @param error Error, if any - * @param [response] ListInstancePartitionsResponse - */ - type ListInstancePartitionsCallback = (error: (Error|null), response?: google.spanner.admin.instance.v1.ListInstancePartitionsResponse) => void; - - /** - * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|getInstance}. - * @param error Error, if any - * @param [response] Instance - */ - type GetInstanceCallback = (error: (Error|null), response?: google.spanner.admin.instance.v1.Instance) => void; - - /** - * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|createInstance}. - * @param error Error, if any - * @param [response] Operation - */ - type CreateInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|updateInstance}. - * @param error Error, if any - * @param [response] Operation - */ - type UpdateInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|deleteInstance}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteInstanceCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|setIamPolicy}. - * @param error Error, if any - * @param [response] Policy - */ - type SetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; - - /** - * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|getIamPolicy}. - * @param error Error, if any - * @param [response] Policy - */ - type GetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; - - /** - * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|testIamPermissions}. - * @param error Error, if any - * @param [response] TestIamPermissionsResponse - */ - type TestIamPermissionsCallback = (error: (Error|null), response?: google.iam.v1.TestIamPermissionsResponse) => void; - - /** - * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|getInstancePartition}. - * @param error Error, if any - * @param [response] InstancePartition - */ - type GetInstancePartitionCallback = (error: (Error|null), response?: google.spanner.admin.instance.v1.InstancePartition) => void; - - /** - * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|createInstancePartition}. - * @param error Error, if any - * @param [response] Operation - */ - type CreateInstancePartitionCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|deleteInstancePartition}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteInstancePartitionCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|updateInstancePartition}. - * @param error Error, if any - * @param [response] Operation - */ - type UpdateInstancePartitionCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|listInstancePartitionOperations}. - * @param error Error, if any - * @param [response] ListInstancePartitionOperationsResponse - */ - type ListInstancePartitionOperationsCallback = (error: (Error|null), response?: google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse) => void; - - /** - * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|moveInstance}. - * @param error Error, if any - * @param [response] Operation - */ - type MoveInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - } - - /** Properties of a ReplicaInfo. */ - interface IReplicaInfo { - - /** ReplicaInfo location */ - location?: (string|null); - - /** ReplicaInfo type */ - type?: (google.spanner.admin.instance.v1.ReplicaInfo.ReplicaType|keyof typeof google.spanner.admin.instance.v1.ReplicaInfo.ReplicaType|null); - - /** ReplicaInfo defaultLeaderLocation */ - defaultLeaderLocation?: (boolean|null); - } - - /** Represents a ReplicaInfo. */ - class ReplicaInfo implements IReplicaInfo { - - /** - * Constructs a new ReplicaInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.instance.v1.IReplicaInfo); - - /** ReplicaInfo location. */ - public location: string; - - /** ReplicaInfo type. */ - public type: (google.spanner.admin.instance.v1.ReplicaInfo.ReplicaType|keyof typeof google.spanner.admin.instance.v1.ReplicaInfo.ReplicaType); - - /** ReplicaInfo defaultLeaderLocation. */ - public defaultLeaderLocation: boolean; - - /** - * Creates a new ReplicaInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns ReplicaInfo instance - */ - public static create(properties?: google.spanner.admin.instance.v1.IReplicaInfo): google.spanner.admin.instance.v1.ReplicaInfo; - - /** - * Encodes the specified ReplicaInfo message. Does not implicitly {@link google.spanner.admin.instance.v1.ReplicaInfo.verify|verify} messages. - * @param message ReplicaInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.instance.v1.IReplicaInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ReplicaInfo message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ReplicaInfo.verify|verify} messages. - * @param message ReplicaInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.instance.v1.IReplicaInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ReplicaInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ReplicaInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.ReplicaInfo; - - /** - * Decodes a ReplicaInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ReplicaInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.ReplicaInfo; - - /** - * Verifies a ReplicaInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ReplicaInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ReplicaInfo - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.ReplicaInfo; - - /** - * Creates a plain object from a ReplicaInfo message. Also converts values to other types if specified. - * @param message ReplicaInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.instance.v1.ReplicaInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ReplicaInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ReplicaInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ReplicaInfo { - - /** ReplicaType enum. */ - enum ReplicaType { - TYPE_UNSPECIFIED = 0, - READ_WRITE = 1, - READ_ONLY = 2, - WITNESS = 3 - } - } - - /** Properties of an InstanceConfig. */ - interface IInstanceConfig { - - /** InstanceConfig name */ - name?: (string|null); - - /** InstanceConfig displayName */ - displayName?: (string|null); - - /** InstanceConfig configType */ - configType?: (google.spanner.admin.instance.v1.InstanceConfig.Type|keyof typeof google.spanner.admin.instance.v1.InstanceConfig.Type|null); - - /** InstanceConfig replicas */ - replicas?: (google.spanner.admin.instance.v1.IReplicaInfo[]|null); - - /** InstanceConfig optionalReplicas */ - optionalReplicas?: (google.spanner.admin.instance.v1.IReplicaInfo[]|null); - - /** InstanceConfig baseConfig */ - baseConfig?: (string|null); - - /** InstanceConfig labels */ - labels?: ({ [k: string]: string }|null); - - /** InstanceConfig etag */ - etag?: (string|null); - - /** InstanceConfig leaderOptions */ - leaderOptions?: (string[]|null); - - /** InstanceConfig reconciling */ - reconciling?: (boolean|null); - - /** InstanceConfig state */ - state?: (google.spanner.admin.instance.v1.InstanceConfig.State|keyof typeof google.spanner.admin.instance.v1.InstanceConfig.State|null); - - /** InstanceConfig freeInstanceAvailability */ - freeInstanceAvailability?: (google.spanner.admin.instance.v1.InstanceConfig.FreeInstanceAvailability|keyof typeof google.spanner.admin.instance.v1.InstanceConfig.FreeInstanceAvailability|null); - - /** InstanceConfig quorumType */ - quorumType?: (google.spanner.admin.instance.v1.InstanceConfig.QuorumType|keyof typeof google.spanner.admin.instance.v1.InstanceConfig.QuorumType|null); - - /** InstanceConfig storageLimitPerProcessingUnit */ - storageLimitPerProcessingUnit?: (number|Long|string|null); - } - - /** Represents an InstanceConfig. */ - class InstanceConfig implements IInstanceConfig { - - /** - * Constructs a new InstanceConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.instance.v1.IInstanceConfig); - - /** InstanceConfig name. */ - public name: string; - - /** InstanceConfig displayName. */ - public displayName: string; - - /** InstanceConfig configType. */ - public configType: (google.spanner.admin.instance.v1.InstanceConfig.Type|keyof typeof google.spanner.admin.instance.v1.InstanceConfig.Type); - - /** InstanceConfig replicas. */ - public replicas: google.spanner.admin.instance.v1.IReplicaInfo[]; - - /** InstanceConfig optionalReplicas. */ - public optionalReplicas: google.spanner.admin.instance.v1.IReplicaInfo[]; - - /** InstanceConfig baseConfig. */ - public baseConfig: string; - - /** InstanceConfig labels. */ - public labels: { [k: string]: string }; - - /** InstanceConfig etag. */ - public etag: string; - - /** InstanceConfig leaderOptions. */ - public leaderOptions: string[]; - - /** InstanceConfig reconciling. */ - public reconciling: boolean; - - /** InstanceConfig state. */ - public state: (google.spanner.admin.instance.v1.InstanceConfig.State|keyof typeof google.spanner.admin.instance.v1.InstanceConfig.State); - - /** InstanceConfig freeInstanceAvailability. */ - public freeInstanceAvailability: (google.spanner.admin.instance.v1.InstanceConfig.FreeInstanceAvailability|keyof typeof google.spanner.admin.instance.v1.InstanceConfig.FreeInstanceAvailability); - - /** InstanceConfig quorumType. */ - public quorumType: (google.spanner.admin.instance.v1.InstanceConfig.QuorumType|keyof typeof google.spanner.admin.instance.v1.InstanceConfig.QuorumType); - - /** InstanceConfig storageLimitPerProcessingUnit. */ - public storageLimitPerProcessingUnit: (number|Long|string); - - /** - * Creates a new InstanceConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns InstanceConfig instance - */ - public static create(properties?: google.spanner.admin.instance.v1.IInstanceConfig): google.spanner.admin.instance.v1.InstanceConfig; - - /** - * Encodes the specified InstanceConfig message. Does not implicitly {@link google.spanner.admin.instance.v1.InstanceConfig.verify|verify} messages. - * @param message InstanceConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.instance.v1.IInstanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified InstanceConfig message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.InstanceConfig.verify|verify} messages. - * @param message InstanceConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.instance.v1.IInstanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an InstanceConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns InstanceConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.InstanceConfig; - - /** - * Decodes an InstanceConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns InstanceConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.InstanceConfig; - - /** - * Verifies an InstanceConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an InstanceConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns InstanceConfig - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.InstanceConfig; - - /** - * Creates a plain object from an InstanceConfig message. Also converts values to other types if specified. - * @param message InstanceConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.instance.v1.InstanceConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this InstanceConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for InstanceConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace InstanceConfig { - - /** Type enum. */ - enum Type { - TYPE_UNSPECIFIED = 0, - GOOGLE_MANAGED = 1, - USER_MANAGED = 2 - } - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - CREATING = 1, - READY = 2 - } - - /** FreeInstanceAvailability enum. */ - enum FreeInstanceAvailability { - FREE_INSTANCE_AVAILABILITY_UNSPECIFIED = 0, - AVAILABLE = 1, - UNSUPPORTED = 2, - DISABLED = 3, - QUOTA_EXCEEDED = 4 - } - - /** QuorumType enum. */ - enum QuorumType { - QUORUM_TYPE_UNSPECIFIED = 0, - REGION = 1, - DUAL_REGION = 2, - MULTI_REGION = 3 - } - } - - /** Properties of a ReplicaComputeCapacity. */ - interface IReplicaComputeCapacity { - - /** ReplicaComputeCapacity replicaSelection */ - replicaSelection?: (google.spanner.admin.instance.v1.IReplicaSelection|null); - - /** ReplicaComputeCapacity nodeCount */ - nodeCount?: (number|null); - - /** ReplicaComputeCapacity processingUnits */ - processingUnits?: (number|null); - } - - /** Represents a ReplicaComputeCapacity. */ - class ReplicaComputeCapacity implements IReplicaComputeCapacity { - - /** - * Constructs a new ReplicaComputeCapacity. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.instance.v1.IReplicaComputeCapacity); - - /** ReplicaComputeCapacity replicaSelection. */ - public replicaSelection?: (google.spanner.admin.instance.v1.IReplicaSelection|null); - - /** ReplicaComputeCapacity nodeCount. */ - public nodeCount?: (number|null); - - /** ReplicaComputeCapacity processingUnits. */ - public processingUnits?: (number|null); - - /** ReplicaComputeCapacity computeCapacity. */ - public computeCapacity?: ("nodeCount"|"processingUnits"); - - /** - * Creates a new ReplicaComputeCapacity instance using the specified properties. - * @param [properties] Properties to set - * @returns ReplicaComputeCapacity instance - */ - public static create(properties?: google.spanner.admin.instance.v1.IReplicaComputeCapacity): google.spanner.admin.instance.v1.ReplicaComputeCapacity; - - /** - * Encodes the specified ReplicaComputeCapacity message. Does not implicitly {@link google.spanner.admin.instance.v1.ReplicaComputeCapacity.verify|verify} messages. - * @param message ReplicaComputeCapacity message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.instance.v1.IReplicaComputeCapacity, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ReplicaComputeCapacity message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ReplicaComputeCapacity.verify|verify} messages. - * @param message ReplicaComputeCapacity message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.instance.v1.IReplicaComputeCapacity, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ReplicaComputeCapacity message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ReplicaComputeCapacity - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.ReplicaComputeCapacity; - - /** - * Decodes a ReplicaComputeCapacity message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ReplicaComputeCapacity - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.ReplicaComputeCapacity; - - /** - * Verifies a ReplicaComputeCapacity message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ReplicaComputeCapacity message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ReplicaComputeCapacity - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.ReplicaComputeCapacity; - - /** - * Creates a plain object from a ReplicaComputeCapacity message. Also converts values to other types if specified. - * @param message ReplicaComputeCapacity - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.instance.v1.ReplicaComputeCapacity, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ReplicaComputeCapacity to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ReplicaComputeCapacity - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an AutoscalingConfig. */ - interface IAutoscalingConfig { - - /** AutoscalingConfig autoscalingLimits */ - autoscalingLimits?: (google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingLimits|null); - - /** AutoscalingConfig autoscalingTargets */ - autoscalingTargets?: (google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingTargets|null); - - /** AutoscalingConfig asymmetricAutoscalingOptions */ - asymmetricAutoscalingOptions?: (google.spanner.admin.instance.v1.AutoscalingConfig.IAsymmetricAutoscalingOption[]|null); - } - - /** Represents an AutoscalingConfig. */ - class AutoscalingConfig implements IAutoscalingConfig { - - /** - * Constructs a new AutoscalingConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.instance.v1.IAutoscalingConfig); - - /** AutoscalingConfig autoscalingLimits. */ - public autoscalingLimits?: (google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingLimits|null); - - /** AutoscalingConfig autoscalingTargets. */ - public autoscalingTargets?: (google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingTargets|null); - - /** AutoscalingConfig asymmetricAutoscalingOptions. */ - public asymmetricAutoscalingOptions: google.spanner.admin.instance.v1.AutoscalingConfig.IAsymmetricAutoscalingOption[]; - - /** - * Creates a new AutoscalingConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns AutoscalingConfig instance - */ - public static create(properties?: google.spanner.admin.instance.v1.IAutoscalingConfig): google.spanner.admin.instance.v1.AutoscalingConfig; - - /** - * Encodes the specified AutoscalingConfig message. Does not implicitly {@link google.spanner.admin.instance.v1.AutoscalingConfig.verify|verify} messages. - * @param message AutoscalingConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.instance.v1.IAutoscalingConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AutoscalingConfig message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.AutoscalingConfig.verify|verify} messages. - * @param message AutoscalingConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.instance.v1.IAutoscalingConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AutoscalingConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AutoscalingConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.AutoscalingConfig; - - /** - * Decodes an AutoscalingConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AutoscalingConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.AutoscalingConfig; - - /** - * Verifies an AutoscalingConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an AutoscalingConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AutoscalingConfig - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.AutoscalingConfig; - - /** - * Creates a plain object from an AutoscalingConfig message. Also converts values to other types if specified. - * @param message AutoscalingConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.instance.v1.AutoscalingConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AutoscalingConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AutoscalingConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace AutoscalingConfig { - - /** Properties of an AutoscalingLimits. */ - interface IAutoscalingLimits { - - /** AutoscalingLimits minNodes */ - minNodes?: (number|null); - - /** AutoscalingLimits minProcessingUnits */ - minProcessingUnits?: (number|null); - - /** AutoscalingLimits maxNodes */ - maxNodes?: (number|null); - - /** AutoscalingLimits maxProcessingUnits */ - maxProcessingUnits?: (number|null); - } - - /** Represents an AutoscalingLimits. */ - class AutoscalingLimits implements IAutoscalingLimits { - - /** - * Constructs a new AutoscalingLimits. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingLimits); - - /** AutoscalingLimits minNodes. */ - public minNodes?: (number|null); - - /** AutoscalingLimits minProcessingUnits. */ - public minProcessingUnits?: (number|null); - - /** AutoscalingLimits maxNodes. */ - public maxNodes?: (number|null); - - /** AutoscalingLimits maxProcessingUnits. */ - public maxProcessingUnits?: (number|null); - - /** AutoscalingLimits minLimit. */ - public minLimit?: ("minNodes"|"minProcessingUnits"); - - /** AutoscalingLimits maxLimit. */ - public maxLimit?: ("maxNodes"|"maxProcessingUnits"); - - /** - * Creates a new AutoscalingLimits instance using the specified properties. - * @param [properties] Properties to set - * @returns AutoscalingLimits instance - */ - public static create(properties?: google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingLimits): google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits; - - /** - * Encodes the specified AutoscalingLimits message. Does not implicitly {@link google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits.verify|verify} messages. - * @param message AutoscalingLimits message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingLimits, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AutoscalingLimits message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits.verify|verify} messages. - * @param message AutoscalingLimits message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingLimits, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AutoscalingLimits message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AutoscalingLimits - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits; - - /** - * Decodes an AutoscalingLimits message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AutoscalingLimits - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits; - - /** - * Verifies an AutoscalingLimits message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an AutoscalingLimits message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AutoscalingLimits - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits; - - /** - * Creates a plain object from an AutoscalingLimits message. Also converts values to other types if specified. - * @param message AutoscalingLimits - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AutoscalingLimits to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AutoscalingLimits - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an AutoscalingTargets. */ - interface IAutoscalingTargets { - - /** AutoscalingTargets highPriorityCpuUtilizationPercent */ - highPriorityCpuUtilizationPercent?: (number|null); - - /** AutoscalingTargets totalCpuUtilizationPercent */ - totalCpuUtilizationPercent?: (number|null); - - /** AutoscalingTargets storageUtilizationPercent */ - storageUtilizationPercent?: (number|null); - } - - /** Represents an AutoscalingTargets. */ - class AutoscalingTargets implements IAutoscalingTargets { - - /** - * Constructs a new AutoscalingTargets. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingTargets); - - /** AutoscalingTargets highPriorityCpuUtilizationPercent. */ - public highPriorityCpuUtilizationPercent: number; - - /** AutoscalingTargets totalCpuUtilizationPercent. */ - public totalCpuUtilizationPercent: number; - - /** AutoscalingTargets storageUtilizationPercent. */ - public storageUtilizationPercent: number; - - /** - * Creates a new AutoscalingTargets instance using the specified properties. - * @param [properties] Properties to set - * @returns AutoscalingTargets instance - */ - public static create(properties?: google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingTargets): google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets; - - /** - * Encodes the specified AutoscalingTargets message. Does not implicitly {@link google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets.verify|verify} messages. - * @param message AutoscalingTargets message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingTargets, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AutoscalingTargets message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets.verify|verify} messages. - * @param message AutoscalingTargets message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingTargets, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AutoscalingTargets message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AutoscalingTargets - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets; - - /** - * Decodes an AutoscalingTargets message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AutoscalingTargets - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets; - - /** - * Verifies an AutoscalingTargets message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an AutoscalingTargets message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AutoscalingTargets - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets; - - /** - * Creates a plain object from an AutoscalingTargets message. Also converts values to other types if specified. - * @param message AutoscalingTargets - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AutoscalingTargets to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AutoscalingTargets - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an AsymmetricAutoscalingOption. */ - interface IAsymmetricAutoscalingOption { - - /** AsymmetricAutoscalingOption replicaSelection */ - replicaSelection?: (google.spanner.admin.instance.v1.IReplicaSelection|null); - - /** AsymmetricAutoscalingOption overrides */ - overrides?: (google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.IAutoscalingConfigOverrides|null); - } - - /** Represents an AsymmetricAutoscalingOption. */ - class AsymmetricAutoscalingOption implements IAsymmetricAutoscalingOption { - - /** - * Constructs a new AsymmetricAutoscalingOption. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.instance.v1.AutoscalingConfig.IAsymmetricAutoscalingOption); - - /** AsymmetricAutoscalingOption replicaSelection. */ - public replicaSelection?: (google.spanner.admin.instance.v1.IReplicaSelection|null); - - /** AsymmetricAutoscalingOption overrides. */ - public overrides?: (google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.IAutoscalingConfigOverrides|null); - - /** - * Creates a new AsymmetricAutoscalingOption instance using the specified properties. - * @param [properties] Properties to set - * @returns AsymmetricAutoscalingOption instance - */ - public static create(properties?: google.spanner.admin.instance.v1.AutoscalingConfig.IAsymmetricAutoscalingOption): google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption; - - /** - * Encodes the specified AsymmetricAutoscalingOption message. Does not implicitly {@link google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.verify|verify} messages. - * @param message AsymmetricAutoscalingOption message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.instance.v1.AutoscalingConfig.IAsymmetricAutoscalingOption, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AsymmetricAutoscalingOption message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.verify|verify} messages. - * @param message AsymmetricAutoscalingOption message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.instance.v1.AutoscalingConfig.IAsymmetricAutoscalingOption, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AsymmetricAutoscalingOption message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AsymmetricAutoscalingOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption; - - /** - * Decodes an AsymmetricAutoscalingOption message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AsymmetricAutoscalingOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption; - - /** - * Verifies an AsymmetricAutoscalingOption message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an AsymmetricAutoscalingOption message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AsymmetricAutoscalingOption - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption; - - /** - * Creates a plain object from an AsymmetricAutoscalingOption message. Also converts values to other types if specified. - * @param message AsymmetricAutoscalingOption - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AsymmetricAutoscalingOption to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AsymmetricAutoscalingOption - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace AsymmetricAutoscalingOption { - - /** Properties of an AutoscalingConfigOverrides. */ - interface IAutoscalingConfigOverrides { - - /** AutoscalingConfigOverrides autoscalingLimits */ - autoscalingLimits?: (google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingLimits|null); - - /** AutoscalingConfigOverrides autoscalingTargetHighPriorityCpuUtilizationPercent */ - autoscalingTargetHighPriorityCpuUtilizationPercent?: (number|null); - - /** AutoscalingConfigOverrides autoscalingTargetTotalCpuUtilizationPercent */ - autoscalingTargetTotalCpuUtilizationPercent?: (number|null); - - /** AutoscalingConfigOverrides disableHighPriorityCpuAutoscaling */ - disableHighPriorityCpuAutoscaling?: (boolean|null); - - /** AutoscalingConfigOverrides disableTotalCpuAutoscaling */ - disableTotalCpuAutoscaling?: (boolean|null); - } - - /** Represents an AutoscalingConfigOverrides. */ - class AutoscalingConfigOverrides implements IAutoscalingConfigOverrides { - - /** - * Constructs a new AutoscalingConfigOverrides. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.IAutoscalingConfigOverrides); - - /** AutoscalingConfigOverrides autoscalingLimits. */ - public autoscalingLimits?: (google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingLimits|null); - - /** AutoscalingConfigOverrides autoscalingTargetHighPriorityCpuUtilizationPercent. */ - public autoscalingTargetHighPriorityCpuUtilizationPercent: number; - - /** AutoscalingConfigOverrides autoscalingTargetTotalCpuUtilizationPercent. */ - public autoscalingTargetTotalCpuUtilizationPercent: number; - - /** AutoscalingConfigOverrides disableHighPriorityCpuAutoscaling. */ - public disableHighPriorityCpuAutoscaling: boolean; - - /** AutoscalingConfigOverrides disableTotalCpuAutoscaling. */ - public disableTotalCpuAutoscaling: boolean; - - /** - * Creates a new AutoscalingConfigOverrides instance using the specified properties. - * @param [properties] Properties to set - * @returns AutoscalingConfigOverrides instance - */ - public static create(properties?: google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.IAutoscalingConfigOverrides): google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides; - - /** - * Encodes the specified AutoscalingConfigOverrides message. Does not implicitly {@link google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides.verify|verify} messages. - * @param message AutoscalingConfigOverrides message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.IAutoscalingConfigOverrides, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AutoscalingConfigOverrides message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides.verify|verify} messages. - * @param message AutoscalingConfigOverrides message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.IAutoscalingConfigOverrides, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AutoscalingConfigOverrides message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AutoscalingConfigOverrides - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides; - - /** - * Decodes an AutoscalingConfigOverrides message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AutoscalingConfigOverrides - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides; - - /** - * Verifies an AutoscalingConfigOverrides message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an AutoscalingConfigOverrides message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AutoscalingConfigOverrides - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides; - - /** - * Creates a plain object from an AutoscalingConfigOverrides message. Also converts values to other types if specified. - * @param message AutoscalingConfigOverrides - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AutoscalingConfigOverrides to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AutoscalingConfigOverrides - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - } - - /** Properties of an Instance. */ - interface IInstance { - - /** Instance name */ - name?: (string|null); - - /** Instance config */ - config?: (string|null); - - /** Instance displayName */ - displayName?: (string|null); - - /** Instance nodeCount */ - nodeCount?: (number|null); - - /** Instance processingUnits */ - processingUnits?: (number|null); - - /** Instance replicaComputeCapacity */ - replicaComputeCapacity?: (google.spanner.admin.instance.v1.IReplicaComputeCapacity[]|null); - - /** Instance autoscalingConfig */ - autoscalingConfig?: (google.spanner.admin.instance.v1.IAutoscalingConfig|null); - - /** Instance state */ - state?: (google.spanner.admin.instance.v1.Instance.State|keyof typeof google.spanner.admin.instance.v1.Instance.State|null); - - /** Instance labels */ - labels?: ({ [k: string]: string }|null); - - /** Instance instanceType */ - instanceType?: (google.spanner.admin.instance.v1.Instance.InstanceType|keyof typeof google.spanner.admin.instance.v1.Instance.InstanceType|null); - - /** Instance endpointUris */ - endpointUris?: (string[]|null); - - /** Instance createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** Instance updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** Instance freeInstanceMetadata */ - freeInstanceMetadata?: (google.spanner.admin.instance.v1.IFreeInstanceMetadata|null); - - /** Instance edition */ - edition?: (google.spanner.admin.instance.v1.Instance.Edition|keyof typeof google.spanner.admin.instance.v1.Instance.Edition|null); - - /** Instance defaultBackupScheduleType */ - defaultBackupScheduleType?: (google.spanner.admin.instance.v1.Instance.DefaultBackupScheduleType|keyof typeof google.spanner.admin.instance.v1.Instance.DefaultBackupScheduleType|null); - } - - /** Represents an Instance. */ - class Instance implements IInstance { - - /** - * Constructs a new Instance. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.instance.v1.IInstance); - - /** Instance name. */ - public name: string; - - /** Instance config. */ - public config: string; - - /** Instance displayName. */ - public displayName: string; - - /** Instance nodeCount. */ - public nodeCount: number; - - /** Instance processingUnits. */ - public processingUnits: number; - - /** Instance replicaComputeCapacity. */ - public replicaComputeCapacity: google.spanner.admin.instance.v1.IReplicaComputeCapacity[]; - - /** Instance autoscalingConfig. */ - public autoscalingConfig?: (google.spanner.admin.instance.v1.IAutoscalingConfig|null); - - /** Instance state. */ - public state: (google.spanner.admin.instance.v1.Instance.State|keyof typeof google.spanner.admin.instance.v1.Instance.State); - - /** Instance labels. */ - public labels: { [k: string]: string }; - - /** Instance instanceType. */ - public instanceType: (google.spanner.admin.instance.v1.Instance.InstanceType|keyof typeof google.spanner.admin.instance.v1.Instance.InstanceType); - - /** Instance endpointUris. */ - public endpointUris: string[]; - - /** Instance createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** Instance updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** Instance freeInstanceMetadata. */ - public freeInstanceMetadata?: (google.spanner.admin.instance.v1.IFreeInstanceMetadata|null); - - /** Instance edition. */ - public edition: (google.spanner.admin.instance.v1.Instance.Edition|keyof typeof google.spanner.admin.instance.v1.Instance.Edition); - - /** Instance defaultBackupScheduleType. */ - public defaultBackupScheduleType: (google.spanner.admin.instance.v1.Instance.DefaultBackupScheduleType|keyof typeof google.spanner.admin.instance.v1.Instance.DefaultBackupScheduleType); - - /** - * Creates a new Instance instance using the specified properties. - * @param [properties] Properties to set - * @returns Instance instance - */ - public static create(properties?: google.spanner.admin.instance.v1.IInstance): google.spanner.admin.instance.v1.Instance; - - /** - * Encodes the specified Instance message. Does not implicitly {@link google.spanner.admin.instance.v1.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.spanner.admin.instance.v1.IInstance, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Instance message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.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.spanner.admin.instance.v1.IInstance, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Instance message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Instance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.Instance; - - /** - * Decodes an Instance message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Instance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.Instance; - - /** - * Verifies an Instance message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Instance message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Instance - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.Instance; - - /** - * Creates a plain object from an Instance message. Also converts values to other types if specified. - * @param message Instance - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.instance.v1.Instance, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Instance to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Instance - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Instance { - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - CREATING = 1, - READY = 2 - } - - /** InstanceType enum. */ - enum InstanceType { - INSTANCE_TYPE_UNSPECIFIED = 0, - PROVISIONED = 1, - FREE_INSTANCE = 2 - } - - /** Edition enum. */ - enum Edition { - EDITION_UNSPECIFIED = 0, - STANDARD = 1, - ENTERPRISE = 2, - ENTERPRISE_PLUS = 3 - } - - /** DefaultBackupScheduleType enum. */ - enum DefaultBackupScheduleType { - DEFAULT_BACKUP_SCHEDULE_TYPE_UNSPECIFIED = 0, - NONE = 1, - AUTOMATIC = 2 - } - } - - /** Properties of a ListInstanceConfigsRequest. */ - interface IListInstanceConfigsRequest { - - /** ListInstanceConfigsRequest parent */ - parent?: (string|null); - - /** ListInstanceConfigsRequest pageSize */ - pageSize?: (number|null); - - /** ListInstanceConfigsRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListInstanceConfigsRequest. */ - class ListInstanceConfigsRequest implements IListInstanceConfigsRequest { - - /** - * Constructs a new ListInstanceConfigsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.instance.v1.IListInstanceConfigsRequest); - - /** ListInstanceConfigsRequest parent. */ - public parent: string; - - /** ListInstanceConfigsRequest pageSize. */ - public pageSize: number; - - /** ListInstanceConfigsRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListInstanceConfigsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListInstanceConfigsRequest instance - */ - public static create(properties?: google.spanner.admin.instance.v1.IListInstanceConfigsRequest): google.spanner.admin.instance.v1.ListInstanceConfigsRequest; - - /** - * Encodes the specified ListInstanceConfigsRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstanceConfigsRequest.verify|verify} messages. - * @param message ListInstanceConfigsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.instance.v1.IListInstanceConfigsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListInstanceConfigsRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstanceConfigsRequest.verify|verify} messages. - * @param message ListInstanceConfigsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.instance.v1.IListInstanceConfigsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListInstanceConfigsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListInstanceConfigsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.ListInstanceConfigsRequest; - - /** - * Decodes a ListInstanceConfigsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListInstanceConfigsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.ListInstanceConfigsRequest; - - /** - * Verifies a ListInstanceConfigsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListInstanceConfigsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListInstanceConfigsRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.ListInstanceConfigsRequest; - - /** - * Creates a plain object from a ListInstanceConfigsRequest message. Also converts values to other types if specified. - * @param message ListInstanceConfigsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.instance.v1.ListInstanceConfigsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListInstanceConfigsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListInstanceConfigsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListInstanceConfigsResponse. */ - interface IListInstanceConfigsResponse { - - /** ListInstanceConfigsResponse instanceConfigs */ - instanceConfigs?: (google.spanner.admin.instance.v1.IInstanceConfig[]|null); - - /** ListInstanceConfigsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListInstanceConfigsResponse. */ - class ListInstanceConfigsResponse implements IListInstanceConfigsResponse { - - /** - * Constructs a new ListInstanceConfigsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.instance.v1.IListInstanceConfigsResponse); - - /** ListInstanceConfigsResponse instanceConfigs. */ - public instanceConfigs: google.spanner.admin.instance.v1.IInstanceConfig[]; - - /** ListInstanceConfigsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListInstanceConfigsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListInstanceConfigsResponse instance - */ - public static create(properties?: google.spanner.admin.instance.v1.IListInstanceConfigsResponse): google.spanner.admin.instance.v1.ListInstanceConfigsResponse; - - /** - * Encodes the specified ListInstanceConfigsResponse message. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstanceConfigsResponse.verify|verify} messages. - * @param message ListInstanceConfigsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.instance.v1.IListInstanceConfigsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListInstanceConfigsResponse message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstanceConfigsResponse.verify|verify} messages. - * @param message ListInstanceConfigsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.instance.v1.IListInstanceConfigsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListInstanceConfigsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListInstanceConfigsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.ListInstanceConfigsResponse; - - /** - * Decodes a ListInstanceConfigsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListInstanceConfigsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.ListInstanceConfigsResponse; - - /** - * Verifies a ListInstanceConfigsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListInstanceConfigsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListInstanceConfigsResponse - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.ListInstanceConfigsResponse; - - /** - * Creates a plain object from a ListInstanceConfigsResponse message. Also converts values to other types if specified. - * @param message ListInstanceConfigsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.instance.v1.ListInstanceConfigsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListInstanceConfigsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListInstanceConfigsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetInstanceConfigRequest. */ - interface IGetInstanceConfigRequest { - - /** GetInstanceConfigRequest name */ - name?: (string|null); - } - - /** Represents a GetInstanceConfigRequest. */ - class GetInstanceConfigRequest implements IGetInstanceConfigRequest { - - /** - * Constructs a new GetInstanceConfigRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.instance.v1.IGetInstanceConfigRequest); - - /** GetInstanceConfigRequest name. */ - public name: string; - - /** - * Creates a new GetInstanceConfigRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetInstanceConfigRequest instance - */ - public static create(properties?: google.spanner.admin.instance.v1.IGetInstanceConfigRequest): google.spanner.admin.instance.v1.GetInstanceConfigRequest; - - /** - * Encodes the specified GetInstanceConfigRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.GetInstanceConfigRequest.verify|verify} messages. - * @param message GetInstanceConfigRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.instance.v1.IGetInstanceConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetInstanceConfigRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.GetInstanceConfigRequest.verify|verify} messages. - * @param message GetInstanceConfigRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.instance.v1.IGetInstanceConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetInstanceConfigRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetInstanceConfigRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.GetInstanceConfigRequest; - - /** - * Decodes a GetInstanceConfigRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetInstanceConfigRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.GetInstanceConfigRequest; - - /** - * Verifies a GetInstanceConfigRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetInstanceConfigRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetInstanceConfigRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.GetInstanceConfigRequest; - - /** - * Creates a plain object from a GetInstanceConfigRequest message. Also converts values to other types if specified. - * @param message GetInstanceConfigRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.instance.v1.GetInstanceConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetInstanceConfigRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetInstanceConfigRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateInstanceConfigRequest. */ - interface ICreateInstanceConfigRequest { - - /** CreateInstanceConfigRequest parent */ - parent?: (string|null); - - /** CreateInstanceConfigRequest instanceConfigId */ - instanceConfigId?: (string|null); - - /** CreateInstanceConfigRequest instanceConfig */ - instanceConfig?: (google.spanner.admin.instance.v1.IInstanceConfig|null); - - /** CreateInstanceConfigRequest validateOnly */ - validateOnly?: (boolean|null); - } - - /** Represents a CreateInstanceConfigRequest. */ - class CreateInstanceConfigRequest implements ICreateInstanceConfigRequest { - - /** - * Constructs a new CreateInstanceConfigRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.instance.v1.ICreateInstanceConfigRequest); - - /** CreateInstanceConfigRequest parent. */ - public parent: string; - - /** CreateInstanceConfigRequest instanceConfigId. */ - public instanceConfigId: string; - - /** CreateInstanceConfigRequest instanceConfig. */ - public instanceConfig?: (google.spanner.admin.instance.v1.IInstanceConfig|null); - - /** CreateInstanceConfigRequest validateOnly. */ - public validateOnly: boolean; - - /** - * Creates a new CreateInstanceConfigRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateInstanceConfigRequest instance - */ - public static create(properties?: google.spanner.admin.instance.v1.ICreateInstanceConfigRequest): google.spanner.admin.instance.v1.CreateInstanceConfigRequest; - - /** - * Encodes the specified CreateInstanceConfigRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.CreateInstanceConfigRequest.verify|verify} messages. - * @param message CreateInstanceConfigRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.instance.v1.ICreateInstanceConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateInstanceConfigRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.CreateInstanceConfigRequest.verify|verify} messages. - * @param message CreateInstanceConfigRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.instance.v1.ICreateInstanceConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateInstanceConfigRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateInstanceConfigRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.CreateInstanceConfigRequest; - - /** - * Decodes a CreateInstanceConfigRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateInstanceConfigRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.CreateInstanceConfigRequest; - - /** - * Verifies a CreateInstanceConfigRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateInstanceConfigRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateInstanceConfigRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.CreateInstanceConfigRequest; - - /** - * Creates a plain object from a CreateInstanceConfigRequest message. Also converts values to other types if specified. - * @param message CreateInstanceConfigRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.instance.v1.CreateInstanceConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateInstanceConfigRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateInstanceConfigRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateInstanceConfigRequest. */ - interface IUpdateInstanceConfigRequest { - - /** UpdateInstanceConfigRequest instanceConfig */ - instanceConfig?: (google.spanner.admin.instance.v1.IInstanceConfig|null); - - /** UpdateInstanceConfigRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - - /** UpdateInstanceConfigRequest validateOnly */ - validateOnly?: (boolean|null); - } - - /** Represents an UpdateInstanceConfigRequest. */ - class UpdateInstanceConfigRequest implements IUpdateInstanceConfigRequest { - - /** - * Constructs a new UpdateInstanceConfigRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.instance.v1.IUpdateInstanceConfigRequest); - - /** UpdateInstanceConfigRequest instanceConfig. */ - public instanceConfig?: (google.spanner.admin.instance.v1.IInstanceConfig|null); - - /** UpdateInstanceConfigRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** UpdateInstanceConfigRequest validateOnly. */ - public validateOnly: boolean; - - /** - * Creates a new UpdateInstanceConfigRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateInstanceConfigRequest instance - */ - public static create(properties?: google.spanner.admin.instance.v1.IUpdateInstanceConfigRequest): google.spanner.admin.instance.v1.UpdateInstanceConfigRequest; - - /** - * Encodes the specified UpdateInstanceConfigRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.UpdateInstanceConfigRequest.verify|verify} messages. - * @param message UpdateInstanceConfigRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.instance.v1.IUpdateInstanceConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateInstanceConfigRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.UpdateInstanceConfigRequest.verify|verify} messages. - * @param message UpdateInstanceConfigRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.instance.v1.IUpdateInstanceConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateInstanceConfigRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateInstanceConfigRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.UpdateInstanceConfigRequest; - - /** - * Decodes an UpdateInstanceConfigRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateInstanceConfigRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.UpdateInstanceConfigRequest; - - /** - * Verifies an UpdateInstanceConfigRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UpdateInstanceConfigRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateInstanceConfigRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.UpdateInstanceConfigRequest; - - /** - * Creates a plain object from an UpdateInstanceConfigRequest message. Also converts values to other types if specified. - * @param message UpdateInstanceConfigRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.instance.v1.UpdateInstanceConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateInstanceConfigRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateInstanceConfigRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteInstanceConfigRequest. */ - interface IDeleteInstanceConfigRequest { - - /** DeleteInstanceConfigRequest name */ - name?: (string|null); - - /** DeleteInstanceConfigRequest etag */ - etag?: (string|null); - - /** DeleteInstanceConfigRequest validateOnly */ - validateOnly?: (boolean|null); - } - - /** Represents a DeleteInstanceConfigRequest. */ - class DeleteInstanceConfigRequest implements IDeleteInstanceConfigRequest { - - /** - * Constructs a new DeleteInstanceConfigRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.instance.v1.IDeleteInstanceConfigRequest); - - /** DeleteInstanceConfigRequest name. */ - public name: string; - - /** DeleteInstanceConfigRequest etag. */ - public etag: string; - - /** DeleteInstanceConfigRequest validateOnly. */ - public validateOnly: boolean; - - /** - * Creates a new DeleteInstanceConfigRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteInstanceConfigRequest instance - */ - public static create(properties?: google.spanner.admin.instance.v1.IDeleteInstanceConfigRequest): google.spanner.admin.instance.v1.DeleteInstanceConfigRequest; - - /** - * Encodes the specified DeleteInstanceConfigRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.DeleteInstanceConfigRequest.verify|verify} messages. - * @param message DeleteInstanceConfigRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.instance.v1.IDeleteInstanceConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteInstanceConfigRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.DeleteInstanceConfigRequest.verify|verify} messages. - * @param message DeleteInstanceConfigRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.instance.v1.IDeleteInstanceConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteInstanceConfigRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteInstanceConfigRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.DeleteInstanceConfigRequest; - - /** - * Decodes a DeleteInstanceConfigRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteInstanceConfigRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.DeleteInstanceConfigRequest; - - /** - * Verifies a DeleteInstanceConfigRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteInstanceConfigRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteInstanceConfigRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.DeleteInstanceConfigRequest; - - /** - * Creates a plain object from a DeleteInstanceConfigRequest message. Also converts values to other types if specified. - * @param message DeleteInstanceConfigRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.instance.v1.DeleteInstanceConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteInstanceConfigRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteInstanceConfigRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListInstanceConfigOperationsRequest. */ - interface IListInstanceConfigOperationsRequest { - - /** ListInstanceConfigOperationsRequest parent */ - parent?: (string|null); - - /** ListInstanceConfigOperationsRequest filter */ - filter?: (string|null); - - /** ListInstanceConfigOperationsRequest pageSize */ - pageSize?: (number|null); - - /** ListInstanceConfigOperationsRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListInstanceConfigOperationsRequest. */ - class ListInstanceConfigOperationsRequest implements IListInstanceConfigOperationsRequest { - - /** - * Constructs a new ListInstanceConfigOperationsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.instance.v1.IListInstanceConfigOperationsRequest); - - /** ListInstanceConfigOperationsRequest parent. */ - public parent: string; - - /** ListInstanceConfigOperationsRequest filter. */ - public filter: string; - - /** ListInstanceConfigOperationsRequest pageSize. */ - public pageSize: number; - - /** ListInstanceConfigOperationsRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListInstanceConfigOperationsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListInstanceConfigOperationsRequest instance - */ - public static create(properties?: google.spanner.admin.instance.v1.IListInstanceConfigOperationsRequest): google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest; - - /** - * Encodes the specified ListInstanceConfigOperationsRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest.verify|verify} messages. - * @param message ListInstanceConfigOperationsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.instance.v1.IListInstanceConfigOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListInstanceConfigOperationsRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest.verify|verify} messages. - * @param message ListInstanceConfigOperationsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.instance.v1.IListInstanceConfigOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListInstanceConfigOperationsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListInstanceConfigOperationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest; - - /** - * Decodes a ListInstanceConfigOperationsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListInstanceConfigOperationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest; - - /** - * Verifies a ListInstanceConfigOperationsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListInstanceConfigOperationsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListInstanceConfigOperationsRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest; - - /** - * Creates a plain object from a ListInstanceConfigOperationsRequest message. Also converts values to other types if specified. - * @param message ListInstanceConfigOperationsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListInstanceConfigOperationsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListInstanceConfigOperationsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListInstanceConfigOperationsResponse. */ - interface IListInstanceConfigOperationsResponse { - - /** ListInstanceConfigOperationsResponse operations */ - operations?: (google.longrunning.IOperation[]|null); - - /** ListInstanceConfigOperationsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListInstanceConfigOperationsResponse. */ - class ListInstanceConfigOperationsResponse implements IListInstanceConfigOperationsResponse { - - /** - * Constructs a new ListInstanceConfigOperationsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.instance.v1.IListInstanceConfigOperationsResponse); - - /** ListInstanceConfigOperationsResponse operations. */ - public operations: google.longrunning.IOperation[]; - - /** ListInstanceConfigOperationsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListInstanceConfigOperationsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListInstanceConfigOperationsResponse instance - */ - public static create(properties?: google.spanner.admin.instance.v1.IListInstanceConfigOperationsResponse): google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse; - - /** - * Encodes the specified ListInstanceConfigOperationsResponse message. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse.verify|verify} messages. - * @param message ListInstanceConfigOperationsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.instance.v1.IListInstanceConfigOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListInstanceConfigOperationsResponse message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse.verify|verify} messages. - * @param message ListInstanceConfigOperationsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.instance.v1.IListInstanceConfigOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListInstanceConfigOperationsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListInstanceConfigOperationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse; - - /** - * Decodes a ListInstanceConfigOperationsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListInstanceConfigOperationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse; - - /** - * Verifies a ListInstanceConfigOperationsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListInstanceConfigOperationsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListInstanceConfigOperationsResponse - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse; - - /** - * Creates a plain object from a ListInstanceConfigOperationsResponse message. Also converts values to other types if specified. - * @param message ListInstanceConfigOperationsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListInstanceConfigOperationsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListInstanceConfigOperationsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetInstanceRequest. */ - interface IGetInstanceRequest { - - /** GetInstanceRequest name */ - name?: (string|null); - - /** GetInstanceRequest fieldMask */ - fieldMask?: (google.protobuf.IFieldMask|null); - } - - /** Represents a GetInstanceRequest. */ - class GetInstanceRequest implements IGetInstanceRequest { - - /** - * Constructs a new GetInstanceRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.instance.v1.IGetInstanceRequest); - - /** GetInstanceRequest name. */ - public name: string; - - /** GetInstanceRequest fieldMask. */ - public fieldMask?: (google.protobuf.IFieldMask|null); - - /** - * Creates a new GetInstanceRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetInstanceRequest instance - */ - public static create(properties?: google.spanner.admin.instance.v1.IGetInstanceRequest): google.spanner.admin.instance.v1.GetInstanceRequest; - - /** - * Encodes the specified GetInstanceRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.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.spanner.admin.instance.v1.IGetInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetInstanceRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.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.spanner.admin.instance.v1.IGetInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetInstanceRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.GetInstanceRequest; - - /** - * Decodes a GetInstanceRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.GetInstanceRequest; - - /** - * Verifies a GetInstanceRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetInstanceRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetInstanceRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.GetInstanceRequest; - - /** - * Creates a plain object from a GetInstanceRequest message. Also converts values to other types if specified. - * @param message GetInstanceRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.instance.v1.GetInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetInstanceRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetInstanceRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateInstanceRequest. */ - interface ICreateInstanceRequest { - - /** CreateInstanceRequest parent */ - parent?: (string|null); - - /** CreateInstanceRequest instanceId */ - instanceId?: (string|null); - - /** CreateInstanceRequest instance */ - instance?: (google.spanner.admin.instance.v1.IInstance|null); - } - - /** Represents a CreateInstanceRequest. */ - class CreateInstanceRequest implements ICreateInstanceRequest { - - /** - * Constructs a new CreateInstanceRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.instance.v1.ICreateInstanceRequest); - - /** CreateInstanceRequest parent. */ - public parent: string; - - /** CreateInstanceRequest instanceId. */ - public instanceId: string; - - /** CreateInstanceRequest instance. */ - public instance?: (google.spanner.admin.instance.v1.IInstance|null); - - /** - * Creates a new CreateInstanceRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateInstanceRequest instance - */ - public static create(properties?: google.spanner.admin.instance.v1.ICreateInstanceRequest): google.spanner.admin.instance.v1.CreateInstanceRequest; - - /** - * Encodes the specified CreateInstanceRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.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.spanner.admin.instance.v1.ICreateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateInstanceRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.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.spanner.admin.instance.v1.ICreateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateInstanceRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.CreateInstanceRequest; - - /** - * Decodes a CreateInstanceRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.CreateInstanceRequest; - - /** - * Verifies a CreateInstanceRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateInstanceRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateInstanceRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.CreateInstanceRequest; - - /** - * Creates a plain object from a CreateInstanceRequest message. Also converts values to other types if specified. - * @param message CreateInstanceRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.instance.v1.CreateInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateInstanceRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateInstanceRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListInstancesRequest. */ - interface IListInstancesRequest { - - /** ListInstancesRequest parent */ - parent?: (string|null); - - /** ListInstancesRequest pageSize */ - pageSize?: (number|null); - - /** ListInstancesRequest pageToken */ - pageToken?: (string|null); - - /** ListInstancesRequest filter */ - filter?: (string|null); - - /** ListInstancesRequest instanceDeadline */ - instanceDeadline?: (google.protobuf.ITimestamp|null); - } - - /** Represents a ListInstancesRequest. */ - class ListInstancesRequest implements IListInstancesRequest { - - /** - * Constructs a new ListInstancesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.instance.v1.IListInstancesRequest); - - /** ListInstancesRequest parent. */ - public parent: string; - - /** ListInstancesRequest pageSize. */ - public pageSize: number; - - /** ListInstancesRequest pageToken. */ - public pageToken: string; - - /** ListInstancesRequest filter. */ - public filter: string; - - /** ListInstancesRequest instanceDeadline. */ - public instanceDeadline?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new ListInstancesRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListInstancesRequest instance - */ - public static create(properties?: google.spanner.admin.instance.v1.IListInstancesRequest): google.spanner.admin.instance.v1.ListInstancesRequest; - - /** - * Encodes the specified ListInstancesRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancesRequest.verify|verify} messages. - * @param message ListInstancesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.instance.v1.IListInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListInstancesRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancesRequest.verify|verify} messages. - * @param message ListInstancesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.instance.v1.IListInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListInstancesRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListInstancesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.ListInstancesRequest; - - /** - * Decodes a ListInstancesRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListInstancesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.ListInstancesRequest; - - /** - * Verifies a ListInstancesRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListInstancesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListInstancesRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.ListInstancesRequest; - - /** - * Creates a plain object from a ListInstancesRequest message. Also converts values to other types if specified. - * @param message ListInstancesRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.instance.v1.ListInstancesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListInstancesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListInstancesRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListInstancesResponse. */ - interface IListInstancesResponse { - - /** ListInstancesResponse instances */ - instances?: (google.spanner.admin.instance.v1.IInstance[]|null); - - /** ListInstancesResponse nextPageToken */ - nextPageToken?: (string|null); - - /** ListInstancesResponse unreachable */ - unreachable?: (string[]|null); - } - - /** Represents a ListInstancesResponse. */ - class ListInstancesResponse implements IListInstancesResponse { - - /** - * Constructs a new ListInstancesResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.instance.v1.IListInstancesResponse); - - /** ListInstancesResponse instances. */ - public instances: google.spanner.admin.instance.v1.IInstance[]; - - /** ListInstancesResponse nextPageToken. */ - public nextPageToken: string; - - /** ListInstancesResponse unreachable. */ - public unreachable: string[]; - - /** - * Creates a new ListInstancesResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListInstancesResponse instance - */ - public static create(properties?: google.spanner.admin.instance.v1.IListInstancesResponse): google.spanner.admin.instance.v1.ListInstancesResponse; - - /** - * Encodes the specified ListInstancesResponse message. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancesResponse.verify|verify} messages. - * @param message ListInstancesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.instance.v1.IListInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListInstancesResponse message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancesResponse.verify|verify} messages. - * @param message ListInstancesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.instance.v1.IListInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListInstancesResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListInstancesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.ListInstancesResponse; - - /** - * Decodes a ListInstancesResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListInstancesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.ListInstancesResponse; - - /** - * Verifies a ListInstancesResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListInstancesResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListInstancesResponse - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.ListInstancesResponse; - - /** - * Creates a plain object from a ListInstancesResponse message. Also converts values to other types if specified. - * @param message ListInstancesResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.instance.v1.ListInstancesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListInstancesResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListInstancesResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateInstanceRequest. */ - interface IUpdateInstanceRequest { - - /** UpdateInstanceRequest instance */ - instance?: (google.spanner.admin.instance.v1.IInstance|null); - - /** UpdateInstanceRequest fieldMask */ - fieldMask?: (google.protobuf.IFieldMask|null); - } - - /** Represents an UpdateInstanceRequest. */ - class UpdateInstanceRequest implements IUpdateInstanceRequest { - - /** - * Constructs a new UpdateInstanceRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.instance.v1.IUpdateInstanceRequest); - - /** UpdateInstanceRequest instance. */ - public instance?: (google.spanner.admin.instance.v1.IInstance|null); - - /** UpdateInstanceRequest fieldMask. */ - public fieldMask?: (google.protobuf.IFieldMask|null); - - /** - * Creates a new UpdateInstanceRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateInstanceRequest instance - */ - public static create(properties?: google.spanner.admin.instance.v1.IUpdateInstanceRequest): google.spanner.admin.instance.v1.UpdateInstanceRequest; - - /** - * Encodes the specified UpdateInstanceRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.UpdateInstanceRequest.verify|verify} messages. - * @param message UpdateInstanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.instance.v1.IUpdateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateInstanceRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.UpdateInstanceRequest.verify|verify} messages. - * @param message UpdateInstanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.instance.v1.IUpdateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateInstanceRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.UpdateInstanceRequest; - - /** - * Decodes an UpdateInstanceRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.UpdateInstanceRequest; - - /** - * Verifies an UpdateInstanceRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UpdateInstanceRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateInstanceRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.UpdateInstanceRequest; - - /** - * Creates a plain object from an UpdateInstanceRequest message. Also converts values to other types if specified. - * @param message UpdateInstanceRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.instance.v1.UpdateInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateInstanceRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateInstanceRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteInstanceRequest. */ - interface IDeleteInstanceRequest { - - /** DeleteInstanceRequest name */ - name?: (string|null); - } - - /** Represents a DeleteInstanceRequest. */ - class DeleteInstanceRequest implements IDeleteInstanceRequest { - - /** - * Constructs a new DeleteInstanceRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.instance.v1.IDeleteInstanceRequest); - - /** DeleteInstanceRequest name. */ - public name: string; - - /** - * Creates a new DeleteInstanceRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteInstanceRequest instance - */ - public static create(properties?: google.spanner.admin.instance.v1.IDeleteInstanceRequest): google.spanner.admin.instance.v1.DeleteInstanceRequest; - - /** - * Encodes the specified DeleteInstanceRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.DeleteInstanceRequest.verify|verify} messages. - * @param message DeleteInstanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.instance.v1.IDeleteInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteInstanceRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.DeleteInstanceRequest.verify|verify} messages. - * @param message DeleteInstanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.instance.v1.IDeleteInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteInstanceRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.DeleteInstanceRequest; - - /** - * Decodes a DeleteInstanceRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.DeleteInstanceRequest; - - /** - * Verifies a DeleteInstanceRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteInstanceRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteInstanceRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.DeleteInstanceRequest; - - /** - * Creates a plain object from a DeleteInstanceRequest message. Also converts values to other types if specified. - * @param message DeleteInstanceRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.instance.v1.DeleteInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteInstanceRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteInstanceRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateInstanceMetadata. */ - interface ICreateInstanceMetadata { - - /** CreateInstanceMetadata instance */ - instance?: (google.spanner.admin.instance.v1.IInstance|null); - - /** CreateInstanceMetadata startTime */ - startTime?: (google.protobuf.ITimestamp|null); - - /** CreateInstanceMetadata cancelTime */ - cancelTime?: (google.protobuf.ITimestamp|null); - - /** CreateInstanceMetadata endTime */ - endTime?: (google.protobuf.ITimestamp|null); - - /** CreateInstanceMetadata expectedFulfillmentPeriod */ - expectedFulfillmentPeriod?: (google.spanner.admin.instance.v1.FulfillmentPeriod|keyof typeof google.spanner.admin.instance.v1.FulfillmentPeriod|null); - } - - /** Represents a CreateInstanceMetadata. */ - class CreateInstanceMetadata implements ICreateInstanceMetadata { - - /** - * Constructs a new CreateInstanceMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.instance.v1.ICreateInstanceMetadata); - - /** CreateInstanceMetadata instance. */ - public instance?: (google.spanner.admin.instance.v1.IInstance|null); - - /** CreateInstanceMetadata startTime. */ - public startTime?: (google.protobuf.ITimestamp|null); - - /** CreateInstanceMetadata cancelTime. */ - public cancelTime?: (google.protobuf.ITimestamp|null); - - /** CreateInstanceMetadata endTime. */ - public endTime?: (google.protobuf.ITimestamp|null); - - /** CreateInstanceMetadata expectedFulfillmentPeriod. */ - public expectedFulfillmentPeriod: (google.spanner.admin.instance.v1.FulfillmentPeriod|keyof typeof google.spanner.admin.instance.v1.FulfillmentPeriod); - - /** - * Creates a new CreateInstanceMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateInstanceMetadata instance - */ - public static create(properties?: google.spanner.admin.instance.v1.ICreateInstanceMetadata): google.spanner.admin.instance.v1.CreateInstanceMetadata; - - /** - * Encodes the specified CreateInstanceMetadata message. Does not implicitly {@link google.spanner.admin.instance.v1.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.spanner.admin.instance.v1.ICreateInstanceMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateInstanceMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.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.spanner.admin.instance.v1.ICreateInstanceMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateInstanceMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateInstanceMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.CreateInstanceMetadata; - - /** - * Decodes a CreateInstanceMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateInstanceMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.CreateInstanceMetadata; - - /** - * Verifies a CreateInstanceMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateInstanceMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateInstanceMetadata - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.CreateInstanceMetadata; - - /** - * Creates a plain object from a CreateInstanceMetadata message. Also converts values to other types if specified. - * @param message CreateInstanceMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.instance.v1.CreateInstanceMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateInstanceMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateInstanceMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateInstanceMetadata. */ - interface IUpdateInstanceMetadata { - - /** UpdateInstanceMetadata instance */ - instance?: (google.spanner.admin.instance.v1.IInstance|null); - - /** UpdateInstanceMetadata startTime */ - startTime?: (google.protobuf.ITimestamp|null); - - /** UpdateInstanceMetadata cancelTime */ - cancelTime?: (google.protobuf.ITimestamp|null); - - /** UpdateInstanceMetadata endTime */ - endTime?: (google.protobuf.ITimestamp|null); - - /** UpdateInstanceMetadata expectedFulfillmentPeriod */ - expectedFulfillmentPeriod?: (google.spanner.admin.instance.v1.FulfillmentPeriod|keyof typeof google.spanner.admin.instance.v1.FulfillmentPeriod|null); - } - - /** Represents an UpdateInstanceMetadata. */ - class UpdateInstanceMetadata implements IUpdateInstanceMetadata { - - /** - * Constructs a new UpdateInstanceMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.instance.v1.IUpdateInstanceMetadata); - - /** UpdateInstanceMetadata instance. */ - public instance?: (google.spanner.admin.instance.v1.IInstance|null); - - /** UpdateInstanceMetadata startTime. */ - public startTime?: (google.protobuf.ITimestamp|null); - - /** UpdateInstanceMetadata cancelTime. */ - public cancelTime?: (google.protobuf.ITimestamp|null); - - /** UpdateInstanceMetadata endTime. */ - public endTime?: (google.protobuf.ITimestamp|null); - - /** UpdateInstanceMetadata expectedFulfillmentPeriod. */ - public expectedFulfillmentPeriod: (google.spanner.admin.instance.v1.FulfillmentPeriod|keyof typeof google.spanner.admin.instance.v1.FulfillmentPeriod); - - /** - * Creates a new UpdateInstanceMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateInstanceMetadata instance - */ - public static create(properties?: google.spanner.admin.instance.v1.IUpdateInstanceMetadata): google.spanner.admin.instance.v1.UpdateInstanceMetadata; - - /** - * Encodes the specified UpdateInstanceMetadata message. Does not implicitly {@link google.spanner.admin.instance.v1.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.spanner.admin.instance.v1.IUpdateInstanceMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateInstanceMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.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.spanner.admin.instance.v1.IUpdateInstanceMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateInstanceMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateInstanceMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.UpdateInstanceMetadata; - - /** - * Decodes an UpdateInstanceMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateInstanceMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.UpdateInstanceMetadata; - - /** - * Verifies an UpdateInstanceMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UpdateInstanceMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateInstanceMetadata - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.UpdateInstanceMetadata; - - /** - * Creates a plain object from an UpdateInstanceMetadata message. Also converts values to other types if specified. - * @param message UpdateInstanceMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.instance.v1.UpdateInstanceMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateInstanceMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateInstanceMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a FreeInstanceMetadata. */ - interface IFreeInstanceMetadata { - - /** FreeInstanceMetadata expireTime */ - expireTime?: (google.protobuf.ITimestamp|null); - - /** FreeInstanceMetadata upgradeTime */ - upgradeTime?: (google.protobuf.ITimestamp|null); - - /** FreeInstanceMetadata expireBehavior */ - expireBehavior?: (google.spanner.admin.instance.v1.FreeInstanceMetadata.ExpireBehavior|keyof typeof google.spanner.admin.instance.v1.FreeInstanceMetadata.ExpireBehavior|null); - } - - /** Represents a FreeInstanceMetadata. */ - class FreeInstanceMetadata implements IFreeInstanceMetadata { - - /** - * Constructs a new FreeInstanceMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.instance.v1.IFreeInstanceMetadata); - - /** FreeInstanceMetadata expireTime. */ - public expireTime?: (google.protobuf.ITimestamp|null); - - /** FreeInstanceMetadata upgradeTime. */ - public upgradeTime?: (google.protobuf.ITimestamp|null); - - /** FreeInstanceMetadata expireBehavior. */ - public expireBehavior: (google.spanner.admin.instance.v1.FreeInstanceMetadata.ExpireBehavior|keyof typeof google.spanner.admin.instance.v1.FreeInstanceMetadata.ExpireBehavior); - - /** - * Creates a new FreeInstanceMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns FreeInstanceMetadata instance - */ - public static create(properties?: google.spanner.admin.instance.v1.IFreeInstanceMetadata): google.spanner.admin.instance.v1.FreeInstanceMetadata; - - /** - * Encodes the specified FreeInstanceMetadata message. Does not implicitly {@link google.spanner.admin.instance.v1.FreeInstanceMetadata.verify|verify} messages. - * @param message FreeInstanceMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.instance.v1.IFreeInstanceMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FreeInstanceMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.FreeInstanceMetadata.verify|verify} messages. - * @param message FreeInstanceMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.instance.v1.IFreeInstanceMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FreeInstanceMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FreeInstanceMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.FreeInstanceMetadata; - - /** - * Decodes a FreeInstanceMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FreeInstanceMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.FreeInstanceMetadata; - - /** - * Verifies a FreeInstanceMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FreeInstanceMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FreeInstanceMetadata - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.FreeInstanceMetadata; - - /** - * Creates a plain object from a FreeInstanceMetadata message. Also converts values to other types if specified. - * @param message FreeInstanceMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.instance.v1.FreeInstanceMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FreeInstanceMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FreeInstanceMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FreeInstanceMetadata { - - /** ExpireBehavior enum. */ - enum ExpireBehavior { - EXPIRE_BEHAVIOR_UNSPECIFIED = 0, - FREE_TO_PROVISIONED = 1, - REMOVE_AFTER_GRACE_PERIOD = 2 - } - } - - /** Properties of a CreateInstanceConfigMetadata. */ - interface ICreateInstanceConfigMetadata { - - /** CreateInstanceConfigMetadata instanceConfig */ - instanceConfig?: (google.spanner.admin.instance.v1.IInstanceConfig|null); - - /** CreateInstanceConfigMetadata progress */ - progress?: (google.spanner.admin.instance.v1.IOperationProgress|null); - - /** CreateInstanceConfigMetadata cancelTime */ - cancelTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a CreateInstanceConfigMetadata. */ - class CreateInstanceConfigMetadata implements ICreateInstanceConfigMetadata { - - /** - * Constructs a new CreateInstanceConfigMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.instance.v1.ICreateInstanceConfigMetadata); - - /** CreateInstanceConfigMetadata instanceConfig. */ - public instanceConfig?: (google.spanner.admin.instance.v1.IInstanceConfig|null); - - /** CreateInstanceConfigMetadata progress. */ - public progress?: (google.spanner.admin.instance.v1.IOperationProgress|null); - - /** CreateInstanceConfigMetadata cancelTime. */ - public cancelTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new CreateInstanceConfigMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateInstanceConfigMetadata instance - */ - public static create(properties?: google.spanner.admin.instance.v1.ICreateInstanceConfigMetadata): google.spanner.admin.instance.v1.CreateInstanceConfigMetadata; - - /** - * Encodes the specified CreateInstanceConfigMetadata message. Does not implicitly {@link google.spanner.admin.instance.v1.CreateInstanceConfigMetadata.verify|verify} messages. - * @param message CreateInstanceConfigMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.instance.v1.ICreateInstanceConfigMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateInstanceConfigMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.CreateInstanceConfigMetadata.verify|verify} messages. - * @param message CreateInstanceConfigMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.instance.v1.ICreateInstanceConfigMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateInstanceConfigMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateInstanceConfigMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.CreateInstanceConfigMetadata; - - /** - * Decodes a CreateInstanceConfigMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateInstanceConfigMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.CreateInstanceConfigMetadata; - - /** - * Verifies a CreateInstanceConfigMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateInstanceConfigMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateInstanceConfigMetadata - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.CreateInstanceConfigMetadata; - - /** - * Creates a plain object from a CreateInstanceConfigMetadata message. Also converts values to other types if specified. - * @param message CreateInstanceConfigMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.instance.v1.CreateInstanceConfigMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateInstanceConfigMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateInstanceConfigMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateInstanceConfigMetadata. */ - interface IUpdateInstanceConfigMetadata { - - /** UpdateInstanceConfigMetadata instanceConfig */ - instanceConfig?: (google.spanner.admin.instance.v1.IInstanceConfig|null); - - /** UpdateInstanceConfigMetadata progress */ - progress?: (google.spanner.admin.instance.v1.IOperationProgress|null); - - /** UpdateInstanceConfigMetadata cancelTime */ - cancelTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents an UpdateInstanceConfigMetadata. */ - class UpdateInstanceConfigMetadata implements IUpdateInstanceConfigMetadata { - - /** - * Constructs a new UpdateInstanceConfigMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.instance.v1.IUpdateInstanceConfigMetadata); - - /** UpdateInstanceConfigMetadata instanceConfig. */ - public instanceConfig?: (google.spanner.admin.instance.v1.IInstanceConfig|null); - - /** UpdateInstanceConfigMetadata progress. */ - public progress?: (google.spanner.admin.instance.v1.IOperationProgress|null); - - /** UpdateInstanceConfigMetadata cancelTime. */ - public cancelTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new UpdateInstanceConfigMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateInstanceConfigMetadata instance - */ - public static create(properties?: google.spanner.admin.instance.v1.IUpdateInstanceConfigMetadata): google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata; - - /** - * Encodes the specified UpdateInstanceConfigMetadata message. Does not implicitly {@link google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata.verify|verify} messages. - * @param message UpdateInstanceConfigMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.instance.v1.IUpdateInstanceConfigMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateInstanceConfigMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata.verify|verify} messages. - * @param message UpdateInstanceConfigMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.instance.v1.IUpdateInstanceConfigMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateInstanceConfigMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateInstanceConfigMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata; - - /** - * Decodes an UpdateInstanceConfigMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateInstanceConfigMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata; - - /** - * Verifies an UpdateInstanceConfigMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UpdateInstanceConfigMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateInstanceConfigMetadata - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata; - - /** - * Creates a plain object from an UpdateInstanceConfigMetadata message. Also converts values to other types if specified. - * @param message UpdateInstanceConfigMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateInstanceConfigMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateInstanceConfigMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an InstancePartition. */ - interface IInstancePartition { - - /** InstancePartition name */ - name?: (string|null); - - /** InstancePartition config */ - config?: (string|null); - - /** InstancePartition displayName */ - displayName?: (string|null); - - /** InstancePartition nodeCount */ - nodeCount?: (number|null); - - /** InstancePartition processingUnits */ - processingUnits?: (number|null); - - /** InstancePartition autoscalingConfig */ - autoscalingConfig?: (google.spanner.admin.instance.v1.IAutoscalingConfig|null); - - /** InstancePartition state */ - state?: (google.spanner.admin.instance.v1.InstancePartition.State|keyof typeof google.spanner.admin.instance.v1.InstancePartition.State|null); - - /** InstancePartition createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** InstancePartition updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** InstancePartition referencingDatabases */ - referencingDatabases?: (string[]|null); - - /** InstancePartition referencingBackups */ - referencingBackups?: (string[]|null); - - /** InstancePartition etag */ - etag?: (string|null); - } - - /** Represents an InstancePartition. */ - class InstancePartition implements IInstancePartition { - - /** - * Constructs a new InstancePartition. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.instance.v1.IInstancePartition); - - /** InstancePartition name. */ - public name: string; - - /** InstancePartition config. */ - public config: string; - - /** InstancePartition displayName. */ - public displayName: string; - - /** InstancePartition nodeCount. */ - public nodeCount?: (number|null); - - /** InstancePartition processingUnits. */ - public processingUnits?: (number|null); - - /** InstancePartition autoscalingConfig. */ - public autoscalingConfig?: (google.spanner.admin.instance.v1.IAutoscalingConfig|null); - - /** InstancePartition state. */ - public state: (google.spanner.admin.instance.v1.InstancePartition.State|keyof typeof google.spanner.admin.instance.v1.InstancePartition.State); - - /** InstancePartition createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** InstancePartition updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** InstancePartition referencingDatabases. */ - public referencingDatabases: string[]; - - /** InstancePartition referencingBackups. */ - public referencingBackups: string[]; - - /** InstancePartition etag. */ - public etag: string; - - /** InstancePartition computeCapacity. */ - public computeCapacity?: ("nodeCount"|"processingUnits"); - - /** - * Creates a new InstancePartition instance using the specified properties. - * @param [properties] Properties to set - * @returns InstancePartition instance - */ - public static create(properties?: google.spanner.admin.instance.v1.IInstancePartition): google.spanner.admin.instance.v1.InstancePartition; - - /** - * Encodes the specified InstancePartition message. Does not implicitly {@link google.spanner.admin.instance.v1.InstancePartition.verify|verify} messages. - * @param message InstancePartition message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.instance.v1.IInstancePartition, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified InstancePartition message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.InstancePartition.verify|verify} messages. - * @param message InstancePartition message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.instance.v1.IInstancePartition, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an InstancePartition message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns InstancePartition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.InstancePartition; - - /** - * Decodes an InstancePartition message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns InstancePartition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.InstancePartition; - - /** - * Verifies an InstancePartition message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an InstancePartition message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns InstancePartition - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.InstancePartition; - - /** - * Creates a plain object from an InstancePartition message. Also converts values to other types if specified. - * @param message InstancePartition - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.instance.v1.InstancePartition, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this InstancePartition to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for InstancePartition - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace InstancePartition { - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - CREATING = 1, - READY = 2 - } - } - - /** Properties of a CreateInstancePartitionMetadata. */ - interface ICreateInstancePartitionMetadata { - - /** CreateInstancePartitionMetadata instancePartition */ - instancePartition?: (google.spanner.admin.instance.v1.IInstancePartition|null); - - /** CreateInstancePartitionMetadata startTime */ - startTime?: (google.protobuf.ITimestamp|null); - - /** CreateInstancePartitionMetadata cancelTime */ - cancelTime?: (google.protobuf.ITimestamp|null); - - /** CreateInstancePartitionMetadata endTime */ - endTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a CreateInstancePartitionMetadata. */ - class CreateInstancePartitionMetadata implements ICreateInstancePartitionMetadata { - - /** - * Constructs a new CreateInstancePartitionMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.instance.v1.ICreateInstancePartitionMetadata); - - /** CreateInstancePartitionMetadata instancePartition. */ - public instancePartition?: (google.spanner.admin.instance.v1.IInstancePartition|null); - - /** CreateInstancePartitionMetadata startTime. */ - public startTime?: (google.protobuf.ITimestamp|null); - - /** CreateInstancePartitionMetadata cancelTime. */ - public cancelTime?: (google.protobuf.ITimestamp|null); - - /** CreateInstancePartitionMetadata endTime. */ - public endTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new CreateInstancePartitionMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateInstancePartitionMetadata instance - */ - public static create(properties?: google.spanner.admin.instance.v1.ICreateInstancePartitionMetadata): google.spanner.admin.instance.v1.CreateInstancePartitionMetadata; - - /** - * Encodes the specified CreateInstancePartitionMetadata message. Does not implicitly {@link google.spanner.admin.instance.v1.CreateInstancePartitionMetadata.verify|verify} messages. - * @param message CreateInstancePartitionMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.instance.v1.ICreateInstancePartitionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateInstancePartitionMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.CreateInstancePartitionMetadata.verify|verify} messages. - * @param message CreateInstancePartitionMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.instance.v1.ICreateInstancePartitionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateInstancePartitionMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateInstancePartitionMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.CreateInstancePartitionMetadata; - - /** - * Decodes a CreateInstancePartitionMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateInstancePartitionMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.CreateInstancePartitionMetadata; - - /** - * Verifies a CreateInstancePartitionMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateInstancePartitionMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateInstancePartitionMetadata - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.CreateInstancePartitionMetadata; - - /** - * Creates a plain object from a CreateInstancePartitionMetadata message. Also converts values to other types if specified. - * @param message CreateInstancePartitionMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.instance.v1.CreateInstancePartitionMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateInstancePartitionMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateInstancePartitionMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateInstancePartitionRequest. */ - interface ICreateInstancePartitionRequest { - - /** CreateInstancePartitionRequest parent */ - parent?: (string|null); - - /** CreateInstancePartitionRequest instancePartitionId */ - instancePartitionId?: (string|null); - - /** CreateInstancePartitionRequest instancePartition */ - instancePartition?: (google.spanner.admin.instance.v1.IInstancePartition|null); - } - - /** Represents a CreateInstancePartitionRequest. */ - class CreateInstancePartitionRequest implements ICreateInstancePartitionRequest { - - /** - * Constructs a new CreateInstancePartitionRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.instance.v1.ICreateInstancePartitionRequest); - - /** CreateInstancePartitionRequest parent. */ - public parent: string; - - /** CreateInstancePartitionRequest instancePartitionId. */ - public instancePartitionId: string; - - /** CreateInstancePartitionRequest instancePartition. */ - public instancePartition?: (google.spanner.admin.instance.v1.IInstancePartition|null); - - /** - * Creates a new CreateInstancePartitionRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateInstancePartitionRequest instance - */ - public static create(properties?: google.spanner.admin.instance.v1.ICreateInstancePartitionRequest): google.spanner.admin.instance.v1.CreateInstancePartitionRequest; - - /** - * Encodes the specified CreateInstancePartitionRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.CreateInstancePartitionRequest.verify|verify} messages. - * @param message CreateInstancePartitionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.instance.v1.ICreateInstancePartitionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateInstancePartitionRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.CreateInstancePartitionRequest.verify|verify} messages. - * @param message CreateInstancePartitionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.instance.v1.ICreateInstancePartitionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateInstancePartitionRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateInstancePartitionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.CreateInstancePartitionRequest; - - /** - * Decodes a CreateInstancePartitionRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateInstancePartitionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.CreateInstancePartitionRequest; - - /** - * Verifies a CreateInstancePartitionRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateInstancePartitionRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateInstancePartitionRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.CreateInstancePartitionRequest; - - /** - * Creates a plain object from a CreateInstancePartitionRequest message. Also converts values to other types if specified. - * @param message CreateInstancePartitionRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.instance.v1.CreateInstancePartitionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateInstancePartitionRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateInstancePartitionRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteInstancePartitionRequest. */ - interface IDeleteInstancePartitionRequest { - - /** DeleteInstancePartitionRequest name */ - name?: (string|null); - - /** DeleteInstancePartitionRequest etag */ - etag?: (string|null); - } - - /** Represents a DeleteInstancePartitionRequest. */ - class DeleteInstancePartitionRequest implements IDeleteInstancePartitionRequest { - - /** - * Constructs a new DeleteInstancePartitionRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.instance.v1.IDeleteInstancePartitionRequest); - - /** DeleteInstancePartitionRequest name. */ - public name: string; - - /** DeleteInstancePartitionRequest etag. */ - public etag: string; - - /** - * Creates a new DeleteInstancePartitionRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteInstancePartitionRequest instance - */ - public static create(properties?: google.spanner.admin.instance.v1.IDeleteInstancePartitionRequest): google.spanner.admin.instance.v1.DeleteInstancePartitionRequest; - - /** - * Encodes the specified DeleteInstancePartitionRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.DeleteInstancePartitionRequest.verify|verify} messages. - * @param message DeleteInstancePartitionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.instance.v1.IDeleteInstancePartitionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteInstancePartitionRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.DeleteInstancePartitionRequest.verify|verify} messages. - * @param message DeleteInstancePartitionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.instance.v1.IDeleteInstancePartitionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteInstancePartitionRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteInstancePartitionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.DeleteInstancePartitionRequest; - - /** - * Decodes a DeleteInstancePartitionRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteInstancePartitionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.DeleteInstancePartitionRequest; - - /** - * Verifies a DeleteInstancePartitionRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteInstancePartitionRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteInstancePartitionRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.DeleteInstancePartitionRequest; - - /** - * Creates a plain object from a DeleteInstancePartitionRequest message. Also converts values to other types if specified. - * @param message DeleteInstancePartitionRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.instance.v1.DeleteInstancePartitionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteInstancePartitionRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteInstancePartitionRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetInstancePartitionRequest. */ - interface IGetInstancePartitionRequest { - - /** GetInstancePartitionRequest name */ - name?: (string|null); - } - - /** Represents a GetInstancePartitionRequest. */ - class GetInstancePartitionRequest implements IGetInstancePartitionRequest { - - /** - * Constructs a new GetInstancePartitionRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.instance.v1.IGetInstancePartitionRequest); - - /** GetInstancePartitionRequest name. */ - public name: string; - - /** - * Creates a new GetInstancePartitionRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetInstancePartitionRequest instance - */ - public static create(properties?: google.spanner.admin.instance.v1.IGetInstancePartitionRequest): google.spanner.admin.instance.v1.GetInstancePartitionRequest; - - /** - * Encodes the specified GetInstancePartitionRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.GetInstancePartitionRequest.verify|verify} messages. - * @param message GetInstancePartitionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.instance.v1.IGetInstancePartitionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetInstancePartitionRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.GetInstancePartitionRequest.verify|verify} messages. - * @param message GetInstancePartitionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.instance.v1.IGetInstancePartitionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetInstancePartitionRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetInstancePartitionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.GetInstancePartitionRequest; - - /** - * Decodes a GetInstancePartitionRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetInstancePartitionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.GetInstancePartitionRequest; - - /** - * Verifies a GetInstancePartitionRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetInstancePartitionRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetInstancePartitionRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.GetInstancePartitionRequest; - - /** - * Creates a plain object from a GetInstancePartitionRequest message. Also converts values to other types if specified. - * @param message GetInstancePartitionRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.instance.v1.GetInstancePartitionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetInstancePartitionRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetInstancePartitionRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateInstancePartitionRequest. */ - interface IUpdateInstancePartitionRequest { - - /** UpdateInstancePartitionRequest instancePartition */ - instancePartition?: (google.spanner.admin.instance.v1.IInstancePartition|null); - - /** UpdateInstancePartitionRequest fieldMask */ - fieldMask?: (google.protobuf.IFieldMask|null); - } - - /** Represents an UpdateInstancePartitionRequest. */ - class UpdateInstancePartitionRequest implements IUpdateInstancePartitionRequest { - - /** - * Constructs a new UpdateInstancePartitionRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.instance.v1.IUpdateInstancePartitionRequest); - - /** UpdateInstancePartitionRequest instancePartition. */ - public instancePartition?: (google.spanner.admin.instance.v1.IInstancePartition|null); - - /** UpdateInstancePartitionRequest fieldMask. */ - public fieldMask?: (google.protobuf.IFieldMask|null); - - /** - * Creates a new UpdateInstancePartitionRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateInstancePartitionRequest instance - */ - public static create(properties?: google.spanner.admin.instance.v1.IUpdateInstancePartitionRequest): google.spanner.admin.instance.v1.UpdateInstancePartitionRequest; - - /** - * Encodes the specified UpdateInstancePartitionRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.UpdateInstancePartitionRequest.verify|verify} messages. - * @param message UpdateInstancePartitionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.instance.v1.IUpdateInstancePartitionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateInstancePartitionRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.UpdateInstancePartitionRequest.verify|verify} messages. - * @param message UpdateInstancePartitionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.instance.v1.IUpdateInstancePartitionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateInstancePartitionRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateInstancePartitionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.UpdateInstancePartitionRequest; - - /** - * Decodes an UpdateInstancePartitionRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateInstancePartitionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.UpdateInstancePartitionRequest; - - /** - * Verifies an UpdateInstancePartitionRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UpdateInstancePartitionRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateInstancePartitionRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.UpdateInstancePartitionRequest; - - /** - * Creates a plain object from an UpdateInstancePartitionRequest message. Also converts values to other types if specified. - * @param message UpdateInstancePartitionRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.instance.v1.UpdateInstancePartitionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateInstancePartitionRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateInstancePartitionRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateInstancePartitionMetadata. */ - interface IUpdateInstancePartitionMetadata { - - /** UpdateInstancePartitionMetadata instancePartition */ - instancePartition?: (google.spanner.admin.instance.v1.IInstancePartition|null); - - /** UpdateInstancePartitionMetadata startTime */ - startTime?: (google.protobuf.ITimestamp|null); - - /** UpdateInstancePartitionMetadata cancelTime */ - cancelTime?: (google.protobuf.ITimestamp|null); - - /** UpdateInstancePartitionMetadata endTime */ - endTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents an UpdateInstancePartitionMetadata. */ - class UpdateInstancePartitionMetadata implements IUpdateInstancePartitionMetadata { - - /** - * Constructs a new UpdateInstancePartitionMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.instance.v1.IUpdateInstancePartitionMetadata); - - /** UpdateInstancePartitionMetadata instancePartition. */ - public instancePartition?: (google.spanner.admin.instance.v1.IInstancePartition|null); - - /** UpdateInstancePartitionMetadata startTime. */ - public startTime?: (google.protobuf.ITimestamp|null); - - /** UpdateInstancePartitionMetadata cancelTime. */ - public cancelTime?: (google.protobuf.ITimestamp|null); - - /** UpdateInstancePartitionMetadata endTime. */ - public endTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new UpdateInstancePartitionMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateInstancePartitionMetadata instance - */ - public static create(properties?: google.spanner.admin.instance.v1.IUpdateInstancePartitionMetadata): google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata; - - /** - * Encodes the specified UpdateInstancePartitionMetadata message. Does not implicitly {@link google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata.verify|verify} messages. - * @param message UpdateInstancePartitionMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.instance.v1.IUpdateInstancePartitionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateInstancePartitionMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata.verify|verify} messages. - * @param message UpdateInstancePartitionMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.instance.v1.IUpdateInstancePartitionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateInstancePartitionMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateInstancePartitionMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata; - - /** - * Decodes an UpdateInstancePartitionMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateInstancePartitionMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata; - - /** - * Verifies an UpdateInstancePartitionMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UpdateInstancePartitionMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateInstancePartitionMetadata - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata; - - /** - * Creates a plain object from an UpdateInstancePartitionMetadata message. Also converts values to other types if specified. - * @param message UpdateInstancePartitionMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateInstancePartitionMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateInstancePartitionMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListInstancePartitionsRequest. */ - interface IListInstancePartitionsRequest { - - /** ListInstancePartitionsRequest parent */ - parent?: (string|null); - - /** ListInstancePartitionsRequest pageSize */ - pageSize?: (number|null); - - /** ListInstancePartitionsRequest pageToken */ - pageToken?: (string|null); - - /** ListInstancePartitionsRequest instancePartitionDeadline */ - instancePartitionDeadline?: (google.protobuf.ITimestamp|null); - } - - /** Represents a ListInstancePartitionsRequest. */ - class ListInstancePartitionsRequest implements IListInstancePartitionsRequest { - - /** - * Constructs a new ListInstancePartitionsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.instance.v1.IListInstancePartitionsRequest); - - /** ListInstancePartitionsRequest parent. */ - public parent: string; - - /** ListInstancePartitionsRequest pageSize. */ - public pageSize: number; - - /** ListInstancePartitionsRequest pageToken. */ - public pageToken: string; - - /** ListInstancePartitionsRequest instancePartitionDeadline. */ - public instancePartitionDeadline?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new ListInstancePartitionsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListInstancePartitionsRequest instance - */ - public static create(properties?: google.spanner.admin.instance.v1.IListInstancePartitionsRequest): google.spanner.admin.instance.v1.ListInstancePartitionsRequest; - - /** - * Encodes the specified ListInstancePartitionsRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancePartitionsRequest.verify|verify} messages. - * @param message ListInstancePartitionsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.instance.v1.IListInstancePartitionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListInstancePartitionsRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancePartitionsRequest.verify|verify} messages. - * @param message ListInstancePartitionsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.instance.v1.IListInstancePartitionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListInstancePartitionsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListInstancePartitionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.ListInstancePartitionsRequest; - - /** - * Decodes a ListInstancePartitionsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListInstancePartitionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.ListInstancePartitionsRequest; - - /** - * Verifies a ListInstancePartitionsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListInstancePartitionsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListInstancePartitionsRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.ListInstancePartitionsRequest; - - /** - * Creates a plain object from a ListInstancePartitionsRequest message. Also converts values to other types if specified. - * @param message ListInstancePartitionsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.instance.v1.ListInstancePartitionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListInstancePartitionsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListInstancePartitionsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListInstancePartitionsResponse. */ - interface IListInstancePartitionsResponse { - - /** ListInstancePartitionsResponse instancePartitions */ - instancePartitions?: (google.spanner.admin.instance.v1.IInstancePartition[]|null); - - /** ListInstancePartitionsResponse nextPageToken */ - nextPageToken?: (string|null); - - /** ListInstancePartitionsResponse unreachable */ - unreachable?: (string[]|null); - } - - /** Represents a ListInstancePartitionsResponse. */ - class ListInstancePartitionsResponse implements IListInstancePartitionsResponse { - - /** - * Constructs a new ListInstancePartitionsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.instance.v1.IListInstancePartitionsResponse); - - /** ListInstancePartitionsResponse instancePartitions. */ - public instancePartitions: google.spanner.admin.instance.v1.IInstancePartition[]; - - /** ListInstancePartitionsResponse nextPageToken. */ - public nextPageToken: string; - - /** ListInstancePartitionsResponse unreachable. */ - public unreachable: string[]; - - /** - * Creates a new ListInstancePartitionsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListInstancePartitionsResponse instance - */ - public static create(properties?: google.spanner.admin.instance.v1.IListInstancePartitionsResponse): google.spanner.admin.instance.v1.ListInstancePartitionsResponse; - - /** - * Encodes the specified ListInstancePartitionsResponse message. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancePartitionsResponse.verify|verify} messages. - * @param message ListInstancePartitionsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.instance.v1.IListInstancePartitionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListInstancePartitionsResponse message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancePartitionsResponse.verify|verify} messages. - * @param message ListInstancePartitionsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.instance.v1.IListInstancePartitionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListInstancePartitionsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListInstancePartitionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.ListInstancePartitionsResponse; - - /** - * Decodes a ListInstancePartitionsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListInstancePartitionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.ListInstancePartitionsResponse; - - /** - * Verifies a ListInstancePartitionsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListInstancePartitionsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListInstancePartitionsResponse - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.ListInstancePartitionsResponse; - - /** - * Creates a plain object from a ListInstancePartitionsResponse message. Also converts values to other types if specified. - * @param message ListInstancePartitionsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.instance.v1.ListInstancePartitionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListInstancePartitionsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListInstancePartitionsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListInstancePartitionOperationsRequest. */ - interface IListInstancePartitionOperationsRequest { - - /** ListInstancePartitionOperationsRequest parent */ - parent?: (string|null); - - /** ListInstancePartitionOperationsRequest filter */ - filter?: (string|null); - - /** ListInstancePartitionOperationsRequest pageSize */ - pageSize?: (number|null); - - /** ListInstancePartitionOperationsRequest pageToken */ - pageToken?: (string|null); - - /** ListInstancePartitionOperationsRequest instancePartitionDeadline */ - instancePartitionDeadline?: (google.protobuf.ITimestamp|null); - } - - /** Represents a ListInstancePartitionOperationsRequest. */ - class ListInstancePartitionOperationsRequest implements IListInstancePartitionOperationsRequest { - - /** - * Constructs a new ListInstancePartitionOperationsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.instance.v1.IListInstancePartitionOperationsRequest); - - /** ListInstancePartitionOperationsRequest parent. */ - public parent: string; - - /** ListInstancePartitionOperationsRequest filter. */ - public filter: string; - - /** ListInstancePartitionOperationsRequest pageSize. */ - public pageSize: number; - - /** ListInstancePartitionOperationsRequest pageToken. */ - public pageToken: string; - - /** ListInstancePartitionOperationsRequest instancePartitionDeadline. */ - public instancePartitionDeadline?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new ListInstancePartitionOperationsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListInstancePartitionOperationsRequest instance - */ - public static create(properties?: google.spanner.admin.instance.v1.IListInstancePartitionOperationsRequest): google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest; - - /** - * Encodes the specified ListInstancePartitionOperationsRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest.verify|verify} messages. - * @param message ListInstancePartitionOperationsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.instance.v1.IListInstancePartitionOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListInstancePartitionOperationsRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest.verify|verify} messages. - * @param message ListInstancePartitionOperationsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.instance.v1.IListInstancePartitionOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListInstancePartitionOperationsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListInstancePartitionOperationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest; - - /** - * Decodes a ListInstancePartitionOperationsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListInstancePartitionOperationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest; - - /** - * Verifies a ListInstancePartitionOperationsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListInstancePartitionOperationsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListInstancePartitionOperationsRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest; - - /** - * Creates a plain object from a ListInstancePartitionOperationsRequest message. Also converts values to other types if specified. - * @param message ListInstancePartitionOperationsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListInstancePartitionOperationsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListInstancePartitionOperationsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListInstancePartitionOperationsResponse. */ - interface IListInstancePartitionOperationsResponse { - - /** ListInstancePartitionOperationsResponse operations */ - operations?: (google.longrunning.IOperation[]|null); - - /** ListInstancePartitionOperationsResponse nextPageToken */ - nextPageToken?: (string|null); - - /** ListInstancePartitionOperationsResponse unreachableInstancePartitions */ - unreachableInstancePartitions?: (string[]|null); - } - - /** Represents a ListInstancePartitionOperationsResponse. */ - class ListInstancePartitionOperationsResponse implements IListInstancePartitionOperationsResponse { - - /** - * Constructs a new ListInstancePartitionOperationsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.instance.v1.IListInstancePartitionOperationsResponse); - - /** ListInstancePartitionOperationsResponse operations. */ - public operations: google.longrunning.IOperation[]; - - /** ListInstancePartitionOperationsResponse nextPageToken. */ - public nextPageToken: string; - - /** ListInstancePartitionOperationsResponse unreachableInstancePartitions. */ - public unreachableInstancePartitions: string[]; - - /** - * Creates a new ListInstancePartitionOperationsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListInstancePartitionOperationsResponse instance - */ - public static create(properties?: google.spanner.admin.instance.v1.IListInstancePartitionOperationsResponse): google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse; - - /** - * Encodes the specified ListInstancePartitionOperationsResponse message. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse.verify|verify} messages. - * @param message ListInstancePartitionOperationsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.instance.v1.IListInstancePartitionOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListInstancePartitionOperationsResponse message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse.verify|verify} messages. - * @param message ListInstancePartitionOperationsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.instance.v1.IListInstancePartitionOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListInstancePartitionOperationsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListInstancePartitionOperationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse; - - /** - * Decodes a ListInstancePartitionOperationsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListInstancePartitionOperationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse; - - /** - * Verifies a ListInstancePartitionOperationsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListInstancePartitionOperationsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListInstancePartitionOperationsResponse - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse; - - /** - * Creates a plain object from a ListInstancePartitionOperationsResponse message. Also converts values to other types if specified. - * @param message ListInstancePartitionOperationsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListInstancePartitionOperationsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListInstancePartitionOperationsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a MoveInstanceRequest. */ - interface IMoveInstanceRequest { - - /** MoveInstanceRequest name */ - name?: (string|null); - - /** MoveInstanceRequest targetConfig */ - targetConfig?: (string|null); - } - - /** Represents a MoveInstanceRequest. */ - class MoveInstanceRequest implements IMoveInstanceRequest { - - /** - * Constructs a new MoveInstanceRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.instance.v1.IMoveInstanceRequest); - - /** MoveInstanceRequest name. */ - public name: string; - - /** MoveInstanceRequest targetConfig. */ - public targetConfig: string; - - /** - * Creates a new MoveInstanceRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns MoveInstanceRequest instance - */ - public static create(properties?: google.spanner.admin.instance.v1.IMoveInstanceRequest): google.spanner.admin.instance.v1.MoveInstanceRequest; - - /** - * Encodes the specified MoveInstanceRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.MoveInstanceRequest.verify|verify} messages. - * @param message MoveInstanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.instance.v1.IMoveInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MoveInstanceRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.MoveInstanceRequest.verify|verify} messages. - * @param message MoveInstanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.instance.v1.IMoveInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MoveInstanceRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MoveInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.MoveInstanceRequest; - - /** - * Decodes a MoveInstanceRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MoveInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.MoveInstanceRequest; - - /** - * Verifies a MoveInstanceRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MoveInstanceRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MoveInstanceRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.MoveInstanceRequest; - - /** - * Creates a plain object from a MoveInstanceRequest message. Also converts values to other types if specified. - * @param message MoveInstanceRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.instance.v1.MoveInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MoveInstanceRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MoveInstanceRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a MoveInstanceResponse. */ - interface IMoveInstanceResponse { - } - - /** Represents a MoveInstanceResponse. */ - class MoveInstanceResponse implements IMoveInstanceResponse { - - /** - * Constructs a new MoveInstanceResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.instance.v1.IMoveInstanceResponse); - - /** - * Creates a new MoveInstanceResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns MoveInstanceResponse instance - */ - public static create(properties?: google.spanner.admin.instance.v1.IMoveInstanceResponse): google.spanner.admin.instance.v1.MoveInstanceResponse; - - /** - * Encodes the specified MoveInstanceResponse message. Does not implicitly {@link google.spanner.admin.instance.v1.MoveInstanceResponse.verify|verify} messages. - * @param message MoveInstanceResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.instance.v1.IMoveInstanceResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MoveInstanceResponse message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.MoveInstanceResponse.verify|verify} messages. - * @param message MoveInstanceResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.instance.v1.IMoveInstanceResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MoveInstanceResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MoveInstanceResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.MoveInstanceResponse; - - /** - * Decodes a MoveInstanceResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MoveInstanceResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.MoveInstanceResponse; - - /** - * Verifies a MoveInstanceResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MoveInstanceResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MoveInstanceResponse - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.MoveInstanceResponse; - - /** - * Creates a plain object from a MoveInstanceResponse message. Also converts values to other types if specified. - * @param message MoveInstanceResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.instance.v1.MoveInstanceResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MoveInstanceResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MoveInstanceResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a MoveInstanceMetadata. */ - interface IMoveInstanceMetadata { - - /** MoveInstanceMetadata targetConfig */ - targetConfig?: (string|null); - - /** MoveInstanceMetadata progress */ - progress?: (google.spanner.admin.instance.v1.IOperationProgress|null); - - /** MoveInstanceMetadata cancelTime */ - cancelTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a MoveInstanceMetadata. */ - class MoveInstanceMetadata implements IMoveInstanceMetadata { - - /** - * Constructs a new MoveInstanceMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.admin.instance.v1.IMoveInstanceMetadata); - - /** MoveInstanceMetadata targetConfig. */ - public targetConfig: string; - - /** MoveInstanceMetadata progress. */ - public progress?: (google.spanner.admin.instance.v1.IOperationProgress|null); - - /** MoveInstanceMetadata cancelTime. */ - public cancelTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new MoveInstanceMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns MoveInstanceMetadata instance - */ - public static create(properties?: google.spanner.admin.instance.v1.IMoveInstanceMetadata): google.spanner.admin.instance.v1.MoveInstanceMetadata; - - /** - * Encodes the specified MoveInstanceMetadata message. Does not implicitly {@link google.spanner.admin.instance.v1.MoveInstanceMetadata.verify|verify} messages. - * @param message MoveInstanceMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.admin.instance.v1.IMoveInstanceMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MoveInstanceMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.MoveInstanceMetadata.verify|verify} messages. - * @param message MoveInstanceMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.admin.instance.v1.IMoveInstanceMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MoveInstanceMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MoveInstanceMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.MoveInstanceMetadata; - - /** - * Decodes a MoveInstanceMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MoveInstanceMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.MoveInstanceMetadata; - - /** - * Verifies a MoveInstanceMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MoveInstanceMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MoveInstanceMetadata - */ - public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.MoveInstanceMetadata; - - /** - * Creates a plain object from a MoveInstanceMetadata message. Also converts values to other types if specified. - * @param message MoveInstanceMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.admin.instance.v1.MoveInstanceMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MoveInstanceMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MoveInstanceMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - } - } - - /** Namespace executor. */ - namespace executor { - - /** Namespace v1. */ - namespace v1 { - - /** Represents a SpannerExecutorProxy */ - class SpannerExecutorProxy extends $protobuf.rpc.Service { - - /** - * Constructs a new SpannerExecutorProxy service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - - /** - * Creates new SpannerExecutorProxy 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): SpannerExecutorProxy; - - /** - * Calls ExecuteActionAsync. - * @param request SpannerAsyncActionRequest message or plain object - * @param callback Node-style callback called with the error, if any, and SpannerAsyncActionResponse - */ - public executeActionAsync(request: google.spanner.executor.v1.ISpannerAsyncActionRequest, callback: google.spanner.executor.v1.SpannerExecutorProxy.ExecuteActionAsyncCallback): void; - - /** - * Calls ExecuteActionAsync. - * @param request SpannerAsyncActionRequest message or plain object - * @returns Promise - */ - public executeActionAsync(request: google.spanner.executor.v1.ISpannerAsyncActionRequest): Promise; - } - - namespace SpannerExecutorProxy { - - /** - * Callback as used by {@link google.spanner.executor.v1.SpannerExecutorProxy|executeActionAsync}. - * @param error Error, if any - * @param [response] SpannerAsyncActionResponse - */ - type ExecuteActionAsyncCallback = (error: (Error|null), response?: google.spanner.executor.v1.SpannerAsyncActionResponse) => void; - } - - /** Properties of a SpannerAsyncActionRequest. */ - interface ISpannerAsyncActionRequest { - - /** SpannerAsyncActionRequest actionId */ - actionId?: (number|null); - - /** SpannerAsyncActionRequest action */ - action?: (google.spanner.executor.v1.ISpannerAction|null); - } - - /** Represents a SpannerAsyncActionRequest. */ - class SpannerAsyncActionRequest implements ISpannerAsyncActionRequest { - - /** - * Constructs a new SpannerAsyncActionRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.executor.v1.ISpannerAsyncActionRequest); - - /** SpannerAsyncActionRequest actionId. */ - public actionId: number; - - /** SpannerAsyncActionRequest action. */ - public action?: (google.spanner.executor.v1.ISpannerAction|null); - - /** - * Creates a new SpannerAsyncActionRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns SpannerAsyncActionRequest instance - */ - public static create(properties?: google.spanner.executor.v1.ISpannerAsyncActionRequest): google.spanner.executor.v1.SpannerAsyncActionRequest; - - /** - * Encodes the specified SpannerAsyncActionRequest message. Does not implicitly {@link google.spanner.executor.v1.SpannerAsyncActionRequest.verify|verify} messages. - * @param message SpannerAsyncActionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.executor.v1.ISpannerAsyncActionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SpannerAsyncActionRequest message, length delimited. Does not implicitly {@link google.spanner.executor.v1.SpannerAsyncActionRequest.verify|verify} messages. - * @param message SpannerAsyncActionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.executor.v1.ISpannerAsyncActionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SpannerAsyncActionRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SpannerAsyncActionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.SpannerAsyncActionRequest; - - /** - * Decodes a SpannerAsyncActionRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SpannerAsyncActionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.SpannerAsyncActionRequest; - - /** - * Verifies a SpannerAsyncActionRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SpannerAsyncActionRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SpannerAsyncActionRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.SpannerAsyncActionRequest; - - /** - * Creates a plain object from a SpannerAsyncActionRequest message. Also converts values to other types if specified. - * @param message SpannerAsyncActionRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.executor.v1.SpannerAsyncActionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SpannerAsyncActionRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SpannerAsyncActionRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a SpannerAsyncActionResponse. */ - interface ISpannerAsyncActionResponse { - - /** SpannerAsyncActionResponse actionId */ - actionId?: (number|null); - - /** SpannerAsyncActionResponse outcome */ - outcome?: (google.spanner.executor.v1.ISpannerActionOutcome|null); - } - - /** Represents a SpannerAsyncActionResponse. */ - class SpannerAsyncActionResponse implements ISpannerAsyncActionResponse { - - /** - * Constructs a new SpannerAsyncActionResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.executor.v1.ISpannerAsyncActionResponse); - - /** SpannerAsyncActionResponse actionId. */ - public actionId: number; - - /** SpannerAsyncActionResponse outcome. */ - public outcome?: (google.spanner.executor.v1.ISpannerActionOutcome|null); - - /** - * Creates a new SpannerAsyncActionResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns SpannerAsyncActionResponse instance - */ - public static create(properties?: google.spanner.executor.v1.ISpannerAsyncActionResponse): google.spanner.executor.v1.SpannerAsyncActionResponse; - - /** - * Encodes the specified SpannerAsyncActionResponse message. Does not implicitly {@link google.spanner.executor.v1.SpannerAsyncActionResponse.verify|verify} messages. - * @param message SpannerAsyncActionResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.executor.v1.ISpannerAsyncActionResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SpannerAsyncActionResponse message, length delimited. Does not implicitly {@link google.spanner.executor.v1.SpannerAsyncActionResponse.verify|verify} messages. - * @param message SpannerAsyncActionResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.executor.v1.ISpannerAsyncActionResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SpannerAsyncActionResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SpannerAsyncActionResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.SpannerAsyncActionResponse; - - /** - * Decodes a SpannerAsyncActionResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SpannerAsyncActionResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.SpannerAsyncActionResponse; - - /** - * Verifies a SpannerAsyncActionResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SpannerAsyncActionResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SpannerAsyncActionResponse - */ - public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.SpannerAsyncActionResponse; - - /** - * Creates a plain object from a SpannerAsyncActionResponse message. Also converts values to other types if specified. - * @param message SpannerAsyncActionResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.executor.v1.SpannerAsyncActionResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SpannerAsyncActionResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SpannerAsyncActionResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a SpannerAction. */ - interface ISpannerAction { - - /** SpannerAction databasePath */ - databasePath?: (string|null); - - /** SpannerAction spannerOptions */ - spannerOptions?: (google.spanner.executor.v1.ISpannerOptions|null); - - /** SpannerAction start */ - start?: (google.spanner.executor.v1.IStartTransactionAction|null); - - /** SpannerAction finish */ - finish?: (google.spanner.executor.v1.IFinishTransactionAction|null); - - /** SpannerAction read */ - read?: (google.spanner.executor.v1.IReadAction|null); - - /** SpannerAction query */ - query?: (google.spanner.executor.v1.IQueryAction|null); - - /** SpannerAction mutation */ - mutation?: (google.spanner.executor.v1.IMutationAction|null); - - /** SpannerAction dml */ - dml?: (google.spanner.executor.v1.IDmlAction|null); - - /** SpannerAction batchDml */ - batchDml?: (google.spanner.executor.v1.IBatchDmlAction|null); - - /** SpannerAction write */ - write?: (google.spanner.executor.v1.IWriteMutationsAction|null); - - /** SpannerAction partitionedUpdate */ - partitionedUpdate?: (google.spanner.executor.v1.IPartitionedUpdateAction|null); - - /** SpannerAction admin */ - admin?: (google.spanner.executor.v1.IAdminAction|null); - - /** SpannerAction startBatchTxn */ - startBatchTxn?: (google.spanner.executor.v1.IStartBatchTransactionAction|null); - - /** SpannerAction closeBatchTxn */ - closeBatchTxn?: (google.spanner.executor.v1.ICloseBatchTransactionAction|null); - - /** SpannerAction generateDbPartitionsRead */ - generateDbPartitionsRead?: (google.spanner.executor.v1.IGenerateDbPartitionsForReadAction|null); - - /** SpannerAction generateDbPartitionsQuery */ - generateDbPartitionsQuery?: (google.spanner.executor.v1.IGenerateDbPartitionsForQueryAction|null); - - /** SpannerAction executePartition */ - executePartition?: (google.spanner.executor.v1.IExecutePartitionAction|null); - - /** SpannerAction executeChangeStreamQuery */ - executeChangeStreamQuery?: (google.spanner.executor.v1.IExecuteChangeStreamQuery|null); - - /** SpannerAction queryCancellation */ - queryCancellation?: (google.spanner.executor.v1.IQueryCancellationAction|null); - } - - /** Represents a SpannerAction. */ - class SpannerAction implements ISpannerAction { - - /** - * Constructs a new SpannerAction. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.executor.v1.ISpannerAction); - - /** SpannerAction databasePath. */ - public databasePath: string; - - /** SpannerAction spannerOptions. */ - public spannerOptions?: (google.spanner.executor.v1.ISpannerOptions|null); - - /** SpannerAction start. */ - public start?: (google.spanner.executor.v1.IStartTransactionAction|null); - - /** SpannerAction finish. */ - public finish?: (google.spanner.executor.v1.IFinishTransactionAction|null); - - /** SpannerAction read. */ - public read?: (google.spanner.executor.v1.IReadAction|null); - - /** SpannerAction query. */ - public query?: (google.spanner.executor.v1.IQueryAction|null); - - /** SpannerAction mutation. */ - public mutation?: (google.spanner.executor.v1.IMutationAction|null); - - /** SpannerAction dml. */ - public dml?: (google.spanner.executor.v1.IDmlAction|null); - - /** SpannerAction batchDml. */ - public batchDml?: (google.spanner.executor.v1.IBatchDmlAction|null); - - /** SpannerAction write. */ - public write?: (google.spanner.executor.v1.IWriteMutationsAction|null); - - /** SpannerAction partitionedUpdate. */ - public partitionedUpdate?: (google.spanner.executor.v1.IPartitionedUpdateAction|null); - - /** SpannerAction admin. */ - public admin?: (google.spanner.executor.v1.IAdminAction|null); - - /** SpannerAction startBatchTxn. */ - public startBatchTxn?: (google.spanner.executor.v1.IStartBatchTransactionAction|null); - - /** SpannerAction closeBatchTxn. */ - public closeBatchTxn?: (google.spanner.executor.v1.ICloseBatchTransactionAction|null); - - /** SpannerAction generateDbPartitionsRead. */ - public generateDbPartitionsRead?: (google.spanner.executor.v1.IGenerateDbPartitionsForReadAction|null); - - /** SpannerAction generateDbPartitionsQuery. */ - public generateDbPartitionsQuery?: (google.spanner.executor.v1.IGenerateDbPartitionsForQueryAction|null); - - /** SpannerAction executePartition. */ - public executePartition?: (google.spanner.executor.v1.IExecutePartitionAction|null); - - /** SpannerAction executeChangeStreamQuery. */ - public executeChangeStreamQuery?: (google.spanner.executor.v1.IExecuteChangeStreamQuery|null); - - /** SpannerAction queryCancellation. */ - public queryCancellation?: (google.spanner.executor.v1.IQueryCancellationAction|null); - - /** SpannerAction action. */ - public action?: ("start"|"finish"|"read"|"query"|"mutation"|"dml"|"batchDml"|"write"|"partitionedUpdate"|"admin"|"startBatchTxn"|"closeBatchTxn"|"generateDbPartitionsRead"|"generateDbPartitionsQuery"|"executePartition"|"executeChangeStreamQuery"|"queryCancellation"); - - /** - * Creates a new SpannerAction instance using the specified properties. - * @param [properties] Properties to set - * @returns SpannerAction instance - */ - public static create(properties?: google.spanner.executor.v1.ISpannerAction): google.spanner.executor.v1.SpannerAction; - - /** - * Encodes the specified SpannerAction message. Does not implicitly {@link google.spanner.executor.v1.SpannerAction.verify|verify} messages. - * @param message SpannerAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.executor.v1.ISpannerAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SpannerAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.SpannerAction.verify|verify} messages. - * @param message SpannerAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.executor.v1.ISpannerAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SpannerAction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SpannerAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.SpannerAction; - - /** - * Decodes a SpannerAction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SpannerAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.SpannerAction; - - /** - * Verifies a SpannerAction message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SpannerAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SpannerAction - */ - public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.SpannerAction; - - /** - * Creates a plain object from a SpannerAction message. Also converts values to other types if specified. - * @param message SpannerAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.executor.v1.SpannerAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SpannerAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SpannerAction - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ReadAction. */ - interface IReadAction { - - /** ReadAction table */ - table?: (string|null); - - /** ReadAction index */ - index?: (string|null); - - /** ReadAction column */ - column?: (string[]|null); - - /** ReadAction keys */ - keys?: (google.spanner.executor.v1.IKeySet|null); - - /** ReadAction limit */ - limit?: (number|null); - } - - /** Represents a ReadAction. */ - class ReadAction implements IReadAction { - - /** - * Constructs a new ReadAction. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.executor.v1.IReadAction); - - /** ReadAction table. */ - public table: string; - - /** ReadAction index. */ - public index?: (string|null); - - /** ReadAction column. */ - public column: string[]; - - /** ReadAction keys. */ - public keys?: (google.spanner.executor.v1.IKeySet|null); - - /** ReadAction limit. */ - public limit: number; - - /** - * Creates a new ReadAction instance using the specified properties. - * @param [properties] Properties to set - * @returns ReadAction instance - */ - public static create(properties?: google.spanner.executor.v1.IReadAction): google.spanner.executor.v1.ReadAction; - - /** - * Encodes the specified ReadAction message. Does not implicitly {@link google.spanner.executor.v1.ReadAction.verify|verify} messages. - * @param message ReadAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.executor.v1.IReadAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ReadAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.ReadAction.verify|verify} messages. - * @param message ReadAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.executor.v1.IReadAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ReadAction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ReadAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.ReadAction; - - /** - * Decodes a ReadAction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ReadAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.ReadAction; - - /** - * Verifies a ReadAction message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ReadAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ReadAction - */ - public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.ReadAction; - - /** - * Creates a plain object from a ReadAction message. Also converts values to other types if specified. - * @param message ReadAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.executor.v1.ReadAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ReadAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ReadAction - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a QueryAction. */ - interface IQueryAction { - - /** QueryAction sql */ - sql?: (string|null); - - /** QueryAction params */ - params?: (google.spanner.executor.v1.QueryAction.IParameter[]|null); - } - - /** Represents a QueryAction. */ - class QueryAction implements IQueryAction { - - /** - * Constructs a new QueryAction. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.executor.v1.IQueryAction); - - /** QueryAction sql. */ - public sql: string; - - /** QueryAction params. */ - public params: google.spanner.executor.v1.QueryAction.IParameter[]; - - /** - * Creates a new QueryAction instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryAction instance - */ - public static create(properties?: google.spanner.executor.v1.IQueryAction): google.spanner.executor.v1.QueryAction; - - /** - * Encodes the specified QueryAction message. Does not implicitly {@link google.spanner.executor.v1.QueryAction.verify|verify} messages. - * @param message QueryAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.executor.v1.IQueryAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.QueryAction.verify|verify} messages. - * @param message QueryAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.executor.v1.IQueryAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryAction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.QueryAction; - - /** - * Decodes a QueryAction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.QueryAction; - - /** - * Verifies a QueryAction message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryAction - */ - public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.QueryAction; - - /** - * Creates a plain object from a QueryAction message. Also converts values to other types if specified. - * @param message QueryAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.executor.v1.QueryAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for QueryAction - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace QueryAction { - - /** Properties of a Parameter. */ - interface IParameter { - - /** Parameter name */ - name?: (string|null); - - /** Parameter type */ - type?: (google.spanner.v1.IType|null); - - /** Parameter value */ - value?: (google.spanner.executor.v1.IValue|null); - } - - /** Represents a Parameter. */ - class Parameter implements IParameter { - - /** - * Constructs a new Parameter. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.executor.v1.QueryAction.IParameter); - - /** Parameter name. */ - public name: string; - - /** Parameter type. */ - public type?: (google.spanner.v1.IType|null); - - /** Parameter value. */ - public value?: (google.spanner.executor.v1.IValue|null); - - /** - * Creates a new Parameter instance using the specified properties. - * @param [properties] Properties to set - * @returns Parameter instance - */ - public static create(properties?: google.spanner.executor.v1.QueryAction.IParameter): google.spanner.executor.v1.QueryAction.Parameter; - - /** - * Encodes the specified Parameter message. Does not implicitly {@link google.spanner.executor.v1.QueryAction.Parameter.verify|verify} messages. - * @param message Parameter message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.executor.v1.QueryAction.IParameter, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Parameter message, length delimited. Does not implicitly {@link google.spanner.executor.v1.QueryAction.Parameter.verify|verify} messages. - * @param message Parameter message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.executor.v1.QueryAction.IParameter, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Parameter message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Parameter - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.QueryAction.Parameter; - - /** - * Decodes a Parameter message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Parameter - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.QueryAction.Parameter; - - /** - * Verifies a Parameter message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Parameter message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Parameter - */ - public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.QueryAction.Parameter; - - /** - * Creates a plain object from a Parameter message. Also converts values to other types if specified. - * @param message Parameter - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.executor.v1.QueryAction.Parameter, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Parameter to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Parameter - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a DmlAction. */ - interface IDmlAction { - - /** DmlAction update */ - update?: (google.spanner.executor.v1.IQueryAction|null); - - /** DmlAction autocommitIfSupported */ - autocommitIfSupported?: (boolean|null); - } - - /** Represents a DmlAction. */ - class DmlAction implements IDmlAction { - - /** - * Constructs a new DmlAction. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.executor.v1.IDmlAction); - - /** DmlAction update. */ - public update?: (google.spanner.executor.v1.IQueryAction|null); - - /** DmlAction autocommitIfSupported. */ - public autocommitIfSupported?: (boolean|null); - - /** - * Creates a new DmlAction instance using the specified properties. - * @param [properties] Properties to set - * @returns DmlAction instance - */ - public static create(properties?: google.spanner.executor.v1.IDmlAction): google.spanner.executor.v1.DmlAction; - - /** - * Encodes the specified DmlAction message. Does not implicitly {@link google.spanner.executor.v1.DmlAction.verify|verify} messages. - * @param message DmlAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.executor.v1.IDmlAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DmlAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.DmlAction.verify|verify} messages. - * @param message DmlAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.executor.v1.IDmlAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DmlAction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DmlAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.DmlAction; - - /** - * Decodes a DmlAction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DmlAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.DmlAction; - - /** - * Verifies a DmlAction message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DmlAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DmlAction - */ - public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.DmlAction; - - /** - * Creates a plain object from a DmlAction message. Also converts values to other types if specified. - * @param message DmlAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.executor.v1.DmlAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DmlAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DmlAction - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BatchDmlAction. */ - interface IBatchDmlAction { - - /** BatchDmlAction updates */ - updates?: (google.spanner.executor.v1.IQueryAction[]|null); - } - - /** Represents a BatchDmlAction. */ - class BatchDmlAction implements IBatchDmlAction { - - /** - * Constructs a new BatchDmlAction. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.executor.v1.IBatchDmlAction); - - /** BatchDmlAction updates. */ - public updates: google.spanner.executor.v1.IQueryAction[]; - - /** - * Creates a new BatchDmlAction instance using the specified properties. - * @param [properties] Properties to set - * @returns BatchDmlAction instance - */ - public static create(properties?: google.spanner.executor.v1.IBatchDmlAction): google.spanner.executor.v1.BatchDmlAction; - - /** - * Encodes the specified BatchDmlAction message. Does not implicitly {@link google.spanner.executor.v1.BatchDmlAction.verify|verify} messages. - * @param message BatchDmlAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.executor.v1.IBatchDmlAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BatchDmlAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.BatchDmlAction.verify|verify} messages. - * @param message BatchDmlAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.executor.v1.IBatchDmlAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BatchDmlAction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BatchDmlAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.BatchDmlAction; - - /** - * Decodes a BatchDmlAction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BatchDmlAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.BatchDmlAction; - - /** - * Verifies a BatchDmlAction message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BatchDmlAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BatchDmlAction - */ - public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.BatchDmlAction; - - /** - * Creates a plain object from a BatchDmlAction message. Also converts values to other types if specified. - * @param message BatchDmlAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.executor.v1.BatchDmlAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BatchDmlAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BatchDmlAction - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Value. */ - interface IValue { - - /** Value isNull */ - isNull?: (boolean|null); - - /** Value intValue */ - intValue?: (number|Long|string|null); - - /** Value boolValue */ - boolValue?: (boolean|null); - - /** Value doubleValue */ - doubleValue?: (number|null); - - /** Value bytesValue */ - bytesValue?: (Uint8Array|Buffer|string|null); - - /** Value stringValue */ - stringValue?: (string|null); - - /** Value structValue */ - structValue?: (google.spanner.executor.v1.IValueList|null); - - /** Value timestampValue */ - timestampValue?: (google.protobuf.ITimestamp|null); - - /** Value dateDaysValue */ - dateDaysValue?: (number|null); - - /** Value isCommitTimestamp */ - isCommitTimestamp?: (boolean|null); - - /** Value arrayValue */ - arrayValue?: (google.spanner.executor.v1.IValueList|null); - - /** Value arrayType */ - arrayType?: (google.spanner.v1.IType|null); - } - - /** Represents a Value. */ - class Value implements IValue { - - /** - * Constructs a new Value. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.executor.v1.IValue); - - /** Value isNull. */ - public isNull?: (boolean|null); - - /** Value intValue. */ - public intValue?: (number|Long|string|null); - - /** Value boolValue. */ - public boolValue?: (boolean|null); - - /** Value doubleValue. */ - public doubleValue?: (number|null); - - /** Value bytesValue. */ - public bytesValue?: (Uint8Array|Buffer|string|null); - - /** Value stringValue. */ - public stringValue?: (string|null); - - /** Value structValue. */ - public structValue?: (google.spanner.executor.v1.IValueList|null); - - /** Value timestampValue. */ - public timestampValue?: (google.protobuf.ITimestamp|null); - - /** Value dateDaysValue. */ - public dateDaysValue?: (number|null); - - /** Value isCommitTimestamp. */ - public isCommitTimestamp?: (boolean|null); - - /** Value arrayValue. */ - public arrayValue?: (google.spanner.executor.v1.IValueList|null); - - /** Value arrayType. */ - public arrayType?: (google.spanner.v1.IType|null); - - /** Value valueType. */ - public valueType?: ("isNull"|"intValue"|"boolValue"|"doubleValue"|"bytesValue"|"stringValue"|"structValue"|"timestampValue"|"dateDaysValue"|"isCommitTimestamp"|"arrayValue"); - - /** - * Creates a new Value instance using the specified properties. - * @param [properties] Properties to set - * @returns Value instance - */ - public static create(properties?: google.spanner.executor.v1.IValue): google.spanner.executor.v1.Value; - - /** - * Encodes the specified Value message. Does not implicitly {@link google.spanner.executor.v1.Value.verify|verify} messages. - * @param message Value message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.executor.v1.IValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Value message, length delimited. Does not implicitly {@link google.spanner.executor.v1.Value.verify|verify} messages. - * @param message Value message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.executor.v1.IValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Value message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.Value; - - /** - * Decodes a Value message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.Value; - - /** - * Verifies a Value message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Value message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Value - */ - public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.Value; - - /** - * Creates a plain object from a Value message. Also converts values to other types if specified. - * @param message Value - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.executor.v1.Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Value to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Value - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a KeyRange. */ - interface IKeyRange { - - /** KeyRange start */ - start?: (google.spanner.executor.v1.IValueList|null); - - /** KeyRange limit */ - limit?: (google.spanner.executor.v1.IValueList|null); - - /** KeyRange type */ - type?: (google.spanner.executor.v1.KeyRange.Type|keyof typeof google.spanner.executor.v1.KeyRange.Type|null); - } - - /** Represents a KeyRange. */ - class KeyRange implements IKeyRange { - - /** - * Constructs a new KeyRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.executor.v1.IKeyRange); - - /** KeyRange start. */ - public start?: (google.spanner.executor.v1.IValueList|null); - - /** KeyRange limit. */ - public limit?: (google.spanner.executor.v1.IValueList|null); - - /** KeyRange type. */ - public type?: (google.spanner.executor.v1.KeyRange.Type|keyof typeof google.spanner.executor.v1.KeyRange.Type|null); - - /** - * Creates a new KeyRange instance using the specified properties. - * @param [properties] Properties to set - * @returns KeyRange instance - */ - public static create(properties?: google.spanner.executor.v1.IKeyRange): google.spanner.executor.v1.KeyRange; - - /** - * Encodes the specified KeyRange message. Does not implicitly {@link google.spanner.executor.v1.KeyRange.verify|verify} messages. - * @param message KeyRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.executor.v1.IKeyRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified KeyRange message, length delimited. Does not implicitly {@link google.spanner.executor.v1.KeyRange.verify|verify} messages. - * @param message KeyRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.executor.v1.IKeyRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a KeyRange message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns KeyRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.KeyRange; - - /** - * Decodes a KeyRange message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns KeyRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.KeyRange; - - /** - * Verifies a KeyRange message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a KeyRange message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns KeyRange - */ - public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.KeyRange; - - /** - * Creates a plain object from a KeyRange message. Also converts values to other types if specified. - * @param message KeyRange - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.executor.v1.KeyRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this KeyRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for KeyRange - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace KeyRange { - - /** Type enum. */ - enum Type { - TYPE_UNSPECIFIED = 0, - CLOSED_CLOSED = 1, - CLOSED_OPEN = 2, - OPEN_CLOSED = 3, - OPEN_OPEN = 4 - } - } - - /** Properties of a KeySet. */ - interface IKeySet { - - /** KeySet point */ - point?: (google.spanner.executor.v1.IValueList[]|null); - - /** KeySet range */ - range?: (google.spanner.executor.v1.IKeyRange[]|null); - - /** KeySet all */ - all?: (boolean|null); - } - - /** Represents a KeySet. */ - class KeySet implements IKeySet { - - /** - * Constructs a new KeySet. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.executor.v1.IKeySet); - - /** KeySet point. */ - public point: google.spanner.executor.v1.IValueList[]; - - /** KeySet range. */ - public range: google.spanner.executor.v1.IKeyRange[]; - - /** KeySet all. */ - public all: boolean; - - /** - * Creates a new KeySet instance using the specified properties. - * @param [properties] Properties to set - * @returns KeySet instance - */ - public static create(properties?: google.spanner.executor.v1.IKeySet): google.spanner.executor.v1.KeySet; - - /** - * Encodes the specified KeySet message. Does not implicitly {@link google.spanner.executor.v1.KeySet.verify|verify} messages. - * @param message KeySet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.executor.v1.IKeySet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified KeySet message, length delimited. Does not implicitly {@link google.spanner.executor.v1.KeySet.verify|verify} messages. - * @param message KeySet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.executor.v1.IKeySet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a KeySet message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns KeySet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.KeySet; - - /** - * Decodes a KeySet message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns KeySet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.KeySet; - - /** - * Verifies a KeySet message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a KeySet message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns KeySet - */ - public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.KeySet; - - /** - * Creates a plain object from a KeySet message. Also converts values to other types if specified. - * @param message KeySet - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.executor.v1.KeySet, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this KeySet to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for KeySet - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ValueList. */ - interface IValueList { - - /** ValueList value */ - value?: (google.spanner.executor.v1.IValue[]|null); - } - - /** Represents a ValueList. */ - class ValueList implements IValueList { - - /** - * Constructs a new ValueList. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.executor.v1.IValueList); - - /** ValueList value. */ - public value: google.spanner.executor.v1.IValue[]; - - /** - * Creates a new ValueList instance using the specified properties. - * @param [properties] Properties to set - * @returns ValueList instance - */ - public static create(properties?: google.spanner.executor.v1.IValueList): google.spanner.executor.v1.ValueList; - - /** - * Encodes the specified ValueList message. Does not implicitly {@link google.spanner.executor.v1.ValueList.verify|verify} messages. - * @param message ValueList message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.executor.v1.IValueList, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ValueList message, length delimited. Does not implicitly {@link google.spanner.executor.v1.ValueList.verify|verify} messages. - * @param message ValueList message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.executor.v1.IValueList, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ValueList message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ValueList - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.ValueList; - - /** - * Decodes a ValueList message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ValueList - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.ValueList; - - /** - * Verifies a ValueList message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ValueList message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ValueList - */ - public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.ValueList; - - /** - * Creates a plain object from a ValueList message. Also converts values to other types if specified. - * @param message ValueList - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.executor.v1.ValueList, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ValueList to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ValueList - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a MutationAction. */ - interface IMutationAction { - - /** MutationAction mod */ - mod?: (google.spanner.executor.v1.MutationAction.IMod[]|null); - } - - /** Represents a MutationAction. */ - class MutationAction implements IMutationAction { - - /** - * Constructs a new MutationAction. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.executor.v1.IMutationAction); - - /** MutationAction mod. */ - public mod: google.spanner.executor.v1.MutationAction.IMod[]; - - /** - * Creates a new MutationAction instance using the specified properties. - * @param [properties] Properties to set - * @returns MutationAction instance - */ - public static create(properties?: google.spanner.executor.v1.IMutationAction): google.spanner.executor.v1.MutationAction; - - /** - * Encodes the specified MutationAction message. Does not implicitly {@link google.spanner.executor.v1.MutationAction.verify|verify} messages. - * @param message MutationAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.executor.v1.IMutationAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MutationAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.MutationAction.verify|verify} messages. - * @param message MutationAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.executor.v1.IMutationAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MutationAction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MutationAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.MutationAction; - - /** - * Decodes a MutationAction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MutationAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.MutationAction; - - /** - * Verifies a MutationAction message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MutationAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MutationAction - */ - public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.MutationAction; - - /** - * Creates a plain object from a MutationAction message. Also converts values to other types if specified. - * @param message MutationAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.executor.v1.MutationAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MutationAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MutationAction - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace MutationAction { - - /** Properties of an InsertArgs. */ - interface IInsertArgs { - - /** InsertArgs column */ - column?: (string[]|null); - - /** InsertArgs type */ - type?: (google.spanner.v1.IType[]|null); - - /** InsertArgs values */ - values?: (google.spanner.executor.v1.IValueList[]|null); - } - - /** Represents an InsertArgs. */ - class InsertArgs implements IInsertArgs { - - /** - * Constructs a new InsertArgs. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.executor.v1.MutationAction.IInsertArgs); - - /** InsertArgs column. */ - public column: string[]; - - /** InsertArgs type. */ - public type: google.spanner.v1.IType[]; - - /** InsertArgs values. */ - public values: google.spanner.executor.v1.IValueList[]; - - /** - * Creates a new InsertArgs instance using the specified properties. - * @param [properties] Properties to set - * @returns InsertArgs instance - */ - public static create(properties?: google.spanner.executor.v1.MutationAction.IInsertArgs): google.spanner.executor.v1.MutationAction.InsertArgs; - - /** - * Encodes the specified InsertArgs message. Does not implicitly {@link google.spanner.executor.v1.MutationAction.InsertArgs.verify|verify} messages. - * @param message InsertArgs message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.executor.v1.MutationAction.IInsertArgs, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified InsertArgs message, length delimited. Does not implicitly {@link google.spanner.executor.v1.MutationAction.InsertArgs.verify|verify} messages. - * @param message InsertArgs message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.executor.v1.MutationAction.IInsertArgs, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an InsertArgs message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns InsertArgs - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.MutationAction.InsertArgs; - - /** - * Decodes an InsertArgs message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns InsertArgs - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.MutationAction.InsertArgs; - - /** - * Verifies an InsertArgs message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an InsertArgs message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns InsertArgs - */ - public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.MutationAction.InsertArgs; - - /** - * Creates a plain object from an InsertArgs message. Also converts values to other types if specified. - * @param message InsertArgs - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.executor.v1.MutationAction.InsertArgs, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this InsertArgs to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for InsertArgs - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateArgs. */ - interface IUpdateArgs { - - /** UpdateArgs column */ - column?: (string[]|null); - - /** UpdateArgs type */ - type?: (google.spanner.v1.IType[]|null); - - /** UpdateArgs values */ - values?: (google.spanner.executor.v1.IValueList[]|null); - } - - /** Represents an UpdateArgs. */ - class UpdateArgs implements IUpdateArgs { - - /** - * Constructs a new UpdateArgs. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.executor.v1.MutationAction.IUpdateArgs); - - /** UpdateArgs column. */ - public column: string[]; - - /** UpdateArgs type. */ - public type: google.spanner.v1.IType[]; - - /** UpdateArgs values. */ - public values: google.spanner.executor.v1.IValueList[]; - - /** - * Creates a new UpdateArgs instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateArgs instance - */ - public static create(properties?: google.spanner.executor.v1.MutationAction.IUpdateArgs): google.spanner.executor.v1.MutationAction.UpdateArgs; - - /** - * Encodes the specified UpdateArgs message. Does not implicitly {@link google.spanner.executor.v1.MutationAction.UpdateArgs.verify|verify} messages. - * @param message UpdateArgs message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.executor.v1.MutationAction.IUpdateArgs, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateArgs message, length delimited. Does not implicitly {@link google.spanner.executor.v1.MutationAction.UpdateArgs.verify|verify} messages. - * @param message UpdateArgs message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.executor.v1.MutationAction.IUpdateArgs, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateArgs message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateArgs - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.MutationAction.UpdateArgs; - - /** - * Decodes an UpdateArgs message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateArgs - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.MutationAction.UpdateArgs; - - /** - * Verifies an UpdateArgs message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UpdateArgs message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateArgs - */ - public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.MutationAction.UpdateArgs; - - /** - * Creates a plain object from an UpdateArgs message. Also converts values to other types if specified. - * @param message UpdateArgs - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.executor.v1.MutationAction.UpdateArgs, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateArgs to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateArgs - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Mod. */ - interface IMod { - - /** Mod table */ - table?: (string|null); - - /** Mod insert */ - insert?: (google.spanner.executor.v1.MutationAction.IInsertArgs|null); - - /** Mod update */ - update?: (google.spanner.executor.v1.MutationAction.IUpdateArgs|null); - - /** Mod insertOrUpdate */ - insertOrUpdate?: (google.spanner.executor.v1.MutationAction.IInsertArgs|null); - - /** Mod replace */ - replace?: (google.spanner.executor.v1.MutationAction.IInsertArgs|null); - - /** Mod deleteKeys */ - deleteKeys?: (google.spanner.executor.v1.IKeySet|null); - } - - /** Represents a Mod. */ - class Mod implements IMod { - - /** - * Constructs a new Mod. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.executor.v1.MutationAction.IMod); - - /** Mod table. */ - public table: string; - - /** Mod insert. */ - public insert?: (google.spanner.executor.v1.MutationAction.IInsertArgs|null); - - /** Mod update. */ - public update?: (google.spanner.executor.v1.MutationAction.IUpdateArgs|null); - - /** Mod insertOrUpdate. */ - public insertOrUpdate?: (google.spanner.executor.v1.MutationAction.IInsertArgs|null); - - /** Mod replace. */ - public replace?: (google.spanner.executor.v1.MutationAction.IInsertArgs|null); - - /** Mod deleteKeys. */ - public deleteKeys?: (google.spanner.executor.v1.IKeySet|null); - - /** - * Creates a new Mod instance using the specified properties. - * @param [properties] Properties to set - * @returns Mod instance - */ - public static create(properties?: google.spanner.executor.v1.MutationAction.IMod): google.spanner.executor.v1.MutationAction.Mod; - - /** - * Encodes the specified Mod message. Does not implicitly {@link google.spanner.executor.v1.MutationAction.Mod.verify|verify} messages. - * @param message Mod message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.executor.v1.MutationAction.IMod, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Mod message, length delimited. Does not implicitly {@link google.spanner.executor.v1.MutationAction.Mod.verify|verify} messages. - * @param message Mod message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.executor.v1.MutationAction.IMod, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Mod message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Mod - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.MutationAction.Mod; - - /** - * Decodes a Mod message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Mod - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.MutationAction.Mod; - - /** - * Verifies a Mod message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Mod message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Mod - */ - public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.MutationAction.Mod; - - /** - * Creates a plain object from a Mod message. Also converts values to other types if specified. - * @param message Mod - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.executor.v1.MutationAction.Mod, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Mod to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Mod - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a WriteMutationsAction. */ - interface IWriteMutationsAction { - - /** WriteMutationsAction mutation */ - mutation?: (google.spanner.executor.v1.IMutationAction|null); - } - - /** Represents a WriteMutationsAction. */ - class WriteMutationsAction implements IWriteMutationsAction { - - /** - * Constructs a new WriteMutationsAction. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.executor.v1.IWriteMutationsAction); - - /** WriteMutationsAction mutation. */ - public mutation?: (google.spanner.executor.v1.IMutationAction|null); - - /** - * Creates a new WriteMutationsAction instance using the specified properties. - * @param [properties] Properties to set - * @returns WriteMutationsAction instance - */ - public static create(properties?: google.spanner.executor.v1.IWriteMutationsAction): google.spanner.executor.v1.WriteMutationsAction; - - /** - * Encodes the specified WriteMutationsAction message. Does not implicitly {@link google.spanner.executor.v1.WriteMutationsAction.verify|verify} messages. - * @param message WriteMutationsAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.executor.v1.IWriteMutationsAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified WriteMutationsAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.WriteMutationsAction.verify|verify} messages. - * @param message WriteMutationsAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.executor.v1.IWriteMutationsAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a WriteMutationsAction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns WriteMutationsAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.WriteMutationsAction; - - /** - * Decodes a WriteMutationsAction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns WriteMutationsAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.WriteMutationsAction; - - /** - * Verifies a WriteMutationsAction message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a WriteMutationsAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns WriteMutationsAction - */ - public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.WriteMutationsAction; - - /** - * Creates a plain object from a WriteMutationsAction message. Also converts values to other types if specified. - * @param message WriteMutationsAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.executor.v1.WriteMutationsAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this WriteMutationsAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for WriteMutationsAction - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PartitionedUpdateAction. */ - interface IPartitionedUpdateAction { - - /** PartitionedUpdateAction options */ - options?: (google.spanner.executor.v1.PartitionedUpdateAction.IExecutePartitionedUpdateOptions|null); - - /** PartitionedUpdateAction update */ - update?: (google.spanner.executor.v1.IQueryAction|null); - } - - /** Represents a PartitionedUpdateAction. */ - class PartitionedUpdateAction implements IPartitionedUpdateAction { - - /** - * Constructs a new PartitionedUpdateAction. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.executor.v1.IPartitionedUpdateAction); - - /** PartitionedUpdateAction options. */ - public options?: (google.spanner.executor.v1.PartitionedUpdateAction.IExecutePartitionedUpdateOptions|null); - - /** PartitionedUpdateAction update. */ - public update?: (google.spanner.executor.v1.IQueryAction|null); - - /** - * Creates a new PartitionedUpdateAction instance using the specified properties. - * @param [properties] Properties to set - * @returns PartitionedUpdateAction instance - */ - public static create(properties?: google.spanner.executor.v1.IPartitionedUpdateAction): google.spanner.executor.v1.PartitionedUpdateAction; - - /** - * Encodes the specified PartitionedUpdateAction message. Does not implicitly {@link google.spanner.executor.v1.PartitionedUpdateAction.verify|verify} messages. - * @param message PartitionedUpdateAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.executor.v1.IPartitionedUpdateAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PartitionedUpdateAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.PartitionedUpdateAction.verify|verify} messages. - * @param message PartitionedUpdateAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.executor.v1.IPartitionedUpdateAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PartitionedUpdateAction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PartitionedUpdateAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.PartitionedUpdateAction; - - /** - * Decodes a PartitionedUpdateAction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PartitionedUpdateAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.PartitionedUpdateAction; - - /** - * Verifies a PartitionedUpdateAction message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PartitionedUpdateAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PartitionedUpdateAction - */ - public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.PartitionedUpdateAction; - - /** - * Creates a plain object from a PartitionedUpdateAction message. Also converts values to other types if specified. - * @param message PartitionedUpdateAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.executor.v1.PartitionedUpdateAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PartitionedUpdateAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PartitionedUpdateAction - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace PartitionedUpdateAction { - - /** Properties of an ExecutePartitionedUpdateOptions. */ - interface IExecutePartitionedUpdateOptions { - - /** ExecutePartitionedUpdateOptions rpcPriority */ - rpcPriority?: (google.spanner.v1.RequestOptions.Priority|keyof typeof google.spanner.v1.RequestOptions.Priority|null); - - /** ExecutePartitionedUpdateOptions tag */ - tag?: (string|null); - } - - /** Represents an ExecutePartitionedUpdateOptions. */ - class ExecutePartitionedUpdateOptions implements IExecutePartitionedUpdateOptions { - - /** - * Constructs a new ExecutePartitionedUpdateOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.executor.v1.PartitionedUpdateAction.IExecutePartitionedUpdateOptions); - - /** ExecutePartitionedUpdateOptions rpcPriority. */ - public rpcPriority?: (google.spanner.v1.RequestOptions.Priority|keyof typeof google.spanner.v1.RequestOptions.Priority|null); - - /** ExecutePartitionedUpdateOptions tag. */ - public tag?: (string|null); - - /** - * Creates a new ExecutePartitionedUpdateOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns ExecutePartitionedUpdateOptions instance - */ - public static create(properties?: google.spanner.executor.v1.PartitionedUpdateAction.IExecutePartitionedUpdateOptions): google.spanner.executor.v1.PartitionedUpdateAction.ExecutePartitionedUpdateOptions; - - /** - * Encodes the specified ExecutePartitionedUpdateOptions message. Does not implicitly {@link google.spanner.executor.v1.PartitionedUpdateAction.ExecutePartitionedUpdateOptions.verify|verify} messages. - * @param message ExecutePartitionedUpdateOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.executor.v1.PartitionedUpdateAction.IExecutePartitionedUpdateOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExecutePartitionedUpdateOptions message, length delimited. Does not implicitly {@link google.spanner.executor.v1.PartitionedUpdateAction.ExecutePartitionedUpdateOptions.verify|verify} messages. - * @param message ExecutePartitionedUpdateOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.executor.v1.PartitionedUpdateAction.IExecutePartitionedUpdateOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExecutePartitionedUpdateOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExecutePartitionedUpdateOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.PartitionedUpdateAction.ExecutePartitionedUpdateOptions; - - /** - * Decodes an ExecutePartitionedUpdateOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExecutePartitionedUpdateOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.PartitionedUpdateAction.ExecutePartitionedUpdateOptions; - - /** - * Verifies an ExecutePartitionedUpdateOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ExecutePartitionedUpdateOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExecutePartitionedUpdateOptions - */ - public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.PartitionedUpdateAction.ExecutePartitionedUpdateOptions; - - /** - * Creates a plain object from an ExecutePartitionedUpdateOptions message. Also converts values to other types if specified. - * @param message ExecutePartitionedUpdateOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.executor.v1.PartitionedUpdateAction.ExecutePartitionedUpdateOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExecutePartitionedUpdateOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExecutePartitionedUpdateOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a StartTransactionAction. */ - interface IStartTransactionAction { - - /** StartTransactionAction concurrency */ - concurrency?: (google.spanner.executor.v1.IConcurrency|null); - - /** StartTransactionAction table */ - table?: (google.spanner.executor.v1.ITableMetadata[]|null); - - /** StartTransactionAction transactionSeed */ - transactionSeed?: (string|null); - - /** StartTransactionAction executionOptions */ - executionOptions?: (google.spanner.executor.v1.ITransactionExecutionOptions|null); - } - - /** Represents a StartTransactionAction. */ - class StartTransactionAction implements IStartTransactionAction { - - /** - * Constructs a new StartTransactionAction. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.executor.v1.IStartTransactionAction); - - /** StartTransactionAction concurrency. */ - public concurrency?: (google.spanner.executor.v1.IConcurrency|null); - - /** StartTransactionAction table. */ - public table: google.spanner.executor.v1.ITableMetadata[]; - - /** StartTransactionAction transactionSeed. */ - public transactionSeed: string; - - /** StartTransactionAction executionOptions. */ - public executionOptions?: (google.spanner.executor.v1.ITransactionExecutionOptions|null); - - /** - * Creates a new StartTransactionAction instance using the specified properties. - * @param [properties] Properties to set - * @returns StartTransactionAction instance - */ - public static create(properties?: google.spanner.executor.v1.IStartTransactionAction): google.spanner.executor.v1.StartTransactionAction; - - /** - * Encodes the specified StartTransactionAction message. Does not implicitly {@link google.spanner.executor.v1.StartTransactionAction.verify|verify} messages. - * @param message StartTransactionAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.executor.v1.IStartTransactionAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified StartTransactionAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.StartTransactionAction.verify|verify} messages. - * @param message StartTransactionAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.executor.v1.IStartTransactionAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a StartTransactionAction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns StartTransactionAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.StartTransactionAction; - - /** - * Decodes a StartTransactionAction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns StartTransactionAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.StartTransactionAction; - - /** - * Verifies a StartTransactionAction message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a StartTransactionAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns StartTransactionAction - */ - public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.StartTransactionAction; - - /** - * Creates a plain object from a StartTransactionAction message. Also converts values to other types if specified. - * @param message StartTransactionAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.executor.v1.StartTransactionAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this StartTransactionAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for StartTransactionAction - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Concurrency. */ - interface IConcurrency { - - /** Concurrency stalenessSeconds */ - stalenessSeconds?: (number|null); - - /** Concurrency minReadTimestampMicros */ - minReadTimestampMicros?: (number|Long|string|null); - - /** Concurrency maxStalenessSeconds */ - maxStalenessSeconds?: (number|null); - - /** Concurrency exactTimestampMicros */ - exactTimestampMicros?: (number|Long|string|null); - - /** Concurrency strong */ - strong?: (boolean|null); - - /** Concurrency batch */ - batch?: (boolean|null); - - /** Concurrency snapshotEpochRead */ - snapshotEpochRead?: (boolean|null); - - /** Concurrency snapshotEpochRootTable */ - snapshotEpochRootTable?: (string|null); - - /** Concurrency batchReadTimestampMicros */ - batchReadTimestampMicros?: (number|Long|string|null); - } - - /** Represents a Concurrency. */ - class Concurrency implements IConcurrency { - - /** - * Constructs a new Concurrency. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.executor.v1.IConcurrency); - - /** Concurrency stalenessSeconds. */ - public stalenessSeconds?: (number|null); - - /** Concurrency minReadTimestampMicros. */ - public minReadTimestampMicros?: (number|Long|string|null); - - /** Concurrency maxStalenessSeconds. */ - public maxStalenessSeconds?: (number|null); - - /** Concurrency exactTimestampMicros. */ - public exactTimestampMicros?: (number|Long|string|null); - - /** Concurrency strong. */ - public strong?: (boolean|null); - - /** Concurrency batch. */ - public batch?: (boolean|null); - - /** Concurrency snapshotEpochRead. */ - public snapshotEpochRead: boolean; - - /** Concurrency snapshotEpochRootTable. */ - public snapshotEpochRootTable: string; - - /** Concurrency batchReadTimestampMicros. */ - public batchReadTimestampMicros: (number|Long|string); - - /** Concurrency concurrencyMode. */ - public concurrencyMode?: ("stalenessSeconds"|"minReadTimestampMicros"|"maxStalenessSeconds"|"exactTimestampMicros"|"strong"|"batch"); - - /** - * Creates a new Concurrency instance using the specified properties. - * @param [properties] Properties to set - * @returns Concurrency instance - */ - public static create(properties?: google.spanner.executor.v1.IConcurrency): google.spanner.executor.v1.Concurrency; - - /** - * Encodes the specified Concurrency message. Does not implicitly {@link google.spanner.executor.v1.Concurrency.verify|verify} messages. - * @param message Concurrency message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.executor.v1.IConcurrency, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Concurrency message, length delimited. Does not implicitly {@link google.spanner.executor.v1.Concurrency.verify|verify} messages. - * @param message Concurrency message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.executor.v1.IConcurrency, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Concurrency message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Concurrency - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.Concurrency; - - /** - * Decodes a Concurrency message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Concurrency - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.Concurrency; - - /** - * Verifies a Concurrency message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Concurrency message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Concurrency - */ - public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.Concurrency; - - /** - * Creates a plain object from a Concurrency message. Also converts values to other types if specified. - * @param message Concurrency - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.executor.v1.Concurrency, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Concurrency to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Concurrency - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a TableMetadata. */ - interface ITableMetadata { - - /** TableMetadata name */ - name?: (string|null); - - /** TableMetadata column */ - column?: (google.spanner.executor.v1.IColumnMetadata[]|null); - - /** TableMetadata keyColumn */ - keyColumn?: (google.spanner.executor.v1.IColumnMetadata[]|null); - } - - /** Represents a TableMetadata. */ - class TableMetadata implements ITableMetadata { - - /** - * Constructs a new TableMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.executor.v1.ITableMetadata); - - /** TableMetadata name. */ - public name: string; - - /** TableMetadata column. */ - public column: google.spanner.executor.v1.IColumnMetadata[]; - - /** TableMetadata keyColumn. */ - public keyColumn: google.spanner.executor.v1.IColumnMetadata[]; - - /** - * Creates a new TableMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns TableMetadata instance - */ - public static create(properties?: google.spanner.executor.v1.ITableMetadata): google.spanner.executor.v1.TableMetadata; - - /** - * Encodes the specified TableMetadata message. Does not implicitly {@link google.spanner.executor.v1.TableMetadata.verify|verify} messages. - * @param message TableMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.executor.v1.ITableMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TableMetadata message, length delimited. Does not implicitly {@link google.spanner.executor.v1.TableMetadata.verify|verify} messages. - * @param message TableMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.executor.v1.ITableMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TableMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TableMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.TableMetadata; - - /** - * Decodes a TableMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TableMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.TableMetadata; - - /** - * Verifies a TableMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TableMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TableMetadata - */ - public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.TableMetadata; - - /** - * Creates a plain object from a TableMetadata message. Also converts values to other types if specified. - * @param message TableMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.executor.v1.TableMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TableMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TableMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ColumnMetadata. */ - interface IColumnMetadata { - - /** ColumnMetadata name */ - name?: (string|null); - - /** ColumnMetadata type */ - type?: (google.spanner.v1.IType|null); - } - - /** Represents a ColumnMetadata. */ - class ColumnMetadata implements IColumnMetadata { - - /** - * Constructs a new ColumnMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.executor.v1.IColumnMetadata); - - /** ColumnMetadata name. */ - public name: string; - - /** ColumnMetadata type. */ - public type?: (google.spanner.v1.IType|null); - - /** - * Creates a new ColumnMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns ColumnMetadata instance - */ - public static create(properties?: google.spanner.executor.v1.IColumnMetadata): google.spanner.executor.v1.ColumnMetadata; - - /** - * Encodes the specified ColumnMetadata message. Does not implicitly {@link google.spanner.executor.v1.ColumnMetadata.verify|verify} messages. - * @param message ColumnMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.executor.v1.IColumnMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ColumnMetadata message, length delimited. Does not implicitly {@link google.spanner.executor.v1.ColumnMetadata.verify|verify} messages. - * @param message ColumnMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.executor.v1.IColumnMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ColumnMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ColumnMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.ColumnMetadata; - - /** - * Decodes a ColumnMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ColumnMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.ColumnMetadata; - - /** - * Verifies a ColumnMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ColumnMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ColumnMetadata - */ - public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.ColumnMetadata; - - /** - * Creates a plain object from a ColumnMetadata message. Also converts values to other types if specified. - * @param message ColumnMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.executor.v1.ColumnMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ColumnMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ColumnMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a TransactionExecutionOptions. */ - interface ITransactionExecutionOptions { - - /** TransactionExecutionOptions optimistic */ - optimistic?: (boolean|null); - } - - /** Represents a TransactionExecutionOptions. */ - class TransactionExecutionOptions implements ITransactionExecutionOptions { - - /** - * Constructs a new TransactionExecutionOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.executor.v1.ITransactionExecutionOptions); - - /** TransactionExecutionOptions optimistic. */ - public optimistic: boolean; - - /** - * Creates a new TransactionExecutionOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns TransactionExecutionOptions instance - */ - public static create(properties?: google.spanner.executor.v1.ITransactionExecutionOptions): google.spanner.executor.v1.TransactionExecutionOptions; - - /** - * Encodes the specified TransactionExecutionOptions message. Does not implicitly {@link google.spanner.executor.v1.TransactionExecutionOptions.verify|verify} messages. - * @param message TransactionExecutionOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.executor.v1.ITransactionExecutionOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TransactionExecutionOptions message, length delimited. Does not implicitly {@link google.spanner.executor.v1.TransactionExecutionOptions.verify|verify} messages. - * @param message TransactionExecutionOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.executor.v1.ITransactionExecutionOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TransactionExecutionOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TransactionExecutionOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.TransactionExecutionOptions; - - /** - * Decodes a TransactionExecutionOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TransactionExecutionOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.TransactionExecutionOptions; - - /** - * Verifies a TransactionExecutionOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TransactionExecutionOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TransactionExecutionOptions - */ - public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.TransactionExecutionOptions; - - /** - * Creates a plain object from a TransactionExecutionOptions message. Also converts values to other types if specified. - * @param message TransactionExecutionOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.executor.v1.TransactionExecutionOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TransactionExecutionOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TransactionExecutionOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a FinishTransactionAction. */ - interface IFinishTransactionAction { - - /** FinishTransactionAction mode */ - mode?: (google.spanner.executor.v1.FinishTransactionAction.Mode|keyof typeof google.spanner.executor.v1.FinishTransactionAction.Mode|null); - } - - /** Represents a FinishTransactionAction. */ - class FinishTransactionAction implements IFinishTransactionAction { - - /** - * Constructs a new FinishTransactionAction. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.executor.v1.IFinishTransactionAction); - - /** FinishTransactionAction mode. */ - public mode: (google.spanner.executor.v1.FinishTransactionAction.Mode|keyof typeof google.spanner.executor.v1.FinishTransactionAction.Mode); - - /** - * Creates a new FinishTransactionAction instance using the specified properties. - * @param [properties] Properties to set - * @returns FinishTransactionAction instance - */ - public static create(properties?: google.spanner.executor.v1.IFinishTransactionAction): google.spanner.executor.v1.FinishTransactionAction; - - /** - * Encodes the specified FinishTransactionAction message. Does not implicitly {@link google.spanner.executor.v1.FinishTransactionAction.verify|verify} messages. - * @param message FinishTransactionAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.executor.v1.IFinishTransactionAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FinishTransactionAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.FinishTransactionAction.verify|verify} messages. - * @param message FinishTransactionAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.executor.v1.IFinishTransactionAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FinishTransactionAction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FinishTransactionAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.FinishTransactionAction; - - /** - * Decodes a FinishTransactionAction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FinishTransactionAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.FinishTransactionAction; - - /** - * Verifies a FinishTransactionAction message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FinishTransactionAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FinishTransactionAction - */ - public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.FinishTransactionAction; - - /** - * Creates a plain object from a FinishTransactionAction message. Also converts values to other types if specified. - * @param message FinishTransactionAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.executor.v1.FinishTransactionAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FinishTransactionAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FinishTransactionAction - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FinishTransactionAction { - - /** Mode enum. */ - enum Mode { - MODE_UNSPECIFIED = 0, - COMMIT = 1, - ABANDON = 2 - } - } - - /** Properties of an AdminAction. */ - interface IAdminAction { - - /** AdminAction createUserInstanceConfig */ - createUserInstanceConfig?: (google.spanner.executor.v1.ICreateUserInstanceConfigAction|null); - - /** AdminAction updateUserInstanceConfig */ - updateUserInstanceConfig?: (google.spanner.executor.v1.IUpdateUserInstanceConfigAction|null); - - /** AdminAction deleteUserInstanceConfig */ - deleteUserInstanceConfig?: (google.spanner.executor.v1.IDeleteUserInstanceConfigAction|null); - - /** AdminAction getCloudInstanceConfig */ - getCloudInstanceConfig?: (google.spanner.executor.v1.IGetCloudInstanceConfigAction|null); - - /** AdminAction listInstanceConfigs */ - listInstanceConfigs?: (google.spanner.executor.v1.IListCloudInstanceConfigsAction|null); - - /** AdminAction createCloudInstance */ - createCloudInstance?: (google.spanner.executor.v1.ICreateCloudInstanceAction|null); - - /** AdminAction updateCloudInstance */ - updateCloudInstance?: (google.spanner.executor.v1.IUpdateCloudInstanceAction|null); - - /** AdminAction deleteCloudInstance */ - deleteCloudInstance?: (google.spanner.executor.v1.IDeleteCloudInstanceAction|null); - - /** AdminAction listCloudInstances */ - listCloudInstances?: (google.spanner.executor.v1.IListCloudInstancesAction|null); - - /** AdminAction getCloudInstance */ - getCloudInstance?: (google.spanner.executor.v1.IGetCloudInstanceAction|null); - - /** AdminAction createCloudDatabase */ - createCloudDatabase?: (google.spanner.executor.v1.ICreateCloudDatabaseAction|null); - - /** AdminAction updateCloudDatabaseDdl */ - updateCloudDatabaseDdl?: (google.spanner.executor.v1.IUpdateCloudDatabaseDdlAction|null); - - /** AdminAction updateCloudDatabase */ - updateCloudDatabase?: (google.spanner.executor.v1.IUpdateCloudDatabaseAction|null); - - /** AdminAction dropCloudDatabase */ - dropCloudDatabase?: (google.spanner.executor.v1.IDropCloudDatabaseAction|null); - - /** AdminAction listCloudDatabases */ - listCloudDatabases?: (google.spanner.executor.v1.IListCloudDatabasesAction|null); - - /** AdminAction listCloudDatabaseOperations */ - listCloudDatabaseOperations?: (google.spanner.executor.v1.IListCloudDatabaseOperationsAction|null); - - /** AdminAction restoreCloudDatabase */ - restoreCloudDatabase?: (google.spanner.executor.v1.IRestoreCloudDatabaseAction|null); - - /** AdminAction getCloudDatabase */ - getCloudDatabase?: (google.spanner.executor.v1.IGetCloudDatabaseAction|null); - - /** AdminAction createCloudBackup */ - createCloudBackup?: (google.spanner.executor.v1.ICreateCloudBackupAction|null); - - /** AdminAction copyCloudBackup */ - copyCloudBackup?: (google.spanner.executor.v1.ICopyCloudBackupAction|null); - - /** AdminAction getCloudBackup */ - getCloudBackup?: (google.spanner.executor.v1.IGetCloudBackupAction|null); - - /** AdminAction updateCloudBackup */ - updateCloudBackup?: (google.spanner.executor.v1.IUpdateCloudBackupAction|null); - - /** AdminAction deleteCloudBackup */ - deleteCloudBackup?: (google.spanner.executor.v1.IDeleteCloudBackupAction|null); - - /** AdminAction listCloudBackups */ - listCloudBackups?: (google.spanner.executor.v1.IListCloudBackupsAction|null); - - /** AdminAction listCloudBackupOperations */ - listCloudBackupOperations?: (google.spanner.executor.v1.IListCloudBackupOperationsAction|null); - - /** AdminAction getOperation */ - getOperation?: (google.spanner.executor.v1.IGetOperationAction|null); - - /** AdminAction cancelOperation */ - cancelOperation?: (google.spanner.executor.v1.ICancelOperationAction|null); - - /** AdminAction changeQuorumCloudDatabase */ - changeQuorumCloudDatabase?: (google.spanner.executor.v1.IChangeQuorumCloudDatabaseAction|null); - } - - /** Represents an AdminAction. */ - class AdminAction implements IAdminAction { - - /** - * Constructs a new AdminAction. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.executor.v1.IAdminAction); - - /** AdminAction createUserInstanceConfig. */ - public createUserInstanceConfig?: (google.spanner.executor.v1.ICreateUserInstanceConfigAction|null); - - /** AdminAction updateUserInstanceConfig. */ - public updateUserInstanceConfig?: (google.spanner.executor.v1.IUpdateUserInstanceConfigAction|null); - - /** AdminAction deleteUserInstanceConfig. */ - public deleteUserInstanceConfig?: (google.spanner.executor.v1.IDeleteUserInstanceConfigAction|null); - - /** AdminAction getCloudInstanceConfig. */ - public getCloudInstanceConfig?: (google.spanner.executor.v1.IGetCloudInstanceConfigAction|null); - - /** AdminAction listInstanceConfigs. */ - public listInstanceConfigs?: (google.spanner.executor.v1.IListCloudInstanceConfigsAction|null); - - /** AdminAction createCloudInstance. */ - public createCloudInstance?: (google.spanner.executor.v1.ICreateCloudInstanceAction|null); - - /** AdminAction updateCloudInstance. */ - public updateCloudInstance?: (google.spanner.executor.v1.IUpdateCloudInstanceAction|null); - - /** AdminAction deleteCloudInstance. */ - public deleteCloudInstance?: (google.spanner.executor.v1.IDeleteCloudInstanceAction|null); - - /** AdminAction listCloudInstances. */ - public listCloudInstances?: (google.spanner.executor.v1.IListCloudInstancesAction|null); - - /** AdminAction getCloudInstance. */ - public getCloudInstance?: (google.spanner.executor.v1.IGetCloudInstanceAction|null); - - /** AdminAction createCloudDatabase. */ - public createCloudDatabase?: (google.spanner.executor.v1.ICreateCloudDatabaseAction|null); - - /** AdminAction updateCloudDatabaseDdl. */ - public updateCloudDatabaseDdl?: (google.spanner.executor.v1.IUpdateCloudDatabaseDdlAction|null); - - /** AdminAction updateCloudDatabase. */ - public updateCloudDatabase?: (google.spanner.executor.v1.IUpdateCloudDatabaseAction|null); - - /** AdminAction dropCloudDatabase. */ - public dropCloudDatabase?: (google.spanner.executor.v1.IDropCloudDatabaseAction|null); - - /** AdminAction listCloudDatabases. */ - public listCloudDatabases?: (google.spanner.executor.v1.IListCloudDatabasesAction|null); - - /** AdminAction listCloudDatabaseOperations. */ - public listCloudDatabaseOperations?: (google.spanner.executor.v1.IListCloudDatabaseOperationsAction|null); - - /** AdminAction restoreCloudDatabase. */ - public restoreCloudDatabase?: (google.spanner.executor.v1.IRestoreCloudDatabaseAction|null); - - /** AdminAction getCloudDatabase. */ - public getCloudDatabase?: (google.spanner.executor.v1.IGetCloudDatabaseAction|null); - - /** AdminAction createCloudBackup. */ - public createCloudBackup?: (google.spanner.executor.v1.ICreateCloudBackupAction|null); - - /** AdminAction copyCloudBackup. */ - public copyCloudBackup?: (google.spanner.executor.v1.ICopyCloudBackupAction|null); - - /** AdminAction getCloudBackup. */ - public getCloudBackup?: (google.spanner.executor.v1.IGetCloudBackupAction|null); - - /** AdminAction updateCloudBackup. */ - public updateCloudBackup?: (google.spanner.executor.v1.IUpdateCloudBackupAction|null); - - /** AdminAction deleteCloudBackup. */ - public deleteCloudBackup?: (google.spanner.executor.v1.IDeleteCloudBackupAction|null); - - /** AdminAction listCloudBackups. */ - public listCloudBackups?: (google.spanner.executor.v1.IListCloudBackupsAction|null); - - /** AdminAction listCloudBackupOperations. */ - public listCloudBackupOperations?: (google.spanner.executor.v1.IListCloudBackupOperationsAction|null); - - /** AdminAction getOperation. */ - public getOperation?: (google.spanner.executor.v1.IGetOperationAction|null); - - /** AdminAction cancelOperation. */ - public cancelOperation?: (google.spanner.executor.v1.ICancelOperationAction|null); - - /** AdminAction changeQuorumCloudDatabase. */ - public changeQuorumCloudDatabase?: (google.spanner.executor.v1.IChangeQuorumCloudDatabaseAction|null); - - /** AdminAction action. */ - public action?: ("createUserInstanceConfig"|"updateUserInstanceConfig"|"deleteUserInstanceConfig"|"getCloudInstanceConfig"|"listInstanceConfigs"|"createCloudInstance"|"updateCloudInstance"|"deleteCloudInstance"|"listCloudInstances"|"getCloudInstance"|"createCloudDatabase"|"updateCloudDatabaseDdl"|"updateCloudDatabase"|"dropCloudDatabase"|"listCloudDatabases"|"listCloudDatabaseOperations"|"restoreCloudDatabase"|"getCloudDatabase"|"createCloudBackup"|"copyCloudBackup"|"getCloudBackup"|"updateCloudBackup"|"deleteCloudBackup"|"listCloudBackups"|"listCloudBackupOperations"|"getOperation"|"cancelOperation"|"changeQuorumCloudDatabase"); - - /** - * Creates a new AdminAction instance using the specified properties. - * @param [properties] Properties to set - * @returns AdminAction instance - */ - public static create(properties?: google.spanner.executor.v1.IAdminAction): google.spanner.executor.v1.AdminAction; - - /** - * Encodes the specified AdminAction message. Does not implicitly {@link google.spanner.executor.v1.AdminAction.verify|verify} messages. - * @param message AdminAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.executor.v1.IAdminAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AdminAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.AdminAction.verify|verify} messages. - * @param message AdminAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.executor.v1.IAdminAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AdminAction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AdminAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.AdminAction; - - /** - * Decodes an AdminAction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AdminAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.AdminAction; - - /** - * Verifies an AdminAction message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an AdminAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AdminAction - */ - public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.AdminAction; - - /** - * Creates a plain object from an AdminAction message. Also converts values to other types if specified. - * @param message AdminAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.executor.v1.AdminAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AdminAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AdminAction - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateUserInstanceConfigAction. */ - interface ICreateUserInstanceConfigAction { - - /** CreateUserInstanceConfigAction userConfigId */ - userConfigId?: (string|null); - - /** CreateUserInstanceConfigAction projectId */ - projectId?: (string|null); - - /** CreateUserInstanceConfigAction baseConfigId */ - baseConfigId?: (string|null); - - /** CreateUserInstanceConfigAction replicas */ - replicas?: (google.spanner.admin.instance.v1.IReplicaInfo[]|null); - } - - /** Represents a CreateUserInstanceConfigAction. */ - class CreateUserInstanceConfigAction implements ICreateUserInstanceConfigAction { - - /** - * Constructs a new CreateUserInstanceConfigAction. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.executor.v1.ICreateUserInstanceConfigAction); - - /** CreateUserInstanceConfigAction userConfigId. */ - public userConfigId: string; - - /** CreateUserInstanceConfigAction projectId. */ - public projectId: string; - - /** CreateUserInstanceConfigAction baseConfigId. */ - public baseConfigId: string; - - /** CreateUserInstanceConfigAction replicas. */ - public replicas: google.spanner.admin.instance.v1.IReplicaInfo[]; - - /** - * Creates a new CreateUserInstanceConfigAction instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateUserInstanceConfigAction instance - */ - public static create(properties?: google.spanner.executor.v1.ICreateUserInstanceConfigAction): google.spanner.executor.v1.CreateUserInstanceConfigAction; - - /** - * Encodes the specified CreateUserInstanceConfigAction message. Does not implicitly {@link google.spanner.executor.v1.CreateUserInstanceConfigAction.verify|verify} messages. - * @param message CreateUserInstanceConfigAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.executor.v1.ICreateUserInstanceConfigAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateUserInstanceConfigAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.CreateUserInstanceConfigAction.verify|verify} messages. - * @param message CreateUserInstanceConfigAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.executor.v1.ICreateUserInstanceConfigAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateUserInstanceConfigAction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateUserInstanceConfigAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.CreateUserInstanceConfigAction; - - /** - * Decodes a CreateUserInstanceConfigAction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateUserInstanceConfigAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.CreateUserInstanceConfigAction; - - /** - * Verifies a CreateUserInstanceConfigAction message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateUserInstanceConfigAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateUserInstanceConfigAction - */ - public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.CreateUserInstanceConfigAction; - - /** - * Creates a plain object from a CreateUserInstanceConfigAction message. Also converts values to other types if specified. - * @param message CreateUserInstanceConfigAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.executor.v1.CreateUserInstanceConfigAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateUserInstanceConfigAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateUserInstanceConfigAction - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateUserInstanceConfigAction. */ - interface IUpdateUserInstanceConfigAction { - - /** UpdateUserInstanceConfigAction userConfigId */ - userConfigId?: (string|null); - - /** UpdateUserInstanceConfigAction projectId */ - projectId?: (string|null); - - /** UpdateUserInstanceConfigAction displayName */ - displayName?: (string|null); - - /** UpdateUserInstanceConfigAction labels */ - labels?: ({ [k: string]: string }|null); - } - - /** Represents an UpdateUserInstanceConfigAction. */ - class UpdateUserInstanceConfigAction implements IUpdateUserInstanceConfigAction { - - /** - * Constructs a new UpdateUserInstanceConfigAction. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.executor.v1.IUpdateUserInstanceConfigAction); - - /** UpdateUserInstanceConfigAction userConfigId. */ - public userConfigId: string; - - /** UpdateUserInstanceConfigAction projectId. */ - public projectId: string; - - /** UpdateUserInstanceConfigAction displayName. */ - public displayName?: (string|null); - - /** UpdateUserInstanceConfigAction labels. */ - public labels: { [k: string]: string }; - - /** - * Creates a new UpdateUserInstanceConfigAction instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateUserInstanceConfigAction instance - */ - public static create(properties?: google.spanner.executor.v1.IUpdateUserInstanceConfigAction): google.spanner.executor.v1.UpdateUserInstanceConfigAction; - - /** - * Encodes the specified UpdateUserInstanceConfigAction message. Does not implicitly {@link google.spanner.executor.v1.UpdateUserInstanceConfigAction.verify|verify} messages. - * @param message UpdateUserInstanceConfigAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.executor.v1.IUpdateUserInstanceConfigAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateUserInstanceConfigAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.UpdateUserInstanceConfigAction.verify|verify} messages. - * @param message UpdateUserInstanceConfigAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.executor.v1.IUpdateUserInstanceConfigAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateUserInstanceConfigAction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateUserInstanceConfigAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.UpdateUserInstanceConfigAction; - - /** - * Decodes an UpdateUserInstanceConfigAction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateUserInstanceConfigAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.UpdateUserInstanceConfigAction; - - /** - * Verifies an UpdateUserInstanceConfigAction message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UpdateUserInstanceConfigAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateUserInstanceConfigAction - */ - public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.UpdateUserInstanceConfigAction; - - /** - * Creates a plain object from an UpdateUserInstanceConfigAction message. Also converts values to other types if specified. - * @param message UpdateUserInstanceConfigAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.executor.v1.UpdateUserInstanceConfigAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateUserInstanceConfigAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateUserInstanceConfigAction - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetCloudInstanceConfigAction. */ - interface IGetCloudInstanceConfigAction { - - /** GetCloudInstanceConfigAction instanceConfigId */ - instanceConfigId?: (string|null); - - /** GetCloudInstanceConfigAction projectId */ - projectId?: (string|null); - } - - /** Represents a GetCloudInstanceConfigAction. */ - class GetCloudInstanceConfigAction implements IGetCloudInstanceConfigAction { - - /** - * Constructs a new GetCloudInstanceConfigAction. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.executor.v1.IGetCloudInstanceConfigAction); - - /** GetCloudInstanceConfigAction instanceConfigId. */ - public instanceConfigId: string; - - /** GetCloudInstanceConfigAction projectId. */ - public projectId: string; - - /** - * Creates a new GetCloudInstanceConfigAction instance using the specified properties. - * @param [properties] Properties to set - * @returns GetCloudInstanceConfigAction instance - */ - public static create(properties?: google.spanner.executor.v1.IGetCloudInstanceConfigAction): google.spanner.executor.v1.GetCloudInstanceConfigAction; - - /** - * Encodes the specified GetCloudInstanceConfigAction message. Does not implicitly {@link google.spanner.executor.v1.GetCloudInstanceConfigAction.verify|verify} messages. - * @param message GetCloudInstanceConfigAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.executor.v1.IGetCloudInstanceConfigAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetCloudInstanceConfigAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.GetCloudInstanceConfigAction.verify|verify} messages. - * @param message GetCloudInstanceConfigAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.executor.v1.IGetCloudInstanceConfigAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetCloudInstanceConfigAction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetCloudInstanceConfigAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.GetCloudInstanceConfigAction; - - /** - * Decodes a GetCloudInstanceConfigAction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetCloudInstanceConfigAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.GetCloudInstanceConfigAction; - - /** - * Verifies a GetCloudInstanceConfigAction message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetCloudInstanceConfigAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetCloudInstanceConfigAction - */ - public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.GetCloudInstanceConfigAction; - - /** - * Creates a plain object from a GetCloudInstanceConfigAction message. Also converts values to other types if specified. - * @param message GetCloudInstanceConfigAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.executor.v1.GetCloudInstanceConfigAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetCloudInstanceConfigAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetCloudInstanceConfigAction - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteUserInstanceConfigAction. */ - interface IDeleteUserInstanceConfigAction { - - /** DeleteUserInstanceConfigAction userConfigId */ - userConfigId?: (string|null); - - /** DeleteUserInstanceConfigAction projectId */ - projectId?: (string|null); - } - - /** Represents a DeleteUserInstanceConfigAction. */ - class DeleteUserInstanceConfigAction implements IDeleteUserInstanceConfigAction { - - /** - * Constructs a new DeleteUserInstanceConfigAction. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.executor.v1.IDeleteUserInstanceConfigAction); - - /** DeleteUserInstanceConfigAction userConfigId. */ - public userConfigId: string; - - /** DeleteUserInstanceConfigAction projectId. */ - public projectId: string; - - /** - * Creates a new DeleteUserInstanceConfigAction instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteUserInstanceConfigAction instance - */ - public static create(properties?: google.spanner.executor.v1.IDeleteUserInstanceConfigAction): google.spanner.executor.v1.DeleteUserInstanceConfigAction; - - /** - * Encodes the specified DeleteUserInstanceConfigAction message. Does not implicitly {@link google.spanner.executor.v1.DeleteUserInstanceConfigAction.verify|verify} messages. - * @param message DeleteUserInstanceConfigAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.executor.v1.IDeleteUserInstanceConfigAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteUserInstanceConfigAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.DeleteUserInstanceConfigAction.verify|verify} messages. - * @param message DeleteUserInstanceConfigAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.executor.v1.IDeleteUserInstanceConfigAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteUserInstanceConfigAction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteUserInstanceConfigAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.DeleteUserInstanceConfigAction; - - /** - * Decodes a DeleteUserInstanceConfigAction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteUserInstanceConfigAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.DeleteUserInstanceConfigAction; - - /** - * Verifies a DeleteUserInstanceConfigAction message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteUserInstanceConfigAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteUserInstanceConfigAction - */ - public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.DeleteUserInstanceConfigAction; - - /** - * Creates a plain object from a DeleteUserInstanceConfigAction message. Also converts values to other types if specified. - * @param message DeleteUserInstanceConfigAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.executor.v1.DeleteUserInstanceConfigAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteUserInstanceConfigAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteUserInstanceConfigAction - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListCloudInstanceConfigsAction. */ - interface IListCloudInstanceConfigsAction { - - /** ListCloudInstanceConfigsAction projectId */ - projectId?: (string|null); - - /** ListCloudInstanceConfigsAction pageSize */ - pageSize?: (number|null); - - /** ListCloudInstanceConfigsAction pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListCloudInstanceConfigsAction. */ - class ListCloudInstanceConfigsAction implements IListCloudInstanceConfigsAction { - - /** - * Constructs a new ListCloudInstanceConfigsAction. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.executor.v1.IListCloudInstanceConfigsAction); - - /** ListCloudInstanceConfigsAction projectId. */ - public projectId: string; - - /** ListCloudInstanceConfigsAction pageSize. */ - public pageSize?: (number|null); - - /** ListCloudInstanceConfigsAction pageToken. */ - public pageToken?: (string|null); - - /** - * Creates a new ListCloudInstanceConfigsAction instance using the specified properties. - * @param [properties] Properties to set - * @returns ListCloudInstanceConfigsAction instance - */ - public static create(properties?: google.spanner.executor.v1.IListCloudInstanceConfigsAction): google.spanner.executor.v1.ListCloudInstanceConfigsAction; - - /** - * Encodes the specified ListCloudInstanceConfigsAction message. Does not implicitly {@link google.spanner.executor.v1.ListCloudInstanceConfigsAction.verify|verify} messages. - * @param message ListCloudInstanceConfigsAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.executor.v1.IListCloudInstanceConfigsAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListCloudInstanceConfigsAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.ListCloudInstanceConfigsAction.verify|verify} messages. - * @param message ListCloudInstanceConfigsAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.executor.v1.IListCloudInstanceConfigsAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListCloudInstanceConfigsAction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListCloudInstanceConfigsAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.ListCloudInstanceConfigsAction; - - /** - * Decodes a ListCloudInstanceConfigsAction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListCloudInstanceConfigsAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.ListCloudInstanceConfigsAction; - - /** - * Verifies a ListCloudInstanceConfigsAction message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListCloudInstanceConfigsAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListCloudInstanceConfigsAction - */ - public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.ListCloudInstanceConfigsAction; - - /** - * Creates a plain object from a ListCloudInstanceConfigsAction message. Also converts values to other types if specified. - * @param message ListCloudInstanceConfigsAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.executor.v1.ListCloudInstanceConfigsAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListCloudInstanceConfigsAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListCloudInstanceConfigsAction - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateCloudInstanceAction. */ - interface ICreateCloudInstanceAction { - - /** CreateCloudInstanceAction instanceId */ - instanceId?: (string|null); - - /** CreateCloudInstanceAction projectId */ - projectId?: (string|null); - - /** CreateCloudInstanceAction instanceConfigId */ - instanceConfigId?: (string|null); - - /** CreateCloudInstanceAction nodeCount */ - nodeCount?: (number|null); - - /** CreateCloudInstanceAction processingUnits */ - processingUnits?: (number|null); - - /** CreateCloudInstanceAction autoscalingConfig */ - autoscalingConfig?: (google.spanner.admin.instance.v1.IAutoscalingConfig|null); - - /** CreateCloudInstanceAction labels */ - labels?: ({ [k: string]: string }|null); - } - - /** Represents a CreateCloudInstanceAction. */ - class CreateCloudInstanceAction implements ICreateCloudInstanceAction { - - /** - * Constructs a new CreateCloudInstanceAction. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.executor.v1.ICreateCloudInstanceAction); - - /** CreateCloudInstanceAction instanceId. */ - public instanceId: string; - - /** CreateCloudInstanceAction projectId. */ - public projectId: string; - - /** CreateCloudInstanceAction instanceConfigId. */ - public instanceConfigId: string; - - /** CreateCloudInstanceAction nodeCount. */ - public nodeCount?: (number|null); - - /** CreateCloudInstanceAction processingUnits. */ - public processingUnits?: (number|null); - - /** CreateCloudInstanceAction autoscalingConfig. */ - public autoscalingConfig?: (google.spanner.admin.instance.v1.IAutoscalingConfig|null); - - /** CreateCloudInstanceAction labels. */ - public labels: { [k: string]: string }; - - /** - * Creates a new CreateCloudInstanceAction instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateCloudInstanceAction instance - */ - public static create(properties?: google.spanner.executor.v1.ICreateCloudInstanceAction): google.spanner.executor.v1.CreateCloudInstanceAction; - - /** - * Encodes the specified CreateCloudInstanceAction message. Does not implicitly {@link google.spanner.executor.v1.CreateCloudInstanceAction.verify|verify} messages. - * @param message CreateCloudInstanceAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.executor.v1.ICreateCloudInstanceAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateCloudInstanceAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.CreateCloudInstanceAction.verify|verify} messages. - * @param message CreateCloudInstanceAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.executor.v1.ICreateCloudInstanceAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateCloudInstanceAction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateCloudInstanceAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.CreateCloudInstanceAction; - - /** - * Decodes a CreateCloudInstanceAction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateCloudInstanceAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.CreateCloudInstanceAction; - - /** - * Verifies a CreateCloudInstanceAction message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateCloudInstanceAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateCloudInstanceAction - */ - public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.CreateCloudInstanceAction; - - /** - * Creates a plain object from a CreateCloudInstanceAction message. Also converts values to other types if specified. - * @param message CreateCloudInstanceAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.executor.v1.CreateCloudInstanceAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateCloudInstanceAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateCloudInstanceAction - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateCloudInstanceAction. */ - interface IUpdateCloudInstanceAction { - - /** UpdateCloudInstanceAction instanceId */ - instanceId?: (string|null); - - /** UpdateCloudInstanceAction projectId */ - projectId?: (string|null); - - /** UpdateCloudInstanceAction displayName */ - displayName?: (string|null); - - /** UpdateCloudInstanceAction nodeCount */ - nodeCount?: (number|null); - - /** UpdateCloudInstanceAction processingUnits */ - processingUnits?: (number|null); - - /** UpdateCloudInstanceAction autoscalingConfig */ - autoscalingConfig?: (google.spanner.admin.instance.v1.IAutoscalingConfig|null); - - /** UpdateCloudInstanceAction labels */ - labels?: ({ [k: string]: string }|null); - } - - /** Represents an UpdateCloudInstanceAction. */ - class UpdateCloudInstanceAction implements IUpdateCloudInstanceAction { - - /** - * Constructs a new UpdateCloudInstanceAction. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.executor.v1.IUpdateCloudInstanceAction); - - /** UpdateCloudInstanceAction instanceId. */ - public instanceId: string; - - /** UpdateCloudInstanceAction projectId. */ - public projectId: string; - - /** UpdateCloudInstanceAction displayName. */ - public displayName?: (string|null); - - /** UpdateCloudInstanceAction nodeCount. */ - public nodeCount?: (number|null); - - /** UpdateCloudInstanceAction processingUnits. */ - public processingUnits?: (number|null); - - /** UpdateCloudInstanceAction autoscalingConfig. */ - public autoscalingConfig?: (google.spanner.admin.instance.v1.IAutoscalingConfig|null); - - /** UpdateCloudInstanceAction labels. */ - public labels: { [k: string]: string }; - - /** - * Creates a new UpdateCloudInstanceAction instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateCloudInstanceAction instance - */ - public static create(properties?: google.spanner.executor.v1.IUpdateCloudInstanceAction): google.spanner.executor.v1.UpdateCloudInstanceAction; - - /** - * Encodes the specified UpdateCloudInstanceAction message. Does not implicitly {@link google.spanner.executor.v1.UpdateCloudInstanceAction.verify|verify} messages. - * @param message UpdateCloudInstanceAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.executor.v1.IUpdateCloudInstanceAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateCloudInstanceAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.UpdateCloudInstanceAction.verify|verify} messages. - * @param message UpdateCloudInstanceAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.executor.v1.IUpdateCloudInstanceAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateCloudInstanceAction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateCloudInstanceAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.UpdateCloudInstanceAction; - - /** - * Decodes an UpdateCloudInstanceAction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateCloudInstanceAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.UpdateCloudInstanceAction; - - /** - * Verifies an UpdateCloudInstanceAction message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UpdateCloudInstanceAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateCloudInstanceAction - */ - public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.UpdateCloudInstanceAction; - - /** - * Creates a plain object from an UpdateCloudInstanceAction message. Also converts values to other types if specified. - * @param message UpdateCloudInstanceAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.executor.v1.UpdateCloudInstanceAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateCloudInstanceAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateCloudInstanceAction - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteCloudInstanceAction. */ - interface IDeleteCloudInstanceAction { - - /** DeleteCloudInstanceAction instanceId */ - instanceId?: (string|null); - - /** DeleteCloudInstanceAction projectId */ - projectId?: (string|null); - } - - /** Represents a DeleteCloudInstanceAction. */ - class DeleteCloudInstanceAction implements IDeleteCloudInstanceAction { - - /** - * Constructs a new DeleteCloudInstanceAction. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.executor.v1.IDeleteCloudInstanceAction); - - /** DeleteCloudInstanceAction instanceId. */ - public instanceId: string; - - /** DeleteCloudInstanceAction projectId. */ - public projectId: string; - - /** - * Creates a new DeleteCloudInstanceAction instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteCloudInstanceAction instance - */ - public static create(properties?: google.spanner.executor.v1.IDeleteCloudInstanceAction): google.spanner.executor.v1.DeleteCloudInstanceAction; - - /** - * Encodes the specified DeleteCloudInstanceAction message. Does not implicitly {@link google.spanner.executor.v1.DeleteCloudInstanceAction.verify|verify} messages. - * @param message DeleteCloudInstanceAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.executor.v1.IDeleteCloudInstanceAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteCloudInstanceAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.DeleteCloudInstanceAction.verify|verify} messages. - * @param message DeleteCloudInstanceAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.executor.v1.IDeleteCloudInstanceAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteCloudInstanceAction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteCloudInstanceAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.DeleteCloudInstanceAction; - - /** - * Decodes a DeleteCloudInstanceAction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteCloudInstanceAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.DeleteCloudInstanceAction; - - /** - * Verifies a DeleteCloudInstanceAction message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteCloudInstanceAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteCloudInstanceAction - */ - public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.DeleteCloudInstanceAction; - - /** - * Creates a plain object from a DeleteCloudInstanceAction message. Also converts values to other types if specified. - * @param message DeleteCloudInstanceAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.executor.v1.DeleteCloudInstanceAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteCloudInstanceAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteCloudInstanceAction - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateCloudDatabaseAction. */ - interface ICreateCloudDatabaseAction { - - /** CreateCloudDatabaseAction instanceId */ - instanceId?: (string|null); - - /** CreateCloudDatabaseAction projectId */ - projectId?: (string|null); - - /** CreateCloudDatabaseAction databaseId */ - databaseId?: (string|null); - - /** CreateCloudDatabaseAction sdlStatement */ - sdlStatement?: (string[]|null); - - /** CreateCloudDatabaseAction encryptionConfig */ - encryptionConfig?: (google.spanner.admin.database.v1.IEncryptionConfig|null); - - /** CreateCloudDatabaseAction dialect */ - dialect?: (string|null); - - /** CreateCloudDatabaseAction protoDescriptors */ - protoDescriptors?: (Uint8Array|Buffer|string|null); - } - - /** Represents a CreateCloudDatabaseAction. */ - class CreateCloudDatabaseAction implements ICreateCloudDatabaseAction { - - /** - * Constructs a new CreateCloudDatabaseAction. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.executor.v1.ICreateCloudDatabaseAction); - - /** CreateCloudDatabaseAction instanceId. */ - public instanceId: string; - - /** CreateCloudDatabaseAction projectId. */ - public projectId: string; - - /** CreateCloudDatabaseAction databaseId. */ - public databaseId: string; - - /** CreateCloudDatabaseAction sdlStatement. */ - public sdlStatement: string[]; - - /** CreateCloudDatabaseAction encryptionConfig. */ - public encryptionConfig?: (google.spanner.admin.database.v1.IEncryptionConfig|null); - - /** CreateCloudDatabaseAction dialect. */ - public dialect?: (string|null); - - /** CreateCloudDatabaseAction protoDescriptors. */ - public protoDescriptors?: (Uint8Array|Buffer|string|null); - - /** - * Creates a new CreateCloudDatabaseAction instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateCloudDatabaseAction instance - */ - public static create(properties?: google.spanner.executor.v1.ICreateCloudDatabaseAction): google.spanner.executor.v1.CreateCloudDatabaseAction; - - /** - * Encodes the specified CreateCloudDatabaseAction message. Does not implicitly {@link google.spanner.executor.v1.CreateCloudDatabaseAction.verify|verify} messages. - * @param message CreateCloudDatabaseAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.executor.v1.ICreateCloudDatabaseAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateCloudDatabaseAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.CreateCloudDatabaseAction.verify|verify} messages. - * @param message CreateCloudDatabaseAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.executor.v1.ICreateCloudDatabaseAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateCloudDatabaseAction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateCloudDatabaseAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.CreateCloudDatabaseAction; - - /** - * Decodes a CreateCloudDatabaseAction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateCloudDatabaseAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.CreateCloudDatabaseAction; - - /** - * Verifies a CreateCloudDatabaseAction message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateCloudDatabaseAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateCloudDatabaseAction - */ - public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.CreateCloudDatabaseAction; - - /** - * Creates a plain object from a CreateCloudDatabaseAction message. Also converts values to other types if specified. - * @param message CreateCloudDatabaseAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.executor.v1.CreateCloudDatabaseAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateCloudDatabaseAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateCloudDatabaseAction - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateCloudDatabaseDdlAction. */ - interface IUpdateCloudDatabaseDdlAction { - - /** UpdateCloudDatabaseDdlAction instanceId */ - instanceId?: (string|null); - - /** UpdateCloudDatabaseDdlAction projectId */ - projectId?: (string|null); - - /** UpdateCloudDatabaseDdlAction databaseId */ - databaseId?: (string|null); - - /** UpdateCloudDatabaseDdlAction sdlStatement */ - sdlStatement?: (string[]|null); - - /** UpdateCloudDatabaseDdlAction operationId */ - operationId?: (string|null); - - /** UpdateCloudDatabaseDdlAction protoDescriptors */ - protoDescriptors?: (Uint8Array|Buffer|string|null); - } - - /** Represents an UpdateCloudDatabaseDdlAction. */ - class UpdateCloudDatabaseDdlAction implements IUpdateCloudDatabaseDdlAction { - - /** - * Constructs a new UpdateCloudDatabaseDdlAction. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.executor.v1.IUpdateCloudDatabaseDdlAction); - - /** UpdateCloudDatabaseDdlAction instanceId. */ - public instanceId: string; - - /** UpdateCloudDatabaseDdlAction projectId. */ - public projectId: string; - - /** UpdateCloudDatabaseDdlAction databaseId. */ - public databaseId: string; - - /** UpdateCloudDatabaseDdlAction sdlStatement. */ - public sdlStatement: string[]; - - /** UpdateCloudDatabaseDdlAction operationId. */ - public operationId: string; - - /** UpdateCloudDatabaseDdlAction protoDescriptors. */ - public protoDescriptors?: (Uint8Array|Buffer|string|null); - - /** - * Creates a new UpdateCloudDatabaseDdlAction instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateCloudDatabaseDdlAction instance - */ - public static create(properties?: google.spanner.executor.v1.IUpdateCloudDatabaseDdlAction): google.spanner.executor.v1.UpdateCloudDatabaseDdlAction; - - /** - * Encodes the specified UpdateCloudDatabaseDdlAction message. Does not implicitly {@link google.spanner.executor.v1.UpdateCloudDatabaseDdlAction.verify|verify} messages. - * @param message UpdateCloudDatabaseDdlAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.executor.v1.IUpdateCloudDatabaseDdlAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateCloudDatabaseDdlAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.UpdateCloudDatabaseDdlAction.verify|verify} messages. - * @param message UpdateCloudDatabaseDdlAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.executor.v1.IUpdateCloudDatabaseDdlAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateCloudDatabaseDdlAction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateCloudDatabaseDdlAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.UpdateCloudDatabaseDdlAction; - - /** - * Decodes an UpdateCloudDatabaseDdlAction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateCloudDatabaseDdlAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.UpdateCloudDatabaseDdlAction; - - /** - * Verifies an UpdateCloudDatabaseDdlAction message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UpdateCloudDatabaseDdlAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateCloudDatabaseDdlAction - */ - public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.UpdateCloudDatabaseDdlAction; - - /** - * Creates a plain object from an UpdateCloudDatabaseDdlAction message. Also converts values to other types if specified. - * @param message UpdateCloudDatabaseDdlAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.executor.v1.UpdateCloudDatabaseDdlAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateCloudDatabaseDdlAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateCloudDatabaseDdlAction - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateCloudDatabaseAction. */ - interface IUpdateCloudDatabaseAction { - - /** UpdateCloudDatabaseAction instanceId */ - instanceId?: (string|null); - - /** UpdateCloudDatabaseAction projectId */ - projectId?: (string|null); - - /** UpdateCloudDatabaseAction databaseName */ - databaseName?: (string|null); - - /** UpdateCloudDatabaseAction enableDropProtection */ - enableDropProtection?: (boolean|null); - } - - /** Represents an UpdateCloudDatabaseAction. */ - class UpdateCloudDatabaseAction implements IUpdateCloudDatabaseAction { - - /** - * Constructs a new UpdateCloudDatabaseAction. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.executor.v1.IUpdateCloudDatabaseAction); - - /** UpdateCloudDatabaseAction instanceId. */ - public instanceId: string; - - /** UpdateCloudDatabaseAction projectId. */ - public projectId: string; - - /** UpdateCloudDatabaseAction databaseName. */ - public databaseName: string; - - /** UpdateCloudDatabaseAction enableDropProtection. */ - public enableDropProtection: boolean; - - /** - * Creates a new UpdateCloudDatabaseAction instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateCloudDatabaseAction instance - */ - public static create(properties?: google.spanner.executor.v1.IUpdateCloudDatabaseAction): google.spanner.executor.v1.UpdateCloudDatabaseAction; - - /** - * Encodes the specified UpdateCloudDatabaseAction message. Does not implicitly {@link google.spanner.executor.v1.UpdateCloudDatabaseAction.verify|verify} messages. - * @param message UpdateCloudDatabaseAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.executor.v1.IUpdateCloudDatabaseAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateCloudDatabaseAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.UpdateCloudDatabaseAction.verify|verify} messages. - * @param message UpdateCloudDatabaseAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.executor.v1.IUpdateCloudDatabaseAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateCloudDatabaseAction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateCloudDatabaseAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.UpdateCloudDatabaseAction; - - /** - * Decodes an UpdateCloudDatabaseAction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateCloudDatabaseAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.UpdateCloudDatabaseAction; - - /** - * Verifies an UpdateCloudDatabaseAction message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UpdateCloudDatabaseAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateCloudDatabaseAction - */ - public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.UpdateCloudDatabaseAction; - - /** - * Creates a plain object from an UpdateCloudDatabaseAction message. Also converts values to other types if specified. - * @param message UpdateCloudDatabaseAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.executor.v1.UpdateCloudDatabaseAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateCloudDatabaseAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateCloudDatabaseAction - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DropCloudDatabaseAction. */ - interface IDropCloudDatabaseAction { - - /** DropCloudDatabaseAction instanceId */ - instanceId?: (string|null); - - /** DropCloudDatabaseAction projectId */ - projectId?: (string|null); - - /** DropCloudDatabaseAction databaseId */ - databaseId?: (string|null); - } - - /** Represents a DropCloudDatabaseAction. */ - class DropCloudDatabaseAction implements IDropCloudDatabaseAction { - - /** - * Constructs a new DropCloudDatabaseAction. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.executor.v1.IDropCloudDatabaseAction); - - /** DropCloudDatabaseAction instanceId. */ - public instanceId: string; - - /** DropCloudDatabaseAction projectId. */ - public projectId: string; - - /** DropCloudDatabaseAction databaseId. */ - public databaseId: string; - - /** - * Creates a new DropCloudDatabaseAction instance using the specified properties. - * @param [properties] Properties to set - * @returns DropCloudDatabaseAction instance - */ - public static create(properties?: google.spanner.executor.v1.IDropCloudDatabaseAction): google.spanner.executor.v1.DropCloudDatabaseAction; - - /** - * Encodes the specified DropCloudDatabaseAction message. Does not implicitly {@link google.spanner.executor.v1.DropCloudDatabaseAction.verify|verify} messages. - * @param message DropCloudDatabaseAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.executor.v1.IDropCloudDatabaseAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DropCloudDatabaseAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.DropCloudDatabaseAction.verify|verify} messages. - * @param message DropCloudDatabaseAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.executor.v1.IDropCloudDatabaseAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DropCloudDatabaseAction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DropCloudDatabaseAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.DropCloudDatabaseAction; - - /** - * Decodes a DropCloudDatabaseAction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DropCloudDatabaseAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.DropCloudDatabaseAction; - - /** - * Verifies a DropCloudDatabaseAction message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DropCloudDatabaseAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DropCloudDatabaseAction - */ - public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.DropCloudDatabaseAction; - - /** - * Creates a plain object from a DropCloudDatabaseAction message. Also converts values to other types if specified. - * @param message DropCloudDatabaseAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.executor.v1.DropCloudDatabaseAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DropCloudDatabaseAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DropCloudDatabaseAction - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ChangeQuorumCloudDatabaseAction. */ - interface IChangeQuorumCloudDatabaseAction { - - /** ChangeQuorumCloudDatabaseAction databaseUri */ - databaseUri?: (string|null); - - /** ChangeQuorumCloudDatabaseAction servingLocations */ - servingLocations?: (string[]|null); - } - - /** Represents a ChangeQuorumCloudDatabaseAction. */ - class ChangeQuorumCloudDatabaseAction implements IChangeQuorumCloudDatabaseAction { - - /** - * Constructs a new ChangeQuorumCloudDatabaseAction. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.executor.v1.IChangeQuorumCloudDatabaseAction); - - /** ChangeQuorumCloudDatabaseAction databaseUri. */ - public databaseUri?: (string|null); - - /** ChangeQuorumCloudDatabaseAction servingLocations. */ - public servingLocations: string[]; - - /** - * Creates a new ChangeQuorumCloudDatabaseAction instance using the specified properties. - * @param [properties] Properties to set - * @returns ChangeQuorumCloudDatabaseAction instance - */ - public static create(properties?: google.spanner.executor.v1.IChangeQuorumCloudDatabaseAction): google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction; - - /** - * Encodes the specified ChangeQuorumCloudDatabaseAction message. Does not implicitly {@link google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction.verify|verify} messages. - * @param message ChangeQuorumCloudDatabaseAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.executor.v1.IChangeQuorumCloudDatabaseAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ChangeQuorumCloudDatabaseAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction.verify|verify} messages. - * @param message ChangeQuorumCloudDatabaseAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.executor.v1.IChangeQuorumCloudDatabaseAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ChangeQuorumCloudDatabaseAction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ChangeQuorumCloudDatabaseAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction; - - /** - * Decodes a ChangeQuorumCloudDatabaseAction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ChangeQuorumCloudDatabaseAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction; - - /** - * Verifies a ChangeQuorumCloudDatabaseAction message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ChangeQuorumCloudDatabaseAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ChangeQuorumCloudDatabaseAction - */ - public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction; - - /** - * Creates a plain object from a ChangeQuorumCloudDatabaseAction message. Also converts values to other types if specified. - * @param message ChangeQuorumCloudDatabaseAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ChangeQuorumCloudDatabaseAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ChangeQuorumCloudDatabaseAction - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListCloudDatabasesAction. */ - interface IListCloudDatabasesAction { - - /** ListCloudDatabasesAction projectId */ - projectId?: (string|null); - - /** ListCloudDatabasesAction instanceId */ - instanceId?: (string|null); - - /** ListCloudDatabasesAction pageSize */ - pageSize?: (number|null); - - /** ListCloudDatabasesAction pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListCloudDatabasesAction. */ - class ListCloudDatabasesAction implements IListCloudDatabasesAction { - - /** - * Constructs a new ListCloudDatabasesAction. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.executor.v1.IListCloudDatabasesAction); - - /** ListCloudDatabasesAction projectId. */ - public projectId: string; - - /** ListCloudDatabasesAction instanceId. */ - public instanceId: string; - - /** ListCloudDatabasesAction pageSize. */ - public pageSize: number; - - /** ListCloudDatabasesAction pageToken. */ - public pageToken: string; - - /** - * Creates a new ListCloudDatabasesAction instance using the specified properties. - * @param [properties] Properties to set - * @returns ListCloudDatabasesAction instance - */ - public static create(properties?: google.spanner.executor.v1.IListCloudDatabasesAction): google.spanner.executor.v1.ListCloudDatabasesAction; - - /** - * Encodes the specified ListCloudDatabasesAction message. Does not implicitly {@link google.spanner.executor.v1.ListCloudDatabasesAction.verify|verify} messages. - * @param message ListCloudDatabasesAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.executor.v1.IListCloudDatabasesAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListCloudDatabasesAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.ListCloudDatabasesAction.verify|verify} messages. - * @param message ListCloudDatabasesAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.executor.v1.IListCloudDatabasesAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListCloudDatabasesAction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListCloudDatabasesAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.ListCloudDatabasesAction; - - /** - * Decodes a ListCloudDatabasesAction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListCloudDatabasesAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.ListCloudDatabasesAction; - - /** - * Verifies a ListCloudDatabasesAction message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListCloudDatabasesAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListCloudDatabasesAction - */ - public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.ListCloudDatabasesAction; - - /** - * Creates a plain object from a ListCloudDatabasesAction message. Also converts values to other types if specified. - * @param message ListCloudDatabasesAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.executor.v1.ListCloudDatabasesAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListCloudDatabasesAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListCloudDatabasesAction - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListCloudInstancesAction. */ - interface IListCloudInstancesAction { - - /** ListCloudInstancesAction projectId */ - projectId?: (string|null); - - /** ListCloudInstancesAction filter */ - filter?: (string|null); - - /** ListCloudInstancesAction pageSize */ - pageSize?: (number|null); - - /** ListCloudInstancesAction pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListCloudInstancesAction. */ - class ListCloudInstancesAction implements IListCloudInstancesAction { - - /** - * Constructs a new ListCloudInstancesAction. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.executor.v1.IListCloudInstancesAction); - - /** ListCloudInstancesAction projectId. */ - public projectId: string; - - /** ListCloudInstancesAction filter. */ - public filter?: (string|null); - - /** ListCloudInstancesAction pageSize. */ - public pageSize?: (number|null); - - /** ListCloudInstancesAction pageToken. */ - public pageToken?: (string|null); - - /** - * Creates a new ListCloudInstancesAction instance using the specified properties. - * @param [properties] Properties to set - * @returns ListCloudInstancesAction instance - */ - public static create(properties?: google.spanner.executor.v1.IListCloudInstancesAction): google.spanner.executor.v1.ListCloudInstancesAction; - - /** - * Encodes the specified ListCloudInstancesAction message. Does not implicitly {@link google.spanner.executor.v1.ListCloudInstancesAction.verify|verify} messages. - * @param message ListCloudInstancesAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.executor.v1.IListCloudInstancesAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListCloudInstancesAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.ListCloudInstancesAction.verify|verify} messages. - * @param message ListCloudInstancesAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.executor.v1.IListCloudInstancesAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListCloudInstancesAction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListCloudInstancesAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.ListCloudInstancesAction; - - /** - * Decodes a ListCloudInstancesAction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListCloudInstancesAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.ListCloudInstancesAction; - - /** - * Verifies a ListCloudInstancesAction message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListCloudInstancesAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListCloudInstancesAction - */ - public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.ListCloudInstancesAction; - - /** - * Creates a plain object from a ListCloudInstancesAction message. Also converts values to other types if specified. - * @param message ListCloudInstancesAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.executor.v1.ListCloudInstancesAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListCloudInstancesAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListCloudInstancesAction - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetCloudInstanceAction. */ - interface IGetCloudInstanceAction { - - /** GetCloudInstanceAction projectId */ - projectId?: (string|null); - - /** GetCloudInstanceAction instanceId */ - instanceId?: (string|null); - } - - /** Represents a GetCloudInstanceAction. */ - class GetCloudInstanceAction implements IGetCloudInstanceAction { - - /** - * Constructs a new GetCloudInstanceAction. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.executor.v1.IGetCloudInstanceAction); - - /** GetCloudInstanceAction projectId. */ - public projectId: string; - - /** GetCloudInstanceAction instanceId. */ - public instanceId: string; - - /** - * Creates a new GetCloudInstanceAction instance using the specified properties. - * @param [properties] Properties to set - * @returns GetCloudInstanceAction instance - */ - public static create(properties?: google.spanner.executor.v1.IGetCloudInstanceAction): google.spanner.executor.v1.GetCloudInstanceAction; - - /** - * Encodes the specified GetCloudInstanceAction message. Does not implicitly {@link google.spanner.executor.v1.GetCloudInstanceAction.verify|verify} messages. - * @param message GetCloudInstanceAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.executor.v1.IGetCloudInstanceAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetCloudInstanceAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.GetCloudInstanceAction.verify|verify} messages. - * @param message GetCloudInstanceAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.executor.v1.IGetCloudInstanceAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetCloudInstanceAction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetCloudInstanceAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.GetCloudInstanceAction; - - /** - * Decodes a GetCloudInstanceAction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetCloudInstanceAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.GetCloudInstanceAction; - - /** - * Verifies a GetCloudInstanceAction message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetCloudInstanceAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetCloudInstanceAction - */ - public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.GetCloudInstanceAction; - - /** - * Creates a plain object from a GetCloudInstanceAction message. Also converts values to other types if specified. - * @param message GetCloudInstanceAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.executor.v1.GetCloudInstanceAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetCloudInstanceAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetCloudInstanceAction - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListCloudDatabaseOperationsAction. */ - interface IListCloudDatabaseOperationsAction { - - /** ListCloudDatabaseOperationsAction projectId */ - projectId?: (string|null); - - /** ListCloudDatabaseOperationsAction instanceId */ - instanceId?: (string|null); - - /** ListCloudDatabaseOperationsAction filter */ - filter?: (string|null); - - /** ListCloudDatabaseOperationsAction pageSize */ - pageSize?: (number|null); - - /** ListCloudDatabaseOperationsAction pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListCloudDatabaseOperationsAction. */ - class ListCloudDatabaseOperationsAction implements IListCloudDatabaseOperationsAction { - - /** - * Constructs a new ListCloudDatabaseOperationsAction. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.executor.v1.IListCloudDatabaseOperationsAction); - - /** ListCloudDatabaseOperationsAction projectId. */ - public projectId: string; - - /** ListCloudDatabaseOperationsAction instanceId. */ - public instanceId: string; - - /** ListCloudDatabaseOperationsAction filter. */ - public filter: string; - - /** ListCloudDatabaseOperationsAction pageSize. */ - public pageSize: number; - - /** ListCloudDatabaseOperationsAction pageToken. */ - public pageToken: string; - - /** - * Creates a new ListCloudDatabaseOperationsAction instance using the specified properties. - * @param [properties] Properties to set - * @returns ListCloudDatabaseOperationsAction instance - */ - public static create(properties?: google.spanner.executor.v1.IListCloudDatabaseOperationsAction): google.spanner.executor.v1.ListCloudDatabaseOperationsAction; - - /** - * Encodes the specified ListCloudDatabaseOperationsAction message. Does not implicitly {@link google.spanner.executor.v1.ListCloudDatabaseOperationsAction.verify|verify} messages. - * @param message ListCloudDatabaseOperationsAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.executor.v1.IListCloudDatabaseOperationsAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListCloudDatabaseOperationsAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.ListCloudDatabaseOperationsAction.verify|verify} messages. - * @param message ListCloudDatabaseOperationsAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.executor.v1.IListCloudDatabaseOperationsAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListCloudDatabaseOperationsAction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListCloudDatabaseOperationsAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.ListCloudDatabaseOperationsAction; - - /** - * Decodes a ListCloudDatabaseOperationsAction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListCloudDatabaseOperationsAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.ListCloudDatabaseOperationsAction; - - /** - * Verifies a ListCloudDatabaseOperationsAction message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListCloudDatabaseOperationsAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListCloudDatabaseOperationsAction - */ - public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.ListCloudDatabaseOperationsAction; - - /** - * Creates a plain object from a ListCloudDatabaseOperationsAction message. Also converts values to other types if specified. - * @param message ListCloudDatabaseOperationsAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.executor.v1.ListCloudDatabaseOperationsAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListCloudDatabaseOperationsAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListCloudDatabaseOperationsAction - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RestoreCloudDatabaseAction. */ - interface IRestoreCloudDatabaseAction { - - /** RestoreCloudDatabaseAction projectId */ - projectId?: (string|null); - - /** RestoreCloudDatabaseAction backupInstanceId */ - backupInstanceId?: (string|null); - - /** RestoreCloudDatabaseAction backupId */ - backupId?: (string|null); - - /** RestoreCloudDatabaseAction databaseInstanceId */ - databaseInstanceId?: (string|null); - - /** RestoreCloudDatabaseAction databaseId */ - databaseId?: (string|null); - - /** RestoreCloudDatabaseAction encryptionConfig */ - encryptionConfig?: (google.spanner.admin.database.v1.IEncryptionConfig|null); - } - - /** Represents a RestoreCloudDatabaseAction. */ - class RestoreCloudDatabaseAction implements IRestoreCloudDatabaseAction { - - /** - * Constructs a new RestoreCloudDatabaseAction. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.executor.v1.IRestoreCloudDatabaseAction); - - /** RestoreCloudDatabaseAction projectId. */ - public projectId: string; - - /** RestoreCloudDatabaseAction backupInstanceId. */ - public backupInstanceId: string; - - /** RestoreCloudDatabaseAction backupId. */ - public backupId: string; - - /** RestoreCloudDatabaseAction databaseInstanceId. */ - public databaseInstanceId: string; - - /** RestoreCloudDatabaseAction databaseId. */ - public databaseId: string; - - /** RestoreCloudDatabaseAction encryptionConfig. */ - public encryptionConfig?: (google.spanner.admin.database.v1.IEncryptionConfig|null); - - /** - * Creates a new RestoreCloudDatabaseAction instance using the specified properties. - * @param [properties] Properties to set - * @returns RestoreCloudDatabaseAction instance - */ - public static create(properties?: google.spanner.executor.v1.IRestoreCloudDatabaseAction): google.spanner.executor.v1.RestoreCloudDatabaseAction; - - /** - * Encodes the specified RestoreCloudDatabaseAction message. Does not implicitly {@link google.spanner.executor.v1.RestoreCloudDatabaseAction.verify|verify} messages. - * @param message RestoreCloudDatabaseAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.executor.v1.IRestoreCloudDatabaseAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RestoreCloudDatabaseAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.RestoreCloudDatabaseAction.verify|verify} messages. - * @param message RestoreCloudDatabaseAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.executor.v1.IRestoreCloudDatabaseAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RestoreCloudDatabaseAction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RestoreCloudDatabaseAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.RestoreCloudDatabaseAction; - - /** - * Decodes a RestoreCloudDatabaseAction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RestoreCloudDatabaseAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.RestoreCloudDatabaseAction; - - /** - * Verifies a RestoreCloudDatabaseAction message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RestoreCloudDatabaseAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RestoreCloudDatabaseAction - */ - public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.RestoreCloudDatabaseAction; - - /** - * Creates a plain object from a RestoreCloudDatabaseAction message. Also converts values to other types if specified. - * @param message RestoreCloudDatabaseAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.executor.v1.RestoreCloudDatabaseAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RestoreCloudDatabaseAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RestoreCloudDatabaseAction - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetCloudDatabaseAction. */ - interface IGetCloudDatabaseAction { - - /** GetCloudDatabaseAction projectId */ - projectId?: (string|null); - - /** GetCloudDatabaseAction instanceId */ - instanceId?: (string|null); - - /** GetCloudDatabaseAction databaseId */ - databaseId?: (string|null); - } - - /** Represents a GetCloudDatabaseAction. */ - class GetCloudDatabaseAction implements IGetCloudDatabaseAction { - - /** - * Constructs a new GetCloudDatabaseAction. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.executor.v1.IGetCloudDatabaseAction); - - /** GetCloudDatabaseAction projectId. */ - public projectId: string; - - /** GetCloudDatabaseAction instanceId. */ - public instanceId: string; - - /** GetCloudDatabaseAction databaseId. */ - public databaseId: string; - - /** - * Creates a new GetCloudDatabaseAction instance using the specified properties. - * @param [properties] Properties to set - * @returns GetCloudDatabaseAction instance - */ - public static create(properties?: google.spanner.executor.v1.IGetCloudDatabaseAction): google.spanner.executor.v1.GetCloudDatabaseAction; - - /** - * Encodes the specified GetCloudDatabaseAction message. Does not implicitly {@link google.spanner.executor.v1.GetCloudDatabaseAction.verify|verify} messages. - * @param message GetCloudDatabaseAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.executor.v1.IGetCloudDatabaseAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetCloudDatabaseAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.GetCloudDatabaseAction.verify|verify} messages. - * @param message GetCloudDatabaseAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.executor.v1.IGetCloudDatabaseAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetCloudDatabaseAction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetCloudDatabaseAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.GetCloudDatabaseAction; - - /** - * Decodes a GetCloudDatabaseAction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetCloudDatabaseAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.GetCloudDatabaseAction; - - /** - * Verifies a GetCloudDatabaseAction message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetCloudDatabaseAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetCloudDatabaseAction - */ - public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.GetCloudDatabaseAction; - - /** - * Creates a plain object from a GetCloudDatabaseAction message. Also converts values to other types if specified. - * @param message GetCloudDatabaseAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.executor.v1.GetCloudDatabaseAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetCloudDatabaseAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetCloudDatabaseAction - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateCloudBackupAction. */ - interface ICreateCloudBackupAction { - - /** CreateCloudBackupAction projectId */ - projectId?: (string|null); - - /** CreateCloudBackupAction instanceId */ - instanceId?: (string|null); - - /** CreateCloudBackupAction backupId */ - backupId?: (string|null); - - /** CreateCloudBackupAction databaseId */ - databaseId?: (string|null); - - /** CreateCloudBackupAction expireTime */ - expireTime?: (google.protobuf.ITimestamp|null); - - /** CreateCloudBackupAction versionTime */ - versionTime?: (google.protobuf.ITimestamp|null); - - /** CreateCloudBackupAction encryptionConfig */ - encryptionConfig?: (google.spanner.admin.database.v1.IEncryptionConfig|null); - } - - /** Represents a CreateCloudBackupAction. */ - class CreateCloudBackupAction implements ICreateCloudBackupAction { - - /** - * Constructs a new CreateCloudBackupAction. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.executor.v1.ICreateCloudBackupAction); - - /** CreateCloudBackupAction projectId. */ - public projectId: string; - - /** CreateCloudBackupAction instanceId. */ - public instanceId: string; - - /** CreateCloudBackupAction backupId. */ - public backupId: string; - - /** CreateCloudBackupAction databaseId. */ - public databaseId: string; - - /** CreateCloudBackupAction expireTime. */ - public expireTime?: (google.protobuf.ITimestamp|null); - - /** CreateCloudBackupAction versionTime. */ - public versionTime?: (google.protobuf.ITimestamp|null); - - /** CreateCloudBackupAction encryptionConfig. */ - public encryptionConfig?: (google.spanner.admin.database.v1.IEncryptionConfig|null); - - /** - * Creates a new CreateCloudBackupAction instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateCloudBackupAction instance - */ - public static create(properties?: google.spanner.executor.v1.ICreateCloudBackupAction): google.spanner.executor.v1.CreateCloudBackupAction; - - /** - * Encodes the specified CreateCloudBackupAction message. Does not implicitly {@link google.spanner.executor.v1.CreateCloudBackupAction.verify|verify} messages. - * @param message CreateCloudBackupAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.executor.v1.ICreateCloudBackupAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateCloudBackupAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.CreateCloudBackupAction.verify|verify} messages. - * @param message CreateCloudBackupAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.executor.v1.ICreateCloudBackupAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateCloudBackupAction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateCloudBackupAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.CreateCloudBackupAction; - - /** - * Decodes a CreateCloudBackupAction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateCloudBackupAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.CreateCloudBackupAction; - - /** - * Verifies a CreateCloudBackupAction message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateCloudBackupAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateCloudBackupAction - */ - public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.CreateCloudBackupAction; - - /** - * Creates a plain object from a CreateCloudBackupAction message. Also converts values to other types if specified. - * @param message CreateCloudBackupAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.executor.v1.CreateCloudBackupAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateCloudBackupAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateCloudBackupAction - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CopyCloudBackupAction. */ - interface ICopyCloudBackupAction { - - /** CopyCloudBackupAction projectId */ - projectId?: (string|null); - - /** CopyCloudBackupAction instanceId */ - instanceId?: (string|null); - - /** CopyCloudBackupAction backupId */ - backupId?: (string|null); - - /** CopyCloudBackupAction sourceBackup */ - sourceBackup?: (string|null); - - /** CopyCloudBackupAction expireTime */ - expireTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a CopyCloudBackupAction. */ - class CopyCloudBackupAction implements ICopyCloudBackupAction { - - /** - * Constructs a new CopyCloudBackupAction. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.executor.v1.ICopyCloudBackupAction); - - /** CopyCloudBackupAction projectId. */ - public projectId: string; - - /** CopyCloudBackupAction instanceId. */ - public instanceId: string; - - /** CopyCloudBackupAction backupId. */ - public backupId: string; - - /** CopyCloudBackupAction sourceBackup. */ - public sourceBackup: string; - - /** CopyCloudBackupAction expireTime. */ - public expireTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new CopyCloudBackupAction instance using the specified properties. - * @param [properties] Properties to set - * @returns CopyCloudBackupAction instance - */ - public static create(properties?: google.spanner.executor.v1.ICopyCloudBackupAction): google.spanner.executor.v1.CopyCloudBackupAction; - - /** - * Encodes the specified CopyCloudBackupAction message. Does not implicitly {@link google.spanner.executor.v1.CopyCloudBackupAction.verify|verify} messages. - * @param message CopyCloudBackupAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.executor.v1.ICopyCloudBackupAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CopyCloudBackupAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.CopyCloudBackupAction.verify|verify} messages. - * @param message CopyCloudBackupAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.executor.v1.ICopyCloudBackupAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CopyCloudBackupAction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CopyCloudBackupAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.CopyCloudBackupAction; - - /** - * Decodes a CopyCloudBackupAction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CopyCloudBackupAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.CopyCloudBackupAction; - - /** - * Verifies a CopyCloudBackupAction message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CopyCloudBackupAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CopyCloudBackupAction - */ - public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.CopyCloudBackupAction; - - /** - * Creates a plain object from a CopyCloudBackupAction message. Also converts values to other types if specified. - * @param message CopyCloudBackupAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.executor.v1.CopyCloudBackupAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CopyCloudBackupAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CopyCloudBackupAction - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetCloudBackupAction. */ - interface IGetCloudBackupAction { - - /** GetCloudBackupAction projectId */ - projectId?: (string|null); - - /** GetCloudBackupAction instanceId */ - instanceId?: (string|null); - - /** GetCloudBackupAction backupId */ - backupId?: (string|null); - } - - /** Represents a GetCloudBackupAction. */ - class GetCloudBackupAction implements IGetCloudBackupAction { - - /** - * Constructs a new GetCloudBackupAction. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.executor.v1.IGetCloudBackupAction); - - /** GetCloudBackupAction projectId. */ - public projectId: string; - - /** GetCloudBackupAction instanceId. */ - public instanceId: string; - - /** GetCloudBackupAction backupId. */ - public backupId: string; - - /** - * Creates a new GetCloudBackupAction instance using the specified properties. - * @param [properties] Properties to set - * @returns GetCloudBackupAction instance - */ - public static create(properties?: google.spanner.executor.v1.IGetCloudBackupAction): google.spanner.executor.v1.GetCloudBackupAction; - - /** - * Encodes the specified GetCloudBackupAction message. Does not implicitly {@link google.spanner.executor.v1.GetCloudBackupAction.verify|verify} messages. - * @param message GetCloudBackupAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.executor.v1.IGetCloudBackupAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetCloudBackupAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.GetCloudBackupAction.verify|verify} messages. - * @param message GetCloudBackupAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.executor.v1.IGetCloudBackupAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetCloudBackupAction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetCloudBackupAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.GetCloudBackupAction; - - /** - * Decodes a GetCloudBackupAction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetCloudBackupAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.GetCloudBackupAction; - - /** - * Verifies a GetCloudBackupAction message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetCloudBackupAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetCloudBackupAction - */ - public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.GetCloudBackupAction; - - /** - * Creates a plain object from a GetCloudBackupAction message. Also converts values to other types if specified. - * @param message GetCloudBackupAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.executor.v1.GetCloudBackupAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetCloudBackupAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetCloudBackupAction - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateCloudBackupAction. */ - interface IUpdateCloudBackupAction { - - /** UpdateCloudBackupAction projectId */ - projectId?: (string|null); - - /** UpdateCloudBackupAction instanceId */ - instanceId?: (string|null); - - /** UpdateCloudBackupAction backupId */ - backupId?: (string|null); - - /** UpdateCloudBackupAction expireTime */ - expireTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents an UpdateCloudBackupAction. */ - class UpdateCloudBackupAction implements IUpdateCloudBackupAction { - - /** - * Constructs a new UpdateCloudBackupAction. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.executor.v1.IUpdateCloudBackupAction); - - /** UpdateCloudBackupAction projectId. */ - public projectId: string; - - /** UpdateCloudBackupAction instanceId. */ - public instanceId: string; - - /** UpdateCloudBackupAction backupId. */ - public backupId: string; - - /** UpdateCloudBackupAction expireTime. */ - public expireTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new UpdateCloudBackupAction instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateCloudBackupAction instance - */ - public static create(properties?: google.spanner.executor.v1.IUpdateCloudBackupAction): google.spanner.executor.v1.UpdateCloudBackupAction; - - /** - * Encodes the specified UpdateCloudBackupAction message. Does not implicitly {@link google.spanner.executor.v1.UpdateCloudBackupAction.verify|verify} messages. - * @param message UpdateCloudBackupAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.executor.v1.IUpdateCloudBackupAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateCloudBackupAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.UpdateCloudBackupAction.verify|verify} messages. - * @param message UpdateCloudBackupAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.executor.v1.IUpdateCloudBackupAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateCloudBackupAction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateCloudBackupAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.UpdateCloudBackupAction; - - /** - * Decodes an UpdateCloudBackupAction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateCloudBackupAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.UpdateCloudBackupAction; - - /** - * Verifies an UpdateCloudBackupAction message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UpdateCloudBackupAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateCloudBackupAction - */ - public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.UpdateCloudBackupAction; - - /** - * Creates a plain object from an UpdateCloudBackupAction message. Also converts values to other types if specified. - * @param message UpdateCloudBackupAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.executor.v1.UpdateCloudBackupAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateCloudBackupAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateCloudBackupAction - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteCloudBackupAction. */ - interface IDeleteCloudBackupAction { - - /** DeleteCloudBackupAction projectId */ - projectId?: (string|null); - - /** DeleteCloudBackupAction instanceId */ - instanceId?: (string|null); - - /** DeleteCloudBackupAction backupId */ - backupId?: (string|null); - } - - /** Represents a DeleteCloudBackupAction. */ - class DeleteCloudBackupAction implements IDeleteCloudBackupAction { - - /** - * Constructs a new DeleteCloudBackupAction. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.executor.v1.IDeleteCloudBackupAction); - - /** DeleteCloudBackupAction projectId. */ - public projectId: string; - - /** DeleteCloudBackupAction instanceId. */ - public instanceId: string; - - /** DeleteCloudBackupAction backupId. */ - public backupId: string; - - /** - * Creates a new DeleteCloudBackupAction instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteCloudBackupAction instance - */ - public static create(properties?: google.spanner.executor.v1.IDeleteCloudBackupAction): google.spanner.executor.v1.DeleteCloudBackupAction; - - /** - * Encodes the specified DeleteCloudBackupAction message. Does not implicitly {@link google.spanner.executor.v1.DeleteCloudBackupAction.verify|verify} messages. - * @param message DeleteCloudBackupAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.executor.v1.IDeleteCloudBackupAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteCloudBackupAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.DeleteCloudBackupAction.verify|verify} messages. - * @param message DeleteCloudBackupAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.executor.v1.IDeleteCloudBackupAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteCloudBackupAction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteCloudBackupAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.DeleteCloudBackupAction; - - /** - * Decodes a DeleteCloudBackupAction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteCloudBackupAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.DeleteCloudBackupAction; - - /** - * Verifies a DeleteCloudBackupAction message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteCloudBackupAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteCloudBackupAction - */ - public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.DeleteCloudBackupAction; - - /** - * Creates a plain object from a DeleteCloudBackupAction message. Also converts values to other types if specified. - * @param message DeleteCloudBackupAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.executor.v1.DeleteCloudBackupAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteCloudBackupAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteCloudBackupAction - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListCloudBackupsAction. */ - interface IListCloudBackupsAction { - - /** ListCloudBackupsAction projectId */ - projectId?: (string|null); - - /** ListCloudBackupsAction instanceId */ - instanceId?: (string|null); - - /** ListCloudBackupsAction filter */ - filter?: (string|null); - - /** ListCloudBackupsAction pageSize */ - pageSize?: (number|null); - - /** ListCloudBackupsAction pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListCloudBackupsAction. */ - class ListCloudBackupsAction implements IListCloudBackupsAction { - - /** - * Constructs a new ListCloudBackupsAction. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.executor.v1.IListCloudBackupsAction); - - /** ListCloudBackupsAction projectId. */ - public projectId: string; - - /** ListCloudBackupsAction instanceId. */ - public instanceId: string; - - /** ListCloudBackupsAction filter. */ - public filter: string; - - /** ListCloudBackupsAction pageSize. */ - public pageSize: number; - - /** ListCloudBackupsAction pageToken. */ - public pageToken: string; - - /** - * Creates a new ListCloudBackupsAction instance using the specified properties. - * @param [properties] Properties to set - * @returns ListCloudBackupsAction instance - */ - public static create(properties?: google.spanner.executor.v1.IListCloudBackupsAction): google.spanner.executor.v1.ListCloudBackupsAction; - - /** - * Encodes the specified ListCloudBackupsAction message. Does not implicitly {@link google.spanner.executor.v1.ListCloudBackupsAction.verify|verify} messages. - * @param message ListCloudBackupsAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.executor.v1.IListCloudBackupsAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListCloudBackupsAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.ListCloudBackupsAction.verify|verify} messages. - * @param message ListCloudBackupsAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.executor.v1.IListCloudBackupsAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListCloudBackupsAction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListCloudBackupsAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.ListCloudBackupsAction; - - /** - * Decodes a ListCloudBackupsAction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListCloudBackupsAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.ListCloudBackupsAction; - - /** - * Verifies a ListCloudBackupsAction message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListCloudBackupsAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListCloudBackupsAction - */ - public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.ListCloudBackupsAction; - - /** - * Creates a plain object from a ListCloudBackupsAction message. Also converts values to other types if specified. - * @param message ListCloudBackupsAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.executor.v1.ListCloudBackupsAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListCloudBackupsAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListCloudBackupsAction - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListCloudBackupOperationsAction. */ - interface IListCloudBackupOperationsAction { - - /** ListCloudBackupOperationsAction projectId */ - projectId?: (string|null); - - /** ListCloudBackupOperationsAction instanceId */ - instanceId?: (string|null); - - /** ListCloudBackupOperationsAction filter */ - filter?: (string|null); - - /** ListCloudBackupOperationsAction pageSize */ - pageSize?: (number|null); - - /** ListCloudBackupOperationsAction pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListCloudBackupOperationsAction. */ - class ListCloudBackupOperationsAction implements IListCloudBackupOperationsAction { - - /** - * Constructs a new ListCloudBackupOperationsAction. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.executor.v1.IListCloudBackupOperationsAction); - - /** ListCloudBackupOperationsAction projectId. */ - public projectId: string; - - /** ListCloudBackupOperationsAction instanceId. */ - public instanceId: string; - - /** ListCloudBackupOperationsAction filter. */ - public filter: string; - - /** ListCloudBackupOperationsAction pageSize. */ - public pageSize: number; - - /** ListCloudBackupOperationsAction pageToken. */ - public pageToken: string; - - /** - * Creates a new ListCloudBackupOperationsAction instance using the specified properties. - * @param [properties] Properties to set - * @returns ListCloudBackupOperationsAction instance - */ - public static create(properties?: google.spanner.executor.v1.IListCloudBackupOperationsAction): google.spanner.executor.v1.ListCloudBackupOperationsAction; - - /** - * Encodes the specified ListCloudBackupOperationsAction message. Does not implicitly {@link google.spanner.executor.v1.ListCloudBackupOperationsAction.verify|verify} messages. - * @param message ListCloudBackupOperationsAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.executor.v1.IListCloudBackupOperationsAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListCloudBackupOperationsAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.ListCloudBackupOperationsAction.verify|verify} messages. - * @param message ListCloudBackupOperationsAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.executor.v1.IListCloudBackupOperationsAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListCloudBackupOperationsAction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListCloudBackupOperationsAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.ListCloudBackupOperationsAction; - - /** - * Decodes a ListCloudBackupOperationsAction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListCloudBackupOperationsAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.ListCloudBackupOperationsAction; - - /** - * Verifies a ListCloudBackupOperationsAction message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListCloudBackupOperationsAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListCloudBackupOperationsAction - */ - public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.ListCloudBackupOperationsAction; - - /** - * Creates a plain object from a ListCloudBackupOperationsAction message. Also converts values to other types if specified. - * @param message ListCloudBackupOperationsAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.executor.v1.ListCloudBackupOperationsAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListCloudBackupOperationsAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListCloudBackupOperationsAction - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetOperationAction. */ - interface IGetOperationAction { - - /** GetOperationAction operation */ - operation?: (string|null); - } - - /** Represents a GetOperationAction. */ - class GetOperationAction implements IGetOperationAction { - - /** - * Constructs a new GetOperationAction. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.executor.v1.IGetOperationAction); - - /** GetOperationAction operation. */ - public operation: string; - - /** - * Creates a new GetOperationAction instance using the specified properties. - * @param [properties] Properties to set - * @returns GetOperationAction instance - */ - public static create(properties?: google.spanner.executor.v1.IGetOperationAction): google.spanner.executor.v1.GetOperationAction; - - /** - * Encodes the specified GetOperationAction message. Does not implicitly {@link google.spanner.executor.v1.GetOperationAction.verify|verify} messages. - * @param message GetOperationAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.executor.v1.IGetOperationAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetOperationAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.GetOperationAction.verify|verify} messages. - * @param message GetOperationAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.executor.v1.IGetOperationAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetOperationAction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetOperationAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.GetOperationAction; - - /** - * Decodes a GetOperationAction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetOperationAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.GetOperationAction; - - /** - * Verifies a GetOperationAction message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetOperationAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetOperationAction - */ - public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.GetOperationAction; - - /** - * Creates a plain object from a GetOperationAction message. Also converts values to other types if specified. - * @param message GetOperationAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.executor.v1.GetOperationAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetOperationAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetOperationAction - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a QueryCancellationAction. */ - interface IQueryCancellationAction { - - /** QueryCancellationAction longRunningSql */ - longRunningSql?: (string|null); - - /** QueryCancellationAction cancelQuery */ - cancelQuery?: (string|null); - } - - /** Represents a QueryCancellationAction. */ - class QueryCancellationAction implements IQueryCancellationAction { - - /** - * Constructs a new QueryCancellationAction. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.executor.v1.IQueryCancellationAction); - - /** QueryCancellationAction longRunningSql. */ - public longRunningSql: string; - - /** QueryCancellationAction cancelQuery. */ - public cancelQuery: string; - - /** - * Creates a new QueryCancellationAction instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryCancellationAction instance - */ - public static create(properties?: google.spanner.executor.v1.IQueryCancellationAction): google.spanner.executor.v1.QueryCancellationAction; - - /** - * Encodes the specified QueryCancellationAction message. Does not implicitly {@link google.spanner.executor.v1.QueryCancellationAction.verify|verify} messages. - * @param message QueryCancellationAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.executor.v1.IQueryCancellationAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryCancellationAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.QueryCancellationAction.verify|verify} messages. - * @param message QueryCancellationAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.executor.v1.IQueryCancellationAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryCancellationAction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryCancellationAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.QueryCancellationAction; - - /** - * Decodes a QueryCancellationAction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryCancellationAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.QueryCancellationAction; - - /** - * Verifies a QueryCancellationAction message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryCancellationAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryCancellationAction - */ - public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.QueryCancellationAction; - - /** - * Creates a plain object from a QueryCancellationAction message. Also converts values to other types if specified. - * @param message QueryCancellationAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.executor.v1.QueryCancellationAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryCancellationAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for QueryCancellationAction - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CancelOperationAction. */ - interface ICancelOperationAction { - - /** CancelOperationAction operation */ - operation?: (string|null); - } - - /** Represents a CancelOperationAction. */ - class CancelOperationAction implements ICancelOperationAction { - - /** - * Constructs a new CancelOperationAction. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.executor.v1.ICancelOperationAction); - - /** CancelOperationAction operation. */ - public operation: string; - - /** - * Creates a new CancelOperationAction instance using the specified properties. - * @param [properties] Properties to set - * @returns CancelOperationAction instance - */ - public static create(properties?: google.spanner.executor.v1.ICancelOperationAction): google.spanner.executor.v1.CancelOperationAction; - - /** - * Encodes the specified CancelOperationAction message. Does not implicitly {@link google.spanner.executor.v1.CancelOperationAction.verify|verify} messages. - * @param message CancelOperationAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.executor.v1.ICancelOperationAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CancelOperationAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.CancelOperationAction.verify|verify} messages. - * @param message CancelOperationAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.executor.v1.ICancelOperationAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CancelOperationAction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CancelOperationAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.CancelOperationAction; - - /** - * Decodes a CancelOperationAction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CancelOperationAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.CancelOperationAction; - - /** - * Verifies a CancelOperationAction message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CancelOperationAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CancelOperationAction - */ - public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.CancelOperationAction; - - /** - * Creates a plain object from a CancelOperationAction message. Also converts values to other types if specified. - * @param message CancelOperationAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.executor.v1.CancelOperationAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CancelOperationAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CancelOperationAction - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a StartBatchTransactionAction. */ - interface IStartBatchTransactionAction { - - /** StartBatchTransactionAction batchTxnTime */ - batchTxnTime?: (google.protobuf.ITimestamp|null); - - /** StartBatchTransactionAction tid */ - tid?: (Uint8Array|Buffer|string|null); - - /** StartBatchTransactionAction cloudDatabaseRole */ - cloudDatabaseRole?: (string|null); - } - - /** Represents a StartBatchTransactionAction. */ - class StartBatchTransactionAction implements IStartBatchTransactionAction { - - /** - * Constructs a new StartBatchTransactionAction. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.executor.v1.IStartBatchTransactionAction); - - /** StartBatchTransactionAction batchTxnTime. */ - public batchTxnTime?: (google.protobuf.ITimestamp|null); - - /** StartBatchTransactionAction tid. */ - public tid?: (Uint8Array|Buffer|string|null); - - /** StartBatchTransactionAction cloudDatabaseRole. */ - public cloudDatabaseRole: string; - - /** StartBatchTransactionAction param. */ - public param?: ("batchTxnTime"|"tid"); - - /** - * Creates a new StartBatchTransactionAction instance using the specified properties. - * @param [properties] Properties to set - * @returns StartBatchTransactionAction instance - */ - public static create(properties?: google.spanner.executor.v1.IStartBatchTransactionAction): google.spanner.executor.v1.StartBatchTransactionAction; - - /** - * Encodes the specified StartBatchTransactionAction message. Does not implicitly {@link google.spanner.executor.v1.StartBatchTransactionAction.verify|verify} messages. - * @param message StartBatchTransactionAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.executor.v1.IStartBatchTransactionAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified StartBatchTransactionAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.StartBatchTransactionAction.verify|verify} messages. - * @param message StartBatchTransactionAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.executor.v1.IStartBatchTransactionAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a StartBatchTransactionAction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns StartBatchTransactionAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.StartBatchTransactionAction; - - /** - * Decodes a StartBatchTransactionAction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns StartBatchTransactionAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.StartBatchTransactionAction; - - /** - * Verifies a StartBatchTransactionAction message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a StartBatchTransactionAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns StartBatchTransactionAction - */ - public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.StartBatchTransactionAction; - - /** - * Creates a plain object from a StartBatchTransactionAction message. Also converts values to other types if specified. - * @param message StartBatchTransactionAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.executor.v1.StartBatchTransactionAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this StartBatchTransactionAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for StartBatchTransactionAction - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CloseBatchTransactionAction. */ - interface ICloseBatchTransactionAction { - - /** CloseBatchTransactionAction cleanup */ - cleanup?: (boolean|null); - } - - /** Represents a CloseBatchTransactionAction. */ - class CloseBatchTransactionAction implements ICloseBatchTransactionAction { - - /** - * Constructs a new CloseBatchTransactionAction. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.executor.v1.ICloseBatchTransactionAction); - - /** CloseBatchTransactionAction cleanup. */ - public cleanup: boolean; - - /** - * Creates a new CloseBatchTransactionAction instance using the specified properties. - * @param [properties] Properties to set - * @returns CloseBatchTransactionAction instance - */ - public static create(properties?: google.spanner.executor.v1.ICloseBatchTransactionAction): google.spanner.executor.v1.CloseBatchTransactionAction; - - /** - * Encodes the specified CloseBatchTransactionAction message. Does not implicitly {@link google.spanner.executor.v1.CloseBatchTransactionAction.verify|verify} messages. - * @param message CloseBatchTransactionAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.executor.v1.ICloseBatchTransactionAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CloseBatchTransactionAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.CloseBatchTransactionAction.verify|verify} messages. - * @param message CloseBatchTransactionAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.executor.v1.ICloseBatchTransactionAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CloseBatchTransactionAction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CloseBatchTransactionAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.CloseBatchTransactionAction; - - /** - * Decodes a CloseBatchTransactionAction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CloseBatchTransactionAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.CloseBatchTransactionAction; - - /** - * Verifies a CloseBatchTransactionAction message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CloseBatchTransactionAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CloseBatchTransactionAction - */ - public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.CloseBatchTransactionAction; - - /** - * Creates a plain object from a CloseBatchTransactionAction message. Also converts values to other types if specified. - * @param message CloseBatchTransactionAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.executor.v1.CloseBatchTransactionAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CloseBatchTransactionAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CloseBatchTransactionAction - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GenerateDbPartitionsForReadAction. */ - interface IGenerateDbPartitionsForReadAction { - - /** GenerateDbPartitionsForReadAction read */ - read?: (google.spanner.executor.v1.IReadAction|null); - - /** GenerateDbPartitionsForReadAction table */ - table?: (google.spanner.executor.v1.ITableMetadata[]|null); - - /** GenerateDbPartitionsForReadAction desiredBytesPerPartition */ - desiredBytesPerPartition?: (number|Long|string|null); - - /** GenerateDbPartitionsForReadAction maxPartitionCount */ - maxPartitionCount?: (number|Long|string|null); - } - - /** Represents a GenerateDbPartitionsForReadAction. */ - class GenerateDbPartitionsForReadAction implements IGenerateDbPartitionsForReadAction { - - /** - * Constructs a new GenerateDbPartitionsForReadAction. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.executor.v1.IGenerateDbPartitionsForReadAction); - - /** GenerateDbPartitionsForReadAction read. */ - public read?: (google.spanner.executor.v1.IReadAction|null); - - /** GenerateDbPartitionsForReadAction table. */ - public table: google.spanner.executor.v1.ITableMetadata[]; - - /** GenerateDbPartitionsForReadAction desiredBytesPerPartition. */ - public desiredBytesPerPartition?: (number|Long|string|null); - - /** GenerateDbPartitionsForReadAction maxPartitionCount. */ - public maxPartitionCount?: (number|Long|string|null); - - /** - * Creates a new GenerateDbPartitionsForReadAction instance using the specified properties. - * @param [properties] Properties to set - * @returns GenerateDbPartitionsForReadAction instance - */ - public static create(properties?: google.spanner.executor.v1.IGenerateDbPartitionsForReadAction): google.spanner.executor.v1.GenerateDbPartitionsForReadAction; - - /** - * Encodes the specified GenerateDbPartitionsForReadAction message. Does not implicitly {@link google.spanner.executor.v1.GenerateDbPartitionsForReadAction.verify|verify} messages. - * @param message GenerateDbPartitionsForReadAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.executor.v1.IGenerateDbPartitionsForReadAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GenerateDbPartitionsForReadAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.GenerateDbPartitionsForReadAction.verify|verify} messages. - * @param message GenerateDbPartitionsForReadAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.executor.v1.IGenerateDbPartitionsForReadAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GenerateDbPartitionsForReadAction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GenerateDbPartitionsForReadAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.GenerateDbPartitionsForReadAction; - - /** - * Decodes a GenerateDbPartitionsForReadAction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GenerateDbPartitionsForReadAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.GenerateDbPartitionsForReadAction; - - /** - * Verifies a GenerateDbPartitionsForReadAction message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GenerateDbPartitionsForReadAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GenerateDbPartitionsForReadAction - */ - public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.GenerateDbPartitionsForReadAction; - - /** - * Creates a plain object from a GenerateDbPartitionsForReadAction message. Also converts values to other types if specified. - * @param message GenerateDbPartitionsForReadAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.executor.v1.GenerateDbPartitionsForReadAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GenerateDbPartitionsForReadAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GenerateDbPartitionsForReadAction - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GenerateDbPartitionsForQueryAction. */ - interface IGenerateDbPartitionsForQueryAction { - - /** GenerateDbPartitionsForQueryAction query */ - query?: (google.spanner.executor.v1.IQueryAction|null); - - /** GenerateDbPartitionsForQueryAction desiredBytesPerPartition */ - desiredBytesPerPartition?: (number|Long|string|null); - } - - /** Represents a GenerateDbPartitionsForQueryAction. */ - class GenerateDbPartitionsForQueryAction implements IGenerateDbPartitionsForQueryAction { - - /** - * Constructs a new GenerateDbPartitionsForQueryAction. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.executor.v1.IGenerateDbPartitionsForQueryAction); - - /** GenerateDbPartitionsForQueryAction query. */ - public query?: (google.spanner.executor.v1.IQueryAction|null); - - /** GenerateDbPartitionsForQueryAction desiredBytesPerPartition. */ - public desiredBytesPerPartition?: (number|Long|string|null); - - /** - * Creates a new GenerateDbPartitionsForQueryAction instance using the specified properties. - * @param [properties] Properties to set - * @returns GenerateDbPartitionsForQueryAction instance - */ - public static create(properties?: google.spanner.executor.v1.IGenerateDbPartitionsForQueryAction): google.spanner.executor.v1.GenerateDbPartitionsForQueryAction; - - /** - * Encodes the specified GenerateDbPartitionsForQueryAction message. Does not implicitly {@link google.spanner.executor.v1.GenerateDbPartitionsForQueryAction.verify|verify} messages. - * @param message GenerateDbPartitionsForQueryAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.executor.v1.IGenerateDbPartitionsForQueryAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GenerateDbPartitionsForQueryAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.GenerateDbPartitionsForQueryAction.verify|verify} messages. - * @param message GenerateDbPartitionsForQueryAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.executor.v1.IGenerateDbPartitionsForQueryAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GenerateDbPartitionsForQueryAction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GenerateDbPartitionsForQueryAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.GenerateDbPartitionsForQueryAction; - - /** - * Decodes a GenerateDbPartitionsForQueryAction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GenerateDbPartitionsForQueryAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.GenerateDbPartitionsForQueryAction; - - /** - * Verifies a GenerateDbPartitionsForQueryAction message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GenerateDbPartitionsForQueryAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GenerateDbPartitionsForQueryAction - */ - public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.GenerateDbPartitionsForQueryAction; - - /** - * Creates a plain object from a GenerateDbPartitionsForQueryAction message. Also converts values to other types if specified. - * @param message GenerateDbPartitionsForQueryAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.executor.v1.GenerateDbPartitionsForQueryAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GenerateDbPartitionsForQueryAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GenerateDbPartitionsForQueryAction - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BatchPartition. */ - interface IBatchPartition { - - /** BatchPartition partition */ - partition?: (Uint8Array|Buffer|string|null); - - /** BatchPartition partitionToken */ - partitionToken?: (Uint8Array|Buffer|string|null); - - /** BatchPartition table */ - table?: (string|null); - - /** BatchPartition index */ - index?: (string|null); - } - - /** Represents a BatchPartition. */ - class BatchPartition implements IBatchPartition { - - /** - * Constructs a new BatchPartition. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.executor.v1.IBatchPartition); - - /** BatchPartition partition. */ - public partition: (Uint8Array|Buffer|string); - - /** BatchPartition partitionToken. */ - public partitionToken: (Uint8Array|Buffer|string); - - /** BatchPartition table. */ - public table?: (string|null); - - /** BatchPartition index. */ - public index?: (string|null); - - /** - * Creates a new BatchPartition instance using the specified properties. - * @param [properties] Properties to set - * @returns BatchPartition instance - */ - public static create(properties?: google.spanner.executor.v1.IBatchPartition): google.spanner.executor.v1.BatchPartition; - - /** - * Encodes the specified BatchPartition message. Does not implicitly {@link google.spanner.executor.v1.BatchPartition.verify|verify} messages. - * @param message BatchPartition message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.executor.v1.IBatchPartition, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BatchPartition message, length delimited. Does not implicitly {@link google.spanner.executor.v1.BatchPartition.verify|verify} messages. - * @param message BatchPartition message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.executor.v1.IBatchPartition, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BatchPartition message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BatchPartition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.BatchPartition; - - /** - * Decodes a BatchPartition message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BatchPartition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.BatchPartition; - - /** - * Verifies a BatchPartition message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BatchPartition message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BatchPartition - */ - public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.BatchPartition; - - /** - * Creates a plain object from a BatchPartition message. Also converts values to other types if specified. - * @param message BatchPartition - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.executor.v1.BatchPartition, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BatchPartition to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BatchPartition - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an ExecutePartitionAction. */ - interface IExecutePartitionAction { - - /** ExecutePartitionAction partition */ - partition?: (google.spanner.executor.v1.IBatchPartition|null); - } - - /** Represents an ExecutePartitionAction. */ - class ExecutePartitionAction implements IExecutePartitionAction { - - /** - * Constructs a new ExecutePartitionAction. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.executor.v1.IExecutePartitionAction); - - /** ExecutePartitionAction partition. */ - public partition?: (google.spanner.executor.v1.IBatchPartition|null); - - /** - * Creates a new ExecutePartitionAction instance using the specified properties. - * @param [properties] Properties to set - * @returns ExecutePartitionAction instance - */ - public static create(properties?: google.spanner.executor.v1.IExecutePartitionAction): google.spanner.executor.v1.ExecutePartitionAction; - - /** - * Encodes the specified ExecutePartitionAction message. Does not implicitly {@link google.spanner.executor.v1.ExecutePartitionAction.verify|verify} messages. - * @param message ExecutePartitionAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.executor.v1.IExecutePartitionAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExecutePartitionAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.ExecutePartitionAction.verify|verify} messages. - * @param message ExecutePartitionAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.executor.v1.IExecutePartitionAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExecutePartitionAction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExecutePartitionAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.ExecutePartitionAction; - - /** - * Decodes an ExecutePartitionAction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExecutePartitionAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.ExecutePartitionAction; - - /** - * Verifies an ExecutePartitionAction message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ExecutePartitionAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExecutePartitionAction - */ - public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.ExecutePartitionAction; - - /** - * Creates a plain object from an ExecutePartitionAction message. Also converts values to other types if specified. - * @param message ExecutePartitionAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.executor.v1.ExecutePartitionAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExecutePartitionAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExecutePartitionAction - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an ExecuteChangeStreamQuery. */ - interface IExecuteChangeStreamQuery { - - /** ExecuteChangeStreamQuery name */ - name?: (string|null); - - /** ExecuteChangeStreamQuery startTime */ - startTime?: (google.protobuf.ITimestamp|null); - - /** ExecuteChangeStreamQuery endTime */ - endTime?: (google.protobuf.ITimestamp|null); - - /** ExecuteChangeStreamQuery partitionToken */ - partitionToken?: (string|null); - - /** ExecuteChangeStreamQuery readOptions */ - readOptions?: (string[]|null); - - /** ExecuteChangeStreamQuery heartbeatMilliseconds */ - heartbeatMilliseconds?: (number|null); - - /** ExecuteChangeStreamQuery deadlineSeconds */ - deadlineSeconds?: (number|Long|string|null); - - /** ExecuteChangeStreamQuery cloudDatabaseRole */ - cloudDatabaseRole?: (string|null); - } - - /** Represents an ExecuteChangeStreamQuery. */ - class ExecuteChangeStreamQuery implements IExecuteChangeStreamQuery { - - /** - * Constructs a new ExecuteChangeStreamQuery. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.executor.v1.IExecuteChangeStreamQuery); - - /** ExecuteChangeStreamQuery name. */ - public name: string; - - /** ExecuteChangeStreamQuery startTime. */ - public startTime?: (google.protobuf.ITimestamp|null); - - /** ExecuteChangeStreamQuery endTime. */ - public endTime?: (google.protobuf.ITimestamp|null); - - /** ExecuteChangeStreamQuery partitionToken. */ - public partitionToken?: (string|null); - - /** ExecuteChangeStreamQuery readOptions. */ - public readOptions: string[]; - - /** ExecuteChangeStreamQuery heartbeatMilliseconds. */ - public heartbeatMilliseconds?: (number|null); - - /** ExecuteChangeStreamQuery deadlineSeconds. */ - public deadlineSeconds?: (number|Long|string|null); - - /** ExecuteChangeStreamQuery cloudDatabaseRole. */ - public cloudDatabaseRole?: (string|null); - - /** - * Creates a new ExecuteChangeStreamQuery instance using the specified properties. - * @param [properties] Properties to set - * @returns ExecuteChangeStreamQuery instance - */ - public static create(properties?: google.spanner.executor.v1.IExecuteChangeStreamQuery): google.spanner.executor.v1.ExecuteChangeStreamQuery; - - /** - * Encodes the specified ExecuteChangeStreamQuery message. Does not implicitly {@link google.spanner.executor.v1.ExecuteChangeStreamQuery.verify|verify} messages. - * @param message ExecuteChangeStreamQuery message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.executor.v1.IExecuteChangeStreamQuery, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExecuteChangeStreamQuery message, length delimited. Does not implicitly {@link google.spanner.executor.v1.ExecuteChangeStreamQuery.verify|verify} messages. - * @param message ExecuteChangeStreamQuery message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.executor.v1.IExecuteChangeStreamQuery, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExecuteChangeStreamQuery message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExecuteChangeStreamQuery - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.ExecuteChangeStreamQuery; - - /** - * Decodes an ExecuteChangeStreamQuery message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExecuteChangeStreamQuery - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.ExecuteChangeStreamQuery; - - /** - * Verifies an ExecuteChangeStreamQuery message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ExecuteChangeStreamQuery message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExecuteChangeStreamQuery - */ - public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.ExecuteChangeStreamQuery; - - /** - * Creates a plain object from an ExecuteChangeStreamQuery message. Also converts values to other types if specified. - * @param message ExecuteChangeStreamQuery - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.executor.v1.ExecuteChangeStreamQuery, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExecuteChangeStreamQuery to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExecuteChangeStreamQuery - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a SpannerActionOutcome. */ - interface ISpannerActionOutcome { - - /** SpannerActionOutcome status */ - status?: (google.rpc.IStatus|null); - - /** SpannerActionOutcome commitTime */ - commitTime?: (google.protobuf.ITimestamp|null); - - /** SpannerActionOutcome readResult */ - readResult?: (google.spanner.executor.v1.IReadResult|null); - - /** SpannerActionOutcome queryResult */ - queryResult?: (google.spanner.executor.v1.IQueryResult|null); - - /** SpannerActionOutcome transactionRestarted */ - transactionRestarted?: (boolean|null); - - /** SpannerActionOutcome batchTxnId */ - batchTxnId?: (Uint8Array|Buffer|string|null); - - /** SpannerActionOutcome dbPartition */ - dbPartition?: (google.spanner.executor.v1.IBatchPartition[]|null); - - /** SpannerActionOutcome adminResult */ - adminResult?: (google.spanner.executor.v1.IAdminResult|null); - - /** SpannerActionOutcome dmlRowsModified */ - dmlRowsModified?: ((number|Long|string)[]|null); - - /** SpannerActionOutcome changeStreamRecords */ - changeStreamRecords?: (google.spanner.executor.v1.IChangeStreamRecord[]|null); - } - - /** Represents a SpannerActionOutcome. */ - class SpannerActionOutcome implements ISpannerActionOutcome { - - /** - * Constructs a new SpannerActionOutcome. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.executor.v1.ISpannerActionOutcome); - - /** SpannerActionOutcome status. */ - public status?: (google.rpc.IStatus|null); - - /** SpannerActionOutcome commitTime. */ - public commitTime?: (google.protobuf.ITimestamp|null); - - /** SpannerActionOutcome readResult. */ - public readResult?: (google.spanner.executor.v1.IReadResult|null); - - /** SpannerActionOutcome queryResult. */ - public queryResult?: (google.spanner.executor.v1.IQueryResult|null); - - /** SpannerActionOutcome transactionRestarted. */ - public transactionRestarted?: (boolean|null); - - /** SpannerActionOutcome batchTxnId. */ - public batchTxnId?: (Uint8Array|Buffer|string|null); - - /** SpannerActionOutcome dbPartition. */ - public dbPartition: google.spanner.executor.v1.IBatchPartition[]; - - /** SpannerActionOutcome adminResult. */ - public adminResult?: (google.spanner.executor.v1.IAdminResult|null); - - /** SpannerActionOutcome dmlRowsModified. */ - public dmlRowsModified: (number|Long|string)[]; - - /** SpannerActionOutcome changeStreamRecords. */ - public changeStreamRecords: google.spanner.executor.v1.IChangeStreamRecord[]; - - /** - * Creates a new SpannerActionOutcome instance using the specified properties. - * @param [properties] Properties to set - * @returns SpannerActionOutcome instance - */ - public static create(properties?: google.spanner.executor.v1.ISpannerActionOutcome): google.spanner.executor.v1.SpannerActionOutcome; - - /** - * Encodes the specified SpannerActionOutcome message. Does not implicitly {@link google.spanner.executor.v1.SpannerActionOutcome.verify|verify} messages. - * @param message SpannerActionOutcome message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.executor.v1.ISpannerActionOutcome, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SpannerActionOutcome message, length delimited. Does not implicitly {@link google.spanner.executor.v1.SpannerActionOutcome.verify|verify} messages. - * @param message SpannerActionOutcome message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.executor.v1.ISpannerActionOutcome, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SpannerActionOutcome message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SpannerActionOutcome - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.SpannerActionOutcome; - - /** - * Decodes a SpannerActionOutcome message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SpannerActionOutcome - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.SpannerActionOutcome; - - /** - * Verifies a SpannerActionOutcome message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SpannerActionOutcome message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SpannerActionOutcome - */ - public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.SpannerActionOutcome; - - /** - * Creates a plain object from a SpannerActionOutcome message. Also converts values to other types if specified. - * @param message SpannerActionOutcome - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.executor.v1.SpannerActionOutcome, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SpannerActionOutcome to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SpannerActionOutcome - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an AdminResult. */ - interface IAdminResult { - - /** AdminResult backupResponse */ - backupResponse?: (google.spanner.executor.v1.ICloudBackupResponse|null); - - /** AdminResult operationResponse */ - operationResponse?: (google.spanner.executor.v1.IOperationResponse|null); - - /** AdminResult databaseResponse */ - databaseResponse?: (google.spanner.executor.v1.ICloudDatabaseResponse|null); - - /** AdminResult instanceResponse */ - instanceResponse?: (google.spanner.executor.v1.ICloudInstanceResponse|null); - - /** AdminResult instanceConfigResponse */ - instanceConfigResponse?: (google.spanner.executor.v1.ICloudInstanceConfigResponse|null); - } - - /** Represents an AdminResult. */ - class AdminResult implements IAdminResult { - - /** - * Constructs a new AdminResult. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.executor.v1.IAdminResult); - - /** AdminResult backupResponse. */ - public backupResponse?: (google.spanner.executor.v1.ICloudBackupResponse|null); - - /** AdminResult operationResponse. */ - public operationResponse?: (google.spanner.executor.v1.IOperationResponse|null); - - /** AdminResult databaseResponse. */ - public databaseResponse?: (google.spanner.executor.v1.ICloudDatabaseResponse|null); - - /** AdminResult instanceResponse. */ - public instanceResponse?: (google.spanner.executor.v1.ICloudInstanceResponse|null); - - /** AdminResult instanceConfigResponse. */ - public instanceConfigResponse?: (google.spanner.executor.v1.ICloudInstanceConfigResponse|null); - - /** - * Creates a new AdminResult instance using the specified properties. - * @param [properties] Properties to set - * @returns AdminResult instance - */ - public static create(properties?: google.spanner.executor.v1.IAdminResult): google.spanner.executor.v1.AdminResult; - - /** - * Encodes the specified AdminResult message. Does not implicitly {@link google.spanner.executor.v1.AdminResult.verify|verify} messages. - * @param message AdminResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.executor.v1.IAdminResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AdminResult message, length delimited. Does not implicitly {@link google.spanner.executor.v1.AdminResult.verify|verify} messages. - * @param message AdminResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.executor.v1.IAdminResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AdminResult message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AdminResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.AdminResult; - - /** - * Decodes an AdminResult message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AdminResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.AdminResult; - - /** - * Verifies an AdminResult message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an AdminResult message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AdminResult - */ - public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.AdminResult; - - /** - * Creates a plain object from an AdminResult message. Also converts values to other types if specified. - * @param message AdminResult - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.executor.v1.AdminResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AdminResult to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AdminResult - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CloudBackupResponse. */ - interface ICloudBackupResponse { - - /** CloudBackupResponse listedBackups */ - listedBackups?: (google.spanner.admin.database.v1.IBackup[]|null); - - /** CloudBackupResponse listedBackupOperations */ - listedBackupOperations?: (google.longrunning.IOperation[]|null); - - /** CloudBackupResponse nextPageToken */ - nextPageToken?: (string|null); - - /** CloudBackupResponse backup */ - backup?: (google.spanner.admin.database.v1.IBackup|null); - } - - /** Represents a CloudBackupResponse. */ - class CloudBackupResponse implements ICloudBackupResponse { - - /** - * Constructs a new CloudBackupResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.executor.v1.ICloudBackupResponse); - - /** CloudBackupResponse listedBackups. */ - public listedBackups: google.spanner.admin.database.v1.IBackup[]; - - /** CloudBackupResponse listedBackupOperations. */ - public listedBackupOperations: google.longrunning.IOperation[]; - - /** CloudBackupResponse nextPageToken. */ - public nextPageToken: string; - - /** CloudBackupResponse backup. */ - public backup?: (google.spanner.admin.database.v1.IBackup|null); - - /** - * Creates a new CloudBackupResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns CloudBackupResponse instance - */ - public static create(properties?: google.spanner.executor.v1.ICloudBackupResponse): google.spanner.executor.v1.CloudBackupResponse; - - /** - * Encodes the specified CloudBackupResponse message. Does not implicitly {@link google.spanner.executor.v1.CloudBackupResponse.verify|verify} messages. - * @param message CloudBackupResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.executor.v1.ICloudBackupResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CloudBackupResponse message, length delimited. Does not implicitly {@link google.spanner.executor.v1.CloudBackupResponse.verify|verify} messages. - * @param message CloudBackupResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.executor.v1.ICloudBackupResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CloudBackupResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CloudBackupResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.CloudBackupResponse; - - /** - * Decodes a CloudBackupResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CloudBackupResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.CloudBackupResponse; - - /** - * Verifies a CloudBackupResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CloudBackupResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CloudBackupResponse - */ - public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.CloudBackupResponse; - - /** - * Creates a plain object from a CloudBackupResponse message. Also converts values to other types if specified. - * @param message CloudBackupResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.executor.v1.CloudBackupResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CloudBackupResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CloudBackupResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an OperationResponse. */ - interface IOperationResponse { - - /** OperationResponse listedOperations */ - listedOperations?: (google.longrunning.IOperation[]|null); - - /** OperationResponse nextPageToken */ - nextPageToken?: (string|null); - - /** OperationResponse operation */ - operation?: (google.longrunning.IOperation|null); - } - - /** Represents an OperationResponse. */ - class OperationResponse implements IOperationResponse { - - /** - * Constructs a new OperationResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.executor.v1.IOperationResponse); - - /** OperationResponse listedOperations. */ - public listedOperations: google.longrunning.IOperation[]; - - /** OperationResponse nextPageToken. */ - public nextPageToken: string; - - /** OperationResponse operation. */ - public operation?: (google.longrunning.IOperation|null); - - /** - * Creates a new OperationResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns OperationResponse instance - */ - public static create(properties?: google.spanner.executor.v1.IOperationResponse): google.spanner.executor.v1.OperationResponse; - - /** - * Encodes the specified OperationResponse message. Does not implicitly {@link google.spanner.executor.v1.OperationResponse.verify|verify} messages. - * @param message OperationResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.executor.v1.IOperationResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OperationResponse message, length delimited. Does not implicitly {@link google.spanner.executor.v1.OperationResponse.verify|verify} messages. - * @param message OperationResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.executor.v1.IOperationResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OperationResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OperationResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.OperationResponse; - - /** - * Decodes an OperationResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OperationResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.OperationResponse; - - /** - * Verifies an OperationResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an OperationResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OperationResponse - */ - public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.OperationResponse; - - /** - * Creates a plain object from an OperationResponse message. Also converts values to other types if specified. - * @param message OperationResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.executor.v1.OperationResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OperationResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for OperationResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CloudInstanceResponse. */ - interface ICloudInstanceResponse { - - /** CloudInstanceResponse listedInstances */ - listedInstances?: (google.spanner.admin.instance.v1.IInstance[]|null); - - /** CloudInstanceResponse nextPageToken */ - nextPageToken?: (string|null); - - /** CloudInstanceResponse instance */ - instance?: (google.spanner.admin.instance.v1.IInstance|null); - } - - /** Represents a CloudInstanceResponse. */ - class CloudInstanceResponse implements ICloudInstanceResponse { - - /** - * Constructs a new CloudInstanceResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.executor.v1.ICloudInstanceResponse); - - /** CloudInstanceResponse listedInstances. */ - public listedInstances: google.spanner.admin.instance.v1.IInstance[]; - - /** CloudInstanceResponse nextPageToken. */ - public nextPageToken: string; - - /** CloudInstanceResponse instance. */ - public instance?: (google.spanner.admin.instance.v1.IInstance|null); - - /** - * Creates a new CloudInstanceResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns CloudInstanceResponse instance - */ - public static create(properties?: google.spanner.executor.v1.ICloudInstanceResponse): google.spanner.executor.v1.CloudInstanceResponse; - - /** - * Encodes the specified CloudInstanceResponse message. Does not implicitly {@link google.spanner.executor.v1.CloudInstanceResponse.verify|verify} messages. - * @param message CloudInstanceResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.executor.v1.ICloudInstanceResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CloudInstanceResponse message, length delimited. Does not implicitly {@link google.spanner.executor.v1.CloudInstanceResponse.verify|verify} messages. - * @param message CloudInstanceResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.executor.v1.ICloudInstanceResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CloudInstanceResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CloudInstanceResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.CloudInstanceResponse; - - /** - * Decodes a CloudInstanceResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CloudInstanceResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.CloudInstanceResponse; - - /** - * Verifies a CloudInstanceResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CloudInstanceResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CloudInstanceResponse - */ - public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.CloudInstanceResponse; - - /** - * Creates a plain object from a CloudInstanceResponse message. Also converts values to other types if specified. - * @param message CloudInstanceResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.executor.v1.CloudInstanceResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CloudInstanceResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CloudInstanceResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CloudInstanceConfigResponse. */ - interface ICloudInstanceConfigResponse { - - /** CloudInstanceConfigResponse listedInstanceConfigs */ - listedInstanceConfigs?: (google.spanner.admin.instance.v1.IInstanceConfig[]|null); - - /** CloudInstanceConfigResponse nextPageToken */ - nextPageToken?: (string|null); - - /** CloudInstanceConfigResponse instanceConfig */ - instanceConfig?: (google.spanner.admin.instance.v1.IInstanceConfig|null); - } - - /** Represents a CloudInstanceConfigResponse. */ - class CloudInstanceConfigResponse implements ICloudInstanceConfigResponse { - - /** - * Constructs a new CloudInstanceConfigResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.executor.v1.ICloudInstanceConfigResponse); - - /** CloudInstanceConfigResponse listedInstanceConfigs. */ - public listedInstanceConfigs: google.spanner.admin.instance.v1.IInstanceConfig[]; - - /** CloudInstanceConfigResponse nextPageToken. */ - public nextPageToken: string; - - /** CloudInstanceConfigResponse instanceConfig. */ - public instanceConfig?: (google.spanner.admin.instance.v1.IInstanceConfig|null); - - /** - * Creates a new CloudInstanceConfigResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns CloudInstanceConfigResponse instance - */ - public static create(properties?: google.spanner.executor.v1.ICloudInstanceConfigResponse): google.spanner.executor.v1.CloudInstanceConfigResponse; - - /** - * Encodes the specified CloudInstanceConfigResponse message. Does not implicitly {@link google.spanner.executor.v1.CloudInstanceConfigResponse.verify|verify} messages. - * @param message CloudInstanceConfigResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.executor.v1.ICloudInstanceConfigResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CloudInstanceConfigResponse message, length delimited. Does not implicitly {@link google.spanner.executor.v1.CloudInstanceConfigResponse.verify|verify} messages. - * @param message CloudInstanceConfigResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.executor.v1.ICloudInstanceConfigResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CloudInstanceConfigResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CloudInstanceConfigResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.CloudInstanceConfigResponse; - - /** - * Decodes a CloudInstanceConfigResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CloudInstanceConfigResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.CloudInstanceConfigResponse; - - /** - * Verifies a CloudInstanceConfigResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CloudInstanceConfigResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CloudInstanceConfigResponse - */ - public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.CloudInstanceConfigResponse; - - /** - * Creates a plain object from a CloudInstanceConfigResponse message. Also converts values to other types if specified. - * @param message CloudInstanceConfigResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.executor.v1.CloudInstanceConfigResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CloudInstanceConfigResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CloudInstanceConfigResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CloudDatabaseResponse. */ - interface ICloudDatabaseResponse { - - /** CloudDatabaseResponse listedDatabases */ - listedDatabases?: (google.spanner.admin.database.v1.IDatabase[]|null); - - /** CloudDatabaseResponse listedDatabaseOperations */ - listedDatabaseOperations?: (google.longrunning.IOperation[]|null); - - /** CloudDatabaseResponse nextPageToken */ - nextPageToken?: (string|null); - - /** CloudDatabaseResponse database */ - database?: (google.spanner.admin.database.v1.IDatabase|null); - } - - /** Represents a CloudDatabaseResponse. */ - class CloudDatabaseResponse implements ICloudDatabaseResponse { - - /** - * Constructs a new CloudDatabaseResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.executor.v1.ICloudDatabaseResponse); - - /** CloudDatabaseResponse listedDatabases. */ - public listedDatabases: google.spanner.admin.database.v1.IDatabase[]; - - /** CloudDatabaseResponse listedDatabaseOperations. */ - public listedDatabaseOperations: google.longrunning.IOperation[]; - - /** CloudDatabaseResponse nextPageToken. */ - public nextPageToken: string; - - /** CloudDatabaseResponse database. */ - public database?: (google.spanner.admin.database.v1.IDatabase|null); - - /** - * Creates a new CloudDatabaseResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns CloudDatabaseResponse instance - */ - public static create(properties?: google.spanner.executor.v1.ICloudDatabaseResponse): google.spanner.executor.v1.CloudDatabaseResponse; - - /** - * Encodes the specified CloudDatabaseResponse message. Does not implicitly {@link google.spanner.executor.v1.CloudDatabaseResponse.verify|verify} messages. - * @param message CloudDatabaseResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.executor.v1.ICloudDatabaseResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CloudDatabaseResponse message, length delimited. Does not implicitly {@link google.spanner.executor.v1.CloudDatabaseResponse.verify|verify} messages. - * @param message CloudDatabaseResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.executor.v1.ICloudDatabaseResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CloudDatabaseResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CloudDatabaseResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.CloudDatabaseResponse; - - /** - * Decodes a CloudDatabaseResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CloudDatabaseResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.CloudDatabaseResponse; - - /** - * Verifies a CloudDatabaseResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CloudDatabaseResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CloudDatabaseResponse - */ - public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.CloudDatabaseResponse; - - /** - * Creates a plain object from a CloudDatabaseResponse message. Also converts values to other types if specified. - * @param message CloudDatabaseResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.executor.v1.CloudDatabaseResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CloudDatabaseResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CloudDatabaseResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ReadResult. */ - interface IReadResult { - - /** ReadResult table */ - table?: (string|null); - - /** ReadResult index */ - index?: (string|null); - - /** ReadResult requestIndex */ - requestIndex?: (number|null); - - /** ReadResult row */ - row?: (google.spanner.executor.v1.IValueList[]|null); - - /** ReadResult rowType */ - rowType?: (google.spanner.v1.IStructType|null); - } - - /** Represents a ReadResult. */ - class ReadResult implements IReadResult { - - /** - * Constructs a new ReadResult. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.executor.v1.IReadResult); - - /** ReadResult table. */ - public table: string; - - /** ReadResult index. */ - public index?: (string|null); - - /** ReadResult requestIndex. */ - public requestIndex?: (number|null); - - /** ReadResult row. */ - public row: google.spanner.executor.v1.IValueList[]; - - /** ReadResult rowType. */ - public rowType?: (google.spanner.v1.IStructType|null); - - /** - * Creates a new ReadResult instance using the specified properties. - * @param [properties] Properties to set - * @returns ReadResult instance - */ - public static create(properties?: google.spanner.executor.v1.IReadResult): google.spanner.executor.v1.ReadResult; - - /** - * Encodes the specified ReadResult message. Does not implicitly {@link google.spanner.executor.v1.ReadResult.verify|verify} messages. - * @param message ReadResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.executor.v1.IReadResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ReadResult message, length delimited. Does not implicitly {@link google.spanner.executor.v1.ReadResult.verify|verify} messages. - * @param message ReadResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.executor.v1.IReadResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ReadResult message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ReadResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.ReadResult; - - /** - * Decodes a ReadResult message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ReadResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.ReadResult; - - /** - * Verifies a ReadResult message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ReadResult message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ReadResult - */ - public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.ReadResult; - - /** - * Creates a plain object from a ReadResult message. Also converts values to other types if specified. - * @param message ReadResult - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.executor.v1.ReadResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ReadResult to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ReadResult - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a QueryResult. */ - interface IQueryResult { - - /** QueryResult row */ - row?: (google.spanner.executor.v1.IValueList[]|null); - - /** QueryResult rowType */ - rowType?: (google.spanner.v1.IStructType|null); - } - - /** Represents a QueryResult. */ - class QueryResult implements IQueryResult { - - /** - * Constructs a new QueryResult. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.executor.v1.IQueryResult); - - /** QueryResult row. */ - public row: google.spanner.executor.v1.IValueList[]; - - /** QueryResult rowType. */ - public rowType?: (google.spanner.v1.IStructType|null); - - /** - * Creates a new QueryResult instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryResult instance - */ - public static create(properties?: google.spanner.executor.v1.IQueryResult): google.spanner.executor.v1.QueryResult; - - /** - * Encodes the specified QueryResult message. Does not implicitly {@link google.spanner.executor.v1.QueryResult.verify|verify} messages. - * @param message QueryResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.executor.v1.IQueryResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryResult message, length delimited. Does not implicitly {@link google.spanner.executor.v1.QueryResult.verify|verify} messages. - * @param message QueryResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.executor.v1.IQueryResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryResult message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.QueryResult; - - /** - * Decodes a QueryResult message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.QueryResult; - - /** - * Verifies a QueryResult message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryResult message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryResult - */ - public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.QueryResult; - - /** - * Creates a plain object from a QueryResult message. Also converts values to other types if specified. - * @param message QueryResult - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.executor.v1.QueryResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryResult to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for QueryResult - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ChangeStreamRecord. */ - interface IChangeStreamRecord { - - /** ChangeStreamRecord dataChange */ - dataChange?: (google.spanner.executor.v1.IDataChangeRecord|null); - - /** ChangeStreamRecord childPartition */ - childPartition?: (google.spanner.executor.v1.IChildPartitionsRecord|null); - - /** ChangeStreamRecord heartbeat */ - heartbeat?: (google.spanner.executor.v1.IHeartbeatRecord|null); - } - - /** Represents a ChangeStreamRecord. */ - class ChangeStreamRecord implements IChangeStreamRecord { - - /** - * Constructs a new ChangeStreamRecord. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.executor.v1.IChangeStreamRecord); - - /** ChangeStreamRecord dataChange. */ - public dataChange?: (google.spanner.executor.v1.IDataChangeRecord|null); - - /** ChangeStreamRecord childPartition. */ - public childPartition?: (google.spanner.executor.v1.IChildPartitionsRecord|null); - - /** ChangeStreamRecord heartbeat. */ - public heartbeat?: (google.spanner.executor.v1.IHeartbeatRecord|null); - - /** ChangeStreamRecord record. */ - public record?: ("dataChange"|"childPartition"|"heartbeat"); - - /** - * Creates a new ChangeStreamRecord instance using the specified properties. - * @param [properties] Properties to set - * @returns ChangeStreamRecord instance - */ - public static create(properties?: google.spanner.executor.v1.IChangeStreamRecord): google.spanner.executor.v1.ChangeStreamRecord; - - /** - * Encodes the specified ChangeStreamRecord message. Does not implicitly {@link google.spanner.executor.v1.ChangeStreamRecord.verify|verify} messages. - * @param message ChangeStreamRecord message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.executor.v1.IChangeStreamRecord, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ChangeStreamRecord message, length delimited. Does not implicitly {@link google.spanner.executor.v1.ChangeStreamRecord.verify|verify} messages. - * @param message ChangeStreamRecord message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.executor.v1.IChangeStreamRecord, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ChangeStreamRecord message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ChangeStreamRecord - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.ChangeStreamRecord; - - /** - * Decodes a ChangeStreamRecord message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ChangeStreamRecord - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.ChangeStreamRecord; - - /** - * Verifies a ChangeStreamRecord message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ChangeStreamRecord message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ChangeStreamRecord - */ - public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.ChangeStreamRecord; - - /** - * Creates a plain object from a ChangeStreamRecord message. Also converts values to other types if specified. - * @param message ChangeStreamRecord - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.executor.v1.ChangeStreamRecord, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ChangeStreamRecord to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ChangeStreamRecord - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DataChangeRecord. */ - interface IDataChangeRecord { - - /** DataChangeRecord commitTime */ - commitTime?: (google.protobuf.ITimestamp|null); - - /** DataChangeRecord recordSequence */ - recordSequence?: (string|null); - - /** DataChangeRecord transactionId */ - transactionId?: (string|null); - - /** DataChangeRecord isLastRecord */ - isLastRecord?: (boolean|null); - - /** DataChangeRecord table */ - table?: (string|null); - - /** DataChangeRecord columnTypes */ - columnTypes?: (google.spanner.executor.v1.DataChangeRecord.IColumnType[]|null); - - /** DataChangeRecord mods */ - mods?: (google.spanner.executor.v1.DataChangeRecord.IMod[]|null); - - /** DataChangeRecord modType */ - modType?: (string|null); - - /** DataChangeRecord valueCaptureType */ - valueCaptureType?: (string|null); - - /** DataChangeRecord recordCount */ - recordCount?: (number|Long|string|null); - - /** DataChangeRecord partitionCount */ - partitionCount?: (number|Long|string|null); - - /** DataChangeRecord transactionTag */ - transactionTag?: (string|null); - - /** DataChangeRecord isSystemTransaction */ - isSystemTransaction?: (boolean|null); - } - - /** Represents a DataChangeRecord. */ - class DataChangeRecord implements IDataChangeRecord { - - /** - * Constructs a new DataChangeRecord. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.executor.v1.IDataChangeRecord); - - /** DataChangeRecord commitTime. */ - public commitTime?: (google.protobuf.ITimestamp|null); - - /** DataChangeRecord recordSequence. */ - public recordSequence: string; - - /** DataChangeRecord transactionId. */ - public transactionId: string; - - /** DataChangeRecord isLastRecord. */ - public isLastRecord: boolean; - - /** DataChangeRecord table. */ - public table: string; - - /** DataChangeRecord columnTypes. */ - public columnTypes: google.spanner.executor.v1.DataChangeRecord.IColumnType[]; - - /** DataChangeRecord mods. */ - public mods: google.spanner.executor.v1.DataChangeRecord.IMod[]; - - /** DataChangeRecord modType. */ - public modType: string; - - /** DataChangeRecord valueCaptureType. */ - public valueCaptureType: string; - - /** DataChangeRecord recordCount. */ - public recordCount: (number|Long|string); - - /** DataChangeRecord partitionCount. */ - public partitionCount: (number|Long|string); - - /** DataChangeRecord transactionTag. */ - public transactionTag: string; - - /** DataChangeRecord isSystemTransaction. */ - public isSystemTransaction: boolean; - - /** - * Creates a new DataChangeRecord instance using the specified properties. - * @param [properties] Properties to set - * @returns DataChangeRecord instance - */ - public static create(properties?: google.spanner.executor.v1.IDataChangeRecord): google.spanner.executor.v1.DataChangeRecord; - - /** - * Encodes the specified DataChangeRecord message. Does not implicitly {@link google.spanner.executor.v1.DataChangeRecord.verify|verify} messages. - * @param message DataChangeRecord message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.executor.v1.IDataChangeRecord, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DataChangeRecord message, length delimited. Does not implicitly {@link google.spanner.executor.v1.DataChangeRecord.verify|verify} messages. - * @param message DataChangeRecord message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.executor.v1.IDataChangeRecord, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DataChangeRecord message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DataChangeRecord - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.DataChangeRecord; - - /** - * Decodes a DataChangeRecord message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DataChangeRecord - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.DataChangeRecord; - - /** - * Verifies a DataChangeRecord message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DataChangeRecord message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DataChangeRecord - */ - public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.DataChangeRecord; - - /** - * Creates a plain object from a DataChangeRecord message. Also converts values to other types if specified. - * @param message DataChangeRecord - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.executor.v1.DataChangeRecord, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DataChangeRecord to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DataChangeRecord - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace DataChangeRecord { - - /** Properties of a ColumnType. */ - interface IColumnType { - - /** ColumnType name */ - name?: (string|null); - - /** ColumnType type */ - type?: (string|null); - - /** ColumnType isPrimaryKey */ - isPrimaryKey?: (boolean|null); - - /** ColumnType ordinalPosition */ - ordinalPosition?: (number|Long|string|null); - } - - /** Represents a ColumnType. */ - class ColumnType implements IColumnType { - - /** - * Constructs a new ColumnType. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.executor.v1.DataChangeRecord.IColumnType); - - /** ColumnType name. */ - public name: string; - - /** ColumnType type. */ - public type: string; - - /** ColumnType isPrimaryKey. */ - public isPrimaryKey: boolean; - - /** ColumnType ordinalPosition. */ - public ordinalPosition: (number|Long|string); - - /** - * Creates a new ColumnType instance using the specified properties. - * @param [properties] Properties to set - * @returns ColumnType instance - */ - public static create(properties?: google.spanner.executor.v1.DataChangeRecord.IColumnType): google.spanner.executor.v1.DataChangeRecord.ColumnType; - - /** - * Encodes the specified ColumnType message. Does not implicitly {@link google.spanner.executor.v1.DataChangeRecord.ColumnType.verify|verify} messages. - * @param message ColumnType message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.executor.v1.DataChangeRecord.IColumnType, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ColumnType message, length delimited. Does not implicitly {@link google.spanner.executor.v1.DataChangeRecord.ColumnType.verify|verify} messages. - * @param message ColumnType message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.executor.v1.DataChangeRecord.IColumnType, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ColumnType message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ColumnType - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.DataChangeRecord.ColumnType; - - /** - * Decodes a ColumnType message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ColumnType - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.DataChangeRecord.ColumnType; - - /** - * Verifies a ColumnType message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ColumnType message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ColumnType - */ - public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.DataChangeRecord.ColumnType; - - /** - * Creates a plain object from a ColumnType message. Also converts values to other types if specified. - * @param message ColumnType - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.executor.v1.DataChangeRecord.ColumnType, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ColumnType to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ColumnType - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Mod. */ - interface IMod { - - /** Mod keys */ - keys?: (string|null); - - /** Mod newValues */ - newValues?: (string|null); - - /** Mod oldValues */ - oldValues?: (string|null); - } - - /** Represents a Mod. */ - class Mod implements IMod { - - /** - * Constructs a new Mod. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.executor.v1.DataChangeRecord.IMod); - - /** Mod keys. */ - public keys: string; - - /** Mod newValues. */ - public newValues: string; - - /** Mod oldValues. */ - public oldValues: string; - - /** - * Creates a new Mod instance using the specified properties. - * @param [properties] Properties to set - * @returns Mod instance - */ - public static create(properties?: google.spanner.executor.v1.DataChangeRecord.IMod): google.spanner.executor.v1.DataChangeRecord.Mod; - - /** - * Encodes the specified Mod message. Does not implicitly {@link google.spanner.executor.v1.DataChangeRecord.Mod.verify|verify} messages. - * @param message Mod message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.executor.v1.DataChangeRecord.IMod, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Mod message, length delimited. Does not implicitly {@link google.spanner.executor.v1.DataChangeRecord.Mod.verify|verify} messages. - * @param message Mod message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.executor.v1.DataChangeRecord.IMod, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Mod message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Mod - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.DataChangeRecord.Mod; - - /** - * Decodes a Mod message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Mod - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.DataChangeRecord.Mod; - - /** - * Verifies a Mod message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Mod message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Mod - */ - public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.DataChangeRecord.Mod; - - /** - * Creates a plain object from a Mod message. Also converts values to other types if specified. - * @param message Mod - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.executor.v1.DataChangeRecord.Mod, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Mod to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Mod - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a ChildPartitionsRecord. */ - interface IChildPartitionsRecord { - - /** ChildPartitionsRecord startTime */ - startTime?: (google.protobuf.ITimestamp|null); - - /** ChildPartitionsRecord recordSequence */ - recordSequence?: (string|null); - - /** ChildPartitionsRecord childPartitions */ - childPartitions?: (google.spanner.executor.v1.ChildPartitionsRecord.IChildPartition[]|null); - } - - /** Represents a ChildPartitionsRecord. */ - class ChildPartitionsRecord implements IChildPartitionsRecord { - - /** - * Constructs a new ChildPartitionsRecord. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.executor.v1.IChildPartitionsRecord); - - /** ChildPartitionsRecord startTime. */ - public startTime?: (google.protobuf.ITimestamp|null); - - /** ChildPartitionsRecord recordSequence. */ - public recordSequence: string; - - /** ChildPartitionsRecord childPartitions. */ - public childPartitions: google.spanner.executor.v1.ChildPartitionsRecord.IChildPartition[]; - - /** - * Creates a new ChildPartitionsRecord instance using the specified properties. - * @param [properties] Properties to set - * @returns ChildPartitionsRecord instance - */ - public static create(properties?: google.spanner.executor.v1.IChildPartitionsRecord): google.spanner.executor.v1.ChildPartitionsRecord; - - /** - * Encodes the specified ChildPartitionsRecord message. Does not implicitly {@link google.spanner.executor.v1.ChildPartitionsRecord.verify|verify} messages. - * @param message ChildPartitionsRecord message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.executor.v1.IChildPartitionsRecord, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ChildPartitionsRecord message, length delimited. Does not implicitly {@link google.spanner.executor.v1.ChildPartitionsRecord.verify|verify} messages. - * @param message ChildPartitionsRecord message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.executor.v1.IChildPartitionsRecord, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ChildPartitionsRecord message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ChildPartitionsRecord - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.ChildPartitionsRecord; - - /** - * Decodes a ChildPartitionsRecord message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ChildPartitionsRecord - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.ChildPartitionsRecord; - - /** - * Verifies a ChildPartitionsRecord message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ChildPartitionsRecord message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ChildPartitionsRecord - */ - public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.ChildPartitionsRecord; - - /** - * Creates a plain object from a ChildPartitionsRecord message. Also converts values to other types if specified. - * @param message ChildPartitionsRecord - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.executor.v1.ChildPartitionsRecord, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ChildPartitionsRecord to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ChildPartitionsRecord - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ChildPartitionsRecord { - - /** Properties of a ChildPartition. */ - interface IChildPartition { - - /** ChildPartition token */ - token?: (string|null); - - /** ChildPartition parentPartitionTokens */ - parentPartitionTokens?: (string[]|null); - } - - /** Represents a ChildPartition. */ - class ChildPartition implements IChildPartition { - - /** - * Constructs a new ChildPartition. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.executor.v1.ChildPartitionsRecord.IChildPartition); - - /** ChildPartition token. */ - public token: string; - - /** ChildPartition parentPartitionTokens. */ - public parentPartitionTokens: string[]; - - /** - * Creates a new ChildPartition instance using the specified properties. - * @param [properties] Properties to set - * @returns ChildPartition instance - */ - public static create(properties?: google.spanner.executor.v1.ChildPartitionsRecord.IChildPartition): google.spanner.executor.v1.ChildPartitionsRecord.ChildPartition; - - /** - * Encodes the specified ChildPartition message. Does not implicitly {@link google.spanner.executor.v1.ChildPartitionsRecord.ChildPartition.verify|verify} messages. - * @param message ChildPartition message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.executor.v1.ChildPartitionsRecord.IChildPartition, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ChildPartition message, length delimited. Does not implicitly {@link google.spanner.executor.v1.ChildPartitionsRecord.ChildPartition.verify|verify} messages. - * @param message ChildPartition message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.executor.v1.ChildPartitionsRecord.IChildPartition, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ChildPartition message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ChildPartition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.ChildPartitionsRecord.ChildPartition; - - /** - * Decodes a ChildPartition message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ChildPartition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.ChildPartitionsRecord.ChildPartition; - - /** - * Verifies a ChildPartition message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ChildPartition message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ChildPartition - */ - public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.ChildPartitionsRecord.ChildPartition; - - /** - * Creates a plain object from a ChildPartition message. Also converts values to other types if specified. - * @param message ChildPartition - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.executor.v1.ChildPartitionsRecord.ChildPartition, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ChildPartition to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ChildPartition - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a HeartbeatRecord. */ - interface IHeartbeatRecord { - - /** HeartbeatRecord heartbeatTime */ - heartbeatTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a HeartbeatRecord. */ - class HeartbeatRecord implements IHeartbeatRecord { - - /** - * Constructs a new HeartbeatRecord. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.executor.v1.IHeartbeatRecord); - - /** HeartbeatRecord heartbeatTime. */ - public heartbeatTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new HeartbeatRecord instance using the specified properties. - * @param [properties] Properties to set - * @returns HeartbeatRecord instance - */ - public static create(properties?: google.spanner.executor.v1.IHeartbeatRecord): google.spanner.executor.v1.HeartbeatRecord; - - /** - * Encodes the specified HeartbeatRecord message. Does not implicitly {@link google.spanner.executor.v1.HeartbeatRecord.verify|verify} messages. - * @param message HeartbeatRecord message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.executor.v1.IHeartbeatRecord, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified HeartbeatRecord message, length delimited. Does not implicitly {@link google.spanner.executor.v1.HeartbeatRecord.verify|verify} messages. - * @param message HeartbeatRecord message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.executor.v1.IHeartbeatRecord, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a HeartbeatRecord message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns HeartbeatRecord - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.HeartbeatRecord; - - /** - * Decodes a HeartbeatRecord message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns HeartbeatRecord - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.HeartbeatRecord; - - /** - * Verifies a HeartbeatRecord message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a HeartbeatRecord message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns HeartbeatRecord - */ - public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.HeartbeatRecord; - - /** - * Creates a plain object from a HeartbeatRecord message. Also converts values to other types if specified. - * @param message HeartbeatRecord - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.executor.v1.HeartbeatRecord, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this HeartbeatRecord to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for HeartbeatRecord - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a SpannerOptions. */ - interface ISpannerOptions { - - /** SpannerOptions sessionPoolOptions */ - sessionPoolOptions?: (google.spanner.executor.v1.ISessionPoolOptions|null); - } - - /** Represents a SpannerOptions. */ - class SpannerOptions implements ISpannerOptions { - - /** - * Constructs a new SpannerOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.executor.v1.ISpannerOptions); - - /** SpannerOptions sessionPoolOptions. */ - public sessionPoolOptions?: (google.spanner.executor.v1.ISessionPoolOptions|null); - - /** - * Creates a new SpannerOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns SpannerOptions instance - */ - public static create(properties?: google.spanner.executor.v1.ISpannerOptions): google.spanner.executor.v1.SpannerOptions; - - /** - * Encodes the specified SpannerOptions message. Does not implicitly {@link google.spanner.executor.v1.SpannerOptions.verify|verify} messages. - * @param message SpannerOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.executor.v1.ISpannerOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SpannerOptions message, length delimited. Does not implicitly {@link google.spanner.executor.v1.SpannerOptions.verify|verify} messages. - * @param message SpannerOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.executor.v1.ISpannerOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SpannerOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SpannerOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.SpannerOptions; - - /** - * Decodes a SpannerOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SpannerOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.SpannerOptions; - - /** - * Verifies a SpannerOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SpannerOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SpannerOptions - */ - public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.SpannerOptions; - - /** - * Creates a plain object from a SpannerOptions message. Also converts values to other types if specified. - * @param message SpannerOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.executor.v1.SpannerOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SpannerOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SpannerOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a SessionPoolOptions. */ - interface ISessionPoolOptions { - - /** SessionPoolOptions useMultiplexed */ - useMultiplexed?: (boolean|null); - } - - /** Represents a SessionPoolOptions. */ - class SessionPoolOptions implements ISessionPoolOptions { - - /** - * Constructs a new SessionPoolOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.executor.v1.ISessionPoolOptions); - - /** SessionPoolOptions useMultiplexed. */ - public useMultiplexed: boolean; - - /** - * Creates a new SessionPoolOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns SessionPoolOptions instance - */ - public static create(properties?: google.spanner.executor.v1.ISessionPoolOptions): google.spanner.executor.v1.SessionPoolOptions; - - /** - * Encodes the specified SessionPoolOptions message. Does not implicitly {@link google.spanner.executor.v1.SessionPoolOptions.verify|verify} messages. - * @param message SessionPoolOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.executor.v1.ISessionPoolOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SessionPoolOptions message, length delimited. Does not implicitly {@link google.spanner.executor.v1.SessionPoolOptions.verify|verify} messages. - * @param message SessionPoolOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.executor.v1.ISessionPoolOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SessionPoolOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SessionPoolOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.SessionPoolOptions; - - /** - * Decodes a SessionPoolOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SessionPoolOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.SessionPoolOptions; - - /** - * Verifies a SessionPoolOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SessionPoolOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SessionPoolOptions - */ - public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.SessionPoolOptions; - - /** - * Creates a plain object from a SessionPoolOptions message. Also converts values to other types if specified. - * @param message SessionPoolOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.executor.v1.SessionPoolOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SessionPoolOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SessionPoolOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - } - - /** Namespace v1. */ - namespace v1 { - - /** Represents a Spanner */ - class Spanner extends $protobuf.rpc.Service { - - /** - * Constructs a new Spanner service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - - /** - * Creates new Spanner 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): Spanner; - - /** - * Calls CreateSession. - * @param request CreateSessionRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Session - */ - public createSession(request: google.spanner.v1.ICreateSessionRequest, callback: google.spanner.v1.Spanner.CreateSessionCallback): void; - - /** - * Calls CreateSession. - * @param request CreateSessionRequest message or plain object - * @returns Promise - */ - public createSession(request: google.spanner.v1.ICreateSessionRequest): Promise; - - /** - * Calls BatchCreateSessions. - * @param request BatchCreateSessionsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and BatchCreateSessionsResponse - */ - public batchCreateSessions(request: google.spanner.v1.IBatchCreateSessionsRequest, callback: google.spanner.v1.Spanner.BatchCreateSessionsCallback): void; - - /** - * Calls BatchCreateSessions. - * @param request BatchCreateSessionsRequest message or plain object - * @returns Promise - */ - public batchCreateSessions(request: google.spanner.v1.IBatchCreateSessionsRequest): Promise; - - /** - * Calls GetSession. - * @param request GetSessionRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Session - */ - public getSession(request: google.spanner.v1.IGetSessionRequest, callback: google.spanner.v1.Spanner.GetSessionCallback): void; - - /** - * Calls GetSession. - * @param request GetSessionRequest message or plain object - * @returns Promise - */ - public getSession(request: google.spanner.v1.IGetSessionRequest): Promise; - - /** - * Calls ListSessions. - * @param request ListSessionsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListSessionsResponse - */ - public listSessions(request: google.spanner.v1.IListSessionsRequest, callback: google.spanner.v1.Spanner.ListSessionsCallback): void; - - /** - * Calls ListSessions. - * @param request ListSessionsRequest message or plain object - * @returns Promise - */ - public listSessions(request: google.spanner.v1.IListSessionsRequest): Promise; - - /** - * Calls DeleteSession. - * @param request DeleteSessionRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteSession(request: google.spanner.v1.IDeleteSessionRequest, callback: google.spanner.v1.Spanner.DeleteSessionCallback): void; - - /** - * Calls DeleteSession. - * @param request DeleteSessionRequest message or plain object - * @returns Promise - */ - public deleteSession(request: google.spanner.v1.IDeleteSessionRequest): Promise; - - /** - * Calls ExecuteSql. - * @param request ExecuteSqlRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ResultSet - */ - public executeSql(request: google.spanner.v1.IExecuteSqlRequest, callback: google.spanner.v1.Spanner.ExecuteSqlCallback): void; - - /** - * Calls ExecuteSql. - * @param request ExecuteSqlRequest message or plain object - * @returns Promise - */ - public executeSql(request: google.spanner.v1.IExecuteSqlRequest): Promise; - - /** - * Calls ExecuteStreamingSql. - * @param request ExecuteSqlRequest message or plain object - * @param callback Node-style callback called with the error, if any, and PartialResultSet - */ - public executeStreamingSql(request: google.spanner.v1.IExecuteSqlRequest, callback: google.spanner.v1.Spanner.ExecuteStreamingSqlCallback): void; - - /** - * Calls ExecuteStreamingSql. - * @param request ExecuteSqlRequest message or plain object - * @returns Promise - */ - public executeStreamingSql(request: google.spanner.v1.IExecuteSqlRequest): Promise; - - /** - * Calls ExecuteBatchDml. - * @param request ExecuteBatchDmlRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ExecuteBatchDmlResponse - */ - public executeBatchDml(request: google.spanner.v1.IExecuteBatchDmlRequest, callback: google.spanner.v1.Spanner.ExecuteBatchDmlCallback): void; - - /** - * Calls ExecuteBatchDml. - * @param request ExecuteBatchDmlRequest message or plain object - * @returns Promise - */ - public executeBatchDml(request: google.spanner.v1.IExecuteBatchDmlRequest): Promise; - - /** - * Calls Read. - * @param request ReadRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ResultSet - */ - public read(request: google.spanner.v1.IReadRequest, callback: google.spanner.v1.Spanner.ReadCallback): void; - - /** - * Calls Read. - * @param request ReadRequest message or plain object - * @returns Promise - */ - public read(request: google.spanner.v1.IReadRequest): Promise; - - /** - * Calls StreamingRead. - * @param request ReadRequest message or plain object - * @param callback Node-style callback called with the error, if any, and PartialResultSet - */ - public streamingRead(request: google.spanner.v1.IReadRequest, callback: google.spanner.v1.Spanner.StreamingReadCallback): void; - - /** - * Calls StreamingRead. - * @param request ReadRequest message or plain object - * @returns Promise - */ - public streamingRead(request: google.spanner.v1.IReadRequest): Promise; - - /** - * Calls BeginTransaction. - * @param request BeginTransactionRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Transaction - */ - public beginTransaction(request: google.spanner.v1.IBeginTransactionRequest, callback: google.spanner.v1.Spanner.BeginTransactionCallback): void; - - /** - * Calls BeginTransaction. - * @param request BeginTransactionRequest message or plain object - * @returns Promise - */ - public beginTransaction(request: google.spanner.v1.IBeginTransactionRequest): Promise; - - /** - * Calls Commit. - * @param request CommitRequest message or plain object - * @param callback Node-style callback called with the error, if any, and CommitResponse - */ - public commit(request: google.spanner.v1.ICommitRequest, callback: google.spanner.v1.Spanner.CommitCallback): void; - - /** - * Calls Commit. - * @param request CommitRequest message or plain object - * @returns Promise - */ - public commit(request: google.spanner.v1.ICommitRequest): Promise; - - /** - * Calls Rollback. - * @param request RollbackRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public rollback(request: google.spanner.v1.IRollbackRequest, callback: google.spanner.v1.Spanner.RollbackCallback): void; - - /** - * Calls Rollback. - * @param request RollbackRequest message or plain object - * @returns Promise - */ - public rollback(request: google.spanner.v1.IRollbackRequest): Promise; - - /** - * Calls PartitionQuery. - * @param request PartitionQueryRequest message or plain object - * @param callback Node-style callback called with the error, if any, and PartitionResponse - */ - public partitionQuery(request: google.spanner.v1.IPartitionQueryRequest, callback: google.spanner.v1.Spanner.PartitionQueryCallback): void; - - /** - * Calls PartitionQuery. - * @param request PartitionQueryRequest message or plain object - * @returns Promise - */ - public partitionQuery(request: google.spanner.v1.IPartitionQueryRequest): Promise; - - /** - * Calls PartitionRead. - * @param request PartitionReadRequest message or plain object - * @param callback Node-style callback called with the error, if any, and PartitionResponse - */ - public partitionRead(request: google.spanner.v1.IPartitionReadRequest, callback: google.spanner.v1.Spanner.PartitionReadCallback): void; - - /** - * Calls PartitionRead. - * @param request PartitionReadRequest message or plain object - * @returns Promise - */ - public partitionRead(request: google.spanner.v1.IPartitionReadRequest): Promise; - - /** - * Calls BatchWrite. - * @param request BatchWriteRequest message or plain object - * @param callback Node-style callback called with the error, if any, and BatchWriteResponse - */ - public batchWrite(request: google.spanner.v1.IBatchWriteRequest, callback: google.spanner.v1.Spanner.BatchWriteCallback): void; - - /** - * Calls BatchWrite. - * @param request BatchWriteRequest message or plain object - * @returns Promise - */ - public batchWrite(request: google.spanner.v1.IBatchWriteRequest): Promise; - } - - namespace Spanner { - - /** - * Callback as used by {@link google.spanner.v1.Spanner|createSession}. - * @param error Error, if any - * @param [response] Session - */ - type CreateSessionCallback = (error: (Error|null), response?: google.spanner.v1.Session) => void; - - /** - * Callback as used by {@link google.spanner.v1.Spanner|batchCreateSessions}. - * @param error Error, if any - * @param [response] BatchCreateSessionsResponse - */ - type BatchCreateSessionsCallback = (error: (Error|null), response?: google.spanner.v1.BatchCreateSessionsResponse) => void; - - /** - * Callback as used by {@link google.spanner.v1.Spanner|getSession}. - * @param error Error, if any - * @param [response] Session - */ - type GetSessionCallback = (error: (Error|null), response?: google.spanner.v1.Session) => void; - - /** - * Callback as used by {@link google.spanner.v1.Spanner|listSessions}. - * @param error Error, if any - * @param [response] ListSessionsResponse - */ - type ListSessionsCallback = (error: (Error|null), response?: google.spanner.v1.ListSessionsResponse) => void; - - /** - * Callback as used by {@link google.spanner.v1.Spanner|deleteSession}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteSessionCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.spanner.v1.Spanner|executeSql}. - * @param error Error, if any - * @param [response] ResultSet - */ - type ExecuteSqlCallback = (error: (Error|null), response?: google.spanner.v1.ResultSet) => void; - - /** - * Callback as used by {@link google.spanner.v1.Spanner|executeStreamingSql}. - * @param error Error, if any - * @param [response] PartialResultSet - */ - type ExecuteStreamingSqlCallback = (error: (Error|null), response?: google.spanner.v1.PartialResultSet) => void; - - /** - * Callback as used by {@link google.spanner.v1.Spanner|executeBatchDml}. - * @param error Error, if any - * @param [response] ExecuteBatchDmlResponse - */ - type ExecuteBatchDmlCallback = (error: (Error|null), response?: google.spanner.v1.ExecuteBatchDmlResponse) => void; - - /** - * Callback as used by {@link google.spanner.v1.Spanner|read}. - * @param error Error, if any - * @param [response] ResultSet - */ - type ReadCallback = (error: (Error|null), response?: google.spanner.v1.ResultSet) => void; - - /** - * Callback as used by {@link google.spanner.v1.Spanner|streamingRead}. - * @param error Error, if any - * @param [response] PartialResultSet - */ - type StreamingReadCallback = (error: (Error|null), response?: google.spanner.v1.PartialResultSet) => void; - - /** - * Callback as used by {@link google.spanner.v1.Spanner|beginTransaction}. - * @param error Error, if any - * @param [response] Transaction - */ - type BeginTransactionCallback = (error: (Error|null), response?: google.spanner.v1.Transaction) => void; - - /** - * Callback as used by {@link google.spanner.v1.Spanner|commit}. - * @param error Error, if any - * @param [response] CommitResponse - */ - type CommitCallback = (error: (Error|null), response?: google.spanner.v1.CommitResponse) => void; - - /** - * Callback as used by {@link google.spanner.v1.Spanner|rollback}. - * @param error Error, if any - * @param [response] Empty - */ - type RollbackCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.spanner.v1.Spanner|partitionQuery}. - * @param error Error, if any - * @param [response] PartitionResponse - */ - type PartitionQueryCallback = (error: (Error|null), response?: google.spanner.v1.PartitionResponse) => void; - - /** - * Callback as used by {@link google.spanner.v1.Spanner|partitionRead}. - * @param error Error, if any - * @param [response] PartitionResponse - */ - type PartitionReadCallback = (error: (Error|null), response?: google.spanner.v1.PartitionResponse) => void; - - /** - * Callback as used by {@link google.spanner.v1.Spanner|batchWrite}. - * @param error Error, if any - * @param [response] BatchWriteResponse - */ - type BatchWriteCallback = (error: (Error|null), response?: google.spanner.v1.BatchWriteResponse) => void; - } - - /** Properties of a CreateSessionRequest. */ - interface ICreateSessionRequest { - - /** CreateSessionRequest database */ - database?: (string|null); - - /** CreateSessionRequest session */ - session?: (google.spanner.v1.ISession|null); - } - - /** Represents a CreateSessionRequest. */ - class CreateSessionRequest implements ICreateSessionRequest { - - /** - * Constructs a new CreateSessionRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.ICreateSessionRequest); - - /** CreateSessionRequest database. */ - public database: string; - - /** CreateSessionRequest session. */ - public session?: (google.spanner.v1.ISession|null); - - /** - * Creates a new CreateSessionRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateSessionRequest instance - */ - public static create(properties?: google.spanner.v1.ICreateSessionRequest): google.spanner.v1.CreateSessionRequest; - - /** - * Encodes the specified CreateSessionRequest message. Does not implicitly {@link google.spanner.v1.CreateSessionRequest.verify|verify} messages. - * @param message CreateSessionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.ICreateSessionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateSessionRequest message, length delimited. Does not implicitly {@link google.spanner.v1.CreateSessionRequest.verify|verify} messages. - * @param message CreateSessionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.ICreateSessionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateSessionRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateSessionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.CreateSessionRequest; - - /** - * Decodes a CreateSessionRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateSessionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.CreateSessionRequest; - - /** - * Verifies a CreateSessionRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateSessionRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateSessionRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.CreateSessionRequest; - - /** - * Creates a plain object from a CreateSessionRequest message. Also converts values to other types if specified. - * @param message CreateSessionRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.CreateSessionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateSessionRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateSessionRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BatchCreateSessionsRequest. */ - interface IBatchCreateSessionsRequest { - - /** BatchCreateSessionsRequest database */ - database?: (string|null); - - /** BatchCreateSessionsRequest sessionTemplate */ - sessionTemplate?: (google.spanner.v1.ISession|null); - - /** BatchCreateSessionsRequest sessionCount */ - sessionCount?: (number|null); - } - - /** Represents a BatchCreateSessionsRequest. */ - class BatchCreateSessionsRequest implements IBatchCreateSessionsRequest { - - /** - * Constructs a new BatchCreateSessionsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.IBatchCreateSessionsRequest); - - /** BatchCreateSessionsRequest database. */ - public database: string; - - /** BatchCreateSessionsRequest sessionTemplate. */ - public sessionTemplate?: (google.spanner.v1.ISession|null); - - /** BatchCreateSessionsRequest sessionCount. */ - public sessionCount: number; - - /** - * Creates a new BatchCreateSessionsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns BatchCreateSessionsRequest instance - */ - public static create(properties?: google.spanner.v1.IBatchCreateSessionsRequest): google.spanner.v1.BatchCreateSessionsRequest; - - /** - * Encodes the specified BatchCreateSessionsRequest message. Does not implicitly {@link google.spanner.v1.BatchCreateSessionsRequest.verify|verify} messages. - * @param message BatchCreateSessionsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.IBatchCreateSessionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BatchCreateSessionsRequest message, length delimited. Does not implicitly {@link google.spanner.v1.BatchCreateSessionsRequest.verify|verify} messages. - * @param message BatchCreateSessionsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.IBatchCreateSessionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BatchCreateSessionsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BatchCreateSessionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.BatchCreateSessionsRequest; - - /** - * Decodes a BatchCreateSessionsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BatchCreateSessionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.BatchCreateSessionsRequest; - - /** - * Verifies a BatchCreateSessionsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BatchCreateSessionsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BatchCreateSessionsRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.BatchCreateSessionsRequest; - - /** - * Creates a plain object from a BatchCreateSessionsRequest message. Also converts values to other types if specified. - * @param message BatchCreateSessionsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.BatchCreateSessionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BatchCreateSessionsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BatchCreateSessionsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BatchCreateSessionsResponse. */ - interface IBatchCreateSessionsResponse { - - /** BatchCreateSessionsResponse session */ - session?: (google.spanner.v1.ISession[]|null); - } - - /** Represents a BatchCreateSessionsResponse. */ - class BatchCreateSessionsResponse implements IBatchCreateSessionsResponse { - - /** - * Constructs a new BatchCreateSessionsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.IBatchCreateSessionsResponse); - - /** BatchCreateSessionsResponse session. */ - public session: google.spanner.v1.ISession[]; - - /** - * Creates a new BatchCreateSessionsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns BatchCreateSessionsResponse instance - */ - public static create(properties?: google.spanner.v1.IBatchCreateSessionsResponse): google.spanner.v1.BatchCreateSessionsResponse; - - /** - * Encodes the specified BatchCreateSessionsResponse message. Does not implicitly {@link google.spanner.v1.BatchCreateSessionsResponse.verify|verify} messages. - * @param message BatchCreateSessionsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.IBatchCreateSessionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BatchCreateSessionsResponse message, length delimited. Does not implicitly {@link google.spanner.v1.BatchCreateSessionsResponse.verify|verify} messages. - * @param message BatchCreateSessionsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.IBatchCreateSessionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BatchCreateSessionsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BatchCreateSessionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.BatchCreateSessionsResponse; - - /** - * Decodes a BatchCreateSessionsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BatchCreateSessionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.BatchCreateSessionsResponse; - - /** - * Verifies a BatchCreateSessionsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BatchCreateSessionsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BatchCreateSessionsResponse - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.BatchCreateSessionsResponse; - - /** - * Creates a plain object from a BatchCreateSessionsResponse message. Also converts values to other types if specified. - * @param message BatchCreateSessionsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.BatchCreateSessionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BatchCreateSessionsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BatchCreateSessionsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Session. */ - interface ISession { - - /** Session name */ - name?: (string|null); - - /** Session labels */ - labels?: ({ [k: string]: string }|null); - - /** Session createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** Session approximateLastUseTime */ - approximateLastUseTime?: (google.protobuf.ITimestamp|null); - - /** Session creatorRole */ - creatorRole?: (string|null); - - /** Session multiplexed */ - multiplexed?: (boolean|null); - } - - /** Represents a Session. */ - class Session implements ISession { - - /** - * Constructs a new Session. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.ISession); - - /** Session name. */ - public name: string; - - /** Session labels. */ - public labels: { [k: string]: string }; - - /** Session createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** Session approximateLastUseTime. */ - public approximateLastUseTime?: (google.protobuf.ITimestamp|null); - - /** Session creatorRole. */ - public creatorRole: string; - - /** Session multiplexed. */ - public multiplexed: boolean; - - /** - * Creates a new Session instance using the specified properties. - * @param [properties] Properties to set - * @returns Session instance - */ - public static create(properties?: google.spanner.v1.ISession): google.spanner.v1.Session; - - /** - * Encodes the specified Session message. Does not implicitly {@link google.spanner.v1.Session.verify|verify} messages. - * @param message Session message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.ISession, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Session message, length delimited. Does not implicitly {@link google.spanner.v1.Session.verify|verify} messages. - * @param message Session message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.ISession, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Session message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Session - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.Session; - - /** - * Decodes a Session message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Session - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.Session; - - /** - * Verifies a Session message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Session message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Session - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.Session; - - /** - * Creates a plain object from a Session message. Also converts values to other types if specified. - * @param message Session - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.Session, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Session to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Session - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetSessionRequest. */ - interface IGetSessionRequest { - - /** GetSessionRequest name */ - name?: (string|null); - } - - /** Represents a GetSessionRequest. */ - class GetSessionRequest implements IGetSessionRequest { - - /** - * Constructs a new GetSessionRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.IGetSessionRequest); - - /** GetSessionRequest name. */ - public name: string; - - /** - * Creates a new GetSessionRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetSessionRequest instance - */ - public static create(properties?: google.spanner.v1.IGetSessionRequest): google.spanner.v1.GetSessionRequest; - - /** - * Encodes the specified GetSessionRequest message. Does not implicitly {@link google.spanner.v1.GetSessionRequest.verify|verify} messages. - * @param message GetSessionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.IGetSessionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetSessionRequest message, length delimited. Does not implicitly {@link google.spanner.v1.GetSessionRequest.verify|verify} messages. - * @param message GetSessionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.IGetSessionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetSessionRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetSessionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.GetSessionRequest; - - /** - * Decodes a GetSessionRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetSessionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.GetSessionRequest; - - /** - * Verifies a GetSessionRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetSessionRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetSessionRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.GetSessionRequest; - - /** - * Creates a plain object from a GetSessionRequest message. Also converts values to other types if specified. - * @param message GetSessionRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.GetSessionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetSessionRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetSessionRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListSessionsRequest. */ - interface IListSessionsRequest { - - /** ListSessionsRequest database */ - database?: (string|null); - - /** ListSessionsRequest pageSize */ - pageSize?: (number|null); - - /** ListSessionsRequest pageToken */ - pageToken?: (string|null); - - /** ListSessionsRequest filter */ - filter?: (string|null); - } - - /** Represents a ListSessionsRequest. */ - class ListSessionsRequest implements IListSessionsRequest { - - /** - * Constructs a new ListSessionsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.IListSessionsRequest); - - /** ListSessionsRequest database. */ - public database: string; - - /** ListSessionsRequest pageSize. */ - public pageSize: number; - - /** ListSessionsRequest pageToken. */ - public pageToken: string; - - /** ListSessionsRequest filter. */ - public filter: string; - - /** - * Creates a new ListSessionsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListSessionsRequest instance - */ - public static create(properties?: google.spanner.v1.IListSessionsRequest): google.spanner.v1.ListSessionsRequest; - - /** - * Encodes the specified ListSessionsRequest message. Does not implicitly {@link google.spanner.v1.ListSessionsRequest.verify|verify} messages. - * @param message ListSessionsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.IListSessionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListSessionsRequest message, length delimited. Does not implicitly {@link google.spanner.v1.ListSessionsRequest.verify|verify} messages. - * @param message ListSessionsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.IListSessionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListSessionsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListSessionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.ListSessionsRequest; - - /** - * Decodes a ListSessionsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListSessionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.ListSessionsRequest; - - /** - * Verifies a ListSessionsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListSessionsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListSessionsRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.ListSessionsRequest; - - /** - * Creates a plain object from a ListSessionsRequest message. Also converts values to other types if specified. - * @param message ListSessionsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.ListSessionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListSessionsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListSessionsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListSessionsResponse. */ - interface IListSessionsResponse { - - /** ListSessionsResponse sessions */ - sessions?: (google.spanner.v1.ISession[]|null); - - /** ListSessionsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListSessionsResponse. */ - class ListSessionsResponse implements IListSessionsResponse { - - /** - * Constructs a new ListSessionsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.IListSessionsResponse); - - /** ListSessionsResponse sessions. */ - public sessions: google.spanner.v1.ISession[]; - - /** ListSessionsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListSessionsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListSessionsResponse instance - */ - public static create(properties?: google.spanner.v1.IListSessionsResponse): google.spanner.v1.ListSessionsResponse; - - /** - * Encodes the specified ListSessionsResponse message. Does not implicitly {@link google.spanner.v1.ListSessionsResponse.verify|verify} messages. - * @param message ListSessionsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.IListSessionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListSessionsResponse message, length delimited. Does not implicitly {@link google.spanner.v1.ListSessionsResponse.verify|verify} messages. - * @param message ListSessionsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.IListSessionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListSessionsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListSessionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.ListSessionsResponse; - - /** - * Decodes a ListSessionsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListSessionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.ListSessionsResponse; - - /** - * Verifies a ListSessionsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListSessionsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListSessionsResponse - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.ListSessionsResponse; - - /** - * Creates a plain object from a ListSessionsResponse message. Also converts values to other types if specified. - * @param message ListSessionsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.ListSessionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListSessionsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListSessionsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteSessionRequest. */ - interface IDeleteSessionRequest { - - /** DeleteSessionRequest name */ - name?: (string|null); - } - - /** Represents a DeleteSessionRequest. */ - class DeleteSessionRequest implements IDeleteSessionRequest { - - /** - * Constructs a new DeleteSessionRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.IDeleteSessionRequest); - - /** DeleteSessionRequest name. */ - public name: string; - - /** - * Creates a new DeleteSessionRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteSessionRequest instance - */ - public static create(properties?: google.spanner.v1.IDeleteSessionRequest): google.spanner.v1.DeleteSessionRequest; - - /** - * Encodes the specified DeleteSessionRequest message. Does not implicitly {@link google.spanner.v1.DeleteSessionRequest.verify|verify} messages. - * @param message DeleteSessionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.IDeleteSessionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteSessionRequest message, length delimited. Does not implicitly {@link google.spanner.v1.DeleteSessionRequest.verify|verify} messages. - * @param message DeleteSessionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.IDeleteSessionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteSessionRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteSessionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.DeleteSessionRequest; - - /** - * Decodes a DeleteSessionRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteSessionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.DeleteSessionRequest; - - /** - * Verifies a DeleteSessionRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteSessionRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteSessionRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.DeleteSessionRequest; - - /** - * Creates a plain object from a DeleteSessionRequest message. Also converts values to other types if specified. - * @param message DeleteSessionRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.DeleteSessionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteSessionRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteSessionRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RequestOptions. */ - interface IRequestOptions { - - /** RequestOptions priority */ - priority?: (google.spanner.v1.RequestOptions.Priority|keyof typeof google.spanner.v1.RequestOptions.Priority|null); - - /** RequestOptions requestTag */ - requestTag?: (string|null); - - /** RequestOptions transactionTag */ - transactionTag?: (string|null); - - /** RequestOptions clientContext */ - clientContext?: (google.spanner.v1.RequestOptions.IClientContext|null); - } - - /** Represents a RequestOptions. */ - class RequestOptions implements IRequestOptions { - - /** - * Constructs a new RequestOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.IRequestOptions); - - /** RequestOptions priority. */ - public priority: (google.spanner.v1.RequestOptions.Priority|keyof typeof google.spanner.v1.RequestOptions.Priority); - - /** RequestOptions requestTag. */ - public requestTag: string; - - /** RequestOptions transactionTag. */ - public transactionTag: string; - - /** RequestOptions clientContext. */ - public clientContext?: (google.spanner.v1.RequestOptions.IClientContext|null); - - /** - * Creates a new RequestOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns RequestOptions instance - */ - public static create(properties?: google.spanner.v1.IRequestOptions): google.spanner.v1.RequestOptions; - - /** - * Encodes the specified RequestOptions message. Does not implicitly {@link google.spanner.v1.RequestOptions.verify|verify} messages. - * @param message RequestOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.IRequestOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RequestOptions message, length delimited. Does not implicitly {@link google.spanner.v1.RequestOptions.verify|verify} messages. - * @param message RequestOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.IRequestOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RequestOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RequestOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.RequestOptions; - - /** - * Decodes a RequestOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RequestOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.RequestOptions; - - /** - * Verifies a RequestOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RequestOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RequestOptions - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.RequestOptions; - - /** - * Creates a plain object from a RequestOptions message. Also converts values to other types if specified. - * @param message RequestOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.RequestOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RequestOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RequestOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace RequestOptions { - - /** Priority enum. */ - enum Priority { - PRIORITY_UNSPECIFIED = 0, - PRIORITY_LOW = 1, - PRIORITY_MEDIUM = 2, - PRIORITY_HIGH = 3 - } - - /** Properties of a ClientContext. */ - interface IClientContext { - - /** ClientContext secureContext */ - secureContext?: ({ [k: string]: google.protobuf.IValue }|null); - } - - /** Represents a ClientContext. */ - class ClientContext implements IClientContext { - - /** - * Constructs a new ClientContext. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.RequestOptions.IClientContext); - - /** ClientContext secureContext. */ - public secureContext: { [k: string]: google.protobuf.IValue }; - - /** - * Creates a new ClientContext instance using the specified properties. - * @param [properties] Properties to set - * @returns ClientContext instance - */ - public static create(properties?: google.spanner.v1.RequestOptions.IClientContext): google.spanner.v1.RequestOptions.ClientContext; - - /** - * Encodes the specified ClientContext message. Does not implicitly {@link google.spanner.v1.RequestOptions.ClientContext.verify|verify} messages. - * @param message ClientContext message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.RequestOptions.IClientContext, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ClientContext message, length delimited. Does not implicitly {@link google.spanner.v1.RequestOptions.ClientContext.verify|verify} messages. - * @param message ClientContext message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.RequestOptions.IClientContext, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ClientContext message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ClientContext - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.RequestOptions.ClientContext; - - /** - * Decodes a ClientContext message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ClientContext - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.RequestOptions.ClientContext; - - /** - * Verifies a ClientContext message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ClientContext message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ClientContext - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.RequestOptions.ClientContext; - - /** - * Creates a plain object from a ClientContext message. Also converts values to other types if specified. - * @param message ClientContext - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.RequestOptions.ClientContext, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ClientContext to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ClientContext - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a DirectedReadOptions. */ - interface IDirectedReadOptions { - - /** DirectedReadOptions includeReplicas */ - includeReplicas?: (google.spanner.v1.DirectedReadOptions.IIncludeReplicas|null); - - /** DirectedReadOptions excludeReplicas */ - excludeReplicas?: (google.spanner.v1.DirectedReadOptions.IExcludeReplicas|null); - } - - /** Represents a DirectedReadOptions. */ - class DirectedReadOptions implements IDirectedReadOptions { - - /** - * Constructs a new DirectedReadOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.IDirectedReadOptions); - - /** DirectedReadOptions includeReplicas. */ - public includeReplicas?: (google.spanner.v1.DirectedReadOptions.IIncludeReplicas|null); - - /** DirectedReadOptions excludeReplicas. */ - public excludeReplicas?: (google.spanner.v1.DirectedReadOptions.IExcludeReplicas|null); - - /** DirectedReadOptions replicas. */ - public replicas?: ("includeReplicas"|"excludeReplicas"); - - /** - * Creates a new DirectedReadOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns DirectedReadOptions instance - */ - public static create(properties?: google.spanner.v1.IDirectedReadOptions): google.spanner.v1.DirectedReadOptions; - - /** - * Encodes the specified DirectedReadOptions message. Does not implicitly {@link google.spanner.v1.DirectedReadOptions.verify|verify} messages. - * @param message DirectedReadOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.IDirectedReadOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DirectedReadOptions message, length delimited. Does not implicitly {@link google.spanner.v1.DirectedReadOptions.verify|verify} messages. - * @param message DirectedReadOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.IDirectedReadOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DirectedReadOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DirectedReadOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.DirectedReadOptions; - - /** - * Decodes a DirectedReadOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DirectedReadOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.DirectedReadOptions; - - /** - * Verifies a DirectedReadOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DirectedReadOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DirectedReadOptions - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.DirectedReadOptions; - - /** - * Creates a plain object from a DirectedReadOptions message. Also converts values to other types if specified. - * @param message DirectedReadOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.DirectedReadOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DirectedReadOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DirectedReadOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace DirectedReadOptions { - - /** Properties of a ReplicaSelection. */ - interface IReplicaSelection { - - /** ReplicaSelection location */ - location?: (string|null); - - /** ReplicaSelection type */ - type?: (google.spanner.v1.DirectedReadOptions.ReplicaSelection.Type|keyof typeof google.spanner.v1.DirectedReadOptions.ReplicaSelection.Type|null); - } - - /** Represents a ReplicaSelection. */ - class ReplicaSelection implements IReplicaSelection { - - /** - * Constructs a new ReplicaSelection. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.DirectedReadOptions.IReplicaSelection); - - /** ReplicaSelection location. */ - public location: string; - - /** ReplicaSelection type. */ - public type: (google.spanner.v1.DirectedReadOptions.ReplicaSelection.Type|keyof typeof google.spanner.v1.DirectedReadOptions.ReplicaSelection.Type); - - /** - * Creates a new ReplicaSelection instance using the specified properties. - * @param [properties] Properties to set - * @returns ReplicaSelection instance - */ - public static create(properties?: google.spanner.v1.DirectedReadOptions.IReplicaSelection): google.spanner.v1.DirectedReadOptions.ReplicaSelection; - - /** - * Encodes the specified ReplicaSelection message. Does not implicitly {@link google.spanner.v1.DirectedReadOptions.ReplicaSelection.verify|verify} messages. - * @param message ReplicaSelection message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.DirectedReadOptions.IReplicaSelection, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ReplicaSelection message, length delimited. Does not implicitly {@link google.spanner.v1.DirectedReadOptions.ReplicaSelection.verify|verify} messages. - * @param message ReplicaSelection message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.DirectedReadOptions.IReplicaSelection, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ReplicaSelection message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ReplicaSelection - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.DirectedReadOptions.ReplicaSelection; - - /** - * Decodes a ReplicaSelection message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ReplicaSelection - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.DirectedReadOptions.ReplicaSelection; - - /** - * Verifies a ReplicaSelection message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ReplicaSelection message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ReplicaSelection - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.DirectedReadOptions.ReplicaSelection; - - /** - * Creates a plain object from a ReplicaSelection message. Also converts values to other types if specified. - * @param message ReplicaSelection - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.DirectedReadOptions.ReplicaSelection, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ReplicaSelection to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ReplicaSelection - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ReplicaSelection { - - /** Type enum. */ - enum Type { - TYPE_UNSPECIFIED = 0, - READ_WRITE = 1, - READ_ONLY = 2 - } - } - - /** Properties of an IncludeReplicas. */ - interface IIncludeReplicas { - - /** IncludeReplicas replicaSelections */ - replicaSelections?: (google.spanner.v1.DirectedReadOptions.IReplicaSelection[]|null); - - /** IncludeReplicas autoFailoverDisabled */ - autoFailoverDisabled?: (boolean|null); - } - - /** Represents an IncludeReplicas. */ - class IncludeReplicas implements IIncludeReplicas { - - /** - * Constructs a new IncludeReplicas. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.DirectedReadOptions.IIncludeReplicas); - - /** IncludeReplicas replicaSelections. */ - public replicaSelections: google.spanner.v1.DirectedReadOptions.IReplicaSelection[]; - - /** IncludeReplicas autoFailoverDisabled. */ - public autoFailoverDisabled: boolean; - - /** - * Creates a new IncludeReplicas instance using the specified properties. - * @param [properties] Properties to set - * @returns IncludeReplicas instance - */ - public static create(properties?: google.spanner.v1.DirectedReadOptions.IIncludeReplicas): google.spanner.v1.DirectedReadOptions.IncludeReplicas; - - /** - * Encodes the specified IncludeReplicas message. Does not implicitly {@link google.spanner.v1.DirectedReadOptions.IncludeReplicas.verify|verify} messages. - * @param message IncludeReplicas message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.DirectedReadOptions.IIncludeReplicas, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified IncludeReplicas message, length delimited. Does not implicitly {@link google.spanner.v1.DirectedReadOptions.IncludeReplicas.verify|verify} messages. - * @param message IncludeReplicas message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.DirectedReadOptions.IIncludeReplicas, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an IncludeReplicas message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns IncludeReplicas - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.DirectedReadOptions.IncludeReplicas; - - /** - * Decodes an IncludeReplicas message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns IncludeReplicas - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.DirectedReadOptions.IncludeReplicas; - - /** - * Verifies an IncludeReplicas message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an IncludeReplicas message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns IncludeReplicas - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.DirectedReadOptions.IncludeReplicas; - - /** - * Creates a plain object from an IncludeReplicas message. Also converts values to other types if specified. - * @param message IncludeReplicas - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.DirectedReadOptions.IncludeReplicas, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this IncludeReplicas to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for IncludeReplicas - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an ExcludeReplicas. */ - interface IExcludeReplicas { - - /** ExcludeReplicas replicaSelections */ - replicaSelections?: (google.spanner.v1.DirectedReadOptions.IReplicaSelection[]|null); - } - - /** Represents an ExcludeReplicas. */ - class ExcludeReplicas implements IExcludeReplicas { - - /** - * Constructs a new ExcludeReplicas. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.DirectedReadOptions.IExcludeReplicas); - - /** ExcludeReplicas replicaSelections. */ - public replicaSelections: google.spanner.v1.DirectedReadOptions.IReplicaSelection[]; - - /** - * Creates a new ExcludeReplicas instance using the specified properties. - * @param [properties] Properties to set - * @returns ExcludeReplicas instance - */ - public static create(properties?: google.spanner.v1.DirectedReadOptions.IExcludeReplicas): google.spanner.v1.DirectedReadOptions.ExcludeReplicas; - - /** - * Encodes the specified ExcludeReplicas message. Does not implicitly {@link google.spanner.v1.DirectedReadOptions.ExcludeReplicas.verify|verify} messages. - * @param message ExcludeReplicas message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.DirectedReadOptions.IExcludeReplicas, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExcludeReplicas message, length delimited. Does not implicitly {@link google.spanner.v1.DirectedReadOptions.ExcludeReplicas.verify|verify} messages. - * @param message ExcludeReplicas message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.DirectedReadOptions.IExcludeReplicas, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExcludeReplicas message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExcludeReplicas - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.DirectedReadOptions.ExcludeReplicas; - - /** - * Decodes an ExcludeReplicas message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExcludeReplicas - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.DirectedReadOptions.ExcludeReplicas; - - /** - * Verifies an ExcludeReplicas message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ExcludeReplicas message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExcludeReplicas - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.DirectedReadOptions.ExcludeReplicas; - - /** - * Creates a plain object from an ExcludeReplicas message. Also converts values to other types if specified. - * @param message ExcludeReplicas - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.DirectedReadOptions.ExcludeReplicas, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExcludeReplicas to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExcludeReplicas - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an ExecuteSqlRequest. */ - interface IExecuteSqlRequest { - - /** ExecuteSqlRequest session */ - session?: (string|null); - - /** ExecuteSqlRequest transaction */ - transaction?: (google.spanner.v1.ITransactionSelector|null); - - /** ExecuteSqlRequest sql */ - sql?: (string|null); - - /** ExecuteSqlRequest params */ - params?: (google.protobuf.IStruct|null); - - /** ExecuteSqlRequest paramTypes */ - paramTypes?: ({ [k: string]: google.spanner.v1.IType }|null); - - /** ExecuteSqlRequest resumeToken */ - resumeToken?: (Uint8Array|Buffer|string|null); - - /** ExecuteSqlRequest queryMode */ - queryMode?: (google.spanner.v1.ExecuteSqlRequest.QueryMode|keyof typeof google.spanner.v1.ExecuteSqlRequest.QueryMode|null); - - /** ExecuteSqlRequest partitionToken */ - partitionToken?: (Uint8Array|Buffer|string|null); - - /** ExecuteSqlRequest seqno */ - seqno?: (number|Long|string|null); - - /** ExecuteSqlRequest queryOptions */ - queryOptions?: (google.spanner.v1.ExecuteSqlRequest.IQueryOptions|null); - - /** ExecuteSqlRequest requestOptions */ - requestOptions?: (google.spanner.v1.IRequestOptions|null); - - /** ExecuteSqlRequest directedReadOptions */ - directedReadOptions?: (google.spanner.v1.IDirectedReadOptions|null); - - /** ExecuteSqlRequest dataBoostEnabled */ - dataBoostEnabled?: (boolean|null); - - /** ExecuteSqlRequest lastStatement */ - lastStatement?: (boolean|null); - - /** ExecuteSqlRequest routingHint */ - routingHint?: (google.spanner.v1.IRoutingHint|null); - } - - /** Represents an ExecuteSqlRequest. */ - class ExecuteSqlRequest implements IExecuteSqlRequest { - - /** - * Constructs a new ExecuteSqlRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.IExecuteSqlRequest); - - /** ExecuteSqlRequest session. */ - public session: string; - - /** ExecuteSqlRequest transaction. */ - public transaction?: (google.spanner.v1.ITransactionSelector|null); - - /** ExecuteSqlRequest sql. */ - public sql: string; - - /** ExecuteSqlRequest params. */ - public params?: (google.protobuf.IStruct|null); - - /** ExecuteSqlRequest paramTypes. */ - public paramTypes: { [k: string]: google.spanner.v1.IType }; - - /** ExecuteSqlRequest resumeToken. */ - public resumeToken: (Uint8Array|Buffer|string); - - /** ExecuteSqlRequest queryMode. */ - public queryMode: (google.spanner.v1.ExecuteSqlRequest.QueryMode|keyof typeof google.spanner.v1.ExecuteSqlRequest.QueryMode); - - /** ExecuteSqlRequest partitionToken. */ - public partitionToken: (Uint8Array|Buffer|string); - - /** ExecuteSqlRequest seqno. */ - public seqno: (number|Long|string); - - /** ExecuteSqlRequest queryOptions. */ - public queryOptions?: (google.spanner.v1.ExecuteSqlRequest.IQueryOptions|null); - - /** ExecuteSqlRequest requestOptions. */ - public requestOptions?: (google.spanner.v1.IRequestOptions|null); - - /** ExecuteSqlRequest directedReadOptions. */ - public directedReadOptions?: (google.spanner.v1.IDirectedReadOptions|null); - - /** ExecuteSqlRequest dataBoostEnabled. */ - public dataBoostEnabled: boolean; - - /** ExecuteSqlRequest lastStatement. */ - public lastStatement: boolean; - - /** ExecuteSqlRequest routingHint. */ - public routingHint?: (google.spanner.v1.IRoutingHint|null); - - /** - * Creates a new ExecuteSqlRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ExecuteSqlRequest instance - */ - public static create(properties?: google.spanner.v1.IExecuteSqlRequest): google.spanner.v1.ExecuteSqlRequest; - - /** - * Encodes the specified ExecuteSqlRequest message. Does not implicitly {@link google.spanner.v1.ExecuteSqlRequest.verify|verify} messages. - * @param message ExecuteSqlRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.IExecuteSqlRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExecuteSqlRequest message, length delimited. Does not implicitly {@link google.spanner.v1.ExecuteSqlRequest.verify|verify} messages. - * @param message ExecuteSqlRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.IExecuteSqlRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExecuteSqlRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExecuteSqlRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.ExecuteSqlRequest; - - /** - * Decodes an ExecuteSqlRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExecuteSqlRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.ExecuteSqlRequest; - - /** - * Verifies an ExecuteSqlRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ExecuteSqlRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExecuteSqlRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.ExecuteSqlRequest; - - /** - * Creates a plain object from an ExecuteSqlRequest message. Also converts values to other types if specified. - * @param message ExecuteSqlRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.ExecuteSqlRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExecuteSqlRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExecuteSqlRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ExecuteSqlRequest { - - /** QueryMode enum. */ - enum QueryMode { - NORMAL = 0, - PLAN = 1, - PROFILE = 2, - WITH_STATS = 3, - WITH_PLAN_AND_STATS = 4 - } - - /** Properties of a QueryOptions. */ - interface IQueryOptions { - - /** QueryOptions optimizerVersion */ - optimizerVersion?: (string|null); - - /** QueryOptions optimizerStatisticsPackage */ - optimizerStatisticsPackage?: (string|null); - } - - /** Represents a QueryOptions. */ - class QueryOptions implements IQueryOptions { - - /** - * Constructs a new QueryOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.ExecuteSqlRequest.IQueryOptions); - - /** QueryOptions optimizerVersion. */ - public optimizerVersion: string; - - /** QueryOptions optimizerStatisticsPackage. */ - public optimizerStatisticsPackage: string; - - /** - * Creates a new QueryOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryOptions instance - */ - public static create(properties?: google.spanner.v1.ExecuteSqlRequest.IQueryOptions): google.spanner.v1.ExecuteSqlRequest.QueryOptions; - - /** - * Encodes the specified QueryOptions message. Does not implicitly {@link google.spanner.v1.ExecuteSqlRequest.QueryOptions.verify|verify} messages. - * @param message QueryOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.ExecuteSqlRequest.IQueryOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryOptions message, length delimited. Does not implicitly {@link google.spanner.v1.ExecuteSqlRequest.QueryOptions.verify|verify} messages. - * @param message QueryOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.ExecuteSqlRequest.IQueryOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.ExecuteSqlRequest.QueryOptions; - - /** - * Decodes a QueryOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.ExecuteSqlRequest.QueryOptions; - - /** - * Verifies a QueryOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryOptions - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.ExecuteSqlRequest.QueryOptions; - - /** - * Creates a plain object from a QueryOptions message. Also converts values to other types if specified. - * @param message QueryOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.ExecuteSqlRequest.QueryOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for QueryOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an ExecuteBatchDmlRequest. */ - interface IExecuteBatchDmlRequest { - - /** ExecuteBatchDmlRequest session */ - session?: (string|null); - - /** ExecuteBatchDmlRequest transaction */ - transaction?: (google.spanner.v1.ITransactionSelector|null); - - /** ExecuteBatchDmlRequest statements */ - statements?: (google.spanner.v1.ExecuteBatchDmlRequest.IStatement[]|null); - - /** ExecuteBatchDmlRequest seqno */ - seqno?: (number|Long|string|null); - - /** ExecuteBatchDmlRequest requestOptions */ - requestOptions?: (google.spanner.v1.IRequestOptions|null); - - /** ExecuteBatchDmlRequest lastStatements */ - lastStatements?: (boolean|null); - } - - /** Represents an ExecuteBatchDmlRequest. */ - class ExecuteBatchDmlRequest implements IExecuteBatchDmlRequest { - - /** - * Constructs a new ExecuteBatchDmlRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.IExecuteBatchDmlRequest); - - /** ExecuteBatchDmlRequest session. */ - public session: string; - - /** ExecuteBatchDmlRequest transaction. */ - public transaction?: (google.spanner.v1.ITransactionSelector|null); - - /** ExecuteBatchDmlRequest statements. */ - public statements: google.spanner.v1.ExecuteBatchDmlRequest.IStatement[]; - - /** ExecuteBatchDmlRequest seqno. */ - public seqno: (number|Long|string); - - /** ExecuteBatchDmlRequest requestOptions. */ - public requestOptions?: (google.spanner.v1.IRequestOptions|null); - - /** ExecuteBatchDmlRequest lastStatements. */ - public lastStatements: boolean; - - /** - * Creates a new ExecuteBatchDmlRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ExecuteBatchDmlRequest instance - */ - public static create(properties?: google.spanner.v1.IExecuteBatchDmlRequest): google.spanner.v1.ExecuteBatchDmlRequest; - - /** - * Encodes the specified ExecuteBatchDmlRequest message. Does not implicitly {@link google.spanner.v1.ExecuteBatchDmlRequest.verify|verify} messages. - * @param message ExecuteBatchDmlRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.IExecuteBatchDmlRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExecuteBatchDmlRequest message, length delimited. Does not implicitly {@link google.spanner.v1.ExecuteBatchDmlRequest.verify|verify} messages. - * @param message ExecuteBatchDmlRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.IExecuteBatchDmlRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExecuteBatchDmlRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExecuteBatchDmlRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.ExecuteBatchDmlRequest; - - /** - * Decodes an ExecuteBatchDmlRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExecuteBatchDmlRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.ExecuteBatchDmlRequest; - - /** - * Verifies an ExecuteBatchDmlRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ExecuteBatchDmlRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExecuteBatchDmlRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.ExecuteBatchDmlRequest; - - /** - * Creates a plain object from an ExecuteBatchDmlRequest message. Also converts values to other types if specified. - * @param message ExecuteBatchDmlRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.ExecuteBatchDmlRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExecuteBatchDmlRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExecuteBatchDmlRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ExecuteBatchDmlRequest { - - /** Properties of a Statement. */ - interface IStatement { - - /** Statement sql */ - sql?: (string|null); - - /** Statement params */ - params?: (google.protobuf.IStruct|null); - - /** Statement paramTypes */ - paramTypes?: ({ [k: string]: google.spanner.v1.IType }|null); - } - - /** Represents a Statement. */ - class Statement implements IStatement { - - /** - * Constructs a new Statement. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.ExecuteBatchDmlRequest.IStatement); - - /** Statement sql. */ - public sql: string; - - /** Statement params. */ - public params?: (google.protobuf.IStruct|null); - - /** Statement paramTypes. */ - public paramTypes: { [k: string]: google.spanner.v1.IType }; - - /** - * Creates a new Statement instance using the specified properties. - * @param [properties] Properties to set - * @returns Statement instance - */ - public static create(properties?: google.spanner.v1.ExecuteBatchDmlRequest.IStatement): google.spanner.v1.ExecuteBatchDmlRequest.Statement; - - /** - * Encodes the specified Statement message. Does not implicitly {@link google.spanner.v1.ExecuteBatchDmlRequest.Statement.verify|verify} messages. - * @param message Statement message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.ExecuteBatchDmlRequest.IStatement, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Statement message, length delimited. Does not implicitly {@link google.spanner.v1.ExecuteBatchDmlRequest.Statement.verify|verify} messages. - * @param message Statement message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.ExecuteBatchDmlRequest.IStatement, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Statement message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Statement - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.ExecuteBatchDmlRequest.Statement; - - /** - * Decodes a Statement message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Statement - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.ExecuteBatchDmlRequest.Statement; - - /** - * Verifies a Statement message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Statement message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Statement - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.ExecuteBatchDmlRequest.Statement; - - /** - * Creates a plain object from a Statement message. Also converts values to other types if specified. - * @param message Statement - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.ExecuteBatchDmlRequest.Statement, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Statement to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Statement - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an ExecuteBatchDmlResponse. */ - interface IExecuteBatchDmlResponse { - - /** ExecuteBatchDmlResponse resultSets */ - resultSets?: (google.spanner.v1.IResultSet[]|null); - - /** ExecuteBatchDmlResponse status */ - status?: (google.rpc.IStatus|null); - - /** ExecuteBatchDmlResponse precommitToken */ - precommitToken?: (google.spanner.v1.IMultiplexedSessionPrecommitToken|null); - } - - /** Represents an ExecuteBatchDmlResponse. */ - class ExecuteBatchDmlResponse implements IExecuteBatchDmlResponse { - - /** - * Constructs a new ExecuteBatchDmlResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.IExecuteBatchDmlResponse); - - /** ExecuteBatchDmlResponse resultSets. */ - public resultSets: google.spanner.v1.IResultSet[]; - - /** ExecuteBatchDmlResponse status. */ - public status?: (google.rpc.IStatus|null); - - /** ExecuteBatchDmlResponse precommitToken. */ - public precommitToken?: (google.spanner.v1.IMultiplexedSessionPrecommitToken|null); - - /** - * Creates a new ExecuteBatchDmlResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ExecuteBatchDmlResponse instance - */ - public static create(properties?: google.spanner.v1.IExecuteBatchDmlResponse): google.spanner.v1.ExecuteBatchDmlResponse; - - /** - * Encodes the specified ExecuteBatchDmlResponse message. Does not implicitly {@link google.spanner.v1.ExecuteBatchDmlResponse.verify|verify} messages. - * @param message ExecuteBatchDmlResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.IExecuteBatchDmlResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExecuteBatchDmlResponse message, length delimited. Does not implicitly {@link google.spanner.v1.ExecuteBatchDmlResponse.verify|verify} messages. - * @param message ExecuteBatchDmlResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.IExecuteBatchDmlResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExecuteBatchDmlResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExecuteBatchDmlResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.ExecuteBatchDmlResponse; - - /** - * Decodes an ExecuteBatchDmlResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExecuteBatchDmlResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.ExecuteBatchDmlResponse; - - /** - * Verifies an ExecuteBatchDmlResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ExecuteBatchDmlResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExecuteBatchDmlResponse - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.ExecuteBatchDmlResponse; - - /** - * Creates a plain object from an ExecuteBatchDmlResponse message. Also converts values to other types if specified. - * @param message ExecuteBatchDmlResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.ExecuteBatchDmlResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExecuteBatchDmlResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExecuteBatchDmlResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PartitionOptions. */ - interface IPartitionOptions { - - /** PartitionOptions partitionSizeBytes */ - partitionSizeBytes?: (number|Long|string|null); - - /** PartitionOptions maxPartitions */ - maxPartitions?: (number|Long|string|null); - } - - /** Represents a PartitionOptions. */ - class PartitionOptions implements IPartitionOptions { - - /** - * Constructs a new PartitionOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.IPartitionOptions); - - /** PartitionOptions partitionSizeBytes. */ - public partitionSizeBytes: (number|Long|string); - - /** PartitionOptions maxPartitions. */ - public maxPartitions: (number|Long|string); - - /** - * Creates a new PartitionOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns PartitionOptions instance - */ - public static create(properties?: google.spanner.v1.IPartitionOptions): google.spanner.v1.PartitionOptions; - - /** - * Encodes the specified PartitionOptions message. Does not implicitly {@link google.spanner.v1.PartitionOptions.verify|verify} messages. - * @param message PartitionOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.IPartitionOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PartitionOptions message, length delimited. Does not implicitly {@link google.spanner.v1.PartitionOptions.verify|verify} messages. - * @param message PartitionOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.IPartitionOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PartitionOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PartitionOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.PartitionOptions; - - /** - * Decodes a PartitionOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PartitionOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.PartitionOptions; - - /** - * Verifies a PartitionOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PartitionOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PartitionOptions - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.PartitionOptions; - - /** - * Creates a plain object from a PartitionOptions message. Also converts values to other types if specified. - * @param message PartitionOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.PartitionOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PartitionOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PartitionOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PartitionQueryRequest. */ - interface IPartitionQueryRequest { - - /** PartitionQueryRequest session */ - session?: (string|null); - - /** PartitionQueryRequest transaction */ - transaction?: (google.spanner.v1.ITransactionSelector|null); - - /** PartitionQueryRequest sql */ - sql?: (string|null); - - /** PartitionQueryRequest params */ - params?: (google.protobuf.IStruct|null); - - /** PartitionQueryRequest paramTypes */ - paramTypes?: ({ [k: string]: google.spanner.v1.IType }|null); - - /** PartitionQueryRequest partitionOptions */ - partitionOptions?: (google.spanner.v1.IPartitionOptions|null); - } - - /** Represents a PartitionQueryRequest. */ - class PartitionQueryRequest implements IPartitionQueryRequest { - - /** - * Constructs a new PartitionQueryRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.IPartitionQueryRequest); - - /** PartitionQueryRequest session. */ - public session: string; - - /** PartitionQueryRequest transaction. */ - public transaction?: (google.spanner.v1.ITransactionSelector|null); - - /** PartitionQueryRequest sql. */ - public sql: string; - - /** PartitionQueryRequest params. */ - public params?: (google.protobuf.IStruct|null); - - /** PartitionQueryRequest paramTypes. */ - public paramTypes: { [k: string]: google.spanner.v1.IType }; - - /** PartitionQueryRequest partitionOptions. */ - public partitionOptions?: (google.spanner.v1.IPartitionOptions|null); - - /** - * Creates a new PartitionQueryRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns PartitionQueryRequest instance - */ - public static create(properties?: google.spanner.v1.IPartitionQueryRequest): google.spanner.v1.PartitionQueryRequest; - - /** - * Encodes the specified PartitionQueryRequest message. Does not implicitly {@link google.spanner.v1.PartitionQueryRequest.verify|verify} messages. - * @param message PartitionQueryRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.IPartitionQueryRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PartitionQueryRequest message, length delimited. Does not implicitly {@link google.spanner.v1.PartitionQueryRequest.verify|verify} messages. - * @param message PartitionQueryRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.IPartitionQueryRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PartitionQueryRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PartitionQueryRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.PartitionQueryRequest; - - /** - * Decodes a PartitionQueryRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PartitionQueryRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.PartitionQueryRequest; - - /** - * Verifies a PartitionQueryRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PartitionQueryRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PartitionQueryRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.PartitionQueryRequest; - - /** - * Creates a plain object from a PartitionQueryRequest message. Also converts values to other types if specified. - * @param message PartitionQueryRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.PartitionQueryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PartitionQueryRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PartitionQueryRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PartitionReadRequest. */ - interface IPartitionReadRequest { - - /** PartitionReadRequest session */ - session?: (string|null); - - /** PartitionReadRequest transaction */ - transaction?: (google.spanner.v1.ITransactionSelector|null); - - /** PartitionReadRequest table */ - table?: (string|null); - - /** PartitionReadRequest index */ - index?: (string|null); - - /** PartitionReadRequest columns */ - columns?: (string[]|null); - - /** PartitionReadRequest keySet */ - keySet?: (google.spanner.v1.IKeySet|null); - - /** PartitionReadRequest partitionOptions */ - partitionOptions?: (google.spanner.v1.IPartitionOptions|null); - } - - /** Represents a PartitionReadRequest. */ - class PartitionReadRequest implements IPartitionReadRequest { - - /** - * Constructs a new PartitionReadRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.IPartitionReadRequest); - - /** PartitionReadRequest session. */ - public session: string; - - /** PartitionReadRequest transaction. */ - public transaction?: (google.spanner.v1.ITransactionSelector|null); - - /** PartitionReadRequest table. */ - public table: string; - - /** PartitionReadRequest index. */ - public index: string; - - /** PartitionReadRequest columns. */ - public columns: string[]; - - /** PartitionReadRequest keySet. */ - public keySet?: (google.spanner.v1.IKeySet|null); - - /** PartitionReadRequest partitionOptions. */ - public partitionOptions?: (google.spanner.v1.IPartitionOptions|null); - - /** - * Creates a new PartitionReadRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns PartitionReadRequest instance - */ - public static create(properties?: google.spanner.v1.IPartitionReadRequest): google.spanner.v1.PartitionReadRequest; - - /** - * Encodes the specified PartitionReadRequest message. Does not implicitly {@link google.spanner.v1.PartitionReadRequest.verify|verify} messages. - * @param message PartitionReadRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.IPartitionReadRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PartitionReadRequest message, length delimited. Does not implicitly {@link google.spanner.v1.PartitionReadRequest.verify|verify} messages. - * @param message PartitionReadRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.IPartitionReadRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PartitionReadRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PartitionReadRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.PartitionReadRequest; - - /** - * Decodes a PartitionReadRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PartitionReadRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.PartitionReadRequest; - - /** - * Verifies a PartitionReadRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PartitionReadRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PartitionReadRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.PartitionReadRequest; - - /** - * Creates a plain object from a PartitionReadRequest message. Also converts values to other types if specified. - * @param message PartitionReadRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.PartitionReadRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PartitionReadRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PartitionReadRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Partition. */ - interface IPartition { - - /** Partition partitionToken */ - partitionToken?: (Uint8Array|Buffer|string|null); - } - - /** Represents a Partition. */ - class Partition implements IPartition { - - /** - * Constructs a new Partition. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.IPartition); - - /** Partition partitionToken. */ - public partitionToken: (Uint8Array|Buffer|string); - - /** - * Creates a new Partition instance using the specified properties. - * @param [properties] Properties to set - * @returns Partition instance - */ - public static create(properties?: google.spanner.v1.IPartition): google.spanner.v1.Partition; - - /** - * Encodes the specified Partition message. Does not implicitly {@link google.spanner.v1.Partition.verify|verify} messages. - * @param message Partition message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.IPartition, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Partition message, length delimited. Does not implicitly {@link google.spanner.v1.Partition.verify|verify} messages. - * @param message Partition message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.IPartition, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Partition message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Partition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.Partition; - - /** - * Decodes a Partition message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Partition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.Partition; - - /** - * Verifies a Partition message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Partition message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Partition - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.Partition; - - /** - * Creates a plain object from a Partition message. Also converts values to other types if specified. - * @param message Partition - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.Partition, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Partition to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Partition - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PartitionResponse. */ - interface IPartitionResponse { - - /** PartitionResponse partitions */ - partitions?: (google.spanner.v1.IPartition[]|null); - - /** PartitionResponse transaction */ - transaction?: (google.spanner.v1.ITransaction|null); - } - - /** Represents a PartitionResponse. */ - class PartitionResponse implements IPartitionResponse { - - /** - * Constructs a new PartitionResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.IPartitionResponse); - - /** PartitionResponse partitions. */ - public partitions: google.spanner.v1.IPartition[]; - - /** PartitionResponse transaction. */ - public transaction?: (google.spanner.v1.ITransaction|null); - - /** - * Creates a new PartitionResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns PartitionResponse instance - */ - public static create(properties?: google.spanner.v1.IPartitionResponse): google.spanner.v1.PartitionResponse; - - /** - * Encodes the specified PartitionResponse message. Does not implicitly {@link google.spanner.v1.PartitionResponse.verify|verify} messages. - * @param message PartitionResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.IPartitionResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PartitionResponse message, length delimited. Does not implicitly {@link google.spanner.v1.PartitionResponse.verify|verify} messages. - * @param message PartitionResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.IPartitionResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PartitionResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PartitionResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.PartitionResponse; - - /** - * Decodes a PartitionResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PartitionResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.PartitionResponse; - - /** - * Verifies a PartitionResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PartitionResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PartitionResponse - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.PartitionResponse; - - /** - * Creates a plain object from a PartitionResponse message. Also converts values to other types if specified. - * @param message PartitionResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.PartitionResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PartitionResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PartitionResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ReadRequest. */ - interface IReadRequest { - - /** ReadRequest session */ - session?: (string|null); - - /** ReadRequest transaction */ - transaction?: (google.spanner.v1.ITransactionSelector|null); - - /** ReadRequest table */ - table?: (string|null); - - /** ReadRequest index */ - index?: (string|null); - - /** ReadRequest columns */ - columns?: (string[]|null); - - /** ReadRequest keySet */ - keySet?: (google.spanner.v1.IKeySet|null); - - /** ReadRequest limit */ - limit?: (number|Long|string|null); - - /** ReadRequest resumeToken */ - resumeToken?: (Uint8Array|Buffer|string|null); - - /** ReadRequest partitionToken */ - partitionToken?: (Uint8Array|Buffer|string|null); - - /** ReadRequest requestOptions */ - requestOptions?: (google.spanner.v1.IRequestOptions|null); - - /** ReadRequest directedReadOptions */ - directedReadOptions?: (google.spanner.v1.IDirectedReadOptions|null); - - /** ReadRequest dataBoostEnabled */ - dataBoostEnabled?: (boolean|null); - - /** ReadRequest orderBy */ - orderBy?: (google.spanner.v1.ReadRequest.OrderBy|keyof typeof google.spanner.v1.ReadRequest.OrderBy|null); - - /** ReadRequest lockHint */ - lockHint?: (google.spanner.v1.ReadRequest.LockHint|keyof typeof google.spanner.v1.ReadRequest.LockHint|null); - - /** ReadRequest routingHint */ - routingHint?: (google.spanner.v1.IRoutingHint|null); - } - - /** Represents a ReadRequest. */ - class ReadRequest implements IReadRequest { - - /** - * Constructs a new ReadRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.IReadRequest); - - /** ReadRequest session. */ - public session: string; - - /** ReadRequest transaction. */ - public transaction?: (google.spanner.v1.ITransactionSelector|null); - - /** ReadRequest table. */ - public table: string; - - /** ReadRequest index. */ - public index: string; - - /** ReadRequest columns. */ - public columns: string[]; - - /** ReadRequest keySet. */ - public keySet?: (google.spanner.v1.IKeySet|null); - - /** ReadRequest limit. */ - public limit: (number|Long|string); - - /** ReadRequest resumeToken. */ - public resumeToken: (Uint8Array|Buffer|string); - - /** ReadRequest partitionToken. */ - public partitionToken: (Uint8Array|Buffer|string); - - /** ReadRequest requestOptions. */ - public requestOptions?: (google.spanner.v1.IRequestOptions|null); - - /** ReadRequest directedReadOptions. */ - public directedReadOptions?: (google.spanner.v1.IDirectedReadOptions|null); - - /** ReadRequest dataBoostEnabled. */ - public dataBoostEnabled: boolean; - - /** ReadRequest orderBy. */ - public orderBy: (google.spanner.v1.ReadRequest.OrderBy|keyof typeof google.spanner.v1.ReadRequest.OrderBy); - - /** ReadRequest lockHint. */ - public lockHint: (google.spanner.v1.ReadRequest.LockHint|keyof typeof google.spanner.v1.ReadRequest.LockHint); - - /** ReadRequest routingHint. */ - public routingHint?: (google.spanner.v1.IRoutingHint|null); - - /** - * Creates a new ReadRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ReadRequest instance - */ - public static create(properties?: google.spanner.v1.IReadRequest): google.spanner.v1.ReadRequest; - - /** - * Encodes the specified ReadRequest message. Does not implicitly {@link google.spanner.v1.ReadRequest.verify|verify} messages. - * @param message ReadRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.IReadRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ReadRequest message, length delimited. Does not implicitly {@link google.spanner.v1.ReadRequest.verify|verify} messages. - * @param message ReadRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.IReadRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ReadRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ReadRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.ReadRequest; - - /** - * Decodes a ReadRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ReadRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.ReadRequest; - - /** - * Verifies a ReadRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ReadRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ReadRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.ReadRequest; - - /** - * Creates a plain object from a ReadRequest message. Also converts values to other types if specified. - * @param message ReadRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.ReadRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ReadRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ReadRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ReadRequest { - - /** OrderBy enum. */ - enum OrderBy { - ORDER_BY_UNSPECIFIED = 0, - ORDER_BY_PRIMARY_KEY = 1, - ORDER_BY_NO_ORDER = 2 - } - - /** LockHint enum. */ - enum LockHint { - LOCK_HINT_UNSPECIFIED = 0, - LOCK_HINT_SHARED = 1, - LOCK_HINT_EXCLUSIVE = 2 - } - } - - /** Properties of a BeginTransactionRequest. */ - interface IBeginTransactionRequest { - - /** BeginTransactionRequest session */ - session?: (string|null); - - /** BeginTransactionRequest options */ - options?: (google.spanner.v1.ITransactionOptions|null); - - /** BeginTransactionRequest requestOptions */ - requestOptions?: (google.spanner.v1.IRequestOptions|null); - - /** BeginTransactionRequest mutationKey */ - mutationKey?: (google.spanner.v1.IMutation|null); - } - - /** Represents a BeginTransactionRequest. */ - class BeginTransactionRequest implements IBeginTransactionRequest { - - /** - * Constructs a new BeginTransactionRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.IBeginTransactionRequest); - - /** BeginTransactionRequest session. */ - public session: string; - - /** BeginTransactionRequest options. */ - public options?: (google.spanner.v1.ITransactionOptions|null); - - /** BeginTransactionRequest requestOptions. */ - public requestOptions?: (google.spanner.v1.IRequestOptions|null); - - /** BeginTransactionRequest mutationKey. */ - public mutationKey?: (google.spanner.v1.IMutation|null); - - /** - * Creates a new BeginTransactionRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns BeginTransactionRequest instance - */ - public static create(properties?: google.spanner.v1.IBeginTransactionRequest): google.spanner.v1.BeginTransactionRequest; - - /** - * Encodes the specified BeginTransactionRequest message. Does not implicitly {@link google.spanner.v1.BeginTransactionRequest.verify|verify} messages. - * @param message BeginTransactionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.IBeginTransactionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BeginTransactionRequest message, length delimited. Does not implicitly {@link google.spanner.v1.BeginTransactionRequest.verify|verify} messages. - * @param message BeginTransactionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.IBeginTransactionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BeginTransactionRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BeginTransactionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.BeginTransactionRequest; - - /** - * Decodes a BeginTransactionRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BeginTransactionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.BeginTransactionRequest; - - /** - * Verifies a BeginTransactionRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BeginTransactionRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BeginTransactionRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.BeginTransactionRequest; - - /** - * Creates a plain object from a BeginTransactionRequest message. Also converts values to other types if specified. - * @param message BeginTransactionRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.BeginTransactionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BeginTransactionRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BeginTransactionRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CommitRequest. */ - interface ICommitRequest { - - /** CommitRequest session */ - session?: (string|null); - - /** CommitRequest transactionId */ - transactionId?: (Uint8Array|Buffer|string|null); - - /** CommitRequest singleUseTransaction */ - singleUseTransaction?: (google.spanner.v1.ITransactionOptions|null); - - /** CommitRequest mutations */ - mutations?: (google.spanner.v1.IMutation[]|null); - - /** CommitRequest returnCommitStats */ - returnCommitStats?: (boolean|null); - - /** CommitRequest maxCommitDelay */ - maxCommitDelay?: (google.protobuf.IDuration|null); - - /** CommitRequest requestOptions */ - requestOptions?: (google.spanner.v1.IRequestOptions|null); - - /** CommitRequest precommitToken */ - precommitToken?: (google.spanner.v1.IMultiplexedSessionPrecommitToken|null); - } - - /** Represents a CommitRequest. */ - class CommitRequest implements ICommitRequest { - - /** - * Constructs a new CommitRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.ICommitRequest); - - /** CommitRequest session. */ - public session: string; - - /** CommitRequest transactionId. */ - public transactionId?: (Uint8Array|Buffer|string|null); - - /** CommitRequest singleUseTransaction. */ - public singleUseTransaction?: (google.spanner.v1.ITransactionOptions|null); - - /** CommitRequest mutations. */ - public mutations: google.spanner.v1.IMutation[]; - - /** CommitRequest returnCommitStats. */ - public returnCommitStats: boolean; - - /** CommitRequest maxCommitDelay. */ - public maxCommitDelay?: (google.protobuf.IDuration|null); - - /** CommitRequest requestOptions. */ - public requestOptions?: (google.spanner.v1.IRequestOptions|null); - - /** CommitRequest precommitToken. */ - public precommitToken?: (google.spanner.v1.IMultiplexedSessionPrecommitToken|null); - - /** CommitRequest transaction. */ - public transaction?: ("transactionId"|"singleUseTransaction"); - - /** - * Creates a new CommitRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CommitRequest instance - */ - public static create(properties?: google.spanner.v1.ICommitRequest): google.spanner.v1.CommitRequest; - - /** - * Encodes the specified CommitRequest message. Does not implicitly {@link google.spanner.v1.CommitRequest.verify|verify} messages. - * @param message CommitRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.ICommitRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CommitRequest message, length delimited. Does not implicitly {@link google.spanner.v1.CommitRequest.verify|verify} messages. - * @param message CommitRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.ICommitRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CommitRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CommitRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.CommitRequest; - - /** - * Decodes a CommitRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CommitRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.CommitRequest; - - /** - * Verifies a CommitRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CommitRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CommitRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.CommitRequest; - - /** - * Creates a plain object from a CommitRequest message. Also converts values to other types if specified. - * @param message CommitRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.CommitRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CommitRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CommitRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RollbackRequest. */ - interface IRollbackRequest { - - /** RollbackRequest session */ - session?: (string|null); - - /** RollbackRequest transactionId */ - transactionId?: (Uint8Array|Buffer|string|null); - } - - /** Represents a RollbackRequest. */ - class RollbackRequest implements IRollbackRequest { - - /** - * Constructs a new RollbackRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.IRollbackRequest); - - /** RollbackRequest session. */ - public session: string; - - /** RollbackRequest transactionId. */ - public transactionId: (Uint8Array|Buffer|string); - - /** - * Creates a new RollbackRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns RollbackRequest instance - */ - public static create(properties?: google.spanner.v1.IRollbackRequest): google.spanner.v1.RollbackRequest; - - /** - * Encodes the specified RollbackRequest message. Does not implicitly {@link google.spanner.v1.RollbackRequest.verify|verify} messages. - * @param message RollbackRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.IRollbackRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RollbackRequest message, length delimited. Does not implicitly {@link google.spanner.v1.RollbackRequest.verify|verify} messages. - * @param message RollbackRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.IRollbackRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RollbackRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RollbackRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.RollbackRequest; - - /** - * Decodes a RollbackRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RollbackRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.RollbackRequest; - - /** - * Verifies a RollbackRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RollbackRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RollbackRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.RollbackRequest; - - /** - * Creates a plain object from a RollbackRequest message. Also converts values to other types if specified. - * @param message RollbackRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.RollbackRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RollbackRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RollbackRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BatchWriteRequest. */ - interface IBatchWriteRequest { - - /** BatchWriteRequest session */ - session?: (string|null); - - /** BatchWriteRequest requestOptions */ - requestOptions?: (google.spanner.v1.IRequestOptions|null); - - /** BatchWriteRequest mutationGroups */ - mutationGroups?: (google.spanner.v1.BatchWriteRequest.IMutationGroup[]|null); - - /** BatchWriteRequest excludeTxnFromChangeStreams */ - excludeTxnFromChangeStreams?: (boolean|null); - } - - /** Represents a BatchWriteRequest. */ - class BatchWriteRequest implements IBatchWriteRequest { - - /** - * Constructs a new BatchWriteRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.IBatchWriteRequest); - - /** BatchWriteRequest session. */ - public session: string; - - /** BatchWriteRequest requestOptions. */ - public requestOptions?: (google.spanner.v1.IRequestOptions|null); - - /** BatchWriteRequest mutationGroups. */ - public mutationGroups: google.spanner.v1.BatchWriteRequest.IMutationGroup[]; - - /** BatchWriteRequest excludeTxnFromChangeStreams. */ - public excludeTxnFromChangeStreams: boolean; - - /** - * Creates a new BatchWriteRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns BatchWriteRequest instance - */ - public static create(properties?: google.spanner.v1.IBatchWriteRequest): google.spanner.v1.BatchWriteRequest; - - /** - * Encodes the specified BatchWriteRequest message. Does not implicitly {@link google.spanner.v1.BatchWriteRequest.verify|verify} messages. - * @param message BatchWriteRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.IBatchWriteRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BatchWriteRequest message, length delimited. Does not implicitly {@link google.spanner.v1.BatchWriteRequest.verify|verify} messages. - * @param message BatchWriteRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.IBatchWriteRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BatchWriteRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BatchWriteRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.BatchWriteRequest; - - /** - * Decodes a BatchWriteRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BatchWriteRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.BatchWriteRequest; - - /** - * Verifies a BatchWriteRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BatchWriteRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BatchWriteRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.BatchWriteRequest; - - /** - * Creates a plain object from a BatchWriteRequest message. Also converts values to other types if specified. - * @param message BatchWriteRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.BatchWriteRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BatchWriteRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BatchWriteRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace BatchWriteRequest { - - /** Properties of a MutationGroup. */ - interface IMutationGroup { - - /** MutationGroup mutations */ - mutations?: (google.spanner.v1.IMutation[]|null); - } - - /** Represents a MutationGroup. */ - class MutationGroup implements IMutationGroup { - - /** - * Constructs a new MutationGroup. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.BatchWriteRequest.IMutationGroup); - - /** MutationGroup mutations. */ - public mutations: google.spanner.v1.IMutation[]; - - /** - * Creates a new MutationGroup instance using the specified properties. - * @param [properties] Properties to set - * @returns MutationGroup instance - */ - public static create(properties?: google.spanner.v1.BatchWriteRequest.IMutationGroup): google.spanner.v1.BatchWriteRequest.MutationGroup; - - /** - * Encodes the specified MutationGroup message. Does not implicitly {@link google.spanner.v1.BatchWriteRequest.MutationGroup.verify|verify} messages. - * @param message MutationGroup message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.BatchWriteRequest.IMutationGroup, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MutationGroup message, length delimited. Does not implicitly {@link google.spanner.v1.BatchWriteRequest.MutationGroup.verify|verify} messages. - * @param message MutationGroup message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.BatchWriteRequest.IMutationGroup, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MutationGroup message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MutationGroup - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.BatchWriteRequest.MutationGroup; - - /** - * Decodes a MutationGroup message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MutationGroup - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.BatchWriteRequest.MutationGroup; - - /** - * Verifies a MutationGroup message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MutationGroup message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MutationGroup - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.BatchWriteRequest.MutationGroup; - - /** - * Creates a plain object from a MutationGroup message. Also converts values to other types if specified. - * @param message MutationGroup - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.BatchWriteRequest.MutationGroup, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MutationGroup to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MutationGroup - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a BatchWriteResponse. */ - interface IBatchWriteResponse { - - /** BatchWriteResponse indexes */ - indexes?: (number[]|null); - - /** BatchWriteResponse status */ - status?: (google.rpc.IStatus|null); - - /** BatchWriteResponse commitTimestamp */ - commitTimestamp?: (google.protobuf.ITimestamp|null); - } - - /** Represents a BatchWriteResponse. */ - class BatchWriteResponse implements IBatchWriteResponse { - - /** - * Constructs a new BatchWriteResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.IBatchWriteResponse); - - /** BatchWriteResponse indexes. */ - public indexes: number[]; - - /** BatchWriteResponse status. */ - public status?: (google.rpc.IStatus|null); - - /** BatchWriteResponse commitTimestamp. */ - public commitTimestamp?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new BatchWriteResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns BatchWriteResponse instance - */ - public static create(properties?: google.spanner.v1.IBatchWriteResponse): google.spanner.v1.BatchWriteResponse; - - /** - * Encodes the specified BatchWriteResponse message. Does not implicitly {@link google.spanner.v1.BatchWriteResponse.verify|verify} messages. - * @param message BatchWriteResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.IBatchWriteResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BatchWriteResponse message, length delimited. Does not implicitly {@link google.spanner.v1.BatchWriteResponse.verify|verify} messages. - * @param message BatchWriteResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.IBatchWriteResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BatchWriteResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BatchWriteResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.BatchWriteResponse; - - /** - * Decodes a BatchWriteResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BatchWriteResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.BatchWriteResponse; - - /** - * Verifies a BatchWriteResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BatchWriteResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BatchWriteResponse - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.BatchWriteResponse; - - /** - * Creates a plain object from a BatchWriteResponse message. Also converts values to other types if specified. - * @param message BatchWriteResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.BatchWriteResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BatchWriteResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BatchWriteResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CommitResponse. */ - interface ICommitResponse { - - /** CommitResponse commitTimestamp */ - commitTimestamp?: (google.protobuf.ITimestamp|null); - - /** CommitResponse commitStats */ - commitStats?: (google.spanner.v1.CommitResponse.ICommitStats|null); - - /** CommitResponse precommitToken */ - precommitToken?: (google.spanner.v1.IMultiplexedSessionPrecommitToken|null); - - /** CommitResponse snapshotTimestamp */ - snapshotTimestamp?: (google.protobuf.ITimestamp|null); - } - - /** Represents a CommitResponse. */ - class CommitResponse implements ICommitResponse { - - /** - * Constructs a new CommitResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.ICommitResponse); - - /** CommitResponse commitTimestamp. */ - public commitTimestamp?: (google.protobuf.ITimestamp|null); - - /** CommitResponse commitStats. */ - public commitStats?: (google.spanner.v1.CommitResponse.ICommitStats|null); - - /** CommitResponse precommitToken. */ - public precommitToken?: (google.spanner.v1.IMultiplexedSessionPrecommitToken|null); - - /** CommitResponse snapshotTimestamp. */ - public snapshotTimestamp?: (google.protobuf.ITimestamp|null); - - /** CommitResponse MultiplexedSessionRetry. */ - public MultiplexedSessionRetry?: "precommitToken"; - - /** - * Creates a new CommitResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns CommitResponse instance - */ - public static create(properties?: google.spanner.v1.ICommitResponse): google.spanner.v1.CommitResponse; - - /** - * Encodes the specified CommitResponse message. Does not implicitly {@link google.spanner.v1.CommitResponse.verify|verify} messages. - * @param message CommitResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.ICommitResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CommitResponse message, length delimited. Does not implicitly {@link google.spanner.v1.CommitResponse.verify|verify} messages. - * @param message CommitResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.ICommitResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CommitResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CommitResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.CommitResponse; - - /** - * Decodes a CommitResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CommitResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.CommitResponse; - - /** - * Verifies a CommitResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CommitResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CommitResponse - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.CommitResponse; - - /** - * Creates a plain object from a CommitResponse message. Also converts values to other types if specified. - * @param message CommitResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.CommitResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CommitResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CommitResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace CommitResponse { - - /** Properties of a CommitStats. */ - interface ICommitStats { - - /** CommitStats mutationCount */ - mutationCount?: (number|Long|string|null); - } - - /** Represents a CommitStats. */ - class CommitStats implements ICommitStats { - - /** - * Constructs a new CommitStats. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.CommitResponse.ICommitStats); - - /** CommitStats mutationCount. */ - public mutationCount: (number|Long|string); - - /** - * Creates a new CommitStats instance using the specified properties. - * @param [properties] Properties to set - * @returns CommitStats instance - */ - public static create(properties?: google.spanner.v1.CommitResponse.ICommitStats): google.spanner.v1.CommitResponse.CommitStats; - - /** - * Encodes the specified CommitStats message. Does not implicitly {@link google.spanner.v1.CommitResponse.CommitStats.verify|verify} messages. - * @param message CommitStats message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.CommitResponse.ICommitStats, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CommitStats message, length delimited. Does not implicitly {@link google.spanner.v1.CommitResponse.CommitStats.verify|verify} messages. - * @param message CommitStats message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.CommitResponse.ICommitStats, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CommitStats message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CommitStats - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.CommitResponse.CommitStats; - - /** - * Decodes a CommitStats message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CommitStats - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.CommitResponse.CommitStats; - - /** - * Verifies a CommitStats message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CommitStats message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CommitStats - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.CommitResponse.CommitStats; - - /** - * Creates a plain object from a CommitStats message. Also converts values to other types if specified. - * @param message CommitStats - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.CommitResponse.CommitStats, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CommitStats to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CommitStats - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a TransactionOptions. */ - interface ITransactionOptions { - - /** TransactionOptions readWrite */ - readWrite?: (google.spanner.v1.TransactionOptions.IReadWrite|null); - - /** TransactionOptions partitionedDml */ - partitionedDml?: (google.spanner.v1.TransactionOptions.IPartitionedDml|null); - - /** TransactionOptions readOnly */ - readOnly?: (google.spanner.v1.TransactionOptions.IReadOnly|null); - - /** TransactionOptions excludeTxnFromChangeStreams */ - excludeTxnFromChangeStreams?: (boolean|null); - - /** TransactionOptions isolationLevel */ - isolationLevel?: (google.spanner.v1.TransactionOptions.IsolationLevel|keyof typeof google.spanner.v1.TransactionOptions.IsolationLevel|null); - } - - /** Represents a TransactionOptions. */ - class TransactionOptions implements ITransactionOptions { - - /** - * Constructs a new TransactionOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.ITransactionOptions); - - /** TransactionOptions readWrite. */ - public readWrite?: (google.spanner.v1.TransactionOptions.IReadWrite|null); - - /** TransactionOptions partitionedDml. */ - public partitionedDml?: (google.spanner.v1.TransactionOptions.IPartitionedDml|null); - - /** TransactionOptions readOnly. */ - public readOnly?: (google.spanner.v1.TransactionOptions.IReadOnly|null); - - /** TransactionOptions excludeTxnFromChangeStreams. */ - public excludeTxnFromChangeStreams: boolean; - - /** TransactionOptions isolationLevel. */ - public isolationLevel: (google.spanner.v1.TransactionOptions.IsolationLevel|keyof typeof google.spanner.v1.TransactionOptions.IsolationLevel); - - /** TransactionOptions mode. */ - public mode?: ("readWrite"|"partitionedDml"|"readOnly"); - - /** - * Creates a new TransactionOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns TransactionOptions instance - */ - public static create(properties?: google.spanner.v1.ITransactionOptions): google.spanner.v1.TransactionOptions; - - /** - * Encodes the specified TransactionOptions message. Does not implicitly {@link google.spanner.v1.TransactionOptions.verify|verify} messages. - * @param message TransactionOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.ITransactionOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TransactionOptions message, length delimited. Does not implicitly {@link google.spanner.v1.TransactionOptions.verify|verify} messages. - * @param message TransactionOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.ITransactionOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TransactionOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TransactionOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.TransactionOptions; - - /** - * Decodes a TransactionOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TransactionOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.TransactionOptions; - - /** - * Verifies a TransactionOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TransactionOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TransactionOptions - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.TransactionOptions; - - /** - * Creates a plain object from a TransactionOptions message. Also converts values to other types if specified. - * @param message TransactionOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.TransactionOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TransactionOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TransactionOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace TransactionOptions { - - /** Properties of a ReadWrite. */ - interface IReadWrite { - - /** ReadWrite readLockMode */ - readLockMode?: (google.spanner.v1.TransactionOptions.ReadWrite.ReadLockMode|keyof typeof google.spanner.v1.TransactionOptions.ReadWrite.ReadLockMode|null); - - /** ReadWrite multiplexedSessionPreviousTransactionId */ - multiplexedSessionPreviousTransactionId?: (Uint8Array|Buffer|string|null); - } - - /** Represents a ReadWrite. */ - class ReadWrite implements IReadWrite { - - /** - * Constructs a new ReadWrite. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.TransactionOptions.IReadWrite); - - /** ReadWrite readLockMode. */ - public readLockMode: (google.spanner.v1.TransactionOptions.ReadWrite.ReadLockMode|keyof typeof google.spanner.v1.TransactionOptions.ReadWrite.ReadLockMode); - - /** ReadWrite multiplexedSessionPreviousTransactionId. */ - public multiplexedSessionPreviousTransactionId: (Uint8Array|Buffer|string); - - /** - * Creates a new ReadWrite instance using the specified properties. - * @param [properties] Properties to set - * @returns ReadWrite instance - */ - public static create(properties?: google.spanner.v1.TransactionOptions.IReadWrite): google.spanner.v1.TransactionOptions.ReadWrite; - - /** - * Encodes the specified ReadWrite message. Does not implicitly {@link google.spanner.v1.TransactionOptions.ReadWrite.verify|verify} messages. - * @param message ReadWrite message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.TransactionOptions.IReadWrite, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ReadWrite message, length delimited. Does not implicitly {@link google.spanner.v1.TransactionOptions.ReadWrite.verify|verify} messages. - * @param message ReadWrite message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.TransactionOptions.IReadWrite, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ReadWrite message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ReadWrite - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.TransactionOptions.ReadWrite; - - /** - * Decodes a ReadWrite message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ReadWrite - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.TransactionOptions.ReadWrite; - - /** - * Verifies a ReadWrite message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ReadWrite message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ReadWrite - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.TransactionOptions.ReadWrite; - - /** - * Creates a plain object from a ReadWrite message. Also converts values to other types if specified. - * @param message ReadWrite - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.TransactionOptions.ReadWrite, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ReadWrite to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ReadWrite - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ReadWrite { - - /** ReadLockMode enum. */ - enum ReadLockMode { - READ_LOCK_MODE_UNSPECIFIED = 0, - PESSIMISTIC = 1, - OPTIMISTIC = 2 - } - } - - /** Properties of a PartitionedDml. */ - interface IPartitionedDml { - } - - /** Represents a PartitionedDml. */ - class PartitionedDml implements IPartitionedDml { - - /** - * Constructs a new PartitionedDml. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.TransactionOptions.IPartitionedDml); - - /** - * Creates a new PartitionedDml instance using the specified properties. - * @param [properties] Properties to set - * @returns PartitionedDml instance - */ - public static create(properties?: google.spanner.v1.TransactionOptions.IPartitionedDml): google.spanner.v1.TransactionOptions.PartitionedDml; - - /** - * Encodes the specified PartitionedDml message. Does not implicitly {@link google.spanner.v1.TransactionOptions.PartitionedDml.verify|verify} messages. - * @param message PartitionedDml message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.TransactionOptions.IPartitionedDml, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PartitionedDml message, length delimited. Does not implicitly {@link google.spanner.v1.TransactionOptions.PartitionedDml.verify|verify} messages. - * @param message PartitionedDml message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.TransactionOptions.IPartitionedDml, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PartitionedDml message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PartitionedDml - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.TransactionOptions.PartitionedDml; - - /** - * Decodes a PartitionedDml message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PartitionedDml - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.TransactionOptions.PartitionedDml; - - /** - * Verifies a PartitionedDml message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PartitionedDml message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PartitionedDml - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.TransactionOptions.PartitionedDml; - - /** - * Creates a plain object from a PartitionedDml message. Also converts values to other types if specified. - * @param message PartitionedDml - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.TransactionOptions.PartitionedDml, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PartitionedDml to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PartitionedDml - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ReadOnly. */ - interface IReadOnly { - - /** ReadOnly strong */ - strong?: (boolean|null); - - /** ReadOnly minReadTimestamp */ - minReadTimestamp?: (google.protobuf.ITimestamp|null); - - /** ReadOnly maxStaleness */ - maxStaleness?: (google.protobuf.IDuration|null); - - /** ReadOnly readTimestamp */ - readTimestamp?: (google.protobuf.ITimestamp|null); - - /** ReadOnly exactStaleness */ - exactStaleness?: (google.protobuf.IDuration|null); - - /** ReadOnly returnReadTimestamp */ - returnReadTimestamp?: (boolean|null); - } - - /** Represents a ReadOnly. */ - class ReadOnly implements IReadOnly { - - /** - * Constructs a new ReadOnly. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.TransactionOptions.IReadOnly); - - /** ReadOnly strong. */ - public strong?: (boolean|null); - - /** ReadOnly minReadTimestamp. */ - public minReadTimestamp?: (google.protobuf.ITimestamp|null); - - /** ReadOnly maxStaleness. */ - public maxStaleness?: (google.protobuf.IDuration|null); - - /** ReadOnly readTimestamp. */ - public readTimestamp?: (google.protobuf.ITimestamp|null); - - /** ReadOnly exactStaleness. */ - public exactStaleness?: (google.protobuf.IDuration|null); - - /** ReadOnly returnReadTimestamp. */ - public returnReadTimestamp: boolean; - - /** ReadOnly timestampBound. */ - public timestampBound?: ("strong"|"minReadTimestamp"|"maxStaleness"|"readTimestamp"|"exactStaleness"); - - /** - * Creates a new ReadOnly instance using the specified properties. - * @param [properties] Properties to set - * @returns ReadOnly instance - */ - public static create(properties?: google.spanner.v1.TransactionOptions.IReadOnly): google.spanner.v1.TransactionOptions.ReadOnly; - - /** - * Encodes the specified ReadOnly message. Does not implicitly {@link google.spanner.v1.TransactionOptions.ReadOnly.verify|verify} messages. - * @param message ReadOnly message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.TransactionOptions.IReadOnly, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ReadOnly message, length delimited. Does not implicitly {@link google.spanner.v1.TransactionOptions.ReadOnly.verify|verify} messages. - * @param message ReadOnly message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.TransactionOptions.IReadOnly, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ReadOnly message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ReadOnly - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.TransactionOptions.ReadOnly; - - /** - * Decodes a ReadOnly message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ReadOnly - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.TransactionOptions.ReadOnly; - - /** - * Verifies a ReadOnly message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ReadOnly message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ReadOnly - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.TransactionOptions.ReadOnly; - - /** - * Creates a plain object from a ReadOnly message. Also converts values to other types if specified. - * @param message ReadOnly - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.TransactionOptions.ReadOnly, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ReadOnly to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ReadOnly - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** IsolationLevel enum. */ - enum IsolationLevel { - ISOLATION_LEVEL_UNSPECIFIED = 0, - SERIALIZABLE = 1, - REPEATABLE_READ = 2 - } - } - - /** Properties of a Transaction. */ - interface ITransaction { - - /** Transaction id */ - id?: (Uint8Array|Buffer|string|null); - - /** Transaction readTimestamp */ - readTimestamp?: (google.protobuf.ITimestamp|null); - - /** Transaction precommitToken */ - precommitToken?: (google.spanner.v1.IMultiplexedSessionPrecommitToken|null); - } - - /** Represents a Transaction. */ - class Transaction implements ITransaction { - - /** - * Constructs a new Transaction. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.ITransaction); - - /** Transaction id. */ - public id: (Uint8Array|Buffer|string); - - /** Transaction readTimestamp. */ - public readTimestamp?: (google.protobuf.ITimestamp|null); - - /** Transaction precommitToken. */ - public precommitToken?: (google.spanner.v1.IMultiplexedSessionPrecommitToken|null); - - /** - * Creates a new Transaction instance using the specified properties. - * @param [properties] Properties to set - * @returns Transaction instance - */ - public static create(properties?: google.spanner.v1.ITransaction): google.spanner.v1.Transaction; - - /** - * Encodes the specified Transaction message. Does not implicitly {@link google.spanner.v1.Transaction.verify|verify} messages. - * @param message Transaction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.ITransaction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Transaction message, length delimited. Does not implicitly {@link google.spanner.v1.Transaction.verify|verify} messages. - * @param message Transaction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.ITransaction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Transaction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Transaction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.Transaction; - - /** - * Decodes a Transaction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Transaction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.Transaction; - - /** - * Verifies a Transaction message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Transaction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Transaction - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.Transaction; - - /** - * Creates a plain object from a Transaction message. Also converts values to other types if specified. - * @param message Transaction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.Transaction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Transaction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Transaction - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a TransactionSelector. */ - interface ITransactionSelector { - - /** TransactionSelector singleUse */ - singleUse?: (google.spanner.v1.ITransactionOptions|null); - - /** TransactionSelector id */ - id?: (Uint8Array|Buffer|string|null); - - /** TransactionSelector begin */ - begin?: (google.spanner.v1.ITransactionOptions|null); - } - - /** Represents a TransactionSelector. */ - class TransactionSelector implements ITransactionSelector { - - /** - * Constructs a new TransactionSelector. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.ITransactionSelector); - - /** TransactionSelector singleUse. */ - public singleUse?: (google.spanner.v1.ITransactionOptions|null); - - /** TransactionSelector id. */ - public id?: (Uint8Array|Buffer|string|null); - - /** TransactionSelector begin. */ - public begin?: (google.spanner.v1.ITransactionOptions|null); - - /** TransactionSelector selector. */ - public selector?: ("singleUse"|"id"|"begin"); - - /** - * Creates a new TransactionSelector instance using the specified properties. - * @param [properties] Properties to set - * @returns TransactionSelector instance - */ - public static create(properties?: google.spanner.v1.ITransactionSelector): google.spanner.v1.TransactionSelector; - - /** - * Encodes the specified TransactionSelector message. Does not implicitly {@link google.spanner.v1.TransactionSelector.verify|verify} messages. - * @param message TransactionSelector message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.ITransactionSelector, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TransactionSelector message, length delimited. Does not implicitly {@link google.spanner.v1.TransactionSelector.verify|verify} messages. - * @param message TransactionSelector message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.ITransactionSelector, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TransactionSelector message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TransactionSelector - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.TransactionSelector; - - /** - * Decodes a TransactionSelector message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TransactionSelector - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.TransactionSelector; - - /** - * Verifies a TransactionSelector message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TransactionSelector message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TransactionSelector - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.TransactionSelector; - - /** - * Creates a plain object from a TransactionSelector message. Also converts values to other types if specified. - * @param message TransactionSelector - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.TransactionSelector, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TransactionSelector to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TransactionSelector - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a MultiplexedSessionPrecommitToken. */ - interface IMultiplexedSessionPrecommitToken { - - /** MultiplexedSessionPrecommitToken precommitToken */ - precommitToken?: (Uint8Array|Buffer|string|null); - - /** MultiplexedSessionPrecommitToken seqNum */ - seqNum?: (number|null); - } - - /** Represents a MultiplexedSessionPrecommitToken. */ - class MultiplexedSessionPrecommitToken implements IMultiplexedSessionPrecommitToken { - - /** - * Constructs a new MultiplexedSessionPrecommitToken. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.IMultiplexedSessionPrecommitToken); - - /** MultiplexedSessionPrecommitToken precommitToken. */ - public precommitToken: (Uint8Array|Buffer|string); - - /** MultiplexedSessionPrecommitToken seqNum. */ - public seqNum: number; - - /** - * Creates a new MultiplexedSessionPrecommitToken instance using the specified properties. - * @param [properties] Properties to set - * @returns MultiplexedSessionPrecommitToken instance - */ - public static create(properties?: google.spanner.v1.IMultiplexedSessionPrecommitToken): google.spanner.v1.MultiplexedSessionPrecommitToken; - - /** - * Encodes the specified MultiplexedSessionPrecommitToken message. Does not implicitly {@link google.spanner.v1.MultiplexedSessionPrecommitToken.verify|verify} messages. - * @param message MultiplexedSessionPrecommitToken message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.IMultiplexedSessionPrecommitToken, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MultiplexedSessionPrecommitToken message, length delimited. Does not implicitly {@link google.spanner.v1.MultiplexedSessionPrecommitToken.verify|verify} messages. - * @param message MultiplexedSessionPrecommitToken message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.IMultiplexedSessionPrecommitToken, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MultiplexedSessionPrecommitToken message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MultiplexedSessionPrecommitToken - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.MultiplexedSessionPrecommitToken; - - /** - * Decodes a MultiplexedSessionPrecommitToken message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MultiplexedSessionPrecommitToken - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.MultiplexedSessionPrecommitToken; - - /** - * Verifies a MultiplexedSessionPrecommitToken message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MultiplexedSessionPrecommitToken message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MultiplexedSessionPrecommitToken - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.MultiplexedSessionPrecommitToken; - - /** - * Creates a plain object from a MultiplexedSessionPrecommitToken message. Also converts values to other types if specified. - * @param message MultiplexedSessionPrecommitToken - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.MultiplexedSessionPrecommitToken, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MultiplexedSessionPrecommitToken to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MultiplexedSessionPrecommitToken - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a KeyRange. */ - interface IKeyRange { - - /** KeyRange startClosed */ - startClosed?: (google.protobuf.IListValue|null); - - /** KeyRange startOpen */ - startOpen?: (google.protobuf.IListValue|null); - - /** KeyRange endClosed */ - endClosed?: (google.protobuf.IListValue|null); - - /** KeyRange endOpen */ - endOpen?: (google.protobuf.IListValue|null); - } - - /** Represents a KeyRange. */ - class KeyRange implements IKeyRange { - - /** - * Constructs a new KeyRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.IKeyRange); - - /** KeyRange startClosed. */ - public startClosed?: (google.protobuf.IListValue|null); - - /** KeyRange startOpen. */ - public startOpen?: (google.protobuf.IListValue|null); - - /** KeyRange endClosed. */ - public endClosed?: (google.protobuf.IListValue|null); - - /** KeyRange endOpen. */ - public endOpen?: (google.protobuf.IListValue|null); - - /** KeyRange startKeyType. */ - public startKeyType?: ("startClosed"|"startOpen"); - - /** KeyRange endKeyType. */ - public endKeyType?: ("endClosed"|"endOpen"); - - /** - * Creates a new KeyRange instance using the specified properties. - * @param [properties] Properties to set - * @returns KeyRange instance - */ - public static create(properties?: google.spanner.v1.IKeyRange): google.spanner.v1.KeyRange; - - /** - * Encodes the specified KeyRange message. Does not implicitly {@link google.spanner.v1.KeyRange.verify|verify} messages. - * @param message KeyRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.IKeyRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified KeyRange message, length delimited. Does not implicitly {@link google.spanner.v1.KeyRange.verify|verify} messages. - * @param message KeyRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.IKeyRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a KeyRange message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns KeyRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.KeyRange; - - /** - * Decodes a KeyRange message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns KeyRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.KeyRange; - - /** - * Verifies a KeyRange message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a KeyRange message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns KeyRange - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.KeyRange; - - /** - * Creates a plain object from a KeyRange message. Also converts values to other types if specified. - * @param message KeyRange - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.KeyRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this KeyRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for KeyRange - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a KeySet. */ - interface IKeySet { - - /** KeySet keys */ - keys?: (google.protobuf.IListValue[]|null); - - /** KeySet ranges */ - ranges?: (google.spanner.v1.IKeyRange[]|null); - - /** KeySet all */ - all?: (boolean|null); - } - - /** Represents a KeySet. */ - class KeySet implements IKeySet { - - /** - * Constructs a new KeySet. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.IKeySet); - - /** KeySet keys. */ - public keys: google.protobuf.IListValue[]; - - /** KeySet ranges. */ - public ranges: google.spanner.v1.IKeyRange[]; - - /** KeySet all. */ - public all: boolean; - - /** - * Creates a new KeySet instance using the specified properties. - * @param [properties] Properties to set - * @returns KeySet instance - */ - public static create(properties?: google.spanner.v1.IKeySet): google.spanner.v1.KeySet; - - /** - * Encodes the specified KeySet message. Does not implicitly {@link google.spanner.v1.KeySet.verify|verify} messages. - * @param message KeySet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.IKeySet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified KeySet message, length delimited. Does not implicitly {@link google.spanner.v1.KeySet.verify|verify} messages. - * @param message KeySet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.IKeySet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a KeySet message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns KeySet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.KeySet; - - /** - * Decodes a KeySet message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns KeySet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.KeySet; - - /** - * Verifies a KeySet message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a KeySet message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns KeySet - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.KeySet; - - /** - * Creates a plain object from a KeySet message. Also converts values to other types if specified. - * @param message KeySet - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.KeySet, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this KeySet to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for KeySet - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Range. */ - interface IRange { - - /** Range startKey */ - startKey?: (Uint8Array|Buffer|string|null); - - /** Range limitKey */ - limitKey?: (Uint8Array|Buffer|string|null); - - /** Range groupUid */ - groupUid?: (number|Long|string|null); - - /** Range splitId */ - splitId?: (number|Long|string|null); - - /** Range generation */ - generation?: (Uint8Array|Buffer|string|null); - } - - /** Represents a Range. */ - class Range implements IRange { - - /** - * Constructs a new Range. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.IRange); - - /** Range startKey. */ - public startKey: (Uint8Array|Buffer|string); - - /** Range limitKey. */ - public limitKey: (Uint8Array|Buffer|string); - - /** Range groupUid. */ - public groupUid: (number|Long|string); - - /** Range splitId. */ - public splitId: (number|Long|string); - - /** Range generation. */ - public generation: (Uint8Array|Buffer|string); - - /** - * Creates a new Range instance using the specified properties. - * @param [properties] Properties to set - * @returns Range instance - */ - public static create(properties?: google.spanner.v1.IRange): google.spanner.v1.Range; - - /** - * Encodes the specified Range message. Does not implicitly {@link google.spanner.v1.Range.verify|verify} messages. - * @param message Range message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.IRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Range message, length delimited. Does not implicitly {@link google.spanner.v1.Range.verify|verify} messages. - * @param message Range message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.IRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Range message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Range - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.Range; - - /** - * Decodes a Range message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Range - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.Range; - - /** - * Verifies a Range message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Range message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Range - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.Range; - - /** - * Creates a plain object from a Range message. Also converts values to other types if specified. - * @param message Range - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.Range, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Range to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Range - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Tablet. */ - interface ITablet { - - /** Tablet tabletUid */ - tabletUid?: (number|Long|string|null); - - /** Tablet serverAddress */ - serverAddress?: (string|null); - - /** Tablet location */ - location?: (string|null); - - /** Tablet role */ - role?: (google.spanner.v1.Tablet.Role|keyof typeof google.spanner.v1.Tablet.Role|null); - - /** Tablet incarnation */ - incarnation?: (Uint8Array|Buffer|string|null); - - /** Tablet distance */ - distance?: (number|null); - - /** Tablet skip */ - skip?: (boolean|null); - } - - /** Represents a Tablet. */ - class Tablet implements ITablet { - - /** - * Constructs a new Tablet. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.ITablet); - - /** Tablet tabletUid. */ - public tabletUid: (number|Long|string); - - /** Tablet serverAddress. */ - public serverAddress: string; - - /** Tablet location. */ - public location: string; - - /** Tablet role. */ - public role: (google.spanner.v1.Tablet.Role|keyof typeof google.spanner.v1.Tablet.Role); - - /** Tablet incarnation. */ - public incarnation: (Uint8Array|Buffer|string); - - /** Tablet distance. */ - public distance: number; - - /** Tablet skip. */ - public skip: boolean; - - /** - * Creates a new Tablet instance using the specified properties. - * @param [properties] Properties to set - * @returns Tablet instance - */ - public static create(properties?: google.spanner.v1.ITablet): google.spanner.v1.Tablet; - - /** - * Encodes the specified Tablet message. Does not implicitly {@link google.spanner.v1.Tablet.verify|verify} messages. - * @param message Tablet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.ITablet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Tablet message, length delimited. Does not implicitly {@link google.spanner.v1.Tablet.verify|verify} messages. - * @param message Tablet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.ITablet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Tablet message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Tablet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.Tablet; - - /** - * Decodes a Tablet message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Tablet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.Tablet; - - /** - * Verifies a Tablet message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Tablet message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Tablet - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.Tablet; - - /** - * Creates a plain object from a Tablet message. Also converts values to other types if specified. - * @param message Tablet - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.Tablet, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Tablet to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Tablet - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Tablet { - - /** Role enum. */ - enum Role { - ROLE_UNSPECIFIED = 0, - READ_WRITE = 1, - READ_ONLY = 2 - } - } - - /** Properties of a Group. */ - interface IGroup { - - /** Group groupUid */ - groupUid?: (number|Long|string|null); - - /** Group tablets */ - tablets?: (google.spanner.v1.ITablet[]|null); - - /** Group leaderIndex */ - leaderIndex?: (number|null); - - /** Group generation */ - generation?: (Uint8Array|Buffer|string|null); - } - - /** Represents a Group. */ - class Group implements IGroup { - - /** - * Constructs a new Group. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.IGroup); - - /** Group groupUid. */ - public groupUid: (number|Long|string); - - /** Group tablets. */ - public tablets: google.spanner.v1.ITablet[]; - - /** Group leaderIndex. */ - public leaderIndex: number; - - /** Group generation. */ - public generation: (Uint8Array|Buffer|string); - - /** - * Creates a new Group instance using the specified properties. - * @param [properties] Properties to set - * @returns Group instance - */ - public static create(properties?: google.spanner.v1.IGroup): google.spanner.v1.Group; - - /** - * Encodes the specified Group message. Does not implicitly {@link google.spanner.v1.Group.verify|verify} messages. - * @param message Group message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.IGroup, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Group message, length delimited. Does not implicitly {@link google.spanner.v1.Group.verify|verify} messages. - * @param message Group message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.IGroup, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Group message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Group - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.Group; - - /** - * Decodes a Group message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Group - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.Group; - - /** - * Verifies a Group message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Group message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Group - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.Group; - - /** - * Creates a plain object from a Group message. Also converts values to other types if specified. - * @param message Group - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.Group, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Group to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Group - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a KeyRecipe. */ - interface IKeyRecipe { - - /** KeyRecipe tableName */ - tableName?: (string|null); - - /** KeyRecipe indexName */ - indexName?: (string|null); - - /** KeyRecipe operationUid */ - operationUid?: (number|Long|string|null); - - /** KeyRecipe part */ - part?: (google.spanner.v1.KeyRecipe.IPart[]|null); - } - - /** Represents a KeyRecipe. */ - class KeyRecipe implements IKeyRecipe { - - /** - * Constructs a new KeyRecipe. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.IKeyRecipe); - - /** KeyRecipe tableName. */ - public tableName?: (string|null); - - /** KeyRecipe indexName. */ - public indexName?: (string|null); - - /** KeyRecipe operationUid. */ - public operationUid?: (number|Long|string|null); - - /** KeyRecipe part. */ - public part: google.spanner.v1.KeyRecipe.IPart[]; - - /** KeyRecipe target. */ - public target?: ("tableName"|"indexName"|"operationUid"); - - /** - * Creates a new KeyRecipe instance using the specified properties. - * @param [properties] Properties to set - * @returns KeyRecipe instance - */ - public static create(properties?: google.spanner.v1.IKeyRecipe): google.spanner.v1.KeyRecipe; - - /** - * Encodes the specified KeyRecipe message. Does not implicitly {@link google.spanner.v1.KeyRecipe.verify|verify} messages. - * @param message KeyRecipe message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.IKeyRecipe, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified KeyRecipe message, length delimited. Does not implicitly {@link google.spanner.v1.KeyRecipe.verify|verify} messages. - * @param message KeyRecipe message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.IKeyRecipe, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a KeyRecipe message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns KeyRecipe - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.KeyRecipe; - - /** - * Decodes a KeyRecipe message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns KeyRecipe - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.KeyRecipe; - - /** - * Verifies a KeyRecipe message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a KeyRecipe message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns KeyRecipe - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.KeyRecipe; - - /** - * Creates a plain object from a KeyRecipe message. Also converts values to other types if specified. - * @param message KeyRecipe - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.KeyRecipe, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this KeyRecipe to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for KeyRecipe - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace KeyRecipe { - - /** Properties of a Part. */ - interface IPart { - - /** Part tag */ - tag?: (number|null); - - /** Part order */ - order?: (google.spanner.v1.KeyRecipe.Part.Order|keyof typeof google.spanner.v1.KeyRecipe.Part.Order|null); - - /** Part nullOrder */ - nullOrder?: (google.spanner.v1.KeyRecipe.Part.NullOrder|keyof typeof google.spanner.v1.KeyRecipe.Part.NullOrder|null); - - /** Part type */ - type?: (google.spanner.v1.IType|null); - - /** Part identifier */ - identifier?: (string|null); - - /** Part value */ - value?: (google.protobuf.IValue|null); - - /** Part random */ - random?: (boolean|null); - - /** Part structIdentifiers */ - structIdentifiers?: (number[]|null); - } - - /** Represents a Part. */ - class Part implements IPart { - - /** - * Constructs a new Part. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.KeyRecipe.IPart); - - /** Part tag. */ - public tag: number; - - /** Part order. */ - public order: (google.spanner.v1.KeyRecipe.Part.Order|keyof typeof google.spanner.v1.KeyRecipe.Part.Order); - - /** Part nullOrder. */ - public nullOrder: (google.spanner.v1.KeyRecipe.Part.NullOrder|keyof typeof google.spanner.v1.KeyRecipe.Part.NullOrder); - - /** Part type. */ - public type?: (google.spanner.v1.IType|null); - - /** Part identifier. */ - public identifier?: (string|null); - - /** Part value. */ - public value?: (google.protobuf.IValue|null); - - /** Part random. */ - public random?: (boolean|null); - - /** Part structIdentifiers. */ - public structIdentifiers: number[]; - - /** Part valueType. */ - public valueType?: ("identifier"|"value"|"random"); - - /** - * Creates a new Part instance using the specified properties. - * @param [properties] Properties to set - * @returns Part instance - */ - public static create(properties?: google.spanner.v1.KeyRecipe.IPart): google.spanner.v1.KeyRecipe.Part; - - /** - * Encodes the specified Part message. Does not implicitly {@link google.spanner.v1.KeyRecipe.Part.verify|verify} messages. - * @param message Part message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.KeyRecipe.IPart, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Part message, length delimited. Does not implicitly {@link google.spanner.v1.KeyRecipe.Part.verify|verify} messages. - * @param message Part message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.KeyRecipe.IPart, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Part message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Part - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.KeyRecipe.Part; - - /** - * Decodes a Part message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Part - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.KeyRecipe.Part; - - /** - * Verifies a Part message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Part message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Part - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.KeyRecipe.Part; - - /** - * Creates a plain object from a Part message. Also converts values to other types if specified. - * @param message Part - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.KeyRecipe.Part, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Part to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Part - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Part { - - /** Order enum. */ - enum Order { - ORDER_UNSPECIFIED = 0, - ASCENDING = 1, - DESCENDING = 2 - } - - /** NullOrder enum. */ - enum NullOrder { - NULL_ORDER_UNSPECIFIED = 0, - NULLS_FIRST = 1, - NULLS_LAST = 2, - NOT_NULL = 3 - } - } - } - - /** Properties of a RecipeList. */ - interface IRecipeList { - - /** RecipeList schemaGeneration */ - schemaGeneration?: (Uint8Array|Buffer|string|null); - - /** RecipeList recipe */ - recipe?: (google.spanner.v1.IKeyRecipe[]|null); - } - - /** Represents a RecipeList. */ - class RecipeList implements IRecipeList { - - /** - * Constructs a new RecipeList. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.IRecipeList); - - /** RecipeList schemaGeneration. */ - public schemaGeneration: (Uint8Array|Buffer|string); - - /** RecipeList recipe. */ - public recipe: google.spanner.v1.IKeyRecipe[]; - - /** - * Creates a new RecipeList instance using the specified properties. - * @param [properties] Properties to set - * @returns RecipeList instance - */ - public static create(properties?: google.spanner.v1.IRecipeList): google.spanner.v1.RecipeList; - - /** - * Encodes the specified RecipeList message. Does not implicitly {@link google.spanner.v1.RecipeList.verify|verify} messages. - * @param message RecipeList message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.IRecipeList, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RecipeList message, length delimited. Does not implicitly {@link google.spanner.v1.RecipeList.verify|verify} messages. - * @param message RecipeList message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.IRecipeList, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RecipeList message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RecipeList - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.RecipeList; - - /** - * Decodes a RecipeList message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RecipeList - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.RecipeList; - - /** - * Verifies a RecipeList message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RecipeList message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RecipeList - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.RecipeList; - - /** - * Creates a plain object from a RecipeList message. Also converts values to other types if specified. - * @param message RecipeList - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.RecipeList, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RecipeList to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RecipeList - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CacheUpdate. */ - interface ICacheUpdate { - - /** CacheUpdate databaseId */ - databaseId?: (number|Long|string|null); - - /** CacheUpdate range */ - range?: (google.spanner.v1.IRange[]|null); - - /** CacheUpdate group */ - group?: (google.spanner.v1.IGroup[]|null); - - /** CacheUpdate keyRecipes */ - keyRecipes?: (google.spanner.v1.IRecipeList|null); - } - - /** Represents a CacheUpdate. */ - class CacheUpdate implements ICacheUpdate { - - /** - * Constructs a new CacheUpdate. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.ICacheUpdate); - - /** CacheUpdate databaseId. */ - public databaseId: (number|Long|string); - - /** CacheUpdate range. */ - public range: google.spanner.v1.IRange[]; - - /** CacheUpdate group. */ - public group: google.spanner.v1.IGroup[]; - - /** CacheUpdate keyRecipes. */ - public keyRecipes?: (google.spanner.v1.IRecipeList|null); - - /** - * Creates a new CacheUpdate instance using the specified properties. - * @param [properties] Properties to set - * @returns CacheUpdate instance - */ - public static create(properties?: google.spanner.v1.ICacheUpdate): google.spanner.v1.CacheUpdate; - - /** - * Encodes the specified CacheUpdate message. Does not implicitly {@link google.spanner.v1.CacheUpdate.verify|verify} messages. - * @param message CacheUpdate message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.ICacheUpdate, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CacheUpdate message, length delimited. Does not implicitly {@link google.spanner.v1.CacheUpdate.verify|verify} messages. - * @param message CacheUpdate message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.ICacheUpdate, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CacheUpdate message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CacheUpdate - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.CacheUpdate; - - /** - * Decodes a CacheUpdate message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CacheUpdate - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.CacheUpdate; - - /** - * Verifies a CacheUpdate message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CacheUpdate message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CacheUpdate - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.CacheUpdate; - - /** - * Creates a plain object from a CacheUpdate message. Also converts values to other types if specified. - * @param message CacheUpdate - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.CacheUpdate, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CacheUpdate to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CacheUpdate - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RoutingHint. */ - interface IRoutingHint { - - /** RoutingHint operationUid */ - operationUid?: (number|Long|string|null); - - /** RoutingHint databaseId */ - databaseId?: (number|Long|string|null); - - /** RoutingHint schemaGeneration */ - schemaGeneration?: (Uint8Array|Buffer|string|null); - - /** RoutingHint key */ - key?: (Uint8Array|Buffer|string|null); - - /** RoutingHint limitKey */ - limitKey?: (Uint8Array|Buffer|string|null); - - /** RoutingHint groupUid */ - groupUid?: (number|Long|string|null); - - /** RoutingHint splitId */ - splitId?: (number|Long|string|null); - - /** RoutingHint tabletUid */ - tabletUid?: (number|Long|string|null); - - /** RoutingHint skippedTabletUid */ - skippedTabletUid?: (google.spanner.v1.RoutingHint.ISkippedTablet[]|null); - - /** RoutingHint clientLocation */ - clientLocation?: (string|null); - } - - /** Represents a RoutingHint. */ - class RoutingHint implements IRoutingHint { - - /** - * Constructs a new RoutingHint. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.IRoutingHint); - - /** RoutingHint operationUid. */ - public operationUid: (number|Long|string); - - /** RoutingHint databaseId. */ - public databaseId: (number|Long|string); - - /** RoutingHint schemaGeneration. */ - public schemaGeneration: (Uint8Array|Buffer|string); - - /** RoutingHint key. */ - public key: (Uint8Array|Buffer|string); - - /** RoutingHint limitKey. */ - public limitKey: (Uint8Array|Buffer|string); - - /** RoutingHint groupUid. */ - public groupUid: (number|Long|string); - - /** RoutingHint splitId. */ - public splitId: (number|Long|string); - - /** RoutingHint tabletUid. */ - public tabletUid: (number|Long|string); - - /** RoutingHint skippedTabletUid. */ - public skippedTabletUid: google.spanner.v1.RoutingHint.ISkippedTablet[]; - - /** RoutingHint clientLocation. */ - public clientLocation: string; - - /** - * Creates a new RoutingHint instance using the specified properties. - * @param [properties] Properties to set - * @returns RoutingHint instance - */ - public static create(properties?: google.spanner.v1.IRoutingHint): google.spanner.v1.RoutingHint; - - /** - * Encodes the specified RoutingHint message. Does not implicitly {@link google.spanner.v1.RoutingHint.verify|verify} messages. - * @param message RoutingHint message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.IRoutingHint, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RoutingHint message, length delimited. Does not implicitly {@link google.spanner.v1.RoutingHint.verify|verify} messages. - * @param message RoutingHint message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.IRoutingHint, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RoutingHint message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RoutingHint - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.RoutingHint; - - /** - * Decodes a RoutingHint message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RoutingHint - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.RoutingHint; - - /** - * Verifies a RoutingHint message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RoutingHint message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RoutingHint - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.RoutingHint; - - /** - * Creates a plain object from a RoutingHint message. Also converts values to other types if specified. - * @param message RoutingHint - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.RoutingHint, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RoutingHint to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RoutingHint - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace RoutingHint { - - /** Properties of a SkippedTablet. */ - interface ISkippedTablet { - - /** SkippedTablet tabletUid */ - tabletUid?: (number|Long|string|null); - - /** SkippedTablet incarnation */ - incarnation?: (Uint8Array|Buffer|string|null); - } - - /** Represents a SkippedTablet. */ - class SkippedTablet implements ISkippedTablet { - - /** - * Constructs a new SkippedTablet. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.RoutingHint.ISkippedTablet); - - /** SkippedTablet tabletUid. */ - public tabletUid: (number|Long|string); - - /** SkippedTablet incarnation. */ - public incarnation: (Uint8Array|Buffer|string); - - /** - * Creates a new SkippedTablet instance using the specified properties. - * @param [properties] Properties to set - * @returns SkippedTablet instance - */ - public static create(properties?: google.spanner.v1.RoutingHint.ISkippedTablet): google.spanner.v1.RoutingHint.SkippedTablet; - - /** - * Encodes the specified SkippedTablet message. Does not implicitly {@link google.spanner.v1.RoutingHint.SkippedTablet.verify|verify} messages. - * @param message SkippedTablet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.RoutingHint.ISkippedTablet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SkippedTablet message, length delimited. Does not implicitly {@link google.spanner.v1.RoutingHint.SkippedTablet.verify|verify} messages. - * @param message SkippedTablet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.RoutingHint.ISkippedTablet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SkippedTablet message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SkippedTablet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.RoutingHint.SkippedTablet; - - /** - * Decodes a SkippedTablet message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SkippedTablet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.RoutingHint.SkippedTablet; - - /** - * Verifies a SkippedTablet message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SkippedTablet message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SkippedTablet - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.RoutingHint.SkippedTablet; - - /** - * Creates a plain object from a SkippedTablet message. Also converts values to other types if specified. - * @param message SkippedTablet - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.RoutingHint.SkippedTablet, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SkippedTablet to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SkippedTablet - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a Type. */ - interface IType { - - /** Type code */ - code?: (google.spanner.v1.TypeCode|keyof typeof google.spanner.v1.TypeCode|null); - - /** Type arrayElementType */ - arrayElementType?: (google.spanner.v1.IType|null); - - /** Type structType */ - structType?: (google.spanner.v1.IStructType|null); - - /** Type typeAnnotation */ - typeAnnotation?: (google.spanner.v1.TypeAnnotationCode|keyof typeof google.spanner.v1.TypeAnnotationCode|null); - - /** Type protoTypeFqn */ - protoTypeFqn?: (string|null); - } - - /** Represents a Type. */ - class Type implements IType { - - /** - * Constructs a new Type. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.IType); - - /** Type code. */ - public code: (google.spanner.v1.TypeCode|keyof typeof google.spanner.v1.TypeCode); - - /** Type arrayElementType. */ - public arrayElementType?: (google.spanner.v1.IType|null); - - /** Type structType. */ - public structType?: (google.spanner.v1.IStructType|null); - - /** Type typeAnnotation. */ - public typeAnnotation: (google.spanner.v1.TypeAnnotationCode|keyof typeof google.spanner.v1.TypeAnnotationCode); - - /** Type protoTypeFqn. */ - public protoTypeFqn: string; - - /** - * Creates a new Type instance using the specified properties. - * @param [properties] Properties to set - * @returns Type instance - */ - public static create(properties?: google.spanner.v1.IType): google.spanner.v1.Type; - - /** - * Encodes the specified Type message. Does not implicitly {@link google.spanner.v1.Type.verify|verify} messages. - * @param message Type message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.IType, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Type message, length delimited. Does not implicitly {@link google.spanner.v1.Type.verify|verify} messages. - * @param message Type message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.IType, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Type message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Type - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.Type; - - /** - * Decodes a Type message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Type - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.Type; - - /** - * Verifies a Type message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Type message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Type - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.Type; - - /** - * Creates a plain object from a Type message. Also converts values to other types if specified. - * @param message Type - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.Type, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Type to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Type - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a StructType. */ - interface IStructType { - - /** StructType fields */ - fields?: (google.spanner.v1.StructType.IField[]|null); - } - - /** Represents a StructType. */ - class StructType implements IStructType { - - /** - * Constructs a new StructType. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.IStructType); - - /** StructType fields. */ - public fields: google.spanner.v1.StructType.IField[]; - - /** - * Creates a new StructType instance using the specified properties. - * @param [properties] Properties to set - * @returns StructType instance - */ - public static create(properties?: google.spanner.v1.IStructType): google.spanner.v1.StructType; - - /** - * Encodes the specified StructType message. Does not implicitly {@link google.spanner.v1.StructType.verify|verify} messages. - * @param message StructType message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.IStructType, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified StructType message, length delimited. Does not implicitly {@link google.spanner.v1.StructType.verify|verify} messages. - * @param message StructType message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.IStructType, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a StructType message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns StructType - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.StructType; - - /** - * Decodes a StructType message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns StructType - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.StructType; - - /** - * Verifies a StructType message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a StructType message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns StructType - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.StructType; - - /** - * Creates a plain object from a StructType message. Also converts values to other types if specified. - * @param message StructType - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.StructType, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this StructType to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for StructType - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace StructType { - - /** Properties of a Field. */ - interface IField { - - /** Field name */ - name?: (string|null); - - /** Field type */ - type?: (google.spanner.v1.IType|null); - } - - /** Represents a Field. */ - class Field implements IField { - - /** - * Constructs a new Field. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.StructType.IField); - - /** Field name. */ - public name: string; - - /** Field type. */ - public type?: (google.spanner.v1.IType|null); - - /** - * Creates a new Field instance using the specified properties. - * @param [properties] Properties to set - * @returns Field instance - */ - public static create(properties?: google.spanner.v1.StructType.IField): google.spanner.v1.StructType.Field; - - /** - * Encodes the specified Field message. Does not implicitly {@link google.spanner.v1.StructType.Field.verify|verify} messages. - * @param message Field message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.StructType.IField, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Field message, length delimited. Does not implicitly {@link google.spanner.v1.StructType.Field.verify|verify} messages. - * @param message Field message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.StructType.IField, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Field message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Field - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.StructType.Field; - - /** - * Decodes a Field message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Field - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.StructType.Field; - - /** - * Verifies a Field message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Field message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Field - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.StructType.Field; - - /** - * Creates a plain object from a Field message. Also converts values to other types if specified. - * @param message Field - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.StructType.Field, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Field to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Field - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** TypeCode enum. */ - enum TypeCode { - TYPE_CODE_UNSPECIFIED = 0, - BOOL = 1, - INT64 = 2, - FLOAT64 = 3, - FLOAT32 = 15, - TIMESTAMP = 4, - DATE = 5, - STRING = 6, - BYTES = 7, - ARRAY = 8, - STRUCT = 9, - NUMERIC = 10, - JSON = 11, - PROTO = 13, - ENUM = 14, - INTERVAL = 16, - UUID = 17 - } - - /** TypeAnnotationCode enum. */ - enum TypeAnnotationCode { - TYPE_ANNOTATION_CODE_UNSPECIFIED = 0, - PG_NUMERIC = 2, - PG_JSONB = 3, - PG_OID = 4 - } - - /** Properties of a Mutation. */ - interface IMutation { - - /** Mutation insert */ - insert?: (google.spanner.v1.Mutation.IWrite|null); - - /** Mutation update */ - update?: (google.spanner.v1.Mutation.IWrite|null); - - /** Mutation insertOrUpdate */ - insertOrUpdate?: (google.spanner.v1.Mutation.IWrite|null); - - /** Mutation replace */ - replace?: (google.spanner.v1.Mutation.IWrite|null); - - /** Mutation delete */ - "delete"?: (google.spanner.v1.Mutation.IDelete|null); - - /** Mutation send */ - send?: (google.spanner.v1.Mutation.ISend|null); - - /** Mutation ack */ - ack?: (google.spanner.v1.Mutation.IAck|null); - } - - /** Represents a Mutation. */ - class Mutation implements IMutation { - - /** - * Constructs a new Mutation. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.IMutation); - - /** Mutation insert. */ - public insert?: (google.spanner.v1.Mutation.IWrite|null); - - /** Mutation update. */ - public update?: (google.spanner.v1.Mutation.IWrite|null); - - /** Mutation insertOrUpdate. */ - public insertOrUpdate?: (google.spanner.v1.Mutation.IWrite|null); - - /** Mutation replace. */ - public replace?: (google.spanner.v1.Mutation.IWrite|null); - - /** Mutation delete. */ - public delete?: (google.spanner.v1.Mutation.IDelete|null); - - /** Mutation send. */ - public send?: (google.spanner.v1.Mutation.ISend|null); - - /** Mutation ack. */ - public ack?: (google.spanner.v1.Mutation.IAck|null); - - /** Mutation operation. */ - public operation?: ("insert"|"update"|"insertOrUpdate"|"replace"|"delete"|"send"|"ack"); - - /** - * Creates a new Mutation instance using the specified properties. - * @param [properties] Properties to set - * @returns Mutation instance - */ - public static create(properties?: google.spanner.v1.IMutation): google.spanner.v1.Mutation; - - /** - * Encodes the specified Mutation message. Does not implicitly {@link google.spanner.v1.Mutation.verify|verify} messages. - * @param message Mutation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.IMutation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Mutation message, length delimited. Does not implicitly {@link google.spanner.v1.Mutation.verify|verify} messages. - * @param message Mutation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.IMutation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Mutation message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Mutation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.Mutation; - - /** - * Decodes a Mutation message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Mutation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.Mutation; - - /** - * Verifies a Mutation message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Mutation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Mutation - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.Mutation; - - /** - * Creates a plain object from a Mutation message. Also converts values to other types if specified. - * @param message Mutation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.Mutation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Mutation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Mutation - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Mutation { - - /** Properties of a Write. */ - interface IWrite { - - /** Write table */ - table?: (string|null); - - /** Write columns */ - columns?: (string[]|null); - - /** Write values */ - values?: (google.protobuf.IListValue[]|null); - } - - /** Represents a Write. */ - class Write implements IWrite { - - /** - * Constructs a new Write. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.Mutation.IWrite); - - /** Write table. */ - public table: string; - - /** Write columns. */ - public columns: string[]; - - /** Write values. */ - public values: google.protobuf.IListValue[]; - - /** - * Creates a new Write instance using the specified properties. - * @param [properties] Properties to set - * @returns Write instance - */ - public static create(properties?: google.spanner.v1.Mutation.IWrite): google.spanner.v1.Mutation.Write; - - /** - * Encodes the specified Write message. Does not implicitly {@link google.spanner.v1.Mutation.Write.verify|verify} messages. - * @param message Write message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.Mutation.IWrite, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Write message, length delimited. Does not implicitly {@link google.spanner.v1.Mutation.Write.verify|verify} messages. - * @param message Write message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.Mutation.IWrite, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Write message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Write - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.Mutation.Write; - - /** - * Decodes a Write message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Write - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.Mutation.Write; - - /** - * Verifies a Write message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Write message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Write - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.Mutation.Write; - - /** - * Creates a plain object from a Write message. Also converts values to other types if specified. - * @param message Write - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.Mutation.Write, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Write to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Write - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Delete. */ - interface IDelete { - - /** Delete table */ - table?: (string|null); - - /** Delete keySet */ - keySet?: (google.spanner.v1.IKeySet|null); - } - - /** Represents a Delete. */ - class Delete implements IDelete { - - /** - * Constructs a new Delete. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.Mutation.IDelete); - - /** Delete table. */ - public table: string; - - /** Delete keySet. */ - public keySet?: (google.spanner.v1.IKeySet|null); - - /** - * Creates a new Delete instance using the specified properties. - * @param [properties] Properties to set - * @returns Delete instance - */ - public static create(properties?: google.spanner.v1.Mutation.IDelete): google.spanner.v1.Mutation.Delete; - - /** - * Encodes the specified Delete message. Does not implicitly {@link google.spanner.v1.Mutation.Delete.verify|verify} messages. - * @param message Delete message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.Mutation.IDelete, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Delete message, length delimited. Does not implicitly {@link google.spanner.v1.Mutation.Delete.verify|verify} messages. - * @param message Delete message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.Mutation.IDelete, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Delete message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Delete - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.Mutation.Delete; - - /** - * Decodes a Delete message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Delete - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.Mutation.Delete; - - /** - * Verifies a Delete message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Delete message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Delete - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.Mutation.Delete; - - /** - * Creates a plain object from a Delete message. Also converts values to other types if specified. - * @param message Delete - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.Mutation.Delete, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Delete to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Delete - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Send. */ - interface ISend { - - /** Send queue */ - queue?: (string|null); - - /** Send key */ - key?: (google.protobuf.IListValue|null); - - /** Send deliverTime */ - deliverTime?: (google.protobuf.ITimestamp|null); - - /** Send payload */ - payload?: (google.protobuf.IValue|null); - } - - /** Represents a Send. */ - class Send implements ISend { - - /** - * Constructs a new Send. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.Mutation.ISend); - - /** Send queue. */ - public queue: string; - - /** Send key. */ - public key?: (google.protobuf.IListValue|null); - - /** Send deliverTime. */ - public deliverTime?: (google.protobuf.ITimestamp|null); - - /** Send payload. */ - public payload?: (google.protobuf.IValue|null); - - /** - * Creates a new Send instance using the specified properties. - * @param [properties] Properties to set - * @returns Send instance - */ - public static create(properties?: google.spanner.v1.Mutation.ISend): google.spanner.v1.Mutation.Send; - - /** - * Encodes the specified Send message. Does not implicitly {@link google.spanner.v1.Mutation.Send.verify|verify} messages. - * @param message Send message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.Mutation.ISend, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Send message, length delimited. Does not implicitly {@link google.spanner.v1.Mutation.Send.verify|verify} messages. - * @param message Send message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.Mutation.ISend, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Send message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Send - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.Mutation.Send; - - /** - * Decodes a Send message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Send - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.Mutation.Send; - - /** - * Verifies a Send message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Send message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Send - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.Mutation.Send; - - /** - * Creates a plain object from a Send message. Also converts values to other types if specified. - * @param message Send - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.Mutation.Send, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Send to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Send - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an Ack. */ - interface IAck { - - /** Ack queue */ - queue?: (string|null); - - /** Ack key */ - key?: (google.protobuf.IListValue|null); - - /** Ack ignoreNotFound */ - ignoreNotFound?: (boolean|null); - } - - /** Represents an Ack. */ - class Ack implements IAck { - - /** - * Constructs a new Ack. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.Mutation.IAck); - - /** Ack queue. */ - public queue: string; - - /** Ack key. */ - public key?: (google.protobuf.IListValue|null); - - /** Ack ignoreNotFound. */ - public ignoreNotFound: boolean; - - /** - * Creates a new Ack instance using the specified properties. - * @param [properties] Properties to set - * @returns Ack instance - */ - public static create(properties?: google.spanner.v1.Mutation.IAck): google.spanner.v1.Mutation.Ack; - - /** - * Encodes the specified Ack message. Does not implicitly {@link google.spanner.v1.Mutation.Ack.verify|verify} messages. - * @param message Ack message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.Mutation.IAck, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Ack message, length delimited. Does not implicitly {@link google.spanner.v1.Mutation.Ack.verify|verify} messages. - * @param message Ack message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.Mutation.IAck, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Ack message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Ack - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.Mutation.Ack; - - /** - * Decodes an Ack message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Ack - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.Mutation.Ack; - - /** - * Verifies an Ack message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Ack message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Ack - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.Mutation.Ack; - - /** - * Creates a plain object from an Ack message. Also converts values to other types if specified. - * @param message Ack - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.Mutation.Ack, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Ack to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Ack - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a ResultSet. */ - interface IResultSet { - - /** ResultSet metadata */ - metadata?: (google.spanner.v1.IResultSetMetadata|null); - - /** ResultSet rows */ - rows?: (google.protobuf.IListValue[]|null); - - /** ResultSet stats */ - stats?: (google.spanner.v1.IResultSetStats|null); - - /** ResultSet precommitToken */ - precommitToken?: (google.spanner.v1.IMultiplexedSessionPrecommitToken|null); - - /** ResultSet cacheUpdate */ - cacheUpdate?: (google.spanner.v1.ICacheUpdate|null); - } - - /** Represents a ResultSet. */ - class ResultSet implements IResultSet { - - /** - * Constructs a new ResultSet. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.IResultSet); - - /** ResultSet metadata. */ - public metadata?: (google.spanner.v1.IResultSetMetadata|null); - - /** ResultSet rows. */ - public rows: google.protobuf.IListValue[]; - - /** ResultSet stats. */ - public stats?: (google.spanner.v1.IResultSetStats|null); - - /** ResultSet precommitToken. */ - public precommitToken?: (google.spanner.v1.IMultiplexedSessionPrecommitToken|null); - - /** ResultSet cacheUpdate. */ - public cacheUpdate?: (google.spanner.v1.ICacheUpdate|null); - - /** - * Creates a new ResultSet instance using the specified properties. - * @param [properties] Properties to set - * @returns ResultSet instance - */ - public static create(properties?: google.spanner.v1.IResultSet): google.spanner.v1.ResultSet; - - /** - * Encodes the specified ResultSet message. Does not implicitly {@link google.spanner.v1.ResultSet.verify|verify} messages. - * @param message ResultSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.IResultSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ResultSet message, length delimited. Does not implicitly {@link google.spanner.v1.ResultSet.verify|verify} messages. - * @param message ResultSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.IResultSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ResultSet message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ResultSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.ResultSet; - - /** - * Decodes a ResultSet message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ResultSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.ResultSet; - - /** - * Verifies a ResultSet message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ResultSet message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ResultSet - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.ResultSet; - - /** - * Creates a plain object from a ResultSet message. Also converts values to other types if specified. - * @param message ResultSet - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.ResultSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ResultSet to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ResultSet - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PartialResultSet. */ - interface IPartialResultSet { - - /** PartialResultSet metadata */ - metadata?: (google.spanner.v1.IResultSetMetadata|null); - - /** PartialResultSet values */ - values?: (google.protobuf.IValue[]|null); - - /** PartialResultSet chunkedValue */ - chunkedValue?: (boolean|null); - - /** PartialResultSet resumeToken */ - resumeToken?: (Uint8Array|Buffer|string|null); - - /** PartialResultSet stats */ - stats?: (google.spanner.v1.IResultSetStats|null); - - /** PartialResultSet precommitToken */ - precommitToken?: (google.spanner.v1.IMultiplexedSessionPrecommitToken|null); - - /** PartialResultSet last */ - last?: (boolean|null); - - /** PartialResultSet cacheUpdate */ - cacheUpdate?: (google.spanner.v1.ICacheUpdate|null); - } - - /** Represents a PartialResultSet. */ - class PartialResultSet implements IPartialResultSet { - - /** - * Constructs a new PartialResultSet. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.IPartialResultSet); - - /** PartialResultSet metadata. */ - public metadata?: (google.spanner.v1.IResultSetMetadata|null); - - /** PartialResultSet values. */ - public values: google.protobuf.IValue[]; - - /** PartialResultSet chunkedValue. */ - public chunkedValue: boolean; - - /** PartialResultSet resumeToken. */ - public resumeToken: (Uint8Array|Buffer|string); - - /** PartialResultSet stats. */ - public stats?: (google.spanner.v1.IResultSetStats|null); - - /** PartialResultSet precommitToken. */ - public precommitToken?: (google.spanner.v1.IMultiplexedSessionPrecommitToken|null); - - /** PartialResultSet last. */ - public last: boolean; - - /** PartialResultSet cacheUpdate. */ - public cacheUpdate?: (google.spanner.v1.ICacheUpdate|null); - - /** - * Creates a new PartialResultSet instance using the specified properties. - * @param [properties] Properties to set - * @returns PartialResultSet instance - */ - public static create(properties?: google.spanner.v1.IPartialResultSet): google.spanner.v1.PartialResultSet; - - /** - * Encodes the specified PartialResultSet message. Does not implicitly {@link google.spanner.v1.PartialResultSet.verify|verify} messages. - * @param message PartialResultSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.IPartialResultSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PartialResultSet message, length delimited. Does not implicitly {@link google.spanner.v1.PartialResultSet.verify|verify} messages. - * @param message PartialResultSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.IPartialResultSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PartialResultSet message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PartialResultSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.PartialResultSet; - - /** - * Decodes a PartialResultSet message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PartialResultSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.PartialResultSet; - - /** - * Verifies a PartialResultSet message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PartialResultSet message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PartialResultSet - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.PartialResultSet; - - /** - * Creates a plain object from a PartialResultSet message. Also converts values to other types if specified. - * @param message PartialResultSet - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.PartialResultSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PartialResultSet to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PartialResultSet - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ResultSetMetadata. */ - interface IResultSetMetadata { - - /** ResultSetMetadata rowType */ - rowType?: (google.spanner.v1.IStructType|null); - - /** ResultSetMetadata transaction */ - transaction?: (google.spanner.v1.ITransaction|null); - - /** ResultSetMetadata undeclaredParameters */ - undeclaredParameters?: (google.spanner.v1.IStructType|null); - } - - /** Represents a ResultSetMetadata. */ - class ResultSetMetadata implements IResultSetMetadata { - - /** - * Constructs a new ResultSetMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.IResultSetMetadata); - - /** ResultSetMetadata rowType. */ - public rowType?: (google.spanner.v1.IStructType|null); - - /** ResultSetMetadata transaction. */ - public transaction?: (google.spanner.v1.ITransaction|null); - - /** ResultSetMetadata undeclaredParameters. */ - public undeclaredParameters?: (google.spanner.v1.IStructType|null); - - /** - * Creates a new ResultSetMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns ResultSetMetadata instance - */ - public static create(properties?: google.spanner.v1.IResultSetMetadata): google.spanner.v1.ResultSetMetadata; - - /** - * Encodes the specified ResultSetMetadata message. Does not implicitly {@link google.spanner.v1.ResultSetMetadata.verify|verify} messages. - * @param message ResultSetMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.IResultSetMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ResultSetMetadata message, length delimited. Does not implicitly {@link google.spanner.v1.ResultSetMetadata.verify|verify} messages. - * @param message ResultSetMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.IResultSetMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ResultSetMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ResultSetMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.ResultSetMetadata; - - /** - * Decodes a ResultSetMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ResultSetMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.ResultSetMetadata; - - /** - * Verifies a ResultSetMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ResultSetMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ResultSetMetadata - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.ResultSetMetadata; - - /** - * Creates a plain object from a ResultSetMetadata message. Also converts values to other types if specified. - * @param message ResultSetMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.ResultSetMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ResultSetMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ResultSetMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ResultSetStats. */ - interface IResultSetStats { - - /** ResultSetStats queryPlan */ - queryPlan?: (google.spanner.v1.IQueryPlan|null); - - /** ResultSetStats queryStats */ - queryStats?: (google.protobuf.IStruct|null); - - /** ResultSetStats rowCountExact */ - rowCountExact?: (number|Long|string|null); - - /** ResultSetStats rowCountLowerBound */ - rowCountLowerBound?: (number|Long|string|null); - } - - /** Represents a ResultSetStats. */ - class ResultSetStats implements IResultSetStats { - - /** - * Constructs a new ResultSetStats. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.IResultSetStats); - - /** ResultSetStats queryPlan. */ - public queryPlan?: (google.spanner.v1.IQueryPlan|null); - - /** ResultSetStats queryStats. */ - public queryStats?: (google.protobuf.IStruct|null); - - /** ResultSetStats rowCountExact. */ - public rowCountExact?: (number|Long|string|null); - - /** ResultSetStats rowCountLowerBound. */ - public rowCountLowerBound?: (number|Long|string|null); - - /** ResultSetStats rowCount. */ - public rowCount?: ("rowCountExact"|"rowCountLowerBound"); - - /** - * Creates a new ResultSetStats instance using the specified properties. - * @param [properties] Properties to set - * @returns ResultSetStats instance - */ - public static create(properties?: google.spanner.v1.IResultSetStats): google.spanner.v1.ResultSetStats; - - /** - * Encodes the specified ResultSetStats message. Does not implicitly {@link google.spanner.v1.ResultSetStats.verify|verify} messages. - * @param message ResultSetStats message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.IResultSetStats, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ResultSetStats message, length delimited. Does not implicitly {@link google.spanner.v1.ResultSetStats.verify|verify} messages. - * @param message ResultSetStats message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.IResultSetStats, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ResultSetStats message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ResultSetStats - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.ResultSetStats; - - /** - * Decodes a ResultSetStats message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ResultSetStats - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.ResultSetStats; - - /** - * Verifies a ResultSetStats message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ResultSetStats message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ResultSetStats - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.ResultSetStats; - - /** - * Creates a plain object from a ResultSetStats message. Also converts values to other types if specified. - * @param message ResultSetStats - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.ResultSetStats, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ResultSetStats to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ResultSetStats - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PlanNode. */ - interface IPlanNode { - - /** PlanNode index */ - index?: (number|null); - - /** PlanNode kind */ - kind?: (google.spanner.v1.PlanNode.Kind|keyof typeof google.spanner.v1.PlanNode.Kind|null); - - /** PlanNode displayName */ - displayName?: (string|null); - - /** PlanNode childLinks */ - childLinks?: (google.spanner.v1.PlanNode.IChildLink[]|null); - - /** PlanNode shortRepresentation */ - shortRepresentation?: (google.spanner.v1.PlanNode.IShortRepresentation|null); - - /** PlanNode metadata */ - metadata?: (google.protobuf.IStruct|null); - - /** PlanNode executionStats */ - executionStats?: (google.protobuf.IStruct|null); - } - - /** Represents a PlanNode. */ - class PlanNode implements IPlanNode { - - /** - * Constructs a new PlanNode. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.IPlanNode); - - /** PlanNode index. */ - public index: number; - - /** PlanNode kind. */ - public kind: (google.spanner.v1.PlanNode.Kind|keyof typeof google.spanner.v1.PlanNode.Kind); - - /** PlanNode displayName. */ - public displayName: string; - - /** PlanNode childLinks. */ - public childLinks: google.spanner.v1.PlanNode.IChildLink[]; - - /** PlanNode shortRepresentation. */ - public shortRepresentation?: (google.spanner.v1.PlanNode.IShortRepresentation|null); - - /** PlanNode metadata. */ - public metadata?: (google.protobuf.IStruct|null); - - /** PlanNode executionStats. */ - public executionStats?: (google.protobuf.IStruct|null); - - /** - * Creates a new PlanNode instance using the specified properties. - * @param [properties] Properties to set - * @returns PlanNode instance - */ - public static create(properties?: google.spanner.v1.IPlanNode): google.spanner.v1.PlanNode; - - /** - * Encodes the specified PlanNode message. Does not implicitly {@link google.spanner.v1.PlanNode.verify|verify} messages. - * @param message PlanNode message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.IPlanNode, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PlanNode message, length delimited. Does not implicitly {@link google.spanner.v1.PlanNode.verify|verify} messages. - * @param message PlanNode message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.IPlanNode, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PlanNode message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PlanNode - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.PlanNode; - - /** - * Decodes a PlanNode message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PlanNode - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.PlanNode; - - /** - * Verifies a PlanNode message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PlanNode message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PlanNode - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.PlanNode; - - /** - * Creates a plain object from a PlanNode message. Also converts values to other types if specified. - * @param message PlanNode - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.PlanNode, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PlanNode to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PlanNode - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace PlanNode { - - /** Kind enum. */ - enum Kind { - KIND_UNSPECIFIED = 0, - RELATIONAL = 1, - SCALAR = 2 - } - - /** Properties of a ChildLink. */ - interface IChildLink { - - /** ChildLink childIndex */ - childIndex?: (number|null); - - /** ChildLink type */ - type?: (string|null); - - /** ChildLink variable */ - variable?: (string|null); - } - - /** Represents a ChildLink. */ - class ChildLink implements IChildLink { - - /** - * Constructs a new ChildLink. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.PlanNode.IChildLink); - - /** ChildLink childIndex. */ - public childIndex: number; - - /** ChildLink type. */ - public type: string; - - /** ChildLink variable. */ - public variable: string; - - /** - * Creates a new ChildLink instance using the specified properties. - * @param [properties] Properties to set - * @returns ChildLink instance - */ - public static create(properties?: google.spanner.v1.PlanNode.IChildLink): google.spanner.v1.PlanNode.ChildLink; - - /** - * Encodes the specified ChildLink message. Does not implicitly {@link google.spanner.v1.PlanNode.ChildLink.verify|verify} messages. - * @param message ChildLink message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.PlanNode.IChildLink, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ChildLink message, length delimited. Does not implicitly {@link google.spanner.v1.PlanNode.ChildLink.verify|verify} messages. - * @param message ChildLink message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.PlanNode.IChildLink, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ChildLink message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ChildLink - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.PlanNode.ChildLink; - - /** - * Decodes a ChildLink message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ChildLink - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.PlanNode.ChildLink; - - /** - * Verifies a ChildLink message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ChildLink message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ChildLink - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.PlanNode.ChildLink; - - /** - * Creates a plain object from a ChildLink message. Also converts values to other types if specified. - * @param message ChildLink - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.PlanNode.ChildLink, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ChildLink to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ChildLink - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ShortRepresentation. */ - interface IShortRepresentation { - - /** ShortRepresentation description */ - description?: (string|null); - - /** ShortRepresentation subqueries */ - subqueries?: ({ [k: string]: number }|null); - } - - /** Represents a ShortRepresentation. */ - class ShortRepresentation implements IShortRepresentation { - - /** - * Constructs a new ShortRepresentation. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.PlanNode.IShortRepresentation); - - /** ShortRepresentation description. */ - public description: string; - - /** ShortRepresentation subqueries. */ - public subqueries: { [k: string]: number }; - - /** - * Creates a new ShortRepresentation instance using the specified properties. - * @param [properties] Properties to set - * @returns ShortRepresentation instance - */ - public static create(properties?: google.spanner.v1.PlanNode.IShortRepresentation): google.spanner.v1.PlanNode.ShortRepresentation; - - /** - * Encodes the specified ShortRepresentation message. Does not implicitly {@link google.spanner.v1.PlanNode.ShortRepresentation.verify|verify} messages. - * @param message ShortRepresentation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.PlanNode.IShortRepresentation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ShortRepresentation message, length delimited. Does not implicitly {@link google.spanner.v1.PlanNode.ShortRepresentation.verify|verify} messages. - * @param message ShortRepresentation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.PlanNode.IShortRepresentation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ShortRepresentation message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ShortRepresentation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.PlanNode.ShortRepresentation; - - /** - * Decodes a ShortRepresentation message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ShortRepresentation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.PlanNode.ShortRepresentation; - - /** - * Verifies a ShortRepresentation message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ShortRepresentation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ShortRepresentation - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.PlanNode.ShortRepresentation; - - /** - * Creates a plain object from a ShortRepresentation message. Also converts values to other types if specified. - * @param message ShortRepresentation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.PlanNode.ShortRepresentation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ShortRepresentation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ShortRepresentation - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a QueryAdvisorResult. */ - interface IQueryAdvisorResult { - - /** QueryAdvisorResult indexAdvice */ - indexAdvice?: (google.spanner.v1.QueryAdvisorResult.IIndexAdvice[]|null); - } - - /** Represents a QueryAdvisorResult. */ - class QueryAdvisorResult implements IQueryAdvisorResult { - - /** - * Constructs a new QueryAdvisorResult. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.IQueryAdvisorResult); - - /** QueryAdvisorResult indexAdvice. */ - public indexAdvice: google.spanner.v1.QueryAdvisorResult.IIndexAdvice[]; - - /** - * Creates a new QueryAdvisorResult instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryAdvisorResult instance - */ - public static create(properties?: google.spanner.v1.IQueryAdvisorResult): google.spanner.v1.QueryAdvisorResult; - - /** - * Encodes the specified QueryAdvisorResult message. Does not implicitly {@link google.spanner.v1.QueryAdvisorResult.verify|verify} messages. - * @param message QueryAdvisorResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.IQueryAdvisorResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryAdvisorResult message, length delimited. Does not implicitly {@link google.spanner.v1.QueryAdvisorResult.verify|verify} messages. - * @param message QueryAdvisorResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.IQueryAdvisorResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryAdvisorResult message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryAdvisorResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.QueryAdvisorResult; - - /** - * Decodes a QueryAdvisorResult message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryAdvisorResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.QueryAdvisorResult; - - /** - * Verifies a QueryAdvisorResult message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryAdvisorResult message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryAdvisorResult - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.QueryAdvisorResult; - - /** - * Creates a plain object from a QueryAdvisorResult message. Also converts values to other types if specified. - * @param message QueryAdvisorResult - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.QueryAdvisorResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryAdvisorResult to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for QueryAdvisorResult - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace QueryAdvisorResult { - - /** Properties of an IndexAdvice. */ - interface IIndexAdvice { - - /** IndexAdvice ddl */ - ddl?: (string[]|null); - - /** IndexAdvice improvementFactor */ - improvementFactor?: (number|null); - } - - /** Represents an IndexAdvice. */ - class IndexAdvice implements IIndexAdvice { - - /** - * Constructs a new IndexAdvice. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.QueryAdvisorResult.IIndexAdvice); - - /** IndexAdvice ddl. */ - public ddl: string[]; - - /** IndexAdvice improvementFactor. */ - public improvementFactor: number; - - /** - * Creates a new IndexAdvice instance using the specified properties. - * @param [properties] Properties to set - * @returns IndexAdvice instance - */ - public static create(properties?: google.spanner.v1.QueryAdvisorResult.IIndexAdvice): google.spanner.v1.QueryAdvisorResult.IndexAdvice; - - /** - * Encodes the specified IndexAdvice message. Does not implicitly {@link google.spanner.v1.QueryAdvisorResult.IndexAdvice.verify|verify} messages. - * @param message IndexAdvice message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.QueryAdvisorResult.IIndexAdvice, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified IndexAdvice message, length delimited. Does not implicitly {@link google.spanner.v1.QueryAdvisorResult.IndexAdvice.verify|verify} messages. - * @param message IndexAdvice message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.QueryAdvisorResult.IIndexAdvice, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an IndexAdvice message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns IndexAdvice - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.QueryAdvisorResult.IndexAdvice; - - /** - * Decodes an IndexAdvice message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns IndexAdvice - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.QueryAdvisorResult.IndexAdvice; - - /** - * Verifies an IndexAdvice message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an IndexAdvice message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns IndexAdvice - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.QueryAdvisorResult.IndexAdvice; - - /** - * Creates a plain object from an IndexAdvice message. Also converts values to other types if specified. - * @param message IndexAdvice - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.QueryAdvisorResult.IndexAdvice, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this IndexAdvice to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for IndexAdvice - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a QueryPlan. */ - interface IQueryPlan { - - /** QueryPlan planNodes */ - planNodes?: (google.spanner.v1.IPlanNode[]|null); - - /** QueryPlan queryAdvice */ - queryAdvice?: (google.spanner.v1.IQueryAdvisorResult|null); - } - - /** Represents a QueryPlan. */ - class QueryPlan implements IQueryPlan { - - /** - * Constructs a new QueryPlan. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.IQueryPlan); - - /** QueryPlan planNodes. */ - public planNodes: google.spanner.v1.IPlanNode[]; - - /** QueryPlan queryAdvice. */ - public queryAdvice?: (google.spanner.v1.IQueryAdvisorResult|null); - - /** - * Creates a new QueryPlan instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryPlan instance - */ - public static create(properties?: google.spanner.v1.IQueryPlan): google.spanner.v1.QueryPlan; - - /** - * Encodes the specified QueryPlan message. Does not implicitly {@link google.spanner.v1.QueryPlan.verify|verify} messages. - * @param message QueryPlan message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.IQueryPlan, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryPlan message, length delimited. Does not implicitly {@link google.spanner.v1.QueryPlan.verify|verify} messages. - * @param message QueryPlan message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.IQueryPlan, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryPlan message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryPlan - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.QueryPlan; - - /** - * Decodes a QueryPlan message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryPlan - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.QueryPlan; - - /** - * Verifies a QueryPlan message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryPlan message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryPlan - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.QueryPlan; - - /** - * Creates a plain object from a QueryPlan message. Also converts values to other types if specified. - * @param message QueryPlan - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.QueryPlan, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryPlan to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for QueryPlan - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - } - - /** Namespace api. */ - namespace api { - - /** FieldBehavior enum. */ - enum FieldBehavior { - FIELD_BEHAVIOR_UNSPECIFIED = 0, - OPTIONAL = 1, - REQUIRED = 2, - OUTPUT_ONLY = 3, - INPUT_ONLY = 4, - IMMUTABLE = 5, - UNORDERED_LIST = 6, - NON_EMPTY_DEFAULT = 7, - IDENTIFIER = 8 - } - - /** Properties of a ResourceDescriptor. */ - interface IResourceDescriptor { - - /** ResourceDescriptor type */ - type?: (string|null); - - /** ResourceDescriptor pattern */ - pattern?: (string[]|null); - - /** ResourceDescriptor nameField */ - nameField?: (string|null); - - /** ResourceDescriptor history */ - history?: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History|null); - - /** ResourceDescriptor plural */ - plural?: (string|null); - - /** ResourceDescriptor singular */ - singular?: (string|null); - - /** ResourceDescriptor style */ - style?: (google.api.ResourceDescriptor.Style[]|null); - } - - /** Represents a ResourceDescriptor. */ - class ResourceDescriptor implements IResourceDescriptor { - - /** - * Constructs a new ResourceDescriptor. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IResourceDescriptor); - - /** ResourceDescriptor type. */ - public type: string; - - /** ResourceDescriptor pattern. */ - public pattern: string[]; - - /** ResourceDescriptor nameField. */ - public nameField: string; - - /** ResourceDescriptor history. */ - public history: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History); - - /** ResourceDescriptor plural. */ - public plural: string; - - /** ResourceDescriptor singular. */ - public singular: string; - - /** ResourceDescriptor style. */ - public style: google.api.ResourceDescriptor.Style[]; - - /** - * Creates a new ResourceDescriptor instance using the specified properties. - * @param [properties] Properties to set - * @returns ResourceDescriptor instance - */ - public static create(properties?: google.api.IResourceDescriptor): google.api.ResourceDescriptor; - - /** - * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. - * @param message ResourceDescriptor message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. - * @param message ResourceDescriptor message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ResourceDescriptor message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ResourceDescriptor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceDescriptor; - - /** - * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ResourceDescriptor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceDescriptor; - - /** - * Verifies a ResourceDescriptor message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ResourceDescriptor - */ - public static fromObject(object: { [k: string]: any }): google.api.ResourceDescriptor; - - /** - * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. - * @param message ResourceDescriptor - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.ResourceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ResourceDescriptor to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ResourceDescriptor - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ResourceDescriptor { - - /** History enum. */ - enum History { - HISTORY_UNSPECIFIED = 0, - ORIGINALLY_SINGLE_PATTERN = 1, - FUTURE_MULTI_PATTERN = 2 - } - - /** Style enum. */ - enum Style { - STYLE_UNSPECIFIED = 0, - DECLARATIVE_FRIENDLY = 1 - } - } - - /** Properties of a ResourceReference. */ - interface IResourceReference { - - /** ResourceReference type */ - type?: (string|null); - - /** ResourceReference childType */ - childType?: (string|null); - } - - /** Represents a ResourceReference. */ - class ResourceReference implements IResourceReference { - - /** - * Constructs a new ResourceReference. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IResourceReference); - - /** ResourceReference type. */ - public type: string; - - /** ResourceReference childType. */ - public childType: string; - - /** - * Creates a new ResourceReference instance using the specified properties. - * @param [properties] Properties to set - * @returns ResourceReference instance - */ - public static create(properties?: google.api.IResourceReference): google.api.ResourceReference; - - /** - * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. - * @param message ResourceReference message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. - * @param message ResourceReference message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ResourceReference message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ResourceReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceReference; - - /** - * Decodes a ResourceReference message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ResourceReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceReference; - - /** - * Verifies a ResourceReference message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ResourceReference - */ - public static fromObject(object: { [k: string]: any }): google.api.ResourceReference; - - /** - * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. - * @param message ResourceReference - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.ResourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ResourceReference to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ResourceReference - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Http. */ - interface IHttp { - - /** Http rules */ - rules?: (google.api.IHttpRule[]|null); - - /** Http fullyDecodeReservedExpansion */ - fullyDecodeReservedExpansion?: (boolean|null); - } - - /** Represents a Http. */ - class Http implements IHttp { - - /** - * Constructs a new Http. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IHttp); - - /** Http rules. */ - public rules: google.api.IHttpRule[]; - - /** Http fullyDecodeReservedExpansion. */ - public fullyDecodeReservedExpansion: boolean; - - /** - * Creates a new Http instance using the specified properties. - * @param [properties] Properties to set - * @returns Http instance - */ - public static create(properties?: google.api.IHttp): google.api.Http; - - /** - * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @param message Http message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @param message Http message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Http message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Http - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Http; - - /** - * Decodes a Http message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Http - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Http; - - /** - * Verifies a Http message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Http message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Http - */ - public static fromObject(object: { [k: string]: any }): google.api.Http; - - /** - * Creates a plain object from a Http message. Also converts values to other types if specified. - * @param message Http - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Http to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Http - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a HttpRule. */ - interface IHttpRule { - - /** HttpRule selector */ - selector?: (string|null); - - /** HttpRule get */ - get?: (string|null); - - /** HttpRule put */ - put?: (string|null); - - /** HttpRule post */ - post?: (string|null); - - /** HttpRule delete */ - "delete"?: (string|null); - - /** HttpRule patch */ - patch?: (string|null); - - /** HttpRule custom */ - custom?: (google.api.ICustomHttpPattern|null); - - /** HttpRule body */ - body?: (string|null); - - /** HttpRule responseBody */ - responseBody?: (string|null); - - /** HttpRule additionalBindings */ - additionalBindings?: (google.api.IHttpRule[]|null); - } - - /** Represents a HttpRule. */ - class HttpRule implements IHttpRule { - - /** - * Constructs a new HttpRule. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IHttpRule); - - /** HttpRule selector. */ - public selector: string; - - /** HttpRule get. */ - public get?: (string|null); - - /** HttpRule put. */ - public put?: (string|null); - - /** HttpRule post. */ - public post?: (string|null); - - /** HttpRule delete. */ - public delete?: (string|null); - - /** HttpRule patch. */ - public patch?: (string|null); - - /** HttpRule custom. */ - public custom?: (google.api.ICustomHttpPattern|null); - - /** HttpRule body. */ - public body: string; - - /** HttpRule responseBody. */ - public responseBody: string; - - /** HttpRule additionalBindings. */ - public additionalBindings: google.api.IHttpRule[]; - - /** HttpRule pattern. */ - public pattern?: ("get"|"put"|"post"|"delete"|"patch"|"custom"); - - /** - * Creates a new HttpRule instance using the specified properties. - * @param [properties] Properties to set - * @returns HttpRule instance - */ - public static create(properties?: google.api.IHttpRule): google.api.HttpRule; - - /** - * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @param message HttpRule message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @param message HttpRule message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a HttpRule message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns HttpRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.HttpRule; - - /** - * Decodes a HttpRule message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns HttpRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.HttpRule; - - /** - * Verifies a HttpRule message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns HttpRule - */ - public static fromObject(object: { [k: string]: any }): google.api.HttpRule; - - /** - * Creates a plain object from a HttpRule message. Also converts values to other types if specified. - * @param message HttpRule - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.HttpRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this HttpRule to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for HttpRule - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CustomHttpPattern. */ - interface ICustomHttpPattern { - - /** CustomHttpPattern kind */ - kind?: (string|null); - - /** CustomHttpPattern path */ - path?: (string|null); - } - - /** Represents a CustomHttpPattern. */ - class CustomHttpPattern implements ICustomHttpPattern { - - /** - * Constructs a new CustomHttpPattern. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.ICustomHttpPattern); - - /** CustomHttpPattern kind. */ - public kind: string; - - /** CustomHttpPattern path. */ - public path: string; - - /** - * Creates a new CustomHttpPattern instance using the specified properties. - * @param [properties] Properties to set - * @returns CustomHttpPattern instance - */ - public static create(properties?: google.api.ICustomHttpPattern): google.api.CustomHttpPattern; - - /** - * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. - * @param message CustomHttpPattern message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. - * @param message CustomHttpPattern message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CustomHttpPattern message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CustomHttpPattern - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CustomHttpPattern; - - /** - * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CustomHttpPattern - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CustomHttpPattern; - - /** - * Verifies a CustomHttpPattern message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CustomHttpPattern - */ - public static fromObject(object: { [k: string]: any }): google.api.CustomHttpPattern; - - /** - * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. - * @param message CustomHttpPattern - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.CustomHttpPattern, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CustomHttpPattern to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CustomHttpPattern - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CommonLanguageSettings. */ - interface ICommonLanguageSettings { - - /** CommonLanguageSettings referenceDocsUri */ - referenceDocsUri?: (string|null); - - /** CommonLanguageSettings destinations */ - destinations?: (google.api.ClientLibraryDestination[]|null); - } - - /** Represents a CommonLanguageSettings. */ - class CommonLanguageSettings implements ICommonLanguageSettings { - - /** - * Constructs a new CommonLanguageSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.ICommonLanguageSettings); - - /** CommonLanguageSettings referenceDocsUri. */ - public referenceDocsUri: string; - - /** CommonLanguageSettings destinations. */ - public destinations: google.api.ClientLibraryDestination[]; - - /** - * Creates a new CommonLanguageSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns CommonLanguageSettings instance - */ - public static create(properties?: google.api.ICommonLanguageSettings): google.api.CommonLanguageSettings; - - /** - * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. - * @param message CommonLanguageSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. - * @param message CommonLanguageSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CommonLanguageSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CommonLanguageSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CommonLanguageSettings; - - /** - * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CommonLanguageSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CommonLanguageSettings; - - /** - * Verifies a CommonLanguageSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CommonLanguageSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.CommonLanguageSettings; - - /** - * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. - * @param message CommonLanguageSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.CommonLanguageSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CommonLanguageSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CommonLanguageSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ClientLibrarySettings. */ - interface IClientLibrarySettings { - - /** ClientLibrarySettings version */ - version?: (string|null); - - /** ClientLibrarySettings launchStage */ - launchStage?: (google.api.LaunchStage|keyof typeof google.api.LaunchStage|null); - - /** ClientLibrarySettings restNumericEnums */ - restNumericEnums?: (boolean|null); - - /** ClientLibrarySettings javaSettings */ - javaSettings?: (google.api.IJavaSettings|null); - - /** ClientLibrarySettings cppSettings */ - cppSettings?: (google.api.ICppSettings|null); - - /** ClientLibrarySettings phpSettings */ - phpSettings?: (google.api.IPhpSettings|null); - - /** ClientLibrarySettings pythonSettings */ - pythonSettings?: (google.api.IPythonSettings|null); - - /** ClientLibrarySettings nodeSettings */ - nodeSettings?: (google.api.INodeSettings|null); - - /** ClientLibrarySettings dotnetSettings */ - dotnetSettings?: (google.api.IDotnetSettings|null); - - /** ClientLibrarySettings rubySettings */ - rubySettings?: (google.api.IRubySettings|null); - - /** ClientLibrarySettings goSettings */ - goSettings?: (google.api.IGoSettings|null); - } - - /** Represents a ClientLibrarySettings. */ - class ClientLibrarySettings implements IClientLibrarySettings { - - /** - * Constructs a new ClientLibrarySettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IClientLibrarySettings); - - /** ClientLibrarySettings version. */ - public version: string; - - /** ClientLibrarySettings launchStage. */ - public launchStage: (google.api.LaunchStage|keyof typeof google.api.LaunchStage); - - /** ClientLibrarySettings restNumericEnums. */ - public restNumericEnums: boolean; - - /** ClientLibrarySettings javaSettings. */ - public javaSettings?: (google.api.IJavaSettings|null); - - /** ClientLibrarySettings cppSettings. */ - public cppSettings?: (google.api.ICppSettings|null); - - /** ClientLibrarySettings phpSettings. */ - public phpSettings?: (google.api.IPhpSettings|null); - - /** ClientLibrarySettings pythonSettings. */ - public pythonSettings?: (google.api.IPythonSettings|null); - - /** ClientLibrarySettings nodeSettings. */ - public nodeSettings?: (google.api.INodeSettings|null); - - /** ClientLibrarySettings dotnetSettings. */ - public dotnetSettings?: (google.api.IDotnetSettings|null); - - /** ClientLibrarySettings rubySettings. */ - public rubySettings?: (google.api.IRubySettings|null); - - /** ClientLibrarySettings goSettings. */ - public goSettings?: (google.api.IGoSettings|null); - - /** - * Creates a new ClientLibrarySettings instance using the specified properties. - * @param [properties] Properties to set - * @returns ClientLibrarySettings instance - */ - public static create(properties?: google.api.IClientLibrarySettings): google.api.ClientLibrarySettings; - - /** - * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. - * @param message ClientLibrarySettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. - * @param message ClientLibrarySettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ClientLibrarySettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ClientLibrarySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ClientLibrarySettings; - - /** - * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ClientLibrarySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ClientLibrarySettings; - - /** - * Verifies a ClientLibrarySettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ClientLibrarySettings - */ - public static fromObject(object: { [k: string]: any }): google.api.ClientLibrarySettings; - - /** - * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. - * @param message ClientLibrarySettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.ClientLibrarySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ClientLibrarySettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ClientLibrarySettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Publishing. */ - interface IPublishing { - - /** Publishing methodSettings */ - methodSettings?: (google.api.IMethodSettings[]|null); - - /** Publishing newIssueUri */ - newIssueUri?: (string|null); - - /** Publishing documentationUri */ - documentationUri?: (string|null); - - /** Publishing apiShortName */ - apiShortName?: (string|null); - - /** Publishing githubLabel */ - githubLabel?: (string|null); - - /** Publishing codeownerGithubTeams */ - codeownerGithubTeams?: (string[]|null); - - /** Publishing docTagPrefix */ - docTagPrefix?: (string|null); - - /** Publishing organization */ - organization?: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization|null); - - /** Publishing librarySettings */ - librarySettings?: (google.api.IClientLibrarySettings[]|null); - - /** Publishing protoReferenceDocumentationUri */ - protoReferenceDocumentationUri?: (string|null); - - /** Publishing restReferenceDocumentationUri */ - restReferenceDocumentationUri?: (string|null); - } - - /** Represents a Publishing. */ - class Publishing implements IPublishing { - - /** - * Constructs a new Publishing. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IPublishing); - - /** Publishing methodSettings. */ - public methodSettings: google.api.IMethodSettings[]; - - /** Publishing newIssueUri. */ - public newIssueUri: string; - - /** Publishing documentationUri. */ - public documentationUri: string; - - /** Publishing apiShortName. */ - public apiShortName: string; - - /** Publishing githubLabel. */ - public githubLabel: string; - - /** Publishing codeownerGithubTeams. */ - public codeownerGithubTeams: string[]; - - /** Publishing docTagPrefix. */ - public docTagPrefix: string; - - /** Publishing organization. */ - public organization: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization); - - /** Publishing librarySettings. */ - public librarySettings: google.api.IClientLibrarySettings[]; - - /** Publishing protoReferenceDocumentationUri. */ - public protoReferenceDocumentationUri: string; - - /** Publishing restReferenceDocumentationUri. */ - public restReferenceDocumentationUri: string; - - /** - * Creates a new Publishing instance using the specified properties. - * @param [properties] Properties to set - * @returns Publishing instance - */ - public static create(properties?: google.api.IPublishing): google.api.Publishing; - - /** - * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. - * @param message Publishing message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. - * @param message Publishing message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Publishing message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Publishing - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Publishing; - - /** - * Decodes a Publishing message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Publishing - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Publishing; - - /** - * Verifies a Publishing message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Publishing message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Publishing - */ - public static fromObject(object: { [k: string]: any }): google.api.Publishing; - - /** - * Creates a plain object from a Publishing message. Also converts values to other types if specified. - * @param message Publishing - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.Publishing, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Publishing to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Publishing - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a JavaSettings. */ - interface IJavaSettings { - - /** JavaSettings libraryPackage */ - libraryPackage?: (string|null); - - /** JavaSettings serviceClassNames */ - serviceClassNames?: ({ [k: string]: string }|null); - - /** JavaSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a JavaSettings. */ - class JavaSettings implements IJavaSettings { - - /** - * Constructs a new JavaSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IJavaSettings); - - /** JavaSettings libraryPackage. */ - public libraryPackage: string; - - /** JavaSettings serviceClassNames. */ - public serviceClassNames: { [k: string]: string }; - - /** JavaSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new JavaSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns JavaSettings instance - */ - public static create(properties?: google.api.IJavaSettings): google.api.JavaSettings; - - /** - * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. - * @param message JavaSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. - * @param message JavaSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a JavaSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns JavaSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.JavaSettings; - - /** - * Decodes a JavaSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns JavaSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.JavaSettings; - - /** - * Verifies a JavaSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns JavaSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.JavaSettings; - - /** - * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. - * @param message JavaSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.JavaSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this JavaSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for JavaSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CppSettings. */ - interface ICppSettings { - - /** CppSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a CppSettings. */ - class CppSettings implements ICppSettings { - - /** - * Constructs a new CppSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.ICppSettings); - - /** CppSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new CppSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns CppSettings instance - */ - public static create(properties?: google.api.ICppSettings): google.api.CppSettings; - - /** - * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. - * @param message CppSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. - * @param message CppSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CppSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CppSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CppSettings; - - /** - * Decodes a CppSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CppSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CppSettings; - - /** - * Verifies a CppSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CppSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.CppSettings; - - /** - * Creates a plain object from a CppSettings message. Also converts values to other types if specified. - * @param message CppSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.CppSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CppSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CppSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PhpSettings. */ - interface IPhpSettings { - - /** PhpSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a PhpSettings. */ - class PhpSettings implements IPhpSettings { - - /** - * Constructs a new PhpSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IPhpSettings); - - /** PhpSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new PhpSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns PhpSettings instance - */ - public static create(properties?: google.api.IPhpSettings): google.api.PhpSettings; - - /** - * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. - * @param message PhpSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. - * @param message PhpSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PhpSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PhpSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PhpSettings; - - /** - * Decodes a PhpSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PhpSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PhpSettings; - - /** - * Verifies a PhpSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PhpSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.PhpSettings; - - /** - * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. - * @param message PhpSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.PhpSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PhpSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PhpSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PythonSettings. */ - interface IPythonSettings { - - /** PythonSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a PythonSettings. */ - class PythonSettings implements IPythonSettings { - - /** - * Constructs a new PythonSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IPythonSettings); - - /** PythonSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new PythonSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns PythonSettings instance - */ - public static create(properties?: google.api.IPythonSettings): google.api.PythonSettings; - - /** - * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. - * @param message PythonSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. - * @param message PythonSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PythonSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PythonSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PythonSettings; - - /** - * Decodes a PythonSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PythonSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PythonSettings; - - /** - * Verifies a PythonSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PythonSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.PythonSettings; - - /** - * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. - * @param message PythonSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.PythonSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PythonSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PythonSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a NodeSettings. */ - interface INodeSettings { - - /** NodeSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a NodeSettings. */ - class NodeSettings implements INodeSettings { - - /** - * Constructs a new NodeSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.INodeSettings); - - /** NodeSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new NodeSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns NodeSettings instance - */ - public static create(properties?: google.api.INodeSettings): google.api.NodeSettings; - - /** - * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. - * @param message NodeSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. - * @param message NodeSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a NodeSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns NodeSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.NodeSettings; - - /** - * Decodes a NodeSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns NodeSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.NodeSettings; - - /** - * Verifies a NodeSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns NodeSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.NodeSettings; - - /** - * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. - * @param message NodeSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.NodeSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this NodeSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for NodeSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DotnetSettings. */ - interface IDotnetSettings { - - /** DotnetSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - - /** DotnetSettings renamedServices */ - renamedServices?: ({ [k: string]: string }|null); - - /** DotnetSettings renamedResources */ - renamedResources?: ({ [k: string]: string }|null); - - /** DotnetSettings ignoredResources */ - ignoredResources?: (string[]|null); - - /** DotnetSettings forcedNamespaceAliases */ - forcedNamespaceAliases?: (string[]|null); - - /** DotnetSettings handwrittenSignatures */ - handwrittenSignatures?: (string[]|null); - } - - /** Represents a DotnetSettings. */ - class DotnetSettings implements IDotnetSettings { - - /** - * Constructs a new DotnetSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IDotnetSettings); - - /** DotnetSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** DotnetSettings renamedServices. */ - public renamedServices: { [k: string]: string }; - - /** DotnetSettings renamedResources. */ - public renamedResources: { [k: string]: string }; - - /** DotnetSettings ignoredResources. */ - public ignoredResources: string[]; - - /** DotnetSettings forcedNamespaceAliases. */ - public forcedNamespaceAliases: string[]; - - /** DotnetSettings handwrittenSignatures. */ - public handwrittenSignatures: string[]; - - /** - * Creates a new DotnetSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns DotnetSettings instance - */ - public static create(properties?: google.api.IDotnetSettings): google.api.DotnetSettings; - - /** - * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. - * @param message DotnetSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. - * @param message DotnetSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DotnetSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DotnetSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.DotnetSettings; - - /** - * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DotnetSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.DotnetSettings; - - /** - * Verifies a DotnetSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DotnetSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.DotnetSettings; - - /** - * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. - * @param message DotnetSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.DotnetSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DotnetSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DotnetSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RubySettings. */ - interface IRubySettings { - - /** RubySettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a RubySettings. */ - class RubySettings implements IRubySettings { - - /** - * Constructs a new RubySettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IRubySettings); - - /** RubySettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new RubySettings instance using the specified properties. - * @param [properties] Properties to set - * @returns RubySettings instance - */ - public static create(properties?: google.api.IRubySettings): google.api.RubySettings; - - /** - * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. - * @param message RubySettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. - * @param message RubySettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RubySettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RubySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.RubySettings; - - /** - * Decodes a RubySettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RubySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.RubySettings; - - /** - * Verifies a RubySettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RubySettings - */ - public static fromObject(object: { [k: string]: any }): google.api.RubySettings; - - /** - * Creates a plain object from a RubySettings message. Also converts values to other types if specified. - * @param message RubySettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.RubySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RubySettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RubySettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GoSettings. */ - interface IGoSettings { - - /** GoSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a GoSettings. */ - class GoSettings implements IGoSettings { - - /** - * Constructs a new GoSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IGoSettings); - - /** GoSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new GoSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns GoSettings instance - */ - public static create(properties?: google.api.IGoSettings): google.api.GoSettings; - - /** - * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. - * @param message GoSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. - * @param message GoSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GoSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GoSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.GoSettings; - - /** - * Decodes a GoSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GoSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.GoSettings; - - /** - * Verifies a GoSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GoSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.GoSettings; - - /** - * Creates a plain object from a GoSettings message. Also converts values to other types if specified. - * @param message GoSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.GoSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GoSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GoSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a MethodSettings. */ - interface IMethodSettings { - - /** MethodSettings selector */ - selector?: (string|null); - - /** MethodSettings longRunning */ - longRunning?: (google.api.MethodSettings.ILongRunning|null); - - /** MethodSettings autoPopulatedFields */ - autoPopulatedFields?: (string[]|null); - } - - /** Represents a MethodSettings. */ - class MethodSettings implements IMethodSettings { - - /** - * Constructs a new MethodSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IMethodSettings); - - /** MethodSettings selector. */ - public selector: string; - - /** MethodSettings longRunning. */ - public longRunning?: (google.api.MethodSettings.ILongRunning|null); - - /** MethodSettings autoPopulatedFields. */ - public autoPopulatedFields: string[]; - - /** - * Creates a new MethodSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns MethodSettings instance - */ - public static create(properties?: google.api.IMethodSettings): google.api.MethodSettings; - - /** - * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. - * @param message MethodSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. - * @param message MethodSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MethodSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MethodSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.MethodSettings; - - /** - * Decodes a MethodSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MethodSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.MethodSettings; - - /** - * Verifies a MethodSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MethodSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.MethodSettings; - - /** - * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. - * @param message MethodSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.MethodSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MethodSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MethodSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace MethodSettings { - - /** Properties of a LongRunning. */ - interface ILongRunning { - - /** LongRunning initialPollDelay */ - initialPollDelay?: (google.protobuf.IDuration|null); - - /** LongRunning pollDelayMultiplier */ - pollDelayMultiplier?: (number|null); - - /** LongRunning maxPollDelay */ - maxPollDelay?: (google.protobuf.IDuration|null); - - /** LongRunning totalPollTimeout */ - totalPollTimeout?: (google.protobuf.IDuration|null); - } - - /** Represents a LongRunning. */ - class LongRunning implements ILongRunning { - - /** - * Constructs a new LongRunning. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.MethodSettings.ILongRunning); - - /** LongRunning initialPollDelay. */ - public initialPollDelay?: (google.protobuf.IDuration|null); - - /** LongRunning pollDelayMultiplier. */ - public pollDelayMultiplier: number; - - /** LongRunning maxPollDelay. */ - public maxPollDelay?: (google.protobuf.IDuration|null); - - /** LongRunning totalPollTimeout. */ - public totalPollTimeout?: (google.protobuf.IDuration|null); - - /** - * Creates a new LongRunning instance using the specified properties. - * @param [properties] Properties to set - * @returns LongRunning instance - */ - public static create(properties?: google.api.MethodSettings.ILongRunning): google.api.MethodSettings.LongRunning; - - /** - * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. - * @param message LongRunning message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. - * @param message LongRunning message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a LongRunning message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns LongRunning - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.MethodSettings.LongRunning; - - /** - * Decodes a LongRunning message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns LongRunning - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.MethodSettings.LongRunning; - - /** - * Verifies a LongRunning message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LongRunning - */ - public static fromObject(object: { [k: string]: any }): google.api.MethodSettings.LongRunning; - - /** - * Creates a plain object from a LongRunning message. Also converts values to other types if specified. - * @param message LongRunning - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.MethodSettings.LongRunning, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this LongRunning to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for LongRunning - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** ClientLibraryOrganization enum. */ - enum ClientLibraryOrganization { - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0, - CLOUD = 1, - ADS = 2, - PHOTOS = 3, - STREET_VIEW = 4, - SHOPPING = 5, - GEO = 6, - GENERATIVE_AI = 7 - } - - /** ClientLibraryDestination enum. */ - enum ClientLibraryDestination { - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0, - GITHUB = 10, - PACKAGE_MANAGER = 20 - } - - /** LaunchStage enum. */ - enum LaunchStage { - LAUNCH_STAGE_UNSPECIFIED = 0, - UNIMPLEMENTED = 6, - PRELAUNCH = 7, - EARLY_ACCESS = 1, - ALPHA = 2, - BETA = 3, - GA = 4, - DEPRECATED = 5 - } - } - - /** Namespace protobuf. */ - namespace protobuf { - - /** Properties of a FileDescriptorSet. */ - interface IFileDescriptorSet { - - /** FileDescriptorSet file */ - file?: (google.protobuf.IFileDescriptorProto[]|null); - } - - /** Represents a FileDescriptorSet. */ - class FileDescriptorSet implements IFileDescriptorSet { - - /** - * Constructs a new FileDescriptorSet. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFileDescriptorSet); - - /** FileDescriptorSet file. */ - public file: google.protobuf.IFileDescriptorProto[]; - - /** - * Creates a new FileDescriptorSet instance using the specified properties. - * @param [properties] Properties to set - * @returns FileDescriptorSet instance - */ - public static create(properties?: google.protobuf.IFileDescriptorSet): google.protobuf.FileDescriptorSet; - - /** - * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. - * @param message FileDescriptorSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. - * @param message FileDescriptorSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FileDescriptorSet message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FileDescriptorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorSet; - - /** - * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FileDescriptorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorSet; - - /** - * Verifies a FileDescriptorSet message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FileDescriptorSet - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorSet; - - /** - * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. - * @param message FileDescriptorSet - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FileDescriptorSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FileDescriptorSet to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FileDescriptorSet - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Edition enum. */ - enum Edition { - EDITION_UNKNOWN = 0, - EDITION_PROTO2 = 998, - EDITION_PROTO3 = 999, - EDITION_2023 = 1000, - EDITION_2024 = 1001, - EDITION_1_TEST_ONLY = 1, - EDITION_2_TEST_ONLY = 2, - EDITION_99997_TEST_ONLY = 99997, - EDITION_99998_TEST_ONLY = 99998, - EDITION_99999_TEST_ONLY = 99999, - EDITION_MAX = 2147483647 - } - - /** Properties of a FileDescriptorProto. */ - interface IFileDescriptorProto { - - /** FileDescriptorProto name */ - name?: (string|null); - - /** FileDescriptorProto package */ - "package"?: (string|null); - - /** FileDescriptorProto dependency */ - dependency?: (string[]|null); - - /** FileDescriptorProto publicDependency */ - publicDependency?: (number[]|null); - - /** FileDescriptorProto weakDependency */ - weakDependency?: (number[]|null); - - /** FileDescriptorProto messageType */ - messageType?: (google.protobuf.IDescriptorProto[]|null); - - /** FileDescriptorProto enumType */ - enumType?: (google.protobuf.IEnumDescriptorProto[]|null); - - /** FileDescriptorProto service */ - service?: (google.protobuf.IServiceDescriptorProto[]|null); - - /** FileDescriptorProto extension */ - extension?: (google.protobuf.IFieldDescriptorProto[]|null); - - /** FileDescriptorProto options */ - options?: (google.protobuf.IFileOptions|null); - - /** FileDescriptorProto sourceCodeInfo */ - sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); - - /** FileDescriptorProto syntax */ - syntax?: (string|null); - - /** FileDescriptorProto edition */ - edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - } - - /** Represents a FileDescriptorProto. */ - class FileDescriptorProto implements IFileDescriptorProto { - - /** - * Constructs a new FileDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFileDescriptorProto); - - /** FileDescriptorProto name. */ - public name: string; - - /** FileDescriptorProto package. */ - public package: string; - - /** FileDescriptorProto dependency. */ - public dependency: string[]; - - /** FileDescriptorProto publicDependency. */ - public publicDependency: number[]; - - /** FileDescriptorProto weakDependency. */ - public weakDependency: number[]; - - /** FileDescriptorProto messageType. */ - public messageType: google.protobuf.IDescriptorProto[]; - - /** FileDescriptorProto enumType. */ - public enumType: google.protobuf.IEnumDescriptorProto[]; - - /** FileDescriptorProto service. */ - public service: google.protobuf.IServiceDescriptorProto[]; - - /** FileDescriptorProto extension. */ - public extension: google.protobuf.IFieldDescriptorProto[]; - - /** FileDescriptorProto options. */ - public options?: (google.protobuf.IFileOptions|null); - - /** FileDescriptorProto sourceCodeInfo. */ - public sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); - - /** FileDescriptorProto syntax. */ - public syntax: string; - - /** FileDescriptorProto edition. */ - public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** - * Creates a new FileDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns FileDescriptorProto instance - */ - public static create(properties?: google.protobuf.IFileDescriptorProto): google.protobuf.FileDescriptorProto; - - /** - * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @param message FileDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @param message FileDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorProto; - - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorProto; - - /** - * Verifies a FileDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FileDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorProto; - - /** - * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. - * @param message FileDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FileDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FileDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FileDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DescriptorProto. */ - interface IDescriptorProto { - - /** DescriptorProto name */ - name?: (string|null); - - /** DescriptorProto field */ - field?: (google.protobuf.IFieldDescriptorProto[]|null); - - /** DescriptorProto extension */ - extension?: (google.protobuf.IFieldDescriptorProto[]|null); - - /** DescriptorProto nestedType */ - nestedType?: (google.protobuf.IDescriptorProto[]|null); - - /** DescriptorProto enumType */ - enumType?: (google.protobuf.IEnumDescriptorProto[]|null); - - /** DescriptorProto extensionRange */ - extensionRange?: (google.protobuf.DescriptorProto.IExtensionRange[]|null); - - /** DescriptorProto oneofDecl */ - oneofDecl?: (google.protobuf.IOneofDescriptorProto[]|null); - - /** DescriptorProto options */ - options?: (google.protobuf.IMessageOptions|null); - - /** DescriptorProto reservedRange */ - reservedRange?: (google.protobuf.DescriptorProto.IReservedRange[]|null); - - /** DescriptorProto reservedName */ - reservedName?: (string[]|null); - } - - /** Represents a DescriptorProto. */ - class DescriptorProto implements IDescriptorProto { - - /** - * Constructs a new DescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IDescriptorProto); - - /** DescriptorProto name. */ - public name: string; - - /** DescriptorProto field. */ - public field: google.protobuf.IFieldDescriptorProto[]; - - /** DescriptorProto extension. */ - public extension: google.protobuf.IFieldDescriptorProto[]; - - /** DescriptorProto nestedType. */ - public nestedType: google.protobuf.IDescriptorProto[]; - - /** DescriptorProto enumType. */ - public enumType: google.protobuf.IEnumDescriptorProto[]; - - /** DescriptorProto extensionRange. */ - public extensionRange: google.protobuf.DescriptorProto.IExtensionRange[]; - - /** DescriptorProto oneofDecl. */ - public oneofDecl: google.protobuf.IOneofDescriptorProto[]; - - /** DescriptorProto options. */ - public options?: (google.protobuf.IMessageOptions|null); - - /** DescriptorProto reservedRange. */ - public reservedRange: google.protobuf.DescriptorProto.IReservedRange[]; - - /** DescriptorProto reservedName. */ - public reservedName: string[]; - - /** - * Creates a new DescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns DescriptorProto instance - */ - public static create(properties?: google.protobuf.IDescriptorProto): google.protobuf.DescriptorProto; - - /** - * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @param message DescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @param message DescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto; - - /** - * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto; - - /** - * Verifies a DescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto; - - /** - * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. - * @param message DescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.DescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace DescriptorProto { - - /** Properties of an ExtensionRange. */ - interface IExtensionRange { - - /** ExtensionRange start */ - start?: (number|null); - - /** ExtensionRange end */ - end?: (number|null); - - /** ExtensionRange options */ - options?: (google.protobuf.IExtensionRangeOptions|null); - } - - /** Represents an ExtensionRange. */ - class ExtensionRange implements IExtensionRange { - - /** - * Constructs a new ExtensionRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange); - - /** ExtensionRange start. */ - public start: number; - - /** ExtensionRange end. */ - public end: number; - - /** ExtensionRange options. */ - public options?: (google.protobuf.IExtensionRangeOptions|null); - - /** - * Creates a new ExtensionRange instance using the specified properties. - * @param [properties] Properties to set - * @returns ExtensionRange instance - */ - public static create(properties?: google.protobuf.DescriptorProto.IExtensionRange): google.protobuf.DescriptorProto.ExtensionRange; - - /** - * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @param message ExtensionRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @param message ExtensionRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExtensionRange message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ExtensionRange; - - /** - * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ExtensionRange; - - /** - * Verifies an ExtensionRange message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExtensionRange - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ExtensionRange; - - /** - * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. - * @param message ExtensionRange - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.DescriptorProto.ExtensionRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExtensionRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExtensionRange - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ReservedRange. */ - interface IReservedRange { - - /** ReservedRange start */ - start?: (number|null); - - /** ReservedRange end */ - end?: (number|null); - } - - /** Represents a ReservedRange. */ - class ReservedRange implements IReservedRange { - - /** - * Constructs a new ReservedRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.DescriptorProto.IReservedRange); - - /** ReservedRange start. */ - public start: number; - - /** ReservedRange end. */ - public end: number; - - /** - * Creates a new ReservedRange instance using the specified properties. - * @param [properties] Properties to set - * @returns ReservedRange instance - */ - public static create(properties?: google.protobuf.DescriptorProto.IReservedRange): google.protobuf.DescriptorProto.ReservedRange; - - /** - * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @param message ReservedRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @param message ReservedRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ReservedRange message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ReservedRange; - - /** - * Decodes a ReservedRange message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ReservedRange; - - /** - * Verifies a ReservedRange message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ReservedRange - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ReservedRange; - - /** - * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. - * @param message ReservedRange - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.DescriptorProto.ReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ReservedRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ReservedRange - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an ExtensionRangeOptions. */ - interface IExtensionRangeOptions { - - /** ExtensionRangeOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** ExtensionRangeOptions declaration */ - declaration?: (google.protobuf.ExtensionRangeOptions.IDeclaration[]|null); - - /** ExtensionRangeOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** ExtensionRangeOptions verification */ - verification?: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState|null); - } - - /** Represents an ExtensionRangeOptions. */ - class ExtensionRangeOptions implements IExtensionRangeOptions { - - /** - * Constructs a new ExtensionRangeOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IExtensionRangeOptions); - - /** ExtensionRangeOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** ExtensionRangeOptions declaration. */ - public declaration: google.protobuf.ExtensionRangeOptions.IDeclaration[]; - - /** ExtensionRangeOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** ExtensionRangeOptions verification. */ - public verification: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState); - - /** - * Creates a new ExtensionRangeOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns ExtensionRangeOptions instance - */ - public static create(properties?: google.protobuf.IExtensionRangeOptions): google.protobuf.ExtensionRangeOptions; - - /** - * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. - * @param message ExtensionRangeOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. - * @param message ExtensionRangeOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExtensionRangeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions; - - /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExtensionRangeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions; - - /** - * Verifies an ExtensionRangeOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExtensionRangeOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions; - - /** - * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. - * @param message ExtensionRangeOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ExtensionRangeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExtensionRangeOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExtensionRangeOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ExtensionRangeOptions { - - /** Properties of a Declaration. */ - interface IDeclaration { - - /** Declaration number */ - number?: (number|null); - - /** Declaration fullName */ - fullName?: (string|null); - - /** Declaration type */ - type?: (string|null); - - /** Declaration reserved */ - reserved?: (boolean|null); - - /** Declaration repeated */ - repeated?: (boolean|null); - } - - /** Represents a Declaration. */ - class Declaration implements IDeclaration { - - /** - * Constructs a new Declaration. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration); - - /** Declaration number. */ - public number: number; - - /** Declaration fullName. */ - public fullName: string; - - /** Declaration type. */ - public type: string; - - /** Declaration reserved. */ - public reserved: boolean; - - /** Declaration repeated. */ - public repeated: boolean; - - /** - * Creates a new Declaration instance using the specified properties. - * @param [properties] Properties to set - * @returns Declaration instance - */ - public static create(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration): google.protobuf.ExtensionRangeOptions.Declaration; - - /** - * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. - * @param message Declaration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. - * @param message Declaration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Declaration message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Declaration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions.Declaration; - - /** - * Decodes a Declaration message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Declaration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions.Declaration; - - /** - * Verifies a Declaration message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Declaration message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Declaration - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions.Declaration; - - /** - * Creates a plain object from a Declaration message. Also converts values to other types if specified. - * @param message Declaration - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ExtensionRangeOptions.Declaration, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Declaration to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Declaration - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** VerificationState enum. */ - enum VerificationState { - DECLARATION = 0, - UNVERIFIED = 1 - } - } - - /** Properties of a FieldDescriptorProto. */ - interface IFieldDescriptorProto { - - /** FieldDescriptorProto name */ - name?: (string|null); - - /** FieldDescriptorProto number */ - number?: (number|null); - - /** FieldDescriptorProto label */ - label?: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label|null); - - /** FieldDescriptorProto type */ - type?: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type|null); - - /** FieldDescriptorProto typeName */ - typeName?: (string|null); - - /** FieldDescriptorProto extendee */ - extendee?: (string|null); - - /** FieldDescriptorProto defaultValue */ - defaultValue?: (string|null); - - /** FieldDescriptorProto oneofIndex */ - oneofIndex?: (number|null); - - /** FieldDescriptorProto jsonName */ - jsonName?: (string|null); - - /** FieldDescriptorProto options */ - options?: (google.protobuf.IFieldOptions|null); - - /** FieldDescriptorProto proto3Optional */ - proto3Optional?: (boolean|null); - } - - /** Represents a FieldDescriptorProto. */ - class FieldDescriptorProto implements IFieldDescriptorProto { - - /** - * Constructs a new FieldDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFieldDescriptorProto); - - /** FieldDescriptorProto name. */ - public name: string; - - /** FieldDescriptorProto number. */ - public number: number; - - /** FieldDescriptorProto label. */ - public label: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label); - - /** FieldDescriptorProto type. */ - public type: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type); - - /** FieldDescriptorProto typeName. */ - public typeName: string; - - /** FieldDescriptorProto extendee. */ - public extendee: string; - - /** FieldDescriptorProto defaultValue. */ - public defaultValue: string; - - /** FieldDescriptorProto oneofIndex. */ - public oneofIndex: number; - - /** FieldDescriptorProto jsonName. */ - public jsonName: string; - - /** FieldDescriptorProto options. */ - public options?: (google.protobuf.IFieldOptions|null); - - /** FieldDescriptorProto proto3Optional. */ - public proto3Optional: boolean; - - /** - * Creates a new FieldDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns FieldDescriptorProto instance - */ - public static create(properties?: google.protobuf.IFieldDescriptorProto): google.protobuf.FieldDescriptorProto; - - /** - * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @param message FieldDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @param message FieldDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldDescriptorProto; - - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldDescriptorProto; - - /** - * Verifies a FieldDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FieldDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto; - - /** - * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. - * @param message FieldDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FieldDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FieldDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FieldDescriptorProto { - - /** Type enum. */ - enum Type { - TYPE_DOUBLE = 1, - TYPE_FLOAT = 2, - TYPE_INT64 = 3, - TYPE_UINT64 = 4, - TYPE_INT32 = 5, - TYPE_FIXED64 = 6, - TYPE_FIXED32 = 7, - TYPE_BOOL = 8, - TYPE_STRING = 9, - TYPE_GROUP = 10, - TYPE_MESSAGE = 11, - TYPE_BYTES = 12, - TYPE_UINT32 = 13, - TYPE_ENUM = 14, - TYPE_SFIXED32 = 15, - TYPE_SFIXED64 = 16, - TYPE_SINT32 = 17, - TYPE_SINT64 = 18 - } - - /** Label enum. */ - enum Label { - LABEL_OPTIONAL = 1, - LABEL_REPEATED = 3, - LABEL_REQUIRED = 2 - } - } - - /** Properties of an OneofDescriptorProto. */ - interface IOneofDescriptorProto { - - /** OneofDescriptorProto name */ - name?: (string|null); - - /** OneofDescriptorProto options */ - options?: (google.protobuf.IOneofOptions|null); - } - - /** Represents an OneofDescriptorProto. */ - class OneofDescriptorProto implements IOneofDescriptorProto { - - /** - * Constructs a new OneofDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IOneofDescriptorProto); - - /** OneofDescriptorProto name. */ - public name: string; - - /** OneofDescriptorProto options. */ - public options?: (google.protobuf.IOneofOptions|null); - - /** - * Creates a new OneofDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns OneofDescriptorProto instance - */ - public static create(properties?: google.protobuf.IOneofDescriptorProto): google.protobuf.OneofDescriptorProto; - - /** - * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @param message OneofDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @param message OneofDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofDescriptorProto; - - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofDescriptorProto; - - /** - * Verifies an OneofDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OneofDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.OneofDescriptorProto; - - /** - * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. - * @param message OneofDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.OneofDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OneofDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for OneofDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EnumDescriptorProto. */ - interface IEnumDescriptorProto { - - /** EnumDescriptorProto name */ - name?: (string|null); - - /** EnumDescriptorProto value */ - value?: (google.protobuf.IEnumValueDescriptorProto[]|null); - - /** EnumDescriptorProto options */ - options?: (google.protobuf.IEnumOptions|null); - - /** EnumDescriptorProto reservedRange */ - reservedRange?: (google.protobuf.EnumDescriptorProto.IEnumReservedRange[]|null); - - /** EnumDescriptorProto reservedName */ - reservedName?: (string[]|null); - } - - /** Represents an EnumDescriptorProto. */ - class EnumDescriptorProto implements IEnumDescriptorProto { - - /** - * Constructs a new EnumDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumDescriptorProto); - - /** EnumDescriptorProto name. */ - public name: string; - - /** EnumDescriptorProto value. */ - public value: google.protobuf.IEnumValueDescriptorProto[]; - - /** EnumDescriptorProto options. */ - public options?: (google.protobuf.IEnumOptions|null); - - /** EnumDescriptorProto reservedRange. */ - public reservedRange: google.protobuf.EnumDescriptorProto.IEnumReservedRange[]; - - /** EnumDescriptorProto reservedName. */ - public reservedName: string[]; - - /** - * Creates a new EnumDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumDescriptorProto instance - */ - public static create(properties?: google.protobuf.IEnumDescriptorProto): google.protobuf.EnumDescriptorProto; - - /** - * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @param message EnumDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @param message EnumDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto; - - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto; - - /** - * Verifies an EnumDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto; - - /** - * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. - * @param message EnumDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace EnumDescriptorProto { - - /** Properties of an EnumReservedRange. */ - interface IEnumReservedRange { - - /** EnumReservedRange start */ - start?: (number|null); - - /** EnumReservedRange end */ - end?: (number|null); - } - - /** Represents an EnumReservedRange. */ - class EnumReservedRange implements IEnumReservedRange { - - /** - * Constructs a new EnumReservedRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange); - - /** EnumReservedRange start. */ - public start: number; - - /** EnumReservedRange end. */ - public end: number; - - /** - * Creates a new EnumReservedRange instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumReservedRange instance - */ - public static create(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange): google.protobuf.EnumDescriptorProto.EnumReservedRange; - - /** - * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. - * @param message EnumReservedRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. - * @param message EnumReservedRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumReservedRange message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto.EnumReservedRange; - - /** - * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto.EnumReservedRange; - - /** - * Verifies an EnumReservedRange message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumReservedRange - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto.EnumReservedRange; - - /** - * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. - * @param message EnumReservedRange - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumDescriptorProto.EnumReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumReservedRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumReservedRange - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an EnumValueDescriptorProto. */ - interface IEnumValueDescriptorProto { - - /** EnumValueDescriptorProto name */ - name?: (string|null); - - /** EnumValueDescriptorProto number */ - number?: (number|null); - - /** EnumValueDescriptorProto options */ - options?: (google.protobuf.IEnumValueOptions|null); - } - - /** Represents an EnumValueDescriptorProto. */ - class EnumValueDescriptorProto implements IEnumValueDescriptorProto { - - /** - * Constructs a new EnumValueDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumValueDescriptorProto); - - /** EnumValueDescriptorProto name. */ - public name: string; - - /** EnumValueDescriptorProto number. */ - public number: number; - - /** EnumValueDescriptorProto options. */ - public options?: (google.protobuf.IEnumValueOptions|null); - - /** - * Creates a new EnumValueDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumValueDescriptorProto instance - */ - public static create(properties?: google.protobuf.IEnumValueDescriptorProto): google.protobuf.EnumValueDescriptorProto; - - /** - * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @param message EnumValueDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @param message EnumValueDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueDescriptorProto; - - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueDescriptorProto; - - /** - * Verifies an EnumValueDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumValueDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueDescriptorProto; - - /** - * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. - * @param message EnumValueDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumValueDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumValueDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumValueDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ServiceDescriptorProto. */ - interface IServiceDescriptorProto { - - /** ServiceDescriptorProto name */ - name?: (string|null); - - /** ServiceDescriptorProto method */ - method?: (google.protobuf.IMethodDescriptorProto[]|null); - - /** ServiceDescriptorProto options */ - options?: (google.protobuf.IServiceOptions|null); - } - - /** Represents a ServiceDescriptorProto. */ - class ServiceDescriptorProto implements IServiceDescriptorProto { - - /** - * Constructs a new ServiceDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IServiceDescriptorProto); - - /** ServiceDescriptorProto name. */ - public name: string; - - /** ServiceDescriptorProto method. */ - public method: google.protobuf.IMethodDescriptorProto[]; - - /** ServiceDescriptorProto options. */ - public options?: (google.protobuf.IServiceOptions|null); - - /** - * Creates a new ServiceDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns ServiceDescriptorProto instance - */ - public static create(properties?: google.protobuf.IServiceDescriptorProto): google.protobuf.ServiceDescriptorProto; - - /** - * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @param message ServiceDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @param message ServiceDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceDescriptorProto; - - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceDescriptorProto; - - /** - * Verifies a ServiceDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ServiceDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceDescriptorProto; - - /** - * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. - * @param message ServiceDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ServiceDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ServiceDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ServiceDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a MethodDescriptorProto. */ - interface IMethodDescriptorProto { - - /** MethodDescriptorProto name */ - name?: (string|null); - - /** MethodDescriptorProto inputType */ - inputType?: (string|null); - - /** MethodDescriptorProto outputType */ - outputType?: (string|null); - - /** MethodDescriptorProto options */ - options?: (google.protobuf.IMethodOptions|null); - - /** MethodDescriptorProto clientStreaming */ - clientStreaming?: (boolean|null); - - /** MethodDescriptorProto serverStreaming */ - serverStreaming?: (boolean|null); - } - - /** Represents a MethodDescriptorProto. */ - class MethodDescriptorProto implements IMethodDescriptorProto { - - /** - * Constructs a new MethodDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IMethodDescriptorProto); - - /** MethodDescriptorProto name. */ - public name: string; - - /** MethodDescriptorProto inputType. */ - public inputType: string; - - /** MethodDescriptorProto outputType. */ - public outputType: string; - - /** MethodDescriptorProto options. */ - public options?: (google.protobuf.IMethodOptions|null); - - /** MethodDescriptorProto clientStreaming. */ - public clientStreaming: boolean; - - /** MethodDescriptorProto serverStreaming. */ - public serverStreaming: boolean; - - /** - * Creates a new MethodDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns MethodDescriptorProto instance - */ - public static create(properties?: google.protobuf.IMethodDescriptorProto): google.protobuf.MethodDescriptorProto; - - /** - * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @param message MethodDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @param message MethodDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodDescriptorProto; - - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodDescriptorProto; - - /** - * Verifies a MethodDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MethodDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.MethodDescriptorProto; - - /** - * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. - * @param message MethodDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.MethodDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MethodDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MethodDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a FileOptions. */ - interface IFileOptions { - - /** FileOptions javaPackage */ - javaPackage?: (string|null); - - /** FileOptions javaOuterClassname */ - javaOuterClassname?: (string|null); - - /** FileOptions javaMultipleFiles */ - javaMultipleFiles?: (boolean|null); - - /** FileOptions javaGenerateEqualsAndHash */ - javaGenerateEqualsAndHash?: (boolean|null); - - /** FileOptions javaStringCheckUtf8 */ - javaStringCheckUtf8?: (boolean|null); - - /** FileOptions optimizeFor */ - optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode|null); - - /** FileOptions goPackage */ - goPackage?: (string|null); - - /** FileOptions ccGenericServices */ - ccGenericServices?: (boolean|null); - - /** FileOptions javaGenericServices */ - javaGenericServices?: (boolean|null); - - /** FileOptions pyGenericServices */ - pyGenericServices?: (boolean|null); - - /** FileOptions deprecated */ - deprecated?: (boolean|null); - - /** FileOptions ccEnableArenas */ - ccEnableArenas?: (boolean|null); - - /** FileOptions objcClassPrefix */ - objcClassPrefix?: (string|null); - - /** FileOptions csharpNamespace */ - csharpNamespace?: (string|null); - - /** FileOptions swiftPrefix */ - swiftPrefix?: (string|null); - - /** FileOptions phpClassPrefix */ - phpClassPrefix?: (string|null); - - /** FileOptions phpNamespace */ - phpNamespace?: (string|null); - - /** FileOptions phpMetadataNamespace */ - phpMetadataNamespace?: (string|null); - - /** FileOptions rubyPackage */ - rubyPackage?: (string|null); - - /** FileOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** FileOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** FileOptions .google.api.resourceDefinition */ - ".google.api.resourceDefinition"?: (google.api.IResourceDescriptor[]|null); - } - - /** Represents a FileOptions. */ - class FileOptions implements IFileOptions { - - /** - * Constructs a new FileOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFileOptions); - - /** FileOptions javaPackage. */ - public javaPackage: string; - - /** FileOptions javaOuterClassname. */ - public javaOuterClassname: string; - - /** FileOptions javaMultipleFiles. */ - public javaMultipleFiles: boolean; - - /** FileOptions javaGenerateEqualsAndHash. */ - public javaGenerateEqualsAndHash: boolean; - - /** FileOptions javaStringCheckUtf8. */ - public javaStringCheckUtf8: boolean; - - /** FileOptions optimizeFor. */ - public optimizeFor: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode); - - /** FileOptions goPackage. */ - public goPackage: string; - - /** FileOptions ccGenericServices. */ - public ccGenericServices: boolean; - - /** FileOptions javaGenericServices. */ - public javaGenericServices: boolean; - - /** FileOptions pyGenericServices. */ - public pyGenericServices: boolean; - - /** FileOptions deprecated. */ - public deprecated: boolean; - - /** FileOptions ccEnableArenas. */ - public ccEnableArenas: boolean; - - /** FileOptions objcClassPrefix. */ - public objcClassPrefix: string; - - /** FileOptions csharpNamespace. */ - public csharpNamespace: string; - - /** FileOptions swiftPrefix. */ - public swiftPrefix: string; - - /** FileOptions phpClassPrefix. */ - public phpClassPrefix: string; - - /** FileOptions phpNamespace. */ - public phpNamespace: string; - - /** FileOptions phpMetadataNamespace. */ - public phpMetadataNamespace: string; - - /** FileOptions rubyPackage. */ - public rubyPackage: string; - - /** FileOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** FileOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new FileOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns FileOptions instance - */ - public static create(properties?: google.protobuf.IFileOptions): google.protobuf.FileOptions; - - /** - * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @param message FileOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @param message FileOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FileOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileOptions; - - /** - * Decodes a FileOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileOptions; - - /** - * Verifies a FileOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FileOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FileOptions; - - /** - * Creates a plain object from a FileOptions message. Also converts values to other types if specified. - * @param message FileOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FileOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FileOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FileOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FileOptions { - - /** OptimizeMode enum. */ - enum OptimizeMode { - SPEED = 1, - CODE_SIZE = 2, - LITE_RUNTIME = 3 - } - } - - /** Properties of a MessageOptions. */ - interface IMessageOptions { - - /** MessageOptions messageSetWireFormat */ - messageSetWireFormat?: (boolean|null); - - /** MessageOptions noStandardDescriptorAccessor */ - noStandardDescriptorAccessor?: (boolean|null); - - /** MessageOptions deprecated */ - deprecated?: (boolean|null); - - /** MessageOptions mapEntry */ - mapEntry?: (boolean|null); - - /** MessageOptions deprecatedLegacyJsonFieldConflicts */ - deprecatedLegacyJsonFieldConflicts?: (boolean|null); - - /** MessageOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** MessageOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** MessageOptions .google.api.resource */ - ".google.api.resource"?: (google.api.IResourceDescriptor|null); - } - - /** Represents a MessageOptions. */ - class MessageOptions implements IMessageOptions { - - /** - * Constructs a new MessageOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IMessageOptions); - - /** MessageOptions messageSetWireFormat. */ - public messageSetWireFormat: boolean; - - /** MessageOptions noStandardDescriptorAccessor. */ - public noStandardDescriptorAccessor: boolean; - - /** MessageOptions deprecated. */ - public deprecated: boolean; - - /** MessageOptions mapEntry. */ - public mapEntry: boolean; - - /** MessageOptions deprecatedLegacyJsonFieldConflicts. */ - public deprecatedLegacyJsonFieldConflicts: boolean; - - /** MessageOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** MessageOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new MessageOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns MessageOptions instance - */ - public static create(properties?: google.protobuf.IMessageOptions): google.protobuf.MessageOptions; - - /** - * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @param message MessageOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @param message MessageOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MessageOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MessageOptions; - - /** - * Decodes a MessageOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MessageOptions; - - /** - * Verifies a MessageOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MessageOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.MessageOptions; - - /** - * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. - * @param message MessageOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.MessageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MessageOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MessageOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a FieldOptions. */ - interface IFieldOptions { - - /** FieldOptions ctype */ - ctype?: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType|null); - - /** FieldOptions packed */ - packed?: (boolean|null); - - /** FieldOptions jstype */ - jstype?: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType|null); - - /** FieldOptions lazy */ - lazy?: (boolean|null); - - /** FieldOptions unverifiedLazy */ - unverifiedLazy?: (boolean|null); - - /** FieldOptions deprecated */ - deprecated?: (boolean|null); - - /** FieldOptions weak */ - weak?: (boolean|null); - - /** FieldOptions debugRedact */ - debugRedact?: (boolean|null); - - /** FieldOptions retention */ - retention?: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention|null); - - /** FieldOptions targets */ - targets?: (google.protobuf.FieldOptions.OptionTargetType[]|null); - - /** FieldOptions editionDefaults */ - editionDefaults?: (google.protobuf.FieldOptions.IEditionDefault[]|null); - - /** FieldOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** FieldOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** FieldOptions .google.api.fieldBehavior */ - ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); - - /** FieldOptions .google.api.resourceReference */ - ".google.api.resourceReference"?: (google.api.IResourceReference|null); - } - - /** Represents a FieldOptions. */ - class FieldOptions implements IFieldOptions { - - /** - * Constructs a new FieldOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFieldOptions); - - /** FieldOptions ctype. */ - public ctype: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType); - - /** FieldOptions packed. */ - public packed: boolean; - - /** FieldOptions jstype. */ - public jstype: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType); - - /** FieldOptions lazy. */ - public lazy: boolean; - - /** FieldOptions unverifiedLazy. */ - public unverifiedLazy: boolean; - - /** FieldOptions deprecated. */ - public deprecated: boolean; - - /** FieldOptions weak. */ - public weak: boolean; - - /** FieldOptions debugRedact. */ - public debugRedact: boolean; - - /** FieldOptions retention. */ - public retention: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention); - - /** FieldOptions targets. */ - public targets: google.protobuf.FieldOptions.OptionTargetType[]; - - /** FieldOptions editionDefaults. */ - public editionDefaults: google.protobuf.FieldOptions.IEditionDefault[]; - - /** FieldOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** FieldOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new FieldOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns FieldOptions instance - */ - public static create(properties?: google.protobuf.IFieldOptions): google.protobuf.FieldOptions; - - /** - * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @param message FieldOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @param message FieldOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FieldOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions; - - /** - * Decodes a FieldOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions; - - /** - * Verifies a FieldOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FieldOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions; - - /** - * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. - * @param message FieldOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FieldOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FieldOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FieldOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FieldOptions { - - /** CType enum. */ - enum CType { - STRING = 0, - CORD = 1, - STRING_PIECE = 2 - } - - /** JSType enum. */ - enum JSType { - JS_NORMAL = 0, - JS_STRING = 1, - JS_NUMBER = 2 - } - - /** OptionRetention enum. */ - enum OptionRetention { - RETENTION_UNKNOWN = 0, - RETENTION_RUNTIME = 1, - RETENTION_SOURCE = 2 - } - - /** OptionTargetType enum. */ - enum OptionTargetType { - TARGET_TYPE_UNKNOWN = 0, - TARGET_TYPE_FILE = 1, - TARGET_TYPE_EXTENSION_RANGE = 2, - TARGET_TYPE_MESSAGE = 3, - TARGET_TYPE_FIELD = 4, - TARGET_TYPE_ONEOF = 5, - TARGET_TYPE_ENUM = 6, - TARGET_TYPE_ENUM_ENTRY = 7, - TARGET_TYPE_SERVICE = 8, - TARGET_TYPE_METHOD = 9 - } - - /** Properties of an EditionDefault. */ - interface IEditionDefault { - - /** EditionDefault edition */ - edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - - /** EditionDefault value */ - value?: (string|null); - } - - /** Represents an EditionDefault. */ - class EditionDefault implements IEditionDefault { - - /** - * Constructs a new EditionDefault. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.FieldOptions.IEditionDefault); - - /** EditionDefault edition. */ - public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** EditionDefault value. */ - public value: string; - - /** - * Creates a new EditionDefault instance using the specified properties. - * @param [properties] Properties to set - * @returns EditionDefault instance - */ - public static create(properties?: google.protobuf.FieldOptions.IEditionDefault): google.protobuf.FieldOptions.EditionDefault; - - /** - * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. - * @param message EditionDefault message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. - * @param message EditionDefault message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EditionDefault message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions.EditionDefault; - - /** - * Decodes an EditionDefault message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions.EditionDefault; - - /** - * Verifies an EditionDefault message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EditionDefault - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions.EditionDefault; - - /** - * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. - * @param message EditionDefault - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FieldOptions.EditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EditionDefault to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EditionDefault - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an OneofOptions. */ - interface IOneofOptions { - - /** OneofOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** OneofOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - } - - /** Represents an OneofOptions. */ - class OneofOptions implements IOneofOptions { - - /** - * Constructs a new OneofOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IOneofOptions); - - /** OneofOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** OneofOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new OneofOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns OneofOptions instance - */ - public static create(properties?: google.protobuf.IOneofOptions): google.protobuf.OneofOptions; - - /** - * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @param message OneofOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @param message OneofOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OneofOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofOptions; - - /** - * Decodes an OneofOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofOptions; - - /** - * Verifies an OneofOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OneofOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.OneofOptions; - - /** - * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. - * @param message OneofOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.OneofOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OneofOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for OneofOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EnumOptions. */ - interface IEnumOptions { - - /** EnumOptions allowAlias */ - allowAlias?: (boolean|null); - - /** EnumOptions deprecated */ - deprecated?: (boolean|null); - - /** EnumOptions deprecatedLegacyJsonFieldConflicts */ - deprecatedLegacyJsonFieldConflicts?: (boolean|null); - - /** EnumOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** EnumOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - } - - /** Represents an EnumOptions. */ - class EnumOptions implements IEnumOptions { - - /** - * Constructs a new EnumOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumOptions); - - /** EnumOptions allowAlias. */ - public allowAlias: boolean; - - /** EnumOptions deprecated. */ - public deprecated: boolean; - - /** EnumOptions deprecatedLegacyJsonFieldConflicts. */ - public deprecatedLegacyJsonFieldConflicts: boolean; - - /** EnumOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** EnumOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new EnumOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumOptions instance - */ - public static create(properties?: google.protobuf.IEnumOptions): google.protobuf.EnumOptions; - - /** - * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @param message EnumOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @param message EnumOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumOptions; - - /** - * Decodes an EnumOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumOptions; - - /** - * Verifies an EnumOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumOptions; - - /** - * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. - * @param message EnumOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EnumValueOptions. */ - interface IEnumValueOptions { - - /** EnumValueOptions deprecated */ - deprecated?: (boolean|null); - - /** EnumValueOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** EnumValueOptions debugRedact */ - debugRedact?: (boolean|null); - - /** EnumValueOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - } - - /** Represents an EnumValueOptions. */ - class EnumValueOptions implements IEnumValueOptions { - - /** - * Constructs a new EnumValueOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumValueOptions); - - /** EnumValueOptions deprecated. */ - public deprecated: boolean; - - /** EnumValueOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** EnumValueOptions debugRedact. */ - public debugRedact: boolean; - - /** EnumValueOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new EnumValueOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumValueOptions instance - */ - public static create(properties?: google.protobuf.IEnumValueOptions): google.protobuf.EnumValueOptions; - - /** - * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @param message EnumValueOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @param message EnumValueOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumValueOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumValueOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueOptions; - - /** - * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumValueOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueOptions; - - /** - * Verifies an EnumValueOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumValueOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueOptions; - - /** - * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. - * @param message EnumValueOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumValueOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumValueOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ServiceOptions. */ - interface IServiceOptions { - - /** ServiceOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** ServiceOptions deprecated */ - deprecated?: (boolean|null); - - /** ServiceOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** ServiceOptions .google.api.defaultHost */ - ".google.api.defaultHost"?: (string|null); - - /** ServiceOptions .google.api.oauthScopes */ - ".google.api.oauthScopes"?: (string|null); - - /** ServiceOptions .google.api.apiVersion */ - ".google.api.apiVersion"?: (string|null); - } - - /** Represents a ServiceOptions. */ - class ServiceOptions implements IServiceOptions { - - /** - * Constructs a new ServiceOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IServiceOptions); - - /** ServiceOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** ServiceOptions deprecated. */ - public deprecated: boolean; - - /** ServiceOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new ServiceOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns ServiceOptions instance - */ - public static create(properties?: google.protobuf.IServiceOptions): google.protobuf.ServiceOptions; - - /** - * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @param message ServiceOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @param message ServiceOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ServiceOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceOptions; - - /** - * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceOptions; - - /** - * Verifies a ServiceOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ServiceOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; - - /** - * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. - * @param message ServiceOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ServiceOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ServiceOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a MethodOptions. */ - interface IMethodOptions { - - /** MethodOptions deprecated */ - deprecated?: (boolean|null); - - /** MethodOptions idempotencyLevel */ - idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); - - /** MethodOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** MethodOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** MethodOptions .google.api.http */ - ".google.api.http"?: (google.api.IHttpRule|null); - - /** MethodOptions .google.api.methodSignature */ - ".google.api.methodSignature"?: (string[]|null); - - /** MethodOptions .google.longrunning.operationInfo */ - ".google.longrunning.operationInfo"?: (google.longrunning.IOperationInfo|null); - } - - /** Represents a MethodOptions. */ - class MethodOptions implements IMethodOptions { - - /** - * Constructs a new MethodOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IMethodOptions); - - /** MethodOptions deprecated. */ - public deprecated: boolean; - - /** MethodOptions idempotencyLevel. */ - public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); - - /** MethodOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** MethodOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new MethodOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns MethodOptions instance - */ - public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; - - /** - * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @param message MethodOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @param message MethodOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MethodOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MethodOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodOptions; - - /** - * Decodes a MethodOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MethodOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodOptions; - - /** - * Verifies a MethodOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MethodOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; - - /** - * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. - * @param message MethodOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MethodOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MethodOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace MethodOptions { - - /** IdempotencyLevel enum. */ - enum IdempotencyLevel { - IDEMPOTENCY_UNKNOWN = 0, - NO_SIDE_EFFECTS = 1, - IDEMPOTENT = 2 - } - } - - /** Properties of an UninterpretedOption. */ - interface IUninterpretedOption { - - /** UninterpretedOption name */ - name?: (google.protobuf.UninterpretedOption.INamePart[]|null); - - /** UninterpretedOption identifierValue */ - identifierValue?: (string|null); - - /** UninterpretedOption positiveIntValue */ - positiveIntValue?: (number|Long|string|null); - - /** UninterpretedOption negativeIntValue */ - negativeIntValue?: (number|Long|string|null); - - /** UninterpretedOption doubleValue */ - doubleValue?: (number|null); - - /** UninterpretedOption stringValue */ - stringValue?: (Uint8Array|Buffer|string|null); - - /** UninterpretedOption aggregateValue */ - aggregateValue?: (string|null); - } - - /** Represents an UninterpretedOption. */ - class UninterpretedOption implements IUninterpretedOption { - - /** - * Constructs a new UninterpretedOption. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IUninterpretedOption); - - /** UninterpretedOption name. */ - public name: google.protobuf.UninterpretedOption.INamePart[]; - - /** UninterpretedOption identifierValue. */ - public identifierValue: string; - - /** UninterpretedOption positiveIntValue. */ - public positiveIntValue: (number|Long|string); - - /** UninterpretedOption negativeIntValue. */ - public negativeIntValue: (number|Long|string); - - /** UninterpretedOption doubleValue. */ - public doubleValue: number; - - /** UninterpretedOption stringValue. */ - public stringValue: (Uint8Array|Buffer|string); - - /** UninterpretedOption aggregateValue. */ - public aggregateValue: string; - - /** - * Creates a new UninterpretedOption instance using the specified properties. - * @param [properties] Properties to set - * @returns UninterpretedOption instance - */ - public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; - - /** - * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @param message UninterpretedOption message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @param message UninterpretedOption message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption; - - /** - * Verifies an UninterpretedOption message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UninterpretedOption - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; - - /** - * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. - * @param message UninterpretedOption - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UninterpretedOption to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UninterpretedOption - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace UninterpretedOption { - - /** Properties of a NamePart. */ - interface INamePart { - - /** NamePart namePart */ - namePart: string; - - /** NamePart isExtension */ - isExtension: boolean; - } - - /** Represents a NamePart. */ - class NamePart implements INamePart { - - /** - * Constructs a new NamePart. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.UninterpretedOption.INamePart); - - /** NamePart namePart. */ - public namePart: string; - - /** NamePart isExtension. */ - public isExtension: boolean; - - /** - * Creates a new NamePart instance using the specified properties. - * @param [properties] Properties to set - * @returns NamePart instance - */ - public static create(properties?: google.protobuf.UninterpretedOption.INamePart): google.protobuf.UninterpretedOption.NamePart; - - /** - * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @param message NamePart message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @param message NamePart message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a NamePart message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption.NamePart; - - /** - * Decodes a NamePart message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption.NamePart; - - /** - * Verifies a NamePart message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a NamePart message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns NamePart - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; - - /** - * Creates a plain object from a NamePart message. Also converts values to other types if specified. - * @param message NamePart - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this NamePart to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for NamePart - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a FeatureSet. */ - interface IFeatureSet { - - /** FeatureSet fieldPresence */ - fieldPresence?: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence|null); - - /** FeatureSet enumType */ - enumType?: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType|null); - - /** FeatureSet repeatedFieldEncoding */ - repeatedFieldEncoding?: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding|null); - - /** FeatureSet utf8Validation */ - utf8Validation?: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation|null); - - /** FeatureSet messageEncoding */ - messageEncoding?: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding|null); - - /** FeatureSet jsonFormat */ - jsonFormat?: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat|null); - } - - /** Represents a FeatureSet. */ - class FeatureSet implements IFeatureSet { - - /** - * Constructs a new FeatureSet. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFeatureSet); - - /** FeatureSet fieldPresence. */ - public fieldPresence: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence); - - /** FeatureSet enumType. */ - public enumType: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType); - - /** FeatureSet repeatedFieldEncoding. */ - public repeatedFieldEncoding: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding); - - /** FeatureSet utf8Validation. */ - public utf8Validation: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation); - - /** FeatureSet messageEncoding. */ - public messageEncoding: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding); - - /** FeatureSet jsonFormat. */ - public jsonFormat: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat); - - /** - * Creates a new FeatureSet instance using the specified properties. - * @param [properties] Properties to set - * @returns FeatureSet instance - */ - public static create(properties?: google.protobuf.IFeatureSet): google.protobuf.FeatureSet; - - /** - * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. - * @param message FeatureSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. - * @param message FeatureSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FeatureSet message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FeatureSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSet; - - /** - * Decodes a FeatureSet message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FeatureSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSet; - - /** - * Verifies a FeatureSet message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FeatureSet - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSet; - - /** - * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. - * @param message FeatureSet - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FeatureSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FeatureSet to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FeatureSet - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FeatureSet { - - /** FieldPresence enum. */ - enum FieldPresence { - FIELD_PRESENCE_UNKNOWN = 0, - EXPLICIT = 1, - IMPLICIT = 2, - LEGACY_REQUIRED = 3 - } - - /** EnumType enum. */ - enum EnumType { - ENUM_TYPE_UNKNOWN = 0, - OPEN = 1, - CLOSED = 2 - } - - /** RepeatedFieldEncoding enum. */ - enum RepeatedFieldEncoding { - REPEATED_FIELD_ENCODING_UNKNOWN = 0, - PACKED = 1, - EXPANDED = 2 - } - - /** Utf8Validation enum. */ - enum Utf8Validation { - UTF8_VALIDATION_UNKNOWN = 0, - VERIFY = 2, - NONE = 3 - } - - /** MessageEncoding enum. */ - enum MessageEncoding { - MESSAGE_ENCODING_UNKNOWN = 0, - LENGTH_PREFIXED = 1, - DELIMITED = 2 - } - - /** JsonFormat enum. */ - enum JsonFormat { - JSON_FORMAT_UNKNOWN = 0, - ALLOW = 1, - LEGACY_BEST_EFFORT = 2 - } - } - - /** Properties of a FeatureSetDefaults. */ - interface IFeatureSetDefaults { - - /** FeatureSetDefaults defaults */ - defaults?: (google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]|null); - - /** FeatureSetDefaults minimumEdition */ - minimumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - - /** FeatureSetDefaults maximumEdition */ - maximumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - } - - /** Represents a FeatureSetDefaults. */ - class FeatureSetDefaults implements IFeatureSetDefaults { - - /** - * Constructs a new FeatureSetDefaults. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFeatureSetDefaults); - - /** FeatureSetDefaults defaults. */ - public defaults: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]; - - /** FeatureSetDefaults minimumEdition. */ - public minimumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** FeatureSetDefaults maximumEdition. */ - public maximumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** - * Creates a new FeatureSetDefaults instance using the specified properties. - * @param [properties] Properties to set - * @returns FeatureSetDefaults instance - */ - public static create(properties?: google.protobuf.IFeatureSetDefaults): google.protobuf.FeatureSetDefaults; - - /** - * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. - * @param message FeatureSetDefaults message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. - * @param message FeatureSetDefaults message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FeatureSetDefaults message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FeatureSetDefaults - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSetDefaults; - - /** - * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FeatureSetDefaults - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSetDefaults; - - /** - * Verifies a FeatureSetDefaults message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FeatureSetDefaults - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults; - - /** - * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. - * @param message FeatureSetDefaults - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FeatureSetDefaults, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FeatureSetDefaults to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FeatureSetDefaults - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FeatureSetDefaults { - - /** Properties of a FeatureSetEditionDefault. */ - interface IFeatureSetEditionDefault { - - /** FeatureSetEditionDefault edition */ - edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - - /** FeatureSetEditionDefault features */ - features?: (google.protobuf.IFeatureSet|null); - } - - /** Represents a FeatureSetEditionDefault. */ - class FeatureSetEditionDefault implements IFeatureSetEditionDefault { - - /** - * Constructs a new FeatureSetEditionDefault. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault); - - /** FeatureSetEditionDefault edition. */ - public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** FeatureSetEditionDefault features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** - * Creates a new FeatureSetEditionDefault instance using the specified properties. - * @param [properties] Properties to set - * @returns FeatureSetEditionDefault instance - */ - public static create(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; - - /** - * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. - * @param message FeatureSetEditionDefault message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. - * @param message FeatureSetEditionDefault message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FeatureSetEditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; - - /** - * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FeatureSetEditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; - - /** - * Verifies a FeatureSetEditionDefault message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FeatureSetEditionDefault - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; - - /** - * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. - * @param message FeatureSetEditionDefault - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FeatureSetEditionDefault to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FeatureSetEditionDefault - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a SourceCodeInfo. */ - interface ISourceCodeInfo { - - /** SourceCodeInfo location */ - location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); - } - - /** Represents a SourceCodeInfo. */ - class SourceCodeInfo implements ISourceCodeInfo { - - /** - * Constructs a new SourceCodeInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.ISourceCodeInfo); - - /** SourceCodeInfo location. */ - public location: google.protobuf.SourceCodeInfo.ILocation[]; - - /** - * Creates a new SourceCodeInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns SourceCodeInfo instance - */ - public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; - - /** - * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @param message SourceCodeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @param message SourceCodeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo; - - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo; - - /** - * Verifies a SourceCodeInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SourceCodeInfo - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; - - /** - * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. - * @param message SourceCodeInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SourceCodeInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SourceCodeInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace SourceCodeInfo { - - /** Properties of a Location. */ - interface ILocation { - - /** Location path */ - path?: (number[]|null); - - /** Location span */ - span?: (number[]|null); - - /** Location leadingComments */ - leadingComments?: (string|null); - - /** Location trailingComments */ - trailingComments?: (string|null); - - /** Location leadingDetachedComments */ - leadingDetachedComments?: (string[]|null); - } - - /** Represents a Location. */ - class Location implements ILocation { - - /** - * Constructs a new Location. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); - - /** Location path. */ - public path: number[]; - - /** Location span. */ - public span: number[]; - - /** Location leadingComments. */ - public leadingComments: string; - - /** Location trailingComments. */ - public trailingComments: string; - - /** Location leadingDetachedComments. */ - public leadingDetachedComments: string[]; - - /** - * Creates a new Location instance using the specified properties. - * @param [properties] Properties to set - * @returns Location instance - */ - public static create(properties?: google.protobuf.SourceCodeInfo.ILocation): google.protobuf.SourceCodeInfo.Location; - - /** - * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @param message Location message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @param message Location message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Location message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo.Location; - - /** - * Decodes a Location message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo.Location; - - /** - * Verifies a Location message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Location message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Location - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; - - /** - * Creates a plain object from a Location message. Also converts values to other types if specified. - * @param message Location - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Location to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Location - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a GeneratedCodeInfo. */ - interface IGeneratedCodeInfo { - - /** GeneratedCodeInfo annotation */ - annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); - } - - /** Represents a GeneratedCodeInfo. */ - class GeneratedCodeInfo implements IGeneratedCodeInfo { - - /** - * Constructs a new GeneratedCodeInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IGeneratedCodeInfo); - - /** GeneratedCodeInfo annotation. */ - public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; - - /** - * Creates a new GeneratedCodeInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns GeneratedCodeInfo instance - */ - public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; - - /** - * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @param message GeneratedCodeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @param message GeneratedCodeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo; - - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo; - - /** - * Verifies a GeneratedCodeInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GeneratedCodeInfo - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; - - /** - * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. - * @param message GeneratedCodeInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GeneratedCodeInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GeneratedCodeInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace GeneratedCodeInfo { - - /** Properties of an Annotation. */ - interface IAnnotation { - - /** Annotation path */ - path?: (number[]|null); - - /** Annotation sourceFile */ - sourceFile?: (string|null); - - /** Annotation begin */ - begin?: (number|null); - - /** Annotation end */ - end?: (number|null); - - /** Annotation semantic */ - semantic?: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null); - } - - /** Represents an Annotation. */ - class Annotation implements IAnnotation { - - /** - * Constructs a new Annotation. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); - - /** Annotation path. */ - public path: number[]; - - /** Annotation sourceFile. */ - public sourceFile: string; - - /** Annotation begin. */ - public begin: number; - - /** Annotation end. */ - public end: number; - - /** Annotation semantic. */ - public semantic: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic); - - /** - * Creates a new Annotation instance using the specified properties. - * @param [properties] Properties to set - * @returns Annotation instance - */ - public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation; - - /** - * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @param message Annotation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @param message Annotation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Annotation message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo.Annotation; - - /** - * Decodes an Annotation message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo.Annotation; - - /** - * Verifies an Annotation message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Annotation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Annotation - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; - - /** - * Creates a plain object from an Annotation message. Also converts values to other types if specified. - * @param message Annotation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Annotation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Annotation - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Annotation { - - /** Semantic enum. */ - enum Semantic { - NONE = 0, - SET = 1, - ALIAS = 2 - } - } - } - - /** Properties of a Duration. */ - interface IDuration { - - /** Duration seconds */ - seconds?: (number|Long|string|null); - - /** Duration nanos */ - nanos?: (number|null); - } - - /** Represents a Duration. */ - class Duration implements IDuration { - - /** - * Constructs a new Duration. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IDuration); - - /** Duration seconds. */ - public seconds: (number|Long|string); - - /** Duration nanos. */ - public nanos: number; - - /** - * Creates a new Duration instance using the specified properties. - * @param [properties] Properties to set - * @returns Duration instance - */ - public static create(properties?: google.protobuf.IDuration): google.protobuf.Duration; - - /** - * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @param message Duration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @param message Duration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Duration message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Duration; - - /** - * Decodes a Duration message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Duration; - - /** - * Verifies a Duration message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Duration message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Duration - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; - - /** - * Creates a plain object from a Duration message. Also converts values to other types if specified. - * @param message Duration - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Duration to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Duration - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an Any. */ - interface IAny { - - /** Any type_url */ - type_url?: (string|null); - - /** Any value */ - value?: (Uint8Array|Buffer|string|null); - } - - /** Represents an Any. */ - class Any implements IAny { - - /** - * Constructs a new Any. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IAny); - - /** Any type_url. */ - public type_url: string; - - /** Any value. */ - public value: (Uint8Array|Buffer|string); - - /** - * Creates a new Any instance using the specified properties. - * @param [properties] Properties to set - * @returns Any instance - */ - public static create(properties?: google.protobuf.IAny): google.protobuf.Any; - - /** - * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. - * @param message Any message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. - * @param message Any message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Any message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Any - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Any; - - /** - * Decodes an Any message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Any - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Any; - - /** - * Verifies an Any message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Any message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Any - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Any; - - /** - * Creates a plain object from an Any message. Also converts values to other types if specified. - * @param message Any - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Any, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Any to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Any - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an Empty. */ - interface IEmpty { - } - - /** Represents an Empty. */ - class Empty implements IEmpty { - - /** - * Constructs a new Empty. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEmpty); - - /** - * Creates a new Empty instance using the specified properties. - * @param [properties] Properties to set - * @returns Empty instance - */ - public static create(properties?: google.protobuf.IEmpty): google.protobuf.Empty; - - /** - * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. - * @param message Empty message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. - * @param message Empty message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Empty message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Empty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Empty; - - /** - * Decodes an Empty message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Empty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Empty; - - /** - * Verifies an Empty message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Empty message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Empty - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Empty; - - /** - * Creates a plain object from an Empty message. Also converts values to other types if specified. - * @param message Empty - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Empty to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Empty - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a FieldMask. */ - interface IFieldMask { - - /** FieldMask paths */ - paths?: (string[]|null); - } - - /** Represents a FieldMask. */ - class FieldMask implements IFieldMask { - - /** - * Constructs a new FieldMask. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFieldMask); - - /** FieldMask paths. */ - public paths: string[]; - - /** - * Creates a new FieldMask instance using the specified properties. - * @param [properties] Properties to set - * @returns FieldMask instance - */ - public static create(properties?: google.protobuf.IFieldMask): google.protobuf.FieldMask; - - /** - * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. - * @param message FieldMask message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. - * @param message FieldMask message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FieldMask message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FieldMask - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldMask; - - /** - * Decodes a FieldMask message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FieldMask - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldMask; - - /** - * Verifies a FieldMask message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FieldMask - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldMask; - - /** - * Creates a plain object from a FieldMask message. Also converts values to other types if specified. - * @param message FieldMask - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FieldMask, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FieldMask to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FieldMask - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Timestamp. */ - interface ITimestamp { - - /** Timestamp seconds */ - seconds?: (number|Long|string|null); - - /** Timestamp nanos */ - nanos?: (number|null); - } - - /** Represents a Timestamp. */ - class Timestamp implements ITimestamp { - - /** - * Constructs a new Timestamp. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.ITimestamp); - - /** Timestamp seconds. */ - public seconds: (number|Long|string); - - /** Timestamp nanos. */ - public nanos: number; - - /** - * Creates a new Timestamp instance using the specified properties. - * @param [properties] Properties to set - * @returns Timestamp instance - */ - public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp; - - /** - * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @param message Timestamp message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @param message Timestamp message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Timestamp message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Timestamp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Timestamp; - - /** - * Decodes a Timestamp message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Timestamp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Timestamp; - - /** - * Verifies a Timestamp message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Timestamp - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; - - /** - * Creates a plain object from a Timestamp message. Also converts values to other types if specified. - * @param message Timestamp - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Timestamp to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Timestamp - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Struct. */ - interface IStruct { - - /** Struct fields */ - fields?: ({ [k: string]: google.protobuf.IValue }|null); - } - - /** Represents a Struct. */ - class Struct implements IStruct { - - /** - * Constructs a new Struct. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IStruct); - - /** Struct fields. */ - public fields: { [k: string]: google.protobuf.IValue }; - - /** - * Creates a new Struct instance using the specified properties. - * @param [properties] Properties to set - * @returns Struct instance - */ - public static create(properties?: google.protobuf.IStruct): google.protobuf.Struct; - - /** - * Encodes the specified Struct message. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. - * @param message Struct message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IStruct, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Struct message, length delimited. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. - * @param message Struct message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IStruct, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Struct message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Struct - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Struct; - - /** - * Decodes a Struct message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Struct - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Struct; - - /** - * Verifies a Struct message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Struct message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Struct - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Struct; - - /** - * Creates a plain object from a Struct message. Also converts values to other types if specified. - * @param message Struct - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Struct, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Struct to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Struct - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Value. */ - interface IValue { - - /** Value nullValue */ - nullValue?: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue|null); - - /** Value numberValue */ - numberValue?: (number|null); - - /** Value stringValue */ - stringValue?: (string|null); - - /** Value boolValue */ - boolValue?: (boolean|null); - - /** Value structValue */ - structValue?: (google.protobuf.IStruct|null); - - /** Value listValue */ - listValue?: (google.protobuf.IListValue|null); - } - - /** Represents a Value. */ - class Value implements IValue { - - /** - * Constructs a new Value. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IValue); - - /** Value nullValue. */ - public nullValue?: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue|null); - - /** Value numberValue. */ - public numberValue?: (number|null); - - /** Value stringValue. */ - public stringValue?: (string|null); - - /** Value boolValue. */ - public boolValue?: (boolean|null); - - /** Value structValue. */ - public structValue?: (google.protobuf.IStruct|null); - - /** Value listValue. */ - public listValue?: (google.protobuf.IListValue|null); - - /** Value kind. */ - public kind?: ("nullValue"|"numberValue"|"stringValue"|"boolValue"|"structValue"|"listValue"); - - /** - * Creates a new Value instance using the specified properties. - * @param [properties] Properties to set - * @returns Value instance - */ - public static create(properties?: google.protobuf.IValue): google.protobuf.Value; - - /** - * Encodes the specified Value message. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. - * @param message Value message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Value message, length delimited. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. - * @param message Value message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Value message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Value; - - /** - * Decodes a Value message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Value; - - /** - * Verifies a Value message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Value message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Value - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Value; - - /** - * Creates a plain object from a Value message. Also converts values to other types if specified. - * @param message Value - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Value to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Value - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** NullValue enum. */ - enum NullValue { - NULL_VALUE = 0 - } - - /** Properties of a ListValue. */ - interface IListValue { - - /** ListValue values */ - values?: (google.protobuf.IValue[]|null); - } - - /** Represents a ListValue. */ - class ListValue implements IListValue { - - /** - * Constructs a new ListValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IListValue); - - /** ListValue values. */ - public values: google.protobuf.IValue[]; - - /** - * Creates a new ListValue instance using the specified properties. - * @param [properties] Properties to set - * @returns ListValue instance - */ - public static create(properties?: google.protobuf.IListValue): google.protobuf.ListValue; - - /** - * Encodes the specified ListValue message. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. - * @param message ListValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IListValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListValue message, length delimited. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. - * @param message ListValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IListValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListValue message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListValue - * @throws {Error} If the payload is not 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.ListValue; - - /** - * Decodes a ListValue message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListValue - * @throws {Error} If the payload 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.ListValue; - - /** - * Verifies a ListValue message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListValue - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ListValue; - - /** - * Creates a plain object from a ListValue message. Also converts values to other types if specified. - * @param message ListValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ListValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListValue - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Namespace longrunning. */ - namespace longrunning { - - /** Represents an Operations */ - class Operations extends $protobuf.rpc.Service { - - /** - * Constructs a new Operations service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - - /** - * Creates new Operations service using the specified rpc implementation. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - * @returns RPC service. Useful where requests and/or responses are streamed. - */ - public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Operations; - - /** - * Calls ListOperations. - * @param request ListOperationsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListOperationsResponse - */ - public listOperations(request: google.longrunning.IListOperationsRequest, callback: google.longrunning.Operations.ListOperationsCallback): void; - - /** - * Calls ListOperations. - * @param request ListOperationsRequest message or plain object - * @returns Promise - */ - public listOperations(request: google.longrunning.IListOperationsRequest): Promise; - - /** - * Calls GetOperation. - * @param request GetOperationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public getOperation(request: google.longrunning.IGetOperationRequest, callback: google.longrunning.Operations.GetOperationCallback): void; - - /** - * Calls GetOperation. - * @param request GetOperationRequest message or plain object - * @returns Promise - */ - public getOperation(request: google.longrunning.IGetOperationRequest): Promise; - - /** - * Calls DeleteOperation. - * @param request DeleteOperationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteOperation(request: google.longrunning.IDeleteOperationRequest, callback: google.longrunning.Operations.DeleteOperationCallback): void; - - /** - * Calls DeleteOperation. - * @param request DeleteOperationRequest message or plain object - * @returns Promise - */ - public deleteOperation(request: google.longrunning.IDeleteOperationRequest): Promise; - - /** - * Calls CancelOperation. - * @param request CancelOperationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public cancelOperation(request: google.longrunning.ICancelOperationRequest, callback: google.longrunning.Operations.CancelOperationCallback): void; - - /** - * Calls CancelOperation. - * @param request CancelOperationRequest message or plain object - * @returns Promise - */ - public cancelOperation(request: google.longrunning.ICancelOperationRequest): Promise; - - /** - * Calls WaitOperation. - * @param request WaitOperationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public waitOperation(request: google.longrunning.IWaitOperationRequest, callback: google.longrunning.Operations.WaitOperationCallback): void; - - /** - * Calls WaitOperation. - * @param request WaitOperationRequest message or plain object - * @returns Promise - */ - public waitOperation(request: google.longrunning.IWaitOperationRequest): Promise; - } - - namespace Operations { - - /** - * Callback as used by {@link google.longrunning.Operations|listOperations}. - * @param error Error, if any - * @param [response] ListOperationsResponse - */ - type ListOperationsCallback = (error: (Error|null), response?: google.longrunning.ListOperationsResponse) => void; - - /** - * Callback as used by {@link google.longrunning.Operations|getOperation}. - * @param error Error, if any - * @param [response] Operation - */ - type GetOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.longrunning.Operations|deleteOperation}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.longrunning.Operations|cancelOperation}. - * @param error Error, if any - * @param [response] Empty - */ - type CancelOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.longrunning.Operations|waitOperation}. - * @param error Error, if any - * @param [response] Operation - */ - type WaitOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - } - - /** Properties of an Operation. */ - interface IOperation { - - /** Operation name */ - name?: (string|null); - - /** Operation metadata */ - metadata?: (google.protobuf.IAny|null); - - /** Operation done */ - done?: (boolean|null); - - /** Operation error */ - error?: (google.rpc.IStatus|null); - - /** Operation response */ - response?: (google.protobuf.IAny|null); - } - - /** Represents an Operation. */ - class Operation implements IOperation { - - /** - * Constructs a new Operation. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IOperation); - - /** Operation name. */ - public name: string; - - /** Operation metadata. */ - public metadata?: (google.protobuf.IAny|null); - - /** Operation done. */ - public done: boolean; - - /** Operation error. */ - public error?: (google.rpc.IStatus|null); - - /** Operation response. */ - public response?: (google.protobuf.IAny|null); - - /** Operation result. */ - public result?: ("error"|"response"); - - /** - * Creates a new Operation instance using the specified properties. - * @param [properties] Properties to set - * @returns Operation instance - */ - public static create(properties?: google.longrunning.IOperation): google.longrunning.Operation; - - /** - * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. - * @param message Operation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. - * @param message Operation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Operation message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Operation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.Operation; - - /** - * Decodes an Operation message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Operation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.Operation; - - /** - * Verifies an Operation message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Operation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Operation - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.Operation; - - /** - * Creates a plain object from an Operation message. Also converts values to other types if specified. - * @param message Operation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.Operation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Operation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Operation - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetOperationRequest. */ - interface IGetOperationRequest { - - /** GetOperationRequest name */ - name?: (string|null); - } - - /** Represents a GetOperationRequest. */ - class GetOperationRequest implements IGetOperationRequest { - - /** - * Constructs a new GetOperationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IGetOperationRequest); - - /** GetOperationRequest name. */ - public name: string; - - /** - * Creates a new GetOperationRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetOperationRequest instance - */ - public static create(properties?: google.longrunning.IGetOperationRequest): google.longrunning.GetOperationRequest; - - /** - * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. - * @param message GetOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. - * @param message GetOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetOperationRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.GetOperationRequest; - - /** - * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.GetOperationRequest; - - /** - * Verifies a GetOperationRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetOperationRequest - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.GetOperationRequest; - - /** - * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. - * @param message GetOperationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.GetOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetOperationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetOperationRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListOperationsRequest. */ - interface IListOperationsRequest { - - /** ListOperationsRequest name */ - name?: (string|null); - - /** ListOperationsRequest filter */ - filter?: (string|null); - - /** ListOperationsRequest pageSize */ - pageSize?: (number|null); - - /** ListOperationsRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListOperationsRequest. */ - class ListOperationsRequest implements IListOperationsRequest { - - /** - * Constructs a new ListOperationsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IListOperationsRequest); - - /** ListOperationsRequest name. */ - public name: string; - - /** ListOperationsRequest filter. */ - public filter: string; - - /** ListOperationsRequest pageSize. */ - public pageSize: number; - - /** ListOperationsRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListOperationsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListOperationsRequest instance - */ - public static create(properties?: google.longrunning.IListOperationsRequest): google.longrunning.ListOperationsRequest; - - /** - * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. - * @param message ListOperationsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. - * @param message ListOperationsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListOperationsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListOperationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsRequest; - - /** - * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListOperationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsRequest; - - /** - * Verifies a ListOperationsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListOperationsRequest - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsRequest; - - /** - * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. - * @param message ListOperationsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.ListOperationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListOperationsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListOperationsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListOperationsResponse. */ - interface IListOperationsResponse { - - /** ListOperationsResponse operations */ - operations?: (google.longrunning.IOperation[]|null); - - /** ListOperationsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListOperationsResponse. */ - class ListOperationsResponse implements IListOperationsResponse { - - /** - * Constructs a new ListOperationsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IListOperationsResponse); - - /** ListOperationsResponse operations. */ - public operations: google.longrunning.IOperation[]; - - /** ListOperationsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListOperationsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListOperationsResponse instance - */ - public static create(properties?: google.longrunning.IListOperationsResponse): google.longrunning.ListOperationsResponse; - - /** - * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. - * @param message ListOperationsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. - * @param message ListOperationsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListOperationsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListOperationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsResponse; - - /** - * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListOperationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsResponse; - - /** - * Verifies a ListOperationsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListOperationsResponse - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsResponse; - - /** - * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. - * @param message ListOperationsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.ListOperationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListOperationsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListOperationsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CancelOperationRequest. */ - interface ICancelOperationRequest { - - /** CancelOperationRequest name */ - name?: (string|null); - } - - /** Represents a CancelOperationRequest. */ - class CancelOperationRequest implements ICancelOperationRequest { - - /** - * Constructs a new CancelOperationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.ICancelOperationRequest); - - /** CancelOperationRequest name. */ - public name: string; - - /** - * Creates a new CancelOperationRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CancelOperationRequest instance - */ - public static create(properties?: google.longrunning.ICancelOperationRequest): google.longrunning.CancelOperationRequest; - - /** - * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. - * @param message CancelOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. - * @param message CancelOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CancelOperationRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CancelOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.CancelOperationRequest; - - /** - * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CancelOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.CancelOperationRequest; - - /** - * Verifies a CancelOperationRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CancelOperationRequest - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.CancelOperationRequest; - - /** - * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. - * @param message CancelOperationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.CancelOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CancelOperationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CancelOperationRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteOperationRequest. */ - interface IDeleteOperationRequest { - - /** DeleteOperationRequest name */ - name?: (string|null); - } - - /** Represents a DeleteOperationRequest. */ - class DeleteOperationRequest implements IDeleteOperationRequest { - - /** - * Constructs a new DeleteOperationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IDeleteOperationRequest); - - /** DeleteOperationRequest name. */ - public name: string; - - /** - * Creates a new DeleteOperationRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteOperationRequest instance - */ - public static create(properties?: google.longrunning.IDeleteOperationRequest): google.longrunning.DeleteOperationRequest; - - /** - * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. - * @param message DeleteOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. - * @param message DeleteOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteOperationRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.DeleteOperationRequest; - - /** - * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.DeleteOperationRequest; - - /** - * Verifies a DeleteOperationRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteOperationRequest - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.DeleteOperationRequest; - - /** - * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. - * @param message DeleteOperationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.DeleteOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteOperationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteOperationRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a WaitOperationRequest. */ - interface IWaitOperationRequest { - - /** WaitOperationRequest name */ - name?: (string|null); - - /** WaitOperationRequest timeout */ - timeout?: (google.protobuf.IDuration|null); - } - - /** Represents a WaitOperationRequest. */ - class WaitOperationRequest implements IWaitOperationRequest { - - /** - * Constructs a new WaitOperationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IWaitOperationRequest); - - /** WaitOperationRequest name. */ - public name: string; - - /** WaitOperationRequest timeout. */ - public timeout?: (google.protobuf.IDuration|null); - - /** - * Creates a new WaitOperationRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns WaitOperationRequest instance - */ - public static create(properties?: google.longrunning.IWaitOperationRequest): google.longrunning.WaitOperationRequest; - - /** - * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. - * @param message WaitOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. - * @param message WaitOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a WaitOperationRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns WaitOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.WaitOperationRequest; - - /** - * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns WaitOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.WaitOperationRequest; - - /** - * Verifies a WaitOperationRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns WaitOperationRequest - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.WaitOperationRequest; - - /** - * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. - * @param message WaitOperationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.WaitOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this WaitOperationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for WaitOperationRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an OperationInfo. */ - interface IOperationInfo { - - /** OperationInfo responseType */ - responseType?: (string|null); - - /** OperationInfo metadataType */ - metadataType?: (string|null); - } - - /** Represents an OperationInfo. */ - class OperationInfo implements IOperationInfo { - - /** - * Constructs a new OperationInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IOperationInfo); - - /** OperationInfo responseType. */ - public responseType: string; - - /** OperationInfo metadataType. */ - public metadataType: string; - - /** - * Creates a new OperationInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns OperationInfo instance - */ - public static create(properties?: google.longrunning.IOperationInfo): google.longrunning.OperationInfo; - - /** - * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. - * @param message OperationInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. - * @param message OperationInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OperationInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OperationInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.OperationInfo; - - /** - * Decodes an OperationInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OperationInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.OperationInfo; - - /** - * Verifies an OperationInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OperationInfo - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.OperationInfo; - - /** - * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. - * @param message OperationInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.OperationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OperationInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for OperationInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Namespace rpc. */ - namespace rpc { - - /** Properties of a Status. */ - interface IStatus { - - /** Status code */ - code?: (number|null); - - /** Status message */ - message?: (string|null); - - /** Status details */ - details?: (google.protobuf.IAny[]|null); - } - - /** Represents a Status. */ - class Status implements IStatus { - - /** - * Constructs a new Status. - * @param [properties] Properties to set - */ - constructor(properties?: google.rpc.IStatus); - - /** Status code. */ - public code: number; - - /** Status message. */ - public message: string; - - /** Status details. */ - public details: google.protobuf.IAny[]; - - /** - * Creates a new Status instance using the specified properties. - * @param [properties] Properties to set - * @returns Status instance - */ - public static create(properties?: google.rpc.IStatus): google.rpc.Status; - - /** - * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. - * @param message Status message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. - * @param message Status message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Status message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Status - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.rpc.Status; - - /** - * Decodes a Status message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Status - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.rpc.Status; - - /** - * Verifies a Status message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Status message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Status - */ - public static fromObject(object: { [k: string]: any }): google.rpc.Status; - - /** - * Creates a plain object from a Status message. Also converts values to other types if specified. - * @param message Status - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.rpc.Status, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Status to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Status - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Namespace iam. */ - namespace iam { - - /** Namespace v1. */ - namespace v1 { - - /** Represents a IAMPolicy */ - class IAMPolicy extends $protobuf.rpc.Service { - - /** - * Constructs a new IAMPolicy service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - - /** - * Creates new IAMPolicy service using the specified rpc implementation. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - * @returns RPC service. Useful where requests and/or responses are streamed. - */ - public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): IAMPolicy; - - /** - * Calls SetIamPolicy. - * @param request SetIamPolicyRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Policy - */ - public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest, callback: google.iam.v1.IAMPolicy.SetIamPolicyCallback): void; - - /** - * Calls SetIamPolicy. - * @param request SetIamPolicyRequest message or plain object - * @returns Promise - */ - public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest): Promise; - - /** - * Calls GetIamPolicy. - * @param request GetIamPolicyRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Policy - */ - public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest, callback: google.iam.v1.IAMPolicy.GetIamPolicyCallback): void; - - /** - * Calls GetIamPolicy. - * @param request GetIamPolicyRequest message or plain object - * @returns Promise - */ - public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest): Promise; - - /** - * Calls TestIamPermissions. - * @param request TestIamPermissionsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and TestIamPermissionsResponse - */ - public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest, callback: google.iam.v1.IAMPolicy.TestIamPermissionsCallback): void; - - /** - * Calls TestIamPermissions. - * @param request TestIamPermissionsRequest message or plain object - * @returns Promise - */ - public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest): Promise; - } - - namespace IAMPolicy { - - /** - * Callback as used by {@link google.iam.v1.IAMPolicy|setIamPolicy}. - * @param error Error, if any - * @param [response] Policy - */ - type SetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; - - /** - * Callback as used by {@link google.iam.v1.IAMPolicy|getIamPolicy}. - * @param error Error, if any - * @param [response] Policy - */ - type GetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; - - /** - * Callback as used by {@link google.iam.v1.IAMPolicy|testIamPermissions}. - * @param error Error, if any - * @param [response] TestIamPermissionsResponse - */ - type TestIamPermissionsCallback = (error: (Error|null), response?: google.iam.v1.TestIamPermissionsResponse) => void; - } - - /** Properties of a SetIamPolicyRequest. */ - interface ISetIamPolicyRequest { - - /** SetIamPolicyRequest resource */ - resource?: (string|null); - - /** SetIamPolicyRequest policy */ - policy?: (google.iam.v1.IPolicy|null); - - /** SetIamPolicyRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - } - - /** Represents a SetIamPolicyRequest. */ - class SetIamPolicyRequest implements ISetIamPolicyRequest { - - /** - * Constructs a new SetIamPolicyRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.ISetIamPolicyRequest); - - /** SetIamPolicyRequest resource. */ - public resource: string; - - /** SetIamPolicyRequest policy. */ - public policy?: (google.iam.v1.IPolicy|null); - - /** SetIamPolicyRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** - * Creates a new SetIamPolicyRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns SetIamPolicyRequest instance - */ - public static create(properties?: google.iam.v1.ISetIamPolicyRequest): google.iam.v1.SetIamPolicyRequest; - - /** - * Encodes the specified SetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. - * @param message SetIamPolicyRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.ISetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. - * @param message SetIamPolicyRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.ISetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SetIamPolicyRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SetIamPolicyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.SetIamPolicyRequest; - - /** - * Decodes a SetIamPolicyRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SetIamPolicyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.SetIamPolicyRequest; - - /** - * Verifies a SetIamPolicyRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SetIamPolicyRequest - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.SetIamPolicyRequest; - - /** - * Creates a plain object from a SetIamPolicyRequest message. Also converts values to other types if specified. - * @param message SetIamPolicyRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.SetIamPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SetIamPolicyRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SetIamPolicyRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetIamPolicyRequest. */ - interface IGetIamPolicyRequest { - - /** GetIamPolicyRequest resource */ - resource?: (string|null); - - /** GetIamPolicyRequest options */ - options?: (google.iam.v1.IGetPolicyOptions|null); - } - - /** Represents a GetIamPolicyRequest. */ - class GetIamPolicyRequest implements IGetIamPolicyRequest { - - /** - * Constructs a new GetIamPolicyRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.IGetIamPolicyRequest); - - /** GetIamPolicyRequest resource. */ - public resource: string; - - /** GetIamPolicyRequest options. */ - public options?: (google.iam.v1.IGetPolicyOptions|null); - - /** - * Creates a new GetIamPolicyRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetIamPolicyRequest instance - */ - public static create(properties?: google.iam.v1.IGetIamPolicyRequest): google.iam.v1.GetIamPolicyRequest; - - /** - * Encodes the specified GetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. - * @param message GetIamPolicyRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.IGetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. - * @param message GetIamPolicyRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.IGetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetIamPolicyRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetIamPolicyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.GetIamPolicyRequest; - - /** - * Decodes a GetIamPolicyRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetIamPolicyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.GetIamPolicyRequest; - - /** - * Verifies a GetIamPolicyRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetIamPolicyRequest - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.GetIamPolicyRequest; - - /** - * Creates a plain object from a GetIamPolicyRequest message. Also converts values to other types if specified. - * @param message GetIamPolicyRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.GetIamPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetIamPolicyRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetIamPolicyRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a TestIamPermissionsRequest. */ - interface ITestIamPermissionsRequest { - - /** TestIamPermissionsRequest resource */ - resource?: (string|null); - - /** TestIamPermissionsRequest permissions */ - permissions?: (string[]|null); - } - - /** Represents a TestIamPermissionsRequest. */ - class TestIamPermissionsRequest implements ITestIamPermissionsRequest { - - /** - * Constructs a new TestIamPermissionsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.ITestIamPermissionsRequest); - - /** TestIamPermissionsRequest resource. */ - public resource: string; - - /** TestIamPermissionsRequest permissions. */ - public permissions: string[]; - - /** - * Creates a new TestIamPermissionsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns TestIamPermissionsRequest instance - */ - public static create(properties?: google.iam.v1.ITestIamPermissionsRequest): google.iam.v1.TestIamPermissionsRequest; - - /** - * Encodes the specified TestIamPermissionsRequest message. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. - * @param message TestIamPermissionsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.ITestIamPermissionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TestIamPermissionsRequest message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. - * @param message TestIamPermissionsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.ITestIamPermissionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TestIamPermissionsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TestIamPermissionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.TestIamPermissionsRequest; - - /** - * Decodes a TestIamPermissionsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TestIamPermissionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.TestIamPermissionsRequest; - - /** - * Verifies a TestIamPermissionsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TestIamPermissionsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TestIamPermissionsRequest - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.TestIamPermissionsRequest; - - /** - * Creates a plain object from a TestIamPermissionsRequest message. Also converts values to other types if specified. - * @param message TestIamPermissionsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.TestIamPermissionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TestIamPermissionsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TestIamPermissionsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a TestIamPermissionsResponse. */ - interface ITestIamPermissionsResponse { - - /** TestIamPermissionsResponse permissions */ - permissions?: (string[]|null); - } - - /** Represents a TestIamPermissionsResponse. */ - class TestIamPermissionsResponse implements ITestIamPermissionsResponse { - - /** - * Constructs a new TestIamPermissionsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.ITestIamPermissionsResponse); - - /** TestIamPermissionsResponse permissions. */ - public permissions: string[]; - - /** - * Creates a new TestIamPermissionsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns TestIamPermissionsResponse instance - */ - public static create(properties?: google.iam.v1.ITestIamPermissionsResponse): google.iam.v1.TestIamPermissionsResponse; - - /** - * Encodes the specified TestIamPermissionsResponse message. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. - * @param message TestIamPermissionsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.ITestIamPermissionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TestIamPermissionsResponse message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. - * @param message TestIamPermissionsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.ITestIamPermissionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TestIamPermissionsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TestIamPermissionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.TestIamPermissionsResponse; - - /** - * Decodes a TestIamPermissionsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TestIamPermissionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.TestIamPermissionsResponse; - - /** - * Verifies a TestIamPermissionsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TestIamPermissionsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TestIamPermissionsResponse - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.TestIamPermissionsResponse; - - /** - * Creates a plain object from a TestIamPermissionsResponse message. Also converts values to other types if specified. - * @param message TestIamPermissionsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.TestIamPermissionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TestIamPermissionsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TestIamPermissionsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetPolicyOptions. */ - interface IGetPolicyOptions { - - /** GetPolicyOptions requestedPolicyVersion */ - requestedPolicyVersion?: (number|null); - } - - /** Represents a GetPolicyOptions. */ - class GetPolicyOptions implements IGetPolicyOptions { - - /** - * Constructs a new GetPolicyOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.IGetPolicyOptions); - - /** GetPolicyOptions requestedPolicyVersion. */ - public requestedPolicyVersion: number; - - /** - * Creates a new GetPolicyOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns GetPolicyOptions instance - */ - public static create(properties?: google.iam.v1.IGetPolicyOptions): google.iam.v1.GetPolicyOptions; - - /** - * Encodes the specified GetPolicyOptions message. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages. - * @param message GetPolicyOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.IGetPolicyOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetPolicyOptions message, length delimited. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages. - * @param message GetPolicyOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.IGetPolicyOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetPolicyOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetPolicyOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.GetPolicyOptions; - - /** - * Decodes a GetPolicyOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetPolicyOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.GetPolicyOptions; - - /** - * Verifies a GetPolicyOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetPolicyOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetPolicyOptions - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.GetPolicyOptions; - - /** - * Creates a plain object from a GetPolicyOptions message. Also converts values to other types if specified. - * @param message GetPolicyOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.GetPolicyOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetPolicyOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetPolicyOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Policy. */ - interface IPolicy { - - /** Policy version */ - version?: (number|null); - - /** Policy bindings */ - bindings?: (google.iam.v1.IBinding[]|null); - - /** Policy auditConfigs */ - auditConfigs?: (google.iam.v1.IAuditConfig[]|null); - - /** Policy etag */ - etag?: (Uint8Array|Buffer|string|null); - } - - /** Represents a Policy. */ - class Policy implements IPolicy { - - /** - * Constructs a new Policy. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.IPolicy); - - /** Policy version. */ - public version: number; - - /** Policy bindings. */ - public bindings: google.iam.v1.IBinding[]; - - /** Policy auditConfigs. */ - public auditConfigs: google.iam.v1.IAuditConfig[]; - - /** Policy etag. */ - public etag: (Uint8Array|Buffer|string); - - /** - * Creates a new Policy instance using the specified properties. - * @param [properties] Properties to set - * @returns Policy instance - */ - public static create(properties?: google.iam.v1.IPolicy): google.iam.v1.Policy; - - /** - * Encodes the specified Policy message. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. - * @param message Policy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.IPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Policy message, length delimited. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. - * @param message Policy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.IPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Policy message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Policy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.Policy; - - /** - * Decodes a Policy message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Policy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.Policy; - - /** - * Verifies a Policy message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Policy message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Policy - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.Policy; - - /** - * Creates a plain object from a Policy message. Also converts values to other types if specified. - * @param message Policy - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.Policy, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Policy to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Policy - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Binding. */ - interface IBinding { - - /** Binding role */ - role?: (string|null); - - /** Binding members */ - members?: (string[]|null); - - /** Binding condition */ - condition?: (google.type.IExpr|null); - } - - /** Represents a Binding. */ - class Binding implements IBinding { - - /** - * Constructs a new Binding. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.IBinding); - - /** Binding role. */ - public role: string; - - /** Binding members. */ - public members: string[]; - - /** Binding condition. */ - public condition?: (google.type.IExpr|null); - - /** - * Creates a new Binding instance using the specified properties. - * @param [properties] Properties to set - * @returns Binding instance - */ - public static create(properties?: google.iam.v1.IBinding): google.iam.v1.Binding; - - /** - * Encodes the specified Binding message. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. - * @param message Binding message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.IBinding, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Binding message, length delimited. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. - * @param message Binding message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.IBinding, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Binding message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Binding - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.Binding; - - /** - * Decodes a Binding message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Binding - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.Binding; - - /** - * Verifies a Binding message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Binding message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Binding - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.Binding; - - /** - * Creates a plain object from a Binding message. Also converts values to other types if specified. - * @param message Binding - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.Binding, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Binding to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Binding - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an AuditConfig. */ - interface IAuditConfig { - - /** AuditConfig service */ - service?: (string|null); - - /** AuditConfig auditLogConfigs */ - auditLogConfigs?: (google.iam.v1.IAuditLogConfig[]|null); - } - - /** Represents an AuditConfig. */ - class AuditConfig implements IAuditConfig { - - /** - * Constructs a new AuditConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.IAuditConfig); - - /** AuditConfig service. */ - public service: string; - - /** AuditConfig auditLogConfigs. */ - public auditLogConfigs: google.iam.v1.IAuditLogConfig[]; - - /** - * Creates a new AuditConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns AuditConfig instance - */ - public static create(properties?: google.iam.v1.IAuditConfig): google.iam.v1.AuditConfig; - - /** - * Encodes the specified AuditConfig message. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. - * @param message AuditConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.IAuditConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AuditConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. - * @param message AuditConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.IAuditConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AuditConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AuditConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.AuditConfig; - - /** - * Decodes an AuditConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AuditConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.AuditConfig; - - /** - * Verifies an AuditConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an AuditConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AuditConfig - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditConfig; - - /** - * Creates a plain object from an AuditConfig message. Also converts values to other types if specified. - * @param message AuditConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.AuditConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AuditConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AuditConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an AuditLogConfig. */ - interface IAuditLogConfig { - - /** AuditLogConfig logType */ - logType?: (google.iam.v1.AuditLogConfig.LogType|keyof typeof google.iam.v1.AuditLogConfig.LogType|null); - - /** AuditLogConfig exemptedMembers */ - exemptedMembers?: (string[]|null); - } - - /** Represents an AuditLogConfig. */ - class AuditLogConfig implements IAuditLogConfig { - - /** - * Constructs a new AuditLogConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.IAuditLogConfig); - - /** AuditLogConfig logType. */ - public logType: (google.iam.v1.AuditLogConfig.LogType|keyof typeof google.iam.v1.AuditLogConfig.LogType); - - /** AuditLogConfig exemptedMembers. */ - public exemptedMembers: string[]; - - /** - * Creates a new AuditLogConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns AuditLogConfig instance - */ - public static create(properties?: google.iam.v1.IAuditLogConfig): google.iam.v1.AuditLogConfig; - - /** - * Encodes the specified AuditLogConfig message. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. - * @param message AuditLogConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.IAuditLogConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AuditLogConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. - * @param message AuditLogConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.IAuditLogConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AuditLogConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AuditLogConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.AuditLogConfig; - - /** - * Decodes an AuditLogConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AuditLogConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.AuditLogConfig; - - /** - * Verifies an AuditLogConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an AuditLogConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AuditLogConfig - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditLogConfig; - - /** - * Creates a plain object from an AuditLogConfig message. Also converts values to other types if specified. - * @param message AuditLogConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.AuditLogConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AuditLogConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AuditLogConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace AuditLogConfig { - - /** LogType enum. */ - enum LogType { - LOG_TYPE_UNSPECIFIED = 0, - ADMIN_READ = 1, - DATA_WRITE = 2, - DATA_READ = 3 - } - } - - /** Properties of a PolicyDelta. */ - interface IPolicyDelta { - - /** PolicyDelta bindingDeltas */ - bindingDeltas?: (google.iam.v1.IBindingDelta[]|null); - - /** PolicyDelta auditConfigDeltas */ - auditConfigDeltas?: (google.iam.v1.IAuditConfigDelta[]|null); - } - - /** Represents a PolicyDelta. */ - class PolicyDelta implements IPolicyDelta { - - /** - * Constructs a new PolicyDelta. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.IPolicyDelta); - - /** PolicyDelta bindingDeltas. */ - public bindingDeltas: google.iam.v1.IBindingDelta[]; - - /** PolicyDelta auditConfigDeltas. */ - public auditConfigDeltas: google.iam.v1.IAuditConfigDelta[]; - - /** - * Creates a new PolicyDelta instance using the specified properties. - * @param [properties] Properties to set - * @returns PolicyDelta instance - */ - public static create(properties?: google.iam.v1.IPolicyDelta): google.iam.v1.PolicyDelta; - - /** - * Encodes the specified PolicyDelta message. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. - * @param message PolicyDelta message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.IPolicyDelta, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PolicyDelta message, length delimited. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. - * @param message PolicyDelta message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.IPolicyDelta, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PolicyDelta message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PolicyDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.PolicyDelta; - - /** - * Decodes a PolicyDelta message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PolicyDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.PolicyDelta; - - /** - * Verifies a PolicyDelta message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PolicyDelta message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PolicyDelta - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.PolicyDelta; - - /** - * Creates a plain object from a PolicyDelta message. Also converts values to other types if specified. - * @param message PolicyDelta - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.PolicyDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PolicyDelta to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PolicyDelta - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BindingDelta. */ - interface IBindingDelta { - - /** BindingDelta action */ - action?: (google.iam.v1.BindingDelta.Action|keyof typeof google.iam.v1.BindingDelta.Action|null); - - /** BindingDelta role */ - role?: (string|null); - - /** BindingDelta member */ - member?: (string|null); - - /** BindingDelta condition */ - condition?: (google.type.IExpr|null); - } - - /** Represents a BindingDelta. */ - class BindingDelta implements IBindingDelta { - - /** - * Constructs a new BindingDelta. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.IBindingDelta); - - /** BindingDelta action. */ - public action: (google.iam.v1.BindingDelta.Action|keyof typeof google.iam.v1.BindingDelta.Action); - - /** BindingDelta role. */ - public role: string; - - /** BindingDelta member. */ - public member: string; - - /** BindingDelta condition. */ - public condition?: (google.type.IExpr|null); - - /** - * Creates a new BindingDelta instance using the specified properties. - * @param [properties] Properties to set - * @returns BindingDelta instance - */ - public static create(properties?: google.iam.v1.IBindingDelta): google.iam.v1.BindingDelta; - - /** - * Encodes the specified BindingDelta message. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. - * @param message BindingDelta message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.IBindingDelta, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BindingDelta message, length delimited. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. - * @param message BindingDelta message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.IBindingDelta, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BindingDelta message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BindingDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.BindingDelta; - - /** - * Decodes a BindingDelta message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BindingDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.BindingDelta; - - /** - * Verifies a BindingDelta message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BindingDelta message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BindingDelta - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.BindingDelta; - - /** - * Creates a plain object from a BindingDelta message. Also converts values to other types if specified. - * @param message BindingDelta - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.BindingDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BindingDelta to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BindingDelta - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace BindingDelta { - - /** Action enum. */ - enum Action { - ACTION_UNSPECIFIED = 0, - ADD = 1, - REMOVE = 2 - } - } - - /** Properties of an AuditConfigDelta. */ - interface IAuditConfigDelta { - - /** AuditConfigDelta action */ - action?: (google.iam.v1.AuditConfigDelta.Action|keyof typeof google.iam.v1.AuditConfigDelta.Action|null); - - /** AuditConfigDelta service */ - service?: (string|null); - - /** AuditConfigDelta exemptedMember */ - exemptedMember?: (string|null); - - /** AuditConfigDelta logType */ - logType?: (string|null); - } - - /** Represents an AuditConfigDelta. */ - class AuditConfigDelta implements IAuditConfigDelta { - - /** - * Constructs a new AuditConfigDelta. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.IAuditConfigDelta); - - /** AuditConfigDelta action. */ - public action: (google.iam.v1.AuditConfigDelta.Action|keyof typeof google.iam.v1.AuditConfigDelta.Action); - - /** AuditConfigDelta service. */ - public service: string; - - /** AuditConfigDelta exemptedMember. */ - public exemptedMember: string; - - /** AuditConfigDelta logType. */ - public logType: string; - - /** - * Creates a new AuditConfigDelta instance using the specified properties. - * @param [properties] Properties to set - * @returns AuditConfigDelta instance - */ - public static create(properties?: google.iam.v1.IAuditConfigDelta): google.iam.v1.AuditConfigDelta; - - /** - * Encodes the specified AuditConfigDelta message. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. - * @param message AuditConfigDelta message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.IAuditConfigDelta, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AuditConfigDelta message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. - * @param message AuditConfigDelta message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.IAuditConfigDelta, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AuditConfigDelta message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AuditConfigDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.AuditConfigDelta; - - /** - * Decodes an AuditConfigDelta message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AuditConfigDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.AuditConfigDelta; - - /** - * Verifies an AuditConfigDelta message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an AuditConfigDelta message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AuditConfigDelta - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditConfigDelta; - - /** - * Creates a plain object from an AuditConfigDelta message. Also converts values to other types if specified. - * @param message AuditConfigDelta - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.AuditConfigDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AuditConfigDelta to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AuditConfigDelta - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace AuditConfigDelta { - - /** Action enum. */ - enum Action { - ACTION_UNSPECIFIED = 0, - ADD = 1, - REMOVE = 2 - } - } - } - } - - /** Namespace type. */ - namespace type { - - /** Properties of an Expr. */ - interface IExpr { - - /** Expr expression */ - expression?: (string|null); - - /** Expr title */ - title?: (string|null); - - /** Expr description */ - description?: (string|null); - - /** Expr location */ - location?: (string|null); - } - - /** Represents an Expr. */ - class Expr implements IExpr { - - /** - * Constructs a new Expr. - * @param [properties] Properties to set - */ - constructor(properties?: google.type.IExpr); - - /** Expr expression. */ - public expression: string; - - /** Expr title. */ - public title: string; - - /** Expr description. */ - public description: string; - - /** Expr location. */ - public location: string; - - /** - * Creates a new Expr instance using the specified properties. - * @param [properties] Properties to set - * @returns Expr instance - */ - public static create(properties?: google.type.IExpr): google.type.Expr; - - /** - * Encodes the specified Expr message. Does not implicitly {@link google.type.Expr.verify|verify} messages. - * @param message Expr message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.type.IExpr, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Expr message, length delimited. Does not implicitly {@link google.type.Expr.verify|verify} messages. - * @param message Expr message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.type.IExpr, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Expr message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Expr - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.type.Expr; - - /** - * Decodes an Expr message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Expr - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.type.Expr; - - /** - * Verifies an Expr message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Expr message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Expr - */ - public static fromObject(object: { [k: string]: any }): google.type.Expr; - - /** - * Creates a plain object from an Expr message. Also converts values to other types if specified. - * @param message Expr - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.type.Expr, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Expr to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Expr - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } -} diff --git a/owl-bot-staging/executor/v1/protos/protos.js b/owl-bot-staging/executor/v1/protos/protos.js deleted file mode 100644 index 15055efd6..000000000 --- a/owl-bot-staging/executor/v1/protos/protos.js +++ /dev/null @@ -1,104291 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ -(function(global, factory) { /* global define, require, module */ - - /* AMD */ if (typeof define === 'function' && define.amd) - define(["protobufjs/minimal"], factory); - - /* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports) - module.exports = factory(require("google-gax/build/src/protobuf").protobufMinimal); - -})(this, function($protobuf) { - "use strict"; - - // Common aliases - var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; - - // Exported root namespace - var $root = $protobuf.roots._google_cloud_executor_protos || ($protobuf.roots._google_cloud_executor_protos = {}); - - $root.google = (function() { - - /** - * Namespace google. - * @exports google - * @namespace - */ - var google = {}; - - google.spanner = (function() { - - /** - * Namespace spanner. - * @memberof google - * @namespace - */ - var spanner = {}; - - spanner.admin = (function() { - - /** - * Namespace admin. - * @memberof google.spanner - * @namespace - */ - var admin = {}; - - admin.database = (function() { - - /** - * Namespace database. - * @memberof google.spanner.admin - * @namespace - */ - var database = {}; - - database.v1 = (function() { - - /** - * Namespace v1. - * @memberof google.spanner.admin.database - * @namespace - */ - var v1 = {}; - - v1.Backup = (function() { - - /** - * Properties of a Backup. - * @memberof google.spanner.admin.database.v1 - * @interface IBackup - * @property {string|null} [database] Backup database - * @property {google.protobuf.ITimestamp|null} [versionTime] Backup versionTime - * @property {google.protobuf.ITimestamp|null} [expireTime] Backup expireTime - * @property {string|null} [name] Backup name - * @property {google.protobuf.ITimestamp|null} [createTime] Backup createTime - * @property {number|Long|null} [sizeBytes] Backup sizeBytes - * @property {number|Long|null} [freeableSizeBytes] Backup freeableSizeBytes - * @property {number|Long|null} [exclusiveSizeBytes] Backup exclusiveSizeBytes - * @property {google.spanner.admin.database.v1.Backup.State|null} [state] Backup state - * @property {Array.|null} [referencingDatabases] Backup referencingDatabases - * @property {google.spanner.admin.database.v1.IEncryptionInfo|null} [encryptionInfo] Backup encryptionInfo - * @property {Array.|null} [encryptionInformation] Backup encryptionInformation - * @property {google.spanner.admin.database.v1.DatabaseDialect|null} [databaseDialect] Backup databaseDialect - * @property {Array.|null} [referencingBackups] Backup referencingBackups - * @property {google.protobuf.ITimestamp|null} [maxExpireTime] Backup maxExpireTime - * @property {Array.|null} [backupSchedules] Backup backupSchedules - * @property {string|null} [incrementalBackupChainId] Backup incrementalBackupChainId - * @property {google.protobuf.ITimestamp|null} [oldestVersionTime] Backup oldestVersionTime - * @property {Array.|null} [instancePartitions] Backup instancePartitions - */ - - /** - * Constructs a new Backup. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents a Backup. - * @implements IBackup - * @constructor - * @param {google.spanner.admin.database.v1.IBackup=} [properties] Properties to set - */ - function Backup(properties) { - this.referencingDatabases = []; - this.encryptionInformation = []; - this.referencingBackups = []; - this.backupSchedules = []; - this.instancePartitions = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Backup database. - * @member {string} database - * @memberof google.spanner.admin.database.v1.Backup - * @instance - */ - Backup.prototype.database = ""; - - /** - * Backup versionTime. - * @member {google.protobuf.ITimestamp|null|undefined} versionTime - * @memberof google.spanner.admin.database.v1.Backup - * @instance - */ - Backup.prototype.versionTime = null; - - /** - * Backup expireTime. - * @member {google.protobuf.ITimestamp|null|undefined} expireTime - * @memberof google.spanner.admin.database.v1.Backup - * @instance - */ - Backup.prototype.expireTime = null; - - /** - * Backup name. - * @member {string} name - * @memberof google.spanner.admin.database.v1.Backup - * @instance - */ - Backup.prototype.name = ""; - - /** - * Backup createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.spanner.admin.database.v1.Backup - * @instance - */ - Backup.prototype.createTime = null; - - /** - * Backup sizeBytes. - * @member {number|Long} sizeBytes - * @memberof google.spanner.admin.database.v1.Backup - * @instance - */ - Backup.prototype.sizeBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Backup freeableSizeBytes. - * @member {number|Long} freeableSizeBytes - * @memberof google.spanner.admin.database.v1.Backup - * @instance - */ - Backup.prototype.freeableSizeBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Backup exclusiveSizeBytes. - * @member {number|Long} exclusiveSizeBytes - * @memberof google.spanner.admin.database.v1.Backup - * @instance - */ - Backup.prototype.exclusiveSizeBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Backup state. - * @member {google.spanner.admin.database.v1.Backup.State} state - * @memberof google.spanner.admin.database.v1.Backup - * @instance - */ - Backup.prototype.state = 0; - - /** - * Backup referencingDatabases. - * @member {Array.} referencingDatabases - * @memberof google.spanner.admin.database.v1.Backup - * @instance - */ - Backup.prototype.referencingDatabases = $util.emptyArray; - - /** - * Backup encryptionInfo. - * @member {google.spanner.admin.database.v1.IEncryptionInfo|null|undefined} encryptionInfo - * @memberof google.spanner.admin.database.v1.Backup - * @instance - */ - Backup.prototype.encryptionInfo = null; - - /** - * Backup encryptionInformation. - * @member {Array.} encryptionInformation - * @memberof google.spanner.admin.database.v1.Backup - * @instance - */ - Backup.prototype.encryptionInformation = $util.emptyArray; - - /** - * Backup databaseDialect. - * @member {google.spanner.admin.database.v1.DatabaseDialect} databaseDialect - * @memberof google.spanner.admin.database.v1.Backup - * @instance - */ - Backup.prototype.databaseDialect = 0; - - /** - * Backup referencingBackups. - * @member {Array.} referencingBackups - * @memberof google.spanner.admin.database.v1.Backup - * @instance - */ - Backup.prototype.referencingBackups = $util.emptyArray; - - /** - * Backup maxExpireTime. - * @member {google.protobuf.ITimestamp|null|undefined} maxExpireTime - * @memberof google.spanner.admin.database.v1.Backup - * @instance - */ - Backup.prototype.maxExpireTime = null; - - /** - * Backup backupSchedules. - * @member {Array.} backupSchedules - * @memberof google.spanner.admin.database.v1.Backup - * @instance - */ - Backup.prototype.backupSchedules = $util.emptyArray; - - /** - * Backup incrementalBackupChainId. - * @member {string} incrementalBackupChainId - * @memberof google.spanner.admin.database.v1.Backup - * @instance - */ - Backup.prototype.incrementalBackupChainId = ""; - - /** - * Backup oldestVersionTime. - * @member {google.protobuf.ITimestamp|null|undefined} oldestVersionTime - * @memberof google.spanner.admin.database.v1.Backup - * @instance - */ - Backup.prototype.oldestVersionTime = null; - - /** - * Backup instancePartitions. - * @member {Array.} instancePartitions - * @memberof google.spanner.admin.database.v1.Backup - * @instance - */ - Backup.prototype.instancePartitions = $util.emptyArray; - - /** - * Creates a new Backup instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.Backup - * @static - * @param {google.spanner.admin.database.v1.IBackup=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.Backup} Backup instance - */ - Backup.create = function create(properties) { - return new Backup(properties); - }; - - /** - * Encodes the specified Backup message. Does not implicitly {@link google.spanner.admin.database.v1.Backup.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.Backup - * @static - * @param {google.spanner.admin.database.v1.IBackup} message Backup message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Backup.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.database != null && Object.hasOwnProperty.call(message, "database")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.database); - if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) - $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.sizeBytes != null && Object.hasOwnProperty.call(message, "sizeBytes")) - writer.uint32(/* id 5, wireType 0 =*/40).int64(message.sizeBytes); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.state); - if (message.referencingDatabases != null && message.referencingDatabases.length) - for (var i = 0; i < message.referencingDatabases.length; ++i) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.referencingDatabases[i]); - if (message.encryptionInfo != null && Object.hasOwnProperty.call(message, "encryptionInfo")) - $root.google.spanner.admin.database.v1.EncryptionInfo.encode(message.encryptionInfo, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.versionTime != null && Object.hasOwnProperty.call(message, "versionTime")) - $root.google.protobuf.Timestamp.encode(message.versionTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.databaseDialect != null && Object.hasOwnProperty.call(message, "databaseDialect")) - writer.uint32(/* id 10, wireType 0 =*/80).int32(message.databaseDialect); - if (message.referencingBackups != null && message.referencingBackups.length) - for (var i = 0; i < message.referencingBackups.length; ++i) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.referencingBackups[i]); - if (message.maxExpireTime != null && Object.hasOwnProperty.call(message, "maxExpireTime")) - $root.google.protobuf.Timestamp.encode(message.maxExpireTime, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - if (message.encryptionInformation != null && message.encryptionInformation.length) - for (var i = 0; i < message.encryptionInformation.length; ++i) - $root.google.spanner.admin.database.v1.EncryptionInfo.encode(message.encryptionInformation[i], writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); - if (message.backupSchedules != null && message.backupSchedules.length) - for (var i = 0; i < message.backupSchedules.length; ++i) - writer.uint32(/* id 14, wireType 2 =*/114).string(message.backupSchedules[i]); - if (message.freeableSizeBytes != null && Object.hasOwnProperty.call(message, "freeableSizeBytes")) - writer.uint32(/* id 15, wireType 0 =*/120).int64(message.freeableSizeBytes); - if (message.exclusiveSizeBytes != null && Object.hasOwnProperty.call(message, "exclusiveSizeBytes")) - writer.uint32(/* id 16, wireType 0 =*/128).int64(message.exclusiveSizeBytes); - if (message.incrementalBackupChainId != null && Object.hasOwnProperty.call(message, "incrementalBackupChainId")) - writer.uint32(/* id 17, wireType 2 =*/138).string(message.incrementalBackupChainId); - if (message.oldestVersionTime != null && Object.hasOwnProperty.call(message, "oldestVersionTime")) - $root.google.protobuf.Timestamp.encode(message.oldestVersionTime, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); - if (message.instancePartitions != null && message.instancePartitions.length) - for (var i = 0; i < message.instancePartitions.length; ++i) - $root.google.spanner.admin.database.v1.BackupInstancePartition.encode(message.instancePartitions[i], writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Backup message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.Backup.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.Backup - * @static - * @param {google.spanner.admin.database.v1.IBackup} message Backup message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Backup.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Backup message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.Backup - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.Backup} Backup - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Backup.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.Backup(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - message.database = reader.string(); - break; - } - case 9: { - message.versionTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 3: { - message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 1: { - message.name = reader.string(); - break; - } - case 4: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 5: { - message.sizeBytes = reader.int64(); - break; - } - case 15: { - message.freeableSizeBytes = reader.int64(); - break; - } - case 16: { - message.exclusiveSizeBytes = reader.int64(); - break; - } - case 6: { - message.state = reader.int32(); - break; - } - case 7: { - if (!(message.referencingDatabases && message.referencingDatabases.length)) - message.referencingDatabases = []; - message.referencingDatabases.push(reader.string()); - break; - } - case 8: { - message.encryptionInfo = $root.google.spanner.admin.database.v1.EncryptionInfo.decode(reader, reader.uint32()); - break; - } - case 13: { - if (!(message.encryptionInformation && message.encryptionInformation.length)) - message.encryptionInformation = []; - message.encryptionInformation.push($root.google.spanner.admin.database.v1.EncryptionInfo.decode(reader, reader.uint32())); - break; - } - case 10: { - message.databaseDialect = reader.int32(); - break; - } - case 11: { - if (!(message.referencingBackups && message.referencingBackups.length)) - message.referencingBackups = []; - message.referencingBackups.push(reader.string()); - break; - } - case 12: { - message.maxExpireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 14: { - if (!(message.backupSchedules && message.backupSchedules.length)) - message.backupSchedules = []; - message.backupSchedules.push(reader.string()); - break; - } - case 17: { - message.incrementalBackupChainId = reader.string(); - break; - } - case 18: { - message.oldestVersionTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 19: { - if (!(message.instancePartitions && message.instancePartitions.length)) - message.instancePartitions = []; - message.instancePartitions.push($root.google.spanner.admin.database.v1.BackupInstancePartition.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Backup message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.Backup - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.Backup} Backup - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Backup.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Backup message. - * @function verify - * @memberof google.spanner.admin.database.v1.Backup - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Backup.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.database != null && message.hasOwnProperty("database")) - if (!$util.isString(message.database)) - return "database: string expected"; - if (message.versionTime != null && message.hasOwnProperty("versionTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.versionTime); - if (error) - return "versionTime." + error; - } - if (message.expireTime != null && message.hasOwnProperty("expireTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.expireTime); - if (error) - return "expireTime." + error; - } - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.sizeBytes != null && message.hasOwnProperty("sizeBytes")) - if (!$util.isInteger(message.sizeBytes) && !(message.sizeBytes && $util.isInteger(message.sizeBytes.low) && $util.isInteger(message.sizeBytes.high))) - return "sizeBytes: integer|Long expected"; - if (message.freeableSizeBytes != null && message.hasOwnProperty("freeableSizeBytes")) - if (!$util.isInteger(message.freeableSizeBytes) && !(message.freeableSizeBytes && $util.isInteger(message.freeableSizeBytes.low) && $util.isInteger(message.freeableSizeBytes.high))) - return "freeableSizeBytes: integer|Long expected"; - if (message.exclusiveSizeBytes != null && message.hasOwnProperty("exclusiveSizeBytes")) - if (!$util.isInteger(message.exclusiveSizeBytes) && !(message.exclusiveSizeBytes && $util.isInteger(message.exclusiveSizeBytes.low) && $util.isInteger(message.exclusiveSizeBytes.high))) - return "exclusiveSizeBytes: integer|Long expected"; - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.referencingDatabases != null && message.hasOwnProperty("referencingDatabases")) { - if (!Array.isArray(message.referencingDatabases)) - return "referencingDatabases: array expected"; - for (var i = 0; i < message.referencingDatabases.length; ++i) - if (!$util.isString(message.referencingDatabases[i])) - return "referencingDatabases: string[] expected"; - } - if (message.encryptionInfo != null && message.hasOwnProperty("encryptionInfo")) { - var error = $root.google.spanner.admin.database.v1.EncryptionInfo.verify(message.encryptionInfo); - if (error) - return "encryptionInfo." + error; - } - if (message.encryptionInformation != null && message.hasOwnProperty("encryptionInformation")) { - if (!Array.isArray(message.encryptionInformation)) - return "encryptionInformation: array expected"; - for (var i = 0; i < message.encryptionInformation.length; ++i) { - var error = $root.google.spanner.admin.database.v1.EncryptionInfo.verify(message.encryptionInformation[i]); - if (error) - return "encryptionInformation." + error; - } - } - if (message.databaseDialect != null && message.hasOwnProperty("databaseDialect")) - switch (message.databaseDialect) { - default: - return "databaseDialect: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.referencingBackups != null && message.hasOwnProperty("referencingBackups")) { - if (!Array.isArray(message.referencingBackups)) - return "referencingBackups: array expected"; - for (var i = 0; i < message.referencingBackups.length; ++i) - if (!$util.isString(message.referencingBackups[i])) - return "referencingBackups: string[] expected"; - } - if (message.maxExpireTime != null && message.hasOwnProperty("maxExpireTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.maxExpireTime); - if (error) - return "maxExpireTime." + error; - } - if (message.backupSchedules != null && message.hasOwnProperty("backupSchedules")) { - if (!Array.isArray(message.backupSchedules)) - return "backupSchedules: array expected"; - for (var i = 0; i < message.backupSchedules.length; ++i) - if (!$util.isString(message.backupSchedules[i])) - return "backupSchedules: string[] expected"; - } - if (message.incrementalBackupChainId != null && message.hasOwnProperty("incrementalBackupChainId")) - if (!$util.isString(message.incrementalBackupChainId)) - return "incrementalBackupChainId: string expected"; - if (message.oldestVersionTime != null && message.hasOwnProperty("oldestVersionTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.oldestVersionTime); - if (error) - return "oldestVersionTime." + error; - } - if (message.instancePartitions != null && message.hasOwnProperty("instancePartitions")) { - if (!Array.isArray(message.instancePartitions)) - return "instancePartitions: array expected"; - for (var i = 0; i < message.instancePartitions.length; ++i) { - var error = $root.google.spanner.admin.database.v1.BackupInstancePartition.verify(message.instancePartitions[i]); - if (error) - return "instancePartitions." + error; - } - } - return null; - }; - - /** - * Creates a Backup message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.Backup - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.Backup} Backup - */ - Backup.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.Backup) - return object; - var message = new $root.google.spanner.admin.database.v1.Backup(); - if (object.database != null) - message.database = String(object.database); - if (object.versionTime != null) { - if (typeof object.versionTime !== "object") - throw TypeError(".google.spanner.admin.database.v1.Backup.versionTime: object expected"); - message.versionTime = $root.google.protobuf.Timestamp.fromObject(object.versionTime); - } - if (object.expireTime != null) { - if (typeof object.expireTime !== "object") - throw TypeError(".google.spanner.admin.database.v1.Backup.expireTime: object expected"); - message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); - } - if (object.name != null) - message.name = String(object.name); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.spanner.admin.database.v1.Backup.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.sizeBytes != null) - if ($util.Long) - (message.sizeBytes = $util.Long.fromValue(object.sizeBytes)).unsigned = false; - else if (typeof object.sizeBytes === "string") - message.sizeBytes = parseInt(object.sizeBytes, 10); - else if (typeof object.sizeBytes === "number") - message.sizeBytes = object.sizeBytes; - else if (typeof object.sizeBytes === "object") - message.sizeBytes = new $util.LongBits(object.sizeBytes.low >>> 0, object.sizeBytes.high >>> 0).toNumber(); - if (object.freeableSizeBytes != null) - if ($util.Long) - (message.freeableSizeBytes = $util.Long.fromValue(object.freeableSizeBytes)).unsigned = false; - else if (typeof object.freeableSizeBytes === "string") - message.freeableSizeBytes = parseInt(object.freeableSizeBytes, 10); - else if (typeof object.freeableSizeBytes === "number") - message.freeableSizeBytes = object.freeableSizeBytes; - else if (typeof object.freeableSizeBytes === "object") - message.freeableSizeBytes = new $util.LongBits(object.freeableSizeBytes.low >>> 0, object.freeableSizeBytes.high >>> 0).toNumber(); - if (object.exclusiveSizeBytes != null) - if ($util.Long) - (message.exclusiveSizeBytes = $util.Long.fromValue(object.exclusiveSizeBytes)).unsigned = false; - else if (typeof object.exclusiveSizeBytes === "string") - message.exclusiveSizeBytes = parseInt(object.exclusiveSizeBytes, 10); - else if (typeof object.exclusiveSizeBytes === "number") - message.exclusiveSizeBytes = object.exclusiveSizeBytes; - else if (typeof object.exclusiveSizeBytes === "object") - message.exclusiveSizeBytes = new $util.LongBits(object.exclusiveSizeBytes.low >>> 0, object.exclusiveSizeBytes.high >>> 0).toNumber(); - switch (object.state) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "CREATING": - case 1: - message.state = 1; - break; - case "READY": - case 2: - message.state = 2; - break; - } - if (object.referencingDatabases) { - if (!Array.isArray(object.referencingDatabases)) - throw TypeError(".google.spanner.admin.database.v1.Backup.referencingDatabases: array expected"); - message.referencingDatabases = []; - for (var i = 0; i < object.referencingDatabases.length; ++i) - message.referencingDatabases[i] = String(object.referencingDatabases[i]); - } - if (object.encryptionInfo != null) { - if (typeof object.encryptionInfo !== "object") - throw TypeError(".google.spanner.admin.database.v1.Backup.encryptionInfo: object expected"); - message.encryptionInfo = $root.google.spanner.admin.database.v1.EncryptionInfo.fromObject(object.encryptionInfo); - } - if (object.encryptionInformation) { - if (!Array.isArray(object.encryptionInformation)) - throw TypeError(".google.spanner.admin.database.v1.Backup.encryptionInformation: array expected"); - message.encryptionInformation = []; - for (var i = 0; i < object.encryptionInformation.length; ++i) { - if (typeof object.encryptionInformation[i] !== "object") - throw TypeError(".google.spanner.admin.database.v1.Backup.encryptionInformation: object expected"); - message.encryptionInformation[i] = $root.google.spanner.admin.database.v1.EncryptionInfo.fromObject(object.encryptionInformation[i]); - } - } - switch (object.databaseDialect) { - default: - if (typeof object.databaseDialect === "number") { - message.databaseDialect = object.databaseDialect; - break; - } - break; - case "DATABASE_DIALECT_UNSPECIFIED": - case 0: - message.databaseDialect = 0; - break; - case "GOOGLE_STANDARD_SQL": - case 1: - message.databaseDialect = 1; - break; - case "POSTGRESQL": - case 2: - message.databaseDialect = 2; - break; - } - if (object.referencingBackups) { - if (!Array.isArray(object.referencingBackups)) - throw TypeError(".google.spanner.admin.database.v1.Backup.referencingBackups: array expected"); - message.referencingBackups = []; - for (var i = 0; i < object.referencingBackups.length; ++i) - message.referencingBackups[i] = String(object.referencingBackups[i]); - } - if (object.maxExpireTime != null) { - if (typeof object.maxExpireTime !== "object") - throw TypeError(".google.spanner.admin.database.v1.Backup.maxExpireTime: object expected"); - message.maxExpireTime = $root.google.protobuf.Timestamp.fromObject(object.maxExpireTime); - } - if (object.backupSchedules) { - if (!Array.isArray(object.backupSchedules)) - throw TypeError(".google.spanner.admin.database.v1.Backup.backupSchedules: array expected"); - message.backupSchedules = []; - for (var i = 0; i < object.backupSchedules.length; ++i) - message.backupSchedules[i] = String(object.backupSchedules[i]); - } - if (object.incrementalBackupChainId != null) - message.incrementalBackupChainId = String(object.incrementalBackupChainId); - if (object.oldestVersionTime != null) { - if (typeof object.oldestVersionTime !== "object") - throw TypeError(".google.spanner.admin.database.v1.Backup.oldestVersionTime: object expected"); - message.oldestVersionTime = $root.google.protobuf.Timestamp.fromObject(object.oldestVersionTime); - } - if (object.instancePartitions) { - if (!Array.isArray(object.instancePartitions)) - throw TypeError(".google.spanner.admin.database.v1.Backup.instancePartitions: array expected"); - message.instancePartitions = []; - for (var i = 0; i < object.instancePartitions.length; ++i) { - if (typeof object.instancePartitions[i] !== "object") - throw TypeError(".google.spanner.admin.database.v1.Backup.instancePartitions: object expected"); - message.instancePartitions[i] = $root.google.spanner.admin.database.v1.BackupInstancePartition.fromObject(object.instancePartitions[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a Backup message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.Backup - * @static - * @param {google.spanner.admin.database.v1.Backup} message Backup - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Backup.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.referencingDatabases = []; - object.referencingBackups = []; - object.encryptionInformation = []; - object.backupSchedules = []; - object.instancePartitions = []; - } - if (options.defaults) { - object.name = ""; - object.database = ""; - object.expireTime = null; - object.createTime = null; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.sizeBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.sizeBytes = options.longs === String ? "0" : 0; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.encryptionInfo = null; - object.versionTime = null; - object.databaseDialect = options.enums === String ? "DATABASE_DIALECT_UNSPECIFIED" : 0; - object.maxExpireTime = null; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.freeableSizeBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.freeableSizeBytes = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.exclusiveSizeBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.exclusiveSizeBytes = options.longs === String ? "0" : 0; - object.incrementalBackupChainId = ""; - object.oldestVersionTime = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.database != null && message.hasOwnProperty("database")) - object.database = message.database; - if (message.expireTime != null && message.hasOwnProperty("expireTime")) - object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.sizeBytes != null && message.hasOwnProperty("sizeBytes")) - if (typeof message.sizeBytes === "number") - object.sizeBytes = options.longs === String ? String(message.sizeBytes) : message.sizeBytes; - else - object.sizeBytes = options.longs === String ? $util.Long.prototype.toString.call(message.sizeBytes) : options.longs === Number ? new $util.LongBits(message.sizeBytes.low >>> 0, message.sizeBytes.high >>> 0).toNumber() : message.sizeBytes; - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.spanner.admin.database.v1.Backup.State[message.state] === undefined ? message.state : $root.google.spanner.admin.database.v1.Backup.State[message.state] : message.state; - if (message.referencingDatabases && message.referencingDatabases.length) { - object.referencingDatabases = []; - for (var j = 0; j < message.referencingDatabases.length; ++j) - object.referencingDatabases[j] = message.referencingDatabases[j]; - } - if (message.encryptionInfo != null && message.hasOwnProperty("encryptionInfo")) - object.encryptionInfo = $root.google.spanner.admin.database.v1.EncryptionInfo.toObject(message.encryptionInfo, options); - if (message.versionTime != null && message.hasOwnProperty("versionTime")) - object.versionTime = $root.google.protobuf.Timestamp.toObject(message.versionTime, options); - if (message.databaseDialect != null && message.hasOwnProperty("databaseDialect")) - object.databaseDialect = options.enums === String ? $root.google.spanner.admin.database.v1.DatabaseDialect[message.databaseDialect] === undefined ? message.databaseDialect : $root.google.spanner.admin.database.v1.DatabaseDialect[message.databaseDialect] : message.databaseDialect; - if (message.referencingBackups && message.referencingBackups.length) { - object.referencingBackups = []; - for (var j = 0; j < message.referencingBackups.length; ++j) - object.referencingBackups[j] = message.referencingBackups[j]; - } - if (message.maxExpireTime != null && message.hasOwnProperty("maxExpireTime")) - object.maxExpireTime = $root.google.protobuf.Timestamp.toObject(message.maxExpireTime, options); - if (message.encryptionInformation && message.encryptionInformation.length) { - object.encryptionInformation = []; - for (var j = 0; j < message.encryptionInformation.length; ++j) - object.encryptionInformation[j] = $root.google.spanner.admin.database.v1.EncryptionInfo.toObject(message.encryptionInformation[j], options); - } - if (message.backupSchedules && message.backupSchedules.length) { - object.backupSchedules = []; - for (var j = 0; j < message.backupSchedules.length; ++j) - object.backupSchedules[j] = message.backupSchedules[j]; - } - if (message.freeableSizeBytes != null && message.hasOwnProperty("freeableSizeBytes")) - if (typeof message.freeableSizeBytes === "number") - object.freeableSizeBytes = options.longs === String ? String(message.freeableSizeBytes) : message.freeableSizeBytes; - else - object.freeableSizeBytes = options.longs === String ? $util.Long.prototype.toString.call(message.freeableSizeBytes) : options.longs === Number ? new $util.LongBits(message.freeableSizeBytes.low >>> 0, message.freeableSizeBytes.high >>> 0).toNumber() : message.freeableSizeBytes; - if (message.exclusiveSizeBytes != null && message.hasOwnProperty("exclusiveSizeBytes")) - if (typeof message.exclusiveSizeBytes === "number") - object.exclusiveSizeBytes = options.longs === String ? String(message.exclusiveSizeBytes) : message.exclusiveSizeBytes; - else - object.exclusiveSizeBytes = options.longs === String ? $util.Long.prototype.toString.call(message.exclusiveSizeBytes) : options.longs === Number ? new $util.LongBits(message.exclusiveSizeBytes.low >>> 0, message.exclusiveSizeBytes.high >>> 0).toNumber() : message.exclusiveSizeBytes; - if (message.incrementalBackupChainId != null && message.hasOwnProperty("incrementalBackupChainId")) - object.incrementalBackupChainId = message.incrementalBackupChainId; - if (message.oldestVersionTime != null && message.hasOwnProperty("oldestVersionTime")) - object.oldestVersionTime = $root.google.protobuf.Timestamp.toObject(message.oldestVersionTime, options); - if (message.instancePartitions && message.instancePartitions.length) { - object.instancePartitions = []; - for (var j = 0; j < message.instancePartitions.length; ++j) - object.instancePartitions[j] = $root.google.spanner.admin.database.v1.BackupInstancePartition.toObject(message.instancePartitions[j], options); - } - return object; - }; - - /** - * Converts this Backup to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.Backup - * @instance - * @returns {Object.} JSON object - */ - Backup.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Backup - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.Backup - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Backup.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.Backup"; - }; - - /** - * State enum. - * @name google.spanner.admin.database.v1.Backup.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} CREATING=1 CREATING value - * @property {number} READY=2 READY value - */ - Backup.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "CREATING"] = 1; - values[valuesById[2] = "READY"] = 2; - return values; - })(); - - return Backup; - })(); - - v1.CreateBackupRequest = (function() { - - /** - * Properties of a CreateBackupRequest. - * @memberof google.spanner.admin.database.v1 - * @interface ICreateBackupRequest - * @property {string|null} [parent] CreateBackupRequest parent - * @property {string|null} [backupId] CreateBackupRequest backupId - * @property {google.spanner.admin.database.v1.IBackup|null} [backup] CreateBackupRequest backup - * @property {google.spanner.admin.database.v1.ICreateBackupEncryptionConfig|null} [encryptionConfig] CreateBackupRequest encryptionConfig - */ - - /** - * Constructs a new CreateBackupRequest. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents a CreateBackupRequest. - * @implements ICreateBackupRequest - * @constructor - * @param {google.spanner.admin.database.v1.ICreateBackupRequest=} [properties] Properties to set - */ - function CreateBackupRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateBackupRequest parent. - * @member {string} parent - * @memberof google.spanner.admin.database.v1.CreateBackupRequest - * @instance - */ - CreateBackupRequest.prototype.parent = ""; - - /** - * CreateBackupRequest backupId. - * @member {string} backupId - * @memberof google.spanner.admin.database.v1.CreateBackupRequest - * @instance - */ - CreateBackupRequest.prototype.backupId = ""; - - /** - * CreateBackupRequest backup. - * @member {google.spanner.admin.database.v1.IBackup|null|undefined} backup - * @memberof google.spanner.admin.database.v1.CreateBackupRequest - * @instance - */ - CreateBackupRequest.prototype.backup = null; - - /** - * CreateBackupRequest encryptionConfig. - * @member {google.spanner.admin.database.v1.ICreateBackupEncryptionConfig|null|undefined} encryptionConfig - * @memberof google.spanner.admin.database.v1.CreateBackupRequest - * @instance - */ - CreateBackupRequest.prototype.encryptionConfig = null; - - /** - * Creates a new CreateBackupRequest instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.CreateBackupRequest - * @static - * @param {google.spanner.admin.database.v1.ICreateBackupRequest=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.CreateBackupRequest} CreateBackupRequest instance - */ - CreateBackupRequest.create = function create(properties) { - return new CreateBackupRequest(properties); - }; - - /** - * Encodes the specified CreateBackupRequest message. Does not implicitly {@link google.spanner.admin.database.v1.CreateBackupRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.CreateBackupRequest - * @static - * @param {google.spanner.admin.database.v1.ICreateBackupRequest} message CreateBackupRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateBackupRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.backupId != null && Object.hasOwnProperty.call(message, "backupId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.backupId); - if (message.backup != null && Object.hasOwnProperty.call(message, "backup")) - $root.google.spanner.admin.database.v1.Backup.encode(message.backup, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) - $root.google.spanner.admin.database.v1.CreateBackupEncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CreateBackupRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.CreateBackupRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.CreateBackupRequest - * @static - * @param {google.spanner.admin.database.v1.ICreateBackupRequest} message CreateBackupRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateBackupRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.CreateBackupRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.CreateBackupRequest} CreateBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateBackupRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.CreateBackupRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.backupId = reader.string(); - break; - } - case 3: { - message.backup = $root.google.spanner.admin.database.v1.Backup.decode(reader, reader.uint32()); - break; - } - case 4: { - message.encryptionConfig = $root.google.spanner.admin.database.v1.CreateBackupEncryptionConfig.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateBackupRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.CreateBackupRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.CreateBackupRequest} CreateBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateBackupRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateBackupRequest message. - * @function verify - * @memberof google.spanner.admin.database.v1.CreateBackupRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateBackupRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.backupId != null && message.hasOwnProperty("backupId")) - if (!$util.isString(message.backupId)) - return "backupId: string expected"; - if (message.backup != null && message.hasOwnProperty("backup")) { - var error = $root.google.spanner.admin.database.v1.Backup.verify(message.backup); - if (error) - return "backup." + error; - } - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { - var error = $root.google.spanner.admin.database.v1.CreateBackupEncryptionConfig.verify(message.encryptionConfig); - if (error) - return "encryptionConfig." + error; - } - return null; - }; - - /** - * Creates a CreateBackupRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.CreateBackupRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.CreateBackupRequest} CreateBackupRequest - */ - CreateBackupRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.CreateBackupRequest) - return object; - var message = new $root.google.spanner.admin.database.v1.CreateBackupRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.backupId != null) - message.backupId = String(object.backupId); - if (object.backup != null) { - if (typeof object.backup !== "object") - throw TypeError(".google.spanner.admin.database.v1.CreateBackupRequest.backup: object expected"); - message.backup = $root.google.spanner.admin.database.v1.Backup.fromObject(object.backup); - } - if (object.encryptionConfig != null) { - if (typeof object.encryptionConfig !== "object") - throw TypeError(".google.spanner.admin.database.v1.CreateBackupRequest.encryptionConfig: object expected"); - message.encryptionConfig = $root.google.spanner.admin.database.v1.CreateBackupEncryptionConfig.fromObject(object.encryptionConfig); - } - return message; - }; - - /** - * Creates a plain object from a CreateBackupRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.CreateBackupRequest - * @static - * @param {google.spanner.admin.database.v1.CreateBackupRequest} message CreateBackupRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateBackupRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.backupId = ""; - object.backup = null; - object.encryptionConfig = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.backupId != null && message.hasOwnProperty("backupId")) - object.backupId = message.backupId; - if (message.backup != null && message.hasOwnProperty("backup")) - object.backup = $root.google.spanner.admin.database.v1.Backup.toObject(message.backup, options); - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) - object.encryptionConfig = $root.google.spanner.admin.database.v1.CreateBackupEncryptionConfig.toObject(message.encryptionConfig, options); - return object; - }; - - /** - * Converts this CreateBackupRequest to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.CreateBackupRequest - * @instance - * @returns {Object.} JSON object - */ - CreateBackupRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateBackupRequest - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.CreateBackupRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.CreateBackupRequest"; - }; - - return CreateBackupRequest; - })(); - - v1.CreateBackupMetadata = (function() { - - /** - * Properties of a CreateBackupMetadata. - * @memberof google.spanner.admin.database.v1 - * @interface ICreateBackupMetadata - * @property {string|null} [name] CreateBackupMetadata name - * @property {string|null} [database] CreateBackupMetadata database - * @property {google.spanner.admin.database.v1.IOperationProgress|null} [progress] CreateBackupMetadata progress - * @property {google.protobuf.ITimestamp|null} [cancelTime] CreateBackupMetadata cancelTime - */ - - /** - * Constructs a new CreateBackupMetadata. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents a CreateBackupMetadata. - * @implements ICreateBackupMetadata - * @constructor - * @param {google.spanner.admin.database.v1.ICreateBackupMetadata=} [properties] Properties to set - */ - function CreateBackupMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateBackupMetadata name. - * @member {string} name - * @memberof google.spanner.admin.database.v1.CreateBackupMetadata - * @instance - */ - CreateBackupMetadata.prototype.name = ""; - - /** - * CreateBackupMetadata database. - * @member {string} database - * @memberof google.spanner.admin.database.v1.CreateBackupMetadata - * @instance - */ - CreateBackupMetadata.prototype.database = ""; - - /** - * CreateBackupMetadata progress. - * @member {google.spanner.admin.database.v1.IOperationProgress|null|undefined} progress - * @memberof google.spanner.admin.database.v1.CreateBackupMetadata - * @instance - */ - CreateBackupMetadata.prototype.progress = null; - - /** - * CreateBackupMetadata cancelTime. - * @member {google.protobuf.ITimestamp|null|undefined} cancelTime - * @memberof google.spanner.admin.database.v1.CreateBackupMetadata - * @instance - */ - CreateBackupMetadata.prototype.cancelTime = null; - - /** - * Creates a new CreateBackupMetadata instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.CreateBackupMetadata - * @static - * @param {google.spanner.admin.database.v1.ICreateBackupMetadata=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.CreateBackupMetadata} CreateBackupMetadata instance - */ - CreateBackupMetadata.create = function create(properties) { - return new CreateBackupMetadata(properties); - }; - - /** - * Encodes the specified CreateBackupMetadata message. Does not implicitly {@link google.spanner.admin.database.v1.CreateBackupMetadata.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.CreateBackupMetadata - * @static - * @param {google.spanner.admin.database.v1.ICreateBackupMetadata} message CreateBackupMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateBackupMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.database != null && Object.hasOwnProperty.call(message, "database")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.database); - if (message.progress != null && Object.hasOwnProperty.call(message, "progress")) - $root.google.spanner.admin.database.v1.OperationProgress.encode(message.progress, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.cancelTime != null && Object.hasOwnProperty.call(message, "cancelTime")) - $root.google.protobuf.Timestamp.encode(message.cancelTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CreateBackupMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.CreateBackupMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.CreateBackupMetadata - * @static - * @param {google.spanner.admin.database.v1.ICreateBackupMetadata} message CreateBackupMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateBackupMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateBackupMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.CreateBackupMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.CreateBackupMetadata} CreateBackupMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateBackupMetadata.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.CreateBackupMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.database = reader.string(); - break; - } - case 3: { - message.progress = $root.google.spanner.admin.database.v1.OperationProgress.decode(reader, reader.uint32()); - break; - } - case 4: { - message.cancelTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateBackupMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.CreateBackupMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.CreateBackupMetadata} CreateBackupMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateBackupMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateBackupMetadata message. - * @function verify - * @memberof google.spanner.admin.database.v1.CreateBackupMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateBackupMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.database != null && message.hasOwnProperty("database")) - if (!$util.isString(message.database)) - return "database: string expected"; - if (message.progress != null && message.hasOwnProperty("progress")) { - var error = $root.google.spanner.admin.database.v1.OperationProgress.verify(message.progress); - if (error) - return "progress." + error; - } - if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.cancelTime); - if (error) - return "cancelTime." + error; - } - return null; - }; - - /** - * Creates a CreateBackupMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.CreateBackupMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.CreateBackupMetadata} CreateBackupMetadata - */ - CreateBackupMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.CreateBackupMetadata) - return object; - var message = new $root.google.spanner.admin.database.v1.CreateBackupMetadata(); - if (object.name != null) - message.name = String(object.name); - if (object.database != null) - message.database = String(object.database); - if (object.progress != null) { - if (typeof object.progress !== "object") - throw TypeError(".google.spanner.admin.database.v1.CreateBackupMetadata.progress: object expected"); - message.progress = $root.google.spanner.admin.database.v1.OperationProgress.fromObject(object.progress); - } - if (object.cancelTime != null) { - if (typeof object.cancelTime !== "object") - throw TypeError(".google.spanner.admin.database.v1.CreateBackupMetadata.cancelTime: object expected"); - message.cancelTime = $root.google.protobuf.Timestamp.fromObject(object.cancelTime); - } - return message; - }; - - /** - * Creates a plain object from a CreateBackupMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.CreateBackupMetadata - * @static - * @param {google.spanner.admin.database.v1.CreateBackupMetadata} message CreateBackupMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateBackupMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.database = ""; - object.progress = null; - object.cancelTime = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.database != null && message.hasOwnProperty("database")) - object.database = message.database; - if (message.progress != null && message.hasOwnProperty("progress")) - object.progress = $root.google.spanner.admin.database.v1.OperationProgress.toObject(message.progress, options); - if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) - object.cancelTime = $root.google.protobuf.Timestamp.toObject(message.cancelTime, options); - return object; - }; - - /** - * Converts this CreateBackupMetadata to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.CreateBackupMetadata - * @instance - * @returns {Object.} JSON object - */ - CreateBackupMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateBackupMetadata - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.CreateBackupMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateBackupMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.CreateBackupMetadata"; - }; - - return CreateBackupMetadata; - })(); - - v1.CopyBackupRequest = (function() { - - /** - * Properties of a CopyBackupRequest. - * @memberof google.spanner.admin.database.v1 - * @interface ICopyBackupRequest - * @property {string|null} [parent] CopyBackupRequest parent - * @property {string|null} [backupId] CopyBackupRequest backupId - * @property {string|null} [sourceBackup] CopyBackupRequest sourceBackup - * @property {google.protobuf.ITimestamp|null} [expireTime] CopyBackupRequest expireTime - * @property {google.spanner.admin.database.v1.ICopyBackupEncryptionConfig|null} [encryptionConfig] CopyBackupRequest encryptionConfig - */ - - /** - * Constructs a new CopyBackupRequest. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents a CopyBackupRequest. - * @implements ICopyBackupRequest - * @constructor - * @param {google.spanner.admin.database.v1.ICopyBackupRequest=} [properties] Properties to set - */ - function CopyBackupRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CopyBackupRequest parent. - * @member {string} parent - * @memberof google.spanner.admin.database.v1.CopyBackupRequest - * @instance - */ - CopyBackupRequest.prototype.parent = ""; - - /** - * CopyBackupRequest backupId. - * @member {string} backupId - * @memberof google.spanner.admin.database.v1.CopyBackupRequest - * @instance - */ - CopyBackupRequest.prototype.backupId = ""; - - /** - * CopyBackupRequest sourceBackup. - * @member {string} sourceBackup - * @memberof google.spanner.admin.database.v1.CopyBackupRequest - * @instance - */ - CopyBackupRequest.prototype.sourceBackup = ""; - - /** - * CopyBackupRequest expireTime. - * @member {google.protobuf.ITimestamp|null|undefined} expireTime - * @memberof google.spanner.admin.database.v1.CopyBackupRequest - * @instance - */ - CopyBackupRequest.prototype.expireTime = null; - - /** - * CopyBackupRequest encryptionConfig. - * @member {google.spanner.admin.database.v1.ICopyBackupEncryptionConfig|null|undefined} encryptionConfig - * @memberof google.spanner.admin.database.v1.CopyBackupRequest - * @instance - */ - CopyBackupRequest.prototype.encryptionConfig = null; - - /** - * Creates a new CopyBackupRequest instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.CopyBackupRequest - * @static - * @param {google.spanner.admin.database.v1.ICopyBackupRequest=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.CopyBackupRequest} CopyBackupRequest instance - */ - CopyBackupRequest.create = function create(properties) { - return new CopyBackupRequest(properties); - }; - - /** - * Encodes the specified CopyBackupRequest message. Does not implicitly {@link google.spanner.admin.database.v1.CopyBackupRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.CopyBackupRequest - * @static - * @param {google.spanner.admin.database.v1.ICopyBackupRequest} message CopyBackupRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CopyBackupRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.backupId != null && Object.hasOwnProperty.call(message, "backupId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.backupId); - if (message.sourceBackup != null && Object.hasOwnProperty.call(message, "sourceBackup")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.sourceBackup); - if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) - $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) - $root.google.spanner.admin.database.v1.CopyBackupEncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CopyBackupRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.CopyBackupRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.CopyBackupRequest - * @static - * @param {google.spanner.admin.database.v1.ICopyBackupRequest} message CopyBackupRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CopyBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CopyBackupRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.CopyBackupRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.CopyBackupRequest} CopyBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CopyBackupRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.CopyBackupRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.backupId = reader.string(); - break; - } - case 3: { - message.sourceBackup = reader.string(); - break; - } - case 4: { - message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 5: { - message.encryptionConfig = $root.google.spanner.admin.database.v1.CopyBackupEncryptionConfig.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CopyBackupRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.CopyBackupRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.CopyBackupRequest} CopyBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CopyBackupRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CopyBackupRequest message. - * @function verify - * @memberof google.spanner.admin.database.v1.CopyBackupRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CopyBackupRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.backupId != null && message.hasOwnProperty("backupId")) - if (!$util.isString(message.backupId)) - return "backupId: string expected"; - if (message.sourceBackup != null && message.hasOwnProperty("sourceBackup")) - if (!$util.isString(message.sourceBackup)) - return "sourceBackup: string expected"; - if (message.expireTime != null && message.hasOwnProperty("expireTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.expireTime); - if (error) - return "expireTime." + error; - } - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { - var error = $root.google.spanner.admin.database.v1.CopyBackupEncryptionConfig.verify(message.encryptionConfig); - if (error) - return "encryptionConfig." + error; - } - return null; - }; - - /** - * Creates a CopyBackupRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.CopyBackupRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.CopyBackupRequest} CopyBackupRequest - */ - CopyBackupRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.CopyBackupRequest) - return object; - var message = new $root.google.spanner.admin.database.v1.CopyBackupRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.backupId != null) - message.backupId = String(object.backupId); - if (object.sourceBackup != null) - message.sourceBackup = String(object.sourceBackup); - if (object.expireTime != null) { - if (typeof object.expireTime !== "object") - throw TypeError(".google.spanner.admin.database.v1.CopyBackupRequest.expireTime: object expected"); - message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); - } - if (object.encryptionConfig != null) { - if (typeof object.encryptionConfig !== "object") - throw TypeError(".google.spanner.admin.database.v1.CopyBackupRequest.encryptionConfig: object expected"); - message.encryptionConfig = $root.google.spanner.admin.database.v1.CopyBackupEncryptionConfig.fromObject(object.encryptionConfig); - } - return message; - }; - - /** - * Creates a plain object from a CopyBackupRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.CopyBackupRequest - * @static - * @param {google.spanner.admin.database.v1.CopyBackupRequest} message CopyBackupRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CopyBackupRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.backupId = ""; - object.sourceBackup = ""; - object.expireTime = null; - object.encryptionConfig = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.backupId != null && message.hasOwnProperty("backupId")) - object.backupId = message.backupId; - if (message.sourceBackup != null && message.hasOwnProperty("sourceBackup")) - object.sourceBackup = message.sourceBackup; - if (message.expireTime != null && message.hasOwnProperty("expireTime")) - object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) - object.encryptionConfig = $root.google.spanner.admin.database.v1.CopyBackupEncryptionConfig.toObject(message.encryptionConfig, options); - return object; - }; - - /** - * Converts this CopyBackupRequest to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.CopyBackupRequest - * @instance - * @returns {Object.} JSON object - */ - CopyBackupRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CopyBackupRequest - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.CopyBackupRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CopyBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.CopyBackupRequest"; - }; - - return CopyBackupRequest; - })(); - - v1.CopyBackupMetadata = (function() { - - /** - * Properties of a CopyBackupMetadata. - * @memberof google.spanner.admin.database.v1 - * @interface ICopyBackupMetadata - * @property {string|null} [name] CopyBackupMetadata name - * @property {string|null} [sourceBackup] CopyBackupMetadata sourceBackup - * @property {google.spanner.admin.database.v1.IOperationProgress|null} [progress] CopyBackupMetadata progress - * @property {google.protobuf.ITimestamp|null} [cancelTime] CopyBackupMetadata cancelTime - */ - - /** - * Constructs a new CopyBackupMetadata. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents a CopyBackupMetadata. - * @implements ICopyBackupMetadata - * @constructor - * @param {google.spanner.admin.database.v1.ICopyBackupMetadata=} [properties] Properties to set - */ - function CopyBackupMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CopyBackupMetadata name. - * @member {string} name - * @memberof google.spanner.admin.database.v1.CopyBackupMetadata - * @instance - */ - CopyBackupMetadata.prototype.name = ""; - - /** - * CopyBackupMetadata sourceBackup. - * @member {string} sourceBackup - * @memberof google.spanner.admin.database.v1.CopyBackupMetadata - * @instance - */ - CopyBackupMetadata.prototype.sourceBackup = ""; - - /** - * CopyBackupMetadata progress. - * @member {google.spanner.admin.database.v1.IOperationProgress|null|undefined} progress - * @memberof google.spanner.admin.database.v1.CopyBackupMetadata - * @instance - */ - CopyBackupMetadata.prototype.progress = null; - - /** - * CopyBackupMetadata cancelTime. - * @member {google.protobuf.ITimestamp|null|undefined} cancelTime - * @memberof google.spanner.admin.database.v1.CopyBackupMetadata - * @instance - */ - CopyBackupMetadata.prototype.cancelTime = null; - - /** - * Creates a new CopyBackupMetadata instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.CopyBackupMetadata - * @static - * @param {google.spanner.admin.database.v1.ICopyBackupMetadata=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.CopyBackupMetadata} CopyBackupMetadata instance - */ - CopyBackupMetadata.create = function create(properties) { - return new CopyBackupMetadata(properties); - }; - - /** - * Encodes the specified CopyBackupMetadata message. Does not implicitly {@link google.spanner.admin.database.v1.CopyBackupMetadata.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.CopyBackupMetadata - * @static - * @param {google.spanner.admin.database.v1.ICopyBackupMetadata} message CopyBackupMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CopyBackupMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.sourceBackup != null && Object.hasOwnProperty.call(message, "sourceBackup")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceBackup); - if (message.progress != null && Object.hasOwnProperty.call(message, "progress")) - $root.google.spanner.admin.database.v1.OperationProgress.encode(message.progress, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.cancelTime != null && Object.hasOwnProperty.call(message, "cancelTime")) - $root.google.protobuf.Timestamp.encode(message.cancelTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CopyBackupMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.CopyBackupMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.CopyBackupMetadata - * @static - * @param {google.spanner.admin.database.v1.ICopyBackupMetadata} message CopyBackupMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CopyBackupMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CopyBackupMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.CopyBackupMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.CopyBackupMetadata} CopyBackupMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CopyBackupMetadata.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.CopyBackupMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.sourceBackup = reader.string(); - break; - } - case 3: { - message.progress = $root.google.spanner.admin.database.v1.OperationProgress.decode(reader, reader.uint32()); - break; - } - case 4: { - message.cancelTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CopyBackupMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.CopyBackupMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.CopyBackupMetadata} CopyBackupMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CopyBackupMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CopyBackupMetadata message. - * @function verify - * @memberof google.spanner.admin.database.v1.CopyBackupMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CopyBackupMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.sourceBackup != null && message.hasOwnProperty("sourceBackup")) - if (!$util.isString(message.sourceBackup)) - return "sourceBackup: string expected"; - if (message.progress != null && message.hasOwnProperty("progress")) { - var error = $root.google.spanner.admin.database.v1.OperationProgress.verify(message.progress); - if (error) - return "progress." + error; - } - if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.cancelTime); - if (error) - return "cancelTime." + error; - } - return null; - }; - - /** - * Creates a CopyBackupMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.CopyBackupMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.CopyBackupMetadata} CopyBackupMetadata - */ - CopyBackupMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.CopyBackupMetadata) - return object; - var message = new $root.google.spanner.admin.database.v1.CopyBackupMetadata(); - if (object.name != null) - message.name = String(object.name); - if (object.sourceBackup != null) - message.sourceBackup = String(object.sourceBackup); - if (object.progress != null) { - if (typeof object.progress !== "object") - throw TypeError(".google.spanner.admin.database.v1.CopyBackupMetadata.progress: object expected"); - message.progress = $root.google.spanner.admin.database.v1.OperationProgress.fromObject(object.progress); - } - if (object.cancelTime != null) { - if (typeof object.cancelTime !== "object") - throw TypeError(".google.spanner.admin.database.v1.CopyBackupMetadata.cancelTime: object expected"); - message.cancelTime = $root.google.protobuf.Timestamp.fromObject(object.cancelTime); - } - return message; - }; - - /** - * Creates a plain object from a CopyBackupMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.CopyBackupMetadata - * @static - * @param {google.spanner.admin.database.v1.CopyBackupMetadata} message CopyBackupMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CopyBackupMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.sourceBackup = ""; - object.progress = null; - object.cancelTime = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.sourceBackup != null && message.hasOwnProperty("sourceBackup")) - object.sourceBackup = message.sourceBackup; - if (message.progress != null && message.hasOwnProperty("progress")) - object.progress = $root.google.spanner.admin.database.v1.OperationProgress.toObject(message.progress, options); - if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) - object.cancelTime = $root.google.protobuf.Timestamp.toObject(message.cancelTime, options); - return object; - }; - - /** - * Converts this CopyBackupMetadata to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.CopyBackupMetadata - * @instance - * @returns {Object.} JSON object - */ - CopyBackupMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CopyBackupMetadata - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.CopyBackupMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CopyBackupMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.CopyBackupMetadata"; - }; - - return CopyBackupMetadata; - })(); - - v1.UpdateBackupRequest = (function() { - - /** - * Properties of an UpdateBackupRequest. - * @memberof google.spanner.admin.database.v1 - * @interface IUpdateBackupRequest - * @property {google.spanner.admin.database.v1.IBackup|null} [backup] UpdateBackupRequest backup - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateBackupRequest updateMask - */ - - /** - * Constructs a new UpdateBackupRequest. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents an UpdateBackupRequest. - * @implements IUpdateBackupRequest - * @constructor - * @param {google.spanner.admin.database.v1.IUpdateBackupRequest=} [properties] Properties to set - */ - function UpdateBackupRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateBackupRequest backup. - * @member {google.spanner.admin.database.v1.IBackup|null|undefined} backup - * @memberof google.spanner.admin.database.v1.UpdateBackupRequest - * @instance - */ - UpdateBackupRequest.prototype.backup = null; - - /** - * UpdateBackupRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.spanner.admin.database.v1.UpdateBackupRequest - * @instance - */ - UpdateBackupRequest.prototype.updateMask = null; - - /** - * Creates a new UpdateBackupRequest instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.UpdateBackupRequest - * @static - * @param {google.spanner.admin.database.v1.IUpdateBackupRequest=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.UpdateBackupRequest} UpdateBackupRequest instance - */ - UpdateBackupRequest.create = function create(properties) { - return new UpdateBackupRequest(properties); - }; - - /** - * Encodes the specified UpdateBackupRequest message. Does not implicitly {@link google.spanner.admin.database.v1.UpdateBackupRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.UpdateBackupRequest - * @static - * @param {google.spanner.admin.database.v1.IUpdateBackupRequest} message UpdateBackupRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateBackupRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.backup != null && Object.hasOwnProperty.call(message, "backup")) - $root.google.spanner.admin.database.v1.Backup.encode(message.backup, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified UpdateBackupRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.UpdateBackupRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.UpdateBackupRequest - * @static - * @param {google.spanner.admin.database.v1.IUpdateBackupRequest} message UpdateBackupRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateBackupRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.UpdateBackupRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.UpdateBackupRequest} UpdateBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateBackupRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.UpdateBackupRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.backup = $root.google.spanner.admin.database.v1.Backup.decode(reader, reader.uint32()); - break; - } - case 2: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateBackupRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.UpdateBackupRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.UpdateBackupRequest} UpdateBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateBackupRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateBackupRequest message. - * @function verify - * @memberof google.spanner.admin.database.v1.UpdateBackupRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateBackupRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.backup != null && message.hasOwnProperty("backup")) { - var error = $root.google.spanner.admin.database.v1.Backup.verify(message.backup); - if (error) - return "backup." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - return null; - }; - - /** - * Creates an UpdateBackupRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.UpdateBackupRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.UpdateBackupRequest} UpdateBackupRequest - */ - UpdateBackupRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.UpdateBackupRequest) - return object; - var message = new $root.google.spanner.admin.database.v1.UpdateBackupRequest(); - if (object.backup != null) { - if (typeof object.backup !== "object") - throw TypeError(".google.spanner.admin.database.v1.UpdateBackupRequest.backup: object expected"); - message.backup = $root.google.spanner.admin.database.v1.Backup.fromObject(object.backup); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.spanner.admin.database.v1.UpdateBackupRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - return message; - }; - - /** - * Creates a plain object from an UpdateBackupRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.UpdateBackupRequest - * @static - * @param {google.spanner.admin.database.v1.UpdateBackupRequest} message UpdateBackupRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateBackupRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.backup = null; - object.updateMask = null; - } - if (message.backup != null && message.hasOwnProperty("backup")) - object.backup = $root.google.spanner.admin.database.v1.Backup.toObject(message.backup, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - return object; - }; - - /** - * Converts this UpdateBackupRequest to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.UpdateBackupRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateBackupRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateBackupRequest - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.UpdateBackupRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.UpdateBackupRequest"; - }; - - return UpdateBackupRequest; - })(); - - v1.GetBackupRequest = (function() { - - /** - * Properties of a GetBackupRequest. - * @memberof google.spanner.admin.database.v1 - * @interface IGetBackupRequest - * @property {string|null} [name] GetBackupRequest name - */ - - /** - * Constructs a new GetBackupRequest. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents a GetBackupRequest. - * @implements IGetBackupRequest - * @constructor - * @param {google.spanner.admin.database.v1.IGetBackupRequest=} [properties] Properties to set - */ - function GetBackupRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetBackupRequest name. - * @member {string} name - * @memberof google.spanner.admin.database.v1.GetBackupRequest - * @instance - */ - GetBackupRequest.prototype.name = ""; - - /** - * Creates a new GetBackupRequest instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.GetBackupRequest - * @static - * @param {google.spanner.admin.database.v1.IGetBackupRequest=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.GetBackupRequest} GetBackupRequest instance - */ - GetBackupRequest.create = function create(properties) { - return new GetBackupRequest(properties); - }; - - /** - * Encodes the specified GetBackupRequest message. Does not implicitly {@link google.spanner.admin.database.v1.GetBackupRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.GetBackupRequest - * @static - * @param {google.spanner.admin.database.v1.IGetBackupRequest} message GetBackupRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetBackupRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; - - /** - * Encodes the specified GetBackupRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.GetBackupRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.GetBackupRequest - * @static - * @param {google.spanner.admin.database.v1.IGetBackupRequest} message GetBackupRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetBackupRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.GetBackupRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.GetBackupRequest} GetBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetBackupRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.GetBackupRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetBackupRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.GetBackupRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.GetBackupRequest} GetBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetBackupRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetBackupRequest message. - * @function verify - * @memberof google.spanner.admin.database.v1.GetBackupRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetBackupRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; - - /** - * Creates a GetBackupRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.GetBackupRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.GetBackupRequest} GetBackupRequest - */ - GetBackupRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.GetBackupRequest) - return object; - var message = new $root.google.spanner.admin.database.v1.GetBackupRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetBackupRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.GetBackupRequest - * @static - * @param {google.spanner.admin.database.v1.GetBackupRequest} message GetBackupRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetBackupRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; - - /** - * Converts this GetBackupRequest to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.GetBackupRequest - * @instance - * @returns {Object.} JSON object - */ - GetBackupRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetBackupRequest - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.GetBackupRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.GetBackupRequest"; - }; - - return GetBackupRequest; - })(); - - v1.DeleteBackupRequest = (function() { - - /** - * Properties of a DeleteBackupRequest. - * @memberof google.spanner.admin.database.v1 - * @interface IDeleteBackupRequest - * @property {string|null} [name] DeleteBackupRequest name - */ - - /** - * Constructs a new DeleteBackupRequest. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents a DeleteBackupRequest. - * @implements IDeleteBackupRequest - * @constructor - * @param {google.spanner.admin.database.v1.IDeleteBackupRequest=} [properties] Properties to set - */ - function DeleteBackupRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteBackupRequest name. - * @member {string} name - * @memberof google.spanner.admin.database.v1.DeleteBackupRequest - * @instance - */ - DeleteBackupRequest.prototype.name = ""; - - /** - * Creates a new DeleteBackupRequest instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.DeleteBackupRequest - * @static - * @param {google.spanner.admin.database.v1.IDeleteBackupRequest=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.DeleteBackupRequest} DeleteBackupRequest instance - */ - DeleteBackupRequest.create = function create(properties) { - return new DeleteBackupRequest(properties); - }; - - /** - * Encodes the specified DeleteBackupRequest message. Does not implicitly {@link google.spanner.admin.database.v1.DeleteBackupRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.DeleteBackupRequest - * @static - * @param {google.spanner.admin.database.v1.IDeleteBackupRequest} message DeleteBackupRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteBackupRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; - - /** - * Encodes the specified DeleteBackupRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.DeleteBackupRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.DeleteBackupRequest - * @static - * @param {google.spanner.admin.database.v1.IDeleteBackupRequest} message DeleteBackupRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteBackupRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.DeleteBackupRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.DeleteBackupRequest} DeleteBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteBackupRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.DeleteBackupRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteBackupRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.DeleteBackupRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.DeleteBackupRequest} DeleteBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteBackupRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteBackupRequest message. - * @function verify - * @memberof google.spanner.admin.database.v1.DeleteBackupRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteBackupRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; - - /** - * Creates a DeleteBackupRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.DeleteBackupRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.DeleteBackupRequest} DeleteBackupRequest - */ - DeleteBackupRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.DeleteBackupRequest) - return object; - var message = new $root.google.spanner.admin.database.v1.DeleteBackupRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a DeleteBackupRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.DeleteBackupRequest - * @static - * @param {google.spanner.admin.database.v1.DeleteBackupRequest} message DeleteBackupRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteBackupRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; - - /** - * Converts this DeleteBackupRequest to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.DeleteBackupRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteBackupRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteBackupRequest - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.DeleteBackupRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.DeleteBackupRequest"; - }; - - return DeleteBackupRequest; - })(); - - v1.ListBackupsRequest = (function() { - - /** - * Properties of a ListBackupsRequest. - * @memberof google.spanner.admin.database.v1 - * @interface IListBackupsRequest - * @property {string|null} [parent] ListBackupsRequest parent - * @property {string|null} [filter] ListBackupsRequest filter - * @property {number|null} [pageSize] ListBackupsRequest pageSize - * @property {string|null} [pageToken] ListBackupsRequest pageToken - */ - - /** - * Constructs a new ListBackupsRequest. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents a ListBackupsRequest. - * @implements IListBackupsRequest - * @constructor - * @param {google.spanner.admin.database.v1.IListBackupsRequest=} [properties] Properties to set - */ - function ListBackupsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListBackupsRequest parent. - * @member {string} parent - * @memberof google.spanner.admin.database.v1.ListBackupsRequest - * @instance - */ - ListBackupsRequest.prototype.parent = ""; - - /** - * ListBackupsRequest filter. - * @member {string} filter - * @memberof google.spanner.admin.database.v1.ListBackupsRequest - * @instance - */ - ListBackupsRequest.prototype.filter = ""; - - /** - * ListBackupsRequest pageSize. - * @member {number} pageSize - * @memberof google.spanner.admin.database.v1.ListBackupsRequest - * @instance - */ - ListBackupsRequest.prototype.pageSize = 0; - - /** - * ListBackupsRequest pageToken. - * @member {string} pageToken - * @memberof google.spanner.admin.database.v1.ListBackupsRequest - * @instance - */ - ListBackupsRequest.prototype.pageToken = ""; - - /** - * Creates a new ListBackupsRequest instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.ListBackupsRequest - * @static - * @param {google.spanner.admin.database.v1.IListBackupsRequest=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.ListBackupsRequest} ListBackupsRequest instance - */ - ListBackupsRequest.create = function create(properties) { - return new ListBackupsRequest(properties); - }; - - /** - * Encodes the specified ListBackupsRequest message. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupsRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.ListBackupsRequest - * @static - * @param {google.spanner.admin.database.v1.IListBackupsRequest} message ListBackupsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListBackupsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); - return writer; - }; - - /** - * Encodes the specified ListBackupsRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.ListBackupsRequest - * @static - * @param {google.spanner.admin.database.v1.IListBackupsRequest} message ListBackupsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListBackupsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListBackupsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.ListBackupsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.ListBackupsRequest} ListBackupsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListBackupsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.ListBackupsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.filter = reader.string(); - break; - } - case 3: { - message.pageSize = reader.int32(); - break; - } - case 4: { - message.pageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListBackupsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.ListBackupsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.ListBackupsRequest} ListBackupsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListBackupsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListBackupsRequest message. - * @function verify - * @memberof google.spanner.admin.database.v1.ListBackupsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListBackupsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - return null; - }; - - /** - * Creates a ListBackupsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.ListBackupsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.ListBackupsRequest} ListBackupsRequest - */ - ListBackupsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.ListBackupsRequest) - return object; - var message = new $root.google.spanner.admin.database.v1.ListBackupsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.filter != null) - message.filter = String(object.filter); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - return message; - }; - - /** - * Creates a plain object from a ListBackupsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.ListBackupsRequest - * @static - * @param {google.spanner.admin.database.v1.ListBackupsRequest} message ListBackupsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListBackupsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.filter = ""; - object.pageSize = 0; - object.pageToken = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - return object; - }; - - /** - * Converts this ListBackupsRequest to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.ListBackupsRequest - * @instance - * @returns {Object.} JSON object - */ - ListBackupsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListBackupsRequest - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.ListBackupsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListBackupsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.ListBackupsRequest"; - }; - - return ListBackupsRequest; - })(); - - v1.ListBackupsResponse = (function() { - - /** - * Properties of a ListBackupsResponse. - * @memberof google.spanner.admin.database.v1 - * @interface IListBackupsResponse - * @property {Array.|null} [backups] ListBackupsResponse backups - * @property {string|null} [nextPageToken] ListBackupsResponse nextPageToken - */ - - /** - * Constructs a new ListBackupsResponse. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents a ListBackupsResponse. - * @implements IListBackupsResponse - * @constructor - * @param {google.spanner.admin.database.v1.IListBackupsResponse=} [properties] Properties to set - */ - function ListBackupsResponse(properties) { - this.backups = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListBackupsResponse backups. - * @member {Array.} backups - * @memberof google.spanner.admin.database.v1.ListBackupsResponse - * @instance - */ - ListBackupsResponse.prototype.backups = $util.emptyArray; - - /** - * ListBackupsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.spanner.admin.database.v1.ListBackupsResponse - * @instance - */ - ListBackupsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListBackupsResponse instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.ListBackupsResponse - * @static - * @param {google.spanner.admin.database.v1.IListBackupsResponse=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.ListBackupsResponse} ListBackupsResponse instance - */ - ListBackupsResponse.create = function create(properties) { - return new ListBackupsResponse(properties); - }; - - /** - * Encodes the specified ListBackupsResponse message. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupsResponse.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.ListBackupsResponse - * @static - * @param {google.spanner.admin.database.v1.IListBackupsResponse} message ListBackupsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListBackupsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.backups != null && message.backups.length) - for (var i = 0; i < message.backups.length; ++i) - $root.google.spanner.admin.database.v1.Backup.encode(message.backups[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - return writer; - }; - - /** - * Encodes the specified ListBackupsResponse message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.ListBackupsResponse - * @static - * @param {google.spanner.admin.database.v1.IListBackupsResponse} message ListBackupsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListBackupsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListBackupsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.ListBackupsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.ListBackupsResponse} ListBackupsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListBackupsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.ListBackupsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.backups && message.backups.length)) - message.backups = []; - message.backups.push($root.google.spanner.admin.database.v1.Backup.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListBackupsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.ListBackupsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.ListBackupsResponse} ListBackupsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListBackupsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListBackupsResponse message. - * @function verify - * @memberof google.spanner.admin.database.v1.ListBackupsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListBackupsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.backups != null && message.hasOwnProperty("backups")) { - if (!Array.isArray(message.backups)) - return "backups: array expected"; - for (var i = 0; i < message.backups.length; ++i) { - var error = $root.google.spanner.admin.database.v1.Backup.verify(message.backups[i]); - if (error) - return "backups." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListBackupsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.ListBackupsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.ListBackupsResponse} ListBackupsResponse - */ - ListBackupsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.ListBackupsResponse) - return object; - var message = new $root.google.spanner.admin.database.v1.ListBackupsResponse(); - if (object.backups) { - if (!Array.isArray(object.backups)) - throw TypeError(".google.spanner.admin.database.v1.ListBackupsResponse.backups: array expected"); - message.backups = []; - for (var i = 0; i < object.backups.length; ++i) { - if (typeof object.backups[i] !== "object") - throw TypeError(".google.spanner.admin.database.v1.ListBackupsResponse.backups: object expected"); - message.backups[i] = $root.google.spanner.admin.database.v1.Backup.fromObject(object.backups[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListBackupsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.ListBackupsResponse - * @static - * @param {google.spanner.admin.database.v1.ListBackupsResponse} message ListBackupsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListBackupsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.backups = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.backups && message.backups.length) { - object.backups = []; - for (var j = 0; j < message.backups.length; ++j) - object.backups[j] = $root.google.spanner.admin.database.v1.Backup.toObject(message.backups[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListBackupsResponse to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.ListBackupsResponse - * @instance - * @returns {Object.} JSON object - */ - ListBackupsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListBackupsResponse - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.ListBackupsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListBackupsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.ListBackupsResponse"; - }; - - return ListBackupsResponse; - })(); - - v1.ListBackupOperationsRequest = (function() { - - /** - * Properties of a ListBackupOperationsRequest. - * @memberof google.spanner.admin.database.v1 - * @interface IListBackupOperationsRequest - * @property {string|null} [parent] ListBackupOperationsRequest parent - * @property {string|null} [filter] ListBackupOperationsRequest filter - * @property {number|null} [pageSize] ListBackupOperationsRequest pageSize - * @property {string|null} [pageToken] ListBackupOperationsRequest pageToken - */ - - /** - * Constructs a new ListBackupOperationsRequest. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents a ListBackupOperationsRequest. - * @implements IListBackupOperationsRequest - * @constructor - * @param {google.spanner.admin.database.v1.IListBackupOperationsRequest=} [properties] Properties to set - */ - function ListBackupOperationsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListBackupOperationsRequest parent. - * @member {string} parent - * @memberof google.spanner.admin.database.v1.ListBackupOperationsRequest - * @instance - */ - ListBackupOperationsRequest.prototype.parent = ""; - - /** - * ListBackupOperationsRequest filter. - * @member {string} filter - * @memberof google.spanner.admin.database.v1.ListBackupOperationsRequest - * @instance - */ - ListBackupOperationsRequest.prototype.filter = ""; - - /** - * ListBackupOperationsRequest pageSize. - * @member {number} pageSize - * @memberof google.spanner.admin.database.v1.ListBackupOperationsRequest - * @instance - */ - ListBackupOperationsRequest.prototype.pageSize = 0; - - /** - * ListBackupOperationsRequest pageToken. - * @member {string} pageToken - * @memberof google.spanner.admin.database.v1.ListBackupOperationsRequest - * @instance - */ - ListBackupOperationsRequest.prototype.pageToken = ""; - - /** - * Creates a new ListBackupOperationsRequest instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.ListBackupOperationsRequest - * @static - * @param {google.spanner.admin.database.v1.IListBackupOperationsRequest=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.ListBackupOperationsRequest} ListBackupOperationsRequest instance - */ - ListBackupOperationsRequest.create = function create(properties) { - return new ListBackupOperationsRequest(properties); - }; - - /** - * Encodes the specified ListBackupOperationsRequest message. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupOperationsRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.ListBackupOperationsRequest - * @static - * @param {google.spanner.admin.database.v1.IListBackupOperationsRequest} message ListBackupOperationsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListBackupOperationsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); - return writer; - }; - - /** - * Encodes the specified ListBackupOperationsRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupOperationsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.ListBackupOperationsRequest - * @static - * @param {google.spanner.admin.database.v1.IListBackupOperationsRequest} message ListBackupOperationsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListBackupOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListBackupOperationsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.ListBackupOperationsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.ListBackupOperationsRequest} ListBackupOperationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListBackupOperationsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.ListBackupOperationsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.filter = reader.string(); - break; - } - case 3: { - message.pageSize = reader.int32(); - break; - } - case 4: { - message.pageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListBackupOperationsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.ListBackupOperationsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.ListBackupOperationsRequest} ListBackupOperationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListBackupOperationsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListBackupOperationsRequest message. - * @function verify - * @memberof google.spanner.admin.database.v1.ListBackupOperationsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListBackupOperationsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.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 ListBackupOperationsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.ListBackupOperationsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.ListBackupOperationsRequest} ListBackupOperationsRequest - */ - ListBackupOperationsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.ListBackupOperationsRequest) - return object; - var message = new $root.google.spanner.admin.database.v1.ListBackupOperationsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.filter != null) - message.filter = String(object.filter); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - return message; - }; - - /** - * Creates a plain object from a ListBackupOperationsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.ListBackupOperationsRequest - * @static - * @param {google.spanner.admin.database.v1.ListBackupOperationsRequest} message ListBackupOperationsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListBackupOperationsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.filter = ""; - object.pageSize = 0; - object.pageToken = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - return object; - }; - - /** - * Converts this ListBackupOperationsRequest to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.ListBackupOperationsRequest - * @instance - * @returns {Object.} JSON object - */ - ListBackupOperationsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListBackupOperationsRequest - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.ListBackupOperationsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListBackupOperationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.ListBackupOperationsRequest"; - }; - - return ListBackupOperationsRequest; - })(); - - v1.ListBackupOperationsResponse = (function() { - - /** - * Properties of a ListBackupOperationsResponse. - * @memberof google.spanner.admin.database.v1 - * @interface IListBackupOperationsResponse - * @property {Array.|null} [operations] ListBackupOperationsResponse operations - * @property {string|null} [nextPageToken] ListBackupOperationsResponse nextPageToken - */ - - /** - * Constructs a new ListBackupOperationsResponse. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents a ListBackupOperationsResponse. - * @implements IListBackupOperationsResponse - * @constructor - * @param {google.spanner.admin.database.v1.IListBackupOperationsResponse=} [properties] Properties to set - */ - function ListBackupOperationsResponse(properties) { - this.operations = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListBackupOperationsResponse operations. - * @member {Array.} operations - * @memberof google.spanner.admin.database.v1.ListBackupOperationsResponse - * @instance - */ - ListBackupOperationsResponse.prototype.operations = $util.emptyArray; - - /** - * ListBackupOperationsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.spanner.admin.database.v1.ListBackupOperationsResponse - * @instance - */ - ListBackupOperationsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListBackupOperationsResponse instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.ListBackupOperationsResponse - * @static - * @param {google.spanner.admin.database.v1.IListBackupOperationsResponse=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.ListBackupOperationsResponse} ListBackupOperationsResponse instance - */ - ListBackupOperationsResponse.create = function create(properties) { - return new ListBackupOperationsResponse(properties); - }; - - /** - * Encodes the specified ListBackupOperationsResponse message. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupOperationsResponse.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.ListBackupOperationsResponse - * @static - * @param {google.spanner.admin.database.v1.IListBackupOperationsResponse} message ListBackupOperationsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListBackupOperationsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.operations != null && message.operations.length) - for (var i = 0; i < message.operations.length; ++i) - $root.google.longrunning.Operation.encode(message.operations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - return writer; - }; - - /** - * Encodes the specified ListBackupOperationsResponse message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupOperationsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.ListBackupOperationsResponse - * @static - * @param {google.spanner.admin.database.v1.IListBackupOperationsResponse} message ListBackupOperationsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListBackupOperationsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListBackupOperationsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.ListBackupOperationsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.ListBackupOperationsResponse} ListBackupOperationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListBackupOperationsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.ListBackupOperationsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.operations && message.operations.length)) - message.operations = []; - message.operations.push($root.google.longrunning.Operation.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListBackupOperationsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.ListBackupOperationsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.ListBackupOperationsResponse} ListBackupOperationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListBackupOperationsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListBackupOperationsResponse message. - * @function verify - * @memberof google.spanner.admin.database.v1.ListBackupOperationsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListBackupOperationsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.operations != null && message.hasOwnProperty("operations")) { - if (!Array.isArray(message.operations)) - return "operations: array expected"; - for (var i = 0; i < message.operations.length; ++i) { - var error = $root.google.longrunning.Operation.verify(message.operations[i]); - if (error) - return "operations." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListBackupOperationsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.ListBackupOperationsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.ListBackupOperationsResponse} ListBackupOperationsResponse - */ - ListBackupOperationsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.ListBackupOperationsResponse) - return object; - var message = new $root.google.spanner.admin.database.v1.ListBackupOperationsResponse(); - if (object.operations) { - if (!Array.isArray(object.operations)) - throw TypeError(".google.spanner.admin.database.v1.ListBackupOperationsResponse.operations: array expected"); - message.operations = []; - for (var i = 0; i < object.operations.length; ++i) { - if (typeof object.operations[i] !== "object") - throw TypeError(".google.spanner.admin.database.v1.ListBackupOperationsResponse.operations: object expected"); - message.operations[i] = $root.google.longrunning.Operation.fromObject(object.operations[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListBackupOperationsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.ListBackupOperationsResponse - * @static - * @param {google.spanner.admin.database.v1.ListBackupOperationsResponse} message ListBackupOperationsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListBackupOperationsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.operations = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.operations && message.operations.length) { - object.operations = []; - for (var j = 0; j < message.operations.length; ++j) - object.operations[j] = $root.google.longrunning.Operation.toObject(message.operations[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListBackupOperationsResponse to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.ListBackupOperationsResponse - * @instance - * @returns {Object.} JSON object - */ - ListBackupOperationsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListBackupOperationsResponse - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.ListBackupOperationsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListBackupOperationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.ListBackupOperationsResponse"; - }; - - return ListBackupOperationsResponse; - })(); - - v1.BackupInfo = (function() { - - /** - * Properties of a BackupInfo. - * @memberof google.spanner.admin.database.v1 - * @interface IBackupInfo - * @property {string|null} [backup] BackupInfo backup - * @property {google.protobuf.ITimestamp|null} [versionTime] BackupInfo versionTime - * @property {google.protobuf.ITimestamp|null} [createTime] BackupInfo createTime - * @property {string|null} [sourceDatabase] BackupInfo sourceDatabase - */ - - /** - * Constructs a new BackupInfo. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents a BackupInfo. - * @implements IBackupInfo - * @constructor - * @param {google.spanner.admin.database.v1.IBackupInfo=} [properties] Properties to set - */ - function BackupInfo(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BackupInfo backup. - * @member {string} backup - * @memberof google.spanner.admin.database.v1.BackupInfo - * @instance - */ - BackupInfo.prototype.backup = ""; - - /** - * BackupInfo versionTime. - * @member {google.protobuf.ITimestamp|null|undefined} versionTime - * @memberof google.spanner.admin.database.v1.BackupInfo - * @instance - */ - BackupInfo.prototype.versionTime = null; - - /** - * BackupInfo createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.spanner.admin.database.v1.BackupInfo - * @instance - */ - BackupInfo.prototype.createTime = null; - - /** - * BackupInfo sourceDatabase. - * @member {string} sourceDatabase - * @memberof google.spanner.admin.database.v1.BackupInfo - * @instance - */ - BackupInfo.prototype.sourceDatabase = ""; - - /** - * Creates a new BackupInfo instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.BackupInfo - * @static - * @param {google.spanner.admin.database.v1.IBackupInfo=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.BackupInfo} BackupInfo instance - */ - BackupInfo.create = function create(properties) { - return new BackupInfo(properties); - }; - - /** - * Encodes the specified BackupInfo message. Does not implicitly {@link google.spanner.admin.database.v1.BackupInfo.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.BackupInfo - * @static - * @param {google.spanner.admin.database.v1.IBackupInfo} message BackupInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BackupInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.backup != null && Object.hasOwnProperty.call(message, "backup")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.backup); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.sourceDatabase != null && Object.hasOwnProperty.call(message, "sourceDatabase")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.sourceDatabase); - if (message.versionTime != null && Object.hasOwnProperty.call(message, "versionTime")) - $root.google.protobuf.Timestamp.encode(message.versionTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified BackupInfo message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.BackupInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.BackupInfo - * @static - * @param {google.spanner.admin.database.v1.IBackupInfo} message BackupInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BackupInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BackupInfo message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.BackupInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.BackupInfo} BackupInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BackupInfo.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.BackupInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.backup = reader.string(); - break; - } - case 4: { - message.versionTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 2: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 3: { - message.sourceDatabase = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BackupInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.BackupInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.BackupInfo} BackupInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BackupInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BackupInfo message. - * @function verify - * @memberof google.spanner.admin.database.v1.BackupInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BackupInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.backup != null && message.hasOwnProperty("backup")) - if (!$util.isString(message.backup)) - return "backup: string expected"; - if (message.versionTime != null && message.hasOwnProperty("versionTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.versionTime); - if (error) - return "versionTime." + error; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.sourceDatabase != null && message.hasOwnProperty("sourceDatabase")) - if (!$util.isString(message.sourceDatabase)) - return "sourceDatabase: string expected"; - return null; - }; - - /** - * Creates a BackupInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.BackupInfo - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.BackupInfo} BackupInfo - */ - BackupInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.BackupInfo) - return object; - var message = new $root.google.spanner.admin.database.v1.BackupInfo(); - if (object.backup != null) - message.backup = String(object.backup); - if (object.versionTime != null) { - if (typeof object.versionTime !== "object") - throw TypeError(".google.spanner.admin.database.v1.BackupInfo.versionTime: object expected"); - message.versionTime = $root.google.protobuf.Timestamp.fromObject(object.versionTime); - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.spanner.admin.database.v1.BackupInfo.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.sourceDatabase != null) - message.sourceDatabase = String(object.sourceDatabase); - return message; - }; - - /** - * Creates a plain object from a BackupInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.BackupInfo - * @static - * @param {google.spanner.admin.database.v1.BackupInfo} message BackupInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BackupInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.backup = ""; - object.createTime = null; - object.sourceDatabase = ""; - object.versionTime = null; - } - if (message.backup != null && message.hasOwnProperty("backup")) - object.backup = message.backup; - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.sourceDatabase != null && message.hasOwnProperty("sourceDatabase")) - object.sourceDatabase = message.sourceDatabase; - if (message.versionTime != null && message.hasOwnProperty("versionTime")) - object.versionTime = $root.google.protobuf.Timestamp.toObject(message.versionTime, options); - return object; - }; - - /** - * Converts this BackupInfo to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.BackupInfo - * @instance - * @returns {Object.} JSON object - */ - BackupInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BackupInfo - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.BackupInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BackupInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.BackupInfo"; - }; - - return BackupInfo; - })(); - - v1.CreateBackupEncryptionConfig = (function() { - - /** - * Properties of a CreateBackupEncryptionConfig. - * @memberof google.spanner.admin.database.v1 - * @interface ICreateBackupEncryptionConfig - * @property {google.spanner.admin.database.v1.CreateBackupEncryptionConfig.EncryptionType|null} [encryptionType] CreateBackupEncryptionConfig encryptionType - * @property {string|null} [kmsKeyName] CreateBackupEncryptionConfig kmsKeyName - * @property {Array.|null} [kmsKeyNames] CreateBackupEncryptionConfig kmsKeyNames - */ - - /** - * Constructs a new CreateBackupEncryptionConfig. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents a CreateBackupEncryptionConfig. - * @implements ICreateBackupEncryptionConfig - * @constructor - * @param {google.spanner.admin.database.v1.ICreateBackupEncryptionConfig=} [properties] Properties to set - */ - function CreateBackupEncryptionConfig(properties) { - this.kmsKeyNames = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateBackupEncryptionConfig encryptionType. - * @member {google.spanner.admin.database.v1.CreateBackupEncryptionConfig.EncryptionType} encryptionType - * @memberof google.spanner.admin.database.v1.CreateBackupEncryptionConfig - * @instance - */ - CreateBackupEncryptionConfig.prototype.encryptionType = 0; - - /** - * CreateBackupEncryptionConfig kmsKeyName. - * @member {string} kmsKeyName - * @memberof google.spanner.admin.database.v1.CreateBackupEncryptionConfig - * @instance - */ - CreateBackupEncryptionConfig.prototype.kmsKeyName = ""; - - /** - * CreateBackupEncryptionConfig kmsKeyNames. - * @member {Array.} kmsKeyNames - * @memberof google.spanner.admin.database.v1.CreateBackupEncryptionConfig - * @instance - */ - CreateBackupEncryptionConfig.prototype.kmsKeyNames = $util.emptyArray; - - /** - * Creates a new CreateBackupEncryptionConfig instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.CreateBackupEncryptionConfig - * @static - * @param {google.spanner.admin.database.v1.ICreateBackupEncryptionConfig=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.CreateBackupEncryptionConfig} CreateBackupEncryptionConfig instance - */ - CreateBackupEncryptionConfig.create = function create(properties) { - return new CreateBackupEncryptionConfig(properties); - }; - - /** - * Encodes the specified CreateBackupEncryptionConfig message. Does not implicitly {@link google.spanner.admin.database.v1.CreateBackupEncryptionConfig.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.CreateBackupEncryptionConfig - * @static - * @param {google.spanner.admin.database.v1.ICreateBackupEncryptionConfig} message CreateBackupEncryptionConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateBackupEncryptionConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.encryptionType != null && Object.hasOwnProperty.call(message, "encryptionType")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.encryptionType); - if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.kmsKeyName); - if (message.kmsKeyNames != null && message.kmsKeyNames.length) - for (var i = 0; i < message.kmsKeyNames.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.kmsKeyNames[i]); - return writer; - }; - - /** - * Encodes the specified CreateBackupEncryptionConfig message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.CreateBackupEncryptionConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.CreateBackupEncryptionConfig - * @static - * @param {google.spanner.admin.database.v1.ICreateBackupEncryptionConfig} message CreateBackupEncryptionConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateBackupEncryptionConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateBackupEncryptionConfig message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.CreateBackupEncryptionConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.CreateBackupEncryptionConfig} CreateBackupEncryptionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateBackupEncryptionConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.CreateBackupEncryptionConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.encryptionType = reader.int32(); - break; - } - case 2: { - message.kmsKeyName = reader.string(); - break; - } - case 3: { - if (!(message.kmsKeyNames && message.kmsKeyNames.length)) - message.kmsKeyNames = []; - message.kmsKeyNames.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateBackupEncryptionConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.CreateBackupEncryptionConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.CreateBackupEncryptionConfig} CreateBackupEncryptionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateBackupEncryptionConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateBackupEncryptionConfig message. - * @function verify - * @memberof google.spanner.admin.database.v1.CreateBackupEncryptionConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateBackupEncryptionConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.encryptionType != null && message.hasOwnProperty("encryptionType")) - switch (message.encryptionType) { - default: - return "encryptionType: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) - if (!$util.isString(message.kmsKeyName)) - return "kmsKeyName: string expected"; - if (message.kmsKeyNames != null && message.hasOwnProperty("kmsKeyNames")) { - if (!Array.isArray(message.kmsKeyNames)) - return "kmsKeyNames: array expected"; - for (var i = 0; i < message.kmsKeyNames.length; ++i) - if (!$util.isString(message.kmsKeyNames[i])) - return "kmsKeyNames: string[] expected"; - } - return null; - }; - - /** - * Creates a CreateBackupEncryptionConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.CreateBackupEncryptionConfig - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.CreateBackupEncryptionConfig} CreateBackupEncryptionConfig - */ - CreateBackupEncryptionConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.CreateBackupEncryptionConfig) - return object; - var message = new $root.google.spanner.admin.database.v1.CreateBackupEncryptionConfig(); - switch (object.encryptionType) { - default: - if (typeof object.encryptionType === "number") { - message.encryptionType = object.encryptionType; - break; - } - break; - case "ENCRYPTION_TYPE_UNSPECIFIED": - case 0: - message.encryptionType = 0; - break; - case "USE_DATABASE_ENCRYPTION": - case 1: - message.encryptionType = 1; - break; - case "GOOGLE_DEFAULT_ENCRYPTION": - case 2: - message.encryptionType = 2; - break; - case "CUSTOMER_MANAGED_ENCRYPTION": - case 3: - message.encryptionType = 3; - break; - } - if (object.kmsKeyName != null) - message.kmsKeyName = String(object.kmsKeyName); - if (object.kmsKeyNames) { - if (!Array.isArray(object.kmsKeyNames)) - throw TypeError(".google.spanner.admin.database.v1.CreateBackupEncryptionConfig.kmsKeyNames: array expected"); - message.kmsKeyNames = []; - for (var i = 0; i < object.kmsKeyNames.length; ++i) - message.kmsKeyNames[i] = String(object.kmsKeyNames[i]); - } - return message; - }; - - /** - * Creates a plain object from a CreateBackupEncryptionConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.CreateBackupEncryptionConfig - * @static - * @param {google.spanner.admin.database.v1.CreateBackupEncryptionConfig} message CreateBackupEncryptionConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateBackupEncryptionConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.kmsKeyNames = []; - if (options.defaults) { - object.encryptionType = options.enums === String ? "ENCRYPTION_TYPE_UNSPECIFIED" : 0; - object.kmsKeyName = ""; - } - if (message.encryptionType != null && message.hasOwnProperty("encryptionType")) - object.encryptionType = options.enums === String ? $root.google.spanner.admin.database.v1.CreateBackupEncryptionConfig.EncryptionType[message.encryptionType] === undefined ? message.encryptionType : $root.google.spanner.admin.database.v1.CreateBackupEncryptionConfig.EncryptionType[message.encryptionType] : message.encryptionType; - if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) - object.kmsKeyName = message.kmsKeyName; - if (message.kmsKeyNames && message.kmsKeyNames.length) { - object.kmsKeyNames = []; - for (var j = 0; j < message.kmsKeyNames.length; ++j) - object.kmsKeyNames[j] = message.kmsKeyNames[j]; - } - return object; - }; - - /** - * Converts this CreateBackupEncryptionConfig to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.CreateBackupEncryptionConfig - * @instance - * @returns {Object.} JSON object - */ - CreateBackupEncryptionConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateBackupEncryptionConfig - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.CreateBackupEncryptionConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateBackupEncryptionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.CreateBackupEncryptionConfig"; - }; - - /** - * EncryptionType enum. - * @name google.spanner.admin.database.v1.CreateBackupEncryptionConfig.EncryptionType - * @enum {number} - * @property {number} ENCRYPTION_TYPE_UNSPECIFIED=0 ENCRYPTION_TYPE_UNSPECIFIED value - * @property {number} USE_DATABASE_ENCRYPTION=1 USE_DATABASE_ENCRYPTION value - * @property {number} GOOGLE_DEFAULT_ENCRYPTION=2 GOOGLE_DEFAULT_ENCRYPTION value - * @property {number} CUSTOMER_MANAGED_ENCRYPTION=3 CUSTOMER_MANAGED_ENCRYPTION value - */ - CreateBackupEncryptionConfig.EncryptionType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ENCRYPTION_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "USE_DATABASE_ENCRYPTION"] = 1; - values[valuesById[2] = "GOOGLE_DEFAULT_ENCRYPTION"] = 2; - values[valuesById[3] = "CUSTOMER_MANAGED_ENCRYPTION"] = 3; - return values; - })(); - - return CreateBackupEncryptionConfig; - })(); - - v1.CopyBackupEncryptionConfig = (function() { - - /** - * Properties of a CopyBackupEncryptionConfig. - * @memberof google.spanner.admin.database.v1 - * @interface ICopyBackupEncryptionConfig - * @property {google.spanner.admin.database.v1.CopyBackupEncryptionConfig.EncryptionType|null} [encryptionType] CopyBackupEncryptionConfig encryptionType - * @property {string|null} [kmsKeyName] CopyBackupEncryptionConfig kmsKeyName - * @property {Array.|null} [kmsKeyNames] CopyBackupEncryptionConfig kmsKeyNames - */ - - /** - * Constructs a new CopyBackupEncryptionConfig. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents a CopyBackupEncryptionConfig. - * @implements ICopyBackupEncryptionConfig - * @constructor - * @param {google.spanner.admin.database.v1.ICopyBackupEncryptionConfig=} [properties] Properties to set - */ - function CopyBackupEncryptionConfig(properties) { - this.kmsKeyNames = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CopyBackupEncryptionConfig encryptionType. - * @member {google.spanner.admin.database.v1.CopyBackupEncryptionConfig.EncryptionType} encryptionType - * @memberof google.spanner.admin.database.v1.CopyBackupEncryptionConfig - * @instance - */ - CopyBackupEncryptionConfig.prototype.encryptionType = 0; - - /** - * CopyBackupEncryptionConfig kmsKeyName. - * @member {string} kmsKeyName - * @memberof google.spanner.admin.database.v1.CopyBackupEncryptionConfig - * @instance - */ - CopyBackupEncryptionConfig.prototype.kmsKeyName = ""; - - /** - * CopyBackupEncryptionConfig kmsKeyNames. - * @member {Array.} kmsKeyNames - * @memberof google.spanner.admin.database.v1.CopyBackupEncryptionConfig - * @instance - */ - CopyBackupEncryptionConfig.prototype.kmsKeyNames = $util.emptyArray; - - /** - * Creates a new CopyBackupEncryptionConfig instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.CopyBackupEncryptionConfig - * @static - * @param {google.spanner.admin.database.v1.ICopyBackupEncryptionConfig=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.CopyBackupEncryptionConfig} CopyBackupEncryptionConfig instance - */ - CopyBackupEncryptionConfig.create = function create(properties) { - return new CopyBackupEncryptionConfig(properties); - }; - - /** - * Encodes the specified CopyBackupEncryptionConfig message. Does not implicitly {@link google.spanner.admin.database.v1.CopyBackupEncryptionConfig.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.CopyBackupEncryptionConfig - * @static - * @param {google.spanner.admin.database.v1.ICopyBackupEncryptionConfig} message CopyBackupEncryptionConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CopyBackupEncryptionConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.encryptionType != null && Object.hasOwnProperty.call(message, "encryptionType")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.encryptionType); - if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.kmsKeyName); - if (message.kmsKeyNames != null && message.kmsKeyNames.length) - for (var i = 0; i < message.kmsKeyNames.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.kmsKeyNames[i]); - return writer; - }; - - /** - * Encodes the specified CopyBackupEncryptionConfig message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.CopyBackupEncryptionConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.CopyBackupEncryptionConfig - * @static - * @param {google.spanner.admin.database.v1.ICopyBackupEncryptionConfig} message CopyBackupEncryptionConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CopyBackupEncryptionConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CopyBackupEncryptionConfig message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.CopyBackupEncryptionConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.CopyBackupEncryptionConfig} CopyBackupEncryptionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CopyBackupEncryptionConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.CopyBackupEncryptionConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.encryptionType = reader.int32(); - break; - } - case 2: { - message.kmsKeyName = reader.string(); - break; - } - case 3: { - if (!(message.kmsKeyNames && message.kmsKeyNames.length)) - message.kmsKeyNames = []; - message.kmsKeyNames.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CopyBackupEncryptionConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.CopyBackupEncryptionConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.CopyBackupEncryptionConfig} CopyBackupEncryptionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CopyBackupEncryptionConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CopyBackupEncryptionConfig message. - * @function verify - * @memberof google.spanner.admin.database.v1.CopyBackupEncryptionConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CopyBackupEncryptionConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.encryptionType != null && message.hasOwnProperty("encryptionType")) - switch (message.encryptionType) { - default: - return "encryptionType: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) - if (!$util.isString(message.kmsKeyName)) - return "kmsKeyName: string expected"; - if (message.kmsKeyNames != null && message.hasOwnProperty("kmsKeyNames")) { - if (!Array.isArray(message.kmsKeyNames)) - return "kmsKeyNames: array expected"; - for (var i = 0; i < message.kmsKeyNames.length; ++i) - if (!$util.isString(message.kmsKeyNames[i])) - return "kmsKeyNames: string[] expected"; - } - return null; - }; - - /** - * Creates a CopyBackupEncryptionConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.CopyBackupEncryptionConfig - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.CopyBackupEncryptionConfig} CopyBackupEncryptionConfig - */ - CopyBackupEncryptionConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.CopyBackupEncryptionConfig) - return object; - var message = new $root.google.spanner.admin.database.v1.CopyBackupEncryptionConfig(); - switch (object.encryptionType) { - default: - if (typeof object.encryptionType === "number") { - message.encryptionType = object.encryptionType; - break; - } - break; - case "ENCRYPTION_TYPE_UNSPECIFIED": - case 0: - message.encryptionType = 0; - break; - case "USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION": - case 1: - message.encryptionType = 1; - break; - case "GOOGLE_DEFAULT_ENCRYPTION": - case 2: - message.encryptionType = 2; - break; - case "CUSTOMER_MANAGED_ENCRYPTION": - case 3: - message.encryptionType = 3; - break; - } - if (object.kmsKeyName != null) - message.kmsKeyName = String(object.kmsKeyName); - if (object.kmsKeyNames) { - if (!Array.isArray(object.kmsKeyNames)) - throw TypeError(".google.spanner.admin.database.v1.CopyBackupEncryptionConfig.kmsKeyNames: array expected"); - message.kmsKeyNames = []; - for (var i = 0; i < object.kmsKeyNames.length; ++i) - message.kmsKeyNames[i] = String(object.kmsKeyNames[i]); - } - return message; - }; - - /** - * Creates a plain object from a CopyBackupEncryptionConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.CopyBackupEncryptionConfig - * @static - * @param {google.spanner.admin.database.v1.CopyBackupEncryptionConfig} message CopyBackupEncryptionConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CopyBackupEncryptionConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.kmsKeyNames = []; - if (options.defaults) { - object.encryptionType = options.enums === String ? "ENCRYPTION_TYPE_UNSPECIFIED" : 0; - object.kmsKeyName = ""; - } - if (message.encryptionType != null && message.hasOwnProperty("encryptionType")) - object.encryptionType = options.enums === String ? $root.google.spanner.admin.database.v1.CopyBackupEncryptionConfig.EncryptionType[message.encryptionType] === undefined ? message.encryptionType : $root.google.spanner.admin.database.v1.CopyBackupEncryptionConfig.EncryptionType[message.encryptionType] : message.encryptionType; - if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) - object.kmsKeyName = message.kmsKeyName; - if (message.kmsKeyNames && message.kmsKeyNames.length) { - object.kmsKeyNames = []; - for (var j = 0; j < message.kmsKeyNames.length; ++j) - object.kmsKeyNames[j] = message.kmsKeyNames[j]; - } - return object; - }; - - /** - * Converts this CopyBackupEncryptionConfig to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.CopyBackupEncryptionConfig - * @instance - * @returns {Object.} JSON object - */ - CopyBackupEncryptionConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CopyBackupEncryptionConfig - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.CopyBackupEncryptionConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CopyBackupEncryptionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.CopyBackupEncryptionConfig"; - }; - - /** - * EncryptionType enum. - * @name google.spanner.admin.database.v1.CopyBackupEncryptionConfig.EncryptionType - * @enum {number} - * @property {number} ENCRYPTION_TYPE_UNSPECIFIED=0 ENCRYPTION_TYPE_UNSPECIFIED value - * @property {number} USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION=1 USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION value - * @property {number} GOOGLE_DEFAULT_ENCRYPTION=2 GOOGLE_DEFAULT_ENCRYPTION value - * @property {number} CUSTOMER_MANAGED_ENCRYPTION=3 CUSTOMER_MANAGED_ENCRYPTION value - */ - CopyBackupEncryptionConfig.EncryptionType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ENCRYPTION_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION"] = 1; - values[valuesById[2] = "GOOGLE_DEFAULT_ENCRYPTION"] = 2; - values[valuesById[3] = "CUSTOMER_MANAGED_ENCRYPTION"] = 3; - return values; - })(); - - return CopyBackupEncryptionConfig; - })(); - - v1.FullBackupSpec = (function() { - - /** - * Properties of a FullBackupSpec. - * @memberof google.spanner.admin.database.v1 - * @interface IFullBackupSpec - */ - - /** - * Constructs a new FullBackupSpec. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents a FullBackupSpec. - * @implements IFullBackupSpec - * @constructor - * @param {google.spanner.admin.database.v1.IFullBackupSpec=} [properties] Properties to set - */ - function FullBackupSpec(properties) { - if (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 FullBackupSpec instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.FullBackupSpec - * @static - * @param {google.spanner.admin.database.v1.IFullBackupSpec=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.FullBackupSpec} FullBackupSpec instance - */ - FullBackupSpec.create = function create(properties) { - return new FullBackupSpec(properties); - }; - - /** - * Encodes the specified FullBackupSpec message. Does not implicitly {@link google.spanner.admin.database.v1.FullBackupSpec.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.FullBackupSpec - * @static - * @param {google.spanner.admin.database.v1.IFullBackupSpec} message FullBackupSpec message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FullBackupSpec.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified FullBackupSpec message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.FullBackupSpec.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.FullBackupSpec - * @static - * @param {google.spanner.admin.database.v1.IFullBackupSpec} message FullBackupSpec message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FullBackupSpec.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FullBackupSpec message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.FullBackupSpec - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.FullBackupSpec} FullBackupSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FullBackupSpec.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.FullBackupSpec(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FullBackupSpec message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.FullBackupSpec - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.FullBackupSpec} FullBackupSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FullBackupSpec.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FullBackupSpec message. - * @function verify - * @memberof google.spanner.admin.database.v1.FullBackupSpec - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FullBackupSpec.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a FullBackupSpec message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.FullBackupSpec - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.FullBackupSpec} FullBackupSpec - */ - FullBackupSpec.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.FullBackupSpec) - return object; - return new $root.google.spanner.admin.database.v1.FullBackupSpec(); - }; - - /** - * Creates a plain object from a FullBackupSpec message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.FullBackupSpec - * @static - * @param {google.spanner.admin.database.v1.FullBackupSpec} message FullBackupSpec - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FullBackupSpec.toObject = function toObject() { - return {}; - }; - - /** - * Converts this FullBackupSpec to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.FullBackupSpec - * @instance - * @returns {Object.} JSON object - */ - FullBackupSpec.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FullBackupSpec - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.FullBackupSpec - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FullBackupSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.FullBackupSpec"; - }; - - return FullBackupSpec; - })(); - - v1.IncrementalBackupSpec = (function() { - - /** - * Properties of an IncrementalBackupSpec. - * @memberof google.spanner.admin.database.v1 - * @interface IIncrementalBackupSpec - */ - - /** - * Constructs a new IncrementalBackupSpec. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents an IncrementalBackupSpec. - * @implements IIncrementalBackupSpec - * @constructor - * @param {google.spanner.admin.database.v1.IIncrementalBackupSpec=} [properties] Properties to set - */ - function IncrementalBackupSpec(properties) { - if (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 IncrementalBackupSpec instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.IncrementalBackupSpec - * @static - * @param {google.spanner.admin.database.v1.IIncrementalBackupSpec=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.IncrementalBackupSpec} IncrementalBackupSpec instance - */ - IncrementalBackupSpec.create = function create(properties) { - return new IncrementalBackupSpec(properties); - }; - - /** - * Encodes the specified IncrementalBackupSpec message. Does not implicitly {@link google.spanner.admin.database.v1.IncrementalBackupSpec.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.IncrementalBackupSpec - * @static - * @param {google.spanner.admin.database.v1.IIncrementalBackupSpec} message IncrementalBackupSpec message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IncrementalBackupSpec.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified IncrementalBackupSpec message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.IncrementalBackupSpec.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.IncrementalBackupSpec - * @static - * @param {google.spanner.admin.database.v1.IIncrementalBackupSpec} message IncrementalBackupSpec message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IncrementalBackupSpec.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an IncrementalBackupSpec message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.IncrementalBackupSpec - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.IncrementalBackupSpec} IncrementalBackupSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IncrementalBackupSpec.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.IncrementalBackupSpec(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an IncrementalBackupSpec message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.IncrementalBackupSpec - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.IncrementalBackupSpec} IncrementalBackupSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IncrementalBackupSpec.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an IncrementalBackupSpec message. - * @function verify - * @memberof google.spanner.admin.database.v1.IncrementalBackupSpec - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - IncrementalBackupSpec.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates an IncrementalBackupSpec message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.IncrementalBackupSpec - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.IncrementalBackupSpec} IncrementalBackupSpec - */ - IncrementalBackupSpec.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.IncrementalBackupSpec) - return object; - return new $root.google.spanner.admin.database.v1.IncrementalBackupSpec(); - }; - - /** - * Creates a plain object from an IncrementalBackupSpec message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.IncrementalBackupSpec - * @static - * @param {google.spanner.admin.database.v1.IncrementalBackupSpec} message IncrementalBackupSpec - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - IncrementalBackupSpec.toObject = function toObject() { - return {}; - }; - - /** - * Converts this IncrementalBackupSpec to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.IncrementalBackupSpec - * @instance - * @returns {Object.} JSON object - */ - IncrementalBackupSpec.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for IncrementalBackupSpec - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.IncrementalBackupSpec - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - IncrementalBackupSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.IncrementalBackupSpec"; - }; - - return IncrementalBackupSpec; - })(); - - v1.BackupInstancePartition = (function() { - - /** - * Properties of a BackupInstancePartition. - * @memberof google.spanner.admin.database.v1 - * @interface IBackupInstancePartition - * @property {string|null} [instancePartition] BackupInstancePartition instancePartition - */ - - /** - * Constructs a new BackupInstancePartition. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents a BackupInstancePartition. - * @implements IBackupInstancePartition - * @constructor - * @param {google.spanner.admin.database.v1.IBackupInstancePartition=} [properties] Properties to set - */ - function BackupInstancePartition(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BackupInstancePartition instancePartition. - * @member {string} instancePartition - * @memberof google.spanner.admin.database.v1.BackupInstancePartition - * @instance - */ - BackupInstancePartition.prototype.instancePartition = ""; - - /** - * Creates a new BackupInstancePartition instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.BackupInstancePartition - * @static - * @param {google.spanner.admin.database.v1.IBackupInstancePartition=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.BackupInstancePartition} BackupInstancePartition instance - */ - BackupInstancePartition.create = function create(properties) { - return new BackupInstancePartition(properties); - }; - - /** - * Encodes the specified BackupInstancePartition message. Does not implicitly {@link google.spanner.admin.database.v1.BackupInstancePartition.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.BackupInstancePartition - * @static - * @param {google.spanner.admin.database.v1.IBackupInstancePartition} message BackupInstancePartition message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BackupInstancePartition.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.instancePartition != null && Object.hasOwnProperty.call(message, "instancePartition")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.instancePartition); - return writer; - }; - - /** - * Encodes the specified BackupInstancePartition message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.BackupInstancePartition.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.BackupInstancePartition - * @static - * @param {google.spanner.admin.database.v1.IBackupInstancePartition} message BackupInstancePartition message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BackupInstancePartition.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BackupInstancePartition message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.BackupInstancePartition - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.BackupInstancePartition} BackupInstancePartition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BackupInstancePartition.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.BackupInstancePartition(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.instancePartition = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BackupInstancePartition message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.BackupInstancePartition - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.BackupInstancePartition} BackupInstancePartition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BackupInstancePartition.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BackupInstancePartition message. - * @function verify - * @memberof google.spanner.admin.database.v1.BackupInstancePartition - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BackupInstancePartition.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.instancePartition != null && message.hasOwnProperty("instancePartition")) - if (!$util.isString(message.instancePartition)) - return "instancePartition: string expected"; - return null; - }; - - /** - * Creates a BackupInstancePartition message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.BackupInstancePartition - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.BackupInstancePartition} BackupInstancePartition - */ - BackupInstancePartition.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.BackupInstancePartition) - return object; - var message = new $root.google.spanner.admin.database.v1.BackupInstancePartition(); - if (object.instancePartition != null) - message.instancePartition = String(object.instancePartition); - return message; - }; - - /** - * Creates a plain object from a BackupInstancePartition message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.BackupInstancePartition - * @static - * @param {google.spanner.admin.database.v1.BackupInstancePartition} message BackupInstancePartition - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BackupInstancePartition.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.instancePartition = ""; - if (message.instancePartition != null && message.hasOwnProperty("instancePartition")) - object.instancePartition = message.instancePartition; - return object; - }; - - /** - * Converts this BackupInstancePartition to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.BackupInstancePartition - * @instance - * @returns {Object.} JSON object - */ - BackupInstancePartition.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BackupInstancePartition - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.BackupInstancePartition - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BackupInstancePartition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.BackupInstancePartition"; - }; - - return BackupInstancePartition; - })(); - - v1.OperationProgress = (function() { - - /** - * Properties of an OperationProgress. - * @memberof google.spanner.admin.database.v1 - * @interface IOperationProgress - * @property {number|null} [progressPercent] OperationProgress progressPercent - * @property {google.protobuf.ITimestamp|null} [startTime] OperationProgress startTime - * @property {google.protobuf.ITimestamp|null} [endTime] OperationProgress endTime - */ - - /** - * Constructs a new OperationProgress. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents an OperationProgress. - * @implements IOperationProgress - * @constructor - * @param {google.spanner.admin.database.v1.IOperationProgress=} [properties] Properties to set - */ - function OperationProgress(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * OperationProgress progressPercent. - * @member {number} progressPercent - * @memberof google.spanner.admin.database.v1.OperationProgress - * @instance - */ - OperationProgress.prototype.progressPercent = 0; - - /** - * OperationProgress startTime. - * @member {google.protobuf.ITimestamp|null|undefined} startTime - * @memberof google.spanner.admin.database.v1.OperationProgress - * @instance - */ - OperationProgress.prototype.startTime = null; - - /** - * OperationProgress endTime. - * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.spanner.admin.database.v1.OperationProgress - * @instance - */ - OperationProgress.prototype.endTime = null; - - /** - * Creates a new OperationProgress instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.OperationProgress - * @static - * @param {google.spanner.admin.database.v1.IOperationProgress=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.OperationProgress} OperationProgress instance - */ - OperationProgress.create = function create(properties) { - return new OperationProgress(properties); - }; - - /** - * Encodes the specified OperationProgress message. Does not implicitly {@link google.spanner.admin.database.v1.OperationProgress.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.OperationProgress - * @static - * @param {google.spanner.admin.database.v1.IOperationProgress} message OperationProgress message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OperationProgress.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.progressPercent != null && Object.hasOwnProperty.call(message, "progressPercent")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.progressPercent); - if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) - $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) - $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified OperationProgress message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.OperationProgress.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.OperationProgress - * @static - * @param {google.spanner.admin.database.v1.IOperationProgress} message OperationProgress message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OperationProgress.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OperationProgress message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.OperationProgress - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.OperationProgress} OperationProgress - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OperationProgress.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.OperationProgress(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.progressPercent = reader.int32(); - break; - } - case 2: { - message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 3: { - message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OperationProgress message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.OperationProgress - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.OperationProgress} OperationProgress - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OperationProgress.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OperationProgress message. - * @function verify - * @memberof google.spanner.admin.database.v1.OperationProgress - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OperationProgress.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.progressPercent != null && message.hasOwnProperty("progressPercent")) - if (!$util.isInteger(message.progressPercent)) - return "progressPercent: integer expected"; - if (message.startTime != null && message.hasOwnProperty("startTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.startTime); - if (error) - return "startTime." + error; - } - if (message.endTime != null && message.hasOwnProperty("endTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.endTime); - if (error) - return "endTime." + error; - } - return null; - }; - - /** - * Creates an OperationProgress message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.OperationProgress - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.OperationProgress} OperationProgress - */ - OperationProgress.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.OperationProgress) - return object; - var message = new $root.google.spanner.admin.database.v1.OperationProgress(); - if (object.progressPercent != null) - message.progressPercent = object.progressPercent | 0; - if (object.startTime != null) { - if (typeof object.startTime !== "object") - throw TypeError(".google.spanner.admin.database.v1.OperationProgress.startTime: object expected"); - message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); - } - if (object.endTime != null) { - if (typeof object.endTime !== "object") - throw TypeError(".google.spanner.admin.database.v1.OperationProgress.endTime: object expected"); - message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); - } - return message; - }; - - /** - * Creates a plain object from an OperationProgress message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.OperationProgress - * @static - * @param {google.spanner.admin.database.v1.OperationProgress} message OperationProgress - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OperationProgress.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.progressPercent = 0; - object.startTime = null; - object.endTime = null; - } - if (message.progressPercent != null && message.hasOwnProperty("progressPercent")) - object.progressPercent = message.progressPercent; - if (message.startTime != null && message.hasOwnProperty("startTime")) - object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); - if (message.endTime != null && message.hasOwnProperty("endTime")) - object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); - return object; - }; - - /** - * Converts this OperationProgress to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.OperationProgress - * @instance - * @returns {Object.} JSON object - */ - OperationProgress.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OperationProgress - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.OperationProgress - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OperationProgress.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.OperationProgress"; - }; - - return OperationProgress; - })(); - - v1.EncryptionConfig = (function() { - - /** - * Properties of an EncryptionConfig. - * @memberof google.spanner.admin.database.v1 - * @interface IEncryptionConfig - * @property {string|null} [kmsKeyName] EncryptionConfig kmsKeyName - * @property {Array.|null} [kmsKeyNames] EncryptionConfig kmsKeyNames - */ - - /** - * Constructs a new EncryptionConfig. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents an EncryptionConfig. - * @implements IEncryptionConfig - * @constructor - * @param {google.spanner.admin.database.v1.IEncryptionConfig=} [properties] Properties to set - */ - function EncryptionConfig(properties) { - this.kmsKeyNames = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EncryptionConfig kmsKeyName. - * @member {string} kmsKeyName - * @memberof google.spanner.admin.database.v1.EncryptionConfig - * @instance - */ - EncryptionConfig.prototype.kmsKeyName = ""; - - /** - * EncryptionConfig kmsKeyNames. - * @member {Array.} kmsKeyNames - * @memberof google.spanner.admin.database.v1.EncryptionConfig - * @instance - */ - EncryptionConfig.prototype.kmsKeyNames = $util.emptyArray; - - /** - * Creates a new EncryptionConfig instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.EncryptionConfig - * @static - * @param {google.spanner.admin.database.v1.IEncryptionConfig=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.EncryptionConfig} EncryptionConfig instance - */ - EncryptionConfig.create = function create(properties) { - return new EncryptionConfig(properties); - }; - - /** - * Encodes the specified EncryptionConfig message. Does not implicitly {@link google.spanner.admin.database.v1.EncryptionConfig.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.EncryptionConfig - * @static - * @param {google.spanner.admin.database.v1.IEncryptionConfig} message EncryptionConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EncryptionConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.kmsKeyName); - if (message.kmsKeyNames != null && message.kmsKeyNames.length) - for (var i = 0; i < message.kmsKeyNames.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.kmsKeyNames[i]); - return writer; - }; - - /** - * Encodes the specified EncryptionConfig message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.EncryptionConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.EncryptionConfig - * @static - * @param {google.spanner.admin.database.v1.IEncryptionConfig} message EncryptionConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EncryptionConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EncryptionConfig message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.EncryptionConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.EncryptionConfig} EncryptionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EncryptionConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.EncryptionConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - message.kmsKeyName = reader.string(); - break; - } - case 3: { - if (!(message.kmsKeyNames && message.kmsKeyNames.length)) - message.kmsKeyNames = []; - message.kmsKeyNames.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EncryptionConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.EncryptionConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.EncryptionConfig} EncryptionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EncryptionConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EncryptionConfig message. - * @function verify - * @memberof google.spanner.admin.database.v1.EncryptionConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EncryptionConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) - if (!$util.isString(message.kmsKeyName)) - return "kmsKeyName: string expected"; - if (message.kmsKeyNames != null && message.hasOwnProperty("kmsKeyNames")) { - if (!Array.isArray(message.kmsKeyNames)) - return "kmsKeyNames: array expected"; - for (var i = 0; i < message.kmsKeyNames.length; ++i) - if (!$util.isString(message.kmsKeyNames[i])) - return "kmsKeyNames: string[] expected"; - } - return null; - }; - - /** - * Creates an EncryptionConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.EncryptionConfig - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.EncryptionConfig} EncryptionConfig - */ - EncryptionConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.EncryptionConfig) - return object; - var message = new $root.google.spanner.admin.database.v1.EncryptionConfig(); - if (object.kmsKeyName != null) - message.kmsKeyName = String(object.kmsKeyName); - if (object.kmsKeyNames) { - if (!Array.isArray(object.kmsKeyNames)) - throw TypeError(".google.spanner.admin.database.v1.EncryptionConfig.kmsKeyNames: array expected"); - message.kmsKeyNames = []; - for (var i = 0; i < object.kmsKeyNames.length; ++i) - message.kmsKeyNames[i] = String(object.kmsKeyNames[i]); - } - return message; - }; - - /** - * Creates a plain object from an EncryptionConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.EncryptionConfig - * @static - * @param {google.spanner.admin.database.v1.EncryptionConfig} message EncryptionConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EncryptionConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.kmsKeyNames = []; - if (options.defaults) - object.kmsKeyName = ""; - if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) - object.kmsKeyName = message.kmsKeyName; - if (message.kmsKeyNames && message.kmsKeyNames.length) { - object.kmsKeyNames = []; - for (var j = 0; j < message.kmsKeyNames.length; ++j) - object.kmsKeyNames[j] = message.kmsKeyNames[j]; - } - return object; - }; - - /** - * Converts this EncryptionConfig to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.EncryptionConfig - * @instance - * @returns {Object.} JSON object - */ - EncryptionConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EncryptionConfig - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.EncryptionConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EncryptionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.EncryptionConfig"; - }; - - return EncryptionConfig; - })(); - - v1.EncryptionInfo = (function() { - - /** - * Properties of an EncryptionInfo. - * @memberof google.spanner.admin.database.v1 - * @interface IEncryptionInfo - * @property {google.spanner.admin.database.v1.EncryptionInfo.Type|null} [encryptionType] EncryptionInfo encryptionType - * @property {google.rpc.IStatus|null} [encryptionStatus] EncryptionInfo encryptionStatus - * @property {string|null} [kmsKeyVersion] EncryptionInfo kmsKeyVersion - */ - - /** - * Constructs a new EncryptionInfo. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents an EncryptionInfo. - * @implements IEncryptionInfo - * @constructor - * @param {google.spanner.admin.database.v1.IEncryptionInfo=} [properties] Properties to set - */ - function EncryptionInfo(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EncryptionInfo encryptionType. - * @member {google.spanner.admin.database.v1.EncryptionInfo.Type} encryptionType - * @memberof google.spanner.admin.database.v1.EncryptionInfo - * @instance - */ - EncryptionInfo.prototype.encryptionType = 0; - - /** - * EncryptionInfo encryptionStatus. - * @member {google.rpc.IStatus|null|undefined} encryptionStatus - * @memberof google.spanner.admin.database.v1.EncryptionInfo - * @instance - */ - EncryptionInfo.prototype.encryptionStatus = null; - - /** - * EncryptionInfo kmsKeyVersion. - * @member {string} kmsKeyVersion - * @memberof google.spanner.admin.database.v1.EncryptionInfo - * @instance - */ - EncryptionInfo.prototype.kmsKeyVersion = ""; - - /** - * Creates a new EncryptionInfo instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.EncryptionInfo - * @static - * @param {google.spanner.admin.database.v1.IEncryptionInfo=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.EncryptionInfo} EncryptionInfo instance - */ - EncryptionInfo.create = function create(properties) { - return new EncryptionInfo(properties); - }; - - /** - * Encodes the specified EncryptionInfo message. Does not implicitly {@link google.spanner.admin.database.v1.EncryptionInfo.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.EncryptionInfo - * @static - * @param {google.spanner.admin.database.v1.IEncryptionInfo} message EncryptionInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EncryptionInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.kmsKeyVersion != null && Object.hasOwnProperty.call(message, "kmsKeyVersion")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.kmsKeyVersion); - if (message.encryptionType != null && Object.hasOwnProperty.call(message, "encryptionType")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.encryptionType); - if (message.encryptionStatus != null && Object.hasOwnProperty.call(message, "encryptionStatus")) - $root.google.rpc.Status.encode(message.encryptionStatus, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EncryptionInfo message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.EncryptionInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.EncryptionInfo - * @static - * @param {google.spanner.admin.database.v1.IEncryptionInfo} message EncryptionInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EncryptionInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EncryptionInfo message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.EncryptionInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.EncryptionInfo} EncryptionInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EncryptionInfo.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.EncryptionInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 3: { - message.encryptionType = reader.int32(); - break; - } - case 4: { - message.encryptionStatus = $root.google.rpc.Status.decode(reader, reader.uint32()); - break; - } - case 2: { - message.kmsKeyVersion = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EncryptionInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.EncryptionInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.EncryptionInfo} EncryptionInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EncryptionInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EncryptionInfo message. - * @function verify - * @memberof google.spanner.admin.database.v1.EncryptionInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EncryptionInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.encryptionType != null && message.hasOwnProperty("encryptionType")) - switch (message.encryptionType) { - default: - return "encryptionType: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.encryptionStatus != null && message.hasOwnProperty("encryptionStatus")) { - var error = $root.google.rpc.Status.verify(message.encryptionStatus); - if (error) - return "encryptionStatus." + error; - } - if (message.kmsKeyVersion != null && message.hasOwnProperty("kmsKeyVersion")) - if (!$util.isString(message.kmsKeyVersion)) - return "kmsKeyVersion: string expected"; - return null; - }; - - /** - * Creates an EncryptionInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.EncryptionInfo - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.EncryptionInfo} EncryptionInfo - */ - EncryptionInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.EncryptionInfo) - return object; - var message = new $root.google.spanner.admin.database.v1.EncryptionInfo(); - switch (object.encryptionType) { - default: - if (typeof object.encryptionType === "number") { - message.encryptionType = object.encryptionType; - break; - } - break; - case "TYPE_UNSPECIFIED": - case 0: - message.encryptionType = 0; - break; - case "GOOGLE_DEFAULT_ENCRYPTION": - case 1: - message.encryptionType = 1; - break; - case "CUSTOMER_MANAGED_ENCRYPTION": - case 2: - message.encryptionType = 2; - break; - } - if (object.encryptionStatus != null) { - if (typeof object.encryptionStatus !== "object") - throw TypeError(".google.spanner.admin.database.v1.EncryptionInfo.encryptionStatus: object expected"); - message.encryptionStatus = $root.google.rpc.Status.fromObject(object.encryptionStatus); - } - if (object.kmsKeyVersion != null) - message.kmsKeyVersion = String(object.kmsKeyVersion); - return message; - }; - - /** - * Creates a plain object from an EncryptionInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.EncryptionInfo - * @static - * @param {google.spanner.admin.database.v1.EncryptionInfo} message EncryptionInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EncryptionInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.kmsKeyVersion = ""; - object.encryptionType = options.enums === String ? "TYPE_UNSPECIFIED" : 0; - object.encryptionStatus = null; - } - if (message.kmsKeyVersion != null && message.hasOwnProperty("kmsKeyVersion")) - object.kmsKeyVersion = message.kmsKeyVersion; - if (message.encryptionType != null && message.hasOwnProperty("encryptionType")) - object.encryptionType = options.enums === String ? $root.google.spanner.admin.database.v1.EncryptionInfo.Type[message.encryptionType] === undefined ? message.encryptionType : $root.google.spanner.admin.database.v1.EncryptionInfo.Type[message.encryptionType] : message.encryptionType; - if (message.encryptionStatus != null && message.hasOwnProperty("encryptionStatus")) - object.encryptionStatus = $root.google.rpc.Status.toObject(message.encryptionStatus, options); - return object; - }; - - /** - * Converts this EncryptionInfo to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.EncryptionInfo - * @instance - * @returns {Object.} JSON object - */ - EncryptionInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EncryptionInfo - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.EncryptionInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EncryptionInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.EncryptionInfo"; - }; - - /** - * Type enum. - * @name google.spanner.admin.database.v1.EncryptionInfo.Type - * @enum {number} - * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value - * @property {number} GOOGLE_DEFAULT_ENCRYPTION=1 GOOGLE_DEFAULT_ENCRYPTION value - * @property {number} CUSTOMER_MANAGED_ENCRYPTION=2 CUSTOMER_MANAGED_ENCRYPTION value - */ - EncryptionInfo.Type = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "GOOGLE_DEFAULT_ENCRYPTION"] = 1; - values[valuesById[2] = "CUSTOMER_MANAGED_ENCRYPTION"] = 2; - return values; - })(); - - return EncryptionInfo; - })(); - - /** - * DatabaseDialect enum. - * @name google.spanner.admin.database.v1.DatabaseDialect - * @enum {number} - * @property {number} DATABASE_DIALECT_UNSPECIFIED=0 DATABASE_DIALECT_UNSPECIFIED value - * @property {number} GOOGLE_STANDARD_SQL=1 GOOGLE_STANDARD_SQL value - * @property {number} POSTGRESQL=2 POSTGRESQL value - */ - v1.DatabaseDialect = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "DATABASE_DIALECT_UNSPECIFIED"] = 0; - values[valuesById[1] = "GOOGLE_STANDARD_SQL"] = 1; - values[valuesById[2] = "POSTGRESQL"] = 2; - return values; - })(); - - v1.BackupScheduleSpec = (function() { - - /** - * Properties of a BackupScheduleSpec. - * @memberof google.spanner.admin.database.v1 - * @interface IBackupScheduleSpec - * @property {google.spanner.admin.database.v1.ICrontabSpec|null} [cronSpec] BackupScheduleSpec cronSpec - */ - - /** - * Constructs a new BackupScheduleSpec. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents a BackupScheduleSpec. - * @implements IBackupScheduleSpec - * @constructor - * @param {google.spanner.admin.database.v1.IBackupScheduleSpec=} [properties] Properties to set - */ - function BackupScheduleSpec(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BackupScheduleSpec cronSpec. - * @member {google.spanner.admin.database.v1.ICrontabSpec|null|undefined} cronSpec - * @memberof google.spanner.admin.database.v1.BackupScheduleSpec - * @instance - */ - BackupScheduleSpec.prototype.cronSpec = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * BackupScheduleSpec scheduleSpec. - * @member {"cronSpec"|undefined} scheduleSpec - * @memberof google.spanner.admin.database.v1.BackupScheduleSpec - * @instance - */ - Object.defineProperty(BackupScheduleSpec.prototype, "scheduleSpec", { - get: $util.oneOfGetter($oneOfFields = ["cronSpec"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new BackupScheduleSpec instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.BackupScheduleSpec - * @static - * @param {google.spanner.admin.database.v1.IBackupScheduleSpec=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.BackupScheduleSpec} BackupScheduleSpec instance - */ - BackupScheduleSpec.create = function create(properties) { - return new BackupScheduleSpec(properties); - }; - - /** - * Encodes the specified BackupScheduleSpec message. Does not implicitly {@link google.spanner.admin.database.v1.BackupScheduleSpec.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.BackupScheduleSpec - * @static - * @param {google.spanner.admin.database.v1.IBackupScheduleSpec} message BackupScheduleSpec message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BackupScheduleSpec.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.cronSpec != null && Object.hasOwnProperty.call(message, "cronSpec")) - $root.google.spanner.admin.database.v1.CrontabSpec.encode(message.cronSpec, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified BackupScheduleSpec message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.BackupScheduleSpec.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.BackupScheduleSpec - * @static - * @param {google.spanner.admin.database.v1.IBackupScheduleSpec} message BackupScheduleSpec message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BackupScheduleSpec.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BackupScheduleSpec message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.BackupScheduleSpec - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.BackupScheduleSpec} BackupScheduleSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BackupScheduleSpec.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.BackupScheduleSpec(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.cronSpec = $root.google.spanner.admin.database.v1.CrontabSpec.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BackupScheduleSpec message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.BackupScheduleSpec - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.BackupScheduleSpec} BackupScheduleSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BackupScheduleSpec.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BackupScheduleSpec message. - * @function verify - * @memberof google.spanner.admin.database.v1.BackupScheduleSpec - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BackupScheduleSpec.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.cronSpec != null && message.hasOwnProperty("cronSpec")) { - properties.scheduleSpec = 1; - { - var error = $root.google.spanner.admin.database.v1.CrontabSpec.verify(message.cronSpec); - if (error) - return "cronSpec." + error; - } - } - return null; - }; - - /** - * Creates a BackupScheduleSpec message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.BackupScheduleSpec - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.BackupScheduleSpec} BackupScheduleSpec - */ - BackupScheduleSpec.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.BackupScheduleSpec) - return object; - var message = new $root.google.spanner.admin.database.v1.BackupScheduleSpec(); - if (object.cronSpec != null) { - if (typeof object.cronSpec !== "object") - throw TypeError(".google.spanner.admin.database.v1.BackupScheduleSpec.cronSpec: object expected"); - message.cronSpec = $root.google.spanner.admin.database.v1.CrontabSpec.fromObject(object.cronSpec); - } - return message; - }; - - /** - * Creates a plain object from a BackupScheduleSpec message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.BackupScheduleSpec - * @static - * @param {google.spanner.admin.database.v1.BackupScheduleSpec} message BackupScheduleSpec - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BackupScheduleSpec.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.cronSpec != null && message.hasOwnProperty("cronSpec")) { - object.cronSpec = $root.google.spanner.admin.database.v1.CrontabSpec.toObject(message.cronSpec, options); - if (options.oneofs) - object.scheduleSpec = "cronSpec"; - } - return object; - }; - - /** - * Converts this BackupScheduleSpec to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.BackupScheduleSpec - * @instance - * @returns {Object.} JSON object - */ - BackupScheduleSpec.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BackupScheduleSpec - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.BackupScheduleSpec - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BackupScheduleSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.BackupScheduleSpec"; - }; - - return BackupScheduleSpec; - })(); - - v1.BackupSchedule = (function() { - - /** - * Properties of a BackupSchedule. - * @memberof google.spanner.admin.database.v1 - * @interface IBackupSchedule - * @property {string|null} [name] BackupSchedule name - * @property {google.spanner.admin.database.v1.IBackupScheduleSpec|null} [spec] BackupSchedule spec - * @property {google.protobuf.IDuration|null} [retentionDuration] BackupSchedule retentionDuration - * @property {google.spanner.admin.database.v1.ICreateBackupEncryptionConfig|null} [encryptionConfig] BackupSchedule encryptionConfig - * @property {google.spanner.admin.database.v1.IFullBackupSpec|null} [fullBackupSpec] BackupSchedule fullBackupSpec - * @property {google.spanner.admin.database.v1.IIncrementalBackupSpec|null} [incrementalBackupSpec] BackupSchedule incrementalBackupSpec - * @property {google.protobuf.ITimestamp|null} [updateTime] BackupSchedule updateTime - */ - - /** - * Constructs a new BackupSchedule. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents a BackupSchedule. - * @implements IBackupSchedule - * @constructor - * @param {google.spanner.admin.database.v1.IBackupSchedule=} [properties] Properties to set - */ - function BackupSchedule(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BackupSchedule name. - * @member {string} name - * @memberof google.spanner.admin.database.v1.BackupSchedule - * @instance - */ - BackupSchedule.prototype.name = ""; - - /** - * BackupSchedule spec. - * @member {google.spanner.admin.database.v1.IBackupScheduleSpec|null|undefined} spec - * @memberof google.spanner.admin.database.v1.BackupSchedule - * @instance - */ - BackupSchedule.prototype.spec = null; - - /** - * BackupSchedule retentionDuration. - * @member {google.protobuf.IDuration|null|undefined} retentionDuration - * @memberof google.spanner.admin.database.v1.BackupSchedule - * @instance - */ - BackupSchedule.prototype.retentionDuration = null; - - /** - * BackupSchedule encryptionConfig. - * @member {google.spanner.admin.database.v1.ICreateBackupEncryptionConfig|null|undefined} encryptionConfig - * @memberof google.spanner.admin.database.v1.BackupSchedule - * @instance - */ - BackupSchedule.prototype.encryptionConfig = null; - - /** - * BackupSchedule fullBackupSpec. - * @member {google.spanner.admin.database.v1.IFullBackupSpec|null|undefined} fullBackupSpec - * @memberof google.spanner.admin.database.v1.BackupSchedule - * @instance - */ - BackupSchedule.prototype.fullBackupSpec = null; - - /** - * BackupSchedule incrementalBackupSpec. - * @member {google.spanner.admin.database.v1.IIncrementalBackupSpec|null|undefined} incrementalBackupSpec - * @memberof google.spanner.admin.database.v1.BackupSchedule - * @instance - */ - BackupSchedule.prototype.incrementalBackupSpec = null; - - /** - * BackupSchedule updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.spanner.admin.database.v1.BackupSchedule - * @instance - */ - BackupSchedule.prototype.updateTime = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * BackupSchedule backupTypeSpec. - * @member {"fullBackupSpec"|"incrementalBackupSpec"|undefined} backupTypeSpec - * @memberof google.spanner.admin.database.v1.BackupSchedule - * @instance - */ - Object.defineProperty(BackupSchedule.prototype, "backupTypeSpec", { - get: $util.oneOfGetter($oneOfFields = ["fullBackupSpec", "incrementalBackupSpec"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new BackupSchedule instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.BackupSchedule - * @static - * @param {google.spanner.admin.database.v1.IBackupSchedule=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.BackupSchedule} BackupSchedule instance - */ - BackupSchedule.create = function create(properties) { - return new BackupSchedule(properties); - }; - - /** - * Encodes the specified BackupSchedule message. Does not implicitly {@link google.spanner.admin.database.v1.BackupSchedule.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.BackupSchedule - * @static - * @param {google.spanner.admin.database.v1.IBackupSchedule} message BackupSchedule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BackupSchedule.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.retentionDuration != null && Object.hasOwnProperty.call(message, "retentionDuration")) - $root.google.protobuf.Duration.encode(message.retentionDuration, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) - $root.google.spanner.admin.database.v1.CreateBackupEncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.spec != null && Object.hasOwnProperty.call(message, "spec")) - $root.google.spanner.admin.database.v1.BackupScheduleSpec.encode(message.spec, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.fullBackupSpec != null && Object.hasOwnProperty.call(message, "fullBackupSpec")) - $root.google.spanner.admin.database.v1.FullBackupSpec.encode(message.fullBackupSpec, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.incrementalBackupSpec != null && Object.hasOwnProperty.call(message, "incrementalBackupSpec")) - $root.google.spanner.admin.database.v1.IncrementalBackupSpec.encode(message.incrementalBackupSpec, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified BackupSchedule message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.BackupSchedule.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.BackupSchedule - * @static - * @param {google.spanner.admin.database.v1.IBackupSchedule} message BackupSchedule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BackupSchedule.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BackupSchedule message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.BackupSchedule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.BackupSchedule} BackupSchedule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BackupSchedule.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.BackupSchedule(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 6: { - message.spec = $root.google.spanner.admin.database.v1.BackupScheduleSpec.decode(reader, reader.uint32()); - break; - } - case 3: { - message.retentionDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 4: { - message.encryptionConfig = $root.google.spanner.admin.database.v1.CreateBackupEncryptionConfig.decode(reader, reader.uint32()); - break; - } - case 7: { - message.fullBackupSpec = $root.google.spanner.admin.database.v1.FullBackupSpec.decode(reader, reader.uint32()); - break; - } - case 8: { - message.incrementalBackupSpec = $root.google.spanner.admin.database.v1.IncrementalBackupSpec.decode(reader, reader.uint32()); - break; - } - case 9: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BackupSchedule message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.BackupSchedule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.BackupSchedule} BackupSchedule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BackupSchedule.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BackupSchedule message. - * @function verify - * @memberof google.spanner.admin.database.v1.BackupSchedule - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BackupSchedule.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.spec != null && message.hasOwnProperty("spec")) { - var error = $root.google.spanner.admin.database.v1.BackupScheduleSpec.verify(message.spec); - if (error) - return "spec." + error; - } - if (message.retentionDuration != null && message.hasOwnProperty("retentionDuration")) { - var error = $root.google.protobuf.Duration.verify(message.retentionDuration); - if (error) - return "retentionDuration." + error; - } - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { - var error = $root.google.spanner.admin.database.v1.CreateBackupEncryptionConfig.verify(message.encryptionConfig); - if (error) - return "encryptionConfig." + error; - } - if (message.fullBackupSpec != null && message.hasOwnProperty("fullBackupSpec")) { - properties.backupTypeSpec = 1; - { - var error = $root.google.spanner.admin.database.v1.FullBackupSpec.verify(message.fullBackupSpec); - if (error) - return "fullBackupSpec." + error; - } - } - if (message.incrementalBackupSpec != null && message.hasOwnProperty("incrementalBackupSpec")) { - if (properties.backupTypeSpec === 1) - return "backupTypeSpec: multiple values"; - properties.backupTypeSpec = 1; - { - var error = $root.google.spanner.admin.database.v1.IncrementalBackupSpec.verify(message.incrementalBackupSpec); - if (error) - return "incrementalBackupSpec." + error; - } - } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); - if (error) - return "updateTime." + error; - } - return null; - }; - - /** - * Creates a BackupSchedule message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.BackupSchedule - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.BackupSchedule} BackupSchedule - */ - BackupSchedule.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.BackupSchedule) - return object; - var message = new $root.google.spanner.admin.database.v1.BackupSchedule(); - if (object.name != null) - message.name = String(object.name); - if (object.spec != null) { - if (typeof object.spec !== "object") - throw TypeError(".google.spanner.admin.database.v1.BackupSchedule.spec: object expected"); - message.spec = $root.google.spanner.admin.database.v1.BackupScheduleSpec.fromObject(object.spec); - } - if (object.retentionDuration != null) { - if (typeof object.retentionDuration !== "object") - throw TypeError(".google.spanner.admin.database.v1.BackupSchedule.retentionDuration: object expected"); - message.retentionDuration = $root.google.protobuf.Duration.fromObject(object.retentionDuration); - } - if (object.encryptionConfig != null) { - if (typeof object.encryptionConfig !== "object") - throw TypeError(".google.spanner.admin.database.v1.BackupSchedule.encryptionConfig: object expected"); - message.encryptionConfig = $root.google.spanner.admin.database.v1.CreateBackupEncryptionConfig.fromObject(object.encryptionConfig); - } - if (object.fullBackupSpec != null) { - if (typeof object.fullBackupSpec !== "object") - throw TypeError(".google.spanner.admin.database.v1.BackupSchedule.fullBackupSpec: object expected"); - message.fullBackupSpec = $root.google.spanner.admin.database.v1.FullBackupSpec.fromObject(object.fullBackupSpec); - } - if (object.incrementalBackupSpec != null) { - if (typeof object.incrementalBackupSpec !== "object") - throw TypeError(".google.spanner.admin.database.v1.BackupSchedule.incrementalBackupSpec: object expected"); - message.incrementalBackupSpec = $root.google.spanner.admin.database.v1.IncrementalBackupSpec.fromObject(object.incrementalBackupSpec); - } - if (object.updateTime != null) { - if (typeof object.updateTime !== "object") - throw TypeError(".google.spanner.admin.database.v1.BackupSchedule.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - return message; - }; - - /** - * Creates a plain object from a BackupSchedule message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.BackupSchedule - * @static - * @param {google.spanner.admin.database.v1.BackupSchedule} message BackupSchedule - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BackupSchedule.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.retentionDuration = null; - object.encryptionConfig = null; - object.spec = null; - object.updateTime = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.retentionDuration != null && message.hasOwnProperty("retentionDuration")) - object.retentionDuration = $root.google.protobuf.Duration.toObject(message.retentionDuration, options); - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) - object.encryptionConfig = $root.google.spanner.admin.database.v1.CreateBackupEncryptionConfig.toObject(message.encryptionConfig, options); - if (message.spec != null && message.hasOwnProperty("spec")) - object.spec = $root.google.spanner.admin.database.v1.BackupScheduleSpec.toObject(message.spec, options); - if (message.fullBackupSpec != null && message.hasOwnProperty("fullBackupSpec")) { - object.fullBackupSpec = $root.google.spanner.admin.database.v1.FullBackupSpec.toObject(message.fullBackupSpec, options); - if (options.oneofs) - object.backupTypeSpec = "fullBackupSpec"; - } - if (message.incrementalBackupSpec != null && message.hasOwnProperty("incrementalBackupSpec")) { - object.incrementalBackupSpec = $root.google.spanner.admin.database.v1.IncrementalBackupSpec.toObject(message.incrementalBackupSpec, options); - if (options.oneofs) - object.backupTypeSpec = "incrementalBackupSpec"; - } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); - return object; - }; - - /** - * Converts this BackupSchedule to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.BackupSchedule - * @instance - * @returns {Object.} JSON object - */ - BackupSchedule.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BackupSchedule - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.BackupSchedule - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BackupSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.BackupSchedule"; - }; - - return BackupSchedule; - })(); - - v1.CrontabSpec = (function() { - - /** - * Properties of a CrontabSpec. - * @memberof google.spanner.admin.database.v1 - * @interface ICrontabSpec - * @property {string|null} [text] CrontabSpec text - * @property {string|null} [timeZone] CrontabSpec timeZone - * @property {google.protobuf.IDuration|null} [creationWindow] CrontabSpec creationWindow - */ - - /** - * Constructs a new CrontabSpec. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents a CrontabSpec. - * @implements ICrontabSpec - * @constructor - * @param {google.spanner.admin.database.v1.ICrontabSpec=} [properties] Properties to set - */ - function CrontabSpec(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CrontabSpec text. - * @member {string} text - * @memberof google.spanner.admin.database.v1.CrontabSpec - * @instance - */ - CrontabSpec.prototype.text = ""; - - /** - * CrontabSpec timeZone. - * @member {string} timeZone - * @memberof google.spanner.admin.database.v1.CrontabSpec - * @instance - */ - CrontabSpec.prototype.timeZone = ""; - - /** - * CrontabSpec creationWindow. - * @member {google.protobuf.IDuration|null|undefined} creationWindow - * @memberof google.spanner.admin.database.v1.CrontabSpec - * @instance - */ - CrontabSpec.prototype.creationWindow = null; - - /** - * Creates a new CrontabSpec instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.CrontabSpec - * @static - * @param {google.spanner.admin.database.v1.ICrontabSpec=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.CrontabSpec} CrontabSpec instance - */ - CrontabSpec.create = function create(properties) { - return new CrontabSpec(properties); - }; - - /** - * Encodes the specified CrontabSpec message. Does not implicitly {@link google.spanner.admin.database.v1.CrontabSpec.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.CrontabSpec - * @static - * @param {google.spanner.admin.database.v1.ICrontabSpec} message CrontabSpec message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CrontabSpec.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.text != null && Object.hasOwnProperty.call(message, "text")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); - if (message.timeZone != null && Object.hasOwnProperty.call(message, "timeZone")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.timeZone); - if (message.creationWindow != null && Object.hasOwnProperty.call(message, "creationWindow")) - $root.google.protobuf.Duration.encode(message.creationWindow, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CrontabSpec message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.CrontabSpec.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.CrontabSpec - * @static - * @param {google.spanner.admin.database.v1.ICrontabSpec} message CrontabSpec message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CrontabSpec.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CrontabSpec message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.CrontabSpec - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.CrontabSpec} CrontabSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CrontabSpec.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.CrontabSpec(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.text = reader.string(); - break; - } - case 2: { - message.timeZone = reader.string(); - break; - } - case 3: { - message.creationWindow = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CrontabSpec message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.CrontabSpec - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.CrontabSpec} CrontabSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CrontabSpec.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CrontabSpec message. - * @function verify - * @memberof google.spanner.admin.database.v1.CrontabSpec - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CrontabSpec.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.text != null && message.hasOwnProperty("text")) - if (!$util.isString(message.text)) - return "text: string expected"; - if (message.timeZone != null && message.hasOwnProperty("timeZone")) - if (!$util.isString(message.timeZone)) - return "timeZone: string expected"; - if (message.creationWindow != null && message.hasOwnProperty("creationWindow")) { - var error = $root.google.protobuf.Duration.verify(message.creationWindow); - if (error) - return "creationWindow." + error; - } - return null; - }; - - /** - * Creates a CrontabSpec message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.CrontabSpec - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.CrontabSpec} CrontabSpec - */ - CrontabSpec.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.CrontabSpec) - return object; - var message = new $root.google.spanner.admin.database.v1.CrontabSpec(); - if (object.text != null) - message.text = String(object.text); - if (object.timeZone != null) - message.timeZone = String(object.timeZone); - if (object.creationWindow != null) { - if (typeof object.creationWindow !== "object") - throw TypeError(".google.spanner.admin.database.v1.CrontabSpec.creationWindow: object expected"); - message.creationWindow = $root.google.protobuf.Duration.fromObject(object.creationWindow); - } - return message; - }; - - /** - * Creates a plain object from a CrontabSpec message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.CrontabSpec - * @static - * @param {google.spanner.admin.database.v1.CrontabSpec} message CrontabSpec - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CrontabSpec.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.text = ""; - object.timeZone = ""; - object.creationWindow = null; - } - if (message.text != null && message.hasOwnProperty("text")) - object.text = message.text; - if (message.timeZone != null && message.hasOwnProperty("timeZone")) - object.timeZone = message.timeZone; - if (message.creationWindow != null && message.hasOwnProperty("creationWindow")) - object.creationWindow = $root.google.protobuf.Duration.toObject(message.creationWindow, options); - return object; - }; - - /** - * Converts this CrontabSpec to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.CrontabSpec - * @instance - * @returns {Object.} JSON object - */ - CrontabSpec.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CrontabSpec - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.CrontabSpec - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CrontabSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.CrontabSpec"; - }; - - return CrontabSpec; - })(); - - v1.CreateBackupScheduleRequest = (function() { - - /** - * Properties of a CreateBackupScheduleRequest. - * @memberof google.spanner.admin.database.v1 - * @interface ICreateBackupScheduleRequest - * @property {string|null} [parent] CreateBackupScheduleRequest parent - * @property {string|null} [backupScheduleId] CreateBackupScheduleRequest backupScheduleId - * @property {google.spanner.admin.database.v1.IBackupSchedule|null} [backupSchedule] CreateBackupScheduleRequest backupSchedule - */ - - /** - * Constructs a new CreateBackupScheduleRequest. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents a CreateBackupScheduleRequest. - * @implements ICreateBackupScheduleRequest - * @constructor - * @param {google.spanner.admin.database.v1.ICreateBackupScheduleRequest=} [properties] Properties to set - */ - function CreateBackupScheduleRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateBackupScheduleRequest parent. - * @member {string} parent - * @memberof google.spanner.admin.database.v1.CreateBackupScheduleRequest - * @instance - */ - CreateBackupScheduleRequest.prototype.parent = ""; - - /** - * CreateBackupScheduleRequest backupScheduleId. - * @member {string} backupScheduleId - * @memberof google.spanner.admin.database.v1.CreateBackupScheduleRequest - * @instance - */ - CreateBackupScheduleRequest.prototype.backupScheduleId = ""; - - /** - * CreateBackupScheduleRequest backupSchedule. - * @member {google.spanner.admin.database.v1.IBackupSchedule|null|undefined} backupSchedule - * @memberof google.spanner.admin.database.v1.CreateBackupScheduleRequest - * @instance - */ - CreateBackupScheduleRequest.prototype.backupSchedule = null; - - /** - * Creates a new CreateBackupScheduleRequest instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.CreateBackupScheduleRequest - * @static - * @param {google.spanner.admin.database.v1.ICreateBackupScheduleRequest=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.CreateBackupScheduleRequest} CreateBackupScheduleRequest instance - */ - CreateBackupScheduleRequest.create = function create(properties) { - return new CreateBackupScheduleRequest(properties); - }; - - /** - * Encodes the specified CreateBackupScheduleRequest message. Does not implicitly {@link google.spanner.admin.database.v1.CreateBackupScheduleRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.CreateBackupScheduleRequest - * @static - * @param {google.spanner.admin.database.v1.ICreateBackupScheduleRequest} message CreateBackupScheduleRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateBackupScheduleRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.backupScheduleId != null && Object.hasOwnProperty.call(message, "backupScheduleId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.backupScheduleId); - if (message.backupSchedule != null && Object.hasOwnProperty.call(message, "backupSchedule")) - $root.google.spanner.admin.database.v1.BackupSchedule.encode(message.backupSchedule, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CreateBackupScheduleRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.CreateBackupScheduleRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.CreateBackupScheduleRequest - * @static - * @param {google.spanner.admin.database.v1.ICreateBackupScheduleRequest} message CreateBackupScheduleRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateBackupScheduleRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateBackupScheduleRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.CreateBackupScheduleRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.CreateBackupScheduleRequest} CreateBackupScheduleRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateBackupScheduleRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.CreateBackupScheduleRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.backupScheduleId = reader.string(); - break; - } - case 3: { - message.backupSchedule = $root.google.spanner.admin.database.v1.BackupSchedule.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateBackupScheduleRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.CreateBackupScheduleRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.CreateBackupScheduleRequest} CreateBackupScheduleRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateBackupScheduleRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateBackupScheduleRequest message. - * @function verify - * @memberof google.spanner.admin.database.v1.CreateBackupScheduleRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateBackupScheduleRequest.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.backupScheduleId != null && message.hasOwnProperty("backupScheduleId")) - if (!$util.isString(message.backupScheduleId)) - return "backupScheduleId: string expected"; - if (message.backupSchedule != null && message.hasOwnProperty("backupSchedule")) { - var error = $root.google.spanner.admin.database.v1.BackupSchedule.verify(message.backupSchedule); - if (error) - return "backupSchedule." + error; - } - return null; - }; - - /** - * Creates a CreateBackupScheduleRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.CreateBackupScheduleRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.CreateBackupScheduleRequest} CreateBackupScheduleRequest - */ - CreateBackupScheduleRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.CreateBackupScheduleRequest) - return object; - var message = new $root.google.spanner.admin.database.v1.CreateBackupScheduleRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.backupScheduleId != null) - message.backupScheduleId = String(object.backupScheduleId); - if (object.backupSchedule != null) { - if (typeof object.backupSchedule !== "object") - throw TypeError(".google.spanner.admin.database.v1.CreateBackupScheduleRequest.backupSchedule: object expected"); - message.backupSchedule = $root.google.spanner.admin.database.v1.BackupSchedule.fromObject(object.backupSchedule); - } - return message; - }; - - /** - * Creates a plain object from a CreateBackupScheduleRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.CreateBackupScheduleRequest - * @static - * @param {google.spanner.admin.database.v1.CreateBackupScheduleRequest} message CreateBackupScheduleRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateBackupScheduleRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.backupScheduleId = ""; - object.backupSchedule = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.backupScheduleId != null && message.hasOwnProperty("backupScheduleId")) - object.backupScheduleId = message.backupScheduleId; - if (message.backupSchedule != null && message.hasOwnProperty("backupSchedule")) - object.backupSchedule = $root.google.spanner.admin.database.v1.BackupSchedule.toObject(message.backupSchedule, options); - return object; - }; - - /** - * Converts this CreateBackupScheduleRequest to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.CreateBackupScheduleRequest - * @instance - * @returns {Object.} JSON object - */ - CreateBackupScheduleRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateBackupScheduleRequest - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.CreateBackupScheduleRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateBackupScheduleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.CreateBackupScheduleRequest"; - }; - - return CreateBackupScheduleRequest; - })(); - - v1.GetBackupScheduleRequest = (function() { - - /** - * Properties of a GetBackupScheduleRequest. - * @memberof google.spanner.admin.database.v1 - * @interface IGetBackupScheduleRequest - * @property {string|null} [name] GetBackupScheduleRequest name - */ - - /** - * Constructs a new GetBackupScheduleRequest. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents a GetBackupScheduleRequest. - * @implements IGetBackupScheduleRequest - * @constructor - * @param {google.spanner.admin.database.v1.IGetBackupScheduleRequest=} [properties] Properties to set - */ - function GetBackupScheduleRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetBackupScheduleRequest name. - * @member {string} name - * @memberof google.spanner.admin.database.v1.GetBackupScheduleRequest - * @instance - */ - GetBackupScheduleRequest.prototype.name = ""; - - /** - * Creates a new GetBackupScheduleRequest instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.GetBackupScheduleRequest - * @static - * @param {google.spanner.admin.database.v1.IGetBackupScheduleRequest=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.GetBackupScheduleRequest} GetBackupScheduleRequest instance - */ - GetBackupScheduleRequest.create = function create(properties) { - return new GetBackupScheduleRequest(properties); - }; - - /** - * Encodes the specified GetBackupScheduleRequest message. Does not implicitly {@link google.spanner.admin.database.v1.GetBackupScheduleRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.GetBackupScheduleRequest - * @static - * @param {google.spanner.admin.database.v1.IGetBackupScheduleRequest} message GetBackupScheduleRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetBackupScheduleRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; - - /** - * Encodes the specified GetBackupScheduleRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.GetBackupScheduleRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.GetBackupScheduleRequest - * @static - * @param {google.spanner.admin.database.v1.IGetBackupScheduleRequest} message GetBackupScheduleRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetBackupScheduleRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetBackupScheduleRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.GetBackupScheduleRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.GetBackupScheduleRequest} GetBackupScheduleRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetBackupScheduleRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.GetBackupScheduleRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetBackupScheduleRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.GetBackupScheduleRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.GetBackupScheduleRequest} GetBackupScheduleRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetBackupScheduleRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetBackupScheduleRequest message. - * @function verify - * @memberof google.spanner.admin.database.v1.GetBackupScheduleRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetBackupScheduleRequest.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 GetBackupScheduleRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.GetBackupScheduleRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.GetBackupScheduleRequest} GetBackupScheduleRequest - */ - GetBackupScheduleRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.GetBackupScheduleRequest) - return object; - var message = new $root.google.spanner.admin.database.v1.GetBackupScheduleRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetBackupScheduleRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.GetBackupScheduleRequest - * @static - * @param {google.spanner.admin.database.v1.GetBackupScheduleRequest} message GetBackupScheduleRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetBackupScheduleRequest.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 GetBackupScheduleRequest to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.GetBackupScheduleRequest - * @instance - * @returns {Object.} JSON object - */ - GetBackupScheduleRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetBackupScheduleRequest - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.GetBackupScheduleRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetBackupScheduleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.GetBackupScheduleRequest"; - }; - - return GetBackupScheduleRequest; - })(); - - v1.DeleteBackupScheduleRequest = (function() { - - /** - * Properties of a DeleteBackupScheduleRequest. - * @memberof google.spanner.admin.database.v1 - * @interface IDeleteBackupScheduleRequest - * @property {string|null} [name] DeleteBackupScheduleRequest name - */ - - /** - * Constructs a new DeleteBackupScheduleRequest. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents a DeleteBackupScheduleRequest. - * @implements IDeleteBackupScheduleRequest - * @constructor - * @param {google.spanner.admin.database.v1.IDeleteBackupScheduleRequest=} [properties] Properties to set - */ - function DeleteBackupScheduleRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteBackupScheduleRequest name. - * @member {string} name - * @memberof google.spanner.admin.database.v1.DeleteBackupScheduleRequest - * @instance - */ - DeleteBackupScheduleRequest.prototype.name = ""; - - /** - * Creates a new DeleteBackupScheduleRequest instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.DeleteBackupScheduleRequest - * @static - * @param {google.spanner.admin.database.v1.IDeleteBackupScheduleRequest=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.DeleteBackupScheduleRequest} DeleteBackupScheduleRequest instance - */ - DeleteBackupScheduleRequest.create = function create(properties) { - return new DeleteBackupScheduleRequest(properties); - }; - - /** - * Encodes the specified DeleteBackupScheduleRequest message. Does not implicitly {@link google.spanner.admin.database.v1.DeleteBackupScheduleRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.DeleteBackupScheduleRequest - * @static - * @param {google.spanner.admin.database.v1.IDeleteBackupScheduleRequest} message DeleteBackupScheduleRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteBackupScheduleRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; - - /** - * Encodes the specified DeleteBackupScheduleRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.DeleteBackupScheduleRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.DeleteBackupScheduleRequest - * @static - * @param {google.spanner.admin.database.v1.IDeleteBackupScheduleRequest} message DeleteBackupScheduleRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteBackupScheduleRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteBackupScheduleRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.DeleteBackupScheduleRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.DeleteBackupScheduleRequest} DeleteBackupScheduleRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteBackupScheduleRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.DeleteBackupScheduleRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteBackupScheduleRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.DeleteBackupScheduleRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.DeleteBackupScheduleRequest} DeleteBackupScheduleRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteBackupScheduleRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteBackupScheduleRequest message. - * @function verify - * @memberof google.spanner.admin.database.v1.DeleteBackupScheduleRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteBackupScheduleRequest.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 DeleteBackupScheduleRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.DeleteBackupScheduleRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.DeleteBackupScheduleRequest} DeleteBackupScheduleRequest - */ - DeleteBackupScheduleRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.DeleteBackupScheduleRequest) - return object; - var message = new $root.google.spanner.admin.database.v1.DeleteBackupScheduleRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a DeleteBackupScheduleRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.DeleteBackupScheduleRequest - * @static - * @param {google.spanner.admin.database.v1.DeleteBackupScheduleRequest} message DeleteBackupScheduleRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteBackupScheduleRequest.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 DeleteBackupScheduleRequest to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.DeleteBackupScheduleRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteBackupScheduleRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteBackupScheduleRequest - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.DeleteBackupScheduleRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteBackupScheduleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.DeleteBackupScheduleRequest"; - }; - - return DeleteBackupScheduleRequest; - })(); - - v1.ListBackupSchedulesRequest = (function() { - - /** - * Properties of a ListBackupSchedulesRequest. - * @memberof google.spanner.admin.database.v1 - * @interface IListBackupSchedulesRequest - * @property {string|null} [parent] ListBackupSchedulesRequest parent - * @property {number|null} [pageSize] ListBackupSchedulesRequest pageSize - * @property {string|null} [pageToken] ListBackupSchedulesRequest pageToken - */ - - /** - * Constructs a new ListBackupSchedulesRequest. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents a ListBackupSchedulesRequest. - * @implements IListBackupSchedulesRequest - * @constructor - * @param {google.spanner.admin.database.v1.IListBackupSchedulesRequest=} [properties] Properties to set - */ - function ListBackupSchedulesRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListBackupSchedulesRequest parent. - * @member {string} parent - * @memberof google.spanner.admin.database.v1.ListBackupSchedulesRequest - * @instance - */ - ListBackupSchedulesRequest.prototype.parent = ""; - - /** - * ListBackupSchedulesRequest pageSize. - * @member {number} pageSize - * @memberof google.spanner.admin.database.v1.ListBackupSchedulesRequest - * @instance - */ - ListBackupSchedulesRequest.prototype.pageSize = 0; - - /** - * ListBackupSchedulesRequest pageToken. - * @member {string} pageToken - * @memberof google.spanner.admin.database.v1.ListBackupSchedulesRequest - * @instance - */ - ListBackupSchedulesRequest.prototype.pageToken = ""; - - /** - * Creates a new ListBackupSchedulesRequest instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.ListBackupSchedulesRequest - * @static - * @param {google.spanner.admin.database.v1.IListBackupSchedulesRequest=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.ListBackupSchedulesRequest} ListBackupSchedulesRequest instance - */ - ListBackupSchedulesRequest.create = function create(properties) { - return new ListBackupSchedulesRequest(properties); - }; - - /** - * Encodes the specified ListBackupSchedulesRequest message. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupSchedulesRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.ListBackupSchedulesRequest - * @static - * @param {google.spanner.admin.database.v1.IListBackupSchedulesRequest} message ListBackupSchedulesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListBackupSchedulesRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); - return writer; - }; - - /** - * Encodes the specified ListBackupSchedulesRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupSchedulesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.ListBackupSchedulesRequest - * @static - * @param {google.spanner.admin.database.v1.IListBackupSchedulesRequest} message ListBackupSchedulesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListBackupSchedulesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListBackupSchedulesRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.ListBackupSchedulesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.ListBackupSchedulesRequest} ListBackupSchedulesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListBackupSchedulesRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.ListBackupSchedulesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 4: { - message.pageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListBackupSchedulesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.ListBackupSchedulesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.ListBackupSchedulesRequest} ListBackupSchedulesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListBackupSchedulesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListBackupSchedulesRequest message. - * @function verify - * @memberof google.spanner.admin.database.v1.ListBackupSchedulesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListBackupSchedulesRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - return null; - }; - - /** - * Creates a ListBackupSchedulesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.ListBackupSchedulesRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.ListBackupSchedulesRequest} ListBackupSchedulesRequest - */ - ListBackupSchedulesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.ListBackupSchedulesRequest) - return object; - var message = new $root.google.spanner.admin.database.v1.ListBackupSchedulesRequest(); - 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 ListBackupSchedulesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.ListBackupSchedulesRequest - * @static - * @param {google.spanner.admin.database.v1.ListBackupSchedulesRequest} message ListBackupSchedulesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListBackupSchedulesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - return object; - }; - - /** - * Converts this ListBackupSchedulesRequest to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.ListBackupSchedulesRequest - * @instance - * @returns {Object.} JSON object - */ - ListBackupSchedulesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListBackupSchedulesRequest - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.ListBackupSchedulesRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListBackupSchedulesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.ListBackupSchedulesRequest"; - }; - - return ListBackupSchedulesRequest; - })(); - - v1.ListBackupSchedulesResponse = (function() { - - /** - * Properties of a ListBackupSchedulesResponse. - * @memberof google.spanner.admin.database.v1 - * @interface IListBackupSchedulesResponse - * @property {Array.|null} [backupSchedules] ListBackupSchedulesResponse backupSchedules - * @property {string|null} [nextPageToken] ListBackupSchedulesResponse nextPageToken - */ - - /** - * Constructs a new ListBackupSchedulesResponse. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents a ListBackupSchedulesResponse. - * @implements IListBackupSchedulesResponse - * @constructor - * @param {google.spanner.admin.database.v1.IListBackupSchedulesResponse=} [properties] Properties to set - */ - function ListBackupSchedulesResponse(properties) { - this.backupSchedules = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListBackupSchedulesResponse backupSchedules. - * @member {Array.} backupSchedules - * @memberof google.spanner.admin.database.v1.ListBackupSchedulesResponse - * @instance - */ - ListBackupSchedulesResponse.prototype.backupSchedules = $util.emptyArray; - - /** - * ListBackupSchedulesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.spanner.admin.database.v1.ListBackupSchedulesResponse - * @instance - */ - ListBackupSchedulesResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListBackupSchedulesResponse instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.ListBackupSchedulesResponse - * @static - * @param {google.spanner.admin.database.v1.IListBackupSchedulesResponse=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.ListBackupSchedulesResponse} ListBackupSchedulesResponse instance - */ - ListBackupSchedulesResponse.create = function create(properties) { - return new ListBackupSchedulesResponse(properties); - }; - - /** - * Encodes the specified ListBackupSchedulesResponse message. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupSchedulesResponse.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.ListBackupSchedulesResponse - * @static - * @param {google.spanner.admin.database.v1.IListBackupSchedulesResponse} message ListBackupSchedulesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListBackupSchedulesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.backupSchedules != null && message.backupSchedules.length) - for (var i = 0; i < message.backupSchedules.length; ++i) - $root.google.spanner.admin.database.v1.BackupSchedule.encode(message.backupSchedules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - return writer; - }; - - /** - * Encodes the specified ListBackupSchedulesResponse message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListBackupSchedulesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.ListBackupSchedulesResponse - * @static - * @param {google.spanner.admin.database.v1.IListBackupSchedulesResponse} message ListBackupSchedulesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListBackupSchedulesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListBackupSchedulesResponse message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.ListBackupSchedulesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.ListBackupSchedulesResponse} ListBackupSchedulesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListBackupSchedulesResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.ListBackupSchedulesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.backupSchedules && message.backupSchedules.length)) - message.backupSchedules = []; - message.backupSchedules.push($root.google.spanner.admin.database.v1.BackupSchedule.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListBackupSchedulesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.ListBackupSchedulesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.ListBackupSchedulesResponse} ListBackupSchedulesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListBackupSchedulesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListBackupSchedulesResponse message. - * @function verify - * @memberof google.spanner.admin.database.v1.ListBackupSchedulesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListBackupSchedulesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.backupSchedules != null && message.hasOwnProperty("backupSchedules")) { - if (!Array.isArray(message.backupSchedules)) - return "backupSchedules: array expected"; - for (var i = 0; i < message.backupSchedules.length; ++i) { - var error = $root.google.spanner.admin.database.v1.BackupSchedule.verify(message.backupSchedules[i]); - if (error) - return "backupSchedules." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListBackupSchedulesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.ListBackupSchedulesResponse - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.ListBackupSchedulesResponse} ListBackupSchedulesResponse - */ - ListBackupSchedulesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.ListBackupSchedulesResponse) - return object; - var message = new $root.google.spanner.admin.database.v1.ListBackupSchedulesResponse(); - if (object.backupSchedules) { - if (!Array.isArray(object.backupSchedules)) - throw TypeError(".google.spanner.admin.database.v1.ListBackupSchedulesResponse.backupSchedules: array expected"); - message.backupSchedules = []; - for (var i = 0; i < object.backupSchedules.length; ++i) { - if (typeof object.backupSchedules[i] !== "object") - throw TypeError(".google.spanner.admin.database.v1.ListBackupSchedulesResponse.backupSchedules: object expected"); - message.backupSchedules[i] = $root.google.spanner.admin.database.v1.BackupSchedule.fromObject(object.backupSchedules[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListBackupSchedulesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.ListBackupSchedulesResponse - * @static - * @param {google.spanner.admin.database.v1.ListBackupSchedulesResponse} message ListBackupSchedulesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListBackupSchedulesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.backupSchedules = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.backupSchedules && message.backupSchedules.length) { - object.backupSchedules = []; - for (var j = 0; j < message.backupSchedules.length; ++j) - object.backupSchedules[j] = $root.google.spanner.admin.database.v1.BackupSchedule.toObject(message.backupSchedules[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListBackupSchedulesResponse to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.ListBackupSchedulesResponse - * @instance - * @returns {Object.} JSON object - */ - ListBackupSchedulesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListBackupSchedulesResponse - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.ListBackupSchedulesResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListBackupSchedulesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.ListBackupSchedulesResponse"; - }; - - return ListBackupSchedulesResponse; - })(); - - v1.UpdateBackupScheduleRequest = (function() { - - /** - * Properties of an UpdateBackupScheduleRequest. - * @memberof google.spanner.admin.database.v1 - * @interface IUpdateBackupScheduleRequest - * @property {google.spanner.admin.database.v1.IBackupSchedule|null} [backupSchedule] UpdateBackupScheduleRequest backupSchedule - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateBackupScheduleRequest updateMask - */ - - /** - * Constructs a new UpdateBackupScheduleRequest. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents an UpdateBackupScheduleRequest. - * @implements IUpdateBackupScheduleRequest - * @constructor - * @param {google.spanner.admin.database.v1.IUpdateBackupScheduleRequest=} [properties] Properties to set - */ - function UpdateBackupScheduleRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateBackupScheduleRequest backupSchedule. - * @member {google.spanner.admin.database.v1.IBackupSchedule|null|undefined} backupSchedule - * @memberof google.spanner.admin.database.v1.UpdateBackupScheduleRequest - * @instance - */ - UpdateBackupScheduleRequest.prototype.backupSchedule = null; - - /** - * UpdateBackupScheduleRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.spanner.admin.database.v1.UpdateBackupScheduleRequest - * @instance - */ - UpdateBackupScheduleRequest.prototype.updateMask = null; - - /** - * Creates a new UpdateBackupScheduleRequest instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.UpdateBackupScheduleRequest - * @static - * @param {google.spanner.admin.database.v1.IUpdateBackupScheduleRequest=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.UpdateBackupScheduleRequest} UpdateBackupScheduleRequest instance - */ - UpdateBackupScheduleRequest.create = function create(properties) { - return new UpdateBackupScheduleRequest(properties); - }; - - /** - * Encodes the specified UpdateBackupScheduleRequest message. Does not implicitly {@link google.spanner.admin.database.v1.UpdateBackupScheduleRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.UpdateBackupScheduleRequest - * @static - * @param {google.spanner.admin.database.v1.IUpdateBackupScheduleRequest} message UpdateBackupScheduleRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateBackupScheduleRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.backupSchedule != null && Object.hasOwnProperty.call(message, "backupSchedule")) - $root.google.spanner.admin.database.v1.BackupSchedule.encode(message.backupSchedule, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified UpdateBackupScheduleRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.UpdateBackupScheduleRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.UpdateBackupScheduleRequest - * @static - * @param {google.spanner.admin.database.v1.IUpdateBackupScheduleRequest} message UpdateBackupScheduleRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateBackupScheduleRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateBackupScheduleRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.UpdateBackupScheduleRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.UpdateBackupScheduleRequest} UpdateBackupScheduleRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateBackupScheduleRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.UpdateBackupScheduleRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.backupSchedule = $root.google.spanner.admin.database.v1.BackupSchedule.decode(reader, reader.uint32()); - break; - } - case 2: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateBackupScheduleRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.UpdateBackupScheduleRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.UpdateBackupScheduleRequest} UpdateBackupScheduleRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateBackupScheduleRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateBackupScheduleRequest message. - * @function verify - * @memberof google.spanner.admin.database.v1.UpdateBackupScheduleRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateBackupScheduleRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.backupSchedule != null && message.hasOwnProperty("backupSchedule")) { - var error = $root.google.spanner.admin.database.v1.BackupSchedule.verify(message.backupSchedule); - if (error) - return "backupSchedule." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - return null; - }; - - /** - * Creates an UpdateBackupScheduleRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.UpdateBackupScheduleRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.UpdateBackupScheduleRequest} UpdateBackupScheduleRequest - */ - UpdateBackupScheduleRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.UpdateBackupScheduleRequest) - return object; - var message = new $root.google.spanner.admin.database.v1.UpdateBackupScheduleRequest(); - if (object.backupSchedule != null) { - if (typeof object.backupSchedule !== "object") - throw TypeError(".google.spanner.admin.database.v1.UpdateBackupScheduleRequest.backupSchedule: object expected"); - message.backupSchedule = $root.google.spanner.admin.database.v1.BackupSchedule.fromObject(object.backupSchedule); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.spanner.admin.database.v1.UpdateBackupScheduleRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - return message; - }; - - /** - * Creates a plain object from an UpdateBackupScheduleRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.UpdateBackupScheduleRequest - * @static - * @param {google.spanner.admin.database.v1.UpdateBackupScheduleRequest} message UpdateBackupScheduleRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateBackupScheduleRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.backupSchedule = null; - object.updateMask = null; - } - if (message.backupSchedule != null && message.hasOwnProperty("backupSchedule")) - object.backupSchedule = $root.google.spanner.admin.database.v1.BackupSchedule.toObject(message.backupSchedule, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - return object; - }; - - /** - * Converts this UpdateBackupScheduleRequest to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.UpdateBackupScheduleRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateBackupScheduleRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateBackupScheduleRequest - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.UpdateBackupScheduleRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateBackupScheduleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.UpdateBackupScheduleRequest"; - }; - - return UpdateBackupScheduleRequest; - })(); - - v1.DatabaseAdmin = (function() { - - /** - * Constructs a new DatabaseAdmin service. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents a DatabaseAdmin - * @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 DatabaseAdmin(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (DatabaseAdmin.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = DatabaseAdmin; - - /** - * Creates new DatabaseAdmin service using the specified rpc implementation. - * @function create - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @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 {DatabaseAdmin} RPC service. Useful where requests and/or responses are streamed. - */ - DatabaseAdmin.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|listDatabases}. - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @typedef ListDatabasesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.spanner.admin.database.v1.ListDatabasesResponse} [response] ListDatabasesResponse - */ - - /** - * Calls ListDatabases. - * @function listDatabases - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.IListDatabasesRequest} request ListDatabasesRequest message or plain object - * @param {google.spanner.admin.database.v1.DatabaseAdmin.ListDatabasesCallback} callback Node-style callback called with the error, if any, and ListDatabasesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DatabaseAdmin.prototype.listDatabases = function listDatabases(request, callback) { - return this.rpcCall(listDatabases, $root.google.spanner.admin.database.v1.ListDatabasesRequest, $root.google.spanner.admin.database.v1.ListDatabasesResponse, request, callback); - }, "name", { value: "ListDatabases" }); - - /** - * Calls ListDatabases. - * @function listDatabases - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.IListDatabasesRequest} request ListDatabasesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|createDatabase}. - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @typedef CreateDatabaseCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls CreateDatabase. - * @function createDatabase - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.ICreateDatabaseRequest} request CreateDatabaseRequest message or plain object - * @param {google.spanner.admin.database.v1.DatabaseAdmin.CreateDatabaseCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DatabaseAdmin.prototype.createDatabase = function createDatabase(request, callback) { - return this.rpcCall(createDatabase, $root.google.spanner.admin.database.v1.CreateDatabaseRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "CreateDatabase" }); - - /** - * Calls CreateDatabase. - * @function createDatabase - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.ICreateDatabaseRequest} request CreateDatabaseRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|getDatabase}. - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @typedef GetDatabaseCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.spanner.admin.database.v1.Database} [response] Database - */ - - /** - * Calls GetDatabase. - * @function getDatabase - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.IGetDatabaseRequest} request GetDatabaseRequest message or plain object - * @param {google.spanner.admin.database.v1.DatabaseAdmin.GetDatabaseCallback} callback Node-style callback called with the error, if any, and Database - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DatabaseAdmin.prototype.getDatabase = function getDatabase(request, callback) { - return this.rpcCall(getDatabase, $root.google.spanner.admin.database.v1.GetDatabaseRequest, $root.google.spanner.admin.database.v1.Database, request, callback); - }, "name", { value: "GetDatabase" }); - - /** - * Calls GetDatabase. - * @function getDatabase - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.IGetDatabaseRequest} request GetDatabaseRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|updateDatabase}. - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @typedef UpdateDatabaseCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls UpdateDatabase. - * @function updateDatabase - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.IUpdateDatabaseRequest} request UpdateDatabaseRequest message or plain object - * @param {google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DatabaseAdmin.prototype.updateDatabase = function updateDatabase(request, callback) { - return this.rpcCall(updateDatabase, $root.google.spanner.admin.database.v1.UpdateDatabaseRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "UpdateDatabase" }); - - /** - * Calls UpdateDatabase. - * @function updateDatabase - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.IUpdateDatabaseRequest} request UpdateDatabaseRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|updateDatabaseDdl}. - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @typedef UpdateDatabaseDdlCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls UpdateDatabaseDdl. - * @function updateDatabaseDdl - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.IUpdateDatabaseDdlRequest} request UpdateDatabaseDdlRequest message or plain object - * @param {google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdlCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DatabaseAdmin.prototype.updateDatabaseDdl = function updateDatabaseDdl(request, callback) { - return this.rpcCall(updateDatabaseDdl, $root.google.spanner.admin.database.v1.UpdateDatabaseDdlRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "UpdateDatabaseDdl" }); - - /** - * Calls UpdateDatabaseDdl. - * @function updateDatabaseDdl - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.IUpdateDatabaseDdlRequest} request UpdateDatabaseDdlRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|dropDatabase}. - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @typedef DropDatabaseCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DropDatabase. - * @function dropDatabase - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.IDropDatabaseRequest} request DropDatabaseRequest message or plain object - * @param {google.spanner.admin.database.v1.DatabaseAdmin.DropDatabaseCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DatabaseAdmin.prototype.dropDatabase = function dropDatabase(request, callback) { - return this.rpcCall(dropDatabase, $root.google.spanner.admin.database.v1.DropDatabaseRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DropDatabase" }); - - /** - * Calls DropDatabase. - * @function dropDatabase - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.IDropDatabaseRequest} request DropDatabaseRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|getDatabaseDdl}. - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @typedef GetDatabaseDdlCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.spanner.admin.database.v1.GetDatabaseDdlResponse} [response] GetDatabaseDdlResponse - */ - - /** - * Calls GetDatabaseDdl. - * @function getDatabaseDdl - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.IGetDatabaseDdlRequest} request GetDatabaseDdlRequest message or plain object - * @param {google.spanner.admin.database.v1.DatabaseAdmin.GetDatabaseDdlCallback} callback Node-style callback called with the error, if any, and GetDatabaseDdlResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DatabaseAdmin.prototype.getDatabaseDdl = function getDatabaseDdl(request, callback) { - return this.rpcCall(getDatabaseDdl, $root.google.spanner.admin.database.v1.GetDatabaseDdlRequest, $root.google.spanner.admin.database.v1.GetDatabaseDdlResponse, request, callback); - }, "name", { value: "GetDatabaseDdl" }); - - /** - * Calls GetDatabaseDdl. - * @function getDatabaseDdl - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.IGetDatabaseDdlRequest} request GetDatabaseDdlRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|setIamPolicy}. - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @typedef SetIamPolicyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.iam.v1.Policy} [response] Policy - */ - - /** - * Calls SetIamPolicy. - * @function setIamPolicy - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object - * @param {google.spanner.admin.database.v1.DatabaseAdmin.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DatabaseAdmin.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.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|getIamPolicy}. - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @typedef GetIamPolicyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.iam.v1.Policy} [response] Policy - */ - - /** - * Calls GetIamPolicy. - * @function getIamPolicy - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object - * @param {google.spanner.admin.database.v1.DatabaseAdmin.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DatabaseAdmin.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.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|testIamPermissions}. - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @typedef TestIamPermissionsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.iam.v1.TestIamPermissionsResponse} [response] TestIamPermissionsResponse - */ - - /** - * Calls TestIamPermissions. - * @function testIamPermissions - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object - * @param {google.spanner.admin.database.v1.DatabaseAdmin.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestIamPermissionsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DatabaseAdmin.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.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|createBackup}. - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @typedef CreateBackupCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls CreateBackup. - * @function createBackup - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.ICreateBackupRequest} request CreateBackupRequest message or plain object - * @param {google.spanner.admin.database.v1.DatabaseAdmin.CreateBackupCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DatabaseAdmin.prototype.createBackup = function createBackup(request, callback) { - return this.rpcCall(createBackup, $root.google.spanner.admin.database.v1.CreateBackupRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "CreateBackup" }); - - /** - * Calls CreateBackup. - * @function createBackup - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.ICreateBackupRequest} request CreateBackupRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|copyBackup}. - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @typedef CopyBackupCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls CopyBackup. - * @function copyBackup - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.ICopyBackupRequest} request CopyBackupRequest message or plain object - * @param {google.spanner.admin.database.v1.DatabaseAdmin.CopyBackupCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DatabaseAdmin.prototype.copyBackup = function copyBackup(request, callback) { - return this.rpcCall(copyBackup, $root.google.spanner.admin.database.v1.CopyBackupRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "CopyBackup" }); - - /** - * Calls CopyBackup. - * @function copyBackup - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.ICopyBackupRequest} request CopyBackupRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|getBackup}. - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @typedef GetBackupCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.spanner.admin.database.v1.Backup} [response] Backup - */ - - /** - * Calls GetBackup. - * @function getBackup - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.IGetBackupRequest} request GetBackupRequest message or plain object - * @param {google.spanner.admin.database.v1.DatabaseAdmin.GetBackupCallback} callback Node-style callback called with the error, if any, and Backup - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DatabaseAdmin.prototype.getBackup = function getBackup(request, callback) { - return this.rpcCall(getBackup, $root.google.spanner.admin.database.v1.GetBackupRequest, $root.google.spanner.admin.database.v1.Backup, request, callback); - }, "name", { value: "GetBackup" }); - - /** - * Calls GetBackup. - * @function getBackup - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.IGetBackupRequest} request GetBackupRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|updateBackup}. - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @typedef UpdateBackupCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.spanner.admin.database.v1.Backup} [response] Backup - */ - - /** - * Calls UpdateBackup. - * @function updateBackup - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.IUpdateBackupRequest} request UpdateBackupRequest message or plain object - * @param {google.spanner.admin.database.v1.DatabaseAdmin.UpdateBackupCallback} callback Node-style callback called with the error, if any, and Backup - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DatabaseAdmin.prototype.updateBackup = function updateBackup(request, callback) { - return this.rpcCall(updateBackup, $root.google.spanner.admin.database.v1.UpdateBackupRequest, $root.google.spanner.admin.database.v1.Backup, request, callback); - }, "name", { value: "UpdateBackup" }); - - /** - * Calls UpdateBackup. - * @function updateBackup - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.IUpdateBackupRequest} request UpdateBackupRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|deleteBackup}. - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @typedef DeleteBackupCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteBackup. - * @function deleteBackup - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.IDeleteBackupRequest} request DeleteBackupRequest message or plain object - * @param {google.spanner.admin.database.v1.DatabaseAdmin.DeleteBackupCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DatabaseAdmin.prototype.deleteBackup = function deleteBackup(request, callback) { - return this.rpcCall(deleteBackup, $root.google.spanner.admin.database.v1.DeleteBackupRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteBackup" }); - - /** - * Calls DeleteBackup. - * @function deleteBackup - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.IDeleteBackupRequest} request DeleteBackupRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|listBackups}. - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @typedef ListBackupsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.spanner.admin.database.v1.ListBackupsResponse} [response] ListBackupsResponse - */ - - /** - * Calls ListBackups. - * @function listBackups - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.IListBackupsRequest} request ListBackupsRequest message or plain object - * @param {google.spanner.admin.database.v1.DatabaseAdmin.ListBackupsCallback} callback Node-style callback called with the error, if any, and ListBackupsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DatabaseAdmin.prototype.listBackups = function listBackups(request, callback) { - return this.rpcCall(listBackups, $root.google.spanner.admin.database.v1.ListBackupsRequest, $root.google.spanner.admin.database.v1.ListBackupsResponse, request, callback); - }, "name", { value: "ListBackups" }); - - /** - * Calls ListBackups. - * @function listBackups - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.IListBackupsRequest} request ListBackupsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|restoreDatabase}. - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @typedef RestoreDatabaseCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls RestoreDatabase. - * @function restoreDatabase - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.IRestoreDatabaseRequest} request RestoreDatabaseRequest message or plain object - * @param {google.spanner.admin.database.v1.DatabaseAdmin.RestoreDatabaseCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DatabaseAdmin.prototype.restoreDatabase = function restoreDatabase(request, callback) { - return this.rpcCall(restoreDatabase, $root.google.spanner.admin.database.v1.RestoreDatabaseRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "RestoreDatabase" }); - - /** - * Calls RestoreDatabase. - * @function restoreDatabase - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.IRestoreDatabaseRequest} request RestoreDatabaseRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|listDatabaseOperations}. - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @typedef ListDatabaseOperationsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.spanner.admin.database.v1.ListDatabaseOperationsResponse} [response] ListDatabaseOperationsResponse - */ - - /** - * Calls ListDatabaseOperations. - * @function listDatabaseOperations - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.IListDatabaseOperationsRequest} request ListDatabaseOperationsRequest message or plain object - * @param {google.spanner.admin.database.v1.DatabaseAdmin.ListDatabaseOperationsCallback} callback Node-style callback called with the error, if any, and ListDatabaseOperationsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DatabaseAdmin.prototype.listDatabaseOperations = function listDatabaseOperations(request, callback) { - return this.rpcCall(listDatabaseOperations, $root.google.spanner.admin.database.v1.ListDatabaseOperationsRequest, $root.google.spanner.admin.database.v1.ListDatabaseOperationsResponse, request, callback); - }, "name", { value: "ListDatabaseOperations" }); - - /** - * Calls ListDatabaseOperations. - * @function listDatabaseOperations - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.IListDatabaseOperationsRequest} request ListDatabaseOperationsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|listBackupOperations}. - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @typedef ListBackupOperationsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.spanner.admin.database.v1.ListBackupOperationsResponse} [response] ListBackupOperationsResponse - */ - - /** - * Calls ListBackupOperations. - * @function listBackupOperations - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.IListBackupOperationsRequest} request ListBackupOperationsRequest message or plain object - * @param {google.spanner.admin.database.v1.DatabaseAdmin.ListBackupOperationsCallback} callback Node-style callback called with the error, if any, and ListBackupOperationsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DatabaseAdmin.prototype.listBackupOperations = function listBackupOperations(request, callback) { - return this.rpcCall(listBackupOperations, $root.google.spanner.admin.database.v1.ListBackupOperationsRequest, $root.google.spanner.admin.database.v1.ListBackupOperationsResponse, request, callback); - }, "name", { value: "ListBackupOperations" }); - - /** - * Calls ListBackupOperations. - * @function listBackupOperations - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.IListBackupOperationsRequest} request ListBackupOperationsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|listDatabaseRoles}. - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @typedef ListDatabaseRolesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.spanner.admin.database.v1.ListDatabaseRolesResponse} [response] ListDatabaseRolesResponse - */ - - /** - * Calls ListDatabaseRoles. - * @function listDatabaseRoles - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.IListDatabaseRolesRequest} request ListDatabaseRolesRequest message or plain object - * @param {google.spanner.admin.database.v1.DatabaseAdmin.ListDatabaseRolesCallback} callback Node-style callback called with the error, if any, and ListDatabaseRolesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DatabaseAdmin.prototype.listDatabaseRoles = function listDatabaseRoles(request, callback) { - return this.rpcCall(listDatabaseRoles, $root.google.spanner.admin.database.v1.ListDatabaseRolesRequest, $root.google.spanner.admin.database.v1.ListDatabaseRolesResponse, request, callback); - }, "name", { value: "ListDatabaseRoles" }); - - /** - * Calls ListDatabaseRoles. - * @function listDatabaseRoles - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.IListDatabaseRolesRequest} request ListDatabaseRolesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|addSplitPoints}. - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @typedef AddSplitPointsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.spanner.admin.database.v1.AddSplitPointsResponse} [response] AddSplitPointsResponse - */ - - /** - * Calls AddSplitPoints. - * @function addSplitPoints - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.IAddSplitPointsRequest} request AddSplitPointsRequest message or plain object - * @param {google.spanner.admin.database.v1.DatabaseAdmin.AddSplitPointsCallback} callback Node-style callback called with the error, if any, and AddSplitPointsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DatabaseAdmin.prototype.addSplitPoints = function addSplitPoints(request, callback) { - return this.rpcCall(addSplitPoints, $root.google.spanner.admin.database.v1.AddSplitPointsRequest, $root.google.spanner.admin.database.v1.AddSplitPointsResponse, request, callback); - }, "name", { value: "AddSplitPoints" }); - - /** - * Calls AddSplitPoints. - * @function addSplitPoints - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.IAddSplitPointsRequest} request AddSplitPointsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|createBackupSchedule}. - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @typedef CreateBackupScheduleCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.spanner.admin.database.v1.BackupSchedule} [response] BackupSchedule - */ - - /** - * Calls CreateBackupSchedule. - * @function createBackupSchedule - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.ICreateBackupScheduleRequest} request CreateBackupScheduleRequest message or plain object - * @param {google.spanner.admin.database.v1.DatabaseAdmin.CreateBackupScheduleCallback} callback Node-style callback called with the error, if any, and BackupSchedule - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DatabaseAdmin.prototype.createBackupSchedule = function createBackupSchedule(request, callback) { - return this.rpcCall(createBackupSchedule, $root.google.spanner.admin.database.v1.CreateBackupScheduleRequest, $root.google.spanner.admin.database.v1.BackupSchedule, request, callback); - }, "name", { value: "CreateBackupSchedule" }); - - /** - * Calls CreateBackupSchedule. - * @function createBackupSchedule - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.ICreateBackupScheduleRequest} request CreateBackupScheduleRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|getBackupSchedule}. - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @typedef GetBackupScheduleCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.spanner.admin.database.v1.BackupSchedule} [response] BackupSchedule - */ - - /** - * Calls GetBackupSchedule. - * @function getBackupSchedule - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.IGetBackupScheduleRequest} request GetBackupScheduleRequest message or plain object - * @param {google.spanner.admin.database.v1.DatabaseAdmin.GetBackupScheduleCallback} callback Node-style callback called with the error, if any, and BackupSchedule - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DatabaseAdmin.prototype.getBackupSchedule = function getBackupSchedule(request, callback) { - return this.rpcCall(getBackupSchedule, $root.google.spanner.admin.database.v1.GetBackupScheduleRequest, $root.google.spanner.admin.database.v1.BackupSchedule, request, callback); - }, "name", { value: "GetBackupSchedule" }); - - /** - * Calls GetBackupSchedule. - * @function getBackupSchedule - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.IGetBackupScheduleRequest} request GetBackupScheduleRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|updateBackupSchedule}. - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @typedef UpdateBackupScheduleCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.spanner.admin.database.v1.BackupSchedule} [response] BackupSchedule - */ - - /** - * Calls UpdateBackupSchedule. - * @function updateBackupSchedule - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.IUpdateBackupScheduleRequest} request UpdateBackupScheduleRequest message or plain object - * @param {google.spanner.admin.database.v1.DatabaseAdmin.UpdateBackupScheduleCallback} callback Node-style callback called with the error, if any, and BackupSchedule - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DatabaseAdmin.prototype.updateBackupSchedule = function updateBackupSchedule(request, callback) { - return this.rpcCall(updateBackupSchedule, $root.google.spanner.admin.database.v1.UpdateBackupScheduleRequest, $root.google.spanner.admin.database.v1.BackupSchedule, request, callback); - }, "name", { value: "UpdateBackupSchedule" }); - - /** - * Calls UpdateBackupSchedule. - * @function updateBackupSchedule - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.IUpdateBackupScheduleRequest} request UpdateBackupScheduleRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|deleteBackupSchedule}. - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @typedef DeleteBackupScheduleCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteBackupSchedule. - * @function deleteBackupSchedule - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.IDeleteBackupScheduleRequest} request DeleteBackupScheduleRequest message or plain object - * @param {google.spanner.admin.database.v1.DatabaseAdmin.DeleteBackupScheduleCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DatabaseAdmin.prototype.deleteBackupSchedule = function deleteBackupSchedule(request, callback) { - return this.rpcCall(deleteBackupSchedule, $root.google.spanner.admin.database.v1.DeleteBackupScheduleRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteBackupSchedule" }); - - /** - * Calls DeleteBackupSchedule. - * @function deleteBackupSchedule - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.IDeleteBackupScheduleRequest} request DeleteBackupScheduleRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|listBackupSchedules}. - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @typedef ListBackupSchedulesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.spanner.admin.database.v1.ListBackupSchedulesResponse} [response] ListBackupSchedulesResponse - */ - - /** - * Calls ListBackupSchedules. - * @function listBackupSchedules - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.IListBackupSchedulesRequest} request ListBackupSchedulesRequest message or plain object - * @param {google.spanner.admin.database.v1.DatabaseAdmin.ListBackupSchedulesCallback} callback Node-style callback called with the error, if any, and ListBackupSchedulesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DatabaseAdmin.prototype.listBackupSchedules = function listBackupSchedules(request, callback) { - return this.rpcCall(listBackupSchedules, $root.google.spanner.admin.database.v1.ListBackupSchedulesRequest, $root.google.spanner.admin.database.v1.ListBackupSchedulesResponse, request, callback); - }, "name", { value: "ListBackupSchedules" }); - - /** - * Calls ListBackupSchedules. - * @function listBackupSchedules - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.IListBackupSchedulesRequest} request ListBackupSchedulesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.admin.database.v1.DatabaseAdmin|internalUpdateGraphOperation}. - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @typedef InternalUpdateGraphOperationCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse} [response] InternalUpdateGraphOperationResponse - */ - - /** - * Calls InternalUpdateGraphOperation. - * @function internalUpdateGraphOperation - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.IInternalUpdateGraphOperationRequest} request InternalUpdateGraphOperationRequest message or plain object - * @param {google.spanner.admin.database.v1.DatabaseAdmin.InternalUpdateGraphOperationCallback} callback Node-style callback called with the error, if any, and InternalUpdateGraphOperationResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DatabaseAdmin.prototype.internalUpdateGraphOperation = function internalUpdateGraphOperation(request, callback) { - return this.rpcCall(internalUpdateGraphOperation, $root.google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest, $root.google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse, request, callback); - }, "name", { value: "InternalUpdateGraphOperation" }); - - /** - * Calls InternalUpdateGraphOperation. - * @function internalUpdateGraphOperation - * @memberof google.spanner.admin.database.v1.DatabaseAdmin - * @instance - * @param {google.spanner.admin.database.v1.IInternalUpdateGraphOperationRequest} request InternalUpdateGraphOperationRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return DatabaseAdmin; - })(); - - v1.RestoreInfo = (function() { - - /** - * Properties of a RestoreInfo. - * @memberof google.spanner.admin.database.v1 - * @interface IRestoreInfo - * @property {google.spanner.admin.database.v1.RestoreSourceType|null} [sourceType] RestoreInfo sourceType - * @property {google.spanner.admin.database.v1.IBackupInfo|null} [backupInfo] RestoreInfo backupInfo - */ - - /** - * Constructs a new RestoreInfo. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents a RestoreInfo. - * @implements IRestoreInfo - * @constructor - * @param {google.spanner.admin.database.v1.IRestoreInfo=} [properties] Properties to set - */ - function RestoreInfo(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RestoreInfo sourceType. - * @member {google.spanner.admin.database.v1.RestoreSourceType} sourceType - * @memberof google.spanner.admin.database.v1.RestoreInfo - * @instance - */ - RestoreInfo.prototype.sourceType = 0; - - /** - * RestoreInfo backupInfo. - * @member {google.spanner.admin.database.v1.IBackupInfo|null|undefined} backupInfo - * @memberof google.spanner.admin.database.v1.RestoreInfo - * @instance - */ - RestoreInfo.prototype.backupInfo = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * RestoreInfo sourceInfo. - * @member {"backupInfo"|undefined} sourceInfo - * @memberof google.spanner.admin.database.v1.RestoreInfo - * @instance - */ - Object.defineProperty(RestoreInfo.prototype, "sourceInfo", { - get: $util.oneOfGetter($oneOfFields = ["backupInfo"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new RestoreInfo instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.RestoreInfo - * @static - * @param {google.spanner.admin.database.v1.IRestoreInfo=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.RestoreInfo} RestoreInfo instance - */ - RestoreInfo.create = function create(properties) { - return new RestoreInfo(properties); - }; - - /** - * Encodes the specified RestoreInfo message. Does not implicitly {@link google.spanner.admin.database.v1.RestoreInfo.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.RestoreInfo - * @static - * @param {google.spanner.admin.database.v1.IRestoreInfo} message RestoreInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RestoreInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.sourceType != null && Object.hasOwnProperty.call(message, "sourceType")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.sourceType); - if (message.backupInfo != null && Object.hasOwnProperty.call(message, "backupInfo")) - $root.google.spanner.admin.database.v1.BackupInfo.encode(message.backupInfo, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified RestoreInfo message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.RestoreInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.RestoreInfo - * @static - * @param {google.spanner.admin.database.v1.IRestoreInfo} message RestoreInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RestoreInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RestoreInfo message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.RestoreInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.RestoreInfo} RestoreInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RestoreInfo.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.RestoreInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.sourceType = reader.int32(); - break; - } - case 2: { - message.backupInfo = $root.google.spanner.admin.database.v1.BackupInfo.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RestoreInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.RestoreInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.RestoreInfo} RestoreInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RestoreInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RestoreInfo message. - * @function verify - * @memberof google.spanner.admin.database.v1.RestoreInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RestoreInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.sourceType != null && message.hasOwnProperty("sourceType")) - switch (message.sourceType) { - default: - return "sourceType: enum value expected"; - case 0: - case 1: - break; - } - if (message.backupInfo != null && message.hasOwnProperty("backupInfo")) { - properties.sourceInfo = 1; - { - var error = $root.google.spanner.admin.database.v1.BackupInfo.verify(message.backupInfo); - if (error) - return "backupInfo." + error; - } - } - return null; - }; - - /** - * Creates a RestoreInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.RestoreInfo - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.RestoreInfo} RestoreInfo - */ - RestoreInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.RestoreInfo) - return object; - var message = new $root.google.spanner.admin.database.v1.RestoreInfo(); - switch (object.sourceType) { - default: - if (typeof object.sourceType === "number") { - message.sourceType = object.sourceType; - break; - } - break; - case "TYPE_UNSPECIFIED": - case 0: - message.sourceType = 0; - break; - case "BACKUP": - case 1: - message.sourceType = 1; - break; - } - if (object.backupInfo != null) { - if (typeof object.backupInfo !== "object") - throw TypeError(".google.spanner.admin.database.v1.RestoreInfo.backupInfo: object expected"); - message.backupInfo = $root.google.spanner.admin.database.v1.BackupInfo.fromObject(object.backupInfo); - } - return message; - }; - - /** - * Creates a plain object from a RestoreInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.RestoreInfo - * @static - * @param {google.spanner.admin.database.v1.RestoreInfo} message RestoreInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RestoreInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.sourceType = options.enums === String ? "TYPE_UNSPECIFIED" : 0; - if (message.sourceType != null && message.hasOwnProperty("sourceType")) - object.sourceType = options.enums === String ? $root.google.spanner.admin.database.v1.RestoreSourceType[message.sourceType] === undefined ? message.sourceType : $root.google.spanner.admin.database.v1.RestoreSourceType[message.sourceType] : message.sourceType; - if (message.backupInfo != null && message.hasOwnProperty("backupInfo")) { - object.backupInfo = $root.google.spanner.admin.database.v1.BackupInfo.toObject(message.backupInfo, options); - if (options.oneofs) - object.sourceInfo = "backupInfo"; - } - return object; - }; - - /** - * Converts this RestoreInfo to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.RestoreInfo - * @instance - * @returns {Object.} JSON object - */ - RestoreInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RestoreInfo - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.RestoreInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RestoreInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.RestoreInfo"; - }; - - return RestoreInfo; - })(); - - v1.Database = (function() { - - /** - * Properties of a Database. - * @memberof google.spanner.admin.database.v1 - * @interface IDatabase - * @property {string|null} [name] Database name - * @property {google.spanner.admin.database.v1.Database.State|null} [state] Database state - * @property {google.protobuf.ITimestamp|null} [createTime] Database createTime - * @property {google.spanner.admin.database.v1.IRestoreInfo|null} [restoreInfo] Database restoreInfo - * @property {google.spanner.admin.database.v1.IEncryptionConfig|null} [encryptionConfig] Database encryptionConfig - * @property {Array.|null} [encryptionInfo] Database encryptionInfo - * @property {string|null} [versionRetentionPeriod] Database versionRetentionPeriod - * @property {google.protobuf.ITimestamp|null} [earliestVersionTime] Database earliestVersionTime - * @property {string|null} [defaultLeader] Database defaultLeader - * @property {google.spanner.admin.database.v1.DatabaseDialect|null} [databaseDialect] Database databaseDialect - * @property {boolean|null} [enableDropProtection] Database enableDropProtection - * @property {boolean|null} [reconciling] Database reconciling - */ - - /** - * Constructs a new Database. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents a Database. - * @implements IDatabase - * @constructor - * @param {google.spanner.admin.database.v1.IDatabase=} [properties] Properties to set - */ - function Database(properties) { - this.encryptionInfo = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Database name. - * @member {string} name - * @memberof google.spanner.admin.database.v1.Database - * @instance - */ - Database.prototype.name = ""; - - /** - * Database state. - * @member {google.spanner.admin.database.v1.Database.State} state - * @memberof google.spanner.admin.database.v1.Database - * @instance - */ - Database.prototype.state = 0; - - /** - * Database createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.spanner.admin.database.v1.Database - * @instance - */ - Database.prototype.createTime = null; - - /** - * Database restoreInfo. - * @member {google.spanner.admin.database.v1.IRestoreInfo|null|undefined} restoreInfo - * @memberof google.spanner.admin.database.v1.Database - * @instance - */ - Database.prototype.restoreInfo = null; - - /** - * Database encryptionConfig. - * @member {google.spanner.admin.database.v1.IEncryptionConfig|null|undefined} encryptionConfig - * @memberof google.spanner.admin.database.v1.Database - * @instance - */ - Database.prototype.encryptionConfig = null; - - /** - * Database encryptionInfo. - * @member {Array.} encryptionInfo - * @memberof google.spanner.admin.database.v1.Database - * @instance - */ - Database.prototype.encryptionInfo = $util.emptyArray; - - /** - * Database versionRetentionPeriod. - * @member {string} versionRetentionPeriod - * @memberof google.spanner.admin.database.v1.Database - * @instance - */ - Database.prototype.versionRetentionPeriod = ""; - - /** - * Database earliestVersionTime. - * @member {google.protobuf.ITimestamp|null|undefined} earliestVersionTime - * @memberof google.spanner.admin.database.v1.Database - * @instance - */ - Database.prototype.earliestVersionTime = null; - - /** - * Database defaultLeader. - * @member {string} defaultLeader - * @memberof google.spanner.admin.database.v1.Database - * @instance - */ - Database.prototype.defaultLeader = ""; - - /** - * Database databaseDialect. - * @member {google.spanner.admin.database.v1.DatabaseDialect} databaseDialect - * @memberof google.spanner.admin.database.v1.Database - * @instance - */ - Database.prototype.databaseDialect = 0; - - /** - * Database enableDropProtection. - * @member {boolean} enableDropProtection - * @memberof google.spanner.admin.database.v1.Database - * @instance - */ - Database.prototype.enableDropProtection = false; - - /** - * Database reconciling. - * @member {boolean} reconciling - * @memberof google.spanner.admin.database.v1.Database - * @instance - */ - Database.prototype.reconciling = false; - - /** - * Creates a new Database instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.Database - * @static - * @param {google.spanner.admin.database.v1.IDatabase=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.Database} Database instance - */ - Database.create = function create(properties) { - return new Database(properties); - }; - - /** - * Encodes the specified Database message. Does not implicitly {@link google.spanner.admin.database.v1.Database.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.Database - * @static - * @param {google.spanner.admin.database.v1.IDatabase} message Database message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Database.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.restoreInfo != null && Object.hasOwnProperty.call(message, "restoreInfo")) - $root.google.spanner.admin.database.v1.RestoreInfo.encode(message.restoreInfo, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) - $root.google.spanner.admin.database.v1.EncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.versionRetentionPeriod != null && Object.hasOwnProperty.call(message, "versionRetentionPeriod")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.versionRetentionPeriod); - if (message.earliestVersionTime != null && Object.hasOwnProperty.call(message, "earliestVersionTime")) - $root.google.protobuf.Timestamp.encode(message.earliestVersionTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.encryptionInfo != null && message.encryptionInfo.length) - for (var i = 0; i < message.encryptionInfo.length; ++i) - $root.google.spanner.admin.database.v1.EncryptionInfo.encode(message.encryptionInfo[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.defaultLeader != null && Object.hasOwnProperty.call(message, "defaultLeader")) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.defaultLeader); - if (message.databaseDialect != null && Object.hasOwnProperty.call(message, "databaseDialect")) - writer.uint32(/* id 10, wireType 0 =*/80).int32(message.databaseDialect); - if (message.enableDropProtection != null && Object.hasOwnProperty.call(message, "enableDropProtection")) - writer.uint32(/* id 11, wireType 0 =*/88).bool(message.enableDropProtection); - if (message.reconciling != null && Object.hasOwnProperty.call(message, "reconciling")) - writer.uint32(/* id 12, wireType 0 =*/96).bool(message.reconciling); - return writer; - }; - - /** - * Encodes the specified Database message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.Database.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.Database - * @static - * @param {google.spanner.admin.database.v1.IDatabase} message Database message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Database.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Database message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.Database - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.Database} Database - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Database.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.Database(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.state = reader.int32(); - break; - } - case 3: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 4: { - message.restoreInfo = $root.google.spanner.admin.database.v1.RestoreInfo.decode(reader, reader.uint32()); - break; - } - case 5: { - message.encryptionConfig = $root.google.spanner.admin.database.v1.EncryptionConfig.decode(reader, reader.uint32()); - break; - } - case 8: { - if (!(message.encryptionInfo && message.encryptionInfo.length)) - message.encryptionInfo = []; - message.encryptionInfo.push($root.google.spanner.admin.database.v1.EncryptionInfo.decode(reader, reader.uint32())); - break; - } - case 6: { - message.versionRetentionPeriod = reader.string(); - break; - } - case 7: { - message.earliestVersionTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 9: { - message.defaultLeader = reader.string(); - break; - } - case 10: { - message.databaseDialect = reader.int32(); - break; - } - case 11: { - message.enableDropProtection = reader.bool(); - break; - } - case 12: { - message.reconciling = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Database message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.Database - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.Database} Database - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Database.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Database message. - * @function verify - * @memberof google.spanner.admin.database.v1.Database - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Database.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.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.restoreInfo != null && message.hasOwnProperty("restoreInfo")) { - var error = $root.google.spanner.admin.database.v1.RestoreInfo.verify(message.restoreInfo); - if (error) - return "restoreInfo." + error; - } - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { - var error = $root.google.spanner.admin.database.v1.EncryptionConfig.verify(message.encryptionConfig); - if (error) - return "encryptionConfig." + error; - } - if (message.encryptionInfo != null && message.hasOwnProperty("encryptionInfo")) { - if (!Array.isArray(message.encryptionInfo)) - return "encryptionInfo: array expected"; - for (var i = 0; i < message.encryptionInfo.length; ++i) { - var error = $root.google.spanner.admin.database.v1.EncryptionInfo.verify(message.encryptionInfo[i]); - if (error) - return "encryptionInfo." + error; - } - } - if (message.versionRetentionPeriod != null && message.hasOwnProperty("versionRetentionPeriod")) - if (!$util.isString(message.versionRetentionPeriod)) - return "versionRetentionPeriod: string expected"; - if (message.earliestVersionTime != null && message.hasOwnProperty("earliestVersionTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.earliestVersionTime); - if (error) - return "earliestVersionTime." + error; - } - if (message.defaultLeader != null && message.hasOwnProperty("defaultLeader")) - if (!$util.isString(message.defaultLeader)) - return "defaultLeader: string expected"; - if (message.databaseDialect != null && message.hasOwnProperty("databaseDialect")) - switch (message.databaseDialect) { - default: - return "databaseDialect: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.enableDropProtection != null && message.hasOwnProperty("enableDropProtection")) - if (typeof message.enableDropProtection !== "boolean") - return "enableDropProtection: boolean expected"; - if (message.reconciling != null && message.hasOwnProperty("reconciling")) - if (typeof message.reconciling !== "boolean") - return "reconciling: boolean expected"; - return null; - }; - - /** - * Creates a Database message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.Database - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.Database} Database - */ - Database.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.Database) - return object; - var message = new $root.google.spanner.admin.database.v1.Database(); - if (object.name != null) - message.name = String(object.name); - switch (object.state) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "CREATING": - case 1: - message.state = 1; - break; - case "READY": - case 2: - message.state = 2; - break; - case "READY_OPTIMIZING": - case 3: - message.state = 3; - break; - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.spanner.admin.database.v1.Database.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.restoreInfo != null) { - if (typeof object.restoreInfo !== "object") - throw TypeError(".google.spanner.admin.database.v1.Database.restoreInfo: object expected"); - message.restoreInfo = $root.google.spanner.admin.database.v1.RestoreInfo.fromObject(object.restoreInfo); - } - if (object.encryptionConfig != null) { - if (typeof object.encryptionConfig !== "object") - throw TypeError(".google.spanner.admin.database.v1.Database.encryptionConfig: object expected"); - message.encryptionConfig = $root.google.spanner.admin.database.v1.EncryptionConfig.fromObject(object.encryptionConfig); - } - if (object.encryptionInfo) { - if (!Array.isArray(object.encryptionInfo)) - throw TypeError(".google.spanner.admin.database.v1.Database.encryptionInfo: array expected"); - message.encryptionInfo = []; - for (var i = 0; i < object.encryptionInfo.length; ++i) { - if (typeof object.encryptionInfo[i] !== "object") - throw TypeError(".google.spanner.admin.database.v1.Database.encryptionInfo: object expected"); - message.encryptionInfo[i] = $root.google.spanner.admin.database.v1.EncryptionInfo.fromObject(object.encryptionInfo[i]); - } - } - if (object.versionRetentionPeriod != null) - message.versionRetentionPeriod = String(object.versionRetentionPeriod); - if (object.earliestVersionTime != null) { - if (typeof object.earliestVersionTime !== "object") - throw TypeError(".google.spanner.admin.database.v1.Database.earliestVersionTime: object expected"); - message.earliestVersionTime = $root.google.protobuf.Timestamp.fromObject(object.earliestVersionTime); - } - if (object.defaultLeader != null) - message.defaultLeader = String(object.defaultLeader); - switch (object.databaseDialect) { - default: - if (typeof object.databaseDialect === "number") { - message.databaseDialect = object.databaseDialect; - break; - } - break; - case "DATABASE_DIALECT_UNSPECIFIED": - case 0: - message.databaseDialect = 0; - break; - case "GOOGLE_STANDARD_SQL": - case 1: - message.databaseDialect = 1; - break; - case "POSTGRESQL": - case 2: - message.databaseDialect = 2; - break; - } - if (object.enableDropProtection != null) - message.enableDropProtection = Boolean(object.enableDropProtection); - if (object.reconciling != null) - message.reconciling = Boolean(object.reconciling); - return message; - }; - - /** - * Creates a plain object from a Database message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.Database - * @static - * @param {google.spanner.admin.database.v1.Database} message Database - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Database.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.encryptionInfo = []; - if (options.defaults) { - object.name = ""; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.createTime = null; - object.restoreInfo = null; - object.encryptionConfig = null; - object.versionRetentionPeriod = ""; - object.earliestVersionTime = null; - object.defaultLeader = ""; - object.databaseDialect = options.enums === String ? "DATABASE_DIALECT_UNSPECIFIED" : 0; - object.enableDropProtection = false; - object.reconciling = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.spanner.admin.database.v1.Database.State[message.state] === undefined ? message.state : $root.google.spanner.admin.database.v1.Database.State[message.state] : message.state; - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.restoreInfo != null && message.hasOwnProperty("restoreInfo")) - object.restoreInfo = $root.google.spanner.admin.database.v1.RestoreInfo.toObject(message.restoreInfo, options); - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) - object.encryptionConfig = $root.google.spanner.admin.database.v1.EncryptionConfig.toObject(message.encryptionConfig, options); - if (message.versionRetentionPeriod != null && message.hasOwnProperty("versionRetentionPeriod")) - object.versionRetentionPeriod = message.versionRetentionPeriod; - if (message.earliestVersionTime != null && message.hasOwnProperty("earliestVersionTime")) - object.earliestVersionTime = $root.google.protobuf.Timestamp.toObject(message.earliestVersionTime, options); - if (message.encryptionInfo && message.encryptionInfo.length) { - object.encryptionInfo = []; - for (var j = 0; j < message.encryptionInfo.length; ++j) - object.encryptionInfo[j] = $root.google.spanner.admin.database.v1.EncryptionInfo.toObject(message.encryptionInfo[j], options); - } - if (message.defaultLeader != null && message.hasOwnProperty("defaultLeader")) - object.defaultLeader = message.defaultLeader; - if (message.databaseDialect != null && message.hasOwnProperty("databaseDialect")) - object.databaseDialect = options.enums === String ? $root.google.spanner.admin.database.v1.DatabaseDialect[message.databaseDialect] === undefined ? message.databaseDialect : $root.google.spanner.admin.database.v1.DatabaseDialect[message.databaseDialect] : message.databaseDialect; - if (message.enableDropProtection != null && message.hasOwnProperty("enableDropProtection")) - object.enableDropProtection = message.enableDropProtection; - if (message.reconciling != null && message.hasOwnProperty("reconciling")) - object.reconciling = message.reconciling; - return object; - }; - - /** - * Converts this Database to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.Database - * @instance - * @returns {Object.} JSON object - */ - Database.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Database - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.Database - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Database.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.Database"; - }; - - /** - * State enum. - * @name google.spanner.admin.database.v1.Database.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} CREATING=1 CREATING value - * @property {number} READY=2 READY value - * @property {number} READY_OPTIMIZING=3 READY_OPTIMIZING value - */ - Database.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "CREATING"] = 1; - values[valuesById[2] = "READY"] = 2; - values[valuesById[3] = "READY_OPTIMIZING"] = 3; - return values; - })(); - - return Database; - })(); - - v1.ListDatabasesRequest = (function() { - - /** - * Properties of a ListDatabasesRequest. - * @memberof google.spanner.admin.database.v1 - * @interface IListDatabasesRequest - * @property {string|null} [parent] ListDatabasesRequest parent - * @property {number|null} [pageSize] ListDatabasesRequest pageSize - * @property {string|null} [pageToken] ListDatabasesRequest pageToken - */ - - /** - * Constructs a new ListDatabasesRequest. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents a ListDatabasesRequest. - * @implements IListDatabasesRequest - * @constructor - * @param {google.spanner.admin.database.v1.IListDatabasesRequest=} [properties] Properties to set - */ - function ListDatabasesRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListDatabasesRequest parent. - * @member {string} parent - * @memberof google.spanner.admin.database.v1.ListDatabasesRequest - * @instance - */ - ListDatabasesRequest.prototype.parent = ""; - - /** - * ListDatabasesRequest pageSize. - * @member {number} pageSize - * @memberof google.spanner.admin.database.v1.ListDatabasesRequest - * @instance - */ - ListDatabasesRequest.prototype.pageSize = 0; - - /** - * ListDatabasesRequest pageToken. - * @member {string} pageToken - * @memberof google.spanner.admin.database.v1.ListDatabasesRequest - * @instance - */ - ListDatabasesRequest.prototype.pageToken = ""; - - /** - * Creates a new ListDatabasesRequest instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.ListDatabasesRequest - * @static - * @param {google.spanner.admin.database.v1.IListDatabasesRequest=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.ListDatabasesRequest} ListDatabasesRequest instance - */ - ListDatabasesRequest.create = function create(properties) { - return new ListDatabasesRequest(properties); - }; - - /** - * Encodes the specified ListDatabasesRequest message. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabasesRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.ListDatabasesRequest - * @static - * @param {google.spanner.admin.database.v1.IListDatabasesRequest} message ListDatabasesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListDatabasesRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); - return writer; - }; - - /** - * Encodes the specified ListDatabasesRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabasesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.ListDatabasesRequest - * @static - * @param {google.spanner.admin.database.v1.IListDatabasesRequest} message ListDatabasesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListDatabasesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListDatabasesRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.ListDatabasesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.ListDatabasesRequest} ListDatabasesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListDatabasesRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.ListDatabasesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 3: { - message.pageSize = reader.int32(); - break; - } - case 4: { - message.pageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListDatabasesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.ListDatabasesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.ListDatabasesRequest} ListDatabasesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListDatabasesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListDatabasesRequest message. - * @function verify - * @memberof google.spanner.admin.database.v1.ListDatabasesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListDatabasesRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - return null; - }; - - /** - * Creates a ListDatabasesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.ListDatabasesRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.ListDatabasesRequest} ListDatabasesRequest - */ - ListDatabasesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.ListDatabasesRequest) - return object; - var message = new $root.google.spanner.admin.database.v1.ListDatabasesRequest(); - 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 ListDatabasesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.ListDatabasesRequest - * @static - * @param {google.spanner.admin.database.v1.ListDatabasesRequest} message ListDatabasesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListDatabasesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - return object; - }; - - /** - * Converts this ListDatabasesRequest to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.ListDatabasesRequest - * @instance - * @returns {Object.} JSON object - */ - ListDatabasesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListDatabasesRequest - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.ListDatabasesRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListDatabasesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.ListDatabasesRequest"; - }; - - return ListDatabasesRequest; - })(); - - v1.ListDatabasesResponse = (function() { - - /** - * Properties of a ListDatabasesResponse. - * @memberof google.spanner.admin.database.v1 - * @interface IListDatabasesResponse - * @property {Array.|null} [databases] ListDatabasesResponse databases - * @property {string|null} [nextPageToken] ListDatabasesResponse nextPageToken - */ - - /** - * Constructs a new ListDatabasesResponse. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents a ListDatabasesResponse. - * @implements IListDatabasesResponse - * @constructor - * @param {google.spanner.admin.database.v1.IListDatabasesResponse=} [properties] Properties to set - */ - function ListDatabasesResponse(properties) { - this.databases = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListDatabasesResponse databases. - * @member {Array.} databases - * @memberof google.spanner.admin.database.v1.ListDatabasesResponse - * @instance - */ - ListDatabasesResponse.prototype.databases = $util.emptyArray; - - /** - * ListDatabasesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.spanner.admin.database.v1.ListDatabasesResponse - * @instance - */ - ListDatabasesResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListDatabasesResponse instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.ListDatabasesResponse - * @static - * @param {google.spanner.admin.database.v1.IListDatabasesResponse=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.ListDatabasesResponse} ListDatabasesResponse instance - */ - ListDatabasesResponse.create = function create(properties) { - return new ListDatabasesResponse(properties); - }; - - /** - * Encodes the specified ListDatabasesResponse message. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabasesResponse.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.ListDatabasesResponse - * @static - * @param {google.spanner.admin.database.v1.IListDatabasesResponse} message ListDatabasesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListDatabasesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.databases != null && message.databases.length) - for (var i = 0; i < message.databases.length; ++i) - $root.google.spanner.admin.database.v1.Database.encode(message.databases[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - return writer; - }; - - /** - * Encodes the specified ListDatabasesResponse message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabasesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.ListDatabasesResponse - * @static - * @param {google.spanner.admin.database.v1.IListDatabasesResponse} message ListDatabasesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListDatabasesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListDatabasesResponse message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.ListDatabasesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.ListDatabasesResponse} ListDatabasesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListDatabasesResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.ListDatabasesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.databases && message.databases.length)) - message.databases = []; - message.databases.push($root.google.spanner.admin.database.v1.Database.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListDatabasesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.ListDatabasesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.ListDatabasesResponse} ListDatabasesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListDatabasesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListDatabasesResponse message. - * @function verify - * @memberof google.spanner.admin.database.v1.ListDatabasesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListDatabasesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.databases != null && message.hasOwnProperty("databases")) { - if (!Array.isArray(message.databases)) - return "databases: array expected"; - for (var i = 0; i < message.databases.length; ++i) { - var error = $root.google.spanner.admin.database.v1.Database.verify(message.databases[i]); - if (error) - return "databases." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListDatabasesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.ListDatabasesResponse - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.ListDatabasesResponse} ListDatabasesResponse - */ - ListDatabasesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.ListDatabasesResponse) - return object; - var message = new $root.google.spanner.admin.database.v1.ListDatabasesResponse(); - if (object.databases) { - if (!Array.isArray(object.databases)) - throw TypeError(".google.spanner.admin.database.v1.ListDatabasesResponse.databases: array expected"); - message.databases = []; - for (var i = 0; i < object.databases.length; ++i) { - if (typeof object.databases[i] !== "object") - throw TypeError(".google.spanner.admin.database.v1.ListDatabasesResponse.databases: object expected"); - message.databases[i] = $root.google.spanner.admin.database.v1.Database.fromObject(object.databases[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListDatabasesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.ListDatabasesResponse - * @static - * @param {google.spanner.admin.database.v1.ListDatabasesResponse} message ListDatabasesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListDatabasesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.databases = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.databases && message.databases.length) { - object.databases = []; - for (var j = 0; j < message.databases.length; ++j) - object.databases[j] = $root.google.spanner.admin.database.v1.Database.toObject(message.databases[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListDatabasesResponse to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.ListDatabasesResponse - * @instance - * @returns {Object.} JSON object - */ - ListDatabasesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListDatabasesResponse - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.ListDatabasesResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListDatabasesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.ListDatabasesResponse"; - }; - - return ListDatabasesResponse; - })(); - - v1.CreateDatabaseRequest = (function() { - - /** - * Properties of a CreateDatabaseRequest. - * @memberof google.spanner.admin.database.v1 - * @interface ICreateDatabaseRequest - * @property {string|null} [parent] CreateDatabaseRequest parent - * @property {string|null} [createStatement] CreateDatabaseRequest createStatement - * @property {Array.|null} [extraStatements] CreateDatabaseRequest extraStatements - * @property {google.spanner.admin.database.v1.IEncryptionConfig|null} [encryptionConfig] CreateDatabaseRequest encryptionConfig - * @property {google.spanner.admin.database.v1.DatabaseDialect|null} [databaseDialect] CreateDatabaseRequest databaseDialect - * @property {Uint8Array|null} [protoDescriptors] CreateDatabaseRequest protoDescriptors - */ - - /** - * Constructs a new CreateDatabaseRequest. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents a CreateDatabaseRequest. - * @implements ICreateDatabaseRequest - * @constructor - * @param {google.spanner.admin.database.v1.ICreateDatabaseRequest=} [properties] Properties to set - */ - function CreateDatabaseRequest(properties) { - this.extraStatements = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateDatabaseRequest parent. - * @member {string} parent - * @memberof google.spanner.admin.database.v1.CreateDatabaseRequest - * @instance - */ - CreateDatabaseRequest.prototype.parent = ""; - - /** - * CreateDatabaseRequest createStatement. - * @member {string} createStatement - * @memberof google.spanner.admin.database.v1.CreateDatabaseRequest - * @instance - */ - CreateDatabaseRequest.prototype.createStatement = ""; - - /** - * CreateDatabaseRequest extraStatements. - * @member {Array.} extraStatements - * @memberof google.spanner.admin.database.v1.CreateDatabaseRequest - * @instance - */ - CreateDatabaseRequest.prototype.extraStatements = $util.emptyArray; - - /** - * CreateDatabaseRequest encryptionConfig. - * @member {google.spanner.admin.database.v1.IEncryptionConfig|null|undefined} encryptionConfig - * @memberof google.spanner.admin.database.v1.CreateDatabaseRequest - * @instance - */ - CreateDatabaseRequest.prototype.encryptionConfig = null; - - /** - * CreateDatabaseRequest databaseDialect. - * @member {google.spanner.admin.database.v1.DatabaseDialect} databaseDialect - * @memberof google.spanner.admin.database.v1.CreateDatabaseRequest - * @instance - */ - CreateDatabaseRequest.prototype.databaseDialect = 0; - - /** - * CreateDatabaseRequest protoDescriptors. - * @member {Uint8Array} protoDescriptors - * @memberof google.spanner.admin.database.v1.CreateDatabaseRequest - * @instance - */ - CreateDatabaseRequest.prototype.protoDescriptors = $util.newBuffer([]); - - /** - * Creates a new CreateDatabaseRequest instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.CreateDatabaseRequest - * @static - * @param {google.spanner.admin.database.v1.ICreateDatabaseRequest=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.CreateDatabaseRequest} CreateDatabaseRequest instance - */ - CreateDatabaseRequest.create = function create(properties) { - return new CreateDatabaseRequest(properties); - }; - - /** - * Encodes the specified CreateDatabaseRequest message. Does not implicitly {@link google.spanner.admin.database.v1.CreateDatabaseRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.CreateDatabaseRequest - * @static - * @param {google.spanner.admin.database.v1.ICreateDatabaseRequest} message CreateDatabaseRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateDatabaseRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.createStatement != null && Object.hasOwnProperty.call(message, "createStatement")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.createStatement); - if (message.extraStatements != null && message.extraStatements.length) - for (var i = 0; i < message.extraStatements.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.extraStatements[i]); - if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) - $root.google.spanner.admin.database.v1.EncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.databaseDialect != null && Object.hasOwnProperty.call(message, "databaseDialect")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.databaseDialect); - if (message.protoDescriptors != null && Object.hasOwnProperty.call(message, "protoDescriptors")) - writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.protoDescriptors); - return writer; - }; - - /** - * Encodes the specified CreateDatabaseRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.CreateDatabaseRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.CreateDatabaseRequest - * @static - * @param {google.spanner.admin.database.v1.ICreateDatabaseRequest} message CreateDatabaseRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateDatabaseRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateDatabaseRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.CreateDatabaseRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.CreateDatabaseRequest} CreateDatabaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateDatabaseRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.CreateDatabaseRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.createStatement = reader.string(); - break; - } - case 3: { - if (!(message.extraStatements && message.extraStatements.length)) - message.extraStatements = []; - message.extraStatements.push(reader.string()); - break; - } - case 4: { - message.encryptionConfig = $root.google.spanner.admin.database.v1.EncryptionConfig.decode(reader, reader.uint32()); - break; - } - case 5: { - message.databaseDialect = reader.int32(); - break; - } - case 6: { - message.protoDescriptors = reader.bytes(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateDatabaseRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.CreateDatabaseRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.CreateDatabaseRequest} CreateDatabaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateDatabaseRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateDatabaseRequest message. - * @function verify - * @memberof google.spanner.admin.database.v1.CreateDatabaseRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateDatabaseRequest.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.createStatement != null && message.hasOwnProperty("createStatement")) - if (!$util.isString(message.createStatement)) - return "createStatement: string expected"; - if (message.extraStatements != null && message.hasOwnProperty("extraStatements")) { - if (!Array.isArray(message.extraStatements)) - return "extraStatements: array expected"; - for (var i = 0; i < message.extraStatements.length; ++i) - if (!$util.isString(message.extraStatements[i])) - return "extraStatements: string[] expected"; - } - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { - var error = $root.google.spanner.admin.database.v1.EncryptionConfig.verify(message.encryptionConfig); - if (error) - return "encryptionConfig." + error; - } - if (message.databaseDialect != null && message.hasOwnProperty("databaseDialect")) - switch (message.databaseDialect) { - default: - return "databaseDialect: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.protoDescriptors != null && message.hasOwnProperty("protoDescriptors")) - if (!(message.protoDescriptors && typeof message.protoDescriptors.length === "number" || $util.isString(message.protoDescriptors))) - return "protoDescriptors: buffer expected"; - return null; - }; - - /** - * Creates a CreateDatabaseRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.CreateDatabaseRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.CreateDatabaseRequest} CreateDatabaseRequest - */ - CreateDatabaseRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.CreateDatabaseRequest) - return object; - var message = new $root.google.spanner.admin.database.v1.CreateDatabaseRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.createStatement != null) - message.createStatement = String(object.createStatement); - if (object.extraStatements) { - if (!Array.isArray(object.extraStatements)) - throw TypeError(".google.spanner.admin.database.v1.CreateDatabaseRequest.extraStatements: array expected"); - message.extraStatements = []; - for (var i = 0; i < object.extraStatements.length; ++i) - message.extraStatements[i] = String(object.extraStatements[i]); - } - if (object.encryptionConfig != null) { - if (typeof object.encryptionConfig !== "object") - throw TypeError(".google.spanner.admin.database.v1.CreateDatabaseRequest.encryptionConfig: object expected"); - message.encryptionConfig = $root.google.spanner.admin.database.v1.EncryptionConfig.fromObject(object.encryptionConfig); - } - switch (object.databaseDialect) { - default: - if (typeof object.databaseDialect === "number") { - message.databaseDialect = object.databaseDialect; - break; - } - break; - case "DATABASE_DIALECT_UNSPECIFIED": - case 0: - message.databaseDialect = 0; - break; - case "GOOGLE_STANDARD_SQL": - case 1: - message.databaseDialect = 1; - break; - case "POSTGRESQL": - case 2: - message.databaseDialect = 2; - break; - } - if (object.protoDescriptors != null) - if (typeof object.protoDescriptors === "string") - $util.base64.decode(object.protoDescriptors, message.protoDescriptors = $util.newBuffer($util.base64.length(object.protoDescriptors)), 0); - else if (object.protoDescriptors.length >= 0) - message.protoDescriptors = object.protoDescriptors; - return message; - }; - - /** - * Creates a plain object from a CreateDatabaseRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.CreateDatabaseRequest - * @static - * @param {google.spanner.admin.database.v1.CreateDatabaseRequest} message CreateDatabaseRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateDatabaseRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.extraStatements = []; - if (options.defaults) { - object.parent = ""; - object.createStatement = ""; - object.encryptionConfig = null; - object.databaseDialect = options.enums === String ? "DATABASE_DIALECT_UNSPECIFIED" : 0; - if (options.bytes === String) - object.protoDescriptors = ""; - else { - object.protoDescriptors = []; - if (options.bytes !== Array) - object.protoDescriptors = $util.newBuffer(object.protoDescriptors); - } - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.createStatement != null && message.hasOwnProperty("createStatement")) - object.createStatement = message.createStatement; - if (message.extraStatements && message.extraStatements.length) { - object.extraStatements = []; - for (var j = 0; j < message.extraStatements.length; ++j) - object.extraStatements[j] = message.extraStatements[j]; - } - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) - object.encryptionConfig = $root.google.spanner.admin.database.v1.EncryptionConfig.toObject(message.encryptionConfig, options); - if (message.databaseDialect != null && message.hasOwnProperty("databaseDialect")) - object.databaseDialect = options.enums === String ? $root.google.spanner.admin.database.v1.DatabaseDialect[message.databaseDialect] === undefined ? message.databaseDialect : $root.google.spanner.admin.database.v1.DatabaseDialect[message.databaseDialect] : message.databaseDialect; - if (message.protoDescriptors != null && message.hasOwnProperty("protoDescriptors")) - object.protoDescriptors = options.bytes === String ? $util.base64.encode(message.protoDescriptors, 0, message.protoDescriptors.length) : options.bytes === Array ? Array.prototype.slice.call(message.protoDescriptors) : message.protoDescriptors; - return object; - }; - - /** - * Converts this CreateDatabaseRequest to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.CreateDatabaseRequest - * @instance - * @returns {Object.} JSON object - */ - CreateDatabaseRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateDatabaseRequest - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.CreateDatabaseRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateDatabaseRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.CreateDatabaseRequest"; - }; - - return CreateDatabaseRequest; - })(); - - v1.CreateDatabaseMetadata = (function() { - - /** - * Properties of a CreateDatabaseMetadata. - * @memberof google.spanner.admin.database.v1 - * @interface ICreateDatabaseMetadata - * @property {string|null} [database] CreateDatabaseMetadata database - */ - - /** - * Constructs a new CreateDatabaseMetadata. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents a CreateDatabaseMetadata. - * @implements ICreateDatabaseMetadata - * @constructor - * @param {google.spanner.admin.database.v1.ICreateDatabaseMetadata=} [properties] Properties to set - */ - function CreateDatabaseMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateDatabaseMetadata database. - * @member {string} database - * @memberof google.spanner.admin.database.v1.CreateDatabaseMetadata - * @instance - */ - CreateDatabaseMetadata.prototype.database = ""; - - /** - * Creates a new CreateDatabaseMetadata instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.CreateDatabaseMetadata - * @static - * @param {google.spanner.admin.database.v1.ICreateDatabaseMetadata=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.CreateDatabaseMetadata} CreateDatabaseMetadata instance - */ - CreateDatabaseMetadata.create = function create(properties) { - return new CreateDatabaseMetadata(properties); - }; - - /** - * Encodes the specified CreateDatabaseMetadata message. Does not implicitly {@link google.spanner.admin.database.v1.CreateDatabaseMetadata.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.CreateDatabaseMetadata - * @static - * @param {google.spanner.admin.database.v1.ICreateDatabaseMetadata} message CreateDatabaseMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateDatabaseMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.database != null && Object.hasOwnProperty.call(message, "database")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.database); - return writer; - }; - - /** - * Encodes the specified CreateDatabaseMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.CreateDatabaseMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.CreateDatabaseMetadata - * @static - * @param {google.spanner.admin.database.v1.ICreateDatabaseMetadata} message CreateDatabaseMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateDatabaseMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateDatabaseMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.CreateDatabaseMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.CreateDatabaseMetadata} CreateDatabaseMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateDatabaseMetadata.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.CreateDatabaseMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.database = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateDatabaseMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.CreateDatabaseMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.CreateDatabaseMetadata} CreateDatabaseMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateDatabaseMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateDatabaseMetadata message. - * @function verify - * @memberof google.spanner.admin.database.v1.CreateDatabaseMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateDatabaseMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.database != null && message.hasOwnProperty("database")) - if (!$util.isString(message.database)) - return "database: string expected"; - return null; - }; - - /** - * Creates a CreateDatabaseMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.CreateDatabaseMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.CreateDatabaseMetadata} CreateDatabaseMetadata - */ - CreateDatabaseMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.CreateDatabaseMetadata) - return object; - var message = new $root.google.spanner.admin.database.v1.CreateDatabaseMetadata(); - if (object.database != null) - message.database = String(object.database); - return message; - }; - - /** - * Creates a plain object from a CreateDatabaseMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.CreateDatabaseMetadata - * @static - * @param {google.spanner.admin.database.v1.CreateDatabaseMetadata} message CreateDatabaseMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateDatabaseMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.database = ""; - if (message.database != null && message.hasOwnProperty("database")) - object.database = message.database; - return object; - }; - - /** - * Converts this CreateDatabaseMetadata to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.CreateDatabaseMetadata - * @instance - * @returns {Object.} JSON object - */ - CreateDatabaseMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateDatabaseMetadata - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.CreateDatabaseMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateDatabaseMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.CreateDatabaseMetadata"; - }; - - return CreateDatabaseMetadata; - })(); - - v1.GetDatabaseRequest = (function() { - - /** - * Properties of a GetDatabaseRequest. - * @memberof google.spanner.admin.database.v1 - * @interface IGetDatabaseRequest - * @property {string|null} [name] GetDatabaseRequest name - */ - - /** - * Constructs a new GetDatabaseRequest. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents a GetDatabaseRequest. - * @implements IGetDatabaseRequest - * @constructor - * @param {google.spanner.admin.database.v1.IGetDatabaseRequest=} [properties] Properties to set - */ - function GetDatabaseRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetDatabaseRequest name. - * @member {string} name - * @memberof google.spanner.admin.database.v1.GetDatabaseRequest - * @instance - */ - GetDatabaseRequest.prototype.name = ""; - - /** - * Creates a new GetDatabaseRequest instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.GetDatabaseRequest - * @static - * @param {google.spanner.admin.database.v1.IGetDatabaseRequest=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.GetDatabaseRequest} GetDatabaseRequest instance - */ - GetDatabaseRequest.create = function create(properties) { - return new GetDatabaseRequest(properties); - }; - - /** - * Encodes the specified GetDatabaseRequest message. Does not implicitly {@link google.spanner.admin.database.v1.GetDatabaseRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.GetDatabaseRequest - * @static - * @param {google.spanner.admin.database.v1.IGetDatabaseRequest} message GetDatabaseRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDatabaseRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; - - /** - * Encodes the specified GetDatabaseRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.GetDatabaseRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.GetDatabaseRequest - * @static - * @param {google.spanner.admin.database.v1.IGetDatabaseRequest} message GetDatabaseRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDatabaseRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetDatabaseRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.GetDatabaseRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.GetDatabaseRequest} GetDatabaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDatabaseRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.GetDatabaseRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetDatabaseRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.GetDatabaseRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.GetDatabaseRequest} GetDatabaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDatabaseRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetDatabaseRequest message. - * @function verify - * @memberof google.spanner.admin.database.v1.GetDatabaseRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetDatabaseRequest.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 GetDatabaseRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.GetDatabaseRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.GetDatabaseRequest} GetDatabaseRequest - */ - GetDatabaseRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.GetDatabaseRequest) - return object; - var message = new $root.google.spanner.admin.database.v1.GetDatabaseRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetDatabaseRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.GetDatabaseRequest - * @static - * @param {google.spanner.admin.database.v1.GetDatabaseRequest} message GetDatabaseRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetDatabaseRequest.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 GetDatabaseRequest to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.GetDatabaseRequest - * @instance - * @returns {Object.} JSON object - */ - GetDatabaseRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetDatabaseRequest - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.GetDatabaseRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetDatabaseRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.GetDatabaseRequest"; - }; - - return GetDatabaseRequest; - })(); - - v1.UpdateDatabaseRequest = (function() { - - /** - * Properties of an UpdateDatabaseRequest. - * @memberof google.spanner.admin.database.v1 - * @interface IUpdateDatabaseRequest - * @property {google.spanner.admin.database.v1.IDatabase|null} [database] UpdateDatabaseRequest database - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateDatabaseRequest updateMask - */ - - /** - * Constructs a new UpdateDatabaseRequest. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents an UpdateDatabaseRequest. - * @implements IUpdateDatabaseRequest - * @constructor - * @param {google.spanner.admin.database.v1.IUpdateDatabaseRequest=} [properties] Properties to set - */ - function UpdateDatabaseRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateDatabaseRequest database. - * @member {google.spanner.admin.database.v1.IDatabase|null|undefined} database - * @memberof google.spanner.admin.database.v1.UpdateDatabaseRequest - * @instance - */ - UpdateDatabaseRequest.prototype.database = null; - - /** - * UpdateDatabaseRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.spanner.admin.database.v1.UpdateDatabaseRequest - * @instance - */ - UpdateDatabaseRequest.prototype.updateMask = null; - - /** - * Creates a new UpdateDatabaseRequest instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.UpdateDatabaseRequest - * @static - * @param {google.spanner.admin.database.v1.IUpdateDatabaseRequest=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.UpdateDatabaseRequest} UpdateDatabaseRequest instance - */ - UpdateDatabaseRequest.create = function create(properties) { - return new UpdateDatabaseRequest(properties); - }; - - /** - * Encodes the specified UpdateDatabaseRequest message. Does not implicitly {@link google.spanner.admin.database.v1.UpdateDatabaseRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.UpdateDatabaseRequest - * @static - * @param {google.spanner.admin.database.v1.IUpdateDatabaseRequest} message UpdateDatabaseRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateDatabaseRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.database != null && Object.hasOwnProperty.call(message, "database")) - $root.google.spanner.admin.database.v1.Database.encode(message.database, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified UpdateDatabaseRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.UpdateDatabaseRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.UpdateDatabaseRequest - * @static - * @param {google.spanner.admin.database.v1.IUpdateDatabaseRequest} message UpdateDatabaseRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateDatabaseRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateDatabaseRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.UpdateDatabaseRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.UpdateDatabaseRequest} UpdateDatabaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateDatabaseRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.UpdateDatabaseRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.database = $root.google.spanner.admin.database.v1.Database.decode(reader, reader.uint32()); - break; - } - case 2: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateDatabaseRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.UpdateDatabaseRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.UpdateDatabaseRequest} UpdateDatabaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateDatabaseRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateDatabaseRequest message. - * @function verify - * @memberof google.spanner.admin.database.v1.UpdateDatabaseRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateDatabaseRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.database != null && message.hasOwnProperty("database")) { - var error = $root.google.spanner.admin.database.v1.Database.verify(message.database); - if (error) - return "database." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - return null; - }; - - /** - * Creates an UpdateDatabaseRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.UpdateDatabaseRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.UpdateDatabaseRequest} UpdateDatabaseRequest - */ - UpdateDatabaseRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.UpdateDatabaseRequest) - return object; - var message = new $root.google.spanner.admin.database.v1.UpdateDatabaseRequest(); - if (object.database != null) { - if (typeof object.database !== "object") - throw TypeError(".google.spanner.admin.database.v1.UpdateDatabaseRequest.database: object expected"); - message.database = $root.google.spanner.admin.database.v1.Database.fromObject(object.database); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.spanner.admin.database.v1.UpdateDatabaseRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - return message; - }; - - /** - * Creates a plain object from an UpdateDatabaseRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.UpdateDatabaseRequest - * @static - * @param {google.spanner.admin.database.v1.UpdateDatabaseRequest} message UpdateDatabaseRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateDatabaseRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.database = null; - object.updateMask = null; - } - if (message.database != null && message.hasOwnProperty("database")) - object.database = $root.google.spanner.admin.database.v1.Database.toObject(message.database, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - return object; - }; - - /** - * Converts this UpdateDatabaseRequest to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.UpdateDatabaseRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateDatabaseRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateDatabaseRequest - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.UpdateDatabaseRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateDatabaseRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.UpdateDatabaseRequest"; - }; - - return UpdateDatabaseRequest; - })(); - - v1.UpdateDatabaseMetadata = (function() { - - /** - * Properties of an UpdateDatabaseMetadata. - * @memberof google.spanner.admin.database.v1 - * @interface IUpdateDatabaseMetadata - * @property {google.spanner.admin.database.v1.IUpdateDatabaseRequest|null} [request] UpdateDatabaseMetadata request - * @property {google.spanner.admin.database.v1.IOperationProgress|null} [progress] UpdateDatabaseMetadata progress - * @property {google.protobuf.ITimestamp|null} [cancelTime] UpdateDatabaseMetadata cancelTime - */ - - /** - * Constructs a new UpdateDatabaseMetadata. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents an UpdateDatabaseMetadata. - * @implements IUpdateDatabaseMetadata - * @constructor - * @param {google.spanner.admin.database.v1.IUpdateDatabaseMetadata=} [properties] Properties to set - */ - function UpdateDatabaseMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateDatabaseMetadata request. - * @member {google.spanner.admin.database.v1.IUpdateDatabaseRequest|null|undefined} request - * @memberof google.spanner.admin.database.v1.UpdateDatabaseMetadata - * @instance - */ - UpdateDatabaseMetadata.prototype.request = null; - - /** - * UpdateDatabaseMetadata progress. - * @member {google.spanner.admin.database.v1.IOperationProgress|null|undefined} progress - * @memberof google.spanner.admin.database.v1.UpdateDatabaseMetadata - * @instance - */ - UpdateDatabaseMetadata.prototype.progress = null; - - /** - * UpdateDatabaseMetadata cancelTime. - * @member {google.protobuf.ITimestamp|null|undefined} cancelTime - * @memberof google.spanner.admin.database.v1.UpdateDatabaseMetadata - * @instance - */ - UpdateDatabaseMetadata.prototype.cancelTime = null; - - /** - * Creates a new UpdateDatabaseMetadata instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.UpdateDatabaseMetadata - * @static - * @param {google.spanner.admin.database.v1.IUpdateDatabaseMetadata=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.UpdateDatabaseMetadata} UpdateDatabaseMetadata instance - */ - UpdateDatabaseMetadata.create = function create(properties) { - return new UpdateDatabaseMetadata(properties); - }; - - /** - * Encodes the specified UpdateDatabaseMetadata message. Does not implicitly {@link google.spanner.admin.database.v1.UpdateDatabaseMetadata.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.UpdateDatabaseMetadata - * @static - * @param {google.spanner.admin.database.v1.IUpdateDatabaseMetadata} message UpdateDatabaseMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateDatabaseMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.request != null && Object.hasOwnProperty.call(message, "request")) - $root.google.spanner.admin.database.v1.UpdateDatabaseRequest.encode(message.request, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.progress != null && Object.hasOwnProperty.call(message, "progress")) - $root.google.spanner.admin.database.v1.OperationProgress.encode(message.progress, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.cancelTime != null && Object.hasOwnProperty.call(message, "cancelTime")) - $root.google.protobuf.Timestamp.encode(message.cancelTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified UpdateDatabaseMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.UpdateDatabaseMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.UpdateDatabaseMetadata - * @static - * @param {google.spanner.admin.database.v1.IUpdateDatabaseMetadata} message UpdateDatabaseMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateDatabaseMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateDatabaseMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.UpdateDatabaseMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.UpdateDatabaseMetadata} UpdateDatabaseMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateDatabaseMetadata.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.UpdateDatabaseMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.request = $root.google.spanner.admin.database.v1.UpdateDatabaseRequest.decode(reader, reader.uint32()); - break; - } - case 2: { - message.progress = $root.google.spanner.admin.database.v1.OperationProgress.decode(reader, reader.uint32()); - break; - } - case 3: { - message.cancelTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateDatabaseMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.UpdateDatabaseMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.UpdateDatabaseMetadata} UpdateDatabaseMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateDatabaseMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateDatabaseMetadata message. - * @function verify - * @memberof google.spanner.admin.database.v1.UpdateDatabaseMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateDatabaseMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.request != null && message.hasOwnProperty("request")) { - var error = $root.google.spanner.admin.database.v1.UpdateDatabaseRequest.verify(message.request); - if (error) - return "request." + error; - } - if (message.progress != null && message.hasOwnProperty("progress")) { - var error = $root.google.spanner.admin.database.v1.OperationProgress.verify(message.progress); - if (error) - return "progress." + error; - } - if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.cancelTime); - if (error) - return "cancelTime." + error; - } - return null; - }; - - /** - * Creates an UpdateDatabaseMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.UpdateDatabaseMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.UpdateDatabaseMetadata} UpdateDatabaseMetadata - */ - UpdateDatabaseMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.UpdateDatabaseMetadata) - return object; - var message = new $root.google.spanner.admin.database.v1.UpdateDatabaseMetadata(); - if (object.request != null) { - if (typeof object.request !== "object") - throw TypeError(".google.spanner.admin.database.v1.UpdateDatabaseMetadata.request: object expected"); - message.request = $root.google.spanner.admin.database.v1.UpdateDatabaseRequest.fromObject(object.request); - } - if (object.progress != null) { - if (typeof object.progress !== "object") - throw TypeError(".google.spanner.admin.database.v1.UpdateDatabaseMetadata.progress: object expected"); - message.progress = $root.google.spanner.admin.database.v1.OperationProgress.fromObject(object.progress); - } - if (object.cancelTime != null) { - if (typeof object.cancelTime !== "object") - throw TypeError(".google.spanner.admin.database.v1.UpdateDatabaseMetadata.cancelTime: object expected"); - message.cancelTime = $root.google.protobuf.Timestamp.fromObject(object.cancelTime); - } - return message; - }; - - /** - * Creates a plain object from an UpdateDatabaseMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.UpdateDatabaseMetadata - * @static - * @param {google.spanner.admin.database.v1.UpdateDatabaseMetadata} message UpdateDatabaseMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateDatabaseMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.request = null; - object.progress = null; - object.cancelTime = null; - } - if (message.request != null && message.hasOwnProperty("request")) - object.request = $root.google.spanner.admin.database.v1.UpdateDatabaseRequest.toObject(message.request, options); - if (message.progress != null && message.hasOwnProperty("progress")) - object.progress = $root.google.spanner.admin.database.v1.OperationProgress.toObject(message.progress, options); - if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) - object.cancelTime = $root.google.protobuf.Timestamp.toObject(message.cancelTime, options); - return object; - }; - - /** - * Converts this UpdateDatabaseMetadata to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.UpdateDatabaseMetadata - * @instance - * @returns {Object.} JSON object - */ - UpdateDatabaseMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateDatabaseMetadata - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.UpdateDatabaseMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateDatabaseMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.UpdateDatabaseMetadata"; - }; - - return UpdateDatabaseMetadata; - })(); - - v1.UpdateDatabaseDdlRequest = (function() { - - /** - * Properties of an UpdateDatabaseDdlRequest. - * @memberof google.spanner.admin.database.v1 - * @interface IUpdateDatabaseDdlRequest - * @property {string|null} [database] UpdateDatabaseDdlRequest database - * @property {Array.|null} [statements] UpdateDatabaseDdlRequest statements - * @property {string|null} [operationId] UpdateDatabaseDdlRequest operationId - * @property {Uint8Array|null} [protoDescriptors] UpdateDatabaseDdlRequest protoDescriptors - * @property {boolean|null} [throughputMode] UpdateDatabaseDdlRequest throughputMode - */ - - /** - * Constructs a new UpdateDatabaseDdlRequest. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents an UpdateDatabaseDdlRequest. - * @implements IUpdateDatabaseDdlRequest - * @constructor - * @param {google.spanner.admin.database.v1.IUpdateDatabaseDdlRequest=} [properties] Properties to set - */ - function UpdateDatabaseDdlRequest(properties) { - this.statements = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateDatabaseDdlRequest database. - * @member {string} database - * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlRequest - * @instance - */ - UpdateDatabaseDdlRequest.prototype.database = ""; - - /** - * UpdateDatabaseDdlRequest statements. - * @member {Array.} statements - * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlRequest - * @instance - */ - UpdateDatabaseDdlRequest.prototype.statements = $util.emptyArray; - - /** - * UpdateDatabaseDdlRequest operationId. - * @member {string} operationId - * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlRequest - * @instance - */ - UpdateDatabaseDdlRequest.prototype.operationId = ""; - - /** - * UpdateDatabaseDdlRequest protoDescriptors. - * @member {Uint8Array} protoDescriptors - * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlRequest - * @instance - */ - UpdateDatabaseDdlRequest.prototype.protoDescriptors = $util.newBuffer([]); - - /** - * UpdateDatabaseDdlRequest throughputMode. - * @member {boolean} throughputMode - * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlRequest - * @instance - */ - UpdateDatabaseDdlRequest.prototype.throughputMode = false; - - /** - * Creates a new UpdateDatabaseDdlRequest instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlRequest - * @static - * @param {google.spanner.admin.database.v1.IUpdateDatabaseDdlRequest=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.UpdateDatabaseDdlRequest} UpdateDatabaseDdlRequest instance - */ - UpdateDatabaseDdlRequest.create = function create(properties) { - return new UpdateDatabaseDdlRequest(properties); - }; - - /** - * Encodes the specified UpdateDatabaseDdlRequest message. Does not implicitly {@link google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlRequest - * @static - * @param {google.spanner.admin.database.v1.IUpdateDatabaseDdlRequest} message UpdateDatabaseDdlRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateDatabaseDdlRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.database != null && Object.hasOwnProperty.call(message, "database")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.database); - if (message.statements != null && message.statements.length) - for (var i = 0; i < message.statements.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.statements[i]); - if (message.operationId != null && Object.hasOwnProperty.call(message, "operationId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.operationId); - if (message.protoDescriptors != null && Object.hasOwnProperty.call(message, "protoDescriptors")) - writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.protoDescriptors); - if (message.throughputMode != null && Object.hasOwnProperty.call(message, "throughputMode")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.throughputMode); - return writer; - }; - - /** - * Encodes the specified UpdateDatabaseDdlRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlRequest - * @static - * @param {google.spanner.admin.database.v1.IUpdateDatabaseDdlRequest} message UpdateDatabaseDdlRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateDatabaseDdlRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateDatabaseDdlRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.UpdateDatabaseDdlRequest} UpdateDatabaseDdlRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateDatabaseDdlRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.UpdateDatabaseDdlRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.database = reader.string(); - break; - } - case 2: { - if (!(message.statements && message.statements.length)) - message.statements = []; - message.statements.push(reader.string()); - break; - } - case 3: { - message.operationId = reader.string(); - break; - } - case 4: { - message.protoDescriptors = reader.bytes(); - break; - } - case 5: { - message.throughputMode = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateDatabaseDdlRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.UpdateDatabaseDdlRequest} UpdateDatabaseDdlRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateDatabaseDdlRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateDatabaseDdlRequest message. - * @function verify - * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateDatabaseDdlRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.database != null && message.hasOwnProperty("database")) - if (!$util.isString(message.database)) - return "database: string expected"; - if (message.statements != null && message.hasOwnProperty("statements")) { - if (!Array.isArray(message.statements)) - return "statements: array expected"; - for (var i = 0; i < message.statements.length; ++i) - if (!$util.isString(message.statements[i])) - return "statements: string[] expected"; - } - if (message.operationId != null && message.hasOwnProperty("operationId")) - if (!$util.isString(message.operationId)) - return "operationId: string expected"; - if (message.protoDescriptors != null && message.hasOwnProperty("protoDescriptors")) - if (!(message.protoDescriptors && typeof message.protoDescriptors.length === "number" || $util.isString(message.protoDescriptors))) - return "protoDescriptors: buffer expected"; - if (message.throughputMode != null && message.hasOwnProperty("throughputMode")) - if (typeof message.throughputMode !== "boolean") - return "throughputMode: boolean expected"; - return null; - }; - - /** - * Creates an UpdateDatabaseDdlRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.UpdateDatabaseDdlRequest} UpdateDatabaseDdlRequest - */ - UpdateDatabaseDdlRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.UpdateDatabaseDdlRequest) - return object; - var message = new $root.google.spanner.admin.database.v1.UpdateDatabaseDdlRequest(); - if (object.database != null) - message.database = String(object.database); - if (object.statements) { - if (!Array.isArray(object.statements)) - throw TypeError(".google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.statements: array expected"); - message.statements = []; - for (var i = 0; i < object.statements.length; ++i) - message.statements[i] = String(object.statements[i]); - } - if (object.operationId != null) - message.operationId = String(object.operationId); - if (object.protoDescriptors != null) - if (typeof object.protoDescriptors === "string") - $util.base64.decode(object.protoDescriptors, message.protoDescriptors = $util.newBuffer($util.base64.length(object.protoDescriptors)), 0); - else if (object.protoDescriptors.length >= 0) - message.protoDescriptors = object.protoDescriptors; - if (object.throughputMode != null) - message.throughputMode = Boolean(object.throughputMode); - return message; - }; - - /** - * Creates a plain object from an UpdateDatabaseDdlRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlRequest - * @static - * @param {google.spanner.admin.database.v1.UpdateDatabaseDdlRequest} message UpdateDatabaseDdlRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateDatabaseDdlRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.statements = []; - if (options.defaults) { - object.database = ""; - object.operationId = ""; - if (options.bytes === String) - object.protoDescriptors = ""; - else { - object.protoDescriptors = []; - if (options.bytes !== Array) - object.protoDescriptors = $util.newBuffer(object.protoDescriptors); - } - object.throughputMode = false; - } - if (message.database != null && message.hasOwnProperty("database")) - object.database = message.database; - if (message.statements && message.statements.length) { - object.statements = []; - for (var j = 0; j < message.statements.length; ++j) - object.statements[j] = message.statements[j]; - } - if (message.operationId != null && message.hasOwnProperty("operationId")) - object.operationId = message.operationId; - if (message.protoDescriptors != null && message.hasOwnProperty("protoDescriptors")) - object.protoDescriptors = options.bytes === String ? $util.base64.encode(message.protoDescriptors, 0, message.protoDescriptors.length) : options.bytes === Array ? Array.prototype.slice.call(message.protoDescriptors) : message.protoDescriptors; - if (message.throughputMode != null && message.hasOwnProperty("throughputMode")) - object.throughputMode = message.throughputMode; - return object; - }; - - /** - * Converts this UpdateDatabaseDdlRequest to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateDatabaseDdlRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateDatabaseDdlRequest - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateDatabaseDdlRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.UpdateDatabaseDdlRequest"; - }; - - return UpdateDatabaseDdlRequest; - })(); - - v1.DdlStatementActionInfo = (function() { - - /** - * Properties of a DdlStatementActionInfo. - * @memberof google.spanner.admin.database.v1 - * @interface IDdlStatementActionInfo - * @property {string|null} [action] DdlStatementActionInfo action - * @property {string|null} [entityType] DdlStatementActionInfo entityType - * @property {Array.|null} [entityNames] DdlStatementActionInfo entityNames - */ - - /** - * Constructs a new DdlStatementActionInfo. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents a DdlStatementActionInfo. - * @implements IDdlStatementActionInfo - * @constructor - * @param {google.spanner.admin.database.v1.IDdlStatementActionInfo=} [properties] Properties to set - */ - function DdlStatementActionInfo(properties) { - this.entityNames = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DdlStatementActionInfo action. - * @member {string} action - * @memberof google.spanner.admin.database.v1.DdlStatementActionInfo - * @instance - */ - DdlStatementActionInfo.prototype.action = ""; - - /** - * DdlStatementActionInfo entityType. - * @member {string} entityType - * @memberof google.spanner.admin.database.v1.DdlStatementActionInfo - * @instance - */ - DdlStatementActionInfo.prototype.entityType = ""; - - /** - * DdlStatementActionInfo entityNames. - * @member {Array.} entityNames - * @memberof google.spanner.admin.database.v1.DdlStatementActionInfo - * @instance - */ - DdlStatementActionInfo.prototype.entityNames = $util.emptyArray; - - /** - * Creates a new DdlStatementActionInfo instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.DdlStatementActionInfo - * @static - * @param {google.spanner.admin.database.v1.IDdlStatementActionInfo=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.DdlStatementActionInfo} DdlStatementActionInfo instance - */ - DdlStatementActionInfo.create = function create(properties) { - return new DdlStatementActionInfo(properties); - }; - - /** - * Encodes the specified DdlStatementActionInfo message. Does not implicitly {@link google.spanner.admin.database.v1.DdlStatementActionInfo.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.DdlStatementActionInfo - * @static - * @param {google.spanner.admin.database.v1.IDdlStatementActionInfo} message DdlStatementActionInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DdlStatementActionInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.action != null && Object.hasOwnProperty.call(message, "action")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.action); - if (message.entityType != null && Object.hasOwnProperty.call(message, "entityType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.entityType); - if (message.entityNames != null && message.entityNames.length) - for (var i = 0; i < message.entityNames.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.entityNames[i]); - return writer; - }; - - /** - * Encodes the specified DdlStatementActionInfo message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.DdlStatementActionInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.DdlStatementActionInfo - * @static - * @param {google.spanner.admin.database.v1.IDdlStatementActionInfo} message DdlStatementActionInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DdlStatementActionInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DdlStatementActionInfo message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.DdlStatementActionInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.DdlStatementActionInfo} DdlStatementActionInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DdlStatementActionInfo.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.DdlStatementActionInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.action = reader.string(); - break; - } - case 2: { - message.entityType = reader.string(); - break; - } - case 3: { - if (!(message.entityNames && message.entityNames.length)) - message.entityNames = []; - message.entityNames.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DdlStatementActionInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.DdlStatementActionInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.DdlStatementActionInfo} DdlStatementActionInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DdlStatementActionInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DdlStatementActionInfo message. - * @function verify - * @memberof google.spanner.admin.database.v1.DdlStatementActionInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DdlStatementActionInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.action != null && message.hasOwnProperty("action")) - if (!$util.isString(message.action)) - return "action: string expected"; - if (message.entityType != null && message.hasOwnProperty("entityType")) - if (!$util.isString(message.entityType)) - return "entityType: string expected"; - if (message.entityNames != null && message.hasOwnProperty("entityNames")) { - if (!Array.isArray(message.entityNames)) - return "entityNames: array expected"; - for (var i = 0; i < message.entityNames.length; ++i) - if (!$util.isString(message.entityNames[i])) - return "entityNames: string[] expected"; - } - return null; - }; - - /** - * Creates a DdlStatementActionInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.DdlStatementActionInfo - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.DdlStatementActionInfo} DdlStatementActionInfo - */ - DdlStatementActionInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.DdlStatementActionInfo) - return object; - var message = new $root.google.spanner.admin.database.v1.DdlStatementActionInfo(); - if (object.action != null) - message.action = String(object.action); - if (object.entityType != null) - message.entityType = String(object.entityType); - if (object.entityNames) { - if (!Array.isArray(object.entityNames)) - throw TypeError(".google.spanner.admin.database.v1.DdlStatementActionInfo.entityNames: array expected"); - message.entityNames = []; - for (var i = 0; i < object.entityNames.length; ++i) - message.entityNames[i] = String(object.entityNames[i]); - } - return message; - }; - - /** - * Creates a plain object from a DdlStatementActionInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.DdlStatementActionInfo - * @static - * @param {google.spanner.admin.database.v1.DdlStatementActionInfo} message DdlStatementActionInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DdlStatementActionInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.entityNames = []; - if (options.defaults) { - object.action = ""; - object.entityType = ""; - } - if (message.action != null && message.hasOwnProperty("action")) - object.action = message.action; - if (message.entityType != null && message.hasOwnProperty("entityType")) - object.entityType = message.entityType; - if (message.entityNames && message.entityNames.length) { - object.entityNames = []; - for (var j = 0; j < message.entityNames.length; ++j) - object.entityNames[j] = message.entityNames[j]; - } - return object; - }; - - /** - * Converts this DdlStatementActionInfo to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.DdlStatementActionInfo - * @instance - * @returns {Object.} JSON object - */ - DdlStatementActionInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DdlStatementActionInfo - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.DdlStatementActionInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DdlStatementActionInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.DdlStatementActionInfo"; - }; - - return DdlStatementActionInfo; - })(); - - v1.UpdateDatabaseDdlMetadata = (function() { - - /** - * Properties of an UpdateDatabaseDdlMetadata. - * @memberof google.spanner.admin.database.v1 - * @interface IUpdateDatabaseDdlMetadata - * @property {string|null} [database] UpdateDatabaseDdlMetadata database - * @property {Array.|null} [statements] UpdateDatabaseDdlMetadata statements - * @property {Array.|null} [commitTimestamps] UpdateDatabaseDdlMetadata commitTimestamps - * @property {boolean|null} [throttled] UpdateDatabaseDdlMetadata throttled - * @property {Array.|null} [progress] UpdateDatabaseDdlMetadata progress - * @property {Array.|null} [actions] UpdateDatabaseDdlMetadata actions - */ - - /** - * Constructs a new UpdateDatabaseDdlMetadata. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents an UpdateDatabaseDdlMetadata. - * @implements IUpdateDatabaseDdlMetadata - * @constructor - * @param {google.spanner.admin.database.v1.IUpdateDatabaseDdlMetadata=} [properties] Properties to set - */ - function UpdateDatabaseDdlMetadata(properties) { - this.statements = []; - this.commitTimestamps = []; - this.progress = []; - this.actions = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateDatabaseDdlMetadata database. - * @member {string} database - * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata - * @instance - */ - UpdateDatabaseDdlMetadata.prototype.database = ""; - - /** - * UpdateDatabaseDdlMetadata statements. - * @member {Array.} statements - * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata - * @instance - */ - UpdateDatabaseDdlMetadata.prototype.statements = $util.emptyArray; - - /** - * UpdateDatabaseDdlMetadata commitTimestamps. - * @member {Array.} commitTimestamps - * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata - * @instance - */ - UpdateDatabaseDdlMetadata.prototype.commitTimestamps = $util.emptyArray; - - /** - * UpdateDatabaseDdlMetadata throttled. - * @member {boolean} throttled - * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata - * @instance - */ - UpdateDatabaseDdlMetadata.prototype.throttled = false; - - /** - * UpdateDatabaseDdlMetadata progress. - * @member {Array.} progress - * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata - * @instance - */ - UpdateDatabaseDdlMetadata.prototype.progress = $util.emptyArray; - - /** - * UpdateDatabaseDdlMetadata actions. - * @member {Array.} actions - * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata - * @instance - */ - UpdateDatabaseDdlMetadata.prototype.actions = $util.emptyArray; - - /** - * Creates a new UpdateDatabaseDdlMetadata instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata - * @static - * @param {google.spanner.admin.database.v1.IUpdateDatabaseDdlMetadata=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata} UpdateDatabaseDdlMetadata instance - */ - UpdateDatabaseDdlMetadata.create = function create(properties) { - return new UpdateDatabaseDdlMetadata(properties); - }; - - /** - * Encodes the specified UpdateDatabaseDdlMetadata message. Does not implicitly {@link google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata - * @static - * @param {google.spanner.admin.database.v1.IUpdateDatabaseDdlMetadata} message UpdateDatabaseDdlMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateDatabaseDdlMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.database != null && Object.hasOwnProperty.call(message, "database")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.database); - if (message.statements != null && message.statements.length) - for (var i = 0; i < message.statements.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.statements[i]); - if (message.commitTimestamps != null && message.commitTimestamps.length) - for (var i = 0; i < message.commitTimestamps.length; ++i) - $root.google.protobuf.Timestamp.encode(message.commitTimestamps[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.throttled != null && Object.hasOwnProperty.call(message, "throttled")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.throttled); - if (message.progress != null && message.progress.length) - for (var i = 0; i < message.progress.length; ++i) - $root.google.spanner.admin.database.v1.OperationProgress.encode(message.progress[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.actions != null && message.actions.length) - for (var i = 0; i < message.actions.length; ++i) - $root.google.spanner.admin.database.v1.DdlStatementActionInfo.encode(message.actions[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified UpdateDatabaseDdlMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata - * @static - * @param {google.spanner.admin.database.v1.IUpdateDatabaseDdlMetadata} message UpdateDatabaseDdlMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateDatabaseDdlMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateDatabaseDdlMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata} UpdateDatabaseDdlMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateDatabaseDdlMetadata.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.database = reader.string(); - break; - } - case 2: { - if (!(message.statements && message.statements.length)) - message.statements = []; - message.statements.push(reader.string()); - break; - } - case 3: { - if (!(message.commitTimestamps && message.commitTimestamps.length)) - message.commitTimestamps = []; - message.commitTimestamps.push($root.google.protobuf.Timestamp.decode(reader, reader.uint32())); - break; - } - case 4: { - message.throttled = reader.bool(); - break; - } - case 5: { - if (!(message.progress && message.progress.length)) - message.progress = []; - message.progress.push($root.google.spanner.admin.database.v1.OperationProgress.decode(reader, reader.uint32())); - break; - } - case 6: { - if (!(message.actions && message.actions.length)) - message.actions = []; - message.actions.push($root.google.spanner.admin.database.v1.DdlStatementActionInfo.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateDatabaseDdlMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata} UpdateDatabaseDdlMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateDatabaseDdlMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateDatabaseDdlMetadata message. - * @function verify - * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateDatabaseDdlMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.database != null && message.hasOwnProperty("database")) - if (!$util.isString(message.database)) - return "database: string expected"; - if (message.statements != null && message.hasOwnProperty("statements")) { - if (!Array.isArray(message.statements)) - return "statements: array expected"; - for (var i = 0; i < message.statements.length; ++i) - if (!$util.isString(message.statements[i])) - return "statements: string[] expected"; - } - if (message.commitTimestamps != null && message.hasOwnProperty("commitTimestamps")) { - if (!Array.isArray(message.commitTimestamps)) - return "commitTimestamps: array expected"; - for (var i = 0; i < message.commitTimestamps.length; ++i) { - var error = $root.google.protobuf.Timestamp.verify(message.commitTimestamps[i]); - if (error) - return "commitTimestamps." + error; - } - } - if (message.throttled != null && message.hasOwnProperty("throttled")) - if (typeof message.throttled !== "boolean") - return "throttled: boolean expected"; - if (message.progress != null && message.hasOwnProperty("progress")) { - if (!Array.isArray(message.progress)) - return "progress: array expected"; - for (var i = 0; i < message.progress.length; ++i) { - var error = $root.google.spanner.admin.database.v1.OperationProgress.verify(message.progress[i]); - if (error) - return "progress." + error; - } - } - if (message.actions != null && message.hasOwnProperty("actions")) { - if (!Array.isArray(message.actions)) - return "actions: array expected"; - for (var i = 0; i < message.actions.length; ++i) { - var error = $root.google.spanner.admin.database.v1.DdlStatementActionInfo.verify(message.actions[i]); - if (error) - return "actions." + error; - } - } - return null; - }; - - /** - * Creates an UpdateDatabaseDdlMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata} UpdateDatabaseDdlMetadata - */ - UpdateDatabaseDdlMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata) - return object; - var message = new $root.google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata(); - if (object.database != null) - message.database = String(object.database); - if (object.statements) { - if (!Array.isArray(object.statements)) - throw TypeError(".google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata.statements: array expected"); - message.statements = []; - for (var i = 0; i < object.statements.length; ++i) - message.statements[i] = String(object.statements[i]); - } - if (object.commitTimestamps) { - if (!Array.isArray(object.commitTimestamps)) - throw TypeError(".google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata.commitTimestamps: array expected"); - message.commitTimestamps = []; - for (var i = 0; i < object.commitTimestamps.length; ++i) { - if (typeof object.commitTimestamps[i] !== "object") - throw TypeError(".google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata.commitTimestamps: object expected"); - message.commitTimestamps[i] = $root.google.protobuf.Timestamp.fromObject(object.commitTimestamps[i]); - } - } - if (object.throttled != null) - message.throttled = Boolean(object.throttled); - if (object.progress) { - if (!Array.isArray(object.progress)) - throw TypeError(".google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata.progress: array expected"); - message.progress = []; - for (var i = 0; i < object.progress.length; ++i) { - if (typeof object.progress[i] !== "object") - throw TypeError(".google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata.progress: object expected"); - message.progress[i] = $root.google.spanner.admin.database.v1.OperationProgress.fromObject(object.progress[i]); - } - } - if (object.actions) { - if (!Array.isArray(object.actions)) - throw TypeError(".google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata.actions: array expected"); - message.actions = []; - for (var i = 0; i < object.actions.length; ++i) { - if (typeof object.actions[i] !== "object") - throw TypeError(".google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata.actions: object expected"); - message.actions[i] = $root.google.spanner.admin.database.v1.DdlStatementActionInfo.fromObject(object.actions[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an UpdateDatabaseDdlMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata - * @static - * @param {google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata} message UpdateDatabaseDdlMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateDatabaseDdlMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.statements = []; - object.commitTimestamps = []; - object.progress = []; - object.actions = []; - } - if (options.defaults) { - object.database = ""; - object.throttled = false; - } - if (message.database != null && message.hasOwnProperty("database")) - object.database = message.database; - if (message.statements && message.statements.length) { - object.statements = []; - for (var j = 0; j < message.statements.length; ++j) - object.statements[j] = message.statements[j]; - } - if (message.commitTimestamps && message.commitTimestamps.length) { - object.commitTimestamps = []; - for (var j = 0; j < message.commitTimestamps.length; ++j) - object.commitTimestamps[j] = $root.google.protobuf.Timestamp.toObject(message.commitTimestamps[j], options); - } - if (message.throttled != null && message.hasOwnProperty("throttled")) - object.throttled = message.throttled; - if (message.progress && message.progress.length) { - object.progress = []; - for (var j = 0; j < message.progress.length; ++j) - object.progress[j] = $root.google.spanner.admin.database.v1.OperationProgress.toObject(message.progress[j], options); - } - if (message.actions && message.actions.length) { - object.actions = []; - for (var j = 0; j < message.actions.length; ++j) - object.actions[j] = $root.google.spanner.admin.database.v1.DdlStatementActionInfo.toObject(message.actions[j], options); - } - return object; - }; - - /** - * Converts this UpdateDatabaseDdlMetadata to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata - * @instance - * @returns {Object.} JSON object - */ - UpdateDatabaseDdlMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateDatabaseDdlMetadata - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateDatabaseDdlMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata"; - }; - - return UpdateDatabaseDdlMetadata; - })(); - - v1.DropDatabaseRequest = (function() { - - /** - * Properties of a DropDatabaseRequest. - * @memberof google.spanner.admin.database.v1 - * @interface IDropDatabaseRequest - * @property {string|null} [database] DropDatabaseRequest database - */ - - /** - * Constructs a new DropDatabaseRequest. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents a DropDatabaseRequest. - * @implements IDropDatabaseRequest - * @constructor - * @param {google.spanner.admin.database.v1.IDropDatabaseRequest=} [properties] Properties to set - */ - function DropDatabaseRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DropDatabaseRequest database. - * @member {string} database - * @memberof google.spanner.admin.database.v1.DropDatabaseRequest - * @instance - */ - DropDatabaseRequest.prototype.database = ""; - - /** - * Creates a new DropDatabaseRequest instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.DropDatabaseRequest - * @static - * @param {google.spanner.admin.database.v1.IDropDatabaseRequest=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.DropDatabaseRequest} DropDatabaseRequest instance - */ - DropDatabaseRequest.create = function create(properties) { - return new DropDatabaseRequest(properties); - }; - - /** - * Encodes the specified DropDatabaseRequest message. Does not implicitly {@link google.spanner.admin.database.v1.DropDatabaseRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.DropDatabaseRequest - * @static - * @param {google.spanner.admin.database.v1.IDropDatabaseRequest} message DropDatabaseRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DropDatabaseRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.database != null && Object.hasOwnProperty.call(message, "database")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.database); - return writer; - }; - - /** - * Encodes the specified DropDatabaseRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.DropDatabaseRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.DropDatabaseRequest - * @static - * @param {google.spanner.admin.database.v1.IDropDatabaseRequest} message DropDatabaseRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DropDatabaseRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DropDatabaseRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.DropDatabaseRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.DropDatabaseRequest} DropDatabaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DropDatabaseRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.DropDatabaseRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.database = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DropDatabaseRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.DropDatabaseRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.DropDatabaseRequest} DropDatabaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DropDatabaseRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DropDatabaseRequest message. - * @function verify - * @memberof google.spanner.admin.database.v1.DropDatabaseRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DropDatabaseRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.database != null && message.hasOwnProperty("database")) - if (!$util.isString(message.database)) - return "database: string expected"; - return null; - }; - - /** - * Creates a DropDatabaseRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.DropDatabaseRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.DropDatabaseRequest} DropDatabaseRequest - */ - DropDatabaseRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.DropDatabaseRequest) - return object; - var message = new $root.google.spanner.admin.database.v1.DropDatabaseRequest(); - if (object.database != null) - message.database = String(object.database); - return message; - }; - - /** - * Creates a plain object from a DropDatabaseRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.DropDatabaseRequest - * @static - * @param {google.spanner.admin.database.v1.DropDatabaseRequest} message DropDatabaseRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DropDatabaseRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.database = ""; - if (message.database != null && message.hasOwnProperty("database")) - object.database = message.database; - return object; - }; - - /** - * Converts this DropDatabaseRequest to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.DropDatabaseRequest - * @instance - * @returns {Object.} JSON object - */ - DropDatabaseRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DropDatabaseRequest - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.DropDatabaseRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DropDatabaseRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.DropDatabaseRequest"; - }; - - return DropDatabaseRequest; - })(); - - v1.GetDatabaseDdlRequest = (function() { - - /** - * Properties of a GetDatabaseDdlRequest. - * @memberof google.spanner.admin.database.v1 - * @interface IGetDatabaseDdlRequest - * @property {string|null} [database] GetDatabaseDdlRequest database - */ - - /** - * Constructs a new GetDatabaseDdlRequest. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents a GetDatabaseDdlRequest. - * @implements IGetDatabaseDdlRequest - * @constructor - * @param {google.spanner.admin.database.v1.IGetDatabaseDdlRequest=} [properties] Properties to set - */ - function GetDatabaseDdlRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetDatabaseDdlRequest database. - * @member {string} database - * @memberof google.spanner.admin.database.v1.GetDatabaseDdlRequest - * @instance - */ - GetDatabaseDdlRequest.prototype.database = ""; - - /** - * Creates a new GetDatabaseDdlRequest instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.GetDatabaseDdlRequest - * @static - * @param {google.spanner.admin.database.v1.IGetDatabaseDdlRequest=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.GetDatabaseDdlRequest} GetDatabaseDdlRequest instance - */ - GetDatabaseDdlRequest.create = function create(properties) { - return new GetDatabaseDdlRequest(properties); - }; - - /** - * Encodes the specified GetDatabaseDdlRequest message. Does not implicitly {@link google.spanner.admin.database.v1.GetDatabaseDdlRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.GetDatabaseDdlRequest - * @static - * @param {google.spanner.admin.database.v1.IGetDatabaseDdlRequest} message GetDatabaseDdlRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDatabaseDdlRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.database != null && Object.hasOwnProperty.call(message, "database")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.database); - return writer; - }; - - /** - * Encodes the specified GetDatabaseDdlRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.GetDatabaseDdlRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.GetDatabaseDdlRequest - * @static - * @param {google.spanner.admin.database.v1.IGetDatabaseDdlRequest} message GetDatabaseDdlRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDatabaseDdlRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetDatabaseDdlRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.GetDatabaseDdlRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.GetDatabaseDdlRequest} GetDatabaseDdlRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDatabaseDdlRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.GetDatabaseDdlRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.database = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetDatabaseDdlRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.GetDatabaseDdlRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.GetDatabaseDdlRequest} GetDatabaseDdlRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDatabaseDdlRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetDatabaseDdlRequest message. - * @function verify - * @memberof google.spanner.admin.database.v1.GetDatabaseDdlRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetDatabaseDdlRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.database != null && message.hasOwnProperty("database")) - if (!$util.isString(message.database)) - return "database: string expected"; - return null; - }; - - /** - * Creates a GetDatabaseDdlRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.GetDatabaseDdlRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.GetDatabaseDdlRequest} GetDatabaseDdlRequest - */ - GetDatabaseDdlRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.GetDatabaseDdlRequest) - return object; - var message = new $root.google.spanner.admin.database.v1.GetDatabaseDdlRequest(); - if (object.database != null) - message.database = String(object.database); - return message; - }; - - /** - * Creates a plain object from a GetDatabaseDdlRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.GetDatabaseDdlRequest - * @static - * @param {google.spanner.admin.database.v1.GetDatabaseDdlRequest} message GetDatabaseDdlRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetDatabaseDdlRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.database = ""; - if (message.database != null && message.hasOwnProperty("database")) - object.database = message.database; - return object; - }; - - /** - * Converts this GetDatabaseDdlRequest to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.GetDatabaseDdlRequest - * @instance - * @returns {Object.} JSON object - */ - GetDatabaseDdlRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetDatabaseDdlRequest - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.GetDatabaseDdlRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetDatabaseDdlRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.GetDatabaseDdlRequest"; - }; - - return GetDatabaseDdlRequest; - })(); - - v1.GetDatabaseDdlResponse = (function() { - - /** - * Properties of a GetDatabaseDdlResponse. - * @memberof google.spanner.admin.database.v1 - * @interface IGetDatabaseDdlResponse - * @property {Array.|null} [statements] GetDatabaseDdlResponse statements - * @property {Uint8Array|null} [protoDescriptors] GetDatabaseDdlResponse protoDescriptors - */ - - /** - * Constructs a new GetDatabaseDdlResponse. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents a GetDatabaseDdlResponse. - * @implements IGetDatabaseDdlResponse - * @constructor - * @param {google.spanner.admin.database.v1.IGetDatabaseDdlResponse=} [properties] Properties to set - */ - function GetDatabaseDdlResponse(properties) { - this.statements = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetDatabaseDdlResponse statements. - * @member {Array.} statements - * @memberof google.spanner.admin.database.v1.GetDatabaseDdlResponse - * @instance - */ - GetDatabaseDdlResponse.prototype.statements = $util.emptyArray; - - /** - * GetDatabaseDdlResponse protoDescriptors. - * @member {Uint8Array} protoDescriptors - * @memberof google.spanner.admin.database.v1.GetDatabaseDdlResponse - * @instance - */ - GetDatabaseDdlResponse.prototype.protoDescriptors = $util.newBuffer([]); - - /** - * Creates a new GetDatabaseDdlResponse instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.GetDatabaseDdlResponse - * @static - * @param {google.spanner.admin.database.v1.IGetDatabaseDdlResponse=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.GetDatabaseDdlResponse} GetDatabaseDdlResponse instance - */ - GetDatabaseDdlResponse.create = function create(properties) { - return new GetDatabaseDdlResponse(properties); - }; - - /** - * Encodes the specified GetDatabaseDdlResponse message. Does not implicitly {@link google.spanner.admin.database.v1.GetDatabaseDdlResponse.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.GetDatabaseDdlResponse - * @static - * @param {google.spanner.admin.database.v1.IGetDatabaseDdlResponse} message GetDatabaseDdlResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDatabaseDdlResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.statements != null && message.statements.length) - for (var i = 0; i < message.statements.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.statements[i]); - if (message.protoDescriptors != null && Object.hasOwnProperty.call(message, "protoDescriptors")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.protoDescriptors); - return writer; - }; - - /** - * Encodes the specified GetDatabaseDdlResponse message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.GetDatabaseDdlResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.GetDatabaseDdlResponse - * @static - * @param {google.spanner.admin.database.v1.IGetDatabaseDdlResponse} message GetDatabaseDdlResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDatabaseDdlResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetDatabaseDdlResponse message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.GetDatabaseDdlResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.GetDatabaseDdlResponse} GetDatabaseDdlResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDatabaseDdlResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.GetDatabaseDdlResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.statements && message.statements.length)) - message.statements = []; - message.statements.push(reader.string()); - break; - } - case 2: { - message.protoDescriptors = reader.bytes(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetDatabaseDdlResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.GetDatabaseDdlResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.GetDatabaseDdlResponse} GetDatabaseDdlResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDatabaseDdlResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetDatabaseDdlResponse message. - * @function verify - * @memberof google.spanner.admin.database.v1.GetDatabaseDdlResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetDatabaseDdlResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.statements != null && message.hasOwnProperty("statements")) { - if (!Array.isArray(message.statements)) - return "statements: array expected"; - for (var i = 0; i < message.statements.length; ++i) - if (!$util.isString(message.statements[i])) - return "statements: string[] expected"; - } - if (message.protoDescriptors != null && message.hasOwnProperty("protoDescriptors")) - if (!(message.protoDescriptors && typeof message.protoDescriptors.length === "number" || $util.isString(message.protoDescriptors))) - return "protoDescriptors: buffer expected"; - return null; - }; - - /** - * Creates a GetDatabaseDdlResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.GetDatabaseDdlResponse - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.GetDatabaseDdlResponse} GetDatabaseDdlResponse - */ - GetDatabaseDdlResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.GetDatabaseDdlResponse) - return object; - var message = new $root.google.spanner.admin.database.v1.GetDatabaseDdlResponse(); - if (object.statements) { - if (!Array.isArray(object.statements)) - throw TypeError(".google.spanner.admin.database.v1.GetDatabaseDdlResponse.statements: array expected"); - message.statements = []; - for (var i = 0; i < object.statements.length; ++i) - message.statements[i] = String(object.statements[i]); - } - if (object.protoDescriptors != null) - if (typeof object.protoDescriptors === "string") - $util.base64.decode(object.protoDescriptors, message.protoDescriptors = $util.newBuffer($util.base64.length(object.protoDescriptors)), 0); - else if (object.protoDescriptors.length >= 0) - message.protoDescriptors = object.protoDescriptors; - return message; - }; - - /** - * Creates a plain object from a GetDatabaseDdlResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.GetDatabaseDdlResponse - * @static - * @param {google.spanner.admin.database.v1.GetDatabaseDdlResponse} message GetDatabaseDdlResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetDatabaseDdlResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.statements = []; - if (options.defaults) - if (options.bytes === String) - object.protoDescriptors = ""; - else { - object.protoDescriptors = []; - if (options.bytes !== Array) - object.protoDescriptors = $util.newBuffer(object.protoDescriptors); - } - if (message.statements && message.statements.length) { - object.statements = []; - for (var j = 0; j < message.statements.length; ++j) - object.statements[j] = message.statements[j]; - } - if (message.protoDescriptors != null && message.hasOwnProperty("protoDescriptors")) - object.protoDescriptors = options.bytes === String ? $util.base64.encode(message.protoDescriptors, 0, message.protoDescriptors.length) : options.bytes === Array ? Array.prototype.slice.call(message.protoDescriptors) : message.protoDescriptors; - return object; - }; - - /** - * Converts this GetDatabaseDdlResponse to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.GetDatabaseDdlResponse - * @instance - * @returns {Object.} JSON object - */ - GetDatabaseDdlResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetDatabaseDdlResponse - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.GetDatabaseDdlResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetDatabaseDdlResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.GetDatabaseDdlResponse"; - }; - - return GetDatabaseDdlResponse; - })(); - - v1.ListDatabaseOperationsRequest = (function() { - - /** - * Properties of a ListDatabaseOperationsRequest. - * @memberof google.spanner.admin.database.v1 - * @interface IListDatabaseOperationsRequest - * @property {string|null} [parent] ListDatabaseOperationsRequest parent - * @property {string|null} [filter] ListDatabaseOperationsRequest filter - * @property {number|null} [pageSize] ListDatabaseOperationsRequest pageSize - * @property {string|null} [pageToken] ListDatabaseOperationsRequest pageToken - */ - - /** - * Constructs a new ListDatabaseOperationsRequest. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents a ListDatabaseOperationsRequest. - * @implements IListDatabaseOperationsRequest - * @constructor - * @param {google.spanner.admin.database.v1.IListDatabaseOperationsRequest=} [properties] Properties to set - */ - function ListDatabaseOperationsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListDatabaseOperationsRequest parent. - * @member {string} parent - * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsRequest - * @instance - */ - ListDatabaseOperationsRequest.prototype.parent = ""; - - /** - * ListDatabaseOperationsRequest filter. - * @member {string} filter - * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsRequest - * @instance - */ - ListDatabaseOperationsRequest.prototype.filter = ""; - - /** - * ListDatabaseOperationsRequest pageSize. - * @member {number} pageSize - * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsRequest - * @instance - */ - ListDatabaseOperationsRequest.prototype.pageSize = 0; - - /** - * ListDatabaseOperationsRequest pageToken. - * @member {string} pageToken - * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsRequest - * @instance - */ - ListDatabaseOperationsRequest.prototype.pageToken = ""; - - /** - * Creates a new ListDatabaseOperationsRequest instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsRequest - * @static - * @param {google.spanner.admin.database.v1.IListDatabaseOperationsRequest=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.ListDatabaseOperationsRequest} ListDatabaseOperationsRequest instance - */ - ListDatabaseOperationsRequest.create = function create(properties) { - return new ListDatabaseOperationsRequest(properties); - }; - - /** - * Encodes the specified ListDatabaseOperationsRequest message. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabaseOperationsRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsRequest - * @static - * @param {google.spanner.admin.database.v1.IListDatabaseOperationsRequest} message ListDatabaseOperationsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListDatabaseOperationsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); - return writer; - }; - - /** - * Encodes the specified ListDatabaseOperationsRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabaseOperationsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsRequest - * @static - * @param {google.spanner.admin.database.v1.IListDatabaseOperationsRequest} message ListDatabaseOperationsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListDatabaseOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListDatabaseOperationsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.ListDatabaseOperationsRequest} ListDatabaseOperationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListDatabaseOperationsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.ListDatabaseOperationsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.filter = reader.string(); - break; - } - case 3: { - message.pageSize = reader.int32(); - break; - } - case 4: { - message.pageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListDatabaseOperationsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.ListDatabaseOperationsRequest} ListDatabaseOperationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListDatabaseOperationsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListDatabaseOperationsRequest message. - * @function verify - * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListDatabaseOperationsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.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 ListDatabaseOperationsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.ListDatabaseOperationsRequest} ListDatabaseOperationsRequest - */ - ListDatabaseOperationsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.ListDatabaseOperationsRequest) - return object; - var message = new $root.google.spanner.admin.database.v1.ListDatabaseOperationsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.filter != null) - message.filter = String(object.filter); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - return message; - }; - - /** - * Creates a plain object from a ListDatabaseOperationsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsRequest - * @static - * @param {google.spanner.admin.database.v1.ListDatabaseOperationsRequest} message ListDatabaseOperationsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListDatabaseOperationsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.filter = ""; - object.pageSize = 0; - object.pageToken = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - return object; - }; - - /** - * Converts this ListDatabaseOperationsRequest to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsRequest - * @instance - * @returns {Object.} JSON object - */ - ListDatabaseOperationsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListDatabaseOperationsRequest - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListDatabaseOperationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.ListDatabaseOperationsRequest"; - }; - - return ListDatabaseOperationsRequest; - })(); - - v1.ListDatabaseOperationsResponse = (function() { - - /** - * Properties of a ListDatabaseOperationsResponse. - * @memberof google.spanner.admin.database.v1 - * @interface IListDatabaseOperationsResponse - * @property {Array.|null} [operations] ListDatabaseOperationsResponse operations - * @property {string|null} [nextPageToken] ListDatabaseOperationsResponse nextPageToken - */ - - /** - * Constructs a new ListDatabaseOperationsResponse. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents a ListDatabaseOperationsResponse. - * @implements IListDatabaseOperationsResponse - * @constructor - * @param {google.spanner.admin.database.v1.IListDatabaseOperationsResponse=} [properties] Properties to set - */ - function ListDatabaseOperationsResponse(properties) { - this.operations = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListDatabaseOperationsResponse operations. - * @member {Array.} operations - * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsResponse - * @instance - */ - ListDatabaseOperationsResponse.prototype.operations = $util.emptyArray; - - /** - * ListDatabaseOperationsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsResponse - * @instance - */ - ListDatabaseOperationsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListDatabaseOperationsResponse instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsResponse - * @static - * @param {google.spanner.admin.database.v1.IListDatabaseOperationsResponse=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.ListDatabaseOperationsResponse} ListDatabaseOperationsResponse instance - */ - ListDatabaseOperationsResponse.create = function create(properties) { - return new ListDatabaseOperationsResponse(properties); - }; - - /** - * Encodes the specified ListDatabaseOperationsResponse message. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabaseOperationsResponse.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsResponse - * @static - * @param {google.spanner.admin.database.v1.IListDatabaseOperationsResponse} message ListDatabaseOperationsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListDatabaseOperationsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.operations != null && message.operations.length) - for (var i = 0; i < message.operations.length; ++i) - $root.google.longrunning.Operation.encode(message.operations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - return writer; - }; - - /** - * Encodes the specified ListDatabaseOperationsResponse message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabaseOperationsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsResponse - * @static - * @param {google.spanner.admin.database.v1.IListDatabaseOperationsResponse} message ListDatabaseOperationsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListDatabaseOperationsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListDatabaseOperationsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.ListDatabaseOperationsResponse} ListDatabaseOperationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListDatabaseOperationsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.ListDatabaseOperationsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.operations && message.operations.length)) - message.operations = []; - message.operations.push($root.google.longrunning.Operation.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListDatabaseOperationsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.ListDatabaseOperationsResponse} ListDatabaseOperationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListDatabaseOperationsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListDatabaseOperationsResponse message. - * @function verify - * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListDatabaseOperationsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.operations != null && message.hasOwnProperty("operations")) { - if (!Array.isArray(message.operations)) - return "operations: array expected"; - for (var i = 0; i < message.operations.length; ++i) { - var error = $root.google.longrunning.Operation.verify(message.operations[i]); - if (error) - return "operations." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListDatabaseOperationsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.ListDatabaseOperationsResponse} ListDatabaseOperationsResponse - */ - ListDatabaseOperationsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.ListDatabaseOperationsResponse) - return object; - var message = new $root.google.spanner.admin.database.v1.ListDatabaseOperationsResponse(); - if (object.operations) { - if (!Array.isArray(object.operations)) - throw TypeError(".google.spanner.admin.database.v1.ListDatabaseOperationsResponse.operations: array expected"); - message.operations = []; - for (var i = 0; i < object.operations.length; ++i) { - if (typeof object.operations[i] !== "object") - throw TypeError(".google.spanner.admin.database.v1.ListDatabaseOperationsResponse.operations: object expected"); - message.operations[i] = $root.google.longrunning.Operation.fromObject(object.operations[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListDatabaseOperationsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsResponse - * @static - * @param {google.spanner.admin.database.v1.ListDatabaseOperationsResponse} message ListDatabaseOperationsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListDatabaseOperationsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.operations = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.operations && message.operations.length) { - object.operations = []; - for (var j = 0; j < message.operations.length; ++j) - object.operations[j] = $root.google.longrunning.Operation.toObject(message.operations[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListDatabaseOperationsResponse to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsResponse - * @instance - * @returns {Object.} JSON object - */ - ListDatabaseOperationsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListDatabaseOperationsResponse - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.ListDatabaseOperationsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListDatabaseOperationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.ListDatabaseOperationsResponse"; - }; - - return ListDatabaseOperationsResponse; - })(); - - v1.RestoreDatabaseRequest = (function() { - - /** - * Properties of a RestoreDatabaseRequest. - * @memberof google.spanner.admin.database.v1 - * @interface IRestoreDatabaseRequest - * @property {string|null} [parent] RestoreDatabaseRequest parent - * @property {string|null} [databaseId] RestoreDatabaseRequest databaseId - * @property {string|null} [backup] RestoreDatabaseRequest backup - * @property {google.spanner.admin.database.v1.IRestoreDatabaseEncryptionConfig|null} [encryptionConfig] RestoreDatabaseRequest encryptionConfig - */ - - /** - * Constructs a new RestoreDatabaseRequest. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents a RestoreDatabaseRequest. - * @implements IRestoreDatabaseRequest - * @constructor - * @param {google.spanner.admin.database.v1.IRestoreDatabaseRequest=} [properties] Properties to set - */ - function RestoreDatabaseRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RestoreDatabaseRequest parent. - * @member {string} parent - * @memberof google.spanner.admin.database.v1.RestoreDatabaseRequest - * @instance - */ - RestoreDatabaseRequest.prototype.parent = ""; - - /** - * RestoreDatabaseRequest databaseId. - * @member {string} databaseId - * @memberof google.spanner.admin.database.v1.RestoreDatabaseRequest - * @instance - */ - RestoreDatabaseRequest.prototype.databaseId = ""; - - /** - * RestoreDatabaseRequest backup. - * @member {string|null|undefined} backup - * @memberof google.spanner.admin.database.v1.RestoreDatabaseRequest - * @instance - */ - RestoreDatabaseRequest.prototype.backup = null; - - /** - * RestoreDatabaseRequest encryptionConfig. - * @member {google.spanner.admin.database.v1.IRestoreDatabaseEncryptionConfig|null|undefined} encryptionConfig - * @memberof google.spanner.admin.database.v1.RestoreDatabaseRequest - * @instance - */ - RestoreDatabaseRequest.prototype.encryptionConfig = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * RestoreDatabaseRequest source. - * @member {"backup"|undefined} source - * @memberof google.spanner.admin.database.v1.RestoreDatabaseRequest - * @instance - */ - Object.defineProperty(RestoreDatabaseRequest.prototype, "source", { - get: $util.oneOfGetter($oneOfFields = ["backup"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new RestoreDatabaseRequest instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.RestoreDatabaseRequest - * @static - * @param {google.spanner.admin.database.v1.IRestoreDatabaseRequest=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.RestoreDatabaseRequest} RestoreDatabaseRequest instance - */ - RestoreDatabaseRequest.create = function create(properties) { - return new RestoreDatabaseRequest(properties); - }; - - /** - * Encodes the specified RestoreDatabaseRequest message. Does not implicitly {@link google.spanner.admin.database.v1.RestoreDatabaseRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.RestoreDatabaseRequest - * @static - * @param {google.spanner.admin.database.v1.IRestoreDatabaseRequest} message RestoreDatabaseRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RestoreDatabaseRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.databaseId != null && Object.hasOwnProperty.call(message, "databaseId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.databaseId); - if (message.backup != null && Object.hasOwnProperty.call(message, "backup")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.backup); - if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) - $root.google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified RestoreDatabaseRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.RestoreDatabaseRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.RestoreDatabaseRequest - * @static - * @param {google.spanner.admin.database.v1.IRestoreDatabaseRequest} message RestoreDatabaseRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RestoreDatabaseRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RestoreDatabaseRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.RestoreDatabaseRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.RestoreDatabaseRequest} RestoreDatabaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RestoreDatabaseRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.RestoreDatabaseRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.databaseId = reader.string(); - break; - } - case 3: { - message.backup = reader.string(); - break; - } - case 4: { - message.encryptionConfig = $root.google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RestoreDatabaseRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.RestoreDatabaseRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.RestoreDatabaseRequest} RestoreDatabaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RestoreDatabaseRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RestoreDatabaseRequest message. - * @function verify - * @memberof google.spanner.admin.database.v1.RestoreDatabaseRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RestoreDatabaseRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.databaseId != null && message.hasOwnProperty("databaseId")) - if (!$util.isString(message.databaseId)) - return "databaseId: string expected"; - if (message.backup != null && message.hasOwnProperty("backup")) { - properties.source = 1; - if (!$util.isString(message.backup)) - return "backup: string expected"; - } - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { - var error = $root.google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.verify(message.encryptionConfig); - if (error) - return "encryptionConfig." + error; - } - return null; - }; - - /** - * Creates a RestoreDatabaseRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.RestoreDatabaseRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.RestoreDatabaseRequest} RestoreDatabaseRequest - */ - RestoreDatabaseRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.RestoreDatabaseRequest) - return object; - var message = new $root.google.spanner.admin.database.v1.RestoreDatabaseRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.databaseId != null) - message.databaseId = String(object.databaseId); - if (object.backup != null) - message.backup = String(object.backup); - if (object.encryptionConfig != null) { - if (typeof object.encryptionConfig !== "object") - throw TypeError(".google.spanner.admin.database.v1.RestoreDatabaseRequest.encryptionConfig: object expected"); - message.encryptionConfig = $root.google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.fromObject(object.encryptionConfig); - } - return message; - }; - - /** - * Creates a plain object from a RestoreDatabaseRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.RestoreDatabaseRequest - * @static - * @param {google.spanner.admin.database.v1.RestoreDatabaseRequest} message RestoreDatabaseRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RestoreDatabaseRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.databaseId = ""; - object.encryptionConfig = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.databaseId != null && message.hasOwnProperty("databaseId")) - object.databaseId = message.databaseId; - if (message.backup != null && message.hasOwnProperty("backup")) { - object.backup = message.backup; - if (options.oneofs) - object.source = "backup"; - } - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) - object.encryptionConfig = $root.google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.toObject(message.encryptionConfig, options); - return object; - }; - - /** - * Converts this RestoreDatabaseRequest to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.RestoreDatabaseRequest - * @instance - * @returns {Object.} JSON object - */ - RestoreDatabaseRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RestoreDatabaseRequest - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.RestoreDatabaseRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RestoreDatabaseRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.RestoreDatabaseRequest"; - }; - - return RestoreDatabaseRequest; - })(); - - v1.RestoreDatabaseEncryptionConfig = (function() { - - /** - * Properties of a RestoreDatabaseEncryptionConfig. - * @memberof google.spanner.admin.database.v1 - * @interface IRestoreDatabaseEncryptionConfig - * @property {google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.EncryptionType|null} [encryptionType] RestoreDatabaseEncryptionConfig encryptionType - * @property {string|null} [kmsKeyName] RestoreDatabaseEncryptionConfig kmsKeyName - * @property {Array.|null} [kmsKeyNames] RestoreDatabaseEncryptionConfig kmsKeyNames - */ - - /** - * Constructs a new RestoreDatabaseEncryptionConfig. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents a RestoreDatabaseEncryptionConfig. - * @implements IRestoreDatabaseEncryptionConfig - * @constructor - * @param {google.spanner.admin.database.v1.IRestoreDatabaseEncryptionConfig=} [properties] Properties to set - */ - function RestoreDatabaseEncryptionConfig(properties) { - this.kmsKeyNames = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RestoreDatabaseEncryptionConfig encryptionType. - * @member {google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.EncryptionType} encryptionType - * @memberof google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig - * @instance - */ - RestoreDatabaseEncryptionConfig.prototype.encryptionType = 0; - - /** - * RestoreDatabaseEncryptionConfig kmsKeyName. - * @member {string} kmsKeyName - * @memberof google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig - * @instance - */ - RestoreDatabaseEncryptionConfig.prototype.kmsKeyName = ""; - - /** - * RestoreDatabaseEncryptionConfig kmsKeyNames. - * @member {Array.} kmsKeyNames - * @memberof google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig - * @instance - */ - RestoreDatabaseEncryptionConfig.prototype.kmsKeyNames = $util.emptyArray; - - /** - * Creates a new RestoreDatabaseEncryptionConfig instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig - * @static - * @param {google.spanner.admin.database.v1.IRestoreDatabaseEncryptionConfig=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig} RestoreDatabaseEncryptionConfig instance - */ - RestoreDatabaseEncryptionConfig.create = function create(properties) { - return new RestoreDatabaseEncryptionConfig(properties); - }; - - /** - * Encodes the specified RestoreDatabaseEncryptionConfig message. Does not implicitly {@link google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig - * @static - * @param {google.spanner.admin.database.v1.IRestoreDatabaseEncryptionConfig} message RestoreDatabaseEncryptionConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RestoreDatabaseEncryptionConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.encryptionType != null && Object.hasOwnProperty.call(message, "encryptionType")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.encryptionType); - if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.kmsKeyName); - if (message.kmsKeyNames != null && message.kmsKeyNames.length) - for (var i = 0; i < message.kmsKeyNames.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.kmsKeyNames[i]); - return writer; - }; - - /** - * Encodes the specified RestoreDatabaseEncryptionConfig message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig - * @static - * @param {google.spanner.admin.database.v1.IRestoreDatabaseEncryptionConfig} message RestoreDatabaseEncryptionConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RestoreDatabaseEncryptionConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RestoreDatabaseEncryptionConfig message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig} RestoreDatabaseEncryptionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RestoreDatabaseEncryptionConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.encryptionType = reader.int32(); - break; - } - case 2: { - message.kmsKeyName = reader.string(); - break; - } - case 3: { - if (!(message.kmsKeyNames && message.kmsKeyNames.length)) - message.kmsKeyNames = []; - message.kmsKeyNames.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RestoreDatabaseEncryptionConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig} RestoreDatabaseEncryptionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RestoreDatabaseEncryptionConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RestoreDatabaseEncryptionConfig message. - * @function verify - * @memberof google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RestoreDatabaseEncryptionConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.encryptionType != null && message.hasOwnProperty("encryptionType")) - switch (message.encryptionType) { - default: - return "encryptionType: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) - if (!$util.isString(message.kmsKeyName)) - return "kmsKeyName: string expected"; - if (message.kmsKeyNames != null && message.hasOwnProperty("kmsKeyNames")) { - if (!Array.isArray(message.kmsKeyNames)) - return "kmsKeyNames: array expected"; - for (var i = 0; i < message.kmsKeyNames.length; ++i) - if (!$util.isString(message.kmsKeyNames[i])) - return "kmsKeyNames: string[] expected"; - } - return null; - }; - - /** - * Creates a RestoreDatabaseEncryptionConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig} RestoreDatabaseEncryptionConfig - */ - RestoreDatabaseEncryptionConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig) - return object; - var message = new $root.google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig(); - switch (object.encryptionType) { - default: - if (typeof object.encryptionType === "number") { - message.encryptionType = object.encryptionType; - break; - } - break; - case "ENCRYPTION_TYPE_UNSPECIFIED": - case 0: - message.encryptionType = 0; - break; - case "USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION": - case 1: - message.encryptionType = 1; - break; - case "GOOGLE_DEFAULT_ENCRYPTION": - case 2: - message.encryptionType = 2; - break; - case "CUSTOMER_MANAGED_ENCRYPTION": - case 3: - message.encryptionType = 3; - break; - } - if (object.kmsKeyName != null) - message.kmsKeyName = String(object.kmsKeyName); - if (object.kmsKeyNames) { - if (!Array.isArray(object.kmsKeyNames)) - throw TypeError(".google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.kmsKeyNames: array expected"); - message.kmsKeyNames = []; - for (var i = 0; i < object.kmsKeyNames.length; ++i) - message.kmsKeyNames[i] = String(object.kmsKeyNames[i]); - } - return message; - }; - - /** - * Creates a plain object from a RestoreDatabaseEncryptionConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig - * @static - * @param {google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig} message RestoreDatabaseEncryptionConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RestoreDatabaseEncryptionConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.kmsKeyNames = []; - if (options.defaults) { - object.encryptionType = options.enums === String ? "ENCRYPTION_TYPE_UNSPECIFIED" : 0; - object.kmsKeyName = ""; - } - if (message.encryptionType != null && message.hasOwnProperty("encryptionType")) - object.encryptionType = options.enums === String ? $root.google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.EncryptionType[message.encryptionType] === undefined ? message.encryptionType : $root.google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.EncryptionType[message.encryptionType] : message.encryptionType; - if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) - object.kmsKeyName = message.kmsKeyName; - if (message.kmsKeyNames && message.kmsKeyNames.length) { - object.kmsKeyNames = []; - for (var j = 0; j < message.kmsKeyNames.length; ++j) - object.kmsKeyNames[j] = message.kmsKeyNames[j]; - } - return object; - }; - - /** - * Converts this RestoreDatabaseEncryptionConfig to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig - * @instance - * @returns {Object.} JSON object - */ - RestoreDatabaseEncryptionConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RestoreDatabaseEncryptionConfig - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RestoreDatabaseEncryptionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig"; - }; - - /** - * EncryptionType enum. - * @name google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.EncryptionType - * @enum {number} - * @property {number} ENCRYPTION_TYPE_UNSPECIFIED=0 ENCRYPTION_TYPE_UNSPECIFIED value - * @property {number} USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION=1 USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION value - * @property {number} GOOGLE_DEFAULT_ENCRYPTION=2 GOOGLE_DEFAULT_ENCRYPTION value - * @property {number} CUSTOMER_MANAGED_ENCRYPTION=3 CUSTOMER_MANAGED_ENCRYPTION value - */ - RestoreDatabaseEncryptionConfig.EncryptionType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ENCRYPTION_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION"] = 1; - values[valuesById[2] = "GOOGLE_DEFAULT_ENCRYPTION"] = 2; - values[valuesById[3] = "CUSTOMER_MANAGED_ENCRYPTION"] = 3; - return values; - })(); - - return RestoreDatabaseEncryptionConfig; - })(); - - v1.RestoreDatabaseMetadata = (function() { - - /** - * Properties of a RestoreDatabaseMetadata. - * @memberof google.spanner.admin.database.v1 - * @interface IRestoreDatabaseMetadata - * @property {string|null} [name] RestoreDatabaseMetadata name - * @property {google.spanner.admin.database.v1.RestoreSourceType|null} [sourceType] RestoreDatabaseMetadata sourceType - * @property {google.spanner.admin.database.v1.IBackupInfo|null} [backupInfo] RestoreDatabaseMetadata backupInfo - * @property {google.spanner.admin.database.v1.IOperationProgress|null} [progress] RestoreDatabaseMetadata progress - * @property {google.protobuf.ITimestamp|null} [cancelTime] RestoreDatabaseMetadata cancelTime - * @property {string|null} [optimizeDatabaseOperationName] RestoreDatabaseMetadata optimizeDatabaseOperationName - */ - - /** - * Constructs a new RestoreDatabaseMetadata. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents a RestoreDatabaseMetadata. - * @implements IRestoreDatabaseMetadata - * @constructor - * @param {google.spanner.admin.database.v1.IRestoreDatabaseMetadata=} [properties] Properties to set - */ - function RestoreDatabaseMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RestoreDatabaseMetadata name. - * @member {string} name - * @memberof google.spanner.admin.database.v1.RestoreDatabaseMetadata - * @instance - */ - RestoreDatabaseMetadata.prototype.name = ""; - - /** - * RestoreDatabaseMetadata sourceType. - * @member {google.spanner.admin.database.v1.RestoreSourceType} sourceType - * @memberof google.spanner.admin.database.v1.RestoreDatabaseMetadata - * @instance - */ - RestoreDatabaseMetadata.prototype.sourceType = 0; - - /** - * RestoreDatabaseMetadata backupInfo. - * @member {google.spanner.admin.database.v1.IBackupInfo|null|undefined} backupInfo - * @memberof google.spanner.admin.database.v1.RestoreDatabaseMetadata - * @instance - */ - RestoreDatabaseMetadata.prototype.backupInfo = null; - - /** - * RestoreDatabaseMetadata progress. - * @member {google.spanner.admin.database.v1.IOperationProgress|null|undefined} progress - * @memberof google.spanner.admin.database.v1.RestoreDatabaseMetadata - * @instance - */ - RestoreDatabaseMetadata.prototype.progress = null; - - /** - * RestoreDatabaseMetadata cancelTime. - * @member {google.protobuf.ITimestamp|null|undefined} cancelTime - * @memberof google.spanner.admin.database.v1.RestoreDatabaseMetadata - * @instance - */ - RestoreDatabaseMetadata.prototype.cancelTime = null; - - /** - * RestoreDatabaseMetadata optimizeDatabaseOperationName. - * @member {string} optimizeDatabaseOperationName - * @memberof google.spanner.admin.database.v1.RestoreDatabaseMetadata - * @instance - */ - RestoreDatabaseMetadata.prototype.optimizeDatabaseOperationName = ""; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * RestoreDatabaseMetadata sourceInfo. - * @member {"backupInfo"|undefined} sourceInfo - * @memberof google.spanner.admin.database.v1.RestoreDatabaseMetadata - * @instance - */ - Object.defineProperty(RestoreDatabaseMetadata.prototype, "sourceInfo", { - get: $util.oneOfGetter($oneOfFields = ["backupInfo"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new RestoreDatabaseMetadata instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.RestoreDatabaseMetadata - * @static - * @param {google.spanner.admin.database.v1.IRestoreDatabaseMetadata=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.RestoreDatabaseMetadata} RestoreDatabaseMetadata instance - */ - RestoreDatabaseMetadata.create = function create(properties) { - return new RestoreDatabaseMetadata(properties); - }; - - /** - * Encodes the specified RestoreDatabaseMetadata message. Does not implicitly {@link google.spanner.admin.database.v1.RestoreDatabaseMetadata.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.RestoreDatabaseMetadata - * @static - * @param {google.spanner.admin.database.v1.IRestoreDatabaseMetadata} message RestoreDatabaseMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RestoreDatabaseMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.sourceType != null && Object.hasOwnProperty.call(message, "sourceType")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.sourceType); - if (message.backupInfo != null && Object.hasOwnProperty.call(message, "backupInfo")) - $root.google.spanner.admin.database.v1.BackupInfo.encode(message.backupInfo, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.progress != null && Object.hasOwnProperty.call(message, "progress")) - $root.google.spanner.admin.database.v1.OperationProgress.encode(message.progress, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.cancelTime != null && Object.hasOwnProperty.call(message, "cancelTime")) - $root.google.protobuf.Timestamp.encode(message.cancelTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.optimizeDatabaseOperationName != null && Object.hasOwnProperty.call(message, "optimizeDatabaseOperationName")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.optimizeDatabaseOperationName); - return writer; - }; - - /** - * Encodes the specified RestoreDatabaseMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.RestoreDatabaseMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.RestoreDatabaseMetadata - * @static - * @param {google.spanner.admin.database.v1.IRestoreDatabaseMetadata} message RestoreDatabaseMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RestoreDatabaseMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RestoreDatabaseMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.RestoreDatabaseMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.RestoreDatabaseMetadata} RestoreDatabaseMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RestoreDatabaseMetadata.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.RestoreDatabaseMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.sourceType = reader.int32(); - break; - } - case 3: { - message.backupInfo = $root.google.spanner.admin.database.v1.BackupInfo.decode(reader, reader.uint32()); - break; - } - case 4: { - message.progress = $root.google.spanner.admin.database.v1.OperationProgress.decode(reader, reader.uint32()); - break; - } - case 5: { - message.cancelTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 6: { - message.optimizeDatabaseOperationName = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RestoreDatabaseMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.RestoreDatabaseMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.RestoreDatabaseMetadata} RestoreDatabaseMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RestoreDatabaseMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RestoreDatabaseMetadata message. - * @function verify - * @memberof google.spanner.admin.database.v1.RestoreDatabaseMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RestoreDatabaseMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.sourceType != null && message.hasOwnProperty("sourceType")) - switch (message.sourceType) { - default: - return "sourceType: enum value expected"; - case 0: - case 1: - break; - } - if (message.backupInfo != null && message.hasOwnProperty("backupInfo")) { - properties.sourceInfo = 1; - { - var error = $root.google.spanner.admin.database.v1.BackupInfo.verify(message.backupInfo); - if (error) - return "backupInfo." + error; - } - } - if (message.progress != null && message.hasOwnProperty("progress")) { - var error = $root.google.spanner.admin.database.v1.OperationProgress.verify(message.progress); - if (error) - return "progress." + error; - } - if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.cancelTime); - if (error) - return "cancelTime." + error; - } - if (message.optimizeDatabaseOperationName != null && message.hasOwnProperty("optimizeDatabaseOperationName")) - if (!$util.isString(message.optimizeDatabaseOperationName)) - return "optimizeDatabaseOperationName: string expected"; - return null; - }; - - /** - * Creates a RestoreDatabaseMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.RestoreDatabaseMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.RestoreDatabaseMetadata} RestoreDatabaseMetadata - */ - RestoreDatabaseMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.RestoreDatabaseMetadata) - return object; - var message = new $root.google.spanner.admin.database.v1.RestoreDatabaseMetadata(); - if (object.name != null) - message.name = String(object.name); - switch (object.sourceType) { - default: - if (typeof object.sourceType === "number") { - message.sourceType = object.sourceType; - break; - } - break; - case "TYPE_UNSPECIFIED": - case 0: - message.sourceType = 0; - break; - case "BACKUP": - case 1: - message.sourceType = 1; - break; - } - if (object.backupInfo != null) { - if (typeof object.backupInfo !== "object") - throw TypeError(".google.spanner.admin.database.v1.RestoreDatabaseMetadata.backupInfo: object expected"); - message.backupInfo = $root.google.spanner.admin.database.v1.BackupInfo.fromObject(object.backupInfo); - } - if (object.progress != null) { - if (typeof object.progress !== "object") - throw TypeError(".google.spanner.admin.database.v1.RestoreDatabaseMetadata.progress: object expected"); - message.progress = $root.google.spanner.admin.database.v1.OperationProgress.fromObject(object.progress); - } - if (object.cancelTime != null) { - if (typeof object.cancelTime !== "object") - throw TypeError(".google.spanner.admin.database.v1.RestoreDatabaseMetadata.cancelTime: object expected"); - message.cancelTime = $root.google.protobuf.Timestamp.fromObject(object.cancelTime); - } - if (object.optimizeDatabaseOperationName != null) - message.optimizeDatabaseOperationName = String(object.optimizeDatabaseOperationName); - return message; - }; - - /** - * Creates a plain object from a RestoreDatabaseMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.RestoreDatabaseMetadata - * @static - * @param {google.spanner.admin.database.v1.RestoreDatabaseMetadata} message RestoreDatabaseMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RestoreDatabaseMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.sourceType = options.enums === String ? "TYPE_UNSPECIFIED" : 0; - object.progress = null; - object.cancelTime = null; - object.optimizeDatabaseOperationName = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.sourceType != null && message.hasOwnProperty("sourceType")) - object.sourceType = options.enums === String ? $root.google.spanner.admin.database.v1.RestoreSourceType[message.sourceType] === undefined ? message.sourceType : $root.google.spanner.admin.database.v1.RestoreSourceType[message.sourceType] : message.sourceType; - if (message.backupInfo != null && message.hasOwnProperty("backupInfo")) { - object.backupInfo = $root.google.spanner.admin.database.v1.BackupInfo.toObject(message.backupInfo, options); - if (options.oneofs) - object.sourceInfo = "backupInfo"; - } - if (message.progress != null && message.hasOwnProperty("progress")) - object.progress = $root.google.spanner.admin.database.v1.OperationProgress.toObject(message.progress, options); - if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) - object.cancelTime = $root.google.protobuf.Timestamp.toObject(message.cancelTime, options); - if (message.optimizeDatabaseOperationName != null && message.hasOwnProperty("optimizeDatabaseOperationName")) - object.optimizeDatabaseOperationName = message.optimizeDatabaseOperationName; - return object; - }; - - /** - * Converts this RestoreDatabaseMetadata to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.RestoreDatabaseMetadata - * @instance - * @returns {Object.} JSON object - */ - RestoreDatabaseMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RestoreDatabaseMetadata - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.RestoreDatabaseMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RestoreDatabaseMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.RestoreDatabaseMetadata"; - }; - - return RestoreDatabaseMetadata; - })(); - - v1.OptimizeRestoredDatabaseMetadata = (function() { - - /** - * Properties of an OptimizeRestoredDatabaseMetadata. - * @memberof google.spanner.admin.database.v1 - * @interface IOptimizeRestoredDatabaseMetadata - * @property {string|null} [name] OptimizeRestoredDatabaseMetadata name - * @property {google.spanner.admin.database.v1.IOperationProgress|null} [progress] OptimizeRestoredDatabaseMetadata progress - */ - - /** - * Constructs a new OptimizeRestoredDatabaseMetadata. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents an OptimizeRestoredDatabaseMetadata. - * @implements IOptimizeRestoredDatabaseMetadata - * @constructor - * @param {google.spanner.admin.database.v1.IOptimizeRestoredDatabaseMetadata=} [properties] Properties to set - */ - function OptimizeRestoredDatabaseMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * OptimizeRestoredDatabaseMetadata name. - * @member {string} name - * @memberof google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata - * @instance - */ - OptimizeRestoredDatabaseMetadata.prototype.name = ""; - - /** - * OptimizeRestoredDatabaseMetadata progress. - * @member {google.spanner.admin.database.v1.IOperationProgress|null|undefined} progress - * @memberof google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata - * @instance - */ - OptimizeRestoredDatabaseMetadata.prototype.progress = null; - - /** - * Creates a new OptimizeRestoredDatabaseMetadata instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata - * @static - * @param {google.spanner.admin.database.v1.IOptimizeRestoredDatabaseMetadata=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata} OptimizeRestoredDatabaseMetadata instance - */ - OptimizeRestoredDatabaseMetadata.create = function create(properties) { - return new OptimizeRestoredDatabaseMetadata(properties); - }; - - /** - * Encodes the specified OptimizeRestoredDatabaseMetadata message. Does not implicitly {@link google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata - * @static - * @param {google.spanner.admin.database.v1.IOptimizeRestoredDatabaseMetadata} message OptimizeRestoredDatabaseMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OptimizeRestoredDatabaseMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.progress != null && Object.hasOwnProperty.call(message, "progress")) - $root.google.spanner.admin.database.v1.OperationProgress.encode(message.progress, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified OptimizeRestoredDatabaseMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata - * @static - * @param {google.spanner.admin.database.v1.IOptimizeRestoredDatabaseMetadata} message OptimizeRestoredDatabaseMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OptimizeRestoredDatabaseMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OptimizeRestoredDatabaseMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata} OptimizeRestoredDatabaseMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OptimizeRestoredDatabaseMetadata.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.progress = $root.google.spanner.admin.database.v1.OperationProgress.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OptimizeRestoredDatabaseMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata} OptimizeRestoredDatabaseMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OptimizeRestoredDatabaseMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OptimizeRestoredDatabaseMetadata message. - * @function verify - * @memberof google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OptimizeRestoredDatabaseMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.progress != null && message.hasOwnProperty("progress")) { - var error = $root.google.spanner.admin.database.v1.OperationProgress.verify(message.progress); - if (error) - return "progress." + error; - } - return null; - }; - - /** - * Creates an OptimizeRestoredDatabaseMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata} OptimizeRestoredDatabaseMetadata - */ - OptimizeRestoredDatabaseMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata) - return object; - var message = new $root.google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata(); - if (object.name != null) - message.name = String(object.name); - if (object.progress != null) { - if (typeof object.progress !== "object") - throw TypeError(".google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata.progress: object expected"); - message.progress = $root.google.spanner.admin.database.v1.OperationProgress.fromObject(object.progress); - } - return message; - }; - - /** - * Creates a plain object from an OptimizeRestoredDatabaseMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata - * @static - * @param {google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata} message OptimizeRestoredDatabaseMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OptimizeRestoredDatabaseMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.progress = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.progress != null && message.hasOwnProperty("progress")) - object.progress = $root.google.spanner.admin.database.v1.OperationProgress.toObject(message.progress, options); - return object; - }; - - /** - * Converts this OptimizeRestoredDatabaseMetadata to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata - * @instance - * @returns {Object.} JSON object - */ - OptimizeRestoredDatabaseMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OptimizeRestoredDatabaseMetadata - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OptimizeRestoredDatabaseMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata"; - }; - - return OptimizeRestoredDatabaseMetadata; - })(); - - /** - * RestoreSourceType enum. - * @name google.spanner.admin.database.v1.RestoreSourceType - * @enum {number} - * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value - * @property {number} BACKUP=1 BACKUP value - */ - v1.RestoreSourceType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "BACKUP"] = 1; - return values; - })(); - - v1.DatabaseRole = (function() { - - /** - * Properties of a DatabaseRole. - * @memberof google.spanner.admin.database.v1 - * @interface IDatabaseRole - * @property {string|null} [name] DatabaseRole name - */ - - /** - * Constructs a new DatabaseRole. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents a DatabaseRole. - * @implements IDatabaseRole - * @constructor - * @param {google.spanner.admin.database.v1.IDatabaseRole=} [properties] Properties to set - */ - function DatabaseRole(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DatabaseRole name. - * @member {string} name - * @memberof google.spanner.admin.database.v1.DatabaseRole - * @instance - */ - DatabaseRole.prototype.name = ""; - - /** - * Creates a new DatabaseRole instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.DatabaseRole - * @static - * @param {google.spanner.admin.database.v1.IDatabaseRole=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.DatabaseRole} DatabaseRole instance - */ - DatabaseRole.create = function create(properties) { - return new DatabaseRole(properties); - }; - - /** - * Encodes the specified DatabaseRole message. Does not implicitly {@link google.spanner.admin.database.v1.DatabaseRole.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.DatabaseRole - * @static - * @param {google.spanner.admin.database.v1.IDatabaseRole} message DatabaseRole message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DatabaseRole.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; - - /** - * Encodes the specified DatabaseRole message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.DatabaseRole.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.DatabaseRole - * @static - * @param {google.spanner.admin.database.v1.IDatabaseRole} message DatabaseRole message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DatabaseRole.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DatabaseRole message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.DatabaseRole - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.DatabaseRole} DatabaseRole - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DatabaseRole.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.DatabaseRole(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DatabaseRole message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.DatabaseRole - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.DatabaseRole} DatabaseRole - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DatabaseRole.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DatabaseRole message. - * @function verify - * @memberof google.spanner.admin.database.v1.DatabaseRole - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DatabaseRole.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 DatabaseRole message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.DatabaseRole - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.DatabaseRole} DatabaseRole - */ - DatabaseRole.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.DatabaseRole) - return object; - var message = new $root.google.spanner.admin.database.v1.DatabaseRole(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a DatabaseRole message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.DatabaseRole - * @static - * @param {google.spanner.admin.database.v1.DatabaseRole} message DatabaseRole - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DatabaseRole.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 DatabaseRole to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.DatabaseRole - * @instance - * @returns {Object.} JSON object - */ - DatabaseRole.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DatabaseRole - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.DatabaseRole - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DatabaseRole.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.DatabaseRole"; - }; - - return DatabaseRole; - })(); - - v1.ListDatabaseRolesRequest = (function() { - - /** - * Properties of a ListDatabaseRolesRequest. - * @memberof google.spanner.admin.database.v1 - * @interface IListDatabaseRolesRequest - * @property {string|null} [parent] ListDatabaseRolesRequest parent - * @property {number|null} [pageSize] ListDatabaseRolesRequest pageSize - * @property {string|null} [pageToken] ListDatabaseRolesRequest pageToken - */ - - /** - * Constructs a new ListDatabaseRolesRequest. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents a ListDatabaseRolesRequest. - * @implements IListDatabaseRolesRequest - * @constructor - * @param {google.spanner.admin.database.v1.IListDatabaseRolesRequest=} [properties] Properties to set - */ - function ListDatabaseRolesRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListDatabaseRolesRequest parent. - * @member {string} parent - * @memberof google.spanner.admin.database.v1.ListDatabaseRolesRequest - * @instance - */ - ListDatabaseRolesRequest.prototype.parent = ""; - - /** - * ListDatabaseRolesRequest pageSize. - * @member {number} pageSize - * @memberof google.spanner.admin.database.v1.ListDatabaseRolesRequest - * @instance - */ - ListDatabaseRolesRequest.prototype.pageSize = 0; - - /** - * ListDatabaseRolesRequest pageToken. - * @member {string} pageToken - * @memberof google.spanner.admin.database.v1.ListDatabaseRolesRequest - * @instance - */ - ListDatabaseRolesRequest.prototype.pageToken = ""; - - /** - * Creates a new ListDatabaseRolesRequest instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.ListDatabaseRolesRequest - * @static - * @param {google.spanner.admin.database.v1.IListDatabaseRolesRequest=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.ListDatabaseRolesRequest} ListDatabaseRolesRequest instance - */ - ListDatabaseRolesRequest.create = function create(properties) { - return new ListDatabaseRolesRequest(properties); - }; - - /** - * Encodes the specified ListDatabaseRolesRequest message. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabaseRolesRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.ListDatabaseRolesRequest - * @static - * @param {google.spanner.admin.database.v1.IListDatabaseRolesRequest} message ListDatabaseRolesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListDatabaseRolesRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - return writer; - }; - - /** - * Encodes the specified ListDatabaseRolesRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabaseRolesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.ListDatabaseRolesRequest - * @static - * @param {google.spanner.admin.database.v1.IListDatabaseRolesRequest} message ListDatabaseRolesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListDatabaseRolesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListDatabaseRolesRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.ListDatabaseRolesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.ListDatabaseRolesRequest} ListDatabaseRolesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListDatabaseRolesRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.ListDatabaseRolesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListDatabaseRolesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.ListDatabaseRolesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.ListDatabaseRolesRequest} ListDatabaseRolesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListDatabaseRolesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListDatabaseRolesRequest message. - * @function verify - * @memberof google.spanner.admin.database.v1.ListDatabaseRolesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListDatabaseRolesRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - return null; - }; - - /** - * Creates a ListDatabaseRolesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.ListDatabaseRolesRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.ListDatabaseRolesRequest} ListDatabaseRolesRequest - */ - ListDatabaseRolesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.ListDatabaseRolesRequest) - return object; - var message = new $root.google.spanner.admin.database.v1.ListDatabaseRolesRequest(); - 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 ListDatabaseRolesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.ListDatabaseRolesRequest - * @static - * @param {google.spanner.admin.database.v1.ListDatabaseRolesRequest} message ListDatabaseRolesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListDatabaseRolesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - return object; - }; - - /** - * Converts this ListDatabaseRolesRequest to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.ListDatabaseRolesRequest - * @instance - * @returns {Object.} JSON object - */ - ListDatabaseRolesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListDatabaseRolesRequest - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.ListDatabaseRolesRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListDatabaseRolesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.ListDatabaseRolesRequest"; - }; - - return ListDatabaseRolesRequest; - })(); - - v1.ListDatabaseRolesResponse = (function() { - - /** - * Properties of a ListDatabaseRolesResponse. - * @memberof google.spanner.admin.database.v1 - * @interface IListDatabaseRolesResponse - * @property {Array.|null} [databaseRoles] ListDatabaseRolesResponse databaseRoles - * @property {string|null} [nextPageToken] ListDatabaseRolesResponse nextPageToken - */ - - /** - * Constructs a new ListDatabaseRolesResponse. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents a ListDatabaseRolesResponse. - * @implements IListDatabaseRolesResponse - * @constructor - * @param {google.spanner.admin.database.v1.IListDatabaseRolesResponse=} [properties] Properties to set - */ - function ListDatabaseRolesResponse(properties) { - this.databaseRoles = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListDatabaseRolesResponse databaseRoles. - * @member {Array.} databaseRoles - * @memberof google.spanner.admin.database.v1.ListDatabaseRolesResponse - * @instance - */ - ListDatabaseRolesResponse.prototype.databaseRoles = $util.emptyArray; - - /** - * ListDatabaseRolesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.spanner.admin.database.v1.ListDatabaseRolesResponse - * @instance - */ - ListDatabaseRolesResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListDatabaseRolesResponse instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.ListDatabaseRolesResponse - * @static - * @param {google.spanner.admin.database.v1.IListDatabaseRolesResponse=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.ListDatabaseRolesResponse} ListDatabaseRolesResponse instance - */ - ListDatabaseRolesResponse.create = function create(properties) { - return new ListDatabaseRolesResponse(properties); - }; - - /** - * Encodes the specified ListDatabaseRolesResponse message. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabaseRolesResponse.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.ListDatabaseRolesResponse - * @static - * @param {google.spanner.admin.database.v1.IListDatabaseRolesResponse} message ListDatabaseRolesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListDatabaseRolesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.databaseRoles != null && message.databaseRoles.length) - for (var i = 0; i < message.databaseRoles.length; ++i) - $root.google.spanner.admin.database.v1.DatabaseRole.encode(message.databaseRoles[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - return writer; - }; - - /** - * Encodes the specified ListDatabaseRolesResponse message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.ListDatabaseRolesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.ListDatabaseRolesResponse - * @static - * @param {google.spanner.admin.database.v1.IListDatabaseRolesResponse} message ListDatabaseRolesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListDatabaseRolesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListDatabaseRolesResponse message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.ListDatabaseRolesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.ListDatabaseRolesResponse} ListDatabaseRolesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListDatabaseRolesResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.ListDatabaseRolesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.databaseRoles && message.databaseRoles.length)) - message.databaseRoles = []; - message.databaseRoles.push($root.google.spanner.admin.database.v1.DatabaseRole.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListDatabaseRolesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.ListDatabaseRolesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.ListDatabaseRolesResponse} ListDatabaseRolesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListDatabaseRolesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListDatabaseRolesResponse message. - * @function verify - * @memberof google.spanner.admin.database.v1.ListDatabaseRolesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListDatabaseRolesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.databaseRoles != null && message.hasOwnProperty("databaseRoles")) { - if (!Array.isArray(message.databaseRoles)) - return "databaseRoles: array expected"; - for (var i = 0; i < message.databaseRoles.length; ++i) { - var error = $root.google.spanner.admin.database.v1.DatabaseRole.verify(message.databaseRoles[i]); - if (error) - return "databaseRoles." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListDatabaseRolesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.ListDatabaseRolesResponse - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.ListDatabaseRolesResponse} ListDatabaseRolesResponse - */ - ListDatabaseRolesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.ListDatabaseRolesResponse) - return object; - var message = new $root.google.spanner.admin.database.v1.ListDatabaseRolesResponse(); - if (object.databaseRoles) { - if (!Array.isArray(object.databaseRoles)) - throw TypeError(".google.spanner.admin.database.v1.ListDatabaseRolesResponse.databaseRoles: array expected"); - message.databaseRoles = []; - for (var i = 0; i < object.databaseRoles.length; ++i) { - if (typeof object.databaseRoles[i] !== "object") - throw TypeError(".google.spanner.admin.database.v1.ListDatabaseRolesResponse.databaseRoles: object expected"); - message.databaseRoles[i] = $root.google.spanner.admin.database.v1.DatabaseRole.fromObject(object.databaseRoles[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListDatabaseRolesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.ListDatabaseRolesResponse - * @static - * @param {google.spanner.admin.database.v1.ListDatabaseRolesResponse} message ListDatabaseRolesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListDatabaseRolesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.databaseRoles = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.databaseRoles && message.databaseRoles.length) { - object.databaseRoles = []; - for (var j = 0; j < message.databaseRoles.length; ++j) - object.databaseRoles[j] = $root.google.spanner.admin.database.v1.DatabaseRole.toObject(message.databaseRoles[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListDatabaseRolesResponse to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.ListDatabaseRolesResponse - * @instance - * @returns {Object.} JSON object - */ - ListDatabaseRolesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListDatabaseRolesResponse - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.ListDatabaseRolesResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListDatabaseRolesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.ListDatabaseRolesResponse"; - }; - - return ListDatabaseRolesResponse; - })(); - - v1.AddSplitPointsRequest = (function() { - - /** - * Properties of an AddSplitPointsRequest. - * @memberof google.spanner.admin.database.v1 - * @interface IAddSplitPointsRequest - * @property {string|null} [database] AddSplitPointsRequest database - * @property {Array.|null} [splitPoints] AddSplitPointsRequest splitPoints - * @property {string|null} [initiator] AddSplitPointsRequest initiator - */ - - /** - * Constructs a new AddSplitPointsRequest. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents an AddSplitPointsRequest. - * @implements IAddSplitPointsRequest - * @constructor - * @param {google.spanner.admin.database.v1.IAddSplitPointsRequest=} [properties] Properties to set - */ - function AddSplitPointsRequest(properties) { - this.splitPoints = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AddSplitPointsRequest database. - * @member {string} database - * @memberof google.spanner.admin.database.v1.AddSplitPointsRequest - * @instance - */ - AddSplitPointsRequest.prototype.database = ""; - - /** - * AddSplitPointsRequest splitPoints. - * @member {Array.} splitPoints - * @memberof google.spanner.admin.database.v1.AddSplitPointsRequest - * @instance - */ - AddSplitPointsRequest.prototype.splitPoints = $util.emptyArray; - - /** - * AddSplitPointsRequest initiator. - * @member {string} initiator - * @memberof google.spanner.admin.database.v1.AddSplitPointsRequest - * @instance - */ - AddSplitPointsRequest.prototype.initiator = ""; - - /** - * Creates a new AddSplitPointsRequest instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.AddSplitPointsRequest - * @static - * @param {google.spanner.admin.database.v1.IAddSplitPointsRequest=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.AddSplitPointsRequest} AddSplitPointsRequest instance - */ - AddSplitPointsRequest.create = function create(properties) { - return new AddSplitPointsRequest(properties); - }; - - /** - * Encodes the specified AddSplitPointsRequest message. Does not implicitly {@link google.spanner.admin.database.v1.AddSplitPointsRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.AddSplitPointsRequest - * @static - * @param {google.spanner.admin.database.v1.IAddSplitPointsRequest} message AddSplitPointsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AddSplitPointsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.database != null && Object.hasOwnProperty.call(message, "database")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.database); - if (message.splitPoints != null && message.splitPoints.length) - for (var i = 0; i < message.splitPoints.length; ++i) - $root.google.spanner.admin.database.v1.SplitPoints.encode(message.splitPoints[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.initiator != null && Object.hasOwnProperty.call(message, "initiator")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.initiator); - return writer; - }; - - /** - * Encodes the specified AddSplitPointsRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.AddSplitPointsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.AddSplitPointsRequest - * @static - * @param {google.spanner.admin.database.v1.IAddSplitPointsRequest} message AddSplitPointsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AddSplitPointsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AddSplitPointsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.AddSplitPointsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.AddSplitPointsRequest} AddSplitPointsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AddSplitPointsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.AddSplitPointsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.database = reader.string(); - break; - } - case 2: { - if (!(message.splitPoints && message.splitPoints.length)) - message.splitPoints = []; - message.splitPoints.push($root.google.spanner.admin.database.v1.SplitPoints.decode(reader, reader.uint32())); - break; - } - case 3: { - message.initiator = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AddSplitPointsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.AddSplitPointsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.AddSplitPointsRequest} AddSplitPointsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AddSplitPointsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AddSplitPointsRequest message. - * @function verify - * @memberof google.spanner.admin.database.v1.AddSplitPointsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AddSplitPointsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.database != null && message.hasOwnProperty("database")) - if (!$util.isString(message.database)) - return "database: string expected"; - if (message.splitPoints != null && message.hasOwnProperty("splitPoints")) { - if (!Array.isArray(message.splitPoints)) - return "splitPoints: array expected"; - for (var i = 0; i < message.splitPoints.length; ++i) { - var error = $root.google.spanner.admin.database.v1.SplitPoints.verify(message.splitPoints[i]); - if (error) - return "splitPoints." + error; - } - } - if (message.initiator != null && message.hasOwnProperty("initiator")) - if (!$util.isString(message.initiator)) - return "initiator: string expected"; - return null; - }; - - /** - * Creates an AddSplitPointsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.AddSplitPointsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.AddSplitPointsRequest} AddSplitPointsRequest - */ - AddSplitPointsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.AddSplitPointsRequest) - return object; - var message = new $root.google.spanner.admin.database.v1.AddSplitPointsRequest(); - if (object.database != null) - message.database = String(object.database); - if (object.splitPoints) { - if (!Array.isArray(object.splitPoints)) - throw TypeError(".google.spanner.admin.database.v1.AddSplitPointsRequest.splitPoints: array expected"); - message.splitPoints = []; - for (var i = 0; i < object.splitPoints.length; ++i) { - if (typeof object.splitPoints[i] !== "object") - throw TypeError(".google.spanner.admin.database.v1.AddSplitPointsRequest.splitPoints: object expected"); - message.splitPoints[i] = $root.google.spanner.admin.database.v1.SplitPoints.fromObject(object.splitPoints[i]); - } - } - if (object.initiator != null) - message.initiator = String(object.initiator); - return message; - }; - - /** - * Creates a plain object from an AddSplitPointsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.AddSplitPointsRequest - * @static - * @param {google.spanner.admin.database.v1.AddSplitPointsRequest} message AddSplitPointsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AddSplitPointsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.splitPoints = []; - if (options.defaults) { - object.database = ""; - object.initiator = ""; - } - if (message.database != null && message.hasOwnProperty("database")) - object.database = message.database; - if (message.splitPoints && message.splitPoints.length) { - object.splitPoints = []; - for (var j = 0; j < message.splitPoints.length; ++j) - object.splitPoints[j] = $root.google.spanner.admin.database.v1.SplitPoints.toObject(message.splitPoints[j], options); - } - if (message.initiator != null && message.hasOwnProperty("initiator")) - object.initiator = message.initiator; - return object; - }; - - /** - * Converts this AddSplitPointsRequest to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.AddSplitPointsRequest - * @instance - * @returns {Object.} JSON object - */ - AddSplitPointsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AddSplitPointsRequest - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.AddSplitPointsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AddSplitPointsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.AddSplitPointsRequest"; - }; - - return AddSplitPointsRequest; - })(); - - v1.AddSplitPointsResponse = (function() { - - /** - * Properties of an AddSplitPointsResponse. - * @memberof google.spanner.admin.database.v1 - * @interface IAddSplitPointsResponse - */ - - /** - * Constructs a new AddSplitPointsResponse. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents an AddSplitPointsResponse. - * @implements IAddSplitPointsResponse - * @constructor - * @param {google.spanner.admin.database.v1.IAddSplitPointsResponse=} [properties] Properties to set - */ - function AddSplitPointsResponse(properties) { - if (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 AddSplitPointsResponse instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.AddSplitPointsResponse - * @static - * @param {google.spanner.admin.database.v1.IAddSplitPointsResponse=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.AddSplitPointsResponse} AddSplitPointsResponse instance - */ - AddSplitPointsResponse.create = function create(properties) { - return new AddSplitPointsResponse(properties); - }; - - /** - * Encodes the specified AddSplitPointsResponse message. Does not implicitly {@link google.spanner.admin.database.v1.AddSplitPointsResponse.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.AddSplitPointsResponse - * @static - * @param {google.spanner.admin.database.v1.IAddSplitPointsResponse} message AddSplitPointsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AddSplitPointsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified AddSplitPointsResponse message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.AddSplitPointsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.AddSplitPointsResponse - * @static - * @param {google.spanner.admin.database.v1.IAddSplitPointsResponse} message AddSplitPointsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AddSplitPointsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AddSplitPointsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.AddSplitPointsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.AddSplitPointsResponse} AddSplitPointsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AddSplitPointsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.AddSplitPointsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AddSplitPointsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.AddSplitPointsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.AddSplitPointsResponse} AddSplitPointsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AddSplitPointsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AddSplitPointsResponse message. - * @function verify - * @memberof google.spanner.admin.database.v1.AddSplitPointsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AddSplitPointsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates an AddSplitPointsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.AddSplitPointsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.AddSplitPointsResponse} AddSplitPointsResponse - */ - AddSplitPointsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.AddSplitPointsResponse) - return object; - return new $root.google.spanner.admin.database.v1.AddSplitPointsResponse(); - }; - - /** - * Creates a plain object from an AddSplitPointsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.AddSplitPointsResponse - * @static - * @param {google.spanner.admin.database.v1.AddSplitPointsResponse} message AddSplitPointsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AddSplitPointsResponse.toObject = function toObject() { - return {}; - }; - - /** - * Converts this AddSplitPointsResponse to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.AddSplitPointsResponse - * @instance - * @returns {Object.} JSON object - */ - AddSplitPointsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AddSplitPointsResponse - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.AddSplitPointsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AddSplitPointsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.AddSplitPointsResponse"; - }; - - return AddSplitPointsResponse; - })(); - - v1.SplitPoints = (function() { - - /** - * Properties of a SplitPoints. - * @memberof google.spanner.admin.database.v1 - * @interface ISplitPoints - * @property {string|null} [table] SplitPoints table - * @property {string|null} [index] SplitPoints index - * @property {Array.|null} [keys] SplitPoints keys - * @property {google.protobuf.ITimestamp|null} [expireTime] SplitPoints expireTime - */ - - /** - * Constructs a new SplitPoints. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents a SplitPoints. - * @implements ISplitPoints - * @constructor - * @param {google.spanner.admin.database.v1.ISplitPoints=} [properties] Properties to set - */ - function SplitPoints(properties) { - this.keys = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SplitPoints table. - * @member {string} table - * @memberof google.spanner.admin.database.v1.SplitPoints - * @instance - */ - SplitPoints.prototype.table = ""; - - /** - * SplitPoints index. - * @member {string} index - * @memberof google.spanner.admin.database.v1.SplitPoints - * @instance - */ - SplitPoints.prototype.index = ""; - - /** - * SplitPoints keys. - * @member {Array.} keys - * @memberof google.spanner.admin.database.v1.SplitPoints - * @instance - */ - SplitPoints.prototype.keys = $util.emptyArray; - - /** - * SplitPoints expireTime. - * @member {google.protobuf.ITimestamp|null|undefined} expireTime - * @memberof google.spanner.admin.database.v1.SplitPoints - * @instance - */ - SplitPoints.prototype.expireTime = null; - - /** - * Creates a new SplitPoints instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.SplitPoints - * @static - * @param {google.spanner.admin.database.v1.ISplitPoints=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.SplitPoints} SplitPoints instance - */ - SplitPoints.create = function create(properties) { - return new SplitPoints(properties); - }; - - /** - * Encodes the specified SplitPoints message. Does not implicitly {@link google.spanner.admin.database.v1.SplitPoints.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.SplitPoints - * @static - * @param {google.spanner.admin.database.v1.ISplitPoints} message SplitPoints message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SplitPoints.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.table != null && Object.hasOwnProperty.call(message, "table")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.table); - if (message.index != null && Object.hasOwnProperty.call(message, "index")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.index); - if (message.keys != null && message.keys.length) - for (var i = 0; i < message.keys.length; ++i) - $root.google.spanner.admin.database.v1.SplitPoints.Key.encode(message.keys[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) - $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified SplitPoints message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.SplitPoints.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.SplitPoints - * @static - * @param {google.spanner.admin.database.v1.ISplitPoints} message SplitPoints message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SplitPoints.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SplitPoints message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.SplitPoints - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.SplitPoints} SplitPoints - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SplitPoints.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.SplitPoints(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.table = reader.string(); - break; - } - case 2: { - message.index = reader.string(); - break; - } - case 3: { - if (!(message.keys && message.keys.length)) - message.keys = []; - message.keys.push($root.google.spanner.admin.database.v1.SplitPoints.Key.decode(reader, reader.uint32())); - break; - } - case 5: { - message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SplitPoints message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.SplitPoints - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.SplitPoints} SplitPoints - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SplitPoints.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SplitPoints message. - * @function verify - * @memberof google.spanner.admin.database.v1.SplitPoints - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SplitPoints.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.table != null && message.hasOwnProperty("table")) - if (!$util.isString(message.table)) - return "table: string expected"; - if (message.index != null && message.hasOwnProperty("index")) - if (!$util.isString(message.index)) - return "index: string expected"; - if (message.keys != null && message.hasOwnProperty("keys")) { - if (!Array.isArray(message.keys)) - return "keys: array expected"; - for (var i = 0; i < message.keys.length; ++i) { - var error = $root.google.spanner.admin.database.v1.SplitPoints.Key.verify(message.keys[i]); - if (error) - return "keys." + error; - } - } - if (message.expireTime != null && message.hasOwnProperty("expireTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.expireTime); - if (error) - return "expireTime." + error; - } - return null; - }; - - /** - * Creates a SplitPoints message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.SplitPoints - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.SplitPoints} SplitPoints - */ - SplitPoints.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.SplitPoints) - return object; - var message = new $root.google.spanner.admin.database.v1.SplitPoints(); - if (object.table != null) - message.table = String(object.table); - if (object.index != null) - message.index = String(object.index); - if (object.keys) { - if (!Array.isArray(object.keys)) - throw TypeError(".google.spanner.admin.database.v1.SplitPoints.keys: array expected"); - message.keys = []; - for (var i = 0; i < object.keys.length; ++i) { - if (typeof object.keys[i] !== "object") - throw TypeError(".google.spanner.admin.database.v1.SplitPoints.keys: object expected"); - message.keys[i] = $root.google.spanner.admin.database.v1.SplitPoints.Key.fromObject(object.keys[i]); - } - } - if (object.expireTime != null) { - if (typeof object.expireTime !== "object") - throw TypeError(".google.spanner.admin.database.v1.SplitPoints.expireTime: object expected"); - message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); - } - return message; - }; - - /** - * Creates a plain object from a SplitPoints message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.SplitPoints - * @static - * @param {google.spanner.admin.database.v1.SplitPoints} message SplitPoints - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SplitPoints.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.keys = []; - if (options.defaults) { - object.table = ""; - object.index = ""; - object.expireTime = null; - } - if (message.table != null && message.hasOwnProperty("table")) - object.table = message.table; - if (message.index != null && message.hasOwnProperty("index")) - object.index = message.index; - if (message.keys && message.keys.length) { - object.keys = []; - for (var j = 0; j < message.keys.length; ++j) - object.keys[j] = $root.google.spanner.admin.database.v1.SplitPoints.Key.toObject(message.keys[j], options); - } - if (message.expireTime != null && message.hasOwnProperty("expireTime")) - object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); - return object; - }; - - /** - * Converts this SplitPoints to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.SplitPoints - * @instance - * @returns {Object.} JSON object - */ - SplitPoints.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SplitPoints - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.SplitPoints - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SplitPoints.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.SplitPoints"; - }; - - SplitPoints.Key = (function() { - - /** - * Properties of a Key. - * @memberof google.spanner.admin.database.v1.SplitPoints - * @interface IKey - * @property {google.protobuf.IListValue|null} [keyParts] Key keyParts - */ - - /** - * Constructs a new Key. - * @memberof google.spanner.admin.database.v1.SplitPoints - * @classdesc Represents a Key. - * @implements IKey - * @constructor - * @param {google.spanner.admin.database.v1.SplitPoints.IKey=} [properties] Properties to set - */ - function Key(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Key keyParts. - * @member {google.protobuf.IListValue|null|undefined} keyParts - * @memberof google.spanner.admin.database.v1.SplitPoints.Key - * @instance - */ - Key.prototype.keyParts = null; - - /** - * Creates a new Key instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.SplitPoints.Key - * @static - * @param {google.spanner.admin.database.v1.SplitPoints.IKey=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.SplitPoints.Key} Key instance - */ - Key.create = function create(properties) { - return new Key(properties); - }; - - /** - * Encodes the specified Key message. Does not implicitly {@link google.spanner.admin.database.v1.SplitPoints.Key.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.SplitPoints.Key - * @static - * @param {google.spanner.admin.database.v1.SplitPoints.IKey} message Key message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Key.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.keyParts != null && Object.hasOwnProperty.call(message, "keyParts")) - $root.google.protobuf.ListValue.encode(message.keyParts, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Key message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.SplitPoints.Key.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.SplitPoints.Key - * @static - * @param {google.spanner.admin.database.v1.SplitPoints.IKey} message Key message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Key.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Key message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.SplitPoints.Key - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.SplitPoints.Key} Key - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Key.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.SplitPoints.Key(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.keyParts = $root.google.protobuf.ListValue.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Key message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.SplitPoints.Key - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.SplitPoints.Key} Key - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Key.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Key message. - * @function verify - * @memberof google.spanner.admin.database.v1.SplitPoints.Key - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Key.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.keyParts != null && message.hasOwnProperty("keyParts")) { - var error = $root.google.protobuf.ListValue.verify(message.keyParts); - if (error) - return "keyParts." + error; - } - return null; - }; - - /** - * Creates a Key message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.SplitPoints.Key - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.SplitPoints.Key} Key - */ - Key.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.SplitPoints.Key) - return object; - var message = new $root.google.spanner.admin.database.v1.SplitPoints.Key(); - if (object.keyParts != null) { - if (typeof object.keyParts !== "object") - throw TypeError(".google.spanner.admin.database.v1.SplitPoints.Key.keyParts: object expected"); - message.keyParts = $root.google.protobuf.ListValue.fromObject(object.keyParts); - } - return message; - }; - - /** - * Creates a plain object from a Key message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.SplitPoints.Key - * @static - * @param {google.spanner.admin.database.v1.SplitPoints.Key} message Key - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Key.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.keyParts = null; - if (message.keyParts != null && message.hasOwnProperty("keyParts")) - object.keyParts = $root.google.protobuf.ListValue.toObject(message.keyParts, options); - return object; - }; - - /** - * Converts this Key to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.SplitPoints.Key - * @instance - * @returns {Object.} JSON object - */ - Key.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Key - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.SplitPoints.Key - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Key.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.SplitPoints.Key"; - }; - - return Key; - })(); - - return SplitPoints; - })(); - - v1.InternalUpdateGraphOperationRequest = (function() { - - /** - * Properties of an InternalUpdateGraphOperationRequest. - * @memberof google.spanner.admin.database.v1 - * @interface IInternalUpdateGraphOperationRequest - * @property {string|null} [database] InternalUpdateGraphOperationRequest database - * @property {string|null} [operationId] InternalUpdateGraphOperationRequest operationId - * @property {string|null} [vmIdentityToken] InternalUpdateGraphOperationRequest vmIdentityToken - * @property {number|null} [progress] InternalUpdateGraphOperationRequest progress - * @property {google.rpc.IStatus|null} [status] InternalUpdateGraphOperationRequest status - */ - - /** - * Constructs a new InternalUpdateGraphOperationRequest. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents an InternalUpdateGraphOperationRequest. - * @implements IInternalUpdateGraphOperationRequest - * @constructor - * @param {google.spanner.admin.database.v1.IInternalUpdateGraphOperationRequest=} [properties] Properties to set - */ - function InternalUpdateGraphOperationRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * InternalUpdateGraphOperationRequest database. - * @member {string} database - * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest - * @instance - */ - InternalUpdateGraphOperationRequest.prototype.database = ""; - - /** - * InternalUpdateGraphOperationRequest operationId. - * @member {string} operationId - * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest - * @instance - */ - InternalUpdateGraphOperationRequest.prototype.operationId = ""; - - /** - * InternalUpdateGraphOperationRequest vmIdentityToken. - * @member {string} vmIdentityToken - * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest - * @instance - */ - InternalUpdateGraphOperationRequest.prototype.vmIdentityToken = ""; - - /** - * InternalUpdateGraphOperationRequest progress. - * @member {number} progress - * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest - * @instance - */ - InternalUpdateGraphOperationRequest.prototype.progress = 0; - - /** - * InternalUpdateGraphOperationRequest status. - * @member {google.rpc.IStatus|null|undefined} status - * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest - * @instance - */ - InternalUpdateGraphOperationRequest.prototype.status = null; - - /** - * Creates a new InternalUpdateGraphOperationRequest instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest - * @static - * @param {google.spanner.admin.database.v1.IInternalUpdateGraphOperationRequest=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest} InternalUpdateGraphOperationRequest instance - */ - InternalUpdateGraphOperationRequest.create = function create(properties) { - return new InternalUpdateGraphOperationRequest(properties); - }; - - /** - * Encodes the specified InternalUpdateGraphOperationRequest message. Does not implicitly {@link google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest - * @static - * @param {google.spanner.admin.database.v1.IInternalUpdateGraphOperationRequest} message InternalUpdateGraphOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InternalUpdateGraphOperationRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.database != null && Object.hasOwnProperty.call(message, "database")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.database); - if (message.operationId != null && Object.hasOwnProperty.call(message, "operationId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.operationId); - if (message.progress != null && Object.hasOwnProperty.call(message, "progress")) - writer.uint32(/* id 3, wireType 1 =*/25).double(message.progress); - if (message.vmIdentityToken != null && Object.hasOwnProperty.call(message, "vmIdentityToken")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.vmIdentityToken); - if (message.status != null && Object.hasOwnProperty.call(message, "status")) - $root.google.rpc.Status.encode(message.status, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified InternalUpdateGraphOperationRequest message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest - * @static - * @param {google.spanner.admin.database.v1.IInternalUpdateGraphOperationRequest} message InternalUpdateGraphOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InternalUpdateGraphOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an InternalUpdateGraphOperationRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest} InternalUpdateGraphOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InternalUpdateGraphOperationRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.database = reader.string(); - break; - } - case 2: { - message.operationId = reader.string(); - break; - } - case 5: { - message.vmIdentityToken = reader.string(); - break; - } - case 3: { - message.progress = reader.double(); - break; - } - case 6: { - message.status = $root.google.rpc.Status.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an InternalUpdateGraphOperationRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest} InternalUpdateGraphOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InternalUpdateGraphOperationRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an InternalUpdateGraphOperationRequest message. - * @function verify - * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - InternalUpdateGraphOperationRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.database != null && message.hasOwnProperty("database")) - if (!$util.isString(message.database)) - return "database: string expected"; - if (message.operationId != null && message.hasOwnProperty("operationId")) - if (!$util.isString(message.operationId)) - return "operationId: string expected"; - if (message.vmIdentityToken != null && message.hasOwnProperty("vmIdentityToken")) - if (!$util.isString(message.vmIdentityToken)) - return "vmIdentityToken: string expected"; - if (message.progress != null && message.hasOwnProperty("progress")) - if (typeof message.progress !== "number") - return "progress: number expected"; - if (message.status != null && message.hasOwnProperty("status")) { - var error = $root.google.rpc.Status.verify(message.status); - if (error) - return "status." + error; - } - return null; - }; - - /** - * Creates an InternalUpdateGraphOperationRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest} InternalUpdateGraphOperationRequest - */ - InternalUpdateGraphOperationRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest) - return object; - var message = new $root.google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest(); - if (object.database != null) - message.database = String(object.database); - if (object.operationId != null) - message.operationId = String(object.operationId); - if (object.vmIdentityToken != null) - message.vmIdentityToken = String(object.vmIdentityToken); - if (object.progress != null) - message.progress = Number(object.progress); - if (object.status != null) { - if (typeof object.status !== "object") - throw TypeError(".google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest.status: object expected"); - message.status = $root.google.rpc.Status.fromObject(object.status); - } - return message; - }; - - /** - * Creates a plain object from an InternalUpdateGraphOperationRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest - * @static - * @param {google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest} message InternalUpdateGraphOperationRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - InternalUpdateGraphOperationRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.database = ""; - object.operationId = ""; - object.progress = 0; - object.vmIdentityToken = ""; - object.status = null; - } - if (message.database != null && message.hasOwnProperty("database")) - object.database = message.database; - if (message.operationId != null && message.hasOwnProperty("operationId")) - object.operationId = message.operationId; - if (message.progress != null && message.hasOwnProperty("progress")) - object.progress = options.json && !isFinite(message.progress) ? String(message.progress) : message.progress; - if (message.vmIdentityToken != null && message.hasOwnProperty("vmIdentityToken")) - object.vmIdentityToken = message.vmIdentityToken; - if (message.status != null && message.hasOwnProperty("status")) - object.status = $root.google.rpc.Status.toObject(message.status, options); - return object; - }; - - /** - * Converts this InternalUpdateGraphOperationRequest to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest - * @instance - * @returns {Object.} JSON object - */ - InternalUpdateGraphOperationRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for InternalUpdateGraphOperationRequest - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - InternalUpdateGraphOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest"; - }; - - return InternalUpdateGraphOperationRequest; - })(); - - v1.InternalUpdateGraphOperationResponse = (function() { - - /** - * Properties of an InternalUpdateGraphOperationResponse. - * @memberof google.spanner.admin.database.v1 - * @interface IInternalUpdateGraphOperationResponse - */ - - /** - * Constructs a new InternalUpdateGraphOperationResponse. - * @memberof google.spanner.admin.database.v1 - * @classdesc Represents an InternalUpdateGraphOperationResponse. - * @implements IInternalUpdateGraphOperationResponse - * @constructor - * @param {google.spanner.admin.database.v1.IInternalUpdateGraphOperationResponse=} [properties] Properties to set - */ - function InternalUpdateGraphOperationResponse(properties) { - if (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 InternalUpdateGraphOperationResponse instance using the specified properties. - * @function create - * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse - * @static - * @param {google.spanner.admin.database.v1.IInternalUpdateGraphOperationResponse=} [properties] Properties to set - * @returns {google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse} InternalUpdateGraphOperationResponse instance - */ - InternalUpdateGraphOperationResponse.create = function create(properties) { - return new InternalUpdateGraphOperationResponse(properties); - }; - - /** - * Encodes the specified InternalUpdateGraphOperationResponse message. Does not implicitly {@link google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse - * @static - * @param {google.spanner.admin.database.v1.IInternalUpdateGraphOperationResponse} message InternalUpdateGraphOperationResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InternalUpdateGraphOperationResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified InternalUpdateGraphOperationResponse message, length delimited. Does not implicitly {@link google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse - * @static - * @param {google.spanner.admin.database.v1.IInternalUpdateGraphOperationResponse} message InternalUpdateGraphOperationResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InternalUpdateGraphOperationResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an InternalUpdateGraphOperationResponse message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse} InternalUpdateGraphOperationResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InternalUpdateGraphOperationResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an InternalUpdateGraphOperationResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse} InternalUpdateGraphOperationResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InternalUpdateGraphOperationResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an InternalUpdateGraphOperationResponse message. - * @function verify - * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - InternalUpdateGraphOperationResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates an InternalUpdateGraphOperationResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse} InternalUpdateGraphOperationResponse - */ - InternalUpdateGraphOperationResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse) - return object; - return new $root.google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse(); - }; - - /** - * Creates a plain object from an InternalUpdateGraphOperationResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse - * @static - * @param {google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse} message InternalUpdateGraphOperationResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - InternalUpdateGraphOperationResponse.toObject = function toObject() { - return {}; - }; - - /** - * Converts this InternalUpdateGraphOperationResponse to JSON. - * @function toJSON - * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse - * @instance - * @returns {Object.} JSON object - */ - InternalUpdateGraphOperationResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for InternalUpdateGraphOperationResponse - * @function getTypeUrl - * @memberof google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - InternalUpdateGraphOperationResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse"; - }; - - return InternalUpdateGraphOperationResponse; - })(); - - return v1; - })(); - - return database; - })(); - - admin.instance = (function() { - - /** - * Namespace instance. - * @memberof google.spanner.admin - * @namespace - */ - var instance = {}; - - instance.v1 = (function() { - - /** - * Namespace v1. - * @memberof google.spanner.admin.instance - * @namespace - */ - var v1 = {}; - - v1.OperationProgress = (function() { - - /** - * Properties of an OperationProgress. - * @memberof google.spanner.admin.instance.v1 - * @interface IOperationProgress - * @property {number|null} [progressPercent] OperationProgress progressPercent - * @property {google.protobuf.ITimestamp|null} [startTime] OperationProgress startTime - * @property {google.protobuf.ITimestamp|null} [endTime] OperationProgress endTime - */ - - /** - * Constructs a new OperationProgress. - * @memberof google.spanner.admin.instance.v1 - * @classdesc Represents an OperationProgress. - * @implements IOperationProgress - * @constructor - * @param {google.spanner.admin.instance.v1.IOperationProgress=} [properties] Properties to set - */ - function OperationProgress(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * OperationProgress progressPercent. - * @member {number} progressPercent - * @memberof google.spanner.admin.instance.v1.OperationProgress - * @instance - */ - OperationProgress.prototype.progressPercent = 0; - - /** - * OperationProgress startTime. - * @member {google.protobuf.ITimestamp|null|undefined} startTime - * @memberof google.spanner.admin.instance.v1.OperationProgress - * @instance - */ - OperationProgress.prototype.startTime = null; - - /** - * OperationProgress endTime. - * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.spanner.admin.instance.v1.OperationProgress - * @instance - */ - OperationProgress.prototype.endTime = null; - - /** - * Creates a new OperationProgress instance using the specified properties. - * @function create - * @memberof google.spanner.admin.instance.v1.OperationProgress - * @static - * @param {google.spanner.admin.instance.v1.IOperationProgress=} [properties] Properties to set - * @returns {google.spanner.admin.instance.v1.OperationProgress} OperationProgress instance - */ - OperationProgress.create = function create(properties) { - return new OperationProgress(properties); - }; - - /** - * Encodes the specified OperationProgress message. Does not implicitly {@link google.spanner.admin.instance.v1.OperationProgress.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.instance.v1.OperationProgress - * @static - * @param {google.spanner.admin.instance.v1.IOperationProgress} message OperationProgress message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OperationProgress.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.progressPercent != null && Object.hasOwnProperty.call(message, "progressPercent")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.progressPercent); - if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) - $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) - $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified OperationProgress message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.OperationProgress.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.instance.v1.OperationProgress - * @static - * @param {google.spanner.admin.instance.v1.IOperationProgress} message OperationProgress message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OperationProgress.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OperationProgress message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.instance.v1.OperationProgress - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.instance.v1.OperationProgress} OperationProgress - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OperationProgress.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.OperationProgress(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.progressPercent = reader.int32(); - break; - } - case 2: { - message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 3: { - message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OperationProgress message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.instance.v1.OperationProgress - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.instance.v1.OperationProgress} OperationProgress - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OperationProgress.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OperationProgress message. - * @function verify - * @memberof google.spanner.admin.instance.v1.OperationProgress - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OperationProgress.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.progressPercent != null && message.hasOwnProperty("progressPercent")) - if (!$util.isInteger(message.progressPercent)) - return "progressPercent: integer expected"; - if (message.startTime != null && message.hasOwnProperty("startTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.startTime); - if (error) - return "startTime." + error; - } - if (message.endTime != null && message.hasOwnProperty("endTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.endTime); - if (error) - return "endTime." + error; - } - return null; - }; - - /** - * Creates an OperationProgress message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.instance.v1.OperationProgress - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.instance.v1.OperationProgress} OperationProgress - */ - OperationProgress.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.instance.v1.OperationProgress) - return object; - var message = new $root.google.spanner.admin.instance.v1.OperationProgress(); - if (object.progressPercent != null) - message.progressPercent = object.progressPercent | 0; - if (object.startTime != null) { - if (typeof object.startTime !== "object") - throw TypeError(".google.spanner.admin.instance.v1.OperationProgress.startTime: object expected"); - message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); - } - if (object.endTime != null) { - if (typeof object.endTime !== "object") - throw TypeError(".google.spanner.admin.instance.v1.OperationProgress.endTime: object expected"); - message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); - } - return message; - }; - - /** - * Creates a plain object from an OperationProgress message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.instance.v1.OperationProgress - * @static - * @param {google.spanner.admin.instance.v1.OperationProgress} message OperationProgress - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OperationProgress.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.progressPercent = 0; - object.startTime = null; - object.endTime = null; - } - if (message.progressPercent != null && message.hasOwnProperty("progressPercent")) - object.progressPercent = message.progressPercent; - if (message.startTime != null && message.hasOwnProperty("startTime")) - object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); - if (message.endTime != null && message.hasOwnProperty("endTime")) - object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); - return object; - }; - - /** - * Converts this OperationProgress to JSON. - * @function toJSON - * @memberof google.spanner.admin.instance.v1.OperationProgress - * @instance - * @returns {Object.} JSON object - */ - OperationProgress.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OperationProgress - * @function getTypeUrl - * @memberof google.spanner.admin.instance.v1.OperationProgress - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OperationProgress.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.instance.v1.OperationProgress"; - }; - - return OperationProgress; - })(); - - /** - * FulfillmentPeriod enum. - * @name google.spanner.admin.instance.v1.FulfillmentPeriod - * @enum {number} - * @property {number} FULFILLMENT_PERIOD_UNSPECIFIED=0 FULFILLMENT_PERIOD_UNSPECIFIED value - * @property {number} FULFILLMENT_PERIOD_NORMAL=1 FULFILLMENT_PERIOD_NORMAL value - * @property {number} FULFILLMENT_PERIOD_EXTENDED=2 FULFILLMENT_PERIOD_EXTENDED value - */ - v1.FulfillmentPeriod = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "FULFILLMENT_PERIOD_UNSPECIFIED"] = 0; - values[valuesById[1] = "FULFILLMENT_PERIOD_NORMAL"] = 1; - values[valuesById[2] = "FULFILLMENT_PERIOD_EXTENDED"] = 2; - return values; - })(); - - v1.ReplicaSelection = (function() { - - /** - * Properties of a ReplicaSelection. - * @memberof google.spanner.admin.instance.v1 - * @interface IReplicaSelection - * @property {string|null} [location] ReplicaSelection location - */ - - /** - * Constructs a new ReplicaSelection. - * @memberof google.spanner.admin.instance.v1 - * @classdesc Represents a ReplicaSelection. - * @implements IReplicaSelection - * @constructor - * @param {google.spanner.admin.instance.v1.IReplicaSelection=} [properties] Properties to set - */ - function ReplicaSelection(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ReplicaSelection location. - * @member {string} location - * @memberof google.spanner.admin.instance.v1.ReplicaSelection - * @instance - */ - ReplicaSelection.prototype.location = ""; - - /** - * Creates a new ReplicaSelection instance using the specified properties. - * @function create - * @memberof google.spanner.admin.instance.v1.ReplicaSelection - * @static - * @param {google.spanner.admin.instance.v1.IReplicaSelection=} [properties] Properties to set - * @returns {google.spanner.admin.instance.v1.ReplicaSelection} ReplicaSelection instance - */ - ReplicaSelection.create = function create(properties) { - return new ReplicaSelection(properties); - }; - - /** - * Encodes the specified ReplicaSelection message. Does not implicitly {@link google.spanner.admin.instance.v1.ReplicaSelection.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.instance.v1.ReplicaSelection - * @static - * @param {google.spanner.admin.instance.v1.IReplicaSelection} message ReplicaSelection message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReplicaSelection.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.location != null && Object.hasOwnProperty.call(message, "location")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.location); - return writer; - }; - - /** - * Encodes the specified ReplicaSelection message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ReplicaSelection.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.instance.v1.ReplicaSelection - * @static - * @param {google.spanner.admin.instance.v1.IReplicaSelection} message ReplicaSelection message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReplicaSelection.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ReplicaSelection message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.instance.v1.ReplicaSelection - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.instance.v1.ReplicaSelection} ReplicaSelection - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReplicaSelection.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.ReplicaSelection(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.location = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ReplicaSelection message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.instance.v1.ReplicaSelection - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.instance.v1.ReplicaSelection} ReplicaSelection - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReplicaSelection.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ReplicaSelection message. - * @function verify - * @memberof google.spanner.admin.instance.v1.ReplicaSelection - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ReplicaSelection.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.location != null && message.hasOwnProperty("location")) - if (!$util.isString(message.location)) - return "location: string expected"; - return null; - }; - - /** - * Creates a ReplicaSelection message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.instance.v1.ReplicaSelection - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.instance.v1.ReplicaSelection} ReplicaSelection - */ - ReplicaSelection.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.instance.v1.ReplicaSelection) - return object; - var message = new $root.google.spanner.admin.instance.v1.ReplicaSelection(); - if (object.location != null) - message.location = String(object.location); - return message; - }; - - /** - * Creates a plain object from a ReplicaSelection message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.instance.v1.ReplicaSelection - * @static - * @param {google.spanner.admin.instance.v1.ReplicaSelection} message ReplicaSelection - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ReplicaSelection.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.location = ""; - if (message.location != null && message.hasOwnProperty("location")) - object.location = message.location; - return object; - }; - - /** - * Converts this ReplicaSelection to JSON. - * @function toJSON - * @memberof google.spanner.admin.instance.v1.ReplicaSelection - * @instance - * @returns {Object.} JSON object - */ - ReplicaSelection.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ReplicaSelection - * @function getTypeUrl - * @memberof google.spanner.admin.instance.v1.ReplicaSelection - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ReplicaSelection.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.instance.v1.ReplicaSelection"; - }; - - return ReplicaSelection; - })(); - - v1.InstanceAdmin = (function() { - - /** - * Constructs a new InstanceAdmin service. - * @memberof google.spanner.admin.instance.v1 - * @classdesc Represents an InstanceAdmin - * @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 InstanceAdmin(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (InstanceAdmin.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = InstanceAdmin; - - /** - * Creates new InstanceAdmin service using the specified rpc implementation. - * @function create - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @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 {InstanceAdmin} RPC service. Useful where requests and/or responses are streamed. - */ - InstanceAdmin.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|listInstanceConfigs}. - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @typedef ListInstanceConfigsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.spanner.admin.instance.v1.ListInstanceConfigsResponse} [response] ListInstanceConfigsResponse - */ - - /** - * Calls ListInstanceConfigs. - * @function listInstanceConfigs - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @instance - * @param {google.spanner.admin.instance.v1.IListInstanceConfigsRequest} request ListInstanceConfigsRequest message or plain object - * @param {google.spanner.admin.instance.v1.InstanceAdmin.ListInstanceConfigsCallback} callback Node-style callback called with the error, if any, and ListInstanceConfigsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(InstanceAdmin.prototype.listInstanceConfigs = function listInstanceConfigs(request, callback) { - return this.rpcCall(listInstanceConfigs, $root.google.spanner.admin.instance.v1.ListInstanceConfigsRequest, $root.google.spanner.admin.instance.v1.ListInstanceConfigsResponse, request, callback); - }, "name", { value: "ListInstanceConfigs" }); - - /** - * Calls ListInstanceConfigs. - * @function listInstanceConfigs - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @instance - * @param {google.spanner.admin.instance.v1.IListInstanceConfigsRequest} request ListInstanceConfigsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|getInstanceConfig}. - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @typedef GetInstanceConfigCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.spanner.admin.instance.v1.InstanceConfig} [response] InstanceConfig - */ - - /** - * Calls GetInstanceConfig. - * @function getInstanceConfig - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @instance - * @param {google.spanner.admin.instance.v1.IGetInstanceConfigRequest} request GetInstanceConfigRequest message or plain object - * @param {google.spanner.admin.instance.v1.InstanceAdmin.GetInstanceConfigCallback} callback Node-style callback called with the error, if any, and InstanceConfig - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(InstanceAdmin.prototype.getInstanceConfig = function getInstanceConfig(request, callback) { - return this.rpcCall(getInstanceConfig, $root.google.spanner.admin.instance.v1.GetInstanceConfigRequest, $root.google.spanner.admin.instance.v1.InstanceConfig, request, callback); - }, "name", { value: "GetInstanceConfig" }); - - /** - * Calls GetInstanceConfig. - * @function getInstanceConfig - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @instance - * @param {google.spanner.admin.instance.v1.IGetInstanceConfigRequest} request GetInstanceConfigRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|createInstanceConfig}. - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @typedef CreateInstanceConfigCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls CreateInstanceConfig. - * @function createInstanceConfig - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @instance - * @param {google.spanner.admin.instance.v1.ICreateInstanceConfigRequest} request CreateInstanceConfigRequest message or plain object - * @param {google.spanner.admin.instance.v1.InstanceAdmin.CreateInstanceConfigCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(InstanceAdmin.prototype.createInstanceConfig = function createInstanceConfig(request, callback) { - return this.rpcCall(createInstanceConfig, $root.google.spanner.admin.instance.v1.CreateInstanceConfigRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "CreateInstanceConfig" }); - - /** - * Calls CreateInstanceConfig. - * @function createInstanceConfig - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @instance - * @param {google.spanner.admin.instance.v1.ICreateInstanceConfigRequest} request CreateInstanceConfigRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|updateInstanceConfig}. - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @typedef UpdateInstanceConfigCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls UpdateInstanceConfig. - * @function updateInstanceConfig - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @instance - * @param {google.spanner.admin.instance.v1.IUpdateInstanceConfigRequest} request UpdateInstanceConfigRequest message or plain object - * @param {google.spanner.admin.instance.v1.InstanceAdmin.UpdateInstanceConfigCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(InstanceAdmin.prototype.updateInstanceConfig = function updateInstanceConfig(request, callback) { - return this.rpcCall(updateInstanceConfig, $root.google.spanner.admin.instance.v1.UpdateInstanceConfigRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "UpdateInstanceConfig" }); - - /** - * Calls UpdateInstanceConfig. - * @function updateInstanceConfig - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @instance - * @param {google.spanner.admin.instance.v1.IUpdateInstanceConfigRequest} request UpdateInstanceConfigRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|deleteInstanceConfig}. - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @typedef DeleteInstanceConfigCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteInstanceConfig. - * @function deleteInstanceConfig - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @instance - * @param {google.spanner.admin.instance.v1.IDeleteInstanceConfigRequest} request DeleteInstanceConfigRequest message or plain object - * @param {google.spanner.admin.instance.v1.InstanceAdmin.DeleteInstanceConfigCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(InstanceAdmin.prototype.deleteInstanceConfig = function deleteInstanceConfig(request, callback) { - return this.rpcCall(deleteInstanceConfig, $root.google.spanner.admin.instance.v1.DeleteInstanceConfigRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteInstanceConfig" }); - - /** - * Calls DeleteInstanceConfig. - * @function deleteInstanceConfig - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @instance - * @param {google.spanner.admin.instance.v1.IDeleteInstanceConfigRequest} request DeleteInstanceConfigRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|listInstanceConfigOperations}. - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @typedef ListInstanceConfigOperationsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse} [response] ListInstanceConfigOperationsResponse - */ - - /** - * Calls ListInstanceConfigOperations. - * @function listInstanceConfigOperations - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @instance - * @param {google.spanner.admin.instance.v1.IListInstanceConfigOperationsRequest} request ListInstanceConfigOperationsRequest message or plain object - * @param {google.spanner.admin.instance.v1.InstanceAdmin.ListInstanceConfigOperationsCallback} callback Node-style callback called with the error, if any, and ListInstanceConfigOperationsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(InstanceAdmin.prototype.listInstanceConfigOperations = function listInstanceConfigOperations(request, callback) { - return this.rpcCall(listInstanceConfigOperations, $root.google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest, $root.google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse, request, callback); - }, "name", { value: "ListInstanceConfigOperations" }); - - /** - * Calls ListInstanceConfigOperations. - * @function listInstanceConfigOperations - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @instance - * @param {google.spanner.admin.instance.v1.IListInstanceConfigOperationsRequest} request ListInstanceConfigOperationsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|listInstances}. - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @typedef ListInstancesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.spanner.admin.instance.v1.ListInstancesResponse} [response] ListInstancesResponse - */ - - /** - * Calls ListInstances. - * @function listInstances - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @instance - * @param {google.spanner.admin.instance.v1.IListInstancesRequest} request ListInstancesRequest message or plain object - * @param {google.spanner.admin.instance.v1.InstanceAdmin.ListInstancesCallback} callback Node-style callback called with the error, if any, and ListInstancesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(InstanceAdmin.prototype.listInstances = function listInstances(request, callback) { - return this.rpcCall(listInstances, $root.google.spanner.admin.instance.v1.ListInstancesRequest, $root.google.spanner.admin.instance.v1.ListInstancesResponse, request, callback); - }, "name", { value: "ListInstances" }); - - /** - * Calls ListInstances. - * @function listInstances - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @instance - * @param {google.spanner.admin.instance.v1.IListInstancesRequest} request ListInstancesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|listInstancePartitions}. - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @typedef ListInstancePartitionsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.spanner.admin.instance.v1.ListInstancePartitionsResponse} [response] ListInstancePartitionsResponse - */ - - /** - * Calls ListInstancePartitions. - * @function listInstancePartitions - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @instance - * @param {google.spanner.admin.instance.v1.IListInstancePartitionsRequest} request ListInstancePartitionsRequest message or plain object - * @param {google.spanner.admin.instance.v1.InstanceAdmin.ListInstancePartitionsCallback} callback Node-style callback called with the error, if any, and ListInstancePartitionsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(InstanceAdmin.prototype.listInstancePartitions = function listInstancePartitions(request, callback) { - return this.rpcCall(listInstancePartitions, $root.google.spanner.admin.instance.v1.ListInstancePartitionsRequest, $root.google.spanner.admin.instance.v1.ListInstancePartitionsResponse, request, callback); - }, "name", { value: "ListInstancePartitions" }); - - /** - * Calls ListInstancePartitions. - * @function listInstancePartitions - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @instance - * @param {google.spanner.admin.instance.v1.IListInstancePartitionsRequest} request ListInstancePartitionsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|getInstance}. - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @typedef GetInstanceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.spanner.admin.instance.v1.Instance} [response] Instance - */ - - /** - * Calls GetInstance. - * @function getInstance - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @instance - * @param {google.spanner.admin.instance.v1.IGetInstanceRequest} request GetInstanceRequest message or plain object - * @param {google.spanner.admin.instance.v1.InstanceAdmin.GetInstanceCallback} callback Node-style callback called with the error, if any, and Instance - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(InstanceAdmin.prototype.getInstance = function getInstance(request, callback) { - return this.rpcCall(getInstance, $root.google.spanner.admin.instance.v1.GetInstanceRequest, $root.google.spanner.admin.instance.v1.Instance, request, callback); - }, "name", { value: "GetInstance" }); - - /** - * Calls GetInstance. - * @function getInstance - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @instance - * @param {google.spanner.admin.instance.v1.IGetInstanceRequest} request GetInstanceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|createInstance}. - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @typedef CreateInstanceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls CreateInstance. - * @function createInstance - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @instance - * @param {google.spanner.admin.instance.v1.ICreateInstanceRequest} request CreateInstanceRequest message or plain object - * @param {google.spanner.admin.instance.v1.InstanceAdmin.CreateInstanceCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(InstanceAdmin.prototype.createInstance = function createInstance(request, callback) { - return this.rpcCall(createInstance, $root.google.spanner.admin.instance.v1.CreateInstanceRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "CreateInstance" }); - - /** - * Calls CreateInstance. - * @function createInstance - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @instance - * @param {google.spanner.admin.instance.v1.ICreateInstanceRequest} request CreateInstanceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|updateInstance}. - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @typedef UpdateInstanceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls UpdateInstance. - * @function updateInstance - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @instance - * @param {google.spanner.admin.instance.v1.IUpdateInstanceRequest} request UpdateInstanceRequest message or plain object - * @param {google.spanner.admin.instance.v1.InstanceAdmin.UpdateInstanceCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(InstanceAdmin.prototype.updateInstance = function updateInstance(request, callback) { - return this.rpcCall(updateInstance, $root.google.spanner.admin.instance.v1.UpdateInstanceRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "UpdateInstance" }); - - /** - * Calls UpdateInstance. - * @function updateInstance - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @instance - * @param {google.spanner.admin.instance.v1.IUpdateInstanceRequest} request UpdateInstanceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|deleteInstance}. - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @typedef DeleteInstanceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteInstance. - * @function deleteInstance - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @instance - * @param {google.spanner.admin.instance.v1.IDeleteInstanceRequest} request DeleteInstanceRequest message or plain object - * @param {google.spanner.admin.instance.v1.InstanceAdmin.DeleteInstanceCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(InstanceAdmin.prototype.deleteInstance = function deleteInstance(request, callback) { - return this.rpcCall(deleteInstance, $root.google.spanner.admin.instance.v1.DeleteInstanceRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteInstance" }); - - /** - * Calls DeleteInstance. - * @function deleteInstance - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @instance - * @param {google.spanner.admin.instance.v1.IDeleteInstanceRequest} request DeleteInstanceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|setIamPolicy}. - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @typedef SetIamPolicyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.iam.v1.Policy} [response] Policy - */ - - /** - * Calls SetIamPolicy. - * @function setIamPolicy - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @instance - * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object - * @param {google.spanner.admin.instance.v1.InstanceAdmin.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(InstanceAdmin.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.spanner.admin.instance.v1.InstanceAdmin - * @instance - * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|getIamPolicy}. - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @typedef GetIamPolicyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.iam.v1.Policy} [response] Policy - */ - - /** - * Calls GetIamPolicy. - * @function getIamPolicy - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @instance - * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object - * @param {google.spanner.admin.instance.v1.InstanceAdmin.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(InstanceAdmin.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.spanner.admin.instance.v1.InstanceAdmin - * @instance - * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|testIamPermissions}. - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @typedef TestIamPermissionsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.iam.v1.TestIamPermissionsResponse} [response] TestIamPermissionsResponse - */ - - /** - * Calls TestIamPermissions. - * @function testIamPermissions - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @instance - * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object - * @param {google.spanner.admin.instance.v1.InstanceAdmin.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestIamPermissionsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(InstanceAdmin.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.spanner.admin.instance.v1.InstanceAdmin - * @instance - * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|getInstancePartition}. - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @typedef GetInstancePartitionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.spanner.admin.instance.v1.InstancePartition} [response] InstancePartition - */ - - /** - * Calls GetInstancePartition. - * @function getInstancePartition - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @instance - * @param {google.spanner.admin.instance.v1.IGetInstancePartitionRequest} request GetInstancePartitionRequest message or plain object - * @param {google.spanner.admin.instance.v1.InstanceAdmin.GetInstancePartitionCallback} callback Node-style callback called with the error, if any, and InstancePartition - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(InstanceAdmin.prototype.getInstancePartition = function getInstancePartition(request, callback) { - return this.rpcCall(getInstancePartition, $root.google.spanner.admin.instance.v1.GetInstancePartitionRequest, $root.google.spanner.admin.instance.v1.InstancePartition, request, callback); - }, "name", { value: "GetInstancePartition" }); - - /** - * Calls GetInstancePartition. - * @function getInstancePartition - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @instance - * @param {google.spanner.admin.instance.v1.IGetInstancePartitionRequest} request GetInstancePartitionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|createInstancePartition}. - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @typedef CreateInstancePartitionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls CreateInstancePartition. - * @function createInstancePartition - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @instance - * @param {google.spanner.admin.instance.v1.ICreateInstancePartitionRequest} request CreateInstancePartitionRequest message or plain object - * @param {google.spanner.admin.instance.v1.InstanceAdmin.CreateInstancePartitionCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(InstanceAdmin.prototype.createInstancePartition = function createInstancePartition(request, callback) { - return this.rpcCall(createInstancePartition, $root.google.spanner.admin.instance.v1.CreateInstancePartitionRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "CreateInstancePartition" }); - - /** - * Calls CreateInstancePartition. - * @function createInstancePartition - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @instance - * @param {google.spanner.admin.instance.v1.ICreateInstancePartitionRequest} request CreateInstancePartitionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|deleteInstancePartition}. - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @typedef DeleteInstancePartitionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteInstancePartition. - * @function deleteInstancePartition - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @instance - * @param {google.spanner.admin.instance.v1.IDeleteInstancePartitionRequest} request DeleteInstancePartitionRequest message or plain object - * @param {google.spanner.admin.instance.v1.InstanceAdmin.DeleteInstancePartitionCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(InstanceAdmin.prototype.deleteInstancePartition = function deleteInstancePartition(request, callback) { - return this.rpcCall(deleteInstancePartition, $root.google.spanner.admin.instance.v1.DeleteInstancePartitionRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteInstancePartition" }); - - /** - * Calls DeleteInstancePartition. - * @function deleteInstancePartition - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @instance - * @param {google.spanner.admin.instance.v1.IDeleteInstancePartitionRequest} request DeleteInstancePartitionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|updateInstancePartition}. - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @typedef UpdateInstancePartitionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls UpdateInstancePartition. - * @function updateInstancePartition - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @instance - * @param {google.spanner.admin.instance.v1.IUpdateInstancePartitionRequest} request UpdateInstancePartitionRequest message or plain object - * @param {google.spanner.admin.instance.v1.InstanceAdmin.UpdateInstancePartitionCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(InstanceAdmin.prototype.updateInstancePartition = function updateInstancePartition(request, callback) { - return this.rpcCall(updateInstancePartition, $root.google.spanner.admin.instance.v1.UpdateInstancePartitionRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "UpdateInstancePartition" }); - - /** - * Calls UpdateInstancePartition. - * @function updateInstancePartition - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @instance - * @param {google.spanner.admin.instance.v1.IUpdateInstancePartitionRequest} request UpdateInstancePartitionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|listInstancePartitionOperations}. - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @typedef ListInstancePartitionOperationsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse} [response] ListInstancePartitionOperationsResponse - */ - - /** - * Calls ListInstancePartitionOperations. - * @function listInstancePartitionOperations - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @instance - * @param {google.spanner.admin.instance.v1.IListInstancePartitionOperationsRequest} request ListInstancePartitionOperationsRequest message or plain object - * @param {google.spanner.admin.instance.v1.InstanceAdmin.ListInstancePartitionOperationsCallback} callback Node-style callback called with the error, if any, and ListInstancePartitionOperationsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(InstanceAdmin.prototype.listInstancePartitionOperations = function listInstancePartitionOperations(request, callback) { - return this.rpcCall(listInstancePartitionOperations, $root.google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest, $root.google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse, request, callback); - }, "name", { value: "ListInstancePartitionOperations" }); - - /** - * Calls ListInstancePartitionOperations. - * @function listInstancePartitionOperations - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @instance - * @param {google.spanner.admin.instance.v1.IListInstancePartitionOperationsRequest} request ListInstancePartitionOperationsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.admin.instance.v1.InstanceAdmin|moveInstance}. - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @typedef MoveInstanceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls MoveInstance. - * @function moveInstance - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @instance - * @param {google.spanner.admin.instance.v1.IMoveInstanceRequest} request MoveInstanceRequest message or plain object - * @param {google.spanner.admin.instance.v1.InstanceAdmin.MoveInstanceCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(InstanceAdmin.prototype.moveInstance = function moveInstance(request, callback) { - return this.rpcCall(moveInstance, $root.google.spanner.admin.instance.v1.MoveInstanceRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "MoveInstance" }); - - /** - * Calls MoveInstance. - * @function moveInstance - * @memberof google.spanner.admin.instance.v1.InstanceAdmin - * @instance - * @param {google.spanner.admin.instance.v1.IMoveInstanceRequest} request MoveInstanceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return InstanceAdmin; - })(); - - v1.ReplicaInfo = (function() { - - /** - * Properties of a ReplicaInfo. - * @memberof google.spanner.admin.instance.v1 - * @interface IReplicaInfo - * @property {string|null} [location] ReplicaInfo location - * @property {google.spanner.admin.instance.v1.ReplicaInfo.ReplicaType|null} [type] ReplicaInfo type - * @property {boolean|null} [defaultLeaderLocation] ReplicaInfo defaultLeaderLocation - */ - - /** - * Constructs a new ReplicaInfo. - * @memberof google.spanner.admin.instance.v1 - * @classdesc Represents a ReplicaInfo. - * @implements IReplicaInfo - * @constructor - * @param {google.spanner.admin.instance.v1.IReplicaInfo=} [properties] Properties to set - */ - function ReplicaInfo(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ReplicaInfo location. - * @member {string} location - * @memberof google.spanner.admin.instance.v1.ReplicaInfo - * @instance - */ - ReplicaInfo.prototype.location = ""; - - /** - * ReplicaInfo type. - * @member {google.spanner.admin.instance.v1.ReplicaInfo.ReplicaType} type - * @memberof google.spanner.admin.instance.v1.ReplicaInfo - * @instance - */ - ReplicaInfo.prototype.type = 0; - - /** - * ReplicaInfo defaultLeaderLocation. - * @member {boolean} defaultLeaderLocation - * @memberof google.spanner.admin.instance.v1.ReplicaInfo - * @instance - */ - ReplicaInfo.prototype.defaultLeaderLocation = false; - - /** - * Creates a new ReplicaInfo instance using the specified properties. - * @function create - * @memberof google.spanner.admin.instance.v1.ReplicaInfo - * @static - * @param {google.spanner.admin.instance.v1.IReplicaInfo=} [properties] Properties to set - * @returns {google.spanner.admin.instance.v1.ReplicaInfo} ReplicaInfo instance - */ - ReplicaInfo.create = function create(properties) { - return new ReplicaInfo(properties); - }; - - /** - * Encodes the specified ReplicaInfo message. Does not implicitly {@link google.spanner.admin.instance.v1.ReplicaInfo.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.instance.v1.ReplicaInfo - * @static - * @param {google.spanner.admin.instance.v1.IReplicaInfo} message ReplicaInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReplicaInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.location != null && Object.hasOwnProperty.call(message, "location")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.location); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.type); - if (message.defaultLeaderLocation != null && Object.hasOwnProperty.call(message, "defaultLeaderLocation")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.defaultLeaderLocation); - return writer; - }; - - /** - * Encodes the specified ReplicaInfo message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ReplicaInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.instance.v1.ReplicaInfo - * @static - * @param {google.spanner.admin.instance.v1.IReplicaInfo} message ReplicaInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReplicaInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ReplicaInfo message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.instance.v1.ReplicaInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.instance.v1.ReplicaInfo} ReplicaInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReplicaInfo.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.ReplicaInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.location = reader.string(); - break; - } - case 2: { - message.type = reader.int32(); - break; - } - case 3: { - message.defaultLeaderLocation = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ReplicaInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.instance.v1.ReplicaInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.instance.v1.ReplicaInfo} ReplicaInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReplicaInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ReplicaInfo message. - * @function verify - * @memberof google.spanner.admin.instance.v1.ReplicaInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ReplicaInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.location != null && message.hasOwnProperty("location")) - if (!$util.isString(message.location)) - return "location: string expected"; - if (message.type != null && message.hasOwnProperty("type")) - switch (message.type) { - default: - return "type: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.defaultLeaderLocation != null && message.hasOwnProperty("defaultLeaderLocation")) - if (typeof message.defaultLeaderLocation !== "boolean") - return "defaultLeaderLocation: boolean expected"; - return null; - }; - - /** - * Creates a ReplicaInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.instance.v1.ReplicaInfo - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.instance.v1.ReplicaInfo} ReplicaInfo - */ - ReplicaInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.instance.v1.ReplicaInfo) - return object; - var message = new $root.google.spanner.admin.instance.v1.ReplicaInfo(); - if (object.location != null) - message.location = String(object.location); - switch (object.type) { - default: - if (typeof object.type === "number") { - message.type = object.type; - break; - } - break; - case "TYPE_UNSPECIFIED": - case 0: - message.type = 0; - break; - case "READ_WRITE": - case 1: - message.type = 1; - break; - case "READ_ONLY": - case 2: - message.type = 2; - break; - case "WITNESS": - case 3: - message.type = 3; - break; - } - if (object.defaultLeaderLocation != null) - message.defaultLeaderLocation = Boolean(object.defaultLeaderLocation); - return message; - }; - - /** - * Creates a plain object from a ReplicaInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.instance.v1.ReplicaInfo - * @static - * @param {google.spanner.admin.instance.v1.ReplicaInfo} message ReplicaInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ReplicaInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.location = ""; - object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; - object.defaultLeaderLocation = false; - } - if (message.location != null && message.hasOwnProperty("location")) - object.location = message.location; - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.spanner.admin.instance.v1.ReplicaInfo.ReplicaType[message.type] === undefined ? message.type : $root.google.spanner.admin.instance.v1.ReplicaInfo.ReplicaType[message.type] : message.type; - if (message.defaultLeaderLocation != null && message.hasOwnProperty("defaultLeaderLocation")) - object.defaultLeaderLocation = message.defaultLeaderLocation; - return object; - }; - - /** - * Converts this ReplicaInfo to JSON. - * @function toJSON - * @memberof google.spanner.admin.instance.v1.ReplicaInfo - * @instance - * @returns {Object.} JSON object - */ - ReplicaInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ReplicaInfo - * @function getTypeUrl - * @memberof google.spanner.admin.instance.v1.ReplicaInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ReplicaInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.instance.v1.ReplicaInfo"; - }; - - /** - * ReplicaType enum. - * @name google.spanner.admin.instance.v1.ReplicaInfo.ReplicaType - * @enum {number} - * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value - * @property {number} READ_WRITE=1 READ_WRITE value - * @property {number} READ_ONLY=2 READ_ONLY value - * @property {number} WITNESS=3 WITNESS value - */ - ReplicaInfo.ReplicaType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "READ_WRITE"] = 1; - values[valuesById[2] = "READ_ONLY"] = 2; - values[valuesById[3] = "WITNESS"] = 3; - return values; - })(); - - return ReplicaInfo; - })(); - - v1.InstanceConfig = (function() { - - /** - * Properties of an InstanceConfig. - * @memberof google.spanner.admin.instance.v1 - * @interface IInstanceConfig - * @property {string|null} [name] InstanceConfig name - * @property {string|null} [displayName] InstanceConfig displayName - * @property {google.spanner.admin.instance.v1.InstanceConfig.Type|null} [configType] InstanceConfig configType - * @property {Array.|null} [replicas] InstanceConfig replicas - * @property {Array.|null} [optionalReplicas] InstanceConfig optionalReplicas - * @property {string|null} [baseConfig] InstanceConfig baseConfig - * @property {Object.|null} [labels] InstanceConfig labels - * @property {string|null} [etag] InstanceConfig etag - * @property {Array.|null} [leaderOptions] InstanceConfig leaderOptions - * @property {boolean|null} [reconciling] InstanceConfig reconciling - * @property {google.spanner.admin.instance.v1.InstanceConfig.State|null} [state] InstanceConfig state - * @property {google.spanner.admin.instance.v1.InstanceConfig.FreeInstanceAvailability|null} [freeInstanceAvailability] InstanceConfig freeInstanceAvailability - * @property {google.spanner.admin.instance.v1.InstanceConfig.QuorumType|null} [quorumType] InstanceConfig quorumType - * @property {number|Long|null} [storageLimitPerProcessingUnit] InstanceConfig storageLimitPerProcessingUnit - */ - - /** - * Constructs a new InstanceConfig. - * @memberof google.spanner.admin.instance.v1 - * @classdesc Represents an InstanceConfig. - * @implements IInstanceConfig - * @constructor - * @param {google.spanner.admin.instance.v1.IInstanceConfig=} [properties] Properties to set - */ - function InstanceConfig(properties) { - this.replicas = []; - this.optionalReplicas = []; - this.labels = {}; - this.leaderOptions = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * InstanceConfig name. - * @member {string} name - * @memberof google.spanner.admin.instance.v1.InstanceConfig - * @instance - */ - InstanceConfig.prototype.name = ""; - - /** - * InstanceConfig displayName. - * @member {string} displayName - * @memberof google.spanner.admin.instance.v1.InstanceConfig - * @instance - */ - InstanceConfig.prototype.displayName = ""; - - /** - * InstanceConfig configType. - * @member {google.spanner.admin.instance.v1.InstanceConfig.Type} configType - * @memberof google.spanner.admin.instance.v1.InstanceConfig - * @instance - */ - InstanceConfig.prototype.configType = 0; - - /** - * InstanceConfig replicas. - * @member {Array.} replicas - * @memberof google.spanner.admin.instance.v1.InstanceConfig - * @instance - */ - InstanceConfig.prototype.replicas = $util.emptyArray; - - /** - * InstanceConfig optionalReplicas. - * @member {Array.} optionalReplicas - * @memberof google.spanner.admin.instance.v1.InstanceConfig - * @instance - */ - InstanceConfig.prototype.optionalReplicas = $util.emptyArray; - - /** - * InstanceConfig baseConfig. - * @member {string} baseConfig - * @memberof google.spanner.admin.instance.v1.InstanceConfig - * @instance - */ - InstanceConfig.prototype.baseConfig = ""; - - /** - * InstanceConfig labels. - * @member {Object.} labels - * @memberof google.spanner.admin.instance.v1.InstanceConfig - * @instance - */ - InstanceConfig.prototype.labels = $util.emptyObject; - - /** - * InstanceConfig etag. - * @member {string} etag - * @memberof google.spanner.admin.instance.v1.InstanceConfig - * @instance - */ - InstanceConfig.prototype.etag = ""; - - /** - * InstanceConfig leaderOptions. - * @member {Array.} leaderOptions - * @memberof google.spanner.admin.instance.v1.InstanceConfig - * @instance - */ - InstanceConfig.prototype.leaderOptions = $util.emptyArray; - - /** - * InstanceConfig reconciling. - * @member {boolean} reconciling - * @memberof google.spanner.admin.instance.v1.InstanceConfig - * @instance - */ - InstanceConfig.prototype.reconciling = false; - - /** - * InstanceConfig state. - * @member {google.spanner.admin.instance.v1.InstanceConfig.State} state - * @memberof google.spanner.admin.instance.v1.InstanceConfig - * @instance - */ - InstanceConfig.prototype.state = 0; - - /** - * InstanceConfig freeInstanceAvailability. - * @member {google.spanner.admin.instance.v1.InstanceConfig.FreeInstanceAvailability} freeInstanceAvailability - * @memberof google.spanner.admin.instance.v1.InstanceConfig - * @instance - */ - InstanceConfig.prototype.freeInstanceAvailability = 0; - - /** - * InstanceConfig quorumType. - * @member {google.spanner.admin.instance.v1.InstanceConfig.QuorumType} quorumType - * @memberof google.spanner.admin.instance.v1.InstanceConfig - * @instance - */ - InstanceConfig.prototype.quorumType = 0; - - /** - * InstanceConfig storageLimitPerProcessingUnit. - * @member {number|Long} storageLimitPerProcessingUnit - * @memberof google.spanner.admin.instance.v1.InstanceConfig - * @instance - */ - InstanceConfig.prototype.storageLimitPerProcessingUnit = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Creates a new InstanceConfig instance using the specified properties. - * @function create - * @memberof google.spanner.admin.instance.v1.InstanceConfig - * @static - * @param {google.spanner.admin.instance.v1.IInstanceConfig=} [properties] Properties to set - * @returns {google.spanner.admin.instance.v1.InstanceConfig} InstanceConfig instance - */ - InstanceConfig.create = function create(properties) { - return new InstanceConfig(properties); - }; - - /** - * Encodes the specified InstanceConfig message. Does not implicitly {@link google.spanner.admin.instance.v1.InstanceConfig.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.instance.v1.InstanceConfig - * @static - * @param {google.spanner.admin.instance.v1.IInstanceConfig} message InstanceConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InstanceConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); - if (message.replicas != null && message.replicas.length) - for (var i = 0; i < message.replicas.length; ++i) - $root.google.spanner.admin.instance.v1.ReplicaInfo.encode(message.replicas[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.leaderOptions != null && message.leaderOptions.length) - for (var i = 0; i < message.leaderOptions.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.leaderOptions[i]); - if (message.configType != null && Object.hasOwnProperty.call(message, "configType")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.configType); - if (message.optionalReplicas != null && message.optionalReplicas.length) - for (var i = 0; i < message.optionalReplicas.length; ++i) - $root.google.spanner.admin.instance.v1.ReplicaInfo.encode(message.optionalReplicas[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.baseConfig != null && Object.hasOwnProperty.call(message, "baseConfig")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.baseConfig); - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 8, wireType 2 =*/66).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.etag); - if (message.reconciling != null && Object.hasOwnProperty.call(message, "reconciling")) - writer.uint32(/* id 10, wireType 0 =*/80).bool(message.reconciling); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 11, wireType 0 =*/88).int32(message.state); - if (message.freeInstanceAvailability != null && Object.hasOwnProperty.call(message, "freeInstanceAvailability")) - writer.uint32(/* id 12, wireType 0 =*/96).int32(message.freeInstanceAvailability); - if (message.quorumType != null && Object.hasOwnProperty.call(message, "quorumType")) - writer.uint32(/* id 18, wireType 0 =*/144).int32(message.quorumType); - if (message.storageLimitPerProcessingUnit != null && Object.hasOwnProperty.call(message, "storageLimitPerProcessingUnit")) - writer.uint32(/* id 19, wireType 0 =*/152).int64(message.storageLimitPerProcessingUnit); - return writer; - }; - - /** - * Encodes the specified InstanceConfig message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.InstanceConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.instance.v1.InstanceConfig - * @static - * @param {google.spanner.admin.instance.v1.IInstanceConfig} message InstanceConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InstanceConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an InstanceConfig message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.instance.v1.InstanceConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.instance.v1.InstanceConfig} InstanceConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InstanceConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.InstanceConfig(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.displayName = reader.string(); - break; - } - case 5: { - message.configType = reader.int32(); - break; - } - case 3: { - if (!(message.replicas && message.replicas.length)) - message.replicas = []; - message.replicas.push($root.google.spanner.admin.instance.v1.ReplicaInfo.decode(reader, reader.uint32())); - break; - } - case 6: { - if (!(message.optionalReplicas && message.optionalReplicas.length)) - message.optionalReplicas = []; - message.optionalReplicas.push($root.google.spanner.admin.instance.v1.ReplicaInfo.decode(reader, reader.uint32())); - break; - } - case 7: { - message.baseConfig = reader.string(); - break; - } - case 8: { - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.labels[key] = value; - break; - } - case 9: { - message.etag = reader.string(); - break; - } - case 4: { - if (!(message.leaderOptions && message.leaderOptions.length)) - message.leaderOptions = []; - message.leaderOptions.push(reader.string()); - break; - } - case 10: { - message.reconciling = reader.bool(); - break; - } - case 11: { - message.state = reader.int32(); - break; - } - case 12: { - message.freeInstanceAvailability = reader.int32(); - break; - } - case 18: { - message.quorumType = reader.int32(); - break; - } - case 19: { - message.storageLimitPerProcessingUnit = reader.int64(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an InstanceConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.instance.v1.InstanceConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.instance.v1.InstanceConfig} InstanceConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InstanceConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an InstanceConfig message. - * @function verify - * @memberof google.spanner.admin.instance.v1.InstanceConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - InstanceConfig.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.configType != null && message.hasOwnProperty("configType")) - switch (message.configType) { - default: - return "configType: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.replicas != null && message.hasOwnProperty("replicas")) { - if (!Array.isArray(message.replicas)) - return "replicas: array expected"; - for (var i = 0; i < message.replicas.length; ++i) { - var error = $root.google.spanner.admin.instance.v1.ReplicaInfo.verify(message.replicas[i]); - if (error) - return "replicas." + error; - } - } - if (message.optionalReplicas != null && message.hasOwnProperty("optionalReplicas")) { - if (!Array.isArray(message.optionalReplicas)) - return "optionalReplicas: array expected"; - for (var i = 0; i < message.optionalReplicas.length; ++i) { - var error = $root.google.spanner.admin.instance.v1.ReplicaInfo.verify(message.optionalReplicas[i]); - if (error) - return "optionalReplicas." + error; - } - } - if (message.baseConfig != null && message.hasOwnProperty("baseConfig")) - if (!$util.isString(message.baseConfig)) - return "baseConfig: string expected"; - if (message.labels != null && message.hasOwnProperty("labels")) { - if (!$util.isObject(message.labels)) - return "labels: object expected"; - var key = Object.keys(message.labels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.labels[key[i]])) - return "labels: string{k:string} expected"; - } - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - if (message.leaderOptions != null && message.hasOwnProperty("leaderOptions")) { - if (!Array.isArray(message.leaderOptions)) - return "leaderOptions: array expected"; - for (var i = 0; i < message.leaderOptions.length; ++i) - if (!$util.isString(message.leaderOptions[i])) - return "leaderOptions: string[] expected"; - } - if (message.reconciling != null && message.hasOwnProperty("reconciling")) - if (typeof message.reconciling !== "boolean") - return "reconciling: boolean 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.freeInstanceAvailability != null && message.hasOwnProperty("freeInstanceAvailability")) - switch (message.freeInstanceAvailability) { - default: - return "freeInstanceAvailability: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - if (message.quorumType != null && message.hasOwnProperty("quorumType")) - switch (message.quorumType) { - default: - return "quorumType: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.storageLimitPerProcessingUnit != null && message.hasOwnProperty("storageLimitPerProcessingUnit")) - if (!$util.isInteger(message.storageLimitPerProcessingUnit) && !(message.storageLimitPerProcessingUnit && $util.isInteger(message.storageLimitPerProcessingUnit.low) && $util.isInteger(message.storageLimitPerProcessingUnit.high))) - return "storageLimitPerProcessingUnit: integer|Long expected"; - return null; - }; - - /** - * Creates an InstanceConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.instance.v1.InstanceConfig - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.instance.v1.InstanceConfig} InstanceConfig - */ - InstanceConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.instance.v1.InstanceConfig) - return object; - var message = new $root.google.spanner.admin.instance.v1.InstanceConfig(); - if (object.name != null) - message.name = String(object.name); - if (object.displayName != null) - message.displayName = String(object.displayName); - switch (object.configType) { - default: - if (typeof object.configType === "number") { - message.configType = object.configType; - break; - } - break; - case "TYPE_UNSPECIFIED": - case 0: - message.configType = 0; - break; - case "GOOGLE_MANAGED": - case 1: - message.configType = 1; - break; - case "USER_MANAGED": - case 2: - message.configType = 2; - break; - } - if (object.replicas) { - if (!Array.isArray(object.replicas)) - throw TypeError(".google.spanner.admin.instance.v1.InstanceConfig.replicas: array expected"); - message.replicas = []; - for (var i = 0; i < object.replicas.length; ++i) { - if (typeof object.replicas[i] !== "object") - throw TypeError(".google.spanner.admin.instance.v1.InstanceConfig.replicas: object expected"); - message.replicas[i] = $root.google.spanner.admin.instance.v1.ReplicaInfo.fromObject(object.replicas[i]); - } - } - if (object.optionalReplicas) { - if (!Array.isArray(object.optionalReplicas)) - throw TypeError(".google.spanner.admin.instance.v1.InstanceConfig.optionalReplicas: array expected"); - message.optionalReplicas = []; - for (var i = 0; i < object.optionalReplicas.length; ++i) { - if (typeof object.optionalReplicas[i] !== "object") - throw TypeError(".google.spanner.admin.instance.v1.InstanceConfig.optionalReplicas: object expected"); - message.optionalReplicas[i] = $root.google.spanner.admin.instance.v1.ReplicaInfo.fromObject(object.optionalReplicas[i]); - } - } - if (object.baseConfig != null) - message.baseConfig = String(object.baseConfig); - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.spanner.admin.instance.v1.InstanceConfig.labels: object expected"); - message.labels = {}; - for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) - message.labels[keys[i]] = String(object.labels[keys[i]]); - } - if (object.etag != null) - message.etag = String(object.etag); - if (object.leaderOptions) { - if (!Array.isArray(object.leaderOptions)) - throw TypeError(".google.spanner.admin.instance.v1.InstanceConfig.leaderOptions: array expected"); - message.leaderOptions = []; - for (var i = 0; i < object.leaderOptions.length; ++i) - message.leaderOptions[i] = String(object.leaderOptions[i]); - } - if (object.reconciling != null) - message.reconciling = Boolean(object.reconciling); - switch (object.state) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "CREATING": - case 1: - message.state = 1; - break; - case "READY": - case 2: - message.state = 2; - break; - } - switch (object.freeInstanceAvailability) { - default: - if (typeof object.freeInstanceAvailability === "number") { - message.freeInstanceAvailability = object.freeInstanceAvailability; - break; - } - break; - case "FREE_INSTANCE_AVAILABILITY_UNSPECIFIED": - case 0: - message.freeInstanceAvailability = 0; - break; - case "AVAILABLE": - case 1: - message.freeInstanceAvailability = 1; - break; - case "UNSUPPORTED": - case 2: - message.freeInstanceAvailability = 2; - break; - case "DISABLED": - case 3: - message.freeInstanceAvailability = 3; - break; - case "QUOTA_EXCEEDED": - case 4: - message.freeInstanceAvailability = 4; - break; - } - switch (object.quorumType) { - default: - if (typeof object.quorumType === "number") { - message.quorumType = object.quorumType; - break; - } - break; - case "QUORUM_TYPE_UNSPECIFIED": - case 0: - message.quorumType = 0; - break; - case "REGION": - case 1: - message.quorumType = 1; - break; - case "DUAL_REGION": - case 2: - message.quorumType = 2; - break; - case "MULTI_REGION": - case 3: - message.quorumType = 3; - break; - } - if (object.storageLimitPerProcessingUnit != null) - if ($util.Long) - (message.storageLimitPerProcessingUnit = $util.Long.fromValue(object.storageLimitPerProcessingUnit)).unsigned = false; - else if (typeof object.storageLimitPerProcessingUnit === "string") - message.storageLimitPerProcessingUnit = parseInt(object.storageLimitPerProcessingUnit, 10); - else if (typeof object.storageLimitPerProcessingUnit === "number") - message.storageLimitPerProcessingUnit = object.storageLimitPerProcessingUnit; - else if (typeof object.storageLimitPerProcessingUnit === "object") - message.storageLimitPerProcessingUnit = new $util.LongBits(object.storageLimitPerProcessingUnit.low >>> 0, object.storageLimitPerProcessingUnit.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from an InstanceConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.instance.v1.InstanceConfig - * @static - * @param {google.spanner.admin.instance.v1.InstanceConfig} message InstanceConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - InstanceConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.replicas = []; - object.leaderOptions = []; - object.optionalReplicas = []; - } - if (options.objects || options.defaults) - object.labels = {}; - if (options.defaults) { - object.name = ""; - object.displayName = ""; - object.configType = options.enums === String ? "TYPE_UNSPECIFIED" : 0; - object.baseConfig = ""; - object.etag = ""; - object.reconciling = false; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.freeInstanceAvailability = options.enums === String ? "FREE_INSTANCE_AVAILABILITY_UNSPECIFIED" : 0; - object.quorumType = options.enums === String ? "QUORUM_TYPE_UNSPECIFIED" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.storageLimitPerProcessingUnit = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.storageLimitPerProcessingUnit = options.longs === String ? "0" : 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.replicas && message.replicas.length) { - object.replicas = []; - for (var j = 0; j < message.replicas.length; ++j) - object.replicas[j] = $root.google.spanner.admin.instance.v1.ReplicaInfo.toObject(message.replicas[j], options); - } - if (message.leaderOptions && message.leaderOptions.length) { - object.leaderOptions = []; - for (var j = 0; j < message.leaderOptions.length; ++j) - object.leaderOptions[j] = message.leaderOptions[j]; - } - if (message.configType != null && message.hasOwnProperty("configType")) - object.configType = options.enums === String ? $root.google.spanner.admin.instance.v1.InstanceConfig.Type[message.configType] === undefined ? message.configType : $root.google.spanner.admin.instance.v1.InstanceConfig.Type[message.configType] : message.configType; - if (message.optionalReplicas && message.optionalReplicas.length) { - object.optionalReplicas = []; - for (var j = 0; j < message.optionalReplicas.length; ++j) - object.optionalReplicas[j] = $root.google.spanner.admin.instance.v1.ReplicaInfo.toObject(message.optionalReplicas[j], options); - } - if (message.baseConfig != null && message.hasOwnProperty("baseConfig")) - object.baseConfig = message.baseConfig; - 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.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - if (message.reconciling != null && message.hasOwnProperty("reconciling")) - object.reconciling = message.reconciling; - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.spanner.admin.instance.v1.InstanceConfig.State[message.state] === undefined ? message.state : $root.google.spanner.admin.instance.v1.InstanceConfig.State[message.state] : message.state; - if (message.freeInstanceAvailability != null && message.hasOwnProperty("freeInstanceAvailability")) - object.freeInstanceAvailability = options.enums === String ? $root.google.spanner.admin.instance.v1.InstanceConfig.FreeInstanceAvailability[message.freeInstanceAvailability] === undefined ? message.freeInstanceAvailability : $root.google.spanner.admin.instance.v1.InstanceConfig.FreeInstanceAvailability[message.freeInstanceAvailability] : message.freeInstanceAvailability; - if (message.quorumType != null && message.hasOwnProperty("quorumType")) - object.quorumType = options.enums === String ? $root.google.spanner.admin.instance.v1.InstanceConfig.QuorumType[message.quorumType] === undefined ? message.quorumType : $root.google.spanner.admin.instance.v1.InstanceConfig.QuorumType[message.quorumType] : message.quorumType; - if (message.storageLimitPerProcessingUnit != null && message.hasOwnProperty("storageLimitPerProcessingUnit")) - if (typeof message.storageLimitPerProcessingUnit === "number") - object.storageLimitPerProcessingUnit = options.longs === String ? String(message.storageLimitPerProcessingUnit) : message.storageLimitPerProcessingUnit; - else - object.storageLimitPerProcessingUnit = options.longs === String ? $util.Long.prototype.toString.call(message.storageLimitPerProcessingUnit) : options.longs === Number ? new $util.LongBits(message.storageLimitPerProcessingUnit.low >>> 0, message.storageLimitPerProcessingUnit.high >>> 0).toNumber() : message.storageLimitPerProcessingUnit; - return object; - }; - - /** - * Converts this InstanceConfig to JSON. - * @function toJSON - * @memberof google.spanner.admin.instance.v1.InstanceConfig - * @instance - * @returns {Object.} JSON object - */ - InstanceConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for InstanceConfig - * @function getTypeUrl - * @memberof google.spanner.admin.instance.v1.InstanceConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - InstanceConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.instance.v1.InstanceConfig"; - }; - - /** - * Type enum. - * @name google.spanner.admin.instance.v1.InstanceConfig.Type - * @enum {number} - * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value - * @property {number} GOOGLE_MANAGED=1 GOOGLE_MANAGED value - * @property {number} USER_MANAGED=2 USER_MANAGED value - */ - InstanceConfig.Type = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "GOOGLE_MANAGED"] = 1; - values[valuesById[2] = "USER_MANAGED"] = 2; - return values; - })(); - - /** - * State enum. - * @name google.spanner.admin.instance.v1.InstanceConfig.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} CREATING=1 CREATING value - * @property {number} READY=2 READY value - */ - InstanceConfig.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "CREATING"] = 1; - values[valuesById[2] = "READY"] = 2; - return values; - })(); - - /** - * FreeInstanceAvailability enum. - * @name google.spanner.admin.instance.v1.InstanceConfig.FreeInstanceAvailability - * @enum {number} - * @property {number} FREE_INSTANCE_AVAILABILITY_UNSPECIFIED=0 FREE_INSTANCE_AVAILABILITY_UNSPECIFIED value - * @property {number} AVAILABLE=1 AVAILABLE value - * @property {number} UNSUPPORTED=2 UNSUPPORTED value - * @property {number} DISABLED=3 DISABLED value - * @property {number} QUOTA_EXCEEDED=4 QUOTA_EXCEEDED value - */ - InstanceConfig.FreeInstanceAvailability = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "FREE_INSTANCE_AVAILABILITY_UNSPECIFIED"] = 0; - values[valuesById[1] = "AVAILABLE"] = 1; - values[valuesById[2] = "UNSUPPORTED"] = 2; - values[valuesById[3] = "DISABLED"] = 3; - values[valuesById[4] = "QUOTA_EXCEEDED"] = 4; - return values; - })(); - - /** - * QuorumType enum. - * @name google.spanner.admin.instance.v1.InstanceConfig.QuorumType - * @enum {number} - * @property {number} QUORUM_TYPE_UNSPECIFIED=0 QUORUM_TYPE_UNSPECIFIED value - * @property {number} REGION=1 REGION value - * @property {number} DUAL_REGION=2 DUAL_REGION value - * @property {number} MULTI_REGION=3 MULTI_REGION value - */ - InstanceConfig.QuorumType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "QUORUM_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "REGION"] = 1; - values[valuesById[2] = "DUAL_REGION"] = 2; - values[valuesById[3] = "MULTI_REGION"] = 3; - return values; - })(); - - return InstanceConfig; - })(); - - v1.ReplicaComputeCapacity = (function() { - - /** - * Properties of a ReplicaComputeCapacity. - * @memberof google.spanner.admin.instance.v1 - * @interface IReplicaComputeCapacity - * @property {google.spanner.admin.instance.v1.IReplicaSelection|null} [replicaSelection] ReplicaComputeCapacity replicaSelection - * @property {number|null} [nodeCount] ReplicaComputeCapacity nodeCount - * @property {number|null} [processingUnits] ReplicaComputeCapacity processingUnits - */ - - /** - * Constructs a new ReplicaComputeCapacity. - * @memberof google.spanner.admin.instance.v1 - * @classdesc Represents a ReplicaComputeCapacity. - * @implements IReplicaComputeCapacity - * @constructor - * @param {google.spanner.admin.instance.v1.IReplicaComputeCapacity=} [properties] Properties to set - */ - function ReplicaComputeCapacity(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ReplicaComputeCapacity replicaSelection. - * @member {google.spanner.admin.instance.v1.IReplicaSelection|null|undefined} replicaSelection - * @memberof google.spanner.admin.instance.v1.ReplicaComputeCapacity - * @instance - */ - ReplicaComputeCapacity.prototype.replicaSelection = null; - - /** - * ReplicaComputeCapacity nodeCount. - * @member {number|null|undefined} nodeCount - * @memberof google.spanner.admin.instance.v1.ReplicaComputeCapacity - * @instance - */ - ReplicaComputeCapacity.prototype.nodeCount = null; - - /** - * ReplicaComputeCapacity processingUnits. - * @member {number|null|undefined} processingUnits - * @memberof google.spanner.admin.instance.v1.ReplicaComputeCapacity - * @instance - */ - ReplicaComputeCapacity.prototype.processingUnits = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * ReplicaComputeCapacity computeCapacity. - * @member {"nodeCount"|"processingUnits"|undefined} computeCapacity - * @memberof google.spanner.admin.instance.v1.ReplicaComputeCapacity - * @instance - */ - Object.defineProperty(ReplicaComputeCapacity.prototype, "computeCapacity", { - get: $util.oneOfGetter($oneOfFields = ["nodeCount", "processingUnits"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new ReplicaComputeCapacity instance using the specified properties. - * @function create - * @memberof google.spanner.admin.instance.v1.ReplicaComputeCapacity - * @static - * @param {google.spanner.admin.instance.v1.IReplicaComputeCapacity=} [properties] Properties to set - * @returns {google.spanner.admin.instance.v1.ReplicaComputeCapacity} ReplicaComputeCapacity instance - */ - ReplicaComputeCapacity.create = function create(properties) { - return new ReplicaComputeCapacity(properties); - }; - - /** - * Encodes the specified ReplicaComputeCapacity message. Does not implicitly {@link google.spanner.admin.instance.v1.ReplicaComputeCapacity.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.instance.v1.ReplicaComputeCapacity - * @static - * @param {google.spanner.admin.instance.v1.IReplicaComputeCapacity} message ReplicaComputeCapacity message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReplicaComputeCapacity.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.replicaSelection != null && Object.hasOwnProperty.call(message, "replicaSelection")) - $root.google.spanner.admin.instance.v1.ReplicaSelection.encode(message.replicaSelection, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nodeCount != null && Object.hasOwnProperty.call(message, "nodeCount")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nodeCount); - if (message.processingUnits != null && Object.hasOwnProperty.call(message, "processingUnits")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.processingUnits); - return writer; - }; - - /** - * Encodes the specified ReplicaComputeCapacity message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ReplicaComputeCapacity.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.instance.v1.ReplicaComputeCapacity - * @static - * @param {google.spanner.admin.instance.v1.IReplicaComputeCapacity} message ReplicaComputeCapacity message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReplicaComputeCapacity.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ReplicaComputeCapacity message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.instance.v1.ReplicaComputeCapacity - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.instance.v1.ReplicaComputeCapacity} ReplicaComputeCapacity - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReplicaComputeCapacity.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.ReplicaComputeCapacity(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.replicaSelection = $root.google.spanner.admin.instance.v1.ReplicaSelection.decode(reader, reader.uint32()); - break; - } - case 2: { - message.nodeCount = reader.int32(); - break; - } - case 3: { - message.processingUnits = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ReplicaComputeCapacity message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.instance.v1.ReplicaComputeCapacity - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.instance.v1.ReplicaComputeCapacity} ReplicaComputeCapacity - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReplicaComputeCapacity.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ReplicaComputeCapacity message. - * @function verify - * @memberof google.spanner.admin.instance.v1.ReplicaComputeCapacity - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ReplicaComputeCapacity.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.replicaSelection != null && message.hasOwnProperty("replicaSelection")) { - var error = $root.google.spanner.admin.instance.v1.ReplicaSelection.verify(message.replicaSelection); - if (error) - return "replicaSelection." + error; - } - if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) { - properties.computeCapacity = 1; - if (!$util.isInteger(message.nodeCount)) - return "nodeCount: integer expected"; - } - if (message.processingUnits != null && message.hasOwnProperty("processingUnits")) { - if (properties.computeCapacity === 1) - return "computeCapacity: multiple values"; - properties.computeCapacity = 1; - if (!$util.isInteger(message.processingUnits)) - return "processingUnits: integer expected"; - } - return null; - }; - - /** - * Creates a ReplicaComputeCapacity message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.instance.v1.ReplicaComputeCapacity - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.instance.v1.ReplicaComputeCapacity} ReplicaComputeCapacity - */ - ReplicaComputeCapacity.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.instance.v1.ReplicaComputeCapacity) - return object; - var message = new $root.google.spanner.admin.instance.v1.ReplicaComputeCapacity(); - if (object.replicaSelection != null) { - if (typeof object.replicaSelection !== "object") - throw TypeError(".google.spanner.admin.instance.v1.ReplicaComputeCapacity.replicaSelection: object expected"); - message.replicaSelection = $root.google.spanner.admin.instance.v1.ReplicaSelection.fromObject(object.replicaSelection); - } - if (object.nodeCount != null) - message.nodeCount = object.nodeCount | 0; - if (object.processingUnits != null) - message.processingUnits = object.processingUnits | 0; - return message; - }; - - /** - * Creates a plain object from a ReplicaComputeCapacity message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.instance.v1.ReplicaComputeCapacity - * @static - * @param {google.spanner.admin.instance.v1.ReplicaComputeCapacity} message ReplicaComputeCapacity - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ReplicaComputeCapacity.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.replicaSelection = null; - if (message.replicaSelection != null && message.hasOwnProperty("replicaSelection")) - object.replicaSelection = $root.google.spanner.admin.instance.v1.ReplicaSelection.toObject(message.replicaSelection, options); - if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) { - object.nodeCount = message.nodeCount; - if (options.oneofs) - object.computeCapacity = "nodeCount"; - } - if (message.processingUnits != null && message.hasOwnProperty("processingUnits")) { - object.processingUnits = message.processingUnits; - if (options.oneofs) - object.computeCapacity = "processingUnits"; - } - return object; - }; - - /** - * Converts this ReplicaComputeCapacity to JSON. - * @function toJSON - * @memberof google.spanner.admin.instance.v1.ReplicaComputeCapacity - * @instance - * @returns {Object.} JSON object - */ - ReplicaComputeCapacity.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ReplicaComputeCapacity - * @function getTypeUrl - * @memberof google.spanner.admin.instance.v1.ReplicaComputeCapacity - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ReplicaComputeCapacity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.instance.v1.ReplicaComputeCapacity"; - }; - - return ReplicaComputeCapacity; - })(); - - v1.AutoscalingConfig = (function() { - - /** - * Properties of an AutoscalingConfig. - * @memberof google.spanner.admin.instance.v1 - * @interface IAutoscalingConfig - * @property {google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingLimits|null} [autoscalingLimits] AutoscalingConfig autoscalingLimits - * @property {google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingTargets|null} [autoscalingTargets] AutoscalingConfig autoscalingTargets - * @property {Array.|null} [asymmetricAutoscalingOptions] AutoscalingConfig asymmetricAutoscalingOptions - */ - - /** - * Constructs a new AutoscalingConfig. - * @memberof google.spanner.admin.instance.v1 - * @classdesc Represents an AutoscalingConfig. - * @implements IAutoscalingConfig - * @constructor - * @param {google.spanner.admin.instance.v1.IAutoscalingConfig=} [properties] Properties to set - */ - function AutoscalingConfig(properties) { - this.asymmetricAutoscalingOptions = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AutoscalingConfig autoscalingLimits. - * @member {google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingLimits|null|undefined} autoscalingLimits - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig - * @instance - */ - AutoscalingConfig.prototype.autoscalingLimits = null; - - /** - * AutoscalingConfig autoscalingTargets. - * @member {google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingTargets|null|undefined} autoscalingTargets - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig - * @instance - */ - AutoscalingConfig.prototype.autoscalingTargets = null; - - /** - * AutoscalingConfig asymmetricAutoscalingOptions. - * @member {Array.} asymmetricAutoscalingOptions - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig - * @instance - */ - AutoscalingConfig.prototype.asymmetricAutoscalingOptions = $util.emptyArray; - - /** - * Creates a new AutoscalingConfig instance using the specified properties. - * @function create - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig - * @static - * @param {google.spanner.admin.instance.v1.IAutoscalingConfig=} [properties] Properties to set - * @returns {google.spanner.admin.instance.v1.AutoscalingConfig} AutoscalingConfig instance - */ - AutoscalingConfig.create = function create(properties) { - return new AutoscalingConfig(properties); - }; - - /** - * Encodes the specified AutoscalingConfig message. Does not implicitly {@link google.spanner.admin.instance.v1.AutoscalingConfig.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig - * @static - * @param {google.spanner.admin.instance.v1.IAutoscalingConfig} message AutoscalingConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AutoscalingConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.autoscalingLimits != null && Object.hasOwnProperty.call(message, "autoscalingLimits")) - $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits.encode(message.autoscalingLimits, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.autoscalingTargets != null && Object.hasOwnProperty.call(message, "autoscalingTargets")) - $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets.encode(message.autoscalingTargets, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.asymmetricAutoscalingOptions != null && message.asymmetricAutoscalingOptions.length) - for (var i = 0; i < message.asymmetricAutoscalingOptions.length; ++i) - $root.google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.encode(message.asymmetricAutoscalingOptions[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified AutoscalingConfig message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.AutoscalingConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig - * @static - * @param {google.spanner.admin.instance.v1.IAutoscalingConfig} message AutoscalingConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AutoscalingConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AutoscalingConfig message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.instance.v1.AutoscalingConfig} AutoscalingConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AutoscalingConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.AutoscalingConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.autoscalingLimits = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits.decode(reader, reader.uint32()); - break; - } - case 2: { - message.autoscalingTargets = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets.decode(reader, reader.uint32()); - break; - } - case 3: { - if (!(message.asymmetricAutoscalingOptions && message.asymmetricAutoscalingOptions.length)) - message.asymmetricAutoscalingOptions = []; - message.asymmetricAutoscalingOptions.push($root.google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AutoscalingConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.instance.v1.AutoscalingConfig} AutoscalingConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AutoscalingConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AutoscalingConfig message. - * @function verify - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AutoscalingConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.autoscalingLimits != null && message.hasOwnProperty("autoscalingLimits")) { - var error = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits.verify(message.autoscalingLimits); - if (error) - return "autoscalingLimits." + error; - } - if (message.autoscalingTargets != null && message.hasOwnProperty("autoscalingTargets")) { - var error = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets.verify(message.autoscalingTargets); - if (error) - return "autoscalingTargets." + error; - } - if (message.asymmetricAutoscalingOptions != null && message.hasOwnProperty("asymmetricAutoscalingOptions")) { - if (!Array.isArray(message.asymmetricAutoscalingOptions)) - return "asymmetricAutoscalingOptions: array expected"; - for (var i = 0; i < message.asymmetricAutoscalingOptions.length; ++i) { - var error = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.verify(message.asymmetricAutoscalingOptions[i]); - if (error) - return "asymmetricAutoscalingOptions." + error; - } - } - return null; - }; - - /** - * Creates an AutoscalingConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.instance.v1.AutoscalingConfig} AutoscalingConfig - */ - AutoscalingConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.instance.v1.AutoscalingConfig) - return object; - var message = new $root.google.spanner.admin.instance.v1.AutoscalingConfig(); - if (object.autoscalingLimits != null) { - if (typeof object.autoscalingLimits !== "object") - throw TypeError(".google.spanner.admin.instance.v1.AutoscalingConfig.autoscalingLimits: object expected"); - message.autoscalingLimits = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits.fromObject(object.autoscalingLimits); - } - if (object.autoscalingTargets != null) { - if (typeof object.autoscalingTargets !== "object") - throw TypeError(".google.spanner.admin.instance.v1.AutoscalingConfig.autoscalingTargets: object expected"); - message.autoscalingTargets = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets.fromObject(object.autoscalingTargets); - } - if (object.asymmetricAutoscalingOptions) { - if (!Array.isArray(object.asymmetricAutoscalingOptions)) - throw TypeError(".google.spanner.admin.instance.v1.AutoscalingConfig.asymmetricAutoscalingOptions: array expected"); - message.asymmetricAutoscalingOptions = []; - for (var i = 0; i < object.asymmetricAutoscalingOptions.length; ++i) { - if (typeof object.asymmetricAutoscalingOptions[i] !== "object") - throw TypeError(".google.spanner.admin.instance.v1.AutoscalingConfig.asymmetricAutoscalingOptions: object expected"); - message.asymmetricAutoscalingOptions[i] = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.fromObject(object.asymmetricAutoscalingOptions[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an AutoscalingConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig - * @static - * @param {google.spanner.admin.instance.v1.AutoscalingConfig} message AutoscalingConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AutoscalingConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.asymmetricAutoscalingOptions = []; - if (options.defaults) { - object.autoscalingLimits = null; - object.autoscalingTargets = null; - } - if (message.autoscalingLimits != null && message.hasOwnProperty("autoscalingLimits")) - object.autoscalingLimits = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits.toObject(message.autoscalingLimits, options); - if (message.autoscalingTargets != null && message.hasOwnProperty("autoscalingTargets")) - object.autoscalingTargets = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets.toObject(message.autoscalingTargets, options); - if (message.asymmetricAutoscalingOptions && message.asymmetricAutoscalingOptions.length) { - object.asymmetricAutoscalingOptions = []; - for (var j = 0; j < message.asymmetricAutoscalingOptions.length; ++j) - object.asymmetricAutoscalingOptions[j] = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.toObject(message.asymmetricAutoscalingOptions[j], options); - } - return object; - }; - - /** - * Converts this AutoscalingConfig to JSON. - * @function toJSON - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig - * @instance - * @returns {Object.} JSON object - */ - AutoscalingConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AutoscalingConfig - * @function getTypeUrl - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AutoscalingConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.instance.v1.AutoscalingConfig"; - }; - - AutoscalingConfig.AutoscalingLimits = (function() { - - /** - * Properties of an AutoscalingLimits. - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig - * @interface IAutoscalingLimits - * @property {number|null} [minNodes] AutoscalingLimits minNodes - * @property {number|null} [minProcessingUnits] AutoscalingLimits minProcessingUnits - * @property {number|null} [maxNodes] AutoscalingLimits maxNodes - * @property {number|null} [maxProcessingUnits] AutoscalingLimits maxProcessingUnits - */ - - /** - * Constructs a new AutoscalingLimits. - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig - * @classdesc Represents an AutoscalingLimits. - * @implements IAutoscalingLimits - * @constructor - * @param {google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingLimits=} [properties] Properties to set - */ - function AutoscalingLimits(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AutoscalingLimits minNodes. - * @member {number|null|undefined} minNodes - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits - * @instance - */ - AutoscalingLimits.prototype.minNodes = null; - - /** - * AutoscalingLimits minProcessingUnits. - * @member {number|null|undefined} minProcessingUnits - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits - * @instance - */ - AutoscalingLimits.prototype.minProcessingUnits = null; - - /** - * AutoscalingLimits maxNodes. - * @member {number|null|undefined} maxNodes - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits - * @instance - */ - AutoscalingLimits.prototype.maxNodes = null; - - /** - * AutoscalingLimits maxProcessingUnits. - * @member {number|null|undefined} maxProcessingUnits - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits - * @instance - */ - AutoscalingLimits.prototype.maxProcessingUnits = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * AutoscalingLimits minLimit. - * @member {"minNodes"|"minProcessingUnits"|undefined} minLimit - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits - * @instance - */ - Object.defineProperty(AutoscalingLimits.prototype, "minLimit", { - get: $util.oneOfGetter($oneOfFields = ["minNodes", "minProcessingUnits"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * AutoscalingLimits maxLimit. - * @member {"maxNodes"|"maxProcessingUnits"|undefined} maxLimit - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits - * @instance - */ - Object.defineProperty(AutoscalingLimits.prototype, "maxLimit", { - get: $util.oneOfGetter($oneOfFields = ["maxNodes", "maxProcessingUnits"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new AutoscalingLimits instance using the specified properties. - * @function create - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits - * @static - * @param {google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingLimits=} [properties] Properties to set - * @returns {google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits} AutoscalingLimits instance - */ - AutoscalingLimits.create = function create(properties) { - return new AutoscalingLimits(properties); - }; - - /** - * Encodes the specified AutoscalingLimits message. Does not implicitly {@link google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits - * @static - * @param {google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingLimits} message AutoscalingLimits message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AutoscalingLimits.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.minNodes != null && Object.hasOwnProperty.call(message, "minNodes")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.minNodes); - if (message.minProcessingUnits != null && Object.hasOwnProperty.call(message, "minProcessingUnits")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.minProcessingUnits); - if (message.maxNodes != null && Object.hasOwnProperty.call(message, "maxNodes")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.maxNodes); - if (message.maxProcessingUnits != null && Object.hasOwnProperty.call(message, "maxProcessingUnits")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.maxProcessingUnits); - return writer; - }; - - /** - * Encodes the specified AutoscalingLimits message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits - * @static - * @param {google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingLimits} message AutoscalingLimits message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AutoscalingLimits.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AutoscalingLimits message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits} AutoscalingLimits - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AutoscalingLimits.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.minNodes = reader.int32(); - break; - } - case 2: { - message.minProcessingUnits = reader.int32(); - break; - } - case 3: { - message.maxNodes = reader.int32(); - break; - } - case 4: { - message.maxProcessingUnits = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AutoscalingLimits message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits} AutoscalingLimits - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AutoscalingLimits.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AutoscalingLimits message. - * @function verify - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AutoscalingLimits.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.minNodes != null && message.hasOwnProperty("minNodes")) { - properties.minLimit = 1; - if (!$util.isInteger(message.minNodes)) - return "minNodes: integer expected"; - } - if (message.minProcessingUnits != null && message.hasOwnProperty("minProcessingUnits")) { - if (properties.minLimit === 1) - return "minLimit: multiple values"; - properties.minLimit = 1; - if (!$util.isInteger(message.minProcessingUnits)) - return "minProcessingUnits: integer expected"; - } - if (message.maxNodes != null && message.hasOwnProperty("maxNodes")) { - properties.maxLimit = 1; - if (!$util.isInteger(message.maxNodes)) - return "maxNodes: integer expected"; - } - if (message.maxProcessingUnits != null && message.hasOwnProperty("maxProcessingUnits")) { - if (properties.maxLimit === 1) - return "maxLimit: multiple values"; - properties.maxLimit = 1; - if (!$util.isInteger(message.maxProcessingUnits)) - return "maxProcessingUnits: integer expected"; - } - return null; - }; - - /** - * Creates an AutoscalingLimits message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits} AutoscalingLimits - */ - AutoscalingLimits.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits) - return object; - var message = new $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits(); - if (object.minNodes != null) - message.minNodes = object.minNodes | 0; - if (object.minProcessingUnits != null) - message.minProcessingUnits = object.minProcessingUnits | 0; - if (object.maxNodes != null) - message.maxNodes = object.maxNodes | 0; - if (object.maxProcessingUnits != null) - message.maxProcessingUnits = object.maxProcessingUnits | 0; - return message; - }; - - /** - * Creates a plain object from an AutoscalingLimits message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits - * @static - * @param {google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits} message AutoscalingLimits - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AutoscalingLimits.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.minNodes != null && message.hasOwnProperty("minNodes")) { - object.minNodes = message.minNodes; - if (options.oneofs) - object.minLimit = "minNodes"; - } - if (message.minProcessingUnits != null && message.hasOwnProperty("minProcessingUnits")) { - object.minProcessingUnits = message.minProcessingUnits; - if (options.oneofs) - object.minLimit = "minProcessingUnits"; - } - if (message.maxNodes != null && message.hasOwnProperty("maxNodes")) { - object.maxNodes = message.maxNodes; - if (options.oneofs) - object.maxLimit = "maxNodes"; - } - if (message.maxProcessingUnits != null && message.hasOwnProperty("maxProcessingUnits")) { - object.maxProcessingUnits = message.maxProcessingUnits; - if (options.oneofs) - object.maxLimit = "maxProcessingUnits"; - } - return object; - }; - - /** - * Converts this AutoscalingLimits to JSON. - * @function toJSON - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits - * @instance - * @returns {Object.} JSON object - */ - AutoscalingLimits.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AutoscalingLimits - * @function getTypeUrl - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AutoscalingLimits.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits"; - }; - - return AutoscalingLimits; - })(); - - AutoscalingConfig.AutoscalingTargets = (function() { - - /** - * Properties of an AutoscalingTargets. - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig - * @interface IAutoscalingTargets - * @property {number|null} [highPriorityCpuUtilizationPercent] AutoscalingTargets highPriorityCpuUtilizationPercent - * @property {number|null} [totalCpuUtilizationPercent] AutoscalingTargets totalCpuUtilizationPercent - * @property {number|null} [storageUtilizationPercent] AutoscalingTargets storageUtilizationPercent - */ - - /** - * Constructs a new AutoscalingTargets. - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig - * @classdesc Represents an AutoscalingTargets. - * @implements IAutoscalingTargets - * @constructor - * @param {google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingTargets=} [properties] Properties to set - */ - function AutoscalingTargets(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AutoscalingTargets highPriorityCpuUtilizationPercent. - * @member {number} highPriorityCpuUtilizationPercent - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets - * @instance - */ - AutoscalingTargets.prototype.highPriorityCpuUtilizationPercent = 0; - - /** - * AutoscalingTargets totalCpuUtilizationPercent. - * @member {number} totalCpuUtilizationPercent - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets - * @instance - */ - AutoscalingTargets.prototype.totalCpuUtilizationPercent = 0; - - /** - * AutoscalingTargets storageUtilizationPercent. - * @member {number} storageUtilizationPercent - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets - * @instance - */ - AutoscalingTargets.prototype.storageUtilizationPercent = 0; - - /** - * Creates a new AutoscalingTargets instance using the specified properties. - * @function create - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets - * @static - * @param {google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingTargets=} [properties] Properties to set - * @returns {google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets} AutoscalingTargets instance - */ - AutoscalingTargets.create = function create(properties) { - return new AutoscalingTargets(properties); - }; - - /** - * Encodes the specified AutoscalingTargets message. Does not implicitly {@link google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets - * @static - * @param {google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingTargets} message AutoscalingTargets message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AutoscalingTargets.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.highPriorityCpuUtilizationPercent != null && Object.hasOwnProperty.call(message, "highPriorityCpuUtilizationPercent")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.highPriorityCpuUtilizationPercent); - if (message.storageUtilizationPercent != null && Object.hasOwnProperty.call(message, "storageUtilizationPercent")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.storageUtilizationPercent); - if (message.totalCpuUtilizationPercent != null && Object.hasOwnProperty.call(message, "totalCpuUtilizationPercent")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.totalCpuUtilizationPercent); - return writer; - }; - - /** - * Encodes the specified AutoscalingTargets message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets - * @static - * @param {google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingTargets} message AutoscalingTargets message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AutoscalingTargets.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AutoscalingTargets message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets} AutoscalingTargets - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AutoscalingTargets.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.highPriorityCpuUtilizationPercent = reader.int32(); - break; - } - case 4: { - message.totalCpuUtilizationPercent = reader.int32(); - break; - } - case 2: { - message.storageUtilizationPercent = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AutoscalingTargets message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets} AutoscalingTargets - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AutoscalingTargets.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AutoscalingTargets message. - * @function verify - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AutoscalingTargets.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.highPriorityCpuUtilizationPercent != null && message.hasOwnProperty("highPriorityCpuUtilizationPercent")) - if (!$util.isInteger(message.highPriorityCpuUtilizationPercent)) - return "highPriorityCpuUtilizationPercent: integer expected"; - if (message.totalCpuUtilizationPercent != null && message.hasOwnProperty("totalCpuUtilizationPercent")) - if (!$util.isInteger(message.totalCpuUtilizationPercent)) - return "totalCpuUtilizationPercent: integer expected"; - if (message.storageUtilizationPercent != null && message.hasOwnProperty("storageUtilizationPercent")) - if (!$util.isInteger(message.storageUtilizationPercent)) - return "storageUtilizationPercent: integer expected"; - return null; - }; - - /** - * Creates an AutoscalingTargets message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets} AutoscalingTargets - */ - AutoscalingTargets.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets) - return object; - var message = new $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets(); - if (object.highPriorityCpuUtilizationPercent != null) - message.highPriorityCpuUtilizationPercent = object.highPriorityCpuUtilizationPercent | 0; - if (object.totalCpuUtilizationPercent != null) - message.totalCpuUtilizationPercent = object.totalCpuUtilizationPercent | 0; - if (object.storageUtilizationPercent != null) - message.storageUtilizationPercent = object.storageUtilizationPercent | 0; - return message; - }; - - /** - * Creates a plain object from an AutoscalingTargets message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets - * @static - * @param {google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets} message AutoscalingTargets - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AutoscalingTargets.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.highPriorityCpuUtilizationPercent = 0; - object.storageUtilizationPercent = 0; - object.totalCpuUtilizationPercent = 0; - } - if (message.highPriorityCpuUtilizationPercent != null && message.hasOwnProperty("highPriorityCpuUtilizationPercent")) - object.highPriorityCpuUtilizationPercent = message.highPriorityCpuUtilizationPercent; - if (message.storageUtilizationPercent != null && message.hasOwnProperty("storageUtilizationPercent")) - object.storageUtilizationPercent = message.storageUtilizationPercent; - if (message.totalCpuUtilizationPercent != null && message.hasOwnProperty("totalCpuUtilizationPercent")) - object.totalCpuUtilizationPercent = message.totalCpuUtilizationPercent; - return object; - }; - - /** - * Converts this AutoscalingTargets to JSON. - * @function toJSON - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets - * @instance - * @returns {Object.} JSON object - */ - AutoscalingTargets.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AutoscalingTargets - * @function getTypeUrl - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AutoscalingTargets.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets"; - }; - - return AutoscalingTargets; - })(); - - AutoscalingConfig.AsymmetricAutoscalingOption = (function() { - - /** - * Properties of an AsymmetricAutoscalingOption. - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig - * @interface IAsymmetricAutoscalingOption - * @property {google.spanner.admin.instance.v1.IReplicaSelection|null} [replicaSelection] AsymmetricAutoscalingOption replicaSelection - * @property {google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.IAutoscalingConfigOverrides|null} [overrides] AsymmetricAutoscalingOption overrides - */ - - /** - * Constructs a new AsymmetricAutoscalingOption. - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig - * @classdesc Represents an AsymmetricAutoscalingOption. - * @implements IAsymmetricAutoscalingOption - * @constructor - * @param {google.spanner.admin.instance.v1.AutoscalingConfig.IAsymmetricAutoscalingOption=} [properties] Properties to set - */ - function AsymmetricAutoscalingOption(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AsymmetricAutoscalingOption replicaSelection. - * @member {google.spanner.admin.instance.v1.IReplicaSelection|null|undefined} replicaSelection - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption - * @instance - */ - AsymmetricAutoscalingOption.prototype.replicaSelection = null; - - /** - * AsymmetricAutoscalingOption overrides. - * @member {google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.IAutoscalingConfigOverrides|null|undefined} overrides - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption - * @instance - */ - AsymmetricAutoscalingOption.prototype.overrides = null; - - /** - * Creates a new AsymmetricAutoscalingOption instance using the specified properties. - * @function create - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption - * @static - * @param {google.spanner.admin.instance.v1.AutoscalingConfig.IAsymmetricAutoscalingOption=} [properties] Properties to set - * @returns {google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption} AsymmetricAutoscalingOption instance - */ - AsymmetricAutoscalingOption.create = function create(properties) { - return new AsymmetricAutoscalingOption(properties); - }; - - /** - * Encodes the specified AsymmetricAutoscalingOption message. Does not implicitly {@link google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption - * @static - * @param {google.spanner.admin.instance.v1.AutoscalingConfig.IAsymmetricAutoscalingOption} message AsymmetricAutoscalingOption message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AsymmetricAutoscalingOption.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.replicaSelection != null && Object.hasOwnProperty.call(message, "replicaSelection")) - $root.google.spanner.admin.instance.v1.ReplicaSelection.encode(message.replicaSelection, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.overrides != null && Object.hasOwnProperty.call(message, "overrides")) - $root.google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides.encode(message.overrides, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified AsymmetricAutoscalingOption message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption - * @static - * @param {google.spanner.admin.instance.v1.AutoscalingConfig.IAsymmetricAutoscalingOption} message AsymmetricAutoscalingOption message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AsymmetricAutoscalingOption.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AsymmetricAutoscalingOption message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption} AsymmetricAutoscalingOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AsymmetricAutoscalingOption.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.replicaSelection = $root.google.spanner.admin.instance.v1.ReplicaSelection.decode(reader, reader.uint32()); - break; - } - case 2: { - message.overrides = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AsymmetricAutoscalingOption message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption} AsymmetricAutoscalingOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AsymmetricAutoscalingOption.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AsymmetricAutoscalingOption message. - * @function verify - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AsymmetricAutoscalingOption.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.replicaSelection != null && message.hasOwnProperty("replicaSelection")) { - var error = $root.google.spanner.admin.instance.v1.ReplicaSelection.verify(message.replicaSelection); - if (error) - return "replicaSelection." + error; - } - if (message.overrides != null && message.hasOwnProperty("overrides")) { - var error = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides.verify(message.overrides); - if (error) - return "overrides." + error; - } - return null; - }; - - /** - * Creates an AsymmetricAutoscalingOption message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption} AsymmetricAutoscalingOption - */ - AsymmetricAutoscalingOption.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption) - return object; - var message = new $root.google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption(); - if (object.replicaSelection != null) { - if (typeof object.replicaSelection !== "object") - throw TypeError(".google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.replicaSelection: object expected"); - message.replicaSelection = $root.google.spanner.admin.instance.v1.ReplicaSelection.fromObject(object.replicaSelection); - } - if (object.overrides != null) { - if (typeof object.overrides !== "object") - throw TypeError(".google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.overrides: object expected"); - message.overrides = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides.fromObject(object.overrides); - } - return message; - }; - - /** - * Creates a plain object from an AsymmetricAutoscalingOption message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption - * @static - * @param {google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption} message AsymmetricAutoscalingOption - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AsymmetricAutoscalingOption.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.replicaSelection = null; - object.overrides = null; - } - if (message.replicaSelection != null && message.hasOwnProperty("replicaSelection")) - object.replicaSelection = $root.google.spanner.admin.instance.v1.ReplicaSelection.toObject(message.replicaSelection, options); - if (message.overrides != null && message.hasOwnProperty("overrides")) - object.overrides = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides.toObject(message.overrides, options); - return object; - }; - - /** - * Converts this AsymmetricAutoscalingOption to JSON. - * @function toJSON - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption - * @instance - * @returns {Object.} JSON object - */ - AsymmetricAutoscalingOption.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AsymmetricAutoscalingOption - * @function getTypeUrl - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AsymmetricAutoscalingOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption"; - }; - - AsymmetricAutoscalingOption.AutoscalingConfigOverrides = (function() { - - /** - * Properties of an AutoscalingConfigOverrides. - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption - * @interface IAutoscalingConfigOverrides - * @property {google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingLimits|null} [autoscalingLimits] AutoscalingConfigOverrides autoscalingLimits - * @property {number|null} [autoscalingTargetHighPriorityCpuUtilizationPercent] AutoscalingConfigOverrides autoscalingTargetHighPriorityCpuUtilizationPercent - * @property {number|null} [autoscalingTargetTotalCpuUtilizationPercent] AutoscalingConfigOverrides autoscalingTargetTotalCpuUtilizationPercent - * @property {boolean|null} [disableHighPriorityCpuAutoscaling] AutoscalingConfigOverrides disableHighPriorityCpuAutoscaling - * @property {boolean|null} [disableTotalCpuAutoscaling] AutoscalingConfigOverrides disableTotalCpuAutoscaling - */ - - /** - * Constructs a new AutoscalingConfigOverrides. - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption - * @classdesc Represents an AutoscalingConfigOverrides. - * @implements IAutoscalingConfigOverrides - * @constructor - * @param {google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.IAutoscalingConfigOverrides=} [properties] Properties to set - */ - function AutoscalingConfigOverrides(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AutoscalingConfigOverrides autoscalingLimits. - * @member {google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingLimits|null|undefined} autoscalingLimits - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides - * @instance - */ - AutoscalingConfigOverrides.prototype.autoscalingLimits = null; - - /** - * AutoscalingConfigOverrides autoscalingTargetHighPriorityCpuUtilizationPercent. - * @member {number} autoscalingTargetHighPriorityCpuUtilizationPercent - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides - * @instance - */ - AutoscalingConfigOverrides.prototype.autoscalingTargetHighPriorityCpuUtilizationPercent = 0; - - /** - * AutoscalingConfigOverrides autoscalingTargetTotalCpuUtilizationPercent. - * @member {number} autoscalingTargetTotalCpuUtilizationPercent - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides - * @instance - */ - AutoscalingConfigOverrides.prototype.autoscalingTargetTotalCpuUtilizationPercent = 0; - - /** - * AutoscalingConfigOverrides disableHighPriorityCpuAutoscaling. - * @member {boolean} disableHighPriorityCpuAutoscaling - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides - * @instance - */ - AutoscalingConfigOverrides.prototype.disableHighPriorityCpuAutoscaling = false; - - /** - * AutoscalingConfigOverrides disableTotalCpuAutoscaling. - * @member {boolean} disableTotalCpuAutoscaling - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides - * @instance - */ - AutoscalingConfigOverrides.prototype.disableTotalCpuAutoscaling = false; - - /** - * Creates a new AutoscalingConfigOverrides instance using the specified properties. - * @function create - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides - * @static - * @param {google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.IAutoscalingConfigOverrides=} [properties] Properties to set - * @returns {google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides} AutoscalingConfigOverrides instance - */ - AutoscalingConfigOverrides.create = function create(properties) { - return new AutoscalingConfigOverrides(properties); - }; - - /** - * Encodes the specified AutoscalingConfigOverrides message. Does not implicitly {@link google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides - * @static - * @param {google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.IAutoscalingConfigOverrides} message AutoscalingConfigOverrides message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AutoscalingConfigOverrides.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.autoscalingLimits != null && Object.hasOwnProperty.call(message, "autoscalingLimits")) - $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits.encode(message.autoscalingLimits, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.autoscalingTargetHighPriorityCpuUtilizationPercent != null && Object.hasOwnProperty.call(message, "autoscalingTargetHighPriorityCpuUtilizationPercent")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.autoscalingTargetHighPriorityCpuUtilizationPercent); - if (message.autoscalingTargetTotalCpuUtilizationPercent != null && Object.hasOwnProperty.call(message, "autoscalingTargetTotalCpuUtilizationPercent")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.autoscalingTargetTotalCpuUtilizationPercent); - if (message.disableHighPriorityCpuAutoscaling != null && Object.hasOwnProperty.call(message, "disableHighPriorityCpuAutoscaling")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.disableHighPriorityCpuAutoscaling); - if (message.disableTotalCpuAutoscaling != null && Object.hasOwnProperty.call(message, "disableTotalCpuAutoscaling")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.disableTotalCpuAutoscaling); - return writer; - }; - - /** - * Encodes the specified AutoscalingConfigOverrides message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides - * @static - * @param {google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.IAutoscalingConfigOverrides} message AutoscalingConfigOverrides message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AutoscalingConfigOverrides.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AutoscalingConfigOverrides message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides} AutoscalingConfigOverrides - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AutoscalingConfigOverrides.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.autoscalingLimits = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits.decode(reader, reader.uint32()); - break; - } - case 2: { - message.autoscalingTargetHighPriorityCpuUtilizationPercent = reader.int32(); - break; - } - case 4: { - message.autoscalingTargetTotalCpuUtilizationPercent = reader.int32(); - break; - } - case 5: { - message.disableHighPriorityCpuAutoscaling = reader.bool(); - break; - } - case 6: { - message.disableTotalCpuAutoscaling = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AutoscalingConfigOverrides message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides} AutoscalingConfigOverrides - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AutoscalingConfigOverrides.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AutoscalingConfigOverrides message. - * @function verify - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AutoscalingConfigOverrides.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.autoscalingLimits != null && message.hasOwnProperty("autoscalingLimits")) { - var error = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits.verify(message.autoscalingLimits); - if (error) - return "autoscalingLimits." + error; - } - if (message.autoscalingTargetHighPriorityCpuUtilizationPercent != null && message.hasOwnProperty("autoscalingTargetHighPriorityCpuUtilizationPercent")) - if (!$util.isInteger(message.autoscalingTargetHighPriorityCpuUtilizationPercent)) - return "autoscalingTargetHighPriorityCpuUtilizationPercent: integer expected"; - if (message.autoscalingTargetTotalCpuUtilizationPercent != null && message.hasOwnProperty("autoscalingTargetTotalCpuUtilizationPercent")) - if (!$util.isInteger(message.autoscalingTargetTotalCpuUtilizationPercent)) - return "autoscalingTargetTotalCpuUtilizationPercent: integer expected"; - if (message.disableHighPriorityCpuAutoscaling != null && message.hasOwnProperty("disableHighPriorityCpuAutoscaling")) - if (typeof message.disableHighPriorityCpuAutoscaling !== "boolean") - return "disableHighPriorityCpuAutoscaling: boolean expected"; - if (message.disableTotalCpuAutoscaling != null && message.hasOwnProperty("disableTotalCpuAutoscaling")) - if (typeof message.disableTotalCpuAutoscaling !== "boolean") - return "disableTotalCpuAutoscaling: boolean expected"; - return null; - }; - - /** - * Creates an AutoscalingConfigOverrides message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides} AutoscalingConfigOverrides - */ - AutoscalingConfigOverrides.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides) - return object; - var message = new $root.google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides(); - if (object.autoscalingLimits != null) { - if (typeof object.autoscalingLimits !== "object") - throw TypeError(".google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides.autoscalingLimits: object expected"); - message.autoscalingLimits = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits.fromObject(object.autoscalingLimits); - } - if (object.autoscalingTargetHighPriorityCpuUtilizationPercent != null) - message.autoscalingTargetHighPriorityCpuUtilizationPercent = object.autoscalingTargetHighPriorityCpuUtilizationPercent | 0; - if (object.autoscalingTargetTotalCpuUtilizationPercent != null) - message.autoscalingTargetTotalCpuUtilizationPercent = object.autoscalingTargetTotalCpuUtilizationPercent | 0; - if (object.disableHighPriorityCpuAutoscaling != null) - message.disableHighPriorityCpuAutoscaling = Boolean(object.disableHighPriorityCpuAutoscaling); - if (object.disableTotalCpuAutoscaling != null) - message.disableTotalCpuAutoscaling = Boolean(object.disableTotalCpuAutoscaling); - return message; - }; - - /** - * Creates a plain object from an AutoscalingConfigOverrides message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides - * @static - * @param {google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides} message AutoscalingConfigOverrides - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AutoscalingConfigOverrides.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.autoscalingLimits = null; - object.autoscalingTargetHighPriorityCpuUtilizationPercent = 0; - object.autoscalingTargetTotalCpuUtilizationPercent = 0; - object.disableHighPriorityCpuAutoscaling = false; - object.disableTotalCpuAutoscaling = false; - } - if (message.autoscalingLimits != null && message.hasOwnProperty("autoscalingLimits")) - object.autoscalingLimits = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits.toObject(message.autoscalingLimits, options); - if (message.autoscalingTargetHighPriorityCpuUtilizationPercent != null && message.hasOwnProperty("autoscalingTargetHighPriorityCpuUtilizationPercent")) - object.autoscalingTargetHighPriorityCpuUtilizationPercent = message.autoscalingTargetHighPriorityCpuUtilizationPercent; - if (message.autoscalingTargetTotalCpuUtilizationPercent != null && message.hasOwnProperty("autoscalingTargetTotalCpuUtilizationPercent")) - object.autoscalingTargetTotalCpuUtilizationPercent = message.autoscalingTargetTotalCpuUtilizationPercent; - if (message.disableHighPriorityCpuAutoscaling != null && message.hasOwnProperty("disableHighPriorityCpuAutoscaling")) - object.disableHighPriorityCpuAutoscaling = message.disableHighPriorityCpuAutoscaling; - if (message.disableTotalCpuAutoscaling != null && message.hasOwnProperty("disableTotalCpuAutoscaling")) - object.disableTotalCpuAutoscaling = message.disableTotalCpuAutoscaling; - return object; - }; - - /** - * Converts this AutoscalingConfigOverrides to JSON. - * @function toJSON - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides - * @instance - * @returns {Object.} JSON object - */ - AutoscalingConfigOverrides.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AutoscalingConfigOverrides - * @function getTypeUrl - * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AutoscalingConfigOverrides.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides"; - }; - - return AutoscalingConfigOverrides; - })(); - - return AsymmetricAutoscalingOption; - })(); - - return AutoscalingConfig; - })(); - - v1.Instance = (function() { - - /** - * Properties of an Instance. - * @memberof google.spanner.admin.instance.v1 - * @interface IInstance - * @property {string|null} [name] Instance name - * @property {string|null} [config] Instance config - * @property {string|null} [displayName] Instance displayName - * @property {number|null} [nodeCount] Instance nodeCount - * @property {number|null} [processingUnits] Instance processingUnits - * @property {Array.|null} [replicaComputeCapacity] Instance replicaComputeCapacity - * @property {google.spanner.admin.instance.v1.IAutoscalingConfig|null} [autoscalingConfig] Instance autoscalingConfig - * @property {google.spanner.admin.instance.v1.Instance.State|null} [state] Instance state - * @property {Object.|null} [labels] Instance labels - * @property {google.spanner.admin.instance.v1.Instance.InstanceType|null} [instanceType] Instance instanceType - * @property {Array.|null} [endpointUris] Instance endpointUris - * @property {google.protobuf.ITimestamp|null} [createTime] Instance createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] Instance updateTime - * @property {google.spanner.admin.instance.v1.IFreeInstanceMetadata|null} [freeInstanceMetadata] Instance freeInstanceMetadata - * @property {google.spanner.admin.instance.v1.Instance.Edition|null} [edition] Instance edition - * @property {google.spanner.admin.instance.v1.Instance.DefaultBackupScheduleType|null} [defaultBackupScheduleType] Instance defaultBackupScheduleType - */ - - /** - * Constructs a new Instance. - * @memberof google.spanner.admin.instance.v1 - * @classdesc Represents an Instance. - * @implements IInstance - * @constructor - * @param {google.spanner.admin.instance.v1.IInstance=} [properties] Properties to set - */ - function Instance(properties) { - this.replicaComputeCapacity = []; - this.labels = {}; - this.endpointUris = []; - if (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.spanner.admin.instance.v1.Instance - * @instance - */ - Instance.prototype.name = ""; - - /** - * Instance config. - * @member {string} config - * @memberof google.spanner.admin.instance.v1.Instance - * @instance - */ - Instance.prototype.config = ""; - - /** - * Instance displayName. - * @member {string} displayName - * @memberof google.spanner.admin.instance.v1.Instance - * @instance - */ - Instance.prototype.displayName = ""; - - /** - * Instance nodeCount. - * @member {number} nodeCount - * @memberof google.spanner.admin.instance.v1.Instance - * @instance - */ - Instance.prototype.nodeCount = 0; - - /** - * Instance processingUnits. - * @member {number} processingUnits - * @memberof google.spanner.admin.instance.v1.Instance - * @instance - */ - Instance.prototype.processingUnits = 0; - - /** - * Instance replicaComputeCapacity. - * @member {Array.} replicaComputeCapacity - * @memberof google.spanner.admin.instance.v1.Instance - * @instance - */ - Instance.prototype.replicaComputeCapacity = $util.emptyArray; - - /** - * Instance autoscalingConfig. - * @member {google.spanner.admin.instance.v1.IAutoscalingConfig|null|undefined} autoscalingConfig - * @memberof google.spanner.admin.instance.v1.Instance - * @instance - */ - Instance.prototype.autoscalingConfig = null; - - /** - * Instance state. - * @member {google.spanner.admin.instance.v1.Instance.State} state - * @memberof google.spanner.admin.instance.v1.Instance - * @instance - */ - Instance.prototype.state = 0; - - /** - * Instance labels. - * @member {Object.} labels - * @memberof google.spanner.admin.instance.v1.Instance - * @instance - */ - Instance.prototype.labels = $util.emptyObject; - - /** - * Instance instanceType. - * @member {google.spanner.admin.instance.v1.Instance.InstanceType} instanceType - * @memberof google.spanner.admin.instance.v1.Instance - * @instance - */ - Instance.prototype.instanceType = 0; - - /** - * Instance endpointUris. - * @member {Array.} endpointUris - * @memberof google.spanner.admin.instance.v1.Instance - * @instance - */ - Instance.prototype.endpointUris = $util.emptyArray; - - /** - * Instance createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.spanner.admin.instance.v1.Instance - * @instance - */ - Instance.prototype.createTime = null; - - /** - * Instance updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.spanner.admin.instance.v1.Instance - * @instance - */ - Instance.prototype.updateTime = null; - - /** - * Instance freeInstanceMetadata. - * @member {google.spanner.admin.instance.v1.IFreeInstanceMetadata|null|undefined} freeInstanceMetadata - * @memberof google.spanner.admin.instance.v1.Instance - * @instance - */ - Instance.prototype.freeInstanceMetadata = null; - - /** - * Instance edition. - * @member {google.spanner.admin.instance.v1.Instance.Edition} edition - * @memberof google.spanner.admin.instance.v1.Instance - * @instance - */ - Instance.prototype.edition = 0; - - /** - * Instance defaultBackupScheduleType. - * @member {google.spanner.admin.instance.v1.Instance.DefaultBackupScheduleType} defaultBackupScheduleType - * @memberof google.spanner.admin.instance.v1.Instance - * @instance - */ - Instance.prototype.defaultBackupScheduleType = 0; - - /** - * Creates a new Instance instance using the specified properties. - * @function create - * @memberof google.spanner.admin.instance.v1.Instance - * @static - * @param {google.spanner.admin.instance.v1.IInstance=} [properties] Properties to set - * @returns {google.spanner.admin.instance.v1.Instance} Instance instance - */ - Instance.create = function create(properties) { - return new Instance(properties); - }; - - /** - * Encodes the specified Instance message. Does not implicitly {@link google.spanner.admin.instance.v1.Instance.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.instance.v1.Instance - * @static - * @param {google.spanner.admin.instance.v1.IInstance} message Instance message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Instance.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.config != null && Object.hasOwnProperty.call(message, "config")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.config); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.displayName); - if (message.nodeCount != null && Object.hasOwnProperty.call(message, "nodeCount")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.nodeCount); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.state); - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.endpointUris != null && message.endpointUris.length) - for (var i = 0; i < message.endpointUris.length; ++i) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.endpointUris[i]); - if (message.processingUnits != null && Object.hasOwnProperty.call(message, "processingUnits")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.processingUnits); - if (message.instanceType != null && Object.hasOwnProperty.call(message, "instanceType")) - writer.uint32(/* id 10, wireType 0 =*/80).int32(message.instanceType); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - if (message.freeInstanceMetadata != null && Object.hasOwnProperty.call(message, "freeInstanceMetadata")) - $root.google.spanner.admin.instance.v1.FreeInstanceMetadata.encode(message.freeInstanceMetadata, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); - if (message.autoscalingConfig != null && Object.hasOwnProperty.call(message, "autoscalingConfig")) - $root.google.spanner.admin.instance.v1.AutoscalingConfig.encode(message.autoscalingConfig, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); - if (message.replicaComputeCapacity != null && message.replicaComputeCapacity.length) - for (var i = 0; i < message.replicaComputeCapacity.length; ++i) - $root.google.spanner.admin.instance.v1.ReplicaComputeCapacity.encode(message.replicaComputeCapacity[i], writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); - if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) - writer.uint32(/* id 20, wireType 0 =*/160).int32(message.edition); - if (message.defaultBackupScheduleType != null && Object.hasOwnProperty.call(message, "defaultBackupScheduleType")) - writer.uint32(/* id 23, wireType 0 =*/184).int32(message.defaultBackupScheduleType); - return writer; - }; - - /** - * Encodes the specified Instance message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.Instance.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.instance.v1.Instance - * @static - * @param {google.spanner.admin.instance.v1.IInstance} message Instance message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Instance.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Instance message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.instance.v1.Instance - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.instance.v1.Instance} Instance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Instance.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.Instance(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.config = reader.string(); - break; - } - case 3: { - message.displayName = reader.string(); - break; - } - case 5: { - message.nodeCount = reader.int32(); - break; - } - case 9: { - message.processingUnits = reader.int32(); - break; - } - case 19: { - if (!(message.replicaComputeCapacity && message.replicaComputeCapacity.length)) - message.replicaComputeCapacity = []; - message.replicaComputeCapacity.push($root.google.spanner.admin.instance.v1.ReplicaComputeCapacity.decode(reader, reader.uint32())); - break; - } - case 17: { - message.autoscalingConfig = $root.google.spanner.admin.instance.v1.AutoscalingConfig.decode(reader, reader.uint32()); - break; - } - case 6: { - message.state = reader.int32(); - break; - } - case 7: { - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.labels[key] = value; - break; - } - case 10: { - message.instanceType = reader.int32(); - break; - } - case 8: { - if (!(message.endpointUris && message.endpointUris.length)) - message.endpointUris = []; - message.endpointUris.push(reader.string()); - break; - } - case 11: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 12: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 13: { - message.freeInstanceMetadata = $root.google.spanner.admin.instance.v1.FreeInstanceMetadata.decode(reader, reader.uint32()); - break; - } - case 20: { - message.edition = reader.int32(); - break; - } - case 23: { - message.defaultBackupScheduleType = reader.int32(); - 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.spanner.admin.instance.v1.Instance - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.instance.v1.Instance} Instance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Instance.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Instance message. - * @function verify - * @memberof google.spanner.admin.instance.v1.Instance - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Instance.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.config != null && message.hasOwnProperty("config")) - if (!$util.isString(message.config)) - return "config: string expected"; - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) - if (!$util.isInteger(message.nodeCount)) - return "nodeCount: integer expected"; - if (message.processingUnits != null && message.hasOwnProperty("processingUnits")) - if (!$util.isInteger(message.processingUnits)) - return "processingUnits: integer expected"; - if (message.replicaComputeCapacity != null && message.hasOwnProperty("replicaComputeCapacity")) { - if (!Array.isArray(message.replicaComputeCapacity)) - return "replicaComputeCapacity: array expected"; - for (var i = 0; i < message.replicaComputeCapacity.length; ++i) { - var error = $root.google.spanner.admin.instance.v1.ReplicaComputeCapacity.verify(message.replicaComputeCapacity[i]); - if (error) - return "replicaComputeCapacity." + error; - } - } - if (message.autoscalingConfig != null && message.hasOwnProperty("autoscalingConfig")) { - var error = $root.google.spanner.admin.instance.v1.AutoscalingConfig.verify(message.autoscalingConfig); - if (error) - return "autoscalingConfig." + 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.labels != null && message.hasOwnProperty("labels")) { - if (!$util.isObject(message.labels)) - return "labels: object expected"; - var key = Object.keys(message.labels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.labels[key[i]])) - return "labels: string{k:string} expected"; - } - if (message.instanceType != null && message.hasOwnProperty("instanceType")) - switch (message.instanceType) { - default: - return "instanceType: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.endpointUris != null && message.hasOwnProperty("endpointUris")) { - if (!Array.isArray(message.endpointUris)) - return "endpointUris: array expected"; - for (var i = 0; i < message.endpointUris.length; ++i) - if (!$util.isString(message.endpointUris[i])) - return "endpointUris: string[] expected"; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); - if (error) - return "updateTime." + error; - } - if (message.freeInstanceMetadata != null && message.hasOwnProperty("freeInstanceMetadata")) { - var error = $root.google.spanner.admin.instance.v1.FreeInstanceMetadata.verify(message.freeInstanceMetadata); - if (error) - return "freeInstanceMetadata." + error; - } - if (message.edition != null && message.hasOwnProperty("edition")) - switch (message.edition) { - default: - return "edition: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.defaultBackupScheduleType != null && message.hasOwnProperty("defaultBackupScheduleType")) - switch (message.defaultBackupScheduleType) { - default: - return "defaultBackupScheduleType: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates an Instance message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.instance.v1.Instance - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.instance.v1.Instance} Instance - */ - Instance.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.instance.v1.Instance) - return object; - var message = new $root.google.spanner.admin.instance.v1.Instance(); - if (object.name != null) - message.name = String(object.name); - if (object.config != null) - message.config = String(object.config); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.nodeCount != null) - message.nodeCount = object.nodeCount | 0; - if (object.processingUnits != null) - message.processingUnits = object.processingUnits | 0; - if (object.replicaComputeCapacity) { - if (!Array.isArray(object.replicaComputeCapacity)) - throw TypeError(".google.spanner.admin.instance.v1.Instance.replicaComputeCapacity: array expected"); - message.replicaComputeCapacity = []; - for (var i = 0; i < object.replicaComputeCapacity.length; ++i) { - if (typeof object.replicaComputeCapacity[i] !== "object") - throw TypeError(".google.spanner.admin.instance.v1.Instance.replicaComputeCapacity: object expected"); - message.replicaComputeCapacity[i] = $root.google.spanner.admin.instance.v1.ReplicaComputeCapacity.fromObject(object.replicaComputeCapacity[i]); - } - } - if (object.autoscalingConfig != null) { - if (typeof object.autoscalingConfig !== "object") - throw TypeError(".google.spanner.admin.instance.v1.Instance.autoscalingConfig: object expected"); - message.autoscalingConfig = $root.google.spanner.admin.instance.v1.AutoscalingConfig.fromObject(object.autoscalingConfig); - } - switch (object.state) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "CREATING": - case 1: - message.state = 1; - break; - case "READY": - case 2: - message.state = 2; - break; - } - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.spanner.admin.instance.v1.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]]); - } - switch (object.instanceType) { - default: - if (typeof object.instanceType === "number") { - message.instanceType = object.instanceType; - break; - } - break; - case "INSTANCE_TYPE_UNSPECIFIED": - case 0: - message.instanceType = 0; - break; - case "PROVISIONED": - case 1: - message.instanceType = 1; - break; - case "FREE_INSTANCE": - case 2: - message.instanceType = 2; - break; - } - if (object.endpointUris) { - if (!Array.isArray(object.endpointUris)) - throw TypeError(".google.spanner.admin.instance.v1.Instance.endpointUris: array expected"); - message.endpointUris = []; - for (var i = 0; i < object.endpointUris.length; ++i) - message.endpointUris[i] = String(object.endpointUris[i]); - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.spanner.admin.instance.v1.Instance.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.updateTime != null) { - if (typeof object.updateTime !== "object") - throw TypeError(".google.spanner.admin.instance.v1.Instance.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.freeInstanceMetadata != null) { - if (typeof object.freeInstanceMetadata !== "object") - throw TypeError(".google.spanner.admin.instance.v1.Instance.freeInstanceMetadata: object expected"); - message.freeInstanceMetadata = $root.google.spanner.admin.instance.v1.FreeInstanceMetadata.fromObject(object.freeInstanceMetadata); - } - switch (object.edition) { - default: - if (typeof object.edition === "number") { - message.edition = object.edition; - break; - } - break; - case "EDITION_UNSPECIFIED": - case 0: - message.edition = 0; - break; - case "STANDARD": - case 1: - message.edition = 1; - break; - case "ENTERPRISE": - case 2: - message.edition = 2; - break; - case "ENTERPRISE_PLUS": - case 3: - message.edition = 3; - break; - } - switch (object.defaultBackupScheduleType) { - default: - if (typeof object.defaultBackupScheduleType === "number") { - message.defaultBackupScheduleType = object.defaultBackupScheduleType; - break; - } - break; - case "DEFAULT_BACKUP_SCHEDULE_TYPE_UNSPECIFIED": - case 0: - message.defaultBackupScheduleType = 0; - break; - case "NONE": - case 1: - message.defaultBackupScheduleType = 1; - break; - case "AUTOMATIC": - case 2: - message.defaultBackupScheduleType = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from an Instance message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.instance.v1.Instance - * @static - * @param {google.spanner.admin.instance.v1.Instance} message Instance - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Instance.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.endpointUris = []; - object.replicaComputeCapacity = []; - } - if (options.objects || options.defaults) - object.labels = {}; - if (options.defaults) { - object.name = ""; - object.config = ""; - object.displayName = ""; - object.nodeCount = 0; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.processingUnits = 0; - object.instanceType = options.enums === String ? "INSTANCE_TYPE_UNSPECIFIED" : 0; - object.createTime = null; - object.updateTime = null; - object.freeInstanceMetadata = null; - object.autoscalingConfig = null; - object.edition = options.enums === String ? "EDITION_UNSPECIFIED" : 0; - object.defaultBackupScheduleType = options.enums === String ? "DEFAULT_BACKUP_SCHEDULE_TYPE_UNSPECIFIED" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.config != null && message.hasOwnProperty("config")) - object.config = message.config; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) - object.nodeCount = message.nodeCount; - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.spanner.admin.instance.v1.Instance.State[message.state] === undefined ? message.state : $root.google.spanner.admin.instance.v1.Instance.State[message.state] : message.state; - 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.endpointUris && message.endpointUris.length) { - object.endpointUris = []; - for (var j = 0; j < message.endpointUris.length; ++j) - object.endpointUris[j] = message.endpointUris[j]; - } - if (message.processingUnits != null && message.hasOwnProperty("processingUnits")) - object.processingUnits = message.processingUnits; - if (message.instanceType != null && message.hasOwnProperty("instanceType")) - object.instanceType = options.enums === String ? $root.google.spanner.admin.instance.v1.Instance.InstanceType[message.instanceType] === undefined ? message.instanceType : $root.google.spanner.admin.instance.v1.Instance.InstanceType[message.instanceType] : message.instanceType; - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.updateTime != null && message.hasOwnProperty("updateTime")) - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); - if (message.freeInstanceMetadata != null && message.hasOwnProperty("freeInstanceMetadata")) - object.freeInstanceMetadata = $root.google.spanner.admin.instance.v1.FreeInstanceMetadata.toObject(message.freeInstanceMetadata, options); - if (message.autoscalingConfig != null && message.hasOwnProperty("autoscalingConfig")) - object.autoscalingConfig = $root.google.spanner.admin.instance.v1.AutoscalingConfig.toObject(message.autoscalingConfig, options); - if (message.replicaComputeCapacity && message.replicaComputeCapacity.length) { - object.replicaComputeCapacity = []; - for (var j = 0; j < message.replicaComputeCapacity.length; ++j) - object.replicaComputeCapacity[j] = $root.google.spanner.admin.instance.v1.ReplicaComputeCapacity.toObject(message.replicaComputeCapacity[j], options); - } - if (message.edition != null && message.hasOwnProperty("edition")) - object.edition = options.enums === String ? $root.google.spanner.admin.instance.v1.Instance.Edition[message.edition] === undefined ? message.edition : $root.google.spanner.admin.instance.v1.Instance.Edition[message.edition] : message.edition; - if (message.defaultBackupScheduleType != null && message.hasOwnProperty("defaultBackupScheduleType")) - object.defaultBackupScheduleType = options.enums === String ? $root.google.spanner.admin.instance.v1.Instance.DefaultBackupScheduleType[message.defaultBackupScheduleType] === undefined ? message.defaultBackupScheduleType : $root.google.spanner.admin.instance.v1.Instance.DefaultBackupScheduleType[message.defaultBackupScheduleType] : message.defaultBackupScheduleType; - return object; - }; - - /** - * Converts this Instance to JSON. - * @function toJSON - * @memberof google.spanner.admin.instance.v1.Instance - * @instance - * @returns {Object.} JSON object - */ - Instance.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Instance - * @function getTypeUrl - * @memberof google.spanner.admin.instance.v1.Instance - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Instance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.instance.v1.Instance"; - }; - - /** - * State enum. - * @name google.spanner.admin.instance.v1.Instance.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} CREATING=1 CREATING value - * @property {number} READY=2 READY value - */ - Instance.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "CREATING"] = 1; - values[valuesById[2] = "READY"] = 2; - return values; - })(); - - /** - * InstanceType enum. - * @name google.spanner.admin.instance.v1.Instance.InstanceType - * @enum {number} - * @property {number} INSTANCE_TYPE_UNSPECIFIED=0 INSTANCE_TYPE_UNSPECIFIED value - * @property {number} PROVISIONED=1 PROVISIONED value - * @property {number} FREE_INSTANCE=2 FREE_INSTANCE value - */ - Instance.InstanceType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "INSTANCE_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "PROVISIONED"] = 1; - values[valuesById[2] = "FREE_INSTANCE"] = 2; - return values; - })(); - - /** - * Edition enum. - * @name google.spanner.admin.instance.v1.Instance.Edition - * @enum {number} - * @property {number} EDITION_UNSPECIFIED=0 EDITION_UNSPECIFIED value - * @property {number} STANDARD=1 STANDARD value - * @property {number} ENTERPRISE=2 ENTERPRISE value - * @property {number} ENTERPRISE_PLUS=3 ENTERPRISE_PLUS value - */ - Instance.Edition = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "EDITION_UNSPECIFIED"] = 0; - values[valuesById[1] = "STANDARD"] = 1; - values[valuesById[2] = "ENTERPRISE"] = 2; - values[valuesById[3] = "ENTERPRISE_PLUS"] = 3; - return values; - })(); - - /** - * DefaultBackupScheduleType enum. - * @name google.spanner.admin.instance.v1.Instance.DefaultBackupScheduleType - * @enum {number} - * @property {number} DEFAULT_BACKUP_SCHEDULE_TYPE_UNSPECIFIED=0 DEFAULT_BACKUP_SCHEDULE_TYPE_UNSPECIFIED value - * @property {number} NONE=1 NONE value - * @property {number} AUTOMATIC=2 AUTOMATIC value - */ - Instance.DefaultBackupScheduleType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "DEFAULT_BACKUP_SCHEDULE_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "NONE"] = 1; - values[valuesById[2] = "AUTOMATIC"] = 2; - return values; - })(); - - return Instance; - })(); - - v1.ListInstanceConfigsRequest = (function() { - - /** - * Properties of a ListInstanceConfigsRequest. - * @memberof google.spanner.admin.instance.v1 - * @interface IListInstanceConfigsRequest - * @property {string|null} [parent] ListInstanceConfigsRequest parent - * @property {number|null} [pageSize] ListInstanceConfigsRequest pageSize - * @property {string|null} [pageToken] ListInstanceConfigsRequest pageToken - */ - - /** - * Constructs a new ListInstanceConfigsRequest. - * @memberof google.spanner.admin.instance.v1 - * @classdesc Represents a ListInstanceConfigsRequest. - * @implements IListInstanceConfigsRequest - * @constructor - * @param {google.spanner.admin.instance.v1.IListInstanceConfigsRequest=} [properties] Properties to set - */ - function ListInstanceConfigsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListInstanceConfigsRequest parent. - * @member {string} parent - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsRequest - * @instance - */ - ListInstanceConfigsRequest.prototype.parent = ""; - - /** - * ListInstanceConfigsRequest pageSize. - * @member {number} pageSize - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsRequest - * @instance - */ - ListInstanceConfigsRequest.prototype.pageSize = 0; - - /** - * ListInstanceConfigsRequest pageToken. - * @member {string} pageToken - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsRequest - * @instance - */ - ListInstanceConfigsRequest.prototype.pageToken = ""; - - /** - * Creates a new ListInstanceConfigsRequest instance using the specified properties. - * @function create - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsRequest - * @static - * @param {google.spanner.admin.instance.v1.IListInstanceConfigsRequest=} [properties] Properties to set - * @returns {google.spanner.admin.instance.v1.ListInstanceConfigsRequest} ListInstanceConfigsRequest instance - */ - ListInstanceConfigsRequest.create = function create(properties) { - return new ListInstanceConfigsRequest(properties); - }; - - /** - * Encodes the specified ListInstanceConfigsRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstanceConfigsRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsRequest - * @static - * @param {google.spanner.admin.instance.v1.IListInstanceConfigsRequest} message ListInstanceConfigsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListInstanceConfigsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - return writer; - }; - - /** - * Encodes the specified ListInstanceConfigsRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstanceConfigsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsRequest - * @static - * @param {google.spanner.admin.instance.v1.IListInstanceConfigsRequest} message ListInstanceConfigsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListInstanceConfigsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListInstanceConfigsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.instance.v1.ListInstanceConfigsRequest} ListInstanceConfigsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListInstanceConfigsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.ListInstanceConfigsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListInstanceConfigsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.instance.v1.ListInstanceConfigsRequest} ListInstanceConfigsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListInstanceConfigsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListInstanceConfigsRequest message. - * @function verify - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListInstanceConfigsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - return null; - }; - - /** - * Creates a ListInstanceConfigsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.instance.v1.ListInstanceConfigsRequest} ListInstanceConfigsRequest - */ - ListInstanceConfigsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.instance.v1.ListInstanceConfigsRequest) - return object; - var message = new $root.google.spanner.admin.instance.v1.ListInstanceConfigsRequest(); - 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 ListInstanceConfigsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsRequest - * @static - * @param {google.spanner.admin.instance.v1.ListInstanceConfigsRequest} message ListInstanceConfigsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListInstanceConfigsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - return object; - }; - - /** - * Converts this ListInstanceConfigsRequest to JSON. - * @function toJSON - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsRequest - * @instance - * @returns {Object.} JSON object - */ - ListInstanceConfigsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListInstanceConfigsRequest - * @function getTypeUrl - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListInstanceConfigsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.instance.v1.ListInstanceConfigsRequest"; - }; - - return ListInstanceConfigsRequest; - })(); - - v1.ListInstanceConfigsResponse = (function() { - - /** - * Properties of a ListInstanceConfigsResponse. - * @memberof google.spanner.admin.instance.v1 - * @interface IListInstanceConfigsResponse - * @property {Array.|null} [instanceConfigs] ListInstanceConfigsResponse instanceConfigs - * @property {string|null} [nextPageToken] ListInstanceConfigsResponse nextPageToken - */ - - /** - * Constructs a new ListInstanceConfigsResponse. - * @memberof google.spanner.admin.instance.v1 - * @classdesc Represents a ListInstanceConfigsResponse. - * @implements IListInstanceConfigsResponse - * @constructor - * @param {google.spanner.admin.instance.v1.IListInstanceConfigsResponse=} [properties] Properties to set - */ - function ListInstanceConfigsResponse(properties) { - this.instanceConfigs = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListInstanceConfigsResponse instanceConfigs. - * @member {Array.} instanceConfigs - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsResponse - * @instance - */ - ListInstanceConfigsResponse.prototype.instanceConfigs = $util.emptyArray; - - /** - * ListInstanceConfigsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsResponse - * @instance - */ - ListInstanceConfigsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListInstanceConfigsResponse instance using the specified properties. - * @function create - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsResponse - * @static - * @param {google.spanner.admin.instance.v1.IListInstanceConfigsResponse=} [properties] Properties to set - * @returns {google.spanner.admin.instance.v1.ListInstanceConfigsResponse} ListInstanceConfigsResponse instance - */ - ListInstanceConfigsResponse.create = function create(properties) { - return new ListInstanceConfigsResponse(properties); - }; - - /** - * Encodes the specified ListInstanceConfigsResponse message. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstanceConfigsResponse.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsResponse - * @static - * @param {google.spanner.admin.instance.v1.IListInstanceConfigsResponse} message ListInstanceConfigsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListInstanceConfigsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.instanceConfigs != null && message.instanceConfigs.length) - for (var i = 0; i < message.instanceConfigs.length; ++i) - $root.google.spanner.admin.instance.v1.InstanceConfig.encode(message.instanceConfigs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - return writer; - }; - - /** - * Encodes the specified ListInstanceConfigsResponse message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstanceConfigsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsResponse - * @static - * @param {google.spanner.admin.instance.v1.IListInstanceConfigsResponse} message ListInstanceConfigsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListInstanceConfigsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListInstanceConfigsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.instance.v1.ListInstanceConfigsResponse} ListInstanceConfigsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListInstanceConfigsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.ListInstanceConfigsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.instanceConfigs && message.instanceConfigs.length)) - message.instanceConfigs = []; - message.instanceConfigs.push($root.google.spanner.admin.instance.v1.InstanceConfig.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListInstanceConfigsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.instance.v1.ListInstanceConfigsResponse} ListInstanceConfigsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListInstanceConfigsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListInstanceConfigsResponse message. - * @function verify - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListInstanceConfigsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.instanceConfigs != null && message.hasOwnProperty("instanceConfigs")) { - if (!Array.isArray(message.instanceConfigs)) - return "instanceConfigs: array expected"; - for (var i = 0; i < message.instanceConfigs.length; ++i) { - var error = $root.google.spanner.admin.instance.v1.InstanceConfig.verify(message.instanceConfigs[i]); - if (error) - return "instanceConfigs." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListInstanceConfigsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.instance.v1.ListInstanceConfigsResponse} ListInstanceConfigsResponse - */ - ListInstanceConfigsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.instance.v1.ListInstanceConfigsResponse) - return object; - var message = new $root.google.spanner.admin.instance.v1.ListInstanceConfigsResponse(); - if (object.instanceConfigs) { - if (!Array.isArray(object.instanceConfigs)) - throw TypeError(".google.spanner.admin.instance.v1.ListInstanceConfigsResponse.instanceConfigs: array expected"); - message.instanceConfigs = []; - for (var i = 0; i < object.instanceConfigs.length; ++i) { - if (typeof object.instanceConfigs[i] !== "object") - throw TypeError(".google.spanner.admin.instance.v1.ListInstanceConfigsResponse.instanceConfigs: object expected"); - message.instanceConfigs[i] = $root.google.spanner.admin.instance.v1.InstanceConfig.fromObject(object.instanceConfigs[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListInstanceConfigsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsResponse - * @static - * @param {google.spanner.admin.instance.v1.ListInstanceConfigsResponse} message ListInstanceConfigsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListInstanceConfigsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.instanceConfigs = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.instanceConfigs && message.instanceConfigs.length) { - object.instanceConfigs = []; - for (var j = 0; j < message.instanceConfigs.length; ++j) - object.instanceConfigs[j] = $root.google.spanner.admin.instance.v1.InstanceConfig.toObject(message.instanceConfigs[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListInstanceConfigsResponse to JSON. - * @function toJSON - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsResponse - * @instance - * @returns {Object.} JSON object - */ - ListInstanceConfigsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListInstanceConfigsResponse - * @function getTypeUrl - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListInstanceConfigsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.instance.v1.ListInstanceConfigsResponse"; - }; - - return ListInstanceConfigsResponse; - })(); - - v1.GetInstanceConfigRequest = (function() { - - /** - * Properties of a GetInstanceConfigRequest. - * @memberof google.spanner.admin.instance.v1 - * @interface IGetInstanceConfigRequest - * @property {string|null} [name] GetInstanceConfigRequest name - */ - - /** - * Constructs a new GetInstanceConfigRequest. - * @memberof google.spanner.admin.instance.v1 - * @classdesc Represents a GetInstanceConfigRequest. - * @implements IGetInstanceConfigRequest - * @constructor - * @param {google.spanner.admin.instance.v1.IGetInstanceConfigRequest=} [properties] Properties to set - */ - function GetInstanceConfigRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetInstanceConfigRequest name. - * @member {string} name - * @memberof google.spanner.admin.instance.v1.GetInstanceConfigRequest - * @instance - */ - GetInstanceConfigRequest.prototype.name = ""; - - /** - * Creates a new GetInstanceConfigRequest instance using the specified properties. - * @function create - * @memberof google.spanner.admin.instance.v1.GetInstanceConfigRequest - * @static - * @param {google.spanner.admin.instance.v1.IGetInstanceConfigRequest=} [properties] Properties to set - * @returns {google.spanner.admin.instance.v1.GetInstanceConfigRequest} GetInstanceConfigRequest instance - */ - GetInstanceConfigRequest.create = function create(properties) { - return new GetInstanceConfigRequest(properties); - }; - - /** - * Encodes the specified GetInstanceConfigRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.GetInstanceConfigRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.instance.v1.GetInstanceConfigRequest - * @static - * @param {google.spanner.admin.instance.v1.IGetInstanceConfigRequest} message GetInstanceConfigRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetInstanceConfigRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; - - /** - * Encodes the specified GetInstanceConfigRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.GetInstanceConfigRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.instance.v1.GetInstanceConfigRequest - * @static - * @param {google.spanner.admin.instance.v1.IGetInstanceConfigRequest} message GetInstanceConfigRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetInstanceConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetInstanceConfigRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.instance.v1.GetInstanceConfigRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.instance.v1.GetInstanceConfigRequest} GetInstanceConfigRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetInstanceConfigRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.GetInstanceConfigRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetInstanceConfigRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.instance.v1.GetInstanceConfigRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.instance.v1.GetInstanceConfigRequest} GetInstanceConfigRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetInstanceConfigRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetInstanceConfigRequest message. - * @function verify - * @memberof google.spanner.admin.instance.v1.GetInstanceConfigRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetInstanceConfigRequest.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 GetInstanceConfigRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.instance.v1.GetInstanceConfigRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.instance.v1.GetInstanceConfigRequest} GetInstanceConfigRequest - */ - GetInstanceConfigRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.instance.v1.GetInstanceConfigRequest) - return object; - var message = new $root.google.spanner.admin.instance.v1.GetInstanceConfigRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetInstanceConfigRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.instance.v1.GetInstanceConfigRequest - * @static - * @param {google.spanner.admin.instance.v1.GetInstanceConfigRequest} message GetInstanceConfigRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetInstanceConfigRequest.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 GetInstanceConfigRequest to JSON. - * @function toJSON - * @memberof google.spanner.admin.instance.v1.GetInstanceConfigRequest - * @instance - * @returns {Object.} JSON object - */ - GetInstanceConfigRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetInstanceConfigRequest - * @function getTypeUrl - * @memberof google.spanner.admin.instance.v1.GetInstanceConfigRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetInstanceConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.instance.v1.GetInstanceConfigRequest"; - }; - - return GetInstanceConfigRequest; - })(); - - v1.CreateInstanceConfigRequest = (function() { - - /** - * Properties of a CreateInstanceConfigRequest. - * @memberof google.spanner.admin.instance.v1 - * @interface ICreateInstanceConfigRequest - * @property {string|null} [parent] CreateInstanceConfigRequest parent - * @property {string|null} [instanceConfigId] CreateInstanceConfigRequest instanceConfigId - * @property {google.spanner.admin.instance.v1.IInstanceConfig|null} [instanceConfig] CreateInstanceConfigRequest instanceConfig - * @property {boolean|null} [validateOnly] CreateInstanceConfigRequest validateOnly - */ - - /** - * Constructs a new CreateInstanceConfigRequest. - * @memberof google.spanner.admin.instance.v1 - * @classdesc Represents a CreateInstanceConfigRequest. - * @implements ICreateInstanceConfigRequest - * @constructor - * @param {google.spanner.admin.instance.v1.ICreateInstanceConfigRequest=} [properties] Properties to set - */ - function CreateInstanceConfigRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateInstanceConfigRequest parent. - * @member {string} parent - * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigRequest - * @instance - */ - CreateInstanceConfigRequest.prototype.parent = ""; - - /** - * CreateInstanceConfigRequest instanceConfigId. - * @member {string} instanceConfigId - * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigRequest - * @instance - */ - CreateInstanceConfigRequest.prototype.instanceConfigId = ""; - - /** - * CreateInstanceConfigRequest instanceConfig. - * @member {google.spanner.admin.instance.v1.IInstanceConfig|null|undefined} instanceConfig - * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigRequest - * @instance - */ - CreateInstanceConfigRequest.prototype.instanceConfig = null; - - /** - * CreateInstanceConfigRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigRequest - * @instance - */ - CreateInstanceConfigRequest.prototype.validateOnly = false; - - /** - * Creates a new CreateInstanceConfigRequest instance using the specified properties. - * @function create - * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigRequest - * @static - * @param {google.spanner.admin.instance.v1.ICreateInstanceConfigRequest=} [properties] Properties to set - * @returns {google.spanner.admin.instance.v1.CreateInstanceConfigRequest} CreateInstanceConfigRequest instance - */ - CreateInstanceConfigRequest.create = function create(properties) { - return new CreateInstanceConfigRequest(properties); - }; - - /** - * Encodes the specified CreateInstanceConfigRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.CreateInstanceConfigRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigRequest - * @static - * @param {google.spanner.admin.instance.v1.ICreateInstanceConfigRequest} message CreateInstanceConfigRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateInstanceConfigRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.instanceConfigId != null && Object.hasOwnProperty.call(message, "instanceConfigId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.instanceConfigId); - if (message.instanceConfig != null && Object.hasOwnProperty.call(message, "instanceConfig")) - $root.google.spanner.admin.instance.v1.InstanceConfig.encode(message.instanceConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); - return writer; - }; - - /** - * Encodes the specified CreateInstanceConfigRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.CreateInstanceConfigRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigRequest - * @static - * @param {google.spanner.admin.instance.v1.ICreateInstanceConfigRequest} message CreateInstanceConfigRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateInstanceConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateInstanceConfigRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.instance.v1.CreateInstanceConfigRequest} CreateInstanceConfigRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateInstanceConfigRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.CreateInstanceConfigRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.instanceConfigId = reader.string(); - break; - } - case 3: { - message.instanceConfig = $root.google.spanner.admin.instance.v1.InstanceConfig.decode(reader, reader.uint32()); - break; - } - case 4: { - message.validateOnly = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateInstanceConfigRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.instance.v1.CreateInstanceConfigRequest} CreateInstanceConfigRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateInstanceConfigRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateInstanceConfigRequest message. - * @function verify - * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateInstanceConfigRequest.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.instanceConfigId != null && message.hasOwnProperty("instanceConfigId")) - if (!$util.isString(message.instanceConfigId)) - return "instanceConfigId: string expected"; - if (message.instanceConfig != null && message.hasOwnProperty("instanceConfig")) { - var error = $root.google.spanner.admin.instance.v1.InstanceConfig.verify(message.instanceConfig); - if (error) - return "instanceConfig." + error; - } - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - return null; - }; - - /** - * Creates a CreateInstanceConfigRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.instance.v1.CreateInstanceConfigRequest} CreateInstanceConfigRequest - */ - CreateInstanceConfigRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.instance.v1.CreateInstanceConfigRequest) - return object; - var message = new $root.google.spanner.admin.instance.v1.CreateInstanceConfigRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.instanceConfigId != null) - message.instanceConfigId = String(object.instanceConfigId); - if (object.instanceConfig != null) { - if (typeof object.instanceConfig !== "object") - throw TypeError(".google.spanner.admin.instance.v1.CreateInstanceConfigRequest.instanceConfig: object expected"); - message.instanceConfig = $root.google.spanner.admin.instance.v1.InstanceConfig.fromObject(object.instanceConfig); - } - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - return message; - }; - - /** - * Creates a plain object from a CreateInstanceConfigRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigRequest - * @static - * @param {google.spanner.admin.instance.v1.CreateInstanceConfigRequest} message CreateInstanceConfigRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateInstanceConfigRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.instanceConfigId = ""; - object.instanceConfig = null; - object.validateOnly = false; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.instanceConfigId != null && message.hasOwnProperty("instanceConfigId")) - object.instanceConfigId = message.instanceConfigId; - if (message.instanceConfig != null && message.hasOwnProperty("instanceConfig")) - object.instanceConfig = $root.google.spanner.admin.instance.v1.InstanceConfig.toObject(message.instanceConfig, options); - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - return object; - }; - - /** - * Converts this CreateInstanceConfigRequest to JSON. - * @function toJSON - * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigRequest - * @instance - * @returns {Object.} JSON object - */ - CreateInstanceConfigRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateInstanceConfigRequest - * @function getTypeUrl - * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateInstanceConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.instance.v1.CreateInstanceConfigRequest"; - }; - - return CreateInstanceConfigRequest; - })(); - - v1.UpdateInstanceConfigRequest = (function() { - - /** - * Properties of an UpdateInstanceConfigRequest. - * @memberof google.spanner.admin.instance.v1 - * @interface IUpdateInstanceConfigRequest - * @property {google.spanner.admin.instance.v1.IInstanceConfig|null} [instanceConfig] UpdateInstanceConfigRequest instanceConfig - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateInstanceConfigRequest updateMask - * @property {boolean|null} [validateOnly] UpdateInstanceConfigRequest validateOnly - */ - - /** - * Constructs a new UpdateInstanceConfigRequest. - * @memberof google.spanner.admin.instance.v1 - * @classdesc Represents an UpdateInstanceConfigRequest. - * @implements IUpdateInstanceConfigRequest - * @constructor - * @param {google.spanner.admin.instance.v1.IUpdateInstanceConfigRequest=} [properties] Properties to set - */ - function UpdateInstanceConfigRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateInstanceConfigRequest instanceConfig. - * @member {google.spanner.admin.instance.v1.IInstanceConfig|null|undefined} instanceConfig - * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigRequest - * @instance - */ - UpdateInstanceConfigRequest.prototype.instanceConfig = null; - - /** - * UpdateInstanceConfigRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigRequest - * @instance - */ - UpdateInstanceConfigRequest.prototype.updateMask = null; - - /** - * UpdateInstanceConfigRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigRequest - * @instance - */ - UpdateInstanceConfigRequest.prototype.validateOnly = false; - - /** - * Creates a new UpdateInstanceConfigRequest instance using the specified properties. - * @function create - * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigRequest - * @static - * @param {google.spanner.admin.instance.v1.IUpdateInstanceConfigRequest=} [properties] Properties to set - * @returns {google.spanner.admin.instance.v1.UpdateInstanceConfigRequest} UpdateInstanceConfigRequest instance - */ - UpdateInstanceConfigRequest.create = function create(properties) { - return new UpdateInstanceConfigRequest(properties); - }; - - /** - * Encodes the specified UpdateInstanceConfigRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.UpdateInstanceConfigRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigRequest - * @static - * @param {google.spanner.admin.instance.v1.IUpdateInstanceConfigRequest} message UpdateInstanceConfigRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateInstanceConfigRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.instanceConfig != null && Object.hasOwnProperty.call(message, "instanceConfig")) - $root.google.spanner.admin.instance.v1.InstanceConfig.encode(message.instanceConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); - return writer; - }; - - /** - * Encodes the specified UpdateInstanceConfigRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.UpdateInstanceConfigRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigRequest - * @static - * @param {google.spanner.admin.instance.v1.IUpdateInstanceConfigRequest} message UpdateInstanceConfigRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateInstanceConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateInstanceConfigRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.instance.v1.UpdateInstanceConfigRequest} UpdateInstanceConfigRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateInstanceConfigRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.UpdateInstanceConfigRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.instanceConfig = $root.google.spanner.admin.instance.v1.InstanceConfig.decode(reader, reader.uint32()); - break; - } - case 2: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - case 3: { - message.validateOnly = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateInstanceConfigRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.instance.v1.UpdateInstanceConfigRequest} UpdateInstanceConfigRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateInstanceConfigRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateInstanceConfigRequest message. - * @function verify - * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateInstanceConfigRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.instanceConfig != null && message.hasOwnProperty("instanceConfig")) { - var error = $root.google.spanner.admin.instance.v1.InstanceConfig.verify(message.instanceConfig); - if (error) - return "instanceConfig." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - return null; - }; - - /** - * Creates an UpdateInstanceConfigRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.instance.v1.UpdateInstanceConfigRequest} UpdateInstanceConfigRequest - */ - UpdateInstanceConfigRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.instance.v1.UpdateInstanceConfigRequest) - return object; - var message = new $root.google.spanner.admin.instance.v1.UpdateInstanceConfigRequest(); - if (object.instanceConfig != null) { - if (typeof object.instanceConfig !== "object") - throw TypeError(".google.spanner.admin.instance.v1.UpdateInstanceConfigRequest.instanceConfig: object expected"); - message.instanceConfig = $root.google.spanner.admin.instance.v1.InstanceConfig.fromObject(object.instanceConfig); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.spanner.admin.instance.v1.UpdateInstanceConfigRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - return message; - }; - - /** - * Creates a plain object from an UpdateInstanceConfigRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigRequest - * @static - * @param {google.spanner.admin.instance.v1.UpdateInstanceConfigRequest} message UpdateInstanceConfigRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateInstanceConfigRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.instanceConfig = null; - object.updateMask = null; - object.validateOnly = false; - } - if (message.instanceConfig != null && message.hasOwnProperty("instanceConfig")) - object.instanceConfig = $root.google.spanner.admin.instance.v1.InstanceConfig.toObject(message.instanceConfig, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - return object; - }; - - /** - * Converts this UpdateInstanceConfigRequest to JSON. - * @function toJSON - * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateInstanceConfigRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateInstanceConfigRequest - * @function getTypeUrl - * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateInstanceConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.instance.v1.UpdateInstanceConfigRequest"; - }; - - return UpdateInstanceConfigRequest; - })(); - - v1.DeleteInstanceConfigRequest = (function() { - - /** - * Properties of a DeleteInstanceConfigRequest. - * @memberof google.spanner.admin.instance.v1 - * @interface IDeleteInstanceConfigRequest - * @property {string|null} [name] DeleteInstanceConfigRequest name - * @property {string|null} [etag] DeleteInstanceConfigRequest etag - * @property {boolean|null} [validateOnly] DeleteInstanceConfigRequest validateOnly - */ - - /** - * Constructs a new DeleteInstanceConfigRequest. - * @memberof google.spanner.admin.instance.v1 - * @classdesc Represents a DeleteInstanceConfigRequest. - * @implements IDeleteInstanceConfigRequest - * @constructor - * @param {google.spanner.admin.instance.v1.IDeleteInstanceConfigRequest=} [properties] Properties to set - */ - function DeleteInstanceConfigRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteInstanceConfigRequest name. - * @member {string} name - * @memberof google.spanner.admin.instance.v1.DeleteInstanceConfigRequest - * @instance - */ - DeleteInstanceConfigRequest.prototype.name = ""; - - /** - * DeleteInstanceConfigRequest etag. - * @member {string} etag - * @memberof google.spanner.admin.instance.v1.DeleteInstanceConfigRequest - * @instance - */ - DeleteInstanceConfigRequest.prototype.etag = ""; - - /** - * DeleteInstanceConfigRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.spanner.admin.instance.v1.DeleteInstanceConfigRequest - * @instance - */ - DeleteInstanceConfigRequest.prototype.validateOnly = false; - - /** - * Creates a new DeleteInstanceConfigRequest instance using the specified properties. - * @function create - * @memberof google.spanner.admin.instance.v1.DeleteInstanceConfigRequest - * @static - * @param {google.spanner.admin.instance.v1.IDeleteInstanceConfigRequest=} [properties] Properties to set - * @returns {google.spanner.admin.instance.v1.DeleteInstanceConfigRequest} DeleteInstanceConfigRequest instance - */ - DeleteInstanceConfigRequest.create = function create(properties) { - return new DeleteInstanceConfigRequest(properties); - }; - - /** - * Encodes the specified DeleteInstanceConfigRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.DeleteInstanceConfigRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.instance.v1.DeleteInstanceConfigRequest - * @static - * @param {google.spanner.admin.instance.v1.IDeleteInstanceConfigRequest} message DeleteInstanceConfigRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteInstanceConfigRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.etag); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); - return writer; - }; - - /** - * Encodes the specified DeleteInstanceConfigRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.DeleteInstanceConfigRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.instance.v1.DeleteInstanceConfigRequest - * @static - * @param {google.spanner.admin.instance.v1.IDeleteInstanceConfigRequest} message DeleteInstanceConfigRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteInstanceConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteInstanceConfigRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.instance.v1.DeleteInstanceConfigRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.instance.v1.DeleteInstanceConfigRequest} DeleteInstanceConfigRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteInstanceConfigRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.DeleteInstanceConfigRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.etag = reader.string(); - break; - } - case 3: { - message.validateOnly = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteInstanceConfigRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.instance.v1.DeleteInstanceConfigRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.instance.v1.DeleteInstanceConfigRequest} DeleteInstanceConfigRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteInstanceConfigRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteInstanceConfigRequest message. - * @function verify - * @memberof google.spanner.admin.instance.v1.DeleteInstanceConfigRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteInstanceConfigRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - return null; - }; - - /** - * Creates a DeleteInstanceConfigRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.instance.v1.DeleteInstanceConfigRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.instance.v1.DeleteInstanceConfigRequest} DeleteInstanceConfigRequest - */ - DeleteInstanceConfigRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.instance.v1.DeleteInstanceConfigRequest) - return object; - var message = new $root.google.spanner.admin.instance.v1.DeleteInstanceConfigRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.etag != null) - message.etag = String(object.etag); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - return message; - }; - - /** - * Creates a plain object from a DeleteInstanceConfigRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.instance.v1.DeleteInstanceConfigRequest - * @static - * @param {google.spanner.admin.instance.v1.DeleteInstanceConfigRequest} message DeleteInstanceConfigRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteInstanceConfigRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.etag = ""; - object.validateOnly = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - return object; - }; - - /** - * Converts this DeleteInstanceConfigRequest to JSON. - * @function toJSON - * @memberof google.spanner.admin.instance.v1.DeleteInstanceConfigRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteInstanceConfigRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteInstanceConfigRequest - * @function getTypeUrl - * @memberof google.spanner.admin.instance.v1.DeleteInstanceConfigRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteInstanceConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.instance.v1.DeleteInstanceConfigRequest"; - }; - - return DeleteInstanceConfigRequest; - })(); - - v1.ListInstanceConfigOperationsRequest = (function() { - - /** - * Properties of a ListInstanceConfigOperationsRequest. - * @memberof google.spanner.admin.instance.v1 - * @interface IListInstanceConfigOperationsRequest - * @property {string|null} [parent] ListInstanceConfigOperationsRequest parent - * @property {string|null} [filter] ListInstanceConfigOperationsRequest filter - * @property {number|null} [pageSize] ListInstanceConfigOperationsRequest pageSize - * @property {string|null} [pageToken] ListInstanceConfigOperationsRequest pageToken - */ - - /** - * Constructs a new ListInstanceConfigOperationsRequest. - * @memberof google.spanner.admin.instance.v1 - * @classdesc Represents a ListInstanceConfigOperationsRequest. - * @implements IListInstanceConfigOperationsRequest - * @constructor - * @param {google.spanner.admin.instance.v1.IListInstanceConfigOperationsRequest=} [properties] Properties to set - */ - function ListInstanceConfigOperationsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListInstanceConfigOperationsRequest parent. - * @member {string} parent - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest - * @instance - */ - ListInstanceConfigOperationsRequest.prototype.parent = ""; - - /** - * ListInstanceConfigOperationsRequest filter. - * @member {string} filter - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest - * @instance - */ - ListInstanceConfigOperationsRequest.prototype.filter = ""; - - /** - * ListInstanceConfigOperationsRequest pageSize. - * @member {number} pageSize - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest - * @instance - */ - ListInstanceConfigOperationsRequest.prototype.pageSize = 0; - - /** - * ListInstanceConfigOperationsRequest pageToken. - * @member {string} pageToken - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest - * @instance - */ - ListInstanceConfigOperationsRequest.prototype.pageToken = ""; - - /** - * Creates a new ListInstanceConfigOperationsRequest instance using the specified properties. - * @function create - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest - * @static - * @param {google.spanner.admin.instance.v1.IListInstanceConfigOperationsRequest=} [properties] Properties to set - * @returns {google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest} ListInstanceConfigOperationsRequest instance - */ - ListInstanceConfigOperationsRequest.create = function create(properties) { - return new ListInstanceConfigOperationsRequest(properties); - }; - - /** - * Encodes the specified ListInstanceConfigOperationsRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest - * @static - * @param {google.spanner.admin.instance.v1.IListInstanceConfigOperationsRequest} message ListInstanceConfigOperationsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListInstanceConfigOperationsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); - return writer; - }; - - /** - * Encodes the specified ListInstanceConfigOperationsRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest - * @static - * @param {google.spanner.admin.instance.v1.IListInstanceConfigOperationsRequest} message ListInstanceConfigOperationsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListInstanceConfigOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListInstanceConfigOperationsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest} ListInstanceConfigOperationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListInstanceConfigOperationsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.filter = reader.string(); - break; - } - case 3: { - message.pageSize = reader.int32(); - break; - } - case 4: { - message.pageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListInstanceConfigOperationsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest} ListInstanceConfigOperationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListInstanceConfigOperationsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListInstanceConfigOperationsRequest message. - * @function verify - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListInstanceConfigOperationsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.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 ListInstanceConfigOperationsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest} ListInstanceConfigOperationsRequest - */ - ListInstanceConfigOperationsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest) - return object; - var message = new $root.google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.filter != null) - message.filter = String(object.filter); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - return message; - }; - - /** - * Creates a plain object from a ListInstanceConfigOperationsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest - * @static - * @param {google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest} message ListInstanceConfigOperationsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListInstanceConfigOperationsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.filter = ""; - object.pageSize = 0; - object.pageToken = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - return object; - }; - - /** - * Converts this ListInstanceConfigOperationsRequest to JSON. - * @function toJSON - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest - * @instance - * @returns {Object.} JSON object - */ - ListInstanceConfigOperationsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListInstanceConfigOperationsRequest - * @function getTypeUrl - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListInstanceConfigOperationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest"; - }; - - return ListInstanceConfigOperationsRequest; - })(); - - v1.ListInstanceConfigOperationsResponse = (function() { - - /** - * Properties of a ListInstanceConfigOperationsResponse. - * @memberof google.spanner.admin.instance.v1 - * @interface IListInstanceConfigOperationsResponse - * @property {Array.|null} [operations] ListInstanceConfigOperationsResponse operations - * @property {string|null} [nextPageToken] ListInstanceConfigOperationsResponse nextPageToken - */ - - /** - * Constructs a new ListInstanceConfigOperationsResponse. - * @memberof google.spanner.admin.instance.v1 - * @classdesc Represents a ListInstanceConfigOperationsResponse. - * @implements IListInstanceConfigOperationsResponse - * @constructor - * @param {google.spanner.admin.instance.v1.IListInstanceConfigOperationsResponse=} [properties] Properties to set - */ - function ListInstanceConfigOperationsResponse(properties) { - this.operations = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListInstanceConfigOperationsResponse operations. - * @member {Array.} operations - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse - * @instance - */ - ListInstanceConfigOperationsResponse.prototype.operations = $util.emptyArray; - - /** - * ListInstanceConfigOperationsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse - * @instance - */ - ListInstanceConfigOperationsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListInstanceConfigOperationsResponse instance using the specified properties. - * @function create - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse - * @static - * @param {google.spanner.admin.instance.v1.IListInstanceConfigOperationsResponse=} [properties] Properties to set - * @returns {google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse} ListInstanceConfigOperationsResponse instance - */ - ListInstanceConfigOperationsResponse.create = function create(properties) { - return new ListInstanceConfigOperationsResponse(properties); - }; - - /** - * Encodes the specified ListInstanceConfigOperationsResponse message. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse - * @static - * @param {google.spanner.admin.instance.v1.IListInstanceConfigOperationsResponse} message ListInstanceConfigOperationsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListInstanceConfigOperationsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.operations != null && message.operations.length) - for (var i = 0; i < message.operations.length; ++i) - $root.google.longrunning.Operation.encode(message.operations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - return writer; - }; - - /** - * Encodes the specified ListInstanceConfigOperationsResponse message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse - * @static - * @param {google.spanner.admin.instance.v1.IListInstanceConfigOperationsResponse} message ListInstanceConfigOperationsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListInstanceConfigOperationsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListInstanceConfigOperationsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse} ListInstanceConfigOperationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListInstanceConfigOperationsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.operations && message.operations.length)) - message.operations = []; - message.operations.push($root.google.longrunning.Operation.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListInstanceConfigOperationsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse} ListInstanceConfigOperationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListInstanceConfigOperationsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListInstanceConfigOperationsResponse message. - * @function verify - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListInstanceConfigOperationsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.operations != null && message.hasOwnProperty("operations")) { - if (!Array.isArray(message.operations)) - return "operations: array expected"; - for (var i = 0; i < message.operations.length; ++i) { - var error = $root.google.longrunning.Operation.verify(message.operations[i]); - if (error) - return "operations." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListInstanceConfigOperationsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse} ListInstanceConfigOperationsResponse - */ - ListInstanceConfigOperationsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse) - return object; - var message = new $root.google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse(); - if (object.operations) { - if (!Array.isArray(object.operations)) - throw TypeError(".google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse.operations: array expected"); - message.operations = []; - for (var i = 0; i < object.operations.length; ++i) { - if (typeof object.operations[i] !== "object") - throw TypeError(".google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse.operations: object expected"); - message.operations[i] = $root.google.longrunning.Operation.fromObject(object.operations[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListInstanceConfigOperationsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse - * @static - * @param {google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse} message ListInstanceConfigOperationsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListInstanceConfigOperationsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.operations = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.operations && message.operations.length) { - object.operations = []; - for (var j = 0; j < message.operations.length; ++j) - object.operations[j] = $root.google.longrunning.Operation.toObject(message.operations[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListInstanceConfigOperationsResponse to JSON. - * @function toJSON - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse - * @instance - * @returns {Object.} JSON object - */ - ListInstanceConfigOperationsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListInstanceConfigOperationsResponse - * @function getTypeUrl - * @memberof google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListInstanceConfigOperationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse"; - }; - - return ListInstanceConfigOperationsResponse; - })(); - - v1.GetInstanceRequest = (function() { - - /** - * Properties of a GetInstanceRequest. - * @memberof google.spanner.admin.instance.v1 - * @interface IGetInstanceRequest - * @property {string|null} [name] GetInstanceRequest name - * @property {google.protobuf.IFieldMask|null} [fieldMask] GetInstanceRequest fieldMask - */ - - /** - * Constructs a new GetInstanceRequest. - * @memberof google.spanner.admin.instance.v1 - * @classdesc Represents a GetInstanceRequest. - * @implements IGetInstanceRequest - * @constructor - * @param {google.spanner.admin.instance.v1.IGetInstanceRequest=} [properties] Properties to set - */ - function GetInstanceRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetInstanceRequest name. - * @member {string} name - * @memberof google.spanner.admin.instance.v1.GetInstanceRequest - * @instance - */ - GetInstanceRequest.prototype.name = ""; - - /** - * GetInstanceRequest fieldMask. - * @member {google.protobuf.IFieldMask|null|undefined} fieldMask - * @memberof google.spanner.admin.instance.v1.GetInstanceRequest - * @instance - */ - GetInstanceRequest.prototype.fieldMask = null; - - /** - * Creates a new GetInstanceRequest instance using the specified properties. - * @function create - * @memberof google.spanner.admin.instance.v1.GetInstanceRequest - * @static - * @param {google.spanner.admin.instance.v1.IGetInstanceRequest=} [properties] Properties to set - * @returns {google.spanner.admin.instance.v1.GetInstanceRequest} GetInstanceRequest instance - */ - GetInstanceRequest.create = function create(properties) { - return new GetInstanceRequest(properties); - }; - - /** - * Encodes the specified GetInstanceRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.GetInstanceRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.instance.v1.GetInstanceRequest - * @static - * @param {google.spanner.admin.instance.v1.IGetInstanceRequest} message GetInstanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetInstanceRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.fieldMask != null && Object.hasOwnProperty.call(message, "fieldMask")) - $root.google.protobuf.FieldMask.encode(message.fieldMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetInstanceRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.GetInstanceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.instance.v1.GetInstanceRequest - * @static - * @param {google.spanner.admin.instance.v1.IGetInstanceRequest} message GetInstanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetInstanceRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.instance.v1.GetInstanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.instance.v1.GetInstanceRequest} GetInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetInstanceRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.GetInstanceRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.fieldMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - 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.spanner.admin.instance.v1.GetInstanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.instance.v1.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.spanner.admin.instance.v1.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"; - if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.fieldMask); - if (error) - return "fieldMask." + error; - } - return null; - }; - - /** - * Creates a GetInstanceRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.instance.v1.GetInstanceRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.instance.v1.GetInstanceRequest} GetInstanceRequest - */ - GetInstanceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.instance.v1.GetInstanceRequest) - return object; - var message = new $root.google.spanner.admin.instance.v1.GetInstanceRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.fieldMask != null) { - if (typeof object.fieldMask !== "object") - throw TypeError(".google.spanner.admin.instance.v1.GetInstanceRequest.fieldMask: object expected"); - message.fieldMask = $root.google.protobuf.FieldMask.fromObject(object.fieldMask); - } - return message; - }; - - /** - * Creates a plain object from a GetInstanceRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.instance.v1.GetInstanceRequest - * @static - * @param {google.spanner.admin.instance.v1.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 = ""; - object.fieldMask = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) - object.fieldMask = $root.google.protobuf.FieldMask.toObject(message.fieldMask, options); - return object; - }; - - /** - * Converts this GetInstanceRequest to JSON. - * @function toJSON - * @memberof google.spanner.admin.instance.v1.GetInstanceRequest - * @instance - * @returns {Object.} JSON object - */ - GetInstanceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetInstanceRequest - * @function getTypeUrl - * @memberof google.spanner.admin.instance.v1.GetInstanceRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.instance.v1.GetInstanceRequest"; - }; - - return GetInstanceRequest; - })(); - - v1.CreateInstanceRequest = (function() { - - /** - * Properties of a CreateInstanceRequest. - * @memberof google.spanner.admin.instance.v1 - * @interface ICreateInstanceRequest - * @property {string|null} [parent] CreateInstanceRequest parent - * @property {string|null} [instanceId] CreateInstanceRequest instanceId - * @property {google.spanner.admin.instance.v1.IInstance|null} [instance] CreateInstanceRequest instance - */ - - /** - * Constructs a new CreateInstanceRequest. - * @memberof google.spanner.admin.instance.v1 - * @classdesc Represents a CreateInstanceRequest. - * @implements ICreateInstanceRequest - * @constructor - * @param {google.spanner.admin.instance.v1.ICreateInstanceRequest=} [properties] Properties to set - */ - function CreateInstanceRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateInstanceRequest parent. - * @member {string} parent - * @memberof google.spanner.admin.instance.v1.CreateInstanceRequest - * @instance - */ - CreateInstanceRequest.prototype.parent = ""; - - /** - * CreateInstanceRequest instanceId. - * @member {string} instanceId - * @memberof google.spanner.admin.instance.v1.CreateInstanceRequest - * @instance - */ - CreateInstanceRequest.prototype.instanceId = ""; - - /** - * CreateInstanceRequest instance. - * @member {google.spanner.admin.instance.v1.IInstance|null|undefined} instance - * @memberof google.spanner.admin.instance.v1.CreateInstanceRequest - * @instance - */ - CreateInstanceRequest.prototype.instance = null; - - /** - * Creates a new CreateInstanceRequest instance using the specified properties. - * @function create - * @memberof google.spanner.admin.instance.v1.CreateInstanceRequest - * @static - * @param {google.spanner.admin.instance.v1.ICreateInstanceRequest=} [properties] Properties to set - * @returns {google.spanner.admin.instance.v1.CreateInstanceRequest} CreateInstanceRequest instance - */ - CreateInstanceRequest.create = function create(properties) { - return new CreateInstanceRequest(properties); - }; - - /** - * Encodes the specified CreateInstanceRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.CreateInstanceRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.instance.v1.CreateInstanceRequest - * @static - * @param {google.spanner.admin.instance.v1.ICreateInstanceRequest} message CreateInstanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateInstanceRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.instanceId); - if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) - $root.google.spanner.admin.instance.v1.Instance.encode(message.instance, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CreateInstanceRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.CreateInstanceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.instance.v1.CreateInstanceRequest - * @static - * @param {google.spanner.admin.instance.v1.ICreateInstanceRequest} message CreateInstanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateInstanceRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.instance.v1.CreateInstanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.instance.v1.CreateInstanceRequest} CreateInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateInstanceRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.CreateInstanceRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.instanceId = reader.string(); - break; - } - case 3: { - message.instance = $root.google.spanner.admin.instance.v1.Instance.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateInstanceRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.instance.v1.CreateInstanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.instance.v1.CreateInstanceRequest} CreateInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateInstanceRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateInstanceRequest message. - * @function verify - * @memberof google.spanner.admin.instance.v1.CreateInstanceRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateInstanceRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.instanceId != null && message.hasOwnProperty("instanceId")) - if (!$util.isString(message.instanceId)) - return "instanceId: string expected"; - if (message.instance != null && message.hasOwnProperty("instance")) { - var error = $root.google.spanner.admin.instance.v1.Instance.verify(message.instance); - if (error) - return "instance." + error; - } - return null; - }; - - /** - * Creates a CreateInstanceRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.instance.v1.CreateInstanceRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.instance.v1.CreateInstanceRequest} CreateInstanceRequest - */ - CreateInstanceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.instance.v1.CreateInstanceRequest) - return object; - var message = new $root.google.spanner.admin.instance.v1.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.spanner.admin.instance.v1.CreateInstanceRequest.instance: object expected"); - message.instance = $root.google.spanner.admin.instance.v1.Instance.fromObject(object.instance); - } - return message; - }; - - /** - * Creates a plain object from a CreateInstanceRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.instance.v1.CreateInstanceRequest - * @static - * @param {google.spanner.admin.instance.v1.CreateInstanceRequest} message CreateInstanceRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateInstanceRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.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.spanner.admin.instance.v1.Instance.toObject(message.instance, options); - return object; - }; - - /** - * Converts this CreateInstanceRequest to JSON. - * @function toJSON - * @memberof google.spanner.admin.instance.v1.CreateInstanceRequest - * @instance - * @returns {Object.} JSON object - */ - CreateInstanceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateInstanceRequest - * @function getTypeUrl - * @memberof google.spanner.admin.instance.v1.CreateInstanceRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.instance.v1.CreateInstanceRequest"; - }; - - return CreateInstanceRequest; - })(); - - v1.ListInstancesRequest = (function() { - - /** - * Properties of a ListInstancesRequest. - * @memberof google.spanner.admin.instance.v1 - * @interface IListInstancesRequest - * @property {string|null} [parent] ListInstancesRequest parent - * @property {number|null} [pageSize] ListInstancesRequest pageSize - * @property {string|null} [pageToken] ListInstancesRequest pageToken - * @property {string|null} [filter] ListInstancesRequest filter - * @property {google.protobuf.ITimestamp|null} [instanceDeadline] ListInstancesRequest instanceDeadline - */ - - /** - * Constructs a new ListInstancesRequest. - * @memberof google.spanner.admin.instance.v1 - * @classdesc Represents a ListInstancesRequest. - * @implements IListInstancesRequest - * @constructor - * @param {google.spanner.admin.instance.v1.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.spanner.admin.instance.v1.ListInstancesRequest - * @instance - */ - ListInstancesRequest.prototype.parent = ""; - - /** - * ListInstancesRequest pageSize. - * @member {number} pageSize - * @memberof google.spanner.admin.instance.v1.ListInstancesRequest - * @instance - */ - ListInstancesRequest.prototype.pageSize = 0; - - /** - * ListInstancesRequest pageToken. - * @member {string} pageToken - * @memberof google.spanner.admin.instance.v1.ListInstancesRequest - * @instance - */ - ListInstancesRequest.prototype.pageToken = ""; - - /** - * ListInstancesRequest filter. - * @member {string} filter - * @memberof google.spanner.admin.instance.v1.ListInstancesRequest - * @instance - */ - ListInstancesRequest.prototype.filter = ""; - - /** - * ListInstancesRequest instanceDeadline. - * @member {google.protobuf.ITimestamp|null|undefined} instanceDeadline - * @memberof google.spanner.admin.instance.v1.ListInstancesRequest - * @instance - */ - ListInstancesRequest.prototype.instanceDeadline = null; - - /** - * Creates a new ListInstancesRequest instance using the specified properties. - * @function create - * @memberof google.spanner.admin.instance.v1.ListInstancesRequest - * @static - * @param {google.spanner.admin.instance.v1.IListInstancesRequest=} [properties] Properties to set - * @returns {google.spanner.admin.instance.v1.ListInstancesRequest} ListInstancesRequest instance - */ - ListInstancesRequest.create = function create(properties) { - return new ListInstancesRequest(properties); - }; - - /** - * Encodes the specified ListInstancesRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancesRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.instance.v1.ListInstancesRequest - * @static - * @param {google.spanner.admin.instance.v1.IListInstancesRequest} message ListInstancesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListInstancesRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); - if (message.instanceDeadline != null && Object.hasOwnProperty.call(message, "instanceDeadline")) - $root.google.protobuf.Timestamp.encode(message.instanceDeadline, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ListInstancesRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.instance.v1.ListInstancesRequest - * @static - * @param {google.spanner.admin.instance.v1.IListInstancesRequest} message ListInstancesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListInstancesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListInstancesRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.instance.v1.ListInstancesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.instance.v1.ListInstancesRequest} ListInstancesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListInstancesRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.ListInstancesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - case 4: { - message.filter = reader.string(); - break; - } - case 5: { - message.instanceDeadline = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListInstancesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.instance.v1.ListInstancesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.instance.v1.ListInstancesRequest} ListInstancesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListInstancesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListInstancesRequest message. - * @function verify - * @memberof google.spanner.admin.instance.v1.ListInstancesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListInstancesRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.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.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.instanceDeadline != null && message.hasOwnProperty("instanceDeadline")) { - var error = $root.google.protobuf.Timestamp.verify(message.instanceDeadline); - if (error) - return "instanceDeadline." + error; - } - return null; - }; - - /** - * Creates a ListInstancesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.instance.v1.ListInstancesRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.instance.v1.ListInstancesRequest} ListInstancesRequest - */ - ListInstancesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.instance.v1.ListInstancesRequest) - return object; - var message = new $root.google.spanner.admin.instance.v1.ListInstancesRequest(); - 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); - if (object.filter != null) - message.filter = String(object.filter); - if (object.instanceDeadline != null) { - if (typeof object.instanceDeadline !== "object") - throw TypeError(".google.spanner.admin.instance.v1.ListInstancesRequest.instanceDeadline: object expected"); - message.instanceDeadline = $root.google.protobuf.Timestamp.fromObject(object.instanceDeadline); - } - return message; - }; - - /** - * Creates a plain object from a ListInstancesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.instance.v1.ListInstancesRequest - * @static - * @param {google.spanner.admin.instance.v1.ListInstancesRequest} message ListInstancesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListInstancesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.filter = ""; - object.instanceDeadline = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.instanceDeadline != null && message.hasOwnProperty("instanceDeadline")) - object.instanceDeadline = $root.google.protobuf.Timestamp.toObject(message.instanceDeadline, options); - return object; - }; - - /** - * Converts this ListInstancesRequest to JSON. - * @function toJSON - * @memberof google.spanner.admin.instance.v1.ListInstancesRequest - * @instance - * @returns {Object.} JSON object - */ - ListInstancesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListInstancesRequest - * @function getTypeUrl - * @memberof google.spanner.admin.instance.v1.ListInstancesRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListInstancesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.instance.v1.ListInstancesRequest"; - }; - - return ListInstancesRequest; - })(); - - v1.ListInstancesResponse = (function() { - - /** - * Properties of a ListInstancesResponse. - * @memberof google.spanner.admin.instance.v1 - * @interface IListInstancesResponse - * @property {Array.|null} [instances] ListInstancesResponse instances - * @property {string|null} [nextPageToken] ListInstancesResponse nextPageToken - * @property {Array.|null} [unreachable] ListInstancesResponse unreachable - */ - - /** - * Constructs a new ListInstancesResponse. - * @memberof google.spanner.admin.instance.v1 - * @classdesc Represents a ListInstancesResponse. - * @implements IListInstancesResponse - * @constructor - * @param {google.spanner.admin.instance.v1.IListInstancesResponse=} [properties] Properties to set - */ - function ListInstancesResponse(properties) { - this.instances = []; - this.unreachable = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListInstancesResponse instances. - * @member {Array.} instances - * @memberof google.spanner.admin.instance.v1.ListInstancesResponse - * @instance - */ - ListInstancesResponse.prototype.instances = $util.emptyArray; - - /** - * ListInstancesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.spanner.admin.instance.v1.ListInstancesResponse - * @instance - */ - ListInstancesResponse.prototype.nextPageToken = ""; - - /** - * ListInstancesResponse unreachable. - * @member {Array.} unreachable - * @memberof google.spanner.admin.instance.v1.ListInstancesResponse - * @instance - */ - ListInstancesResponse.prototype.unreachable = $util.emptyArray; - - /** - * Creates a new ListInstancesResponse instance using the specified properties. - * @function create - * @memberof google.spanner.admin.instance.v1.ListInstancesResponse - * @static - * @param {google.spanner.admin.instance.v1.IListInstancesResponse=} [properties] Properties to set - * @returns {google.spanner.admin.instance.v1.ListInstancesResponse} ListInstancesResponse instance - */ - ListInstancesResponse.create = function create(properties) { - return new ListInstancesResponse(properties); - }; - - /** - * Encodes the specified ListInstancesResponse message. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancesResponse.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.instance.v1.ListInstancesResponse - * @static - * @param {google.spanner.admin.instance.v1.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.spanner.admin.instance.v1.Instance.encode(message.instances[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - if (message.unreachable != null && message.unreachable.length) - for (var i = 0; i < message.unreachable.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); - return writer; - }; - - /** - * Encodes the specified ListInstancesResponse message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.instance.v1.ListInstancesResponse - * @static - * @param {google.spanner.admin.instance.v1.IListInstancesResponse} message ListInstancesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListInstancesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListInstancesResponse message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.instance.v1.ListInstancesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.instance.v1.ListInstancesResponse} ListInstancesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListInstancesResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.ListInstancesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.instances && message.instances.length)) - message.instances = []; - message.instances.push($root.google.spanner.admin.instance.v1.Instance.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - case 3: { - if (!(message.unreachable && message.unreachable.length)) - message.unreachable = []; - message.unreachable.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListInstancesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.instance.v1.ListInstancesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.instance.v1.ListInstancesResponse} ListInstancesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListInstancesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListInstancesResponse message. - * @function verify - * @memberof google.spanner.admin.instance.v1.ListInstancesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListInstancesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.instances != null && message.hasOwnProperty("instances")) { - if (!Array.isArray(message.instances)) - return "instances: array expected"; - for (var i = 0; i < message.instances.length; ++i) { - var error = $root.google.spanner.admin.instance.v1.Instance.verify(message.instances[i]); - if (error) - return "instances." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - if (message.unreachable != null && message.hasOwnProperty("unreachable")) { - if (!Array.isArray(message.unreachable)) - return "unreachable: array expected"; - for (var i = 0; i < message.unreachable.length; ++i) - if (!$util.isString(message.unreachable[i])) - return "unreachable: string[] expected"; - } - return null; - }; - - /** - * Creates a ListInstancesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.instance.v1.ListInstancesResponse - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.instance.v1.ListInstancesResponse} ListInstancesResponse - */ - ListInstancesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.instance.v1.ListInstancesResponse) - return object; - var message = new $root.google.spanner.admin.instance.v1.ListInstancesResponse(); - if (object.instances) { - if (!Array.isArray(object.instances)) - throw TypeError(".google.spanner.admin.instance.v1.ListInstancesResponse.instances: array expected"); - message.instances = []; - for (var i = 0; i < object.instances.length; ++i) { - if (typeof object.instances[i] !== "object") - throw TypeError(".google.spanner.admin.instance.v1.ListInstancesResponse.instances: object expected"); - message.instances[i] = $root.google.spanner.admin.instance.v1.Instance.fromObject(object.instances[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.unreachable) { - if (!Array.isArray(object.unreachable)) - throw TypeError(".google.spanner.admin.instance.v1.ListInstancesResponse.unreachable: array expected"); - message.unreachable = []; - for (var i = 0; i < object.unreachable.length; ++i) - message.unreachable[i] = String(object.unreachable[i]); - } - return message; - }; - - /** - * Creates a plain object from a ListInstancesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.instance.v1.ListInstancesResponse - * @static - * @param {google.spanner.admin.instance.v1.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.unreachable = []; - } - 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.spanner.admin.instance.v1.Instance.toObject(message.instances[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - if (message.unreachable && message.unreachable.length) { - object.unreachable = []; - for (var j = 0; j < message.unreachable.length; ++j) - object.unreachable[j] = message.unreachable[j]; - } - return object; - }; - - /** - * Converts this ListInstancesResponse to JSON. - * @function toJSON - * @memberof google.spanner.admin.instance.v1.ListInstancesResponse - * @instance - * @returns {Object.} JSON object - */ - ListInstancesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListInstancesResponse - * @function getTypeUrl - * @memberof google.spanner.admin.instance.v1.ListInstancesResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListInstancesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.instance.v1.ListInstancesResponse"; - }; - - return ListInstancesResponse; - })(); - - v1.UpdateInstanceRequest = (function() { - - /** - * Properties of an UpdateInstanceRequest. - * @memberof google.spanner.admin.instance.v1 - * @interface IUpdateInstanceRequest - * @property {google.spanner.admin.instance.v1.IInstance|null} [instance] UpdateInstanceRequest instance - * @property {google.protobuf.IFieldMask|null} [fieldMask] UpdateInstanceRequest fieldMask - */ - - /** - * Constructs a new UpdateInstanceRequest. - * @memberof google.spanner.admin.instance.v1 - * @classdesc Represents an UpdateInstanceRequest. - * @implements IUpdateInstanceRequest - * @constructor - * @param {google.spanner.admin.instance.v1.IUpdateInstanceRequest=} [properties] Properties to set - */ - function UpdateInstanceRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateInstanceRequest instance. - * @member {google.spanner.admin.instance.v1.IInstance|null|undefined} instance - * @memberof google.spanner.admin.instance.v1.UpdateInstanceRequest - * @instance - */ - UpdateInstanceRequest.prototype.instance = null; - - /** - * UpdateInstanceRequest fieldMask. - * @member {google.protobuf.IFieldMask|null|undefined} fieldMask - * @memberof google.spanner.admin.instance.v1.UpdateInstanceRequest - * @instance - */ - UpdateInstanceRequest.prototype.fieldMask = null; - - /** - * Creates a new UpdateInstanceRequest instance using the specified properties. - * @function create - * @memberof google.spanner.admin.instance.v1.UpdateInstanceRequest - * @static - * @param {google.spanner.admin.instance.v1.IUpdateInstanceRequest=} [properties] Properties to set - * @returns {google.spanner.admin.instance.v1.UpdateInstanceRequest} UpdateInstanceRequest instance - */ - UpdateInstanceRequest.create = function create(properties) { - return new UpdateInstanceRequest(properties); - }; - - /** - * Encodes the specified UpdateInstanceRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.UpdateInstanceRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.instance.v1.UpdateInstanceRequest - * @static - * @param {google.spanner.admin.instance.v1.IUpdateInstanceRequest} message UpdateInstanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateInstanceRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) - $root.google.spanner.admin.instance.v1.Instance.encode(message.instance, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.fieldMask != null && Object.hasOwnProperty.call(message, "fieldMask")) - $root.google.protobuf.FieldMask.encode(message.fieldMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified UpdateInstanceRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.UpdateInstanceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.instance.v1.UpdateInstanceRequest - * @static - * @param {google.spanner.admin.instance.v1.IUpdateInstanceRequest} message UpdateInstanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateInstanceRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.instance.v1.UpdateInstanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.instance.v1.UpdateInstanceRequest} UpdateInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateInstanceRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.UpdateInstanceRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.instance = $root.google.spanner.admin.instance.v1.Instance.decode(reader, reader.uint32()); - break; - } - case 2: { - message.fieldMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateInstanceRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.instance.v1.UpdateInstanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.instance.v1.UpdateInstanceRequest} UpdateInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateInstanceRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateInstanceRequest message. - * @function verify - * @memberof google.spanner.admin.instance.v1.UpdateInstanceRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateInstanceRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.instance != null && message.hasOwnProperty("instance")) { - var error = $root.google.spanner.admin.instance.v1.Instance.verify(message.instance); - if (error) - return "instance." + error; - } - if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.fieldMask); - if (error) - return "fieldMask." + error; - } - return null; - }; - - /** - * Creates an UpdateInstanceRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.instance.v1.UpdateInstanceRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.instance.v1.UpdateInstanceRequest} UpdateInstanceRequest - */ - UpdateInstanceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.instance.v1.UpdateInstanceRequest) - return object; - var message = new $root.google.spanner.admin.instance.v1.UpdateInstanceRequest(); - if (object.instance != null) { - if (typeof object.instance !== "object") - throw TypeError(".google.spanner.admin.instance.v1.UpdateInstanceRequest.instance: object expected"); - message.instance = $root.google.spanner.admin.instance.v1.Instance.fromObject(object.instance); - } - if (object.fieldMask != null) { - if (typeof object.fieldMask !== "object") - throw TypeError(".google.spanner.admin.instance.v1.UpdateInstanceRequest.fieldMask: object expected"); - message.fieldMask = $root.google.protobuf.FieldMask.fromObject(object.fieldMask); - } - return message; - }; - - /** - * Creates a plain object from an UpdateInstanceRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.instance.v1.UpdateInstanceRequest - * @static - * @param {google.spanner.admin.instance.v1.UpdateInstanceRequest} message UpdateInstanceRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateInstanceRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.instance = null; - object.fieldMask = null; - } - if (message.instance != null && message.hasOwnProperty("instance")) - object.instance = $root.google.spanner.admin.instance.v1.Instance.toObject(message.instance, options); - if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) - object.fieldMask = $root.google.protobuf.FieldMask.toObject(message.fieldMask, options); - return object; - }; - - /** - * Converts this UpdateInstanceRequest to JSON. - * @function toJSON - * @memberof google.spanner.admin.instance.v1.UpdateInstanceRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateInstanceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateInstanceRequest - * @function getTypeUrl - * @memberof google.spanner.admin.instance.v1.UpdateInstanceRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.instance.v1.UpdateInstanceRequest"; - }; - - return UpdateInstanceRequest; - })(); - - v1.DeleteInstanceRequest = (function() { - - /** - * Properties of a DeleteInstanceRequest. - * @memberof google.spanner.admin.instance.v1 - * @interface IDeleteInstanceRequest - * @property {string|null} [name] DeleteInstanceRequest name - */ - - /** - * Constructs a new DeleteInstanceRequest. - * @memberof google.spanner.admin.instance.v1 - * @classdesc Represents a DeleteInstanceRequest. - * @implements IDeleteInstanceRequest - * @constructor - * @param {google.spanner.admin.instance.v1.IDeleteInstanceRequest=} [properties] Properties to set - */ - function DeleteInstanceRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteInstanceRequest name. - * @member {string} name - * @memberof google.spanner.admin.instance.v1.DeleteInstanceRequest - * @instance - */ - DeleteInstanceRequest.prototype.name = ""; - - /** - * Creates a new DeleteInstanceRequest instance using the specified properties. - * @function create - * @memberof google.spanner.admin.instance.v1.DeleteInstanceRequest - * @static - * @param {google.spanner.admin.instance.v1.IDeleteInstanceRequest=} [properties] Properties to set - * @returns {google.spanner.admin.instance.v1.DeleteInstanceRequest} DeleteInstanceRequest instance - */ - DeleteInstanceRequest.create = function create(properties) { - return new DeleteInstanceRequest(properties); - }; - - /** - * Encodes the specified DeleteInstanceRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.DeleteInstanceRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.instance.v1.DeleteInstanceRequest - * @static - * @param {google.spanner.admin.instance.v1.IDeleteInstanceRequest} message DeleteInstanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteInstanceRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; - - /** - * Encodes the specified DeleteInstanceRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.DeleteInstanceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.instance.v1.DeleteInstanceRequest - * @static - * @param {google.spanner.admin.instance.v1.IDeleteInstanceRequest} message DeleteInstanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteInstanceRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.instance.v1.DeleteInstanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.instance.v1.DeleteInstanceRequest} DeleteInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteInstanceRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.DeleteInstanceRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteInstanceRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.instance.v1.DeleteInstanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.instance.v1.DeleteInstanceRequest} DeleteInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteInstanceRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteInstanceRequest message. - * @function verify - * @memberof google.spanner.admin.instance.v1.DeleteInstanceRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteInstanceRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; - - /** - * Creates a DeleteInstanceRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.instance.v1.DeleteInstanceRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.instance.v1.DeleteInstanceRequest} DeleteInstanceRequest - */ - DeleteInstanceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.instance.v1.DeleteInstanceRequest) - return object; - var message = new $root.google.spanner.admin.instance.v1.DeleteInstanceRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a DeleteInstanceRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.instance.v1.DeleteInstanceRequest - * @static - * @param {google.spanner.admin.instance.v1.DeleteInstanceRequest} message DeleteInstanceRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteInstanceRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; - - /** - * Converts this DeleteInstanceRequest to JSON. - * @function toJSON - * @memberof google.spanner.admin.instance.v1.DeleteInstanceRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteInstanceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteInstanceRequest - * @function getTypeUrl - * @memberof google.spanner.admin.instance.v1.DeleteInstanceRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.instance.v1.DeleteInstanceRequest"; - }; - - return DeleteInstanceRequest; - })(); - - v1.CreateInstanceMetadata = (function() { - - /** - * Properties of a CreateInstanceMetadata. - * @memberof google.spanner.admin.instance.v1 - * @interface ICreateInstanceMetadata - * @property {google.spanner.admin.instance.v1.IInstance|null} [instance] CreateInstanceMetadata instance - * @property {google.protobuf.ITimestamp|null} [startTime] CreateInstanceMetadata startTime - * @property {google.protobuf.ITimestamp|null} [cancelTime] CreateInstanceMetadata cancelTime - * @property {google.protobuf.ITimestamp|null} [endTime] CreateInstanceMetadata endTime - * @property {google.spanner.admin.instance.v1.FulfillmentPeriod|null} [expectedFulfillmentPeriod] CreateInstanceMetadata expectedFulfillmentPeriod - */ - - /** - * Constructs a new CreateInstanceMetadata. - * @memberof google.spanner.admin.instance.v1 - * @classdesc Represents a CreateInstanceMetadata. - * @implements ICreateInstanceMetadata - * @constructor - * @param {google.spanner.admin.instance.v1.ICreateInstanceMetadata=} [properties] Properties to set - */ - function CreateInstanceMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateInstanceMetadata instance. - * @member {google.spanner.admin.instance.v1.IInstance|null|undefined} instance - * @memberof google.spanner.admin.instance.v1.CreateInstanceMetadata - * @instance - */ - CreateInstanceMetadata.prototype.instance = null; - - /** - * CreateInstanceMetadata startTime. - * @member {google.protobuf.ITimestamp|null|undefined} startTime - * @memberof google.spanner.admin.instance.v1.CreateInstanceMetadata - * @instance - */ - CreateInstanceMetadata.prototype.startTime = null; - - /** - * CreateInstanceMetadata cancelTime. - * @member {google.protobuf.ITimestamp|null|undefined} cancelTime - * @memberof google.spanner.admin.instance.v1.CreateInstanceMetadata - * @instance - */ - CreateInstanceMetadata.prototype.cancelTime = null; - - /** - * CreateInstanceMetadata endTime. - * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.spanner.admin.instance.v1.CreateInstanceMetadata - * @instance - */ - CreateInstanceMetadata.prototype.endTime = null; - - /** - * CreateInstanceMetadata expectedFulfillmentPeriod. - * @member {google.spanner.admin.instance.v1.FulfillmentPeriod} expectedFulfillmentPeriod - * @memberof google.spanner.admin.instance.v1.CreateInstanceMetadata - * @instance - */ - CreateInstanceMetadata.prototype.expectedFulfillmentPeriod = 0; - - /** - * Creates a new CreateInstanceMetadata instance using the specified properties. - * @function create - * @memberof google.spanner.admin.instance.v1.CreateInstanceMetadata - * @static - * @param {google.spanner.admin.instance.v1.ICreateInstanceMetadata=} [properties] Properties to set - * @returns {google.spanner.admin.instance.v1.CreateInstanceMetadata} CreateInstanceMetadata instance - */ - CreateInstanceMetadata.create = function create(properties) { - return new CreateInstanceMetadata(properties); - }; - - /** - * Encodes the specified CreateInstanceMetadata message. Does not implicitly {@link google.spanner.admin.instance.v1.CreateInstanceMetadata.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.instance.v1.CreateInstanceMetadata - * @static - * @param {google.spanner.admin.instance.v1.ICreateInstanceMetadata} message CreateInstanceMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateInstanceMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) - $root.google.spanner.admin.instance.v1.Instance.encode(message.instance, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) - $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.cancelTime != null && Object.hasOwnProperty.call(message, "cancelTime")) - $root.google.protobuf.Timestamp.encode(message.cancelTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) - $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.expectedFulfillmentPeriod != null && Object.hasOwnProperty.call(message, "expectedFulfillmentPeriod")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.expectedFulfillmentPeriod); - return writer; - }; - - /** - * Encodes the specified CreateInstanceMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.CreateInstanceMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.instance.v1.CreateInstanceMetadata - * @static - * @param {google.spanner.admin.instance.v1.ICreateInstanceMetadata} message CreateInstanceMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateInstanceMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateInstanceMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.instance.v1.CreateInstanceMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.instance.v1.CreateInstanceMetadata} CreateInstanceMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateInstanceMetadata.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.CreateInstanceMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.instance = $root.google.spanner.admin.instance.v1.Instance.decode(reader, reader.uint32()); - break; - } - case 2: { - message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 3: { - message.cancelTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 4: { - message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 5: { - message.expectedFulfillmentPeriod = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateInstanceMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.instance.v1.CreateInstanceMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.instance.v1.CreateInstanceMetadata} CreateInstanceMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateInstanceMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateInstanceMetadata message. - * @function verify - * @memberof google.spanner.admin.instance.v1.CreateInstanceMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateInstanceMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.instance != null && message.hasOwnProperty("instance")) { - var error = $root.google.spanner.admin.instance.v1.Instance.verify(message.instance); - if (error) - return "instance." + error; - } - if (message.startTime != null && message.hasOwnProperty("startTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.startTime); - if (error) - return "startTime." + error; - } - if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.cancelTime); - if (error) - return "cancelTime." + error; - } - if (message.endTime != null && message.hasOwnProperty("endTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.endTime); - if (error) - return "endTime." + error; - } - if (message.expectedFulfillmentPeriod != null && message.hasOwnProperty("expectedFulfillmentPeriod")) - switch (message.expectedFulfillmentPeriod) { - default: - return "expectedFulfillmentPeriod: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a CreateInstanceMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.instance.v1.CreateInstanceMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.instance.v1.CreateInstanceMetadata} CreateInstanceMetadata - */ - CreateInstanceMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.instance.v1.CreateInstanceMetadata) - return object; - var message = new $root.google.spanner.admin.instance.v1.CreateInstanceMetadata(); - if (object.instance != null) { - if (typeof object.instance !== "object") - throw TypeError(".google.spanner.admin.instance.v1.CreateInstanceMetadata.instance: object expected"); - message.instance = $root.google.spanner.admin.instance.v1.Instance.fromObject(object.instance); - } - if (object.startTime != null) { - if (typeof object.startTime !== "object") - throw TypeError(".google.spanner.admin.instance.v1.CreateInstanceMetadata.startTime: object expected"); - message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); - } - if (object.cancelTime != null) { - if (typeof object.cancelTime !== "object") - throw TypeError(".google.spanner.admin.instance.v1.CreateInstanceMetadata.cancelTime: object expected"); - message.cancelTime = $root.google.protobuf.Timestamp.fromObject(object.cancelTime); - } - if (object.endTime != null) { - if (typeof object.endTime !== "object") - throw TypeError(".google.spanner.admin.instance.v1.CreateInstanceMetadata.endTime: object expected"); - message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); - } - switch (object.expectedFulfillmentPeriod) { - default: - if (typeof object.expectedFulfillmentPeriod === "number") { - message.expectedFulfillmentPeriod = object.expectedFulfillmentPeriod; - break; - } - break; - case "FULFILLMENT_PERIOD_UNSPECIFIED": - case 0: - message.expectedFulfillmentPeriod = 0; - break; - case "FULFILLMENT_PERIOD_NORMAL": - case 1: - message.expectedFulfillmentPeriod = 1; - break; - case "FULFILLMENT_PERIOD_EXTENDED": - case 2: - message.expectedFulfillmentPeriod = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a CreateInstanceMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.instance.v1.CreateInstanceMetadata - * @static - * @param {google.spanner.admin.instance.v1.CreateInstanceMetadata} message CreateInstanceMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateInstanceMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.instance = null; - object.startTime = null; - object.cancelTime = null; - object.endTime = null; - object.expectedFulfillmentPeriod = options.enums === String ? "FULFILLMENT_PERIOD_UNSPECIFIED" : 0; - } - if (message.instance != null && message.hasOwnProperty("instance")) - object.instance = $root.google.spanner.admin.instance.v1.Instance.toObject(message.instance, options); - if (message.startTime != null && message.hasOwnProperty("startTime")) - object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); - if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) - object.cancelTime = $root.google.protobuf.Timestamp.toObject(message.cancelTime, options); - if (message.endTime != null && message.hasOwnProperty("endTime")) - object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); - if (message.expectedFulfillmentPeriod != null && message.hasOwnProperty("expectedFulfillmentPeriod")) - object.expectedFulfillmentPeriod = options.enums === String ? $root.google.spanner.admin.instance.v1.FulfillmentPeriod[message.expectedFulfillmentPeriod] === undefined ? message.expectedFulfillmentPeriod : $root.google.spanner.admin.instance.v1.FulfillmentPeriod[message.expectedFulfillmentPeriod] : message.expectedFulfillmentPeriod; - return object; - }; - - /** - * Converts this CreateInstanceMetadata to JSON. - * @function toJSON - * @memberof google.spanner.admin.instance.v1.CreateInstanceMetadata - * @instance - * @returns {Object.} JSON object - */ - CreateInstanceMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateInstanceMetadata - * @function getTypeUrl - * @memberof google.spanner.admin.instance.v1.CreateInstanceMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateInstanceMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.instance.v1.CreateInstanceMetadata"; - }; - - return CreateInstanceMetadata; - })(); - - v1.UpdateInstanceMetadata = (function() { - - /** - * Properties of an UpdateInstanceMetadata. - * @memberof google.spanner.admin.instance.v1 - * @interface IUpdateInstanceMetadata - * @property {google.spanner.admin.instance.v1.IInstance|null} [instance] UpdateInstanceMetadata instance - * @property {google.protobuf.ITimestamp|null} [startTime] UpdateInstanceMetadata startTime - * @property {google.protobuf.ITimestamp|null} [cancelTime] UpdateInstanceMetadata cancelTime - * @property {google.protobuf.ITimestamp|null} [endTime] UpdateInstanceMetadata endTime - * @property {google.spanner.admin.instance.v1.FulfillmentPeriod|null} [expectedFulfillmentPeriod] UpdateInstanceMetadata expectedFulfillmentPeriod - */ - - /** - * Constructs a new UpdateInstanceMetadata. - * @memberof google.spanner.admin.instance.v1 - * @classdesc Represents an UpdateInstanceMetadata. - * @implements IUpdateInstanceMetadata - * @constructor - * @param {google.spanner.admin.instance.v1.IUpdateInstanceMetadata=} [properties] Properties to set - */ - function UpdateInstanceMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateInstanceMetadata instance. - * @member {google.spanner.admin.instance.v1.IInstance|null|undefined} instance - * @memberof google.spanner.admin.instance.v1.UpdateInstanceMetadata - * @instance - */ - UpdateInstanceMetadata.prototype.instance = null; - - /** - * UpdateInstanceMetadata startTime. - * @member {google.protobuf.ITimestamp|null|undefined} startTime - * @memberof google.spanner.admin.instance.v1.UpdateInstanceMetadata - * @instance - */ - UpdateInstanceMetadata.prototype.startTime = null; - - /** - * UpdateInstanceMetadata cancelTime. - * @member {google.protobuf.ITimestamp|null|undefined} cancelTime - * @memberof google.spanner.admin.instance.v1.UpdateInstanceMetadata - * @instance - */ - UpdateInstanceMetadata.prototype.cancelTime = null; - - /** - * UpdateInstanceMetadata endTime. - * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.spanner.admin.instance.v1.UpdateInstanceMetadata - * @instance - */ - UpdateInstanceMetadata.prototype.endTime = null; - - /** - * UpdateInstanceMetadata expectedFulfillmentPeriod. - * @member {google.spanner.admin.instance.v1.FulfillmentPeriod} expectedFulfillmentPeriod - * @memberof google.spanner.admin.instance.v1.UpdateInstanceMetadata - * @instance - */ - UpdateInstanceMetadata.prototype.expectedFulfillmentPeriod = 0; - - /** - * Creates a new UpdateInstanceMetadata instance using the specified properties. - * @function create - * @memberof google.spanner.admin.instance.v1.UpdateInstanceMetadata - * @static - * @param {google.spanner.admin.instance.v1.IUpdateInstanceMetadata=} [properties] Properties to set - * @returns {google.spanner.admin.instance.v1.UpdateInstanceMetadata} UpdateInstanceMetadata instance - */ - UpdateInstanceMetadata.create = function create(properties) { - return new UpdateInstanceMetadata(properties); - }; - - /** - * Encodes the specified UpdateInstanceMetadata message. Does not implicitly {@link google.spanner.admin.instance.v1.UpdateInstanceMetadata.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.instance.v1.UpdateInstanceMetadata - * @static - * @param {google.spanner.admin.instance.v1.IUpdateInstanceMetadata} message UpdateInstanceMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateInstanceMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) - $root.google.spanner.admin.instance.v1.Instance.encode(message.instance, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) - $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.cancelTime != null && Object.hasOwnProperty.call(message, "cancelTime")) - $root.google.protobuf.Timestamp.encode(message.cancelTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) - $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.expectedFulfillmentPeriod != null && Object.hasOwnProperty.call(message, "expectedFulfillmentPeriod")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.expectedFulfillmentPeriod); - return writer; - }; - - /** - * Encodes the specified UpdateInstanceMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.UpdateInstanceMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.instance.v1.UpdateInstanceMetadata - * @static - * @param {google.spanner.admin.instance.v1.IUpdateInstanceMetadata} message UpdateInstanceMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateInstanceMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateInstanceMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.instance.v1.UpdateInstanceMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.instance.v1.UpdateInstanceMetadata} UpdateInstanceMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateInstanceMetadata.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.UpdateInstanceMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.instance = $root.google.spanner.admin.instance.v1.Instance.decode(reader, reader.uint32()); - break; - } - case 2: { - message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 3: { - message.cancelTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 4: { - message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 5: { - message.expectedFulfillmentPeriod = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateInstanceMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.instance.v1.UpdateInstanceMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.instance.v1.UpdateInstanceMetadata} UpdateInstanceMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateInstanceMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateInstanceMetadata message. - * @function verify - * @memberof google.spanner.admin.instance.v1.UpdateInstanceMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateInstanceMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.instance != null && message.hasOwnProperty("instance")) { - var error = $root.google.spanner.admin.instance.v1.Instance.verify(message.instance); - if (error) - return "instance." + error; - } - if (message.startTime != null && message.hasOwnProperty("startTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.startTime); - if (error) - return "startTime." + error; - } - if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.cancelTime); - if (error) - return "cancelTime." + error; - } - if (message.endTime != null && message.hasOwnProperty("endTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.endTime); - if (error) - return "endTime." + error; - } - if (message.expectedFulfillmentPeriod != null && message.hasOwnProperty("expectedFulfillmentPeriod")) - switch (message.expectedFulfillmentPeriod) { - default: - return "expectedFulfillmentPeriod: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates an UpdateInstanceMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.instance.v1.UpdateInstanceMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.instance.v1.UpdateInstanceMetadata} UpdateInstanceMetadata - */ - UpdateInstanceMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.instance.v1.UpdateInstanceMetadata) - return object; - var message = new $root.google.spanner.admin.instance.v1.UpdateInstanceMetadata(); - if (object.instance != null) { - if (typeof object.instance !== "object") - throw TypeError(".google.spanner.admin.instance.v1.UpdateInstanceMetadata.instance: object expected"); - message.instance = $root.google.spanner.admin.instance.v1.Instance.fromObject(object.instance); - } - if (object.startTime != null) { - if (typeof object.startTime !== "object") - throw TypeError(".google.spanner.admin.instance.v1.UpdateInstanceMetadata.startTime: object expected"); - message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); - } - if (object.cancelTime != null) { - if (typeof object.cancelTime !== "object") - throw TypeError(".google.spanner.admin.instance.v1.UpdateInstanceMetadata.cancelTime: object expected"); - message.cancelTime = $root.google.protobuf.Timestamp.fromObject(object.cancelTime); - } - if (object.endTime != null) { - if (typeof object.endTime !== "object") - throw TypeError(".google.spanner.admin.instance.v1.UpdateInstanceMetadata.endTime: object expected"); - message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); - } - switch (object.expectedFulfillmentPeriod) { - default: - if (typeof object.expectedFulfillmentPeriod === "number") { - message.expectedFulfillmentPeriod = object.expectedFulfillmentPeriod; - break; - } - break; - case "FULFILLMENT_PERIOD_UNSPECIFIED": - case 0: - message.expectedFulfillmentPeriod = 0; - break; - case "FULFILLMENT_PERIOD_NORMAL": - case 1: - message.expectedFulfillmentPeriod = 1; - break; - case "FULFILLMENT_PERIOD_EXTENDED": - case 2: - message.expectedFulfillmentPeriod = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from an UpdateInstanceMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.instance.v1.UpdateInstanceMetadata - * @static - * @param {google.spanner.admin.instance.v1.UpdateInstanceMetadata} message UpdateInstanceMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateInstanceMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.instance = null; - object.startTime = null; - object.cancelTime = null; - object.endTime = null; - object.expectedFulfillmentPeriod = options.enums === String ? "FULFILLMENT_PERIOD_UNSPECIFIED" : 0; - } - if (message.instance != null && message.hasOwnProperty("instance")) - object.instance = $root.google.spanner.admin.instance.v1.Instance.toObject(message.instance, options); - if (message.startTime != null && message.hasOwnProperty("startTime")) - object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); - if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) - object.cancelTime = $root.google.protobuf.Timestamp.toObject(message.cancelTime, options); - if (message.endTime != null && message.hasOwnProperty("endTime")) - object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); - if (message.expectedFulfillmentPeriod != null && message.hasOwnProperty("expectedFulfillmentPeriod")) - object.expectedFulfillmentPeriod = options.enums === String ? $root.google.spanner.admin.instance.v1.FulfillmentPeriod[message.expectedFulfillmentPeriod] === undefined ? message.expectedFulfillmentPeriod : $root.google.spanner.admin.instance.v1.FulfillmentPeriod[message.expectedFulfillmentPeriod] : message.expectedFulfillmentPeriod; - return object; - }; - - /** - * Converts this UpdateInstanceMetadata to JSON. - * @function toJSON - * @memberof google.spanner.admin.instance.v1.UpdateInstanceMetadata - * @instance - * @returns {Object.} JSON object - */ - UpdateInstanceMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateInstanceMetadata - * @function getTypeUrl - * @memberof google.spanner.admin.instance.v1.UpdateInstanceMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateInstanceMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.instance.v1.UpdateInstanceMetadata"; - }; - - return UpdateInstanceMetadata; - })(); - - v1.FreeInstanceMetadata = (function() { - - /** - * Properties of a FreeInstanceMetadata. - * @memberof google.spanner.admin.instance.v1 - * @interface IFreeInstanceMetadata - * @property {google.protobuf.ITimestamp|null} [expireTime] FreeInstanceMetadata expireTime - * @property {google.protobuf.ITimestamp|null} [upgradeTime] FreeInstanceMetadata upgradeTime - * @property {google.spanner.admin.instance.v1.FreeInstanceMetadata.ExpireBehavior|null} [expireBehavior] FreeInstanceMetadata expireBehavior - */ - - /** - * Constructs a new FreeInstanceMetadata. - * @memberof google.spanner.admin.instance.v1 - * @classdesc Represents a FreeInstanceMetadata. - * @implements IFreeInstanceMetadata - * @constructor - * @param {google.spanner.admin.instance.v1.IFreeInstanceMetadata=} [properties] Properties to set - */ - function FreeInstanceMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FreeInstanceMetadata expireTime. - * @member {google.protobuf.ITimestamp|null|undefined} expireTime - * @memberof google.spanner.admin.instance.v1.FreeInstanceMetadata - * @instance - */ - FreeInstanceMetadata.prototype.expireTime = null; - - /** - * FreeInstanceMetadata upgradeTime. - * @member {google.protobuf.ITimestamp|null|undefined} upgradeTime - * @memberof google.spanner.admin.instance.v1.FreeInstanceMetadata - * @instance - */ - FreeInstanceMetadata.prototype.upgradeTime = null; - - /** - * FreeInstanceMetadata expireBehavior. - * @member {google.spanner.admin.instance.v1.FreeInstanceMetadata.ExpireBehavior} expireBehavior - * @memberof google.spanner.admin.instance.v1.FreeInstanceMetadata - * @instance - */ - FreeInstanceMetadata.prototype.expireBehavior = 0; - - /** - * Creates a new FreeInstanceMetadata instance using the specified properties. - * @function create - * @memberof google.spanner.admin.instance.v1.FreeInstanceMetadata - * @static - * @param {google.spanner.admin.instance.v1.IFreeInstanceMetadata=} [properties] Properties to set - * @returns {google.spanner.admin.instance.v1.FreeInstanceMetadata} FreeInstanceMetadata instance - */ - FreeInstanceMetadata.create = function create(properties) { - return new FreeInstanceMetadata(properties); - }; - - /** - * Encodes the specified FreeInstanceMetadata message. Does not implicitly {@link google.spanner.admin.instance.v1.FreeInstanceMetadata.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.instance.v1.FreeInstanceMetadata - * @static - * @param {google.spanner.admin.instance.v1.IFreeInstanceMetadata} message FreeInstanceMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FreeInstanceMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) - $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.upgradeTime != null && Object.hasOwnProperty.call(message, "upgradeTime")) - $root.google.protobuf.Timestamp.encode(message.upgradeTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.expireBehavior != null && Object.hasOwnProperty.call(message, "expireBehavior")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.expireBehavior); - return writer; - }; - - /** - * Encodes the specified FreeInstanceMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.FreeInstanceMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.instance.v1.FreeInstanceMetadata - * @static - * @param {google.spanner.admin.instance.v1.IFreeInstanceMetadata} message FreeInstanceMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FreeInstanceMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FreeInstanceMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.instance.v1.FreeInstanceMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.instance.v1.FreeInstanceMetadata} FreeInstanceMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FreeInstanceMetadata.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.FreeInstanceMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 2: { - message.upgradeTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 3: { - message.expireBehavior = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FreeInstanceMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.instance.v1.FreeInstanceMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.instance.v1.FreeInstanceMetadata} FreeInstanceMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FreeInstanceMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FreeInstanceMetadata message. - * @function verify - * @memberof google.spanner.admin.instance.v1.FreeInstanceMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FreeInstanceMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.expireTime != null && message.hasOwnProperty("expireTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.expireTime); - if (error) - return "expireTime." + error; - } - if (message.upgradeTime != null && message.hasOwnProperty("upgradeTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.upgradeTime); - if (error) - return "upgradeTime." + error; - } - if (message.expireBehavior != null && message.hasOwnProperty("expireBehavior")) - switch (message.expireBehavior) { - default: - return "expireBehavior: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a FreeInstanceMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.instance.v1.FreeInstanceMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.instance.v1.FreeInstanceMetadata} FreeInstanceMetadata - */ - FreeInstanceMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.instance.v1.FreeInstanceMetadata) - return object; - var message = new $root.google.spanner.admin.instance.v1.FreeInstanceMetadata(); - if (object.expireTime != null) { - if (typeof object.expireTime !== "object") - throw TypeError(".google.spanner.admin.instance.v1.FreeInstanceMetadata.expireTime: object expected"); - message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); - } - if (object.upgradeTime != null) { - if (typeof object.upgradeTime !== "object") - throw TypeError(".google.spanner.admin.instance.v1.FreeInstanceMetadata.upgradeTime: object expected"); - message.upgradeTime = $root.google.protobuf.Timestamp.fromObject(object.upgradeTime); - } - switch (object.expireBehavior) { - default: - if (typeof object.expireBehavior === "number") { - message.expireBehavior = object.expireBehavior; - break; - } - break; - case "EXPIRE_BEHAVIOR_UNSPECIFIED": - case 0: - message.expireBehavior = 0; - break; - case "FREE_TO_PROVISIONED": - case 1: - message.expireBehavior = 1; - break; - case "REMOVE_AFTER_GRACE_PERIOD": - case 2: - message.expireBehavior = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a FreeInstanceMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.instance.v1.FreeInstanceMetadata - * @static - * @param {google.spanner.admin.instance.v1.FreeInstanceMetadata} message FreeInstanceMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FreeInstanceMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.expireTime = null; - object.upgradeTime = null; - object.expireBehavior = options.enums === String ? "EXPIRE_BEHAVIOR_UNSPECIFIED" : 0; - } - if (message.expireTime != null && message.hasOwnProperty("expireTime")) - object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); - if (message.upgradeTime != null && message.hasOwnProperty("upgradeTime")) - object.upgradeTime = $root.google.protobuf.Timestamp.toObject(message.upgradeTime, options); - if (message.expireBehavior != null && message.hasOwnProperty("expireBehavior")) - object.expireBehavior = options.enums === String ? $root.google.spanner.admin.instance.v1.FreeInstanceMetadata.ExpireBehavior[message.expireBehavior] === undefined ? message.expireBehavior : $root.google.spanner.admin.instance.v1.FreeInstanceMetadata.ExpireBehavior[message.expireBehavior] : message.expireBehavior; - return object; - }; - - /** - * Converts this FreeInstanceMetadata to JSON. - * @function toJSON - * @memberof google.spanner.admin.instance.v1.FreeInstanceMetadata - * @instance - * @returns {Object.} JSON object - */ - FreeInstanceMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FreeInstanceMetadata - * @function getTypeUrl - * @memberof google.spanner.admin.instance.v1.FreeInstanceMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FreeInstanceMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.instance.v1.FreeInstanceMetadata"; - }; - - /** - * ExpireBehavior enum. - * @name google.spanner.admin.instance.v1.FreeInstanceMetadata.ExpireBehavior - * @enum {number} - * @property {number} EXPIRE_BEHAVIOR_UNSPECIFIED=0 EXPIRE_BEHAVIOR_UNSPECIFIED value - * @property {number} FREE_TO_PROVISIONED=1 FREE_TO_PROVISIONED value - * @property {number} REMOVE_AFTER_GRACE_PERIOD=2 REMOVE_AFTER_GRACE_PERIOD value - */ - FreeInstanceMetadata.ExpireBehavior = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "EXPIRE_BEHAVIOR_UNSPECIFIED"] = 0; - values[valuesById[1] = "FREE_TO_PROVISIONED"] = 1; - values[valuesById[2] = "REMOVE_AFTER_GRACE_PERIOD"] = 2; - return values; - })(); - - return FreeInstanceMetadata; - })(); - - v1.CreateInstanceConfigMetadata = (function() { - - /** - * Properties of a CreateInstanceConfigMetadata. - * @memberof google.spanner.admin.instance.v1 - * @interface ICreateInstanceConfigMetadata - * @property {google.spanner.admin.instance.v1.IInstanceConfig|null} [instanceConfig] CreateInstanceConfigMetadata instanceConfig - * @property {google.spanner.admin.instance.v1.IOperationProgress|null} [progress] CreateInstanceConfigMetadata progress - * @property {google.protobuf.ITimestamp|null} [cancelTime] CreateInstanceConfigMetadata cancelTime - */ - - /** - * Constructs a new CreateInstanceConfigMetadata. - * @memberof google.spanner.admin.instance.v1 - * @classdesc Represents a CreateInstanceConfigMetadata. - * @implements ICreateInstanceConfigMetadata - * @constructor - * @param {google.spanner.admin.instance.v1.ICreateInstanceConfigMetadata=} [properties] Properties to set - */ - function CreateInstanceConfigMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateInstanceConfigMetadata instanceConfig. - * @member {google.spanner.admin.instance.v1.IInstanceConfig|null|undefined} instanceConfig - * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigMetadata - * @instance - */ - CreateInstanceConfigMetadata.prototype.instanceConfig = null; - - /** - * CreateInstanceConfigMetadata progress. - * @member {google.spanner.admin.instance.v1.IOperationProgress|null|undefined} progress - * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigMetadata - * @instance - */ - CreateInstanceConfigMetadata.prototype.progress = null; - - /** - * CreateInstanceConfigMetadata cancelTime. - * @member {google.protobuf.ITimestamp|null|undefined} cancelTime - * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigMetadata - * @instance - */ - CreateInstanceConfigMetadata.prototype.cancelTime = null; - - /** - * Creates a new CreateInstanceConfigMetadata instance using the specified properties. - * @function create - * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigMetadata - * @static - * @param {google.spanner.admin.instance.v1.ICreateInstanceConfigMetadata=} [properties] Properties to set - * @returns {google.spanner.admin.instance.v1.CreateInstanceConfigMetadata} CreateInstanceConfigMetadata instance - */ - CreateInstanceConfigMetadata.create = function create(properties) { - return new CreateInstanceConfigMetadata(properties); - }; - - /** - * Encodes the specified CreateInstanceConfigMetadata message. Does not implicitly {@link google.spanner.admin.instance.v1.CreateInstanceConfigMetadata.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigMetadata - * @static - * @param {google.spanner.admin.instance.v1.ICreateInstanceConfigMetadata} message CreateInstanceConfigMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateInstanceConfigMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.instanceConfig != null && Object.hasOwnProperty.call(message, "instanceConfig")) - $root.google.spanner.admin.instance.v1.InstanceConfig.encode(message.instanceConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.progress != null && Object.hasOwnProperty.call(message, "progress")) - $root.google.spanner.admin.instance.v1.OperationProgress.encode(message.progress, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.cancelTime != null && Object.hasOwnProperty.call(message, "cancelTime")) - $root.google.protobuf.Timestamp.encode(message.cancelTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CreateInstanceConfigMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.CreateInstanceConfigMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigMetadata - * @static - * @param {google.spanner.admin.instance.v1.ICreateInstanceConfigMetadata} message CreateInstanceConfigMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateInstanceConfigMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateInstanceConfigMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.instance.v1.CreateInstanceConfigMetadata} CreateInstanceConfigMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateInstanceConfigMetadata.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.CreateInstanceConfigMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.instanceConfig = $root.google.spanner.admin.instance.v1.InstanceConfig.decode(reader, reader.uint32()); - break; - } - case 2: { - message.progress = $root.google.spanner.admin.instance.v1.OperationProgress.decode(reader, reader.uint32()); - break; - } - case 3: { - message.cancelTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateInstanceConfigMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.instance.v1.CreateInstanceConfigMetadata} CreateInstanceConfigMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateInstanceConfigMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateInstanceConfigMetadata message. - * @function verify - * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateInstanceConfigMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.instanceConfig != null && message.hasOwnProperty("instanceConfig")) { - var error = $root.google.spanner.admin.instance.v1.InstanceConfig.verify(message.instanceConfig); - if (error) - return "instanceConfig." + error; - } - if (message.progress != null && message.hasOwnProperty("progress")) { - var error = $root.google.spanner.admin.instance.v1.OperationProgress.verify(message.progress); - if (error) - return "progress." + error; - } - if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.cancelTime); - if (error) - return "cancelTime." + error; - } - return null; - }; - - /** - * Creates a CreateInstanceConfigMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.instance.v1.CreateInstanceConfigMetadata} CreateInstanceConfigMetadata - */ - CreateInstanceConfigMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.instance.v1.CreateInstanceConfigMetadata) - return object; - var message = new $root.google.spanner.admin.instance.v1.CreateInstanceConfigMetadata(); - if (object.instanceConfig != null) { - if (typeof object.instanceConfig !== "object") - throw TypeError(".google.spanner.admin.instance.v1.CreateInstanceConfigMetadata.instanceConfig: object expected"); - message.instanceConfig = $root.google.spanner.admin.instance.v1.InstanceConfig.fromObject(object.instanceConfig); - } - if (object.progress != null) { - if (typeof object.progress !== "object") - throw TypeError(".google.spanner.admin.instance.v1.CreateInstanceConfigMetadata.progress: object expected"); - message.progress = $root.google.spanner.admin.instance.v1.OperationProgress.fromObject(object.progress); - } - if (object.cancelTime != null) { - if (typeof object.cancelTime !== "object") - throw TypeError(".google.spanner.admin.instance.v1.CreateInstanceConfigMetadata.cancelTime: object expected"); - message.cancelTime = $root.google.protobuf.Timestamp.fromObject(object.cancelTime); - } - return message; - }; - - /** - * Creates a plain object from a CreateInstanceConfigMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigMetadata - * @static - * @param {google.spanner.admin.instance.v1.CreateInstanceConfigMetadata} message CreateInstanceConfigMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateInstanceConfigMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.instanceConfig = null; - object.progress = null; - object.cancelTime = null; - } - if (message.instanceConfig != null && message.hasOwnProperty("instanceConfig")) - object.instanceConfig = $root.google.spanner.admin.instance.v1.InstanceConfig.toObject(message.instanceConfig, options); - if (message.progress != null && message.hasOwnProperty("progress")) - object.progress = $root.google.spanner.admin.instance.v1.OperationProgress.toObject(message.progress, options); - if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) - object.cancelTime = $root.google.protobuf.Timestamp.toObject(message.cancelTime, options); - return object; - }; - - /** - * Converts this CreateInstanceConfigMetadata to JSON. - * @function toJSON - * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigMetadata - * @instance - * @returns {Object.} JSON object - */ - CreateInstanceConfigMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateInstanceConfigMetadata - * @function getTypeUrl - * @memberof google.spanner.admin.instance.v1.CreateInstanceConfigMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateInstanceConfigMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.instance.v1.CreateInstanceConfigMetadata"; - }; - - return CreateInstanceConfigMetadata; - })(); - - v1.UpdateInstanceConfigMetadata = (function() { - - /** - * Properties of an UpdateInstanceConfigMetadata. - * @memberof google.spanner.admin.instance.v1 - * @interface IUpdateInstanceConfigMetadata - * @property {google.spanner.admin.instance.v1.IInstanceConfig|null} [instanceConfig] UpdateInstanceConfigMetadata instanceConfig - * @property {google.spanner.admin.instance.v1.IOperationProgress|null} [progress] UpdateInstanceConfigMetadata progress - * @property {google.protobuf.ITimestamp|null} [cancelTime] UpdateInstanceConfigMetadata cancelTime - */ - - /** - * Constructs a new UpdateInstanceConfigMetadata. - * @memberof google.spanner.admin.instance.v1 - * @classdesc Represents an UpdateInstanceConfigMetadata. - * @implements IUpdateInstanceConfigMetadata - * @constructor - * @param {google.spanner.admin.instance.v1.IUpdateInstanceConfigMetadata=} [properties] Properties to set - */ - function UpdateInstanceConfigMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateInstanceConfigMetadata instanceConfig. - * @member {google.spanner.admin.instance.v1.IInstanceConfig|null|undefined} instanceConfig - * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata - * @instance - */ - UpdateInstanceConfigMetadata.prototype.instanceConfig = null; - - /** - * UpdateInstanceConfigMetadata progress. - * @member {google.spanner.admin.instance.v1.IOperationProgress|null|undefined} progress - * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata - * @instance - */ - UpdateInstanceConfigMetadata.prototype.progress = null; - - /** - * UpdateInstanceConfigMetadata cancelTime. - * @member {google.protobuf.ITimestamp|null|undefined} cancelTime - * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata - * @instance - */ - UpdateInstanceConfigMetadata.prototype.cancelTime = null; - - /** - * Creates a new UpdateInstanceConfigMetadata instance using the specified properties. - * @function create - * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata - * @static - * @param {google.spanner.admin.instance.v1.IUpdateInstanceConfigMetadata=} [properties] Properties to set - * @returns {google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata} UpdateInstanceConfigMetadata instance - */ - UpdateInstanceConfigMetadata.create = function create(properties) { - return new UpdateInstanceConfigMetadata(properties); - }; - - /** - * Encodes the specified UpdateInstanceConfigMetadata message. Does not implicitly {@link google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata - * @static - * @param {google.spanner.admin.instance.v1.IUpdateInstanceConfigMetadata} message UpdateInstanceConfigMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateInstanceConfigMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.instanceConfig != null && Object.hasOwnProperty.call(message, "instanceConfig")) - $root.google.spanner.admin.instance.v1.InstanceConfig.encode(message.instanceConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.progress != null && Object.hasOwnProperty.call(message, "progress")) - $root.google.spanner.admin.instance.v1.OperationProgress.encode(message.progress, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.cancelTime != null && Object.hasOwnProperty.call(message, "cancelTime")) - $root.google.protobuf.Timestamp.encode(message.cancelTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified UpdateInstanceConfigMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata - * @static - * @param {google.spanner.admin.instance.v1.IUpdateInstanceConfigMetadata} message UpdateInstanceConfigMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateInstanceConfigMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateInstanceConfigMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata} UpdateInstanceConfigMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateInstanceConfigMetadata.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.instanceConfig = $root.google.spanner.admin.instance.v1.InstanceConfig.decode(reader, reader.uint32()); - break; - } - case 2: { - message.progress = $root.google.spanner.admin.instance.v1.OperationProgress.decode(reader, reader.uint32()); - break; - } - case 3: { - message.cancelTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateInstanceConfigMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata} UpdateInstanceConfigMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateInstanceConfigMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateInstanceConfigMetadata message. - * @function verify - * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateInstanceConfigMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.instanceConfig != null && message.hasOwnProperty("instanceConfig")) { - var error = $root.google.spanner.admin.instance.v1.InstanceConfig.verify(message.instanceConfig); - if (error) - return "instanceConfig." + error; - } - if (message.progress != null && message.hasOwnProperty("progress")) { - var error = $root.google.spanner.admin.instance.v1.OperationProgress.verify(message.progress); - if (error) - return "progress." + error; - } - if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.cancelTime); - if (error) - return "cancelTime." + error; - } - return null; - }; - - /** - * Creates an UpdateInstanceConfigMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata} UpdateInstanceConfigMetadata - */ - UpdateInstanceConfigMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata) - return object; - var message = new $root.google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata(); - if (object.instanceConfig != null) { - if (typeof object.instanceConfig !== "object") - throw TypeError(".google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata.instanceConfig: object expected"); - message.instanceConfig = $root.google.spanner.admin.instance.v1.InstanceConfig.fromObject(object.instanceConfig); - } - if (object.progress != null) { - if (typeof object.progress !== "object") - throw TypeError(".google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata.progress: object expected"); - message.progress = $root.google.spanner.admin.instance.v1.OperationProgress.fromObject(object.progress); - } - if (object.cancelTime != null) { - if (typeof object.cancelTime !== "object") - throw TypeError(".google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata.cancelTime: object expected"); - message.cancelTime = $root.google.protobuf.Timestamp.fromObject(object.cancelTime); - } - return message; - }; - - /** - * Creates a plain object from an UpdateInstanceConfigMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata - * @static - * @param {google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata} message UpdateInstanceConfigMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateInstanceConfigMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.instanceConfig = null; - object.progress = null; - object.cancelTime = null; - } - if (message.instanceConfig != null && message.hasOwnProperty("instanceConfig")) - object.instanceConfig = $root.google.spanner.admin.instance.v1.InstanceConfig.toObject(message.instanceConfig, options); - if (message.progress != null && message.hasOwnProperty("progress")) - object.progress = $root.google.spanner.admin.instance.v1.OperationProgress.toObject(message.progress, options); - if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) - object.cancelTime = $root.google.protobuf.Timestamp.toObject(message.cancelTime, options); - return object; - }; - - /** - * Converts this UpdateInstanceConfigMetadata to JSON. - * @function toJSON - * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata - * @instance - * @returns {Object.} JSON object - */ - UpdateInstanceConfigMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateInstanceConfigMetadata - * @function getTypeUrl - * @memberof google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateInstanceConfigMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata"; - }; - - return UpdateInstanceConfigMetadata; - })(); - - v1.InstancePartition = (function() { - - /** - * Properties of an InstancePartition. - * @memberof google.spanner.admin.instance.v1 - * @interface IInstancePartition - * @property {string|null} [name] InstancePartition name - * @property {string|null} [config] InstancePartition config - * @property {string|null} [displayName] InstancePartition displayName - * @property {number|null} [nodeCount] InstancePartition nodeCount - * @property {number|null} [processingUnits] InstancePartition processingUnits - * @property {google.spanner.admin.instance.v1.IAutoscalingConfig|null} [autoscalingConfig] InstancePartition autoscalingConfig - * @property {google.spanner.admin.instance.v1.InstancePartition.State|null} [state] InstancePartition state - * @property {google.protobuf.ITimestamp|null} [createTime] InstancePartition createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] InstancePartition updateTime - * @property {Array.|null} [referencingDatabases] InstancePartition referencingDatabases - * @property {Array.|null} [referencingBackups] InstancePartition referencingBackups - * @property {string|null} [etag] InstancePartition etag - */ - - /** - * Constructs a new InstancePartition. - * @memberof google.spanner.admin.instance.v1 - * @classdesc Represents an InstancePartition. - * @implements IInstancePartition - * @constructor - * @param {google.spanner.admin.instance.v1.IInstancePartition=} [properties] Properties to set - */ - function InstancePartition(properties) { - this.referencingDatabases = []; - this.referencingBackups = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * InstancePartition name. - * @member {string} name - * @memberof google.spanner.admin.instance.v1.InstancePartition - * @instance - */ - InstancePartition.prototype.name = ""; - - /** - * InstancePartition config. - * @member {string} config - * @memberof google.spanner.admin.instance.v1.InstancePartition - * @instance - */ - InstancePartition.prototype.config = ""; - - /** - * InstancePartition displayName. - * @member {string} displayName - * @memberof google.spanner.admin.instance.v1.InstancePartition - * @instance - */ - InstancePartition.prototype.displayName = ""; - - /** - * InstancePartition nodeCount. - * @member {number|null|undefined} nodeCount - * @memberof google.spanner.admin.instance.v1.InstancePartition - * @instance - */ - InstancePartition.prototype.nodeCount = null; - - /** - * InstancePartition processingUnits. - * @member {number|null|undefined} processingUnits - * @memberof google.spanner.admin.instance.v1.InstancePartition - * @instance - */ - InstancePartition.prototype.processingUnits = null; - - /** - * InstancePartition autoscalingConfig. - * @member {google.spanner.admin.instance.v1.IAutoscalingConfig|null|undefined} autoscalingConfig - * @memberof google.spanner.admin.instance.v1.InstancePartition - * @instance - */ - InstancePartition.prototype.autoscalingConfig = null; - - /** - * InstancePartition state. - * @member {google.spanner.admin.instance.v1.InstancePartition.State} state - * @memberof google.spanner.admin.instance.v1.InstancePartition - * @instance - */ - InstancePartition.prototype.state = 0; - - /** - * InstancePartition createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.spanner.admin.instance.v1.InstancePartition - * @instance - */ - InstancePartition.prototype.createTime = null; - - /** - * InstancePartition updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.spanner.admin.instance.v1.InstancePartition - * @instance - */ - InstancePartition.prototype.updateTime = null; - - /** - * InstancePartition referencingDatabases. - * @member {Array.} referencingDatabases - * @memberof google.spanner.admin.instance.v1.InstancePartition - * @instance - */ - InstancePartition.prototype.referencingDatabases = $util.emptyArray; - - /** - * InstancePartition referencingBackups. - * @member {Array.} referencingBackups - * @memberof google.spanner.admin.instance.v1.InstancePartition - * @instance - */ - InstancePartition.prototype.referencingBackups = $util.emptyArray; - - /** - * InstancePartition etag. - * @member {string} etag - * @memberof google.spanner.admin.instance.v1.InstancePartition - * @instance - */ - InstancePartition.prototype.etag = ""; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * InstancePartition computeCapacity. - * @member {"nodeCount"|"processingUnits"|undefined} computeCapacity - * @memberof google.spanner.admin.instance.v1.InstancePartition - * @instance - */ - Object.defineProperty(InstancePartition.prototype, "computeCapacity", { - get: $util.oneOfGetter($oneOfFields = ["nodeCount", "processingUnits"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new InstancePartition instance using the specified properties. - * @function create - * @memberof google.spanner.admin.instance.v1.InstancePartition - * @static - * @param {google.spanner.admin.instance.v1.IInstancePartition=} [properties] Properties to set - * @returns {google.spanner.admin.instance.v1.InstancePartition} InstancePartition instance - */ - InstancePartition.create = function create(properties) { - return new InstancePartition(properties); - }; - - /** - * Encodes the specified InstancePartition message. Does not implicitly {@link google.spanner.admin.instance.v1.InstancePartition.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.instance.v1.InstancePartition - * @static - * @param {google.spanner.admin.instance.v1.IInstancePartition} message InstancePartition message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InstancePartition.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.config != null && Object.hasOwnProperty.call(message, "config")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.config); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.displayName); - if (message.nodeCount != null && Object.hasOwnProperty.call(message, "nodeCount")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.nodeCount); - if (message.processingUnits != null && Object.hasOwnProperty.call(message, "processingUnits")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.processingUnits); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 7, wireType 0 =*/56).int32(message.state); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.referencingDatabases != null && message.referencingDatabases.length) - for (var i = 0; i < message.referencingDatabases.length; ++i) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.referencingDatabases[i]); - if (message.referencingBackups != null && message.referencingBackups.length) - for (var i = 0; i < message.referencingBackups.length; ++i) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.referencingBackups[i]); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.etag); - if (message.autoscalingConfig != null && Object.hasOwnProperty.call(message, "autoscalingConfig")) - $root.google.spanner.admin.instance.v1.AutoscalingConfig.encode(message.autoscalingConfig, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified InstancePartition message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.InstancePartition.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.instance.v1.InstancePartition - * @static - * @param {google.spanner.admin.instance.v1.IInstancePartition} message InstancePartition message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InstancePartition.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an InstancePartition message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.instance.v1.InstancePartition - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.instance.v1.InstancePartition} InstancePartition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InstancePartition.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.InstancePartition(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.config = reader.string(); - break; - } - case 3: { - message.displayName = reader.string(); - break; - } - case 5: { - message.nodeCount = reader.int32(); - break; - } - case 6: { - message.processingUnits = reader.int32(); - break; - } - case 13: { - message.autoscalingConfig = $root.google.spanner.admin.instance.v1.AutoscalingConfig.decode(reader, reader.uint32()); - break; - } - case 7: { - message.state = reader.int32(); - break; - } - case 8: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 9: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 10: { - if (!(message.referencingDatabases && message.referencingDatabases.length)) - message.referencingDatabases = []; - message.referencingDatabases.push(reader.string()); - break; - } - case 11: { - if (!(message.referencingBackups && message.referencingBackups.length)) - message.referencingBackups = []; - message.referencingBackups.push(reader.string()); - break; - } - case 12: { - message.etag = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an InstancePartition message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.instance.v1.InstancePartition - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.instance.v1.InstancePartition} InstancePartition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InstancePartition.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an InstancePartition message. - * @function verify - * @memberof google.spanner.admin.instance.v1.InstancePartition - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - InstancePartition.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.config != null && message.hasOwnProperty("config")) - if (!$util.isString(message.config)) - return "config: string expected"; - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) { - properties.computeCapacity = 1; - if (!$util.isInteger(message.nodeCount)) - return "nodeCount: integer expected"; - } - if (message.processingUnits != null && message.hasOwnProperty("processingUnits")) { - if (properties.computeCapacity === 1) - return "computeCapacity: multiple values"; - properties.computeCapacity = 1; - if (!$util.isInteger(message.processingUnits)) - return "processingUnits: integer expected"; - } - if (message.autoscalingConfig != null && message.hasOwnProperty("autoscalingConfig")) { - var error = $root.google.spanner.admin.instance.v1.AutoscalingConfig.verify(message.autoscalingConfig); - if (error) - return "autoscalingConfig." + 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.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); - if (error) - return "updateTime." + error; - } - if (message.referencingDatabases != null && message.hasOwnProperty("referencingDatabases")) { - if (!Array.isArray(message.referencingDatabases)) - return "referencingDatabases: array expected"; - for (var i = 0; i < message.referencingDatabases.length; ++i) - if (!$util.isString(message.referencingDatabases[i])) - return "referencingDatabases: string[] expected"; - } - if (message.referencingBackups != null && message.hasOwnProperty("referencingBackups")) { - if (!Array.isArray(message.referencingBackups)) - return "referencingBackups: array expected"; - for (var i = 0; i < message.referencingBackups.length; ++i) - if (!$util.isString(message.referencingBackups[i])) - return "referencingBackups: string[] expected"; - } - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - return null; - }; - - /** - * Creates an InstancePartition message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.instance.v1.InstancePartition - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.instance.v1.InstancePartition} InstancePartition - */ - InstancePartition.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.instance.v1.InstancePartition) - return object; - var message = new $root.google.spanner.admin.instance.v1.InstancePartition(); - if (object.name != null) - message.name = String(object.name); - if (object.config != null) - message.config = String(object.config); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.nodeCount != null) - message.nodeCount = object.nodeCount | 0; - if (object.processingUnits != null) - message.processingUnits = object.processingUnits | 0; - if (object.autoscalingConfig != null) { - if (typeof object.autoscalingConfig !== "object") - throw TypeError(".google.spanner.admin.instance.v1.InstancePartition.autoscalingConfig: object expected"); - message.autoscalingConfig = $root.google.spanner.admin.instance.v1.AutoscalingConfig.fromObject(object.autoscalingConfig); - } - switch (object.state) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "CREATING": - case 1: - message.state = 1; - break; - case "READY": - case 2: - message.state = 2; - break; - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.spanner.admin.instance.v1.InstancePartition.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.updateTime != null) { - if (typeof object.updateTime !== "object") - throw TypeError(".google.spanner.admin.instance.v1.InstancePartition.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.referencingDatabases) { - if (!Array.isArray(object.referencingDatabases)) - throw TypeError(".google.spanner.admin.instance.v1.InstancePartition.referencingDatabases: array expected"); - message.referencingDatabases = []; - for (var i = 0; i < object.referencingDatabases.length; ++i) - message.referencingDatabases[i] = String(object.referencingDatabases[i]); - } - if (object.referencingBackups) { - if (!Array.isArray(object.referencingBackups)) - throw TypeError(".google.spanner.admin.instance.v1.InstancePartition.referencingBackups: array expected"); - message.referencingBackups = []; - for (var i = 0; i < object.referencingBackups.length; ++i) - message.referencingBackups[i] = String(object.referencingBackups[i]); - } - if (object.etag != null) - message.etag = String(object.etag); - return message; - }; - - /** - * Creates a plain object from an InstancePartition message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.instance.v1.InstancePartition - * @static - * @param {google.spanner.admin.instance.v1.InstancePartition} message InstancePartition - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - InstancePartition.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.referencingDatabases = []; - object.referencingBackups = []; - } - if (options.defaults) { - object.name = ""; - object.config = ""; - object.displayName = ""; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.createTime = null; - object.updateTime = null; - object.etag = ""; - object.autoscalingConfig = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.config != null && message.hasOwnProperty("config")) - object.config = message.config; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) { - object.nodeCount = message.nodeCount; - if (options.oneofs) - object.computeCapacity = "nodeCount"; - } - if (message.processingUnits != null && message.hasOwnProperty("processingUnits")) { - object.processingUnits = message.processingUnits; - if (options.oneofs) - object.computeCapacity = "processingUnits"; - } - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.spanner.admin.instance.v1.InstancePartition.State[message.state] === undefined ? message.state : $root.google.spanner.admin.instance.v1.InstancePartition.State[message.state] : message.state; - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.updateTime != null && message.hasOwnProperty("updateTime")) - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); - if (message.referencingDatabases && message.referencingDatabases.length) { - object.referencingDatabases = []; - for (var j = 0; j < message.referencingDatabases.length; ++j) - object.referencingDatabases[j] = message.referencingDatabases[j]; - } - if (message.referencingBackups && message.referencingBackups.length) { - object.referencingBackups = []; - for (var j = 0; j < message.referencingBackups.length; ++j) - object.referencingBackups[j] = message.referencingBackups[j]; - } - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - if (message.autoscalingConfig != null && message.hasOwnProperty("autoscalingConfig")) - object.autoscalingConfig = $root.google.spanner.admin.instance.v1.AutoscalingConfig.toObject(message.autoscalingConfig, options); - return object; - }; - - /** - * Converts this InstancePartition to JSON. - * @function toJSON - * @memberof google.spanner.admin.instance.v1.InstancePartition - * @instance - * @returns {Object.} JSON object - */ - InstancePartition.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for InstancePartition - * @function getTypeUrl - * @memberof google.spanner.admin.instance.v1.InstancePartition - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - InstancePartition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.instance.v1.InstancePartition"; - }; - - /** - * State enum. - * @name google.spanner.admin.instance.v1.InstancePartition.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} CREATING=1 CREATING value - * @property {number} READY=2 READY value - */ - InstancePartition.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "CREATING"] = 1; - values[valuesById[2] = "READY"] = 2; - return values; - })(); - - return InstancePartition; - })(); - - v1.CreateInstancePartitionMetadata = (function() { - - /** - * Properties of a CreateInstancePartitionMetadata. - * @memberof google.spanner.admin.instance.v1 - * @interface ICreateInstancePartitionMetadata - * @property {google.spanner.admin.instance.v1.IInstancePartition|null} [instancePartition] CreateInstancePartitionMetadata instancePartition - * @property {google.protobuf.ITimestamp|null} [startTime] CreateInstancePartitionMetadata startTime - * @property {google.protobuf.ITimestamp|null} [cancelTime] CreateInstancePartitionMetadata cancelTime - * @property {google.protobuf.ITimestamp|null} [endTime] CreateInstancePartitionMetadata endTime - */ - - /** - * Constructs a new CreateInstancePartitionMetadata. - * @memberof google.spanner.admin.instance.v1 - * @classdesc Represents a CreateInstancePartitionMetadata. - * @implements ICreateInstancePartitionMetadata - * @constructor - * @param {google.spanner.admin.instance.v1.ICreateInstancePartitionMetadata=} [properties] Properties to set - */ - function CreateInstancePartitionMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateInstancePartitionMetadata instancePartition. - * @member {google.spanner.admin.instance.v1.IInstancePartition|null|undefined} instancePartition - * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionMetadata - * @instance - */ - CreateInstancePartitionMetadata.prototype.instancePartition = null; - - /** - * CreateInstancePartitionMetadata startTime. - * @member {google.protobuf.ITimestamp|null|undefined} startTime - * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionMetadata - * @instance - */ - CreateInstancePartitionMetadata.prototype.startTime = null; - - /** - * CreateInstancePartitionMetadata cancelTime. - * @member {google.protobuf.ITimestamp|null|undefined} cancelTime - * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionMetadata - * @instance - */ - CreateInstancePartitionMetadata.prototype.cancelTime = null; - - /** - * CreateInstancePartitionMetadata endTime. - * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionMetadata - * @instance - */ - CreateInstancePartitionMetadata.prototype.endTime = null; - - /** - * Creates a new CreateInstancePartitionMetadata instance using the specified properties. - * @function create - * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionMetadata - * @static - * @param {google.spanner.admin.instance.v1.ICreateInstancePartitionMetadata=} [properties] Properties to set - * @returns {google.spanner.admin.instance.v1.CreateInstancePartitionMetadata} CreateInstancePartitionMetadata instance - */ - CreateInstancePartitionMetadata.create = function create(properties) { - return new CreateInstancePartitionMetadata(properties); - }; - - /** - * Encodes the specified CreateInstancePartitionMetadata message. Does not implicitly {@link google.spanner.admin.instance.v1.CreateInstancePartitionMetadata.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionMetadata - * @static - * @param {google.spanner.admin.instance.v1.ICreateInstancePartitionMetadata} message CreateInstancePartitionMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateInstancePartitionMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.instancePartition != null && Object.hasOwnProperty.call(message, "instancePartition")) - $root.google.spanner.admin.instance.v1.InstancePartition.encode(message.instancePartition, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) - $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.cancelTime != null && Object.hasOwnProperty.call(message, "cancelTime")) - $root.google.protobuf.Timestamp.encode(message.cancelTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) - $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CreateInstancePartitionMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.CreateInstancePartitionMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionMetadata - * @static - * @param {google.spanner.admin.instance.v1.ICreateInstancePartitionMetadata} message CreateInstancePartitionMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateInstancePartitionMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateInstancePartitionMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.instance.v1.CreateInstancePartitionMetadata} CreateInstancePartitionMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateInstancePartitionMetadata.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.CreateInstancePartitionMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.instancePartition = $root.google.spanner.admin.instance.v1.InstancePartition.decode(reader, reader.uint32()); - break; - } - case 2: { - message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 3: { - message.cancelTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 4: { - message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateInstancePartitionMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.instance.v1.CreateInstancePartitionMetadata} CreateInstancePartitionMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateInstancePartitionMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateInstancePartitionMetadata message. - * @function verify - * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateInstancePartitionMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.instancePartition != null && message.hasOwnProperty("instancePartition")) { - var error = $root.google.spanner.admin.instance.v1.InstancePartition.verify(message.instancePartition); - if (error) - return "instancePartition." + error; - } - if (message.startTime != null && message.hasOwnProperty("startTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.startTime); - if (error) - return "startTime." + error; - } - if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.cancelTime); - if (error) - return "cancelTime." + error; - } - if (message.endTime != null && message.hasOwnProperty("endTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.endTime); - if (error) - return "endTime." + error; - } - return null; - }; - - /** - * Creates a CreateInstancePartitionMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.instance.v1.CreateInstancePartitionMetadata} CreateInstancePartitionMetadata - */ - CreateInstancePartitionMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.instance.v1.CreateInstancePartitionMetadata) - return object; - var message = new $root.google.spanner.admin.instance.v1.CreateInstancePartitionMetadata(); - if (object.instancePartition != null) { - if (typeof object.instancePartition !== "object") - throw TypeError(".google.spanner.admin.instance.v1.CreateInstancePartitionMetadata.instancePartition: object expected"); - message.instancePartition = $root.google.spanner.admin.instance.v1.InstancePartition.fromObject(object.instancePartition); - } - if (object.startTime != null) { - if (typeof object.startTime !== "object") - throw TypeError(".google.spanner.admin.instance.v1.CreateInstancePartitionMetadata.startTime: object expected"); - message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); - } - if (object.cancelTime != null) { - if (typeof object.cancelTime !== "object") - throw TypeError(".google.spanner.admin.instance.v1.CreateInstancePartitionMetadata.cancelTime: object expected"); - message.cancelTime = $root.google.protobuf.Timestamp.fromObject(object.cancelTime); - } - if (object.endTime != null) { - if (typeof object.endTime !== "object") - throw TypeError(".google.spanner.admin.instance.v1.CreateInstancePartitionMetadata.endTime: object expected"); - message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); - } - return message; - }; - - /** - * Creates a plain object from a CreateInstancePartitionMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionMetadata - * @static - * @param {google.spanner.admin.instance.v1.CreateInstancePartitionMetadata} message CreateInstancePartitionMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateInstancePartitionMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.instancePartition = null; - object.startTime = null; - object.cancelTime = null; - object.endTime = null; - } - if (message.instancePartition != null && message.hasOwnProperty("instancePartition")) - object.instancePartition = $root.google.spanner.admin.instance.v1.InstancePartition.toObject(message.instancePartition, options); - if (message.startTime != null && message.hasOwnProperty("startTime")) - object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); - if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) - object.cancelTime = $root.google.protobuf.Timestamp.toObject(message.cancelTime, options); - if (message.endTime != null && message.hasOwnProperty("endTime")) - object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); - return object; - }; - - /** - * Converts this CreateInstancePartitionMetadata to JSON. - * @function toJSON - * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionMetadata - * @instance - * @returns {Object.} JSON object - */ - CreateInstancePartitionMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateInstancePartitionMetadata - * @function getTypeUrl - * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateInstancePartitionMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.instance.v1.CreateInstancePartitionMetadata"; - }; - - return CreateInstancePartitionMetadata; - })(); - - v1.CreateInstancePartitionRequest = (function() { - - /** - * Properties of a CreateInstancePartitionRequest. - * @memberof google.spanner.admin.instance.v1 - * @interface ICreateInstancePartitionRequest - * @property {string|null} [parent] CreateInstancePartitionRequest parent - * @property {string|null} [instancePartitionId] CreateInstancePartitionRequest instancePartitionId - * @property {google.spanner.admin.instance.v1.IInstancePartition|null} [instancePartition] CreateInstancePartitionRequest instancePartition - */ - - /** - * Constructs a new CreateInstancePartitionRequest. - * @memberof google.spanner.admin.instance.v1 - * @classdesc Represents a CreateInstancePartitionRequest. - * @implements ICreateInstancePartitionRequest - * @constructor - * @param {google.spanner.admin.instance.v1.ICreateInstancePartitionRequest=} [properties] Properties to set - */ - function CreateInstancePartitionRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateInstancePartitionRequest parent. - * @member {string} parent - * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionRequest - * @instance - */ - CreateInstancePartitionRequest.prototype.parent = ""; - - /** - * CreateInstancePartitionRequest instancePartitionId. - * @member {string} instancePartitionId - * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionRequest - * @instance - */ - CreateInstancePartitionRequest.prototype.instancePartitionId = ""; - - /** - * CreateInstancePartitionRequest instancePartition. - * @member {google.spanner.admin.instance.v1.IInstancePartition|null|undefined} instancePartition - * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionRequest - * @instance - */ - CreateInstancePartitionRequest.prototype.instancePartition = null; - - /** - * Creates a new CreateInstancePartitionRequest instance using the specified properties. - * @function create - * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionRequest - * @static - * @param {google.spanner.admin.instance.v1.ICreateInstancePartitionRequest=} [properties] Properties to set - * @returns {google.spanner.admin.instance.v1.CreateInstancePartitionRequest} CreateInstancePartitionRequest instance - */ - CreateInstancePartitionRequest.create = function create(properties) { - return new CreateInstancePartitionRequest(properties); - }; - - /** - * Encodes the specified CreateInstancePartitionRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.CreateInstancePartitionRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionRequest - * @static - * @param {google.spanner.admin.instance.v1.ICreateInstancePartitionRequest} message CreateInstancePartitionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateInstancePartitionRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.instancePartitionId != null && Object.hasOwnProperty.call(message, "instancePartitionId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.instancePartitionId); - if (message.instancePartition != null && Object.hasOwnProperty.call(message, "instancePartition")) - $root.google.spanner.admin.instance.v1.InstancePartition.encode(message.instancePartition, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CreateInstancePartitionRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.CreateInstancePartitionRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionRequest - * @static - * @param {google.spanner.admin.instance.v1.ICreateInstancePartitionRequest} message CreateInstancePartitionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateInstancePartitionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateInstancePartitionRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.instance.v1.CreateInstancePartitionRequest} CreateInstancePartitionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateInstancePartitionRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.CreateInstancePartitionRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.instancePartitionId = reader.string(); - break; - } - case 3: { - message.instancePartition = $root.google.spanner.admin.instance.v1.InstancePartition.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateInstancePartitionRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.instance.v1.CreateInstancePartitionRequest} CreateInstancePartitionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateInstancePartitionRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateInstancePartitionRequest message. - * @function verify - * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateInstancePartitionRequest.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.instancePartitionId != null && message.hasOwnProperty("instancePartitionId")) - if (!$util.isString(message.instancePartitionId)) - return "instancePartitionId: string expected"; - if (message.instancePartition != null && message.hasOwnProperty("instancePartition")) { - var error = $root.google.spanner.admin.instance.v1.InstancePartition.verify(message.instancePartition); - if (error) - return "instancePartition." + error; - } - return null; - }; - - /** - * Creates a CreateInstancePartitionRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.instance.v1.CreateInstancePartitionRequest} CreateInstancePartitionRequest - */ - CreateInstancePartitionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.instance.v1.CreateInstancePartitionRequest) - return object; - var message = new $root.google.spanner.admin.instance.v1.CreateInstancePartitionRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.instancePartitionId != null) - message.instancePartitionId = String(object.instancePartitionId); - if (object.instancePartition != null) { - if (typeof object.instancePartition !== "object") - throw TypeError(".google.spanner.admin.instance.v1.CreateInstancePartitionRequest.instancePartition: object expected"); - message.instancePartition = $root.google.spanner.admin.instance.v1.InstancePartition.fromObject(object.instancePartition); - } - return message; - }; - - /** - * Creates a plain object from a CreateInstancePartitionRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionRequest - * @static - * @param {google.spanner.admin.instance.v1.CreateInstancePartitionRequest} message CreateInstancePartitionRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateInstancePartitionRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.instancePartitionId = ""; - object.instancePartition = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.instancePartitionId != null && message.hasOwnProperty("instancePartitionId")) - object.instancePartitionId = message.instancePartitionId; - if (message.instancePartition != null && message.hasOwnProperty("instancePartition")) - object.instancePartition = $root.google.spanner.admin.instance.v1.InstancePartition.toObject(message.instancePartition, options); - return object; - }; - - /** - * Converts this CreateInstancePartitionRequest to JSON. - * @function toJSON - * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionRequest - * @instance - * @returns {Object.} JSON object - */ - CreateInstancePartitionRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateInstancePartitionRequest - * @function getTypeUrl - * @memberof google.spanner.admin.instance.v1.CreateInstancePartitionRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateInstancePartitionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.instance.v1.CreateInstancePartitionRequest"; - }; - - return CreateInstancePartitionRequest; - })(); - - v1.DeleteInstancePartitionRequest = (function() { - - /** - * Properties of a DeleteInstancePartitionRequest. - * @memberof google.spanner.admin.instance.v1 - * @interface IDeleteInstancePartitionRequest - * @property {string|null} [name] DeleteInstancePartitionRequest name - * @property {string|null} [etag] DeleteInstancePartitionRequest etag - */ - - /** - * Constructs a new DeleteInstancePartitionRequest. - * @memberof google.spanner.admin.instance.v1 - * @classdesc Represents a DeleteInstancePartitionRequest. - * @implements IDeleteInstancePartitionRequest - * @constructor - * @param {google.spanner.admin.instance.v1.IDeleteInstancePartitionRequest=} [properties] Properties to set - */ - function DeleteInstancePartitionRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteInstancePartitionRequest name. - * @member {string} name - * @memberof google.spanner.admin.instance.v1.DeleteInstancePartitionRequest - * @instance - */ - DeleteInstancePartitionRequest.prototype.name = ""; - - /** - * DeleteInstancePartitionRequest etag. - * @member {string} etag - * @memberof google.spanner.admin.instance.v1.DeleteInstancePartitionRequest - * @instance - */ - DeleteInstancePartitionRequest.prototype.etag = ""; - - /** - * Creates a new DeleteInstancePartitionRequest instance using the specified properties. - * @function create - * @memberof google.spanner.admin.instance.v1.DeleteInstancePartitionRequest - * @static - * @param {google.spanner.admin.instance.v1.IDeleteInstancePartitionRequest=} [properties] Properties to set - * @returns {google.spanner.admin.instance.v1.DeleteInstancePartitionRequest} DeleteInstancePartitionRequest instance - */ - DeleteInstancePartitionRequest.create = function create(properties) { - return new DeleteInstancePartitionRequest(properties); - }; - - /** - * Encodes the specified DeleteInstancePartitionRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.DeleteInstancePartitionRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.instance.v1.DeleteInstancePartitionRequest - * @static - * @param {google.spanner.admin.instance.v1.IDeleteInstancePartitionRequest} message DeleteInstancePartitionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteInstancePartitionRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.etag); - return writer; - }; - - /** - * Encodes the specified DeleteInstancePartitionRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.DeleteInstancePartitionRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.instance.v1.DeleteInstancePartitionRequest - * @static - * @param {google.spanner.admin.instance.v1.IDeleteInstancePartitionRequest} message DeleteInstancePartitionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteInstancePartitionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteInstancePartitionRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.instance.v1.DeleteInstancePartitionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.instance.v1.DeleteInstancePartitionRequest} DeleteInstancePartitionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteInstancePartitionRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.DeleteInstancePartitionRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.etag = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteInstancePartitionRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.instance.v1.DeleteInstancePartitionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.instance.v1.DeleteInstancePartitionRequest} DeleteInstancePartitionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteInstancePartitionRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteInstancePartitionRequest message. - * @function verify - * @memberof google.spanner.admin.instance.v1.DeleteInstancePartitionRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteInstancePartitionRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - return null; - }; - - /** - * Creates a DeleteInstancePartitionRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.instance.v1.DeleteInstancePartitionRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.instance.v1.DeleteInstancePartitionRequest} DeleteInstancePartitionRequest - */ - DeleteInstancePartitionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.instance.v1.DeleteInstancePartitionRequest) - return object; - var message = new $root.google.spanner.admin.instance.v1.DeleteInstancePartitionRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.etag != null) - message.etag = String(object.etag); - return message; - }; - - /** - * Creates a plain object from a DeleteInstancePartitionRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.instance.v1.DeleteInstancePartitionRequest - * @static - * @param {google.spanner.admin.instance.v1.DeleteInstancePartitionRequest} message DeleteInstancePartitionRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteInstancePartitionRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.etag = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - return object; - }; - - /** - * Converts this DeleteInstancePartitionRequest to JSON. - * @function toJSON - * @memberof google.spanner.admin.instance.v1.DeleteInstancePartitionRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteInstancePartitionRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteInstancePartitionRequest - * @function getTypeUrl - * @memberof google.spanner.admin.instance.v1.DeleteInstancePartitionRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteInstancePartitionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.instance.v1.DeleteInstancePartitionRequest"; - }; - - return DeleteInstancePartitionRequest; - })(); - - v1.GetInstancePartitionRequest = (function() { - - /** - * Properties of a GetInstancePartitionRequest. - * @memberof google.spanner.admin.instance.v1 - * @interface IGetInstancePartitionRequest - * @property {string|null} [name] GetInstancePartitionRequest name - */ - - /** - * Constructs a new GetInstancePartitionRequest. - * @memberof google.spanner.admin.instance.v1 - * @classdesc Represents a GetInstancePartitionRequest. - * @implements IGetInstancePartitionRequest - * @constructor - * @param {google.spanner.admin.instance.v1.IGetInstancePartitionRequest=} [properties] Properties to set - */ - function GetInstancePartitionRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetInstancePartitionRequest name. - * @member {string} name - * @memberof google.spanner.admin.instance.v1.GetInstancePartitionRequest - * @instance - */ - GetInstancePartitionRequest.prototype.name = ""; - - /** - * Creates a new GetInstancePartitionRequest instance using the specified properties. - * @function create - * @memberof google.spanner.admin.instance.v1.GetInstancePartitionRequest - * @static - * @param {google.spanner.admin.instance.v1.IGetInstancePartitionRequest=} [properties] Properties to set - * @returns {google.spanner.admin.instance.v1.GetInstancePartitionRequest} GetInstancePartitionRequest instance - */ - GetInstancePartitionRequest.create = function create(properties) { - return new GetInstancePartitionRequest(properties); - }; - - /** - * Encodes the specified GetInstancePartitionRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.GetInstancePartitionRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.instance.v1.GetInstancePartitionRequest - * @static - * @param {google.spanner.admin.instance.v1.IGetInstancePartitionRequest} message GetInstancePartitionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetInstancePartitionRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; - - /** - * Encodes the specified GetInstancePartitionRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.GetInstancePartitionRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.instance.v1.GetInstancePartitionRequest - * @static - * @param {google.spanner.admin.instance.v1.IGetInstancePartitionRequest} message GetInstancePartitionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetInstancePartitionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetInstancePartitionRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.instance.v1.GetInstancePartitionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.instance.v1.GetInstancePartitionRequest} GetInstancePartitionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetInstancePartitionRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.GetInstancePartitionRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetInstancePartitionRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.instance.v1.GetInstancePartitionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.instance.v1.GetInstancePartitionRequest} GetInstancePartitionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetInstancePartitionRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetInstancePartitionRequest message. - * @function verify - * @memberof google.spanner.admin.instance.v1.GetInstancePartitionRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetInstancePartitionRequest.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 GetInstancePartitionRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.instance.v1.GetInstancePartitionRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.instance.v1.GetInstancePartitionRequest} GetInstancePartitionRequest - */ - GetInstancePartitionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.instance.v1.GetInstancePartitionRequest) - return object; - var message = new $root.google.spanner.admin.instance.v1.GetInstancePartitionRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetInstancePartitionRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.instance.v1.GetInstancePartitionRequest - * @static - * @param {google.spanner.admin.instance.v1.GetInstancePartitionRequest} message GetInstancePartitionRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetInstancePartitionRequest.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 GetInstancePartitionRequest to JSON. - * @function toJSON - * @memberof google.spanner.admin.instance.v1.GetInstancePartitionRequest - * @instance - * @returns {Object.} JSON object - */ - GetInstancePartitionRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetInstancePartitionRequest - * @function getTypeUrl - * @memberof google.spanner.admin.instance.v1.GetInstancePartitionRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetInstancePartitionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.instance.v1.GetInstancePartitionRequest"; - }; - - return GetInstancePartitionRequest; - })(); - - v1.UpdateInstancePartitionRequest = (function() { - - /** - * Properties of an UpdateInstancePartitionRequest. - * @memberof google.spanner.admin.instance.v1 - * @interface IUpdateInstancePartitionRequest - * @property {google.spanner.admin.instance.v1.IInstancePartition|null} [instancePartition] UpdateInstancePartitionRequest instancePartition - * @property {google.protobuf.IFieldMask|null} [fieldMask] UpdateInstancePartitionRequest fieldMask - */ - - /** - * Constructs a new UpdateInstancePartitionRequest. - * @memberof google.spanner.admin.instance.v1 - * @classdesc Represents an UpdateInstancePartitionRequest. - * @implements IUpdateInstancePartitionRequest - * @constructor - * @param {google.spanner.admin.instance.v1.IUpdateInstancePartitionRequest=} [properties] Properties to set - */ - function UpdateInstancePartitionRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateInstancePartitionRequest instancePartition. - * @member {google.spanner.admin.instance.v1.IInstancePartition|null|undefined} instancePartition - * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionRequest - * @instance - */ - UpdateInstancePartitionRequest.prototype.instancePartition = null; - - /** - * UpdateInstancePartitionRequest fieldMask. - * @member {google.protobuf.IFieldMask|null|undefined} fieldMask - * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionRequest - * @instance - */ - UpdateInstancePartitionRequest.prototype.fieldMask = null; - - /** - * Creates a new UpdateInstancePartitionRequest instance using the specified properties. - * @function create - * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionRequest - * @static - * @param {google.spanner.admin.instance.v1.IUpdateInstancePartitionRequest=} [properties] Properties to set - * @returns {google.spanner.admin.instance.v1.UpdateInstancePartitionRequest} UpdateInstancePartitionRequest instance - */ - UpdateInstancePartitionRequest.create = function create(properties) { - return new UpdateInstancePartitionRequest(properties); - }; - - /** - * Encodes the specified UpdateInstancePartitionRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.UpdateInstancePartitionRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionRequest - * @static - * @param {google.spanner.admin.instance.v1.IUpdateInstancePartitionRequest} message UpdateInstancePartitionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateInstancePartitionRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.instancePartition != null && Object.hasOwnProperty.call(message, "instancePartition")) - $root.google.spanner.admin.instance.v1.InstancePartition.encode(message.instancePartition, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.fieldMask != null && Object.hasOwnProperty.call(message, "fieldMask")) - $root.google.protobuf.FieldMask.encode(message.fieldMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified UpdateInstancePartitionRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.UpdateInstancePartitionRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionRequest - * @static - * @param {google.spanner.admin.instance.v1.IUpdateInstancePartitionRequest} message UpdateInstancePartitionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateInstancePartitionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateInstancePartitionRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.instance.v1.UpdateInstancePartitionRequest} UpdateInstancePartitionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateInstancePartitionRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.UpdateInstancePartitionRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.instancePartition = $root.google.spanner.admin.instance.v1.InstancePartition.decode(reader, reader.uint32()); - break; - } - case 2: { - message.fieldMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateInstancePartitionRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.instance.v1.UpdateInstancePartitionRequest} UpdateInstancePartitionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateInstancePartitionRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateInstancePartitionRequest message. - * @function verify - * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateInstancePartitionRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.instancePartition != null && message.hasOwnProperty("instancePartition")) { - var error = $root.google.spanner.admin.instance.v1.InstancePartition.verify(message.instancePartition); - if (error) - return "instancePartition." + error; - } - if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.fieldMask); - if (error) - return "fieldMask." + error; - } - return null; - }; - - /** - * Creates an UpdateInstancePartitionRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.instance.v1.UpdateInstancePartitionRequest} UpdateInstancePartitionRequest - */ - UpdateInstancePartitionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.instance.v1.UpdateInstancePartitionRequest) - return object; - var message = new $root.google.spanner.admin.instance.v1.UpdateInstancePartitionRequest(); - if (object.instancePartition != null) { - if (typeof object.instancePartition !== "object") - throw TypeError(".google.spanner.admin.instance.v1.UpdateInstancePartitionRequest.instancePartition: object expected"); - message.instancePartition = $root.google.spanner.admin.instance.v1.InstancePartition.fromObject(object.instancePartition); - } - if (object.fieldMask != null) { - if (typeof object.fieldMask !== "object") - throw TypeError(".google.spanner.admin.instance.v1.UpdateInstancePartitionRequest.fieldMask: object expected"); - message.fieldMask = $root.google.protobuf.FieldMask.fromObject(object.fieldMask); - } - return message; - }; - - /** - * Creates a plain object from an UpdateInstancePartitionRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionRequest - * @static - * @param {google.spanner.admin.instance.v1.UpdateInstancePartitionRequest} message UpdateInstancePartitionRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateInstancePartitionRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.instancePartition = null; - object.fieldMask = null; - } - if (message.instancePartition != null && message.hasOwnProperty("instancePartition")) - object.instancePartition = $root.google.spanner.admin.instance.v1.InstancePartition.toObject(message.instancePartition, options); - if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) - object.fieldMask = $root.google.protobuf.FieldMask.toObject(message.fieldMask, options); - return object; - }; - - /** - * Converts this UpdateInstancePartitionRequest to JSON. - * @function toJSON - * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateInstancePartitionRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateInstancePartitionRequest - * @function getTypeUrl - * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateInstancePartitionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.instance.v1.UpdateInstancePartitionRequest"; - }; - - return UpdateInstancePartitionRequest; - })(); - - v1.UpdateInstancePartitionMetadata = (function() { - - /** - * Properties of an UpdateInstancePartitionMetadata. - * @memberof google.spanner.admin.instance.v1 - * @interface IUpdateInstancePartitionMetadata - * @property {google.spanner.admin.instance.v1.IInstancePartition|null} [instancePartition] UpdateInstancePartitionMetadata instancePartition - * @property {google.protobuf.ITimestamp|null} [startTime] UpdateInstancePartitionMetadata startTime - * @property {google.protobuf.ITimestamp|null} [cancelTime] UpdateInstancePartitionMetadata cancelTime - * @property {google.protobuf.ITimestamp|null} [endTime] UpdateInstancePartitionMetadata endTime - */ - - /** - * Constructs a new UpdateInstancePartitionMetadata. - * @memberof google.spanner.admin.instance.v1 - * @classdesc Represents an UpdateInstancePartitionMetadata. - * @implements IUpdateInstancePartitionMetadata - * @constructor - * @param {google.spanner.admin.instance.v1.IUpdateInstancePartitionMetadata=} [properties] Properties to set - */ - function UpdateInstancePartitionMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateInstancePartitionMetadata instancePartition. - * @member {google.spanner.admin.instance.v1.IInstancePartition|null|undefined} instancePartition - * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata - * @instance - */ - UpdateInstancePartitionMetadata.prototype.instancePartition = null; - - /** - * UpdateInstancePartitionMetadata startTime. - * @member {google.protobuf.ITimestamp|null|undefined} startTime - * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata - * @instance - */ - UpdateInstancePartitionMetadata.prototype.startTime = null; - - /** - * UpdateInstancePartitionMetadata cancelTime. - * @member {google.protobuf.ITimestamp|null|undefined} cancelTime - * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata - * @instance - */ - UpdateInstancePartitionMetadata.prototype.cancelTime = null; - - /** - * UpdateInstancePartitionMetadata endTime. - * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata - * @instance - */ - UpdateInstancePartitionMetadata.prototype.endTime = null; - - /** - * Creates a new UpdateInstancePartitionMetadata instance using the specified properties. - * @function create - * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata - * @static - * @param {google.spanner.admin.instance.v1.IUpdateInstancePartitionMetadata=} [properties] Properties to set - * @returns {google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata} UpdateInstancePartitionMetadata instance - */ - UpdateInstancePartitionMetadata.create = function create(properties) { - return new UpdateInstancePartitionMetadata(properties); - }; - - /** - * Encodes the specified UpdateInstancePartitionMetadata message. Does not implicitly {@link google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata - * @static - * @param {google.spanner.admin.instance.v1.IUpdateInstancePartitionMetadata} message UpdateInstancePartitionMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateInstancePartitionMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.instancePartition != null && Object.hasOwnProperty.call(message, "instancePartition")) - $root.google.spanner.admin.instance.v1.InstancePartition.encode(message.instancePartition, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) - $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.cancelTime != null && Object.hasOwnProperty.call(message, "cancelTime")) - $root.google.protobuf.Timestamp.encode(message.cancelTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) - $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified UpdateInstancePartitionMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata - * @static - * @param {google.spanner.admin.instance.v1.IUpdateInstancePartitionMetadata} message UpdateInstancePartitionMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateInstancePartitionMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateInstancePartitionMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata} UpdateInstancePartitionMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateInstancePartitionMetadata.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.instancePartition = $root.google.spanner.admin.instance.v1.InstancePartition.decode(reader, reader.uint32()); - break; - } - case 2: { - message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 3: { - message.cancelTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 4: { - message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateInstancePartitionMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata} UpdateInstancePartitionMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateInstancePartitionMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateInstancePartitionMetadata message. - * @function verify - * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateInstancePartitionMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.instancePartition != null && message.hasOwnProperty("instancePartition")) { - var error = $root.google.spanner.admin.instance.v1.InstancePartition.verify(message.instancePartition); - if (error) - return "instancePartition." + error; - } - if (message.startTime != null && message.hasOwnProperty("startTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.startTime); - if (error) - return "startTime." + error; - } - if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.cancelTime); - if (error) - return "cancelTime." + error; - } - if (message.endTime != null && message.hasOwnProperty("endTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.endTime); - if (error) - return "endTime." + error; - } - return null; - }; - - /** - * Creates an UpdateInstancePartitionMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata} UpdateInstancePartitionMetadata - */ - UpdateInstancePartitionMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata) - return object; - var message = new $root.google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata(); - if (object.instancePartition != null) { - if (typeof object.instancePartition !== "object") - throw TypeError(".google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata.instancePartition: object expected"); - message.instancePartition = $root.google.spanner.admin.instance.v1.InstancePartition.fromObject(object.instancePartition); - } - if (object.startTime != null) { - if (typeof object.startTime !== "object") - throw TypeError(".google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata.startTime: object expected"); - message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); - } - if (object.cancelTime != null) { - if (typeof object.cancelTime !== "object") - throw TypeError(".google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata.cancelTime: object expected"); - message.cancelTime = $root.google.protobuf.Timestamp.fromObject(object.cancelTime); - } - if (object.endTime != null) { - if (typeof object.endTime !== "object") - throw TypeError(".google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata.endTime: object expected"); - message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); - } - return message; - }; - - /** - * Creates a plain object from an UpdateInstancePartitionMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata - * @static - * @param {google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata} message UpdateInstancePartitionMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateInstancePartitionMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.instancePartition = null; - object.startTime = null; - object.cancelTime = null; - object.endTime = null; - } - if (message.instancePartition != null && message.hasOwnProperty("instancePartition")) - object.instancePartition = $root.google.spanner.admin.instance.v1.InstancePartition.toObject(message.instancePartition, options); - if (message.startTime != null && message.hasOwnProperty("startTime")) - object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); - if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) - object.cancelTime = $root.google.protobuf.Timestamp.toObject(message.cancelTime, options); - if (message.endTime != null && message.hasOwnProperty("endTime")) - object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); - return object; - }; - - /** - * Converts this UpdateInstancePartitionMetadata to JSON. - * @function toJSON - * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata - * @instance - * @returns {Object.} JSON object - */ - UpdateInstancePartitionMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateInstancePartitionMetadata - * @function getTypeUrl - * @memberof google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateInstancePartitionMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata"; - }; - - return UpdateInstancePartitionMetadata; - })(); - - v1.ListInstancePartitionsRequest = (function() { - - /** - * Properties of a ListInstancePartitionsRequest. - * @memberof google.spanner.admin.instance.v1 - * @interface IListInstancePartitionsRequest - * @property {string|null} [parent] ListInstancePartitionsRequest parent - * @property {number|null} [pageSize] ListInstancePartitionsRequest pageSize - * @property {string|null} [pageToken] ListInstancePartitionsRequest pageToken - * @property {google.protobuf.ITimestamp|null} [instancePartitionDeadline] ListInstancePartitionsRequest instancePartitionDeadline - */ - - /** - * Constructs a new ListInstancePartitionsRequest. - * @memberof google.spanner.admin.instance.v1 - * @classdesc Represents a ListInstancePartitionsRequest. - * @implements IListInstancePartitionsRequest - * @constructor - * @param {google.spanner.admin.instance.v1.IListInstancePartitionsRequest=} [properties] Properties to set - */ - function ListInstancePartitionsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListInstancePartitionsRequest parent. - * @member {string} parent - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsRequest - * @instance - */ - ListInstancePartitionsRequest.prototype.parent = ""; - - /** - * ListInstancePartitionsRequest pageSize. - * @member {number} pageSize - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsRequest - * @instance - */ - ListInstancePartitionsRequest.prototype.pageSize = 0; - - /** - * ListInstancePartitionsRequest pageToken. - * @member {string} pageToken - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsRequest - * @instance - */ - ListInstancePartitionsRequest.prototype.pageToken = ""; - - /** - * ListInstancePartitionsRequest instancePartitionDeadline. - * @member {google.protobuf.ITimestamp|null|undefined} instancePartitionDeadline - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsRequest - * @instance - */ - ListInstancePartitionsRequest.prototype.instancePartitionDeadline = null; - - /** - * Creates a new ListInstancePartitionsRequest instance using the specified properties. - * @function create - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsRequest - * @static - * @param {google.spanner.admin.instance.v1.IListInstancePartitionsRequest=} [properties] Properties to set - * @returns {google.spanner.admin.instance.v1.ListInstancePartitionsRequest} ListInstancePartitionsRequest instance - */ - ListInstancePartitionsRequest.create = function create(properties) { - return new ListInstancePartitionsRequest(properties); - }; - - /** - * Encodes the specified ListInstancePartitionsRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancePartitionsRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsRequest - * @static - * @param {google.spanner.admin.instance.v1.IListInstancePartitionsRequest} message ListInstancePartitionsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListInstancePartitionsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.instancePartitionDeadline != null && Object.hasOwnProperty.call(message, "instancePartitionDeadline")) - $root.google.protobuf.Timestamp.encode(message.instancePartitionDeadline, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ListInstancePartitionsRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancePartitionsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsRequest - * @static - * @param {google.spanner.admin.instance.v1.IListInstancePartitionsRequest} message ListInstancePartitionsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListInstancePartitionsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListInstancePartitionsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.instance.v1.ListInstancePartitionsRequest} ListInstancePartitionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListInstancePartitionsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.ListInstancePartitionsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - case 4: { - message.instancePartitionDeadline = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListInstancePartitionsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.instance.v1.ListInstancePartitionsRequest} ListInstancePartitionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListInstancePartitionsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListInstancePartitionsRequest message. - * @function verify - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListInstancePartitionsRequest.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.instancePartitionDeadline != null && message.hasOwnProperty("instancePartitionDeadline")) { - var error = $root.google.protobuf.Timestamp.verify(message.instancePartitionDeadline); - if (error) - return "instancePartitionDeadline." + error; - } - return null; - }; - - /** - * Creates a ListInstancePartitionsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.instance.v1.ListInstancePartitionsRequest} ListInstancePartitionsRequest - */ - ListInstancePartitionsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.instance.v1.ListInstancePartitionsRequest) - return object; - var message = new $root.google.spanner.admin.instance.v1.ListInstancePartitionsRequest(); - 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); - if (object.instancePartitionDeadline != null) { - if (typeof object.instancePartitionDeadline !== "object") - throw TypeError(".google.spanner.admin.instance.v1.ListInstancePartitionsRequest.instancePartitionDeadline: object expected"); - message.instancePartitionDeadline = $root.google.protobuf.Timestamp.fromObject(object.instancePartitionDeadline); - } - return message; - }; - - /** - * Creates a plain object from a ListInstancePartitionsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsRequest - * @static - * @param {google.spanner.admin.instance.v1.ListInstancePartitionsRequest} message ListInstancePartitionsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListInstancePartitionsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.instancePartitionDeadline = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.instancePartitionDeadline != null && message.hasOwnProperty("instancePartitionDeadline")) - object.instancePartitionDeadline = $root.google.protobuf.Timestamp.toObject(message.instancePartitionDeadline, options); - return object; - }; - - /** - * Converts this ListInstancePartitionsRequest to JSON. - * @function toJSON - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsRequest - * @instance - * @returns {Object.} JSON object - */ - ListInstancePartitionsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListInstancePartitionsRequest - * @function getTypeUrl - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListInstancePartitionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.instance.v1.ListInstancePartitionsRequest"; - }; - - return ListInstancePartitionsRequest; - })(); - - v1.ListInstancePartitionsResponse = (function() { - - /** - * Properties of a ListInstancePartitionsResponse. - * @memberof google.spanner.admin.instance.v1 - * @interface IListInstancePartitionsResponse - * @property {Array.|null} [instancePartitions] ListInstancePartitionsResponse instancePartitions - * @property {string|null} [nextPageToken] ListInstancePartitionsResponse nextPageToken - * @property {Array.|null} [unreachable] ListInstancePartitionsResponse unreachable - */ - - /** - * Constructs a new ListInstancePartitionsResponse. - * @memberof google.spanner.admin.instance.v1 - * @classdesc Represents a ListInstancePartitionsResponse. - * @implements IListInstancePartitionsResponse - * @constructor - * @param {google.spanner.admin.instance.v1.IListInstancePartitionsResponse=} [properties] Properties to set - */ - function ListInstancePartitionsResponse(properties) { - this.instancePartitions = []; - this.unreachable = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListInstancePartitionsResponse instancePartitions. - * @member {Array.} instancePartitions - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsResponse - * @instance - */ - ListInstancePartitionsResponse.prototype.instancePartitions = $util.emptyArray; - - /** - * ListInstancePartitionsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsResponse - * @instance - */ - ListInstancePartitionsResponse.prototype.nextPageToken = ""; - - /** - * ListInstancePartitionsResponse unreachable. - * @member {Array.} unreachable - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsResponse - * @instance - */ - ListInstancePartitionsResponse.prototype.unreachable = $util.emptyArray; - - /** - * Creates a new ListInstancePartitionsResponse instance using the specified properties. - * @function create - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsResponse - * @static - * @param {google.spanner.admin.instance.v1.IListInstancePartitionsResponse=} [properties] Properties to set - * @returns {google.spanner.admin.instance.v1.ListInstancePartitionsResponse} ListInstancePartitionsResponse instance - */ - ListInstancePartitionsResponse.create = function create(properties) { - return new ListInstancePartitionsResponse(properties); - }; - - /** - * Encodes the specified ListInstancePartitionsResponse message. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancePartitionsResponse.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsResponse - * @static - * @param {google.spanner.admin.instance.v1.IListInstancePartitionsResponse} message ListInstancePartitionsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListInstancePartitionsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.instancePartitions != null && message.instancePartitions.length) - for (var i = 0; i < message.instancePartitions.length; ++i) - $root.google.spanner.admin.instance.v1.InstancePartition.encode(message.instancePartitions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - if (message.unreachable != null && message.unreachable.length) - for (var i = 0; i < message.unreachable.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); - return writer; - }; - - /** - * Encodes the specified ListInstancePartitionsResponse message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancePartitionsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsResponse - * @static - * @param {google.spanner.admin.instance.v1.IListInstancePartitionsResponse} message ListInstancePartitionsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListInstancePartitionsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListInstancePartitionsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.instance.v1.ListInstancePartitionsResponse} ListInstancePartitionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListInstancePartitionsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.ListInstancePartitionsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.instancePartitions && message.instancePartitions.length)) - message.instancePartitions = []; - message.instancePartitions.push($root.google.spanner.admin.instance.v1.InstancePartition.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - case 3: { - if (!(message.unreachable && message.unreachable.length)) - message.unreachable = []; - message.unreachable.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListInstancePartitionsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.instance.v1.ListInstancePartitionsResponse} ListInstancePartitionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListInstancePartitionsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListInstancePartitionsResponse message. - * @function verify - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListInstancePartitionsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.instancePartitions != null && message.hasOwnProperty("instancePartitions")) { - if (!Array.isArray(message.instancePartitions)) - return "instancePartitions: array expected"; - for (var i = 0; i < message.instancePartitions.length; ++i) { - var error = $root.google.spanner.admin.instance.v1.InstancePartition.verify(message.instancePartitions[i]); - if (error) - return "instancePartitions." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - if (message.unreachable != null && message.hasOwnProperty("unreachable")) { - if (!Array.isArray(message.unreachable)) - return "unreachable: array expected"; - for (var i = 0; i < message.unreachable.length; ++i) - if (!$util.isString(message.unreachable[i])) - return "unreachable: string[] expected"; - } - return null; - }; - - /** - * Creates a ListInstancePartitionsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.instance.v1.ListInstancePartitionsResponse} ListInstancePartitionsResponse - */ - ListInstancePartitionsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.instance.v1.ListInstancePartitionsResponse) - return object; - var message = new $root.google.spanner.admin.instance.v1.ListInstancePartitionsResponse(); - if (object.instancePartitions) { - if (!Array.isArray(object.instancePartitions)) - throw TypeError(".google.spanner.admin.instance.v1.ListInstancePartitionsResponse.instancePartitions: array expected"); - message.instancePartitions = []; - for (var i = 0; i < object.instancePartitions.length; ++i) { - if (typeof object.instancePartitions[i] !== "object") - throw TypeError(".google.spanner.admin.instance.v1.ListInstancePartitionsResponse.instancePartitions: object expected"); - message.instancePartitions[i] = $root.google.spanner.admin.instance.v1.InstancePartition.fromObject(object.instancePartitions[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.unreachable) { - if (!Array.isArray(object.unreachable)) - throw TypeError(".google.spanner.admin.instance.v1.ListInstancePartitionsResponse.unreachable: array expected"); - message.unreachable = []; - for (var i = 0; i < object.unreachable.length; ++i) - message.unreachable[i] = String(object.unreachable[i]); - } - return message; - }; - - /** - * Creates a plain object from a ListInstancePartitionsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsResponse - * @static - * @param {google.spanner.admin.instance.v1.ListInstancePartitionsResponse} message ListInstancePartitionsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListInstancePartitionsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.instancePartitions = []; - object.unreachable = []; - } - if (options.defaults) - object.nextPageToken = ""; - if (message.instancePartitions && message.instancePartitions.length) { - object.instancePartitions = []; - for (var j = 0; j < message.instancePartitions.length; ++j) - object.instancePartitions[j] = $root.google.spanner.admin.instance.v1.InstancePartition.toObject(message.instancePartitions[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - if (message.unreachable && message.unreachable.length) { - object.unreachable = []; - for (var j = 0; j < message.unreachable.length; ++j) - object.unreachable[j] = message.unreachable[j]; - } - return object; - }; - - /** - * Converts this ListInstancePartitionsResponse to JSON. - * @function toJSON - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsResponse - * @instance - * @returns {Object.} JSON object - */ - ListInstancePartitionsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListInstancePartitionsResponse - * @function getTypeUrl - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListInstancePartitionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.instance.v1.ListInstancePartitionsResponse"; - }; - - return ListInstancePartitionsResponse; - })(); - - v1.ListInstancePartitionOperationsRequest = (function() { - - /** - * Properties of a ListInstancePartitionOperationsRequest. - * @memberof google.spanner.admin.instance.v1 - * @interface IListInstancePartitionOperationsRequest - * @property {string|null} [parent] ListInstancePartitionOperationsRequest parent - * @property {string|null} [filter] ListInstancePartitionOperationsRequest filter - * @property {number|null} [pageSize] ListInstancePartitionOperationsRequest pageSize - * @property {string|null} [pageToken] ListInstancePartitionOperationsRequest pageToken - * @property {google.protobuf.ITimestamp|null} [instancePartitionDeadline] ListInstancePartitionOperationsRequest instancePartitionDeadline - */ - - /** - * Constructs a new ListInstancePartitionOperationsRequest. - * @memberof google.spanner.admin.instance.v1 - * @classdesc Represents a ListInstancePartitionOperationsRequest. - * @implements IListInstancePartitionOperationsRequest - * @constructor - * @param {google.spanner.admin.instance.v1.IListInstancePartitionOperationsRequest=} [properties] Properties to set - */ - function ListInstancePartitionOperationsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListInstancePartitionOperationsRequest parent. - * @member {string} parent - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest - * @instance - */ - ListInstancePartitionOperationsRequest.prototype.parent = ""; - - /** - * ListInstancePartitionOperationsRequest filter. - * @member {string} filter - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest - * @instance - */ - ListInstancePartitionOperationsRequest.prototype.filter = ""; - - /** - * ListInstancePartitionOperationsRequest pageSize. - * @member {number} pageSize - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest - * @instance - */ - ListInstancePartitionOperationsRequest.prototype.pageSize = 0; - - /** - * ListInstancePartitionOperationsRequest pageToken. - * @member {string} pageToken - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest - * @instance - */ - ListInstancePartitionOperationsRequest.prototype.pageToken = ""; - - /** - * ListInstancePartitionOperationsRequest instancePartitionDeadline. - * @member {google.protobuf.ITimestamp|null|undefined} instancePartitionDeadline - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest - * @instance - */ - ListInstancePartitionOperationsRequest.prototype.instancePartitionDeadline = null; - - /** - * Creates a new ListInstancePartitionOperationsRequest instance using the specified properties. - * @function create - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest - * @static - * @param {google.spanner.admin.instance.v1.IListInstancePartitionOperationsRequest=} [properties] Properties to set - * @returns {google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest} ListInstancePartitionOperationsRequest instance - */ - ListInstancePartitionOperationsRequest.create = function create(properties) { - return new ListInstancePartitionOperationsRequest(properties); - }; - - /** - * Encodes the specified ListInstancePartitionOperationsRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest - * @static - * @param {google.spanner.admin.instance.v1.IListInstancePartitionOperationsRequest} message ListInstancePartitionOperationsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListInstancePartitionOperationsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); - if (message.instancePartitionDeadline != null && Object.hasOwnProperty.call(message, "instancePartitionDeadline")) - $root.google.protobuf.Timestamp.encode(message.instancePartitionDeadline, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ListInstancePartitionOperationsRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest - * @static - * @param {google.spanner.admin.instance.v1.IListInstancePartitionOperationsRequest} message ListInstancePartitionOperationsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListInstancePartitionOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListInstancePartitionOperationsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest} ListInstancePartitionOperationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListInstancePartitionOperationsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.filter = reader.string(); - break; - } - case 3: { - message.pageSize = reader.int32(); - break; - } - case 4: { - message.pageToken = reader.string(); - break; - } - case 5: { - message.instancePartitionDeadline = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListInstancePartitionOperationsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest} ListInstancePartitionOperationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListInstancePartitionOperationsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListInstancePartitionOperationsRequest message. - * @function verify - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListInstancePartitionOperationsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.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.instancePartitionDeadline != null && message.hasOwnProperty("instancePartitionDeadline")) { - var error = $root.google.protobuf.Timestamp.verify(message.instancePartitionDeadline); - if (error) - return "instancePartitionDeadline." + error; - } - return null; - }; - - /** - * Creates a ListInstancePartitionOperationsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest} ListInstancePartitionOperationsRequest - */ - ListInstancePartitionOperationsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest) - return object; - var message = new $root.google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.filter != null) - message.filter = String(object.filter); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.instancePartitionDeadline != null) { - if (typeof object.instancePartitionDeadline !== "object") - throw TypeError(".google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest.instancePartitionDeadline: object expected"); - message.instancePartitionDeadline = $root.google.protobuf.Timestamp.fromObject(object.instancePartitionDeadline); - } - return message; - }; - - /** - * Creates a plain object from a ListInstancePartitionOperationsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest - * @static - * @param {google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest} message ListInstancePartitionOperationsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListInstancePartitionOperationsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.filter = ""; - object.pageSize = 0; - object.pageToken = ""; - object.instancePartitionDeadline = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.instancePartitionDeadline != null && message.hasOwnProperty("instancePartitionDeadline")) - object.instancePartitionDeadline = $root.google.protobuf.Timestamp.toObject(message.instancePartitionDeadline, options); - return object; - }; - - /** - * Converts this ListInstancePartitionOperationsRequest to JSON. - * @function toJSON - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest - * @instance - * @returns {Object.} JSON object - */ - ListInstancePartitionOperationsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListInstancePartitionOperationsRequest - * @function getTypeUrl - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListInstancePartitionOperationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest"; - }; - - return ListInstancePartitionOperationsRequest; - })(); - - v1.ListInstancePartitionOperationsResponse = (function() { - - /** - * Properties of a ListInstancePartitionOperationsResponse. - * @memberof google.spanner.admin.instance.v1 - * @interface IListInstancePartitionOperationsResponse - * @property {Array.|null} [operations] ListInstancePartitionOperationsResponse operations - * @property {string|null} [nextPageToken] ListInstancePartitionOperationsResponse nextPageToken - * @property {Array.|null} [unreachableInstancePartitions] ListInstancePartitionOperationsResponse unreachableInstancePartitions - */ - - /** - * Constructs a new ListInstancePartitionOperationsResponse. - * @memberof google.spanner.admin.instance.v1 - * @classdesc Represents a ListInstancePartitionOperationsResponse. - * @implements IListInstancePartitionOperationsResponse - * @constructor - * @param {google.spanner.admin.instance.v1.IListInstancePartitionOperationsResponse=} [properties] Properties to set - */ - function ListInstancePartitionOperationsResponse(properties) { - this.operations = []; - this.unreachableInstancePartitions = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListInstancePartitionOperationsResponse operations. - * @member {Array.} operations - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse - * @instance - */ - ListInstancePartitionOperationsResponse.prototype.operations = $util.emptyArray; - - /** - * ListInstancePartitionOperationsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse - * @instance - */ - ListInstancePartitionOperationsResponse.prototype.nextPageToken = ""; - - /** - * ListInstancePartitionOperationsResponse unreachableInstancePartitions. - * @member {Array.} unreachableInstancePartitions - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse - * @instance - */ - ListInstancePartitionOperationsResponse.prototype.unreachableInstancePartitions = $util.emptyArray; - - /** - * Creates a new ListInstancePartitionOperationsResponse instance using the specified properties. - * @function create - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse - * @static - * @param {google.spanner.admin.instance.v1.IListInstancePartitionOperationsResponse=} [properties] Properties to set - * @returns {google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse} ListInstancePartitionOperationsResponse instance - */ - ListInstancePartitionOperationsResponse.create = function create(properties) { - return new ListInstancePartitionOperationsResponse(properties); - }; - - /** - * Encodes the specified ListInstancePartitionOperationsResponse message. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse - * @static - * @param {google.spanner.admin.instance.v1.IListInstancePartitionOperationsResponse} message ListInstancePartitionOperationsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListInstancePartitionOperationsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.operations != null && message.operations.length) - for (var i = 0; i < message.operations.length; ++i) - $root.google.longrunning.Operation.encode(message.operations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - if (message.unreachableInstancePartitions != null && message.unreachableInstancePartitions.length) - for (var i = 0; i < message.unreachableInstancePartitions.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachableInstancePartitions[i]); - return writer; - }; - - /** - * Encodes the specified ListInstancePartitionOperationsResponse message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse - * @static - * @param {google.spanner.admin.instance.v1.IListInstancePartitionOperationsResponse} message ListInstancePartitionOperationsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListInstancePartitionOperationsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListInstancePartitionOperationsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse} ListInstancePartitionOperationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListInstancePartitionOperationsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.operations && message.operations.length)) - message.operations = []; - message.operations.push($root.google.longrunning.Operation.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - case 3: { - if (!(message.unreachableInstancePartitions && message.unreachableInstancePartitions.length)) - message.unreachableInstancePartitions = []; - message.unreachableInstancePartitions.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListInstancePartitionOperationsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse} ListInstancePartitionOperationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListInstancePartitionOperationsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListInstancePartitionOperationsResponse message. - * @function verify - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListInstancePartitionOperationsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.operations != null && message.hasOwnProperty("operations")) { - if (!Array.isArray(message.operations)) - return "operations: array expected"; - for (var i = 0; i < message.operations.length; ++i) { - var error = $root.google.longrunning.Operation.verify(message.operations[i]); - if (error) - return "operations." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - if (message.unreachableInstancePartitions != null && message.hasOwnProperty("unreachableInstancePartitions")) { - if (!Array.isArray(message.unreachableInstancePartitions)) - return "unreachableInstancePartitions: array expected"; - for (var i = 0; i < message.unreachableInstancePartitions.length; ++i) - if (!$util.isString(message.unreachableInstancePartitions[i])) - return "unreachableInstancePartitions: string[] expected"; - } - return null; - }; - - /** - * Creates a ListInstancePartitionOperationsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse} ListInstancePartitionOperationsResponse - */ - ListInstancePartitionOperationsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse) - return object; - var message = new $root.google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse(); - if (object.operations) { - if (!Array.isArray(object.operations)) - throw TypeError(".google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse.operations: array expected"); - message.operations = []; - for (var i = 0; i < object.operations.length; ++i) { - if (typeof object.operations[i] !== "object") - throw TypeError(".google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse.operations: object expected"); - message.operations[i] = $root.google.longrunning.Operation.fromObject(object.operations[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.unreachableInstancePartitions) { - if (!Array.isArray(object.unreachableInstancePartitions)) - throw TypeError(".google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse.unreachableInstancePartitions: array expected"); - message.unreachableInstancePartitions = []; - for (var i = 0; i < object.unreachableInstancePartitions.length; ++i) - message.unreachableInstancePartitions[i] = String(object.unreachableInstancePartitions[i]); - } - return message; - }; - - /** - * Creates a plain object from a ListInstancePartitionOperationsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse - * @static - * @param {google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse} message ListInstancePartitionOperationsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListInstancePartitionOperationsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.operations = []; - object.unreachableInstancePartitions = []; - } - if (options.defaults) - object.nextPageToken = ""; - if (message.operations && message.operations.length) { - object.operations = []; - for (var j = 0; j < message.operations.length; ++j) - object.operations[j] = $root.google.longrunning.Operation.toObject(message.operations[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - if (message.unreachableInstancePartitions && message.unreachableInstancePartitions.length) { - object.unreachableInstancePartitions = []; - for (var j = 0; j < message.unreachableInstancePartitions.length; ++j) - object.unreachableInstancePartitions[j] = message.unreachableInstancePartitions[j]; - } - return object; - }; - - /** - * Converts this ListInstancePartitionOperationsResponse to JSON. - * @function toJSON - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse - * @instance - * @returns {Object.} JSON object - */ - ListInstancePartitionOperationsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListInstancePartitionOperationsResponse - * @function getTypeUrl - * @memberof google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListInstancePartitionOperationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse"; - }; - - return ListInstancePartitionOperationsResponse; - })(); - - v1.MoveInstanceRequest = (function() { - - /** - * Properties of a MoveInstanceRequest. - * @memberof google.spanner.admin.instance.v1 - * @interface IMoveInstanceRequest - * @property {string|null} [name] MoveInstanceRequest name - * @property {string|null} [targetConfig] MoveInstanceRequest targetConfig - */ - - /** - * Constructs a new MoveInstanceRequest. - * @memberof google.spanner.admin.instance.v1 - * @classdesc Represents a MoveInstanceRequest. - * @implements IMoveInstanceRequest - * @constructor - * @param {google.spanner.admin.instance.v1.IMoveInstanceRequest=} [properties] Properties to set - */ - function MoveInstanceRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MoveInstanceRequest name. - * @member {string} name - * @memberof google.spanner.admin.instance.v1.MoveInstanceRequest - * @instance - */ - MoveInstanceRequest.prototype.name = ""; - - /** - * MoveInstanceRequest targetConfig. - * @member {string} targetConfig - * @memberof google.spanner.admin.instance.v1.MoveInstanceRequest - * @instance - */ - MoveInstanceRequest.prototype.targetConfig = ""; - - /** - * Creates a new MoveInstanceRequest instance using the specified properties. - * @function create - * @memberof google.spanner.admin.instance.v1.MoveInstanceRequest - * @static - * @param {google.spanner.admin.instance.v1.IMoveInstanceRequest=} [properties] Properties to set - * @returns {google.spanner.admin.instance.v1.MoveInstanceRequest} MoveInstanceRequest instance - */ - MoveInstanceRequest.create = function create(properties) { - return new MoveInstanceRequest(properties); - }; - - /** - * Encodes the specified MoveInstanceRequest message. Does not implicitly {@link google.spanner.admin.instance.v1.MoveInstanceRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.instance.v1.MoveInstanceRequest - * @static - * @param {google.spanner.admin.instance.v1.IMoveInstanceRequest} message MoveInstanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MoveInstanceRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.targetConfig != null && Object.hasOwnProperty.call(message, "targetConfig")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.targetConfig); - return writer; - }; - - /** - * Encodes the specified MoveInstanceRequest message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.MoveInstanceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.instance.v1.MoveInstanceRequest - * @static - * @param {google.spanner.admin.instance.v1.IMoveInstanceRequest} message MoveInstanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MoveInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MoveInstanceRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.instance.v1.MoveInstanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.instance.v1.MoveInstanceRequest} MoveInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MoveInstanceRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.MoveInstanceRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.targetConfig = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MoveInstanceRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.instance.v1.MoveInstanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.instance.v1.MoveInstanceRequest} MoveInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MoveInstanceRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MoveInstanceRequest message. - * @function verify - * @memberof google.spanner.admin.instance.v1.MoveInstanceRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MoveInstanceRequest.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.targetConfig != null && message.hasOwnProperty("targetConfig")) - if (!$util.isString(message.targetConfig)) - return "targetConfig: string expected"; - return null; - }; - - /** - * Creates a MoveInstanceRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.instance.v1.MoveInstanceRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.instance.v1.MoveInstanceRequest} MoveInstanceRequest - */ - MoveInstanceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.instance.v1.MoveInstanceRequest) - return object; - var message = new $root.google.spanner.admin.instance.v1.MoveInstanceRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.targetConfig != null) - message.targetConfig = String(object.targetConfig); - return message; - }; - - /** - * Creates a plain object from a MoveInstanceRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.instance.v1.MoveInstanceRequest - * @static - * @param {google.spanner.admin.instance.v1.MoveInstanceRequest} message MoveInstanceRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MoveInstanceRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.targetConfig = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.targetConfig != null && message.hasOwnProperty("targetConfig")) - object.targetConfig = message.targetConfig; - return object; - }; - - /** - * Converts this MoveInstanceRequest to JSON. - * @function toJSON - * @memberof google.spanner.admin.instance.v1.MoveInstanceRequest - * @instance - * @returns {Object.} JSON object - */ - MoveInstanceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MoveInstanceRequest - * @function getTypeUrl - * @memberof google.spanner.admin.instance.v1.MoveInstanceRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MoveInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.instance.v1.MoveInstanceRequest"; - }; - - return MoveInstanceRequest; - })(); - - v1.MoveInstanceResponse = (function() { - - /** - * Properties of a MoveInstanceResponse. - * @memberof google.spanner.admin.instance.v1 - * @interface IMoveInstanceResponse - */ - - /** - * Constructs a new MoveInstanceResponse. - * @memberof google.spanner.admin.instance.v1 - * @classdesc Represents a MoveInstanceResponse. - * @implements IMoveInstanceResponse - * @constructor - * @param {google.spanner.admin.instance.v1.IMoveInstanceResponse=} [properties] Properties to set - */ - function MoveInstanceResponse(properties) { - if (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 MoveInstanceResponse instance using the specified properties. - * @function create - * @memberof google.spanner.admin.instance.v1.MoveInstanceResponse - * @static - * @param {google.spanner.admin.instance.v1.IMoveInstanceResponse=} [properties] Properties to set - * @returns {google.spanner.admin.instance.v1.MoveInstanceResponse} MoveInstanceResponse instance - */ - MoveInstanceResponse.create = function create(properties) { - return new MoveInstanceResponse(properties); - }; - - /** - * Encodes the specified MoveInstanceResponse message. Does not implicitly {@link google.spanner.admin.instance.v1.MoveInstanceResponse.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.instance.v1.MoveInstanceResponse - * @static - * @param {google.spanner.admin.instance.v1.IMoveInstanceResponse} message MoveInstanceResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MoveInstanceResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified MoveInstanceResponse message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.MoveInstanceResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.instance.v1.MoveInstanceResponse - * @static - * @param {google.spanner.admin.instance.v1.IMoveInstanceResponse} message MoveInstanceResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MoveInstanceResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MoveInstanceResponse message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.instance.v1.MoveInstanceResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.instance.v1.MoveInstanceResponse} MoveInstanceResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MoveInstanceResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.MoveInstanceResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MoveInstanceResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.instance.v1.MoveInstanceResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.instance.v1.MoveInstanceResponse} MoveInstanceResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MoveInstanceResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MoveInstanceResponse message. - * @function verify - * @memberof google.spanner.admin.instance.v1.MoveInstanceResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MoveInstanceResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a MoveInstanceResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.instance.v1.MoveInstanceResponse - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.instance.v1.MoveInstanceResponse} MoveInstanceResponse - */ - MoveInstanceResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.instance.v1.MoveInstanceResponse) - return object; - return new $root.google.spanner.admin.instance.v1.MoveInstanceResponse(); - }; - - /** - * Creates a plain object from a MoveInstanceResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.instance.v1.MoveInstanceResponse - * @static - * @param {google.spanner.admin.instance.v1.MoveInstanceResponse} message MoveInstanceResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MoveInstanceResponse.toObject = function toObject() { - return {}; - }; - - /** - * Converts this MoveInstanceResponse to JSON. - * @function toJSON - * @memberof google.spanner.admin.instance.v1.MoveInstanceResponse - * @instance - * @returns {Object.} JSON object - */ - MoveInstanceResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MoveInstanceResponse - * @function getTypeUrl - * @memberof google.spanner.admin.instance.v1.MoveInstanceResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MoveInstanceResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.instance.v1.MoveInstanceResponse"; - }; - - return MoveInstanceResponse; - })(); - - v1.MoveInstanceMetadata = (function() { - - /** - * Properties of a MoveInstanceMetadata. - * @memberof google.spanner.admin.instance.v1 - * @interface IMoveInstanceMetadata - * @property {string|null} [targetConfig] MoveInstanceMetadata targetConfig - * @property {google.spanner.admin.instance.v1.IOperationProgress|null} [progress] MoveInstanceMetadata progress - * @property {google.protobuf.ITimestamp|null} [cancelTime] MoveInstanceMetadata cancelTime - */ - - /** - * Constructs a new MoveInstanceMetadata. - * @memberof google.spanner.admin.instance.v1 - * @classdesc Represents a MoveInstanceMetadata. - * @implements IMoveInstanceMetadata - * @constructor - * @param {google.spanner.admin.instance.v1.IMoveInstanceMetadata=} [properties] Properties to set - */ - function MoveInstanceMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MoveInstanceMetadata targetConfig. - * @member {string} targetConfig - * @memberof google.spanner.admin.instance.v1.MoveInstanceMetadata - * @instance - */ - MoveInstanceMetadata.prototype.targetConfig = ""; - - /** - * MoveInstanceMetadata progress. - * @member {google.spanner.admin.instance.v1.IOperationProgress|null|undefined} progress - * @memberof google.spanner.admin.instance.v1.MoveInstanceMetadata - * @instance - */ - MoveInstanceMetadata.prototype.progress = null; - - /** - * MoveInstanceMetadata cancelTime. - * @member {google.protobuf.ITimestamp|null|undefined} cancelTime - * @memberof google.spanner.admin.instance.v1.MoveInstanceMetadata - * @instance - */ - MoveInstanceMetadata.prototype.cancelTime = null; - - /** - * Creates a new MoveInstanceMetadata instance using the specified properties. - * @function create - * @memberof google.spanner.admin.instance.v1.MoveInstanceMetadata - * @static - * @param {google.spanner.admin.instance.v1.IMoveInstanceMetadata=} [properties] Properties to set - * @returns {google.spanner.admin.instance.v1.MoveInstanceMetadata} MoveInstanceMetadata instance - */ - MoveInstanceMetadata.create = function create(properties) { - return new MoveInstanceMetadata(properties); - }; - - /** - * Encodes the specified MoveInstanceMetadata message. Does not implicitly {@link google.spanner.admin.instance.v1.MoveInstanceMetadata.verify|verify} messages. - * @function encode - * @memberof google.spanner.admin.instance.v1.MoveInstanceMetadata - * @static - * @param {google.spanner.admin.instance.v1.IMoveInstanceMetadata} message MoveInstanceMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MoveInstanceMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.targetConfig != null && Object.hasOwnProperty.call(message, "targetConfig")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.targetConfig); - if (message.progress != null && Object.hasOwnProperty.call(message, "progress")) - $root.google.spanner.admin.instance.v1.OperationProgress.encode(message.progress, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.cancelTime != null && Object.hasOwnProperty.call(message, "cancelTime")) - $root.google.protobuf.Timestamp.encode(message.cancelTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified MoveInstanceMetadata message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.MoveInstanceMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.admin.instance.v1.MoveInstanceMetadata - * @static - * @param {google.spanner.admin.instance.v1.IMoveInstanceMetadata} message MoveInstanceMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MoveInstanceMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MoveInstanceMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.admin.instance.v1.MoveInstanceMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.admin.instance.v1.MoveInstanceMetadata} MoveInstanceMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MoveInstanceMetadata.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.MoveInstanceMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.targetConfig = reader.string(); - break; - } - case 2: { - message.progress = $root.google.spanner.admin.instance.v1.OperationProgress.decode(reader, reader.uint32()); - break; - } - case 3: { - message.cancelTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MoveInstanceMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.admin.instance.v1.MoveInstanceMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.admin.instance.v1.MoveInstanceMetadata} MoveInstanceMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MoveInstanceMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MoveInstanceMetadata message. - * @function verify - * @memberof google.spanner.admin.instance.v1.MoveInstanceMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MoveInstanceMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.targetConfig != null && message.hasOwnProperty("targetConfig")) - if (!$util.isString(message.targetConfig)) - return "targetConfig: string expected"; - if (message.progress != null && message.hasOwnProperty("progress")) { - var error = $root.google.spanner.admin.instance.v1.OperationProgress.verify(message.progress); - if (error) - return "progress." + error; - } - if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.cancelTime); - if (error) - return "cancelTime." + error; - } - return null; - }; - - /** - * Creates a MoveInstanceMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.admin.instance.v1.MoveInstanceMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.admin.instance.v1.MoveInstanceMetadata} MoveInstanceMetadata - */ - MoveInstanceMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.admin.instance.v1.MoveInstanceMetadata) - return object; - var message = new $root.google.spanner.admin.instance.v1.MoveInstanceMetadata(); - if (object.targetConfig != null) - message.targetConfig = String(object.targetConfig); - if (object.progress != null) { - if (typeof object.progress !== "object") - throw TypeError(".google.spanner.admin.instance.v1.MoveInstanceMetadata.progress: object expected"); - message.progress = $root.google.spanner.admin.instance.v1.OperationProgress.fromObject(object.progress); - } - if (object.cancelTime != null) { - if (typeof object.cancelTime !== "object") - throw TypeError(".google.spanner.admin.instance.v1.MoveInstanceMetadata.cancelTime: object expected"); - message.cancelTime = $root.google.protobuf.Timestamp.fromObject(object.cancelTime); - } - return message; - }; - - /** - * Creates a plain object from a MoveInstanceMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.admin.instance.v1.MoveInstanceMetadata - * @static - * @param {google.spanner.admin.instance.v1.MoveInstanceMetadata} message MoveInstanceMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MoveInstanceMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.targetConfig = ""; - object.progress = null; - object.cancelTime = null; - } - if (message.targetConfig != null && message.hasOwnProperty("targetConfig")) - object.targetConfig = message.targetConfig; - if (message.progress != null && message.hasOwnProperty("progress")) - object.progress = $root.google.spanner.admin.instance.v1.OperationProgress.toObject(message.progress, options); - if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) - object.cancelTime = $root.google.protobuf.Timestamp.toObject(message.cancelTime, options); - return object; - }; - - /** - * Converts this MoveInstanceMetadata to JSON. - * @function toJSON - * @memberof google.spanner.admin.instance.v1.MoveInstanceMetadata - * @instance - * @returns {Object.} JSON object - */ - MoveInstanceMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MoveInstanceMetadata - * @function getTypeUrl - * @memberof google.spanner.admin.instance.v1.MoveInstanceMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MoveInstanceMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.admin.instance.v1.MoveInstanceMetadata"; - }; - - return MoveInstanceMetadata; - })(); - - return v1; - })(); - - return instance; - })(); - - return admin; - })(); - - spanner.executor = (function() { - - /** - * Namespace executor. - * @memberof google.spanner - * @namespace - */ - var executor = {}; - - executor.v1 = (function() { - - /** - * Namespace v1. - * @memberof google.spanner.executor - * @namespace - */ - var v1 = {}; - - v1.SpannerExecutorProxy = (function() { - - /** - * Constructs a new SpannerExecutorProxy service. - * @memberof google.spanner.executor.v1 - * @classdesc Represents a SpannerExecutorProxy - * @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 SpannerExecutorProxy(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (SpannerExecutorProxy.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = SpannerExecutorProxy; - - /** - * Creates new SpannerExecutorProxy service using the specified rpc implementation. - * @function create - * @memberof google.spanner.executor.v1.SpannerExecutorProxy - * @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 {SpannerExecutorProxy} RPC service. Useful where requests and/or responses are streamed. - */ - SpannerExecutorProxy.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.spanner.executor.v1.SpannerExecutorProxy|executeActionAsync}. - * @memberof google.spanner.executor.v1.SpannerExecutorProxy - * @typedef ExecuteActionAsyncCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.spanner.executor.v1.SpannerAsyncActionResponse} [response] SpannerAsyncActionResponse - */ - - /** - * Calls ExecuteActionAsync. - * @function executeActionAsync - * @memberof google.spanner.executor.v1.SpannerExecutorProxy - * @instance - * @param {google.spanner.executor.v1.ISpannerAsyncActionRequest} request SpannerAsyncActionRequest message or plain object - * @param {google.spanner.executor.v1.SpannerExecutorProxy.ExecuteActionAsyncCallback} callback Node-style callback called with the error, if any, and SpannerAsyncActionResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(SpannerExecutorProxy.prototype.executeActionAsync = function executeActionAsync(request, callback) { - return this.rpcCall(executeActionAsync, $root.google.spanner.executor.v1.SpannerAsyncActionRequest, $root.google.spanner.executor.v1.SpannerAsyncActionResponse, request, callback); - }, "name", { value: "ExecuteActionAsync" }); - - /** - * Calls ExecuteActionAsync. - * @function executeActionAsync - * @memberof google.spanner.executor.v1.SpannerExecutorProxy - * @instance - * @param {google.spanner.executor.v1.ISpannerAsyncActionRequest} request SpannerAsyncActionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return SpannerExecutorProxy; - })(); - - v1.SpannerAsyncActionRequest = (function() { - - /** - * Properties of a SpannerAsyncActionRequest. - * @memberof google.spanner.executor.v1 - * @interface ISpannerAsyncActionRequest - * @property {number|null} [actionId] SpannerAsyncActionRequest actionId - * @property {google.spanner.executor.v1.ISpannerAction|null} [action] SpannerAsyncActionRequest action - */ - - /** - * Constructs a new SpannerAsyncActionRequest. - * @memberof google.spanner.executor.v1 - * @classdesc Represents a SpannerAsyncActionRequest. - * @implements ISpannerAsyncActionRequest - * @constructor - * @param {google.spanner.executor.v1.ISpannerAsyncActionRequest=} [properties] Properties to set - */ - function SpannerAsyncActionRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SpannerAsyncActionRequest actionId. - * @member {number} actionId - * @memberof google.spanner.executor.v1.SpannerAsyncActionRequest - * @instance - */ - SpannerAsyncActionRequest.prototype.actionId = 0; - - /** - * SpannerAsyncActionRequest action. - * @member {google.spanner.executor.v1.ISpannerAction|null|undefined} action - * @memberof google.spanner.executor.v1.SpannerAsyncActionRequest - * @instance - */ - SpannerAsyncActionRequest.prototype.action = null; - - /** - * Creates a new SpannerAsyncActionRequest instance using the specified properties. - * @function create - * @memberof google.spanner.executor.v1.SpannerAsyncActionRequest - * @static - * @param {google.spanner.executor.v1.ISpannerAsyncActionRequest=} [properties] Properties to set - * @returns {google.spanner.executor.v1.SpannerAsyncActionRequest} SpannerAsyncActionRequest instance - */ - SpannerAsyncActionRequest.create = function create(properties) { - return new SpannerAsyncActionRequest(properties); - }; - - /** - * Encodes the specified SpannerAsyncActionRequest message. Does not implicitly {@link google.spanner.executor.v1.SpannerAsyncActionRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.executor.v1.SpannerAsyncActionRequest - * @static - * @param {google.spanner.executor.v1.ISpannerAsyncActionRequest} message SpannerAsyncActionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SpannerAsyncActionRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.actionId != null && Object.hasOwnProperty.call(message, "actionId")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.actionId); - if (message.action != null && Object.hasOwnProperty.call(message, "action")) - $root.google.spanner.executor.v1.SpannerAction.encode(message.action, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified SpannerAsyncActionRequest message, length delimited. Does not implicitly {@link google.spanner.executor.v1.SpannerAsyncActionRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.executor.v1.SpannerAsyncActionRequest - * @static - * @param {google.spanner.executor.v1.ISpannerAsyncActionRequest} message SpannerAsyncActionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SpannerAsyncActionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SpannerAsyncActionRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.executor.v1.SpannerAsyncActionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.executor.v1.SpannerAsyncActionRequest} SpannerAsyncActionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SpannerAsyncActionRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.SpannerAsyncActionRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.actionId = reader.int32(); - break; - } - case 2: { - message.action = $root.google.spanner.executor.v1.SpannerAction.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SpannerAsyncActionRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.executor.v1.SpannerAsyncActionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.executor.v1.SpannerAsyncActionRequest} SpannerAsyncActionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SpannerAsyncActionRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SpannerAsyncActionRequest message. - * @function verify - * @memberof google.spanner.executor.v1.SpannerAsyncActionRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SpannerAsyncActionRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.actionId != null && message.hasOwnProperty("actionId")) - if (!$util.isInteger(message.actionId)) - return "actionId: integer expected"; - if (message.action != null && message.hasOwnProperty("action")) { - var error = $root.google.spanner.executor.v1.SpannerAction.verify(message.action); - if (error) - return "action." + error; - } - return null; - }; - - /** - * Creates a SpannerAsyncActionRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.executor.v1.SpannerAsyncActionRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.executor.v1.SpannerAsyncActionRequest} SpannerAsyncActionRequest - */ - SpannerAsyncActionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.executor.v1.SpannerAsyncActionRequest) - return object; - var message = new $root.google.spanner.executor.v1.SpannerAsyncActionRequest(); - if (object.actionId != null) - message.actionId = object.actionId | 0; - if (object.action != null) { - if (typeof object.action !== "object") - throw TypeError(".google.spanner.executor.v1.SpannerAsyncActionRequest.action: object expected"); - message.action = $root.google.spanner.executor.v1.SpannerAction.fromObject(object.action); - } - return message; - }; - - /** - * Creates a plain object from a SpannerAsyncActionRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.executor.v1.SpannerAsyncActionRequest - * @static - * @param {google.spanner.executor.v1.SpannerAsyncActionRequest} message SpannerAsyncActionRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SpannerAsyncActionRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.actionId = 0; - object.action = null; - } - if (message.actionId != null && message.hasOwnProperty("actionId")) - object.actionId = message.actionId; - if (message.action != null && message.hasOwnProperty("action")) - object.action = $root.google.spanner.executor.v1.SpannerAction.toObject(message.action, options); - return object; - }; - - /** - * Converts this SpannerAsyncActionRequest to JSON. - * @function toJSON - * @memberof google.spanner.executor.v1.SpannerAsyncActionRequest - * @instance - * @returns {Object.} JSON object - */ - SpannerAsyncActionRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SpannerAsyncActionRequest - * @function getTypeUrl - * @memberof google.spanner.executor.v1.SpannerAsyncActionRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SpannerAsyncActionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.executor.v1.SpannerAsyncActionRequest"; - }; - - return SpannerAsyncActionRequest; - })(); - - v1.SpannerAsyncActionResponse = (function() { - - /** - * Properties of a SpannerAsyncActionResponse. - * @memberof google.spanner.executor.v1 - * @interface ISpannerAsyncActionResponse - * @property {number|null} [actionId] SpannerAsyncActionResponse actionId - * @property {google.spanner.executor.v1.ISpannerActionOutcome|null} [outcome] SpannerAsyncActionResponse outcome - */ - - /** - * Constructs a new SpannerAsyncActionResponse. - * @memberof google.spanner.executor.v1 - * @classdesc Represents a SpannerAsyncActionResponse. - * @implements ISpannerAsyncActionResponse - * @constructor - * @param {google.spanner.executor.v1.ISpannerAsyncActionResponse=} [properties] Properties to set - */ - function SpannerAsyncActionResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SpannerAsyncActionResponse actionId. - * @member {number} actionId - * @memberof google.spanner.executor.v1.SpannerAsyncActionResponse - * @instance - */ - SpannerAsyncActionResponse.prototype.actionId = 0; - - /** - * SpannerAsyncActionResponse outcome. - * @member {google.spanner.executor.v1.ISpannerActionOutcome|null|undefined} outcome - * @memberof google.spanner.executor.v1.SpannerAsyncActionResponse - * @instance - */ - SpannerAsyncActionResponse.prototype.outcome = null; - - /** - * Creates a new SpannerAsyncActionResponse instance using the specified properties. - * @function create - * @memberof google.spanner.executor.v1.SpannerAsyncActionResponse - * @static - * @param {google.spanner.executor.v1.ISpannerAsyncActionResponse=} [properties] Properties to set - * @returns {google.spanner.executor.v1.SpannerAsyncActionResponse} SpannerAsyncActionResponse instance - */ - SpannerAsyncActionResponse.create = function create(properties) { - return new SpannerAsyncActionResponse(properties); - }; - - /** - * Encodes the specified SpannerAsyncActionResponse message. Does not implicitly {@link google.spanner.executor.v1.SpannerAsyncActionResponse.verify|verify} messages. - * @function encode - * @memberof google.spanner.executor.v1.SpannerAsyncActionResponse - * @static - * @param {google.spanner.executor.v1.ISpannerAsyncActionResponse} message SpannerAsyncActionResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SpannerAsyncActionResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.actionId != null && Object.hasOwnProperty.call(message, "actionId")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.actionId); - if (message.outcome != null && Object.hasOwnProperty.call(message, "outcome")) - $root.google.spanner.executor.v1.SpannerActionOutcome.encode(message.outcome, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified SpannerAsyncActionResponse message, length delimited. Does not implicitly {@link google.spanner.executor.v1.SpannerAsyncActionResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.executor.v1.SpannerAsyncActionResponse - * @static - * @param {google.spanner.executor.v1.ISpannerAsyncActionResponse} message SpannerAsyncActionResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SpannerAsyncActionResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SpannerAsyncActionResponse message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.executor.v1.SpannerAsyncActionResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.executor.v1.SpannerAsyncActionResponse} SpannerAsyncActionResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SpannerAsyncActionResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.SpannerAsyncActionResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.actionId = reader.int32(); - break; - } - case 2: { - message.outcome = $root.google.spanner.executor.v1.SpannerActionOutcome.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SpannerAsyncActionResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.executor.v1.SpannerAsyncActionResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.executor.v1.SpannerAsyncActionResponse} SpannerAsyncActionResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SpannerAsyncActionResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SpannerAsyncActionResponse message. - * @function verify - * @memberof google.spanner.executor.v1.SpannerAsyncActionResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SpannerAsyncActionResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.actionId != null && message.hasOwnProperty("actionId")) - if (!$util.isInteger(message.actionId)) - return "actionId: integer expected"; - if (message.outcome != null && message.hasOwnProperty("outcome")) { - var error = $root.google.spanner.executor.v1.SpannerActionOutcome.verify(message.outcome); - if (error) - return "outcome." + error; - } - return null; - }; - - /** - * Creates a SpannerAsyncActionResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.executor.v1.SpannerAsyncActionResponse - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.executor.v1.SpannerAsyncActionResponse} SpannerAsyncActionResponse - */ - SpannerAsyncActionResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.executor.v1.SpannerAsyncActionResponse) - return object; - var message = new $root.google.spanner.executor.v1.SpannerAsyncActionResponse(); - if (object.actionId != null) - message.actionId = object.actionId | 0; - if (object.outcome != null) { - if (typeof object.outcome !== "object") - throw TypeError(".google.spanner.executor.v1.SpannerAsyncActionResponse.outcome: object expected"); - message.outcome = $root.google.spanner.executor.v1.SpannerActionOutcome.fromObject(object.outcome); - } - return message; - }; - - /** - * Creates a plain object from a SpannerAsyncActionResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.executor.v1.SpannerAsyncActionResponse - * @static - * @param {google.spanner.executor.v1.SpannerAsyncActionResponse} message SpannerAsyncActionResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SpannerAsyncActionResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.actionId = 0; - object.outcome = null; - } - if (message.actionId != null && message.hasOwnProperty("actionId")) - object.actionId = message.actionId; - if (message.outcome != null && message.hasOwnProperty("outcome")) - object.outcome = $root.google.spanner.executor.v1.SpannerActionOutcome.toObject(message.outcome, options); - return object; - }; - - /** - * Converts this SpannerAsyncActionResponse to JSON. - * @function toJSON - * @memberof google.spanner.executor.v1.SpannerAsyncActionResponse - * @instance - * @returns {Object.} JSON object - */ - SpannerAsyncActionResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SpannerAsyncActionResponse - * @function getTypeUrl - * @memberof google.spanner.executor.v1.SpannerAsyncActionResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SpannerAsyncActionResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.executor.v1.SpannerAsyncActionResponse"; - }; - - return SpannerAsyncActionResponse; - })(); - - v1.SpannerAction = (function() { - - /** - * Properties of a SpannerAction. - * @memberof google.spanner.executor.v1 - * @interface ISpannerAction - * @property {string|null} [databasePath] SpannerAction databasePath - * @property {google.spanner.executor.v1.ISpannerOptions|null} [spannerOptions] SpannerAction spannerOptions - * @property {google.spanner.executor.v1.IStartTransactionAction|null} [start] SpannerAction start - * @property {google.spanner.executor.v1.IFinishTransactionAction|null} [finish] SpannerAction finish - * @property {google.spanner.executor.v1.IReadAction|null} [read] SpannerAction read - * @property {google.spanner.executor.v1.IQueryAction|null} [query] SpannerAction query - * @property {google.spanner.executor.v1.IMutationAction|null} [mutation] SpannerAction mutation - * @property {google.spanner.executor.v1.IDmlAction|null} [dml] SpannerAction dml - * @property {google.spanner.executor.v1.IBatchDmlAction|null} [batchDml] SpannerAction batchDml - * @property {google.spanner.executor.v1.IWriteMutationsAction|null} [write] SpannerAction write - * @property {google.spanner.executor.v1.IPartitionedUpdateAction|null} [partitionedUpdate] SpannerAction partitionedUpdate - * @property {google.spanner.executor.v1.IAdminAction|null} [admin] SpannerAction admin - * @property {google.spanner.executor.v1.IStartBatchTransactionAction|null} [startBatchTxn] SpannerAction startBatchTxn - * @property {google.spanner.executor.v1.ICloseBatchTransactionAction|null} [closeBatchTxn] SpannerAction closeBatchTxn - * @property {google.spanner.executor.v1.IGenerateDbPartitionsForReadAction|null} [generateDbPartitionsRead] SpannerAction generateDbPartitionsRead - * @property {google.spanner.executor.v1.IGenerateDbPartitionsForQueryAction|null} [generateDbPartitionsQuery] SpannerAction generateDbPartitionsQuery - * @property {google.spanner.executor.v1.IExecutePartitionAction|null} [executePartition] SpannerAction executePartition - * @property {google.spanner.executor.v1.IExecuteChangeStreamQuery|null} [executeChangeStreamQuery] SpannerAction executeChangeStreamQuery - * @property {google.spanner.executor.v1.IQueryCancellationAction|null} [queryCancellation] SpannerAction queryCancellation - */ - - /** - * Constructs a new SpannerAction. - * @memberof google.spanner.executor.v1 - * @classdesc Represents a SpannerAction. - * @implements ISpannerAction - * @constructor - * @param {google.spanner.executor.v1.ISpannerAction=} [properties] Properties to set - */ - function SpannerAction(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SpannerAction databasePath. - * @member {string} databasePath - * @memberof google.spanner.executor.v1.SpannerAction - * @instance - */ - SpannerAction.prototype.databasePath = ""; - - /** - * SpannerAction spannerOptions. - * @member {google.spanner.executor.v1.ISpannerOptions|null|undefined} spannerOptions - * @memberof google.spanner.executor.v1.SpannerAction - * @instance - */ - SpannerAction.prototype.spannerOptions = null; - - /** - * SpannerAction start. - * @member {google.spanner.executor.v1.IStartTransactionAction|null|undefined} start - * @memberof google.spanner.executor.v1.SpannerAction - * @instance - */ - SpannerAction.prototype.start = null; - - /** - * SpannerAction finish. - * @member {google.spanner.executor.v1.IFinishTransactionAction|null|undefined} finish - * @memberof google.spanner.executor.v1.SpannerAction - * @instance - */ - SpannerAction.prototype.finish = null; - - /** - * SpannerAction read. - * @member {google.spanner.executor.v1.IReadAction|null|undefined} read - * @memberof google.spanner.executor.v1.SpannerAction - * @instance - */ - SpannerAction.prototype.read = null; - - /** - * SpannerAction query. - * @member {google.spanner.executor.v1.IQueryAction|null|undefined} query - * @memberof google.spanner.executor.v1.SpannerAction - * @instance - */ - SpannerAction.prototype.query = null; - - /** - * SpannerAction mutation. - * @member {google.spanner.executor.v1.IMutationAction|null|undefined} mutation - * @memberof google.spanner.executor.v1.SpannerAction - * @instance - */ - SpannerAction.prototype.mutation = null; - - /** - * SpannerAction dml. - * @member {google.spanner.executor.v1.IDmlAction|null|undefined} dml - * @memberof google.spanner.executor.v1.SpannerAction - * @instance - */ - SpannerAction.prototype.dml = null; - - /** - * SpannerAction batchDml. - * @member {google.spanner.executor.v1.IBatchDmlAction|null|undefined} batchDml - * @memberof google.spanner.executor.v1.SpannerAction - * @instance - */ - SpannerAction.prototype.batchDml = null; - - /** - * SpannerAction write. - * @member {google.spanner.executor.v1.IWriteMutationsAction|null|undefined} write - * @memberof google.spanner.executor.v1.SpannerAction - * @instance - */ - SpannerAction.prototype.write = null; - - /** - * SpannerAction partitionedUpdate. - * @member {google.spanner.executor.v1.IPartitionedUpdateAction|null|undefined} partitionedUpdate - * @memberof google.spanner.executor.v1.SpannerAction - * @instance - */ - SpannerAction.prototype.partitionedUpdate = null; - - /** - * SpannerAction admin. - * @member {google.spanner.executor.v1.IAdminAction|null|undefined} admin - * @memberof google.spanner.executor.v1.SpannerAction - * @instance - */ - SpannerAction.prototype.admin = null; - - /** - * SpannerAction startBatchTxn. - * @member {google.spanner.executor.v1.IStartBatchTransactionAction|null|undefined} startBatchTxn - * @memberof google.spanner.executor.v1.SpannerAction - * @instance - */ - SpannerAction.prototype.startBatchTxn = null; - - /** - * SpannerAction closeBatchTxn. - * @member {google.spanner.executor.v1.ICloseBatchTransactionAction|null|undefined} closeBatchTxn - * @memberof google.spanner.executor.v1.SpannerAction - * @instance - */ - SpannerAction.prototype.closeBatchTxn = null; - - /** - * SpannerAction generateDbPartitionsRead. - * @member {google.spanner.executor.v1.IGenerateDbPartitionsForReadAction|null|undefined} generateDbPartitionsRead - * @memberof google.spanner.executor.v1.SpannerAction - * @instance - */ - SpannerAction.prototype.generateDbPartitionsRead = null; - - /** - * SpannerAction generateDbPartitionsQuery. - * @member {google.spanner.executor.v1.IGenerateDbPartitionsForQueryAction|null|undefined} generateDbPartitionsQuery - * @memberof google.spanner.executor.v1.SpannerAction - * @instance - */ - SpannerAction.prototype.generateDbPartitionsQuery = null; - - /** - * SpannerAction executePartition. - * @member {google.spanner.executor.v1.IExecutePartitionAction|null|undefined} executePartition - * @memberof google.spanner.executor.v1.SpannerAction - * @instance - */ - SpannerAction.prototype.executePartition = null; - - /** - * SpannerAction executeChangeStreamQuery. - * @member {google.spanner.executor.v1.IExecuteChangeStreamQuery|null|undefined} executeChangeStreamQuery - * @memberof google.spanner.executor.v1.SpannerAction - * @instance - */ - SpannerAction.prototype.executeChangeStreamQuery = null; - - /** - * SpannerAction queryCancellation. - * @member {google.spanner.executor.v1.IQueryCancellationAction|null|undefined} queryCancellation - * @memberof google.spanner.executor.v1.SpannerAction - * @instance - */ - SpannerAction.prototype.queryCancellation = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * SpannerAction action. - * @member {"start"|"finish"|"read"|"query"|"mutation"|"dml"|"batchDml"|"write"|"partitionedUpdate"|"admin"|"startBatchTxn"|"closeBatchTxn"|"generateDbPartitionsRead"|"generateDbPartitionsQuery"|"executePartition"|"executeChangeStreamQuery"|"queryCancellation"|undefined} action - * @memberof google.spanner.executor.v1.SpannerAction - * @instance - */ - Object.defineProperty(SpannerAction.prototype, "action", { - get: $util.oneOfGetter($oneOfFields = ["start", "finish", "read", "query", "mutation", "dml", "batchDml", "write", "partitionedUpdate", "admin", "startBatchTxn", "closeBatchTxn", "generateDbPartitionsRead", "generateDbPartitionsQuery", "executePartition", "executeChangeStreamQuery", "queryCancellation"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new SpannerAction instance using the specified properties. - * @function create - * @memberof google.spanner.executor.v1.SpannerAction - * @static - * @param {google.spanner.executor.v1.ISpannerAction=} [properties] Properties to set - * @returns {google.spanner.executor.v1.SpannerAction} SpannerAction instance - */ - SpannerAction.create = function create(properties) { - return new SpannerAction(properties); - }; - - /** - * Encodes the specified SpannerAction message. Does not implicitly {@link google.spanner.executor.v1.SpannerAction.verify|verify} messages. - * @function encode - * @memberof google.spanner.executor.v1.SpannerAction - * @static - * @param {google.spanner.executor.v1.ISpannerAction} message SpannerAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SpannerAction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.databasePath != null && Object.hasOwnProperty.call(message, "databasePath")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.databasePath); - if (message.spannerOptions != null && Object.hasOwnProperty.call(message, "spannerOptions")) - $root.google.spanner.executor.v1.SpannerOptions.encode(message.spannerOptions, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.start != null && Object.hasOwnProperty.call(message, "start")) - $root.google.spanner.executor.v1.StartTransactionAction.encode(message.start, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.finish != null && Object.hasOwnProperty.call(message, "finish")) - $root.google.spanner.executor.v1.FinishTransactionAction.encode(message.finish, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.read != null && Object.hasOwnProperty.call(message, "read")) - $root.google.spanner.executor.v1.ReadAction.encode(message.read, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); - if (message.query != null && Object.hasOwnProperty.call(message, "query")) - $root.google.spanner.executor.v1.QueryAction.encode(message.query, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); - if (message.mutation != null && Object.hasOwnProperty.call(message, "mutation")) - $root.google.spanner.executor.v1.MutationAction.encode(message.mutation, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); - if (message.dml != null && Object.hasOwnProperty.call(message, "dml")) - $root.google.spanner.executor.v1.DmlAction.encode(message.dml, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); - if (message.batchDml != null && Object.hasOwnProperty.call(message, "batchDml")) - $root.google.spanner.executor.v1.BatchDmlAction.encode(message.batchDml, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); - if (message.write != null && Object.hasOwnProperty.call(message, "write")) - $root.google.spanner.executor.v1.WriteMutationsAction.encode(message.write, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); - if (message.partitionedUpdate != null && Object.hasOwnProperty.call(message, "partitionedUpdate")) - $root.google.spanner.executor.v1.PartitionedUpdateAction.encode(message.partitionedUpdate, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); - if (message.admin != null && Object.hasOwnProperty.call(message, "admin")) - $root.google.spanner.executor.v1.AdminAction.encode(message.admin, writer.uint32(/* id 30, wireType 2 =*/242).fork()).ldelim(); - if (message.startBatchTxn != null && Object.hasOwnProperty.call(message, "startBatchTxn")) - $root.google.spanner.executor.v1.StartBatchTransactionAction.encode(message.startBatchTxn, writer.uint32(/* id 40, wireType 2 =*/322).fork()).ldelim(); - if (message.closeBatchTxn != null && Object.hasOwnProperty.call(message, "closeBatchTxn")) - $root.google.spanner.executor.v1.CloseBatchTransactionAction.encode(message.closeBatchTxn, writer.uint32(/* id 41, wireType 2 =*/330).fork()).ldelim(); - if (message.generateDbPartitionsRead != null && Object.hasOwnProperty.call(message, "generateDbPartitionsRead")) - $root.google.spanner.executor.v1.GenerateDbPartitionsForReadAction.encode(message.generateDbPartitionsRead, writer.uint32(/* id 42, wireType 2 =*/338).fork()).ldelim(); - if (message.generateDbPartitionsQuery != null && Object.hasOwnProperty.call(message, "generateDbPartitionsQuery")) - $root.google.spanner.executor.v1.GenerateDbPartitionsForQueryAction.encode(message.generateDbPartitionsQuery, writer.uint32(/* id 43, wireType 2 =*/346).fork()).ldelim(); - if (message.executePartition != null && Object.hasOwnProperty.call(message, "executePartition")) - $root.google.spanner.executor.v1.ExecutePartitionAction.encode(message.executePartition, writer.uint32(/* id 44, wireType 2 =*/354).fork()).ldelim(); - if (message.executeChangeStreamQuery != null && Object.hasOwnProperty.call(message, "executeChangeStreamQuery")) - $root.google.spanner.executor.v1.ExecuteChangeStreamQuery.encode(message.executeChangeStreamQuery, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); - if (message.queryCancellation != null && Object.hasOwnProperty.call(message, "queryCancellation")) - $root.google.spanner.executor.v1.QueryCancellationAction.encode(message.queryCancellation, writer.uint32(/* id 51, wireType 2 =*/410).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified SpannerAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.SpannerAction.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.executor.v1.SpannerAction - * @static - * @param {google.spanner.executor.v1.ISpannerAction} message SpannerAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SpannerAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SpannerAction message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.executor.v1.SpannerAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.executor.v1.SpannerAction} SpannerAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SpannerAction.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.SpannerAction(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.databasePath = reader.string(); - break; - } - case 2: { - message.spannerOptions = $root.google.spanner.executor.v1.SpannerOptions.decode(reader, reader.uint32()); - break; - } - case 10: { - message.start = $root.google.spanner.executor.v1.StartTransactionAction.decode(reader, reader.uint32()); - break; - } - case 11: { - message.finish = $root.google.spanner.executor.v1.FinishTransactionAction.decode(reader, reader.uint32()); - break; - } - case 20: { - message.read = $root.google.spanner.executor.v1.ReadAction.decode(reader, reader.uint32()); - break; - } - case 21: { - message.query = $root.google.spanner.executor.v1.QueryAction.decode(reader, reader.uint32()); - break; - } - case 22: { - message.mutation = $root.google.spanner.executor.v1.MutationAction.decode(reader, reader.uint32()); - break; - } - case 23: { - message.dml = $root.google.spanner.executor.v1.DmlAction.decode(reader, reader.uint32()); - break; - } - case 24: { - message.batchDml = $root.google.spanner.executor.v1.BatchDmlAction.decode(reader, reader.uint32()); - break; - } - case 25: { - message.write = $root.google.spanner.executor.v1.WriteMutationsAction.decode(reader, reader.uint32()); - break; - } - case 27: { - message.partitionedUpdate = $root.google.spanner.executor.v1.PartitionedUpdateAction.decode(reader, reader.uint32()); - break; - } - case 30: { - message.admin = $root.google.spanner.executor.v1.AdminAction.decode(reader, reader.uint32()); - break; - } - case 40: { - message.startBatchTxn = $root.google.spanner.executor.v1.StartBatchTransactionAction.decode(reader, reader.uint32()); - break; - } - case 41: { - message.closeBatchTxn = $root.google.spanner.executor.v1.CloseBatchTransactionAction.decode(reader, reader.uint32()); - break; - } - case 42: { - message.generateDbPartitionsRead = $root.google.spanner.executor.v1.GenerateDbPartitionsForReadAction.decode(reader, reader.uint32()); - break; - } - case 43: { - message.generateDbPartitionsQuery = $root.google.spanner.executor.v1.GenerateDbPartitionsForQueryAction.decode(reader, reader.uint32()); - break; - } - case 44: { - message.executePartition = $root.google.spanner.executor.v1.ExecutePartitionAction.decode(reader, reader.uint32()); - break; - } - case 50: { - message.executeChangeStreamQuery = $root.google.spanner.executor.v1.ExecuteChangeStreamQuery.decode(reader, reader.uint32()); - break; - } - case 51: { - message.queryCancellation = $root.google.spanner.executor.v1.QueryCancellationAction.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SpannerAction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.executor.v1.SpannerAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.executor.v1.SpannerAction} SpannerAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SpannerAction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SpannerAction message. - * @function verify - * @memberof google.spanner.executor.v1.SpannerAction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SpannerAction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.databasePath != null && message.hasOwnProperty("databasePath")) - if (!$util.isString(message.databasePath)) - return "databasePath: string expected"; - if (message.spannerOptions != null && message.hasOwnProperty("spannerOptions")) { - var error = $root.google.spanner.executor.v1.SpannerOptions.verify(message.spannerOptions); - if (error) - return "spannerOptions." + error; - } - if (message.start != null && message.hasOwnProperty("start")) { - properties.action = 1; - { - var error = $root.google.spanner.executor.v1.StartTransactionAction.verify(message.start); - if (error) - return "start." + error; - } - } - if (message.finish != null && message.hasOwnProperty("finish")) { - if (properties.action === 1) - return "action: multiple values"; - properties.action = 1; - { - var error = $root.google.spanner.executor.v1.FinishTransactionAction.verify(message.finish); - if (error) - return "finish." + error; - } - } - if (message.read != null && message.hasOwnProperty("read")) { - if (properties.action === 1) - return "action: multiple values"; - properties.action = 1; - { - var error = $root.google.spanner.executor.v1.ReadAction.verify(message.read); - if (error) - return "read." + error; - } - } - if (message.query != null && message.hasOwnProperty("query")) { - if (properties.action === 1) - return "action: multiple values"; - properties.action = 1; - { - var error = $root.google.spanner.executor.v1.QueryAction.verify(message.query); - if (error) - return "query." + error; - } - } - if (message.mutation != null && message.hasOwnProperty("mutation")) { - if (properties.action === 1) - return "action: multiple values"; - properties.action = 1; - { - var error = $root.google.spanner.executor.v1.MutationAction.verify(message.mutation); - if (error) - return "mutation." + error; - } - } - if (message.dml != null && message.hasOwnProperty("dml")) { - if (properties.action === 1) - return "action: multiple values"; - properties.action = 1; - { - var error = $root.google.spanner.executor.v1.DmlAction.verify(message.dml); - if (error) - return "dml." + error; - } - } - if (message.batchDml != null && message.hasOwnProperty("batchDml")) { - if (properties.action === 1) - return "action: multiple values"; - properties.action = 1; - { - var error = $root.google.spanner.executor.v1.BatchDmlAction.verify(message.batchDml); - if (error) - return "batchDml." + error; - } - } - if (message.write != null && message.hasOwnProperty("write")) { - if (properties.action === 1) - return "action: multiple values"; - properties.action = 1; - { - var error = $root.google.spanner.executor.v1.WriteMutationsAction.verify(message.write); - if (error) - return "write." + error; - } - } - if (message.partitionedUpdate != null && message.hasOwnProperty("partitionedUpdate")) { - if (properties.action === 1) - return "action: multiple values"; - properties.action = 1; - { - var error = $root.google.spanner.executor.v1.PartitionedUpdateAction.verify(message.partitionedUpdate); - if (error) - return "partitionedUpdate." + error; - } - } - if (message.admin != null && message.hasOwnProperty("admin")) { - if (properties.action === 1) - return "action: multiple values"; - properties.action = 1; - { - var error = $root.google.spanner.executor.v1.AdminAction.verify(message.admin); - if (error) - return "admin." + error; - } - } - if (message.startBatchTxn != null && message.hasOwnProperty("startBatchTxn")) { - if (properties.action === 1) - return "action: multiple values"; - properties.action = 1; - { - var error = $root.google.spanner.executor.v1.StartBatchTransactionAction.verify(message.startBatchTxn); - if (error) - return "startBatchTxn." + error; - } - } - if (message.closeBatchTxn != null && message.hasOwnProperty("closeBatchTxn")) { - if (properties.action === 1) - return "action: multiple values"; - properties.action = 1; - { - var error = $root.google.spanner.executor.v1.CloseBatchTransactionAction.verify(message.closeBatchTxn); - if (error) - return "closeBatchTxn." + error; - } - } - if (message.generateDbPartitionsRead != null && message.hasOwnProperty("generateDbPartitionsRead")) { - if (properties.action === 1) - return "action: multiple values"; - properties.action = 1; - { - var error = $root.google.spanner.executor.v1.GenerateDbPartitionsForReadAction.verify(message.generateDbPartitionsRead); - if (error) - return "generateDbPartitionsRead." + error; - } - } - if (message.generateDbPartitionsQuery != null && message.hasOwnProperty("generateDbPartitionsQuery")) { - if (properties.action === 1) - return "action: multiple values"; - properties.action = 1; - { - var error = $root.google.spanner.executor.v1.GenerateDbPartitionsForQueryAction.verify(message.generateDbPartitionsQuery); - if (error) - return "generateDbPartitionsQuery." + error; - } - } - if (message.executePartition != null && message.hasOwnProperty("executePartition")) { - if (properties.action === 1) - return "action: multiple values"; - properties.action = 1; - { - var error = $root.google.spanner.executor.v1.ExecutePartitionAction.verify(message.executePartition); - if (error) - return "executePartition." + error; - } - } - if (message.executeChangeStreamQuery != null && message.hasOwnProperty("executeChangeStreamQuery")) { - if (properties.action === 1) - return "action: multiple values"; - properties.action = 1; - { - var error = $root.google.spanner.executor.v1.ExecuteChangeStreamQuery.verify(message.executeChangeStreamQuery); - if (error) - return "executeChangeStreamQuery." + error; - } - } - if (message.queryCancellation != null && message.hasOwnProperty("queryCancellation")) { - if (properties.action === 1) - return "action: multiple values"; - properties.action = 1; - { - var error = $root.google.spanner.executor.v1.QueryCancellationAction.verify(message.queryCancellation); - if (error) - return "queryCancellation." + error; - } - } - return null; - }; - - /** - * Creates a SpannerAction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.executor.v1.SpannerAction - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.executor.v1.SpannerAction} SpannerAction - */ - SpannerAction.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.executor.v1.SpannerAction) - return object; - var message = new $root.google.spanner.executor.v1.SpannerAction(); - if (object.databasePath != null) - message.databasePath = String(object.databasePath); - if (object.spannerOptions != null) { - if (typeof object.spannerOptions !== "object") - throw TypeError(".google.spanner.executor.v1.SpannerAction.spannerOptions: object expected"); - message.spannerOptions = $root.google.spanner.executor.v1.SpannerOptions.fromObject(object.spannerOptions); - } - if (object.start != null) { - if (typeof object.start !== "object") - throw TypeError(".google.spanner.executor.v1.SpannerAction.start: object expected"); - message.start = $root.google.spanner.executor.v1.StartTransactionAction.fromObject(object.start); - } - if (object.finish != null) { - if (typeof object.finish !== "object") - throw TypeError(".google.spanner.executor.v1.SpannerAction.finish: object expected"); - message.finish = $root.google.spanner.executor.v1.FinishTransactionAction.fromObject(object.finish); - } - if (object.read != null) { - if (typeof object.read !== "object") - throw TypeError(".google.spanner.executor.v1.SpannerAction.read: object expected"); - message.read = $root.google.spanner.executor.v1.ReadAction.fromObject(object.read); - } - if (object.query != null) { - if (typeof object.query !== "object") - throw TypeError(".google.spanner.executor.v1.SpannerAction.query: object expected"); - message.query = $root.google.spanner.executor.v1.QueryAction.fromObject(object.query); - } - if (object.mutation != null) { - if (typeof object.mutation !== "object") - throw TypeError(".google.spanner.executor.v1.SpannerAction.mutation: object expected"); - message.mutation = $root.google.spanner.executor.v1.MutationAction.fromObject(object.mutation); - } - if (object.dml != null) { - if (typeof object.dml !== "object") - throw TypeError(".google.spanner.executor.v1.SpannerAction.dml: object expected"); - message.dml = $root.google.spanner.executor.v1.DmlAction.fromObject(object.dml); - } - if (object.batchDml != null) { - if (typeof object.batchDml !== "object") - throw TypeError(".google.spanner.executor.v1.SpannerAction.batchDml: object expected"); - message.batchDml = $root.google.spanner.executor.v1.BatchDmlAction.fromObject(object.batchDml); - } - if (object.write != null) { - if (typeof object.write !== "object") - throw TypeError(".google.spanner.executor.v1.SpannerAction.write: object expected"); - message.write = $root.google.spanner.executor.v1.WriteMutationsAction.fromObject(object.write); - } - if (object.partitionedUpdate != null) { - if (typeof object.partitionedUpdate !== "object") - throw TypeError(".google.spanner.executor.v1.SpannerAction.partitionedUpdate: object expected"); - message.partitionedUpdate = $root.google.spanner.executor.v1.PartitionedUpdateAction.fromObject(object.partitionedUpdate); - } - if (object.admin != null) { - if (typeof object.admin !== "object") - throw TypeError(".google.spanner.executor.v1.SpannerAction.admin: object expected"); - message.admin = $root.google.spanner.executor.v1.AdminAction.fromObject(object.admin); - } - if (object.startBatchTxn != null) { - if (typeof object.startBatchTxn !== "object") - throw TypeError(".google.spanner.executor.v1.SpannerAction.startBatchTxn: object expected"); - message.startBatchTxn = $root.google.spanner.executor.v1.StartBatchTransactionAction.fromObject(object.startBatchTxn); - } - if (object.closeBatchTxn != null) { - if (typeof object.closeBatchTxn !== "object") - throw TypeError(".google.spanner.executor.v1.SpannerAction.closeBatchTxn: object expected"); - message.closeBatchTxn = $root.google.spanner.executor.v1.CloseBatchTransactionAction.fromObject(object.closeBatchTxn); - } - if (object.generateDbPartitionsRead != null) { - if (typeof object.generateDbPartitionsRead !== "object") - throw TypeError(".google.spanner.executor.v1.SpannerAction.generateDbPartitionsRead: object expected"); - message.generateDbPartitionsRead = $root.google.spanner.executor.v1.GenerateDbPartitionsForReadAction.fromObject(object.generateDbPartitionsRead); - } - if (object.generateDbPartitionsQuery != null) { - if (typeof object.generateDbPartitionsQuery !== "object") - throw TypeError(".google.spanner.executor.v1.SpannerAction.generateDbPartitionsQuery: object expected"); - message.generateDbPartitionsQuery = $root.google.spanner.executor.v1.GenerateDbPartitionsForQueryAction.fromObject(object.generateDbPartitionsQuery); - } - if (object.executePartition != null) { - if (typeof object.executePartition !== "object") - throw TypeError(".google.spanner.executor.v1.SpannerAction.executePartition: object expected"); - message.executePartition = $root.google.spanner.executor.v1.ExecutePartitionAction.fromObject(object.executePartition); - } - if (object.executeChangeStreamQuery != null) { - if (typeof object.executeChangeStreamQuery !== "object") - throw TypeError(".google.spanner.executor.v1.SpannerAction.executeChangeStreamQuery: object expected"); - message.executeChangeStreamQuery = $root.google.spanner.executor.v1.ExecuteChangeStreamQuery.fromObject(object.executeChangeStreamQuery); - } - if (object.queryCancellation != null) { - if (typeof object.queryCancellation !== "object") - throw TypeError(".google.spanner.executor.v1.SpannerAction.queryCancellation: object expected"); - message.queryCancellation = $root.google.spanner.executor.v1.QueryCancellationAction.fromObject(object.queryCancellation); - } - return message; - }; - - /** - * Creates a plain object from a SpannerAction message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.executor.v1.SpannerAction - * @static - * @param {google.spanner.executor.v1.SpannerAction} message SpannerAction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SpannerAction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.databasePath = ""; - object.spannerOptions = null; - } - if (message.databasePath != null && message.hasOwnProperty("databasePath")) - object.databasePath = message.databasePath; - if (message.spannerOptions != null && message.hasOwnProperty("spannerOptions")) - object.spannerOptions = $root.google.spanner.executor.v1.SpannerOptions.toObject(message.spannerOptions, options); - if (message.start != null && message.hasOwnProperty("start")) { - object.start = $root.google.spanner.executor.v1.StartTransactionAction.toObject(message.start, options); - if (options.oneofs) - object.action = "start"; - } - if (message.finish != null && message.hasOwnProperty("finish")) { - object.finish = $root.google.spanner.executor.v1.FinishTransactionAction.toObject(message.finish, options); - if (options.oneofs) - object.action = "finish"; - } - if (message.read != null && message.hasOwnProperty("read")) { - object.read = $root.google.spanner.executor.v1.ReadAction.toObject(message.read, options); - if (options.oneofs) - object.action = "read"; - } - if (message.query != null && message.hasOwnProperty("query")) { - object.query = $root.google.spanner.executor.v1.QueryAction.toObject(message.query, options); - if (options.oneofs) - object.action = "query"; - } - if (message.mutation != null && message.hasOwnProperty("mutation")) { - object.mutation = $root.google.spanner.executor.v1.MutationAction.toObject(message.mutation, options); - if (options.oneofs) - object.action = "mutation"; - } - if (message.dml != null && message.hasOwnProperty("dml")) { - object.dml = $root.google.spanner.executor.v1.DmlAction.toObject(message.dml, options); - if (options.oneofs) - object.action = "dml"; - } - if (message.batchDml != null && message.hasOwnProperty("batchDml")) { - object.batchDml = $root.google.spanner.executor.v1.BatchDmlAction.toObject(message.batchDml, options); - if (options.oneofs) - object.action = "batchDml"; - } - if (message.write != null && message.hasOwnProperty("write")) { - object.write = $root.google.spanner.executor.v1.WriteMutationsAction.toObject(message.write, options); - if (options.oneofs) - object.action = "write"; - } - if (message.partitionedUpdate != null && message.hasOwnProperty("partitionedUpdate")) { - object.partitionedUpdate = $root.google.spanner.executor.v1.PartitionedUpdateAction.toObject(message.partitionedUpdate, options); - if (options.oneofs) - object.action = "partitionedUpdate"; - } - if (message.admin != null && message.hasOwnProperty("admin")) { - object.admin = $root.google.spanner.executor.v1.AdminAction.toObject(message.admin, options); - if (options.oneofs) - object.action = "admin"; - } - if (message.startBatchTxn != null && message.hasOwnProperty("startBatchTxn")) { - object.startBatchTxn = $root.google.spanner.executor.v1.StartBatchTransactionAction.toObject(message.startBatchTxn, options); - if (options.oneofs) - object.action = "startBatchTxn"; - } - if (message.closeBatchTxn != null && message.hasOwnProperty("closeBatchTxn")) { - object.closeBatchTxn = $root.google.spanner.executor.v1.CloseBatchTransactionAction.toObject(message.closeBatchTxn, options); - if (options.oneofs) - object.action = "closeBatchTxn"; - } - if (message.generateDbPartitionsRead != null && message.hasOwnProperty("generateDbPartitionsRead")) { - object.generateDbPartitionsRead = $root.google.spanner.executor.v1.GenerateDbPartitionsForReadAction.toObject(message.generateDbPartitionsRead, options); - if (options.oneofs) - object.action = "generateDbPartitionsRead"; - } - if (message.generateDbPartitionsQuery != null && message.hasOwnProperty("generateDbPartitionsQuery")) { - object.generateDbPartitionsQuery = $root.google.spanner.executor.v1.GenerateDbPartitionsForQueryAction.toObject(message.generateDbPartitionsQuery, options); - if (options.oneofs) - object.action = "generateDbPartitionsQuery"; - } - if (message.executePartition != null && message.hasOwnProperty("executePartition")) { - object.executePartition = $root.google.spanner.executor.v1.ExecutePartitionAction.toObject(message.executePartition, options); - if (options.oneofs) - object.action = "executePartition"; - } - if (message.executeChangeStreamQuery != null && message.hasOwnProperty("executeChangeStreamQuery")) { - object.executeChangeStreamQuery = $root.google.spanner.executor.v1.ExecuteChangeStreamQuery.toObject(message.executeChangeStreamQuery, options); - if (options.oneofs) - object.action = "executeChangeStreamQuery"; - } - if (message.queryCancellation != null && message.hasOwnProperty("queryCancellation")) { - object.queryCancellation = $root.google.spanner.executor.v1.QueryCancellationAction.toObject(message.queryCancellation, options); - if (options.oneofs) - object.action = "queryCancellation"; - } - return object; - }; - - /** - * Converts this SpannerAction to JSON. - * @function toJSON - * @memberof google.spanner.executor.v1.SpannerAction - * @instance - * @returns {Object.} JSON object - */ - SpannerAction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SpannerAction - * @function getTypeUrl - * @memberof google.spanner.executor.v1.SpannerAction - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SpannerAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.executor.v1.SpannerAction"; - }; - - return SpannerAction; - })(); - - v1.ReadAction = (function() { - - /** - * Properties of a ReadAction. - * @memberof google.spanner.executor.v1 - * @interface IReadAction - * @property {string|null} [table] ReadAction table - * @property {string|null} [index] ReadAction index - * @property {Array.|null} [column] ReadAction column - * @property {google.spanner.executor.v1.IKeySet|null} [keys] ReadAction keys - * @property {number|null} [limit] ReadAction limit - */ - - /** - * Constructs a new ReadAction. - * @memberof google.spanner.executor.v1 - * @classdesc Represents a ReadAction. - * @implements IReadAction - * @constructor - * @param {google.spanner.executor.v1.IReadAction=} [properties] Properties to set - */ - function ReadAction(properties) { - this.column = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ReadAction table. - * @member {string} table - * @memberof google.spanner.executor.v1.ReadAction - * @instance - */ - ReadAction.prototype.table = ""; - - /** - * ReadAction index. - * @member {string|null|undefined} index - * @memberof google.spanner.executor.v1.ReadAction - * @instance - */ - ReadAction.prototype.index = null; - - /** - * ReadAction column. - * @member {Array.} column - * @memberof google.spanner.executor.v1.ReadAction - * @instance - */ - ReadAction.prototype.column = $util.emptyArray; - - /** - * ReadAction keys. - * @member {google.spanner.executor.v1.IKeySet|null|undefined} keys - * @memberof google.spanner.executor.v1.ReadAction - * @instance - */ - ReadAction.prototype.keys = null; - - /** - * ReadAction limit. - * @member {number} limit - * @memberof google.spanner.executor.v1.ReadAction - * @instance - */ - ReadAction.prototype.limit = 0; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ReadAction.prototype, "_index", { - get: $util.oneOfGetter($oneOfFields = ["index"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new ReadAction instance using the specified properties. - * @function create - * @memberof google.spanner.executor.v1.ReadAction - * @static - * @param {google.spanner.executor.v1.IReadAction=} [properties] Properties to set - * @returns {google.spanner.executor.v1.ReadAction} ReadAction instance - */ - ReadAction.create = function create(properties) { - return new ReadAction(properties); - }; - - /** - * Encodes the specified ReadAction message. Does not implicitly {@link google.spanner.executor.v1.ReadAction.verify|verify} messages. - * @function encode - * @memberof google.spanner.executor.v1.ReadAction - * @static - * @param {google.spanner.executor.v1.IReadAction} message ReadAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReadAction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.table != null && Object.hasOwnProperty.call(message, "table")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.table); - if (message.index != null && Object.hasOwnProperty.call(message, "index")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.index); - if (message.column != null && message.column.length) - for (var i = 0; i < message.column.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.column[i]); - if (message.keys != null && Object.hasOwnProperty.call(message, "keys")) - $root.google.spanner.executor.v1.KeySet.encode(message.keys, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.limit); - return writer; - }; - - /** - * Encodes the specified ReadAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.ReadAction.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.executor.v1.ReadAction - * @static - * @param {google.spanner.executor.v1.IReadAction} message ReadAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReadAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ReadAction message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.executor.v1.ReadAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.executor.v1.ReadAction} ReadAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReadAction.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.ReadAction(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.table = reader.string(); - break; - } - case 2: { - message.index = reader.string(); - break; - } - case 3: { - if (!(message.column && message.column.length)) - message.column = []; - message.column.push(reader.string()); - break; - } - case 4: { - message.keys = $root.google.spanner.executor.v1.KeySet.decode(reader, reader.uint32()); - break; - } - case 5: { - message.limit = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ReadAction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.executor.v1.ReadAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.executor.v1.ReadAction} ReadAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReadAction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ReadAction message. - * @function verify - * @memberof google.spanner.executor.v1.ReadAction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ReadAction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.table != null && message.hasOwnProperty("table")) - if (!$util.isString(message.table)) - return "table: string expected"; - if (message.index != null && message.hasOwnProperty("index")) { - properties._index = 1; - if (!$util.isString(message.index)) - return "index: string expected"; - } - if (message.column != null && message.hasOwnProperty("column")) { - if (!Array.isArray(message.column)) - return "column: array expected"; - for (var i = 0; i < message.column.length; ++i) - if (!$util.isString(message.column[i])) - return "column: string[] expected"; - } - if (message.keys != null && message.hasOwnProperty("keys")) { - var error = $root.google.spanner.executor.v1.KeySet.verify(message.keys); - if (error) - return "keys." + error; - } - if (message.limit != null && message.hasOwnProperty("limit")) - if (!$util.isInteger(message.limit)) - return "limit: integer expected"; - return null; - }; - - /** - * Creates a ReadAction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.executor.v1.ReadAction - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.executor.v1.ReadAction} ReadAction - */ - ReadAction.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.executor.v1.ReadAction) - return object; - var message = new $root.google.spanner.executor.v1.ReadAction(); - if (object.table != null) - message.table = String(object.table); - if (object.index != null) - message.index = String(object.index); - if (object.column) { - if (!Array.isArray(object.column)) - throw TypeError(".google.spanner.executor.v1.ReadAction.column: array expected"); - message.column = []; - for (var i = 0; i < object.column.length; ++i) - message.column[i] = String(object.column[i]); - } - if (object.keys != null) { - if (typeof object.keys !== "object") - throw TypeError(".google.spanner.executor.v1.ReadAction.keys: object expected"); - message.keys = $root.google.spanner.executor.v1.KeySet.fromObject(object.keys); - } - if (object.limit != null) - message.limit = object.limit | 0; - return message; - }; - - /** - * Creates a plain object from a ReadAction message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.executor.v1.ReadAction - * @static - * @param {google.spanner.executor.v1.ReadAction} message ReadAction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ReadAction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.column = []; - if (options.defaults) { - object.table = ""; - object.keys = null; - object.limit = 0; - } - if (message.table != null && message.hasOwnProperty("table")) - object.table = message.table; - if (message.index != null && message.hasOwnProperty("index")) { - object.index = message.index; - if (options.oneofs) - object._index = "index"; - } - if (message.column && message.column.length) { - object.column = []; - for (var j = 0; j < message.column.length; ++j) - object.column[j] = message.column[j]; - } - if (message.keys != null && message.hasOwnProperty("keys")) - object.keys = $root.google.spanner.executor.v1.KeySet.toObject(message.keys, options); - if (message.limit != null && message.hasOwnProperty("limit")) - object.limit = message.limit; - return object; - }; - - /** - * Converts this ReadAction to JSON. - * @function toJSON - * @memberof google.spanner.executor.v1.ReadAction - * @instance - * @returns {Object.} JSON object - */ - ReadAction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ReadAction - * @function getTypeUrl - * @memberof google.spanner.executor.v1.ReadAction - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ReadAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.executor.v1.ReadAction"; - }; - - return ReadAction; - })(); - - v1.QueryAction = (function() { - - /** - * Properties of a QueryAction. - * @memberof google.spanner.executor.v1 - * @interface IQueryAction - * @property {string|null} [sql] QueryAction sql - * @property {Array.|null} [params] QueryAction params - */ - - /** - * Constructs a new QueryAction. - * @memberof google.spanner.executor.v1 - * @classdesc Represents a QueryAction. - * @implements IQueryAction - * @constructor - * @param {google.spanner.executor.v1.IQueryAction=} [properties] Properties to set - */ - function QueryAction(properties) { - this.params = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryAction sql. - * @member {string} sql - * @memberof google.spanner.executor.v1.QueryAction - * @instance - */ - QueryAction.prototype.sql = ""; - - /** - * QueryAction params. - * @member {Array.} params - * @memberof google.spanner.executor.v1.QueryAction - * @instance - */ - QueryAction.prototype.params = $util.emptyArray; - - /** - * Creates a new QueryAction instance using the specified properties. - * @function create - * @memberof google.spanner.executor.v1.QueryAction - * @static - * @param {google.spanner.executor.v1.IQueryAction=} [properties] Properties to set - * @returns {google.spanner.executor.v1.QueryAction} QueryAction instance - */ - QueryAction.create = function create(properties) { - return new QueryAction(properties); - }; - - /** - * Encodes the specified QueryAction message. Does not implicitly {@link google.spanner.executor.v1.QueryAction.verify|verify} messages. - * @function encode - * @memberof google.spanner.executor.v1.QueryAction - * @static - * @param {google.spanner.executor.v1.IQueryAction} message QueryAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryAction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.sql != null && Object.hasOwnProperty.call(message, "sql")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.sql); - if (message.params != null && message.params.length) - for (var i = 0; i < message.params.length; ++i) - $root.google.spanner.executor.v1.QueryAction.Parameter.encode(message.params[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.QueryAction.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.executor.v1.QueryAction - * @static - * @param {google.spanner.executor.v1.IQueryAction} message QueryAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryAction message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.executor.v1.QueryAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.executor.v1.QueryAction} QueryAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryAction.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.QueryAction(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.sql = reader.string(); - break; - } - case 2: { - if (!(message.params && message.params.length)) - message.params = []; - message.params.push($root.google.spanner.executor.v1.QueryAction.Parameter.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryAction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.executor.v1.QueryAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.executor.v1.QueryAction} QueryAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryAction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryAction message. - * @function verify - * @memberof google.spanner.executor.v1.QueryAction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryAction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.sql != null && message.hasOwnProperty("sql")) - if (!$util.isString(message.sql)) - return "sql: string expected"; - if (message.params != null && message.hasOwnProperty("params")) { - if (!Array.isArray(message.params)) - return "params: array expected"; - for (var i = 0; i < message.params.length; ++i) { - var error = $root.google.spanner.executor.v1.QueryAction.Parameter.verify(message.params[i]); - if (error) - return "params." + error; - } - } - return null; - }; - - /** - * Creates a QueryAction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.executor.v1.QueryAction - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.executor.v1.QueryAction} QueryAction - */ - QueryAction.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.executor.v1.QueryAction) - return object; - var message = new $root.google.spanner.executor.v1.QueryAction(); - if (object.sql != null) - message.sql = String(object.sql); - if (object.params) { - if (!Array.isArray(object.params)) - throw TypeError(".google.spanner.executor.v1.QueryAction.params: array expected"); - message.params = []; - for (var i = 0; i < object.params.length; ++i) { - if (typeof object.params[i] !== "object") - throw TypeError(".google.spanner.executor.v1.QueryAction.params: object expected"); - message.params[i] = $root.google.spanner.executor.v1.QueryAction.Parameter.fromObject(object.params[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a QueryAction message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.executor.v1.QueryAction - * @static - * @param {google.spanner.executor.v1.QueryAction} message QueryAction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryAction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.params = []; - if (options.defaults) - object.sql = ""; - if (message.sql != null && message.hasOwnProperty("sql")) - object.sql = message.sql; - if (message.params && message.params.length) { - object.params = []; - for (var j = 0; j < message.params.length; ++j) - object.params[j] = $root.google.spanner.executor.v1.QueryAction.Parameter.toObject(message.params[j], options); - } - return object; - }; - - /** - * Converts this QueryAction to JSON. - * @function toJSON - * @memberof google.spanner.executor.v1.QueryAction - * @instance - * @returns {Object.} JSON object - */ - QueryAction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for QueryAction - * @function getTypeUrl - * @memberof google.spanner.executor.v1.QueryAction - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - QueryAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.executor.v1.QueryAction"; - }; - - QueryAction.Parameter = (function() { - - /** - * Properties of a Parameter. - * @memberof google.spanner.executor.v1.QueryAction - * @interface IParameter - * @property {string|null} [name] Parameter name - * @property {google.spanner.v1.IType|null} [type] Parameter type - * @property {google.spanner.executor.v1.IValue|null} [value] Parameter value - */ - - /** - * Constructs a new Parameter. - * @memberof google.spanner.executor.v1.QueryAction - * @classdesc Represents a Parameter. - * @implements IParameter - * @constructor - * @param {google.spanner.executor.v1.QueryAction.IParameter=} [properties] Properties to set - */ - function Parameter(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Parameter name. - * @member {string} name - * @memberof google.spanner.executor.v1.QueryAction.Parameter - * @instance - */ - Parameter.prototype.name = ""; - - /** - * Parameter type. - * @member {google.spanner.v1.IType|null|undefined} type - * @memberof google.spanner.executor.v1.QueryAction.Parameter - * @instance - */ - Parameter.prototype.type = null; - - /** - * Parameter value. - * @member {google.spanner.executor.v1.IValue|null|undefined} value - * @memberof google.spanner.executor.v1.QueryAction.Parameter - * @instance - */ - Parameter.prototype.value = null; - - /** - * Creates a new Parameter instance using the specified properties. - * @function create - * @memberof google.spanner.executor.v1.QueryAction.Parameter - * @static - * @param {google.spanner.executor.v1.QueryAction.IParameter=} [properties] Properties to set - * @returns {google.spanner.executor.v1.QueryAction.Parameter} Parameter instance - */ - Parameter.create = function create(properties) { - return new Parameter(properties); - }; - - /** - * Encodes the specified Parameter message. Does not implicitly {@link google.spanner.executor.v1.QueryAction.Parameter.verify|verify} messages. - * @function encode - * @memberof google.spanner.executor.v1.QueryAction.Parameter - * @static - * @param {google.spanner.executor.v1.QueryAction.IParameter} message Parameter message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Parameter.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - $root.google.spanner.v1.Type.encode(message.type, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - $root.google.spanner.executor.v1.Value.encode(message.value, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Parameter message, length delimited. Does not implicitly {@link google.spanner.executor.v1.QueryAction.Parameter.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.executor.v1.QueryAction.Parameter - * @static - * @param {google.spanner.executor.v1.QueryAction.IParameter} message Parameter message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Parameter.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Parameter message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.executor.v1.QueryAction.Parameter - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.executor.v1.QueryAction.Parameter} Parameter - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Parameter.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.QueryAction.Parameter(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.type = $root.google.spanner.v1.Type.decode(reader, reader.uint32()); - break; - } - case 3: { - message.value = $root.google.spanner.executor.v1.Value.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Parameter message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.executor.v1.QueryAction.Parameter - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.executor.v1.QueryAction.Parameter} Parameter - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Parameter.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Parameter message. - * @function verify - * @memberof google.spanner.executor.v1.QueryAction.Parameter - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Parameter.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.type != null && message.hasOwnProperty("type")) { - var error = $root.google.spanner.v1.Type.verify(message.type); - if (error) - return "type." + error; - } - if (message.value != null && message.hasOwnProperty("value")) { - var error = $root.google.spanner.executor.v1.Value.verify(message.value); - if (error) - return "value." + error; - } - return null; - }; - - /** - * Creates a Parameter message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.executor.v1.QueryAction.Parameter - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.executor.v1.QueryAction.Parameter} Parameter - */ - Parameter.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.executor.v1.QueryAction.Parameter) - return object; - var message = new $root.google.spanner.executor.v1.QueryAction.Parameter(); - if (object.name != null) - message.name = String(object.name); - if (object.type != null) { - if (typeof object.type !== "object") - throw TypeError(".google.spanner.executor.v1.QueryAction.Parameter.type: object expected"); - message.type = $root.google.spanner.v1.Type.fromObject(object.type); - } - if (object.value != null) { - if (typeof object.value !== "object") - throw TypeError(".google.spanner.executor.v1.QueryAction.Parameter.value: object expected"); - message.value = $root.google.spanner.executor.v1.Value.fromObject(object.value); - } - return message; - }; - - /** - * Creates a plain object from a Parameter message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.executor.v1.QueryAction.Parameter - * @static - * @param {google.spanner.executor.v1.QueryAction.Parameter} message Parameter - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Parameter.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.type = null; - object.value = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.type != null && message.hasOwnProperty("type")) - object.type = $root.google.spanner.v1.Type.toObject(message.type, options); - if (message.value != null && message.hasOwnProperty("value")) - object.value = $root.google.spanner.executor.v1.Value.toObject(message.value, options); - return object; - }; - - /** - * Converts this Parameter to JSON. - * @function toJSON - * @memberof google.spanner.executor.v1.QueryAction.Parameter - * @instance - * @returns {Object.} JSON object - */ - Parameter.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Parameter - * @function getTypeUrl - * @memberof google.spanner.executor.v1.QueryAction.Parameter - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Parameter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.executor.v1.QueryAction.Parameter"; - }; - - return Parameter; - })(); - - return QueryAction; - })(); - - v1.DmlAction = (function() { - - /** - * Properties of a DmlAction. - * @memberof google.spanner.executor.v1 - * @interface IDmlAction - * @property {google.spanner.executor.v1.IQueryAction|null} [update] DmlAction update - * @property {boolean|null} [autocommitIfSupported] DmlAction autocommitIfSupported - */ - - /** - * Constructs a new DmlAction. - * @memberof google.spanner.executor.v1 - * @classdesc Represents a DmlAction. - * @implements IDmlAction - * @constructor - * @param {google.spanner.executor.v1.IDmlAction=} [properties] Properties to set - */ - function DmlAction(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DmlAction update. - * @member {google.spanner.executor.v1.IQueryAction|null|undefined} update - * @memberof google.spanner.executor.v1.DmlAction - * @instance - */ - DmlAction.prototype.update = null; - - /** - * DmlAction autocommitIfSupported. - * @member {boolean|null|undefined} autocommitIfSupported - * @memberof google.spanner.executor.v1.DmlAction - * @instance - */ - DmlAction.prototype.autocommitIfSupported = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(DmlAction.prototype, "_autocommitIfSupported", { - get: $util.oneOfGetter($oneOfFields = ["autocommitIfSupported"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new DmlAction instance using the specified properties. - * @function create - * @memberof google.spanner.executor.v1.DmlAction - * @static - * @param {google.spanner.executor.v1.IDmlAction=} [properties] Properties to set - * @returns {google.spanner.executor.v1.DmlAction} DmlAction instance - */ - DmlAction.create = function create(properties) { - return new DmlAction(properties); - }; - - /** - * Encodes the specified DmlAction message. Does not implicitly {@link google.spanner.executor.v1.DmlAction.verify|verify} messages. - * @function encode - * @memberof google.spanner.executor.v1.DmlAction - * @static - * @param {google.spanner.executor.v1.IDmlAction} message DmlAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DmlAction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.update != null && Object.hasOwnProperty.call(message, "update")) - $root.google.spanner.executor.v1.QueryAction.encode(message.update, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.autocommitIfSupported != null && Object.hasOwnProperty.call(message, "autocommitIfSupported")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.autocommitIfSupported); - return writer; - }; - - /** - * Encodes the specified DmlAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.DmlAction.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.executor.v1.DmlAction - * @static - * @param {google.spanner.executor.v1.IDmlAction} message DmlAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DmlAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DmlAction message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.executor.v1.DmlAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.executor.v1.DmlAction} DmlAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DmlAction.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.DmlAction(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.update = $root.google.spanner.executor.v1.QueryAction.decode(reader, reader.uint32()); - break; - } - case 2: { - message.autocommitIfSupported = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DmlAction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.executor.v1.DmlAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.executor.v1.DmlAction} DmlAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DmlAction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DmlAction message. - * @function verify - * @memberof google.spanner.executor.v1.DmlAction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DmlAction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.update != null && message.hasOwnProperty("update")) { - var error = $root.google.spanner.executor.v1.QueryAction.verify(message.update); - if (error) - return "update." + error; - } - if (message.autocommitIfSupported != null && message.hasOwnProperty("autocommitIfSupported")) { - properties._autocommitIfSupported = 1; - if (typeof message.autocommitIfSupported !== "boolean") - return "autocommitIfSupported: boolean expected"; - } - return null; - }; - - /** - * Creates a DmlAction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.executor.v1.DmlAction - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.executor.v1.DmlAction} DmlAction - */ - DmlAction.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.executor.v1.DmlAction) - return object; - var message = new $root.google.spanner.executor.v1.DmlAction(); - if (object.update != null) { - if (typeof object.update !== "object") - throw TypeError(".google.spanner.executor.v1.DmlAction.update: object expected"); - message.update = $root.google.spanner.executor.v1.QueryAction.fromObject(object.update); - } - if (object.autocommitIfSupported != null) - message.autocommitIfSupported = Boolean(object.autocommitIfSupported); - return message; - }; - - /** - * Creates a plain object from a DmlAction message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.executor.v1.DmlAction - * @static - * @param {google.spanner.executor.v1.DmlAction} message DmlAction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DmlAction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.update = null; - if (message.update != null && message.hasOwnProperty("update")) - object.update = $root.google.spanner.executor.v1.QueryAction.toObject(message.update, options); - if (message.autocommitIfSupported != null && message.hasOwnProperty("autocommitIfSupported")) { - object.autocommitIfSupported = message.autocommitIfSupported; - if (options.oneofs) - object._autocommitIfSupported = "autocommitIfSupported"; - } - return object; - }; - - /** - * Converts this DmlAction to JSON. - * @function toJSON - * @memberof google.spanner.executor.v1.DmlAction - * @instance - * @returns {Object.} JSON object - */ - DmlAction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DmlAction - * @function getTypeUrl - * @memberof google.spanner.executor.v1.DmlAction - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DmlAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.executor.v1.DmlAction"; - }; - - return DmlAction; - })(); - - v1.BatchDmlAction = (function() { - - /** - * Properties of a BatchDmlAction. - * @memberof google.spanner.executor.v1 - * @interface IBatchDmlAction - * @property {Array.|null} [updates] BatchDmlAction updates - */ - - /** - * Constructs a new BatchDmlAction. - * @memberof google.spanner.executor.v1 - * @classdesc Represents a BatchDmlAction. - * @implements IBatchDmlAction - * @constructor - * @param {google.spanner.executor.v1.IBatchDmlAction=} [properties] Properties to set - */ - function BatchDmlAction(properties) { - this.updates = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BatchDmlAction updates. - * @member {Array.} updates - * @memberof google.spanner.executor.v1.BatchDmlAction - * @instance - */ - BatchDmlAction.prototype.updates = $util.emptyArray; - - /** - * Creates a new BatchDmlAction instance using the specified properties. - * @function create - * @memberof google.spanner.executor.v1.BatchDmlAction - * @static - * @param {google.spanner.executor.v1.IBatchDmlAction=} [properties] Properties to set - * @returns {google.spanner.executor.v1.BatchDmlAction} BatchDmlAction instance - */ - BatchDmlAction.create = function create(properties) { - return new BatchDmlAction(properties); - }; - - /** - * Encodes the specified BatchDmlAction message. Does not implicitly {@link google.spanner.executor.v1.BatchDmlAction.verify|verify} messages. - * @function encode - * @memberof google.spanner.executor.v1.BatchDmlAction - * @static - * @param {google.spanner.executor.v1.IBatchDmlAction} message BatchDmlAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchDmlAction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.updates != null && message.updates.length) - for (var i = 0; i < message.updates.length; ++i) - $root.google.spanner.executor.v1.QueryAction.encode(message.updates[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified BatchDmlAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.BatchDmlAction.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.executor.v1.BatchDmlAction - * @static - * @param {google.spanner.executor.v1.IBatchDmlAction} message BatchDmlAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchDmlAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BatchDmlAction message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.executor.v1.BatchDmlAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.executor.v1.BatchDmlAction} BatchDmlAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchDmlAction.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.BatchDmlAction(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.updates && message.updates.length)) - message.updates = []; - message.updates.push($root.google.spanner.executor.v1.QueryAction.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BatchDmlAction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.executor.v1.BatchDmlAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.executor.v1.BatchDmlAction} BatchDmlAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchDmlAction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BatchDmlAction message. - * @function verify - * @memberof google.spanner.executor.v1.BatchDmlAction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BatchDmlAction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.updates != null && message.hasOwnProperty("updates")) { - if (!Array.isArray(message.updates)) - return "updates: array expected"; - for (var i = 0; i < message.updates.length; ++i) { - var error = $root.google.spanner.executor.v1.QueryAction.verify(message.updates[i]); - if (error) - return "updates." + error; - } - } - return null; - }; - - /** - * Creates a BatchDmlAction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.executor.v1.BatchDmlAction - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.executor.v1.BatchDmlAction} BatchDmlAction - */ - BatchDmlAction.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.executor.v1.BatchDmlAction) - return object; - var message = new $root.google.spanner.executor.v1.BatchDmlAction(); - if (object.updates) { - if (!Array.isArray(object.updates)) - throw TypeError(".google.spanner.executor.v1.BatchDmlAction.updates: array expected"); - message.updates = []; - for (var i = 0; i < object.updates.length; ++i) { - if (typeof object.updates[i] !== "object") - throw TypeError(".google.spanner.executor.v1.BatchDmlAction.updates: object expected"); - message.updates[i] = $root.google.spanner.executor.v1.QueryAction.fromObject(object.updates[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a BatchDmlAction message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.executor.v1.BatchDmlAction - * @static - * @param {google.spanner.executor.v1.BatchDmlAction} message BatchDmlAction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BatchDmlAction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.updates = []; - if (message.updates && message.updates.length) { - object.updates = []; - for (var j = 0; j < message.updates.length; ++j) - object.updates[j] = $root.google.spanner.executor.v1.QueryAction.toObject(message.updates[j], options); - } - return object; - }; - - /** - * Converts this BatchDmlAction to JSON. - * @function toJSON - * @memberof google.spanner.executor.v1.BatchDmlAction - * @instance - * @returns {Object.} JSON object - */ - BatchDmlAction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BatchDmlAction - * @function getTypeUrl - * @memberof google.spanner.executor.v1.BatchDmlAction - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BatchDmlAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.executor.v1.BatchDmlAction"; - }; - - return BatchDmlAction; - })(); - - v1.Value = (function() { - - /** - * Properties of a Value. - * @memberof google.spanner.executor.v1 - * @interface IValue - * @property {boolean|null} [isNull] Value isNull - * @property {number|Long|null} [intValue] Value intValue - * @property {boolean|null} [boolValue] Value boolValue - * @property {number|null} [doubleValue] Value doubleValue - * @property {Uint8Array|null} [bytesValue] Value bytesValue - * @property {string|null} [stringValue] Value stringValue - * @property {google.spanner.executor.v1.IValueList|null} [structValue] Value structValue - * @property {google.protobuf.ITimestamp|null} [timestampValue] Value timestampValue - * @property {number|null} [dateDaysValue] Value dateDaysValue - * @property {boolean|null} [isCommitTimestamp] Value isCommitTimestamp - * @property {google.spanner.executor.v1.IValueList|null} [arrayValue] Value arrayValue - * @property {google.spanner.v1.IType|null} [arrayType] Value arrayType - */ - - /** - * Constructs a new Value. - * @memberof google.spanner.executor.v1 - * @classdesc Represents a Value. - * @implements IValue - * @constructor - * @param {google.spanner.executor.v1.IValue=} [properties] Properties to set - */ - function Value(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Value isNull. - * @member {boolean|null|undefined} isNull - * @memberof google.spanner.executor.v1.Value - * @instance - */ - Value.prototype.isNull = null; - - /** - * Value intValue. - * @member {number|Long|null|undefined} intValue - * @memberof google.spanner.executor.v1.Value - * @instance - */ - Value.prototype.intValue = null; - - /** - * Value boolValue. - * @member {boolean|null|undefined} boolValue - * @memberof google.spanner.executor.v1.Value - * @instance - */ - Value.prototype.boolValue = null; - - /** - * Value doubleValue. - * @member {number|null|undefined} doubleValue - * @memberof google.spanner.executor.v1.Value - * @instance - */ - Value.prototype.doubleValue = null; - - /** - * Value bytesValue. - * @member {Uint8Array|null|undefined} bytesValue - * @memberof google.spanner.executor.v1.Value - * @instance - */ - Value.prototype.bytesValue = null; - - /** - * Value stringValue. - * @member {string|null|undefined} stringValue - * @memberof google.spanner.executor.v1.Value - * @instance - */ - Value.prototype.stringValue = null; - - /** - * Value structValue. - * @member {google.spanner.executor.v1.IValueList|null|undefined} structValue - * @memberof google.spanner.executor.v1.Value - * @instance - */ - Value.prototype.structValue = null; - - /** - * Value timestampValue. - * @member {google.protobuf.ITimestamp|null|undefined} timestampValue - * @memberof google.spanner.executor.v1.Value - * @instance - */ - Value.prototype.timestampValue = null; - - /** - * Value dateDaysValue. - * @member {number|null|undefined} dateDaysValue - * @memberof google.spanner.executor.v1.Value - * @instance - */ - Value.prototype.dateDaysValue = null; - - /** - * Value isCommitTimestamp. - * @member {boolean|null|undefined} isCommitTimestamp - * @memberof google.spanner.executor.v1.Value - * @instance - */ - Value.prototype.isCommitTimestamp = null; - - /** - * Value arrayValue. - * @member {google.spanner.executor.v1.IValueList|null|undefined} arrayValue - * @memberof google.spanner.executor.v1.Value - * @instance - */ - Value.prototype.arrayValue = null; - - /** - * Value arrayType. - * @member {google.spanner.v1.IType|null|undefined} arrayType - * @memberof google.spanner.executor.v1.Value - * @instance - */ - Value.prototype.arrayType = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Value valueType. - * @member {"isNull"|"intValue"|"boolValue"|"doubleValue"|"bytesValue"|"stringValue"|"structValue"|"timestampValue"|"dateDaysValue"|"isCommitTimestamp"|"arrayValue"|undefined} valueType - * @memberof google.spanner.executor.v1.Value - * @instance - */ - Object.defineProperty(Value.prototype, "valueType", { - get: $util.oneOfGetter($oneOfFields = ["isNull", "intValue", "boolValue", "doubleValue", "bytesValue", "stringValue", "structValue", "timestampValue", "dateDaysValue", "isCommitTimestamp", "arrayValue"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(Value.prototype, "_arrayType", { - get: $util.oneOfGetter($oneOfFields = ["arrayType"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Value instance using the specified properties. - * @function create - * @memberof google.spanner.executor.v1.Value - * @static - * @param {google.spanner.executor.v1.IValue=} [properties] Properties to set - * @returns {google.spanner.executor.v1.Value} Value instance - */ - Value.create = function create(properties) { - return new Value(properties); - }; - - /** - * Encodes the specified Value message. Does not implicitly {@link google.spanner.executor.v1.Value.verify|verify} messages. - * @function encode - * @memberof google.spanner.executor.v1.Value - * @static - * @param {google.spanner.executor.v1.IValue} message Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Value.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.isNull != null && Object.hasOwnProperty.call(message, "isNull")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.isNull); - if (message.intValue != null && Object.hasOwnProperty.call(message, "intValue")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.intValue); - if (message.boolValue != null && Object.hasOwnProperty.call(message, "boolValue")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.boolValue); - if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) - writer.uint32(/* id 4, wireType 1 =*/33).double(message.doubleValue); - if (message.bytesValue != null && Object.hasOwnProperty.call(message, "bytesValue")) - writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.bytesValue); - if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.stringValue); - if (message.structValue != null && Object.hasOwnProperty.call(message, "structValue")) - $root.google.spanner.executor.v1.ValueList.encode(message.structValue, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.timestampValue != null && Object.hasOwnProperty.call(message, "timestampValue")) - $root.google.protobuf.Timestamp.encode(message.timestampValue, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.dateDaysValue != null && Object.hasOwnProperty.call(message, "dateDaysValue")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.dateDaysValue); - if (message.isCommitTimestamp != null && Object.hasOwnProperty.call(message, "isCommitTimestamp")) - writer.uint32(/* id 10, wireType 0 =*/80).bool(message.isCommitTimestamp); - if (message.arrayValue != null && Object.hasOwnProperty.call(message, "arrayValue")) - $root.google.spanner.executor.v1.ValueList.encode(message.arrayValue, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.arrayType != null && Object.hasOwnProperty.call(message, "arrayType")) - $root.google.spanner.v1.Type.encode(message.arrayType, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Value message, length delimited. Does not implicitly {@link google.spanner.executor.v1.Value.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.executor.v1.Value - * @static - * @param {google.spanner.executor.v1.IValue} message Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Value.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Value message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.executor.v1.Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.executor.v1.Value} Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Value.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.Value(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.isNull = reader.bool(); - break; - } - case 2: { - message.intValue = reader.int64(); - break; - } - case 3: { - message.boolValue = reader.bool(); - break; - } - case 4: { - message.doubleValue = reader.double(); - break; - } - case 5: { - message.bytesValue = reader.bytes(); - break; - } - case 6: { - message.stringValue = reader.string(); - break; - } - case 7: { - message.structValue = $root.google.spanner.executor.v1.ValueList.decode(reader, reader.uint32()); - break; - } - case 8: { - message.timestampValue = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 9: { - message.dateDaysValue = reader.int32(); - break; - } - case 10: { - message.isCommitTimestamp = reader.bool(); - break; - } - case 11: { - message.arrayValue = $root.google.spanner.executor.v1.ValueList.decode(reader, reader.uint32()); - break; - } - case 12: { - message.arrayType = $root.google.spanner.v1.Type.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Value message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.executor.v1.Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.executor.v1.Value} Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Value.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Value message. - * @function verify - * @memberof google.spanner.executor.v1.Value - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Value.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.isNull != null && message.hasOwnProperty("isNull")) { - properties.valueType = 1; - if (typeof message.isNull !== "boolean") - return "isNull: boolean expected"; - } - if (message.intValue != null && message.hasOwnProperty("intValue")) { - if (properties.valueType === 1) - return "valueType: multiple values"; - properties.valueType = 1; - if (!$util.isInteger(message.intValue) && !(message.intValue && $util.isInteger(message.intValue.low) && $util.isInteger(message.intValue.high))) - return "intValue: integer|Long expected"; - } - if (message.boolValue != null && message.hasOwnProperty("boolValue")) { - if (properties.valueType === 1) - return "valueType: multiple values"; - properties.valueType = 1; - if (typeof message.boolValue !== "boolean") - return "boolValue: boolean expected"; - } - if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) { - if (properties.valueType === 1) - return "valueType: multiple values"; - properties.valueType = 1; - if (typeof message.doubleValue !== "number") - return "doubleValue: number expected"; - } - if (message.bytesValue != null && message.hasOwnProperty("bytesValue")) { - if (properties.valueType === 1) - return "valueType: multiple values"; - properties.valueType = 1; - if (!(message.bytesValue && typeof message.bytesValue.length === "number" || $util.isString(message.bytesValue))) - return "bytesValue: buffer expected"; - } - if (message.stringValue != null && message.hasOwnProperty("stringValue")) { - if (properties.valueType === 1) - return "valueType: multiple values"; - properties.valueType = 1; - if (!$util.isString(message.stringValue)) - return "stringValue: string expected"; - } - if (message.structValue != null && message.hasOwnProperty("structValue")) { - if (properties.valueType === 1) - return "valueType: multiple values"; - properties.valueType = 1; - { - var error = $root.google.spanner.executor.v1.ValueList.verify(message.structValue); - if (error) - return "structValue." + error; - } - } - if (message.timestampValue != null && message.hasOwnProperty("timestampValue")) { - if (properties.valueType === 1) - return "valueType: multiple values"; - properties.valueType = 1; - { - var error = $root.google.protobuf.Timestamp.verify(message.timestampValue); - if (error) - return "timestampValue." + error; - } - } - if (message.dateDaysValue != null && message.hasOwnProperty("dateDaysValue")) { - if (properties.valueType === 1) - return "valueType: multiple values"; - properties.valueType = 1; - if (!$util.isInteger(message.dateDaysValue)) - return "dateDaysValue: integer expected"; - } - if (message.isCommitTimestamp != null && message.hasOwnProperty("isCommitTimestamp")) { - if (properties.valueType === 1) - return "valueType: multiple values"; - properties.valueType = 1; - if (typeof message.isCommitTimestamp !== "boolean") - return "isCommitTimestamp: boolean expected"; - } - if (message.arrayValue != null && message.hasOwnProperty("arrayValue")) { - if (properties.valueType === 1) - return "valueType: multiple values"; - properties.valueType = 1; - { - var error = $root.google.spanner.executor.v1.ValueList.verify(message.arrayValue); - if (error) - return "arrayValue." + error; - } - } - if (message.arrayType != null && message.hasOwnProperty("arrayType")) { - properties._arrayType = 1; - { - var error = $root.google.spanner.v1.Type.verify(message.arrayType); - if (error) - return "arrayType." + error; - } - } - return null; - }; - - /** - * Creates a Value message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.executor.v1.Value - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.executor.v1.Value} Value - */ - Value.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.executor.v1.Value) - return object; - var message = new $root.google.spanner.executor.v1.Value(); - if (object.isNull != null) - message.isNull = Boolean(object.isNull); - if (object.intValue != null) - if ($util.Long) - (message.intValue = $util.Long.fromValue(object.intValue)).unsigned = false; - else if (typeof object.intValue === "string") - message.intValue = parseInt(object.intValue, 10); - else if (typeof object.intValue === "number") - message.intValue = object.intValue; - else if (typeof object.intValue === "object") - message.intValue = new $util.LongBits(object.intValue.low >>> 0, object.intValue.high >>> 0).toNumber(); - if (object.boolValue != null) - message.boolValue = Boolean(object.boolValue); - if (object.doubleValue != null) - message.doubleValue = Number(object.doubleValue); - if (object.bytesValue != null) - if (typeof object.bytesValue === "string") - $util.base64.decode(object.bytesValue, message.bytesValue = $util.newBuffer($util.base64.length(object.bytesValue)), 0); - else if (object.bytesValue.length >= 0) - message.bytesValue = object.bytesValue; - if (object.stringValue != null) - message.stringValue = String(object.stringValue); - if (object.structValue != null) { - if (typeof object.structValue !== "object") - throw TypeError(".google.spanner.executor.v1.Value.structValue: object expected"); - message.structValue = $root.google.spanner.executor.v1.ValueList.fromObject(object.structValue); - } - if (object.timestampValue != null) { - if (typeof object.timestampValue !== "object") - throw TypeError(".google.spanner.executor.v1.Value.timestampValue: object expected"); - message.timestampValue = $root.google.protobuf.Timestamp.fromObject(object.timestampValue); - } - if (object.dateDaysValue != null) - message.dateDaysValue = object.dateDaysValue | 0; - if (object.isCommitTimestamp != null) - message.isCommitTimestamp = Boolean(object.isCommitTimestamp); - if (object.arrayValue != null) { - if (typeof object.arrayValue !== "object") - throw TypeError(".google.spanner.executor.v1.Value.arrayValue: object expected"); - message.arrayValue = $root.google.spanner.executor.v1.ValueList.fromObject(object.arrayValue); - } - if (object.arrayType != null) { - if (typeof object.arrayType !== "object") - throw TypeError(".google.spanner.executor.v1.Value.arrayType: object expected"); - message.arrayType = $root.google.spanner.v1.Type.fromObject(object.arrayType); - } - return message; - }; - - /** - * Creates a plain object from a Value message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.executor.v1.Value - * @static - * @param {google.spanner.executor.v1.Value} message Value - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Value.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.isNull != null && message.hasOwnProperty("isNull")) { - object.isNull = message.isNull; - if (options.oneofs) - object.valueType = "isNull"; - } - if (message.intValue != null && message.hasOwnProperty("intValue")) { - if (typeof message.intValue === "number") - object.intValue = options.longs === String ? String(message.intValue) : message.intValue; - else - object.intValue = options.longs === String ? $util.Long.prototype.toString.call(message.intValue) : options.longs === Number ? new $util.LongBits(message.intValue.low >>> 0, message.intValue.high >>> 0).toNumber() : message.intValue; - if (options.oneofs) - object.valueType = "intValue"; - } - if (message.boolValue != null && message.hasOwnProperty("boolValue")) { - object.boolValue = message.boolValue; - if (options.oneofs) - object.valueType = "boolValue"; - } - if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) { - object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; - if (options.oneofs) - object.valueType = "doubleValue"; - } - if (message.bytesValue != null && message.hasOwnProperty("bytesValue")) { - object.bytesValue = options.bytes === String ? $util.base64.encode(message.bytesValue, 0, message.bytesValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.bytesValue) : message.bytesValue; - if (options.oneofs) - object.valueType = "bytesValue"; - } - if (message.stringValue != null && message.hasOwnProperty("stringValue")) { - object.stringValue = message.stringValue; - if (options.oneofs) - object.valueType = "stringValue"; - } - if (message.structValue != null && message.hasOwnProperty("structValue")) { - object.structValue = $root.google.spanner.executor.v1.ValueList.toObject(message.structValue, options); - if (options.oneofs) - object.valueType = "structValue"; - } - if (message.timestampValue != null && message.hasOwnProperty("timestampValue")) { - object.timestampValue = $root.google.protobuf.Timestamp.toObject(message.timestampValue, options); - if (options.oneofs) - object.valueType = "timestampValue"; - } - if (message.dateDaysValue != null && message.hasOwnProperty("dateDaysValue")) { - object.dateDaysValue = message.dateDaysValue; - if (options.oneofs) - object.valueType = "dateDaysValue"; - } - if (message.isCommitTimestamp != null && message.hasOwnProperty("isCommitTimestamp")) { - object.isCommitTimestamp = message.isCommitTimestamp; - if (options.oneofs) - object.valueType = "isCommitTimestamp"; - } - if (message.arrayValue != null && message.hasOwnProperty("arrayValue")) { - object.arrayValue = $root.google.spanner.executor.v1.ValueList.toObject(message.arrayValue, options); - if (options.oneofs) - object.valueType = "arrayValue"; - } - if (message.arrayType != null && message.hasOwnProperty("arrayType")) { - object.arrayType = $root.google.spanner.v1.Type.toObject(message.arrayType, options); - if (options.oneofs) - object._arrayType = "arrayType"; - } - return object; - }; - - /** - * Converts this Value to JSON. - * @function toJSON - * @memberof google.spanner.executor.v1.Value - * @instance - * @returns {Object.} JSON object - */ - Value.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Value - * @function getTypeUrl - * @memberof google.spanner.executor.v1.Value - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.executor.v1.Value"; - }; - - return Value; - })(); - - v1.KeyRange = (function() { - - /** - * Properties of a KeyRange. - * @memberof google.spanner.executor.v1 - * @interface IKeyRange - * @property {google.spanner.executor.v1.IValueList|null} [start] KeyRange start - * @property {google.spanner.executor.v1.IValueList|null} [limit] KeyRange limit - * @property {google.spanner.executor.v1.KeyRange.Type|null} [type] KeyRange type - */ - - /** - * Constructs a new KeyRange. - * @memberof google.spanner.executor.v1 - * @classdesc Represents a KeyRange. - * @implements IKeyRange - * @constructor - * @param {google.spanner.executor.v1.IKeyRange=} [properties] Properties to set - */ - function KeyRange(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * KeyRange start. - * @member {google.spanner.executor.v1.IValueList|null|undefined} start - * @memberof google.spanner.executor.v1.KeyRange - * @instance - */ - KeyRange.prototype.start = null; - - /** - * KeyRange limit. - * @member {google.spanner.executor.v1.IValueList|null|undefined} limit - * @memberof google.spanner.executor.v1.KeyRange - * @instance - */ - KeyRange.prototype.limit = null; - - /** - * KeyRange type. - * @member {google.spanner.executor.v1.KeyRange.Type|null|undefined} type - * @memberof google.spanner.executor.v1.KeyRange - * @instance - */ - KeyRange.prototype.type = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(KeyRange.prototype, "_type", { - get: $util.oneOfGetter($oneOfFields = ["type"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new KeyRange instance using the specified properties. - * @function create - * @memberof google.spanner.executor.v1.KeyRange - * @static - * @param {google.spanner.executor.v1.IKeyRange=} [properties] Properties to set - * @returns {google.spanner.executor.v1.KeyRange} KeyRange instance - */ - KeyRange.create = function create(properties) { - return new KeyRange(properties); - }; - - /** - * Encodes the specified KeyRange message. Does not implicitly {@link google.spanner.executor.v1.KeyRange.verify|verify} messages. - * @function encode - * @memberof google.spanner.executor.v1.KeyRange - * @static - * @param {google.spanner.executor.v1.IKeyRange} message KeyRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - KeyRange.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.start != null && Object.hasOwnProperty.call(message, "start")) - $root.google.spanner.executor.v1.ValueList.encode(message.start, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) - $root.google.spanner.executor.v1.ValueList.encode(message.limit, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.type); - return writer; - }; - - /** - * Encodes the specified KeyRange message, length delimited. Does not implicitly {@link google.spanner.executor.v1.KeyRange.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.executor.v1.KeyRange - * @static - * @param {google.spanner.executor.v1.IKeyRange} message KeyRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - KeyRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a KeyRange message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.executor.v1.KeyRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.executor.v1.KeyRange} KeyRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - KeyRange.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.KeyRange(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.start = $root.google.spanner.executor.v1.ValueList.decode(reader, reader.uint32()); - break; - } - case 2: { - message.limit = $root.google.spanner.executor.v1.ValueList.decode(reader, reader.uint32()); - break; - } - case 3: { - message.type = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a KeyRange message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.executor.v1.KeyRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.executor.v1.KeyRange} KeyRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - KeyRange.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a KeyRange message. - * @function verify - * @memberof google.spanner.executor.v1.KeyRange - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - KeyRange.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.start != null && message.hasOwnProperty("start")) { - var error = $root.google.spanner.executor.v1.ValueList.verify(message.start); - if (error) - return "start." + error; - } - if (message.limit != null && message.hasOwnProperty("limit")) { - var error = $root.google.spanner.executor.v1.ValueList.verify(message.limit); - if (error) - return "limit." + error; - } - if (message.type != null && message.hasOwnProperty("type")) { - properties._type = 1; - switch (message.type) { - default: - return "type: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - } - return null; - }; - - /** - * Creates a KeyRange message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.executor.v1.KeyRange - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.executor.v1.KeyRange} KeyRange - */ - KeyRange.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.executor.v1.KeyRange) - return object; - var message = new $root.google.spanner.executor.v1.KeyRange(); - if (object.start != null) { - if (typeof object.start !== "object") - throw TypeError(".google.spanner.executor.v1.KeyRange.start: object expected"); - message.start = $root.google.spanner.executor.v1.ValueList.fromObject(object.start); - } - if (object.limit != null) { - if (typeof object.limit !== "object") - throw TypeError(".google.spanner.executor.v1.KeyRange.limit: object expected"); - message.limit = $root.google.spanner.executor.v1.ValueList.fromObject(object.limit); - } - switch (object.type) { - default: - if (typeof object.type === "number") { - message.type = object.type; - break; - } - break; - case "TYPE_UNSPECIFIED": - case 0: - message.type = 0; - break; - case "CLOSED_CLOSED": - case 1: - message.type = 1; - break; - case "CLOSED_OPEN": - case 2: - message.type = 2; - break; - case "OPEN_CLOSED": - case 3: - message.type = 3; - break; - case "OPEN_OPEN": - case 4: - message.type = 4; - break; - } - return message; - }; - - /** - * Creates a plain object from a KeyRange message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.executor.v1.KeyRange - * @static - * @param {google.spanner.executor.v1.KeyRange} message KeyRange - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - KeyRange.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.start = null; - object.limit = null; - } - if (message.start != null && message.hasOwnProperty("start")) - object.start = $root.google.spanner.executor.v1.ValueList.toObject(message.start, options); - if (message.limit != null && message.hasOwnProperty("limit")) - object.limit = $root.google.spanner.executor.v1.ValueList.toObject(message.limit, options); - if (message.type != null && message.hasOwnProperty("type")) { - object.type = options.enums === String ? $root.google.spanner.executor.v1.KeyRange.Type[message.type] === undefined ? message.type : $root.google.spanner.executor.v1.KeyRange.Type[message.type] : message.type; - if (options.oneofs) - object._type = "type"; - } - return object; - }; - - /** - * Converts this KeyRange to JSON. - * @function toJSON - * @memberof google.spanner.executor.v1.KeyRange - * @instance - * @returns {Object.} JSON object - */ - KeyRange.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for KeyRange - * @function getTypeUrl - * @memberof google.spanner.executor.v1.KeyRange - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - KeyRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.executor.v1.KeyRange"; - }; - - /** - * Type enum. - * @name google.spanner.executor.v1.KeyRange.Type - * @enum {number} - * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value - * @property {number} CLOSED_CLOSED=1 CLOSED_CLOSED value - * @property {number} CLOSED_OPEN=2 CLOSED_OPEN value - * @property {number} OPEN_CLOSED=3 OPEN_CLOSED value - * @property {number} OPEN_OPEN=4 OPEN_OPEN value - */ - KeyRange.Type = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "CLOSED_CLOSED"] = 1; - values[valuesById[2] = "CLOSED_OPEN"] = 2; - values[valuesById[3] = "OPEN_CLOSED"] = 3; - values[valuesById[4] = "OPEN_OPEN"] = 4; - return values; - })(); - - return KeyRange; - })(); - - v1.KeySet = (function() { - - /** - * Properties of a KeySet. - * @memberof google.spanner.executor.v1 - * @interface IKeySet - * @property {Array.|null} [point] KeySet point - * @property {Array.|null} [range] KeySet range - * @property {boolean|null} [all] KeySet all - */ - - /** - * Constructs a new KeySet. - * @memberof google.spanner.executor.v1 - * @classdesc Represents a KeySet. - * @implements IKeySet - * @constructor - * @param {google.spanner.executor.v1.IKeySet=} [properties] Properties to set - */ - function KeySet(properties) { - this.point = []; - this.range = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * KeySet point. - * @member {Array.} point - * @memberof google.spanner.executor.v1.KeySet - * @instance - */ - KeySet.prototype.point = $util.emptyArray; - - /** - * KeySet range. - * @member {Array.} range - * @memberof google.spanner.executor.v1.KeySet - * @instance - */ - KeySet.prototype.range = $util.emptyArray; - - /** - * KeySet all. - * @member {boolean} all - * @memberof google.spanner.executor.v1.KeySet - * @instance - */ - KeySet.prototype.all = false; - - /** - * Creates a new KeySet instance using the specified properties. - * @function create - * @memberof google.spanner.executor.v1.KeySet - * @static - * @param {google.spanner.executor.v1.IKeySet=} [properties] Properties to set - * @returns {google.spanner.executor.v1.KeySet} KeySet instance - */ - KeySet.create = function create(properties) { - return new KeySet(properties); - }; - - /** - * Encodes the specified KeySet message. Does not implicitly {@link google.spanner.executor.v1.KeySet.verify|verify} messages. - * @function encode - * @memberof google.spanner.executor.v1.KeySet - * @static - * @param {google.spanner.executor.v1.IKeySet} message KeySet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - KeySet.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.point != null && message.point.length) - for (var i = 0; i < message.point.length; ++i) - $root.google.spanner.executor.v1.ValueList.encode(message.point[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.range != null && message.range.length) - for (var i = 0; i < message.range.length; ++i) - $root.google.spanner.executor.v1.KeyRange.encode(message.range[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.all != null && Object.hasOwnProperty.call(message, "all")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.all); - return writer; - }; - - /** - * Encodes the specified KeySet message, length delimited. Does not implicitly {@link google.spanner.executor.v1.KeySet.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.executor.v1.KeySet - * @static - * @param {google.spanner.executor.v1.IKeySet} message KeySet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - KeySet.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a KeySet message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.executor.v1.KeySet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.executor.v1.KeySet} KeySet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - KeySet.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.KeySet(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.point && message.point.length)) - message.point = []; - message.point.push($root.google.spanner.executor.v1.ValueList.decode(reader, reader.uint32())); - break; - } - case 2: { - if (!(message.range && message.range.length)) - message.range = []; - message.range.push($root.google.spanner.executor.v1.KeyRange.decode(reader, reader.uint32())); - break; - } - case 3: { - message.all = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a KeySet message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.executor.v1.KeySet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.executor.v1.KeySet} KeySet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - KeySet.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a KeySet message. - * @function verify - * @memberof google.spanner.executor.v1.KeySet - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - KeySet.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.point != null && message.hasOwnProperty("point")) { - if (!Array.isArray(message.point)) - return "point: array expected"; - for (var i = 0; i < message.point.length; ++i) { - var error = $root.google.spanner.executor.v1.ValueList.verify(message.point[i]); - if (error) - return "point." + error; - } - } - if (message.range != null && message.hasOwnProperty("range")) { - if (!Array.isArray(message.range)) - return "range: array expected"; - for (var i = 0; i < message.range.length; ++i) { - var error = $root.google.spanner.executor.v1.KeyRange.verify(message.range[i]); - if (error) - return "range." + error; - } - } - if (message.all != null && message.hasOwnProperty("all")) - if (typeof message.all !== "boolean") - return "all: boolean expected"; - return null; - }; - - /** - * Creates a KeySet message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.executor.v1.KeySet - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.executor.v1.KeySet} KeySet - */ - KeySet.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.executor.v1.KeySet) - return object; - var message = new $root.google.spanner.executor.v1.KeySet(); - if (object.point) { - if (!Array.isArray(object.point)) - throw TypeError(".google.spanner.executor.v1.KeySet.point: array expected"); - message.point = []; - for (var i = 0; i < object.point.length; ++i) { - if (typeof object.point[i] !== "object") - throw TypeError(".google.spanner.executor.v1.KeySet.point: object expected"); - message.point[i] = $root.google.spanner.executor.v1.ValueList.fromObject(object.point[i]); - } - } - if (object.range) { - if (!Array.isArray(object.range)) - throw TypeError(".google.spanner.executor.v1.KeySet.range: array expected"); - message.range = []; - for (var i = 0; i < object.range.length; ++i) { - if (typeof object.range[i] !== "object") - throw TypeError(".google.spanner.executor.v1.KeySet.range: object expected"); - message.range[i] = $root.google.spanner.executor.v1.KeyRange.fromObject(object.range[i]); - } - } - if (object.all != null) - message.all = Boolean(object.all); - return message; - }; - - /** - * Creates a plain object from a KeySet message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.executor.v1.KeySet - * @static - * @param {google.spanner.executor.v1.KeySet} message KeySet - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - KeySet.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.point = []; - object.range = []; - } - if (options.defaults) - object.all = false; - if (message.point && message.point.length) { - object.point = []; - for (var j = 0; j < message.point.length; ++j) - object.point[j] = $root.google.spanner.executor.v1.ValueList.toObject(message.point[j], options); - } - if (message.range && message.range.length) { - object.range = []; - for (var j = 0; j < message.range.length; ++j) - object.range[j] = $root.google.spanner.executor.v1.KeyRange.toObject(message.range[j], options); - } - if (message.all != null && message.hasOwnProperty("all")) - object.all = message.all; - return object; - }; - - /** - * Converts this KeySet to JSON. - * @function toJSON - * @memberof google.spanner.executor.v1.KeySet - * @instance - * @returns {Object.} JSON object - */ - KeySet.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for KeySet - * @function getTypeUrl - * @memberof google.spanner.executor.v1.KeySet - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - KeySet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.executor.v1.KeySet"; - }; - - return KeySet; - })(); - - v1.ValueList = (function() { - - /** - * Properties of a ValueList. - * @memberof google.spanner.executor.v1 - * @interface IValueList - * @property {Array.|null} [value] ValueList value - */ - - /** - * Constructs a new ValueList. - * @memberof google.spanner.executor.v1 - * @classdesc Represents a ValueList. - * @implements IValueList - * @constructor - * @param {google.spanner.executor.v1.IValueList=} [properties] Properties to set - */ - function ValueList(properties) { - this.value = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ValueList value. - * @member {Array.} value - * @memberof google.spanner.executor.v1.ValueList - * @instance - */ - ValueList.prototype.value = $util.emptyArray; - - /** - * Creates a new ValueList instance using the specified properties. - * @function create - * @memberof google.spanner.executor.v1.ValueList - * @static - * @param {google.spanner.executor.v1.IValueList=} [properties] Properties to set - * @returns {google.spanner.executor.v1.ValueList} ValueList instance - */ - ValueList.create = function create(properties) { - return new ValueList(properties); - }; - - /** - * Encodes the specified ValueList message. Does not implicitly {@link google.spanner.executor.v1.ValueList.verify|verify} messages. - * @function encode - * @memberof google.spanner.executor.v1.ValueList - * @static - * @param {google.spanner.executor.v1.IValueList} message ValueList message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ValueList.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && message.value.length) - for (var i = 0; i < message.value.length; ++i) - $root.google.spanner.executor.v1.Value.encode(message.value[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ValueList message, length delimited. Does not implicitly {@link google.spanner.executor.v1.ValueList.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.executor.v1.ValueList - * @static - * @param {google.spanner.executor.v1.IValueList} message ValueList message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ValueList.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ValueList message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.executor.v1.ValueList - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.executor.v1.ValueList} ValueList - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ValueList.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.ValueList(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.value && message.value.length)) - message.value = []; - message.value.push($root.google.spanner.executor.v1.Value.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ValueList message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.executor.v1.ValueList - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.executor.v1.ValueList} ValueList - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ValueList.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ValueList message. - * @function verify - * @memberof google.spanner.executor.v1.ValueList - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ValueList.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) { - if (!Array.isArray(message.value)) - return "value: array expected"; - for (var i = 0; i < message.value.length; ++i) { - var error = $root.google.spanner.executor.v1.Value.verify(message.value[i]); - if (error) - return "value." + error; - } - } - return null; - }; - - /** - * Creates a ValueList message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.executor.v1.ValueList - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.executor.v1.ValueList} ValueList - */ - ValueList.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.executor.v1.ValueList) - return object; - var message = new $root.google.spanner.executor.v1.ValueList(); - if (object.value) { - if (!Array.isArray(object.value)) - throw TypeError(".google.spanner.executor.v1.ValueList.value: array expected"); - message.value = []; - for (var i = 0; i < object.value.length; ++i) { - if (typeof object.value[i] !== "object") - throw TypeError(".google.spanner.executor.v1.ValueList.value: object expected"); - message.value[i] = $root.google.spanner.executor.v1.Value.fromObject(object.value[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a ValueList message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.executor.v1.ValueList - * @static - * @param {google.spanner.executor.v1.ValueList} message ValueList - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ValueList.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.value = []; - if (message.value && message.value.length) { - object.value = []; - for (var j = 0; j < message.value.length; ++j) - object.value[j] = $root.google.spanner.executor.v1.Value.toObject(message.value[j], options); - } - return object; - }; - - /** - * Converts this ValueList to JSON. - * @function toJSON - * @memberof google.spanner.executor.v1.ValueList - * @instance - * @returns {Object.} JSON object - */ - ValueList.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ValueList - * @function getTypeUrl - * @memberof google.spanner.executor.v1.ValueList - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ValueList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.executor.v1.ValueList"; - }; - - return ValueList; - })(); - - v1.MutationAction = (function() { - - /** - * Properties of a MutationAction. - * @memberof google.spanner.executor.v1 - * @interface IMutationAction - * @property {Array.|null} [mod] MutationAction mod - */ - - /** - * Constructs a new MutationAction. - * @memberof google.spanner.executor.v1 - * @classdesc Represents a MutationAction. - * @implements IMutationAction - * @constructor - * @param {google.spanner.executor.v1.IMutationAction=} [properties] Properties to set - */ - function MutationAction(properties) { - this.mod = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MutationAction mod. - * @member {Array.} mod - * @memberof google.spanner.executor.v1.MutationAction - * @instance - */ - MutationAction.prototype.mod = $util.emptyArray; - - /** - * Creates a new MutationAction instance using the specified properties. - * @function create - * @memberof google.spanner.executor.v1.MutationAction - * @static - * @param {google.spanner.executor.v1.IMutationAction=} [properties] Properties to set - * @returns {google.spanner.executor.v1.MutationAction} MutationAction instance - */ - MutationAction.create = function create(properties) { - return new MutationAction(properties); - }; - - /** - * Encodes the specified MutationAction message. Does not implicitly {@link google.spanner.executor.v1.MutationAction.verify|verify} messages. - * @function encode - * @memberof google.spanner.executor.v1.MutationAction - * @static - * @param {google.spanner.executor.v1.IMutationAction} message MutationAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MutationAction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.mod != null && message.mod.length) - for (var i = 0; i < message.mod.length; ++i) - $root.google.spanner.executor.v1.MutationAction.Mod.encode(message.mod[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified MutationAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.MutationAction.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.executor.v1.MutationAction - * @static - * @param {google.spanner.executor.v1.IMutationAction} message MutationAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MutationAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MutationAction message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.executor.v1.MutationAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.executor.v1.MutationAction} MutationAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MutationAction.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.MutationAction(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.mod && message.mod.length)) - message.mod = []; - message.mod.push($root.google.spanner.executor.v1.MutationAction.Mod.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MutationAction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.executor.v1.MutationAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.executor.v1.MutationAction} MutationAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MutationAction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MutationAction message. - * @function verify - * @memberof google.spanner.executor.v1.MutationAction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MutationAction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.mod != null && message.hasOwnProperty("mod")) { - if (!Array.isArray(message.mod)) - return "mod: array expected"; - for (var i = 0; i < message.mod.length; ++i) { - var error = $root.google.spanner.executor.v1.MutationAction.Mod.verify(message.mod[i]); - if (error) - return "mod." + error; - } - } - return null; - }; - - /** - * Creates a MutationAction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.executor.v1.MutationAction - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.executor.v1.MutationAction} MutationAction - */ - MutationAction.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.executor.v1.MutationAction) - return object; - var message = new $root.google.spanner.executor.v1.MutationAction(); - if (object.mod) { - if (!Array.isArray(object.mod)) - throw TypeError(".google.spanner.executor.v1.MutationAction.mod: array expected"); - message.mod = []; - for (var i = 0; i < object.mod.length; ++i) { - if (typeof object.mod[i] !== "object") - throw TypeError(".google.spanner.executor.v1.MutationAction.mod: object expected"); - message.mod[i] = $root.google.spanner.executor.v1.MutationAction.Mod.fromObject(object.mod[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a MutationAction message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.executor.v1.MutationAction - * @static - * @param {google.spanner.executor.v1.MutationAction} message MutationAction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MutationAction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.mod = []; - if (message.mod && message.mod.length) { - object.mod = []; - for (var j = 0; j < message.mod.length; ++j) - object.mod[j] = $root.google.spanner.executor.v1.MutationAction.Mod.toObject(message.mod[j], options); - } - return object; - }; - - /** - * Converts this MutationAction to JSON. - * @function toJSON - * @memberof google.spanner.executor.v1.MutationAction - * @instance - * @returns {Object.} JSON object - */ - MutationAction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MutationAction - * @function getTypeUrl - * @memberof google.spanner.executor.v1.MutationAction - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MutationAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.executor.v1.MutationAction"; - }; - - MutationAction.InsertArgs = (function() { - - /** - * Properties of an InsertArgs. - * @memberof google.spanner.executor.v1.MutationAction - * @interface IInsertArgs - * @property {Array.|null} [column] InsertArgs column - * @property {Array.|null} [type] InsertArgs type - * @property {Array.|null} [values] InsertArgs values - */ - - /** - * Constructs a new InsertArgs. - * @memberof google.spanner.executor.v1.MutationAction - * @classdesc Represents an InsertArgs. - * @implements IInsertArgs - * @constructor - * @param {google.spanner.executor.v1.MutationAction.IInsertArgs=} [properties] Properties to set - */ - function InsertArgs(properties) { - this.column = []; - this.type = []; - this.values = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * InsertArgs column. - * @member {Array.} column - * @memberof google.spanner.executor.v1.MutationAction.InsertArgs - * @instance - */ - InsertArgs.prototype.column = $util.emptyArray; - - /** - * InsertArgs type. - * @member {Array.} type - * @memberof google.spanner.executor.v1.MutationAction.InsertArgs - * @instance - */ - InsertArgs.prototype.type = $util.emptyArray; - - /** - * InsertArgs values. - * @member {Array.} values - * @memberof google.spanner.executor.v1.MutationAction.InsertArgs - * @instance - */ - InsertArgs.prototype.values = $util.emptyArray; - - /** - * Creates a new InsertArgs instance using the specified properties. - * @function create - * @memberof google.spanner.executor.v1.MutationAction.InsertArgs - * @static - * @param {google.spanner.executor.v1.MutationAction.IInsertArgs=} [properties] Properties to set - * @returns {google.spanner.executor.v1.MutationAction.InsertArgs} InsertArgs instance - */ - InsertArgs.create = function create(properties) { - return new InsertArgs(properties); - }; - - /** - * Encodes the specified InsertArgs message. Does not implicitly {@link google.spanner.executor.v1.MutationAction.InsertArgs.verify|verify} messages. - * @function encode - * @memberof google.spanner.executor.v1.MutationAction.InsertArgs - * @static - * @param {google.spanner.executor.v1.MutationAction.IInsertArgs} message InsertArgs message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InsertArgs.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.column != null && message.column.length) - for (var i = 0; i < message.column.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.column[i]); - if (message.type != null && message.type.length) - for (var i = 0; i < message.type.length; ++i) - $root.google.spanner.v1.Type.encode(message.type[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.values != null && message.values.length) - for (var i = 0; i < message.values.length; ++i) - $root.google.spanner.executor.v1.ValueList.encode(message.values[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified InsertArgs message, length delimited. Does not implicitly {@link google.spanner.executor.v1.MutationAction.InsertArgs.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.executor.v1.MutationAction.InsertArgs - * @static - * @param {google.spanner.executor.v1.MutationAction.IInsertArgs} message InsertArgs message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InsertArgs.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an InsertArgs message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.executor.v1.MutationAction.InsertArgs - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.executor.v1.MutationAction.InsertArgs} InsertArgs - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InsertArgs.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.MutationAction.InsertArgs(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.column && message.column.length)) - message.column = []; - message.column.push(reader.string()); - break; - } - case 2: { - if (!(message.type && message.type.length)) - message.type = []; - message.type.push($root.google.spanner.v1.Type.decode(reader, reader.uint32())); - break; - } - case 3: { - if (!(message.values && message.values.length)) - message.values = []; - message.values.push($root.google.spanner.executor.v1.ValueList.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an InsertArgs message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.executor.v1.MutationAction.InsertArgs - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.executor.v1.MutationAction.InsertArgs} InsertArgs - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InsertArgs.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an InsertArgs message. - * @function verify - * @memberof google.spanner.executor.v1.MutationAction.InsertArgs - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - InsertArgs.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.column != null && message.hasOwnProperty("column")) { - if (!Array.isArray(message.column)) - return "column: array expected"; - for (var i = 0; i < message.column.length; ++i) - if (!$util.isString(message.column[i])) - return "column: string[] expected"; - } - if (message.type != null && message.hasOwnProperty("type")) { - if (!Array.isArray(message.type)) - return "type: array expected"; - for (var i = 0; i < message.type.length; ++i) { - var error = $root.google.spanner.v1.Type.verify(message.type[i]); - if (error) - return "type." + error; - } - } - if (message.values != null && message.hasOwnProperty("values")) { - if (!Array.isArray(message.values)) - return "values: array expected"; - for (var i = 0; i < message.values.length; ++i) { - var error = $root.google.spanner.executor.v1.ValueList.verify(message.values[i]); - if (error) - return "values." + error; - } - } - return null; - }; - - /** - * Creates an InsertArgs message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.executor.v1.MutationAction.InsertArgs - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.executor.v1.MutationAction.InsertArgs} InsertArgs - */ - InsertArgs.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.executor.v1.MutationAction.InsertArgs) - return object; - var message = new $root.google.spanner.executor.v1.MutationAction.InsertArgs(); - if (object.column) { - if (!Array.isArray(object.column)) - throw TypeError(".google.spanner.executor.v1.MutationAction.InsertArgs.column: array expected"); - message.column = []; - for (var i = 0; i < object.column.length; ++i) - message.column[i] = String(object.column[i]); - } - if (object.type) { - if (!Array.isArray(object.type)) - throw TypeError(".google.spanner.executor.v1.MutationAction.InsertArgs.type: array expected"); - message.type = []; - for (var i = 0; i < object.type.length; ++i) { - if (typeof object.type[i] !== "object") - throw TypeError(".google.spanner.executor.v1.MutationAction.InsertArgs.type: object expected"); - message.type[i] = $root.google.spanner.v1.Type.fromObject(object.type[i]); - } - } - if (object.values) { - if (!Array.isArray(object.values)) - throw TypeError(".google.spanner.executor.v1.MutationAction.InsertArgs.values: array expected"); - message.values = []; - for (var i = 0; i < object.values.length; ++i) { - if (typeof object.values[i] !== "object") - throw TypeError(".google.spanner.executor.v1.MutationAction.InsertArgs.values: object expected"); - message.values[i] = $root.google.spanner.executor.v1.ValueList.fromObject(object.values[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an InsertArgs message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.executor.v1.MutationAction.InsertArgs - * @static - * @param {google.spanner.executor.v1.MutationAction.InsertArgs} message InsertArgs - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - InsertArgs.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.column = []; - object.type = []; - object.values = []; - } - if (message.column && message.column.length) { - object.column = []; - for (var j = 0; j < message.column.length; ++j) - object.column[j] = message.column[j]; - } - if (message.type && message.type.length) { - object.type = []; - for (var j = 0; j < message.type.length; ++j) - object.type[j] = $root.google.spanner.v1.Type.toObject(message.type[j], options); - } - if (message.values && message.values.length) { - object.values = []; - for (var j = 0; j < message.values.length; ++j) - object.values[j] = $root.google.spanner.executor.v1.ValueList.toObject(message.values[j], options); - } - return object; - }; - - /** - * Converts this InsertArgs to JSON. - * @function toJSON - * @memberof google.spanner.executor.v1.MutationAction.InsertArgs - * @instance - * @returns {Object.} JSON object - */ - InsertArgs.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for InsertArgs - * @function getTypeUrl - * @memberof google.spanner.executor.v1.MutationAction.InsertArgs - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - InsertArgs.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.executor.v1.MutationAction.InsertArgs"; - }; - - return InsertArgs; - })(); - - MutationAction.UpdateArgs = (function() { - - /** - * Properties of an UpdateArgs. - * @memberof google.spanner.executor.v1.MutationAction - * @interface IUpdateArgs - * @property {Array.|null} [column] UpdateArgs column - * @property {Array.|null} [type] UpdateArgs type - * @property {Array.|null} [values] UpdateArgs values - */ - - /** - * Constructs a new UpdateArgs. - * @memberof google.spanner.executor.v1.MutationAction - * @classdesc Represents an UpdateArgs. - * @implements IUpdateArgs - * @constructor - * @param {google.spanner.executor.v1.MutationAction.IUpdateArgs=} [properties] Properties to set - */ - function UpdateArgs(properties) { - this.column = []; - this.type = []; - this.values = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateArgs column. - * @member {Array.} column - * @memberof google.spanner.executor.v1.MutationAction.UpdateArgs - * @instance - */ - UpdateArgs.prototype.column = $util.emptyArray; - - /** - * UpdateArgs type. - * @member {Array.} type - * @memberof google.spanner.executor.v1.MutationAction.UpdateArgs - * @instance - */ - UpdateArgs.prototype.type = $util.emptyArray; - - /** - * UpdateArgs values. - * @member {Array.} values - * @memberof google.spanner.executor.v1.MutationAction.UpdateArgs - * @instance - */ - UpdateArgs.prototype.values = $util.emptyArray; - - /** - * Creates a new UpdateArgs instance using the specified properties. - * @function create - * @memberof google.spanner.executor.v1.MutationAction.UpdateArgs - * @static - * @param {google.spanner.executor.v1.MutationAction.IUpdateArgs=} [properties] Properties to set - * @returns {google.spanner.executor.v1.MutationAction.UpdateArgs} UpdateArgs instance - */ - UpdateArgs.create = function create(properties) { - return new UpdateArgs(properties); - }; - - /** - * Encodes the specified UpdateArgs message. Does not implicitly {@link google.spanner.executor.v1.MutationAction.UpdateArgs.verify|verify} messages. - * @function encode - * @memberof google.spanner.executor.v1.MutationAction.UpdateArgs - * @static - * @param {google.spanner.executor.v1.MutationAction.IUpdateArgs} message UpdateArgs message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateArgs.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.column != null && message.column.length) - for (var i = 0; i < message.column.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.column[i]); - if (message.type != null && message.type.length) - for (var i = 0; i < message.type.length; ++i) - $root.google.spanner.v1.Type.encode(message.type[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.values != null && message.values.length) - for (var i = 0; i < message.values.length; ++i) - $root.google.spanner.executor.v1.ValueList.encode(message.values[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified UpdateArgs message, length delimited. Does not implicitly {@link google.spanner.executor.v1.MutationAction.UpdateArgs.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.executor.v1.MutationAction.UpdateArgs - * @static - * @param {google.spanner.executor.v1.MutationAction.IUpdateArgs} message UpdateArgs message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateArgs.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateArgs message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.executor.v1.MutationAction.UpdateArgs - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.executor.v1.MutationAction.UpdateArgs} UpdateArgs - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateArgs.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.MutationAction.UpdateArgs(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.column && message.column.length)) - message.column = []; - message.column.push(reader.string()); - break; - } - case 2: { - if (!(message.type && message.type.length)) - message.type = []; - message.type.push($root.google.spanner.v1.Type.decode(reader, reader.uint32())); - break; - } - case 3: { - if (!(message.values && message.values.length)) - message.values = []; - message.values.push($root.google.spanner.executor.v1.ValueList.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateArgs message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.executor.v1.MutationAction.UpdateArgs - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.executor.v1.MutationAction.UpdateArgs} UpdateArgs - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateArgs.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateArgs message. - * @function verify - * @memberof google.spanner.executor.v1.MutationAction.UpdateArgs - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateArgs.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.column != null && message.hasOwnProperty("column")) { - if (!Array.isArray(message.column)) - return "column: array expected"; - for (var i = 0; i < message.column.length; ++i) - if (!$util.isString(message.column[i])) - return "column: string[] expected"; - } - if (message.type != null && message.hasOwnProperty("type")) { - if (!Array.isArray(message.type)) - return "type: array expected"; - for (var i = 0; i < message.type.length; ++i) { - var error = $root.google.spanner.v1.Type.verify(message.type[i]); - if (error) - return "type." + error; - } - } - if (message.values != null && message.hasOwnProperty("values")) { - if (!Array.isArray(message.values)) - return "values: array expected"; - for (var i = 0; i < message.values.length; ++i) { - var error = $root.google.spanner.executor.v1.ValueList.verify(message.values[i]); - if (error) - return "values." + error; - } - } - return null; - }; - - /** - * Creates an UpdateArgs message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.executor.v1.MutationAction.UpdateArgs - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.executor.v1.MutationAction.UpdateArgs} UpdateArgs - */ - UpdateArgs.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.executor.v1.MutationAction.UpdateArgs) - return object; - var message = new $root.google.spanner.executor.v1.MutationAction.UpdateArgs(); - if (object.column) { - if (!Array.isArray(object.column)) - throw TypeError(".google.spanner.executor.v1.MutationAction.UpdateArgs.column: array expected"); - message.column = []; - for (var i = 0; i < object.column.length; ++i) - message.column[i] = String(object.column[i]); - } - if (object.type) { - if (!Array.isArray(object.type)) - throw TypeError(".google.spanner.executor.v1.MutationAction.UpdateArgs.type: array expected"); - message.type = []; - for (var i = 0; i < object.type.length; ++i) { - if (typeof object.type[i] !== "object") - throw TypeError(".google.spanner.executor.v1.MutationAction.UpdateArgs.type: object expected"); - message.type[i] = $root.google.spanner.v1.Type.fromObject(object.type[i]); - } - } - if (object.values) { - if (!Array.isArray(object.values)) - throw TypeError(".google.spanner.executor.v1.MutationAction.UpdateArgs.values: array expected"); - message.values = []; - for (var i = 0; i < object.values.length; ++i) { - if (typeof object.values[i] !== "object") - throw TypeError(".google.spanner.executor.v1.MutationAction.UpdateArgs.values: object expected"); - message.values[i] = $root.google.spanner.executor.v1.ValueList.fromObject(object.values[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an UpdateArgs message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.executor.v1.MutationAction.UpdateArgs - * @static - * @param {google.spanner.executor.v1.MutationAction.UpdateArgs} message UpdateArgs - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateArgs.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.column = []; - object.type = []; - object.values = []; - } - if (message.column && message.column.length) { - object.column = []; - for (var j = 0; j < message.column.length; ++j) - object.column[j] = message.column[j]; - } - if (message.type && message.type.length) { - object.type = []; - for (var j = 0; j < message.type.length; ++j) - object.type[j] = $root.google.spanner.v1.Type.toObject(message.type[j], options); - } - if (message.values && message.values.length) { - object.values = []; - for (var j = 0; j < message.values.length; ++j) - object.values[j] = $root.google.spanner.executor.v1.ValueList.toObject(message.values[j], options); - } - return object; - }; - - /** - * Converts this UpdateArgs to JSON. - * @function toJSON - * @memberof google.spanner.executor.v1.MutationAction.UpdateArgs - * @instance - * @returns {Object.} JSON object - */ - UpdateArgs.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateArgs - * @function getTypeUrl - * @memberof google.spanner.executor.v1.MutationAction.UpdateArgs - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateArgs.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.executor.v1.MutationAction.UpdateArgs"; - }; - - return UpdateArgs; - })(); - - MutationAction.Mod = (function() { - - /** - * Properties of a Mod. - * @memberof google.spanner.executor.v1.MutationAction - * @interface IMod - * @property {string|null} [table] Mod table - * @property {google.spanner.executor.v1.MutationAction.IInsertArgs|null} [insert] Mod insert - * @property {google.spanner.executor.v1.MutationAction.IUpdateArgs|null} [update] Mod update - * @property {google.spanner.executor.v1.MutationAction.IInsertArgs|null} [insertOrUpdate] Mod insertOrUpdate - * @property {google.spanner.executor.v1.MutationAction.IInsertArgs|null} [replace] Mod replace - * @property {google.spanner.executor.v1.IKeySet|null} [deleteKeys] Mod deleteKeys - */ - - /** - * Constructs a new Mod. - * @memberof google.spanner.executor.v1.MutationAction - * @classdesc Represents a Mod. - * @implements IMod - * @constructor - * @param {google.spanner.executor.v1.MutationAction.IMod=} [properties] Properties to set - */ - function Mod(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Mod table. - * @member {string} table - * @memberof google.spanner.executor.v1.MutationAction.Mod - * @instance - */ - Mod.prototype.table = ""; - - /** - * Mod insert. - * @member {google.spanner.executor.v1.MutationAction.IInsertArgs|null|undefined} insert - * @memberof google.spanner.executor.v1.MutationAction.Mod - * @instance - */ - Mod.prototype.insert = null; - - /** - * Mod update. - * @member {google.spanner.executor.v1.MutationAction.IUpdateArgs|null|undefined} update - * @memberof google.spanner.executor.v1.MutationAction.Mod - * @instance - */ - Mod.prototype.update = null; - - /** - * Mod insertOrUpdate. - * @member {google.spanner.executor.v1.MutationAction.IInsertArgs|null|undefined} insertOrUpdate - * @memberof google.spanner.executor.v1.MutationAction.Mod - * @instance - */ - Mod.prototype.insertOrUpdate = null; - - /** - * Mod replace. - * @member {google.spanner.executor.v1.MutationAction.IInsertArgs|null|undefined} replace - * @memberof google.spanner.executor.v1.MutationAction.Mod - * @instance - */ - Mod.prototype.replace = null; - - /** - * Mod deleteKeys. - * @member {google.spanner.executor.v1.IKeySet|null|undefined} deleteKeys - * @memberof google.spanner.executor.v1.MutationAction.Mod - * @instance - */ - Mod.prototype.deleteKeys = null; - - /** - * Creates a new Mod instance using the specified properties. - * @function create - * @memberof google.spanner.executor.v1.MutationAction.Mod - * @static - * @param {google.spanner.executor.v1.MutationAction.IMod=} [properties] Properties to set - * @returns {google.spanner.executor.v1.MutationAction.Mod} Mod instance - */ - Mod.create = function create(properties) { - return new Mod(properties); - }; - - /** - * Encodes the specified Mod message. Does not implicitly {@link google.spanner.executor.v1.MutationAction.Mod.verify|verify} messages. - * @function encode - * @memberof google.spanner.executor.v1.MutationAction.Mod - * @static - * @param {google.spanner.executor.v1.MutationAction.IMod} message Mod message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Mod.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.table != null && Object.hasOwnProperty.call(message, "table")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.table); - if (message.insert != null && Object.hasOwnProperty.call(message, "insert")) - $root.google.spanner.executor.v1.MutationAction.InsertArgs.encode(message.insert, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.update != null && Object.hasOwnProperty.call(message, "update")) - $root.google.spanner.executor.v1.MutationAction.UpdateArgs.encode(message.update, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.insertOrUpdate != null && Object.hasOwnProperty.call(message, "insertOrUpdate")) - $root.google.spanner.executor.v1.MutationAction.InsertArgs.encode(message.insertOrUpdate, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.replace != null && Object.hasOwnProperty.call(message, "replace")) - $root.google.spanner.executor.v1.MutationAction.InsertArgs.encode(message.replace, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.deleteKeys != null && Object.hasOwnProperty.call(message, "deleteKeys")) - $root.google.spanner.executor.v1.KeySet.encode(message.deleteKeys, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Mod message, length delimited. Does not implicitly {@link google.spanner.executor.v1.MutationAction.Mod.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.executor.v1.MutationAction.Mod - * @static - * @param {google.spanner.executor.v1.MutationAction.IMod} message Mod message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Mod.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Mod message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.executor.v1.MutationAction.Mod - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.executor.v1.MutationAction.Mod} Mod - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Mod.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.MutationAction.Mod(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.table = reader.string(); - break; - } - case 2: { - message.insert = $root.google.spanner.executor.v1.MutationAction.InsertArgs.decode(reader, reader.uint32()); - break; - } - case 3: { - message.update = $root.google.spanner.executor.v1.MutationAction.UpdateArgs.decode(reader, reader.uint32()); - break; - } - case 4: { - message.insertOrUpdate = $root.google.spanner.executor.v1.MutationAction.InsertArgs.decode(reader, reader.uint32()); - break; - } - case 5: { - message.replace = $root.google.spanner.executor.v1.MutationAction.InsertArgs.decode(reader, reader.uint32()); - break; - } - case 6: { - message.deleteKeys = $root.google.spanner.executor.v1.KeySet.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Mod message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.executor.v1.MutationAction.Mod - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.executor.v1.MutationAction.Mod} Mod - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Mod.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Mod message. - * @function verify - * @memberof google.spanner.executor.v1.MutationAction.Mod - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Mod.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.table != null && message.hasOwnProperty("table")) - if (!$util.isString(message.table)) - return "table: string expected"; - if (message.insert != null && message.hasOwnProperty("insert")) { - var error = $root.google.spanner.executor.v1.MutationAction.InsertArgs.verify(message.insert); - if (error) - return "insert." + error; - } - if (message.update != null && message.hasOwnProperty("update")) { - var error = $root.google.spanner.executor.v1.MutationAction.UpdateArgs.verify(message.update); - if (error) - return "update." + error; - } - if (message.insertOrUpdate != null && message.hasOwnProperty("insertOrUpdate")) { - var error = $root.google.spanner.executor.v1.MutationAction.InsertArgs.verify(message.insertOrUpdate); - if (error) - return "insertOrUpdate." + error; - } - if (message.replace != null && message.hasOwnProperty("replace")) { - var error = $root.google.spanner.executor.v1.MutationAction.InsertArgs.verify(message.replace); - if (error) - return "replace." + error; - } - if (message.deleteKeys != null && message.hasOwnProperty("deleteKeys")) { - var error = $root.google.spanner.executor.v1.KeySet.verify(message.deleteKeys); - if (error) - return "deleteKeys." + error; - } - return null; - }; - - /** - * Creates a Mod message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.executor.v1.MutationAction.Mod - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.executor.v1.MutationAction.Mod} Mod - */ - Mod.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.executor.v1.MutationAction.Mod) - return object; - var message = new $root.google.spanner.executor.v1.MutationAction.Mod(); - if (object.table != null) - message.table = String(object.table); - if (object.insert != null) { - if (typeof object.insert !== "object") - throw TypeError(".google.spanner.executor.v1.MutationAction.Mod.insert: object expected"); - message.insert = $root.google.spanner.executor.v1.MutationAction.InsertArgs.fromObject(object.insert); - } - if (object.update != null) { - if (typeof object.update !== "object") - throw TypeError(".google.spanner.executor.v1.MutationAction.Mod.update: object expected"); - message.update = $root.google.spanner.executor.v1.MutationAction.UpdateArgs.fromObject(object.update); - } - if (object.insertOrUpdate != null) { - if (typeof object.insertOrUpdate !== "object") - throw TypeError(".google.spanner.executor.v1.MutationAction.Mod.insertOrUpdate: object expected"); - message.insertOrUpdate = $root.google.spanner.executor.v1.MutationAction.InsertArgs.fromObject(object.insertOrUpdate); - } - if (object.replace != null) { - if (typeof object.replace !== "object") - throw TypeError(".google.spanner.executor.v1.MutationAction.Mod.replace: object expected"); - message.replace = $root.google.spanner.executor.v1.MutationAction.InsertArgs.fromObject(object.replace); - } - if (object.deleteKeys != null) { - if (typeof object.deleteKeys !== "object") - throw TypeError(".google.spanner.executor.v1.MutationAction.Mod.deleteKeys: object expected"); - message.deleteKeys = $root.google.spanner.executor.v1.KeySet.fromObject(object.deleteKeys); - } - return message; - }; - - /** - * Creates a plain object from a Mod message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.executor.v1.MutationAction.Mod - * @static - * @param {google.spanner.executor.v1.MutationAction.Mod} message Mod - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Mod.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.table = ""; - object.insert = null; - object.update = null; - object.insertOrUpdate = null; - object.replace = null; - object.deleteKeys = null; - } - if (message.table != null && message.hasOwnProperty("table")) - object.table = message.table; - if (message.insert != null && message.hasOwnProperty("insert")) - object.insert = $root.google.spanner.executor.v1.MutationAction.InsertArgs.toObject(message.insert, options); - if (message.update != null && message.hasOwnProperty("update")) - object.update = $root.google.spanner.executor.v1.MutationAction.UpdateArgs.toObject(message.update, options); - if (message.insertOrUpdate != null && message.hasOwnProperty("insertOrUpdate")) - object.insertOrUpdate = $root.google.spanner.executor.v1.MutationAction.InsertArgs.toObject(message.insertOrUpdate, options); - if (message.replace != null && message.hasOwnProperty("replace")) - object.replace = $root.google.spanner.executor.v1.MutationAction.InsertArgs.toObject(message.replace, options); - if (message.deleteKeys != null && message.hasOwnProperty("deleteKeys")) - object.deleteKeys = $root.google.spanner.executor.v1.KeySet.toObject(message.deleteKeys, options); - return object; - }; - - /** - * Converts this Mod to JSON. - * @function toJSON - * @memberof google.spanner.executor.v1.MutationAction.Mod - * @instance - * @returns {Object.} JSON object - */ - Mod.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Mod - * @function getTypeUrl - * @memberof google.spanner.executor.v1.MutationAction.Mod - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Mod.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.executor.v1.MutationAction.Mod"; - }; - - return Mod; - })(); - - return MutationAction; - })(); - - v1.WriteMutationsAction = (function() { - - /** - * Properties of a WriteMutationsAction. - * @memberof google.spanner.executor.v1 - * @interface IWriteMutationsAction - * @property {google.spanner.executor.v1.IMutationAction|null} [mutation] WriteMutationsAction mutation - */ - - /** - * Constructs a new WriteMutationsAction. - * @memberof google.spanner.executor.v1 - * @classdesc Represents a WriteMutationsAction. - * @implements IWriteMutationsAction - * @constructor - * @param {google.spanner.executor.v1.IWriteMutationsAction=} [properties] Properties to set - */ - function WriteMutationsAction(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * WriteMutationsAction mutation. - * @member {google.spanner.executor.v1.IMutationAction|null|undefined} mutation - * @memberof google.spanner.executor.v1.WriteMutationsAction - * @instance - */ - WriteMutationsAction.prototype.mutation = null; - - /** - * Creates a new WriteMutationsAction instance using the specified properties. - * @function create - * @memberof google.spanner.executor.v1.WriteMutationsAction - * @static - * @param {google.spanner.executor.v1.IWriteMutationsAction=} [properties] Properties to set - * @returns {google.spanner.executor.v1.WriteMutationsAction} WriteMutationsAction instance - */ - WriteMutationsAction.create = function create(properties) { - return new WriteMutationsAction(properties); - }; - - /** - * Encodes the specified WriteMutationsAction message. Does not implicitly {@link google.spanner.executor.v1.WriteMutationsAction.verify|verify} messages. - * @function encode - * @memberof google.spanner.executor.v1.WriteMutationsAction - * @static - * @param {google.spanner.executor.v1.IWriteMutationsAction} message WriteMutationsAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WriteMutationsAction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.mutation != null && Object.hasOwnProperty.call(message, "mutation")) - $root.google.spanner.executor.v1.MutationAction.encode(message.mutation, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified WriteMutationsAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.WriteMutationsAction.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.executor.v1.WriteMutationsAction - * @static - * @param {google.spanner.executor.v1.IWriteMutationsAction} message WriteMutationsAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WriteMutationsAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a WriteMutationsAction message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.executor.v1.WriteMutationsAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.executor.v1.WriteMutationsAction} WriteMutationsAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WriteMutationsAction.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.WriteMutationsAction(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.mutation = $root.google.spanner.executor.v1.MutationAction.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a WriteMutationsAction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.executor.v1.WriteMutationsAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.executor.v1.WriteMutationsAction} WriteMutationsAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WriteMutationsAction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a WriteMutationsAction message. - * @function verify - * @memberof google.spanner.executor.v1.WriteMutationsAction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - WriteMutationsAction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.mutation != null && message.hasOwnProperty("mutation")) { - var error = $root.google.spanner.executor.v1.MutationAction.verify(message.mutation); - if (error) - return "mutation." + error; - } - return null; - }; - - /** - * Creates a WriteMutationsAction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.executor.v1.WriteMutationsAction - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.executor.v1.WriteMutationsAction} WriteMutationsAction - */ - WriteMutationsAction.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.executor.v1.WriteMutationsAction) - return object; - var message = new $root.google.spanner.executor.v1.WriteMutationsAction(); - if (object.mutation != null) { - if (typeof object.mutation !== "object") - throw TypeError(".google.spanner.executor.v1.WriteMutationsAction.mutation: object expected"); - message.mutation = $root.google.spanner.executor.v1.MutationAction.fromObject(object.mutation); - } - return message; - }; - - /** - * Creates a plain object from a WriteMutationsAction message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.executor.v1.WriteMutationsAction - * @static - * @param {google.spanner.executor.v1.WriteMutationsAction} message WriteMutationsAction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - WriteMutationsAction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.mutation = null; - if (message.mutation != null && message.hasOwnProperty("mutation")) - object.mutation = $root.google.spanner.executor.v1.MutationAction.toObject(message.mutation, options); - return object; - }; - - /** - * Converts this WriteMutationsAction to JSON. - * @function toJSON - * @memberof google.spanner.executor.v1.WriteMutationsAction - * @instance - * @returns {Object.} JSON object - */ - WriteMutationsAction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for WriteMutationsAction - * @function getTypeUrl - * @memberof google.spanner.executor.v1.WriteMutationsAction - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - WriteMutationsAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.executor.v1.WriteMutationsAction"; - }; - - return WriteMutationsAction; - })(); - - v1.PartitionedUpdateAction = (function() { - - /** - * Properties of a PartitionedUpdateAction. - * @memberof google.spanner.executor.v1 - * @interface IPartitionedUpdateAction - * @property {google.spanner.executor.v1.PartitionedUpdateAction.IExecutePartitionedUpdateOptions|null} [options] PartitionedUpdateAction options - * @property {google.spanner.executor.v1.IQueryAction|null} [update] PartitionedUpdateAction update - */ - - /** - * Constructs a new PartitionedUpdateAction. - * @memberof google.spanner.executor.v1 - * @classdesc Represents a PartitionedUpdateAction. - * @implements IPartitionedUpdateAction - * @constructor - * @param {google.spanner.executor.v1.IPartitionedUpdateAction=} [properties] Properties to set - */ - function PartitionedUpdateAction(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PartitionedUpdateAction options. - * @member {google.spanner.executor.v1.PartitionedUpdateAction.IExecutePartitionedUpdateOptions|null|undefined} options - * @memberof google.spanner.executor.v1.PartitionedUpdateAction - * @instance - */ - PartitionedUpdateAction.prototype.options = null; - - /** - * PartitionedUpdateAction update. - * @member {google.spanner.executor.v1.IQueryAction|null|undefined} update - * @memberof google.spanner.executor.v1.PartitionedUpdateAction - * @instance - */ - PartitionedUpdateAction.prototype.update = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(PartitionedUpdateAction.prototype, "_options", { - get: $util.oneOfGetter($oneOfFields = ["options"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new PartitionedUpdateAction instance using the specified properties. - * @function create - * @memberof google.spanner.executor.v1.PartitionedUpdateAction - * @static - * @param {google.spanner.executor.v1.IPartitionedUpdateAction=} [properties] Properties to set - * @returns {google.spanner.executor.v1.PartitionedUpdateAction} PartitionedUpdateAction instance - */ - PartitionedUpdateAction.create = function create(properties) { - return new PartitionedUpdateAction(properties); - }; - - /** - * Encodes the specified PartitionedUpdateAction message. Does not implicitly {@link google.spanner.executor.v1.PartitionedUpdateAction.verify|verify} messages. - * @function encode - * @memberof google.spanner.executor.v1.PartitionedUpdateAction - * @static - * @param {google.spanner.executor.v1.IPartitionedUpdateAction} message PartitionedUpdateAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PartitionedUpdateAction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.spanner.executor.v1.PartitionedUpdateAction.ExecutePartitionedUpdateOptions.encode(message.options, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.update != null && Object.hasOwnProperty.call(message, "update")) - $root.google.spanner.executor.v1.QueryAction.encode(message.update, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified PartitionedUpdateAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.PartitionedUpdateAction.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.executor.v1.PartitionedUpdateAction - * @static - * @param {google.spanner.executor.v1.IPartitionedUpdateAction} message PartitionedUpdateAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PartitionedUpdateAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PartitionedUpdateAction message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.executor.v1.PartitionedUpdateAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.executor.v1.PartitionedUpdateAction} PartitionedUpdateAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PartitionedUpdateAction.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.PartitionedUpdateAction(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.options = $root.google.spanner.executor.v1.PartitionedUpdateAction.ExecutePartitionedUpdateOptions.decode(reader, reader.uint32()); - break; - } - case 2: { - message.update = $root.google.spanner.executor.v1.QueryAction.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PartitionedUpdateAction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.executor.v1.PartitionedUpdateAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.executor.v1.PartitionedUpdateAction} PartitionedUpdateAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PartitionedUpdateAction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PartitionedUpdateAction message. - * @function verify - * @memberof google.spanner.executor.v1.PartitionedUpdateAction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PartitionedUpdateAction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.options != null && message.hasOwnProperty("options")) { - properties._options = 1; - { - var error = $root.google.spanner.executor.v1.PartitionedUpdateAction.ExecutePartitionedUpdateOptions.verify(message.options); - if (error) - return "options." + error; - } - } - if (message.update != null && message.hasOwnProperty("update")) { - var error = $root.google.spanner.executor.v1.QueryAction.verify(message.update); - if (error) - return "update." + error; - } - return null; - }; - - /** - * Creates a PartitionedUpdateAction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.executor.v1.PartitionedUpdateAction - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.executor.v1.PartitionedUpdateAction} PartitionedUpdateAction - */ - PartitionedUpdateAction.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.executor.v1.PartitionedUpdateAction) - return object; - var message = new $root.google.spanner.executor.v1.PartitionedUpdateAction(); - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.spanner.executor.v1.PartitionedUpdateAction.options: object expected"); - message.options = $root.google.spanner.executor.v1.PartitionedUpdateAction.ExecutePartitionedUpdateOptions.fromObject(object.options); - } - if (object.update != null) { - if (typeof object.update !== "object") - throw TypeError(".google.spanner.executor.v1.PartitionedUpdateAction.update: object expected"); - message.update = $root.google.spanner.executor.v1.QueryAction.fromObject(object.update); - } - return message; - }; - - /** - * Creates a plain object from a PartitionedUpdateAction message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.executor.v1.PartitionedUpdateAction - * @static - * @param {google.spanner.executor.v1.PartitionedUpdateAction} message PartitionedUpdateAction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PartitionedUpdateAction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.update = null; - if (message.options != null && message.hasOwnProperty("options")) { - object.options = $root.google.spanner.executor.v1.PartitionedUpdateAction.ExecutePartitionedUpdateOptions.toObject(message.options, options); - if (options.oneofs) - object._options = "options"; - } - if (message.update != null && message.hasOwnProperty("update")) - object.update = $root.google.spanner.executor.v1.QueryAction.toObject(message.update, options); - return object; - }; - - /** - * Converts this PartitionedUpdateAction to JSON. - * @function toJSON - * @memberof google.spanner.executor.v1.PartitionedUpdateAction - * @instance - * @returns {Object.} JSON object - */ - PartitionedUpdateAction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PartitionedUpdateAction - * @function getTypeUrl - * @memberof google.spanner.executor.v1.PartitionedUpdateAction - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PartitionedUpdateAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.executor.v1.PartitionedUpdateAction"; - }; - - PartitionedUpdateAction.ExecutePartitionedUpdateOptions = (function() { - - /** - * Properties of an ExecutePartitionedUpdateOptions. - * @memberof google.spanner.executor.v1.PartitionedUpdateAction - * @interface IExecutePartitionedUpdateOptions - * @property {google.spanner.v1.RequestOptions.Priority|null} [rpcPriority] ExecutePartitionedUpdateOptions rpcPriority - * @property {string|null} [tag] ExecutePartitionedUpdateOptions tag - */ - - /** - * Constructs a new ExecutePartitionedUpdateOptions. - * @memberof google.spanner.executor.v1.PartitionedUpdateAction - * @classdesc Represents an ExecutePartitionedUpdateOptions. - * @implements IExecutePartitionedUpdateOptions - * @constructor - * @param {google.spanner.executor.v1.PartitionedUpdateAction.IExecutePartitionedUpdateOptions=} [properties] Properties to set - */ - function ExecutePartitionedUpdateOptions(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExecutePartitionedUpdateOptions rpcPriority. - * @member {google.spanner.v1.RequestOptions.Priority|null|undefined} rpcPriority - * @memberof google.spanner.executor.v1.PartitionedUpdateAction.ExecutePartitionedUpdateOptions - * @instance - */ - ExecutePartitionedUpdateOptions.prototype.rpcPriority = null; - - /** - * ExecutePartitionedUpdateOptions tag. - * @member {string|null|undefined} tag - * @memberof google.spanner.executor.v1.PartitionedUpdateAction.ExecutePartitionedUpdateOptions - * @instance - */ - ExecutePartitionedUpdateOptions.prototype.tag = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ExecutePartitionedUpdateOptions.prototype, "_rpcPriority", { - get: $util.oneOfGetter($oneOfFields = ["rpcPriority"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ExecutePartitionedUpdateOptions.prototype, "_tag", { - get: $util.oneOfGetter($oneOfFields = ["tag"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new ExecutePartitionedUpdateOptions instance using the specified properties. - * @function create - * @memberof google.spanner.executor.v1.PartitionedUpdateAction.ExecutePartitionedUpdateOptions - * @static - * @param {google.spanner.executor.v1.PartitionedUpdateAction.IExecutePartitionedUpdateOptions=} [properties] Properties to set - * @returns {google.spanner.executor.v1.PartitionedUpdateAction.ExecutePartitionedUpdateOptions} ExecutePartitionedUpdateOptions instance - */ - ExecutePartitionedUpdateOptions.create = function create(properties) { - return new ExecutePartitionedUpdateOptions(properties); - }; - - /** - * Encodes the specified ExecutePartitionedUpdateOptions message. Does not implicitly {@link google.spanner.executor.v1.PartitionedUpdateAction.ExecutePartitionedUpdateOptions.verify|verify} messages. - * @function encode - * @memberof google.spanner.executor.v1.PartitionedUpdateAction.ExecutePartitionedUpdateOptions - * @static - * @param {google.spanner.executor.v1.PartitionedUpdateAction.IExecutePartitionedUpdateOptions} message ExecutePartitionedUpdateOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExecutePartitionedUpdateOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.rpcPriority != null && Object.hasOwnProperty.call(message, "rpcPriority")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.rpcPriority); - if (message.tag != null && Object.hasOwnProperty.call(message, "tag")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.tag); - return writer; - }; - - /** - * Encodes the specified ExecutePartitionedUpdateOptions message, length delimited. Does not implicitly {@link google.spanner.executor.v1.PartitionedUpdateAction.ExecutePartitionedUpdateOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.executor.v1.PartitionedUpdateAction.ExecutePartitionedUpdateOptions - * @static - * @param {google.spanner.executor.v1.PartitionedUpdateAction.IExecutePartitionedUpdateOptions} message ExecutePartitionedUpdateOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExecutePartitionedUpdateOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExecutePartitionedUpdateOptions message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.executor.v1.PartitionedUpdateAction.ExecutePartitionedUpdateOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.executor.v1.PartitionedUpdateAction.ExecutePartitionedUpdateOptions} ExecutePartitionedUpdateOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExecutePartitionedUpdateOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.PartitionedUpdateAction.ExecutePartitionedUpdateOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.rpcPriority = reader.int32(); - break; - } - case 2: { - message.tag = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExecutePartitionedUpdateOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.executor.v1.PartitionedUpdateAction.ExecutePartitionedUpdateOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.executor.v1.PartitionedUpdateAction.ExecutePartitionedUpdateOptions} ExecutePartitionedUpdateOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExecutePartitionedUpdateOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExecutePartitionedUpdateOptions message. - * @function verify - * @memberof google.spanner.executor.v1.PartitionedUpdateAction.ExecutePartitionedUpdateOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExecutePartitionedUpdateOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.rpcPriority != null && message.hasOwnProperty("rpcPriority")) { - properties._rpcPriority = 1; - switch (message.rpcPriority) { - default: - return "rpcPriority: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - } - if (message.tag != null && message.hasOwnProperty("tag")) { - properties._tag = 1; - if (!$util.isString(message.tag)) - return "tag: string expected"; - } - return null; - }; - - /** - * Creates an ExecutePartitionedUpdateOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.executor.v1.PartitionedUpdateAction.ExecutePartitionedUpdateOptions - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.executor.v1.PartitionedUpdateAction.ExecutePartitionedUpdateOptions} ExecutePartitionedUpdateOptions - */ - ExecutePartitionedUpdateOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.executor.v1.PartitionedUpdateAction.ExecutePartitionedUpdateOptions) - return object; - var message = new $root.google.spanner.executor.v1.PartitionedUpdateAction.ExecutePartitionedUpdateOptions(); - switch (object.rpcPriority) { - default: - if (typeof object.rpcPriority === "number") { - message.rpcPriority = object.rpcPriority; - break; - } - break; - case "PRIORITY_UNSPECIFIED": - case 0: - message.rpcPriority = 0; - break; - case "PRIORITY_LOW": - case 1: - message.rpcPriority = 1; - break; - case "PRIORITY_MEDIUM": - case 2: - message.rpcPriority = 2; - break; - case "PRIORITY_HIGH": - case 3: - message.rpcPriority = 3; - break; - } - if (object.tag != null) - message.tag = String(object.tag); - return message; - }; - - /** - * Creates a plain object from an ExecutePartitionedUpdateOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.executor.v1.PartitionedUpdateAction.ExecutePartitionedUpdateOptions - * @static - * @param {google.spanner.executor.v1.PartitionedUpdateAction.ExecutePartitionedUpdateOptions} message ExecutePartitionedUpdateOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExecutePartitionedUpdateOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.rpcPriority != null && message.hasOwnProperty("rpcPriority")) { - object.rpcPriority = options.enums === String ? $root.google.spanner.v1.RequestOptions.Priority[message.rpcPriority] === undefined ? message.rpcPriority : $root.google.spanner.v1.RequestOptions.Priority[message.rpcPriority] : message.rpcPriority; - if (options.oneofs) - object._rpcPriority = "rpcPriority"; - } - if (message.tag != null && message.hasOwnProperty("tag")) { - object.tag = message.tag; - if (options.oneofs) - object._tag = "tag"; - } - return object; - }; - - /** - * Converts this ExecutePartitionedUpdateOptions to JSON. - * @function toJSON - * @memberof google.spanner.executor.v1.PartitionedUpdateAction.ExecutePartitionedUpdateOptions - * @instance - * @returns {Object.} JSON object - */ - ExecutePartitionedUpdateOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExecutePartitionedUpdateOptions - * @function getTypeUrl - * @memberof google.spanner.executor.v1.PartitionedUpdateAction.ExecutePartitionedUpdateOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExecutePartitionedUpdateOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.executor.v1.PartitionedUpdateAction.ExecutePartitionedUpdateOptions"; - }; - - return ExecutePartitionedUpdateOptions; - })(); - - return PartitionedUpdateAction; - })(); - - v1.StartTransactionAction = (function() { - - /** - * Properties of a StartTransactionAction. - * @memberof google.spanner.executor.v1 - * @interface IStartTransactionAction - * @property {google.spanner.executor.v1.IConcurrency|null} [concurrency] StartTransactionAction concurrency - * @property {Array.|null} [table] StartTransactionAction table - * @property {string|null} [transactionSeed] StartTransactionAction transactionSeed - * @property {google.spanner.executor.v1.ITransactionExecutionOptions|null} [executionOptions] StartTransactionAction executionOptions - */ - - /** - * Constructs a new StartTransactionAction. - * @memberof google.spanner.executor.v1 - * @classdesc Represents a StartTransactionAction. - * @implements IStartTransactionAction - * @constructor - * @param {google.spanner.executor.v1.IStartTransactionAction=} [properties] Properties to set - */ - function StartTransactionAction(properties) { - this.table = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * StartTransactionAction concurrency. - * @member {google.spanner.executor.v1.IConcurrency|null|undefined} concurrency - * @memberof google.spanner.executor.v1.StartTransactionAction - * @instance - */ - StartTransactionAction.prototype.concurrency = null; - - /** - * StartTransactionAction table. - * @member {Array.} table - * @memberof google.spanner.executor.v1.StartTransactionAction - * @instance - */ - StartTransactionAction.prototype.table = $util.emptyArray; - - /** - * StartTransactionAction transactionSeed. - * @member {string} transactionSeed - * @memberof google.spanner.executor.v1.StartTransactionAction - * @instance - */ - StartTransactionAction.prototype.transactionSeed = ""; - - /** - * StartTransactionAction executionOptions. - * @member {google.spanner.executor.v1.ITransactionExecutionOptions|null|undefined} executionOptions - * @memberof google.spanner.executor.v1.StartTransactionAction - * @instance - */ - StartTransactionAction.prototype.executionOptions = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(StartTransactionAction.prototype, "_concurrency", { - get: $util.oneOfGetter($oneOfFields = ["concurrency"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(StartTransactionAction.prototype, "_executionOptions", { - get: $util.oneOfGetter($oneOfFields = ["executionOptions"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new StartTransactionAction instance using the specified properties. - * @function create - * @memberof google.spanner.executor.v1.StartTransactionAction - * @static - * @param {google.spanner.executor.v1.IStartTransactionAction=} [properties] Properties to set - * @returns {google.spanner.executor.v1.StartTransactionAction} StartTransactionAction instance - */ - StartTransactionAction.create = function create(properties) { - return new StartTransactionAction(properties); - }; - - /** - * Encodes the specified StartTransactionAction message. Does not implicitly {@link google.spanner.executor.v1.StartTransactionAction.verify|verify} messages. - * @function encode - * @memberof google.spanner.executor.v1.StartTransactionAction - * @static - * @param {google.spanner.executor.v1.IStartTransactionAction} message StartTransactionAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StartTransactionAction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.concurrency != null && Object.hasOwnProperty.call(message, "concurrency")) - $root.google.spanner.executor.v1.Concurrency.encode(message.concurrency, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.table != null && message.table.length) - for (var i = 0; i < message.table.length; ++i) - $root.google.spanner.executor.v1.TableMetadata.encode(message.table[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.transactionSeed != null && Object.hasOwnProperty.call(message, "transactionSeed")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.transactionSeed); - if (message.executionOptions != null && Object.hasOwnProperty.call(message, "executionOptions")) - $root.google.spanner.executor.v1.TransactionExecutionOptions.encode(message.executionOptions, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified StartTransactionAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.StartTransactionAction.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.executor.v1.StartTransactionAction - * @static - * @param {google.spanner.executor.v1.IStartTransactionAction} message StartTransactionAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StartTransactionAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a StartTransactionAction message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.executor.v1.StartTransactionAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.executor.v1.StartTransactionAction} StartTransactionAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StartTransactionAction.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.StartTransactionAction(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.concurrency = $root.google.spanner.executor.v1.Concurrency.decode(reader, reader.uint32()); - break; - } - case 2: { - if (!(message.table && message.table.length)) - message.table = []; - message.table.push($root.google.spanner.executor.v1.TableMetadata.decode(reader, reader.uint32())); - break; - } - case 3: { - message.transactionSeed = reader.string(); - break; - } - case 4: { - message.executionOptions = $root.google.spanner.executor.v1.TransactionExecutionOptions.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a StartTransactionAction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.executor.v1.StartTransactionAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.executor.v1.StartTransactionAction} StartTransactionAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StartTransactionAction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a StartTransactionAction message. - * @function verify - * @memberof google.spanner.executor.v1.StartTransactionAction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - StartTransactionAction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.concurrency != null && message.hasOwnProperty("concurrency")) { - properties._concurrency = 1; - { - var error = $root.google.spanner.executor.v1.Concurrency.verify(message.concurrency); - if (error) - return "concurrency." + error; - } - } - if (message.table != null && message.hasOwnProperty("table")) { - if (!Array.isArray(message.table)) - return "table: array expected"; - for (var i = 0; i < message.table.length; ++i) { - var error = $root.google.spanner.executor.v1.TableMetadata.verify(message.table[i]); - if (error) - return "table." + error; - } - } - if (message.transactionSeed != null && message.hasOwnProperty("transactionSeed")) - if (!$util.isString(message.transactionSeed)) - return "transactionSeed: string expected"; - if (message.executionOptions != null && message.hasOwnProperty("executionOptions")) { - properties._executionOptions = 1; - { - var error = $root.google.spanner.executor.v1.TransactionExecutionOptions.verify(message.executionOptions); - if (error) - return "executionOptions." + error; - } - } - return null; - }; - - /** - * Creates a StartTransactionAction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.executor.v1.StartTransactionAction - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.executor.v1.StartTransactionAction} StartTransactionAction - */ - StartTransactionAction.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.executor.v1.StartTransactionAction) - return object; - var message = new $root.google.spanner.executor.v1.StartTransactionAction(); - if (object.concurrency != null) { - if (typeof object.concurrency !== "object") - throw TypeError(".google.spanner.executor.v1.StartTransactionAction.concurrency: object expected"); - message.concurrency = $root.google.spanner.executor.v1.Concurrency.fromObject(object.concurrency); - } - if (object.table) { - if (!Array.isArray(object.table)) - throw TypeError(".google.spanner.executor.v1.StartTransactionAction.table: array expected"); - message.table = []; - for (var i = 0; i < object.table.length; ++i) { - if (typeof object.table[i] !== "object") - throw TypeError(".google.spanner.executor.v1.StartTransactionAction.table: object expected"); - message.table[i] = $root.google.spanner.executor.v1.TableMetadata.fromObject(object.table[i]); - } - } - if (object.transactionSeed != null) - message.transactionSeed = String(object.transactionSeed); - if (object.executionOptions != null) { - if (typeof object.executionOptions !== "object") - throw TypeError(".google.spanner.executor.v1.StartTransactionAction.executionOptions: object expected"); - message.executionOptions = $root.google.spanner.executor.v1.TransactionExecutionOptions.fromObject(object.executionOptions); - } - return message; - }; - - /** - * Creates a plain object from a StartTransactionAction message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.executor.v1.StartTransactionAction - * @static - * @param {google.spanner.executor.v1.StartTransactionAction} message StartTransactionAction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - StartTransactionAction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.table = []; - if (options.defaults) - object.transactionSeed = ""; - if (message.concurrency != null && message.hasOwnProperty("concurrency")) { - object.concurrency = $root.google.spanner.executor.v1.Concurrency.toObject(message.concurrency, options); - if (options.oneofs) - object._concurrency = "concurrency"; - } - if (message.table && message.table.length) { - object.table = []; - for (var j = 0; j < message.table.length; ++j) - object.table[j] = $root.google.spanner.executor.v1.TableMetadata.toObject(message.table[j], options); - } - if (message.transactionSeed != null && message.hasOwnProperty("transactionSeed")) - object.transactionSeed = message.transactionSeed; - if (message.executionOptions != null && message.hasOwnProperty("executionOptions")) { - object.executionOptions = $root.google.spanner.executor.v1.TransactionExecutionOptions.toObject(message.executionOptions, options); - if (options.oneofs) - object._executionOptions = "executionOptions"; - } - return object; - }; - - /** - * Converts this StartTransactionAction to JSON. - * @function toJSON - * @memberof google.spanner.executor.v1.StartTransactionAction - * @instance - * @returns {Object.} JSON object - */ - StartTransactionAction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for StartTransactionAction - * @function getTypeUrl - * @memberof google.spanner.executor.v1.StartTransactionAction - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - StartTransactionAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.executor.v1.StartTransactionAction"; - }; - - return StartTransactionAction; - })(); - - v1.Concurrency = (function() { - - /** - * Properties of a Concurrency. - * @memberof google.spanner.executor.v1 - * @interface IConcurrency - * @property {number|null} [stalenessSeconds] Concurrency stalenessSeconds - * @property {number|Long|null} [minReadTimestampMicros] Concurrency minReadTimestampMicros - * @property {number|null} [maxStalenessSeconds] Concurrency maxStalenessSeconds - * @property {number|Long|null} [exactTimestampMicros] Concurrency exactTimestampMicros - * @property {boolean|null} [strong] Concurrency strong - * @property {boolean|null} [batch] Concurrency batch - * @property {boolean|null} [snapshotEpochRead] Concurrency snapshotEpochRead - * @property {string|null} [snapshotEpochRootTable] Concurrency snapshotEpochRootTable - * @property {number|Long|null} [batchReadTimestampMicros] Concurrency batchReadTimestampMicros - */ - - /** - * Constructs a new Concurrency. - * @memberof google.spanner.executor.v1 - * @classdesc Represents a Concurrency. - * @implements IConcurrency - * @constructor - * @param {google.spanner.executor.v1.IConcurrency=} [properties] Properties to set - */ - function Concurrency(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Concurrency stalenessSeconds. - * @member {number|null|undefined} stalenessSeconds - * @memberof google.spanner.executor.v1.Concurrency - * @instance - */ - Concurrency.prototype.stalenessSeconds = null; - - /** - * Concurrency minReadTimestampMicros. - * @member {number|Long|null|undefined} minReadTimestampMicros - * @memberof google.spanner.executor.v1.Concurrency - * @instance - */ - Concurrency.prototype.minReadTimestampMicros = null; - - /** - * Concurrency maxStalenessSeconds. - * @member {number|null|undefined} maxStalenessSeconds - * @memberof google.spanner.executor.v1.Concurrency - * @instance - */ - Concurrency.prototype.maxStalenessSeconds = null; - - /** - * Concurrency exactTimestampMicros. - * @member {number|Long|null|undefined} exactTimestampMicros - * @memberof google.spanner.executor.v1.Concurrency - * @instance - */ - Concurrency.prototype.exactTimestampMicros = null; - - /** - * Concurrency strong. - * @member {boolean|null|undefined} strong - * @memberof google.spanner.executor.v1.Concurrency - * @instance - */ - Concurrency.prototype.strong = null; - - /** - * Concurrency batch. - * @member {boolean|null|undefined} batch - * @memberof google.spanner.executor.v1.Concurrency - * @instance - */ - Concurrency.prototype.batch = null; - - /** - * Concurrency snapshotEpochRead. - * @member {boolean} snapshotEpochRead - * @memberof google.spanner.executor.v1.Concurrency - * @instance - */ - Concurrency.prototype.snapshotEpochRead = false; - - /** - * Concurrency snapshotEpochRootTable. - * @member {string} snapshotEpochRootTable - * @memberof google.spanner.executor.v1.Concurrency - * @instance - */ - Concurrency.prototype.snapshotEpochRootTable = ""; - - /** - * Concurrency batchReadTimestampMicros. - * @member {number|Long} batchReadTimestampMicros - * @memberof google.spanner.executor.v1.Concurrency - * @instance - */ - Concurrency.prototype.batchReadTimestampMicros = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Concurrency concurrencyMode. - * @member {"stalenessSeconds"|"minReadTimestampMicros"|"maxStalenessSeconds"|"exactTimestampMicros"|"strong"|"batch"|undefined} concurrencyMode - * @memberof google.spanner.executor.v1.Concurrency - * @instance - */ - Object.defineProperty(Concurrency.prototype, "concurrencyMode", { - get: $util.oneOfGetter($oneOfFields = ["stalenessSeconds", "minReadTimestampMicros", "maxStalenessSeconds", "exactTimestampMicros", "strong", "batch"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Concurrency instance using the specified properties. - * @function create - * @memberof google.spanner.executor.v1.Concurrency - * @static - * @param {google.spanner.executor.v1.IConcurrency=} [properties] Properties to set - * @returns {google.spanner.executor.v1.Concurrency} Concurrency instance - */ - Concurrency.create = function create(properties) { - return new Concurrency(properties); - }; - - /** - * Encodes the specified Concurrency message. Does not implicitly {@link google.spanner.executor.v1.Concurrency.verify|verify} messages. - * @function encode - * @memberof google.spanner.executor.v1.Concurrency - * @static - * @param {google.spanner.executor.v1.IConcurrency} message Concurrency message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Concurrency.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.stalenessSeconds != null && Object.hasOwnProperty.call(message, "stalenessSeconds")) - writer.uint32(/* id 1, wireType 1 =*/9).double(message.stalenessSeconds); - if (message.minReadTimestampMicros != null && Object.hasOwnProperty.call(message, "minReadTimestampMicros")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.minReadTimestampMicros); - if (message.maxStalenessSeconds != null && Object.hasOwnProperty.call(message, "maxStalenessSeconds")) - writer.uint32(/* id 3, wireType 1 =*/25).double(message.maxStalenessSeconds); - if (message.exactTimestampMicros != null && Object.hasOwnProperty.call(message, "exactTimestampMicros")) - writer.uint32(/* id 4, wireType 0 =*/32).int64(message.exactTimestampMicros); - if (message.strong != null && Object.hasOwnProperty.call(message, "strong")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.strong); - if (message.batch != null && Object.hasOwnProperty.call(message, "batch")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.batch); - if (message.snapshotEpochRead != null && Object.hasOwnProperty.call(message, "snapshotEpochRead")) - writer.uint32(/* id 7, wireType 0 =*/56).bool(message.snapshotEpochRead); - if (message.snapshotEpochRootTable != null && Object.hasOwnProperty.call(message, "snapshotEpochRootTable")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.snapshotEpochRootTable); - if (message.batchReadTimestampMicros != null && Object.hasOwnProperty.call(message, "batchReadTimestampMicros")) - writer.uint32(/* id 9, wireType 0 =*/72).int64(message.batchReadTimestampMicros); - return writer; - }; - - /** - * Encodes the specified Concurrency message, length delimited. Does not implicitly {@link google.spanner.executor.v1.Concurrency.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.executor.v1.Concurrency - * @static - * @param {google.spanner.executor.v1.IConcurrency} message Concurrency message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Concurrency.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Concurrency message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.executor.v1.Concurrency - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.executor.v1.Concurrency} Concurrency - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Concurrency.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.Concurrency(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.stalenessSeconds = reader.double(); - break; - } - case 2: { - message.minReadTimestampMicros = reader.int64(); - break; - } - case 3: { - message.maxStalenessSeconds = reader.double(); - break; - } - case 4: { - message.exactTimestampMicros = reader.int64(); - break; - } - case 5: { - message.strong = reader.bool(); - break; - } - case 6: { - message.batch = reader.bool(); - break; - } - case 7: { - message.snapshotEpochRead = reader.bool(); - break; - } - case 8: { - message.snapshotEpochRootTable = reader.string(); - break; - } - case 9: { - message.batchReadTimestampMicros = reader.int64(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Concurrency message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.executor.v1.Concurrency - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.executor.v1.Concurrency} Concurrency - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Concurrency.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Concurrency message. - * @function verify - * @memberof google.spanner.executor.v1.Concurrency - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Concurrency.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.stalenessSeconds != null && message.hasOwnProperty("stalenessSeconds")) { - properties.concurrencyMode = 1; - if (typeof message.stalenessSeconds !== "number") - return "stalenessSeconds: number expected"; - } - if (message.minReadTimestampMicros != null && message.hasOwnProperty("minReadTimestampMicros")) { - if (properties.concurrencyMode === 1) - return "concurrencyMode: multiple values"; - properties.concurrencyMode = 1; - if (!$util.isInteger(message.minReadTimestampMicros) && !(message.minReadTimestampMicros && $util.isInteger(message.minReadTimestampMicros.low) && $util.isInteger(message.minReadTimestampMicros.high))) - return "minReadTimestampMicros: integer|Long expected"; - } - if (message.maxStalenessSeconds != null && message.hasOwnProperty("maxStalenessSeconds")) { - if (properties.concurrencyMode === 1) - return "concurrencyMode: multiple values"; - properties.concurrencyMode = 1; - if (typeof message.maxStalenessSeconds !== "number") - return "maxStalenessSeconds: number expected"; - } - if (message.exactTimestampMicros != null && message.hasOwnProperty("exactTimestampMicros")) { - if (properties.concurrencyMode === 1) - return "concurrencyMode: multiple values"; - properties.concurrencyMode = 1; - if (!$util.isInteger(message.exactTimestampMicros) && !(message.exactTimestampMicros && $util.isInteger(message.exactTimestampMicros.low) && $util.isInteger(message.exactTimestampMicros.high))) - return "exactTimestampMicros: integer|Long expected"; - } - if (message.strong != null && message.hasOwnProperty("strong")) { - if (properties.concurrencyMode === 1) - return "concurrencyMode: multiple values"; - properties.concurrencyMode = 1; - if (typeof message.strong !== "boolean") - return "strong: boolean expected"; - } - if (message.batch != null && message.hasOwnProperty("batch")) { - if (properties.concurrencyMode === 1) - return "concurrencyMode: multiple values"; - properties.concurrencyMode = 1; - if (typeof message.batch !== "boolean") - return "batch: boolean expected"; - } - if (message.snapshotEpochRead != null && message.hasOwnProperty("snapshotEpochRead")) - if (typeof message.snapshotEpochRead !== "boolean") - return "snapshotEpochRead: boolean expected"; - if (message.snapshotEpochRootTable != null && message.hasOwnProperty("snapshotEpochRootTable")) - if (!$util.isString(message.snapshotEpochRootTable)) - return "snapshotEpochRootTable: string expected"; - if (message.batchReadTimestampMicros != null && message.hasOwnProperty("batchReadTimestampMicros")) - if (!$util.isInteger(message.batchReadTimestampMicros) && !(message.batchReadTimestampMicros && $util.isInteger(message.batchReadTimestampMicros.low) && $util.isInteger(message.batchReadTimestampMicros.high))) - return "batchReadTimestampMicros: integer|Long expected"; - return null; - }; - - /** - * Creates a Concurrency message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.executor.v1.Concurrency - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.executor.v1.Concurrency} Concurrency - */ - Concurrency.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.executor.v1.Concurrency) - return object; - var message = new $root.google.spanner.executor.v1.Concurrency(); - if (object.stalenessSeconds != null) - message.stalenessSeconds = Number(object.stalenessSeconds); - if (object.minReadTimestampMicros != null) - if ($util.Long) - (message.minReadTimestampMicros = $util.Long.fromValue(object.minReadTimestampMicros)).unsigned = false; - else if (typeof object.minReadTimestampMicros === "string") - message.minReadTimestampMicros = parseInt(object.minReadTimestampMicros, 10); - else if (typeof object.minReadTimestampMicros === "number") - message.minReadTimestampMicros = object.minReadTimestampMicros; - else if (typeof object.minReadTimestampMicros === "object") - message.minReadTimestampMicros = new $util.LongBits(object.minReadTimestampMicros.low >>> 0, object.minReadTimestampMicros.high >>> 0).toNumber(); - if (object.maxStalenessSeconds != null) - message.maxStalenessSeconds = Number(object.maxStalenessSeconds); - if (object.exactTimestampMicros != null) - if ($util.Long) - (message.exactTimestampMicros = $util.Long.fromValue(object.exactTimestampMicros)).unsigned = false; - else if (typeof object.exactTimestampMicros === "string") - message.exactTimestampMicros = parseInt(object.exactTimestampMicros, 10); - else if (typeof object.exactTimestampMicros === "number") - message.exactTimestampMicros = object.exactTimestampMicros; - else if (typeof object.exactTimestampMicros === "object") - message.exactTimestampMicros = new $util.LongBits(object.exactTimestampMicros.low >>> 0, object.exactTimestampMicros.high >>> 0).toNumber(); - if (object.strong != null) - message.strong = Boolean(object.strong); - if (object.batch != null) - message.batch = Boolean(object.batch); - if (object.snapshotEpochRead != null) - message.snapshotEpochRead = Boolean(object.snapshotEpochRead); - if (object.snapshotEpochRootTable != null) - message.snapshotEpochRootTable = String(object.snapshotEpochRootTable); - if (object.batchReadTimestampMicros != null) - if ($util.Long) - (message.batchReadTimestampMicros = $util.Long.fromValue(object.batchReadTimestampMicros)).unsigned = false; - else if (typeof object.batchReadTimestampMicros === "string") - message.batchReadTimestampMicros = parseInt(object.batchReadTimestampMicros, 10); - else if (typeof object.batchReadTimestampMicros === "number") - message.batchReadTimestampMicros = object.batchReadTimestampMicros; - else if (typeof object.batchReadTimestampMicros === "object") - message.batchReadTimestampMicros = new $util.LongBits(object.batchReadTimestampMicros.low >>> 0, object.batchReadTimestampMicros.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from a Concurrency message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.executor.v1.Concurrency - * @static - * @param {google.spanner.executor.v1.Concurrency} message Concurrency - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Concurrency.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.snapshotEpochRead = false; - object.snapshotEpochRootTable = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.batchReadTimestampMicros = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.batchReadTimestampMicros = options.longs === String ? "0" : 0; - } - if (message.stalenessSeconds != null && message.hasOwnProperty("stalenessSeconds")) { - object.stalenessSeconds = options.json && !isFinite(message.stalenessSeconds) ? String(message.stalenessSeconds) : message.stalenessSeconds; - if (options.oneofs) - object.concurrencyMode = "stalenessSeconds"; - } - if (message.minReadTimestampMicros != null && message.hasOwnProperty("minReadTimestampMicros")) { - if (typeof message.minReadTimestampMicros === "number") - object.minReadTimestampMicros = options.longs === String ? String(message.minReadTimestampMicros) : message.minReadTimestampMicros; - else - object.minReadTimestampMicros = options.longs === String ? $util.Long.prototype.toString.call(message.minReadTimestampMicros) : options.longs === Number ? new $util.LongBits(message.minReadTimestampMicros.low >>> 0, message.minReadTimestampMicros.high >>> 0).toNumber() : message.minReadTimestampMicros; - if (options.oneofs) - object.concurrencyMode = "minReadTimestampMicros"; - } - if (message.maxStalenessSeconds != null && message.hasOwnProperty("maxStalenessSeconds")) { - object.maxStalenessSeconds = options.json && !isFinite(message.maxStalenessSeconds) ? String(message.maxStalenessSeconds) : message.maxStalenessSeconds; - if (options.oneofs) - object.concurrencyMode = "maxStalenessSeconds"; - } - if (message.exactTimestampMicros != null && message.hasOwnProperty("exactTimestampMicros")) { - if (typeof message.exactTimestampMicros === "number") - object.exactTimestampMicros = options.longs === String ? String(message.exactTimestampMicros) : message.exactTimestampMicros; - else - object.exactTimestampMicros = options.longs === String ? $util.Long.prototype.toString.call(message.exactTimestampMicros) : options.longs === Number ? new $util.LongBits(message.exactTimestampMicros.low >>> 0, message.exactTimestampMicros.high >>> 0).toNumber() : message.exactTimestampMicros; - if (options.oneofs) - object.concurrencyMode = "exactTimestampMicros"; - } - if (message.strong != null && message.hasOwnProperty("strong")) { - object.strong = message.strong; - if (options.oneofs) - object.concurrencyMode = "strong"; - } - if (message.batch != null && message.hasOwnProperty("batch")) { - object.batch = message.batch; - if (options.oneofs) - object.concurrencyMode = "batch"; - } - if (message.snapshotEpochRead != null && message.hasOwnProperty("snapshotEpochRead")) - object.snapshotEpochRead = message.snapshotEpochRead; - if (message.snapshotEpochRootTable != null && message.hasOwnProperty("snapshotEpochRootTable")) - object.snapshotEpochRootTable = message.snapshotEpochRootTable; - if (message.batchReadTimestampMicros != null && message.hasOwnProperty("batchReadTimestampMicros")) - if (typeof message.batchReadTimestampMicros === "number") - object.batchReadTimestampMicros = options.longs === String ? String(message.batchReadTimestampMicros) : message.batchReadTimestampMicros; - else - object.batchReadTimestampMicros = options.longs === String ? $util.Long.prototype.toString.call(message.batchReadTimestampMicros) : options.longs === Number ? new $util.LongBits(message.batchReadTimestampMicros.low >>> 0, message.batchReadTimestampMicros.high >>> 0).toNumber() : message.batchReadTimestampMicros; - return object; - }; - - /** - * Converts this Concurrency to JSON. - * @function toJSON - * @memberof google.spanner.executor.v1.Concurrency - * @instance - * @returns {Object.} JSON object - */ - Concurrency.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Concurrency - * @function getTypeUrl - * @memberof google.spanner.executor.v1.Concurrency - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Concurrency.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.executor.v1.Concurrency"; - }; - - return Concurrency; - })(); - - v1.TableMetadata = (function() { - - /** - * Properties of a TableMetadata. - * @memberof google.spanner.executor.v1 - * @interface ITableMetadata - * @property {string|null} [name] TableMetadata name - * @property {Array.|null} [column] TableMetadata column - * @property {Array.|null} [keyColumn] TableMetadata keyColumn - */ - - /** - * Constructs a new TableMetadata. - * @memberof google.spanner.executor.v1 - * @classdesc Represents a TableMetadata. - * @implements ITableMetadata - * @constructor - * @param {google.spanner.executor.v1.ITableMetadata=} [properties] Properties to set - */ - function TableMetadata(properties) { - this.column = []; - this.keyColumn = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TableMetadata name. - * @member {string} name - * @memberof google.spanner.executor.v1.TableMetadata - * @instance - */ - TableMetadata.prototype.name = ""; - - /** - * TableMetadata column. - * @member {Array.} column - * @memberof google.spanner.executor.v1.TableMetadata - * @instance - */ - TableMetadata.prototype.column = $util.emptyArray; - - /** - * TableMetadata keyColumn. - * @member {Array.} keyColumn - * @memberof google.spanner.executor.v1.TableMetadata - * @instance - */ - TableMetadata.prototype.keyColumn = $util.emptyArray; - - /** - * Creates a new TableMetadata instance using the specified properties. - * @function create - * @memberof google.spanner.executor.v1.TableMetadata - * @static - * @param {google.spanner.executor.v1.ITableMetadata=} [properties] Properties to set - * @returns {google.spanner.executor.v1.TableMetadata} TableMetadata instance - */ - TableMetadata.create = function create(properties) { - return new TableMetadata(properties); - }; - - /** - * Encodes the specified TableMetadata message. Does not implicitly {@link google.spanner.executor.v1.TableMetadata.verify|verify} messages. - * @function encode - * @memberof google.spanner.executor.v1.TableMetadata - * @static - * @param {google.spanner.executor.v1.ITableMetadata} message TableMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TableMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.column != null && message.column.length) - for (var i = 0; i < message.column.length; ++i) - $root.google.spanner.executor.v1.ColumnMetadata.encode(message.column[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.keyColumn != null && message.keyColumn.length) - for (var i = 0; i < message.keyColumn.length; ++i) - $root.google.spanner.executor.v1.ColumnMetadata.encode(message.keyColumn[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified TableMetadata message, length delimited. Does not implicitly {@link google.spanner.executor.v1.TableMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.executor.v1.TableMetadata - * @static - * @param {google.spanner.executor.v1.ITableMetadata} message TableMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TableMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TableMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.executor.v1.TableMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.executor.v1.TableMetadata} TableMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TableMetadata.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.TableMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - if (!(message.column && message.column.length)) - message.column = []; - message.column.push($root.google.spanner.executor.v1.ColumnMetadata.decode(reader, reader.uint32())); - break; - } - case 3: { - if (!(message.keyColumn && message.keyColumn.length)) - message.keyColumn = []; - message.keyColumn.push($root.google.spanner.executor.v1.ColumnMetadata.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TableMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.executor.v1.TableMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.executor.v1.TableMetadata} TableMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TableMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TableMetadata message. - * @function verify - * @memberof google.spanner.executor.v1.TableMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TableMetadata.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.column != null && message.hasOwnProperty("column")) { - if (!Array.isArray(message.column)) - return "column: array expected"; - for (var i = 0; i < message.column.length; ++i) { - var error = $root.google.spanner.executor.v1.ColumnMetadata.verify(message.column[i]); - if (error) - return "column." + error; - } - } - if (message.keyColumn != null && message.hasOwnProperty("keyColumn")) { - if (!Array.isArray(message.keyColumn)) - return "keyColumn: array expected"; - for (var i = 0; i < message.keyColumn.length; ++i) { - var error = $root.google.spanner.executor.v1.ColumnMetadata.verify(message.keyColumn[i]); - if (error) - return "keyColumn." + error; - } - } - return null; - }; - - /** - * Creates a TableMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.executor.v1.TableMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.executor.v1.TableMetadata} TableMetadata - */ - TableMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.executor.v1.TableMetadata) - return object; - var message = new $root.google.spanner.executor.v1.TableMetadata(); - if (object.name != null) - message.name = String(object.name); - if (object.column) { - if (!Array.isArray(object.column)) - throw TypeError(".google.spanner.executor.v1.TableMetadata.column: array expected"); - message.column = []; - for (var i = 0; i < object.column.length; ++i) { - if (typeof object.column[i] !== "object") - throw TypeError(".google.spanner.executor.v1.TableMetadata.column: object expected"); - message.column[i] = $root.google.spanner.executor.v1.ColumnMetadata.fromObject(object.column[i]); - } - } - if (object.keyColumn) { - if (!Array.isArray(object.keyColumn)) - throw TypeError(".google.spanner.executor.v1.TableMetadata.keyColumn: array expected"); - message.keyColumn = []; - for (var i = 0; i < object.keyColumn.length; ++i) { - if (typeof object.keyColumn[i] !== "object") - throw TypeError(".google.spanner.executor.v1.TableMetadata.keyColumn: object expected"); - message.keyColumn[i] = $root.google.spanner.executor.v1.ColumnMetadata.fromObject(object.keyColumn[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a TableMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.executor.v1.TableMetadata - * @static - * @param {google.spanner.executor.v1.TableMetadata} message TableMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TableMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.column = []; - object.keyColumn = []; - } - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.column && message.column.length) { - object.column = []; - for (var j = 0; j < message.column.length; ++j) - object.column[j] = $root.google.spanner.executor.v1.ColumnMetadata.toObject(message.column[j], options); - } - if (message.keyColumn && message.keyColumn.length) { - object.keyColumn = []; - for (var j = 0; j < message.keyColumn.length; ++j) - object.keyColumn[j] = $root.google.spanner.executor.v1.ColumnMetadata.toObject(message.keyColumn[j], options); - } - return object; - }; - - /** - * Converts this TableMetadata to JSON. - * @function toJSON - * @memberof google.spanner.executor.v1.TableMetadata - * @instance - * @returns {Object.} JSON object - */ - TableMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TableMetadata - * @function getTypeUrl - * @memberof google.spanner.executor.v1.TableMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TableMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.executor.v1.TableMetadata"; - }; - - return TableMetadata; - })(); - - v1.ColumnMetadata = (function() { - - /** - * Properties of a ColumnMetadata. - * @memberof google.spanner.executor.v1 - * @interface IColumnMetadata - * @property {string|null} [name] ColumnMetadata name - * @property {google.spanner.v1.IType|null} [type] ColumnMetadata type - */ - - /** - * Constructs a new ColumnMetadata. - * @memberof google.spanner.executor.v1 - * @classdesc Represents a ColumnMetadata. - * @implements IColumnMetadata - * @constructor - * @param {google.spanner.executor.v1.IColumnMetadata=} [properties] Properties to set - */ - function ColumnMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ColumnMetadata name. - * @member {string} name - * @memberof google.spanner.executor.v1.ColumnMetadata - * @instance - */ - ColumnMetadata.prototype.name = ""; - - /** - * ColumnMetadata type. - * @member {google.spanner.v1.IType|null|undefined} type - * @memberof google.spanner.executor.v1.ColumnMetadata - * @instance - */ - ColumnMetadata.prototype.type = null; - - /** - * Creates a new ColumnMetadata instance using the specified properties. - * @function create - * @memberof google.spanner.executor.v1.ColumnMetadata - * @static - * @param {google.spanner.executor.v1.IColumnMetadata=} [properties] Properties to set - * @returns {google.spanner.executor.v1.ColumnMetadata} ColumnMetadata instance - */ - ColumnMetadata.create = function create(properties) { - return new ColumnMetadata(properties); - }; - - /** - * Encodes the specified ColumnMetadata message. Does not implicitly {@link google.spanner.executor.v1.ColumnMetadata.verify|verify} messages. - * @function encode - * @memberof google.spanner.executor.v1.ColumnMetadata - * @static - * @param {google.spanner.executor.v1.IColumnMetadata} message ColumnMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ColumnMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - $root.google.spanner.v1.Type.encode(message.type, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ColumnMetadata message, length delimited. Does not implicitly {@link google.spanner.executor.v1.ColumnMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.executor.v1.ColumnMetadata - * @static - * @param {google.spanner.executor.v1.IColumnMetadata} message ColumnMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ColumnMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ColumnMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.executor.v1.ColumnMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.executor.v1.ColumnMetadata} ColumnMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ColumnMetadata.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.ColumnMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.type = $root.google.spanner.v1.Type.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ColumnMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.executor.v1.ColumnMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.executor.v1.ColumnMetadata} ColumnMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ColumnMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ColumnMetadata message. - * @function verify - * @memberof google.spanner.executor.v1.ColumnMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ColumnMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.type != null && message.hasOwnProperty("type")) { - var error = $root.google.spanner.v1.Type.verify(message.type); - if (error) - return "type." + error; - } - return null; - }; - - /** - * Creates a ColumnMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.executor.v1.ColumnMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.executor.v1.ColumnMetadata} ColumnMetadata - */ - ColumnMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.executor.v1.ColumnMetadata) - return object; - var message = new $root.google.spanner.executor.v1.ColumnMetadata(); - if (object.name != null) - message.name = String(object.name); - if (object.type != null) { - if (typeof object.type !== "object") - throw TypeError(".google.spanner.executor.v1.ColumnMetadata.type: object expected"); - message.type = $root.google.spanner.v1.Type.fromObject(object.type); - } - return message; - }; - - /** - * Creates a plain object from a ColumnMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.executor.v1.ColumnMetadata - * @static - * @param {google.spanner.executor.v1.ColumnMetadata} message ColumnMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ColumnMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.type = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.type != null && message.hasOwnProperty("type")) - object.type = $root.google.spanner.v1.Type.toObject(message.type, options); - return object; - }; - - /** - * Converts this ColumnMetadata to JSON. - * @function toJSON - * @memberof google.spanner.executor.v1.ColumnMetadata - * @instance - * @returns {Object.} JSON object - */ - ColumnMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ColumnMetadata - * @function getTypeUrl - * @memberof google.spanner.executor.v1.ColumnMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ColumnMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.executor.v1.ColumnMetadata"; - }; - - return ColumnMetadata; - })(); - - v1.TransactionExecutionOptions = (function() { - - /** - * Properties of a TransactionExecutionOptions. - * @memberof google.spanner.executor.v1 - * @interface ITransactionExecutionOptions - * @property {boolean|null} [optimistic] TransactionExecutionOptions optimistic - */ - - /** - * Constructs a new TransactionExecutionOptions. - * @memberof google.spanner.executor.v1 - * @classdesc Represents a TransactionExecutionOptions. - * @implements ITransactionExecutionOptions - * @constructor - * @param {google.spanner.executor.v1.ITransactionExecutionOptions=} [properties] Properties to set - */ - function TransactionExecutionOptions(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TransactionExecutionOptions optimistic. - * @member {boolean} optimistic - * @memberof google.spanner.executor.v1.TransactionExecutionOptions - * @instance - */ - TransactionExecutionOptions.prototype.optimistic = false; - - /** - * Creates a new TransactionExecutionOptions instance using the specified properties. - * @function create - * @memberof google.spanner.executor.v1.TransactionExecutionOptions - * @static - * @param {google.spanner.executor.v1.ITransactionExecutionOptions=} [properties] Properties to set - * @returns {google.spanner.executor.v1.TransactionExecutionOptions} TransactionExecutionOptions instance - */ - TransactionExecutionOptions.create = function create(properties) { - return new TransactionExecutionOptions(properties); - }; - - /** - * Encodes the specified TransactionExecutionOptions message. Does not implicitly {@link google.spanner.executor.v1.TransactionExecutionOptions.verify|verify} messages. - * @function encode - * @memberof google.spanner.executor.v1.TransactionExecutionOptions - * @static - * @param {google.spanner.executor.v1.ITransactionExecutionOptions} message TransactionExecutionOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TransactionExecutionOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.optimistic != null && Object.hasOwnProperty.call(message, "optimistic")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.optimistic); - return writer; - }; - - /** - * Encodes the specified TransactionExecutionOptions message, length delimited. Does not implicitly {@link google.spanner.executor.v1.TransactionExecutionOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.executor.v1.TransactionExecutionOptions - * @static - * @param {google.spanner.executor.v1.ITransactionExecutionOptions} message TransactionExecutionOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TransactionExecutionOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TransactionExecutionOptions message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.executor.v1.TransactionExecutionOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.executor.v1.TransactionExecutionOptions} TransactionExecutionOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TransactionExecutionOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.TransactionExecutionOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.optimistic = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TransactionExecutionOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.executor.v1.TransactionExecutionOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.executor.v1.TransactionExecutionOptions} TransactionExecutionOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TransactionExecutionOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TransactionExecutionOptions message. - * @function verify - * @memberof google.spanner.executor.v1.TransactionExecutionOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TransactionExecutionOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.optimistic != null && message.hasOwnProperty("optimistic")) - if (typeof message.optimistic !== "boolean") - return "optimistic: boolean expected"; - return null; - }; - - /** - * Creates a TransactionExecutionOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.executor.v1.TransactionExecutionOptions - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.executor.v1.TransactionExecutionOptions} TransactionExecutionOptions - */ - TransactionExecutionOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.executor.v1.TransactionExecutionOptions) - return object; - var message = new $root.google.spanner.executor.v1.TransactionExecutionOptions(); - if (object.optimistic != null) - message.optimistic = Boolean(object.optimistic); - return message; - }; - - /** - * Creates a plain object from a TransactionExecutionOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.executor.v1.TransactionExecutionOptions - * @static - * @param {google.spanner.executor.v1.TransactionExecutionOptions} message TransactionExecutionOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TransactionExecutionOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.optimistic = false; - if (message.optimistic != null && message.hasOwnProperty("optimistic")) - object.optimistic = message.optimistic; - return object; - }; - - /** - * Converts this TransactionExecutionOptions to JSON. - * @function toJSON - * @memberof google.spanner.executor.v1.TransactionExecutionOptions - * @instance - * @returns {Object.} JSON object - */ - TransactionExecutionOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TransactionExecutionOptions - * @function getTypeUrl - * @memberof google.spanner.executor.v1.TransactionExecutionOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TransactionExecutionOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.executor.v1.TransactionExecutionOptions"; - }; - - return TransactionExecutionOptions; - })(); - - v1.FinishTransactionAction = (function() { - - /** - * Properties of a FinishTransactionAction. - * @memberof google.spanner.executor.v1 - * @interface IFinishTransactionAction - * @property {google.spanner.executor.v1.FinishTransactionAction.Mode|null} [mode] FinishTransactionAction mode - */ - - /** - * Constructs a new FinishTransactionAction. - * @memberof google.spanner.executor.v1 - * @classdesc Represents a FinishTransactionAction. - * @implements IFinishTransactionAction - * @constructor - * @param {google.spanner.executor.v1.IFinishTransactionAction=} [properties] Properties to set - */ - function FinishTransactionAction(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FinishTransactionAction mode. - * @member {google.spanner.executor.v1.FinishTransactionAction.Mode} mode - * @memberof google.spanner.executor.v1.FinishTransactionAction - * @instance - */ - FinishTransactionAction.prototype.mode = 0; - - /** - * Creates a new FinishTransactionAction instance using the specified properties. - * @function create - * @memberof google.spanner.executor.v1.FinishTransactionAction - * @static - * @param {google.spanner.executor.v1.IFinishTransactionAction=} [properties] Properties to set - * @returns {google.spanner.executor.v1.FinishTransactionAction} FinishTransactionAction instance - */ - FinishTransactionAction.create = function create(properties) { - return new FinishTransactionAction(properties); - }; - - /** - * Encodes the specified FinishTransactionAction message. Does not implicitly {@link google.spanner.executor.v1.FinishTransactionAction.verify|verify} messages. - * @function encode - * @memberof google.spanner.executor.v1.FinishTransactionAction - * @static - * @param {google.spanner.executor.v1.IFinishTransactionAction} message FinishTransactionAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FinishTransactionAction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.mode != null && Object.hasOwnProperty.call(message, "mode")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.mode); - return writer; - }; - - /** - * Encodes the specified FinishTransactionAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.FinishTransactionAction.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.executor.v1.FinishTransactionAction - * @static - * @param {google.spanner.executor.v1.IFinishTransactionAction} message FinishTransactionAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FinishTransactionAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FinishTransactionAction message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.executor.v1.FinishTransactionAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.executor.v1.FinishTransactionAction} FinishTransactionAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FinishTransactionAction.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.FinishTransactionAction(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.mode = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FinishTransactionAction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.executor.v1.FinishTransactionAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.executor.v1.FinishTransactionAction} FinishTransactionAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FinishTransactionAction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FinishTransactionAction message. - * @function verify - * @memberof google.spanner.executor.v1.FinishTransactionAction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FinishTransactionAction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.mode != null && message.hasOwnProperty("mode")) - switch (message.mode) { - default: - return "mode: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a FinishTransactionAction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.executor.v1.FinishTransactionAction - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.executor.v1.FinishTransactionAction} FinishTransactionAction - */ - FinishTransactionAction.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.executor.v1.FinishTransactionAction) - return object; - var message = new $root.google.spanner.executor.v1.FinishTransactionAction(); - switch (object.mode) { - default: - if (typeof object.mode === "number") { - message.mode = object.mode; - break; - } - break; - case "MODE_UNSPECIFIED": - case 0: - message.mode = 0; - break; - case "COMMIT": - case 1: - message.mode = 1; - break; - case "ABANDON": - case 2: - message.mode = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a FinishTransactionAction message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.executor.v1.FinishTransactionAction - * @static - * @param {google.spanner.executor.v1.FinishTransactionAction} message FinishTransactionAction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FinishTransactionAction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.mode = options.enums === String ? "MODE_UNSPECIFIED" : 0; - if (message.mode != null && message.hasOwnProperty("mode")) - object.mode = options.enums === String ? $root.google.spanner.executor.v1.FinishTransactionAction.Mode[message.mode] === undefined ? message.mode : $root.google.spanner.executor.v1.FinishTransactionAction.Mode[message.mode] : message.mode; - return object; - }; - - /** - * Converts this FinishTransactionAction to JSON. - * @function toJSON - * @memberof google.spanner.executor.v1.FinishTransactionAction - * @instance - * @returns {Object.} JSON object - */ - FinishTransactionAction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FinishTransactionAction - * @function getTypeUrl - * @memberof google.spanner.executor.v1.FinishTransactionAction - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FinishTransactionAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.executor.v1.FinishTransactionAction"; - }; - - /** - * Mode enum. - * @name google.spanner.executor.v1.FinishTransactionAction.Mode - * @enum {number} - * @property {number} MODE_UNSPECIFIED=0 MODE_UNSPECIFIED value - * @property {number} COMMIT=1 COMMIT value - * @property {number} ABANDON=2 ABANDON value - */ - FinishTransactionAction.Mode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "MODE_UNSPECIFIED"] = 0; - values[valuesById[1] = "COMMIT"] = 1; - values[valuesById[2] = "ABANDON"] = 2; - return values; - })(); - - return FinishTransactionAction; - })(); - - v1.AdminAction = (function() { - - /** - * Properties of an AdminAction. - * @memberof google.spanner.executor.v1 - * @interface IAdminAction - * @property {google.spanner.executor.v1.ICreateUserInstanceConfigAction|null} [createUserInstanceConfig] AdminAction createUserInstanceConfig - * @property {google.spanner.executor.v1.IUpdateUserInstanceConfigAction|null} [updateUserInstanceConfig] AdminAction updateUserInstanceConfig - * @property {google.spanner.executor.v1.IDeleteUserInstanceConfigAction|null} [deleteUserInstanceConfig] AdminAction deleteUserInstanceConfig - * @property {google.spanner.executor.v1.IGetCloudInstanceConfigAction|null} [getCloudInstanceConfig] AdminAction getCloudInstanceConfig - * @property {google.spanner.executor.v1.IListCloudInstanceConfigsAction|null} [listInstanceConfigs] AdminAction listInstanceConfigs - * @property {google.spanner.executor.v1.ICreateCloudInstanceAction|null} [createCloudInstance] AdminAction createCloudInstance - * @property {google.spanner.executor.v1.IUpdateCloudInstanceAction|null} [updateCloudInstance] AdminAction updateCloudInstance - * @property {google.spanner.executor.v1.IDeleteCloudInstanceAction|null} [deleteCloudInstance] AdminAction deleteCloudInstance - * @property {google.spanner.executor.v1.IListCloudInstancesAction|null} [listCloudInstances] AdminAction listCloudInstances - * @property {google.spanner.executor.v1.IGetCloudInstanceAction|null} [getCloudInstance] AdminAction getCloudInstance - * @property {google.spanner.executor.v1.ICreateCloudDatabaseAction|null} [createCloudDatabase] AdminAction createCloudDatabase - * @property {google.spanner.executor.v1.IUpdateCloudDatabaseDdlAction|null} [updateCloudDatabaseDdl] AdminAction updateCloudDatabaseDdl - * @property {google.spanner.executor.v1.IUpdateCloudDatabaseAction|null} [updateCloudDatabase] AdminAction updateCloudDatabase - * @property {google.spanner.executor.v1.IDropCloudDatabaseAction|null} [dropCloudDatabase] AdminAction dropCloudDatabase - * @property {google.spanner.executor.v1.IListCloudDatabasesAction|null} [listCloudDatabases] AdminAction listCloudDatabases - * @property {google.spanner.executor.v1.IListCloudDatabaseOperationsAction|null} [listCloudDatabaseOperations] AdminAction listCloudDatabaseOperations - * @property {google.spanner.executor.v1.IRestoreCloudDatabaseAction|null} [restoreCloudDatabase] AdminAction restoreCloudDatabase - * @property {google.spanner.executor.v1.IGetCloudDatabaseAction|null} [getCloudDatabase] AdminAction getCloudDatabase - * @property {google.spanner.executor.v1.ICreateCloudBackupAction|null} [createCloudBackup] AdminAction createCloudBackup - * @property {google.spanner.executor.v1.ICopyCloudBackupAction|null} [copyCloudBackup] AdminAction copyCloudBackup - * @property {google.spanner.executor.v1.IGetCloudBackupAction|null} [getCloudBackup] AdminAction getCloudBackup - * @property {google.spanner.executor.v1.IUpdateCloudBackupAction|null} [updateCloudBackup] AdminAction updateCloudBackup - * @property {google.spanner.executor.v1.IDeleteCloudBackupAction|null} [deleteCloudBackup] AdminAction deleteCloudBackup - * @property {google.spanner.executor.v1.IListCloudBackupsAction|null} [listCloudBackups] AdminAction listCloudBackups - * @property {google.spanner.executor.v1.IListCloudBackupOperationsAction|null} [listCloudBackupOperations] AdminAction listCloudBackupOperations - * @property {google.spanner.executor.v1.IGetOperationAction|null} [getOperation] AdminAction getOperation - * @property {google.spanner.executor.v1.ICancelOperationAction|null} [cancelOperation] AdminAction cancelOperation - * @property {google.spanner.executor.v1.IChangeQuorumCloudDatabaseAction|null} [changeQuorumCloudDatabase] AdminAction changeQuorumCloudDatabase - */ - - /** - * Constructs a new AdminAction. - * @memberof google.spanner.executor.v1 - * @classdesc Represents an AdminAction. - * @implements IAdminAction - * @constructor - * @param {google.spanner.executor.v1.IAdminAction=} [properties] Properties to set - */ - function AdminAction(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AdminAction createUserInstanceConfig. - * @member {google.spanner.executor.v1.ICreateUserInstanceConfigAction|null|undefined} createUserInstanceConfig - * @memberof google.spanner.executor.v1.AdminAction - * @instance - */ - AdminAction.prototype.createUserInstanceConfig = null; - - /** - * AdminAction updateUserInstanceConfig. - * @member {google.spanner.executor.v1.IUpdateUserInstanceConfigAction|null|undefined} updateUserInstanceConfig - * @memberof google.spanner.executor.v1.AdminAction - * @instance - */ - AdminAction.prototype.updateUserInstanceConfig = null; - - /** - * AdminAction deleteUserInstanceConfig. - * @member {google.spanner.executor.v1.IDeleteUserInstanceConfigAction|null|undefined} deleteUserInstanceConfig - * @memberof google.spanner.executor.v1.AdminAction - * @instance - */ - AdminAction.prototype.deleteUserInstanceConfig = null; - - /** - * AdminAction getCloudInstanceConfig. - * @member {google.spanner.executor.v1.IGetCloudInstanceConfigAction|null|undefined} getCloudInstanceConfig - * @memberof google.spanner.executor.v1.AdminAction - * @instance - */ - AdminAction.prototype.getCloudInstanceConfig = null; - - /** - * AdminAction listInstanceConfigs. - * @member {google.spanner.executor.v1.IListCloudInstanceConfigsAction|null|undefined} listInstanceConfigs - * @memberof google.spanner.executor.v1.AdminAction - * @instance - */ - AdminAction.prototype.listInstanceConfigs = null; - - /** - * AdminAction createCloudInstance. - * @member {google.spanner.executor.v1.ICreateCloudInstanceAction|null|undefined} createCloudInstance - * @memberof google.spanner.executor.v1.AdminAction - * @instance - */ - AdminAction.prototype.createCloudInstance = null; - - /** - * AdminAction updateCloudInstance. - * @member {google.spanner.executor.v1.IUpdateCloudInstanceAction|null|undefined} updateCloudInstance - * @memberof google.spanner.executor.v1.AdminAction - * @instance - */ - AdminAction.prototype.updateCloudInstance = null; - - /** - * AdminAction deleteCloudInstance. - * @member {google.spanner.executor.v1.IDeleteCloudInstanceAction|null|undefined} deleteCloudInstance - * @memberof google.spanner.executor.v1.AdminAction - * @instance - */ - AdminAction.prototype.deleteCloudInstance = null; - - /** - * AdminAction listCloudInstances. - * @member {google.spanner.executor.v1.IListCloudInstancesAction|null|undefined} listCloudInstances - * @memberof google.spanner.executor.v1.AdminAction - * @instance - */ - AdminAction.prototype.listCloudInstances = null; - - /** - * AdminAction getCloudInstance. - * @member {google.spanner.executor.v1.IGetCloudInstanceAction|null|undefined} getCloudInstance - * @memberof google.spanner.executor.v1.AdminAction - * @instance - */ - AdminAction.prototype.getCloudInstance = null; - - /** - * AdminAction createCloudDatabase. - * @member {google.spanner.executor.v1.ICreateCloudDatabaseAction|null|undefined} createCloudDatabase - * @memberof google.spanner.executor.v1.AdminAction - * @instance - */ - AdminAction.prototype.createCloudDatabase = null; - - /** - * AdminAction updateCloudDatabaseDdl. - * @member {google.spanner.executor.v1.IUpdateCloudDatabaseDdlAction|null|undefined} updateCloudDatabaseDdl - * @memberof google.spanner.executor.v1.AdminAction - * @instance - */ - AdminAction.prototype.updateCloudDatabaseDdl = null; - - /** - * AdminAction updateCloudDatabase. - * @member {google.spanner.executor.v1.IUpdateCloudDatabaseAction|null|undefined} updateCloudDatabase - * @memberof google.spanner.executor.v1.AdminAction - * @instance - */ - AdminAction.prototype.updateCloudDatabase = null; - - /** - * AdminAction dropCloudDatabase. - * @member {google.spanner.executor.v1.IDropCloudDatabaseAction|null|undefined} dropCloudDatabase - * @memberof google.spanner.executor.v1.AdminAction - * @instance - */ - AdminAction.prototype.dropCloudDatabase = null; - - /** - * AdminAction listCloudDatabases. - * @member {google.spanner.executor.v1.IListCloudDatabasesAction|null|undefined} listCloudDatabases - * @memberof google.spanner.executor.v1.AdminAction - * @instance - */ - AdminAction.prototype.listCloudDatabases = null; - - /** - * AdminAction listCloudDatabaseOperations. - * @member {google.spanner.executor.v1.IListCloudDatabaseOperationsAction|null|undefined} listCloudDatabaseOperations - * @memberof google.spanner.executor.v1.AdminAction - * @instance - */ - AdminAction.prototype.listCloudDatabaseOperations = null; - - /** - * AdminAction restoreCloudDatabase. - * @member {google.spanner.executor.v1.IRestoreCloudDatabaseAction|null|undefined} restoreCloudDatabase - * @memberof google.spanner.executor.v1.AdminAction - * @instance - */ - AdminAction.prototype.restoreCloudDatabase = null; - - /** - * AdminAction getCloudDatabase. - * @member {google.spanner.executor.v1.IGetCloudDatabaseAction|null|undefined} getCloudDatabase - * @memberof google.spanner.executor.v1.AdminAction - * @instance - */ - AdminAction.prototype.getCloudDatabase = null; - - /** - * AdminAction createCloudBackup. - * @member {google.spanner.executor.v1.ICreateCloudBackupAction|null|undefined} createCloudBackup - * @memberof google.spanner.executor.v1.AdminAction - * @instance - */ - AdminAction.prototype.createCloudBackup = null; - - /** - * AdminAction copyCloudBackup. - * @member {google.spanner.executor.v1.ICopyCloudBackupAction|null|undefined} copyCloudBackup - * @memberof google.spanner.executor.v1.AdminAction - * @instance - */ - AdminAction.prototype.copyCloudBackup = null; - - /** - * AdminAction getCloudBackup. - * @member {google.spanner.executor.v1.IGetCloudBackupAction|null|undefined} getCloudBackup - * @memberof google.spanner.executor.v1.AdminAction - * @instance - */ - AdminAction.prototype.getCloudBackup = null; - - /** - * AdminAction updateCloudBackup. - * @member {google.spanner.executor.v1.IUpdateCloudBackupAction|null|undefined} updateCloudBackup - * @memberof google.spanner.executor.v1.AdminAction - * @instance - */ - AdminAction.prototype.updateCloudBackup = null; - - /** - * AdminAction deleteCloudBackup. - * @member {google.spanner.executor.v1.IDeleteCloudBackupAction|null|undefined} deleteCloudBackup - * @memberof google.spanner.executor.v1.AdminAction - * @instance - */ - AdminAction.prototype.deleteCloudBackup = null; - - /** - * AdminAction listCloudBackups. - * @member {google.spanner.executor.v1.IListCloudBackupsAction|null|undefined} listCloudBackups - * @memberof google.spanner.executor.v1.AdminAction - * @instance - */ - AdminAction.prototype.listCloudBackups = null; - - /** - * AdminAction listCloudBackupOperations. - * @member {google.spanner.executor.v1.IListCloudBackupOperationsAction|null|undefined} listCloudBackupOperations - * @memberof google.spanner.executor.v1.AdminAction - * @instance - */ - AdminAction.prototype.listCloudBackupOperations = null; - - /** - * AdminAction getOperation. - * @member {google.spanner.executor.v1.IGetOperationAction|null|undefined} getOperation - * @memberof google.spanner.executor.v1.AdminAction - * @instance - */ - AdminAction.prototype.getOperation = null; - - /** - * AdminAction cancelOperation. - * @member {google.spanner.executor.v1.ICancelOperationAction|null|undefined} cancelOperation - * @memberof google.spanner.executor.v1.AdminAction - * @instance - */ - AdminAction.prototype.cancelOperation = null; - - /** - * AdminAction changeQuorumCloudDatabase. - * @member {google.spanner.executor.v1.IChangeQuorumCloudDatabaseAction|null|undefined} changeQuorumCloudDatabase - * @memberof google.spanner.executor.v1.AdminAction - * @instance - */ - AdminAction.prototype.changeQuorumCloudDatabase = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * AdminAction action. - * @member {"createUserInstanceConfig"|"updateUserInstanceConfig"|"deleteUserInstanceConfig"|"getCloudInstanceConfig"|"listInstanceConfigs"|"createCloudInstance"|"updateCloudInstance"|"deleteCloudInstance"|"listCloudInstances"|"getCloudInstance"|"createCloudDatabase"|"updateCloudDatabaseDdl"|"updateCloudDatabase"|"dropCloudDatabase"|"listCloudDatabases"|"listCloudDatabaseOperations"|"restoreCloudDatabase"|"getCloudDatabase"|"createCloudBackup"|"copyCloudBackup"|"getCloudBackup"|"updateCloudBackup"|"deleteCloudBackup"|"listCloudBackups"|"listCloudBackupOperations"|"getOperation"|"cancelOperation"|"changeQuorumCloudDatabase"|undefined} action - * @memberof google.spanner.executor.v1.AdminAction - * @instance - */ - Object.defineProperty(AdminAction.prototype, "action", { - get: $util.oneOfGetter($oneOfFields = ["createUserInstanceConfig", "updateUserInstanceConfig", "deleteUserInstanceConfig", "getCloudInstanceConfig", "listInstanceConfigs", "createCloudInstance", "updateCloudInstance", "deleteCloudInstance", "listCloudInstances", "getCloudInstance", "createCloudDatabase", "updateCloudDatabaseDdl", "updateCloudDatabase", "dropCloudDatabase", "listCloudDatabases", "listCloudDatabaseOperations", "restoreCloudDatabase", "getCloudDatabase", "createCloudBackup", "copyCloudBackup", "getCloudBackup", "updateCloudBackup", "deleteCloudBackup", "listCloudBackups", "listCloudBackupOperations", "getOperation", "cancelOperation", "changeQuorumCloudDatabase"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new AdminAction instance using the specified properties. - * @function create - * @memberof google.spanner.executor.v1.AdminAction - * @static - * @param {google.spanner.executor.v1.IAdminAction=} [properties] Properties to set - * @returns {google.spanner.executor.v1.AdminAction} AdminAction instance - */ - AdminAction.create = function create(properties) { - return new AdminAction(properties); - }; - - /** - * Encodes the specified AdminAction message. Does not implicitly {@link google.spanner.executor.v1.AdminAction.verify|verify} messages. - * @function encode - * @memberof google.spanner.executor.v1.AdminAction - * @static - * @param {google.spanner.executor.v1.IAdminAction} message AdminAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AdminAction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.createUserInstanceConfig != null && Object.hasOwnProperty.call(message, "createUserInstanceConfig")) - $root.google.spanner.executor.v1.CreateUserInstanceConfigAction.encode(message.createUserInstanceConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateUserInstanceConfig != null && Object.hasOwnProperty.call(message, "updateUserInstanceConfig")) - $root.google.spanner.executor.v1.UpdateUserInstanceConfigAction.encode(message.updateUserInstanceConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.deleteUserInstanceConfig != null && Object.hasOwnProperty.call(message, "deleteUserInstanceConfig")) - $root.google.spanner.executor.v1.DeleteUserInstanceConfigAction.encode(message.deleteUserInstanceConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.getCloudInstanceConfig != null && Object.hasOwnProperty.call(message, "getCloudInstanceConfig")) - $root.google.spanner.executor.v1.GetCloudInstanceConfigAction.encode(message.getCloudInstanceConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.listInstanceConfigs != null && Object.hasOwnProperty.call(message, "listInstanceConfigs")) - $root.google.spanner.executor.v1.ListCloudInstanceConfigsAction.encode(message.listInstanceConfigs, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.createCloudInstance != null && Object.hasOwnProperty.call(message, "createCloudInstance")) - $root.google.spanner.executor.v1.CreateCloudInstanceAction.encode(message.createCloudInstance, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.updateCloudInstance != null && Object.hasOwnProperty.call(message, "updateCloudInstance")) - $root.google.spanner.executor.v1.UpdateCloudInstanceAction.encode(message.updateCloudInstance, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.deleteCloudInstance != null && Object.hasOwnProperty.call(message, "deleteCloudInstance")) - $root.google.spanner.executor.v1.DeleteCloudInstanceAction.encode(message.deleteCloudInstance, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.listCloudInstances != null && Object.hasOwnProperty.call(message, "listCloudInstances")) - $root.google.spanner.executor.v1.ListCloudInstancesAction.encode(message.listCloudInstances, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.getCloudInstance != null && Object.hasOwnProperty.call(message, "getCloudInstance")) - $root.google.spanner.executor.v1.GetCloudInstanceAction.encode(message.getCloudInstance, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.createCloudDatabase != null && Object.hasOwnProperty.call(message, "createCloudDatabase")) - $root.google.spanner.executor.v1.CreateCloudDatabaseAction.encode(message.createCloudDatabase, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.updateCloudDatabaseDdl != null && Object.hasOwnProperty.call(message, "updateCloudDatabaseDdl")) - $root.google.spanner.executor.v1.UpdateCloudDatabaseDdlAction.encode(message.updateCloudDatabaseDdl, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - if (message.dropCloudDatabase != null && Object.hasOwnProperty.call(message, "dropCloudDatabase")) - $root.google.spanner.executor.v1.DropCloudDatabaseAction.encode(message.dropCloudDatabase, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); - if (message.listCloudDatabases != null && Object.hasOwnProperty.call(message, "listCloudDatabases")) - $root.google.spanner.executor.v1.ListCloudDatabasesAction.encode(message.listCloudDatabases, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); - if (message.listCloudDatabaseOperations != null && Object.hasOwnProperty.call(message, "listCloudDatabaseOperations")) - $root.google.spanner.executor.v1.ListCloudDatabaseOperationsAction.encode(message.listCloudDatabaseOperations, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); - if (message.restoreCloudDatabase != null && Object.hasOwnProperty.call(message, "restoreCloudDatabase")) - $root.google.spanner.executor.v1.RestoreCloudDatabaseAction.encode(message.restoreCloudDatabase, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); - if (message.getCloudDatabase != null && Object.hasOwnProperty.call(message, "getCloudDatabase")) - $root.google.spanner.executor.v1.GetCloudDatabaseAction.encode(message.getCloudDatabase, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); - if (message.createCloudBackup != null && Object.hasOwnProperty.call(message, "createCloudBackup")) - $root.google.spanner.executor.v1.CreateCloudBackupAction.encode(message.createCloudBackup, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); - if (message.copyCloudBackup != null && Object.hasOwnProperty.call(message, "copyCloudBackup")) - $root.google.spanner.executor.v1.CopyCloudBackupAction.encode(message.copyCloudBackup, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); - if (message.getCloudBackup != null && Object.hasOwnProperty.call(message, "getCloudBackup")) - $root.google.spanner.executor.v1.GetCloudBackupAction.encode(message.getCloudBackup, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); - if (message.updateCloudBackup != null && Object.hasOwnProperty.call(message, "updateCloudBackup")) - $root.google.spanner.executor.v1.UpdateCloudBackupAction.encode(message.updateCloudBackup, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); - if (message.deleteCloudBackup != null && Object.hasOwnProperty.call(message, "deleteCloudBackup")) - $root.google.spanner.executor.v1.DeleteCloudBackupAction.encode(message.deleteCloudBackup, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); - if (message.listCloudBackups != null && Object.hasOwnProperty.call(message, "listCloudBackups")) - $root.google.spanner.executor.v1.ListCloudBackupsAction.encode(message.listCloudBackups, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); - if (message.listCloudBackupOperations != null && Object.hasOwnProperty.call(message, "listCloudBackupOperations")) - $root.google.spanner.executor.v1.ListCloudBackupOperationsAction.encode(message.listCloudBackupOperations, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); - if (message.getOperation != null && Object.hasOwnProperty.call(message, "getOperation")) - $root.google.spanner.executor.v1.GetOperationAction.encode(message.getOperation, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); - if (message.cancelOperation != null && Object.hasOwnProperty.call(message, "cancelOperation")) - $root.google.spanner.executor.v1.CancelOperationAction.encode(message.cancelOperation, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); - if (message.updateCloudDatabase != null && Object.hasOwnProperty.call(message, "updateCloudDatabase")) - $root.google.spanner.executor.v1.UpdateCloudDatabaseAction.encode(message.updateCloudDatabase, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); - if (message.changeQuorumCloudDatabase != null && Object.hasOwnProperty.call(message, "changeQuorumCloudDatabase")) - $root.google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction.encode(message.changeQuorumCloudDatabase, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified AdminAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.AdminAction.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.executor.v1.AdminAction - * @static - * @param {google.spanner.executor.v1.IAdminAction} message AdminAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AdminAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AdminAction message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.executor.v1.AdminAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.executor.v1.AdminAction} AdminAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AdminAction.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.AdminAction(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.createUserInstanceConfig = $root.google.spanner.executor.v1.CreateUserInstanceConfigAction.decode(reader, reader.uint32()); - break; - } - case 2: { - message.updateUserInstanceConfig = $root.google.spanner.executor.v1.UpdateUserInstanceConfigAction.decode(reader, reader.uint32()); - break; - } - case 3: { - message.deleteUserInstanceConfig = $root.google.spanner.executor.v1.DeleteUserInstanceConfigAction.decode(reader, reader.uint32()); - break; - } - case 4: { - message.getCloudInstanceConfig = $root.google.spanner.executor.v1.GetCloudInstanceConfigAction.decode(reader, reader.uint32()); - break; - } - case 5: { - message.listInstanceConfigs = $root.google.spanner.executor.v1.ListCloudInstanceConfigsAction.decode(reader, reader.uint32()); - break; - } - case 6: { - message.createCloudInstance = $root.google.spanner.executor.v1.CreateCloudInstanceAction.decode(reader, reader.uint32()); - break; - } - case 7: { - message.updateCloudInstance = $root.google.spanner.executor.v1.UpdateCloudInstanceAction.decode(reader, reader.uint32()); - break; - } - case 8: { - message.deleteCloudInstance = $root.google.spanner.executor.v1.DeleteCloudInstanceAction.decode(reader, reader.uint32()); - break; - } - case 9: { - message.listCloudInstances = $root.google.spanner.executor.v1.ListCloudInstancesAction.decode(reader, reader.uint32()); - break; - } - case 10: { - message.getCloudInstance = $root.google.spanner.executor.v1.GetCloudInstanceAction.decode(reader, reader.uint32()); - break; - } - case 11: { - message.createCloudDatabase = $root.google.spanner.executor.v1.CreateCloudDatabaseAction.decode(reader, reader.uint32()); - break; - } - case 12: { - message.updateCloudDatabaseDdl = $root.google.spanner.executor.v1.UpdateCloudDatabaseDdlAction.decode(reader, reader.uint32()); - break; - } - case 27: { - message.updateCloudDatabase = $root.google.spanner.executor.v1.UpdateCloudDatabaseAction.decode(reader, reader.uint32()); - break; - } - case 13: { - message.dropCloudDatabase = $root.google.spanner.executor.v1.DropCloudDatabaseAction.decode(reader, reader.uint32()); - break; - } - case 14: { - message.listCloudDatabases = $root.google.spanner.executor.v1.ListCloudDatabasesAction.decode(reader, reader.uint32()); - break; - } - case 15: { - message.listCloudDatabaseOperations = $root.google.spanner.executor.v1.ListCloudDatabaseOperationsAction.decode(reader, reader.uint32()); - break; - } - case 16: { - message.restoreCloudDatabase = $root.google.spanner.executor.v1.RestoreCloudDatabaseAction.decode(reader, reader.uint32()); - break; - } - case 17: { - message.getCloudDatabase = $root.google.spanner.executor.v1.GetCloudDatabaseAction.decode(reader, reader.uint32()); - break; - } - case 18: { - message.createCloudBackup = $root.google.spanner.executor.v1.CreateCloudBackupAction.decode(reader, reader.uint32()); - break; - } - case 19: { - message.copyCloudBackup = $root.google.spanner.executor.v1.CopyCloudBackupAction.decode(reader, reader.uint32()); - break; - } - case 20: { - message.getCloudBackup = $root.google.spanner.executor.v1.GetCloudBackupAction.decode(reader, reader.uint32()); - break; - } - case 21: { - message.updateCloudBackup = $root.google.spanner.executor.v1.UpdateCloudBackupAction.decode(reader, reader.uint32()); - break; - } - case 22: { - message.deleteCloudBackup = $root.google.spanner.executor.v1.DeleteCloudBackupAction.decode(reader, reader.uint32()); - break; - } - case 23: { - message.listCloudBackups = $root.google.spanner.executor.v1.ListCloudBackupsAction.decode(reader, reader.uint32()); - break; - } - case 24: { - message.listCloudBackupOperations = $root.google.spanner.executor.v1.ListCloudBackupOperationsAction.decode(reader, reader.uint32()); - break; - } - case 25: { - message.getOperation = $root.google.spanner.executor.v1.GetOperationAction.decode(reader, reader.uint32()); - break; - } - case 26: { - message.cancelOperation = $root.google.spanner.executor.v1.CancelOperationAction.decode(reader, reader.uint32()); - break; - } - case 28: { - message.changeQuorumCloudDatabase = $root.google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AdminAction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.executor.v1.AdminAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.executor.v1.AdminAction} AdminAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AdminAction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AdminAction message. - * @function verify - * @memberof google.spanner.executor.v1.AdminAction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AdminAction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.createUserInstanceConfig != null && message.hasOwnProperty("createUserInstanceConfig")) { - properties.action = 1; - { - var error = $root.google.spanner.executor.v1.CreateUserInstanceConfigAction.verify(message.createUserInstanceConfig); - if (error) - return "createUserInstanceConfig." + error; - } - } - if (message.updateUserInstanceConfig != null && message.hasOwnProperty("updateUserInstanceConfig")) { - if (properties.action === 1) - return "action: multiple values"; - properties.action = 1; - { - var error = $root.google.spanner.executor.v1.UpdateUserInstanceConfigAction.verify(message.updateUserInstanceConfig); - if (error) - return "updateUserInstanceConfig." + error; - } - } - if (message.deleteUserInstanceConfig != null && message.hasOwnProperty("deleteUserInstanceConfig")) { - if (properties.action === 1) - return "action: multiple values"; - properties.action = 1; - { - var error = $root.google.spanner.executor.v1.DeleteUserInstanceConfigAction.verify(message.deleteUserInstanceConfig); - if (error) - return "deleteUserInstanceConfig." + error; - } - } - if (message.getCloudInstanceConfig != null && message.hasOwnProperty("getCloudInstanceConfig")) { - if (properties.action === 1) - return "action: multiple values"; - properties.action = 1; - { - var error = $root.google.spanner.executor.v1.GetCloudInstanceConfigAction.verify(message.getCloudInstanceConfig); - if (error) - return "getCloudInstanceConfig." + error; - } - } - if (message.listInstanceConfigs != null && message.hasOwnProperty("listInstanceConfigs")) { - if (properties.action === 1) - return "action: multiple values"; - properties.action = 1; - { - var error = $root.google.spanner.executor.v1.ListCloudInstanceConfigsAction.verify(message.listInstanceConfigs); - if (error) - return "listInstanceConfigs." + error; - } - } - if (message.createCloudInstance != null && message.hasOwnProperty("createCloudInstance")) { - if (properties.action === 1) - return "action: multiple values"; - properties.action = 1; - { - var error = $root.google.spanner.executor.v1.CreateCloudInstanceAction.verify(message.createCloudInstance); - if (error) - return "createCloudInstance." + error; - } - } - if (message.updateCloudInstance != null && message.hasOwnProperty("updateCloudInstance")) { - if (properties.action === 1) - return "action: multiple values"; - properties.action = 1; - { - var error = $root.google.spanner.executor.v1.UpdateCloudInstanceAction.verify(message.updateCloudInstance); - if (error) - return "updateCloudInstance." + error; - } - } - if (message.deleteCloudInstance != null && message.hasOwnProperty("deleteCloudInstance")) { - if (properties.action === 1) - return "action: multiple values"; - properties.action = 1; - { - var error = $root.google.spanner.executor.v1.DeleteCloudInstanceAction.verify(message.deleteCloudInstance); - if (error) - return "deleteCloudInstance." + error; - } - } - if (message.listCloudInstances != null && message.hasOwnProperty("listCloudInstances")) { - if (properties.action === 1) - return "action: multiple values"; - properties.action = 1; - { - var error = $root.google.spanner.executor.v1.ListCloudInstancesAction.verify(message.listCloudInstances); - if (error) - return "listCloudInstances." + error; - } - } - if (message.getCloudInstance != null && message.hasOwnProperty("getCloudInstance")) { - if (properties.action === 1) - return "action: multiple values"; - properties.action = 1; - { - var error = $root.google.spanner.executor.v1.GetCloudInstanceAction.verify(message.getCloudInstance); - if (error) - return "getCloudInstance." + error; - } - } - if (message.createCloudDatabase != null && message.hasOwnProperty("createCloudDatabase")) { - if (properties.action === 1) - return "action: multiple values"; - properties.action = 1; - { - var error = $root.google.spanner.executor.v1.CreateCloudDatabaseAction.verify(message.createCloudDatabase); - if (error) - return "createCloudDatabase." + error; - } - } - if (message.updateCloudDatabaseDdl != null && message.hasOwnProperty("updateCloudDatabaseDdl")) { - if (properties.action === 1) - return "action: multiple values"; - properties.action = 1; - { - var error = $root.google.spanner.executor.v1.UpdateCloudDatabaseDdlAction.verify(message.updateCloudDatabaseDdl); - if (error) - return "updateCloudDatabaseDdl." + error; - } - } - if (message.updateCloudDatabase != null && message.hasOwnProperty("updateCloudDatabase")) { - if (properties.action === 1) - return "action: multiple values"; - properties.action = 1; - { - var error = $root.google.spanner.executor.v1.UpdateCloudDatabaseAction.verify(message.updateCloudDatabase); - if (error) - return "updateCloudDatabase." + error; - } - } - if (message.dropCloudDatabase != null && message.hasOwnProperty("dropCloudDatabase")) { - if (properties.action === 1) - return "action: multiple values"; - properties.action = 1; - { - var error = $root.google.spanner.executor.v1.DropCloudDatabaseAction.verify(message.dropCloudDatabase); - if (error) - return "dropCloudDatabase." + error; - } - } - if (message.listCloudDatabases != null && message.hasOwnProperty("listCloudDatabases")) { - if (properties.action === 1) - return "action: multiple values"; - properties.action = 1; - { - var error = $root.google.spanner.executor.v1.ListCloudDatabasesAction.verify(message.listCloudDatabases); - if (error) - return "listCloudDatabases." + error; - } - } - if (message.listCloudDatabaseOperations != null && message.hasOwnProperty("listCloudDatabaseOperations")) { - if (properties.action === 1) - return "action: multiple values"; - properties.action = 1; - { - var error = $root.google.spanner.executor.v1.ListCloudDatabaseOperationsAction.verify(message.listCloudDatabaseOperations); - if (error) - return "listCloudDatabaseOperations." + error; - } - } - if (message.restoreCloudDatabase != null && message.hasOwnProperty("restoreCloudDatabase")) { - if (properties.action === 1) - return "action: multiple values"; - properties.action = 1; - { - var error = $root.google.spanner.executor.v1.RestoreCloudDatabaseAction.verify(message.restoreCloudDatabase); - if (error) - return "restoreCloudDatabase." + error; - } - } - if (message.getCloudDatabase != null && message.hasOwnProperty("getCloudDatabase")) { - if (properties.action === 1) - return "action: multiple values"; - properties.action = 1; - { - var error = $root.google.spanner.executor.v1.GetCloudDatabaseAction.verify(message.getCloudDatabase); - if (error) - return "getCloudDatabase." + error; - } - } - if (message.createCloudBackup != null && message.hasOwnProperty("createCloudBackup")) { - if (properties.action === 1) - return "action: multiple values"; - properties.action = 1; - { - var error = $root.google.spanner.executor.v1.CreateCloudBackupAction.verify(message.createCloudBackup); - if (error) - return "createCloudBackup." + error; - } - } - if (message.copyCloudBackup != null && message.hasOwnProperty("copyCloudBackup")) { - if (properties.action === 1) - return "action: multiple values"; - properties.action = 1; - { - var error = $root.google.spanner.executor.v1.CopyCloudBackupAction.verify(message.copyCloudBackup); - if (error) - return "copyCloudBackup." + error; - } - } - if (message.getCloudBackup != null && message.hasOwnProperty("getCloudBackup")) { - if (properties.action === 1) - return "action: multiple values"; - properties.action = 1; - { - var error = $root.google.spanner.executor.v1.GetCloudBackupAction.verify(message.getCloudBackup); - if (error) - return "getCloudBackup." + error; - } - } - if (message.updateCloudBackup != null && message.hasOwnProperty("updateCloudBackup")) { - if (properties.action === 1) - return "action: multiple values"; - properties.action = 1; - { - var error = $root.google.spanner.executor.v1.UpdateCloudBackupAction.verify(message.updateCloudBackup); - if (error) - return "updateCloudBackup." + error; - } - } - if (message.deleteCloudBackup != null && message.hasOwnProperty("deleteCloudBackup")) { - if (properties.action === 1) - return "action: multiple values"; - properties.action = 1; - { - var error = $root.google.spanner.executor.v1.DeleteCloudBackupAction.verify(message.deleteCloudBackup); - if (error) - return "deleteCloudBackup." + error; - } - } - if (message.listCloudBackups != null && message.hasOwnProperty("listCloudBackups")) { - if (properties.action === 1) - return "action: multiple values"; - properties.action = 1; - { - var error = $root.google.spanner.executor.v1.ListCloudBackupsAction.verify(message.listCloudBackups); - if (error) - return "listCloudBackups." + error; - } - } - if (message.listCloudBackupOperations != null && message.hasOwnProperty("listCloudBackupOperations")) { - if (properties.action === 1) - return "action: multiple values"; - properties.action = 1; - { - var error = $root.google.spanner.executor.v1.ListCloudBackupOperationsAction.verify(message.listCloudBackupOperations); - if (error) - return "listCloudBackupOperations." + error; - } - } - if (message.getOperation != null && message.hasOwnProperty("getOperation")) { - if (properties.action === 1) - return "action: multiple values"; - properties.action = 1; - { - var error = $root.google.spanner.executor.v1.GetOperationAction.verify(message.getOperation); - if (error) - return "getOperation." + error; - } - } - if (message.cancelOperation != null && message.hasOwnProperty("cancelOperation")) { - if (properties.action === 1) - return "action: multiple values"; - properties.action = 1; - { - var error = $root.google.spanner.executor.v1.CancelOperationAction.verify(message.cancelOperation); - if (error) - return "cancelOperation." + error; - } - } - if (message.changeQuorumCloudDatabase != null && message.hasOwnProperty("changeQuorumCloudDatabase")) { - if (properties.action === 1) - return "action: multiple values"; - properties.action = 1; - { - var error = $root.google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction.verify(message.changeQuorumCloudDatabase); - if (error) - return "changeQuorumCloudDatabase." + error; - } - } - return null; - }; - - /** - * Creates an AdminAction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.executor.v1.AdminAction - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.executor.v1.AdminAction} AdminAction - */ - AdminAction.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.executor.v1.AdminAction) - return object; - var message = new $root.google.spanner.executor.v1.AdminAction(); - if (object.createUserInstanceConfig != null) { - if (typeof object.createUserInstanceConfig !== "object") - throw TypeError(".google.spanner.executor.v1.AdminAction.createUserInstanceConfig: object expected"); - message.createUserInstanceConfig = $root.google.spanner.executor.v1.CreateUserInstanceConfigAction.fromObject(object.createUserInstanceConfig); - } - if (object.updateUserInstanceConfig != null) { - if (typeof object.updateUserInstanceConfig !== "object") - throw TypeError(".google.spanner.executor.v1.AdminAction.updateUserInstanceConfig: object expected"); - message.updateUserInstanceConfig = $root.google.spanner.executor.v1.UpdateUserInstanceConfigAction.fromObject(object.updateUserInstanceConfig); - } - if (object.deleteUserInstanceConfig != null) { - if (typeof object.deleteUserInstanceConfig !== "object") - throw TypeError(".google.spanner.executor.v1.AdminAction.deleteUserInstanceConfig: object expected"); - message.deleteUserInstanceConfig = $root.google.spanner.executor.v1.DeleteUserInstanceConfigAction.fromObject(object.deleteUserInstanceConfig); - } - if (object.getCloudInstanceConfig != null) { - if (typeof object.getCloudInstanceConfig !== "object") - throw TypeError(".google.spanner.executor.v1.AdminAction.getCloudInstanceConfig: object expected"); - message.getCloudInstanceConfig = $root.google.spanner.executor.v1.GetCloudInstanceConfigAction.fromObject(object.getCloudInstanceConfig); - } - if (object.listInstanceConfigs != null) { - if (typeof object.listInstanceConfigs !== "object") - throw TypeError(".google.spanner.executor.v1.AdminAction.listInstanceConfigs: object expected"); - message.listInstanceConfigs = $root.google.spanner.executor.v1.ListCloudInstanceConfigsAction.fromObject(object.listInstanceConfigs); - } - if (object.createCloudInstance != null) { - if (typeof object.createCloudInstance !== "object") - throw TypeError(".google.spanner.executor.v1.AdminAction.createCloudInstance: object expected"); - message.createCloudInstance = $root.google.spanner.executor.v1.CreateCloudInstanceAction.fromObject(object.createCloudInstance); - } - if (object.updateCloudInstance != null) { - if (typeof object.updateCloudInstance !== "object") - throw TypeError(".google.spanner.executor.v1.AdminAction.updateCloudInstance: object expected"); - message.updateCloudInstance = $root.google.spanner.executor.v1.UpdateCloudInstanceAction.fromObject(object.updateCloudInstance); - } - if (object.deleteCloudInstance != null) { - if (typeof object.deleteCloudInstance !== "object") - throw TypeError(".google.spanner.executor.v1.AdminAction.deleteCloudInstance: object expected"); - message.deleteCloudInstance = $root.google.spanner.executor.v1.DeleteCloudInstanceAction.fromObject(object.deleteCloudInstance); - } - if (object.listCloudInstances != null) { - if (typeof object.listCloudInstances !== "object") - throw TypeError(".google.spanner.executor.v1.AdminAction.listCloudInstances: object expected"); - message.listCloudInstances = $root.google.spanner.executor.v1.ListCloudInstancesAction.fromObject(object.listCloudInstances); - } - if (object.getCloudInstance != null) { - if (typeof object.getCloudInstance !== "object") - throw TypeError(".google.spanner.executor.v1.AdminAction.getCloudInstance: object expected"); - message.getCloudInstance = $root.google.spanner.executor.v1.GetCloudInstanceAction.fromObject(object.getCloudInstance); - } - if (object.createCloudDatabase != null) { - if (typeof object.createCloudDatabase !== "object") - throw TypeError(".google.spanner.executor.v1.AdminAction.createCloudDatabase: object expected"); - message.createCloudDatabase = $root.google.spanner.executor.v1.CreateCloudDatabaseAction.fromObject(object.createCloudDatabase); - } - if (object.updateCloudDatabaseDdl != null) { - if (typeof object.updateCloudDatabaseDdl !== "object") - throw TypeError(".google.spanner.executor.v1.AdminAction.updateCloudDatabaseDdl: object expected"); - message.updateCloudDatabaseDdl = $root.google.spanner.executor.v1.UpdateCloudDatabaseDdlAction.fromObject(object.updateCloudDatabaseDdl); - } - if (object.updateCloudDatabase != null) { - if (typeof object.updateCloudDatabase !== "object") - throw TypeError(".google.spanner.executor.v1.AdminAction.updateCloudDatabase: object expected"); - message.updateCloudDatabase = $root.google.spanner.executor.v1.UpdateCloudDatabaseAction.fromObject(object.updateCloudDatabase); - } - if (object.dropCloudDatabase != null) { - if (typeof object.dropCloudDatabase !== "object") - throw TypeError(".google.spanner.executor.v1.AdminAction.dropCloudDatabase: object expected"); - message.dropCloudDatabase = $root.google.spanner.executor.v1.DropCloudDatabaseAction.fromObject(object.dropCloudDatabase); - } - if (object.listCloudDatabases != null) { - if (typeof object.listCloudDatabases !== "object") - throw TypeError(".google.spanner.executor.v1.AdminAction.listCloudDatabases: object expected"); - message.listCloudDatabases = $root.google.spanner.executor.v1.ListCloudDatabasesAction.fromObject(object.listCloudDatabases); - } - if (object.listCloudDatabaseOperations != null) { - if (typeof object.listCloudDatabaseOperations !== "object") - throw TypeError(".google.spanner.executor.v1.AdminAction.listCloudDatabaseOperations: object expected"); - message.listCloudDatabaseOperations = $root.google.spanner.executor.v1.ListCloudDatabaseOperationsAction.fromObject(object.listCloudDatabaseOperations); - } - if (object.restoreCloudDatabase != null) { - if (typeof object.restoreCloudDatabase !== "object") - throw TypeError(".google.spanner.executor.v1.AdminAction.restoreCloudDatabase: object expected"); - message.restoreCloudDatabase = $root.google.spanner.executor.v1.RestoreCloudDatabaseAction.fromObject(object.restoreCloudDatabase); - } - if (object.getCloudDatabase != null) { - if (typeof object.getCloudDatabase !== "object") - throw TypeError(".google.spanner.executor.v1.AdminAction.getCloudDatabase: object expected"); - message.getCloudDatabase = $root.google.spanner.executor.v1.GetCloudDatabaseAction.fromObject(object.getCloudDatabase); - } - if (object.createCloudBackup != null) { - if (typeof object.createCloudBackup !== "object") - throw TypeError(".google.spanner.executor.v1.AdminAction.createCloudBackup: object expected"); - message.createCloudBackup = $root.google.spanner.executor.v1.CreateCloudBackupAction.fromObject(object.createCloudBackup); - } - if (object.copyCloudBackup != null) { - if (typeof object.copyCloudBackup !== "object") - throw TypeError(".google.spanner.executor.v1.AdminAction.copyCloudBackup: object expected"); - message.copyCloudBackup = $root.google.spanner.executor.v1.CopyCloudBackupAction.fromObject(object.copyCloudBackup); - } - if (object.getCloudBackup != null) { - if (typeof object.getCloudBackup !== "object") - throw TypeError(".google.spanner.executor.v1.AdminAction.getCloudBackup: object expected"); - message.getCloudBackup = $root.google.spanner.executor.v1.GetCloudBackupAction.fromObject(object.getCloudBackup); - } - if (object.updateCloudBackup != null) { - if (typeof object.updateCloudBackup !== "object") - throw TypeError(".google.spanner.executor.v1.AdminAction.updateCloudBackup: object expected"); - message.updateCloudBackup = $root.google.spanner.executor.v1.UpdateCloudBackupAction.fromObject(object.updateCloudBackup); - } - if (object.deleteCloudBackup != null) { - if (typeof object.deleteCloudBackup !== "object") - throw TypeError(".google.spanner.executor.v1.AdminAction.deleteCloudBackup: object expected"); - message.deleteCloudBackup = $root.google.spanner.executor.v1.DeleteCloudBackupAction.fromObject(object.deleteCloudBackup); - } - if (object.listCloudBackups != null) { - if (typeof object.listCloudBackups !== "object") - throw TypeError(".google.spanner.executor.v1.AdminAction.listCloudBackups: object expected"); - message.listCloudBackups = $root.google.spanner.executor.v1.ListCloudBackupsAction.fromObject(object.listCloudBackups); - } - if (object.listCloudBackupOperations != null) { - if (typeof object.listCloudBackupOperations !== "object") - throw TypeError(".google.spanner.executor.v1.AdminAction.listCloudBackupOperations: object expected"); - message.listCloudBackupOperations = $root.google.spanner.executor.v1.ListCloudBackupOperationsAction.fromObject(object.listCloudBackupOperations); - } - if (object.getOperation != null) { - if (typeof object.getOperation !== "object") - throw TypeError(".google.spanner.executor.v1.AdminAction.getOperation: object expected"); - message.getOperation = $root.google.spanner.executor.v1.GetOperationAction.fromObject(object.getOperation); - } - if (object.cancelOperation != null) { - if (typeof object.cancelOperation !== "object") - throw TypeError(".google.spanner.executor.v1.AdminAction.cancelOperation: object expected"); - message.cancelOperation = $root.google.spanner.executor.v1.CancelOperationAction.fromObject(object.cancelOperation); - } - if (object.changeQuorumCloudDatabase != null) { - if (typeof object.changeQuorumCloudDatabase !== "object") - throw TypeError(".google.spanner.executor.v1.AdminAction.changeQuorumCloudDatabase: object expected"); - message.changeQuorumCloudDatabase = $root.google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction.fromObject(object.changeQuorumCloudDatabase); - } - return message; - }; - - /** - * Creates a plain object from an AdminAction message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.executor.v1.AdminAction - * @static - * @param {google.spanner.executor.v1.AdminAction} message AdminAction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AdminAction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.createUserInstanceConfig != null && message.hasOwnProperty("createUserInstanceConfig")) { - object.createUserInstanceConfig = $root.google.spanner.executor.v1.CreateUserInstanceConfigAction.toObject(message.createUserInstanceConfig, options); - if (options.oneofs) - object.action = "createUserInstanceConfig"; - } - if (message.updateUserInstanceConfig != null && message.hasOwnProperty("updateUserInstanceConfig")) { - object.updateUserInstanceConfig = $root.google.spanner.executor.v1.UpdateUserInstanceConfigAction.toObject(message.updateUserInstanceConfig, options); - if (options.oneofs) - object.action = "updateUserInstanceConfig"; - } - if (message.deleteUserInstanceConfig != null && message.hasOwnProperty("deleteUserInstanceConfig")) { - object.deleteUserInstanceConfig = $root.google.spanner.executor.v1.DeleteUserInstanceConfigAction.toObject(message.deleteUserInstanceConfig, options); - if (options.oneofs) - object.action = "deleteUserInstanceConfig"; - } - if (message.getCloudInstanceConfig != null && message.hasOwnProperty("getCloudInstanceConfig")) { - object.getCloudInstanceConfig = $root.google.spanner.executor.v1.GetCloudInstanceConfigAction.toObject(message.getCloudInstanceConfig, options); - if (options.oneofs) - object.action = "getCloudInstanceConfig"; - } - if (message.listInstanceConfigs != null && message.hasOwnProperty("listInstanceConfigs")) { - object.listInstanceConfigs = $root.google.spanner.executor.v1.ListCloudInstanceConfigsAction.toObject(message.listInstanceConfigs, options); - if (options.oneofs) - object.action = "listInstanceConfigs"; - } - if (message.createCloudInstance != null && message.hasOwnProperty("createCloudInstance")) { - object.createCloudInstance = $root.google.spanner.executor.v1.CreateCloudInstanceAction.toObject(message.createCloudInstance, options); - if (options.oneofs) - object.action = "createCloudInstance"; - } - if (message.updateCloudInstance != null && message.hasOwnProperty("updateCloudInstance")) { - object.updateCloudInstance = $root.google.spanner.executor.v1.UpdateCloudInstanceAction.toObject(message.updateCloudInstance, options); - if (options.oneofs) - object.action = "updateCloudInstance"; - } - if (message.deleteCloudInstance != null && message.hasOwnProperty("deleteCloudInstance")) { - object.deleteCloudInstance = $root.google.spanner.executor.v1.DeleteCloudInstanceAction.toObject(message.deleteCloudInstance, options); - if (options.oneofs) - object.action = "deleteCloudInstance"; - } - if (message.listCloudInstances != null && message.hasOwnProperty("listCloudInstances")) { - object.listCloudInstances = $root.google.spanner.executor.v1.ListCloudInstancesAction.toObject(message.listCloudInstances, options); - if (options.oneofs) - object.action = "listCloudInstances"; - } - if (message.getCloudInstance != null && message.hasOwnProperty("getCloudInstance")) { - object.getCloudInstance = $root.google.spanner.executor.v1.GetCloudInstanceAction.toObject(message.getCloudInstance, options); - if (options.oneofs) - object.action = "getCloudInstance"; - } - if (message.createCloudDatabase != null && message.hasOwnProperty("createCloudDatabase")) { - object.createCloudDatabase = $root.google.spanner.executor.v1.CreateCloudDatabaseAction.toObject(message.createCloudDatabase, options); - if (options.oneofs) - object.action = "createCloudDatabase"; - } - if (message.updateCloudDatabaseDdl != null && message.hasOwnProperty("updateCloudDatabaseDdl")) { - object.updateCloudDatabaseDdl = $root.google.spanner.executor.v1.UpdateCloudDatabaseDdlAction.toObject(message.updateCloudDatabaseDdl, options); - if (options.oneofs) - object.action = "updateCloudDatabaseDdl"; - } - if (message.dropCloudDatabase != null && message.hasOwnProperty("dropCloudDatabase")) { - object.dropCloudDatabase = $root.google.spanner.executor.v1.DropCloudDatabaseAction.toObject(message.dropCloudDatabase, options); - if (options.oneofs) - object.action = "dropCloudDatabase"; - } - if (message.listCloudDatabases != null && message.hasOwnProperty("listCloudDatabases")) { - object.listCloudDatabases = $root.google.spanner.executor.v1.ListCloudDatabasesAction.toObject(message.listCloudDatabases, options); - if (options.oneofs) - object.action = "listCloudDatabases"; - } - if (message.listCloudDatabaseOperations != null && message.hasOwnProperty("listCloudDatabaseOperations")) { - object.listCloudDatabaseOperations = $root.google.spanner.executor.v1.ListCloudDatabaseOperationsAction.toObject(message.listCloudDatabaseOperations, options); - if (options.oneofs) - object.action = "listCloudDatabaseOperations"; - } - if (message.restoreCloudDatabase != null && message.hasOwnProperty("restoreCloudDatabase")) { - object.restoreCloudDatabase = $root.google.spanner.executor.v1.RestoreCloudDatabaseAction.toObject(message.restoreCloudDatabase, options); - if (options.oneofs) - object.action = "restoreCloudDatabase"; - } - if (message.getCloudDatabase != null && message.hasOwnProperty("getCloudDatabase")) { - object.getCloudDatabase = $root.google.spanner.executor.v1.GetCloudDatabaseAction.toObject(message.getCloudDatabase, options); - if (options.oneofs) - object.action = "getCloudDatabase"; - } - if (message.createCloudBackup != null && message.hasOwnProperty("createCloudBackup")) { - object.createCloudBackup = $root.google.spanner.executor.v1.CreateCloudBackupAction.toObject(message.createCloudBackup, options); - if (options.oneofs) - object.action = "createCloudBackup"; - } - if (message.copyCloudBackup != null && message.hasOwnProperty("copyCloudBackup")) { - object.copyCloudBackup = $root.google.spanner.executor.v1.CopyCloudBackupAction.toObject(message.copyCloudBackup, options); - if (options.oneofs) - object.action = "copyCloudBackup"; - } - if (message.getCloudBackup != null && message.hasOwnProperty("getCloudBackup")) { - object.getCloudBackup = $root.google.spanner.executor.v1.GetCloudBackupAction.toObject(message.getCloudBackup, options); - if (options.oneofs) - object.action = "getCloudBackup"; - } - if (message.updateCloudBackup != null && message.hasOwnProperty("updateCloudBackup")) { - object.updateCloudBackup = $root.google.spanner.executor.v1.UpdateCloudBackupAction.toObject(message.updateCloudBackup, options); - if (options.oneofs) - object.action = "updateCloudBackup"; - } - if (message.deleteCloudBackup != null && message.hasOwnProperty("deleteCloudBackup")) { - object.deleteCloudBackup = $root.google.spanner.executor.v1.DeleteCloudBackupAction.toObject(message.deleteCloudBackup, options); - if (options.oneofs) - object.action = "deleteCloudBackup"; - } - if (message.listCloudBackups != null && message.hasOwnProperty("listCloudBackups")) { - object.listCloudBackups = $root.google.spanner.executor.v1.ListCloudBackupsAction.toObject(message.listCloudBackups, options); - if (options.oneofs) - object.action = "listCloudBackups"; - } - if (message.listCloudBackupOperations != null && message.hasOwnProperty("listCloudBackupOperations")) { - object.listCloudBackupOperations = $root.google.spanner.executor.v1.ListCloudBackupOperationsAction.toObject(message.listCloudBackupOperations, options); - if (options.oneofs) - object.action = "listCloudBackupOperations"; - } - if (message.getOperation != null && message.hasOwnProperty("getOperation")) { - object.getOperation = $root.google.spanner.executor.v1.GetOperationAction.toObject(message.getOperation, options); - if (options.oneofs) - object.action = "getOperation"; - } - if (message.cancelOperation != null && message.hasOwnProperty("cancelOperation")) { - object.cancelOperation = $root.google.spanner.executor.v1.CancelOperationAction.toObject(message.cancelOperation, options); - if (options.oneofs) - object.action = "cancelOperation"; - } - if (message.updateCloudDatabase != null && message.hasOwnProperty("updateCloudDatabase")) { - object.updateCloudDatabase = $root.google.spanner.executor.v1.UpdateCloudDatabaseAction.toObject(message.updateCloudDatabase, options); - if (options.oneofs) - object.action = "updateCloudDatabase"; - } - if (message.changeQuorumCloudDatabase != null && message.hasOwnProperty("changeQuorumCloudDatabase")) { - object.changeQuorumCloudDatabase = $root.google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction.toObject(message.changeQuorumCloudDatabase, options); - if (options.oneofs) - object.action = "changeQuorumCloudDatabase"; - } - return object; - }; - - /** - * Converts this AdminAction to JSON. - * @function toJSON - * @memberof google.spanner.executor.v1.AdminAction - * @instance - * @returns {Object.} JSON object - */ - AdminAction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AdminAction - * @function getTypeUrl - * @memberof google.spanner.executor.v1.AdminAction - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AdminAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.executor.v1.AdminAction"; - }; - - return AdminAction; - })(); - - v1.CreateUserInstanceConfigAction = (function() { - - /** - * Properties of a CreateUserInstanceConfigAction. - * @memberof google.spanner.executor.v1 - * @interface ICreateUserInstanceConfigAction - * @property {string|null} [userConfigId] CreateUserInstanceConfigAction userConfigId - * @property {string|null} [projectId] CreateUserInstanceConfigAction projectId - * @property {string|null} [baseConfigId] CreateUserInstanceConfigAction baseConfigId - * @property {Array.|null} [replicas] CreateUserInstanceConfigAction replicas - */ - - /** - * Constructs a new CreateUserInstanceConfigAction. - * @memberof google.spanner.executor.v1 - * @classdesc Represents a CreateUserInstanceConfigAction. - * @implements ICreateUserInstanceConfigAction - * @constructor - * @param {google.spanner.executor.v1.ICreateUserInstanceConfigAction=} [properties] Properties to set - */ - function CreateUserInstanceConfigAction(properties) { - this.replicas = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateUserInstanceConfigAction userConfigId. - * @member {string} userConfigId - * @memberof google.spanner.executor.v1.CreateUserInstanceConfigAction - * @instance - */ - CreateUserInstanceConfigAction.prototype.userConfigId = ""; - - /** - * CreateUserInstanceConfigAction projectId. - * @member {string} projectId - * @memberof google.spanner.executor.v1.CreateUserInstanceConfigAction - * @instance - */ - CreateUserInstanceConfigAction.prototype.projectId = ""; - - /** - * CreateUserInstanceConfigAction baseConfigId. - * @member {string} baseConfigId - * @memberof google.spanner.executor.v1.CreateUserInstanceConfigAction - * @instance - */ - CreateUserInstanceConfigAction.prototype.baseConfigId = ""; - - /** - * CreateUserInstanceConfigAction replicas. - * @member {Array.} replicas - * @memberof google.spanner.executor.v1.CreateUserInstanceConfigAction - * @instance - */ - CreateUserInstanceConfigAction.prototype.replicas = $util.emptyArray; - - /** - * Creates a new CreateUserInstanceConfigAction instance using the specified properties. - * @function create - * @memberof google.spanner.executor.v1.CreateUserInstanceConfigAction - * @static - * @param {google.spanner.executor.v1.ICreateUserInstanceConfigAction=} [properties] Properties to set - * @returns {google.spanner.executor.v1.CreateUserInstanceConfigAction} CreateUserInstanceConfigAction instance - */ - CreateUserInstanceConfigAction.create = function create(properties) { - return new CreateUserInstanceConfigAction(properties); - }; - - /** - * Encodes the specified CreateUserInstanceConfigAction message. Does not implicitly {@link google.spanner.executor.v1.CreateUserInstanceConfigAction.verify|verify} messages. - * @function encode - * @memberof google.spanner.executor.v1.CreateUserInstanceConfigAction - * @static - * @param {google.spanner.executor.v1.ICreateUserInstanceConfigAction} message CreateUserInstanceConfigAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateUserInstanceConfigAction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.userConfigId != null && Object.hasOwnProperty.call(message, "userConfigId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.userConfigId); - if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.projectId); - if (message.baseConfigId != null && Object.hasOwnProperty.call(message, "baseConfigId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.baseConfigId); - if (message.replicas != null && message.replicas.length) - for (var i = 0; i < message.replicas.length; ++i) - $root.google.spanner.admin.instance.v1.ReplicaInfo.encode(message.replicas[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CreateUserInstanceConfigAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.CreateUserInstanceConfigAction.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.executor.v1.CreateUserInstanceConfigAction - * @static - * @param {google.spanner.executor.v1.ICreateUserInstanceConfigAction} message CreateUserInstanceConfigAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateUserInstanceConfigAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateUserInstanceConfigAction message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.executor.v1.CreateUserInstanceConfigAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.executor.v1.CreateUserInstanceConfigAction} CreateUserInstanceConfigAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateUserInstanceConfigAction.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.CreateUserInstanceConfigAction(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.userConfigId = reader.string(); - break; - } - case 2: { - message.projectId = reader.string(); - break; - } - case 3: { - message.baseConfigId = reader.string(); - break; - } - case 4: { - if (!(message.replicas && message.replicas.length)) - message.replicas = []; - message.replicas.push($root.google.spanner.admin.instance.v1.ReplicaInfo.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateUserInstanceConfigAction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.executor.v1.CreateUserInstanceConfigAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.executor.v1.CreateUserInstanceConfigAction} CreateUserInstanceConfigAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateUserInstanceConfigAction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateUserInstanceConfigAction message. - * @function verify - * @memberof google.spanner.executor.v1.CreateUserInstanceConfigAction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateUserInstanceConfigAction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.userConfigId != null && message.hasOwnProperty("userConfigId")) - if (!$util.isString(message.userConfigId)) - return "userConfigId: string expected"; - if (message.projectId != null && message.hasOwnProperty("projectId")) - if (!$util.isString(message.projectId)) - return "projectId: string expected"; - if (message.baseConfigId != null && message.hasOwnProperty("baseConfigId")) - if (!$util.isString(message.baseConfigId)) - return "baseConfigId: string expected"; - if (message.replicas != null && message.hasOwnProperty("replicas")) { - if (!Array.isArray(message.replicas)) - return "replicas: array expected"; - for (var i = 0; i < message.replicas.length; ++i) { - var error = $root.google.spanner.admin.instance.v1.ReplicaInfo.verify(message.replicas[i]); - if (error) - return "replicas." + error; - } - } - return null; - }; - - /** - * Creates a CreateUserInstanceConfigAction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.executor.v1.CreateUserInstanceConfigAction - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.executor.v1.CreateUserInstanceConfigAction} CreateUserInstanceConfigAction - */ - CreateUserInstanceConfigAction.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.executor.v1.CreateUserInstanceConfigAction) - return object; - var message = new $root.google.spanner.executor.v1.CreateUserInstanceConfigAction(); - if (object.userConfigId != null) - message.userConfigId = String(object.userConfigId); - if (object.projectId != null) - message.projectId = String(object.projectId); - if (object.baseConfigId != null) - message.baseConfigId = String(object.baseConfigId); - if (object.replicas) { - if (!Array.isArray(object.replicas)) - throw TypeError(".google.spanner.executor.v1.CreateUserInstanceConfigAction.replicas: array expected"); - message.replicas = []; - for (var i = 0; i < object.replicas.length; ++i) { - if (typeof object.replicas[i] !== "object") - throw TypeError(".google.spanner.executor.v1.CreateUserInstanceConfigAction.replicas: object expected"); - message.replicas[i] = $root.google.spanner.admin.instance.v1.ReplicaInfo.fromObject(object.replicas[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a CreateUserInstanceConfigAction message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.executor.v1.CreateUserInstanceConfigAction - * @static - * @param {google.spanner.executor.v1.CreateUserInstanceConfigAction} message CreateUserInstanceConfigAction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateUserInstanceConfigAction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.replicas = []; - if (options.defaults) { - object.userConfigId = ""; - object.projectId = ""; - object.baseConfigId = ""; - } - if (message.userConfigId != null && message.hasOwnProperty("userConfigId")) - object.userConfigId = message.userConfigId; - if (message.projectId != null && message.hasOwnProperty("projectId")) - object.projectId = message.projectId; - if (message.baseConfigId != null && message.hasOwnProperty("baseConfigId")) - object.baseConfigId = message.baseConfigId; - if (message.replicas && message.replicas.length) { - object.replicas = []; - for (var j = 0; j < message.replicas.length; ++j) - object.replicas[j] = $root.google.spanner.admin.instance.v1.ReplicaInfo.toObject(message.replicas[j], options); - } - return object; - }; - - /** - * Converts this CreateUserInstanceConfigAction to JSON. - * @function toJSON - * @memberof google.spanner.executor.v1.CreateUserInstanceConfigAction - * @instance - * @returns {Object.} JSON object - */ - CreateUserInstanceConfigAction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateUserInstanceConfigAction - * @function getTypeUrl - * @memberof google.spanner.executor.v1.CreateUserInstanceConfigAction - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateUserInstanceConfigAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.executor.v1.CreateUserInstanceConfigAction"; - }; - - return CreateUserInstanceConfigAction; - })(); - - v1.UpdateUserInstanceConfigAction = (function() { - - /** - * Properties of an UpdateUserInstanceConfigAction. - * @memberof google.spanner.executor.v1 - * @interface IUpdateUserInstanceConfigAction - * @property {string|null} [userConfigId] UpdateUserInstanceConfigAction userConfigId - * @property {string|null} [projectId] UpdateUserInstanceConfigAction projectId - * @property {string|null} [displayName] UpdateUserInstanceConfigAction displayName - * @property {Object.|null} [labels] UpdateUserInstanceConfigAction labels - */ - - /** - * Constructs a new UpdateUserInstanceConfigAction. - * @memberof google.spanner.executor.v1 - * @classdesc Represents an UpdateUserInstanceConfigAction. - * @implements IUpdateUserInstanceConfigAction - * @constructor - * @param {google.spanner.executor.v1.IUpdateUserInstanceConfigAction=} [properties] Properties to set - */ - function UpdateUserInstanceConfigAction(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]]; - } - - /** - * UpdateUserInstanceConfigAction userConfigId. - * @member {string} userConfigId - * @memberof google.spanner.executor.v1.UpdateUserInstanceConfigAction - * @instance - */ - UpdateUserInstanceConfigAction.prototype.userConfigId = ""; - - /** - * UpdateUserInstanceConfigAction projectId. - * @member {string} projectId - * @memberof google.spanner.executor.v1.UpdateUserInstanceConfigAction - * @instance - */ - UpdateUserInstanceConfigAction.prototype.projectId = ""; - - /** - * UpdateUserInstanceConfigAction displayName. - * @member {string|null|undefined} displayName - * @memberof google.spanner.executor.v1.UpdateUserInstanceConfigAction - * @instance - */ - UpdateUserInstanceConfigAction.prototype.displayName = null; - - /** - * UpdateUserInstanceConfigAction labels. - * @member {Object.} labels - * @memberof google.spanner.executor.v1.UpdateUserInstanceConfigAction - * @instance - */ - UpdateUserInstanceConfigAction.prototype.labels = $util.emptyObject; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(UpdateUserInstanceConfigAction.prototype, "_displayName", { - get: $util.oneOfGetter($oneOfFields = ["displayName"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new UpdateUserInstanceConfigAction instance using the specified properties. - * @function create - * @memberof google.spanner.executor.v1.UpdateUserInstanceConfigAction - * @static - * @param {google.spanner.executor.v1.IUpdateUserInstanceConfigAction=} [properties] Properties to set - * @returns {google.spanner.executor.v1.UpdateUserInstanceConfigAction} UpdateUserInstanceConfigAction instance - */ - UpdateUserInstanceConfigAction.create = function create(properties) { - return new UpdateUserInstanceConfigAction(properties); - }; - - /** - * Encodes the specified UpdateUserInstanceConfigAction message. Does not implicitly {@link google.spanner.executor.v1.UpdateUserInstanceConfigAction.verify|verify} messages. - * @function encode - * @memberof google.spanner.executor.v1.UpdateUserInstanceConfigAction - * @static - * @param {google.spanner.executor.v1.IUpdateUserInstanceConfigAction} message UpdateUserInstanceConfigAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateUserInstanceConfigAction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.userConfigId != null && Object.hasOwnProperty.call(message, "userConfigId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.userConfigId); - if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.projectId); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.displayName); - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).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 UpdateUserInstanceConfigAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.UpdateUserInstanceConfigAction.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.executor.v1.UpdateUserInstanceConfigAction - * @static - * @param {google.spanner.executor.v1.IUpdateUserInstanceConfigAction} message UpdateUserInstanceConfigAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateUserInstanceConfigAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateUserInstanceConfigAction message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.executor.v1.UpdateUserInstanceConfigAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.executor.v1.UpdateUserInstanceConfigAction} UpdateUserInstanceConfigAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateUserInstanceConfigAction.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.UpdateUserInstanceConfigAction(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.userConfigId = reader.string(); - break; - } - case 2: { - message.projectId = reader.string(); - break; - } - case 3: { - message.displayName = reader.string(); - break; - } - case 4: { - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.labels[key] = value; - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateUserInstanceConfigAction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.executor.v1.UpdateUserInstanceConfigAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.executor.v1.UpdateUserInstanceConfigAction} UpdateUserInstanceConfigAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateUserInstanceConfigAction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateUserInstanceConfigAction message. - * @function verify - * @memberof google.spanner.executor.v1.UpdateUserInstanceConfigAction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateUserInstanceConfigAction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.userConfigId != null && message.hasOwnProperty("userConfigId")) - if (!$util.isString(message.userConfigId)) - return "userConfigId: string expected"; - if (message.projectId != null && message.hasOwnProperty("projectId")) - if (!$util.isString(message.projectId)) - return "projectId: string expected"; - if (message.displayName != null && message.hasOwnProperty("displayName")) { - properties._displayName = 1; - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - } - 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 UpdateUserInstanceConfigAction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.executor.v1.UpdateUserInstanceConfigAction - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.executor.v1.UpdateUserInstanceConfigAction} UpdateUserInstanceConfigAction - */ - UpdateUserInstanceConfigAction.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.executor.v1.UpdateUserInstanceConfigAction) - return object; - var message = new $root.google.spanner.executor.v1.UpdateUserInstanceConfigAction(); - if (object.userConfigId != null) - message.userConfigId = String(object.userConfigId); - if (object.projectId != null) - message.projectId = String(object.projectId); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.spanner.executor.v1.UpdateUserInstanceConfigAction.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 UpdateUserInstanceConfigAction message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.executor.v1.UpdateUserInstanceConfigAction - * @static - * @param {google.spanner.executor.v1.UpdateUserInstanceConfigAction} message UpdateUserInstanceConfigAction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateUserInstanceConfigAction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.labels = {}; - if (options.defaults) { - object.userConfigId = ""; - object.projectId = ""; - } - if (message.userConfigId != null && message.hasOwnProperty("userConfigId")) - object.userConfigId = message.userConfigId; - if (message.projectId != null && message.hasOwnProperty("projectId")) - object.projectId = message.projectId; - if (message.displayName != null && message.hasOwnProperty("displayName")) { - object.displayName = message.displayName; - if (options.oneofs) - object._displayName = "displayName"; - } - 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; - }; - - /** - * Converts this UpdateUserInstanceConfigAction to JSON. - * @function toJSON - * @memberof google.spanner.executor.v1.UpdateUserInstanceConfigAction - * @instance - * @returns {Object.} JSON object - */ - UpdateUserInstanceConfigAction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateUserInstanceConfigAction - * @function getTypeUrl - * @memberof google.spanner.executor.v1.UpdateUserInstanceConfigAction - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateUserInstanceConfigAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.executor.v1.UpdateUserInstanceConfigAction"; - }; - - return UpdateUserInstanceConfigAction; - })(); - - v1.GetCloudInstanceConfigAction = (function() { - - /** - * Properties of a GetCloudInstanceConfigAction. - * @memberof google.spanner.executor.v1 - * @interface IGetCloudInstanceConfigAction - * @property {string|null} [instanceConfigId] GetCloudInstanceConfigAction instanceConfigId - * @property {string|null} [projectId] GetCloudInstanceConfigAction projectId - */ - - /** - * Constructs a new GetCloudInstanceConfigAction. - * @memberof google.spanner.executor.v1 - * @classdesc Represents a GetCloudInstanceConfigAction. - * @implements IGetCloudInstanceConfigAction - * @constructor - * @param {google.spanner.executor.v1.IGetCloudInstanceConfigAction=} [properties] Properties to set - */ - function GetCloudInstanceConfigAction(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetCloudInstanceConfigAction instanceConfigId. - * @member {string} instanceConfigId - * @memberof google.spanner.executor.v1.GetCloudInstanceConfigAction - * @instance - */ - GetCloudInstanceConfigAction.prototype.instanceConfigId = ""; - - /** - * GetCloudInstanceConfigAction projectId. - * @member {string} projectId - * @memberof google.spanner.executor.v1.GetCloudInstanceConfigAction - * @instance - */ - GetCloudInstanceConfigAction.prototype.projectId = ""; - - /** - * Creates a new GetCloudInstanceConfigAction instance using the specified properties. - * @function create - * @memberof google.spanner.executor.v1.GetCloudInstanceConfigAction - * @static - * @param {google.spanner.executor.v1.IGetCloudInstanceConfigAction=} [properties] Properties to set - * @returns {google.spanner.executor.v1.GetCloudInstanceConfigAction} GetCloudInstanceConfigAction instance - */ - GetCloudInstanceConfigAction.create = function create(properties) { - return new GetCloudInstanceConfigAction(properties); - }; - - /** - * Encodes the specified GetCloudInstanceConfigAction message. Does not implicitly {@link google.spanner.executor.v1.GetCloudInstanceConfigAction.verify|verify} messages. - * @function encode - * @memberof google.spanner.executor.v1.GetCloudInstanceConfigAction - * @static - * @param {google.spanner.executor.v1.IGetCloudInstanceConfigAction} message GetCloudInstanceConfigAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetCloudInstanceConfigAction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.instanceConfigId != null && Object.hasOwnProperty.call(message, "instanceConfigId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.instanceConfigId); - if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.projectId); - return writer; - }; - - /** - * Encodes the specified GetCloudInstanceConfigAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.GetCloudInstanceConfigAction.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.executor.v1.GetCloudInstanceConfigAction - * @static - * @param {google.spanner.executor.v1.IGetCloudInstanceConfigAction} message GetCloudInstanceConfigAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetCloudInstanceConfigAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetCloudInstanceConfigAction message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.executor.v1.GetCloudInstanceConfigAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.executor.v1.GetCloudInstanceConfigAction} GetCloudInstanceConfigAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetCloudInstanceConfigAction.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.GetCloudInstanceConfigAction(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.instanceConfigId = reader.string(); - break; - } - case 2: { - message.projectId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetCloudInstanceConfigAction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.executor.v1.GetCloudInstanceConfigAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.executor.v1.GetCloudInstanceConfigAction} GetCloudInstanceConfigAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetCloudInstanceConfigAction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetCloudInstanceConfigAction message. - * @function verify - * @memberof google.spanner.executor.v1.GetCloudInstanceConfigAction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetCloudInstanceConfigAction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.instanceConfigId != null && message.hasOwnProperty("instanceConfigId")) - if (!$util.isString(message.instanceConfigId)) - return "instanceConfigId: string expected"; - if (message.projectId != null && message.hasOwnProperty("projectId")) - if (!$util.isString(message.projectId)) - return "projectId: string expected"; - return null; - }; - - /** - * Creates a GetCloudInstanceConfigAction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.executor.v1.GetCloudInstanceConfigAction - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.executor.v1.GetCloudInstanceConfigAction} GetCloudInstanceConfigAction - */ - GetCloudInstanceConfigAction.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.executor.v1.GetCloudInstanceConfigAction) - return object; - var message = new $root.google.spanner.executor.v1.GetCloudInstanceConfigAction(); - if (object.instanceConfigId != null) - message.instanceConfigId = String(object.instanceConfigId); - if (object.projectId != null) - message.projectId = String(object.projectId); - return message; - }; - - /** - * Creates a plain object from a GetCloudInstanceConfigAction message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.executor.v1.GetCloudInstanceConfigAction - * @static - * @param {google.spanner.executor.v1.GetCloudInstanceConfigAction} message GetCloudInstanceConfigAction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetCloudInstanceConfigAction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.instanceConfigId = ""; - object.projectId = ""; - } - if (message.instanceConfigId != null && message.hasOwnProperty("instanceConfigId")) - object.instanceConfigId = message.instanceConfigId; - if (message.projectId != null && message.hasOwnProperty("projectId")) - object.projectId = message.projectId; - return object; - }; - - /** - * Converts this GetCloudInstanceConfigAction to JSON. - * @function toJSON - * @memberof google.spanner.executor.v1.GetCloudInstanceConfigAction - * @instance - * @returns {Object.} JSON object - */ - GetCloudInstanceConfigAction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetCloudInstanceConfigAction - * @function getTypeUrl - * @memberof google.spanner.executor.v1.GetCloudInstanceConfigAction - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetCloudInstanceConfigAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.executor.v1.GetCloudInstanceConfigAction"; - }; - - return GetCloudInstanceConfigAction; - })(); - - v1.DeleteUserInstanceConfigAction = (function() { - - /** - * Properties of a DeleteUserInstanceConfigAction. - * @memberof google.spanner.executor.v1 - * @interface IDeleteUserInstanceConfigAction - * @property {string|null} [userConfigId] DeleteUserInstanceConfigAction userConfigId - * @property {string|null} [projectId] DeleteUserInstanceConfigAction projectId - */ - - /** - * Constructs a new DeleteUserInstanceConfigAction. - * @memberof google.spanner.executor.v1 - * @classdesc Represents a DeleteUserInstanceConfigAction. - * @implements IDeleteUserInstanceConfigAction - * @constructor - * @param {google.spanner.executor.v1.IDeleteUserInstanceConfigAction=} [properties] Properties to set - */ - function DeleteUserInstanceConfigAction(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteUserInstanceConfigAction userConfigId. - * @member {string} userConfigId - * @memberof google.spanner.executor.v1.DeleteUserInstanceConfigAction - * @instance - */ - DeleteUserInstanceConfigAction.prototype.userConfigId = ""; - - /** - * DeleteUserInstanceConfigAction projectId. - * @member {string} projectId - * @memberof google.spanner.executor.v1.DeleteUserInstanceConfigAction - * @instance - */ - DeleteUserInstanceConfigAction.prototype.projectId = ""; - - /** - * Creates a new DeleteUserInstanceConfigAction instance using the specified properties. - * @function create - * @memberof google.spanner.executor.v1.DeleteUserInstanceConfigAction - * @static - * @param {google.spanner.executor.v1.IDeleteUserInstanceConfigAction=} [properties] Properties to set - * @returns {google.spanner.executor.v1.DeleteUserInstanceConfigAction} DeleteUserInstanceConfigAction instance - */ - DeleteUserInstanceConfigAction.create = function create(properties) { - return new DeleteUserInstanceConfigAction(properties); - }; - - /** - * Encodes the specified DeleteUserInstanceConfigAction message. Does not implicitly {@link google.spanner.executor.v1.DeleteUserInstanceConfigAction.verify|verify} messages. - * @function encode - * @memberof google.spanner.executor.v1.DeleteUserInstanceConfigAction - * @static - * @param {google.spanner.executor.v1.IDeleteUserInstanceConfigAction} message DeleteUserInstanceConfigAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteUserInstanceConfigAction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.userConfigId != null && Object.hasOwnProperty.call(message, "userConfigId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.userConfigId); - if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.projectId); - return writer; - }; - - /** - * Encodes the specified DeleteUserInstanceConfigAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.DeleteUserInstanceConfigAction.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.executor.v1.DeleteUserInstanceConfigAction - * @static - * @param {google.spanner.executor.v1.IDeleteUserInstanceConfigAction} message DeleteUserInstanceConfigAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteUserInstanceConfigAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteUserInstanceConfigAction message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.executor.v1.DeleteUserInstanceConfigAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.executor.v1.DeleteUserInstanceConfigAction} DeleteUserInstanceConfigAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteUserInstanceConfigAction.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.DeleteUserInstanceConfigAction(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.userConfigId = reader.string(); - break; - } - case 2: { - message.projectId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteUserInstanceConfigAction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.executor.v1.DeleteUserInstanceConfigAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.executor.v1.DeleteUserInstanceConfigAction} DeleteUserInstanceConfigAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteUserInstanceConfigAction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteUserInstanceConfigAction message. - * @function verify - * @memberof google.spanner.executor.v1.DeleteUserInstanceConfigAction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteUserInstanceConfigAction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.userConfigId != null && message.hasOwnProperty("userConfigId")) - if (!$util.isString(message.userConfigId)) - return "userConfigId: string expected"; - if (message.projectId != null && message.hasOwnProperty("projectId")) - if (!$util.isString(message.projectId)) - return "projectId: string expected"; - return null; - }; - - /** - * Creates a DeleteUserInstanceConfigAction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.executor.v1.DeleteUserInstanceConfigAction - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.executor.v1.DeleteUserInstanceConfigAction} DeleteUserInstanceConfigAction - */ - DeleteUserInstanceConfigAction.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.executor.v1.DeleteUserInstanceConfigAction) - return object; - var message = new $root.google.spanner.executor.v1.DeleteUserInstanceConfigAction(); - if (object.userConfigId != null) - message.userConfigId = String(object.userConfigId); - if (object.projectId != null) - message.projectId = String(object.projectId); - return message; - }; - - /** - * Creates a plain object from a DeleteUserInstanceConfigAction message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.executor.v1.DeleteUserInstanceConfigAction - * @static - * @param {google.spanner.executor.v1.DeleteUserInstanceConfigAction} message DeleteUserInstanceConfigAction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteUserInstanceConfigAction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.userConfigId = ""; - object.projectId = ""; - } - if (message.userConfigId != null && message.hasOwnProperty("userConfigId")) - object.userConfigId = message.userConfigId; - if (message.projectId != null && message.hasOwnProperty("projectId")) - object.projectId = message.projectId; - return object; - }; - - /** - * Converts this DeleteUserInstanceConfigAction to JSON. - * @function toJSON - * @memberof google.spanner.executor.v1.DeleteUserInstanceConfigAction - * @instance - * @returns {Object.} JSON object - */ - DeleteUserInstanceConfigAction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteUserInstanceConfigAction - * @function getTypeUrl - * @memberof google.spanner.executor.v1.DeleteUserInstanceConfigAction - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteUserInstanceConfigAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.executor.v1.DeleteUserInstanceConfigAction"; - }; - - return DeleteUserInstanceConfigAction; - })(); - - v1.ListCloudInstanceConfigsAction = (function() { - - /** - * Properties of a ListCloudInstanceConfigsAction. - * @memberof google.spanner.executor.v1 - * @interface IListCloudInstanceConfigsAction - * @property {string|null} [projectId] ListCloudInstanceConfigsAction projectId - * @property {number|null} [pageSize] ListCloudInstanceConfigsAction pageSize - * @property {string|null} [pageToken] ListCloudInstanceConfigsAction pageToken - */ - - /** - * Constructs a new ListCloudInstanceConfigsAction. - * @memberof google.spanner.executor.v1 - * @classdesc Represents a ListCloudInstanceConfigsAction. - * @implements IListCloudInstanceConfigsAction - * @constructor - * @param {google.spanner.executor.v1.IListCloudInstanceConfigsAction=} [properties] Properties to set - */ - function ListCloudInstanceConfigsAction(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListCloudInstanceConfigsAction projectId. - * @member {string} projectId - * @memberof google.spanner.executor.v1.ListCloudInstanceConfigsAction - * @instance - */ - ListCloudInstanceConfigsAction.prototype.projectId = ""; - - /** - * ListCloudInstanceConfigsAction pageSize. - * @member {number|null|undefined} pageSize - * @memberof google.spanner.executor.v1.ListCloudInstanceConfigsAction - * @instance - */ - ListCloudInstanceConfigsAction.prototype.pageSize = null; - - /** - * ListCloudInstanceConfigsAction pageToken. - * @member {string|null|undefined} pageToken - * @memberof google.spanner.executor.v1.ListCloudInstanceConfigsAction - * @instance - */ - ListCloudInstanceConfigsAction.prototype.pageToken = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ListCloudInstanceConfigsAction.prototype, "_pageSize", { - get: $util.oneOfGetter($oneOfFields = ["pageSize"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ListCloudInstanceConfigsAction.prototype, "_pageToken", { - get: $util.oneOfGetter($oneOfFields = ["pageToken"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new ListCloudInstanceConfigsAction instance using the specified properties. - * @function create - * @memberof google.spanner.executor.v1.ListCloudInstanceConfigsAction - * @static - * @param {google.spanner.executor.v1.IListCloudInstanceConfigsAction=} [properties] Properties to set - * @returns {google.spanner.executor.v1.ListCloudInstanceConfigsAction} ListCloudInstanceConfigsAction instance - */ - ListCloudInstanceConfigsAction.create = function create(properties) { - return new ListCloudInstanceConfigsAction(properties); - }; - - /** - * Encodes the specified ListCloudInstanceConfigsAction message. Does not implicitly {@link google.spanner.executor.v1.ListCloudInstanceConfigsAction.verify|verify} messages. - * @function encode - * @memberof google.spanner.executor.v1.ListCloudInstanceConfigsAction - * @static - * @param {google.spanner.executor.v1.IListCloudInstanceConfigsAction} message ListCloudInstanceConfigsAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListCloudInstanceConfigsAction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - return writer; - }; - - /** - * Encodes the specified ListCloudInstanceConfigsAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.ListCloudInstanceConfigsAction.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.executor.v1.ListCloudInstanceConfigsAction - * @static - * @param {google.spanner.executor.v1.IListCloudInstanceConfigsAction} message ListCloudInstanceConfigsAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListCloudInstanceConfigsAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListCloudInstanceConfigsAction message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.executor.v1.ListCloudInstanceConfigsAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.executor.v1.ListCloudInstanceConfigsAction} ListCloudInstanceConfigsAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListCloudInstanceConfigsAction.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.ListCloudInstanceConfigsAction(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.projectId = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListCloudInstanceConfigsAction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.executor.v1.ListCloudInstanceConfigsAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.executor.v1.ListCloudInstanceConfigsAction} ListCloudInstanceConfigsAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListCloudInstanceConfigsAction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListCloudInstanceConfigsAction message. - * @function verify - * @memberof google.spanner.executor.v1.ListCloudInstanceConfigsAction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListCloudInstanceConfigsAction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.projectId != null && message.hasOwnProperty("projectId")) - if (!$util.isString(message.projectId)) - return "projectId: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) { - properties._pageSize = 1; - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - } - if (message.pageToken != null && message.hasOwnProperty("pageToken")) { - properties._pageToken = 1; - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - } - return null; - }; - - /** - * Creates a ListCloudInstanceConfigsAction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.executor.v1.ListCloudInstanceConfigsAction - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.executor.v1.ListCloudInstanceConfigsAction} ListCloudInstanceConfigsAction - */ - ListCloudInstanceConfigsAction.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.executor.v1.ListCloudInstanceConfigsAction) - return object; - var message = new $root.google.spanner.executor.v1.ListCloudInstanceConfigsAction(); - if (object.projectId != null) - message.projectId = String(object.projectId); - 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 ListCloudInstanceConfigsAction message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.executor.v1.ListCloudInstanceConfigsAction - * @static - * @param {google.spanner.executor.v1.ListCloudInstanceConfigsAction} message ListCloudInstanceConfigsAction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListCloudInstanceConfigsAction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.projectId = ""; - if (message.projectId != null && message.hasOwnProperty("projectId")) - object.projectId = message.projectId; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) { - object.pageSize = message.pageSize; - if (options.oneofs) - object._pageSize = "pageSize"; - } - if (message.pageToken != null && message.hasOwnProperty("pageToken")) { - object.pageToken = message.pageToken; - if (options.oneofs) - object._pageToken = "pageToken"; - } - return object; - }; - - /** - * Converts this ListCloudInstanceConfigsAction to JSON. - * @function toJSON - * @memberof google.spanner.executor.v1.ListCloudInstanceConfigsAction - * @instance - * @returns {Object.} JSON object - */ - ListCloudInstanceConfigsAction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListCloudInstanceConfigsAction - * @function getTypeUrl - * @memberof google.spanner.executor.v1.ListCloudInstanceConfigsAction - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListCloudInstanceConfigsAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.executor.v1.ListCloudInstanceConfigsAction"; - }; - - return ListCloudInstanceConfigsAction; - })(); - - v1.CreateCloudInstanceAction = (function() { - - /** - * Properties of a CreateCloudInstanceAction. - * @memberof google.spanner.executor.v1 - * @interface ICreateCloudInstanceAction - * @property {string|null} [instanceId] CreateCloudInstanceAction instanceId - * @property {string|null} [projectId] CreateCloudInstanceAction projectId - * @property {string|null} [instanceConfigId] CreateCloudInstanceAction instanceConfigId - * @property {number|null} [nodeCount] CreateCloudInstanceAction nodeCount - * @property {number|null} [processingUnits] CreateCloudInstanceAction processingUnits - * @property {google.spanner.admin.instance.v1.IAutoscalingConfig|null} [autoscalingConfig] CreateCloudInstanceAction autoscalingConfig - * @property {Object.|null} [labels] CreateCloudInstanceAction labels - */ - - /** - * Constructs a new CreateCloudInstanceAction. - * @memberof google.spanner.executor.v1 - * @classdesc Represents a CreateCloudInstanceAction. - * @implements ICreateCloudInstanceAction - * @constructor - * @param {google.spanner.executor.v1.ICreateCloudInstanceAction=} [properties] Properties to set - */ - function CreateCloudInstanceAction(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]]; - } - - /** - * CreateCloudInstanceAction instanceId. - * @member {string} instanceId - * @memberof google.spanner.executor.v1.CreateCloudInstanceAction - * @instance - */ - CreateCloudInstanceAction.prototype.instanceId = ""; - - /** - * CreateCloudInstanceAction projectId. - * @member {string} projectId - * @memberof google.spanner.executor.v1.CreateCloudInstanceAction - * @instance - */ - CreateCloudInstanceAction.prototype.projectId = ""; - - /** - * CreateCloudInstanceAction instanceConfigId. - * @member {string} instanceConfigId - * @memberof google.spanner.executor.v1.CreateCloudInstanceAction - * @instance - */ - CreateCloudInstanceAction.prototype.instanceConfigId = ""; - - /** - * CreateCloudInstanceAction nodeCount. - * @member {number|null|undefined} nodeCount - * @memberof google.spanner.executor.v1.CreateCloudInstanceAction - * @instance - */ - CreateCloudInstanceAction.prototype.nodeCount = null; - - /** - * CreateCloudInstanceAction processingUnits. - * @member {number|null|undefined} processingUnits - * @memberof google.spanner.executor.v1.CreateCloudInstanceAction - * @instance - */ - CreateCloudInstanceAction.prototype.processingUnits = null; - - /** - * CreateCloudInstanceAction autoscalingConfig. - * @member {google.spanner.admin.instance.v1.IAutoscalingConfig|null|undefined} autoscalingConfig - * @memberof google.spanner.executor.v1.CreateCloudInstanceAction - * @instance - */ - CreateCloudInstanceAction.prototype.autoscalingConfig = null; - - /** - * CreateCloudInstanceAction labels. - * @member {Object.} labels - * @memberof google.spanner.executor.v1.CreateCloudInstanceAction - * @instance - */ - CreateCloudInstanceAction.prototype.labels = $util.emptyObject; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(CreateCloudInstanceAction.prototype, "_nodeCount", { - get: $util.oneOfGetter($oneOfFields = ["nodeCount"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(CreateCloudInstanceAction.prototype, "_processingUnits", { - get: $util.oneOfGetter($oneOfFields = ["processingUnits"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(CreateCloudInstanceAction.prototype, "_autoscalingConfig", { - get: $util.oneOfGetter($oneOfFields = ["autoscalingConfig"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new CreateCloudInstanceAction instance using the specified properties. - * @function create - * @memberof google.spanner.executor.v1.CreateCloudInstanceAction - * @static - * @param {google.spanner.executor.v1.ICreateCloudInstanceAction=} [properties] Properties to set - * @returns {google.spanner.executor.v1.CreateCloudInstanceAction} CreateCloudInstanceAction instance - */ - CreateCloudInstanceAction.create = function create(properties) { - return new CreateCloudInstanceAction(properties); - }; - - /** - * Encodes the specified CreateCloudInstanceAction message. Does not implicitly {@link google.spanner.executor.v1.CreateCloudInstanceAction.verify|verify} messages. - * @function encode - * @memberof google.spanner.executor.v1.CreateCloudInstanceAction - * @static - * @param {google.spanner.executor.v1.ICreateCloudInstanceAction} message CreateCloudInstanceAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateCloudInstanceAction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.instanceId); - if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.projectId); - if (message.instanceConfigId != null && Object.hasOwnProperty.call(message, "instanceConfigId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.instanceConfigId); - if (message.nodeCount != null && Object.hasOwnProperty.call(message, "nodeCount")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.nodeCount); - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.processingUnits != null && Object.hasOwnProperty.call(message, "processingUnits")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.processingUnits); - if (message.autoscalingConfig != null && Object.hasOwnProperty.call(message, "autoscalingConfig")) - $root.google.spanner.admin.instance.v1.AutoscalingConfig.encode(message.autoscalingConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CreateCloudInstanceAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.CreateCloudInstanceAction.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.executor.v1.CreateCloudInstanceAction - * @static - * @param {google.spanner.executor.v1.ICreateCloudInstanceAction} message CreateCloudInstanceAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateCloudInstanceAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateCloudInstanceAction message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.executor.v1.CreateCloudInstanceAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.executor.v1.CreateCloudInstanceAction} CreateCloudInstanceAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateCloudInstanceAction.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.CreateCloudInstanceAction(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.instanceId = reader.string(); - break; - } - case 2: { - message.projectId = reader.string(); - break; - } - case 3: { - message.instanceConfigId = reader.string(); - break; - } - case 4: { - message.nodeCount = reader.int32(); - break; - } - case 6: { - message.processingUnits = reader.int32(); - break; - } - case 7: { - message.autoscalingConfig = $root.google.spanner.admin.instance.v1.AutoscalingConfig.decode(reader, reader.uint32()); - break; - } - case 5: { - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.labels[key] = value; - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateCloudInstanceAction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.executor.v1.CreateCloudInstanceAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.executor.v1.CreateCloudInstanceAction} CreateCloudInstanceAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateCloudInstanceAction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateCloudInstanceAction message. - * @function verify - * @memberof google.spanner.executor.v1.CreateCloudInstanceAction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateCloudInstanceAction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.instanceId != null && message.hasOwnProperty("instanceId")) - if (!$util.isString(message.instanceId)) - return "instanceId: string expected"; - if (message.projectId != null && message.hasOwnProperty("projectId")) - if (!$util.isString(message.projectId)) - return "projectId: string expected"; - if (message.instanceConfigId != null && message.hasOwnProperty("instanceConfigId")) - if (!$util.isString(message.instanceConfigId)) - return "instanceConfigId: string expected"; - if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) { - properties._nodeCount = 1; - if (!$util.isInteger(message.nodeCount)) - return "nodeCount: integer expected"; - } - if (message.processingUnits != null && message.hasOwnProperty("processingUnits")) { - properties._processingUnits = 1; - if (!$util.isInteger(message.processingUnits)) - return "processingUnits: integer expected"; - } - if (message.autoscalingConfig != null && message.hasOwnProperty("autoscalingConfig")) { - properties._autoscalingConfig = 1; - { - var error = $root.google.spanner.admin.instance.v1.AutoscalingConfig.verify(message.autoscalingConfig); - if (error) - return "autoscalingConfig." + error; - } - } - 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 CreateCloudInstanceAction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.executor.v1.CreateCloudInstanceAction - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.executor.v1.CreateCloudInstanceAction} CreateCloudInstanceAction - */ - CreateCloudInstanceAction.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.executor.v1.CreateCloudInstanceAction) - return object; - var message = new $root.google.spanner.executor.v1.CreateCloudInstanceAction(); - if (object.instanceId != null) - message.instanceId = String(object.instanceId); - if (object.projectId != null) - message.projectId = String(object.projectId); - if (object.instanceConfigId != null) - message.instanceConfigId = String(object.instanceConfigId); - if (object.nodeCount != null) - message.nodeCount = object.nodeCount | 0; - if (object.processingUnits != null) - message.processingUnits = object.processingUnits | 0; - if (object.autoscalingConfig != null) { - if (typeof object.autoscalingConfig !== "object") - throw TypeError(".google.spanner.executor.v1.CreateCloudInstanceAction.autoscalingConfig: object expected"); - message.autoscalingConfig = $root.google.spanner.admin.instance.v1.AutoscalingConfig.fromObject(object.autoscalingConfig); - } - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.spanner.executor.v1.CreateCloudInstanceAction.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 CreateCloudInstanceAction message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.executor.v1.CreateCloudInstanceAction - * @static - * @param {google.spanner.executor.v1.CreateCloudInstanceAction} message CreateCloudInstanceAction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateCloudInstanceAction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.labels = {}; - if (options.defaults) { - object.instanceId = ""; - object.projectId = ""; - object.instanceConfigId = ""; - } - if (message.instanceId != null && message.hasOwnProperty("instanceId")) - object.instanceId = message.instanceId; - if (message.projectId != null && message.hasOwnProperty("projectId")) - object.projectId = message.projectId; - if (message.instanceConfigId != null && message.hasOwnProperty("instanceConfigId")) - object.instanceConfigId = message.instanceConfigId; - if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) { - object.nodeCount = message.nodeCount; - if (options.oneofs) - object._nodeCount = "nodeCount"; - } - 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.processingUnits != null && message.hasOwnProperty("processingUnits")) { - object.processingUnits = message.processingUnits; - if (options.oneofs) - object._processingUnits = "processingUnits"; - } - if (message.autoscalingConfig != null && message.hasOwnProperty("autoscalingConfig")) { - object.autoscalingConfig = $root.google.spanner.admin.instance.v1.AutoscalingConfig.toObject(message.autoscalingConfig, options); - if (options.oneofs) - object._autoscalingConfig = "autoscalingConfig"; - } - return object; - }; - - /** - * Converts this CreateCloudInstanceAction to JSON. - * @function toJSON - * @memberof google.spanner.executor.v1.CreateCloudInstanceAction - * @instance - * @returns {Object.} JSON object - */ - CreateCloudInstanceAction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateCloudInstanceAction - * @function getTypeUrl - * @memberof google.spanner.executor.v1.CreateCloudInstanceAction - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateCloudInstanceAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.executor.v1.CreateCloudInstanceAction"; - }; - - return CreateCloudInstanceAction; - })(); - - v1.UpdateCloudInstanceAction = (function() { - - /** - * Properties of an UpdateCloudInstanceAction. - * @memberof google.spanner.executor.v1 - * @interface IUpdateCloudInstanceAction - * @property {string|null} [instanceId] UpdateCloudInstanceAction instanceId - * @property {string|null} [projectId] UpdateCloudInstanceAction projectId - * @property {string|null} [displayName] UpdateCloudInstanceAction displayName - * @property {number|null} [nodeCount] UpdateCloudInstanceAction nodeCount - * @property {number|null} [processingUnits] UpdateCloudInstanceAction processingUnits - * @property {google.spanner.admin.instance.v1.IAutoscalingConfig|null} [autoscalingConfig] UpdateCloudInstanceAction autoscalingConfig - * @property {Object.|null} [labels] UpdateCloudInstanceAction labels - */ - - /** - * Constructs a new UpdateCloudInstanceAction. - * @memberof google.spanner.executor.v1 - * @classdesc Represents an UpdateCloudInstanceAction. - * @implements IUpdateCloudInstanceAction - * @constructor - * @param {google.spanner.executor.v1.IUpdateCloudInstanceAction=} [properties] Properties to set - */ - function UpdateCloudInstanceAction(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]]; - } - - /** - * UpdateCloudInstanceAction instanceId. - * @member {string} instanceId - * @memberof google.spanner.executor.v1.UpdateCloudInstanceAction - * @instance - */ - UpdateCloudInstanceAction.prototype.instanceId = ""; - - /** - * UpdateCloudInstanceAction projectId. - * @member {string} projectId - * @memberof google.spanner.executor.v1.UpdateCloudInstanceAction - * @instance - */ - UpdateCloudInstanceAction.prototype.projectId = ""; - - /** - * UpdateCloudInstanceAction displayName. - * @member {string|null|undefined} displayName - * @memberof google.spanner.executor.v1.UpdateCloudInstanceAction - * @instance - */ - UpdateCloudInstanceAction.prototype.displayName = null; - - /** - * UpdateCloudInstanceAction nodeCount. - * @member {number|null|undefined} nodeCount - * @memberof google.spanner.executor.v1.UpdateCloudInstanceAction - * @instance - */ - UpdateCloudInstanceAction.prototype.nodeCount = null; - - /** - * UpdateCloudInstanceAction processingUnits. - * @member {number|null|undefined} processingUnits - * @memberof google.spanner.executor.v1.UpdateCloudInstanceAction - * @instance - */ - UpdateCloudInstanceAction.prototype.processingUnits = null; - - /** - * UpdateCloudInstanceAction autoscalingConfig. - * @member {google.spanner.admin.instance.v1.IAutoscalingConfig|null|undefined} autoscalingConfig - * @memberof google.spanner.executor.v1.UpdateCloudInstanceAction - * @instance - */ - UpdateCloudInstanceAction.prototype.autoscalingConfig = null; - - /** - * UpdateCloudInstanceAction labels. - * @member {Object.} labels - * @memberof google.spanner.executor.v1.UpdateCloudInstanceAction - * @instance - */ - UpdateCloudInstanceAction.prototype.labels = $util.emptyObject; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(UpdateCloudInstanceAction.prototype, "_displayName", { - get: $util.oneOfGetter($oneOfFields = ["displayName"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(UpdateCloudInstanceAction.prototype, "_nodeCount", { - get: $util.oneOfGetter($oneOfFields = ["nodeCount"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(UpdateCloudInstanceAction.prototype, "_processingUnits", { - get: $util.oneOfGetter($oneOfFields = ["processingUnits"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(UpdateCloudInstanceAction.prototype, "_autoscalingConfig", { - get: $util.oneOfGetter($oneOfFields = ["autoscalingConfig"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new UpdateCloudInstanceAction instance using the specified properties. - * @function create - * @memberof google.spanner.executor.v1.UpdateCloudInstanceAction - * @static - * @param {google.spanner.executor.v1.IUpdateCloudInstanceAction=} [properties] Properties to set - * @returns {google.spanner.executor.v1.UpdateCloudInstanceAction} UpdateCloudInstanceAction instance - */ - UpdateCloudInstanceAction.create = function create(properties) { - return new UpdateCloudInstanceAction(properties); - }; - - /** - * Encodes the specified UpdateCloudInstanceAction message. Does not implicitly {@link google.spanner.executor.v1.UpdateCloudInstanceAction.verify|verify} messages. - * @function encode - * @memberof google.spanner.executor.v1.UpdateCloudInstanceAction - * @static - * @param {google.spanner.executor.v1.IUpdateCloudInstanceAction} message UpdateCloudInstanceAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateCloudInstanceAction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.instanceId); - if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.projectId); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.displayName); - if (message.nodeCount != null && Object.hasOwnProperty.call(message, "nodeCount")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.nodeCount); - if (message.processingUnits != null && Object.hasOwnProperty.call(message, "processingUnits")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.processingUnits); - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.autoscalingConfig != null && Object.hasOwnProperty.call(message, "autoscalingConfig")) - $root.google.spanner.admin.instance.v1.AutoscalingConfig.encode(message.autoscalingConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified UpdateCloudInstanceAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.UpdateCloudInstanceAction.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.executor.v1.UpdateCloudInstanceAction - * @static - * @param {google.spanner.executor.v1.IUpdateCloudInstanceAction} message UpdateCloudInstanceAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateCloudInstanceAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateCloudInstanceAction message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.executor.v1.UpdateCloudInstanceAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.executor.v1.UpdateCloudInstanceAction} UpdateCloudInstanceAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateCloudInstanceAction.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.UpdateCloudInstanceAction(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.instanceId = reader.string(); - break; - } - case 2: { - message.projectId = reader.string(); - break; - } - case 3: { - message.displayName = reader.string(); - break; - } - case 4: { - message.nodeCount = reader.int32(); - break; - } - case 5: { - message.processingUnits = reader.int32(); - break; - } - case 7: { - message.autoscalingConfig = $root.google.spanner.admin.instance.v1.AutoscalingConfig.decode(reader, reader.uint32()); - break; - } - case 6: { - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.labels[key] = value; - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateCloudInstanceAction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.executor.v1.UpdateCloudInstanceAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.executor.v1.UpdateCloudInstanceAction} UpdateCloudInstanceAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateCloudInstanceAction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateCloudInstanceAction message. - * @function verify - * @memberof google.spanner.executor.v1.UpdateCloudInstanceAction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateCloudInstanceAction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.instanceId != null && message.hasOwnProperty("instanceId")) - if (!$util.isString(message.instanceId)) - return "instanceId: string expected"; - if (message.projectId != null && message.hasOwnProperty("projectId")) - if (!$util.isString(message.projectId)) - return "projectId: string expected"; - if (message.displayName != null && message.hasOwnProperty("displayName")) { - properties._displayName = 1; - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - } - if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) { - properties._nodeCount = 1; - if (!$util.isInteger(message.nodeCount)) - return "nodeCount: integer expected"; - } - if (message.processingUnits != null && message.hasOwnProperty("processingUnits")) { - properties._processingUnits = 1; - if (!$util.isInteger(message.processingUnits)) - return "processingUnits: integer expected"; - } - if (message.autoscalingConfig != null && message.hasOwnProperty("autoscalingConfig")) { - properties._autoscalingConfig = 1; - { - var error = $root.google.spanner.admin.instance.v1.AutoscalingConfig.verify(message.autoscalingConfig); - if (error) - return "autoscalingConfig." + error; - } - } - 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 UpdateCloudInstanceAction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.executor.v1.UpdateCloudInstanceAction - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.executor.v1.UpdateCloudInstanceAction} UpdateCloudInstanceAction - */ - UpdateCloudInstanceAction.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.executor.v1.UpdateCloudInstanceAction) - return object; - var message = new $root.google.spanner.executor.v1.UpdateCloudInstanceAction(); - if (object.instanceId != null) - message.instanceId = String(object.instanceId); - if (object.projectId != null) - message.projectId = String(object.projectId); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.nodeCount != null) - message.nodeCount = object.nodeCount | 0; - if (object.processingUnits != null) - message.processingUnits = object.processingUnits | 0; - if (object.autoscalingConfig != null) { - if (typeof object.autoscalingConfig !== "object") - throw TypeError(".google.spanner.executor.v1.UpdateCloudInstanceAction.autoscalingConfig: object expected"); - message.autoscalingConfig = $root.google.spanner.admin.instance.v1.AutoscalingConfig.fromObject(object.autoscalingConfig); - } - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.spanner.executor.v1.UpdateCloudInstanceAction.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 UpdateCloudInstanceAction message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.executor.v1.UpdateCloudInstanceAction - * @static - * @param {google.spanner.executor.v1.UpdateCloudInstanceAction} message UpdateCloudInstanceAction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateCloudInstanceAction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.labels = {}; - if (options.defaults) { - object.instanceId = ""; - object.projectId = ""; - } - if (message.instanceId != null && message.hasOwnProperty("instanceId")) - object.instanceId = message.instanceId; - if (message.projectId != null && message.hasOwnProperty("projectId")) - object.projectId = message.projectId; - if (message.displayName != null && message.hasOwnProperty("displayName")) { - object.displayName = message.displayName; - if (options.oneofs) - object._displayName = "displayName"; - } - if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) { - object.nodeCount = message.nodeCount; - if (options.oneofs) - object._nodeCount = "nodeCount"; - } - if (message.processingUnits != null && message.hasOwnProperty("processingUnits")) { - object.processingUnits = message.processingUnits; - if (options.oneofs) - object._processingUnits = "processingUnits"; - } - 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.autoscalingConfig != null && message.hasOwnProperty("autoscalingConfig")) { - object.autoscalingConfig = $root.google.spanner.admin.instance.v1.AutoscalingConfig.toObject(message.autoscalingConfig, options); - if (options.oneofs) - object._autoscalingConfig = "autoscalingConfig"; - } - return object; - }; - - /** - * Converts this UpdateCloudInstanceAction to JSON. - * @function toJSON - * @memberof google.spanner.executor.v1.UpdateCloudInstanceAction - * @instance - * @returns {Object.} JSON object - */ - UpdateCloudInstanceAction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateCloudInstanceAction - * @function getTypeUrl - * @memberof google.spanner.executor.v1.UpdateCloudInstanceAction - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateCloudInstanceAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.executor.v1.UpdateCloudInstanceAction"; - }; - - return UpdateCloudInstanceAction; - })(); - - v1.DeleteCloudInstanceAction = (function() { - - /** - * Properties of a DeleteCloudInstanceAction. - * @memberof google.spanner.executor.v1 - * @interface IDeleteCloudInstanceAction - * @property {string|null} [instanceId] DeleteCloudInstanceAction instanceId - * @property {string|null} [projectId] DeleteCloudInstanceAction projectId - */ - - /** - * Constructs a new DeleteCloudInstanceAction. - * @memberof google.spanner.executor.v1 - * @classdesc Represents a DeleteCloudInstanceAction. - * @implements IDeleteCloudInstanceAction - * @constructor - * @param {google.spanner.executor.v1.IDeleteCloudInstanceAction=} [properties] Properties to set - */ - function DeleteCloudInstanceAction(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteCloudInstanceAction instanceId. - * @member {string} instanceId - * @memberof google.spanner.executor.v1.DeleteCloudInstanceAction - * @instance - */ - DeleteCloudInstanceAction.prototype.instanceId = ""; - - /** - * DeleteCloudInstanceAction projectId. - * @member {string} projectId - * @memberof google.spanner.executor.v1.DeleteCloudInstanceAction - * @instance - */ - DeleteCloudInstanceAction.prototype.projectId = ""; - - /** - * Creates a new DeleteCloudInstanceAction instance using the specified properties. - * @function create - * @memberof google.spanner.executor.v1.DeleteCloudInstanceAction - * @static - * @param {google.spanner.executor.v1.IDeleteCloudInstanceAction=} [properties] Properties to set - * @returns {google.spanner.executor.v1.DeleteCloudInstanceAction} DeleteCloudInstanceAction instance - */ - DeleteCloudInstanceAction.create = function create(properties) { - return new DeleteCloudInstanceAction(properties); - }; - - /** - * Encodes the specified DeleteCloudInstanceAction message. Does not implicitly {@link google.spanner.executor.v1.DeleteCloudInstanceAction.verify|verify} messages. - * @function encode - * @memberof google.spanner.executor.v1.DeleteCloudInstanceAction - * @static - * @param {google.spanner.executor.v1.IDeleteCloudInstanceAction} message DeleteCloudInstanceAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteCloudInstanceAction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.instanceId); - if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.projectId); - return writer; - }; - - /** - * Encodes the specified DeleteCloudInstanceAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.DeleteCloudInstanceAction.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.executor.v1.DeleteCloudInstanceAction - * @static - * @param {google.spanner.executor.v1.IDeleteCloudInstanceAction} message DeleteCloudInstanceAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteCloudInstanceAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteCloudInstanceAction message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.executor.v1.DeleteCloudInstanceAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.executor.v1.DeleteCloudInstanceAction} DeleteCloudInstanceAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteCloudInstanceAction.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.DeleteCloudInstanceAction(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.instanceId = reader.string(); - break; - } - case 2: { - message.projectId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteCloudInstanceAction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.executor.v1.DeleteCloudInstanceAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.executor.v1.DeleteCloudInstanceAction} DeleteCloudInstanceAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteCloudInstanceAction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteCloudInstanceAction message. - * @function verify - * @memberof google.spanner.executor.v1.DeleteCloudInstanceAction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteCloudInstanceAction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.instanceId != null && message.hasOwnProperty("instanceId")) - if (!$util.isString(message.instanceId)) - return "instanceId: string expected"; - if (message.projectId != null && message.hasOwnProperty("projectId")) - if (!$util.isString(message.projectId)) - return "projectId: string expected"; - return null; - }; - - /** - * Creates a DeleteCloudInstanceAction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.executor.v1.DeleteCloudInstanceAction - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.executor.v1.DeleteCloudInstanceAction} DeleteCloudInstanceAction - */ - DeleteCloudInstanceAction.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.executor.v1.DeleteCloudInstanceAction) - return object; - var message = new $root.google.spanner.executor.v1.DeleteCloudInstanceAction(); - if (object.instanceId != null) - message.instanceId = String(object.instanceId); - if (object.projectId != null) - message.projectId = String(object.projectId); - return message; - }; - - /** - * Creates a plain object from a DeleteCloudInstanceAction message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.executor.v1.DeleteCloudInstanceAction - * @static - * @param {google.spanner.executor.v1.DeleteCloudInstanceAction} message DeleteCloudInstanceAction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteCloudInstanceAction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.instanceId = ""; - object.projectId = ""; - } - if (message.instanceId != null && message.hasOwnProperty("instanceId")) - object.instanceId = message.instanceId; - if (message.projectId != null && message.hasOwnProperty("projectId")) - object.projectId = message.projectId; - return object; - }; - - /** - * Converts this DeleteCloudInstanceAction to JSON. - * @function toJSON - * @memberof google.spanner.executor.v1.DeleteCloudInstanceAction - * @instance - * @returns {Object.} JSON object - */ - DeleteCloudInstanceAction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteCloudInstanceAction - * @function getTypeUrl - * @memberof google.spanner.executor.v1.DeleteCloudInstanceAction - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteCloudInstanceAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.executor.v1.DeleteCloudInstanceAction"; - }; - - return DeleteCloudInstanceAction; - })(); - - v1.CreateCloudDatabaseAction = (function() { - - /** - * Properties of a CreateCloudDatabaseAction. - * @memberof google.spanner.executor.v1 - * @interface ICreateCloudDatabaseAction - * @property {string|null} [instanceId] CreateCloudDatabaseAction instanceId - * @property {string|null} [projectId] CreateCloudDatabaseAction projectId - * @property {string|null} [databaseId] CreateCloudDatabaseAction databaseId - * @property {Array.|null} [sdlStatement] CreateCloudDatabaseAction sdlStatement - * @property {google.spanner.admin.database.v1.IEncryptionConfig|null} [encryptionConfig] CreateCloudDatabaseAction encryptionConfig - * @property {string|null} [dialect] CreateCloudDatabaseAction dialect - * @property {Uint8Array|null} [protoDescriptors] CreateCloudDatabaseAction protoDescriptors - */ - - /** - * Constructs a new CreateCloudDatabaseAction. - * @memberof google.spanner.executor.v1 - * @classdesc Represents a CreateCloudDatabaseAction. - * @implements ICreateCloudDatabaseAction - * @constructor - * @param {google.spanner.executor.v1.ICreateCloudDatabaseAction=} [properties] Properties to set - */ - function CreateCloudDatabaseAction(properties) { - this.sdlStatement = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateCloudDatabaseAction instanceId. - * @member {string} instanceId - * @memberof google.spanner.executor.v1.CreateCloudDatabaseAction - * @instance - */ - CreateCloudDatabaseAction.prototype.instanceId = ""; - - /** - * CreateCloudDatabaseAction projectId. - * @member {string} projectId - * @memberof google.spanner.executor.v1.CreateCloudDatabaseAction - * @instance - */ - CreateCloudDatabaseAction.prototype.projectId = ""; - - /** - * CreateCloudDatabaseAction databaseId. - * @member {string} databaseId - * @memberof google.spanner.executor.v1.CreateCloudDatabaseAction - * @instance - */ - CreateCloudDatabaseAction.prototype.databaseId = ""; - - /** - * CreateCloudDatabaseAction sdlStatement. - * @member {Array.} sdlStatement - * @memberof google.spanner.executor.v1.CreateCloudDatabaseAction - * @instance - */ - CreateCloudDatabaseAction.prototype.sdlStatement = $util.emptyArray; - - /** - * CreateCloudDatabaseAction encryptionConfig. - * @member {google.spanner.admin.database.v1.IEncryptionConfig|null|undefined} encryptionConfig - * @memberof google.spanner.executor.v1.CreateCloudDatabaseAction - * @instance - */ - CreateCloudDatabaseAction.prototype.encryptionConfig = null; - - /** - * CreateCloudDatabaseAction dialect. - * @member {string|null|undefined} dialect - * @memberof google.spanner.executor.v1.CreateCloudDatabaseAction - * @instance - */ - CreateCloudDatabaseAction.prototype.dialect = null; - - /** - * CreateCloudDatabaseAction protoDescriptors. - * @member {Uint8Array|null|undefined} protoDescriptors - * @memberof google.spanner.executor.v1.CreateCloudDatabaseAction - * @instance - */ - CreateCloudDatabaseAction.prototype.protoDescriptors = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(CreateCloudDatabaseAction.prototype, "_dialect", { - get: $util.oneOfGetter($oneOfFields = ["dialect"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(CreateCloudDatabaseAction.prototype, "_protoDescriptors", { - get: $util.oneOfGetter($oneOfFields = ["protoDescriptors"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new CreateCloudDatabaseAction instance using the specified properties. - * @function create - * @memberof google.spanner.executor.v1.CreateCloudDatabaseAction - * @static - * @param {google.spanner.executor.v1.ICreateCloudDatabaseAction=} [properties] Properties to set - * @returns {google.spanner.executor.v1.CreateCloudDatabaseAction} CreateCloudDatabaseAction instance - */ - CreateCloudDatabaseAction.create = function create(properties) { - return new CreateCloudDatabaseAction(properties); - }; - - /** - * Encodes the specified CreateCloudDatabaseAction message. Does not implicitly {@link google.spanner.executor.v1.CreateCloudDatabaseAction.verify|verify} messages. - * @function encode - * @memberof google.spanner.executor.v1.CreateCloudDatabaseAction - * @static - * @param {google.spanner.executor.v1.ICreateCloudDatabaseAction} message CreateCloudDatabaseAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateCloudDatabaseAction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.instanceId); - if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.projectId); - if (message.databaseId != null && Object.hasOwnProperty.call(message, "databaseId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.databaseId); - if (message.sdlStatement != null && message.sdlStatement.length) - for (var i = 0; i < message.sdlStatement.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.sdlStatement[i]); - if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) - $root.google.spanner.admin.database.v1.EncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.dialect != null && Object.hasOwnProperty.call(message, "dialect")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.dialect); - if (message.protoDescriptors != null && Object.hasOwnProperty.call(message, "protoDescriptors")) - writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.protoDescriptors); - return writer; - }; - - /** - * Encodes the specified CreateCloudDatabaseAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.CreateCloudDatabaseAction.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.executor.v1.CreateCloudDatabaseAction - * @static - * @param {google.spanner.executor.v1.ICreateCloudDatabaseAction} message CreateCloudDatabaseAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateCloudDatabaseAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateCloudDatabaseAction message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.executor.v1.CreateCloudDatabaseAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.executor.v1.CreateCloudDatabaseAction} CreateCloudDatabaseAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateCloudDatabaseAction.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.CreateCloudDatabaseAction(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.instanceId = reader.string(); - break; - } - case 2: { - message.projectId = reader.string(); - break; - } - case 3: { - message.databaseId = reader.string(); - break; - } - case 4: { - if (!(message.sdlStatement && message.sdlStatement.length)) - message.sdlStatement = []; - message.sdlStatement.push(reader.string()); - break; - } - case 5: { - message.encryptionConfig = $root.google.spanner.admin.database.v1.EncryptionConfig.decode(reader, reader.uint32()); - break; - } - case 6: { - message.dialect = reader.string(); - break; - } - case 7: { - message.protoDescriptors = reader.bytes(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateCloudDatabaseAction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.executor.v1.CreateCloudDatabaseAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.executor.v1.CreateCloudDatabaseAction} CreateCloudDatabaseAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateCloudDatabaseAction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateCloudDatabaseAction message. - * @function verify - * @memberof google.spanner.executor.v1.CreateCloudDatabaseAction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateCloudDatabaseAction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.instanceId != null && message.hasOwnProperty("instanceId")) - if (!$util.isString(message.instanceId)) - return "instanceId: string expected"; - if (message.projectId != null && message.hasOwnProperty("projectId")) - if (!$util.isString(message.projectId)) - return "projectId: string expected"; - if (message.databaseId != null && message.hasOwnProperty("databaseId")) - if (!$util.isString(message.databaseId)) - return "databaseId: string expected"; - if (message.sdlStatement != null && message.hasOwnProperty("sdlStatement")) { - if (!Array.isArray(message.sdlStatement)) - return "sdlStatement: array expected"; - for (var i = 0; i < message.sdlStatement.length; ++i) - if (!$util.isString(message.sdlStatement[i])) - return "sdlStatement: string[] expected"; - } - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { - var error = $root.google.spanner.admin.database.v1.EncryptionConfig.verify(message.encryptionConfig); - if (error) - return "encryptionConfig." + error; - } - if (message.dialect != null && message.hasOwnProperty("dialect")) { - properties._dialect = 1; - if (!$util.isString(message.dialect)) - return "dialect: string expected"; - } - if (message.protoDescriptors != null && message.hasOwnProperty("protoDescriptors")) { - properties._protoDescriptors = 1; - if (!(message.protoDescriptors && typeof message.protoDescriptors.length === "number" || $util.isString(message.protoDescriptors))) - return "protoDescriptors: buffer expected"; - } - return null; - }; - - /** - * Creates a CreateCloudDatabaseAction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.executor.v1.CreateCloudDatabaseAction - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.executor.v1.CreateCloudDatabaseAction} CreateCloudDatabaseAction - */ - CreateCloudDatabaseAction.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.executor.v1.CreateCloudDatabaseAction) - return object; - var message = new $root.google.spanner.executor.v1.CreateCloudDatabaseAction(); - if (object.instanceId != null) - message.instanceId = String(object.instanceId); - if (object.projectId != null) - message.projectId = String(object.projectId); - if (object.databaseId != null) - message.databaseId = String(object.databaseId); - if (object.sdlStatement) { - if (!Array.isArray(object.sdlStatement)) - throw TypeError(".google.spanner.executor.v1.CreateCloudDatabaseAction.sdlStatement: array expected"); - message.sdlStatement = []; - for (var i = 0; i < object.sdlStatement.length; ++i) - message.sdlStatement[i] = String(object.sdlStatement[i]); - } - if (object.encryptionConfig != null) { - if (typeof object.encryptionConfig !== "object") - throw TypeError(".google.spanner.executor.v1.CreateCloudDatabaseAction.encryptionConfig: object expected"); - message.encryptionConfig = $root.google.spanner.admin.database.v1.EncryptionConfig.fromObject(object.encryptionConfig); - } - if (object.dialect != null) - message.dialect = String(object.dialect); - if (object.protoDescriptors != null) - if (typeof object.protoDescriptors === "string") - $util.base64.decode(object.protoDescriptors, message.protoDescriptors = $util.newBuffer($util.base64.length(object.protoDescriptors)), 0); - else if (object.protoDescriptors.length >= 0) - message.protoDescriptors = object.protoDescriptors; - return message; - }; - - /** - * Creates a plain object from a CreateCloudDatabaseAction message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.executor.v1.CreateCloudDatabaseAction - * @static - * @param {google.spanner.executor.v1.CreateCloudDatabaseAction} message CreateCloudDatabaseAction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateCloudDatabaseAction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.sdlStatement = []; - if (options.defaults) { - object.instanceId = ""; - object.projectId = ""; - object.databaseId = ""; - object.encryptionConfig = null; - } - if (message.instanceId != null && message.hasOwnProperty("instanceId")) - object.instanceId = message.instanceId; - if (message.projectId != null && message.hasOwnProperty("projectId")) - object.projectId = message.projectId; - if (message.databaseId != null && message.hasOwnProperty("databaseId")) - object.databaseId = message.databaseId; - if (message.sdlStatement && message.sdlStatement.length) { - object.sdlStatement = []; - for (var j = 0; j < message.sdlStatement.length; ++j) - object.sdlStatement[j] = message.sdlStatement[j]; - } - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) - object.encryptionConfig = $root.google.spanner.admin.database.v1.EncryptionConfig.toObject(message.encryptionConfig, options); - if (message.dialect != null && message.hasOwnProperty("dialect")) { - object.dialect = message.dialect; - if (options.oneofs) - object._dialect = "dialect"; - } - if (message.protoDescriptors != null && message.hasOwnProperty("protoDescriptors")) { - object.protoDescriptors = options.bytes === String ? $util.base64.encode(message.protoDescriptors, 0, message.protoDescriptors.length) : options.bytes === Array ? Array.prototype.slice.call(message.protoDescriptors) : message.protoDescriptors; - if (options.oneofs) - object._protoDescriptors = "protoDescriptors"; - } - return object; - }; - - /** - * Converts this CreateCloudDatabaseAction to JSON. - * @function toJSON - * @memberof google.spanner.executor.v1.CreateCloudDatabaseAction - * @instance - * @returns {Object.} JSON object - */ - CreateCloudDatabaseAction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateCloudDatabaseAction - * @function getTypeUrl - * @memberof google.spanner.executor.v1.CreateCloudDatabaseAction - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateCloudDatabaseAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.executor.v1.CreateCloudDatabaseAction"; - }; - - return CreateCloudDatabaseAction; - })(); - - v1.UpdateCloudDatabaseDdlAction = (function() { - - /** - * Properties of an UpdateCloudDatabaseDdlAction. - * @memberof google.spanner.executor.v1 - * @interface IUpdateCloudDatabaseDdlAction - * @property {string|null} [instanceId] UpdateCloudDatabaseDdlAction instanceId - * @property {string|null} [projectId] UpdateCloudDatabaseDdlAction projectId - * @property {string|null} [databaseId] UpdateCloudDatabaseDdlAction databaseId - * @property {Array.|null} [sdlStatement] UpdateCloudDatabaseDdlAction sdlStatement - * @property {string|null} [operationId] UpdateCloudDatabaseDdlAction operationId - * @property {Uint8Array|null} [protoDescriptors] UpdateCloudDatabaseDdlAction protoDescriptors - */ - - /** - * Constructs a new UpdateCloudDatabaseDdlAction. - * @memberof google.spanner.executor.v1 - * @classdesc Represents an UpdateCloudDatabaseDdlAction. - * @implements IUpdateCloudDatabaseDdlAction - * @constructor - * @param {google.spanner.executor.v1.IUpdateCloudDatabaseDdlAction=} [properties] Properties to set - */ - function UpdateCloudDatabaseDdlAction(properties) { - this.sdlStatement = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateCloudDatabaseDdlAction instanceId. - * @member {string} instanceId - * @memberof google.spanner.executor.v1.UpdateCloudDatabaseDdlAction - * @instance - */ - UpdateCloudDatabaseDdlAction.prototype.instanceId = ""; - - /** - * UpdateCloudDatabaseDdlAction projectId. - * @member {string} projectId - * @memberof google.spanner.executor.v1.UpdateCloudDatabaseDdlAction - * @instance - */ - UpdateCloudDatabaseDdlAction.prototype.projectId = ""; - - /** - * UpdateCloudDatabaseDdlAction databaseId. - * @member {string} databaseId - * @memberof google.spanner.executor.v1.UpdateCloudDatabaseDdlAction - * @instance - */ - UpdateCloudDatabaseDdlAction.prototype.databaseId = ""; - - /** - * UpdateCloudDatabaseDdlAction sdlStatement. - * @member {Array.} sdlStatement - * @memberof google.spanner.executor.v1.UpdateCloudDatabaseDdlAction - * @instance - */ - UpdateCloudDatabaseDdlAction.prototype.sdlStatement = $util.emptyArray; - - /** - * UpdateCloudDatabaseDdlAction operationId. - * @member {string} operationId - * @memberof google.spanner.executor.v1.UpdateCloudDatabaseDdlAction - * @instance - */ - UpdateCloudDatabaseDdlAction.prototype.operationId = ""; - - /** - * UpdateCloudDatabaseDdlAction protoDescriptors. - * @member {Uint8Array|null|undefined} protoDescriptors - * @memberof google.spanner.executor.v1.UpdateCloudDatabaseDdlAction - * @instance - */ - UpdateCloudDatabaseDdlAction.prototype.protoDescriptors = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(UpdateCloudDatabaseDdlAction.prototype, "_protoDescriptors", { - get: $util.oneOfGetter($oneOfFields = ["protoDescriptors"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new UpdateCloudDatabaseDdlAction instance using the specified properties. - * @function create - * @memberof google.spanner.executor.v1.UpdateCloudDatabaseDdlAction - * @static - * @param {google.spanner.executor.v1.IUpdateCloudDatabaseDdlAction=} [properties] Properties to set - * @returns {google.spanner.executor.v1.UpdateCloudDatabaseDdlAction} UpdateCloudDatabaseDdlAction instance - */ - UpdateCloudDatabaseDdlAction.create = function create(properties) { - return new UpdateCloudDatabaseDdlAction(properties); - }; - - /** - * Encodes the specified UpdateCloudDatabaseDdlAction message. Does not implicitly {@link google.spanner.executor.v1.UpdateCloudDatabaseDdlAction.verify|verify} messages. - * @function encode - * @memberof google.spanner.executor.v1.UpdateCloudDatabaseDdlAction - * @static - * @param {google.spanner.executor.v1.IUpdateCloudDatabaseDdlAction} message UpdateCloudDatabaseDdlAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateCloudDatabaseDdlAction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.instanceId); - if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.projectId); - if (message.databaseId != null && Object.hasOwnProperty.call(message, "databaseId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.databaseId); - if (message.sdlStatement != null && message.sdlStatement.length) - for (var i = 0; i < message.sdlStatement.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.sdlStatement[i]); - if (message.operationId != null && Object.hasOwnProperty.call(message, "operationId")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.operationId); - if (message.protoDescriptors != null && Object.hasOwnProperty.call(message, "protoDescriptors")) - writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.protoDescriptors); - return writer; - }; - - /** - * Encodes the specified UpdateCloudDatabaseDdlAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.UpdateCloudDatabaseDdlAction.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.executor.v1.UpdateCloudDatabaseDdlAction - * @static - * @param {google.spanner.executor.v1.IUpdateCloudDatabaseDdlAction} message UpdateCloudDatabaseDdlAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateCloudDatabaseDdlAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateCloudDatabaseDdlAction message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.executor.v1.UpdateCloudDatabaseDdlAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.executor.v1.UpdateCloudDatabaseDdlAction} UpdateCloudDatabaseDdlAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateCloudDatabaseDdlAction.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.UpdateCloudDatabaseDdlAction(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.instanceId = reader.string(); - break; - } - case 2: { - message.projectId = reader.string(); - break; - } - case 3: { - message.databaseId = reader.string(); - break; - } - case 4: { - if (!(message.sdlStatement && message.sdlStatement.length)) - message.sdlStatement = []; - message.sdlStatement.push(reader.string()); - break; - } - case 5: { - message.operationId = reader.string(); - break; - } - case 6: { - message.protoDescriptors = reader.bytes(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateCloudDatabaseDdlAction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.executor.v1.UpdateCloudDatabaseDdlAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.executor.v1.UpdateCloudDatabaseDdlAction} UpdateCloudDatabaseDdlAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateCloudDatabaseDdlAction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateCloudDatabaseDdlAction message. - * @function verify - * @memberof google.spanner.executor.v1.UpdateCloudDatabaseDdlAction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateCloudDatabaseDdlAction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.instanceId != null && message.hasOwnProperty("instanceId")) - if (!$util.isString(message.instanceId)) - return "instanceId: string expected"; - if (message.projectId != null && message.hasOwnProperty("projectId")) - if (!$util.isString(message.projectId)) - return "projectId: string expected"; - if (message.databaseId != null && message.hasOwnProperty("databaseId")) - if (!$util.isString(message.databaseId)) - return "databaseId: string expected"; - if (message.sdlStatement != null && message.hasOwnProperty("sdlStatement")) { - if (!Array.isArray(message.sdlStatement)) - return "sdlStatement: array expected"; - for (var i = 0; i < message.sdlStatement.length; ++i) - if (!$util.isString(message.sdlStatement[i])) - return "sdlStatement: string[] expected"; - } - if (message.operationId != null && message.hasOwnProperty("operationId")) - if (!$util.isString(message.operationId)) - return "operationId: string expected"; - if (message.protoDescriptors != null && message.hasOwnProperty("protoDescriptors")) { - properties._protoDescriptors = 1; - if (!(message.protoDescriptors && typeof message.protoDescriptors.length === "number" || $util.isString(message.protoDescriptors))) - return "protoDescriptors: buffer expected"; - } - return null; - }; - - /** - * Creates an UpdateCloudDatabaseDdlAction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.executor.v1.UpdateCloudDatabaseDdlAction - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.executor.v1.UpdateCloudDatabaseDdlAction} UpdateCloudDatabaseDdlAction - */ - UpdateCloudDatabaseDdlAction.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.executor.v1.UpdateCloudDatabaseDdlAction) - return object; - var message = new $root.google.spanner.executor.v1.UpdateCloudDatabaseDdlAction(); - if (object.instanceId != null) - message.instanceId = String(object.instanceId); - if (object.projectId != null) - message.projectId = String(object.projectId); - if (object.databaseId != null) - message.databaseId = String(object.databaseId); - if (object.sdlStatement) { - if (!Array.isArray(object.sdlStatement)) - throw TypeError(".google.spanner.executor.v1.UpdateCloudDatabaseDdlAction.sdlStatement: array expected"); - message.sdlStatement = []; - for (var i = 0; i < object.sdlStatement.length; ++i) - message.sdlStatement[i] = String(object.sdlStatement[i]); - } - if (object.operationId != null) - message.operationId = String(object.operationId); - if (object.protoDescriptors != null) - if (typeof object.protoDescriptors === "string") - $util.base64.decode(object.protoDescriptors, message.protoDescriptors = $util.newBuffer($util.base64.length(object.protoDescriptors)), 0); - else if (object.protoDescriptors.length >= 0) - message.protoDescriptors = object.protoDescriptors; - return message; - }; - - /** - * Creates a plain object from an UpdateCloudDatabaseDdlAction message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.executor.v1.UpdateCloudDatabaseDdlAction - * @static - * @param {google.spanner.executor.v1.UpdateCloudDatabaseDdlAction} message UpdateCloudDatabaseDdlAction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateCloudDatabaseDdlAction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.sdlStatement = []; - if (options.defaults) { - object.instanceId = ""; - object.projectId = ""; - object.databaseId = ""; - object.operationId = ""; - } - if (message.instanceId != null && message.hasOwnProperty("instanceId")) - object.instanceId = message.instanceId; - if (message.projectId != null && message.hasOwnProperty("projectId")) - object.projectId = message.projectId; - if (message.databaseId != null && message.hasOwnProperty("databaseId")) - object.databaseId = message.databaseId; - if (message.sdlStatement && message.sdlStatement.length) { - object.sdlStatement = []; - for (var j = 0; j < message.sdlStatement.length; ++j) - object.sdlStatement[j] = message.sdlStatement[j]; - } - if (message.operationId != null && message.hasOwnProperty("operationId")) - object.operationId = message.operationId; - if (message.protoDescriptors != null && message.hasOwnProperty("protoDescriptors")) { - object.protoDescriptors = options.bytes === String ? $util.base64.encode(message.protoDescriptors, 0, message.protoDescriptors.length) : options.bytes === Array ? Array.prototype.slice.call(message.protoDescriptors) : message.protoDescriptors; - if (options.oneofs) - object._protoDescriptors = "protoDescriptors"; - } - return object; - }; - - /** - * Converts this UpdateCloudDatabaseDdlAction to JSON. - * @function toJSON - * @memberof google.spanner.executor.v1.UpdateCloudDatabaseDdlAction - * @instance - * @returns {Object.} JSON object - */ - UpdateCloudDatabaseDdlAction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateCloudDatabaseDdlAction - * @function getTypeUrl - * @memberof google.spanner.executor.v1.UpdateCloudDatabaseDdlAction - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateCloudDatabaseDdlAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.executor.v1.UpdateCloudDatabaseDdlAction"; - }; - - return UpdateCloudDatabaseDdlAction; - })(); - - v1.UpdateCloudDatabaseAction = (function() { - - /** - * Properties of an UpdateCloudDatabaseAction. - * @memberof google.spanner.executor.v1 - * @interface IUpdateCloudDatabaseAction - * @property {string|null} [instanceId] UpdateCloudDatabaseAction instanceId - * @property {string|null} [projectId] UpdateCloudDatabaseAction projectId - * @property {string|null} [databaseName] UpdateCloudDatabaseAction databaseName - * @property {boolean|null} [enableDropProtection] UpdateCloudDatabaseAction enableDropProtection - */ - - /** - * Constructs a new UpdateCloudDatabaseAction. - * @memberof google.spanner.executor.v1 - * @classdesc Represents an UpdateCloudDatabaseAction. - * @implements IUpdateCloudDatabaseAction - * @constructor - * @param {google.spanner.executor.v1.IUpdateCloudDatabaseAction=} [properties] Properties to set - */ - function UpdateCloudDatabaseAction(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateCloudDatabaseAction instanceId. - * @member {string} instanceId - * @memberof google.spanner.executor.v1.UpdateCloudDatabaseAction - * @instance - */ - UpdateCloudDatabaseAction.prototype.instanceId = ""; - - /** - * UpdateCloudDatabaseAction projectId. - * @member {string} projectId - * @memberof google.spanner.executor.v1.UpdateCloudDatabaseAction - * @instance - */ - UpdateCloudDatabaseAction.prototype.projectId = ""; - - /** - * UpdateCloudDatabaseAction databaseName. - * @member {string} databaseName - * @memberof google.spanner.executor.v1.UpdateCloudDatabaseAction - * @instance - */ - UpdateCloudDatabaseAction.prototype.databaseName = ""; - - /** - * UpdateCloudDatabaseAction enableDropProtection. - * @member {boolean} enableDropProtection - * @memberof google.spanner.executor.v1.UpdateCloudDatabaseAction - * @instance - */ - UpdateCloudDatabaseAction.prototype.enableDropProtection = false; - - /** - * Creates a new UpdateCloudDatabaseAction instance using the specified properties. - * @function create - * @memberof google.spanner.executor.v1.UpdateCloudDatabaseAction - * @static - * @param {google.spanner.executor.v1.IUpdateCloudDatabaseAction=} [properties] Properties to set - * @returns {google.spanner.executor.v1.UpdateCloudDatabaseAction} UpdateCloudDatabaseAction instance - */ - UpdateCloudDatabaseAction.create = function create(properties) { - return new UpdateCloudDatabaseAction(properties); - }; - - /** - * Encodes the specified UpdateCloudDatabaseAction message. Does not implicitly {@link google.spanner.executor.v1.UpdateCloudDatabaseAction.verify|verify} messages. - * @function encode - * @memberof google.spanner.executor.v1.UpdateCloudDatabaseAction - * @static - * @param {google.spanner.executor.v1.IUpdateCloudDatabaseAction} message UpdateCloudDatabaseAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateCloudDatabaseAction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.instanceId); - if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.projectId); - if (message.databaseName != null && Object.hasOwnProperty.call(message, "databaseName")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.databaseName); - if (message.enableDropProtection != null && Object.hasOwnProperty.call(message, "enableDropProtection")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.enableDropProtection); - return writer; - }; - - /** - * Encodes the specified UpdateCloudDatabaseAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.UpdateCloudDatabaseAction.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.executor.v1.UpdateCloudDatabaseAction - * @static - * @param {google.spanner.executor.v1.IUpdateCloudDatabaseAction} message UpdateCloudDatabaseAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateCloudDatabaseAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateCloudDatabaseAction message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.executor.v1.UpdateCloudDatabaseAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.executor.v1.UpdateCloudDatabaseAction} UpdateCloudDatabaseAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateCloudDatabaseAction.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.UpdateCloudDatabaseAction(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.instanceId = reader.string(); - break; - } - case 2: { - message.projectId = reader.string(); - break; - } - case 3: { - message.databaseName = reader.string(); - break; - } - case 4: { - message.enableDropProtection = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateCloudDatabaseAction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.executor.v1.UpdateCloudDatabaseAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.executor.v1.UpdateCloudDatabaseAction} UpdateCloudDatabaseAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateCloudDatabaseAction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateCloudDatabaseAction message. - * @function verify - * @memberof google.spanner.executor.v1.UpdateCloudDatabaseAction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateCloudDatabaseAction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.instanceId != null && message.hasOwnProperty("instanceId")) - if (!$util.isString(message.instanceId)) - return "instanceId: string expected"; - if (message.projectId != null && message.hasOwnProperty("projectId")) - if (!$util.isString(message.projectId)) - return "projectId: string expected"; - if (message.databaseName != null && message.hasOwnProperty("databaseName")) - if (!$util.isString(message.databaseName)) - return "databaseName: string expected"; - if (message.enableDropProtection != null && message.hasOwnProperty("enableDropProtection")) - if (typeof message.enableDropProtection !== "boolean") - return "enableDropProtection: boolean expected"; - return null; - }; - - /** - * Creates an UpdateCloudDatabaseAction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.executor.v1.UpdateCloudDatabaseAction - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.executor.v1.UpdateCloudDatabaseAction} UpdateCloudDatabaseAction - */ - UpdateCloudDatabaseAction.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.executor.v1.UpdateCloudDatabaseAction) - return object; - var message = new $root.google.spanner.executor.v1.UpdateCloudDatabaseAction(); - if (object.instanceId != null) - message.instanceId = String(object.instanceId); - if (object.projectId != null) - message.projectId = String(object.projectId); - if (object.databaseName != null) - message.databaseName = String(object.databaseName); - if (object.enableDropProtection != null) - message.enableDropProtection = Boolean(object.enableDropProtection); - return message; - }; - - /** - * Creates a plain object from an UpdateCloudDatabaseAction message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.executor.v1.UpdateCloudDatabaseAction - * @static - * @param {google.spanner.executor.v1.UpdateCloudDatabaseAction} message UpdateCloudDatabaseAction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateCloudDatabaseAction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.instanceId = ""; - object.projectId = ""; - object.databaseName = ""; - object.enableDropProtection = false; - } - if (message.instanceId != null && message.hasOwnProperty("instanceId")) - object.instanceId = message.instanceId; - if (message.projectId != null && message.hasOwnProperty("projectId")) - object.projectId = message.projectId; - if (message.databaseName != null && message.hasOwnProperty("databaseName")) - object.databaseName = message.databaseName; - if (message.enableDropProtection != null && message.hasOwnProperty("enableDropProtection")) - object.enableDropProtection = message.enableDropProtection; - return object; - }; - - /** - * Converts this UpdateCloudDatabaseAction to JSON. - * @function toJSON - * @memberof google.spanner.executor.v1.UpdateCloudDatabaseAction - * @instance - * @returns {Object.} JSON object - */ - UpdateCloudDatabaseAction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateCloudDatabaseAction - * @function getTypeUrl - * @memberof google.spanner.executor.v1.UpdateCloudDatabaseAction - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateCloudDatabaseAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.executor.v1.UpdateCloudDatabaseAction"; - }; - - return UpdateCloudDatabaseAction; - })(); - - v1.DropCloudDatabaseAction = (function() { - - /** - * Properties of a DropCloudDatabaseAction. - * @memberof google.spanner.executor.v1 - * @interface IDropCloudDatabaseAction - * @property {string|null} [instanceId] DropCloudDatabaseAction instanceId - * @property {string|null} [projectId] DropCloudDatabaseAction projectId - * @property {string|null} [databaseId] DropCloudDatabaseAction databaseId - */ - - /** - * Constructs a new DropCloudDatabaseAction. - * @memberof google.spanner.executor.v1 - * @classdesc Represents a DropCloudDatabaseAction. - * @implements IDropCloudDatabaseAction - * @constructor - * @param {google.spanner.executor.v1.IDropCloudDatabaseAction=} [properties] Properties to set - */ - function DropCloudDatabaseAction(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DropCloudDatabaseAction instanceId. - * @member {string} instanceId - * @memberof google.spanner.executor.v1.DropCloudDatabaseAction - * @instance - */ - DropCloudDatabaseAction.prototype.instanceId = ""; - - /** - * DropCloudDatabaseAction projectId. - * @member {string} projectId - * @memberof google.spanner.executor.v1.DropCloudDatabaseAction - * @instance - */ - DropCloudDatabaseAction.prototype.projectId = ""; - - /** - * DropCloudDatabaseAction databaseId. - * @member {string} databaseId - * @memberof google.spanner.executor.v1.DropCloudDatabaseAction - * @instance - */ - DropCloudDatabaseAction.prototype.databaseId = ""; - - /** - * Creates a new DropCloudDatabaseAction instance using the specified properties. - * @function create - * @memberof google.spanner.executor.v1.DropCloudDatabaseAction - * @static - * @param {google.spanner.executor.v1.IDropCloudDatabaseAction=} [properties] Properties to set - * @returns {google.spanner.executor.v1.DropCloudDatabaseAction} DropCloudDatabaseAction instance - */ - DropCloudDatabaseAction.create = function create(properties) { - return new DropCloudDatabaseAction(properties); - }; - - /** - * Encodes the specified DropCloudDatabaseAction message. Does not implicitly {@link google.spanner.executor.v1.DropCloudDatabaseAction.verify|verify} messages. - * @function encode - * @memberof google.spanner.executor.v1.DropCloudDatabaseAction - * @static - * @param {google.spanner.executor.v1.IDropCloudDatabaseAction} message DropCloudDatabaseAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DropCloudDatabaseAction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.instanceId); - if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.projectId); - if (message.databaseId != null && Object.hasOwnProperty.call(message, "databaseId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.databaseId); - return writer; - }; - - /** - * Encodes the specified DropCloudDatabaseAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.DropCloudDatabaseAction.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.executor.v1.DropCloudDatabaseAction - * @static - * @param {google.spanner.executor.v1.IDropCloudDatabaseAction} message DropCloudDatabaseAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DropCloudDatabaseAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DropCloudDatabaseAction message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.executor.v1.DropCloudDatabaseAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.executor.v1.DropCloudDatabaseAction} DropCloudDatabaseAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DropCloudDatabaseAction.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.DropCloudDatabaseAction(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.instanceId = reader.string(); - break; - } - case 2: { - message.projectId = reader.string(); - break; - } - case 3: { - message.databaseId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DropCloudDatabaseAction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.executor.v1.DropCloudDatabaseAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.executor.v1.DropCloudDatabaseAction} DropCloudDatabaseAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DropCloudDatabaseAction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DropCloudDatabaseAction message. - * @function verify - * @memberof google.spanner.executor.v1.DropCloudDatabaseAction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DropCloudDatabaseAction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.instanceId != null && message.hasOwnProperty("instanceId")) - if (!$util.isString(message.instanceId)) - return "instanceId: string expected"; - if (message.projectId != null && message.hasOwnProperty("projectId")) - if (!$util.isString(message.projectId)) - return "projectId: string expected"; - if (message.databaseId != null && message.hasOwnProperty("databaseId")) - if (!$util.isString(message.databaseId)) - return "databaseId: string expected"; - return null; - }; - - /** - * Creates a DropCloudDatabaseAction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.executor.v1.DropCloudDatabaseAction - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.executor.v1.DropCloudDatabaseAction} DropCloudDatabaseAction - */ - DropCloudDatabaseAction.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.executor.v1.DropCloudDatabaseAction) - return object; - var message = new $root.google.spanner.executor.v1.DropCloudDatabaseAction(); - if (object.instanceId != null) - message.instanceId = String(object.instanceId); - if (object.projectId != null) - message.projectId = String(object.projectId); - if (object.databaseId != null) - message.databaseId = String(object.databaseId); - return message; - }; - - /** - * Creates a plain object from a DropCloudDatabaseAction message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.executor.v1.DropCloudDatabaseAction - * @static - * @param {google.spanner.executor.v1.DropCloudDatabaseAction} message DropCloudDatabaseAction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DropCloudDatabaseAction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.instanceId = ""; - object.projectId = ""; - object.databaseId = ""; - } - if (message.instanceId != null && message.hasOwnProperty("instanceId")) - object.instanceId = message.instanceId; - if (message.projectId != null && message.hasOwnProperty("projectId")) - object.projectId = message.projectId; - if (message.databaseId != null && message.hasOwnProperty("databaseId")) - object.databaseId = message.databaseId; - return object; - }; - - /** - * Converts this DropCloudDatabaseAction to JSON. - * @function toJSON - * @memberof google.spanner.executor.v1.DropCloudDatabaseAction - * @instance - * @returns {Object.} JSON object - */ - DropCloudDatabaseAction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DropCloudDatabaseAction - * @function getTypeUrl - * @memberof google.spanner.executor.v1.DropCloudDatabaseAction - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DropCloudDatabaseAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.executor.v1.DropCloudDatabaseAction"; - }; - - return DropCloudDatabaseAction; - })(); - - v1.ChangeQuorumCloudDatabaseAction = (function() { - - /** - * Properties of a ChangeQuorumCloudDatabaseAction. - * @memberof google.spanner.executor.v1 - * @interface IChangeQuorumCloudDatabaseAction - * @property {string|null} [databaseUri] ChangeQuorumCloudDatabaseAction databaseUri - * @property {Array.|null} [servingLocations] ChangeQuorumCloudDatabaseAction servingLocations - */ - - /** - * Constructs a new ChangeQuorumCloudDatabaseAction. - * @memberof google.spanner.executor.v1 - * @classdesc Represents a ChangeQuorumCloudDatabaseAction. - * @implements IChangeQuorumCloudDatabaseAction - * @constructor - * @param {google.spanner.executor.v1.IChangeQuorumCloudDatabaseAction=} [properties] Properties to set - */ - function ChangeQuorumCloudDatabaseAction(properties) { - this.servingLocations = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ChangeQuorumCloudDatabaseAction databaseUri. - * @member {string|null|undefined} databaseUri - * @memberof google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction - * @instance - */ - ChangeQuorumCloudDatabaseAction.prototype.databaseUri = null; - - /** - * ChangeQuorumCloudDatabaseAction servingLocations. - * @member {Array.} servingLocations - * @memberof google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction - * @instance - */ - ChangeQuorumCloudDatabaseAction.prototype.servingLocations = $util.emptyArray; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ChangeQuorumCloudDatabaseAction.prototype, "_databaseUri", { - get: $util.oneOfGetter($oneOfFields = ["databaseUri"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new ChangeQuorumCloudDatabaseAction instance using the specified properties. - * @function create - * @memberof google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction - * @static - * @param {google.spanner.executor.v1.IChangeQuorumCloudDatabaseAction=} [properties] Properties to set - * @returns {google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction} ChangeQuorumCloudDatabaseAction instance - */ - ChangeQuorumCloudDatabaseAction.create = function create(properties) { - return new ChangeQuorumCloudDatabaseAction(properties); - }; - - /** - * Encodes the specified ChangeQuorumCloudDatabaseAction message. Does not implicitly {@link google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction.verify|verify} messages. - * @function encode - * @memberof google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction - * @static - * @param {google.spanner.executor.v1.IChangeQuorumCloudDatabaseAction} message ChangeQuorumCloudDatabaseAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ChangeQuorumCloudDatabaseAction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.databaseUri != null && Object.hasOwnProperty.call(message, "databaseUri")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.databaseUri); - if (message.servingLocations != null && message.servingLocations.length) - for (var i = 0; i < message.servingLocations.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.servingLocations[i]); - return writer; - }; - - /** - * Encodes the specified ChangeQuorumCloudDatabaseAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction - * @static - * @param {google.spanner.executor.v1.IChangeQuorumCloudDatabaseAction} message ChangeQuorumCloudDatabaseAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ChangeQuorumCloudDatabaseAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ChangeQuorumCloudDatabaseAction message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction} ChangeQuorumCloudDatabaseAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ChangeQuorumCloudDatabaseAction.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.databaseUri = reader.string(); - break; - } - case 2: { - if (!(message.servingLocations && message.servingLocations.length)) - message.servingLocations = []; - message.servingLocations.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ChangeQuorumCloudDatabaseAction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction} ChangeQuorumCloudDatabaseAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ChangeQuorumCloudDatabaseAction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ChangeQuorumCloudDatabaseAction message. - * @function verify - * @memberof google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ChangeQuorumCloudDatabaseAction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.databaseUri != null && message.hasOwnProperty("databaseUri")) { - properties._databaseUri = 1; - if (!$util.isString(message.databaseUri)) - return "databaseUri: string expected"; - } - if (message.servingLocations != null && message.hasOwnProperty("servingLocations")) { - if (!Array.isArray(message.servingLocations)) - return "servingLocations: array expected"; - for (var i = 0; i < message.servingLocations.length; ++i) - if (!$util.isString(message.servingLocations[i])) - return "servingLocations: string[] expected"; - } - return null; - }; - - /** - * Creates a ChangeQuorumCloudDatabaseAction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction} ChangeQuorumCloudDatabaseAction - */ - ChangeQuorumCloudDatabaseAction.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction) - return object; - var message = new $root.google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction(); - if (object.databaseUri != null) - message.databaseUri = String(object.databaseUri); - if (object.servingLocations) { - if (!Array.isArray(object.servingLocations)) - throw TypeError(".google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction.servingLocations: array expected"); - message.servingLocations = []; - for (var i = 0; i < object.servingLocations.length; ++i) - message.servingLocations[i] = String(object.servingLocations[i]); - } - return message; - }; - - /** - * Creates a plain object from a ChangeQuorumCloudDatabaseAction message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction - * @static - * @param {google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction} message ChangeQuorumCloudDatabaseAction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ChangeQuorumCloudDatabaseAction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.servingLocations = []; - if (message.databaseUri != null && message.hasOwnProperty("databaseUri")) { - object.databaseUri = message.databaseUri; - if (options.oneofs) - object._databaseUri = "databaseUri"; - } - if (message.servingLocations && message.servingLocations.length) { - object.servingLocations = []; - for (var j = 0; j < message.servingLocations.length; ++j) - object.servingLocations[j] = message.servingLocations[j]; - } - return object; - }; - - /** - * Converts this ChangeQuorumCloudDatabaseAction to JSON. - * @function toJSON - * @memberof google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction - * @instance - * @returns {Object.} JSON object - */ - ChangeQuorumCloudDatabaseAction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ChangeQuorumCloudDatabaseAction - * @function getTypeUrl - * @memberof google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ChangeQuorumCloudDatabaseAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction"; - }; - - return ChangeQuorumCloudDatabaseAction; - })(); - - v1.ListCloudDatabasesAction = (function() { - - /** - * Properties of a ListCloudDatabasesAction. - * @memberof google.spanner.executor.v1 - * @interface IListCloudDatabasesAction - * @property {string|null} [projectId] ListCloudDatabasesAction projectId - * @property {string|null} [instanceId] ListCloudDatabasesAction instanceId - * @property {number|null} [pageSize] ListCloudDatabasesAction pageSize - * @property {string|null} [pageToken] ListCloudDatabasesAction pageToken - */ - - /** - * Constructs a new ListCloudDatabasesAction. - * @memberof google.spanner.executor.v1 - * @classdesc Represents a ListCloudDatabasesAction. - * @implements IListCloudDatabasesAction - * @constructor - * @param {google.spanner.executor.v1.IListCloudDatabasesAction=} [properties] Properties to set - */ - function ListCloudDatabasesAction(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListCloudDatabasesAction projectId. - * @member {string} projectId - * @memberof google.spanner.executor.v1.ListCloudDatabasesAction - * @instance - */ - ListCloudDatabasesAction.prototype.projectId = ""; - - /** - * ListCloudDatabasesAction instanceId. - * @member {string} instanceId - * @memberof google.spanner.executor.v1.ListCloudDatabasesAction - * @instance - */ - ListCloudDatabasesAction.prototype.instanceId = ""; - - /** - * ListCloudDatabasesAction pageSize. - * @member {number} pageSize - * @memberof google.spanner.executor.v1.ListCloudDatabasesAction - * @instance - */ - ListCloudDatabasesAction.prototype.pageSize = 0; - - /** - * ListCloudDatabasesAction pageToken. - * @member {string} pageToken - * @memberof google.spanner.executor.v1.ListCloudDatabasesAction - * @instance - */ - ListCloudDatabasesAction.prototype.pageToken = ""; - - /** - * Creates a new ListCloudDatabasesAction instance using the specified properties. - * @function create - * @memberof google.spanner.executor.v1.ListCloudDatabasesAction - * @static - * @param {google.spanner.executor.v1.IListCloudDatabasesAction=} [properties] Properties to set - * @returns {google.spanner.executor.v1.ListCloudDatabasesAction} ListCloudDatabasesAction instance - */ - ListCloudDatabasesAction.create = function create(properties) { - return new ListCloudDatabasesAction(properties); - }; - - /** - * Encodes the specified ListCloudDatabasesAction message. Does not implicitly {@link google.spanner.executor.v1.ListCloudDatabasesAction.verify|verify} messages. - * @function encode - * @memberof google.spanner.executor.v1.ListCloudDatabasesAction - * @static - * @param {google.spanner.executor.v1.IListCloudDatabasesAction} message ListCloudDatabasesAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListCloudDatabasesAction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); - if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.instanceId); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); - return writer; - }; - - /** - * Encodes the specified ListCloudDatabasesAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.ListCloudDatabasesAction.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.executor.v1.ListCloudDatabasesAction - * @static - * @param {google.spanner.executor.v1.IListCloudDatabasesAction} message ListCloudDatabasesAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListCloudDatabasesAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListCloudDatabasesAction message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.executor.v1.ListCloudDatabasesAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.executor.v1.ListCloudDatabasesAction} ListCloudDatabasesAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListCloudDatabasesAction.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.ListCloudDatabasesAction(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.projectId = reader.string(); - break; - } - case 2: { - message.instanceId = reader.string(); - break; - } - case 3: { - message.pageSize = reader.int32(); - break; - } - case 4: { - message.pageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListCloudDatabasesAction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.executor.v1.ListCloudDatabasesAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.executor.v1.ListCloudDatabasesAction} ListCloudDatabasesAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListCloudDatabasesAction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListCloudDatabasesAction message. - * @function verify - * @memberof google.spanner.executor.v1.ListCloudDatabasesAction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListCloudDatabasesAction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.projectId != null && message.hasOwnProperty("projectId")) - if (!$util.isString(message.projectId)) - return "projectId: string expected"; - if (message.instanceId != null && message.hasOwnProperty("instanceId")) - if (!$util.isString(message.instanceId)) - return "instanceId: 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 ListCloudDatabasesAction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.executor.v1.ListCloudDatabasesAction - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.executor.v1.ListCloudDatabasesAction} ListCloudDatabasesAction - */ - ListCloudDatabasesAction.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.executor.v1.ListCloudDatabasesAction) - return object; - var message = new $root.google.spanner.executor.v1.ListCloudDatabasesAction(); - if (object.projectId != null) - message.projectId = String(object.projectId); - if (object.instanceId != null) - message.instanceId = String(object.instanceId); - 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 ListCloudDatabasesAction message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.executor.v1.ListCloudDatabasesAction - * @static - * @param {google.spanner.executor.v1.ListCloudDatabasesAction} message ListCloudDatabasesAction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListCloudDatabasesAction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.projectId = ""; - object.instanceId = ""; - object.pageSize = 0; - object.pageToken = ""; - } - if (message.projectId != null && message.hasOwnProperty("projectId")) - object.projectId = message.projectId; - if (message.instanceId != null && message.hasOwnProperty("instanceId")) - object.instanceId = message.instanceId; - 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 ListCloudDatabasesAction to JSON. - * @function toJSON - * @memberof google.spanner.executor.v1.ListCloudDatabasesAction - * @instance - * @returns {Object.} JSON object - */ - ListCloudDatabasesAction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListCloudDatabasesAction - * @function getTypeUrl - * @memberof google.spanner.executor.v1.ListCloudDatabasesAction - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListCloudDatabasesAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.executor.v1.ListCloudDatabasesAction"; - }; - - return ListCloudDatabasesAction; - })(); - - v1.ListCloudInstancesAction = (function() { - - /** - * Properties of a ListCloudInstancesAction. - * @memberof google.spanner.executor.v1 - * @interface IListCloudInstancesAction - * @property {string|null} [projectId] ListCloudInstancesAction projectId - * @property {string|null} [filter] ListCloudInstancesAction filter - * @property {number|null} [pageSize] ListCloudInstancesAction pageSize - * @property {string|null} [pageToken] ListCloudInstancesAction pageToken - */ - - /** - * Constructs a new ListCloudInstancesAction. - * @memberof google.spanner.executor.v1 - * @classdesc Represents a ListCloudInstancesAction. - * @implements IListCloudInstancesAction - * @constructor - * @param {google.spanner.executor.v1.IListCloudInstancesAction=} [properties] Properties to set - */ - function ListCloudInstancesAction(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListCloudInstancesAction projectId. - * @member {string} projectId - * @memberof google.spanner.executor.v1.ListCloudInstancesAction - * @instance - */ - ListCloudInstancesAction.prototype.projectId = ""; - - /** - * ListCloudInstancesAction filter. - * @member {string|null|undefined} filter - * @memberof google.spanner.executor.v1.ListCloudInstancesAction - * @instance - */ - ListCloudInstancesAction.prototype.filter = null; - - /** - * ListCloudInstancesAction pageSize. - * @member {number|null|undefined} pageSize - * @memberof google.spanner.executor.v1.ListCloudInstancesAction - * @instance - */ - ListCloudInstancesAction.prototype.pageSize = null; - - /** - * ListCloudInstancesAction pageToken. - * @member {string|null|undefined} pageToken - * @memberof google.spanner.executor.v1.ListCloudInstancesAction - * @instance - */ - ListCloudInstancesAction.prototype.pageToken = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ListCloudInstancesAction.prototype, "_filter", { - get: $util.oneOfGetter($oneOfFields = ["filter"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ListCloudInstancesAction.prototype, "_pageSize", { - get: $util.oneOfGetter($oneOfFields = ["pageSize"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ListCloudInstancesAction.prototype, "_pageToken", { - get: $util.oneOfGetter($oneOfFields = ["pageToken"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new ListCloudInstancesAction instance using the specified properties. - * @function create - * @memberof google.spanner.executor.v1.ListCloudInstancesAction - * @static - * @param {google.spanner.executor.v1.IListCloudInstancesAction=} [properties] Properties to set - * @returns {google.spanner.executor.v1.ListCloudInstancesAction} ListCloudInstancesAction instance - */ - ListCloudInstancesAction.create = function create(properties) { - return new ListCloudInstancesAction(properties); - }; - - /** - * Encodes the specified ListCloudInstancesAction message. Does not implicitly {@link google.spanner.executor.v1.ListCloudInstancesAction.verify|verify} messages. - * @function encode - * @memberof google.spanner.executor.v1.ListCloudInstancesAction - * @static - * @param {google.spanner.executor.v1.IListCloudInstancesAction} message ListCloudInstancesAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListCloudInstancesAction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); - return writer; - }; - - /** - * Encodes the specified ListCloudInstancesAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.ListCloudInstancesAction.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.executor.v1.ListCloudInstancesAction - * @static - * @param {google.spanner.executor.v1.IListCloudInstancesAction} message ListCloudInstancesAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListCloudInstancesAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListCloudInstancesAction message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.executor.v1.ListCloudInstancesAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.executor.v1.ListCloudInstancesAction} ListCloudInstancesAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListCloudInstancesAction.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.ListCloudInstancesAction(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.projectId = reader.string(); - break; - } - case 2: { - message.filter = reader.string(); - break; - } - case 3: { - message.pageSize = reader.int32(); - break; - } - case 4: { - message.pageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListCloudInstancesAction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.executor.v1.ListCloudInstancesAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.executor.v1.ListCloudInstancesAction} ListCloudInstancesAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListCloudInstancesAction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListCloudInstancesAction message. - * @function verify - * @memberof google.spanner.executor.v1.ListCloudInstancesAction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListCloudInstancesAction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.projectId != null && message.hasOwnProperty("projectId")) - if (!$util.isString(message.projectId)) - return "projectId: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) { - properties._filter = 1; - if (!$util.isString(message.filter)) - return "filter: string expected"; - } - if (message.pageSize != null && message.hasOwnProperty("pageSize")) { - properties._pageSize = 1; - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - } - if (message.pageToken != null && message.hasOwnProperty("pageToken")) { - properties._pageToken = 1; - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - } - return null; - }; - - /** - * Creates a ListCloudInstancesAction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.executor.v1.ListCloudInstancesAction - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.executor.v1.ListCloudInstancesAction} ListCloudInstancesAction - */ - ListCloudInstancesAction.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.executor.v1.ListCloudInstancesAction) - return object; - var message = new $root.google.spanner.executor.v1.ListCloudInstancesAction(); - if (object.projectId != null) - message.projectId = String(object.projectId); - if (object.filter != null) - message.filter = String(object.filter); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - return message; - }; - - /** - * Creates a plain object from a ListCloudInstancesAction message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.executor.v1.ListCloudInstancesAction - * @static - * @param {google.spanner.executor.v1.ListCloudInstancesAction} message ListCloudInstancesAction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListCloudInstancesAction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.projectId = ""; - if (message.projectId != null && message.hasOwnProperty("projectId")) - object.projectId = message.projectId; - if (message.filter != null && message.hasOwnProperty("filter")) { - object.filter = message.filter; - if (options.oneofs) - object._filter = "filter"; - } - if (message.pageSize != null && message.hasOwnProperty("pageSize")) { - object.pageSize = message.pageSize; - if (options.oneofs) - object._pageSize = "pageSize"; - } - if (message.pageToken != null && message.hasOwnProperty("pageToken")) { - object.pageToken = message.pageToken; - if (options.oneofs) - object._pageToken = "pageToken"; - } - return object; - }; - - /** - * Converts this ListCloudInstancesAction to JSON. - * @function toJSON - * @memberof google.spanner.executor.v1.ListCloudInstancesAction - * @instance - * @returns {Object.} JSON object - */ - ListCloudInstancesAction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListCloudInstancesAction - * @function getTypeUrl - * @memberof google.spanner.executor.v1.ListCloudInstancesAction - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListCloudInstancesAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.executor.v1.ListCloudInstancesAction"; - }; - - return ListCloudInstancesAction; - })(); - - v1.GetCloudInstanceAction = (function() { - - /** - * Properties of a GetCloudInstanceAction. - * @memberof google.spanner.executor.v1 - * @interface IGetCloudInstanceAction - * @property {string|null} [projectId] GetCloudInstanceAction projectId - * @property {string|null} [instanceId] GetCloudInstanceAction instanceId - */ - - /** - * Constructs a new GetCloudInstanceAction. - * @memberof google.spanner.executor.v1 - * @classdesc Represents a GetCloudInstanceAction. - * @implements IGetCloudInstanceAction - * @constructor - * @param {google.spanner.executor.v1.IGetCloudInstanceAction=} [properties] Properties to set - */ - function GetCloudInstanceAction(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetCloudInstanceAction projectId. - * @member {string} projectId - * @memberof google.spanner.executor.v1.GetCloudInstanceAction - * @instance - */ - GetCloudInstanceAction.prototype.projectId = ""; - - /** - * GetCloudInstanceAction instanceId. - * @member {string} instanceId - * @memberof google.spanner.executor.v1.GetCloudInstanceAction - * @instance - */ - GetCloudInstanceAction.prototype.instanceId = ""; - - /** - * Creates a new GetCloudInstanceAction instance using the specified properties. - * @function create - * @memberof google.spanner.executor.v1.GetCloudInstanceAction - * @static - * @param {google.spanner.executor.v1.IGetCloudInstanceAction=} [properties] Properties to set - * @returns {google.spanner.executor.v1.GetCloudInstanceAction} GetCloudInstanceAction instance - */ - GetCloudInstanceAction.create = function create(properties) { - return new GetCloudInstanceAction(properties); - }; - - /** - * Encodes the specified GetCloudInstanceAction message. Does not implicitly {@link google.spanner.executor.v1.GetCloudInstanceAction.verify|verify} messages. - * @function encode - * @memberof google.spanner.executor.v1.GetCloudInstanceAction - * @static - * @param {google.spanner.executor.v1.IGetCloudInstanceAction} message GetCloudInstanceAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetCloudInstanceAction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); - if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.instanceId); - return writer; - }; - - /** - * Encodes the specified GetCloudInstanceAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.GetCloudInstanceAction.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.executor.v1.GetCloudInstanceAction - * @static - * @param {google.spanner.executor.v1.IGetCloudInstanceAction} message GetCloudInstanceAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetCloudInstanceAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetCloudInstanceAction message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.executor.v1.GetCloudInstanceAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.executor.v1.GetCloudInstanceAction} GetCloudInstanceAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetCloudInstanceAction.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.GetCloudInstanceAction(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.projectId = reader.string(); - break; - } - case 2: { - message.instanceId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetCloudInstanceAction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.executor.v1.GetCloudInstanceAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.executor.v1.GetCloudInstanceAction} GetCloudInstanceAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetCloudInstanceAction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetCloudInstanceAction message. - * @function verify - * @memberof google.spanner.executor.v1.GetCloudInstanceAction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetCloudInstanceAction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.projectId != null && message.hasOwnProperty("projectId")) - if (!$util.isString(message.projectId)) - return "projectId: string expected"; - if (message.instanceId != null && message.hasOwnProperty("instanceId")) - if (!$util.isString(message.instanceId)) - return "instanceId: string expected"; - return null; - }; - - /** - * Creates a GetCloudInstanceAction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.executor.v1.GetCloudInstanceAction - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.executor.v1.GetCloudInstanceAction} GetCloudInstanceAction - */ - GetCloudInstanceAction.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.executor.v1.GetCloudInstanceAction) - return object; - var message = new $root.google.spanner.executor.v1.GetCloudInstanceAction(); - if (object.projectId != null) - message.projectId = String(object.projectId); - if (object.instanceId != null) - message.instanceId = String(object.instanceId); - return message; - }; - - /** - * Creates a plain object from a GetCloudInstanceAction message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.executor.v1.GetCloudInstanceAction - * @static - * @param {google.spanner.executor.v1.GetCloudInstanceAction} message GetCloudInstanceAction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetCloudInstanceAction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.projectId = ""; - object.instanceId = ""; - } - if (message.projectId != null && message.hasOwnProperty("projectId")) - object.projectId = message.projectId; - if (message.instanceId != null && message.hasOwnProperty("instanceId")) - object.instanceId = message.instanceId; - return object; - }; - - /** - * Converts this GetCloudInstanceAction to JSON. - * @function toJSON - * @memberof google.spanner.executor.v1.GetCloudInstanceAction - * @instance - * @returns {Object.} JSON object - */ - GetCloudInstanceAction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetCloudInstanceAction - * @function getTypeUrl - * @memberof google.spanner.executor.v1.GetCloudInstanceAction - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetCloudInstanceAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.executor.v1.GetCloudInstanceAction"; - }; - - return GetCloudInstanceAction; - })(); - - v1.ListCloudDatabaseOperationsAction = (function() { - - /** - * Properties of a ListCloudDatabaseOperationsAction. - * @memberof google.spanner.executor.v1 - * @interface IListCloudDatabaseOperationsAction - * @property {string|null} [projectId] ListCloudDatabaseOperationsAction projectId - * @property {string|null} [instanceId] ListCloudDatabaseOperationsAction instanceId - * @property {string|null} [filter] ListCloudDatabaseOperationsAction filter - * @property {number|null} [pageSize] ListCloudDatabaseOperationsAction pageSize - * @property {string|null} [pageToken] ListCloudDatabaseOperationsAction pageToken - */ - - /** - * Constructs a new ListCloudDatabaseOperationsAction. - * @memberof google.spanner.executor.v1 - * @classdesc Represents a ListCloudDatabaseOperationsAction. - * @implements IListCloudDatabaseOperationsAction - * @constructor - * @param {google.spanner.executor.v1.IListCloudDatabaseOperationsAction=} [properties] Properties to set - */ - function ListCloudDatabaseOperationsAction(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListCloudDatabaseOperationsAction projectId. - * @member {string} projectId - * @memberof google.spanner.executor.v1.ListCloudDatabaseOperationsAction - * @instance - */ - ListCloudDatabaseOperationsAction.prototype.projectId = ""; - - /** - * ListCloudDatabaseOperationsAction instanceId. - * @member {string} instanceId - * @memberof google.spanner.executor.v1.ListCloudDatabaseOperationsAction - * @instance - */ - ListCloudDatabaseOperationsAction.prototype.instanceId = ""; - - /** - * ListCloudDatabaseOperationsAction filter. - * @member {string} filter - * @memberof google.spanner.executor.v1.ListCloudDatabaseOperationsAction - * @instance - */ - ListCloudDatabaseOperationsAction.prototype.filter = ""; - - /** - * ListCloudDatabaseOperationsAction pageSize. - * @member {number} pageSize - * @memberof google.spanner.executor.v1.ListCloudDatabaseOperationsAction - * @instance - */ - ListCloudDatabaseOperationsAction.prototype.pageSize = 0; - - /** - * ListCloudDatabaseOperationsAction pageToken. - * @member {string} pageToken - * @memberof google.spanner.executor.v1.ListCloudDatabaseOperationsAction - * @instance - */ - ListCloudDatabaseOperationsAction.prototype.pageToken = ""; - - /** - * Creates a new ListCloudDatabaseOperationsAction instance using the specified properties. - * @function create - * @memberof google.spanner.executor.v1.ListCloudDatabaseOperationsAction - * @static - * @param {google.spanner.executor.v1.IListCloudDatabaseOperationsAction=} [properties] Properties to set - * @returns {google.spanner.executor.v1.ListCloudDatabaseOperationsAction} ListCloudDatabaseOperationsAction instance - */ - ListCloudDatabaseOperationsAction.create = function create(properties) { - return new ListCloudDatabaseOperationsAction(properties); - }; - - /** - * Encodes the specified ListCloudDatabaseOperationsAction message. Does not implicitly {@link google.spanner.executor.v1.ListCloudDatabaseOperationsAction.verify|verify} messages. - * @function encode - * @memberof google.spanner.executor.v1.ListCloudDatabaseOperationsAction - * @static - * @param {google.spanner.executor.v1.IListCloudDatabaseOperationsAction} message ListCloudDatabaseOperationsAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListCloudDatabaseOperationsAction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); - if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.instanceId); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.filter); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.pageToken); - return writer; - }; - - /** - * Encodes the specified ListCloudDatabaseOperationsAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.ListCloudDatabaseOperationsAction.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.executor.v1.ListCloudDatabaseOperationsAction - * @static - * @param {google.spanner.executor.v1.IListCloudDatabaseOperationsAction} message ListCloudDatabaseOperationsAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListCloudDatabaseOperationsAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListCloudDatabaseOperationsAction message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.executor.v1.ListCloudDatabaseOperationsAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.executor.v1.ListCloudDatabaseOperationsAction} ListCloudDatabaseOperationsAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListCloudDatabaseOperationsAction.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.ListCloudDatabaseOperationsAction(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.projectId = reader.string(); - break; - } - case 2: { - message.instanceId = reader.string(); - break; - } - case 3: { - message.filter = reader.string(); - break; - } - case 4: { - message.pageSize = reader.int32(); - break; - } - case 5: { - message.pageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListCloudDatabaseOperationsAction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.executor.v1.ListCloudDatabaseOperationsAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.executor.v1.ListCloudDatabaseOperationsAction} ListCloudDatabaseOperationsAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListCloudDatabaseOperationsAction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListCloudDatabaseOperationsAction message. - * @function verify - * @memberof google.spanner.executor.v1.ListCloudDatabaseOperationsAction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListCloudDatabaseOperationsAction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.projectId != null && message.hasOwnProperty("projectId")) - if (!$util.isString(message.projectId)) - return "projectId: string expected"; - if (message.instanceId != null && message.hasOwnProperty("instanceId")) - if (!$util.isString(message.instanceId)) - return "instanceId: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - return null; - }; - - /** - * Creates a ListCloudDatabaseOperationsAction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.executor.v1.ListCloudDatabaseOperationsAction - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.executor.v1.ListCloudDatabaseOperationsAction} ListCloudDatabaseOperationsAction - */ - ListCloudDatabaseOperationsAction.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.executor.v1.ListCloudDatabaseOperationsAction) - return object; - var message = new $root.google.spanner.executor.v1.ListCloudDatabaseOperationsAction(); - if (object.projectId != null) - message.projectId = String(object.projectId); - if (object.instanceId != null) - message.instanceId = String(object.instanceId); - if (object.filter != null) - message.filter = String(object.filter); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - return message; - }; - - /** - * Creates a plain object from a ListCloudDatabaseOperationsAction message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.executor.v1.ListCloudDatabaseOperationsAction - * @static - * @param {google.spanner.executor.v1.ListCloudDatabaseOperationsAction} message ListCloudDatabaseOperationsAction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListCloudDatabaseOperationsAction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.projectId = ""; - object.instanceId = ""; - object.filter = ""; - object.pageSize = 0; - object.pageToken = ""; - } - if (message.projectId != null && message.hasOwnProperty("projectId")) - object.projectId = message.projectId; - if (message.instanceId != null && message.hasOwnProperty("instanceId")) - object.instanceId = message.instanceId; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - return object; - }; - - /** - * Converts this ListCloudDatabaseOperationsAction to JSON. - * @function toJSON - * @memberof google.spanner.executor.v1.ListCloudDatabaseOperationsAction - * @instance - * @returns {Object.} JSON object - */ - ListCloudDatabaseOperationsAction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListCloudDatabaseOperationsAction - * @function getTypeUrl - * @memberof google.spanner.executor.v1.ListCloudDatabaseOperationsAction - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListCloudDatabaseOperationsAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.executor.v1.ListCloudDatabaseOperationsAction"; - }; - - return ListCloudDatabaseOperationsAction; - })(); - - v1.RestoreCloudDatabaseAction = (function() { - - /** - * Properties of a RestoreCloudDatabaseAction. - * @memberof google.spanner.executor.v1 - * @interface IRestoreCloudDatabaseAction - * @property {string|null} [projectId] RestoreCloudDatabaseAction projectId - * @property {string|null} [backupInstanceId] RestoreCloudDatabaseAction backupInstanceId - * @property {string|null} [backupId] RestoreCloudDatabaseAction backupId - * @property {string|null} [databaseInstanceId] RestoreCloudDatabaseAction databaseInstanceId - * @property {string|null} [databaseId] RestoreCloudDatabaseAction databaseId - * @property {google.spanner.admin.database.v1.IEncryptionConfig|null} [encryptionConfig] RestoreCloudDatabaseAction encryptionConfig - */ - - /** - * Constructs a new RestoreCloudDatabaseAction. - * @memberof google.spanner.executor.v1 - * @classdesc Represents a RestoreCloudDatabaseAction. - * @implements IRestoreCloudDatabaseAction - * @constructor - * @param {google.spanner.executor.v1.IRestoreCloudDatabaseAction=} [properties] Properties to set - */ - function RestoreCloudDatabaseAction(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RestoreCloudDatabaseAction projectId. - * @member {string} projectId - * @memberof google.spanner.executor.v1.RestoreCloudDatabaseAction - * @instance - */ - RestoreCloudDatabaseAction.prototype.projectId = ""; - - /** - * RestoreCloudDatabaseAction backupInstanceId. - * @member {string} backupInstanceId - * @memberof google.spanner.executor.v1.RestoreCloudDatabaseAction - * @instance - */ - RestoreCloudDatabaseAction.prototype.backupInstanceId = ""; - - /** - * RestoreCloudDatabaseAction backupId. - * @member {string} backupId - * @memberof google.spanner.executor.v1.RestoreCloudDatabaseAction - * @instance - */ - RestoreCloudDatabaseAction.prototype.backupId = ""; - - /** - * RestoreCloudDatabaseAction databaseInstanceId. - * @member {string} databaseInstanceId - * @memberof google.spanner.executor.v1.RestoreCloudDatabaseAction - * @instance - */ - RestoreCloudDatabaseAction.prototype.databaseInstanceId = ""; - - /** - * RestoreCloudDatabaseAction databaseId. - * @member {string} databaseId - * @memberof google.spanner.executor.v1.RestoreCloudDatabaseAction - * @instance - */ - RestoreCloudDatabaseAction.prototype.databaseId = ""; - - /** - * RestoreCloudDatabaseAction encryptionConfig. - * @member {google.spanner.admin.database.v1.IEncryptionConfig|null|undefined} encryptionConfig - * @memberof google.spanner.executor.v1.RestoreCloudDatabaseAction - * @instance - */ - RestoreCloudDatabaseAction.prototype.encryptionConfig = null; - - /** - * Creates a new RestoreCloudDatabaseAction instance using the specified properties. - * @function create - * @memberof google.spanner.executor.v1.RestoreCloudDatabaseAction - * @static - * @param {google.spanner.executor.v1.IRestoreCloudDatabaseAction=} [properties] Properties to set - * @returns {google.spanner.executor.v1.RestoreCloudDatabaseAction} RestoreCloudDatabaseAction instance - */ - RestoreCloudDatabaseAction.create = function create(properties) { - return new RestoreCloudDatabaseAction(properties); - }; - - /** - * Encodes the specified RestoreCloudDatabaseAction message. Does not implicitly {@link google.spanner.executor.v1.RestoreCloudDatabaseAction.verify|verify} messages. - * @function encode - * @memberof google.spanner.executor.v1.RestoreCloudDatabaseAction - * @static - * @param {google.spanner.executor.v1.IRestoreCloudDatabaseAction} message RestoreCloudDatabaseAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RestoreCloudDatabaseAction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); - if (message.backupInstanceId != null && Object.hasOwnProperty.call(message, "backupInstanceId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.backupInstanceId); - if (message.backupId != null && Object.hasOwnProperty.call(message, "backupId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.backupId); - if (message.databaseInstanceId != null && Object.hasOwnProperty.call(message, "databaseInstanceId")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.databaseInstanceId); - if (message.databaseId != null && Object.hasOwnProperty.call(message, "databaseId")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.databaseId); - if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) - $root.google.spanner.admin.database.v1.EncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified RestoreCloudDatabaseAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.RestoreCloudDatabaseAction.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.executor.v1.RestoreCloudDatabaseAction - * @static - * @param {google.spanner.executor.v1.IRestoreCloudDatabaseAction} message RestoreCloudDatabaseAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RestoreCloudDatabaseAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RestoreCloudDatabaseAction message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.executor.v1.RestoreCloudDatabaseAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.executor.v1.RestoreCloudDatabaseAction} RestoreCloudDatabaseAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RestoreCloudDatabaseAction.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.RestoreCloudDatabaseAction(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.projectId = reader.string(); - break; - } - case 2: { - message.backupInstanceId = reader.string(); - break; - } - case 3: { - message.backupId = reader.string(); - break; - } - case 4: { - message.databaseInstanceId = reader.string(); - break; - } - case 5: { - message.databaseId = reader.string(); - break; - } - case 7: { - message.encryptionConfig = $root.google.spanner.admin.database.v1.EncryptionConfig.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RestoreCloudDatabaseAction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.executor.v1.RestoreCloudDatabaseAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.executor.v1.RestoreCloudDatabaseAction} RestoreCloudDatabaseAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RestoreCloudDatabaseAction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RestoreCloudDatabaseAction message. - * @function verify - * @memberof google.spanner.executor.v1.RestoreCloudDatabaseAction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RestoreCloudDatabaseAction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.projectId != null && message.hasOwnProperty("projectId")) - if (!$util.isString(message.projectId)) - return "projectId: string expected"; - if (message.backupInstanceId != null && message.hasOwnProperty("backupInstanceId")) - if (!$util.isString(message.backupInstanceId)) - return "backupInstanceId: string expected"; - if (message.backupId != null && message.hasOwnProperty("backupId")) - if (!$util.isString(message.backupId)) - return "backupId: string expected"; - if (message.databaseInstanceId != null && message.hasOwnProperty("databaseInstanceId")) - if (!$util.isString(message.databaseInstanceId)) - return "databaseInstanceId: string expected"; - if (message.databaseId != null && message.hasOwnProperty("databaseId")) - if (!$util.isString(message.databaseId)) - return "databaseId: string expected"; - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { - var error = $root.google.spanner.admin.database.v1.EncryptionConfig.verify(message.encryptionConfig); - if (error) - return "encryptionConfig." + error; - } - return null; - }; - - /** - * Creates a RestoreCloudDatabaseAction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.executor.v1.RestoreCloudDatabaseAction - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.executor.v1.RestoreCloudDatabaseAction} RestoreCloudDatabaseAction - */ - RestoreCloudDatabaseAction.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.executor.v1.RestoreCloudDatabaseAction) - return object; - var message = new $root.google.spanner.executor.v1.RestoreCloudDatabaseAction(); - if (object.projectId != null) - message.projectId = String(object.projectId); - if (object.backupInstanceId != null) - message.backupInstanceId = String(object.backupInstanceId); - if (object.backupId != null) - message.backupId = String(object.backupId); - if (object.databaseInstanceId != null) - message.databaseInstanceId = String(object.databaseInstanceId); - if (object.databaseId != null) - message.databaseId = String(object.databaseId); - if (object.encryptionConfig != null) { - if (typeof object.encryptionConfig !== "object") - throw TypeError(".google.spanner.executor.v1.RestoreCloudDatabaseAction.encryptionConfig: object expected"); - message.encryptionConfig = $root.google.spanner.admin.database.v1.EncryptionConfig.fromObject(object.encryptionConfig); - } - return message; - }; - - /** - * Creates a plain object from a RestoreCloudDatabaseAction message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.executor.v1.RestoreCloudDatabaseAction - * @static - * @param {google.spanner.executor.v1.RestoreCloudDatabaseAction} message RestoreCloudDatabaseAction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RestoreCloudDatabaseAction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.projectId = ""; - object.backupInstanceId = ""; - object.backupId = ""; - object.databaseInstanceId = ""; - object.databaseId = ""; - object.encryptionConfig = null; - } - if (message.projectId != null && message.hasOwnProperty("projectId")) - object.projectId = message.projectId; - if (message.backupInstanceId != null && message.hasOwnProperty("backupInstanceId")) - object.backupInstanceId = message.backupInstanceId; - if (message.backupId != null && message.hasOwnProperty("backupId")) - object.backupId = message.backupId; - if (message.databaseInstanceId != null && message.hasOwnProperty("databaseInstanceId")) - object.databaseInstanceId = message.databaseInstanceId; - if (message.databaseId != null && message.hasOwnProperty("databaseId")) - object.databaseId = message.databaseId; - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) - object.encryptionConfig = $root.google.spanner.admin.database.v1.EncryptionConfig.toObject(message.encryptionConfig, options); - return object; - }; - - /** - * Converts this RestoreCloudDatabaseAction to JSON. - * @function toJSON - * @memberof google.spanner.executor.v1.RestoreCloudDatabaseAction - * @instance - * @returns {Object.} JSON object - */ - RestoreCloudDatabaseAction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RestoreCloudDatabaseAction - * @function getTypeUrl - * @memberof google.spanner.executor.v1.RestoreCloudDatabaseAction - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RestoreCloudDatabaseAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.executor.v1.RestoreCloudDatabaseAction"; - }; - - return RestoreCloudDatabaseAction; - })(); - - v1.GetCloudDatabaseAction = (function() { - - /** - * Properties of a GetCloudDatabaseAction. - * @memberof google.spanner.executor.v1 - * @interface IGetCloudDatabaseAction - * @property {string|null} [projectId] GetCloudDatabaseAction projectId - * @property {string|null} [instanceId] GetCloudDatabaseAction instanceId - * @property {string|null} [databaseId] GetCloudDatabaseAction databaseId - */ - - /** - * Constructs a new GetCloudDatabaseAction. - * @memberof google.spanner.executor.v1 - * @classdesc Represents a GetCloudDatabaseAction. - * @implements IGetCloudDatabaseAction - * @constructor - * @param {google.spanner.executor.v1.IGetCloudDatabaseAction=} [properties] Properties to set - */ - function GetCloudDatabaseAction(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetCloudDatabaseAction projectId. - * @member {string} projectId - * @memberof google.spanner.executor.v1.GetCloudDatabaseAction - * @instance - */ - GetCloudDatabaseAction.prototype.projectId = ""; - - /** - * GetCloudDatabaseAction instanceId. - * @member {string} instanceId - * @memberof google.spanner.executor.v1.GetCloudDatabaseAction - * @instance - */ - GetCloudDatabaseAction.prototype.instanceId = ""; - - /** - * GetCloudDatabaseAction databaseId. - * @member {string} databaseId - * @memberof google.spanner.executor.v1.GetCloudDatabaseAction - * @instance - */ - GetCloudDatabaseAction.prototype.databaseId = ""; - - /** - * Creates a new GetCloudDatabaseAction instance using the specified properties. - * @function create - * @memberof google.spanner.executor.v1.GetCloudDatabaseAction - * @static - * @param {google.spanner.executor.v1.IGetCloudDatabaseAction=} [properties] Properties to set - * @returns {google.spanner.executor.v1.GetCloudDatabaseAction} GetCloudDatabaseAction instance - */ - GetCloudDatabaseAction.create = function create(properties) { - return new GetCloudDatabaseAction(properties); - }; - - /** - * Encodes the specified GetCloudDatabaseAction message. Does not implicitly {@link google.spanner.executor.v1.GetCloudDatabaseAction.verify|verify} messages. - * @function encode - * @memberof google.spanner.executor.v1.GetCloudDatabaseAction - * @static - * @param {google.spanner.executor.v1.IGetCloudDatabaseAction} message GetCloudDatabaseAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetCloudDatabaseAction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); - if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.instanceId); - if (message.databaseId != null && Object.hasOwnProperty.call(message, "databaseId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.databaseId); - return writer; - }; - - /** - * Encodes the specified GetCloudDatabaseAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.GetCloudDatabaseAction.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.executor.v1.GetCloudDatabaseAction - * @static - * @param {google.spanner.executor.v1.IGetCloudDatabaseAction} message GetCloudDatabaseAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetCloudDatabaseAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetCloudDatabaseAction message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.executor.v1.GetCloudDatabaseAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.executor.v1.GetCloudDatabaseAction} GetCloudDatabaseAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetCloudDatabaseAction.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.GetCloudDatabaseAction(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.projectId = reader.string(); - break; - } - case 2: { - message.instanceId = reader.string(); - break; - } - case 3: { - message.databaseId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetCloudDatabaseAction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.executor.v1.GetCloudDatabaseAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.executor.v1.GetCloudDatabaseAction} GetCloudDatabaseAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetCloudDatabaseAction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetCloudDatabaseAction message. - * @function verify - * @memberof google.spanner.executor.v1.GetCloudDatabaseAction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetCloudDatabaseAction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.projectId != null && message.hasOwnProperty("projectId")) - if (!$util.isString(message.projectId)) - return "projectId: string expected"; - if (message.instanceId != null && message.hasOwnProperty("instanceId")) - if (!$util.isString(message.instanceId)) - return "instanceId: string expected"; - if (message.databaseId != null && message.hasOwnProperty("databaseId")) - if (!$util.isString(message.databaseId)) - return "databaseId: string expected"; - return null; - }; - - /** - * Creates a GetCloudDatabaseAction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.executor.v1.GetCloudDatabaseAction - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.executor.v1.GetCloudDatabaseAction} GetCloudDatabaseAction - */ - GetCloudDatabaseAction.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.executor.v1.GetCloudDatabaseAction) - return object; - var message = new $root.google.spanner.executor.v1.GetCloudDatabaseAction(); - if (object.projectId != null) - message.projectId = String(object.projectId); - if (object.instanceId != null) - message.instanceId = String(object.instanceId); - if (object.databaseId != null) - message.databaseId = String(object.databaseId); - return message; - }; - - /** - * Creates a plain object from a GetCloudDatabaseAction message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.executor.v1.GetCloudDatabaseAction - * @static - * @param {google.spanner.executor.v1.GetCloudDatabaseAction} message GetCloudDatabaseAction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetCloudDatabaseAction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.projectId = ""; - object.instanceId = ""; - object.databaseId = ""; - } - if (message.projectId != null && message.hasOwnProperty("projectId")) - object.projectId = message.projectId; - if (message.instanceId != null && message.hasOwnProperty("instanceId")) - object.instanceId = message.instanceId; - if (message.databaseId != null && message.hasOwnProperty("databaseId")) - object.databaseId = message.databaseId; - return object; - }; - - /** - * Converts this GetCloudDatabaseAction to JSON. - * @function toJSON - * @memberof google.spanner.executor.v1.GetCloudDatabaseAction - * @instance - * @returns {Object.} JSON object - */ - GetCloudDatabaseAction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetCloudDatabaseAction - * @function getTypeUrl - * @memberof google.spanner.executor.v1.GetCloudDatabaseAction - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetCloudDatabaseAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.executor.v1.GetCloudDatabaseAction"; - }; - - return GetCloudDatabaseAction; - })(); - - v1.CreateCloudBackupAction = (function() { - - /** - * Properties of a CreateCloudBackupAction. - * @memberof google.spanner.executor.v1 - * @interface ICreateCloudBackupAction - * @property {string|null} [projectId] CreateCloudBackupAction projectId - * @property {string|null} [instanceId] CreateCloudBackupAction instanceId - * @property {string|null} [backupId] CreateCloudBackupAction backupId - * @property {string|null} [databaseId] CreateCloudBackupAction databaseId - * @property {google.protobuf.ITimestamp|null} [expireTime] CreateCloudBackupAction expireTime - * @property {google.protobuf.ITimestamp|null} [versionTime] CreateCloudBackupAction versionTime - * @property {google.spanner.admin.database.v1.IEncryptionConfig|null} [encryptionConfig] CreateCloudBackupAction encryptionConfig - */ - - /** - * Constructs a new CreateCloudBackupAction. - * @memberof google.spanner.executor.v1 - * @classdesc Represents a CreateCloudBackupAction. - * @implements ICreateCloudBackupAction - * @constructor - * @param {google.spanner.executor.v1.ICreateCloudBackupAction=} [properties] Properties to set - */ - function CreateCloudBackupAction(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateCloudBackupAction projectId. - * @member {string} projectId - * @memberof google.spanner.executor.v1.CreateCloudBackupAction - * @instance - */ - CreateCloudBackupAction.prototype.projectId = ""; - - /** - * CreateCloudBackupAction instanceId. - * @member {string} instanceId - * @memberof google.spanner.executor.v1.CreateCloudBackupAction - * @instance - */ - CreateCloudBackupAction.prototype.instanceId = ""; - - /** - * CreateCloudBackupAction backupId. - * @member {string} backupId - * @memberof google.spanner.executor.v1.CreateCloudBackupAction - * @instance - */ - CreateCloudBackupAction.prototype.backupId = ""; - - /** - * CreateCloudBackupAction databaseId. - * @member {string} databaseId - * @memberof google.spanner.executor.v1.CreateCloudBackupAction - * @instance - */ - CreateCloudBackupAction.prototype.databaseId = ""; - - /** - * CreateCloudBackupAction expireTime. - * @member {google.protobuf.ITimestamp|null|undefined} expireTime - * @memberof google.spanner.executor.v1.CreateCloudBackupAction - * @instance - */ - CreateCloudBackupAction.prototype.expireTime = null; - - /** - * CreateCloudBackupAction versionTime. - * @member {google.protobuf.ITimestamp|null|undefined} versionTime - * @memberof google.spanner.executor.v1.CreateCloudBackupAction - * @instance - */ - CreateCloudBackupAction.prototype.versionTime = null; - - /** - * CreateCloudBackupAction encryptionConfig. - * @member {google.spanner.admin.database.v1.IEncryptionConfig|null|undefined} encryptionConfig - * @memberof google.spanner.executor.v1.CreateCloudBackupAction - * @instance - */ - CreateCloudBackupAction.prototype.encryptionConfig = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(CreateCloudBackupAction.prototype, "_versionTime", { - get: $util.oneOfGetter($oneOfFields = ["versionTime"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new CreateCloudBackupAction instance using the specified properties. - * @function create - * @memberof google.spanner.executor.v1.CreateCloudBackupAction - * @static - * @param {google.spanner.executor.v1.ICreateCloudBackupAction=} [properties] Properties to set - * @returns {google.spanner.executor.v1.CreateCloudBackupAction} CreateCloudBackupAction instance - */ - CreateCloudBackupAction.create = function create(properties) { - return new CreateCloudBackupAction(properties); - }; - - /** - * Encodes the specified CreateCloudBackupAction message. Does not implicitly {@link google.spanner.executor.v1.CreateCloudBackupAction.verify|verify} messages. - * @function encode - * @memberof google.spanner.executor.v1.CreateCloudBackupAction - * @static - * @param {google.spanner.executor.v1.ICreateCloudBackupAction} message CreateCloudBackupAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateCloudBackupAction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); - if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.instanceId); - if (message.backupId != null && Object.hasOwnProperty.call(message, "backupId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.backupId); - if (message.databaseId != null && Object.hasOwnProperty.call(message, "databaseId")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.databaseId); - if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) - $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.versionTime != null && Object.hasOwnProperty.call(message, "versionTime")) - $root.google.protobuf.Timestamp.encode(message.versionTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) - $root.google.spanner.admin.database.v1.EncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CreateCloudBackupAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.CreateCloudBackupAction.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.executor.v1.CreateCloudBackupAction - * @static - * @param {google.spanner.executor.v1.ICreateCloudBackupAction} message CreateCloudBackupAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateCloudBackupAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateCloudBackupAction message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.executor.v1.CreateCloudBackupAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.executor.v1.CreateCloudBackupAction} CreateCloudBackupAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateCloudBackupAction.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.CreateCloudBackupAction(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.projectId = reader.string(); - break; - } - case 2: { - message.instanceId = reader.string(); - break; - } - case 3: { - message.backupId = reader.string(); - break; - } - case 4: { - message.databaseId = reader.string(); - break; - } - case 5: { - message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 6: { - message.versionTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 7: { - message.encryptionConfig = $root.google.spanner.admin.database.v1.EncryptionConfig.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateCloudBackupAction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.executor.v1.CreateCloudBackupAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.executor.v1.CreateCloudBackupAction} CreateCloudBackupAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateCloudBackupAction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateCloudBackupAction message. - * @function verify - * @memberof google.spanner.executor.v1.CreateCloudBackupAction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateCloudBackupAction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.projectId != null && message.hasOwnProperty("projectId")) - if (!$util.isString(message.projectId)) - return "projectId: string expected"; - if (message.instanceId != null && message.hasOwnProperty("instanceId")) - if (!$util.isString(message.instanceId)) - return "instanceId: string expected"; - if (message.backupId != null && message.hasOwnProperty("backupId")) - if (!$util.isString(message.backupId)) - return "backupId: string expected"; - if (message.databaseId != null && message.hasOwnProperty("databaseId")) - if (!$util.isString(message.databaseId)) - return "databaseId: string expected"; - if (message.expireTime != null && message.hasOwnProperty("expireTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.expireTime); - if (error) - return "expireTime." + error; - } - if (message.versionTime != null && message.hasOwnProperty("versionTime")) { - properties._versionTime = 1; - { - var error = $root.google.protobuf.Timestamp.verify(message.versionTime); - if (error) - return "versionTime." + error; - } - } - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { - var error = $root.google.spanner.admin.database.v1.EncryptionConfig.verify(message.encryptionConfig); - if (error) - return "encryptionConfig." + error; - } - return null; - }; - - /** - * Creates a CreateCloudBackupAction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.executor.v1.CreateCloudBackupAction - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.executor.v1.CreateCloudBackupAction} CreateCloudBackupAction - */ - CreateCloudBackupAction.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.executor.v1.CreateCloudBackupAction) - return object; - var message = new $root.google.spanner.executor.v1.CreateCloudBackupAction(); - if (object.projectId != null) - message.projectId = String(object.projectId); - if (object.instanceId != null) - message.instanceId = String(object.instanceId); - if (object.backupId != null) - message.backupId = String(object.backupId); - if (object.databaseId != null) - message.databaseId = String(object.databaseId); - if (object.expireTime != null) { - if (typeof object.expireTime !== "object") - throw TypeError(".google.spanner.executor.v1.CreateCloudBackupAction.expireTime: object expected"); - message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); - } - if (object.versionTime != null) { - if (typeof object.versionTime !== "object") - throw TypeError(".google.spanner.executor.v1.CreateCloudBackupAction.versionTime: object expected"); - message.versionTime = $root.google.protobuf.Timestamp.fromObject(object.versionTime); - } - if (object.encryptionConfig != null) { - if (typeof object.encryptionConfig !== "object") - throw TypeError(".google.spanner.executor.v1.CreateCloudBackupAction.encryptionConfig: object expected"); - message.encryptionConfig = $root.google.spanner.admin.database.v1.EncryptionConfig.fromObject(object.encryptionConfig); - } - return message; - }; - - /** - * Creates a plain object from a CreateCloudBackupAction message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.executor.v1.CreateCloudBackupAction - * @static - * @param {google.spanner.executor.v1.CreateCloudBackupAction} message CreateCloudBackupAction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateCloudBackupAction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.projectId = ""; - object.instanceId = ""; - object.backupId = ""; - object.databaseId = ""; - object.expireTime = null; - object.encryptionConfig = null; - } - if (message.projectId != null && message.hasOwnProperty("projectId")) - object.projectId = message.projectId; - if (message.instanceId != null && message.hasOwnProperty("instanceId")) - object.instanceId = message.instanceId; - if (message.backupId != null && message.hasOwnProperty("backupId")) - object.backupId = message.backupId; - if (message.databaseId != null && message.hasOwnProperty("databaseId")) - object.databaseId = message.databaseId; - if (message.expireTime != null && message.hasOwnProperty("expireTime")) - object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); - if (message.versionTime != null && message.hasOwnProperty("versionTime")) { - object.versionTime = $root.google.protobuf.Timestamp.toObject(message.versionTime, options); - if (options.oneofs) - object._versionTime = "versionTime"; - } - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) - object.encryptionConfig = $root.google.spanner.admin.database.v1.EncryptionConfig.toObject(message.encryptionConfig, options); - return object; - }; - - /** - * Converts this CreateCloudBackupAction to JSON. - * @function toJSON - * @memberof google.spanner.executor.v1.CreateCloudBackupAction - * @instance - * @returns {Object.} JSON object - */ - CreateCloudBackupAction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateCloudBackupAction - * @function getTypeUrl - * @memberof google.spanner.executor.v1.CreateCloudBackupAction - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateCloudBackupAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.executor.v1.CreateCloudBackupAction"; - }; - - return CreateCloudBackupAction; - })(); - - v1.CopyCloudBackupAction = (function() { - - /** - * Properties of a CopyCloudBackupAction. - * @memberof google.spanner.executor.v1 - * @interface ICopyCloudBackupAction - * @property {string|null} [projectId] CopyCloudBackupAction projectId - * @property {string|null} [instanceId] CopyCloudBackupAction instanceId - * @property {string|null} [backupId] CopyCloudBackupAction backupId - * @property {string|null} [sourceBackup] CopyCloudBackupAction sourceBackup - * @property {google.protobuf.ITimestamp|null} [expireTime] CopyCloudBackupAction expireTime - */ - - /** - * Constructs a new CopyCloudBackupAction. - * @memberof google.spanner.executor.v1 - * @classdesc Represents a CopyCloudBackupAction. - * @implements ICopyCloudBackupAction - * @constructor - * @param {google.spanner.executor.v1.ICopyCloudBackupAction=} [properties] Properties to set - */ - function CopyCloudBackupAction(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CopyCloudBackupAction projectId. - * @member {string} projectId - * @memberof google.spanner.executor.v1.CopyCloudBackupAction - * @instance - */ - CopyCloudBackupAction.prototype.projectId = ""; - - /** - * CopyCloudBackupAction instanceId. - * @member {string} instanceId - * @memberof google.spanner.executor.v1.CopyCloudBackupAction - * @instance - */ - CopyCloudBackupAction.prototype.instanceId = ""; - - /** - * CopyCloudBackupAction backupId. - * @member {string} backupId - * @memberof google.spanner.executor.v1.CopyCloudBackupAction - * @instance - */ - CopyCloudBackupAction.prototype.backupId = ""; - - /** - * CopyCloudBackupAction sourceBackup. - * @member {string} sourceBackup - * @memberof google.spanner.executor.v1.CopyCloudBackupAction - * @instance - */ - CopyCloudBackupAction.prototype.sourceBackup = ""; - - /** - * CopyCloudBackupAction expireTime. - * @member {google.protobuf.ITimestamp|null|undefined} expireTime - * @memberof google.spanner.executor.v1.CopyCloudBackupAction - * @instance - */ - CopyCloudBackupAction.prototype.expireTime = null; - - /** - * Creates a new CopyCloudBackupAction instance using the specified properties. - * @function create - * @memberof google.spanner.executor.v1.CopyCloudBackupAction - * @static - * @param {google.spanner.executor.v1.ICopyCloudBackupAction=} [properties] Properties to set - * @returns {google.spanner.executor.v1.CopyCloudBackupAction} CopyCloudBackupAction instance - */ - CopyCloudBackupAction.create = function create(properties) { - return new CopyCloudBackupAction(properties); - }; - - /** - * Encodes the specified CopyCloudBackupAction message. Does not implicitly {@link google.spanner.executor.v1.CopyCloudBackupAction.verify|verify} messages. - * @function encode - * @memberof google.spanner.executor.v1.CopyCloudBackupAction - * @static - * @param {google.spanner.executor.v1.ICopyCloudBackupAction} message CopyCloudBackupAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CopyCloudBackupAction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); - if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.instanceId); - if (message.backupId != null && Object.hasOwnProperty.call(message, "backupId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.backupId); - if (message.sourceBackup != null && Object.hasOwnProperty.call(message, "sourceBackup")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.sourceBackup); - if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) - $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CopyCloudBackupAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.CopyCloudBackupAction.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.executor.v1.CopyCloudBackupAction - * @static - * @param {google.spanner.executor.v1.ICopyCloudBackupAction} message CopyCloudBackupAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CopyCloudBackupAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CopyCloudBackupAction message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.executor.v1.CopyCloudBackupAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.executor.v1.CopyCloudBackupAction} CopyCloudBackupAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CopyCloudBackupAction.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.CopyCloudBackupAction(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.projectId = reader.string(); - break; - } - case 2: { - message.instanceId = reader.string(); - break; - } - case 3: { - message.backupId = reader.string(); - break; - } - case 4: { - message.sourceBackup = reader.string(); - break; - } - case 5: { - message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CopyCloudBackupAction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.executor.v1.CopyCloudBackupAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.executor.v1.CopyCloudBackupAction} CopyCloudBackupAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CopyCloudBackupAction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CopyCloudBackupAction message. - * @function verify - * @memberof google.spanner.executor.v1.CopyCloudBackupAction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CopyCloudBackupAction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.projectId != null && message.hasOwnProperty("projectId")) - if (!$util.isString(message.projectId)) - return "projectId: string expected"; - if (message.instanceId != null && message.hasOwnProperty("instanceId")) - if (!$util.isString(message.instanceId)) - return "instanceId: string expected"; - if (message.backupId != null && message.hasOwnProperty("backupId")) - if (!$util.isString(message.backupId)) - return "backupId: string expected"; - if (message.sourceBackup != null && message.hasOwnProperty("sourceBackup")) - if (!$util.isString(message.sourceBackup)) - return "sourceBackup: string expected"; - if (message.expireTime != null && message.hasOwnProperty("expireTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.expireTime); - if (error) - return "expireTime." + error; - } - return null; - }; - - /** - * Creates a CopyCloudBackupAction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.executor.v1.CopyCloudBackupAction - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.executor.v1.CopyCloudBackupAction} CopyCloudBackupAction - */ - CopyCloudBackupAction.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.executor.v1.CopyCloudBackupAction) - return object; - var message = new $root.google.spanner.executor.v1.CopyCloudBackupAction(); - if (object.projectId != null) - message.projectId = String(object.projectId); - if (object.instanceId != null) - message.instanceId = String(object.instanceId); - if (object.backupId != null) - message.backupId = String(object.backupId); - if (object.sourceBackup != null) - message.sourceBackup = String(object.sourceBackup); - if (object.expireTime != null) { - if (typeof object.expireTime !== "object") - throw TypeError(".google.spanner.executor.v1.CopyCloudBackupAction.expireTime: object expected"); - message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); - } - return message; - }; - - /** - * Creates a plain object from a CopyCloudBackupAction message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.executor.v1.CopyCloudBackupAction - * @static - * @param {google.spanner.executor.v1.CopyCloudBackupAction} message CopyCloudBackupAction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CopyCloudBackupAction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.projectId = ""; - object.instanceId = ""; - object.backupId = ""; - object.sourceBackup = ""; - object.expireTime = null; - } - if (message.projectId != null && message.hasOwnProperty("projectId")) - object.projectId = message.projectId; - if (message.instanceId != null && message.hasOwnProperty("instanceId")) - object.instanceId = message.instanceId; - if (message.backupId != null && message.hasOwnProperty("backupId")) - object.backupId = message.backupId; - if (message.sourceBackup != null && message.hasOwnProperty("sourceBackup")) - object.sourceBackup = message.sourceBackup; - if (message.expireTime != null && message.hasOwnProperty("expireTime")) - object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); - return object; - }; - - /** - * Converts this CopyCloudBackupAction to JSON. - * @function toJSON - * @memberof google.spanner.executor.v1.CopyCloudBackupAction - * @instance - * @returns {Object.} JSON object - */ - CopyCloudBackupAction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CopyCloudBackupAction - * @function getTypeUrl - * @memberof google.spanner.executor.v1.CopyCloudBackupAction - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CopyCloudBackupAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.executor.v1.CopyCloudBackupAction"; - }; - - return CopyCloudBackupAction; - })(); - - v1.GetCloudBackupAction = (function() { - - /** - * Properties of a GetCloudBackupAction. - * @memberof google.spanner.executor.v1 - * @interface IGetCloudBackupAction - * @property {string|null} [projectId] GetCloudBackupAction projectId - * @property {string|null} [instanceId] GetCloudBackupAction instanceId - * @property {string|null} [backupId] GetCloudBackupAction backupId - */ - - /** - * Constructs a new GetCloudBackupAction. - * @memberof google.spanner.executor.v1 - * @classdesc Represents a GetCloudBackupAction. - * @implements IGetCloudBackupAction - * @constructor - * @param {google.spanner.executor.v1.IGetCloudBackupAction=} [properties] Properties to set - */ - function GetCloudBackupAction(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetCloudBackupAction projectId. - * @member {string} projectId - * @memberof google.spanner.executor.v1.GetCloudBackupAction - * @instance - */ - GetCloudBackupAction.prototype.projectId = ""; - - /** - * GetCloudBackupAction instanceId. - * @member {string} instanceId - * @memberof google.spanner.executor.v1.GetCloudBackupAction - * @instance - */ - GetCloudBackupAction.prototype.instanceId = ""; - - /** - * GetCloudBackupAction backupId. - * @member {string} backupId - * @memberof google.spanner.executor.v1.GetCloudBackupAction - * @instance - */ - GetCloudBackupAction.prototype.backupId = ""; - - /** - * Creates a new GetCloudBackupAction instance using the specified properties. - * @function create - * @memberof google.spanner.executor.v1.GetCloudBackupAction - * @static - * @param {google.spanner.executor.v1.IGetCloudBackupAction=} [properties] Properties to set - * @returns {google.spanner.executor.v1.GetCloudBackupAction} GetCloudBackupAction instance - */ - GetCloudBackupAction.create = function create(properties) { - return new GetCloudBackupAction(properties); - }; - - /** - * Encodes the specified GetCloudBackupAction message. Does not implicitly {@link google.spanner.executor.v1.GetCloudBackupAction.verify|verify} messages. - * @function encode - * @memberof google.spanner.executor.v1.GetCloudBackupAction - * @static - * @param {google.spanner.executor.v1.IGetCloudBackupAction} message GetCloudBackupAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetCloudBackupAction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); - if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.instanceId); - if (message.backupId != null && Object.hasOwnProperty.call(message, "backupId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.backupId); - return writer; - }; - - /** - * Encodes the specified GetCloudBackupAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.GetCloudBackupAction.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.executor.v1.GetCloudBackupAction - * @static - * @param {google.spanner.executor.v1.IGetCloudBackupAction} message GetCloudBackupAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetCloudBackupAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetCloudBackupAction message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.executor.v1.GetCloudBackupAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.executor.v1.GetCloudBackupAction} GetCloudBackupAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetCloudBackupAction.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.GetCloudBackupAction(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.projectId = reader.string(); - break; - } - case 2: { - message.instanceId = reader.string(); - break; - } - case 3: { - message.backupId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetCloudBackupAction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.executor.v1.GetCloudBackupAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.executor.v1.GetCloudBackupAction} GetCloudBackupAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetCloudBackupAction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetCloudBackupAction message. - * @function verify - * @memberof google.spanner.executor.v1.GetCloudBackupAction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetCloudBackupAction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.projectId != null && message.hasOwnProperty("projectId")) - if (!$util.isString(message.projectId)) - return "projectId: string expected"; - if (message.instanceId != null && message.hasOwnProperty("instanceId")) - if (!$util.isString(message.instanceId)) - return "instanceId: string expected"; - if (message.backupId != null && message.hasOwnProperty("backupId")) - if (!$util.isString(message.backupId)) - return "backupId: string expected"; - return null; - }; - - /** - * Creates a GetCloudBackupAction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.executor.v1.GetCloudBackupAction - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.executor.v1.GetCloudBackupAction} GetCloudBackupAction - */ - GetCloudBackupAction.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.executor.v1.GetCloudBackupAction) - return object; - var message = new $root.google.spanner.executor.v1.GetCloudBackupAction(); - if (object.projectId != null) - message.projectId = String(object.projectId); - if (object.instanceId != null) - message.instanceId = String(object.instanceId); - if (object.backupId != null) - message.backupId = String(object.backupId); - return message; - }; - - /** - * Creates a plain object from a GetCloudBackupAction message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.executor.v1.GetCloudBackupAction - * @static - * @param {google.spanner.executor.v1.GetCloudBackupAction} message GetCloudBackupAction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetCloudBackupAction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.projectId = ""; - object.instanceId = ""; - object.backupId = ""; - } - if (message.projectId != null && message.hasOwnProperty("projectId")) - object.projectId = message.projectId; - if (message.instanceId != null && message.hasOwnProperty("instanceId")) - object.instanceId = message.instanceId; - if (message.backupId != null && message.hasOwnProperty("backupId")) - object.backupId = message.backupId; - return object; - }; - - /** - * Converts this GetCloudBackupAction to JSON. - * @function toJSON - * @memberof google.spanner.executor.v1.GetCloudBackupAction - * @instance - * @returns {Object.} JSON object - */ - GetCloudBackupAction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetCloudBackupAction - * @function getTypeUrl - * @memberof google.spanner.executor.v1.GetCloudBackupAction - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetCloudBackupAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.executor.v1.GetCloudBackupAction"; - }; - - return GetCloudBackupAction; - })(); - - v1.UpdateCloudBackupAction = (function() { - - /** - * Properties of an UpdateCloudBackupAction. - * @memberof google.spanner.executor.v1 - * @interface IUpdateCloudBackupAction - * @property {string|null} [projectId] UpdateCloudBackupAction projectId - * @property {string|null} [instanceId] UpdateCloudBackupAction instanceId - * @property {string|null} [backupId] UpdateCloudBackupAction backupId - * @property {google.protobuf.ITimestamp|null} [expireTime] UpdateCloudBackupAction expireTime - */ - - /** - * Constructs a new UpdateCloudBackupAction. - * @memberof google.spanner.executor.v1 - * @classdesc Represents an UpdateCloudBackupAction. - * @implements IUpdateCloudBackupAction - * @constructor - * @param {google.spanner.executor.v1.IUpdateCloudBackupAction=} [properties] Properties to set - */ - function UpdateCloudBackupAction(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateCloudBackupAction projectId. - * @member {string} projectId - * @memberof google.spanner.executor.v1.UpdateCloudBackupAction - * @instance - */ - UpdateCloudBackupAction.prototype.projectId = ""; - - /** - * UpdateCloudBackupAction instanceId. - * @member {string} instanceId - * @memberof google.spanner.executor.v1.UpdateCloudBackupAction - * @instance - */ - UpdateCloudBackupAction.prototype.instanceId = ""; - - /** - * UpdateCloudBackupAction backupId. - * @member {string} backupId - * @memberof google.spanner.executor.v1.UpdateCloudBackupAction - * @instance - */ - UpdateCloudBackupAction.prototype.backupId = ""; - - /** - * UpdateCloudBackupAction expireTime. - * @member {google.protobuf.ITimestamp|null|undefined} expireTime - * @memberof google.spanner.executor.v1.UpdateCloudBackupAction - * @instance - */ - UpdateCloudBackupAction.prototype.expireTime = null; - - /** - * Creates a new UpdateCloudBackupAction instance using the specified properties. - * @function create - * @memberof google.spanner.executor.v1.UpdateCloudBackupAction - * @static - * @param {google.spanner.executor.v1.IUpdateCloudBackupAction=} [properties] Properties to set - * @returns {google.spanner.executor.v1.UpdateCloudBackupAction} UpdateCloudBackupAction instance - */ - UpdateCloudBackupAction.create = function create(properties) { - return new UpdateCloudBackupAction(properties); - }; - - /** - * Encodes the specified UpdateCloudBackupAction message. Does not implicitly {@link google.spanner.executor.v1.UpdateCloudBackupAction.verify|verify} messages. - * @function encode - * @memberof google.spanner.executor.v1.UpdateCloudBackupAction - * @static - * @param {google.spanner.executor.v1.IUpdateCloudBackupAction} message UpdateCloudBackupAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateCloudBackupAction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); - if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.instanceId); - if (message.backupId != null && Object.hasOwnProperty.call(message, "backupId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.backupId); - if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) - $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified UpdateCloudBackupAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.UpdateCloudBackupAction.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.executor.v1.UpdateCloudBackupAction - * @static - * @param {google.spanner.executor.v1.IUpdateCloudBackupAction} message UpdateCloudBackupAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateCloudBackupAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateCloudBackupAction message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.executor.v1.UpdateCloudBackupAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.executor.v1.UpdateCloudBackupAction} UpdateCloudBackupAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateCloudBackupAction.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.UpdateCloudBackupAction(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.projectId = reader.string(); - break; - } - case 2: { - message.instanceId = reader.string(); - break; - } - case 3: { - message.backupId = reader.string(); - break; - } - case 4: { - message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateCloudBackupAction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.executor.v1.UpdateCloudBackupAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.executor.v1.UpdateCloudBackupAction} UpdateCloudBackupAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateCloudBackupAction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateCloudBackupAction message. - * @function verify - * @memberof google.spanner.executor.v1.UpdateCloudBackupAction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateCloudBackupAction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.projectId != null && message.hasOwnProperty("projectId")) - if (!$util.isString(message.projectId)) - return "projectId: string expected"; - if (message.instanceId != null && message.hasOwnProperty("instanceId")) - if (!$util.isString(message.instanceId)) - return "instanceId: string expected"; - if (message.backupId != null && message.hasOwnProperty("backupId")) - if (!$util.isString(message.backupId)) - return "backupId: string expected"; - if (message.expireTime != null && message.hasOwnProperty("expireTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.expireTime); - if (error) - return "expireTime." + error; - } - return null; - }; - - /** - * Creates an UpdateCloudBackupAction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.executor.v1.UpdateCloudBackupAction - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.executor.v1.UpdateCloudBackupAction} UpdateCloudBackupAction - */ - UpdateCloudBackupAction.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.executor.v1.UpdateCloudBackupAction) - return object; - var message = new $root.google.spanner.executor.v1.UpdateCloudBackupAction(); - if (object.projectId != null) - message.projectId = String(object.projectId); - if (object.instanceId != null) - message.instanceId = String(object.instanceId); - if (object.backupId != null) - message.backupId = String(object.backupId); - if (object.expireTime != null) { - if (typeof object.expireTime !== "object") - throw TypeError(".google.spanner.executor.v1.UpdateCloudBackupAction.expireTime: object expected"); - message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); - } - return message; - }; - - /** - * Creates a plain object from an UpdateCloudBackupAction message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.executor.v1.UpdateCloudBackupAction - * @static - * @param {google.spanner.executor.v1.UpdateCloudBackupAction} message UpdateCloudBackupAction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateCloudBackupAction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.projectId = ""; - object.instanceId = ""; - object.backupId = ""; - object.expireTime = null; - } - if (message.projectId != null && message.hasOwnProperty("projectId")) - object.projectId = message.projectId; - if (message.instanceId != null && message.hasOwnProperty("instanceId")) - object.instanceId = message.instanceId; - if (message.backupId != null && message.hasOwnProperty("backupId")) - object.backupId = message.backupId; - if (message.expireTime != null && message.hasOwnProperty("expireTime")) - object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); - return object; - }; - - /** - * Converts this UpdateCloudBackupAction to JSON. - * @function toJSON - * @memberof google.spanner.executor.v1.UpdateCloudBackupAction - * @instance - * @returns {Object.} JSON object - */ - UpdateCloudBackupAction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateCloudBackupAction - * @function getTypeUrl - * @memberof google.spanner.executor.v1.UpdateCloudBackupAction - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateCloudBackupAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.executor.v1.UpdateCloudBackupAction"; - }; - - return UpdateCloudBackupAction; - })(); - - v1.DeleteCloudBackupAction = (function() { - - /** - * Properties of a DeleteCloudBackupAction. - * @memberof google.spanner.executor.v1 - * @interface IDeleteCloudBackupAction - * @property {string|null} [projectId] DeleteCloudBackupAction projectId - * @property {string|null} [instanceId] DeleteCloudBackupAction instanceId - * @property {string|null} [backupId] DeleteCloudBackupAction backupId - */ - - /** - * Constructs a new DeleteCloudBackupAction. - * @memberof google.spanner.executor.v1 - * @classdesc Represents a DeleteCloudBackupAction. - * @implements IDeleteCloudBackupAction - * @constructor - * @param {google.spanner.executor.v1.IDeleteCloudBackupAction=} [properties] Properties to set - */ - function DeleteCloudBackupAction(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteCloudBackupAction projectId. - * @member {string} projectId - * @memberof google.spanner.executor.v1.DeleteCloudBackupAction - * @instance - */ - DeleteCloudBackupAction.prototype.projectId = ""; - - /** - * DeleteCloudBackupAction instanceId. - * @member {string} instanceId - * @memberof google.spanner.executor.v1.DeleteCloudBackupAction - * @instance - */ - DeleteCloudBackupAction.prototype.instanceId = ""; - - /** - * DeleteCloudBackupAction backupId. - * @member {string} backupId - * @memberof google.spanner.executor.v1.DeleteCloudBackupAction - * @instance - */ - DeleteCloudBackupAction.prototype.backupId = ""; - - /** - * Creates a new DeleteCloudBackupAction instance using the specified properties. - * @function create - * @memberof google.spanner.executor.v1.DeleteCloudBackupAction - * @static - * @param {google.spanner.executor.v1.IDeleteCloudBackupAction=} [properties] Properties to set - * @returns {google.spanner.executor.v1.DeleteCloudBackupAction} DeleteCloudBackupAction instance - */ - DeleteCloudBackupAction.create = function create(properties) { - return new DeleteCloudBackupAction(properties); - }; - - /** - * Encodes the specified DeleteCloudBackupAction message. Does not implicitly {@link google.spanner.executor.v1.DeleteCloudBackupAction.verify|verify} messages. - * @function encode - * @memberof google.spanner.executor.v1.DeleteCloudBackupAction - * @static - * @param {google.spanner.executor.v1.IDeleteCloudBackupAction} message DeleteCloudBackupAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteCloudBackupAction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); - if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.instanceId); - if (message.backupId != null && Object.hasOwnProperty.call(message, "backupId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.backupId); - return writer; - }; - - /** - * Encodes the specified DeleteCloudBackupAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.DeleteCloudBackupAction.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.executor.v1.DeleteCloudBackupAction - * @static - * @param {google.spanner.executor.v1.IDeleteCloudBackupAction} message DeleteCloudBackupAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteCloudBackupAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteCloudBackupAction message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.executor.v1.DeleteCloudBackupAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.executor.v1.DeleteCloudBackupAction} DeleteCloudBackupAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteCloudBackupAction.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.DeleteCloudBackupAction(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.projectId = reader.string(); - break; - } - case 2: { - message.instanceId = reader.string(); - break; - } - case 3: { - message.backupId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteCloudBackupAction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.executor.v1.DeleteCloudBackupAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.executor.v1.DeleteCloudBackupAction} DeleteCloudBackupAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteCloudBackupAction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteCloudBackupAction message. - * @function verify - * @memberof google.spanner.executor.v1.DeleteCloudBackupAction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteCloudBackupAction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.projectId != null && message.hasOwnProperty("projectId")) - if (!$util.isString(message.projectId)) - return "projectId: string expected"; - if (message.instanceId != null && message.hasOwnProperty("instanceId")) - if (!$util.isString(message.instanceId)) - return "instanceId: string expected"; - if (message.backupId != null && message.hasOwnProperty("backupId")) - if (!$util.isString(message.backupId)) - return "backupId: string expected"; - return null; - }; - - /** - * Creates a DeleteCloudBackupAction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.executor.v1.DeleteCloudBackupAction - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.executor.v1.DeleteCloudBackupAction} DeleteCloudBackupAction - */ - DeleteCloudBackupAction.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.executor.v1.DeleteCloudBackupAction) - return object; - var message = new $root.google.spanner.executor.v1.DeleteCloudBackupAction(); - if (object.projectId != null) - message.projectId = String(object.projectId); - if (object.instanceId != null) - message.instanceId = String(object.instanceId); - if (object.backupId != null) - message.backupId = String(object.backupId); - return message; - }; - - /** - * Creates a plain object from a DeleteCloudBackupAction message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.executor.v1.DeleteCloudBackupAction - * @static - * @param {google.spanner.executor.v1.DeleteCloudBackupAction} message DeleteCloudBackupAction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteCloudBackupAction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.projectId = ""; - object.instanceId = ""; - object.backupId = ""; - } - if (message.projectId != null && message.hasOwnProperty("projectId")) - object.projectId = message.projectId; - if (message.instanceId != null && message.hasOwnProperty("instanceId")) - object.instanceId = message.instanceId; - if (message.backupId != null && message.hasOwnProperty("backupId")) - object.backupId = message.backupId; - return object; - }; - - /** - * Converts this DeleteCloudBackupAction to JSON. - * @function toJSON - * @memberof google.spanner.executor.v1.DeleteCloudBackupAction - * @instance - * @returns {Object.} JSON object - */ - DeleteCloudBackupAction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteCloudBackupAction - * @function getTypeUrl - * @memberof google.spanner.executor.v1.DeleteCloudBackupAction - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteCloudBackupAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.executor.v1.DeleteCloudBackupAction"; - }; - - return DeleteCloudBackupAction; - })(); - - v1.ListCloudBackupsAction = (function() { - - /** - * Properties of a ListCloudBackupsAction. - * @memberof google.spanner.executor.v1 - * @interface IListCloudBackupsAction - * @property {string|null} [projectId] ListCloudBackupsAction projectId - * @property {string|null} [instanceId] ListCloudBackupsAction instanceId - * @property {string|null} [filter] ListCloudBackupsAction filter - * @property {number|null} [pageSize] ListCloudBackupsAction pageSize - * @property {string|null} [pageToken] ListCloudBackupsAction pageToken - */ - - /** - * Constructs a new ListCloudBackupsAction. - * @memberof google.spanner.executor.v1 - * @classdesc Represents a ListCloudBackupsAction. - * @implements IListCloudBackupsAction - * @constructor - * @param {google.spanner.executor.v1.IListCloudBackupsAction=} [properties] Properties to set - */ - function ListCloudBackupsAction(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListCloudBackupsAction projectId. - * @member {string} projectId - * @memberof google.spanner.executor.v1.ListCloudBackupsAction - * @instance - */ - ListCloudBackupsAction.prototype.projectId = ""; - - /** - * ListCloudBackupsAction instanceId. - * @member {string} instanceId - * @memberof google.spanner.executor.v1.ListCloudBackupsAction - * @instance - */ - ListCloudBackupsAction.prototype.instanceId = ""; - - /** - * ListCloudBackupsAction filter. - * @member {string} filter - * @memberof google.spanner.executor.v1.ListCloudBackupsAction - * @instance - */ - ListCloudBackupsAction.prototype.filter = ""; - - /** - * ListCloudBackupsAction pageSize. - * @member {number} pageSize - * @memberof google.spanner.executor.v1.ListCloudBackupsAction - * @instance - */ - ListCloudBackupsAction.prototype.pageSize = 0; - - /** - * ListCloudBackupsAction pageToken. - * @member {string} pageToken - * @memberof google.spanner.executor.v1.ListCloudBackupsAction - * @instance - */ - ListCloudBackupsAction.prototype.pageToken = ""; - - /** - * Creates a new ListCloudBackupsAction instance using the specified properties. - * @function create - * @memberof google.spanner.executor.v1.ListCloudBackupsAction - * @static - * @param {google.spanner.executor.v1.IListCloudBackupsAction=} [properties] Properties to set - * @returns {google.spanner.executor.v1.ListCloudBackupsAction} ListCloudBackupsAction instance - */ - ListCloudBackupsAction.create = function create(properties) { - return new ListCloudBackupsAction(properties); - }; - - /** - * Encodes the specified ListCloudBackupsAction message. Does not implicitly {@link google.spanner.executor.v1.ListCloudBackupsAction.verify|verify} messages. - * @function encode - * @memberof google.spanner.executor.v1.ListCloudBackupsAction - * @static - * @param {google.spanner.executor.v1.IListCloudBackupsAction} message ListCloudBackupsAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListCloudBackupsAction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); - if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.instanceId); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.filter); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.pageToken); - return writer; - }; - - /** - * Encodes the specified ListCloudBackupsAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.ListCloudBackupsAction.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.executor.v1.ListCloudBackupsAction - * @static - * @param {google.spanner.executor.v1.IListCloudBackupsAction} message ListCloudBackupsAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListCloudBackupsAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListCloudBackupsAction message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.executor.v1.ListCloudBackupsAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.executor.v1.ListCloudBackupsAction} ListCloudBackupsAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListCloudBackupsAction.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.ListCloudBackupsAction(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.projectId = reader.string(); - break; - } - case 2: { - message.instanceId = reader.string(); - break; - } - case 3: { - message.filter = reader.string(); - break; - } - case 4: { - message.pageSize = reader.int32(); - break; - } - case 5: { - message.pageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListCloudBackupsAction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.executor.v1.ListCloudBackupsAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.executor.v1.ListCloudBackupsAction} ListCloudBackupsAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListCloudBackupsAction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListCloudBackupsAction message. - * @function verify - * @memberof google.spanner.executor.v1.ListCloudBackupsAction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListCloudBackupsAction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.projectId != null && message.hasOwnProperty("projectId")) - if (!$util.isString(message.projectId)) - return "projectId: string expected"; - if (message.instanceId != null && message.hasOwnProperty("instanceId")) - if (!$util.isString(message.instanceId)) - return "instanceId: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - return null; - }; - - /** - * Creates a ListCloudBackupsAction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.executor.v1.ListCloudBackupsAction - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.executor.v1.ListCloudBackupsAction} ListCloudBackupsAction - */ - ListCloudBackupsAction.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.executor.v1.ListCloudBackupsAction) - return object; - var message = new $root.google.spanner.executor.v1.ListCloudBackupsAction(); - if (object.projectId != null) - message.projectId = String(object.projectId); - if (object.instanceId != null) - message.instanceId = String(object.instanceId); - if (object.filter != null) - message.filter = String(object.filter); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - return message; - }; - - /** - * Creates a plain object from a ListCloudBackupsAction message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.executor.v1.ListCloudBackupsAction - * @static - * @param {google.spanner.executor.v1.ListCloudBackupsAction} message ListCloudBackupsAction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListCloudBackupsAction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.projectId = ""; - object.instanceId = ""; - object.filter = ""; - object.pageSize = 0; - object.pageToken = ""; - } - if (message.projectId != null && message.hasOwnProperty("projectId")) - object.projectId = message.projectId; - if (message.instanceId != null && message.hasOwnProperty("instanceId")) - object.instanceId = message.instanceId; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - return object; - }; - - /** - * Converts this ListCloudBackupsAction to JSON. - * @function toJSON - * @memberof google.spanner.executor.v1.ListCloudBackupsAction - * @instance - * @returns {Object.} JSON object - */ - ListCloudBackupsAction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListCloudBackupsAction - * @function getTypeUrl - * @memberof google.spanner.executor.v1.ListCloudBackupsAction - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListCloudBackupsAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.executor.v1.ListCloudBackupsAction"; - }; - - return ListCloudBackupsAction; - })(); - - v1.ListCloudBackupOperationsAction = (function() { - - /** - * Properties of a ListCloudBackupOperationsAction. - * @memberof google.spanner.executor.v1 - * @interface IListCloudBackupOperationsAction - * @property {string|null} [projectId] ListCloudBackupOperationsAction projectId - * @property {string|null} [instanceId] ListCloudBackupOperationsAction instanceId - * @property {string|null} [filter] ListCloudBackupOperationsAction filter - * @property {number|null} [pageSize] ListCloudBackupOperationsAction pageSize - * @property {string|null} [pageToken] ListCloudBackupOperationsAction pageToken - */ - - /** - * Constructs a new ListCloudBackupOperationsAction. - * @memberof google.spanner.executor.v1 - * @classdesc Represents a ListCloudBackupOperationsAction. - * @implements IListCloudBackupOperationsAction - * @constructor - * @param {google.spanner.executor.v1.IListCloudBackupOperationsAction=} [properties] Properties to set - */ - function ListCloudBackupOperationsAction(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListCloudBackupOperationsAction projectId. - * @member {string} projectId - * @memberof google.spanner.executor.v1.ListCloudBackupOperationsAction - * @instance - */ - ListCloudBackupOperationsAction.prototype.projectId = ""; - - /** - * ListCloudBackupOperationsAction instanceId. - * @member {string} instanceId - * @memberof google.spanner.executor.v1.ListCloudBackupOperationsAction - * @instance - */ - ListCloudBackupOperationsAction.prototype.instanceId = ""; - - /** - * ListCloudBackupOperationsAction filter. - * @member {string} filter - * @memberof google.spanner.executor.v1.ListCloudBackupOperationsAction - * @instance - */ - ListCloudBackupOperationsAction.prototype.filter = ""; - - /** - * ListCloudBackupOperationsAction pageSize. - * @member {number} pageSize - * @memberof google.spanner.executor.v1.ListCloudBackupOperationsAction - * @instance - */ - ListCloudBackupOperationsAction.prototype.pageSize = 0; - - /** - * ListCloudBackupOperationsAction pageToken. - * @member {string} pageToken - * @memberof google.spanner.executor.v1.ListCloudBackupOperationsAction - * @instance - */ - ListCloudBackupOperationsAction.prototype.pageToken = ""; - - /** - * Creates a new ListCloudBackupOperationsAction instance using the specified properties. - * @function create - * @memberof google.spanner.executor.v1.ListCloudBackupOperationsAction - * @static - * @param {google.spanner.executor.v1.IListCloudBackupOperationsAction=} [properties] Properties to set - * @returns {google.spanner.executor.v1.ListCloudBackupOperationsAction} ListCloudBackupOperationsAction instance - */ - ListCloudBackupOperationsAction.create = function create(properties) { - return new ListCloudBackupOperationsAction(properties); - }; - - /** - * Encodes the specified ListCloudBackupOperationsAction message. Does not implicitly {@link google.spanner.executor.v1.ListCloudBackupOperationsAction.verify|verify} messages. - * @function encode - * @memberof google.spanner.executor.v1.ListCloudBackupOperationsAction - * @static - * @param {google.spanner.executor.v1.IListCloudBackupOperationsAction} message ListCloudBackupOperationsAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListCloudBackupOperationsAction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); - if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.instanceId); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.filter); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.pageToken); - return writer; - }; - - /** - * Encodes the specified ListCloudBackupOperationsAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.ListCloudBackupOperationsAction.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.executor.v1.ListCloudBackupOperationsAction - * @static - * @param {google.spanner.executor.v1.IListCloudBackupOperationsAction} message ListCloudBackupOperationsAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListCloudBackupOperationsAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListCloudBackupOperationsAction message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.executor.v1.ListCloudBackupOperationsAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.executor.v1.ListCloudBackupOperationsAction} ListCloudBackupOperationsAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListCloudBackupOperationsAction.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.ListCloudBackupOperationsAction(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.projectId = reader.string(); - break; - } - case 2: { - message.instanceId = reader.string(); - break; - } - case 3: { - message.filter = reader.string(); - break; - } - case 4: { - message.pageSize = reader.int32(); - break; - } - case 5: { - message.pageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListCloudBackupOperationsAction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.executor.v1.ListCloudBackupOperationsAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.executor.v1.ListCloudBackupOperationsAction} ListCloudBackupOperationsAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListCloudBackupOperationsAction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListCloudBackupOperationsAction message. - * @function verify - * @memberof google.spanner.executor.v1.ListCloudBackupOperationsAction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListCloudBackupOperationsAction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.projectId != null && message.hasOwnProperty("projectId")) - if (!$util.isString(message.projectId)) - return "projectId: string expected"; - if (message.instanceId != null && message.hasOwnProperty("instanceId")) - if (!$util.isString(message.instanceId)) - return "instanceId: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - return null; - }; - - /** - * Creates a ListCloudBackupOperationsAction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.executor.v1.ListCloudBackupOperationsAction - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.executor.v1.ListCloudBackupOperationsAction} ListCloudBackupOperationsAction - */ - ListCloudBackupOperationsAction.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.executor.v1.ListCloudBackupOperationsAction) - return object; - var message = new $root.google.spanner.executor.v1.ListCloudBackupOperationsAction(); - if (object.projectId != null) - message.projectId = String(object.projectId); - if (object.instanceId != null) - message.instanceId = String(object.instanceId); - if (object.filter != null) - message.filter = String(object.filter); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - return message; - }; - - /** - * Creates a plain object from a ListCloudBackupOperationsAction message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.executor.v1.ListCloudBackupOperationsAction - * @static - * @param {google.spanner.executor.v1.ListCloudBackupOperationsAction} message ListCloudBackupOperationsAction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListCloudBackupOperationsAction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.projectId = ""; - object.instanceId = ""; - object.filter = ""; - object.pageSize = 0; - object.pageToken = ""; - } - if (message.projectId != null && message.hasOwnProperty("projectId")) - object.projectId = message.projectId; - if (message.instanceId != null && message.hasOwnProperty("instanceId")) - object.instanceId = message.instanceId; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - return object; - }; - - /** - * Converts this ListCloudBackupOperationsAction to JSON. - * @function toJSON - * @memberof google.spanner.executor.v1.ListCloudBackupOperationsAction - * @instance - * @returns {Object.} JSON object - */ - ListCloudBackupOperationsAction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListCloudBackupOperationsAction - * @function getTypeUrl - * @memberof google.spanner.executor.v1.ListCloudBackupOperationsAction - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListCloudBackupOperationsAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.executor.v1.ListCloudBackupOperationsAction"; - }; - - return ListCloudBackupOperationsAction; - })(); - - v1.GetOperationAction = (function() { - - /** - * Properties of a GetOperationAction. - * @memberof google.spanner.executor.v1 - * @interface IGetOperationAction - * @property {string|null} [operation] GetOperationAction operation - */ - - /** - * Constructs a new GetOperationAction. - * @memberof google.spanner.executor.v1 - * @classdesc Represents a GetOperationAction. - * @implements IGetOperationAction - * @constructor - * @param {google.spanner.executor.v1.IGetOperationAction=} [properties] Properties to set - */ - function GetOperationAction(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetOperationAction operation. - * @member {string} operation - * @memberof google.spanner.executor.v1.GetOperationAction - * @instance - */ - GetOperationAction.prototype.operation = ""; - - /** - * Creates a new GetOperationAction instance using the specified properties. - * @function create - * @memberof google.spanner.executor.v1.GetOperationAction - * @static - * @param {google.spanner.executor.v1.IGetOperationAction=} [properties] Properties to set - * @returns {google.spanner.executor.v1.GetOperationAction} GetOperationAction instance - */ - GetOperationAction.create = function create(properties) { - return new GetOperationAction(properties); - }; - - /** - * Encodes the specified GetOperationAction message. Does not implicitly {@link google.spanner.executor.v1.GetOperationAction.verify|verify} messages. - * @function encode - * @memberof google.spanner.executor.v1.GetOperationAction - * @static - * @param {google.spanner.executor.v1.IGetOperationAction} message GetOperationAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetOperationAction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.operation != null && Object.hasOwnProperty.call(message, "operation")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.operation); - return writer; - }; - - /** - * Encodes the specified GetOperationAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.GetOperationAction.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.executor.v1.GetOperationAction - * @static - * @param {google.spanner.executor.v1.IGetOperationAction} message GetOperationAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetOperationAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetOperationAction message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.executor.v1.GetOperationAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.executor.v1.GetOperationAction} GetOperationAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetOperationAction.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.GetOperationAction(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.operation = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetOperationAction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.executor.v1.GetOperationAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.executor.v1.GetOperationAction} GetOperationAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetOperationAction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetOperationAction message. - * @function verify - * @memberof google.spanner.executor.v1.GetOperationAction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetOperationAction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.operation != null && message.hasOwnProperty("operation")) - if (!$util.isString(message.operation)) - return "operation: string expected"; - return null; - }; - - /** - * Creates a GetOperationAction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.executor.v1.GetOperationAction - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.executor.v1.GetOperationAction} GetOperationAction - */ - GetOperationAction.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.executor.v1.GetOperationAction) - return object; - var message = new $root.google.spanner.executor.v1.GetOperationAction(); - if (object.operation != null) - message.operation = String(object.operation); - return message; - }; - - /** - * Creates a plain object from a GetOperationAction message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.executor.v1.GetOperationAction - * @static - * @param {google.spanner.executor.v1.GetOperationAction} message GetOperationAction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetOperationAction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.operation = ""; - if (message.operation != null && message.hasOwnProperty("operation")) - object.operation = message.operation; - return object; - }; - - /** - * Converts this GetOperationAction to JSON. - * @function toJSON - * @memberof google.spanner.executor.v1.GetOperationAction - * @instance - * @returns {Object.} JSON object - */ - GetOperationAction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetOperationAction - * @function getTypeUrl - * @memberof google.spanner.executor.v1.GetOperationAction - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetOperationAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.executor.v1.GetOperationAction"; - }; - - return GetOperationAction; - })(); - - v1.QueryCancellationAction = (function() { - - /** - * Properties of a QueryCancellationAction. - * @memberof google.spanner.executor.v1 - * @interface IQueryCancellationAction - * @property {string|null} [longRunningSql] QueryCancellationAction longRunningSql - * @property {string|null} [cancelQuery] QueryCancellationAction cancelQuery - */ - - /** - * Constructs a new QueryCancellationAction. - * @memberof google.spanner.executor.v1 - * @classdesc Represents a QueryCancellationAction. - * @implements IQueryCancellationAction - * @constructor - * @param {google.spanner.executor.v1.IQueryCancellationAction=} [properties] Properties to set - */ - function QueryCancellationAction(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryCancellationAction longRunningSql. - * @member {string} longRunningSql - * @memberof google.spanner.executor.v1.QueryCancellationAction - * @instance - */ - QueryCancellationAction.prototype.longRunningSql = ""; - - /** - * QueryCancellationAction cancelQuery. - * @member {string} cancelQuery - * @memberof google.spanner.executor.v1.QueryCancellationAction - * @instance - */ - QueryCancellationAction.prototype.cancelQuery = ""; - - /** - * Creates a new QueryCancellationAction instance using the specified properties. - * @function create - * @memberof google.spanner.executor.v1.QueryCancellationAction - * @static - * @param {google.spanner.executor.v1.IQueryCancellationAction=} [properties] Properties to set - * @returns {google.spanner.executor.v1.QueryCancellationAction} QueryCancellationAction instance - */ - QueryCancellationAction.create = function create(properties) { - return new QueryCancellationAction(properties); - }; - - /** - * Encodes the specified QueryCancellationAction message. Does not implicitly {@link google.spanner.executor.v1.QueryCancellationAction.verify|verify} messages. - * @function encode - * @memberof google.spanner.executor.v1.QueryCancellationAction - * @static - * @param {google.spanner.executor.v1.IQueryCancellationAction} message QueryCancellationAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryCancellationAction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.longRunningSql != null && Object.hasOwnProperty.call(message, "longRunningSql")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.longRunningSql); - if (message.cancelQuery != null && Object.hasOwnProperty.call(message, "cancelQuery")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.cancelQuery); - return writer; - }; - - /** - * Encodes the specified QueryCancellationAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.QueryCancellationAction.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.executor.v1.QueryCancellationAction - * @static - * @param {google.spanner.executor.v1.IQueryCancellationAction} message QueryCancellationAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryCancellationAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryCancellationAction message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.executor.v1.QueryCancellationAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.executor.v1.QueryCancellationAction} QueryCancellationAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryCancellationAction.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.QueryCancellationAction(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.longRunningSql = reader.string(); - break; - } - case 2: { - message.cancelQuery = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryCancellationAction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.executor.v1.QueryCancellationAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.executor.v1.QueryCancellationAction} QueryCancellationAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryCancellationAction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryCancellationAction message. - * @function verify - * @memberof google.spanner.executor.v1.QueryCancellationAction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryCancellationAction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.longRunningSql != null && message.hasOwnProperty("longRunningSql")) - if (!$util.isString(message.longRunningSql)) - return "longRunningSql: string expected"; - if (message.cancelQuery != null && message.hasOwnProperty("cancelQuery")) - if (!$util.isString(message.cancelQuery)) - return "cancelQuery: string expected"; - return null; - }; - - /** - * Creates a QueryCancellationAction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.executor.v1.QueryCancellationAction - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.executor.v1.QueryCancellationAction} QueryCancellationAction - */ - QueryCancellationAction.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.executor.v1.QueryCancellationAction) - return object; - var message = new $root.google.spanner.executor.v1.QueryCancellationAction(); - if (object.longRunningSql != null) - message.longRunningSql = String(object.longRunningSql); - if (object.cancelQuery != null) - message.cancelQuery = String(object.cancelQuery); - return message; - }; - - /** - * Creates a plain object from a QueryCancellationAction message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.executor.v1.QueryCancellationAction - * @static - * @param {google.spanner.executor.v1.QueryCancellationAction} message QueryCancellationAction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryCancellationAction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.longRunningSql = ""; - object.cancelQuery = ""; - } - if (message.longRunningSql != null && message.hasOwnProperty("longRunningSql")) - object.longRunningSql = message.longRunningSql; - if (message.cancelQuery != null && message.hasOwnProperty("cancelQuery")) - object.cancelQuery = message.cancelQuery; - return object; - }; - - /** - * Converts this QueryCancellationAction to JSON. - * @function toJSON - * @memberof google.spanner.executor.v1.QueryCancellationAction - * @instance - * @returns {Object.} JSON object - */ - QueryCancellationAction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for QueryCancellationAction - * @function getTypeUrl - * @memberof google.spanner.executor.v1.QueryCancellationAction - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - QueryCancellationAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.executor.v1.QueryCancellationAction"; - }; - - return QueryCancellationAction; - })(); - - v1.CancelOperationAction = (function() { - - /** - * Properties of a CancelOperationAction. - * @memberof google.spanner.executor.v1 - * @interface ICancelOperationAction - * @property {string|null} [operation] CancelOperationAction operation - */ - - /** - * Constructs a new CancelOperationAction. - * @memberof google.spanner.executor.v1 - * @classdesc Represents a CancelOperationAction. - * @implements ICancelOperationAction - * @constructor - * @param {google.spanner.executor.v1.ICancelOperationAction=} [properties] Properties to set - */ - function CancelOperationAction(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CancelOperationAction operation. - * @member {string} operation - * @memberof google.spanner.executor.v1.CancelOperationAction - * @instance - */ - CancelOperationAction.prototype.operation = ""; - - /** - * Creates a new CancelOperationAction instance using the specified properties. - * @function create - * @memberof google.spanner.executor.v1.CancelOperationAction - * @static - * @param {google.spanner.executor.v1.ICancelOperationAction=} [properties] Properties to set - * @returns {google.spanner.executor.v1.CancelOperationAction} CancelOperationAction instance - */ - CancelOperationAction.create = function create(properties) { - return new CancelOperationAction(properties); - }; - - /** - * Encodes the specified CancelOperationAction message. Does not implicitly {@link google.spanner.executor.v1.CancelOperationAction.verify|verify} messages. - * @function encode - * @memberof google.spanner.executor.v1.CancelOperationAction - * @static - * @param {google.spanner.executor.v1.ICancelOperationAction} message CancelOperationAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CancelOperationAction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.operation != null && Object.hasOwnProperty.call(message, "operation")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.operation); - return writer; - }; - - /** - * Encodes the specified CancelOperationAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.CancelOperationAction.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.executor.v1.CancelOperationAction - * @static - * @param {google.spanner.executor.v1.ICancelOperationAction} message CancelOperationAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CancelOperationAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CancelOperationAction message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.executor.v1.CancelOperationAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.executor.v1.CancelOperationAction} CancelOperationAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CancelOperationAction.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.CancelOperationAction(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.operation = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CancelOperationAction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.executor.v1.CancelOperationAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.executor.v1.CancelOperationAction} CancelOperationAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CancelOperationAction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CancelOperationAction message. - * @function verify - * @memberof google.spanner.executor.v1.CancelOperationAction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CancelOperationAction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.operation != null && message.hasOwnProperty("operation")) - if (!$util.isString(message.operation)) - return "operation: string expected"; - return null; - }; - - /** - * Creates a CancelOperationAction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.executor.v1.CancelOperationAction - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.executor.v1.CancelOperationAction} CancelOperationAction - */ - CancelOperationAction.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.executor.v1.CancelOperationAction) - return object; - var message = new $root.google.spanner.executor.v1.CancelOperationAction(); - if (object.operation != null) - message.operation = String(object.operation); - return message; - }; - - /** - * Creates a plain object from a CancelOperationAction message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.executor.v1.CancelOperationAction - * @static - * @param {google.spanner.executor.v1.CancelOperationAction} message CancelOperationAction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CancelOperationAction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.operation = ""; - if (message.operation != null && message.hasOwnProperty("operation")) - object.operation = message.operation; - return object; - }; - - /** - * Converts this CancelOperationAction to JSON. - * @function toJSON - * @memberof google.spanner.executor.v1.CancelOperationAction - * @instance - * @returns {Object.} JSON object - */ - CancelOperationAction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CancelOperationAction - * @function getTypeUrl - * @memberof google.spanner.executor.v1.CancelOperationAction - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CancelOperationAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.executor.v1.CancelOperationAction"; - }; - - return CancelOperationAction; - })(); - - v1.StartBatchTransactionAction = (function() { - - /** - * Properties of a StartBatchTransactionAction. - * @memberof google.spanner.executor.v1 - * @interface IStartBatchTransactionAction - * @property {google.protobuf.ITimestamp|null} [batchTxnTime] StartBatchTransactionAction batchTxnTime - * @property {Uint8Array|null} [tid] StartBatchTransactionAction tid - * @property {string|null} [cloudDatabaseRole] StartBatchTransactionAction cloudDatabaseRole - */ - - /** - * Constructs a new StartBatchTransactionAction. - * @memberof google.spanner.executor.v1 - * @classdesc Represents a StartBatchTransactionAction. - * @implements IStartBatchTransactionAction - * @constructor - * @param {google.spanner.executor.v1.IStartBatchTransactionAction=} [properties] Properties to set - */ - function StartBatchTransactionAction(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * StartBatchTransactionAction batchTxnTime. - * @member {google.protobuf.ITimestamp|null|undefined} batchTxnTime - * @memberof google.spanner.executor.v1.StartBatchTransactionAction - * @instance - */ - StartBatchTransactionAction.prototype.batchTxnTime = null; - - /** - * StartBatchTransactionAction tid. - * @member {Uint8Array|null|undefined} tid - * @memberof google.spanner.executor.v1.StartBatchTransactionAction - * @instance - */ - StartBatchTransactionAction.prototype.tid = null; - - /** - * StartBatchTransactionAction cloudDatabaseRole. - * @member {string} cloudDatabaseRole - * @memberof google.spanner.executor.v1.StartBatchTransactionAction - * @instance - */ - StartBatchTransactionAction.prototype.cloudDatabaseRole = ""; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * StartBatchTransactionAction param. - * @member {"batchTxnTime"|"tid"|undefined} param - * @memberof google.spanner.executor.v1.StartBatchTransactionAction - * @instance - */ - Object.defineProperty(StartBatchTransactionAction.prototype, "param", { - get: $util.oneOfGetter($oneOfFields = ["batchTxnTime", "tid"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new StartBatchTransactionAction instance using the specified properties. - * @function create - * @memberof google.spanner.executor.v1.StartBatchTransactionAction - * @static - * @param {google.spanner.executor.v1.IStartBatchTransactionAction=} [properties] Properties to set - * @returns {google.spanner.executor.v1.StartBatchTransactionAction} StartBatchTransactionAction instance - */ - StartBatchTransactionAction.create = function create(properties) { - return new StartBatchTransactionAction(properties); - }; - - /** - * Encodes the specified StartBatchTransactionAction message. Does not implicitly {@link google.spanner.executor.v1.StartBatchTransactionAction.verify|verify} messages. - * @function encode - * @memberof google.spanner.executor.v1.StartBatchTransactionAction - * @static - * @param {google.spanner.executor.v1.IStartBatchTransactionAction} message StartBatchTransactionAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StartBatchTransactionAction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.batchTxnTime != null && Object.hasOwnProperty.call(message, "batchTxnTime")) - $root.google.protobuf.Timestamp.encode(message.batchTxnTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.tid != null && Object.hasOwnProperty.call(message, "tid")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.tid); - if (message.cloudDatabaseRole != null && Object.hasOwnProperty.call(message, "cloudDatabaseRole")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.cloudDatabaseRole); - return writer; - }; - - /** - * Encodes the specified StartBatchTransactionAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.StartBatchTransactionAction.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.executor.v1.StartBatchTransactionAction - * @static - * @param {google.spanner.executor.v1.IStartBatchTransactionAction} message StartBatchTransactionAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StartBatchTransactionAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a StartBatchTransactionAction message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.executor.v1.StartBatchTransactionAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.executor.v1.StartBatchTransactionAction} StartBatchTransactionAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StartBatchTransactionAction.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.StartBatchTransactionAction(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.batchTxnTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 2: { - message.tid = reader.bytes(); - break; - } - case 3: { - message.cloudDatabaseRole = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a StartBatchTransactionAction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.executor.v1.StartBatchTransactionAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.executor.v1.StartBatchTransactionAction} StartBatchTransactionAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StartBatchTransactionAction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a StartBatchTransactionAction message. - * @function verify - * @memberof google.spanner.executor.v1.StartBatchTransactionAction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - StartBatchTransactionAction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.batchTxnTime != null && message.hasOwnProperty("batchTxnTime")) { - properties.param = 1; - { - var error = $root.google.protobuf.Timestamp.verify(message.batchTxnTime); - if (error) - return "batchTxnTime." + error; - } - } - if (message.tid != null && message.hasOwnProperty("tid")) { - if (properties.param === 1) - return "param: multiple values"; - properties.param = 1; - if (!(message.tid && typeof message.tid.length === "number" || $util.isString(message.tid))) - return "tid: buffer expected"; - } - if (message.cloudDatabaseRole != null && message.hasOwnProperty("cloudDatabaseRole")) - if (!$util.isString(message.cloudDatabaseRole)) - return "cloudDatabaseRole: string expected"; - return null; - }; - - /** - * Creates a StartBatchTransactionAction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.executor.v1.StartBatchTransactionAction - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.executor.v1.StartBatchTransactionAction} StartBatchTransactionAction - */ - StartBatchTransactionAction.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.executor.v1.StartBatchTransactionAction) - return object; - var message = new $root.google.spanner.executor.v1.StartBatchTransactionAction(); - if (object.batchTxnTime != null) { - if (typeof object.batchTxnTime !== "object") - throw TypeError(".google.spanner.executor.v1.StartBatchTransactionAction.batchTxnTime: object expected"); - message.batchTxnTime = $root.google.protobuf.Timestamp.fromObject(object.batchTxnTime); - } - if (object.tid != null) - if (typeof object.tid === "string") - $util.base64.decode(object.tid, message.tid = $util.newBuffer($util.base64.length(object.tid)), 0); - else if (object.tid.length >= 0) - message.tid = object.tid; - if (object.cloudDatabaseRole != null) - message.cloudDatabaseRole = String(object.cloudDatabaseRole); - return message; - }; - - /** - * Creates a plain object from a StartBatchTransactionAction message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.executor.v1.StartBatchTransactionAction - * @static - * @param {google.spanner.executor.v1.StartBatchTransactionAction} message StartBatchTransactionAction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - StartBatchTransactionAction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.cloudDatabaseRole = ""; - if (message.batchTxnTime != null && message.hasOwnProperty("batchTxnTime")) { - object.batchTxnTime = $root.google.protobuf.Timestamp.toObject(message.batchTxnTime, options); - if (options.oneofs) - object.param = "batchTxnTime"; - } - if (message.tid != null && message.hasOwnProperty("tid")) { - object.tid = options.bytes === String ? $util.base64.encode(message.tid, 0, message.tid.length) : options.bytes === Array ? Array.prototype.slice.call(message.tid) : message.tid; - if (options.oneofs) - object.param = "tid"; - } - if (message.cloudDatabaseRole != null && message.hasOwnProperty("cloudDatabaseRole")) - object.cloudDatabaseRole = message.cloudDatabaseRole; - return object; - }; - - /** - * Converts this StartBatchTransactionAction to JSON. - * @function toJSON - * @memberof google.spanner.executor.v1.StartBatchTransactionAction - * @instance - * @returns {Object.} JSON object - */ - StartBatchTransactionAction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for StartBatchTransactionAction - * @function getTypeUrl - * @memberof google.spanner.executor.v1.StartBatchTransactionAction - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - StartBatchTransactionAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.executor.v1.StartBatchTransactionAction"; - }; - - return StartBatchTransactionAction; - })(); - - v1.CloseBatchTransactionAction = (function() { - - /** - * Properties of a CloseBatchTransactionAction. - * @memberof google.spanner.executor.v1 - * @interface ICloseBatchTransactionAction - * @property {boolean|null} [cleanup] CloseBatchTransactionAction cleanup - */ - - /** - * Constructs a new CloseBatchTransactionAction. - * @memberof google.spanner.executor.v1 - * @classdesc Represents a CloseBatchTransactionAction. - * @implements ICloseBatchTransactionAction - * @constructor - * @param {google.spanner.executor.v1.ICloseBatchTransactionAction=} [properties] Properties to set - */ - function CloseBatchTransactionAction(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CloseBatchTransactionAction cleanup. - * @member {boolean} cleanup - * @memberof google.spanner.executor.v1.CloseBatchTransactionAction - * @instance - */ - CloseBatchTransactionAction.prototype.cleanup = false; - - /** - * Creates a new CloseBatchTransactionAction instance using the specified properties. - * @function create - * @memberof google.spanner.executor.v1.CloseBatchTransactionAction - * @static - * @param {google.spanner.executor.v1.ICloseBatchTransactionAction=} [properties] Properties to set - * @returns {google.spanner.executor.v1.CloseBatchTransactionAction} CloseBatchTransactionAction instance - */ - CloseBatchTransactionAction.create = function create(properties) { - return new CloseBatchTransactionAction(properties); - }; - - /** - * Encodes the specified CloseBatchTransactionAction message. Does not implicitly {@link google.spanner.executor.v1.CloseBatchTransactionAction.verify|verify} messages. - * @function encode - * @memberof google.spanner.executor.v1.CloseBatchTransactionAction - * @static - * @param {google.spanner.executor.v1.ICloseBatchTransactionAction} message CloseBatchTransactionAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CloseBatchTransactionAction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.cleanup != null && Object.hasOwnProperty.call(message, "cleanup")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.cleanup); - return writer; - }; - - /** - * Encodes the specified CloseBatchTransactionAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.CloseBatchTransactionAction.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.executor.v1.CloseBatchTransactionAction - * @static - * @param {google.spanner.executor.v1.ICloseBatchTransactionAction} message CloseBatchTransactionAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CloseBatchTransactionAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CloseBatchTransactionAction message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.executor.v1.CloseBatchTransactionAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.executor.v1.CloseBatchTransactionAction} CloseBatchTransactionAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CloseBatchTransactionAction.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.CloseBatchTransactionAction(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.cleanup = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CloseBatchTransactionAction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.executor.v1.CloseBatchTransactionAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.executor.v1.CloseBatchTransactionAction} CloseBatchTransactionAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CloseBatchTransactionAction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CloseBatchTransactionAction message. - * @function verify - * @memberof google.spanner.executor.v1.CloseBatchTransactionAction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CloseBatchTransactionAction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.cleanup != null && message.hasOwnProperty("cleanup")) - if (typeof message.cleanup !== "boolean") - return "cleanup: boolean expected"; - return null; - }; - - /** - * Creates a CloseBatchTransactionAction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.executor.v1.CloseBatchTransactionAction - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.executor.v1.CloseBatchTransactionAction} CloseBatchTransactionAction - */ - CloseBatchTransactionAction.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.executor.v1.CloseBatchTransactionAction) - return object; - var message = new $root.google.spanner.executor.v1.CloseBatchTransactionAction(); - if (object.cleanup != null) - message.cleanup = Boolean(object.cleanup); - return message; - }; - - /** - * Creates a plain object from a CloseBatchTransactionAction message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.executor.v1.CloseBatchTransactionAction - * @static - * @param {google.spanner.executor.v1.CloseBatchTransactionAction} message CloseBatchTransactionAction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CloseBatchTransactionAction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.cleanup = false; - if (message.cleanup != null && message.hasOwnProperty("cleanup")) - object.cleanup = message.cleanup; - return object; - }; - - /** - * Converts this CloseBatchTransactionAction to JSON. - * @function toJSON - * @memberof google.spanner.executor.v1.CloseBatchTransactionAction - * @instance - * @returns {Object.} JSON object - */ - CloseBatchTransactionAction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CloseBatchTransactionAction - * @function getTypeUrl - * @memberof google.spanner.executor.v1.CloseBatchTransactionAction - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CloseBatchTransactionAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.executor.v1.CloseBatchTransactionAction"; - }; - - return CloseBatchTransactionAction; - })(); - - v1.GenerateDbPartitionsForReadAction = (function() { - - /** - * Properties of a GenerateDbPartitionsForReadAction. - * @memberof google.spanner.executor.v1 - * @interface IGenerateDbPartitionsForReadAction - * @property {google.spanner.executor.v1.IReadAction|null} [read] GenerateDbPartitionsForReadAction read - * @property {Array.|null} [table] GenerateDbPartitionsForReadAction table - * @property {number|Long|null} [desiredBytesPerPartition] GenerateDbPartitionsForReadAction desiredBytesPerPartition - * @property {number|Long|null} [maxPartitionCount] GenerateDbPartitionsForReadAction maxPartitionCount - */ - - /** - * Constructs a new GenerateDbPartitionsForReadAction. - * @memberof google.spanner.executor.v1 - * @classdesc Represents a GenerateDbPartitionsForReadAction. - * @implements IGenerateDbPartitionsForReadAction - * @constructor - * @param {google.spanner.executor.v1.IGenerateDbPartitionsForReadAction=} [properties] Properties to set - */ - function GenerateDbPartitionsForReadAction(properties) { - this.table = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GenerateDbPartitionsForReadAction read. - * @member {google.spanner.executor.v1.IReadAction|null|undefined} read - * @memberof google.spanner.executor.v1.GenerateDbPartitionsForReadAction - * @instance - */ - GenerateDbPartitionsForReadAction.prototype.read = null; - - /** - * GenerateDbPartitionsForReadAction table. - * @member {Array.} table - * @memberof google.spanner.executor.v1.GenerateDbPartitionsForReadAction - * @instance - */ - GenerateDbPartitionsForReadAction.prototype.table = $util.emptyArray; - - /** - * GenerateDbPartitionsForReadAction desiredBytesPerPartition. - * @member {number|Long|null|undefined} desiredBytesPerPartition - * @memberof google.spanner.executor.v1.GenerateDbPartitionsForReadAction - * @instance - */ - GenerateDbPartitionsForReadAction.prototype.desiredBytesPerPartition = null; - - /** - * GenerateDbPartitionsForReadAction maxPartitionCount. - * @member {number|Long|null|undefined} maxPartitionCount - * @memberof google.spanner.executor.v1.GenerateDbPartitionsForReadAction - * @instance - */ - GenerateDbPartitionsForReadAction.prototype.maxPartitionCount = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(GenerateDbPartitionsForReadAction.prototype, "_desiredBytesPerPartition", { - get: $util.oneOfGetter($oneOfFields = ["desiredBytesPerPartition"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(GenerateDbPartitionsForReadAction.prototype, "_maxPartitionCount", { - get: $util.oneOfGetter($oneOfFields = ["maxPartitionCount"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GenerateDbPartitionsForReadAction instance using the specified properties. - * @function create - * @memberof google.spanner.executor.v1.GenerateDbPartitionsForReadAction - * @static - * @param {google.spanner.executor.v1.IGenerateDbPartitionsForReadAction=} [properties] Properties to set - * @returns {google.spanner.executor.v1.GenerateDbPartitionsForReadAction} GenerateDbPartitionsForReadAction instance - */ - GenerateDbPartitionsForReadAction.create = function create(properties) { - return new GenerateDbPartitionsForReadAction(properties); - }; - - /** - * Encodes the specified GenerateDbPartitionsForReadAction message. Does not implicitly {@link google.spanner.executor.v1.GenerateDbPartitionsForReadAction.verify|verify} messages. - * @function encode - * @memberof google.spanner.executor.v1.GenerateDbPartitionsForReadAction - * @static - * @param {google.spanner.executor.v1.IGenerateDbPartitionsForReadAction} message GenerateDbPartitionsForReadAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenerateDbPartitionsForReadAction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.read != null && Object.hasOwnProperty.call(message, "read")) - $root.google.spanner.executor.v1.ReadAction.encode(message.read, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.table != null && message.table.length) - for (var i = 0; i < message.table.length; ++i) - $root.google.spanner.executor.v1.TableMetadata.encode(message.table[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.desiredBytesPerPartition != null && Object.hasOwnProperty.call(message, "desiredBytesPerPartition")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.desiredBytesPerPartition); - if (message.maxPartitionCount != null && Object.hasOwnProperty.call(message, "maxPartitionCount")) - writer.uint32(/* id 4, wireType 0 =*/32).int64(message.maxPartitionCount); - return writer; - }; - - /** - * Encodes the specified GenerateDbPartitionsForReadAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.GenerateDbPartitionsForReadAction.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.executor.v1.GenerateDbPartitionsForReadAction - * @static - * @param {google.spanner.executor.v1.IGenerateDbPartitionsForReadAction} message GenerateDbPartitionsForReadAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenerateDbPartitionsForReadAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GenerateDbPartitionsForReadAction message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.executor.v1.GenerateDbPartitionsForReadAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.executor.v1.GenerateDbPartitionsForReadAction} GenerateDbPartitionsForReadAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenerateDbPartitionsForReadAction.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.GenerateDbPartitionsForReadAction(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.read = $root.google.spanner.executor.v1.ReadAction.decode(reader, reader.uint32()); - break; - } - case 2: { - if (!(message.table && message.table.length)) - message.table = []; - message.table.push($root.google.spanner.executor.v1.TableMetadata.decode(reader, reader.uint32())); - break; - } - case 3: { - message.desiredBytesPerPartition = reader.int64(); - break; - } - case 4: { - message.maxPartitionCount = reader.int64(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GenerateDbPartitionsForReadAction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.executor.v1.GenerateDbPartitionsForReadAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.executor.v1.GenerateDbPartitionsForReadAction} GenerateDbPartitionsForReadAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenerateDbPartitionsForReadAction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GenerateDbPartitionsForReadAction message. - * @function verify - * @memberof google.spanner.executor.v1.GenerateDbPartitionsForReadAction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GenerateDbPartitionsForReadAction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.read != null && message.hasOwnProperty("read")) { - var error = $root.google.spanner.executor.v1.ReadAction.verify(message.read); - if (error) - return "read." + error; - } - if (message.table != null && message.hasOwnProperty("table")) { - if (!Array.isArray(message.table)) - return "table: array expected"; - for (var i = 0; i < message.table.length; ++i) { - var error = $root.google.spanner.executor.v1.TableMetadata.verify(message.table[i]); - if (error) - return "table." + error; - } - } - if (message.desiredBytesPerPartition != null && message.hasOwnProperty("desiredBytesPerPartition")) { - properties._desiredBytesPerPartition = 1; - if (!$util.isInteger(message.desiredBytesPerPartition) && !(message.desiredBytesPerPartition && $util.isInteger(message.desiredBytesPerPartition.low) && $util.isInteger(message.desiredBytesPerPartition.high))) - return "desiredBytesPerPartition: integer|Long expected"; - } - if (message.maxPartitionCount != null && message.hasOwnProperty("maxPartitionCount")) { - properties._maxPartitionCount = 1; - if (!$util.isInteger(message.maxPartitionCount) && !(message.maxPartitionCount && $util.isInteger(message.maxPartitionCount.low) && $util.isInteger(message.maxPartitionCount.high))) - return "maxPartitionCount: integer|Long expected"; - } - return null; - }; - - /** - * Creates a GenerateDbPartitionsForReadAction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.executor.v1.GenerateDbPartitionsForReadAction - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.executor.v1.GenerateDbPartitionsForReadAction} GenerateDbPartitionsForReadAction - */ - GenerateDbPartitionsForReadAction.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.executor.v1.GenerateDbPartitionsForReadAction) - return object; - var message = new $root.google.spanner.executor.v1.GenerateDbPartitionsForReadAction(); - if (object.read != null) { - if (typeof object.read !== "object") - throw TypeError(".google.spanner.executor.v1.GenerateDbPartitionsForReadAction.read: object expected"); - message.read = $root.google.spanner.executor.v1.ReadAction.fromObject(object.read); - } - if (object.table) { - if (!Array.isArray(object.table)) - throw TypeError(".google.spanner.executor.v1.GenerateDbPartitionsForReadAction.table: array expected"); - message.table = []; - for (var i = 0; i < object.table.length; ++i) { - if (typeof object.table[i] !== "object") - throw TypeError(".google.spanner.executor.v1.GenerateDbPartitionsForReadAction.table: object expected"); - message.table[i] = $root.google.spanner.executor.v1.TableMetadata.fromObject(object.table[i]); - } - } - if (object.desiredBytesPerPartition != null) - if ($util.Long) - (message.desiredBytesPerPartition = $util.Long.fromValue(object.desiredBytesPerPartition)).unsigned = false; - else if (typeof object.desiredBytesPerPartition === "string") - message.desiredBytesPerPartition = parseInt(object.desiredBytesPerPartition, 10); - else if (typeof object.desiredBytesPerPartition === "number") - message.desiredBytesPerPartition = object.desiredBytesPerPartition; - else if (typeof object.desiredBytesPerPartition === "object") - message.desiredBytesPerPartition = new $util.LongBits(object.desiredBytesPerPartition.low >>> 0, object.desiredBytesPerPartition.high >>> 0).toNumber(); - if (object.maxPartitionCount != null) - if ($util.Long) - (message.maxPartitionCount = $util.Long.fromValue(object.maxPartitionCount)).unsigned = false; - else if (typeof object.maxPartitionCount === "string") - message.maxPartitionCount = parseInt(object.maxPartitionCount, 10); - else if (typeof object.maxPartitionCount === "number") - message.maxPartitionCount = object.maxPartitionCount; - else if (typeof object.maxPartitionCount === "object") - message.maxPartitionCount = new $util.LongBits(object.maxPartitionCount.low >>> 0, object.maxPartitionCount.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from a GenerateDbPartitionsForReadAction message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.executor.v1.GenerateDbPartitionsForReadAction - * @static - * @param {google.spanner.executor.v1.GenerateDbPartitionsForReadAction} message GenerateDbPartitionsForReadAction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GenerateDbPartitionsForReadAction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.table = []; - if (options.defaults) - object.read = null; - if (message.read != null && message.hasOwnProperty("read")) - object.read = $root.google.spanner.executor.v1.ReadAction.toObject(message.read, options); - if (message.table && message.table.length) { - object.table = []; - for (var j = 0; j < message.table.length; ++j) - object.table[j] = $root.google.spanner.executor.v1.TableMetadata.toObject(message.table[j], options); - } - if (message.desiredBytesPerPartition != null && message.hasOwnProperty("desiredBytesPerPartition")) { - if (typeof message.desiredBytesPerPartition === "number") - object.desiredBytesPerPartition = options.longs === String ? String(message.desiredBytesPerPartition) : message.desiredBytesPerPartition; - else - object.desiredBytesPerPartition = options.longs === String ? $util.Long.prototype.toString.call(message.desiredBytesPerPartition) : options.longs === Number ? new $util.LongBits(message.desiredBytesPerPartition.low >>> 0, message.desiredBytesPerPartition.high >>> 0).toNumber() : message.desiredBytesPerPartition; - if (options.oneofs) - object._desiredBytesPerPartition = "desiredBytesPerPartition"; - } - if (message.maxPartitionCount != null && message.hasOwnProperty("maxPartitionCount")) { - if (typeof message.maxPartitionCount === "number") - object.maxPartitionCount = options.longs === String ? String(message.maxPartitionCount) : message.maxPartitionCount; - else - object.maxPartitionCount = options.longs === String ? $util.Long.prototype.toString.call(message.maxPartitionCount) : options.longs === Number ? new $util.LongBits(message.maxPartitionCount.low >>> 0, message.maxPartitionCount.high >>> 0).toNumber() : message.maxPartitionCount; - if (options.oneofs) - object._maxPartitionCount = "maxPartitionCount"; - } - return object; - }; - - /** - * Converts this GenerateDbPartitionsForReadAction to JSON. - * @function toJSON - * @memberof google.spanner.executor.v1.GenerateDbPartitionsForReadAction - * @instance - * @returns {Object.} JSON object - */ - GenerateDbPartitionsForReadAction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GenerateDbPartitionsForReadAction - * @function getTypeUrl - * @memberof google.spanner.executor.v1.GenerateDbPartitionsForReadAction - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GenerateDbPartitionsForReadAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.executor.v1.GenerateDbPartitionsForReadAction"; - }; - - return GenerateDbPartitionsForReadAction; - })(); - - v1.GenerateDbPartitionsForQueryAction = (function() { - - /** - * Properties of a GenerateDbPartitionsForQueryAction. - * @memberof google.spanner.executor.v1 - * @interface IGenerateDbPartitionsForQueryAction - * @property {google.spanner.executor.v1.IQueryAction|null} [query] GenerateDbPartitionsForQueryAction query - * @property {number|Long|null} [desiredBytesPerPartition] GenerateDbPartitionsForQueryAction desiredBytesPerPartition - */ - - /** - * Constructs a new GenerateDbPartitionsForQueryAction. - * @memberof google.spanner.executor.v1 - * @classdesc Represents a GenerateDbPartitionsForQueryAction. - * @implements IGenerateDbPartitionsForQueryAction - * @constructor - * @param {google.spanner.executor.v1.IGenerateDbPartitionsForQueryAction=} [properties] Properties to set - */ - function GenerateDbPartitionsForQueryAction(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GenerateDbPartitionsForQueryAction query. - * @member {google.spanner.executor.v1.IQueryAction|null|undefined} query - * @memberof google.spanner.executor.v1.GenerateDbPartitionsForQueryAction - * @instance - */ - GenerateDbPartitionsForQueryAction.prototype.query = null; - - /** - * GenerateDbPartitionsForQueryAction desiredBytesPerPartition. - * @member {number|Long|null|undefined} desiredBytesPerPartition - * @memberof google.spanner.executor.v1.GenerateDbPartitionsForQueryAction - * @instance - */ - GenerateDbPartitionsForQueryAction.prototype.desiredBytesPerPartition = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(GenerateDbPartitionsForQueryAction.prototype, "_desiredBytesPerPartition", { - get: $util.oneOfGetter($oneOfFields = ["desiredBytesPerPartition"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GenerateDbPartitionsForQueryAction instance using the specified properties. - * @function create - * @memberof google.spanner.executor.v1.GenerateDbPartitionsForQueryAction - * @static - * @param {google.spanner.executor.v1.IGenerateDbPartitionsForQueryAction=} [properties] Properties to set - * @returns {google.spanner.executor.v1.GenerateDbPartitionsForQueryAction} GenerateDbPartitionsForQueryAction instance - */ - GenerateDbPartitionsForQueryAction.create = function create(properties) { - return new GenerateDbPartitionsForQueryAction(properties); - }; - - /** - * Encodes the specified GenerateDbPartitionsForQueryAction message. Does not implicitly {@link google.spanner.executor.v1.GenerateDbPartitionsForQueryAction.verify|verify} messages. - * @function encode - * @memberof google.spanner.executor.v1.GenerateDbPartitionsForQueryAction - * @static - * @param {google.spanner.executor.v1.IGenerateDbPartitionsForQueryAction} message GenerateDbPartitionsForQueryAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenerateDbPartitionsForQueryAction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.query != null && Object.hasOwnProperty.call(message, "query")) - $root.google.spanner.executor.v1.QueryAction.encode(message.query, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.desiredBytesPerPartition != null && Object.hasOwnProperty.call(message, "desiredBytesPerPartition")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.desiredBytesPerPartition); - return writer; - }; - - /** - * Encodes the specified GenerateDbPartitionsForQueryAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.GenerateDbPartitionsForQueryAction.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.executor.v1.GenerateDbPartitionsForQueryAction - * @static - * @param {google.spanner.executor.v1.IGenerateDbPartitionsForQueryAction} message GenerateDbPartitionsForQueryAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenerateDbPartitionsForQueryAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GenerateDbPartitionsForQueryAction message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.executor.v1.GenerateDbPartitionsForQueryAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.executor.v1.GenerateDbPartitionsForQueryAction} GenerateDbPartitionsForQueryAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenerateDbPartitionsForQueryAction.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.GenerateDbPartitionsForQueryAction(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.query = $root.google.spanner.executor.v1.QueryAction.decode(reader, reader.uint32()); - break; - } - case 2: { - message.desiredBytesPerPartition = reader.int64(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GenerateDbPartitionsForQueryAction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.executor.v1.GenerateDbPartitionsForQueryAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.executor.v1.GenerateDbPartitionsForQueryAction} GenerateDbPartitionsForQueryAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenerateDbPartitionsForQueryAction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GenerateDbPartitionsForQueryAction message. - * @function verify - * @memberof google.spanner.executor.v1.GenerateDbPartitionsForQueryAction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GenerateDbPartitionsForQueryAction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.query != null && message.hasOwnProperty("query")) { - var error = $root.google.spanner.executor.v1.QueryAction.verify(message.query); - if (error) - return "query." + error; - } - if (message.desiredBytesPerPartition != null && message.hasOwnProperty("desiredBytesPerPartition")) { - properties._desiredBytesPerPartition = 1; - if (!$util.isInteger(message.desiredBytesPerPartition) && !(message.desiredBytesPerPartition && $util.isInteger(message.desiredBytesPerPartition.low) && $util.isInteger(message.desiredBytesPerPartition.high))) - return "desiredBytesPerPartition: integer|Long expected"; - } - return null; - }; - - /** - * Creates a GenerateDbPartitionsForQueryAction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.executor.v1.GenerateDbPartitionsForQueryAction - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.executor.v1.GenerateDbPartitionsForQueryAction} GenerateDbPartitionsForQueryAction - */ - GenerateDbPartitionsForQueryAction.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.executor.v1.GenerateDbPartitionsForQueryAction) - return object; - var message = new $root.google.spanner.executor.v1.GenerateDbPartitionsForQueryAction(); - if (object.query != null) { - if (typeof object.query !== "object") - throw TypeError(".google.spanner.executor.v1.GenerateDbPartitionsForQueryAction.query: object expected"); - message.query = $root.google.spanner.executor.v1.QueryAction.fromObject(object.query); - } - if (object.desiredBytesPerPartition != null) - if ($util.Long) - (message.desiredBytesPerPartition = $util.Long.fromValue(object.desiredBytesPerPartition)).unsigned = false; - else if (typeof object.desiredBytesPerPartition === "string") - message.desiredBytesPerPartition = parseInt(object.desiredBytesPerPartition, 10); - else if (typeof object.desiredBytesPerPartition === "number") - message.desiredBytesPerPartition = object.desiredBytesPerPartition; - else if (typeof object.desiredBytesPerPartition === "object") - message.desiredBytesPerPartition = new $util.LongBits(object.desiredBytesPerPartition.low >>> 0, object.desiredBytesPerPartition.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from a GenerateDbPartitionsForQueryAction message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.executor.v1.GenerateDbPartitionsForQueryAction - * @static - * @param {google.spanner.executor.v1.GenerateDbPartitionsForQueryAction} message GenerateDbPartitionsForQueryAction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GenerateDbPartitionsForQueryAction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.query = null; - if (message.query != null && message.hasOwnProperty("query")) - object.query = $root.google.spanner.executor.v1.QueryAction.toObject(message.query, options); - if (message.desiredBytesPerPartition != null && message.hasOwnProperty("desiredBytesPerPartition")) { - if (typeof message.desiredBytesPerPartition === "number") - object.desiredBytesPerPartition = options.longs === String ? String(message.desiredBytesPerPartition) : message.desiredBytesPerPartition; - else - object.desiredBytesPerPartition = options.longs === String ? $util.Long.prototype.toString.call(message.desiredBytesPerPartition) : options.longs === Number ? new $util.LongBits(message.desiredBytesPerPartition.low >>> 0, message.desiredBytesPerPartition.high >>> 0).toNumber() : message.desiredBytesPerPartition; - if (options.oneofs) - object._desiredBytesPerPartition = "desiredBytesPerPartition"; - } - return object; - }; - - /** - * Converts this GenerateDbPartitionsForQueryAction to JSON. - * @function toJSON - * @memberof google.spanner.executor.v1.GenerateDbPartitionsForQueryAction - * @instance - * @returns {Object.} JSON object - */ - GenerateDbPartitionsForQueryAction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GenerateDbPartitionsForQueryAction - * @function getTypeUrl - * @memberof google.spanner.executor.v1.GenerateDbPartitionsForQueryAction - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GenerateDbPartitionsForQueryAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.executor.v1.GenerateDbPartitionsForQueryAction"; - }; - - return GenerateDbPartitionsForQueryAction; - })(); - - v1.BatchPartition = (function() { - - /** - * Properties of a BatchPartition. - * @memberof google.spanner.executor.v1 - * @interface IBatchPartition - * @property {Uint8Array|null} [partition] BatchPartition partition - * @property {Uint8Array|null} [partitionToken] BatchPartition partitionToken - * @property {string|null} [table] BatchPartition table - * @property {string|null} [index] BatchPartition index - */ - - /** - * Constructs a new BatchPartition. - * @memberof google.spanner.executor.v1 - * @classdesc Represents a BatchPartition. - * @implements IBatchPartition - * @constructor - * @param {google.spanner.executor.v1.IBatchPartition=} [properties] Properties to set - */ - function BatchPartition(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BatchPartition partition. - * @member {Uint8Array} partition - * @memberof google.spanner.executor.v1.BatchPartition - * @instance - */ - BatchPartition.prototype.partition = $util.newBuffer([]); - - /** - * BatchPartition partitionToken. - * @member {Uint8Array} partitionToken - * @memberof google.spanner.executor.v1.BatchPartition - * @instance - */ - BatchPartition.prototype.partitionToken = $util.newBuffer([]); - - /** - * BatchPartition table. - * @member {string|null|undefined} table - * @memberof google.spanner.executor.v1.BatchPartition - * @instance - */ - BatchPartition.prototype.table = null; - - /** - * BatchPartition index. - * @member {string|null|undefined} index - * @memberof google.spanner.executor.v1.BatchPartition - * @instance - */ - BatchPartition.prototype.index = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(BatchPartition.prototype, "_table", { - get: $util.oneOfGetter($oneOfFields = ["table"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(BatchPartition.prototype, "_index", { - get: $util.oneOfGetter($oneOfFields = ["index"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new BatchPartition instance using the specified properties. - * @function create - * @memberof google.spanner.executor.v1.BatchPartition - * @static - * @param {google.spanner.executor.v1.IBatchPartition=} [properties] Properties to set - * @returns {google.spanner.executor.v1.BatchPartition} BatchPartition instance - */ - BatchPartition.create = function create(properties) { - return new BatchPartition(properties); - }; - - /** - * Encodes the specified BatchPartition message. Does not implicitly {@link google.spanner.executor.v1.BatchPartition.verify|verify} messages. - * @function encode - * @memberof google.spanner.executor.v1.BatchPartition - * @static - * @param {google.spanner.executor.v1.IBatchPartition} message BatchPartition message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchPartition.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.partition != null && Object.hasOwnProperty.call(message, "partition")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.partition); - if (message.partitionToken != null && Object.hasOwnProperty.call(message, "partitionToken")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.partitionToken); - if (message.table != null && Object.hasOwnProperty.call(message, "table")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.table); - if (message.index != null && Object.hasOwnProperty.call(message, "index")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.index); - return writer; - }; - - /** - * Encodes the specified BatchPartition message, length delimited. Does not implicitly {@link google.spanner.executor.v1.BatchPartition.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.executor.v1.BatchPartition - * @static - * @param {google.spanner.executor.v1.IBatchPartition} message BatchPartition message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchPartition.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BatchPartition message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.executor.v1.BatchPartition - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.executor.v1.BatchPartition} BatchPartition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchPartition.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.BatchPartition(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.partition = reader.bytes(); - break; - } - case 2: { - message.partitionToken = reader.bytes(); - break; - } - case 3: { - message.table = reader.string(); - break; - } - case 4: { - message.index = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BatchPartition message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.executor.v1.BatchPartition - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.executor.v1.BatchPartition} BatchPartition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchPartition.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BatchPartition message. - * @function verify - * @memberof google.spanner.executor.v1.BatchPartition - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BatchPartition.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.partition != null && message.hasOwnProperty("partition")) - if (!(message.partition && typeof message.partition.length === "number" || $util.isString(message.partition))) - return "partition: buffer expected"; - if (message.partitionToken != null && message.hasOwnProperty("partitionToken")) - if (!(message.partitionToken && typeof message.partitionToken.length === "number" || $util.isString(message.partitionToken))) - return "partitionToken: buffer expected"; - if (message.table != null && message.hasOwnProperty("table")) { - properties._table = 1; - if (!$util.isString(message.table)) - return "table: string expected"; - } - if (message.index != null && message.hasOwnProperty("index")) { - properties._index = 1; - if (!$util.isString(message.index)) - return "index: string expected"; - } - return null; - }; - - /** - * Creates a BatchPartition message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.executor.v1.BatchPartition - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.executor.v1.BatchPartition} BatchPartition - */ - BatchPartition.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.executor.v1.BatchPartition) - return object; - var message = new $root.google.spanner.executor.v1.BatchPartition(); - if (object.partition != null) - if (typeof object.partition === "string") - $util.base64.decode(object.partition, message.partition = $util.newBuffer($util.base64.length(object.partition)), 0); - else if (object.partition.length >= 0) - message.partition = object.partition; - if (object.partitionToken != null) - if (typeof object.partitionToken === "string") - $util.base64.decode(object.partitionToken, message.partitionToken = $util.newBuffer($util.base64.length(object.partitionToken)), 0); - else if (object.partitionToken.length >= 0) - message.partitionToken = object.partitionToken; - if (object.table != null) - message.table = String(object.table); - if (object.index != null) - message.index = String(object.index); - return message; - }; - - /** - * Creates a plain object from a BatchPartition message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.executor.v1.BatchPartition - * @static - * @param {google.spanner.executor.v1.BatchPartition} message BatchPartition - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BatchPartition.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.partition = ""; - else { - object.partition = []; - if (options.bytes !== Array) - object.partition = $util.newBuffer(object.partition); - } - if (options.bytes === String) - object.partitionToken = ""; - else { - object.partitionToken = []; - if (options.bytes !== Array) - object.partitionToken = $util.newBuffer(object.partitionToken); - } - } - if (message.partition != null && message.hasOwnProperty("partition")) - object.partition = options.bytes === String ? $util.base64.encode(message.partition, 0, message.partition.length) : options.bytes === Array ? Array.prototype.slice.call(message.partition) : message.partition; - if (message.partitionToken != null && message.hasOwnProperty("partitionToken")) - object.partitionToken = options.bytes === String ? $util.base64.encode(message.partitionToken, 0, message.partitionToken.length) : options.bytes === Array ? Array.prototype.slice.call(message.partitionToken) : message.partitionToken; - if (message.table != null && message.hasOwnProperty("table")) { - object.table = message.table; - if (options.oneofs) - object._table = "table"; - } - if (message.index != null && message.hasOwnProperty("index")) { - object.index = message.index; - if (options.oneofs) - object._index = "index"; - } - return object; - }; - - /** - * Converts this BatchPartition to JSON. - * @function toJSON - * @memberof google.spanner.executor.v1.BatchPartition - * @instance - * @returns {Object.} JSON object - */ - BatchPartition.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BatchPartition - * @function getTypeUrl - * @memberof google.spanner.executor.v1.BatchPartition - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BatchPartition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.executor.v1.BatchPartition"; - }; - - return BatchPartition; - })(); - - v1.ExecutePartitionAction = (function() { - - /** - * Properties of an ExecutePartitionAction. - * @memberof google.spanner.executor.v1 - * @interface IExecutePartitionAction - * @property {google.spanner.executor.v1.IBatchPartition|null} [partition] ExecutePartitionAction partition - */ - - /** - * Constructs a new ExecutePartitionAction. - * @memberof google.spanner.executor.v1 - * @classdesc Represents an ExecutePartitionAction. - * @implements IExecutePartitionAction - * @constructor - * @param {google.spanner.executor.v1.IExecutePartitionAction=} [properties] Properties to set - */ - function ExecutePartitionAction(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExecutePartitionAction partition. - * @member {google.spanner.executor.v1.IBatchPartition|null|undefined} partition - * @memberof google.spanner.executor.v1.ExecutePartitionAction - * @instance - */ - ExecutePartitionAction.prototype.partition = null; - - /** - * Creates a new ExecutePartitionAction instance using the specified properties. - * @function create - * @memberof google.spanner.executor.v1.ExecutePartitionAction - * @static - * @param {google.spanner.executor.v1.IExecutePartitionAction=} [properties] Properties to set - * @returns {google.spanner.executor.v1.ExecutePartitionAction} ExecutePartitionAction instance - */ - ExecutePartitionAction.create = function create(properties) { - return new ExecutePartitionAction(properties); - }; - - /** - * Encodes the specified ExecutePartitionAction message. Does not implicitly {@link google.spanner.executor.v1.ExecutePartitionAction.verify|verify} messages. - * @function encode - * @memberof google.spanner.executor.v1.ExecutePartitionAction - * @static - * @param {google.spanner.executor.v1.IExecutePartitionAction} message ExecutePartitionAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExecutePartitionAction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.partition != null && Object.hasOwnProperty.call(message, "partition")) - $root.google.spanner.executor.v1.BatchPartition.encode(message.partition, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ExecutePartitionAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.ExecutePartitionAction.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.executor.v1.ExecutePartitionAction - * @static - * @param {google.spanner.executor.v1.IExecutePartitionAction} message ExecutePartitionAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExecutePartitionAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExecutePartitionAction message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.executor.v1.ExecutePartitionAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.executor.v1.ExecutePartitionAction} ExecutePartitionAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExecutePartitionAction.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.ExecutePartitionAction(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.partition = $root.google.spanner.executor.v1.BatchPartition.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExecutePartitionAction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.executor.v1.ExecutePartitionAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.executor.v1.ExecutePartitionAction} ExecutePartitionAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExecutePartitionAction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExecutePartitionAction message. - * @function verify - * @memberof google.spanner.executor.v1.ExecutePartitionAction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExecutePartitionAction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.partition != null && message.hasOwnProperty("partition")) { - var error = $root.google.spanner.executor.v1.BatchPartition.verify(message.partition); - if (error) - return "partition." + error; - } - return null; - }; - - /** - * Creates an ExecutePartitionAction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.executor.v1.ExecutePartitionAction - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.executor.v1.ExecutePartitionAction} ExecutePartitionAction - */ - ExecutePartitionAction.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.executor.v1.ExecutePartitionAction) - return object; - var message = new $root.google.spanner.executor.v1.ExecutePartitionAction(); - if (object.partition != null) { - if (typeof object.partition !== "object") - throw TypeError(".google.spanner.executor.v1.ExecutePartitionAction.partition: object expected"); - message.partition = $root.google.spanner.executor.v1.BatchPartition.fromObject(object.partition); - } - return message; - }; - - /** - * Creates a plain object from an ExecutePartitionAction message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.executor.v1.ExecutePartitionAction - * @static - * @param {google.spanner.executor.v1.ExecutePartitionAction} message ExecutePartitionAction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExecutePartitionAction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.partition = null; - if (message.partition != null && message.hasOwnProperty("partition")) - object.partition = $root.google.spanner.executor.v1.BatchPartition.toObject(message.partition, options); - return object; - }; - - /** - * Converts this ExecutePartitionAction to JSON. - * @function toJSON - * @memberof google.spanner.executor.v1.ExecutePartitionAction - * @instance - * @returns {Object.} JSON object - */ - ExecutePartitionAction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExecutePartitionAction - * @function getTypeUrl - * @memberof google.spanner.executor.v1.ExecutePartitionAction - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExecutePartitionAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.executor.v1.ExecutePartitionAction"; - }; - - return ExecutePartitionAction; - })(); - - v1.ExecuteChangeStreamQuery = (function() { - - /** - * Properties of an ExecuteChangeStreamQuery. - * @memberof google.spanner.executor.v1 - * @interface IExecuteChangeStreamQuery - * @property {string|null} [name] ExecuteChangeStreamQuery name - * @property {google.protobuf.ITimestamp|null} [startTime] ExecuteChangeStreamQuery startTime - * @property {google.protobuf.ITimestamp|null} [endTime] ExecuteChangeStreamQuery endTime - * @property {string|null} [partitionToken] ExecuteChangeStreamQuery partitionToken - * @property {Array.|null} [readOptions] ExecuteChangeStreamQuery readOptions - * @property {number|null} [heartbeatMilliseconds] ExecuteChangeStreamQuery heartbeatMilliseconds - * @property {number|Long|null} [deadlineSeconds] ExecuteChangeStreamQuery deadlineSeconds - * @property {string|null} [cloudDatabaseRole] ExecuteChangeStreamQuery cloudDatabaseRole - */ - - /** - * Constructs a new ExecuteChangeStreamQuery. - * @memberof google.spanner.executor.v1 - * @classdesc Represents an ExecuteChangeStreamQuery. - * @implements IExecuteChangeStreamQuery - * @constructor - * @param {google.spanner.executor.v1.IExecuteChangeStreamQuery=} [properties] Properties to set - */ - function ExecuteChangeStreamQuery(properties) { - this.readOptions = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExecuteChangeStreamQuery name. - * @member {string} name - * @memberof google.spanner.executor.v1.ExecuteChangeStreamQuery - * @instance - */ - ExecuteChangeStreamQuery.prototype.name = ""; - - /** - * ExecuteChangeStreamQuery startTime. - * @member {google.protobuf.ITimestamp|null|undefined} startTime - * @memberof google.spanner.executor.v1.ExecuteChangeStreamQuery - * @instance - */ - ExecuteChangeStreamQuery.prototype.startTime = null; - - /** - * ExecuteChangeStreamQuery endTime. - * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.spanner.executor.v1.ExecuteChangeStreamQuery - * @instance - */ - ExecuteChangeStreamQuery.prototype.endTime = null; - - /** - * ExecuteChangeStreamQuery partitionToken. - * @member {string|null|undefined} partitionToken - * @memberof google.spanner.executor.v1.ExecuteChangeStreamQuery - * @instance - */ - ExecuteChangeStreamQuery.prototype.partitionToken = null; - - /** - * ExecuteChangeStreamQuery readOptions. - * @member {Array.} readOptions - * @memberof google.spanner.executor.v1.ExecuteChangeStreamQuery - * @instance - */ - ExecuteChangeStreamQuery.prototype.readOptions = $util.emptyArray; - - /** - * ExecuteChangeStreamQuery heartbeatMilliseconds. - * @member {number|null|undefined} heartbeatMilliseconds - * @memberof google.spanner.executor.v1.ExecuteChangeStreamQuery - * @instance - */ - ExecuteChangeStreamQuery.prototype.heartbeatMilliseconds = null; - - /** - * ExecuteChangeStreamQuery deadlineSeconds. - * @member {number|Long|null|undefined} deadlineSeconds - * @memberof google.spanner.executor.v1.ExecuteChangeStreamQuery - * @instance - */ - ExecuteChangeStreamQuery.prototype.deadlineSeconds = null; - - /** - * ExecuteChangeStreamQuery cloudDatabaseRole. - * @member {string|null|undefined} cloudDatabaseRole - * @memberof google.spanner.executor.v1.ExecuteChangeStreamQuery - * @instance - */ - ExecuteChangeStreamQuery.prototype.cloudDatabaseRole = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ExecuteChangeStreamQuery.prototype, "_endTime", { - get: $util.oneOfGetter($oneOfFields = ["endTime"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ExecuteChangeStreamQuery.prototype, "_partitionToken", { - get: $util.oneOfGetter($oneOfFields = ["partitionToken"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ExecuteChangeStreamQuery.prototype, "_heartbeatMilliseconds", { - get: $util.oneOfGetter($oneOfFields = ["heartbeatMilliseconds"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ExecuteChangeStreamQuery.prototype, "_deadlineSeconds", { - get: $util.oneOfGetter($oneOfFields = ["deadlineSeconds"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ExecuteChangeStreamQuery.prototype, "_cloudDatabaseRole", { - get: $util.oneOfGetter($oneOfFields = ["cloudDatabaseRole"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new ExecuteChangeStreamQuery instance using the specified properties. - * @function create - * @memberof google.spanner.executor.v1.ExecuteChangeStreamQuery - * @static - * @param {google.spanner.executor.v1.IExecuteChangeStreamQuery=} [properties] Properties to set - * @returns {google.spanner.executor.v1.ExecuteChangeStreamQuery} ExecuteChangeStreamQuery instance - */ - ExecuteChangeStreamQuery.create = function create(properties) { - return new ExecuteChangeStreamQuery(properties); - }; - - /** - * Encodes the specified ExecuteChangeStreamQuery message. Does not implicitly {@link google.spanner.executor.v1.ExecuteChangeStreamQuery.verify|verify} messages. - * @function encode - * @memberof google.spanner.executor.v1.ExecuteChangeStreamQuery - * @static - * @param {google.spanner.executor.v1.IExecuteChangeStreamQuery} message ExecuteChangeStreamQuery message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExecuteChangeStreamQuery.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) - $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) - $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.partitionToken != null && Object.hasOwnProperty.call(message, "partitionToken")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.partitionToken); - if (message.readOptions != null && message.readOptions.length) - for (var i = 0; i < message.readOptions.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.readOptions[i]); - if (message.heartbeatMilliseconds != null && Object.hasOwnProperty.call(message, "heartbeatMilliseconds")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.heartbeatMilliseconds); - if (message.deadlineSeconds != null && Object.hasOwnProperty.call(message, "deadlineSeconds")) - writer.uint32(/* id 7, wireType 0 =*/56).int64(message.deadlineSeconds); - if (message.cloudDatabaseRole != null && Object.hasOwnProperty.call(message, "cloudDatabaseRole")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.cloudDatabaseRole); - return writer; - }; - - /** - * Encodes the specified ExecuteChangeStreamQuery message, length delimited. Does not implicitly {@link google.spanner.executor.v1.ExecuteChangeStreamQuery.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.executor.v1.ExecuteChangeStreamQuery - * @static - * @param {google.spanner.executor.v1.IExecuteChangeStreamQuery} message ExecuteChangeStreamQuery message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExecuteChangeStreamQuery.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExecuteChangeStreamQuery message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.executor.v1.ExecuteChangeStreamQuery - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.executor.v1.ExecuteChangeStreamQuery} ExecuteChangeStreamQuery - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExecuteChangeStreamQuery.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.ExecuteChangeStreamQuery(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 3: { - message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 4: { - message.partitionToken = reader.string(); - break; - } - case 5: { - if (!(message.readOptions && message.readOptions.length)) - message.readOptions = []; - message.readOptions.push(reader.string()); - break; - } - case 6: { - message.heartbeatMilliseconds = reader.int32(); - break; - } - case 7: { - message.deadlineSeconds = reader.int64(); - break; - } - case 8: { - message.cloudDatabaseRole = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExecuteChangeStreamQuery message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.executor.v1.ExecuteChangeStreamQuery - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.executor.v1.ExecuteChangeStreamQuery} ExecuteChangeStreamQuery - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExecuteChangeStreamQuery.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExecuteChangeStreamQuery message. - * @function verify - * @memberof google.spanner.executor.v1.ExecuteChangeStreamQuery - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExecuteChangeStreamQuery.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.startTime != null && message.hasOwnProperty("startTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.startTime); - if (error) - return "startTime." + error; - } - if (message.endTime != null && message.hasOwnProperty("endTime")) { - properties._endTime = 1; - { - var error = $root.google.protobuf.Timestamp.verify(message.endTime); - if (error) - return "endTime." + error; - } - } - if (message.partitionToken != null && message.hasOwnProperty("partitionToken")) { - properties._partitionToken = 1; - if (!$util.isString(message.partitionToken)) - return "partitionToken: string expected"; - } - if (message.readOptions != null && message.hasOwnProperty("readOptions")) { - if (!Array.isArray(message.readOptions)) - return "readOptions: array expected"; - for (var i = 0; i < message.readOptions.length; ++i) - if (!$util.isString(message.readOptions[i])) - return "readOptions: string[] expected"; - } - if (message.heartbeatMilliseconds != null && message.hasOwnProperty("heartbeatMilliseconds")) { - properties._heartbeatMilliseconds = 1; - if (!$util.isInteger(message.heartbeatMilliseconds)) - return "heartbeatMilliseconds: integer expected"; - } - if (message.deadlineSeconds != null && message.hasOwnProperty("deadlineSeconds")) { - properties._deadlineSeconds = 1; - if (!$util.isInteger(message.deadlineSeconds) && !(message.deadlineSeconds && $util.isInteger(message.deadlineSeconds.low) && $util.isInteger(message.deadlineSeconds.high))) - return "deadlineSeconds: integer|Long expected"; - } - if (message.cloudDatabaseRole != null && message.hasOwnProperty("cloudDatabaseRole")) { - properties._cloudDatabaseRole = 1; - if (!$util.isString(message.cloudDatabaseRole)) - return "cloudDatabaseRole: string expected"; - } - return null; - }; - - /** - * Creates an ExecuteChangeStreamQuery message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.executor.v1.ExecuteChangeStreamQuery - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.executor.v1.ExecuteChangeStreamQuery} ExecuteChangeStreamQuery - */ - ExecuteChangeStreamQuery.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.executor.v1.ExecuteChangeStreamQuery) - return object; - var message = new $root.google.spanner.executor.v1.ExecuteChangeStreamQuery(); - if (object.name != null) - message.name = String(object.name); - if (object.startTime != null) { - if (typeof object.startTime !== "object") - throw TypeError(".google.spanner.executor.v1.ExecuteChangeStreamQuery.startTime: object expected"); - message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); - } - if (object.endTime != null) { - if (typeof object.endTime !== "object") - throw TypeError(".google.spanner.executor.v1.ExecuteChangeStreamQuery.endTime: object expected"); - message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); - } - if (object.partitionToken != null) - message.partitionToken = String(object.partitionToken); - if (object.readOptions) { - if (!Array.isArray(object.readOptions)) - throw TypeError(".google.spanner.executor.v1.ExecuteChangeStreamQuery.readOptions: array expected"); - message.readOptions = []; - for (var i = 0; i < object.readOptions.length; ++i) - message.readOptions[i] = String(object.readOptions[i]); - } - if (object.heartbeatMilliseconds != null) - message.heartbeatMilliseconds = object.heartbeatMilliseconds | 0; - if (object.deadlineSeconds != null) - if ($util.Long) - (message.deadlineSeconds = $util.Long.fromValue(object.deadlineSeconds)).unsigned = false; - else if (typeof object.deadlineSeconds === "string") - message.deadlineSeconds = parseInt(object.deadlineSeconds, 10); - else if (typeof object.deadlineSeconds === "number") - message.deadlineSeconds = object.deadlineSeconds; - else if (typeof object.deadlineSeconds === "object") - message.deadlineSeconds = new $util.LongBits(object.deadlineSeconds.low >>> 0, object.deadlineSeconds.high >>> 0).toNumber(); - if (object.cloudDatabaseRole != null) - message.cloudDatabaseRole = String(object.cloudDatabaseRole); - return message; - }; - - /** - * Creates a plain object from an ExecuteChangeStreamQuery message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.executor.v1.ExecuteChangeStreamQuery - * @static - * @param {google.spanner.executor.v1.ExecuteChangeStreamQuery} message ExecuteChangeStreamQuery - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExecuteChangeStreamQuery.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.readOptions = []; - if (options.defaults) { - object.name = ""; - object.startTime = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.startTime != null && message.hasOwnProperty("startTime")) - object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); - if (message.endTime != null && message.hasOwnProperty("endTime")) { - object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); - if (options.oneofs) - object._endTime = "endTime"; - } - if (message.partitionToken != null && message.hasOwnProperty("partitionToken")) { - object.partitionToken = message.partitionToken; - if (options.oneofs) - object._partitionToken = "partitionToken"; - } - if (message.readOptions && message.readOptions.length) { - object.readOptions = []; - for (var j = 0; j < message.readOptions.length; ++j) - object.readOptions[j] = message.readOptions[j]; - } - if (message.heartbeatMilliseconds != null && message.hasOwnProperty("heartbeatMilliseconds")) { - object.heartbeatMilliseconds = message.heartbeatMilliseconds; - if (options.oneofs) - object._heartbeatMilliseconds = "heartbeatMilliseconds"; - } - if (message.deadlineSeconds != null && message.hasOwnProperty("deadlineSeconds")) { - if (typeof message.deadlineSeconds === "number") - object.deadlineSeconds = options.longs === String ? String(message.deadlineSeconds) : message.deadlineSeconds; - else - object.deadlineSeconds = options.longs === String ? $util.Long.prototype.toString.call(message.deadlineSeconds) : options.longs === Number ? new $util.LongBits(message.deadlineSeconds.low >>> 0, message.deadlineSeconds.high >>> 0).toNumber() : message.deadlineSeconds; - if (options.oneofs) - object._deadlineSeconds = "deadlineSeconds"; - } - if (message.cloudDatabaseRole != null && message.hasOwnProperty("cloudDatabaseRole")) { - object.cloudDatabaseRole = message.cloudDatabaseRole; - if (options.oneofs) - object._cloudDatabaseRole = "cloudDatabaseRole"; - } - return object; - }; - - /** - * Converts this ExecuteChangeStreamQuery to JSON. - * @function toJSON - * @memberof google.spanner.executor.v1.ExecuteChangeStreamQuery - * @instance - * @returns {Object.} JSON object - */ - ExecuteChangeStreamQuery.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExecuteChangeStreamQuery - * @function getTypeUrl - * @memberof google.spanner.executor.v1.ExecuteChangeStreamQuery - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExecuteChangeStreamQuery.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.executor.v1.ExecuteChangeStreamQuery"; - }; - - return ExecuteChangeStreamQuery; - })(); - - v1.SpannerActionOutcome = (function() { - - /** - * Properties of a SpannerActionOutcome. - * @memberof google.spanner.executor.v1 - * @interface ISpannerActionOutcome - * @property {google.rpc.IStatus|null} [status] SpannerActionOutcome status - * @property {google.protobuf.ITimestamp|null} [commitTime] SpannerActionOutcome commitTime - * @property {google.spanner.executor.v1.IReadResult|null} [readResult] SpannerActionOutcome readResult - * @property {google.spanner.executor.v1.IQueryResult|null} [queryResult] SpannerActionOutcome queryResult - * @property {boolean|null} [transactionRestarted] SpannerActionOutcome transactionRestarted - * @property {Uint8Array|null} [batchTxnId] SpannerActionOutcome batchTxnId - * @property {Array.|null} [dbPartition] SpannerActionOutcome dbPartition - * @property {google.spanner.executor.v1.IAdminResult|null} [adminResult] SpannerActionOutcome adminResult - * @property {Array.|null} [dmlRowsModified] SpannerActionOutcome dmlRowsModified - * @property {Array.|null} [changeStreamRecords] SpannerActionOutcome changeStreamRecords - */ - - /** - * Constructs a new SpannerActionOutcome. - * @memberof google.spanner.executor.v1 - * @classdesc Represents a SpannerActionOutcome. - * @implements ISpannerActionOutcome - * @constructor - * @param {google.spanner.executor.v1.ISpannerActionOutcome=} [properties] Properties to set - */ - function SpannerActionOutcome(properties) { - this.dbPartition = []; - this.dmlRowsModified = []; - this.changeStreamRecords = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SpannerActionOutcome status. - * @member {google.rpc.IStatus|null|undefined} status - * @memberof google.spanner.executor.v1.SpannerActionOutcome - * @instance - */ - SpannerActionOutcome.prototype.status = null; - - /** - * SpannerActionOutcome commitTime. - * @member {google.protobuf.ITimestamp|null|undefined} commitTime - * @memberof google.spanner.executor.v1.SpannerActionOutcome - * @instance - */ - SpannerActionOutcome.prototype.commitTime = null; - - /** - * SpannerActionOutcome readResult. - * @member {google.spanner.executor.v1.IReadResult|null|undefined} readResult - * @memberof google.spanner.executor.v1.SpannerActionOutcome - * @instance - */ - SpannerActionOutcome.prototype.readResult = null; - - /** - * SpannerActionOutcome queryResult. - * @member {google.spanner.executor.v1.IQueryResult|null|undefined} queryResult - * @memberof google.spanner.executor.v1.SpannerActionOutcome - * @instance - */ - SpannerActionOutcome.prototype.queryResult = null; - - /** - * SpannerActionOutcome transactionRestarted. - * @member {boolean|null|undefined} transactionRestarted - * @memberof google.spanner.executor.v1.SpannerActionOutcome - * @instance - */ - SpannerActionOutcome.prototype.transactionRestarted = null; - - /** - * SpannerActionOutcome batchTxnId. - * @member {Uint8Array|null|undefined} batchTxnId - * @memberof google.spanner.executor.v1.SpannerActionOutcome - * @instance - */ - SpannerActionOutcome.prototype.batchTxnId = null; - - /** - * SpannerActionOutcome dbPartition. - * @member {Array.} dbPartition - * @memberof google.spanner.executor.v1.SpannerActionOutcome - * @instance - */ - SpannerActionOutcome.prototype.dbPartition = $util.emptyArray; - - /** - * SpannerActionOutcome adminResult. - * @member {google.spanner.executor.v1.IAdminResult|null|undefined} adminResult - * @memberof google.spanner.executor.v1.SpannerActionOutcome - * @instance - */ - SpannerActionOutcome.prototype.adminResult = null; - - /** - * SpannerActionOutcome dmlRowsModified. - * @member {Array.} dmlRowsModified - * @memberof google.spanner.executor.v1.SpannerActionOutcome - * @instance - */ - SpannerActionOutcome.prototype.dmlRowsModified = $util.emptyArray; - - /** - * SpannerActionOutcome changeStreamRecords. - * @member {Array.} changeStreamRecords - * @memberof google.spanner.executor.v1.SpannerActionOutcome - * @instance - */ - SpannerActionOutcome.prototype.changeStreamRecords = $util.emptyArray; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(SpannerActionOutcome.prototype, "_status", { - get: $util.oneOfGetter($oneOfFields = ["status"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(SpannerActionOutcome.prototype, "_commitTime", { - get: $util.oneOfGetter($oneOfFields = ["commitTime"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(SpannerActionOutcome.prototype, "_readResult", { - get: $util.oneOfGetter($oneOfFields = ["readResult"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(SpannerActionOutcome.prototype, "_queryResult", { - get: $util.oneOfGetter($oneOfFields = ["queryResult"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(SpannerActionOutcome.prototype, "_transactionRestarted", { - get: $util.oneOfGetter($oneOfFields = ["transactionRestarted"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(SpannerActionOutcome.prototype, "_batchTxnId", { - get: $util.oneOfGetter($oneOfFields = ["batchTxnId"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(SpannerActionOutcome.prototype, "_adminResult", { - get: $util.oneOfGetter($oneOfFields = ["adminResult"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new SpannerActionOutcome instance using the specified properties. - * @function create - * @memberof google.spanner.executor.v1.SpannerActionOutcome - * @static - * @param {google.spanner.executor.v1.ISpannerActionOutcome=} [properties] Properties to set - * @returns {google.spanner.executor.v1.SpannerActionOutcome} SpannerActionOutcome instance - */ - SpannerActionOutcome.create = function create(properties) { - return new SpannerActionOutcome(properties); - }; - - /** - * Encodes the specified SpannerActionOutcome message. Does not implicitly {@link google.spanner.executor.v1.SpannerActionOutcome.verify|verify} messages. - * @function encode - * @memberof google.spanner.executor.v1.SpannerActionOutcome - * @static - * @param {google.spanner.executor.v1.ISpannerActionOutcome} message SpannerActionOutcome message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SpannerActionOutcome.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.status != null && Object.hasOwnProperty.call(message, "status")) - $root.google.rpc.Status.encode(message.status, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.commitTime != null && Object.hasOwnProperty.call(message, "commitTime")) - $root.google.protobuf.Timestamp.encode(message.commitTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.readResult != null && Object.hasOwnProperty.call(message, "readResult")) - $root.google.spanner.executor.v1.ReadResult.encode(message.readResult, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.queryResult != null && Object.hasOwnProperty.call(message, "queryResult")) - $root.google.spanner.executor.v1.QueryResult.encode(message.queryResult, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.transactionRestarted != null && Object.hasOwnProperty.call(message, "transactionRestarted")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.transactionRestarted); - if (message.batchTxnId != null && Object.hasOwnProperty.call(message, "batchTxnId")) - writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.batchTxnId); - if (message.dbPartition != null && message.dbPartition.length) - for (var i = 0; i < message.dbPartition.length; ++i) - $root.google.spanner.executor.v1.BatchPartition.encode(message.dbPartition[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.adminResult != null && Object.hasOwnProperty.call(message, "adminResult")) - $root.google.spanner.executor.v1.AdminResult.encode(message.adminResult, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.dmlRowsModified != null && message.dmlRowsModified.length) { - writer.uint32(/* id 9, wireType 2 =*/74).fork(); - for (var i = 0; i < message.dmlRowsModified.length; ++i) - writer.int64(message.dmlRowsModified[i]); - writer.ldelim(); - } - if (message.changeStreamRecords != null && message.changeStreamRecords.length) - for (var i = 0; i < message.changeStreamRecords.length; ++i) - $root.google.spanner.executor.v1.ChangeStreamRecord.encode(message.changeStreamRecords[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified SpannerActionOutcome message, length delimited. Does not implicitly {@link google.spanner.executor.v1.SpannerActionOutcome.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.executor.v1.SpannerActionOutcome - * @static - * @param {google.spanner.executor.v1.ISpannerActionOutcome} message SpannerActionOutcome message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SpannerActionOutcome.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SpannerActionOutcome message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.executor.v1.SpannerActionOutcome - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.executor.v1.SpannerActionOutcome} SpannerActionOutcome - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SpannerActionOutcome.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.SpannerActionOutcome(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.status = $root.google.rpc.Status.decode(reader, reader.uint32()); - break; - } - case 2: { - message.commitTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 3: { - message.readResult = $root.google.spanner.executor.v1.ReadResult.decode(reader, reader.uint32()); - break; - } - case 4: { - message.queryResult = $root.google.spanner.executor.v1.QueryResult.decode(reader, reader.uint32()); - break; - } - case 5: { - message.transactionRestarted = reader.bool(); - break; - } - case 6: { - message.batchTxnId = reader.bytes(); - break; - } - case 7: { - if (!(message.dbPartition && message.dbPartition.length)) - message.dbPartition = []; - message.dbPartition.push($root.google.spanner.executor.v1.BatchPartition.decode(reader, reader.uint32())); - break; - } - case 8: { - message.adminResult = $root.google.spanner.executor.v1.AdminResult.decode(reader, reader.uint32()); - break; - } - case 9: { - if (!(message.dmlRowsModified && message.dmlRowsModified.length)) - message.dmlRowsModified = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.dmlRowsModified.push(reader.int64()); - } else - message.dmlRowsModified.push(reader.int64()); - break; - } - case 10: { - if (!(message.changeStreamRecords && message.changeStreamRecords.length)) - message.changeStreamRecords = []; - message.changeStreamRecords.push($root.google.spanner.executor.v1.ChangeStreamRecord.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SpannerActionOutcome message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.executor.v1.SpannerActionOutcome - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.executor.v1.SpannerActionOutcome} SpannerActionOutcome - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SpannerActionOutcome.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SpannerActionOutcome message. - * @function verify - * @memberof google.spanner.executor.v1.SpannerActionOutcome - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SpannerActionOutcome.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.status != null && message.hasOwnProperty("status")) { - properties._status = 1; - { - var error = $root.google.rpc.Status.verify(message.status); - if (error) - return "status." + error; - } - } - if (message.commitTime != null && message.hasOwnProperty("commitTime")) { - properties._commitTime = 1; - { - var error = $root.google.protobuf.Timestamp.verify(message.commitTime); - if (error) - return "commitTime." + error; - } - } - if (message.readResult != null && message.hasOwnProperty("readResult")) { - properties._readResult = 1; - { - var error = $root.google.spanner.executor.v1.ReadResult.verify(message.readResult); - if (error) - return "readResult." + error; - } - } - if (message.queryResult != null && message.hasOwnProperty("queryResult")) { - properties._queryResult = 1; - { - var error = $root.google.spanner.executor.v1.QueryResult.verify(message.queryResult); - if (error) - return "queryResult." + error; - } - } - if (message.transactionRestarted != null && message.hasOwnProperty("transactionRestarted")) { - properties._transactionRestarted = 1; - if (typeof message.transactionRestarted !== "boolean") - return "transactionRestarted: boolean expected"; - } - if (message.batchTxnId != null && message.hasOwnProperty("batchTxnId")) { - properties._batchTxnId = 1; - if (!(message.batchTxnId && typeof message.batchTxnId.length === "number" || $util.isString(message.batchTxnId))) - return "batchTxnId: buffer expected"; - } - if (message.dbPartition != null && message.hasOwnProperty("dbPartition")) { - if (!Array.isArray(message.dbPartition)) - return "dbPartition: array expected"; - for (var i = 0; i < message.dbPartition.length; ++i) { - var error = $root.google.spanner.executor.v1.BatchPartition.verify(message.dbPartition[i]); - if (error) - return "dbPartition." + error; - } - } - if (message.adminResult != null && message.hasOwnProperty("adminResult")) { - properties._adminResult = 1; - { - var error = $root.google.spanner.executor.v1.AdminResult.verify(message.adminResult); - if (error) - return "adminResult." + error; - } - } - if (message.dmlRowsModified != null && message.hasOwnProperty("dmlRowsModified")) { - if (!Array.isArray(message.dmlRowsModified)) - return "dmlRowsModified: array expected"; - for (var i = 0; i < message.dmlRowsModified.length; ++i) - if (!$util.isInteger(message.dmlRowsModified[i]) && !(message.dmlRowsModified[i] && $util.isInteger(message.dmlRowsModified[i].low) && $util.isInteger(message.dmlRowsModified[i].high))) - return "dmlRowsModified: integer|Long[] expected"; - } - if (message.changeStreamRecords != null && message.hasOwnProperty("changeStreamRecords")) { - if (!Array.isArray(message.changeStreamRecords)) - return "changeStreamRecords: array expected"; - for (var i = 0; i < message.changeStreamRecords.length; ++i) { - var error = $root.google.spanner.executor.v1.ChangeStreamRecord.verify(message.changeStreamRecords[i]); - if (error) - return "changeStreamRecords." + error; - } - } - return null; - }; - - /** - * Creates a SpannerActionOutcome message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.executor.v1.SpannerActionOutcome - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.executor.v1.SpannerActionOutcome} SpannerActionOutcome - */ - SpannerActionOutcome.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.executor.v1.SpannerActionOutcome) - return object; - var message = new $root.google.spanner.executor.v1.SpannerActionOutcome(); - if (object.status != null) { - if (typeof object.status !== "object") - throw TypeError(".google.spanner.executor.v1.SpannerActionOutcome.status: object expected"); - message.status = $root.google.rpc.Status.fromObject(object.status); - } - if (object.commitTime != null) { - if (typeof object.commitTime !== "object") - throw TypeError(".google.spanner.executor.v1.SpannerActionOutcome.commitTime: object expected"); - message.commitTime = $root.google.protobuf.Timestamp.fromObject(object.commitTime); - } - if (object.readResult != null) { - if (typeof object.readResult !== "object") - throw TypeError(".google.spanner.executor.v1.SpannerActionOutcome.readResult: object expected"); - message.readResult = $root.google.spanner.executor.v1.ReadResult.fromObject(object.readResult); - } - if (object.queryResult != null) { - if (typeof object.queryResult !== "object") - throw TypeError(".google.spanner.executor.v1.SpannerActionOutcome.queryResult: object expected"); - message.queryResult = $root.google.spanner.executor.v1.QueryResult.fromObject(object.queryResult); - } - if (object.transactionRestarted != null) - message.transactionRestarted = Boolean(object.transactionRestarted); - if (object.batchTxnId != null) - if (typeof object.batchTxnId === "string") - $util.base64.decode(object.batchTxnId, message.batchTxnId = $util.newBuffer($util.base64.length(object.batchTxnId)), 0); - else if (object.batchTxnId.length >= 0) - message.batchTxnId = object.batchTxnId; - if (object.dbPartition) { - if (!Array.isArray(object.dbPartition)) - throw TypeError(".google.spanner.executor.v1.SpannerActionOutcome.dbPartition: array expected"); - message.dbPartition = []; - for (var i = 0; i < object.dbPartition.length; ++i) { - if (typeof object.dbPartition[i] !== "object") - throw TypeError(".google.spanner.executor.v1.SpannerActionOutcome.dbPartition: object expected"); - message.dbPartition[i] = $root.google.spanner.executor.v1.BatchPartition.fromObject(object.dbPartition[i]); - } - } - if (object.adminResult != null) { - if (typeof object.adminResult !== "object") - throw TypeError(".google.spanner.executor.v1.SpannerActionOutcome.adminResult: object expected"); - message.adminResult = $root.google.spanner.executor.v1.AdminResult.fromObject(object.adminResult); - } - if (object.dmlRowsModified) { - if (!Array.isArray(object.dmlRowsModified)) - throw TypeError(".google.spanner.executor.v1.SpannerActionOutcome.dmlRowsModified: array expected"); - message.dmlRowsModified = []; - for (var i = 0; i < object.dmlRowsModified.length; ++i) - if ($util.Long) - (message.dmlRowsModified[i] = $util.Long.fromValue(object.dmlRowsModified[i])).unsigned = false; - else if (typeof object.dmlRowsModified[i] === "string") - message.dmlRowsModified[i] = parseInt(object.dmlRowsModified[i], 10); - else if (typeof object.dmlRowsModified[i] === "number") - message.dmlRowsModified[i] = object.dmlRowsModified[i]; - else if (typeof object.dmlRowsModified[i] === "object") - message.dmlRowsModified[i] = new $util.LongBits(object.dmlRowsModified[i].low >>> 0, object.dmlRowsModified[i].high >>> 0).toNumber(); - } - if (object.changeStreamRecords) { - if (!Array.isArray(object.changeStreamRecords)) - throw TypeError(".google.spanner.executor.v1.SpannerActionOutcome.changeStreamRecords: array expected"); - message.changeStreamRecords = []; - for (var i = 0; i < object.changeStreamRecords.length; ++i) { - if (typeof object.changeStreamRecords[i] !== "object") - throw TypeError(".google.spanner.executor.v1.SpannerActionOutcome.changeStreamRecords: object expected"); - message.changeStreamRecords[i] = $root.google.spanner.executor.v1.ChangeStreamRecord.fromObject(object.changeStreamRecords[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a SpannerActionOutcome message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.executor.v1.SpannerActionOutcome - * @static - * @param {google.spanner.executor.v1.SpannerActionOutcome} message SpannerActionOutcome - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SpannerActionOutcome.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.dbPartition = []; - object.dmlRowsModified = []; - object.changeStreamRecords = []; - } - if (message.status != null && message.hasOwnProperty("status")) { - object.status = $root.google.rpc.Status.toObject(message.status, options); - if (options.oneofs) - object._status = "status"; - } - if (message.commitTime != null && message.hasOwnProperty("commitTime")) { - object.commitTime = $root.google.protobuf.Timestamp.toObject(message.commitTime, options); - if (options.oneofs) - object._commitTime = "commitTime"; - } - if (message.readResult != null && message.hasOwnProperty("readResult")) { - object.readResult = $root.google.spanner.executor.v1.ReadResult.toObject(message.readResult, options); - if (options.oneofs) - object._readResult = "readResult"; - } - if (message.queryResult != null && message.hasOwnProperty("queryResult")) { - object.queryResult = $root.google.spanner.executor.v1.QueryResult.toObject(message.queryResult, options); - if (options.oneofs) - object._queryResult = "queryResult"; - } - if (message.transactionRestarted != null && message.hasOwnProperty("transactionRestarted")) { - object.transactionRestarted = message.transactionRestarted; - if (options.oneofs) - object._transactionRestarted = "transactionRestarted"; - } - if (message.batchTxnId != null && message.hasOwnProperty("batchTxnId")) { - object.batchTxnId = options.bytes === String ? $util.base64.encode(message.batchTxnId, 0, message.batchTxnId.length) : options.bytes === Array ? Array.prototype.slice.call(message.batchTxnId) : message.batchTxnId; - if (options.oneofs) - object._batchTxnId = "batchTxnId"; - } - if (message.dbPartition && message.dbPartition.length) { - object.dbPartition = []; - for (var j = 0; j < message.dbPartition.length; ++j) - object.dbPartition[j] = $root.google.spanner.executor.v1.BatchPartition.toObject(message.dbPartition[j], options); - } - if (message.adminResult != null && message.hasOwnProperty("adminResult")) { - object.adminResult = $root.google.spanner.executor.v1.AdminResult.toObject(message.adminResult, options); - if (options.oneofs) - object._adminResult = "adminResult"; - } - if (message.dmlRowsModified && message.dmlRowsModified.length) { - object.dmlRowsModified = []; - for (var j = 0; j < message.dmlRowsModified.length; ++j) - if (typeof message.dmlRowsModified[j] === "number") - object.dmlRowsModified[j] = options.longs === String ? String(message.dmlRowsModified[j]) : message.dmlRowsModified[j]; - else - object.dmlRowsModified[j] = options.longs === String ? $util.Long.prototype.toString.call(message.dmlRowsModified[j]) : options.longs === Number ? new $util.LongBits(message.dmlRowsModified[j].low >>> 0, message.dmlRowsModified[j].high >>> 0).toNumber() : message.dmlRowsModified[j]; - } - if (message.changeStreamRecords && message.changeStreamRecords.length) { - object.changeStreamRecords = []; - for (var j = 0; j < message.changeStreamRecords.length; ++j) - object.changeStreamRecords[j] = $root.google.spanner.executor.v1.ChangeStreamRecord.toObject(message.changeStreamRecords[j], options); - } - return object; - }; - - /** - * Converts this SpannerActionOutcome to JSON. - * @function toJSON - * @memberof google.spanner.executor.v1.SpannerActionOutcome - * @instance - * @returns {Object.} JSON object - */ - SpannerActionOutcome.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SpannerActionOutcome - * @function getTypeUrl - * @memberof google.spanner.executor.v1.SpannerActionOutcome - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SpannerActionOutcome.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.executor.v1.SpannerActionOutcome"; - }; - - return SpannerActionOutcome; - })(); - - v1.AdminResult = (function() { - - /** - * Properties of an AdminResult. - * @memberof google.spanner.executor.v1 - * @interface IAdminResult - * @property {google.spanner.executor.v1.ICloudBackupResponse|null} [backupResponse] AdminResult backupResponse - * @property {google.spanner.executor.v1.IOperationResponse|null} [operationResponse] AdminResult operationResponse - * @property {google.spanner.executor.v1.ICloudDatabaseResponse|null} [databaseResponse] AdminResult databaseResponse - * @property {google.spanner.executor.v1.ICloudInstanceResponse|null} [instanceResponse] AdminResult instanceResponse - * @property {google.spanner.executor.v1.ICloudInstanceConfigResponse|null} [instanceConfigResponse] AdminResult instanceConfigResponse - */ - - /** - * Constructs a new AdminResult. - * @memberof google.spanner.executor.v1 - * @classdesc Represents an AdminResult. - * @implements IAdminResult - * @constructor - * @param {google.spanner.executor.v1.IAdminResult=} [properties] Properties to set - */ - function AdminResult(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AdminResult backupResponse. - * @member {google.spanner.executor.v1.ICloudBackupResponse|null|undefined} backupResponse - * @memberof google.spanner.executor.v1.AdminResult - * @instance - */ - AdminResult.prototype.backupResponse = null; - - /** - * AdminResult operationResponse. - * @member {google.spanner.executor.v1.IOperationResponse|null|undefined} operationResponse - * @memberof google.spanner.executor.v1.AdminResult - * @instance - */ - AdminResult.prototype.operationResponse = null; - - /** - * AdminResult databaseResponse. - * @member {google.spanner.executor.v1.ICloudDatabaseResponse|null|undefined} databaseResponse - * @memberof google.spanner.executor.v1.AdminResult - * @instance - */ - AdminResult.prototype.databaseResponse = null; - - /** - * AdminResult instanceResponse. - * @member {google.spanner.executor.v1.ICloudInstanceResponse|null|undefined} instanceResponse - * @memberof google.spanner.executor.v1.AdminResult - * @instance - */ - AdminResult.prototype.instanceResponse = null; - - /** - * AdminResult instanceConfigResponse. - * @member {google.spanner.executor.v1.ICloudInstanceConfigResponse|null|undefined} instanceConfigResponse - * @memberof google.spanner.executor.v1.AdminResult - * @instance - */ - AdminResult.prototype.instanceConfigResponse = null; - - /** - * Creates a new AdminResult instance using the specified properties. - * @function create - * @memberof google.spanner.executor.v1.AdminResult - * @static - * @param {google.spanner.executor.v1.IAdminResult=} [properties] Properties to set - * @returns {google.spanner.executor.v1.AdminResult} AdminResult instance - */ - AdminResult.create = function create(properties) { - return new AdminResult(properties); - }; - - /** - * Encodes the specified AdminResult message. Does not implicitly {@link google.spanner.executor.v1.AdminResult.verify|verify} messages. - * @function encode - * @memberof google.spanner.executor.v1.AdminResult - * @static - * @param {google.spanner.executor.v1.IAdminResult} message AdminResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AdminResult.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.backupResponse != null && Object.hasOwnProperty.call(message, "backupResponse")) - $root.google.spanner.executor.v1.CloudBackupResponse.encode(message.backupResponse, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.operationResponse != null && Object.hasOwnProperty.call(message, "operationResponse")) - $root.google.spanner.executor.v1.OperationResponse.encode(message.operationResponse, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.databaseResponse != null && Object.hasOwnProperty.call(message, "databaseResponse")) - $root.google.spanner.executor.v1.CloudDatabaseResponse.encode(message.databaseResponse, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.instanceResponse != null && Object.hasOwnProperty.call(message, "instanceResponse")) - $root.google.spanner.executor.v1.CloudInstanceResponse.encode(message.instanceResponse, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.instanceConfigResponse != null && Object.hasOwnProperty.call(message, "instanceConfigResponse")) - $root.google.spanner.executor.v1.CloudInstanceConfigResponse.encode(message.instanceConfigResponse, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified AdminResult message, length delimited. Does not implicitly {@link google.spanner.executor.v1.AdminResult.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.executor.v1.AdminResult - * @static - * @param {google.spanner.executor.v1.IAdminResult} message AdminResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AdminResult.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AdminResult message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.executor.v1.AdminResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.executor.v1.AdminResult} AdminResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AdminResult.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.AdminResult(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.backupResponse = $root.google.spanner.executor.v1.CloudBackupResponse.decode(reader, reader.uint32()); - break; - } - case 2: { - message.operationResponse = $root.google.spanner.executor.v1.OperationResponse.decode(reader, reader.uint32()); - break; - } - case 3: { - message.databaseResponse = $root.google.spanner.executor.v1.CloudDatabaseResponse.decode(reader, reader.uint32()); - break; - } - case 4: { - message.instanceResponse = $root.google.spanner.executor.v1.CloudInstanceResponse.decode(reader, reader.uint32()); - break; - } - case 5: { - message.instanceConfigResponse = $root.google.spanner.executor.v1.CloudInstanceConfigResponse.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AdminResult message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.executor.v1.AdminResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.executor.v1.AdminResult} AdminResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AdminResult.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AdminResult message. - * @function verify - * @memberof google.spanner.executor.v1.AdminResult - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AdminResult.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.backupResponse != null && message.hasOwnProperty("backupResponse")) { - var error = $root.google.spanner.executor.v1.CloudBackupResponse.verify(message.backupResponse); - if (error) - return "backupResponse." + error; - } - if (message.operationResponse != null && message.hasOwnProperty("operationResponse")) { - var error = $root.google.spanner.executor.v1.OperationResponse.verify(message.operationResponse); - if (error) - return "operationResponse." + error; - } - if (message.databaseResponse != null && message.hasOwnProperty("databaseResponse")) { - var error = $root.google.spanner.executor.v1.CloudDatabaseResponse.verify(message.databaseResponse); - if (error) - return "databaseResponse." + error; - } - if (message.instanceResponse != null && message.hasOwnProperty("instanceResponse")) { - var error = $root.google.spanner.executor.v1.CloudInstanceResponse.verify(message.instanceResponse); - if (error) - return "instanceResponse." + error; - } - if (message.instanceConfigResponse != null && message.hasOwnProperty("instanceConfigResponse")) { - var error = $root.google.spanner.executor.v1.CloudInstanceConfigResponse.verify(message.instanceConfigResponse); - if (error) - return "instanceConfigResponse." + error; - } - return null; - }; - - /** - * Creates an AdminResult message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.executor.v1.AdminResult - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.executor.v1.AdminResult} AdminResult - */ - AdminResult.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.executor.v1.AdminResult) - return object; - var message = new $root.google.spanner.executor.v1.AdminResult(); - if (object.backupResponse != null) { - if (typeof object.backupResponse !== "object") - throw TypeError(".google.spanner.executor.v1.AdminResult.backupResponse: object expected"); - message.backupResponse = $root.google.spanner.executor.v1.CloudBackupResponse.fromObject(object.backupResponse); - } - if (object.operationResponse != null) { - if (typeof object.operationResponse !== "object") - throw TypeError(".google.spanner.executor.v1.AdminResult.operationResponse: object expected"); - message.operationResponse = $root.google.spanner.executor.v1.OperationResponse.fromObject(object.operationResponse); - } - if (object.databaseResponse != null) { - if (typeof object.databaseResponse !== "object") - throw TypeError(".google.spanner.executor.v1.AdminResult.databaseResponse: object expected"); - message.databaseResponse = $root.google.spanner.executor.v1.CloudDatabaseResponse.fromObject(object.databaseResponse); - } - if (object.instanceResponse != null) { - if (typeof object.instanceResponse !== "object") - throw TypeError(".google.spanner.executor.v1.AdminResult.instanceResponse: object expected"); - message.instanceResponse = $root.google.spanner.executor.v1.CloudInstanceResponse.fromObject(object.instanceResponse); - } - if (object.instanceConfigResponse != null) { - if (typeof object.instanceConfigResponse !== "object") - throw TypeError(".google.spanner.executor.v1.AdminResult.instanceConfigResponse: object expected"); - message.instanceConfigResponse = $root.google.spanner.executor.v1.CloudInstanceConfigResponse.fromObject(object.instanceConfigResponse); - } - return message; - }; - - /** - * Creates a plain object from an AdminResult message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.executor.v1.AdminResult - * @static - * @param {google.spanner.executor.v1.AdminResult} message AdminResult - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AdminResult.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.backupResponse = null; - object.operationResponse = null; - object.databaseResponse = null; - object.instanceResponse = null; - object.instanceConfigResponse = null; - } - if (message.backupResponse != null && message.hasOwnProperty("backupResponse")) - object.backupResponse = $root.google.spanner.executor.v1.CloudBackupResponse.toObject(message.backupResponse, options); - if (message.operationResponse != null && message.hasOwnProperty("operationResponse")) - object.operationResponse = $root.google.spanner.executor.v1.OperationResponse.toObject(message.operationResponse, options); - if (message.databaseResponse != null && message.hasOwnProperty("databaseResponse")) - object.databaseResponse = $root.google.spanner.executor.v1.CloudDatabaseResponse.toObject(message.databaseResponse, options); - if (message.instanceResponse != null && message.hasOwnProperty("instanceResponse")) - object.instanceResponse = $root.google.spanner.executor.v1.CloudInstanceResponse.toObject(message.instanceResponse, options); - if (message.instanceConfigResponse != null && message.hasOwnProperty("instanceConfigResponse")) - object.instanceConfigResponse = $root.google.spanner.executor.v1.CloudInstanceConfigResponse.toObject(message.instanceConfigResponse, options); - return object; - }; - - /** - * Converts this AdminResult to JSON. - * @function toJSON - * @memberof google.spanner.executor.v1.AdminResult - * @instance - * @returns {Object.} JSON object - */ - AdminResult.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AdminResult - * @function getTypeUrl - * @memberof google.spanner.executor.v1.AdminResult - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AdminResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.executor.v1.AdminResult"; - }; - - return AdminResult; - })(); - - v1.CloudBackupResponse = (function() { - - /** - * Properties of a CloudBackupResponse. - * @memberof google.spanner.executor.v1 - * @interface ICloudBackupResponse - * @property {Array.|null} [listedBackups] CloudBackupResponse listedBackups - * @property {Array.|null} [listedBackupOperations] CloudBackupResponse listedBackupOperations - * @property {string|null} [nextPageToken] CloudBackupResponse nextPageToken - * @property {google.spanner.admin.database.v1.IBackup|null} [backup] CloudBackupResponse backup - */ - - /** - * Constructs a new CloudBackupResponse. - * @memberof google.spanner.executor.v1 - * @classdesc Represents a CloudBackupResponse. - * @implements ICloudBackupResponse - * @constructor - * @param {google.spanner.executor.v1.ICloudBackupResponse=} [properties] Properties to set - */ - function CloudBackupResponse(properties) { - this.listedBackups = []; - this.listedBackupOperations = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CloudBackupResponse listedBackups. - * @member {Array.} listedBackups - * @memberof google.spanner.executor.v1.CloudBackupResponse - * @instance - */ - CloudBackupResponse.prototype.listedBackups = $util.emptyArray; - - /** - * CloudBackupResponse listedBackupOperations. - * @member {Array.} listedBackupOperations - * @memberof google.spanner.executor.v1.CloudBackupResponse - * @instance - */ - CloudBackupResponse.prototype.listedBackupOperations = $util.emptyArray; - - /** - * CloudBackupResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.spanner.executor.v1.CloudBackupResponse - * @instance - */ - CloudBackupResponse.prototype.nextPageToken = ""; - - /** - * CloudBackupResponse backup. - * @member {google.spanner.admin.database.v1.IBackup|null|undefined} backup - * @memberof google.spanner.executor.v1.CloudBackupResponse - * @instance - */ - CloudBackupResponse.prototype.backup = null; - - /** - * Creates a new CloudBackupResponse instance using the specified properties. - * @function create - * @memberof google.spanner.executor.v1.CloudBackupResponse - * @static - * @param {google.spanner.executor.v1.ICloudBackupResponse=} [properties] Properties to set - * @returns {google.spanner.executor.v1.CloudBackupResponse} CloudBackupResponse instance - */ - CloudBackupResponse.create = function create(properties) { - return new CloudBackupResponse(properties); - }; - - /** - * Encodes the specified CloudBackupResponse message. Does not implicitly {@link google.spanner.executor.v1.CloudBackupResponse.verify|verify} messages. - * @function encode - * @memberof google.spanner.executor.v1.CloudBackupResponse - * @static - * @param {google.spanner.executor.v1.ICloudBackupResponse} message CloudBackupResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CloudBackupResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.listedBackups != null && message.listedBackups.length) - for (var i = 0; i < message.listedBackups.length; ++i) - $root.google.spanner.admin.database.v1.Backup.encode(message.listedBackups[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.listedBackupOperations != null && message.listedBackupOperations.length) - for (var i = 0; i < message.listedBackupOperations.length; ++i) - $root.google.longrunning.Operation.encode(message.listedBackupOperations[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); - if (message.backup != null && Object.hasOwnProperty.call(message, "backup")) - $root.google.spanner.admin.database.v1.Backup.encode(message.backup, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CloudBackupResponse message, length delimited. Does not implicitly {@link google.spanner.executor.v1.CloudBackupResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.executor.v1.CloudBackupResponse - * @static - * @param {google.spanner.executor.v1.ICloudBackupResponse} message CloudBackupResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CloudBackupResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CloudBackupResponse message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.executor.v1.CloudBackupResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.executor.v1.CloudBackupResponse} CloudBackupResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CloudBackupResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.CloudBackupResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.listedBackups && message.listedBackups.length)) - message.listedBackups = []; - message.listedBackups.push($root.google.spanner.admin.database.v1.Backup.decode(reader, reader.uint32())); - break; - } - case 2: { - if (!(message.listedBackupOperations && message.listedBackupOperations.length)) - message.listedBackupOperations = []; - message.listedBackupOperations.push($root.google.longrunning.Operation.decode(reader, reader.uint32())); - break; - } - case 3: { - message.nextPageToken = reader.string(); - break; - } - case 4: { - message.backup = $root.google.spanner.admin.database.v1.Backup.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CloudBackupResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.executor.v1.CloudBackupResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.executor.v1.CloudBackupResponse} CloudBackupResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CloudBackupResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CloudBackupResponse message. - * @function verify - * @memberof google.spanner.executor.v1.CloudBackupResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CloudBackupResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.listedBackups != null && message.hasOwnProperty("listedBackups")) { - if (!Array.isArray(message.listedBackups)) - return "listedBackups: array expected"; - for (var i = 0; i < message.listedBackups.length; ++i) { - var error = $root.google.spanner.admin.database.v1.Backup.verify(message.listedBackups[i]); - if (error) - return "listedBackups." + error; - } - } - if (message.listedBackupOperations != null && message.hasOwnProperty("listedBackupOperations")) { - if (!Array.isArray(message.listedBackupOperations)) - return "listedBackupOperations: array expected"; - for (var i = 0; i < message.listedBackupOperations.length; ++i) { - var error = $root.google.longrunning.Operation.verify(message.listedBackupOperations[i]); - if (error) - return "listedBackupOperations." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - if (message.backup != null && message.hasOwnProperty("backup")) { - var error = $root.google.spanner.admin.database.v1.Backup.verify(message.backup); - if (error) - return "backup." + error; - } - return null; - }; - - /** - * Creates a CloudBackupResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.executor.v1.CloudBackupResponse - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.executor.v1.CloudBackupResponse} CloudBackupResponse - */ - CloudBackupResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.executor.v1.CloudBackupResponse) - return object; - var message = new $root.google.spanner.executor.v1.CloudBackupResponse(); - if (object.listedBackups) { - if (!Array.isArray(object.listedBackups)) - throw TypeError(".google.spanner.executor.v1.CloudBackupResponse.listedBackups: array expected"); - message.listedBackups = []; - for (var i = 0; i < object.listedBackups.length; ++i) { - if (typeof object.listedBackups[i] !== "object") - throw TypeError(".google.spanner.executor.v1.CloudBackupResponse.listedBackups: object expected"); - message.listedBackups[i] = $root.google.spanner.admin.database.v1.Backup.fromObject(object.listedBackups[i]); - } - } - if (object.listedBackupOperations) { - if (!Array.isArray(object.listedBackupOperations)) - throw TypeError(".google.spanner.executor.v1.CloudBackupResponse.listedBackupOperations: array expected"); - message.listedBackupOperations = []; - for (var i = 0; i < object.listedBackupOperations.length; ++i) { - if (typeof object.listedBackupOperations[i] !== "object") - throw TypeError(".google.spanner.executor.v1.CloudBackupResponse.listedBackupOperations: object expected"); - message.listedBackupOperations[i] = $root.google.longrunning.Operation.fromObject(object.listedBackupOperations[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.backup != null) { - if (typeof object.backup !== "object") - throw TypeError(".google.spanner.executor.v1.CloudBackupResponse.backup: object expected"); - message.backup = $root.google.spanner.admin.database.v1.Backup.fromObject(object.backup); - } - return message; - }; - - /** - * Creates a plain object from a CloudBackupResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.executor.v1.CloudBackupResponse - * @static - * @param {google.spanner.executor.v1.CloudBackupResponse} message CloudBackupResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CloudBackupResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.listedBackups = []; - object.listedBackupOperations = []; - } - if (options.defaults) { - object.nextPageToken = ""; - object.backup = null; - } - if (message.listedBackups && message.listedBackups.length) { - object.listedBackups = []; - for (var j = 0; j < message.listedBackups.length; ++j) - object.listedBackups[j] = $root.google.spanner.admin.database.v1.Backup.toObject(message.listedBackups[j], options); - } - if (message.listedBackupOperations && message.listedBackupOperations.length) { - object.listedBackupOperations = []; - for (var j = 0; j < message.listedBackupOperations.length; ++j) - object.listedBackupOperations[j] = $root.google.longrunning.Operation.toObject(message.listedBackupOperations[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - if (message.backup != null && message.hasOwnProperty("backup")) - object.backup = $root.google.spanner.admin.database.v1.Backup.toObject(message.backup, options); - return object; - }; - - /** - * Converts this CloudBackupResponse to JSON. - * @function toJSON - * @memberof google.spanner.executor.v1.CloudBackupResponse - * @instance - * @returns {Object.} JSON object - */ - CloudBackupResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CloudBackupResponse - * @function getTypeUrl - * @memberof google.spanner.executor.v1.CloudBackupResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CloudBackupResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.executor.v1.CloudBackupResponse"; - }; - - return CloudBackupResponse; - })(); - - v1.OperationResponse = (function() { - - /** - * Properties of an OperationResponse. - * @memberof google.spanner.executor.v1 - * @interface IOperationResponse - * @property {Array.|null} [listedOperations] OperationResponse listedOperations - * @property {string|null} [nextPageToken] OperationResponse nextPageToken - * @property {google.longrunning.IOperation|null} [operation] OperationResponse operation - */ - - /** - * Constructs a new OperationResponse. - * @memberof google.spanner.executor.v1 - * @classdesc Represents an OperationResponse. - * @implements IOperationResponse - * @constructor - * @param {google.spanner.executor.v1.IOperationResponse=} [properties] Properties to set - */ - function OperationResponse(properties) { - this.listedOperations = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * OperationResponse listedOperations. - * @member {Array.} listedOperations - * @memberof google.spanner.executor.v1.OperationResponse - * @instance - */ - OperationResponse.prototype.listedOperations = $util.emptyArray; - - /** - * OperationResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.spanner.executor.v1.OperationResponse - * @instance - */ - OperationResponse.prototype.nextPageToken = ""; - - /** - * OperationResponse operation. - * @member {google.longrunning.IOperation|null|undefined} operation - * @memberof google.spanner.executor.v1.OperationResponse - * @instance - */ - OperationResponse.prototype.operation = null; - - /** - * Creates a new OperationResponse instance using the specified properties. - * @function create - * @memberof google.spanner.executor.v1.OperationResponse - * @static - * @param {google.spanner.executor.v1.IOperationResponse=} [properties] Properties to set - * @returns {google.spanner.executor.v1.OperationResponse} OperationResponse instance - */ - OperationResponse.create = function create(properties) { - return new OperationResponse(properties); - }; - - /** - * Encodes the specified OperationResponse message. Does not implicitly {@link google.spanner.executor.v1.OperationResponse.verify|verify} messages. - * @function encode - * @memberof google.spanner.executor.v1.OperationResponse - * @static - * @param {google.spanner.executor.v1.IOperationResponse} message OperationResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OperationResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.listedOperations != null && message.listedOperations.length) - for (var i = 0; i < message.listedOperations.length; ++i) - $root.google.longrunning.Operation.encode(message.listedOperations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - if (message.operation != null && Object.hasOwnProperty.call(message, "operation")) - $root.google.longrunning.Operation.encode(message.operation, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified OperationResponse message, length delimited. Does not implicitly {@link google.spanner.executor.v1.OperationResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.executor.v1.OperationResponse - * @static - * @param {google.spanner.executor.v1.IOperationResponse} message OperationResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OperationResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OperationResponse message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.executor.v1.OperationResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.executor.v1.OperationResponse} OperationResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OperationResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.OperationResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.listedOperations && message.listedOperations.length)) - message.listedOperations = []; - message.listedOperations.push($root.google.longrunning.Operation.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - case 3: { - message.operation = $root.google.longrunning.Operation.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OperationResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.executor.v1.OperationResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.executor.v1.OperationResponse} OperationResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OperationResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OperationResponse message. - * @function verify - * @memberof google.spanner.executor.v1.OperationResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OperationResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.listedOperations != null && message.hasOwnProperty("listedOperations")) { - if (!Array.isArray(message.listedOperations)) - return "listedOperations: array expected"; - for (var i = 0; i < message.listedOperations.length; ++i) { - var error = $root.google.longrunning.Operation.verify(message.listedOperations[i]); - if (error) - return "listedOperations." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - if (message.operation != null && message.hasOwnProperty("operation")) { - var error = $root.google.longrunning.Operation.verify(message.operation); - if (error) - return "operation." + error; - } - return null; - }; - - /** - * Creates an OperationResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.executor.v1.OperationResponse - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.executor.v1.OperationResponse} OperationResponse - */ - OperationResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.executor.v1.OperationResponse) - return object; - var message = new $root.google.spanner.executor.v1.OperationResponse(); - if (object.listedOperations) { - if (!Array.isArray(object.listedOperations)) - throw TypeError(".google.spanner.executor.v1.OperationResponse.listedOperations: array expected"); - message.listedOperations = []; - for (var i = 0; i < object.listedOperations.length; ++i) { - if (typeof object.listedOperations[i] !== "object") - throw TypeError(".google.spanner.executor.v1.OperationResponse.listedOperations: object expected"); - message.listedOperations[i] = $root.google.longrunning.Operation.fromObject(object.listedOperations[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.operation != null) { - if (typeof object.operation !== "object") - throw TypeError(".google.spanner.executor.v1.OperationResponse.operation: object expected"); - message.operation = $root.google.longrunning.Operation.fromObject(object.operation); - } - return message; - }; - - /** - * Creates a plain object from an OperationResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.executor.v1.OperationResponse - * @static - * @param {google.spanner.executor.v1.OperationResponse} message OperationResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OperationResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.listedOperations = []; - if (options.defaults) { - object.nextPageToken = ""; - object.operation = null; - } - if (message.listedOperations && message.listedOperations.length) { - object.listedOperations = []; - for (var j = 0; j < message.listedOperations.length; ++j) - object.listedOperations[j] = $root.google.longrunning.Operation.toObject(message.listedOperations[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - if (message.operation != null && message.hasOwnProperty("operation")) - object.operation = $root.google.longrunning.Operation.toObject(message.operation, options); - return object; - }; - - /** - * Converts this OperationResponse to JSON. - * @function toJSON - * @memberof google.spanner.executor.v1.OperationResponse - * @instance - * @returns {Object.} JSON object - */ - OperationResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OperationResponse - * @function getTypeUrl - * @memberof google.spanner.executor.v1.OperationResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OperationResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.executor.v1.OperationResponse"; - }; - - return OperationResponse; - })(); - - v1.CloudInstanceResponse = (function() { - - /** - * Properties of a CloudInstanceResponse. - * @memberof google.spanner.executor.v1 - * @interface ICloudInstanceResponse - * @property {Array.|null} [listedInstances] CloudInstanceResponse listedInstances - * @property {string|null} [nextPageToken] CloudInstanceResponse nextPageToken - * @property {google.spanner.admin.instance.v1.IInstance|null} [instance] CloudInstanceResponse instance - */ - - /** - * Constructs a new CloudInstanceResponse. - * @memberof google.spanner.executor.v1 - * @classdesc Represents a CloudInstanceResponse. - * @implements ICloudInstanceResponse - * @constructor - * @param {google.spanner.executor.v1.ICloudInstanceResponse=} [properties] Properties to set - */ - function CloudInstanceResponse(properties) { - this.listedInstances = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CloudInstanceResponse listedInstances. - * @member {Array.} listedInstances - * @memberof google.spanner.executor.v1.CloudInstanceResponse - * @instance - */ - CloudInstanceResponse.prototype.listedInstances = $util.emptyArray; - - /** - * CloudInstanceResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.spanner.executor.v1.CloudInstanceResponse - * @instance - */ - CloudInstanceResponse.prototype.nextPageToken = ""; - - /** - * CloudInstanceResponse instance. - * @member {google.spanner.admin.instance.v1.IInstance|null|undefined} instance - * @memberof google.spanner.executor.v1.CloudInstanceResponse - * @instance - */ - CloudInstanceResponse.prototype.instance = null; - - /** - * Creates a new CloudInstanceResponse instance using the specified properties. - * @function create - * @memberof google.spanner.executor.v1.CloudInstanceResponse - * @static - * @param {google.spanner.executor.v1.ICloudInstanceResponse=} [properties] Properties to set - * @returns {google.spanner.executor.v1.CloudInstanceResponse} CloudInstanceResponse instance - */ - CloudInstanceResponse.create = function create(properties) { - return new CloudInstanceResponse(properties); - }; - - /** - * Encodes the specified CloudInstanceResponse message. Does not implicitly {@link google.spanner.executor.v1.CloudInstanceResponse.verify|verify} messages. - * @function encode - * @memberof google.spanner.executor.v1.CloudInstanceResponse - * @static - * @param {google.spanner.executor.v1.ICloudInstanceResponse} message CloudInstanceResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CloudInstanceResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.listedInstances != null && message.listedInstances.length) - for (var i = 0; i < message.listedInstances.length; ++i) - $root.google.spanner.admin.instance.v1.Instance.encode(message.listedInstances[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) - $root.google.spanner.admin.instance.v1.Instance.encode(message.instance, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CloudInstanceResponse message, length delimited. Does not implicitly {@link google.spanner.executor.v1.CloudInstanceResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.executor.v1.CloudInstanceResponse - * @static - * @param {google.spanner.executor.v1.ICloudInstanceResponse} message CloudInstanceResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CloudInstanceResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CloudInstanceResponse message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.executor.v1.CloudInstanceResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.executor.v1.CloudInstanceResponse} CloudInstanceResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CloudInstanceResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.CloudInstanceResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.listedInstances && message.listedInstances.length)) - message.listedInstances = []; - message.listedInstances.push($root.google.spanner.admin.instance.v1.Instance.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - case 3: { - message.instance = $root.google.spanner.admin.instance.v1.Instance.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CloudInstanceResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.executor.v1.CloudInstanceResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.executor.v1.CloudInstanceResponse} CloudInstanceResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CloudInstanceResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CloudInstanceResponse message. - * @function verify - * @memberof google.spanner.executor.v1.CloudInstanceResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CloudInstanceResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.listedInstances != null && message.hasOwnProperty("listedInstances")) { - if (!Array.isArray(message.listedInstances)) - return "listedInstances: array expected"; - for (var i = 0; i < message.listedInstances.length; ++i) { - var error = $root.google.spanner.admin.instance.v1.Instance.verify(message.listedInstances[i]); - if (error) - return "listedInstances." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - if (message.instance != null && message.hasOwnProperty("instance")) { - var error = $root.google.spanner.admin.instance.v1.Instance.verify(message.instance); - if (error) - return "instance." + error; - } - return null; - }; - - /** - * Creates a CloudInstanceResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.executor.v1.CloudInstanceResponse - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.executor.v1.CloudInstanceResponse} CloudInstanceResponse - */ - CloudInstanceResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.executor.v1.CloudInstanceResponse) - return object; - var message = new $root.google.spanner.executor.v1.CloudInstanceResponse(); - if (object.listedInstances) { - if (!Array.isArray(object.listedInstances)) - throw TypeError(".google.spanner.executor.v1.CloudInstanceResponse.listedInstances: array expected"); - message.listedInstances = []; - for (var i = 0; i < object.listedInstances.length; ++i) { - if (typeof object.listedInstances[i] !== "object") - throw TypeError(".google.spanner.executor.v1.CloudInstanceResponse.listedInstances: object expected"); - message.listedInstances[i] = $root.google.spanner.admin.instance.v1.Instance.fromObject(object.listedInstances[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.instance != null) { - if (typeof object.instance !== "object") - throw TypeError(".google.spanner.executor.v1.CloudInstanceResponse.instance: object expected"); - message.instance = $root.google.spanner.admin.instance.v1.Instance.fromObject(object.instance); - } - return message; - }; - - /** - * Creates a plain object from a CloudInstanceResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.executor.v1.CloudInstanceResponse - * @static - * @param {google.spanner.executor.v1.CloudInstanceResponse} message CloudInstanceResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CloudInstanceResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.listedInstances = []; - if (options.defaults) { - object.nextPageToken = ""; - object.instance = null; - } - if (message.listedInstances && message.listedInstances.length) { - object.listedInstances = []; - for (var j = 0; j < message.listedInstances.length; ++j) - object.listedInstances[j] = $root.google.spanner.admin.instance.v1.Instance.toObject(message.listedInstances[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - if (message.instance != null && message.hasOwnProperty("instance")) - object.instance = $root.google.spanner.admin.instance.v1.Instance.toObject(message.instance, options); - return object; - }; - - /** - * Converts this CloudInstanceResponse to JSON. - * @function toJSON - * @memberof google.spanner.executor.v1.CloudInstanceResponse - * @instance - * @returns {Object.} JSON object - */ - CloudInstanceResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CloudInstanceResponse - * @function getTypeUrl - * @memberof google.spanner.executor.v1.CloudInstanceResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CloudInstanceResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.executor.v1.CloudInstanceResponse"; - }; - - return CloudInstanceResponse; - })(); - - v1.CloudInstanceConfigResponse = (function() { - - /** - * Properties of a CloudInstanceConfigResponse. - * @memberof google.spanner.executor.v1 - * @interface ICloudInstanceConfigResponse - * @property {Array.|null} [listedInstanceConfigs] CloudInstanceConfigResponse listedInstanceConfigs - * @property {string|null} [nextPageToken] CloudInstanceConfigResponse nextPageToken - * @property {google.spanner.admin.instance.v1.IInstanceConfig|null} [instanceConfig] CloudInstanceConfigResponse instanceConfig - */ - - /** - * Constructs a new CloudInstanceConfigResponse. - * @memberof google.spanner.executor.v1 - * @classdesc Represents a CloudInstanceConfigResponse. - * @implements ICloudInstanceConfigResponse - * @constructor - * @param {google.spanner.executor.v1.ICloudInstanceConfigResponse=} [properties] Properties to set - */ - function CloudInstanceConfigResponse(properties) { - this.listedInstanceConfigs = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CloudInstanceConfigResponse listedInstanceConfigs. - * @member {Array.} listedInstanceConfigs - * @memberof google.spanner.executor.v1.CloudInstanceConfigResponse - * @instance - */ - CloudInstanceConfigResponse.prototype.listedInstanceConfigs = $util.emptyArray; - - /** - * CloudInstanceConfigResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.spanner.executor.v1.CloudInstanceConfigResponse - * @instance - */ - CloudInstanceConfigResponse.prototype.nextPageToken = ""; - - /** - * CloudInstanceConfigResponse instanceConfig. - * @member {google.spanner.admin.instance.v1.IInstanceConfig|null|undefined} instanceConfig - * @memberof google.spanner.executor.v1.CloudInstanceConfigResponse - * @instance - */ - CloudInstanceConfigResponse.prototype.instanceConfig = null; - - /** - * Creates a new CloudInstanceConfigResponse instance using the specified properties. - * @function create - * @memberof google.spanner.executor.v1.CloudInstanceConfigResponse - * @static - * @param {google.spanner.executor.v1.ICloudInstanceConfigResponse=} [properties] Properties to set - * @returns {google.spanner.executor.v1.CloudInstanceConfigResponse} CloudInstanceConfigResponse instance - */ - CloudInstanceConfigResponse.create = function create(properties) { - return new CloudInstanceConfigResponse(properties); - }; - - /** - * Encodes the specified CloudInstanceConfigResponse message. Does not implicitly {@link google.spanner.executor.v1.CloudInstanceConfigResponse.verify|verify} messages. - * @function encode - * @memberof google.spanner.executor.v1.CloudInstanceConfigResponse - * @static - * @param {google.spanner.executor.v1.ICloudInstanceConfigResponse} message CloudInstanceConfigResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CloudInstanceConfigResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.listedInstanceConfigs != null && message.listedInstanceConfigs.length) - for (var i = 0; i < message.listedInstanceConfigs.length; ++i) - $root.google.spanner.admin.instance.v1.InstanceConfig.encode(message.listedInstanceConfigs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - if (message.instanceConfig != null && Object.hasOwnProperty.call(message, "instanceConfig")) - $root.google.spanner.admin.instance.v1.InstanceConfig.encode(message.instanceConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CloudInstanceConfigResponse message, length delimited. Does not implicitly {@link google.spanner.executor.v1.CloudInstanceConfigResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.executor.v1.CloudInstanceConfigResponse - * @static - * @param {google.spanner.executor.v1.ICloudInstanceConfigResponse} message CloudInstanceConfigResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CloudInstanceConfigResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CloudInstanceConfigResponse message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.executor.v1.CloudInstanceConfigResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.executor.v1.CloudInstanceConfigResponse} CloudInstanceConfigResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CloudInstanceConfigResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.CloudInstanceConfigResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.listedInstanceConfigs && message.listedInstanceConfigs.length)) - message.listedInstanceConfigs = []; - message.listedInstanceConfigs.push($root.google.spanner.admin.instance.v1.InstanceConfig.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - case 3: { - message.instanceConfig = $root.google.spanner.admin.instance.v1.InstanceConfig.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CloudInstanceConfigResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.executor.v1.CloudInstanceConfigResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.executor.v1.CloudInstanceConfigResponse} CloudInstanceConfigResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CloudInstanceConfigResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CloudInstanceConfigResponse message. - * @function verify - * @memberof google.spanner.executor.v1.CloudInstanceConfigResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CloudInstanceConfigResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.listedInstanceConfigs != null && message.hasOwnProperty("listedInstanceConfigs")) { - if (!Array.isArray(message.listedInstanceConfigs)) - return "listedInstanceConfigs: array expected"; - for (var i = 0; i < message.listedInstanceConfigs.length; ++i) { - var error = $root.google.spanner.admin.instance.v1.InstanceConfig.verify(message.listedInstanceConfigs[i]); - if (error) - return "listedInstanceConfigs." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - if (message.instanceConfig != null && message.hasOwnProperty("instanceConfig")) { - var error = $root.google.spanner.admin.instance.v1.InstanceConfig.verify(message.instanceConfig); - if (error) - return "instanceConfig." + error; - } - return null; - }; - - /** - * Creates a CloudInstanceConfigResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.executor.v1.CloudInstanceConfigResponse - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.executor.v1.CloudInstanceConfigResponse} CloudInstanceConfigResponse - */ - CloudInstanceConfigResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.executor.v1.CloudInstanceConfigResponse) - return object; - var message = new $root.google.spanner.executor.v1.CloudInstanceConfigResponse(); - if (object.listedInstanceConfigs) { - if (!Array.isArray(object.listedInstanceConfigs)) - throw TypeError(".google.spanner.executor.v1.CloudInstanceConfigResponse.listedInstanceConfigs: array expected"); - message.listedInstanceConfigs = []; - for (var i = 0; i < object.listedInstanceConfigs.length; ++i) { - if (typeof object.listedInstanceConfigs[i] !== "object") - throw TypeError(".google.spanner.executor.v1.CloudInstanceConfigResponse.listedInstanceConfigs: object expected"); - message.listedInstanceConfigs[i] = $root.google.spanner.admin.instance.v1.InstanceConfig.fromObject(object.listedInstanceConfigs[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.instanceConfig != null) { - if (typeof object.instanceConfig !== "object") - throw TypeError(".google.spanner.executor.v1.CloudInstanceConfigResponse.instanceConfig: object expected"); - message.instanceConfig = $root.google.spanner.admin.instance.v1.InstanceConfig.fromObject(object.instanceConfig); - } - return message; - }; - - /** - * Creates a plain object from a CloudInstanceConfigResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.executor.v1.CloudInstanceConfigResponse - * @static - * @param {google.spanner.executor.v1.CloudInstanceConfigResponse} message CloudInstanceConfigResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CloudInstanceConfigResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.listedInstanceConfigs = []; - if (options.defaults) { - object.nextPageToken = ""; - object.instanceConfig = null; - } - if (message.listedInstanceConfigs && message.listedInstanceConfigs.length) { - object.listedInstanceConfigs = []; - for (var j = 0; j < message.listedInstanceConfigs.length; ++j) - object.listedInstanceConfigs[j] = $root.google.spanner.admin.instance.v1.InstanceConfig.toObject(message.listedInstanceConfigs[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - if (message.instanceConfig != null && message.hasOwnProperty("instanceConfig")) - object.instanceConfig = $root.google.spanner.admin.instance.v1.InstanceConfig.toObject(message.instanceConfig, options); - return object; - }; - - /** - * Converts this CloudInstanceConfigResponse to JSON. - * @function toJSON - * @memberof google.spanner.executor.v1.CloudInstanceConfigResponse - * @instance - * @returns {Object.} JSON object - */ - CloudInstanceConfigResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CloudInstanceConfigResponse - * @function getTypeUrl - * @memberof google.spanner.executor.v1.CloudInstanceConfigResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CloudInstanceConfigResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.executor.v1.CloudInstanceConfigResponse"; - }; - - return CloudInstanceConfigResponse; - })(); - - v1.CloudDatabaseResponse = (function() { - - /** - * Properties of a CloudDatabaseResponse. - * @memberof google.spanner.executor.v1 - * @interface ICloudDatabaseResponse - * @property {Array.|null} [listedDatabases] CloudDatabaseResponse listedDatabases - * @property {Array.|null} [listedDatabaseOperations] CloudDatabaseResponse listedDatabaseOperations - * @property {string|null} [nextPageToken] CloudDatabaseResponse nextPageToken - * @property {google.spanner.admin.database.v1.IDatabase|null} [database] CloudDatabaseResponse database - */ - - /** - * Constructs a new CloudDatabaseResponse. - * @memberof google.spanner.executor.v1 - * @classdesc Represents a CloudDatabaseResponse. - * @implements ICloudDatabaseResponse - * @constructor - * @param {google.spanner.executor.v1.ICloudDatabaseResponse=} [properties] Properties to set - */ - function CloudDatabaseResponse(properties) { - this.listedDatabases = []; - this.listedDatabaseOperations = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CloudDatabaseResponse listedDatabases. - * @member {Array.} listedDatabases - * @memberof google.spanner.executor.v1.CloudDatabaseResponse - * @instance - */ - CloudDatabaseResponse.prototype.listedDatabases = $util.emptyArray; - - /** - * CloudDatabaseResponse listedDatabaseOperations. - * @member {Array.} listedDatabaseOperations - * @memberof google.spanner.executor.v1.CloudDatabaseResponse - * @instance - */ - CloudDatabaseResponse.prototype.listedDatabaseOperations = $util.emptyArray; - - /** - * CloudDatabaseResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.spanner.executor.v1.CloudDatabaseResponse - * @instance - */ - CloudDatabaseResponse.prototype.nextPageToken = ""; - - /** - * CloudDatabaseResponse database. - * @member {google.spanner.admin.database.v1.IDatabase|null|undefined} database - * @memberof google.spanner.executor.v1.CloudDatabaseResponse - * @instance - */ - CloudDatabaseResponse.prototype.database = null; - - /** - * Creates a new CloudDatabaseResponse instance using the specified properties. - * @function create - * @memberof google.spanner.executor.v1.CloudDatabaseResponse - * @static - * @param {google.spanner.executor.v1.ICloudDatabaseResponse=} [properties] Properties to set - * @returns {google.spanner.executor.v1.CloudDatabaseResponse} CloudDatabaseResponse instance - */ - CloudDatabaseResponse.create = function create(properties) { - return new CloudDatabaseResponse(properties); - }; - - /** - * Encodes the specified CloudDatabaseResponse message. Does not implicitly {@link google.spanner.executor.v1.CloudDatabaseResponse.verify|verify} messages. - * @function encode - * @memberof google.spanner.executor.v1.CloudDatabaseResponse - * @static - * @param {google.spanner.executor.v1.ICloudDatabaseResponse} message CloudDatabaseResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CloudDatabaseResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.listedDatabases != null && message.listedDatabases.length) - for (var i = 0; i < message.listedDatabases.length; ++i) - $root.google.spanner.admin.database.v1.Database.encode(message.listedDatabases[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.listedDatabaseOperations != null && message.listedDatabaseOperations.length) - for (var i = 0; i < message.listedDatabaseOperations.length; ++i) - $root.google.longrunning.Operation.encode(message.listedDatabaseOperations[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); - if (message.database != null && Object.hasOwnProperty.call(message, "database")) - $root.google.spanner.admin.database.v1.Database.encode(message.database, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CloudDatabaseResponse message, length delimited. Does not implicitly {@link google.spanner.executor.v1.CloudDatabaseResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.executor.v1.CloudDatabaseResponse - * @static - * @param {google.spanner.executor.v1.ICloudDatabaseResponse} message CloudDatabaseResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CloudDatabaseResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CloudDatabaseResponse message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.executor.v1.CloudDatabaseResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.executor.v1.CloudDatabaseResponse} CloudDatabaseResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CloudDatabaseResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.CloudDatabaseResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.listedDatabases && message.listedDatabases.length)) - message.listedDatabases = []; - message.listedDatabases.push($root.google.spanner.admin.database.v1.Database.decode(reader, reader.uint32())); - break; - } - case 2: { - if (!(message.listedDatabaseOperations && message.listedDatabaseOperations.length)) - message.listedDatabaseOperations = []; - message.listedDatabaseOperations.push($root.google.longrunning.Operation.decode(reader, reader.uint32())); - break; - } - case 3: { - message.nextPageToken = reader.string(); - break; - } - case 4: { - message.database = $root.google.spanner.admin.database.v1.Database.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CloudDatabaseResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.executor.v1.CloudDatabaseResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.executor.v1.CloudDatabaseResponse} CloudDatabaseResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CloudDatabaseResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CloudDatabaseResponse message. - * @function verify - * @memberof google.spanner.executor.v1.CloudDatabaseResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CloudDatabaseResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.listedDatabases != null && message.hasOwnProperty("listedDatabases")) { - if (!Array.isArray(message.listedDatabases)) - return "listedDatabases: array expected"; - for (var i = 0; i < message.listedDatabases.length; ++i) { - var error = $root.google.spanner.admin.database.v1.Database.verify(message.listedDatabases[i]); - if (error) - return "listedDatabases." + error; - } - } - if (message.listedDatabaseOperations != null && message.hasOwnProperty("listedDatabaseOperations")) { - if (!Array.isArray(message.listedDatabaseOperations)) - return "listedDatabaseOperations: array expected"; - for (var i = 0; i < message.listedDatabaseOperations.length; ++i) { - var error = $root.google.longrunning.Operation.verify(message.listedDatabaseOperations[i]); - if (error) - return "listedDatabaseOperations." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - if (message.database != null && message.hasOwnProperty("database")) { - var error = $root.google.spanner.admin.database.v1.Database.verify(message.database); - if (error) - return "database." + error; - } - return null; - }; - - /** - * Creates a CloudDatabaseResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.executor.v1.CloudDatabaseResponse - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.executor.v1.CloudDatabaseResponse} CloudDatabaseResponse - */ - CloudDatabaseResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.executor.v1.CloudDatabaseResponse) - return object; - var message = new $root.google.spanner.executor.v1.CloudDatabaseResponse(); - if (object.listedDatabases) { - if (!Array.isArray(object.listedDatabases)) - throw TypeError(".google.spanner.executor.v1.CloudDatabaseResponse.listedDatabases: array expected"); - message.listedDatabases = []; - for (var i = 0; i < object.listedDatabases.length; ++i) { - if (typeof object.listedDatabases[i] !== "object") - throw TypeError(".google.spanner.executor.v1.CloudDatabaseResponse.listedDatabases: object expected"); - message.listedDatabases[i] = $root.google.spanner.admin.database.v1.Database.fromObject(object.listedDatabases[i]); - } - } - if (object.listedDatabaseOperations) { - if (!Array.isArray(object.listedDatabaseOperations)) - throw TypeError(".google.spanner.executor.v1.CloudDatabaseResponse.listedDatabaseOperations: array expected"); - message.listedDatabaseOperations = []; - for (var i = 0; i < object.listedDatabaseOperations.length; ++i) { - if (typeof object.listedDatabaseOperations[i] !== "object") - throw TypeError(".google.spanner.executor.v1.CloudDatabaseResponse.listedDatabaseOperations: object expected"); - message.listedDatabaseOperations[i] = $root.google.longrunning.Operation.fromObject(object.listedDatabaseOperations[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.database != null) { - if (typeof object.database !== "object") - throw TypeError(".google.spanner.executor.v1.CloudDatabaseResponse.database: object expected"); - message.database = $root.google.spanner.admin.database.v1.Database.fromObject(object.database); - } - return message; - }; - - /** - * Creates a plain object from a CloudDatabaseResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.executor.v1.CloudDatabaseResponse - * @static - * @param {google.spanner.executor.v1.CloudDatabaseResponse} message CloudDatabaseResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CloudDatabaseResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.listedDatabases = []; - object.listedDatabaseOperations = []; - } - if (options.defaults) { - object.nextPageToken = ""; - object.database = null; - } - if (message.listedDatabases && message.listedDatabases.length) { - object.listedDatabases = []; - for (var j = 0; j < message.listedDatabases.length; ++j) - object.listedDatabases[j] = $root.google.spanner.admin.database.v1.Database.toObject(message.listedDatabases[j], options); - } - if (message.listedDatabaseOperations && message.listedDatabaseOperations.length) { - object.listedDatabaseOperations = []; - for (var j = 0; j < message.listedDatabaseOperations.length; ++j) - object.listedDatabaseOperations[j] = $root.google.longrunning.Operation.toObject(message.listedDatabaseOperations[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - if (message.database != null && message.hasOwnProperty("database")) - object.database = $root.google.spanner.admin.database.v1.Database.toObject(message.database, options); - return object; - }; - - /** - * Converts this CloudDatabaseResponse to JSON. - * @function toJSON - * @memberof google.spanner.executor.v1.CloudDatabaseResponse - * @instance - * @returns {Object.} JSON object - */ - CloudDatabaseResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CloudDatabaseResponse - * @function getTypeUrl - * @memberof google.spanner.executor.v1.CloudDatabaseResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CloudDatabaseResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.executor.v1.CloudDatabaseResponse"; - }; - - return CloudDatabaseResponse; - })(); - - v1.ReadResult = (function() { - - /** - * Properties of a ReadResult. - * @memberof google.spanner.executor.v1 - * @interface IReadResult - * @property {string|null} [table] ReadResult table - * @property {string|null} [index] ReadResult index - * @property {number|null} [requestIndex] ReadResult requestIndex - * @property {Array.|null} [row] ReadResult row - * @property {google.spanner.v1.IStructType|null} [rowType] ReadResult rowType - */ - - /** - * Constructs a new ReadResult. - * @memberof google.spanner.executor.v1 - * @classdesc Represents a ReadResult. - * @implements IReadResult - * @constructor - * @param {google.spanner.executor.v1.IReadResult=} [properties] Properties to set - */ - function ReadResult(properties) { - this.row = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ReadResult table. - * @member {string} table - * @memberof google.spanner.executor.v1.ReadResult - * @instance - */ - ReadResult.prototype.table = ""; - - /** - * ReadResult index. - * @member {string|null|undefined} index - * @memberof google.spanner.executor.v1.ReadResult - * @instance - */ - ReadResult.prototype.index = null; - - /** - * ReadResult requestIndex. - * @member {number|null|undefined} requestIndex - * @memberof google.spanner.executor.v1.ReadResult - * @instance - */ - ReadResult.prototype.requestIndex = null; - - /** - * ReadResult row. - * @member {Array.} row - * @memberof google.spanner.executor.v1.ReadResult - * @instance - */ - ReadResult.prototype.row = $util.emptyArray; - - /** - * ReadResult rowType. - * @member {google.spanner.v1.IStructType|null|undefined} rowType - * @memberof google.spanner.executor.v1.ReadResult - * @instance - */ - ReadResult.prototype.rowType = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ReadResult.prototype, "_index", { - get: $util.oneOfGetter($oneOfFields = ["index"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ReadResult.prototype, "_requestIndex", { - get: $util.oneOfGetter($oneOfFields = ["requestIndex"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ReadResult.prototype, "_rowType", { - get: $util.oneOfGetter($oneOfFields = ["rowType"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new ReadResult instance using the specified properties. - * @function create - * @memberof google.spanner.executor.v1.ReadResult - * @static - * @param {google.spanner.executor.v1.IReadResult=} [properties] Properties to set - * @returns {google.spanner.executor.v1.ReadResult} ReadResult instance - */ - ReadResult.create = function create(properties) { - return new ReadResult(properties); - }; - - /** - * Encodes the specified ReadResult message. Does not implicitly {@link google.spanner.executor.v1.ReadResult.verify|verify} messages. - * @function encode - * @memberof google.spanner.executor.v1.ReadResult - * @static - * @param {google.spanner.executor.v1.IReadResult} message ReadResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReadResult.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.table != null && Object.hasOwnProperty.call(message, "table")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.table); - if (message.index != null && Object.hasOwnProperty.call(message, "index")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.index); - if (message.requestIndex != null && Object.hasOwnProperty.call(message, "requestIndex")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.requestIndex); - if (message.row != null && message.row.length) - for (var i = 0; i < message.row.length; ++i) - $root.google.spanner.executor.v1.ValueList.encode(message.row[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.rowType != null && Object.hasOwnProperty.call(message, "rowType")) - $root.google.spanner.v1.StructType.encode(message.rowType, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ReadResult message, length delimited. Does not implicitly {@link google.spanner.executor.v1.ReadResult.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.executor.v1.ReadResult - * @static - * @param {google.spanner.executor.v1.IReadResult} message ReadResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReadResult.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ReadResult message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.executor.v1.ReadResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.executor.v1.ReadResult} ReadResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReadResult.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.ReadResult(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.table = reader.string(); - break; - } - case 2: { - message.index = reader.string(); - break; - } - case 3: { - message.requestIndex = reader.int32(); - break; - } - case 4: { - if (!(message.row && message.row.length)) - message.row = []; - message.row.push($root.google.spanner.executor.v1.ValueList.decode(reader, reader.uint32())); - break; - } - case 5: { - message.rowType = $root.google.spanner.v1.StructType.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ReadResult message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.executor.v1.ReadResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.executor.v1.ReadResult} ReadResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReadResult.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ReadResult message. - * @function verify - * @memberof google.spanner.executor.v1.ReadResult - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ReadResult.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.table != null && message.hasOwnProperty("table")) - if (!$util.isString(message.table)) - return "table: string expected"; - if (message.index != null && message.hasOwnProperty("index")) { - properties._index = 1; - if (!$util.isString(message.index)) - return "index: string expected"; - } - if (message.requestIndex != null && message.hasOwnProperty("requestIndex")) { - properties._requestIndex = 1; - if (!$util.isInteger(message.requestIndex)) - return "requestIndex: integer expected"; - } - if (message.row != null && message.hasOwnProperty("row")) { - if (!Array.isArray(message.row)) - return "row: array expected"; - for (var i = 0; i < message.row.length; ++i) { - var error = $root.google.spanner.executor.v1.ValueList.verify(message.row[i]); - if (error) - return "row." + error; - } - } - if (message.rowType != null && message.hasOwnProperty("rowType")) { - properties._rowType = 1; - { - var error = $root.google.spanner.v1.StructType.verify(message.rowType); - if (error) - return "rowType." + error; - } - } - return null; - }; - - /** - * Creates a ReadResult message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.executor.v1.ReadResult - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.executor.v1.ReadResult} ReadResult - */ - ReadResult.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.executor.v1.ReadResult) - return object; - var message = new $root.google.spanner.executor.v1.ReadResult(); - if (object.table != null) - message.table = String(object.table); - if (object.index != null) - message.index = String(object.index); - if (object.requestIndex != null) - message.requestIndex = object.requestIndex | 0; - if (object.row) { - if (!Array.isArray(object.row)) - throw TypeError(".google.spanner.executor.v1.ReadResult.row: array expected"); - message.row = []; - for (var i = 0; i < object.row.length; ++i) { - if (typeof object.row[i] !== "object") - throw TypeError(".google.spanner.executor.v1.ReadResult.row: object expected"); - message.row[i] = $root.google.spanner.executor.v1.ValueList.fromObject(object.row[i]); - } - } - if (object.rowType != null) { - if (typeof object.rowType !== "object") - throw TypeError(".google.spanner.executor.v1.ReadResult.rowType: object expected"); - message.rowType = $root.google.spanner.v1.StructType.fromObject(object.rowType); - } - return message; - }; - - /** - * Creates a plain object from a ReadResult message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.executor.v1.ReadResult - * @static - * @param {google.spanner.executor.v1.ReadResult} message ReadResult - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ReadResult.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.row = []; - if (options.defaults) - object.table = ""; - if (message.table != null && message.hasOwnProperty("table")) - object.table = message.table; - if (message.index != null && message.hasOwnProperty("index")) { - object.index = message.index; - if (options.oneofs) - object._index = "index"; - } - if (message.requestIndex != null && message.hasOwnProperty("requestIndex")) { - object.requestIndex = message.requestIndex; - if (options.oneofs) - object._requestIndex = "requestIndex"; - } - if (message.row && message.row.length) { - object.row = []; - for (var j = 0; j < message.row.length; ++j) - object.row[j] = $root.google.spanner.executor.v1.ValueList.toObject(message.row[j], options); - } - if (message.rowType != null && message.hasOwnProperty("rowType")) { - object.rowType = $root.google.spanner.v1.StructType.toObject(message.rowType, options); - if (options.oneofs) - object._rowType = "rowType"; - } - return object; - }; - - /** - * Converts this ReadResult to JSON. - * @function toJSON - * @memberof google.spanner.executor.v1.ReadResult - * @instance - * @returns {Object.} JSON object - */ - ReadResult.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ReadResult - * @function getTypeUrl - * @memberof google.spanner.executor.v1.ReadResult - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ReadResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.executor.v1.ReadResult"; - }; - - return ReadResult; - })(); - - v1.QueryResult = (function() { - - /** - * Properties of a QueryResult. - * @memberof google.spanner.executor.v1 - * @interface IQueryResult - * @property {Array.|null} [row] QueryResult row - * @property {google.spanner.v1.IStructType|null} [rowType] QueryResult rowType - */ - - /** - * Constructs a new QueryResult. - * @memberof google.spanner.executor.v1 - * @classdesc Represents a QueryResult. - * @implements IQueryResult - * @constructor - * @param {google.spanner.executor.v1.IQueryResult=} [properties] Properties to set - */ - function QueryResult(properties) { - this.row = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryResult row. - * @member {Array.} row - * @memberof google.spanner.executor.v1.QueryResult - * @instance - */ - QueryResult.prototype.row = $util.emptyArray; - - /** - * QueryResult rowType. - * @member {google.spanner.v1.IStructType|null|undefined} rowType - * @memberof google.spanner.executor.v1.QueryResult - * @instance - */ - QueryResult.prototype.rowType = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(QueryResult.prototype, "_rowType", { - get: $util.oneOfGetter($oneOfFields = ["rowType"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new QueryResult instance using the specified properties. - * @function create - * @memberof google.spanner.executor.v1.QueryResult - * @static - * @param {google.spanner.executor.v1.IQueryResult=} [properties] Properties to set - * @returns {google.spanner.executor.v1.QueryResult} QueryResult instance - */ - QueryResult.create = function create(properties) { - return new QueryResult(properties); - }; - - /** - * Encodes the specified QueryResult message. Does not implicitly {@link google.spanner.executor.v1.QueryResult.verify|verify} messages. - * @function encode - * @memberof google.spanner.executor.v1.QueryResult - * @static - * @param {google.spanner.executor.v1.IQueryResult} message QueryResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryResult.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.row != null && message.row.length) - for (var i = 0; i < message.row.length; ++i) - $root.google.spanner.executor.v1.ValueList.encode(message.row[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.rowType != null && Object.hasOwnProperty.call(message, "rowType")) - $root.google.spanner.v1.StructType.encode(message.rowType, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryResult message, length delimited. Does not implicitly {@link google.spanner.executor.v1.QueryResult.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.executor.v1.QueryResult - * @static - * @param {google.spanner.executor.v1.IQueryResult} message QueryResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryResult.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryResult message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.executor.v1.QueryResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.executor.v1.QueryResult} QueryResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryResult.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.QueryResult(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.row && message.row.length)) - message.row = []; - message.row.push($root.google.spanner.executor.v1.ValueList.decode(reader, reader.uint32())); - break; - } - case 2: { - message.rowType = $root.google.spanner.v1.StructType.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryResult message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.executor.v1.QueryResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.executor.v1.QueryResult} QueryResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryResult.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryResult message. - * @function verify - * @memberof google.spanner.executor.v1.QueryResult - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryResult.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.row != null && message.hasOwnProperty("row")) { - if (!Array.isArray(message.row)) - return "row: array expected"; - for (var i = 0; i < message.row.length; ++i) { - var error = $root.google.spanner.executor.v1.ValueList.verify(message.row[i]); - if (error) - return "row." + error; - } - } - if (message.rowType != null && message.hasOwnProperty("rowType")) { - properties._rowType = 1; - { - var error = $root.google.spanner.v1.StructType.verify(message.rowType); - if (error) - return "rowType." + error; - } - } - return null; - }; - - /** - * Creates a QueryResult message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.executor.v1.QueryResult - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.executor.v1.QueryResult} QueryResult - */ - QueryResult.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.executor.v1.QueryResult) - return object; - var message = new $root.google.spanner.executor.v1.QueryResult(); - if (object.row) { - if (!Array.isArray(object.row)) - throw TypeError(".google.spanner.executor.v1.QueryResult.row: array expected"); - message.row = []; - for (var i = 0; i < object.row.length; ++i) { - if (typeof object.row[i] !== "object") - throw TypeError(".google.spanner.executor.v1.QueryResult.row: object expected"); - message.row[i] = $root.google.spanner.executor.v1.ValueList.fromObject(object.row[i]); - } - } - if (object.rowType != null) { - if (typeof object.rowType !== "object") - throw TypeError(".google.spanner.executor.v1.QueryResult.rowType: object expected"); - message.rowType = $root.google.spanner.v1.StructType.fromObject(object.rowType); - } - return message; - }; - - /** - * Creates a plain object from a QueryResult message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.executor.v1.QueryResult - * @static - * @param {google.spanner.executor.v1.QueryResult} message QueryResult - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryResult.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.row = []; - if (message.row && message.row.length) { - object.row = []; - for (var j = 0; j < message.row.length; ++j) - object.row[j] = $root.google.spanner.executor.v1.ValueList.toObject(message.row[j], options); - } - if (message.rowType != null && message.hasOwnProperty("rowType")) { - object.rowType = $root.google.spanner.v1.StructType.toObject(message.rowType, options); - if (options.oneofs) - object._rowType = "rowType"; - } - return object; - }; - - /** - * Converts this QueryResult to JSON. - * @function toJSON - * @memberof google.spanner.executor.v1.QueryResult - * @instance - * @returns {Object.} JSON object - */ - QueryResult.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for QueryResult - * @function getTypeUrl - * @memberof google.spanner.executor.v1.QueryResult - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - QueryResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.executor.v1.QueryResult"; - }; - - return QueryResult; - })(); - - v1.ChangeStreamRecord = (function() { - - /** - * Properties of a ChangeStreamRecord. - * @memberof google.spanner.executor.v1 - * @interface IChangeStreamRecord - * @property {google.spanner.executor.v1.IDataChangeRecord|null} [dataChange] ChangeStreamRecord dataChange - * @property {google.spanner.executor.v1.IChildPartitionsRecord|null} [childPartition] ChangeStreamRecord childPartition - * @property {google.spanner.executor.v1.IHeartbeatRecord|null} [heartbeat] ChangeStreamRecord heartbeat - */ - - /** - * Constructs a new ChangeStreamRecord. - * @memberof google.spanner.executor.v1 - * @classdesc Represents a ChangeStreamRecord. - * @implements IChangeStreamRecord - * @constructor - * @param {google.spanner.executor.v1.IChangeStreamRecord=} [properties] Properties to set - */ - function ChangeStreamRecord(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ChangeStreamRecord dataChange. - * @member {google.spanner.executor.v1.IDataChangeRecord|null|undefined} dataChange - * @memberof google.spanner.executor.v1.ChangeStreamRecord - * @instance - */ - ChangeStreamRecord.prototype.dataChange = null; - - /** - * ChangeStreamRecord childPartition. - * @member {google.spanner.executor.v1.IChildPartitionsRecord|null|undefined} childPartition - * @memberof google.spanner.executor.v1.ChangeStreamRecord - * @instance - */ - ChangeStreamRecord.prototype.childPartition = null; - - /** - * ChangeStreamRecord heartbeat. - * @member {google.spanner.executor.v1.IHeartbeatRecord|null|undefined} heartbeat - * @memberof google.spanner.executor.v1.ChangeStreamRecord - * @instance - */ - ChangeStreamRecord.prototype.heartbeat = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * ChangeStreamRecord record. - * @member {"dataChange"|"childPartition"|"heartbeat"|undefined} record - * @memberof google.spanner.executor.v1.ChangeStreamRecord - * @instance - */ - Object.defineProperty(ChangeStreamRecord.prototype, "record", { - get: $util.oneOfGetter($oneOfFields = ["dataChange", "childPartition", "heartbeat"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new ChangeStreamRecord instance using the specified properties. - * @function create - * @memberof google.spanner.executor.v1.ChangeStreamRecord - * @static - * @param {google.spanner.executor.v1.IChangeStreamRecord=} [properties] Properties to set - * @returns {google.spanner.executor.v1.ChangeStreamRecord} ChangeStreamRecord instance - */ - ChangeStreamRecord.create = function create(properties) { - return new ChangeStreamRecord(properties); - }; - - /** - * Encodes the specified ChangeStreamRecord message. Does not implicitly {@link google.spanner.executor.v1.ChangeStreamRecord.verify|verify} messages. - * @function encode - * @memberof google.spanner.executor.v1.ChangeStreamRecord - * @static - * @param {google.spanner.executor.v1.IChangeStreamRecord} message ChangeStreamRecord message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ChangeStreamRecord.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.dataChange != null && Object.hasOwnProperty.call(message, "dataChange")) - $root.google.spanner.executor.v1.DataChangeRecord.encode(message.dataChange, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.childPartition != null && Object.hasOwnProperty.call(message, "childPartition")) - $root.google.spanner.executor.v1.ChildPartitionsRecord.encode(message.childPartition, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.heartbeat != null && Object.hasOwnProperty.call(message, "heartbeat")) - $root.google.spanner.executor.v1.HeartbeatRecord.encode(message.heartbeat, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ChangeStreamRecord message, length delimited. Does not implicitly {@link google.spanner.executor.v1.ChangeStreamRecord.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.executor.v1.ChangeStreamRecord - * @static - * @param {google.spanner.executor.v1.IChangeStreamRecord} message ChangeStreamRecord message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ChangeStreamRecord.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ChangeStreamRecord message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.executor.v1.ChangeStreamRecord - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.executor.v1.ChangeStreamRecord} ChangeStreamRecord - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ChangeStreamRecord.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.ChangeStreamRecord(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.dataChange = $root.google.spanner.executor.v1.DataChangeRecord.decode(reader, reader.uint32()); - break; - } - case 2: { - message.childPartition = $root.google.spanner.executor.v1.ChildPartitionsRecord.decode(reader, reader.uint32()); - break; - } - case 3: { - message.heartbeat = $root.google.spanner.executor.v1.HeartbeatRecord.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ChangeStreamRecord message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.executor.v1.ChangeStreamRecord - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.executor.v1.ChangeStreamRecord} ChangeStreamRecord - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ChangeStreamRecord.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ChangeStreamRecord message. - * @function verify - * @memberof google.spanner.executor.v1.ChangeStreamRecord - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ChangeStreamRecord.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.dataChange != null && message.hasOwnProperty("dataChange")) { - properties.record = 1; - { - var error = $root.google.spanner.executor.v1.DataChangeRecord.verify(message.dataChange); - if (error) - return "dataChange." + error; - } - } - if (message.childPartition != null && message.hasOwnProperty("childPartition")) { - if (properties.record === 1) - return "record: multiple values"; - properties.record = 1; - { - var error = $root.google.spanner.executor.v1.ChildPartitionsRecord.verify(message.childPartition); - if (error) - return "childPartition." + error; - } - } - if (message.heartbeat != null && message.hasOwnProperty("heartbeat")) { - if (properties.record === 1) - return "record: multiple values"; - properties.record = 1; - { - var error = $root.google.spanner.executor.v1.HeartbeatRecord.verify(message.heartbeat); - if (error) - return "heartbeat." + error; - } - } - return null; - }; - - /** - * Creates a ChangeStreamRecord message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.executor.v1.ChangeStreamRecord - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.executor.v1.ChangeStreamRecord} ChangeStreamRecord - */ - ChangeStreamRecord.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.executor.v1.ChangeStreamRecord) - return object; - var message = new $root.google.spanner.executor.v1.ChangeStreamRecord(); - if (object.dataChange != null) { - if (typeof object.dataChange !== "object") - throw TypeError(".google.spanner.executor.v1.ChangeStreamRecord.dataChange: object expected"); - message.dataChange = $root.google.spanner.executor.v1.DataChangeRecord.fromObject(object.dataChange); - } - if (object.childPartition != null) { - if (typeof object.childPartition !== "object") - throw TypeError(".google.spanner.executor.v1.ChangeStreamRecord.childPartition: object expected"); - message.childPartition = $root.google.spanner.executor.v1.ChildPartitionsRecord.fromObject(object.childPartition); - } - if (object.heartbeat != null) { - if (typeof object.heartbeat !== "object") - throw TypeError(".google.spanner.executor.v1.ChangeStreamRecord.heartbeat: object expected"); - message.heartbeat = $root.google.spanner.executor.v1.HeartbeatRecord.fromObject(object.heartbeat); - } - return message; - }; - - /** - * Creates a plain object from a ChangeStreamRecord message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.executor.v1.ChangeStreamRecord - * @static - * @param {google.spanner.executor.v1.ChangeStreamRecord} message ChangeStreamRecord - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ChangeStreamRecord.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.dataChange != null && message.hasOwnProperty("dataChange")) { - object.dataChange = $root.google.spanner.executor.v1.DataChangeRecord.toObject(message.dataChange, options); - if (options.oneofs) - object.record = "dataChange"; - } - if (message.childPartition != null && message.hasOwnProperty("childPartition")) { - object.childPartition = $root.google.spanner.executor.v1.ChildPartitionsRecord.toObject(message.childPartition, options); - if (options.oneofs) - object.record = "childPartition"; - } - if (message.heartbeat != null && message.hasOwnProperty("heartbeat")) { - object.heartbeat = $root.google.spanner.executor.v1.HeartbeatRecord.toObject(message.heartbeat, options); - if (options.oneofs) - object.record = "heartbeat"; - } - return object; - }; - - /** - * Converts this ChangeStreamRecord to JSON. - * @function toJSON - * @memberof google.spanner.executor.v1.ChangeStreamRecord - * @instance - * @returns {Object.} JSON object - */ - ChangeStreamRecord.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ChangeStreamRecord - * @function getTypeUrl - * @memberof google.spanner.executor.v1.ChangeStreamRecord - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ChangeStreamRecord.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.executor.v1.ChangeStreamRecord"; - }; - - return ChangeStreamRecord; - })(); - - v1.DataChangeRecord = (function() { - - /** - * Properties of a DataChangeRecord. - * @memberof google.spanner.executor.v1 - * @interface IDataChangeRecord - * @property {google.protobuf.ITimestamp|null} [commitTime] DataChangeRecord commitTime - * @property {string|null} [recordSequence] DataChangeRecord recordSequence - * @property {string|null} [transactionId] DataChangeRecord transactionId - * @property {boolean|null} [isLastRecord] DataChangeRecord isLastRecord - * @property {string|null} [table] DataChangeRecord table - * @property {Array.|null} [columnTypes] DataChangeRecord columnTypes - * @property {Array.|null} [mods] DataChangeRecord mods - * @property {string|null} [modType] DataChangeRecord modType - * @property {string|null} [valueCaptureType] DataChangeRecord valueCaptureType - * @property {number|Long|null} [recordCount] DataChangeRecord recordCount - * @property {number|Long|null} [partitionCount] DataChangeRecord partitionCount - * @property {string|null} [transactionTag] DataChangeRecord transactionTag - * @property {boolean|null} [isSystemTransaction] DataChangeRecord isSystemTransaction - */ - - /** - * Constructs a new DataChangeRecord. - * @memberof google.spanner.executor.v1 - * @classdesc Represents a DataChangeRecord. - * @implements IDataChangeRecord - * @constructor - * @param {google.spanner.executor.v1.IDataChangeRecord=} [properties] Properties to set - */ - function DataChangeRecord(properties) { - this.columnTypes = []; - this.mods = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DataChangeRecord commitTime. - * @member {google.protobuf.ITimestamp|null|undefined} commitTime - * @memberof google.spanner.executor.v1.DataChangeRecord - * @instance - */ - DataChangeRecord.prototype.commitTime = null; - - /** - * DataChangeRecord recordSequence. - * @member {string} recordSequence - * @memberof google.spanner.executor.v1.DataChangeRecord - * @instance - */ - DataChangeRecord.prototype.recordSequence = ""; - - /** - * DataChangeRecord transactionId. - * @member {string} transactionId - * @memberof google.spanner.executor.v1.DataChangeRecord - * @instance - */ - DataChangeRecord.prototype.transactionId = ""; - - /** - * DataChangeRecord isLastRecord. - * @member {boolean} isLastRecord - * @memberof google.spanner.executor.v1.DataChangeRecord - * @instance - */ - DataChangeRecord.prototype.isLastRecord = false; - - /** - * DataChangeRecord table. - * @member {string} table - * @memberof google.spanner.executor.v1.DataChangeRecord - * @instance - */ - DataChangeRecord.prototype.table = ""; - - /** - * DataChangeRecord columnTypes. - * @member {Array.} columnTypes - * @memberof google.spanner.executor.v1.DataChangeRecord - * @instance - */ - DataChangeRecord.prototype.columnTypes = $util.emptyArray; - - /** - * DataChangeRecord mods. - * @member {Array.} mods - * @memberof google.spanner.executor.v1.DataChangeRecord - * @instance - */ - DataChangeRecord.prototype.mods = $util.emptyArray; - - /** - * DataChangeRecord modType. - * @member {string} modType - * @memberof google.spanner.executor.v1.DataChangeRecord - * @instance - */ - DataChangeRecord.prototype.modType = ""; - - /** - * DataChangeRecord valueCaptureType. - * @member {string} valueCaptureType - * @memberof google.spanner.executor.v1.DataChangeRecord - * @instance - */ - DataChangeRecord.prototype.valueCaptureType = ""; - - /** - * DataChangeRecord recordCount. - * @member {number|Long} recordCount - * @memberof google.spanner.executor.v1.DataChangeRecord - * @instance - */ - DataChangeRecord.prototype.recordCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * DataChangeRecord partitionCount. - * @member {number|Long} partitionCount - * @memberof google.spanner.executor.v1.DataChangeRecord - * @instance - */ - DataChangeRecord.prototype.partitionCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * DataChangeRecord transactionTag. - * @member {string} transactionTag - * @memberof google.spanner.executor.v1.DataChangeRecord - * @instance - */ - DataChangeRecord.prototype.transactionTag = ""; - - /** - * DataChangeRecord isSystemTransaction. - * @member {boolean} isSystemTransaction - * @memberof google.spanner.executor.v1.DataChangeRecord - * @instance - */ - DataChangeRecord.prototype.isSystemTransaction = false; - - /** - * Creates a new DataChangeRecord instance using the specified properties. - * @function create - * @memberof google.spanner.executor.v1.DataChangeRecord - * @static - * @param {google.spanner.executor.v1.IDataChangeRecord=} [properties] Properties to set - * @returns {google.spanner.executor.v1.DataChangeRecord} DataChangeRecord instance - */ - DataChangeRecord.create = function create(properties) { - return new DataChangeRecord(properties); - }; - - /** - * Encodes the specified DataChangeRecord message. Does not implicitly {@link google.spanner.executor.v1.DataChangeRecord.verify|verify} messages. - * @function encode - * @memberof google.spanner.executor.v1.DataChangeRecord - * @static - * @param {google.spanner.executor.v1.IDataChangeRecord} message DataChangeRecord message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DataChangeRecord.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.commitTime != null && Object.hasOwnProperty.call(message, "commitTime")) - $root.google.protobuf.Timestamp.encode(message.commitTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.recordSequence != null && Object.hasOwnProperty.call(message, "recordSequence")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.recordSequence); - if (message.transactionId != null && Object.hasOwnProperty.call(message, "transactionId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.transactionId); - if (message.isLastRecord != null && Object.hasOwnProperty.call(message, "isLastRecord")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.isLastRecord); - if (message.table != null && Object.hasOwnProperty.call(message, "table")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.table); - if (message.columnTypes != null && message.columnTypes.length) - for (var i = 0; i < message.columnTypes.length; ++i) - $root.google.spanner.executor.v1.DataChangeRecord.ColumnType.encode(message.columnTypes[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.mods != null && message.mods.length) - for (var i = 0; i < message.mods.length; ++i) - $root.google.spanner.executor.v1.DataChangeRecord.Mod.encode(message.mods[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.modType != null && Object.hasOwnProperty.call(message, "modType")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.modType); - if (message.valueCaptureType != null && Object.hasOwnProperty.call(message, "valueCaptureType")) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.valueCaptureType); - if (message.recordCount != null && Object.hasOwnProperty.call(message, "recordCount")) - writer.uint32(/* id 10, wireType 0 =*/80).int64(message.recordCount); - if (message.partitionCount != null && Object.hasOwnProperty.call(message, "partitionCount")) - writer.uint32(/* id 11, wireType 0 =*/88).int64(message.partitionCount); - if (message.transactionTag != null && Object.hasOwnProperty.call(message, "transactionTag")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.transactionTag); - if (message.isSystemTransaction != null && Object.hasOwnProperty.call(message, "isSystemTransaction")) - writer.uint32(/* id 13, wireType 0 =*/104).bool(message.isSystemTransaction); - return writer; - }; - - /** - * Encodes the specified DataChangeRecord message, length delimited. Does not implicitly {@link google.spanner.executor.v1.DataChangeRecord.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.executor.v1.DataChangeRecord - * @static - * @param {google.spanner.executor.v1.IDataChangeRecord} message DataChangeRecord message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DataChangeRecord.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DataChangeRecord message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.executor.v1.DataChangeRecord - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.executor.v1.DataChangeRecord} DataChangeRecord - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DataChangeRecord.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.DataChangeRecord(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.commitTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 2: { - message.recordSequence = reader.string(); - break; - } - case 3: { - message.transactionId = reader.string(); - break; - } - case 4: { - message.isLastRecord = reader.bool(); - break; - } - case 5: { - message.table = reader.string(); - break; - } - case 6: { - if (!(message.columnTypes && message.columnTypes.length)) - message.columnTypes = []; - message.columnTypes.push($root.google.spanner.executor.v1.DataChangeRecord.ColumnType.decode(reader, reader.uint32())); - break; - } - case 7: { - if (!(message.mods && message.mods.length)) - message.mods = []; - message.mods.push($root.google.spanner.executor.v1.DataChangeRecord.Mod.decode(reader, reader.uint32())); - break; - } - case 8: { - message.modType = reader.string(); - break; - } - case 9: { - message.valueCaptureType = reader.string(); - break; - } - case 10: { - message.recordCount = reader.int64(); - break; - } - case 11: { - message.partitionCount = reader.int64(); - break; - } - case 12: { - message.transactionTag = reader.string(); - break; - } - case 13: { - message.isSystemTransaction = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DataChangeRecord message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.executor.v1.DataChangeRecord - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.executor.v1.DataChangeRecord} DataChangeRecord - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DataChangeRecord.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DataChangeRecord message. - * @function verify - * @memberof google.spanner.executor.v1.DataChangeRecord - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DataChangeRecord.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.commitTime != null && message.hasOwnProperty("commitTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.commitTime); - if (error) - return "commitTime." + error; - } - if (message.recordSequence != null && message.hasOwnProperty("recordSequence")) - if (!$util.isString(message.recordSequence)) - return "recordSequence: string expected"; - if (message.transactionId != null && message.hasOwnProperty("transactionId")) - if (!$util.isString(message.transactionId)) - return "transactionId: string expected"; - if (message.isLastRecord != null && message.hasOwnProperty("isLastRecord")) - if (typeof message.isLastRecord !== "boolean") - return "isLastRecord: boolean expected"; - if (message.table != null && message.hasOwnProperty("table")) - if (!$util.isString(message.table)) - return "table: string expected"; - if (message.columnTypes != null && message.hasOwnProperty("columnTypes")) { - if (!Array.isArray(message.columnTypes)) - return "columnTypes: array expected"; - for (var i = 0; i < message.columnTypes.length; ++i) { - var error = $root.google.spanner.executor.v1.DataChangeRecord.ColumnType.verify(message.columnTypes[i]); - if (error) - return "columnTypes." + error; - } - } - if (message.mods != null && message.hasOwnProperty("mods")) { - if (!Array.isArray(message.mods)) - return "mods: array expected"; - for (var i = 0; i < message.mods.length; ++i) { - var error = $root.google.spanner.executor.v1.DataChangeRecord.Mod.verify(message.mods[i]); - if (error) - return "mods." + error; - } - } - if (message.modType != null && message.hasOwnProperty("modType")) - if (!$util.isString(message.modType)) - return "modType: string expected"; - if (message.valueCaptureType != null && message.hasOwnProperty("valueCaptureType")) - if (!$util.isString(message.valueCaptureType)) - return "valueCaptureType: string expected"; - if (message.recordCount != null && message.hasOwnProperty("recordCount")) - if (!$util.isInteger(message.recordCount) && !(message.recordCount && $util.isInteger(message.recordCount.low) && $util.isInteger(message.recordCount.high))) - return "recordCount: integer|Long expected"; - if (message.partitionCount != null && message.hasOwnProperty("partitionCount")) - if (!$util.isInteger(message.partitionCount) && !(message.partitionCount && $util.isInteger(message.partitionCount.low) && $util.isInteger(message.partitionCount.high))) - return "partitionCount: integer|Long expected"; - if (message.transactionTag != null && message.hasOwnProperty("transactionTag")) - if (!$util.isString(message.transactionTag)) - return "transactionTag: string expected"; - if (message.isSystemTransaction != null && message.hasOwnProperty("isSystemTransaction")) - if (typeof message.isSystemTransaction !== "boolean") - return "isSystemTransaction: boolean expected"; - return null; - }; - - /** - * Creates a DataChangeRecord message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.executor.v1.DataChangeRecord - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.executor.v1.DataChangeRecord} DataChangeRecord - */ - DataChangeRecord.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.executor.v1.DataChangeRecord) - return object; - var message = new $root.google.spanner.executor.v1.DataChangeRecord(); - if (object.commitTime != null) { - if (typeof object.commitTime !== "object") - throw TypeError(".google.spanner.executor.v1.DataChangeRecord.commitTime: object expected"); - message.commitTime = $root.google.protobuf.Timestamp.fromObject(object.commitTime); - } - if (object.recordSequence != null) - message.recordSequence = String(object.recordSequence); - if (object.transactionId != null) - message.transactionId = String(object.transactionId); - if (object.isLastRecord != null) - message.isLastRecord = Boolean(object.isLastRecord); - if (object.table != null) - message.table = String(object.table); - if (object.columnTypes) { - if (!Array.isArray(object.columnTypes)) - throw TypeError(".google.spanner.executor.v1.DataChangeRecord.columnTypes: array expected"); - message.columnTypes = []; - for (var i = 0; i < object.columnTypes.length; ++i) { - if (typeof object.columnTypes[i] !== "object") - throw TypeError(".google.spanner.executor.v1.DataChangeRecord.columnTypes: object expected"); - message.columnTypes[i] = $root.google.spanner.executor.v1.DataChangeRecord.ColumnType.fromObject(object.columnTypes[i]); - } - } - if (object.mods) { - if (!Array.isArray(object.mods)) - throw TypeError(".google.spanner.executor.v1.DataChangeRecord.mods: array expected"); - message.mods = []; - for (var i = 0; i < object.mods.length; ++i) { - if (typeof object.mods[i] !== "object") - throw TypeError(".google.spanner.executor.v1.DataChangeRecord.mods: object expected"); - message.mods[i] = $root.google.spanner.executor.v1.DataChangeRecord.Mod.fromObject(object.mods[i]); - } - } - if (object.modType != null) - message.modType = String(object.modType); - if (object.valueCaptureType != null) - message.valueCaptureType = String(object.valueCaptureType); - if (object.recordCount != null) - if ($util.Long) - (message.recordCount = $util.Long.fromValue(object.recordCount)).unsigned = false; - else if (typeof object.recordCount === "string") - message.recordCount = parseInt(object.recordCount, 10); - else if (typeof object.recordCount === "number") - message.recordCount = object.recordCount; - else if (typeof object.recordCount === "object") - message.recordCount = new $util.LongBits(object.recordCount.low >>> 0, object.recordCount.high >>> 0).toNumber(); - if (object.partitionCount != null) - if ($util.Long) - (message.partitionCount = $util.Long.fromValue(object.partitionCount)).unsigned = false; - else if (typeof object.partitionCount === "string") - message.partitionCount = parseInt(object.partitionCount, 10); - else if (typeof object.partitionCount === "number") - message.partitionCount = object.partitionCount; - else if (typeof object.partitionCount === "object") - message.partitionCount = new $util.LongBits(object.partitionCount.low >>> 0, object.partitionCount.high >>> 0).toNumber(); - if (object.transactionTag != null) - message.transactionTag = String(object.transactionTag); - if (object.isSystemTransaction != null) - message.isSystemTransaction = Boolean(object.isSystemTransaction); - return message; - }; - - /** - * Creates a plain object from a DataChangeRecord message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.executor.v1.DataChangeRecord - * @static - * @param {google.spanner.executor.v1.DataChangeRecord} message DataChangeRecord - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DataChangeRecord.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.columnTypes = []; - object.mods = []; - } - if (options.defaults) { - object.commitTime = null; - object.recordSequence = ""; - object.transactionId = ""; - object.isLastRecord = false; - object.table = ""; - object.modType = ""; - object.valueCaptureType = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.recordCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.recordCount = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.partitionCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.partitionCount = options.longs === String ? "0" : 0; - object.transactionTag = ""; - object.isSystemTransaction = false; - } - if (message.commitTime != null && message.hasOwnProperty("commitTime")) - object.commitTime = $root.google.protobuf.Timestamp.toObject(message.commitTime, options); - if (message.recordSequence != null && message.hasOwnProperty("recordSequence")) - object.recordSequence = message.recordSequence; - if (message.transactionId != null && message.hasOwnProperty("transactionId")) - object.transactionId = message.transactionId; - if (message.isLastRecord != null && message.hasOwnProperty("isLastRecord")) - object.isLastRecord = message.isLastRecord; - if (message.table != null && message.hasOwnProperty("table")) - object.table = message.table; - if (message.columnTypes && message.columnTypes.length) { - object.columnTypes = []; - for (var j = 0; j < message.columnTypes.length; ++j) - object.columnTypes[j] = $root.google.spanner.executor.v1.DataChangeRecord.ColumnType.toObject(message.columnTypes[j], options); - } - if (message.mods && message.mods.length) { - object.mods = []; - for (var j = 0; j < message.mods.length; ++j) - object.mods[j] = $root.google.spanner.executor.v1.DataChangeRecord.Mod.toObject(message.mods[j], options); - } - if (message.modType != null && message.hasOwnProperty("modType")) - object.modType = message.modType; - if (message.valueCaptureType != null && message.hasOwnProperty("valueCaptureType")) - object.valueCaptureType = message.valueCaptureType; - if (message.recordCount != null && message.hasOwnProperty("recordCount")) - if (typeof message.recordCount === "number") - object.recordCount = options.longs === String ? String(message.recordCount) : message.recordCount; - else - object.recordCount = options.longs === String ? $util.Long.prototype.toString.call(message.recordCount) : options.longs === Number ? new $util.LongBits(message.recordCount.low >>> 0, message.recordCount.high >>> 0).toNumber() : message.recordCount; - if (message.partitionCount != null && message.hasOwnProperty("partitionCount")) - if (typeof message.partitionCount === "number") - object.partitionCount = options.longs === String ? String(message.partitionCount) : message.partitionCount; - else - object.partitionCount = options.longs === String ? $util.Long.prototype.toString.call(message.partitionCount) : options.longs === Number ? new $util.LongBits(message.partitionCount.low >>> 0, message.partitionCount.high >>> 0).toNumber() : message.partitionCount; - if (message.transactionTag != null && message.hasOwnProperty("transactionTag")) - object.transactionTag = message.transactionTag; - if (message.isSystemTransaction != null && message.hasOwnProperty("isSystemTransaction")) - object.isSystemTransaction = message.isSystemTransaction; - return object; - }; - - /** - * Converts this DataChangeRecord to JSON. - * @function toJSON - * @memberof google.spanner.executor.v1.DataChangeRecord - * @instance - * @returns {Object.} JSON object - */ - DataChangeRecord.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DataChangeRecord - * @function getTypeUrl - * @memberof google.spanner.executor.v1.DataChangeRecord - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DataChangeRecord.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.executor.v1.DataChangeRecord"; - }; - - DataChangeRecord.ColumnType = (function() { - - /** - * Properties of a ColumnType. - * @memberof google.spanner.executor.v1.DataChangeRecord - * @interface IColumnType - * @property {string|null} [name] ColumnType name - * @property {string|null} [type] ColumnType type - * @property {boolean|null} [isPrimaryKey] ColumnType isPrimaryKey - * @property {number|Long|null} [ordinalPosition] ColumnType ordinalPosition - */ - - /** - * Constructs a new ColumnType. - * @memberof google.spanner.executor.v1.DataChangeRecord - * @classdesc Represents a ColumnType. - * @implements IColumnType - * @constructor - * @param {google.spanner.executor.v1.DataChangeRecord.IColumnType=} [properties] Properties to set - */ - function ColumnType(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ColumnType name. - * @member {string} name - * @memberof google.spanner.executor.v1.DataChangeRecord.ColumnType - * @instance - */ - ColumnType.prototype.name = ""; - - /** - * ColumnType type. - * @member {string} type - * @memberof google.spanner.executor.v1.DataChangeRecord.ColumnType - * @instance - */ - ColumnType.prototype.type = ""; - - /** - * ColumnType isPrimaryKey. - * @member {boolean} isPrimaryKey - * @memberof google.spanner.executor.v1.DataChangeRecord.ColumnType - * @instance - */ - ColumnType.prototype.isPrimaryKey = false; - - /** - * ColumnType ordinalPosition. - * @member {number|Long} ordinalPosition - * @memberof google.spanner.executor.v1.DataChangeRecord.ColumnType - * @instance - */ - ColumnType.prototype.ordinalPosition = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Creates a new ColumnType instance using the specified properties. - * @function create - * @memberof google.spanner.executor.v1.DataChangeRecord.ColumnType - * @static - * @param {google.spanner.executor.v1.DataChangeRecord.IColumnType=} [properties] Properties to set - * @returns {google.spanner.executor.v1.DataChangeRecord.ColumnType} ColumnType instance - */ - ColumnType.create = function create(properties) { - return new ColumnType(properties); - }; - - /** - * Encodes the specified ColumnType message. Does not implicitly {@link google.spanner.executor.v1.DataChangeRecord.ColumnType.verify|verify} messages. - * @function encode - * @memberof google.spanner.executor.v1.DataChangeRecord.ColumnType - * @static - * @param {google.spanner.executor.v1.DataChangeRecord.IColumnType} message ColumnType message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ColumnType.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.type); - if (message.isPrimaryKey != null && Object.hasOwnProperty.call(message, "isPrimaryKey")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.isPrimaryKey); - if (message.ordinalPosition != null && Object.hasOwnProperty.call(message, "ordinalPosition")) - writer.uint32(/* id 4, wireType 0 =*/32).int64(message.ordinalPosition); - return writer; - }; - - /** - * Encodes the specified ColumnType message, length delimited. Does not implicitly {@link google.spanner.executor.v1.DataChangeRecord.ColumnType.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.executor.v1.DataChangeRecord.ColumnType - * @static - * @param {google.spanner.executor.v1.DataChangeRecord.IColumnType} message ColumnType message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ColumnType.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ColumnType message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.executor.v1.DataChangeRecord.ColumnType - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.executor.v1.DataChangeRecord.ColumnType} ColumnType - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ColumnType.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.DataChangeRecord.ColumnType(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.type = reader.string(); - break; - } - case 3: { - message.isPrimaryKey = reader.bool(); - break; - } - case 4: { - message.ordinalPosition = reader.int64(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ColumnType message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.executor.v1.DataChangeRecord.ColumnType - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.executor.v1.DataChangeRecord.ColumnType} ColumnType - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ColumnType.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ColumnType message. - * @function verify - * @memberof google.spanner.executor.v1.DataChangeRecord.ColumnType - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ColumnType.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.isPrimaryKey != null && message.hasOwnProperty("isPrimaryKey")) - if (typeof message.isPrimaryKey !== "boolean") - return "isPrimaryKey: boolean expected"; - if (message.ordinalPosition != null && message.hasOwnProperty("ordinalPosition")) - if (!$util.isInteger(message.ordinalPosition) && !(message.ordinalPosition && $util.isInteger(message.ordinalPosition.low) && $util.isInteger(message.ordinalPosition.high))) - return "ordinalPosition: integer|Long expected"; - return null; - }; - - /** - * Creates a ColumnType message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.executor.v1.DataChangeRecord.ColumnType - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.executor.v1.DataChangeRecord.ColumnType} ColumnType - */ - ColumnType.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.executor.v1.DataChangeRecord.ColumnType) - return object; - var message = new $root.google.spanner.executor.v1.DataChangeRecord.ColumnType(); - if (object.name != null) - message.name = String(object.name); - if (object.type != null) - message.type = String(object.type); - if (object.isPrimaryKey != null) - message.isPrimaryKey = Boolean(object.isPrimaryKey); - if (object.ordinalPosition != null) - if ($util.Long) - (message.ordinalPosition = $util.Long.fromValue(object.ordinalPosition)).unsigned = false; - else if (typeof object.ordinalPosition === "string") - message.ordinalPosition = parseInt(object.ordinalPosition, 10); - else if (typeof object.ordinalPosition === "number") - message.ordinalPosition = object.ordinalPosition; - else if (typeof object.ordinalPosition === "object") - message.ordinalPosition = new $util.LongBits(object.ordinalPosition.low >>> 0, object.ordinalPosition.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from a ColumnType message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.executor.v1.DataChangeRecord.ColumnType - * @static - * @param {google.spanner.executor.v1.DataChangeRecord.ColumnType} message ColumnType - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ColumnType.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.type = ""; - object.isPrimaryKey = false; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.ordinalPosition = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.ordinalPosition = options.longs === String ? "0" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.isPrimaryKey != null && message.hasOwnProperty("isPrimaryKey")) - object.isPrimaryKey = message.isPrimaryKey; - if (message.ordinalPosition != null && message.hasOwnProperty("ordinalPosition")) - if (typeof message.ordinalPosition === "number") - object.ordinalPosition = options.longs === String ? String(message.ordinalPosition) : message.ordinalPosition; - else - object.ordinalPosition = options.longs === String ? $util.Long.prototype.toString.call(message.ordinalPosition) : options.longs === Number ? new $util.LongBits(message.ordinalPosition.low >>> 0, message.ordinalPosition.high >>> 0).toNumber() : message.ordinalPosition; - return object; - }; - - /** - * Converts this ColumnType to JSON. - * @function toJSON - * @memberof google.spanner.executor.v1.DataChangeRecord.ColumnType - * @instance - * @returns {Object.} JSON object - */ - ColumnType.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ColumnType - * @function getTypeUrl - * @memberof google.spanner.executor.v1.DataChangeRecord.ColumnType - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ColumnType.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.executor.v1.DataChangeRecord.ColumnType"; - }; - - return ColumnType; - })(); - - DataChangeRecord.Mod = (function() { - - /** - * Properties of a Mod. - * @memberof google.spanner.executor.v1.DataChangeRecord - * @interface IMod - * @property {string|null} [keys] Mod keys - * @property {string|null} [newValues] Mod newValues - * @property {string|null} [oldValues] Mod oldValues - */ - - /** - * Constructs a new Mod. - * @memberof google.spanner.executor.v1.DataChangeRecord - * @classdesc Represents a Mod. - * @implements IMod - * @constructor - * @param {google.spanner.executor.v1.DataChangeRecord.IMod=} [properties] Properties to set - */ - function Mod(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Mod keys. - * @member {string} keys - * @memberof google.spanner.executor.v1.DataChangeRecord.Mod - * @instance - */ - Mod.prototype.keys = ""; - - /** - * Mod newValues. - * @member {string} newValues - * @memberof google.spanner.executor.v1.DataChangeRecord.Mod - * @instance - */ - Mod.prototype.newValues = ""; - - /** - * Mod oldValues. - * @member {string} oldValues - * @memberof google.spanner.executor.v1.DataChangeRecord.Mod - * @instance - */ - Mod.prototype.oldValues = ""; - - /** - * Creates a new Mod instance using the specified properties. - * @function create - * @memberof google.spanner.executor.v1.DataChangeRecord.Mod - * @static - * @param {google.spanner.executor.v1.DataChangeRecord.IMod=} [properties] Properties to set - * @returns {google.spanner.executor.v1.DataChangeRecord.Mod} Mod instance - */ - Mod.create = function create(properties) { - return new Mod(properties); - }; - - /** - * Encodes the specified Mod message. Does not implicitly {@link google.spanner.executor.v1.DataChangeRecord.Mod.verify|verify} messages. - * @function encode - * @memberof google.spanner.executor.v1.DataChangeRecord.Mod - * @static - * @param {google.spanner.executor.v1.DataChangeRecord.IMod} message Mod message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Mod.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.keys != null && Object.hasOwnProperty.call(message, "keys")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.keys); - if (message.newValues != null && Object.hasOwnProperty.call(message, "newValues")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.newValues); - if (message.oldValues != null && Object.hasOwnProperty.call(message, "oldValues")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.oldValues); - return writer; - }; - - /** - * Encodes the specified Mod message, length delimited. Does not implicitly {@link google.spanner.executor.v1.DataChangeRecord.Mod.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.executor.v1.DataChangeRecord.Mod - * @static - * @param {google.spanner.executor.v1.DataChangeRecord.IMod} message Mod message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Mod.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Mod message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.executor.v1.DataChangeRecord.Mod - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.executor.v1.DataChangeRecord.Mod} Mod - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Mod.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.DataChangeRecord.Mod(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.keys = reader.string(); - break; - } - case 2: { - message.newValues = reader.string(); - break; - } - case 3: { - message.oldValues = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Mod message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.executor.v1.DataChangeRecord.Mod - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.executor.v1.DataChangeRecord.Mod} Mod - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Mod.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Mod message. - * @function verify - * @memberof google.spanner.executor.v1.DataChangeRecord.Mod - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Mod.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.keys != null && message.hasOwnProperty("keys")) - if (!$util.isString(message.keys)) - return "keys: string expected"; - if (message.newValues != null && message.hasOwnProperty("newValues")) - if (!$util.isString(message.newValues)) - return "newValues: string expected"; - if (message.oldValues != null && message.hasOwnProperty("oldValues")) - if (!$util.isString(message.oldValues)) - return "oldValues: string expected"; - return null; - }; - - /** - * Creates a Mod message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.executor.v1.DataChangeRecord.Mod - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.executor.v1.DataChangeRecord.Mod} Mod - */ - Mod.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.executor.v1.DataChangeRecord.Mod) - return object; - var message = new $root.google.spanner.executor.v1.DataChangeRecord.Mod(); - if (object.keys != null) - message.keys = String(object.keys); - if (object.newValues != null) - message.newValues = String(object.newValues); - if (object.oldValues != null) - message.oldValues = String(object.oldValues); - return message; - }; - - /** - * Creates a plain object from a Mod message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.executor.v1.DataChangeRecord.Mod - * @static - * @param {google.spanner.executor.v1.DataChangeRecord.Mod} message Mod - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Mod.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.keys = ""; - object.newValues = ""; - object.oldValues = ""; - } - if (message.keys != null && message.hasOwnProperty("keys")) - object.keys = message.keys; - if (message.newValues != null && message.hasOwnProperty("newValues")) - object.newValues = message.newValues; - if (message.oldValues != null && message.hasOwnProperty("oldValues")) - object.oldValues = message.oldValues; - return object; - }; - - /** - * Converts this Mod to JSON. - * @function toJSON - * @memberof google.spanner.executor.v1.DataChangeRecord.Mod - * @instance - * @returns {Object.} JSON object - */ - Mod.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Mod - * @function getTypeUrl - * @memberof google.spanner.executor.v1.DataChangeRecord.Mod - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Mod.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.executor.v1.DataChangeRecord.Mod"; - }; - - return Mod; - })(); - - return DataChangeRecord; - })(); - - v1.ChildPartitionsRecord = (function() { - - /** - * Properties of a ChildPartitionsRecord. - * @memberof google.spanner.executor.v1 - * @interface IChildPartitionsRecord - * @property {google.protobuf.ITimestamp|null} [startTime] ChildPartitionsRecord startTime - * @property {string|null} [recordSequence] ChildPartitionsRecord recordSequence - * @property {Array.|null} [childPartitions] ChildPartitionsRecord childPartitions - */ - - /** - * Constructs a new ChildPartitionsRecord. - * @memberof google.spanner.executor.v1 - * @classdesc Represents a ChildPartitionsRecord. - * @implements IChildPartitionsRecord - * @constructor - * @param {google.spanner.executor.v1.IChildPartitionsRecord=} [properties] Properties to set - */ - function ChildPartitionsRecord(properties) { - this.childPartitions = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ChildPartitionsRecord startTime. - * @member {google.protobuf.ITimestamp|null|undefined} startTime - * @memberof google.spanner.executor.v1.ChildPartitionsRecord - * @instance - */ - ChildPartitionsRecord.prototype.startTime = null; - - /** - * ChildPartitionsRecord recordSequence. - * @member {string} recordSequence - * @memberof google.spanner.executor.v1.ChildPartitionsRecord - * @instance - */ - ChildPartitionsRecord.prototype.recordSequence = ""; - - /** - * ChildPartitionsRecord childPartitions. - * @member {Array.} childPartitions - * @memberof google.spanner.executor.v1.ChildPartitionsRecord - * @instance - */ - ChildPartitionsRecord.prototype.childPartitions = $util.emptyArray; - - /** - * Creates a new ChildPartitionsRecord instance using the specified properties. - * @function create - * @memberof google.spanner.executor.v1.ChildPartitionsRecord - * @static - * @param {google.spanner.executor.v1.IChildPartitionsRecord=} [properties] Properties to set - * @returns {google.spanner.executor.v1.ChildPartitionsRecord} ChildPartitionsRecord instance - */ - ChildPartitionsRecord.create = function create(properties) { - return new ChildPartitionsRecord(properties); - }; - - /** - * Encodes the specified ChildPartitionsRecord message. Does not implicitly {@link google.spanner.executor.v1.ChildPartitionsRecord.verify|verify} messages. - * @function encode - * @memberof google.spanner.executor.v1.ChildPartitionsRecord - * @static - * @param {google.spanner.executor.v1.IChildPartitionsRecord} message ChildPartitionsRecord message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ChildPartitionsRecord.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) - $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.recordSequence != null && Object.hasOwnProperty.call(message, "recordSequence")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.recordSequence); - if (message.childPartitions != null && message.childPartitions.length) - for (var i = 0; i < message.childPartitions.length; ++i) - $root.google.spanner.executor.v1.ChildPartitionsRecord.ChildPartition.encode(message.childPartitions[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ChildPartitionsRecord message, length delimited. Does not implicitly {@link google.spanner.executor.v1.ChildPartitionsRecord.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.executor.v1.ChildPartitionsRecord - * @static - * @param {google.spanner.executor.v1.IChildPartitionsRecord} message ChildPartitionsRecord message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ChildPartitionsRecord.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ChildPartitionsRecord message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.executor.v1.ChildPartitionsRecord - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.executor.v1.ChildPartitionsRecord} ChildPartitionsRecord - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ChildPartitionsRecord.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.ChildPartitionsRecord(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 2: { - message.recordSequence = reader.string(); - break; - } - case 3: { - if (!(message.childPartitions && message.childPartitions.length)) - message.childPartitions = []; - message.childPartitions.push($root.google.spanner.executor.v1.ChildPartitionsRecord.ChildPartition.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ChildPartitionsRecord message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.executor.v1.ChildPartitionsRecord - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.executor.v1.ChildPartitionsRecord} ChildPartitionsRecord - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ChildPartitionsRecord.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ChildPartitionsRecord message. - * @function verify - * @memberof google.spanner.executor.v1.ChildPartitionsRecord - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ChildPartitionsRecord.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.startTime != null && message.hasOwnProperty("startTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.startTime); - if (error) - return "startTime." + error; - } - if (message.recordSequence != null && message.hasOwnProperty("recordSequence")) - if (!$util.isString(message.recordSequence)) - return "recordSequence: string expected"; - if (message.childPartitions != null && message.hasOwnProperty("childPartitions")) { - if (!Array.isArray(message.childPartitions)) - return "childPartitions: array expected"; - for (var i = 0; i < message.childPartitions.length; ++i) { - var error = $root.google.spanner.executor.v1.ChildPartitionsRecord.ChildPartition.verify(message.childPartitions[i]); - if (error) - return "childPartitions." + error; - } - } - return null; - }; - - /** - * Creates a ChildPartitionsRecord message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.executor.v1.ChildPartitionsRecord - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.executor.v1.ChildPartitionsRecord} ChildPartitionsRecord - */ - ChildPartitionsRecord.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.executor.v1.ChildPartitionsRecord) - return object; - var message = new $root.google.spanner.executor.v1.ChildPartitionsRecord(); - if (object.startTime != null) { - if (typeof object.startTime !== "object") - throw TypeError(".google.spanner.executor.v1.ChildPartitionsRecord.startTime: object expected"); - message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); - } - if (object.recordSequence != null) - message.recordSequence = String(object.recordSequence); - if (object.childPartitions) { - if (!Array.isArray(object.childPartitions)) - throw TypeError(".google.spanner.executor.v1.ChildPartitionsRecord.childPartitions: array expected"); - message.childPartitions = []; - for (var i = 0; i < object.childPartitions.length; ++i) { - if (typeof object.childPartitions[i] !== "object") - throw TypeError(".google.spanner.executor.v1.ChildPartitionsRecord.childPartitions: object expected"); - message.childPartitions[i] = $root.google.spanner.executor.v1.ChildPartitionsRecord.ChildPartition.fromObject(object.childPartitions[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a ChildPartitionsRecord message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.executor.v1.ChildPartitionsRecord - * @static - * @param {google.spanner.executor.v1.ChildPartitionsRecord} message ChildPartitionsRecord - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ChildPartitionsRecord.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.childPartitions = []; - if (options.defaults) { - object.startTime = null; - object.recordSequence = ""; - } - if (message.startTime != null && message.hasOwnProperty("startTime")) - object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); - if (message.recordSequence != null && message.hasOwnProperty("recordSequence")) - object.recordSequence = message.recordSequence; - if (message.childPartitions && message.childPartitions.length) { - object.childPartitions = []; - for (var j = 0; j < message.childPartitions.length; ++j) - object.childPartitions[j] = $root.google.spanner.executor.v1.ChildPartitionsRecord.ChildPartition.toObject(message.childPartitions[j], options); - } - return object; - }; - - /** - * Converts this ChildPartitionsRecord to JSON. - * @function toJSON - * @memberof google.spanner.executor.v1.ChildPartitionsRecord - * @instance - * @returns {Object.} JSON object - */ - ChildPartitionsRecord.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ChildPartitionsRecord - * @function getTypeUrl - * @memberof google.spanner.executor.v1.ChildPartitionsRecord - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ChildPartitionsRecord.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.executor.v1.ChildPartitionsRecord"; - }; - - ChildPartitionsRecord.ChildPartition = (function() { - - /** - * Properties of a ChildPartition. - * @memberof google.spanner.executor.v1.ChildPartitionsRecord - * @interface IChildPartition - * @property {string|null} [token] ChildPartition token - * @property {Array.|null} [parentPartitionTokens] ChildPartition parentPartitionTokens - */ - - /** - * Constructs a new ChildPartition. - * @memberof google.spanner.executor.v1.ChildPartitionsRecord - * @classdesc Represents a ChildPartition. - * @implements IChildPartition - * @constructor - * @param {google.spanner.executor.v1.ChildPartitionsRecord.IChildPartition=} [properties] Properties to set - */ - function ChildPartition(properties) { - this.parentPartitionTokens = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ChildPartition token. - * @member {string} token - * @memberof google.spanner.executor.v1.ChildPartitionsRecord.ChildPartition - * @instance - */ - ChildPartition.prototype.token = ""; - - /** - * ChildPartition parentPartitionTokens. - * @member {Array.} parentPartitionTokens - * @memberof google.spanner.executor.v1.ChildPartitionsRecord.ChildPartition - * @instance - */ - ChildPartition.prototype.parentPartitionTokens = $util.emptyArray; - - /** - * Creates a new ChildPartition instance using the specified properties. - * @function create - * @memberof google.spanner.executor.v1.ChildPartitionsRecord.ChildPartition - * @static - * @param {google.spanner.executor.v1.ChildPartitionsRecord.IChildPartition=} [properties] Properties to set - * @returns {google.spanner.executor.v1.ChildPartitionsRecord.ChildPartition} ChildPartition instance - */ - ChildPartition.create = function create(properties) { - return new ChildPartition(properties); - }; - - /** - * Encodes the specified ChildPartition message. Does not implicitly {@link google.spanner.executor.v1.ChildPartitionsRecord.ChildPartition.verify|verify} messages. - * @function encode - * @memberof google.spanner.executor.v1.ChildPartitionsRecord.ChildPartition - * @static - * @param {google.spanner.executor.v1.ChildPartitionsRecord.IChildPartition} message ChildPartition message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ChildPartition.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.token != null && Object.hasOwnProperty.call(message, "token")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.token); - if (message.parentPartitionTokens != null && message.parentPartitionTokens.length) - for (var i = 0; i < message.parentPartitionTokens.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.parentPartitionTokens[i]); - return writer; - }; - - /** - * Encodes the specified ChildPartition message, length delimited. Does not implicitly {@link google.spanner.executor.v1.ChildPartitionsRecord.ChildPartition.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.executor.v1.ChildPartitionsRecord.ChildPartition - * @static - * @param {google.spanner.executor.v1.ChildPartitionsRecord.IChildPartition} message ChildPartition message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ChildPartition.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ChildPartition message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.executor.v1.ChildPartitionsRecord.ChildPartition - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.executor.v1.ChildPartitionsRecord.ChildPartition} ChildPartition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ChildPartition.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.ChildPartitionsRecord.ChildPartition(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.token = reader.string(); - break; - } - case 2: { - if (!(message.parentPartitionTokens && message.parentPartitionTokens.length)) - message.parentPartitionTokens = []; - message.parentPartitionTokens.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ChildPartition message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.executor.v1.ChildPartitionsRecord.ChildPartition - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.executor.v1.ChildPartitionsRecord.ChildPartition} ChildPartition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ChildPartition.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ChildPartition message. - * @function verify - * @memberof google.spanner.executor.v1.ChildPartitionsRecord.ChildPartition - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ChildPartition.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.token != null && message.hasOwnProperty("token")) - if (!$util.isString(message.token)) - return "token: string expected"; - if (message.parentPartitionTokens != null && message.hasOwnProperty("parentPartitionTokens")) { - if (!Array.isArray(message.parentPartitionTokens)) - return "parentPartitionTokens: array expected"; - for (var i = 0; i < message.parentPartitionTokens.length; ++i) - if (!$util.isString(message.parentPartitionTokens[i])) - return "parentPartitionTokens: string[] expected"; - } - return null; - }; - - /** - * Creates a ChildPartition message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.executor.v1.ChildPartitionsRecord.ChildPartition - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.executor.v1.ChildPartitionsRecord.ChildPartition} ChildPartition - */ - ChildPartition.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.executor.v1.ChildPartitionsRecord.ChildPartition) - return object; - var message = new $root.google.spanner.executor.v1.ChildPartitionsRecord.ChildPartition(); - if (object.token != null) - message.token = String(object.token); - if (object.parentPartitionTokens) { - if (!Array.isArray(object.parentPartitionTokens)) - throw TypeError(".google.spanner.executor.v1.ChildPartitionsRecord.ChildPartition.parentPartitionTokens: array expected"); - message.parentPartitionTokens = []; - for (var i = 0; i < object.parentPartitionTokens.length; ++i) - message.parentPartitionTokens[i] = String(object.parentPartitionTokens[i]); - } - return message; - }; - - /** - * Creates a plain object from a ChildPartition message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.executor.v1.ChildPartitionsRecord.ChildPartition - * @static - * @param {google.spanner.executor.v1.ChildPartitionsRecord.ChildPartition} message ChildPartition - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ChildPartition.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.parentPartitionTokens = []; - if (options.defaults) - object.token = ""; - if (message.token != null && message.hasOwnProperty("token")) - object.token = message.token; - if (message.parentPartitionTokens && message.parentPartitionTokens.length) { - object.parentPartitionTokens = []; - for (var j = 0; j < message.parentPartitionTokens.length; ++j) - object.parentPartitionTokens[j] = message.parentPartitionTokens[j]; - } - return object; - }; - - /** - * Converts this ChildPartition to JSON. - * @function toJSON - * @memberof google.spanner.executor.v1.ChildPartitionsRecord.ChildPartition - * @instance - * @returns {Object.} JSON object - */ - ChildPartition.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ChildPartition - * @function getTypeUrl - * @memberof google.spanner.executor.v1.ChildPartitionsRecord.ChildPartition - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ChildPartition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.executor.v1.ChildPartitionsRecord.ChildPartition"; - }; - - return ChildPartition; - })(); - - return ChildPartitionsRecord; - })(); - - v1.HeartbeatRecord = (function() { - - /** - * Properties of a HeartbeatRecord. - * @memberof google.spanner.executor.v1 - * @interface IHeartbeatRecord - * @property {google.protobuf.ITimestamp|null} [heartbeatTime] HeartbeatRecord heartbeatTime - */ - - /** - * Constructs a new HeartbeatRecord. - * @memberof google.spanner.executor.v1 - * @classdesc Represents a HeartbeatRecord. - * @implements IHeartbeatRecord - * @constructor - * @param {google.spanner.executor.v1.IHeartbeatRecord=} [properties] Properties to set - */ - function HeartbeatRecord(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * HeartbeatRecord heartbeatTime. - * @member {google.protobuf.ITimestamp|null|undefined} heartbeatTime - * @memberof google.spanner.executor.v1.HeartbeatRecord - * @instance - */ - HeartbeatRecord.prototype.heartbeatTime = null; - - /** - * Creates a new HeartbeatRecord instance using the specified properties. - * @function create - * @memberof google.spanner.executor.v1.HeartbeatRecord - * @static - * @param {google.spanner.executor.v1.IHeartbeatRecord=} [properties] Properties to set - * @returns {google.spanner.executor.v1.HeartbeatRecord} HeartbeatRecord instance - */ - HeartbeatRecord.create = function create(properties) { - return new HeartbeatRecord(properties); - }; - - /** - * Encodes the specified HeartbeatRecord message. Does not implicitly {@link google.spanner.executor.v1.HeartbeatRecord.verify|verify} messages. - * @function encode - * @memberof google.spanner.executor.v1.HeartbeatRecord - * @static - * @param {google.spanner.executor.v1.IHeartbeatRecord} message HeartbeatRecord message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HeartbeatRecord.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.heartbeatTime != null && Object.hasOwnProperty.call(message, "heartbeatTime")) - $root.google.protobuf.Timestamp.encode(message.heartbeatTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified HeartbeatRecord message, length delimited. Does not implicitly {@link google.spanner.executor.v1.HeartbeatRecord.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.executor.v1.HeartbeatRecord - * @static - * @param {google.spanner.executor.v1.IHeartbeatRecord} message HeartbeatRecord message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HeartbeatRecord.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a HeartbeatRecord message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.executor.v1.HeartbeatRecord - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.executor.v1.HeartbeatRecord} HeartbeatRecord - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HeartbeatRecord.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.HeartbeatRecord(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.heartbeatTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a HeartbeatRecord message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.executor.v1.HeartbeatRecord - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.executor.v1.HeartbeatRecord} HeartbeatRecord - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HeartbeatRecord.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a HeartbeatRecord message. - * @function verify - * @memberof google.spanner.executor.v1.HeartbeatRecord - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - HeartbeatRecord.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.heartbeatTime != null && message.hasOwnProperty("heartbeatTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.heartbeatTime); - if (error) - return "heartbeatTime." + error; - } - return null; - }; - - /** - * Creates a HeartbeatRecord message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.executor.v1.HeartbeatRecord - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.executor.v1.HeartbeatRecord} HeartbeatRecord - */ - HeartbeatRecord.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.executor.v1.HeartbeatRecord) - return object; - var message = new $root.google.spanner.executor.v1.HeartbeatRecord(); - if (object.heartbeatTime != null) { - if (typeof object.heartbeatTime !== "object") - throw TypeError(".google.spanner.executor.v1.HeartbeatRecord.heartbeatTime: object expected"); - message.heartbeatTime = $root.google.protobuf.Timestamp.fromObject(object.heartbeatTime); - } - return message; - }; - - /** - * Creates a plain object from a HeartbeatRecord message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.executor.v1.HeartbeatRecord - * @static - * @param {google.spanner.executor.v1.HeartbeatRecord} message HeartbeatRecord - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - HeartbeatRecord.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.heartbeatTime = null; - if (message.heartbeatTime != null && message.hasOwnProperty("heartbeatTime")) - object.heartbeatTime = $root.google.protobuf.Timestamp.toObject(message.heartbeatTime, options); - return object; - }; - - /** - * Converts this HeartbeatRecord to JSON. - * @function toJSON - * @memberof google.spanner.executor.v1.HeartbeatRecord - * @instance - * @returns {Object.} JSON object - */ - HeartbeatRecord.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for HeartbeatRecord - * @function getTypeUrl - * @memberof google.spanner.executor.v1.HeartbeatRecord - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - HeartbeatRecord.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.executor.v1.HeartbeatRecord"; - }; - - return HeartbeatRecord; - })(); - - v1.SpannerOptions = (function() { - - /** - * Properties of a SpannerOptions. - * @memberof google.spanner.executor.v1 - * @interface ISpannerOptions - * @property {google.spanner.executor.v1.ISessionPoolOptions|null} [sessionPoolOptions] SpannerOptions sessionPoolOptions - */ - - /** - * Constructs a new SpannerOptions. - * @memberof google.spanner.executor.v1 - * @classdesc Represents a SpannerOptions. - * @implements ISpannerOptions - * @constructor - * @param {google.spanner.executor.v1.ISpannerOptions=} [properties] Properties to set - */ - function SpannerOptions(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SpannerOptions sessionPoolOptions. - * @member {google.spanner.executor.v1.ISessionPoolOptions|null|undefined} sessionPoolOptions - * @memberof google.spanner.executor.v1.SpannerOptions - * @instance - */ - SpannerOptions.prototype.sessionPoolOptions = null; - - /** - * Creates a new SpannerOptions instance using the specified properties. - * @function create - * @memberof google.spanner.executor.v1.SpannerOptions - * @static - * @param {google.spanner.executor.v1.ISpannerOptions=} [properties] Properties to set - * @returns {google.spanner.executor.v1.SpannerOptions} SpannerOptions instance - */ - SpannerOptions.create = function create(properties) { - return new SpannerOptions(properties); - }; - - /** - * Encodes the specified SpannerOptions message. Does not implicitly {@link google.spanner.executor.v1.SpannerOptions.verify|verify} messages. - * @function encode - * @memberof google.spanner.executor.v1.SpannerOptions - * @static - * @param {google.spanner.executor.v1.ISpannerOptions} message SpannerOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SpannerOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.sessionPoolOptions != null && Object.hasOwnProperty.call(message, "sessionPoolOptions")) - $root.google.spanner.executor.v1.SessionPoolOptions.encode(message.sessionPoolOptions, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified SpannerOptions message, length delimited. Does not implicitly {@link google.spanner.executor.v1.SpannerOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.executor.v1.SpannerOptions - * @static - * @param {google.spanner.executor.v1.ISpannerOptions} message SpannerOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SpannerOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SpannerOptions message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.executor.v1.SpannerOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.executor.v1.SpannerOptions} SpannerOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SpannerOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.SpannerOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.sessionPoolOptions = $root.google.spanner.executor.v1.SessionPoolOptions.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SpannerOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.executor.v1.SpannerOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.executor.v1.SpannerOptions} SpannerOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SpannerOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SpannerOptions message. - * @function verify - * @memberof google.spanner.executor.v1.SpannerOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SpannerOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.sessionPoolOptions != null && message.hasOwnProperty("sessionPoolOptions")) { - var error = $root.google.spanner.executor.v1.SessionPoolOptions.verify(message.sessionPoolOptions); - if (error) - return "sessionPoolOptions." + error; - } - return null; - }; - - /** - * Creates a SpannerOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.executor.v1.SpannerOptions - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.executor.v1.SpannerOptions} SpannerOptions - */ - SpannerOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.executor.v1.SpannerOptions) - return object; - var message = new $root.google.spanner.executor.v1.SpannerOptions(); - if (object.sessionPoolOptions != null) { - if (typeof object.sessionPoolOptions !== "object") - throw TypeError(".google.spanner.executor.v1.SpannerOptions.sessionPoolOptions: object expected"); - message.sessionPoolOptions = $root.google.spanner.executor.v1.SessionPoolOptions.fromObject(object.sessionPoolOptions); - } - return message; - }; - - /** - * Creates a plain object from a SpannerOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.executor.v1.SpannerOptions - * @static - * @param {google.spanner.executor.v1.SpannerOptions} message SpannerOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SpannerOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.sessionPoolOptions = null; - if (message.sessionPoolOptions != null && message.hasOwnProperty("sessionPoolOptions")) - object.sessionPoolOptions = $root.google.spanner.executor.v1.SessionPoolOptions.toObject(message.sessionPoolOptions, options); - return object; - }; - - /** - * Converts this SpannerOptions to JSON. - * @function toJSON - * @memberof google.spanner.executor.v1.SpannerOptions - * @instance - * @returns {Object.} JSON object - */ - SpannerOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SpannerOptions - * @function getTypeUrl - * @memberof google.spanner.executor.v1.SpannerOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SpannerOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.executor.v1.SpannerOptions"; - }; - - return SpannerOptions; - })(); - - v1.SessionPoolOptions = (function() { - - /** - * Properties of a SessionPoolOptions. - * @memberof google.spanner.executor.v1 - * @interface ISessionPoolOptions - * @property {boolean|null} [useMultiplexed] SessionPoolOptions useMultiplexed - */ - - /** - * Constructs a new SessionPoolOptions. - * @memberof google.spanner.executor.v1 - * @classdesc Represents a SessionPoolOptions. - * @implements ISessionPoolOptions - * @constructor - * @param {google.spanner.executor.v1.ISessionPoolOptions=} [properties] Properties to set - */ - function SessionPoolOptions(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SessionPoolOptions useMultiplexed. - * @member {boolean} useMultiplexed - * @memberof google.spanner.executor.v1.SessionPoolOptions - * @instance - */ - SessionPoolOptions.prototype.useMultiplexed = false; - - /** - * Creates a new SessionPoolOptions instance using the specified properties. - * @function create - * @memberof google.spanner.executor.v1.SessionPoolOptions - * @static - * @param {google.spanner.executor.v1.ISessionPoolOptions=} [properties] Properties to set - * @returns {google.spanner.executor.v1.SessionPoolOptions} SessionPoolOptions instance - */ - SessionPoolOptions.create = function create(properties) { - return new SessionPoolOptions(properties); - }; - - /** - * Encodes the specified SessionPoolOptions message. Does not implicitly {@link google.spanner.executor.v1.SessionPoolOptions.verify|verify} messages. - * @function encode - * @memberof google.spanner.executor.v1.SessionPoolOptions - * @static - * @param {google.spanner.executor.v1.ISessionPoolOptions} message SessionPoolOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SessionPoolOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.useMultiplexed != null && Object.hasOwnProperty.call(message, "useMultiplexed")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.useMultiplexed); - return writer; - }; - - /** - * Encodes the specified SessionPoolOptions message, length delimited. Does not implicitly {@link google.spanner.executor.v1.SessionPoolOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.executor.v1.SessionPoolOptions - * @static - * @param {google.spanner.executor.v1.ISessionPoolOptions} message SessionPoolOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SessionPoolOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SessionPoolOptions message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.executor.v1.SessionPoolOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.executor.v1.SessionPoolOptions} SessionPoolOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SessionPoolOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.SessionPoolOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.useMultiplexed = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SessionPoolOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.executor.v1.SessionPoolOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.executor.v1.SessionPoolOptions} SessionPoolOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SessionPoolOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SessionPoolOptions message. - * @function verify - * @memberof google.spanner.executor.v1.SessionPoolOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SessionPoolOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.useMultiplexed != null && message.hasOwnProperty("useMultiplexed")) - if (typeof message.useMultiplexed !== "boolean") - return "useMultiplexed: boolean expected"; - return null; - }; - - /** - * Creates a SessionPoolOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.executor.v1.SessionPoolOptions - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.executor.v1.SessionPoolOptions} SessionPoolOptions - */ - SessionPoolOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.executor.v1.SessionPoolOptions) - return object; - var message = new $root.google.spanner.executor.v1.SessionPoolOptions(); - if (object.useMultiplexed != null) - message.useMultiplexed = Boolean(object.useMultiplexed); - return message; - }; - - /** - * Creates a plain object from a SessionPoolOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.executor.v1.SessionPoolOptions - * @static - * @param {google.spanner.executor.v1.SessionPoolOptions} message SessionPoolOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SessionPoolOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.useMultiplexed = false; - if (message.useMultiplexed != null && message.hasOwnProperty("useMultiplexed")) - object.useMultiplexed = message.useMultiplexed; - return object; - }; - - /** - * Converts this SessionPoolOptions to JSON. - * @function toJSON - * @memberof google.spanner.executor.v1.SessionPoolOptions - * @instance - * @returns {Object.} JSON object - */ - SessionPoolOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SessionPoolOptions - * @function getTypeUrl - * @memberof google.spanner.executor.v1.SessionPoolOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SessionPoolOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.executor.v1.SessionPoolOptions"; - }; - - return SessionPoolOptions; - })(); - - return v1; - })(); - - return executor; - })(); - - spanner.v1 = (function() { - - /** - * Namespace v1. - * @memberof google.spanner - * @namespace - */ - var v1 = {}; - - v1.Spanner = (function() { - - /** - * Constructs a new Spanner service. - * @memberof google.spanner.v1 - * @classdesc Represents a Spanner - * @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 Spanner(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (Spanner.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Spanner; - - /** - * Creates new Spanner service using the specified rpc implementation. - * @function create - * @memberof google.spanner.v1.Spanner - * @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 {Spanner} RPC service. Useful where requests and/or responses are streamed. - */ - Spanner.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.spanner.v1.Spanner|createSession}. - * @memberof google.spanner.v1.Spanner - * @typedef CreateSessionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.spanner.v1.Session} [response] Session - */ - - /** - * Calls CreateSession. - * @function createSession - * @memberof google.spanner.v1.Spanner - * @instance - * @param {google.spanner.v1.ICreateSessionRequest} request CreateSessionRequest message or plain object - * @param {google.spanner.v1.Spanner.CreateSessionCallback} callback Node-style callback called with the error, if any, and Session - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Spanner.prototype.createSession = function createSession(request, callback) { - return this.rpcCall(createSession, $root.google.spanner.v1.CreateSessionRequest, $root.google.spanner.v1.Session, request, callback); - }, "name", { value: "CreateSession" }); - - /** - * Calls CreateSession. - * @function createSession - * @memberof google.spanner.v1.Spanner - * @instance - * @param {google.spanner.v1.ICreateSessionRequest} request CreateSessionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.v1.Spanner|batchCreateSessions}. - * @memberof google.spanner.v1.Spanner - * @typedef BatchCreateSessionsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.spanner.v1.BatchCreateSessionsResponse} [response] BatchCreateSessionsResponse - */ - - /** - * Calls BatchCreateSessions. - * @function batchCreateSessions - * @memberof google.spanner.v1.Spanner - * @instance - * @param {google.spanner.v1.IBatchCreateSessionsRequest} request BatchCreateSessionsRequest message or plain object - * @param {google.spanner.v1.Spanner.BatchCreateSessionsCallback} callback Node-style callback called with the error, if any, and BatchCreateSessionsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Spanner.prototype.batchCreateSessions = function batchCreateSessions(request, callback) { - return this.rpcCall(batchCreateSessions, $root.google.spanner.v1.BatchCreateSessionsRequest, $root.google.spanner.v1.BatchCreateSessionsResponse, request, callback); - }, "name", { value: "BatchCreateSessions" }); - - /** - * Calls BatchCreateSessions. - * @function batchCreateSessions - * @memberof google.spanner.v1.Spanner - * @instance - * @param {google.spanner.v1.IBatchCreateSessionsRequest} request BatchCreateSessionsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.v1.Spanner|getSession}. - * @memberof google.spanner.v1.Spanner - * @typedef GetSessionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.spanner.v1.Session} [response] Session - */ - - /** - * Calls GetSession. - * @function getSession - * @memberof google.spanner.v1.Spanner - * @instance - * @param {google.spanner.v1.IGetSessionRequest} request GetSessionRequest message or plain object - * @param {google.spanner.v1.Spanner.GetSessionCallback} callback Node-style callback called with the error, if any, and Session - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Spanner.prototype.getSession = function getSession(request, callback) { - return this.rpcCall(getSession, $root.google.spanner.v1.GetSessionRequest, $root.google.spanner.v1.Session, request, callback); - }, "name", { value: "GetSession" }); - - /** - * Calls GetSession. - * @function getSession - * @memberof google.spanner.v1.Spanner - * @instance - * @param {google.spanner.v1.IGetSessionRequest} request GetSessionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.v1.Spanner|listSessions}. - * @memberof google.spanner.v1.Spanner - * @typedef ListSessionsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.spanner.v1.ListSessionsResponse} [response] ListSessionsResponse - */ - - /** - * Calls ListSessions. - * @function listSessions - * @memberof google.spanner.v1.Spanner - * @instance - * @param {google.spanner.v1.IListSessionsRequest} request ListSessionsRequest message or plain object - * @param {google.spanner.v1.Spanner.ListSessionsCallback} callback Node-style callback called with the error, if any, and ListSessionsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Spanner.prototype.listSessions = function listSessions(request, callback) { - return this.rpcCall(listSessions, $root.google.spanner.v1.ListSessionsRequest, $root.google.spanner.v1.ListSessionsResponse, request, callback); - }, "name", { value: "ListSessions" }); - - /** - * Calls ListSessions. - * @function listSessions - * @memberof google.spanner.v1.Spanner - * @instance - * @param {google.spanner.v1.IListSessionsRequest} request ListSessionsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.v1.Spanner|deleteSession}. - * @memberof google.spanner.v1.Spanner - * @typedef DeleteSessionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteSession. - * @function deleteSession - * @memberof google.spanner.v1.Spanner - * @instance - * @param {google.spanner.v1.IDeleteSessionRequest} request DeleteSessionRequest message or plain object - * @param {google.spanner.v1.Spanner.DeleteSessionCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Spanner.prototype.deleteSession = function deleteSession(request, callback) { - return this.rpcCall(deleteSession, $root.google.spanner.v1.DeleteSessionRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteSession" }); - - /** - * Calls DeleteSession. - * @function deleteSession - * @memberof google.spanner.v1.Spanner - * @instance - * @param {google.spanner.v1.IDeleteSessionRequest} request DeleteSessionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.v1.Spanner|executeSql}. - * @memberof google.spanner.v1.Spanner - * @typedef ExecuteSqlCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.spanner.v1.ResultSet} [response] ResultSet - */ - - /** - * Calls ExecuteSql. - * @function executeSql - * @memberof google.spanner.v1.Spanner - * @instance - * @param {google.spanner.v1.IExecuteSqlRequest} request ExecuteSqlRequest message or plain object - * @param {google.spanner.v1.Spanner.ExecuteSqlCallback} callback Node-style callback called with the error, if any, and ResultSet - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Spanner.prototype.executeSql = function executeSql(request, callback) { - return this.rpcCall(executeSql, $root.google.spanner.v1.ExecuteSqlRequest, $root.google.spanner.v1.ResultSet, request, callback); - }, "name", { value: "ExecuteSql" }); - - /** - * Calls ExecuteSql. - * @function executeSql - * @memberof google.spanner.v1.Spanner - * @instance - * @param {google.spanner.v1.IExecuteSqlRequest} request ExecuteSqlRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.v1.Spanner|executeStreamingSql}. - * @memberof google.spanner.v1.Spanner - * @typedef ExecuteStreamingSqlCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.spanner.v1.PartialResultSet} [response] PartialResultSet - */ - - /** - * Calls ExecuteStreamingSql. - * @function executeStreamingSql - * @memberof google.spanner.v1.Spanner - * @instance - * @param {google.spanner.v1.IExecuteSqlRequest} request ExecuteSqlRequest message or plain object - * @param {google.spanner.v1.Spanner.ExecuteStreamingSqlCallback} callback Node-style callback called with the error, if any, and PartialResultSet - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Spanner.prototype.executeStreamingSql = function executeStreamingSql(request, callback) { - return this.rpcCall(executeStreamingSql, $root.google.spanner.v1.ExecuteSqlRequest, $root.google.spanner.v1.PartialResultSet, request, callback); - }, "name", { value: "ExecuteStreamingSql" }); - - /** - * Calls ExecuteStreamingSql. - * @function executeStreamingSql - * @memberof google.spanner.v1.Spanner - * @instance - * @param {google.spanner.v1.IExecuteSqlRequest} request ExecuteSqlRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.v1.Spanner|executeBatchDml}. - * @memberof google.spanner.v1.Spanner - * @typedef ExecuteBatchDmlCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.spanner.v1.ExecuteBatchDmlResponse} [response] ExecuteBatchDmlResponse - */ - - /** - * Calls ExecuteBatchDml. - * @function executeBatchDml - * @memberof google.spanner.v1.Spanner - * @instance - * @param {google.spanner.v1.IExecuteBatchDmlRequest} request ExecuteBatchDmlRequest message or plain object - * @param {google.spanner.v1.Spanner.ExecuteBatchDmlCallback} callback Node-style callback called with the error, if any, and ExecuteBatchDmlResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Spanner.prototype.executeBatchDml = function executeBatchDml(request, callback) { - return this.rpcCall(executeBatchDml, $root.google.spanner.v1.ExecuteBatchDmlRequest, $root.google.spanner.v1.ExecuteBatchDmlResponse, request, callback); - }, "name", { value: "ExecuteBatchDml" }); - - /** - * Calls ExecuteBatchDml. - * @function executeBatchDml - * @memberof google.spanner.v1.Spanner - * @instance - * @param {google.spanner.v1.IExecuteBatchDmlRequest} request ExecuteBatchDmlRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.v1.Spanner|read}. - * @memberof google.spanner.v1.Spanner - * @typedef ReadCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.spanner.v1.ResultSet} [response] ResultSet - */ - - /** - * Calls Read. - * @function read - * @memberof google.spanner.v1.Spanner - * @instance - * @param {google.spanner.v1.IReadRequest} request ReadRequest message or plain object - * @param {google.spanner.v1.Spanner.ReadCallback} callback Node-style callback called with the error, if any, and ResultSet - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Spanner.prototype.read = function read(request, callback) { - return this.rpcCall(read, $root.google.spanner.v1.ReadRequest, $root.google.spanner.v1.ResultSet, request, callback); - }, "name", { value: "Read" }); - - /** - * Calls Read. - * @function read - * @memberof google.spanner.v1.Spanner - * @instance - * @param {google.spanner.v1.IReadRequest} request ReadRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.v1.Spanner|streamingRead}. - * @memberof google.spanner.v1.Spanner - * @typedef StreamingReadCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.spanner.v1.PartialResultSet} [response] PartialResultSet - */ - - /** - * Calls StreamingRead. - * @function streamingRead - * @memberof google.spanner.v1.Spanner - * @instance - * @param {google.spanner.v1.IReadRequest} request ReadRequest message or plain object - * @param {google.spanner.v1.Spanner.StreamingReadCallback} callback Node-style callback called with the error, if any, and PartialResultSet - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Spanner.prototype.streamingRead = function streamingRead(request, callback) { - return this.rpcCall(streamingRead, $root.google.spanner.v1.ReadRequest, $root.google.spanner.v1.PartialResultSet, request, callback); - }, "name", { value: "StreamingRead" }); - - /** - * Calls StreamingRead. - * @function streamingRead - * @memberof google.spanner.v1.Spanner - * @instance - * @param {google.spanner.v1.IReadRequest} request ReadRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.v1.Spanner|beginTransaction}. - * @memberof google.spanner.v1.Spanner - * @typedef BeginTransactionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.spanner.v1.Transaction} [response] Transaction - */ - - /** - * Calls BeginTransaction. - * @function beginTransaction - * @memberof google.spanner.v1.Spanner - * @instance - * @param {google.spanner.v1.IBeginTransactionRequest} request BeginTransactionRequest message or plain object - * @param {google.spanner.v1.Spanner.BeginTransactionCallback} callback Node-style callback called with the error, if any, and Transaction - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Spanner.prototype.beginTransaction = function beginTransaction(request, callback) { - return this.rpcCall(beginTransaction, $root.google.spanner.v1.BeginTransactionRequest, $root.google.spanner.v1.Transaction, request, callback); - }, "name", { value: "BeginTransaction" }); - - /** - * Calls BeginTransaction. - * @function beginTransaction - * @memberof google.spanner.v1.Spanner - * @instance - * @param {google.spanner.v1.IBeginTransactionRequest} request BeginTransactionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.v1.Spanner|commit}. - * @memberof google.spanner.v1.Spanner - * @typedef CommitCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.spanner.v1.CommitResponse} [response] CommitResponse - */ - - /** - * Calls Commit. - * @function commit - * @memberof google.spanner.v1.Spanner - * @instance - * @param {google.spanner.v1.ICommitRequest} request CommitRequest message or plain object - * @param {google.spanner.v1.Spanner.CommitCallback} callback Node-style callback called with the error, if any, and CommitResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Spanner.prototype.commit = function commit(request, callback) { - return this.rpcCall(commit, $root.google.spanner.v1.CommitRequest, $root.google.spanner.v1.CommitResponse, request, callback); - }, "name", { value: "Commit" }); - - /** - * Calls Commit. - * @function commit - * @memberof google.spanner.v1.Spanner - * @instance - * @param {google.spanner.v1.ICommitRequest} request CommitRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.v1.Spanner|rollback}. - * @memberof google.spanner.v1.Spanner - * @typedef RollbackCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls Rollback. - * @function rollback - * @memberof google.spanner.v1.Spanner - * @instance - * @param {google.spanner.v1.IRollbackRequest} request RollbackRequest message or plain object - * @param {google.spanner.v1.Spanner.RollbackCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Spanner.prototype.rollback = function rollback(request, callback) { - return this.rpcCall(rollback, $root.google.spanner.v1.RollbackRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "Rollback" }); - - /** - * Calls Rollback. - * @function rollback - * @memberof google.spanner.v1.Spanner - * @instance - * @param {google.spanner.v1.IRollbackRequest} request RollbackRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.v1.Spanner|partitionQuery}. - * @memberof google.spanner.v1.Spanner - * @typedef PartitionQueryCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.spanner.v1.PartitionResponse} [response] PartitionResponse - */ - - /** - * Calls PartitionQuery. - * @function partitionQuery - * @memberof google.spanner.v1.Spanner - * @instance - * @param {google.spanner.v1.IPartitionQueryRequest} request PartitionQueryRequest message or plain object - * @param {google.spanner.v1.Spanner.PartitionQueryCallback} callback Node-style callback called with the error, if any, and PartitionResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Spanner.prototype.partitionQuery = function partitionQuery(request, callback) { - return this.rpcCall(partitionQuery, $root.google.spanner.v1.PartitionQueryRequest, $root.google.spanner.v1.PartitionResponse, request, callback); - }, "name", { value: "PartitionQuery" }); - - /** - * Calls PartitionQuery. - * @function partitionQuery - * @memberof google.spanner.v1.Spanner - * @instance - * @param {google.spanner.v1.IPartitionQueryRequest} request PartitionQueryRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.v1.Spanner|partitionRead}. - * @memberof google.spanner.v1.Spanner - * @typedef PartitionReadCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.spanner.v1.PartitionResponse} [response] PartitionResponse - */ - - /** - * Calls PartitionRead. - * @function partitionRead - * @memberof google.spanner.v1.Spanner - * @instance - * @param {google.spanner.v1.IPartitionReadRequest} request PartitionReadRequest message or plain object - * @param {google.spanner.v1.Spanner.PartitionReadCallback} callback Node-style callback called with the error, if any, and PartitionResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Spanner.prototype.partitionRead = function partitionRead(request, callback) { - return this.rpcCall(partitionRead, $root.google.spanner.v1.PartitionReadRequest, $root.google.spanner.v1.PartitionResponse, request, callback); - }, "name", { value: "PartitionRead" }); - - /** - * Calls PartitionRead. - * @function partitionRead - * @memberof google.spanner.v1.Spanner - * @instance - * @param {google.spanner.v1.IPartitionReadRequest} request PartitionReadRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.v1.Spanner|batchWrite}. - * @memberof google.spanner.v1.Spanner - * @typedef BatchWriteCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.spanner.v1.BatchWriteResponse} [response] BatchWriteResponse - */ - - /** - * Calls BatchWrite. - * @function batchWrite - * @memberof google.spanner.v1.Spanner - * @instance - * @param {google.spanner.v1.IBatchWriteRequest} request BatchWriteRequest message or plain object - * @param {google.spanner.v1.Spanner.BatchWriteCallback} callback Node-style callback called with the error, if any, and BatchWriteResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Spanner.prototype.batchWrite = function batchWrite(request, callback) { - return this.rpcCall(batchWrite, $root.google.spanner.v1.BatchWriteRequest, $root.google.spanner.v1.BatchWriteResponse, request, callback); - }, "name", { value: "BatchWrite" }); - - /** - * Calls BatchWrite. - * @function batchWrite - * @memberof google.spanner.v1.Spanner - * @instance - * @param {google.spanner.v1.IBatchWriteRequest} request BatchWriteRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return Spanner; - })(); - - v1.CreateSessionRequest = (function() { - - /** - * Properties of a CreateSessionRequest. - * @memberof google.spanner.v1 - * @interface ICreateSessionRequest - * @property {string|null} [database] CreateSessionRequest database - * @property {google.spanner.v1.ISession|null} [session] CreateSessionRequest session - */ - - /** - * Constructs a new CreateSessionRequest. - * @memberof google.spanner.v1 - * @classdesc Represents a CreateSessionRequest. - * @implements ICreateSessionRequest - * @constructor - * @param {google.spanner.v1.ICreateSessionRequest=} [properties] Properties to set - */ - function CreateSessionRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateSessionRequest database. - * @member {string} database - * @memberof google.spanner.v1.CreateSessionRequest - * @instance - */ - CreateSessionRequest.prototype.database = ""; - - /** - * CreateSessionRequest session. - * @member {google.spanner.v1.ISession|null|undefined} session - * @memberof google.spanner.v1.CreateSessionRequest - * @instance - */ - CreateSessionRequest.prototype.session = null; - - /** - * Creates a new CreateSessionRequest instance using the specified properties. - * @function create - * @memberof google.spanner.v1.CreateSessionRequest - * @static - * @param {google.spanner.v1.ICreateSessionRequest=} [properties] Properties to set - * @returns {google.spanner.v1.CreateSessionRequest} CreateSessionRequest instance - */ - CreateSessionRequest.create = function create(properties) { - return new CreateSessionRequest(properties); - }; - - /** - * Encodes the specified CreateSessionRequest message. Does not implicitly {@link google.spanner.v1.CreateSessionRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.CreateSessionRequest - * @static - * @param {google.spanner.v1.ICreateSessionRequest} message CreateSessionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateSessionRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.database != null && Object.hasOwnProperty.call(message, "database")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.database); - if (message.session != null && Object.hasOwnProperty.call(message, "session")) - $root.google.spanner.v1.Session.encode(message.session, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CreateSessionRequest message, length delimited. Does not implicitly {@link google.spanner.v1.CreateSessionRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.CreateSessionRequest - * @static - * @param {google.spanner.v1.ICreateSessionRequest} message CreateSessionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateSessionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateSessionRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.CreateSessionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.CreateSessionRequest} CreateSessionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateSessionRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.CreateSessionRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.database = reader.string(); - break; - } - case 2: { - message.session = $root.google.spanner.v1.Session.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateSessionRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.CreateSessionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.CreateSessionRequest} CreateSessionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateSessionRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateSessionRequest message. - * @function verify - * @memberof google.spanner.v1.CreateSessionRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateSessionRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.database != null && message.hasOwnProperty("database")) - if (!$util.isString(message.database)) - return "database: string expected"; - if (message.session != null && message.hasOwnProperty("session")) { - var error = $root.google.spanner.v1.Session.verify(message.session); - if (error) - return "session." + error; - } - return null; - }; - - /** - * Creates a CreateSessionRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.CreateSessionRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.CreateSessionRequest} CreateSessionRequest - */ - CreateSessionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.CreateSessionRequest) - return object; - var message = new $root.google.spanner.v1.CreateSessionRequest(); - if (object.database != null) - message.database = String(object.database); - if (object.session != null) { - if (typeof object.session !== "object") - throw TypeError(".google.spanner.v1.CreateSessionRequest.session: object expected"); - message.session = $root.google.spanner.v1.Session.fromObject(object.session); - } - return message; - }; - - /** - * Creates a plain object from a CreateSessionRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.CreateSessionRequest - * @static - * @param {google.spanner.v1.CreateSessionRequest} message CreateSessionRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateSessionRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.database = ""; - object.session = null; - } - if (message.database != null && message.hasOwnProperty("database")) - object.database = message.database; - if (message.session != null && message.hasOwnProperty("session")) - object.session = $root.google.spanner.v1.Session.toObject(message.session, options); - return object; - }; - - /** - * Converts this CreateSessionRequest to JSON. - * @function toJSON - * @memberof google.spanner.v1.CreateSessionRequest - * @instance - * @returns {Object.} JSON object - */ - CreateSessionRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateSessionRequest - * @function getTypeUrl - * @memberof google.spanner.v1.CreateSessionRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateSessionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.CreateSessionRequest"; - }; - - return CreateSessionRequest; - })(); - - v1.BatchCreateSessionsRequest = (function() { - - /** - * Properties of a BatchCreateSessionsRequest. - * @memberof google.spanner.v1 - * @interface IBatchCreateSessionsRequest - * @property {string|null} [database] BatchCreateSessionsRequest database - * @property {google.spanner.v1.ISession|null} [sessionTemplate] BatchCreateSessionsRequest sessionTemplate - * @property {number|null} [sessionCount] BatchCreateSessionsRequest sessionCount - */ - - /** - * Constructs a new BatchCreateSessionsRequest. - * @memberof google.spanner.v1 - * @classdesc Represents a BatchCreateSessionsRequest. - * @implements IBatchCreateSessionsRequest - * @constructor - * @param {google.spanner.v1.IBatchCreateSessionsRequest=} [properties] Properties to set - */ - function BatchCreateSessionsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BatchCreateSessionsRequest database. - * @member {string} database - * @memberof google.spanner.v1.BatchCreateSessionsRequest - * @instance - */ - BatchCreateSessionsRequest.prototype.database = ""; - - /** - * BatchCreateSessionsRequest sessionTemplate. - * @member {google.spanner.v1.ISession|null|undefined} sessionTemplate - * @memberof google.spanner.v1.BatchCreateSessionsRequest - * @instance - */ - BatchCreateSessionsRequest.prototype.sessionTemplate = null; - - /** - * BatchCreateSessionsRequest sessionCount. - * @member {number} sessionCount - * @memberof google.spanner.v1.BatchCreateSessionsRequest - * @instance - */ - BatchCreateSessionsRequest.prototype.sessionCount = 0; - - /** - * Creates a new BatchCreateSessionsRequest instance using the specified properties. - * @function create - * @memberof google.spanner.v1.BatchCreateSessionsRequest - * @static - * @param {google.spanner.v1.IBatchCreateSessionsRequest=} [properties] Properties to set - * @returns {google.spanner.v1.BatchCreateSessionsRequest} BatchCreateSessionsRequest instance - */ - BatchCreateSessionsRequest.create = function create(properties) { - return new BatchCreateSessionsRequest(properties); - }; - - /** - * Encodes the specified BatchCreateSessionsRequest message. Does not implicitly {@link google.spanner.v1.BatchCreateSessionsRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.BatchCreateSessionsRequest - * @static - * @param {google.spanner.v1.IBatchCreateSessionsRequest} message BatchCreateSessionsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchCreateSessionsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.database != null && Object.hasOwnProperty.call(message, "database")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.database); - if (message.sessionTemplate != null && Object.hasOwnProperty.call(message, "sessionTemplate")) - $root.google.spanner.v1.Session.encode(message.sessionTemplate, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.sessionCount != null && Object.hasOwnProperty.call(message, "sessionCount")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.sessionCount); - return writer; - }; - - /** - * Encodes the specified BatchCreateSessionsRequest message, length delimited. Does not implicitly {@link google.spanner.v1.BatchCreateSessionsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.BatchCreateSessionsRequest - * @static - * @param {google.spanner.v1.IBatchCreateSessionsRequest} message BatchCreateSessionsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchCreateSessionsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BatchCreateSessionsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.BatchCreateSessionsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.BatchCreateSessionsRequest} BatchCreateSessionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchCreateSessionsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.BatchCreateSessionsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.database = reader.string(); - break; - } - case 2: { - message.sessionTemplate = $root.google.spanner.v1.Session.decode(reader, reader.uint32()); - break; - } - case 3: { - message.sessionCount = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BatchCreateSessionsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.BatchCreateSessionsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.BatchCreateSessionsRequest} BatchCreateSessionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchCreateSessionsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BatchCreateSessionsRequest message. - * @function verify - * @memberof google.spanner.v1.BatchCreateSessionsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BatchCreateSessionsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.database != null && message.hasOwnProperty("database")) - if (!$util.isString(message.database)) - return "database: string expected"; - if (message.sessionTemplate != null && message.hasOwnProperty("sessionTemplate")) { - var error = $root.google.spanner.v1.Session.verify(message.sessionTemplate); - if (error) - return "sessionTemplate." + error; - } - if (message.sessionCount != null && message.hasOwnProperty("sessionCount")) - if (!$util.isInteger(message.sessionCount)) - return "sessionCount: integer expected"; - return null; - }; - - /** - * Creates a BatchCreateSessionsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.BatchCreateSessionsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.BatchCreateSessionsRequest} BatchCreateSessionsRequest - */ - BatchCreateSessionsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.BatchCreateSessionsRequest) - return object; - var message = new $root.google.spanner.v1.BatchCreateSessionsRequest(); - if (object.database != null) - message.database = String(object.database); - if (object.sessionTemplate != null) { - if (typeof object.sessionTemplate !== "object") - throw TypeError(".google.spanner.v1.BatchCreateSessionsRequest.sessionTemplate: object expected"); - message.sessionTemplate = $root.google.spanner.v1.Session.fromObject(object.sessionTemplate); - } - if (object.sessionCount != null) - message.sessionCount = object.sessionCount | 0; - return message; - }; - - /** - * Creates a plain object from a BatchCreateSessionsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.BatchCreateSessionsRequest - * @static - * @param {google.spanner.v1.BatchCreateSessionsRequest} message BatchCreateSessionsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BatchCreateSessionsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.database = ""; - object.sessionTemplate = null; - object.sessionCount = 0; - } - if (message.database != null && message.hasOwnProperty("database")) - object.database = message.database; - if (message.sessionTemplate != null && message.hasOwnProperty("sessionTemplate")) - object.sessionTemplate = $root.google.spanner.v1.Session.toObject(message.sessionTemplate, options); - if (message.sessionCount != null && message.hasOwnProperty("sessionCount")) - object.sessionCount = message.sessionCount; - return object; - }; - - /** - * Converts this BatchCreateSessionsRequest to JSON. - * @function toJSON - * @memberof google.spanner.v1.BatchCreateSessionsRequest - * @instance - * @returns {Object.} JSON object - */ - BatchCreateSessionsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BatchCreateSessionsRequest - * @function getTypeUrl - * @memberof google.spanner.v1.BatchCreateSessionsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BatchCreateSessionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.BatchCreateSessionsRequest"; - }; - - return BatchCreateSessionsRequest; - })(); - - v1.BatchCreateSessionsResponse = (function() { - - /** - * Properties of a BatchCreateSessionsResponse. - * @memberof google.spanner.v1 - * @interface IBatchCreateSessionsResponse - * @property {Array.|null} [session] BatchCreateSessionsResponse session - */ - - /** - * Constructs a new BatchCreateSessionsResponse. - * @memberof google.spanner.v1 - * @classdesc Represents a BatchCreateSessionsResponse. - * @implements IBatchCreateSessionsResponse - * @constructor - * @param {google.spanner.v1.IBatchCreateSessionsResponse=} [properties] Properties to set - */ - function BatchCreateSessionsResponse(properties) { - this.session = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BatchCreateSessionsResponse session. - * @member {Array.} session - * @memberof google.spanner.v1.BatchCreateSessionsResponse - * @instance - */ - BatchCreateSessionsResponse.prototype.session = $util.emptyArray; - - /** - * Creates a new BatchCreateSessionsResponse instance using the specified properties. - * @function create - * @memberof google.spanner.v1.BatchCreateSessionsResponse - * @static - * @param {google.spanner.v1.IBatchCreateSessionsResponse=} [properties] Properties to set - * @returns {google.spanner.v1.BatchCreateSessionsResponse} BatchCreateSessionsResponse instance - */ - BatchCreateSessionsResponse.create = function create(properties) { - return new BatchCreateSessionsResponse(properties); - }; - - /** - * Encodes the specified BatchCreateSessionsResponse message. Does not implicitly {@link google.spanner.v1.BatchCreateSessionsResponse.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.BatchCreateSessionsResponse - * @static - * @param {google.spanner.v1.IBatchCreateSessionsResponse} message BatchCreateSessionsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchCreateSessionsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.session != null && message.session.length) - for (var i = 0; i < message.session.length; ++i) - $root.google.spanner.v1.Session.encode(message.session[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified BatchCreateSessionsResponse message, length delimited. Does not implicitly {@link google.spanner.v1.BatchCreateSessionsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.BatchCreateSessionsResponse - * @static - * @param {google.spanner.v1.IBatchCreateSessionsResponse} message BatchCreateSessionsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchCreateSessionsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BatchCreateSessionsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.BatchCreateSessionsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.BatchCreateSessionsResponse} BatchCreateSessionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchCreateSessionsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.BatchCreateSessionsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.session && message.session.length)) - message.session = []; - message.session.push($root.google.spanner.v1.Session.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BatchCreateSessionsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.BatchCreateSessionsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.BatchCreateSessionsResponse} BatchCreateSessionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchCreateSessionsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BatchCreateSessionsResponse message. - * @function verify - * @memberof google.spanner.v1.BatchCreateSessionsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BatchCreateSessionsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.session != null && message.hasOwnProperty("session")) { - if (!Array.isArray(message.session)) - return "session: array expected"; - for (var i = 0; i < message.session.length; ++i) { - var error = $root.google.spanner.v1.Session.verify(message.session[i]); - if (error) - return "session." + error; - } - } - return null; - }; - - /** - * Creates a BatchCreateSessionsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.BatchCreateSessionsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.BatchCreateSessionsResponse} BatchCreateSessionsResponse - */ - BatchCreateSessionsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.BatchCreateSessionsResponse) - return object; - var message = new $root.google.spanner.v1.BatchCreateSessionsResponse(); - if (object.session) { - if (!Array.isArray(object.session)) - throw TypeError(".google.spanner.v1.BatchCreateSessionsResponse.session: array expected"); - message.session = []; - for (var i = 0; i < object.session.length; ++i) { - if (typeof object.session[i] !== "object") - throw TypeError(".google.spanner.v1.BatchCreateSessionsResponse.session: object expected"); - message.session[i] = $root.google.spanner.v1.Session.fromObject(object.session[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a BatchCreateSessionsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.BatchCreateSessionsResponse - * @static - * @param {google.spanner.v1.BatchCreateSessionsResponse} message BatchCreateSessionsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BatchCreateSessionsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.session = []; - if (message.session && message.session.length) { - object.session = []; - for (var j = 0; j < message.session.length; ++j) - object.session[j] = $root.google.spanner.v1.Session.toObject(message.session[j], options); - } - return object; - }; - - /** - * Converts this BatchCreateSessionsResponse to JSON. - * @function toJSON - * @memberof google.spanner.v1.BatchCreateSessionsResponse - * @instance - * @returns {Object.} JSON object - */ - BatchCreateSessionsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BatchCreateSessionsResponse - * @function getTypeUrl - * @memberof google.spanner.v1.BatchCreateSessionsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BatchCreateSessionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.BatchCreateSessionsResponse"; - }; - - return BatchCreateSessionsResponse; - })(); - - v1.Session = (function() { - - /** - * Properties of a Session. - * @memberof google.spanner.v1 - * @interface ISession - * @property {string|null} [name] Session name - * @property {Object.|null} [labels] Session labels - * @property {google.protobuf.ITimestamp|null} [createTime] Session createTime - * @property {google.protobuf.ITimestamp|null} [approximateLastUseTime] Session approximateLastUseTime - * @property {string|null} [creatorRole] Session creatorRole - * @property {boolean|null} [multiplexed] Session multiplexed - */ - - /** - * Constructs a new Session. - * @memberof google.spanner.v1 - * @classdesc Represents a Session. - * @implements ISession - * @constructor - * @param {google.spanner.v1.ISession=} [properties] Properties to set - */ - function Session(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]]; - } - - /** - * Session name. - * @member {string} name - * @memberof google.spanner.v1.Session - * @instance - */ - Session.prototype.name = ""; - - /** - * Session labels. - * @member {Object.} labels - * @memberof google.spanner.v1.Session - * @instance - */ - Session.prototype.labels = $util.emptyObject; - - /** - * Session createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.spanner.v1.Session - * @instance - */ - Session.prototype.createTime = null; - - /** - * Session approximateLastUseTime. - * @member {google.protobuf.ITimestamp|null|undefined} approximateLastUseTime - * @memberof google.spanner.v1.Session - * @instance - */ - Session.prototype.approximateLastUseTime = null; - - /** - * Session creatorRole. - * @member {string} creatorRole - * @memberof google.spanner.v1.Session - * @instance - */ - Session.prototype.creatorRole = ""; - - /** - * Session multiplexed. - * @member {boolean} multiplexed - * @memberof google.spanner.v1.Session - * @instance - */ - Session.prototype.multiplexed = false; - - /** - * Creates a new Session instance using the specified properties. - * @function create - * @memberof google.spanner.v1.Session - * @static - * @param {google.spanner.v1.ISession=} [properties] Properties to set - * @returns {google.spanner.v1.Session} Session instance - */ - Session.create = function create(properties) { - return new Session(properties); - }; - - /** - * Encodes the specified Session message. Does not implicitly {@link google.spanner.v1.Session.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.Session - * @static - * @param {google.spanner.v1.ISession} message Session message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Session.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.approximateLastUseTime != null && Object.hasOwnProperty.call(message, "approximateLastUseTime")) - $root.google.protobuf.Timestamp.encode(message.approximateLastUseTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.creatorRole != null && Object.hasOwnProperty.call(message, "creatorRole")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.creatorRole); - if (message.multiplexed != null && Object.hasOwnProperty.call(message, "multiplexed")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.multiplexed); - return writer; - }; - - /** - * Encodes the specified Session message, length delimited. Does not implicitly {@link google.spanner.v1.Session.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.Session - * @static - * @param {google.spanner.v1.ISession} message Session message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Session.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Session message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.Session - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.Session} Session - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Session.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.Session(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.labels[key] = value; - break; - } - case 3: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 4: { - message.approximateLastUseTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 5: { - message.creatorRole = reader.string(); - break; - } - case 6: { - message.multiplexed = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Session message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.Session - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.Session} Session - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Session.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Session message. - * @function verify - * @memberof google.spanner.v1.Session - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Session.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.labels != null && message.hasOwnProperty("labels")) { - if (!$util.isObject(message.labels)) - return "labels: object expected"; - var key = Object.keys(message.labels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.labels[key[i]])) - return "labels: string{k:string} expected"; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.approximateLastUseTime != null && message.hasOwnProperty("approximateLastUseTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.approximateLastUseTime); - if (error) - return "approximateLastUseTime." + error; - } - if (message.creatorRole != null && message.hasOwnProperty("creatorRole")) - if (!$util.isString(message.creatorRole)) - return "creatorRole: string expected"; - if (message.multiplexed != null && message.hasOwnProperty("multiplexed")) - if (typeof message.multiplexed !== "boolean") - return "multiplexed: boolean expected"; - return null; - }; - - /** - * Creates a Session message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.Session - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.Session} Session - */ - Session.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.Session) - return object; - var message = new $root.google.spanner.v1.Session(); - if (object.name != null) - message.name = String(object.name); - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.spanner.v1.Session.labels: object expected"); - message.labels = {}; - for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) - message.labels[keys[i]] = String(object.labels[keys[i]]); - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.spanner.v1.Session.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.approximateLastUseTime != null) { - if (typeof object.approximateLastUseTime !== "object") - throw TypeError(".google.spanner.v1.Session.approximateLastUseTime: object expected"); - message.approximateLastUseTime = $root.google.protobuf.Timestamp.fromObject(object.approximateLastUseTime); - } - if (object.creatorRole != null) - message.creatorRole = String(object.creatorRole); - if (object.multiplexed != null) - message.multiplexed = Boolean(object.multiplexed); - return message; - }; - - /** - * Creates a plain object from a Session message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.Session - * @static - * @param {google.spanner.v1.Session} message Session - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Session.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.labels = {}; - if (options.defaults) { - object.name = ""; - object.createTime = null; - object.approximateLastUseTime = null; - object.creatorRole = ""; - object.multiplexed = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - var keys2; - if (message.labels && (keys2 = Object.keys(message.labels)).length) { - object.labels = {}; - for (var j = 0; j < keys2.length; ++j) - object.labels[keys2[j]] = message.labels[keys2[j]]; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.approximateLastUseTime != null && message.hasOwnProperty("approximateLastUseTime")) - object.approximateLastUseTime = $root.google.protobuf.Timestamp.toObject(message.approximateLastUseTime, options); - if (message.creatorRole != null && message.hasOwnProperty("creatorRole")) - object.creatorRole = message.creatorRole; - if (message.multiplexed != null && message.hasOwnProperty("multiplexed")) - object.multiplexed = message.multiplexed; - return object; - }; - - /** - * Converts this Session to JSON. - * @function toJSON - * @memberof google.spanner.v1.Session - * @instance - * @returns {Object.} JSON object - */ - Session.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Session - * @function getTypeUrl - * @memberof google.spanner.v1.Session - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Session.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.Session"; - }; - - return Session; - })(); - - v1.GetSessionRequest = (function() { - - /** - * Properties of a GetSessionRequest. - * @memberof google.spanner.v1 - * @interface IGetSessionRequest - * @property {string|null} [name] GetSessionRequest name - */ - - /** - * Constructs a new GetSessionRequest. - * @memberof google.spanner.v1 - * @classdesc Represents a GetSessionRequest. - * @implements IGetSessionRequest - * @constructor - * @param {google.spanner.v1.IGetSessionRequest=} [properties] Properties to set - */ - function GetSessionRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetSessionRequest name. - * @member {string} name - * @memberof google.spanner.v1.GetSessionRequest - * @instance - */ - GetSessionRequest.prototype.name = ""; - - /** - * Creates a new GetSessionRequest instance using the specified properties. - * @function create - * @memberof google.spanner.v1.GetSessionRequest - * @static - * @param {google.spanner.v1.IGetSessionRequest=} [properties] Properties to set - * @returns {google.spanner.v1.GetSessionRequest} GetSessionRequest instance - */ - GetSessionRequest.create = function create(properties) { - return new GetSessionRequest(properties); - }; - - /** - * Encodes the specified GetSessionRequest message. Does not implicitly {@link google.spanner.v1.GetSessionRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.GetSessionRequest - * @static - * @param {google.spanner.v1.IGetSessionRequest} message GetSessionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetSessionRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; - - /** - * Encodes the specified GetSessionRequest message, length delimited. Does not implicitly {@link google.spanner.v1.GetSessionRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.GetSessionRequest - * @static - * @param {google.spanner.v1.IGetSessionRequest} message GetSessionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetSessionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetSessionRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.GetSessionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.GetSessionRequest} GetSessionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetSessionRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.GetSessionRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetSessionRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.GetSessionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.GetSessionRequest} GetSessionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetSessionRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetSessionRequest message. - * @function verify - * @memberof google.spanner.v1.GetSessionRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetSessionRequest.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 GetSessionRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.GetSessionRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.GetSessionRequest} GetSessionRequest - */ - GetSessionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.GetSessionRequest) - return object; - var message = new $root.google.spanner.v1.GetSessionRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetSessionRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.GetSessionRequest - * @static - * @param {google.spanner.v1.GetSessionRequest} message GetSessionRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetSessionRequest.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 GetSessionRequest to JSON. - * @function toJSON - * @memberof google.spanner.v1.GetSessionRequest - * @instance - * @returns {Object.} JSON object - */ - GetSessionRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetSessionRequest - * @function getTypeUrl - * @memberof google.spanner.v1.GetSessionRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetSessionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.GetSessionRequest"; - }; - - return GetSessionRequest; - })(); - - v1.ListSessionsRequest = (function() { - - /** - * Properties of a ListSessionsRequest. - * @memberof google.spanner.v1 - * @interface IListSessionsRequest - * @property {string|null} [database] ListSessionsRequest database - * @property {number|null} [pageSize] ListSessionsRequest pageSize - * @property {string|null} [pageToken] ListSessionsRequest pageToken - * @property {string|null} [filter] ListSessionsRequest filter - */ - - /** - * Constructs a new ListSessionsRequest. - * @memberof google.spanner.v1 - * @classdesc Represents a ListSessionsRequest. - * @implements IListSessionsRequest - * @constructor - * @param {google.spanner.v1.IListSessionsRequest=} [properties] Properties to set - */ - function ListSessionsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListSessionsRequest database. - * @member {string} database - * @memberof google.spanner.v1.ListSessionsRequest - * @instance - */ - ListSessionsRequest.prototype.database = ""; - - /** - * ListSessionsRequest pageSize. - * @member {number} pageSize - * @memberof google.spanner.v1.ListSessionsRequest - * @instance - */ - ListSessionsRequest.prototype.pageSize = 0; - - /** - * ListSessionsRequest pageToken. - * @member {string} pageToken - * @memberof google.spanner.v1.ListSessionsRequest - * @instance - */ - ListSessionsRequest.prototype.pageToken = ""; - - /** - * ListSessionsRequest filter. - * @member {string} filter - * @memberof google.spanner.v1.ListSessionsRequest - * @instance - */ - ListSessionsRequest.prototype.filter = ""; - - /** - * Creates a new ListSessionsRequest instance using the specified properties. - * @function create - * @memberof google.spanner.v1.ListSessionsRequest - * @static - * @param {google.spanner.v1.IListSessionsRequest=} [properties] Properties to set - * @returns {google.spanner.v1.ListSessionsRequest} ListSessionsRequest instance - */ - ListSessionsRequest.create = function create(properties) { - return new ListSessionsRequest(properties); - }; - - /** - * Encodes the specified ListSessionsRequest message. Does not implicitly {@link google.spanner.v1.ListSessionsRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.ListSessionsRequest - * @static - * @param {google.spanner.v1.IListSessionsRequest} message ListSessionsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListSessionsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.database != null && Object.hasOwnProperty.call(message, "database")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.database); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); - return writer; - }; - - /** - * Encodes the specified ListSessionsRequest message, length delimited. Does not implicitly {@link google.spanner.v1.ListSessionsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.ListSessionsRequest - * @static - * @param {google.spanner.v1.IListSessionsRequest} message ListSessionsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListSessionsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListSessionsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.ListSessionsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.ListSessionsRequest} ListSessionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListSessionsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.ListSessionsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.database = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - case 4: { - message.filter = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListSessionsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.ListSessionsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.ListSessionsRequest} ListSessionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListSessionsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListSessionsRequest message. - * @function verify - * @memberof google.spanner.v1.ListSessionsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListSessionsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.database != null && message.hasOwnProperty("database")) - if (!$util.isString(message.database)) - return "database: 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.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - return null; - }; - - /** - * Creates a ListSessionsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.ListSessionsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.ListSessionsRequest} ListSessionsRequest - */ - ListSessionsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.ListSessionsRequest) - return object; - var message = new $root.google.spanner.v1.ListSessionsRequest(); - if (object.database != null) - message.database = String(object.database); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.filter != null) - message.filter = String(object.filter); - return message; - }; - - /** - * Creates a plain object from a ListSessionsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.ListSessionsRequest - * @static - * @param {google.spanner.v1.ListSessionsRequest} message ListSessionsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListSessionsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.database = ""; - object.pageSize = 0; - object.pageToken = ""; - object.filter = ""; - } - if (message.database != null && message.hasOwnProperty("database")) - object.database = message.database; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - return object; - }; - - /** - * Converts this ListSessionsRequest to JSON. - * @function toJSON - * @memberof google.spanner.v1.ListSessionsRequest - * @instance - * @returns {Object.} JSON object - */ - ListSessionsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListSessionsRequest - * @function getTypeUrl - * @memberof google.spanner.v1.ListSessionsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListSessionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.ListSessionsRequest"; - }; - - return ListSessionsRequest; - })(); - - v1.ListSessionsResponse = (function() { - - /** - * Properties of a ListSessionsResponse. - * @memberof google.spanner.v1 - * @interface IListSessionsResponse - * @property {Array.|null} [sessions] ListSessionsResponse sessions - * @property {string|null} [nextPageToken] ListSessionsResponse nextPageToken - */ - - /** - * Constructs a new ListSessionsResponse. - * @memberof google.spanner.v1 - * @classdesc Represents a ListSessionsResponse. - * @implements IListSessionsResponse - * @constructor - * @param {google.spanner.v1.IListSessionsResponse=} [properties] Properties to set - */ - function ListSessionsResponse(properties) { - this.sessions = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListSessionsResponse sessions. - * @member {Array.} sessions - * @memberof google.spanner.v1.ListSessionsResponse - * @instance - */ - ListSessionsResponse.prototype.sessions = $util.emptyArray; - - /** - * ListSessionsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.spanner.v1.ListSessionsResponse - * @instance - */ - ListSessionsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListSessionsResponse instance using the specified properties. - * @function create - * @memberof google.spanner.v1.ListSessionsResponse - * @static - * @param {google.spanner.v1.IListSessionsResponse=} [properties] Properties to set - * @returns {google.spanner.v1.ListSessionsResponse} ListSessionsResponse instance - */ - ListSessionsResponse.create = function create(properties) { - return new ListSessionsResponse(properties); - }; - - /** - * Encodes the specified ListSessionsResponse message. Does not implicitly {@link google.spanner.v1.ListSessionsResponse.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.ListSessionsResponse - * @static - * @param {google.spanner.v1.IListSessionsResponse} message ListSessionsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListSessionsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.sessions != null && message.sessions.length) - for (var i = 0; i < message.sessions.length; ++i) - $root.google.spanner.v1.Session.encode(message.sessions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - return writer; - }; - - /** - * Encodes the specified ListSessionsResponse message, length delimited. Does not implicitly {@link google.spanner.v1.ListSessionsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.ListSessionsResponse - * @static - * @param {google.spanner.v1.IListSessionsResponse} message ListSessionsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListSessionsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListSessionsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.ListSessionsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.ListSessionsResponse} ListSessionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListSessionsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.ListSessionsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.sessions && message.sessions.length)) - message.sessions = []; - message.sessions.push($root.google.spanner.v1.Session.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListSessionsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.ListSessionsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.ListSessionsResponse} ListSessionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListSessionsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListSessionsResponse message. - * @function verify - * @memberof google.spanner.v1.ListSessionsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListSessionsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.sessions != null && message.hasOwnProperty("sessions")) { - if (!Array.isArray(message.sessions)) - return "sessions: array expected"; - for (var i = 0; i < message.sessions.length; ++i) { - var error = $root.google.spanner.v1.Session.verify(message.sessions[i]); - if (error) - return "sessions." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListSessionsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.ListSessionsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.ListSessionsResponse} ListSessionsResponse - */ - ListSessionsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.ListSessionsResponse) - return object; - var message = new $root.google.spanner.v1.ListSessionsResponse(); - if (object.sessions) { - if (!Array.isArray(object.sessions)) - throw TypeError(".google.spanner.v1.ListSessionsResponse.sessions: array expected"); - message.sessions = []; - for (var i = 0; i < object.sessions.length; ++i) { - if (typeof object.sessions[i] !== "object") - throw TypeError(".google.spanner.v1.ListSessionsResponse.sessions: object expected"); - message.sessions[i] = $root.google.spanner.v1.Session.fromObject(object.sessions[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListSessionsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.ListSessionsResponse - * @static - * @param {google.spanner.v1.ListSessionsResponse} message ListSessionsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListSessionsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.sessions = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.sessions && message.sessions.length) { - object.sessions = []; - for (var j = 0; j < message.sessions.length; ++j) - object.sessions[j] = $root.google.spanner.v1.Session.toObject(message.sessions[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListSessionsResponse to JSON. - * @function toJSON - * @memberof google.spanner.v1.ListSessionsResponse - * @instance - * @returns {Object.} JSON object - */ - ListSessionsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListSessionsResponse - * @function getTypeUrl - * @memberof google.spanner.v1.ListSessionsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListSessionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.ListSessionsResponse"; - }; - - return ListSessionsResponse; - })(); - - v1.DeleteSessionRequest = (function() { - - /** - * Properties of a DeleteSessionRequest. - * @memberof google.spanner.v1 - * @interface IDeleteSessionRequest - * @property {string|null} [name] DeleteSessionRequest name - */ - - /** - * Constructs a new DeleteSessionRequest. - * @memberof google.spanner.v1 - * @classdesc Represents a DeleteSessionRequest. - * @implements IDeleteSessionRequest - * @constructor - * @param {google.spanner.v1.IDeleteSessionRequest=} [properties] Properties to set - */ - function DeleteSessionRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteSessionRequest name. - * @member {string} name - * @memberof google.spanner.v1.DeleteSessionRequest - * @instance - */ - DeleteSessionRequest.prototype.name = ""; - - /** - * Creates a new DeleteSessionRequest instance using the specified properties. - * @function create - * @memberof google.spanner.v1.DeleteSessionRequest - * @static - * @param {google.spanner.v1.IDeleteSessionRequest=} [properties] Properties to set - * @returns {google.spanner.v1.DeleteSessionRequest} DeleteSessionRequest instance - */ - DeleteSessionRequest.create = function create(properties) { - return new DeleteSessionRequest(properties); - }; - - /** - * Encodes the specified DeleteSessionRequest message. Does not implicitly {@link google.spanner.v1.DeleteSessionRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.DeleteSessionRequest - * @static - * @param {google.spanner.v1.IDeleteSessionRequest} message DeleteSessionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteSessionRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; - - /** - * Encodes the specified DeleteSessionRequest message, length delimited. Does not implicitly {@link google.spanner.v1.DeleteSessionRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.DeleteSessionRequest - * @static - * @param {google.spanner.v1.IDeleteSessionRequest} message DeleteSessionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteSessionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteSessionRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.DeleteSessionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.DeleteSessionRequest} DeleteSessionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteSessionRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.DeleteSessionRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteSessionRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.DeleteSessionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.DeleteSessionRequest} DeleteSessionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteSessionRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteSessionRequest message. - * @function verify - * @memberof google.spanner.v1.DeleteSessionRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteSessionRequest.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 DeleteSessionRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.DeleteSessionRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.DeleteSessionRequest} DeleteSessionRequest - */ - DeleteSessionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.DeleteSessionRequest) - return object; - var message = new $root.google.spanner.v1.DeleteSessionRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a DeleteSessionRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.DeleteSessionRequest - * @static - * @param {google.spanner.v1.DeleteSessionRequest} message DeleteSessionRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteSessionRequest.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 DeleteSessionRequest to JSON. - * @function toJSON - * @memberof google.spanner.v1.DeleteSessionRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteSessionRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteSessionRequest - * @function getTypeUrl - * @memberof google.spanner.v1.DeleteSessionRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteSessionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.DeleteSessionRequest"; - }; - - return DeleteSessionRequest; - })(); - - v1.RequestOptions = (function() { - - /** - * Properties of a RequestOptions. - * @memberof google.spanner.v1 - * @interface IRequestOptions - * @property {google.spanner.v1.RequestOptions.Priority|null} [priority] RequestOptions priority - * @property {string|null} [requestTag] RequestOptions requestTag - * @property {string|null} [transactionTag] RequestOptions transactionTag - * @property {google.spanner.v1.RequestOptions.IClientContext|null} [clientContext] RequestOptions clientContext - */ - - /** - * Constructs a new RequestOptions. - * @memberof google.spanner.v1 - * @classdesc Represents a RequestOptions. - * @implements IRequestOptions - * @constructor - * @param {google.spanner.v1.IRequestOptions=} [properties] Properties to set - */ - function RequestOptions(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RequestOptions priority. - * @member {google.spanner.v1.RequestOptions.Priority} priority - * @memberof google.spanner.v1.RequestOptions - * @instance - */ - RequestOptions.prototype.priority = 0; - - /** - * RequestOptions requestTag. - * @member {string} requestTag - * @memberof google.spanner.v1.RequestOptions - * @instance - */ - RequestOptions.prototype.requestTag = ""; - - /** - * RequestOptions transactionTag. - * @member {string} transactionTag - * @memberof google.spanner.v1.RequestOptions - * @instance - */ - RequestOptions.prototype.transactionTag = ""; - - /** - * RequestOptions clientContext. - * @member {google.spanner.v1.RequestOptions.IClientContext|null|undefined} clientContext - * @memberof google.spanner.v1.RequestOptions - * @instance - */ - RequestOptions.prototype.clientContext = null; - - /** - * Creates a new RequestOptions instance using the specified properties. - * @function create - * @memberof google.spanner.v1.RequestOptions - * @static - * @param {google.spanner.v1.IRequestOptions=} [properties] Properties to set - * @returns {google.spanner.v1.RequestOptions} RequestOptions instance - */ - RequestOptions.create = function create(properties) { - return new RequestOptions(properties); - }; - - /** - * Encodes the specified RequestOptions message. Does not implicitly {@link google.spanner.v1.RequestOptions.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.RequestOptions - * @static - * @param {google.spanner.v1.IRequestOptions} message RequestOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RequestOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.priority != null && Object.hasOwnProperty.call(message, "priority")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.priority); - if (message.requestTag != null && Object.hasOwnProperty.call(message, "requestTag")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestTag); - if (message.transactionTag != null && Object.hasOwnProperty.call(message, "transactionTag")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.transactionTag); - if (message.clientContext != null && Object.hasOwnProperty.call(message, "clientContext")) - $root.google.spanner.v1.RequestOptions.ClientContext.encode(message.clientContext, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified RequestOptions message, length delimited. Does not implicitly {@link google.spanner.v1.RequestOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.RequestOptions - * @static - * @param {google.spanner.v1.IRequestOptions} message RequestOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RequestOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RequestOptions message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.RequestOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.RequestOptions} RequestOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RequestOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.RequestOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.priority = reader.int32(); - break; - } - case 2: { - message.requestTag = reader.string(); - break; - } - case 3: { - message.transactionTag = reader.string(); - break; - } - case 4: { - message.clientContext = $root.google.spanner.v1.RequestOptions.ClientContext.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RequestOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.RequestOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.RequestOptions} RequestOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RequestOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RequestOptions message. - * @function verify - * @memberof google.spanner.v1.RequestOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RequestOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.priority != null && message.hasOwnProperty("priority")) - switch (message.priority) { - default: - return "priority: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.requestTag != null && message.hasOwnProperty("requestTag")) - if (!$util.isString(message.requestTag)) - return "requestTag: string expected"; - if (message.transactionTag != null && message.hasOwnProperty("transactionTag")) - if (!$util.isString(message.transactionTag)) - return "transactionTag: string expected"; - if (message.clientContext != null && message.hasOwnProperty("clientContext")) { - var error = $root.google.spanner.v1.RequestOptions.ClientContext.verify(message.clientContext); - if (error) - return "clientContext." + error; - } - return null; - }; - - /** - * Creates a RequestOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.RequestOptions - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.RequestOptions} RequestOptions - */ - RequestOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.RequestOptions) - return object; - var message = new $root.google.spanner.v1.RequestOptions(); - switch (object.priority) { - default: - if (typeof object.priority === "number") { - message.priority = object.priority; - break; - } - break; - case "PRIORITY_UNSPECIFIED": - case 0: - message.priority = 0; - break; - case "PRIORITY_LOW": - case 1: - message.priority = 1; - break; - case "PRIORITY_MEDIUM": - case 2: - message.priority = 2; - break; - case "PRIORITY_HIGH": - case 3: - message.priority = 3; - break; - } - if (object.requestTag != null) - message.requestTag = String(object.requestTag); - if (object.transactionTag != null) - message.transactionTag = String(object.transactionTag); - if (object.clientContext != null) { - if (typeof object.clientContext !== "object") - throw TypeError(".google.spanner.v1.RequestOptions.clientContext: object expected"); - message.clientContext = $root.google.spanner.v1.RequestOptions.ClientContext.fromObject(object.clientContext); - } - return message; - }; - - /** - * Creates a plain object from a RequestOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.RequestOptions - * @static - * @param {google.spanner.v1.RequestOptions} message RequestOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RequestOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.priority = options.enums === String ? "PRIORITY_UNSPECIFIED" : 0; - object.requestTag = ""; - object.transactionTag = ""; - object.clientContext = null; - } - if (message.priority != null && message.hasOwnProperty("priority")) - object.priority = options.enums === String ? $root.google.spanner.v1.RequestOptions.Priority[message.priority] === undefined ? message.priority : $root.google.spanner.v1.RequestOptions.Priority[message.priority] : message.priority; - if (message.requestTag != null && message.hasOwnProperty("requestTag")) - object.requestTag = message.requestTag; - if (message.transactionTag != null && message.hasOwnProperty("transactionTag")) - object.transactionTag = message.transactionTag; - if (message.clientContext != null && message.hasOwnProperty("clientContext")) - object.clientContext = $root.google.spanner.v1.RequestOptions.ClientContext.toObject(message.clientContext, options); - return object; - }; - - /** - * Converts this RequestOptions to JSON. - * @function toJSON - * @memberof google.spanner.v1.RequestOptions - * @instance - * @returns {Object.} JSON object - */ - RequestOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RequestOptions - * @function getTypeUrl - * @memberof google.spanner.v1.RequestOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RequestOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.RequestOptions"; - }; - - /** - * Priority enum. - * @name google.spanner.v1.RequestOptions.Priority - * @enum {number} - * @property {number} PRIORITY_UNSPECIFIED=0 PRIORITY_UNSPECIFIED value - * @property {number} PRIORITY_LOW=1 PRIORITY_LOW value - * @property {number} PRIORITY_MEDIUM=2 PRIORITY_MEDIUM value - * @property {number} PRIORITY_HIGH=3 PRIORITY_HIGH value - */ - RequestOptions.Priority = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "PRIORITY_UNSPECIFIED"] = 0; - values[valuesById[1] = "PRIORITY_LOW"] = 1; - values[valuesById[2] = "PRIORITY_MEDIUM"] = 2; - values[valuesById[3] = "PRIORITY_HIGH"] = 3; - return values; - })(); - - RequestOptions.ClientContext = (function() { - - /** - * Properties of a ClientContext. - * @memberof google.spanner.v1.RequestOptions - * @interface IClientContext - * @property {Object.|null} [secureContext] ClientContext secureContext - */ - - /** - * Constructs a new ClientContext. - * @memberof google.spanner.v1.RequestOptions - * @classdesc Represents a ClientContext. - * @implements IClientContext - * @constructor - * @param {google.spanner.v1.RequestOptions.IClientContext=} [properties] Properties to set - */ - function ClientContext(properties) { - this.secureContext = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ClientContext secureContext. - * @member {Object.} secureContext - * @memberof google.spanner.v1.RequestOptions.ClientContext - * @instance - */ - ClientContext.prototype.secureContext = $util.emptyObject; - - /** - * Creates a new ClientContext instance using the specified properties. - * @function create - * @memberof google.spanner.v1.RequestOptions.ClientContext - * @static - * @param {google.spanner.v1.RequestOptions.IClientContext=} [properties] Properties to set - * @returns {google.spanner.v1.RequestOptions.ClientContext} ClientContext instance - */ - ClientContext.create = function create(properties) { - return new ClientContext(properties); - }; - - /** - * Encodes the specified ClientContext message. Does not implicitly {@link google.spanner.v1.RequestOptions.ClientContext.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.RequestOptions.ClientContext - * @static - * @param {google.spanner.v1.RequestOptions.IClientContext} message ClientContext message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClientContext.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.secureContext != null && Object.hasOwnProperty.call(message, "secureContext")) - for (var keys = Object.keys(message.secureContext), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.protobuf.Value.encode(message.secureContext[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - return writer; - }; - - /** - * Encodes the specified ClientContext message, length delimited. Does not implicitly {@link google.spanner.v1.RequestOptions.ClientContext.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.RequestOptions.ClientContext - * @static - * @param {google.spanner.v1.RequestOptions.IClientContext} message ClientContext message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClientContext.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ClientContext message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.RequestOptions.ClientContext - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.RequestOptions.ClientContext} ClientContext - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClientContext.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.RequestOptions.ClientContext(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (message.secureContext === $util.emptyObject) - message.secureContext = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = null; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = $root.google.protobuf.Value.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.secureContext[key] = value; - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ClientContext message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.RequestOptions.ClientContext - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.RequestOptions.ClientContext} ClientContext - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClientContext.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ClientContext message. - * @function verify - * @memberof google.spanner.v1.RequestOptions.ClientContext - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ClientContext.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.secureContext != null && message.hasOwnProperty("secureContext")) { - if (!$util.isObject(message.secureContext)) - return "secureContext: object expected"; - var key = Object.keys(message.secureContext); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.protobuf.Value.verify(message.secureContext[key[i]]); - if (error) - return "secureContext." + error; - } - } - return null; - }; - - /** - * Creates a ClientContext message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.RequestOptions.ClientContext - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.RequestOptions.ClientContext} ClientContext - */ - ClientContext.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.RequestOptions.ClientContext) - return object; - var message = new $root.google.spanner.v1.RequestOptions.ClientContext(); - if (object.secureContext) { - if (typeof object.secureContext !== "object") - throw TypeError(".google.spanner.v1.RequestOptions.ClientContext.secureContext: object expected"); - message.secureContext = {}; - for (var keys = Object.keys(object.secureContext), i = 0; i < keys.length; ++i) { - if (typeof object.secureContext[keys[i]] !== "object") - throw TypeError(".google.spanner.v1.RequestOptions.ClientContext.secureContext: object expected"); - message.secureContext[keys[i]] = $root.google.protobuf.Value.fromObject(object.secureContext[keys[i]]); - } - } - return message; - }; - - /** - * Creates a plain object from a ClientContext message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.RequestOptions.ClientContext - * @static - * @param {google.spanner.v1.RequestOptions.ClientContext} message ClientContext - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ClientContext.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.secureContext = {}; - var keys2; - if (message.secureContext && (keys2 = Object.keys(message.secureContext)).length) { - object.secureContext = {}; - for (var j = 0; j < keys2.length; ++j) - object.secureContext[keys2[j]] = $root.google.protobuf.Value.toObject(message.secureContext[keys2[j]], options); - } - return object; - }; - - /** - * Converts this ClientContext to JSON. - * @function toJSON - * @memberof google.spanner.v1.RequestOptions.ClientContext - * @instance - * @returns {Object.} JSON object - */ - ClientContext.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ClientContext - * @function getTypeUrl - * @memberof google.spanner.v1.RequestOptions.ClientContext - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ClientContext.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.RequestOptions.ClientContext"; - }; - - return ClientContext; - })(); - - return RequestOptions; - })(); - - v1.DirectedReadOptions = (function() { - - /** - * Properties of a DirectedReadOptions. - * @memberof google.spanner.v1 - * @interface IDirectedReadOptions - * @property {google.spanner.v1.DirectedReadOptions.IIncludeReplicas|null} [includeReplicas] DirectedReadOptions includeReplicas - * @property {google.spanner.v1.DirectedReadOptions.IExcludeReplicas|null} [excludeReplicas] DirectedReadOptions excludeReplicas - */ - - /** - * Constructs a new DirectedReadOptions. - * @memberof google.spanner.v1 - * @classdesc Represents a DirectedReadOptions. - * @implements IDirectedReadOptions - * @constructor - * @param {google.spanner.v1.IDirectedReadOptions=} [properties] Properties to set - */ - function DirectedReadOptions(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DirectedReadOptions includeReplicas. - * @member {google.spanner.v1.DirectedReadOptions.IIncludeReplicas|null|undefined} includeReplicas - * @memberof google.spanner.v1.DirectedReadOptions - * @instance - */ - DirectedReadOptions.prototype.includeReplicas = null; - - /** - * DirectedReadOptions excludeReplicas. - * @member {google.spanner.v1.DirectedReadOptions.IExcludeReplicas|null|undefined} excludeReplicas - * @memberof google.spanner.v1.DirectedReadOptions - * @instance - */ - DirectedReadOptions.prototype.excludeReplicas = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * DirectedReadOptions replicas. - * @member {"includeReplicas"|"excludeReplicas"|undefined} replicas - * @memberof google.spanner.v1.DirectedReadOptions - * @instance - */ - Object.defineProperty(DirectedReadOptions.prototype, "replicas", { - get: $util.oneOfGetter($oneOfFields = ["includeReplicas", "excludeReplicas"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new DirectedReadOptions instance using the specified properties. - * @function create - * @memberof google.spanner.v1.DirectedReadOptions - * @static - * @param {google.spanner.v1.IDirectedReadOptions=} [properties] Properties to set - * @returns {google.spanner.v1.DirectedReadOptions} DirectedReadOptions instance - */ - DirectedReadOptions.create = function create(properties) { - return new DirectedReadOptions(properties); - }; - - /** - * Encodes the specified DirectedReadOptions message. Does not implicitly {@link google.spanner.v1.DirectedReadOptions.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.DirectedReadOptions - * @static - * @param {google.spanner.v1.IDirectedReadOptions} message DirectedReadOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DirectedReadOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.includeReplicas != null && Object.hasOwnProperty.call(message, "includeReplicas")) - $root.google.spanner.v1.DirectedReadOptions.IncludeReplicas.encode(message.includeReplicas, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.excludeReplicas != null && Object.hasOwnProperty.call(message, "excludeReplicas")) - $root.google.spanner.v1.DirectedReadOptions.ExcludeReplicas.encode(message.excludeReplicas, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified DirectedReadOptions message, length delimited. Does not implicitly {@link google.spanner.v1.DirectedReadOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.DirectedReadOptions - * @static - * @param {google.spanner.v1.IDirectedReadOptions} message DirectedReadOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DirectedReadOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DirectedReadOptions message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.DirectedReadOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.DirectedReadOptions} DirectedReadOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DirectedReadOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.DirectedReadOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.includeReplicas = $root.google.spanner.v1.DirectedReadOptions.IncludeReplicas.decode(reader, reader.uint32()); - break; - } - case 2: { - message.excludeReplicas = $root.google.spanner.v1.DirectedReadOptions.ExcludeReplicas.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DirectedReadOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.DirectedReadOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.DirectedReadOptions} DirectedReadOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DirectedReadOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DirectedReadOptions message. - * @function verify - * @memberof google.spanner.v1.DirectedReadOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DirectedReadOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.includeReplicas != null && message.hasOwnProperty("includeReplicas")) { - properties.replicas = 1; - { - var error = $root.google.spanner.v1.DirectedReadOptions.IncludeReplicas.verify(message.includeReplicas); - if (error) - return "includeReplicas." + error; - } - } - if (message.excludeReplicas != null && message.hasOwnProperty("excludeReplicas")) { - if (properties.replicas === 1) - return "replicas: multiple values"; - properties.replicas = 1; - { - var error = $root.google.spanner.v1.DirectedReadOptions.ExcludeReplicas.verify(message.excludeReplicas); - if (error) - return "excludeReplicas." + error; - } - } - return null; - }; - - /** - * Creates a DirectedReadOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.DirectedReadOptions - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.DirectedReadOptions} DirectedReadOptions - */ - DirectedReadOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.DirectedReadOptions) - return object; - var message = new $root.google.spanner.v1.DirectedReadOptions(); - if (object.includeReplicas != null) { - if (typeof object.includeReplicas !== "object") - throw TypeError(".google.spanner.v1.DirectedReadOptions.includeReplicas: object expected"); - message.includeReplicas = $root.google.spanner.v1.DirectedReadOptions.IncludeReplicas.fromObject(object.includeReplicas); - } - if (object.excludeReplicas != null) { - if (typeof object.excludeReplicas !== "object") - throw TypeError(".google.spanner.v1.DirectedReadOptions.excludeReplicas: object expected"); - message.excludeReplicas = $root.google.spanner.v1.DirectedReadOptions.ExcludeReplicas.fromObject(object.excludeReplicas); - } - return message; - }; - - /** - * Creates a plain object from a DirectedReadOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.DirectedReadOptions - * @static - * @param {google.spanner.v1.DirectedReadOptions} message DirectedReadOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DirectedReadOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.includeReplicas != null && message.hasOwnProperty("includeReplicas")) { - object.includeReplicas = $root.google.spanner.v1.DirectedReadOptions.IncludeReplicas.toObject(message.includeReplicas, options); - if (options.oneofs) - object.replicas = "includeReplicas"; - } - if (message.excludeReplicas != null && message.hasOwnProperty("excludeReplicas")) { - object.excludeReplicas = $root.google.spanner.v1.DirectedReadOptions.ExcludeReplicas.toObject(message.excludeReplicas, options); - if (options.oneofs) - object.replicas = "excludeReplicas"; - } - return object; - }; - - /** - * Converts this DirectedReadOptions to JSON. - * @function toJSON - * @memberof google.spanner.v1.DirectedReadOptions - * @instance - * @returns {Object.} JSON object - */ - DirectedReadOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DirectedReadOptions - * @function getTypeUrl - * @memberof google.spanner.v1.DirectedReadOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DirectedReadOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.DirectedReadOptions"; - }; - - DirectedReadOptions.ReplicaSelection = (function() { - - /** - * Properties of a ReplicaSelection. - * @memberof google.spanner.v1.DirectedReadOptions - * @interface IReplicaSelection - * @property {string|null} [location] ReplicaSelection location - * @property {google.spanner.v1.DirectedReadOptions.ReplicaSelection.Type|null} [type] ReplicaSelection type - */ - - /** - * Constructs a new ReplicaSelection. - * @memberof google.spanner.v1.DirectedReadOptions - * @classdesc Represents a ReplicaSelection. - * @implements IReplicaSelection - * @constructor - * @param {google.spanner.v1.DirectedReadOptions.IReplicaSelection=} [properties] Properties to set - */ - function ReplicaSelection(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ReplicaSelection location. - * @member {string} location - * @memberof google.spanner.v1.DirectedReadOptions.ReplicaSelection - * @instance - */ - ReplicaSelection.prototype.location = ""; - - /** - * ReplicaSelection type. - * @member {google.spanner.v1.DirectedReadOptions.ReplicaSelection.Type} type - * @memberof google.spanner.v1.DirectedReadOptions.ReplicaSelection - * @instance - */ - ReplicaSelection.prototype.type = 0; - - /** - * Creates a new ReplicaSelection instance using the specified properties. - * @function create - * @memberof google.spanner.v1.DirectedReadOptions.ReplicaSelection - * @static - * @param {google.spanner.v1.DirectedReadOptions.IReplicaSelection=} [properties] Properties to set - * @returns {google.spanner.v1.DirectedReadOptions.ReplicaSelection} ReplicaSelection instance - */ - ReplicaSelection.create = function create(properties) { - return new ReplicaSelection(properties); - }; - - /** - * Encodes the specified ReplicaSelection message. Does not implicitly {@link google.spanner.v1.DirectedReadOptions.ReplicaSelection.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.DirectedReadOptions.ReplicaSelection - * @static - * @param {google.spanner.v1.DirectedReadOptions.IReplicaSelection} message ReplicaSelection message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReplicaSelection.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.location != null && Object.hasOwnProperty.call(message, "location")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.location); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.type); - return writer; - }; - - /** - * Encodes the specified ReplicaSelection message, length delimited. Does not implicitly {@link google.spanner.v1.DirectedReadOptions.ReplicaSelection.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.DirectedReadOptions.ReplicaSelection - * @static - * @param {google.spanner.v1.DirectedReadOptions.IReplicaSelection} message ReplicaSelection message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReplicaSelection.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ReplicaSelection message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.DirectedReadOptions.ReplicaSelection - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.DirectedReadOptions.ReplicaSelection} ReplicaSelection - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReplicaSelection.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.DirectedReadOptions.ReplicaSelection(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.location = reader.string(); - break; - } - case 2: { - message.type = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ReplicaSelection message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.DirectedReadOptions.ReplicaSelection - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.DirectedReadOptions.ReplicaSelection} ReplicaSelection - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReplicaSelection.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ReplicaSelection message. - * @function verify - * @memberof google.spanner.v1.DirectedReadOptions.ReplicaSelection - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ReplicaSelection.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.location != null && message.hasOwnProperty("location")) - if (!$util.isString(message.location)) - return "location: string expected"; - if (message.type != null && message.hasOwnProperty("type")) - switch (message.type) { - default: - return "type: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a ReplicaSelection message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.DirectedReadOptions.ReplicaSelection - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.DirectedReadOptions.ReplicaSelection} ReplicaSelection - */ - ReplicaSelection.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.DirectedReadOptions.ReplicaSelection) - return object; - var message = new $root.google.spanner.v1.DirectedReadOptions.ReplicaSelection(); - if (object.location != null) - message.location = String(object.location); - switch (object.type) { - default: - if (typeof object.type === "number") { - message.type = object.type; - break; - } - break; - case "TYPE_UNSPECIFIED": - case 0: - message.type = 0; - break; - case "READ_WRITE": - case 1: - message.type = 1; - break; - case "READ_ONLY": - case 2: - message.type = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a ReplicaSelection message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.DirectedReadOptions.ReplicaSelection - * @static - * @param {google.spanner.v1.DirectedReadOptions.ReplicaSelection} message ReplicaSelection - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ReplicaSelection.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.location = ""; - object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; - } - if (message.location != null && message.hasOwnProperty("location")) - object.location = message.location; - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.spanner.v1.DirectedReadOptions.ReplicaSelection.Type[message.type] === undefined ? message.type : $root.google.spanner.v1.DirectedReadOptions.ReplicaSelection.Type[message.type] : message.type; - return object; - }; - - /** - * Converts this ReplicaSelection to JSON. - * @function toJSON - * @memberof google.spanner.v1.DirectedReadOptions.ReplicaSelection - * @instance - * @returns {Object.} JSON object - */ - ReplicaSelection.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ReplicaSelection - * @function getTypeUrl - * @memberof google.spanner.v1.DirectedReadOptions.ReplicaSelection - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ReplicaSelection.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.DirectedReadOptions.ReplicaSelection"; - }; - - /** - * Type enum. - * @name google.spanner.v1.DirectedReadOptions.ReplicaSelection.Type - * @enum {number} - * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value - * @property {number} READ_WRITE=1 READ_WRITE value - * @property {number} READ_ONLY=2 READ_ONLY value - */ - ReplicaSelection.Type = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "READ_WRITE"] = 1; - values[valuesById[2] = "READ_ONLY"] = 2; - return values; - })(); - - return ReplicaSelection; - })(); - - DirectedReadOptions.IncludeReplicas = (function() { - - /** - * Properties of an IncludeReplicas. - * @memberof google.spanner.v1.DirectedReadOptions - * @interface IIncludeReplicas - * @property {Array.|null} [replicaSelections] IncludeReplicas replicaSelections - * @property {boolean|null} [autoFailoverDisabled] IncludeReplicas autoFailoverDisabled - */ - - /** - * Constructs a new IncludeReplicas. - * @memberof google.spanner.v1.DirectedReadOptions - * @classdesc Represents an IncludeReplicas. - * @implements IIncludeReplicas - * @constructor - * @param {google.spanner.v1.DirectedReadOptions.IIncludeReplicas=} [properties] Properties to set - */ - function IncludeReplicas(properties) { - this.replicaSelections = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * IncludeReplicas replicaSelections. - * @member {Array.} replicaSelections - * @memberof google.spanner.v1.DirectedReadOptions.IncludeReplicas - * @instance - */ - IncludeReplicas.prototype.replicaSelections = $util.emptyArray; - - /** - * IncludeReplicas autoFailoverDisabled. - * @member {boolean} autoFailoverDisabled - * @memberof google.spanner.v1.DirectedReadOptions.IncludeReplicas - * @instance - */ - IncludeReplicas.prototype.autoFailoverDisabled = false; - - /** - * Creates a new IncludeReplicas instance using the specified properties. - * @function create - * @memberof google.spanner.v1.DirectedReadOptions.IncludeReplicas - * @static - * @param {google.spanner.v1.DirectedReadOptions.IIncludeReplicas=} [properties] Properties to set - * @returns {google.spanner.v1.DirectedReadOptions.IncludeReplicas} IncludeReplicas instance - */ - IncludeReplicas.create = function create(properties) { - return new IncludeReplicas(properties); - }; - - /** - * Encodes the specified IncludeReplicas message. Does not implicitly {@link google.spanner.v1.DirectedReadOptions.IncludeReplicas.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.DirectedReadOptions.IncludeReplicas - * @static - * @param {google.spanner.v1.DirectedReadOptions.IIncludeReplicas} message IncludeReplicas message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IncludeReplicas.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.replicaSelections != null && message.replicaSelections.length) - for (var i = 0; i < message.replicaSelections.length; ++i) - $root.google.spanner.v1.DirectedReadOptions.ReplicaSelection.encode(message.replicaSelections[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.autoFailoverDisabled != null && Object.hasOwnProperty.call(message, "autoFailoverDisabled")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.autoFailoverDisabled); - return writer; - }; - - /** - * Encodes the specified IncludeReplicas message, length delimited. Does not implicitly {@link google.spanner.v1.DirectedReadOptions.IncludeReplicas.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.DirectedReadOptions.IncludeReplicas - * @static - * @param {google.spanner.v1.DirectedReadOptions.IIncludeReplicas} message IncludeReplicas message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IncludeReplicas.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an IncludeReplicas message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.DirectedReadOptions.IncludeReplicas - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.DirectedReadOptions.IncludeReplicas} IncludeReplicas - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IncludeReplicas.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.DirectedReadOptions.IncludeReplicas(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.replicaSelections && message.replicaSelections.length)) - message.replicaSelections = []; - message.replicaSelections.push($root.google.spanner.v1.DirectedReadOptions.ReplicaSelection.decode(reader, reader.uint32())); - break; - } - case 2: { - message.autoFailoverDisabled = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an IncludeReplicas message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.DirectedReadOptions.IncludeReplicas - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.DirectedReadOptions.IncludeReplicas} IncludeReplicas - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IncludeReplicas.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an IncludeReplicas message. - * @function verify - * @memberof google.spanner.v1.DirectedReadOptions.IncludeReplicas - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - IncludeReplicas.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.replicaSelections != null && message.hasOwnProperty("replicaSelections")) { - if (!Array.isArray(message.replicaSelections)) - return "replicaSelections: array expected"; - for (var i = 0; i < message.replicaSelections.length; ++i) { - var error = $root.google.spanner.v1.DirectedReadOptions.ReplicaSelection.verify(message.replicaSelections[i]); - if (error) - return "replicaSelections." + error; - } - } - if (message.autoFailoverDisabled != null && message.hasOwnProperty("autoFailoverDisabled")) - if (typeof message.autoFailoverDisabled !== "boolean") - return "autoFailoverDisabled: boolean expected"; - return null; - }; - - /** - * Creates an IncludeReplicas message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.DirectedReadOptions.IncludeReplicas - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.DirectedReadOptions.IncludeReplicas} IncludeReplicas - */ - IncludeReplicas.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.DirectedReadOptions.IncludeReplicas) - return object; - var message = new $root.google.spanner.v1.DirectedReadOptions.IncludeReplicas(); - if (object.replicaSelections) { - if (!Array.isArray(object.replicaSelections)) - throw TypeError(".google.spanner.v1.DirectedReadOptions.IncludeReplicas.replicaSelections: array expected"); - message.replicaSelections = []; - for (var i = 0; i < object.replicaSelections.length; ++i) { - if (typeof object.replicaSelections[i] !== "object") - throw TypeError(".google.spanner.v1.DirectedReadOptions.IncludeReplicas.replicaSelections: object expected"); - message.replicaSelections[i] = $root.google.spanner.v1.DirectedReadOptions.ReplicaSelection.fromObject(object.replicaSelections[i]); - } - } - if (object.autoFailoverDisabled != null) - message.autoFailoverDisabled = Boolean(object.autoFailoverDisabled); - return message; - }; - - /** - * Creates a plain object from an IncludeReplicas message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.DirectedReadOptions.IncludeReplicas - * @static - * @param {google.spanner.v1.DirectedReadOptions.IncludeReplicas} message IncludeReplicas - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - IncludeReplicas.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.replicaSelections = []; - if (options.defaults) - object.autoFailoverDisabled = false; - if (message.replicaSelections && message.replicaSelections.length) { - object.replicaSelections = []; - for (var j = 0; j < message.replicaSelections.length; ++j) - object.replicaSelections[j] = $root.google.spanner.v1.DirectedReadOptions.ReplicaSelection.toObject(message.replicaSelections[j], options); - } - if (message.autoFailoverDisabled != null && message.hasOwnProperty("autoFailoverDisabled")) - object.autoFailoverDisabled = message.autoFailoverDisabled; - return object; - }; - - /** - * Converts this IncludeReplicas to JSON. - * @function toJSON - * @memberof google.spanner.v1.DirectedReadOptions.IncludeReplicas - * @instance - * @returns {Object.} JSON object - */ - IncludeReplicas.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for IncludeReplicas - * @function getTypeUrl - * @memberof google.spanner.v1.DirectedReadOptions.IncludeReplicas - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - IncludeReplicas.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.DirectedReadOptions.IncludeReplicas"; - }; - - return IncludeReplicas; - })(); - - DirectedReadOptions.ExcludeReplicas = (function() { - - /** - * Properties of an ExcludeReplicas. - * @memberof google.spanner.v1.DirectedReadOptions - * @interface IExcludeReplicas - * @property {Array.|null} [replicaSelections] ExcludeReplicas replicaSelections - */ - - /** - * Constructs a new ExcludeReplicas. - * @memberof google.spanner.v1.DirectedReadOptions - * @classdesc Represents an ExcludeReplicas. - * @implements IExcludeReplicas - * @constructor - * @param {google.spanner.v1.DirectedReadOptions.IExcludeReplicas=} [properties] Properties to set - */ - function ExcludeReplicas(properties) { - this.replicaSelections = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExcludeReplicas replicaSelections. - * @member {Array.} replicaSelections - * @memberof google.spanner.v1.DirectedReadOptions.ExcludeReplicas - * @instance - */ - ExcludeReplicas.prototype.replicaSelections = $util.emptyArray; - - /** - * Creates a new ExcludeReplicas instance using the specified properties. - * @function create - * @memberof google.spanner.v1.DirectedReadOptions.ExcludeReplicas - * @static - * @param {google.spanner.v1.DirectedReadOptions.IExcludeReplicas=} [properties] Properties to set - * @returns {google.spanner.v1.DirectedReadOptions.ExcludeReplicas} ExcludeReplicas instance - */ - ExcludeReplicas.create = function create(properties) { - return new ExcludeReplicas(properties); - }; - - /** - * Encodes the specified ExcludeReplicas message. Does not implicitly {@link google.spanner.v1.DirectedReadOptions.ExcludeReplicas.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.DirectedReadOptions.ExcludeReplicas - * @static - * @param {google.spanner.v1.DirectedReadOptions.IExcludeReplicas} message ExcludeReplicas message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExcludeReplicas.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.replicaSelections != null && message.replicaSelections.length) - for (var i = 0; i < message.replicaSelections.length; ++i) - $root.google.spanner.v1.DirectedReadOptions.ReplicaSelection.encode(message.replicaSelections[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ExcludeReplicas message, length delimited. Does not implicitly {@link google.spanner.v1.DirectedReadOptions.ExcludeReplicas.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.DirectedReadOptions.ExcludeReplicas - * @static - * @param {google.spanner.v1.DirectedReadOptions.IExcludeReplicas} message ExcludeReplicas message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExcludeReplicas.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExcludeReplicas message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.DirectedReadOptions.ExcludeReplicas - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.DirectedReadOptions.ExcludeReplicas} ExcludeReplicas - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExcludeReplicas.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.DirectedReadOptions.ExcludeReplicas(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.replicaSelections && message.replicaSelections.length)) - message.replicaSelections = []; - message.replicaSelections.push($root.google.spanner.v1.DirectedReadOptions.ReplicaSelection.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExcludeReplicas message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.DirectedReadOptions.ExcludeReplicas - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.DirectedReadOptions.ExcludeReplicas} ExcludeReplicas - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExcludeReplicas.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExcludeReplicas message. - * @function verify - * @memberof google.spanner.v1.DirectedReadOptions.ExcludeReplicas - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExcludeReplicas.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.replicaSelections != null && message.hasOwnProperty("replicaSelections")) { - if (!Array.isArray(message.replicaSelections)) - return "replicaSelections: array expected"; - for (var i = 0; i < message.replicaSelections.length; ++i) { - var error = $root.google.spanner.v1.DirectedReadOptions.ReplicaSelection.verify(message.replicaSelections[i]); - if (error) - return "replicaSelections." + error; - } - } - return null; - }; - - /** - * Creates an ExcludeReplicas message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.DirectedReadOptions.ExcludeReplicas - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.DirectedReadOptions.ExcludeReplicas} ExcludeReplicas - */ - ExcludeReplicas.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.DirectedReadOptions.ExcludeReplicas) - return object; - var message = new $root.google.spanner.v1.DirectedReadOptions.ExcludeReplicas(); - if (object.replicaSelections) { - if (!Array.isArray(object.replicaSelections)) - throw TypeError(".google.spanner.v1.DirectedReadOptions.ExcludeReplicas.replicaSelections: array expected"); - message.replicaSelections = []; - for (var i = 0; i < object.replicaSelections.length; ++i) { - if (typeof object.replicaSelections[i] !== "object") - throw TypeError(".google.spanner.v1.DirectedReadOptions.ExcludeReplicas.replicaSelections: object expected"); - message.replicaSelections[i] = $root.google.spanner.v1.DirectedReadOptions.ReplicaSelection.fromObject(object.replicaSelections[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an ExcludeReplicas message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.DirectedReadOptions.ExcludeReplicas - * @static - * @param {google.spanner.v1.DirectedReadOptions.ExcludeReplicas} message ExcludeReplicas - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExcludeReplicas.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.replicaSelections = []; - if (message.replicaSelections && message.replicaSelections.length) { - object.replicaSelections = []; - for (var j = 0; j < message.replicaSelections.length; ++j) - object.replicaSelections[j] = $root.google.spanner.v1.DirectedReadOptions.ReplicaSelection.toObject(message.replicaSelections[j], options); - } - return object; - }; - - /** - * Converts this ExcludeReplicas to JSON. - * @function toJSON - * @memberof google.spanner.v1.DirectedReadOptions.ExcludeReplicas - * @instance - * @returns {Object.} JSON object - */ - ExcludeReplicas.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExcludeReplicas - * @function getTypeUrl - * @memberof google.spanner.v1.DirectedReadOptions.ExcludeReplicas - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExcludeReplicas.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.DirectedReadOptions.ExcludeReplicas"; - }; - - return ExcludeReplicas; - })(); - - return DirectedReadOptions; - })(); - - v1.ExecuteSqlRequest = (function() { - - /** - * Properties of an ExecuteSqlRequest. - * @memberof google.spanner.v1 - * @interface IExecuteSqlRequest - * @property {string|null} [session] ExecuteSqlRequest session - * @property {google.spanner.v1.ITransactionSelector|null} [transaction] ExecuteSqlRequest transaction - * @property {string|null} [sql] ExecuteSqlRequest sql - * @property {google.protobuf.IStruct|null} [params] ExecuteSqlRequest params - * @property {Object.|null} [paramTypes] ExecuteSqlRequest paramTypes - * @property {Uint8Array|null} [resumeToken] ExecuteSqlRequest resumeToken - * @property {google.spanner.v1.ExecuteSqlRequest.QueryMode|null} [queryMode] ExecuteSqlRequest queryMode - * @property {Uint8Array|null} [partitionToken] ExecuteSqlRequest partitionToken - * @property {number|Long|null} [seqno] ExecuteSqlRequest seqno - * @property {google.spanner.v1.ExecuteSqlRequest.IQueryOptions|null} [queryOptions] ExecuteSqlRequest queryOptions - * @property {google.spanner.v1.IRequestOptions|null} [requestOptions] ExecuteSqlRequest requestOptions - * @property {google.spanner.v1.IDirectedReadOptions|null} [directedReadOptions] ExecuteSqlRequest directedReadOptions - * @property {boolean|null} [dataBoostEnabled] ExecuteSqlRequest dataBoostEnabled - * @property {boolean|null} [lastStatement] ExecuteSqlRequest lastStatement - * @property {google.spanner.v1.IRoutingHint|null} [routingHint] ExecuteSqlRequest routingHint - */ - - /** - * Constructs a new ExecuteSqlRequest. - * @memberof google.spanner.v1 - * @classdesc Represents an ExecuteSqlRequest. - * @implements IExecuteSqlRequest - * @constructor - * @param {google.spanner.v1.IExecuteSqlRequest=} [properties] Properties to set - */ - function ExecuteSqlRequest(properties) { - this.paramTypes = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExecuteSqlRequest session. - * @member {string} session - * @memberof google.spanner.v1.ExecuteSqlRequest - * @instance - */ - ExecuteSqlRequest.prototype.session = ""; - - /** - * ExecuteSqlRequest transaction. - * @member {google.spanner.v1.ITransactionSelector|null|undefined} transaction - * @memberof google.spanner.v1.ExecuteSqlRequest - * @instance - */ - ExecuteSqlRequest.prototype.transaction = null; - - /** - * ExecuteSqlRequest sql. - * @member {string} sql - * @memberof google.spanner.v1.ExecuteSqlRequest - * @instance - */ - ExecuteSqlRequest.prototype.sql = ""; - - /** - * ExecuteSqlRequest params. - * @member {google.protobuf.IStruct|null|undefined} params - * @memberof google.spanner.v1.ExecuteSqlRequest - * @instance - */ - ExecuteSqlRequest.prototype.params = null; - - /** - * ExecuteSqlRequest paramTypes. - * @member {Object.} paramTypes - * @memberof google.spanner.v1.ExecuteSqlRequest - * @instance - */ - ExecuteSqlRequest.prototype.paramTypes = $util.emptyObject; - - /** - * ExecuteSqlRequest resumeToken. - * @member {Uint8Array} resumeToken - * @memberof google.spanner.v1.ExecuteSqlRequest - * @instance - */ - ExecuteSqlRequest.prototype.resumeToken = $util.newBuffer([]); - - /** - * ExecuteSqlRequest queryMode. - * @member {google.spanner.v1.ExecuteSqlRequest.QueryMode} queryMode - * @memberof google.spanner.v1.ExecuteSqlRequest - * @instance - */ - ExecuteSqlRequest.prototype.queryMode = 0; - - /** - * ExecuteSqlRequest partitionToken. - * @member {Uint8Array} partitionToken - * @memberof google.spanner.v1.ExecuteSqlRequest - * @instance - */ - ExecuteSqlRequest.prototype.partitionToken = $util.newBuffer([]); - - /** - * ExecuteSqlRequest seqno. - * @member {number|Long} seqno - * @memberof google.spanner.v1.ExecuteSqlRequest - * @instance - */ - ExecuteSqlRequest.prototype.seqno = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * ExecuteSqlRequest queryOptions. - * @member {google.spanner.v1.ExecuteSqlRequest.IQueryOptions|null|undefined} queryOptions - * @memberof google.spanner.v1.ExecuteSqlRequest - * @instance - */ - ExecuteSqlRequest.prototype.queryOptions = null; - - /** - * ExecuteSqlRequest requestOptions. - * @member {google.spanner.v1.IRequestOptions|null|undefined} requestOptions - * @memberof google.spanner.v1.ExecuteSqlRequest - * @instance - */ - ExecuteSqlRequest.prototype.requestOptions = null; - - /** - * ExecuteSqlRequest directedReadOptions. - * @member {google.spanner.v1.IDirectedReadOptions|null|undefined} directedReadOptions - * @memberof google.spanner.v1.ExecuteSqlRequest - * @instance - */ - ExecuteSqlRequest.prototype.directedReadOptions = null; - - /** - * ExecuteSqlRequest dataBoostEnabled. - * @member {boolean} dataBoostEnabled - * @memberof google.spanner.v1.ExecuteSqlRequest - * @instance - */ - ExecuteSqlRequest.prototype.dataBoostEnabled = false; - - /** - * ExecuteSqlRequest lastStatement. - * @member {boolean} lastStatement - * @memberof google.spanner.v1.ExecuteSqlRequest - * @instance - */ - ExecuteSqlRequest.prototype.lastStatement = false; - - /** - * ExecuteSqlRequest routingHint. - * @member {google.spanner.v1.IRoutingHint|null|undefined} routingHint - * @memberof google.spanner.v1.ExecuteSqlRequest - * @instance - */ - ExecuteSqlRequest.prototype.routingHint = null; - - /** - * Creates a new ExecuteSqlRequest instance using the specified properties. - * @function create - * @memberof google.spanner.v1.ExecuteSqlRequest - * @static - * @param {google.spanner.v1.IExecuteSqlRequest=} [properties] Properties to set - * @returns {google.spanner.v1.ExecuteSqlRequest} ExecuteSqlRequest instance - */ - ExecuteSqlRequest.create = function create(properties) { - return new ExecuteSqlRequest(properties); - }; - - /** - * Encodes the specified ExecuteSqlRequest message. Does not implicitly {@link google.spanner.v1.ExecuteSqlRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.ExecuteSqlRequest - * @static - * @param {google.spanner.v1.IExecuteSqlRequest} message ExecuteSqlRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExecuteSqlRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.session != null && Object.hasOwnProperty.call(message, "session")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.session); - if (message.transaction != null && Object.hasOwnProperty.call(message, "transaction")) - $root.google.spanner.v1.TransactionSelector.encode(message.transaction, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.sql != null && Object.hasOwnProperty.call(message, "sql")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.sql); - if (message.params != null && Object.hasOwnProperty.call(message, "params")) - $root.google.protobuf.Struct.encode(message.params, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.paramTypes != null && Object.hasOwnProperty.call(message, "paramTypes")) - for (var keys = Object.keys(message.paramTypes), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.spanner.v1.Type.encode(message.paramTypes[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - if (message.resumeToken != null && Object.hasOwnProperty.call(message, "resumeToken")) - writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.resumeToken); - if (message.queryMode != null && Object.hasOwnProperty.call(message, "queryMode")) - writer.uint32(/* id 7, wireType 0 =*/56).int32(message.queryMode); - if (message.partitionToken != null && Object.hasOwnProperty.call(message, "partitionToken")) - writer.uint32(/* id 8, wireType 2 =*/66).bytes(message.partitionToken); - if (message.seqno != null && Object.hasOwnProperty.call(message, "seqno")) - writer.uint32(/* id 9, wireType 0 =*/72).int64(message.seqno); - if (message.queryOptions != null && Object.hasOwnProperty.call(message, "queryOptions")) - $root.google.spanner.v1.ExecuteSqlRequest.QueryOptions.encode(message.queryOptions, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.requestOptions != null && Object.hasOwnProperty.call(message, "requestOptions")) - $root.google.spanner.v1.RequestOptions.encode(message.requestOptions, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.directedReadOptions != null && Object.hasOwnProperty.call(message, "directedReadOptions")) - $root.google.spanner.v1.DirectedReadOptions.encode(message.directedReadOptions, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); - if (message.dataBoostEnabled != null && Object.hasOwnProperty.call(message, "dataBoostEnabled")) - writer.uint32(/* id 16, wireType 0 =*/128).bool(message.dataBoostEnabled); - if (message.lastStatement != null && Object.hasOwnProperty.call(message, "lastStatement")) - writer.uint32(/* id 17, wireType 0 =*/136).bool(message.lastStatement); - if (message.routingHint != null && Object.hasOwnProperty.call(message, "routingHint")) - $root.google.spanner.v1.RoutingHint.encode(message.routingHint, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ExecuteSqlRequest message, length delimited. Does not implicitly {@link google.spanner.v1.ExecuteSqlRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.ExecuteSqlRequest - * @static - * @param {google.spanner.v1.IExecuteSqlRequest} message ExecuteSqlRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExecuteSqlRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExecuteSqlRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.ExecuteSqlRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.ExecuteSqlRequest} ExecuteSqlRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExecuteSqlRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.ExecuteSqlRequest(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.session = reader.string(); - break; - } - case 2: { - message.transaction = $root.google.spanner.v1.TransactionSelector.decode(reader, reader.uint32()); - break; - } - case 3: { - message.sql = reader.string(); - break; - } - case 4: { - message.params = $root.google.protobuf.Struct.decode(reader, reader.uint32()); - break; - } - case 5: { - if (message.paramTypes === $util.emptyObject) - message.paramTypes = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = null; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = $root.google.spanner.v1.Type.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.paramTypes[key] = value; - break; - } - case 6: { - message.resumeToken = reader.bytes(); - break; - } - case 7: { - message.queryMode = reader.int32(); - break; - } - case 8: { - message.partitionToken = reader.bytes(); - break; - } - case 9: { - message.seqno = reader.int64(); - break; - } - case 10: { - message.queryOptions = $root.google.spanner.v1.ExecuteSqlRequest.QueryOptions.decode(reader, reader.uint32()); - break; - } - case 11: { - message.requestOptions = $root.google.spanner.v1.RequestOptions.decode(reader, reader.uint32()); - break; - } - case 15: { - message.directedReadOptions = $root.google.spanner.v1.DirectedReadOptions.decode(reader, reader.uint32()); - break; - } - case 16: { - message.dataBoostEnabled = reader.bool(); - break; - } - case 17: { - message.lastStatement = reader.bool(); - break; - } - case 18: { - message.routingHint = $root.google.spanner.v1.RoutingHint.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExecuteSqlRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.ExecuteSqlRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.ExecuteSqlRequest} ExecuteSqlRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExecuteSqlRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExecuteSqlRequest message. - * @function verify - * @memberof google.spanner.v1.ExecuteSqlRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExecuteSqlRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.session != null && message.hasOwnProperty("session")) - if (!$util.isString(message.session)) - return "session: string expected"; - if (message.transaction != null && message.hasOwnProperty("transaction")) { - var error = $root.google.spanner.v1.TransactionSelector.verify(message.transaction); - if (error) - return "transaction." + error; - } - if (message.sql != null && message.hasOwnProperty("sql")) - if (!$util.isString(message.sql)) - return "sql: string expected"; - if (message.params != null && message.hasOwnProperty("params")) { - var error = $root.google.protobuf.Struct.verify(message.params); - if (error) - return "params." + error; - } - if (message.paramTypes != null && message.hasOwnProperty("paramTypes")) { - if (!$util.isObject(message.paramTypes)) - return "paramTypes: object expected"; - var key = Object.keys(message.paramTypes); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.spanner.v1.Type.verify(message.paramTypes[key[i]]); - if (error) - return "paramTypes." + error; - } - } - if (message.resumeToken != null && message.hasOwnProperty("resumeToken")) - if (!(message.resumeToken && typeof message.resumeToken.length === "number" || $util.isString(message.resumeToken))) - return "resumeToken: buffer expected"; - if (message.queryMode != null && message.hasOwnProperty("queryMode")) - switch (message.queryMode) { - default: - return "queryMode: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - if (message.partitionToken != null && message.hasOwnProperty("partitionToken")) - if (!(message.partitionToken && typeof message.partitionToken.length === "number" || $util.isString(message.partitionToken))) - return "partitionToken: buffer expected"; - if (message.seqno != null && message.hasOwnProperty("seqno")) - if (!$util.isInteger(message.seqno) && !(message.seqno && $util.isInteger(message.seqno.low) && $util.isInteger(message.seqno.high))) - return "seqno: integer|Long expected"; - if (message.queryOptions != null && message.hasOwnProperty("queryOptions")) { - var error = $root.google.spanner.v1.ExecuteSqlRequest.QueryOptions.verify(message.queryOptions); - if (error) - return "queryOptions." + error; - } - if (message.requestOptions != null && message.hasOwnProperty("requestOptions")) { - var error = $root.google.spanner.v1.RequestOptions.verify(message.requestOptions); - if (error) - return "requestOptions." + error; - } - if (message.directedReadOptions != null && message.hasOwnProperty("directedReadOptions")) { - var error = $root.google.spanner.v1.DirectedReadOptions.verify(message.directedReadOptions); - if (error) - return "directedReadOptions." + error; - } - if (message.dataBoostEnabled != null && message.hasOwnProperty("dataBoostEnabled")) - if (typeof message.dataBoostEnabled !== "boolean") - return "dataBoostEnabled: boolean expected"; - if (message.lastStatement != null && message.hasOwnProperty("lastStatement")) - if (typeof message.lastStatement !== "boolean") - return "lastStatement: boolean expected"; - if (message.routingHint != null && message.hasOwnProperty("routingHint")) { - var error = $root.google.spanner.v1.RoutingHint.verify(message.routingHint); - if (error) - return "routingHint." + error; - } - return null; - }; - - /** - * Creates an ExecuteSqlRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.ExecuteSqlRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.ExecuteSqlRequest} ExecuteSqlRequest - */ - ExecuteSqlRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.ExecuteSqlRequest) - return object; - var message = new $root.google.spanner.v1.ExecuteSqlRequest(); - if (object.session != null) - message.session = String(object.session); - if (object.transaction != null) { - if (typeof object.transaction !== "object") - throw TypeError(".google.spanner.v1.ExecuteSqlRequest.transaction: object expected"); - message.transaction = $root.google.spanner.v1.TransactionSelector.fromObject(object.transaction); - } - if (object.sql != null) - message.sql = String(object.sql); - if (object.params != null) { - if (typeof object.params !== "object") - throw TypeError(".google.spanner.v1.ExecuteSqlRequest.params: object expected"); - message.params = $root.google.protobuf.Struct.fromObject(object.params); - } - if (object.paramTypes) { - if (typeof object.paramTypes !== "object") - throw TypeError(".google.spanner.v1.ExecuteSqlRequest.paramTypes: object expected"); - message.paramTypes = {}; - for (var keys = Object.keys(object.paramTypes), i = 0; i < keys.length; ++i) { - if (typeof object.paramTypes[keys[i]] !== "object") - throw TypeError(".google.spanner.v1.ExecuteSqlRequest.paramTypes: object expected"); - message.paramTypes[keys[i]] = $root.google.spanner.v1.Type.fromObject(object.paramTypes[keys[i]]); - } - } - if (object.resumeToken != null) - if (typeof object.resumeToken === "string") - $util.base64.decode(object.resumeToken, message.resumeToken = $util.newBuffer($util.base64.length(object.resumeToken)), 0); - else if (object.resumeToken.length >= 0) - message.resumeToken = object.resumeToken; - switch (object.queryMode) { - default: - if (typeof object.queryMode === "number") { - message.queryMode = object.queryMode; - break; - } - break; - case "NORMAL": - case 0: - message.queryMode = 0; - break; - case "PLAN": - case 1: - message.queryMode = 1; - break; - case "PROFILE": - case 2: - message.queryMode = 2; - break; - case "WITH_STATS": - case 3: - message.queryMode = 3; - break; - case "WITH_PLAN_AND_STATS": - case 4: - message.queryMode = 4; - break; - } - if (object.partitionToken != null) - if (typeof object.partitionToken === "string") - $util.base64.decode(object.partitionToken, message.partitionToken = $util.newBuffer($util.base64.length(object.partitionToken)), 0); - else if (object.partitionToken.length >= 0) - message.partitionToken = object.partitionToken; - if (object.seqno != null) - if ($util.Long) - (message.seqno = $util.Long.fromValue(object.seqno)).unsigned = false; - else if (typeof object.seqno === "string") - message.seqno = parseInt(object.seqno, 10); - else if (typeof object.seqno === "number") - message.seqno = object.seqno; - else if (typeof object.seqno === "object") - message.seqno = new $util.LongBits(object.seqno.low >>> 0, object.seqno.high >>> 0).toNumber(); - if (object.queryOptions != null) { - if (typeof object.queryOptions !== "object") - throw TypeError(".google.spanner.v1.ExecuteSqlRequest.queryOptions: object expected"); - message.queryOptions = $root.google.spanner.v1.ExecuteSqlRequest.QueryOptions.fromObject(object.queryOptions); - } - if (object.requestOptions != null) { - if (typeof object.requestOptions !== "object") - throw TypeError(".google.spanner.v1.ExecuteSqlRequest.requestOptions: object expected"); - message.requestOptions = $root.google.spanner.v1.RequestOptions.fromObject(object.requestOptions); - } - if (object.directedReadOptions != null) { - if (typeof object.directedReadOptions !== "object") - throw TypeError(".google.spanner.v1.ExecuteSqlRequest.directedReadOptions: object expected"); - message.directedReadOptions = $root.google.spanner.v1.DirectedReadOptions.fromObject(object.directedReadOptions); - } - if (object.dataBoostEnabled != null) - message.dataBoostEnabled = Boolean(object.dataBoostEnabled); - if (object.lastStatement != null) - message.lastStatement = Boolean(object.lastStatement); - if (object.routingHint != null) { - if (typeof object.routingHint !== "object") - throw TypeError(".google.spanner.v1.ExecuteSqlRequest.routingHint: object expected"); - message.routingHint = $root.google.spanner.v1.RoutingHint.fromObject(object.routingHint); - } - return message; - }; - - /** - * Creates a plain object from an ExecuteSqlRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.ExecuteSqlRequest - * @static - * @param {google.spanner.v1.ExecuteSqlRequest} message ExecuteSqlRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExecuteSqlRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.paramTypes = {}; - if (options.defaults) { - object.session = ""; - object.transaction = null; - object.sql = ""; - object.params = null; - if (options.bytes === String) - object.resumeToken = ""; - else { - object.resumeToken = []; - if (options.bytes !== Array) - object.resumeToken = $util.newBuffer(object.resumeToken); - } - object.queryMode = options.enums === String ? "NORMAL" : 0; - if (options.bytes === String) - object.partitionToken = ""; - else { - object.partitionToken = []; - if (options.bytes !== Array) - object.partitionToken = $util.newBuffer(object.partitionToken); - } - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.seqno = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.seqno = options.longs === String ? "0" : 0; - object.queryOptions = null; - object.requestOptions = null; - object.directedReadOptions = null; - object.dataBoostEnabled = false; - object.lastStatement = false; - object.routingHint = null; - } - if (message.session != null && message.hasOwnProperty("session")) - object.session = message.session; - if (message.transaction != null && message.hasOwnProperty("transaction")) - object.transaction = $root.google.spanner.v1.TransactionSelector.toObject(message.transaction, options); - if (message.sql != null && message.hasOwnProperty("sql")) - object.sql = message.sql; - if (message.params != null && message.hasOwnProperty("params")) - object.params = $root.google.protobuf.Struct.toObject(message.params, options); - var keys2; - if (message.paramTypes && (keys2 = Object.keys(message.paramTypes)).length) { - object.paramTypes = {}; - for (var j = 0; j < keys2.length; ++j) - object.paramTypes[keys2[j]] = $root.google.spanner.v1.Type.toObject(message.paramTypes[keys2[j]], options); - } - if (message.resumeToken != null && message.hasOwnProperty("resumeToken")) - object.resumeToken = options.bytes === String ? $util.base64.encode(message.resumeToken, 0, message.resumeToken.length) : options.bytes === Array ? Array.prototype.slice.call(message.resumeToken) : message.resumeToken; - if (message.queryMode != null && message.hasOwnProperty("queryMode")) - object.queryMode = options.enums === String ? $root.google.spanner.v1.ExecuteSqlRequest.QueryMode[message.queryMode] === undefined ? message.queryMode : $root.google.spanner.v1.ExecuteSqlRequest.QueryMode[message.queryMode] : message.queryMode; - if (message.partitionToken != null && message.hasOwnProperty("partitionToken")) - object.partitionToken = options.bytes === String ? $util.base64.encode(message.partitionToken, 0, message.partitionToken.length) : options.bytes === Array ? Array.prototype.slice.call(message.partitionToken) : message.partitionToken; - if (message.seqno != null && message.hasOwnProperty("seqno")) - if (typeof message.seqno === "number") - object.seqno = options.longs === String ? String(message.seqno) : message.seqno; - else - object.seqno = options.longs === String ? $util.Long.prototype.toString.call(message.seqno) : options.longs === Number ? new $util.LongBits(message.seqno.low >>> 0, message.seqno.high >>> 0).toNumber() : message.seqno; - if (message.queryOptions != null && message.hasOwnProperty("queryOptions")) - object.queryOptions = $root.google.spanner.v1.ExecuteSqlRequest.QueryOptions.toObject(message.queryOptions, options); - if (message.requestOptions != null && message.hasOwnProperty("requestOptions")) - object.requestOptions = $root.google.spanner.v1.RequestOptions.toObject(message.requestOptions, options); - if (message.directedReadOptions != null && message.hasOwnProperty("directedReadOptions")) - object.directedReadOptions = $root.google.spanner.v1.DirectedReadOptions.toObject(message.directedReadOptions, options); - if (message.dataBoostEnabled != null && message.hasOwnProperty("dataBoostEnabled")) - object.dataBoostEnabled = message.dataBoostEnabled; - if (message.lastStatement != null && message.hasOwnProperty("lastStatement")) - object.lastStatement = message.lastStatement; - if (message.routingHint != null && message.hasOwnProperty("routingHint")) - object.routingHint = $root.google.spanner.v1.RoutingHint.toObject(message.routingHint, options); - return object; - }; - - /** - * Converts this ExecuteSqlRequest to JSON. - * @function toJSON - * @memberof google.spanner.v1.ExecuteSqlRequest - * @instance - * @returns {Object.} JSON object - */ - ExecuteSqlRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExecuteSqlRequest - * @function getTypeUrl - * @memberof google.spanner.v1.ExecuteSqlRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExecuteSqlRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.ExecuteSqlRequest"; - }; - - /** - * QueryMode enum. - * @name google.spanner.v1.ExecuteSqlRequest.QueryMode - * @enum {number} - * @property {number} NORMAL=0 NORMAL value - * @property {number} PLAN=1 PLAN value - * @property {number} PROFILE=2 PROFILE value - * @property {number} WITH_STATS=3 WITH_STATS value - * @property {number} WITH_PLAN_AND_STATS=4 WITH_PLAN_AND_STATS value - */ - ExecuteSqlRequest.QueryMode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "NORMAL"] = 0; - values[valuesById[1] = "PLAN"] = 1; - values[valuesById[2] = "PROFILE"] = 2; - values[valuesById[3] = "WITH_STATS"] = 3; - values[valuesById[4] = "WITH_PLAN_AND_STATS"] = 4; - return values; - })(); - - ExecuteSqlRequest.QueryOptions = (function() { - - /** - * Properties of a QueryOptions. - * @memberof google.spanner.v1.ExecuteSqlRequest - * @interface IQueryOptions - * @property {string|null} [optimizerVersion] QueryOptions optimizerVersion - * @property {string|null} [optimizerStatisticsPackage] QueryOptions optimizerStatisticsPackage - */ - - /** - * Constructs a new QueryOptions. - * @memberof google.spanner.v1.ExecuteSqlRequest - * @classdesc Represents a QueryOptions. - * @implements IQueryOptions - * @constructor - * @param {google.spanner.v1.ExecuteSqlRequest.IQueryOptions=} [properties] Properties to set - */ - function QueryOptions(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryOptions optimizerVersion. - * @member {string} optimizerVersion - * @memberof google.spanner.v1.ExecuteSqlRequest.QueryOptions - * @instance - */ - QueryOptions.prototype.optimizerVersion = ""; - - /** - * QueryOptions optimizerStatisticsPackage. - * @member {string} optimizerStatisticsPackage - * @memberof google.spanner.v1.ExecuteSqlRequest.QueryOptions - * @instance - */ - QueryOptions.prototype.optimizerStatisticsPackage = ""; - - /** - * Creates a new QueryOptions instance using the specified properties. - * @function create - * @memberof google.spanner.v1.ExecuteSqlRequest.QueryOptions - * @static - * @param {google.spanner.v1.ExecuteSqlRequest.IQueryOptions=} [properties] Properties to set - * @returns {google.spanner.v1.ExecuteSqlRequest.QueryOptions} QueryOptions instance - */ - QueryOptions.create = function create(properties) { - return new QueryOptions(properties); - }; - - /** - * Encodes the specified QueryOptions message. Does not implicitly {@link google.spanner.v1.ExecuteSqlRequest.QueryOptions.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.ExecuteSqlRequest.QueryOptions - * @static - * @param {google.spanner.v1.ExecuteSqlRequest.IQueryOptions} message QueryOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.optimizerVersion != null && Object.hasOwnProperty.call(message, "optimizerVersion")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.optimizerVersion); - if (message.optimizerStatisticsPackage != null && Object.hasOwnProperty.call(message, "optimizerStatisticsPackage")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.optimizerStatisticsPackage); - return writer; - }; - - /** - * Encodes the specified QueryOptions message, length delimited. Does not implicitly {@link google.spanner.v1.ExecuteSqlRequest.QueryOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.ExecuteSqlRequest.QueryOptions - * @static - * @param {google.spanner.v1.ExecuteSqlRequest.IQueryOptions} message QueryOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryOptions message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.ExecuteSqlRequest.QueryOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.ExecuteSqlRequest.QueryOptions} QueryOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.ExecuteSqlRequest.QueryOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.optimizerVersion = reader.string(); - break; - } - case 2: { - message.optimizerStatisticsPackage = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.ExecuteSqlRequest.QueryOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.ExecuteSqlRequest.QueryOptions} QueryOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryOptions message. - * @function verify - * @memberof google.spanner.v1.ExecuteSqlRequest.QueryOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.optimizerVersion != null && message.hasOwnProperty("optimizerVersion")) - if (!$util.isString(message.optimizerVersion)) - return "optimizerVersion: string expected"; - if (message.optimizerStatisticsPackage != null && message.hasOwnProperty("optimizerStatisticsPackage")) - if (!$util.isString(message.optimizerStatisticsPackage)) - return "optimizerStatisticsPackage: string expected"; - return null; - }; - - /** - * Creates a QueryOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.ExecuteSqlRequest.QueryOptions - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.ExecuteSqlRequest.QueryOptions} QueryOptions - */ - QueryOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.ExecuteSqlRequest.QueryOptions) - return object; - var message = new $root.google.spanner.v1.ExecuteSqlRequest.QueryOptions(); - if (object.optimizerVersion != null) - message.optimizerVersion = String(object.optimizerVersion); - if (object.optimizerStatisticsPackage != null) - message.optimizerStatisticsPackage = String(object.optimizerStatisticsPackage); - return message; - }; - - /** - * Creates a plain object from a QueryOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.ExecuteSqlRequest.QueryOptions - * @static - * @param {google.spanner.v1.ExecuteSqlRequest.QueryOptions} message QueryOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.optimizerVersion = ""; - object.optimizerStatisticsPackage = ""; - } - if (message.optimizerVersion != null && message.hasOwnProperty("optimizerVersion")) - object.optimizerVersion = message.optimizerVersion; - if (message.optimizerStatisticsPackage != null && message.hasOwnProperty("optimizerStatisticsPackage")) - object.optimizerStatisticsPackage = message.optimizerStatisticsPackage; - return object; - }; - - /** - * Converts this QueryOptions to JSON. - * @function toJSON - * @memberof google.spanner.v1.ExecuteSqlRequest.QueryOptions - * @instance - * @returns {Object.} JSON object - */ - QueryOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for QueryOptions - * @function getTypeUrl - * @memberof google.spanner.v1.ExecuteSqlRequest.QueryOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - QueryOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.ExecuteSqlRequest.QueryOptions"; - }; - - return QueryOptions; - })(); - - return ExecuteSqlRequest; - })(); - - v1.ExecuteBatchDmlRequest = (function() { - - /** - * Properties of an ExecuteBatchDmlRequest. - * @memberof google.spanner.v1 - * @interface IExecuteBatchDmlRequest - * @property {string|null} [session] ExecuteBatchDmlRequest session - * @property {google.spanner.v1.ITransactionSelector|null} [transaction] ExecuteBatchDmlRequest transaction - * @property {Array.|null} [statements] ExecuteBatchDmlRequest statements - * @property {number|Long|null} [seqno] ExecuteBatchDmlRequest seqno - * @property {google.spanner.v1.IRequestOptions|null} [requestOptions] ExecuteBatchDmlRequest requestOptions - * @property {boolean|null} [lastStatements] ExecuteBatchDmlRequest lastStatements - */ - - /** - * Constructs a new ExecuteBatchDmlRequest. - * @memberof google.spanner.v1 - * @classdesc Represents an ExecuteBatchDmlRequest. - * @implements IExecuteBatchDmlRequest - * @constructor - * @param {google.spanner.v1.IExecuteBatchDmlRequest=} [properties] Properties to set - */ - function ExecuteBatchDmlRequest(properties) { - this.statements = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExecuteBatchDmlRequest session. - * @member {string} session - * @memberof google.spanner.v1.ExecuteBatchDmlRequest - * @instance - */ - ExecuteBatchDmlRequest.prototype.session = ""; - - /** - * ExecuteBatchDmlRequest transaction. - * @member {google.spanner.v1.ITransactionSelector|null|undefined} transaction - * @memberof google.spanner.v1.ExecuteBatchDmlRequest - * @instance - */ - ExecuteBatchDmlRequest.prototype.transaction = null; - - /** - * ExecuteBatchDmlRequest statements. - * @member {Array.} statements - * @memberof google.spanner.v1.ExecuteBatchDmlRequest - * @instance - */ - ExecuteBatchDmlRequest.prototype.statements = $util.emptyArray; - - /** - * ExecuteBatchDmlRequest seqno. - * @member {number|Long} seqno - * @memberof google.spanner.v1.ExecuteBatchDmlRequest - * @instance - */ - ExecuteBatchDmlRequest.prototype.seqno = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * ExecuteBatchDmlRequest requestOptions. - * @member {google.spanner.v1.IRequestOptions|null|undefined} requestOptions - * @memberof google.spanner.v1.ExecuteBatchDmlRequest - * @instance - */ - ExecuteBatchDmlRequest.prototype.requestOptions = null; - - /** - * ExecuteBatchDmlRequest lastStatements. - * @member {boolean} lastStatements - * @memberof google.spanner.v1.ExecuteBatchDmlRequest - * @instance - */ - ExecuteBatchDmlRequest.prototype.lastStatements = false; - - /** - * Creates a new ExecuteBatchDmlRequest instance using the specified properties. - * @function create - * @memberof google.spanner.v1.ExecuteBatchDmlRequest - * @static - * @param {google.spanner.v1.IExecuteBatchDmlRequest=} [properties] Properties to set - * @returns {google.spanner.v1.ExecuteBatchDmlRequest} ExecuteBatchDmlRequest instance - */ - ExecuteBatchDmlRequest.create = function create(properties) { - return new ExecuteBatchDmlRequest(properties); - }; - - /** - * Encodes the specified ExecuteBatchDmlRequest message. Does not implicitly {@link google.spanner.v1.ExecuteBatchDmlRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.ExecuteBatchDmlRequest - * @static - * @param {google.spanner.v1.IExecuteBatchDmlRequest} message ExecuteBatchDmlRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExecuteBatchDmlRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.session != null && Object.hasOwnProperty.call(message, "session")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.session); - if (message.transaction != null && Object.hasOwnProperty.call(message, "transaction")) - $root.google.spanner.v1.TransactionSelector.encode(message.transaction, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.statements != null && message.statements.length) - for (var i = 0; i < message.statements.length; ++i) - $root.google.spanner.v1.ExecuteBatchDmlRequest.Statement.encode(message.statements[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.seqno != null && Object.hasOwnProperty.call(message, "seqno")) - writer.uint32(/* id 4, wireType 0 =*/32).int64(message.seqno); - if (message.requestOptions != null && Object.hasOwnProperty.call(message, "requestOptions")) - $root.google.spanner.v1.RequestOptions.encode(message.requestOptions, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.lastStatements != null && Object.hasOwnProperty.call(message, "lastStatements")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.lastStatements); - return writer; - }; - - /** - * Encodes the specified ExecuteBatchDmlRequest message, length delimited. Does not implicitly {@link google.spanner.v1.ExecuteBatchDmlRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.ExecuteBatchDmlRequest - * @static - * @param {google.spanner.v1.IExecuteBatchDmlRequest} message ExecuteBatchDmlRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExecuteBatchDmlRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExecuteBatchDmlRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.ExecuteBatchDmlRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.ExecuteBatchDmlRequest} ExecuteBatchDmlRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExecuteBatchDmlRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.ExecuteBatchDmlRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.session = reader.string(); - break; - } - case 2: { - message.transaction = $root.google.spanner.v1.TransactionSelector.decode(reader, reader.uint32()); - break; - } - case 3: { - if (!(message.statements && message.statements.length)) - message.statements = []; - message.statements.push($root.google.spanner.v1.ExecuteBatchDmlRequest.Statement.decode(reader, reader.uint32())); - break; - } - case 4: { - message.seqno = reader.int64(); - break; - } - case 5: { - message.requestOptions = $root.google.spanner.v1.RequestOptions.decode(reader, reader.uint32()); - break; - } - case 6: { - message.lastStatements = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExecuteBatchDmlRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.ExecuteBatchDmlRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.ExecuteBatchDmlRequest} ExecuteBatchDmlRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExecuteBatchDmlRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExecuteBatchDmlRequest message. - * @function verify - * @memberof google.spanner.v1.ExecuteBatchDmlRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExecuteBatchDmlRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.session != null && message.hasOwnProperty("session")) - if (!$util.isString(message.session)) - return "session: string expected"; - if (message.transaction != null && message.hasOwnProperty("transaction")) { - var error = $root.google.spanner.v1.TransactionSelector.verify(message.transaction); - if (error) - return "transaction." + error; - } - if (message.statements != null && message.hasOwnProperty("statements")) { - if (!Array.isArray(message.statements)) - return "statements: array expected"; - for (var i = 0; i < message.statements.length; ++i) { - var error = $root.google.spanner.v1.ExecuteBatchDmlRequest.Statement.verify(message.statements[i]); - if (error) - return "statements." + error; - } - } - if (message.seqno != null && message.hasOwnProperty("seqno")) - if (!$util.isInteger(message.seqno) && !(message.seqno && $util.isInteger(message.seqno.low) && $util.isInteger(message.seqno.high))) - return "seqno: integer|Long expected"; - if (message.requestOptions != null && message.hasOwnProperty("requestOptions")) { - var error = $root.google.spanner.v1.RequestOptions.verify(message.requestOptions); - if (error) - return "requestOptions." + error; - } - if (message.lastStatements != null && message.hasOwnProperty("lastStatements")) - if (typeof message.lastStatements !== "boolean") - return "lastStatements: boolean expected"; - return null; - }; - - /** - * Creates an ExecuteBatchDmlRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.ExecuteBatchDmlRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.ExecuteBatchDmlRequest} ExecuteBatchDmlRequest - */ - ExecuteBatchDmlRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.ExecuteBatchDmlRequest) - return object; - var message = new $root.google.spanner.v1.ExecuteBatchDmlRequest(); - if (object.session != null) - message.session = String(object.session); - if (object.transaction != null) { - if (typeof object.transaction !== "object") - throw TypeError(".google.spanner.v1.ExecuteBatchDmlRequest.transaction: object expected"); - message.transaction = $root.google.spanner.v1.TransactionSelector.fromObject(object.transaction); - } - if (object.statements) { - if (!Array.isArray(object.statements)) - throw TypeError(".google.spanner.v1.ExecuteBatchDmlRequest.statements: array expected"); - message.statements = []; - for (var i = 0; i < object.statements.length; ++i) { - if (typeof object.statements[i] !== "object") - throw TypeError(".google.spanner.v1.ExecuteBatchDmlRequest.statements: object expected"); - message.statements[i] = $root.google.spanner.v1.ExecuteBatchDmlRequest.Statement.fromObject(object.statements[i]); - } - } - if (object.seqno != null) - if ($util.Long) - (message.seqno = $util.Long.fromValue(object.seqno)).unsigned = false; - else if (typeof object.seqno === "string") - message.seqno = parseInt(object.seqno, 10); - else if (typeof object.seqno === "number") - message.seqno = object.seqno; - else if (typeof object.seqno === "object") - message.seqno = new $util.LongBits(object.seqno.low >>> 0, object.seqno.high >>> 0).toNumber(); - if (object.requestOptions != null) { - if (typeof object.requestOptions !== "object") - throw TypeError(".google.spanner.v1.ExecuteBatchDmlRequest.requestOptions: object expected"); - message.requestOptions = $root.google.spanner.v1.RequestOptions.fromObject(object.requestOptions); - } - if (object.lastStatements != null) - message.lastStatements = Boolean(object.lastStatements); - return message; - }; - - /** - * Creates a plain object from an ExecuteBatchDmlRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.ExecuteBatchDmlRequest - * @static - * @param {google.spanner.v1.ExecuteBatchDmlRequest} message ExecuteBatchDmlRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExecuteBatchDmlRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.statements = []; - if (options.defaults) { - object.session = ""; - object.transaction = null; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.seqno = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.seqno = options.longs === String ? "0" : 0; - object.requestOptions = null; - object.lastStatements = false; - } - if (message.session != null && message.hasOwnProperty("session")) - object.session = message.session; - if (message.transaction != null && message.hasOwnProperty("transaction")) - object.transaction = $root.google.spanner.v1.TransactionSelector.toObject(message.transaction, options); - if (message.statements && message.statements.length) { - object.statements = []; - for (var j = 0; j < message.statements.length; ++j) - object.statements[j] = $root.google.spanner.v1.ExecuteBatchDmlRequest.Statement.toObject(message.statements[j], options); - } - if (message.seqno != null && message.hasOwnProperty("seqno")) - if (typeof message.seqno === "number") - object.seqno = options.longs === String ? String(message.seqno) : message.seqno; - else - object.seqno = options.longs === String ? $util.Long.prototype.toString.call(message.seqno) : options.longs === Number ? new $util.LongBits(message.seqno.low >>> 0, message.seqno.high >>> 0).toNumber() : message.seqno; - if (message.requestOptions != null && message.hasOwnProperty("requestOptions")) - object.requestOptions = $root.google.spanner.v1.RequestOptions.toObject(message.requestOptions, options); - if (message.lastStatements != null && message.hasOwnProperty("lastStatements")) - object.lastStatements = message.lastStatements; - return object; - }; - - /** - * Converts this ExecuteBatchDmlRequest to JSON. - * @function toJSON - * @memberof google.spanner.v1.ExecuteBatchDmlRequest - * @instance - * @returns {Object.} JSON object - */ - ExecuteBatchDmlRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExecuteBatchDmlRequest - * @function getTypeUrl - * @memberof google.spanner.v1.ExecuteBatchDmlRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExecuteBatchDmlRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.ExecuteBatchDmlRequest"; - }; - - ExecuteBatchDmlRequest.Statement = (function() { - - /** - * Properties of a Statement. - * @memberof google.spanner.v1.ExecuteBatchDmlRequest - * @interface IStatement - * @property {string|null} [sql] Statement sql - * @property {google.protobuf.IStruct|null} [params] Statement params - * @property {Object.|null} [paramTypes] Statement paramTypes - */ - - /** - * Constructs a new Statement. - * @memberof google.spanner.v1.ExecuteBatchDmlRequest - * @classdesc Represents a Statement. - * @implements IStatement - * @constructor - * @param {google.spanner.v1.ExecuteBatchDmlRequest.IStatement=} [properties] Properties to set - */ - function Statement(properties) { - this.paramTypes = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Statement sql. - * @member {string} sql - * @memberof google.spanner.v1.ExecuteBatchDmlRequest.Statement - * @instance - */ - Statement.prototype.sql = ""; - - /** - * Statement params. - * @member {google.protobuf.IStruct|null|undefined} params - * @memberof google.spanner.v1.ExecuteBatchDmlRequest.Statement - * @instance - */ - Statement.prototype.params = null; - - /** - * Statement paramTypes. - * @member {Object.} paramTypes - * @memberof google.spanner.v1.ExecuteBatchDmlRequest.Statement - * @instance - */ - Statement.prototype.paramTypes = $util.emptyObject; - - /** - * Creates a new Statement instance using the specified properties. - * @function create - * @memberof google.spanner.v1.ExecuteBatchDmlRequest.Statement - * @static - * @param {google.spanner.v1.ExecuteBatchDmlRequest.IStatement=} [properties] Properties to set - * @returns {google.spanner.v1.ExecuteBatchDmlRequest.Statement} Statement instance - */ - Statement.create = function create(properties) { - return new Statement(properties); - }; - - /** - * Encodes the specified Statement message. Does not implicitly {@link google.spanner.v1.ExecuteBatchDmlRequest.Statement.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.ExecuteBatchDmlRequest.Statement - * @static - * @param {google.spanner.v1.ExecuteBatchDmlRequest.IStatement} message Statement message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Statement.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.sql != null && Object.hasOwnProperty.call(message, "sql")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.sql); - if (message.params != null && Object.hasOwnProperty.call(message, "params")) - $root.google.protobuf.Struct.encode(message.params, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.paramTypes != null && Object.hasOwnProperty.call(message, "paramTypes")) - for (var keys = Object.keys(message.paramTypes), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.spanner.v1.Type.encode(message.paramTypes[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - return writer; - }; - - /** - * Encodes the specified Statement message, length delimited. Does not implicitly {@link google.spanner.v1.ExecuteBatchDmlRequest.Statement.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.ExecuteBatchDmlRequest.Statement - * @static - * @param {google.spanner.v1.ExecuteBatchDmlRequest.IStatement} message Statement message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Statement.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Statement message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.ExecuteBatchDmlRequest.Statement - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.ExecuteBatchDmlRequest.Statement} Statement - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Statement.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.ExecuteBatchDmlRequest.Statement(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.sql = reader.string(); - break; - } - case 2: { - message.params = $root.google.protobuf.Struct.decode(reader, reader.uint32()); - break; - } - case 3: { - if (message.paramTypes === $util.emptyObject) - message.paramTypes = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = null; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = $root.google.spanner.v1.Type.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.paramTypes[key] = value; - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Statement message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.ExecuteBatchDmlRequest.Statement - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.ExecuteBatchDmlRequest.Statement} Statement - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Statement.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Statement message. - * @function verify - * @memberof google.spanner.v1.ExecuteBatchDmlRequest.Statement - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Statement.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.sql != null && message.hasOwnProperty("sql")) - if (!$util.isString(message.sql)) - return "sql: string expected"; - if (message.params != null && message.hasOwnProperty("params")) { - var error = $root.google.protobuf.Struct.verify(message.params); - if (error) - return "params." + error; - } - if (message.paramTypes != null && message.hasOwnProperty("paramTypes")) { - if (!$util.isObject(message.paramTypes)) - return "paramTypes: object expected"; - var key = Object.keys(message.paramTypes); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.spanner.v1.Type.verify(message.paramTypes[key[i]]); - if (error) - return "paramTypes." + error; - } - } - return null; - }; - - /** - * Creates a Statement message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.ExecuteBatchDmlRequest.Statement - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.ExecuteBatchDmlRequest.Statement} Statement - */ - Statement.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.ExecuteBatchDmlRequest.Statement) - return object; - var message = new $root.google.spanner.v1.ExecuteBatchDmlRequest.Statement(); - if (object.sql != null) - message.sql = String(object.sql); - if (object.params != null) { - if (typeof object.params !== "object") - throw TypeError(".google.spanner.v1.ExecuteBatchDmlRequest.Statement.params: object expected"); - message.params = $root.google.protobuf.Struct.fromObject(object.params); - } - if (object.paramTypes) { - if (typeof object.paramTypes !== "object") - throw TypeError(".google.spanner.v1.ExecuteBatchDmlRequest.Statement.paramTypes: object expected"); - message.paramTypes = {}; - for (var keys = Object.keys(object.paramTypes), i = 0; i < keys.length; ++i) { - if (typeof object.paramTypes[keys[i]] !== "object") - throw TypeError(".google.spanner.v1.ExecuteBatchDmlRequest.Statement.paramTypes: object expected"); - message.paramTypes[keys[i]] = $root.google.spanner.v1.Type.fromObject(object.paramTypes[keys[i]]); - } - } - return message; - }; - - /** - * Creates a plain object from a Statement message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.ExecuteBatchDmlRequest.Statement - * @static - * @param {google.spanner.v1.ExecuteBatchDmlRequest.Statement} message Statement - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Statement.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.paramTypes = {}; - if (options.defaults) { - object.sql = ""; - object.params = null; - } - if (message.sql != null && message.hasOwnProperty("sql")) - object.sql = message.sql; - if (message.params != null && message.hasOwnProperty("params")) - object.params = $root.google.protobuf.Struct.toObject(message.params, options); - var keys2; - if (message.paramTypes && (keys2 = Object.keys(message.paramTypes)).length) { - object.paramTypes = {}; - for (var j = 0; j < keys2.length; ++j) - object.paramTypes[keys2[j]] = $root.google.spanner.v1.Type.toObject(message.paramTypes[keys2[j]], options); - } - return object; - }; - - /** - * Converts this Statement to JSON. - * @function toJSON - * @memberof google.spanner.v1.ExecuteBatchDmlRequest.Statement - * @instance - * @returns {Object.} JSON object - */ - Statement.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Statement - * @function getTypeUrl - * @memberof google.spanner.v1.ExecuteBatchDmlRequest.Statement - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Statement.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.ExecuteBatchDmlRequest.Statement"; - }; - - return Statement; - })(); - - return ExecuteBatchDmlRequest; - })(); - - v1.ExecuteBatchDmlResponse = (function() { - - /** - * Properties of an ExecuteBatchDmlResponse. - * @memberof google.spanner.v1 - * @interface IExecuteBatchDmlResponse - * @property {Array.|null} [resultSets] ExecuteBatchDmlResponse resultSets - * @property {google.rpc.IStatus|null} [status] ExecuteBatchDmlResponse status - * @property {google.spanner.v1.IMultiplexedSessionPrecommitToken|null} [precommitToken] ExecuteBatchDmlResponse precommitToken - */ - - /** - * Constructs a new ExecuteBatchDmlResponse. - * @memberof google.spanner.v1 - * @classdesc Represents an ExecuteBatchDmlResponse. - * @implements IExecuteBatchDmlResponse - * @constructor - * @param {google.spanner.v1.IExecuteBatchDmlResponse=} [properties] Properties to set - */ - function ExecuteBatchDmlResponse(properties) { - this.resultSets = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExecuteBatchDmlResponse resultSets. - * @member {Array.} resultSets - * @memberof google.spanner.v1.ExecuteBatchDmlResponse - * @instance - */ - ExecuteBatchDmlResponse.prototype.resultSets = $util.emptyArray; - - /** - * ExecuteBatchDmlResponse status. - * @member {google.rpc.IStatus|null|undefined} status - * @memberof google.spanner.v1.ExecuteBatchDmlResponse - * @instance - */ - ExecuteBatchDmlResponse.prototype.status = null; - - /** - * ExecuteBatchDmlResponse precommitToken. - * @member {google.spanner.v1.IMultiplexedSessionPrecommitToken|null|undefined} precommitToken - * @memberof google.spanner.v1.ExecuteBatchDmlResponse - * @instance - */ - ExecuteBatchDmlResponse.prototype.precommitToken = null; - - /** - * Creates a new ExecuteBatchDmlResponse instance using the specified properties. - * @function create - * @memberof google.spanner.v1.ExecuteBatchDmlResponse - * @static - * @param {google.spanner.v1.IExecuteBatchDmlResponse=} [properties] Properties to set - * @returns {google.spanner.v1.ExecuteBatchDmlResponse} ExecuteBatchDmlResponse instance - */ - ExecuteBatchDmlResponse.create = function create(properties) { - return new ExecuteBatchDmlResponse(properties); - }; - - /** - * Encodes the specified ExecuteBatchDmlResponse message. Does not implicitly {@link google.spanner.v1.ExecuteBatchDmlResponse.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.ExecuteBatchDmlResponse - * @static - * @param {google.spanner.v1.IExecuteBatchDmlResponse} message ExecuteBatchDmlResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExecuteBatchDmlResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.resultSets != null && message.resultSets.length) - for (var i = 0; i < message.resultSets.length; ++i) - $root.google.spanner.v1.ResultSet.encode(message.resultSets[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.status != null && Object.hasOwnProperty.call(message, "status")) - $root.google.rpc.Status.encode(message.status, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.precommitToken != null && Object.hasOwnProperty.call(message, "precommitToken")) - $root.google.spanner.v1.MultiplexedSessionPrecommitToken.encode(message.precommitToken, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ExecuteBatchDmlResponse message, length delimited. Does not implicitly {@link google.spanner.v1.ExecuteBatchDmlResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.ExecuteBatchDmlResponse - * @static - * @param {google.spanner.v1.IExecuteBatchDmlResponse} message ExecuteBatchDmlResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExecuteBatchDmlResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExecuteBatchDmlResponse message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.ExecuteBatchDmlResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.ExecuteBatchDmlResponse} ExecuteBatchDmlResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExecuteBatchDmlResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.ExecuteBatchDmlResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.resultSets && message.resultSets.length)) - message.resultSets = []; - message.resultSets.push($root.google.spanner.v1.ResultSet.decode(reader, reader.uint32())); - break; - } - case 2: { - message.status = $root.google.rpc.Status.decode(reader, reader.uint32()); - break; - } - case 3: { - message.precommitToken = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExecuteBatchDmlResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.ExecuteBatchDmlResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.ExecuteBatchDmlResponse} ExecuteBatchDmlResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExecuteBatchDmlResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExecuteBatchDmlResponse message. - * @function verify - * @memberof google.spanner.v1.ExecuteBatchDmlResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExecuteBatchDmlResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.resultSets != null && message.hasOwnProperty("resultSets")) { - if (!Array.isArray(message.resultSets)) - return "resultSets: array expected"; - for (var i = 0; i < message.resultSets.length; ++i) { - var error = $root.google.spanner.v1.ResultSet.verify(message.resultSets[i]); - if (error) - return "resultSets." + error; - } - } - if (message.status != null && message.hasOwnProperty("status")) { - var error = $root.google.rpc.Status.verify(message.status); - if (error) - return "status." + error; - } - if (message.precommitToken != null && message.hasOwnProperty("precommitToken")) { - var error = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.verify(message.precommitToken); - if (error) - return "precommitToken." + error; - } - return null; - }; - - /** - * Creates an ExecuteBatchDmlResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.ExecuteBatchDmlResponse - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.ExecuteBatchDmlResponse} ExecuteBatchDmlResponse - */ - ExecuteBatchDmlResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.ExecuteBatchDmlResponse) - return object; - var message = new $root.google.spanner.v1.ExecuteBatchDmlResponse(); - if (object.resultSets) { - if (!Array.isArray(object.resultSets)) - throw TypeError(".google.spanner.v1.ExecuteBatchDmlResponse.resultSets: array expected"); - message.resultSets = []; - for (var i = 0; i < object.resultSets.length; ++i) { - if (typeof object.resultSets[i] !== "object") - throw TypeError(".google.spanner.v1.ExecuteBatchDmlResponse.resultSets: object expected"); - message.resultSets[i] = $root.google.spanner.v1.ResultSet.fromObject(object.resultSets[i]); - } - } - if (object.status != null) { - if (typeof object.status !== "object") - throw TypeError(".google.spanner.v1.ExecuteBatchDmlResponse.status: object expected"); - message.status = $root.google.rpc.Status.fromObject(object.status); - } - if (object.precommitToken != null) { - if (typeof object.precommitToken !== "object") - throw TypeError(".google.spanner.v1.ExecuteBatchDmlResponse.precommitToken: object expected"); - message.precommitToken = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.fromObject(object.precommitToken); - } - return message; - }; - - /** - * Creates a plain object from an ExecuteBatchDmlResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.ExecuteBatchDmlResponse - * @static - * @param {google.spanner.v1.ExecuteBatchDmlResponse} message ExecuteBatchDmlResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExecuteBatchDmlResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.resultSets = []; - if (options.defaults) { - object.status = null; - object.precommitToken = null; - } - if (message.resultSets && message.resultSets.length) { - object.resultSets = []; - for (var j = 0; j < message.resultSets.length; ++j) - object.resultSets[j] = $root.google.spanner.v1.ResultSet.toObject(message.resultSets[j], options); - } - if (message.status != null && message.hasOwnProperty("status")) - object.status = $root.google.rpc.Status.toObject(message.status, options); - if (message.precommitToken != null && message.hasOwnProperty("precommitToken")) - object.precommitToken = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.toObject(message.precommitToken, options); - return object; - }; - - /** - * Converts this ExecuteBatchDmlResponse to JSON. - * @function toJSON - * @memberof google.spanner.v1.ExecuteBatchDmlResponse - * @instance - * @returns {Object.} JSON object - */ - ExecuteBatchDmlResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExecuteBatchDmlResponse - * @function getTypeUrl - * @memberof google.spanner.v1.ExecuteBatchDmlResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExecuteBatchDmlResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.ExecuteBatchDmlResponse"; - }; - - return ExecuteBatchDmlResponse; - })(); - - v1.PartitionOptions = (function() { - - /** - * Properties of a PartitionOptions. - * @memberof google.spanner.v1 - * @interface IPartitionOptions - * @property {number|Long|null} [partitionSizeBytes] PartitionOptions partitionSizeBytes - * @property {number|Long|null} [maxPartitions] PartitionOptions maxPartitions - */ - - /** - * Constructs a new PartitionOptions. - * @memberof google.spanner.v1 - * @classdesc Represents a PartitionOptions. - * @implements IPartitionOptions - * @constructor - * @param {google.spanner.v1.IPartitionOptions=} [properties] Properties to set - */ - function PartitionOptions(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PartitionOptions partitionSizeBytes. - * @member {number|Long} partitionSizeBytes - * @memberof google.spanner.v1.PartitionOptions - * @instance - */ - PartitionOptions.prototype.partitionSizeBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * PartitionOptions maxPartitions. - * @member {number|Long} maxPartitions - * @memberof google.spanner.v1.PartitionOptions - * @instance - */ - PartitionOptions.prototype.maxPartitions = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Creates a new PartitionOptions instance using the specified properties. - * @function create - * @memberof google.spanner.v1.PartitionOptions - * @static - * @param {google.spanner.v1.IPartitionOptions=} [properties] Properties to set - * @returns {google.spanner.v1.PartitionOptions} PartitionOptions instance - */ - PartitionOptions.create = function create(properties) { - return new PartitionOptions(properties); - }; - - /** - * Encodes the specified PartitionOptions message. Does not implicitly {@link google.spanner.v1.PartitionOptions.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.PartitionOptions - * @static - * @param {google.spanner.v1.IPartitionOptions} message PartitionOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PartitionOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.partitionSizeBytes != null && Object.hasOwnProperty.call(message, "partitionSizeBytes")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.partitionSizeBytes); - if (message.maxPartitions != null && Object.hasOwnProperty.call(message, "maxPartitions")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.maxPartitions); - return writer; - }; - - /** - * Encodes the specified PartitionOptions message, length delimited. Does not implicitly {@link google.spanner.v1.PartitionOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.PartitionOptions - * @static - * @param {google.spanner.v1.IPartitionOptions} message PartitionOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PartitionOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PartitionOptions message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.PartitionOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.PartitionOptions} PartitionOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PartitionOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.PartitionOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.partitionSizeBytes = reader.int64(); - break; - } - case 2: { - message.maxPartitions = reader.int64(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PartitionOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.PartitionOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.PartitionOptions} PartitionOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PartitionOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PartitionOptions message. - * @function verify - * @memberof google.spanner.v1.PartitionOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PartitionOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.partitionSizeBytes != null && message.hasOwnProperty("partitionSizeBytes")) - if (!$util.isInteger(message.partitionSizeBytes) && !(message.partitionSizeBytes && $util.isInteger(message.partitionSizeBytes.low) && $util.isInteger(message.partitionSizeBytes.high))) - return "partitionSizeBytes: integer|Long expected"; - if (message.maxPartitions != null && message.hasOwnProperty("maxPartitions")) - if (!$util.isInteger(message.maxPartitions) && !(message.maxPartitions && $util.isInteger(message.maxPartitions.low) && $util.isInteger(message.maxPartitions.high))) - return "maxPartitions: integer|Long expected"; - return null; - }; - - /** - * Creates a PartitionOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.PartitionOptions - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.PartitionOptions} PartitionOptions - */ - PartitionOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.PartitionOptions) - return object; - var message = new $root.google.spanner.v1.PartitionOptions(); - if (object.partitionSizeBytes != null) - if ($util.Long) - (message.partitionSizeBytes = $util.Long.fromValue(object.partitionSizeBytes)).unsigned = false; - else if (typeof object.partitionSizeBytes === "string") - message.partitionSizeBytes = parseInt(object.partitionSizeBytes, 10); - else if (typeof object.partitionSizeBytes === "number") - message.partitionSizeBytes = object.partitionSizeBytes; - else if (typeof object.partitionSizeBytes === "object") - message.partitionSizeBytes = new $util.LongBits(object.partitionSizeBytes.low >>> 0, object.partitionSizeBytes.high >>> 0).toNumber(); - if (object.maxPartitions != null) - if ($util.Long) - (message.maxPartitions = $util.Long.fromValue(object.maxPartitions)).unsigned = false; - else if (typeof object.maxPartitions === "string") - message.maxPartitions = parseInt(object.maxPartitions, 10); - else if (typeof object.maxPartitions === "number") - message.maxPartitions = object.maxPartitions; - else if (typeof object.maxPartitions === "object") - message.maxPartitions = new $util.LongBits(object.maxPartitions.low >>> 0, object.maxPartitions.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from a PartitionOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.PartitionOptions - * @static - * @param {google.spanner.v1.PartitionOptions} message PartitionOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PartitionOptions.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.partitionSizeBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.partitionSizeBytes = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.maxPartitions = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.maxPartitions = options.longs === String ? "0" : 0; - } - if (message.partitionSizeBytes != null && message.hasOwnProperty("partitionSizeBytes")) - if (typeof message.partitionSizeBytes === "number") - object.partitionSizeBytes = options.longs === String ? String(message.partitionSizeBytes) : message.partitionSizeBytes; - else - object.partitionSizeBytes = options.longs === String ? $util.Long.prototype.toString.call(message.partitionSizeBytes) : options.longs === Number ? new $util.LongBits(message.partitionSizeBytes.low >>> 0, message.partitionSizeBytes.high >>> 0).toNumber() : message.partitionSizeBytes; - if (message.maxPartitions != null && message.hasOwnProperty("maxPartitions")) - if (typeof message.maxPartitions === "number") - object.maxPartitions = options.longs === String ? String(message.maxPartitions) : message.maxPartitions; - else - object.maxPartitions = options.longs === String ? $util.Long.prototype.toString.call(message.maxPartitions) : options.longs === Number ? new $util.LongBits(message.maxPartitions.low >>> 0, message.maxPartitions.high >>> 0).toNumber() : message.maxPartitions; - return object; - }; - - /** - * Converts this PartitionOptions to JSON. - * @function toJSON - * @memberof google.spanner.v1.PartitionOptions - * @instance - * @returns {Object.} JSON object - */ - PartitionOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PartitionOptions - * @function getTypeUrl - * @memberof google.spanner.v1.PartitionOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PartitionOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.PartitionOptions"; - }; - - return PartitionOptions; - })(); - - v1.PartitionQueryRequest = (function() { - - /** - * Properties of a PartitionQueryRequest. - * @memberof google.spanner.v1 - * @interface IPartitionQueryRequest - * @property {string|null} [session] PartitionQueryRequest session - * @property {google.spanner.v1.ITransactionSelector|null} [transaction] PartitionQueryRequest transaction - * @property {string|null} [sql] PartitionQueryRequest sql - * @property {google.protobuf.IStruct|null} [params] PartitionQueryRequest params - * @property {Object.|null} [paramTypes] PartitionQueryRequest paramTypes - * @property {google.spanner.v1.IPartitionOptions|null} [partitionOptions] PartitionQueryRequest partitionOptions - */ - - /** - * Constructs a new PartitionQueryRequest. - * @memberof google.spanner.v1 - * @classdesc Represents a PartitionQueryRequest. - * @implements IPartitionQueryRequest - * @constructor - * @param {google.spanner.v1.IPartitionQueryRequest=} [properties] Properties to set - */ - function PartitionQueryRequest(properties) { - this.paramTypes = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PartitionQueryRequest session. - * @member {string} session - * @memberof google.spanner.v1.PartitionQueryRequest - * @instance - */ - PartitionQueryRequest.prototype.session = ""; - - /** - * PartitionQueryRequest transaction. - * @member {google.spanner.v1.ITransactionSelector|null|undefined} transaction - * @memberof google.spanner.v1.PartitionQueryRequest - * @instance - */ - PartitionQueryRequest.prototype.transaction = null; - - /** - * PartitionQueryRequest sql. - * @member {string} sql - * @memberof google.spanner.v1.PartitionQueryRequest - * @instance - */ - PartitionQueryRequest.prototype.sql = ""; - - /** - * PartitionQueryRequest params. - * @member {google.protobuf.IStruct|null|undefined} params - * @memberof google.spanner.v1.PartitionQueryRequest - * @instance - */ - PartitionQueryRequest.prototype.params = null; - - /** - * PartitionQueryRequest paramTypes. - * @member {Object.} paramTypes - * @memberof google.spanner.v1.PartitionQueryRequest - * @instance - */ - PartitionQueryRequest.prototype.paramTypes = $util.emptyObject; - - /** - * PartitionQueryRequest partitionOptions. - * @member {google.spanner.v1.IPartitionOptions|null|undefined} partitionOptions - * @memberof google.spanner.v1.PartitionQueryRequest - * @instance - */ - PartitionQueryRequest.prototype.partitionOptions = null; - - /** - * Creates a new PartitionQueryRequest instance using the specified properties. - * @function create - * @memberof google.spanner.v1.PartitionQueryRequest - * @static - * @param {google.spanner.v1.IPartitionQueryRequest=} [properties] Properties to set - * @returns {google.spanner.v1.PartitionQueryRequest} PartitionQueryRequest instance - */ - PartitionQueryRequest.create = function create(properties) { - return new PartitionQueryRequest(properties); - }; - - /** - * Encodes the specified PartitionQueryRequest message. Does not implicitly {@link google.spanner.v1.PartitionQueryRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.PartitionQueryRequest - * @static - * @param {google.spanner.v1.IPartitionQueryRequest} message PartitionQueryRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PartitionQueryRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.session != null && Object.hasOwnProperty.call(message, "session")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.session); - if (message.transaction != null && Object.hasOwnProperty.call(message, "transaction")) - $root.google.spanner.v1.TransactionSelector.encode(message.transaction, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.sql != null && Object.hasOwnProperty.call(message, "sql")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.sql); - if (message.params != null && Object.hasOwnProperty.call(message, "params")) - $root.google.protobuf.Struct.encode(message.params, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.paramTypes != null && Object.hasOwnProperty.call(message, "paramTypes")) - for (var keys = Object.keys(message.paramTypes), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.spanner.v1.Type.encode(message.paramTypes[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - if (message.partitionOptions != null && Object.hasOwnProperty.call(message, "partitionOptions")) - $root.google.spanner.v1.PartitionOptions.encode(message.partitionOptions, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified PartitionQueryRequest message, length delimited. Does not implicitly {@link google.spanner.v1.PartitionQueryRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.PartitionQueryRequest - * @static - * @param {google.spanner.v1.IPartitionQueryRequest} message PartitionQueryRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PartitionQueryRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PartitionQueryRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.PartitionQueryRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.PartitionQueryRequest} PartitionQueryRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PartitionQueryRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.PartitionQueryRequest(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.session = reader.string(); - break; - } - case 2: { - message.transaction = $root.google.spanner.v1.TransactionSelector.decode(reader, reader.uint32()); - break; - } - case 3: { - message.sql = reader.string(); - break; - } - case 4: { - message.params = $root.google.protobuf.Struct.decode(reader, reader.uint32()); - break; - } - case 5: { - if (message.paramTypes === $util.emptyObject) - message.paramTypes = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = null; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = $root.google.spanner.v1.Type.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.paramTypes[key] = value; - break; - } - case 6: { - message.partitionOptions = $root.google.spanner.v1.PartitionOptions.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PartitionQueryRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.PartitionQueryRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.PartitionQueryRequest} PartitionQueryRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PartitionQueryRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PartitionQueryRequest message. - * @function verify - * @memberof google.spanner.v1.PartitionQueryRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PartitionQueryRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.session != null && message.hasOwnProperty("session")) - if (!$util.isString(message.session)) - return "session: string expected"; - if (message.transaction != null && message.hasOwnProperty("transaction")) { - var error = $root.google.spanner.v1.TransactionSelector.verify(message.transaction); - if (error) - return "transaction." + error; - } - if (message.sql != null && message.hasOwnProperty("sql")) - if (!$util.isString(message.sql)) - return "sql: string expected"; - if (message.params != null && message.hasOwnProperty("params")) { - var error = $root.google.protobuf.Struct.verify(message.params); - if (error) - return "params." + error; - } - if (message.paramTypes != null && message.hasOwnProperty("paramTypes")) { - if (!$util.isObject(message.paramTypes)) - return "paramTypes: object expected"; - var key = Object.keys(message.paramTypes); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.spanner.v1.Type.verify(message.paramTypes[key[i]]); - if (error) - return "paramTypes." + error; - } - } - if (message.partitionOptions != null && message.hasOwnProperty("partitionOptions")) { - var error = $root.google.spanner.v1.PartitionOptions.verify(message.partitionOptions); - if (error) - return "partitionOptions." + error; - } - return null; - }; - - /** - * Creates a PartitionQueryRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.PartitionQueryRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.PartitionQueryRequest} PartitionQueryRequest - */ - PartitionQueryRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.PartitionQueryRequest) - return object; - var message = new $root.google.spanner.v1.PartitionQueryRequest(); - if (object.session != null) - message.session = String(object.session); - if (object.transaction != null) { - if (typeof object.transaction !== "object") - throw TypeError(".google.spanner.v1.PartitionQueryRequest.transaction: object expected"); - message.transaction = $root.google.spanner.v1.TransactionSelector.fromObject(object.transaction); - } - if (object.sql != null) - message.sql = String(object.sql); - if (object.params != null) { - if (typeof object.params !== "object") - throw TypeError(".google.spanner.v1.PartitionQueryRequest.params: object expected"); - message.params = $root.google.protobuf.Struct.fromObject(object.params); - } - if (object.paramTypes) { - if (typeof object.paramTypes !== "object") - throw TypeError(".google.spanner.v1.PartitionQueryRequest.paramTypes: object expected"); - message.paramTypes = {}; - for (var keys = Object.keys(object.paramTypes), i = 0; i < keys.length; ++i) { - if (typeof object.paramTypes[keys[i]] !== "object") - throw TypeError(".google.spanner.v1.PartitionQueryRequest.paramTypes: object expected"); - message.paramTypes[keys[i]] = $root.google.spanner.v1.Type.fromObject(object.paramTypes[keys[i]]); - } - } - if (object.partitionOptions != null) { - if (typeof object.partitionOptions !== "object") - throw TypeError(".google.spanner.v1.PartitionQueryRequest.partitionOptions: object expected"); - message.partitionOptions = $root.google.spanner.v1.PartitionOptions.fromObject(object.partitionOptions); - } - return message; - }; - - /** - * Creates a plain object from a PartitionQueryRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.PartitionQueryRequest - * @static - * @param {google.spanner.v1.PartitionQueryRequest} message PartitionQueryRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PartitionQueryRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.paramTypes = {}; - if (options.defaults) { - object.session = ""; - object.transaction = null; - object.sql = ""; - object.params = null; - object.partitionOptions = null; - } - if (message.session != null && message.hasOwnProperty("session")) - object.session = message.session; - if (message.transaction != null && message.hasOwnProperty("transaction")) - object.transaction = $root.google.spanner.v1.TransactionSelector.toObject(message.transaction, options); - if (message.sql != null && message.hasOwnProperty("sql")) - object.sql = message.sql; - if (message.params != null && message.hasOwnProperty("params")) - object.params = $root.google.protobuf.Struct.toObject(message.params, options); - var keys2; - if (message.paramTypes && (keys2 = Object.keys(message.paramTypes)).length) { - object.paramTypes = {}; - for (var j = 0; j < keys2.length; ++j) - object.paramTypes[keys2[j]] = $root.google.spanner.v1.Type.toObject(message.paramTypes[keys2[j]], options); - } - if (message.partitionOptions != null && message.hasOwnProperty("partitionOptions")) - object.partitionOptions = $root.google.spanner.v1.PartitionOptions.toObject(message.partitionOptions, options); - return object; - }; - - /** - * Converts this PartitionQueryRequest to JSON. - * @function toJSON - * @memberof google.spanner.v1.PartitionQueryRequest - * @instance - * @returns {Object.} JSON object - */ - PartitionQueryRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PartitionQueryRequest - * @function getTypeUrl - * @memberof google.spanner.v1.PartitionQueryRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PartitionQueryRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.PartitionQueryRequest"; - }; - - return PartitionQueryRequest; - })(); - - v1.PartitionReadRequest = (function() { - - /** - * Properties of a PartitionReadRequest. - * @memberof google.spanner.v1 - * @interface IPartitionReadRequest - * @property {string|null} [session] PartitionReadRequest session - * @property {google.spanner.v1.ITransactionSelector|null} [transaction] PartitionReadRequest transaction - * @property {string|null} [table] PartitionReadRequest table - * @property {string|null} [index] PartitionReadRequest index - * @property {Array.|null} [columns] PartitionReadRequest columns - * @property {google.spanner.v1.IKeySet|null} [keySet] PartitionReadRequest keySet - * @property {google.spanner.v1.IPartitionOptions|null} [partitionOptions] PartitionReadRequest partitionOptions - */ - - /** - * Constructs a new PartitionReadRequest. - * @memberof google.spanner.v1 - * @classdesc Represents a PartitionReadRequest. - * @implements IPartitionReadRequest - * @constructor - * @param {google.spanner.v1.IPartitionReadRequest=} [properties] Properties to set - */ - function PartitionReadRequest(properties) { - this.columns = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PartitionReadRequest session. - * @member {string} session - * @memberof google.spanner.v1.PartitionReadRequest - * @instance - */ - PartitionReadRequest.prototype.session = ""; - - /** - * PartitionReadRequest transaction. - * @member {google.spanner.v1.ITransactionSelector|null|undefined} transaction - * @memberof google.spanner.v1.PartitionReadRequest - * @instance - */ - PartitionReadRequest.prototype.transaction = null; - - /** - * PartitionReadRequest table. - * @member {string} table - * @memberof google.spanner.v1.PartitionReadRequest - * @instance - */ - PartitionReadRequest.prototype.table = ""; - - /** - * PartitionReadRequest index. - * @member {string} index - * @memberof google.spanner.v1.PartitionReadRequest - * @instance - */ - PartitionReadRequest.prototype.index = ""; - - /** - * PartitionReadRequest columns. - * @member {Array.} columns - * @memberof google.spanner.v1.PartitionReadRequest - * @instance - */ - PartitionReadRequest.prototype.columns = $util.emptyArray; - - /** - * PartitionReadRequest keySet. - * @member {google.spanner.v1.IKeySet|null|undefined} keySet - * @memberof google.spanner.v1.PartitionReadRequest - * @instance - */ - PartitionReadRequest.prototype.keySet = null; - - /** - * PartitionReadRequest partitionOptions. - * @member {google.spanner.v1.IPartitionOptions|null|undefined} partitionOptions - * @memberof google.spanner.v1.PartitionReadRequest - * @instance - */ - PartitionReadRequest.prototype.partitionOptions = null; - - /** - * Creates a new PartitionReadRequest instance using the specified properties. - * @function create - * @memberof google.spanner.v1.PartitionReadRequest - * @static - * @param {google.spanner.v1.IPartitionReadRequest=} [properties] Properties to set - * @returns {google.spanner.v1.PartitionReadRequest} PartitionReadRequest instance - */ - PartitionReadRequest.create = function create(properties) { - return new PartitionReadRequest(properties); - }; - - /** - * Encodes the specified PartitionReadRequest message. Does not implicitly {@link google.spanner.v1.PartitionReadRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.PartitionReadRequest - * @static - * @param {google.spanner.v1.IPartitionReadRequest} message PartitionReadRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PartitionReadRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.session != null && Object.hasOwnProperty.call(message, "session")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.session); - if (message.transaction != null && Object.hasOwnProperty.call(message, "transaction")) - $root.google.spanner.v1.TransactionSelector.encode(message.transaction, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.table != null && Object.hasOwnProperty.call(message, "table")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.table); - if (message.index != null && Object.hasOwnProperty.call(message, "index")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.index); - if (message.columns != null && message.columns.length) - for (var i = 0; i < message.columns.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.columns[i]); - if (message.keySet != null && Object.hasOwnProperty.call(message, "keySet")) - $root.google.spanner.v1.KeySet.encode(message.keySet, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.partitionOptions != null && Object.hasOwnProperty.call(message, "partitionOptions")) - $root.google.spanner.v1.PartitionOptions.encode(message.partitionOptions, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified PartitionReadRequest message, length delimited. Does not implicitly {@link google.spanner.v1.PartitionReadRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.PartitionReadRequest - * @static - * @param {google.spanner.v1.IPartitionReadRequest} message PartitionReadRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PartitionReadRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PartitionReadRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.PartitionReadRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.PartitionReadRequest} PartitionReadRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PartitionReadRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.PartitionReadRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.session = reader.string(); - break; - } - case 2: { - message.transaction = $root.google.spanner.v1.TransactionSelector.decode(reader, reader.uint32()); - break; - } - case 3: { - message.table = reader.string(); - break; - } - case 4: { - message.index = reader.string(); - break; - } - case 5: { - if (!(message.columns && message.columns.length)) - message.columns = []; - message.columns.push(reader.string()); - break; - } - case 6: { - message.keySet = $root.google.spanner.v1.KeySet.decode(reader, reader.uint32()); - break; - } - case 9: { - message.partitionOptions = $root.google.spanner.v1.PartitionOptions.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PartitionReadRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.PartitionReadRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.PartitionReadRequest} PartitionReadRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PartitionReadRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PartitionReadRequest message. - * @function verify - * @memberof google.spanner.v1.PartitionReadRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PartitionReadRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.session != null && message.hasOwnProperty("session")) - if (!$util.isString(message.session)) - return "session: string expected"; - if (message.transaction != null && message.hasOwnProperty("transaction")) { - var error = $root.google.spanner.v1.TransactionSelector.verify(message.transaction); - if (error) - return "transaction." + error; - } - if (message.table != null && message.hasOwnProperty("table")) - if (!$util.isString(message.table)) - return "table: string expected"; - if (message.index != null && message.hasOwnProperty("index")) - if (!$util.isString(message.index)) - return "index: string expected"; - if (message.columns != null && message.hasOwnProperty("columns")) { - if (!Array.isArray(message.columns)) - return "columns: array expected"; - for (var i = 0; i < message.columns.length; ++i) - if (!$util.isString(message.columns[i])) - return "columns: string[] expected"; - } - if (message.keySet != null && message.hasOwnProperty("keySet")) { - var error = $root.google.spanner.v1.KeySet.verify(message.keySet); - if (error) - return "keySet." + error; - } - if (message.partitionOptions != null && message.hasOwnProperty("partitionOptions")) { - var error = $root.google.spanner.v1.PartitionOptions.verify(message.partitionOptions); - if (error) - return "partitionOptions." + error; - } - return null; - }; - - /** - * Creates a PartitionReadRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.PartitionReadRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.PartitionReadRequest} PartitionReadRequest - */ - PartitionReadRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.PartitionReadRequest) - return object; - var message = new $root.google.spanner.v1.PartitionReadRequest(); - if (object.session != null) - message.session = String(object.session); - if (object.transaction != null) { - if (typeof object.transaction !== "object") - throw TypeError(".google.spanner.v1.PartitionReadRequest.transaction: object expected"); - message.transaction = $root.google.spanner.v1.TransactionSelector.fromObject(object.transaction); - } - if (object.table != null) - message.table = String(object.table); - if (object.index != null) - message.index = String(object.index); - if (object.columns) { - if (!Array.isArray(object.columns)) - throw TypeError(".google.spanner.v1.PartitionReadRequest.columns: array expected"); - message.columns = []; - for (var i = 0; i < object.columns.length; ++i) - message.columns[i] = String(object.columns[i]); - } - if (object.keySet != null) { - if (typeof object.keySet !== "object") - throw TypeError(".google.spanner.v1.PartitionReadRequest.keySet: object expected"); - message.keySet = $root.google.spanner.v1.KeySet.fromObject(object.keySet); - } - if (object.partitionOptions != null) { - if (typeof object.partitionOptions !== "object") - throw TypeError(".google.spanner.v1.PartitionReadRequest.partitionOptions: object expected"); - message.partitionOptions = $root.google.spanner.v1.PartitionOptions.fromObject(object.partitionOptions); - } - return message; - }; - - /** - * Creates a plain object from a PartitionReadRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.PartitionReadRequest - * @static - * @param {google.spanner.v1.PartitionReadRequest} message PartitionReadRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PartitionReadRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.columns = []; - if (options.defaults) { - object.session = ""; - object.transaction = null; - object.table = ""; - object.index = ""; - object.keySet = null; - object.partitionOptions = null; - } - if (message.session != null && message.hasOwnProperty("session")) - object.session = message.session; - if (message.transaction != null && message.hasOwnProperty("transaction")) - object.transaction = $root.google.spanner.v1.TransactionSelector.toObject(message.transaction, options); - if (message.table != null && message.hasOwnProperty("table")) - object.table = message.table; - if (message.index != null && message.hasOwnProperty("index")) - object.index = message.index; - if (message.columns && message.columns.length) { - object.columns = []; - for (var j = 0; j < message.columns.length; ++j) - object.columns[j] = message.columns[j]; - } - if (message.keySet != null && message.hasOwnProperty("keySet")) - object.keySet = $root.google.spanner.v1.KeySet.toObject(message.keySet, options); - if (message.partitionOptions != null && message.hasOwnProperty("partitionOptions")) - object.partitionOptions = $root.google.spanner.v1.PartitionOptions.toObject(message.partitionOptions, options); - return object; - }; - - /** - * Converts this PartitionReadRequest to JSON. - * @function toJSON - * @memberof google.spanner.v1.PartitionReadRequest - * @instance - * @returns {Object.} JSON object - */ - PartitionReadRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PartitionReadRequest - * @function getTypeUrl - * @memberof google.spanner.v1.PartitionReadRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PartitionReadRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.PartitionReadRequest"; - }; - - return PartitionReadRequest; - })(); - - v1.Partition = (function() { - - /** - * Properties of a Partition. - * @memberof google.spanner.v1 - * @interface IPartition - * @property {Uint8Array|null} [partitionToken] Partition partitionToken - */ - - /** - * Constructs a new Partition. - * @memberof google.spanner.v1 - * @classdesc Represents a Partition. - * @implements IPartition - * @constructor - * @param {google.spanner.v1.IPartition=} [properties] Properties to set - */ - function Partition(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Partition partitionToken. - * @member {Uint8Array} partitionToken - * @memberof google.spanner.v1.Partition - * @instance - */ - Partition.prototype.partitionToken = $util.newBuffer([]); - - /** - * Creates a new Partition instance using the specified properties. - * @function create - * @memberof google.spanner.v1.Partition - * @static - * @param {google.spanner.v1.IPartition=} [properties] Properties to set - * @returns {google.spanner.v1.Partition} Partition instance - */ - Partition.create = function create(properties) { - return new Partition(properties); - }; - - /** - * Encodes the specified Partition message. Does not implicitly {@link google.spanner.v1.Partition.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.Partition - * @static - * @param {google.spanner.v1.IPartition} message Partition message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Partition.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.partitionToken != null && Object.hasOwnProperty.call(message, "partitionToken")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.partitionToken); - return writer; - }; - - /** - * Encodes the specified Partition message, length delimited. Does not implicitly {@link google.spanner.v1.Partition.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.Partition - * @static - * @param {google.spanner.v1.IPartition} message Partition message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Partition.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Partition message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.Partition - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.Partition} Partition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Partition.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.Partition(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.partitionToken = reader.bytes(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Partition message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.Partition - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.Partition} Partition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Partition.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Partition message. - * @function verify - * @memberof google.spanner.v1.Partition - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Partition.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.partitionToken != null && message.hasOwnProperty("partitionToken")) - if (!(message.partitionToken && typeof message.partitionToken.length === "number" || $util.isString(message.partitionToken))) - return "partitionToken: buffer expected"; - return null; - }; - - /** - * Creates a Partition message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.Partition - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.Partition} Partition - */ - Partition.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.Partition) - return object; - var message = new $root.google.spanner.v1.Partition(); - if (object.partitionToken != null) - if (typeof object.partitionToken === "string") - $util.base64.decode(object.partitionToken, message.partitionToken = $util.newBuffer($util.base64.length(object.partitionToken)), 0); - else if (object.partitionToken.length >= 0) - message.partitionToken = object.partitionToken; - return message; - }; - - /** - * Creates a plain object from a Partition message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.Partition - * @static - * @param {google.spanner.v1.Partition} message Partition - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Partition.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - if (options.bytes === String) - object.partitionToken = ""; - else { - object.partitionToken = []; - if (options.bytes !== Array) - object.partitionToken = $util.newBuffer(object.partitionToken); - } - if (message.partitionToken != null && message.hasOwnProperty("partitionToken")) - object.partitionToken = options.bytes === String ? $util.base64.encode(message.partitionToken, 0, message.partitionToken.length) : options.bytes === Array ? Array.prototype.slice.call(message.partitionToken) : message.partitionToken; - return object; - }; - - /** - * Converts this Partition to JSON. - * @function toJSON - * @memberof google.spanner.v1.Partition - * @instance - * @returns {Object.} JSON object - */ - Partition.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Partition - * @function getTypeUrl - * @memberof google.spanner.v1.Partition - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Partition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.Partition"; - }; - - return Partition; - })(); - - v1.PartitionResponse = (function() { - - /** - * Properties of a PartitionResponse. - * @memberof google.spanner.v1 - * @interface IPartitionResponse - * @property {Array.|null} [partitions] PartitionResponse partitions - * @property {google.spanner.v1.ITransaction|null} [transaction] PartitionResponse transaction - */ - - /** - * Constructs a new PartitionResponse. - * @memberof google.spanner.v1 - * @classdesc Represents a PartitionResponse. - * @implements IPartitionResponse - * @constructor - * @param {google.spanner.v1.IPartitionResponse=} [properties] Properties to set - */ - function PartitionResponse(properties) { - this.partitions = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PartitionResponse partitions. - * @member {Array.} partitions - * @memberof google.spanner.v1.PartitionResponse - * @instance - */ - PartitionResponse.prototype.partitions = $util.emptyArray; - - /** - * PartitionResponse transaction. - * @member {google.spanner.v1.ITransaction|null|undefined} transaction - * @memberof google.spanner.v1.PartitionResponse - * @instance - */ - PartitionResponse.prototype.transaction = null; - - /** - * Creates a new PartitionResponse instance using the specified properties. - * @function create - * @memberof google.spanner.v1.PartitionResponse - * @static - * @param {google.spanner.v1.IPartitionResponse=} [properties] Properties to set - * @returns {google.spanner.v1.PartitionResponse} PartitionResponse instance - */ - PartitionResponse.create = function create(properties) { - return new PartitionResponse(properties); - }; - - /** - * Encodes the specified PartitionResponse message. Does not implicitly {@link google.spanner.v1.PartitionResponse.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.PartitionResponse - * @static - * @param {google.spanner.v1.IPartitionResponse} message PartitionResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PartitionResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.partitions != null && message.partitions.length) - for (var i = 0; i < message.partitions.length; ++i) - $root.google.spanner.v1.Partition.encode(message.partitions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.transaction != null && Object.hasOwnProperty.call(message, "transaction")) - $root.google.spanner.v1.Transaction.encode(message.transaction, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified PartitionResponse message, length delimited. Does not implicitly {@link google.spanner.v1.PartitionResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.PartitionResponse - * @static - * @param {google.spanner.v1.IPartitionResponse} message PartitionResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PartitionResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PartitionResponse message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.PartitionResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.PartitionResponse} PartitionResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PartitionResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.PartitionResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.partitions && message.partitions.length)) - message.partitions = []; - message.partitions.push($root.google.spanner.v1.Partition.decode(reader, reader.uint32())); - break; - } - case 2: { - message.transaction = $root.google.spanner.v1.Transaction.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PartitionResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.PartitionResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.PartitionResponse} PartitionResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PartitionResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PartitionResponse message. - * @function verify - * @memberof google.spanner.v1.PartitionResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PartitionResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.partitions != null && message.hasOwnProperty("partitions")) { - if (!Array.isArray(message.partitions)) - return "partitions: array expected"; - for (var i = 0; i < message.partitions.length; ++i) { - var error = $root.google.spanner.v1.Partition.verify(message.partitions[i]); - if (error) - return "partitions." + error; - } - } - if (message.transaction != null && message.hasOwnProperty("transaction")) { - var error = $root.google.spanner.v1.Transaction.verify(message.transaction); - if (error) - return "transaction." + error; - } - return null; - }; - - /** - * Creates a PartitionResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.PartitionResponse - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.PartitionResponse} PartitionResponse - */ - PartitionResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.PartitionResponse) - return object; - var message = new $root.google.spanner.v1.PartitionResponse(); - if (object.partitions) { - if (!Array.isArray(object.partitions)) - throw TypeError(".google.spanner.v1.PartitionResponse.partitions: array expected"); - message.partitions = []; - for (var i = 0; i < object.partitions.length; ++i) { - if (typeof object.partitions[i] !== "object") - throw TypeError(".google.spanner.v1.PartitionResponse.partitions: object expected"); - message.partitions[i] = $root.google.spanner.v1.Partition.fromObject(object.partitions[i]); - } - } - if (object.transaction != null) { - if (typeof object.transaction !== "object") - throw TypeError(".google.spanner.v1.PartitionResponse.transaction: object expected"); - message.transaction = $root.google.spanner.v1.Transaction.fromObject(object.transaction); - } - return message; - }; - - /** - * Creates a plain object from a PartitionResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.PartitionResponse - * @static - * @param {google.spanner.v1.PartitionResponse} message PartitionResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PartitionResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.partitions = []; - if (options.defaults) - object.transaction = null; - if (message.partitions && message.partitions.length) { - object.partitions = []; - for (var j = 0; j < message.partitions.length; ++j) - object.partitions[j] = $root.google.spanner.v1.Partition.toObject(message.partitions[j], options); - } - if (message.transaction != null && message.hasOwnProperty("transaction")) - object.transaction = $root.google.spanner.v1.Transaction.toObject(message.transaction, options); - return object; - }; - - /** - * Converts this PartitionResponse to JSON. - * @function toJSON - * @memberof google.spanner.v1.PartitionResponse - * @instance - * @returns {Object.} JSON object - */ - PartitionResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PartitionResponse - * @function getTypeUrl - * @memberof google.spanner.v1.PartitionResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PartitionResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.PartitionResponse"; - }; - - return PartitionResponse; - })(); - - v1.ReadRequest = (function() { - - /** - * Properties of a ReadRequest. - * @memberof google.spanner.v1 - * @interface IReadRequest - * @property {string|null} [session] ReadRequest session - * @property {google.spanner.v1.ITransactionSelector|null} [transaction] ReadRequest transaction - * @property {string|null} [table] ReadRequest table - * @property {string|null} [index] ReadRequest index - * @property {Array.|null} [columns] ReadRequest columns - * @property {google.spanner.v1.IKeySet|null} [keySet] ReadRequest keySet - * @property {number|Long|null} [limit] ReadRequest limit - * @property {Uint8Array|null} [resumeToken] ReadRequest resumeToken - * @property {Uint8Array|null} [partitionToken] ReadRequest partitionToken - * @property {google.spanner.v1.IRequestOptions|null} [requestOptions] ReadRequest requestOptions - * @property {google.spanner.v1.IDirectedReadOptions|null} [directedReadOptions] ReadRequest directedReadOptions - * @property {boolean|null} [dataBoostEnabled] ReadRequest dataBoostEnabled - * @property {google.spanner.v1.ReadRequest.OrderBy|null} [orderBy] ReadRequest orderBy - * @property {google.spanner.v1.ReadRequest.LockHint|null} [lockHint] ReadRequest lockHint - * @property {google.spanner.v1.IRoutingHint|null} [routingHint] ReadRequest routingHint - */ - - /** - * Constructs a new ReadRequest. - * @memberof google.spanner.v1 - * @classdesc Represents a ReadRequest. - * @implements IReadRequest - * @constructor - * @param {google.spanner.v1.IReadRequest=} [properties] Properties to set - */ - function ReadRequest(properties) { - this.columns = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ReadRequest session. - * @member {string} session - * @memberof google.spanner.v1.ReadRequest - * @instance - */ - ReadRequest.prototype.session = ""; - - /** - * ReadRequest transaction. - * @member {google.spanner.v1.ITransactionSelector|null|undefined} transaction - * @memberof google.spanner.v1.ReadRequest - * @instance - */ - ReadRequest.prototype.transaction = null; - - /** - * ReadRequest table. - * @member {string} table - * @memberof google.spanner.v1.ReadRequest - * @instance - */ - ReadRequest.prototype.table = ""; - - /** - * ReadRequest index. - * @member {string} index - * @memberof google.spanner.v1.ReadRequest - * @instance - */ - ReadRequest.prototype.index = ""; - - /** - * ReadRequest columns. - * @member {Array.} columns - * @memberof google.spanner.v1.ReadRequest - * @instance - */ - ReadRequest.prototype.columns = $util.emptyArray; - - /** - * ReadRequest keySet. - * @member {google.spanner.v1.IKeySet|null|undefined} keySet - * @memberof google.spanner.v1.ReadRequest - * @instance - */ - ReadRequest.prototype.keySet = null; - - /** - * ReadRequest limit. - * @member {number|Long} limit - * @memberof google.spanner.v1.ReadRequest - * @instance - */ - ReadRequest.prototype.limit = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * ReadRequest resumeToken. - * @member {Uint8Array} resumeToken - * @memberof google.spanner.v1.ReadRequest - * @instance - */ - ReadRequest.prototype.resumeToken = $util.newBuffer([]); - - /** - * ReadRequest partitionToken. - * @member {Uint8Array} partitionToken - * @memberof google.spanner.v1.ReadRequest - * @instance - */ - ReadRequest.prototype.partitionToken = $util.newBuffer([]); - - /** - * ReadRequest requestOptions. - * @member {google.spanner.v1.IRequestOptions|null|undefined} requestOptions - * @memberof google.spanner.v1.ReadRequest - * @instance - */ - ReadRequest.prototype.requestOptions = null; - - /** - * ReadRequest directedReadOptions. - * @member {google.spanner.v1.IDirectedReadOptions|null|undefined} directedReadOptions - * @memberof google.spanner.v1.ReadRequest - * @instance - */ - ReadRequest.prototype.directedReadOptions = null; - - /** - * ReadRequest dataBoostEnabled. - * @member {boolean} dataBoostEnabled - * @memberof google.spanner.v1.ReadRequest - * @instance - */ - ReadRequest.prototype.dataBoostEnabled = false; - - /** - * ReadRequest orderBy. - * @member {google.spanner.v1.ReadRequest.OrderBy} orderBy - * @memberof google.spanner.v1.ReadRequest - * @instance - */ - ReadRequest.prototype.orderBy = 0; - - /** - * ReadRequest lockHint. - * @member {google.spanner.v1.ReadRequest.LockHint} lockHint - * @memberof google.spanner.v1.ReadRequest - * @instance - */ - ReadRequest.prototype.lockHint = 0; - - /** - * ReadRequest routingHint. - * @member {google.spanner.v1.IRoutingHint|null|undefined} routingHint - * @memberof google.spanner.v1.ReadRequest - * @instance - */ - ReadRequest.prototype.routingHint = null; - - /** - * Creates a new ReadRequest instance using the specified properties. - * @function create - * @memberof google.spanner.v1.ReadRequest - * @static - * @param {google.spanner.v1.IReadRequest=} [properties] Properties to set - * @returns {google.spanner.v1.ReadRequest} ReadRequest instance - */ - ReadRequest.create = function create(properties) { - return new ReadRequest(properties); - }; - - /** - * Encodes the specified ReadRequest message. Does not implicitly {@link google.spanner.v1.ReadRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.ReadRequest - * @static - * @param {google.spanner.v1.IReadRequest} message ReadRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReadRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.session != null && Object.hasOwnProperty.call(message, "session")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.session); - if (message.transaction != null && Object.hasOwnProperty.call(message, "transaction")) - $root.google.spanner.v1.TransactionSelector.encode(message.transaction, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.table != null && Object.hasOwnProperty.call(message, "table")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.table); - if (message.index != null && Object.hasOwnProperty.call(message, "index")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.index); - if (message.columns != null && message.columns.length) - for (var i = 0; i < message.columns.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.columns[i]); - if (message.keySet != null && Object.hasOwnProperty.call(message, "keySet")) - $root.google.spanner.v1.KeySet.encode(message.keySet, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) - writer.uint32(/* id 8, wireType 0 =*/64).int64(message.limit); - if (message.resumeToken != null && Object.hasOwnProperty.call(message, "resumeToken")) - writer.uint32(/* id 9, wireType 2 =*/74).bytes(message.resumeToken); - if (message.partitionToken != null && Object.hasOwnProperty.call(message, "partitionToken")) - writer.uint32(/* id 10, wireType 2 =*/82).bytes(message.partitionToken); - if (message.requestOptions != null && Object.hasOwnProperty.call(message, "requestOptions")) - $root.google.spanner.v1.RequestOptions.encode(message.requestOptions, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.directedReadOptions != null && Object.hasOwnProperty.call(message, "directedReadOptions")) - $root.google.spanner.v1.DirectedReadOptions.encode(message.directedReadOptions, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); - if (message.dataBoostEnabled != null && Object.hasOwnProperty.call(message, "dataBoostEnabled")) - writer.uint32(/* id 15, wireType 0 =*/120).bool(message.dataBoostEnabled); - if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) - writer.uint32(/* id 16, wireType 0 =*/128).int32(message.orderBy); - if (message.lockHint != null && Object.hasOwnProperty.call(message, "lockHint")) - writer.uint32(/* id 17, wireType 0 =*/136).int32(message.lockHint); - if (message.routingHint != null && Object.hasOwnProperty.call(message, "routingHint")) - $root.google.spanner.v1.RoutingHint.encode(message.routingHint, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ReadRequest message, length delimited. Does not implicitly {@link google.spanner.v1.ReadRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.ReadRequest - * @static - * @param {google.spanner.v1.IReadRequest} message ReadRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReadRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ReadRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.ReadRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.ReadRequest} ReadRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReadRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.ReadRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.session = reader.string(); - break; - } - case 2: { - message.transaction = $root.google.spanner.v1.TransactionSelector.decode(reader, reader.uint32()); - break; - } - case 3: { - message.table = reader.string(); - break; - } - case 4: { - message.index = reader.string(); - break; - } - case 5: { - if (!(message.columns && message.columns.length)) - message.columns = []; - message.columns.push(reader.string()); - break; - } - case 6: { - message.keySet = $root.google.spanner.v1.KeySet.decode(reader, reader.uint32()); - break; - } - case 8: { - message.limit = reader.int64(); - break; - } - case 9: { - message.resumeToken = reader.bytes(); - break; - } - case 10: { - message.partitionToken = reader.bytes(); - break; - } - case 11: { - message.requestOptions = $root.google.spanner.v1.RequestOptions.decode(reader, reader.uint32()); - break; - } - case 14: { - message.directedReadOptions = $root.google.spanner.v1.DirectedReadOptions.decode(reader, reader.uint32()); - break; - } - case 15: { - message.dataBoostEnabled = reader.bool(); - break; - } - case 16: { - message.orderBy = reader.int32(); - break; - } - case 17: { - message.lockHint = reader.int32(); - break; - } - case 18: { - message.routingHint = $root.google.spanner.v1.RoutingHint.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ReadRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.ReadRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.ReadRequest} ReadRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReadRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ReadRequest message. - * @function verify - * @memberof google.spanner.v1.ReadRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ReadRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.session != null && message.hasOwnProperty("session")) - if (!$util.isString(message.session)) - return "session: string expected"; - if (message.transaction != null && message.hasOwnProperty("transaction")) { - var error = $root.google.spanner.v1.TransactionSelector.verify(message.transaction); - if (error) - return "transaction." + error; - } - if (message.table != null && message.hasOwnProperty("table")) - if (!$util.isString(message.table)) - return "table: string expected"; - if (message.index != null && message.hasOwnProperty("index")) - if (!$util.isString(message.index)) - return "index: string expected"; - if (message.columns != null && message.hasOwnProperty("columns")) { - if (!Array.isArray(message.columns)) - return "columns: array expected"; - for (var i = 0; i < message.columns.length; ++i) - if (!$util.isString(message.columns[i])) - return "columns: string[] expected"; - } - if (message.keySet != null && message.hasOwnProperty("keySet")) { - var error = $root.google.spanner.v1.KeySet.verify(message.keySet); - if (error) - return "keySet." + error; - } - if (message.limit != null && message.hasOwnProperty("limit")) - if (!$util.isInteger(message.limit) && !(message.limit && $util.isInteger(message.limit.low) && $util.isInteger(message.limit.high))) - return "limit: integer|Long expected"; - if (message.resumeToken != null && message.hasOwnProperty("resumeToken")) - if (!(message.resumeToken && typeof message.resumeToken.length === "number" || $util.isString(message.resumeToken))) - return "resumeToken: buffer expected"; - if (message.partitionToken != null && message.hasOwnProperty("partitionToken")) - if (!(message.partitionToken && typeof message.partitionToken.length === "number" || $util.isString(message.partitionToken))) - return "partitionToken: buffer expected"; - if (message.requestOptions != null && message.hasOwnProperty("requestOptions")) { - var error = $root.google.spanner.v1.RequestOptions.verify(message.requestOptions); - if (error) - return "requestOptions." + error; - } - if (message.directedReadOptions != null && message.hasOwnProperty("directedReadOptions")) { - var error = $root.google.spanner.v1.DirectedReadOptions.verify(message.directedReadOptions); - if (error) - return "directedReadOptions." + error; - } - if (message.dataBoostEnabled != null && message.hasOwnProperty("dataBoostEnabled")) - if (typeof message.dataBoostEnabled !== "boolean") - return "dataBoostEnabled: boolean expected"; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - switch (message.orderBy) { - default: - return "orderBy: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.lockHint != null && message.hasOwnProperty("lockHint")) - switch (message.lockHint) { - default: - return "lockHint: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.routingHint != null && message.hasOwnProperty("routingHint")) { - var error = $root.google.spanner.v1.RoutingHint.verify(message.routingHint); - if (error) - return "routingHint." + error; - } - return null; - }; - - /** - * Creates a ReadRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.ReadRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.ReadRequest} ReadRequest - */ - ReadRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.ReadRequest) - return object; - var message = new $root.google.spanner.v1.ReadRequest(); - if (object.session != null) - message.session = String(object.session); - if (object.transaction != null) { - if (typeof object.transaction !== "object") - throw TypeError(".google.spanner.v1.ReadRequest.transaction: object expected"); - message.transaction = $root.google.spanner.v1.TransactionSelector.fromObject(object.transaction); - } - if (object.table != null) - message.table = String(object.table); - if (object.index != null) - message.index = String(object.index); - if (object.columns) { - if (!Array.isArray(object.columns)) - throw TypeError(".google.spanner.v1.ReadRequest.columns: array expected"); - message.columns = []; - for (var i = 0; i < object.columns.length; ++i) - message.columns[i] = String(object.columns[i]); - } - if (object.keySet != null) { - if (typeof object.keySet !== "object") - throw TypeError(".google.spanner.v1.ReadRequest.keySet: object expected"); - message.keySet = $root.google.spanner.v1.KeySet.fromObject(object.keySet); - } - if (object.limit != null) - if ($util.Long) - (message.limit = $util.Long.fromValue(object.limit)).unsigned = false; - else if (typeof object.limit === "string") - message.limit = parseInt(object.limit, 10); - else if (typeof object.limit === "number") - message.limit = object.limit; - else if (typeof object.limit === "object") - message.limit = new $util.LongBits(object.limit.low >>> 0, object.limit.high >>> 0).toNumber(); - if (object.resumeToken != null) - if (typeof object.resumeToken === "string") - $util.base64.decode(object.resumeToken, message.resumeToken = $util.newBuffer($util.base64.length(object.resumeToken)), 0); - else if (object.resumeToken.length >= 0) - message.resumeToken = object.resumeToken; - if (object.partitionToken != null) - if (typeof object.partitionToken === "string") - $util.base64.decode(object.partitionToken, message.partitionToken = $util.newBuffer($util.base64.length(object.partitionToken)), 0); - else if (object.partitionToken.length >= 0) - message.partitionToken = object.partitionToken; - if (object.requestOptions != null) { - if (typeof object.requestOptions !== "object") - throw TypeError(".google.spanner.v1.ReadRequest.requestOptions: object expected"); - message.requestOptions = $root.google.spanner.v1.RequestOptions.fromObject(object.requestOptions); - } - if (object.directedReadOptions != null) { - if (typeof object.directedReadOptions !== "object") - throw TypeError(".google.spanner.v1.ReadRequest.directedReadOptions: object expected"); - message.directedReadOptions = $root.google.spanner.v1.DirectedReadOptions.fromObject(object.directedReadOptions); - } - if (object.dataBoostEnabled != null) - message.dataBoostEnabled = Boolean(object.dataBoostEnabled); - switch (object.orderBy) { - default: - if (typeof object.orderBy === "number") { - message.orderBy = object.orderBy; - break; - } - break; - case "ORDER_BY_UNSPECIFIED": - case 0: - message.orderBy = 0; - break; - case "ORDER_BY_PRIMARY_KEY": - case 1: - message.orderBy = 1; - break; - case "ORDER_BY_NO_ORDER": - case 2: - message.orderBy = 2; - break; - } - switch (object.lockHint) { - default: - if (typeof object.lockHint === "number") { - message.lockHint = object.lockHint; - break; - } - break; - case "LOCK_HINT_UNSPECIFIED": - case 0: - message.lockHint = 0; - break; - case "LOCK_HINT_SHARED": - case 1: - message.lockHint = 1; - break; - case "LOCK_HINT_EXCLUSIVE": - case 2: - message.lockHint = 2; - break; - } - if (object.routingHint != null) { - if (typeof object.routingHint !== "object") - throw TypeError(".google.spanner.v1.ReadRequest.routingHint: object expected"); - message.routingHint = $root.google.spanner.v1.RoutingHint.fromObject(object.routingHint); - } - return message; - }; - - /** - * Creates a plain object from a ReadRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.ReadRequest - * @static - * @param {google.spanner.v1.ReadRequest} message ReadRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ReadRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.columns = []; - if (options.defaults) { - object.session = ""; - object.transaction = null; - object.table = ""; - object.index = ""; - object.keySet = null; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.limit = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.limit = options.longs === String ? "0" : 0; - if (options.bytes === String) - object.resumeToken = ""; - else { - object.resumeToken = []; - if (options.bytes !== Array) - object.resumeToken = $util.newBuffer(object.resumeToken); - } - if (options.bytes === String) - object.partitionToken = ""; - else { - object.partitionToken = []; - if (options.bytes !== Array) - object.partitionToken = $util.newBuffer(object.partitionToken); - } - object.requestOptions = null; - object.directedReadOptions = null; - object.dataBoostEnabled = false; - object.orderBy = options.enums === String ? "ORDER_BY_UNSPECIFIED" : 0; - object.lockHint = options.enums === String ? "LOCK_HINT_UNSPECIFIED" : 0; - object.routingHint = null; - } - if (message.session != null && message.hasOwnProperty("session")) - object.session = message.session; - if (message.transaction != null && message.hasOwnProperty("transaction")) - object.transaction = $root.google.spanner.v1.TransactionSelector.toObject(message.transaction, options); - if (message.table != null && message.hasOwnProperty("table")) - object.table = message.table; - if (message.index != null && message.hasOwnProperty("index")) - object.index = message.index; - if (message.columns && message.columns.length) { - object.columns = []; - for (var j = 0; j < message.columns.length; ++j) - object.columns[j] = message.columns[j]; - } - if (message.keySet != null && message.hasOwnProperty("keySet")) - object.keySet = $root.google.spanner.v1.KeySet.toObject(message.keySet, options); - if (message.limit != null && message.hasOwnProperty("limit")) - if (typeof message.limit === "number") - object.limit = options.longs === String ? String(message.limit) : message.limit; - else - object.limit = options.longs === String ? $util.Long.prototype.toString.call(message.limit) : options.longs === Number ? new $util.LongBits(message.limit.low >>> 0, message.limit.high >>> 0).toNumber() : message.limit; - if (message.resumeToken != null && message.hasOwnProperty("resumeToken")) - object.resumeToken = options.bytes === String ? $util.base64.encode(message.resumeToken, 0, message.resumeToken.length) : options.bytes === Array ? Array.prototype.slice.call(message.resumeToken) : message.resumeToken; - if (message.partitionToken != null && message.hasOwnProperty("partitionToken")) - object.partitionToken = options.bytes === String ? $util.base64.encode(message.partitionToken, 0, message.partitionToken.length) : options.bytes === Array ? Array.prototype.slice.call(message.partitionToken) : message.partitionToken; - if (message.requestOptions != null && message.hasOwnProperty("requestOptions")) - object.requestOptions = $root.google.spanner.v1.RequestOptions.toObject(message.requestOptions, options); - if (message.directedReadOptions != null && message.hasOwnProperty("directedReadOptions")) - object.directedReadOptions = $root.google.spanner.v1.DirectedReadOptions.toObject(message.directedReadOptions, options); - if (message.dataBoostEnabled != null && message.hasOwnProperty("dataBoostEnabled")) - object.dataBoostEnabled = message.dataBoostEnabled; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - object.orderBy = options.enums === String ? $root.google.spanner.v1.ReadRequest.OrderBy[message.orderBy] === undefined ? message.orderBy : $root.google.spanner.v1.ReadRequest.OrderBy[message.orderBy] : message.orderBy; - if (message.lockHint != null && message.hasOwnProperty("lockHint")) - object.lockHint = options.enums === String ? $root.google.spanner.v1.ReadRequest.LockHint[message.lockHint] === undefined ? message.lockHint : $root.google.spanner.v1.ReadRequest.LockHint[message.lockHint] : message.lockHint; - if (message.routingHint != null && message.hasOwnProperty("routingHint")) - object.routingHint = $root.google.spanner.v1.RoutingHint.toObject(message.routingHint, options); - return object; - }; - - /** - * Converts this ReadRequest to JSON. - * @function toJSON - * @memberof google.spanner.v1.ReadRequest - * @instance - * @returns {Object.} JSON object - */ - ReadRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ReadRequest - * @function getTypeUrl - * @memberof google.spanner.v1.ReadRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ReadRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.ReadRequest"; - }; - - /** - * OrderBy enum. - * @name google.spanner.v1.ReadRequest.OrderBy - * @enum {number} - * @property {number} ORDER_BY_UNSPECIFIED=0 ORDER_BY_UNSPECIFIED value - * @property {number} ORDER_BY_PRIMARY_KEY=1 ORDER_BY_PRIMARY_KEY value - * @property {number} ORDER_BY_NO_ORDER=2 ORDER_BY_NO_ORDER value - */ - ReadRequest.OrderBy = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ORDER_BY_UNSPECIFIED"] = 0; - values[valuesById[1] = "ORDER_BY_PRIMARY_KEY"] = 1; - values[valuesById[2] = "ORDER_BY_NO_ORDER"] = 2; - return values; - })(); - - /** - * LockHint enum. - * @name google.spanner.v1.ReadRequest.LockHint - * @enum {number} - * @property {number} LOCK_HINT_UNSPECIFIED=0 LOCK_HINT_UNSPECIFIED value - * @property {number} LOCK_HINT_SHARED=1 LOCK_HINT_SHARED value - * @property {number} LOCK_HINT_EXCLUSIVE=2 LOCK_HINT_EXCLUSIVE value - */ - ReadRequest.LockHint = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "LOCK_HINT_UNSPECIFIED"] = 0; - values[valuesById[1] = "LOCK_HINT_SHARED"] = 1; - values[valuesById[2] = "LOCK_HINT_EXCLUSIVE"] = 2; - return values; - })(); - - return ReadRequest; - })(); - - v1.BeginTransactionRequest = (function() { - - /** - * Properties of a BeginTransactionRequest. - * @memberof google.spanner.v1 - * @interface IBeginTransactionRequest - * @property {string|null} [session] BeginTransactionRequest session - * @property {google.spanner.v1.ITransactionOptions|null} [options] BeginTransactionRequest options - * @property {google.spanner.v1.IRequestOptions|null} [requestOptions] BeginTransactionRequest requestOptions - * @property {google.spanner.v1.IMutation|null} [mutationKey] BeginTransactionRequest mutationKey - */ - - /** - * Constructs a new BeginTransactionRequest. - * @memberof google.spanner.v1 - * @classdesc Represents a BeginTransactionRequest. - * @implements IBeginTransactionRequest - * @constructor - * @param {google.spanner.v1.IBeginTransactionRequest=} [properties] Properties to set - */ - function BeginTransactionRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BeginTransactionRequest session. - * @member {string} session - * @memberof google.spanner.v1.BeginTransactionRequest - * @instance - */ - BeginTransactionRequest.prototype.session = ""; - - /** - * BeginTransactionRequest options. - * @member {google.spanner.v1.ITransactionOptions|null|undefined} options - * @memberof google.spanner.v1.BeginTransactionRequest - * @instance - */ - BeginTransactionRequest.prototype.options = null; - - /** - * BeginTransactionRequest requestOptions. - * @member {google.spanner.v1.IRequestOptions|null|undefined} requestOptions - * @memberof google.spanner.v1.BeginTransactionRequest - * @instance - */ - BeginTransactionRequest.prototype.requestOptions = null; - - /** - * BeginTransactionRequest mutationKey. - * @member {google.spanner.v1.IMutation|null|undefined} mutationKey - * @memberof google.spanner.v1.BeginTransactionRequest - * @instance - */ - BeginTransactionRequest.prototype.mutationKey = null; - - /** - * Creates a new BeginTransactionRequest instance using the specified properties. - * @function create - * @memberof google.spanner.v1.BeginTransactionRequest - * @static - * @param {google.spanner.v1.IBeginTransactionRequest=} [properties] Properties to set - * @returns {google.spanner.v1.BeginTransactionRequest} BeginTransactionRequest instance - */ - BeginTransactionRequest.create = function create(properties) { - return new BeginTransactionRequest(properties); - }; - - /** - * Encodes the specified BeginTransactionRequest message. Does not implicitly {@link google.spanner.v1.BeginTransactionRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.BeginTransactionRequest - * @static - * @param {google.spanner.v1.IBeginTransactionRequest} message BeginTransactionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BeginTransactionRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.session != null && Object.hasOwnProperty.call(message, "session")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.session); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.spanner.v1.TransactionOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.requestOptions != null && Object.hasOwnProperty.call(message, "requestOptions")) - $root.google.spanner.v1.RequestOptions.encode(message.requestOptions, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.mutationKey != null && Object.hasOwnProperty.call(message, "mutationKey")) - $root.google.spanner.v1.Mutation.encode(message.mutationKey, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified BeginTransactionRequest message, length delimited. Does not implicitly {@link google.spanner.v1.BeginTransactionRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.BeginTransactionRequest - * @static - * @param {google.spanner.v1.IBeginTransactionRequest} message BeginTransactionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BeginTransactionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BeginTransactionRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.BeginTransactionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.BeginTransactionRequest} BeginTransactionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BeginTransactionRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.BeginTransactionRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.session = reader.string(); - break; - } - case 2: { - message.options = $root.google.spanner.v1.TransactionOptions.decode(reader, reader.uint32()); - break; - } - case 3: { - message.requestOptions = $root.google.spanner.v1.RequestOptions.decode(reader, reader.uint32()); - break; - } - case 4: { - message.mutationKey = $root.google.spanner.v1.Mutation.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BeginTransactionRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.BeginTransactionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.BeginTransactionRequest} BeginTransactionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BeginTransactionRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BeginTransactionRequest message. - * @function verify - * @memberof google.spanner.v1.BeginTransactionRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BeginTransactionRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.session != null && message.hasOwnProperty("session")) - if (!$util.isString(message.session)) - return "session: string expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.spanner.v1.TransactionOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.requestOptions != null && message.hasOwnProperty("requestOptions")) { - var error = $root.google.spanner.v1.RequestOptions.verify(message.requestOptions); - if (error) - return "requestOptions." + error; - } - if (message.mutationKey != null && message.hasOwnProperty("mutationKey")) { - var error = $root.google.spanner.v1.Mutation.verify(message.mutationKey); - if (error) - return "mutationKey." + error; - } - return null; - }; - - /** - * Creates a BeginTransactionRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.BeginTransactionRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.BeginTransactionRequest} BeginTransactionRequest - */ - BeginTransactionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.BeginTransactionRequest) - return object; - var message = new $root.google.spanner.v1.BeginTransactionRequest(); - if (object.session != null) - message.session = String(object.session); - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.spanner.v1.BeginTransactionRequest.options: object expected"); - message.options = $root.google.spanner.v1.TransactionOptions.fromObject(object.options); - } - if (object.requestOptions != null) { - if (typeof object.requestOptions !== "object") - throw TypeError(".google.spanner.v1.BeginTransactionRequest.requestOptions: object expected"); - message.requestOptions = $root.google.spanner.v1.RequestOptions.fromObject(object.requestOptions); - } - if (object.mutationKey != null) { - if (typeof object.mutationKey !== "object") - throw TypeError(".google.spanner.v1.BeginTransactionRequest.mutationKey: object expected"); - message.mutationKey = $root.google.spanner.v1.Mutation.fromObject(object.mutationKey); - } - return message; - }; - - /** - * Creates a plain object from a BeginTransactionRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.BeginTransactionRequest - * @static - * @param {google.spanner.v1.BeginTransactionRequest} message BeginTransactionRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BeginTransactionRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.session = ""; - object.options = null; - object.requestOptions = null; - object.mutationKey = null; - } - if (message.session != null && message.hasOwnProperty("session")) - object.session = message.session; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.spanner.v1.TransactionOptions.toObject(message.options, options); - if (message.requestOptions != null && message.hasOwnProperty("requestOptions")) - object.requestOptions = $root.google.spanner.v1.RequestOptions.toObject(message.requestOptions, options); - if (message.mutationKey != null && message.hasOwnProperty("mutationKey")) - object.mutationKey = $root.google.spanner.v1.Mutation.toObject(message.mutationKey, options); - return object; - }; - - /** - * Converts this BeginTransactionRequest to JSON. - * @function toJSON - * @memberof google.spanner.v1.BeginTransactionRequest - * @instance - * @returns {Object.} JSON object - */ - BeginTransactionRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BeginTransactionRequest - * @function getTypeUrl - * @memberof google.spanner.v1.BeginTransactionRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BeginTransactionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.BeginTransactionRequest"; - }; - - return BeginTransactionRequest; - })(); - - v1.CommitRequest = (function() { - - /** - * Properties of a CommitRequest. - * @memberof google.spanner.v1 - * @interface ICommitRequest - * @property {string|null} [session] CommitRequest session - * @property {Uint8Array|null} [transactionId] CommitRequest transactionId - * @property {google.spanner.v1.ITransactionOptions|null} [singleUseTransaction] CommitRequest singleUseTransaction - * @property {Array.|null} [mutations] CommitRequest mutations - * @property {boolean|null} [returnCommitStats] CommitRequest returnCommitStats - * @property {google.protobuf.IDuration|null} [maxCommitDelay] CommitRequest maxCommitDelay - * @property {google.spanner.v1.IRequestOptions|null} [requestOptions] CommitRequest requestOptions - * @property {google.spanner.v1.IMultiplexedSessionPrecommitToken|null} [precommitToken] CommitRequest precommitToken - */ - - /** - * Constructs a new CommitRequest. - * @memberof google.spanner.v1 - * @classdesc Represents a CommitRequest. - * @implements ICommitRequest - * @constructor - * @param {google.spanner.v1.ICommitRequest=} [properties] Properties to set - */ - function CommitRequest(properties) { - this.mutations = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CommitRequest session. - * @member {string} session - * @memberof google.spanner.v1.CommitRequest - * @instance - */ - CommitRequest.prototype.session = ""; - - /** - * CommitRequest transactionId. - * @member {Uint8Array|null|undefined} transactionId - * @memberof google.spanner.v1.CommitRequest - * @instance - */ - CommitRequest.prototype.transactionId = null; - - /** - * CommitRequest singleUseTransaction. - * @member {google.spanner.v1.ITransactionOptions|null|undefined} singleUseTransaction - * @memberof google.spanner.v1.CommitRequest - * @instance - */ - CommitRequest.prototype.singleUseTransaction = null; - - /** - * CommitRequest mutations. - * @member {Array.} mutations - * @memberof google.spanner.v1.CommitRequest - * @instance - */ - CommitRequest.prototype.mutations = $util.emptyArray; - - /** - * CommitRequest returnCommitStats. - * @member {boolean} returnCommitStats - * @memberof google.spanner.v1.CommitRequest - * @instance - */ - CommitRequest.prototype.returnCommitStats = false; - - /** - * CommitRequest maxCommitDelay. - * @member {google.protobuf.IDuration|null|undefined} maxCommitDelay - * @memberof google.spanner.v1.CommitRequest - * @instance - */ - CommitRequest.prototype.maxCommitDelay = null; - - /** - * CommitRequest requestOptions. - * @member {google.spanner.v1.IRequestOptions|null|undefined} requestOptions - * @memberof google.spanner.v1.CommitRequest - * @instance - */ - CommitRequest.prototype.requestOptions = null; - - /** - * CommitRequest precommitToken. - * @member {google.spanner.v1.IMultiplexedSessionPrecommitToken|null|undefined} precommitToken - * @memberof google.spanner.v1.CommitRequest - * @instance - */ - CommitRequest.prototype.precommitToken = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * CommitRequest transaction. - * @member {"transactionId"|"singleUseTransaction"|undefined} transaction - * @memberof google.spanner.v1.CommitRequest - * @instance - */ - Object.defineProperty(CommitRequest.prototype, "transaction", { - get: $util.oneOfGetter($oneOfFields = ["transactionId", "singleUseTransaction"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new CommitRequest instance using the specified properties. - * @function create - * @memberof google.spanner.v1.CommitRequest - * @static - * @param {google.spanner.v1.ICommitRequest=} [properties] Properties to set - * @returns {google.spanner.v1.CommitRequest} CommitRequest instance - */ - CommitRequest.create = function create(properties) { - return new CommitRequest(properties); - }; - - /** - * Encodes the specified CommitRequest message. Does not implicitly {@link google.spanner.v1.CommitRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.CommitRequest - * @static - * @param {google.spanner.v1.ICommitRequest} message CommitRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CommitRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.session != null && Object.hasOwnProperty.call(message, "session")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.session); - if (message.transactionId != null && Object.hasOwnProperty.call(message, "transactionId")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.transactionId); - if (message.singleUseTransaction != null && Object.hasOwnProperty.call(message, "singleUseTransaction")) - $root.google.spanner.v1.TransactionOptions.encode(message.singleUseTransaction, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.mutations != null && message.mutations.length) - for (var i = 0; i < message.mutations.length; ++i) - $root.google.spanner.v1.Mutation.encode(message.mutations[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.returnCommitStats != null && Object.hasOwnProperty.call(message, "returnCommitStats")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.returnCommitStats); - if (message.requestOptions != null && Object.hasOwnProperty.call(message, "requestOptions")) - $root.google.spanner.v1.RequestOptions.encode(message.requestOptions, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.maxCommitDelay != null && Object.hasOwnProperty.call(message, "maxCommitDelay")) - $root.google.protobuf.Duration.encode(message.maxCommitDelay, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.precommitToken != null && Object.hasOwnProperty.call(message, "precommitToken")) - $root.google.spanner.v1.MultiplexedSessionPrecommitToken.encode(message.precommitToken, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CommitRequest message, length delimited. Does not implicitly {@link google.spanner.v1.CommitRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.CommitRequest - * @static - * @param {google.spanner.v1.ICommitRequest} message CommitRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CommitRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CommitRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.CommitRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.CommitRequest} CommitRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CommitRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.CommitRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.session = reader.string(); - break; - } - case 2: { - message.transactionId = reader.bytes(); - break; - } - case 3: { - message.singleUseTransaction = $root.google.spanner.v1.TransactionOptions.decode(reader, reader.uint32()); - break; - } - case 4: { - if (!(message.mutations && message.mutations.length)) - message.mutations = []; - message.mutations.push($root.google.spanner.v1.Mutation.decode(reader, reader.uint32())); - break; - } - case 5: { - message.returnCommitStats = reader.bool(); - break; - } - case 8: { - message.maxCommitDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 6: { - message.requestOptions = $root.google.spanner.v1.RequestOptions.decode(reader, reader.uint32()); - break; - } - case 9: { - message.precommitToken = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CommitRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.CommitRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.CommitRequest} CommitRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CommitRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CommitRequest message. - * @function verify - * @memberof google.spanner.v1.CommitRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CommitRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.session != null && message.hasOwnProperty("session")) - if (!$util.isString(message.session)) - return "session: string expected"; - if (message.transactionId != null && message.hasOwnProperty("transactionId")) { - properties.transaction = 1; - if (!(message.transactionId && typeof message.transactionId.length === "number" || $util.isString(message.transactionId))) - return "transactionId: buffer expected"; - } - if (message.singleUseTransaction != null && message.hasOwnProperty("singleUseTransaction")) { - if (properties.transaction === 1) - return "transaction: multiple values"; - properties.transaction = 1; - { - var error = $root.google.spanner.v1.TransactionOptions.verify(message.singleUseTransaction); - if (error) - return "singleUseTransaction." + error; - } - } - if (message.mutations != null && message.hasOwnProperty("mutations")) { - if (!Array.isArray(message.mutations)) - return "mutations: array expected"; - for (var i = 0; i < message.mutations.length; ++i) { - var error = $root.google.spanner.v1.Mutation.verify(message.mutations[i]); - if (error) - return "mutations." + error; - } - } - if (message.returnCommitStats != null && message.hasOwnProperty("returnCommitStats")) - if (typeof message.returnCommitStats !== "boolean") - return "returnCommitStats: boolean expected"; - if (message.maxCommitDelay != null && message.hasOwnProperty("maxCommitDelay")) { - var error = $root.google.protobuf.Duration.verify(message.maxCommitDelay); - if (error) - return "maxCommitDelay." + error; - } - if (message.requestOptions != null && message.hasOwnProperty("requestOptions")) { - var error = $root.google.spanner.v1.RequestOptions.verify(message.requestOptions); - if (error) - return "requestOptions." + error; - } - if (message.precommitToken != null && message.hasOwnProperty("precommitToken")) { - var error = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.verify(message.precommitToken); - if (error) - return "precommitToken." + error; - } - return null; - }; - - /** - * Creates a CommitRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.CommitRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.CommitRequest} CommitRequest - */ - CommitRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.CommitRequest) - return object; - var message = new $root.google.spanner.v1.CommitRequest(); - if (object.session != null) - message.session = String(object.session); - if (object.transactionId != null) - if (typeof object.transactionId === "string") - $util.base64.decode(object.transactionId, message.transactionId = $util.newBuffer($util.base64.length(object.transactionId)), 0); - else if (object.transactionId.length >= 0) - message.transactionId = object.transactionId; - if (object.singleUseTransaction != null) { - if (typeof object.singleUseTransaction !== "object") - throw TypeError(".google.spanner.v1.CommitRequest.singleUseTransaction: object expected"); - message.singleUseTransaction = $root.google.spanner.v1.TransactionOptions.fromObject(object.singleUseTransaction); - } - if (object.mutations) { - if (!Array.isArray(object.mutations)) - throw TypeError(".google.spanner.v1.CommitRequest.mutations: array expected"); - message.mutations = []; - for (var i = 0; i < object.mutations.length; ++i) { - if (typeof object.mutations[i] !== "object") - throw TypeError(".google.spanner.v1.CommitRequest.mutations: object expected"); - message.mutations[i] = $root.google.spanner.v1.Mutation.fromObject(object.mutations[i]); - } - } - if (object.returnCommitStats != null) - message.returnCommitStats = Boolean(object.returnCommitStats); - if (object.maxCommitDelay != null) { - if (typeof object.maxCommitDelay !== "object") - throw TypeError(".google.spanner.v1.CommitRequest.maxCommitDelay: object expected"); - message.maxCommitDelay = $root.google.protobuf.Duration.fromObject(object.maxCommitDelay); - } - if (object.requestOptions != null) { - if (typeof object.requestOptions !== "object") - throw TypeError(".google.spanner.v1.CommitRequest.requestOptions: object expected"); - message.requestOptions = $root.google.spanner.v1.RequestOptions.fromObject(object.requestOptions); - } - if (object.precommitToken != null) { - if (typeof object.precommitToken !== "object") - throw TypeError(".google.spanner.v1.CommitRequest.precommitToken: object expected"); - message.precommitToken = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.fromObject(object.precommitToken); - } - return message; - }; - - /** - * Creates a plain object from a CommitRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.CommitRequest - * @static - * @param {google.spanner.v1.CommitRequest} message CommitRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CommitRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.mutations = []; - if (options.defaults) { - object.session = ""; - object.returnCommitStats = false; - object.requestOptions = null; - object.maxCommitDelay = null; - object.precommitToken = null; - } - if (message.session != null && message.hasOwnProperty("session")) - object.session = message.session; - if (message.transactionId != null && message.hasOwnProperty("transactionId")) { - object.transactionId = options.bytes === String ? $util.base64.encode(message.transactionId, 0, message.transactionId.length) : options.bytes === Array ? Array.prototype.slice.call(message.transactionId) : message.transactionId; - if (options.oneofs) - object.transaction = "transactionId"; - } - if (message.singleUseTransaction != null && message.hasOwnProperty("singleUseTransaction")) { - object.singleUseTransaction = $root.google.spanner.v1.TransactionOptions.toObject(message.singleUseTransaction, options); - if (options.oneofs) - object.transaction = "singleUseTransaction"; - } - if (message.mutations && message.mutations.length) { - object.mutations = []; - for (var j = 0; j < message.mutations.length; ++j) - object.mutations[j] = $root.google.spanner.v1.Mutation.toObject(message.mutations[j], options); - } - if (message.returnCommitStats != null && message.hasOwnProperty("returnCommitStats")) - object.returnCommitStats = message.returnCommitStats; - if (message.requestOptions != null && message.hasOwnProperty("requestOptions")) - object.requestOptions = $root.google.spanner.v1.RequestOptions.toObject(message.requestOptions, options); - if (message.maxCommitDelay != null && message.hasOwnProperty("maxCommitDelay")) - object.maxCommitDelay = $root.google.protobuf.Duration.toObject(message.maxCommitDelay, options); - if (message.precommitToken != null && message.hasOwnProperty("precommitToken")) - object.precommitToken = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.toObject(message.precommitToken, options); - return object; - }; - - /** - * Converts this CommitRequest to JSON. - * @function toJSON - * @memberof google.spanner.v1.CommitRequest - * @instance - * @returns {Object.} JSON object - */ - CommitRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CommitRequest - * @function getTypeUrl - * @memberof google.spanner.v1.CommitRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CommitRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.CommitRequest"; - }; - - return CommitRequest; - })(); - - v1.RollbackRequest = (function() { - - /** - * Properties of a RollbackRequest. - * @memberof google.spanner.v1 - * @interface IRollbackRequest - * @property {string|null} [session] RollbackRequest session - * @property {Uint8Array|null} [transactionId] RollbackRequest transactionId - */ - - /** - * Constructs a new RollbackRequest. - * @memberof google.spanner.v1 - * @classdesc Represents a RollbackRequest. - * @implements IRollbackRequest - * @constructor - * @param {google.spanner.v1.IRollbackRequest=} [properties] Properties to set - */ - function RollbackRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RollbackRequest session. - * @member {string} session - * @memberof google.spanner.v1.RollbackRequest - * @instance - */ - RollbackRequest.prototype.session = ""; - - /** - * RollbackRequest transactionId. - * @member {Uint8Array} transactionId - * @memberof google.spanner.v1.RollbackRequest - * @instance - */ - RollbackRequest.prototype.transactionId = $util.newBuffer([]); - - /** - * Creates a new RollbackRequest instance using the specified properties. - * @function create - * @memberof google.spanner.v1.RollbackRequest - * @static - * @param {google.spanner.v1.IRollbackRequest=} [properties] Properties to set - * @returns {google.spanner.v1.RollbackRequest} RollbackRequest instance - */ - RollbackRequest.create = function create(properties) { - return new RollbackRequest(properties); - }; - - /** - * Encodes the specified RollbackRequest message. Does not implicitly {@link google.spanner.v1.RollbackRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.RollbackRequest - * @static - * @param {google.spanner.v1.IRollbackRequest} message RollbackRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RollbackRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.session != null && Object.hasOwnProperty.call(message, "session")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.session); - if (message.transactionId != null && Object.hasOwnProperty.call(message, "transactionId")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.transactionId); - return writer; - }; - - /** - * Encodes the specified RollbackRequest message, length delimited. Does not implicitly {@link google.spanner.v1.RollbackRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.RollbackRequest - * @static - * @param {google.spanner.v1.IRollbackRequest} message RollbackRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RollbackRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RollbackRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.RollbackRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.RollbackRequest} RollbackRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RollbackRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.RollbackRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.session = reader.string(); - break; - } - case 2: { - message.transactionId = reader.bytes(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RollbackRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.RollbackRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.RollbackRequest} RollbackRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RollbackRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RollbackRequest message. - * @function verify - * @memberof google.spanner.v1.RollbackRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RollbackRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.session != null && message.hasOwnProperty("session")) - if (!$util.isString(message.session)) - return "session: string expected"; - if (message.transactionId != null && message.hasOwnProperty("transactionId")) - if (!(message.transactionId && typeof message.transactionId.length === "number" || $util.isString(message.transactionId))) - return "transactionId: buffer expected"; - return null; - }; - - /** - * Creates a RollbackRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.RollbackRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.RollbackRequest} RollbackRequest - */ - RollbackRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.RollbackRequest) - return object; - var message = new $root.google.spanner.v1.RollbackRequest(); - if (object.session != null) - message.session = String(object.session); - if (object.transactionId != null) - if (typeof object.transactionId === "string") - $util.base64.decode(object.transactionId, message.transactionId = $util.newBuffer($util.base64.length(object.transactionId)), 0); - else if (object.transactionId.length >= 0) - message.transactionId = object.transactionId; - return message; - }; - - /** - * Creates a plain object from a RollbackRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.RollbackRequest - * @static - * @param {google.spanner.v1.RollbackRequest} message RollbackRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RollbackRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.session = ""; - if (options.bytes === String) - object.transactionId = ""; - else { - object.transactionId = []; - if (options.bytes !== Array) - object.transactionId = $util.newBuffer(object.transactionId); - } - } - if (message.session != null && message.hasOwnProperty("session")) - object.session = message.session; - if (message.transactionId != null && message.hasOwnProperty("transactionId")) - object.transactionId = options.bytes === String ? $util.base64.encode(message.transactionId, 0, message.transactionId.length) : options.bytes === Array ? Array.prototype.slice.call(message.transactionId) : message.transactionId; - return object; - }; - - /** - * Converts this RollbackRequest to JSON. - * @function toJSON - * @memberof google.spanner.v1.RollbackRequest - * @instance - * @returns {Object.} JSON object - */ - RollbackRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RollbackRequest - * @function getTypeUrl - * @memberof google.spanner.v1.RollbackRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RollbackRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.RollbackRequest"; - }; - - return RollbackRequest; - })(); - - v1.BatchWriteRequest = (function() { - - /** - * Properties of a BatchWriteRequest. - * @memberof google.spanner.v1 - * @interface IBatchWriteRequest - * @property {string|null} [session] BatchWriteRequest session - * @property {google.spanner.v1.IRequestOptions|null} [requestOptions] BatchWriteRequest requestOptions - * @property {Array.|null} [mutationGroups] BatchWriteRequest mutationGroups - * @property {boolean|null} [excludeTxnFromChangeStreams] BatchWriteRequest excludeTxnFromChangeStreams - */ - - /** - * Constructs a new BatchWriteRequest. - * @memberof google.spanner.v1 - * @classdesc Represents a BatchWriteRequest. - * @implements IBatchWriteRequest - * @constructor - * @param {google.spanner.v1.IBatchWriteRequest=} [properties] Properties to set - */ - function BatchWriteRequest(properties) { - this.mutationGroups = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BatchWriteRequest session. - * @member {string} session - * @memberof google.spanner.v1.BatchWriteRequest - * @instance - */ - BatchWriteRequest.prototype.session = ""; - - /** - * BatchWriteRequest requestOptions. - * @member {google.spanner.v1.IRequestOptions|null|undefined} requestOptions - * @memberof google.spanner.v1.BatchWriteRequest - * @instance - */ - BatchWriteRequest.prototype.requestOptions = null; - - /** - * BatchWriteRequest mutationGroups. - * @member {Array.} mutationGroups - * @memberof google.spanner.v1.BatchWriteRequest - * @instance - */ - BatchWriteRequest.prototype.mutationGroups = $util.emptyArray; - - /** - * BatchWriteRequest excludeTxnFromChangeStreams. - * @member {boolean} excludeTxnFromChangeStreams - * @memberof google.spanner.v1.BatchWriteRequest - * @instance - */ - BatchWriteRequest.prototype.excludeTxnFromChangeStreams = false; - - /** - * Creates a new BatchWriteRequest instance using the specified properties. - * @function create - * @memberof google.spanner.v1.BatchWriteRequest - * @static - * @param {google.spanner.v1.IBatchWriteRequest=} [properties] Properties to set - * @returns {google.spanner.v1.BatchWriteRequest} BatchWriteRequest instance - */ - BatchWriteRequest.create = function create(properties) { - return new BatchWriteRequest(properties); - }; - - /** - * Encodes the specified BatchWriteRequest message. Does not implicitly {@link google.spanner.v1.BatchWriteRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.BatchWriteRequest - * @static - * @param {google.spanner.v1.IBatchWriteRequest} message BatchWriteRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchWriteRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.session != null && Object.hasOwnProperty.call(message, "session")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.session); - if (message.requestOptions != null && Object.hasOwnProperty.call(message, "requestOptions")) - $root.google.spanner.v1.RequestOptions.encode(message.requestOptions, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.mutationGroups != null && message.mutationGroups.length) - for (var i = 0; i < message.mutationGroups.length; ++i) - $root.google.spanner.v1.BatchWriteRequest.MutationGroup.encode(message.mutationGroups[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.excludeTxnFromChangeStreams != null && Object.hasOwnProperty.call(message, "excludeTxnFromChangeStreams")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.excludeTxnFromChangeStreams); - return writer; - }; - - /** - * Encodes the specified BatchWriteRequest message, length delimited. Does not implicitly {@link google.spanner.v1.BatchWriteRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.BatchWriteRequest - * @static - * @param {google.spanner.v1.IBatchWriteRequest} message BatchWriteRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchWriteRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BatchWriteRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.BatchWriteRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.BatchWriteRequest} BatchWriteRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchWriteRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.BatchWriteRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.session = reader.string(); - break; - } - case 3: { - message.requestOptions = $root.google.spanner.v1.RequestOptions.decode(reader, reader.uint32()); - break; - } - case 4: { - if (!(message.mutationGroups && message.mutationGroups.length)) - message.mutationGroups = []; - message.mutationGroups.push($root.google.spanner.v1.BatchWriteRequest.MutationGroup.decode(reader, reader.uint32())); - break; - } - case 5: { - message.excludeTxnFromChangeStreams = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BatchWriteRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.BatchWriteRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.BatchWriteRequest} BatchWriteRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchWriteRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BatchWriteRequest message. - * @function verify - * @memberof google.spanner.v1.BatchWriteRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BatchWriteRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.session != null && message.hasOwnProperty("session")) - if (!$util.isString(message.session)) - return "session: string expected"; - if (message.requestOptions != null && message.hasOwnProperty("requestOptions")) { - var error = $root.google.spanner.v1.RequestOptions.verify(message.requestOptions); - if (error) - return "requestOptions." + error; - } - if (message.mutationGroups != null && message.hasOwnProperty("mutationGroups")) { - if (!Array.isArray(message.mutationGroups)) - return "mutationGroups: array expected"; - for (var i = 0; i < message.mutationGroups.length; ++i) { - var error = $root.google.spanner.v1.BatchWriteRequest.MutationGroup.verify(message.mutationGroups[i]); - if (error) - return "mutationGroups." + error; - } - } - if (message.excludeTxnFromChangeStreams != null && message.hasOwnProperty("excludeTxnFromChangeStreams")) - if (typeof message.excludeTxnFromChangeStreams !== "boolean") - return "excludeTxnFromChangeStreams: boolean expected"; - return null; - }; - - /** - * Creates a BatchWriteRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.BatchWriteRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.BatchWriteRequest} BatchWriteRequest - */ - BatchWriteRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.BatchWriteRequest) - return object; - var message = new $root.google.spanner.v1.BatchWriteRequest(); - if (object.session != null) - message.session = String(object.session); - if (object.requestOptions != null) { - if (typeof object.requestOptions !== "object") - throw TypeError(".google.spanner.v1.BatchWriteRequest.requestOptions: object expected"); - message.requestOptions = $root.google.spanner.v1.RequestOptions.fromObject(object.requestOptions); - } - if (object.mutationGroups) { - if (!Array.isArray(object.mutationGroups)) - throw TypeError(".google.spanner.v1.BatchWriteRequest.mutationGroups: array expected"); - message.mutationGroups = []; - for (var i = 0; i < object.mutationGroups.length; ++i) { - if (typeof object.mutationGroups[i] !== "object") - throw TypeError(".google.spanner.v1.BatchWriteRequest.mutationGroups: object expected"); - message.mutationGroups[i] = $root.google.spanner.v1.BatchWriteRequest.MutationGroup.fromObject(object.mutationGroups[i]); - } - } - if (object.excludeTxnFromChangeStreams != null) - message.excludeTxnFromChangeStreams = Boolean(object.excludeTxnFromChangeStreams); - return message; - }; - - /** - * Creates a plain object from a BatchWriteRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.BatchWriteRequest - * @static - * @param {google.spanner.v1.BatchWriteRequest} message BatchWriteRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BatchWriteRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.mutationGroups = []; - if (options.defaults) { - object.session = ""; - object.requestOptions = null; - object.excludeTxnFromChangeStreams = false; - } - if (message.session != null && message.hasOwnProperty("session")) - object.session = message.session; - if (message.requestOptions != null && message.hasOwnProperty("requestOptions")) - object.requestOptions = $root.google.spanner.v1.RequestOptions.toObject(message.requestOptions, options); - if (message.mutationGroups && message.mutationGroups.length) { - object.mutationGroups = []; - for (var j = 0; j < message.mutationGroups.length; ++j) - object.mutationGroups[j] = $root.google.spanner.v1.BatchWriteRequest.MutationGroup.toObject(message.mutationGroups[j], options); - } - if (message.excludeTxnFromChangeStreams != null && message.hasOwnProperty("excludeTxnFromChangeStreams")) - object.excludeTxnFromChangeStreams = message.excludeTxnFromChangeStreams; - return object; - }; - - /** - * Converts this BatchWriteRequest to JSON. - * @function toJSON - * @memberof google.spanner.v1.BatchWriteRequest - * @instance - * @returns {Object.} JSON object - */ - BatchWriteRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BatchWriteRequest - * @function getTypeUrl - * @memberof google.spanner.v1.BatchWriteRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BatchWriteRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.BatchWriteRequest"; - }; - - BatchWriteRequest.MutationGroup = (function() { - - /** - * Properties of a MutationGroup. - * @memberof google.spanner.v1.BatchWriteRequest - * @interface IMutationGroup - * @property {Array.|null} [mutations] MutationGroup mutations - */ - - /** - * Constructs a new MutationGroup. - * @memberof google.spanner.v1.BatchWriteRequest - * @classdesc Represents a MutationGroup. - * @implements IMutationGroup - * @constructor - * @param {google.spanner.v1.BatchWriteRequest.IMutationGroup=} [properties] Properties to set - */ - function MutationGroup(properties) { - this.mutations = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MutationGroup mutations. - * @member {Array.} mutations - * @memberof google.spanner.v1.BatchWriteRequest.MutationGroup - * @instance - */ - MutationGroup.prototype.mutations = $util.emptyArray; - - /** - * Creates a new MutationGroup instance using the specified properties. - * @function create - * @memberof google.spanner.v1.BatchWriteRequest.MutationGroup - * @static - * @param {google.spanner.v1.BatchWriteRequest.IMutationGroup=} [properties] Properties to set - * @returns {google.spanner.v1.BatchWriteRequest.MutationGroup} MutationGroup instance - */ - MutationGroup.create = function create(properties) { - return new MutationGroup(properties); - }; - - /** - * Encodes the specified MutationGroup message. Does not implicitly {@link google.spanner.v1.BatchWriteRequest.MutationGroup.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.BatchWriteRequest.MutationGroup - * @static - * @param {google.spanner.v1.BatchWriteRequest.IMutationGroup} message MutationGroup message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MutationGroup.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.mutations != null && message.mutations.length) - for (var i = 0; i < message.mutations.length; ++i) - $root.google.spanner.v1.Mutation.encode(message.mutations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified MutationGroup message, length delimited. Does not implicitly {@link google.spanner.v1.BatchWriteRequest.MutationGroup.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.BatchWriteRequest.MutationGroup - * @static - * @param {google.spanner.v1.BatchWriteRequest.IMutationGroup} message MutationGroup message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MutationGroup.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MutationGroup message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.BatchWriteRequest.MutationGroup - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.BatchWriteRequest.MutationGroup} MutationGroup - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MutationGroup.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.BatchWriteRequest.MutationGroup(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.mutations && message.mutations.length)) - message.mutations = []; - message.mutations.push($root.google.spanner.v1.Mutation.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MutationGroup message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.BatchWriteRequest.MutationGroup - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.BatchWriteRequest.MutationGroup} MutationGroup - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MutationGroup.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MutationGroup message. - * @function verify - * @memberof google.spanner.v1.BatchWriteRequest.MutationGroup - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MutationGroup.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.mutations != null && message.hasOwnProperty("mutations")) { - if (!Array.isArray(message.mutations)) - return "mutations: array expected"; - for (var i = 0; i < message.mutations.length; ++i) { - var error = $root.google.spanner.v1.Mutation.verify(message.mutations[i]); - if (error) - return "mutations." + error; - } - } - return null; - }; - - /** - * Creates a MutationGroup message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.BatchWriteRequest.MutationGroup - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.BatchWriteRequest.MutationGroup} MutationGroup - */ - MutationGroup.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.BatchWriteRequest.MutationGroup) - return object; - var message = new $root.google.spanner.v1.BatchWriteRequest.MutationGroup(); - if (object.mutations) { - if (!Array.isArray(object.mutations)) - throw TypeError(".google.spanner.v1.BatchWriteRequest.MutationGroup.mutations: array expected"); - message.mutations = []; - for (var i = 0; i < object.mutations.length; ++i) { - if (typeof object.mutations[i] !== "object") - throw TypeError(".google.spanner.v1.BatchWriteRequest.MutationGroup.mutations: object expected"); - message.mutations[i] = $root.google.spanner.v1.Mutation.fromObject(object.mutations[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a MutationGroup message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.BatchWriteRequest.MutationGroup - * @static - * @param {google.spanner.v1.BatchWriteRequest.MutationGroup} message MutationGroup - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MutationGroup.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.mutations = []; - if (message.mutations && message.mutations.length) { - object.mutations = []; - for (var j = 0; j < message.mutations.length; ++j) - object.mutations[j] = $root.google.spanner.v1.Mutation.toObject(message.mutations[j], options); - } - return object; - }; - - /** - * Converts this MutationGroup to JSON. - * @function toJSON - * @memberof google.spanner.v1.BatchWriteRequest.MutationGroup - * @instance - * @returns {Object.} JSON object - */ - MutationGroup.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MutationGroup - * @function getTypeUrl - * @memberof google.spanner.v1.BatchWriteRequest.MutationGroup - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MutationGroup.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.BatchWriteRequest.MutationGroup"; - }; - - return MutationGroup; - })(); - - return BatchWriteRequest; - })(); - - v1.BatchWriteResponse = (function() { - - /** - * Properties of a BatchWriteResponse. - * @memberof google.spanner.v1 - * @interface IBatchWriteResponse - * @property {Array.|null} [indexes] BatchWriteResponse indexes - * @property {google.rpc.IStatus|null} [status] BatchWriteResponse status - * @property {google.protobuf.ITimestamp|null} [commitTimestamp] BatchWriteResponse commitTimestamp - */ - - /** - * Constructs a new BatchWriteResponse. - * @memberof google.spanner.v1 - * @classdesc Represents a BatchWriteResponse. - * @implements IBatchWriteResponse - * @constructor - * @param {google.spanner.v1.IBatchWriteResponse=} [properties] Properties to set - */ - function BatchWriteResponse(properties) { - this.indexes = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BatchWriteResponse indexes. - * @member {Array.} indexes - * @memberof google.spanner.v1.BatchWriteResponse - * @instance - */ - BatchWriteResponse.prototype.indexes = $util.emptyArray; - - /** - * BatchWriteResponse status. - * @member {google.rpc.IStatus|null|undefined} status - * @memberof google.spanner.v1.BatchWriteResponse - * @instance - */ - BatchWriteResponse.prototype.status = null; - - /** - * BatchWriteResponse commitTimestamp. - * @member {google.protobuf.ITimestamp|null|undefined} commitTimestamp - * @memberof google.spanner.v1.BatchWriteResponse - * @instance - */ - BatchWriteResponse.prototype.commitTimestamp = null; - - /** - * Creates a new BatchWriteResponse instance using the specified properties. - * @function create - * @memberof google.spanner.v1.BatchWriteResponse - * @static - * @param {google.spanner.v1.IBatchWriteResponse=} [properties] Properties to set - * @returns {google.spanner.v1.BatchWriteResponse} BatchWriteResponse instance - */ - BatchWriteResponse.create = function create(properties) { - return new BatchWriteResponse(properties); - }; - - /** - * Encodes the specified BatchWriteResponse message. Does not implicitly {@link google.spanner.v1.BatchWriteResponse.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.BatchWriteResponse - * @static - * @param {google.spanner.v1.IBatchWriteResponse} message BatchWriteResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchWriteResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.indexes != null && message.indexes.length) { - writer.uint32(/* id 1, wireType 2 =*/10).fork(); - for (var i = 0; i < message.indexes.length; ++i) - writer.int32(message.indexes[i]); - writer.ldelim(); - } - if (message.status != null && Object.hasOwnProperty.call(message, "status")) - $root.google.rpc.Status.encode(message.status, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.commitTimestamp != null && Object.hasOwnProperty.call(message, "commitTimestamp")) - $root.google.protobuf.Timestamp.encode(message.commitTimestamp, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified BatchWriteResponse message, length delimited. Does not implicitly {@link google.spanner.v1.BatchWriteResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.BatchWriteResponse - * @static - * @param {google.spanner.v1.IBatchWriteResponse} message BatchWriteResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchWriteResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BatchWriteResponse message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.BatchWriteResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.BatchWriteResponse} BatchWriteResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchWriteResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.BatchWriteResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.indexes && message.indexes.length)) - message.indexes = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.indexes.push(reader.int32()); - } else - message.indexes.push(reader.int32()); - break; - } - case 2: { - message.status = $root.google.rpc.Status.decode(reader, reader.uint32()); - break; - } - case 3: { - message.commitTimestamp = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BatchWriteResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.BatchWriteResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.BatchWriteResponse} BatchWriteResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchWriteResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BatchWriteResponse message. - * @function verify - * @memberof google.spanner.v1.BatchWriteResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BatchWriteResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.indexes != null && message.hasOwnProperty("indexes")) { - if (!Array.isArray(message.indexes)) - return "indexes: array expected"; - for (var i = 0; i < message.indexes.length; ++i) - if (!$util.isInteger(message.indexes[i])) - return "indexes: integer[] expected"; - } - if (message.status != null && message.hasOwnProperty("status")) { - var error = $root.google.rpc.Status.verify(message.status); - if (error) - return "status." + error; - } - if (message.commitTimestamp != null && message.hasOwnProperty("commitTimestamp")) { - var error = $root.google.protobuf.Timestamp.verify(message.commitTimestamp); - if (error) - return "commitTimestamp." + error; - } - return null; - }; - - /** - * Creates a BatchWriteResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.BatchWriteResponse - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.BatchWriteResponse} BatchWriteResponse - */ - BatchWriteResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.BatchWriteResponse) - return object; - var message = new $root.google.spanner.v1.BatchWriteResponse(); - if (object.indexes) { - if (!Array.isArray(object.indexes)) - throw TypeError(".google.spanner.v1.BatchWriteResponse.indexes: array expected"); - message.indexes = []; - for (var i = 0; i < object.indexes.length; ++i) - message.indexes[i] = object.indexes[i] | 0; - } - if (object.status != null) { - if (typeof object.status !== "object") - throw TypeError(".google.spanner.v1.BatchWriteResponse.status: object expected"); - message.status = $root.google.rpc.Status.fromObject(object.status); - } - if (object.commitTimestamp != null) { - if (typeof object.commitTimestamp !== "object") - throw TypeError(".google.spanner.v1.BatchWriteResponse.commitTimestamp: object expected"); - message.commitTimestamp = $root.google.protobuf.Timestamp.fromObject(object.commitTimestamp); - } - return message; - }; - - /** - * Creates a plain object from a BatchWriteResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.BatchWriteResponse - * @static - * @param {google.spanner.v1.BatchWriteResponse} message BatchWriteResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BatchWriteResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.indexes = []; - if (options.defaults) { - object.status = null; - object.commitTimestamp = null; - } - if (message.indexes && message.indexes.length) { - object.indexes = []; - for (var j = 0; j < message.indexes.length; ++j) - object.indexes[j] = message.indexes[j]; - } - if (message.status != null && message.hasOwnProperty("status")) - object.status = $root.google.rpc.Status.toObject(message.status, options); - if (message.commitTimestamp != null && message.hasOwnProperty("commitTimestamp")) - object.commitTimestamp = $root.google.protobuf.Timestamp.toObject(message.commitTimestamp, options); - return object; - }; - - /** - * Converts this BatchWriteResponse to JSON. - * @function toJSON - * @memberof google.spanner.v1.BatchWriteResponse - * @instance - * @returns {Object.} JSON object - */ - BatchWriteResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BatchWriteResponse - * @function getTypeUrl - * @memberof google.spanner.v1.BatchWriteResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BatchWriteResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.BatchWriteResponse"; - }; - - return BatchWriteResponse; - })(); - - v1.CommitResponse = (function() { - - /** - * Properties of a CommitResponse. - * @memberof google.spanner.v1 - * @interface ICommitResponse - * @property {google.protobuf.ITimestamp|null} [commitTimestamp] CommitResponse commitTimestamp - * @property {google.spanner.v1.CommitResponse.ICommitStats|null} [commitStats] CommitResponse commitStats - * @property {google.spanner.v1.IMultiplexedSessionPrecommitToken|null} [precommitToken] CommitResponse precommitToken - * @property {google.protobuf.ITimestamp|null} [snapshotTimestamp] CommitResponse snapshotTimestamp - */ - - /** - * Constructs a new CommitResponse. - * @memberof google.spanner.v1 - * @classdesc Represents a CommitResponse. - * @implements ICommitResponse - * @constructor - * @param {google.spanner.v1.ICommitResponse=} [properties] Properties to set - */ - function CommitResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CommitResponse commitTimestamp. - * @member {google.protobuf.ITimestamp|null|undefined} commitTimestamp - * @memberof google.spanner.v1.CommitResponse - * @instance - */ - CommitResponse.prototype.commitTimestamp = null; - - /** - * CommitResponse commitStats. - * @member {google.spanner.v1.CommitResponse.ICommitStats|null|undefined} commitStats - * @memberof google.spanner.v1.CommitResponse - * @instance - */ - CommitResponse.prototype.commitStats = null; - - /** - * CommitResponse precommitToken. - * @member {google.spanner.v1.IMultiplexedSessionPrecommitToken|null|undefined} precommitToken - * @memberof google.spanner.v1.CommitResponse - * @instance - */ - CommitResponse.prototype.precommitToken = null; - - /** - * CommitResponse snapshotTimestamp. - * @member {google.protobuf.ITimestamp|null|undefined} snapshotTimestamp - * @memberof google.spanner.v1.CommitResponse - * @instance - */ - CommitResponse.prototype.snapshotTimestamp = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * CommitResponse MultiplexedSessionRetry. - * @member {"precommitToken"|undefined} MultiplexedSessionRetry - * @memberof google.spanner.v1.CommitResponse - * @instance - */ - Object.defineProperty(CommitResponse.prototype, "MultiplexedSessionRetry", { - get: $util.oneOfGetter($oneOfFields = ["precommitToken"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new CommitResponse instance using the specified properties. - * @function create - * @memberof google.spanner.v1.CommitResponse - * @static - * @param {google.spanner.v1.ICommitResponse=} [properties] Properties to set - * @returns {google.spanner.v1.CommitResponse} CommitResponse instance - */ - CommitResponse.create = function create(properties) { - return new CommitResponse(properties); - }; - - /** - * Encodes the specified CommitResponse message. Does not implicitly {@link google.spanner.v1.CommitResponse.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.CommitResponse - * @static - * @param {google.spanner.v1.ICommitResponse} message CommitResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CommitResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.commitTimestamp != null && Object.hasOwnProperty.call(message, "commitTimestamp")) - $root.google.protobuf.Timestamp.encode(message.commitTimestamp, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.commitStats != null && Object.hasOwnProperty.call(message, "commitStats")) - $root.google.spanner.v1.CommitResponse.CommitStats.encode(message.commitStats, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.precommitToken != null && Object.hasOwnProperty.call(message, "precommitToken")) - $root.google.spanner.v1.MultiplexedSessionPrecommitToken.encode(message.precommitToken, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.snapshotTimestamp != null && Object.hasOwnProperty.call(message, "snapshotTimestamp")) - $root.google.protobuf.Timestamp.encode(message.snapshotTimestamp, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CommitResponse message, length delimited. Does not implicitly {@link google.spanner.v1.CommitResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.CommitResponse - * @static - * @param {google.spanner.v1.ICommitResponse} message CommitResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CommitResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CommitResponse message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.CommitResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.CommitResponse} CommitResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CommitResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.CommitResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.commitTimestamp = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 2: { - message.commitStats = $root.google.spanner.v1.CommitResponse.CommitStats.decode(reader, reader.uint32()); - break; - } - case 4: { - message.precommitToken = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.decode(reader, reader.uint32()); - break; - } - case 5: { - message.snapshotTimestamp = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CommitResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.CommitResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.CommitResponse} CommitResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CommitResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CommitResponse message. - * @function verify - * @memberof google.spanner.v1.CommitResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CommitResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.commitTimestamp != null && message.hasOwnProperty("commitTimestamp")) { - var error = $root.google.protobuf.Timestamp.verify(message.commitTimestamp); - if (error) - return "commitTimestamp." + error; - } - if (message.commitStats != null && message.hasOwnProperty("commitStats")) { - var error = $root.google.spanner.v1.CommitResponse.CommitStats.verify(message.commitStats); - if (error) - return "commitStats." + error; - } - if (message.precommitToken != null && message.hasOwnProperty("precommitToken")) { - properties.MultiplexedSessionRetry = 1; - { - var error = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.verify(message.precommitToken); - if (error) - return "precommitToken." + error; - } - } - if (message.snapshotTimestamp != null && message.hasOwnProperty("snapshotTimestamp")) { - var error = $root.google.protobuf.Timestamp.verify(message.snapshotTimestamp); - if (error) - return "snapshotTimestamp." + error; - } - return null; - }; - - /** - * Creates a CommitResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.CommitResponse - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.CommitResponse} CommitResponse - */ - CommitResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.CommitResponse) - return object; - var message = new $root.google.spanner.v1.CommitResponse(); - if (object.commitTimestamp != null) { - if (typeof object.commitTimestamp !== "object") - throw TypeError(".google.spanner.v1.CommitResponse.commitTimestamp: object expected"); - message.commitTimestamp = $root.google.protobuf.Timestamp.fromObject(object.commitTimestamp); - } - if (object.commitStats != null) { - if (typeof object.commitStats !== "object") - throw TypeError(".google.spanner.v1.CommitResponse.commitStats: object expected"); - message.commitStats = $root.google.spanner.v1.CommitResponse.CommitStats.fromObject(object.commitStats); - } - if (object.precommitToken != null) { - if (typeof object.precommitToken !== "object") - throw TypeError(".google.spanner.v1.CommitResponse.precommitToken: object expected"); - message.precommitToken = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.fromObject(object.precommitToken); - } - if (object.snapshotTimestamp != null) { - if (typeof object.snapshotTimestamp !== "object") - throw TypeError(".google.spanner.v1.CommitResponse.snapshotTimestamp: object expected"); - message.snapshotTimestamp = $root.google.protobuf.Timestamp.fromObject(object.snapshotTimestamp); - } - return message; - }; - - /** - * Creates a plain object from a CommitResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.CommitResponse - * @static - * @param {google.spanner.v1.CommitResponse} message CommitResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CommitResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.commitTimestamp = null; - object.commitStats = null; - object.snapshotTimestamp = null; - } - if (message.commitTimestamp != null && message.hasOwnProperty("commitTimestamp")) - object.commitTimestamp = $root.google.protobuf.Timestamp.toObject(message.commitTimestamp, options); - if (message.commitStats != null && message.hasOwnProperty("commitStats")) - object.commitStats = $root.google.spanner.v1.CommitResponse.CommitStats.toObject(message.commitStats, options); - if (message.precommitToken != null && message.hasOwnProperty("precommitToken")) { - object.precommitToken = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.toObject(message.precommitToken, options); - if (options.oneofs) - object.MultiplexedSessionRetry = "precommitToken"; - } - if (message.snapshotTimestamp != null && message.hasOwnProperty("snapshotTimestamp")) - object.snapshotTimestamp = $root.google.protobuf.Timestamp.toObject(message.snapshotTimestamp, options); - return object; - }; - - /** - * Converts this CommitResponse to JSON. - * @function toJSON - * @memberof google.spanner.v1.CommitResponse - * @instance - * @returns {Object.} JSON object - */ - CommitResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CommitResponse - * @function getTypeUrl - * @memberof google.spanner.v1.CommitResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CommitResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.CommitResponse"; - }; - - CommitResponse.CommitStats = (function() { - - /** - * Properties of a CommitStats. - * @memberof google.spanner.v1.CommitResponse - * @interface ICommitStats - * @property {number|Long|null} [mutationCount] CommitStats mutationCount - */ - - /** - * Constructs a new CommitStats. - * @memberof google.spanner.v1.CommitResponse - * @classdesc Represents a CommitStats. - * @implements ICommitStats - * @constructor - * @param {google.spanner.v1.CommitResponse.ICommitStats=} [properties] Properties to set - */ - function CommitStats(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CommitStats mutationCount. - * @member {number|Long} mutationCount - * @memberof google.spanner.v1.CommitResponse.CommitStats - * @instance - */ - CommitStats.prototype.mutationCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Creates a new CommitStats instance using the specified properties. - * @function create - * @memberof google.spanner.v1.CommitResponse.CommitStats - * @static - * @param {google.spanner.v1.CommitResponse.ICommitStats=} [properties] Properties to set - * @returns {google.spanner.v1.CommitResponse.CommitStats} CommitStats instance - */ - CommitStats.create = function create(properties) { - return new CommitStats(properties); - }; - - /** - * Encodes the specified CommitStats message. Does not implicitly {@link google.spanner.v1.CommitResponse.CommitStats.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.CommitResponse.CommitStats - * @static - * @param {google.spanner.v1.CommitResponse.ICommitStats} message CommitStats message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CommitStats.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.mutationCount != null && Object.hasOwnProperty.call(message, "mutationCount")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.mutationCount); - return writer; - }; - - /** - * Encodes the specified CommitStats message, length delimited. Does not implicitly {@link google.spanner.v1.CommitResponse.CommitStats.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.CommitResponse.CommitStats - * @static - * @param {google.spanner.v1.CommitResponse.ICommitStats} message CommitStats message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CommitStats.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CommitStats message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.CommitResponse.CommitStats - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.CommitResponse.CommitStats} CommitStats - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CommitStats.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.CommitResponse.CommitStats(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.mutationCount = reader.int64(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CommitStats message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.CommitResponse.CommitStats - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.CommitResponse.CommitStats} CommitStats - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CommitStats.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CommitStats message. - * @function verify - * @memberof google.spanner.v1.CommitResponse.CommitStats - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CommitStats.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.mutationCount != null && message.hasOwnProperty("mutationCount")) - if (!$util.isInteger(message.mutationCount) && !(message.mutationCount && $util.isInteger(message.mutationCount.low) && $util.isInteger(message.mutationCount.high))) - return "mutationCount: integer|Long expected"; - return null; - }; - - /** - * Creates a CommitStats message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.CommitResponse.CommitStats - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.CommitResponse.CommitStats} CommitStats - */ - CommitStats.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.CommitResponse.CommitStats) - return object; - var message = new $root.google.spanner.v1.CommitResponse.CommitStats(); - if (object.mutationCount != null) - if ($util.Long) - (message.mutationCount = $util.Long.fromValue(object.mutationCount)).unsigned = false; - else if (typeof object.mutationCount === "string") - message.mutationCount = parseInt(object.mutationCount, 10); - else if (typeof object.mutationCount === "number") - message.mutationCount = object.mutationCount; - else if (typeof object.mutationCount === "object") - message.mutationCount = new $util.LongBits(object.mutationCount.low >>> 0, object.mutationCount.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from a CommitStats message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.CommitResponse.CommitStats - * @static - * @param {google.spanner.v1.CommitResponse.CommitStats} message CommitStats - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CommitStats.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.mutationCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.mutationCount = options.longs === String ? "0" : 0; - if (message.mutationCount != null && message.hasOwnProperty("mutationCount")) - if (typeof message.mutationCount === "number") - object.mutationCount = options.longs === String ? String(message.mutationCount) : message.mutationCount; - else - object.mutationCount = options.longs === String ? $util.Long.prototype.toString.call(message.mutationCount) : options.longs === Number ? new $util.LongBits(message.mutationCount.low >>> 0, message.mutationCount.high >>> 0).toNumber() : message.mutationCount; - return object; - }; - - /** - * Converts this CommitStats to JSON. - * @function toJSON - * @memberof google.spanner.v1.CommitResponse.CommitStats - * @instance - * @returns {Object.} JSON object - */ - CommitStats.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CommitStats - * @function getTypeUrl - * @memberof google.spanner.v1.CommitResponse.CommitStats - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CommitStats.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.CommitResponse.CommitStats"; - }; - - return CommitStats; - })(); - - return CommitResponse; - })(); - - v1.TransactionOptions = (function() { - - /** - * Properties of a TransactionOptions. - * @memberof google.spanner.v1 - * @interface ITransactionOptions - * @property {google.spanner.v1.TransactionOptions.IReadWrite|null} [readWrite] TransactionOptions readWrite - * @property {google.spanner.v1.TransactionOptions.IPartitionedDml|null} [partitionedDml] TransactionOptions partitionedDml - * @property {google.spanner.v1.TransactionOptions.IReadOnly|null} [readOnly] TransactionOptions readOnly - * @property {boolean|null} [excludeTxnFromChangeStreams] TransactionOptions excludeTxnFromChangeStreams - * @property {google.spanner.v1.TransactionOptions.IsolationLevel|null} [isolationLevel] TransactionOptions isolationLevel - */ - - /** - * Constructs a new TransactionOptions. - * @memberof google.spanner.v1 - * @classdesc Represents a TransactionOptions. - * @implements ITransactionOptions - * @constructor - * @param {google.spanner.v1.ITransactionOptions=} [properties] Properties to set - */ - function TransactionOptions(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TransactionOptions readWrite. - * @member {google.spanner.v1.TransactionOptions.IReadWrite|null|undefined} readWrite - * @memberof google.spanner.v1.TransactionOptions - * @instance - */ - TransactionOptions.prototype.readWrite = null; - - /** - * TransactionOptions partitionedDml. - * @member {google.spanner.v1.TransactionOptions.IPartitionedDml|null|undefined} partitionedDml - * @memberof google.spanner.v1.TransactionOptions - * @instance - */ - TransactionOptions.prototype.partitionedDml = null; - - /** - * TransactionOptions readOnly. - * @member {google.spanner.v1.TransactionOptions.IReadOnly|null|undefined} readOnly - * @memberof google.spanner.v1.TransactionOptions - * @instance - */ - TransactionOptions.prototype.readOnly = null; - - /** - * TransactionOptions excludeTxnFromChangeStreams. - * @member {boolean} excludeTxnFromChangeStreams - * @memberof google.spanner.v1.TransactionOptions - * @instance - */ - TransactionOptions.prototype.excludeTxnFromChangeStreams = false; - - /** - * TransactionOptions isolationLevel. - * @member {google.spanner.v1.TransactionOptions.IsolationLevel} isolationLevel - * @memberof google.spanner.v1.TransactionOptions - * @instance - */ - TransactionOptions.prototype.isolationLevel = 0; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * TransactionOptions mode. - * @member {"readWrite"|"partitionedDml"|"readOnly"|undefined} mode - * @memberof google.spanner.v1.TransactionOptions - * @instance - */ - Object.defineProperty(TransactionOptions.prototype, "mode", { - get: $util.oneOfGetter($oneOfFields = ["readWrite", "partitionedDml", "readOnly"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new TransactionOptions instance using the specified properties. - * @function create - * @memberof google.spanner.v1.TransactionOptions - * @static - * @param {google.spanner.v1.ITransactionOptions=} [properties] Properties to set - * @returns {google.spanner.v1.TransactionOptions} TransactionOptions instance - */ - TransactionOptions.create = function create(properties) { - return new TransactionOptions(properties); - }; - - /** - * Encodes the specified TransactionOptions message. Does not implicitly {@link google.spanner.v1.TransactionOptions.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.TransactionOptions - * @static - * @param {google.spanner.v1.ITransactionOptions} message TransactionOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TransactionOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.readWrite != null && Object.hasOwnProperty.call(message, "readWrite")) - $root.google.spanner.v1.TransactionOptions.ReadWrite.encode(message.readWrite, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.readOnly != null && Object.hasOwnProperty.call(message, "readOnly")) - $root.google.spanner.v1.TransactionOptions.ReadOnly.encode(message.readOnly, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.partitionedDml != null && Object.hasOwnProperty.call(message, "partitionedDml")) - $root.google.spanner.v1.TransactionOptions.PartitionedDml.encode(message.partitionedDml, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.excludeTxnFromChangeStreams != null && Object.hasOwnProperty.call(message, "excludeTxnFromChangeStreams")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.excludeTxnFromChangeStreams); - if (message.isolationLevel != null && Object.hasOwnProperty.call(message, "isolationLevel")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.isolationLevel); - return writer; - }; - - /** - * Encodes the specified TransactionOptions message, length delimited. Does not implicitly {@link google.spanner.v1.TransactionOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.TransactionOptions - * @static - * @param {google.spanner.v1.ITransactionOptions} message TransactionOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TransactionOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TransactionOptions message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.TransactionOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.TransactionOptions} TransactionOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TransactionOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.TransactionOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.readWrite = $root.google.spanner.v1.TransactionOptions.ReadWrite.decode(reader, reader.uint32()); - break; - } - case 3: { - message.partitionedDml = $root.google.spanner.v1.TransactionOptions.PartitionedDml.decode(reader, reader.uint32()); - break; - } - case 2: { - message.readOnly = $root.google.spanner.v1.TransactionOptions.ReadOnly.decode(reader, reader.uint32()); - break; - } - case 5: { - message.excludeTxnFromChangeStreams = reader.bool(); - break; - } - case 6: { - message.isolationLevel = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TransactionOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.TransactionOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.TransactionOptions} TransactionOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TransactionOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TransactionOptions message. - * @function verify - * @memberof google.spanner.v1.TransactionOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TransactionOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.readWrite != null && message.hasOwnProperty("readWrite")) { - properties.mode = 1; - { - var error = $root.google.spanner.v1.TransactionOptions.ReadWrite.verify(message.readWrite); - if (error) - return "readWrite." + error; - } - } - if (message.partitionedDml != null && message.hasOwnProperty("partitionedDml")) { - if (properties.mode === 1) - return "mode: multiple values"; - properties.mode = 1; - { - var error = $root.google.spanner.v1.TransactionOptions.PartitionedDml.verify(message.partitionedDml); - if (error) - return "partitionedDml." + error; - } - } - if (message.readOnly != null && message.hasOwnProperty("readOnly")) { - if (properties.mode === 1) - return "mode: multiple values"; - properties.mode = 1; - { - var error = $root.google.spanner.v1.TransactionOptions.ReadOnly.verify(message.readOnly); - if (error) - return "readOnly." + error; - } - } - if (message.excludeTxnFromChangeStreams != null && message.hasOwnProperty("excludeTxnFromChangeStreams")) - if (typeof message.excludeTxnFromChangeStreams !== "boolean") - return "excludeTxnFromChangeStreams: boolean expected"; - if (message.isolationLevel != null && message.hasOwnProperty("isolationLevel")) - switch (message.isolationLevel) { - default: - return "isolationLevel: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a TransactionOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.TransactionOptions - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.TransactionOptions} TransactionOptions - */ - TransactionOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.TransactionOptions) - return object; - var message = new $root.google.spanner.v1.TransactionOptions(); - if (object.readWrite != null) { - if (typeof object.readWrite !== "object") - throw TypeError(".google.spanner.v1.TransactionOptions.readWrite: object expected"); - message.readWrite = $root.google.spanner.v1.TransactionOptions.ReadWrite.fromObject(object.readWrite); - } - if (object.partitionedDml != null) { - if (typeof object.partitionedDml !== "object") - throw TypeError(".google.spanner.v1.TransactionOptions.partitionedDml: object expected"); - message.partitionedDml = $root.google.spanner.v1.TransactionOptions.PartitionedDml.fromObject(object.partitionedDml); - } - if (object.readOnly != null) { - if (typeof object.readOnly !== "object") - throw TypeError(".google.spanner.v1.TransactionOptions.readOnly: object expected"); - message.readOnly = $root.google.spanner.v1.TransactionOptions.ReadOnly.fromObject(object.readOnly); - } - if (object.excludeTxnFromChangeStreams != null) - message.excludeTxnFromChangeStreams = Boolean(object.excludeTxnFromChangeStreams); - switch (object.isolationLevel) { - default: - if (typeof object.isolationLevel === "number") { - message.isolationLevel = object.isolationLevel; - break; - } - break; - case "ISOLATION_LEVEL_UNSPECIFIED": - case 0: - message.isolationLevel = 0; - break; - case "SERIALIZABLE": - case 1: - message.isolationLevel = 1; - break; - case "REPEATABLE_READ": - case 2: - message.isolationLevel = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a TransactionOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.TransactionOptions - * @static - * @param {google.spanner.v1.TransactionOptions} message TransactionOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TransactionOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.excludeTxnFromChangeStreams = false; - object.isolationLevel = options.enums === String ? "ISOLATION_LEVEL_UNSPECIFIED" : 0; - } - if (message.readWrite != null && message.hasOwnProperty("readWrite")) { - object.readWrite = $root.google.spanner.v1.TransactionOptions.ReadWrite.toObject(message.readWrite, options); - if (options.oneofs) - object.mode = "readWrite"; - } - if (message.readOnly != null && message.hasOwnProperty("readOnly")) { - object.readOnly = $root.google.spanner.v1.TransactionOptions.ReadOnly.toObject(message.readOnly, options); - if (options.oneofs) - object.mode = "readOnly"; - } - if (message.partitionedDml != null && message.hasOwnProperty("partitionedDml")) { - object.partitionedDml = $root.google.spanner.v1.TransactionOptions.PartitionedDml.toObject(message.partitionedDml, options); - if (options.oneofs) - object.mode = "partitionedDml"; - } - if (message.excludeTxnFromChangeStreams != null && message.hasOwnProperty("excludeTxnFromChangeStreams")) - object.excludeTxnFromChangeStreams = message.excludeTxnFromChangeStreams; - if (message.isolationLevel != null && message.hasOwnProperty("isolationLevel")) - object.isolationLevel = options.enums === String ? $root.google.spanner.v1.TransactionOptions.IsolationLevel[message.isolationLevel] === undefined ? message.isolationLevel : $root.google.spanner.v1.TransactionOptions.IsolationLevel[message.isolationLevel] : message.isolationLevel; - return object; - }; - - /** - * Converts this TransactionOptions to JSON. - * @function toJSON - * @memberof google.spanner.v1.TransactionOptions - * @instance - * @returns {Object.} JSON object - */ - TransactionOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TransactionOptions - * @function getTypeUrl - * @memberof google.spanner.v1.TransactionOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TransactionOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.TransactionOptions"; - }; - - TransactionOptions.ReadWrite = (function() { - - /** - * Properties of a ReadWrite. - * @memberof google.spanner.v1.TransactionOptions - * @interface IReadWrite - * @property {google.spanner.v1.TransactionOptions.ReadWrite.ReadLockMode|null} [readLockMode] ReadWrite readLockMode - * @property {Uint8Array|null} [multiplexedSessionPreviousTransactionId] ReadWrite multiplexedSessionPreviousTransactionId - */ - - /** - * Constructs a new ReadWrite. - * @memberof google.spanner.v1.TransactionOptions - * @classdesc Represents a ReadWrite. - * @implements IReadWrite - * @constructor - * @param {google.spanner.v1.TransactionOptions.IReadWrite=} [properties] Properties to set - */ - function ReadWrite(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ReadWrite readLockMode. - * @member {google.spanner.v1.TransactionOptions.ReadWrite.ReadLockMode} readLockMode - * @memberof google.spanner.v1.TransactionOptions.ReadWrite - * @instance - */ - ReadWrite.prototype.readLockMode = 0; - - /** - * ReadWrite multiplexedSessionPreviousTransactionId. - * @member {Uint8Array} multiplexedSessionPreviousTransactionId - * @memberof google.spanner.v1.TransactionOptions.ReadWrite - * @instance - */ - ReadWrite.prototype.multiplexedSessionPreviousTransactionId = $util.newBuffer([]); - - /** - * Creates a new ReadWrite instance using the specified properties. - * @function create - * @memberof google.spanner.v1.TransactionOptions.ReadWrite - * @static - * @param {google.spanner.v1.TransactionOptions.IReadWrite=} [properties] Properties to set - * @returns {google.spanner.v1.TransactionOptions.ReadWrite} ReadWrite instance - */ - ReadWrite.create = function create(properties) { - return new ReadWrite(properties); - }; - - /** - * Encodes the specified ReadWrite message. Does not implicitly {@link google.spanner.v1.TransactionOptions.ReadWrite.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.TransactionOptions.ReadWrite - * @static - * @param {google.spanner.v1.TransactionOptions.IReadWrite} message ReadWrite message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReadWrite.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.readLockMode != null && Object.hasOwnProperty.call(message, "readLockMode")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.readLockMode); - if (message.multiplexedSessionPreviousTransactionId != null && Object.hasOwnProperty.call(message, "multiplexedSessionPreviousTransactionId")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.multiplexedSessionPreviousTransactionId); - return writer; - }; - - /** - * Encodes the specified ReadWrite message, length delimited. Does not implicitly {@link google.spanner.v1.TransactionOptions.ReadWrite.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.TransactionOptions.ReadWrite - * @static - * @param {google.spanner.v1.TransactionOptions.IReadWrite} message ReadWrite message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReadWrite.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ReadWrite message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.TransactionOptions.ReadWrite - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.TransactionOptions.ReadWrite} ReadWrite - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReadWrite.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.TransactionOptions.ReadWrite(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.readLockMode = reader.int32(); - break; - } - case 2: { - message.multiplexedSessionPreviousTransactionId = reader.bytes(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ReadWrite message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.TransactionOptions.ReadWrite - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.TransactionOptions.ReadWrite} ReadWrite - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReadWrite.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ReadWrite message. - * @function verify - * @memberof google.spanner.v1.TransactionOptions.ReadWrite - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ReadWrite.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.readLockMode != null && message.hasOwnProperty("readLockMode")) - switch (message.readLockMode) { - default: - return "readLockMode: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.multiplexedSessionPreviousTransactionId != null && message.hasOwnProperty("multiplexedSessionPreviousTransactionId")) - if (!(message.multiplexedSessionPreviousTransactionId && typeof message.multiplexedSessionPreviousTransactionId.length === "number" || $util.isString(message.multiplexedSessionPreviousTransactionId))) - return "multiplexedSessionPreviousTransactionId: buffer expected"; - return null; - }; - - /** - * Creates a ReadWrite message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.TransactionOptions.ReadWrite - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.TransactionOptions.ReadWrite} ReadWrite - */ - ReadWrite.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.TransactionOptions.ReadWrite) - return object; - var message = new $root.google.spanner.v1.TransactionOptions.ReadWrite(); - switch (object.readLockMode) { - default: - if (typeof object.readLockMode === "number") { - message.readLockMode = object.readLockMode; - break; - } - break; - case "READ_LOCK_MODE_UNSPECIFIED": - case 0: - message.readLockMode = 0; - break; - case "PESSIMISTIC": - case 1: - message.readLockMode = 1; - break; - case "OPTIMISTIC": - case 2: - message.readLockMode = 2; - break; - } - if (object.multiplexedSessionPreviousTransactionId != null) - if (typeof object.multiplexedSessionPreviousTransactionId === "string") - $util.base64.decode(object.multiplexedSessionPreviousTransactionId, message.multiplexedSessionPreviousTransactionId = $util.newBuffer($util.base64.length(object.multiplexedSessionPreviousTransactionId)), 0); - else if (object.multiplexedSessionPreviousTransactionId.length >= 0) - message.multiplexedSessionPreviousTransactionId = object.multiplexedSessionPreviousTransactionId; - return message; - }; - - /** - * Creates a plain object from a ReadWrite message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.TransactionOptions.ReadWrite - * @static - * @param {google.spanner.v1.TransactionOptions.ReadWrite} message ReadWrite - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ReadWrite.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.readLockMode = options.enums === String ? "READ_LOCK_MODE_UNSPECIFIED" : 0; - if (options.bytes === String) - object.multiplexedSessionPreviousTransactionId = ""; - else { - object.multiplexedSessionPreviousTransactionId = []; - if (options.bytes !== Array) - object.multiplexedSessionPreviousTransactionId = $util.newBuffer(object.multiplexedSessionPreviousTransactionId); - } - } - if (message.readLockMode != null && message.hasOwnProperty("readLockMode")) - object.readLockMode = options.enums === String ? $root.google.spanner.v1.TransactionOptions.ReadWrite.ReadLockMode[message.readLockMode] === undefined ? message.readLockMode : $root.google.spanner.v1.TransactionOptions.ReadWrite.ReadLockMode[message.readLockMode] : message.readLockMode; - if (message.multiplexedSessionPreviousTransactionId != null && message.hasOwnProperty("multiplexedSessionPreviousTransactionId")) - object.multiplexedSessionPreviousTransactionId = options.bytes === String ? $util.base64.encode(message.multiplexedSessionPreviousTransactionId, 0, message.multiplexedSessionPreviousTransactionId.length) : options.bytes === Array ? Array.prototype.slice.call(message.multiplexedSessionPreviousTransactionId) : message.multiplexedSessionPreviousTransactionId; - return object; - }; - - /** - * Converts this ReadWrite to JSON. - * @function toJSON - * @memberof google.spanner.v1.TransactionOptions.ReadWrite - * @instance - * @returns {Object.} JSON object - */ - ReadWrite.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ReadWrite - * @function getTypeUrl - * @memberof google.spanner.v1.TransactionOptions.ReadWrite - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ReadWrite.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.TransactionOptions.ReadWrite"; - }; - - /** - * ReadLockMode enum. - * @name google.spanner.v1.TransactionOptions.ReadWrite.ReadLockMode - * @enum {number} - * @property {number} READ_LOCK_MODE_UNSPECIFIED=0 READ_LOCK_MODE_UNSPECIFIED value - * @property {number} PESSIMISTIC=1 PESSIMISTIC value - * @property {number} OPTIMISTIC=2 OPTIMISTIC value - */ - ReadWrite.ReadLockMode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "READ_LOCK_MODE_UNSPECIFIED"] = 0; - values[valuesById[1] = "PESSIMISTIC"] = 1; - values[valuesById[2] = "OPTIMISTIC"] = 2; - return values; - })(); - - return ReadWrite; - })(); - - TransactionOptions.PartitionedDml = (function() { - - /** - * Properties of a PartitionedDml. - * @memberof google.spanner.v1.TransactionOptions - * @interface IPartitionedDml - */ - - /** - * Constructs a new PartitionedDml. - * @memberof google.spanner.v1.TransactionOptions - * @classdesc Represents a PartitionedDml. - * @implements IPartitionedDml - * @constructor - * @param {google.spanner.v1.TransactionOptions.IPartitionedDml=} [properties] Properties to set - */ - function PartitionedDml(properties) { - if (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 PartitionedDml instance using the specified properties. - * @function create - * @memberof google.spanner.v1.TransactionOptions.PartitionedDml - * @static - * @param {google.spanner.v1.TransactionOptions.IPartitionedDml=} [properties] Properties to set - * @returns {google.spanner.v1.TransactionOptions.PartitionedDml} PartitionedDml instance - */ - PartitionedDml.create = function create(properties) { - return new PartitionedDml(properties); - }; - - /** - * Encodes the specified PartitionedDml message. Does not implicitly {@link google.spanner.v1.TransactionOptions.PartitionedDml.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.TransactionOptions.PartitionedDml - * @static - * @param {google.spanner.v1.TransactionOptions.IPartitionedDml} message PartitionedDml message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PartitionedDml.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified PartitionedDml message, length delimited. Does not implicitly {@link google.spanner.v1.TransactionOptions.PartitionedDml.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.TransactionOptions.PartitionedDml - * @static - * @param {google.spanner.v1.TransactionOptions.IPartitionedDml} message PartitionedDml message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PartitionedDml.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PartitionedDml message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.TransactionOptions.PartitionedDml - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.TransactionOptions.PartitionedDml} PartitionedDml - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PartitionedDml.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.TransactionOptions.PartitionedDml(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PartitionedDml message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.TransactionOptions.PartitionedDml - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.TransactionOptions.PartitionedDml} PartitionedDml - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PartitionedDml.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PartitionedDml message. - * @function verify - * @memberof google.spanner.v1.TransactionOptions.PartitionedDml - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PartitionedDml.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a PartitionedDml message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.TransactionOptions.PartitionedDml - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.TransactionOptions.PartitionedDml} PartitionedDml - */ - PartitionedDml.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.TransactionOptions.PartitionedDml) - return object; - return new $root.google.spanner.v1.TransactionOptions.PartitionedDml(); - }; - - /** - * Creates a plain object from a PartitionedDml message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.TransactionOptions.PartitionedDml - * @static - * @param {google.spanner.v1.TransactionOptions.PartitionedDml} message PartitionedDml - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PartitionedDml.toObject = function toObject() { - return {}; - }; - - /** - * Converts this PartitionedDml to JSON. - * @function toJSON - * @memberof google.spanner.v1.TransactionOptions.PartitionedDml - * @instance - * @returns {Object.} JSON object - */ - PartitionedDml.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PartitionedDml - * @function getTypeUrl - * @memberof google.spanner.v1.TransactionOptions.PartitionedDml - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PartitionedDml.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.TransactionOptions.PartitionedDml"; - }; - - return PartitionedDml; - })(); - - TransactionOptions.ReadOnly = (function() { - - /** - * Properties of a ReadOnly. - * @memberof google.spanner.v1.TransactionOptions - * @interface IReadOnly - * @property {boolean|null} [strong] ReadOnly strong - * @property {google.protobuf.ITimestamp|null} [minReadTimestamp] ReadOnly minReadTimestamp - * @property {google.protobuf.IDuration|null} [maxStaleness] ReadOnly maxStaleness - * @property {google.protobuf.ITimestamp|null} [readTimestamp] ReadOnly readTimestamp - * @property {google.protobuf.IDuration|null} [exactStaleness] ReadOnly exactStaleness - * @property {boolean|null} [returnReadTimestamp] ReadOnly returnReadTimestamp - */ - - /** - * Constructs a new ReadOnly. - * @memberof google.spanner.v1.TransactionOptions - * @classdesc Represents a ReadOnly. - * @implements IReadOnly - * @constructor - * @param {google.spanner.v1.TransactionOptions.IReadOnly=} [properties] Properties to set - */ - function ReadOnly(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ReadOnly strong. - * @member {boolean|null|undefined} strong - * @memberof google.spanner.v1.TransactionOptions.ReadOnly - * @instance - */ - ReadOnly.prototype.strong = null; - - /** - * ReadOnly minReadTimestamp. - * @member {google.protobuf.ITimestamp|null|undefined} minReadTimestamp - * @memberof google.spanner.v1.TransactionOptions.ReadOnly - * @instance - */ - ReadOnly.prototype.minReadTimestamp = null; - - /** - * ReadOnly maxStaleness. - * @member {google.protobuf.IDuration|null|undefined} maxStaleness - * @memberof google.spanner.v1.TransactionOptions.ReadOnly - * @instance - */ - ReadOnly.prototype.maxStaleness = null; - - /** - * ReadOnly readTimestamp. - * @member {google.protobuf.ITimestamp|null|undefined} readTimestamp - * @memberof google.spanner.v1.TransactionOptions.ReadOnly - * @instance - */ - ReadOnly.prototype.readTimestamp = null; - - /** - * ReadOnly exactStaleness. - * @member {google.protobuf.IDuration|null|undefined} exactStaleness - * @memberof google.spanner.v1.TransactionOptions.ReadOnly - * @instance - */ - ReadOnly.prototype.exactStaleness = null; - - /** - * ReadOnly returnReadTimestamp. - * @member {boolean} returnReadTimestamp - * @memberof google.spanner.v1.TransactionOptions.ReadOnly - * @instance - */ - ReadOnly.prototype.returnReadTimestamp = false; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * ReadOnly timestampBound. - * @member {"strong"|"minReadTimestamp"|"maxStaleness"|"readTimestamp"|"exactStaleness"|undefined} timestampBound - * @memberof google.spanner.v1.TransactionOptions.ReadOnly - * @instance - */ - Object.defineProperty(ReadOnly.prototype, "timestampBound", { - get: $util.oneOfGetter($oneOfFields = ["strong", "minReadTimestamp", "maxStaleness", "readTimestamp", "exactStaleness"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new ReadOnly instance using the specified properties. - * @function create - * @memberof google.spanner.v1.TransactionOptions.ReadOnly - * @static - * @param {google.spanner.v1.TransactionOptions.IReadOnly=} [properties] Properties to set - * @returns {google.spanner.v1.TransactionOptions.ReadOnly} ReadOnly instance - */ - ReadOnly.create = function create(properties) { - return new ReadOnly(properties); - }; - - /** - * Encodes the specified ReadOnly message. Does not implicitly {@link google.spanner.v1.TransactionOptions.ReadOnly.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.TransactionOptions.ReadOnly - * @static - * @param {google.spanner.v1.TransactionOptions.IReadOnly} message ReadOnly message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReadOnly.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.strong != null && Object.hasOwnProperty.call(message, "strong")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.strong); - if (message.minReadTimestamp != null && Object.hasOwnProperty.call(message, "minReadTimestamp")) - $root.google.protobuf.Timestamp.encode(message.minReadTimestamp, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.maxStaleness != null && Object.hasOwnProperty.call(message, "maxStaleness")) - $root.google.protobuf.Duration.encode(message.maxStaleness, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.readTimestamp != null && Object.hasOwnProperty.call(message, "readTimestamp")) - $root.google.protobuf.Timestamp.encode(message.readTimestamp, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.exactStaleness != null && Object.hasOwnProperty.call(message, "exactStaleness")) - $root.google.protobuf.Duration.encode(message.exactStaleness, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.returnReadTimestamp != null && Object.hasOwnProperty.call(message, "returnReadTimestamp")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.returnReadTimestamp); - return writer; - }; - - /** - * Encodes the specified ReadOnly message, length delimited. Does not implicitly {@link google.spanner.v1.TransactionOptions.ReadOnly.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.TransactionOptions.ReadOnly - * @static - * @param {google.spanner.v1.TransactionOptions.IReadOnly} message ReadOnly message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReadOnly.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ReadOnly message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.TransactionOptions.ReadOnly - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.TransactionOptions.ReadOnly} ReadOnly - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReadOnly.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.TransactionOptions.ReadOnly(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.strong = reader.bool(); - break; - } - case 2: { - message.minReadTimestamp = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 3: { - message.maxStaleness = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 4: { - message.readTimestamp = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 5: { - message.exactStaleness = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 6: { - message.returnReadTimestamp = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ReadOnly message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.TransactionOptions.ReadOnly - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.TransactionOptions.ReadOnly} ReadOnly - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReadOnly.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ReadOnly message. - * @function verify - * @memberof google.spanner.v1.TransactionOptions.ReadOnly - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ReadOnly.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.strong != null && message.hasOwnProperty("strong")) { - properties.timestampBound = 1; - if (typeof message.strong !== "boolean") - return "strong: boolean expected"; - } - if (message.minReadTimestamp != null && message.hasOwnProperty("minReadTimestamp")) { - if (properties.timestampBound === 1) - return "timestampBound: multiple values"; - properties.timestampBound = 1; - { - var error = $root.google.protobuf.Timestamp.verify(message.minReadTimestamp); - if (error) - return "minReadTimestamp." + error; - } - } - if (message.maxStaleness != null && message.hasOwnProperty("maxStaleness")) { - if (properties.timestampBound === 1) - return "timestampBound: multiple values"; - properties.timestampBound = 1; - { - var error = $root.google.protobuf.Duration.verify(message.maxStaleness); - if (error) - return "maxStaleness." + error; - } - } - if (message.readTimestamp != null && message.hasOwnProperty("readTimestamp")) { - if (properties.timestampBound === 1) - return "timestampBound: multiple values"; - properties.timestampBound = 1; - { - var error = $root.google.protobuf.Timestamp.verify(message.readTimestamp); - if (error) - return "readTimestamp." + error; - } - } - if (message.exactStaleness != null && message.hasOwnProperty("exactStaleness")) { - if (properties.timestampBound === 1) - return "timestampBound: multiple values"; - properties.timestampBound = 1; - { - var error = $root.google.protobuf.Duration.verify(message.exactStaleness); - if (error) - return "exactStaleness." + error; - } - } - if (message.returnReadTimestamp != null && message.hasOwnProperty("returnReadTimestamp")) - if (typeof message.returnReadTimestamp !== "boolean") - return "returnReadTimestamp: boolean expected"; - return null; - }; - - /** - * Creates a ReadOnly message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.TransactionOptions.ReadOnly - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.TransactionOptions.ReadOnly} ReadOnly - */ - ReadOnly.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.TransactionOptions.ReadOnly) - return object; - var message = new $root.google.spanner.v1.TransactionOptions.ReadOnly(); - if (object.strong != null) - message.strong = Boolean(object.strong); - if (object.minReadTimestamp != null) { - if (typeof object.minReadTimestamp !== "object") - throw TypeError(".google.spanner.v1.TransactionOptions.ReadOnly.minReadTimestamp: object expected"); - message.minReadTimestamp = $root.google.protobuf.Timestamp.fromObject(object.minReadTimestamp); - } - if (object.maxStaleness != null) { - if (typeof object.maxStaleness !== "object") - throw TypeError(".google.spanner.v1.TransactionOptions.ReadOnly.maxStaleness: object expected"); - message.maxStaleness = $root.google.protobuf.Duration.fromObject(object.maxStaleness); - } - if (object.readTimestamp != null) { - if (typeof object.readTimestamp !== "object") - throw TypeError(".google.spanner.v1.TransactionOptions.ReadOnly.readTimestamp: object expected"); - message.readTimestamp = $root.google.protobuf.Timestamp.fromObject(object.readTimestamp); - } - if (object.exactStaleness != null) { - if (typeof object.exactStaleness !== "object") - throw TypeError(".google.spanner.v1.TransactionOptions.ReadOnly.exactStaleness: object expected"); - message.exactStaleness = $root.google.protobuf.Duration.fromObject(object.exactStaleness); - } - if (object.returnReadTimestamp != null) - message.returnReadTimestamp = Boolean(object.returnReadTimestamp); - return message; - }; - - /** - * Creates a plain object from a ReadOnly message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.TransactionOptions.ReadOnly - * @static - * @param {google.spanner.v1.TransactionOptions.ReadOnly} message ReadOnly - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ReadOnly.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.returnReadTimestamp = false; - if (message.strong != null && message.hasOwnProperty("strong")) { - object.strong = message.strong; - if (options.oneofs) - object.timestampBound = "strong"; - } - if (message.minReadTimestamp != null && message.hasOwnProperty("minReadTimestamp")) { - object.minReadTimestamp = $root.google.protobuf.Timestamp.toObject(message.minReadTimestamp, options); - if (options.oneofs) - object.timestampBound = "minReadTimestamp"; - } - if (message.maxStaleness != null && message.hasOwnProperty("maxStaleness")) { - object.maxStaleness = $root.google.protobuf.Duration.toObject(message.maxStaleness, options); - if (options.oneofs) - object.timestampBound = "maxStaleness"; - } - if (message.readTimestamp != null && message.hasOwnProperty("readTimestamp")) { - object.readTimestamp = $root.google.protobuf.Timestamp.toObject(message.readTimestamp, options); - if (options.oneofs) - object.timestampBound = "readTimestamp"; - } - if (message.exactStaleness != null && message.hasOwnProperty("exactStaleness")) { - object.exactStaleness = $root.google.protobuf.Duration.toObject(message.exactStaleness, options); - if (options.oneofs) - object.timestampBound = "exactStaleness"; - } - if (message.returnReadTimestamp != null && message.hasOwnProperty("returnReadTimestamp")) - object.returnReadTimestamp = message.returnReadTimestamp; - return object; - }; - - /** - * Converts this ReadOnly to JSON. - * @function toJSON - * @memberof google.spanner.v1.TransactionOptions.ReadOnly - * @instance - * @returns {Object.} JSON object - */ - ReadOnly.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ReadOnly - * @function getTypeUrl - * @memberof google.spanner.v1.TransactionOptions.ReadOnly - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ReadOnly.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.TransactionOptions.ReadOnly"; - }; - - return ReadOnly; - })(); - - /** - * IsolationLevel enum. - * @name google.spanner.v1.TransactionOptions.IsolationLevel - * @enum {number} - * @property {number} ISOLATION_LEVEL_UNSPECIFIED=0 ISOLATION_LEVEL_UNSPECIFIED value - * @property {number} SERIALIZABLE=1 SERIALIZABLE value - * @property {number} REPEATABLE_READ=2 REPEATABLE_READ value - */ - TransactionOptions.IsolationLevel = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ISOLATION_LEVEL_UNSPECIFIED"] = 0; - values[valuesById[1] = "SERIALIZABLE"] = 1; - values[valuesById[2] = "REPEATABLE_READ"] = 2; - return values; - })(); - - return TransactionOptions; - })(); - - v1.Transaction = (function() { - - /** - * Properties of a Transaction. - * @memberof google.spanner.v1 - * @interface ITransaction - * @property {Uint8Array|null} [id] Transaction id - * @property {google.protobuf.ITimestamp|null} [readTimestamp] Transaction readTimestamp - * @property {google.spanner.v1.IMultiplexedSessionPrecommitToken|null} [precommitToken] Transaction precommitToken - */ - - /** - * Constructs a new Transaction. - * @memberof google.spanner.v1 - * @classdesc Represents a Transaction. - * @implements ITransaction - * @constructor - * @param {google.spanner.v1.ITransaction=} [properties] Properties to set - */ - function Transaction(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Transaction id. - * @member {Uint8Array} id - * @memberof google.spanner.v1.Transaction - * @instance - */ - Transaction.prototype.id = $util.newBuffer([]); - - /** - * Transaction readTimestamp. - * @member {google.protobuf.ITimestamp|null|undefined} readTimestamp - * @memberof google.spanner.v1.Transaction - * @instance - */ - Transaction.prototype.readTimestamp = null; - - /** - * Transaction precommitToken. - * @member {google.spanner.v1.IMultiplexedSessionPrecommitToken|null|undefined} precommitToken - * @memberof google.spanner.v1.Transaction - * @instance - */ - Transaction.prototype.precommitToken = null; - - /** - * Creates a new Transaction instance using the specified properties. - * @function create - * @memberof google.spanner.v1.Transaction - * @static - * @param {google.spanner.v1.ITransaction=} [properties] Properties to set - * @returns {google.spanner.v1.Transaction} Transaction instance - */ - Transaction.create = function create(properties) { - return new Transaction(properties); - }; - - /** - * Encodes the specified Transaction message. Does not implicitly {@link google.spanner.v1.Transaction.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.Transaction - * @static - * @param {google.spanner.v1.ITransaction} message Transaction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Transaction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.id != null && Object.hasOwnProperty.call(message, "id")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.id); - if (message.readTimestamp != null && Object.hasOwnProperty.call(message, "readTimestamp")) - $root.google.protobuf.Timestamp.encode(message.readTimestamp, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.precommitToken != null && Object.hasOwnProperty.call(message, "precommitToken")) - $root.google.spanner.v1.MultiplexedSessionPrecommitToken.encode(message.precommitToken, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Transaction message, length delimited. Does not implicitly {@link google.spanner.v1.Transaction.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.Transaction - * @static - * @param {google.spanner.v1.ITransaction} message Transaction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Transaction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Transaction message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.Transaction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.Transaction} Transaction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Transaction.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.Transaction(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.id = reader.bytes(); - break; - } - case 2: { - message.readTimestamp = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 3: { - message.precommitToken = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Transaction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.Transaction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.Transaction} Transaction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Transaction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Transaction message. - * @function verify - * @memberof google.spanner.v1.Transaction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Transaction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.id != null && message.hasOwnProperty("id")) - if (!(message.id && typeof message.id.length === "number" || $util.isString(message.id))) - return "id: buffer expected"; - if (message.readTimestamp != null && message.hasOwnProperty("readTimestamp")) { - var error = $root.google.protobuf.Timestamp.verify(message.readTimestamp); - if (error) - return "readTimestamp." + error; - } - if (message.precommitToken != null && message.hasOwnProperty("precommitToken")) { - var error = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.verify(message.precommitToken); - if (error) - return "precommitToken." + error; - } - return null; - }; - - /** - * Creates a Transaction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.Transaction - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.Transaction} Transaction - */ - Transaction.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.Transaction) - return object; - var message = new $root.google.spanner.v1.Transaction(); - if (object.id != null) - if (typeof object.id === "string") - $util.base64.decode(object.id, message.id = $util.newBuffer($util.base64.length(object.id)), 0); - else if (object.id.length >= 0) - message.id = object.id; - if (object.readTimestamp != null) { - if (typeof object.readTimestamp !== "object") - throw TypeError(".google.spanner.v1.Transaction.readTimestamp: object expected"); - message.readTimestamp = $root.google.protobuf.Timestamp.fromObject(object.readTimestamp); - } - if (object.precommitToken != null) { - if (typeof object.precommitToken !== "object") - throw TypeError(".google.spanner.v1.Transaction.precommitToken: object expected"); - message.precommitToken = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.fromObject(object.precommitToken); - } - return message; - }; - - /** - * Creates a plain object from a Transaction message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.Transaction - * @static - * @param {google.spanner.v1.Transaction} message Transaction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Transaction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.id = ""; - else { - object.id = []; - if (options.bytes !== Array) - object.id = $util.newBuffer(object.id); - } - object.readTimestamp = null; - object.precommitToken = null; - } - if (message.id != null && message.hasOwnProperty("id")) - object.id = options.bytes === String ? $util.base64.encode(message.id, 0, message.id.length) : options.bytes === Array ? Array.prototype.slice.call(message.id) : message.id; - if (message.readTimestamp != null && message.hasOwnProperty("readTimestamp")) - object.readTimestamp = $root.google.protobuf.Timestamp.toObject(message.readTimestamp, options); - if (message.precommitToken != null && message.hasOwnProperty("precommitToken")) - object.precommitToken = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.toObject(message.precommitToken, options); - return object; - }; - - /** - * Converts this Transaction to JSON. - * @function toJSON - * @memberof google.spanner.v1.Transaction - * @instance - * @returns {Object.} JSON object - */ - Transaction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Transaction - * @function getTypeUrl - * @memberof google.spanner.v1.Transaction - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Transaction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.Transaction"; - }; - - return Transaction; - })(); - - v1.TransactionSelector = (function() { - - /** - * Properties of a TransactionSelector. - * @memberof google.spanner.v1 - * @interface ITransactionSelector - * @property {google.spanner.v1.ITransactionOptions|null} [singleUse] TransactionSelector singleUse - * @property {Uint8Array|null} [id] TransactionSelector id - * @property {google.spanner.v1.ITransactionOptions|null} [begin] TransactionSelector begin - */ - - /** - * Constructs a new TransactionSelector. - * @memberof google.spanner.v1 - * @classdesc Represents a TransactionSelector. - * @implements ITransactionSelector - * @constructor - * @param {google.spanner.v1.ITransactionSelector=} [properties] Properties to set - */ - function TransactionSelector(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TransactionSelector singleUse. - * @member {google.spanner.v1.ITransactionOptions|null|undefined} singleUse - * @memberof google.spanner.v1.TransactionSelector - * @instance - */ - TransactionSelector.prototype.singleUse = null; - - /** - * TransactionSelector id. - * @member {Uint8Array|null|undefined} id - * @memberof google.spanner.v1.TransactionSelector - * @instance - */ - TransactionSelector.prototype.id = null; - - /** - * TransactionSelector begin. - * @member {google.spanner.v1.ITransactionOptions|null|undefined} begin - * @memberof google.spanner.v1.TransactionSelector - * @instance - */ - TransactionSelector.prototype.begin = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * TransactionSelector selector. - * @member {"singleUse"|"id"|"begin"|undefined} selector - * @memberof google.spanner.v1.TransactionSelector - * @instance - */ - Object.defineProperty(TransactionSelector.prototype, "selector", { - get: $util.oneOfGetter($oneOfFields = ["singleUse", "id", "begin"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new TransactionSelector instance using the specified properties. - * @function create - * @memberof google.spanner.v1.TransactionSelector - * @static - * @param {google.spanner.v1.ITransactionSelector=} [properties] Properties to set - * @returns {google.spanner.v1.TransactionSelector} TransactionSelector instance - */ - TransactionSelector.create = function create(properties) { - return new TransactionSelector(properties); - }; - - /** - * Encodes the specified TransactionSelector message. Does not implicitly {@link google.spanner.v1.TransactionSelector.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.TransactionSelector - * @static - * @param {google.spanner.v1.ITransactionSelector} message TransactionSelector message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TransactionSelector.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.singleUse != null && Object.hasOwnProperty.call(message, "singleUse")) - $root.google.spanner.v1.TransactionOptions.encode(message.singleUse, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.id != null && Object.hasOwnProperty.call(message, "id")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.id); - if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) - $root.google.spanner.v1.TransactionOptions.encode(message.begin, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified TransactionSelector message, length delimited. Does not implicitly {@link google.spanner.v1.TransactionSelector.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.TransactionSelector - * @static - * @param {google.spanner.v1.ITransactionSelector} message TransactionSelector message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TransactionSelector.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TransactionSelector message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.TransactionSelector - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.TransactionSelector} TransactionSelector - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TransactionSelector.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.TransactionSelector(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.singleUse = $root.google.spanner.v1.TransactionOptions.decode(reader, reader.uint32()); - break; - } - case 2: { - message.id = reader.bytes(); - break; - } - case 3: { - message.begin = $root.google.spanner.v1.TransactionOptions.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TransactionSelector message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.TransactionSelector - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.TransactionSelector} TransactionSelector - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TransactionSelector.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TransactionSelector message. - * @function verify - * @memberof google.spanner.v1.TransactionSelector - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TransactionSelector.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.singleUse != null && message.hasOwnProperty("singleUse")) { - properties.selector = 1; - { - var error = $root.google.spanner.v1.TransactionOptions.verify(message.singleUse); - if (error) - return "singleUse." + error; - } - } - if (message.id != null && message.hasOwnProperty("id")) { - if (properties.selector === 1) - return "selector: multiple values"; - properties.selector = 1; - if (!(message.id && typeof message.id.length === "number" || $util.isString(message.id))) - return "id: buffer expected"; - } - if (message.begin != null && message.hasOwnProperty("begin")) { - if (properties.selector === 1) - return "selector: multiple values"; - properties.selector = 1; - { - var error = $root.google.spanner.v1.TransactionOptions.verify(message.begin); - if (error) - return "begin." + error; - } - } - return null; - }; - - /** - * Creates a TransactionSelector message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.TransactionSelector - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.TransactionSelector} TransactionSelector - */ - TransactionSelector.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.TransactionSelector) - return object; - var message = new $root.google.spanner.v1.TransactionSelector(); - if (object.singleUse != null) { - if (typeof object.singleUse !== "object") - throw TypeError(".google.spanner.v1.TransactionSelector.singleUse: object expected"); - message.singleUse = $root.google.spanner.v1.TransactionOptions.fromObject(object.singleUse); - } - if (object.id != null) - if (typeof object.id === "string") - $util.base64.decode(object.id, message.id = $util.newBuffer($util.base64.length(object.id)), 0); - else if (object.id.length >= 0) - message.id = object.id; - if (object.begin != null) { - if (typeof object.begin !== "object") - throw TypeError(".google.spanner.v1.TransactionSelector.begin: object expected"); - message.begin = $root.google.spanner.v1.TransactionOptions.fromObject(object.begin); - } - return message; - }; - - /** - * Creates a plain object from a TransactionSelector message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.TransactionSelector - * @static - * @param {google.spanner.v1.TransactionSelector} message TransactionSelector - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TransactionSelector.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.singleUse != null && message.hasOwnProperty("singleUse")) { - object.singleUse = $root.google.spanner.v1.TransactionOptions.toObject(message.singleUse, options); - if (options.oneofs) - object.selector = "singleUse"; - } - if (message.id != null && message.hasOwnProperty("id")) { - object.id = options.bytes === String ? $util.base64.encode(message.id, 0, message.id.length) : options.bytes === Array ? Array.prototype.slice.call(message.id) : message.id; - if (options.oneofs) - object.selector = "id"; - } - if (message.begin != null && message.hasOwnProperty("begin")) { - object.begin = $root.google.spanner.v1.TransactionOptions.toObject(message.begin, options); - if (options.oneofs) - object.selector = "begin"; - } - return object; - }; - - /** - * Converts this TransactionSelector to JSON. - * @function toJSON - * @memberof google.spanner.v1.TransactionSelector - * @instance - * @returns {Object.} JSON object - */ - TransactionSelector.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TransactionSelector - * @function getTypeUrl - * @memberof google.spanner.v1.TransactionSelector - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TransactionSelector.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.TransactionSelector"; - }; - - return TransactionSelector; - })(); - - v1.MultiplexedSessionPrecommitToken = (function() { - - /** - * Properties of a MultiplexedSessionPrecommitToken. - * @memberof google.spanner.v1 - * @interface IMultiplexedSessionPrecommitToken - * @property {Uint8Array|null} [precommitToken] MultiplexedSessionPrecommitToken precommitToken - * @property {number|null} [seqNum] MultiplexedSessionPrecommitToken seqNum - */ - - /** - * Constructs a new MultiplexedSessionPrecommitToken. - * @memberof google.spanner.v1 - * @classdesc Represents a MultiplexedSessionPrecommitToken. - * @implements IMultiplexedSessionPrecommitToken - * @constructor - * @param {google.spanner.v1.IMultiplexedSessionPrecommitToken=} [properties] Properties to set - */ - function MultiplexedSessionPrecommitToken(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MultiplexedSessionPrecommitToken precommitToken. - * @member {Uint8Array} precommitToken - * @memberof google.spanner.v1.MultiplexedSessionPrecommitToken - * @instance - */ - MultiplexedSessionPrecommitToken.prototype.precommitToken = $util.newBuffer([]); - - /** - * MultiplexedSessionPrecommitToken seqNum. - * @member {number} seqNum - * @memberof google.spanner.v1.MultiplexedSessionPrecommitToken - * @instance - */ - MultiplexedSessionPrecommitToken.prototype.seqNum = 0; - - /** - * Creates a new MultiplexedSessionPrecommitToken instance using the specified properties. - * @function create - * @memberof google.spanner.v1.MultiplexedSessionPrecommitToken - * @static - * @param {google.spanner.v1.IMultiplexedSessionPrecommitToken=} [properties] Properties to set - * @returns {google.spanner.v1.MultiplexedSessionPrecommitToken} MultiplexedSessionPrecommitToken instance - */ - MultiplexedSessionPrecommitToken.create = function create(properties) { - return new MultiplexedSessionPrecommitToken(properties); - }; - - /** - * Encodes the specified MultiplexedSessionPrecommitToken message. Does not implicitly {@link google.spanner.v1.MultiplexedSessionPrecommitToken.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.MultiplexedSessionPrecommitToken - * @static - * @param {google.spanner.v1.IMultiplexedSessionPrecommitToken} message MultiplexedSessionPrecommitToken message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MultiplexedSessionPrecommitToken.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.precommitToken != null && Object.hasOwnProperty.call(message, "precommitToken")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.precommitToken); - if (message.seqNum != null && Object.hasOwnProperty.call(message, "seqNum")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.seqNum); - return writer; - }; - - /** - * Encodes the specified MultiplexedSessionPrecommitToken message, length delimited. Does not implicitly {@link google.spanner.v1.MultiplexedSessionPrecommitToken.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.MultiplexedSessionPrecommitToken - * @static - * @param {google.spanner.v1.IMultiplexedSessionPrecommitToken} message MultiplexedSessionPrecommitToken message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MultiplexedSessionPrecommitToken.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MultiplexedSessionPrecommitToken message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.MultiplexedSessionPrecommitToken - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.MultiplexedSessionPrecommitToken} MultiplexedSessionPrecommitToken - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MultiplexedSessionPrecommitToken.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.MultiplexedSessionPrecommitToken(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.precommitToken = reader.bytes(); - break; - } - case 2: { - message.seqNum = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MultiplexedSessionPrecommitToken message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.MultiplexedSessionPrecommitToken - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.MultiplexedSessionPrecommitToken} MultiplexedSessionPrecommitToken - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MultiplexedSessionPrecommitToken.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MultiplexedSessionPrecommitToken message. - * @function verify - * @memberof google.spanner.v1.MultiplexedSessionPrecommitToken - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MultiplexedSessionPrecommitToken.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.precommitToken != null && message.hasOwnProperty("precommitToken")) - if (!(message.precommitToken && typeof message.precommitToken.length === "number" || $util.isString(message.precommitToken))) - return "precommitToken: buffer expected"; - if (message.seqNum != null && message.hasOwnProperty("seqNum")) - if (!$util.isInteger(message.seqNum)) - return "seqNum: integer expected"; - return null; - }; - - /** - * Creates a MultiplexedSessionPrecommitToken message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.MultiplexedSessionPrecommitToken - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.MultiplexedSessionPrecommitToken} MultiplexedSessionPrecommitToken - */ - MultiplexedSessionPrecommitToken.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.MultiplexedSessionPrecommitToken) - return object; - var message = new $root.google.spanner.v1.MultiplexedSessionPrecommitToken(); - if (object.precommitToken != null) - if (typeof object.precommitToken === "string") - $util.base64.decode(object.precommitToken, message.precommitToken = $util.newBuffer($util.base64.length(object.precommitToken)), 0); - else if (object.precommitToken.length >= 0) - message.precommitToken = object.precommitToken; - if (object.seqNum != null) - message.seqNum = object.seqNum | 0; - return message; - }; - - /** - * Creates a plain object from a MultiplexedSessionPrecommitToken message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.MultiplexedSessionPrecommitToken - * @static - * @param {google.spanner.v1.MultiplexedSessionPrecommitToken} message MultiplexedSessionPrecommitToken - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MultiplexedSessionPrecommitToken.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.precommitToken = ""; - else { - object.precommitToken = []; - if (options.bytes !== Array) - object.precommitToken = $util.newBuffer(object.precommitToken); - } - object.seqNum = 0; - } - if (message.precommitToken != null && message.hasOwnProperty("precommitToken")) - object.precommitToken = options.bytes === String ? $util.base64.encode(message.precommitToken, 0, message.precommitToken.length) : options.bytes === Array ? Array.prototype.slice.call(message.precommitToken) : message.precommitToken; - if (message.seqNum != null && message.hasOwnProperty("seqNum")) - object.seqNum = message.seqNum; - return object; - }; - - /** - * Converts this MultiplexedSessionPrecommitToken to JSON. - * @function toJSON - * @memberof google.spanner.v1.MultiplexedSessionPrecommitToken - * @instance - * @returns {Object.} JSON object - */ - MultiplexedSessionPrecommitToken.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MultiplexedSessionPrecommitToken - * @function getTypeUrl - * @memberof google.spanner.v1.MultiplexedSessionPrecommitToken - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MultiplexedSessionPrecommitToken.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.MultiplexedSessionPrecommitToken"; - }; - - return MultiplexedSessionPrecommitToken; - })(); - - v1.KeyRange = (function() { - - /** - * Properties of a KeyRange. - * @memberof google.spanner.v1 - * @interface IKeyRange - * @property {google.protobuf.IListValue|null} [startClosed] KeyRange startClosed - * @property {google.protobuf.IListValue|null} [startOpen] KeyRange startOpen - * @property {google.protobuf.IListValue|null} [endClosed] KeyRange endClosed - * @property {google.protobuf.IListValue|null} [endOpen] KeyRange endOpen - */ - - /** - * Constructs a new KeyRange. - * @memberof google.spanner.v1 - * @classdesc Represents a KeyRange. - * @implements IKeyRange - * @constructor - * @param {google.spanner.v1.IKeyRange=} [properties] Properties to set - */ - function KeyRange(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * KeyRange startClosed. - * @member {google.protobuf.IListValue|null|undefined} startClosed - * @memberof google.spanner.v1.KeyRange - * @instance - */ - KeyRange.prototype.startClosed = null; - - /** - * KeyRange startOpen. - * @member {google.protobuf.IListValue|null|undefined} startOpen - * @memberof google.spanner.v1.KeyRange - * @instance - */ - KeyRange.prototype.startOpen = null; - - /** - * KeyRange endClosed. - * @member {google.protobuf.IListValue|null|undefined} endClosed - * @memberof google.spanner.v1.KeyRange - * @instance - */ - KeyRange.prototype.endClosed = null; - - /** - * KeyRange endOpen. - * @member {google.protobuf.IListValue|null|undefined} endOpen - * @memberof google.spanner.v1.KeyRange - * @instance - */ - KeyRange.prototype.endOpen = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * KeyRange startKeyType. - * @member {"startClosed"|"startOpen"|undefined} startKeyType - * @memberof google.spanner.v1.KeyRange - * @instance - */ - Object.defineProperty(KeyRange.prototype, "startKeyType", { - get: $util.oneOfGetter($oneOfFields = ["startClosed", "startOpen"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * KeyRange endKeyType. - * @member {"endClosed"|"endOpen"|undefined} endKeyType - * @memberof google.spanner.v1.KeyRange - * @instance - */ - Object.defineProperty(KeyRange.prototype, "endKeyType", { - get: $util.oneOfGetter($oneOfFields = ["endClosed", "endOpen"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new KeyRange instance using the specified properties. - * @function create - * @memberof google.spanner.v1.KeyRange - * @static - * @param {google.spanner.v1.IKeyRange=} [properties] Properties to set - * @returns {google.spanner.v1.KeyRange} KeyRange instance - */ - KeyRange.create = function create(properties) { - return new KeyRange(properties); - }; - - /** - * Encodes the specified KeyRange message. Does not implicitly {@link google.spanner.v1.KeyRange.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.KeyRange - * @static - * @param {google.spanner.v1.IKeyRange} message KeyRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - KeyRange.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.startClosed != null && Object.hasOwnProperty.call(message, "startClosed")) - $root.google.protobuf.ListValue.encode(message.startClosed, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.startOpen != null && Object.hasOwnProperty.call(message, "startOpen")) - $root.google.protobuf.ListValue.encode(message.startOpen, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.endClosed != null && Object.hasOwnProperty.call(message, "endClosed")) - $root.google.protobuf.ListValue.encode(message.endClosed, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.endOpen != null && Object.hasOwnProperty.call(message, "endOpen")) - $root.google.protobuf.ListValue.encode(message.endOpen, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified KeyRange message, length delimited. Does not implicitly {@link google.spanner.v1.KeyRange.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.KeyRange - * @static - * @param {google.spanner.v1.IKeyRange} message KeyRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - KeyRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a KeyRange message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.KeyRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.KeyRange} KeyRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - KeyRange.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.KeyRange(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.startClosed = $root.google.protobuf.ListValue.decode(reader, reader.uint32()); - break; - } - case 2: { - message.startOpen = $root.google.protobuf.ListValue.decode(reader, reader.uint32()); - break; - } - case 3: { - message.endClosed = $root.google.protobuf.ListValue.decode(reader, reader.uint32()); - break; - } - case 4: { - message.endOpen = $root.google.protobuf.ListValue.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a KeyRange message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.KeyRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.KeyRange} KeyRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - KeyRange.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a KeyRange message. - * @function verify - * @memberof google.spanner.v1.KeyRange - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - KeyRange.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.startClosed != null && message.hasOwnProperty("startClosed")) { - properties.startKeyType = 1; - { - var error = $root.google.protobuf.ListValue.verify(message.startClosed); - if (error) - return "startClosed." + error; - } - } - if (message.startOpen != null && message.hasOwnProperty("startOpen")) { - if (properties.startKeyType === 1) - return "startKeyType: multiple values"; - properties.startKeyType = 1; - { - var error = $root.google.protobuf.ListValue.verify(message.startOpen); - if (error) - return "startOpen." + error; - } - } - if (message.endClosed != null && message.hasOwnProperty("endClosed")) { - properties.endKeyType = 1; - { - var error = $root.google.protobuf.ListValue.verify(message.endClosed); - if (error) - return "endClosed." + error; - } - } - if (message.endOpen != null && message.hasOwnProperty("endOpen")) { - if (properties.endKeyType === 1) - return "endKeyType: multiple values"; - properties.endKeyType = 1; - { - var error = $root.google.protobuf.ListValue.verify(message.endOpen); - if (error) - return "endOpen." + error; - } - } - return null; - }; - - /** - * Creates a KeyRange message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.KeyRange - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.KeyRange} KeyRange - */ - KeyRange.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.KeyRange) - return object; - var message = new $root.google.spanner.v1.KeyRange(); - if (object.startClosed != null) { - if (typeof object.startClosed !== "object") - throw TypeError(".google.spanner.v1.KeyRange.startClosed: object expected"); - message.startClosed = $root.google.protobuf.ListValue.fromObject(object.startClosed); - } - if (object.startOpen != null) { - if (typeof object.startOpen !== "object") - throw TypeError(".google.spanner.v1.KeyRange.startOpen: object expected"); - message.startOpen = $root.google.protobuf.ListValue.fromObject(object.startOpen); - } - if (object.endClosed != null) { - if (typeof object.endClosed !== "object") - throw TypeError(".google.spanner.v1.KeyRange.endClosed: object expected"); - message.endClosed = $root.google.protobuf.ListValue.fromObject(object.endClosed); - } - if (object.endOpen != null) { - if (typeof object.endOpen !== "object") - throw TypeError(".google.spanner.v1.KeyRange.endOpen: object expected"); - message.endOpen = $root.google.protobuf.ListValue.fromObject(object.endOpen); - } - return message; - }; - - /** - * Creates a plain object from a KeyRange message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.KeyRange - * @static - * @param {google.spanner.v1.KeyRange} message KeyRange - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - KeyRange.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.startClosed != null && message.hasOwnProperty("startClosed")) { - object.startClosed = $root.google.protobuf.ListValue.toObject(message.startClosed, options); - if (options.oneofs) - object.startKeyType = "startClosed"; - } - if (message.startOpen != null && message.hasOwnProperty("startOpen")) { - object.startOpen = $root.google.protobuf.ListValue.toObject(message.startOpen, options); - if (options.oneofs) - object.startKeyType = "startOpen"; - } - if (message.endClosed != null && message.hasOwnProperty("endClosed")) { - object.endClosed = $root.google.protobuf.ListValue.toObject(message.endClosed, options); - if (options.oneofs) - object.endKeyType = "endClosed"; - } - if (message.endOpen != null && message.hasOwnProperty("endOpen")) { - object.endOpen = $root.google.protobuf.ListValue.toObject(message.endOpen, options); - if (options.oneofs) - object.endKeyType = "endOpen"; - } - return object; - }; - - /** - * Converts this KeyRange to JSON. - * @function toJSON - * @memberof google.spanner.v1.KeyRange - * @instance - * @returns {Object.} JSON object - */ - KeyRange.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for KeyRange - * @function getTypeUrl - * @memberof google.spanner.v1.KeyRange - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - KeyRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.KeyRange"; - }; - - return KeyRange; - })(); - - v1.KeySet = (function() { - - /** - * Properties of a KeySet. - * @memberof google.spanner.v1 - * @interface IKeySet - * @property {Array.|null} [keys] KeySet keys - * @property {Array.|null} [ranges] KeySet ranges - * @property {boolean|null} [all] KeySet all - */ - - /** - * Constructs a new KeySet. - * @memberof google.spanner.v1 - * @classdesc Represents a KeySet. - * @implements IKeySet - * @constructor - * @param {google.spanner.v1.IKeySet=} [properties] Properties to set - */ - function KeySet(properties) { - this.keys = []; - this.ranges = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * KeySet keys. - * @member {Array.} keys - * @memberof google.spanner.v1.KeySet - * @instance - */ - KeySet.prototype.keys = $util.emptyArray; - - /** - * KeySet ranges. - * @member {Array.} ranges - * @memberof google.spanner.v1.KeySet - * @instance - */ - KeySet.prototype.ranges = $util.emptyArray; - - /** - * KeySet all. - * @member {boolean} all - * @memberof google.spanner.v1.KeySet - * @instance - */ - KeySet.prototype.all = false; - - /** - * Creates a new KeySet instance using the specified properties. - * @function create - * @memberof google.spanner.v1.KeySet - * @static - * @param {google.spanner.v1.IKeySet=} [properties] Properties to set - * @returns {google.spanner.v1.KeySet} KeySet instance - */ - KeySet.create = function create(properties) { - return new KeySet(properties); - }; - - /** - * Encodes the specified KeySet message. Does not implicitly {@link google.spanner.v1.KeySet.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.KeySet - * @static - * @param {google.spanner.v1.IKeySet} message KeySet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - KeySet.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.keys != null && message.keys.length) - for (var i = 0; i < message.keys.length; ++i) - $root.google.protobuf.ListValue.encode(message.keys[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.ranges != null && message.ranges.length) - for (var i = 0; i < message.ranges.length; ++i) - $root.google.spanner.v1.KeyRange.encode(message.ranges[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.all != null && Object.hasOwnProperty.call(message, "all")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.all); - return writer; - }; - - /** - * Encodes the specified KeySet message, length delimited. Does not implicitly {@link google.spanner.v1.KeySet.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.KeySet - * @static - * @param {google.spanner.v1.IKeySet} message KeySet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - KeySet.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a KeySet message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.KeySet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.KeySet} KeySet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - KeySet.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.KeySet(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.keys && message.keys.length)) - message.keys = []; - message.keys.push($root.google.protobuf.ListValue.decode(reader, reader.uint32())); - break; - } - case 2: { - if (!(message.ranges && message.ranges.length)) - message.ranges = []; - message.ranges.push($root.google.spanner.v1.KeyRange.decode(reader, reader.uint32())); - break; - } - case 3: { - message.all = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a KeySet message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.KeySet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.KeySet} KeySet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - KeySet.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a KeySet message. - * @function verify - * @memberof google.spanner.v1.KeySet - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - KeySet.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.keys != null && message.hasOwnProperty("keys")) { - if (!Array.isArray(message.keys)) - return "keys: array expected"; - for (var i = 0; i < message.keys.length; ++i) { - var error = $root.google.protobuf.ListValue.verify(message.keys[i]); - if (error) - return "keys." + error; - } - } - if (message.ranges != null && message.hasOwnProperty("ranges")) { - if (!Array.isArray(message.ranges)) - return "ranges: array expected"; - for (var i = 0; i < message.ranges.length; ++i) { - var error = $root.google.spanner.v1.KeyRange.verify(message.ranges[i]); - if (error) - return "ranges." + error; - } - } - if (message.all != null && message.hasOwnProperty("all")) - if (typeof message.all !== "boolean") - return "all: boolean expected"; - return null; - }; - - /** - * Creates a KeySet message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.KeySet - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.KeySet} KeySet - */ - KeySet.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.KeySet) - return object; - var message = new $root.google.spanner.v1.KeySet(); - if (object.keys) { - if (!Array.isArray(object.keys)) - throw TypeError(".google.spanner.v1.KeySet.keys: array expected"); - message.keys = []; - for (var i = 0; i < object.keys.length; ++i) { - if (typeof object.keys[i] !== "object") - throw TypeError(".google.spanner.v1.KeySet.keys: object expected"); - message.keys[i] = $root.google.protobuf.ListValue.fromObject(object.keys[i]); - } - } - if (object.ranges) { - if (!Array.isArray(object.ranges)) - throw TypeError(".google.spanner.v1.KeySet.ranges: array expected"); - message.ranges = []; - for (var i = 0; i < object.ranges.length; ++i) { - if (typeof object.ranges[i] !== "object") - throw TypeError(".google.spanner.v1.KeySet.ranges: object expected"); - message.ranges[i] = $root.google.spanner.v1.KeyRange.fromObject(object.ranges[i]); - } - } - if (object.all != null) - message.all = Boolean(object.all); - return message; - }; - - /** - * Creates a plain object from a KeySet message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.KeySet - * @static - * @param {google.spanner.v1.KeySet} message KeySet - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - KeySet.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.keys = []; - object.ranges = []; - } - if (options.defaults) - object.all = false; - if (message.keys && message.keys.length) { - object.keys = []; - for (var j = 0; j < message.keys.length; ++j) - object.keys[j] = $root.google.protobuf.ListValue.toObject(message.keys[j], options); - } - if (message.ranges && message.ranges.length) { - object.ranges = []; - for (var j = 0; j < message.ranges.length; ++j) - object.ranges[j] = $root.google.spanner.v1.KeyRange.toObject(message.ranges[j], options); - } - if (message.all != null && message.hasOwnProperty("all")) - object.all = message.all; - return object; - }; - - /** - * Converts this KeySet to JSON. - * @function toJSON - * @memberof google.spanner.v1.KeySet - * @instance - * @returns {Object.} JSON object - */ - KeySet.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for KeySet - * @function getTypeUrl - * @memberof google.spanner.v1.KeySet - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - KeySet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.KeySet"; - }; - - return KeySet; - })(); - - v1.Range = (function() { - - /** - * Properties of a Range. - * @memberof google.spanner.v1 - * @interface IRange - * @property {Uint8Array|null} [startKey] Range startKey - * @property {Uint8Array|null} [limitKey] Range limitKey - * @property {number|Long|null} [groupUid] Range groupUid - * @property {number|Long|null} [splitId] Range splitId - * @property {Uint8Array|null} [generation] Range generation - */ - - /** - * Constructs a new Range. - * @memberof google.spanner.v1 - * @classdesc Represents a Range. - * @implements IRange - * @constructor - * @param {google.spanner.v1.IRange=} [properties] Properties to set - */ - function Range(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Range startKey. - * @member {Uint8Array} startKey - * @memberof google.spanner.v1.Range - * @instance - */ - Range.prototype.startKey = $util.newBuffer([]); - - /** - * Range limitKey. - * @member {Uint8Array} limitKey - * @memberof google.spanner.v1.Range - * @instance - */ - Range.prototype.limitKey = $util.newBuffer([]); - - /** - * Range groupUid. - * @member {number|Long} groupUid - * @memberof google.spanner.v1.Range - * @instance - */ - Range.prototype.groupUid = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Range splitId. - * @member {number|Long} splitId - * @memberof google.spanner.v1.Range - * @instance - */ - Range.prototype.splitId = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Range generation. - * @member {Uint8Array} generation - * @memberof google.spanner.v1.Range - * @instance - */ - Range.prototype.generation = $util.newBuffer([]); - - /** - * Creates a new Range instance using the specified properties. - * @function create - * @memberof google.spanner.v1.Range - * @static - * @param {google.spanner.v1.IRange=} [properties] Properties to set - * @returns {google.spanner.v1.Range} Range instance - */ - Range.create = function create(properties) { - return new Range(properties); - }; - - /** - * Encodes the specified Range message. Does not implicitly {@link google.spanner.v1.Range.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.Range - * @static - * @param {google.spanner.v1.IRange} message Range message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Range.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.startKey != null && Object.hasOwnProperty.call(message, "startKey")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.startKey); - if (message.limitKey != null && Object.hasOwnProperty.call(message, "limitKey")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.limitKey); - if (message.groupUid != null && Object.hasOwnProperty.call(message, "groupUid")) - writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.groupUid); - if (message.splitId != null && Object.hasOwnProperty.call(message, "splitId")) - writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.splitId); - if (message.generation != null && Object.hasOwnProperty.call(message, "generation")) - writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.generation); - return writer; - }; - - /** - * Encodes the specified Range message, length delimited. Does not implicitly {@link google.spanner.v1.Range.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.Range - * @static - * @param {google.spanner.v1.IRange} message Range message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Range.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Range message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.Range - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.Range} Range - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Range.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.Range(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.startKey = reader.bytes(); - break; - } - case 2: { - message.limitKey = reader.bytes(); - break; - } - case 3: { - message.groupUid = reader.uint64(); - break; - } - case 4: { - message.splitId = reader.uint64(); - break; - } - case 5: { - message.generation = reader.bytes(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Range message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.Range - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.Range} Range - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Range.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Range message. - * @function verify - * @memberof google.spanner.v1.Range - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Range.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.startKey != null && message.hasOwnProperty("startKey")) - if (!(message.startKey && typeof message.startKey.length === "number" || $util.isString(message.startKey))) - return "startKey: buffer expected"; - if (message.limitKey != null && message.hasOwnProperty("limitKey")) - if (!(message.limitKey && typeof message.limitKey.length === "number" || $util.isString(message.limitKey))) - return "limitKey: buffer expected"; - if (message.groupUid != null && message.hasOwnProperty("groupUid")) - if (!$util.isInteger(message.groupUid) && !(message.groupUid && $util.isInteger(message.groupUid.low) && $util.isInteger(message.groupUid.high))) - return "groupUid: integer|Long expected"; - if (message.splitId != null && message.hasOwnProperty("splitId")) - if (!$util.isInteger(message.splitId) && !(message.splitId && $util.isInteger(message.splitId.low) && $util.isInteger(message.splitId.high))) - return "splitId: integer|Long expected"; - if (message.generation != null && message.hasOwnProperty("generation")) - if (!(message.generation && typeof message.generation.length === "number" || $util.isString(message.generation))) - return "generation: buffer expected"; - return null; - }; - - /** - * Creates a Range message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.Range - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.Range} Range - */ - Range.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.Range) - return object; - var message = new $root.google.spanner.v1.Range(); - if (object.startKey != null) - if (typeof object.startKey === "string") - $util.base64.decode(object.startKey, message.startKey = $util.newBuffer($util.base64.length(object.startKey)), 0); - else if (object.startKey.length >= 0) - message.startKey = object.startKey; - if (object.limitKey != null) - if (typeof object.limitKey === "string") - $util.base64.decode(object.limitKey, message.limitKey = $util.newBuffer($util.base64.length(object.limitKey)), 0); - else if (object.limitKey.length >= 0) - message.limitKey = object.limitKey; - if (object.groupUid != null) - if ($util.Long) - (message.groupUid = $util.Long.fromValue(object.groupUid)).unsigned = true; - else if (typeof object.groupUid === "string") - message.groupUid = parseInt(object.groupUid, 10); - else if (typeof object.groupUid === "number") - message.groupUid = object.groupUid; - else if (typeof object.groupUid === "object") - message.groupUid = new $util.LongBits(object.groupUid.low >>> 0, object.groupUid.high >>> 0).toNumber(true); - if (object.splitId != null) - if ($util.Long) - (message.splitId = $util.Long.fromValue(object.splitId)).unsigned = true; - else if (typeof object.splitId === "string") - message.splitId = parseInt(object.splitId, 10); - else if (typeof object.splitId === "number") - message.splitId = object.splitId; - else if (typeof object.splitId === "object") - message.splitId = new $util.LongBits(object.splitId.low >>> 0, object.splitId.high >>> 0).toNumber(true); - if (object.generation != null) - if (typeof object.generation === "string") - $util.base64.decode(object.generation, message.generation = $util.newBuffer($util.base64.length(object.generation)), 0); - else if (object.generation.length >= 0) - message.generation = object.generation; - return message; - }; - - /** - * Creates a plain object from a Range message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.Range - * @static - * @param {google.spanner.v1.Range} message Range - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Range.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.startKey = ""; - else { - object.startKey = []; - if (options.bytes !== Array) - object.startKey = $util.newBuffer(object.startKey); - } - if (options.bytes === String) - object.limitKey = ""; - else { - object.limitKey = []; - if (options.bytes !== Array) - object.limitKey = $util.newBuffer(object.limitKey); - } - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.groupUid = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.groupUid = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.splitId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.splitId = options.longs === String ? "0" : 0; - if (options.bytes === String) - object.generation = ""; - else { - object.generation = []; - if (options.bytes !== Array) - object.generation = $util.newBuffer(object.generation); - } - } - if (message.startKey != null && message.hasOwnProperty("startKey")) - object.startKey = options.bytes === String ? $util.base64.encode(message.startKey, 0, message.startKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.startKey) : message.startKey; - if (message.limitKey != null && message.hasOwnProperty("limitKey")) - object.limitKey = options.bytes === String ? $util.base64.encode(message.limitKey, 0, message.limitKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.limitKey) : message.limitKey; - if (message.groupUid != null && message.hasOwnProperty("groupUid")) - if (typeof message.groupUid === "number") - object.groupUid = options.longs === String ? String(message.groupUid) : message.groupUid; - else - object.groupUid = options.longs === String ? $util.Long.prototype.toString.call(message.groupUid) : options.longs === Number ? new $util.LongBits(message.groupUid.low >>> 0, message.groupUid.high >>> 0).toNumber(true) : message.groupUid; - if (message.splitId != null && message.hasOwnProperty("splitId")) - if (typeof message.splitId === "number") - object.splitId = options.longs === String ? String(message.splitId) : message.splitId; - else - object.splitId = options.longs === String ? $util.Long.prototype.toString.call(message.splitId) : options.longs === Number ? new $util.LongBits(message.splitId.low >>> 0, message.splitId.high >>> 0).toNumber(true) : message.splitId; - if (message.generation != null && message.hasOwnProperty("generation")) - object.generation = options.bytes === String ? $util.base64.encode(message.generation, 0, message.generation.length) : options.bytes === Array ? Array.prototype.slice.call(message.generation) : message.generation; - return object; - }; - - /** - * Converts this Range to JSON. - * @function toJSON - * @memberof google.spanner.v1.Range - * @instance - * @returns {Object.} JSON object - */ - Range.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Range - * @function getTypeUrl - * @memberof google.spanner.v1.Range - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Range.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.Range"; - }; - - return Range; - })(); - - v1.Tablet = (function() { - - /** - * Properties of a Tablet. - * @memberof google.spanner.v1 - * @interface ITablet - * @property {number|Long|null} [tabletUid] Tablet tabletUid - * @property {string|null} [serverAddress] Tablet serverAddress - * @property {string|null} [location] Tablet location - * @property {google.spanner.v1.Tablet.Role|null} [role] Tablet role - * @property {Uint8Array|null} [incarnation] Tablet incarnation - * @property {number|null} [distance] Tablet distance - * @property {boolean|null} [skip] Tablet skip - */ - - /** - * Constructs a new Tablet. - * @memberof google.spanner.v1 - * @classdesc Represents a Tablet. - * @implements ITablet - * @constructor - * @param {google.spanner.v1.ITablet=} [properties] Properties to set - */ - function Tablet(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Tablet tabletUid. - * @member {number|Long} tabletUid - * @memberof google.spanner.v1.Tablet - * @instance - */ - Tablet.prototype.tabletUid = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Tablet serverAddress. - * @member {string} serverAddress - * @memberof google.spanner.v1.Tablet - * @instance - */ - Tablet.prototype.serverAddress = ""; - - /** - * Tablet location. - * @member {string} location - * @memberof google.spanner.v1.Tablet - * @instance - */ - Tablet.prototype.location = ""; - - /** - * Tablet role. - * @member {google.spanner.v1.Tablet.Role} role - * @memberof google.spanner.v1.Tablet - * @instance - */ - Tablet.prototype.role = 0; - - /** - * Tablet incarnation. - * @member {Uint8Array} incarnation - * @memberof google.spanner.v1.Tablet - * @instance - */ - Tablet.prototype.incarnation = $util.newBuffer([]); - - /** - * Tablet distance. - * @member {number} distance - * @memberof google.spanner.v1.Tablet - * @instance - */ - Tablet.prototype.distance = 0; - - /** - * Tablet skip. - * @member {boolean} skip - * @memberof google.spanner.v1.Tablet - * @instance - */ - Tablet.prototype.skip = false; - - /** - * Creates a new Tablet instance using the specified properties. - * @function create - * @memberof google.spanner.v1.Tablet - * @static - * @param {google.spanner.v1.ITablet=} [properties] Properties to set - * @returns {google.spanner.v1.Tablet} Tablet instance - */ - Tablet.create = function create(properties) { - return new Tablet(properties); - }; - - /** - * Encodes the specified Tablet message. Does not implicitly {@link google.spanner.v1.Tablet.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.Tablet - * @static - * @param {google.spanner.v1.ITablet} message Tablet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Tablet.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tabletUid != null && Object.hasOwnProperty.call(message, "tabletUid")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.tabletUid); - if (message.serverAddress != null && Object.hasOwnProperty.call(message, "serverAddress")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.serverAddress); - if (message.location != null && Object.hasOwnProperty.call(message, "location")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.location); - if (message.role != null && Object.hasOwnProperty.call(message, "role")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.role); - if (message.incarnation != null && Object.hasOwnProperty.call(message, "incarnation")) - writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.incarnation); - if (message.distance != null && Object.hasOwnProperty.call(message, "distance")) - writer.uint32(/* id 6, wireType 0 =*/48).uint32(message.distance); - if (message.skip != null && Object.hasOwnProperty.call(message, "skip")) - writer.uint32(/* id 7, wireType 0 =*/56).bool(message.skip); - return writer; - }; - - /** - * Encodes the specified Tablet message, length delimited. Does not implicitly {@link google.spanner.v1.Tablet.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.Tablet - * @static - * @param {google.spanner.v1.ITablet} message Tablet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Tablet.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Tablet message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.Tablet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.Tablet} Tablet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Tablet.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.Tablet(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.tabletUid = reader.uint64(); - break; - } - case 2: { - message.serverAddress = reader.string(); - break; - } - case 3: { - message.location = reader.string(); - break; - } - case 4: { - message.role = reader.int32(); - break; - } - case 5: { - message.incarnation = reader.bytes(); - break; - } - case 6: { - message.distance = reader.uint32(); - break; - } - case 7: { - message.skip = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Tablet message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.Tablet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.Tablet} Tablet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Tablet.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Tablet message. - * @function verify - * @memberof google.spanner.v1.Tablet - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Tablet.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.tabletUid != null && message.hasOwnProperty("tabletUid")) - if (!$util.isInteger(message.tabletUid) && !(message.tabletUid && $util.isInteger(message.tabletUid.low) && $util.isInteger(message.tabletUid.high))) - return "tabletUid: integer|Long expected"; - if (message.serverAddress != null && message.hasOwnProperty("serverAddress")) - if (!$util.isString(message.serverAddress)) - return "serverAddress: string expected"; - if (message.location != null && message.hasOwnProperty("location")) - if (!$util.isString(message.location)) - return "location: string expected"; - if (message.role != null && message.hasOwnProperty("role")) - switch (message.role) { - default: - return "role: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.incarnation != null && message.hasOwnProperty("incarnation")) - if (!(message.incarnation && typeof message.incarnation.length === "number" || $util.isString(message.incarnation))) - return "incarnation: buffer expected"; - if (message.distance != null && message.hasOwnProperty("distance")) - if (!$util.isInteger(message.distance)) - return "distance: integer expected"; - if (message.skip != null && message.hasOwnProperty("skip")) - if (typeof message.skip !== "boolean") - return "skip: boolean expected"; - return null; - }; - - /** - * Creates a Tablet message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.Tablet - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.Tablet} Tablet - */ - Tablet.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.Tablet) - return object; - var message = new $root.google.spanner.v1.Tablet(); - if (object.tabletUid != null) - if ($util.Long) - (message.tabletUid = $util.Long.fromValue(object.tabletUid)).unsigned = true; - else if (typeof object.tabletUid === "string") - message.tabletUid = parseInt(object.tabletUid, 10); - else if (typeof object.tabletUid === "number") - message.tabletUid = object.tabletUid; - else if (typeof object.tabletUid === "object") - message.tabletUid = new $util.LongBits(object.tabletUid.low >>> 0, object.tabletUid.high >>> 0).toNumber(true); - if (object.serverAddress != null) - message.serverAddress = String(object.serverAddress); - if (object.location != null) - message.location = String(object.location); - switch (object.role) { - default: - if (typeof object.role === "number") { - message.role = object.role; - break; - } - break; - case "ROLE_UNSPECIFIED": - case 0: - message.role = 0; - break; - case "READ_WRITE": - case 1: - message.role = 1; - break; - case "READ_ONLY": - case 2: - message.role = 2; - break; - } - if (object.incarnation != null) - if (typeof object.incarnation === "string") - $util.base64.decode(object.incarnation, message.incarnation = $util.newBuffer($util.base64.length(object.incarnation)), 0); - else if (object.incarnation.length >= 0) - message.incarnation = object.incarnation; - if (object.distance != null) - message.distance = object.distance >>> 0; - if (object.skip != null) - message.skip = Boolean(object.skip); - return message; - }; - - /** - * Creates a plain object from a Tablet message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.Tablet - * @static - * @param {google.spanner.v1.Tablet} message Tablet - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Tablet.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.tabletUid = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.tabletUid = options.longs === String ? "0" : 0; - object.serverAddress = ""; - object.location = ""; - object.role = options.enums === String ? "ROLE_UNSPECIFIED" : 0; - if (options.bytes === String) - object.incarnation = ""; - else { - object.incarnation = []; - if (options.bytes !== Array) - object.incarnation = $util.newBuffer(object.incarnation); - } - object.distance = 0; - object.skip = false; - } - if (message.tabletUid != null && message.hasOwnProperty("tabletUid")) - if (typeof message.tabletUid === "number") - object.tabletUid = options.longs === String ? String(message.tabletUid) : message.tabletUid; - else - object.tabletUid = options.longs === String ? $util.Long.prototype.toString.call(message.tabletUid) : options.longs === Number ? new $util.LongBits(message.tabletUid.low >>> 0, message.tabletUid.high >>> 0).toNumber(true) : message.tabletUid; - if (message.serverAddress != null && message.hasOwnProperty("serverAddress")) - object.serverAddress = message.serverAddress; - if (message.location != null && message.hasOwnProperty("location")) - object.location = message.location; - if (message.role != null && message.hasOwnProperty("role")) - object.role = options.enums === String ? $root.google.spanner.v1.Tablet.Role[message.role] === undefined ? message.role : $root.google.spanner.v1.Tablet.Role[message.role] : message.role; - if (message.incarnation != null && message.hasOwnProperty("incarnation")) - object.incarnation = options.bytes === String ? $util.base64.encode(message.incarnation, 0, message.incarnation.length) : options.bytes === Array ? Array.prototype.slice.call(message.incarnation) : message.incarnation; - if (message.distance != null && message.hasOwnProperty("distance")) - object.distance = message.distance; - if (message.skip != null && message.hasOwnProperty("skip")) - object.skip = message.skip; - return object; - }; - - /** - * Converts this Tablet to JSON. - * @function toJSON - * @memberof google.spanner.v1.Tablet - * @instance - * @returns {Object.} JSON object - */ - Tablet.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Tablet - * @function getTypeUrl - * @memberof google.spanner.v1.Tablet - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Tablet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.Tablet"; - }; - - /** - * Role enum. - * @name google.spanner.v1.Tablet.Role - * @enum {number} - * @property {number} ROLE_UNSPECIFIED=0 ROLE_UNSPECIFIED value - * @property {number} READ_WRITE=1 READ_WRITE value - * @property {number} READ_ONLY=2 READ_ONLY value - */ - Tablet.Role = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ROLE_UNSPECIFIED"] = 0; - values[valuesById[1] = "READ_WRITE"] = 1; - values[valuesById[2] = "READ_ONLY"] = 2; - return values; - })(); - - return Tablet; - })(); - - v1.Group = (function() { - - /** - * Properties of a Group. - * @memberof google.spanner.v1 - * @interface IGroup - * @property {number|Long|null} [groupUid] Group groupUid - * @property {Array.|null} [tablets] Group tablets - * @property {number|null} [leaderIndex] Group leaderIndex - * @property {Uint8Array|null} [generation] Group generation - */ - - /** - * Constructs a new Group. - * @memberof google.spanner.v1 - * @classdesc Represents a Group. - * @implements IGroup - * @constructor - * @param {google.spanner.v1.IGroup=} [properties] Properties to set - */ - function Group(properties) { - this.tablets = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Group groupUid. - * @member {number|Long} groupUid - * @memberof google.spanner.v1.Group - * @instance - */ - Group.prototype.groupUid = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Group tablets. - * @member {Array.} tablets - * @memberof google.spanner.v1.Group - * @instance - */ - Group.prototype.tablets = $util.emptyArray; - - /** - * Group leaderIndex. - * @member {number} leaderIndex - * @memberof google.spanner.v1.Group - * @instance - */ - Group.prototype.leaderIndex = 0; - - /** - * Group generation. - * @member {Uint8Array} generation - * @memberof google.spanner.v1.Group - * @instance - */ - Group.prototype.generation = $util.newBuffer([]); - - /** - * Creates a new Group instance using the specified properties. - * @function create - * @memberof google.spanner.v1.Group - * @static - * @param {google.spanner.v1.IGroup=} [properties] Properties to set - * @returns {google.spanner.v1.Group} Group instance - */ - Group.create = function create(properties) { - return new Group(properties); - }; - - /** - * Encodes the specified Group message. Does not implicitly {@link google.spanner.v1.Group.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.Group - * @static - * @param {google.spanner.v1.IGroup} message Group message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Group.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.groupUid != null && Object.hasOwnProperty.call(message, "groupUid")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.groupUid); - if (message.tablets != null && message.tablets.length) - for (var i = 0; i < message.tablets.length; ++i) - $root.google.spanner.v1.Tablet.encode(message.tablets[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.leaderIndex != null && Object.hasOwnProperty.call(message, "leaderIndex")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.leaderIndex); - if (message.generation != null && Object.hasOwnProperty.call(message, "generation")) - writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.generation); - return writer; - }; - - /** - * Encodes the specified Group message, length delimited. Does not implicitly {@link google.spanner.v1.Group.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.Group - * @static - * @param {google.spanner.v1.IGroup} message Group message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Group.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Group message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.Group - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.Group} Group - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Group.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.Group(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.groupUid = reader.uint64(); - break; - } - case 2: { - if (!(message.tablets && message.tablets.length)) - message.tablets = []; - message.tablets.push($root.google.spanner.v1.Tablet.decode(reader, reader.uint32())); - break; - } - case 3: { - message.leaderIndex = reader.int32(); - break; - } - case 4: { - message.generation = reader.bytes(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Group message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.Group - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.Group} Group - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Group.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Group message. - * @function verify - * @memberof google.spanner.v1.Group - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Group.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.groupUid != null && message.hasOwnProperty("groupUid")) - if (!$util.isInteger(message.groupUid) && !(message.groupUid && $util.isInteger(message.groupUid.low) && $util.isInteger(message.groupUid.high))) - return "groupUid: integer|Long expected"; - if (message.tablets != null && message.hasOwnProperty("tablets")) { - if (!Array.isArray(message.tablets)) - return "tablets: array expected"; - for (var i = 0; i < message.tablets.length; ++i) { - var error = $root.google.spanner.v1.Tablet.verify(message.tablets[i]); - if (error) - return "tablets." + error; - } - } - if (message.leaderIndex != null && message.hasOwnProperty("leaderIndex")) - if (!$util.isInteger(message.leaderIndex)) - return "leaderIndex: integer expected"; - if (message.generation != null && message.hasOwnProperty("generation")) - if (!(message.generation && typeof message.generation.length === "number" || $util.isString(message.generation))) - return "generation: buffer expected"; - return null; - }; - - /** - * Creates a Group message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.Group - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.Group} Group - */ - Group.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.Group) - return object; - var message = new $root.google.spanner.v1.Group(); - if (object.groupUid != null) - if ($util.Long) - (message.groupUid = $util.Long.fromValue(object.groupUid)).unsigned = true; - else if (typeof object.groupUid === "string") - message.groupUid = parseInt(object.groupUid, 10); - else if (typeof object.groupUid === "number") - message.groupUid = object.groupUid; - else if (typeof object.groupUid === "object") - message.groupUid = new $util.LongBits(object.groupUid.low >>> 0, object.groupUid.high >>> 0).toNumber(true); - if (object.tablets) { - if (!Array.isArray(object.tablets)) - throw TypeError(".google.spanner.v1.Group.tablets: array expected"); - message.tablets = []; - for (var i = 0; i < object.tablets.length; ++i) { - if (typeof object.tablets[i] !== "object") - throw TypeError(".google.spanner.v1.Group.tablets: object expected"); - message.tablets[i] = $root.google.spanner.v1.Tablet.fromObject(object.tablets[i]); - } - } - if (object.leaderIndex != null) - message.leaderIndex = object.leaderIndex | 0; - if (object.generation != null) - if (typeof object.generation === "string") - $util.base64.decode(object.generation, message.generation = $util.newBuffer($util.base64.length(object.generation)), 0); - else if (object.generation.length >= 0) - message.generation = object.generation; - return message; - }; - - /** - * Creates a plain object from a Group message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.Group - * @static - * @param {google.spanner.v1.Group} message Group - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Group.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.tablets = []; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.groupUid = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.groupUid = options.longs === String ? "0" : 0; - object.leaderIndex = 0; - if (options.bytes === String) - object.generation = ""; - else { - object.generation = []; - if (options.bytes !== Array) - object.generation = $util.newBuffer(object.generation); - } - } - if (message.groupUid != null && message.hasOwnProperty("groupUid")) - if (typeof message.groupUid === "number") - object.groupUid = options.longs === String ? String(message.groupUid) : message.groupUid; - else - object.groupUid = options.longs === String ? $util.Long.prototype.toString.call(message.groupUid) : options.longs === Number ? new $util.LongBits(message.groupUid.low >>> 0, message.groupUid.high >>> 0).toNumber(true) : message.groupUid; - if (message.tablets && message.tablets.length) { - object.tablets = []; - for (var j = 0; j < message.tablets.length; ++j) - object.tablets[j] = $root.google.spanner.v1.Tablet.toObject(message.tablets[j], options); - } - if (message.leaderIndex != null && message.hasOwnProperty("leaderIndex")) - object.leaderIndex = message.leaderIndex; - if (message.generation != null && message.hasOwnProperty("generation")) - object.generation = options.bytes === String ? $util.base64.encode(message.generation, 0, message.generation.length) : options.bytes === Array ? Array.prototype.slice.call(message.generation) : message.generation; - return object; - }; - - /** - * Converts this Group to JSON. - * @function toJSON - * @memberof google.spanner.v1.Group - * @instance - * @returns {Object.} JSON object - */ - Group.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Group - * @function getTypeUrl - * @memberof google.spanner.v1.Group - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Group.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.Group"; - }; - - return Group; - })(); - - v1.KeyRecipe = (function() { - - /** - * Properties of a KeyRecipe. - * @memberof google.spanner.v1 - * @interface IKeyRecipe - * @property {string|null} [tableName] KeyRecipe tableName - * @property {string|null} [indexName] KeyRecipe indexName - * @property {number|Long|null} [operationUid] KeyRecipe operationUid - * @property {Array.|null} [part] KeyRecipe part - */ - - /** - * Constructs a new KeyRecipe. - * @memberof google.spanner.v1 - * @classdesc Represents a KeyRecipe. - * @implements IKeyRecipe - * @constructor - * @param {google.spanner.v1.IKeyRecipe=} [properties] Properties to set - */ - function KeyRecipe(properties) { - this.part = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * KeyRecipe tableName. - * @member {string|null|undefined} tableName - * @memberof google.spanner.v1.KeyRecipe - * @instance - */ - KeyRecipe.prototype.tableName = null; - - /** - * KeyRecipe indexName. - * @member {string|null|undefined} indexName - * @memberof google.spanner.v1.KeyRecipe - * @instance - */ - KeyRecipe.prototype.indexName = null; - - /** - * KeyRecipe operationUid. - * @member {number|Long|null|undefined} operationUid - * @memberof google.spanner.v1.KeyRecipe - * @instance - */ - KeyRecipe.prototype.operationUid = null; - - /** - * KeyRecipe part. - * @member {Array.} part - * @memberof google.spanner.v1.KeyRecipe - * @instance - */ - KeyRecipe.prototype.part = $util.emptyArray; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * KeyRecipe target. - * @member {"tableName"|"indexName"|"operationUid"|undefined} target - * @memberof google.spanner.v1.KeyRecipe - * @instance - */ - Object.defineProperty(KeyRecipe.prototype, "target", { - get: $util.oneOfGetter($oneOfFields = ["tableName", "indexName", "operationUid"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new KeyRecipe instance using the specified properties. - * @function create - * @memberof google.spanner.v1.KeyRecipe - * @static - * @param {google.spanner.v1.IKeyRecipe=} [properties] Properties to set - * @returns {google.spanner.v1.KeyRecipe} KeyRecipe instance - */ - KeyRecipe.create = function create(properties) { - return new KeyRecipe(properties); - }; - - /** - * Encodes the specified KeyRecipe message. Does not implicitly {@link google.spanner.v1.KeyRecipe.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.KeyRecipe - * @static - * @param {google.spanner.v1.IKeyRecipe} message KeyRecipe message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - KeyRecipe.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tableName != null && Object.hasOwnProperty.call(message, "tableName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.tableName); - if (message.indexName != null && Object.hasOwnProperty.call(message, "indexName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.indexName); - if (message.operationUid != null && Object.hasOwnProperty.call(message, "operationUid")) - writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.operationUid); - if (message.part != null && message.part.length) - for (var i = 0; i < message.part.length; ++i) - $root.google.spanner.v1.KeyRecipe.Part.encode(message.part[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified KeyRecipe message, length delimited. Does not implicitly {@link google.spanner.v1.KeyRecipe.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.KeyRecipe - * @static - * @param {google.spanner.v1.IKeyRecipe} message KeyRecipe message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - KeyRecipe.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a KeyRecipe message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.KeyRecipe - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.KeyRecipe} KeyRecipe - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - KeyRecipe.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.KeyRecipe(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.tableName = reader.string(); - break; - } - case 2: { - message.indexName = reader.string(); - break; - } - case 3: { - message.operationUid = reader.uint64(); - break; - } - case 4: { - if (!(message.part && message.part.length)) - message.part = []; - message.part.push($root.google.spanner.v1.KeyRecipe.Part.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a KeyRecipe message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.KeyRecipe - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.KeyRecipe} KeyRecipe - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - KeyRecipe.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a KeyRecipe message. - * @function verify - * @memberof google.spanner.v1.KeyRecipe - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - KeyRecipe.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.tableName != null && message.hasOwnProperty("tableName")) { - properties.target = 1; - if (!$util.isString(message.tableName)) - return "tableName: string expected"; - } - if (message.indexName != null && message.hasOwnProperty("indexName")) { - if (properties.target === 1) - return "target: multiple values"; - properties.target = 1; - if (!$util.isString(message.indexName)) - return "indexName: string expected"; - } - if (message.operationUid != null && message.hasOwnProperty("operationUid")) { - if (properties.target === 1) - return "target: multiple values"; - properties.target = 1; - if (!$util.isInteger(message.operationUid) && !(message.operationUid && $util.isInteger(message.operationUid.low) && $util.isInteger(message.operationUid.high))) - return "operationUid: integer|Long expected"; - } - if (message.part != null && message.hasOwnProperty("part")) { - if (!Array.isArray(message.part)) - return "part: array expected"; - for (var i = 0; i < message.part.length; ++i) { - var error = $root.google.spanner.v1.KeyRecipe.Part.verify(message.part[i]); - if (error) - return "part." + error; - } - } - return null; - }; - - /** - * Creates a KeyRecipe message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.KeyRecipe - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.KeyRecipe} KeyRecipe - */ - KeyRecipe.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.KeyRecipe) - return object; - var message = new $root.google.spanner.v1.KeyRecipe(); - if (object.tableName != null) - message.tableName = String(object.tableName); - if (object.indexName != null) - message.indexName = String(object.indexName); - if (object.operationUid != null) - if ($util.Long) - (message.operationUid = $util.Long.fromValue(object.operationUid)).unsigned = true; - else if (typeof object.operationUid === "string") - message.operationUid = parseInt(object.operationUid, 10); - else if (typeof object.operationUid === "number") - message.operationUid = object.operationUid; - else if (typeof object.operationUid === "object") - message.operationUid = new $util.LongBits(object.operationUid.low >>> 0, object.operationUid.high >>> 0).toNumber(true); - if (object.part) { - if (!Array.isArray(object.part)) - throw TypeError(".google.spanner.v1.KeyRecipe.part: array expected"); - message.part = []; - for (var i = 0; i < object.part.length; ++i) { - if (typeof object.part[i] !== "object") - throw TypeError(".google.spanner.v1.KeyRecipe.part: object expected"); - message.part[i] = $root.google.spanner.v1.KeyRecipe.Part.fromObject(object.part[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a KeyRecipe message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.KeyRecipe - * @static - * @param {google.spanner.v1.KeyRecipe} message KeyRecipe - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - KeyRecipe.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.part = []; - if (message.tableName != null && message.hasOwnProperty("tableName")) { - object.tableName = message.tableName; - if (options.oneofs) - object.target = "tableName"; - } - if (message.indexName != null && message.hasOwnProperty("indexName")) { - object.indexName = message.indexName; - if (options.oneofs) - object.target = "indexName"; - } - if (message.operationUid != null && message.hasOwnProperty("operationUid")) { - if (typeof message.operationUid === "number") - object.operationUid = options.longs === String ? String(message.operationUid) : message.operationUid; - else - object.operationUid = options.longs === String ? $util.Long.prototype.toString.call(message.operationUid) : options.longs === Number ? new $util.LongBits(message.operationUid.low >>> 0, message.operationUid.high >>> 0).toNumber(true) : message.operationUid; - if (options.oneofs) - object.target = "operationUid"; - } - if (message.part && message.part.length) { - object.part = []; - for (var j = 0; j < message.part.length; ++j) - object.part[j] = $root.google.spanner.v1.KeyRecipe.Part.toObject(message.part[j], options); - } - return object; - }; - - /** - * Converts this KeyRecipe to JSON. - * @function toJSON - * @memberof google.spanner.v1.KeyRecipe - * @instance - * @returns {Object.} JSON object - */ - KeyRecipe.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for KeyRecipe - * @function getTypeUrl - * @memberof google.spanner.v1.KeyRecipe - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - KeyRecipe.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.KeyRecipe"; - }; - - KeyRecipe.Part = (function() { - - /** - * Properties of a Part. - * @memberof google.spanner.v1.KeyRecipe - * @interface IPart - * @property {number|null} [tag] Part tag - * @property {google.spanner.v1.KeyRecipe.Part.Order|null} [order] Part order - * @property {google.spanner.v1.KeyRecipe.Part.NullOrder|null} [nullOrder] Part nullOrder - * @property {google.spanner.v1.IType|null} [type] Part type - * @property {string|null} [identifier] Part identifier - * @property {google.protobuf.IValue|null} [value] Part value - * @property {boolean|null} [random] Part random - * @property {Array.|null} [structIdentifiers] Part structIdentifiers - */ - - /** - * Constructs a new Part. - * @memberof google.spanner.v1.KeyRecipe - * @classdesc Represents a Part. - * @implements IPart - * @constructor - * @param {google.spanner.v1.KeyRecipe.IPart=} [properties] Properties to set - */ - function Part(properties) { - this.structIdentifiers = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Part tag. - * @member {number} tag - * @memberof google.spanner.v1.KeyRecipe.Part - * @instance - */ - Part.prototype.tag = 0; - - /** - * Part order. - * @member {google.spanner.v1.KeyRecipe.Part.Order} order - * @memberof google.spanner.v1.KeyRecipe.Part - * @instance - */ - Part.prototype.order = 0; - - /** - * Part nullOrder. - * @member {google.spanner.v1.KeyRecipe.Part.NullOrder} nullOrder - * @memberof google.spanner.v1.KeyRecipe.Part - * @instance - */ - Part.prototype.nullOrder = 0; - - /** - * Part type. - * @member {google.spanner.v1.IType|null|undefined} type - * @memberof google.spanner.v1.KeyRecipe.Part - * @instance - */ - Part.prototype.type = null; - - /** - * Part identifier. - * @member {string|null|undefined} identifier - * @memberof google.spanner.v1.KeyRecipe.Part - * @instance - */ - Part.prototype.identifier = null; - - /** - * Part value. - * @member {google.protobuf.IValue|null|undefined} value - * @memberof google.spanner.v1.KeyRecipe.Part - * @instance - */ - Part.prototype.value = null; - - /** - * Part random. - * @member {boolean|null|undefined} random - * @memberof google.spanner.v1.KeyRecipe.Part - * @instance - */ - Part.prototype.random = null; - - /** - * Part structIdentifiers. - * @member {Array.} structIdentifiers - * @memberof google.spanner.v1.KeyRecipe.Part - * @instance - */ - Part.prototype.structIdentifiers = $util.emptyArray; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Part valueType. - * @member {"identifier"|"value"|"random"|undefined} valueType - * @memberof google.spanner.v1.KeyRecipe.Part - * @instance - */ - Object.defineProperty(Part.prototype, "valueType", { - get: $util.oneOfGetter($oneOfFields = ["identifier", "value", "random"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Part instance using the specified properties. - * @function create - * @memberof google.spanner.v1.KeyRecipe.Part - * @static - * @param {google.spanner.v1.KeyRecipe.IPart=} [properties] Properties to set - * @returns {google.spanner.v1.KeyRecipe.Part} Part instance - */ - Part.create = function create(properties) { - return new Part(properties); - }; - - /** - * Encodes the specified Part message. Does not implicitly {@link google.spanner.v1.KeyRecipe.Part.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.KeyRecipe.Part - * @static - * @param {google.spanner.v1.KeyRecipe.IPart} message Part message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Part.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tag != null && Object.hasOwnProperty.call(message, "tag")) - writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.tag); - if (message.order != null && Object.hasOwnProperty.call(message, "order")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.order); - if (message.nullOrder != null && Object.hasOwnProperty.call(message, "nullOrder")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.nullOrder); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - $root.google.spanner.v1.Type.encode(message.type, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.identifier != null && Object.hasOwnProperty.call(message, "identifier")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.identifier); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - $root.google.protobuf.Value.encode(message.value, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.structIdentifiers != null && message.structIdentifiers.length) { - writer.uint32(/* id 7, wireType 2 =*/58).fork(); - for (var i = 0; i < message.structIdentifiers.length; ++i) - writer.int32(message.structIdentifiers[i]); - writer.ldelim(); - } - if (message.random != null && Object.hasOwnProperty.call(message, "random")) - writer.uint32(/* id 8, wireType 0 =*/64).bool(message.random); - return writer; - }; - - /** - * Encodes the specified Part message, length delimited. Does not implicitly {@link google.spanner.v1.KeyRecipe.Part.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.KeyRecipe.Part - * @static - * @param {google.spanner.v1.KeyRecipe.IPart} message Part message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Part.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Part message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.KeyRecipe.Part - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.KeyRecipe.Part} Part - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Part.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.KeyRecipe.Part(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.tag = reader.uint32(); - break; - } - case 2: { - message.order = reader.int32(); - break; - } - case 3: { - message.nullOrder = reader.int32(); - break; - } - case 4: { - message.type = $root.google.spanner.v1.Type.decode(reader, reader.uint32()); - break; - } - case 5: { - message.identifier = reader.string(); - break; - } - case 6: { - message.value = $root.google.protobuf.Value.decode(reader, reader.uint32()); - break; - } - case 8: { - message.random = reader.bool(); - break; - } - case 7: { - if (!(message.structIdentifiers && message.structIdentifiers.length)) - message.structIdentifiers = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.structIdentifiers.push(reader.int32()); - } else - message.structIdentifiers.push(reader.int32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Part message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.KeyRecipe.Part - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.KeyRecipe.Part} Part - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Part.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Part message. - * @function verify - * @memberof google.spanner.v1.KeyRecipe.Part - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Part.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.tag != null && message.hasOwnProperty("tag")) - if (!$util.isInteger(message.tag)) - return "tag: integer expected"; - if (message.order != null && message.hasOwnProperty("order")) - switch (message.order) { - default: - return "order: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.nullOrder != null && message.hasOwnProperty("nullOrder")) - switch (message.nullOrder) { - default: - return "nullOrder: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.type != null && message.hasOwnProperty("type")) { - var error = $root.google.spanner.v1.Type.verify(message.type); - if (error) - return "type." + error; - } - if (message.identifier != null && message.hasOwnProperty("identifier")) { - properties.valueType = 1; - if (!$util.isString(message.identifier)) - return "identifier: string expected"; - } - if (message.value != null && message.hasOwnProperty("value")) { - if (properties.valueType === 1) - return "valueType: multiple values"; - properties.valueType = 1; - { - var error = $root.google.protobuf.Value.verify(message.value); - if (error) - return "value." + error; - } - } - if (message.random != null && message.hasOwnProperty("random")) { - if (properties.valueType === 1) - return "valueType: multiple values"; - properties.valueType = 1; - if (typeof message.random !== "boolean") - return "random: boolean expected"; - } - if (message.structIdentifiers != null && message.hasOwnProperty("structIdentifiers")) { - if (!Array.isArray(message.structIdentifiers)) - return "structIdentifiers: array expected"; - for (var i = 0; i < message.structIdentifiers.length; ++i) - if (!$util.isInteger(message.structIdentifiers[i])) - return "structIdentifiers: integer[] expected"; - } - return null; - }; - - /** - * Creates a Part message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.KeyRecipe.Part - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.KeyRecipe.Part} Part - */ - Part.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.KeyRecipe.Part) - return object; - var message = new $root.google.spanner.v1.KeyRecipe.Part(); - if (object.tag != null) - message.tag = object.tag >>> 0; - switch (object.order) { - default: - if (typeof object.order === "number") { - message.order = object.order; - break; - } - break; - case "ORDER_UNSPECIFIED": - case 0: - message.order = 0; - break; - case "ASCENDING": - case 1: - message.order = 1; - break; - case "DESCENDING": - case 2: - message.order = 2; - break; - } - switch (object.nullOrder) { - default: - if (typeof object.nullOrder === "number") { - message.nullOrder = object.nullOrder; - break; - } - break; - case "NULL_ORDER_UNSPECIFIED": - case 0: - message.nullOrder = 0; - break; - case "NULLS_FIRST": - case 1: - message.nullOrder = 1; - break; - case "NULLS_LAST": - case 2: - message.nullOrder = 2; - break; - case "NOT_NULL": - case 3: - message.nullOrder = 3; - break; - } - if (object.type != null) { - if (typeof object.type !== "object") - throw TypeError(".google.spanner.v1.KeyRecipe.Part.type: object expected"); - message.type = $root.google.spanner.v1.Type.fromObject(object.type); - } - if (object.identifier != null) - message.identifier = String(object.identifier); - if (object.value != null) { - if (typeof object.value !== "object") - throw TypeError(".google.spanner.v1.KeyRecipe.Part.value: object expected"); - message.value = $root.google.protobuf.Value.fromObject(object.value); - } - if (object.random != null) - message.random = Boolean(object.random); - if (object.structIdentifiers) { - if (!Array.isArray(object.structIdentifiers)) - throw TypeError(".google.spanner.v1.KeyRecipe.Part.structIdentifiers: array expected"); - message.structIdentifiers = []; - for (var i = 0; i < object.structIdentifiers.length; ++i) - message.structIdentifiers[i] = object.structIdentifiers[i] | 0; - } - return message; - }; - - /** - * Creates a plain object from a Part message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.KeyRecipe.Part - * @static - * @param {google.spanner.v1.KeyRecipe.Part} message Part - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Part.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.structIdentifiers = []; - if (options.defaults) { - object.tag = 0; - object.order = options.enums === String ? "ORDER_UNSPECIFIED" : 0; - object.nullOrder = options.enums === String ? "NULL_ORDER_UNSPECIFIED" : 0; - object.type = null; - } - if (message.tag != null && message.hasOwnProperty("tag")) - object.tag = message.tag; - if (message.order != null && message.hasOwnProperty("order")) - object.order = options.enums === String ? $root.google.spanner.v1.KeyRecipe.Part.Order[message.order] === undefined ? message.order : $root.google.spanner.v1.KeyRecipe.Part.Order[message.order] : message.order; - if (message.nullOrder != null && message.hasOwnProperty("nullOrder")) - object.nullOrder = options.enums === String ? $root.google.spanner.v1.KeyRecipe.Part.NullOrder[message.nullOrder] === undefined ? message.nullOrder : $root.google.spanner.v1.KeyRecipe.Part.NullOrder[message.nullOrder] : message.nullOrder; - if (message.type != null && message.hasOwnProperty("type")) - object.type = $root.google.spanner.v1.Type.toObject(message.type, options); - if (message.identifier != null && message.hasOwnProperty("identifier")) { - object.identifier = message.identifier; - if (options.oneofs) - object.valueType = "identifier"; - } - if (message.value != null && message.hasOwnProperty("value")) { - object.value = $root.google.protobuf.Value.toObject(message.value, options); - if (options.oneofs) - object.valueType = "value"; - } - if (message.structIdentifiers && message.structIdentifiers.length) { - object.structIdentifiers = []; - for (var j = 0; j < message.structIdentifiers.length; ++j) - object.structIdentifiers[j] = message.structIdentifiers[j]; - } - if (message.random != null && message.hasOwnProperty("random")) { - object.random = message.random; - if (options.oneofs) - object.valueType = "random"; - } - return object; - }; - - /** - * Converts this Part to JSON. - * @function toJSON - * @memberof google.spanner.v1.KeyRecipe.Part - * @instance - * @returns {Object.} JSON object - */ - Part.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Part - * @function getTypeUrl - * @memberof google.spanner.v1.KeyRecipe.Part - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Part.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.KeyRecipe.Part"; - }; - - /** - * Order enum. - * @name google.spanner.v1.KeyRecipe.Part.Order - * @enum {number} - * @property {number} ORDER_UNSPECIFIED=0 ORDER_UNSPECIFIED value - * @property {number} ASCENDING=1 ASCENDING value - * @property {number} DESCENDING=2 DESCENDING value - */ - Part.Order = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ORDER_UNSPECIFIED"] = 0; - values[valuesById[1] = "ASCENDING"] = 1; - values[valuesById[2] = "DESCENDING"] = 2; - return values; - })(); - - /** - * NullOrder enum. - * @name google.spanner.v1.KeyRecipe.Part.NullOrder - * @enum {number} - * @property {number} NULL_ORDER_UNSPECIFIED=0 NULL_ORDER_UNSPECIFIED value - * @property {number} NULLS_FIRST=1 NULLS_FIRST value - * @property {number} NULLS_LAST=2 NULLS_LAST value - * @property {number} NOT_NULL=3 NOT_NULL value - */ - Part.NullOrder = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "NULL_ORDER_UNSPECIFIED"] = 0; - values[valuesById[1] = "NULLS_FIRST"] = 1; - values[valuesById[2] = "NULLS_LAST"] = 2; - values[valuesById[3] = "NOT_NULL"] = 3; - return values; - })(); - - return Part; - })(); - - return KeyRecipe; - })(); - - v1.RecipeList = (function() { - - /** - * Properties of a RecipeList. - * @memberof google.spanner.v1 - * @interface IRecipeList - * @property {Uint8Array|null} [schemaGeneration] RecipeList schemaGeneration - * @property {Array.|null} [recipe] RecipeList recipe - */ - - /** - * Constructs a new RecipeList. - * @memberof google.spanner.v1 - * @classdesc Represents a RecipeList. - * @implements IRecipeList - * @constructor - * @param {google.spanner.v1.IRecipeList=} [properties] Properties to set - */ - function RecipeList(properties) { - this.recipe = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RecipeList schemaGeneration. - * @member {Uint8Array} schemaGeneration - * @memberof google.spanner.v1.RecipeList - * @instance - */ - RecipeList.prototype.schemaGeneration = $util.newBuffer([]); - - /** - * RecipeList recipe. - * @member {Array.} recipe - * @memberof google.spanner.v1.RecipeList - * @instance - */ - RecipeList.prototype.recipe = $util.emptyArray; - - /** - * Creates a new RecipeList instance using the specified properties. - * @function create - * @memberof google.spanner.v1.RecipeList - * @static - * @param {google.spanner.v1.IRecipeList=} [properties] Properties to set - * @returns {google.spanner.v1.RecipeList} RecipeList instance - */ - RecipeList.create = function create(properties) { - return new RecipeList(properties); - }; - - /** - * Encodes the specified RecipeList message. Does not implicitly {@link google.spanner.v1.RecipeList.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.RecipeList - * @static - * @param {google.spanner.v1.IRecipeList} message RecipeList message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RecipeList.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.schemaGeneration != null && Object.hasOwnProperty.call(message, "schemaGeneration")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.schemaGeneration); - if (message.recipe != null && message.recipe.length) - for (var i = 0; i < message.recipe.length; ++i) - $root.google.spanner.v1.KeyRecipe.encode(message.recipe[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified RecipeList message, length delimited. Does not implicitly {@link google.spanner.v1.RecipeList.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.RecipeList - * @static - * @param {google.spanner.v1.IRecipeList} message RecipeList message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RecipeList.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RecipeList message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.RecipeList - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.RecipeList} RecipeList - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RecipeList.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.RecipeList(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.schemaGeneration = reader.bytes(); - break; - } - case 3: { - if (!(message.recipe && message.recipe.length)) - message.recipe = []; - message.recipe.push($root.google.spanner.v1.KeyRecipe.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RecipeList message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.RecipeList - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.RecipeList} RecipeList - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RecipeList.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RecipeList message. - * @function verify - * @memberof google.spanner.v1.RecipeList - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RecipeList.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.schemaGeneration != null && message.hasOwnProperty("schemaGeneration")) - if (!(message.schemaGeneration && typeof message.schemaGeneration.length === "number" || $util.isString(message.schemaGeneration))) - return "schemaGeneration: buffer expected"; - if (message.recipe != null && message.hasOwnProperty("recipe")) { - if (!Array.isArray(message.recipe)) - return "recipe: array expected"; - for (var i = 0; i < message.recipe.length; ++i) { - var error = $root.google.spanner.v1.KeyRecipe.verify(message.recipe[i]); - if (error) - return "recipe." + error; - } - } - return null; - }; - - /** - * Creates a RecipeList message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.RecipeList - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.RecipeList} RecipeList - */ - RecipeList.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.RecipeList) - return object; - var message = new $root.google.spanner.v1.RecipeList(); - if (object.schemaGeneration != null) - if (typeof object.schemaGeneration === "string") - $util.base64.decode(object.schemaGeneration, message.schemaGeneration = $util.newBuffer($util.base64.length(object.schemaGeneration)), 0); - else if (object.schemaGeneration.length >= 0) - message.schemaGeneration = object.schemaGeneration; - if (object.recipe) { - if (!Array.isArray(object.recipe)) - throw TypeError(".google.spanner.v1.RecipeList.recipe: array expected"); - message.recipe = []; - for (var i = 0; i < object.recipe.length; ++i) { - if (typeof object.recipe[i] !== "object") - throw TypeError(".google.spanner.v1.RecipeList.recipe: object expected"); - message.recipe[i] = $root.google.spanner.v1.KeyRecipe.fromObject(object.recipe[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a RecipeList message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.RecipeList - * @static - * @param {google.spanner.v1.RecipeList} message RecipeList - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RecipeList.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.recipe = []; - if (options.defaults) - if (options.bytes === String) - object.schemaGeneration = ""; - else { - object.schemaGeneration = []; - if (options.bytes !== Array) - object.schemaGeneration = $util.newBuffer(object.schemaGeneration); - } - if (message.schemaGeneration != null && message.hasOwnProperty("schemaGeneration")) - object.schemaGeneration = options.bytes === String ? $util.base64.encode(message.schemaGeneration, 0, message.schemaGeneration.length) : options.bytes === Array ? Array.prototype.slice.call(message.schemaGeneration) : message.schemaGeneration; - if (message.recipe && message.recipe.length) { - object.recipe = []; - for (var j = 0; j < message.recipe.length; ++j) - object.recipe[j] = $root.google.spanner.v1.KeyRecipe.toObject(message.recipe[j], options); - } - return object; - }; - - /** - * Converts this RecipeList to JSON. - * @function toJSON - * @memberof google.spanner.v1.RecipeList - * @instance - * @returns {Object.} JSON object - */ - RecipeList.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RecipeList - * @function getTypeUrl - * @memberof google.spanner.v1.RecipeList - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RecipeList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.RecipeList"; - }; - - return RecipeList; - })(); - - v1.CacheUpdate = (function() { - - /** - * Properties of a CacheUpdate. - * @memberof google.spanner.v1 - * @interface ICacheUpdate - * @property {number|Long|null} [databaseId] CacheUpdate databaseId - * @property {Array.|null} [range] CacheUpdate range - * @property {Array.|null} [group] CacheUpdate group - * @property {google.spanner.v1.IRecipeList|null} [keyRecipes] CacheUpdate keyRecipes - */ - - /** - * Constructs a new CacheUpdate. - * @memberof google.spanner.v1 - * @classdesc Represents a CacheUpdate. - * @implements ICacheUpdate - * @constructor - * @param {google.spanner.v1.ICacheUpdate=} [properties] Properties to set - */ - function CacheUpdate(properties) { - this.range = []; - this.group = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CacheUpdate databaseId. - * @member {number|Long} databaseId - * @memberof google.spanner.v1.CacheUpdate - * @instance - */ - CacheUpdate.prototype.databaseId = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * CacheUpdate range. - * @member {Array.} range - * @memberof google.spanner.v1.CacheUpdate - * @instance - */ - CacheUpdate.prototype.range = $util.emptyArray; - - /** - * CacheUpdate group. - * @member {Array.} group - * @memberof google.spanner.v1.CacheUpdate - * @instance - */ - CacheUpdate.prototype.group = $util.emptyArray; - - /** - * CacheUpdate keyRecipes. - * @member {google.spanner.v1.IRecipeList|null|undefined} keyRecipes - * @memberof google.spanner.v1.CacheUpdate - * @instance - */ - CacheUpdate.prototype.keyRecipes = null; - - /** - * Creates a new CacheUpdate instance using the specified properties. - * @function create - * @memberof google.spanner.v1.CacheUpdate - * @static - * @param {google.spanner.v1.ICacheUpdate=} [properties] Properties to set - * @returns {google.spanner.v1.CacheUpdate} CacheUpdate instance - */ - CacheUpdate.create = function create(properties) { - return new CacheUpdate(properties); - }; - - /** - * Encodes the specified CacheUpdate message. Does not implicitly {@link google.spanner.v1.CacheUpdate.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.CacheUpdate - * @static - * @param {google.spanner.v1.ICacheUpdate} message CacheUpdate message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CacheUpdate.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.databaseId != null && Object.hasOwnProperty.call(message, "databaseId")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.databaseId); - if (message.range != null && message.range.length) - for (var i = 0; i < message.range.length; ++i) - $root.google.spanner.v1.Range.encode(message.range[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.group != null && message.group.length) - for (var i = 0; i < message.group.length; ++i) - $root.google.spanner.v1.Group.encode(message.group[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.keyRecipes != null && Object.hasOwnProperty.call(message, "keyRecipes")) - $root.google.spanner.v1.RecipeList.encode(message.keyRecipes, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CacheUpdate message, length delimited. Does not implicitly {@link google.spanner.v1.CacheUpdate.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.CacheUpdate - * @static - * @param {google.spanner.v1.ICacheUpdate} message CacheUpdate message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CacheUpdate.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CacheUpdate message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.CacheUpdate - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.CacheUpdate} CacheUpdate - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CacheUpdate.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.CacheUpdate(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.databaseId = reader.uint64(); - break; - } - case 2: { - if (!(message.range && message.range.length)) - message.range = []; - message.range.push($root.google.spanner.v1.Range.decode(reader, reader.uint32())); - break; - } - case 3: { - if (!(message.group && message.group.length)) - message.group = []; - message.group.push($root.google.spanner.v1.Group.decode(reader, reader.uint32())); - break; - } - case 5: { - message.keyRecipes = $root.google.spanner.v1.RecipeList.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CacheUpdate message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.CacheUpdate - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.CacheUpdate} CacheUpdate - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CacheUpdate.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CacheUpdate message. - * @function verify - * @memberof google.spanner.v1.CacheUpdate - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CacheUpdate.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.databaseId != null && message.hasOwnProperty("databaseId")) - if (!$util.isInteger(message.databaseId) && !(message.databaseId && $util.isInteger(message.databaseId.low) && $util.isInteger(message.databaseId.high))) - return "databaseId: integer|Long expected"; - if (message.range != null && message.hasOwnProperty("range")) { - if (!Array.isArray(message.range)) - return "range: array expected"; - for (var i = 0; i < message.range.length; ++i) { - var error = $root.google.spanner.v1.Range.verify(message.range[i]); - if (error) - return "range." + error; - } - } - if (message.group != null && message.hasOwnProperty("group")) { - if (!Array.isArray(message.group)) - return "group: array expected"; - for (var i = 0; i < message.group.length; ++i) { - var error = $root.google.spanner.v1.Group.verify(message.group[i]); - if (error) - return "group." + error; - } - } - if (message.keyRecipes != null && message.hasOwnProperty("keyRecipes")) { - var error = $root.google.spanner.v1.RecipeList.verify(message.keyRecipes); - if (error) - return "keyRecipes." + error; - } - return null; - }; - - /** - * Creates a CacheUpdate message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.CacheUpdate - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.CacheUpdate} CacheUpdate - */ - CacheUpdate.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.CacheUpdate) - return object; - var message = new $root.google.spanner.v1.CacheUpdate(); - if (object.databaseId != null) - if ($util.Long) - (message.databaseId = $util.Long.fromValue(object.databaseId)).unsigned = true; - else if (typeof object.databaseId === "string") - message.databaseId = parseInt(object.databaseId, 10); - else if (typeof object.databaseId === "number") - message.databaseId = object.databaseId; - else if (typeof object.databaseId === "object") - message.databaseId = new $util.LongBits(object.databaseId.low >>> 0, object.databaseId.high >>> 0).toNumber(true); - if (object.range) { - if (!Array.isArray(object.range)) - throw TypeError(".google.spanner.v1.CacheUpdate.range: array expected"); - message.range = []; - for (var i = 0; i < object.range.length; ++i) { - if (typeof object.range[i] !== "object") - throw TypeError(".google.spanner.v1.CacheUpdate.range: object expected"); - message.range[i] = $root.google.spanner.v1.Range.fromObject(object.range[i]); - } - } - if (object.group) { - if (!Array.isArray(object.group)) - throw TypeError(".google.spanner.v1.CacheUpdate.group: array expected"); - message.group = []; - for (var i = 0; i < object.group.length; ++i) { - if (typeof object.group[i] !== "object") - throw TypeError(".google.spanner.v1.CacheUpdate.group: object expected"); - message.group[i] = $root.google.spanner.v1.Group.fromObject(object.group[i]); - } - } - if (object.keyRecipes != null) { - if (typeof object.keyRecipes !== "object") - throw TypeError(".google.spanner.v1.CacheUpdate.keyRecipes: object expected"); - message.keyRecipes = $root.google.spanner.v1.RecipeList.fromObject(object.keyRecipes); - } - return message; - }; - - /** - * Creates a plain object from a CacheUpdate message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.CacheUpdate - * @static - * @param {google.spanner.v1.CacheUpdate} message CacheUpdate - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CacheUpdate.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.range = []; - object.group = []; - } - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.databaseId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.databaseId = options.longs === String ? "0" : 0; - object.keyRecipes = null; - } - if (message.databaseId != null && message.hasOwnProperty("databaseId")) - if (typeof message.databaseId === "number") - object.databaseId = options.longs === String ? String(message.databaseId) : message.databaseId; - else - object.databaseId = options.longs === String ? $util.Long.prototype.toString.call(message.databaseId) : options.longs === Number ? new $util.LongBits(message.databaseId.low >>> 0, message.databaseId.high >>> 0).toNumber(true) : message.databaseId; - if (message.range && message.range.length) { - object.range = []; - for (var j = 0; j < message.range.length; ++j) - object.range[j] = $root.google.spanner.v1.Range.toObject(message.range[j], options); - } - if (message.group && message.group.length) { - object.group = []; - for (var j = 0; j < message.group.length; ++j) - object.group[j] = $root.google.spanner.v1.Group.toObject(message.group[j], options); - } - if (message.keyRecipes != null && message.hasOwnProperty("keyRecipes")) - object.keyRecipes = $root.google.spanner.v1.RecipeList.toObject(message.keyRecipes, options); - return object; - }; - - /** - * Converts this CacheUpdate to JSON. - * @function toJSON - * @memberof google.spanner.v1.CacheUpdate - * @instance - * @returns {Object.} JSON object - */ - CacheUpdate.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CacheUpdate - * @function getTypeUrl - * @memberof google.spanner.v1.CacheUpdate - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CacheUpdate.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.CacheUpdate"; - }; - - return CacheUpdate; - })(); - - v1.RoutingHint = (function() { - - /** - * Properties of a RoutingHint. - * @memberof google.spanner.v1 - * @interface IRoutingHint - * @property {number|Long|null} [operationUid] RoutingHint operationUid - * @property {number|Long|null} [databaseId] RoutingHint databaseId - * @property {Uint8Array|null} [schemaGeneration] RoutingHint schemaGeneration - * @property {Uint8Array|null} [key] RoutingHint key - * @property {Uint8Array|null} [limitKey] RoutingHint limitKey - * @property {number|Long|null} [groupUid] RoutingHint groupUid - * @property {number|Long|null} [splitId] RoutingHint splitId - * @property {number|Long|null} [tabletUid] RoutingHint tabletUid - * @property {Array.|null} [skippedTabletUid] RoutingHint skippedTabletUid - * @property {string|null} [clientLocation] RoutingHint clientLocation - */ - - /** - * Constructs a new RoutingHint. - * @memberof google.spanner.v1 - * @classdesc Represents a RoutingHint. - * @implements IRoutingHint - * @constructor - * @param {google.spanner.v1.IRoutingHint=} [properties] Properties to set - */ - function RoutingHint(properties) { - this.skippedTabletUid = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RoutingHint operationUid. - * @member {number|Long} operationUid - * @memberof google.spanner.v1.RoutingHint - * @instance - */ - RoutingHint.prototype.operationUid = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * RoutingHint databaseId. - * @member {number|Long} databaseId - * @memberof google.spanner.v1.RoutingHint - * @instance - */ - RoutingHint.prototype.databaseId = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * RoutingHint schemaGeneration. - * @member {Uint8Array} schemaGeneration - * @memberof google.spanner.v1.RoutingHint - * @instance - */ - RoutingHint.prototype.schemaGeneration = $util.newBuffer([]); - - /** - * RoutingHint key. - * @member {Uint8Array} key - * @memberof google.spanner.v1.RoutingHint - * @instance - */ - RoutingHint.prototype.key = $util.newBuffer([]); - - /** - * RoutingHint limitKey. - * @member {Uint8Array} limitKey - * @memberof google.spanner.v1.RoutingHint - * @instance - */ - RoutingHint.prototype.limitKey = $util.newBuffer([]); - - /** - * RoutingHint groupUid. - * @member {number|Long} groupUid - * @memberof google.spanner.v1.RoutingHint - * @instance - */ - RoutingHint.prototype.groupUid = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * RoutingHint splitId. - * @member {number|Long} splitId - * @memberof google.spanner.v1.RoutingHint - * @instance - */ - RoutingHint.prototype.splitId = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * RoutingHint tabletUid. - * @member {number|Long} tabletUid - * @memberof google.spanner.v1.RoutingHint - * @instance - */ - RoutingHint.prototype.tabletUid = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * RoutingHint skippedTabletUid. - * @member {Array.} skippedTabletUid - * @memberof google.spanner.v1.RoutingHint - * @instance - */ - RoutingHint.prototype.skippedTabletUid = $util.emptyArray; - - /** - * RoutingHint clientLocation. - * @member {string} clientLocation - * @memberof google.spanner.v1.RoutingHint - * @instance - */ - RoutingHint.prototype.clientLocation = ""; - - /** - * Creates a new RoutingHint instance using the specified properties. - * @function create - * @memberof google.spanner.v1.RoutingHint - * @static - * @param {google.spanner.v1.IRoutingHint=} [properties] Properties to set - * @returns {google.spanner.v1.RoutingHint} RoutingHint instance - */ - RoutingHint.create = function create(properties) { - return new RoutingHint(properties); - }; - - /** - * Encodes the specified RoutingHint message. Does not implicitly {@link google.spanner.v1.RoutingHint.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.RoutingHint - * @static - * @param {google.spanner.v1.IRoutingHint} message RoutingHint message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RoutingHint.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.operationUid != null && Object.hasOwnProperty.call(message, "operationUid")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.operationUid); - if (message.databaseId != null && Object.hasOwnProperty.call(message, "databaseId")) - writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.databaseId); - if (message.schemaGeneration != null && Object.hasOwnProperty.call(message, "schemaGeneration")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.schemaGeneration); - if (message.key != null && Object.hasOwnProperty.call(message, "key")) - writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.key); - if (message.limitKey != null && Object.hasOwnProperty.call(message, "limitKey")) - writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.limitKey); - if (message.groupUid != null && Object.hasOwnProperty.call(message, "groupUid")) - writer.uint32(/* id 6, wireType 0 =*/48).uint64(message.groupUid); - if (message.splitId != null && Object.hasOwnProperty.call(message, "splitId")) - writer.uint32(/* id 7, wireType 0 =*/56).uint64(message.splitId); - if (message.tabletUid != null && Object.hasOwnProperty.call(message, "tabletUid")) - writer.uint32(/* id 8, wireType 0 =*/64).uint64(message.tabletUid); - if (message.skippedTabletUid != null && message.skippedTabletUid.length) - for (var i = 0; i < message.skippedTabletUid.length; ++i) - $root.google.spanner.v1.RoutingHint.SkippedTablet.encode(message.skippedTabletUid[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.clientLocation != null && Object.hasOwnProperty.call(message, "clientLocation")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.clientLocation); - return writer; - }; - - /** - * Encodes the specified RoutingHint message, length delimited. Does not implicitly {@link google.spanner.v1.RoutingHint.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.RoutingHint - * @static - * @param {google.spanner.v1.IRoutingHint} message RoutingHint message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RoutingHint.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RoutingHint message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.RoutingHint - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.RoutingHint} RoutingHint - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RoutingHint.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.RoutingHint(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.operationUid = reader.uint64(); - break; - } - case 2: { - message.databaseId = reader.uint64(); - break; - } - case 3: { - message.schemaGeneration = reader.bytes(); - break; - } - case 4: { - message.key = reader.bytes(); - break; - } - case 5: { - message.limitKey = reader.bytes(); - break; - } - case 6: { - message.groupUid = reader.uint64(); - break; - } - case 7: { - message.splitId = reader.uint64(); - break; - } - case 8: { - message.tabletUid = reader.uint64(); - break; - } - case 9: { - if (!(message.skippedTabletUid && message.skippedTabletUid.length)) - message.skippedTabletUid = []; - message.skippedTabletUid.push($root.google.spanner.v1.RoutingHint.SkippedTablet.decode(reader, reader.uint32())); - break; - } - case 10: { - message.clientLocation = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RoutingHint message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.RoutingHint - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.RoutingHint} RoutingHint - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RoutingHint.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RoutingHint message. - * @function verify - * @memberof google.spanner.v1.RoutingHint - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RoutingHint.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.operationUid != null && message.hasOwnProperty("operationUid")) - if (!$util.isInteger(message.operationUid) && !(message.operationUid && $util.isInteger(message.operationUid.low) && $util.isInteger(message.operationUid.high))) - return "operationUid: integer|Long expected"; - if (message.databaseId != null && message.hasOwnProperty("databaseId")) - if (!$util.isInteger(message.databaseId) && !(message.databaseId && $util.isInteger(message.databaseId.low) && $util.isInteger(message.databaseId.high))) - return "databaseId: integer|Long expected"; - if (message.schemaGeneration != null && message.hasOwnProperty("schemaGeneration")) - if (!(message.schemaGeneration && typeof message.schemaGeneration.length === "number" || $util.isString(message.schemaGeneration))) - return "schemaGeneration: buffer expected"; - if (message.key != null && message.hasOwnProperty("key")) - if (!(message.key && typeof message.key.length === "number" || $util.isString(message.key))) - return "key: buffer expected"; - if (message.limitKey != null && message.hasOwnProperty("limitKey")) - if (!(message.limitKey && typeof message.limitKey.length === "number" || $util.isString(message.limitKey))) - return "limitKey: buffer expected"; - if (message.groupUid != null && message.hasOwnProperty("groupUid")) - if (!$util.isInteger(message.groupUid) && !(message.groupUid && $util.isInteger(message.groupUid.low) && $util.isInteger(message.groupUid.high))) - return "groupUid: integer|Long expected"; - if (message.splitId != null && message.hasOwnProperty("splitId")) - if (!$util.isInteger(message.splitId) && !(message.splitId && $util.isInteger(message.splitId.low) && $util.isInteger(message.splitId.high))) - return "splitId: integer|Long expected"; - if (message.tabletUid != null && message.hasOwnProperty("tabletUid")) - if (!$util.isInteger(message.tabletUid) && !(message.tabletUid && $util.isInteger(message.tabletUid.low) && $util.isInteger(message.tabletUid.high))) - return "tabletUid: integer|Long expected"; - if (message.skippedTabletUid != null && message.hasOwnProperty("skippedTabletUid")) { - if (!Array.isArray(message.skippedTabletUid)) - return "skippedTabletUid: array expected"; - for (var i = 0; i < message.skippedTabletUid.length; ++i) { - var error = $root.google.spanner.v1.RoutingHint.SkippedTablet.verify(message.skippedTabletUid[i]); - if (error) - return "skippedTabletUid." + error; - } - } - if (message.clientLocation != null && message.hasOwnProperty("clientLocation")) - if (!$util.isString(message.clientLocation)) - return "clientLocation: string expected"; - return null; - }; - - /** - * Creates a RoutingHint message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.RoutingHint - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.RoutingHint} RoutingHint - */ - RoutingHint.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.RoutingHint) - return object; - var message = new $root.google.spanner.v1.RoutingHint(); - if (object.operationUid != null) - if ($util.Long) - (message.operationUid = $util.Long.fromValue(object.operationUid)).unsigned = true; - else if (typeof object.operationUid === "string") - message.operationUid = parseInt(object.operationUid, 10); - else if (typeof object.operationUid === "number") - message.operationUid = object.operationUid; - else if (typeof object.operationUid === "object") - message.operationUid = new $util.LongBits(object.operationUid.low >>> 0, object.operationUid.high >>> 0).toNumber(true); - if (object.databaseId != null) - if ($util.Long) - (message.databaseId = $util.Long.fromValue(object.databaseId)).unsigned = true; - else if (typeof object.databaseId === "string") - message.databaseId = parseInt(object.databaseId, 10); - else if (typeof object.databaseId === "number") - message.databaseId = object.databaseId; - else if (typeof object.databaseId === "object") - message.databaseId = new $util.LongBits(object.databaseId.low >>> 0, object.databaseId.high >>> 0).toNumber(true); - if (object.schemaGeneration != null) - if (typeof object.schemaGeneration === "string") - $util.base64.decode(object.schemaGeneration, message.schemaGeneration = $util.newBuffer($util.base64.length(object.schemaGeneration)), 0); - else if (object.schemaGeneration.length >= 0) - message.schemaGeneration = object.schemaGeneration; - if (object.key != null) - if (typeof object.key === "string") - $util.base64.decode(object.key, message.key = $util.newBuffer($util.base64.length(object.key)), 0); - else if (object.key.length >= 0) - message.key = object.key; - if (object.limitKey != null) - if (typeof object.limitKey === "string") - $util.base64.decode(object.limitKey, message.limitKey = $util.newBuffer($util.base64.length(object.limitKey)), 0); - else if (object.limitKey.length >= 0) - message.limitKey = object.limitKey; - if (object.groupUid != null) - if ($util.Long) - (message.groupUid = $util.Long.fromValue(object.groupUid)).unsigned = true; - else if (typeof object.groupUid === "string") - message.groupUid = parseInt(object.groupUid, 10); - else if (typeof object.groupUid === "number") - message.groupUid = object.groupUid; - else if (typeof object.groupUid === "object") - message.groupUid = new $util.LongBits(object.groupUid.low >>> 0, object.groupUid.high >>> 0).toNumber(true); - if (object.splitId != null) - if ($util.Long) - (message.splitId = $util.Long.fromValue(object.splitId)).unsigned = true; - else if (typeof object.splitId === "string") - message.splitId = parseInt(object.splitId, 10); - else if (typeof object.splitId === "number") - message.splitId = object.splitId; - else if (typeof object.splitId === "object") - message.splitId = new $util.LongBits(object.splitId.low >>> 0, object.splitId.high >>> 0).toNumber(true); - if (object.tabletUid != null) - if ($util.Long) - (message.tabletUid = $util.Long.fromValue(object.tabletUid)).unsigned = true; - else if (typeof object.tabletUid === "string") - message.tabletUid = parseInt(object.tabletUid, 10); - else if (typeof object.tabletUid === "number") - message.tabletUid = object.tabletUid; - else if (typeof object.tabletUid === "object") - message.tabletUid = new $util.LongBits(object.tabletUid.low >>> 0, object.tabletUid.high >>> 0).toNumber(true); - if (object.skippedTabletUid) { - if (!Array.isArray(object.skippedTabletUid)) - throw TypeError(".google.spanner.v1.RoutingHint.skippedTabletUid: array expected"); - message.skippedTabletUid = []; - for (var i = 0; i < object.skippedTabletUid.length; ++i) { - if (typeof object.skippedTabletUid[i] !== "object") - throw TypeError(".google.spanner.v1.RoutingHint.skippedTabletUid: object expected"); - message.skippedTabletUid[i] = $root.google.spanner.v1.RoutingHint.SkippedTablet.fromObject(object.skippedTabletUid[i]); - } - } - if (object.clientLocation != null) - message.clientLocation = String(object.clientLocation); - return message; - }; - - /** - * Creates a plain object from a RoutingHint message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.RoutingHint - * @static - * @param {google.spanner.v1.RoutingHint} message RoutingHint - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RoutingHint.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.skippedTabletUid = []; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.operationUid = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.operationUid = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.databaseId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.databaseId = options.longs === String ? "0" : 0; - if (options.bytes === String) - object.schemaGeneration = ""; - else { - object.schemaGeneration = []; - if (options.bytes !== Array) - object.schemaGeneration = $util.newBuffer(object.schemaGeneration); - } - if (options.bytes === String) - object.key = ""; - else { - object.key = []; - if (options.bytes !== Array) - object.key = $util.newBuffer(object.key); - } - if (options.bytes === String) - object.limitKey = ""; - else { - object.limitKey = []; - if (options.bytes !== Array) - object.limitKey = $util.newBuffer(object.limitKey); - } - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.groupUid = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.groupUid = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.splitId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.splitId = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.tabletUid = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.tabletUid = options.longs === String ? "0" : 0; - object.clientLocation = ""; - } - if (message.operationUid != null && message.hasOwnProperty("operationUid")) - if (typeof message.operationUid === "number") - object.operationUid = options.longs === String ? String(message.operationUid) : message.operationUid; - else - object.operationUid = options.longs === String ? $util.Long.prototype.toString.call(message.operationUid) : options.longs === Number ? new $util.LongBits(message.operationUid.low >>> 0, message.operationUid.high >>> 0).toNumber(true) : message.operationUid; - if (message.databaseId != null && message.hasOwnProperty("databaseId")) - if (typeof message.databaseId === "number") - object.databaseId = options.longs === String ? String(message.databaseId) : message.databaseId; - else - object.databaseId = options.longs === String ? $util.Long.prototype.toString.call(message.databaseId) : options.longs === Number ? new $util.LongBits(message.databaseId.low >>> 0, message.databaseId.high >>> 0).toNumber(true) : message.databaseId; - if (message.schemaGeneration != null && message.hasOwnProperty("schemaGeneration")) - object.schemaGeneration = options.bytes === String ? $util.base64.encode(message.schemaGeneration, 0, message.schemaGeneration.length) : options.bytes === Array ? Array.prototype.slice.call(message.schemaGeneration) : message.schemaGeneration; - if (message.key != null && message.hasOwnProperty("key")) - object.key = options.bytes === String ? $util.base64.encode(message.key, 0, message.key.length) : options.bytes === Array ? Array.prototype.slice.call(message.key) : message.key; - if (message.limitKey != null && message.hasOwnProperty("limitKey")) - object.limitKey = options.bytes === String ? $util.base64.encode(message.limitKey, 0, message.limitKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.limitKey) : message.limitKey; - if (message.groupUid != null && message.hasOwnProperty("groupUid")) - if (typeof message.groupUid === "number") - object.groupUid = options.longs === String ? String(message.groupUid) : message.groupUid; - else - object.groupUid = options.longs === String ? $util.Long.prototype.toString.call(message.groupUid) : options.longs === Number ? new $util.LongBits(message.groupUid.low >>> 0, message.groupUid.high >>> 0).toNumber(true) : message.groupUid; - if (message.splitId != null && message.hasOwnProperty("splitId")) - if (typeof message.splitId === "number") - object.splitId = options.longs === String ? String(message.splitId) : message.splitId; - else - object.splitId = options.longs === String ? $util.Long.prototype.toString.call(message.splitId) : options.longs === Number ? new $util.LongBits(message.splitId.low >>> 0, message.splitId.high >>> 0).toNumber(true) : message.splitId; - if (message.tabletUid != null && message.hasOwnProperty("tabletUid")) - if (typeof message.tabletUid === "number") - object.tabletUid = options.longs === String ? String(message.tabletUid) : message.tabletUid; - else - object.tabletUid = options.longs === String ? $util.Long.prototype.toString.call(message.tabletUid) : options.longs === Number ? new $util.LongBits(message.tabletUid.low >>> 0, message.tabletUid.high >>> 0).toNumber(true) : message.tabletUid; - if (message.skippedTabletUid && message.skippedTabletUid.length) { - object.skippedTabletUid = []; - for (var j = 0; j < message.skippedTabletUid.length; ++j) - object.skippedTabletUid[j] = $root.google.spanner.v1.RoutingHint.SkippedTablet.toObject(message.skippedTabletUid[j], options); - } - if (message.clientLocation != null && message.hasOwnProperty("clientLocation")) - object.clientLocation = message.clientLocation; - return object; - }; - - /** - * Converts this RoutingHint to JSON. - * @function toJSON - * @memberof google.spanner.v1.RoutingHint - * @instance - * @returns {Object.} JSON object - */ - RoutingHint.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RoutingHint - * @function getTypeUrl - * @memberof google.spanner.v1.RoutingHint - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RoutingHint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.RoutingHint"; - }; - - RoutingHint.SkippedTablet = (function() { - - /** - * Properties of a SkippedTablet. - * @memberof google.spanner.v1.RoutingHint - * @interface ISkippedTablet - * @property {number|Long|null} [tabletUid] SkippedTablet tabletUid - * @property {Uint8Array|null} [incarnation] SkippedTablet incarnation - */ - - /** - * Constructs a new SkippedTablet. - * @memberof google.spanner.v1.RoutingHint - * @classdesc Represents a SkippedTablet. - * @implements ISkippedTablet - * @constructor - * @param {google.spanner.v1.RoutingHint.ISkippedTablet=} [properties] Properties to set - */ - function SkippedTablet(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SkippedTablet tabletUid. - * @member {number|Long} tabletUid - * @memberof google.spanner.v1.RoutingHint.SkippedTablet - * @instance - */ - SkippedTablet.prototype.tabletUid = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * SkippedTablet incarnation. - * @member {Uint8Array} incarnation - * @memberof google.spanner.v1.RoutingHint.SkippedTablet - * @instance - */ - SkippedTablet.prototype.incarnation = $util.newBuffer([]); - - /** - * Creates a new SkippedTablet instance using the specified properties. - * @function create - * @memberof google.spanner.v1.RoutingHint.SkippedTablet - * @static - * @param {google.spanner.v1.RoutingHint.ISkippedTablet=} [properties] Properties to set - * @returns {google.spanner.v1.RoutingHint.SkippedTablet} SkippedTablet instance - */ - SkippedTablet.create = function create(properties) { - return new SkippedTablet(properties); - }; - - /** - * Encodes the specified SkippedTablet message. Does not implicitly {@link google.spanner.v1.RoutingHint.SkippedTablet.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.RoutingHint.SkippedTablet - * @static - * @param {google.spanner.v1.RoutingHint.ISkippedTablet} message SkippedTablet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SkippedTablet.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tabletUid != null && Object.hasOwnProperty.call(message, "tabletUid")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.tabletUid); - if (message.incarnation != null && Object.hasOwnProperty.call(message, "incarnation")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.incarnation); - return writer; - }; - - /** - * Encodes the specified SkippedTablet message, length delimited. Does not implicitly {@link google.spanner.v1.RoutingHint.SkippedTablet.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.RoutingHint.SkippedTablet - * @static - * @param {google.spanner.v1.RoutingHint.ISkippedTablet} message SkippedTablet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SkippedTablet.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SkippedTablet message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.RoutingHint.SkippedTablet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.RoutingHint.SkippedTablet} SkippedTablet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SkippedTablet.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.RoutingHint.SkippedTablet(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.tabletUid = reader.uint64(); - break; - } - case 2: { - message.incarnation = reader.bytes(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SkippedTablet message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.RoutingHint.SkippedTablet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.RoutingHint.SkippedTablet} SkippedTablet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SkippedTablet.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SkippedTablet message. - * @function verify - * @memberof google.spanner.v1.RoutingHint.SkippedTablet - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SkippedTablet.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.tabletUid != null && message.hasOwnProperty("tabletUid")) - if (!$util.isInteger(message.tabletUid) && !(message.tabletUid && $util.isInteger(message.tabletUid.low) && $util.isInteger(message.tabletUid.high))) - return "tabletUid: integer|Long expected"; - if (message.incarnation != null && message.hasOwnProperty("incarnation")) - if (!(message.incarnation && typeof message.incarnation.length === "number" || $util.isString(message.incarnation))) - return "incarnation: buffer expected"; - return null; - }; - - /** - * Creates a SkippedTablet message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.RoutingHint.SkippedTablet - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.RoutingHint.SkippedTablet} SkippedTablet - */ - SkippedTablet.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.RoutingHint.SkippedTablet) - return object; - var message = new $root.google.spanner.v1.RoutingHint.SkippedTablet(); - if (object.tabletUid != null) - if ($util.Long) - (message.tabletUid = $util.Long.fromValue(object.tabletUid)).unsigned = true; - else if (typeof object.tabletUid === "string") - message.tabletUid = parseInt(object.tabletUid, 10); - else if (typeof object.tabletUid === "number") - message.tabletUid = object.tabletUid; - else if (typeof object.tabletUid === "object") - message.tabletUid = new $util.LongBits(object.tabletUid.low >>> 0, object.tabletUid.high >>> 0).toNumber(true); - if (object.incarnation != null) - if (typeof object.incarnation === "string") - $util.base64.decode(object.incarnation, message.incarnation = $util.newBuffer($util.base64.length(object.incarnation)), 0); - else if (object.incarnation.length >= 0) - message.incarnation = object.incarnation; - return message; - }; - - /** - * Creates a plain object from a SkippedTablet message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.RoutingHint.SkippedTablet - * @static - * @param {google.spanner.v1.RoutingHint.SkippedTablet} message SkippedTablet - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SkippedTablet.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.tabletUid = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.tabletUid = options.longs === String ? "0" : 0; - if (options.bytes === String) - object.incarnation = ""; - else { - object.incarnation = []; - if (options.bytes !== Array) - object.incarnation = $util.newBuffer(object.incarnation); - } - } - if (message.tabletUid != null && message.hasOwnProperty("tabletUid")) - if (typeof message.tabletUid === "number") - object.tabletUid = options.longs === String ? String(message.tabletUid) : message.tabletUid; - else - object.tabletUid = options.longs === String ? $util.Long.prototype.toString.call(message.tabletUid) : options.longs === Number ? new $util.LongBits(message.tabletUid.low >>> 0, message.tabletUid.high >>> 0).toNumber(true) : message.tabletUid; - if (message.incarnation != null && message.hasOwnProperty("incarnation")) - object.incarnation = options.bytes === String ? $util.base64.encode(message.incarnation, 0, message.incarnation.length) : options.bytes === Array ? Array.prototype.slice.call(message.incarnation) : message.incarnation; - return object; - }; - - /** - * Converts this SkippedTablet to JSON. - * @function toJSON - * @memberof google.spanner.v1.RoutingHint.SkippedTablet - * @instance - * @returns {Object.} JSON object - */ - SkippedTablet.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SkippedTablet - * @function getTypeUrl - * @memberof google.spanner.v1.RoutingHint.SkippedTablet - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SkippedTablet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.RoutingHint.SkippedTablet"; - }; - - return SkippedTablet; - })(); - - return RoutingHint; - })(); - - v1.Type = (function() { - - /** - * Properties of a Type. - * @memberof google.spanner.v1 - * @interface IType - * @property {google.spanner.v1.TypeCode|null} [code] Type code - * @property {google.spanner.v1.IType|null} [arrayElementType] Type arrayElementType - * @property {google.spanner.v1.IStructType|null} [structType] Type structType - * @property {google.spanner.v1.TypeAnnotationCode|null} [typeAnnotation] Type typeAnnotation - * @property {string|null} [protoTypeFqn] Type protoTypeFqn - */ - - /** - * Constructs a new Type. - * @memberof google.spanner.v1 - * @classdesc Represents a Type. - * @implements IType - * @constructor - * @param {google.spanner.v1.IType=} [properties] Properties to set - */ - function Type(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Type code. - * @member {google.spanner.v1.TypeCode} code - * @memberof google.spanner.v1.Type - * @instance - */ - Type.prototype.code = 0; - - /** - * Type arrayElementType. - * @member {google.spanner.v1.IType|null|undefined} arrayElementType - * @memberof google.spanner.v1.Type - * @instance - */ - Type.prototype.arrayElementType = null; - - /** - * Type structType. - * @member {google.spanner.v1.IStructType|null|undefined} structType - * @memberof google.spanner.v1.Type - * @instance - */ - Type.prototype.structType = null; - - /** - * Type typeAnnotation. - * @member {google.spanner.v1.TypeAnnotationCode} typeAnnotation - * @memberof google.spanner.v1.Type - * @instance - */ - Type.prototype.typeAnnotation = 0; - - /** - * Type protoTypeFqn. - * @member {string} protoTypeFqn - * @memberof google.spanner.v1.Type - * @instance - */ - Type.prototype.protoTypeFqn = ""; - - /** - * Creates a new Type instance using the specified properties. - * @function create - * @memberof google.spanner.v1.Type - * @static - * @param {google.spanner.v1.IType=} [properties] Properties to set - * @returns {google.spanner.v1.Type} Type instance - */ - Type.create = function create(properties) { - return new Type(properties); - }; - - /** - * Encodes the specified Type message. Does not implicitly {@link google.spanner.v1.Type.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.Type - * @static - * @param {google.spanner.v1.IType} message Type message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Type.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.code != null && Object.hasOwnProperty.call(message, "code")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); - if (message.arrayElementType != null && Object.hasOwnProperty.call(message, "arrayElementType")) - $root.google.spanner.v1.Type.encode(message.arrayElementType, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.structType != null && Object.hasOwnProperty.call(message, "structType")) - $root.google.spanner.v1.StructType.encode(message.structType, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.typeAnnotation != null && Object.hasOwnProperty.call(message, "typeAnnotation")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.typeAnnotation); - if (message.protoTypeFqn != null && Object.hasOwnProperty.call(message, "protoTypeFqn")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.protoTypeFqn); - return writer; - }; - - /** - * Encodes the specified Type message, length delimited. Does not implicitly {@link google.spanner.v1.Type.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.Type - * @static - * @param {google.spanner.v1.IType} message Type message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Type.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Type message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.Type - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.Type} Type - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Type.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.Type(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.code = reader.int32(); - break; - } - case 2: { - message.arrayElementType = $root.google.spanner.v1.Type.decode(reader, reader.uint32()); - break; - } - case 3: { - message.structType = $root.google.spanner.v1.StructType.decode(reader, reader.uint32()); - break; - } - case 4: { - message.typeAnnotation = reader.int32(); - break; - } - case 5: { - message.protoTypeFqn = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Type message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.Type - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.Type} Type - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Type.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Type message. - * @function verify - * @memberof google.spanner.v1.Type - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Type.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.code != null && message.hasOwnProperty("code")) - switch (message.code) { - default: - return "code: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 15: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - case 10: - case 11: - case 13: - case 14: - case 16: - case 17: - break; - } - if (message.arrayElementType != null && message.hasOwnProperty("arrayElementType")) { - var error = $root.google.spanner.v1.Type.verify(message.arrayElementType); - if (error) - return "arrayElementType." + error; - } - if (message.structType != null && message.hasOwnProperty("structType")) { - var error = $root.google.spanner.v1.StructType.verify(message.structType); - if (error) - return "structType." + error; - } - if (message.typeAnnotation != null && message.hasOwnProperty("typeAnnotation")) - switch (message.typeAnnotation) { - default: - return "typeAnnotation: enum value expected"; - case 0: - case 2: - case 3: - case 4: - break; - } - if (message.protoTypeFqn != null && message.hasOwnProperty("protoTypeFqn")) - if (!$util.isString(message.protoTypeFqn)) - return "protoTypeFqn: string expected"; - return null; - }; - - /** - * Creates a Type message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.Type - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.Type} Type - */ - Type.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.Type) - return object; - var message = new $root.google.spanner.v1.Type(); - switch (object.code) { - default: - if (typeof object.code === "number") { - message.code = object.code; - break; - } - break; - case "TYPE_CODE_UNSPECIFIED": - case 0: - message.code = 0; - break; - case "BOOL": - case 1: - message.code = 1; - break; - case "INT64": - case 2: - message.code = 2; - break; - case "FLOAT64": - case 3: - message.code = 3; - break; - case "FLOAT32": - case 15: - message.code = 15; - break; - case "TIMESTAMP": - case 4: - message.code = 4; - break; - case "DATE": - case 5: - message.code = 5; - break; - case "STRING": - case 6: - message.code = 6; - break; - case "BYTES": - case 7: - message.code = 7; - break; - case "ARRAY": - case 8: - message.code = 8; - break; - case "STRUCT": - case 9: - message.code = 9; - break; - case "NUMERIC": - case 10: - message.code = 10; - break; - case "JSON": - case 11: - message.code = 11; - break; - case "PROTO": - case 13: - message.code = 13; - break; - case "ENUM": - case 14: - message.code = 14; - break; - case "INTERVAL": - case 16: - message.code = 16; - break; - case "UUID": - case 17: - message.code = 17; - break; - } - if (object.arrayElementType != null) { - if (typeof object.arrayElementType !== "object") - throw TypeError(".google.spanner.v1.Type.arrayElementType: object expected"); - message.arrayElementType = $root.google.spanner.v1.Type.fromObject(object.arrayElementType); - } - if (object.structType != null) { - if (typeof object.structType !== "object") - throw TypeError(".google.spanner.v1.Type.structType: object expected"); - message.structType = $root.google.spanner.v1.StructType.fromObject(object.structType); - } - switch (object.typeAnnotation) { - default: - if (typeof object.typeAnnotation === "number") { - message.typeAnnotation = object.typeAnnotation; - break; - } - break; - case "TYPE_ANNOTATION_CODE_UNSPECIFIED": - case 0: - message.typeAnnotation = 0; - break; - case "PG_NUMERIC": - case 2: - message.typeAnnotation = 2; - break; - case "PG_JSONB": - case 3: - message.typeAnnotation = 3; - break; - case "PG_OID": - case 4: - message.typeAnnotation = 4; - break; - } - if (object.protoTypeFqn != null) - message.protoTypeFqn = String(object.protoTypeFqn); - return message; - }; - - /** - * Creates a plain object from a Type message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.Type - * @static - * @param {google.spanner.v1.Type} message Type - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Type.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.code = options.enums === String ? "TYPE_CODE_UNSPECIFIED" : 0; - object.arrayElementType = null; - object.structType = null; - object.typeAnnotation = options.enums === String ? "TYPE_ANNOTATION_CODE_UNSPECIFIED" : 0; - object.protoTypeFqn = ""; - } - if (message.code != null && message.hasOwnProperty("code")) - object.code = options.enums === String ? $root.google.spanner.v1.TypeCode[message.code] === undefined ? message.code : $root.google.spanner.v1.TypeCode[message.code] : message.code; - if (message.arrayElementType != null && message.hasOwnProperty("arrayElementType")) - object.arrayElementType = $root.google.spanner.v1.Type.toObject(message.arrayElementType, options); - if (message.structType != null && message.hasOwnProperty("structType")) - object.structType = $root.google.spanner.v1.StructType.toObject(message.structType, options); - if (message.typeAnnotation != null && message.hasOwnProperty("typeAnnotation")) - object.typeAnnotation = options.enums === String ? $root.google.spanner.v1.TypeAnnotationCode[message.typeAnnotation] === undefined ? message.typeAnnotation : $root.google.spanner.v1.TypeAnnotationCode[message.typeAnnotation] : message.typeAnnotation; - if (message.protoTypeFqn != null && message.hasOwnProperty("protoTypeFqn")) - object.protoTypeFqn = message.protoTypeFqn; - return object; - }; - - /** - * Converts this Type to JSON. - * @function toJSON - * @memberof google.spanner.v1.Type - * @instance - * @returns {Object.} JSON object - */ - Type.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Type - * @function getTypeUrl - * @memberof google.spanner.v1.Type - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Type.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.Type"; - }; - - return Type; - })(); - - v1.StructType = (function() { - - /** - * Properties of a StructType. - * @memberof google.spanner.v1 - * @interface IStructType - * @property {Array.|null} [fields] StructType fields - */ - - /** - * Constructs a new StructType. - * @memberof google.spanner.v1 - * @classdesc Represents a StructType. - * @implements IStructType - * @constructor - * @param {google.spanner.v1.IStructType=} [properties] Properties to set - */ - function StructType(properties) { - this.fields = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * StructType fields. - * @member {Array.} fields - * @memberof google.spanner.v1.StructType - * @instance - */ - StructType.prototype.fields = $util.emptyArray; - - /** - * Creates a new StructType instance using the specified properties. - * @function create - * @memberof google.spanner.v1.StructType - * @static - * @param {google.spanner.v1.IStructType=} [properties] Properties to set - * @returns {google.spanner.v1.StructType} StructType instance - */ - StructType.create = function create(properties) { - return new StructType(properties); - }; - - /** - * Encodes the specified StructType message. Does not implicitly {@link google.spanner.v1.StructType.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.StructType - * @static - * @param {google.spanner.v1.IStructType} message StructType message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StructType.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.fields != null && message.fields.length) - for (var i = 0; i < message.fields.length; ++i) - $root.google.spanner.v1.StructType.Field.encode(message.fields[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified StructType message, length delimited. Does not implicitly {@link google.spanner.v1.StructType.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.StructType - * @static - * @param {google.spanner.v1.IStructType} message StructType message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StructType.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a StructType message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.StructType - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.StructType} StructType - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StructType.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.StructType(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.fields && message.fields.length)) - message.fields = []; - message.fields.push($root.google.spanner.v1.StructType.Field.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a StructType message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.StructType - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.StructType} StructType - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StructType.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a StructType message. - * @function verify - * @memberof google.spanner.v1.StructType - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - StructType.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.fields != null && message.hasOwnProperty("fields")) { - if (!Array.isArray(message.fields)) - return "fields: array expected"; - for (var i = 0; i < message.fields.length; ++i) { - var error = $root.google.spanner.v1.StructType.Field.verify(message.fields[i]); - if (error) - return "fields." + error; - } - } - return null; - }; - - /** - * Creates a StructType message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.StructType - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.StructType} StructType - */ - StructType.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.StructType) - return object; - var message = new $root.google.spanner.v1.StructType(); - if (object.fields) { - if (!Array.isArray(object.fields)) - throw TypeError(".google.spanner.v1.StructType.fields: array expected"); - message.fields = []; - for (var i = 0; i < object.fields.length; ++i) { - if (typeof object.fields[i] !== "object") - throw TypeError(".google.spanner.v1.StructType.fields: object expected"); - message.fields[i] = $root.google.spanner.v1.StructType.Field.fromObject(object.fields[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a StructType message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.StructType - * @static - * @param {google.spanner.v1.StructType} message StructType - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - StructType.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.fields = []; - if (message.fields && message.fields.length) { - object.fields = []; - for (var j = 0; j < message.fields.length; ++j) - object.fields[j] = $root.google.spanner.v1.StructType.Field.toObject(message.fields[j], options); - } - return object; - }; - - /** - * Converts this StructType to JSON. - * @function toJSON - * @memberof google.spanner.v1.StructType - * @instance - * @returns {Object.} JSON object - */ - StructType.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for StructType - * @function getTypeUrl - * @memberof google.spanner.v1.StructType - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - StructType.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.StructType"; - }; - - StructType.Field = (function() { - - /** - * Properties of a Field. - * @memberof google.spanner.v1.StructType - * @interface IField - * @property {string|null} [name] Field name - * @property {google.spanner.v1.IType|null} [type] Field type - */ - - /** - * Constructs a new Field. - * @memberof google.spanner.v1.StructType - * @classdesc Represents a Field. - * @implements IField - * @constructor - * @param {google.spanner.v1.StructType.IField=} [properties] Properties to set - */ - function Field(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Field name. - * @member {string} name - * @memberof google.spanner.v1.StructType.Field - * @instance - */ - Field.prototype.name = ""; - - /** - * Field type. - * @member {google.spanner.v1.IType|null|undefined} type - * @memberof google.spanner.v1.StructType.Field - * @instance - */ - Field.prototype.type = null; - - /** - * Creates a new Field instance using the specified properties. - * @function create - * @memberof google.spanner.v1.StructType.Field - * @static - * @param {google.spanner.v1.StructType.IField=} [properties] Properties to set - * @returns {google.spanner.v1.StructType.Field} Field instance - */ - Field.create = function create(properties) { - return new Field(properties); - }; - - /** - * Encodes the specified Field message. Does not implicitly {@link google.spanner.v1.StructType.Field.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.StructType.Field - * @static - * @param {google.spanner.v1.StructType.IField} message Field message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Field.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - $root.google.spanner.v1.Type.encode(message.type, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Field message, length delimited. Does not implicitly {@link google.spanner.v1.StructType.Field.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.StructType.Field - * @static - * @param {google.spanner.v1.StructType.IField} message Field message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Field.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Field message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.StructType.Field - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.StructType.Field} Field - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Field.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.StructType.Field(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.type = $root.google.spanner.v1.Type.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Field message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.StructType.Field - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.StructType.Field} Field - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Field.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Field message. - * @function verify - * @memberof google.spanner.v1.StructType.Field - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Field.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.type != null && message.hasOwnProperty("type")) { - var error = $root.google.spanner.v1.Type.verify(message.type); - if (error) - return "type." + error; - } - return null; - }; - - /** - * Creates a Field message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.StructType.Field - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.StructType.Field} Field - */ - Field.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.StructType.Field) - return object; - var message = new $root.google.spanner.v1.StructType.Field(); - if (object.name != null) - message.name = String(object.name); - if (object.type != null) { - if (typeof object.type !== "object") - throw TypeError(".google.spanner.v1.StructType.Field.type: object expected"); - message.type = $root.google.spanner.v1.Type.fromObject(object.type); - } - return message; - }; - - /** - * Creates a plain object from a Field message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.StructType.Field - * @static - * @param {google.spanner.v1.StructType.Field} message Field - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Field.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.type = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.type != null && message.hasOwnProperty("type")) - object.type = $root.google.spanner.v1.Type.toObject(message.type, options); - return object; - }; - - /** - * Converts this Field to JSON. - * @function toJSON - * @memberof google.spanner.v1.StructType.Field - * @instance - * @returns {Object.} JSON object - */ - Field.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Field - * @function getTypeUrl - * @memberof google.spanner.v1.StructType.Field - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Field.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.StructType.Field"; - }; - - return Field; - })(); - - return StructType; - })(); - - /** - * TypeCode enum. - * @name google.spanner.v1.TypeCode - * @enum {number} - * @property {number} TYPE_CODE_UNSPECIFIED=0 TYPE_CODE_UNSPECIFIED value - * @property {number} BOOL=1 BOOL value - * @property {number} INT64=2 INT64 value - * @property {number} FLOAT64=3 FLOAT64 value - * @property {number} FLOAT32=15 FLOAT32 value - * @property {number} TIMESTAMP=4 TIMESTAMP value - * @property {number} DATE=5 DATE value - * @property {number} STRING=6 STRING value - * @property {number} BYTES=7 BYTES value - * @property {number} ARRAY=8 ARRAY value - * @property {number} STRUCT=9 STRUCT value - * @property {number} NUMERIC=10 NUMERIC value - * @property {number} JSON=11 JSON value - * @property {number} PROTO=13 PROTO value - * @property {number} ENUM=14 ENUM value - * @property {number} INTERVAL=16 INTERVAL value - * @property {number} UUID=17 UUID value - */ - v1.TypeCode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TYPE_CODE_UNSPECIFIED"] = 0; - values[valuesById[1] = "BOOL"] = 1; - values[valuesById[2] = "INT64"] = 2; - values[valuesById[3] = "FLOAT64"] = 3; - values[valuesById[15] = "FLOAT32"] = 15; - values[valuesById[4] = "TIMESTAMP"] = 4; - values[valuesById[5] = "DATE"] = 5; - values[valuesById[6] = "STRING"] = 6; - values[valuesById[7] = "BYTES"] = 7; - values[valuesById[8] = "ARRAY"] = 8; - values[valuesById[9] = "STRUCT"] = 9; - values[valuesById[10] = "NUMERIC"] = 10; - values[valuesById[11] = "JSON"] = 11; - values[valuesById[13] = "PROTO"] = 13; - values[valuesById[14] = "ENUM"] = 14; - values[valuesById[16] = "INTERVAL"] = 16; - values[valuesById[17] = "UUID"] = 17; - return values; - })(); - - /** - * TypeAnnotationCode enum. - * @name google.spanner.v1.TypeAnnotationCode - * @enum {number} - * @property {number} TYPE_ANNOTATION_CODE_UNSPECIFIED=0 TYPE_ANNOTATION_CODE_UNSPECIFIED value - * @property {number} PG_NUMERIC=2 PG_NUMERIC value - * @property {number} PG_JSONB=3 PG_JSONB value - * @property {number} PG_OID=4 PG_OID value - */ - v1.TypeAnnotationCode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TYPE_ANNOTATION_CODE_UNSPECIFIED"] = 0; - values[valuesById[2] = "PG_NUMERIC"] = 2; - values[valuesById[3] = "PG_JSONB"] = 3; - values[valuesById[4] = "PG_OID"] = 4; - return values; - })(); - - v1.Mutation = (function() { - - /** - * Properties of a Mutation. - * @memberof google.spanner.v1 - * @interface IMutation - * @property {google.spanner.v1.Mutation.IWrite|null} [insert] Mutation insert - * @property {google.spanner.v1.Mutation.IWrite|null} [update] Mutation update - * @property {google.spanner.v1.Mutation.IWrite|null} [insertOrUpdate] Mutation insertOrUpdate - * @property {google.spanner.v1.Mutation.IWrite|null} [replace] Mutation replace - * @property {google.spanner.v1.Mutation.IDelete|null} ["delete"] Mutation delete - * @property {google.spanner.v1.Mutation.ISend|null} [send] Mutation send - * @property {google.spanner.v1.Mutation.IAck|null} [ack] Mutation ack - */ - - /** - * Constructs a new Mutation. - * @memberof google.spanner.v1 - * @classdesc Represents a Mutation. - * @implements IMutation - * @constructor - * @param {google.spanner.v1.IMutation=} [properties] Properties to set - */ - function Mutation(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Mutation insert. - * @member {google.spanner.v1.Mutation.IWrite|null|undefined} insert - * @memberof google.spanner.v1.Mutation - * @instance - */ - Mutation.prototype.insert = null; - - /** - * Mutation update. - * @member {google.spanner.v1.Mutation.IWrite|null|undefined} update - * @memberof google.spanner.v1.Mutation - * @instance - */ - Mutation.prototype.update = null; - - /** - * Mutation insertOrUpdate. - * @member {google.spanner.v1.Mutation.IWrite|null|undefined} insertOrUpdate - * @memberof google.spanner.v1.Mutation - * @instance - */ - Mutation.prototype.insertOrUpdate = null; - - /** - * Mutation replace. - * @member {google.spanner.v1.Mutation.IWrite|null|undefined} replace - * @memberof google.spanner.v1.Mutation - * @instance - */ - Mutation.prototype.replace = null; - - /** - * Mutation delete. - * @member {google.spanner.v1.Mutation.IDelete|null|undefined} delete - * @memberof google.spanner.v1.Mutation - * @instance - */ - Mutation.prototype["delete"] = null; - - /** - * Mutation send. - * @member {google.spanner.v1.Mutation.ISend|null|undefined} send - * @memberof google.spanner.v1.Mutation - * @instance - */ - Mutation.prototype.send = null; - - /** - * Mutation ack. - * @member {google.spanner.v1.Mutation.IAck|null|undefined} ack - * @memberof google.spanner.v1.Mutation - * @instance - */ - Mutation.prototype.ack = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Mutation operation. - * @member {"insert"|"update"|"insertOrUpdate"|"replace"|"delete"|"send"|"ack"|undefined} operation - * @memberof google.spanner.v1.Mutation - * @instance - */ - Object.defineProperty(Mutation.prototype, "operation", { - get: $util.oneOfGetter($oneOfFields = ["insert", "update", "insertOrUpdate", "replace", "delete", "send", "ack"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Mutation instance using the specified properties. - * @function create - * @memberof google.spanner.v1.Mutation - * @static - * @param {google.spanner.v1.IMutation=} [properties] Properties to set - * @returns {google.spanner.v1.Mutation} Mutation instance - */ - Mutation.create = function create(properties) { - return new Mutation(properties); - }; - - /** - * Encodes the specified Mutation message. Does not implicitly {@link google.spanner.v1.Mutation.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.Mutation - * @static - * @param {google.spanner.v1.IMutation} message Mutation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Mutation.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.insert != null && Object.hasOwnProperty.call(message, "insert")) - $root.google.spanner.v1.Mutation.Write.encode(message.insert, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.update != null && Object.hasOwnProperty.call(message, "update")) - $root.google.spanner.v1.Mutation.Write.encode(message.update, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.insertOrUpdate != null && Object.hasOwnProperty.call(message, "insertOrUpdate")) - $root.google.spanner.v1.Mutation.Write.encode(message.insertOrUpdate, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.replace != null && Object.hasOwnProperty.call(message, "replace")) - $root.google.spanner.v1.Mutation.Write.encode(message.replace, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) - $root.google.spanner.v1.Mutation.Delete.encode(message["delete"], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.send != null && Object.hasOwnProperty.call(message, "send")) - $root.google.spanner.v1.Mutation.Send.encode(message.send, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.ack != null && Object.hasOwnProperty.call(message, "ack")) - $root.google.spanner.v1.Mutation.Ack.encode(message.ack, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Mutation message, length delimited. Does not implicitly {@link google.spanner.v1.Mutation.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.Mutation - * @static - * @param {google.spanner.v1.IMutation} message Mutation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Mutation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Mutation message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.Mutation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.Mutation} Mutation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Mutation.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.Mutation(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.insert = $root.google.spanner.v1.Mutation.Write.decode(reader, reader.uint32()); - break; - } - case 2: { - message.update = $root.google.spanner.v1.Mutation.Write.decode(reader, reader.uint32()); - break; - } - case 3: { - message.insertOrUpdate = $root.google.spanner.v1.Mutation.Write.decode(reader, reader.uint32()); - break; - } - case 4: { - message.replace = $root.google.spanner.v1.Mutation.Write.decode(reader, reader.uint32()); - break; - } - case 5: { - message["delete"] = $root.google.spanner.v1.Mutation.Delete.decode(reader, reader.uint32()); - break; - } - case 6: { - message.send = $root.google.spanner.v1.Mutation.Send.decode(reader, reader.uint32()); - break; - } - case 7: { - message.ack = $root.google.spanner.v1.Mutation.Ack.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Mutation message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.Mutation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.Mutation} Mutation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Mutation.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Mutation message. - * @function verify - * @memberof google.spanner.v1.Mutation - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Mutation.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.insert != null && message.hasOwnProperty("insert")) { - properties.operation = 1; - { - var error = $root.google.spanner.v1.Mutation.Write.verify(message.insert); - if (error) - return "insert." + error; - } - } - if (message.update != null && message.hasOwnProperty("update")) { - if (properties.operation === 1) - return "operation: multiple values"; - properties.operation = 1; - { - var error = $root.google.spanner.v1.Mutation.Write.verify(message.update); - if (error) - return "update." + error; - } - } - if (message.insertOrUpdate != null && message.hasOwnProperty("insertOrUpdate")) { - if (properties.operation === 1) - return "operation: multiple values"; - properties.operation = 1; - { - var error = $root.google.spanner.v1.Mutation.Write.verify(message.insertOrUpdate); - if (error) - return "insertOrUpdate." + error; - } - } - if (message.replace != null && message.hasOwnProperty("replace")) { - if (properties.operation === 1) - return "operation: multiple values"; - properties.operation = 1; - { - var error = $root.google.spanner.v1.Mutation.Write.verify(message.replace); - if (error) - return "replace." + error; - } - } - if (message["delete"] != null && message.hasOwnProperty("delete")) { - if (properties.operation === 1) - return "operation: multiple values"; - properties.operation = 1; - { - var error = $root.google.spanner.v1.Mutation.Delete.verify(message["delete"]); - if (error) - return "delete." + error; - } - } - if (message.send != null && message.hasOwnProperty("send")) { - if (properties.operation === 1) - return "operation: multiple values"; - properties.operation = 1; - { - var error = $root.google.spanner.v1.Mutation.Send.verify(message.send); - if (error) - return "send." + error; - } - } - if (message.ack != null && message.hasOwnProperty("ack")) { - if (properties.operation === 1) - return "operation: multiple values"; - properties.operation = 1; - { - var error = $root.google.spanner.v1.Mutation.Ack.verify(message.ack); - if (error) - return "ack." + error; - } - } - return null; - }; - - /** - * Creates a Mutation message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.Mutation - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.Mutation} Mutation - */ - Mutation.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.Mutation) - return object; - var message = new $root.google.spanner.v1.Mutation(); - if (object.insert != null) { - if (typeof object.insert !== "object") - throw TypeError(".google.spanner.v1.Mutation.insert: object expected"); - message.insert = $root.google.spanner.v1.Mutation.Write.fromObject(object.insert); - } - if (object.update != null) { - if (typeof object.update !== "object") - throw TypeError(".google.spanner.v1.Mutation.update: object expected"); - message.update = $root.google.spanner.v1.Mutation.Write.fromObject(object.update); - } - if (object.insertOrUpdate != null) { - if (typeof object.insertOrUpdate !== "object") - throw TypeError(".google.spanner.v1.Mutation.insertOrUpdate: object expected"); - message.insertOrUpdate = $root.google.spanner.v1.Mutation.Write.fromObject(object.insertOrUpdate); - } - if (object.replace != null) { - if (typeof object.replace !== "object") - throw TypeError(".google.spanner.v1.Mutation.replace: object expected"); - message.replace = $root.google.spanner.v1.Mutation.Write.fromObject(object.replace); - } - if (object["delete"] != null) { - if (typeof object["delete"] !== "object") - throw TypeError(".google.spanner.v1.Mutation.delete: object expected"); - message["delete"] = $root.google.spanner.v1.Mutation.Delete.fromObject(object["delete"]); - } - if (object.send != null) { - if (typeof object.send !== "object") - throw TypeError(".google.spanner.v1.Mutation.send: object expected"); - message.send = $root.google.spanner.v1.Mutation.Send.fromObject(object.send); - } - if (object.ack != null) { - if (typeof object.ack !== "object") - throw TypeError(".google.spanner.v1.Mutation.ack: object expected"); - message.ack = $root.google.spanner.v1.Mutation.Ack.fromObject(object.ack); - } - return message; - }; - - /** - * Creates a plain object from a Mutation message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.Mutation - * @static - * @param {google.spanner.v1.Mutation} message Mutation - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Mutation.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.insert != null && message.hasOwnProperty("insert")) { - object.insert = $root.google.spanner.v1.Mutation.Write.toObject(message.insert, options); - if (options.oneofs) - object.operation = "insert"; - } - if (message.update != null && message.hasOwnProperty("update")) { - object.update = $root.google.spanner.v1.Mutation.Write.toObject(message.update, options); - if (options.oneofs) - object.operation = "update"; - } - if (message.insertOrUpdate != null && message.hasOwnProperty("insertOrUpdate")) { - object.insertOrUpdate = $root.google.spanner.v1.Mutation.Write.toObject(message.insertOrUpdate, options); - if (options.oneofs) - object.operation = "insertOrUpdate"; - } - if (message.replace != null && message.hasOwnProperty("replace")) { - object.replace = $root.google.spanner.v1.Mutation.Write.toObject(message.replace, options); - if (options.oneofs) - object.operation = "replace"; - } - if (message["delete"] != null && message.hasOwnProperty("delete")) { - object["delete"] = $root.google.spanner.v1.Mutation.Delete.toObject(message["delete"], options); - if (options.oneofs) - object.operation = "delete"; - } - if (message.send != null && message.hasOwnProperty("send")) { - object.send = $root.google.spanner.v1.Mutation.Send.toObject(message.send, options); - if (options.oneofs) - object.operation = "send"; - } - if (message.ack != null && message.hasOwnProperty("ack")) { - object.ack = $root.google.spanner.v1.Mutation.Ack.toObject(message.ack, options); - if (options.oneofs) - object.operation = "ack"; - } - return object; - }; - - /** - * Converts this Mutation to JSON. - * @function toJSON - * @memberof google.spanner.v1.Mutation - * @instance - * @returns {Object.} JSON object - */ - Mutation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Mutation - * @function getTypeUrl - * @memberof google.spanner.v1.Mutation - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Mutation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.Mutation"; - }; - - Mutation.Write = (function() { - - /** - * Properties of a Write. - * @memberof google.spanner.v1.Mutation - * @interface IWrite - * @property {string|null} [table] Write table - * @property {Array.|null} [columns] Write columns - * @property {Array.|null} [values] Write values - */ - - /** - * Constructs a new Write. - * @memberof google.spanner.v1.Mutation - * @classdesc Represents a Write. - * @implements IWrite - * @constructor - * @param {google.spanner.v1.Mutation.IWrite=} [properties] Properties to set - */ - function Write(properties) { - this.columns = []; - this.values = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Write table. - * @member {string} table - * @memberof google.spanner.v1.Mutation.Write - * @instance - */ - Write.prototype.table = ""; - - /** - * Write columns. - * @member {Array.} columns - * @memberof google.spanner.v1.Mutation.Write - * @instance - */ - Write.prototype.columns = $util.emptyArray; - - /** - * Write values. - * @member {Array.} values - * @memberof google.spanner.v1.Mutation.Write - * @instance - */ - Write.prototype.values = $util.emptyArray; - - /** - * Creates a new Write instance using the specified properties. - * @function create - * @memberof google.spanner.v1.Mutation.Write - * @static - * @param {google.spanner.v1.Mutation.IWrite=} [properties] Properties to set - * @returns {google.spanner.v1.Mutation.Write} Write instance - */ - Write.create = function create(properties) { - return new Write(properties); - }; - - /** - * Encodes the specified Write message. Does not implicitly {@link google.spanner.v1.Mutation.Write.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.Mutation.Write - * @static - * @param {google.spanner.v1.Mutation.IWrite} message Write message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Write.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.table != null && Object.hasOwnProperty.call(message, "table")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.table); - if (message.columns != null && message.columns.length) - for (var i = 0; i < message.columns.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.columns[i]); - if (message.values != null && message.values.length) - for (var i = 0; i < message.values.length; ++i) - $root.google.protobuf.ListValue.encode(message.values[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Write message, length delimited. Does not implicitly {@link google.spanner.v1.Mutation.Write.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.Mutation.Write - * @static - * @param {google.spanner.v1.Mutation.IWrite} message Write message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Write.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Write message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.Mutation.Write - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.Mutation.Write} Write - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Write.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.Mutation.Write(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.table = reader.string(); - break; - } - case 2: { - if (!(message.columns && message.columns.length)) - message.columns = []; - message.columns.push(reader.string()); - break; - } - case 3: { - if (!(message.values && message.values.length)) - message.values = []; - message.values.push($root.google.protobuf.ListValue.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Write message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.Mutation.Write - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.Mutation.Write} Write - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Write.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Write message. - * @function verify - * @memberof google.spanner.v1.Mutation.Write - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Write.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.table != null && message.hasOwnProperty("table")) - if (!$util.isString(message.table)) - return "table: string expected"; - if (message.columns != null && message.hasOwnProperty("columns")) { - if (!Array.isArray(message.columns)) - return "columns: array expected"; - for (var i = 0; i < message.columns.length; ++i) - if (!$util.isString(message.columns[i])) - return "columns: string[] expected"; - } - if (message.values != null && message.hasOwnProperty("values")) { - if (!Array.isArray(message.values)) - return "values: array expected"; - for (var i = 0; i < message.values.length; ++i) { - var error = $root.google.protobuf.ListValue.verify(message.values[i]); - if (error) - return "values." + error; - } - } - return null; - }; - - /** - * Creates a Write message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.Mutation.Write - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.Mutation.Write} Write - */ - Write.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.Mutation.Write) - return object; - var message = new $root.google.spanner.v1.Mutation.Write(); - if (object.table != null) - message.table = String(object.table); - if (object.columns) { - if (!Array.isArray(object.columns)) - throw TypeError(".google.spanner.v1.Mutation.Write.columns: array expected"); - message.columns = []; - for (var i = 0; i < object.columns.length; ++i) - message.columns[i] = String(object.columns[i]); - } - if (object.values) { - if (!Array.isArray(object.values)) - throw TypeError(".google.spanner.v1.Mutation.Write.values: array expected"); - message.values = []; - for (var i = 0; i < object.values.length; ++i) { - if (typeof object.values[i] !== "object") - throw TypeError(".google.spanner.v1.Mutation.Write.values: object expected"); - message.values[i] = $root.google.protobuf.ListValue.fromObject(object.values[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a Write message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.Mutation.Write - * @static - * @param {google.spanner.v1.Mutation.Write} message Write - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Write.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.columns = []; - object.values = []; - } - if (options.defaults) - object.table = ""; - if (message.table != null && message.hasOwnProperty("table")) - object.table = message.table; - if (message.columns && message.columns.length) { - object.columns = []; - for (var j = 0; j < message.columns.length; ++j) - object.columns[j] = message.columns[j]; - } - if (message.values && message.values.length) { - object.values = []; - for (var j = 0; j < message.values.length; ++j) - object.values[j] = $root.google.protobuf.ListValue.toObject(message.values[j], options); - } - return object; - }; - - /** - * Converts this Write to JSON. - * @function toJSON - * @memberof google.spanner.v1.Mutation.Write - * @instance - * @returns {Object.} JSON object - */ - Write.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Write - * @function getTypeUrl - * @memberof google.spanner.v1.Mutation.Write - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Write.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.Mutation.Write"; - }; - - return Write; - })(); - - Mutation.Delete = (function() { - - /** - * Properties of a Delete. - * @memberof google.spanner.v1.Mutation - * @interface IDelete - * @property {string|null} [table] Delete table - * @property {google.spanner.v1.IKeySet|null} [keySet] Delete keySet - */ - - /** - * Constructs a new Delete. - * @memberof google.spanner.v1.Mutation - * @classdesc Represents a Delete. - * @implements IDelete - * @constructor - * @param {google.spanner.v1.Mutation.IDelete=} [properties] Properties to set - */ - function Delete(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Delete table. - * @member {string} table - * @memberof google.spanner.v1.Mutation.Delete - * @instance - */ - Delete.prototype.table = ""; - - /** - * Delete keySet. - * @member {google.spanner.v1.IKeySet|null|undefined} keySet - * @memberof google.spanner.v1.Mutation.Delete - * @instance - */ - Delete.prototype.keySet = null; - - /** - * Creates a new Delete instance using the specified properties. - * @function create - * @memberof google.spanner.v1.Mutation.Delete - * @static - * @param {google.spanner.v1.Mutation.IDelete=} [properties] Properties to set - * @returns {google.spanner.v1.Mutation.Delete} Delete instance - */ - Delete.create = function create(properties) { - return new Delete(properties); - }; - - /** - * Encodes the specified Delete message. Does not implicitly {@link google.spanner.v1.Mutation.Delete.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.Mutation.Delete - * @static - * @param {google.spanner.v1.Mutation.IDelete} message Delete message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Delete.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.table != null && Object.hasOwnProperty.call(message, "table")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.table); - if (message.keySet != null && Object.hasOwnProperty.call(message, "keySet")) - $root.google.spanner.v1.KeySet.encode(message.keySet, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Delete message, length delimited. Does not implicitly {@link google.spanner.v1.Mutation.Delete.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.Mutation.Delete - * @static - * @param {google.spanner.v1.Mutation.IDelete} message Delete message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Delete.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Delete message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.Mutation.Delete - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.Mutation.Delete} Delete - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Delete.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.Mutation.Delete(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.table = reader.string(); - break; - } - case 2: { - message.keySet = $root.google.spanner.v1.KeySet.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Delete message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.Mutation.Delete - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.Mutation.Delete} Delete - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Delete.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Delete message. - * @function verify - * @memberof google.spanner.v1.Mutation.Delete - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Delete.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.table != null && message.hasOwnProperty("table")) - if (!$util.isString(message.table)) - return "table: string expected"; - if (message.keySet != null && message.hasOwnProperty("keySet")) { - var error = $root.google.spanner.v1.KeySet.verify(message.keySet); - if (error) - return "keySet." + error; - } - return null; - }; - - /** - * Creates a Delete message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.Mutation.Delete - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.Mutation.Delete} Delete - */ - Delete.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.Mutation.Delete) - return object; - var message = new $root.google.spanner.v1.Mutation.Delete(); - if (object.table != null) - message.table = String(object.table); - if (object.keySet != null) { - if (typeof object.keySet !== "object") - throw TypeError(".google.spanner.v1.Mutation.Delete.keySet: object expected"); - message.keySet = $root.google.spanner.v1.KeySet.fromObject(object.keySet); - } - return message; - }; - - /** - * Creates a plain object from a Delete message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.Mutation.Delete - * @static - * @param {google.spanner.v1.Mutation.Delete} message Delete - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Delete.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.table = ""; - object.keySet = null; - } - if (message.table != null && message.hasOwnProperty("table")) - object.table = message.table; - if (message.keySet != null && message.hasOwnProperty("keySet")) - object.keySet = $root.google.spanner.v1.KeySet.toObject(message.keySet, options); - return object; - }; - - /** - * Converts this Delete to JSON. - * @function toJSON - * @memberof google.spanner.v1.Mutation.Delete - * @instance - * @returns {Object.} JSON object - */ - Delete.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Delete - * @function getTypeUrl - * @memberof google.spanner.v1.Mutation.Delete - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Delete.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.Mutation.Delete"; - }; - - return Delete; - })(); - - Mutation.Send = (function() { - - /** - * Properties of a Send. - * @memberof google.spanner.v1.Mutation - * @interface ISend - * @property {string|null} [queue] Send queue - * @property {google.protobuf.IListValue|null} [key] Send key - * @property {google.protobuf.ITimestamp|null} [deliverTime] Send deliverTime - * @property {google.protobuf.IValue|null} [payload] Send payload - */ - - /** - * Constructs a new Send. - * @memberof google.spanner.v1.Mutation - * @classdesc Represents a Send. - * @implements ISend - * @constructor - * @param {google.spanner.v1.Mutation.ISend=} [properties] Properties to set - */ - function Send(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Send queue. - * @member {string} queue - * @memberof google.spanner.v1.Mutation.Send - * @instance - */ - Send.prototype.queue = ""; - - /** - * Send key. - * @member {google.protobuf.IListValue|null|undefined} key - * @memberof google.spanner.v1.Mutation.Send - * @instance - */ - Send.prototype.key = null; - - /** - * Send deliverTime. - * @member {google.protobuf.ITimestamp|null|undefined} deliverTime - * @memberof google.spanner.v1.Mutation.Send - * @instance - */ - Send.prototype.deliverTime = null; - - /** - * Send payload. - * @member {google.protobuf.IValue|null|undefined} payload - * @memberof google.spanner.v1.Mutation.Send - * @instance - */ - Send.prototype.payload = null; - - /** - * Creates a new Send instance using the specified properties. - * @function create - * @memberof google.spanner.v1.Mutation.Send - * @static - * @param {google.spanner.v1.Mutation.ISend=} [properties] Properties to set - * @returns {google.spanner.v1.Mutation.Send} Send instance - */ - Send.create = function create(properties) { - return new Send(properties); - }; - - /** - * Encodes the specified Send message. Does not implicitly {@link google.spanner.v1.Mutation.Send.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.Mutation.Send - * @static - * @param {google.spanner.v1.Mutation.ISend} message Send message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Send.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.queue != null && Object.hasOwnProperty.call(message, "queue")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.queue); - if (message.key != null && Object.hasOwnProperty.call(message, "key")) - $root.google.protobuf.ListValue.encode(message.key, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.deliverTime != null && Object.hasOwnProperty.call(message, "deliverTime")) - $root.google.protobuf.Timestamp.encode(message.deliverTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.payload != null && Object.hasOwnProperty.call(message, "payload")) - $root.google.protobuf.Value.encode(message.payload, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Send message, length delimited. Does not implicitly {@link google.spanner.v1.Mutation.Send.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.Mutation.Send - * @static - * @param {google.spanner.v1.Mutation.ISend} message Send message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Send.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Send message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.Mutation.Send - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.Mutation.Send} Send - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Send.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.Mutation.Send(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.queue = reader.string(); - break; - } - case 2: { - message.key = $root.google.protobuf.ListValue.decode(reader, reader.uint32()); - break; - } - case 3: { - message.deliverTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 4: { - message.payload = $root.google.protobuf.Value.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Send message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.Mutation.Send - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.Mutation.Send} Send - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Send.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Send message. - * @function verify - * @memberof google.spanner.v1.Mutation.Send - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Send.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.queue != null && message.hasOwnProperty("queue")) - if (!$util.isString(message.queue)) - return "queue: string expected"; - if (message.key != null && message.hasOwnProperty("key")) { - var error = $root.google.protobuf.ListValue.verify(message.key); - if (error) - return "key." + error; - } - if (message.deliverTime != null && message.hasOwnProperty("deliverTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.deliverTime); - if (error) - return "deliverTime." + error; - } - if (message.payload != null && message.hasOwnProperty("payload")) { - var error = $root.google.protobuf.Value.verify(message.payload); - if (error) - return "payload." + error; - } - return null; - }; - - /** - * Creates a Send message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.Mutation.Send - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.Mutation.Send} Send - */ - Send.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.Mutation.Send) - return object; - var message = new $root.google.spanner.v1.Mutation.Send(); - if (object.queue != null) - message.queue = String(object.queue); - if (object.key != null) { - if (typeof object.key !== "object") - throw TypeError(".google.spanner.v1.Mutation.Send.key: object expected"); - message.key = $root.google.protobuf.ListValue.fromObject(object.key); - } - if (object.deliverTime != null) { - if (typeof object.deliverTime !== "object") - throw TypeError(".google.spanner.v1.Mutation.Send.deliverTime: object expected"); - message.deliverTime = $root.google.protobuf.Timestamp.fromObject(object.deliverTime); - } - if (object.payload != null) { - if (typeof object.payload !== "object") - throw TypeError(".google.spanner.v1.Mutation.Send.payload: object expected"); - message.payload = $root.google.protobuf.Value.fromObject(object.payload); - } - return message; - }; - - /** - * Creates a plain object from a Send message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.Mutation.Send - * @static - * @param {google.spanner.v1.Mutation.Send} message Send - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Send.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.queue = ""; - object.key = null; - object.deliverTime = null; - object.payload = null; - } - if (message.queue != null && message.hasOwnProperty("queue")) - object.queue = message.queue; - if (message.key != null && message.hasOwnProperty("key")) - object.key = $root.google.protobuf.ListValue.toObject(message.key, options); - if (message.deliverTime != null && message.hasOwnProperty("deliverTime")) - object.deliverTime = $root.google.protobuf.Timestamp.toObject(message.deliverTime, options); - if (message.payload != null && message.hasOwnProperty("payload")) - object.payload = $root.google.protobuf.Value.toObject(message.payload, options); - return object; - }; - - /** - * Converts this Send to JSON. - * @function toJSON - * @memberof google.spanner.v1.Mutation.Send - * @instance - * @returns {Object.} JSON object - */ - Send.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Send - * @function getTypeUrl - * @memberof google.spanner.v1.Mutation.Send - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Send.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.Mutation.Send"; - }; - - return Send; - })(); - - Mutation.Ack = (function() { - - /** - * Properties of an Ack. - * @memberof google.spanner.v1.Mutation - * @interface IAck - * @property {string|null} [queue] Ack queue - * @property {google.protobuf.IListValue|null} [key] Ack key - * @property {boolean|null} [ignoreNotFound] Ack ignoreNotFound - */ - - /** - * Constructs a new Ack. - * @memberof google.spanner.v1.Mutation - * @classdesc Represents an Ack. - * @implements IAck - * @constructor - * @param {google.spanner.v1.Mutation.IAck=} [properties] Properties to set - */ - function Ack(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Ack queue. - * @member {string} queue - * @memberof google.spanner.v1.Mutation.Ack - * @instance - */ - Ack.prototype.queue = ""; - - /** - * Ack key. - * @member {google.protobuf.IListValue|null|undefined} key - * @memberof google.spanner.v1.Mutation.Ack - * @instance - */ - Ack.prototype.key = null; - - /** - * Ack ignoreNotFound. - * @member {boolean} ignoreNotFound - * @memberof google.spanner.v1.Mutation.Ack - * @instance - */ - Ack.prototype.ignoreNotFound = false; - - /** - * Creates a new Ack instance using the specified properties. - * @function create - * @memberof google.spanner.v1.Mutation.Ack - * @static - * @param {google.spanner.v1.Mutation.IAck=} [properties] Properties to set - * @returns {google.spanner.v1.Mutation.Ack} Ack instance - */ - Ack.create = function create(properties) { - return new Ack(properties); - }; - - /** - * Encodes the specified Ack message. Does not implicitly {@link google.spanner.v1.Mutation.Ack.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.Mutation.Ack - * @static - * @param {google.spanner.v1.Mutation.IAck} message Ack message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Ack.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.queue != null && Object.hasOwnProperty.call(message, "queue")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.queue); - if (message.key != null && Object.hasOwnProperty.call(message, "key")) - $root.google.protobuf.ListValue.encode(message.key, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.ignoreNotFound != null && Object.hasOwnProperty.call(message, "ignoreNotFound")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.ignoreNotFound); - return writer; - }; - - /** - * Encodes the specified Ack message, length delimited. Does not implicitly {@link google.spanner.v1.Mutation.Ack.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.Mutation.Ack - * @static - * @param {google.spanner.v1.Mutation.IAck} message Ack message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Ack.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Ack message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.Mutation.Ack - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.Mutation.Ack} Ack - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Ack.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.Mutation.Ack(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.queue = reader.string(); - break; - } - case 2: { - message.key = $root.google.protobuf.ListValue.decode(reader, reader.uint32()); - break; - } - case 3: { - message.ignoreNotFound = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Ack message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.Mutation.Ack - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.Mutation.Ack} Ack - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Ack.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Ack message. - * @function verify - * @memberof google.spanner.v1.Mutation.Ack - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Ack.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.queue != null && message.hasOwnProperty("queue")) - if (!$util.isString(message.queue)) - return "queue: string expected"; - if (message.key != null && message.hasOwnProperty("key")) { - var error = $root.google.protobuf.ListValue.verify(message.key); - if (error) - return "key." + error; - } - if (message.ignoreNotFound != null && message.hasOwnProperty("ignoreNotFound")) - if (typeof message.ignoreNotFound !== "boolean") - return "ignoreNotFound: boolean expected"; - return null; - }; - - /** - * Creates an Ack message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.Mutation.Ack - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.Mutation.Ack} Ack - */ - Ack.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.Mutation.Ack) - return object; - var message = new $root.google.spanner.v1.Mutation.Ack(); - if (object.queue != null) - message.queue = String(object.queue); - if (object.key != null) { - if (typeof object.key !== "object") - throw TypeError(".google.spanner.v1.Mutation.Ack.key: object expected"); - message.key = $root.google.protobuf.ListValue.fromObject(object.key); - } - if (object.ignoreNotFound != null) - message.ignoreNotFound = Boolean(object.ignoreNotFound); - return message; - }; - - /** - * Creates a plain object from an Ack message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.Mutation.Ack - * @static - * @param {google.spanner.v1.Mutation.Ack} message Ack - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Ack.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.queue = ""; - object.key = null; - object.ignoreNotFound = false; - } - if (message.queue != null && message.hasOwnProperty("queue")) - object.queue = message.queue; - if (message.key != null && message.hasOwnProperty("key")) - object.key = $root.google.protobuf.ListValue.toObject(message.key, options); - if (message.ignoreNotFound != null && message.hasOwnProperty("ignoreNotFound")) - object.ignoreNotFound = message.ignoreNotFound; - return object; - }; - - /** - * Converts this Ack to JSON. - * @function toJSON - * @memberof google.spanner.v1.Mutation.Ack - * @instance - * @returns {Object.} JSON object - */ - Ack.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Ack - * @function getTypeUrl - * @memberof google.spanner.v1.Mutation.Ack - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Ack.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.Mutation.Ack"; - }; - - return Ack; - })(); - - return Mutation; - })(); - - v1.ResultSet = (function() { - - /** - * Properties of a ResultSet. - * @memberof google.spanner.v1 - * @interface IResultSet - * @property {google.spanner.v1.IResultSetMetadata|null} [metadata] ResultSet metadata - * @property {Array.|null} [rows] ResultSet rows - * @property {google.spanner.v1.IResultSetStats|null} [stats] ResultSet stats - * @property {google.spanner.v1.IMultiplexedSessionPrecommitToken|null} [precommitToken] ResultSet precommitToken - * @property {google.spanner.v1.ICacheUpdate|null} [cacheUpdate] ResultSet cacheUpdate - */ - - /** - * Constructs a new ResultSet. - * @memberof google.spanner.v1 - * @classdesc Represents a ResultSet. - * @implements IResultSet - * @constructor - * @param {google.spanner.v1.IResultSet=} [properties] Properties to set - */ - function ResultSet(properties) { - this.rows = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ResultSet metadata. - * @member {google.spanner.v1.IResultSetMetadata|null|undefined} metadata - * @memberof google.spanner.v1.ResultSet - * @instance - */ - ResultSet.prototype.metadata = null; - - /** - * ResultSet rows. - * @member {Array.} rows - * @memberof google.spanner.v1.ResultSet - * @instance - */ - ResultSet.prototype.rows = $util.emptyArray; - - /** - * ResultSet stats. - * @member {google.spanner.v1.IResultSetStats|null|undefined} stats - * @memberof google.spanner.v1.ResultSet - * @instance - */ - ResultSet.prototype.stats = null; - - /** - * ResultSet precommitToken. - * @member {google.spanner.v1.IMultiplexedSessionPrecommitToken|null|undefined} precommitToken - * @memberof google.spanner.v1.ResultSet - * @instance - */ - ResultSet.prototype.precommitToken = null; - - /** - * ResultSet cacheUpdate. - * @member {google.spanner.v1.ICacheUpdate|null|undefined} cacheUpdate - * @memberof google.spanner.v1.ResultSet - * @instance - */ - ResultSet.prototype.cacheUpdate = null; - - /** - * Creates a new ResultSet instance using the specified properties. - * @function create - * @memberof google.spanner.v1.ResultSet - * @static - * @param {google.spanner.v1.IResultSet=} [properties] Properties to set - * @returns {google.spanner.v1.ResultSet} ResultSet instance - */ - ResultSet.create = function create(properties) { - return new ResultSet(properties); - }; - - /** - * Encodes the specified ResultSet message. Does not implicitly {@link google.spanner.v1.ResultSet.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.ResultSet - * @static - * @param {google.spanner.v1.IResultSet} message ResultSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResultSet.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.google.spanner.v1.ResultSetMetadata.encode(message.metadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.rows != null && message.rows.length) - for (var i = 0; i < message.rows.length; ++i) - $root.google.protobuf.ListValue.encode(message.rows[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.stats != null && Object.hasOwnProperty.call(message, "stats")) - $root.google.spanner.v1.ResultSetStats.encode(message.stats, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.precommitToken != null && Object.hasOwnProperty.call(message, "precommitToken")) - $root.google.spanner.v1.MultiplexedSessionPrecommitToken.encode(message.precommitToken, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.cacheUpdate != null && Object.hasOwnProperty.call(message, "cacheUpdate")) - $root.google.spanner.v1.CacheUpdate.encode(message.cacheUpdate, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ResultSet message, length delimited. Does not implicitly {@link google.spanner.v1.ResultSet.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.ResultSet - * @static - * @param {google.spanner.v1.IResultSet} message ResultSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResultSet.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ResultSet message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.ResultSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.ResultSet} ResultSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResultSet.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.ResultSet(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.metadata = $root.google.spanner.v1.ResultSetMetadata.decode(reader, reader.uint32()); - break; - } - case 2: { - if (!(message.rows && message.rows.length)) - message.rows = []; - message.rows.push($root.google.protobuf.ListValue.decode(reader, reader.uint32())); - break; - } - case 3: { - message.stats = $root.google.spanner.v1.ResultSetStats.decode(reader, reader.uint32()); - break; - } - case 5: { - message.precommitToken = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.decode(reader, reader.uint32()); - break; - } - case 6: { - message.cacheUpdate = $root.google.spanner.v1.CacheUpdate.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ResultSet message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.ResultSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.ResultSet} ResultSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResultSet.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ResultSet message. - * @function verify - * @memberof google.spanner.v1.ResultSet - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ResultSet.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.google.spanner.v1.ResultSetMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - if (message.rows != null && message.hasOwnProperty("rows")) { - if (!Array.isArray(message.rows)) - return "rows: array expected"; - for (var i = 0; i < message.rows.length; ++i) { - var error = $root.google.protobuf.ListValue.verify(message.rows[i]); - if (error) - return "rows." + error; - } - } - if (message.stats != null && message.hasOwnProperty("stats")) { - var error = $root.google.spanner.v1.ResultSetStats.verify(message.stats); - if (error) - return "stats." + error; - } - if (message.precommitToken != null && message.hasOwnProperty("precommitToken")) { - var error = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.verify(message.precommitToken); - if (error) - return "precommitToken." + error; - } - if (message.cacheUpdate != null && message.hasOwnProperty("cacheUpdate")) { - var error = $root.google.spanner.v1.CacheUpdate.verify(message.cacheUpdate); - if (error) - return "cacheUpdate." + error; - } - return null; - }; - - /** - * Creates a ResultSet message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.ResultSet - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.ResultSet} ResultSet - */ - ResultSet.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.ResultSet) - return object; - var message = new $root.google.spanner.v1.ResultSet(); - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".google.spanner.v1.ResultSet.metadata: object expected"); - message.metadata = $root.google.spanner.v1.ResultSetMetadata.fromObject(object.metadata); - } - if (object.rows) { - if (!Array.isArray(object.rows)) - throw TypeError(".google.spanner.v1.ResultSet.rows: array expected"); - message.rows = []; - for (var i = 0; i < object.rows.length; ++i) { - if (typeof object.rows[i] !== "object") - throw TypeError(".google.spanner.v1.ResultSet.rows: object expected"); - message.rows[i] = $root.google.protobuf.ListValue.fromObject(object.rows[i]); - } - } - if (object.stats != null) { - if (typeof object.stats !== "object") - throw TypeError(".google.spanner.v1.ResultSet.stats: object expected"); - message.stats = $root.google.spanner.v1.ResultSetStats.fromObject(object.stats); - } - if (object.precommitToken != null) { - if (typeof object.precommitToken !== "object") - throw TypeError(".google.spanner.v1.ResultSet.precommitToken: object expected"); - message.precommitToken = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.fromObject(object.precommitToken); - } - if (object.cacheUpdate != null) { - if (typeof object.cacheUpdate !== "object") - throw TypeError(".google.spanner.v1.ResultSet.cacheUpdate: object expected"); - message.cacheUpdate = $root.google.spanner.v1.CacheUpdate.fromObject(object.cacheUpdate); - } - return message; - }; - - /** - * Creates a plain object from a ResultSet message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.ResultSet - * @static - * @param {google.spanner.v1.ResultSet} message ResultSet - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResultSet.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.rows = []; - if (options.defaults) { - object.metadata = null; - object.stats = null; - object.precommitToken = null; - object.cacheUpdate = null; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.google.spanner.v1.ResultSetMetadata.toObject(message.metadata, options); - if (message.rows && message.rows.length) { - object.rows = []; - for (var j = 0; j < message.rows.length; ++j) - object.rows[j] = $root.google.protobuf.ListValue.toObject(message.rows[j], options); - } - if (message.stats != null && message.hasOwnProperty("stats")) - object.stats = $root.google.spanner.v1.ResultSetStats.toObject(message.stats, options); - if (message.precommitToken != null && message.hasOwnProperty("precommitToken")) - object.precommitToken = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.toObject(message.precommitToken, options); - if (message.cacheUpdate != null && message.hasOwnProperty("cacheUpdate")) - object.cacheUpdate = $root.google.spanner.v1.CacheUpdate.toObject(message.cacheUpdate, options); - return object; - }; - - /** - * Converts this ResultSet to JSON. - * @function toJSON - * @memberof google.spanner.v1.ResultSet - * @instance - * @returns {Object.} JSON object - */ - ResultSet.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ResultSet - * @function getTypeUrl - * @memberof google.spanner.v1.ResultSet - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ResultSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.ResultSet"; - }; - - return ResultSet; - })(); - - v1.PartialResultSet = (function() { - - /** - * Properties of a PartialResultSet. - * @memberof google.spanner.v1 - * @interface IPartialResultSet - * @property {google.spanner.v1.IResultSetMetadata|null} [metadata] PartialResultSet metadata - * @property {Array.|null} [values] PartialResultSet values - * @property {boolean|null} [chunkedValue] PartialResultSet chunkedValue - * @property {Uint8Array|null} [resumeToken] PartialResultSet resumeToken - * @property {google.spanner.v1.IResultSetStats|null} [stats] PartialResultSet stats - * @property {google.spanner.v1.IMultiplexedSessionPrecommitToken|null} [precommitToken] PartialResultSet precommitToken - * @property {boolean|null} [last] PartialResultSet last - * @property {google.spanner.v1.ICacheUpdate|null} [cacheUpdate] PartialResultSet cacheUpdate - */ - - /** - * Constructs a new PartialResultSet. - * @memberof google.spanner.v1 - * @classdesc Represents a PartialResultSet. - * @implements IPartialResultSet - * @constructor - * @param {google.spanner.v1.IPartialResultSet=} [properties] Properties to set - */ - function PartialResultSet(properties) { - this.values = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PartialResultSet metadata. - * @member {google.spanner.v1.IResultSetMetadata|null|undefined} metadata - * @memberof google.spanner.v1.PartialResultSet - * @instance - */ - PartialResultSet.prototype.metadata = null; - - /** - * PartialResultSet values. - * @member {Array.} values - * @memberof google.spanner.v1.PartialResultSet - * @instance - */ - PartialResultSet.prototype.values = $util.emptyArray; - - /** - * PartialResultSet chunkedValue. - * @member {boolean} chunkedValue - * @memberof google.spanner.v1.PartialResultSet - * @instance - */ - PartialResultSet.prototype.chunkedValue = false; - - /** - * PartialResultSet resumeToken. - * @member {Uint8Array} resumeToken - * @memberof google.spanner.v1.PartialResultSet - * @instance - */ - PartialResultSet.prototype.resumeToken = $util.newBuffer([]); - - /** - * PartialResultSet stats. - * @member {google.spanner.v1.IResultSetStats|null|undefined} stats - * @memberof google.spanner.v1.PartialResultSet - * @instance - */ - PartialResultSet.prototype.stats = null; - - /** - * PartialResultSet precommitToken. - * @member {google.spanner.v1.IMultiplexedSessionPrecommitToken|null|undefined} precommitToken - * @memberof google.spanner.v1.PartialResultSet - * @instance - */ - PartialResultSet.prototype.precommitToken = null; - - /** - * PartialResultSet last. - * @member {boolean} last - * @memberof google.spanner.v1.PartialResultSet - * @instance - */ - PartialResultSet.prototype.last = false; - - /** - * PartialResultSet cacheUpdate. - * @member {google.spanner.v1.ICacheUpdate|null|undefined} cacheUpdate - * @memberof google.spanner.v1.PartialResultSet - * @instance - */ - PartialResultSet.prototype.cacheUpdate = null; - - /** - * Creates a new PartialResultSet instance using the specified properties. - * @function create - * @memberof google.spanner.v1.PartialResultSet - * @static - * @param {google.spanner.v1.IPartialResultSet=} [properties] Properties to set - * @returns {google.spanner.v1.PartialResultSet} PartialResultSet instance - */ - PartialResultSet.create = function create(properties) { - return new PartialResultSet(properties); - }; - - /** - * Encodes the specified PartialResultSet message. Does not implicitly {@link google.spanner.v1.PartialResultSet.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.PartialResultSet - * @static - * @param {google.spanner.v1.IPartialResultSet} message PartialResultSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PartialResultSet.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.google.spanner.v1.ResultSetMetadata.encode(message.metadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.values != null && message.values.length) - for (var i = 0; i < message.values.length; ++i) - $root.google.protobuf.Value.encode(message.values[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.chunkedValue != null && Object.hasOwnProperty.call(message, "chunkedValue")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.chunkedValue); - if (message.resumeToken != null && Object.hasOwnProperty.call(message, "resumeToken")) - writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.resumeToken); - if (message.stats != null && Object.hasOwnProperty.call(message, "stats")) - $root.google.spanner.v1.ResultSetStats.encode(message.stats, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.precommitToken != null && Object.hasOwnProperty.call(message, "precommitToken")) - $root.google.spanner.v1.MultiplexedSessionPrecommitToken.encode(message.precommitToken, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.last != null && Object.hasOwnProperty.call(message, "last")) - writer.uint32(/* id 9, wireType 0 =*/72).bool(message.last); - if (message.cacheUpdate != null && Object.hasOwnProperty.call(message, "cacheUpdate")) - $root.google.spanner.v1.CacheUpdate.encode(message.cacheUpdate, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified PartialResultSet message, length delimited. Does not implicitly {@link google.spanner.v1.PartialResultSet.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.PartialResultSet - * @static - * @param {google.spanner.v1.IPartialResultSet} message PartialResultSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PartialResultSet.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PartialResultSet message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.PartialResultSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.PartialResultSet} PartialResultSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PartialResultSet.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.PartialResultSet(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.metadata = $root.google.spanner.v1.ResultSetMetadata.decode(reader, reader.uint32()); - break; - } - case 2: { - if (!(message.values && message.values.length)) - message.values = []; - message.values.push($root.google.protobuf.Value.decode(reader, reader.uint32())); - break; - } - case 3: { - message.chunkedValue = reader.bool(); - break; - } - case 4: { - message.resumeToken = reader.bytes(); - break; - } - case 5: { - message.stats = $root.google.spanner.v1.ResultSetStats.decode(reader, reader.uint32()); - break; - } - case 8: { - message.precommitToken = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.decode(reader, reader.uint32()); - break; - } - case 9: { - message.last = reader.bool(); - break; - } - case 10: { - message.cacheUpdate = $root.google.spanner.v1.CacheUpdate.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PartialResultSet message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.PartialResultSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.PartialResultSet} PartialResultSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PartialResultSet.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PartialResultSet message. - * @function verify - * @memberof google.spanner.v1.PartialResultSet - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PartialResultSet.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.google.spanner.v1.ResultSetMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - if (message.values != null && message.hasOwnProperty("values")) { - if (!Array.isArray(message.values)) - return "values: array expected"; - for (var i = 0; i < message.values.length; ++i) { - var error = $root.google.protobuf.Value.verify(message.values[i]); - if (error) - return "values." + error; - } - } - if (message.chunkedValue != null && message.hasOwnProperty("chunkedValue")) - if (typeof message.chunkedValue !== "boolean") - return "chunkedValue: boolean expected"; - if (message.resumeToken != null && message.hasOwnProperty("resumeToken")) - if (!(message.resumeToken && typeof message.resumeToken.length === "number" || $util.isString(message.resumeToken))) - return "resumeToken: buffer expected"; - if (message.stats != null && message.hasOwnProperty("stats")) { - var error = $root.google.spanner.v1.ResultSetStats.verify(message.stats); - if (error) - return "stats." + error; - } - if (message.precommitToken != null && message.hasOwnProperty("precommitToken")) { - var error = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.verify(message.precommitToken); - if (error) - return "precommitToken." + error; - } - if (message.last != null && message.hasOwnProperty("last")) - if (typeof message.last !== "boolean") - return "last: boolean expected"; - if (message.cacheUpdate != null && message.hasOwnProperty("cacheUpdate")) { - var error = $root.google.spanner.v1.CacheUpdate.verify(message.cacheUpdate); - if (error) - return "cacheUpdate." + error; - } - return null; - }; - - /** - * Creates a PartialResultSet message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.PartialResultSet - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.PartialResultSet} PartialResultSet - */ - PartialResultSet.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.PartialResultSet) - return object; - var message = new $root.google.spanner.v1.PartialResultSet(); - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".google.spanner.v1.PartialResultSet.metadata: object expected"); - message.metadata = $root.google.spanner.v1.ResultSetMetadata.fromObject(object.metadata); - } - if (object.values) { - if (!Array.isArray(object.values)) - throw TypeError(".google.spanner.v1.PartialResultSet.values: array expected"); - message.values = []; - for (var i = 0; i < object.values.length; ++i) { - if (typeof object.values[i] !== "object") - throw TypeError(".google.spanner.v1.PartialResultSet.values: object expected"); - message.values[i] = $root.google.protobuf.Value.fromObject(object.values[i]); - } - } - if (object.chunkedValue != null) - message.chunkedValue = Boolean(object.chunkedValue); - if (object.resumeToken != null) - if (typeof object.resumeToken === "string") - $util.base64.decode(object.resumeToken, message.resumeToken = $util.newBuffer($util.base64.length(object.resumeToken)), 0); - else if (object.resumeToken.length >= 0) - message.resumeToken = object.resumeToken; - if (object.stats != null) { - if (typeof object.stats !== "object") - throw TypeError(".google.spanner.v1.PartialResultSet.stats: object expected"); - message.stats = $root.google.spanner.v1.ResultSetStats.fromObject(object.stats); - } - if (object.precommitToken != null) { - if (typeof object.precommitToken !== "object") - throw TypeError(".google.spanner.v1.PartialResultSet.precommitToken: object expected"); - message.precommitToken = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.fromObject(object.precommitToken); - } - if (object.last != null) - message.last = Boolean(object.last); - if (object.cacheUpdate != null) { - if (typeof object.cacheUpdate !== "object") - throw TypeError(".google.spanner.v1.PartialResultSet.cacheUpdate: object expected"); - message.cacheUpdate = $root.google.spanner.v1.CacheUpdate.fromObject(object.cacheUpdate); - } - return message; - }; - - /** - * Creates a plain object from a PartialResultSet message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.PartialResultSet - * @static - * @param {google.spanner.v1.PartialResultSet} message PartialResultSet - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PartialResultSet.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.values = []; - if (options.defaults) { - object.metadata = null; - object.chunkedValue = false; - if (options.bytes === String) - object.resumeToken = ""; - else { - object.resumeToken = []; - if (options.bytes !== Array) - object.resumeToken = $util.newBuffer(object.resumeToken); - } - object.stats = null; - object.precommitToken = null; - object.last = false; - object.cacheUpdate = null; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.google.spanner.v1.ResultSetMetadata.toObject(message.metadata, options); - if (message.values && message.values.length) { - object.values = []; - for (var j = 0; j < message.values.length; ++j) - object.values[j] = $root.google.protobuf.Value.toObject(message.values[j], options); - } - if (message.chunkedValue != null && message.hasOwnProperty("chunkedValue")) - object.chunkedValue = message.chunkedValue; - if (message.resumeToken != null && message.hasOwnProperty("resumeToken")) - object.resumeToken = options.bytes === String ? $util.base64.encode(message.resumeToken, 0, message.resumeToken.length) : options.bytes === Array ? Array.prototype.slice.call(message.resumeToken) : message.resumeToken; - if (message.stats != null && message.hasOwnProperty("stats")) - object.stats = $root.google.spanner.v1.ResultSetStats.toObject(message.stats, options); - if (message.precommitToken != null && message.hasOwnProperty("precommitToken")) - object.precommitToken = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.toObject(message.precommitToken, options); - if (message.last != null && message.hasOwnProperty("last")) - object.last = message.last; - if (message.cacheUpdate != null && message.hasOwnProperty("cacheUpdate")) - object.cacheUpdate = $root.google.spanner.v1.CacheUpdate.toObject(message.cacheUpdate, options); - return object; - }; - - /** - * Converts this PartialResultSet to JSON. - * @function toJSON - * @memberof google.spanner.v1.PartialResultSet - * @instance - * @returns {Object.} JSON object - */ - PartialResultSet.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PartialResultSet - * @function getTypeUrl - * @memberof google.spanner.v1.PartialResultSet - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PartialResultSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.PartialResultSet"; - }; - - return PartialResultSet; - })(); - - v1.ResultSetMetadata = (function() { - - /** - * Properties of a ResultSetMetadata. - * @memberof google.spanner.v1 - * @interface IResultSetMetadata - * @property {google.spanner.v1.IStructType|null} [rowType] ResultSetMetadata rowType - * @property {google.spanner.v1.ITransaction|null} [transaction] ResultSetMetadata transaction - * @property {google.spanner.v1.IStructType|null} [undeclaredParameters] ResultSetMetadata undeclaredParameters - */ - - /** - * Constructs a new ResultSetMetadata. - * @memberof google.spanner.v1 - * @classdesc Represents a ResultSetMetadata. - * @implements IResultSetMetadata - * @constructor - * @param {google.spanner.v1.IResultSetMetadata=} [properties] Properties to set - */ - function ResultSetMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ResultSetMetadata rowType. - * @member {google.spanner.v1.IStructType|null|undefined} rowType - * @memberof google.spanner.v1.ResultSetMetadata - * @instance - */ - ResultSetMetadata.prototype.rowType = null; - - /** - * ResultSetMetadata transaction. - * @member {google.spanner.v1.ITransaction|null|undefined} transaction - * @memberof google.spanner.v1.ResultSetMetadata - * @instance - */ - ResultSetMetadata.prototype.transaction = null; - - /** - * ResultSetMetadata undeclaredParameters. - * @member {google.spanner.v1.IStructType|null|undefined} undeclaredParameters - * @memberof google.spanner.v1.ResultSetMetadata - * @instance - */ - ResultSetMetadata.prototype.undeclaredParameters = null; - - /** - * Creates a new ResultSetMetadata instance using the specified properties. - * @function create - * @memberof google.spanner.v1.ResultSetMetadata - * @static - * @param {google.spanner.v1.IResultSetMetadata=} [properties] Properties to set - * @returns {google.spanner.v1.ResultSetMetadata} ResultSetMetadata instance - */ - ResultSetMetadata.create = function create(properties) { - return new ResultSetMetadata(properties); - }; - - /** - * Encodes the specified ResultSetMetadata message. Does not implicitly {@link google.spanner.v1.ResultSetMetadata.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.ResultSetMetadata - * @static - * @param {google.spanner.v1.IResultSetMetadata} message ResultSetMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResultSetMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.rowType != null && Object.hasOwnProperty.call(message, "rowType")) - $root.google.spanner.v1.StructType.encode(message.rowType, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.transaction != null && Object.hasOwnProperty.call(message, "transaction")) - $root.google.spanner.v1.Transaction.encode(message.transaction, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.undeclaredParameters != null && Object.hasOwnProperty.call(message, "undeclaredParameters")) - $root.google.spanner.v1.StructType.encode(message.undeclaredParameters, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ResultSetMetadata message, length delimited. Does not implicitly {@link google.spanner.v1.ResultSetMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.ResultSetMetadata - * @static - * @param {google.spanner.v1.IResultSetMetadata} message ResultSetMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResultSetMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ResultSetMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.ResultSetMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.ResultSetMetadata} ResultSetMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResultSetMetadata.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.ResultSetMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.rowType = $root.google.spanner.v1.StructType.decode(reader, reader.uint32()); - break; - } - case 2: { - message.transaction = $root.google.spanner.v1.Transaction.decode(reader, reader.uint32()); - break; - } - case 3: { - message.undeclaredParameters = $root.google.spanner.v1.StructType.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ResultSetMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.ResultSetMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.ResultSetMetadata} ResultSetMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResultSetMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ResultSetMetadata message. - * @function verify - * @memberof google.spanner.v1.ResultSetMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ResultSetMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.rowType != null && message.hasOwnProperty("rowType")) { - var error = $root.google.spanner.v1.StructType.verify(message.rowType); - if (error) - return "rowType." + error; - } - if (message.transaction != null && message.hasOwnProperty("transaction")) { - var error = $root.google.spanner.v1.Transaction.verify(message.transaction); - if (error) - return "transaction." + error; - } - if (message.undeclaredParameters != null && message.hasOwnProperty("undeclaredParameters")) { - var error = $root.google.spanner.v1.StructType.verify(message.undeclaredParameters); - if (error) - return "undeclaredParameters." + error; - } - return null; - }; - - /** - * Creates a ResultSetMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.ResultSetMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.ResultSetMetadata} ResultSetMetadata - */ - ResultSetMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.ResultSetMetadata) - return object; - var message = new $root.google.spanner.v1.ResultSetMetadata(); - if (object.rowType != null) { - if (typeof object.rowType !== "object") - throw TypeError(".google.spanner.v1.ResultSetMetadata.rowType: object expected"); - message.rowType = $root.google.spanner.v1.StructType.fromObject(object.rowType); - } - if (object.transaction != null) { - if (typeof object.transaction !== "object") - throw TypeError(".google.spanner.v1.ResultSetMetadata.transaction: object expected"); - message.transaction = $root.google.spanner.v1.Transaction.fromObject(object.transaction); - } - if (object.undeclaredParameters != null) { - if (typeof object.undeclaredParameters !== "object") - throw TypeError(".google.spanner.v1.ResultSetMetadata.undeclaredParameters: object expected"); - message.undeclaredParameters = $root.google.spanner.v1.StructType.fromObject(object.undeclaredParameters); - } - return message; - }; - - /** - * Creates a plain object from a ResultSetMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.ResultSetMetadata - * @static - * @param {google.spanner.v1.ResultSetMetadata} message ResultSetMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResultSetMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.rowType = null; - object.transaction = null; - object.undeclaredParameters = null; - } - if (message.rowType != null && message.hasOwnProperty("rowType")) - object.rowType = $root.google.spanner.v1.StructType.toObject(message.rowType, options); - if (message.transaction != null && message.hasOwnProperty("transaction")) - object.transaction = $root.google.spanner.v1.Transaction.toObject(message.transaction, options); - if (message.undeclaredParameters != null && message.hasOwnProperty("undeclaredParameters")) - object.undeclaredParameters = $root.google.spanner.v1.StructType.toObject(message.undeclaredParameters, options); - return object; - }; - - /** - * Converts this ResultSetMetadata to JSON. - * @function toJSON - * @memberof google.spanner.v1.ResultSetMetadata - * @instance - * @returns {Object.} JSON object - */ - ResultSetMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ResultSetMetadata - * @function getTypeUrl - * @memberof google.spanner.v1.ResultSetMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ResultSetMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.ResultSetMetadata"; - }; - - return ResultSetMetadata; - })(); - - v1.ResultSetStats = (function() { - - /** - * Properties of a ResultSetStats. - * @memberof google.spanner.v1 - * @interface IResultSetStats - * @property {google.spanner.v1.IQueryPlan|null} [queryPlan] ResultSetStats queryPlan - * @property {google.protobuf.IStruct|null} [queryStats] ResultSetStats queryStats - * @property {number|Long|null} [rowCountExact] ResultSetStats rowCountExact - * @property {number|Long|null} [rowCountLowerBound] ResultSetStats rowCountLowerBound - */ - - /** - * Constructs a new ResultSetStats. - * @memberof google.spanner.v1 - * @classdesc Represents a ResultSetStats. - * @implements IResultSetStats - * @constructor - * @param {google.spanner.v1.IResultSetStats=} [properties] Properties to set - */ - function ResultSetStats(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ResultSetStats queryPlan. - * @member {google.spanner.v1.IQueryPlan|null|undefined} queryPlan - * @memberof google.spanner.v1.ResultSetStats - * @instance - */ - ResultSetStats.prototype.queryPlan = null; - - /** - * ResultSetStats queryStats. - * @member {google.protobuf.IStruct|null|undefined} queryStats - * @memberof google.spanner.v1.ResultSetStats - * @instance - */ - ResultSetStats.prototype.queryStats = null; - - /** - * ResultSetStats rowCountExact. - * @member {number|Long|null|undefined} rowCountExact - * @memberof google.spanner.v1.ResultSetStats - * @instance - */ - ResultSetStats.prototype.rowCountExact = null; - - /** - * ResultSetStats rowCountLowerBound. - * @member {number|Long|null|undefined} rowCountLowerBound - * @memberof google.spanner.v1.ResultSetStats - * @instance - */ - ResultSetStats.prototype.rowCountLowerBound = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * ResultSetStats rowCount. - * @member {"rowCountExact"|"rowCountLowerBound"|undefined} rowCount - * @memberof google.spanner.v1.ResultSetStats - * @instance - */ - Object.defineProperty(ResultSetStats.prototype, "rowCount", { - get: $util.oneOfGetter($oneOfFields = ["rowCountExact", "rowCountLowerBound"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new ResultSetStats instance using the specified properties. - * @function create - * @memberof google.spanner.v1.ResultSetStats - * @static - * @param {google.spanner.v1.IResultSetStats=} [properties] Properties to set - * @returns {google.spanner.v1.ResultSetStats} ResultSetStats instance - */ - ResultSetStats.create = function create(properties) { - return new ResultSetStats(properties); - }; - - /** - * Encodes the specified ResultSetStats message. Does not implicitly {@link google.spanner.v1.ResultSetStats.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.ResultSetStats - * @static - * @param {google.spanner.v1.IResultSetStats} message ResultSetStats message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResultSetStats.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.queryPlan != null && Object.hasOwnProperty.call(message, "queryPlan")) - $root.google.spanner.v1.QueryPlan.encode(message.queryPlan, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.queryStats != null && Object.hasOwnProperty.call(message, "queryStats")) - $root.google.protobuf.Struct.encode(message.queryStats, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.rowCountExact != null && Object.hasOwnProperty.call(message, "rowCountExact")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.rowCountExact); - if (message.rowCountLowerBound != null && Object.hasOwnProperty.call(message, "rowCountLowerBound")) - writer.uint32(/* id 4, wireType 0 =*/32).int64(message.rowCountLowerBound); - return writer; - }; - - /** - * Encodes the specified ResultSetStats message, length delimited. Does not implicitly {@link google.spanner.v1.ResultSetStats.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.ResultSetStats - * @static - * @param {google.spanner.v1.IResultSetStats} message ResultSetStats message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResultSetStats.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ResultSetStats message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.ResultSetStats - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.ResultSetStats} ResultSetStats - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResultSetStats.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.ResultSetStats(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.queryPlan = $root.google.spanner.v1.QueryPlan.decode(reader, reader.uint32()); - break; - } - case 2: { - message.queryStats = $root.google.protobuf.Struct.decode(reader, reader.uint32()); - break; - } - case 3: { - message.rowCountExact = reader.int64(); - break; - } - case 4: { - message.rowCountLowerBound = reader.int64(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ResultSetStats message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.ResultSetStats - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.ResultSetStats} ResultSetStats - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResultSetStats.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ResultSetStats message. - * @function verify - * @memberof google.spanner.v1.ResultSetStats - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ResultSetStats.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.queryPlan != null && message.hasOwnProperty("queryPlan")) { - var error = $root.google.spanner.v1.QueryPlan.verify(message.queryPlan); - if (error) - return "queryPlan." + error; - } - if (message.queryStats != null && message.hasOwnProperty("queryStats")) { - var error = $root.google.protobuf.Struct.verify(message.queryStats); - if (error) - return "queryStats." + error; - } - if (message.rowCountExact != null && message.hasOwnProperty("rowCountExact")) { - properties.rowCount = 1; - if (!$util.isInteger(message.rowCountExact) && !(message.rowCountExact && $util.isInteger(message.rowCountExact.low) && $util.isInteger(message.rowCountExact.high))) - return "rowCountExact: integer|Long expected"; - } - if (message.rowCountLowerBound != null && message.hasOwnProperty("rowCountLowerBound")) { - if (properties.rowCount === 1) - return "rowCount: multiple values"; - properties.rowCount = 1; - if (!$util.isInteger(message.rowCountLowerBound) && !(message.rowCountLowerBound && $util.isInteger(message.rowCountLowerBound.low) && $util.isInteger(message.rowCountLowerBound.high))) - return "rowCountLowerBound: integer|Long expected"; - } - return null; - }; - - /** - * Creates a ResultSetStats message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.ResultSetStats - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.ResultSetStats} ResultSetStats - */ - ResultSetStats.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.ResultSetStats) - return object; - var message = new $root.google.spanner.v1.ResultSetStats(); - if (object.queryPlan != null) { - if (typeof object.queryPlan !== "object") - throw TypeError(".google.spanner.v1.ResultSetStats.queryPlan: object expected"); - message.queryPlan = $root.google.spanner.v1.QueryPlan.fromObject(object.queryPlan); - } - if (object.queryStats != null) { - if (typeof object.queryStats !== "object") - throw TypeError(".google.spanner.v1.ResultSetStats.queryStats: object expected"); - message.queryStats = $root.google.protobuf.Struct.fromObject(object.queryStats); - } - if (object.rowCountExact != null) - if ($util.Long) - (message.rowCountExact = $util.Long.fromValue(object.rowCountExact)).unsigned = false; - else if (typeof object.rowCountExact === "string") - message.rowCountExact = parseInt(object.rowCountExact, 10); - else if (typeof object.rowCountExact === "number") - message.rowCountExact = object.rowCountExact; - else if (typeof object.rowCountExact === "object") - message.rowCountExact = new $util.LongBits(object.rowCountExact.low >>> 0, object.rowCountExact.high >>> 0).toNumber(); - if (object.rowCountLowerBound != null) - if ($util.Long) - (message.rowCountLowerBound = $util.Long.fromValue(object.rowCountLowerBound)).unsigned = false; - else if (typeof object.rowCountLowerBound === "string") - message.rowCountLowerBound = parseInt(object.rowCountLowerBound, 10); - else if (typeof object.rowCountLowerBound === "number") - message.rowCountLowerBound = object.rowCountLowerBound; - else if (typeof object.rowCountLowerBound === "object") - message.rowCountLowerBound = new $util.LongBits(object.rowCountLowerBound.low >>> 0, object.rowCountLowerBound.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from a ResultSetStats message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.ResultSetStats - * @static - * @param {google.spanner.v1.ResultSetStats} message ResultSetStats - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResultSetStats.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.queryPlan = null; - object.queryStats = null; - } - if (message.queryPlan != null && message.hasOwnProperty("queryPlan")) - object.queryPlan = $root.google.spanner.v1.QueryPlan.toObject(message.queryPlan, options); - if (message.queryStats != null && message.hasOwnProperty("queryStats")) - object.queryStats = $root.google.protobuf.Struct.toObject(message.queryStats, options); - if (message.rowCountExact != null && message.hasOwnProperty("rowCountExact")) { - if (typeof message.rowCountExact === "number") - object.rowCountExact = options.longs === String ? String(message.rowCountExact) : message.rowCountExact; - else - object.rowCountExact = options.longs === String ? $util.Long.prototype.toString.call(message.rowCountExact) : options.longs === Number ? new $util.LongBits(message.rowCountExact.low >>> 0, message.rowCountExact.high >>> 0).toNumber() : message.rowCountExact; - if (options.oneofs) - object.rowCount = "rowCountExact"; - } - if (message.rowCountLowerBound != null && message.hasOwnProperty("rowCountLowerBound")) { - if (typeof message.rowCountLowerBound === "number") - object.rowCountLowerBound = options.longs === String ? String(message.rowCountLowerBound) : message.rowCountLowerBound; - else - object.rowCountLowerBound = options.longs === String ? $util.Long.prototype.toString.call(message.rowCountLowerBound) : options.longs === Number ? new $util.LongBits(message.rowCountLowerBound.low >>> 0, message.rowCountLowerBound.high >>> 0).toNumber() : message.rowCountLowerBound; - if (options.oneofs) - object.rowCount = "rowCountLowerBound"; - } - return object; - }; - - /** - * Converts this ResultSetStats to JSON. - * @function toJSON - * @memberof google.spanner.v1.ResultSetStats - * @instance - * @returns {Object.} JSON object - */ - ResultSetStats.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ResultSetStats - * @function getTypeUrl - * @memberof google.spanner.v1.ResultSetStats - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ResultSetStats.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.ResultSetStats"; - }; - - return ResultSetStats; - })(); - - v1.PlanNode = (function() { - - /** - * Properties of a PlanNode. - * @memberof google.spanner.v1 - * @interface IPlanNode - * @property {number|null} [index] PlanNode index - * @property {google.spanner.v1.PlanNode.Kind|null} [kind] PlanNode kind - * @property {string|null} [displayName] PlanNode displayName - * @property {Array.|null} [childLinks] PlanNode childLinks - * @property {google.spanner.v1.PlanNode.IShortRepresentation|null} [shortRepresentation] PlanNode shortRepresentation - * @property {google.protobuf.IStruct|null} [metadata] PlanNode metadata - * @property {google.protobuf.IStruct|null} [executionStats] PlanNode executionStats - */ - - /** - * Constructs a new PlanNode. - * @memberof google.spanner.v1 - * @classdesc Represents a PlanNode. - * @implements IPlanNode - * @constructor - * @param {google.spanner.v1.IPlanNode=} [properties] Properties to set - */ - function PlanNode(properties) { - this.childLinks = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PlanNode index. - * @member {number} index - * @memberof google.spanner.v1.PlanNode - * @instance - */ - PlanNode.prototype.index = 0; - - /** - * PlanNode kind. - * @member {google.spanner.v1.PlanNode.Kind} kind - * @memberof google.spanner.v1.PlanNode - * @instance - */ - PlanNode.prototype.kind = 0; - - /** - * PlanNode displayName. - * @member {string} displayName - * @memberof google.spanner.v1.PlanNode - * @instance - */ - PlanNode.prototype.displayName = ""; - - /** - * PlanNode childLinks. - * @member {Array.} childLinks - * @memberof google.spanner.v1.PlanNode - * @instance - */ - PlanNode.prototype.childLinks = $util.emptyArray; - - /** - * PlanNode shortRepresentation. - * @member {google.spanner.v1.PlanNode.IShortRepresentation|null|undefined} shortRepresentation - * @memberof google.spanner.v1.PlanNode - * @instance - */ - PlanNode.prototype.shortRepresentation = null; - - /** - * PlanNode metadata. - * @member {google.protobuf.IStruct|null|undefined} metadata - * @memberof google.spanner.v1.PlanNode - * @instance - */ - PlanNode.prototype.metadata = null; - - /** - * PlanNode executionStats. - * @member {google.protobuf.IStruct|null|undefined} executionStats - * @memberof google.spanner.v1.PlanNode - * @instance - */ - PlanNode.prototype.executionStats = null; - - /** - * Creates a new PlanNode instance using the specified properties. - * @function create - * @memberof google.spanner.v1.PlanNode - * @static - * @param {google.spanner.v1.IPlanNode=} [properties] Properties to set - * @returns {google.spanner.v1.PlanNode} PlanNode instance - */ - PlanNode.create = function create(properties) { - return new PlanNode(properties); - }; - - /** - * Encodes the specified PlanNode message. Does not implicitly {@link google.spanner.v1.PlanNode.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.PlanNode - * @static - * @param {google.spanner.v1.IPlanNode} message PlanNode message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PlanNode.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.index != null && Object.hasOwnProperty.call(message, "index")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.index); - if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.kind); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.displayName); - if (message.childLinks != null && message.childLinks.length) - for (var i = 0; i < message.childLinks.length; ++i) - $root.google.spanner.v1.PlanNode.ChildLink.encode(message.childLinks[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.shortRepresentation != null && Object.hasOwnProperty.call(message, "shortRepresentation")) - $root.google.spanner.v1.PlanNode.ShortRepresentation.encode(message.shortRepresentation, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.google.protobuf.Struct.encode(message.metadata, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.executionStats != null && Object.hasOwnProperty.call(message, "executionStats")) - $root.google.protobuf.Struct.encode(message.executionStats, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified PlanNode message, length delimited. Does not implicitly {@link google.spanner.v1.PlanNode.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.PlanNode - * @static - * @param {google.spanner.v1.IPlanNode} message PlanNode message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PlanNode.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PlanNode message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.PlanNode - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.PlanNode} PlanNode - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PlanNode.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.PlanNode(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.index = reader.int32(); - break; - } - case 2: { - message.kind = reader.int32(); - break; - } - case 3: { - message.displayName = reader.string(); - break; - } - case 4: { - if (!(message.childLinks && message.childLinks.length)) - message.childLinks = []; - message.childLinks.push($root.google.spanner.v1.PlanNode.ChildLink.decode(reader, reader.uint32())); - break; - } - case 5: { - message.shortRepresentation = $root.google.spanner.v1.PlanNode.ShortRepresentation.decode(reader, reader.uint32()); - break; - } - case 6: { - message.metadata = $root.google.protobuf.Struct.decode(reader, reader.uint32()); - break; - } - case 7: { - message.executionStats = $root.google.protobuf.Struct.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PlanNode message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.PlanNode - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.PlanNode} PlanNode - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PlanNode.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PlanNode message. - * @function verify - * @memberof google.spanner.v1.PlanNode - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PlanNode.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.index != null && message.hasOwnProperty("index")) - if (!$util.isInteger(message.index)) - return "index: integer expected"; - if (message.kind != null && message.hasOwnProperty("kind")) - switch (message.kind) { - default: - return "kind: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.childLinks != null && message.hasOwnProperty("childLinks")) { - if (!Array.isArray(message.childLinks)) - return "childLinks: array expected"; - for (var i = 0; i < message.childLinks.length; ++i) { - var error = $root.google.spanner.v1.PlanNode.ChildLink.verify(message.childLinks[i]); - if (error) - return "childLinks." + error; - } - } - if (message.shortRepresentation != null && message.hasOwnProperty("shortRepresentation")) { - var error = $root.google.spanner.v1.PlanNode.ShortRepresentation.verify(message.shortRepresentation); - if (error) - return "shortRepresentation." + error; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.google.protobuf.Struct.verify(message.metadata); - if (error) - return "metadata." + error; - } - if (message.executionStats != null && message.hasOwnProperty("executionStats")) { - var error = $root.google.protobuf.Struct.verify(message.executionStats); - if (error) - return "executionStats." + error; - } - return null; - }; - - /** - * Creates a PlanNode message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.PlanNode - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.PlanNode} PlanNode - */ - PlanNode.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.PlanNode) - return object; - var message = new $root.google.spanner.v1.PlanNode(); - if (object.index != null) - message.index = object.index | 0; - switch (object.kind) { - default: - if (typeof object.kind === "number") { - message.kind = object.kind; - break; - } - break; - case "KIND_UNSPECIFIED": - case 0: - message.kind = 0; - break; - case "RELATIONAL": - case 1: - message.kind = 1; - break; - case "SCALAR": - case 2: - message.kind = 2; - break; - } - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.childLinks) { - if (!Array.isArray(object.childLinks)) - throw TypeError(".google.spanner.v1.PlanNode.childLinks: array expected"); - message.childLinks = []; - for (var i = 0; i < object.childLinks.length; ++i) { - if (typeof object.childLinks[i] !== "object") - throw TypeError(".google.spanner.v1.PlanNode.childLinks: object expected"); - message.childLinks[i] = $root.google.spanner.v1.PlanNode.ChildLink.fromObject(object.childLinks[i]); - } - } - if (object.shortRepresentation != null) { - if (typeof object.shortRepresentation !== "object") - throw TypeError(".google.spanner.v1.PlanNode.shortRepresentation: object expected"); - message.shortRepresentation = $root.google.spanner.v1.PlanNode.ShortRepresentation.fromObject(object.shortRepresentation); - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".google.spanner.v1.PlanNode.metadata: object expected"); - message.metadata = $root.google.protobuf.Struct.fromObject(object.metadata); - } - if (object.executionStats != null) { - if (typeof object.executionStats !== "object") - throw TypeError(".google.spanner.v1.PlanNode.executionStats: object expected"); - message.executionStats = $root.google.protobuf.Struct.fromObject(object.executionStats); - } - return message; - }; - - /** - * Creates a plain object from a PlanNode message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.PlanNode - * @static - * @param {google.spanner.v1.PlanNode} message PlanNode - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PlanNode.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.childLinks = []; - if (options.defaults) { - object.index = 0; - object.kind = options.enums === String ? "KIND_UNSPECIFIED" : 0; - object.displayName = ""; - object.shortRepresentation = null; - object.metadata = null; - object.executionStats = null; - } - if (message.index != null && message.hasOwnProperty("index")) - object.index = message.index; - if (message.kind != null && message.hasOwnProperty("kind")) - object.kind = options.enums === String ? $root.google.spanner.v1.PlanNode.Kind[message.kind] === undefined ? message.kind : $root.google.spanner.v1.PlanNode.Kind[message.kind] : message.kind; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.childLinks && message.childLinks.length) { - object.childLinks = []; - for (var j = 0; j < message.childLinks.length; ++j) - object.childLinks[j] = $root.google.spanner.v1.PlanNode.ChildLink.toObject(message.childLinks[j], options); - } - if (message.shortRepresentation != null && message.hasOwnProperty("shortRepresentation")) - object.shortRepresentation = $root.google.spanner.v1.PlanNode.ShortRepresentation.toObject(message.shortRepresentation, options); - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.google.protobuf.Struct.toObject(message.metadata, options); - if (message.executionStats != null && message.hasOwnProperty("executionStats")) - object.executionStats = $root.google.protobuf.Struct.toObject(message.executionStats, options); - return object; - }; - - /** - * Converts this PlanNode to JSON. - * @function toJSON - * @memberof google.spanner.v1.PlanNode - * @instance - * @returns {Object.} JSON object - */ - PlanNode.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PlanNode - * @function getTypeUrl - * @memberof google.spanner.v1.PlanNode - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PlanNode.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.PlanNode"; - }; - - /** - * Kind enum. - * @name google.spanner.v1.PlanNode.Kind - * @enum {number} - * @property {number} KIND_UNSPECIFIED=0 KIND_UNSPECIFIED value - * @property {number} RELATIONAL=1 RELATIONAL value - * @property {number} SCALAR=2 SCALAR value - */ - PlanNode.Kind = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "KIND_UNSPECIFIED"] = 0; - values[valuesById[1] = "RELATIONAL"] = 1; - values[valuesById[2] = "SCALAR"] = 2; - return values; - })(); - - PlanNode.ChildLink = (function() { - - /** - * Properties of a ChildLink. - * @memberof google.spanner.v1.PlanNode - * @interface IChildLink - * @property {number|null} [childIndex] ChildLink childIndex - * @property {string|null} [type] ChildLink type - * @property {string|null} [variable] ChildLink variable - */ - - /** - * Constructs a new ChildLink. - * @memberof google.spanner.v1.PlanNode - * @classdesc Represents a ChildLink. - * @implements IChildLink - * @constructor - * @param {google.spanner.v1.PlanNode.IChildLink=} [properties] Properties to set - */ - function ChildLink(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ChildLink childIndex. - * @member {number} childIndex - * @memberof google.spanner.v1.PlanNode.ChildLink - * @instance - */ - ChildLink.prototype.childIndex = 0; - - /** - * ChildLink type. - * @member {string} type - * @memberof google.spanner.v1.PlanNode.ChildLink - * @instance - */ - ChildLink.prototype.type = ""; - - /** - * ChildLink variable. - * @member {string} variable - * @memberof google.spanner.v1.PlanNode.ChildLink - * @instance - */ - ChildLink.prototype.variable = ""; - - /** - * Creates a new ChildLink instance using the specified properties. - * @function create - * @memberof google.spanner.v1.PlanNode.ChildLink - * @static - * @param {google.spanner.v1.PlanNode.IChildLink=} [properties] Properties to set - * @returns {google.spanner.v1.PlanNode.ChildLink} ChildLink instance - */ - ChildLink.create = function create(properties) { - return new ChildLink(properties); - }; - - /** - * Encodes the specified ChildLink message. Does not implicitly {@link google.spanner.v1.PlanNode.ChildLink.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.PlanNode.ChildLink - * @static - * @param {google.spanner.v1.PlanNode.IChildLink} message ChildLink message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ChildLink.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.childIndex != null && Object.hasOwnProperty.call(message, "childIndex")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.childIndex); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.type); - if (message.variable != null && Object.hasOwnProperty.call(message, "variable")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.variable); - return writer; - }; - - /** - * Encodes the specified ChildLink message, length delimited. Does not implicitly {@link google.spanner.v1.PlanNode.ChildLink.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.PlanNode.ChildLink - * @static - * @param {google.spanner.v1.PlanNode.IChildLink} message ChildLink message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ChildLink.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ChildLink message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.PlanNode.ChildLink - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.PlanNode.ChildLink} ChildLink - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ChildLink.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.PlanNode.ChildLink(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.childIndex = reader.int32(); - break; - } - case 2: { - message.type = reader.string(); - break; - } - case 3: { - message.variable = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ChildLink message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.PlanNode.ChildLink - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.PlanNode.ChildLink} ChildLink - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ChildLink.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ChildLink message. - * @function verify - * @memberof google.spanner.v1.PlanNode.ChildLink - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ChildLink.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.childIndex != null && message.hasOwnProperty("childIndex")) - if (!$util.isInteger(message.childIndex)) - return "childIndex: integer expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.variable != null && message.hasOwnProperty("variable")) - if (!$util.isString(message.variable)) - return "variable: string expected"; - return null; - }; - - /** - * Creates a ChildLink message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.PlanNode.ChildLink - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.PlanNode.ChildLink} ChildLink - */ - ChildLink.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.PlanNode.ChildLink) - return object; - var message = new $root.google.spanner.v1.PlanNode.ChildLink(); - if (object.childIndex != null) - message.childIndex = object.childIndex | 0; - if (object.type != null) - message.type = String(object.type); - if (object.variable != null) - message.variable = String(object.variable); - return message; - }; - - /** - * Creates a plain object from a ChildLink message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.PlanNode.ChildLink - * @static - * @param {google.spanner.v1.PlanNode.ChildLink} message ChildLink - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ChildLink.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.childIndex = 0; - object.type = ""; - object.variable = ""; - } - if (message.childIndex != null && message.hasOwnProperty("childIndex")) - object.childIndex = message.childIndex; - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.variable != null && message.hasOwnProperty("variable")) - object.variable = message.variable; - return object; - }; - - /** - * Converts this ChildLink to JSON. - * @function toJSON - * @memberof google.spanner.v1.PlanNode.ChildLink - * @instance - * @returns {Object.} JSON object - */ - ChildLink.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ChildLink - * @function getTypeUrl - * @memberof google.spanner.v1.PlanNode.ChildLink - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ChildLink.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.PlanNode.ChildLink"; - }; - - return ChildLink; - })(); - - PlanNode.ShortRepresentation = (function() { - - /** - * Properties of a ShortRepresentation. - * @memberof google.spanner.v1.PlanNode - * @interface IShortRepresentation - * @property {string|null} [description] ShortRepresentation description - * @property {Object.|null} [subqueries] ShortRepresentation subqueries - */ - - /** - * Constructs a new ShortRepresentation. - * @memberof google.spanner.v1.PlanNode - * @classdesc Represents a ShortRepresentation. - * @implements IShortRepresentation - * @constructor - * @param {google.spanner.v1.PlanNode.IShortRepresentation=} [properties] Properties to set - */ - function ShortRepresentation(properties) { - this.subqueries = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ShortRepresentation description. - * @member {string} description - * @memberof google.spanner.v1.PlanNode.ShortRepresentation - * @instance - */ - ShortRepresentation.prototype.description = ""; - - /** - * ShortRepresentation subqueries. - * @member {Object.} subqueries - * @memberof google.spanner.v1.PlanNode.ShortRepresentation - * @instance - */ - ShortRepresentation.prototype.subqueries = $util.emptyObject; - - /** - * Creates a new ShortRepresentation instance using the specified properties. - * @function create - * @memberof google.spanner.v1.PlanNode.ShortRepresentation - * @static - * @param {google.spanner.v1.PlanNode.IShortRepresentation=} [properties] Properties to set - * @returns {google.spanner.v1.PlanNode.ShortRepresentation} ShortRepresentation instance - */ - ShortRepresentation.create = function create(properties) { - return new ShortRepresentation(properties); - }; - - /** - * Encodes the specified ShortRepresentation message. Does not implicitly {@link google.spanner.v1.PlanNode.ShortRepresentation.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.PlanNode.ShortRepresentation - * @static - * @param {google.spanner.v1.PlanNode.IShortRepresentation} message ShortRepresentation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ShortRepresentation.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.description); - if (message.subqueries != null && Object.hasOwnProperty.call(message, "subqueries")) - for (var keys = Object.keys(message.subqueries), i = 0; i < keys.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 0 =*/16).int32(message.subqueries[keys[i]]).ldelim(); - return writer; - }; - - /** - * Encodes the specified ShortRepresentation message, length delimited. Does not implicitly {@link google.spanner.v1.PlanNode.ShortRepresentation.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.PlanNode.ShortRepresentation - * @static - * @param {google.spanner.v1.PlanNode.IShortRepresentation} message ShortRepresentation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ShortRepresentation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ShortRepresentation message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.PlanNode.ShortRepresentation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.PlanNode.ShortRepresentation} ShortRepresentation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ShortRepresentation.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.PlanNode.ShortRepresentation(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.description = reader.string(); - break; - } - case 2: { - if (message.subqueries === $util.emptyObject) - message.subqueries = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = 0; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.int32(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.subqueries[key] = value; - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ShortRepresentation message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.PlanNode.ShortRepresentation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.PlanNode.ShortRepresentation} ShortRepresentation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ShortRepresentation.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ShortRepresentation message. - * @function verify - * @memberof google.spanner.v1.PlanNode.ShortRepresentation - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ShortRepresentation.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.subqueries != null && message.hasOwnProperty("subqueries")) { - if (!$util.isObject(message.subqueries)) - return "subqueries: object expected"; - var key = Object.keys(message.subqueries); - for (var i = 0; i < key.length; ++i) - if (!$util.isInteger(message.subqueries[key[i]])) - return "subqueries: integer{k:string} expected"; - } - return null; - }; - - /** - * Creates a ShortRepresentation message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.PlanNode.ShortRepresentation - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.PlanNode.ShortRepresentation} ShortRepresentation - */ - ShortRepresentation.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.PlanNode.ShortRepresentation) - return object; - var message = new $root.google.spanner.v1.PlanNode.ShortRepresentation(); - if (object.description != null) - message.description = String(object.description); - if (object.subqueries) { - if (typeof object.subqueries !== "object") - throw TypeError(".google.spanner.v1.PlanNode.ShortRepresentation.subqueries: object expected"); - message.subqueries = {}; - for (var keys = Object.keys(object.subqueries), i = 0; i < keys.length; ++i) - message.subqueries[keys[i]] = object.subqueries[keys[i]] | 0; - } - return message; - }; - - /** - * Creates a plain object from a ShortRepresentation message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.PlanNode.ShortRepresentation - * @static - * @param {google.spanner.v1.PlanNode.ShortRepresentation} message ShortRepresentation - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ShortRepresentation.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.subqueries = {}; - if (options.defaults) - object.description = ""; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - var keys2; - if (message.subqueries && (keys2 = Object.keys(message.subqueries)).length) { - object.subqueries = {}; - for (var j = 0; j < keys2.length; ++j) - object.subqueries[keys2[j]] = message.subqueries[keys2[j]]; - } - return object; - }; - - /** - * Converts this ShortRepresentation to JSON. - * @function toJSON - * @memberof google.spanner.v1.PlanNode.ShortRepresentation - * @instance - * @returns {Object.} JSON object - */ - ShortRepresentation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ShortRepresentation - * @function getTypeUrl - * @memberof google.spanner.v1.PlanNode.ShortRepresentation - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ShortRepresentation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.PlanNode.ShortRepresentation"; - }; - - return ShortRepresentation; - })(); - - return PlanNode; - })(); - - v1.QueryAdvisorResult = (function() { - - /** - * Properties of a QueryAdvisorResult. - * @memberof google.spanner.v1 - * @interface IQueryAdvisorResult - * @property {Array.|null} [indexAdvice] QueryAdvisorResult indexAdvice - */ - - /** - * Constructs a new QueryAdvisorResult. - * @memberof google.spanner.v1 - * @classdesc Represents a QueryAdvisorResult. - * @implements IQueryAdvisorResult - * @constructor - * @param {google.spanner.v1.IQueryAdvisorResult=} [properties] Properties to set - */ - function QueryAdvisorResult(properties) { - this.indexAdvice = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryAdvisorResult indexAdvice. - * @member {Array.} indexAdvice - * @memberof google.spanner.v1.QueryAdvisorResult - * @instance - */ - QueryAdvisorResult.prototype.indexAdvice = $util.emptyArray; - - /** - * Creates a new QueryAdvisorResult instance using the specified properties. - * @function create - * @memberof google.spanner.v1.QueryAdvisorResult - * @static - * @param {google.spanner.v1.IQueryAdvisorResult=} [properties] Properties to set - * @returns {google.spanner.v1.QueryAdvisorResult} QueryAdvisorResult instance - */ - QueryAdvisorResult.create = function create(properties) { - return new QueryAdvisorResult(properties); - }; - - /** - * Encodes the specified QueryAdvisorResult message. Does not implicitly {@link google.spanner.v1.QueryAdvisorResult.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.QueryAdvisorResult - * @static - * @param {google.spanner.v1.IQueryAdvisorResult} message QueryAdvisorResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryAdvisorResult.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.indexAdvice != null && message.indexAdvice.length) - for (var i = 0; i < message.indexAdvice.length; ++i) - $root.google.spanner.v1.QueryAdvisorResult.IndexAdvice.encode(message.indexAdvice[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryAdvisorResult message, length delimited. Does not implicitly {@link google.spanner.v1.QueryAdvisorResult.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.QueryAdvisorResult - * @static - * @param {google.spanner.v1.IQueryAdvisorResult} message QueryAdvisorResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryAdvisorResult.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryAdvisorResult message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.QueryAdvisorResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.QueryAdvisorResult} QueryAdvisorResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryAdvisorResult.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.QueryAdvisorResult(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.indexAdvice && message.indexAdvice.length)) - message.indexAdvice = []; - message.indexAdvice.push($root.google.spanner.v1.QueryAdvisorResult.IndexAdvice.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryAdvisorResult message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.QueryAdvisorResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.QueryAdvisorResult} QueryAdvisorResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryAdvisorResult.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryAdvisorResult message. - * @function verify - * @memberof google.spanner.v1.QueryAdvisorResult - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryAdvisorResult.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.indexAdvice != null && message.hasOwnProperty("indexAdvice")) { - if (!Array.isArray(message.indexAdvice)) - return "indexAdvice: array expected"; - for (var i = 0; i < message.indexAdvice.length; ++i) { - var error = $root.google.spanner.v1.QueryAdvisorResult.IndexAdvice.verify(message.indexAdvice[i]); - if (error) - return "indexAdvice." + error; - } - } - return null; - }; - - /** - * Creates a QueryAdvisorResult message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.QueryAdvisorResult - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.QueryAdvisorResult} QueryAdvisorResult - */ - QueryAdvisorResult.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.QueryAdvisorResult) - return object; - var message = new $root.google.spanner.v1.QueryAdvisorResult(); - if (object.indexAdvice) { - if (!Array.isArray(object.indexAdvice)) - throw TypeError(".google.spanner.v1.QueryAdvisorResult.indexAdvice: array expected"); - message.indexAdvice = []; - for (var i = 0; i < object.indexAdvice.length; ++i) { - if (typeof object.indexAdvice[i] !== "object") - throw TypeError(".google.spanner.v1.QueryAdvisorResult.indexAdvice: object expected"); - message.indexAdvice[i] = $root.google.spanner.v1.QueryAdvisorResult.IndexAdvice.fromObject(object.indexAdvice[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a QueryAdvisorResult message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.QueryAdvisorResult - * @static - * @param {google.spanner.v1.QueryAdvisorResult} message QueryAdvisorResult - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryAdvisorResult.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.indexAdvice = []; - if (message.indexAdvice && message.indexAdvice.length) { - object.indexAdvice = []; - for (var j = 0; j < message.indexAdvice.length; ++j) - object.indexAdvice[j] = $root.google.spanner.v1.QueryAdvisorResult.IndexAdvice.toObject(message.indexAdvice[j], options); - } - return object; - }; - - /** - * Converts this QueryAdvisorResult to JSON. - * @function toJSON - * @memberof google.spanner.v1.QueryAdvisorResult - * @instance - * @returns {Object.} JSON object - */ - QueryAdvisorResult.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for QueryAdvisorResult - * @function getTypeUrl - * @memberof google.spanner.v1.QueryAdvisorResult - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - QueryAdvisorResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.QueryAdvisorResult"; - }; - - QueryAdvisorResult.IndexAdvice = (function() { - - /** - * Properties of an IndexAdvice. - * @memberof google.spanner.v1.QueryAdvisorResult - * @interface IIndexAdvice - * @property {Array.|null} [ddl] IndexAdvice ddl - * @property {number|null} [improvementFactor] IndexAdvice improvementFactor - */ - - /** - * Constructs a new IndexAdvice. - * @memberof google.spanner.v1.QueryAdvisorResult - * @classdesc Represents an IndexAdvice. - * @implements IIndexAdvice - * @constructor - * @param {google.spanner.v1.QueryAdvisorResult.IIndexAdvice=} [properties] Properties to set - */ - function IndexAdvice(properties) { - this.ddl = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * IndexAdvice ddl. - * @member {Array.} ddl - * @memberof google.spanner.v1.QueryAdvisorResult.IndexAdvice - * @instance - */ - IndexAdvice.prototype.ddl = $util.emptyArray; - - /** - * IndexAdvice improvementFactor. - * @member {number} improvementFactor - * @memberof google.spanner.v1.QueryAdvisorResult.IndexAdvice - * @instance - */ - IndexAdvice.prototype.improvementFactor = 0; - - /** - * Creates a new IndexAdvice instance using the specified properties. - * @function create - * @memberof google.spanner.v1.QueryAdvisorResult.IndexAdvice - * @static - * @param {google.spanner.v1.QueryAdvisorResult.IIndexAdvice=} [properties] Properties to set - * @returns {google.spanner.v1.QueryAdvisorResult.IndexAdvice} IndexAdvice instance - */ - IndexAdvice.create = function create(properties) { - return new IndexAdvice(properties); - }; - - /** - * Encodes the specified IndexAdvice message. Does not implicitly {@link google.spanner.v1.QueryAdvisorResult.IndexAdvice.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.QueryAdvisorResult.IndexAdvice - * @static - * @param {google.spanner.v1.QueryAdvisorResult.IIndexAdvice} message IndexAdvice message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IndexAdvice.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.ddl != null && message.ddl.length) - for (var i = 0; i < message.ddl.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.ddl[i]); - if (message.improvementFactor != null && Object.hasOwnProperty.call(message, "improvementFactor")) - writer.uint32(/* id 2, wireType 1 =*/17).double(message.improvementFactor); - return writer; - }; - - /** - * Encodes the specified IndexAdvice message, length delimited. Does not implicitly {@link google.spanner.v1.QueryAdvisorResult.IndexAdvice.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.QueryAdvisorResult.IndexAdvice - * @static - * @param {google.spanner.v1.QueryAdvisorResult.IIndexAdvice} message IndexAdvice message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IndexAdvice.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an IndexAdvice message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.QueryAdvisorResult.IndexAdvice - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.QueryAdvisorResult.IndexAdvice} IndexAdvice - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IndexAdvice.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.QueryAdvisorResult.IndexAdvice(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.ddl && message.ddl.length)) - message.ddl = []; - message.ddl.push(reader.string()); - break; - } - case 2: { - message.improvementFactor = reader.double(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an IndexAdvice message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.QueryAdvisorResult.IndexAdvice - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.QueryAdvisorResult.IndexAdvice} IndexAdvice - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IndexAdvice.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an IndexAdvice message. - * @function verify - * @memberof google.spanner.v1.QueryAdvisorResult.IndexAdvice - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - IndexAdvice.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.ddl != null && message.hasOwnProperty("ddl")) { - if (!Array.isArray(message.ddl)) - return "ddl: array expected"; - for (var i = 0; i < message.ddl.length; ++i) - if (!$util.isString(message.ddl[i])) - return "ddl: string[] expected"; - } - if (message.improvementFactor != null && message.hasOwnProperty("improvementFactor")) - if (typeof message.improvementFactor !== "number") - return "improvementFactor: number expected"; - return null; - }; - - /** - * Creates an IndexAdvice message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.QueryAdvisorResult.IndexAdvice - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.QueryAdvisorResult.IndexAdvice} IndexAdvice - */ - IndexAdvice.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.QueryAdvisorResult.IndexAdvice) - return object; - var message = new $root.google.spanner.v1.QueryAdvisorResult.IndexAdvice(); - if (object.ddl) { - if (!Array.isArray(object.ddl)) - throw TypeError(".google.spanner.v1.QueryAdvisorResult.IndexAdvice.ddl: array expected"); - message.ddl = []; - for (var i = 0; i < object.ddl.length; ++i) - message.ddl[i] = String(object.ddl[i]); - } - if (object.improvementFactor != null) - message.improvementFactor = Number(object.improvementFactor); - return message; - }; - - /** - * Creates a plain object from an IndexAdvice message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.QueryAdvisorResult.IndexAdvice - * @static - * @param {google.spanner.v1.QueryAdvisorResult.IndexAdvice} message IndexAdvice - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - IndexAdvice.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.ddl = []; - if (options.defaults) - object.improvementFactor = 0; - if (message.ddl && message.ddl.length) { - object.ddl = []; - for (var j = 0; j < message.ddl.length; ++j) - object.ddl[j] = message.ddl[j]; - } - if (message.improvementFactor != null && message.hasOwnProperty("improvementFactor")) - object.improvementFactor = options.json && !isFinite(message.improvementFactor) ? String(message.improvementFactor) : message.improvementFactor; - return object; - }; - - /** - * Converts this IndexAdvice to JSON. - * @function toJSON - * @memberof google.spanner.v1.QueryAdvisorResult.IndexAdvice - * @instance - * @returns {Object.} JSON object - */ - IndexAdvice.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for IndexAdvice - * @function getTypeUrl - * @memberof google.spanner.v1.QueryAdvisorResult.IndexAdvice - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - IndexAdvice.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.QueryAdvisorResult.IndexAdvice"; - }; - - return IndexAdvice; - })(); - - return QueryAdvisorResult; - })(); - - v1.QueryPlan = (function() { - - /** - * Properties of a QueryPlan. - * @memberof google.spanner.v1 - * @interface IQueryPlan - * @property {Array.|null} [planNodes] QueryPlan planNodes - * @property {google.spanner.v1.IQueryAdvisorResult|null} [queryAdvice] QueryPlan queryAdvice - */ - - /** - * Constructs a new QueryPlan. - * @memberof google.spanner.v1 - * @classdesc Represents a QueryPlan. - * @implements IQueryPlan - * @constructor - * @param {google.spanner.v1.IQueryPlan=} [properties] Properties to set - */ - function QueryPlan(properties) { - this.planNodes = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryPlan planNodes. - * @member {Array.} planNodes - * @memberof google.spanner.v1.QueryPlan - * @instance - */ - QueryPlan.prototype.planNodes = $util.emptyArray; - - /** - * QueryPlan queryAdvice. - * @member {google.spanner.v1.IQueryAdvisorResult|null|undefined} queryAdvice - * @memberof google.spanner.v1.QueryPlan - * @instance - */ - QueryPlan.prototype.queryAdvice = null; - - /** - * Creates a new QueryPlan instance using the specified properties. - * @function create - * @memberof google.spanner.v1.QueryPlan - * @static - * @param {google.spanner.v1.IQueryPlan=} [properties] Properties to set - * @returns {google.spanner.v1.QueryPlan} QueryPlan instance - */ - QueryPlan.create = function create(properties) { - return new QueryPlan(properties); - }; - - /** - * Encodes the specified QueryPlan message. Does not implicitly {@link google.spanner.v1.QueryPlan.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.QueryPlan - * @static - * @param {google.spanner.v1.IQueryPlan} message QueryPlan message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryPlan.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.planNodes != null && message.planNodes.length) - for (var i = 0; i < message.planNodes.length; ++i) - $root.google.spanner.v1.PlanNode.encode(message.planNodes[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.queryAdvice != null && Object.hasOwnProperty.call(message, "queryAdvice")) - $root.google.spanner.v1.QueryAdvisorResult.encode(message.queryAdvice, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryPlan message, length delimited. Does not implicitly {@link google.spanner.v1.QueryPlan.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.QueryPlan - * @static - * @param {google.spanner.v1.IQueryPlan} message QueryPlan message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryPlan.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryPlan message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.QueryPlan - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.QueryPlan} QueryPlan - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryPlan.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.QueryPlan(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.planNodes && message.planNodes.length)) - message.planNodes = []; - message.planNodes.push($root.google.spanner.v1.PlanNode.decode(reader, reader.uint32())); - break; - } - case 2: { - message.queryAdvice = $root.google.spanner.v1.QueryAdvisorResult.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryPlan message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.QueryPlan - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.QueryPlan} QueryPlan - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryPlan.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryPlan message. - * @function verify - * @memberof google.spanner.v1.QueryPlan - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryPlan.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.planNodes != null && message.hasOwnProperty("planNodes")) { - if (!Array.isArray(message.planNodes)) - return "planNodes: array expected"; - for (var i = 0; i < message.planNodes.length; ++i) { - var error = $root.google.spanner.v1.PlanNode.verify(message.planNodes[i]); - if (error) - return "planNodes." + error; - } - } - if (message.queryAdvice != null && message.hasOwnProperty("queryAdvice")) { - var error = $root.google.spanner.v1.QueryAdvisorResult.verify(message.queryAdvice); - if (error) - return "queryAdvice." + error; - } - return null; - }; - - /** - * Creates a QueryPlan message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.QueryPlan - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.QueryPlan} QueryPlan - */ - QueryPlan.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.QueryPlan) - return object; - var message = new $root.google.spanner.v1.QueryPlan(); - if (object.planNodes) { - if (!Array.isArray(object.planNodes)) - throw TypeError(".google.spanner.v1.QueryPlan.planNodes: array expected"); - message.planNodes = []; - for (var i = 0; i < object.planNodes.length; ++i) { - if (typeof object.planNodes[i] !== "object") - throw TypeError(".google.spanner.v1.QueryPlan.planNodes: object expected"); - message.planNodes[i] = $root.google.spanner.v1.PlanNode.fromObject(object.planNodes[i]); - } - } - if (object.queryAdvice != null) { - if (typeof object.queryAdvice !== "object") - throw TypeError(".google.spanner.v1.QueryPlan.queryAdvice: object expected"); - message.queryAdvice = $root.google.spanner.v1.QueryAdvisorResult.fromObject(object.queryAdvice); - } - return message; - }; - - /** - * Creates a plain object from a QueryPlan message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.QueryPlan - * @static - * @param {google.spanner.v1.QueryPlan} message QueryPlan - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryPlan.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.planNodes = []; - if (options.defaults) - object.queryAdvice = null; - if (message.planNodes && message.planNodes.length) { - object.planNodes = []; - for (var j = 0; j < message.planNodes.length; ++j) - object.planNodes[j] = $root.google.spanner.v1.PlanNode.toObject(message.planNodes[j], options); - } - if (message.queryAdvice != null && message.hasOwnProperty("queryAdvice")) - object.queryAdvice = $root.google.spanner.v1.QueryAdvisorResult.toObject(message.queryAdvice, options); - return object; - }; - - /** - * Converts this QueryPlan to JSON. - * @function toJSON - * @memberof google.spanner.v1.QueryPlan - * @instance - * @returns {Object.} JSON object - */ - QueryPlan.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for QueryPlan - * @function getTypeUrl - * @memberof google.spanner.v1.QueryPlan - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - QueryPlan.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.QueryPlan"; - }; - - return QueryPlan; - })(); - - return v1; - })(); - - return spanner; - })(); - - google.api = (function() { - - /** - * Namespace api. - * @memberof google - * @namespace - */ - var api = {}; - - /** - * FieldBehavior enum. - * @name google.api.FieldBehavior - * @enum {number} - * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value - * @property {number} OPTIONAL=1 OPTIONAL value - * @property {number} REQUIRED=2 REQUIRED value - * @property {number} OUTPUT_ONLY=3 OUTPUT_ONLY value - * @property {number} INPUT_ONLY=4 INPUT_ONLY value - * @property {number} IMMUTABLE=5 IMMUTABLE value - * @property {number} UNORDERED_LIST=6 UNORDERED_LIST value - * @property {number} NON_EMPTY_DEFAULT=7 NON_EMPTY_DEFAULT value - * @property {number} IDENTIFIER=8 IDENTIFIER value - */ - api.FieldBehavior = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "FIELD_BEHAVIOR_UNSPECIFIED"] = 0; - values[valuesById[1] = "OPTIONAL"] = 1; - values[valuesById[2] = "REQUIRED"] = 2; - values[valuesById[3] = "OUTPUT_ONLY"] = 3; - values[valuesById[4] = "INPUT_ONLY"] = 4; - values[valuesById[5] = "IMMUTABLE"] = 5; - values[valuesById[6] = "UNORDERED_LIST"] = 6; - values[valuesById[7] = "NON_EMPTY_DEFAULT"] = 7; - values[valuesById[8] = "IDENTIFIER"] = 8; - return values; - })(); - - api.ResourceDescriptor = (function() { - - /** - * Properties of a ResourceDescriptor. - * @memberof google.api - * @interface IResourceDescriptor - * @property {string|null} [type] ResourceDescriptor type - * @property {Array.|null} [pattern] ResourceDescriptor pattern - * @property {string|null} [nameField] ResourceDescriptor nameField - * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history - * @property {string|null} [plural] ResourceDescriptor plural - * @property {string|null} [singular] ResourceDescriptor singular - * @property {Array.|null} [style] ResourceDescriptor style - */ - - /** - * Constructs a new ResourceDescriptor. - * @memberof google.api - * @classdesc Represents a ResourceDescriptor. - * @implements IResourceDescriptor - * @constructor - * @param {google.api.IResourceDescriptor=} [properties] Properties to set - */ - function ResourceDescriptor(properties) { - this.pattern = []; - this.style = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ResourceDescriptor type. - * @member {string} type - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.type = ""; - - /** - * ResourceDescriptor pattern. - * @member {Array.} pattern - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.pattern = $util.emptyArray; - - /** - * ResourceDescriptor nameField. - * @member {string} nameField - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.nameField = ""; - - /** - * ResourceDescriptor history. - * @member {google.api.ResourceDescriptor.History} history - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.history = 0; - - /** - * ResourceDescriptor plural. - * @member {string} plural - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.plural = ""; - - /** - * ResourceDescriptor singular. - * @member {string} singular - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.singular = ""; - - /** - * ResourceDescriptor style. - * @member {Array.} style - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.style = $util.emptyArray; - - /** - * Creates a new ResourceDescriptor instance using the specified properties. - * @function create - * @memberof google.api.ResourceDescriptor - * @static - * @param {google.api.IResourceDescriptor=} [properties] Properties to set - * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance - */ - ResourceDescriptor.create = function create(properties) { - return new ResourceDescriptor(properties); - }; - - /** - * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. - * @function encode - * @memberof google.api.ResourceDescriptor - * @static - * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceDescriptor.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); - if (message.pattern != null && message.pattern.length) - for (var i = 0; i < message.pattern.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.pattern[i]); - if (message.nameField != null && Object.hasOwnProperty.call(message, "nameField")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); - if (message.history != null && Object.hasOwnProperty.call(message, "history")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); - if (message.plural != null && Object.hasOwnProperty.call(message, "plural")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); - if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); - if (message.style != null && message.style.length) { - writer.uint32(/* id 10, wireType 2 =*/82).fork(); - for (var i = 0; i < message.style.length; ++i) - writer.int32(message.style[i]); - writer.ldelim(); - } - return writer; - }; - - /** - * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.ResourceDescriptor - * @static - * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ResourceDescriptor message from the specified reader or buffer. - * @function decode - * @memberof google.api.ResourceDescriptor - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.ResourceDescriptor} ResourceDescriptor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceDescriptor.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceDescriptor(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.type = reader.string(); - break; - } - case 2: { - if (!(message.pattern && message.pattern.length)) - message.pattern = []; - message.pattern.push(reader.string()); - break; - } - case 3: { - message.nameField = reader.string(); - break; - } - case 4: { - message.history = reader.int32(); - break; - } - case 5: { - message.plural = reader.string(); - break; - } - case 6: { - message.singular = reader.string(); - break; - } - case 10: { - if (!(message.style && message.style.length)) - message.style = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.style.push(reader.int32()); - } else - message.style.push(reader.int32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.ResourceDescriptor - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.ResourceDescriptor} ResourceDescriptor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ResourceDescriptor message. - * @function verify - * @memberof google.api.ResourceDescriptor - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ResourceDescriptor.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.pattern != null && message.hasOwnProperty("pattern")) { - if (!Array.isArray(message.pattern)) - return "pattern: array expected"; - for (var i = 0; i < message.pattern.length; ++i) - if (!$util.isString(message.pattern[i])) - return "pattern: string[] expected"; - } - if (message.nameField != null && message.hasOwnProperty("nameField")) - if (!$util.isString(message.nameField)) - return "nameField: string expected"; - if (message.history != null && message.hasOwnProperty("history")) - switch (message.history) { - default: - return "history: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.plural != null && message.hasOwnProperty("plural")) - if (!$util.isString(message.plural)) - return "plural: string expected"; - if (message.singular != null && message.hasOwnProperty("singular")) - if (!$util.isString(message.singular)) - return "singular: string expected"; - if (message.style != null && message.hasOwnProperty("style")) { - if (!Array.isArray(message.style)) - return "style: array expected"; - for (var i = 0; i < message.style.length; ++i) - switch (message.style[i]) { - default: - return "style: enum value[] expected"; - case 0: - case 1: - break; - } - } - return null; - }; - - /** - * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.ResourceDescriptor - * @static - * @param {Object.} object Plain object - * @returns {google.api.ResourceDescriptor} ResourceDescriptor - */ - ResourceDescriptor.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.ResourceDescriptor) - return object; - var message = new $root.google.api.ResourceDescriptor(); - if (object.type != null) - message.type = String(object.type); - if (object.pattern) { - if (!Array.isArray(object.pattern)) - throw TypeError(".google.api.ResourceDescriptor.pattern: array expected"); - message.pattern = []; - for (var i = 0; i < object.pattern.length; ++i) - message.pattern[i] = String(object.pattern[i]); - } - if (object.nameField != null) - message.nameField = String(object.nameField); - switch (object.history) { - default: - if (typeof object.history === "number") { - message.history = object.history; - break; - } - break; - case "HISTORY_UNSPECIFIED": - case 0: - message.history = 0; - break; - case "ORIGINALLY_SINGLE_PATTERN": - case 1: - message.history = 1; - break; - case "FUTURE_MULTI_PATTERN": - case 2: - message.history = 2; - break; - } - if (object.plural != null) - message.plural = String(object.plural); - if (object.singular != null) - message.singular = String(object.singular); - if (object.style) { - if (!Array.isArray(object.style)) - throw TypeError(".google.api.ResourceDescriptor.style: array expected"); - message.style = []; - for (var i = 0; i < object.style.length; ++i) - switch (object.style[i]) { - default: - if (typeof object.style[i] === "number") { - message.style[i] = object.style[i]; - break; - } - case "STYLE_UNSPECIFIED": - case 0: - message.style[i] = 0; - break; - case "DECLARATIVE_FRIENDLY": - case 1: - message.style[i] = 1; - break; - } - } - return message; - }; - - /** - * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.ResourceDescriptor - * @static - * @param {google.api.ResourceDescriptor} message ResourceDescriptor - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResourceDescriptor.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.pattern = []; - object.style = []; - } - if (options.defaults) { - object.type = ""; - object.nameField = ""; - object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; - object.plural = ""; - object.singular = ""; - } - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.pattern && message.pattern.length) { - object.pattern = []; - for (var j = 0; j < message.pattern.length; ++j) - object.pattern[j] = message.pattern[j]; - } - if (message.nameField != null && message.hasOwnProperty("nameField")) - object.nameField = message.nameField; - if (message.history != null && message.hasOwnProperty("history")) - object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] === undefined ? message.history : $root.google.api.ResourceDescriptor.History[message.history] : message.history; - if (message.plural != null && message.hasOwnProperty("plural")) - object.plural = message.plural; - if (message.singular != null && message.hasOwnProperty("singular")) - object.singular = message.singular; - if (message.style && message.style.length) { - object.style = []; - for (var j = 0; j < message.style.length; ++j) - object.style[j] = options.enums === String ? $root.google.api.ResourceDescriptor.Style[message.style[j]] === undefined ? message.style[j] : $root.google.api.ResourceDescriptor.Style[message.style[j]] : message.style[j]; - } - return object; - }; - - /** - * Converts this ResourceDescriptor to JSON. - * @function toJSON - * @memberof google.api.ResourceDescriptor - * @instance - * @returns {Object.} JSON object - */ - ResourceDescriptor.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ResourceDescriptor - * @function getTypeUrl - * @memberof google.api.ResourceDescriptor - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ResourceDescriptor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.ResourceDescriptor"; - }; - - /** - * History enum. - * @name google.api.ResourceDescriptor.History - * @enum {number} - * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value - * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value - * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value - */ - ResourceDescriptor.History = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "HISTORY_UNSPECIFIED"] = 0; - values[valuesById[1] = "ORIGINALLY_SINGLE_PATTERN"] = 1; - values[valuesById[2] = "FUTURE_MULTI_PATTERN"] = 2; - return values; - })(); - - /** - * Style enum. - * @name google.api.ResourceDescriptor.Style - * @enum {number} - * @property {number} STYLE_UNSPECIFIED=0 STYLE_UNSPECIFIED value - * @property {number} DECLARATIVE_FRIENDLY=1 DECLARATIVE_FRIENDLY value - */ - ResourceDescriptor.Style = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STYLE_UNSPECIFIED"] = 0; - values[valuesById[1] = "DECLARATIVE_FRIENDLY"] = 1; - return values; - })(); - - return ResourceDescriptor; - })(); - - api.ResourceReference = (function() { - - /** - * Properties of a ResourceReference. - * @memberof google.api - * @interface IResourceReference - * @property {string|null} [type] ResourceReference type - * @property {string|null} [childType] ResourceReference childType - */ - - /** - * Constructs a new ResourceReference. - * @memberof google.api - * @classdesc Represents a ResourceReference. - * @implements IResourceReference - * @constructor - * @param {google.api.IResourceReference=} [properties] Properties to set - */ - function ResourceReference(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ResourceReference type. - * @member {string} type - * @memberof google.api.ResourceReference - * @instance - */ - ResourceReference.prototype.type = ""; - - /** - * ResourceReference childType. - * @member {string} childType - * @memberof google.api.ResourceReference - * @instance - */ - ResourceReference.prototype.childType = ""; - - /** - * Creates a new ResourceReference instance using the specified properties. - * @function create - * @memberof google.api.ResourceReference - * @static - * @param {google.api.IResourceReference=} [properties] Properties to set - * @returns {google.api.ResourceReference} ResourceReference instance - */ - ResourceReference.create = function create(properties) { - return new ResourceReference(properties); - }; - - /** - * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. - * @function encode - * @memberof google.api.ResourceReference - * @static - * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceReference.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); - if (message.childType != null && Object.hasOwnProperty.call(message, "childType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); - return writer; - }; - - /** - * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.ResourceReference - * @static - * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ResourceReference message from the specified reader or buffer. - * @function decode - * @memberof google.api.ResourceReference - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.ResourceReference} ResourceReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceReference.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceReference(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.type = reader.string(); - break; - } - case 2: { - message.childType = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ResourceReference message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.ResourceReference - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.ResourceReference} ResourceReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceReference.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ResourceReference message. - * @function verify - * @memberof google.api.ResourceReference - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ResourceReference.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.childType != null && message.hasOwnProperty("childType")) - if (!$util.isString(message.childType)) - return "childType: string expected"; - return null; - }; - - /** - * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.ResourceReference - * @static - * @param {Object.} object Plain object - * @returns {google.api.ResourceReference} ResourceReference - */ - ResourceReference.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.ResourceReference) - return object; - var message = new $root.google.api.ResourceReference(); - if (object.type != null) - message.type = String(object.type); - if (object.childType != null) - message.childType = String(object.childType); - return message; - }; - - /** - * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.ResourceReference - * @static - * @param {google.api.ResourceReference} message ResourceReference - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResourceReference.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.type = ""; - object.childType = ""; - } - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.childType != null && message.hasOwnProperty("childType")) - object.childType = message.childType; - return object; - }; - - /** - * Converts this ResourceReference to JSON. - * @function toJSON - * @memberof google.api.ResourceReference - * @instance - * @returns {Object.} JSON object - */ - ResourceReference.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ResourceReference - * @function getTypeUrl - * @memberof google.api.ResourceReference - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ResourceReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.ResourceReference"; - }; - - return ResourceReference; - })(); - - api.Http = (function() { - - /** - * Properties of a Http. - * @memberof google.api - * @interface IHttp - * @property {Array.|null} [rules] Http rules - * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion - */ - - /** - * Constructs a new Http. - * @memberof google.api - * @classdesc Represents a Http. - * @implements IHttp - * @constructor - * @param {google.api.IHttp=} [properties] Properties to set - */ - function Http(properties) { - this.rules = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Http rules. - * @member {Array.} rules - * @memberof google.api.Http - * @instance - */ - Http.prototype.rules = $util.emptyArray; - - /** - * Http fullyDecodeReservedExpansion. - * @member {boolean} fullyDecodeReservedExpansion - * @memberof google.api.Http - * @instance - */ - Http.prototype.fullyDecodeReservedExpansion = false; - - /** - * Creates a new Http instance using the specified properties. - * @function create - * @memberof google.api.Http - * @static - * @param {google.api.IHttp=} [properties] Properties to set - * @returns {google.api.Http} Http instance - */ - Http.create = function create(properties) { - return new Http(properties); - }; - - /** - * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @function encode - * @memberof google.api.Http - * @static - * @param {google.api.IHttp} message Http message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Http.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.rules != null && message.rules.length) - for (var i = 0; i < message.rules.length; ++i) - $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); - return writer; - }; - - /** - * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.Http - * @static - * @param {google.api.IHttp} message Http message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Http.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Http message from the specified reader or buffer. - * @function decode - * @memberof google.api.Http - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.Http} Http - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Http.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.rules && message.rules.length)) - message.rules = []; - message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); - break; - } - case 2: { - message.fullyDecodeReservedExpansion = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Http message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.Http - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.Http} Http - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Http.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Http message. - * @function verify - * @memberof google.api.Http - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Http.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.rules != null && message.hasOwnProperty("rules")) { - if (!Array.isArray(message.rules)) - return "rules: array expected"; - for (var i = 0; i < message.rules.length; ++i) { - var error = $root.google.api.HttpRule.verify(message.rules[i]); - if (error) - return "rules." + error; - } - } - if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) - if (typeof message.fullyDecodeReservedExpansion !== "boolean") - return "fullyDecodeReservedExpansion: boolean expected"; - return null; - }; - - /** - * Creates a Http message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.Http - * @static - * @param {Object.} object Plain object - * @returns {google.api.Http} Http - */ - Http.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.Http) - return object; - var message = new $root.google.api.Http(); - if (object.rules) { - if (!Array.isArray(object.rules)) - throw TypeError(".google.api.Http.rules: array expected"); - message.rules = []; - for (var i = 0; i < object.rules.length; ++i) { - if (typeof object.rules[i] !== "object") - throw TypeError(".google.api.Http.rules: object expected"); - message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); - } - } - if (object.fullyDecodeReservedExpansion != null) - message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); - return message; - }; - - /** - * Creates a plain object from a Http message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.Http - * @static - * @param {google.api.Http} message Http - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Http.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.rules = []; - if (options.defaults) - object.fullyDecodeReservedExpansion = false; - if (message.rules && message.rules.length) { - object.rules = []; - for (var j = 0; j < message.rules.length; ++j) - object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); - } - if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) - object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; - return object; - }; - - /** - * Converts this Http to JSON. - * @function toJSON - * @memberof google.api.Http - * @instance - * @returns {Object.} JSON object - */ - Http.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Http - * @function getTypeUrl - * @memberof google.api.Http - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Http.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.Http"; - }; - - return Http; - })(); - - api.HttpRule = (function() { - - /** - * Properties of a HttpRule. - * @memberof google.api - * @interface IHttpRule - * @property {string|null} [selector] HttpRule selector - * @property {string|null} [get] HttpRule get - * @property {string|null} [put] HttpRule put - * @property {string|null} [post] HttpRule post - * @property {string|null} ["delete"] HttpRule delete - * @property {string|null} [patch] HttpRule patch - * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom - * @property {string|null} [body] HttpRule body - * @property {string|null} [responseBody] HttpRule responseBody - * @property {Array.|null} [additionalBindings] HttpRule additionalBindings - */ - - /** - * Constructs a new HttpRule. - * @memberof google.api - * @classdesc Represents a HttpRule. - * @implements IHttpRule - * @constructor - * @param {google.api.IHttpRule=} [properties] Properties to set - */ - function HttpRule(properties) { - this.additionalBindings = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * HttpRule selector. - * @member {string} selector - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.selector = ""; - - /** - * HttpRule get. - * @member {string|null|undefined} get - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.get = null; - - /** - * HttpRule put. - * @member {string|null|undefined} put - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.put = null; - - /** - * HttpRule post. - * @member {string|null|undefined} post - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.post = null; - - /** - * HttpRule delete. - * @member {string|null|undefined} delete - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype["delete"] = null; - - /** - * HttpRule patch. - * @member {string|null|undefined} patch - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.patch = null; - - /** - * HttpRule custom. - * @member {google.api.ICustomHttpPattern|null|undefined} custom - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.custom = null; - - /** - * HttpRule body. - * @member {string} body - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.body = ""; - - /** - * HttpRule responseBody. - * @member {string} responseBody - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.responseBody = ""; - - /** - * HttpRule additionalBindings. - * @member {Array.} additionalBindings - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.additionalBindings = $util.emptyArray; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * HttpRule pattern. - * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern - * @memberof google.api.HttpRule - * @instance - */ - Object.defineProperty(HttpRule.prototype, "pattern", { - get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new HttpRule instance using the specified properties. - * @function create - * @memberof google.api.HttpRule - * @static - * @param {google.api.IHttpRule=} [properties] Properties to set - * @returns {google.api.HttpRule} HttpRule instance - */ - HttpRule.create = function create(properties) { - return new HttpRule(properties); - }; - - /** - * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @function encode - * @memberof google.api.HttpRule - * @static - * @param {google.api.IHttpRule} message HttpRule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HttpRule.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); - if (message.get != null && Object.hasOwnProperty.call(message, "get")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); - if (message.put != null && Object.hasOwnProperty.call(message, "put")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); - if (message.post != null && Object.hasOwnProperty.call(message, "post")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); - if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); - if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); - if (message.body != null && Object.hasOwnProperty.call(message, "body")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); - if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) - $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.additionalBindings != null && message.additionalBindings.length) - for (var i = 0; i < message.additionalBindings.length; ++i) - $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); - return writer; - }; - - /** - * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.HttpRule - * @static - * @param {google.api.IHttpRule} message HttpRule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HttpRule.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a HttpRule message from the specified reader or buffer. - * @function decode - * @memberof google.api.HttpRule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.HttpRule} HttpRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HttpRule.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.selector = reader.string(); - break; - } - case 2: { - message.get = reader.string(); - break; - } - case 3: { - message.put = reader.string(); - break; - } - case 4: { - message.post = reader.string(); - break; - } - case 5: { - message["delete"] = reader.string(); - break; - } - case 6: { - message.patch = reader.string(); - break; - } - case 8: { - message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); - break; - } - case 7: { - message.body = reader.string(); - break; - } - case 12: { - message.responseBody = reader.string(); - break; - } - case 11: { - if (!(message.additionalBindings && message.additionalBindings.length)) - message.additionalBindings = []; - message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a HttpRule message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.HttpRule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.HttpRule} HttpRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HttpRule.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a HttpRule message. - * @function verify - * @memberof google.api.HttpRule - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - HttpRule.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.selector != null && message.hasOwnProperty("selector")) - if (!$util.isString(message.selector)) - return "selector: string expected"; - if (message.get != null && message.hasOwnProperty("get")) { - properties.pattern = 1; - if (!$util.isString(message.get)) - return "get: string expected"; - } - if (message.put != null && message.hasOwnProperty("put")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message.put)) - return "put: string expected"; - } - if (message.post != null && message.hasOwnProperty("post")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message.post)) - return "post: string expected"; - } - if (message["delete"] != null && message.hasOwnProperty("delete")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message["delete"])) - return "delete: string expected"; - } - if (message.patch != null && message.hasOwnProperty("patch")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message.patch)) - return "patch: string expected"; - } - if (message.custom != null && message.hasOwnProperty("custom")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - { - var error = $root.google.api.CustomHttpPattern.verify(message.custom); - if (error) - return "custom." + error; - } - } - if (message.body != null && message.hasOwnProperty("body")) - if (!$util.isString(message.body)) - return "body: string expected"; - if (message.responseBody != null && message.hasOwnProperty("responseBody")) - if (!$util.isString(message.responseBody)) - return "responseBody: string expected"; - if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) { - if (!Array.isArray(message.additionalBindings)) - return "additionalBindings: array expected"; - for (var i = 0; i < message.additionalBindings.length; ++i) { - var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]); - if (error) - return "additionalBindings." + error; - } - } - return null; - }; - - /** - * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.HttpRule - * @static - * @param {Object.} object Plain object - * @returns {google.api.HttpRule} HttpRule - */ - HttpRule.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.HttpRule) - return object; - var message = new $root.google.api.HttpRule(); - if (object.selector != null) - message.selector = String(object.selector); - if (object.get != null) - message.get = String(object.get); - if (object.put != null) - message.put = String(object.put); - if (object.post != null) - message.post = String(object.post); - if (object["delete"] != null) - message["delete"] = String(object["delete"]); - if (object.patch != null) - message.patch = String(object.patch); - if (object.custom != null) { - if (typeof object.custom !== "object") - throw TypeError(".google.api.HttpRule.custom: object expected"); - message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); - } - if (object.body != null) - message.body = String(object.body); - if (object.responseBody != null) - message.responseBody = String(object.responseBody); - if (object.additionalBindings) { - if (!Array.isArray(object.additionalBindings)) - throw TypeError(".google.api.HttpRule.additionalBindings: array expected"); - message.additionalBindings = []; - for (var i = 0; i < object.additionalBindings.length; ++i) { - if (typeof object.additionalBindings[i] !== "object") - throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); - message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a HttpRule message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.HttpRule - * @static - * @param {google.api.HttpRule} message HttpRule - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - HttpRule.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.additionalBindings = []; - if (options.defaults) { - object.selector = ""; - object.body = ""; - object.responseBody = ""; - } - if (message.selector != null && message.hasOwnProperty("selector")) - object.selector = message.selector; - if (message.get != null && message.hasOwnProperty("get")) { - object.get = message.get; - if (options.oneofs) - object.pattern = "get"; - } - if (message.put != null && message.hasOwnProperty("put")) { - object.put = message.put; - if (options.oneofs) - object.pattern = "put"; - } - if (message.post != null && message.hasOwnProperty("post")) { - object.post = message.post; - if (options.oneofs) - object.pattern = "post"; - } - if (message["delete"] != null && message.hasOwnProperty("delete")) { - object["delete"] = message["delete"]; - if (options.oneofs) - object.pattern = "delete"; - } - if (message.patch != null && message.hasOwnProperty("patch")) { - object.patch = message.patch; - if (options.oneofs) - object.pattern = "patch"; - } - if (message.body != null && message.hasOwnProperty("body")) - object.body = message.body; - if (message.custom != null && message.hasOwnProperty("custom")) { - object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); - if (options.oneofs) - object.pattern = "custom"; - } - if (message.additionalBindings && message.additionalBindings.length) { - object.additionalBindings = []; - for (var j = 0; j < message.additionalBindings.length; ++j) - object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options); - } - if (message.responseBody != null && message.hasOwnProperty("responseBody")) - object.responseBody = message.responseBody; - return object; - }; - - /** - * Converts this HttpRule to JSON. - * @function toJSON - * @memberof google.api.HttpRule - * @instance - * @returns {Object.} JSON object - */ - HttpRule.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for HttpRule - * @function getTypeUrl - * @memberof google.api.HttpRule - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - HttpRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.HttpRule"; - }; - - return HttpRule; - })(); - - api.CustomHttpPattern = (function() { - - /** - * Properties of a CustomHttpPattern. - * @memberof google.api - * @interface ICustomHttpPattern - * @property {string|null} [kind] CustomHttpPattern kind - * @property {string|null} [path] CustomHttpPattern path - */ - - /** - * Constructs a new CustomHttpPattern. - * @memberof google.api - * @classdesc Represents a CustomHttpPattern. - * @implements ICustomHttpPattern - * @constructor - * @param {google.api.ICustomHttpPattern=} [properties] Properties to set - */ - function CustomHttpPattern(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CustomHttpPattern kind. - * @member {string} kind - * @memberof google.api.CustomHttpPattern - * @instance - */ - CustomHttpPattern.prototype.kind = ""; - - /** - * CustomHttpPattern path. - * @member {string} path - * @memberof google.api.CustomHttpPattern - * @instance - */ - CustomHttpPattern.prototype.path = ""; - - /** - * Creates a new CustomHttpPattern instance using the specified properties. - * @function create - * @memberof google.api.CustomHttpPattern - * @static - * @param {google.api.ICustomHttpPattern=} [properties] Properties to set - * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance - */ - CustomHttpPattern.create = function create(properties) { - return new CustomHttpPattern(properties); - }; - - /** - * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. - * @function encode - * @memberof google.api.CustomHttpPattern - * @static - * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CustomHttpPattern.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); - if (message.path != null && Object.hasOwnProperty.call(message, "path")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); - return writer; - }; - - /** - * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.CustomHttpPattern - * @static - * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CustomHttpPattern message from the specified reader or buffer. - * @function decode - * @memberof google.api.CustomHttpPattern - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.CustomHttpPattern} CustomHttpPattern - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CustomHttpPattern.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.kind = reader.string(); - break; - } - case 2: { - message.path = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.CustomHttpPattern - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.CustomHttpPattern} CustomHttpPattern - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CustomHttpPattern message. - * @function verify - * @memberof google.api.CustomHttpPattern - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CustomHttpPattern.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.kind != null && message.hasOwnProperty("kind")) - if (!$util.isString(message.kind)) - return "kind: string expected"; - if (message.path != null && message.hasOwnProperty("path")) - if (!$util.isString(message.path)) - return "path: string expected"; - return null; - }; - - /** - * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.CustomHttpPattern - * @static - * @param {Object.} object Plain object - * @returns {google.api.CustomHttpPattern} CustomHttpPattern - */ - CustomHttpPattern.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.CustomHttpPattern) - return object; - var message = new $root.google.api.CustomHttpPattern(); - if (object.kind != null) - message.kind = String(object.kind); - if (object.path != null) - message.path = String(object.path); - return message; - }; - - /** - * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.CustomHttpPattern - * @static - * @param {google.api.CustomHttpPattern} message CustomHttpPattern - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CustomHttpPattern.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.kind = ""; - object.path = ""; - } - if (message.kind != null && message.hasOwnProperty("kind")) - object.kind = message.kind; - if (message.path != null && message.hasOwnProperty("path")) - object.path = message.path; - return object; - }; - - /** - * Converts this CustomHttpPattern to JSON. - * @function toJSON - * @memberof google.api.CustomHttpPattern - * @instance - * @returns {Object.} JSON object - */ - CustomHttpPattern.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CustomHttpPattern - * @function getTypeUrl - * @memberof google.api.CustomHttpPattern - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CustomHttpPattern.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.CustomHttpPattern"; - }; - - return CustomHttpPattern; - })(); - - api.CommonLanguageSettings = (function() { - - /** - * Properties of a CommonLanguageSettings. - * @memberof google.api - * @interface ICommonLanguageSettings - * @property {string|null} [referenceDocsUri] CommonLanguageSettings referenceDocsUri - * @property {Array.|null} [destinations] CommonLanguageSettings destinations - */ - - /** - * Constructs a new CommonLanguageSettings. - * @memberof google.api - * @classdesc Represents a CommonLanguageSettings. - * @implements ICommonLanguageSettings - * @constructor - * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set - */ - function CommonLanguageSettings(properties) { - this.destinations = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CommonLanguageSettings referenceDocsUri. - * @member {string} referenceDocsUri - * @memberof google.api.CommonLanguageSettings - * @instance - */ - CommonLanguageSettings.prototype.referenceDocsUri = ""; - - /** - * CommonLanguageSettings destinations. - * @member {Array.} destinations - * @memberof google.api.CommonLanguageSettings - * @instance - */ - CommonLanguageSettings.prototype.destinations = $util.emptyArray; - - /** - * Creates a new CommonLanguageSettings instance using the specified properties. - * @function create - * @memberof google.api.CommonLanguageSettings - * @static - * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set - * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings instance - */ - CommonLanguageSettings.create = function create(properties) { - return new CommonLanguageSettings(properties); - }; - - /** - * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. - * @function encode - * @memberof google.api.CommonLanguageSettings - * @static - * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CommonLanguageSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.referenceDocsUri != null && Object.hasOwnProperty.call(message, "referenceDocsUri")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.referenceDocsUri); - if (message.destinations != null && message.destinations.length) { - writer.uint32(/* id 2, wireType 2 =*/18).fork(); - for (var i = 0; i < message.destinations.length; ++i) - writer.int32(message.destinations[i]); - writer.ldelim(); - } - return writer; - }; - - /** - * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.CommonLanguageSettings - * @static - * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CommonLanguageSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CommonLanguageSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.CommonLanguageSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CommonLanguageSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CommonLanguageSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.referenceDocsUri = reader.string(); - break; - } - case 2: { - if (!(message.destinations && message.destinations.length)) - message.destinations = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.destinations.push(reader.int32()); - } else - message.destinations.push(reader.int32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.CommonLanguageSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CommonLanguageSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CommonLanguageSettings message. - * @function verify - * @memberof google.api.CommonLanguageSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CommonLanguageSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) - if (!$util.isString(message.referenceDocsUri)) - return "referenceDocsUri: string expected"; - if (message.destinations != null && message.hasOwnProperty("destinations")) { - if (!Array.isArray(message.destinations)) - return "destinations: array expected"; - for (var i = 0; i < message.destinations.length; ++i) - switch (message.destinations[i]) { - default: - return "destinations: enum value[] expected"; - case 0: - case 10: - case 20: - break; - } - } - return null; - }; - - /** - * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.CommonLanguageSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings - */ - CommonLanguageSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.CommonLanguageSettings) - return object; - var message = new $root.google.api.CommonLanguageSettings(); - if (object.referenceDocsUri != null) - message.referenceDocsUri = String(object.referenceDocsUri); - if (object.destinations) { - if (!Array.isArray(object.destinations)) - throw TypeError(".google.api.CommonLanguageSettings.destinations: array expected"); - message.destinations = []; - for (var i = 0; i < object.destinations.length; ++i) - switch (object.destinations[i]) { - default: - if (typeof object.destinations[i] === "number") { - message.destinations[i] = object.destinations[i]; - break; - } - case "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": - case 0: - message.destinations[i] = 0; - break; - case "GITHUB": - case 10: - message.destinations[i] = 10; - break; - case "PACKAGE_MANAGER": - case 20: - message.destinations[i] = 20; - break; - } - } - return message; - }; - - /** - * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.CommonLanguageSettings - * @static - * @param {google.api.CommonLanguageSettings} message CommonLanguageSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CommonLanguageSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.destinations = []; - if (options.defaults) - object.referenceDocsUri = ""; - if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) - object.referenceDocsUri = message.referenceDocsUri; - if (message.destinations && message.destinations.length) { - object.destinations = []; - for (var j = 0; j < message.destinations.length; ++j) - object.destinations[j] = options.enums === String ? $root.google.api.ClientLibraryDestination[message.destinations[j]] === undefined ? message.destinations[j] : $root.google.api.ClientLibraryDestination[message.destinations[j]] : message.destinations[j]; - } - return object; - }; - - /** - * Converts this CommonLanguageSettings to JSON. - * @function toJSON - * @memberof google.api.CommonLanguageSettings - * @instance - * @returns {Object.} JSON object - */ - CommonLanguageSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CommonLanguageSettings - * @function getTypeUrl - * @memberof google.api.CommonLanguageSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CommonLanguageSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.CommonLanguageSettings"; - }; - - return CommonLanguageSettings; - })(); - - api.ClientLibrarySettings = (function() { - - /** - * Properties of a ClientLibrarySettings. - * @memberof google.api - * @interface IClientLibrarySettings - * @property {string|null} [version] ClientLibrarySettings version - * @property {google.api.LaunchStage|null} [launchStage] ClientLibrarySettings launchStage - * @property {boolean|null} [restNumericEnums] ClientLibrarySettings restNumericEnums - * @property {google.api.IJavaSettings|null} [javaSettings] ClientLibrarySettings javaSettings - * @property {google.api.ICppSettings|null} [cppSettings] ClientLibrarySettings cppSettings - * @property {google.api.IPhpSettings|null} [phpSettings] ClientLibrarySettings phpSettings - * @property {google.api.IPythonSettings|null} [pythonSettings] ClientLibrarySettings pythonSettings - * @property {google.api.INodeSettings|null} [nodeSettings] ClientLibrarySettings nodeSettings - * @property {google.api.IDotnetSettings|null} [dotnetSettings] ClientLibrarySettings dotnetSettings - * @property {google.api.IRubySettings|null} [rubySettings] ClientLibrarySettings rubySettings - * @property {google.api.IGoSettings|null} [goSettings] ClientLibrarySettings goSettings - */ - - /** - * Constructs a new ClientLibrarySettings. - * @memberof google.api - * @classdesc Represents a ClientLibrarySettings. - * @implements IClientLibrarySettings - * @constructor - * @param {google.api.IClientLibrarySettings=} [properties] Properties to set - */ - function ClientLibrarySettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ClientLibrarySettings version. - * @member {string} version - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.version = ""; - - /** - * ClientLibrarySettings launchStage. - * @member {google.api.LaunchStage} launchStage - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.launchStage = 0; - - /** - * ClientLibrarySettings restNumericEnums. - * @member {boolean} restNumericEnums - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.restNumericEnums = false; - - /** - * ClientLibrarySettings javaSettings. - * @member {google.api.IJavaSettings|null|undefined} javaSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.javaSettings = null; - - /** - * ClientLibrarySettings cppSettings. - * @member {google.api.ICppSettings|null|undefined} cppSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.cppSettings = null; - - /** - * ClientLibrarySettings phpSettings. - * @member {google.api.IPhpSettings|null|undefined} phpSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.phpSettings = null; - - /** - * ClientLibrarySettings pythonSettings. - * @member {google.api.IPythonSettings|null|undefined} pythonSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.pythonSettings = null; - - /** - * ClientLibrarySettings nodeSettings. - * @member {google.api.INodeSettings|null|undefined} nodeSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.nodeSettings = null; - - /** - * ClientLibrarySettings dotnetSettings. - * @member {google.api.IDotnetSettings|null|undefined} dotnetSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.dotnetSettings = null; - - /** - * ClientLibrarySettings rubySettings. - * @member {google.api.IRubySettings|null|undefined} rubySettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.rubySettings = null; - - /** - * ClientLibrarySettings goSettings. - * @member {google.api.IGoSettings|null|undefined} goSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.goSettings = null; - - /** - * Creates a new ClientLibrarySettings instance using the specified properties. - * @function create - * @memberof google.api.ClientLibrarySettings - * @static - * @param {google.api.IClientLibrarySettings=} [properties] Properties to set - * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings instance - */ - ClientLibrarySettings.create = function create(properties) { - return new ClientLibrarySettings(properties); - }; - - /** - * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. - * @function encode - * @memberof google.api.ClientLibrarySettings - * @static - * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClientLibrarySettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); - if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.launchStage); - if (message.restNumericEnums != null && Object.hasOwnProperty.call(message, "restNumericEnums")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.restNumericEnums); - if (message.javaSettings != null && Object.hasOwnProperty.call(message, "javaSettings")) - $root.google.api.JavaSettings.encode(message.javaSettings, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); - if (message.cppSettings != null && Object.hasOwnProperty.call(message, "cppSettings")) - $root.google.api.CppSettings.encode(message.cppSettings, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); - if (message.phpSettings != null && Object.hasOwnProperty.call(message, "phpSettings")) - $root.google.api.PhpSettings.encode(message.phpSettings, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); - if (message.pythonSettings != null && Object.hasOwnProperty.call(message, "pythonSettings")) - $root.google.api.PythonSettings.encode(message.pythonSettings, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); - if (message.nodeSettings != null && Object.hasOwnProperty.call(message, "nodeSettings")) - $root.google.api.NodeSettings.encode(message.nodeSettings, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); - if (message.dotnetSettings != null && Object.hasOwnProperty.call(message, "dotnetSettings")) - $root.google.api.DotnetSettings.encode(message.dotnetSettings, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); - if (message.rubySettings != null && Object.hasOwnProperty.call(message, "rubySettings")) - $root.google.api.RubySettings.encode(message.rubySettings, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); - if (message.goSettings != null && Object.hasOwnProperty.call(message, "goSettings")) - $root.google.api.GoSettings.encode(message.goSettings, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.ClientLibrarySettings - * @static - * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClientLibrarySettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ClientLibrarySettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.ClientLibrarySettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClientLibrarySettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ClientLibrarySettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.version = reader.string(); - break; - } - case 2: { - message.launchStage = reader.int32(); - break; - } - case 3: { - message.restNumericEnums = reader.bool(); - break; - } - case 21: { - message.javaSettings = $root.google.api.JavaSettings.decode(reader, reader.uint32()); - break; - } - case 22: { - message.cppSettings = $root.google.api.CppSettings.decode(reader, reader.uint32()); - break; - } - case 23: { - message.phpSettings = $root.google.api.PhpSettings.decode(reader, reader.uint32()); - break; - } - case 24: { - message.pythonSettings = $root.google.api.PythonSettings.decode(reader, reader.uint32()); - break; - } - case 25: { - message.nodeSettings = $root.google.api.NodeSettings.decode(reader, reader.uint32()); - break; - } - case 26: { - message.dotnetSettings = $root.google.api.DotnetSettings.decode(reader, reader.uint32()); - break; - } - case 27: { - message.rubySettings = $root.google.api.RubySettings.decode(reader, reader.uint32()); - break; - } - case 28: { - message.goSettings = $root.google.api.GoSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.ClientLibrarySettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClientLibrarySettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ClientLibrarySettings message. - * @function verify - * @memberof google.api.ClientLibrarySettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ClientLibrarySettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.version != null && message.hasOwnProperty("version")) - if (!$util.isString(message.version)) - return "version: string expected"; - if (message.launchStage != null && message.hasOwnProperty("launchStage")) - switch (message.launchStage) { - default: - return "launchStage: enum value expected"; - case 0: - case 6: - case 7: - case 1: - case 2: - case 3: - case 4: - case 5: - break; - } - if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) - if (typeof message.restNumericEnums !== "boolean") - return "restNumericEnums: boolean expected"; - if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) { - var error = $root.google.api.JavaSettings.verify(message.javaSettings); - if (error) - return "javaSettings." + error; - } - if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) { - var error = $root.google.api.CppSettings.verify(message.cppSettings); - if (error) - return "cppSettings." + error; - } - if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) { - var error = $root.google.api.PhpSettings.verify(message.phpSettings); - if (error) - return "phpSettings." + error; - } - if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) { - var error = $root.google.api.PythonSettings.verify(message.pythonSettings); - if (error) - return "pythonSettings." + error; - } - if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) { - var error = $root.google.api.NodeSettings.verify(message.nodeSettings); - if (error) - return "nodeSettings." + error; - } - if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) { - var error = $root.google.api.DotnetSettings.verify(message.dotnetSettings); - if (error) - return "dotnetSettings." + error; - } - if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) { - var error = $root.google.api.RubySettings.verify(message.rubySettings); - if (error) - return "rubySettings." + error; - } - if (message.goSettings != null && message.hasOwnProperty("goSettings")) { - var error = $root.google.api.GoSettings.verify(message.goSettings); - if (error) - return "goSettings." + error; - } - return null; - }; - - /** - * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.ClientLibrarySettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings - */ - ClientLibrarySettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.ClientLibrarySettings) - return object; - var message = new $root.google.api.ClientLibrarySettings(); - if (object.version != null) - message.version = String(object.version); - switch (object.launchStage) { - default: - if (typeof object.launchStage === "number") { - message.launchStage = object.launchStage; - break; - } - break; - case "LAUNCH_STAGE_UNSPECIFIED": - case 0: - message.launchStage = 0; - break; - case "UNIMPLEMENTED": - case 6: - message.launchStage = 6; - break; - case "PRELAUNCH": - case 7: - message.launchStage = 7; - break; - case "EARLY_ACCESS": - case 1: - message.launchStage = 1; - break; - case "ALPHA": - case 2: - message.launchStage = 2; - break; - case "BETA": - case 3: - message.launchStage = 3; - break; - case "GA": - case 4: - message.launchStage = 4; - break; - case "DEPRECATED": - case 5: - message.launchStage = 5; - break; - } - if (object.restNumericEnums != null) - message.restNumericEnums = Boolean(object.restNumericEnums); - if (object.javaSettings != null) { - if (typeof object.javaSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.javaSettings: object expected"); - message.javaSettings = $root.google.api.JavaSettings.fromObject(object.javaSettings); - } - if (object.cppSettings != null) { - if (typeof object.cppSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.cppSettings: object expected"); - message.cppSettings = $root.google.api.CppSettings.fromObject(object.cppSettings); - } - if (object.phpSettings != null) { - if (typeof object.phpSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.phpSettings: object expected"); - message.phpSettings = $root.google.api.PhpSettings.fromObject(object.phpSettings); - } - if (object.pythonSettings != null) { - if (typeof object.pythonSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.pythonSettings: object expected"); - message.pythonSettings = $root.google.api.PythonSettings.fromObject(object.pythonSettings); - } - if (object.nodeSettings != null) { - if (typeof object.nodeSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.nodeSettings: object expected"); - message.nodeSettings = $root.google.api.NodeSettings.fromObject(object.nodeSettings); - } - if (object.dotnetSettings != null) { - if (typeof object.dotnetSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.dotnetSettings: object expected"); - message.dotnetSettings = $root.google.api.DotnetSettings.fromObject(object.dotnetSettings); - } - if (object.rubySettings != null) { - if (typeof object.rubySettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.rubySettings: object expected"); - message.rubySettings = $root.google.api.RubySettings.fromObject(object.rubySettings); - } - if (object.goSettings != null) { - if (typeof object.goSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.goSettings: object expected"); - message.goSettings = $root.google.api.GoSettings.fromObject(object.goSettings); - } - return message; - }; - - /** - * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.ClientLibrarySettings - * @static - * @param {google.api.ClientLibrarySettings} message ClientLibrarySettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ClientLibrarySettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.version = ""; - object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; - object.restNumericEnums = false; - object.javaSettings = null; - object.cppSettings = null; - object.phpSettings = null; - object.pythonSettings = null; - object.nodeSettings = null; - object.dotnetSettings = null; - object.rubySettings = null; - object.goSettings = null; - } - if (message.version != null && message.hasOwnProperty("version")) - object.version = message.version; - if (message.launchStage != null && message.hasOwnProperty("launchStage")) - object.launchStage = options.enums === String ? $root.google.api.LaunchStage[message.launchStage] === undefined ? message.launchStage : $root.google.api.LaunchStage[message.launchStage] : message.launchStage; - if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) - object.restNumericEnums = message.restNumericEnums; - if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) - object.javaSettings = $root.google.api.JavaSettings.toObject(message.javaSettings, options); - if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) - object.cppSettings = $root.google.api.CppSettings.toObject(message.cppSettings, options); - if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) - object.phpSettings = $root.google.api.PhpSettings.toObject(message.phpSettings, options); - if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) - object.pythonSettings = $root.google.api.PythonSettings.toObject(message.pythonSettings, options); - if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) - object.nodeSettings = $root.google.api.NodeSettings.toObject(message.nodeSettings, options); - if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) - object.dotnetSettings = $root.google.api.DotnetSettings.toObject(message.dotnetSettings, options); - if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) - object.rubySettings = $root.google.api.RubySettings.toObject(message.rubySettings, options); - if (message.goSettings != null && message.hasOwnProperty("goSettings")) - object.goSettings = $root.google.api.GoSettings.toObject(message.goSettings, options); - return object; - }; - - /** - * Converts this ClientLibrarySettings to JSON. - * @function toJSON - * @memberof google.api.ClientLibrarySettings - * @instance - * @returns {Object.} JSON object - */ - ClientLibrarySettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ClientLibrarySettings - * @function getTypeUrl - * @memberof google.api.ClientLibrarySettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ClientLibrarySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.ClientLibrarySettings"; - }; - - return ClientLibrarySettings; - })(); - - api.Publishing = (function() { - - /** - * Properties of a Publishing. - * @memberof google.api - * @interface IPublishing - * @property {Array.|null} [methodSettings] Publishing methodSettings - * @property {string|null} [newIssueUri] Publishing newIssueUri - * @property {string|null} [documentationUri] Publishing documentationUri - * @property {string|null} [apiShortName] Publishing apiShortName - * @property {string|null} [githubLabel] Publishing githubLabel - * @property {Array.|null} [codeownerGithubTeams] Publishing codeownerGithubTeams - * @property {string|null} [docTagPrefix] Publishing docTagPrefix - * @property {google.api.ClientLibraryOrganization|null} [organization] Publishing organization - * @property {Array.|null} [librarySettings] Publishing librarySettings - * @property {string|null} [protoReferenceDocumentationUri] Publishing protoReferenceDocumentationUri - * @property {string|null} [restReferenceDocumentationUri] Publishing restReferenceDocumentationUri - */ - - /** - * Constructs a new Publishing. - * @memberof google.api - * @classdesc Represents a Publishing. - * @implements IPublishing - * @constructor - * @param {google.api.IPublishing=} [properties] Properties to set - */ - function Publishing(properties) { - this.methodSettings = []; - this.codeownerGithubTeams = []; - this.librarySettings = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Publishing methodSettings. - * @member {Array.} methodSettings - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.methodSettings = $util.emptyArray; - - /** - * Publishing newIssueUri. - * @member {string} newIssueUri - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.newIssueUri = ""; - - /** - * Publishing documentationUri. - * @member {string} documentationUri - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.documentationUri = ""; - - /** - * Publishing apiShortName. - * @member {string} apiShortName - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.apiShortName = ""; - - /** - * Publishing githubLabel. - * @member {string} githubLabel - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.githubLabel = ""; - - /** - * Publishing codeownerGithubTeams. - * @member {Array.} codeownerGithubTeams - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.codeownerGithubTeams = $util.emptyArray; - - /** - * Publishing docTagPrefix. - * @member {string} docTagPrefix - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.docTagPrefix = ""; - - /** - * Publishing organization. - * @member {google.api.ClientLibraryOrganization} organization - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.organization = 0; - - /** - * Publishing librarySettings. - * @member {Array.} librarySettings - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.librarySettings = $util.emptyArray; - - /** - * Publishing protoReferenceDocumentationUri. - * @member {string} protoReferenceDocumentationUri - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.protoReferenceDocumentationUri = ""; - - /** - * Publishing restReferenceDocumentationUri. - * @member {string} restReferenceDocumentationUri - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.restReferenceDocumentationUri = ""; - - /** - * Creates a new Publishing instance using the specified properties. - * @function create - * @memberof google.api.Publishing - * @static - * @param {google.api.IPublishing=} [properties] Properties to set - * @returns {google.api.Publishing} Publishing instance - */ - Publishing.create = function create(properties) { - return new Publishing(properties); - }; - - /** - * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. - * @function encode - * @memberof google.api.Publishing - * @static - * @param {google.api.IPublishing} message Publishing message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Publishing.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.methodSettings != null && message.methodSettings.length) - for (var i = 0; i < message.methodSettings.length; ++i) - $root.google.api.MethodSettings.encode(message.methodSettings[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.newIssueUri != null && Object.hasOwnProperty.call(message, "newIssueUri")) - writer.uint32(/* id 101, wireType 2 =*/810).string(message.newIssueUri); - if (message.documentationUri != null && Object.hasOwnProperty.call(message, "documentationUri")) - writer.uint32(/* id 102, wireType 2 =*/818).string(message.documentationUri); - if (message.apiShortName != null && Object.hasOwnProperty.call(message, "apiShortName")) - writer.uint32(/* id 103, wireType 2 =*/826).string(message.apiShortName); - if (message.githubLabel != null && Object.hasOwnProperty.call(message, "githubLabel")) - writer.uint32(/* id 104, wireType 2 =*/834).string(message.githubLabel); - if (message.codeownerGithubTeams != null && message.codeownerGithubTeams.length) - for (var i = 0; i < message.codeownerGithubTeams.length; ++i) - writer.uint32(/* id 105, wireType 2 =*/842).string(message.codeownerGithubTeams[i]); - if (message.docTagPrefix != null && Object.hasOwnProperty.call(message, "docTagPrefix")) - writer.uint32(/* id 106, wireType 2 =*/850).string(message.docTagPrefix); - if (message.organization != null && Object.hasOwnProperty.call(message, "organization")) - writer.uint32(/* id 107, wireType 0 =*/856).int32(message.organization); - if (message.librarySettings != null && message.librarySettings.length) - for (var i = 0; i < message.librarySettings.length; ++i) - $root.google.api.ClientLibrarySettings.encode(message.librarySettings[i], writer.uint32(/* id 109, wireType 2 =*/874).fork()).ldelim(); - if (message.protoReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "protoReferenceDocumentationUri")) - writer.uint32(/* id 110, wireType 2 =*/882).string(message.protoReferenceDocumentationUri); - if (message.restReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "restReferenceDocumentationUri")) - writer.uint32(/* id 111, wireType 2 =*/890).string(message.restReferenceDocumentationUri); - return writer; - }; - - /** - * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.Publishing - * @static - * @param {google.api.IPublishing} message Publishing message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Publishing.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Publishing message from the specified reader or buffer. - * @function decode - * @memberof google.api.Publishing - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.Publishing} Publishing - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Publishing.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Publishing(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - if (!(message.methodSettings && message.methodSettings.length)) - message.methodSettings = []; - message.methodSettings.push($root.google.api.MethodSettings.decode(reader, reader.uint32())); - break; - } - case 101: { - message.newIssueUri = reader.string(); - break; - } - case 102: { - message.documentationUri = reader.string(); - break; - } - case 103: { - message.apiShortName = reader.string(); - break; - } - case 104: { - message.githubLabel = reader.string(); - break; - } - case 105: { - if (!(message.codeownerGithubTeams && message.codeownerGithubTeams.length)) - message.codeownerGithubTeams = []; - message.codeownerGithubTeams.push(reader.string()); - break; - } - case 106: { - message.docTagPrefix = reader.string(); - break; - } - case 107: { - message.organization = reader.int32(); - break; - } - case 109: { - if (!(message.librarySettings && message.librarySettings.length)) - message.librarySettings = []; - message.librarySettings.push($root.google.api.ClientLibrarySettings.decode(reader, reader.uint32())); - break; - } - case 110: { - message.protoReferenceDocumentationUri = reader.string(); - break; - } - case 111: { - message.restReferenceDocumentationUri = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Publishing message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.Publishing - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.Publishing} Publishing - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Publishing.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Publishing message. - * @function verify - * @memberof google.api.Publishing - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Publishing.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.methodSettings != null && message.hasOwnProperty("methodSettings")) { - if (!Array.isArray(message.methodSettings)) - return "methodSettings: array expected"; - for (var i = 0; i < message.methodSettings.length; ++i) { - var error = $root.google.api.MethodSettings.verify(message.methodSettings[i]); - if (error) - return "methodSettings." + error; - } - } - if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) - if (!$util.isString(message.newIssueUri)) - return "newIssueUri: string expected"; - if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) - if (!$util.isString(message.documentationUri)) - return "documentationUri: string expected"; - if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) - if (!$util.isString(message.apiShortName)) - return "apiShortName: string expected"; - if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) - if (!$util.isString(message.githubLabel)) - return "githubLabel: string expected"; - if (message.codeownerGithubTeams != null && message.hasOwnProperty("codeownerGithubTeams")) { - if (!Array.isArray(message.codeownerGithubTeams)) - return "codeownerGithubTeams: array expected"; - for (var i = 0; i < message.codeownerGithubTeams.length; ++i) - if (!$util.isString(message.codeownerGithubTeams[i])) - return "codeownerGithubTeams: string[] expected"; - } - if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) - if (!$util.isString(message.docTagPrefix)) - return "docTagPrefix: string expected"; - if (message.organization != null && message.hasOwnProperty("organization")) - switch (message.organization) { - default: - return "organization: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - break; - } - if (message.librarySettings != null && message.hasOwnProperty("librarySettings")) { - if (!Array.isArray(message.librarySettings)) - return "librarySettings: array expected"; - for (var i = 0; i < message.librarySettings.length; ++i) { - var error = $root.google.api.ClientLibrarySettings.verify(message.librarySettings[i]); - if (error) - return "librarySettings." + error; - } - } - if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) - if (!$util.isString(message.protoReferenceDocumentationUri)) - return "protoReferenceDocumentationUri: string expected"; - if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) - if (!$util.isString(message.restReferenceDocumentationUri)) - return "restReferenceDocumentationUri: string expected"; - return null; - }; - - /** - * Creates a Publishing message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.Publishing - * @static - * @param {Object.} object Plain object - * @returns {google.api.Publishing} Publishing - */ - Publishing.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.Publishing) - return object; - var message = new $root.google.api.Publishing(); - if (object.methodSettings) { - if (!Array.isArray(object.methodSettings)) - throw TypeError(".google.api.Publishing.methodSettings: array expected"); - message.methodSettings = []; - for (var i = 0; i < object.methodSettings.length; ++i) { - if (typeof object.methodSettings[i] !== "object") - throw TypeError(".google.api.Publishing.methodSettings: object expected"); - message.methodSettings[i] = $root.google.api.MethodSettings.fromObject(object.methodSettings[i]); - } - } - if (object.newIssueUri != null) - message.newIssueUri = String(object.newIssueUri); - if (object.documentationUri != null) - message.documentationUri = String(object.documentationUri); - if (object.apiShortName != null) - message.apiShortName = String(object.apiShortName); - if (object.githubLabel != null) - message.githubLabel = String(object.githubLabel); - if (object.codeownerGithubTeams) { - if (!Array.isArray(object.codeownerGithubTeams)) - throw TypeError(".google.api.Publishing.codeownerGithubTeams: array expected"); - message.codeownerGithubTeams = []; - for (var i = 0; i < object.codeownerGithubTeams.length; ++i) - message.codeownerGithubTeams[i] = String(object.codeownerGithubTeams[i]); - } - if (object.docTagPrefix != null) - message.docTagPrefix = String(object.docTagPrefix); - switch (object.organization) { - default: - if (typeof object.organization === "number") { - message.organization = object.organization; - break; - } - break; - case "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": - case 0: - message.organization = 0; - break; - case "CLOUD": - case 1: - message.organization = 1; - break; - case "ADS": - case 2: - message.organization = 2; - break; - case "PHOTOS": - case 3: - message.organization = 3; - break; - case "STREET_VIEW": - case 4: - message.organization = 4; - break; - case "SHOPPING": - case 5: - message.organization = 5; - break; - case "GEO": - case 6: - message.organization = 6; - break; - case "GENERATIVE_AI": - case 7: - message.organization = 7; - break; - } - if (object.librarySettings) { - if (!Array.isArray(object.librarySettings)) - throw TypeError(".google.api.Publishing.librarySettings: array expected"); - message.librarySettings = []; - for (var i = 0; i < object.librarySettings.length; ++i) { - if (typeof object.librarySettings[i] !== "object") - throw TypeError(".google.api.Publishing.librarySettings: object expected"); - message.librarySettings[i] = $root.google.api.ClientLibrarySettings.fromObject(object.librarySettings[i]); - } - } - if (object.protoReferenceDocumentationUri != null) - message.protoReferenceDocumentationUri = String(object.protoReferenceDocumentationUri); - if (object.restReferenceDocumentationUri != null) - message.restReferenceDocumentationUri = String(object.restReferenceDocumentationUri); - return message; - }; - - /** - * Creates a plain object from a Publishing message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.Publishing - * @static - * @param {google.api.Publishing} message Publishing - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Publishing.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.methodSettings = []; - object.codeownerGithubTeams = []; - object.librarySettings = []; - } - if (options.defaults) { - object.newIssueUri = ""; - object.documentationUri = ""; - object.apiShortName = ""; - object.githubLabel = ""; - object.docTagPrefix = ""; - object.organization = options.enums === String ? "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED" : 0; - object.protoReferenceDocumentationUri = ""; - object.restReferenceDocumentationUri = ""; - } - if (message.methodSettings && message.methodSettings.length) { - object.methodSettings = []; - for (var j = 0; j < message.methodSettings.length; ++j) - object.methodSettings[j] = $root.google.api.MethodSettings.toObject(message.methodSettings[j], options); - } - if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) - object.newIssueUri = message.newIssueUri; - if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) - object.documentationUri = message.documentationUri; - if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) - object.apiShortName = message.apiShortName; - if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) - object.githubLabel = message.githubLabel; - if (message.codeownerGithubTeams && message.codeownerGithubTeams.length) { - object.codeownerGithubTeams = []; - for (var j = 0; j < message.codeownerGithubTeams.length; ++j) - object.codeownerGithubTeams[j] = message.codeownerGithubTeams[j]; - } - if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) - object.docTagPrefix = message.docTagPrefix; - if (message.organization != null && message.hasOwnProperty("organization")) - object.organization = options.enums === String ? $root.google.api.ClientLibraryOrganization[message.organization] === undefined ? message.organization : $root.google.api.ClientLibraryOrganization[message.organization] : message.organization; - if (message.librarySettings && message.librarySettings.length) { - object.librarySettings = []; - for (var j = 0; j < message.librarySettings.length; ++j) - object.librarySettings[j] = $root.google.api.ClientLibrarySettings.toObject(message.librarySettings[j], options); - } - if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) - object.protoReferenceDocumentationUri = message.protoReferenceDocumentationUri; - if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) - object.restReferenceDocumentationUri = message.restReferenceDocumentationUri; - return object; - }; - - /** - * Converts this Publishing to JSON. - * @function toJSON - * @memberof google.api.Publishing - * @instance - * @returns {Object.} JSON object - */ - Publishing.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Publishing - * @function getTypeUrl - * @memberof google.api.Publishing - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Publishing.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.Publishing"; - }; - - return Publishing; - })(); - - api.JavaSettings = (function() { - - /** - * Properties of a JavaSettings. - * @memberof google.api - * @interface IJavaSettings - * @property {string|null} [libraryPackage] JavaSettings libraryPackage - * @property {Object.|null} [serviceClassNames] JavaSettings serviceClassNames - * @property {google.api.ICommonLanguageSettings|null} [common] JavaSettings common - */ - - /** - * Constructs a new JavaSettings. - * @memberof google.api - * @classdesc Represents a JavaSettings. - * @implements IJavaSettings - * @constructor - * @param {google.api.IJavaSettings=} [properties] Properties to set - */ - function JavaSettings(properties) { - this.serviceClassNames = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * JavaSettings libraryPackage. - * @member {string} libraryPackage - * @memberof google.api.JavaSettings - * @instance - */ - JavaSettings.prototype.libraryPackage = ""; - - /** - * JavaSettings serviceClassNames. - * @member {Object.} serviceClassNames - * @memberof google.api.JavaSettings - * @instance - */ - JavaSettings.prototype.serviceClassNames = $util.emptyObject; - - /** - * JavaSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.JavaSettings - * @instance - */ - JavaSettings.prototype.common = null; - - /** - * Creates a new JavaSettings instance using the specified properties. - * @function create - * @memberof google.api.JavaSettings - * @static - * @param {google.api.IJavaSettings=} [properties] Properties to set - * @returns {google.api.JavaSettings} JavaSettings instance - */ - JavaSettings.create = function create(properties) { - return new JavaSettings(properties); - }; - - /** - * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. - * @function encode - * @memberof google.api.JavaSettings - * @static - * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - JavaSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.libraryPackage != null && Object.hasOwnProperty.call(message, "libraryPackage")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.libraryPackage); - if (message.serviceClassNames != null && Object.hasOwnProperty.call(message, "serviceClassNames")) - for (var keys = Object.keys(message.serviceClassNames), i = 0; i < keys.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.serviceClassNames[keys[i]]).ldelim(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.JavaSettings - * @static - * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - JavaSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a JavaSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.JavaSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.JavaSettings} JavaSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - JavaSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.JavaSettings(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.libraryPackage = reader.string(); - break; - } - case 2: { - if (message.serviceClassNames === $util.emptyObject) - message.serviceClassNames = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.serviceClassNames[key] = value; - break; - } - case 3: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a JavaSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.JavaSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.JavaSettings} JavaSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - JavaSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a JavaSettings message. - * @function verify - * @memberof google.api.JavaSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - JavaSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) - if (!$util.isString(message.libraryPackage)) - return "libraryPackage: string expected"; - if (message.serviceClassNames != null && message.hasOwnProperty("serviceClassNames")) { - if (!$util.isObject(message.serviceClassNames)) - return "serviceClassNames: object expected"; - var key = Object.keys(message.serviceClassNames); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.serviceClassNames[key[i]])) - return "serviceClassNames: string{k:string} expected"; - } - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.JavaSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.JavaSettings} JavaSettings - */ - JavaSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.JavaSettings) - return object; - var message = new $root.google.api.JavaSettings(); - if (object.libraryPackage != null) - message.libraryPackage = String(object.libraryPackage); - if (object.serviceClassNames) { - if (typeof object.serviceClassNames !== "object") - throw TypeError(".google.api.JavaSettings.serviceClassNames: object expected"); - message.serviceClassNames = {}; - for (var keys = Object.keys(object.serviceClassNames), i = 0; i < keys.length; ++i) - message.serviceClassNames[keys[i]] = String(object.serviceClassNames[keys[i]]); - } - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.JavaSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.JavaSettings - * @static - * @param {google.api.JavaSettings} message JavaSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - JavaSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.serviceClassNames = {}; - if (options.defaults) { - object.libraryPackage = ""; - object.common = null; - } - if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) - object.libraryPackage = message.libraryPackage; - var keys2; - if (message.serviceClassNames && (keys2 = Object.keys(message.serviceClassNames)).length) { - object.serviceClassNames = {}; - for (var j = 0; j < keys2.length; ++j) - object.serviceClassNames[keys2[j]] = message.serviceClassNames[keys2[j]]; - } - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this JavaSettings to JSON. - * @function toJSON - * @memberof google.api.JavaSettings - * @instance - * @returns {Object.} JSON object - */ - JavaSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for JavaSettings - * @function getTypeUrl - * @memberof google.api.JavaSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - JavaSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.JavaSettings"; - }; - - return JavaSettings; - })(); - - api.CppSettings = (function() { - - /** - * Properties of a CppSettings. - * @memberof google.api - * @interface ICppSettings - * @property {google.api.ICommonLanguageSettings|null} [common] CppSettings common - */ - - /** - * Constructs a new CppSettings. - * @memberof google.api - * @classdesc Represents a CppSettings. - * @implements ICppSettings - * @constructor - * @param {google.api.ICppSettings=} [properties] Properties to set - */ - function CppSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CppSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.CppSettings - * @instance - */ - CppSettings.prototype.common = null; - - /** - * Creates a new CppSettings instance using the specified properties. - * @function create - * @memberof google.api.CppSettings - * @static - * @param {google.api.ICppSettings=} [properties] Properties to set - * @returns {google.api.CppSettings} CppSettings instance - */ - CppSettings.create = function create(properties) { - return new CppSettings(properties); - }; - - /** - * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. - * @function encode - * @memberof google.api.CppSettings - * @static - * @param {google.api.ICppSettings} message CppSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CppSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.CppSettings - * @static - * @param {google.api.ICppSettings} message CppSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CppSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CppSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.CppSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.CppSettings} CppSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CppSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CppSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CppSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.CppSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.CppSettings} CppSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CppSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CppSettings message. - * @function verify - * @memberof google.api.CppSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CppSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.CppSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.CppSettings} CppSettings - */ - CppSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.CppSettings) - return object; - var message = new $root.google.api.CppSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.CppSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a CppSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.CppSettings - * @static - * @param {google.api.CppSettings} message CppSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CppSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this CppSettings to JSON. - * @function toJSON - * @memberof google.api.CppSettings - * @instance - * @returns {Object.} JSON object - */ - CppSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CppSettings - * @function getTypeUrl - * @memberof google.api.CppSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CppSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.CppSettings"; - }; - - return CppSettings; - })(); - - api.PhpSettings = (function() { - - /** - * Properties of a PhpSettings. - * @memberof google.api - * @interface IPhpSettings - * @property {google.api.ICommonLanguageSettings|null} [common] PhpSettings common - */ - - /** - * Constructs a new PhpSettings. - * @memberof google.api - * @classdesc Represents a PhpSettings. - * @implements IPhpSettings - * @constructor - * @param {google.api.IPhpSettings=} [properties] Properties to set - */ - function PhpSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PhpSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.PhpSettings - * @instance - */ - PhpSettings.prototype.common = null; - - /** - * Creates a new PhpSettings instance using the specified properties. - * @function create - * @memberof google.api.PhpSettings - * @static - * @param {google.api.IPhpSettings=} [properties] Properties to set - * @returns {google.api.PhpSettings} PhpSettings instance - */ - PhpSettings.create = function create(properties) { - return new PhpSettings(properties); - }; - - /** - * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. - * @function encode - * @memberof google.api.PhpSettings - * @static - * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PhpSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.PhpSettings - * @static - * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PhpSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PhpSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.PhpSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.PhpSettings} PhpSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PhpSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PhpSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PhpSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.PhpSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.PhpSettings} PhpSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PhpSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PhpSettings message. - * @function verify - * @memberof google.api.PhpSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PhpSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.PhpSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.PhpSettings} PhpSettings - */ - PhpSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.PhpSettings) - return object; - var message = new $root.google.api.PhpSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.PhpSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.PhpSettings - * @static - * @param {google.api.PhpSettings} message PhpSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PhpSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this PhpSettings to JSON. - * @function toJSON - * @memberof google.api.PhpSettings - * @instance - * @returns {Object.} JSON object - */ - PhpSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PhpSettings - * @function getTypeUrl - * @memberof google.api.PhpSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PhpSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.PhpSettings"; - }; - - return PhpSettings; - })(); - - api.PythonSettings = (function() { - - /** - * Properties of a PythonSettings. - * @memberof google.api - * @interface IPythonSettings - * @property {google.api.ICommonLanguageSettings|null} [common] PythonSettings common - */ - - /** - * Constructs a new PythonSettings. - * @memberof google.api - * @classdesc Represents a PythonSettings. - * @implements IPythonSettings - * @constructor - * @param {google.api.IPythonSettings=} [properties] Properties to set - */ - function PythonSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PythonSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.PythonSettings - * @instance - */ - PythonSettings.prototype.common = null; - - /** - * Creates a new PythonSettings instance using the specified properties. - * @function create - * @memberof google.api.PythonSettings - * @static - * @param {google.api.IPythonSettings=} [properties] Properties to set - * @returns {google.api.PythonSettings} PythonSettings instance - */ - PythonSettings.create = function create(properties) { - return new PythonSettings(properties); - }; - - /** - * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. - * @function encode - * @memberof google.api.PythonSettings - * @static - * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PythonSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.PythonSettings - * @static - * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PythonSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PythonSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.PythonSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.PythonSettings} PythonSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PythonSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PythonSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PythonSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.PythonSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.PythonSettings} PythonSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PythonSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PythonSettings message. - * @function verify - * @memberof google.api.PythonSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PythonSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.PythonSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.PythonSettings} PythonSettings - */ - PythonSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.PythonSettings) - return object; - var message = new $root.google.api.PythonSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.PythonSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.PythonSettings - * @static - * @param {google.api.PythonSettings} message PythonSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PythonSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this PythonSettings to JSON. - * @function toJSON - * @memberof google.api.PythonSettings - * @instance - * @returns {Object.} JSON object - */ - PythonSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PythonSettings - * @function getTypeUrl - * @memberof google.api.PythonSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PythonSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.PythonSettings"; - }; - - return PythonSettings; - })(); - - api.NodeSettings = (function() { - - /** - * Properties of a NodeSettings. - * @memberof google.api - * @interface INodeSettings - * @property {google.api.ICommonLanguageSettings|null} [common] NodeSettings common - */ - - /** - * Constructs a new NodeSettings. - * @memberof google.api - * @classdesc Represents a NodeSettings. - * @implements INodeSettings - * @constructor - * @param {google.api.INodeSettings=} [properties] Properties to set - */ - function NodeSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * NodeSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.NodeSettings - * @instance - */ - NodeSettings.prototype.common = null; - - /** - * Creates a new NodeSettings instance using the specified properties. - * @function create - * @memberof google.api.NodeSettings - * @static - * @param {google.api.INodeSettings=} [properties] Properties to set - * @returns {google.api.NodeSettings} NodeSettings instance - */ - NodeSettings.create = function create(properties) { - return new NodeSettings(properties); - }; - - /** - * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. - * @function encode - * @memberof google.api.NodeSettings - * @static - * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NodeSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.NodeSettings - * @static - * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NodeSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a NodeSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.NodeSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.NodeSettings} NodeSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NodeSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.NodeSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a NodeSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.NodeSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.NodeSettings} NodeSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NodeSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a NodeSettings message. - * @function verify - * @memberof google.api.NodeSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - NodeSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.NodeSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.NodeSettings} NodeSettings - */ - NodeSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.NodeSettings) - return object; - var message = new $root.google.api.NodeSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.NodeSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.NodeSettings - * @static - * @param {google.api.NodeSettings} message NodeSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - NodeSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this NodeSettings to JSON. - * @function toJSON - * @memberof google.api.NodeSettings - * @instance - * @returns {Object.} JSON object - */ - NodeSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for NodeSettings - * @function getTypeUrl - * @memberof google.api.NodeSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - NodeSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.NodeSettings"; - }; - - return NodeSettings; - })(); - - api.DotnetSettings = (function() { - - /** - * Properties of a DotnetSettings. - * @memberof google.api - * @interface IDotnetSettings - * @property {google.api.ICommonLanguageSettings|null} [common] DotnetSettings common - * @property {Object.|null} [renamedServices] DotnetSettings renamedServices - * @property {Object.|null} [renamedResources] DotnetSettings renamedResources - * @property {Array.|null} [ignoredResources] DotnetSettings ignoredResources - * @property {Array.|null} [forcedNamespaceAliases] DotnetSettings forcedNamespaceAliases - * @property {Array.|null} [handwrittenSignatures] DotnetSettings handwrittenSignatures - */ - - /** - * Constructs a new DotnetSettings. - * @memberof google.api - * @classdesc Represents a DotnetSettings. - * @implements IDotnetSettings - * @constructor - * @param {google.api.IDotnetSettings=} [properties] Properties to set - */ - function DotnetSettings(properties) { - this.renamedServices = {}; - this.renamedResources = {}; - this.ignoredResources = []; - this.forcedNamespaceAliases = []; - this.handwrittenSignatures = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DotnetSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.common = null; - - /** - * DotnetSettings renamedServices. - * @member {Object.} renamedServices - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.renamedServices = $util.emptyObject; - - /** - * DotnetSettings renamedResources. - * @member {Object.} renamedResources - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.renamedResources = $util.emptyObject; - - /** - * DotnetSettings ignoredResources. - * @member {Array.} ignoredResources - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.ignoredResources = $util.emptyArray; - - /** - * DotnetSettings forcedNamespaceAliases. - * @member {Array.} forcedNamespaceAliases - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.forcedNamespaceAliases = $util.emptyArray; - - /** - * DotnetSettings handwrittenSignatures. - * @member {Array.} handwrittenSignatures - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.handwrittenSignatures = $util.emptyArray; - - /** - * Creates a new DotnetSettings instance using the specified properties. - * @function create - * @memberof google.api.DotnetSettings - * @static - * @param {google.api.IDotnetSettings=} [properties] Properties to set - * @returns {google.api.DotnetSettings} DotnetSettings instance - */ - DotnetSettings.create = function create(properties) { - return new DotnetSettings(properties); - }; - - /** - * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. - * @function encode - * @memberof google.api.DotnetSettings - * @static - * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DotnetSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.renamedServices != null && Object.hasOwnProperty.call(message, "renamedServices")) - for (var keys = Object.keys(message.renamedServices), i = 0; i < keys.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedServices[keys[i]]).ldelim(); - if (message.renamedResources != null && Object.hasOwnProperty.call(message, "renamedResources")) - for (var keys = Object.keys(message.renamedResources), i = 0; i < keys.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedResources[keys[i]]).ldelim(); - if (message.ignoredResources != null && message.ignoredResources.length) - for (var i = 0; i < message.ignoredResources.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.ignoredResources[i]); - if (message.forcedNamespaceAliases != null && message.forcedNamespaceAliases.length) - for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.forcedNamespaceAliases[i]); - if (message.handwrittenSignatures != null && message.handwrittenSignatures.length) - for (var i = 0; i < message.handwrittenSignatures.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.handwrittenSignatures[i]); - return writer; - }; - - /** - * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.DotnetSettings - * @static - * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DotnetSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DotnetSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.DotnetSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.DotnetSettings} DotnetSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DotnetSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.DotnetSettings(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - case 2: { - if (message.renamedServices === $util.emptyObject) - message.renamedServices = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.renamedServices[key] = value; - break; - } - case 3: { - if (message.renamedResources === $util.emptyObject) - message.renamedResources = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.renamedResources[key] = value; - break; - } - case 4: { - if (!(message.ignoredResources && message.ignoredResources.length)) - message.ignoredResources = []; - message.ignoredResources.push(reader.string()); - break; - } - case 5: { - if (!(message.forcedNamespaceAliases && message.forcedNamespaceAliases.length)) - message.forcedNamespaceAliases = []; - message.forcedNamespaceAliases.push(reader.string()); - break; - } - case 6: { - if (!(message.handwrittenSignatures && message.handwrittenSignatures.length)) - message.handwrittenSignatures = []; - message.handwrittenSignatures.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.DotnetSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.DotnetSettings} DotnetSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DotnetSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DotnetSettings message. - * @function verify - * @memberof google.api.DotnetSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DotnetSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - if (message.renamedServices != null && message.hasOwnProperty("renamedServices")) { - if (!$util.isObject(message.renamedServices)) - return "renamedServices: object expected"; - var key = Object.keys(message.renamedServices); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.renamedServices[key[i]])) - return "renamedServices: string{k:string} expected"; - } - if (message.renamedResources != null && message.hasOwnProperty("renamedResources")) { - if (!$util.isObject(message.renamedResources)) - return "renamedResources: object expected"; - var key = Object.keys(message.renamedResources); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.renamedResources[key[i]])) - return "renamedResources: string{k:string} expected"; - } - if (message.ignoredResources != null && message.hasOwnProperty("ignoredResources")) { - if (!Array.isArray(message.ignoredResources)) - return "ignoredResources: array expected"; - for (var i = 0; i < message.ignoredResources.length; ++i) - if (!$util.isString(message.ignoredResources[i])) - return "ignoredResources: string[] expected"; - } - if (message.forcedNamespaceAliases != null && message.hasOwnProperty("forcedNamespaceAliases")) { - if (!Array.isArray(message.forcedNamespaceAliases)) - return "forcedNamespaceAliases: array expected"; - for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) - if (!$util.isString(message.forcedNamespaceAliases[i])) - return "forcedNamespaceAliases: string[] expected"; - } - if (message.handwrittenSignatures != null && message.hasOwnProperty("handwrittenSignatures")) { - if (!Array.isArray(message.handwrittenSignatures)) - return "handwrittenSignatures: array expected"; - for (var i = 0; i < message.handwrittenSignatures.length; ++i) - if (!$util.isString(message.handwrittenSignatures[i])) - return "handwrittenSignatures: string[] expected"; - } - return null; - }; - - /** - * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.DotnetSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.DotnetSettings} DotnetSettings - */ - DotnetSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.DotnetSettings) - return object; - var message = new $root.google.api.DotnetSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.DotnetSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - if (object.renamedServices) { - if (typeof object.renamedServices !== "object") - throw TypeError(".google.api.DotnetSettings.renamedServices: object expected"); - message.renamedServices = {}; - for (var keys = Object.keys(object.renamedServices), i = 0; i < keys.length; ++i) - message.renamedServices[keys[i]] = String(object.renamedServices[keys[i]]); - } - if (object.renamedResources) { - if (typeof object.renamedResources !== "object") - throw TypeError(".google.api.DotnetSettings.renamedResources: object expected"); - message.renamedResources = {}; - for (var keys = Object.keys(object.renamedResources), i = 0; i < keys.length; ++i) - message.renamedResources[keys[i]] = String(object.renamedResources[keys[i]]); - } - if (object.ignoredResources) { - if (!Array.isArray(object.ignoredResources)) - throw TypeError(".google.api.DotnetSettings.ignoredResources: array expected"); - message.ignoredResources = []; - for (var i = 0; i < object.ignoredResources.length; ++i) - message.ignoredResources[i] = String(object.ignoredResources[i]); - } - if (object.forcedNamespaceAliases) { - if (!Array.isArray(object.forcedNamespaceAliases)) - throw TypeError(".google.api.DotnetSettings.forcedNamespaceAliases: array expected"); - message.forcedNamespaceAliases = []; - for (var i = 0; i < object.forcedNamespaceAliases.length; ++i) - message.forcedNamespaceAliases[i] = String(object.forcedNamespaceAliases[i]); - } - if (object.handwrittenSignatures) { - if (!Array.isArray(object.handwrittenSignatures)) - throw TypeError(".google.api.DotnetSettings.handwrittenSignatures: array expected"); - message.handwrittenSignatures = []; - for (var i = 0; i < object.handwrittenSignatures.length; ++i) - message.handwrittenSignatures[i] = String(object.handwrittenSignatures[i]); - } - return message; - }; - - /** - * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.DotnetSettings - * @static - * @param {google.api.DotnetSettings} message DotnetSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DotnetSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.ignoredResources = []; - object.forcedNamespaceAliases = []; - object.handwrittenSignatures = []; - } - if (options.objects || options.defaults) { - object.renamedServices = {}; - object.renamedResources = {}; - } - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - var keys2; - if (message.renamedServices && (keys2 = Object.keys(message.renamedServices)).length) { - object.renamedServices = {}; - for (var j = 0; j < keys2.length; ++j) - object.renamedServices[keys2[j]] = message.renamedServices[keys2[j]]; - } - if (message.renamedResources && (keys2 = Object.keys(message.renamedResources)).length) { - object.renamedResources = {}; - for (var j = 0; j < keys2.length; ++j) - object.renamedResources[keys2[j]] = message.renamedResources[keys2[j]]; - } - if (message.ignoredResources && message.ignoredResources.length) { - object.ignoredResources = []; - for (var j = 0; j < message.ignoredResources.length; ++j) - object.ignoredResources[j] = message.ignoredResources[j]; - } - if (message.forcedNamespaceAliases && message.forcedNamespaceAliases.length) { - object.forcedNamespaceAliases = []; - for (var j = 0; j < message.forcedNamespaceAliases.length; ++j) - object.forcedNamespaceAliases[j] = message.forcedNamespaceAliases[j]; - } - if (message.handwrittenSignatures && message.handwrittenSignatures.length) { - object.handwrittenSignatures = []; - for (var j = 0; j < message.handwrittenSignatures.length; ++j) - object.handwrittenSignatures[j] = message.handwrittenSignatures[j]; - } - return object; - }; - - /** - * Converts this DotnetSettings to JSON. - * @function toJSON - * @memberof google.api.DotnetSettings - * @instance - * @returns {Object.} JSON object - */ - DotnetSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DotnetSettings - * @function getTypeUrl - * @memberof google.api.DotnetSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DotnetSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.DotnetSettings"; - }; - - return DotnetSettings; - })(); - - api.RubySettings = (function() { - - /** - * Properties of a RubySettings. - * @memberof google.api - * @interface IRubySettings - * @property {google.api.ICommonLanguageSettings|null} [common] RubySettings common - */ - - /** - * Constructs a new RubySettings. - * @memberof google.api - * @classdesc Represents a RubySettings. - * @implements IRubySettings - * @constructor - * @param {google.api.IRubySettings=} [properties] Properties to set - */ - function RubySettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RubySettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.RubySettings - * @instance - */ - RubySettings.prototype.common = null; - - /** - * Creates a new RubySettings instance using the specified properties. - * @function create - * @memberof google.api.RubySettings - * @static - * @param {google.api.IRubySettings=} [properties] Properties to set - * @returns {google.api.RubySettings} RubySettings instance - */ - RubySettings.create = function create(properties) { - return new RubySettings(properties); - }; - - /** - * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. - * @function encode - * @memberof google.api.RubySettings - * @static - * @param {google.api.IRubySettings} message RubySettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RubySettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.RubySettings - * @static - * @param {google.api.IRubySettings} message RubySettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RubySettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RubySettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.RubySettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.RubySettings} RubySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RubySettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.RubySettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RubySettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.RubySettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.RubySettings} RubySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RubySettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RubySettings message. - * @function verify - * @memberof google.api.RubySettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RubySettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.RubySettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.RubySettings} RubySettings - */ - RubySettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.RubySettings) - return object; - var message = new $root.google.api.RubySettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.RubySettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a RubySettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.RubySettings - * @static - * @param {google.api.RubySettings} message RubySettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RubySettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this RubySettings to JSON. - * @function toJSON - * @memberof google.api.RubySettings - * @instance - * @returns {Object.} JSON object - */ - RubySettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RubySettings - * @function getTypeUrl - * @memberof google.api.RubySettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RubySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.RubySettings"; - }; - - return RubySettings; - })(); - - api.GoSettings = (function() { - - /** - * Properties of a GoSettings. - * @memberof google.api - * @interface IGoSettings - * @property {google.api.ICommonLanguageSettings|null} [common] GoSettings common - */ - - /** - * Constructs a new GoSettings. - * @memberof google.api - * @classdesc Represents a GoSettings. - * @implements IGoSettings - * @constructor - * @param {google.api.IGoSettings=} [properties] Properties to set - */ - function GoSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GoSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.GoSettings - * @instance - */ - GoSettings.prototype.common = null; - - /** - * Creates a new GoSettings instance using the specified properties. - * @function create - * @memberof google.api.GoSettings - * @static - * @param {google.api.IGoSettings=} [properties] Properties to set - * @returns {google.api.GoSettings} GoSettings instance - */ - GoSettings.create = function create(properties) { - return new GoSettings(properties); - }; - - /** - * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. - * @function encode - * @memberof google.api.GoSettings - * @static - * @param {google.api.IGoSettings} message GoSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GoSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.GoSettings - * @static - * @param {google.api.IGoSettings} message GoSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GoSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GoSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.GoSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.GoSettings} GoSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GoSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.GoSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GoSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.GoSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.GoSettings} GoSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GoSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GoSettings message. - * @function verify - * @memberof google.api.GoSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GoSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.GoSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.GoSettings} GoSettings - */ - GoSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.GoSettings) - return object; - var message = new $root.google.api.GoSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.GoSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a GoSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.GoSettings - * @static - * @param {google.api.GoSettings} message GoSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GoSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this GoSettings to JSON. - * @function toJSON - * @memberof google.api.GoSettings - * @instance - * @returns {Object.} JSON object - */ - GoSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GoSettings - * @function getTypeUrl - * @memberof google.api.GoSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GoSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.GoSettings"; - }; - - return GoSettings; - })(); - - api.MethodSettings = (function() { - - /** - * Properties of a MethodSettings. - * @memberof google.api - * @interface IMethodSettings - * @property {string|null} [selector] MethodSettings selector - * @property {google.api.MethodSettings.ILongRunning|null} [longRunning] MethodSettings longRunning - * @property {Array.|null} [autoPopulatedFields] MethodSettings autoPopulatedFields - */ - - /** - * Constructs a new MethodSettings. - * @memberof google.api - * @classdesc Represents a MethodSettings. - * @implements IMethodSettings - * @constructor - * @param {google.api.IMethodSettings=} [properties] Properties to set - */ - function MethodSettings(properties) { - this.autoPopulatedFields = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MethodSettings selector. - * @member {string} selector - * @memberof google.api.MethodSettings - * @instance - */ - MethodSettings.prototype.selector = ""; - - /** - * MethodSettings longRunning. - * @member {google.api.MethodSettings.ILongRunning|null|undefined} longRunning - * @memberof google.api.MethodSettings - * @instance - */ - MethodSettings.prototype.longRunning = null; - - /** - * MethodSettings autoPopulatedFields. - * @member {Array.} autoPopulatedFields - * @memberof google.api.MethodSettings - * @instance - */ - MethodSettings.prototype.autoPopulatedFields = $util.emptyArray; - - /** - * Creates a new MethodSettings instance using the specified properties. - * @function create - * @memberof google.api.MethodSettings - * @static - * @param {google.api.IMethodSettings=} [properties] Properties to set - * @returns {google.api.MethodSettings} MethodSettings instance - */ - MethodSettings.create = function create(properties) { - return new MethodSettings(properties); - }; - - /** - * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. - * @function encode - * @memberof google.api.MethodSettings - * @static - * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); - if (message.longRunning != null && Object.hasOwnProperty.call(message, "longRunning")) - $root.google.api.MethodSettings.LongRunning.encode(message.longRunning, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.autoPopulatedFields != null && message.autoPopulatedFields.length) - for (var i = 0; i < message.autoPopulatedFields.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.autoPopulatedFields[i]); - return writer; - }; - - /** - * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.MethodSettings - * @static - * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MethodSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.MethodSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.MethodSettings} MethodSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.selector = reader.string(); - break; - } - case 2: { - message.longRunning = $root.google.api.MethodSettings.LongRunning.decode(reader, reader.uint32()); - break; - } - case 3: { - if (!(message.autoPopulatedFields && message.autoPopulatedFields.length)) - message.autoPopulatedFields = []; - message.autoPopulatedFields.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MethodSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.MethodSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.MethodSettings} MethodSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MethodSettings message. - * @function verify - * @memberof google.api.MethodSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MethodSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.selector != null && message.hasOwnProperty("selector")) - if (!$util.isString(message.selector)) - return "selector: string expected"; - if (message.longRunning != null && message.hasOwnProperty("longRunning")) { - var error = $root.google.api.MethodSettings.LongRunning.verify(message.longRunning); - if (error) - return "longRunning." + error; - } - if (message.autoPopulatedFields != null && message.hasOwnProperty("autoPopulatedFields")) { - if (!Array.isArray(message.autoPopulatedFields)) - return "autoPopulatedFields: array expected"; - for (var i = 0; i < message.autoPopulatedFields.length; ++i) - if (!$util.isString(message.autoPopulatedFields[i])) - return "autoPopulatedFields: string[] expected"; - } - return null; - }; - - /** - * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.MethodSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.MethodSettings} MethodSettings - */ - MethodSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.MethodSettings) - return object; - var message = new $root.google.api.MethodSettings(); - if (object.selector != null) - message.selector = String(object.selector); - if (object.longRunning != null) { - if (typeof object.longRunning !== "object") - throw TypeError(".google.api.MethodSettings.longRunning: object expected"); - message.longRunning = $root.google.api.MethodSettings.LongRunning.fromObject(object.longRunning); - } - if (object.autoPopulatedFields) { - if (!Array.isArray(object.autoPopulatedFields)) - throw TypeError(".google.api.MethodSettings.autoPopulatedFields: array expected"); - message.autoPopulatedFields = []; - for (var i = 0; i < object.autoPopulatedFields.length; ++i) - message.autoPopulatedFields[i] = String(object.autoPopulatedFields[i]); - } - return message; - }; - - /** - * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.MethodSettings - * @static - * @param {google.api.MethodSettings} message MethodSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MethodSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.autoPopulatedFields = []; - if (options.defaults) { - object.selector = ""; - object.longRunning = null; - } - if (message.selector != null && message.hasOwnProperty("selector")) - object.selector = message.selector; - if (message.longRunning != null && message.hasOwnProperty("longRunning")) - object.longRunning = $root.google.api.MethodSettings.LongRunning.toObject(message.longRunning, options); - if (message.autoPopulatedFields && message.autoPopulatedFields.length) { - object.autoPopulatedFields = []; - for (var j = 0; j < message.autoPopulatedFields.length; ++j) - object.autoPopulatedFields[j] = message.autoPopulatedFields[j]; - } - return object; - }; - - /** - * Converts this MethodSettings to JSON. - * @function toJSON - * @memberof google.api.MethodSettings - * @instance - * @returns {Object.} JSON object - */ - MethodSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MethodSettings - * @function getTypeUrl - * @memberof google.api.MethodSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MethodSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.MethodSettings"; - }; - - MethodSettings.LongRunning = (function() { - - /** - * Properties of a LongRunning. - * @memberof google.api.MethodSettings - * @interface ILongRunning - * @property {google.protobuf.IDuration|null} [initialPollDelay] LongRunning initialPollDelay - * @property {number|null} [pollDelayMultiplier] LongRunning pollDelayMultiplier - * @property {google.protobuf.IDuration|null} [maxPollDelay] LongRunning maxPollDelay - * @property {google.protobuf.IDuration|null} [totalPollTimeout] LongRunning totalPollTimeout - */ - - /** - * Constructs a new LongRunning. - * @memberof google.api.MethodSettings - * @classdesc Represents a LongRunning. - * @implements ILongRunning - * @constructor - * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set - */ - function LongRunning(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * LongRunning initialPollDelay. - * @member {google.protobuf.IDuration|null|undefined} initialPollDelay - * @memberof google.api.MethodSettings.LongRunning - * @instance - */ - LongRunning.prototype.initialPollDelay = null; - - /** - * LongRunning pollDelayMultiplier. - * @member {number} pollDelayMultiplier - * @memberof google.api.MethodSettings.LongRunning - * @instance - */ - LongRunning.prototype.pollDelayMultiplier = 0; - - /** - * LongRunning maxPollDelay. - * @member {google.protobuf.IDuration|null|undefined} maxPollDelay - * @memberof google.api.MethodSettings.LongRunning - * @instance - */ - LongRunning.prototype.maxPollDelay = null; - - /** - * LongRunning totalPollTimeout. - * @member {google.protobuf.IDuration|null|undefined} totalPollTimeout - * @memberof google.api.MethodSettings.LongRunning - * @instance - */ - LongRunning.prototype.totalPollTimeout = null; - - /** - * Creates a new LongRunning instance using the specified properties. - * @function create - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set - * @returns {google.api.MethodSettings.LongRunning} LongRunning instance - */ - LongRunning.create = function create(properties) { - return new LongRunning(properties); - }; - - /** - * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. - * @function encode - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LongRunning.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.initialPollDelay != null && Object.hasOwnProperty.call(message, "initialPollDelay")) - $root.google.protobuf.Duration.encode(message.initialPollDelay, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.pollDelayMultiplier != null && Object.hasOwnProperty.call(message, "pollDelayMultiplier")) - writer.uint32(/* id 2, wireType 5 =*/21).float(message.pollDelayMultiplier); - if (message.maxPollDelay != null && Object.hasOwnProperty.call(message, "maxPollDelay")) - $root.google.protobuf.Duration.encode(message.maxPollDelay, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.totalPollTimeout != null && Object.hasOwnProperty.call(message, "totalPollTimeout")) - $root.google.protobuf.Duration.encode(message.totalPollTimeout, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LongRunning.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a LongRunning message from the specified reader or buffer. - * @function decode - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.MethodSettings.LongRunning} LongRunning - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LongRunning.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings.LongRunning(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.initialPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 2: { - message.pollDelayMultiplier = reader.float(); - break; - } - case 3: { - message.maxPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 4: { - message.totalPollTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a LongRunning message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.MethodSettings.LongRunning} LongRunning - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LongRunning.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a LongRunning message. - * @function verify - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LongRunning.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) { - var error = $root.google.protobuf.Duration.verify(message.initialPollDelay); - if (error) - return "initialPollDelay." + error; - } - if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) - if (typeof message.pollDelayMultiplier !== "number") - return "pollDelayMultiplier: number expected"; - if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) { - var error = $root.google.protobuf.Duration.verify(message.maxPollDelay); - if (error) - return "maxPollDelay." + error; - } - if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) { - var error = $root.google.protobuf.Duration.verify(message.totalPollTimeout); - if (error) - return "totalPollTimeout." + error; - } - return null; - }; - - /** - * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {Object.} object Plain object - * @returns {google.api.MethodSettings.LongRunning} LongRunning - */ - LongRunning.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.MethodSettings.LongRunning) - return object; - var message = new $root.google.api.MethodSettings.LongRunning(); - if (object.initialPollDelay != null) { - if (typeof object.initialPollDelay !== "object") - throw TypeError(".google.api.MethodSettings.LongRunning.initialPollDelay: object expected"); - message.initialPollDelay = $root.google.protobuf.Duration.fromObject(object.initialPollDelay); - } - if (object.pollDelayMultiplier != null) - message.pollDelayMultiplier = Number(object.pollDelayMultiplier); - if (object.maxPollDelay != null) { - if (typeof object.maxPollDelay !== "object") - throw TypeError(".google.api.MethodSettings.LongRunning.maxPollDelay: object expected"); - message.maxPollDelay = $root.google.protobuf.Duration.fromObject(object.maxPollDelay); - } - if (object.totalPollTimeout != null) { - if (typeof object.totalPollTimeout !== "object") - throw TypeError(".google.api.MethodSettings.LongRunning.totalPollTimeout: object expected"); - message.totalPollTimeout = $root.google.protobuf.Duration.fromObject(object.totalPollTimeout); - } - return message; - }; - - /** - * Creates a plain object from a LongRunning message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {google.api.MethodSettings.LongRunning} message LongRunning - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LongRunning.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.initialPollDelay = null; - object.pollDelayMultiplier = 0; - object.maxPollDelay = null; - object.totalPollTimeout = null; - } - if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) - object.initialPollDelay = $root.google.protobuf.Duration.toObject(message.initialPollDelay, options); - if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) - object.pollDelayMultiplier = options.json && !isFinite(message.pollDelayMultiplier) ? String(message.pollDelayMultiplier) : message.pollDelayMultiplier; - if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) - object.maxPollDelay = $root.google.protobuf.Duration.toObject(message.maxPollDelay, options); - if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) - object.totalPollTimeout = $root.google.protobuf.Duration.toObject(message.totalPollTimeout, options); - return object; - }; - - /** - * Converts this LongRunning to JSON. - * @function toJSON - * @memberof google.api.MethodSettings.LongRunning - * @instance - * @returns {Object.} JSON object - */ - LongRunning.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for LongRunning - * @function getTypeUrl - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - LongRunning.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.MethodSettings.LongRunning"; - }; - - return LongRunning; - })(); - - return MethodSettings; - })(); - - /** - * ClientLibraryOrganization enum. - * @name google.api.ClientLibraryOrganization - * @enum {number} - * @property {number} CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED=0 CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED value - * @property {number} CLOUD=1 CLOUD value - * @property {number} ADS=2 ADS value - * @property {number} PHOTOS=3 PHOTOS value - * @property {number} STREET_VIEW=4 STREET_VIEW value - * @property {number} SHOPPING=5 SHOPPING value - * @property {number} GEO=6 GEO value - * @property {number} GENERATIVE_AI=7 GENERATIVE_AI value - */ - api.ClientLibraryOrganization = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED"] = 0; - values[valuesById[1] = "CLOUD"] = 1; - values[valuesById[2] = "ADS"] = 2; - values[valuesById[3] = "PHOTOS"] = 3; - values[valuesById[4] = "STREET_VIEW"] = 4; - values[valuesById[5] = "SHOPPING"] = 5; - values[valuesById[6] = "GEO"] = 6; - values[valuesById[7] = "GENERATIVE_AI"] = 7; - return values; - })(); - - /** - * ClientLibraryDestination enum. - * @name google.api.ClientLibraryDestination - * @enum {number} - * @property {number} CLIENT_LIBRARY_DESTINATION_UNSPECIFIED=0 CLIENT_LIBRARY_DESTINATION_UNSPECIFIED value - * @property {number} GITHUB=10 GITHUB value - * @property {number} PACKAGE_MANAGER=20 PACKAGE_MANAGER value - */ - api.ClientLibraryDestination = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED"] = 0; - values[valuesById[10] = "GITHUB"] = 10; - values[valuesById[20] = "PACKAGE_MANAGER"] = 20; - return values; - })(); - - /** - * LaunchStage enum. - * @name google.api.LaunchStage - * @enum {number} - * @property {number} LAUNCH_STAGE_UNSPECIFIED=0 LAUNCH_STAGE_UNSPECIFIED value - * @property {number} UNIMPLEMENTED=6 UNIMPLEMENTED value - * @property {number} PRELAUNCH=7 PRELAUNCH value - * @property {number} EARLY_ACCESS=1 EARLY_ACCESS value - * @property {number} ALPHA=2 ALPHA value - * @property {number} BETA=3 BETA value - * @property {number} GA=4 GA value - * @property {number} DEPRECATED=5 DEPRECATED value - */ - api.LaunchStage = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "LAUNCH_STAGE_UNSPECIFIED"] = 0; - values[valuesById[6] = "UNIMPLEMENTED"] = 6; - values[valuesById[7] = "PRELAUNCH"] = 7; - values[valuesById[1] = "EARLY_ACCESS"] = 1; - values[valuesById[2] = "ALPHA"] = 2; - values[valuesById[3] = "BETA"] = 3; - values[valuesById[4] = "GA"] = 4; - values[valuesById[5] = "DEPRECATED"] = 5; - return values; - })(); - - return api; - })(); - - google.protobuf = (function() { - - /** - * Namespace protobuf. - * @memberof google - * @namespace - */ - var protobuf = {}; - - protobuf.FileDescriptorSet = (function() { - - /** - * Properties of a FileDescriptorSet. - * @memberof google.protobuf - * @interface IFileDescriptorSet - * @property {Array.|null} [file] FileDescriptorSet file - */ - - /** - * Constructs a new FileDescriptorSet. - * @memberof google.protobuf - * @classdesc Represents a FileDescriptorSet. - * @implements IFileDescriptorSet - * @constructor - * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set - */ - function FileDescriptorSet(properties) { - this.file = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FileDescriptorSet file. - * @member {Array.} file - * @memberof google.protobuf.FileDescriptorSet - * @instance - */ - FileDescriptorSet.prototype.file = $util.emptyArray; - - /** - * Creates a new FileDescriptorSet instance using the specified properties. - * @function create - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance - */ - FileDescriptorSet.create = function create(properties) { - return new FileDescriptorSet(properties); - }; - - /** - * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorSet.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.file != null && message.file.length) - for (var i = 0; i < message.file.length; ++i) - $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FileDescriptorSet message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorSet.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.file && message.file.length)) - message.file = []; - message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FileDescriptorSet message. - * @function verify - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FileDescriptorSet.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.file != null && message.hasOwnProperty("file")) { - if (!Array.isArray(message.file)) - return "file: array expected"; - for (var i = 0; i < message.file.length; ++i) { - var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]); - if (error) - return "file." + error; - } - } - return null; - }; - - /** - * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet - */ - FileDescriptorSet.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FileDescriptorSet) - return object; - var message = new $root.google.protobuf.FileDescriptorSet(); - if (object.file) { - if (!Array.isArray(object.file)) - throw TypeError(".google.protobuf.FileDescriptorSet.file: array expected"); - message.file = []; - for (var i = 0; i < object.file.length; ++i) { - if (typeof object.file[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected"); - message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FileDescriptorSet.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.file = []; - if (message.file && message.file.length) { - object.file = []; - for (var j = 0; j < message.file.length; ++j) - object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options); - } - return object; - }; - - /** - * Converts this FileDescriptorSet to JSON. - * @function toJSON - * @memberof google.protobuf.FileDescriptorSet - * @instance - * @returns {Object.} JSON object - */ - FileDescriptorSet.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FileDescriptorSet - * @function getTypeUrl - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FileDescriptorSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FileDescriptorSet"; - }; - - return FileDescriptorSet; - })(); - - /** - * Edition enum. - * @name google.protobuf.Edition - * @enum {number} - * @property {number} EDITION_UNKNOWN=0 EDITION_UNKNOWN value - * @property {number} EDITION_PROTO2=998 EDITION_PROTO2 value - * @property {number} EDITION_PROTO3=999 EDITION_PROTO3 value - * @property {number} EDITION_2023=1000 EDITION_2023 value - * @property {number} EDITION_2024=1001 EDITION_2024 value - * @property {number} EDITION_1_TEST_ONLY=1 EDITION_1_TEST_ONLY value - * @property {number} EDITION_2_TEST_ONLY=2 EDITION_2_TEST_ONLY value - * @property {number} EDITION_99997_TEST_ONLY=99997 EDITION_99997_TEST_ONLY value - * @property {number} EDITION_99998_TEST_ONLY=99998 EDITION_99998_TEST_ONLY value - * @property {number} EDITION_99999_TEST_ONLY=99999 EDITION_99999_TEST_ONLY value - * @property {number} EDITION_MAX=2147483647 EDITION_MAX value - */ - protobuf.Edition = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "EDITION_UNKNOWN"] = 0; - values[valuesById[998] = "EDITION_PROTO2"] = 998; - values[valuesById[999] = "EDITION_PROTO3"] = 999; - values[valuesById[1000] = "EDITION_2023"] = 1000; - values[valuesById[1001] = "EDITION_2024"] = 1001; - values[valuesById[1] = "EDITION_1_TEST_ONLY"] = 1; - values[valuesById[2] = "EDITION_2_TEST_ONLY"] = 2; - values[valuesById[99997] = "EDITION_99997_TEST_ONLY"] = 99997; - values[valuesById[99998] = "EDITION_99998_TEST_ONLY"] = 99998; - values[valuesById[99999] = "EDITION_99999_TEST_ONLY"] = 99999; - values[valuesById[2147483647] = "EDITION_MAX"] = 2147483647; - return values; - })(); - - protobuf.FileDescriptorProto = (function() { - - /** - * Properties of a FileDescriptorProto. - * @memberof google.protobuf - * @interface IFileDescriptorProto - * @property {string|null} [name] FileDescriptorProto name - * @property {string|null} ["package"] FileDescriptorProto package - * @property {Array.|null} [dependency] FileDescriptorProto dependency - * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency - * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency - * @property {Array.|null} [messageType] FileDescriptorProto messageType - * @property {Array.|null} [enumType] FileDescriptorProto enumType - * @property {Array.|null} [service] FileDescriptorProto service - * @property {Array.|null} [extension] FileDescriptorProto extension - * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options - * @property {google.protobuf.ISourceCodeInfo|null} [sourceCodeInfo] FileDescriptorProto sourceCodeInfo - * @property {string|null} [syntax] FileDescriptorProto syntax - * @property {google.protobuf.Edition|null} [edition] FileDescriptorProto edition - */ - - /** - * Constructs a new FileDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a FileDescriptorProto. - * @implements IFileDescriptorProto - * @constructor - * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set - */ - function FileDescriptorProto(properties) { - this.dependency = []; - this.publicDependency = []; - this.weakDependency = []; - this.messageType = []; - this.enumType = []; - this.service = []; - this.extension = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FileDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.name = ""; - - /** - * FileDescriptorProto package. - * @member {string} package - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype["package"] = ""; - - /** - * FileDescriptorProto dependency. - * @member {Array.} dependency - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.dependency = $util.emptyArray; - - /** - * FileDescriptorProto publicDependency. - * @member {Array.} publicDependency - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.publicDependency = $util.emptyArray; - - /** - * FileDescriptorProto weakDependency. - * @member {Array.} weakDependency - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.weakDependency = $util.emptyArray; - - /** - * FileDescriptorProto messageType. - * @member {Array.} messageType - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.messageType = $util.emptyArray; - - /** - * FileDescriptorProto enumType. - * @member {Array.} enumType - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.enumType = $util.emptyArray; - - /** - * FileDescriptorProto service. - * @member {Array.} service - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.service = $util.emptyArray; - - /** - * FileDescriptorProto extension. - * @member {Array.} extension - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.extension = $util.emptyArray; - - /** - * FileDescriptorProto options. - * @member {google.protobuf.IFileOptions|null|undefined} options - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.options = null; - - /** - * FileDescriptorProto sourceCodeInfo. - * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.sourceCodeInfo = null; - - /** - * FileDescriptorProto syntax. - * @member {string} syntax - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.syntax = ""; - - /** - * FileDescriptorProto edition. - * @member {google.protobuf.Edition} edition - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.edition = 0; - - /** - * Creates a new FileDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance - */ - FileDescriptorProto.create = function create(properties) { - return new FileDescriptorProto(properties); - }; - - /** - * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); - if (message.dependency != null && message.dependency.length) - for (var i = 0; i < message.dependency.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); - if (message.messageType != null && message.messageType.length) - for (var i = 0; i < message.messageType.length; ++i) - $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.enumType != null && message.enumType.length) - for (var i = 0; i < message.enumType.length; ++i) - $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.service != null && message.service.length) - for (var i = 0; i < message.service.length; ++i) - $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.extension != null && message.extension.length) - for (var i = 0; i < message.extension.length; ++i) - $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo")) - $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.publicDependency != null && message.publicDependency.length) - for (var i = 0; i < message.publicDependency.length; ++i) - writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]); - if (message.weakDependency != null && message.weakDependency.length) - for (var i = 0; i < message.weakDependency.length; ++i) - writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); - if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); - if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) - writer.uint32(/* id 14, wireType 0 =*/112).int32(message.edition); - return writer; - }; - - /** - * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorProto.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message["package"] = reader.string(); - break; - } - case 3: { - if (!(message.dependency && message.dependency.length)) - message.dependency = []; - message.dependency.push(reader.string()); - break; - } - case 10: { - if (!(message.publicDependency && message.publicDependency.length)) - message.publicDependency = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.publicDependency.push(reader.int32()); - } else - message.publicDependency.push(reader.int32()); - break; - } - case 11: { - if (!(message.weakDependency && message.weakDependency.length)) - message.weakDependency = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.weakDependency.push(reader.int32()); - } else - message.weakDependency.push(reader.int32()); - break; - } - case 4: { - if (!(message.messageType && message.messageType.length)) - message.messageType = []; - message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); - break; - } - case 5: { - if (!(message.enumType && message.enumType.length)) - message.enumType = []; - message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 6: { - if (!(message.service && message.service.length)) - message.service = []; - message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 7: { - if (!(message.extension && message.extension.length)) - message.extension = []; - message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 8: { - message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32()); - break; - } - case 9: { - message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32()); - break; - } - case 12: { - message.syntax = reader.string(); - break; - } - case 14: { - message.edition = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FileDescriptorProto message. - * @function verify - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FileDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message["package"] != null && message.hasOwnProperty("package")) - if (!$util.isString(message["package"])) - return "package: string expected"; - if (message.dependency != null && message.hasOwnProperty("dependency")) { - if (!Array.isArray(message.dependency)) - return "dependency: array expected"; - for (var i = 0; i < message.dependency.length; ++i) - if (!$util.isString(message.dependency[i])) - return "dependency: string[] expected"; - } - if (message.publicDependency != null && message.hasOwnProperty("publicDependency")) { - if (!Array.isArray(message.publicDependency)) - return "publicDependency: array expected"; - for (var i = 0; i < message.publicDependency.length; ++i) - if (!$util.isInteger(message.publicDependency[i])) - return "publicDependency: integer[] expected"; - } - if (message.weakDependency != null && message.hasOwnProperty("weakDependency")) { - if (!Array.isArray(message.weakDependency)) - return "weakDependency: array expected"; - for (var i = 0; i < message.weakDependency.length; ++i) - if (!$util.isInteger(message.weakDependency[i])) - return "weakDependency: integer[] expected"; - } - if (message.messageType != null && message.hasOwnProperty("messageType")) { - if (!Array.isArray(message.messageType)) - return "messageType: array expected"; - for (var i = 0; i < message.messageType.length; ++i) { - var error = $root.google.protobuf.DescriptorProto.verify(message.messageType[i]); - if (error) - return "messageType." + error; - } - } - if (message.enumType != null && message.hasOwnProperty("enumType")) { - if (!Array.isArray(message.enumType)) - return "enumType: array expected"; - for (var i = 0; i < message.enumType.length; ++i) { - var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); - if (error) - return "enumType." + error; - } - } - if (message.service != null && message.hasOwnProperty("service")) { - if (!Array.isArray(message.service)) - return "service: array expected"; - for (var i = 0; i < message.service.length; ++i) { - var error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i]); - if (error) - return "service." + error; - } - } - if (message.extension != null && message.hasOwnProperty("extension")) { - if (!Array.isArray(message.extension)) - return "extension: array expected"; - for (var i = 0; i < message.extension.length; ++i) { - var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); - if (error) - return "extension." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.FileOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) { - var error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo); - if (error) - return "sourceCodeInfo." + error; - } - if (message.syntax != null && message.hasOwnProperty("syntax")) - if (!$util.isString(message.syntax)) - return "syntax: string expected"; - if (message.edition != null && message.hasOwnProperty("edition")) - switch (message.edition) { - default: - return "edition: enum value expected"; - case 0: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - return null; - }; - - /** - * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto - */ - FileDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FileDescriptorProto) - return object; - var message = new $root.google.protobuf.FileDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object["package"] != null) - message["package"] = String(object["package"]); - if (object.dependency) { - if (!Array.isArray(object.dependency)) - throw TypeError(".google.protobuf.FileDescriptorProto.dependency: array expected"); - message.dependency = []; - for (var i = 0; i < object.dependency.length; ++i) - message.dependency[i] = String(object.dependency[i]); - } - if (object.publicDependency) { - if (!Array.isArray(object.publicDependency)) - throw TypeError(".google.protobuf.FileDescriptorProto.publicDependency: array expected"); - message.publicDependency = []; - for (var i = 0; i < object.publicDependency.length; ++i) - message.publicDependency[i] = object.publicDependency[i] | 0; - } - if (object.weakDependency) { - if (!Array.isArray(object.weakDependency)) - throw TypeError(".google.protobuf.FileDescriptorProto.weakDependency: array expected"); - message.weakDependency = []; - for (var i = 0; i < object.weakDependency.length; ++i) - message.weakDependency[i] = object.weakDependency[i] | 0; - } - if (object.messageType) { - if (!Array.isArray(object.messageType)) - throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); - message.messageType = []; - for (var i = 0; i < object.messageType.length; ++i) { - if (typeof object.messageType[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.messageType: object expected"); - message.messageType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.messageType[i]); - } - } - if (object.enumType) { - if (!Array.isArray(object.enumType)) - throw TypeError(".google.protobuf.FileDescriptorProto.enumType: array expected"); - message.enumType = []; - for (var i = 0; i < object.enumType.length; ++i) { - if (typeof object.enumType[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.enumType: object expected"); - message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); - } - } - if (object.service) { - if (!Array.isArray(object.service)) - throw TypeError(".google.protobuf.FileDescriptorProto.service: array expected"); - message.service = []; - for (var i = 0; i < object.service.length; ++i) { - if (typeof object.service[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.service: object expected"); - message.service[i] = $root.google.protobuf.ServiceDescriptorProto.fromObject(object.service[i]); - } - } - if (object.extension) { - if (!Array.isArray(object.extension)) - throw TypeError(".google.protobuf.FileDescriptorProto.extension: array expected"); - message.extension = []; - for (var i = 0; i < object.extension.length; ++i) { - if (typeof object.extension[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.extension: object expected"); - message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.FileOptions.fromObject(object.options); - } - if (object.sourceCodeInfo != null) { - if (typeof object.sourceCodeInfo !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.sourceCodeInfo: object expected"); - message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.fromObject(object.sourceCodeInfo); - } - if (object.syntax != null) - message.syntax = String(object.syntax); - switch (object.edition) { - default: - if (typeof object.edition === "number") { - message.edition = object.edition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.edition = 0; - break; - case "EDITION_PROTO2": - case 998: - message.edition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.edition = 999; - break; - case "EDITION_2023": - case 1000: - message.edition = 1000; - break; - case "EDITION_2024": - case 1001: - message.edition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.edition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.edition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.edition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.edition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.edition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.edition = 2147483647; - break; - } - return message; - }; - - /** - * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FileDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.dependency = []; - object.messageType = []; - object.enumType = []; - object.service = []; - object.extension = []; - object.publicDependency = []; - object.weakDependency = []; - } - if (options.defaults) { - object.name = ""; - object["package"] = ""; - object.options = null; - object.sourceCodeInfo = null; - object.syntax = ""; - object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message["package"] != null && message.hasOwnProperty("package")) - object["package"] = message["package"]; - if (message.dependency && message.dependency.length) { - object.dependency = []; - for (var j = 0; j < message.dependency.length; ++j) - object.dependency[j] = message.dependency[j]; - } - if (message.messageType && message.messageType.length) { - object.messageType = []; - for (var j = 0; j < message.messageType.length; ++j) - object.messageType[j] = $root.google.protobuf.DescriptorProto.toObject(message.messageType[j], options); - } - if (message.enumType && message.enumType.length) { - object.enumType = []; - for (var j = 0; j < message.enumType.length; ++j) - object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); - } - if (message.service && message.service.length) { - object.service = []; - for (var j = 0; j < message.service.length; ++j) - object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options); - } - if (message.extension && message.extension.length) { - object.extension = []; - for (var j = 0; j < message.extension.length; ++j) - object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.FileOptions.toObject(message.options, options); - if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) - object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options); - if (message.publicDependency && message.publicDependency.length) { - object.publicDependency = []; - for (var j = 0; j < message.publicDependency.length; ++j) - object.publicDependency[j] = message.publicDependency[j]; - } - if (message.weakDependency && message.weakDependency.length) { - object.weakDependency = []; - for (var j = 0; j < message.weakDependency.length; ++j) - object.weakDependency[j] = message.weakDependency[j]; - } - if (message.syntax != null && message.hasOwnProperty("syntax")) - object.syntax = message.syntax; - if (message.edition != null && message.hasOwnProperty("edition")) - object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; - return object; - }; - - /** - * Converts this FileDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.FileDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - FileDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FileDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FileDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FileDescriptorProto"; - }; - - return FileDescriptorProto; - })(); - - protobuf.DescriptorProto = (function() { - - /** - * Properties of a DescriptorProto. - * @memberof google.protobuf - * @interface IDescriptorProto - * @property {string|null} [name] DescriptorProto name - * @property {Array.|null} [field] DescriptorProto field - * @property {Array.|null} [extension] DescriptorProto extension - * @property {Array.|null} [nestedType] DescriptorProto nestedType - * @property {Array.|null} [enumType] DescriptorProto enumType - * @property {Array.|null} [extensionRange] DescriptorProto extensionRange - * @property {Array.|null} [oneofDecl] DescriptorProto oneofDecl - * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options - * @property {Array.|null} [reservedRange] DescriptorProto reservedRange - * @property {Array.|null} [reservedName] DescriptorProto reservedName - */ - - /** - * Constructs a new DescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a DescriptorProto. - * @implements IDescriptorProto - * @constructor - * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set - */ - function DescriptorProto(properties) { - this.field = []; - this.extension = []; - this.nestedType = []; - this.enumType = []; - this.extensionRange = []; - this.oneofDecl = []; - this.reservedRange = []; - this.reservedName = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DescriptorProto name. - * @member {string} name - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.name = ""; - - /** - * DescriptorProto field. - * @member {Array.} field - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.field = $util.emptyArray; - - /** - * DescriptorProto extension. - * @member {Array.} extension - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.extension = $util.emptyArray; - - /** - * DescriptorProto nestedType. - * @member {Array.} nestedType - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.nestedType = $util.emptyArray; - - /** - * DescriptorProto enumType. - * @member {Array.} enumType - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.enumType = $util.emptyArray; - - /** - * DescriptorProto extensionRange. - * @member {Array.} extensionRange - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.extensionRange = $util.emptyArray; - - /** - * DescriptorProto oneofDecl. - * @member {Array.} oneofDecl - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.oneofDecl = $util.emptyArray; - - /** - * DescriptorProto options. - * @member {google.protobuf.IMessageOptions|null|undefined} options - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.options = null; - - /** - * DescriptorProto reservedRange. - * @member {Array.} reservedRange - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.reservedRange = $util.emptyArray; - - /** - * DescriptorProto reservedName. - * @member {Array.} reservedName - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.reservedName = $util.emptyArray; - - /** - * Creates a new DescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.DescriptorProto - * @static - * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.DescriptorProto} DescriptorProto instance - */ - DescriptorProto.create = function create(properties) { - return new DescriptorProto(properties); - }; - - /** - * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.DescriptorProto - * @static - * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.field != null && message.field.length) - for (var i = 0; i < message.field.length; ++i) - $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.nestedType != null && message.nestedType.length) - for (var i = 0; i < message.nestedType.length; ++i) - $root.google.protobuf.DescriptorProto.encode(message.nestedType[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.enumType != null && message.enumType.length) - for (var i = 0; i < message.enumType.length; ++i) - $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.extensionRange != null && message.extensionRange.length) - for (var i = 0; i < message.extensionRange.length; ++i) - $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extensionRange[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.extension != null && message.extension.length) - for (var i = 0; i < message.extension.length; ++i) - $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.oneofDecl != null && message.oneofDecl.length) - for (var i = 0; i < message.oneofDecl.length; ++i) - $root.google.protobuf.OneofDescriptorProto.encode(message.oneofDecl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.reservedRange != null && message.reservedRange.length) - for (var i = 0; i < message.reservedRange.length; ++i) - $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.reservedName != null && message.reservedName.length) - for (var i = 0; i < message.reservedName.length; ++i) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); - return writer; - }; - - /** - * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.DescriptorProto - * @static - * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.DescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DescriptorProto} DescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DescriptorProto.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - if (!(message.field && message.field.length)) - message.field = []; - message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 6: { - if (!(message.extension && message.extension.length)) - message.extension = []; - message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 3: { - if (!(message.nestedType && message.nestedType.length)) - message.nestedType = []; - message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); - break; - } - case 4: { - if (!(message.enumType && message.enumType.length)) - message.enumType = []; - message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 5: { - if (!(message.extensionRange && message.extensionRange.length)) - message.extensionRange = []; - message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32())); - break; - } - case 8: { - if (!(message.oneofDecl && message.oneofDecl.length)) - message.oneofDecl = []; - message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 7: { - message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32()); - break; - } - case 9: { - if (!(message.reservedRange && message.reservedRange.length)) - message.reservedRange = []; - message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32())); - break; - } - case 10: { - if (!(message.reservedName && message.reservedName.length)) - message.reservedName = []; - message.reservedName.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.DescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DescriptorProto} DescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DescriptorProto message. - * @function verify - * @memberof google.protobuf.DescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.field != null && message.hasOwnProperty("field")) { - if (!Array.isArray(message.field)) - return "field: array expected"; - for (var i = 0; i < message.field.length; ++i) { - var error = $root.google.protobuf.FieldDescriptorProto.verify(message.field[i]); - if (error) - return "field." + error; - } - } - if (message.extension != null && message.hasOwnProperty("extension")) { - if (!Array.isArray(message.extension)) - return "extension: array expected"; - for (var i = 0; i < message.extension.length; ++i) { - var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); - if (error) - return "extension." + error; - } - } - if (message.nestedType != null && message.hasOwnProperty("nestedType")) { - if (!Array.isArray(message.nestedType)) - return "nestedType: array expected"; - for (var i = 0; i < message.nestedType.length; ++i) { - var error = $root.google.protobuf.DescriptorProto.verify(message.nestedType[i]); - if (error) - return "nestedType." + error; - } - } - if (message.enumType != null && message.hasOwnProperty("enumType")) { - if (!Array.isArray(message.enumType)) - return "enumType: array expected"; - for (var i = 0; i < message.enumType.length; ++i) { - var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); - if (error) - return "enumType." + error; - } - } - if (message.extensionRange != null && message.hasOwnProperty("extensionRange")) { - if (!Array.isArray(message.extensionRange)) - return "extensionRange: array expected"; - for (var i = 0; i < message.extensionRange.length; ++i) { - var error = $root.google.protobuf.DescriptorProto.ExtensionRange.verify(message.extensionRange[i]); - if (error) - return "extensionRange." + error; - } - } - if (message.oneofDecl != null && message.hasOwnProperty("oneofDecl")) { - if (!Array.isArray(message.oneofDecl)) - return "oneofDecl: array expected"; - for (var i = 0; i < message.oneofDecl.length; ++i) { - var error = $root.google.protobuf.OneofDescriptorProto.verify(message.oneofDecl[i]); - if (error) - return "oneofDecl." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.MessageOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { - if (!Array.isArray(message.reservedRange)) - return "reservedRange: array expected"; - for (var i = 0; i < message.reservedRange.length; ++i) { - var error = $root.google.protobuf.DescriptorProto.ReservedRange.verify(message.reservedRange[i]); - if (error) - return "reservedRange." + error; - } - } - if (message.reservedName != null && message.hasOwnProperty("reservedName")) { - if (!Array.isArray(message.reservedName)) - return "reservedName: array expected"; - for (var i = 0; i < message.reservedName.length; ++i) - if (!$util.isString(message.reservedName[i])) - return "reservedName: string[] expected"; - } - return null; - }; - - /** - * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.DescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.DescriptorProto} DescriptorProto - */ - DescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DescriptorProto) - return object; - var message = new $root.google.protobuf.DescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.field) { - if (!Array.isArray(object.field)) - throw TypeError(".google.protobuf.DescriptorProto.field: array expected"); - message.field = []; - for (var i = 0; i < object.field.length; ++i) { - if (typeof object.field[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.field: object expected"); - message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i]); - } - } - if (object.extension) { - if (!Array.isArray(object.extension)) - throw TypeError(".google.protobuf.DescriptorProto.extension: array expected"); - message.extension = []; - for (var i = 0; i < object.extension.length; ++i) { - if (typeof object.extension[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.extension: object expected"); - message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); - } - } - if (object.nestedType) { - if (!Array.isArray(object.nestedType)) - throw TypeError(".google.protobuf.DescriptorProto.nestedType: array expected"); - message.nestedType = []; - for (var i = 0; i < object.nestedType.length; ++i) { - if (typeof object.nestedType[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.nestedType: object expected"); - message.nestedType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nestedType[i]); - } - } - if (object.enumType) { - if (!Array.isArray(object.enumType)) - throw TypeError(".google.protobuf.DescriptorProto.enumType: array expected"); - message.enumType = []; - for (var i = 0; i < object.enumType.length; ++i) { - if (typeof object.enumType[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.enumType: object expected"); - message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); - } - } - if (object.extensionRange) { - if (!Array.isArray(object.extensionRange)) - throw TypeError(".google.protobuf.DescriptorProto.extensionRange: array expected"); - message.extensionRange = []; - for (var i = 0; i < object.extensionRange.length; ++i) { - if (typeof object.extensionRange[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.extensionRange: object expected"); - message.extensionRange[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extensionRange[i]); - } - } - if (object.oneofDecl) { - if (!Array.isArray(object.oneofDecl)) - throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: array expected"); - message.oneofDecl = []; - for (var i = 0; i < object.oneofDecl.length; ++i) { - if (typeof object.oneofDecl[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: object expected"); - message.oneofDecl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneofDecl[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.DescriptorProto.options: object expected"); - message.options = $root.google.protobuf.MessageOptions.fromObject(object.options); - } - if (object.reservedRange) { - if (!Array.isArray(object.reservedRange)) - throw TypeError(".google.protobuf.DescriptorProto.reservedRange: array expected"); - message.reservedRange = []; - for (var i = 0; i < object.reservedRange.length; ++i) { - if (typeof object.reservedRange[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.reservedRange: object expected"); - message.reservedRange[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reservedRange[i]); - } - } - if (object.reservedName) { - if (!Array.isArray(object.reservedName)) - throw TypeError(".google.protobuf.DescriptorProto.reservedName: array expected"); - message.reservedName = []; - for (var i = 0; i < object.reservedName.length; ++i) - message.reservedName[i] = String(object.reservedName[i]); - } - return message; - }; - - /** - * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.DescriptorProto - * @static - * @param {google.protobuf.DescriptorProto} message DescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.field = []; - object.nestedType = []; - object.enumType = []; - object.extensionRange = []; - object.extension = []; - object.oneofDecl = []; - object.reservedRange = []; - object.reservedName = []; - } - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.field && message.field.length) { - object.field = []; - for (var j = 0; j < message.field.length; ++j) - object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options); - } - if (message.nestedType && message.nestedType.length) { - object.nestedType = []; - for (var j = 0; j < message.nestedType.length; ++j) - object.nestedType[j] = $root.google.protobuf.DescriptorProto.toObject(message.nestedType[j], options); - } - if (message.enumType && message.enumType.length) { - object.enumType = []; - for (var j = 0; j < message.enumType.length; ++j) - object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); - } - if (message.extensionRange && message.extensionRange.length) { - object.extensionRange = []; - for (var j = 0; j < message.extensionRange.length; ++j) - object.extensionRange[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extensionRange[j], options); - } - if (message.extension && message.extension.length) { - object.extension = []; - for (var j = 0; j < message.extension.length; ++j) - object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options); - if (message.oneofDecl && message.oneofDecl.length) { - object.oneofDecl = []; - for (var j = 0; j < message.oneofDecl.length; ++j) - object.oneofDecl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneofDecl[j], options); - } - if (message.reservedRange && message.reservedRange.length) { - object.reservedRange = []; - for (var j = 0; j < message.reservedRange.length; ++j) - object.reservedRange[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reservedRange[j], options); - } - if (message.reservedName && message.reservedName.length) { - object.reservedName = []; - for (var j = 0; j < message.reservedName.length; ++j) - object.reservedName[j] = message.reservedName[j]; - } - return object; - }; - - /** - * Converts this DescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.DescriptorProto - * @instance - * @returns {Object.} JSON object - */ - DescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.DescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.DescriptorProto"; - }; - - DescriptorProto.ExtensionRange = (function() { - - /** - * Properties of an ExtensionRange. - * @memberof google.protobuf.DescriptorProto - * @interface IExtensionRange - * @property {number|null} [start] ExtensionRange start - * @property {number|null} [end] ExtensionRange end - * @property {google.protobuf.IExtensionRangeOptions|null} [options] ExtensionRange options - */ - - /** - * Constructs a new ExtensionRange. - * @memberof google.protobuf.DescriptorProto - * @classdesc Represents an ExtensionRange. - * @implements IExtensionRange - * @constructor - * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set - */ - function ExtensionRange(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExtensionRange start. - * @member {number} start - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - */ - ExtensionRange.prototype.start = 0; - - /** - * ExtensionRange end. - * @member {number} end - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - */ - ExtensionRange.prototype.end = 0; - - /** - * ExtensionRange options. - * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - */ - ExtensionRange.prototype.options = null; - - /** - * Creates a new ExtensionRange instance using the specified properties. - * @function create - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance - */ - ExtensionRange.create = function create(properties) { - return new ExtensionRange(properties); - }; - - /** - * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @function encode - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtensionRange.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.start != null && Object.hasOwnProperty.call(message, "start")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExtensionRange message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtensionRange.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.start = reader.int32(); - break; - } - case 2: { - message.end = reader.int32(); - break; - } - case 3: { - message.options = $root.google.protobuf.ExtensionRangeOptions.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtensionRange.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExtensionRange message. - * @function verify - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExtensionRange.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.start != null && message.hasOwnProperty("start")) - if (!$util.isInteger(message.start)) - return "start: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.ExtensionRangeOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange - */ - ExtensionRange.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange) - return object; - var message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); - if (object.start != null) - message.start = object.start | 0; - if (object.end != null) - message.end = object.end | 0; - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange.options: object expected"); - message.options = $root.google.protobuf.ExtensionRangeOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExtensionRange.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.start = 0; - object.end = 0; - object.options = null; - } - if (message.start != null && message.hasOwnProperty("start")) - object.start = message.start; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.ExtensionRangeOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this ExtensionRange to JSON. - * @function toJSON - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - * @returns {Object.} JSON object - */ - ExtensionRange.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExtensionRange - * @function getTypeUrl - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExtensionRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.DescriptorProto.ExtensionRange"; - }; - - return ExtensionRange; - })(); - - DescriptorProto.ReservedRange = (function() { - - /** - * Properties of a ReservedRange. - * @memberof google.protobuf.DescriptorProto - * @interface IReservedRange - * @property {number|null} [start] ReservedRange start - * @property {number|null} [end] ReservedRange end - */ - - /** - * Constructs a new ReservedRange. - * @memberof google.protobuf.DescriptorProto - * @classdesc Represents a ReservedRange. - * @implements IReservedRange - * @constructor - * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set - */ - function ReservedRange(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ReservedRange start. - * @member {number} start - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @instance - */ - ReservedRange.prototype.start = 0; - - /** - * ReservedRange end. - * @member {number} end - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @instance - */ - ReservedRange.prototype.end = 0; - - /** - * Creates a new ReservedRange instance using the specified properties. - * @function create - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance - */ - ReservedRange.create = function create(properties) { - return new ReservedRange(properties); - }; - - /** - * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @function encode - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReservedRange.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.start != null && Object.hasOwnProperty.call(message, "start")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); - return writer; - }; - - /** - * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ReservedRange message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReservedRange.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ReservedRange(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.start = reader.int32(); - break; - } - case 2: { - message.end = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ReservedRange message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReservedRange.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ReservedRange message. - * @function verify - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ReservedRange.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.start != null && message.hasOwnProperty("start")) - if (!$util.isInteger(message.start)) - return "start: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - return null; - }; - - /** - * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange - */ - ReservedRange.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange) - return object; - var message = new $root.google.protobuf.DescriptorProto.ReservedRange(); - if (object.start != null) - message.start = object.start | 0; - if (object.end != null) - message.end = object.end | 0; - return message; - }; - - /** - * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ReservedRange.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.start = 0; - object.end = 0; - } - if (message.start != null && message.hasOwnProperty("start")) - object.start = message.start; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - return object; - }; - - /** - * Converts this ReservedRange to JSON. - * @function toJSON - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @instance - * @returns {Object.} JSON object - */ - ReservedRange.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ReservedRange - * @function getTypeUrl - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.DescriptorProto.ReservedRange"; - }; - - return ReservedRange; - })(); - - return DescriptorProto; - })(); - - protobuf.ExtensionRangeOptions = (function() { - - /** - * Properties of an ExtensionRangeOptions. - * @memberof google.protobuf - * @interface IExtensionRangeOptions - * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption - * @property {Array.|null} [declaration] ExtensionRangeOptions declaration - * @property {google.protobuf.IFeatureSet|null} [features] ExtensionRangeOptions features - * @property {google.protobuf.ExtensionRangeOptions.VerificationState|null} [verification] ExtensionRangeOptions verification - */ - - /** - * Constructs a new ExtensionRangeOptions. - * @memberof google.protobuf - * @classdesc Represents an ExtensionRangeOptions. - * @implements IExtensionRangeOptions - * @constructor - * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set - */ - function ExtensionRangeOptions(properties) { - this.uninterpretedOption = []; - this.declaration = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExtensionRangeOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - */ - ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * ExtensionRangeOptions declaration. - * @member {Array.} declaration - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - */ - ExtensionRangeOptions.prototype.declaration = $util.emptyArray; - - /** - * ExtensionRangeOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - */ - ExtensionRangeOptions.prototype.features = null; - - /** - * ExtensionRangeOptions verification. - * @member {google.protobuf.ExtensionRangeOptions.VerificationState} verification - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - */ - ExtensionRangeOptions.prototype.verification = 1; - - /** - * Creates a new ExtensionRangeOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions instance - */ - ExtensionRangeOptions.create = function create(properties) { - return new ExtensionRangeOptions(properties); - }; - - /** - * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtensionRangeOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.declaration != null && message.declaration.length) - for (var i = 0; i < message.declaration.length; ++i) - $root.google.protobuf.ExtensionRangeOptions.Declaration.encode(message.declaration[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.verification != null && Object.hasOwnProperty.call(message, "verification")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.verification); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtensionRangeOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 2: { - if (!(message.declaration && message.declaration.length)) - message.declaration = []; - message.declaration.push($root.google.protobuf.ExtensionRangeOptions.Declaration.decode(reader, reader.uint32())); - break; - } - case 50: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 3: { - message.verification = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtensionRangeOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExtensionRangeOptions message. - * @function verify - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExtensionRangeOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message.declaration != null && message.hasOwnProperty("declaration")) { - if (!Array.isArray(message.declaration)) - return "declaration: array expected"; - for (var i = 0; i < message.declaration.length; ++i) { - var error = $root.google.protobuf.ExtensionRangeOptions.Declaration.verify(message.declaration[i]); - if (error) - return "declaration." + error; - } - } - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.verification != null && message.hasOwnProperty("verification")) - switch (message.verification) { - default: - return "verification: enum value expected"; - case 0: - case 1: - break; - } - return null; - }; - - /** - * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions - */ - ExtensionRangeOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ExtensionRangeOptions) - return object; - var message = new $root.google.protobuf.ExtensionRangeOptions(); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object.declaration) { - if (!Array.isArray(object.declaration)) - throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: array expected"); - message.declaration = []; - for (var i = 0; i < object.declaration.length; ++i) { - if (typeof object.declaration[i] !== "object") - throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: object expected"); - message.declaration[i] = $root.google.protobuf.ExtensionRangeOptions.Declaration.fromObject(object.declaration[i]); - } - } - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.ExtensionRangeOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - switch (object.verification) { - case "DECLARATION": - case 0: - message.verification = 0; - break; - default: - if (typeof object.verification === "number") { - message.verification = object.verification; - break; - } - break; - case "UNVERIFIED": - case 1: - message.verification = 1; - break; - } - return message; - }; - - /** - * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExtensionRangeOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.declaration = []; - object.uninterpretedOption = []; - } - if (options.defaults) { - object.verification = options.enums === String ? "UNVERIFIED" : 1; - object.features = null; - } - if (message.declaration && message.declaration.length) { - object.declaration = []; - for (var j = 0; j < message.declaration.length; ++j) - object.declaration[j] = $root.google.protobuf.ExtensionRangeOptions.Declaration.toObject(message.declaration[j], options); - } - if (message.verification != null && message.hasOwnProperty("verification")) - object.verification = options.enums === String ? $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] === undefined ? message.verification : $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] : message.verification; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; - - /** - * Converts this ExtensionRangeOptions to JSON. - * @function toJSON - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - * @returns {Object.} JSON object - */ - ExtensionRangeOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExtensionRangeOptions - * @function getTypeUrl - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExtensionRangeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions"; - }; - - ExtensionRangeOptions.Declaration = (function() { - - /** - * Properties of a Declaration. - * @memberof google.protobuf.ExtensionRangeOptions - * @interface IDeclaration - * @property {number|null} [number] Declaration number - * @property {string|null} [fullName] Declaration fullName - * @property {string|null} [type] Declaration type - * @property {boolean|null} [reserved] Declaration reserved - * @property {boolean|null} [repeated] Declaration repeated - */ - - /** - * Constructs a new Declaration. - * @memberof google.protobuf.ExtensionRangeOptions - * @classdesc Represents a Declaration. - * @implements IDeclaration - * @constructor - * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set - */ - function Declaration(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Declaration number. - * @member {number} number - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.number = 0; - - /** - * Declaration fullName. - * @member {string} fullName - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.fullName = ""; - - /** - * Declaration type. - * @member {string} type - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.type = ""; - - /** - * Declaration reserved. - * @member {boolean} reserved - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.reserved = false; - - /** - * Declaration repeated. - * @member {boolean} repeated - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.repeated = false; - - /** - * Creates a new Declaration instance using the specified properties. - * @function create - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set - * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration instance - */ - Declaration.create = function create(properties) { - return new Declaration(properties); - }; - - /** - * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Declaration.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.number != null && Object.hasOwnProperty.call(message, "number")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.number); - if (message.fullName != null && Object.hasOwnProperty.call(message, "fullName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.fullName); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.type); - if (message.reserved != null && Object.hasOwnProperty.call(message, "reserved")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.reserved); - if (message.repeated != null && Object.hasOwnProperty.call(message, "repeated")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.repeated); - return writer; - }; - - /** - * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Declaration.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Declaration message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Declaration.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.number = reader.int32(); - break; - } - case 2: { - message.fullName = reader.string(); - break; - } - case 3: { - message.type = reader.string(); - break; - } - case 5: { - message.reserved = reader.bool(); - break; - } - case 6: { - message.repeated = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Declaration message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Declaration.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Declaration message. - * @function verify - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Declaration.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.number != null && message.hasOwnProperty("number")) - if (!$util.isInteger(message.number)) - return "number: integer expected"; - if (message.fullName != null && message.hasOwnProperty("fullName")) - if (!$util.isString(message.fullName)) - return "fullName: string expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.reserved != null && message.hasOwnProperty("reserved")) - if (typeof message.reserved !== "boolean") - return "reserved: boolean expected"; - if (message.repeated != null && message.hasOwnProperty("repeated")) - if (typeof message.repeated !== "boolean") - return "repeated: boolean expected"; - return null; - }; - - /** - * Creates a Declaration message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration - */ - Declaration.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ExtensionRangeOptions.Declaration) - return object; - var message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); - if (object.number != null) - message.number = object.number | 0; - if (object.fullName != null) - message.fullName = String(object.fullName); - if (object.type != null) - message.type = String(object.type); - if (object.reserved != null) - message.reserved = Boolean(object.reserved); - if (object.repeated != null) - message.repeated = Boolean(object.repeated); - return message; - }; - - /** - * Creates a plain object from a Declaration message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {google.protobuf.ExtensionRangeOptions.Declaration} message Declaration - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Declaration.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.number = 0; - object.fullName = ""; - object.type = ""; - object.reserved = false; - object.repeated = false; - } - if (message.number != null && message.hasOwnProperty("number")) - object.number = message.number; - if (message.fullName != null && message.hasOwnProperty("fullName")) - object.fullName = message.fullName; - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.reserved != null && message.hasOwnProperty("reserved")) - object.reserved = message.reserved; - if (message.repeated != null && message.hasOwnProperty("repeated")) - object.repeated = message.repeated; - return object; - }; - - /** - * Converts this Declaration to JSON. - * @function toJSON - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - * @returns {Object.} JSON object - */ - Declaration.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Declaration - * @function getTypeUrl - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Declaration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions.Declaration"; - }; - - return Declaration; - })(); - - /** - * VerificationState enum. - * @name google.protobuf.ExtensionRangeOptions.VerificationState - * @enum {number} - * @property {number} DECLARATION=0 DECLARATION value - * @property {number} UNVERIFIED=1 UNVERIFIED value - */ - ExtensionRangeOptions.VerificationState = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "DECLARATION"] = 0; - values[valuesById[1] = "UNVERIFIED"] = 1; - return values; - })(); - - return ExtensionRangeOptions; - })(); - - protobuf.FieldDescriptorProto = (function() { - - /** - * Properties of a FieldDescriptorProto. - * @memberof google.protobuf - * @interface IFieldDescriptorProto - * @property {string|null} [name] FieldDescriptorProto name - * @property {number|null} [number] FieldDescriptorProto number - * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label - * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type - * @property {string|null} [typeName] FieldDescriptorProto typeName - * @property {string|null} [extendee] FieldDescriptorProto extendee - * @property {string|null} [defaultValue] FieldDescriptorProto defaultValue - * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex - * @property {string|null} [jsonName] FieldDescriptorProto jsonName - * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options - * @property {boolean|null} [proto3Optional] FieldDescriptorProto proto3Optional - */ - - /** - * Constructs a new FieldDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a FieldDescriptorProto. - * @implements IFieldDescriptorProto - * @constructor - * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set - */ - function FieldDescriptorProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FieldDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.name = ""; - - /** - * FieldDescriptorProto number. - * @member {number} number - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.number = 0; - - /** - * FieldDescriptorProto label. - * @member {google.protobuf.FieldDescriptorProto.Label} label - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.label = 1; - - /** - * FieldDescriptorProto type. - * @member {google.protobuf.FieldDescriptorProto.Type} type - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.type = 1; - - /** - * FieldDescriptorProto typeName. - * @member {string} typeName - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.typeName = ""; - - /** - * FieldDescriptorProto extendee. - * @member {string} extendee - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.extendee = ""; - - /** - * FieldDescriptorProto defaultValue. - * @member {string} defaultValue - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.defaultValue = ""; - - /** - * FieldDescriptorProto oneofIndex. - * @member {number} oneofIndex - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.oneofIndex = 0; - - /** - * FieldDescriptorProto jsonName. - * @member {string} jsonName - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.jsonName = ""; - - /** - * FieldDescriptorProto options. - * @member {google.protobuf.IFieldOptions|null|undefined} options - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.options = null; - - /** - * FieldDescriptorProto proto3Optional. - * @member {boolean} proto3Optional - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.proto3Optional = false; - - /** - * Creates a new FieldDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance - */ - FieldDescriptorProto.create = function create(properties) { - return new FieldDescriptorProto(properties); - }; - - /** - * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); - if (message.number != null && Object.hasOwnProperty.call(message, "number")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); - if (message.label != null && Object.hasOwnProperty.call(message, "label")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); - if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); - if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); - if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); - if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) - writer.uint32(/* id 17, wireType 0 =*/136).bool(message.proto3Optional); - return writer; - }; - - /** - * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldDescriptorProto.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 3: { - message.number = reader.int32(); - break; - } - case 4: { - message.label = reader.int32(); - break; - } - case 5: { - message.type = reader.int32(); - break; - } - case 6: { - message.typeName = reader.string(); - break; - } - case 2: { - message.extendee = reader.string(); - break; - } - case 7: { - message.defaultValue = reader.string(); - break; - } - case 9: { - message.oneofIndex = reader.int32(); - break; - } - case 10: { - message.jsonName = reader.string(); - break; - } - case 8: { - message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); - break; - } - case 17: { - message.proto3Optional = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FieldDescriptorProto message. - * @function verify - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FieldDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.number != null && message.hasOwnProperty("number")) - if (!$util.isInteger(message.number)) - return "number: integer expected"; - if (message.label != null && message.hasOwnProperty("label")) - switch (message.label) { - default: - return "label: enum value expected"; - case 1: - case 3: - case 2: - break; - } - if (message.type != null && message.hasOwnProperty("type")) - switch (message.type) { - default: - return "type: enum value expected"; - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - case 10: - case 11: - case 12: - case 13: - case 14: - case 15: - case 16: - case 17: - case 18: - break; - } - if (message.typeName != null && message.hasOwnProperty("typeName")) - if (!$util.isString(message.typeName)) - return "typeName: string expected"; - if (message.extendee != null && message.hasOwnProperty("extendee")) - if (!$util.isString(message.extendee)) - return "extendee: string expected"; - if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) - if (!$util.isString(message.defaultValue)) - return "defaultValue: string expected"; - if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) - if (!$util.isInteger(message.oneofIndex)) - return "oneofIndex: integer expected"; - if (message.jsonName != null && message.hasOwnProperty("jsonName")) - if (!$util.isString(message.jsonName)) - return "jsonName: string expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.FieldOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) - if (typeof message.proto3Optional !== "boolean") - return "proto3Optional: boolean expected"; - return null; - }; - - /** - * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto - */ - FieldDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldDescriptorProto) - return object; - var message = new $root.google.protobuf.FieldDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.number != null) - message.number = object.number | 0; - switch (object.label) { - default: - if (typeof object.label === "number") { - message.label = object.label; - break; - } - break; - case "LABEL_OPTIONAL": - case 1: - message.label = 1; - break; - case "LABEL_REPEATED": - case 3: - message.label = 3; - break; - case "LABEL_REQUIRED": - case 2: - message.label = 2; - break; - } - switch (object.type) { - default: - if (typeof object.type === "number") { - message.type = object.type; - break; - } - break; - case "TYPE_DOUBLE": - case 1: - message.type = 1; - break; - case "TYPE_FLOAT": - case 2: - message.type = 2; - break; - case "TYPE_INT64": - case 3: - message.type = 3; - break; - case "TYPE_UINT64": - case 4: - message.type = 4; - break; - case "TYPE_INT32": - case 5: - message.type = 5; - break; - case "TYPE_FIXED64": - case 6: - message.type = 6; - break; - case "TYPE_FIXED32": - case 7: - message.type = 7; - break; - case "TYPE_BOOL": - case 8: - message.type = 8; - break; - case "TYPE_STRING": - case 9: - message.type = 9; - break; - case "TYPE_GROUP": - case 10: - message.type = 10; - break; - case "TYPE_MESSAGE": - case 11: - message.type = 11; - break; - case "TYPE_BYTES": - case 12: - message.type = 12; - break; - case "TYPE_UINT32": - case 13: - message.type = 13; - break; - case "TYPE_ENUM": - case 14: - message.type = 14; - break; - case "TYPE_SFIXED32": - case 15: - message.type = 15; - break; - case "TYPE_SFIXED64": - case 16: - message.type = 16; - break; - case "TYPE_SINT32": - case 17: - message.type = 17; - break; - case "TYPE_SINT64": - case 18: - message.type = 18; - break; - } - if (object.typeName != null) - message.typeName = String(object.typeName); - if (object.extendee != null) - message.extendee = String(object.extendee); - if (object.defaultValue != null) - message.defaultValue = String(object.defaultValue); - if (object.oneofIndex != null) - message.oneofIndex = object.oneofIndex | 0; - if (object.jsonName != null) - message.jsonName = String(object.jsonName); - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.FieldOptions.fromObject(object.options); - } - if (object.proto3Optional != null) - message.proto3Optional = Boolean(object.proto3Optional); - return message; - }; - - /** - * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FieldDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.extendee = ""; - object.number = 0; - object.label = options.enums === String ? "LABEL_OPTIONAL" : 1; - object.type = options.enums === String ? "TYPE_DOUBLE" : 1; - object.typeName = ""; - object.defaultValue = ""; - object.options = null; - object.oneofIndex = 0; - object.jsonName = ""; - object.proto3Optional = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.extendee != null && message.hasOwnProperty("extendee")) - object.extendee = message.extendee; - if (message.number != null && message.hasOwnProperty("number")) - object.number = message.number; - if (message.label != null && message.hasOwnProperty("label")) - object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] === undefined ? message.label : $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] === undefined ? message.type : $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; - if (message.typeName != null && message.hasOwnProperty("typeName")) - object.typeName = message.typeName; - if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) - object.defaultValue = message.defaultValue; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options); - if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) - object.oneofIndex = message.oneofIndex; - if (message.jsonName != null && message.hasOwnProperty("jsonName")) - object.jsonName = message.jsonName; - if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) - object.proto3Optional = message.proto3Optional; - return object; - }; - - /** - * Converts this FieldDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.FieldDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - FieldDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FieldDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FieldDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FieldDescriptorProto"; - }; - - /** - * Type enum. - * @name google.protobuf.FieldDescriptorProto.Type - * @enum {number} - * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value - * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value - * @property {number} TYPE_INT64=3 TYPE_INT64 value - * @property {number} TYPE_UINT64=4 TYPE_UINT64 value - * @property {number} TYPE_INT32=5 TYPE_INT32 value - * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value - * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value - * @property {number} TYPE_BOOL=8 TYPE_BOOL value - * @property {number} TYPE_STRING=9 TYPE_STRING value - * @property {number} TYPE_GROUP=10 TYPE_GROUP value - * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value - * @property {number} TYPE_BYTES=12 TYPE_BYTES value - * @property {number} TYPE_UINT32=13 TYPE_UINT32 value - * @property {number} TYPE_ENUM=14 TYPE_ENUM value - * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value - * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value - * @property {number} TYPE_SINT32=17 TYPE_SINT32 value - * @property {number} TYPE_SINT64=18 TYPE_SINT64 value - */ - FieldDescriptorProto.Type = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[1] = "TYPE_DOUBLE"] = 1; - values[valuesById[2] = "TYPE_FLOAT"] = 2; - values[valuesById[3] = "TYPE_INT64"] = 3; - values[valuesById[4] = "TYPE_UINT64"] = 4; - values[valuesById[5] = "TYPE_INT32"] = 5; - values[valuesById[6] = "TYPE_FIXED64"] = 6; - values[valuesById[7] = "TYPE_FIXED32"] = 7; - values[valuesById[8] = "TYPE_BOOL"] = 8; - values[valuesById[9] = "TYPE_STRING"] = 9; - values[valuesById[10] = "TYPE_GROUP"] = 10; - values[valuesById[11] = "TYPE_MESSAGE"] = 11; - values[valuesById[12] = "TYPE_BYTES"] = 12; - values[valuesById[13] = "TYPE_UINT32"] = 13; - values[valuesById[14] = "TYPE_ENUM"] = 14; - values[valuesById[15] = "TYPE_SFIXED32"] = 15; - values[valuesById[16] = "TYPE_SFIXED64"] = 16; - values[valuesById[17] = "TYPE_SINT32"] = 17; - values[valuesById[18] = "TYPE_SINT64"] = 18; - return values; - })(); - - /** - * Label enum. - * @name google.protobuf.FieldDescriptorProto.Label - * @enum {number} - * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value - * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value - * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value - */ - FieldDescriptorProto.Label = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[1] = "LABEL_OPTIONAL"] = 1; - values[valuesById[3] = "LABEL_REPEATED"] = 3; - values[valuesById[2] = "LABEL_REQUIRED"] = 2; - return values; - })(); - - return FieldDescriptorProto; - })(); - - protobuf.OneofDescriptorProto = (function() { - - /** - * Properties of an OneofDescriptorProto. - * @memberof google.protobuf - * @interface IOneofDescriptorProto - * @property {string|null} [name] OneofDescriptorProto name - * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options - */ - - /** - * Constructs a new OneofDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents an OneofDescriptorProto. - * @implements IOneofDescriptorProto - * @constructor - * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set - */ - function OneofDescriptorProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * OneofDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.OneofDescriptorProto - * @instance - */ - OneofDescriptorProto.prototype.name = ""; - - /** - * OneofDescriptorProto options. - * @member {google.protobuf.IOneofOptions|null|undefined} options - * @memberof google.protobuf.OneofDescriptorProto - * @instance - */ - OneofDescriptorProto.prototype.options = null; - - /** - * Creates a new OneofDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance - */ - OneofDescriptorProto.create = function create(properties) { - return new OneofDescriptorProto(properties); - }; - - /** - * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofDescriptorProto.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OneofDescriptorProto message. - * @function verify - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OneofDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.OneofOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto - */ - OneofDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.OneofDescriptorProto) - return object; - var message = new $root.google.protobuf.OneofDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.OneofOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OneofDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this OneofDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.OneofDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - OneofDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OneofDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OneofDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.OneofDescriptorProto"; - }; - - return OneofDescriptorProto; - })(); - - protobuf.EnumDescriptorProto = (function() { - - /** - * Properties of an EnumDescriptorProto. - * @memberof google.protobuf - * @interface IEnumDescriptorProto - * @property {string|null} [name] EnumDescriptorProto name - * @property {Array.|null} [value] EnumDescriptorProto value - * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options - * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange - * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName - */ - - /** - * Constructs a new EnumDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents an EnumDescriptorProto. - * @implements IEnumDescriptorProto - * @constructor - * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set - */ - function EnumDescriptorProto(properties) { - this.value = []; - this.reservedRange = []; - this.reservedName = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.name = ""; - - /** - * EnumDescriptorProto value. - * @member {Array.} value - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.value = $util.emptyArray; - - /** - * EnumDescriptorProto options. - * @member {google.protobuf.IEnumOptions|null|undefined} options - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.options = null; - - /** - * EnumDescriptorProto reservedRange. - * @member {Array.} reservedRange - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; - - /** - * EnumDescriptorProto reservedName. - * @member {Array.} reservedName - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.reservedName = $util.emptyArray; - - /** - * Creates a new EnumDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance - */ - EnumDescriptorProto.create = function create(properties) { - return new EnumDescriptorProto(properties); - }; - - /** - * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.value != null && message.value.length) - for (var i = 0; i < message.value.length; ++i) - $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.reservedRange != null && message.reservedRange.length) - for (var i = 0; i < message.reservedRange.length; ++i) - $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.reservedName != null && message.reservedName.length) - for (var i = 0; i < message.reservedName.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); - return writer; - }; - - /** - * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumDescriptorProto.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - if (!(message.value && message.value.length)) - message.value = []; - message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 3: { - message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); - break; - } - case 4: { - if (!(message.reservedRange && message.reservedRange.length)) - message.reservedRange = []; - message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32())); - break; - } - case 5: { - if (!(message.reservedName && message.reservedName.length)) - message.reservedName = []; - message.reservedName.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumDescriptorProto message. - * @function verify - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.value != null && message.hasOwnProperty("value")) { - if (!Array.isArray(message.value)) - return "value: array expected"; - for (var i = 0; i < message.value.length; ++i) { - var error = $root.google.protobuf.EnumValueDescriptorProto.verify(message.value[i]); - if (error) - return "value." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.EnumOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { - if (!Array.isArray(message.reservedRange)) - return "reservedRange: array expected"; - for (var i = 0; i < message.reservedRange.length; ++i) { - var error = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.verify(message.reservedRange[i]); - if (error) - return "reservedRange." + error; - } - } - if (message.reservedName != null && message.hasOwnProperty("reservedName")) { - if (!Array.isArray(message.reservedName)) - return "reservedName: array expected"; - for (var i = 0; i < message.reservedName.length; ++i) - if (!$util.isString(message.reservedName[i])) - return "reservedName: string[] expected"; - } - return null; - }; - - /** - * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto - */ - EnumDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumDescriptorProto) - return object; - var message = new $root.google.protobuf.EnumDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.value) { - if (!Array.isArray(object.value)) - throw TypeError(".google.protobuf.EnumDescriptorProto.value: array expected"); - message.value = []; - for (var i = 0; i < object.value.length; ++i) { - if (typeof object.value[i] !== "object") - throw TypeError(".google.protobuf.EnumDescriptorProto.value: object expected"); - message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.EnumDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.EnumOptions.fromObject(object.options); - } - if (object.reservedRange) { - if (!Array.isArray(object.reservedRange)) - throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: array expected"); - message.reservedRange = []; - for (var i = 0; i < object.reservedRange.length; ++i) { - if (typeof object.reservedRange[i] !== "object") - throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: object expected"); - message.reservedRange[i] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.fromObject(object.reservedRange[i]); - } - } - if (object.reservedName) { - if (!Array.isArray(object.reservedName)) - throw TypeError(".google.protobuf.EnumDescriptorProto.reservedName: array expected"); - message.reservedName = []; - for (var i = 0; i < object.reservedName.length; ++i) - message.reservedName[i] = String(object.reservedName[i]); - } - return message; - }; - - /** - * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.value = []; - object.reservedRange = []; - object.reservedName = []; - } - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.value && message.value.length) { - object.value = []; - for (var j = 0; j < message.value.length; ++j) - object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options); - if (message.reservedRange && message.reservedRange.length) { - object.reservedRange = []; - for (var j = 0; j < message.reservedRange.length; ++j) - object.reservedRange[j] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.toObject(message.reservedRange[j], options); - } - if (message.reservedName && message.reservedName.length) { - object.reservedName = []; - for (var j = 0; j < message.reservedName.length; ++j) - object.reservedName[j] = message.reservedName[j]; - } - return object; - }; - - /** - * Converts this EnumDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.EnumDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - EnumDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto"; - }; - - EnumDescriptorProto.EnumReservedRange = (function() { - - /** - * Properties of an EnumReservedRange. - * @memberof google.protobuf.EnumDescriptorProto - * @interface IEnumReservedRange - * @property {number|null} [start] EnumReservedRange start - * @property {number|null} [end] EnumReservedRange end - */ - - /** - * Constructs a new EnumReservedRange. - * @memberof google.protobuf.EnumDescriptorProto - * @classdesc Represents an EnumReservedRange. - * @implements IEnumReservedRange - * @constructor - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set - */ - function EnumReservedRange(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumReservedRange start. - * @member {number} start - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @instance - */ - EnumReservedRange.prototype.start = 0; - - /** - * EnumReservedRange end. - * @member {number} end - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @instance - */ - EnumReservedRange.prototype.end = 0; - - /** - * Creates a new EnumReservedRange instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set - * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance - */ - EnumReservedRange.create = function create(properties) { - return new EnumReservedRange(properties); - }; - - /** - * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumReservedRange.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.start != null && Object.hasOwnProperty.call(message, "start")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); - return writer; - }; - - /** - * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumReservedRange message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumReservedRange.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.start = reader.int32(); - break; - } - case 2: { - message.end = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumReservedRange.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumReservedRange message. - * @function verify - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumReservedRange.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.start != null && message.hasOwnProperty("start")) - if (!$util.isInteger(message.start)) - return "start: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - return null; - }; - - /** - * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange - */ - EnumReservedRange.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumDescriptorProto.EnumReservedRange) - return object; - var message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); - if (object.start != null) - message.start = object.start | 0; - if (object.end != null) - message.end = object.end | 0; - return message; - }; - - /** - * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {google.protobuf.EnumDescriptorProto.EnumReservedRange} message EnumReservedRange - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumReservedRange.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.start = 0; - object.end = 0; - } - if (message.start != null && message.hasOwnProperty("start")) - object.start = message.start; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - return object; - }; - - /** - * Converts this EnumReservedRange to JSON. - * @function toJSON - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @instance - * @returns {Object.} JSON object - */ - EnumReservedRange.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumReservedRange - * @function getTypeUrl - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto.EnumReservedRange"; - }; - - return EnumReservedRange; - })(); - - return EnumDescriptorProto; - })(); - - protobuf.EnumValueDescriptorProto = (function() { - - /** - * Properties of an EnumValueDescriptorProto. - * @memberof google.protobuf - * @interface IEnumValueDescriptorProto - * @property {string|null} [name] EnumValueDescriptorProto name - * @property {number|null} [number] EnumValueDescriptorProto number - * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options - */ - - /** - * Constructs a new EnumValueDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents an EnumValueDescriptorProto. - * @implements IEnumValueDescriptorProto - * @constructor - * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set - */ - function EnumValueDescriptorProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumValueDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - */ - EnumValueDescriptorProto.prototype.name = ""; - - /** - * EnumValueDescriptorProto number. - * @member {number} number - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - */ - EnumValueDescriptorProto.prototype.number = 0; - - /** - * EnumValueDescriptorProto options. - * @member {google.protobuf.IEnumValueOptions|null|undefined} options - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - */ - EnumValueDescriptorProto.prototype.options = null; - - /** - * Creates a new EnumValueDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance - */ - EnumValueDescriptorProto.create = function create(properties) { - return new EnumValueDescriptorProto(properties); - }; - - /** - * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.number != null && Object.hasOwnProperty.call(message, "number")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueDescriptorProto.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.number = reader.int32(); - break; - } - case 3: { - message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumValueDescriptorProto message. - * @function verify - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumValueDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.number != null && message.hasOwnProperty("number")) - if (!$util.isInteger(message.number)) - return "number: integer expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.EnumValueOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto - */ - EnumValueDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) - return object; - var message = new $root.google.protobuf.EnumValueDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.number != null) - message.number = object.number | 0; - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumValueDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.number = 0; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.number != null && message.hasOwnProperty("number")) - object.number = message.number; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this EnumValueDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - EnumValueDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumValueDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumValueDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumValueDescriptorProto"; - }; - - return EnumValueDescriptorProto; - })(); - - protobuf.ServiceDescriptorProto = (function() { - - /** - * Properties of a ServiceDescriptorProto. - * @memberof google.protobuf - * @interface IServiceDescriptorProto - * @property {string|null} [name] ServiceDescriptorProto name - * @property {Array.|null} [method] ServiceDescriptorProto method - * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options - */ - - /** - * Constructs a new ServiceDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a ServiceDescriptorProto. - * @implements IServiceDescriptorProto - * @constructor - * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set - */ - function ServiceDescriptorProto(properties) { - this.method = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ServiceDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - */ - ServiceDescriptorProto.prototype.name = ""; - - /** - * ServiceDescriptorProto method. - * @member {Array.} method - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - */ - ServiceDescriptorProto.prototype.method = $util.emptyArray; - - /** - * ServiceDescriptorProto options. - * @member {google.protobuf.IServiceOptions|null|undefined} options - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - */ - ServiceDescriptorProto.prototype.options = null; - - /** - * Creates a new ServiceDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance - */ - ServiceDescriptorProto.create = function create(properties) { - return new ServiceDescriptorProto(properties); - }; - - /** - * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.method != null && message.method.length) - for (var i = 0; i < message.method.length; ++i) - $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceDescriptorProto.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - if (!(message.method && message.method.length)) - message.method = []; - message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 3: { - message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ServiceDescriptorProto message. - * @function verify - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ServiceDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.method != null && message.hasOwnProperty("method")) { - if (!Array.isArray(message.method)) - return "method: array expected"; - for (var i = 0; i < message.method.length; ++i) { - var error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i]); - if (error) - return "method." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.ServiceOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto - */ - ServiceDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ServiceDescriptorProto) - return object; - var message = new $root.google.protobuf.ServiceDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.method) { - if (!Array.isArray(object.method)) - throw TypeError(".google.protobuf.ServiceDescriptorProto.method: array expected"); - message.method = []; - for (var i = 0; i < object.method.length; ++i) { - if (typeof object.method[i] !== "object") - throw TypeError(".google.protobuf.ServiceDescriptorProto.method: object expected"); - message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ServiceDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.method = []; - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.method && message.method.length) { - object.method = []; - for (var j = 0; j < message.method.length; ++j) - object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this ServiceDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - ServiceDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ServiceDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ServiceDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.ServiceDescriptorProto"; - }; - - return ServiceDescriptorProto; - })(); - - protobuf.MethodDescriptorProto = (function() { - - /** - * Properties of a MethodDescriptorProto. - * @memberof google.protobuf - * @interface IMethodDescriptorProto - * @property {string|null} [name] MethodDescriptorProto name - * @property {string|null} [inputType] MethodDescriptorProto inputType - * @property {string|null} [outputType] MethodDescriptorProto outputType - * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options - * @property {boolean|null} [clientStreaming] MethodDescriptorProto clientStreaming - * @property {boolean|null} [serverStreaming] MethodDescriptorProto serverStreaming - */ - - /** - * Constructs a new MethodDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a MethodDescriptorProto. - * @implements IMethodDescriptorProto - * @constructor - * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set - */ - function MethodDescriptorProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MethodDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.name = ""; - - /** - * MethodDescriptorProto inputType. - * @member {string} inputType - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.inputType = ""; - - /** - * MethodDescriptorProto outputType. - * @member {string} outputType - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.outputType = ""; - - /** - * MethodDescriptorProto options. - * @member {google.protobuf.IMethodOptions|null|undefined} options - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.options = null; - - /** - * MethodDescriptorProto clientStreaming. - * @member {boolean} clientStreaming - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.clientStreaming = false; - - /** - * MethodDescriptorProto serverStreaming. - * @member {boolean} serverStreaming - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.serverStreaming = false; - - /** - * Creates a new MethodDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance - */ - MethodDescriptorProto.create = function create(properties) { - return new MethodDescriptorProto(properties); - }; - - /** - * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); - if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); - if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); - return writer; - }; - - /** - * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodDescriptorProto.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.inputType = reader.string(); - break; - } - case 3: { - message.outputType = reader.string(); - break; - } - case 4: { - message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); - break; - } - case 5: { - message.clientStreaming = reader.bool(); - break; - } - case 6: { - message.serverStreaming = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MethodDescriptorProto message. - * @function verify - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MethodDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.inputType != null && message.hasOwnProperty("inputType")) - if (!$util.isString(message.inputType)) - return "inputType: string expected"; - if (message.outputType != null && message.hasOwnProperty("outputType")) - if (!$util.isString(message.outputType)) - return "outputType: string expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.MethodOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) - if (typeof message.clientStreaming !== "boolean") - return "clientStreaming: boolean expected"; - if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) - if (typeof message.serverStreaming !== "boolean") - return "serverStreaming: boolean expected"; - return null; - }; - - /** - * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto - */ - MethodDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.MethodDescriptorProto) - return object; - var message = new $root.google.protobuf.MethodDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.inputType != null) - message.inputType = String(object.inputType); - if (object.outputType != null) - message.outputType = String(object.outputType); - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.MethodOptions.fromObject(object.options); - } - if (object.clientStreaming != null) - message.clientStreaming = Boolean(object.clientStreaming); - if (object.serverStreaming != null) - message.serverStreaming = Boolean(object.serverStreaming); - return message; - }; - - /** - * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MethodDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.inputType = ""; - object.outputType = ""; - object.options = null; - object.clientStreaming = false; - object.serverStreaming = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.inputType != null && message.hasOwnProperty("inputType")) - object.inputType = message.inputType; - if (message.outputType != null && message.hasOwnProperty("outputType")) - object.outputType = message.outputType; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options); - if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) - object.clientStreaming = message.clientStreaming; - if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) - object.serverStreaming = message.serverStreaming; - return object; - }; - - /** - * Converts this MethodDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.MethodDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - MethodDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MethodDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MethodDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.MethodDescriptorProto"; - }; - - return MethodDescriptorProto; - })(); - - protobuf.FileOptions = (function() { - - /** - * Properties of a FileOptions. - * @memberof google.protobuf - * @interface IFileOptions - * @property {string|null} [javaPackage] FileOptions javaPackage - * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname - * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles - * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash - * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8 - * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor - * @property {string|null} [goPackage] FileOptions goPackage - * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices - * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices - * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices - * @property {boolean|null} [deprecated] FileOptions deprecated - * @property {boolean|null} [ccEnableArenas] FileOptions ccEnableArenas - * @property {string|null} [objcClassPrefix] FileOptions objcClassPrefix - * @property {string|null} [csharpNamespace] FileOptions csharpNamespace - * @property {string|null} [swiftPrefix] FileOptions swiftPrefix - * @property {string|null} [phpClassPrefix] FileOptions phpClassPrefix - * @property {string|null} [phpNamespace] FileOptions phpNamespace - * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace - * @property {string|null} [rubyPackage] FileOptions rubyPackage - * @property {google.protobuf.IFeatureSet|null} [features] FileOptions features - * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption - * @property {Array.|null} [".google.api.resourceDefinition"] FileOptions .google.api.resourceDefinition - */ - - /** - * Constructs a new FileOptions. - * @memberof google.protobuf - * @classdesc Represents a FileOptions. - * @implements IFileOptions - * @constructor - * @param {google.protobuf.IFileOptions=} [properties] Properties to set - */ - function FileOptions(properties) { - this.uninterpretedOption = []; - this[".google.api.resourceDefinition"] = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FileOptions javaPackage. - * @member {string} javaPackage - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaPackage = ""; - - /** - * FileOptions javaOuterClassname. - * @member {string} javaOuterClassname - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaOuterClassname = ""; - - /** - * FileOptions javaMultipleFiles. - * @member {boolean} javaMultipleFiles - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaMultipleFiles = false; - - /** - * FileOptions javaGenerateEqualsAndHash. - * @member {boolean} javaGenerateEqualsAndHash - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaGenerateEqualsAndHash = false; - - /** - * FileOptions javaStringCheckUtf8. - * @member {boolean} javaStringCheckUtf8 - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaStringCheckUtf8 = false; - - /** - * FileOptions optimizeFor. - * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.optimizeFor = 1; - - /** - * FileOptions goPackage. - * @member {string} goPackage - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.goPackage = ""; - - /** - * FileOptions ccGenericServices. - * @member {boolean} ccGenericServices - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.ccGenericServices = false; - - /** - * FileOptions javaGenericServices. - * @member {boolean} javaGenericServices - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaGenericServices = false; - - /** - * FileOptions pyGenericServices. - * @member {boolean} pyGenericServices - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.pyGenericServices = false; - - /** - * FileOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.deprecated = false; - - /** - * FileOptions ccEnableArenas. - * @member {boolean} ccEnableArenas - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.ccEnableArenas = true; - - /** - * FileOptions objcClassPrefix. - * @member {string} objcClassPrefix - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.objcClassPrefix = ""; - - /** - * FileOptions csharpNamespace. - * @member {string} csharpNamespace - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.csharpNamespace = ""; - - /** - * FileOptions swiftPrefix. - * @member {string} swiftPrefix - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.swiftPrefix = ""; - - /** - * FileOptions phpClassPrefix. - * @member {string} phpClassPrefix - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.phpClassPrefix = ""; - - /** - * FileOptions phpNamespace. - * @member {string} phpNamespace - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.phpNamespace = ""; - - /** - * FileOptions phpMetadataNamespace. - * @member {string} phpMetadataNamespace - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.phpMetadataNamespace = ""; - - /** - * FileOptions rubyPackage. - * @member {string} rubyPackage - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.rubyPackage = ""; - - /** - * FileOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.features = null; - - /** - * FileOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * FileOptions .google.api.resourceDefinition. - * @member {Array.} .google.api.resourceDefinition - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray; - - /** - * Creates a new FileOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.FileOptions - * @static - * @param {google.protobuf.IFileOptions=} [properties] Properties to set - * @returns {google.protobuf.FileOptions} FileOptions instance - */ - FileOptions.create = function create(properties) { - return new FileOptions(properties); - }; - - /** - * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FileOptions - * @static - * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); - if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); - if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); - if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) - writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); - if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); - if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) - writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); - if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) - writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); - if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) - writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); - if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) - writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); - if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) - writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); - if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) - writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); - if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) - writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); - if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) - writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); - if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) - writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); - if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) - writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); - if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) - writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); - if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) - writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); - if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) - writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.resourceDefinition"] != null && message[".google.api.resourceDefinition"].length) - for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) - $root.google.api.ResourceDescriptor.encode(message[".google.api.resourceDefinition"][i], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FileOptions - * @static - * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FileOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FileOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FileOptions} FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.javaPackage = reader.string(); - break; - } - case 8: { - message.javaOuterClassname = reader.string(); - break; - } - case 10: { - message.javaMultipleFiles = reader.bool(); - break; - } - case 20: { - message.javaGenerateEqualsAndHash = reader.bool(); - break; - } - case 27: { - message.javaStringCheckUtf8 = reader.bool(); - break; - } - case 9: { - message.optimizeFor = reader.int32(); - break; - } - case 11: { - message.goPackage = reader.string(); - break; - } - case 16: { - message.ccGenericServices = reader.bool(); - break; - } - case 17: { - message.javaGenericServices = reader.bool(); - break; - } - case 18: { - message.pyGenericServices = reader.bool(); - break; - } - case 23: { - message.deprecated = reader.bool(); - break; - } - case 31: { - message.ccEnableArenas = reader.bool(); - break; - } - case 36: { - message.objcClassPrefix = reader.string(); - break; - } - case 37: { - message.csharpNamespace = reader.string(); - break; - } - case 39: { - message.swiftPrefix = reader.string(); - break; - } - case 40: { - message.phpClassPrefix = reader.string(); - break; - } - case 41: { - message.phpNamespace = reader.string(); - break; - } - case 44: { - message.phpMetadataNamespace = reader.string(); - break; - } - case 45: { - message.rubyPackage = reader.string(); - break; - } - case 50: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 1053: { - if (!(message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length)) - message[".google.api.resourceDefinition"] = []; - message[".google.api.resourceDefinition"].push($root.google.api.ResourceDescriptor.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FileOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FileOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FileOptions} FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FileOptions message. - * @function verify - * @memberof google.protobuf.FileOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FileOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) - if (!$util.isString(message.javaPackage)) - return "javaPackage: string expected"; - if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) - if (!$util.isString(message.javaOuterClassname)) - return "javaOuterClassname: string expected"; - if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) - if (typeof message.javaMultipleFiles !== "boolean") - return "javaMultipleFiles: boolean expected"; - if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) - if (typeof message.javaGenerateEqualsAndHash !== "boolean") - return "javaGenerateEqualsAndHash: boolean expected"; - if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) - if (typeof message.javaStringCheckUtf8 !== "boolean") - return "javaStringCheckUtf8: boolean expected"; - if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) - switch (message.optimizeFor) { - default: - return "optimizeFor: enum value expected"; - case 1: - case 2: - case 3: - break; - } - if (message.goPackage != null && message.hasOwnProperty("goPackage")) - if (!$util.isString(message.goPackage)) - return "goPackage: string expected"; - if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) - if (typeof message.ccGenericServices !== "boolean") - return "ccGenericServices: boolean expected"; - if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) - if (typeof message.javaGenericServices !== "boolean") - return "javaGenericServices: boolean expected"; - if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) - if (typeof message.pyGenericServices !== "boolean") - return "pyGenericServices: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) - if (typeof message.ccEnableArenas !== "boolean") - return "ccEnableArenas: boolean expected"; - if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) - if (!$util.isString(message.objcClassPrefix)) - return "objcClassPrefix: string expected"; - if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) - if (!$util.isString(message.csharpNamespace)) - return "csharpNamespace: string expected"; - if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) - if (!$util.isString(message.swiftPrefix)) - return "swiftPrefix: string expected"; - if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) - if (!$util.isString(message.phpClassPrefix)) - return "phpClassPrefix: string expected"; - if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) - if (!$util.isString(message.phpNamespace)) - return "phpNamespace: string expected"; - if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) - if (!$util.isString(message.phpMetadataNamespace)) - return "phpMetadataNamespace: string expected"; - if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) - if (!$util.isString(message.rubyPackage)) - return "rubyPackage: string expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".google.api.resourceDefinition"] != null && message.hasOwnProperty(".google.api.resourceDefinition")) { - if (!Array.isArray(message[".google.api.resourceDefinition"])) - return ".google.api.resourceDefinition: array expected"; - for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) { - var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resourceDefinition"][i]); - if (error) - return ".google.api.resourceDefinition." + error; - } - } - return null; - }; - - /** - * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FileOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FileOptions} FileOptions - */ - FileOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FileOptions) - return object; - var message = new $root.google.protobuf.FileOptions(); - if (object.javaPackage != null) - message.javaPackage = String(object.javaPackage); - if (object.javaOuterClassname != null) - message.javaOuterClassname = String(object.javaOuterClassname); - if (object.javaMultipleFiles != null) - message.javaMultipleFiles = Boolean(object.javaMultipleFiles); - if (object.javaGenerateEqualsAndHash != null) - message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash); - if (object.javaStringCheckUtf8 != null) - message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); - switch (object.optimizeFor) { - default: - if (typeof object.optimizeFor === "number") { - message.optimizeFor = object.optimizeFor; - break; - } - break; - case "SPEED": - case 1: - message.optimizeFor = 1; - break; - case "CODE_SIZE": - case 2: - message.optimizeFor = 2; - break; - case "LITE_RUNTIME": - case 3: - message.optimizeFor = 3; - break; - } - if (object.goPackage != null) - message.goPackage = String(object.goPackage); - if (object.ccGenericServices != null) - message.ccGenericServices = Boolean(object.ccGenericServices); - if (object.javaGenericServices != null) - message.javaGenericServices = Boolean(object.javaGenericServices); - if (object.pyGenericServices != null) - message.pyGenericServices = Boolean(object.pyGenericServices); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.ccEnableArenas != null) - message.ccEnableArenas = Boolean(object.ccEnableArenas); - if (object.objcClassPrefix != null) - message.objcClassPrefix = String(object.objcClassPrefix); - if (object.csharpNamespace != null) - message.csharpNamespace = String(object.csharpNamespace); - if (object.swiftPrefix != null) - message.swiftPrefix = String(object.swiftPrefix); - if (object.phpClassPrefix != null) - message.phpClassPrefix = String(object.phpClassPrefix); - if (object.phpNamespace != null) - message.phpNamespace = String(object.phpNamespace); - if (object.phpMetadataNamespace != null) - message.phpMetadataNamespace = String(object.phpMetadataNamespace); - if (object.rubyPackage != null) - message.rubyPackage = String(object.rubyPackage); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.FileOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".google.api.resourceDefinition"]) { - if (!Array.isArray(object[".google.api.resourceDefinition"])) - throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: array expected"); - message[".google.api.resourceDefinition"] = []; - for (var i = 0; i < object[".google.api.resourceDefinition"].length; ++i) { - if (typeof object[".google.api.resourceDefinition"][i] !== "object") - throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: object expected"); - message[".google.api.resourceDefinition"][i] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resourceDefinition"][i]); - } - } - return message; - }; - - /** - * Creates a plain object from a FileOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FileOptions - * @static - * @param {google.protobuf.FileOptions} message FileOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FileOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.uninterpretedOption = []; - object[".google.api.resourceDefinition"] = []; - } - if (options.defaults) { - object.javaPackage = ""; - object.javaOuterClassname = ""; - object.optimizeFor = options.enums === String ? "SPEED" : 1; - object.javaMultipleFiles = false; - object.goPackage = ""; - object.ccGenericServices = false; - object.javaGenericServices = false; - object.pyGenericServices = false; - object.javaGenerateEqualsAndHash = false; - object.deprecated = false; - object.javaStringCheckUtf8 = false; - object.ccEnableArenas = true; - object.objcClassPrefix = ""; - object.csharpNamespace = ""; - object.swiftPrefix = ""; - object.phpClassPrefix = ""; - object.phpNamespace = ""; - object.phpMetadataNamespace = ""; - object.rubyPackage = ""; - object.features = null; - } - if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) - object.javaPackage = message.javaPackage; - if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) - object.javaOuterClassname = message.javaOuterClassname; - if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) - object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] === undefined ? message.optimizeFor : $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; - if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) - object.javaMultipleFiles = message.javaMultipleFiles; - if (message.goPackage != null && message.hasOwnProperty("goPackage")) - object.goPackage = message.goPackage; - if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) - object.ccGenericServices = message.ccGenericServices; - if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) - object.javaGenericServices = message.javaGenericServices; - if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) - object.pyGenericServices = message.pyGenericServices; - if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) - object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) - object.javaStringCheckUtf8 = message.javaStringCheckUtf8; - if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) - object.ccEnableArenas = message.ccEnableArenas; - if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) - object.objcClassPrefix = message.objcClassPrefix; - if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) - object.csharpNamespace = message.csharpNamespace; - if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) - object.swiftPrefix = message.swiftPrefix; - if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) - object.phpClassPrefix = message.phpClassPrefix; - if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) - object.phpNamespace = message.phpNamespace; - if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) - object.phpMetadataNamespace = message.phpMetadataNamespace; - if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) - object.rubyPackage = message.rubyPackage; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length) { - object[".google.api.resourceDefinition"] = []; - for (var j = 0; j < message[".google.api.resourceDefinition"].length; ++j) - object[".google.api.resourceDefinition"][j] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resourceDefinition"][j], options); - } - return object; - }; - - /** - * Converts this FileOptions to JSON. - * @function toJSON - * @memberof google.protobuf.FileOptions - * @instance - * @returns {Object.} JSON object - */ - FileOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FileOptions - * @function getTypeUrl - * @memberof google.protobuf.FileOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FileOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FileOptions"; - }; - - /** - * OptimizeMode enum. - * @name google.protobuf.FileOptions.OptimizeMode - * @enum {number} - * @property {number} SPEED=1 SPEED value - * @property {number} CODE_SIZE=2 CODE_SIZE value - * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value - */ - FileOptions.OptimizeMode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[1] = "SPEED"] = 1; - values[valuesById[2] = "CODE_SIZE"] = 2; - values[valuesById[3] = "LITE_RUNTIME"] = 3; - return values; - })(); - - return FileOptions; - })(); - - protobuf.MessageOptions = (function() { - - /** - * Properties of a MessageOptions. - * @memberof google.protobuf - * @interface IMessageOptions - * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat - * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor - * @property {boolean|null} [deprecated] MessageOptions deprecated - * @property {boolean|null} [mapEntry] MessageOptions mapEntry - * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] MessageOptions deprecatedLegacyJsonFieldConflicts - * @property {google.protobuf.IFeatureSet|null} [features] MessageOptions features - * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption - * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource - */ - - /** - * Constructs a new MessageOptions. - * @memberof google.protobuf - * @classdesc Represents a MessageOptions. - * @implements IMessageOptions - * @constructor - * @param {google.protobuf.IMessageOptions=} [properties] Properties to set - */ - function MessageOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MessageOptions messageSetWireFormat. - * @member {boolean} messageSetWireFormat - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.messageSetWireFormat = false; - - /** - * MessageOptions noStandardDescriptorAccessor. - * @member {boolean} noStandardDescriptorAccessor - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.noStandardDescriptorAccessor = false; - - /** - * MessageOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.deprecated = false; - - /** - * MessageOptions mapEntry. - * @member {boolean} mapEntry - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.mapEntry = false; - - /** - * MessageOptions deprecatedLegacyJsonFieldConflicts. - * @member {boolean} deprecatedLegacyJsonFieldConflicts - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; - - /** - * MessageOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.features = null; - - /** - * MessageOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * MessageOptions .google.api.resource. - * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".google.api.resource"] = null; - - /** - * Creates a new MessageOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.IMessageOptions=} [properties] Properties to set - * @returns {google.protobuf.MessageOptions} MessageOptions instance - */ - MessageOptions.create = function create(properties) { - return new MessageOptions(properties); - }; - - /** - * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MessageOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); - if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) - writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); - if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) - writer.uint32(/* id 11, wireType 0 =*/88).bool(message.deprecatedLegacyJsonFieldConflicts); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.resource"] != null && Object.hasOwnProperty.call(message, ".google.api.resource")) - $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MessageOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.MessageOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.MessageOptions} MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MessageOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.messageSetWireFormat = reader.bool(); - break; - } - case 2: { - message.noStandardDescriptorAccessor = reader.bool(); - break; - } - case 3: { - message.deprecated = reader.bool(); - break; - } - case 7: { - message.mapEntry = reader.bool(); - break; - } - case 11: { - message.deprecatedLegacyJsonFieldConflicts = reader.bool(); - break; - } - case 12: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 1053: { - message[".google.api.resource"] = $root.google.api.ResourceDescriptor.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MessageOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.MessageOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.MessageOptions} MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MessageOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MessageOptions message. - * @function verify - * @memberof google.protobuf.MessageOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MessageOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) - if (typeof message.messageSetWireFormat !== "boolean") - return "messageSetWireFormat: boolean expected"; - if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) - if (typeof message.noStandardDescriptorAccessor !== "boolean") - return "noStandardDescriptorAccessor: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) - if (typeof message.mapEntry !== "boolean") - return "mapEntry: boolean expected"; - if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) - if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") - return "deprecatedLegacyJsonFieldConflicts: boolean expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) { - var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resource"]); - if (error) - return ".google.api.resource." + error; - } - return null; - }; - - /** - * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.MessageOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.MessageOptions} MessageOptions - */ - MessageOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.MessageOptions) - return object; - var message = new $root.google.protobuf.MessageOptions(); - if (object.messageSetWireFormat != null) - message.messageSetWireFormat = Boolean(object.messageSetWireFormat); - if (object.noStandardDescriptorAccessor != null) - message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.mapEntry != null) - message.mapEntry = Boolean(object.mapEntry); - if (object.deprecatedLegacyJsonFieldConflicts != null) - message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.MessageOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".google.api.resource"] != null) { - if (typeof object[".google.api.resource"] !== "object") - throw TypeError(".google.protobuf.MessageOptions..google.api.resource: object expected"); - message[".google.api.resource"] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resource"]); - } - return message; - }; - - /** - * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.MessageOptions} message MessageOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MessageOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) { - object.messageSetWireFormat = false; - object.noStandardDescriptorAccessor = false; - object.deprecated = false; - object.mapEntry = false; - object.deprecatedLegacyJsonFieldConflicts = false; - object.features = null; - object[".google.api.resource"] = null; - } - if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) - object.messageSetWireFormat = message.messageSetWireFormat; - if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) - object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) - object.mapEntry = message.mapEntry; - if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) - object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) - object[".google.api.resource"] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resource"], options); - return object; - }; - - /** - * Converts this MessageOptions to JSON. - * @function toJSON - * @memberof google.protobuf.MessageOptions - * @instance - * @returns {Object.} JSON object - */ - MessageOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MessageOptions - * @function getTypeUrl - * @memberof google.protobuf.MessageOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MessageOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.MessageOptions"; - }; - - return MessageOptions; - })(); - - protobuf.FieldOptions = (function() { - - /** - * Properties of a FieldOptions. - * @memberof google.protobuf - * @interface IFieldOptions - * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype - * @property {boolean|null} [packed] FieldOptions packed - * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype - * @property {boolean|null} [lazy] FieldOptions lazy - * @property {boolean|null} [unverifiedLazy] FieldOptions unverifiedLazy - * @property {boolean|null} [deprecated] FieldOptions deprecated - * @property {boolean|null} [weak] FieldOptions weak - * @property {boolean|null} [debugRedact] FieldOptions debugRedact - * @property {google.protobuf.FieldOptions.OptionRetention|null} [retention] FieldOptions retention - * @property {Array.|null} [targets] FieldOptions targets - * @property {Array.|null} [editionDefaults] FieldOptions editionDefaults - * @property {google.protobuf.IFeatureSet|null} [features] FieldOptions features - * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption - * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior - * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference - */ - - /** - * Constructs a new FieldOptions. - * @memberof google.protobuf - * @classdesc Represents a FieldOptions. - * @implements IFieldOptions - * @constructor - * @param {google.protobuf.IFieldOptions=} [properties] Properties to set - */ - function FieldOptions(properties) { - this.targets = []; - this.editionDefaults = []; - this.uninterpretedOption = []; - this[".google.api.fieldBehavior"] = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FieldOptions ctype. - * @member {google.protobuf.FieldOptions.CType} ctype - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.ctype = 0; - - /** - * FieldOptions packed. - * @member {boolean} packed - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.packed = false; - - /** - * FieldOptions jstype. - * @member {google.protobuf.FieldOptions.JSType} jstype - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.jstype = 0; - - /** - * FieldOptions lazy. - * @member {boolean} lazy - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.lazy = false; - - /** - * FieldOptions unverifiedLazy. - * @member {boolean} unverifiedLazy - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.unverifiedLazy = false; - - /** - * FieldOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.deprecated = false; - - /** - * FieldOptions weak. - * @member {boolean} weak - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.weak = false; - - /** - * FieldOptions debugRedact. - * @member {boolean} debugRedact - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.debugRedact = false; - - /** - * FieldOptions retention. - * @member {google.protobuf.FieldOptions.OptionRetention} retention - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.retention = 0; - - /** - * FieldOptions targets. - * @member {Array.} targets - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.targets = $util.emptyArray; - - /** - * FieldOptions editionDefaults. - * @member {Array.} editionDefaults - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.editionDefaults = $util.emptyArray; - - /** - * FieldOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.features = null; - - /** - * FieldOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * FieldOptions .google.api.fieldBehavior. - * @member {Array.} .google.api.fieldBehavior - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; - - /** - * FieldOptions .google.api.resourceReference. - * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".google.api.resourceReference"] = null; - - /** - * Creates a new FieldOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.IFieldOptions=} [properties] Properties to set - * @returns {google.protobuf.FieldOptions} FieldOptions instance - */ - FieldOptions.create = function create(properties) { - return new FieldOptions(properties); - }; - - /** - * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); - if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); - if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); - if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) - writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); - if (message.unverifiedLazy != null && Object.hasOwnProperty.call(message, "unverifiedLazy")) - writer.uint32(/* id 15, wireType 0 =*/120).bool(message.unverifiedLazy); - if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) - writer.uint32(/* id 16, wireType 0 =*/128).bool(message.debugRedact); - if (message.retention != null && Object.hasOwnProperty.call(message, "retention")) - writer.uint32(/* id 17, wireType 0 =*/136).int32(message.retention); - if (message.targets != null && message.targets.length) - for (var i = 0; i < message.targets.length; ++i) - writer.uint32(/* id 19, wireType 0 =*/152).int32(message.targets[i]); - if (message.editionDefaults != null && message.editionDefaults.length) - for (var i = 0; i < message.editionDefaults.length; ++i) - $root.google.protobuf.FieldOptions.EditionDefault.encode(message.editionDefaults[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) - for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) - writer.uint32(/* id 1052, wireType 0 =*/8416).int32(message[".google.api.fieldBehavior"][i]); - if (message[".google.api.resourceReference"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceReference")) - $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FieldOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FieldOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldOptions} FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.ctype = reader.int32(); - break; - } - case 2: { - message.packed = reader.bool(); - break; - } - case 6: { - message.jstype = reader.int32(); - break; - } - case 5: { - message.lazy = reader.bool(); - break; - } - case 15: { - message.unverifiedLazy = reader.bool(); - break; - } - case 3: { - message.deprecated = reader.bool(); - break; - } - case 10: { - message.weak = reader.bool(); - break; - } - case 16: { - message.debugRedact = reader.bool(); - break; - } - case 17: { - message.retention = reader.int32(); - break; - } - case 19: { - if (!(message.targets && message.targets.length)) - message.targets = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.targets.push(reader.int32()); - } else - message.targets.push(reader.int32()); - break; - } - case 20: { - if (!(message.editionDefaults && message.editionDefaults.length)) - message.editionDefaults = []; - message.editionDefaults.push($root.google.protobuf.FieldOptions.EditionDefault.decode(reader, reader.uint32())); - break; - } - case 21: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 1052: { - if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) - message[".google.api.fieldBehavior"] = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message[".google.api.fieldBehavior"].push(reader.int32()); - } else - message[".google.api.fieldBehavior"].push(reader.int32()); - break; - } - case 1055: { - message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FieldOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FieldOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldOptions} FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FieldOptions message. - * @function verify - * @memberof google.protobuf.FieldOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FieldOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.ctype != null && message.hasOwnProperty("ctype")) - switch (message.ctype) { - default: - return "ctype: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.packed != null && message.hasOwnProperty("packed")) - if (typeof message.packed !== "boolean") - return "packed: boolean expected"; - if (message.jstype != null && message.hasOwnProperty("jstype")) - switch (message.jstype) { - default: - return "jstype: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.lazy != null && message.hasOwnProperty("lazy")) - if (typeof message.lazy !== "boolean") - return "lazy: boolean expected"; - if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) - if (typeof message.unverifiedLazy !== "boolean") - return "unverifiedLazy: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.weak != null && message.hasOwnProperty("weak")) - if (typeof message.weak !== "boolean") - return "weak: boolean expected"; - if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) - if (typeof message.debugRedact !== "boolean") - return "debugRedact: boolean expected"; - if (message.retention != null && message.hasOwnProperty("retention")) - switch (message.retention) { - default: - return "retention: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.targets != null && message.hasOwnProperty("targets")) { - if (!Array.isArray(message.targets)) - return "targets: array expected"; - for (var i = 0; i < message.targets.length; ++i) - switch (message.targets[i]) { - default: - return "targets: enum value[] expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - break; - } - } - if (message.editionDefaults != null && message.hasOwnProperty("editionDefaults")) { - if (!Array.isArray(message.editionDefaults)) - return "editionDefaults: array expected"; - for (var i = 0; i < message.editionDefaults.length; ++i) { - var error = $root.google.protobuf.FieldOptions.EditionDefault.verify(message.editionDefaults[i]); - if (error) - return "editionDefaults." + error; - } - } - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".google.api.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) { - if (!Array.isArray(message[".google.api.fieldBehavior"])) - return ".google.api.fieldBehavior: array expected"; - for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) - switch (message[".google.api.fieldBehavior"][i]) { - default: - return ".google.api.fieldBehavior: enum value[] expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - break; - } - } - if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) { - var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"]); - if (error) - return ".google.api.resourceReference." + error; - } - return null; - }; - - /** - * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FieldOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FieldOptions} FieldOptions - */ - FieldOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldOptions) - return object; - var message = new $root.google.protobuf.FieldOptions(); - switch (object.ctype) { - default: - if (typeof object.ctype === "number") { - message.ctype = object.ctype; - break; - } - break; - case "STRING": - case 0: - message.ctype = 0; - break; - case "CORD": - case 1: - message.ctype = 1; - break; - case "STRING_PIECE": - case 2: - message.ctype = 2; - break; - } - if (object.packed != null) - message.packed = Boolean(object.packed); - switch (object.jstype) { - default: - if (typeof object.jstype === "number") { - message.jstype = object.jstype; - break; - } - break; - case "JS_NORMAL": - case 0: - message.jstype = 0; - break; - case "JS_STRING": - case 1: - message.jstype = 1; - break; - case "JS_NUMBER": - case 2: - message.jstype = 2; - break; - } - if (object.lazy != null) - message.lazy = Boolean(object.lazy); - if (object.unverifiedLazy != null) - message.unverifiedLazy = Boolean(object.unverifiedLazy); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.weak != null) - message.weak = Boolean(object.weak); - if (object.debugRedact != null) - message.debugRedact = Boolean(object.debugRedact); - switch (object.retention) { - default: - if (typeof object.retention === "number") { - message.retention = object.retention; - break; - } - break; - case "RETENTION_UNKNOWN": - case 0: - message.retention = 0; - break; - case "RETENTION_RUNTIME": - case 1: - message.retention = 1; - break; - case "RETENTION_SOURCE": - case 2: - message.retention = 2; - break; - } - if (object.targets) { - if (!Array.isArray(object.targets)) - throw TypeError(".google.protobuf.FieldOptions.targets: array expected"); - message.targets = []; - for (var i = 0; i < object.targets.length; ++i) - switch (object.targets[i]) { - default: - if (typeof object.targets[i] === "number") { - message.targets[i] = object.targets[i]; - break; - } - case "TARGET_TYPE_UNKNOWN": - case 0: - message.targets[i] = 0; - break; - case "TARGET_TYPE_FILE": - case 1: - message.targets[i] = 1; - break; - case "TARGET_TYPE_EXTENSION_RANGE": - case 2: - message.targets[i] = 2; - break; - case "TARGET_TYPE_MESSAGE": - case 3: - message.targets[i] = 3; - break; - case "TARGET_TYPE_FIELD": - case 4: - message.targets[i] = 4; - break; - case "TARGET_TYPE_ONEOF": - case 5: - message.targets[i] = 5; - break; - case "TARGET_TYPE_ENUM": - case 6: - message.targets[i] = 6; - break; - case "TARGET_TYPE_ENUM_ENTRY": - case 7: - message.targets[i] = 7; - break; - case "TARGET_TYPE_SERVICE": - case 8: - message.targets[i] = 8; - break; - case "TARGET_TYPE_METHOD": - case 9: - message.targets[i] = 9; - break; - } - } - if (object.editionDefaults) { - if (!Array.isArray(object.editionDefaults)) - throw TypeError(".google.protobuf.FieldOptions.editionDefaults: array expected"); - message.editionDefaults = []; - for (var i = 0; i < object.editionDefaults.length; ++i) { - if (typeof object.editionDefaults[i] !== "object") - throw TypeError(".google.protobuf.FieldOptions.editionDefaults: object expected"); - message.editionDefaults[i] = $root.google.protobuf.FieldOptions.EditionDefault.fromObject(object.editionDefaults[i]); - } - } - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.FieldOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".google.api.fieldBehavior"]) { - if (!Array.isArray(object[".google.api.fieldBehavior"])) - throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected"); - message[".google.api.fieldBehavior"] = []; - for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i) - switch (object[".google.api.fieldBehavior"][i]) { - default: - if (typeof object[".google.api.fieldBehavior"][i] === "number") { - message[".google.api.fieldBehavior"][i] = object[".google.api.fieldBehavior"][i]; - break; - } - case "FIELD_BEHAVIOR_UNSPECIFIED": - case 0: - message[".google.api.fieldBehavior"][i] = 0; - break; - case "OPTIONAL": - case 1: - message[".google.api.fieldBehavior"][i] = 1; - break; - case "REQUIRED": - case 2: - message[".google.api.fieldBehavior"][i] = 2; - break; - case "OUTPUT_ONLY": - case 3: - message[".google.api.fieldBehavior"][i] = 3; - break; - case "INPUT_ONLY": - case 4: - message[".google.api.fieldBehavior"][i] = 4; - break; - case "IMMUTABLE": - case 5: - message[".google.api.fieldBehavior"][i] = 5; - break; - case "UNORDERED_LIST": - case 6: - message[".google.api.fieldBehavior"][i] = 6; - break; - case "NON_EMPTY_DEFAULT": - case 7: - message[".google.api.fieldBehavior"][i] = 7; - break; - case "IDENTIFIER": - case 8: - message[".google.api.fieldBehavior"][i] = 8; - break; - } - } - if (object[".google.api.resourceReference"] != null) { - if (typeof object[".google.api.resourceReference"] !== "object") - throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected"); - message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"]); - } - return message; - }; - - /** - * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.FieldOptions} message FieldOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FieldOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.targets = []; - object.editionDefaults = []; - object.uninterpretedOption = []; - object[".google.api.fieldBehavior"] = []; - } - if (options.defaults) { - object.ctype = options.enums === String ? "STRING" : 0; - object.packed = false; - object.deprecated = false; - object.lazy = false; - object.jstype = options.enums === String ? "JS_NORMAL" : 0; - object.weak = false; - object.unverifiedLazy = false; - object.debugRedact = false; - object.retention = options.enums === String ? "RETENTION_UNKNOWN" : 0; - object.features = null; - object[".google.api.resourceReference"] = null; - } - if (message.ctype != null && message.hasOwnProperty("ctype")) - object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] === undefined ? message.ctype : $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; - if (message.packed != null && message.hasOwnProperty("packed")) - object.packed = message.packed; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.lazy != null && message.hasOwnProperty("lazy")) - object.lazy = message.lazy; - if (message.jstype != null && message.hasOwnProperty("jstype")) - object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] === undefined ? message.jstype : $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; - if (message.weak != null && message.hasOwnProperty("weak")) - object.weak = message.weak; - if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) - object.unverifiedLazy = message.unverifiedLazy; - if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) - object.debugRedact = message.debugRedact; - if (message.retention != null && message.hasOwnProperty("retention")) - object.retention = options.enums === String ? $root.google.protobuf.FieldOptions.OptionRetention[message.retention] === undefined ? message.retention : $root.google.protobuf.FieldOptions.OptionRetention[message.retention] : message.retention; - if (message.targets && message.targets.length) { - object.targets = []; - for (var j = 0; j < message.targets.length; ++j) - object.targets[j] = options.enums === String ? $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] === undefined ? message.targets[j] : $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] : message.targets[j]; - } - if (message.editionDefaults && message.editionDefaults.length) { - object.editionDefaults = []; - for (var j = 0; j < message.editionDefaults.length; ++j) - object.editionDefaults[j] = $root.google.protobuf.FieldOptions.EditionDefault.toObject(message.editionDefaults[j], options); - } - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length) { - object[".google.api.fieldBehavior"] = []; - for (var j = 0; j < message[".google.api.fieldBehavior"].length; ++j) - object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] === undefined ? message[".google.api.fieldBehavior"][j] : $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; - } - if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) - object[".google.api.resourceReference"] = $root.google.api.ResourceReference.toObject(message[".google.api.resourceReference"], options); - return object; - }; - - /** - * Converts this FieldOptions to JSON. - * @function toJSON - * @memberof google.protobuf.FieldOptions - * @instance - * @returns {Object.} JSON object - */ - FieldOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FieldOptions - * @function getTypeUrl - * @memberof google.protobuf.FieldOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FieldOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FieldOptions"; - }; - - /** - * CType enum. - * @name google.protobuf.FieldOptions.CType - * @enum {number} - * @property {number} STRING=0 STRING value - * @property {number} CORD=1 CORD value - * @property {number} STRING_PIECE=2 STRING_PIECE value - */ - FieldOptions.CType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STRING"] = 0; - values[valuesById[1] = "CORD"] = 1; - values[valuesById[2] = "STRING_PIECE"] = 2; - return values; - })(); - - /** - * JSType enum. - * @name google.protobuf.FieldOptions.JSType - * @enum {number} - * @property {number} JS_NORMAL=0 JS_NORMAL value - * @property {number} JS_STRING=1 JS_STRING value - * @property {number} JS_NUMBER=2 JS_NUMBER value - */ - FieldOptions.JSType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "JS_NORMAL"] = 0; - values[valuesById[1] = "JS_STRING"] = 1; - values[valuesById[2] = "JS_NUMBER"] = 2; - return values; - })(); - - /** - * OptionRetention enum. - * @name google.protobuf.FieldOptions.OptionRetention - * @enum {number} - * @property {number} RETENTION_UNKNOWN=0 RETENTION_UNKNOWN value - * @property {number} RETENTION_RUNTIME=1 RETENTION_RUNTIME value - * @property {number} RETENTION_SOURCE=2 RETENTION_SOURCE value - */ - FieldOptions.OptionRetention = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "RETENTION_UNKNOWN"] = 0; - values[valuesById[1] = "RETENTION_RUNTIME"] = 1; - values[valuesById[2] = "RETENTION_SOURCE"] = 2; - return values; - })(); - - /** - * OptionTargetType enum. - * @name google.protobuf.FieldOptions.OptionTargetType - * @enum {number} - * @property {number} TARGET_TYPE_UNKNOWN=0 TARGET_TYPE_UNKNOWN value - * @property {number} TARGET_TYPE_FILE=1 TARGET_TYPE_FILE value - * @property {number} TARGET_TYPE_EXTENSION_RANGE=2 TARGET_TYPE_EXTENSION_RANGE value - * @property {number} TARGET_TYPE_MESSAGE=3 TARGET_TYPE_MESSAGE value - * @property {number} TARGET_TYPE_FIELD=4 TARGET_TYPE_FIELD value - * @property {number} TARGET_TYPE_ONEOF=5 TARGET_TYPE_ONEOF value - * @property {number} TARGET_TYPE_ENUM=6 TARGET_TYPE_ENUM value - * @property {number} TARGET_TYPE_ENUM_ENTRY=7 TARGET_TYPE_ENUM_ENTRY value - * @property {number} TARGET_TYPE_SERVICE=8 TARGET_TYPE_SERVICE value - * @property {number} TARGET_TYPE_METHOD=9 TARGET_TYPE_METHOD value - */ - FieldOptions.OptionTargetType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TARGET_TYPE_UNKNOWN"] = 0; - values[valuesById[1] = "TARGET_TYPE_FILE"] = 1; - values[valuesById[2] = "TARGET_TYPE_EXTENSION_RANGE"] = 2; - values[valuesById[3] = "TARGET_TYPE_MESSAGE"] = 3; - values[valuesById[4] = "TARGET_TYPE_FIELD"] = 4; - values[valuesById[5] = "TARGET_TYPE_ONEOF"] = 5; - values[valuesById[6] = "TARGET_TYPE_ENUM"] = 6; - values[valuesById[7] = "TARGET_TYPE_ENUM_ENTRY"] = 7; - values[valuesById[8] = "TARGET_TYPE_SERVICE"] = 8; - values[valuesById[9] = "TARGET_TYPE_METHOD"] = 9; - return values; - })(); - - FieldOptions.EditionDefault = (function() { - - /** - * Properties of an EditionDefault. - * @memberof google.protobuf.FieldOptions - * @interface IEditionDefault - * @property {google.protobuf.Edition|null} [edition] EditionDefault edition - * @property {string|null} [value] EditionDefault value - */ - - /** - * Constructs a new EditionDefault. - * @memberof google.protobuf.FieldOptions - * @classdesc Represents an EditionDefault. - * @implements IEditionDefault - * @constructor - * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set - */ - function EditionDefault(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EditionDefault edition. - * @member {google.protobuf.Edition} edition - * @memberof google.protobuf.FieldOptions.EditionDefault - * @instance - */ - EditionDefault.prototype.edition = 0; - - /** - * EditionDefault value. - * @member {string} value - * @memberof google.protobuf.FieldOptions.EditionDefault - * @instance - */ - EditionDefault.prototype.value = ""; - - /** - * Creates a new EditionDefault instance using the specified properties. - * @function create - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set - * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault instance - */ - EditionDefault.create = function create(properties) { - return new EditionDefault(properties); - }; - - /** - * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EditionDefault.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); - if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); - return writer; - }; - - /** - * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EditionDefault.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EditionDefault message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EditionDefault.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions.EditionDefault(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 3: { - message.edition = reader.int32(); - break; - } - case 2: { - message.value = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EditionDefault message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EditionDefault.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EditionDefault message. - * @function verify - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EditionDefault.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.edition != null && message.hasOwnProperty("edition")) - switch (message.edition) { - default: - return "edition: enum value expected"; - case 0: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isString(message.value)) - return "value: string expected"; - return null; - }; - - /** - * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault - */ - EditionDefault.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldOptions.EditionDefault) - return object; - var message = new $root.google.protobuf.FieldOptions.EditionDefault(); - switch (object.edition) { - default: - if (typeof object.edition === "number") { - message.edition = object.edition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.edition = 0; - break; - case "EDITION_PROTO2": - case 998: - message.edition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.edition = 999; - break; - case "EDITION_2023": - case 1000: - message.edition = 1000; - break; - case "EDITION_2024": - case 1001: - message.edition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.edition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.edition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.edition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.edition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.edition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.edition = 2147483647; - break; - } - if (object.value != null) - message.value = String(object.value); - return message; - }; - - /** - * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {google.protobuf.FieldOptions.EditionDefault} message EditionDefault - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EditionDefault.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.value = ""; - object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; - } - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - if (message.edition != null && message.hasOwnProperty("edition")) - object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; - return object; - }; - - /** - * Converts this EditionDefault to JSON. - * @function toJSON - * @memberof google.protobuf.FieldOptions.EditionDefault - * @instance - * @returns {Object.} JSON object - */ - EditionDefault.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EditionDefault - * @function getTypeUrl - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FieldOptions.EditionDefault"; - }; - - return EditionDefault; - })(); - - return FieldOptions; - })(); - - protobuf.OneofOptions = (function() { - - /** - * Properties of an OneofOptions. - * @memberof google.protobuf - * @interface IOneofOptions - * @property {google.protobuf.IFeatureSet|null} [features] OneofOptions features - * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption - */ - - /** - * Constructs a new OneofOptions. - * @memberof google.protobuf - * @classdesc Represents an OneofOptions. - * @implements IOneofOptions - * @constructor - * @param {google.protobuf.IOneofOptions=} [properties] Properties to set - */ - function OneofOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * OneofOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.OneofOptions - * @instance - */ - OneofOptions.prototype.features = null; - - /** - * OneofOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.OneofOptions - * @instance - */ - OneofOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * Creates a new OneofOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.IOneofOptions=} [properties] Properties to set - * @returns {google.protobuf.OneofOptions} OneofOptions instance - */ - OneofOptions.create = function create(properties) { - return new OneofOptions(properties); - }; - - /** - * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OneofOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.OneofOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.OneofOptions} OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OneofOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.OneofOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.OneofOptions} OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OneofOptions message. - * @function verify - * @memberof google.protobuf.OneofOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OneofOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - return null; - }; - - /** - * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.OneofOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.OneofOptions} OneofOptions - */ - OneofOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.OneofOptions) - return object; - var message = new $root.google.protobuf.OneofOptions(); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.OneofOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.OneofOptions} message OneofOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OneofOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) - object.features = null; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; - - /** - * Converts this OneofOptions to JSON. - * @function toJSON - * @memberof google.protobuf.OneofOptions - * @instance - * @returns {Object.} JSON object - */ - OneofOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OneofOptions - * @function getTypeUrl - * @memberof google.protobuf.OneofOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OneofOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.OneofOptions"; - }; - - return OneofOptions; - })(); - - protobuf.EnumOptions = (function() { - - /** - * Properties of an EnumOptions. - * @memberof google.protobuf - * @interface IEnumOptions - * @property {boolean|null} [allowAlias] EnumOptions allowAlias - * @property {boolean|null} [deprecated] EnumOptions deprecated - * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] EnumOptions deprecatedLegacyJsonFieldConflicts - * @property {google.protobuf.IFeatureSet|null} [features] EnumOptions features - * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption - */ - - /** - * Constructs a new EnumOptions. - * @memberof google.protobuf - * @classdesc Represents an EnumOptions. - * @implements IEnumOptions - * @constructor - * @param {google.protobuf.IEnumOptions=} [properties] Properties to set - */ - function EnumOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumOptions allowAlias. - * @member {boolean} allowAlias - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.allowAlias = false; - - /** - * EnumOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.deprecated = false; - - /** - * EnumOptions deprecatedLegacyJsonFieldConflicts. - * @member {boolean} deprecatedLegacyJsonFieldConflicts - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; - - /** - * EnumOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.features = null; - - /** - * EnumOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * Creates a new EnumOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.IEnumOptions=} [properties] Properties to set - * @returns {google.protobuf.EnumOptions} EnumOptions instance - */ - EnumOptions.create = function create(properties) { - return new EnumOptions(properties); - }; - - /** - * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.deprecatedLegacyJsonFieldConflicts); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumOptions} EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - message.allowAlias = reader.bool(); - break; - } - case 3: { - message.deprecated = reader.bool(); - break; - } - case 6: { - message.deprecatedLegacyJsonFieldConflicts = reader.bool(); - break; - } - case 7: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumOptions} EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumOptions message. - * @function verify - * @memberof google.protobuf.EnumOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) - if (typeof message.allowAlias !== "boolean") - return "allowAlias: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) - if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") - return "deprecatedLegacyJsonFieldConflicts: boolean expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - return null; - }; - - /** - * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumOptions} EnumOptions - */ - EnumOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumOptions) - return object; - var message = new $root.google.protobuf.EnumOptions(); - if (object.allowAlias != null) - message.allowAlias = Boolean(object.allowAlias); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.deprecatedLegacyJsonFieldConflicts != null) - message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.EnumOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.EnumOptions} message EnumOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) { - object.allowAlias = false; - object.deprecated = false; - object.deprecatedLegacyJsonFieldConflicts = false; - object.features = null; - } - if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) - object.allowAlias = message.allowAlias; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) - object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; - - /** - * Converts this EnumOptions to JSON. - * @function toJSON - * @memberof google.protobuf.EnumOptions - * @instance - * @returns {Object.} JSON object - */ - EnumOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumOptions - * @function getTypeUrl - * @memberof google.protobuf.EnumOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumOptions"; - }; - - return EnumOptions; - })(); - - protobuf.EnumValueOptions = (function() { - - /** - * Properties of an EnumValueOptions. - * @memberof google.protobuf - * @interface IEnumValueOptions - * @property {boolean|null} [deprecated] EnumValueOptions deprecated - * @property {google.protobuf.IFeatureSet|null} [features] EnumValueOptions features - * @property {boolean|null} [debugRedact] EnumValueOptions debugRedact - * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption - */ - - /** - * Constructs a new EnumValueOptions. - * @memberof google.protobuf - * @classdesc Represents an EnumValueOptions. - * @implements IEnumValueOptions - * @constructor - * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set - */ - function EnumValueOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumValueOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.deprecated = false; - - /** - * EnumValueOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.features = null; - - /** - * EnumValueOptions debugRedact. - * @member {boolean} debugRedact - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.debugRedact = false; - - /** - * EnumValueOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * Creates a new EnumValueOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance - */ - EnumValueOptions.create = function create(properties) { - return new EnumValueOptions(properties); - }; - - /** - * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.debugRedact); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumValueOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.deprecated = reader.bool(); - break; - } - case 2: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 3: { - message.debugRedact = reader.bool(); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumValueOptions message. - * @function verify - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumValueOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) - if (typeof message.debugRedact !== "boolean") - return "debugRedact: boolean expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - return null; - }; - - /** - * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions - */ - EnumValueOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumValueOptions) - return object; - var message = new $root.google.protobuf.EnumValueOptions(); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.EnumValueOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.debugRedact != null) - message.debugRedact = Boolean(object.debugRedact); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.EnumValueOptions} message EnumValueOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumValueOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) { - object.deprecated = false; - object.features = null; - object.debugRedact = false; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) - object.debugRedact = message.debugRedact; - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; - - /** - * Converts this EnumValueOptions to JSON. - * @function toJSON - * @memberof google.protobuf.EnumValueOptions - * @instance - * @returns {Object.} JSON object - */ - EnumValueOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumValueOptions - * @function getTypeUrl - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumValueOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumValueOptions"; - }; - - return EnumValueOptions; - })(); - - protobuf.ServiceOptions = (function() { - - /** - * Properties of a ServiceOptions. - * @memberof google.protobuf - * @interface IServiceOptions - * @property {google.protobuf.IFeatureSet|null} [features] ServiceOptions features - * @property {boolean|null} [deprecated] ServiceOptions deprecated - * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption - * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost - * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes - * @property {string|null} [".google.api.apiVersion"] ServiceOptions .google.api.apiVersion - */ - - /** - * Constructs a new ServiceOptions. - * @memberof google.protobuf - * @classdesc Represents a ServiceOptions. - * @implements IServiceOptions - * @constructor - * @param {google.protobuf.IServiceOptions=} [properties] Properties to set - */ - function ServiceOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ServiceOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype.features = null; - - /** - * ServiceOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype.deprecated = false; - - /** - * ServiceOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * ServiceOptions .google.api.defaultHost. - * @member {string} .google.api.defaultHost - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype[".google.api.defaultHost"] = ""; - - /** - * ServiceOptions .google.api.oauthScopes. - * @member {string} .google.api.oauthScopes - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype[".google.api.oauthScopes"] = ""; - - /** - * ServiceOptions .google.api.apiVersion. - * @member {string} .google.api.apiVersion - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype[".google.api.apiVersion"] = ""; - - /** - * Creates a new ServiceOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.IServiceOptions=} [properties] Properties to set - * @returns {google.protobuf.ServiceOptions} ServiceOptions instance - */ - ServiceOptions.create = function create(properties) { - return new ServiceOptions(properties); - }; - - /** - * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 34, wireType 2 =*/274).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) - writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); - if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) - writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); - if (message[".google.api.apiVersion"] != null && Object.hasOwnProperty.call(message, ".google.api.apiVersion")) - writer.uint32(/* id 525000001, wireType 2 =*/4200000010).string(message[".google.api.apiVersion"]); - return writer; - }; - - /** - * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ServiceOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ServiceOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ServiceOptions} ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 34: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 33: { - message.deprecated = reader.bool(); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 1049: { - message[".google.api.defaultHost"] = reader.string(); - break; - } - case 1050: { - message[".google.api.oauthScopes"] = reader.string(); - break; - } - case 525000001: { - message[".google.api.apiVersion"] = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ServiceOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ServiceOptions} ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ServiceOptions message. - * @function verify - * @memberof google.protobuf.ServiceOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ServiceOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) - if (!$util.isString(message[".google.api.defaultHost"])) - return ".google.api.defaultHost: string expected"; - if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) - if (!$util.isString(message[".google.api.oauthScopes"])) - return ".google.api.oauthScopes: string expected"; - if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) - if (!$util.isString(message[".google.api.apiVersion"])) - return ".google.api.apiVersion: string expected"; - return null; - }; - - /** - * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ServiceOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ServiceOptions} ServiceOptions - */ - ServiceOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ServiceOptions) - return object; - var message = new $root.google.protobuf.ServiceOptions(); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.ServiceOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".google.api.defaultHost"] != null) - message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); - if (object[".google.api.oauthScopes"] != null) - message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); - if (object[".google.api.apiVersion"] != null) - message[".google.api.apiVersion"] = String(object[".google.api.apiVersion"]); - return message; - }; - - /** - * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.ServiceOptions} message ServiceOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ServiceOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) { - object.deprecated = false; - object.features = null; - object[".google.api.defaultHost"] = ""; - object[".google.api.oauthScopes"] = ""; - object[".google.api.apiVersion"] = ""; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) - object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; - if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) - object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; - if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) - object[".google.api.apiVersion"] = message[".google.api.apiVersion"]; - return object; - }; - - /** - * Converts this ServiceOptions to JSON. - * @function toJSON - * @memberof google.protobuf.ServiceOptions - * @instance - * @returns {Object.} JSON object - */ - ServiceOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ServiceOptions - * @function getTypeUrl - * @memberof google.protobuf.ServiceOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.ServiceOptions"; - }; - - return ServiceOptions; - })(); - - protobuf.MethodOptions = (function() { - - /** - * Properties of a MethodOptions. - * @memberof google.protobuf - * @interface IMethodOptions - * @property {boolean|null} [deprecated] MethodOptions deprecated - * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel - * @property {google.protobuf.IFeatureSet|null} [features] MethodOptions features - * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption - * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http - * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature - * @property {google.longrunning.IOperationInfo|null} [".google.longrunning.operationInfo"] MethodOptions .google.longrunning.operationInfo - */ - - /** - * Constructs a new MethodOptions. - * @memberof google.protobuf - * @classdesc Represents a MethodOptions. - * @implements IMethodOptions - * @constructor - * @param {google.protobuf.IMethodOptions=} [properties] Properties to set - */ - function MethodOptions(properties) { - this.uninterpretedOption = []; - this[".google.api.methodSignature"] = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MethodOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype.deprecated = false; - - /** - * MethodOptions idempotencyLevel. - * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype.idempotencyLevel = 0; - - /** - * MethodOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype.features = null; - - /** - * MethodOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * MethodOptions .google.api.http. - * @member {google.api.IHttpRule|null|undefined} .google.api.http - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype[".google.api.http"] = null; - - /** - * MethodOptions .google.api.methodSignature. - * @member {Array.} .google.api.methodSignature - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; - - /** - * MethodOptions .google.longrunning.operationInfo. - * @member {google.longrunning.IOperationInfo|null|undefined} .google.longrunning.operationInfo - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype[".google.longrunning.operationInfo"] = null; - - /** - * Creates a new MethodOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.MethodOptions - * @static - * @param {google.protobuf.IMethodOptions=} [properties] Properties to set - * @returns {google.protobuf.MethodOptions} MethodOptions instance - */ - MethodOptions.create = function create(properties) { - return new MethodOptions(properties); - }; - - /** - * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.MethodOptions - * @static - * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); - if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel")) - writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 35, wireType 2 =*/282).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.longrunning.operationInfo"] != null && Object.hasOwnProperty.call(message, ".google.longrunning.operationInfo")) - $root.google.longrunning.OperationInfo.encode(message[".google.longrunning.operationInfo"], writer.uint32(/* id 1049, wireType 2 =*/8394).fork()).ldelim(); - if (message[".google.api.methodSignature"] != null && message[".google.api.methodSignature"].length) - for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) - writer.uint32(/* id 1051, wireType 2 =*/8410).string(message[".google.api.methodSignature"][i]); - if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http")) - $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.MethodOptions - * @static - * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MethodOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.MethodOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.MethodOptions} MethodOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 33: { - message.deprecated = reader.bool(); - break; - } - case 34: { - message.idempotencyLevel = reader.int32(); - break; - } - case 35: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 72295728: { - message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); - break; - } - case 1051: { - if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) - message[".google.api.methodSignature"] = []; - message[".google.api.methodSignature"].push(reader.string()); - break; - } - case 1049: { - message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MethodOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.MethodOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.MethodOptions} MethodOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MethodOptions message. - * @function verify - * @memberof google.protobuf.MethodOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MethodOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) - switch (message.idempotencyLevel) { - default: - return "idempotencyLevel: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) { - var error = $root.google.api.HttpRule.verify(message[".google.api.http"]); - if (error) - return ".google.api.http." + error; - } - if (message[".google.api.methodSignature"] != null && message.hasOwnProperty(".google.api.methodSignature")) { - if (!Array.isArray(message[".google.api.methodSignature"])) - return ".google.api.methodSignature: array expected"; - for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) - if (!$util.isString(message[".google.api.methodSignature"][i])) - return ".google.api.methodSignature: string[] expected"; - } - if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) { - var error = $root.google.longrunning.OperationInfo.verify(message[".google.longrunning.operationInfo"]); - if (error) - return ".google.longrunning.operationInfo." + error; - } - return null; - }; - - /** - * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.MethodOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.MethodOptions} MethodOptions - */ - MethodOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.MethodOptions) - return object; - var message = new $root.google.protobuf.MethodOptions(); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - switch (object.idempotencyLevel) { - default: - if (typeof object.idempotencyLevel === "number") { - message.idempotencyLevel = object.idempotencyLevel; - break; - } - break; - case "IDEMPOTENCY_UNKNOWN": - case 0: - message.idempotencyLevel = 0; - break; - case "NO_SIDE_EFFECTS": - case 1: - message.idempotencyLevel = 1; - break; - case "IDEMPOTENT": - case 2: - message.idempotencyLevel = 2; - break; - } - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.MethodOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".google.api.http"] != null) { - if (typeof object[".google.api.http"] !== "object") - throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected"); - message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"]); - } - if (object[".google.api.methodSignature"]) { - if (!Array.isArray(object[".google.api.methodSignature"])) - throw TypeError(".google.protobuf.MethodOptions..google.api.methodSignature: array expected"); - message[".google.api.methodSignature"] = []; - for (var i = 0; i < object[".google.api.methodSignature"].length; ++i) - message[".google.api.methodSignature"][i] = String(object[".google.api.methodSignature"][i]); - } - if (object[".google.longrunning.operationInfo"] != null) { - if (typeof object[".google.longrunning.operationInfo"] !== "object") - throw TypeError(".google.protobuf.MethodOptions..google.longrunning.operationInfo: object expected"); - message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.fromObject(object[".google.longrunning.operationInfo"]); - } - return message; - }; - - /** - * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.MethodOptions - * @static - * @param {google.protobuf.MethodOptions} message MethodOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MethodOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.uninterpretedOption = []; - object[".google.api.methodSignature"] = []; - } - if (options.defaults) { - object.deprecated = false; - object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0; - object.features = null; - object[".google.longrunning.operationInfo"] = null; - object[".google.api.http"] = null; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) - object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] === undefined ? message.idempotencyLevel : $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) - object[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.toObject(message[".google.longrunning.operationInfo"], options); - if (message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length) { - object[".google.api.methodSignature"] = []; - for (var j = 0; j < message[".google.api.methodSignature"].length; ++j) - object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j]; - } - if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) - object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); - return object; - }; - - /** - * Converts this MethodOptions to JSON. - * @function toJSON - * @memberof google.protobuf.MethodOptions - * @instance - * @returns {Object.} JSON object - */ - MethodOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MethodOptions - * @function getTypeUrl - * @memberof google.protobuf.MethodOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MethodOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.MethodOptions"; - }; - - /** - * IdempotencyLevel enum. - * @name google.protobuf.MethodOptions.IdempotencyLevel - * @enum {number} - * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value - * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value - * @property {number} IDEMPOTENT=2 IDEMPOTENT value - */ - MethodOptions.IdempotencyLevel = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0; - values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1; - values[valuesById[2] = "IDEMPOTENT"] = 2; - return values; - })(); - - return MethodOptions; - })(); - - protobuf.UninterpretedOption = (function() { - - /** - * Properties of an UninterpretedOption. - * @memberof google.protobuf - * @interface IUninterpretedOption - * @property {Array.|null} [name] UninterpretedOption name - * @property {string|null} [identifierValue] UninterpretedOption identifierValue - * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue - * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue - * @property {number|null} [doubleValue] UninterpretedOption doubleValue - * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue - * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue - */ - - /** - * Constructs a new UninterpretedOption. - * @memberof google.protobuf - * @classdesc Represents an UninterpretedOption. - * @implements IUninterpretedOption - * @constructor - * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set - */ - function UninterpretedOption(properties) { - this.name = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UninterpretedOption name. - * @member {Array.} name - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.name = $util.emptyArray; - - /** - * UninterpretedOption identifierValue. - * @member {string} identifierValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.identifierValue = ""; - - /** - * UninterpretedOption positiveIntValue. - * @member {number|Long} positiveIntValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * UninterpretedOption negativeIntValue. - * @member {number|Long} negativeIntValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * UninterpretedOption doubleValue. - * @member {number} doubleValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.doubleValue = 0; - - /** - * UninterpretedOption stringValue. - * @member {Uint8Array} stringValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.stringValue = $util.newBuffer([]); - - /** - * UninterpretedOption aggregateValue. - * @member {string} aggregateValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.aggregateValue = ""; - - /** - * Creates a new UninterpretedOption instance using the specified properties. - * @function create - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance - */ - UninterpretedOption.create = function create(properties) { - return new UninterpretedOption(properties); - }; - - /** - * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @function encode - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UninterpretedOption.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && message.name.length) - for (var i = 0; i < message.name.length; ++i) - $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); - if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) - writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); - if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) - writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); - if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) - writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); - if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) - writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); - if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); - return writer; - }; - - /** - * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UninterpretedOption.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - if (!(message.name && message.name.length)) - message.name = []; - message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); - break; - } - case 3: { - message.identifierValue = reader.string(); - break; - } - case 4: { - message.positiveIntValue = reader.uint64(); - break; - } - case 5: { - message.negativeIntValue = reader.int64(); - break; - } - case 6: { - message.doubleValue = reader.double(); - break; - } - case 7: { - message.stringValue = reader.bytes(); - break; - } - case 8: { - message.aggregateValue = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UninterpretedOption message. - * @function verify - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UninterpretedOption.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) { - if (!Array.isArray(message.name)) - return "name: array expected"; - for (var i = 0; i < message.name.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]); - if (error) - return "name." + error; - } - } - if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) - if (!$util.isString(message.identifierValue)) - return "identifierValue: string expected"; - if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) - if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high))) - return "positiveIntValue: integer|Long expected"; - if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) - if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high))) - return "negativeIntValue: integer|Long expected"; - if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) - if (typeof message.doubleValue !== "number") - return "doubleValue: number expected"; - if (message.stringValue != null && message.hasOwnProperty("stringValue")) - if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue))) - return "stringValue: buffer expected"; - if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) - if (!$util.isString(message.aggregateValue)) - return "aggregateValue: string expected"; - return null; - }; - - /** - * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption - */ - UninterpretedOption.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.UninterpretedOption) - return object; - var message = new $root.google.protobuf.UninterpretedOption(); - if (object.name) { - if (!Array.isArray(object.name)) - throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); - message.name = []; - for (var i = 0; i < object.name.length; ++i) { - if (typeof object.name[i] !== "object") - throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); - message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); - } - } - if (object.identifierValue != null) - message.identifierValue = String(object.identifierValue); - if (object.positiveIntValue != null) - if ($util.Long) - (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; - else if (typeof object.positiveIntValue === "string") - message.positiveIntValue = parseInt(object.positiveIntValue, 10); - else if (typeof object.positiveIntValue === "number") - message.positiveIntValue = object.positiveIntValue; - else if (typeof object.positiveIntValue === "object") - message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); - if (object.negativeIntValue != null) - if ($util.Long) - (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false; - else if (typeof object.negativeIntValue === "string") - message.negativeIntValue = parseInt(object.negativeIntValue, 10); - else if (typeof object.negativeIntValue === "number") - message.negativeIntValue = object.negativeIntValue; - else if (typeof object.negativeIntValue === "object") - message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); - if (object.doubleValue != null) - message.doubleValue = Number(object.doubleValue); - if (object.stringValue != null) - if (typeof object.stringValue === "string") - $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); - else if (object.stringValue.length >= 0) - message.stringValue = object.stringValue; - if (object.aggregateValue != null) - message.aggregateValue = String(object.aggregateValue); - return message; - }; - - /** - * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.UninterpretedOption} message UninterpretedOption - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UninterpretedOption.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.name = []; - if (options.defaults) { - object.identifierValue = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.positiveIntValue = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.negativeIntValue = options.longs === String ? "0" : 0; - object.doubleValue = 0; - if (options.bytes === String) - object.stringValue = ""; - else { - object.stringValue = []; - if (options.bytes !== Array) - object.stringValue = $util.newBuffer(object.stringValue); - } - object.aggregateValue = ""; - } - if (message.name && message.name.length) { - object.name = []; - for (var j = 0; j < message.name.length; ++j) - object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); - } - if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) - object.identifierValue = message.identifierValue; - if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) - if (typeof message.positiveIntValue === "number") - object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue; - else - object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue; - if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) - if (typeof message.negativeIntValue === "number") - object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue; - else - object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue; - if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) - object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; - if (message.stringValue != null && message.hasOwnProperty("stringValue")) - object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue; - if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) - object.aggregateValue = message.aggregateValue; - return object; - }; - - /** - * Converts this UninterpretedOption to JSON. - * @function toJSON - * @memberof google.protobuf.UninterpretedOption - * @instance - * @returns {Object.} JSON object - */ - UninterpretedOption.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UninterpretedOption - * @function getTypeUrl - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UninterpretedOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.UninterpretedOption"; - }; - - UninterpretedOption.NamePart = (function() { - - /** - * Properties of a NamePart. - * @memberof google.protobuf.UninterpretedOption - * @interface INamePart - * @property {string} namePart NamePart namePart - * @property {boolean} isExtension NamePart isExtension - */ - - /** - * Constructs a new NamePart. - * @memberof google.protobuf.UninterpretedOption - * @classdesc Represents a NamePart. - * @implements INamePart - * @constructor - * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set - */ - function NamePart(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * NamePart namePart. - * @member {string} namePart - * @memberof google.protobuf.UninterpretedOption.NamePart - * @instance - */ - NamePart.prototype.namePart = ""; - - /** - * NamePart isExtension. - * @member {boolean} isExtension - * @memberof google.protobuf.UninterpretedOption.NamePart - * @instance - */ - NamePart.prototype.isExtension = false; - - /** - * Creates a new NamePart instance using the specified properties. - * @function create - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance - */ - NamePart.create = function create(properties) { - return new NamePart(properties); - }; - - /** - * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @function encode - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NamePart.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart); - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension); - return writer; - }; - - /** - * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NamePart.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a NamePart message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NamePart.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.namePart = reader.string(); - break; - } - case 2: { - message.isExtension = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - if (!message.hasOwnProperty("namePart")) - throw $util.ProtocolError("missing required 'namePart'", { instance: message }); - if (!message.hasOwnProperty("isExtension")) - throw $util.ProtocolError("missing required 'isExtension'", { instance: message }); - return message; - }; - - /** - * Decodes a NamePart message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NamePart.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a NamePart message. - * @function verify - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - NamePart.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (!$util.isString(message.namePart)) - return "namePart: string expected"; - if (typeof message.isExtension !== "boolean") - return "isExtension: boolean expected"; - return null; - }; - - /** - * Creates a NamePart message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart - */ - NamePart.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) - return object; - var message = new $root.google.protobuf.UninterpretedOption.NamePart(); - if (object.namePart != null) - message.namePart = String(object.namePart); - if (object.isExtension != null) - message.isExtension = Boolean(object.isExtension); - return message; - }; - - /** - * Creates a plain object from a NamePart message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - NamePart.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.namePart = ""; - object.isExtension = false; - } - if (message.namePart != null && message.hasOwnProperty("namePart")) - object.namePart = message.namePart; - if (message.isExtension != null && message.hasOwnProperty("isExtension")) - object.isExtension = message.isExtension; - return object; - }; - - /** - * Converts this NamePart to JSON. - * @function toJSON - * @memberof google.protobuf.UninterpretedOption.NamePart - * @instance - * @returns {Object.} JSON object - */ - NamePart.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for NamePart - * @function getTypeUrl - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - NamePart.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.UninterpretedOption.NamePart"; - }; - - return NamePart; - })(); - - return UninterpretedOption; - })(); - - protobuf.FeatureSet = (function() { - - /** - * Properties of a FeatureSet. - * @memberof google.protobuf - * @interface IFeatureSet - * @property {google.protobuf.FeatureSet.FieldPresence|null} [fieldPresence] FeatureSet fieldPresence - * @property {google.protobuf.FeatureSet.EnumType|null} [enumType] FeatureSet enumType - * @property {google.protobuf.FeatureSet.RepeatedFieldEncoding|null} [repeatedFieldEncoding] FeatureSet repeatedFieldEncoding - * @property {google.protobuf.FeatureSet.Utf8Validation|null} [utf8Validation] FeatureSet utf8Validation - * @property {google.protobuf.FeatureSet.MessageEncoding|null} [messageEncoding] FeatureSet messageEncoding - * @property {google.protobuf.FeatureSet.JsonFormat|null} [jsonFormat] FeatureSet jsonFormat - */ - - /** - * Constructs a new FeatureSet. - * @memberof google.protobuf - * @classdesc Represents a FeatureSet. - * @implements IFeatureSet - * @constructor - * @param {google.protobuf.IFeatureSet=} [properties] Properties to set - */ - function FeatureSet(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FeatureSet fieldPresence. - * @member {google.protobuf.FeatureSet.FieldPresence} fieldPresence - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.fieldPresence = 0; - - /** - * FeatureSet enumType. - * @member {google.protobuf.FeatureSet.EnumType} enumType - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.enumType = 0; - - /** - * FeatureSet repeatedFieldEncoding. - * @member {google.protobuf.FeatureSet.RepeatedFieldEncoding} repeatedFieldEncoding - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.repeatedFieldEncoding = 0; - - /** - * FeatureSet utf8Validation. - * @member {google.protobuf.FeatureSet.Utf8Validation} utf8Validation - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.utf8Validation = 0; - - /** - * FeatureSet messageEncoding. - * @member {google.protobuf.FeatureSet.MessageEncoding} messageEncoding - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.messageEncoding = 0; - - /** - * FeatureSet jsonFormat. - * @member {google.protobuf.FeatureSet.JsonFormat} jsonFormat - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.jsonFormat = 0; - - /** - * Creates a new FeatureSet instance using the specified properties. - * @function create - * @memberof google.protobuf.FeatureSet - * @static - * @param {google.protobuf.IFeatureSet=} [properties] Properties to set - * @returns {google.protobuf.FeatureSet} FeatureSet instance - */ - FeatureSet.create = function create(properties) { - return new FeatureSet(properties); - }; - - /** - * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FeatureSet - * @static - * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSet.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.fieldPresence != null && Object.hasOwnProperty.call(message, "fieldPresence")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.fieldPresence); - if (message.enumType != null && Object.hasOwnProperty.call(message, "enumType")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.enumType); - if (message.repeatedFieldEncoding != null && Object.hasOwnProperty.call(message, "repeatedFieldEncoding")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.repeatedFieldEncoding); - if (message.utf8Validation != null && Object.hasOwnProperty.call(message, "utf8Validation")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.utf8Validation); - if (message.messageEncoding != null && Object.hasOwnProperty.call(message, "messageEncoding")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.messageEncoding); - if (message.jsonFormat != null && Object.hasOwnProperty.call(message, "jsonFormat")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jsonFormat); - return writer; - }; - - /** - * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FeatureSet - * @static - * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSet.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FeatureSet message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FeatureSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FeatureSet} FeatureSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSet.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSet(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.fieldPresence = reader.int32(); - break; - } - case 2: { - message.enumType = reader.int32(); - break; - } - case 3: { - message.repeatedFieldEncoding = reader.int32(); - break; - } - case 4: { - message.utf8Validation = reader.int32(); - break; - } - case 5: { - message.messageEncoding = reader.int32(); - break; - } - case 6: { - message.jsonFormat = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FeatureSet message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FeatureSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FeatureSet} FeatureSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSet.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FeatureSet message. - * @function verify - * @memberof google.protobuf.FeatureSet - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FeatureSet.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) - switch (message.fieldPresence) { - default: - return "fieldPresence: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.enumType != null && message.hasOwnProperty("enumType")) - switch (message.enumType) { - default: - return "enumType: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) - switch (message.repeatedFieldEncoding) { - default: - return "repeatedFieldEncoding: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) - switch (message.utf8Validation) { - default: - return "utf8Validation: enum value expected"; - case 0: - case 2: - case 3: - break; - } - if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) - switch (message.messageEncoding) { - default: - return "messageEncoding: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) - switch (message.jsonFormat) { - default: - return "jsonFormat: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FeatureSet - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FeatureSet} FeatureSet - */ - FeatureSet.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FeatureSet) - return object; - var message = new $root.google.protobuf.FeatureSet(); - switch (object.fieldPresence) { - default: - if (typeof object.fieldPresence === "number") { - message.fieldPresence = object.fieldPresence; - break; - } - break; - case "FIELD_PRESENCE_UNKNOWN": - case 0: - message.fieldPresence = 0; - break; - case "EXPLICIT": - case 1: - message.fieldPresence = 1; - break; - case "IMPLICIT": - case 2: - message.fieldPresence = 2; - break; - case "LEGACY_REQUIRED": - case 3: - message.fieldPresence = 3; - break; - } - switch (object.enumType) { - default: - if (typeof object.enumType === "number") { - message.enumType = object.enumType; - break; - } - break; - case "ENUM_TYPE_UNKNOWN": - case 0: - message.enumType = 0; - break; - case "OPEN": - case 1: - message.enumType = 1; - break; - case "CLOSED": - case 2: - message.enumType = 2; - break; - } - switch (object.repeatedFieldEncoding) { - default: - if (typeof object.repeatedFieldEncoding === "number") { - message.repeatedFieldEncoding = object.repeatedFieldEncoding; - break; - } - break; - case "REPEATED_FIELD_ENCODING_UNKNOWN": - case 0: - message.repeatedFieldEncoding = 0; - break; - case "PACKED": - case 1: - message.repeatedFieldEncoding = 1; - break; - case "EXPANDED": - case 2: - message.repeatedFieldEncoding = 2; - break; - } - switch (object.utf8Validation) { - default: - if (typeof object.utf8Validation === "number") { - message.utf8Validation = object.utf8Validation; - break; - } - break; - case "UTF8_VALIDATION_UNKNOWN": - case 0: - message.utf8Validation = 0; - break; - case "VERIFY": - case 2: - message.utf8Validation = 2; - break; - case "NONE": - case 3: - message.utf8Validation = 3; - break; - } - switch (object.messageEncoding) { - default: - if (typeof object.messageEncoding === "number") { - message.messageEncoding = object.messageEncoding; - break; - } - break; - case "MESSAGE_ENCODING_UNKNOWN": - case 0: - message.messageEncoding = 0; - break; - case "LENGTH_PREFIXED": - case 1: - message.messageEncoding = 1; - break; - case "DELIMITED": - case 2: - message.messageEncoding = 2; - break; - } - switch (object.jsonFormat) { - default: - if (typeof object.jsonFormat === "number") { - message.jsonFormat = object.jsonFormat; - break; - } - break; - case "JSON_FORMAT_UNKNOWN": - case 0: - message.jsonFormat = 0; - break; - case "ALLOW": - case 1: - message.jsonFormat = 1; - break; - case "LEGACY_BEST_EFFORT": - case 2: - message.jsonFormat = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FeatureSet - * @static - * @param {google.protobuf.FeatureSet} message FeatureSet - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FeatureSet.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.fieldPresence = options.enums === String ? "FIELD_PRESENCE_UNKNOWN" : 0; - object.enumType = options.enums === String ? "ENUM_TYPE_UNKNOWN" : 0; - object.repeatedFieldEncoding = options.enums === String ? "REPEATED_FIELD_ENCODING_UNKNOWN" : 0; - object.utf8Validation = options.enums === String ? "UTF8_VALIDATION_UNKNOWN" : 0; - object.messageEncoding = options.enums === String ? "MESSAGE_ENCODING_UNKNOWN" : 0; - object.jsonFormat = options.enums === String ? "JSON_FORMAT_UNKNOWN" : 0; - } - if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) - object.fieldPresence = options.enums === String ? $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] === undefined ? message.fieldPresence : $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] : message.fieldPresence; - if (message.enumType != null && message.hasOwnProperty("enumType")) - object.enumType = options.enums === String ? $root.google.protobuf.FeatureSet.EnumType[message.enumType] === undefined ? message.enumType : $root.google.protobuf.FeatureSet.EnumType[message.enumType] : message.enumType; - if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) - object.repeatedFieldEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] === undefined ? message.repeatedFieldEncoding : $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] : message.repeatedFieldEncoding; - if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) - object.utf8Validation = options.enums === String ? $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] === undefined ? message.utf8Validation : $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] : message.utf8Validation; - if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) - object.messageEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] === undefined ? message.messageEncoding : $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] : message.messageEncoding; - if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) - object.jsonFormat = options.enums === String ? $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] === undefined ? message.jsonFormat : $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] : message.jsonFormat; - return object; - }; - - /** - * Converts this FeatureSet to JSON. - * @function toJSON - * @memberof google.protobuf.FeatureSet - * @instance - * @returns {Object.} JSON object - */ - FeatureSet.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FeatureSet - * @function getTypeUrl - * @memberof google.protobuf.FeatureSet - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FeatureSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FeatureSet"; - }; - - /** - * FieldPresence enum. - * @name google.protobuf.FeatureSet.FieldPresence - * @enum {number} - * @property {number} FIELD_PRESENCE_UNKNOWN=0 FIELD_PRESENCE_UNKNOWN value - * @property {number} EXPLICIT=1 EXPLICIT value - * @property {number} IMPLICIT=2 IMPLICIT value - * @property {number} LEGACY_REQUIRED=3 LEGACY_REQUIRED value - */ - FeatureSet.FieldPresence = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "FIELD_PRESENCE_UNKNOWN"] = 0; - values[valuesById[1] = "EXPLICIT"] = 1; - values[valuesById[2] = "IMPLICIT"] = 2; - values[valuesById[3] = "LEGACY_REQUIRED"] = 3; - return values; - })(); - - /** - * EnumType enum. - * @name google.protobuf.FeatureSet.EnumType - * @enum {number} - * @property {number} ENUM_TYPE_UNKNOWN=0 ENUM_TYPE_UNKNOWN value - * @property {number} OPEN=1 OPEN value - * @property {number} CLOSED=2 CLOSED value - */ - FeatureSet.EnumType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ENUM_TYPE_UNKNOWN"] = 0; - values[valuesById[1] = "OPEN"] = 1; - values[valuesById[2] = "CLOSED"] = 2; - return values; - })(); - - /** - * RepeatedFieldEncoding enum. - * @name google.protobuf.FeatureSet.RepeatedFieldEncoding - * @enum {number} - * @property {number} REPEATED_FIELD_ENCODING_UNKNOWN=0 REPEATED_FIELD_ENCODING_UNKNOWN value - * @property {number} PACKED=1 PACKED value - * @property {number} EXPANDED=2 EXPANDED value - */ - FeatureSet.RepeatedFieldEncoding = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "REPEATED_FIELD_ENCODING_UNKNOWN"] = 0; - values[valuesById[1] = "PACKED"] = 1; - values[valuesById[2] = "EXPANDED"] = 2; - return values; - })(); - - /** - * Utf8Validation enum. - * @name google.protobuf.FeatureSet.Utf8Validation - * @enum {number} - * @property {number} UTF8_VALIDATION_UNKNOWN=0 UTF8_VALIDATION_UNKNOWN value - * @property {number} VERIFY=2 VERIFY value - * @property {number} NONE=3 NONE value - */ - FeatureSet.Utf8Validation = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "UTF8_VALIDATION_UNKNOWN"] = 0; - values[valuesById[2] = "VERIFY"] = 2; - values[valuesById[3] = "NONE"] = 3; - return values; - })(); - - /** - * MessageEncoding enum. - * @name google.protobuf.FeatureSet.MessageEncoding - * @enum {number} - * @property {number} MESSAGE_ENCODING_UNKNOWN=0 MESSAGE_ENCODING_UNKNOWN value - * @property {number} LENGTH_PREFIXED=1 LENGTH_PREFIXED value - * @property {number} DELIMITED=2 DELIMITED value - */ - FeatureSet.MessageEncoding = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "MESSAGE_ENCODING_UNKNOWN"] = 0; - values[valuesById[1] = "LENGTH_PREFIXED"] = 1; - values[valuesById[2] = "DELIMITED"] = 2; - return values; - })(); - - /** - * JsonFormat enum. - * @name google.protobuf.FeatureSet.JsonFormat - * @enum {number} - * @property {number} JSON_FORMAT_UNKNOWN=0 JSON_FORMAT_UNKNOWN value - * @property {number} ALLOW=1 ALLOW value - * @property {number} LEGACY_BEST_EFFORT=2 LEGACY_BEST_EFFORT value - */ - FeatureSet.JsonFormat = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "JSON_FORMAT_UNKNOWN"] = 0; - values[valuesById[1] = "ALLOW"] = 1; - values[valuesById[2] = "LEGACY_BEST_EFFORT"] = 2; - return values; - })(); - - return FeatureSet; - })(); - - protobuf.FeatureSetDefaults = (function() { - - /** - * Properties of a FeatureSetDefaults. - * @memberof google.protobuf - * @interface IFeatureSetDefaults - * @property {Array.|null} [defaults] FeatureSetDefaults defaults - * @property {google.protobuf.Edition|null} [minimumEdition] FeatureSetDefaults minimumEdition - * @property {google.protobuf.Edition|null} [maximumEdition] FeatureSetDefaults maximumEdition - */ - - /** - * Constructs a new FeatureSetDefaults. - * @memberof google.protobuf - * @classdesc Represents a FeatureSetDefaults. - * @implements IFeatureSetDefaults - * @constructor - * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set - */ - function FeatureSetDefaults(properties) { - this.defaults = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FeatureSetDefaults defaults. - * @member {Array.} defaults - * @memberof google.protobuf.FeatureSetDefaults - * @instance - */ - FeatureSetDefaults.prototype.defaults = $util.emptyArray; - - /** - * FeatureSetDefaults minimumEdition. - * @member {google.protobuf.Edition} minimumEdition - * @memberof google.protobuf.FeatureSetDefaults - * @instance - */ - FeatureSetDefaults.prototype.minimumEdition = 0; - - /** - * FeatureSetDefaults maximumEdition. - * @member {google.protobuf.Edition} maximumEdition - * @memberof google.protobuf.FeatureSetDefaults - * @instance - */ - FeatureSetDefaults.prototype.maximumEdition = 0; - - /** - * Creates a new FeatureSetDefaults instance using the specified properties. - * @function create - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set - * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults instance - */ - FeatureSetDefaults.create = function create(properties) { - return new FeatureSetDefaults(properties); - }; - - /** - * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSetDefaults.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.defaults != null && message.defaults.length) - for (var i = 0; i < message.defaults.length; ++i) - $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.encode(message.defaults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.minimumEdition != null && Object.hasOwnProperty.call(message, "minimumEdition")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.minimumEdition); - if (message.maximumEdition != null && Object.hasOwnProperty.call(message, "maximumEdition")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maximumEdition); - return writer; - }; - - /** - * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSetDefaults.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FeatureSetDefaults message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSetDefaults.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.defaults && message.defaults.length)) - message.defaults = []; - message.defaults.push($root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.decode(reader, reader.uint32())); - break; - } - case 4: { - message.minimumEdition = reader.int32(); - break; - } - case 5: { - message.maximumEdition = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSetDefaults.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FeatureSetDefaults message. - * @function verify - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FeatureSetDefaults.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.defaults != null && message.hasOwnProperty("defaults")) { - if (!Array.isArray(message.defaults)) - return "defaults: array expected"; - for (var i = 0; i < message.defaults.length; ++i) { - var error = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify(message.defaults[i]); - if (error) - return "defaults." + error; - } - } - if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) - switch (message.minimumEdition) { - default: - return "minimumEdition: enum value expected"; - case 0: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) - switch (message.maximumEdition) { - default: - return "maximumEdition: enum value expected"; - case 0: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - return null; - }; - - /** - * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults - */ - FeatureSetDefaults.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FeatureSetDefaults) - return object; - var message = new $root.google.protobuf.FeatureSetDefaults(); - if (object.defaults) { - if (!Array.isArray(object.defaults)) - throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: array expected"); - message.defaults = []; - for (var i = 0; i < object.defaults.length; ++i) { - if (typeof object.defaults[i] !== "object") - throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: object expected"); - message.defaults[i] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fromObject(object.defaults[i]); - } - } - switch (object.minimumEdition) { - default: - if (typeof object.minimumEdition === "number") { - message.minimumEdition = object.minimumEdition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.minimumEdition = 0; - break; - case "EDITION_PROTO2": - case 998: - message.minimumEdition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.minimumEdition = 999; - break; - case "EDITION_2023": - case 1000: - message.minimumEdition = 1000; - break; - case "EDITION_2024": - case 1001: - message.minimumEdition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.minimumEdition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.minimumEdition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.minimumEdition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.minimumEdition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.minimumEdition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.minimumEdition = 2147483647; - break; - } - switch (object.maximumEdition) { - default: - if (typeof object.maximumEdition === "number") { - message.maximumEdition = object.maximumEdition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.maximumEdition = 0; - break; - case "EDITION_PROTO2": - case 998: - message.maximumEdition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.maximumEdition = 999; - break; - case "EDITION_2023": - case 1000: - message.maximumEdition = 1000; - break; - case "EDITION_2024": - case 1001: - message.maximumEdition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.maximumEdition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.maximumEdition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.maximumEdition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.maximumEdition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.maximumEdition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.maximumEdition = 2147483647; - break; - } - return message; - }; - - /** - * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {google.protobuf.FeatureSetDefaults} message FeatureSetDefaults - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FeatureSetDefaults.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.defaults = []; - if (options.defaults) { - object.minimumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; - object.maximumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; - } - if (message.defaults && message.defaults.length) { - object.defaults = []; - for (var j = 0; j < message.defaults.length; ++j) - object.defaults[j] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.toObject(message.defaults[j], options); - } - if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) - object.minimumEdition = options.enums === String ? $root.google.protobuf.Edition[message.minimumEdition] === undefined ? message.minimumEdition : $root.google.protobuf.Edition[message.minimumEdition] : message.minimumEdition; - if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) - object.maximumEdition = options.enums === String ? $root.google.protobuf.Edition[message.maximumEdition] === undefined ? message.maximumEdition : $root.google.protobuf.Edition[message.maximumEdition] : message.maximumEdition; - return object; - }; - - /** - * Converts this FeatureSetDefaults to JSON. - * @function toJSON - * @memberof google.protobuf.FeatureSetDefaults - * @instance - * @returns {Object.} JSON object - */ - FeatureSetDefaults.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FeatureSetDefaults - * @function getTypeUrl - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FeatureSetDefaults.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults"; - }; - - FeatureSetDefaults.FeatureSetEditionDefault = (function() { - - /** - * Properties of a FeatureSetEditionDefault. - * @memberof google.protobuf.FeatureSetDefaults - * @interface IFeatureSetEditionDefault - * @property {google.protobuf.Edition|null} [edition] FeatureSetEditionDefault edition - * @property {google.protobuf.IFeatureSet|null} [features] FeatureSetEditionDefault features - */ - - /** - * Constructs a new FeatureSetEditionDefault. - * @memberof google.protobuf.FeatureSetDefaults - * @classdesc Represents a FeatureSetEditionDefault. - * @implements IFeatureSetEditionDefault - * @constructor - * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set - */ - function FeatureSetEditionDefault(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FeatureSetEditionDefault edition. - * @member {google.protobuf.Edition} edition - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @instance - */ - FeatureSetEditionDefault.prototype.edition = 0; - - /** - * FeatureSetEditionDefault features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @instance - */ - FeatureSetEditionDefault.prototype.features = null; - - /** - * Creates a new FeatureSetEditionDefault instance using the specified properties. - * @function create - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set - * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault instance - */ - FeatureSetEditionDefault.create = function create(properties) { - return new FeatureSetEditionDefault(properties); - }; - - /** - * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSetEditionDefault.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); - return writer; - }; - - /** - * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSetEditionDefault.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSetEditionDefault.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 3: { - message.edition = reader.int32(); - break; - } - case 2: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSetEditionDefault.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FeatureSetEditionDefault message. - * @function verify - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FeatureSetEditionDefault.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.edition != null && message.hasOwnProperty("edition")) - switch (message.edition) { - default: - return "edition: enum value expected"; - case 0: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - return null; - }; - - /** - * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault - */ - FeatureSetEditionDefault.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault) - return object; - var message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); - switch (object.edition) { - default: - if (typeof object.edition === "number") { - message.edition = object.edition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.edition = 0; - break; - case "EDITION_PROTO2": - case 998: - message.edition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.edition = 999; - break; - case "EDITION_2023": - case 1000: - message.edition = 1000; - break; - case "EDITION_2024": - case 1001: - message.edition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.edition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.edition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.edition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.edition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.edition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.edition = 2147483647; - break; - } - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - return message; - }; - - /** - * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} message FeatureSetEditionDefault - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FeatureSetEditionDefault.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.features = null; - object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; - } - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.edition != null && message.hasOwnProperty("edition")) - object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; - return object; - }; - - /** - * Converts this FeatureSetEditionDefault to JSON. - * @function toJSON - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @instance - * @returns {Object.} JSON object - */ - FeatureSetEditionDefault.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FeatureSetEditionDefault - * @function getTypeUrl - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FeatureSetEditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault"; - }; - - return FeatureSetEditionDefault; - })(); - - return FeatureSetDefaults; - })(); - - protobuf.SourceCodeInfo = (function() { - - /** - * Properties of a SourceCodeInfo. - * @memberof google.protobuf - * @interface ISourceCodeInfo - * @property {Array.|null} [location] SourceCodeInfo location - */ - - /** - * Constructs a new SourceCodeInfo. - * @memberof google.protobuf - * @classdesc Represents a SourceCodeInfo. - * @implements ISourceCodeInfo - * @constructor - * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set - */ - function SourceCodeInfo(properties) { - this.location = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SourceCodeInfo location. - * @member {Array.} location - * @memberof google.protobuf.SourceCodeInfo - * @instance - */ - SourceCodeInfo.prototype.location = $util.emptyArray; - - /** - * Creates a new SourceCodeInfo instance using the specified properties. - * @function create - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance - */ - SourceCodeInfo.create = function create(properties) { - return new SourceCodeInfo(properties); - }; - - /** - * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @function encode - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SourceCodeInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.location != null && message.location.length) - for (var i = 0; i < message.location.length; ++i) - $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SourceCodeInfo.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.location && message.location.length)) - message.location = []; - message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SourceCodeInfo message. - * @function verify - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SourceCodeInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.location != null && message.hasOwnProperty("location")) { - if (!Array.isArray(message.location)) - return "location: array expected"; - for (var i = 0; i < message.location.length; ++i) { - var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]); - if (error) - return "location." + error; - } - } - return null; - }; - - /** - * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo - */ - SourceCodeInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.SourceCodeInfo) - return object; - var message = new $root.google.protobuf.SourceCodeInfo(); - if (object.location) { - if (!Array.isArray(object.location)) - throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); - message.location = []; - for (var i = 0; i < object.location.length; ++i) { - if (typeof object.location[i] !== "object") - throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); - message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SourceCodeInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.location = []; - if (message.location && message.location.length) { - object.location = []; - for (var j = 0; j < message.location.length; ++j) - object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options); - } - return object; - }; - - /** - * Converts this SourceCodeInfo to JSON. - * @function toJSON - * @memberof google.protobuf.SourceCodeInfo - * @instance - * @returns {Object.} JSON object - */ - SourceCodeInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SourceCodeInfo - * @function getTypeUrl - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SourceCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.SourceCodeInfo"; - }; - - SourceCodeInfo.Location = (function() { - - /** - * Properties of a Location. - * @memberof google.protobuf.SourceCodeInfo - * @interface ILocation - * @property {Array.|null} [path] Location path - * @property {Array.|null} [span] Location span - * @property {string|null} [leadingComments] Location leadingComments - * @property {string|null} [trailingComments] Location trailingComments - * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments - */ - - /** - * Constructs a new Location. - * @memberof google.protobuf.SourceCodeInfo - * @classdesc Represents a Location. - * @implements ILocation - * @constructor - * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set - */ - function Location(properties) { - this.path = []; - this.span = []; - this.leadingDetachedComments = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Location path. - * @member {Array.} path - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.path = $util.emptyArray; - - /** - * Location span. - * @member {Array.} span - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.span = $util.emptyArray; - - /** - * Location leadingComments. - * @member {string} leadingComments - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.leadingComments = ""; - - /** - * Location trailingComments. - * @member {string} trailingComments - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.trailingComments = ""; - - /** - * Location leadingDetachedComments. - * @member {Array.} leadingDetachedComments - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.leadingDetachedComments = $util.emptyArray; - - /** - * Creates a new Location instance using the specified properties. - * @function create - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set - * @returns {google.protobuf.SourceCodeInfo.Location} Location instance - */ - Location.create = function create(properties) { - return new Location(properties); - }; - - /** - * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @function encode - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Location.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && message.path.length) { - writer.uint32(/* id 1, wireType 2 =*/10).fork(); - for (var i = 0; i < message.path.length; ++i) - writer.int32(message.path[i]); - writer.ldelim(); - } - if (message.span != null && message.span.length) { - writer.uint32(/* id 2, wireType 2 =*/18).fork(); - for (var i = 0; i < message.span.length; ++i) - writer.int32(message.span[i]); - writer.ldelim(); - } - if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); - if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); - if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) - for (var i = 0; i < message.leadingDetachedComments.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); - return writer; - }; - - /** - * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Location.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Location message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.SourceCodeInfo.Location} Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Location.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.path && message.path.length)) - message.path = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.path.push(reader.int32()); - } else - message.path.push(reader.int32()); - break; - } - case 2: { - if (!(message.span && message.span.length)) - message.span = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.span.push(reader.int32()); - } else - message.span.push(reader.int32()); - break; - } - case 3: { - message.leadingComments = reader.string(); - break; - } - case 4: { - message.trailingComments = reader.string(); - break; - } - case 6: { - if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) - message.leadingDetachedComments = []; - message.leadingDetachedComments.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Location message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.SourceCodeInfo.Location} Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Location.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Location message. - * @function verify - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Location.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) { - if (!Array.isArray(message.path)) - return "path: array expected"; - for (var i = 0; i < message.path.length; ++i) - if (!$util.isInteger(message.path[i])) - return "path: integer[] expected"; - } - if (message.span != null && message.hasOwnProperty("span")) { - if (!Array.isArray(message.span)) - return "span: array expected"; - for (var i = 0; i < message.span.length; ++i) - if (!$util.isInteger(message.span[i])) - return "span: integer[] expected"; - } - if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) - if (!$util.isString(message.leadingComments)) - return "leadingComments: string expected"; - if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) - if (!$util.isString(message.trailingComments)) - return "trailingComments: string expected"; - if (message.leadingDetachedComments != null && message.hasOwnProperty("leadingDetachedComments")) { - if (!Array.isArray(message.leadingDetachedComments)) - return "leadingDetachedComments: array expected"; - for (var i = 0; i < message.leadingDetachedComments.length; ++i) - if (!$util.isString(message.leadingDetachedComments[i])) - return "leadingDetachedComments: string[] expected"; - } - return null; - }; - - /** - * Creates a Location message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.SourceCodeInfo.Location} Location - */ - Location.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) - return object; - var message = new $root.google.protobuf.SourceCodeInfo.Location(); - if (object.path) { - if (!Array.isArray(object.path)) - throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); - message.path = []; - for (var i = 0; i < object.path.length; ++i) - message.path[i] = object.path[i] | 0; - } - if (object.span) { - if (!Array.isArray(object.span)) - throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); - message.span = []; - for (var i = 0; i < object.span.length; ++i) - message.span[i] = object.span[i] | 0; - } - if (object.leadingComments != null) - message.leadingComments = String(object.leadingComments); - if (object.trailingComments != null) - message.trailingComments = String(object.trailingComments); - if (object.leadingDetachedComments) { - if (!Array.isArray(object.leadingDetachedComments)) - throw TypeError(".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected"); - message.leadingDetachedComments = []; - for (var i = 0; i < object.leadingDetachedComments.length; ++i) - message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]); - } - return message; - }; - - /** - * Creates a plain object from a Location message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.Location} message Location - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Location.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.path = []; - object.span = []; - object.leadingDetachedComments = []; - } - if (options.defaults) { - object.leadingComments = ""; - object.trailingComments = ""; - } - if (message.path && message.path.length) { - object.path = []; - for (var j = 0; j < message.path.length; ++j) - object.path[j] = message.path[j]; - } - if (message.span && message.span.length) { - object.span = []; - for (var j = 0; j < message.span.length; ++j) - object.span[j] = message.span[j]; - } - if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) - object.leadingComments = message.leadingComments; - if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) - object.trailingComments = message.trailingComments; - if (message.leadingDetachedComments && message.leadingDetachedComments.length) { - object.leadingDetachedComments = []; - for (var j = 0; j < message.leadingDetachedComments.length; ++j) - object.leadingDetachedComments[j] = message.leadingDetachedComments[j]; - } - return object; - }; - - /** - * Converts this Location to JSON. - * @function toJSON - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - * @returns {Object.} JSON object - */ - Location.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Location - * @function getTypeUrl - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Location.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.SourceCodeInfo.Location"; - }; - - return Location; - })(); - - return SourceCodeInfo; - })(); - - protobuf.GeneratedCodeInfo = (function() { - - /** - * Properties of a GeneratedCodeInfo. - * @memberof google.protobuf - * @interface IGeneratedCodeInfo - * @property {Array.|null} [annotation] GeneratedCodeInfo annotation - */ - - /** - * Constructs a new GeneratedCodeInfo. - * @memberof google.protobuf - * @classdesc Represents a GeneratedCodeInfo. - * @implements IGeneratedCodeInfo - * @constructor - * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set - */ - function GeneratedCodeInfo(properties) { - this.annotation = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GeneratedCodeInfo annotation. - * @member {Array.} annotation - * @memberof google.protobuf.GeneratedCodeInfo - * @instance - */ - GeneratedCodeInfo.prototype.annotation = $util.emptyArray; - - /** - * Creates a new GeneratedCodeInfo instance using the specified properties. - * @function create - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance - */ - GeneratedCodeInfo.create = function create(properties) { - return new GeneratedCodeInfo(properties); - }; - - /** - * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @function encode - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GeneratedCodeInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.annotation != null && message.annotation.length) - for (var i = 0; i < message.annotation.length; ++i) - $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GeneratedCodeInfo.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.annotation && message.annotation.length)) - message.annotation = []; - message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GeneratedCodeInfo message. - * @function verify - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GeneratedCodeInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.annotation != null && message.hasOwnProperty("annotation")) { - if (!Array.isArray(message.annotation)) - return "annotation: array expected"; - for (var i = 0; i < message.annotation.length; ++i) { - var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]); - if (error) - return "annotation." + error; - } - } - return null; - }; - - /** - * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo - */ - GeneratedCodeInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.GeneratedCodeInfo) - return object; - var message = new $root.google.protobuf.GeneratedCodeInfo(); - if (object.annotation) { - if (!Array.isArray(object.annotation)) - throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); - message.annotation = []; - for (var i = 0; i < object.annotation.length; ++i) { - if (typeof object.annotation[i] !== "object") - throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); - message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GeneratedCodeInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.annotation = []; - if (message.annotation && message.annotation.length) { - object.annotation = []; - for (var j = 0; j < message.annotation.length; ++j) - object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options); - } - return object; - }; - - /** - * Converts this GeneratedCodeInfo to JSON. - * @function toJSON - * @memberof google.protobuf.GeneratedCodeInfo - * @instance - * @returns {Object.} JSON object - */ - GeneratedCodeInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GeneratedCodeInfo - * @function getTypeUrl - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GeneratedCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo"; - }; - - GeneratedCodeInfo.Annotation = (function() { - - /** - * Properties of an Annotation. - * @memberof google.protobuf.GeneratedCodeInfo - * @interface IAnnotation - * @property {Array.|null} [path] Annotation path - * @property {string|null} [sourceFile] Annotation sourceFile - * @property {number|null} [begin] Annotation begin - * @property {number|null} [end] Annotation end - * @property {google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null} [semantic] Annotation semantic - */ - - /** - * Constructs a new Annotation. - * @memberof google.protobuf.GeneratedCodeInfo - * @classdesc Represents an Annotation. - * @implements IAnnotation - * @constructor - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set - */ - function Annotation(properties) { - this.path = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Annotation path. - * @member {Array.} path - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.path = $util.emptyArray; - - /** - * Annotation sourceFile. - * @member {string} sourceFile - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.sourceFile = ""; - - /** - * Annotation begin. - * @member {number} begin - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.begin = 0; - - /** - * Annotation end. - * @member {number} end - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.end = 0; - - /** - * Annotation semantic. - * @member {google.protobuf.GeneratedCodeInfo.Annotation.Semantic} semantic - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.semantic = 0; - - /** - * Creates a new Annotation instance using the specified properties. - * @function create - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance - */ - Annotation.create = function create(properties) { - return new Annotation(properties); - }; - - /** - * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @function encode - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Annotation.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && message.path.length) { - writer.uint32(/* id 1, wireType 2 =*/10).fork(); - for (var i = 0; i < message.path.length; ++i) - writer.int32(message.path[i]); - writer.ldelim(); - } - if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); - if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); - if (message.semantic != null && Object.hasOwnProperty.call(message, "semantic")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.semantic); - return writer; - }; - - /** - * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Annotation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Annotation message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Annotation.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.path && message.path.length)) - message.path = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.path.push(reader.int32()); - } else - message.path.push(reader.int32()); - break; - } - case 2: { - message.sourceFile = reader.string(); - break; - } - case 3: { - message.begin = reader.int32(); - break; - } - case 4: { - message.end = reader.int32(); - break; - } - case 5: { - message.semantic = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Annotation message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Annotation.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Annotation message. - * @function verify - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Annotation.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) { - if (!Array.isArray(message.path)) - return "path: array expected"; - for (var i = 0; i < message.path.length; ++i) - if (!$util.isInteger(message.path[i])) - return "path: integer[] expected"; - } - if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) - if (!$util.isString(message.sourceFile)) - return "sourceFile: string expected"; - if (message.begin != null && message.hasOwnProperty("begin")) - if (!$util.isInteger(message.begin)) - return "begin: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - if (message.semantic != null && message.hasOwnProperty("semantic")) - switch (message.semantic) { - default: - return "semantic: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates an Annotation message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation - */ - Annotation.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) - return object; - var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); - if (object.path) { - if (!Array.isArray(object.path)) - throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); - message.path = []; - for (var i = 0; i < object.path.length; ++i) - message.path[i] = object.path[i] | 0; - } - if (object.sourceFile != null) - message.sourceFile = String(object.sourceFile); - if (object.begin != null) - message.begin = object.begin | 0; - if (object.end != null) - message.end = object.end | 0; - switch (object.semantic) { - default: - if (typeof object.semantic === "number") { - message.semantic = object.semantic; - break; - } - break; - case "NONE": - case 0: - message.semantic = 0; - break; - case "SET": - case 1: - message.semantic = 1; - break; - case "ALIAS": - case 2: - message.semantic = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from an Annotation message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Annotation.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.path = []; - if (options.defaults) { - object.sourceFile = ""; - object.begin = 0; - object.end = 0; - object.semantic = options.enums === String ? "NONE" : 0; - } - if (message.path && message.path.length) { - object.path = []; - for (var j = 0; j < message.path.length; ++j) - object.path[j] = message.path[j]; - } - if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) - object.sourceFile = message.sourceFile; - if (message.begin != null && message.hasOwnProperty("begin")) - object.begin = message.begin; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - if (message.semantic != null && message.hasOwnProperty("semantic")) - object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] === undefined ? message.semantic : $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic; - return object; - }; - - /** - * Converts this Annotation to JSON. - * @function toJSON - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - * @returns {Object.} JSON object - */ - Annotation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Annotation - * @function getTypeUrl - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Annotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo.Annotation"; - }; - - /** - * Semantic enum. - * @name google.protobuf.GeneratedCodeInfo.Annotation.Semantic - * @enum {number} - * @property {number} NONE=0 NONE value - * @property {number} SET=1 SET value - * @property {number} ALIAS=2 ALIAS value - */ - Annotation.Semantic = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "NONE"] = 0; - values[valuesById[1] = "SET"] = 1; - values[valuesById[2] = "ALIAS"] = 2; - return values; - })(); - - return Annotation; - })(); - - return GeneratedCodeInfo; - })(); - - protobuf.Duration = (function() { - - /** - * Properties of a Duration. - * @memberof google.protobuf - * @interface IDuration - * @property {number|Long|null} [seconds] Duration seconds - * @property {number|null} [nanos] Duration nanos - */ - - /** - * Constructs a new Duration. - * @memberof google.protobuf - * @classdesc Represents a Duration. - * @implements IDuration - * @constructor - * @param {google.protobuf.IDuration=} [properties] Properties to set - */ - function Duration(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Duration seconds. - * @member {number|Long} seconds - * @memberof google.protobuf.Duration - * @instance - */ - Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Duration nanos. - * @member {number} nanos - * @memberof google.protobuf.Duration - * @instance - */ - Duration.prototype.nanos = 0; - - /** - * Creates a new Duration instance using the specified properties. - * @function create - * @memberof google.protobuf.Duration - * @static - * @param {google.protobuf.IDuration=} [properties] Properties to set - * @returns {google.protobuf.Duration} Duration instance - */ - Duration.create = function create(properties) { - return new Duration(properties); - }; - - /** - * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Duration - * @static - * @param {google.protobuf.IDuration} message Duration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Duration.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); - if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); - return writer; - }; - - /** - * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Duration - * @static - * @param {google.protobuf.IDuration} message Duration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Duration.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Duration message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Duration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Duration} Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Duration.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.seconds = reader.int64(); - break; - } - case 2: { - message.nanos = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Duration message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Duration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Duration} Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Duration.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Duration message. - * @function verify - * @memberof google.protobuf.Duration - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Duration.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) - return "seconds: integer|Long expected"; - if (message.nanos != null && message.hasOwnProperty("nanos")) - if (!$util.isInteger(message.nanos)) - return "nanos: integer expected"; - return null; - }; - - /** - * Creates a Duration message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Duration - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Duration} Duration - */ - Duration.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Duration) - return object; - var message = new $root.google.protobuf.Duration(); - if (object.seconds != null) - if ($util.Long) - (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; - else if (typeof object.seconds === "string") - message.seconds = parseInt(object.seconds, 10); - else if (typeof object.seconds === "number") - message.seconds = object.seconds; - else if (typeof object.seconds === "object") - message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); - if (object.nanos != null) - message.nanos = object.nanos | 0; - return message; - }; - - /** - * Creates a plain object from a Duration message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Duration - * @static - * @param {google.protobuf.Duration} message Duration - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Duration.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.seconds = options.longs === String ? "0" : 0; - object.nanos = 0; - } - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (typeof message.seconds === "number") - object.seconds = options.longs === String ? String(message.seconds) : message.seconds; - else - object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; - if (message.nanos != null && message.hasOwnProperty("nanos")) - object.nanos = message.nanos; - return object; - }; - - /** - * Converts this Duration to JSON. - * @function toJSON - * @memberof google.protobuf.Duration - * @instance - * @returns {Object.} JSON object - */ - Duration.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Duration - * @function getTypeUrl - * @memberof google.protobuf.Duration - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Duration"; - }; - - return Duration; - })(); - - protobuf.Any = (function() { - - /** - * Properties of an Any. - * @memberof google.protobuf - * @interface IAny - * @property {string|null} [type_url] Any type_url - * @property {Uint8Array|null} [value] Any value - */ - - /** - * Constructs a new Any. - * @memberof google.protobuf - * @classdesc Represents an Any. - * @implements IAny - * @constructor - * @param {google.protobuf.IAny=} [properties] Properties to set - */ - function Any(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Any type_url. - * @member {string} type_url - * @memberof google.protobuf.Any - * @instance - */ - Any.prototype.type_url = ""; - - /** - * Any value. - * @member {Uint8Array} value - * @memberof google.protobuf.Any - * @instance - */ - Any.prototype.value = $util.newBuffer([]); - - /** - * Creates a new Any instance using the specified properties. - * @function create - * @memberof google.protobuf.Any - * @static - * @param {google.protobuf.IAny=} [properties] Properties to set - * @returns {google.protobuf.Any} Any instance - */ - Any.create = function create(properties) { - return new Any(properties); - }; - - /** - * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Any - * @static - * @param {google.protobuf.IAny} message Any message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Any.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); - return writer; - }; - - /** - * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Any - * @static - * @param {google.protobuf.IAny} message Any message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Any.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Any message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Any - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Any} Any - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Any.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.type_url = reader.string(); - break; - } - case 2: { - message.value = reader.bytes(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Any message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Any - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Any} Any - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Any.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Any message. - * @function verify - * @memberof google.protobuf.Any - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Any.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.type_url != null && message.hasOwnProperty("type_url")) - if (!$util.isString(message.type_url)) - return "type_url: string expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) - return "value: buffer expected"; - return null; - }; - - /** - * Creates an Any message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Any - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Any} Any - */ - Any.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Any) - return object; - var message = new $root.google.protobuf.Any(); - if (object.type_url != null) - message.type_url = String(object.type_url); - if (object.value != null) - if (typeof object.value === "string") - $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); - else if (object.value.length >= 0) - message.value = object.value; - return message; - }; - - /** - * Creates a plain object from an Any message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Any - * @static - * @param {google.protobuf.Any} message Any - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Any.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.type_url = ""; - if (options.bytes === String) - object.value = ""; - else { - object.value = []; - if (options.bytes !== Array) - object.value = $util.newBuffer(object.value); - } - } - if (message.type_url != null && message.hasOwnProperty("type_url")) - object.type_url = message.type_url; - if (message.value != null && message.hasOwnProperty("value")) - object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; - return object; - }; - - /** - * Converts this Any to JSON. - * @function toJSON - * @memberof google.protobuf.Any - * @instance - * @returns {Object.} JSON object - */ - Any.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Any - * @function getTypeUrl - * @memberof google.protobuf.Any - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Any.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Any"; - }; - - return Any; - })(); - - protobuf.Empty = (function() { - - /** - * Properties of an Empty. - * @memberof google.protobuf - * @interface IEmpty - */ - - /** - * Constructs a new Empty. - * @memberof google.protobuf - * @classdesc Represents an Empty. - * @implements IEmpty - * @constructor - * @param {google.protobuf.IEmpty=} [properties] Properties to set - */ - function Empty(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Creates a new Empty instance using the specified properties. - * @function create - * @memberof google.protobuf.Empty - * @static - * @param {google.protobuf.IEmpty=} [properties] Properties to set - * @returns {google.protobuf.Empty} Empty instance - */ - Empty.create = function create(properties) { - return new Empty(properties); - }; - - /** - * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Empty - * @static - * @param {google.protobuf.IEmpty} message Empty message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Empty.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Empty - * @static - * @param {google.protobuf.IEmpty} message Empty message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Empty.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Empty message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Empty - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Empty} Empty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Empty.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Empty message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Empty - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Empty} Empty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Empty.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Empty message. - * @function verify - * @memberof google.protobuf.Empty - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Empty.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates an Empty message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Empty - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Empty} Empty - */ - Empty.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Empty) - return object; - return new $root.google.protobuf.Empty(); - }; - - /** - * Creates a plain object from an Empty message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Empty - * @static - * @param {google.protobuf.Empty} message Empty - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Empty.toObject = function toObject() { - return {}; - }; - - /** - * Converts this Empty to JSON. - * @function toJSON - * @memberof google.protobuf.Empty - * @instance - * @returns {Object.} JSON object - */ - Empty.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Empty - * @function getTypeUrl - * @memberof google.protobuf.Empty - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Empty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Empty"; - }; - - return Empty; - })(); - - protobuf.FieldMask = (function() { - - /** - * Properties of a FieldMask. - * @memberof google.protobuf - * @interface IFieldMask - * @property {Array.|null} [paths] FieldMask paths - */ - - /** - * Constructs a new FieldMask. - * @memberof google.protobuf - * @classdesc Represents a FieldMask. - * @implements IFieldMask - * @constructor - * @param {google.protobuf.IFieldMask=} [properties] Properties to set - */ - function FieldMask(properties) { - this.paths = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FieldMask paths. - * @member {Array.} paths - * @memberof google.protobuf.FieldMask - * @instance - */ - FieldMask.prototype.paths = $util.emptyArray; - - /** - * Creates a new FieldMask instance using the specified properties. - * @function create - * @memberof google.protobuf.FieldMask - * @static - * @param {google.protobuf.IFieldMask=} [properties] Properties to set - * @returns {google.protobuf.FieldMask} FieldMask instance - */ - FieldMask.create = function create(properties) { - return new FieldMask(properties); - }; - - /** - * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FieldMask - * @static - * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldMask.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.paths != null && message.paths.length) - for (var i = 0; i < message.paths.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.paths[i]); - return writer; - }; - - /** - * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FieldMask - * @static - * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldMask.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FieldMask message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FieldMask - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldMask} FieldMask - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldMask.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldMask(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.paths && message.paths.length)) - message.paths = []; - message.paths.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FieldMask message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FieldMask - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldMask} FieldMask - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldMask.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FieldMask message. - * @function verify - * @memberof google.protobuf.FieldMask - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FieldMask.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.paths != null && message.hasOwnProperty("paths")) { - if (!Array.isArray(message.paths)) - return "paths: array expected"; - for (var i = 0; i < message.paths.length; ++i) - if (!$util.isString(message.paths[i])) - return "paths: string[] expected"; - } - return null; - }; - - /** - * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FieldMask - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FieldMask} FieldMask - */ - FieldMask.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldMask) - return object; - var message = new $root.google.protobuf.FieldMask(); - if (object.paths) { - if (!Array.isArray(object.paths)) - throw TypeError(".google.protobuf.FieldMask.paths: array expected"); - message.paths = []; - for (var i = 0; i < object.paths.length; ++i) - message.paths[i] = String(object.paths[i]); - } - return message; - }; - - /** - * Creates a plain object from a FieldMask message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FieldMask - * @static - * @param {google.protobuf.FieldMask} message FieldMask - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FieldMask.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.paths = []; - if (message.paths && message.paths.length) { - object.paths = []; - for (var j = 0; j < message.paths.length; ++j) - object.paths[j] = message.paths[j]; - } - return object; - }; - - /** - * Converts this FieldMask to JSON. - * @function toJSON - * @memberof google.protobuf.FieldMask - * @instance - * @returns {Object.} JSON object - */ - FieldMask.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FieldMask - * @function getTypeUrl - * @memberof google.protobuf.FieldMask - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FieldMask.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FieldMask"; - }; - - return FieldMask; - })(); - - protobuf.Timestamp = (function() { - - /** - * Properties of a Timestamp. - * @memberof google.protobuf - * @interface ITimestamp - * @property {number|Long|null} [seconds] Timestamp seconds - * @property {number|null} [nanos] Timestamp nanos - */ - - /** - * Constructs a new Timestamp. - * @memberof google.protobuf - * @classdesc Represents a Timestamp. - * @implements ITimestamp - * @constructor - * @param {google.protobuf.ITimestamp=} [properties] Properties to set - */ - function Timestamp(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Timestamp seconds. - * @member {number|Long} seconds - * @memberof google.protobuf.Timestamp - * @instance - */ - Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Timestamp nanos. - * @member {number} nanos - * @memberof google.protobuf.Timestamp - * @instance - */ - Timestamp.prototype.nanos = 0; - - /** - * Creates a new Timestamp instance using the specified properties. - * @function create - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.ITimestamp=} [properties] Properties to set - * @returns {google.protobuf.Timestamp} Timestamp instance - */ - Timestamp.create = function create(properties) { - return new Timestamp(properties); - }; - - /** - * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Timestamp.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); - if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); - return writer; - }; - - /** - * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Timestamp.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Timestamp message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Timestamp - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Timestamp} Timestamp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Timestamp.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.seconds = reader.int64(); - break; - } - case 2: { - message.nanos = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Timestamp message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Timestamp - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Timestamp} Timestamp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Timestamp.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Timestamp message. - * @function verify - * @memberof google.protobuf.Timestamp - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Timestamp.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) - return "seconds: integer|Long expected"; - if (message.nanos != null && message.hasOwnProperty("nanos")) - if (!$util.isInteger(message.nanos)) - return "nanos: integer expected"; - return null; - }; - - /** - * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Timestamp - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Timestamp} Timestamp - */ - Timestamp.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Timestamp) - return object; - var message = new $root.google.protobuf.Timestamp(); - if (object.seconds != null) - if ($util.Long) - (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; - else if (typeof object.seconds === "string") - message.seconds = parseInt(object.seconds, 10); - else if (typeof object.seconds === "number") - message.seconds = object.seconds; - else if (typeof object.seconds === "object") - message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); - if (object.nanos != null) - message.nanos = object.nanos | 0; - return message; - }; - - /** - * Creates a plain object from a Timestamp message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.Timestamp} message Timestamp - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Timestamp.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.seconds = options.longs === String ? "0" : 0; - object.nanos = 0; - } - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (typeof message.seconds === "number") - object.seconds = options.longs === String ? String(message.seconds) : message.seconds; - else - object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; - if (message.nanos != null && message.hasOwnProperty("nanos")) - object.nanos = message.nanos; - return object; - }; - - /** - * Converts this Timestamp to JSON. - * @function toJSON - * @memberof google.protobuf.Timestamp - * @instance - * @returns {Object.} JSON object - */ - Timestamp.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Timestamp - * @function getTypeUrl - * @memberof google.protobuf.Timestamp - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Timestamp"; - }; - - return Timestamp; - })(); - - protobuf.Struct = (function() { - - /** - * Properties of a Struct. - * @memberof google.protobuf - * @interface IStruct - * @property {Object.|null} [fields] Struct fields - */ - - /** - * Constructs a new Struct. - * @memberof google.protobuf - * @classdesc Represents a Struct. - * @implements IStruct - * @constructor - * @param {google.protobuf.IStruct=} [properties] Properties to set - */ - function Struct(properties) { - this.fields = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Struct fields. - * @member {Object.} fields - * @memberof google.protobuf.Struct - * @instance - */ - Struct.prototype.fields = $util.emptyObject; - - /** - * Creates a new Struct instance using the specified properties. - * @function create - * @memberof google.protobuf.Struct - * @static - * @param {google.protobuf.IStruct=} [properties] Properties to set - * @returns {google.protobuf.Struct} Struct instance - */ - Struct.create = function create(properties) { - return new Struct(properties); - }; - - /** - * Encodes the specified Struct message. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Struct - * @static - * @param {google.protobuf.IStruct} message Struct message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Struct.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.fields != null && Object.hasOwnProperty.call(message, "fields")) - for (var keys = Object.keys(message.fields), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.protobuf.Value.encode(message.fields[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - return writer; - }; - - /** - * Encodes the specified Struct message, length delimited. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Struct - * @static - * @param {google.protobuf.IStruct} message Struct message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Struct.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Struct message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Struct - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Struct} Struct - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Struct.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Struct(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (message.fields === $util.emptyObject) - message.fields = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = null; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = $root.google.protobuf.Value.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.fields[key] = value; - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Struct message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Struct - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Struct} Struct - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Struct.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Struct message. - * @function verify - * @memberof google.protobuf.Struct - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Struct.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.fields != null && message.hasOwnProperty("fields")) { - if (!$util.isObject(message.fields)) - return "fields: object expected"; - var key = Object.keys(message.fields); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.protobuf.Value.verify(message.fields[key[i]]); - if (error) - return "fields." + error; - } - } - return null; - }; - - /** - * Creates a Struct message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Struct - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Struct} Struct - */ - Struct.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Struct) - return object; - var message = new $root.google.protobuf.Struct(); - if (object.fields) { - if (typeof object.fields !== "object") - throw TypeError(".google.protobuf.Struct.fields: object expected"); - message.fields = {}; - for (var keys = Object.keys(object.fields), i = 0; i < keys.length; ++i) { - if (typeof object.fields[keys[i]] !== "object") - throw TypeError(".google.protobuf.Struct.fields: object expected"); - message.fields[keys[i]] = $root.google.protobuf.Value.fromObject(object.fields[keys[i]]); - } - } - return message; - }; - - /** - * Creates a plain object from a Struct message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Struct - * @static - * @param {google.protobuf.Struct} message Struct - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Struct.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.fields = {}; - var keys2; - if (message.fields && (keys2 = Object.keys(message.fields)).length) { - object.fields = {}; - for (var j = 0; j < keys2.length; ++j) - object.fields[keys2[j]] = $root.google.protobuf.Value.toObject(message.fields[keys2[j]], options); - } - return object; - }; - - /** - * Converts this Struct to JSON. - * @function toJSON - * @memberof google.protobuf.Struct - * @instance - * @returns {Object.} JSON object - */ - Struct.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Struct - * @function getTypeUrl - * @memberof google.protobuf.Struct - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Struct.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Struct"; - }; - - return Struct; - })(); - - protobuf.Value = (function() { - - /** - * Properties of a Value. - * @memberof google.protobuf - * @interface IValue - * @property {google.protobuf.NullValue|null} [nullValue] Value nullValue - * @property {number|null} [numberValue] Value numberValue - * @property {string|null} [stringValue] Value stringValue - * @property {boolean|null} [boolValue] Value boolValue - * @property {google.protobuf.IStruct|null} [structValue] Value structValue - * @property {google.protobuf.IListValue|null} [listValue] Value listValue - */ - - /** - * Constructs a new Value. - * @memberof google.protobuf - * @classdesc Represents a Value. - * @implements IValue - * @constructor - * @param {google.protobuf.IValue=} [properties] Properties to set - */ - function Value(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Value nullValue. - * @member {google.protobuf.NullValue|null|undefined} nullValue - * @memberof google.protobuf.Value - * @instance - */ - Value.prototype.nullValue = null; - - /** - * Value numberValue. - * @member {number|null|undefined} numberValue - * @memberof google.protobuf.Value - * @instance - */ - Value.prototype.numberValue = null; - - /** - * Value stringValue. - * @member {string|null|undefined} stringValue - * @memberof google.protobuf.Value - * @instance - */ - Value.prototype.stringValue = null; - - /** - * Value boolValue. - * @member {boolean|null|undefined} boolValue - * @memberof google.protobuf.Value - * @instance - */ - Value.prototype.boolValue = null; - - /** - * Value structValue. - * @member {google.protobuf.IStruct|null|undefined} structValue - * @memberof google.protobuf.Value - * @instance - */ - Value.prototype.structValue = null; - - /** - * Value listValue. - * @member {google.protobuf.IListValue|null|undefined} listValue - * @memberof google.protobuf.Value - * @instance - */ - Value.prototype.listValue = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Value kind. - * @member {"nullValue"|"numberValue"|"stringValue"|"boolValue"|"structValue"|"listValue"|undefined} kind - * @memberof google.protobuf.Value - * @instance - */ - Object.defineProperty(Value.prototype, "kind", { - get: $util.oneOfGetter($oneOfFields = ["nullValue", "numberValue", "stringValue", "boolValue", "structValue", "listValue"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Value instance using the specified properties. - * @function create - * @memberof google.protobuf.Value - * @static - * @param {google.protobuf.IValue=} [properties] Properties to set - * @returns {google.protobuf.Value} Value instance - */ - Value.create = function create(properties) { - return new Value(properties); - }; - - /** - * Encodes the specified Value message. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Value - * @static - * @param {google.protobuf.IValue} message Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Value.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.nullValue != null && Object.hasOwnProperty.call(message, "nullValue")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.nullValue); - if (message.numberValue != null && Object.hasOwnProperty.call(message, "numberValue")) - writer.uint32(/* id 2, wireType 1 =*/17).double(message.numberValue); - if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.stringValue); - if (message.boolValue != null && Object.hasOwnProperty.call(message, "boolValue")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.boolValue); - if (message.structValue != null && Object.hasOwnProperty.call(message, "structValue")) - $root.google.protobuf.Struct.encode(message.structValue, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.listValue != null && Object.hasOwnProperty.call(message, "listValue")) - $root.google.protobuf.ListValue.encode(message.listValue, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Value message, length delimited. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Value - * @static - * @param {google.protobuf.IValue} message Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Value.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Value message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Value} Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Value.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Value(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.nullValue = reader.int32(); - break; - } - case 2: { - message.numberValue = reader.double(); - break; - } - case 3: { - message.stringValue = reader.string(); - break; - } - case 4: { - message.boolValue = reader.bool(); - break; - } - case 5: { - message.structValue = $root.google.protobuf.Struct.decode(reader, reader.uint32()); - break; - } - case 6: { - message.listValue = $root.google.protobuf.ListValue.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Value message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Value} Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Value.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Value message. - * @function verify - * @memberof google.protobuf.Value - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Value.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.nullValue != null && message.hasOwnProperty("nullValue")) { - properties.kind = 1; - switch (message.nullValue) { - default: - return "nullValue: enum value expected"; - case 0: - break; - } - } - if (message.numberValue != null && message.hasOwnProperty("numberValue")) { - if (properties.kind === 1) - return "kind: multiple values"; - properties.kind = 1; - if (typeof message.numberValue !== "number") - return "numberValue: number expected"; - } - if (message.stringValue != null && message.hasOwnProperty("stringValue")) { - if (properties.kind === 1) - return "kind: multiple values"; - properties.kind = 1; - if (!$util.isString(message.stringValue)) - return "stringValue: string expected"; - } - if (message.boolValue != null && message.hasOwnProperty("boolValue")) { - if (properties.kind === 1) - return "kind: multiple values"; - properties.kind = 1; - if (typeof message.boolValue !== "boolean") - return "boolValue: boolean expected"; - } - if (message.structValue != null && message.hasOwnProperty("structValue")) { - if (properties.kind === 1) - return "kind: multiple values"; - properties.kind = 1; - { - var error = $root.google.protobuf.Struct.verify(message.structValue); - if (error) - return "structValue." + error; - } - } - if (message.listValue != null && message.hasOwnProperty("listValue")) { - if (properties.kind === 1) - return "kind: multiple values"; - properties.kind = 1; - { - var error = $root.google.protobuf.ListValue.verify(message.listValue); - if (error) - return "listValue." + error; - } - } - return null; - }; - - /** - * Creates a Value message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Value - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Value} Value - */ - Value.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Value) - return object; - var message = new $root.google.protobuf.Value(); - switch (object.nullValue) { - default: - if (typeof object.nullValue === "number") { - message.nullValue = object.nullValue; - break; - } - break; - case "NULL_VALUE": - case 0: - message.nullValue = 0; - break; - } - if (object.numberValue != null) - message.numberValue = Number(object.numberValue); - if (object.stringValue != null) - message.stringValue = String(object.stringValue); - if (object.boolValue != null) - message.boolValue = Boolean(object.boolValue); - if (object.structValue != null) { - if (typeof object.structValue !== "object") - throw TypeError(".google.protobuf.Value.structValue: object expected"); - message.structValue = $root.google.protobuf.Struct.fromObject(object.structValue); - } - if (object.listValue != null) { - if (typeof object.listValue !== "object") - throw TypeError(".google.protobuf.Value.listValue: object expected"); - message.listValue = $root.google.protobuf.ListValue.fromObject(object.listValue); - } - return message; - }; - - /** - * Creates a plain object from a Value message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Value - * @static - * @param {google.protobuf.Value} message Value - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Value.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.nullValue != null && message.hasOwnProperty("nullValue")) { - object.nullValue = options.enums === String ? $root.google.protobuf.NullValue[message.nullValue] === undefined ? message.nullValue : $root.google.protobuf.NullValue[message.nullValue] : message.nullValue; - if (options.oneofs) - object.kind = "nullValue"; - } - if (message.numberValue != null && message.hasOwnProperty("numberValue")) { - object.numberValue = options.json && !isFinite(message.numberValue) ? String(message.numberValue) : message.numberValue; - if (options.oneofs) - object.kind = "numberValue"; - } - if (message.stringValue != null && message.hasOwnProperty("stringValue")) { - object.stringValue = message.stringValue; - if (options.oneofs) - object.kind = "stringValue"; - } - if (message.boolValue != null && message.hasOwnProperty("boolValue")) { - object.boolValue = message.boolValue; - if (options.oneofs) - object.kind = "boolValue"; - } - if (message.structValue != null && message.hasOwnProperty("structValue")) { - object.structValue = $root.google.protobuf.Struct.toObject(message.structValue, options); - if (options.oneofs) - object.kind = "structValue"; - } - if (message.listValue != null && message.hasOwnProperty("listValue")) { - object.listValue = $root.google.protobuf.ListValue.toObject(message.listValue, options); - if (options.oneofs) - object.kind = "listValue"; - } - return object; - }; - - /** - * Converts this Value to JSON. - * @function toJSON - * @memberof google.protobuf.Value - * @instance - * @returns {Object.} JSON object - */ - Value.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Value - * @function getTypeUrl - * @memberof google.protobuf.Value - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Value"; - }; - - return Value; - })(); - - /** - * NullValue enum. - * @name google.protobuf.NullValue - * @enum {number} - * @property {number} NULL_VALUE=0 NULL_VALUE value - */ - protobuf.NullValue = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "NULL_VALUE"] = 0; - return values; - })(); - - protobuf.ListValue = (function() { - - /** - * Properties of a ListValue. - * @memberof google.protobuf - * @interface IListValue - * @property {Array.|null} [values] ListValue values - */ - - /** - * Constructs a new ListValue. - * @memberof google.protobuf - * @classdesc Represents a ListValue. - * @implements IListValue - * @constructor - * @param {google.protobuf.IListValue=} [properties] Properties to set - */ - function ListValue(properties) { - this.values = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListValue values. - * @member {Array.} values - * @memberof google.protobuf.ListValue - * @instance - */ - ListValue.prototype.values = $util.emptyArray; - - /** - * Creates a new ListValue instance using the specified properties. - * @function create - * @memberof google.protobuf.ListValue - * @static - * @param {google.protobuf.IListValue=} [properties] Properties to set - * @returns {google.protobuf.ListValue} ListValue instance - */ - ListValue.create = function create(properties) { - return new ListValue(properties); - }; - - /** - * Encodes the specified ListValue message. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ListValue - * @static - * @param {google.protobuf.IListValue} message ListValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListValue.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.values != null && message.values.length) - for (var i = 0; i < message.values.length; ++i) - $root.google.protobuf.Value.encode(message.values[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ListValue message, length delimited. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ListValue - * @static - * @param {google.protobuf.IListValue} message ListValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListValue message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ListValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ListValue} ListValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListValue.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ListValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.values && message.values.length)) - message.values = []; - message.values.push($root.google.protobuf.Value.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ListValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ListValue} ListValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListValue message. - * @function verify - * @memberof google.protobuf.ListValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListValue.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.values != null && message.hasOwnProperty("values")) { - if (!Array.isArray(message.values)) - return "values: array expected"; - for (var i = 0; i < message.values.length; ++i) { - var error = $root.google.protobuf.Value.verify(message.values[i]); - if (error) - return "values." + error; - } - } - return null; - }; - - /** - * Creates a ListValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ListValue - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ListValue} ListValue - */ - ListValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ListValue) - return object; - var message = new $root.google.protobuf.ListValue(); - if (object.values) { - if (!Array.isArray(object.values)) - throw TypeError(".google.protobuf.ListValue.values: array expected"); - message.values = []; - for (var i = 0; i < object.values.length; ++i) { - if (typeof object.values[i] !== "object") - throw TypeError(".google.protobuf.ListValue.values: object expected"); - message.values[i] = $root.google.protobuf.Value.fromObject(object.values[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a ListValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ListValue - * @static - * @param {google.protobuf.ListValue} message ListValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListValue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.values = []; - if (message.values && message.values.length) { - object.values = []; - for (var j = 0; j < message.values.length; ++j) - object.values[j] = $root.google.protobuf.Value.toObject(message.values[j], options); - } - return object; - }; - - /** - * Converts this ListValue to JSON. - * @function toJSON - * @memberof google.protobuf.ListValue - * @instance - * @returns {Object.} JSON object - */ - ListValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListValue - * @function getTypeUrl - * @memberof google.protobuf.ListValue - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.ListValue"; - }; - - return ListValue; - })(); - - return protobuf; - })(); - - google.longrunning = (function() { - - /** - * Namespace longrunning. - * @memberof google - * @namespace - */ - var longrunning = {}; - - longrunning.Operations = (function() { - - /** - * Constructs a new Operations service. - * @memberof google.longrunning - * @classdesc Represents an Operations - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function Operations(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (Operations.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Operations; - - /** - * Creates new Operations service using the specified rpc implementation. - * @function create - * @memberof google.longrunning.Operations - * @static - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - * @returns {Operations} RPC service. Useful where requests and/or responses are streamed. - */ - Operations.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.longrunning.Operations|listOperations}. - * @memberof google.longrunning.Operations - * @typedef ListOperationsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.ListOperationsResponse} [response] ListOperationsResponse - */ - - /** - * Calls ListOperations. - * @function listOperations - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object - * @param {google.longrunning.Operations.ListOperationsCallback} callback Node-style callback called with the error, if any, and ListOperationsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Operations.prototype.listOperations = function listOperations(request, callback) { - return this.rpcCall(listOperations, $root.google.longrunning.ListOperationsRequest, $root.google.longrunning.ListOperationsResponse, request, callback); - }, "name", { value: "ListOperations" }); - - /** - * Calls ListOperations. - * @function listOperations - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.longrunning.Operations|getOperation}. - * @memberof google.longrunning.Operations - * @typedef GetOperationCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls GetOperation. - * @function getOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object - * @param {google.longrunning.Operations.GetOperationCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Operations.prototype.getOperation = function getOperation(request, callback) { - return this.rpcCall(getOperation, $root.google.longrunning.GetOperationRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "GetOperation" }); - - /** - * Calls GetOperation. - * @function getOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.longrunning.Operations|deleteOperation}. - * @memberof google.longrunning.Operations - * @typedef DeleteOperationCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteOperation. - * @function deleteOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object - * @param {google.longrunning.Operations.DeleteOperationCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Operations.prototype.deleteOperation = function deleteOperation(request, callback) { - return this.rpcCall(deleteOperation, $root.google.longrunning.DeleteOperationRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteOperation" }); - - /** - * Calls DeleteOperation. - * @function deleteOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.longrunning.Operations|cancelOperation}. - * @memberof google.longrunning.Operations - * @typedef CancelOperationCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls CancelOperation. - * @function cancelOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object - * @param {google.longrunning.Operations.CancelOperationCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Operations.prototype.cancelOperation = function cancelOperation(request, callback) { - return this.rpcCall(cancelOperation, $root.google.longrunning.CancelOperationRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "CancelOperation" }); - - /** - * Calls CancelOperation. - * @function cancelOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.longrunning.Operations|waitOperation}. - * @memberof google.longrunning.Operations - * @typedef WaitOperationCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls WaitOperation. - * @function waitOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object - * @param {google.longrunning.Operations.WaitOperationCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Operations.prototype.waitOperation = function waitOperation(request, callback) { - return this.rpcCall(waitOperation, $root.google.longrunning.WaitOperationRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "WaitOperation" }); - - /** - * Calls WaitOperation. - * @function waitOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return Operations; - })(); - - longrunning.Operation = (function() { - - /** - * Properties of an Operation. - * @memberof google.longrunning - * @interface IOperation - * @property {string|null} [name] Operation name - * @property {google.protobuf.IAny|null} [metadata] Operation metadata - * @property {boolean|null} [done] Operation done - * @property {google.rpc.IStatus|null} [error] Operation error - * @property {google.protobuf.IAny|null} [response] Operation response - */ - - /** - * Constructs a new Operation. - * @memberof google.longrunning - * @classdesc Represents an Operation. - * @implements IOperation - * @constructor - * @param {google.longrunning.IOperation=} [properties] Properties to set - */ - function Operation(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Operation name. - * @member {string} name - * @memberof google.longrunning.Operation - * @instance - */ - Operation.prototype.name = ""; - - /** - * Operation metadata. - * @member {google.protobuf.IAny|null|undefined} metadata - * @memberof google.longrunning.Operation - * @instance - */ - Operation.prototype.metadata = null; - - /** - * Operation done. - * @member {boolean} done - * @memberof google.longrunning.Operation - * @instance - */ - Operation.prototype.done = false; - - /** - * Operation error. - * @member {google.rpc.IStatus|null|undefined} error - * @memberof google.longrunning.Operation - * @instance - */ - Operation.prototype.error = null; - - /** - * Operation response. - * @member {google.protobuf.IAny|null|undefined} response - * @memberof google.longrunning.Operation - * @instance - */ - Operation.prototype.response = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Operation result. - * @member {"error"|"response"|undefined} result - * @memberof google.longrunning.Operation - * @instance - */ - Object.defineProperty(Operation.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["error", "response"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Operation instance using the specified properties. - * @function create - * @memberof google.longrunning.Operation - * @static - * @param {google.longrunning.IOperation=} [properties] Properties to set - * @returns {google.longrunning.Operation} Operation instance - */ - Operation.create = function create(properties) { - return new Operation(properties); - }; - - /** - * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. - * @function encode - * @memberof google.longrunning.Operation - * @static - * @param {google.longrunning.IOperation} message Operation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Operation.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.google.protobuf.Any.encode(message.metadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.done != null && Object.hasOwnProperty.call(message, "done")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.done); - if (message.error != null && Object.hasOwnProperty.call(message, "error")) - $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.response != null && Object.hasOwnProperty.call(message, "response")) - $root.google.protobuf.Any.encode(message.response, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.Operation - * @static - * @param {google.longrunning.IOperation} message Operation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Operation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Operation message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.Operation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.Operation} Operation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Operation.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.Operation(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.metadata = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - } - case 3: { - message.done = reader.bool(); - break; - } - case 4: { - message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); - break; - } - case 5: { - message.response = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Operation message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.Operation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.Operation} Operation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Operation.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Operation message. - * @function verify - * @memberof google.longrunning.Operation - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Operation.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.google.protobuf.Any.verify(message.metadata); - if (error) - return "metadata." + error; - } - if (message.done != null && message.hasOwnProperty("done")) - if (typeof message.done !== "boolean") - return "done: boolean expected"; - if (message.error != null && message.hasOwnProperty("error")) { - properties.result = 1; - { - var error = $root.google.rpc.Status.verify(message.error); - if (error) - return "error." + error; - } - } - if (message.response != null && message.hasOwnProperty("response")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.google.protobuf.Any.verify(message.response); - if (error) - return "response." + error; - } - } - return null; - }; - - /** - * Creates an Operation message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.Operation - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.Operation} Operation - */ - Operation.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.Operation) - return object; - var message = new $root.google.longrunning.Operation(); - if (object.name != null) - message.name = String(object.name); - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".google.longrunning.Operation.metadata: object expected"); - message.metadata = $root.google.protobuf.Any.fromObject(object.metadata); - } - if (object.done != null) - message.done = Boolean(object.done); - if (object.error != null) { - if (typeof object.error !== "object") - throw TypeError(".google.longrunning.Operation.error: object expected"); - message.error = $root.google.rpc.Status.fromObject(object.error); - } - if (object.response != null) { - if (typeof object.response !== "object") - throw TypeError(".google.longrunning.Operation.response: object expected"); - message.response = $root.google.protobuf.Any.fromObject(object.response); - } - return message; - }; - - /** - * Creates a plain object from an Operation message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.Operation - * @static - * @param {google.longrunning.Operation} message Operation - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Operation.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.metadata = null; - object.done = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.google.protobuf.Any.toObject(message.metadata, options); - if (message.done != null && message.hasOwnProperty("done")) - object.done = message.done; - if (message.error != null && message.hasOwnProperty("error")) { - object.error = $root.google.rpc.Status.toObject(message.error, options); - if (options.oneofs) - object.result = "error"; - } - if (message.response != null && message.hasOwnProperty("response")) { - object.response = $root.google.protobuf.Any.toObject(message.response, options); - if (options.oneofs) - object.result = "response"; - } - return object; - }; - - /** - * Converts this Operation to JSON. - * @function toJSON - * @memberof google.longrunning.Operation - * @instance - * @returns {Object.} JSON object - */ - Operation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Operation - * @function getTypeUrl - * @memberof google.longrunning.Operation - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Operation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.Operation"; - }; - - return Operation; - })(); - - longrunning.GetOperationRequest = (function() { - - /** - * Properties of a GetOperationRequest. - * @memberof google.longrunning - * @interface IGetOperationRequest - * @property {string|null} [name] GetOperationRequest name - */ - - /** - * Constructs a new GetOperationRequest. - * @memberof google.longrunning - * @classdesc Represents a GetOperationRequest. - * @implements IGetOperationRequest - * @constructor - * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set - */ - function GetOperationRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetOperationRequest name. - * @member {string} name - * @memberof google.longrunning.GetOperationRequest - * @instance - */ - GetOperationRequest.prototype.name = ""; - - /** - * Creates a new GetOperationRequest instance using the specified properties. - * @function create - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set - * @returns {google.longrunning.GetOperationRequest} GetOperationRequest instance - */ - GetOperationRequest.create = function create(properties) { - return new GetOperationRequest(properties); - }; - - /** - * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. - * @function encode - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetOperationRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; - - /** - * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetOperationRequest message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.GetOperationRequest} GetOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetOperationRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.GetOperationRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.GetOperationRequest} GetOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetOperationRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetOperationRequest message. - * @function verify - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetOperationRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; - - /** - * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.GetOperationRequest} GetOperationRequest - */ - GetOperationRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.GetOperationRequest) - return object; - var message = new $root.google.longrunning.GetOperationRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {google.longrunning.GetOperationRequest} message GetOperationRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetOperationRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; - - /** - * Converts this GetOperationRequest to JSON. - * @function toJSON - * @memberof google.longrunning.GetOperationRequest - * @instance - * @returns {Object.} JSON object - */ - GetOperationRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetOperationRequest - * @function getTypeUrl - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.GetOperationRequest"; - }; - - return GetOperationRequest; - })(); - - longrunning.ListOperationsRequest = (function() { - - /** - * Properties of a ListOperationsRequest. - * @memberof google.longrunning - * @interface IListOperationsRequest - * @property {string|null} [name] ListOperationsRequest name - * @property {string|null} [filter] ListOperationsRequest filter - * @property {number|null} [pageSize] ListOperationsRequest pageSize - * @property {string|null} [pageToken] ListOperationsRequest pageToken - */ - - /** - * Constructs a new ListOperationsRequest. - * @memberof google.longrunning - * @classdesc Represents a ListOperationsRequest. - * @implements IListOperationsRequest - * @constructor - * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set - */ - function ListOperationsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListOperationsRequest name. - * @member {string} name - * @memberof google.longrunning.ListOperationsRequest - * @instance - */ - ListOperationsRequest.prototype.name = ""; - - /** - * ListOperationsRequest filter. - * @member {string} filter - * @memberof google.longrunning.ListOperationsRequest - * @instance - */ - ListOperationsRequest.prototype.filter = ""; - - /** - * ListOperationsRequest pageSize. - * @member {number} pageSize - * @memberof google.longrunning.ListOperationsRequest - * @instance - */ - ListOperationsRequest.prototype.pageSize = 0; - - /** - * ListOperationsRequest pageToken. - * @member {string} pageToken - * @memberof google.longrunning.ListOperationsRequest - * @instance - */ - ListOperationsRequest.prototype.pageToken = ""; - - /** - * Creates a new ListOperationsRequest instance using the specified properties. - * @function create - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set - * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest instance - */ - ListOperationsRequest.create = function create(properties) { - return new ListOperationsRequest(properties); - }; - - /** - * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. - * @function encode - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListOperationsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); - return writer; - }; - - /** - * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListOperationsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListOperationsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 4: { - message.name = reader.string(); - break; - } - case 1: { - message.filter = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListOperationsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListOperationsRequest message. - * @function verify - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListOperationsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - return null; - }; - - /** - * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest - */ - ListOperationsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.ListOperationsRequest) - return object; - var message = new $root.google.longrunning.ListOperationsRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.filter != null) - message.filter = String(object.filter); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - return message; - }; - - /** - * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {google.longrunning.ListOperationsRequest} message ListOperationsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListOperationsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.filter = ""; - object.pageSize = 0; - object.pageToken = ""; - object.name = ""; - } - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; - - /** - * Converts this ListOperationsRequest to JSON. - * @function toJSON - * @memberof google.longrunning.ListOperationsRequest - * @instance - * @returns {Object.} JSON object - */ - ListOperationsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListOperationsRequest - * @function getTypeUrl - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListOperationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.ListOperationsRequest"; - }; - - return ListOperationsRequest; - })(); - - longrunning.ListOperationsResponse = (function() { - - /** - * Properties of a ListOperationsResponse. - * @memberof google.longrunning - * @interface IListOperationsResponse - * @property {Array.|null} [operations] ListOperationsResponse operations - * @property {string|null} [nextPageToken] ListOperationsResponse nextPageToken - */ - - /** - * Constructs a new ListOperationsResponse. - * @memberof google.longrunning - * @classdesc Represents a ListOperationsResponse. - * @implements IListOperationsResponse - * @constructor - * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set - */ - function ListOperationsResponse(properties) { - this.operations = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListOperationsResponse operations. - * @member {Array.} operations - * @memberof google.longrunning.ListOperationsResponse - * @instance - */ - ListOperationsResponse.prototype.operations = $util.emptyArray; - - /** - * ListOperationsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.longrunning.ListOperationsResponse - * @instance - */ - ListOperationsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListOperationsResponse instance using the specified properties. - * @function create - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set - * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse instance - */ - ListOperationsResponse.create = function create(properties) { - return new ListOperationsResponse(properties); - }; - - /** - * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. - * @function encode - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListOperationsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.operations != null && message.operations.length) - for (var i = 0; i < message.operations.length; ++i) - $root.google.longrunning.Operation.encode(message.operations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - return writer; - }; - - /** - * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListOperationsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListOperationsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListOperationsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.operations && message.operations.length)) - message.operations = []; - message.operations.push($root.google.longrunning.Operation.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListOperationsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListOperationsResponse message. - * @function verify - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListOperationsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.operations != null && message.hasOwnProperty("operations")) { - if (!Array.isArray(message.operations)) - return "operations: array expected"; - for (var i = 0; i < message.operations.length; ++i) { - var error = $root.google.longrunning.Operation.verify(message.operations[i]); - if (error) - return "operations." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse - */ - ListOperationsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.ListOperationsResponse) - return object; - var message = new $root.google.longrunning.ListOperationsResponse(); - if (object.operations) { - if (!Array.isArray(object.operations)) - throw TypeError(".google.longrunning.ListOperationsResponse.operations: array expected"); - message.operations = []; - for (var i = 0; i < object.operations.length; ++i) { - if (typeof object.operations[i] !== "object") - throw TypeError(".google.longrunning.ListOperationsResponse.operations: object expected"); - message.operations[i] = $root.google.longrunning.Operation.fromObject(object.operations[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {google.longrunning.ListOperationsResponse} message ListOperationsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListOperationsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.operations = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.operations && message.operations.length) { - object.operations = []; - for (var j = 0; j < message.operations.length; ++j) - object.operations[j] = $root.google.longrunning.Operation.toObject(message.operations[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListOperationsResponse to JSON. - * @function toJSON - * @memberof google.longrunning.ListOperationsResponse - * @instance - * @returns {Object.} JSON object - */ - ListOperationsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListOperationsResponse - * @function getTypeUrl - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListOperationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.ListOperationsResponse"; - }; - - return ListOperationsResponse; - })(); - - longrunning.CancelOperationRequest = (function() { - - /** - * Properties of a CancelOperationRequest. - * @memberof google.longrunning - * @interface ICancelOperationRequest - * @property {string|null} [name] CancelOperationRequest name - */ - - /** - * Constructs a new CancelOperationRequest. - * @memberof google.longrunning - * @classdesc Represents a CancelOperationRequest. - * @implements ICancelOperationRequest - * @constructor - * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set - */ - function CancelOperationRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CancelOperationRequest name. - * @member {string} name - * @memberof google.longrunning.CancelOperationRequest - * @instance - */ - CancelOperationRequest.prototype.name = ""; - - /** - * Creates a new CancelOperationRequest instance using the specified properties. - * @function create - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set - * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest instance - */ - CancelOperationRequest.create = function create(properties) { - return new CancelOperationRequest(properties); - }; - - /** - * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. - * @function encode - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CancelOperationRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; - - /** - * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CancelOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CancelOperationRequest message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CancelOperationRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.CancelOperationRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CancelOperationRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CancelOperationRequest message. - * @function verify - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CancelOperationRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; - - /** - * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest - */ - CancelOperationRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.CancelOperationRequest) - return object; - var message = new $root.google.longrunning.CancelOperationRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {google.longrunning.CancelOperationRequest} message CancelOperationRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CancelOperationRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; - - /** - * Converts this CancelOperationRequest to JSON. - * @function toJSON - * @memberof google.longrunning.CancelOperationRequest - * @instance - * @returns {Object.} JSON object - */ - CancelOperationRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CancelOperationRequest - * @function getTypeUrl - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CancelOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.CancelOperationRequest"; - }; - - return CancelOperationRequest; - })(); - - longrunning.DeleteOperationRequest = (function() { - - /** - * Properties of a DeleteOperationRequest. - * @memberof google.longrunning - * @interface IDeleteOperationRequest - * @property {string|null} [name] DeleteOperationRequest name - */ - - /** - * Constructs a new DeleteOperationRequest. - * @memberof google.longrunning - * @classdesc Represents a DeleteOperationRequest. - * @implements IDeleteOperationRequest - * @constructor - * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set - */ - function DeleteOperationRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteOperationRequest name. - * @member {string} name - * @memberof google.longrunning.DeleteOperationRequest - * @instance - */ - DeleteOperationRequest.prototype.name = ""; - - /** - * Creates a new DeleteOperationRequest instance using the specified properties. - * @function create - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set - * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest instance - */ - DeleteOperationRequest.create = function create(properties) { - return new DeleteOperationRequest(properties); - }; - - /** - * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. - * @function encode - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteOperationRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; - - /** - * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteOperationRequest message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteOperationRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.DeleteOperationRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteOperationRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteOperationRequest message. - * @function verify - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteOperationRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; - - /** - * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest - */ - DeleteOperationRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.DeleteOperationRequest) - return object; - var message = new $root.google.longrunning.DeleteOperationRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {google.longrunning.DeleteOperationRequest} message DeleteOperationRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteOperationRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; - - /** - * Converts this DeleteOperationRequest to JSON. - * @function toJSON - * @memberof google.longrunning.DeleteOperationRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteOperationRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteOperationRequest - * @function getTypeUrl - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.DeleteOperationRequest"; - }; - - return DeleteOperationRequest; - })(); - - longrunning.WaitOperationRequest = (function() { - - /** - * Properties of a WaitOperationRequest. - * @memberof google.longrunning - * @interface IWaitOperationRequest - * @property {string|null} [name] WaitOperationRequest name - * @property {google.protobuf.IDuration|null} [timeout] WaitOperationRequest timeout - */ - - /** - * Constructs a new WaitOperationRequest. - * @memberof google.longrunning - * @classdesc Represents a WaitOperationRequest. - * @implements IWaitOperationRequest - * @constructor - * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set - */ - function WaitOperationRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * WaitOperationRequest name. - * @member {string} name - * @memberof google.longrunning.WaitOperationRequest - * @instance - */ - WaitOperationRequest.prototype.name = ""; - - /** - * WaitOperationRequest timeout. - * @member {google.protobuf.IDuration|null|undefined} timeout - * @memberof google.longrunning.WaitOperationRequest - * @instance - */ - WaitOperationRequest.prototype.timeout = null; - - /** - * Creates a new WaitOperationRequest instance using the specified properties. - * @function create - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set - * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest instance - */ - WaitOperationRequest.create = function create(properties) { - return new WaitOperationRequest(properties); - }; - - /** - * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. - * @function encode - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WaitOperationRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) - $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WaitOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a WaitOperationRequest message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WaitOperationRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.WaitOperationRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WaitOperationRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a WaitOperationRequest message. - * @function verify - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - WaitOperationRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.timeout != null && message.hasOwnProperty("timeout")) { - var error = $root.google.protobuf.Duration.verify(message.timeout); - if (error) - return "timeout." + error; - } - return null; - }; - - /** - * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest - */ - WaitOperationRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.WaitOperationRequest) - return object; - var message = new $root.google.longrunning.WaitOperationRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.timeout != null) { - if (typeof object.timeout !== "object") - throw TypeError(".google.longrunning.WaitOperationRequest.timeout: object expected"); - message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); - } - return message; - }; - - /** - * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {google.longrunning.WaitOperationRequest} message WaitOperationRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - WaitOperationRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.timeout = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.timeout != null && message.hasOwnProperty("timeout")) - object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); - return object; - }; - - /** - * Converts this WaitOperationRequest to JSON. - * @function toJSON - * @memberof google.longrunning.WaitOperationRequest - * @instance - * @returns {Object.} JSON object - */ - WaitOperationRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for WaitOperationRequest - * @function getTypeUrl - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - WaitOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.WaitOperationRequest"; - }; - - return WaitOperationRequest; - })(); - - longrunning.OperationInfo = (function() { - - /** - * Properties of an OperationInfo. - * @memberof google.longrunning - * @interface IOperationInfo - * @property {string|null} [responseType] OperationInfo responseType - * @property {string|null} [metadataType] OperationInfo metadataType - */ - - /** - * Constructs a new OperationInfo. - * @memberof google.longrunning - * @classdesc Represents an OperationInfo. - * @implements IOperationInfo - * @constructor - * @param {google.longrunning.IOperationInfo=} [properties] Properties to set - */ - function OperationInfo(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * OperationInfo responseType. - * @member {string} responseType - * @memberof google.longrunning.OperationInfo - * @instance - */ - OperationInfo.prototype.responseType = ""; - - /** - * OperationInfo metadataType. - * @member {string} metadataType - * @memberof google.longrunning.OperationInfo - * @instance - */ - OperationInfo.prototype.metadataType = ""; - - /** - * Creates a new OperationInfo instance using the specified properties. - * @function create - * @memberof google.longrunning.OperationInfo - * @static - * @param {google.longrunning.IOperationInfo=} [properties] Properties to set - * @returns {google.longrunning.OperationInfo} OperationInfo instance - */ - OperationInfo.create = function create(properties) { - return new OperationInfo(properties); - }; - - /** - * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. - * @function encode - * @memberof google.longrunning.OperationInfo - * @static - * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OperationInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.responseType != null && Object.hasOwnProperty.call(message, "responseType")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseType); - if (message.metadataType != null && Object.hasOwnProperty.call(message, "metadataType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.metadataType); - return writer; - }; - - /** - * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.OperationInfo - * @static - * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OperationInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OperationInfo message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.OperationInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.OperationInfo} OperationInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OperationInfo.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.OperationInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.responseType = reader.string(); - break; - } - case 2: { - message.metadataType = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OperationInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.OperationInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.OperationInfo} OperationInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OperationInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OperationInfo message. - * @function verify - * @memberof google.longrunning.OperationInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OperationInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.responseType != null && message.hasOwnProperty("responseType")) - if (!$util.isString(message.responseType)) - return "responseType: string expected"; - if (message.metadataType != null && message.hasOwnProperty("metadataType")) - if (!$util.isString(message.metadataType)) - return "metadataType: string expected"; - return null; - }; - - /** - * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.OperationInfo - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.OperationInfo} OperationInfo - */ - OperationInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.OperationInfo) - return object; - var message = new $root.google.longrunning.OperationInfo(); - if (object.responseType != null) - message.responseType = String(object.responseType); - if (object.metadataType != null) - message.metadataType = String(object.metadataType); - return message; - }; - - /** - * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.OperationInfo - * @static - * @param {google.longrunning.OperationInfo} message OperationInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OperationInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.responseType = ""; - object.metadataType = ""; - } - if (message.responseType != null && message.hasOwnProperty("responseType")) - object.responseType = message.responseType; - if (message.metadataType != null && message.hasOwnProperty("metadataType")) - object.metadataType = message.metadataType; - return object; - }; - - /** - * Converts this OperationInfo to JSON. - * @function toJSON - * @memberof google.longrunning.OperationInfo - * @instance - * @returns {Object.} JSON object - */ - OperationInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OperationInfo - * @function getTypeUrl - * @memberof google.longrunning.OperationInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OperationInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.OperationInfo"; - }; - - return OperationInfo; - })(); - - return longrunning; - })(); - - google.rpc = (function() { - - /** - * Namespace rpc. - * @memberof google - * @namespace - */ - var rpc = {}; - - rpc.Status = (function() { - - /** - * Properties of a Status. - * @memberof google.rpc - * @interface IStatus - * @property {number|null} [code] Status code - * @property {string|null} [message] Status message - * @property {Array.|null} [details] Status details - */ - - /** - * Constructs a new Status. - * @memberof google.rpc - * @classdesc Represents a Status. - * @implements IStatus - * @constructor - * @param {google.rpc.IStatus=} [properties] Properties to set - */ - function Status(properties) { - this.details = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Status code. - * @member {number} code - * @memberof google.rpc.Status - * @instance - */ - Status.prototype.code = 0; - - /** - * Status message. - * @member {string} message - * @memberof google.rpc.Status - * @instance - */ - Status.prototype.message = ""; - - /** - * Status details. - * @member {Array.} details - * @memberof google.rpc.Status - * @instance - */ - Status.prototype.details = $util.emptyArray; - - /** - * Creates a new Status instance using the specified properties. - * @function create - * @memberof google.rpc.Status - * @static - * @param {google.rpc.IStatus=} [properties] Properties to set - * @returns {google.rpc.Status} Status instance - */ - Status.create = function create(properties) { - return new Status(properties); - }; - - /** - * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. - * @function encode - * @memberof google.rpc.Status - * @static - * @param {google.rpc.IStatus} message Status message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Status.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.code != null && Object.hasOwnProperty.call(message, "code")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); - if (message.message != null && Object.hasOwnProperty.call(message, "message")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); - if (message.details != null && message.details.length) - for (var i = 0; i < message.details.length; ++i) - $root.google.protobuf.Any.encode(message.details[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. - * @function encodeDelimited - * @memberof google.rpc.Status - * @static - * @param {google.rpc.IStatus} message Status message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Status.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Status message from the specified reader or buffer. - * @function decode - * @memberof google.rpc.Status - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.rpc.Status} Status - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Status.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.rpc.Status(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.code = reader.int32(); - break; - } - case 2: { - message.message = reader.string(); - break; - } - case 3: { - if (!(message.details && message.details.length)) - message.details = []; - message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Status message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.rpc.Status - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.rpc.Status} Status - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Status.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Status message. - * @function verify - * @memberof google.rpc.Status - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Status.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.code != null && message.hasOwnProperty("code")) - if (!$util.isInteger(message.code)) - return "code: integer expected"; - if (message.message != null && message.hasOwnProperty("message")) - if (!$util.isString(message.message)) - return "message: string expected"; - if (message.details != null && message.hasOwnProperty("details")) { - if (!Array.isArray(message.details)) - return "details: array expected"; - for (var i = 0; i < message.details.length; ++i) { - var error = $root.google.protobuf.Any.verify(message.details[i]); - if (error) - return "details." + error; - } - } - return null; - }; - - /** - * Creates a Status message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.rpc.Status - * @static - * @param {Object.} object Plain object - * @returns {google.rpc.Status} Status - */ - Status.fromObject = function fromObject(object) { - if (object instanceof $root.google.rpc.Status) - return object; - var message = new $root.google.rpc.Status(); - if (object.code != null) - message.code = object.code | 0; - if (object.message != null) - message.message = String(object.message); - if (object.details) { - if (!Array.isArray(object.details)) - throw TypeError(".google.rpc.Status.details: array expected"); - message.details = []; - for (var i = 0; i < object.details.length; ++i) { - if (typeof object.details[i] !== "object") - throw TypeError(".google.rpc.Status.details: object expected"); - message.details[i] = $root.google.protobuf.Any.fromObject(object.details[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a Status message. Also converts values to other types if specified. - * @function toObject - * @memberof google.rpc.Status - * @static - * @param {google.rpc.Status} message Status - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Status.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.details = []; - if (options.defaults) { - object.code = 0; - object.message = ""; - } - if (message.code != null && message.hasOwnProperty("code")) - object.code = message.code; - if (message.message != null && message.hasOwnProperty("message")) - object.message = message.message; - if (message.details && message.details.length) { - object.details = []; - for (var j = 0; j < message.details.length; ++j) - object.details[j] = $root.google.protobuf.Any.toObject(message.details[j], options); - } - return object; - }; - - /** - * Converts this Status to JSON. - * @function toJSON - * @memberof google.rpc.Status - * @instance - * @returns {Object.} JSON object - */ - Status.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Status - * @function getTypeUrl - * @memberof google.rpc.Status - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Status.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.rpc.Status"; - }; - - return Status; - })(); - - return rpc; - })(); - - google.iam = (function() { - - /** - * Namespace iam. - * @memberof google - * @namespace - */ - var iam = {}; - - iam.v1 = (function() { - - /** - * Namespace v1. - * @memberof google.iam - * @namespace - */ - var v1 = {}; - - v1.IAMPolicy = (function() { - - /** - * Constructs a new IAMPolicy service. - * @memberof google.iam.v1 - * @classdesc Represents a IAMPolicy - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function IAMPolicy(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (IAMPolicy.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = IAMPolicy; - - /** - * Creates new IAMPolicy service using the specified rpc implementation. - * @function create - * @memberof google.iam.v1.IAMPolicy - * @static - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - * @returns {IAMPolicy} RPC service. Useful where requests and/or responses are streamed. - */ - IAMPolicy.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.iam.v1.IAMPolicy|setIamPolicy}. - * @memberof google.iam.v1.IAMPolicy - * @typedef SetIamPolicyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.iam.v1.Policy} [response] Policy - */ - - /** - * Calls SetIamPolicy. - * @function setIamPolicy - * @memberof google.iam.v1.IAMPolicy - * @instance - * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object - * @param {google.iam.v1.IAMPolicy.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(IAMPolicy.prototype.setIamPolicy = function setIamPolicy(request, callback) { - return this.rpcCall(setIamPolicy, $root.google.iam.v1.SetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); - }, "name", { value: "SetIamPolicy" }); - - /** - * Calls SetIamPolicy. - * @function setIamPolicy - * @memberof google.iam.v1.IAMPolicy - * @instance - * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.iam.v1.IAMPolicy|getIamPolicy}. - * @memberof google.iam.v1.IAMPolicy - * @typedef GetIamPolicyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.iam.v1.Policy} [response] Policy - */ - - /** - * Calls GetIamPolicy. - * @function getIamPolicy - * @memberof google.iam.v1.IAMPolicy - * @instance - * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object - * @param {google.iam.v1.IAMPolicy.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(IAMPolicy.prototype.getIamPolicy = function getIamPolicy(request, callback) { - return this.rpcCall(getIamPolicy, $root.google.iam.v1.GetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); - }, "name", { value: "GetIamPolicy" }); - - /** - * Calls GetIamPolicy. - * @function getIamPolicy - * @memberof google.iam.v1.IAMPolicy - * @instance - * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.iam.v1.IAMPolicy|testIamPermissions}. - * @memberof google.iam.v1.IAMPolicy - * @typedef TestIamPermissionsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.iam.v1.TestIamPermissionsResponse} [response] TestIamPermissionsResponse - */ - - /** - * Calls TestIamPermissions. - * @function testIamPermissions - * @memberof google.iam.v1.IAMPolicy - * @instance - * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object - * @param {google.iam.v1.IAMPolicy.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestIamPermissionsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(IAMPolicy.prototype.testIamPermissions = function testIamPermissions(request, callback) { - return this.rpcCall(testIamPermissions, $root.google.iam.v1.TestIamPermissionsRequest, $root.google.iam.v1.TestIamPermissionsResponse, request, callback); - }, "name", { value: "TestIamPermissions" }); - - /** - * Calls TestIamPermissions. - * @function testIamPermissions - * @memberof google.iam.v1.IAMPolicy - * @instance - * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return IAMPolicy; - })(); - - v1.SetIamPolicyRequest = (function() { - - /** - * Properties of a SetIamPolicyRequest. - * @memberof google.iam.v1 - * @interface ISetIamPolicyRequest - * @property {string|null} [resource] SetIamPolicyRequest resource - * @property {google.iam.v1.IPolicy|null} [policy] SetIamPolicyRequest policy - * @property {google.protobuf.IFieldMask|null} [updateMask] SetIamPolicyRequest updateMask - */ - - /** - * Constructs a new SetIamPolicyRequest. - * @memberof google.iam.v1 - * @classdesc Represents a SetIamPolicyRequest. - * @implements ISetIamPolicyRequest - * @constructor - * @param {google.iam.v1.ISetIamPolicyRequest=} [properties] Properties to set - */ - function SetIamPolicyRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SetIamPolicyRequest resource. - * @member {string} resource - * @memberof google.iam.v1.SetIamPolicyRequest - * @instance - */ - SetIamPolicyRequest.prototype.resource = ""; - - /** - * SetIamPolicyRequest policy. - * @member {google.iam.v1.IPolicy|null|undefined} policy - * @memberof google.iam.v1.SetIamPolicyRequest - * @instance - */ - SetIamPolicyRequest.prototype.policy = null; - - /** - * SetIamPolicyRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.iam.v1.SetIamPolicyRequest - * @instance - */ - SetIamPolicyRequest.prototype.updateMask = null; - - /** - * Creates a new SetIamPolicyRequest instance using the specified properties. - * @function create - * @memberof google.iam.v1.SetIamPolicyRequest - * @static - * @param {google.iam.v1.ISetIamPolicyRequest=} [properties] Properties to set - * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest instance - */ - SetIamPolicyRequest.create = function create(properties) { - return new SetIamPolicyRequest(properties); - }; - - /** - * Encodes the specified SetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. - * @function encode - * @memberof google.iam.v1.SetIamPolicyRequest - * @static - * @param {google.iam.v1.ISetIamPolicyRequest} message SetIamPolicyRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SetIamPolicyRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); - if (message.policy != null && Object.hasOwnProperty.call(message, "policy")) - $root.google.iam.v1.Policy.encode(message.policy, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified SetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.iam.v1.SetIamPolicyRequest - * @static - * @param {google.iam.v1.ISetIamPolicyRequest} message SetIamPolicyRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SetIamPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SetIamPolicyRequest message from the specified reader or buffer. - * @function decode - * @memberof google.iam.v1.SetIamPolicyRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SetIamPolicyRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.SetIamPolicyRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.resource = reader.string(); - break; - } - case 2: { - message.policy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); - break; - } - case 3: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SetIamPolicyRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.iam.v1.SetIamPolicyRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SetIamPolicyRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SetIamPolicyRequest message. - * @function verify - * @memberof google.iam.v1.SetIamPolicyRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SetIamPolicyRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.resource != null && message.hasOwnProperty("resource")) - if (!$util.isString(message.resource)) - return "resource: string expected"; - if (message.policy != null && message.hasOwnProperty("policy")) { - var error = $root.google.iam.v1.Policy.verify(message.policy); - if (error) - return "policy." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - return null; - }; - - /** - * Creates a SetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.iam.v1.SetIamPolicyRequest - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest - */ - SetIamPolicyRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.SetIamPolicyRequest) - return object; - var message = new $root.google.iam.v1.SetIamPolicyRequest(); - if (object.resource != null) - message.resource = String(object.resource); - if (object.policy != null) { - if (typeof object.policy !== "object") - throw TypeError(".google.iam.v1.SetIamPolicyRequest.policy: object expected"); - message.policy = $root.google.iam.v1.Policy.fromObject(object.policy); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.iam.v1.SetIamPolicyRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - return message; - }; - - /** - * Creates a plain object from a SetIamPolicyRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.iam.v1.SetIamPolicyRequest - * @static - * @param {google.iam.v1.SetIamPolicyRequest} message SetIamPolicyRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SetIamPolicyRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.resource = ""; - object.policy = null; - object.updateMask = null; - } - if (message.resource != null && message.hasOwnProperty("resource")) - object.resource = message.resource; - if (message.policy != null && message.hasOwnProperty("policy")) - object.policy = $root.google.iam.v1.Policy.toObject(message.policy, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - return object; - }; - - /** - * Converts this SetIamPolicyRequest to JSON. - * @function toJSON - * @memberof google.iam.v1.SetIamPolicyRequest - * @instance - * @returns {Object.} JSON object - */ - SetIamPolicyRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SetIamPolicyRequest - * @function getTypeUrl - * @memberof google.iam.v1.SetIamPolicyRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SetIamPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.iam.v1.SetIamPolicyRequest"; - }; - - return SetIamPolicyRequest; - })(); - - v1.GetIamPolicyRequest = (function() { - - /** - * Properties of a GetIamPolicyRequest. - * @memberof google.iam.v1 - * @interface IGetIamPolicyRequest - * @property {string|null} [resource] GetIamPolicyRequest resource - * @property {google.iam.v1.IGetPolicyOptions|null} [options] GetIamPolicyRequest options - */ - - /** - * Constructs a new GetIamPolicyRequest. - * @memberof google.iam.v1 - * @classdesc Represents a GetIamPolicyRequest. - * @implements IGetIamPolicyRequest - * @constructor - * @param {google.iam.v1.IGetIamPolicyRequest=} [properties] Properties to set - */ - function GetIamPolicyRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIamPolicyRequest resource. - * @member {string} resource - * @memberof google.iam.v1.GetIamPolicyRequest - * @instance - */ - GetIamPolicyRequest.prototype.resource = ""; - - /** - * GetIamPolicyRequest options. - * @member {google.iam.v1.IGetPolicyOptions|null|undefined} options - * @memberof google.iam.v1.GetIamPolicyRequest - * @instance - */ - GetIamPolicyRequest.prototype.options = null; - - /** - * Creates a new GetIamPolicyRequest instance using the specified properties. - * @function create - * @memberof google.iam.v1.GetIamPolicyRequest - * @static - * @param {google.iam.v1.IGetIamPolicyRequest=} [properties] Properties to set - * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest instance - */ - GetIamPolicyRequest.create = function create(properties) { - return new GetIamPolicyRequest(properties); - }; - - /** - * Encodes the specified GetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. - * @function encode - * @memberof google.iam.v1.GetIamPolicyRequest - * @static - * @param {google.iam.v1.IGetIamPolicyRequest} message GetIamPolicyRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIamPolicyRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.iam.v1.GetPolicyOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.iam.v1.GetIamPolicyRequest - * @static - * @param {google.iam.v1.IGetIamPolicyRequest} message GetIamPolicyRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIamPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIamPolicyRequest message from the specified reader or buffer. - * @function decode - * @memberof google.iam.v1.GetIamPolicyRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIamPolicyRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.GetIamPolicyRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.resource = reader.string(); - break; - } - case 2: { - message.options = $root.google.iam.v1.GetPolicyOptions.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIamPolicyRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.iam.v1.GetIamPolicyRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIamPolicyRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIamPolicyRequest message. - * @function verify - * @memberof google.iam.v1.GetIamPolicyRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIamPolicyRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.resource != null && message.hasOwnProperty("resource")) - if (!$util.isString(message.resource)) - return "resource: string expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.iam.v1.GetPolicyOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates a GetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.iam.v1.GetIamPolicyRequest - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest - */ - GetIamPolicyRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.GetIamPolicyRequest) - return object; - var message = new $root.google.iam.v1.GetIamPolicyRequest(); - if (object.resource != null) - message.resource = String(object.resource); - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.iam.v1.GetIamPolicyRequest.options: object expected"); - message.options = $root.google.iam.v1.GetPolicyOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from a GetIamPolicyRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.iam.v1.GetIamPolicyRequest - * @static - * @param {google.iam.v1.GetIamPolicyRequest} message GetIamPolicyRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIamPolicyRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.resource = ""; - object.options = null; - } - if (message.resource != null && message.hasOwnProperty("resource")) - object.resource = message.resource; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.iam.v1.GetPolicyOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this GetIamPolicyRequest to JSON. - * @function toJSON - * @memberof google.iam.v1.GetIamPolicyRequest - * @instance - * @returns {Object.} JSON object - */ - GetIamPolicyRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetIamPolicyRequest - * @function getTypeUrl - * @memberof google.iam.v1.GetIamPolicyRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetIamPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.iam.v1.GetIamPolicyRequest"; - }; - - return GetIamPolicyRequest; - })(); - - v1.TestIamPermissionsRequest = (function() { - - /** - * Properties of a TestIamPermissionsRequest. - * @memberof google.iam.v1 - * @interface ITestIamPermissionsRequest - * @property {string|null} [resource] TestIamPermissionsRequest resource - * @property {Array.|null} [permissions] TestIamPermissionsRequest permissions - */ - - /** - * Constructs a new TestIamPermissionsRequest. - * @memberof google.iam.v1 - * @classdesc Represents a TestIamPermissionsRequest. - * @implements ITestIamPermissionsRequest - * @constructor - * @param {google.iam.v1.ITestIamPermissionsRequest=} [properties] Properties to set - */ - function TestIamPermissionsRequest(properties) { - this.permissions = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TestIamPermissionsRequest resource. - * @member {string} resource - * @memberof google.iam.v1.TestIamPermissionsRequest - * @instance - */ - TestIamPermissionsRequest.prototype.resource = ""; - - /** - * TestIamPermissionsRequest permissions. - * @member {Array.} permissions - * @memberof google.iam.v1.TestIamPermissionsRequest - * @instance - */ - TestIamPermissionsRequest.prototype.permissions = $util.emptyArray; - - /** - * Creates a new TestIamPermissionsRequest instance using the specified properties. - * @function create - * @memberof google.iam.v1.TestIamPermissionsRequest - * @static - * @param {google.iam.v1.ITestIamPermissionsRequest=} [properties] Properties to set - * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest instance - */ - TestIamPermissionsRequest.create = function create(properties) { - return new TestIamPermissionsRequest(properties); - }; - - /** - * Encodes the specified TestIamPermissionsRequest message. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. - * @function encode - * @memberof google.iam.v1.TestIamPermissionsRequest - * @static - * @param {google.iam.v1.ITestIamPermissionsRequest} message TestIamPermissionsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TestIamPermissionsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); - if (message.permissions != null && message.permissions.length) - for (var i = 0; i < message.permissions.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.permissions[i]); - return writer; - }; - - /** - * Encodes the specified TestIamPermissionsRequest message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.iam.v1.TestIamPermissionsRequest - * @static - * @param {google.iam.v1.ITestIamPermissionsRequest} message TestIamPermissionsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TestIamPermissionsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TestIamPermissionsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.iam.v1.TestIamPermissionsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TestIamPermissionsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.TestIamPermissionsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.resource = reader.string(); - break; - } - case 2: { - if (!(message.permissions && message.permissions.length)) - message.permissions = []; - message.permissions.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TestIamPermissionsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.iam.v1.TestIamPermissionsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TestIamPermissionsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TestIamPermissionsRequest message. - * @function verify - * @memberof google.iam.v1.TestIamPermissionsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TestIamPermissionsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.resource != null && message.hasOwnProperty("resource")) - if (!$util.isString(message.resource)) - return "resource: string expected"; - if (message.permissions != null && message.hasOwnProperty("permissions")) { - if (!Array.isArray(message.permissions)) - return "permissions: array expected"; - for (var i = 0; i < message.permissions.length; ++i) - if (!$util.isString(message.permissions[i])) - return "permissions: string[] expected"; - } - return null; - }; - - /** - * Creates a TestIamPermissionsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.iam.v1.TestIamPermissionsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest - */ - TestIamPermissionsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.TestIamPermissionsRequest) - return object; - var message = new $root.google.iam.v1.TestIamPermissionsRequest(); - if (object.resource != null) - message.resource = String(object.resource); - if (object.permissions) { - if (!Array.isArray(object.permissions)) - throw TypeError(".google.iam.v1.TestIamPermissionsRequest.permissions: array expected"); - message.permissions = []; - for (var i = 0; i < object.permissions.length; ++i) - message.permissions[i] = String(object.permissions[i]); - } - return message; - }; - - /** - * Creates a plain object from a TestIamPermissionsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.iam.v1.TestIamPermissionsRequest - * @static - * @param {google.iam.v1.TestIamPermissionsRequest} message TestIamPermissionsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TestIamPermissionsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.permissions = []; - if (options.defaults) - object.resource = ""; - if (message.resource != null && message.hasOwnProperty("resource")) - object.resource = message.resource; - if (message.permissions && message.permissions.length) { - object.permissions = []; - for (var j = 0; j < message.permissions.length; ++j) - object.permissions[j] = message.permissions[j]; - } - return object; - }; - - /** - * Converts this TestIamPermissionsRequest to JSON. - * @function toJSON - * @memberof google.iam.v1.TestIamPermissionsRequest - * @instance - * @returns {Object.} JSON object - */ - TestIamPermissionsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TestIamPermissionsRequest - * @function getTypeUrl - * @memberof google.iam.v1.TestIamPermissionsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TestIamPermissionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.iam.v1.TestIamPermissionsRequest"; - }; - - return TestIamPermissionsRequest; - })(); - - v1.TestIamPermissionsResponse = (function() { - - /** - * Properties of a TestIamPermissionsResponse. - * @memberof google.iam.v1 - * @interface ITestIamPermissionsResponse - * @property {Array.|null} [permissions] TestIamPermissionsResponse permissions - */ - - /** - * Constructs a new TestIamPermissionsResponse. - * @memberof google.iam.v1 - * @classdesc Represents a TestIamPermissionsResponse. - * @implements ITestIamPermissionsResponse - * @constructor - * @param {google.iam.v1.ITestIamPermissionsResponse=} [properties] Properties to set - */ - function TestIamPermissionsResponse(properties) { - this.permissions = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TestIamPermissionsResponse permissions. - * @member {Array.} permissions - * @memberof google.iam.v1.TestIamPermissionsResponse - * @instance - */ - TestIamPermissionsResponse.prototype.permissions = $util.emptyArray; - - /** - * Creates a new TestIamPermissionsResponse instance using the specified properties. - * @function create - * @memberof google.iam.v1.TestIamPermissionsResponse - * @static - * @param {google.iam.v1.ITestIamPermissionsResponse=} [properties] Properties to set - * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse instance - */ - TestIamPermissionsResponse.create = function create(properties) { - return new TestIamPermissionsResponse(properties); - }; - - /** - * Encodes the specified TestIamPermissionsResponse message. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. - * @function encode - * @memberof google.iam.v1.TestIamPermissionsResponse - * @static - * @param {google.iam.v1.ITestIamPermissionsResponse} message TestIamPermissionsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TestIamPermissionsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.permissions != null && message.permissions.length) - for (var i = 0; i < message.permissions.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.permissions[i]); - return writer; - }; - - /** - * Encodes the specified TestIamPermissionsResponse message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.iam.v1.TestIamPermissionsResponse - * @static - * @param {google.iam.v1.ITestIamPermissionsResponse} message TestIamPermissionsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TestIamPermissionsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TestIamPermissionsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.iam.v1.TestIamPermissionsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TestIamPermissionsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.TestIamPermissionsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.permissions && message.permissions.length)) - message.permissions = []; - message.permissions.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TestIamPermissionsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.iam.v1.TestIamPermissionsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TestIamPermissionsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TestIamPermissionsResponse message. - * @function verify - * @memberof google.iam.v1.TestIamPermissionsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TestIamPermissionsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.permissions != null && message.hasOwnProperty("permissions")) { - if (!Array.isArray(message.permissions)) - return "permissions: array expected"; - for (var i = 0; i < message.permissions.length; ++i) - if (!$util.isString(message.permissions[i])) - return "permissions: string[] expected"; - } - return null; - }; - - /** - * Creates a TestIamPermissionsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.iam.v1.TestIamPermissionsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse - */ - TestIamPermissionsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.TestIamPermissionsResponse) - return object; - var message = new $root.google.iam.v1.TestIamPermissionsResponse(); - if (object.permissions) { - if (!Array.isArray(object.permissions)) - throw TypeError(".google.iam.v1.TestIamPermissionsResponse.permissions: array expected"); - message.permissions = []; - for (var i = 0; i < object.permissions.length; ++i) - message.permissions[i] = String(object.permissions[i]); - } - return message; - }; - - /** - * Creates a plain object from a TestIamPermissionsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.iam.v1.TestIamPermissionsResponse - * @static - * @param {google.iam.v1.TestIamPermissionsResponse} message TestIamPermissionsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TestIamPermissionsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.permissions = []; - if (message.permissions && message.permissions.length) { - object.permissions = []; - for (var j = 0; j < message.permissions.length; ++j) - object.permissions[j] = message.permissions[j]; - } - return object; - }; - - /** - * Converts this TestIamPermissionsResponse to JSON. - * @function toJSON - * @memberof google.iam.v1.TestIamPermissionsResponse - * @instance - * @returns {Object.} JSON object - */ - TestIamPermissionsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TestIamPermissionsResponse - * @function getTypeUrl - * @memberof google.iam.v1.TestIamPermissionsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TestIamPermissionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.iam.v1.TestIamPermissionsResponse"; - }; - - return TestIamPermissionsResponse; - })(); - - v1.GetPolicyOptions = (function() { - - /** - * Properties of a GetPolicyOptions. - * @memberof google.iam.v1 - * @interface IGetPolicyOptions - * @property {number|null} [requestedPolicyVersion] GetPolicyOptions requestedPolicyVersion - */ - - /** - * Constructs a new GetPolicyOptions. - * @memberof google.iam.v1 - * @classdesc Represents a GetPolicyOptions. - * @implements IGetPolicyOptions - * @constructor - * @param {google.iam.v1.IGetPolicyOptions=} [properties] Properties to set - */ - function GetPolicyOptions(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetPolicyOptions requestedPolicyVersion. - * @member {number} requestedPolicyVersion - * @memberof google.iam.v1.GetPolicyOptions - * @instance - */ - GetPolicyOptions.prototype.requestedPolicyVersion = 0; - - /** - * Creates a new GetPolicyOptions instance using the specified properties. - * @function create - * @memberof google.iam.v1.GetPolicyOptions - * @static - * @param {google.iam.v1.IGetPolicyOptions=} [properties] Properties to set - * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions instance - */ - GetPolicyOptions.create = function create(properties) { - return new GetPolicyOptions(properties); - }; - - /** - * Encodes the specified GetPolicyOptions message. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages. - * @function encode - * @memberof google.iam.v1.GetPolicyOptions - * @static - * @param {google.iam.v1.IGetPolicyOptions} message GetPolicyOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetPolicyOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.requestedPolicyVersion != null && Object.hasOwnProperty.call(message, "requestedPolicyVersion")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.requestedPolicyVersion); - return writer; - }; - - /** - * Encodes the specified GetPolicyOptions message, length delimited. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.iam.v1.GetPolicyOptions - * @static - * @param {google.iam.v1.IGetPolicyOptions} message GetPolicyOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetPolicyOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetPolicyOptions message from the specified reader or buffer. - * @function decode - * @memberof google.iam.v1.GetPolicyOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetPolicyOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.GetPolicyOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.requestedPolicyVersion = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetPolicyOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.iam.v1.GetPolicyOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetPolicyOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetPolicyOptions message. - * @function verify - * @memberof google.iam.v1.GetPolicyOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetPolicyOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.requestedPolicyVersion != null && message.hasOwnProperty("requestedPolicyVersion")) - if (!$util.isInteger(message.requestedPolicyVersion)) - return "requestedPolicyVersion: integer expected"; - return null; - }; - - /** - * Creates a GetPolicyOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.iam.v1.GetPolicyOptions - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions - */ - GetPolicyOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.GetPolicyOptions) - return object; - var message = new $root.google.iam.v1.GetPolicyOptions(); - if (object.requestedPolicyVersion != null) - message.requestedPolicyVersion = object.requestedPolicyVersion | 0; - return message; - }; - - /** - * Creates a plain object from a GetPolicyOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.iam.v1.GetPolicyOptions - * @static - * @param {google.iam.v1.GetPolicyOptions} message GetPolicyOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetPolicyOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.requestedPolicyVersion = 0; - if (message.requestedPolicyVersion != null && message.hasOwnProperty("requestedPolicyVersion")) - object.requestedPolicyVersion = message.requestedPolicyVersion; - return object; - }; - - /** - * Converts this GetPolicyOptions to JSON. - * @function toJSON - * @memberof google.iam.v1.GetPolicyOptions - * @instance - * @returns {Object.} JSON object - */ - GetPolicyOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetPolicyOptions - * @function getTypeUrl - * @memberof google.iam.v1.GetPolicyOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetPolicyOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.iam.v1.GetPolicyOptions"; - }; - - return GetPolicyOptions; - })(); - - v1.Policy = (function() { - - /** - * Properties of a Policy. - * @memberof google.iam.v1 - * @interface IPolicy - * @property {number|null} [version] Policy version - * @property {Array.|null} [bindings] Policy bindings - * @property {Array.|null} [auditConfigs] Policy auditConfigs - * @property {Uint8Array|null} [etag] Policy etag - */ - - /** - * Constructs a new Policy. - * @memberof google.iam.v1 - * @classdesc Represents a Policy. - * @implements IPolicy - * @constructor - * @param {google.iam.v1.IPolicy=} [properties] Properties to set - */ - function Policy(properties) { - this.bindings = []; - this.auditConfigs = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Policy version. - * @member {number} version - * @memberof google.iam.v1.Policy - * @instance - */ - Policy.prototype.version = 0; - - /** - * Policy bindings. - * @member {Array.} bindings - * @memberof google.iam.v1.Policy - * @instance - */ - Policy.prototype.bindings = $util.emptyArray; - - /** - * Policy auditConfigs. - * @member {Array.} auditConfigs - * @memberof google.iam.v1.Policy - * @instance - */ - Policy.prototype.auditConfigs = $util.emptyArray; - - /** - * Policy etag. - * @member {Uint8Array} etag - * @memberof google.iam.v1.Policy - * @instance - */ - Policy.prototype.etag = $util.newBuffer([]); - - /** - * Creates a new Policy instance using the specified properties. - * @function create - * @memberof google.iam.v1.Policy - * @static - * @param {google.iam.v1.IPolicy=} [properties] Properties to set - * @returns {google.iam.v1.Policy} Policy instance - */ - Policy.create = function create(properties) { - return new Policy(properties); - }; - - /** - * Encodes the specified Policy message. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. - * @function encode - * @memberof google.iam.v1.Policy - * @static - * @param {google.iam.v1.IPolicy} message Policy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Policy.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.version); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.etag); - if (message.bindings != null && message.bindings.length) - for (var i = 0; i < message.bindings.length; ++i) - $root.google.iam.v1.Binding.encode(message.bindings[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.auditConfigs != null && message.auditConfigs.length) - for (var i = 0; i < message.auditConfigs.length; ++i) - $root.google.iam.v1.AuditConfig.encode(message.auditConfigs[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Policy message, length delimited. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. - * @function encodeDelimited - * @memberof google.iam.v1.Policy - * @static - * @param {google.iam.v1.IPolicy} message Policy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Policy.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Policy message from the specified reader or buffer. - * @function decode - * @memberof google.iam.v1.Policy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.Policy} Policy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Policy.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.Policy(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.version = reader.int32(); - break; - } - case 4: { - if (!(message.bindings && message.bindings.length)) - message.bindings = []; - message.bindings.push($root.google.iam.v1.Binding.decode(reader, reader.uint32())); - break; - } - case 6: { - if (!(message.auditConfigs && message.auditConfigs.length)) - message.auditConfigs = []; - message.auditConfigs.push($root.google.iam.v1.AuditConfig.decode(reader, reader.uint32())); - break; - } - case 3: { - message.etag = reader.bytes(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Policy message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.iam.v1.Policy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.Policy} Policy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Policy.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Policy message. - * @function verify - * @memberof google.iam.v1.Policy - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Policy.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.version != null && message.hasOwnProperty("version")) - if (!$util.isInteger(message.version)) - return "version: integer expected"; - if (message.bindings != null && message.hasOwnProperty("bindings")) { - if (!Array.isArray(message.bindings)) - return "bindings: array expected"; - for (var i = 0; i < message.bindings.length; ++i) { - var error = $root.google.iam.v1.Binding.verify(message.bindings[i]); - if (error) - return "bindings." + error; - } - } - if (message.auditConfigs != null && message.hasOwnProperty("auditConfigs")) { - if (!Array.isArray(message.auditConfigs)) - return "auditConfigs: array expected"; - for (var i = 0; i < message.auditConfigs.length; ++i) { - var error = $root.google.iam.v1.AuditConfig.verify(message.auditConfigs[i]); - if (error) - return "auditConfigs." + error; - } - } - if (message.etag != null && message.hasOwnProperty("etag")) - if (!(message.etag && typeof message.etag.length === "number" || $util.isString(message.etag))) - return "etag: buffer expected"; - return null; - }; - - /** - * Creates a Policy message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.iam.v1.Policy - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v1.Policy} Policy - */ - Policy.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.Policy) - return object; - var message = new $root.google.iam.v1.Policy(); - if (object.version != null) - message.version = object.version | 0; - if (object.bindings) { - if (!Array.isArray(object.bindings)) - throw TypeError(".google.iam.v1.Policy.bindings: array expected"); - message.bindings = []; - for (var i = 0; i < object.bindings.length; ++i) { - if (typeof object.bindings[i] !== "object") - throw TypeError(".google.iam.v1.Policy.bindings: object expected"); - message.bindings[i] = $root.google.iam.v1.Binding.fromObject(object.bindings[i]); - } - } - if (object.auditConfigs) { - if (!Array.isArray(object.auditConfigs)) - throw TypeError(".google.iam.v1.Policy.auditConfigs: array expected"); - message.auditConfigs = []; - for (var i = 0; i < object.auditConfigs.length; ++i) { - if (typeof object.auditConfigs[i] !== "object") - throw TypeError(".google.iam.v1.Policy.auditConfigs: object expected"); - message.auditConfigs[i] = $root.google.iam.v1.AuditConfig.fromObject(object.auditConfigs[i]); - } - } - if (object.etag != null) - if (typeof object.etag === "string") - $util.base64.decode(object.etag, message.etag = $util.newBuffer($util.base64.length(object.etag)), 0); - else if (object.etag.length >= 0) - message.etag = object.etag; - return message; - }; - - /** - * Creates a plain object from a Policy message. Also converts values to other types if specified. - * @function toObject - * @memberof google.iam.v1.Policy - * @static - * @param {google.iam.v1.Policy} message Policy - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Policy.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.bindings = []; - object.auditConfigs = []; - } - if (options.defaults) { - object.version = 0; - if (options.bytes === String) - object.etag = ""; - else { - object.etag = []; - if (options.bytes !== Array) - object.etag = $util.newBuffer(object.etag); - } - } - if (message.version != null && message.hasOwnProperty("version")) - object.version = message.version; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = options.bytes === String ? $util.base64.encode(message.etag, 0, message.etag.length) : options.bytes === Array ? Array.prototype.slice.call(message.etag) : message.etag; - if (message.bindings && message.bindings.length) { - object.bindings = []; - for (var j = 0; j < message.bindings.length; ++j) - object.bindings[j] = $root.google.iam.v1.Binding.toObject(message.bindings[j], options); - } - if (message.auditConfigs && message.auditConfigs.length) { - object.auditConfigs = []; - for (var j = 0; j < message.auditConfigs.length; ++j) - object.auditConfigs[j] = $root.google.iam.v1.AuditConfig.toObject(message.auditConfigs[j], options); - } - return object; - }; - - /** - * Converts this Policy to JSON. - * @function toJSON - * @memberof google.iam.v1.Policy - * @instance - * @returns {Object.} JSON object - */ - Policy.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Policy - * @function getTypeUrl - * @memberof google.iam.v1.Policy - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Policy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.iam.v1.Policy"; - }; - - return Policy; - })(); - - v1.Binding = (function() { - - /** - * Properties of a Binding. - * @memberof google.iam.v1 - * @interface IBinding - * @property {string|null} [role] Binding role - * @property {Array.|null} [members] Binding members - * @property {google.type.IExpr|null} [condition] Binding condition - */ - - /** - * Constructs a new Binding. - * @memberof google.iam.v1 - * @classdesc Represents a Binding. - * @implements IBinding - * @constructor - * @param {google.iam.v1.IBinding=} [properties] Properties to set - */ - function Binding(properties) { - this.members = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Binding role. - * @member {string} role - * @memberof google.iam.v1.Binding - * @instance - */ - Binding.prototype.role = ""; - - /** - * Binding members. - * @member {Array.} members - * @memberof google.iam.v1.Binding - * @instance - */ - Binding.prototype.members = $util.emptyArray; - - /** - * Binding condition. - * @member {google.type.IExpr|null|undefined} condition - * @memberof google.iam.v1.Binding - * @instance - */ - Binding.prototype.condition = null; - - /** - * Creates a new Binding instance using the specified properties. - * @function create - * @memberof google.iam.v1.Binding - * @static - * @param {google.iam.v1.IBinding=} [properties] Properties to set - * @returns {google.iam.v1.Binding} Binding instance - */ - Binding.create = function create(properties) { - return new Binding(properties); - }; - - /** - * Encodes the specified Binding message. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. - * @function encode - * @memberof google.iam.v1.Binding - * @static - * @param {google.iam.v1.IBinding} message Binding message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Binding.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.role != null && Object.hasOwnProperty.call(message, "role")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.role); - if (message.members != null && message.members.length) - for (var i = 0; i < message.members.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.members[i]); - if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) - $root.google.type.Expr.encode(message.condition, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Binding message, length delimited. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. - * @function encodeDelimited - * @memberof google.iam.v1.Binding - * @static - * @param {google.iam.v1.IBinding} message Binding message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Binding.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Binding message from the specified reader or buffer. - * @function decode - * @memberof google.iam.v1.Binding - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.Binding} Binding - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Binding.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.Binding(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.role = reader.string(); - break; - } - case 2: { - if (!(message.members && message.members.length)) - message.members = []; - message.members.push(reader.string()); - break; - } - case 3: { - message.condition = $root.google.type.Expr.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Binding message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.iam.v1.Binding - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.Binding} Binding - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Binding.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Binding message. - * @function verify - * @memberof google.iam.v1.Binding - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Binding.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.role != null && message.hasOwnProperty("role")) - if (!$util.isString(message.role)) - return "role: string expected"; - if (message.members != null && message.hasOwnProperty("members")) { - if (!Array.isArray(message.members)) - return "members: array expected"; - for (var i = 0; i < message.members.length; ++i) - if (!$util.isString(message.members[i])) - return "members: string[] expected"; - } - if (message.condition != null && message.hasOwnProperty("condition")) { - var error = $root.google.type.Expr.verify(message.condition); - if (error) - return "condition." + error; - } - return null; - }; - - /** - * Creates a Binding message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.iam.v1.Binding - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v1.Binding} Binding - */ - Binding.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.Binding) - return object; - var message = new $root.google.iam.v1.Binding(); - if (object.role != null) - message.role = String(object.role); - if (object.members) { - if (!Array.isArray(object.members)) - throw TypeError(".google.iam.v1.Binding.members: array expected"); - message.members = []; - for (var i = 0; i < object.members.length; ++i) - message.members[i] = String(object.members[i]); - } - if (object.condition != null) { - if (typeof object.condition !== "object") - throw TypeError(".google.iam.v1.Binding.condition: object expected"); - message.condition = $root.google.type.Expr.fromObject(object.condition); - } - return message; - }; - - /** - * Creates a plain object from a Binding message. Also converts values to other types if specified. - * @function toObject - * @memberof google.iam.v1.Binding - * @static - * @param {google.iam.v1.Binding} message Binding - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Binding.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.members = []; - if (options.defaults) { - object.role = ""; - object.condition = null; - } - if (message.role != null && message.hasOwnProperty("role")) - object.role = message.role; - if (message.members && message.members.length) { - object.members = []; - for (var j = 0; j < message.members.length; ++j) - object.members[j] = message.members[j]; - } - if (message.condition != null && message.hasOwnProperty("condition")) - object.condition = $root.google.type.Expr.toObject(message.condition, options); - return object; - }; - - /** - * Converts this Binding to JSON. - * @function toJSON - * @memberof google.iam.v1.Binding - * @instance - * @returns {Object.} JSON object - */ - Binding.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Binding - * @function getTypeUrl - * @memberof google.iam.v1.Binding - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Binding.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.iam.v1.Binding"; - }; - - return Binding; - })(); - - v1.AuditConfig = (function() { - - /** - * Properties of an AuditConfig. - * @memberof google.iam.v1 - * @interface IAuditConfig - * @property {string|null} [service] AuditConfig service - * @property {Array.|null} [auditLogConfigs] AuditConfig auditLogConfigs - */ - - /** - * Constructs a new AuditConfig. - * @memberof google.iam.v1 - * @classdesc Represents an AuditConfig. - * @implements IAuditConfig - * @constructor - * @param {google.iam.v1.IAuditConfig=} [properties] Properties to set - */ - function AuditConfig(properties) { - this.auditLogConfigs = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AuditConfig service. - * @member {string} service - * @memberof google.iam.v1.AuditConfig - * @instance - */ - AuditConfig.prototype.service = ""; - - /** - * AuditConfig auditLogConfigs. - * @member {Array.} auditLogConfigs - * @memberof google.iam.v1.AuditConfig - * @instance - */ - AuditConfig.prototype.auditLogConfigs = $util.emptyArray; - - /** - * Creates a new AuditConfig instance using the specified properties. - * @function create - * @memberof google.iam.v1.AuditConfig - * @static - * @param {google.iam.v1.IAuditConfig=} [properties] Properties to set - * @returns {google.iam.v1.AuditConfig} AuditConfig instance - */ - AuditConfig.create = function create(properties) { - return new AuditConfig(properties); - }; - - /** - * Encodes the specified AuditConfig message. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. - * @function encode - * @memberof google.iam.v1.AuditConfig - * @static - * @param {google.iam.v1.IAuditConfig} message AuditConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AuditConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.service != null && Object.hasOwnProperty.call(message, "service")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.service); - if (message.auditLogConfigs != null && message.auditLogConfigs.length) - for (var i = 0; i < message.auditLogConfigs.length; ++i) - $root.google.iam.v1.AuditLogConfig.encode(message.auditLogConfigs[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified AuditConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.iam.v1.AuditConfig - * @static - * @param {google.iam.v1.IAuditConfig} message AuditConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AuditConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AuditConfig message from the specified reader or buffer. - * @function decode - * @memberof google.iam.v1.AuditConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.AuditConfig} AuditConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AuditConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.AuditConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.service = reader.string(); - break; - } - case 3: { - if (!(message.auditLogConfigs && message.auditLogConfigs.length)) - message.auditLogConfigs = []; - message.auditLogConfigs.push($root.google.iam.v1.AuditLogConfig.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AuditConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.iam.v1.AuditConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.AuditConfig} AuditConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AuditConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AuditConfig message. - * @function verify - * @memberof google.iam.v1.AuditConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AuditConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.service != null && message.hasOwnProperty("service")) - if (!$util.isString(message.service)) - return "service: string expected"; - if (message.auditLogConfigs != null && message.hasOwnProperty("auditLogConfigs")) { - if (!Array.isArray(message.auditLogConfigs)) - return "auditLogConfigs: array expected"; - for (var i = 0; i < message.auditLogConfigs.length; ++i) { - var error = $root.google.iam.v1.AuditLogConfig.verify(message.auditLogConfigs[i]); - if (error) - return "auditLogConfigs." + error; - } - } - return null; - }; - - /** - * Creates an AuditConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.iam.v1.AuditConfig - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v1.AuditConfig} AuditConfig - */ - AuditConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.AuditConfig) - return object; - var message = new $root.google.iam.v1.AuditConfig(); - if (object.service != null) - message.service = String(object.service); - if (object.auditLogConfigs) { - if (!Array.isArray(object.auditLogConfigs)) - throw TypeError(".google.iam.v1.AuditConfig.auditLogConfigs: array expected"); - message.auditLogConfigs = []; - for (var i = 0; i < object.auditLogConfigs.length; ++i) { - if (typeof object.auditLogConfigs[i] !== "object") - throw TypeError(".google.iam.v1.AuditConfig.auditLogConfigs: object expected"); - message.auditLogConfigs[i] = $root.google.iam.v1.AuditLogConfig.fromObject(object.auditLogConfigs[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an AuditConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.iam.v1.AuditConfig - * @static - * @param {google.iam.v1.AuditConfig} message AuditConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AuditConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.auditLogConfigs = []; - if (options.defaults) - object.service = ""; - if (message.service != null && message.hasOwnProperty("service")) - object.service = message.service; - if (message.auditLogConfigs && message.auditLogConfigs.length) { - object.auditLogConfigs = []; - for (var j = 0; j < message.auditLogConfigs.length; ++j) - object.auditLogConfigs[j] = $root.google.iam.v1.AuditLogConfig.toObject(message.auditLogConfigs[j], options); - } - return object; - }; - - /** - * Converts this AuditConfig to JSON. - * @function toJSON - * @memberof google.iam.v1.AuditConfig - * @instance - * @returns {Object.} JSON object - */ - AuditConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AuditConfig - * @function getTypeUrl - * @memberof google.iam.v1.AuditConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AuditConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.iam.v1.AuditConfig"; - }; - - return AuditConfig; - })(); - - v1.AuditLogConfig = (function() { - - /** - * Properties of an AuditLogConfig. - * @memberof google.iam.v1 - * @interface IAuditLogConfig - * @property {google.iam.v1.AuditLogConfig.LogType|null} [logType] AuditLogConfig logType - * @property {Array.|null} [exemptedMembers] AuditLogConfig exemptedMembers - */ - - /** - * Constructs a new AuditLogConfig. - * @memberof google.iam.v1 - * @classdesc Represents an AuditLogConfig. - * @implements IAuditLogConfig - * @constructor - * @param {google.iam.v1.IAuditLogConfig=} [properties] Properties to set - */ - function AuditLogConfig(properties) { - this.exemptedMembers = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AuditLogConfig logType. - * @member {google.iam.v1.AuditLogConfig.LogType} logType - * @memberof google.iam.v1.AuditLogConfig - * @instance - */ - AuditLogConfig.prototype.logType = 0; - - /** - * AuditLogConfig exemptedMembers. - * @member {Array.} exemptedMembers - * @memberof google.iam.v1.AuditLogConfig - * @instance - */ - AuditLogConfig.prototype.exemptedMembers = $util.emptyArray; - - /** - * Creates a new AuditLogConfig instance using the specified properties. - * @function create - * @memberof google.iam.v1.AuditLogConfig - * @static - * @param {google.iam.v1.IAuditLogConfig=} [properties] Properties to set - * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig instance - */ - AuditLogConfig.create = function create(properties) { - return new AuditLogConfig(properties); - }; - - /** - * Encodes the specified AuditLogConfig message. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. - * @function encode - * @memberof google.iam.v1.AuditLogConfig - * @static - * @param {google.iam.v1.IAuditLogConfig} message AuditLogConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AuditLogConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.logType != null && Object.hasOwnProperty.call(message, "logType")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.logType); - if (message.exemptedMembers != null && message.exemptedMembers.length) - for (var i = 0; i < message.exemptedMembers.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.exemptedMembers[i]); - return writer; - }; - - /** - * Encodes the specified AuditLogConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.iam.v1.AuditLogConfig - * @static - * @param {google.iam.v1.IAuditLogConfig} message AuditLogConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AuditLogConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AuditLogConfig message from the specified reader or buffer. - * @function decode - * @memberof google.iam.v1.AuditLogConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AuditLogConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.AuditLogConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.logType = reader.int32(); - break; - } - case 2: { - if (!(message.exemptedMembers && message.exemptedMembers.length)) - message.exemptedMembers = []; - message.exemptedMembers.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AuditLogConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.iam.v1.AuditLogConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AuditLogConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AuditLogConfig message. - * @function verify - * @memberof google.iam.v1.AuditLogConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AuditLogConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.logType != null && message.hasOwnProperty("logType")) - switch (message.logType) { - default: - return "logType: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.exemptedMembers != null && message.hasOwnProperty("exemptedMembers")) { - if (!Array.isArray(message.exemptedMembers)) - return "exemptedMembers: array expected"; - for (var i = 0; i < message.exemptedMembers.length; ++i) - if (!$util.isString(message.exemptedMembers[i])) - return "exemptedMembers: string[] expected"; - } - return null; - }; - - /** - * Creates an AuditLogConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.iam.v1.AuditLogConfig - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig - */ - AuditLogConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.AuditLogConfig) - return object; - var message = new $root.google.iam.v1.AuditLogConfig(); - switch (object.logType) { - default: - if (typeof object.logType === "number") { - message.logType = object.logType; - break; - } - break; - case "LOG_TYPE_UNSPECIFIED": - case 0: - message.logType = 0; - break; - case "ADMIN_READ": - case 1: - message.logType = 1; - break; - case "DATA_WRITE": - case 2: - message.logType = 2; - break; - case "DATA_READ": - case 3: - message.logType = 3; - break; - } - if (object.exemptedMembers) { - if (!Array.isArray(object.exemptedMembers)) - throw TypeError(".google.iam.v1.AuditLogConfig.exemptedMembers: array expected"); - message.exemptedMembers = []; - for (var i = 0; i < object.exemptedMembers.length; ++i) - message.exemptedMembers[i] = String(object.exemptedMembers[i]); - } - return message; - }; - - /** - * Creates a plain object from an AuditLogConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.iam.v1.AuditLogConfig - * @static - * @param {google.iam.v1.AuditLogConfig} message AuditLogConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AuditLogConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.exemptedMembers = []; - if (options.defaults) - object.logType = options.enums === String ? "LOG_TYPE_UNSPECIFIED" : 0; - if (message.logType != null && message.hasOwnProperty("logType")) - object.logType = options.enums === String ? $root.google.iam.v1.AuditLogConfig.LogType[message.logType] === undefined ? message.logType : $root.google.iam.v1.AuditLogConfig.LogType[message.logType] : message.logType; - if (message.exemptedMembers && message.exemptedMembers.length) { - object.exemptedMembers = []; - for (var j = 0; j < message.exemptedMembers.length; ++j) - object.exemptedMembers[j] = message.exemptedMembers[j]; - } - return object; - }; - - /** - * Converts this AuditLogConfig to JSON. - * @function toJSON - * @memberof google.iam.v1.AuditLogConfig - * @instance - * @returns {Object.} JSON object - */ - AuditLogConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AuditLogConfig - * @function getTypeUrl - * @memberof google.iam.v1.AuditLogConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AuditLogConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.iam.v1.AuditLogConfig"; - }; - - /** - * LogType enum. - * @name google.iam.v1.AuditLogConfig.LogType - * @enum {number} - * @property {number} LOG_TYPE_UNSPECIFIED=0 LOG_TYPE_UNSPECIFIED value - * @property {number} ADMIN_READ=1 ADMIN_READ value - * @property {number} DATA_WRITE=2 DATA_WRITE value - * @property {number} DATA_READ=3 DATA_READ value - */ - AuditLogConfig.LogType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "LOG_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "ADMIN_READ"] = 1; - values[valuesById[2] = "DATA_WRITE"] = 2; - values[valuesById[3] = "DATA_READ"] = 3; - return values; - })(); - - return AuditLogConfig; - })(); - - v1.PolicyDelta = (function() { - - /** - * Properties of a PolicyDelta. - * @memberof google.iam.v1 - * @interface IPolicyDelta - * @property {Array.|null} [bindingDeltas] PolicyDelta bindingDeltas - * @property {Array.|null} [auditConfigDeltas] PolicyDelta auditConfigDeltas - */ - - /** - * Constructs a new PolicyDelta. - * @memberof google.iam.v1 - * @classdesc Represents a PolicyDelta. - * @implements IPolicyDelta - * @constructor - * @param {google.iam.v1.IPolicyDelta=} [properties] Properties to set - */ - function PolicyDelta(properties) { - this.bindingDeltas = []; - this.auditConfigDeltas = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PolicyDelta bindingDeltas. - * @member {Array.} bindingDeltas - * @memberof google.iam.v1.PolicyDelta - * @instance - */ - PolicyDelta.prototype.bindingDeltas = $util.emptyArray; - - /** - * PolicyDelta auditConfigDeltas. - * @member {Array.} auditConfigDeltas - * @memberof google.iam.v1.PolicyDelta - * @instance - */ - PolicyDelta.prototype.auditConfigDeltas = $util.emptyArray; - - /** - * Creates a new PolicyDelta instance using the specified properties. - * @function create - * @memberof google.iam.v1.PolicyDelta - * @static - * @param {google.iam.v1.IPolicyDelta=} [properties] Properties to set - * @returns {google.iam.v1.PolicyDelta} PolicyDelta instance - */ - PolicyDelta.create = function create(properties) { - return new PolicyDelta(properties); - }; - - /** - * Encodes the specified PolicyDelta message. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. - * @function encode - * @memberof google.iam.v1.PolicyDelta - * @static - * @param {google.iam.v1.IPolicyDelta} message PolicyDelta message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PolicyDelta.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.bindingDeltas != null && message.bindingDeltas.length) - for (var i = 0; i < message.bindingDeltas.length; ++i) - $root.google.iam.v1.BindingDelta.encode(message.bindingDeltas[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.auditConfigDeltas != null && message.auditConfigDeltas.length) - for (var i = 0; i < message.auditConfigDeltas.length; ++i) - $root.google.iam.v1.AuditConfigDelta.encode(message.auditConfigDeltas[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified PolicyDelta message, length delimited. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. - * @function encodeDelimited - * @memberof google.iam.v1.PolicyDelta - * @static - * @param {google.iam.v1.IPolicyDelta} message PolicyDelta message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PolicyDelta.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PolicyDelta message from the specified reader or buffer. - * @function decode - * @memberof google.iam.v1.PolicyDelta - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.PolicyDelta} PolicyDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PolicyDelta.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.PolicyDelta(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.bindingDeltas && message.bindingDeltas.length)) - message.bindingDeltas = []; - message.bindingDeltas.push($root.google.iam.v1.BindingDelta.decode(reader, reader.uint32())); - break; - } - case 2: { - if (!(message.auditConfigDeltas && message.auditConfigDeltas.length)) - message.auditConfigDeltas = []; - message.auditConfigDeltas.push($root.google.iam.v1.AuditConfigDelta.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PolicyDelta message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.iam.v1.PolicyDelta - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.PolicyDelta} PolicyDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PolicyDelta.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PolicyDelta message. - * @function verify - * @memberof google.iam.v1.PolicyDelta - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PolicyDelta.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.bindingDeltas != null && message.hasOwnProperty("bindingDeltas")) { - if (!Array.isArray(message.bindingDeltas)) - return "bindingDeltas: array expected"; - for (var i = 0; i < message.bindingDeltas.length; ++i) { - var error = $root.google.iam.v1.BindingDelta.verify(message.bindingDeltas[i]); - if (error) - return "bindingDeltas." + error; - } - } - if (message.auditConfigDeltas != null && message.hasOwnProperty("auditConfigDeltas")) { - if (!Array.isArray(message.auditConfigDeltas)) - return "auditConfigDeltas: array expected"; - for (var i = 0; i < message.auditConfigDeltas.length; ++i) { - var error = $root.google.iam.v1.AuditConfigDelta.verify(message.auditConfigDeltas[i]); - if (error) - return "auditConfigDeltas." + error; - } - } - return null; - }; - - /** - * Creates a PolicyDelta message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.iam.v1.PolicyDelta - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v1.PolicyDelta} PolicyDelta - */ - PolicyDelta.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.PolicyDelta) - return object; - var message = new $root.google.iam.v1.PolicyDelta(); - if (object.bindingDeltas) { - if (!Array.isArray(object.bindingDeltas)) - throw TypeError(".google.iam.v1.PolicyDelta.bindingDeltas: array expected"); - message.bindingDeltas = []; - for (var i = 0; i < object.bindingDeltas.length; ++i) { - if (typeof object.bindingDeltas[i] !== "object") - throw TypeError(".google.iam.v1.PolicyDelta.bindingDeltas: object expected"); - message.bindingDeltas[i] = $root.google.iam.v1.BindingDelta.fromObject(object.bindingDeltas[i]); - } - } - if (object.auditConfigDeltas) { - if (!Array.isArray(object.auditConfigDeltas)) - throw TypeError(".google.iam.v1.PolicyDelta.auditConfigDeltas: array expected"); - message.auditConfigDeltas = []; - for (var i = 0; i < object.auditConfigDeltas.length; ++i) { - if (typeof object.auditConfigDeltas[i] !== "object") - throw TypeError(".google.iam.v1.PolicyDelta.auditConfigDeltas: object expected"); - message.auditConfigDeltas[i] = $root.google.iam.v1.AuditConfigDelta.fromObject(object.auditConfigDeltas[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a PolicyDelta message. Also converts values to other types if specified. - * @function toObject - * @memberof google.iam.v1.PolicyDelta - * @static - * @param {google.iam.v1.PolicyDelta} message PolicyDelta - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PolicyDelta.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.bindingDeltas = []; - object.auditConfigDeltas = []; - } - if (message.bindingDeltas && message.bindingDeltas.length) { - object.bindingDeltas = []; - for (var j = 0; j < message.bindingDeltas.length; ++j) - object.bindingDeltas[j] = $root.google.iam.v1.BindingDelta.toObject(message.bindingDeltas[j], options); - } - if (message.auditConfigDeltas && message.auditConfigDeltas.length) { - object.auditConfigDeltas = []; - for (var j = 0; j < message.auditConfigDeltas.length; ++j) - object.auditConfigDeltas[j] = $root.google.iam.v1.AuditConfigDelta.toObject(message.auditConfigDeltas[j], options); - } - return object; - }; - - /** - * Converts this PolicyDelta to JSON. - * @function toJSON - * @memberof google.iam.v1.PolicyDelta - * @instance - * @returns {Object.} JSON object - */ - PolicyDelta.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PolicyDelta - * @function getTypeUrl - * @memberof google.iam.v1.PolicyDelta - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PolicyDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.iam.v1.PolicyDelta"; - }; - - return PolicyDelta; - })(); - - v1.BindingDelta = (function() { - - /** - * Properties of a BindingDelta. - * @memberof google.iam.v1 - * @interface IBindingDelta - * @property {google.iam.v1.BindingDelta.Action|null} [action] BindingDelta action - * @property {string|null} [role] BindingDelta role - * @property {string|null} [member] BindingDelta member - * @property {google.type.IExpr|null} [condition] BindingDelta condition - */ - - /** - * Constructs a new BindingDelta. - * @memberof google.iam.v1 - * @classdesc Represents a BindingDelta. - * @implements IBindingDelta - * @constructor - * @param {google.iam.v1.IBindingDelta=} [properties] Properties to set - */ - function BindingDelta(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BindingDelta action. - * @member {google.iam.v1.BindingDelta.Action} action - * @memberof google.iam.v1.BindingDelta - * @instance - */ - BindingDelta.prototype.action = 0; - - /** - * BindingDelta role. - * @member {string} role - * @memberof google.iam.v1.BindingDelta - * @instance - */ - BindingDelta.prototype.role = ""; - - /** - * BindingDelta member. - * @member {string} member - * @memberof google.iam.v1.BindingDelta - * @instance - */ - BindingDelta.prototype.member = ""; - - /** - * BindingDelta condition. - * @member {google.type.IExpr|null|undefined} condition - * @memberof google.iam.v1.BindingDelta - * @instance - */ - BindingDelta.prototype.condition = null; - - /** - * Creates a new BindingDelta instance using the specified properties. - * @function create - * @memberof google.iam.v1.BindingDelta - * @static - * @param {google.iam.v1.IBindingDelta=} [properties] Properties to set - * @returns {google.iam.v1.BindingDelta} BindingDelta instance - */ - BindingDelta.create = function create(properties) { - return new BindingDelta(properties); - }; - - /** - * Encodes the specified BindingDelta message. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. - * @function encode - * @memberof google.iam.v1.BindingDelta - * @static - * @param {google.iam.v1.IBindingDelta} message BindingDelta message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BindingDelta.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.action != null && Object.hasOwnProperty.call(message, "action")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); - if (message.role != null && Object.hasOwnProperty.call(message, "role")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.role); - if (message.member != null && Object.hasOwnProperty.call(message, "member")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.member); - if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) - $root.google.type.Expr.encode(message.condition, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified BindingDelta message, length delimited. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. - * @function encodeDelimited - * @memberof google.iam.v1.BindingDelta - * @static - * @param {google.iam.v1.IBindingDelta} message BindingDelta message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BindingDelta.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BindingDelta message from the specified reader or buffer. - * @function decode - * @memberof google.iam.v1.BindingDelta - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.BindingDelta} BindingDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BindingDelta.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.BindingDelta(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.action = reader.int32(); - break; - } - case 2: { - message.role = reader.string(); - break; - } - case 3: { - message.member = reader.string(); - break; - } - case 4: { - message.condition = $root.google.type.Expr.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BindingDelta message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.iam.v1.BindingDelta - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.BindingDelta} BindingDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BindingDelta.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BindingDelta message. - * @function verify - * @memberof google.iam.v1.BindingDelta - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BindingDelta.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.action != null && message.hasOwnProperty("action")) - switch (message.action) { - default: - return "action: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.role != null && message.hasOwnProperty("role")) - if (!$util.isString(message.role)) - return "role: string expected"; - if (message.member != null && message.hasOwnProperty("member")) - if (!$util.isString(message.member)) - return "member: string expected"; - if (message.condition != null && message.hasOwnProperty("condition")) { - var error = $root.google.type.Expr.verify(message.condition); - if (error) - return "condition." + error; - } - return null; - }; - - /** - * Creates a BindingDelta message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.iam.v1.BindingDelta - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v1.BindingDelta} BindingDelta - */ - BindingDelta.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.BindingDelta) - return object; - var message = new $root.google.iam.v1.BindingDelta(); - switch (object.action) { - default: - if (typeof object.action === "number") { - message.action = object.action; - break; - } - break; - case "ACTION_UNSPECIFIED": - case 0: - message.action = 0; - break; - case "ADD": - case 1: - message.action = 1; - break; - case "REMOVE": - case 2: - message.action = 2; - break; - } - if (object.role != null) - message.role = String(object.role); - if (object.member != null) - message.member = String(object.member); - if (object.condition != null) { - if (typeof object.condition !== "object") - throw TypeError(".google.iam.v1.BindingDelta.condition: object expected"); - message.condition = $root.google.type.Expr.fromObject(object.condition); - } - return message; - }; - - /** - * Creates a plain object from a BindingDelta message. Also converts values to other types if specified. - * @function toObject - * @memberof google.iam.v1.BindingDelta - * @static - * @param {google.iam.v1.BindingDelta} message BindingDelta - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BindingDelta.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.action = options.enums === String ? "ACTION_UNSPECIFIED" : 0; - object.role = ""; - object.member = ""; - object.condition = null; - } - if (message.action != null && message.hasOwnProperty("action")) - object.action = options.enums === String ? $root.google.iam.v1.BindingDelta.Action[message.action] === undefined ? message.action : $root.google.iam.v1.BindingDelta.Action[message.action] : message.action; - if (message.role != null && message.hasOwnProperty("role")) - object.role = message.role; - if (message.member != null && message.hasOwnProperty("member")) - object.member = message.member; - if (message.condition != null && message.hasOwnProperty("condition")) - object.condition = $root.google.type.Expr.toObject(message.condition, options); - return object; - }; - - /** - * Converts this BindingDelta to JSON. - * @function toJSON - * @memberof google.iam.v1.BindingDelta - * @instance - * @returns {Object.} JSON object - */ - BindingDelta.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BindingDelta - * @function getTypeUrl - * @memberof google.iam.v1.BindingDelta - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BindingDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.iam.v1.BindingDelta"; - }; - - /** - * Action enum. - * @name google.iam.v1.BindingDelta.Action - * @enum {number} - * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value - * @property {number} ADD=1 ADD value - * @property {number} REMOVE=2 REMOVE value - */ - BindingDelta.Action = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ACTION_UNSPECIFIED"] = 0; - values[valuesById[1] = "ADD"] = 1; - values[valuesById[2] = "REMOVE"] = 2; - return values; - })(); - - return BindingDelta; - })(); - - v1.AuditConfigDelta = (function() { - - /** - * Properties of an AuditConfigDelta. - * @memberof google.iam.v1 - * @interface IAuditConfigDelta - * @property {google.iam.v1.AuditConfigDelta.Action|null} [action] AuditConfigDelta action - * @property {string|null} [service] AuditConfigDelta service - * @property {string|null} [exemptedMember] AuditConfigDelta exemptedMember - * @property {string|null} [logType] AuditConfigDelta logType - */ - - /** - * Constructs a new AuditConfigDelta. - * @memberof google.iam.v1 - * @classdesc Represents an AuditConfigDelta. - * @implements IAuditConfigDelta - * @constructor - * @param {google.iam.v1.IAuditConfigDelta=} [properties] Properties to set - */ - function AuditConfigDelta(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AuditConfigDelta action. - * @member {google.iam.v1.AuditConfigDelta.Action} action - * @memberof google.iam.v1.AuditConfigDelta - * @instance - */ - AuditConfigDelta.prototype.action = 0; - - /** - * AuditConfigDelta service. - * @member {string} service - * @memberof google.iam.v1.AuditConfigDelta - * @instance - */ - AuditConfigDelta.prototype.service = ""; - - /** - * AuditConfigDelta exemptedMember. - * @member {string} exemptedMember - * @memberof google.iam.v1.AuditConfigDelta - * @instance - */ - AuditConfigDelta.prototype.exemptedMember = ""; - - /** - * AuditConfigDelta logType. - * @member {string} logType - * @memberof google.iam.v1.AuditConfigDelta - * @instance - */ - AuditConfigDelta.prototype.logType = ""; - - /** - * Creates a new AuditConfigDelta instance using the specified properties. - * @function create - * @memberof google.iam.v1.AuditConfigDelta - * @static - * @param {google.iam.v1.IAuditConfigDelta=} [properties] Properties to set - * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta instance - */ - AuditConfigDelta.create = function create(properties) { - return new AuditConfigDelta(properties); - }; - - /** - * Encodes the specified AuditConfigDelta message. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. - * @function encode - * @memberof google.iam.v1.AuditConfigDelta - * @static - * @param {google.iam.v1.IAuditConfigDelta} message AuditConfigDelta message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AuditConfigDelta.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.action != null && Object.hasOwnProperty.call(message, "action")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); - if (message.service != null && Object.hasOwnProperty.call(message, "service")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.service); - if (message.exemptedMember != null && Object.hasOwnProperty.call(message, "exemptedMember")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.exemptedMember); - if (message.logType != null && Object.hasOwnProperty.call(message, "logType")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.logType); - return writer; - }; - - /** - * Encodes the specified AuditConfigDelta message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. - * @function encodeDelimited - * @memberof google.iam.v1.AuditConfigDelta - * @static - * @param {google.iam.v1.IAuditConfigDelta} message AuditConfigDelta message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AuditConfigDelta.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AuditConfigDelta message from the specified reader or buffer. - * @function decode - * @memberof google.iam.v1.AuditConfigDelta - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AuditConfigDelta.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.AuditConfigDelta(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.action = reader.int32(); - break; - } - case 2: { - message.service = reader.string(); - break; - } - case 3: { - message.exemptedMember = reader.string(); - break; - } - case 4: { - message.logType = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AuditConfigDelta message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.iam.v1.AuditConfigDelta - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AuditConfigDelta.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AuditConfigDelta message. - * @function verify - * @memberof google.iam.v1.AuditConfigDelta - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AuditConfigDelta.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.action != null && message.hasOwnProperty("action")) - switch (message.action) { - default: - return "action: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.service != null && message.hasOwnProperty("service")) - if (!$util.isString(message.service)) - return "service: string expected"; - if (message.exemptedMember != null && message.hasOwnProperty("exemptedMember")) - if (!$util.isString(message.exemptedMember)) - return "exemptedMember: string expected"; - if (message.logType != null && message.hasOwnProperty("logType")) - if (!$util.isString(message.logType)) - return "logType: string expected"; - return null; - }; - - /** - * Creates an AuditConfigDelta message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.iam.v1.AuditConfigDelta - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta - */ - AuditConfigDelta.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.AuditConfigDelta) - return object; - var message = new $root.google.iam.v1.AuditConfigDelta(); - switch (object.action) { - default: - if (typeof object.action === "number") { - message.action = object.action; - break; - } - break; - case "ACTION_UNSPECIFIED": - case 0: - message.action = 0; - break; - case "ADD": - case 1: - message.action = 1; - break; - case "REMOVE": - case 2: - message.action = 2; - break; - } - if (object.service != null) - message.service = String(object.service); - if (object.exemptedMember != null) - message.exemptedMember = String(object.exemptedMember); - if (object.logType != null) - message.logType = String(object.logType); - return message; - }; - - /** - * Creates a plain object from an AuditConfigDelta message. Also converts values to other types if specified. - * @function toObject - * @memberof google.iam.v1.AuditConfigDelta - * @static - * @param {google.iam.v1.AuditConfigDelta} message AuditConfigDelta - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AuditConfigDelta.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.action = options.enums === String ? "ACTION_UNSPECIFIED" : 0; - object.service = ""; - object.exemptedMember = ""; - object.logType = ""; - } - if (message.action != null && message.hasOwnProperty("action")) - object.action = options.enums === String ? $root.google.iam.v1.AuditConfigDelta.Action[message.action] === undefined ? message.action : $root.google.iam.v1.AuditConfigDelta.Action[message.action] : message.action; - if (message.service != null && message.hasOwnProperty("service")) - object.service = message.service; - if (message.exemptedMember != null && message.hasOwnProperty("exemptedMember")) - object.exemptedMember = message.exemptedMember; - if (message.logType != null && message.hasOwnProperty("logType")) - object.logType = message.logType; - return object; - }; - - /** - * Converts this AuditConfigDelta to JSON. - * @function toJSON - * @memberof google.iam.v1.AuditConfigDelta - * @instance - * @returns {Object.} JSON object - */ - AuditConfigDelta.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AuditConfigDelta - * @function getTypeUrl - * @memberof google.iam.v1.AuditConfigDelta - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AuditConfigDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.iam.v1.AuditConfigDelta"; - }; - - /** - * Action enum. - * @name google.iam.v1.AuditConfigDelta.Action - * @enum {number} - * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value - * @property {number} ADD=1 ADD value - * @property {number} REMOVE=2 REMOVE value - */ - AuditConfigDelta.Action = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ACTION_UNSPECIFIED"] = 0; - values[valuesById[1] = "ADD"] = 1; - values[valuesById[2] = "REMOVE"] = 2; - return values; - })(); - - return AuditConfigDelta; - })(); - - return v1; - })(); - - return iam; - })(); - - google.type = (function() { - - /** - * Namespace type. - * @memberof google - * @namespace - */ - var type = {}; - - type.Expr = (function() { - - /** - * Properties of an Expr. - * @memberof google.type - * @interface IExpr - * @property {string|null} [expression] Expr expression - * @property {string|null} [title] Expr title - * @property {string|null} [description] Expr description - * @property {string|null} [location] Expr location - */ - - /** - * Constructs a new Expr. - * @memberof google.type - * @classdesc Represents an Expr. - * @implements IExpr - * @constructor - * @param {google.type.IExpr=} [properties] Properties to set - */ - function Expr(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Expr expression. - * @member {string} expression - * @memberof google.type.Expr - * @instance - */ - Expr.prototype.expression = ""; - - /** - * Expr title. - * @member {string} title - * @memberof google.type.Expr - * @instance - */ - Expr.prototype.title = ""; - - /** - * Expr description. - * @member {string} description - * @memberof google.type.Expr - * @instance - */ - Expr.prototype.description = ""; - - /** - * Expr location. - * @member {string} location - * @memberof google.type.Expr - * @instance - */ - Expr.prototype.location = ""; - - /** - * Creates a new Expr instance using the specified properties. - * @function create - * @memberof google.type.Expr - * @static - * @param {google.type.IExpr=} [properties] Properties to set - * @returns {google.type.Expr} Expr instance - */ - Expr.create = function create(properties) { - return new Expr(properties); - }; - - /** - * Encodes the specified Expr message. Does not implicitly {@link google.type.Expr.verify|verify} messages. - * @function encode - * @memberof google.type.Expr - * @static - * @param {google.type.IExpr} message Expr message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Expr.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.expression != null && Object.hasOwnProperty.call(message, "expression")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.expression); - if (message.title != null && Object.hasOwnProperty.call(message, "title")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.title); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); - if (message.location != null && Object.hasOwnProperty.call(message, "location")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.location); - return writer; - }; - - /** - * Encodes the specified Expr message, length delimited. Does not implicitly {@link google.type.Expr.verify|verify} messages. - * @function encodeDelimited - * @memberof google.type.Expr - * @static - * @param {google.type.IExpr} message Expr message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Expr.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Expr message from the specified reader or buffer. - * @function decode - * @memberof google.type.Expr - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.type.Expr} Expr - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Expr.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.Expr(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.expression = reader.string(); - break; - } - case 2: { - message.title = reader.string(); - break; - } - case 3: { - message.description = reader.string(); - break; - } - case 4: { - message.location = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Expr message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.type.Expr - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.type.Expr} Expr - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Expr.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Expr message. - * @function verify - * @memberof google.type.Expr - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Expr.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.expression != null && message.hasOwnProperty("expression")) - if (!$util.isString(message.expression)) - return "expression: string expected"; - if (message.title != null && message.hasOwnProperty("title")) - if (!$util.isString(message.title)) - return "title: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.location != null && message.hasOwnProperty("location")) - if (!$util.isString(message.location)) - return "location: string expected"; - return null; - }; - - /** - * Creates an Expr message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.type.Expr - * @static - * @param {Object.} object Plain object - * @returns {google.type.Expr} Expr - */ - Expr.fromObject = function fromObject(object) { - if (object instanceof $root.google.type.Expr) - return object; - var message = new $root.google.type.Expr(); - if (object.expression != null) - message.expression = String(object.expression); - if (object.title != null) - message.title = String(object.title); - if (object.description != null) - message.description = String(object.description); - if (object.location != null) - message.location = String(object.location); - return message; - }; - - /** - * Creates a plain object from an Expr message. Also converts values to other types if specified. - * @function toObject - * @memberof google.type.Expr - * @static - * @param {google.type.Expr} message Expr - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Expr.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.expression = ""; - object.title = ""; - object.description = ""; - object.location = ""; - } - if (message.expression != null && message.hasOwnProperty("expression")) - object.expression = message.expression; - if (message.title != null && message.hasOwnProperty("title")) - object.title = message.title; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.location != null && message.hasOwnProperty("location")) - object.location = message.location; - return object; - }; - - /** - * Converts this Expr to JSON. - * @function toJSON - * @memberof google.type.Expr - * @instance - * @returns {Object.} JSON object - */ - Expr.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Expr - * @function getTypeUrl - * @memberof google.type.Expr - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Expr.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.type.Expr"; - }; - - return Expr; - })(); - - return type; - })(); - - return google; - })(); - - return $root; -}); diff --git a/owl-bot-staging/executor/v1/protos/protos.json b/owl-bot-staging/executor/v1/protos/protos.json deleted file mode 100644 index 43bf0a679..000000000 --- a/owl-bot-staging/executor/v1/protos/protos.json +++ /dev/null @@ -1,10772 +0,0 @@ -{ - "nested": { - "google": { - "nested": { - "spanner": { - "nested": { - "admin": { - "nested": { - "database": { - "nested": { - "v1": { - "options": { - "csharp_namespace": "Google.Cloud.Spanner.Admin.Database.V1", - "go_package": "cloud.google.com/go/spanner/admin/database/apiv1/databasepb;databasepb", - "java_multiple_files": true, - "java_outer_classname": "SpannerDatabaseAdminProto", - "java_package": "com.google.spanner.admin.database.v1", - "php_namespace": "Google\\Cloud\\Spanner\\Admin\\Database\\V1", - "ruby_package": "Google::Cloud::Spanner::Admin::Database::V1", - "(google.api.resource_definition).type": "spanner.googleapis.com/InstancePartition", - "(google.api.resource_definition).pattern": "projects/{project}/instances/{instance}/instancePartitions/{instance_partition}" - }, - "nested": { - "Backup": { - "options": { - "(google.api.resource).type": "spanner.googleapis.com/Backup", - "(google.api.resource).pattern": "projects/{project}/instances/{instance}/backups/{backup}" - }, - "fields": { - "database": { - "type": "string", - "id": 2, - "options": { - "(google.api.resource_reference).type": "spanner.googleapis.com/Database" - } - }, - "versionTime": { - "type": "google.protobuf.Timestamp", - "id": 9 - }, - "expireTime": { - "type": "google.protobuf.Timestamp", - "id": 3 - }, - "name": { - "type": "string", - "id": 1 - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "sizeBytes": { - "type": "int64", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "freeableSizeBytes": { - "type": "int64", - "id": 15, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "exclusiveSizeBytes": { - "type": "int64", - "id": 16, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "state": { - "type": "State", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "referencingDatabases": { - "rule": "repeated", - "type": "string", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "(google.api.resource_reference).type": "spanner.googleapis.com/Database" - } - }, - "encryptionInfo": { - "type": "EncryptionInfo", - "id": 8, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "encryptionInformation": { - "rule": "repeated", - "type": "EncryptionInfo", - "id": 13, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "databaseDialect": { - "type": "DatabaseDialect", - "id": 10, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "referencingBackups": { - "rule": "repeated", - "type": "string", - "id": 11, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "(google.api.resource_reference).type": "spanner.googleapis.com/Backup" - } - }, - "maxExpireTime": { - "type": "google.protobuf.Timestamp", - "id": 12, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "backupSchedules": { - "rule": "repeated", - "type": "string", - "id": 14, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "(google.api.resource_reference).type": "spanner.googleapis.com/BackupSchedule" - } - }, - "incrementalBackupChainId": { - "type": "string", - "id": 17, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "oldestVersionTime": { - "type": "google.protobuf.Timestamp", - "id": 18, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "instancePartitions": { - "rule": "repeated", - "type": "BackupInstancePartition", - "id": 19, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - }, - "nested": { - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "CREATING": 1, - "READY": 2 - } - } - } - }, - "CreateBackupRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/Instance" - } - }, - "backupId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "backup": { - "type": "Backup", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "encryptionConfig": { - "type": "CreateBackupEncryptionConfig", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "CreateBackupMetadata": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.resource_reference).type": "spanner.googleapis.com/Backup" - } - }, - "database": { - "type": "string", - "id": 2, - "options": { - "(google.api.resource_reference).type": "spanner.googleapis.com/Database" - } - }, - "progress": { - "type": "OperationProgress", - "id": 3 - }, - "cancelTime": { - "type": "google.protobuf.Timestamp", - "id": 4 - } - } - }, - "CopyBackupRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/Instance" - } - }, - "backupId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "sourceBackup": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/Backup" - } - }, - "expireTime": { - "type": "google.protobuf.Timestamp", - "id": 4, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "encryptionConfig": { - "type": "CopyBackupEncryptionConfig", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "CopyBackupMetadata": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.resource_reference).type": "spanner.googleapis.com/Backup" - } - }, - "sourceBackup": { - "type": "string", - "id": 2, - "options": { - "(google.api.resource_reference).type": "spanner.googleapis.com/Backup" - } - }, - "progress": { - "type": "OperationProgress", - "id": 3 - }, - "cancelTime": { - "type": "google.protobuf.Timestamp", - "id": 4 - } - } - }, - "UpdateBackupRequest": { - "fields": { - "backup": { - "type": "Backup", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "GetBackupRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/Backup" - } - } - } - }, - "DeleteBackupRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/Backup" - } - } - } - }, - "ListBackupsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/Instance" - } - }, - "filter": { - "type": "string", - "id": 2 - }, - "pageSize": { - "type": "int32", - "id": 3 - }, - "pageToken": { - "type": "string", - "id": 4 - } - } - }, - "ListBackupsResponse": { - "fields": { - "backups": { - "rule": "repeated", - "type": "Backup", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "ListBackupOperationsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/Instance" - } - }, - "filter": { - "type": "string", - "id": 2 - }, - "pageSize": { - "type": "int32", - "id": 3 - }, - "pageToken": { - "type": "string", - "id": 4 - } - } - }, - "ListBackupOperationsResponse": { - "fields": { - "operations": { - "rule": "repeated", - "type": "google.longrunning.Operation", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "BackupInfo": { - "fields": { - "backup": { - "type": "string", - "id": 1, - "options": { - "(google.api.resource_reference).type": "spanner.googleapis.com/Backup" - } - }, - "versionTime": { - "type": "google.protobuf.Timestamp", - "id": 4 - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 2 - }, - "sourceDatabase": { - "type": "string", - "id": 3, - "options": { - "(google.api.resource_reference).type": "spanner.googleapis.com/Database" - } - } - } - }, - "CreateBackupEncryptionConfig": { - "fields": { - "encryptionType": { - "type": "EncryptionType", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "kmsKeyName": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" - } - }, - "kmsKeyNames": { - "rule": "repeated", - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" - } - } - }, - "nested": { - "EncryptionType": { - "values": { - "ENCRYPTION_TYPE_UNSPECIFIED": 0, - "USE_DATABASE_ENCRYPTION": 1, - "GOOGLE_DEFAULT_ENCRYPTION": 2, - "CUSTOMER_MANAGED_ENCRYPTION": 3 - } - } - } - }, - "CopyBackupEncryptionConfig": { - "fields": { - "encryptionType": { - "type": "EncryptionType", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "kmsKeyName": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" - } - }, - "kmsKeyNames": { - "rule": "repeated", - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" - } - } - }, - "nested": { - "EncryptionType": { - "values": { - "ENCRYPTION_TYPE_UNSPECIFIED": 0, - "USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION": 1, - "GOOGLE_DEFAULT_ENCRYPTION": 2, - "CUSTOMER_MANAGED_ENCRYPTION": 3 - } - } - } - }, - "FullBackupSpec": { - "fields": {} - }, - "IncrementalBackupSpec": { - "fields": {} - }, - "BackupInstancePartition": { - "fields": { - "instancePartition": { - "type": "string", - "id": 1, - "options": { - "(google.api.resource_reference).type": "spanner.googleapis.com/InstancePartition" - } - } - } - }, - "OperationProgress": { - "fields": { - "progressPercent": { - "type": "int32", - "id": 1 - }, - "startTime": { - "type": "google.protobuf.Timestamp", - "id": 2 - }, - "endTime": { - "type": "google.protobuf.Timestamp", - "id": 3 - } - } - }, - "EncryptionConfig": { - "fields": { - "kmsKeyName": { - "type": "string", - "id": 2, - "options": { - "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" - } - }, - "kmsKeyNames": { - "rule": "repeated", - "type": "string", - "id": 3, - "options": { - "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" - } - } - } - }, - "EncryptionInfo": { - "fields": { - "encryptionType": { - "type": "Type", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "encryptionStatus": { - "type": "google.rpc.Status", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "kmsKeyVersion": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKeyVersion" - } - } - }, - "nested": { - "Type": { - "values": { - "TYPE_UNSPECIFIED": 0, - "GOOGLE_DEFAULT_ENCRYPTION": 1, - "CUSTOMER_MANAGED_ENCRYPTION": 2 - } - } - } - }, - "DatabaseDialect": { - "values": { - "DATABASE_DIALECT_UNSPECIFIED": 0, - "GOOGLE_STANDARD_SQL": 1, - "POSTGRESQL": 2 - } - }, - "BackupScheduleSpec": { - "oneofs": { - "scheduleSpec": { - "oneof": [ - "cronSpec" - ] - } - }, - "fields": { - "cronSpec": { - "type": "CrontabSpec", - "id": 1 - } - } - }, - "BackupSchedule": { - "options": { - "(google.api.resource).type": "spanner.googleapis.com/BackupSchedule", - "(google.api.resource).pattern": "projects/{project}/instances/{instance}/databases/{database}/backupSchedules/{schedule}", - "(google.api.resource).plural": "backupSchedules", - "(google.api.resource).singular": "backupSchedule" - }, - "oneofs": { - "backupTypeSpec": { - "oneof": [ - "fullBackupSpec", - "incrementalBackupSpec" - ] - } - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER" - } - }, - "spec": { - "type": "BackupScheduleSpec", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "retentionDuration": { - "type": "google.protobuf.Duration", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "encryptionConfig": { - "type": "CreateBackupEncryptionConfig", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "fullBackupSpec": { - "type": "FullBackupSpec", - "id": 7 - }, - "incrementalBackupSpec": { - "type": "IncrementalBackupSpec", - "id": 8 - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 9, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "CrontabSpec": { - "fields": { - "text": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "timeZone": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "creationWindow": { - "type": "google.protobuf.Duration", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "CreateBackupScheduleRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/Database" - } - }, - "backupScheduleId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "backupSchedule": { - "type": "BackupSchedule", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "GetBackupScheduleRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/BackupSchedule" - } - } - } - }, - "DeleteBackupScheduleRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/BackupSchedule" - } - } - } - }, - "ListBackupSchedulesRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/Database" - } - }, - "pageSize": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pageToken": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListBackupSchedulesResponse": { - "fields": { - "backupSchedules": { - "rule": "repeated", - "type": "BackupSchedule", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "UpdateBackupScheduleRequest": { - "fields": { - "backupSchedule": { - "type": "BackupSchedule", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "DatabaseAdmin": { - "options": { - "(google.api.default_host)": "spanner.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/spanner.admin" - }, - "methods": { - "ListDatabases": { - "requestType": "ListDatabasesRequest", - "responseType": "ListDatabasesResponse", - "options": { - "(google.api.http).get": "/v1/{parent=projects/*/instances/*}/databases", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=projects/*/instances/*}/databases" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "CreateDatabase": { - "requestType": "CreateDatabaseRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1/{parent=projects/*/instances/*}/databases", - "(google.api.http).body": "*", - "(google.api.method_signature)": "parent,create_statement", - "(google.longrunning.operation_info).response_type": "google.spanner.admin.database.v1.Database", - "(google.longrunning.operation_info).metadata_type": "google.spanner.admin.database.v1.CreateDatabaseMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{parent=projects/*/instances/*}/databases", - "body": "*" - } - }, - { - "(google.api.method_signature)": "parent,create_statement" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "google.spanner.admin.database.v1.Database", - "metadata_type": "google.spanner.admin.database.v1.CreateDatabaseMetadata" - } - } - ] - }, - "GetDatabase": { - "requestType": "GetDatabaseRequest", - "responseType": "Database", - "options": { - "(google.api.http).get": "/v1/{name=projects/*/instances/*/databases/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=projects/*/instances/*/databases/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "UpdateDatabase": { - "requestType": "UpdateDatabaseRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).patch": "/v1/{database.name=projects/*/instances/*/databases/*}", - "(google.api.http).body": "database", - "(google.api.method_signature)": "database,update_mask", - "(google.longrunning.operation_info).response_type": "Database", - "(google.longrunning.operation_info).metadata_type": "UpdateDatabaseMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v1/{database.name=projects/*/instances/*/databases/*}", - "body": "database" - } - }, - { - "(google.api.method_signature)": "database,update_mask" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "Database", - "metadata_type": "UpdateDatabaseMetadata" - } - } - ] - }, - "UpdateDatabaseDdl": { - "requestType": "UpdateDatabaseDdlRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).patch": "/v1/{database=projects/*/instances/*/databases/*}/ddl", - "(google.api.http).body": "*", - "(google.api.method_signature)": "database,statements", - "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", - "(google.longrunning.operation_info).metadata_type": "google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v1/{database=projects/*/instances/*/databases/*}/ddl", - "body": "*" - } - }, - { - "(google.api.method_signature)": "database,statements" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "google.protobuf.Empty", - "metadata_type": "google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata" - } - } - ] - }, - "DropDatabase": { - "requestType": "DropDatabaseRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v1/{database=projects/*/instances/*/databases/*}", - "(google.api.method_signature)": "database" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1/{database=projects/*/instances/*/databases/*}" - } - }, - { - "(google.api.method_signature)": "database" - } - ] - }, - "GetDatabaseDdl": { - "requestType": "GetDatabaseDdlRequest", - "responseType": "GetDatabaseDdlResponse", - "options": { - "(google.api.http).get": "/v1/{database=projects/*/instances/*/databases/*}/ddl", - "(google.api.method_signature)": "database" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{database=projects/*/instances/*/databases/*}/ddl" - } - }, - { - "(google.api.method_signature)": "database" - } - ] - }, - "SetIamPolicy": { - "requestType": "google.iam.v1.SetIamPolicyRequest", - "responseType": "google.iam.v1.Policy", - "options": { - "(google.api.http).post": "/v1/{resource=projects/*/instances/*/databases/*}:setIamPolicy", - "(google.api.http).body": "*", - "(google.api.http).additional_bindings.post": "/v1/{resource=projects/*/instances/*/databases/*/backupSchedules/*}:setIamPolicy", - "(google.api.http).additional_bindings.body": "*", - "(google.api.method_signature)": "resource,policy" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{resource=projects/*/instances/*/databases/*}:setIamPolicy", - "body": "*", - "additional_bindings": [ - { - "post": "/v1/{resource=projects/*/instances/*/backups/*}:setIamPolicy", - "body": "*" - }, - { - "post": "/v1/{resource=projects/*/instances/*/databases/*/backupSchedules/*}:setIamPolicy", - "body": "*" - } - ] - } - }, - { - "(google.api.method_signature)": "resource,policy" - } - ] - }, - "GetIamPolicy": { - "requestType": "google.iam.v1.GetIamPolicyRequest", - "responseType": "google.iam.v1.Policy", - "options": { - "(google.api.http).post": "/v1/{resource=projects/*/instances/*/databases/*}:getIamPolicy", - "(google.api.http).body": "*", - "(google.api.http).additional_bindings.post": "/v1/{resource=projects/*/instances/*/databases/*/backupSchedules/*}:getIamPolicy", - "(google.api.http).additional_bindings.body": "*", - "(google.api.method_signature)": "resource" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{resource=projects/*/instances/*/databases/*}:getIamPolicy", - "body": "*", - "additional_bindings": [ - { - "post": "/v1/{resource=projects/*/instances/*/backups/*}:getIamPolicy", - "body": "*" - }, - { - "post": "/v1/{resource=projects/*/instances/*/databases/*/backupSchedules/*}:getIamPolicy", - "body": "*" - } - ] - } - }, - { - "(google.api.method_signature)": "resource" - } - ] - }, - "TestIamPermissions": { - "requestType": "google.iam.v1.TestIamPermissionsRequest", - "responseType": "google.iam.v1.TestIamPermissionsResponse", - "options": { - "(google.api.http).post": "/v1/{resource=projects/*/instances/*/databases/*}:testIamPermissions", - "(google.api.http).body": "*", - "(google.api.http).additional_bindings.post": "/v1/{resource=projects/*/instances/*/databases/*/databaseRoles/*}:testIamPermissions", - "(google.api.http).additional_bindings.body": "*", - "(google.api.method_signature)": "resource,permissions" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{resource=projects/*/instances/*/databases/*}:testIamPermissions", - "body": "*", - "additional_bindings": [ - { - "post": "/v1/{resource=projects/*/instances/*/backups/*}:testIamPermissions", - "body": "*" - }, - { - "post": "/v1/{resource=projects/*/instances/*/databases/*/backupSchedules/*}:testIamPermissions", - "body": "*" - }, - { - "post": "/v1/{resource=projects/*/instances/*/databases/*/databaseRoles/*}:testIamPermissions", - "body": "*" - } - ] - } - }, - { - "(google.api.method_signature)": "resource,permissions" - } - ] - }, - "CreateBackup": { - "requestType": "CreateBackupRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1/{parent=projects/*/instances/*}/backups", - "(google.api.http).body": "backup", - "(google.api.method_signature)": "parent,backup,backup_id", - "(google.longrunning.operation_info).response_type": "google.spanner.admin.database.v1.Backup", - "(google.longrunning.operation_info).metadata_type": "google.spanner.admin.database.v1.CreateBackupMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{parent=projects/*/instances/*}/backups", - "body": "backup" - } - }, - { - "(google.api.method_signature)": "parent,backup,backup_id" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "google.spanner.admin.database.v1.Backup", - "metadata_type": "google.spanner.admin.database.v1.CreateBackupMetadata" - } - } - ] - }, - "CopyBackup": { - "requestType": "CopyBackupRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1/{parent=projects/*/instances/*}/backups:copy", - "(google.api.http).body": "*", - "(google.api.method_signature)": "parent,backup_id,source_backup,expire_time", - "(google.longrunning.operation_info).response_type": "google.spanner.admin.database.v1.Backup", - "(google.longrunning.operation_info).metadata_type": "google.spanner.admin.database.v1.CopyBackupMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{parent=projects/*/instances/*}/backups:copy", - "body": "*" - } - }, - { - "(google.api.method_signature)": "parent,backup_id,source_backup,expire_time" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "google.spanner.admin.database.v1.Backup", - "metadata_type": "google.spanner.admin.database.v1.CopyBackupMetadata" - } - } - ] - }, - "GetBackup": { - "requestType": "GetBackupRequest", - "responseType": "Backup", - "options": { - "(google.api.http).get": "/v1/{name=projects/*/instances/*/backups/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=projects/*/instances/*/backups/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "UpdateBackup": { - "requestType": "UpdateBackupRequest", - "responseType": "Backup", - "options": { - "(google.api.http).patch": "/v1/{backup.name=projects/*/instances/*/backups/*}", - "(google.api.http).body": "backup", - "(google.api.method_signature)": "backup,update_mask" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v1/{backup.name=projects/*/instances/*/backups/*}", - "body": "backup" - } - }, - { - "(google.api.method_signature)": "backup,update_mask" - } - ] - }, - "DeleteBackup": { - "requestType": "DeleteBackupRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v1/{name=projects/*/instances/*/backups/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1/{name=projects/*/instances/*/backups/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListBackups": { - "requestType": "ListBackupsRequest", - "responseType": "ListBackupsResponse", - "options": { - "(google.api.http).get": "/v1/{parent=projects/*/instances/*}/backups", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=projects/*/instances/*}/backups" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "RestoreDatabase": { - "requestType": "RestoreDatabaseRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1/{parent=projects/*/instances/*}/databases:restore", - "(google.api.http).body": "*", - "(google.api.method_signature)": "parent,database_id,backup", - "(google.longrunning.operation_info).response_type": "google.spanner.admin.database.v1.Database", - "(google.longrunning.operation_info).metadata_type": "google.spanner.admin.database.v1.RestoreDatabaseMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{parent=projects/*/instances/*}/databases:restore", - "body": "*" - } - }, - { - "(google.api.method_signature)": "parent,database_id,backup" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "google.spanner.admin.database.v1.Database", - "metadata_type": "google.spanner.admin.database.v1.RestoreDatabaseMetadata" - } - } - ] - }, - "ListDatabaseOperations": { - "requestType": "ListDatabaseOperationsRequest", - "responseType": "ListDatabaseOperationsResponse", - "options": { - "(google.api.http).get": "/v1/{parent=projects/*/instances/*}/databaseOperations", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=projects/*/instances/*}/databaseOperations" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "ListBackupOperations": { - "requestType": "ListBackupOperationsRequest", - "responseType": "ListBackupOperationsResponse", - "options": { - "(google.api.http).get": "/v1/{parent=projects/*/instances/*}/backupOperations", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=projects/*/instances/*}/backupOperations" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "ListDatabaseRoles": { - "requestType": "ListDatabaseRolesRequest", - "responseType": "ListDatabaseRolesResponse", - "options": { - "(google.api.http).get": "/v1/{parent=projects/*/instances/*/databases/*}/databaseRoles", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=projects/*/instances/*/databases/*}/databaseRoles" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "AddSplitPoints": { - "requestType": "AddSplitPointsRequest", - "responseType": "AddSplitPointsResponse", - "options": { - "(google.api.http).post": "/v1/{database=projects/*/instances/*/databases/*}:addSplitPoints", - "(google.api.http).body": "*", - "(google.api.method_signature)": "database,split_points" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{database=projects/*/instances/*/databases/*}:addSplitPoints", - "body": "*" - } - }, - { - "(google.api.method_signature)": "database,split_points" - } - ] - }, - "CreateBackupSchedule": { - "requestType": "CreateBackupScheduleRequest", - "responseType": "BackupSchedule", - "options": { - "(google.api.http).post": "/v1/{parent=projects/*/instances/*/databases/*}/backupSchedules", - "(google.api.http).body": "backup_schedule", - "(google.api.method_signature)": "parent,backup_schedule,backup_schedule_id" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{parent=projects/*/instances/*/databases/*}/backupSchedules", - "body": "backup_schedule" - } - }, - { - "(google.api.method_signature)": "parent,backup_schedule,backup_schedule_id" - } - ] - }, - "GetBackupSchedule": { - "requestType": "GetBackupScheduleRequest", - "responseType": "BackupSchedule", - "options": { - "(google.api.http).get": "/v1/{name=projects/*/instances/*/databases/*/backupSchedules/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=projects/*/instances/*/databases/*/backupSchedules/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "UpdateBackupSchedule": { - "requestType": "UpdateBackupScheduleRequest", - "responseType": "BackupSchedule", - "options": { - "(google.api.http).patch": "/v1/{backup_schedule.name=projects/*/instances/*/databases/*/backupSchedules/*}", - "(google.api.http).body": "backup_schedule", - "(google.api.method_signature)": "backup_schedule,update_mask" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v1/{backup_schedule.name=projects/*/instances/*/databases/*/backupSchedules/*}", - "body": "backup_schedule" - } - }, - { - "(google.api.method_signature)": "backup_schedule,update_mask" - } - ] - }, - "DeleteBackupSchedule": { - "requestType": "DeleteBackupScheduleRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v1/{name=projects/*/instances/*/databases/*/backupSchedules/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1/{name=projects/*/instances/*/databases/*/backupSchedules/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListBackupSchedules": { - "requestType": "ListBackupSchedulesRequest", - "responseType": "ListBackupSchedulesResponse", - "options": { - "(google.api.http).get": "/v1/{parent=projects/*/instances/*/databases/*}/backupSchedules", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=projects/*/instances/*/databases/*}/backupSchedules" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "InternalUpdateGraphOperation": { - "requestType": "InternalUpdateGraphOperationRequest", - "responseType": "InternalUpdateGraphOperationResponse", - "options": { - "(google.api.method_signature)": "database,operation_id" - }, - "parsedOptions": [ - { - "(google.api.method_signature)": "database,operation_id" - } - ] - } - } - }, - "RestoreInfo": { - "oneofs": { - "sourceInfo": { - "oneof": [ - "backupInfo" - ] - } - }, - "fields": { - "sourceType": { - "type": "RestoreSourceType", - "id": 1 - }, - "backupInfo": { - "type": "BackupInfo", - "id": 2 - } - } - }, - "Database": { - "options": { - "(google.api.resource).type": "spanner.googleapis.com/Database", - "(google.api.resource).pattern": "projects/{project}/instances/{instance}/databases/{database}" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "state": { - "type": "State", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "restoreInfo": { - "type": "RestoreInfo", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "encryptionConfig": { - "type": "EncryptionConfig", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "encryptionInfo": { - "rule": "repeated", - "type": "EncryptionInfo", - "id": 8, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "versionRetentionPeriod": { - "type": "string", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "earliestVersionTime": { - "type": "google.protobuf.Timestamp", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "defaultLeader": { - "type": "string", - "id": 9, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "databaseDialect": { - "type": "DatabaseDialect", - "id": 10, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "enableDropProtection": { - "type": "bool", - "id": 11 - }, - "reconciling": { - "type": "bool", - "id": 12, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - }, - "nested": { - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "CREATING": 1, - "READY": 2, - "READY_OPTIMIZING": 3 - } - } - } - }, - "ListDatabasesRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/Instance" - } - }, - "pageSize": { - "type": "int32", - "id": 3 - }, - "pageToken": { - "type": "string", - "id": 4 - } - } - }, - "ListDatabasesResponse": { - "fields": { - "databases": { - "rule": "repeated", - "type": "Database", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "CreateDatabaseRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/Instance" - } - }, - "createStatement": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "extraStatements": { - "rule": "repeated", - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "encryptionConfig": { - "type": "EncryptionConfig", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "databaseDialect": { - "type": "DatabaseDialect", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "protoDescriptors": { - "type": "bytes", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "CreateDatabaseMetadata": { - "fields": { - "database": { - "type": "string", - "id": 1, - "options": { - "(google.api.resource_reference).type": "spanner.googleapis.com/Database" - } - } - } - }, - "GetDatabaseRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/Database" - } - } - } - }, - "UpdateDatabaseRequest": { - "fields": { - "database": { - "type": "Database", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "UpdateDatabaseMetadata": { - "fields": { - "request": { - "type": "UpdateDatabaseRequest", - "id": 1 - }, - "progress": { - "type": "OperationProgress", - "id": 2 - }, - "cancelTime": { - "type": "google.protobuf.Timestamp", - "id": 3 - } - } - }, - "UpdateDatabaseDdlRequest": { - "fields": { - "database": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/Database" - } - }, - "statements": { - "rule": "repeated", - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "operationId": { - "type": "string", - "id": 3 - }, - "protoDescriptors": { - "type": "bytes", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "throughputMode": { - "type": "bool", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "DdlStatementActionInfo": { - "fields": { - "action": { - "type": "string", - "id": 1 - }, - "entityType": { - "type": "string", - "id": 2 - }, - "entityNames": { - "rule": "repeated", - "type": "string", - "id": 3 - } - } - }, - "UpdateDatabaseDdlMetadata": { - "fields": { - "database": { - "type": "string", - "id": 1, - "options": { - "(google.api.resource_reference).type": "spanner.googleapis.com/Database" - } - }, - "statements": { - "rule": "repeated", - "type": "string", - "id": 2 - }, - "commitTimestamps": { - "rule": "repeated", - "type": "google.protobuf.Timestamp", - "id": 3 - }, - "throttled": { - "type": "bool", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "progress": { - "rule": "repeated", - "type": "OperationProgress", - "id": 5 - }, - "actions": { - "rule": "repeated", - "type": "DdlStatementActionInfo", - "id": 6 - } - } - }, - "DropDatabaseRequest": { - "fields": { - "database": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/Database" - } - } - } - }, - "GetDatabaseDdlRequest": { - "fields": { - "database": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/Database" - } - } - } - }, - "GetDatabaseDdlResponse": { - "fields": { - "statements": { - "rule": "repeated", - "type": "string", - "id": 1 - }, - "protoDescriptors": { - "type": "bytes", - "id": 2 - } - } - }, - "ListDatabaseOperationsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/Instance" - } - }, - "filter": { - "type": "string", - "id": 2 - }, - "pageSize": { - "type": "int32", - "id": 3 - }, - "pageToken": { - "type": "string", - "id": 4 - } - } - }, - "ListDatabaseOperationsResponse": { - "fields": { - "operations": { - "rule": "repeated", - "type": "google.longrunning.Operation", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "RestoreDatabaseRequest": { - "oneofs": { - "source": { - "oneof": [ - "backup" - ] - } - }, - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/Instance" - } - }, - "databaseId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "backup": { - "type": "string", - "id": 3, - "options": { - "(google.api.resource_reference).type": "spanner.googleapis.com/Backup" - } - }, - "encryptionConfig": { - "type": "RestoreDatabaseEncryptionConfig", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "RestoreDatabaseEncryptionConfig": { - "fields": { - "encryptionType": { - "type": "EncryptionType", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "kmsKeyName": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" - } - }, - "kmsKeyNames": { - "rule": "repeated", - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" - } - } - }, - "nested": { - "EncryptionType": { - "values": { - "ENCRYPTION_TYPE_UNSPECIFIED": 0, - "USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION": 1, - "GOOGLE_DEFAULT_ENCRYPTION": 2, - "CUSTOMER_MANAGED_ENCRYPTION": 3 - } - } - } - }, - "RestoreDatabaseMetadata": { - "oneofs": { - "sourceInfo": { - "oneof": [ - "backupInfo" - ] - } - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.resource_reference).type": "spanner.googleapis.com/Database" - } - }, - "sourceType": { - "type": "RestoreSourceType", - "id": 2 - }, - "backupInfo": { - "type": "BackupInfo", - "id": 3 - }, - "progress": { - "type": "OperationProgress", - "id": 4 - }, - "cancelTime": { - "type": "google.protobuf.Timestamp", - "id": 5 - }, - "optimizeDatabaseOperationName": { - "type": "string", - "id": 6 - } - } - }, - "OptimizeRestoredDatabaseMetadata": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.resource_reference).type": "spanner.googleapis.com/Database" - } - }, - "progress": { - "type": "OperationProgress", - "id": 2 - } - } - }, - "RestoreSourceType": { - "values": { - "TYPE_UNSPECIFIED": 0, - "BACKUP": 1 - } - }, - "DatabaseRole": { - "options": { - "(google.api.resource).type": "spanner.googleapis.com/DatabaseRole", - "(google.api.resource).pattern": "projects/{project}/instances/{instance}/databases/{database}/databaseRoles/{role}" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "ListDatabaseRolesRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/Database" - } - }, - "pageSize": { - "type": "int32", - "id": 2 - }, - "pageToken": { - "type": "string", - "id": 3 - } - } - }, - "ListDatabaseRolesResponse": { - "fields": { - "databaseRoles": { - "rule": "repeated", - "type": "DatabaseRole", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "AddSplitPointsRequest": { - "fields": { - "database": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/Database" - } - }, - "splitPoints": { - "rule": "repeated", - "type": "SplitPoints", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "initiator": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "AddSplitPointsResponse": { - "fields": {} - }, - "SplitPoints": { - "fields": { - "table": { - "type": "string", - "id": 1 - }, - "index": { - "type": "string", - "id": 2 - }, - "keys": { - "rule": "repeated", - "type": "Key", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "expireTime": { - "type": "google.protobuf.Timestamp", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "Key": { - "fields": { - "keyParts": { - "type": "google.protobuf.ListValue", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - } - } - }, - "InternalUpdateGraphOperationRequest": { - "fields": { - "database": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/Database" - } - }, - "operationId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "vmIdentityToken": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "progress": { - "type": "double", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "status": { - "type": "google.rpc.Status", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "InternalUpdateGraphOperationResponse": { - "fields": {} - } - } - } - } - }, - "instance": { - "nested": { - "v1": { - "options": { - "csharp_namespace": "Google.Cloud.Spanner.Admin.Instance.V1", - "go_package": "cloud.google.com/go/spanner/admin/instance/apiv1/instancepb;instancepb", - "java_multiple_files": true, - "java_outer_classname": "SpannerInstanceAdminProto", - "java_package": "com.google.spanner.admin.instance.v1", - "php_namespace": "Google\\Cloud\\Spanner\\Admin\\Instance\\V1", - "ruby_package": "Google::Cloud::Spanner::Admin::Instance::V1" - }, - "nested": { - "OperationProgress": { - "fields": { - "progressPercent": { - "type": "int32", - "id": 1 - }, - "startTime": { - "type": "google.protobuf.Timestamp", - "id": 2 - }, - "endTime": { - "type": "google.protobuf.Timestamp", - "id": 3 - } - } - }, - "FulfillmentPeriod": { - "values": { - "FULFILLMENT_PERIOD_UNSPECIFIED": 0, - "FULFILLMENT_PERIOD_NORMAL": 1, - "FULFILLMENT_PERIOD_EXTENDED": 2 - } - }, - "ReplicaSelection": { - "fields": { - "location": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "InstanceAdmin": { - "options": { - "(google.api.default_host)": "spanner.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/spanner.admin" - }, - "methods": { - "ListInstanceConfigs": { - "requestType": "ListInstanceConfigsRequest", - "responseType": "ListInstanceConfigsResponse", - "options": { - "(google.api.http).get": "/v1/{parent=projects/*}/instanceConfigs", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=projects/*}/instanceConfigs" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "GetInstanceConfig": { - "requestType": "GetInstanceConfigRequest", - "responseType": "InstanceConfig", - "options": { - "(google.api.http).get": "/v1/{name=projects/*/instanceConfigs/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=projects/*/instanceConfigs/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "CreateInstanceConfig": { - "requestType": "CreateInstanceConfigRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1/{parent=projects/*}/instanceConfigs", - "(google.api.http).body": "*", - "(google.api.method_signature)": "parent,instance_config,instance_config_id", - "(google.longrunning.operation_info).response_type": "google.spanner.admin.instance.v1.InstanceConfig", - "(google.longrunning.operation_info).metadata_type": "google.spanner.admin.instance.v1.CreateInstanceConfigMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{parent=projects/*}/instanceConfigs", - "body": "*" - } - }, - { - "(google.api.method_signature)": "parent,instance_config,instance_config_id" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "google.spanner.admin.instance.v1.InstanceConfig", - "metadata_type": "google.spanner.admin.instance.v1.CreateInstanceConfigMetadata" - } - } - ] - }, - "UpdateInstanceConfig": { - "requestType": "UpdateInstanceConfigRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).patch": "/v1/{instance_config.name=projects/*/instanceConfigs/*}", - "(google.api.http).body": "*", - "(google.api.method_signature)": "instance_config,update_mask", - "(google.longrunning.operation_info).response_type": "google.spanner.admin.instance.v1.InstanceConfig", - "(google.longrunning.operation_info).metadata_type": "google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v1/{instance_config.name=projects/*/instanceConfigs/*}", - "body": "*" - } - }, - { - "(google.api.method_signature)": "instance_config,update_mask" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "google.spanner.admin.instance.v1.InstanceConfig", - "metadata_type": "google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata" - } - } - ] - }, - "DeleteInstanceConfig": { - "requestType": "DeleteInstanceConfigRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v1/{name=projects/*/instanceConfigs/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1/{name=projects/*/instanceConfigs/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListInstanceConfigOperations": { - "requestType": "ListInstanceConfigOperationsRequest", - "responseType": "ListInstanceConfigOperationsResponse", - "options": { - "(google.api.http).get": "/v1/{parent=projects/*}/instanceConfigOperations", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=projects/*}/instanceConfigOperations" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "ListInstances": { - "requestType": "ListInstancesRequest", - "responseType": "ListInstancesResponse", - "options": { - "(google.api.http).get": "/v1/{parent=projects/*}/instances", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=projects/*}/instances" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "ListInstancePartitions": { - "requestType": "ListInstancePartitionsRequest", - "responseType": "ListInstancePartitionsResponse", - "options": { - "(google.api.http).get": "/v1/{parent=projects/*/instances/*}/instancePartitions", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=projects/*/instances/*}/instancePartitions" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "GetInstance": { - "requestType": "GetInstanceRequest", - "responseType": "Instance", - "options": { - "(google.api.http).get": "/v1/{name=projects/*/instances/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=projects/*/instances/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "CreateInstance": { - "requestType": "CreateInstanceRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1/{parent=projects/*}/instances", - "(google.api.http).body": "*", - "(google.api.method_signature)": "parent,instance_id,instance", - "(google.longrunning.operation_info).response_type": "google.spanner.admin.instance.v1.Instance", - "(google.longrunning.operation_info).metadata_type": "google.spanner.admin.instance.v1.CreateInstanceMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{parent=projects/*}/instances", - "body": "*" - } - }, - { - "(google.api.method_signature)": "parent,instance_id,instance" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "google.spanner.admin.instance.v1.Instance", - "metadata_type": "google.spanner.admin.instance.v1.CreateInstanceMetadata" - } - } - ] - }, - "UpdateInstance": { - "requestType": "UpdateInstanceRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).patch": "/v1/{instance.name=projects/*/instances/*}", - "(google.api.http).body": "*", - "(google.api.method_signature)": "instance,field_mask", - "(google.longrunning.operation_info).response_type": "google.spanner.admin.instance.v1.Instance", - "(google.longrunning.operation_info).metadata_type": "google.spanner.admin.instance.v1.UpdateInstanceMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v1/{instance.name=projects/*/instances/*}", - "body": "*" - } - }, - { - "(google.api.method_signature)": "instance,field_mask" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "google.spanner.admin.instance.v1.Instance", - "metadata_type": "google.spanner.admin.instance.v1.UpdateInstanceMetadata" - } - } - ] - }, - "DeleteInstance": { - "requestType": "DeleteInstanceRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v1/{name=projects/*/instances/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1/{name=projects/*/instances/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "SetIamPolicy": { - "requestType": "google.iam.v1.SetIamPolicyRequest", - "responseType": "google.iam.v1.Policy", - "options": { - "(google.api.http).post": "/v1/{resource=projects/*/instances/*}:setIamPolicy", - "(google.api.http).body": "*", - "(google.api.method_signature)": "resource,policy" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{resource=projects/*/instances/*}:setIamPolicy", - "body": "*" - } - }, - { - "(google.api.method_signature)": "resource,policy" - } - ] - }, - "GetIamPolicy": { - "requestType": "google.iam.v1.GetIamPolicyRequest", - "responseType": "google.iam.v1.Policy", - "options": { - "(google.api.http).post": "/v1/{resource=projects/*/instances/*}:getIamPolicy", - "(google.api.http).body": "*", - "(google.api.method_signature)": "resource" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{resource=projects/*/instances/*}:getIamPolicy", - "body": "*" - } - }, - { - "(google.api.method_signature)": "resource" - } - ] - }, - "TestIamPermissions": { - "requestType": "google.iam.v1.TestIamPermissionsRequest", - "responseType": "google.iam.v1.TestIamPermissionsResponse", - "options": { - "(google.api.http).post": "/v1/{resource=projects/*/instances/*}:testIamPermissions", - "(google.api.http).body": "*", - "(google.api.method_signature)": "resource,permissions" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{resource=projects/*/instances/*}:testIamPermissions", - "body": "*" - } - }, - { - "(google.api.method_signature)": "resource,permissions" - } - ] - }, - "GetInstancePartition": { - "requestType": "GetInstancePartitionRequest", - "responseType": "InstancePartition", - "options": { - "(google.api.http).get": "/v1/{name=projects/*/instances/*/instancePartitions/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=projects/*/instances/*/instancePartitions/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "CreateInstancePartition": { - "requestType": "CreateInstancePartitionRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1/{parent=projects/*/instances/*}/instancePartitions", - "(google.api.http).body": "*", - "(google.api.method_signature)": "parent,instance_partition,instance_partition_id", - "(google.longrunning.operation_info).response_type": "google.spanner.admin.instance.v1.InstancePartition", - "(google.longrunning.operation_info).metadata_type": "google.spanner.admin.instance.v1.CreateInstancePartitionMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{parent=projects/*/instances/*}/instancePartitions", - "body": "*" - } - }, - { - "(google.api.method_signature)": "parent,instance_partition,instance_partition_id" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "google.spanner.admin.instance.v1.InstancePartition", - "metadata_type": "google.spanner.admin.instance.v1.CreateInstancePartitionMetadata" - } - } - ] - }, - "DeleteInstancePartition": { - "requestType": "DeleteInstancePartitionRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v1/{name=projects/*/instances/*/instancePartitions/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1/{name=projects/*/instances/*/instancePartitions/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "UpdateInstancePartition": { - "requestType": "UpdateInstancePartitionRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).patch": "/v1/{instance_partition.name=projects/*/instances/*/instancePartitions/*}", - "(google.api.http).body": "*", - "(google.api.method_signature)": "instance_partition,field_mask", - "(google.longrunning.operation_info).response_type": "google.spanner.admin.instance.v1.InstancePartition", - "(google.longrunning.operation_info).metadata_type": "google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v1/{instance_partition.name=projects/*/instances/*/instancePartitions/*}", - "body": "*" - } - }, - { - "(google.api.method_signature)": "instance_partition,field_mask" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "google.spanner.admin.instance.v1.InstancePartition", - "metadata_type": "google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata" - } - } - ] - }, - "ListInstancePartitionOperations": { - "requestType": "ListInstancePartitionOperationsRequest", - "responseType": "ListInstancePartitionOperationsResponse", - "options": { - "(google.api.http).get": "/v1/{parent=projects/*/instances/*}/instancePartitionOperations", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=projects/*/instances/*}/instancePartitionOperations" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "MoveInstance": { - "requestType": "MoveInstanceRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1/{name=projects/*/instances/*}:move", - "(google.api.http).body": "*", - "(google.longrunning.operation_info).response_type": "google.spanner.admin.instance.v1.MoveInstanceResponse", - "(google.longrunning.operation_info).metadata_type": "google.spanner.admin.instance.v1.MoveInstanceMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{name=projects/*/instances/*}:move", - "body": "*" - } - }, - { - "(google.longrunning.operation_info)": { - "response_type": "google.spanner.admin.instance.v1.MoveInstanceResponse", - "metadata_type": "google.spanner.admin.instance.v1.MoveInstanceMetadata" - } - } - ] - } - } - }, - "ReplicaInfo": { - "fields": { - "location": { - "type": "string", - "id": 1 - }, - "type": { - "type": "ReplicaType", - "id": 2 - }, - "defaultLeaderLocation": { - "type": "bool", - "id": 3 - } - }, - "nested": { - "ReplicaType": { - "values": { - "TYPE_UNSPECIFIED": 0, - "READ_WRITE": 1, - "READ_ONLY": 2, - "WITNESS": 3 - } - } - } - }, - "InstanceConfig": { - "options": { - "(google.api.resource).type": "spanner.googleapis.com/InstanceConfig", - "(google.api.resource).pattern": "projects/{project}/instanceConfigs/{instance_config}", - "(google.api.resource).plural": "instanceConfigs", - "(google.api.resource).singular": "instanceConfig" - }, - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "displayName": { - "type": "string", - "id": 2 - }, - "configType": { - "type": "Type", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "replicas": { - "rule": "repeated", - "type": "ReplicaInfo", - "id": 3 - }, - "optionalReplicas": { - "rule": "repeated", - "type": "ReplicaInfo", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "baseConfig": { - "type": "string", - "id": 7, - "options": { - "(google.api.resource_reference).type": "spanner.googleapis.com/InstanceConfig" - } - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 8 - }, - "etag": { - "type": "string", - "id": 9 - }, - "leaderOptions": { - "rule": "repeated", - "type": "string", - "id": 4 - }, - "reconciling": { - "type": "bool", - "id": 10, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "state": { - "type": "State", - "id": 11, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "freeInstanceAvailability": { - "type": "FreeInstanceAvailability", - "id": 12, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "quorumType": { - "type": "QuorumType", - "id": 18, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "storageLimitPerProcessingUnit": { - "type": "int64", - "id": 19, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - }, - "nested": { - "Type": { - "values": { - "TYPE_UNSPECIFIED": 0, - "GOOGLE_MANAGED": 1, - "USER_MANAGED": 2 - } - }, - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "CREATING": 1, - "READY": 2 - } - }, - "FreeInstanceAvailability": { - "values": { - "FREE_INSTANCE_AVAILABILITY_UNSPECIFIED": 0, - "AVAILABLE": 1, - "UNSUPPORTED": 2, - "DISABLED": 3, - "QUOTA_EXCEEDED": 4 - } - }, - "QuorumType": { - "values": { - "QUORUM_TYPE_UNSPECIFIED": 0, - "REGION": 1, - "DUAL_REGION": 2, - "MULTI_REGION": 3 - } - } - } - }, - "ReplicaComputeCapacity": { - "oneofs": { - "computeCapacity": { - "oneof": [ - "nodeCount", - "processingUnits" - ] - } - }, - "fields": { - "replicaSelection": { - "type": "ReplicaSelection", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "nodeCount": { - "type": "int32", - "id": 2 - }, - "processingUnits": { - "type": "int32", - "id": 3 - } - } - }, - "AutoscalingConfig": { - "fields": { - "autoscalingLimits": { - "type": "AutoscalingLimits", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "autoscalingTargets": { - "type": "AutoscalingTargets", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "asymmetricAutoscalingOptions": { - "rule": "repeated", - "type": "AsymmetricAutoscalingOption", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "AutoscalingLimits": { - "oneofs": { - "minLimit": { - "oneof": [ - "minNodes", - "minProcessingUnits" - ] - }, - "maxLimit": { - "oneof": [ - "maxNodes", - "maxProcessingUnits" - ] - } - }, - "fields": { - "minNodes": { - "type": "int32", - "id": 1 - }, - "minProcessingUnits": { - "type": "int32", - "id": 2 - }, - "maxNodes": { - "type": "int32", - "id": 3 - }, - "maxProcessingUnits": { - "type": "int32", - "id": 4 - } - } - }, - "AutoscalingTargets": { - "fields": { - "highPriorityCpuUtilizationPercent": { - "type": "int32", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "totalCpuUtilizationPercent": { - "type": "int32", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "storageUtilizationPercent": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "AsymmetricAutoscalingOption": { - "fields": { - "replicaSelection": { - "type": "ReplicaSelection", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "overrides": { - "type": "AutoscalingConfigOverrides", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "AutoscalingConfigOverrides": { - "fields": { - "autoscalingLimits": { - "type": "AutoscalingLimits", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "autoscalingTargetHighPriorityCpuUtilizationPercent": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "autoscalingTargetTotalCpuUtilizationPercent": { - "type": "int32", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "disableHighPriorityCpuAutoscaling": { - "type": "bool", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "disableTotalCpuAutoscaling": { - "type": "bool", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - } - } - } - } - }, - "Instance": { - "options": { - "(google.api.resource).type": "spanner.googleapis.com/Instance", - "(google.api.resource).pattern": "projects/{project}/instances/{instance}", - "(google.api.resource).plural": "instances", - "(google.api.resource).singular": "instance" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "config": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/InstanceConfig" - } - }, - "displayName": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "nodeCount": { - "type": "int32", - "id": 5 - }, - "processingUnits": { - "type": "int32", - "id": 9 - }, - "replicaComputeCapacity": { - "rule": "repeated", - "type": "ReplicaComputeCapacity", - "id": 19, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "autoscalingConfig": { - "type": "AutoscalingConfig", - "id": 17, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "state": { - "type": "State", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 7 - }, - "instanceType": { - "type": "InstanceType", - "id": 10 - }, - "endpointUris": { - "rule": "repeated", - "type": "string", - "id": 8 - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 11, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 12, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "freeInstanceMetadata": { - "type": "FreeInstanceMetadata", - "id": 13 - }, - "edition": { - "type": "Edition", - "id": 20, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "defaultBackupScheduleType": { - "type": "DefaultBackupScheduleType", - "id": 23, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "CREATING": 1, - "READY": 2 - } - }, - "InstanceType": { - "values": { - "INSTANCE_TYPE_UNSPECIFIED": 0, - "PROVISIONED": 1, - "FREE_INSTANCE": 2 - } - }, - "Edition": { - "values": { - "EDITION_UNSPECIFIED": 0, - "STANDARD": 1, - "ENTERPRISE": 2, - "ENTERPRISE_PLUS": 3 - } - }, - "DefaultBackupScheduleType": { - "values": { - "DEFAULT_BACKUP_SCHEDULE_TYPE_UNSPECIFIED": 0, - "NONE": 1, - "AUTOMATIC": 2 - } - } - } - }, - "ListInstanceConfigsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" - } - }, - "pageSize": { - "type": "int32", - "id": 2 - }, - "pageToken": { - "type": "string", - "id": 3 - } - } - }, - "ListInstanceConfigsResponse": { - "fields": { - "instanceConfigs": { - "rule": "repeated", - "type": "InstanceConfig", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "GetInstanceConfigRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/InstanceConfig" - } - } - } - }, - "CreateInstanceConfigRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" - } - }, - "instanceConfigId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "instanceConfig": { - "type": "InstanceConfig", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "validateOnly": { - "type": "bool", - "id": 4 - } - } - }, - "UpdateInstanceConfigRequest": { - "fields": { - "instanceConfig": { - "type": "InstanceConfig", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "validateOnly": { - "type": "bool", - "id": 3 - } - } - }, - "DeleteInstanceConfigRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/InstanceConfig" - } - }, - "etag": { - "type": "string", - "id": 2 - }, - "validateOnly": { - "type": "bool", - "id": 3 - } - } - }, - "ListInstanceConfigOperationsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" - } - }, - "filter": { - "type": "string", - "id": 2 - }, - "pageSize": { - "type": "int32", - "id": 3 - }, - "pageToken": { - "type": "string", - "id": 4 - } - } - }, - "ListInstanceConfigOperationsResponse": { - "fields": { - "operations": { - "rule": "repeated", - "type": "google.longrunning.Operation", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "GetInstanceRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/Instance" - } - }, - "fieldMask": { - "type": "google.protobuf.FieldMask", - "id": 2 - } - } - }, - "CreateInstanceRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" - } - }, - "instanceId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "instance": { - "type": "Instance", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "ListInstancesRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" - } - }, - "pageSize": { - "type": "int32", - "id": 2 - }, - "pageToken": { - "type": "string", - "id": 3 - }, - "filter": { - "type": "string", - "id": 4 - }, - "instanceDeadline": { - "type": "google.protobuf.Timestamp", - "id": 5 - } - } - }, - "ListInstancesResponse": { - "fields": { - "instances": { - "rule": "repeated", - "type": "Instance", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - }, - "unreachable": { - "rule": "repeated", - "type": "string", - "id": 3 - } - } - }, - "UpdateInstanceRequest": { - "fields": { - "instance": { - "type": "Instance", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "fieldMask": { - "type": "google.protobuf.FieldMask", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "DeleteInstanceRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/Instance" - } - } - } - }, - "CreateInstanceMetadata": { - "fields": { - "instance": { - "type": "Instance", - "id": 1 - }, - "startTime": { - "type": "google.protobuf.Timestamp", - "id": 2 - }, - "cancelTime": { - "type": "google.protobuf.Timestamp", - "id": 3 - }, - "endTime": { - "type": "google.protobuf.Timestamp", - "id": 4 - }, - "expectedFulfillmentPeriod": { - "type": "FulfillmentPeriod", - "id": 5 - } - } - }, - "UpdateInstanceMetadata": { - "fields": { - "instance": { - "type": "Instance", - "id": 1 - }, - "startTime": { - "type": "google.protobuf.Timestamp", - "id": 2 - }, - "cancelTime": { - "type": "google.protobuf.Timestamp", - "id": 3 - }, - "endTime": { - "type": "google.protobuf.Timestamp", - "id": 4 - }, - "expectedFulfillmentPeriod": { - "type": "FulfillmentPeriod", - "id": 5 - } - } - }, - "FreeInstanceMetadata": { - "fields": { - "expireTime": { - "type": "google.protobuf.Timestamp", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "upgradeTime": { - "type": "google.protobuf.Timestamp", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "expireBehavior": { - "type": "ExpireBehavior", - "id": 3 - } - }, - "nested": { - "ExpireBehavior": { - "values": { - "EXPIRE_BEHAVIOR_UNSPECIFIED": 0, - "FREE_TO_PROVISIONED": 1, - "REMOVE_AFTER_GRACE_PERIOD": 2 - } - } - } - }, - "CreateInstanceConfigMetadata": { - "fields": { - "instanceConfig": { - "type": "InstanceConfig", - "id": 1 - }, - "progress": { - "type": "OperationProgress", - "id": 2 - }, - "cancelTime": { - "type": "google.protobuf.Timestamp", - "id": 3 - } - } - }, - "UpdateInstanceConfigMetadata": { - "fields": { - "instanceConfig": { - "type": "InstanceConfig", - "id": 1 - }, - "progress": { - "type": "OperationProgress", - "id": 2 - }, - "cancelTime": { - "type": "google.protobuf.Timestamp", - "id": 3 - } - } - }, - "InstancePartition": { - "options": { - "(google.api.resource).type": "spanner.googleapis.com/InstancePartition", - "(google.api.resource).pattern": "projects/{project}/instances/{instance}/instancePartitions/{instance_partition}", - "(google.api.resource).plural": "instancePartitions", - "(google.api.resource).singular": "instancePartition" - }, - "oneofs": { - "computeCapacity": { - "oneof": [ - "nodeCount", - "processingUnits" - ] - } - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "config": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/InstanceConfig" - } - }, - "displayName": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "nodeCount": { - "type": "int32", - "id": 5 - }, - "processingUnits": { - "type": "int32", - "id": 6 - }, - "autoscalingConfig": { - "type": "AutoscalingConfig", - "id": 13, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "state": { - "type": "State", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 8, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 9, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "referencingDatabases": { - "rule": "repeated", - "type": "string", - "id": 10, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "referencingBackups": { - "rule": "repeated", - "type": "string", - "id": 11, - "options": { - "deprecated": true, - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "etag": { - "type": "string", - "id": 12 - } - }, - "nested": { - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "CREATING": 1, - "READY": 2 - } - } - } - }, - "CreateInstancePartitionMetadata": { - "fields": { - "instancePartition": { - "type": "InstancePartition", - "id": 1 - }, - "startTime": { - "type": "google.protobuf.Timestamp", - "id": 2 - }, - "cancelTime": { - "type": "google.protobuf.Timestamp", - "id": 3 - }, - "endTime": { - "type": "google.protobuf.Timestamp", - "id": 4 - } - } - }, - "CreateInstancePartitionRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/Instance" - } - }, - "instancePartitionId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "instancePartition": { - "type": "InstancePartition", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "DeleteInstancePartitionRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/InstancePartition" - } - }, - "etag": { - "type": "string", - "id": 2 - } - } - }, - "GetInstancePartitionRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/InstancePartition" - } - } - } - }, - "UpdateInstancePartitionRequest": { - "fields": { - "instancePartition": { - "type": "InstancePartition", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "fieldMask": { - "type": "google.protobuf.FieldMask", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "UpdateInstancePartitionMetadata": { - "fields": { - "instancePartition": { - "type": "InstancePartition", - "id": 1 - }, - "startTime": { - "type": "google.protobuf.Timestamp", - "id": 2 - }, - "cancelTime": { - "type": "google.protobuf.Timestamp", - "id": 3 - }, - "endTime": { - "type": "google.protobuf.Timestamp", - "id": 4 - } - } - }, - "ListInstancePartitionsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/Instance" - } - }, - "pageSize": { - "type": "int32", - "id": 2 - }, - "pageToken": { - "type": "string", - "id": 3 - }, - "instancePartitionDeadline": { - "type": "google.protobuf.Timestamp", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListInstancePartitionsResponse": { - "fields": { - "instancePartitions": { - "rule": "repeated", - "type": "InstancePartition", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - }, - "unreachable": { - "rule": "repeated", - "type": "string", - "id": 3 - } - } - }, - "ListInstancePartitionOperationsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/Instance" - } - }, - "filter": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pageSize": { - "type": "int32", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pageToken": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "instancePartitionDeadline": { - "type": "google.protobuf.Timestamp", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListInstancePartitionOperationsResponse": { - "fields": { - "operations": { - "rule": "repeated", - "type": "google.longrunning.Operation", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - }, - "unreachableInstancePartitions": { - "rule": "repeated", - "type": "string", - "id": 3 - } - } - }, - "MoveInstanceRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/Instance" - } - }, - "targetConfig": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/InstanceConfig" - } - } - } - }, - "MoveInstanceResponse": { - "fields": {} - }, - "MoveInstanceMetadata": { - "fields": { - "targetConfig": { - "type": "string", - "id": 1 - }, - "progress": { - "type": "OperationProgress", - "id": 2 - }, - "cancelTime": { - "type": "google.protobuf.Timestamp", - "id": 3 - } - } - } - } - } - } - } - } - }, - "executor": { - "nested": { - "v1": { - "options": { - "go_package": "cloud.google.com/go/spanner/executor/apiv1/executorpb;executorpb", - "java_multiple_files": true, - "java_outer_classname": "CloudExecutorProto", - "java_package": "com.google.spanner.executor.v1" - }, - "nested": { - "SpannerExecutorProxy": { - "options": { - "(google.api.default_host)": "spanner-cloud-executor.googleapis.com" - }, - "methods": { - "ExecuteActionAsync": { - "requestType": "SpannerAsyncActionRequest", - "requestStream": true, - "responseType": "SpannerAsyncActionResponse", - "responseStream": true - } - } - }, - "SpannerAsyncActionRequest": { - "fields": { - "actionId": { - "type": "int32", - "id": 1 - }, - "action": { - "type": "SpannerAction", - "id": 2 - } - } - }, - "SpannerAsyncActionResponse": { - "fields": { - "actionId": { - "type": "int32", - "id": 1 - }, - "outcome": { - "type": "SpannerActionOutcome", - "id": 2 - } - } - }, - "SpannerAction": { - "oneofs": { - "action": { - "oneof": [ - "start", - "finish", - "read", - "query", - "mutation", - "dml", - "batchDml", - "write", - "partitionedUpdate", - "admin", - "startBatchTxn", - "closeBatchTxn", - "generateDbPartitionsRead", - "generateDbPartitionsQuery", - "executePartition", - "executeChangeStreamQuery", - "queryCancellation" - ] - } - }, - "fields": { - "databasePath": { - "type": "string", - "id": 1 - }, - "spannerOptions": { - "type": "SpannerOptions", - "id": 2 - }, - "start": { - "type": "StartTransactionAction", - "id": 10 - }, - "finish": { - "type": "FinishTransactionAction", - "id": 11 - }, - "read": { - "type": "ReadAction", - "id": 20 - }, - "query": { - "type": "QueryAction", - "id": 21 - }, - "mutation": { - "type": "MutationAction", - "id": 22 - }, - "dml": { - "type": "DmlAction", - "id": 23 - }, - "batchDml": { - "type": "BatchDmlAction", - "id": 24 - }, - "write": { - "type": "WriteMutationsAction", - "id": 25 - }, - "partitionedUpdate": { - "type": "PartitionedUpdateAction", - "id": 27 - }, - "admin": { - "type": "AdminAction", - "id": 30 - }, - "startBatchTxn": { - "type": "StartBatchTransactionAction", - "id": 40 - }, - "closeBatchTxn": { - "type": "CloseBatchTransactionAction", - "id": 41 - }, - "generateDbPartitionsRead": { - "type": "GenerateDbPartitionsForReadAction", - "id": 42 - }, - "generateDbPartitionsQuery": { - "type": "GenerateDbPartitionsForQueryAction", - "id": 43 - }, - "executePartition": { - "type": "ExecutePartitionAction", - "id": 44 - }, - "executeChangeStreamQuery": { - "type": "ExecuteChangeStreamQuery", - "id": 50 - }, - "queryCancellation": { - "type": "QueryCancellationAction", - "id": 51 - } - } - }, - "ReadAction": { - "oneofs": { - "_index": { - "oneof": [ - "index" - ] - } - }, - "fields": { - "table": { - "type": "string", - "id": 1 - }, - "index": { - "type": "string", - "id": 2, - "options": { - "proto3_optional": true - } - }, - "column": { - "rule": "repeated", - "type": "string", - "id": 3 - }, - "keys": { - "type": "KeySet", - "id": 4 - }, - "limit": { - "type": "int32", - "id": 5 - } - } - }, - "QueryAction": { - "fields": { - "sql": { - "type": "string", - "id": 1 - }, - "params": { - "rule": "repeated", - "type": "Parameter", - "id": 2 - } - }, - "nested": { - "Parameter": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "type": { - "type": "google.spanner.v1.Type", - "id": 2 - }, - "value": { - "type": "Value", - "id": 3 - } - } - } - } - }, - "DmlAction": { - "oneofs": { - "_autocommitIfSupported": { - "oneof": [ - "autocommitIfSupported" - ] - } - }, - "fields": { - "update": { - "type": "QueryAction", - "id": 1 - }, - "autocommitIfSupported": { - "type": "bool", - "id": 2, - "options": { - "proto3_optional": true - } - } - } - }, - "BatchDmlAction": { - "fields": { - "updates": { - "rule": "repeated", - "type": "QueryAction", - "id": 1 - } - } - }, - "Value": { - "oneofs": { - "valueType": { - "oneof": [ - "isNull", - "intValue", - "boolValue", - "doubleValue", - "bytesValue", - "stringValue", - "structValue", - "timestampValue", - "dateDaysValue", - "isCommitTimestamp", - "arrayValue" - ] - }, - "_arrayType": { - "oneof": [ - "arrayType" - ] - } - }, - "fields": { - "isNull": { - "type": "bool", - "id": 1 - }, - "intValue": { - "type": "int64", - "id": 2 - }, - "boolValue": { - "type": "bool", - "id": 3 - }, - "doubleValue": { - "type": "double", - "id": 4 - }, - "bytesValue": { - "type": "bytes", - "id": 5 - }, - "stringValue": { - "type": "string", - "id": 6 - }, - "structValue": { - "type": "ValueList", - "id": 7 - }, - "timestampValue": { - "type": "google.protobuf.Timestamp", - "id": 8 - }, - "dateDaysValue": { - "type": "int32", - "id": 9 - }, - "isCommitTimestamp": { - "type": "bool", - "id": 10 - }, - "arrayValue": { - "type": "ValueList", - "id": 11 - }, - "arrayType": { - "type": "google.spanner.v1.Type", - "id": 12, - "options": { - "proto3_optional": true - } - } - } - }, - "KeyRange": { - "oneofs": { - "_type": { - "oneof": [ - "type" - ] - } - }, - "fields": { - "start": { - "type": "ValueList", - "id": 1 - }, - "limit": { - "type": "ValueList", - "id": 2 - }, - "type": { - "type": "Type", - "id": 3, - "options": { - "proto3_optional": true - } - } - }, - "nested": { - "Type": { - "values": { - "TYPE_UNSPECIFIED": 0, - "CLOSED_CLOSED": 1, - "CLOSED_OPEN": 2, - "OPEN_CLOSED": 3, - "OPEN_OPEN": 4 - } - } - } - }, - "KeySet": { - "fields": { - "point": { - "rule": "repeated", - "type": "ValueList", - "id": 1 - }, - "range": { - "rule": "repeated", - "type": "KeyRange", - "id": 2 - }, - "all": { - "type": "bool", - "id": 3 - } - } - }, - "ValueList": { - "fields": { - "value": { - "rule": "repeated", - "type": "Value", - "id": 1 - } - } - }, - "MutationAction": { - "fields": { - "mod": { - "rule": "repeated", - "type": "Mod", - "id": 1 - } - }, - "nested": { - "InsertArgs": { - "fields": { - "column": { - "rule": "repeated", - "type": "string", - "id": 1 - }, - "type": { - "rule": "repeated", - "type": "google.spanner.v1.Type", - "id": 2 - }, - "values": { - "rule": "repeated", - "type": "ValueList", - "id": 3 - } - } - }, - "UpdateArgs": { - "fields": { - "column": { - "rule": "repeated", - "type": "string", - "id": 1 - }, - "type": { - "rule": "repeated", - "type": "google.spanner.v1.Type", - "id": 2 - }, - "values": { - "rule": "repeated", - "type": "ValueList", - "id": 3 - } - } - }, - "Mod": { - "fields": { - "table": { - "type": "string", - "id": 1 - }, - "insert": { - "type": "InsertArgs", - "id": 2 - }, - "update": { - "type": "UpdateArgs", - "id": 3 - }, - "insertOrUpdate": { - "type": "InsertArgs", - "id": 4 - }, - "replace": { - "type": "InsertArgs", - "id": 5 - }, - "deleteKeys": { - "type": "KeySet", - "id": 6 - } - } - } - } - }, - "WriteMutationsAction": { - "fields": { - "mutation": { - "type": "MutationAction", - "id": 1 - } - } - }, - "PartitionedUpdateAction": { - "oneofs": { - "_options": { - "oneof": [ - "options" - ] - } - }, - "fields": { - "options": { - "type": "ExecutePartitionedUpdateOptions", - "id": 1, - "options": { - "proto3_optional": true - } - }, - "update": { - "type": "QueryAction", - "id": 2 - } - }, - "nested": { - "ExecutePartitionedUpdateOptions": { - "oneofs": { - "_rpcPriority": { - "oneof": [ - "rpcPriority" - ] - }, - "_tag": { - "oneof": [ - "tag" - ] - } - }, - "fields": { - "rpcPriority": { - "type": "google.spanner.v1.RequestOptions.Priority", - "id": 1, - "options": { - "proto3_optional": true - } - }, - "tag": { - "type": "string", - "id": 2, - "options": { - "proto3_optional": true - } - } - } - } - } - }, - "StartTransactionAction": { - "oneofs": { - "_concurrency": { - "oneof": [ - "concurrency" - ] - }, - "_executionOptions": { - "oneof": [ - "executionOptions" - ] - } - }, - "fields": { - "concurrency": { - "type": "Concurrency", - "id": 1, - "options": { - "proto3_optional": true - } - }, - "table": { - "rule": "repeated", - "type": "TableMetadata", - "id": 2 - }, - "transactionSeed": { - "type": "string", - "id": 3 - }, - "executionOptions": { - "type": "TransactionExecutionOptions", - "id": 4, - "options": { - "proto3_optional": true - } - } - } - }, - "Concurrency": { - "oneofs": { - "concurrencyMode": { - "oneof": [ - "stalenessSeconds", - "minReadTimestampMicros", - "maxStalenessSeconds", - "exactTimestampMicros", - "strong", - "batch" - ] - } - }, - "fields": { - "stalenessSeconds": { - "type": "double", - "id": 1 - }, - "minReadTimestampMicros": { - "type": "int64", - "id": 2 - }, - "maxStalenessSeconds": { - "type": "double", - "id": 3 - }, - "exactTimestampMicros": { - "type": "int64", - "id": 4 - }, - "strong": { - "type": "bool", - "id": 5 - }, - "batch": { - "type": "bool", - "id": 6 - }, - "snapshotEpochRead": { - "type": "bool", - "id": 7 - }, - "snapshotEpochRootTable": { - "type": "string", - "id": 8 - }, - "batchReadTimestampMicros": { - "type": "int64", - "id": 9 - } - } - }, - "TableMetadata": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "column": { - "rule": "repeated", - "type": "ColumnMetadata", - "id": 2 - }, - "keyColumn": { - "rule": "repeated", - "type": "ColumnMetadata", - "id": 3 - } - } - }, - "ColumnMetadata": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "type": { - "type": "google.spanner.v1.Type", - "id": 2 - } - } - }, - "TransactionExecutionOptions": { - "fields": { - "optimistic": { - "type": "bool", - "id": 1 - } - } - }, - "FinishTransactionAction": { - "fields": { - "mode": { - "type": "Mode", - "id": 1 - } - }, - "nested": { - "Mode": { - "values": { - "MODE_UNSPECIFIED": 0, - "COMMIT": 1, - "ABANDON": 2 - } - } - } - }, - "AdminAction": { - "oneofs": { - "action": { - "oneof": [ - "createUserInstanceConfig", - "updateUserInstanceConfig", - "deleteUserInstanceConfig", - "getCloudInstanceConfig", - "listInstanceConfigs", - "createCloudInstance", - "updateCloudInstance", - "deleteCloudInstance", - "listCloudInstances", - "getCloudInstance", - "createCloudDatabase", - "updateCloudDatabaseDdl", - "updateCloudDatabase", - "dropCloudDatabase", - "listCloudDatabases", - "listCloudDatabaseOperations", - "restoreCloudDatabase", - "getCloudDatabase", - "createCloudBackup", - "copyCloudBackup", - "getCloudBackup", - "updateCloudBackup", - "deleteCloudBackup", - "listCloudBackups", - "listCloudBackupOperations", - "getOperation", - "cancelOperation", - "changeQuorumCloudDatabase" - ] - } - }, - "fields": { - "createUserInstanceConfig": { - "type": "CreateUserInstanceConfigAction", - "id": 1 - }, - "updateUserInstanceConfig": { - "type": "UpdateUserInstanceConfigAction", - "id": 2 - }, - "deleteUserInstanceConfig": { - "type": "DeleteUserInstanceConfigAction", - "id": 3 - }, - "getCloudInstanceConfig": { - "type": "GetCloudInstanceConfigAction", - "id": 4 - }, - "listInstanceConfigs": { - "type": "ListCloudInstanceConfigsAction", - "id": 5 - }, - "createCloudInstance": { - "type": "CreateCloudInstanceAction", - "id": 6 - }, - "updateCloudInstance": { - "type": "UpdateCloudInstanceAction", - "id": 7 - }, - "deleteCloudInstance": { - "type": "DeleteCloudInstanceAction", - "id": 8 - }, - "listCloudInstances": { - "type": "ListCloudInstancesAction", - "id": 9 - }, - "getCloudInstance": { - "type": "GetCloudInstanceAction", - "id": 10 - }, - "createCloudDatabase": { - "type": "CreateCloudDatabaseAction", - "id": 11 - }, - "updateCloudDatabaseDdl": { - "type": "UpdateCloudDatabaseDdlAction", - "id": 12 - }, - "updateCloudDatabase": { - "type": "UpdateCloudDatabaseAction", - "id": 27 - }, - "dropCloudDatabase": { - "type": "DropCloudDatabaseAction", - "id": 13 - }, - "listCloudDatabases": { - "type": "ListCloudDatabasesAction", - "id": 14 - }, - "listCloudDatabaseOperations": { - "type": "ListCloudDatabaseOperationsAction", - "id": 15 - }, - "restoreCloudDatabase": { - "type": "RestoreCloudDatabaseAction", - "id": 16 - }, - "getCloudDatabase": { - "type": "GetCloudDatabaseAction", - "id": 17 - }, - "createCloudBackup": { - "type": "CreateCloudBackupAction", - "id": 18 - }, - "copyCloudBackup": { - "type": "CopyCloudBackupAction", - "id": 19 - }, - "getCloudBackup": { - "type": "GetCloudBackupAction", - "id": 20 - }, - "updateCloudBackup": { - "type": "UpdateCloudBackupAction", - "id": 21 - }, - "deleteCloudBackup": { - "type": "DeleteCloudBackupAction", - "id": 22 - }, - "listCloudBackups": { - "type": "ListCloudBackupsAction", - "id": 23 - }, - "listCloudBackupOperations": { - "type": "ListCloudBackupOperationsAction", - "id": 24 - }, - "getOperation": { - "type": "GetOperationAction", - "id": 25 - }, - "cancelOperation": { - "type": "CancelOperationAction", - "id": 26 - }, - "changeQuorumCloudDatabase": { - "type": "ChangeQuorumCloudDatabaseAction", - "id": 28 - } - } - }, - "CreateUserInstanceConfigAction": { - "fields": { - "userConfigId": { - "type": "string", - "id": 1 - }, - "projectId": { - "type": "string", - "id": 2 - }, - "baseConfigId": { - "type": "string", - "id": 3 - }, - "replicas": { - "rule": "repeated", - "type": "google.spanner.admin.instance.v1.ReplicaInfo", - "id": 4 - } - } - }, - "UpdateUserInstanceConfigAction": { - "oneofs": { - "_displayName": { - "oneof": [ - "displayName" - ] - } - }, - "fields": { - "userConfigId": { - "type": "string", - "id": 1 - }, - "projectId": { - "type": "string", - "id": 2 - }, - "displayName": { - "type": "string", - "id": 3, - "options": { - "proto3_optional": true - } - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 4 - } - } - }, - "GetCloudInstanceConfigAction": { - "fields": { - "instanceConfigId": { - "type": "string", - "id": 1 - }, - "projectId": { - "type": "string", - "id": 2 - } - } - }, - "DeleteUserInstanceConfigAction": { - "fields": { - "userConfigId": { - "type": "string", - "id": 1 - }, - "projectId": { - "type": "string", - "id": 2 - } - } - }, - "ListCloudInstanceConfigsAction": { - "oneofs": { - "_pageSize": { - "oneof": [ - "pageSize" - ] - }, - "_pageToken": { - "oneof": [ - "pageToken" - ] - } - }, - "fields": { - "projectId": { - "type": "string", - "id": 1 - }, - "pageSize": { - "type": "int32", - "id": 2, - "options": { - "proto3_optional": true - } - }, - "pageToken": { - "type": "string", - "id": 3, - "options": { - "proto3_optional": true - } - } - } - }, - "CreateCloudInstanceAction": { - "oneofs": { - "_nodeCount": { - "oneof": [ - "nodeCount" - ] - }, - "_processingUnits": { - "oneof": [ - "processingUnits" - ] - }, - "_autoscalingConfig": { - "oneof": [ - "autoscalingConfig" - ] - } - }, - "fields": { - "instanceId": { - "type": "string", - "id": 1 - }, - "projectId": { - "type": "string", - "id": 2 - }, - "instanceConfigId": { - "type": "string", - "id": 3 - }, - "nodeCount": { - "type": "int32", - "id": 4, - "options": { - "proto3_optional": true - } - }, - "processingUnits": { - "type": "int32", - "id": 6, - "options": { - "proto3_optional": true - } - }, - "autoscalingConfig": { - "type": "google.spanner.admin.instance.v1.AutoscalingConfig", - "id": 7, - "options": { - "proto3_optional": true - } - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 5 - } - } - }, - "UpdateCloudInstanceAction": { - "oneofs": { - "_displayName": { - "oneof": [ - "displayName" - ] - }, - "_nodeCount": { - "oneof": [ - "nodeCount" - ] - }, - "_processingUnits": { - "oneof": [ - "processingUnits" - ] - }, - "_autoscalingConfig": { - "oneof": [ - "autoscalingConfig" - ] - } - }, - "fields": { - "instanceId": { - "type": "string", - "id": 1 - }, - "projectId": { - "type": "string", - "id": 2 - }, - "displayName": { - "type": "string", - "id": 3, - "options": { - "proto3_optional": true - } - }, - "nodeCount": { - "type": "int32", - "id": 4, - "options": { - "proto3_optional": true - } - }, - "processingUnits": { - "type": "int32", - "id": 5, - "options": { - "proto3_optional": true - } - }, - "autoscalingConfig": { - "type": "google.spanner.admin.instance.v1.AutoscalingConfig", - "id": 7, - "options": { - "proto3_optional": true - } - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 6 - } - } - }, - "DeleteCloudInstanceAction": { - "fields": { - "instanceId": { - "type": "string", - "id": 1 - }, - "projectId": { - "type": "string", - "id": 2 - } - } - }, - "CreateCloudDatabaseAction": { - "oneofs": { - "_dialect": { - "oneof": [ - "dialect" - ] - }, - "_protoDescriptors": { - "oneof": [ - "protoDescriptors" - ] - } - }, - "fields": { - "instanceId": { - "type": "string", - "id": 1 - }, - "projectId": { - "type": "string", - "id": 2 - }, - "databaseId": { - "type": "string", - "id": 3 - }, - "sdlStatement": { - "rule": "repeated", - "type": "string", - "id": 4 - }, - "encryptionConfig": { - "type": "google.spanner.admin.database.v1.EncryptionConfig", - "id": 5 - }, - "dialect": { - "type": "string", - "id": 6, - "options": { - "proto3_optional": true - } - }, - "protoDescriptors": { - "type": "bytes", - "id": 7, - "options": { - "proto3_optional": true - } - } - } - }, - "UpdateCloudDatabaseDdlAction": { - "oneofs": { - "_protoDescriptors": { - "oneof": [ - "protoDescriptors" - ] - } - }, - "fields": { - "instanceId": { - "type": "string", - "id": 1 - }, - "projectId": { - "type": "string", - "id": 2 - }, - "databaseId": { - "type": "string", - "id": 3 - }, - "sdlStatement": { - "rule": "repeated", - "type": "string", - "id": 4 - }, - "operationId": { - "type": "string", - "id": 5 - }, - "protoDescriptors": { - "type": "bytes", - "id": 6, - "options": { - "proto3_optional": true - } - } - } - }, - "UpdateCloudDatabaseAction": { - "fields": { - "instanceId": { - "type": "string", - "id": 1 - }, - "projectId": { - "type": "string", - "id": 2 - }, - "databaseName": { - "type": "string", - "id": 3 - }, - "enableDropProtection": { - "type": "bool", - "id": 4 - } - } - }, - "DropCloudDatabaseAction": { - "fields": { - "instanceId": { - "type": "string", - "id": 1 - }, - "projectId": { - "type": "string", - "id": 2 - }, - "databaseId": { - "type": "string", - "id": 3 - } - } - }, - "ChangeQuorumCloudDatabaseAction": { - "oneofs": { - "_databaseUri": { - "oneof": [ - "databaseUri" - ] - } - }, - "fields": { - "databaseUri": { - "type": "string", - "id": 1, - "options": { - "proto3_optional": true - } - }, - "servingLocations": { - "rule": "repeated", - "type": "string", - "id": 2 - } - } - }, - "ListCloudDatabasesAction": { - "fields": { - "projectId": { - "type": "string", - "id": 1 - }, - "instanceId": { - "type": "string", - "id": 2 - }, - "pageSize": { - "type": "int32", - "id": 3 - }, - "pageToken": { - "type": "string", - "id": 4 - } - } - }, - "ListCloudInstancesAction": { - "oneofs": { - "_filter": { - "oneof": [ - "filter" - ] - }, - "_pageSize": { - "oneof": [ - "pageSize" - ] - }, - "_pageToken": { - "oneof": [ - "pageToken" - ] - } - }, - "fields": { - "projectId": { - "type": "string", - "id": 1 - }, - "filter": { - "type": "string", - "id": 2, - "options": { - "proto3_optional": true - } - }, - "pageSize": { - "type": "int32", - "id": 3, - "options": { - "proto3_optional": true - } - }, - "pageToken": { - "type": "string", - "id": 4, - "options": { - "proto3_optional": true - } - } - } - }, - "GetCloudInstanceAction": { - "fields": { - "projectId": { - "type": "string", - "id": 1 - }, - "instanceId": { - "type": "string", - "id": 2 - } - } - }, - "ListCloudDatabaseOperationsAction": { - "fields": { - "projectId": { - "type": "string", - "id": 1 - }, - "instanceId": { - "type": "string", - "id": 2 - }, - "filter": { - "type": "string", - "id": 3 - }, - "pageSize": { - "type": "int32", - "id": 4 - }, - "pageToken": { - "type": "string", - "id": 5 - } - } - }, - "RestoreCloudDatabaseAction": { - "fields": { - "projectId": { - "type": "string", - "id": 1 - }, - "backupInstanceId": { - "type": "string", - "id": 2 - }, - "backupId": { - "type": "string", - "id": 3 - }, - "databaseInstanceId": { - "type": "string", - "id": 4 - }, - "databaseId": { - "type": "string", - "id": 5 - }, - "encryptionConfig": { - "type": "google.spanner.admin.database.v1.EncryptionConfig", - "id": 7 - } - } - }, - "GetCloudDatabaseAction": { - "fields": { - "projectId": { - "type": "string", - "id": 1 - }, - "instanceId": { - "type": "string", - "id": 2 - }, - "databaseId": { - "type": "string", - "id": 3 - } - } - }, - "CreateCloudBackupAction": { - "oneofs": { - "_versionTime": { - "oneof": [ - "versionTime" - ] - } - }, - "fields": { - "projectId": { - "type": "string", - "id": 1 - }, - "instanceId": { - "type": "string", - "id": 2 - }, - "backupId": { - "type": "string", - "id": 3 - }, - "databaseId": { - "type": "string", - "id": 4 - }, - "expireTime": { - "type": "google.protobuf.Timestamp", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "versionTime": { - "type": "google.protobuf.Timestamp", - "id": 6, - "options": { - "proto3_optional": true - } - }, - "encryptionConfig": { - "type": "google.spanner.admin.database.v1.EncryptionConfig", - "id": 7 - } - } - }, - "CopyCloudBackupAction": { - "fields": { - "projectId": { - "type": "string", - "id": 1 - }, - "instanceId": { - "type": "string", - "id": 2 - }, - "backupId": { - "type": "string", - "id": 3 - }, - "sourceBackup": { - "type": "string", - "id": 4 - }, - "expireTime": { - "type": "google.protobuf.Timestamp", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "GetCloudBackupAction": { - "fields": { - "projectId": { - "type": "string", - "id": 1 - }, - "instanceId": { - "type": "string", - "id": 2 - }, - "backupId": { - "type": "string", - "id": 3 - } - } - }, - "UpdateCloudBackupAction": { - "fields": { - "projectId": { - "type": "string", - "id": 1 - }, - "instanceId": { - "type": "string", - "id": 2 - }, - "backupId": { - "type": "string", - "id": 3 - }, - "expireTime": { - "type": "google.protobuf.Timestamp", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "DeleteCloudBackupAction": { - "fields": { - "projectId": { - "type": "string", - "id": 1 - }, - "instanceId": { - "type": "string", - "id": 2 - }, - "backupId": { - "type": "string", - "id": 3 - } - } - }, - "ListCloudBackupsAction": { - "fields": { - "projectId": { - "type": "string", - "id": 1 - }, - "instanceId": { - "type": "string", - "id": 2 - }, - "filter": { - "type": "string", - "id": 3 - }, - "pageSize": { - "type": "int32", - "id": 4 - }, - "pageToken": { - "type": "string", - "id": 5 - } - } - }, - "ListCloudBackupOperationsAction": { - "fields": { - "projectId": { - "type": "string", - "id": 1 - }, - "instanceId": { - "type": "string", - "id": 2 - }, - "filter": { - "type": "string", - "id": 3 - }, - "pageSize": { - "type": "int32", - "id": 4 - }, - "pageToken": { - "type": "string", - "id": 5 - } - } - }, - "GetOperationAction": { - "fields": { - "operation": { - "type": "string", - "id": 1 - } - } - }, - "QueryCancellationAction": { - "fields": { - "longRunningSql": { - "type": "string", - "id": 1 - }, - "cancelQuery": { - "type": "string", - "id": 2 - } - } - }, - "CancelOperationAction": { - "fields": { - "operation": { - "type": "string", - "id": 1 - } - } - }, - "StartBatchTransactionAction": { - "oneofs": { - "param": { - "oneof": [ - "batchTxnTime", - "tid" - ] - } - }, - "fields": { - "batchTxnTime": { - "type": "google.protobuf.Timestamp", - "id": 1 - }, - "tid": { - "type": "bytes", - "id": 2 - }, - "cloudDatabaseRole": { - "type": "string", - "id": 3 - } - } - }, - "CloseBatchTransactionAction": { - "fields": { - "cleanup": { - "type": "bool", - "id": 1 - } - } - }, - "GenerateDbPartitionsForReadAction": { - "oneofs": { - "_desiredBytesPerPartition": { - "oneof": [ - "desiredBytesPerPartition" - ] - }, - "_maxPartitionCount": { - "oneof": [ - "maxPartitionCount" - ] - } - }, - "fields": { - "read": { - "type": "ReadAction", - "id": 1 - }, - "table": { - "rule": "repeated", - "type": "TableMetadata", - "id": 2 - }, - "desiredBytesPerPartition": { - "type": "int64", - "id": 3, - "options": { - "proto3_optional": true - } - }, - "maxPartitionCount": { - "type": "int64", - "id": 4, - "options": { - "proto3_optional": true - } - } - } - }, - "GenerateDbPartitionsForQueryAction": { - "oneofs": { - "_desiredBytesPerPartition": { - "oneof": [ - "desiredBytesPerPartition" - ] - } - }, - "fields": { - "query": { - "type": "QueryAction", - "id": 1 - }, - "desiredBytesPerPartition": { - "type": "int64", - "id": 2, - "options": { - "proto3_optional": true - } - } - } - }, - "BatchPartition": { - "oneofs": { - "_table": { - "oneof": [ - "table" - ] - }, - "_index": { - "oneof": [ - "index" - ] - } - }, - "fields": { - "partition": { - "type": "bytes", - "id": 1 - }, - "partitionToken": { - "type": "bytes", - "id": 2 - }, - "table": { - "type": "string", - "id": 3, - "options": { - "proto3_optional": true - } - }, - "index": { - "type": "string", - "id": 4, - "options": { - "proto3_optional": true - } - } - } - }, - "ExecutePartitionAction": { - "fields": { - "partition": { - "type": "BatchPartition", - "id": 1 - } - } - }, - "ExecuteChangeStreamQuery": { - "oneofs": { - "_endTime": { - "oneof": [ - "endTime" - ] - }, - "_partitionToken": { - "oneof": [ - "partitionToken" - ] - }, - "_heartbeatMilliseconds": { - "oneof": [ - "heartbeatMilliseconds" - ] - }, - "_deadlineSeconds": { - "oneof": [ - "deadlineSeconds" - ] - }, - "_cloudDatabaseRole": { - "oneof": [ - "cloudDatabaseRole" - ] - } - }, - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "startTime": { - "type": "google.protobuf.Timestamp", - "id": 2 - }, - "endTime": { - "type": "google.protobuf.Timestamp", - "id": 3, - "options": { - "proto3_optional": true - } - }, - "partitionToken": { - "type": "string", - "id": 4, - "options": { - "proto3_optional": true - } - }, - "readOptions": { - "rule": "repeated", - "type": "string", - "id": 5 - }, - "heartbeatMilliseconds": { - "type": "int32", - "id": 6, - "options": { - "proto3_optional": true - } - }, - "deadlineSeconds": { - "type": "int64", - "id": 7, - "options": { - "proto3_optional": true - } - }, - "cloudDatabaseRole": { - "type": "string", - "id": 8, - "options": { - "proto3_optional": true - } - } - } - }, - "SpannerActionOutcome": { - "oneofs": { - "_status": { - "oneof": [ - "status" - ] - }, - "_commitTime": { - "oneof": [ - "commitTime" - ] - }, - "_readResult": { - "oneof": [ - "readResult" - ] - }, - "_queryResult": { - "oneof": [ - "queryResult" - ] - }, - "_transactionRestarted": { - "oneof": [ - "transactionRestarted" - ] - }, - "_batchTxnId": { - "oneof": [ - "batchTxnId" - ] - }, - "_adminResult": { - "oneof": [ - "adminResult" - ] - } - }, - "fields": { - "status": { - "type": "google.rpc.Status", - "id": 1, - "options": { - "proto3_optional": true - } - }, - "commitTime": { - "type": "google.protobuf.Timestamp", - "id": 2, - "options": { - "proto3_optional": true - } - }, - "readResult": { - "type": "ReadResult", - "id": 3, - "options": { - "proto3_optional": true - } - }, - "queryResult": { - "type": "QueryResult", - "id": 4, - "options": { - "proto3_optional": true - } - }, - "transactionRestarted": { - "type": "bool", - "id": 5, - "options": { - "proto3_optional": true - } - }, - "batchTxnId": { - "type": "bytes", - "id": 6, - "options": { - "proto3_optional": true - } - }, - "dbPartition": { - "rule": "repeated", - "type": "BatchPartition", - "id": 7 - }, - "adminResult": { - "type": "AdminResult", - "id": 8, - "options": { - "proto3_optional": true - } - }, - "dmlRowsModified": { - "rule": "repeated", - "type": "int64", - "id": 9 - }, - "changeStreamRecords": { - "rule": "repeated", - "type": "ChangeStreamRecord", - "id": 10 - } - } - }, - "AdminResult": { - "fields": { - "backupResponse": { - "type": "CloudBackupResponse", - "id": 1 - }, - "operationResponse": { - "type": "OperationResponse", - "id": 2 - }, - "databaseResponse": { - "type": "CloudDatabaseResponse", - "id": 3 - }, - "instanceResponse": { - "type": "CloudInstanceResponse", - "id": 4 - }, - "instanceConfigResponse": { - "type": "CloudInstanceConfigResponse", - "id": 5 - } - } - }, - "CloudBackupResponse": { - "fields": { - "listedBackups": { - "rule": "repeated", - "type": "google.spanner.admin.database.v1.Backup", - "id": 1 - }, - "listedBackupOperations": { - "rule": "repeated", - "type": "google.longrunning.Operation", - "id": 2 - }, - "nextPageToken": { - "type": "string", - "id": 3 - }, - "backup": { - "type": "google.spanner.admin.database.v1.Backup", - "id": 4 - } - } - }, - "OperationResponse": { - "fields": { - "listedOperations": { - "rule": "repeated", - "type": "google.longrunning.Operation", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - }, - "operation": { - "type": "google.longrunning.Operation", - "id": 3 - } - } - }, - "CloudInstanceResponse": { - "fields": { - "listedInstances": { - "rule": "repeated", - "type": "google.spanner.admin.instance.v1.Instance", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - }, - "instance": { - "type": "google.spanner.admin.instance.v1.Instance", - "id": 3 - } - } - }, - "CloudInstanceConfigResponse": { - "fields": { - "listedInstanceConfigs": { - "rule": "repeated", - "type": "google.spanner.admin.instance.v1.InstanceConfig", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - }, - "instanceConfig": { - "type": "google.spanner.admin.instance.v1.InstanceConfig", - "id": 3 - } - } - }, - "CloudDatabaseResponse": { - "fields": { - "listedDatabases": { - "rule": "repeated", - "type": "google.spanner.admin.database.v1.Database", - "id": 1 - }, - "listedDatabaseOperations": { - "rule": "repeated", - "type": "google.longrunning.Operation", - "id": 2 - }, - "nextPageToken": { - "type": "string", - "id": 3 - }, - "database": { - "type": "google.spanner.admin.database.v1.Database", - "id": 4 - } - } - }, - "ReadResult": { - "oneofs": { - "_index": { - "oneof": [ - "index" - ] - }, - "_requestIndex": { - "oneof": [ - "requestIndex" - ] - }, - "_rowType": { - "oneof": [ - "rowType" - ] - } - }, - "fields": { - "table": { - "type": "string", - "id": 1 - }, - "index": { - "type": "string", - "id": 2, - "options": { - "proto3_optional": true - } - }, - "requestIndex": { - "type": "int32", - "id": 3, - "options": { - "proto3_optional": true - } - }, - "row": { - "rule": "repeated", - "type": "ValueList", - "id": 4 - }, - "rowType": { - "type": "google.spanner.v1.StructType", - "id": 5, - "options": { - "proto3_optional": true - } - } - } - }, - "QueryResult": { - "oneofs": { - "_rowType": { - "oneof": [ - "rowType" - ] - } - }, - "fields": { - "row": { - "rule": "repeated", - "type": "ValueList", - "id": 1 - }, - "rowType": { - "type": "google.spanner.v1.StructType", - "id": 2, - "options": { - "proto3_optional": true - } - } - } - }, - "ChangeStreamRecord": { - "oneofs": { - "record": { - "oneof": [ - "dataChange", - "childPartition", - "heartbeat" - ] - } - }, - "fields": { - "dataChange": { - "type": "DataChangeRecord", - "id": 1 - }, - "childPartition": { - "type": "ChildPartitionsRecord", - "id": 2 - }, - "heartbeat": { - "type": "HeartbeatRecord", - "id": 3 - } - } - }, - "DataChangeRecord": { - "fields": { - "commitTime": { - "type": "google.protobuf.Timestamp", - "id": 1 - }, - "recordSequence": { - "type": "string", - "id": 2 - }, - "transactionId": { - "type": "string", - "id": 3 - }, - "isLastRecord": { - "type": "bool", - "id": 4 - }, - "table": { - "type": "string", - "id": 5 - }, - "columnTypes": { - "rule": "repeated", - "type": "ColumnType", - "id": 6 - }, - "mods": { - "rule": "repeated", - "type": "Mod", - "id": 7 - }, - "modType": { - "type": "string", - "id": 8 - }, - "valueCaptureType": { - "type": "string", - "id": 9 - }, - "recordCount": { - "type": "int64", - "id": 10 - }, - "partitionCount": { - "type": "int64", - "id": 11 - }, - "transactionTag": { - "type": "string", - "id": 12 - }, - "isSystemTransaction": { - "type": "bool", - "id": 13 - } - }, - "nested": { - "ColumnType": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "type": { - "type": "string", - "id": 2 - }, - "isPrimaryKey": { - "type": "bool", - "id": 3 - }, - "ordinalPosition": { - "type": "int64", - "id": 4 - } - } - }, - "Mod": { - "fields": { - "keys": { - "type": "string", - "id": 1 - }, - "newValues": { - "type": "string", - "id": 2 - }, - "oldValues": { - "type": "string", - "id": 3 - } - } - } - } - }, - "ChildPartitionsRecord": { - "fields": { - "startTime": { - "type": "google.protobuf.Timestamp", - "id": 1 - }, - "recordSequence": { - "type": "string", - "id": 2 - }, - "childPartitions": { - "rule": "repeated", - "type": "ChildPartition", - "id": 3 - } - }, - "nested": { - "ChildPartition": { - "fields": { - "token": { - "type": "string", - "id": 1 - }, - "parentPartitionTokens": { - "rule": "repeated", - "type": "string", - "id": 2 - } - } - } - } - }, - "HeartbeatRecord": { - "fields": { - "heartbeatTime": { - "type": "google.protobuf.Timestamp", - "id": 1 - } - } - }, - "SpannerOptions": { - "fields": { - "sessionPoolOptions": { - "type": "SessionPoolOptions", - "id": 1 - } - } - }, - "SessionPoolOptions": { - "fields": { - "useMultiplexed": { - "type": "bool", - "id": 1 - } - } - } - } - } - } - }, - "v1": { - "options": { - "csharp_namespace": "Google.Cloud.Spanner.V1", - "go_package": "cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb", - "java_multiple_files": true, - "java_outer_classname": "QueryPlanProto", - "java_package": "com.google.spanner.v1", - "php_namespace": "Google\\Cloud\\Spanner\\V1", - "ruby_package": "Google::Cloud::Spanner::V1", - "(google.api.resource_definition).type": "spanner.googleapis.com/Database", - "(google.api.resource_definition).pattern": "projects/{project}/instances/{instance}/databases/{database}" - }, - "nested": { - "Spanner": { - "options": { - "(google.api.default_host)": "spanner.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/spanner.data" - }, - "methods": { - "CreateSession": { - "requestType": "CreateSessionRequest", - "responseType": "Session", - "options": { - "(google.api.http).post": "/v1/{database=projects/*/instances/*/databases/*}/sessions", - "(google.api.http).body": "*", - "(google.api.method_signature)": "database" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{database=projects/*/instances/*/databases/*}/sessions", - "body": "*" - } - }, - { - "(google.api.method_signature)": "database" - } - ] - }, - "BatchCreateSessions": { - "requestType": "BatchCreateSessionsRequest", - "responseType": "BatchCreateSessionsResponse", - "options": { - "(google.api.http).post": "/v1/{database=projects/*/instances/*/databases/*}/sessions:batchCreate", - "(google.api.http).body": "*", - "(google.api.method_signature)": "database,session_count" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{database=projects/*/instances/*/databases/*}/sessions:batchCreate", - "body": "*" - } - }, - { - "(google.api.method_signature)": "database,session_count" - } - ] - }, - "GetSession": { - "requestType": "GetSessionRequest", - "responseType": "Session", - "options": { - "(google.api.http).get": "/v1/{name=projects/*/instances/*/databases/*/sessions/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=projects/*/instances/*/databases/*/sessions/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListSessions": { - "requestType": "ListSessionsRequest", - "responseType": "ListSessionsResponse", - "options": { - "(google.api.http).get": "/v1/{database=projects/*/instances/*/databases/*}/sessions", - "(google.api.method_signature)": "database" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{database=projects/*/instances/*/databases/*}/sessions" - } - }, - { - "(google.api.method_signature)": "database" - } - ] - }, - "DeleteSession": { - "requestType": "DeleteSessionRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v1/{name=projects/*/instances/*/databases/*/sessions/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1/{name=projects/*/instances/*/databases/*/sessions/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ExecuteSql": { - "requestType": "ExecuteSqlRequest", - "responseType": "ResultSet", - "options": { - "(google.api.http).post": "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:executeSql", - "(google.api.http).body": "*" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:executeSql", - "body": "*" - } - } - ] - }, - "ExecuteStreamingSql": { - "requestType": "ExecuteSqlRequest", - "responseType": "PartialResultSet", - "responseStream": true, - "options": { - "(google.api.http).post": "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:executeStreamingSql", - "(google.api.http).body": "*" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:executeStreamingSql", - "body": "*" - } - } - ] - }, - "ExecuteBatchDml": { - "requestType": "ExecuteBatchDmlRequest", - "responseType": "ExecuteBatchDmlResponse", - "options": { - "(google.api.http).post": "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:executeBatchDml", - "(google.api.http).body": "*" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:executeBatchDml", - "body": "*" - } - } - ] - }, - "Read": { - "requestType": "ReadRequest", - "responseType": "ResultSet", - "options": { - "(google.api.http).post": "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:read", - "(google.api.http).body": "*" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:read", - "body": "*" - } - } - ] - }, - "StreamingRead": { - "requestType": "ReadRequest", - "responseType": "PartialResultSet", - "responseStream": true, - "options": { - "(google.api.http).post": "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:streamingRead", - "(google.api.http).body": "*" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:streamingRead", - "body": "*" - } - } - ] - }, - "BeginTransaction": { - "requestType": "BeginTransactionRequest", - "responseType": "Transaction", - "options": { - "(google.api.http).post": "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:beginTransaction", - "(google.api.http).body": "*", - "(google.api.method_signature)": "session,options" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:beginTransaction", - "body": "*" - } - }, - { - "(google.api.method_signature)": "session,options" - } - ] - }, - "Commit": { - "requestType": "CommitRequest", - "responseType": "CommitResponse", - "options": { - "(google.api.http).post": "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:commit", - "(google.api.http).body": "*", - "(google.api.method_signature)": "session,single_use_transaction,mutations" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:commit", - "body": "*" - } - }, - { - "(google.api.method_signature)": "session,transaction_id,mutations" - }, - { - "(google.api.method_signature)": "session,single_use_transaction,mutations" - } - ] - }, - "Rollback": { - "requestType": "RollbackRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).post": "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:rollback", - "(google.api.http).body": "*", - "(google.api.method_signature)": "session,transaction_id" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:rollback", - "body": "*" - } - }, - { - "(google.api.method_signature)": "session,transaction_id" - } - ] - }, - "PartitionQuery": { - "requestType": "PartitionQueryRequest", - "responseType": "PartitionResponse", - "options": { - "(google.api.http).post": "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:partitionQuery", - "(google.api.http).body": "*" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:partitionQuery", - "body": "*" - } - } - ] - }, - "PartitionRead": { - "requestType": "PartitionReadRequest", - "responseType": "PartitionResponse", - "options": { - "(google.api.http).post": "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:partitionRead", - "(google.api.http).body": "*" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:partitionRead", - "body": "*" - } - } - ] - }, - "BatchWrite": { - "requestType": "BatchWriteRequest", - "responseType": "BatchWriteResponse", - "responseStream": true, - "options": { - "(google.api.http).post": "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:batchWrite", - "(google.api.http).body": "*", - "(google.api.method_signature)": "session,mutation_groups" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:batchWrite", - "body": "*" - } - }, - { - "(google.api.method_signature)": "session,mutation_groups" - } - ] - } - } - }, - "CreateSessionRequest": { - "fields": { - "database": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/Database" - } - }, - "session": { - "type": "Session", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "BatchCreateSessionsRequest": { - "fields": { - "database": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/Database" - } - }, - "sessionTemplate": { - "type": "Session", - "id": 2 - }, - "sessionCount": { - "type": "int32", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "BatchCreateSessionsResponse": { - "fields": { - "session": { - "rule": "repeated", - "type": "Session", - "id": 1 - } - } - }, - "Session": { - "options": { - "(google.api.resource).type": "spanner.googleapis.com/Session", - "(google.api.resource).pattern": "projects/{project}/instances/{instance}/databases/{database}/sessions/{session}", - "(google.api.resource).plural": "sessions", - "(google.api.resource).singular": "session" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 2 - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "approximateLastUseTime": { - "type": "google.protobuf.Timestamp", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "creatorRole": { - "type": "string", - "id": 5 - }, - "multiplexed": { - "type": "bool", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "GetSessionRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/Session" - } - } - } - }, - "ListSessionsRequest": { - "fields": { - "database": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/Database" - } - }, - "pageSize": { - "type": "int32", - "id": 2 - }, - "pageToken": { - "type": "string", - "id": 3 - }, - "filter": { - "type": "string", - "id": 4 - } - } - }, - "ListSessionsResponse": { - "fields": { - "sessions": { - "rule": "repeated", - "type": "Session", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "DeleteSessionRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/Session" - } - } - } - }, - "RequestOptions": { - "fields": { - "priority": { - "type": "Priority", - "id": 1 - }, - "requestTag": { - "type": "string", - "id": 2 - }, - "transactionTag": { - "type": "string", - "id": 3 - }, - "clientContext": { - "type": "ClientContext", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "Priority": { - "values": { - "PRIORITY_UNSPECIFIED": 0, - "PRIORITY_LOW": 1, - "PRIORITY_MEDIUM": 2, - "PRIORITY_HIGH": 3 - } - }, - "ClientContext": { - "fields": { - "secureContext": { - "keyType": "string", - "type": "google.protobuf.Value", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - } - } - }, - "DirectedReadOptions": { - "oneofs": { - "replicas": { - "oneof": [ - "includeReplicas", - "excludeReplicas" - ] - } - }, - "fields": { - "includeReplicas": { - "type": "IncludeReplicas", - "id": 1 - }, - "excludeReplicas": { - "type": "ExcludeReplicas", - "id": 2 - } - }, - "nested": { - "ReplicaSelection": { - "fields": { - "location": { - "type": "string", - "id": 1 - }, - "type": { - "type": "Type", - "id": 2 - } - }, - "nested": { - "Type": { - "values": { - "TYPE_UNSPECIFIED": 0, - "READ_WRITE": 1, - "READ_ONLY": 2 - } - } - } - }, - "IncludeReplicas": { - "fields": { - "replicaSelections": { - "rule": "repeated", - "type": "ReplicaSelection", - "id": 1 - }, - "autoFailoverDisabled": { - "type": "bool", - "id": 2 - } - } - }, - "ExcludeReplicas": { - "fields": { - "replicaSelections": { - "rule": "repeated", - "type": "ReplicaSelection", - "id": 1 - } - } - } - } - }, - "ExecuteSqlRequest": { - "fields": { - "session": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/Session" - } - }, - "transaction": { - "type": "TransactionSelector", - "id": 2 - }, - "sql": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "params": { - "type": "google.protobuf.Struct", - "id": 4 - }, - "paramTypes": { - "keyType": "string", - "type": "Type", - "id": 5 - }, - "resumeToken": { - "type": "bytes", - "id": 6 - }, - "queryMode": { - "type": "QueryMode", - "id": 7 - }, - "partitionToken": { - "type": "bytes", - "id": 8 - }, - "seqno": { - "type": "int64", - "id": 9 - }, - "queryOptions": { - "type": "QueryOptions", - "id": 10 - }, - "requestOptions": { - "type": "RequestOptions", - "id": 11 - }, - "directedReadOptions": { - "type": "DirectedReadOptions", - "id": 15 - }, - "dataBoostEnabled": { - "type": "bool", - "id": 16 - }, - "lastStatement": { - "type": "bool", - "id": 17, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "routingHint": { - "type": "RoutingHint", - "id": 18, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "QueryMode": { - "values": { - "NORMAL": 0, - "PLAN": 1, - "PROFILE": 2, - "WITH_STATS": 3, - "WITH_PLAN_AND_STATS": 4 - } - }, - "QueryOptions": { - "fields": { - "optimizerVersion": { - "type": "string", - "id": 1 - }, - "optimizerStatisticsPackage": { - "type": "string", - "id": 2 - } - } - } - } - }, - "ExecuteBatchDmlRequest": { - "fields": { - "session": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/Session" - } - }, - "transaction": { - "type": "TransactionSelector", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "statements": { - "rule": "repeated", - "type": "Statement", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "seqno": { - "type": "int64", - "id": 4, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "requestOptions": { - "type": "RequestOptions", - "id": 5 - }, - "lastStatements": { - "type": "bool", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "Statement": { - "fields": { - "sql": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "params": { - "type": "google.protobuf.Struct", - "id": 2 - }, - "paramTypes": { - "keyType": "string", - "type": "Type", - "id": 3 - } - } - } - } - }, - "ExecuteBatchDmlResponse": { - "fields": { - "resultSets": { - "rule": "repeated", - "type": "ResultSet", - "id": 1 - }, - "status": { - "type": "google.rpc.Status", - "id": 2 - }, - "precommitToken": { - "type": "MultiplexedSessionPrecommitToken", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "PartitionOptions": { - "fields": { - "partitionSizeBytes": { - "type": "int64", - "id": 1 - }, - "maxPartitions": { - "type": "int64", - "id": 2 - } - } - }, - "PartitionQueryRequest": { - "fields": { - "session": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/Session" - } - }, - "transaction": { - "type": "TransactionSelector", - "id": 2 - }, - "sql": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "params": { - "type": "google.protobuf.Struct", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "paramTypes": { - "keyType": "string", - "type": "Type", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "partitionOptions": { - "type": "PartitionOptions", - "id": 6 - } - } - }, - "PartitionReadRequest": { - "fields": { - "session": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/Session" - } - }, - "transaction": { - "type": "TransactionSelector", - "id": 2 - }, - "table": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "index": { - "type": "string", - "id": 4 - }, - "columns": { - "rule": "repeated", - "type": "string", - "id": 5 - }, - "keySet": { - "type": "KeySet", - "id": 6, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "partitionOptions": { - "type": "PartitionOptions", - "id": 9 - } - } - }, - "Partition": { - "fields": { - "partitionToken": { - "type": "bytes", - "id": 1 - } - } - }, - "PartitionResponse": { - "fields": { - "partitions": { - "rule": "repeated", - "type": "Partition", - "id": 1 - }, - "transaction": { - "type": "Transaction", - "id": 2 - } - } - }, - "ReadRequest": { - "fields": { - "session": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/Session" - } - }, - "transaction": { - "type": "TransactionSelector", - "id": 2 - }, - "table": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "index": { - "type": "string", - "id": 4 - }, - "columns": { - "rule": "repeated", - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "keySet": { - "type": "KeySet", - "id": 6, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "limit": { - "type": "int64", - "id": 8 - }, - "resumeToken": { - "type": "bytes", - "id": 9 - }, - "partitionToken": { - "type": "bytes", - "id": 10 - }, - "requestOptions": { - "type": "RequestOptions", - "id": 11 - }, - "directedReadOptions": { - "type": "DirectedReadOptions", - "id": 14 - }, - "dataBoostEnabled": { - "type": "bool", - "id": 15 - }, - "orderBy": { - "type": "OrderBy", - "id": 16, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "lockHint": { - "type": "LockHint", - "id": 17, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "routingHint": { - "type": "RoutingHint", - "id": 18, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "OrderBy": { - "values": { - "ORDER_BY_UNSPECIFIED": 0, - "ORDER_BY_PRIMARY_KEY": 1, - "ORDER_BY_NO_ORDER": 2 - } - }, - "LockHint": { - "values": { - "LOCK_HINT_UNSPECIFIED": 0, - "LOCK_HINT_SHARED": 1, - "LOCK_HINT_EXCLUSIVE": 2 - } - } - } - }, - "BeginTransactionRequest": { - "fields": { - "session": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/Session" - } - }, - "options": { - "type": "TransactionOptions", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "requestOptions": { - "type": "RequestOptions", - "id": 3 - }, - "mutationKey": { - "type": "Mutation", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "CommitRequest": { - "oneofs": { - "transaction": { - "oneof": [ - "transactionId", - "singleUseTransaction" - ] - } - }, - "fields": { - "session": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/Session" - } - }, - "transactionId": { - "type": "bytes", - "id": 2 - }, - "singleUseTransaction": { - "type": "TransactionOptions", - "id": 3 - }, - "mutations": { - "rule": "repeated", - "type": "Mutation", - "id": 4 - }, - "returnCommitStats": { - "type": "bool", - "id": 5 - }, - "maxCommitDelay": { - "type": "google.protobuf.Duration", - "id": 8, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "requestOptions": { - "type": "RequestOptions", - "id": 6 - }, - "precommitToken": { - "type": "MultiplexedSessionPrecommitToken", - "id": 9, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "RollbackRequest": { - "fields": { - "session": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/Session" - } - }, - "transactionId": { - "type": "bytes", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "BatchWriteRequest": { - "fields": { - "session": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/Session" - } - }, - "requestOptions": { - "type": "RequestOptions", - "id": 3 - }, - "mutationGroups": { - "rule": "repeated", - "type": "MutationGroup", - "id": 4, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "excludeTxnFromChangeStreams": { - "type": "bool", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "MutationGroup": { - "fields": { - "mutations": { - "rule": "repeated", - "type": "Mutation", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - } - } - }, - "BatchWriteResponse": { - "fields": { - "indexes": { - "rule": "repeated", - "type": "int32", - "id": 1 - }, - "status": { - "type": "google.rpc.Status", - "id": 2 - }, - "commitTimestamp": { - "type": "google.protobuf.Timestamp", - "id": 3 - } - } - }, - "CommitResponse": { - "oneofs": { - "MultiplexedSessionRetry": { - "oneof": [ - "precommitToken" - ] - } - }, - "fields": { - "commitTimestamp": { - "type": "google.protobuf.Timestamp", - "id": 1 - }, - "commitStats": { - "type": "CommitStats", - "id": 2 - }, - "precommitToken": { - "type": "MultiplexedSessionPrecommitToken", - "id": 4 - }, - "snapshotTimestamp": { - "type": "google.protobuf.Timestamp", - "id": 5 - } - }, - "nested": { - "CommitStats": { - "fields": { - "mutationCount": { - "type": "int64", - "id": 1 - } - } - } - } - }, - "TransactionOptions": { - "oneofs": { - "mode": { - "oneof": [ - "readWrite", - "partitionedDml", - "readOnly" - ] - } - }, - "fields": { - "readWrite": { - "type": "ReadWrite", - "id": 1 - }, - "partitionedDml": { - "type": "PartitionedDml", - "id": 3 - }, - "readOnly": { - "type": "ReadOnly", - "id": 2 - }, - "excludeTxnFromChangeStreams": { - "type": "bool", - "id": 5 - }, - "isolationLevel": { - "type": "IsolationLevel", - "id": 6 - } - }, - "nested": { - "ReadWrite": { - "fields": { - "readLockMode": { - "type": "ReadLockMode", - "id": 1 - }, - "multiplexedSessionPreviousTransactionId": { - "type": "bytes", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "ReadLockMode": { - "values": { - "READ_LOCK_MODE_UNSPECIFIED": 0, - "PESSIMISTIC": 1, - "OPTIMISTIC": 2 - } - } - } - }, - "PartitionedDml": { - "fields": {} - }, - "ReadOnly": { - "oneofs": { - "timestampBound": { - "oneof": [ - "strong", - "minReadTimestamp", - "maxStaleness", - "readTimestamp", - "exactStaleness" - ] - } - }, - "fields": { - "strong": { - "type": "bool", - "id": 1 - }, - "minReadTimestamp": { - "type": "google.protobuf.Timestamp", - "id": 2 - }, - "maxStaleness": { - "type": "google.protobuf.Duration", - "id": 3 - }, - "readTimestamp": { - "type": "google.protobuf.Timestamp", - "id": 4 - }, - "exactStaleness": { - "type": "google.protobuf.Duration", - "id": 5 - }, - "returnReadTimestamp": { - "type": "bool", - "id": 6 - } - } - }, - "IsolationLevel": { - "values": { - "ISOLATION_LEVEL_UNSPECIFIED": 0, - "SERIALIZABLE": 1, - "REPEATABLE_READ": 2 - } - } - } - }, - "Transaction": { - "fields": { - "id": { - "type": "bytes", - "id": 1 - }, - "readTimestamp": { - "type": "google.protobuf.Timestamp", - "id": 2 - }, - "precommitToken": { - "type": "MultiplexedSessionPrecommitToken", - "id": 3 - } - } - }, - "TransactionSelector": { - "oneofs": { - "selector": { - "oneof": [ - "singleUse", - "id", - "begin" - ] - } - }, - "fields": { - "singleUse": { - "type": "TransactionOptions", - "id": 1 - }, - "id": { - "type": "bytes", - "id": 2 - }, - "begin": { - "type": "TransactionOptions", - "id": 3 - } - } - }, - "MultiplexedSessionPrecommitToken": { - "fields": { - "precommitToken": { - "type": "bytes", - "id": 1 - }, - "seqNum": { - "type": "int32", - "id": 2 - } - } - }, - "KeyRange": { - "oneofs": { - "startKeyType": { - "oneof": [ - "startClosed", - "startOpen" - ] - }, - "endKeyType": { - "oneof": [ - "endClosed", - "endOpen" - ] - } - }, - "fields": { - "startClosed": { - "type": "google.protobuf.ListValue", - "id": 1 - }, - "startOpen": { - "type": "google.protobuf.ListValue", - "id": 2 - }, - "endClosed": { - "type": "google.protobuf.ListValue", - "id": 3 - }, - "endOpen": { - "type": "google.protobuf.ListValue", - "id": 4 - } - } - }, - "KeySet": { - "fields": { - "keys": { - "rule": "repeated", - "type": "google.protobuf.ListValue", - "id": 1 - }, - "ranges": { - "rule": "repeated", - "type": "KeyRange", - "id": 2 - }, - "all": { - "type": "bool", - "id": 3 - } - } - }, - "Range": { - "fields": { - "startKey": { - "type": "bytes", - "id": 1 - }, - "limitKey": { - "type": "bytes", - "id": 2 - }, - "groupUid": { - "type": "uint64", - "id": 3 - }, - "splitId": { - "type": "uint64", - "id": 4 - }, - "generation": { - "type": "bytes", - "id": 5 - } - } - }, - "Tablet": { - "fields": { - "tabletUid": { - "type": "uint64", - "id": 1 - }, - "serverAddress": { - "type": "string", - "id": 2 - }, - "location": { - "type": "string", - "id": 3 - }, - "role": { - "type": "Role", - "id": 4 - }, - "incarnation": { - "type": "bytes", - "id": 5 - }, - "distance": { - "type": "uint32", - "id": 6 - }, - "skip": { - "type": "bool", - "id": 7 - } - }, - "nested": { - "Role": { - "values": { - "ROLE_UNSPECIFIED": 0, - "READ_WRITE": 1, - "READ_ONLY": 2 - } - } - } - }, - "Group": { - "fields": { - "groupUid": { - "type": "uint64", - "id": 1 - }, - "tablets": { - "rule": "repeated", - "type": "Tablet", - "id": 2 - }, - "leaderIndex": { - "type": "int32", - "id": 3 - }, - "generation": { - "type": "bytes", - "id": 4 - } - } - }, - "KeyRecipe": { - "oneofs": { - "target": { - "oneof": [ - "tableName", - "indexName", - "operationUid" - ] - } - }, - "fields": { - "tableName": { - "type": "string", - "id": 1 - }, - "indexName": { - "type": "string", - "id": 2 - }, - "operationUid": { - "type": "uint64", - "id": 3 - }, - "part": { - "rule": "repeated", - "type": "Part", - "id": 4 - } - }, - "nested": { - "Part": { - "oneofs": { - "valueType": { - "oneof": [ - "identifier", - "value", - "random" - ] - } - }, - "fields": { - "tag": { - "type": "uint32", - "id": 1 - }, - "order": { - "type": "Order", - "id": 2 - }, - "nullOrder": { - "type": "NullOrder", - "id": 3 - }, - "type": { - "type": "Type", - "id": 4 - }, - "identifier": { - "type": "string", - "id": 5 - }, - "value": { - "type": "google.protobuf.Value", - "id": 6 - }, - "random": { - "type": "bool", - "id": 8 - }, - "structIdentifiers": { - "rule": "repeated", - "type": "int32", - "id": 7 - } - }, - "nested": { - "Order": { - "values": { - "ORDER_UNSPECIFIED": 0, - "ASCENDING": 1, - "DESCENDING": 2 - } - }, - "NullOrder": { - "values": { - "NULL_ORDER_UNSPECIFIED": 0, - "NULLS_FIRST": 1, - "NULLS_LAST": 2, - "NOT_NULL": 3 - } - } - } - } - } - }, - "RecipeList": { - "fields": { - "schemaGeneration": { - "type": "bytes", - "id": 1 - }, - "recipe": { - "rule": "repeated", - "type": "KeyRecipe", - "id": 3 - } - } - }, - "CacheUpdate": { - "fields": { - "databaseId": { - "type": "uint64", - "id": 1 - }, - "range": { - "rule": "repeated", - "type": "Range", - "id": 2 - }, - "group": { - "rule": "repeated", - "type": "Group", - "id": 3 - }, - "keyRecipes": { - "type": "RecipeList", - "id": 5 - } - } - }, - "RoutingHint": { - "fields": { - "operationUid": { - "type": "uint64", - "id": 1 - }, - "databaseId": { - "type": "uint64", - "id": 2 - }, - "schemaGeneration": { - "type": "bytes", - "id": 3 - }, - "key": { - "type": "bytes", - "id": 4 - }, - "limitKey": { - "type": "bytes", - "id": 5 - }, - "groupUid": { - "type": "uint64", - "id": 6 - }, - "splitId": { - "type": "uint64", - "id": 7 - }, - "tabletUid": { - "type": "uint64", - "id": 8 - }, - "skippedTabletUid": { - "rule": "repeated", - "type": "SkippedTablet", - "id": 9 - }, - "clientLocation": { - "type": "string", - "id": 10 - } - }, - "nested": { - "SkippedTablet": { - "fields": { - "tabletUid": { - "type": "uint64", - "id": 1 - }, - "incarnation": { - "type": "bytes", - "id": 2 - } - } - } - } - }, - "Type": { - "fields": { - "code": { - "type": "TypeCode", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "arrayElementType": { - "type": "Type", - "id": 2 - }, - "structType": { - "type": "StructType", - "id": 3 - }, - "typeAnnotation": { - "type": "TypeAnnotationCode", - "id": 4 - }, - "protoTypeFqn": { - "type": "string", - "id": 5 - } - } - }, - "StructType": { - "fields": { - "fields": { - "rule": "repeated", - "type": "Field", - "id": 1 - } - }, - "nested": { - "Field": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "type": { - "type": "Type", - "id": 2 - } - } - } - } - }, - "TypeCode": { - "values": { - "TYPE_CODE_UNSPECIFIED": 0, - "BOOL": 1, - "INT64": 2, - "FLOAT64": 3, - "FLOAT32": 15, - "TIMESTAMP": 4, - "DATE": 5, - "STRING": 6, - "BYTES": 7, - "ARRAY": 8, - "STRUCT": 9, - "NUMERIC": 10, - "JSON": 11, - "PROTO": 13, - "ENUM": 14, - "INTERVAL": 16, - "UUID": 17 - } - }, - "TypeAnnotationCode": { - "values": { - "TYPE_ANNOTATION_CODE_UNSPECIFIED": 0, - "PG_NUMERIC": 2, - "PG_JSONB": 3, - "PG_OID": 4 - } - }, - "Mutation": { - "oneofs": { - "operation": { - "oneof": [ - "insert", - "update", - "insertOrUpdate", - "replace", - "delete", - "send", - "ack" - ] - } - }, - "fields": { - "insert": { - "type": "Write", - "id": 1 - }, - "update": { - "type": "Write", - "id": 2 - }, - "insertOrUpdate": { - "type": "Write", - "id": 3 - }, - "replace": { - "type": "Write", - "id": 4 - }, - "delete": { - "type": "Delete", - "id": 5 - }, - "send": { - "type": "Send", - "id": 6 - }, - "ack": { - "type": "Ack", - "id": 7 - } - }, - "nested": { - "Write": { - "fields": { - "table": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "columns": { - "rule": "repeated", - "type": "string", - "id": 2 - }, - "values": { - "rule": "repeated", - "type": "google.protobuf.ListValue", - "id": 3 - } - } - }, - "Delete": { - "fields": { - "table": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "keySet": { - "type": "KeySet", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "Send": { - "fields": { - "queue": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "key": { - "type": "google.protobuf.ListValue", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "deliverTime": { - "type": "google.protobuf.Timestamp", - "id": 3 - }, - "payload": { - "type": "google.protobuf.Value", - "id": 4 - } - } - }, - "Ack": { - "fields": { - "queue": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "key": { - "type": "google.protobuf.ListValue", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "ignoreNotFound": { - "type": "bool", - "id": 3 - } - } - } - } - }, - "ResultSet": { - "fields": { - "metadata": { - "type": "ResultSetMetadata", - "id": 1 - }, - "rows": { - "rule": "repeated", - "type": "google.protobuf.ListValue", - "id": 2 - }, - "stats": { - "type": "ResultSetStats", - "id": 3 - }, - "precommitToken": { - "type": "MultiplexedSessionPrecommitToken", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "cacheUpdate": { - "type": "CacheUpdate", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "PartialResultSet": { - "fields": { - "metadata": { - "type": "ResultSetMetadata", - "id": 1 - }, - "values": { - "rule": "repeated", - "type": "google.protobuf.Value", - "id": 2 - }, - "chunkedValue": { - "type": "bool", - "id": 3 - }, - "resumeToken": { - "type": "bytes", - "id": 4 - }, - "stats": { - "type": "ResultSetStats", - "id": 5 - }, - "precommitToken": { - "type": "MultiplexedSessionPrecommitToken", - "id": 8, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "last": { - "type": "bool", - "id": 9, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "cacheUpdate": { - "type": "CacheUpdate", - "id": 10, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ResultSetMetadata": { - "fields": { - "rowType": { - "type": "StructType", - "id": 1 - }, - "transaction": { - "type": "Transaction", - "id": 2 - }, - "undeclaredParameters": { - "type": "StructType", - "id": 3 - } - } - }, - "ResultSetStats": { - "oneofs": { - "rowCount": { - "oneof": [ - "rowCountExact", - "rowCountLowerBound" - ] - } - }, - "fields": { - "queryPlan": { - "type": "QueryPlan", - "id": 1 - }, - "queryStats": { - "type": "google.protobuf.Struct", - "id": 2 - }, - "rowCountExact": { - "type": "int64", - "id": 3 - }, - "rowCountLowerBound": { - "type": "int64", - "id": 4 - } - } - }, - "PlanNode": { - "fields": { - "index": { - "type": "int32", - "id": 1 - }, - "kind": { - "type": "Kind", - "id": 2 - }, - "displayName": { - "type": "string", - "id": 3 - }, - "childLinks": { - "rule": "repeated", - "type": "ChildLink", - "id": 4 - }, - "shortRepresentation": { - "type": "ShortRepresentation", - "id": 5 - }, - "metadata": { - "type": "google.protobuf.Struct", - "id": 6 - }, - "executionStats": { - "type": "google.protobuf.Struct", - "id": 7 - } - }, - "nested": { - "Kind": { - "values": { - "KIND_UNSPECIFIED": 0, - "RELATIONAL": 1, - "SCALAR": 2 - } - }, - "ChildLink": { - "fields": { - "childIndex": { - "type": "int32", - "id": 1 - }, - "type": { - "type": "string", - "id": 2 - }, - "variable": { - "type": "string", - "id": 3 - } - } - }, - "ShortRepresentation": { - "fields": { - "description": { - "type": "string", - "id": 1 - }, - "subqueries": { - "keyType": "string", - "type": "int32", - "id": 2 - } - } - } - } - }, - "QueryAdvisorResult": { - "fields": { - "indexAdvice": { - "rule": "repeated", - "type": "IndexAdvice", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "IndexAdvice": { - "fields": { - "ddl": { - "rule": "repeated", - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "improvementFactor": { - "type": "double", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - } - } - }, - "QueryPlan": { - "fields": { - "planNodes": { - "rule": "repeated", - "type": "PlanNode", - "id": 1 - }, - "queryAdvice": { - "type": "QueryAdvisorResult", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - } - } - } - } - }, - "api": { - "options": { - "go_package": "google.golang.org/genproto/googleapis/api;api", - "java_multiple_files": true, - "java_outer_classname": "LaunchStageProto", - "java_package": "com.google.api", - "objc_class_prefix": "GAPI", - "cc_enable_arenas": true - }, - "nested": { - "fieldBehavior": { - "rule": "repeated", - "type": "google.api.FieldBehavior", - "id": 1052, - "extend": "google.protobuf.FieldOptions", - "options": { - "packed": false - } - }, - "FieldBehavior": { - "values": { - "FIELD_BEHAVIOR_UNSPECIFIED": 0, - "OPTIONAL": 1, - "REQUIRED": 2, - "OUTPUT_ONLY": 3, - "INPUT_ONLY": 4, - "IMMUTABLE": 5, - "UNORDERED_LIST": 6, - "NON_EMPTY_DEFAULT": 7, - "IDENTIFIER": 8 - } - }, - "resourceReference": { - "type": "google.api.ResourceReference", - "id": 1055, - "extend": "google.protobuf.FieldOptions" - }, - "resourceDefinition": { - "rule": "repeated", - "type": "google.api.ResourceDescriptor", - "id": 1053, - "extend": "google.protobuf.FileOptions" - }, - "resource": { - "type": "google.api.ResourceDescriptor", - "id": 1053, - "extend": "google.protobuf.MessageOptions" - }, - "ResourceDescriptor": { - "fields": { - "type": { - "type": "string", - "id": 1 - }, - "pattern": { - "rule": "repeated", - "type": "string", - "id": 2 - }, - "nameField": { - "type": "string", - "id": 3 - }, - "history": { - "type": "History", - "id": 4 - }, - "plural": { - "type": "string", - "id": 5 - }, - "singular": { - "type": "string", - "id": 6 - }, - "style": { - "rule": "repeated", - "type": "Style", - "id": 10 - } - }, - "nested": { - "History": { - "values": { - "HISTORY_UNSPECIFIED": 0, - "ORIGINALLY_SINGLE_PATTERN": 1, - "FUTURE_MULTI_PATTERN": 2 - } - }, - "Style": { - "values": { - "STYLE_UNSPECIFIED": 0, - "DECLARATIVE_FRIENDLY": 1 - } - } - } - }, - "ResourceReference": { - "fields": { - "type": { - "type": "string", - "id": 1 - }, - "childType": { - "type": "string", - "id": 2 - } - } - }, - "http": { - "type": "HttpRule", - "id": 72295728, - "extend": "google.protobuf.MethodOptions" - }, - "Http": { - "fields": { - "rules": { - "rule": "repeated", - "type": "HttpRule", - "id": 1 - }, - "fullyDecodeReservedExpansion": { - "type": "bool", - "id": 2 - } - } - }, - "HttpRule": { - "oneofs": { - "pattern": { - "oneof": [ - "get", - "put", - "post", - "delete", - "patch", - "custom" - ] - } - }, - "fields": { - "selector": { - "type": "string", - "id": 1 - }, - "get": { - "type": "string", - "id": 2 - }, - "put": { - "type": "string", - "id": 3 - }, - "post": { - "type": "string", - "id": 4 - }, - "delete": { - "type": "string", - "id": 5 - }, - "patch": { - "type": "string", - "id": 6 - }, - "custom": { - "type": "CustomHttpPattern", - "id": 8 - }, - "body": { - "type": "string", - "id": 7 - }, - "responseBody": { - "type": "string", - "id": 12 - }, - "additionalBindings": { - "rule": "repeated", - "type": "HttpRule", - "id": 11 - } - } - }, - "CustomHttpPattern": { - "fields": { - "kind": { - "type": "string", - "id": 1 - }, - "path": { - "type": "string", - "id": 2 - } - } - }, - "methodSignature": { - "rule": "repeated", - "type": "string", - "id": 1051, - "extend": "google.protobuf.MethodOptions" - }, - "defaultHost": { - "type": "string", - "id": 1049, - "extend": "google.protobuf.ServiceOptions" - }, - "oauthScopes": { - "type": "string", - "id": 1050, - "extend": "google.protobuf.ServiceOptions" - }, - "apiVersion": { - "type": "string", - "id": 525000001, - "extend": "google.protobuf.ServiceOptions" - }, - "CommonLanguageSettings": { - "fields": { - "referenceDocsUri": { - "type": "string", - "id": 1, - "options": { - "deprecated": true - } - }, - "destinations": { - "rule": "repeated", - "type": "ClientLibraryDestination", - "id": 2 - } - } - }, - "ClientLibrarySettings": { - "fields": { - "version": { - "type": "string", - "id": 1 - }, - "launchStage": { - "type": "LaunchStage", - "id": 2 - }, - "restNumericEnums": { - "type": "bool", - "id": 3 - }, - "javaSettings": { - "type": "JavaSettings", - "id": 21 - }, - "cppSettings": { - "type": "CppSettings", - "id": 22 - }, - "phpSettings": { - "type": "PhpSettings", - "id": 23 - }, - "pythonSettings": { - "type": "PythonSettings", - "id": 24 - }, - "nodeSettings": { - "type": "NodeSettings", - "id": 25 - }, - "dotnetSettings": { - "type": "DotnetSettings", - "id": 26 - }, - "rubySettings": { - "type": "RubySettings", - "id": 27 - }, - "goSettings": { - "type": "GoSettings", - "id": 28 - } - } - }, - "Publishing": { - "fields": { - "methodSettings": { - "rule": "repeated", - "type": "MethodSettings", - "id": 2 - }, - "newIssueUri": { - "type": "string", - "id": 101 - }, - "documentationUri": { - "type": "string", - "id": 102 - }, - "apiShortName": { - "type": "string", - "id": 103 - }, - "githubLabel": { - "type": "string", - "id": 104 - }, - "codeownerGithubTeams": { - "rule": "repeated", - "type": "string", - "id": 105 - }, - "docTagPrefix": { - "type": "string", - "id": 106 - }, - "organization": { - "type": "ClientLibraryOrganization", - "id": 107 - }, - "librarySettings": { - "rule": "repeated", - "type": "ClientLibrarySettings", - "id": 109 - }, - "protoReferenceDocumentationUri": { - "type": "string", - "id": 110 - }, - "restReferenceDocumentationUri": { - "type": "string", - "id": 111 - } - } - }, - "JavaSettings": { - "fields": { - "libraryPackage": { - "type": "string", - "id": 1 - }, - "serviceClassNames": { - "keyType": "string", - "type": "string", - "id": 2 - }, - "common": { - "type": "CommonLanguageSettings", - "id": 3 - } - } - }, - "CppSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "PhpSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "PythonSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "NodeSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "DotnetSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - }, - "renamedServices": { - "keyType": "string", - "type": "string", - "id": 2 - }, - "renamedResources": { - "keyType": "string", - "type": "string", - "id": 3 - }, - "ignoredResources": { - "rule": "repeated", - "type": "string", - "id": 4 - }, - "forcedNamespaceAliases": { - "rule": "repeated", - "type": "string", - "id": 5 - }, - "handwrittenSignatures": { - "rule": "repeated", - "type": "string", - "id": 6 - } - } - }, - "RubySettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "GoSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "MethodSettings": { - "fields": { - "selector": { - "type": "string", - "id": 1 - }, - "longRunning": { - "type": "LongRunning", - "id": 2 - }, - "autoPopulatedFields": { - "rule": "repeated", - "type": "string", - "id": 3 - } - }, - "nested": { - "LongRunning": { - "fields": { - "initialPollDelay": { - "type": "google.protobuf.Duration", - "id": 1 - }, - "pollDelayMultiplier": { - "type": "float", - "id": 2 - }, - "maxPollDelay": { - "type": "google.protobuf.Duration", - "id": 3 - }, - "totalPollTimeout": { - "type": "google.protobuf.Duration", - "id": 4 - } - } - } - } - }, - "ClientLibraryOrganization": { - "values": { - "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": 0, - "CLOUD": 1, - "ADS": 2, - "PHOTOS": 3, - "STREET_VIEW": 4, - "SHOPPING": 5, - "GEO": 6, - "GENERATIVE_AI": 7 - } - }, - "ClientLibraryDestination": { - "values": { - "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": 0, - "GITHUB": 10, - "PACKAGE_MANAGER": 20 - } - }, - "LaunchStage": { - "values": { - "LAUNCH_STAGE_UNSPECIFIED": 0, - "UNIMPLEMENTED": 6, - "PRELAUNCH": 7, - "EARLY_ACCESS": 1, - "ALPHA": 2, - "BETA": 3, - "GA": 4, - "DEPRECATED": 5 - } - } - } - }, - "protobuf": { - "options": { - "go_package": "google.golang.org/protobuf/types/descriptorpb", - "java_package": "com.google.protobuf", - "java_outer_classname": "DescriptorProtos", - "csharp_namespace": "Google.Protobuf.Reflection", - "objc_class_prefix": "GPB", - "cc_enable_arenas": true, - "optimize_for": "SPEED" - }, - "nested": { - "FileDescriptorSet": { - "edition": "proto2", - "fields": { - "file": { - "rule": "repeated", - "type": "FileDescriptorProto", - "id": 1 - } - } - }, - "Edition": { - "edition": "proto2", - "values": { - "EDITION_UNKNOWN": 0, - "EDITION_PROTO2": 998, - "EDITION_PROTO3": 999, - "EDITION_2023": 1000, - "EDITION_2024": 1001, - "EDITION_1_TEST_ONLY": 1, - "EDITION_2_TEST_ONLY": 2, - "EDITION_99997_TEST_ONLY": 99997, - "EDITION_99998_TEST_ONLY": 99998, - "EDITION_99999_TEST_ONLY": 99999, - "EDITION_MAX": 2147483647 - } - }, - "FileDescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "package": { - "type": "string", - "id": 2 - }, - "dependency": { - "rule": "repeated", - "type": "string", - "id": 3 - }, - "publicDependency": { - "rule": "repeated", - "type": "int32", - "id": 10 - }, - "weakDependency": { - "rule": "repeated", - "type": "int32", - "id": 11 - }, - "messageType": { - "rule": "repeated", - "type": "DescriptorProto", - "id": 4 - }, - "enumType": { - "rule": "repeated", - "type": "EnumDescriptorProto", - "id": 5 - }, - "service": { - "rule": "repeated", - "type": "ServiceDescriptorProto", - "id": 6 - }, - "extension": { - "rule": "repeated", - "type": "FieldDescriptorProto", - "id": 7 - }, - "options": { - "type": "FileOptions", - "id": 8 - }, - "sourceCodeInfo": { - "type": "SourceCodeInfo", - "id": 9 - }, - "syntax": { - "type": "string", - "id": 12 - }, - "edition": { - "type": "Edition", - "id": 14 - } - } - }, - "DescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "field": { - "rule": "repeated", - "type": "FieldDescriptorProto", - "id": 2 - }, - "extension": { - "rule": "repeated", - "type": "FieldDescriptorProto", - "id": 6 - }, - "nestedType": { - "rule": "repeated", - "type": "DescriptorProto", - "id": 3 - }, - "enumType": { - "rule": "repeated", - "type": "EnumDescriptorProto", - "id": 4 - }, - "extensionRange": { - "rule": "repeated", - "type": "ExtensionRange", - "id": 5 - }, - "oneofDecl": { - "rule": "repeated", - "type": "OneofDescriptorProto", - "id": 8 - }, - "options": { - "type": "MessageOptions", - "id": 7 - }, - "reservedRange": { - "rule": "repeated", - "type": "ReservedRange", - "id": 9 - }, - "reservedName": { - "rule": "repeated", - "type": "string", - "id": 10 - } - }, - "nested": { - "ExtensionRange": { - "fields": { - "start": { - "type": "int32", - "id": 1 - }, - "end": { - "type": "int32", - "id": 2 - }, - "options": { - "type": "ExtensionRangeOptions", - "id": 3 - } - } - }, - "ReservedRange": { - "fields": { - "start": { - "type": "int32", - "id": 1 - }, - "end": { - "type": "int32", - "id": 2 - } - } - } - } - }, - "ExtensionRangeOptions": { - "edition": "proto2", - "fields": { - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - }, - "declaration": { - "rule": "repeated", - "type": "Declaration", - "id": 2, - "options": { - "retention": "RETENTION_SOURCE" - } - }, - "features": { - "type": "FeatureSet", - "id": 50 - }, - "verification": { - "type": "VerificationState", - "id": 3, - "options": { - "default": "UNVERIFIED", - "retention": "RETENTION_SOURCE" - } - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "nested": { - "Declaration": { - "fields": { - "number": { - "type": "int32", - "id": 1 - }, - "fullName": { - "type": "string", - "id": 2 - }, - "type": { - "type": "string", - "id": 3 - }, - "reserved": { - "type": "bool", - "id": 5 - }, - "repeated": { - "type": "bool", - "id": 6 - } - }, - "reserved": [ - [ - 4, - 4 - ] - ] - }, - "VerificationState": { - "values": { - "DECLARATION": 0, - "UNVERIFIED": 1 - } - } - } - }, - "FieldDescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "number": { - "type": "int32", - "id": 3 - }, - "label": { - "type": "Label", - "id": 4 - }, - "type": { - "type": "Type", - "id": 5 - }, - "typeName": { - "type": "string", - "id": 6 - }, - "extendee": { - "type": "string", - "id": 2 - }, - "defaultValue": { - "type": "string", - "id": 7 - }, - "oneofIndex": { - "type": "int32", - "id": 9 - }, - "jsonName": { - "type": "string", - "id": 10 - }, - "options": { - "type": "FieldOptions", - "id": 8 - }, - "proto3Optional": { - "type": "bool", - "id": 17 - } - }, - "nested": { - "Type": { - "values": { - "TYPE_DOUBLE": 1, - "TYPE_FLOAT": 2, - "TYPE_INT64": 3, - "TYPE_UINT64": 4, - "TYPE_INT32": 5, - "TYPE_FIXED64": 6, - "TYPE_FIXED32": 7, - "TYPE_BOOL": 8, - "TYPE_STRING": 9, - "TYPE_GROUP": 10, - "TYPE_MESSAGE": 11, - "TYPE_BYTES": 12, - "TYPE_UINT32": 13, - "TYPE_ENUM": 14, - "TYPE_SFIXED32": 15, - "TYPE_SFIXED64": 16, - "TYPE_SINT32": 17, - "TYPE_SINT64": 18 - } - }, - "Label": { - "values": { - "LABEL_OPTIONAL": 1, - "LABEL_REPEATED": 3, - "LABEL_REQUIRED": 2 - } - } - } - }, - "OneofDescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "options": { - "type": "OneofOptions", - "id": 2 - } - } - }, - "EnumDescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "value": { - "rule": "repeated", - "type": "EnumValueDescriptorProto", - "id": 2 - }, - "options": { - "type": "EnumOptions", - "id": 3 - }, - "reservedRange": { - "rule": "repeated", - "type": "EnumReservedRange", - "id": 4 - }, - "reservedName": { - "rule": "repeated", - "type": "string", - "id": 5 - } - }, - "nested": { - "EnumReservedRange": { - "fields": { - "start": { - "type": "int32", - "id": 1 - }, - "end": { - "type": "int32", - "id": 2 - } - } - } - } - }, - "EnumValueDescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "number": { - "type": "int32", - "id": 2 - }, - "options": { - "type": "EnumValueOptions", - "id": 3 - } - } - }, - "ServiceDescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "method": { - "rule": "repeated", - "type": "MethodDescriptorProto", - "id": 2 - }, - "options": { - "type": "ServiceOptions", - "id": 3 - } - } - }, - "MethodDescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "inputType": { - "type": "string", - "id": 2 - }, - "outputType": { - "type": "string", - "id": 3 - }, - "options": { - "type": "MethodOptions", - "id": 4 - }, - "clientStreaming": { - "type": "bool", - "id": 5, - "options": { - "default": false - } - }, - "serverStreaming": { - "type": "bool", - "id": 6, - "options": { - "default": false - } - } - } - }, - "FileOptions": { - "edition": "proto2", - "fields": { - "javaPackage": { - "type": "string", - "id": 1 - }, - "javaOuterClassname": { - "type": "string", - "id": 8 - }, - "javaMultipleFiles": { - "type": "bool", - "id": 10, - "options": { - "default": false - } - }, - "javaGenerateEqualsAndHash": { - "type": "bool", - "id": 20, - "options": { - "deprecated": true - } - }, - "javaStringCheckUtf8": { - "type": "bool", - "id": 27, - "options": { - "default": false - } - }, - "optimizeFor": { - "type": "OptimizeMode", - "id": 9, - "options": { - "default": "SPEED" - } - }, - "goPackage": { - "type": "string", - "id": 11 - }, - "ccGenericServices": { - "type": "bool", - "id": 16, - "options": { - "default": false - } - }, - "javaGenericServices": { - "type": "bool", - "id": 17, - "options": { - "default": false - } - }, - "pyGenericServices": { - "type": "bool", - "id": 18, - "options": { - "default": false - } - }, - "deprecated": { - "type": "bool", - "id": 23, - "options": { - "default": false - } - }, - "ccEnableArenas": { - "type": "bool", - "id": 31, - "options": { - "default": true - } - }, - "objcClassPrefix": { - "type": "string", - "id": 36 - }, - "csharpNamespace": { - "type": "string", - "id": 37 - }, - "swiftPrefix": { - "type": "string", - "id": 39 - }, - "phpClassPrefix": { - "type": "string", - "id": 40 - }, - "phpNamespace": { - "type": "string", - "id": 41 - }, - "phpMetadataNamespace": { - "type": "string", - "id": 44 - }, - "rubyPackage": { - "type": "string", - "id": 45 - }, - "features": { - "type": "FeatureSet", - "id": 50 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "reserved": [ - [ - 42, - 42 - ], - [ - 38, - 38 - ] - ], - "nested": { - "OptimizeMode": { - "values": { - "SPEED": 1, - "CODE_SIZE": 2, - "LITE_RUNTIME": 3 - } - } - } - }, - "MessageOptions": { - "edition": "proto2", - "fields": { - "messageSetWireFormat": { - "type": "bool", - "id": 1, - "options": { - "default": false - } - }, - "noStandardDescriptorAccessor": { - "type": "bool", - "id": 2, - "options": { - "default": false - } - }, - "deprecated": { - "type": "bool", - "id": 3, - "options": { - "default": false - } - }, - "mapEntry": { - "type": "bool", - "id": 7 - }, - "deprecatedLegacyJsonFieldConflicts": { - "type": "bool", - "id": 11, - "options": { - "deprecated": true - } - }, - "features": { - "type": "FeatureSet", - "id": 12 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "reserved": [ - [ - 4, - 4 - ], - [ - 5, - 5 - ], - [ - 6, - 6 - ], - [ - 8, - 8 - ], - [ - 9, - 9 - ] - ] - }, - "FieldOptions": { - "edition": "proto2", - "fields": { - "ctype": { - "type": "CType", - "id": 1, - "options": { - "default": "STRING" - } - }, - "packed": { - "type": "bool", - "id": 2 - }, - "jstype": { - "type": "JSType", - "id": 6, - "options": { - "default": "JS_NORMAL" - } - }, - "lazy": { - "type": "bool", - "id": 5, - "options": { - "default": false - } - }, - "unverifiedLazy": { - "type": "bool", - "id": 15, - "options": { - "default": false - } - }, - "deprecated": { - "type": "bool", - "id": 3, - "options": { - "default": false - } - }, - "weak": { - "type": "bool", - "id": 10, - "options": { - "default": false - } - }, - "debugRedact": { - "type": "bool", - "id": 16, - "options": { - "default": false - } - }, - "retention": { - "type": "OptionRetention", - "id": 17 - }, - "targets": { - "rule": "repeated", - "type": "OptionTargetType", - "id": 19 - }, - "editionDefaults": { - "rule": "repeated", - "type": "EditionDefault", - "id": 20 - }, - "features": { - "type": "FeatureSet", - "id": 21 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "reserved": [ - [ - 4, - 4 - ], - [ - 18, - 18 - ] - ], - "nested": { - "CType": { - "values": { - "STRING": 0, - "CORD": 1, - "STRING_PIECE": 2 - } - }, - "JSType": { - "values": { - "JS_NORMAL": 0, - "JS_STRING": 1, - "JS_NUMBER": 2 - } - }, - "OptionRetention": { - "values": { - "RETENTION_UNKNOWN": 0, - "RETENTION_RUNTIME": 1, - "RETENTION_SOURCE": 2 - } - }, - "OptionTargetType": { - "values": { - "TARGET_TYPE_UNKNOWN": 0, - "TARGET_TYPE_FILE": 1, - "TARGET_TYPE_EXTENSION_RANGE": 2, - "TARGET_TYPE_MESSAGE": 3, - "TARGET_TYPE_FIELD": 4, - "TARGET_TYPE_ONEOF": 5, - "TARGET_TYPE_ENUM": 6, - "TARGET_TYPE_ENUM_ENTRY": 7, - "TARGET_TYPE_SERVICE": 8, - "TARGET_TYPE_METHOD": 9 - } - }, - "EditionDefault": { - "fields": { - "edition": { - "type": "Edition", - "id": 3 - }, - "value": { - "type": "string", - "id": 2 - } - } - } - } - }, - "OneofOptions": { - "edition": "proto2", - "fields": { - "features": { - "type": "FeatureSet", - "id": 1 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ] - }, - "EnumOptions": { - "edition": "proto2", - "fields": { - "allowAlias": { - "type": "bool", - "id": 2 - }, - "deprecated": { - "type": "bool", - "id": 3, - "options": { - "default": false - } - }, - "deprecatedLegacyJsonFieldConflicts": { - "type": "bool", - "id": 6, - "options": { - "deprecated": true - } - }, - "features": { - "type": "FeatureSet", - "id": 7 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "reserved": [ - [ - 5, - 5 - ] - ] - }, - "EnumValueOptions": { - "edition": "proto2", - "fields": { - "deprecated": { - "type": "bool", - "id": 1, - "options": { - "default": false - } - }, - "features": { - "type": "FeatureSet", - "id": 2 - }, - "debugRedact": { - "type": "bool", - "id": 3, - "options": { - "default": false - } - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ] - }, - "ServiceOptions": { - "edition": "proto2", - "fields": { - "features": { - "type": "FeatureSet", - "id": 34 - }, - "deprecated": { - "type": "bool", - "id": 33, - "options": { - "default": false - } - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ] - }, - "MethodOptions": { - "edition": "proto2", - "fields": { - "deprecated": { - "type": "bool", - "id": 33, - "options": { - "default": false - } - }, - "idempotencyLevel": { - "type": "IdempotencyLevel", - "id": 34, - "options": { - "default": "IDEMPOTENCY_UNKNOWN" - } - }, - "features": { - "type": "FeatureSet", - "id": 35 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "nested": { - "IdempotencyLevel": { - "values": { - "IDEMPOTENCY_UNKNOWN": 0, - "NO_SIDE_EFFECTS": 1, - "IDEMPOTENT": 2 - } - } - } - }, - "UninterpretedOption": { - "edition": "proto2", - "fields": { - "name": { - "rule": "repeated", - "type": "NamePart", - "id": 2 - }, - "identifierValue": { - "type": "string", - "id": 3 - }, - "positiveIntValue": { - "type": "uint64", - "id": 4 - }, - "negativeIntValue": { - "type": "int64", - "id": 5 - }, - "doubleValue": { - "type": "double", - "id": 6 - }, - "stringValue": { - "type": "bytes", - "id": 7 - }, - "aggregateValue": { - "type": "string", - "id": 8 - } - }, - "nested": { - "NamePart": { - "fields": { - "namePart": { - "rule": "required", - "type": "string", - "id": 1 - }, - "isExtension": { - "rule": "required", - "type": "bool", - "id": 2 - } - } - } - } - }, - "FeatureSet": { - "edition": "proto2", - "fields": { - "fieldPresence": { - "type": "FieldPresence", - "id": 1, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_2023", - "edition_defaults.value": "EXPLICIT" - } - }, - "enumType": { - "type": "EnumType", - "id": 2, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO3", - "edition_defaults.value": "OPEN" - } - }, - "repeatedFieldEncoding": { - "type": "RepeatedFieldEncoding", - "id": 3, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO3", - "edition_defaults.value": "PACKED" - } - }, - "utf8Validation": { - "type": "Utf8Validation", - "id": 4, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO3", - "edition_defaults.value": "VERIFY" - } - }, - "messageEncoding": { - "type": "MessageEncoding", - "id": 5, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO2", - "edition_defaults.value": "LENGTH_PREFIXED" - } - }, - "jsonFormat": { - "type": "JsonFormat", - "id": 6, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO3", - "edition_defaults.value": "ALLOW" - } - } - }, - "extensions": [ - [ - 1000, - 1000 - ], - [ - 1001, - 1001 - ], - [ - 1002, - 1002 - ], - [ - 9990, - 9990 - ], - [ - 9995, - 9999 - ], - [ - 10000, - 10000 - ] - ], - "reserved": [ - [ - 999, - 999 - ] - ], - "nested": { - "FieldPresence": { - "values": { - "FIELD_PRESENCE_UNKNOWN": 0, - "EXPLICIT": 1, - "IMPLICIT": 2, - "LEGACY_REQUIRED": 3 - } - }, - "EnumType": { - "values": { - "ENUM_TYPE_UNKNOWN": 0, - "OPEN": 1, - "CLOSED": 2 - } - }, - "RepeatedFieldEncoding": { - "values": { - "REPEATED_FIELD_ENCODING_UNKNOWN": 0, - "PACKED": 1, - "EXPANDED": 2 - } - }, - "Utf8Validation": { - "values": { - "UTF8_VALIDATION_UNKNOWN": 0, - "VERIFY": 2, - "NONE": 3 - } - }, - "MessageEncoding": { - "values": { - "MESSAGE_ENCODING_UNKNOWN": 0, - "LENGTH_PREFIXED": 1, - "DELIMITED": 2 - } - }, - "JsonFormat": { - "values": { - "JSON_FORMAT_UNKNOWN": 0, - "ALLOW": 1, - "LEGACY_BEST_EFFORT": 2 - } - } - } - }, - "FeatureSetDefaults": { - "edition": "proto2", - "fields": { - "defaults": { - "rule": "repeated", - "type": "FeatureSetEditionDefault", - "id": 1 - }, - "minimumEdition": { - "type": "Edition", - "id": 4 - }, - "maximumEdition": { - "type": "Edition", - "id": 5 - } - }, - "nested": { - "FeatureSetEditionDefault": { - "fields": { - "edition": { - "type": "Edition", - "id": 3 - }, - "features": { - "type": "FeatureSet", - "id": 2 - } - } - } - } - }, - "SourceCodeInfo": { - "edition": "proto2", - "fields": { - "location": { - "rule": "repeated", - "type": "Location", - "id": 1 - } - }, - "nested": { - "Location": { - "fields": { - "path": { - "rule": "repeated", - "type": "int32", - "id": 1, - "options": { - "packed": true - } - }, - "span": { - "rule": "repeated", - "type": "int32", - "id": 2, - "options": { - "packed": true - } - }, - "leadingComments": { - "type": "string", - "id": 3 - }, - "trailingComments": { - "type": "string", - "id": 4 - }, - "leadingDetachedComments": { - "rule": "repeated", - "type": "string", - "id": 6 - } - } - } - } - }, - "GeneratedCodeInfo": { - "edition": "proto2", - "fields": { - "annotation": { - "rule": "repeated", - "type": "Annotation", - "id": 1 - } - }, - "nested": { - "Annotation": { - "fields": { - "path": { - "rule": "repeated", - "type": "int32", - "id": 1, - "options": { - "packed": true - } - }, - "sourceFile": { - "type": "string", - "id": 2 - }, - "begin": { - "type": "int32", - "id": 3 - }, - "end": { - "type": "int32", - "id": 4 - }, - "semantic": { - "type": "Semantic", - "id": 5 - } - }, - "nested": { - "Semantic": { - "values": { - "NONE": 0, - "SET": 1, - "ALIAS": 2 - } - } - } - } - } - }, - "Duration": { - "fields": { - "seconds": { - "type": "int64", - "id": 1 - }, - "nanos": { - "type": "int32", - "id": 2 - } - } - }, - "Any": { - "fields": { - "type_url": { - "type": "string", - "id": 1 - }, - "value": { - "type": "bytes", - "id": 2 - } - } - }, - "Empty": { - "fields": {} - }, - "FieldMask": { - "fields": { - "paths": { - "rule": "repeated", - "type": "string", - "id": 1 - } - } - }, - "Timestamp": { - "fields": { - "seconds": { - "type": "int64", - "id": 1 - }, - "nanos": { - "type": "int32", - "id": 2 - } - } - }, - "Struct": { - "fields": { - "fields": { - "keyType": "string", - "type": "Value", - "id": 1 - } - } - }, - "Value": { - "oneofs": { - "kind": { - "oneof": [ - "nullValue", - "numberValue", - "stringValue", - "boolValue", - "structValue", - "listValue" - ] - } - }, - "fields": { - "nullValue": { - "type": "NullValue", - "id": 1 - }, - "numberValue": { - "type": "double", - "id": 2 - }, - "stringValue": { - "type": "string", - "id": 3 - }, - "boolValue": { - "type": "bool", - "id": 4 - }, - "structValue": { - "type": "Struct", - "id": 5 - }, - "listValue": { - "type": "ListValue", - "id": 6 - } - } - }, - "NullValue": { - "values": { - "NULL_VALUE": 0 - } - }, - "ListValue": { - "fields": { - "values": { - "rule": "repeated", - "type": "Value", - "id": 1 - } - } - } - } - }, - "longrunning": { - "options": { - "cc_enable_arenas": true, - "csharp_namespace": "Google.LongRunning", - "go_package": "cloud.google.com/go/longrunning/autogen/longrunningpb;longrunningpb", - "java_multiple_files": true, - "java_outer_classname": "OperationsProto", - "java_package": "com.google.longrunning", - "php_namespace": "Google\\LongRunning" - }, - "nested": { - "operationInfo": { - "type": "google.longrunning.OperationInfo", - "id": 1049, - "extend": "google.protobuf.MethodOptions" - }, - "Operations": { - "options": { - "(google.api.default_host)": "longrunning.googleapis.com" - }, - "methods": { - "ListOperations": { - "requestType": "ListOperationsRequest", - "responseType": "ListOperationsResponse", - "options": { - "(google.api.http).get": "/v1/{name=operations}", - "(google.api.method_signature)": "name,filter" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=operations}" - } - }, - { - "(google.api.method_signature)": "name,filter" - } - ] - }, - "GetOperation": { - "requestType": "GetOperationRequest", - "responseType": "Operation", - "options": { - "(google.api.http).get": "/v1/{name=operations/**}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=operations/**}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "DeleteOperation": { - "requestType": "DeleteOperationRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v1/{name=operations/**}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1/{name=operations/**}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "CancelOperation": { - "requestType": "CancelOperationRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).post": "/v1/{name=operations/**}:cancel", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{name=operations/**}:cancel", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "WaitOperation": { - "requestType": "WaitOperationRequest", - "responseType": "Operation" - } - } - }, - "Operation": { - "oneofs": { - "result": { - "oneof": [ - "error", - "response" - ] - } - }, - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "metadata": { - "type": "google.protobuf.Any", - "id": 2 - }, - "done": { - "type": "bool", - "id": 3 - }, - "error": { - "type": "google.rpc.Status", - "id": 4 - }, - "response": { - "type": "google.protobuf.Any", - "id": 5 - } - } - }, - "GetOperationRequest": { - "fields": { - "name": { - "type": "string", - "id": 1 - } - } - }, - "ListOperationsRequest": { - "fields": { - "name": { - "type": "string", - "id": 4 - }, - "filter": { - "type": "string", - "id": 1 - }, - "pageSize": { - "type": "int32", - "id": 2 - }, - "pageToken": { - "type": "string", - "id": 3 - } - } - }, - "ListOperationsResponse": { - "fields": { - "operations": { - "rule": "repeated", - "type": "Operation", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "CancelOperationRequest": { - "fields": { - "name": { - "type": "string", - "id": 1 - } - } - }, - "DeleteOperationRequest": { - "fields": { - "name": { - "type": "string", - "id": 1 - } - } - }, - "WaitOperationRequest": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "timeout": { - "type": "google.protobuf.Duration", - "id": 2 - } - } - }, - "OperationInfo": { - "fields": { - "responseType": { - "type": "string", - "id": 1 - }, - "metadataType": { - "type": "string", - "id": 2 - } - } - } - } - }, - "rpc": { - "options": { - "cc_enable_arenas": true, - "go_package": "google.golang.org/genproto/googleapis/rpc/status;status", - "java_multiple_files": true, - "java_outer_classname": "StatusProto", - "java_package": "com.google.rpc", - "objc_class_prefix": "RPC" - }, - "nested": { - "Status": { - "fields": { - "code": { - "type": "int32", - "id": 1 - }, - "message": { - "type": "string", - "id": 2 - }, - "details": { - "rule": "repeated", - "type": "google.protobuf.Any", - "id": 3 - } - } - } - } - }, - "iam": { - "nested": { - "v1": { - "options": { - "cc_enable_arenas": true, - "csharp_namespace": "Google.Cloud.Iam.V1", - "go_package": "cloud.google.com/go/iam/apiv1/iampb;iampb", - "java_multiple_files": true, - "java_outer_classname": "PolicyProto", - "java_package": "com.google.iam.v1", - "php_namespace": "Google\\Cloud\\Iam\\V1" - }, - "nested": { - "IAMPolicy": { - "options": { - "(google.api.default_host)": "iam-meta-api.googleapis.com" - }, - "methods": { - "SetIamPolicy": { - "requestType": "SetIamPolicyRequest", - "responseType": "Policy", - "options": { - "(google.api.http).post": "/v1/{resource=**}:setIamPolicy", - "(google.api.http).body": "*" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{resource=**}:setIamPolicy", - "body": "*" - } - } - ] - }, - "GetIamPolicy": { - "requestType": "GetIamPolicyRequest", - "responseType": "Policy", - "options": { - "(google.api.http).post": "/v1/{resource=**}:getIamPolicy", - "(google.api.http).body": "*" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{resource=**}:getIamPolicy", - "body": "*" - } - } - ] - }, - "TestIamPermissions": { - "requestType": "TestIamPermissionsRequest", - "responseType": "TestIamPermissionsResponse", - "options": { - "(google.api.http).post": "/v1/{resource=**}:testIamPermissions", - "(google.api.http).body": "*" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{resource=**}:testIamPermissions", - "body": "*" - } - } - ] - } - } - }, - "SetIamPolicyRequest": { - "fields": { - "resource": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "*" - } - }, - "policy": { - "type": "Policy", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 3 - } - } - }, - "GetIamPolicyRequest": { - "fields": { - "resource": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "*" - } - }, - "options": { - "type": "GetPolicyOptions", - "id": 2 - } - } - }, - "TestIamPermissionsRequest": { - "fields": { - "resource": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "*" - } - }, - "permissions": { - "rule": "repeated", - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "TestIamPermissionsResponse": { - "fields": { - "permissions": { - "rule": "repeated", - "type": "string", - "id": 1 - } - } - }, - "GetPolicyOptions": { - "fields": { - "requestedPolicyVersion": { - "type": "int32", - "id": 1 - } - } - }, - "Policy": { - "fields": { - "version": { - "type": "int32", - "id": 1 - }, - "bindings": { - "rule": "repeated", - "type": "Binding", - "id": 4 - }, - "auditConfigs": { - "rule": "repeated", - "type": "AuditConfig", - "id": 6 - }, - "etag": { - "type": "bytes", - "id": 3 - } - } - }, - "Binding": { - "fields": { - "role": { - "type": "string", - "id": 1 - }, - "members": { - "rule": "repeated", - "type": "string", - "id": 2 - }, - "condition": { - "type": "google.type.Expr", - "id": 3 - } - } - }, - "AuditConfig": { - "fields": { - "service": { - "type": "string", - "id": 1 - }, - "auditLogConfigs": { - "rule": "repeated", - "type": "AuditLogConfig", - "id": 3 - } - } - }, - "AuditLogConfig": { - "fields": { - "logType": { - "type": "LogType", - "id": 1 - }, - "exemptedMembers": { - "rule": "repeated", - "type": "string", - "id": 2 - } - }, - "nested": { - "LogType": { - "values": { - "LOG_TYPE_UNSPECIFIED": 0, - "ADMIN_READ": 1, - "DATA_WRITE": 2, - "DATA_READ": 3 - } - } - } - }, - "PolicyDelta": { - "fields": { - "bindingDeltas": { - "rule": "repeated", - "type": "BindingDelta", - "id": 1 - }, - "auditConfigDeltas": { - "rule": "repeated", - "type": "AuditConfigDelta", - "id": 2 - } - } - }, - "BindingDelta": { - "fields": { - "action": { - "type": "Action", - "id": 1 - }, - "role": { - "type": "string", - "id": 2 - }, - "member": { - "type": "string", - "id": 3 - }, - "condition": { - "type": "google.type.Expr", - "id": 4 - } - }, - "nested": { - "Action": { - "values": { - "ACTION_UNSPECIFIED": 0, - "ADD": 1, - "REMOVE": 2 - } - } - } - }, - "AuditConfigDelta": { - "fields": { - "action": { - "type": "Action", - "id": 1 - }, - "service": { - "type": "string", - "id": 2 - }, - "exemptedMember": { - "type": "string", - "id": 3 - }, - "logType": { - "type": "string", - "id": 4 - } - }, - "nested": { - "Action": { - "values": { - "ACTION_UNSPECIFIED": 0, - "ADD": 1, - "REMOVE": 2 - } - } - } - } - } - } - } - }, - "type": { - "options": { - "go_package": "google.golang.org/genproto/googleapis/type/expr;expr", - "java_multiple_files": true, - "java_outer_classname": "ExprProto", - "java_package": "com.google.type", - "objc_class_prefix": "GTP" - }, - "nested": { - "Expr": { - "fields": { - "expression": { - "type": "string", - "id": 1 - }, - "title": { - "type": "string", - "id": 2 - }, - "description": { - "type": "string", - "id": 3 - }, - "location": { - "type": "string", - "id": 4 - } - } - } - } - } - } - } - } -} \ No newline at end of file diff --git a/owl-bot-staging/executor/v1/src/index.ts b/owl-bot-staging/executor/v1/src/index.ts deleted file mode 100644 index e6dcb78a8..000000000 --- a/owl-bot-staging/executor/v1/src/index.ts +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as v1 from './v1'; -const SpannerExecutorProxyClient = v1.SpannerExecutorProxyClient; -type SpannerExecutorProxyClient = v1.SpannerExecutorProxyClient; -export {v1, SpannerExecutorProxyClient}; -export default {v1, SpannerExecutorProxyClient}; -import * as protos from '../protos/protos'; -export {protos} diff --git a/owl-bot-staging/executor/v1/src/v1/gapic_metadata.json b/owl-bot-staging/executor/v1/src/v1/gapic_metadata.json deleted file mode 100644 index fd7e7f8cc..000000000 --- a/owl-bot-staging/executor/v1/src/v1/gapic_metadata.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "typescript", - "protoPackage": "google.spanner.executor.v1", - "libraryPackage": "@google-cloud/executor", - "services": { - "SpannerExecutorProxy": { - "clients": { - "grpc": { - "libraryClient": "SpannerExecutorProxyClient", - "rpcs": { - "ExecuteActionAsync": { - "methods": [ - "executeActionAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "SpannerExecutorProxyClient", - "rpcs": {} - } - } - } - } -} diff --git a/owl-bot-staging/executor/v1/src/v1/index.ts b/owl-bot-staging/executor/v1/src/v1/index.ts deleted file mode 100644 index 6da8e65b8..000000000 --- a/owl-bot-staging/executor/v1/src/v1/index.ts +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -export {SpannerExecutorProxyClient} from './spanner_executor_proxy_client'; diff --git a/owl-bot-staging/executor/v1/src/v1/spanner_executor_proxy_client.ts b/owl-bot-staging/executor/v1/src/v1/spanner_executor_proxy_client.ts deleted file mode 100644 index 538f733a1..000000000 --- a/owl-bot-staging/executor/v1/src/v1/spanner_executor_proxy_client.ts +++ /dev/null @@ -1,816 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -/* global window */ -import type * as gax from 'google-gax'; -import type {Callback, CallOptions, Descriptors, ClientOptions} from 'google-gax'; -import {PassThrough} from 'stream'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; - -/** - * Client JSON configuration object, loaded from - * `src/v1/spanner_executor_proxy_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './spanner_executor_proxy_client_config.json'; -const version = require('../../../package.json').version; - -/** - * Service that executes SpannerActions asynchronously. - * @class - * @memberof v1 - */ -export class SpannerExecutorProxyClient { - private _terminated = false; - private _opts: ClientOptions; - private _providedCustomServicePath: boolean; - private _gaxModule: typeof gax | typeof gax.fallback; - private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; - private _protos: {}; - private _defaults: {[method: string]: gax.CallSettings}; - private _universeDomain: string; - private _servicePath: string; - private _log = logging.log('executor'); - - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - pathTemplates: {[name: string]: gax.PathTemplate}; - spannerExecutorProxyStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of SpannerExecutorProxyClient. - * - * @param {object} [options] - The configuration object. - * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). - * The common options are: - * @param {object} [options.credentials] - Credentials object. - * @param {string} [options.credentials.client_email] - * @param {string} [options.credentials.private_key] - * @param {string} [options.email] - Account email address. Required when - * using a .pem or .p12 keyFilename. - * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or - * .p12 key downloaded from the Google Developers Console. If you provide - * a path to a JSON file, the projectId option below is not necessary. - * NOTE: .pem and .p12 require you to specify options.email as well. - * @param {number} [options.port] - The port on which to connect to - * the remote host. - * @param {string} [options.projectId] - The project ID from the Google - * Developer's Console, e.g. 'grape-spaceship-123'. We will also check - * the environment variable GCLOUD_PROJECT for your project ID. If your - * app is running in an environment which supports - * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. - * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. - * For more information, please check the - * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. - * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you - * need to avoid loading the default gRPC version and want to use the fallback - * HTTP implementation. Load only fallback version and pass it to the constructor: - * ``` - * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new SpannerExecutorProxyClient({fallback: true}, gax); - * ``` - */ - constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { - // Ensure that options include all the required fields. - const staticMembers = this.constructor as typeof SpannerExecutorProxyClient; - if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { - throw new Error('Please set either universe_domain or universeDomain, but not both.'); - } - const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; - this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; - this._servicePath = 'spanner-cloud-executor.' + this._universeDomain; - const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; - this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); - const port = opts?.port || staticMembers.port; - const clientConfig = opts?.clientConfig ?? {}; - const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); - opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); - - // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. - if (servicePath !== this._servicePath && !('scopes' in opts)) { - opts['scopes'] = staticMembers.scopes; - } - - // Load google-gax module synchronously if needed - if (!gaxInstance) { - gaxInstance = require('google-gax') as typeof gax; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; - - // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. - this._gaxGrpc = new this._gaxModule.GrpcClient(opts); - - // Save options to use in initialize() method. - this._opts = opts; - - // Save the auth object to the client, for use by other methods. - this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); - - // Set useJWTAccessWithScope on the auth object. - this.auth.useJWTAccessWithScope = true; - - // Set defaultServicePath on the auth object. - this.auth.defaultServicePath = this._servicePath; - - // Set the default scopes in auth client if needed. - if (servicePath === this._servicePath) { - this.auth.defaultScopes = staticMembers.scopes; - } - - // Determine the client header string. - const clientHeader = [ - `gax/${this._gaxModule.version}`, - `gapic/${version}`, - ]; - if (typeof process === 'object' && 'versions' in process) { - clientHeader.push(`gl-node/${process.versions.node}`); - } else { - clientHeader.push(`gl-web/${this._gaxModule.version}`); - } - if (!opts.fallback) { - clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else { - clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); - } - if (opts.libName && opts.libVersion) { - clientHeader.push(`${opts.libName}/${opts.libVersion}`); - } - // Load the applicable protos. - this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); - - // This API contains "path templates"; forward-slash-separated - // identifiers to uniquely identify resources within the API. - // Create useful helper objects for these. - this.pathTemplates = { - backupPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/instances/{instance}/backups/{backup}' - ), - backupSchedulePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/instances/{instance}/databases/{database}/backupSchedules/{schedule}' - ), - databasePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/instances/{instance}/databases/{database}' - ), - databaseRolePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/instances/{instance}/databases/{database}/databaseRoles/{role}' - ), - instancePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/instances/{instance}' - ), - instanceConfigPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/instanceConfigs/{instance_config}' - ), - instancePartitionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/instances/{instance}/instancePartitions/{instance_partition}' - ), - sessionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/instances/{instance}/databases/{database}/sessions/{session}' - ), - }; - - // Some of the methods on this service provide streaming responses. - // Provide descriptors for these. - this.descriptors.stream = { - executeActionAsync: new this._gaxModule.StreamDescriptor(this._gaxModule.StreamType.BIDI_STREAMING, !!opts.fallback, !!opts.gaxServerStreamingRetries) - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.spanner.executor.v1.SpannerExecutorProxy', gapicConfig as gax.ClientConfig, - opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); - - // Set up a dictionary of "inner API calls"; the core implementation - // of calling the API is handled in `google-gax`, with this code - // merely providing the destination and request information. - this.innerApiCalls = {}; - - // Add a warn function to the client constructor so it can be easily tested. - this.warn = this._gaxModule.warn; - } - - /** - * Initialize the client. - * Performs asynchronous operations (such as authentication) and prepares the client. - * This function will be called automatically when any class method is called for the - * first time, but if you need to initialize it before calling an actual method, - * feel free to call initialize() directly. - * - * You can await on this method if you want to make sure the client is initialized. - * - * @returns {Promise} A promise that resolves to an authenticated service stub. - */ - initialize() { - // If the client stub promise is already initialized, return immediately. - if (this.spannerExecutorProxyStub) { - return this.spannerExecutorProxyStub; - } - - // Put together the "service stub" for - // google.spanner.executor.v1.SpannerExecutorProxy. - this.spannerExecutorProxyStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.spanner.executor.v1.SpannerExecutorProxy') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.spanner.executor.v1.SpannerExecutorProxy, - this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; - - // Iterate over each of the methods that the service provides - // and create an API call method for each. - const spannerExecutorProxyStubMethods = - ['executeActionAsync']; - for (const methodName of spannerExecutorProxyStubMethods) { - const callPromise = this.spannerExecutorProxyStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - if (methodName in this.descriptors.stream) { - const stream = new PassThrough({objectMode: true}); - setImmediate(() => { - stream.emit('error', new this._gaxModule.GoogleError('The client has already been closed.')); - }); - return stream; - } - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, - (err: Error|null|undefined) => () => { - throw err; - }); - - const descriptor = - this.descriptors.stream[methodName] || - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor, - this._opts.fallback - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.spannerExecutorProxyStub; - } - - /** - * The DNS address for this API service. - * @deprecated Use the apiEndpoint method of the client instance. - * @returns {string} The DNS address for this service. - */ - static get servicePath() { - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); - } - return 'spanner-cloud-executor.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath. - * @deprecated Use the apiEndpoint method of the client instance. - * @returns {string} The DNS address for this service. - */ - static get apiEndpoint() { - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); - } - return 'spanner-cloud-executor.googleapis.com'; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - get apiEndpoint() { - return this._servicePath; - } - - get universeDomain() { - return this._universeDomain; - } - - /** - * The port for this API service. - * @returns {number} The default port for this service. - */ - static get port() { - return 443; - } - - /** - * The scopes needed to make gRPC calls for every method defined - * in this service. - * @returns {string[]} List of default scopes. - */ - static get scopes() { - return []; - } - - getProjectId(): Promise; - getProjectId(callback: Callback): void; - /** - * Return the project ID used by this class. - * @returns {Promise} A promise that resolves to string containing the project ID. - */ - getProjectId(callback?: Callback): - Promise|void { - if (callback) { - this.auth.getProjectId(callback); - return; - } - return this.auth.getProjectId(); - } - - // ------------------- - // -- Service calls -- - // ------------------- - -/** - * ExecuteActionAsync is a streaming call that starts executing a new Spanner - * action. - * - * For each request, the server will reply with one or more responses, but - * only the last response will contain status in the outcome. - * - * Responses can be matched to requests by action_id. It is allowed to have - * multiple actions in flight--in that case, actions are be executed in - * parallel. - * - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which is both readable and writable. It accepts objects - * representing {@link protos.google.spanner.executor.v1.SpannerAsyncActionRequest|SpannerAsyncActionRequest} for write() method, and - * will emit objects representing {@link protos.google.spanner.executor.v1.SpannerAsyncActionResponse|SpannerAsyncActionResponse} on 'data' event asynchronously. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#bi-directional-streaming | documentation } - * for more details and examples. - * @example include:samples/generated/v1/spanner_executor_proxy.execute_action_async.js - * region_tag:spanner-cloud-executor_v1_generated_SpannerExecutorProxy_ExecuteActionAsync_async - */ - executeActionAsync( - options?: CallOptions): - gax.CancellableStream { - this.initialize().catch(err => {throw err}); - this._log.info('executeActionAsync stream %j', options); - return this.innerApiCalls.executeActionAsync(null, options); - } - - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified backup resource name string. - * - * @param {string} project - * @param {string} instance - * @param {string} backup - * @returns {string} Resource name string. - */ - backupPath(project:string,instance:string,backup:string) { - return this.pathTemplates.backupPathTemplate.render({ - project: project, - instance: instance, - backup: backup, - }); - } - - /** - * Parse the project from Backup resource. - * - * @param {string} backupName - * A fully-qualified path representing Backup resource. - * @returns {string} A string representing the project. - */ - matchProjectFromBackupName(backupName: string) { - return this.pathTemplates.backupPathTemplate.match(backupName).project; - } - - /** - * Parse the instance from Backup resource. - * - * @param {string} backupName - * A fully-qualified path representing Backup resource. - * @returns {string} A string representing the instance. - */ - matchInstanceFromBackupName(backupName: string) { - return this.pathTemplates.backupPathTemplate.match(backupName).instance; - } - - /** - * Parse the backup from Backup resource. - * - * @param {string} backupName - * A fully-qualified path representing Backup resource. - * @returns {string} A string representing the backup. - */ - matchBackupFromBackupName(backupName: string) { - return this.pathTemplates.backupPathTemplate.match(backupName).backup; - } - - /** - * Return a fully-qualified backupSchedule resource name string. - * - * @param {string} project - * @param {string} instance - * @param {string} database - * @param {string} schedule - * @returns {string} Resource name string. - */ - backupSchedulePath(project:string,instance:string,database:string,schedule:string) { - return this.pathTemplates.backupSchedulePathTemplate.render({ - project: project, - instance: instance, - database: database, - schedule: schedule, - }); - } - - /** - * Parse the project from BackupSchedule resource. - * - * @param {string} backupScheduleName - * A fully-qualified path representing BackupSchedule resource. - * @returns {string} A string representing the project. - */ - matchProjectFromBackupScheduleName(backupScheduleName: string) { - return this.pathTemplates.backupSchedulePathTemplate.match(backupScheduleName).project; - } - - /** - * Parse the instance from BackupSchedule resource. - * - * @param {string} backupScheduleName - * A fully-qualified path representing BackupSchedule resource. - * @returns {string} A string representing the instance. - */ - matchInstanceFromBackupScheduleName(backupScheduleName: string) { - return this.pathTemplates.backupSchedulePathTemplate.match(backupScheduleName).instance; - } - - /** - * Parse the database from BackupSchedule resource. - * - * @param {string} backupScheduleName - * A fully-qualified path representing BackupSchedule resource. - * @returns {string} A string representing the database. - */ - matchDatabaseFromBackupScheduleName(backupScheduleName: string) { - return this.pathTemplates.backupSchedulePathTemplate.match(backupScheduleName).database; - } - - /** - * Parse the schedule from BackupSchedule resource. - * - * @param {string} backupScheduleName - * A fully-qualified path representing BackupSchedule resource. - * @returns {string} A string representing the schedule. - */ - matchScheduleFromBackupScheduleName(backupScheduleName: string) { - return this.pathTemplates.backupSchedulePathTemplate.match(backupScheduleName).schedule; - } - - /** - * Return a fully-qualified database resource name string. - * - * @param {string} project - * @param {string} instance - * @param {string} database - * @returns {string} Resource name string. - */ - databasePath(project:string,instance:string,database:string) { - return this.pathTemplates.databasePathTemplate.render({ - project: project, - instance: instance, - database: database, - }); - } - - /** - * Parse the project from Database resource. - * - * @param {string} databaseName - * A fully-qualified path representing Database resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDatabaseName(databaseName: string) { - return this.pathTemplates.databasePathTemplate.match(databaseName).project; - } - - /** - * Parse the instance from Database resource. - * - * @param {string} databaseName - * A fully-qualified path representing Database resource. - * @returns {string} A string representing the instance. - */ - matchInstanceFromDatabaseName(databaseName: string) { - return this.pathTemplates.databasePathTemplate.match(databaseName).instance; - } - - /** - * Parse the database from Database resource. - * - * @param {string} databaseName - * A fully-qualified path representing Database resource. - * @returns {string} A string representing the database. - */ - matchDatabaseFromDatabaseName(databaseName: string) { - return this.pathTemplates.databasePathTemplate.match(databaseName).database; - } - - /** - * Return a fully-qualified databaseRole resource name string. - * - * @param {string} project - * @param {string} instance - * @param {string} database - * @param {string} role - * @returns {string} Resource name string. - */ - databaseRolePath(project:string,instance:string,database:string,role:string) { - return this.pathTemplates.databaseRolePathTemplate.render({ - project: project, - instance: instance, - database: database, - role: role, - }); - } - - /** - * Parse the project from DatabaseRole resource. - * - * @param {string} databaseRoleName - * A fully-qualified path representing DatabaseRole resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDatabaseRoleName(databaseRoleName: string) { - return this.pathTemplates.databaseRolePathTemplate.match(databaseRoleName).project; - } - - /** - * Parse the instance from DatabaseRole resource. - * - * @param {string} databaseRoleName - * A fully-qualified path representing DatabaseRole resource. - * @returns {string} A string representing the instance. - */ - matchInstanceFromDatabaseRoleName(databaseRoleName: string) { - return this.pathTemplates.databaseRolePathTemplate.match(databaseRoleName).instance; - } - - /** - * Parse the database from DatabaseRole resource. - * - * @param {string} databaseRoleName - * A fully-qualified path representing DatabaseRole resource. - * @returns {string} A string representing the database. - */ - matchDatabaseFromDatabaseRoleName(databaseRoleName: string) { - return this.pathTemplates.databaseRolePathTemplate.match(databaseRoleName).database; - } - - /** - * Parse the role from DatabaseRole resource. - * - * @param {string} databaseRoleName - * A fully-qualified path representing DatabaseRole resource. - * @returns {string} A string representing the role. - */ - matchRoleFromDatabaseRoleName(databaseRoleName: string) { - return this.pathTemplates.databaseRolePathTemplate.match(databaseRoleName).role; - } - - /** - * Return a fully-qualified instance resource name string. - * - * @param {string} project - * @param {string} instance - * @returns {string} Resource name string. - */ - instancePath(project:string,instance:string) { - return this.pathTemplates.instancePathTemplate.render({ - project: project, - instance: instance, - }); - } - - /** - * Parse the project from Instance resource. - * - * @param {string} instanceName - * A fully-qualified path representing Instance resource. - * @returns {string} A string representing the project. - */ - matchProjectFromInstanceName(instanceName: string) { - return this.pathTemplates.instancePathTemplate.match(instanceName).project; - } - - /** - * Parse the instance from Instance resource. - * - * @param {string} instanceName - * A fully-qualified path representing Instance resource. - * @returns {string} A string representing the instance. - */ - matchInstanceFromInstanceName(instanceName: string) { - return this.pathTemplates.instancePathTemplate.match(instanceName).instance; - } - - /** - * Return a fully-qualified instanceConfig resource name string. - * - * @param {string} project - * @param {string} instance_config - * @returns {string} Resource name string. - */ - instanceConfigPath(project:string,instanceConfig:string) { - return this.pathTemplates.instanceConfigPathTemplate.render({ - project: project, - instance_config: instanceConfig, - }); - } - - /** - * Parse the project from InstanceConfig resource. - * - * @param {string} instanceConfigName - * A fully-qualified path representing InstanceConfig resource. - * @returns {string} A string representing the project. - */ - matchProjectFromInstanceConfigName(instanceConfigName: string) { - return this.pathTemplates.instanceConfigPathTemplate.match(instanceConfigName).project; - } - - /** - * Parse the instance_config from InstanceConfig resource. - * - * @param {string} instanceConfigName - * A fully-qualified path representing InstanceConfig resource. - * @returns {string} A string representing the instance_config. - */ - matchInstanceConfigFromInstanceConfigName(instanceConfigName: string) { - return this.pathTemplates.instanceConfigPathTemplate.match(instanceConfigName).instance_config; - } - - /** - * Return a fully-qualified instancePartition resource name string. - * - * @param {string} project - * @param {string} instance - * @param {string} instance_partition - * @returns {string} Resource name string. - */ - instancePartitionPath(project:string,instance:string,instancePartition:string) { - return this.pathTemplates.instancePartitionPathTemplate.render({ - project: project, - instance: instance, - instance_partition: instancePartition, - }); - } - - /** - * Parse the project from InstancePartition resource. - * - * @param {string} instancePartitionName - * A fully-qualified path representing InstancePartition resource. - * @returns {string} A string representing the project. - */ - matchProjectFromInstancePartitionName(instancePartitionName: string) { - return this.pathTemplates.instancePartitionPathTemplate.match(instancePartitionName).project; - } - - /** - * Parse the instance from InstancePartition resource. - * - * @param {string} instancePartitionName - * A fully-qualified path representing InstancePartition resource. - * @returns {string} A string representing the instance. - */ - matchInstanceFromInstancePartitionName(instancePartitionName: string) { - return this.pathTemplates.instancePartitionPathTemplate.match(instancePartitionName).instance; - } - - /** - * Parse the instance_partition from InstancePartition resource. - * - * @param {string} instancePartitionName - * A fully-qualified path representing InstancePartition resource. - * @returns {string} A string representing the instance_partition. - */ - matchInstancePartitionFromInstancePartitionName(instancePartitionName: string) { - return this.pathTemplates.instancePartitionPathTemplate.match(instancePartitionName).instance_partition; - } - - /** - * Return a fully-qualified session resource name string. - * - * @param {string} project - * @param {string} instance - * @param {string} database - * @param {string} session - * @returns {string} Resource name string. - */ - sessionPath(project:string,instance:string,database:string,session:string) { - return this.pathTemplates.sessionPathTemplate.render({ - project: project, - instance: instance, - database: database, - session: session, - }); - } - - /** - * Parse the project from Session resource. - * - * @param {string} sessionName - * A fully-qualified path representing Session resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSessionName(sessionName: string) { - return this.pathTemplates.sessionPathTemplate.match(sessionName).project; - } - - /** - * Parse the instance from Session resource. - * - * @param {string} sessionName - * A fully-qualified path representing Session resource. - * @returns {string} A string representing the instance. - */ - matchInstanceFromSessionName(sessionName: string) { - return this.pathTemplates.sessionPathTemplate.match(sessionName).instance; - } - - /** - * Parse the database from Session resource. - * - * @param {string} sessionName - * A fully-qualified path representing Session resource. - * @returns {string} A string representing the database. - */ - matchDatabaseFromSessionName(sessionName: string) { - return this.pathTemplates.sessionPathTemplate.match(sessionName).database; - } - - /** - * Parse the session from Session resource. - * - * @param {string} sessionName - * A fully-qualified path representing Session resource. - * @returns {string} A string representing the session. - */ - matchSessionFromSessionName(sessionName: string) { - return this.pathTemplates.sessionPathTemplate.match(sessionName).session; - } - - /** - * Terminate the gRPC channel and close the client. - * - * The client will no longer be usable and all future behavior is undefined. - * @returns {Promise} A promise that resolves when the client is closed. - */ - close(): Promise { - if (this.spannerExecutorProxyStub && !this._terminated) { - return this.spannerExecutorProxyStub.then(stub => { - this._log.info('ending gRPC channel'); - this._terminated = true; - stub.close(); - }); - } - return Promise.resolve(); - } -} \ No newline at end of file diff --git a/owl-bot-staging/executor/v1/src/v1/spanner_executor_proxy_client_config.json b/owl-bot-staging/executor/v1/src/v1/spanner_executor_proxy_client_config.json deleted file mode 100644 index a26ec1166..000000000 --- a/owl-bot-staging/executor/v1/src/v1/spanner_executor_proxy_client_config.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "interfaces": { - "google.spanner.executor.v1.SpannerExecutorProxy": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "ExecuteActionAsync": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/executor/v1/src/v1/spanner_executor_proxy_proto_list.json b/owl-bot-staging/executor/v1/src/v1/spanner_executor_proxy_proto_list.json deleted file mode 100644 index eaca520c9..000000000 --- a/owl-bot-staging/executor/v1/src/v1/spanner_executor_proxy_proto_list.json +++ /dev/null @@ -1,15 +0,0 @@ -[ - "../../protos/google/spanner/admin/database/v1/backup.proto", - "../../protos/google/spanner/admin/database/v1/backup_schedule.proto", - "../../protos/google/spanner/admin/database/v1/common.proto", - "../../protos/google/spanner/admin/instance/v1/common.proto", - "../../protos/google/spanner/executor/v1/cloud_executor.proto", - "../../protos/google/spanner/v1/commit_response.proto", - "../../protos/google/spanner/v1/keys.proto", - "../../protos/google/spanner/v1/location.proto", - "../../protos/google/spanner/v1/mutation.proto", - "../../protos/google/spanner/v1/query_plan.proto", - "../../protos/google/spanner/v1/result_set.proto", - "../../protos/google/spanner/v1/transaction.proto", - "../../protos/google/spanner/v1/type.proto" -] diff --git a/owl-bot-staging/executor/v1/test/gapic_spanner_executor_proxy_v1.ts b/owl-bot-staging/executor/v1/test/gapic_spanner_executor_proxy_v1.ts deleted file mode 100644 index f03673534..000000000 --- a/owl-bot-staging/executor/v1/test/gapic_spanner_executor_proxy_v1.ts +++ /dev/null @@ -1,660 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as protos from '../protos/protos'; -import * as assert from 'assert'; -import * as sinon from 'sinon'; -import {SinonStub} from 'sinon'; -import {describe, it} from 'mocha'; -import * as spannerexecutorproxyModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf} from 'google-gax'; - -// Dynamically loaded proto JSON is needed to get the type information -// to fill in default values for request objects -const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); - -// eslint-disable-next-line @typescript-eslint/no-unused-vars -function getTypeDefaultValue(typeName: string, fields: string[]) { - let type = root.lookupType(typeName) as protobuf.Type; - for (const field of fields.slice(0, -1)) { - type = type.fields[field]?.resolvedType as protobuf.Type; - } - return type.fields[fields[fields.length - 1]]?.defaultValue; -} - -function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message) - .toObject(instance as protobuf.Message, {defaults: true}); - return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; -} - -function stubBidiStreamingCall(response?: ResponseType, error?: Error) { - const transformStub = error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); - const mockStream = new PassThrough({ - objectMode: true, - transform: transformStub, - }); - return sinon.stub().returns(mockStream); -} - -describe('v1.SpannerExecutorProxyClient', () => { - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new spannerexecutorproxyModule.v1.SpannerExecutorProxyClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'spanner-cloud-executor.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new spannerexecutorproxyModule.v1.SpannerExecutorProxyClient(); - const universeDomain = client.universeDomain; - assert.strictEqual(universeDomain, "googleapis.com"); - }); - - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - it('throws DeprecationWarning if static servicePath is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const servicePath = spannerexecutorproxyModule.v1.SpannerExecutorProxyClient.servicePath; - assert.strictEqual(servicePath, 'spanner-cloud-executor.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - - it('throws DeprecationWarning if static apiEndpoint is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const apiEndpoint = spannerexecutorproxyModule.v1.SpannerExecutorProxyClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'spanner-cloud-executor.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new spannerexecutorproxyModule.v1.SpannerExecutorProxyClient({universeDomain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'spanner-cloud-executor.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new spannerexecutorproxyModule.v1.SpannerExecutorProxyClient({universe_domain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'spanner-cloud-executor.example.com'); - }); - - if (typeof process === 'object' && 'env' in process) { - describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { - it('sets apiEndpoint from environment variable', () => { - const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; - const client = new spannerexecutorproxyModule.v1.SpannerExecutorProxyClient(); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'spanner-cloud-executor.example.com'); - if (saved) { - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; - } else { - delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - } - }); - - it('value configured in code has priority over environment variable', () => { - const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; - const client = new spannerexecutorproxyModule.v1.SpannerExecutorProxyClient({universeDomain: 'configured.example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'spanner-cloud-executor.configured.example.com'); - if (saved) { - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; - } else { - delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - } - }); - }); - } - it('does not allow setting both universeDomain and universe_domain', () => { - assert.throws(() => { new spannerexecutorproxyModule.v1.SpannerExecutorProxyClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); - }); - - it('has port', () => { - const port = spannerexecutorproxyModule.v1.SpannerExecutorProxyClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new spannerexecutorproxyModule.v1.SpannerExecutorProxyClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new spannerexecutorproxyModule.v1.SpannerExecutorProxyClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new spannerexecutorproxyModule.v1.SpannerExecutorProxyClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.spannerExecutorProxyStub, undefined); - await client.initialize(); - assert(client.spannerExecutorProxyStub); - }); - - it('has close method for the initialized client', done => { - const client = new spannerexecutorproxyModule.v1.SpannerExecutorProxyClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize().catch(err => {throw err}); - assert(client.spannerExecutorProxyStub); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has close method for the non-initialized client', done => { - const client = new spannerexecutorproxyModule.v1.SpannerExecutorProxyClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.spannerExecutorProxyStub, undefined); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new spannerexecutorproxyModule.v1.SpannerExecutorProxyClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); - const result = await client.getProjectId(); - assert.strictEqual(result, fakeProjectId); - assert((client.auth.getProjectId as SinonStub).calledWithExactly()); - }); - - it('has getProjectId method with callback', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new spannerexecutorproxyModule.v1.SpannerExecutorProxyClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); - const promise = new Promise((resolve, reject) => { - client.getProjectId((err?: Error|null, projectId?: string|null) => { - if (err) { - reject(err); - } else { - resolve(projectId); - } - }); - }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); - }); - }); - - describe('executeActionAsync', () => { - it('invokes executeActionAsync without error', async () => { - const client = new spannerexecutorproxyModule.v1.SpannerExecutorProxyClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.executor.v1.SpannerAsyncActionRequest() - ); - - const expectedResponse = generateSampleMessage( - new protos.google.spanner.executor.v1.SpannerAsyncActionResponse() - ); - client.innerApiCalls.executeActionAsync = stubBidiStreamingCall(expectedResponse); - const stream = client.executeActionAsync(); - const promise = new Promise((resolve, reject) => { - stream.on('data', (response: protos.google.spanner.executor.v1.SpannerAsyncActionResponse) => { - resolve(response); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - stream.write(request); - stream.end(); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.executeActionAsync as SinonStub) - .getCall(0).calledWith(null)); - assert.deepStrictEqual(((stream as unknown as PassThrough) - ._transform as SinonStub).getCall(0).args[0], request); - }); - - it('invokes executeActionAsync with error', async () => { - const client = new spannerexecutorproxyModule.v1.SpannerExecutorProxyClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.executor.v1.SpannerAsyncActionRequest() - ); - const expectedError = new Error('expected'); - client.innerApiCalls.executeActionAsync = stubBidiStreamingCall(undefined, expectedError); - const stream = client.executeActionAsync(); - const promise = new Promise((resolve, reject) => { - stream.on('data', (response: protos.google.spanner.executor.v1.SpannerAsyncActionResponse) => { - resolve(response); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - stream.write(request); - stream.end(); - }); - await assert.rejects(promise, expectedError); - assert((client.innerApiCalls.executeActionAsync as SinonStub) - .getCall(0).calledWith(null)); - assert.deepStrictEqual(((stream as unknown as PassThrough) - ._transform as SinonStub).getCall(0).args[0], request); - }); - }); - - describe('Path templates', () => { - - describe('backup', async () => { - const fakePath = "/rendered/path/backup"; - const expectedParameters = { - project: "projectValue", - instance: "instanceValue", - backup: "backupValue", - }; - const client = new spannerexecutorproxyModule.v1.SpannerExecutorProxyClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.backupPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.backupPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('backupPath', () => { - const result = client.backupPath("projectValue", "instanceValue", "backupValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.backupPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromBackupName', () => { - const result = client.matchProjectFromBackupName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.backupPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchInstanceFromBackupName', () => { - const result = client.matchInstanceFromBackupName(fakePath); - assert.strictEqual(result, "instanceValue"); - assert((client.pathTemplates.backupPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchBackupFromBackupName', () => { - const result = client.matchBackupFromBackupName(fakePath); - assert.strictEqual(result, "backupValue"); - assert((client.pathTemplates.backupPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('backupSchedule', async () => { - const fakePath = "/rendered/path/backupSchedule"; - const expectedParameters = { - project: "projectValue", - instance: "instanceValue", - database: "databaseValue", - schedule: "scheduleValue", - }; - const client = new spannerexecutorproxyModule.v1.SpannerExecutorProxyClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.backupSchedulePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.backupSchedulePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('backupSchedulePath', () => { - const result = client.backupSchedulePath("projectValue", "instanceValue", "databaseValue", "scheduleValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.backupSchedulePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromBackupScheduleName', () => { - const result = client.matchProjectFromBackupScheduleName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.backupSchedulePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchInstanceFromBackupScheduleName', () => { - const result = client.matchInstanceFromBackupScheduleName(fakePath); - assert.strictEqual(result, "instanceValue"); - assert((client.pathTemplates.backupSchedulePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatabaseFromBackupScheduleName', () => { - const result = client.matchDatabaseFromBackupScheduleName(fakePath); - assert.strictEqual(result, "databaseValue"); - assert((client.pathTemplates.backupSchedulePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchScheduleFromBackupScheduleName', () => { - const result = client.matchScheduleFromBackupScheduleName(fakePath); - assert.strictEqual(result, "scheduleValue"); - assert((client.pathTemplates.backupSchedulePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('database', async () => { - const fakePath = "/rendered/path/database"; - const expectedParameters = { - project: "projectValue", - instance: "instanceValue", - database: "databaseValue", - }; - const client = new spannerexecutorproxyModule.v1.SpannerExecutorProxyClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.databasePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.databasePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('databasePath', () => { - const result = client.databasePath("projectValue", "instanceValue", "databaseValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.databasePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDatabaseName', () => { - const result = client.matchProjectFromDatabaseName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.databasePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchInstanceFromDatabaseName', () => { - const result = client.matchInstanceFromDatabaseName(fakePath); - assert.strictEqual(result, "instanceValue"); - assert((client.pathTemplates.databasePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatabaseFromDatabaseName', () => { - const result = client.matchDatabaseFromDatabaseName(fakePath); - assert.strictEqual(result, "databaseValue"); - assert((client.pathTemplates.databasePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('databaseRole', async () => { - const fakePath = "/rendered/path/databaseRole"; - const expectedParameters = { - project: "projectValue", - instance: "instanceValue", - database: "databaseValue", - role: "roleValue", - }; - const client = new spannerexecutorproxyModule.v1.SpannerExecutorProxyClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.databaseRolePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.databaseRolePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('databaseRolePath', () => { - const result = client.databaseRolePath("projectValue", "instanceValue", "databaseValue", "roleValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.databaseRolePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDatabaseRoleName', () => { - const result = client.matchProjectFromDatabaseRoleName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.databaseRolePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchInstanceFromDatabaseRoleName', () => { - const result = client.matchInstanceFromDatabaseRoleName(fakePath); - assert.strictEqual(result, "instanceValue"); - assert((client.pathTemplates.databaseRolePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatabaseFromDatabaseRoleName', () => { - const result = client.matchDatabaseFromDatabaseRoleName(fakePath); - assert.strictEqual(result, "databaseValue"); - assert((client.pathTemplates.databaseRolePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRoleFromDatabaseRoleName', () => { - const result = client.matchRoleFromDatabaseRoleName(fakePath); - assert.strictEqual(result, "roleValue"); - assert((client.pathTemplates.databaseRolePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('instance', async () => { - const fakePath = "/rendered/path/instance"; - const expectedParameters = { - project: "projectValue", - instance: "instanceValue", - }; - const client = new spannerexecutorproxyModule.v1.SpannerExecutorProxyClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.instancePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.instancePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('instancePath', () => { - const result = client.instancePath("projectValue", "instanceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.instancePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromInstanceName', () => { - const result = client.matchProjectFromInstanceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.instancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchInstanceFromInstanceName', () => { - const result = client.matchInstanceFromInstanceName(fakePath); - assert.strictEqual(result, "instanceValue"); - assert((client.pathTemplates.instancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('instanceConfig', async () => { - const fakePath = "/rendered/path/instanceConfig"; - const expectedParameters = { - project: "projectValue", - instance_config: "instanceConfigValue", - }; - const client = new spannerexecutorproxyModule.v1.SpannerExecutorProxyClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.instanceConfigPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.instanceConfigPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('instanceConfigPath', () => { - const result = client.instanceConfigPath("projectValue", "instanceConfigValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.instanceConfigPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromInstanceConfigName', () => { - const result = client.matchProjectFromInstanceConfigName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.instanceConfigPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchInstanceConfigFromInstanceConfigName', () => { - const result = client.matchInstanceConfigFromInstanceConfigName(fakePath); - assert.strictEqual(result, "instanceConfigValue"); - assert((client.pathTemplates.instanceConfigPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('instancePartition', async () => { - const fakePath = "/rendered/path/instancePartition"; - const expectedParameters = { - project: "projectValue", - instance: "instanceValue", - instance_partition: "instancePartitionValue", - }; - const client = new spannerexecutorproxyModule.v1.SpannerExecutorProxyClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.instancePartitionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.instancePartitionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('instancePartitionPath', () => { - const result = client.instancePartitionPath("projectValue", "instanceValue", "instancePartitionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.instancePartitionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromInstancePartitionName', () => { - const result = client.matchProjectFromInstancePartitionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.instancePartitionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchInstanceFromInstancePartitionName', () => { - const result = client.matchInstanceFromInstancePartitionName(fakePath); - assert.strictEqual(result, "instanceValue"); - assert((client.pathTemplates.instancePartitionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchInstancePartitionFromInstancePartitionName', () => { - const result = client.matchInstancePartitionFromInstancePartitionName(fakePath); - assert.strictEqual(result, "instancePartitionValue"); - assert((client.pathTemplates.instancePartitionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('session', async () => { - const fakePath = "/rendered/path/session"; - const expectedParameters = { - project: "projectValue", - instance: "instanceValue", - database: "databaseValue", - session: "sessionValue", - }; - const client = new spannerexecutorproxyModule.v1.SpannerExecutorProxyClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.sessionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.sessionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('sessionPath', () => { - const result = client.sessionPath("projectValue", "instanceValue", "databaseValue", "sessionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.sessionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSessionName', () => { - const result = client.matchProjectFromSessionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.sessionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchInstanceFromSessionName', () => { - const result = client.matchInstanceFromSessionName(fakePath); - assert.strictEqual(result, "instanceValue"); - assert((client.pathTemplates.sessionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatabaseFromSessionName', () => { - const result = client.matchDatabaseFromSessionName(fakePath); - assert.strictEqual(result, "databaseValue"); - assert((client.pathTemplates.sessionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSessionFromSessionName', () => { - const result = client.matchSessionFromSessionName(fakePath); - assert.strictEqual(result, "sessionValue"); - assert((client.pathTemplates.sessionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/executor/v1/tsconfig.json b/owl-bot-staging/executor/v1/tsconfig.json deleted file mode 100644 index ca73e7bfc..000000000 --- a/owl-bot-staging/executor/v1/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "extends": "./node_modules/gts/tsconfig-google.json", - "compilerOptions": { - "rootDir": ".", - "outDir": "build", - "resolveJsonModule": true, - "lib": [ - "es2023", - "dom" - ] - }, - "include": [ - "src/*.ts", - "src/**/*.ts", - "test/*.ts", - "test/**/*.ts", - "system-test/*.ts", - "src/**/*.json", - "samples/**/*.json", - "protos/protos.json" - ] -} diff --git a/owl-bot-staging/executor/v1/webpack.config.js b/owl-bot-staging/executor/v1/webpack.config.js deleted file mode 100644 index ef04209ca..000000000 --- a/owl-bot-staging/executor/v1/webpack.config.js +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -const path = require('path'); - -module.exports = { - entry: './src/index.ts', - output: { - library: 'DatabaseAdmin', - filename: './database-admin.js', - }, - node: { - child_process: 'empty', - fs: 'empty', - crypto: 'empty', - }, - resolve: { - alias: { - '../../../package.json': path.resolve(__dirname, 'package.json'), - }, - extensions: ['.js', '.json', '.ts'], - }, - module: { - rules: [ - { - test: /\.tsx?$/, - use: 'ts-loader', - exclude: /node_modules/ - }, - { - test: /node_modules[\\/]@grpc[\\/]grpc-js/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]grpc/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]retry-request/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]https?-proxy-agent/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]gtoken/, - use: 'null-loader' - }, - ], - }, - mode: 'production', -}; diff --git a/owl-bot-staging/v1/.OwlBot.yaml b/owl-bot-staging/v1/.OwlBot.yaml deleted file mode 100644 index 23551270f..000000000 --- a/owl-bot-staging/v1/.OwlBot.yaml +++ /dev/null @@ -1,19 +0,0 @@ -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -deep-copy-regex: - - source: /google/spanner/google-spanner-nodejs - dest: /owl-bot-staging/google-spanner - -api-name: spanner \ No newline at end of file diff --git a/owl-bot-staging/v1/.eslintignore b/owl-bot-staging/v1/.eslintignore deleted file mode 100644 index cfc348ec4..000000000 --- a/owl-bot-staging/v1/.eslintignore +++ /dev/null @@ -1,7 +0,0 @@ -**/node_modules -**/.coverage -build/ -docs/ -protos/ -system-test/ -samples/generated/ diff --git a/owl-bot-staging/v1/.eslintrc.json b/owl-bot-staging/v1/.eslintrc.json deleted file mode 100644 index 782153495..000000000 --- a/owl-bot-staging/v1/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./node_modules/gts" -} diff --git a/owl-bot-staging/v1/.gitattributes b/owl-bot-staging/v1/.gitattributes deleted file mode 100644 index 33739cb74..000000000 --- a/owl-bot-staging/v1/.gitattributes +++ /dev/null @@ -1,4 +0,0 @@ -*.ts text eol=lf -*.js text eol=lf -protos/* linguist-generated -**/api-extractor.json linguist-language=JSON-with-Comments diff --git a/owl-bot-staging/v1/.gitignore b/owl-bot-staging/v1/.gitignore deleted file mode 100644 index d4f03a0df..000000000 --- a/owl-bot-staging/v1/.gitignore +++ /dev/null @@ -1,14 +0,0 @@ -**/*.log -**/node_modules -/.coverage -/coverage -/.nyc_output -/docs/ -/out/ -/build/ -system-test/secrets.js -system-test/*key.json -*.lock -.DS_Store -package-lock.json -__pycache__ diff --git a/owl-bot-staging/v1/.jsdoc.js b/owl-bot-staging/v1/.jsdoc.js deleted file mode 100644 index 89dbb7cd9..000000000 --- a/owl-bot-staging/v1/.jsdoc.js +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -'use strict'; - -module.exports = { - opts: { - readme: './README.md', - package: './package.json', - template: './node_modules/jsdoc-fresh', - recurse: true, - verbose: true, - destination: './docs/' - }, - plugins: [ - 'plugins/markdown', - 'jsdoc-region-tag' - ], - source: { - excludePattern: '(^|\\/|\\\\)[._]', - include: [ - 'build/src', - 'protos' - ], - includePattern: '\\.js$' - }, - templates: { - copyright: 'Copyright 2026 Google LLC', - includeDate: false, - sourceFiles: false, - systemName: '@google-cloud/spanner', - theme: 'lumen', - default: { - outputSourceFiles: false - } - }, - markdown: { - idInHeadings: true - } -}; diff --git a/owl-bot-staging/v1/.mocharc.js b/owl-bot-staging/v1/.mocharc.js deleted file mode 100644 index 5eb34e86c..000000000 --- a/owl-bot-staging/v1/.mocharc.js +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -const config = { - "enable-source-maps": true, - "throw-deprecation": true, - "timeout": 10000 -} -if (process.env.MOCHA_THROW_DEPRECATION === 'false') { - delete config['throw-deprecation']; -} -if (process.env.MOCHA_REPORTER) { - config.reporter = process.env.MOCHA_REPORTER; -} -if (process.env.MOCHA_REPORTER_OUTPUT) { - config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; -} -module.exports = config diff --git a/owl-bot-staging/v1/.nycrc b/owl-bot-staging/v1/.nycrc deleted file mode 100644 index 81a95fc94..000000000 --- a/owl-bot-staging/v1/.nycrc +++ /dev/null @@ -1,24 +0,0 @@ -{ - "report-dir": "./.coverage", - "reporter": ["text", "lcov"], - "exclude": [ - "**/*-test", - "**/.coverage", - "**/apis", - "**/benchmark", - "**/conformance", - "**/docs", - "**/samples", - "**/scripts", - "**/protos", - "**/test", - "**/*.d.ts", - ".jsdoc.js", - "**/.jsdoc.js", - "karma.conf.js", - "webpack-tests.config.js", - "webpack.config.js" - ], - "exclude-after-remap": false, - "all": true -} \ No newline at end of file diff --git a/owl-bot-staging/v1/.prettierignore b/owl-bot-staging/v1/.prettierignore deleted file mode 100644 index 9340ad9b8..000000000 --- a/owl-bot-staging/v1/.prettierignore +++ /dev/null @@ -1,6 +0,0 @@ -**/node_modules -**/coverage -test/fixtures -build/ -docs/ -protos/ diff --git a/owl-bot-staging/v1/.prettierrc.js b/owl-bot-staging/v1/.prettierrc.js deleted file mode 100644 index 7649ee3c2..000000000 --- a/owl-bot-staging/v1/.prettierrc.js +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - -module.exports = { - ...require('gts/.prettierrc.json') -} diff --git a/owl-bot-staging/v1/CODE_OF_CONDUCT.md b/owl-bot-staging/v1/CODE_OF_CONDUCT.md deleted file mode 100644 index 2add2547a..000000000 --- a/owl-bot-staging/v1/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,94 +0,0 @@ - -# Code of Conduct - -## Our Pledge - -In the interest of fostering an open and welcoming environment, we as -contributors and maintainers pledge to making participation in our project and -our community a harassment-free experience for everyone, regardless of age, body -size, disability, ethnicity, gender identity and expression, level of -experience, education, socio-economic status, nationality, personal appearance, -race, religion, or sexual identity and orientation. - -## Our Standards - -Examples of behavior that contributes to creating a positive environment -include: - -* Using welcoming and inclusive language -* Being respectful of differing viewpoints and experiences -* Gracefully accepting constructive criticism -* Focusing on what is best for the community -* Showing empathy towards other community members - -Examples of unacceptable behavior by participants include: - -* The use of sexualized language or imagery and unwelcome sexual attention or - advances -* Trolling, insulting/derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or electronic - address, without explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting - -## Our Responsibilities - -Project maintainers are responsible for clarifying the standards of acceptable -behavior and are expected to take appropriate and fair corrective action in -response to any instances of unacceptable behavior. - -Project maintainers have the right and responsibility to remove, edit, or reject -comments, commits, code, wiki edits, issues, and other contributions that are -not aligned to this Code of Conduct, or to ban temporarily or permanently any -contributor for other behaviors that they deem inappropriate, threatening, -offensive, or harmful. - -## Scope - -This Code of Conduct applies both within project spaces and in public spaces -when an individual is representing the project or its community. Examples of -representing a project or community include using an official project e-mail -address, posting via an official social media account, or acting as an appointed -representative at an online or offline event. Representation of a project may be -further defined and clarified by project maintainers. - -This Code of Conduct also applies outside the project spaces when the Project -Steward has a reasonable belief that an individual's behavior may have a -negative impact on the project or its community. - -## Conflict Resolution - -We do not believe that all conflict is bad; healthy debate and disagreement -often yield positive results. However, it is never okay to be disrespectful or -to engage in behavior that violates the project’s code of conduct. - -If you see someone violating the code of conduct, you are encouraged to address -the behavior directly with those involved. Many issues can be resolved quickly -and easily, and this gives people more control over the outcome of their -dispute. If you are unable to resolve the matter for any reason, or if the -behavior is threatening or harassing, report it. We are dedicated to providing -an environment where participants feel welcome and safe. - -Reports should be directed to *googleapis-stewards@google.com*, the -Project Steward(s) for *Google Cloud Client Libraries*. It is the Project Steward’s duty to -receive and address reported violations of the code of conduct. They will then -work with a committee consisting of representatives from the Open Source -Programs Office and the Google Open Source Strategy team. If for any reason you -are uncomfortable reaching out to the Project Steward, please email -opensource@google.com. - -We will investigate every complaint, but you may not receive a direct response. -We will use our discretion in determining when and how to follow up on reported -incidents, which may range from not taking action to permanent expulsion from -the project and project-sponsored spaces. We will notify the accused of the -report and provide them an opportunity to discuss it before any action is taken. -The identity of the reporter will be omitted from the details of the report -supplied to the accused. In potentially harmful situations, such as ongoing -harassment or threats to anyone's safety, we may take action without notice. - -## Attribution - -This Code of Conduct is adapted from the Contributor Covenant, version 1.4, -available at -https://www.contributor-covenant.org/version/1/4/code-of-conduct.html \ No newline at end of file diff --git a/owl-bot-staging/v1/CONTRIBUTING.md b/owl-bot-staging/v1/CONTRIBUTING.md deleted file mode 100644 index 5ddaa4e60..000000000 --- a/owl-bot-staging/v1/CONTRIBUTING.md +++ /dev/null @@ -1,76 +0,0 @@ -# How to become a contributor and submit your own code - -**Table of contents** - -* [Contributor License Agreements](#contributor-license-agreements) -* [Contributing a patch](#contributing-a-patch) -* [Running the tests](#running-the-tests) -* [Releasing the library](#releasing-the-library) - -## Contributor License Agreements - -We'd love to accept your sample apps and patches! Before we can take them, we -have to jump a couple of legal hurdles. - -Please fill out either the individual or corporate Contributor License Agreement -(CLA). - - * If you are an individual writing original source code and you're sure you - own the intellectual property, then you'll need to sign an [individual CLA](https://developers.google.com/open-source/cla/individual). - * If you work for a company that wants to allow you to contribute your work, - then you'll need to sign a [corporate CLA](https://developers.google.com/open-source/cla/corporate). - -Follow either of the two links above to access the appropriate CLA and -instructions for how to sign and return it. Once we receive it, we'll be able to -accept your pull requests. - -## Contributing A Patch - -1. Submit an issue describing your proposed change to the repo in question. -1. The repo owner will respond to your issue promptly. -1. If your proposed change is accepted, and you haven't already done so, sign a - Contributor License Agreement (see details above). -1. Fork the desired repo, develop and test your code changes. -1. Ensure that your code adheres to the existing style in the code to which - you are contributing. -1. Ensure that your code has an appropriate set of tests which all pass. -1. Title your pull request following [Conventional Commits](https://www.conventionalcommits.org/) styling. -1. Submit a pull request. - -### Before you begin - -1. [Select or create a Cloud Platform project][projects]. -1. [Enable billing for your project][billing]. -1. [Enable the Spanner API][enable_api]. -1. [Set up authentication with a service account][auth] so you can access the - API from your local workstation. - - -## Running the tests - -1. [Prepare your environment for Node.js setup][setup]. - -1. Install dependencies: - - npm install - -1. Run the tests: - - # Run unit tests. - npm test - - # Run sample integration tests. - npm run samples-test - - # Run all system tests. - npm run system-test - -1. Lint (and maybe fix) any changes: - - npm run fix - -[setup]: https://cloud.google.com/nodejs/docs/setup -[projects]: https://console.cloud.google.com/project -[billing]: https://support.google.com/cloud/answer/6293499#enable-billing -[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=spanner.googleapis.com -[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/owl-bot-staging/v1/LICENSE b/owl-bot-staging/v1/LICENSE deleted file mode 100644 index d64569567..000000000 --- a/owl-bot-staging/v1/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/owl-bot-staging/v1/README.md b/owl-bot-staging/v1/README.md deleted file mode 100644 index b8fb95907..000000000 --- a/owl-bot-staging/v1/README.md +++ /dev/null @@ -1,108 +0,0 @@ -[//]: # "This README.md file is auto-generated, all changes to this file will be lost." -[//]: # "The comments you see below are used to generate those parts of the template in later states." -Google Cloud Platform logo - -# [Cloud Spanner API: Nodejs Client][homepage] - -[//]: # "releaseLevel" - -[![npm version](https://img.shields.io/npm/v/@google-cloud/spanner.svg)](https://www.npmjs.org/package/@google-cloud/spanner) - -Cloud Spanner API client for Node.js - -[//]: # "partials.introduction" - -A comprehensive list of changes in each version may be found in -[the CHANGELOG][homepage_changelog]. - -* [Cloud Spanner API Nodejs Client API Reference](https://cloud.google.com/nodejs/docs/reference/spanner/latest) -* [Cloud Spanner API Documentation](https://cloud.google.com/spanner/) - -Read more about the client libraries for Cloud APIs, including the older -Google APIs Client Libraries, in [Client Libraries Explained][explained]. - -[explained]: https://cloud.google.com/apis/docs/client-libraries-explained - -**Table of contents:** - -* [Quickstart](#quickstart) - * [Before you begin](#before-you-begin) - * [Installing the client library](#installing-the-client-library) - -* [Versioning](#versioning) -* [Contributing](#contributing) -* [License](#license) - -## Quickstart -### Before you begin - -1. [Select or create a Cloud Platform project][projects]. -1. [Enable billing for your project][billing]. -1. [Enable the Cloud Spanner API API][enable_api]. -1. [Set up authentication][auth] so you can access the - API from your local workstation. -### Installing the client library - -```bash -npm install @google-cloud/spanner -``` - -[//]: # "partials.body" - -## Samples - -Samples are in the [`samples/`][homepage_samples] directory. Each sample's `README.md` has instructions for running its sample. - -[//]: # "samples" - -## Supported Node.js Versions - -Our client libraries follow the [Node.js release schedule](https://github.com/nodejs/release#release-schedule). -Libraries are compatible with all current _active_ and _maintenance_ versions of -Node.js. -If you are using an end-of-life version of Node.js, we recommend that you update -as soon as possible to an actively supported LTS version. - -Google's client libraries support legacy versions of Node.js runtimes on a -best-efforts basis with the following warnings: - -* Legacy versions are not tested in continuous integration. -* Some security patches and features cannot be backported. -* Dependencies cannot be kept up-to-date. - -Client libraries targeting some end-of-life versions of Node.js are available, and -can be installed through npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). -The dist-tags follow the naming convention `legacy-(version)`. -For example, `npm install @google-cloud/spanner@legacy-8` installs client libraries -for versions compatible with Node.js 8. - -## Versioning - -This library follows [Semantic Versioning](http://semver.org/). - -More Information: [Google Cloud Platform Launch Stages][launch_stages] - -[launch_stages]: https://cloud.google.com/terms/launch-stages - -## Contributing - -Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-spanner/CONTRIBUTING.md). - -Please note that this `README.md` -and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) -are generated from a central template. - -## License - -Apache Version 2.0 - -See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-spanner/LICENSE) - -[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png -[projects]: https://console.cloud.google.com/project -[billing]: https://support.google.com/cloud/answer/6293499#enable-billing -[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=spanner.googleapis.com -[auth]: https://cloud.google.com/docs/authentication/external/set-up-adc-local -[homepage_samples]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-spanner/samples -[homepage_changelog]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-spanner/CHANGELOG.md -[homepage]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-spanner diff --git a/owl-bot-staging/v1/package.json b/owl-bot-staging/v1/package.json deleted file mode 100644 index 2b8152dd8..000000000 --- a/owl-bot-staging/v1/package.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "name": "@google-cloud/spanner", - "version": "0.1.0", - "description": "Spanner client for Node.js", - "repository": "googleapis/nodejs-spanner", - "license": "Apache-2.0", - "author": "Google LLC", - "main": "build/src/index.js", - "files": [ - "build/src", - "build/protos" - ], - "keywords": [ - "google apis client", - "google api client", - "google apis", - "google api", - "google", - "google cloud platform", - "google cloud", - "cloud", - "google spanner", - "spanner", - "spanner" - ], - "scripts": { - "clean": "gts clean", - "compile": "tsc -p . && cp -r protos build/ && minifyProtoJson", - "compile-protos": "compileProtos src", - "docs": "jsdoc -c .jsdoc.js", - "fix": "gts fix", - "lint": "gts check", - "prepare": "npm run compile-protos && npm run compile", - "system-test": "c8 mocha build/system-test", - "test": "c8 mocha build/test" - }, - "dependencies": { - "google-gax": "^5.1.1-rc.1" - }, - "devDependencies": { - "@types/mocha": "^10.0.10", - "@types/node": "^22.18.12", - "@types/sinon": "^17.0.4", - "c8": "^10.1.3", - "gapic-tools": "^1.0.3", - "gts": "^6.0.2", - "jsdoc": "^4.0.5", - "jsdoc-fresh": "^5.0.2", - "jsdoc-region-tag": "^4.0.1", - "mocha": "^11.7.4", - "pack-n-play": "^4.2.1", - "typescript": "5.8.3", - "sinon": "^21.0.0" - }, - "engines": { - "node": ">=v18" - } -} diff --git a/owl-bot-staging/v1/protos/google/spanner/v1/change_stream.proto b/owl-bot-staging/v1/protos/google/spanner/v1/change_stream.proto deleted file mode 100644 index e7d12e608..000000000 --- a/owl-bot-staging/v1/protos/google/spanner/v1/change_stream.proto +++ /dev/null @@ -1,451 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.spanner.v1; - -import "google/protobuf/struct.proto"; -import "google/protobuf/timestamp.proto"; -import "google/spanner/v1/type.proto"; - -option csharp_namespace = "Google.Cloud.Spanner.V1"; -option go_package = "cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb"; -option java_multiple_files = true; -option java_outer_classname = "ChangeStreamProto"; -option java_package = "com.google.spanner.v1"; -option php_namespace = "Google\\Cloud\\Spanner\\V1"; -option ruby_package = "Google::Cloud::Spanner::V1"; - -// Spanner Change Streams enable customers to capture and stream out changes to -// their Spanner databases in real-time. A change stream -// can be created with option partition_mode='IMMUTABLE_KEY_RANGE' or -// partition_mode='MUTABLE_KEY_RANGE'. -// -// This message is only used in Change Streams created with the option -// partition_mode='MUTABLE_KEY_RANGE'. Spanner automatically creates a special -// Table-Valued Function (TVF) along with each Change Streams. The function -// provides access to the change stream's records. The function is named -// READ_ (where is the -// name of the change stream), and it returns a table with only one column -// called ChangeRecord. -message ChangeStreamRecord { - // A data change record contains a set of changes to a table with the same - // modification type (insert, update, or delete) committed at the same commit - // timestamp in one change stream partition for the same transaction. Multiple - // data change records can be returned for the same transaction across - // multiple change stream partitions. - message DataChangeRecord { - // Metadata for a column. - message ColumnMetadata { - // Name of the column. - string name = 1; - - // Type of the column. - Type type = 2; - - // Indicates whether the column is a primary key column. - bool is_primary_key = 3; - - // Ordinal position of the column based on the original table definition - // in the schema starting with a value of 1. - int64 ordinal_position = 4; - } - - // Returns the value and associated metadata for a particular field of the - // [Mod][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod]. - message ModValue { - // Index within the repeated - // [column_metadata][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.column_metadata] - // field, to obtain the column metadata for the column that was modified. - int32 column_metadata_index = 1; - - // The value of the column. - google.protobuf.Value value = 2; - } - - // A mod describes all data changes in a watched table row. - message Mod { - // Returns the value of the primary key of the modified row. - repeated ModValue keys = 1; - - // Returns the old values before the change for the modified columns. - // Always empty for - // [INSERT][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType.INSERT], - // or if old values are not being captured specified by - // [value_capture_type][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ValueCaptureType]. - repeated ModValue old_values = 2; - - // Returns the new values after the change for the modified columns. - // Always empty for - // [DELETE][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType.DELETE]. - repeated ModValue new_values = 3; - } - - // Mod type describes the type of change Spanner applied to the data. For - // example, if the client submits an INSERT_OR_UPDATE request, Spanner will - // perform an insert if there is no existing row and return ModType INSERT. - // Alternatively, if there is an existing row, Spanner will perform an - // update and return ModType UPDATE. - enum ModType { - // Not specified. - MOD_TYPE_UNSPECIFIED = 0; - - // Indicates data was inserted. - INSERT = 10; - - // Indicates existing data was updated. - UPDATE = 20; - - // Indicates existing data was deleted. - DELETE = 30; - } - - // Value capture type describes which values are recorded in the data - // change record. - enum ValueCaptureType { - // Not specified. - VALUE_CAPTURE_TYPE_UNSPECIFIED = 0; - - // Records both old and new values of the modified watched columns. - OLD_AND_NEW_VALUES = 10; - - // Records only new values of the modified watched columns. - NEW_VALUES = 20; - - // Records new values of all watched columns, including modified and - // unmodified columns. - NEW_ROW = 30; - - // Records the new values of all watched columns, including modified and - // unmodified columns. Also records the old values of the modified - // columns. - NEW_ROW_AND_OLD_VALUES = 40; - } - - // Indicates the timestamp in which the change was committed. - // DataChangeRecord.commit_timestamps, - // PartitionStartRecord.start_timestamps, - // PartitionEventRecord.commit_timestamps, and - // PartitionEndRecord.end_timestamps can have the same value in the same - // partition. - google.protobuf.Timestamp commit_timestamp = 1; - - // Record sequence numbers are unique and monotonically increasing (but not - // necessarily contiguous) for a specific timestamp across record - // types in the same partition. To guarantee ordered processing, the reader - // should process records (of potentially different types) in - // record_sequence order for a specific timestamp in the same partition. - // - // The record sequence number ordering across partitions is only meaningful - // in the context of a specific transaction. Record sequence numbers are - // unique across partitions for a specific transaction. Sort the - // DataChangeRecords for the same - // [server_transaction_id][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.server_transaction_id] - // by - // [record_sequence][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.record_sequence] - // to reconstruct the ordering of the changes within the transaction. - string record_sequence = 2; - - // Provides a globally unique string that represents the transaction in - // which the change was committed. Multiple transactions can have the same - // commit timestamp, but each transaction has a unique - // server_transaction_id. - string server_transaction_id = 3; - - // Indicates whether this is the last record for a transaction in the - // current partition. Clients can use this field to determine when all - // records for a transaction in the current partition have been received. - bool is_last_record_in_transaction_in_partition = 4; - - // Name of the table affected by the change. - string table = 5; - - // Provides metadata describing the columns associated with the - // [mods][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.mods] listed - // below. - repeated ColumnMetadata column_metadata = 6; - - // Describes the changes that were made. - repeated Mod mods = 7; - - // Describes the type of change. - ModType mod_type = 8; - - // Describes the value capture type that was specified in the change stream - // configuration when this change was captured. - ValueCaptureType value_capture_type = 9; - - // Indicates the number of data change records that are part of this - // transaction across all change stream partitions. This value can be used - // to assemble all the records associated with a particular transaction. - int32 number_of_records_in_transaction = 10; - - // Indicates the number of partitions that return data change records for - // this transaction. This value can be helpful in assembling all records - // associated with a particular transaction. - int32 number_of_partitions_in_transaction = 11; - - // Indicates the transaction tag associated with this transaction. - string transaction_tag = 12; - - // Indicates whether the transaction is a system transaction. System - // transactions include those issued by time-to-live (TTL), column backfill, - // etc. - bool is_system_transaction = 13; - } - - // A heartbeat record is returned as a progress indicator, when there are no - // data changes or any other partition record types in the change stream - // partition. - message HeartbeatRecord { - // Indicates the timestamp at which the query has returned all the records - // in the change stream partition with timestamp <= heartbeat timestamp. - // The heartbeat timestamp will not be the same as the timestamps of other - // record types in the same partition. - google.protobuf.Timestamp timestamp = 1; - } - - // A partition start record serves as a notification that the client should - // schedule the partitions to be queried. PartitionStartRecord returns - // information about one or more partitions. - message PartitionStartRecord { - // Start timestamp at which the partitions should be queried to return - // change stream records with timestamps >= start_timestamp. - // DataChangeRecord.commit_timestamps, - // PartitionStartRecord.start_timestamps, - // PartitionEventRecord.commit_timestamps, and - // PartitionEndRecord.end_timestamps can have the same value in the same - // partition. - google.protobuf.Timestamp start_timestamp = 1; - - // Record sequence numbers are unique and monotonically increasing (but not - // necessarily contiguous) for a specific timestamp across record - // types in the same partition. To guarantee ordered processing, the reader - // should process records (of potentially different types) in - // record_sequence order for a specific timestamp in the same partition. - string record_sequence = 2; - - // Unique partition identifiers to be used in queries. - repeated string partition_tokens = 3; - } - - // A partition end record serves as a notification that the client should stop - // reading the partition. No further records are expected to be retrieved on - // it. - message PartitionEndRecord { - // End timestamp at which the change stream partition is terminated. All - // changes generated by this partition will have timestamps <= - // end_timestamp. DataChangeRecord.commit_timestamps, - // PartitionStartRecord.start_timestamps, - // PartitionEventRecord.commit_timestamps, and - // PartitionEndRecord.end_timestamps can have the same value in the same - // partition. PartitionEndRecord is the last record returned for a - // partition. - google.protobuf.Timestamp end_timestamp = 1; - - // Record sequence numbers are unique and monotonically increasing (but not - // necessarily contiguous) for a specific timestamp across record - // types in the same partition. To guarantee ordered processing, the reader - // should process records (of potentially different types) in - // record_sequence order for a specific timestamp in the same partition. - string record_sequence = 2; - - // Unique partition identifier describing the terminated change stream - // partition. - // [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEndRecord.partition_token] - // is equal to the partition token of the change stream partition currently - // queried to return this PartitionEndRecord. - string partition_token = 3; - } - - // A partition event record describes key range changes for a change stream - // partition. The changes to a row defined by its primary key can be captured - // in one change stream partition for a specific time range, and then be - // captured in a different change stream partition for a different time range. - // This movement of key ranges across change stream partitions is a reflection - // of activities, such as Spanner's dynamic splitting and load balancing, etc. - // Processing this event is needed if users want to guarantee processing of - // the changes for any key in timestamp order. If time ordered processing of - // changes for a primary key is not needed, this event can be ignored. - // To guarantee time ordered processing for each primary key, if the event - // describes move-ins, the reader of this partition needs to wait until the - // readers of the source partitions have processed all records with timestamps - // <= this PartitionEventRecord.commit_timestamp, before advancing beyond this - // PartitionEventRecord. If the event describes move-outs, the reader can - // notify the readers of the destination partitions that they can continue - // processing. - message PartitionEventRecord { - // Describes move-in of the key ranges into the change stream partition - // identified by - // [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token]. - // - // To maintain processing the changes for a particular key in timestamp - // order, the query processing the change stream partition identified by - // [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token] - // should not advance beyond the partition event record commit timestamp - // until the queries processing the source change stream partitions have - // processed all change stream records with timestamps <= the partition - // event record commit timestamp. - message MoveInEvent { - // An unique partition identifier describing the source change stream - // partition that recorded changes for the key range that is moving - // into this partition. - string source_partition_token = 1; - } - - // Describes move-out of the key ranges out of the change stream partition - // identified by - // [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token]. - // - // To maintain processing the changes for a particular key in timestamp - // order, the query processing the - // [MoveOutEvent][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent] - // in the partition identified by - // [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token] - // should inform the queries processing the destination partitions that - // they can unblock and proceed processing records past the - // [commit_timestamp][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.commit_timestamp]. - message MoveOutEvent { - // An unique partition identifier describing the destination change - // stream partition that will record changes for the key range that is - // moving out of this partition. - string destination_partition_token = 1; - } - - // Indicates the commit timestamp at which the key range change occurred. - // DataChangeRecord.commit_timestamps, - // PartitionStartRecord.start_timestamps, - // PartitionEventRecord.commit_timestamps, and - // PartitionEndRecord.end_timestamps can have the same value in the same - // partition. - google.protobuf.Timestamp commit_timestamp = 1; - - // Record sequence numbers are unique and monotonically increasing (but not - // necessarily contiguous) for a specific timestamp across record - // types in the same partition. To guarantee ordered processing, the reader - // should process records (of potentially different types) in - // record_sequence order for a specific timestamp in the same partition. - string record_sequence = 2; - - // Unique partition identifier describing the partition this event - // occurred on. - // [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token] - // is equal to the partition token of the change stream partition currently - // queried to return this PartitionEventRecord. - string partition_token = 3; - - // Set when one or more key ranges are moved into the change stream - // partition identified by - // [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token]. - // - // Example: Two key ranges are moved into partition (P1) from partition (P2) - // and partition (P3) in a single transaction at timestamp T. - // - // The PartitionEventRecord returned in P1 will reflect the move as: - // - // PartitionEventRecord { - // commit_timestamp: T - // partition_token: "P1" - // move_in_events { - // source_partition_token: "P2" - // } - // move_in_events { - // source_partition_token: "P3" - // } - // } - // - // The PartitionEventRecord returned in P2 will reflect the move as: - // - // PartitionEventRecord { - // commit_timestamp: T - // partition_token: "P2" - // move_out_events { - // destination_partition_token: "P1" - // } - // } - // - // The PartitionEventRecord returned in P3 will reflect the move as: - // - // PartitionEventRecord { - // commit_timestamp: T - // partition_token: "P3" - // move_out_events { - // destination_partition_token: "P1" - // } - // } - repeated MoveInEvent move_in_events = 4; - - // Set when one or more key ranges are moved out of the change stream - // partition identified by - // [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token]. - // - // Example: Two key ranges are moved out of partition (P1) to partition (P2) - // and partition (P3) in a single transaction at timestamp T. - // - // The PartitionEventRecord returned in P1 will reflect the move as: - // - // PartitionEventRecord { - // commit_timestamp: T - // partition_token: "P1" - // move_out_events { - // destination_partition_token: "P2" - // } - // move_out_events { - // destination_partition_token: "P3" - // } - // } - // - // The PartitionEventRecord returned in P2 will reflect the move as: - // - // PartitionEventRecord { - // commit_timestamp: T - // partition_token: "P2" - // move_in_events { - // source_partition_token: "P1" - // } - // } - // - // The PartitionEventRecord returned in P3 will reflect the move as: - // - // PartitionEventRecord { - // commit_timestamp: T - // partition_token: "P3" - // move_in_events { - // source_partition_token: "P1" - // } - // } - repeated MoveOutEvent move_out_events = 5; - } - - // One of the change stream subrecords. - oneof record { - // Data change record describing a data change for a change stream - // partition. - DataChangeRecord data_change_record = 1; - - // Heartbeat record describing a heartbeat for a change stream partition. - HeartbeatRecord heartbeat_record = 2; - - // Partition start record describing a new change stream partition. - PartitionStartRecord partition_start_record = 3; - - // Partition end record describing a terminated change stream partition. - PartitionEndRecord partition_end_record = 4; - - // Partition event record describing key range changes for a change stream - // partition. - PartitionEventRecord partition_event_record = 5; - } -} diff --git a/owl-bot-staging/v1/protos/google/spanner/v1/commit_response.proto b/owl-bot-staging/v1/protos/google/spanner/v1/commit_response.proto deleted file mode 100644 index 6e4459122..000000000 --- a/owl-bot-staging/v1/protos/google/spanner/v1/commit_response.proto +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.spanner.v1; - -import "google/protobuf/timestamp.proto"; -import "google/spanner/v1/transaction.proto"; - -option csharp_namespace = "Google.Cloud.Spanner.V1"; -option go_package = "cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb"; -option java_multiple_files = true; -option java_outer_classname = "CommitResponseProto"; -option java_package = "com.google.spanner.v1"; -option php_namespace = "Google\\Cloud\\Spanner\\V1"; -option ruby_package = "Google::Cloud::Spanner::V1"; - -// The response for [Commit][google.spanner.v1.Spanner.Commit]. -message CommitResponse { - // Additional statistics about a commit. - message CommitStats { - // The total number of mutations for the transaction. Knowing the - // `mutation_count` value can help you maximize the number of mutations - // in a transaction and minimize the number of API round trips. You can - // also monitor this value to prevent transactions from exceeding the system - // [limit](https://cloud.google.com/spanner/quotas#limits_for_creating_reading_updating_and_deleting_data). - // If the number of mutations exceeds the limit, the server returns - // [INVALID_ARGUMENT](https://cloud.google.com/spanner/docs/reference/rest/v1/Code#ENUM_VALUES.INVALID_ARGUMENT). - int64 mutation_count = 1; - } - - // The Cloud Spanner timestamp at which the transaction committed. - google.protobuf.Timestamp commit_timestamp = 1; - - // The statistics about this `Commit`. Not returned by default. - // For more information, see - // [CommitRequest.return_commit_stats][google.spanner.v1.CommitRequest.return_commit_stats]. - CommitStats commit_stats = 2; - - // You must examine and retry the commit if the following is populated. - oneof MultiplexedSessionRetry { - // If specified, transaction has not committed yet. - // You must retry the commit with the new precommit token. - MultiplexedSessionPrecommitToken precommit_token = 4; - } - - // If `TransactionOptions.isolation_level` is set to - // `IsolationLevel.REPEATABLE_READ`, then the snapshot timestamp is the - // timestamp at which all reads in the transaction ran. This timestamp is - // never returned. - google.protobuf.Timestamp snapshot_timestamp = 5; -} diff --git a/owl-bot-staging/v1/protos/google/spanner/v1/keys.proto b/owl-bot-staging/v1/protos/google/spanner/v1/keys.proto deleted file mode 100644 index 5e30e831e..000000000 --- a/owl-bot-staging/v1/protos/google/spanner/v1/keys.proto +++ /dev/null @@ -1,163 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.spanner.v1; - -import "google/protobuf/struct.proto"; - -option csharp_namespace = "Google.Cloud.Spanner.V1"; -option go_package = "cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb"; -option java_multiple_files = true; -option java_outer_classname = "KeysProto"; -option java_package = "com.google.spanner.v1"; -option php_namespace = "Google\\Cloud\\Spanner\\V1"; -option ruby_package = "Google::Cloud::Spanner::V1"; - -// KeyRange represents a range of rows in a table or index. -// -// A range has a start key and an end key. These keys can be open or -// closed, indicating if the range includes rows with that key. -// -// Keys are represented by lists, where the ith value in the list -// corresponds to the ith component of the table or index primary key. -// Individual values are encoded as described -// [here][google.spanner.v1.TypeCode]. -// -// For example, consider the following table definition: -// -// CREATE TABLE UserEvents ( -// UserName STRING(MAX), -// EventDate STRING(10) -// ) PRIMARY KEY(UserName, EventDate); -// -// The following keys name rows in this table: -// -// ["Bob", "2014-09-23"] -// ["Alfred", "2015-06-12"] -// -// Since the `UserEvents` table's `PRIMARY KEY` clause names two -// columns, each `UserEvents` key has two elements; the first is the -// `UserName`, and the second is the `EventDate`. -// -// Key ranges with multiple components are interpreted -// lexicographically by component using the table or index key's declared -// sort order. For example, the following range returns all events for -// user `"Bob"` that occurred in the year 2015: -// -// "start_closed": ["Bob", "2015-01-01"] -// "end_closed": ["Bob", "2015-12-31"] -// -// Start and end keys can omit trailing key components. This affects the -// inclusion and exclusion of rows that exactly match the provided key -// components: if the key is closed, then rows that exactly match the -// provided components are included; if the key is open, then rows -// that exactly match are not included. -// -// For example, the following range includes all events for `"Bob"` that -// occurred during and after the year 2000: -// -// "start_closed": ["Bob", "2000-01-01"] -// "end_closed": ["Bob"] -// -// The next example retrieves all events for `"Bob"`: -// -// "start_closed": ["Bob"] -// "end_closed": ["Bob"] -// -// To retrieve events before the year 2000: -// -// "start_closed": ["Bob"] -// "end_open": ["Bob", "2000-01-01"] -// -// The following range includes all rows in the table: -// -// "start_closed": [] -// "end_closed": [] -// -// This range returns all users whose `UserName` begins with any -// character from A to C: -// -// "start_closed": ["A"] -// "end_open": ["D"] -// -// This range returns all users whose `UserName` begins with B: -// -// "start_closed": ["B"] -// "end_open": ["C"] -// -// Key ranges honor column sort order. For example, suppose a table is -// defined as follows: -// -// CREATE TABLE DescendingSortedTable { -// Key INT64, -// ... -// ) PRIMARY KEY(Key DESC); -// -// The following range retrieves all rows with key values between 1 -// and 100 inclusive: -// -// "start_closed": ["100"] -// "end_closed": ["1"] -// -// Note that 100 is passed as the start, and 1 is passed as the end, -// because `Key` is a descending column in the schema. -message KeyRange { - // The start key must be provided. It can be either closed or open. - oneof start_key_type { - // If the start is closed, then the range includes all rows whose - // first `len(start_closed)` key columns exactly match `start_closed`. - google.protobuf.ListValue start_closed = 1; - - // If the start is open, then the range excludes rows whose first - // `len(start_open)` key columns exactly match `start_open`. - google.protobuf.ListValue start_open = 2; - } - - // The end key must be provided. It can be either closed or open. - oneof end_key_type { - // If the end is closed, then the range includes all rows whose - // first `len(end_closed)` key columns exactly match `end_closed`. - google.protobuf.ListValue end_closed = 3; - - // If the end is open, then the range excludes rows whose first - // `len(end_open)` key columns exactly match `end_open`. - google.protobuf.ListValue end_open = 4; - } -} - -// `KeySet` defines a collection of Cloud Spanner keys and/or key ranges. All -// the keys are expected to be in the same table or index. The keys need -// not be sorted in any particular way. -// -// If the same key is specified multiple times in the set (for example -// if two ranges, two keys, or a key and a range overlap), Cloud Spanner -// behaves as if the key were only specified once. -message KeySet { - // A list of specific keys. Entries in `keys` should have exactly as - // many elements as there are columns in the primary or index key - // with which this `KeySet` is used. Individual key values are - // encoded as described [here][google.spanner.v1.TypeCode]. - repeated google.protobuf.ListValue keys = 1; - - // A list of key ranges. See [KeyRange][google.spanner.v1.KeyRange] for more - // information about key range specifications. - repeated KeyRange ranges = 2; - - // For convenience `all` can be set to `true` to indicate that this - // `KeySet` matches all keys in the table or index. Note that any keys - // specified in `keys` or `ranges` are only yielded once. - bool all = 3; -} diff --git a/owl-bot-staging/v1/protos/google/spanner/v1/location.proto b/owl-bot-staging/v1/protos/google/spanner/v1/location.proto deleted file mode 100644 index 870dc0ec0..000000000 --- a/owl-bot-staging/v1/protos/google/spanner/v1/location.proto +++ /dev/null @@ -1,388 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.spanner.v1; - -import "google/protobuf/struct.proto"; -import "google/spanner/v1/type.proto"; - -option csharp_namespace = "Google.Cloud.Spanner.V1"; -option go_package = "cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb"; -option java_multiple_files = true; -option java_outer_classname = "LocationProto"; -option java_package = "com.google.spanner.v1"; -option php_namespace = "Google\\Cloud\\Spanner\\V1"; -option ruby_package = "Google::Cloud::Spanner::V1"; - -// A `Range` represents a range of keys in a database. The keys themselves -// are encoded in "sortable string format", also known as ssformat. Consult -// Spanner's open source client libraries for details on the encoding. -// -// Each range represents a contiguous range of rows, possibly from multiple -// tables/indexes. Each range is associated with a single paxos group (known as -// a "group" throughout this API), a split (which names the exact range within -// the group), and a generation that can be used to determine whether a given -// `Range` represents a newer or older location for the key range. -message Range { - // The start key of the range, inclusive. Encoded in "sortable string format" - // (ssformat). - bytes start_key = 1; - - // The limit key of the range, exclusive. Encoded in "sortable string format" - // (ssformat). - bytes limit_key = 2; - - // The UID of the paxos group where this range is stored. UIDs are unique - // within the database. References `Group.group_uid`. - uint64 group_uid = 3; - - // A group can store multiple ranges of keys. Each key range is named by an - // ID (the split ID). Within a group, split IDs are unique. The `split_id` - // names the exact split in `group_uid` where this range is stored. - uint64 split_id = 4; - - // `generation` indicates the freshness of the range information contained - // in this proto. Generations can be compared lexicographically; if generation - // A is greater than generation B, then the `Range` corresponding to A is - // newer than the `Range` corresponding to B, and should be used - // preferentially. - bytes generation = 5; -} - -// A `Tablet` represents a single replica of a `Group`. A tablet is served by a -// single server at a time, and can move between servers due to server death or -// simply load balancing. -message Tablet { - // Indicates the role of the tablet. - enum Role { - // Not specified. - ROLE_UNSPECIFIED = 0; - - // The tablet can perform reads and (if elected leader) writes. - READ_WRITE = 1; - - // The tablet can only perform reads. - READ_ONLY = 2; - } - - // The UID of the tablet, unique within the database. Matches the - // `tablet_uids` and `leader_tablet_uid` fields in `Group`. - uint64 tablet_uid = 1; - - // The address of the server that is serving this tablet -- either an IP - // address or DNS hostname and a port number. - string server_address = 2; - - // Where this tablet is located. This is the name of a Google Cloud region, - // such as "us-central1". - string location = 3; - - // The role of the tablet. - Role role = 4; - - // `incarnation` indicates the freshness of the tablet information contained - // in this proto. Incarnations can be compared lexicographically; if - // incarnation A is greater than incarnation B, then the `Tablet` - // corresponding to A is newer than the `Tablet` corresponding to B, and - // should be used preferentially. - bytes incarnation = 5; - - // Distances help the client pick the closest tablet out of the list of - // tablets for a given request. Tablets with lower distances should generally - // be preferred. Tablets with the same distance are approximately equally - // close; the client can choose arbitrarily. - // - // Distances do not correspond precisely to expected latency, geographical - // distance, or anything else. Distances should be compared only between - // tablets of the same group; they are not meaningful between different - // groups. - // - // A value of zero indicates that the tablet may be in the same zone as - // the client, and have minimum network latency. A value less than or equal to - // five indicates that the tablet is thought to be in the same region as the - // client, and may have a few milliseconds of network latency. Values greater - // than five are most likely in a different region, with non-trivial network - // latency. - // - // Clients should use the following algorithm: - // * If the request is using a directed read, eliminate any tablets that - // do not match the directed read's target zone and/or replica type. - // * (Read-write transactions only) Choose leader tablet if it has an - // distance <=5. - // * Group and sort tablets by distance. Choose a random - // tablet with the lowest distance. If the request - // is not a directed read, only consider replicas with distances <=5. - // * Send the request to the fallback endpoint. - // - // The tablet picked by this algorithm may be skipped, either because it is - // marked as `skip` by the server or because the corresponding server is - // unreachable, flow controlled, etc. Skipped tablets should be added to the - // `skipped_tablet_uid` field in `RoutingHint`; the algorithm above should - // then be re-run without including the skipped tablet(s) to pick the next - // best tablet. - uint32 distance = 6; - - // If true, the tablet should not be chosen by the client. Typically, this - // signals that the tablet is unhealthy in some way. Tablets with `skip` - // set to true should be reported back to the server in - // `RoutingHint.skipped_tablet_uid`; this cues the server to send updated - // information for this tablet should it become usable again. - bool skip = 7; -} - -// A `Group` represents a paxos group in a database. A group is a set of -// tablets that are replicated across multiple servers. Groups may have a leader -// tablet. Groups store one (or sometimes more) ranges of keys. -message Group { - // The UID of the paxos group, unique within the database. Matches the - // `group_uid` field in `Range`. - uint64 group_uid = 1; - - // A list of tablets that are part of the group. Note that this list may not - // be exhaustive; it will only include tablets the server considers useful - // to the client. The returned list is ordered ascending by distance. - // - // Tablet UIDs reference `Tablet.tablet_uid`. - repeated Tablet tablets = 2; - - // The last known leader tablet of the group as an index into `tablets`. May - // be negative if the group has no known leader. - int32 leader_index = 3; - - // `generation` indicates the freshness of the group information (including - // leader information) contained in this proto. Generations can be compared - // lexicographically; if generation A is greater than generation B, then the - // `Group` corresponding to A is newer than the `Group` corresponding to B, - // and should be used preferentially. - bytes generation = 4; -} - -// A `KeyRecipe` provides the metadata required to translate reads, mutations, -// and queries into a byte array in "sortable string format" (ssformat)that can -// be used with `Range`s to route requests. Note that the client *must* tolerate -// `KeyRecipe`s that appear to be invalid, since the `KeyRecipe` format may -// change over time. Requests with invalid `KeyRecipe`s should be routed to a -// default server. -message KeyRecipe { - // An ssformat key is composed of a sequence of tag numbers and key column - // values. `Part` represents a single tag or key column value. - message Part { - // The remaining fields encode column values. - enum Order { - // Default value, equivalent to `ASCENDING`. - ORDER_UNSPECIFIED = 0; - - // The key is ascending - corresponds to `ASC` in the schema definition. - ASCENDING = 1; - - // The key is descending - corresponds to `DESC` in the schema definition. - DESCENDING = 2; - } - - // The null order of the key column. This dictates where NULL values sort - // in the sorted order. Note that columns which are `NOT NULL` can have a - // special encoding. - enum NullOrder { - // Default value. This value is unused. - NULL_ORDER_UNSPECIFIED = 0; - - // NULL values sort before any non-NULL values. - NULLS_FIRST = 1; - - // NULL values sort after any non-NULL values. - NULLS_LAST = 2; - - // The column does not support NULL values. - NOT_NULL = 3; - } - - // If non-zero, `tag` is the only field present in this `Part`. The part - // is encoded by appending `tag` to the ssformat key. - uint32 tag = 1; - - // Whether the key column is sorted ascending or descending. Only present - // if `tag` is zero. - Order order = 2; - - // How NULLs are represented in the encoded key part. Only present if `tag` - // is zero. - NullOrder null_order = 3; - - // The type of the key part. Only present if `tag` is zero. - Type type = 4; - - // Only present if `tag` is zero. - oneof value_type { - // `identifier` is the name of the column or query parameter. - string identifier = 5; - - // The constant value of the key part. - // It is present when query uses a constant as a part of the key. - google.protobuf.Value value = 6; - - // If true, the client is responsible to fill in the value randomly. - // It's relevant only for the INT64 type. - bool random = 8; - } - - // It is a repeated field to support fetching key columns from nested - // structs, such as `STRUCT` query parameters. - repeated int32 struct_identifiers = 7; - } - - // A recipe can be associated with a table, index, or query. Tables recipes - // are used to encode read and write keys; index recipes are used for index - // reads, and query recipes are used only for SQL queries. - oneof target { - // A table name, matching the name from the database schema. - string table_name = 1; - - // An index name, matching the name from the database schema. - string index_name = 2; - - // The UID of a query, matching the UID from `RoutingHint`. - uint64 operation_uid = 3; - } - - // Parts are in the order they should appear in the encoded key. - repeated Part part = 4; -} - -// A `RecipeList` contains a list of `KeyRecipe`s, which share the same -// schema generation. -message RecipeList { - // The schema generation of the recipes. To be sent to the server in - // `RoutingHint.schema_generation` whenever one of the recipes is used. - // `schema_generation` values are comparable with each other; if generation A - // compares greater than generation B, then A is a more recent schema than B. - // Clients should in general aim to cache only the latest schema generation, - // and discard more stale recipes. - bytes schema_generation = 1; - - // A list of recipes to be cached. - repeated KeyRecipe recipe = 3; -} - -// A `CacheUpdate` expresses a set of changes the client should incorporate into -// its location cache. These changes may or may not be newer than what the -// client has in its cache, and should be discarded if necessary. `CacheUpdate`s -// can be obtained in response to requests that included a `RoutingHint` -// field, but may also be obtained by explicit location-fetching RPCs which may -// be added in the future. -message CacheUpdate { - // An internal ID for the database. Database names can be reused if a database - // is deleted and re-created. Each time the database is re-created, it will - // get a new database ID, which will never be re-used for any other database. - uint64 database_id = 1; - - // A list of ranges to be cached. - repeated Range range = 2; - - // A list of groups to be cached. - repeated Group group = 3; - - // A list of recipes to be cached. - RecipeList key_recipes = 5; -} - -// `RoutingHint` can be optionally added to location-aware Spanner -// requests. It gives the server hints that can be used to route the request to -// an appropriate server, potentially significantly decreasing latency and -// improving throughput. To achieve improved performance, most fields must be -// filled in with accurate values. -// -// The presence of a valid `RoutingHint` tells the server that the client -// is location-aware. -// -// `RoutingHint` does not change the semantics of the request; it is -// purely a performance hint; the request will perform the same actions on the -// database's data as if `RoutingHint` were not present. However, if -// the `RoutingHint` is incomplete or incorrect, the response may include -// a `CacheUpdate` the client can use to correct its location cache. -message RoutingHint { - // A tablet that was skipped by the client. See `Tablet.tablet_uid` and - // `Tablet.incarnation`. - message SkippedTablet { - // The tablet UID of the tablet that was skipped. See `Tablet.tablet_uid`. - uint64 tablet_uid = 1; - - // The incarnation of the tablet that was skipped. See `Tablet.incarnation`. - bytes incarnation = 2; - } - - // A session-scoped unique ID for the operation, computed client-side. - // Requests with the same `operation_uid` should have a shared 'shape', - // meaning that some fields are expected to be the same, such as the SQL - // query, the target table/columns (for reads) etc. Requests with the same - // `operation_uid` are meant to differ only in fields like keys/key - // ranges/query parameters, transaction IDs, etc. - // - // `operation_uid` must be non-zero for `RoutingHint` to be valid. - uint64 operation_uid = 1; - - // The database ID of the database being accessed, see - // `CacheUpdate.database_id`. Should match the cache entries that were used - // to generate the rest of the fields in this `RoutingHint`. - uint64 database_id = 2; - - // The schema generation of the recipe that was used to generate `key` and - // `limit_key`. See also `RecipeList.schema_generation`. - bytes schema_generation = 3; - - // The key / key range that this request accesses. For operations that - // access a single key, `key` should be set and `limit_key` should be empty. - // For operations that access a key range, `key` and `limit_key` should both - // be set, to the inclusive start and exclusive end of the range respectively. - // - // The keys are encoded in "sortable string format" (ssformat), using a - // `KeyRecipe` that is appropriate for the request. See `KeyRecipe` for more - // details. - bytes key = 4; - - // If this request targets a key range, this is the exclusive end of the - // range. See `key` for more details. - bytes limit_key = 5; - - // The group UID of the group that the client believes serves the range - // defined by `key` and `limit_key`. See `Range.group_uid` for more details. - uint64 group_uid = 6; - - // The split ID of the split that the client believes contains the range - // defined by `key` and `limit_key`. See `Range.split_id` for more details. - uint64 split_id = 7; - - // The tablet UID of the tablet from group `group_uid` that the client - // believes is best to serve this request. See `Group.local_tablet_uids` and - // `Group.leader_tablet_uid`. - uint64 tablet_uid = 8; - - // If the client had multiple options for tablet selection, and some of its - // first choices were unhealthy (e.g., the server is unreachable, or - // `Tablet.skip` is true), this field will contain the tablet UIDs of those - // tablets, with their incarnations. The server may include a `CacheUpdate` - // with new locations for those tablets. - repeated SkippedTablet skipped_tablet_uid = 9; - - // If present, the client's current location. This should be the name of a - // Google Cloud zone or region, such as "us-central1". - // - // If absent, the client's location will be assumed to be the same as the - // location of the server the client ends up connected to. - // - // Locations are primarily valuable for clients that connect from regions - // other than the ones that contain the Spanner database. - string client_location = 10; -} diff --git a/owl-bot-staging/v1/protos/google/spanner/v1/mutation.proto b/owl-bot-staging/v1/protos/google/spanner/v1/mutation.proto deleted file mode 100644 index 7e3306a20..000000000 --- a/owl-bot-staging/v1/protos/google/spanner/v1/mutation.proto +++ /dev/null @@ -1,156 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.spanner.v1; - -import "google/api/field_behavior.proto"; -import "google/protobuf/struct.proto"; -import "google/protobuf/timestamp.proto"; -import "google/spanner/v1/keys.proto"; - -option csharp_namespace = "Google.Cloud.Spanner.V1"; -option go_package = "cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb"; -option java_multiple_files = true; -option java_outer_classname = "MutationProto"; -option java_package = "com.google.spanner.v1"; -option php_namespace = "Google\\Cloud\\Spanner\\V1"; -option ruby_package = "Google::Cloud::Spanner::V1"; - -// A modification to one or more Cloud Spanner rows. Mutations can be -// applied to a Cloud Spanner database by sending them in a -// [Commit][google.spanner.v1.Spanner.Commit] call. -message Mutation { - // Arguments to [insert][google.spanner.v1.Mutation.insert], - // [update][google.spanner.v1.Mutation.update], - // [insert_or_update][google.spanner.v1.Mutation.insert_or_update], and - // [replace][google.spanner.v1.Mutation.replace] operations. - message Write { - // Required. The table whose rows will be written. - string table = 1 [(google.api.field_behavior) = REQUIRED]; - - // The names of the columns in - // [table][google.spanner.v1.Mutation.Write.table] to be written. - // - // The list of columns must contain enough columns to allow - // Cloud Spanner to derive values for all primary key columns in the - // row(s) to be modified. - repeated string columns = 2; - - // The values to be written. `values` can contain more than one - // list of values. If it does, then multiple rows are written, one - // for each entry in `values`. Each list in `values` must have - // exactly as many entries as there are entries in - // [columns][google.spanner.v1.Mutation.Write.columns] above. Sending - // multiple lists is equivalent to sending multiple `Mutation`s, each - // containing one `values` entry and repeating - // [table][google.spanner.v1.Mutation.Write.table] and - // [columns][google.spanner.v1.Mutation.Write.columns]. Individual values in - // each list are encoded as described [here][google.spanner.v1.TypeCode]. - repeated google.protobuf.ListValue values = 3; - } - - // Arguments to [delete][google.spanner.v1.Mutation.delete] operations. - message Delete { - // Required. The table whose rows will be deleted. - string table = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The primary keys of the rows within - // [table][google.spanner.v1.Mutation.Delete.table] to delete. The primary - // keys must be specified in the order in which they appear in the `PRIMARY - // KEY()` clause of the table's equivalent DDL statement (the DDL statement - // used to create the table). Delete is idempotent. The transaction will - // succeed even if some or all rows do not exist. - KeySet key_set = 2 [(google.api.field_behavior) = REQUIRED]; - } - - // Arguments to [send][google.spanner.v1.Mutation.send] operations. - message Send { - // Required. The queue to which the message will be sent. - string queue = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The primary key of the message to be sent. - google.protobuf.ListValue key = 2 [(google.api.field_behavior) = REQUIRED]; - - // The time at which Spanner will begin attempting to deliver the message. - // If `deliver_time` is not set, Spanner will deliver the message - // immediately. If `deliver_time` is in the past, Spanner will replace it - // with a value closer to the current time. - google.protobuf.Timestamp deliver_time = 3; - - // The payload of the message. - google.protobuf.Value payload = 4; - } - - // Arguments to [ack][google.spanner.v1.Mutation.ack] operations. - message Ack { - // Required. The queue where the message to be acked is stored. - string queue = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The primary key of the message to be acked. - google.protobuf.ListValue key = 2 [(google.api.field_behavior) = REQUIRED]; - - // By default, an attempt to ack a message that does not exist will fail - // with a `NOT_FOUND` error. With `ignore_not_found` set to true, the ack - // will succeed even if the message does not exist. This is useful for - // unconditionally acking a message, even if it is missing or has already - // been acked. - bool ignore_not_found = 3; - } - - // Required. The operation to perform. - oneof operation { - // Insert new rows in a table. If any of the rows already exist, - // the write or transaction fails with error `ALREADY_EXISTS`. - Write insert = 1; - - // Update existing rows in a table. If any of the rows does not - // already exist, the transaction fails with error `NOT_FOUND`. - Write update = 2; - - // Like [insert][google.spanner.v1.Mutation.insert], except that if the row - // already exists, then its column values are overwritten with the ones - // provided. Any column values not explicitly written are preserved. - // - // When using - // [insert_or_update][google.spanner.v1.Mutation.insert_or_update], just as - // when using [insert][google.spanner.v1.Mutation.insert], all `NOT NULL` - // columns in the table must be given a value. This holds true even when the - // row already exists and will therefore actually be updated. - Write insert_or_update = 3; - - // Like [insert][google.spanner.v1.Mutation.insert], except that if the row - // already exists, it is deleted, and the column values provided are - // inserted instead. Unlike - // [insert_or_update][google.spanner.v1.Mutation.insert_or_update], this - // means any values not explicitly written become `NULL`. - // - // In an interleaved table, if you create the child table with the - // `ON DELETE CASCADE` annotation, then replacing a parent row - // also deletes the child rows. Otherwise, you must delete the - // child rows before you replace the parent row. - Write replace = 4; - - // Delete rows from a table. Succeeds whether or not the named - // rows were present. - Delete delete = 5; - - // Send a message to a queue. - Send send = 6; - - // Ack a message from a queue. - Ack ack = 7; - } -} diff --git a/owl-bot-staging/v1/protos/google/spanner/v1/query_plan.proto b/owl-bot-staging/v1/protos/google/spanner/v1/query_plan.proto deleted file mode 100644 index 5850ff97f..000000000 --- a/owl-bot-staging/v1/protos/google/spanner/v1/query_plan.proto +++ /dev/null @@ -1,156 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.spanner.v1; - -import "google/api/field_behavior.proto"; -import "google/protobuf/struct.proto"; - -option csharp_namespace = "Google.Cloud.Spanner.V1"; -option go_package = "cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb"; -option java_multiple_files = true; -option java_outer_classname = "QueryPlanProto"; -option java_package = "com.google.spanner.v1"; -option php_namespace = "Google\\Cloud\\Spanner\\V1"; -option ruby_package = "Google::Cloud::Spanner::V1"; - -// Node information for nodes appearing in a -// [QueryPlan.plan_nodes][google.spanner.v1.QueryPlan.plan_nodes]. -message PlanNode { - // The kind of [PlanNode][google.spanner.v1.PlanNode]. Distinguishes between - // the two different kinds of nodes that can appear in a query plan. - enum Kind { - // Not specified. - KIND_UNSPECIFIED = 0; - - // Denotes a Relational operator node in the expression tree. Relational - // operators represent iterative processing of rows during query execution. - // For example, a `TableScan` operation that reads rows from a table. - RELATIONAL = 1; - - // Denotes a Scalar node in the expression tree. Scalar nodes represent - // non-iterable entities in the query plan. For example, constants or - // arithmetic operators appearing inside predicate expressions or references - // to column names. - SCALAR = 2; - } - - // Metadata associated with a parent-child relationship appearing in a - // [PlanNode][google.spanner.v1.PlanNode]. - message ChildLink { - // The node to which the link points. - int32 child_index = 1; - - // The type of the link. For example, in Hash Joins this could be used to - // distinguish between the build child and the probe child, or in the case - // of the child being an output variable, to represent the tag associated - // with the output variable. - string type = 2; - - // Only present if the child node is - // [SCALAR][google.spanner.v1.PlanNode.Kind.SCALAR] and corresponds to an - // output variable of the parent node. The field carries the name of the - // output variable. For example, a `TableScan` operator that reads rows from - // a table will have child links to the `SCALAR` nodes representing the - // output variables created for each column that is read by the operator. - // The corresponding `variable` fields will be set to the variable names - // assigned to the columns. - string variable = 3; - } - - // Condensed representation of a node and its subtree. Only present for - // `SCALAR` [PlanNode(s)][google.spanner.v1.PlanNode]. - message ShortRepresentation { - // A string representation of the expression subtree rooted at this node. - string description = 1; - - // A mapping of (subquery variable name) -> (subquery node id) for cases - // where the `description` string of this node references a `SCALAR` - // subquery contained in the expression subtree rooted at this node. The - // referenced `SCALAR` subquery may not necessarily be a direct child of - // this node. - map subqueries = 2; - } - - // The `PlanNode`'s index in [node - // list][google.spanner.v1.QueryPlan.plan_nodes]. - int32 index = 1; - - // Used to determine the type of node. May be needed for visualizing - // different kinds of nodes differently. For example, If the node is a - // [SCALAR][google.spanner.v1.PlanNode.Kind.SCALAR] node, it will have a - // condensed representation which can be used to directly embed a description - // of the node in its parent. - Kind kind = 2; - - // The display name for the node. - string display_name = 3; - - // List of child node `index`es and their relationship to this parent. - repeated ChildLink child_links = 4; - - // Condensed representation for - // [SCALAR][google.spanner.v1.PlanNode.Kind.SCALAR] nodes. - ShortRepresentation short_representation = 5; - - // Attributes relevant to the node contained in a group of key-value pairs. - // For example, a Parameter Reference node could have the following - // information in its metadata: - // - // { - // "parameter_reference": "param1", - // "parameter_type": "array" - // } - google.protobuf.Struct metadata = 6; - - // The execution statistics associated with the node, contained in a group of - // key-value pairs. Only present if the plan was returned as a result of a - // profile query. For example, number of executions, number of rows/time per - // execution etc. - google.protobuf.Struct execution_stats = 7; -} - -// Output of query advisor analysis. -message QueryAdvisorResult { - // Recommendation to add new indexes to run queries more efficiently. - message IndexAdvice { - // Optional. DDL statements to add new indexes that will improve the query. - repeated string ddl = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Estimated latency improvement factor. For example if the query - // currently takes 500 ms to run and the estimated latency with new indexes - // is 100 ms this field will be 5. - double improvement_factor = 2 [(google.api.field_behavior) = OPTIONAL]; - } - - // Optional. Index Recommendation for a query. This is an optional field and - // the recommendation will only be available when the recommendation - // guarantees significant improvement in query performance. - repeated IndexAdvice index_advice = 1 - [(google.api.field_behavior) = OPTIONAL]; -} - -// Contains an ordered list of nodes appearing in the query plan. -message QueryPlan { - // The nodes in the query plan. Plan nodes are returned in pre-order starting - // with the plan root. Each [PlanNode][google.spanner.v1.PlanNode]'s `id` - // corresponds to its index in `plan_nodes`. - repeated PlanNode plan_nodes = 1; - - // Optional. The advise/recommendations for a query. Currently this field will - // be serving index recommendations for a query. - QueryAdvisorResult query_advice = 2 [(google.api.field_behavior) = OPTIONAL]; -} diff --git a/owl-bot-staging/v1/protos/google/spanner/v1/result_set.proto b/owl-bot-staging/v1/protos/google/spanner/v1/result_set.proto deleted file mode 100644 index 3851d688c..000000000 --- a/owl-bot-staging/v1/protos/google/spanner/v1/result_set.proto +++ /dev/null @@ -1,260 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.spanner.v1; - -import "google/api/field_behavior.proto"; -import "google/protobuf/struct.proto"; -import "google/spanner/v1/location.proto"; -import "google/spanner/v1/query_plan.proto"; -import "google/spanner/v1/transaction.proto"; -import "google/spanner/v1/type.proto"; - -option csharp_namespace = "Google.Cloud.Spanner.V1"; -option go_package = "cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb"; -option java_multiple_files = true; -option java_outer_classname = "ResultSetProto"; -option java_package = "com.google.spanner.v1"; -option php_namespace = "Google\\Cloud\\Spanner\\V1"; -option ruby_package = "Google::Cloud::Spanner::V1"; - -// Results from [Read][google.spanner.v1.Spanner.Read] or -// [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql]. -message ResultSet { - // Metadata about the result set, such as row type information. - ResultSetMetadata metadata = 1; - - // Each element in `rows` is a row whose format is defined by - // [metadata.row_type][google.spanner.v1.ResultSetMetadata.row_type]. The ith - // element in each row matches the ith field in - // [metadata.row_type][google.spanner.v1.ResultSetMetadata.row_type]. Elements - // are encoded based on type as described [here][google.spanner.v1.TypeCode]. - repeated google.protobuf.ListValue rows = 2; - - // Query plan and execution statistics for the SQL statement that - // produced this result set. These can be requested by setting - // [ExecuteSqlRequest.query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode]. - // DML statements always produce stats containing the number of rows - // modified, unless executed using the - // [ExecuteSqlRequest.QueryMode.PLAN][google.spanner.v1.ExecuteSqlRequest.QueryMode.PLAN] - // [ExecuteSqlRequest.query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode]. - // Other fields might or might not be populated, based on the - // [ExecuteSqlRequest.query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode]. - ResultSetStats stats = 3; - - // Optional. A precommit token is included if the read-write transaction is on - // a multiplexed session. Pass the precommit token with the highest sequence - // number from this transaction attempt to the - // [Commit][google.spanner.v1.Spanner.Commit] request for this transaction. - MultiplexedSessionPrecommitToken precommit_token = 5 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A cache update expresses a set of changes the client should - // incorporate into its location cache. The client should discard the changes - // if they are older than the data it already has. This data can be obtained - // in response to requests that included a `RoutingHint` field, but may also - // be obtained by explicit location-fetching RPCs which may be added in the - // future. - CacheUpdate cache_update = 6 [(google.api.field_behavior) = OPTIONAL]; -} - -// Partial results from a streaming read or SQL query. Streaming reads and -// SQL queries better tolerate large result sets, large rows, and large -// values, but are a little trickier to consume. -message PartialResultSet { - // Metadata about the result set, such as row type information. - // Only present in the first response. - ResultSetMetadata metadata = 1; - - // A streamed result set consists of a stream of values, which might - // be split into many `PartialResultSet` messages to accommodate - // large rows and/or large values. Every N complete values defines a - // row, where N is equal to the number of entries in - // [metadata.row_type.fields][google.spanner.v1.StructType.fields]. - // - // Most values are encoded based on type as described - // [here][google.spanner.v1.TypeCode]. - // - // It's possible that the last value in values is "chunked", - // meaning that the rest of the value is sent in subsequent - // `PartialResultSet`(s). This is denoted by the - // [chunked_value][google.spanner.v1.PartialResultSet.chunked_value] field. - // Two or more chunked values can be merged to form a complete value as - // follows: - // - // * `bool/number/null`: can't be chunked - // * `string`: concatenate the strings - // * `list`: concatenate the lists. If the last element in a list is a - // `string`, `list`, or `object`, merge it with the first element in - // the next list by applying these rules recursively. - // * `object`: concatenate the (field name, field value) pairs. If a - // field name is duplicated, then apply these rules recursively - // to merge the field values. - // - // Some examples of merging: - // - // Strings are concatenated. - // "foo", "bar" => "foobar" - // - // Lists of non-strings are concatenated. - // [2, 3], [4] => [2, 3, 4] - // - // Lists are concatenated, but the last and first elements are merged - // because they are strings. - // ["a", "b"], ["c", "d"] => ["a", "bc", "d"] - // - // Lists are concatenated, but the last and first elements are merged - // because they are lists. Recursively, the last and first elements - // of the inner lists are merged because they are strings. - // ["a", ["b", "c"]], [["d"], "e"] => ["a", ["b", "cd"], "e"] - // - // Non-overlapping object fields are combined. - // {"a": "1"}, {"b": "2"} => {"a": "1", "b": 2"} - // - // Overlapping object fields are merged. - // {"a": "1"}, {"a": "2"} => {"a": "12"} - // - // Examples of merging objects containing lists of strings. - // {"a": ["1"]}, {"a": ["2"]} => {"a": ["12"]} - // - // For a more complete example, suppose a streaming SQL query is - // yielding a result set whose rows contain a single string - // field. The following `PartialResultSet`s might be yielded: - // - // { - // "metadata": { ... } - // "values": ["Hello", "W"] - // "chunked_value": true - // "resume_token": "Af65..." - // } - // { - // "values": ["orl"] - // "chunked_value": true - // } - // { - // "values": ["d"] - // "resume_token": "Zx1B..." - // } - // - // This sequence of `PartialResultSet`s encodes two rows, one - // containing the field value `"Hello"`, and a second containing the - // field value `"World" = "W" + "orl" + "d"`. - // - // Not all `PartialResultSet`s contain a `resume_token`. Execution can only be - // resumed from a previously yielded `resume_token`. For the above sequence of - // `PartialResultSet`s, resuming the query with `"resume_token": "Af65..."` - // yields results from the `PartialResultSet` with value "orl". - repeated google.protobuf.Value values = 2; - - // If true, then the final value in - // [values][google.spanner.v1.PartialResultSet.values] is chunked, and must be - // combined with more values from subsequent `PartialResultSet`s to obtain a - // complete field value. - bool chunked_value = 3; - - // Streaming calls might be interrupted for a variety of reasons, such - // as TCP connection loss. If this occurs, the stream of results can - // be resumed by re-sending the original request and including - // `resume_token`. Note that executing any other transaction in the - // same session invalidates the token. - bytes resume_token = 4; - - // Query plan and execution statistics for the statement that produced this - // streaming result set. These can be requested by setting - // [ExecuteSqlRequest.query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode] - // and are sent only once with the last response in the stream. This field is - // also present in the last response for DML statements. - ResultSetStats stats = 5; - - // Optional. A precommit token is included if the read-write transaction - // has multiplexed sessions enabled. Pass the precommit token with the highest - // sequence number from this transaction attempt to the - // [Commit][google.spanner.v1.Spanner.Commit] request for this transaction. - MultiplexedSessionPrecommitToken precommit_token = 8 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Indicates whether this is the last `PartialResultSet` in the - // stream. The server might optionally set this field. Clients shouldn't rely - // on this field being set in all cases. - bool last = 9 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A cache update expresses a set of changes the client should - // incorporate into its location cache. The client should discard the changes - // if they are older than the data it already has. This data can be obtained - // in response to requests that included a `RoutingHint` field, but may also - // be obtained by explicit location-fetching RPCs which may be added in the - // future. - CacheUpdate cache_update = 10 [(google.api.field_behavior) = OPTIONAL]; -} - -// Metadata about a [ResultSet][google.spanner.v1.ResultSet] or -// [PartialResultSet][google.spanner.v1.PartialResultSet]. -message ResultSetMetadata { - // Indicates the field names and types for the rows in the result - // set. For example, a SQL query like `"SELECT UserId, UserName FROM - // Users"` could return a `row_type` value like: - // - // "fields": [ - // { "name": "UserId", "type": { "code": "INT64" } }, - // { "name": "UserName", "type": { "code": "STRING" } }, - // ] - StructType row_type = 1; - - // If the read or SQL query began a transaction as a side-effect, the - // information about the new transaction is yielded here. - Transaction transaction = 2; - - // A SQL query can be parameterized. In PLAN mode, these parameters can be - // undeclared. This indicates the field names and types for those undeclared - // parameters in the SQL query. For example, a SQL query like `"SELECT * FROM - // Users where UserId = @userId and UserName = @userName "` could return a - // `undeclared_parameters` value like: - // - // "fields": [ - // { "name": "UserId", "type": { "code": "INT64" } }, - // { "name": "UserName", "type": { "code": "STRING" } }, - // ] - StructType undeclared_parameters = 3; -} - -// Additional statistics about a [ResultSet][google.spanner.v1.ResultSet] or -// [PartialResultSet][google.spanner.v1.PartialResultSet]. -message ResultSetStats { - // [QueryPlan][google.spanner.v1.QueryPlan] for the query associated with this - // result. - QueryPlan query_plan = 1; - - // Aggregated statistics from the execution of the query. Only present when - // the query is profiled. For example, a query could return the statistics as - // follows: - // - // { - // "rows_returned": "3", - // "elapsed_time": "1.22 secs", - // "cpu_time": "1.19 secs" - // } - google.protobuf.Struct query_stats = 2; - - // The number of rows modified by the DML statement. - oneof row_count { - // Standard DML returns an exact count of rows that were modified. - int64 row_count_exact = 3; - - // Partitioned DML doesn't offer exactly-once semantics, so it - // returns a lower bound of the rows modified. - int64 row_count_lower_bound = 4; - } -} diff --git a/owl-bot-staging/v1/protos/google/spanner/v1/spanner.proto b/owl-bot-staging/v1/protos/google/spanner/v1/spanner.proto deleted file mode 100644 index 525cc2ba4..000000000 --- a/owl-bot-staging/v1/protos/google/spanner/v1/spanner.proto +++ /dev/null @@ -1,1419 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.spanner.v1; - -import public "google/spanner/v1/commit_response.proto"; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/empty.proto"; -import "google/protobuf/struct.proto"; -import "google/protobuf/timestamp.proto"; -import "google/rpc/status.proto"; -import "google/spanner/v1/keys.proto"; -import "google/spanner/v1/location.proto"; -import "google/spanner/v1/mutation.proto"; -import "google/spanner/v1/result_set.proto"; -import "google/spanner/v1/transaction.proto"; -import "google/spanner/v1/type.proto"; - -option csharp_namespace = "Google.Cloud.Spanner.V1"; -option go_package = "cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb"; -option java_multiple_files = true; -option java_outer_classname = "SpannerProto"; -option java_package = "com.google.spanner.v1"; -option php_namespace = "Google\\Cloud\\Spanner\\V1"; -option ruby_package = "Google::Cloud::Spanner::V1"; -option (google.api.resource_definition) = { - type: "spanner.googleapis.com/Database" - pattern: "projects/{project}/instances/{instance}/databases/{database}" -}; - -// Cloud Spanner API -// -// The Cloud Spanner API can be used to manage sessions and execute -// transactions on data stored in Cloud Spanner databases. -service Spanner { - option (google.api.default_host) = "spanner.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform," - "https://www.googleapis.com/auth/spanner.data"; - - // Creates a new session. A session can be used to perform - // transactions that read and/or modify data in a Cloud Spanner database. - // Sessions are meant to be reused for many consecutive - // transactions. - // - // Sessions can only execute one transaction at a time. To execute - // multiple concurrent read-write/write-only transactions, create - // multiple sessions. Note that standalone reads and queries use a - // transaction internally, and count toward the one transaction - // limit. - // - // Active sessions use additional server resources, so it's a good idea to - // delete idle and unneeded sessions. - // Aside from explicit deletes, Cloud Spanner can delete sessions when no - // operations are sent for more than an hour. If a session is deleted, - // requests to it return `NOT_FOUND`. - // - // Idle sessions can be kept alive by sending a trivial SQL query - // periodically, for example, `"SELECT 1"`. - rpc CreateSession(CreateSessionRequest) returns (Session) { - option (google.api.http) = { - post: "/v1/{database=projects/*/instances/*/databases/*}/sessions" - body: "*" - }; - option (google.api.method_signature) = "database"; - } - - // Creates multiple new sessions. - // - // This API can be used to initialize a session cache on the clients. - // See https://goo.gl/TgSFN2 for best practices on session cache management. - rpc BatchCreateSessions(BatchCreateSessionsRequest) - returns (BatchCreateSessionsResponse) { - option (google.api.http) = { - post: "/v1/{database=projects/*/instances/*/databases/*}/sessions:batchCreate" - body: "*" - }; - option (google.api.method_signature) = "database,session_count"; - } - - // Gets a session. Returns `NOT_FOUND` if the session doesn't exist. - // This is mainly useful for determining whether a session is still - // alive. - rpc GetSession(GetSessionRequest) returns (Session) { - option (google.api.http) = { - get: "/v1/{name=projects/*/instances/*/databases/*/sessions/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists all sessions in a given database. - rpc ListSessions(ListSessionsRequest) returns (ListSessionsResponse) { - option (google.api.http) = { - get: "/v1/{database=projects/*/instances/*/databases/*}/sessions" - }; - option (google.api.method_signature) = "database"; - } - - // Ends a session, releasing server resources associated with it. This - // asynchronously triggers the cancellation of any operations that are running - // with this session. - rpc DeleteSession(DeleteSessionRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/instances/*/databases/*/sessions/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Executes an SQL statement, returning all results in a single reply. This - // method can't be used to return a result set larger than 10 MiB; - // if the query yields more data than that, the query fails with - // a `FAILED_PRECONDITION` error. - // - // Operations inside read-write transactions might return `ABORTED`. If - // this occurs, the application should restart the transaction from - // the beginning. See [Transaction][google.spanner.v1.Transaction] for more - // details. - // - // Larger result sets can be fetched in streaming fashion by calling - // [ExecuteStreamingSql][google.spanner.v1.Spanner.ExecuteStreamingSql] - // instead. - // - // The query string can be SQL or [Graph Query Language - // (GQL)](https://cloud.google.com/spanner/docs/reference/standard-sql/graph-intro). - rpc ExecuteSql(ExecuteSqlRequest) returns (ResultSet) { - option (google.api.http) = { - post: "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:executeSql" - body: "*" - }; - } - - // Like [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql], except returns the - // result set as a stream. Unlike - // [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql], there is no limit on - // the size of the returned result set. However, no individual row in the - // result set can exceed 100 MiB, and no column value can exceed 10 MiB. - // - // The query string can be SQL or [Graph Query Language - // (GQL)](https://cloud.google.com/spanner/docs/reference/standard-sql/graph-intro). - rpc ExecuteStreamingSql(ExecuteSqlRequest) returns (stream PartialResultSet) { - option (google.api.http) = { - post: "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:executeStreamingSql" - body: "*" - }; - } - - // Executes a batch of SQL DML statements. This method allows many statements - // to be run with lower latency than submitting them sequentially with - // [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql]. - // - // Statements are executed in sequential order. A request can succeed even if - // a statement fails. The - // [ExecuteBatchDmlResponse.status][google.spanner.v1.ExecuteBatchDmlResponse.status] - // field in the response provides information about the statement that failed. - // Clients must inspect this field to determine whether an error occurred. - // - // Execution stops after the first failed statement; the remaining statements - // are not executed. - rpc ExecuteBatchDml(ExecuteBatchDmlRequest) - returns (ExecuteBatchDmlResponse) { - option (google.api.http) = { - post: "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:executeBatchDml" - body: "*" - }; - } - - // Reads rows from the database using key lookups and scans, as a - // simple key/value style alternative to - // [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql]. This method can't be - // used to return a result set larger than 10 MiB; if the read matches more - // data than that, the read fails with a `FAILED_PRECONDITION` - // error. - // - // Reads inside read-write transactions might return `ABORTED`. If - // this occurs, the application should restart the transaction from - // the beginning. See [Transaction][google.spanner.v1.Transaction] for more - // details. - // - // Larger result sets can be yielded in streaming fashion by calling - // [StreamingRead][google.spanner.v1.Spanner.StreamingRead] instead. - rpc Read(ReadRequest) returns (ResultSet) { - option (google.api.http) = { - post: "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:read" - body: "*" - }; - } - - // Like [Read][google.spanner.v1.Spanner.Read], except returns the result set - // as a stream. Unlike [Read][google.spanner.v1.Spanner.Read], there is no - // limit on the size of the returned result set. However, no individual row in - // the result set can exceed 100 MiB, and no column value can exceed - // 10 MiB. - rpc StreamingRead(ReadRequest) returns (stream PartialResultSet) { - option (google.api.http) = { - post: "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:streamingRead" - body: "*" - }; - } - - // Begins a new transaction. This step can often be skipped: - // [Read][google.spanner.v1.Spanner.Read], - // [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql] and - // [Commit][google.spanner.v1.Spanner.Commit] can begin a new transaction as a - // side-effect. - rpc BeginTransaction(BeginTransactionRequest) returns (Transaction) { - option (google.api.http) = { - post: "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:beginTransaction" - body: "*" - }; - option (google.api.method_signature) = "session,options"; - } - - // Commits a transaction. The request includes the mutations to be - // applied to rows in the database. - // - // `Commit` might return an `ABORTED` error. This can occur at any time; - // commonly, the cause is conflicts with concurrent - // transactions. However, it can also happen for a variety of other - // reasons. If `Commit` returns `ABORTED`, the caller should retry - // the transaction from the beginning, reusing the same session. - // - // On very rare occasions, `Commit` might return `UNKNOWN`. This can happen, - // for example, if the client job experiences a 1+ hour networking failure. - // At that point, Cloud Spanner has lost track of the transaction outcome and - // we recommend that you perform another read from the database to see the - // state of things as they are now. - rpc Commit(CommitRequest) returns (CommitResponse) { - option (google.api.http) = { - post: "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:commit" - body: "*" - }; - option (google.api.method_signature) = "session,transaction_id,mutations"; - option (google.api.method_signature) = - "session,single_use_transaction,mutations"; - } - - // Rolls back a transaction, releasing any locks it holds. It's a good - // idea to call this for any transaction that includes one or more - // [Read][google.spanner.v1.Spanner.Read] or - // [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql] requests and ultimately - // decides not to commit. - // - // `Rollback` returns `OK` if it successfully aborts the transaction, the - // transaction was already aborted, or the transaction isn't - // found. `Rollback` never returns `ABORTED`. - rpc Rollback(RollbackRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:rollback" - body: "*" - }; - option (google.api.method_signature) = "session,transaction_id"; - } - - // Creates a set of partition tokens that can be used to execute a query - // operation in parallel. Each of the returned partition tokens can be used - // by [ExecuteStreamingSql][google.spanner.v1.Spanner.ExecuteStreamingSql] to - // specify a subset of the query result to read. The same session and - // read-only transaction must be used by the `PartitionQueryRequest` used to - // create the partition tokens and the `ExecuteSqlRequests` that use the - // partition tokens. - // - // Partition tokens become invalid when the session used to create them - // is deleted, is idle for too long, begins a new transaction, or becomes too - // old. When any of these happen, it isn't possible to resume the query, and - // the whole operation must be restarted from the beginning. - rpc PartitionQuery(PartitionQueryRequest) returns (PartitionResponse) { - option (google.api.http) = { - post: "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:partitionQuery" - body: "*" - }; - } - - // Creates a set of partition tokens that can be used to execute a read - // operation in parallel. Each of the returned partition tokens can be used - // by [StreamingRead][google.spanner.v1.Spanner.StreamingRead] to specify a - // subset of the read result to read. The same session and read-only - // transaction must be used by the `PartitionReadRequest` used to create the - // partition tokens and the `ReadRequests` that use the partition tokens. - // There are no ordering guarantees on rows returned among the returned - // partition tokens, or even within each individual `StreamingRead` call - // issued with a `partition_token`. - // - // Partition tokens become invalid when the session used to create them - // is deleted, is idle for too long, begins a new transaction, or becomes too - // old. When any of these happen, it isn't possible to resume the read, and - // the whole operation must be restarted from the beginning. - rpc PartitionRead(PartitionReadRequest) returns (PartitionResponse) { - option (google.api.http) = { - post: "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:partitionRead" - body: "*" - }; - } - - // Batches the supplied mutation groups in a collection of efficient - // transactions. All mutations in a group are committed atomically. However, - // mutations across groups can be committed non-atomically in an unspecified - // order and thus, they must be independent of each other. Partial failure is - // possible, that is, some groups might have been committed successfully, - // while some might have failed. The results of individual batches are - // streamed into the response as the batches are applied. - // - // `BatchWrite` requests are not replay protected, meaning that each mutation - // group can be applied more than once. Replays of non-idempotent mutations - // can have undesirable effects. For example, replays of an insert mutation - // can produce an already exists error or if you use generated or commit - // timestamp-based keys, it can result in additional rows being added to the - // mutation's table. We recommend structuring your mutation groups to be - // idempotent to avoid this issue. - rpc BatchWrite(BatchWriteRequest) returns (stream BatchWriteResponse) { - option (google.api.http) = { - post: "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:batchWrite" - body: "*" - }; - option (google.api.method_signature) = "session,mutation_groups"; - } -} - -// The request for [CreateSession][google.spanner.v1.Spanner.CreateSession]. -message CreateSessionRequest { - // Required. The database in which the new session is created. - string database = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "spanner.googleapis.com/Database" - } - ]; - - // Required. The session to create. - Session session = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// The request for -// [BatchCreateSessions][google.spanner.v1.Spanner.BatchCreateSessions]. -message BatchCreateSessionsRequest { - // Required. The database in which the new sessions are created. - string database = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "spanner.googleapis.com/Database" - } - ]; - - // Parameters to apply to each created session. - Session session_template = 2; - - // Required. The number of sessions to be created in this batch call. At least - // one session is created. The API can return fewer than the requested number - // of sessions. If a specific number of sessions are desired, the client can - // make additional calls to `BatchCreateSessions` (adjusting - // [session_count][google.spanner.v1.BatchCreateSessionsRequest.session_count] - // as necessary). - int32 session_count = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// The response for -// [BatchCreateSessions][google.spanner.v1.Spanner.BatchCreateSessions]. -message BatchCreateSessionsResponse { - // The freshly created sessions. - repeated Session session = 1; -} - -// A session in the Cloud Spanner API. -message Session { - option (google.api.resource) = { - type: "spanner.googleapis.com/Session" - pattern: "projects/{project}/instances/{instance}/databases/{database}/sessions/{session}" - plural: "sessions" - singular: "session" - }; - - // Output only. The name of the session. This is always system-assigned. - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The labels for the session. - // - // * Label keys must be between 1 and 63 characters long and must conform to - // the following regular expression: `[a-z]([-a-z0-9]*[a-z0-9])?`. - // * Label values must be between 0 and 63 characters long and must conform - // to the regular expression `([a-z]([-a-z0-9]*[a-z0-9])?)?`. - // * No more than 64 labels can be associated with a given session. - // - // See https://goo.gl/xmQnxf for more information on and examples of labels. - map labels = 2; - - // Output only. The timestamp when the session is created. - google.protobuf.Timestamp create_time = 3 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The approximate timestamp when the session is last used. It's - // typically earlier than the actual last use time. - google.protobuf.Timestamp approximate_last_use_time = 4 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The database role which created this session. - string creator_role = 5; - - // Optional. If `true`, specifies a multiplexed session. Use a multiplexed - // session for multiple, concurrent operations including any combination of - // read-only and read-write transactions. Use - // [`sessions.create`][google.spanner.v1.Spanner.CreateSession] to create - // multiplexed sessions. Don't use - // [BatchCreateSessions][google.spanner.v1.Spanner.BatchCreateSessions] to - // create a multiplexed session. You can't delete or list multiplexed - // sessions. - bool multiplexed = 6 [(google.api.field_behavior) = OPTIONAL]; -} - -// The request for [GetSession][google.spanner.v1.Spanner.GetSession]. -message GetSessionRequest { - // Required. The name of the session to retrieve. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "spanner.googleapis.com/Session" } - ]; -} - -// The request for [ListSessions][google.spanner.v1.Spanner.ListSessions]. -message ListSessionsRequest { - // Required. The database in which to list sessions. - string database = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "spanner.googleapis.com/Database" - } - ]; - - // Number of sessions to be returned in the response. If 0 or less, defaults - // to the server's maximum allowed page size. - int32 page_size = 2; - - // If non-empty, `page_token` should contain a - // [next_page_token][google.spanner.v1.ListSessionsResponse.next_page_token] - // from a previous - // [ListSessionsResponse][google.spanner.v1.ListSessionsResponse]. - string page_token = 3; - - // An expression for filtering the results of the request. Filter rules are - // case insensitive. The fields eligible for filtering are: - // - // * `labels.key` where key is the name of a label - // - // Some examples of using filters are: - // - // * `labels.env:*` --> The session has the label "env". - // * `labels.env:dev` --> The session has the label "env" and the value of - // the label contains the string "dev". - string filter = 4; -} - -// The response for [ListSessions][google.spanner.v1.Spanner.ListSessions]. -message ListSessionsResponse { - // The list of requested sessions. - repeated Session sessions = 1; - - // `next_page_token` can be sent in a subsequent - // [ListSessions][google.spanner.v1.Spanner.ListSessions] call to fetch more - // of the matching sessions. - string next_page_token = 2; -} - -// The request for [DeleteSession][google.spanner.v1.Spanner.DeleteSession]. -message DeleteSessionRequest { - // Required. The name of the session to delete. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "spanner.googleapis.com/Session" } - ]; -} - -// Common request options for various APIs. -message RequestOptions { - // The relative priority for requests. Note that priority isn't applicable - // for [BeginTransaction][google.spanner.v1.Spanner.BeginTransaction]. - // - // The priority acts as a hint to the Cloud Spanner scheduler and doesn't - // guarantee priority or order of execution. For example: - // - // * Some parts of a write operation always execute at `PRIORITY_HIGH`, - // regardless of the specified priority. This can cause you to see an - // increase in high priority workload even when executing a low priority - // request. This can also potentially cause a priority inversion where a - // lower priority request is fulfilled ahead of a higher priority - // request. - // * If a transaction contains multiple operations with different priorities, - // Cloud Spanner doesn't guarantee to process the higher priority - // operations first. There might be other constraints to satisfy, such as - // the order of operations. - enum Priority { - // `PRIORITY_UNSPECIFIED` is equivalent to `PRIORITY_HIGH`. - PRIORITY_UNSPECIFIED = 0; - - // This specifies that the request is low priority. - PRIORITY_LOW = 1; - - // This specifies that the request is medium priority. - PRIORITY_MEDIUM = 2; - - // This specifies that the request is high priority. - PRIORITY_HIGH = 3; - } - - // Container for various pieces of client-owned context attached to a request. - message ClientContext { - // Optional. Map of parameter name to value for this request. These values - // will be returned by any SECURE_CONTEXT() calls invoked by this request - // (e.g., by queries against Parameterized Secure Views). - map secure_context = 1 - [(google.api.field_behavior) = OPTIONAL]; - } - - // Priority for the request. - Priority priority = 1; - - // A per-request tag which can be applied to queries or reads, used for - // statistics collection. - // Both `request_tag` and `transaction_tag` can be specified for a read or - // query that belongs to a transaction. - // This field is ignored for requests where it's not applicable (for example, - // `CommitRequest`). - // Legal characters for `request_tag` values are all printable characters - // (ASCII 32 - 126) and the length of a request_tag is limited to 50 - // characters. Values that exceed this limit are truncated. - // Any leading underscore (_) characters are removed from the string. - string request_tag = 2; - - // A tag used for statistics collection about this transaction. - // Both `request_tag` and `transaction_tag` can be specified for a read or - // query that belongs to a transaction. - // To enable tagging on a transaction, `transaction_tag` must be set to the - // same value for all requests belonging to the same transaction, including - // [BeginTransaction][google.spanner.v1.Spanner.BeginTransaction]. - // If this request doesn't belong to any transaction, `transaction_tag` is - // ignored. - // Legal characters for `transaction_tag` values are all printable characters - // (ASCII 32 - 126) and the length of a `transaction_tag` is limited to 50 - // characters. Values that exceed this limit are truncated. - // Any leading underscore (_) characters are removed from the string. - string transaction_tag = 3; - - // Optional. Optional context that may be needed for some requests. - ClientContext client_context = 4 [(google.api.field_behavior) = OPTIONAL]; -} - -// The `DirectedReadOptions` can be used to indicate which replicas or regions -// should be used for non-transactional reads or queries. -// -// `DirectedReadOptions` can only be specified for a read-only transaction, -// otherwise the API returns an `INVALID_ARGUMENT` error. -message DirectedReadOptions { - // The directed read replica selector. - // Callers must provide one or more of the following fields for replica - // selection: - // - // * `location` - The location must be one of the regions within the - // multi-region configuration of your database. - // * `type` - The type of the replica. - // - // Some examples of using replica_selectors are: - // - // * `location:us-east1` --> The "us-east1" replica(s) of any available type - // is used to process the request. - // * `type:READ_ONLY` --> The "READ_ONLY" type replica(s) in the nearest - // available location are used to process the - // request. - // * `location:us-east1 type:READ_ONLY` --> The "READ_ONLY" type replica(s) - // in location "us-east1" is used to process - // the request. - message ReplicaSelection { - // Indicates the type of replica. - enum Type { - // Not specified. - TYPE_UNSPECIFIED = 0; - - // Read-write replicas support both reads and writes. - READ_WRITE = 1; - - // Read-only replicas only support reads (not writes). - READ_ONLY = 2; - } - - // The location or region of the serving requests, for example, "us-east1". - string location = 1; - - // The type of replica. - Type type = 2; - } - - // An `IncludeReplicas` contains a repeated set of `ReplicaSelection` which - // indicates the order in which replicas should be considered. - message IncludeReplicas { - // The directed read replica selector. - repeated ReplicaSelection replica_selections = 1; - - // If `true`, Spanner doesn't route requests to a replica outside the - // <`include_replicas` list when all of the specified replicas are - // unavailable or unhealthy. Default value is `false`. - bool auto_failover_disabled = 2; - } - - // An ExcludeReplicas contains a repeated set of ReplicaSelection that should - // be excluded from serving requests. - message ExcludeReplicas { - // The directed read replica selector. - repeated ReplicaSelection replica_selections = 1; - } - - // Required. At most one of either `include_replicas` or `exclude_replicas` - // should be present in the message. - oneof replicas { - // `Include_replicas` indicates the order of replicas (as they appear in - // this list) to process the request. If `auto_failover_disabled` is set to - // `true` and all replicas are exhausted without finding a healthy replica, - // Spanner waits for a replica in the list to become available, requests - // might fail due to `DEADLINE_EXCEEDED` errors. - IncludeReplicas include_replicas = 1; - - // `Exclude_replicas` indicates that specified replicas should be excluded - // from serving requests. Spanner doesn't route requests to the replicas - // in this list. - ExcludeReplicas exclude_replicas = 2; - } -} - -// The request for [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql] and -// [ExecuteStreamingSql][google.spanner.v1.Spanner.ExecuteStreamingSql]. -message ExecuteSqlRequest { - // Mode in which the statement must be processed. - enum QueryMode { - // The default mode. Only the statement results are returned. - NORMAL = 0; - - // This mode returns only the query plan, without any results or - // execution statistics information. - PLAN = 1; - - // This mode returns the query plan, overall execution statistics, - // operator level execution statistics along with the results. This has a - // performance overhead compared to the other modes. It isn't recommended - // to use this mode for production traffic. - PROFILE = 2; - - // This mode returns the overall (but not operator-level) execution - // statistics along with the results. - WITH_STATS = 3; - - // This mode returns the query plan, overall (but not operator-level) - // execution statistics along with the results. - WITH_PLAN_AND_STATS = 4; - } - - // Query optimizer configuration. - message QueryOptions { - // An option to control the selection of optimizer version. - // - // This parameter allows individual queries to pick different query - // optimizer versions. - // - // Specifying `latest` as a value instructs Cloud Spanner to use the - // latest supported query optimizer version. If not specified, Cloud Spanner - // uses the optimizer version set at the database level options. Any other - // positive integer (from the list of supported optimizer versions) - // overrides the default optimizer version for query execution. - // - // The list of supported optimizer versions can be queried from - // `SPANNER_SYS.SUPPORTED_OPTIMIZER_VERSIONS`. - // - // Executing a SQL statement with an invalid optimizer version fails with - // an `INVALID_ARGUMENT` error. - // - // See - // https://cloud.google.com/spanner/docs/query-optimizer/manage-query-optimizer - // for more information on managing the query optimizer. - // - // The `optimizer_version` statement hint has precedence over this setting. - string optimizer_version = 1; - - // An option to control the selection of optimizer statistics package. - // - // This parameter allows individual queries to use a different query - // optimizer statistics package. - // - // Specifying `latest` as a value instructs Cloud Spanner to use the latest - // generated statistics package. If not specified, Cloud Spanner uses - // the statistics package set at the database level options, or the latest - // package if the database option isn't set. - // - // The statistics package requested by the query has to be exempt from - // garbage collection. This can be achieved with the following DDL - // statement: - // - // ```sql - // ALTER STATISTICS SET OPTIONS (allow_gc=false) - // ``` - // - // The list of available statistics packages can be queried from - // `INFORMATION_SCHEMA.SPANNER_STATISTICS`. - // - // Executing a SQL statement with an invalid optimizer statistics package - // or with a statistics package that allows garbage collection fails with - // an `INVALID_ARGUMENT` error. - string optimizer_statistics_package = 2; - } - - // Required. The session in which the SQL query should be performed. - string session = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "spanner.googleapis.com/Session" } - ]; - - // The transaction to use. - // - // For queries, if none is provided, the default is a temporary read-only - // transaction with strong concurrency. - // - // Standard DML statements require a read-write transaction. To protect - // against replays, single-use transactions are not supported. The caller - // must either supply an existing transaction ID or begin a new transaction. - // - // Partitioned DML requires an existing Partitioned DML transaction ID. - TransactionSelector transaction = 2; - - // Required. The SQL string. - string sql = 3 [(google.api.field_behavior) = REQUIRED]; - - // Parameter names and values that bind to placeholders in the SQL string. - // - // A parameter placeholder consists of the `@` character followed by the - // parameter name (for example, `@firstName`). Parameter names must conform - // to the naming requirements of identifiers as specified at - // https://cloud.google.com/spanner/docs/lexical#identifiers. - // - // Parameters can appear anywhere that a literal value is expected. The same - // parameter name can be used more than once, for example: - // - // `"WHERE id > @msg_id AND id < @msg_id + 100"` - // - // It's an error to execute a SQL statement with unbound parameters. - google.protobuf.Struct params = 4; - - // It isn't always possible for Cloud Spanner to infer the right SQL type - // from a JSON value. For example, values of type `BYTES` and values - // of type `STRING` both appear in - // [params][google.spanner.v1.ExecuteSqlRequest.params] as JSON strings. - // - // In these cases, you can use `param_types` to specify the exact - // SQL type for some or all of the SQL statement parameters. See the - // definition of [Type][google.spanner.v1.Type] for more information - // about SQL types. - map param_types = 5; - - // If this request is resuming a previously interrupted SQL statement - // execution, `resume_token` should be copied from the last - // [PartialResultSet][google.spanner.v1.PartialResultSet] yielded before the - // interruption. Doing this enables the new SQL statement execution to resume - // where the last one left off. The rest of the request parameters must - // exactly match the request that yielded this token. - bytes resume_token = 6; - - // Used to control the amount of debugging information returned in - // [ResultSetStats][google.spanner.v1.ResultSetStats]. If - // [partition_token][google.spanner.v1.ExecuteSqlRequest.partition_token] is - // set, [query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode] can only - // be set to - // [QueryMode.NORMAL][google.spanner.v1.ExecuteSqlRequest.QueryMode.NORMAL]. - QueryMode query_mode = 7; - - // If present, results are restricted to the specified partition - // previously created using `PartitionQuery`. There must be an exact - // match for the values of fields common to this message and the - // `PartitionQueryRequest` message used to create this `partition_token`. - bytes partition_token = 8; - - // A per-transaction sequence number used to identify this request. This field - // makes each request idempotent such that if the request is received multiple - // times, at most one succeeds. - // - // The sequence number must be monotonically increasing within the - // transaction. If a request arrives for the first time with an out-of-order - // sequence number, the transaction can be aborted. Replays of previously - // handled requests yield the same response as the first execution. - // - // Required for DML statements. Ignored for queries. - int64 seqno = 9; - - // Query optimizer configuration to use for the given query. - QueryOptions query_options = 10; - - // Common options for this request. - RequestOptions request_options = 11; - - // Directed read options for this request. - DirectedReadOptions directed_read_options = 15; - - // If this is for a partitioned query and this field is set to `true`, the - // request is executed with Spanner Data Boost independent compute resources. - // - // If the field is set to `true` but the request doesn't set - // `partition_token`, the API returns an `INVALID_ARGUMENT` error. - bool data_boost_enabled = 16; - - // Optional. If set to `true`, this statement marks the end of the - // transaction. After this statement executes, you must commit or abort the - // transaction. Attempts to execute any other requests against this - // transaction (including reads and queries) are rejected. - // - // For DML statements, setting this option might cause some error reporting to - // be deferred until commit time (for example, validation of unique - // constraints). Given this, successful execution of a DML statement shouldn't - // be assumed until a subsequent `Commit` call completes successfully. - bool last_statement = 17 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If present, it makes the Spanner requests location-aware. - // - // It gives the server hints that can be used to route the request - // to an appropriate server, potentially significantly decreasing latency and - // improving throughput. To achieve improved performance, most fields must be - // filled in with accurate values. - RoutingHint routing_hint = 18 [(google.api.field_behavior) = OPTIONAL]; -} - -// The request for [ExecuteBatchDml][google.spanner.v1.Spanner.ExecuteBatchDml]. -message ExecuteBatchDmlRequest { - // A single DML statement. - message Statement { - // Required. The DML string. - string sql = 1 [(google.api.field_behavior) = REQUIRED]; - - // Parameter names and values that bind to placeholders in the DML string. - // - // A parameter placeholder consists of the `@` character followed by the - // parameter name (for example, `@firstName`). Parameter names can contain - // letters, numbers, and underscores. - // - // Parameters can appear anywhere that a literal value is expected. The - // same parameter name can be used more than once, for example: - // - // `"WHERE id > @msg_id AND id < @msg_id + 100"` - // - // It's an error to execute a SQL statement with unbound parameters. - google.protobuf.Struct params = 2; - - // It isn't always possible for Cloud Spanner to infer the right SQL type - // from a JSON value. For example, values of type `BYTES` and values - // of type `STRING` both appear in - // [params][google.spanner.v1.ExecuteBatchDmlRequest.Statement.params] as - // JSON strings. - // - // In these cases, `param_types` can be used to specify the exact - // SQL type for some or all of the SQL statement parameters. See the - // definition of [Type][google.spanner.v1.Type] for more information - // about SQL types. - map param_types = 3; - } - - // Required. The session in which the DML statements should be performed. - string session = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "spanner.googleapis.com/Session" } - ]; - - // Required. The transaction to use. Must be a read-write transaction. - // - // To protect against replays, single-use transactions are not supported. The - // caller must either supply an existing transaction ID or begin a new - // transaction. - TransactionSelector transaction = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The list of statements to execute in this batch. Statements are - // executed serially, such that the effects of statement `i` are visible to - // statement `i+1`. Each statement must be a DML statement. Execution stops at - // the first failed statement; the remaining statements are not executed. - // - // Callers must provide at least one statement. - repeated Statement statements = 3 [(google.api.field_behavior) = REQUIRED]; - - // Required. A per-transaction sequence number used to identify this request. - // This field makes each request idempotent such that if the request is - // received multiple times, at most one succeeds. - // - // The sequence number must be monotonically increasing within the - // transaction. If a request arrives for the first time with an out-of-order - // sequence number, the transaction might be aborted. Replays of previously - // handled requests yield the same response as the first execution. - int64 seqno = 4 [(google.api.field_behavior) = REQUIRED]; - - // Common options for this request. - RequestOptions request_options = 5; - - // Optional. If set to `true`, this request marks the end of the transaction. - // After these statements execute, you must commit or abort the transaction. - // Attempts to execute any other requests against this transaction - // (including reads and queries) are rejected. - // - // Setting this option might cause some error reporting to be deferred until - // commit time (for example, validation of unique constraints). Given this, - // successful execution of statements shouldn't be assumed until a subsequent - // `Commit` call completes successfully. - bool last_statements = 6 [(google.api.field_behavior) = OPTIONAL]; -} - -// The response for -// [ExecuteBatchDml][google.spanner.v1.Spanner.ExecuteBatchDml]. Contains a list -// of [ResultSet][google.spanner.v1.ResultSet] messages, one for each DML -// statement that has successfully executed, in the same order as the statements -// in the request. If a statement fails, the status in the response body -// identifies the cause of the failure. -// -// To check for DML statements that failed, use the following approach: -// -// 1. Check the status in the response message. The -// [google.rpc.Code][google.rpc.Code] enum -// value `OK` indicates that all statements were executed successfully. -// 2. If the status was not `OK`, check the number of result sets in the -// response. If the response contains `N` -// [ResultSet][google.spanner.v1.ResultSet] messages, then statement `N+1` in -// the request failed. -// -// Example 1: -// -// * Request: 5 DML statements, all executed successfully. -// * Response: 5 [ResultSet][google.spanner.v1.ResultSet] messages, with the -// status `OK`. -// -// Example 2: -// -// * Request: 5 DML statements. The third statement has a syntax error. -// * Response: 2 [ResultSet][google.spanner.v1.ResultSet] messages, and a syntax -// error (`INVALID_ARGUMENT`) -// status. The number of [ResultSet][google.spanner.v1.ResultSet] messages -// indicates that the third statement failed, and the fourth and fifth -// statements were not executed. -message ExecuteBatchDmlResponse { - // One [ResultSet][google.spanner.v1.ResultSet] for each statement in the - // request that ran successfully, in the same order as the statements in the - // request. Each [ResultSet][google.spanner.v1.ResultSet] does not contain any - // rows. The [ResultSetStats][google.spanner.v1.ResultSetStats] in each - // [ResultSet][google.spanner.v1.ResultSet] contain the number of rows - // modified by the statement. - // - // Only the first [ResultSet][google.spanner.v1.ResultSet] in the response - // contains valid [ResultSetMetadata][google.spanner.v1.ResultSetMetadata]. - repeated ResultSet result_sets = 1; - - // If all DML statements are executed successfully, the status is `OK`. - // Otherwise, the error status of the first failed statement. - google.rpc.Status status = 2; - - // Optional. A precommit token is included if the read-write transaction - // is on a multiplexed session. Pass the precommit token with the highest - // sequence number from this transaction attempt should be passed to the - // [Commit][google.spanner.v1.Spanner.Commit] request for this transaction. - MultiplexedSessionPrecommitToken precommit_token = 3 - [(google.api.field_behavior) = OPTIONAL]; -} - -// Options for a `PartitionQueryRequest` and `PartitionReadRequest`. -message PartitionOptions { - // **Note:** This hint is currently ignored by `PartitionQuery` and - // `PartitionRead` requests. - // - // The desired data size for each partition generated. The default for this - // option is currently 1 GiB. This is only a hint. The actual size of each - // partition can be smaller or larger than this size request. - int64 partition_size_bytes = 1; - - // **Note:** This hint is currently ignored by `PartitionQuery` and - // `PartitionRead` requests. - // - // The desired maximum number of partitions to return. For example, this - // might be set to the number of workers available. The default for this - // option is currently 10,000. The maximum value is currently 200,000. This - // is only a hint. The actual number of partitions returned can be smaller or - // larger than this maximum count request. - int64 max_partitions = 2; -} - -// The request for [PartitionQuery][google.spanner.v1.Spanner.PartitionQuery] -message PartitionQueryRequest { - // Required. The session used to create the partitions. - string session = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "spanner.googleapis.com/Session" } - ]; - - // Read-only snapshot transactions are supported, read and write and - // single-use transactions are not. - TransactionSelector transaction = 2; - - // Required. The query request to generate partitions for. The request fails - // if the query isn't root partitionable. For a query to be root - // partitionable, it needs to satisfy a few conditions. For example, if the - // query execution plan contains a distributed union operator, then it must be - // the first operator in the plan. For more information about other - // conditions, see [Read data in - // parallel](https://cloud.google.com/spanner/docs/reads#read_data_in_parallel). - // - // The query request must not contain DML commands, such as `INSERT`, - // `UPDATE`, or `DELETE`. Use - // [`ExecuteStreamingSql`][google.spanner.v1.Spanner.ExecuteStreamingSql] with - // a `PartitionedDml` transaction for large, partition-friendly DML - // operations. - string sql = 3 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Parameter names and values that bind to placeholders in the SQL - // string. - // - // A parameter placeholder consists of the `@` character followed by the - // parameter name (for example, `@firstName`). Parameter names can contain - // letters, numbers, and underscores. - // - // Parameters can appear anywhere that a literal value is expected. The same - // parameter name can be used more than once, for example: - // - // `"WHERE id > @msg_id AND id < @msg_id + 100"` - // - // It's an error to execute a SQL statement with unbound parameters. - google.protobuf.Struct params = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. It isn't always possible for Cloud Spanner to infer the right SQL - // type from a JSON value. For example, values of type `BYTES` and values of - // type `STRING` both appear in - // [params][google.spanner.v1.PartitionQueryRequest.params] as JSON strings. - // - // In these cases, `param_types` can be used to specify the exact - // SQL type for some or all of the SQL query parameters. See the - // definition of [Type][google.spanner.v1.Type] for more information - // about SQL types. - map param_types = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Additional options that affect how many partitions are created. - PartitionOptions partition_options = 6; -} - -// The request for [PartitionRead][google.spanner.v1.Spanner.PartitionRead] -message PartitionReadRequest { - // Required. The session used to create the partitions. - string session = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "spanner.googleapis.com/Session" } - ]; - - // Read only snapshot transactions are supported, read/write and single use - // transactions are not. - TransactionSelector transaction = 2; - - // Required. The name of the table in the database to be read. - string table = 3 [(google.api.field_behavior) = REQUIRED]; - - // If non-empty, the name of an index on - // [table][google.spanner.v1.PartitionReadRequest.table]. This index is used - // instead of the table primary key when interpreting - // [key_set][google.spanner.v1.PartitionReadRequest.key_set] and sorting - // result rows. See [key_set][google.spanner.v1.PartitionReadRequest.key_set] - // for further information. - string index = 4; - - // The columns of [table][google.spanner.v1.PartitionReadRequest.table] to be - // returned for each row matching this request. - repeated string columns = 5; - - // Required. `key_set` identifies the rows to be yielded. `key_set` names the - // primary keys of the rows in - // [table][google.spanner.v1.PartitionReadRequest.table] to be yielded, unless - // [index][google.spanner.v1.PartitionReadRequest.index] is present. If - // [index][google.spanner.v1.PartitionReadRequest.index] is present, then - // [key_set][google.spanner.v1.PartitionReadRequest.key_set] instead names - // index keys in [index][google.spanner.v1.PartitionReadRequest.index]. - // - // It isn't an error for the `key_set` to name rows that don't - // exist in the database. Read yields nothing for nonexistent rows. - KeySet key_set = 6 [(google.api.field_behavior) = REQUIRED]; - - // Additional options that affect how many partitions are created. - PartitionOptions partition_options = 9; -} - -// Information returned for each partition returned in a -// PartitionResponse. -message Partition { - // This token can be passed to `Read`, `StreamingRead`, `ExecuteSql`, or - // `ExecuteStreamingSql` requests to restrict the results to those identified - // by this partition token. - bytes partition_token = 1; -} - -// The response for [PartitionQuery][google.spanner.v1.Spanner.PartitionQuery] -// or [PartitionRead][google.spanner.v1.Spanner.PartitionRead] -message PartitionResponse { - // Partitions created by this request. - repeated Partition partitions = 1; - - // Transaction created by this request. - Transaction transaction = 2; -} - -// The request for [Read][google.spanner.v1.Spanner.Read] and -// [StreamingRead][google.spanner.v1.Spanner.StreamingRead]. -message ReadRequest { - // An option to control the order in which rows are returned from a read. - enum OrderBy { - // Default value. - // - // `ORDER_BY_UNSPECIFIED` is equivalent to `ORDER_BY_PRIMARY_KEY`. - ORDER_BY_UNSPECIFIED = 0; - - // Read rows are returned in primary key order. - // - // In the event that this option is used in conjunction with the - // `partition_token` field, the API returns an `INVALID_ARGUMENT` error. - ORDER_BY_PRIMARY_KEY = 1; - - // Read rows are returned in any order. - ORDER_BY_NO_ORDER = 2; - } - - // A lock hint mechanism for reads done within a transaction. - enum LockHint { - // Default value. - // - // `LOCK_HINT_UNSPECIFIED` is equivalent to `LOCK_HINT_SHARED`. - LOCK_HINT_UNSPECIFIED = 0; - - // Acquire shared locks. - // - // By default when you perform a read as part of a read-write transaction, - // Spanner acquires shared read locks, which allows other reads to still - // access the data until your transaction is ready to commit. When your - // transaction is committing and writes are being applied, the transaction - // attempts to upgrade to an exclusive lock for any data you are writing. - // For more information about locks, see [Lock - // modes](https://cloud.google.com/spanner/docs/introspection/lock-statistics#explain-lock-modes). - LOCK_HINT_SHARED = 1; - - // Acquire exclusive locks. - // - // Requesting exclusive locks is beneficial if you observe high write - // contention, which means you notice that multiple transactions are - // concurrently trying to read and write to the same data, resulting in a - // large number of aborts. This problem occurs when two transactions - // initially acquire shared locks and then both try to upgrade to exclusive - // locks at the same time. In this situation both transactions are waiting - // for the other to give up their lock, resulting in a deadlocked situation. - // Spanner is able to detect this occurring and force one of the - // transactions to abort. However, this is a slow and expensive operation - // and results in lower performance. In this case it makes sense to acquire - // exclusive locks at the start of the transaction because then when - // multiple transactions try to act on the same data, they automatically get - // serialized. Each transaction waits its turn to acquire the lock and - // avoids getting into deadlock situations. - // - // Because the exclusive lock hint is just a hint, it shouldn't be - // considered equivalent to a mutex. In other words, you shouldn't use - // Spanner exclusive locks as a mutual exclusion mechanism for the execution - // of code outside of Spanner. - // - // **Note:** Request exclusive locks judiciously because they block others - // from reading that data for the entire transaction, rather than just when - // the writes are being performed. Unless you observe high write contention, - // you should use the default of shared read locks so you don't prematurely - // block other clients from reading the data that you're writing to. - LOCK_HINT_EXCLUSIVE = 2; - } - - // Required. The session in which the read should be performed. - string session = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "spanner.googleapis.com/Session" } - ]; - - // The transaction to use. If none is provided, the default is a - // temporary read-only transaction with strong concurrency. - TransactionSelector transaction = 2; - - // Required. The name of the table in the database to be read. - string table = 3 [(google.api.field_behavior) = REQUIRED]; - - // If non-empty, the name of an index on - // [table][google.spanner.v1.ReadRequest.table]. This index is used instead of - // the table primary key when interpreting - // [key_set][google.spanner.v1.ReadRequest.key_set] and sorting result rows. - // See [key_set][google.spanner.v1.ReadRequest.key_set] for further - // information. - string index = 4; - - // Required. The columns of [table][google.spanner.v1.ReadRequest.table] to be - // returned for each row matching this request. - repeated string columns = 5 [(google.api.field_behavior) = REQUIRED]; - - // Required. `key_set` identifies the rows to be yielded. `key_set` names the - // primary keys of the rows in [table][google.spanner.v1.ReadRequest.table] to - // be yielded, unless [index][google.spanner.v1.ReadRequest.index] is present. - // If [index][google.spanner.v1.ReadRequest.index] is present, then - // [key_set][google.spanner.v1.ReadRequest.key_set] instead names index keys - // in [index][google.spanner.v1.ReadRequest.index]. - // - // If the [partition_token][google.spanner.v1.ReadRequest.partition_token] - // field is empty, rows are yielded in table primary key order (if - // [index][google.spanner.v1.ReadRequest.index] is empty) or index key order - // (if [index][google.spanner.v1.ReadRequest.index] is non-empty). If the - // [partition_token][google.spanner.v1.ReadRequest.partition_token] field - // isn't empty, rows are yielded in an unspecified order. - // - // It isn't an error for the `key_set` to name rows that don't - // exist in the database. Read yields nothing for nonexistent rows. - KeySet key_set = 6 [(google.api.field_behavior) = REQUIRED]; - - // If greater than zero, only the first `limit` rows are yielded. If `limit` - // is zero, the default is no limit. A limit can't be specified if - // `partition_token` is set. - int64 limit = 8; - - // If this request is resuming a previously interrupted read, - // `resume_token` should be copied from the last - // [PartialResultSet][google.spanner.v1.PartialResultSet] yielded before the - // interruption. Doing this enables the new read to resume where the last read - // left off. The rest of the request parameters must exactly match the request - // that yielded this token. - bytes resume_token = 9; - - // If present, results are restricted to the specified partition - // previously created using `PartitionRead`. There must be an exact - // match for the values of fields common to this message and the - // PartitionReadRequest message used to create this partition_token. - bytes partition_token = 10; - - // Common options for this request. - RequestOptions request_options = 11; - - // Directed read options for this request. - DirectedReadOptions directed_read_options = 14; - - // If this is for a partitioned read and this field is set to `true`, the - // request is executed with Spanner Data Boost independent compute resources. - // - // If the field is set to `true` but the request doesn't set - // `partition_token`, the API returns an `INVALID_ARGUMENT` error. - bool data_boost_enabled = 15; - - // Optional. Order for the returned rows. - // - // By default, Spanner returns result rows in primary key order except for - // PartitionRead requests. For applications that don't require rows to be - // returned in primary key (`ORDER_BY_PRIMARY_KEY`) order, setting - // `ORDER_BY_NO_ORDER` option allows Spanner to optimize row retrieval, - // resulting in lower latencies in certain cases (for example, bulk point - // lookups). - OrderBy order_by = 16 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Lock Hint for the request, it can only be used with read-write - // transactions. - LockHint lock_hint = 17 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If present, it makes the Spanner requests location-aware. - // - // It gives the server hints that can be used to route the request - // to an appropriate server, potentially significantly decreasing latency and - // improving throughput. To achieve improved performance, most fields must be - // filled in with accurate values. - RoutingHint routing_hint = 18 [(google.api.field_behavior) = OPTIONAL]; -} - -// The request for -// [BeginTransaction][google.spanner.v1.Spanner.BeginTransaction]. -message BeginTransactionRequest { - // Required. The session in which the transaction runs. - string session = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "spanner.googleapis.com/Session" } - ]; - - // Required. Options for the new transaction. - TransactionOptions options = 2 [(google.api.field_behavior) = REQUIRED]; - - // Common options for this request. - // Priority is ignored for this request. Setting the priority in this - // `request_options` struct doesn't do anything. To set the priority for a - // transaction, set it on the reads and writes that are part of this - // transaction instead. - RequestOptions request_options = 3; - - // Optional. Required for read-write transactions on a multiplexed session - // that commit mutations but don't perform any reads or queries. You must - // randomly select one of the mutations from the mutation set and send it as a - // part of this request. - Mutation mutation_key = 4 [(google.api.field_behavior) = OPTIONAL]; -} - -// The request for [Commit][google.spanner.v1.Spanner.Commit]. -message CommitRequest { - // Required. The session in which the transaction to be committed is running. - string session = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "spanner.googleapis.com/Session" } - ]; - - // Required. The transaction in which to commit. - oneof transaction { - // Commit a previously-started transaction. - bytes transaction_id = 2; - - // Execute mutations in a temporary transaction. Note that unlike - // commit of a previously-started transaction, commit with a - // temporary transaction is non-idempotent. That is, if the - // `CommitRequest` is sent to Cloud Spanner more than once (for - // instance, due to retries in the application, or in the - // transport library), it's possible that the mutations are - // executed more than once. If this is undesirable, use - // [BeginTransaction][google.spanner.v1.Spanner.BeginTransaction] and - // [Commit][google.spanner.v1.Spanner.Commit] instead. - TransactionOptions single_use_transaction = 3; - } - - // The mutations to be executed when this transaction commits. All - // mutations are applied atomically, in the order they appear in - // this list. - repeated Mutation mutations = 4; - - // If `true`, then statistics related to the transaction is included in - // the [CommitResponse][google.spanner.v1.CommitResponse.commit_stats]. - // Default value is `false`. - bool return_commit_stats = 5; - - // Optional. The amount of latency this request is configured to incur in - // order to improve throughput. If this field isn't set, Spanner assumes - // requests are relatively latency sensitive and automatically determines an - // appropriate delay time. You can specify a commit delay value between 0 and - // 500 ms. - google.protobuf.Duration max_commit_delay = 8 - [(google.api.field_behavior) = OPTIONAL]; - - // Common options for this request. - RequestOptions request_options = 6; - - // Optional. If the read-write transaction was executed on a multiplexed - // session, then you must include the precommit token with the highest - // sequence number received in this transaction attempt. Failing to do so - // results in a `FailedPrecondition` error. - MultiplexedSessionPrecommitToken precommit_token = 9 - [(google.api.field_behavior) = OPTIONAL]; -} - -// The request for [Rollback][google.spanner.v1.Spanner.Rollback]. -message RollbackRequest { - // Required. The session in which the transaction to roll back is running. - string session = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "spanner.googleapis.com/Session" } - ]; - - // Required. The transaction to roll back. - bytes transaction_id = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// The request for [BatchWrite][google.spanner.v1.Spanner.BatchWrite]. -message BatchWriteRequest { - // A group of mutations to be committed together. Related mutations should be - // placed in a group. For example, two mutations inserting rows with the same - // primary key prefix in both parent and child tables are related. - message MutationGroup { - // Required. The mutations in this group. - repeated Mutation mutations = 1 [(google.api.field_behavior) = REQUIRED]; - } - - // Required. The session in which the batch request is to be run. - string session = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "spanner.googleapis.com/Session" } - ]; - - // Common options for this request. - RequestOptions request_options = 3; - - // Required. The groups of mutations to be applied. - repeated MutationGroup mutation_groups = 4 - [(google.api.field_behavior) = REQUIRED]; - - // Optional. If you don't set the `exclude_txn_from_change_streams` option or - // if it's set to `false`, then any change streams monitoring columns modified - // by transactions will capture the updates made within that transaction. - bool exclude_txn_from_change_streams = 5 - [(google.api.field_behavior) = OPTIONAL]; -} - -// The result of applying a batch of mutations. -message BatchWriteResponse { - // The mutation groups applied in this batch. The values index into the - // `mutation_groups` field in the corresponding `BatchWriteRequest`. - repeated int32 indexes = 1; - - // An `OK` status indicates success. Any other status indicates a failure. - google.rpc.Status status = 2; - - // The commit timestamp of the transaction that applied this batch. - // Present if status is OK and the mutation groups were applied, absent - // otherwise. - // - // For mutation groups with conditions, a status=OK and missing - // commit_timestamp means that the mutation groups were not applied due to the - // condition not being satisfied after evaluation. - google.protobuf.Timestamp commit_timestamp = 3; -} diff --git a/owl-bot-staging/v1/protos/google/spanner/v1/transaction.proto b/owl-bot-staging/v1/protos/google/spanner/v1/transaction.proto deleted file mode 100644 index dfdf3b11a..000000000 --- a/owl-bot-staging/v1/protos/google/spanner/v1/transaction.proto +++ /dev/null @@ -1,309 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.spanner.v1; - -import "google/api/field_behavior.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.Spanner.V1"; -option go_package = "cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb"; -option java_multiple_files = true; -option java_outer_classname = "TransactionProto"; -option java_package = "com.google.spanner.v1"; -option php_namespace = "Google\\Cloud\\Spanner\\V1"; -option ruby_package = "Google::Cloud::Spanner::V1"; - -// Options to use for transactions. -message TransactionOptions { - // Message type to initiate a read-write transaction. Currently this - // transaction type has no options. - message ReadWrite { - // `ReadLockMode` is used to set the read lock mode for read-write - // transactions. - enum ReadLockMode { - // Default value. - // - // * If isolation level is - // [REPEATABLE_READ][google.spanner.v1.TransactionOptions.IsolationLevel.REPEATABLE_READ], - // then it is an error to specify `read_lock_mode`. Locking semantics - // default to `OPTIMISTIC`. No validation checks are done for reads, - // except to validate that the data that was served at the snapshot time - // is unchanged at commit time in the following cases: - // 1. reads done as part of queries that use `SELECT FOR UPDATE` - // 2. reads done as part of statements with a `LOCK_SCANNED_RANGES` - // hint - // 3. reads done as part of DML statements - // * At all other isolation levels, if `read_lock_mode` is the default - // value, then pessimistic read locks are used. - READ_LOCK_MODE_UNSPECIFIED = 0; - - // Pessimistic lock mode. - // - // Read locks are acquired immediately on read. - // Semantics described only applies to - // [SERIALIZABLE][google.spanner.v1.TransactionOptions.IsolationLevel.SERIALIZABLE] - // isolation. - PESSIMISTIC = 1; - - // Optimistic lock mode. - // - // Locks for reads within the transaction are not acquired on read. - // Instead the locks are acquired on a commit to validate that - // read/queried data has not changed since the transaction started. - // Semantics described only applies to - // [SERIALIZABLE][google.spanner.v1.TransactionOptions.IsolationLevel.SERIALIZABLE] - // isolation. - OPTIMISTIC = 2; - } - - // Read lock mode for the transaction. - ReadLockMode read_lock_mode = 1; - - // Optional. Clients should pass the transaction ID of the previous - // transaction attempt that was aborted if this transaction is being - // executed on a multiplexed session. - bytes multiplexed_session_previous_transaction_id = 2 - [(google.api.field_behavior) = OPTIONAL]; - } - - // Message type to initiate a Partitioned DML transaction. - message PartitionedDml {} - - // Message type to initiate a read-only transaction. - message ReadOnly { - // How to choose the timestamp for the read-only transaction. - oneof timestamp_bound { - // Read at a timestamp where all previously committed transactions - // are visible. - bool strong = 1; - - // Executes all reads at a timestamp >= `min_read_timestamp`. - // - // This is useful for requesting fresher data than some previous - // read, or data that is fresh enough to observe the effects of some - // previously committed transaction whose timestamp is known. - // - // Note that this option can only be used in single-use transactions. - // - // A timestamp in RFC3339 UTC \"Zulu\" format, accurate to nanoseconds. - // Example: `"2014-10-02T15:01:23.045123456Z"`. - google.protobuf.Timestamp min_read_timestamp = 2; - - // Read data at a timestamp >= `NOW - max_staleness` - // seconds. Guarantees that all writes that have committed more - // than the specified number of seconds ago are visible. Because - // Cloud Spanner chooses the exact timestamp, this mode works even if - // the client's local clock is substantially skewed from Cloud Spanner - // commit timestamps. - // - // Useful for reading the freshest data available at a nearby - // replica, while bounding the possible staleness if the local - // replica has fallen behind. - // - // Note that this option can only be used in single-use - // transactions. - google.protobuf.Duration max_staleness = 3; - - // Executes all reads at the given timestamp. Unlike other modes, - // reads at a specific timestamp are repeatable; the same read at - // the same timestamp always returns the same data. If the - // timestamp is in the future, the read is blocked until the - // specified timestamp, modulo the read's deadline. - // - // Useful for large scale consistent reads such as mapreduces, or - // for coordinating many reads against a consistent snapshot of the - // data. - // - // A timestamp in RFC3339 UTC \"Zulu\" format, accurate to nanoseconds. - // Example: `"2014-10-02T15:01:23.045123456Z"`. - google.protobuf.Timestamp read_timestamp = 4; - - // Executes all reads at a timestamp that is `exact_staleness` - // old. The timestamp is chosen soon after the read is started. - // - // Guarantees that all writes that have committed more than the - // specified number of seconds ago are visible. Because Cloud Spanner - // chooses the exact timestamp, this mode works even if the client's - // local clock is substantially skewed from Cloud Spanner commit - // timestamps. - // - // Useful for reading at nearby replicas without the distributed - // timestamp negotiation overhead of `max_staleness`. - google.protobuf.Duration exact_staleness = 5; - } - - // If true, the Cloud Spanner-selected read timestamp is included in - // the [Transaction][google.spanner.v1.Transaction] message that describes - // the transaction. - bool return_read_timestamp = 6; - } - - // `IsolationLevel` is used when setting the [isolation - // level](https://cloud.google.com/spanner/docs/isolation-levels) for a - // transaction. - enum IsolationLevel { - // Default value. - // - // If the value is not specified, the `SERIALIZABLE` isolation level is - // used. - ISOLATION_LEVEL_UNSPECIFIED = 0; - - // All transactions appear as if they executed in a serial order, even if - // some of the reads, writes, and other operations of distinct transactions - // actually occurred in parallel. Spanner assigns commit timestamps that - // reflect the order of committed transactions to implement this property. - // Spanner offers a stronger guarantee than serializability called external - // consistency. For more information, see - // [TrueTime and external - // consistency](https://cloud.google.com/spanner/docs/true-time-external-consistency#serializability). - SERIALIZABLE = 1; - - // All reads performed during the transaction observe a consistent snapshot - // of the database, and the transaction is only successfully committed in - // the absence of conflicts between its updates and any concurrent updates - // that have occurred since that snapshot. Consequently, in contrast to - // `SERIALIZABLE` transactions, only write-write conflicts are detected in - // snapshot transactions. - // - // This isolation level does not support read-only and partitioned DML - // transactions. - // - // When `REPEATABLE_READ` is specified on a read-write transaction, the - // locking semantics default to `OPTIMISTIC`. - REPEATABLE_READ = 2; - } - - // Required. The type of transaction. - oneof mode { - // Transaction may write. - // - // Authorization to begin a read-write transaction requires - // `spanner.databases.beginOrRollbackReadWriteTransaction` permission - // on the `session` resource. - ReadWrite read_write = 1; - - // Partitioned DML transaction. - // - // Authorization to begin a Partitioned DML transaction requires - // `spanner.databases.beginPartitionedDmlTransaction` permission - // on the `session` resource. - PartitionedDml partitioned_dml = 3; - - // Transaction does not write. - // - // Authorization to begin a read-only transaction requires - // `spanner.databases.beginReadOnlyTransaction` permission - // on the `session` resource. - ReadOnly read_only = 2; - } - - // When `exclude_txn_from_change_streams` is set to `true`, it prevents read - // or write transactions from being tracked in change streams. - // - // * If the DDL option `allow_txn_exclusion` is set to `true`, then the - // updates - // made within this transaction aren't recorded in the change stream. - // - // * If you don't set the DDL option `allow_txn_exclusion` or if it's - // set to `false`, then the updates made within this transaction are - // recorded in the change stream. - // - // When `exclude_txn_from_change_streams` is set to `false` or not set, - // modifications from this transaction are recorded in all change streams - // that are tracking columns modified by these transactions. - // - // The `exclude_txn_from_change_streams` option can only be specified - // for read-write or partitioned DML transactions, otherwise the API returns - // an `INVALID_ARGUMENT` error. - bool exclude_txn_from_change_streams = 5; - - // Isolation level for the transaction. - IsolationLevel isolation_level = 6; -} - -// A transaction. -message Transaction { - // `id` may be used to identify the transaction in subsequent - // [Read][google.spanner.v1.Spanner.Read], - // [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql], - // [Commit][google.spanner.v1.Spanner.Commit], or - // [Rollback][google.spanner.v1.Spanner.Rollback] calls. - // - // Single-use read-only transactions do not have IDs, because - // single-use transactions do not support multiple requests. - bytes id = 1; - - // For snapshot read-only transactions, the read timestamp chosen - // for the transaction. Not returned by default: see - // [TransactionOptions.ReadOnly.return_read_timestamp][google.spanner.v1.TransactionOptions.ReadOnly.return_read_timestamp]. - // - // A timestamp in RFC3339 UTC \"Zulu\" format, accurate to nanoseconds. - // Example: `"2014-10-02T15:01:23.045123456Z"`. - google.protobuf.Timestamp read_timestamp = 2; - - // A precommit token is included in the response of a BeginTransaction - // request if the read-write transaction is on a multiplexed session and - // a mutation_key was specified in the - // [BeginTransaction][google.spanner.v1.BeginTransactionRequest]. - // The precommit token with the highest sequence number from this transaction - // attempt should be passed to the [Commit][google.spanner.v1.Spanner.Commit] - // request for this transaction. - MultiplexedSessionPrecommitToken precommit_token = 3; -} - -// This message is used to select the transaction in which a -// [Read][google.spanner.v1.Spanner.Read] or -// [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql] call runs. -// -// See [TransactionOptions][google.spanner.v1.TransactionOptions] for more -// information about transactions. -message TransactionSelector { - // If no fields are set, the default is a single use transaction - // with strong concurrency. - oneof selector { - // Execute the read or SQL query in a temporary transaction. - // This is the most efficient way to execute a transaction that - // consists of a single SQL query. - TransactionOptions single_use = 1; - - // Execute the read or SQL query in a previously-started transaction. - bytes id = 2; - - // Begin a new transaction and execute this read or SQL query in - // it. The transaction ID of the new transaction is returned in - // [ResultSetMetadata.transaction][google.spanner.v1.ResultSetMetadata.transaction], - // which is a [Transaction][google.spanner.v1.Transaction]. - TransactionOptions begin = 3; - } -} - -// When a read-write transaction is executed on a multiplexed session, -// this precommit token is sent back to the client -// as a part of the [Transaction][google.spanner.v1.Transaction] message in the -// [BeginTransaction][google.spanner.v1.BeginTransactionRequest] response and -// also as a part of the [ResultSet][google.spanner.v1.ResultSet] and -// [PartialResultSet][google.spanner.v1.PartialResultSet] responses. -message MultiplexedSessionPrecommitToken { - // Opaque precommit token. - bytes precommit_token = 1; - - // An incrementing seq number is generated on every precommit token - // that is returned. Clients should remember the precommit token with the - // highest sequence number from the current transaction attempt. - int32 seq_num = 2; -} diff --git a/owl-bot-staging/v1/protos/google/spanner/v1/type.proto b/owl-bot-staging/v1/protos/google/spanner/v1/type.proto deleted file mode 100644 index e3e85a770..000000000 --- a/owl-bot-staging/v1/protos/google/spanner/v1/type.proto +++ /dev/null @@ -1,214 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.spanner.v1; - -import "google/api/field_behavior.proto"; - -option csharp_namespace = "Google.Cloud.Spanner.V1"; -option go_package = "cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb"; -option java_multiple_files = true; -option java_outer_classname = "TypeProto"; -option java_package = "com.google.spanner.v1"; -option php_namespace = "Google\\Cloud\\Spanner\\V1"; -option ruby_package = "Google::Cloud::Spanner::V1"; - -// `Type` indicates the type of a Cloud Spanner value, as might be stored in a -// table cell or returned from an SQL query. -message Type { - // Required. The [TypeCode][google.spanner.v1.TypeCode] for this type. - TypeCode code = 1 [(google.api.field_behavior) = REQUIRED]; - - // If [code][google.spanner.v1.Type.code] == - // [ARRAY][google.spanner.v1.TypeCode.ARRAY], then `array_element_type` is the - // type of the array elements. - Type array_element_type = 2; - - // If [code][google.spanner.v1.Type.code] == - // [STRUCT][google.spanner.v1.TypeCode.STRUCT], then `struct_type` provides - // type information for the struct's fields. - StructType struct_type = 3; - - // The [TypeAnnotationCode][google.spanner.v1.TypeAnnotationCode] that - // disambiguates SQL type that Spanner will use to represent values of this - // type during query processing. This is necessary for some type codes because - // a single [TypeCode][google.spanner.v1.TypeCode] can be mapped to different - // SQL types depending on the SQL dialect. - // [type_annotation][google.spanner.v1.Type.type_annotation] typically is not - // needed to process the content of a value (it doesn't affect serialization) - // and clients can ignore it on the read path. - TypeAnnotationCode type_annotation = 4; - - // If [code][google.spanner.v1.Type.code] == - // [PROTO][google.spanner.v1.TypeCode.PROTO] or - // [code][google.spanner.v1.Type.code] == - // [ENUM][google.spanner.v1.TypeCode.ENUM], then `proto_type_fqn` is the fully - // qualified name of the proto type representing the proto/enum definition. - string proto_type_fqn = 5; -} - -// `StructType` defines the fields of a -// [STRUCT][google.spanner.v1.TypeCode.STRUCT] type. -message StructType { - // Message representing a single field of a struct. - message Field { - // The name of the field. For reads, this is the column name. For - // SQL queries, it is the column alias (e.g., `"Word"` in the - // query `"SELECT 'hello' AS Word"`), or the column name (e.g., - // `"ColName"` in the query `"SELECT ColName FROM Table"`). Some - // columns might have an empty name (e.g., `"SELECT - // UPPER(ColName)"`). Note that a query result can contain - // multiple fields with the same name. - string name = 1; - - // The type of the field. - Type type = 2; - } - - // The list of fields that make up this struct. Order is - // significant, because values of this struct type are represented as - // lists, where the order of field values matches the order of - // fields in the [StructType][google.spanner.v1.StructType]. In turn, the - // order of fields matches the order of columns in a read request, or the - // order of fields in the `SELECT` clause of a query. - repeated Field fields = 1; -} - -// `TypeCode` is used as part of [Type][google.spanner.v1.Type] to -// indicate the type of a Cloud Spanner value. -// -// Each legal value of a type can be encoded to or decoded from a JSON -// value, using the encodings described below. All Cloud Spanner values can -// be `null`, regardless of type; `null`s are always encoded as a JSON -// `null`. -enum TypeCode { - // Not specified. - TYPE_CODE_UNSPECIFIED = 0; - - // Encoded as JSON `true` or `false`. - BOOL = 1; - - // Encoded as `string`, in decimal format. - INT64 = 2; - - // Encoded as `number`, or the strings `"NaN"`, `"Infinity"`, or - // `"-Infinity"`. - FLOAT64 = 3; - - // Encoded as `number`, or the strings `"NaN"`, `"Infinity"`, or - // `"-Infinity"`. - FLOAT32 = 15; - - // Encoded as `string` in RFC 3339 timestamp format. The time zone - // must be present, and must be `"Z"`. - // - // If the schema has the column option - // `allow_commit_timestamp=true`, the placeholder string - // `"spanner.commit_timestamp()"` can be used to instruct the system - // to insert the commit timestamp associated with the transaction - // commit. - TIMESTAMP = 4; - - // Encoded as `string` in RFC 3339 date format. - DATE = 5; - - // Encoded as `string`. - STRING = 6; - - // Encoded as a base64-encoded `string`, as described in RFC 4648, - // section 4. - BYTES = 7; - - // Encoded as `list`, where the list elements are represented - // according to - // [array_element_type][google.spanner.v1.Type.array_element_type]. - ARRAY = 8; - - // Encoded as `list`, where list element `i` is represented according - // to [struct_type.fields[i]][google.spanner.v1.StructType.fields]. - STRUCT = 9; - - // Encoded as `string`, in decimal format or scientific notation format. - // Decimal format: - // `[+-]Digits[.[Digits]]` or - // `[+-][Digits].Digits` - // - // Scientific notation: - // `[+-]Digits[.[Digits]][ExponentIndicator[+-]Digits]` or - // `[+-][Digits].Digits[ExponentIndicator[+-]Digits]` - // (ExponentIndicator is `"e"` or `"E"`) - NUMERIC = 10; - - // Encoded as a JSON-formatted `string` as described in RFC 7159. The - // following rules are applied when parsing JSON input: - // - // - Whitespace characters are not preserved. - // - If a JSON object has duplicate keys, only the first key is preserved. - // - Members of a JSON object are not guaranteed to have their order - // preserved. - // - JSON array elements will have their order preserved. - JSON = 11; - - // Encoded as a base64-encoded `string`, as described in RFC 4648, - // section 4. - PROTO = 13; - - // Encoded as `string`, in decimal format. - ENUM = 14; - - // Encoded as `string`, in `ISO8601` duration format - - // `P[n]Y[n]M[n]DT[n]H[n]M[n[.fraction]]S` - // where `n` is an integer. - // For example, `P1Y2M3DT4H5M6.5S` represents time duration of 1 year, 2 - // months, 3 days, 4 hours, 5 minutes, and 6.5 seconds. - INTERVAL = 16; - - // Encoded as `string`, in lower-case hexa-decimal format, as described - // in RFC 9562, section 4. - UUID = 17; -} - -// `TypeAnnotationCode` is used as a part of [Type][google.spanner.v1.Type] to -// disambiguate SQL types that should be used for a given Cloud Spanner value. -// Disambiguation is needed because the same Cloud Spanner type can be mapped to -// different SQL types depending on SQL dialect. TypeAnnotationCode doesn't -// affect the way value is serialized. -enum TypeAnnotationCode { - // Not specified. - TYPE_ANNOTATION_CODE_UNSPECIFIED = 0; - - // PostgreSQL compatible NUMERIC type. This annotation needs to be applied to - // [Type][google.spanner.v1.Type] instances having - // [NUMERIC][google.spanner.v1.TypeCode.NUMERIC] type code to specify that - // values of this type should be treated as PostgreSQL NUMERIC values. - // Currently this annotation is always needed for - // [NUMERIC][google.spanner.v1.TypeCode.NUMERIC] when a client interacts with - // PostgreSQL-enabled Spanner databases. - PG_NUMERIC = 2; - - // PostgreSQL compatible JSONB type. This annotation needs to be applied to - // [Type][google.spanner.v1.Type] instances having - // [JSON][google.spanner.v1.TypeCode.JSON] type code to specify that values of - // this type should be treated as PostgreSQL JSONB values. Currently this - // annotation is always needed for [JSON][google.spanner.v1.TypeCode.JSON] - // when a client interacts with PostgreSQL-enabled Spanner databases. - PG_JSONB = 3; - - // PostgreSQL compatible OID type. This annotation can be used by a client - // interacting with PostgreSQL-enabled Spanner database to specify that a - // value should be treated using the semantics of the OID type. - PG_OID = 4; -} diff --git a/owl-bot-staging/v1/protos/protos.d.ts b/owl-bot-staging/v1/protos/protos.d.ts deleted file mode 100644 index fa190f40c..000000000 --- a/owl-bot-staging/v1/protos/protos.d.ts +++ /dev/null @@ -1,16769 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -import type {protobuf as $protobuf} from "google-gax"; -import Long = require("long"); -/** Namespace google. */ -export namespace google { - - /** Namespace protobuf. */ - namespace protobuf { - - /** Properties of a Struct. */ - interface IStruct { - - /** Struct fields */ - fields?: ({ [k: string]: google.protobuf.IValue }|null); - } - - /** Represents a Struct. */ - class Struct implements IStruct { - - /** - * Constructs a new Struct. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IStruct); - - /** Struct fields. */ - public fields: { [k: string]: google.protobuf.IValue }; - - /** - * Creates a new Struct instance using the specified properties. - * @param [properties] Properties to set - * @returns Struct instance - */ - public static create(properties?: google.protobuf.IStruct): google.protobuf.Struct; - - /** - * Encodes the specified Struct message. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. - * @param message Struct message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IStruct, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Struct message, length delimited. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. - * @param message Struct message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IStruct, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Struct message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Struct - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Struct; - - /** - * Decodes a Struct message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Struct - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Struct; - - /** - * Verifies a Struct message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Struct message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Struct - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Struct; - - /** - * Creates a plain object from a Struct message. Also converts values to other types if specified. - * @param message Struct - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Struct, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Struct to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Struct - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Value. */ - interface IValue { - - /** Value nullValue */ - nullValue?: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue|null); - - /** Value numberValue */ - numberValue?: (number|null); - - /** Value stringValue */ - stringValue?: (string|null); - - /** Value boolValue */ - boolValue?: (boolean|null); - - /** Value structValue */ - structValue?: (google.protobuf.IStruct|null); - - /** Value listValue */ - listValue?: (google.protobuf.IListValue|null); - } - - /** Represents a Value. */ - class Value implements IValue { - - /** - * Constructs a new Value. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IValue); - - /** Value nullValue. */ - public nullValue?: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue|null); - - /** Value numberValue. */ - public numberValue?: (number|null); - - /** Value stringValue. */ - public stringValue?: (string|null); - - /** Value boolValue. */ - public boolValue?: (boolean|null); - - /** Value structValue. */ - public structValue?: (google.protobuf.IStruct|null); - - /** Value listValue. */ - public listValue?: (google.protobuf.IListValue|null); - - /** Value kind. */ - public kind?: ("nullValue"|"numberValue"|"stringValue"|"boolValue"|"structValue"|"listValue"); - - /** - * Creates a new Value instance using the specified properties. - * @param [properties] Properties to set - * @returns Value instance - */ - public static create(properties?: google.protobuf.IValue): google.protobuf.Value; - - /** - * Encodes the specified Value message. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. - * @param message Value message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Value message, length delimited. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. - * @param message Value message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Value message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Value; - - /** - * Decodes a Value message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Value; - - /** - * Verifies a Value message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Value message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Value - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Value; - - /** - * Creates a plain object from a Value message. Also converts values to other types if specified. - * @param message Value - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Value to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Value - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** NullValue enum. */ - enum NullValue { - NULL_VALUE = 0 - } - - /** Properties of a ListValue. */ - interface IListValue { - - /** ListValue values */ - values?: (google.protobuf.IValue[]|null); - } - - /** Represents a ListValue. */ - class ListValue implements IListValue { - - /** - * Constructs a new ListValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IListValue); - - /** ListValue values. */ - public values: google.protobuf.IValue[]; - - /** - * Creates a new ListValue instance using the specified properties. - * @param [properties] Properties to set - * @returns ListValue instance - */ - public static create(properties?: google.protobuf.IListValue): google.protobuf.ListValue; - - /** - * Encodes the specified ListValue message. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. - * @param message ListValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IListValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListValue message, length delimited. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. - * @param message ListValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IListValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListValue message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListValue - * @throws {Error} If the payload is not 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.ListValue; - - /** - * Decodes a ListValue message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListValue - * @throws {Error} If the payload 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.ListValue; - - /** - * Verifies a ListValue message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListValue - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ListValue; - - /** - * Creates a plain object from a ListValue message. Also converts values to other types if specified. - * @param message ListValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ListValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListValue - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Timestamp. */ - interface ITimestamp { - - /** Timestamp seconds */ - seconds?: (number|Long|string|null); - - /** Timestamp nanos */ - nanos?: (number|null); - } - - /** Represents a Timestamp. */ - class Timestamp implements ITimestamp { - - /** - * Constructs a new Timestamp. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.ITimestamp); - - /** Timestamp seconds. */ - public seconds: (number|Long|string); - - /** Timestamp nanos. */ - public nanos: number; - - /** - * Creates a new Timestamp instance using the specified properties. - * @param [properties] Properties to set - * @returns Timestamp instance - */ - public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp; - - /** - * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @param message Timestamp message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @param message Timestamp message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Timestamp message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Timestamp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Timestamp; - - /** - * Decodes a Timestamp message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Timestamp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Timestamp; - - /** - * Verifies a Timestamp message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Timestamp - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; - - /** - * Creates a plain object from a Timestamp message. Also converts values to other types if specified. - * @param message Timestamp - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Timestamp to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Timestamp - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a FileDescriptorSet. */ - interface IFileDescriptorSet { - - /** FileDescriptorSet file */ - file?: (google.protobuf.IFileDescriptorProto[]|null); - } - - /** Represents a FileDescriptorSet. */ - class FileDescriptorSet implements IFileDescriptorSet { - - /** - * Constructs a new FileDescriptorSet. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFileDescriptorSet); - - /** FileDescriptorSet file. */ - public file: google.protobuf.IFileDescriptorProto[]; - - /** - * Creates a new FileDescriptorSet instance using the specified properties. - * @param [properties] Properties to set - * @returns FileDescriptorSet instance - */ - public static create(properties?: google.protobuf.IFileDescriptorSet): google.protobuf.FileDescriptorSet; - - /** - * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. - * @param message FileDescriptorSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. - * @param message FileDescriptorSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FileDescriptorSet message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FileDescriptorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorSet; - - /** - * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FileDescriptorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorSet; - - /** - * Verifies a FileDescriptorSet message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FileDescriptorSet - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorSet; - - /** - * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. - * @param message FileDescriptorSet - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FileDescriptorSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FileDescriptorSet to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FileDescriptorSet - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Edition enum. */ - enum Edition { - EDITION_UNKNOWN = 0, - EDITION_PROTO2 = 998, - EDITION_PROTO3 = 999, - EDITION_2023 = 1000, - EDITION_2024 = 1001, - EDITION_1_TEST_ONLY = 1, - EDITION_2_TEST_ONLY = 2, - EDITION_99997_TEST_ONLY = 99997, - EDITION_99998_TEST_ONLY = 99998, - EDITION_99999_TEST_ONLY = 99999, - EDITION_MAX = 2147483647 - } - - /** Properties of a FileDescriptorProto. */ - interface IFileDescriptorProto { - - /** FileDescriptorProto name */ - name?: (string|null); - - /** FileDescriptorProto package */ - "package"?: (string|null); - - /** FileDescriptorProto dependency */ - dependency?: (string[]|null); - - /** FileDescriptorProto publicDependency */ - publicDependency?: (number[]|null); - - /** FileDescriptorProto weakDependency */ - weakDependency?: (number[]|null); - - /** FileDescriptorProto messageType */ - messageType?: (google.protobuf.IDescriptorProto[]|null); - - /** FileDescriptorProto enumType */ - enumType?: (google.protobuf.IEnumDescriptorProto[]|null); - - /** FileDescriptorProto service */ - service?: (google.protobuf.IServiceDescriptorProto[]|null); - - /** FileDescriptorProto extension */ - extension?: (google.protobuf.IFieldDescriptorProto[]|null); - - /** FileDescriptorProto options */ - options?: (google.protobuf.IFileOptions|null); - - /** FileDescriptorProto sourceCodeInfo */ - sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); - - /** FileDescriptorProto syntax */ - syntax?: (string|null); - - /** FileDescriptorProto edition */ - edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - } - - /** Represents a FileDescriptorProto. */ - class FileDescriptorProto implements IFileDescriptorProto { - - /** - * Constructs a new FileDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFileDescriptorProto); - - /** FileDescriptorProto name. */ - public name: string; - - /** FileDescriptorProto package. */ - public package: string; - - /** FileDescriptorProto dependency. */ - public dependency: string[]; - - /** FileDescriptorProto publicDependency. */ - public publicDependency: number[]; - - /** FileDescriptorProto weakDependency. */ - public weakDependency: number[]; - - /** FileDescriptorProto messageType. */ - public messageType: google.protobuf.IDescriptorProto[]; - - /** FileDescriptorProto enumType. */ - public enumType: google.protobuf.IEnumDescriptorProto[]; - - /** FileDescriptorProto service. */ - public service: google.protobuf.IServiceDescriptorProto[]; - - /** FileDescriptorProto extension. */ - public extension: google.protobuf.IFieldDescriptorProto[]; - - /** FileDescriptorProto options. */ - public options?: (google.protobuf.IFileOptions|null); - - /** FileDescriptorProto sourceCodeInfo. */ - public sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); - - /** FileDescriptorProto syntax. */ - public syntax: string; - - /** FileDescriptorProto edition. */ - public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** - * Creates a new FileDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns FileDescriptorProto instance - */ - public static create(properties?: google.protobuf.IFileDescriptorProto): google.protobuf.FileDescriptorProto; - - /** - * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @param message FileDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @param message FileDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorProto; - - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorProto; - - /** - * Verifies a FileDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FileDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorProto; - - /** - * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. - * @param message FileDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FileDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FileDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FileDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DescriptorProto. */ - interface IDescriptorProto { - - /** DescriptorProto name */ - name?: (string|null); - - /** DescriptorProto field */ - field?: (google.protobuf.IFieldDescriptorProto[]|null); - - /** DescriptorProto extension */ - extension?: (google.protobuf.IFieldDescriptorProto[]|null); - - /** DescriptorProto nestedType */ - nestedType?: (google.protobuf.IDescriptorProto[]|null); - - /** DescriptorProto enumType */ - enumType?: (google.protobuf.IEnumDescriptorProto[]|null); - - /** DescriptorProto extensionRange */ - extensionRange?: (google.protobuf.DescriptorProto.IExtensionRange[]|null); - - /** DescriptorProto oneofDecl */ - oneofDecl?: (google.protobuf.IOneofDescriptorProto[]|null); - - /** DescriptorProto options */ - options?: (google.protobuf.IMessageOptions|null); - - /** DescriptorProto reservedRange */ - reservedRange?: (google.protobuf.DescriptorProto.IReservedRange[]|null); - - /** DescriptorProto reservedName */ - reservedName?: (string[]|null); - } - - /** Represents a DescriptorProto. */ - class DescriptorProto implements IDescriptorProto { - - /** - * Constructs a new DescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IDescriptorProto); - - /** DescriptorProto name. */ - public name: string; - - /** DescriptorProto field. */ - public field: google.protobuf.IFieldDescriptorProto[]; - - /** DescriptorProto extension. */ - public extension: google.protobuf.IFieldDescriptorProto[]; - - /** DescriptorProto nestedType. */ - public nestedType: google.protobuf.IDescriptorProto[]; - - /** DescriptorProto enumType. */ - public enumType: google.protobuf.IEnumDescriptorProto[]; - - /** DescriptorProto extensionRange. */ - public extensionRange: google.protobuf.DescriptorProto.IExtensionRange[]; - - /** DescriptorProto oneofDecl. */ - public oneofDecl: google.protobuf.IOneofDescriptorProto[]; - - /** DescriptorProto options. */ - public options?: (google.protobuf.IMessageOptions|null); - - /** DescriptorProto reservedRange. */ - public reservedRange: google.protobuf.DescriptorProto.IReservedRange[]; - - /** DescriptorProto reservedName. */ - public reservedName: string[]; - - /** - * Creates a new DescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns DescriptorProto instance - */ - public static create(properties?: google.protobuf.IDescriptorProto): google.protobuf.DescriptorProto; - - /** - * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @param message DescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @param message DescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto; - - /** - * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto; - - /** - * Verifies a DescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto; - - /** - * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. - * @param message DescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.DescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace DescriptorProto { - - /** Properties of an ExtensionRange. */ - interface IExtensionRange { - - /** ExtensionRange start */ - start?: (number|null); - - /** ExtensionRange end */ - end?: (number|null); - - /** ExtensionRange options */ - options?: (google.protobuf.IExtensionRangeOptions|null); - } - - /** Represents an ExtensionRange. */ - class ExtensionRange implements IExtensionRange { - - /** - * Constructs a new ExtensionRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange); - - /** ExtensionRange start. */ - public start: number; - - /** ExtensionRange end. */ - public end: number; - - /** ExtensionRange options. */ - public options?: (google.protobuf.IExtensionRangeOptions|null); - - /** - * Creates a new ExtensionRange instance using the specified properties. - * @param [properties] Properties to set - * @returns ExtensionRange instance - */ - public static create(properties?: google.protobuf.DescriptorProto.IExtensionRange): google.protobuf.DescriptorProto.ExtensionRange; - - /** - * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @param message ExtensionRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @param message ExtensionRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExtensionRange message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ExtensionRange; - - /** - * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ExtensionRange; - - /** - * Verifies an ExtensionRange message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExtensionRange - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ExtensionRange; - - /** - * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. - * @param message ExtensionRange - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.DescriptorProto.ExtensionRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExtensionRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExtensionRange - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ReservedRange. */ - interface IReservedRange { - - /** ReservedRange start */ - start?: (number|null); - - /** ReservedRange end */ - end?: (number|null); - } - - /** Represents a ReservedRange. */ - class ReservedRange implements IReservedRange { - - /** - * Constructs a new ReservedRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.DescriptorProto.IReservedRange); - - /** ReservedRange start. */ - public start: number; - - /** ReservedRange end. */ - public end: number; - - /** - * Creates a new ReservedRange instance using the specified properties. - * @param [properties] Properties to set - * @returns ReservedRange instance - */ - public static create(properties?: google.protobuf.DescriptorProto.IReservedRange): google.protobuf.DescriptorProto.ReservedRange; - - /** - * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @param message ReservedRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @param message ReservedRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ReservedRange message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ReservedRange; - - /** - * Decodes a ReservedRange message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ReservedRange; - - /** - * Verifies a ReservedRange message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ReservedRange - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ReservedRange; - - /** - * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. - * @param message ReservedRange - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.DescriptorProto.ReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ReservedRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ReservedRange - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an ExtensionRangeOptions. */ - interface IExtensionRangeOptions { - - /** ExtensionRangeOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** ExtensionRangeOptions declaration */ - declaration?: (google.protobuf.ExtensionRangeOptions.IDeclaration[]|null); - - /** ExtensionRangeOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** ExtensionRangeOptions verification */ - verification?: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState|null); - } - - /** Represents an ExtensionRangeOptions. */ - class ExtensionRangeOptions implements IExtensionRangeOptions { - - /** - * Constructs a new ExtensionRangeOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IExtensionRangeOptions); - - /** ExtensionRangeOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** ExtensionRangeOptions declaration. */ - public declaration: google.protobuf.ExtensionRangeOptions.IDeclaration[]; - - /** ExtensionRangeOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** ExtensionRangeOptions verification. */ - public verification: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState); - - /** - * Creates a new ExtensionRangeOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns ExtensionRangeOptions instance - */ - public static create(properties?: google.protobuf.IExtensionRangeOptions): google.protobuf.ExtensionRangeOptions; - - /** - * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. - * @param message ExtensionRangeOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. - * @param message ExtensionRangeOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExtensionRangeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions; - - /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExtensionRangeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions; - - /** - * Verifies an ExtensionRangeOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExtensionRangeOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions; - - /** - * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. - * @param message ExtensionRangeOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ExtensionRangeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExtensionRangeOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExtensionRangeOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ExtensionRangeOptions { - - /** Properties of a Declaration. */ - interface IDeclaration { - - /** Declaration number */ - number?: (number|null); - - /** Declaration fullName */ - fullName?: (string|null); - - /** Declaration type */ - type?: (string|null); - - /** Declaration reserved */ - reserved?: (boolean|null); - - /** Declaration repeated */ - repeated?: (boolean|null); - } - - /** Represents a Declaration. */ - class Declaration implements IDeclaration { - - /** - * Constructs a new Declaration. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration); - - /** Declaration number. */ - public number: number; - - /** Declaration fullName. */ - public fullName: string; - - /** Declaration type. */ - public type: string; - - /** Declaration reserved. */ - public reserved: boolean; - - /** Declaration repeated. */ - public repeated: boolean; - - /** - * Creates a new Declaration instance using the specified properties. - * @param [properties] Properties to set - * @returns Declaration instance - */ - public static create(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration): google.protobuf.ExtensionRangeOptions.Declaration; - - /** - * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. - * @param message Declaration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. - * @param message Declaration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Declaration message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Declaration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions.Declaration; - - /** - * Decodes a Declaration message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Declaration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions.Declaration; - - /** - * Verifies a Declaration message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Declaration message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Declaration - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions.Declaration; - - /** - * Creates a plain object from a Declaration message. Also converts values to other types if specified. - * @param message Declaration - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ExtensionRangeOptions.Declaration, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Declaration to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Declaration - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** VerificationState enum. */ - enum VerificationState { - DECLARATION = 0, - UNVERIFIED = 1 - } - } - - /** Properties of a FieldDescriptorProto. */ - interface IFieldDescriptorProto { - - /** FieldDescriptorProto name */ - name?: (string|null); - - /** FieldDescriptorProto number */ - number?: (number|null); - - /** FieldDescriptorProto label */ - label?: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label|null); - - /** FieldDescriptorProto type */ - type?: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type|null); - - /** FieldDescriptorProto typeName */ - typeName?: (string|null); - - /** FieldDescriptorProto extendee */ - extendee?: (string|null); - - /** FieldDescriptorProto defaultValue */ - defaultValue?: (string|null); - - /** FieldDescriptorProto oneofIndex */ - oneofIndex?: (number|null); - - /** FieldDescriptorProto jsonName */ - jsonName?: (string|null); - - /** FieldDescriptorProto options */ - options?: (google.protobuf.IFieldOptions|null); - - /** FieldDescriptorProto proto3Optional */ - proto3Optional?: (boolean|null); - } - - /** Represents a FieldDescriptorProto. */ - class FieldDescriptorProto implements IFieldDescriptorProto { - - /** - * Constructs a new FieldDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFieldDescriptorProto); - - /** FieldDescriptorProto name. */ - public name: string; - - /** FieldDescriptorProto number. */ - public number: number; - - /** FieldDescriptorProto label. */ - public label: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label); - - /** FieldDescriptorProto type. */ - public type: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type); - - /** FieldDescriptorProto typeName. */ - public typeName: string; - - /** FieldDescriptorProto extendee. */ - public extendee: string; - - /** FieldDescriptorProto defaultValue. */ - public defaultValue: string; - - /** FieldDescriptorProto oneofIndex. */ - public oneofIndex: number; - - /** FieldDescriptorProto jsonName. */ - public jsonName: string; - - /** FieldDescriptorProto options. */ - public options?: (google.protobuf.IFieldOptions|null); - - /** FieldDescriptorProto proto3Optional. */ - public proto3Optional: boolean; - - /** - * Creates a new FieldDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns FieldDescriptorProto instance - */ - public static create(properties?: google.protobuf.IFieldDescriptorProto): google.protobuf.FieldDescriptorProto; - - /** - * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @param message FieldDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @param message FieldDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldDescriptorProto; - - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldDescriptorProto; - - /** - * Verifies a FieldDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FieldDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto; - - /** - * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. - * @param message FieldDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FieldDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FieldDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FieldDescriptorProto { - - /** Type enum. */ - enum Type { - TYPE_DOUBLE = 1, - TYPE_FLOAT = 2, - TYPE_INT64 = 3, - TYPE_UINT64 = 4, - TYPE_INT32 = 5, - TYPE_FIXED64 = 6, - TYPE_FIXED32 = 7, - TYPE_BOOL = 8, - TYPE_STRING = 9, - TYPE_GROUP = 10, - TYPE_MESSAGE = 11, - TYPE_BYTES = 12, - TYPE_UINT32 = 13, - TYPE_ENUM = 14, - TYPE_SFIXED32 = 15, - TYPE_SFIXED64 = 16, - TYPE_SINT32 = 17, - TYPE_SINT64 = 18 - } - - /** Label enum. */ - enum Label { - LABEL_OPTIONAL = 1, - LABEL_REPEATED = 3, - LABEL_REQUIRED = 2 - } - } - - /** Properties of an OneofDescriptorProto. */ - interface IOneofDescriptorProto { - - /** OneofDescriptorProto name */ - name?: (string|null); - - /** OneofDescriptorProto options */ - options?: (google.protobuf.IOneofOptions|null); - } - - /** Represents an OneofDescriptorProto. */ - class OneofDescriptorProto implements IOneofDescriptorProto { - - /** - * Constructs a new OneofDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IOneofDescriptorProto); - - /** OneofDescriptorProto name. */ - public name: string; - - /** OneofDescriptorProto options. */ - public options?: (google.protobuf.IOneofOptions|null); - - /** - * Creates a new OneofDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns OneofDescriptorProto instance - */ - public static create(properties?: google.protobuf.IOneofDescriptorProto): google.protobuf.OneofDescriptorProto; - - /** - * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @param message OneofDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @param message OneofDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofDescriptorProto; - - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofDescriptorProto; - - /** - * Verifies an OneofDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OneofDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.OneofDescriptorProto; - - /** - * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. - * @param message OneofDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.OneofDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OneofDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for OneofDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EnumDescriptorProto. */ - interface IEnumDescriptorProto { - - /** EnumDescriptorProto name */ - name?: (string|null); - - /** EnumDescriptorProto value */ - value?: (google.protobuf.IEnumValueDescriptorProto[]|null); - - /** EnumDescriptorProto options */ - options?: (google.protobuf.IEnumOptions|null); - - /** EnumDescriptorProto reservedRange */ - reservedRange?: (google.protobuf.EnumDescriptorProto.IEnumReservedRange[]|null); - - /** EnumDescriptorProto reservedName */ - reservedName?: (string[]|null); - } - - /** Represents an EnumDescriptorProto. */ - class EnumDescriptorProto implements IEnumDescriptorProto { - - /** - * Constructs a new EnumDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumDescriptorProto); - - /** EnumDescriptorProto name. */ - public name: string; - - /** EnumDescriptorProto value. */ - public value: google.protobuf.IEnumValueDescriptorProto[]; - - /** EnumDescriptorProto options. */ - public options?: (google.protobuf.IEnumOptions|null); - - /** EnumDescriptorProto reservedRange. */ - public reservedRange: google.protobuf.EnumDescriptorProto.IEnumReservedRange[]; - - /** EnumDescriptorProto reservedName. */ - public reservedName: string[]; - - /** - * Creates a new EnumDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumDescriptorProto instance - */ - public static create(properties?: google.protobuf.IEnumDescriptorProto): google.protobuf.EnumDescriptorProto; - - /** - * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @param message EnumDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @param message EnumDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto; - - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto; - - /** - * Verifies an EnumDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto; - - /** - * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. - * @param message EnumDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace EnumDescriptorProto { - - /** Properties of an EnumReservedRange. */ - interface IEnumReservedRange { - - /** EnumReservedRange start */ - start?: (number|null); - - /** EnumReservedRange end */ - end?: (number|null); - } - - /** Represents an EnumReservedRange. */ - class EnumReservedRange implements IEnumReservedRange { - - /** - * Constructs a new EnumReservedRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange); - - /** EnumReservedRange start. */ - public start: number; - - /** EnumReservedRange end. */ - public end: number; - - /** - * Creates a new EnumReservedRange instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumReservedRange instance - */ - public static create(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange): google.protobuf.EnumDescriptorProto.EnumReservedRange; - - /** - * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. - * @param message EnumReservedRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. - * @param message EnumReservedRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumReservedRange message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto.EnumReservedRange; - - /** - * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto.EnumReservedRange; - - /** - * Verifies an EnumReservedRange message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumReservedRange - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto.EnumReservedRange; - - /** - * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. - * @param message EnumReservedRange - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumDescriptorProto.EnumReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumReservedRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumReservedRange - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an EnumValueDescriptorProto. */ - interface IEnumValueDescriptorProto { - - /** EnumValueDescriptorProto name */ - name?: (string|null); - - /** EnumValueDescriptorProto number */ - number?: (number|null); - - /** EnumValueDescriptorProto options */ - options?: (google.protobuf.IEnumValueOptions|null); - } - - /** Represents an EnumValueDescriptorProto. */ - class EnumValueDescriptorProto implements IEnumValueDescriptorProto { - - /** - * Constructs a new EnumValueDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumValueDescriptorProto); - - /** EnumValueDescriptorProto name. */ - public name: string; - - /** EnumValueDescriptorProto number. */ - public number: number; - - /** EnumValueDescriptorProto options. */ - public options?: (google.protobuf.IEnumValueOptions|null); - - /** - * Creates a new EnumValueDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumValueDescriptorProto instance - */ - public static create(properties?: google.protobuf.IEnumValueDescriptorProto): google.protobuf.EnumValueDescriptorProto; - - /** - * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @param message EnumValueDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @param message EnumValueDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueDescriptorProto; - - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueDescriptorProto; - - /** - * Verifies an EnumValueDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumValueDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueDescriptorProto; - - /** - * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. - * @param message EnumValueDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumValueDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumValueDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumValueDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ServiceDescriptorProto. */ - interface IServiceDescriptorProto { - - /** ServiceDescriptorProto name */ - name?: (string|null); - - /** ServiceDescriptorProto method */ - method?: (google.protobuf.IMethodDescriptorProto[]|null); - - /** ServiceDescriptorProto options */ - options?: (google.protobuf.IServiceOptions|null); - } - - /** Represents a ServiceDescriptorProto. */ - class ServiceDescriptorProto implements IServiceDescriptorProto { - - /** - * Constructs a new ServiceDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IServiceDescriptorProto); - - /** ServiceDescriptorProto name. */ - public name: string; - - /** ServiceDescriptorProto method. */ - public method: google.protobuf.IMethodDescriptorProto[]; - - /** ServiceDescriptorProto options. */ - public options?: (google.protobuf.IServiceOptions|null); - - /** - * Creates a new ServiceDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns ServiceDescriptorProto instance - */ - public static create(properties?: google.protobuf.IServiceDescriptorProto): google.protobuf.ServiceDescriptorProto; - - /** - * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @param message ServiceDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @param message ServiceDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceDescriptorProto; - - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceDescriptorProto; - - /** - * Verifies a ServiceDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ServiceDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceDescriptorProto; - - /** - * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. - * @param message ServiceDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ServiceDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ServiceDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ServiceDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a MethodDescriptorProto. */ - interface IMethodDescriptorProto { - - /** MethodDescriptorProto name */ - name?: (string|null); - - /** MethodDescriptorProto inputType */ - inputType?: (string|null); - - /** MethodDescriptorProto outputType */ - outputType?: (string|null); - - /** MethodDescriptorProto options */ - options?: (google.protobuf.IMethodOptions|null); - - /** MethodDescriptorProto clientStreaming */ - clientStreaming?: (boolean|null); - - /** MethodDescriptorProto serverStreaming */ - serverStreaming?: (boolean|null); - } - - /** Represents a MethodDescriptorProto. */ - class MethodDescriptorProto implements IMethodDescriptorProto { - - /** - * Constructs a new MethodDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IMethodDescriptorProto); - - /** MethodDescriptorProto name. */ - public name: string; - - /** MethodDescriptorProto inputType. */ - public inputType: string; - - /** MethodDescriptorProto outputType. */ - public outputType: string; - - /** MethodDescriptorProto options. */ - public options?: (google.protobuf.IMethodOptions|null); - - /** MethodDescriptorProto clientStreaming. */ - public clientStreaming: boolean; - - /** MethodDescriptorProto serverStreaming. */ - public serverStreaming: boolean; - - /** - * Creates a new MethodDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns MethodDescriptorProto instance - */ - public static create(properties?: google.protobuf.IMethodDescriptorProto): google.protobuf.MethodDescriptorProto; - - /** - * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @param message MethodDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @param message MethodDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodDescriptorProto; - - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodDescriptorProto; - - /** - * Verifies a MethodDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MethodDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.MethodDescriptorProto; - - /** - * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. - * @param message MethodDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.MethodDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MethodDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MethodDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a FileOptions. */ - interface IFileOptions { - - /** FileOptions javaPackage */ - javaPackage?: (string|null); - - /** FileOptions javaOuterClassname */ - javaOuterClassname?: (string|null); - - /** FileOptions javaMultipleFiles */ - javaMultipleFiles?: (boolean|null); - - /** FileOptions javaGenerateEqualsAndHash */ - javaGenerateEqualsAndHash?: (boolean|null); - - /** FileOptions javaStringCheckUtf8 */ - javaStringCheckUtf8?: (boolean|null); - - /** FileOptions optimizeFor */ - optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode|null); - - /** FileOptions goPackage */ - goPackage?: (string|null); - - /** FileOptions ccGenericServices */ - ccGenericServices?: (boolean|null); - - /** FileOptions javaGenericServices */ - javaGenericServices?: (boolean|null); - - /** FileOptions pyGenericServices */ - pyGenericServices?: (boolean|null); - - /** FileOptions deprecated */ - deprecated?: (boolean|null); - - /** FileOptions ccEnableArenas */ - ccEnableArenas?: (boolean|null); - - /** FileOptions objcClassPrefix */ - objcClassPrefix?: (string|null); - - /** FileOptions csharpNamespace */ - csharpNamespace?: (string|null); - - /** FileOptions swiftPrefix */ - swiftPrefix?: (string|null); - - /** FileOptions phpClassPrefix */ - phpClassPrefix?: (string|null); - - /** FileOptions phpNamespace */ - phpNamespace?: (string|null); - - /** FileOptions phpMetadataNamespace */ - phpMetadataNamespace?: (string|null); - - /** FileOptions rubyPackage */ - rubyPackage?: (string|null); - - /** FileOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** FileOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** FileOptions .google.api.resourceDefinition */ - ".google.api.resourceDefinition"?: (google.api.IResourceDescriptor[]|null); - } - - /** Represents a FileOptions. */ - class FileOptions implements IFileOptions { - - /** - * Constructs a new FileOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFileOptions); - - /** FileOptions javaPackage. */ - public javaPackage: string; - - /** FileOptions javaOuterClassname. */ - public javaOuterClassname: string; - - /** FileOptions javaMultipleFiles. */ - public javaMultipleFiles: boolean; - - /** FileOptions javaGenerateEqualsAndHash. */ - public javaGenerateEqualsAndHash: boolean; - - /** FileOptions javaStringCheckUtf8. */ - public javaStringCheckUtf8: boolean; - - /** FileOptions optimizeFor. */ - public optimizeFor: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode); - - /** FileOptions goPackage. */ - public goPackage: string; - - /** FileOptions ccGenericServices. */ - public ccGenericServices: boolean; - - /** FileOptions javaGenericServices. */ - public javaGenericServices: boolean; - - /** FileOptions pyGenericServices. */ - public pyGenericServices: boolean; - - /** FileOptions deprecated. */ - public deprecated: boolean; - - /** FileOptions ccEnableArenas. */ - public ccEnableArenas: boolean; - - /** FileOptions objcClassPrefix. */ - public objcClassPrefix: string; - - /** FileOptions csharpNamespace. */ - public csharpNamespace: string; - - /** FileOptions swiftPrefix. */ - public swiftPrefix: string; - - /** FileOptions phpClassPrefix. */ - public phpClassPrefix: string; - - /** FileOptions phpNamespace. */ - public phpNamespace: string; - - /** FileOptions phpMetadataNamespace. */ - public phpMetadataNamespace: string; - - /** FileOptions rubyPackage. */ - public rubyPackage: string; - - /** FileOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** FileOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new FileOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns FileOptions instance - */ - public static create(properties?: google.protobuf.IFileOptions): google.protobuf.FileOptions; - - /** - * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @param message FileOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @param message FileOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FileOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileOptions; - - /** - * Decodes a FileOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileOptions; - - /** - * Verifies a FileOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FileOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FileOptions; - - /** - * Creates a plain object from a FileOptions message. Also converts values to other types if specified. - * @param message FileOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FileOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FileOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FileOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FileOptions { - - /** OptimizeMode enum. */ - enum OptimizeMode { - SPEED = 1, - CODE_SIZE = 2, - LITE_RUNTIME = 3 - } - } - - /** Properties of a MessageOptions. */ - interface IMessageOptions { - - /** MessageOptions messageSetWireFormat */ - messageSetWireFormat?: (boolean|null); - - /** MessageOptions noStandardDescriptorAccessor */ - noStandardDescriptorAccessor?: (boolean|null); - - /** MessageOptions deprecated */ - deprecated?: (boolean|null); - - /** MessageOptions mapEntry */ - mapEntry?: (boolean|null); - - /** MessageOptions deprecatedLegacyJsonFieldConflicts */ - deprecatedLegacyJsonFieldConflicts?: (boolean|null); - - /** MessageOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** MessageOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** MessageOptions .google.api.resource */ - ".google.api.resource"?: (google.api.IResourceDescriptor|null); - } - - /** Represents a MessageOptions. */ - class MessageOptions implements IMessageOptions { - - /** - * Constructs a new MessageOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IMessageOptions); - - /** MessageOptions messageSetWireFormat. */ - public messageSetWireFormat: boolean; - - /** MessageOptions noStandardDescriptorAccessor. */ - public noStandardDescriptorAccessor: boolean; - - /** MessageOptions deprecated. */ - public deprecated: boolean; - - /** MessageOptions mapEntry. */ - public mapEntry: boolean; - - /** MessageOptions deprecatedLegacyJsonFieldConflicts. */ - public deprecatedLegacyJsonFieldConflicts: boolean; - - /** MessageOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** MessageOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new MessageOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns MessageOptions instance - */ - public static create(properties?: google.protobuf.IMessageOptions): google.protobuf.MessageOptions; - - /** - * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @param message MessageOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @param message MessageOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MessageOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MessageOptions; - - /** - * Decodes a MessageOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MessageOptions; - - /** - * Verifies a MessageOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MessageOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.MessageOptions; - - /** - * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. - * @param message MessageOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.MessageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MessageOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MessageOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a FieldOptions. */ - interface IFieldOptions { - - /** FieldOptions ctype */ - ctype?: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType|null); - - /** FieldOptions packed */ - packed?: (boolean|null); - - /** FieldOptions jstype */ - jstype?: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType|null); - - /** FieldOptions lazy */ - lazy?: (boolean|null); - - /** FieldOptions unverifiedLazy */ - unverifiedLazy?: (boolean|null); - - /** FieldOptions deprecated */ - deprecated?: (boolean|null); - - /** FieldOptions weak */ - weak?: (boolean|null); - - /** FieldOptions debugRedact */ - debugRedact?: (boolean|null); - - /** FieldOptions retention */ - retention?: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention|null); - - /** FieldOptions targets */ - targets?: (google.protobuf.FieldOptions.OptionTargetType[]|null); - - /** FieldOptions editionDefaults */ - editionDefaults?: (google.protobuf.FieldOptions.IEditionDefault[]|null); - - /** FieldOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** FieldOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** FieldOptions .google.api.fieldBehavior */ - ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); - - /** FieldOptions .google.api.resourceReference */ - ".google.api.resourceReference"?: (google.api.IResourceReference|null); - } - - /** Represents a FieldOptions. */ - class FieldOptions implements IFieldOptions { - - /** - * Constructs a new FieldOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFieldOptions); - - /** FieldOptions ctype. */ - public ctype: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType); - - /** FieldOptions packed. */ - public packed: boolean; - - /** FieldOptions jstype. */ - public jstype: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType); - - /** FieldOptions lazy. */ - public lazy: boolean; - - /** FieldOptions unverifiedLazy. */ - public unverifiedLazy: boolean; - - /** FieldOptions deprecated. */ - public deprecated: boolean; - - /** FieldOptions weak. */ - public weak: boolean; - - /** FieldOptions debugRedact. */ - public debugRedact: boolean; - - /** FieldOptions retention. */ - public retention: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention); - - /** FieldOptions targets. */ - public targets: google.protobuf.FieldOptions.OptionTargetType[]; - - /** FieldOptions editionDefaults. */ - public editionDefaults: google.protobuf.FieldOptions.IEditionDefault[]; - - /** FieldOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** FieldOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new FieldOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns FieldOptions instance - */ - public static create(properties?: google.protobuf.IFieldOptions): google.protobuf.FieldOptions; - - /** - * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @param message FieldOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @param message FieldOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FieldOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions; - - /** - * Decodes a FieldOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions; - - /** - * Verifies a FieldOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FieldOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions; - - /** - * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. - * @param message FieldOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FieldOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FieldOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FieldOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FieldOptions { - - /** CType enum. */ - enum CType { - STRING = 0, - CORD = 1, - STRING_PIECE = 2 - } - - /** JSType enum. */ - enum JSType { - JS_NORMAL = 0, - JS_STRING = 1, - JS_NUMBER = 2 - } - - /** OptionRetention enum. */ - enum OptionRetention { - RETENTION_UNKNOWN = 0, - RETENTION_RUNTIME = 1, - RETENTION_SOURCE = 2 - } - - /** OptionTargetType enum. */ - enum OptionTargetType { - TARGET_TYPE_UNKNOWN = 0, - TARGET_TYPE_FILE = 1, - TARGET_TYPE_EXTENSION_RANGE = 2, - TARGET_TYPE_MESSAGE = 3, - TARGET_TYPE_FIELD = 4, - TARGET_TYPE_ONEOF = 5, - TARGET_TYPE_ENUM = 6, - TARGET_TYPE_ENUM_ENTRY = 7, - TARGET_TYPE_SERVICE = 8, - TARGET_TYPE_METHOD = 9 - } - - /** Properties of an EditionDefault. */ - interface IEditionDefault { - - /** EditionDefault edition */ - edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - - /** EditionDefault value */ - value?: (string|null); - } - - /** Represents an EditionDefault. */ - class EditionDefault implements IEditionDefault { - - /** - * Constructs a new EditionDefault. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.FieldOptions.IEditionDefault); - - /** EditionDefault edition. */ - public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** EditionDefault value. */ - public value: string; - - /** - * Creates a new EditionDefault instance using the specified properties. - * @param [properties] Properties to set - * @returns EditionDefault instance - */ - public static create(properties?: google.protobuf.FieldOptions.IEditionDefault): google.protobuf.FieldOptions.EditionDefault; - - /** - * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. - * @param message EditionDefault message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. - * @param message EditionDefault message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EditionDefault message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions.EditionDefault; - - /** - * Decodes an EditionDefault message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions.EditionDefault; - - /** - * Verifies an EditionDefault message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EditionDefault - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions.EditionDefault; - - /** - * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. - * @param message EditionDefault - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FieldOptions.EditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EditionDefault to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EditionDefault - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an OneofOptions. */ - interface IOneofOptions { - - /** OneofOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** OneofOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - } - - /** Represents an OneofOptions. */ - class OneofOptions implements IOneofOptions { - - /** - * Constructs a new OneofOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IOneofOptions); - - /** OneofOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** OneofOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new OneofOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns OneofOptions instance - */ - public static create(properties?: google.protobuf.IOneofOptions): google.protobuf.OneofOptions; - - /** - * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @param message OneofOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @param message OneofOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OneofOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofOptions; - - /** - * Decodes an OneofOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofOptions; - - /** - * Verifies an OneofOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OneofOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.OneofOptions; - - /** - * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. - * @param message OneofOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.OneofOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OneofOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for OneofOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EnumOptions. */ - interface IEnumOptions { - - /** EnumOptions allowAlias */ - allowAlias?: (boolean|null); - - /** EnumOptions deprecated */ - deprecated?: (boolean|null); - - /** EnumOptions deprecatedLegacyJsonFieldConflicts */ - deprecatedLegacyJsonFieldConflicts?: (boolean|null); - - /** EnumOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** EnumOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - } - - /** Represents an EnumOptions. */ - class EnumOptions implements IEnumOptions { - - /** - * Constructs a new EnumOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumOptions); - - /** EnumOptions allowAlias. */ - public allowAlias: boolean; - - /** EnumOptions deprecated. */ - public deprecated: boolean; - - /** EnumOptions deprecatedLegacyJsonFieldConflicts. */ - public deprecatedLegacyJsonFieldConflicts: boolean; - - /** EnumOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** EnumOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new EnumOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumOptions instance - */ - public static create(properties?: google.protobuf.IEnumOptions): google.protobuf.EnumOptions; - - /** - * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @param message EnumOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @param message EnumOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumOptions; - - /** - * Decodes an EnumOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumOptions; - - /** - * Verifies an EnumOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumOptions; - - /** - * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. - * @param message EnumOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EnumValueOptions. */ - interface IEnumValueOptions { - - /** EnumValueOptions deprecated */ - deprecated?: (boolean|null); - - /** EnumValueOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** EnumValueOptions debugRedact */ - debugRedact?: (boolean|null); - - /** EnumValueOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - } - - /** Represents an EnumValueOptions. */ - class EnumValueOptions implements IEnumValueOptions { - - /** - * Constructs a new EnumValueOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumValueOptions); - - /** EnumValueOptions deprecated. */ - public deprecated: boolean; - - /** EnumValueOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** EnumValueOptions debugRedact. */ - public debugRedact: boolean; - - /** EnumValueOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new EnumValueOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumValueOptions instance - */ - public static create(properties?: google.protobuf.IEnumValueOptions): google.protobuf.EnumValueOptions; - - /** - * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @param message EnumValueOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @param message EnumValueOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumValueOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumValueOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueOptions; - - /** - * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumValueOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueOptions; - - /** - * Verifies an EnumValueOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumValueOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueOptions; - - /** - * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. - * @param message EnumValueOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumValueOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumValueOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ServiceOptions. */ - interface IServiceOptions { - - /** ServiceOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** ServiceOptions deprecated */ - deprecated?: (boolean|null); - - /** ServiceOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** ServiceOptions .google.api.defaultHost */ - ".google.api.defaultHost"?: (string|null); - - /** ServiceOptions .google.api.oauthScopes */ - ".google.api.oauthScopes"?: (string|null); - - /** ServiceOptions .google.api.apiVersion */ - ".google.api.apiVersion"?: (string|null); - } - - /** Represents a ServiceOptions. */ - class ServiceOptions implements IServiceOptions { - - /** - * Constructs a new ServiceOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IServiceOptions); - - /** ServiceOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** ServiceOptions deprecated. */ - public deprecated: boolean; - - /** ServiceOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new ServiceOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns ServiceOptions instance - */ - public static create(properties?: google.protobuf.IServiceOptions): google.protobuf.ServiceOptions; - - /** - * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @param message ServiceOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @param message ServiceOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ServiceOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceOptions; - - /** - * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceOptions; - - /** - * Verifies a ServiceOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ServiceOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; - - /** - * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. - * @param message ServiceOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ServiceOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ServiceOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a MethodOptions. */ - interface IMethodOptions { - - /** MethodOptions deprecated */ - deprecated?: (boolean|null); - - /** MethodOptions idempotencyLevel */ - idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); - - /** MethodOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** MethodOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** MethodOptions .google.api.http */ - ".google.api.http"?: (google.api.IHttpRule|null); - - /** MethodOptions .google.api.methodSignature */ - ".google.api.methodSignature"?: (string[]|null); - } - - /** Represents a MethodOptions. */ - class MethodOptions implements IMethodOptions { - - /** - * Constructs a new MethodOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IMethodOptions); - - /** MethodOptions deprecated. */ - public deprecated: boolean; - - /** MethodOptions idempotencyLevel. */ - public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); - - /** MethodOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** MethodOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new MethodOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns MethodOptions instance - */ - public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; - - /** - * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @param message MethodOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @param message MethodOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MethodOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MethodOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodOptions; - - /** - * Decodes a MethodOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MethodOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodOptions; - - /** - * Verifies a MethodOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MethodOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; - - /** - * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. - * @param message MethodOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MethodOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MethodOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace MethodOptions { - - /** IdempotencyLevel enum. */ - enum IdempotencyLevel { - IDEMPOTENCY_UNKNOWN = 0, - NO_SIDE_EFFECTS = 1, - IDEMPOTENT = 2 - } - } - - /** Properties of an UninterpretedOption. */ - interface IUninterpretedOption { - - /** UninterpretedOption name */ - name?: (google.protobuf.UninterpretedOption.INamePart[]|null); - - /** UninterpretedOption identifierValue */ - identifierValue?: (string|null); - - /** UninterpretedOption positiveIntValue */ - positiveIntValue?: (number|Long|string|null); - - /** UninterpretedOption negativeIntValue */ - negativeIntValue?: (number|Long|string|null); - - /** UninterpretedOption doubleValue */ - doubleValue?: (number|null); - - /** UninterpretedOption stringValue */ - stringValue?: (Uint8Array|Buffer|string|null); - - /** UninterpretedOption aggregateValue */ - aggregateValue?: (string|null); - } - - /** Represents an UninterpretedOption. */ - class UninterpretedOption implements IUninterpretedOption { - - /** - * Constructs a new UninterpretedOption. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IUninterpretedOption); - - /** UninterpretedOption name. */ - public name: google.protobuf.UninterpretedOption.INamePart[]; - - /** UninterpretedOption identifierValue. */ - public identifierValue: string; - - /** UninterpretedOption positiveIntValue. */ - public positiveIntValue: (number|Long|string); - - /** UninterpretedOption negativeIntValue. */ - public negativeIntValue: (number|Long|string); - - /** UninterpretedOption doubleValue. */ - public doubleValue: number; - - /** UninterpretedOption stringValue. */ - public stringValue: (Uint8Array|Buffer|string); - - /** UninterpretedOption aggregateValue. */ - public aggregateValue: string; - - /** - * Creates a new UninterpretedOption instance using the specified properties. - * @param [properties] Properties to set - * @returns UninterpretedOption instance - */ - public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; - - /** - * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @param message UninterpretedOption message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @param message UninterpretedOption message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption; - - /** - * Verifies an UninterpretedOption message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UninterpretedOption - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; - - /** - * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. - * @param message UninterpretedOption - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UninterpretedOption to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UninterpretedOption - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace UninterpretedOption { - - /** Properties of a NamePart. */ - interface INamePart { - - /** NamePart namePart */ - namePart: string; - - /** NamePart isExtension */ - isExtension: boolean; - } - - /** Represents a NamePart. */ - class NamePart implements INamePart { - - /** - * Constructs a new NamePart. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.UninterpretedOption.INamePart); - - /** NamePart namePart. */ - public namePart: string; - - /** NamePart isExtension. */ - public isExtension: boolean; - - /** - * Creates a new NamePart instance using the specified properties. - * @param [properties] Properties to set - * @returns NamePart instance - */ - public static create(properties?: google.protobuf.UninterpretedOption.INamePart): google.protobuf.UninterpretedOption.NamePart; - - /** - * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @param message NamePart message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @param message NamePart message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a NamePart message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption.NamePart; - - /** - * Decodes a NamePart message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption.NamePart; - - /** - * Verifies a NamePart message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a NamePart message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns NamePart - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; - - /** - * Creates a plain object from a NamePart message. Also converts values to other types if specified. - * @param message NamePart - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this NamePart to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for NamePart - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a FeatureSet. */ - interface IFeatureSet { - - /** FeatureSet fieldPresence */ - fieldPresence?: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence|null); - - /** FeatureSet enumType */ - enumType?: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType|null); - - /** FeatureSet repeatedFieldEncoding */ - repeatedFieldEncoding?: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding|null); - - /** FeatureSet utf8Validation */ - utf8Validation?: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation|null); - - /** FeatureSet messageEncoding */ - messageEncoding?: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding|null); - - /** FeatureSet jsonFormat */ - jsonFormat?: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat|null); - } - - /** Represents a FeatureSet. */ - class FeatureSet implements IFeatureSet { - - /** - * Constructs a new FeatureSet. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFeatureSet); - - /** FeatureSet fieldPresence. */ - public fieldPresence: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence); - - /** FeatureSet enumType. */ - public enumType: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType); - - /** FeatureSet repeatedFieldEncoding. */ - public repeatedFieldEncoding: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding); - - /** FeatureSet utf8Validation. */ - public utf8Validation: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation); - - /** FeatureSet messageEncoding. */ - public messageEncoding: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding); - - /** FeatureSet jsonFormat. */ - public jsonFormat: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat); - - /** - * Creates a new FeatureSet instance using the specified properties. - * @param [properties] Properties to set - * @returns FeatureSet instance - */ - public static create(properties?: google.protobuf.IFeatureSet): google.protobuf.FeatureSet; - - /** - * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. - * @param message FeatureSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. - * @param message FeatureSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FeatureSet message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FeatureSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSet; - - /** - * Decodes a FeatureSet message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FeatureSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSet; - - /** - * Verifies a FeatureSet message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FeatureSet - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSet; - - /** - * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. - * @param message FeatureSet - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FeatureSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FeatureSet to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FeatureSet - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FeatureSet { - - /** FieldPresence enum. */ - enum FieldPresence { - FIELD_PRESENCE_UNKNOWN = 0, - EXPLICIT = 1, - IMPLICIT = 2, - LEGACY_REQUIRED = 3 - } - - /** EnumType enum. */ - enum EnumType { - ENUM_TYPE_UNKNOWN = 0, - OPEN = 1, - CLOSED = 2 - } - - /** RepeatedFieldEncoding enum. */ - enum RepeatedFieldEncoding { - REPEATED_FIELD_ENCODING_UNKNOWN = 0, - PACKED = 1, - EXPANDED = 2 - } - - /** Utf8Validation enum. */ - enum Utf8Validation { - UTF8_VALIDATION_UNKNOWN = 0, - VERIFY = 2, - NONE = 3 - } - - /** MessageEncoding enum. */ - enum MessageEncoding { - MESSAGE_ENCODING_UNKNOWN = 0, - LENGTH_PREFIXED = 1, - DELIMITED = 2 - } - - /** JsonFormat enum. */ - enum JsonFormat { - JSON_FORMAT_UNKNOWN = 0, - ALLOW = 1, - LEGACY_BEST_EFFORT = 2 - } - } - - /** Properties of a FeatureSetDefaults. */ - interface IFeatureSetDefaults { - - /** FeatureSetDefaults defaults */ - defaults?: (google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]|null); - - /** FeatureSetDefaults minimumEdition */ - minimumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - - /** FeatureSetDefaults maximumEdition */ - maximumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - } - - /** Represents a FeatureSetDefaults. */ - class FeatureSetDefaults implements IFeatureSetDefaults { - - /** - * Constructs a new FeatureSetDefaults. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFeatureSetDefaults); - - /** FeatureSetDefaults defaults. */ - public defaults: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]; - - /** FeatureSetDefaults minimumEdition. */ - public minimumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** FeatureSetDefaults maximumEdition. */ - public maximumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** - * Creates a new FeatureSetDefaults instance using the specified properties. - * @param [properties] Properties to set - * @returns FeatureSetDefaults instance - */ - public static create(properties?: google.protobuf.IFeatureSetDefaults): google.protobuf.FeatureSetDefaults; - - /** - * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. - * @param message FeatureSetDefaults message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. - * @param message FeatureSetDefaults message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FeatureSetDefaults message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FeatureSetDefaults - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSetDefaults; - - /** - * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FeatureSetDefaults - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSetDefaults; - - /** - * Verifies a FeatureSetDefaults message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FeatureSetDefaults - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults; - - /** - * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. - * @param message FeatureSetDefaults - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FeatureSetDefaults, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FeatureSetDefaults to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FeatureSetDefaults - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FeatureSetDefaults { - - /** Properties of a FeatureSetEditionDefault. */ - interface IFeatureSetEditionDefault { - - /** FeatureSetEditionDefault edition */ - edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - - /** FeatureSetEditionDefault features */ - features?: (google.protobuf.IFeatureSet|null); - } - - /** Represents a FeatureSetEditionDefault. */ - class FeatureSetEditionDefault implements IFeatureSetEditionDefault { - - /** - * Constructs a new FeatureSetEditionDefault. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault); - - /** FeatureSetEditionDefault edition. */ - public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** FeatureSetEditionDefault features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** - * Creates a new FeatureSetEditionDefault instance using the specified properties. - * @param [properties] Properties to set - * @returns FeatureSetEditionDefault instance - */ - public static create(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; - - /** - * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. - * @param message FeatureSetEditionDefault message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. - * @param message FeatureSetEditionDefault message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FeatureSetEditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; - - /** - * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FeatureSetEditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; - - /** - * Verifies a FeatureSetEditionDefault message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FeatureSetEditionDefault - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; - - /** - * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. - * @param message FeatureSetEditionDefault - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FeatureSetEditionDefault to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FeatureSetEditionDefault - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a SourceCodeInfo. */ - interface ISourceCodeInfo { - - /** SourceCodeInfo location */ - location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); - } - - /** Represents a SourceCodeInfo. */ - class SourceCodeInfo implements ISourceCodeInfo { - - /** - * Constructs a new SourceCodeInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.ISourceCodeInfo); - - /** SourceCodeInfo location. */ - public location: google.protobuf.SourceCodeInfo.ILocation[]; - - /** - * Creates a new SourceCodeInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns SourceCodeInfo instance - */ - public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; - - /** - * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @param message SourceCodeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @param message SourceCodeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo; - - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo; - - /** - * Verifies a SourceCodeInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SourceCodeInfo - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; - - /** - * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. - * @param message SourceCodeInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SourceCodeInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SourceCodeInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace SourceCodeInfo { - - /** Properties of a Location. */ - interface ILocation { - - /** Location path */ - path?: (number[]|null); - - /** Location span */ - span?: (number[]|null); - - /** Location leadingComments */ - leadingComments?: (string|null); - - /** Location trailingComments */ - trailingComments?: (string|null); - - /** Location leadingDetachedComments */ - leadingDetachedComments?: (string[]|null); - } - - /** Represents a Location. */ - class Location implements ILocation { - - /** - * Constructs a new Location. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); - - /** Location path. */ - public path: number[]; - - /** Location span. */ - public span: number[]; - - /** Location leadingComments. */ - public leadingComments: string; - - /** Location trailingComments. */ - public trailingComments: string; - - /** Location leadingDetachedComments. */ - public leadingDetachedComments: string[]; - - /** - * Creates a new Location instance using the specified properties. - * @param [properties] Properties to set - * @returns Location instance - */ - public static create(properties?: google.protobuf.SourceCodeInfo.ILocation): google.protobuf.SourceCodeInfo.Location; - - /** - * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @param message Location message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @param message Location message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Location message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo.Location; - - /** - * Decodes a Location message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo.Location; - - /** - * Verifies a Location message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Location message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Location - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; - - /** - * Creates a plain object from a Location message. Also converts values to other types if specified. - * @param message Location - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Location to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Location - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a GeneratedCodeInfo. */ - interface IGeneratedCodeInfo { - - /** GeneratedCodeInfo annotation */ - annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); - } - - /** Represents a GeneratedCodeInfo. */ - class GeneratedCodeInfo implements IGeneratedCodeInfo { - - /** - * Constructs a new GeneratedCodeInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IGeneratedCodeInfo); - - /** GeneratedCodeInfo annotation. */ - public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; - - /** - * Creates a new GeneratedCodeInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns GeneratedCodeInfo instance - */ - public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; - - /** - * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @param message GeneratedCodeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @param message GeneratedCodeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo; - - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo; - - /** - * Verifies a GeneratedCodeInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GeneratedCodeInfo - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; - - /** - * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. - * @param message GeneratedCodeInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GeneratedCodeInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GeneratedCodeInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace GeneratedCodeInfo { - - /** Properties of an Annotation. */ - interface IAnnotation { - - /** Annotation path */ - path?: (number[]|null); - - /** Annotation sourceFile */ - sourceFile?: (string|null); - - /** Annotation begin */ - begin?: (number|null); - - /** Annotation end */ - end?: (number|null); - - /** Annotation semantic */ - semantic?: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null); - } - - /** Represents an Annotation. */ - class Annotation implements IAnnotation { - - /** - * Constructs a new Annotation. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); - - /** Annotation path. */ - public path: number[]; - - /** Annotation sourceFile. */ - public sourceFile: string; - - /** Annotation begin. */ - public begin: number; - - /** Annotation end. */ - public end: number; - - /** Annotation semantic. */ - public semantic: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic); - - /** - * Creates a new Annotation instance using the specified properties. - * @param [properties] Properties to set - * @returns Annotation instance - */ - public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation; - - /** - * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @param message Annotation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @param message Annotation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Annotation message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo.Annotation; - - /** - * Decodes an Annotation message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo.Annotation; - - /** - * Verifies an Annotation message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Annotation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Annotation - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; - - /** - * Creates a plain object from an Annotation message. Also converts values to other types if specified. - * @param message Annotation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Annotation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Annotation - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Annotation { - - /** Semantic enum. */ - enum Semantic { - NONE = 0, - SET = 1, - ALIAS = 2 - } - } - } - - /** Properties of a Duration. */ - interface IDuration { - - /** Duration seconds */ - seconds?: (number|Long|string|null); - - /** Duration nanos */ - nanos?: (number|null); - } - - /** Represents a Duration. */ - class Duration implements IDuration { - - /** - * Constructs a new Duration. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IDuration); - - /** Duration seconds. */ - public seconds: (number|Long|string); - - /** Duration nanos. */ - public nanos: number; - - /** - * Creates a new Duration instance using the specified properties. - * @param [properties] Properties to set - * @returns Duration instance - */ - public static create(properties?: google.protobuf.IDuration): google.protobuf.Duration; - - /** - * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @param message Duration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @param message Duration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Duration message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Duration; - - /** - * Decodes a Duration message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Duration; - - /** - * Verifies a Duration message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Duration message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Duration - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; - - /** - * Creates a plain object from a Duration message. Also converts values to other types if specified. - * @param message Duration - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Duration to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Duration - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an Empty. */ - interface IEmpty { - } - - /** Represents an Empty. */ - class Empty implements IEmpty { - - /** - * Constructs a new Empty. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEmpty); - - /** - * Creates a new Empty instance using the specified properties. - * @param [properties] Properties to set - * @returns Empty instance - */ - public static create(properties?: google.protobuf.IEmpty): google.protobuf.Empty; - - /** - * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. - * @param message Empty message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. - * @param message Empty message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Empty message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Empty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Empty; - - /** - * Decodes an Empty message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Empty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Empty; - - /** - * Verifies an Empty message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Empty message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Empty - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Empty; - - /** - * Creates a plain object from an Empty message. Also converts values to other types if specified. - * @param message Empty - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Empty to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Empty - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an Any. */ - interface IAny { - - /** Any type_url */ - type_url?: (string|null); - - /** Any value */ - value?: (Uint8Array|Buffer|string|null); - } - - /** Represents an Any. */ - class Any implements IAny { - - /** - * Constructs a new Any. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IAny); - - /** Any type_url. */ - public type_url: string; - - /** Any value. */ - public value: (Uint8Array|Buffer|string); - - /** - * Creates a new Any instance using the specified properties. - * @param [properties] Properties to set - * @returns Any instance - */ - public static create(properties?: google.protobuf.IAny): google.protobuf.Any; - - /** - * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. - * @param message Any message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. - * @param message Any message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Any message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Any - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Any; - - /** - * Decodes an Any message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Any - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Any; - - /** - * Verifies an Any message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Any message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Any - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Any; - - /** - * Creates a plain object from an Any message. Also converts values to other types if specified. - * @param message Any - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Any, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Any to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Any - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Namespace spanner. */ - namespace spanner { - - /** Namespace v1. */ - namespace v1 { - - /** Properties of a ChangeStreamRecord. */ - interface IChangeStreamRecord { - - /** ChangeStreamRecord dataChangeRecord */ - dataChangeRecord?: (google.spanner.v1.ChangeStreamRecord.IDataChangeRecord|null); - - /** ChangeStreamRecord heartbeatRecord */ - heartbeatRecord?: (google.spanner.v1.ChangeStreamRecord.IHeartbeatRecord|null); - - /** ChangeStreamRecord partitionStartRecord */ - partitionStartRecord?: (google.spanner.v1.ChangeStreamRecord.IPartitionStartRecord|null); - - /** ChangeStreamRecord partitionEndRecord */ - partitionEndRecord?: (google.spanner.v1.ChangeStreamRecord.IPartitionEndRecord|null); - - /** ChangeStreamRecord partitionEventRecord */ - partitionEventRecord?: (google.spanner.v1.ChangeStreamRecord.IPartitionEventRecord|null); - } - - /** Represents a ChangeStreamRecord. */ - class ChangeStreamRecord implements IChangeStreamRecord { - - /** - * Constructs a new ChangeStreamRecord. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.IChangeStreamRecord); - - /** ChangeStreamRecord dataChangeRecord. */ - public dataChangeRecord?: (google.spanner.v1.ChangeStreamRecord.IDataChangeRecord|null); - - /** ChangeStreamRecord heartbeatRecord. */ - public heartbeatRecord?: (google.spanner.v1.ChangeStreamRecord.IHeartbeatRecord|null); - - /** ChangeStreamRecord partitionStartRecord. */ - public partitionStartRecord?: (google.spanner.v1.ChangeStreamRecord.IPartitionStartRecord|null); - - /** ChangeStreamRecord partitionEndRecord. */ - public partitionEndRecord?: (google.spanner.v1.ChangeStreamRecord.IPartitionEndRecord|null); - - /** ChangeStreamRecord partitionEventRecord. */ - public partitionEventRecord?: (google.spanner.v1.ChangeStreamRecord.IPartitionEventRecord|null); - - /** ChangeStreamRecord record. */ - public record?: ("dataChangeRecord"|"heartbeatRecord"|"partitionStartRecord"|"partitionEndRecord"|"partitionEventRecord"); - - /** - * Creates a new ChangeStreamRecord instance using the specified properties. - * @param [properties] Properties to set - * @returns ChangeStreamRecord instance - */ - public static create(properties?: google.spanner.v1.IChangeStreamRecord): google.spanner.v1.ChangeStreamRecord; - - /** - * Encodes the specified ChangeStreamRecord message. Does not implicitly {@link google.spanner.v1.ChangeStreamRecord.verify|verify} messages. - * @param message ChangeStreamRecord message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.IChangeStreamRecord, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ChangeStreamRecord message, length delimited. Does not implicitly {@link google.spanner.v1.ChangeStreamRecord.verify|verify} messages. - * @param message ChangeStreamRecord message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.IChangeStreamRecord, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ChangeStreamRecord message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ChangeStreamRecord - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.ChangeStreamRecord; - - /** - * Decodes a ChangeStreamRecord message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ChangeStreamRecord - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.ChangeStreamRecord; - - /** - * Verifies a ChangeStreamRecord message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ChangeStreamRecord message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ChangeStreamRecord - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.ChangeStreamRecord; - - /** - * Creates a plain object from a ChangeStreamRecord message. Also converts values to other types if specified. - * @param message ChangeStreamRecord - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.ChangeStreamRecord, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ChangeStreamRecord to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ChangeStreamRecord - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ChangeStreamRecord { - - /** Properties of a DataChangeRecord. */ - interface IDataChangeRecord { - - /** DataChangeRecord commitTimestamp */ - commitTimestamp?: (google.protobuf.ITimestamp|null); - - /** DataChangeRecord recordSequence */ - recordSequence?: (string|null); - - /** DataChangeRecord serverTransactionId */ - serverTransactionId?: (string|null); - - /** DataChangeRecord isLastRecordInTransactionInPartition */ - isLastRecordInTransactionInPartition?: (boolean|null); - - /** DataChangeRecord table */ - table?: (string|null); - - /** DataChangeRecord columnMetadata */ - columnMetadata?: (google.spanner.v1.ChangeStreamRecord.DataChangeRecord.IColumnMetadata[]|null); - - /** DataChangeRecord mods */ - mods?: (google.spanner.v1.ChangeStreamRecord.DataChangeRecord.IMod[]|null); - - /** DataChangeRecord modType */ - modType?: (google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType|keyof typeof google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType|null); - - /** DataChangeRecord valueCaptureType */ - valueCaptureType?: (google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ValueCaptureType|keyof typeof google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ValueCaptureType|null); - - /** DataChangeRecord numberOfRecordsInTransaction */ - numberOfRecordsInTransaction?: (number|null); - - /** DataChangeRecord numberOfPartitionsInTransaction */ - numberOfPartitionsInTransaction?: (number|null); - - /** DataChangeRecord transactionTag */ - transactionTag?: (string|null); - - /** DataChangeRecord isSystemTransaction */ - isSystemTransaction?: (boolean|null); - } - - /** Represents a DataChangeRecord. */ - class DataChangeRecord implements IDataChangeRecord { - - /** - * Constructs a new DataChangeRecord. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.ChangeStreamRecord.IDataChangeRecord); - - /** DataChangeRecord commitTimestamp. */ - public commitTimestamp?: (google.protobuf.ITimestamp|null); - - /** DataChangeRecord recordSequence. */ - public recordSequence: string; - - /** DataChangeRecord serverTransactionId. */ - public serverTransactionId: string; - - /** DataChangeRecord isLastRecordInTransactionInPartition. */ - public isLastRecordInTransactionInPartition: boolean; - - /** DataChangeRecord table. */ - public table: string; - - /** DataChangeRecord columnMetadata. */ - public columnMetadata: google.spanner.v1.ChangeStreamRecord.DataChangeRecord.IColumnMetadata[]; - - /** DataChangeRecord mods. */ - public mods: google.spanner.v1.ChangeStreamRecord.DataChangeRecord.IMod[]; - - /** DataChangeRecord modType. */ - public modType: (google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType|keyof typeof google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType); - - /** DataChangeRecord valueCaptureType. */ - public valueCaptureType: (google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ValueCaptureType|keyof typeof google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ValueCaptureType); - - /** DataChangeRecord numberOfRecordsInTransaction. */ - public numberOfRecordsInTransaction: number; - - /** DataChangeRecord numberOfPartitionsInTransaction. */ - public numberOfPartitionsInTransaction: number; - - /** DataChangeRecord transactionTag. */ - public transactionTag: string; - - /** DataChangeRecord isSystemTransaction. */ - public isSystemTransaction: boolean; - - /** - * Creates a new DataChangeRecord instance using the specified properties. - * @param [properties] Properties to set - * @returns DataChangeRecord instance - */ - public static create(properties?: google.spanner.v1.ChangeStreamRecord.IDataChangeRecord): google.spanner.v1.ChangeStreamRecord.DataChangeRecord; - - /** - * Encodes the specified DataChangeRecord message. Does not implicitly {@link google.spanner.v1.ChangeStreamRecord.DataChangeRecord.verify|verify} messages. - * @param message DataChangeRecord message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.ChangeStreamRecord.IDataChangeRecord, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DataChangeRecord message, length delimited. Does not implicitly {@link google.spanner.v1.ChangeStreamRecord.DataChangeRecord.verify|verify} messages. - * @param message DataChangeRecord message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.ChangeStreamRecord.IDataChangeRecord, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DataChangeRecord message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DataChangeRecord - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.ChangeStreamRecord.DataChangeRecord; - - /** - * Decodes a DataChangeRecord message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DataChangeRecord - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.ChangeStreamRecord.DataChangeRecord; - - /** - * Verifies a DataChangeRecord message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DataChangeRecord message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DataChangeRecord - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.ChangeStreamRecord.DataChangeRecord; - - /** - * Creates a plain object from a DataChangeRecord message. Also converts values to other types if specified. - * @param message DataChangeRecord - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.ChangeStreamRecord.DataChangeRecord, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DataChangeRecord to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DataChangeRecord - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace DataChangeRecord { - - /** Properties of a ColumnMetadata. */ - interface IColumnMetadata { - - /** ColumnMetadata name */ - name?: (string|null); - - /** ColumnMetadata type */ - type?: (google.spanner.v1.IType|null); - - /** ColumnMetadata isPrimaryKey */ - isPrimaryKey?: (boolean|null); - - /** ColumnMetadata ordinalPosition */ - ordinalPosition?: (number|Long|string|null); - } - - /** Represents a ColumnMetadata. */ - class ColumnMetadata implements IColumnMetadata { - - /** - * Constructs a new ColumnMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.ChangeStreamRecord.DataChangeRecord.IColumnMetadata); - - /** ColumnMetadata name. */ - public name: string; - - /** ColumnMetadata type. */ - public type?: (google.spanner.v1.IType|null); - - /** ColumnMetadata isPrimaryKey. */ - public isPrimaryKey: boolean; - - /** ColumnMetadata ordinalPosition. */ - public ordinalPosition: (number|Long|string); - - /** - * Creates a new ColumnMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns ColumnMetadata instance - */ - public static create(properties?: google.spanner.v1.ChangeStreamRecord.DataChangeRecord.IColumnMetadata): google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata; - - /** - * Encodes the specified ColumnMetadata message. Does not implicitly {@link google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata.verify|verify} messages. - * @param message ColumnMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.ChangeStreamRecord.DataChangeRecord.IColumnMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ColumnMetadata message, length delimited. Does not implicitly {@link google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata.verify|verify} messages. - * @param message ColumnMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.ChangeStreamRecord.DataChangeRecord.IColumnMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ColumnMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ColumnMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata; - - /** - * Decodes a ColumnMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ColumnMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata; - - /** - * Verifies a ColumnMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ColumnMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ColumnMetadata - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata; - - /** - * Creates a plain object from a ColumnMetadata message. Also converts values to other types if specified. - * @param message ColumnMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ColumnMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ColumnMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ModValue. */ - interface IModValue { - - /** ModValue columnMetadataIndex */ - columnMetadataIndex?: (number|null); - - /** ModValue value */ - value?: (google.protobuf.IValue|null); - } - - /** Represents a ModValue. */ - class ModValue implements IModValue { - - /** - * Constructs a new ModValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.ChangeStreamRecord.DataChangeRecord.IModValue); - - /** ModValue columnMetadataIndex. */ - public columnMetadataIndex: number; - - /** ModValue value. */ - public value?: (google.protobuf.IValue|null); - - /** - * Creates a new ModValue instance using the specified properties. - * @param [properties] Properties to set - * @returns ModValue instance - */ - public static create(properties?: google.spanner.v1.ChangeStreamRecord.DataChangeRecord.IModValue): google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue; - - /** - * Encodes the specified ModValue message. Does not implicitly {@link google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue.verify|verify} messages. - * @param message ModValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.ChangeStreamRecord.DataChangeRecord.IModValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ModValue message, length delimited. Does not implicitly {@link google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue.verify|verify} messages. - * @param message ModValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.ChangeStreamRecord.DataChangeRecord.IModValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ModValue message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ModValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue; - - /** - * Decodes a ModValue message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ModValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue; - - /** - * Verifies a ModValue message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ModValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ModValue - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue; - - /** - * Creates a plain object from a ModValue message. Also converts values to other types if specified. - * @param message ModValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ModValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ModValue - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Mod. */ - interface IMod { - - /** Mod keys */ - keys?: (google.spanner.v1.ChangeStreamRecord.DataChangeRecord.IModValue[]|null); - - /** Mod oldValues */ - oldValues?: (google.spanner.v1.ChangeStreamRecord.DataChangeRecord.IModValue[]|null); - - /** Mod newValues */ - newValues?: (google.spanner.v1.ChangeStreamRecord.DataChangeRecord.IModValue[]|null); - } - - /** Represents a Mod. */ - class Mod implements IMod { - - /** - * Constructs a new Mod. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.ChangeStreamRecord.DataChangeRecord.IMod); - - /** Mod keys. */ - public keys: google.spanner.v1.ChangeStreamRecord.DataChangeRecord.IModValue[]; - - /** Mod oldValues. */ - public oldValues: google.spanner.v1.ChangeStreamRecord.DataChangeRecord.IModValue[]; - - /** Mod newValues. */ - public newValues: google.spanner.v1.ChangeStreamRecord.DataChangeRecord.IModValue[]; - - /** - * Creates a new Mod instance using the specified properties. - * @param [properties] Properties to set - * @returns Mod instance - */ - public static create(properties?: google.spanner.v1.ChangeStreamRecord.DataChangeRecord.IMod): google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod; - - /** - * Encodes the specified Mod message. Does not implicitly {@link google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod.verify|verify} messages. - * @param message Mod message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.ChangeStreamRecord.DataChangeRecord.IMod, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Mod message, length delimited. Does not implicitly {@link google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod.verify|verify} messages. - * @param message Mod message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.ChangeStreamRecord.DataChangeRecord.IMod, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Mod message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Mod - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod; - - /** - * Decodes a Mod message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Mod - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod; - - /** - * Verifies a Mod message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Mod message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Mod - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod; - - /** - * Creates a plain object from a Mod message. Also converts values to other types if specified. - * @param message Mod - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Mod to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Mod - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** ModType enum. */ - enum ModType { - MOD_TYPE_UNSPECIFIED = 0, - INSERT = 10, - UPDATE = 20, - DELETE = 30 - } - - /** ValueCaptureType enum. */ - enum ValueCaptureType { - VALUE_CAPTURE_TYPE_UNSPECIFIED = 0, - OLD_AND_NEW_VALUES = 10, - NEW_VALUES = 20, - NEW_ROW = 30, - NEW_ROW_AND_OLD_VALUES = 40 - } - } - - /** Properties of a HeartbeatRecord. */ - interface IHeartbeatRecord { - - /** HeartbeatRecord timestamp */ - timestamp?: (google.protobuf.ITimestamp|null); - } - - /** Represents a HeartbeatRecord. */ - class HeartbeatRecord implements IHeartbeatRecord { - - /** - * Constructs a new HeartbeatRecord. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.ChangeStreamRecord.IHeartbeatRecord); - - /** HeartbeatRecord timestamp. */ - public timestamp?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new HeartbeatRecord instance using the specified properties. - * @param [properties] Properties to set - * @returns HeartbeatRecord instance - */ - public static create(properties?: google.spanner.v1.ChangeStreamRecord.IHeartbeatRecord): google.spanner.v1.ChangeStreamRecord.HeartbeatRecord; - - /** - * Encodes the specified HeartbeatRecord message. Does not implicitly {@link google.spanner.v1.ChangeStreamRecord.HeartbeatRecord.verify|verify} messages. - * @param message HeartbeatRecord message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.ChangeStreamRecord.IHeartbeatRecord, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified HeartbeatRecord message, length delimited. Does not implicitly {@link google.spanner.v1.ChangeStreamRecord.HeartbeatRecord.verify|verify} messages. - * @param message HeartbeatRecord message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.ChangeStreamRecord.IHeartbeatRecord, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a HeartbeatRecord message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns HeartbeatRecord - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.ChangeStreamRecord.HeartbeatRecord; - - /** - * Decodes a HeartbeatRecord message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns HeartbeatRecord - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.ChangeStreamRecord.HeartbeatRecord; - - /** - * Verifies a HeartbeatRecord message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a HeartbeatRecord message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns HeartbeatRecord - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.ChangeStreamRecord.HeartbeatRecord; - - /** - * Creates a plain object from a HeartbeatRecord message. Also converts values to other types if specified. - * @param message HeartbeatRecord - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.ChangeStreamRecord.HeartbeatRecord, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this HeartbeatRecord to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for HeartbeatRecord - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PartitionStartRecord. */ - interface IPartitionStartRecord { - - /** PartitionStartRecord startTimestamp */ - startTimestamp?: (google.protobuf.ITimestamp|null); - - /** PartitionStartRecord recordSequence */ - recordSequence?: (string|null); - - /** PartitionStartRecord partitionTokens */ - partitionTokens?: (string[]|null); - } - - /** Represents a PartitionStartRecord. */ - class PartitionStartRecord implements IPartitionStartRecord { - - /** - * Constructs a new PartitionStartRecord. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.ChangeStreamRecord.IPartitionStartRecord); - - /** PartitionStartRecord startTimestamp. */ - public startTimestamp?: (google.protobuf.ITimestamp|null); - - /** PartitionStartRecord recordSequence. */ - public recordSequence: string; - - /** PartitionStartRecord partitionTokens. */ - public partitionTokens: string[]; - - /** - * Creates a new PartitionStartRecord instance using the specified properties. - * @param [properties] Properties to set - * @returns PartitionStartRecord instance - */ - public static create(properties?: google.spanner.v1.ChangeStreamRecord.IPartitionStartRecord): google.spanner.v1.ChangeStreamRecord.PartitionStartRecord; - - /** - * Encodes the specified PartitionStartRecord message. Does not implicitly {@link google.spanner.v1.ChangeStreamRecord.PartitionStartRecord.verify|verify} messages. - * @param message PartitionStartRecord message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.ChangeStreamRecord.IPartitionStartRecord, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PartitionStartRecord message, length delimited. Does not implicitly {@link google.spanner.v1.ChangeStreamRecord.PartitionStartRecord.verify|verify} messages. - * @param message PartitionStartRecord message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.ChangeStreamRecord.IPartitionStartRecord, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PartitionStartRecord message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PartitionStartRecord - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.ChangeStreamRecord.PartitionStartRecord; - - /** - * Decodes a PartitionStartRecord message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PartitionStartRecord - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.ChangeStreamRecord.PartitionStartRecord; - - /** - * Verifies a PartitionStartRecord message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PartitionStartRecord message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PartitionStartRecord - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.ChangeStreamRecord.PartitionStartRecord; - - /** - * Creates a plain object from a PartitionStartRecord message. Also converts values to other types if specified. - * @param message PartitionStartRecord - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.ChangeStreamRecord.PartitionStartRecord, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PartitionStartRecord to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PartitionStartRecord - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PartitionEndRecord. */ - interface IPartitionEndRecord { - - /** PartitionEndRecord endTimestamp */ - endTimestamp?: (google.protobuf.ITimestamp|null); - - /** PartitionEndRecord recordSequence */ - recordSequence?: (string|null); - - /** PartitionEndRecord partitionToken */ - partitionToken?: (string|null); - } - - /** Represents a PartitionEndRecord. */ - class PartitionEndRecord implements IPartitionEndRecord { - - /** - * Constructs a new PartitionEndRecord. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.ChangeStreamRecord.IPartitionEndRecord); - - /** PartitionEndRecord endTimestamp. */ - public endTimestamp?: (google.protobuf.ITimestamp|null); - - /** PartitionEndRecord recordSequence. */ - public recordSequence: string; - - /** PartitionEndRecord partitionToken. */ - public partitionToken: string; - - /** - * Creates a new PartitionEndRecord instance using the specified properties. - * @param [properties] Properties to set - * @returns PartitionEndRecord instance - */ - public static create(properties?: google.spanner.v1.ChangeStreamRecord.IPartitionEndRecord): google.spanner.v1.ChangeStreamRecord.PartitionEndRecord; - - /** - * Encodes the specified PartitionEndRecord message. Does not implicitly {@link google.spanner.v1.ChangeStreamRecord.PartitionEndRecord.verify|verify} messages. - * @param message PartitionEndRecord message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.ChangeStreamRecord.IPartitionEndRecord, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PartitionEndRecord message, length delimited. Does not implicitly {@link google.spanner.v1.ChangeStreamRecord.PartitionEndRecord.verify|verify} messages. - * @param message PartitionEndRecord message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.ChangeStreamRecord.IPartitionEndRecord, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PartitionEndRecord message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PartitionEndRecord - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.ChangeStreamRecord.PartitionEndRecord; - - /** - * Decodes a PartitionEndRecord message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PartitionEndRecord - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.ChangeStreamRecord.PartitionEndRecord; - - /** - * Verifies a PartitionEndRecord message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PartitionEndRecord message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PartitionEndRecord - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.ChangeStreamRecord.PartitionEndRecord; - - /** - * Creates a plain object from a PartitionEndRecord message. Also converts values to other types if specified. - * @param message PartitionEndRecord - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.ChangeStreamRecord.PartitionEndRecord, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PartitionEndRecord to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PartitionEndRecord - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PartitionEventRecord. */ - interface IPartitionEventRecord { - - /** PartitionEventRecord commitTimestamp */ - commitTimestamp?: (google.protobuf.ITimestamp|null); - - /** PartitionEventRecord recordSequence */ - recordSequence?: (string|null); - - /** PartitionEventRecord partitionToken */ - partitionToken?: (string|null); - - /** PartitionEventRecord moveInEvents */ - moveInEvents?: (google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.IMoveInEvent[]|null); - - /** PartitionEventRecord moveOutEvents */ - moveOutEvents?: (google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.IMoveOutEvent[]|null); - } - - /** Represents a PartitionEventRecord. */ - class PartitionEventRecord implements IPartitionEventRecord { - - /** - * Constructs a new PartitionEventRecord. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.ChangeStreamRecord.IPartitionEventRecord); - - /** PartitionEventRecord commitTimestamp. */ - public commitTimestamp?: (google.protobuf.ITimestamp|null); - - /** PartitionEventRecord recordSequence. */ - public recordSequence: string; - - /** PartitionEventRecord partitionToken. */ - public partitionToken: string; - - /** PartitionEventRecord moveInEvents. */ - public moveInEvents: google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.IMoveInEvent[]; - - /** PartitionEventRecord moveOutEvents. */ - public moveOutEvents: google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.IMoveOutEvent[]; - - /** - * Creates a new PartitionEventRecord instance using the specified properties. - * @param [properties] Properties to set - * @returns PartitionEventRecord instance - */ - public static create(properties?: google.spanner.v1.ChangeStreamRecord.IPartitionEventRecord): google.spanner.v1.ChangeStreamRecord.PartitionEventRecord; - - /** - * Encodes the specified PartitionEventRecord message. Does not implicitly {@link google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.verify|verify} messages. - * @param message PartitionEventRecord message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.ChangeStreamRecord.IPartitionEventRecord, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PartitionEventRecord message, length delimited. Does not implicitly {@link google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.verify|verify} messages. - * @param message PartitionEventRecord message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.ChangeStreamRecord.IPartitionEventRecord, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PartitionEventRecord message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PartitionEventRecord - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.ChangeStreamRecord.PartitionEventRecord; - - /** - * Decodes a PartitionEventRecord message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PartitionEventRecord - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.ChangeStreamRecord.PartitionEventRecord; - - /** - * Verifies a PartitionEventRecord message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PartitionEventRecord message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PartitionEventRecord - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.ChangeStreamRecord.PartitionEventRecord; - - /** - * Creates a plain object from a PartitionEventRecord message. Also converts values to other types if specified. - * @param message PartitionEventRecord - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.ChangeStreamRecord.PartitionEventRecord, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PartitionEventRecord to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PartitionEventRecord - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace PartitionEventRecord { - - /** Properties of a MoveInEvent. */ - interface IMoveInEvent { - - /** MoveInEvent sourcePartitionToken */ - sourcePartitionToken?: (string|null); - } - - /** Represents a MoveInEvent. */ - class MoveInEvent implements IMoveInEvent { - - /** - * Constructs a new MoveInEvent. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.IMoveInEvent); - - /** MoveInEvent sourcePartitionToken. */ - public sourcePartitionToken: string; - - /** - * Creates a new MoveInEvent instance using the specified properties. - * @param [properties] Properties to set - * @returns MoveInEvent instance - */ - public static create(properties?: google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.IMoveInEvent): google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent; - - /** - * Encodes the specified MoveInEvent message. Does not implicitly {@link google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent.verify|verify} messages. - * @param message MoveInEvent message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.IMoveInEvent, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MoveInEvent message, length delimited. Does not implicitly {@link google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent.verify|verify} messages. - * @param message MoveInEvent message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.IMoveInEvent, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MoveInEvent message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MoveInEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent; - - /** - * Decodes a MoveInEvent message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MoveInEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent; - - /** - * Verifies a MoveInEvent message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MoveInEvent message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MoveInEvent - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent; - - /** - * Creates a plain object from a MoveInEvent message. Also converts values to other types if specified. - * @param message MoveInEvent - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MoveInEvent to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MoveInEvent - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a MoveOutEvent. */ - interface IMoveOutEvent { - - /** MoveOutEvent destinationPartitionToken */ - destinationPartitionToken?: (string|null); - } - - /** Represents a MoveOutEvent. */ - class MoveOutEvent implements IMoveOutEvent { - - /** - * Constructs a new MoveOutEvent. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.IMoveOutEvent); - - /** MoveOutEvent destinationPartitionToken. */ - public destinationPartitionToken: string; - - /** - * Creates a new MoveOutEvent instance using the specified properties. - * @param [properties] Properties to set - * @returns MoveOutEvent instance - */ - public static create(properties?: google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.IMoveOutEvent): google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent; - - /** - * Encodes the specified MoveOutEvent message. Does not implicitly {@link google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent.verify|verify} messages. - * @param message MoveOutEvent message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.IMoveOutEvent, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MoveOutEvent message, length delimited. Does not implicitly {@link google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent.verify|verify} messages. - * @param message MoveOutEvent message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.IMoveOutEvent, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MoveOutEvent message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MoveOutEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent; - - /** - * Decodes a MoveOutEvent message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MoveOutEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent; - - /** - * Verifies a MoveOutEvent message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MoveOutEvent message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MoveOutEvent - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent; - - /** - * Creates a plain object from a MoveOutEvent message. Also converts values to other types if specified. - * @param message MoveOutEvent - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MoveOutEvent to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MoveOutEvent - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - } - - /** Properties of a Type. */ - interface IType { - - /** Type code */ - code?: (google.spanner.v1.TypeCode|keyof typeof google.spanner.v1.TypeCode|null); - - /** Type arrayElementType */ - arrayElementType?: (google.spanner.v1.IType|null); - - /** Type structType */ - structType?: (google.spanner.v1.IStructType|null); - - /** Type typeAnnotation */ - typeAnnotation?: (google.spanner.v1.TypeAnnotationCode|keyof typeof google.spanner.v1.TypeAnnotationCode|null); - - /** Type protoTypeFqn */ - protoTypeFqn?: (string|null); - } - - /** Represents a Type. */ - class Type implements IType { - - /** - * Constructs a new Type. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.IType); - - /** Type code. */ - public code: (google.spanner.v1.TypeCode|keyof typeof google.spanner.v1.TypeCode); - - /** Type arrayElementType. */ - public arrayElementType?: (google.spanner.v1.IType|null); - - /** Type structType. */ - public structType?: (google.spanner.v1.IStructType|null); - - /** Type typeAnnotation. */ - public typeAnnotation: (google.spanner.v1.TypeAnnotationCode|keyof typeof google.spanner.v1.TypeAnnotationCode); - - /** Type protoTypeFqn. */ - public protoTypeFqn: string; - - /** - * Creates a new Type instance using the specified properties. - * @param [properties] Properties to set - * @returns Type instance - */ - public static create(properties?: google.spanner.v1.IType): google.spanner.v1.Type; - - /** - * Encodes the specified Type message. Does not implicitly {@link google.spanner.v1.Type.verify|verify} messages. - * @param message Type message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.IType, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Type message, length delimited. Does not implicitly {@link google.spanner.v1.Type.verify|verify} messages. - * @param message Type message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.IType, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Type message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Type - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.Type; - - /** - * Decodes a Type message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Type - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.Type; - - /** - * Verifies a Type message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Type message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Type - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.Type; - - /** - * Creates a plain object from a Type message. Also converts values to other types if specified. - * @param message Type - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.Type, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Type to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Type - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a StructType. */ - interface IStructType { - - /** StructType fields */ - fields?: (google.spanner.v1.StructType.IField[]|null); - } - - /** Represents a StructType. */ - class StructType implements IStructType { - - /** - * Constructs a new StructType. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.IStructType); - - /** StructType fields. */ - public fields: google.spanner.v1.StructType.IField[]; - - /** - * Creates a new StructType instance using the specified properties. - * @param [properties] Properties to set - * @returns StructType instance - */ - public static create(properties?: google.spanner.v1.IStructType): google.spanner.v1.StructType; - - /** - * Encodes the specified StructType message. Does not implicitly {@link google.spanner.v1.StructType.verify|verify} messages. - * @param message StructType message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.IStructType, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified StructType message, length delimited. Does not implicitly {@link google.spanner.v1.StructType.verify|verify} messages. - * @param message StructType message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.IStructType, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a StructType message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns StructType - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.StructType; - - /** - * Decodes a StructType message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns StructType - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.StructType; - - /** - * Verifies a StructType message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a StructType message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns StructType - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.StructType; - - /** - * Creates a plain object from a StructType message. Also converts values to other types if specified. - * @param message StructType - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.StructType, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this StructType to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for StructType - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace StructType { - - /** Properties of a Field. */ - interface IField { - - /** Field name */ - name?: (string|null); - - /** Field type */ - type?: (google.spanner.v1.IType|null); - } - - /** Represents a Field. */ - class Field implements IField { - - /** - * Constructs a new Field. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.StructType.IField); - - /** Field name. */ - public name: string; - - /** Field type. */ - public type?: (google.spanner.v1.IType|null); - - /** - * Creates a new Field instance using the specified properties. - * @param [properties] Properties to set - * @returns Field instance - */ - public static create(properties?: google.spanner.v1.StructType.IField): google.spanner.v1.StructType.Field; - - /** - * Encodes the specified Field message. Does not implicitly {@link google.spanner.v1.StructType.Field.verify|verify} messages. - * @param message Field message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.StructType.IField, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Field message, length delimited. Does not implicitly {@link google.spanner.v1.StructType.Field.verify|verify} messages. - * @param message Field message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.StructType.IField, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Field message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Field - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.StructType.Field; - - /** - * Decodes a Field message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Field - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.StructType.Field; - - /** - * Verifies a Field message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Field message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Field - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.StructType.Field; - - /** - * Creates a plain object from a Field message. Also converts values to other types if specified. - * @param message Field - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.StructType.Field, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Field to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Field - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** TypeCode enum. */ - enum TypeCode { - TYPE_CODE_UNSPECIFIED = 0, - BOOL = 1, - INT64 = 2, - FLOAT64 = 3, - FLOAT32 = 15, - TIMESTAMP = 4, - DATE = 5, - STRING = 6, - BYTES = 7, - ARRAY = 8, - STRUCT = 9, - NUMERIC = 10, - JSON = 11, - PROTO = 13, - ENUM = 14, - INTERVAL = 16, - UUID = 17 - } - - /** TypeAnnotationCode enum. */ - enum TypeAnnotationCode { - TYPE_ANNOTATION_CODE_UNSPECIFIED = 0, - PG_NUMERIC = 2, - PG_JSONB = 3, - PG_OID = 4 - } - - /** Properties of a CommitResponse. */ - interface ICommitResponse { - - /** CommitResponse commitTimestamp */ - commitTimestamp?: (google.protobuf.ITimestamp|null); - - /** CommitResponse commitStats */ - commitStats?: (google.spanner.v1.CommitResponse.ICommitStats|null); - - /** CommitResponse precommitToken */ - precommitToken?: (google.spanner.v1.IMultiplexedSessionPrecommitToken|null); - - /** CommitResponse snapshotTimestamp */ - snapshotTimestamp?: (google.protobuf.ITimestamp|null); - } - - /** Represents a CommitResponse. */ - class CommitResponse implements ICommitResponse { - - /** - * Constructs a new CommitResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.ICommitResponse); - - /** CommitResponse commitTimestamp. */ - public commitTimestamp?: (google.protobuf.ITimestamp|null); - - /** CommitResponse commitStats. */ - public commitStats?: (google.spanner.v1.CommitResponse.ICommitStats|null); - - /** CommitResponse precommitToken. */ - public precommitToken?: (google.spanner.v1.IMultiplexedSessionPrecommitToken|null); - - /** CommitResponse snapshotTimestamp. */ - public snapshotTimestamp?: (google.protobuf.ITimestamp|null); - - /** CommitResponse MultiplexedSessionRetry. */ - public MultiplexedSessionRetry?: "precommitToken"; - - /** - * Creates a new CommitResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns CommitResponse instance - */ - public static create(properties?: google.spanner.v1.ICommitResponse): google.spanner.v1.CommitResponse; - - /** - * Encodes the specified CommitResponse message. Does not implicitly {@link google.spanner.v1.CommitResponse.verify|verify} messages. - * @param message CommitResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.ICommitResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CommitResponse message, length delimited. Does not implicitly {@link google.spanner.v1.CommitResponse.verify|verify} messages. - * @param message CommitResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.ICommitResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CommitResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CommitResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.CommitResponse; - - /** - * Decodes a CommitResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CommitResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.CommitResponse; - - /** - * Verifies a CommitResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CommitResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CommitResponse - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.CommitResponse; - - /** - * Creates a plain object from a CommitResponse message. Also converts values to other types if specified. - * @param message CommitResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.CommitResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CommitResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CommitResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace CommitResponse { - - /** Properties of a CommitStats. */ - interface ICommitStats { - - /** CommitStats mutationCount */ - mutationCount?: (number|Long|string|null); - } - - /** Represents a CommitStats. */ - class CommitStats implements ICommitStats { - - /** - * Constructs a new CommitStats. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.CommitResponse.ICommitStats); - - /** CommitStats mutationCount. */ - public mutationCount: (number|Long|string); - - /** - * Creates a new CommitStats instance using the specified properties. - * @param [properties] Properties to set - * @returns CommitStats instance - */ - public static create(properties?: google.spanner.v1.CommitResponse.ICommitStats): google.spanner.v1.CommitResponse.CommitStats; - - /** - * Encodes the specified CommitStats message. Does not implicitly {@link google.spanner.v1.CommitResponse.CommitStats.verify|verify} messages. - * @param message CommitStats message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.CommitResponse.ICommitStats, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CommitStats message, length delimited. Does not implicitly {@link google.spanner.v1.CommitResponse.CommitStats.verify|verify} messages. - * @param message CommitStats message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.CommitResponse.ICommitStats, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CommitStats message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CommitStats - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.CommitResponse.CommitStats; - - /** - * Decodes a CommitStats message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CommitStats - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.CommitResponse.CommitStats; - - /** - * Verifies a CommitStats message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CommitStats message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CommitStats - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.CommitResponse.CommitStats; - - /** - * Creates a plain object from a CommitStats message. Also converts values to other types if specified. - * @param message CommitStats - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.CommitResponse.CommitStats, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CommitStats to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CommitStats - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a TransactionOptions. */ - interface ITransactionOptions { - - /** TransactionOptions readWrite */ - readWrite?: (google.spanner.v1.TransactionOptions.IReadWrite|null); - - /** TransactionOptions partitionedDml */ - partitionedDml?: (google.spanner.v1.TransactionOptions.IPartitionedDml|null); - - /** TransactionOptions readOnly */ - readOnly?: (google.spanner.v1.TransactionOptions.IReadOnly|null); - - /** TransactionOptions excludeTxnFromChangeStreams */ - excludeTxnFromChangeStreams?: (boolean|null); - - /** TransactionOptions isolationLevel */ - isolationLevel?: (google.spanner.v1.TransactionOptions.IsolationLevel|keyof typeof google.spanner.v1.TransactionOptions.IsolationLevel|null); - } - - /** Represents a TransactionOptions. */ - class TransactionOptions implements ITransactionOptions { - - /** - * Constructs a new TransactionOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.ITransactionOptions); - - /** TransactionOptions readWrite. */ - public readWrite?: (google.spanner.v1.TransactionOptions.IReadWrite|null); - - /** TransactionOptions partitionedDml. */ - public partitionedDml?: (google.spanner.v1.TransactionOptions.IPartitionedDml|null); - - /** TransactionOptions readOnly. */ - public readOnly?: (google.spanner.v1.TransactionOptions.IReadOnly|null); - - /** TransactionOptions excludeTxnFromChangeStreams. */ - public excludeTxnFromChangeStreams: boolean; - - /** TransactionOptions isolationLevel. */ - public isolationLevel: (google.spanner.v1.TransactionOptions.IsolationLevel|keyof typeof google.spanner.v1.TransactionOptions.IsolationLevel); - - /** TransactionOptions mode. */ - public mode?: ("readWrite"|"partitionedDml"|"readOnly"); - - /** - * Creates a new TransactionOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns TransactionOptions instance - */ - public static create(properties?: google.spanner.v1.ITransactionOptions): google.spanner.v1.TransactionOptions; - - /** - * Encodes the specified TransactionOptions message. Does not implicitly {@link google.spanner.v1.TransactionOptions.verify|verify} messages. - * @param message TransactionOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.ITransactionOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TransactionOptions message, length delimited. Does not implicitly {@link google.spanner.v1.TransactionOptions.verify|verify} messages. - * @param message TransactionOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.ITransactionOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TransactionOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TransactionOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.TransactionOptions; - - /** - * Decodes a TransactionOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TransactionOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.TransactionOptions; - - /** - * Verifies a TransactionOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TransactionOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TransactionOptions - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.TransactionOptions; - - /** - * Creates a plain object from a TransactionOptions message. Also converts values to other types if specified. - * @param message TransactionOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.TransactionOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TransactionOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TransactionOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace TransactionOptions { - - /** Properties of a ReadWrite. */ - interface IReadWrite { - - /** ReadWrite readLockMode */ - readLockMode?: (google.spanner.v1.TransactionOptions.ReadWrite.ReadLockMode|keyof typeof google.spanner.v1.TransactionOptions.ReadWrite.ReadLockMode|null); - - /** ReadWrite multiplexedSessionPreviousTransactionId */ - multiplexedSessionPreviousTransactionId?: (Uint8Array|Buffer|string|null); - } - - /** Represents a ReadWrite. */ - class ReadWrite implements IReadWrite { - - /** - * Constructs a new ReadWrite. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.TransactionOptions.IReadWrite); - - /** ReadWrite readLockMode. */ - public readLockMode: (google.spanner.v1.TransactionOptions.ReadWrite.ReadLockMode|keyof typeof google.spanner.v1.TransactionOptions.ReadWrite.ReadLockMode); - - /** ReadWrite multiplexedSessionPreviousTransactionId. */ - public multiplexedSessionPreviousTransactionId: (Uint8Array|Buffer|string); - - /** - * Creates a new ReadWrite instance using the specified properties. - * @param [properties] Properties to set - * @returns ReadWrite instance - */ - public static create(properties?: google.spanner.v1.TransactionOptions.IReadWrite): google.spanner.v1.TransactionOptions.ReadWrite; - - /** - * Encodes the specified ReadWrite message. Does not implicitly {@link google.spanner.v1.TransactionOptions.ReadWrite.verify|verify} messages. - * @param message ReadWrite message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.TransactionOptions.IReadWrite, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ReadWrite message, length delimited. Does not implicitly {@link google.spanner.v1.TransactionOptions.ReadWrite.verify|verify} messages. - * @param message ReadWrite message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.TransactionOptions.IReadWrite, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ReadWrite message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ReadWrite - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.TransactionOptions.ReadWrite; - - /** - * Decodes a ReadWrite message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ReadWrite - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.TransactionOptions.ReadWrite; - - /** - * Verifies a ReadWrite message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ReadWrite message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ReadWrite - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.TransactionOptions.ReadWrite; - - /** - * Creates a plain object from a ReadWrite message. Also converts values to other types if specified. - * @param message ReadWrite - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.TransactionOptions.ReadWrite, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ReadWrite to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ReadWrite - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ReadWrite { - - /** ReadLockMode enum. */ - enum ReadLockMode { - READ_LOCK_MODE_UNSPECIFIED = 0, - PESSIMISTIC = 1, - OPTIMISTIC = 2 - } - } - - /** Properties of a PartitionedDml. */ - interface IPartitionedDml { - } - - /** Represents a PartitionedDml. */ - class PartitionedDml implements IPartitionedDml { - - /** - * Constructs a new PartitionedDml. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.TransactionOptions.IPartitionedDml); - - /** - * Creates a new PartitionedDml instance using the specified properties. - * @param [properties] Properties to set - * @returns PartitionedDml instance - */ - public static create(properties?: google.spanner.v1.TransactionOptions.IPartitionedDml): google.spanner.v1.TransactionOptions.PartitionedDml; - - /** - * Encodes the specified PartitionedDml message. Does not implicitly {@link google.spanner.v1.TransactionOptions.PartitionedDml.verify|verify} messages. - * @param message PartitionedDml message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.TransactionOptions.IPartitionedDml, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PartitionedDml message, length delimited. Does not implicitly {@link google.spanner.v1.TransactionOptions.PartitionedDml.verify|verify} messages. - * @param message PartitionedDml message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.TransactionOptions.IPartitionedDml, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PartitionedDml message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PartitionedDml - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.TransactionOptions.PartitionedDml; - - /** - * Decodes a PartitionedDml message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PartitionedDml - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.TransactionOptions.PartitionedDml; - - /** - * Verifies a PartitionedDml message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PartitionedDml message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PartitionedDml - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.TransactionOptions.PartitionedDml; - - /** - * Creates a plain object from a PartitionedDml message. Also converts values to other types if specified. - * @param message PartitionedDml - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.TransactionOptions.PartitionedDml, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PartitionedDml to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PartitionedDml - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ReadOnly. */ - interface IReadOnly { - - /** ReadOnly strong */ - strong?: (boolean|null); - - /** ReadOnly minReadTimestamp */ - minReadTimestamp?: (google.protobuf.ITimestamp|null); - - /** ReadOnly maxStaleness */ - maxStaleness?: (google.protobuf.IDuration|null); - - /** ReadOnly readTimestamp */ - readTimestamp?: (google.protobuf.ITimestamp|null); - - /** ReadOnly exactStaleness */ - exactStaleness?: (google.protobuf.IDuration|null); - - /** ReadOnly returnReadTimestamp */ - returnReadTimestamp?: (boolean|null); - } - - /** Represents a ReadOnly. */ - class ReadOnly implements IReadOnly { - - /** - * Constructs a new ReadOnly. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.TransactionOptions.IReadOnly); - - /** ReadOnly strong. */ - public strong?: (boolean|null); - - /** ReadOnly minReadTimestamp. */ - public minReadTimestamp?: (google.protobuf.ITimestamp|null); - - /** ReadOnly maxStaleness. */ - public maxStaleness?: (google.protobuf.IDuration|null); - - /** ReadOnly readTimestamp. */ - public readTimestamp?: (google.protobuf.ITimestamp|null); - - /** ReadOnly exactStaleness. */ - public exactStaleness?: (google.protobuf.IDuration|null); - - /** ReadOnly returnReadTimestamp. */ - public returnReadTimestamp: boolean; - - /** ReadOnly timestampBound. */ - public timestampBound?: ("strong"|"minReadTimestamp"|"maxStaleness"|"readTimestamp"|"exactStaleness"); - - /** - * Creates a new ReadOnly instance using the specified properties. - * @param [properties] Properties to set - * @returns ReadOnly instance - */ - public static create(properties?: google.spanner.v1.TransactionOptions.IReadOnly): google.spanner.v1.TransactionOptions.ReadOnly; - - /** - * Encodes the specified ReadOnly message. Does not implicitly {@link google.spanner.v1.TransactionOptions.ReadOnly.verify|verify} messages. - * @param message ReadOnly message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.TransactionOptions.IReadOnly, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ReadOnly message, length delimited. Does not implicitly {@link google.spanner.v1.TransactionOptions.ReadOnly.verify|verify} messages. - * @param message ReadOnly message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.TransactionOptions.IReadOnly, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ReadOnly message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ReadOnly - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.TransactionOptions.ReadOnly; - - /** - * Decodes a ReadOnly message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ReadOnly - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.TransactionOptions.ReadOnly; - - /** - * Verifies a ReadOnly message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ReadOnly message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ReadOnly - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.TransactionOptions.ReadOnly; - - /** - * Creates a plain object from a ReadOnly message. Also converts values to other types if specified. - * @param message ReadOnly - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.TransactionOptions.ReadOnly, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ReadOnly to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ReadOnly - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** IsolationLevel enum. */ - enum IsolationLevel { - ISOLATION_LEVEL_UNSPECIFIED = 0, - SERIALIZABLE = 1, - REPEATABLE_READ = 2 - } - } - - /** Properties of a Transaction. */ - interface ITransaction { - - /** Transaction id */ - id?: (Uint8Array|Buffer|string|null); - - /** Transaction readTimestamp */ - readTimestamp?: (google.protobuf.ITimestamp|null); - - /** Transaction precommitToken */ - precommitToken?: (google.spanner.v1.IMultiplexedSessionPrecommitToken|null); - } - - /** Represents a Transaction. */ - class Transaction implements ITransaction { - - /** - * Constructs a new Transaction. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.ITransaction); - - /** Transaction id. */ - public id: (Uint8Array|Buffer|string); - - /** Transaction readTimestamp. */ - public readTimestamp?: (google.protobuf.ITimestamp|null); - - /** Transaction precommitToken. */ - public precommitToken?: (google.spanner.v1.IMultiplexedSessionPrecommitToken|null); - - /** - * Creates a new Transaction instance using the specified properties. - * @param [properties] Properties to set - * @returns Transaction instance - */ - public static create(properties?: google.spanner.v1.ITransaction): google.spanner.v1.Transaction; - - /** - * Encodes the specified Transaction message. Does not implicitly {@link google.spanner.v1.Transaction.verify|verify} messages. - * @param message Transaction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.ITransaction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Transaction message, length delimited. Does not implicitly {@link google.spanner.v1.Transaction.verify|verify} messages. - * @param message Transaction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.ITransaction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Transaction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Transaction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.Transaction; - - /** - * Decodes a Transaction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Transaction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.Transaction; - - /** - * Verifies a Transaction message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Transaction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Transaction - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.Transaction; - - /** - * Creates a plain object from a Transaction message. Also converts values to other types if specified. - * @param message Transaction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.Transaction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Transaction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Transaction - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a TransactionSelector. */ - interface ITransactionSelector { - - /** TransactionSelector singleUse */ - singleUse?: (google.spanner.v1.ITransactionOptions|null); - - /** TransactionSelector id */ - id?: (Uint8Array|Buffer|string|null); - - /** TransactionSelector begin */ - begin?: (google.spanner.v1.ITransactionOptions|null); - } - - /** Represents a TransactionSelector. */ - class TransactionSelector implements ITransactionSelector { - - /** - * Constructs a new TransactionSelector. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.ITransactionSelector); - - /** TransactionSelector singleUse. */ - public singleUse?: (google.spanner.v1.ITransactionOptions|null); - - /** TransactionSelector id. */ - public id?: (Uint8Array|Buffer|string|null); - - /** TransactionSelector begin. */ - public begin?: (google.spanner.v1.ITransactionOptions|null); - - /** TransactionSelector selector. */ - public selector?: ("singleUse"|"id"|"begin"); - - /** - * Creates a new TransactionSelector instance using the specified properties. - * @param [properties] Properties to set - * @returns TransactionSelector instance - */ - public static create(properties?: google.spanner.v1.ITransactionSelector): google.spanner.v1.TransactionSelector; - - /** - * Encodes the specified TransactionSelector message. Does not implicitly {@link google.spanner.v1.TransactionSelector.verify|verify} messages. - * @param message TransactionSelector message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.ITransactionSelector, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TransactionSelector message, length delimited. Does not implicitly {@link google.spanner.v1.TransactionSelector.verify|verify} messages. - * @param message TransactionSelector message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.ITransactionSelector, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TransactionSelector message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TransactionSelector - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.TransactionSelector; - - /** - * Decodes a TransactionSelector message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TransactionSelector - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.TransactionSelector; - - /** - * Verifies a TransactionSelector message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TransactionSelector message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TransactionSelector - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.TransactionSelector; - - /** - * Creates a plain object from a TransactionSelector message. Also converts values to other types if specified. - * @param message TransactionSelector - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.TransactionSelector, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TransactionSelector to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TransactionSelector - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a MultiplexedSessionPrecommitToken. */ - interface IMultiplexedSessionPrecommitToken { - - /** MultiplexedSessionPrecommitToken precommitToken */ - precommitToken?: (Uint8Array|Buffer|string|null); - - /** MultiplexedSessionPrecommitToken seqNum */ - seqNum?: (number|null); - } - - /** Represents a MultiplexedSessionPrecommitToken. */ - class MultiplexedSessionPrecommitToken implements IMultiplexedSessionPrecommitToken { - - /** - * Constructs a new MultiplexedSessionPrecommitToken. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.IMultiplexedSessionPrecommitToken); - - /** MultiplexedSessionPrecommitToken precommitToken. */ - public precommitToken: (Uint8Array|Buffer|string); - - /** MultiplexedSessionPrecommitToken seqNum. */ - public seqNum: number; - - /** - * Creates a new MultiplexedSessionPrecommitToken instance using the specified properties. - * @param [properties] Properties to set - * @returns MultiplexedSessionPrecommitToken instance - */ - public static create(properties?: google.spanner.v1.IMultiplexedSessionPrecommitToken): google.spanner.v1.MultiplexedSessionPrecommitToken; - - /** - * Encodes the specified MultiplexedSessionPrecommitToken message. Does not implicitly {@link google.spanner.v1.MultiplexedSessionPrecommitToken.verify|verify} messages. - * @param message MultiplexedSessionPrecommitToken message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.IMultiplexedSessionPrecommitToken, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MultiplexedSessionPrecommitToken message, length delimited. Does not implicitly {@link google.spanner.v1.MultiplexedSessionPrecommitToken.verify|verify} messages. - * @param message MultiplexedSessionPrecommitToken message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.IMultiplexedSessionPrecommitToken, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MultiplexedSessionPrecommitToken message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MultiplexedSessionPrecommitToken - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.MultiplexedSessionPrecommitToken; - - /** - * Decodes a MultiplexedSessionPrecommitToken message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MultiplexedSessionPrecommitToken - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.MultiplexedSessionPrecommitToken; - - /** - * Verifies a MultiplexedSessionPrecommitToken message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MultiplexedSessionPrecommitToken message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MultiplexedSessionPrecommitToken - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.MultiplexedSessionPrecommitToken; - - /** - * Creates a plain object from a MultiplexedSessionPrecommitToken message. Also converts values to other types if specified. - * @param message MultiplexedSessionPrecommitToken - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.MultiplexedSessionPrecommitToken, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MultiplexedSessionPrecommitToken to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MultiplexedSessionPrecommitToken - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a KeyRange. */ - interface IKeyRange { - - /** KeyRange startClosed */ - startClosed?: (google.protobuf.IListValue|null); - - /** KeyRange startOpen */ - startOpen?: (google.protobuf.IListValue|null); - - /** KeyRange endClosed */ - endClosed?: (google.protobuf.IListValue|null); - - /** KeyRange endOpen */ - endOpen?: (google.protobuf.IListValue|null); - } - - /** Represents a KeyRange. */ - class KeyRange implements IKeyRange { - - /** - * Constructs a new KeyRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.IKeyRange); - - /** KeyRange startClosed. */ - public startClosed?: (google.protobuf.IListValue|null); - - /** KeyRange startOpen. */ - public startOpen?: (google.protobuf.IListValue|null); - - /** KeyRange endClosed. */ - public endClosed?: (google.protobuf.IListValue|null); - - /** KeyRange endOpen. */ - public endOpen?: (google.protobuf.IListValue|null); - - /** KeyRange startKeyType. */ - public startKeyType?: ("startClosed"|"startOpen"); - - /** KeyRange endKeyType. */ - public endKeyType?: ("endClosed"|"endOpen"); - - /** - * Creates a new KeyRange instance using the specified properties. - * @param [properties] Properties to set - * @returns KeyRange instance - */ - public static create(properties?: google.spanner.v1.IKeyRange): google.spanner.v1.KeyRange; - - /** - * Encodes the specified KeyRange message. Does not implicitly {@link google.spanner.v1.KeyRange.verify|verify} messages. - * @param message KeyRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.IKeyRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified KeyRange message, length delimited. Does not implicitly {@link google.spanner.v1.KeyRange.verify|verify} messages. - * @param message KeyRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.IKeyRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a KeyRange message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns KeyRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.KeyRange; - - /** - * Decodes a KeyRange message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns KeyRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.KeyRange; - - /** - * Verifies a KeyRange message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a KeyRange message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns KeyRange - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.KeyRange; - - /** - * Creates a plain object from a KeyRange message. Also converts values to other types if specified. - * @param message KeyRange - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.KeyRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this KeyRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for KeyRange - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a KeySet. */ - interface IKeySet { - - /** KeySet keys */ - keys?: (google.protobuf.IListValue[]|null); - - /** KeySet ranges */ - ranges?: (google.spanner.v1.IKeyRange[]|null); - - /** KeySet all */ - all?: (boolean|null); - } - - /** Represents a KeySet. */ - class KeySet implements IKeySet { - - /** - * Constructs a new KeySet. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.IKeySet); - - /** KeySet keys. */ - public keys: google.protobuf.IListValue[]; - - /** KeySet ranges. */ - public ranges: google.spanner.v1.IKeyRange[]; - - /** KeySet all. */ - public all: boolean; - - /** - * Creates a new KeySet instance using the specified properties. - * @param [properties] Properties to set - * @returns KeySet instance - */ - public static create(properties?: google.spanner.v1.IKeySet): google.spanner.v1.KeySet; - - /** - * Encodes the specified KeySet message. Does not implicitly {@link google.spanner.v1.KeySet.verify|verify} messages. - * @param message KeySet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.IKeySet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified KeySet message, length delimited. Does not implicitly {@link google.spanner.v1.KeySet.verify|verify} messages. - * @param message KeySet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.IKeySet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a KeySet message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns KeySet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.KeySet; - - /** - * Decodes a KeySet message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns KeySet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.KeySet; - - /** - * Verifies a KeySet message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a KeySet message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns KeySet - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.KeySet; - - /** - * Creates a plain object from a KeySet message. Also converts values to other types if specified. - * @param message KeySet - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.KeySet, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this KeySet to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for KeySet - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Range. */ - interface IRange { - - /** Range startKey */ - startKey?: (Uint8Array|Buffer|string|null); - - /** Range limitKey */ - limitKey?: (Uint8Array|Buffer|string|null); - - /** Range groupUid */ - groupUid?: (number|Long|string|null); - - /** Range splitId */ - splitId?: (number|Long|string|null); - - /** Range generation */ - generation?: (Uint8Array|Buffer|string|null); - } - - /** Represents a Range. */ - class Range implements IRange { - - /** - * Constructs a new Range. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.IRange); - - /** Range startKey. */ - public startKey: (Uint8Array|Buffer|string); - - /** Range limitKey. */ - public limitKey: (Uint8Array|Buffer|string); - - /** Range groupUid. */ - public groupUid: (number|Long|string); - - /** Range splitId. */ - public splitId: (number|Long|string); - - /** Range generation. */ - public generation: (Uint8Array|Buffer|string); - - /** - * Creates a new Range instance using the specified properties. - * @param [properties] Properties to set - * @returns Range instance - */ - public static create(properties?: google.spanner.v1.IRange): google.spanner.v1.Range; - - /** - * Encodes the specified Range message. Does not implicitly {@link google.spanner.v1.Range.verify|verify} messages. - * @param message Range message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.IRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Range message, length delimited. Does not implicitly {@link google.spanner.v1.Range.verify|verify} messages. - * @param message Range message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.IRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Range message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Range - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.Range; - - /** - * Decodes a Range message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Range - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.Range; - - /** - * Verifies a Range message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Range message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Range - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.Range; - - /** - * Creates a plain object from a Range message. Also converts values to other types if specified. - * @param message Range - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.Range, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Range to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Range - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Tablet. */ - interface ITablet { - - /** Tablet tabletUid */ - tabletUid?: (number|Long|string|null); - - /** Tablet serverAddress */ - serverAddress?: (string|null); - - /** Tablet location */ - location?: (string|null); - - /** Tablet role */ - role?: (google.spanner.v1.Tablet.Role|keyof typeof google.spanner.v1.Tablet.Role|null); - - /** Tablet incarnation */ - incarnation?: (Uint8Array|Buffer|string|null); - - /** Tablet distance */ - distance?: (number|null); - - /** Tablet skip */ - skip?: (boolean|null); - } - - /** Represents a Tablet. */ - class Tablet implements ITablet { - - /** - * Constructs a new Tablet. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.ITablet); - - /** Tablet tabletUid. */ - public tabletUid: (number|Long|string); - - /** Tablet serverAddress. */ - public serverAddress: string; - - /** Tablet location. */ - public location: string; - - /** Tablet role. */ - public role: (google.spanner.v1.Tablet.Role|keyof typeof google.spanner.v1.Tablet.Role); - - /** Tablet incarnation. */ - public incarnation: (Uint8Array|Buffer|string); - - /** Tablet distance. */ - public distance: number; - - /** Tablet skip. */ - public skip: boolean; - - /** - * Creates a new Tablet instance using the specified properties. - * @param [properties] Properties to set - * @returns Tablet instance - */ - public static create(properties?: google.spanner.v1.ITablet): google.spanner.v1.Tablet; - - /** - * Encodes the specified Tablet message. Does not implicitly {@link google.spanner.v1.Tablet.verify|verify} messages. - * @param message Tablet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.ITablet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Tablet message, length delimited. Does not implicitly {@link google.spanner.v1.Tablet.verify|verify} messages. - * @param message Tablet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.ITablet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Tablet message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Tablet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.Tablet; - - /** - * Decodes a Tablet message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Tablet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.Tablet; - - /** - * Verifies a Tablet message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Tablet message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Tablet - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.Tablet; - - /** - * Creates a plain object from a Tablet message. Also converts values to other types if specified. - * @param message Tablet - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.Tablet, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Tablet to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Tablet - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Tablet { - - /** Role enum. */ - enum Role { - ROLE_UNSPECIFIED = 0, - READ_WRITE = 1, - READ_ONLY = 2 - } - } - - /** Properties of a Group. */ - interface IGroup { - - /** Group groupUid */ - groupUid?: (number|Long|string|null); - - /** Group tablets */ - tablets?: (google.spanner.v1.ITablet[]|null); - - /** Group leaderIndex */ - leaderIndex?: (number|null); - - /** Group generation */ - generation?: (Uint8Array|Buffer|string|null); - } - - /** Represents a Group. */ - class Group implements IGroup { - - /** - * Constructs a new Group. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.IGroup); - - /** Group groupUid. */ - public groupUid: (number|Long|string); - - /** Group tablets. */ - public tablets: google.spanner.v1.ITablet[]; - - /** Group leaderIndex. */ - public leaderIndex: number; - - /** Group generation. */ - public generation: (Uint8Array|Buffer|string); - - /** - * Creates a new Group instance using the specified properties. - * @param [properties] Properties to set - * @returns Group instance - */ - public static create(properties?: google.spanner.v1.IGroup): google.spanner.v1.Group; - - /** - * Encodes the specified Group message. Does not implicitly {@link google.spanner.v1.Group.verify|verify} messages. - * @param message Group message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.IGroup, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Group message, length delimited. Does not implicitly {@link google.spanner.v1.Group.verify|verify} messages. - * @param message Group message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.IGroup, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Group message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Group - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.Group; - - /** - * Decodes a Group message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Group - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.Group; - - /** - * Verifies a Group message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Group message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Group - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.Group; - - /** - * Creates a plain object from a Group message. Also converts values to other types if specified. - * @param message Group - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.Group, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Group to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Group - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a KeyRecipe. */ - interface IKeyRecipe { - - /** KeyRecipe tableName */ - tableName?: (string|null); - - /** KeyRecipe indexName */ - indexName?: (string|null); - - /** KeyRecipe operationUid */ - operationUid?: (number|Long|string|null); - - /** KeyRecipe part */ - part?: (google.spanner.v1.KeyRecipe.IPart[]|null); - } - - /** Represents a KeyRecipe. */ - class KeyRecipe implements IKeyRecipe { - - /** - * Constructs a new KeyRecipe. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.IKeyRecipe); - - /** KeyRecipe tableName. */ - public tableName?: (string|null); - - /** KeyRecipe indexName. */ - public indexName?: (string|null); - - /** KeyRecipe operationUid. */ - public operationUid?: (number|Long|string|null); - - /** KeyRecipe part. */ - public part: google.spanner.v1.KeyRecipe.IPart[]; - - /** KeyRecipe target. */ - public target?: ("tableName"|"indexName"|"operationUid"); - - /** - * Creates a new KeyRecipe instance using the specified properties. - * @param [properties] Properties to set - * @returns KeyRecipe instance - */ - public static create(properties?: google.spanner.v1.IKeyRecipe): google.spanner.v1.KeyRecipe; - - /** - * Encodes the specified KeyRecipe message. Does not implicitly {@link google.spanner.v1.KeyRecipe.verify|verify} messages. - * @param message KeyRecipe message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.IKeyRecipe, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified KeyRecipe message, length delimited. Does not implicitly {@link google.spanner.v1.KeyRecipe.verify|verify} messages. - * @param message KeyRecipe message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.IKeyRecipe, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a KeyRecipe message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns KeyRecipe - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.KeyRecipe; - - /** - * Decodes a KeyRecipe message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns KeyRecipe - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.KeyRecipe; - - /** - * Verifies a KeyRecipe message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a KeyRecipe message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns KeyRecipe - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.KeyRecipe; - - /** - * Creates a plain object from a KeyRecipe message. Also converts values to other types if specified. - * @param message KeyRecipe - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.KeyRecipe, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this KeyRecipe to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for KeyRecipe - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace KeyRecipe { - - /** Properties of a Part. */ - interface IPart { - - /** Part tag */ - tag?: (number|null); - - /** Part order */ - order?: (google.spanner.v1.KeyRecipe.Part.Order|keyof typeof google.spanner.v1.KeyRecipe.Part.Order|null); - - /** Part nullOrder */ - nullOrder?: (google.spanner.v1.KeyRecipe.Part.NullOrder|keyof typeof google.spanner.v1.KeyRecipe.Part.NullOrder|null); - - /** Part type */ - type?: (google.spanner.v1.IType|null); - - /** Part identifier */ - identifier?: (string|null); - - /** Part value */ - value?: (google.protobuf.IValue|null); - - /** Part random */ - random?: (boolean|null); - - /** Part structIdentifiers */ - structIdentifiers?: (number[]|null); - } - - /** Represents a Part. */ - class Part implements IPart { - - /** - * Constructs a new Part. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.KeyRecipe.IPart); - - /** Part tag. */ - public tag: number; - - /** Part order. */ - public order: (google.spanner.v1.KeyRecipe.Part.Order|keyof typeof google.spanner.v1.KeyRecipe.Part.Order); - - /** Part nullOrder. */ - public nullOrder: (google.spanner.v1.KeyRecipe.Part.NullOrder|keyof typeof google.spanner.v1.KeyRecipe.Part.NullOrder); - - /** Part type. */ - public type?: (google.spanner.v1.IType|null); - - /** Part identifier. */ - public identifier?: (string|null); - - /** Part value. */ - public value?: (google.protobuf.IValue|null); - - /** Part random. */ - public random?: (boolean|null); - - /** Part structIdentifiers. */ - public structIdentifiers: number[]; - - /** Part valueType. */ - public valueType?: ("identifier"|"value"|"random"); - - /** - * Creates a new Part instance using the specified properties. - * @param [properties] Properties to set - * @returns Part instance - */ - public static create(properties?: google.spanner.v1.KeyRecipe.IPart): google.spanner.v1.KeyRecipe.Part; - - /** - * Encodes the specified Part message. Does not implicitly {@link google.spanner.v1.KeyRecipe.Part.verify|verify} messages. - * @param message Part message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.KeyRecipe.IPart, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Part message, length delimited. Does not implicitly {@link google.spanner.v1.KeyRecipe.Part.verify|verify} messages. - * @param message Part message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.KeyRecipe.IPart, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Part message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Part - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.KeyRecipe.Part; - - /** - * Decodes a Part message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Part - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.KeyRecipe.Part; - - /** - * Verifies a Part message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Part message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Part - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.KeyRecipe.Part; - - /** - * Creates a plain object from a Part message. Also converts values to other types if specified. - * @param message Part - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.KeyRecipe.Part, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Part to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Part - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Part { - - /** Order enum. */ - enum Order { - ORDER_UNSPECIFIED = 0, - ASCENDING = 1, - DESCENDING = 2 - } - - /** NullOrder enum. */ - enum NullOrder { - NULL_ORDER_UNSPECIFIED = 0, - NULLS_FIRST = 1, - NULLS_LAST = 2, - NOT_NULL = 3 - } - } - } - - /** Properties of a RecipeList. */ - interface IRecipeList { - - /** RecipeList schemaGeneration */ - schemaGeneration?: (Uint8Array|Buffer|string|null); - - /** RecipeList recipe */ - recipe?: (google.spanner.v1.IKeyRecipe[]|null); - } - - /** Represents a RecipeList. */ - class RecipeList implements IRecipeList { - - /** - * Constructs a new RecipeList. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.IRecipeList); - - /** RecipeList schemaGeneration. */ - public schemaGeneration: (Uint8Array|Buffer|string); - - /** RecipeList recipe. */ - public recipe: google.spanner.v1.IKeyRecipe[]; - - /** - * Creates a new RecipeList instance using the specified properties. - * @param [properties] Properties to set - * @returns RecipeList instance - */ - public static create(properties?: google.spanner.v1.IRecipeList): google.spanner.v1.RecipeList; - - /** - * Encodes the specified RecipeList message. Does not implicitly {@link google.spanner.v1.RecipeList.verify|verify} messages. - * @param message RecipeList message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.IRecipeList, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RecipeList message, length delimited. Does not implicitly {@link google.spanner.v1.RecipeList.verify|verify} messages. - * @param message RecipeList message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.IRecipeList, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RecipeList message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RecipeList - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.RecipeList; - - /** - * Decodes a RecipeList message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RecipeList - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.RecipeList; - - /** - * Verifies a RecipeList message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RecipeList message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RecipeList - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.RecipeList; - - /** - * Creates a plain object from a RecipeList message. Also converts values to other types if specified. - * @param message RecipeList - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.RecipeList, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RecipeList to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RecipeList - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CacheUpdate. */ - interface ICacheUpdate { - - /** CacheUpdate databaseId */ - databaseId?: (number|Long|string|null); - - /** CacheUpdate range */ - range?: (google.spanner.v1.IRange[]|null); - - /** CacheUpdate group */ - group?: (google.spanner.v1.IGroup[]|null); - - /** CacheUpdate keyRecipes */ - keyRecipes?: (google.spanner.v1.IRecipeList|null); - } - - /** Represents a CacheUpdate. */ - class CacheUpdate implements ICacheUpdate { - - /** - * Constructs a new CacheUpdate. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.ICacheUpdate); - - /** CacheUpdate databaseId. */ - public databaseId: (number|Long|string); - - /** CacheUpdate range. */ - public range: google.spanner.v1.IRange[]; - - /** CacheUpdate group. */ - public group: google.spanner.v1.IGroup[]; - - /** CacheUpdate keyRecipes. */ - public keyRecipes?: (google.spanner.v1.IRecipeList|null); - - /** - * Creates a new CacheUpdate instance using the specified properties. - * @param [properties] Properties to set - * @returns CacheUpdate instance - */ - public static create(properties?: google.spanner.v1.ICacheUpdate): google.spanner.v1.CacheUpdate; - - /** - * Encodes the specified CacheUpdate message. Does not implicitly {@link google.spanner.v1.CacheUpdate.verify|verify} messages. - * @param message CacheUpdate message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.ICacheUpdate, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CacheUpdate message, length delimited. Does not implicitly {@link google.spanner.v1.CacheUpdate.verify|verify} messages. - * @param message CacheUpdate message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.ICacheUpdate, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CacheUpdate message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CacheUpdate - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.CacheUpdate; - - /** - * Decodes a CacheUpdate message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CacheUpdate - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.CacheUpdate; - - /** - * Verifies a CacheUpdate message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CacheUpdate message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CacheUpdate - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.CacheUpdate; - - /** - * Creates a plain object from a CacheUpdate message. Also converts values to other types if specified. - * @param message CacheUpdate - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.CacheUpdate, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CacheUpdate to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CacheUpdate - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RoutingHint. */ - interface IRoutingHint { - - /** RoutingHint operationUid */ - operationUid?: (number|Long|string|null); - - /** RoutingHint databaseId */ - databaseId?: (number|Long|string|null); - - /** RoutingHint schemaGeneration */ - schemaGeneration?: (Uint8Array|Buffer|string|null); - - /** RoutingHint key */ - key?: (Uint8Array|Buffer|string|null); - - /** RoutingHint limitKey */ - limitKey?: (Uint8Array|Buffer|string|null); - - /** RoutingHint groupUid */ - groupUid?: (number|Long|string|null); - - /** RoutingHint splitId */ - splitId?: (number|Long|string|null); - - /** RoutingHint tabletUid */ - tabletUid?: (number|Long|string|null); - - /** RoutingHint skippedTabletUid */ - skippedTabletUid?: (google.spanner.v1.RoutingHint.ISkippedTablet[]|null); - - /** RoutingHint clientLocation */ - clientLocation?: (string|null); - } - - /** Represents a RoutingHint. */ - class RoutingHint implements IRoutingHint { - - /** - * Constructs a new RoutingHint. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.IRoutingHint); - - /** RoutingHint operationUid. */ - public operationUid: (number|Long|string); - - /** RoutingHint databaseId. */ - public databaseId: (number|Long|string); - - /** RoutingHint schemaGeneration. */ - public schemaGeneration: (Uint8Array|Buffer|string); - - /** RoutingHint key. */ - public key: (Uint8Array|Buffer|string); - - /** RoutingHint limitKey. */ - public limitKey: (Uint8Array|Buffer|string); - - /** RoutingHint groupUid. */ - public groupUid: (number|Long|string); - - /** RoutingHint splitId. */ - public splitId: (number|Long|string); - - /** RoutingHint tabletUid. */ - public tabletUid: (number|Long|string); - - /** RoutingHint skippedTabletUid. */ - public skippedTabletUid: google.spanner.v1.RoutingHint.ISkippedTablet[]; - - /** RoutingHint clientLocation. */ - public clientLocation: string; - - /** - * Creates a new RoutingHint instance using the specified properties. - * @param [properties] Properties to set - * @returns RoutingHint instance - */ - public static create(properties?: google.spanner.v1.IRoutingHint): google.spanner.v1.RoutingHint; - - /** - * Encodes the specified RoutingHint message. Does not implicitly {@link google.spanner.v1.RoutingHint.verify|verify} messages. - * @param message RoutingHint message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.IRoutingHint, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RoutingHint message, length delimited. Does not implicitly {@link google.spanner.v1.RoutingHint.verify|verify} messages. - * @param message RoutingHint message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.IRoutingHint, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RoutingHint message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RoutingHint - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.RoutingHint; - - /** - * Decodes a RoutingHint message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RoutingHint - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.RoutingHint; - - /** - * Verifies a RoutingHint message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RoutingHint message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RoutingHint - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.RoutingHint; - - /** - * Creates a plain object from a RoutingHint message. Also converts values to other types if specified. - * @param message RoutingHint - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.RoutingHint, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RoutingHint to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RoutingHint - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace RoutingHint { - - /** Properties of a SkippedTablet. */ - interface ISkippedTablet { - - /** SkippedTablet tabletUid */ - tabletUid?: (number|Long|string|null); - - /** SkippedTablet incarnation */ - incarnation?: (Uint8Array|Buffer|string|null); - } - - /** Represents a SkippedTablet. */ - class SkippedTablet implements ISkippedTablet { - - /** - * Constructs a new SkippedTablet. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.RoutingHint.ISkippedTablet); - - /** SkippedTablet tabletUid. */ - public tabletUid: (number|Long|string); - - /** SkippedTablet incarnation. */ - public incarnation: (Uint8Array|Buffer|string); - - /** - * Creates a new SkippedTablet instance using the specified properties. - * @param [properties] Properties to set - * @returns SkippedTablet instance - */ - public static create(properties?: google.spanner.v1.RoutingHint.ISkippedTablet): google.spanner.v1.RoutingHint.SkippedTablet; - - /** - * Encodes the specified SkippedTablet message. Does not implicitly {@link google.spanner.v1.RoutingHint.SkippedTablet.verify|verify} messages. - * @param message SkippedTablet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.RoutingHint.ISkippedTablet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SkippedTablet message, length delimited. Does not implicitly {@link google.spanner.v1.RoutingHint.SkippedTablet.verify|verify} messages. - * @param message SkippedTablet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.RoutingHint.ISkippedTablet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SkippedTablet message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SkippedTablet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.RoutingHint.SkippedTablet; - - /** - * Decodes a SkippedTablet message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SkippedTablet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.RoutingHint.SkippedTablet; - - /** - * Verifies a SkippedTablet message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SkippedTablet message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SkippedTablet - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.RoutingHint.SkippedTablet; - - /** - * Creates a plain object from a SkippedTablet message. Also converts values to other types if specified. - * @param message SkippedTablet - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.RoutingHint.SkippedTablet, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SkippedTablet to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SkippedTablet - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a Mutation. */ - interface IMutation { - - /** Mutation insert */ - insert?: (google.spanner.v1.Mutation.IWrite|null); - - /** Mutation update */ - update?: (google.spanner.v1.Mutation.IWrite|null); - - /** Mutation insertOrUpdate */ - insertOrUpdate?: (google.spanner.v1.Mutation.IWrite|null); - - /** Mutation replace */ - replace?: (google.spanner.v1.Mutation.IWrite|null); - - /** Mutation delete */ - "delete"?: (google.spanner.v1.Mutation.IDelete|null); - - /** Mutation send */ - send?: (google.spanner.v1.Mutation.ISend|null); - - /** Mutation ack */ - ack?: (google.spanner.v1.Mutation.IAck|null); - } - - /** Represents a Mutation. */ - class Mutation implements IMutation { - - /** - * Constructs a new Mutation. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.IMutation); - - /** Mutation insert. */ - public insert?: (google.spanner.v1.Mutation.IWrite|null); - - /** Mutation update. */ - public update?: (google.spanner.v1.Mutation.IWrite|null); - - /** Mutation insertOrUpdate. */ - public insertOrUpdate?: (google.spanner.v1.Mutation.IWrite|null); - - /** Mutation replace. */ - public replace?: (google.spanner.v1.Mutation.IWrite|null); - - /** Mutation delete. */ - public delete?: (google.spanner.v1.Mutation.IDelete|null); - - /** Mutation send. */ - public send?: (google.spanner.v1.Mutation.ISend|null); - - /** Mutation ack. */ - public ack?: (google.spanner.v1.Mutation.IAck|null); - - /** Mutation operation. */ - public operation?: ("insert"|"update"|"insertOrUpdate"|"replace"|"delete"|"send"|"ack"); - - /** - * Creates a new Mutation instance using the specified properties. - * @param [properties] Properties to set - * @returns Mutation instance - */ - public static create(properties?: google.spanner.v1.IMutation): google.spanner.v1.Mutation; - - /** - * Encodes the specified Mutation message. Does not implicitly {@link google.spanner.v1.Mutation.verify|verify} messages. - * @param message Mutation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.IMutation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Mutation message, length delimited. Does not implicitly {@link google.spanner.v1.Mutation.verify|verify} messages. - * @param message Mutation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.IMutation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Mutation message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Mutation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.Mutation; - - /** - * Decodes a Mutation message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Mutation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.Mutation; - - /** - * Verifies a Mutation message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Mutation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Mutation - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.Mutation; - - /** - * Creates a plain object from a Mutation message. Also converts values to other types if specified. - * @param message Mutation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.Mutation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Mutation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Mutation - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Mutation { - - /** Properties of a Write. */ - interface IWrite { - - /** Write table */ - table?: (string|null); - - /** Write columns */ - columns?: (string[]|null); - - /** Write values */ - values?: (google.protobuf.IListValue[]|null); - } - - /** Represents a Write. */ - class Write implements IWrite { - - /** - * Constructs a new Write. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.Mutation.IWrite); - - /** Write table. */ - public table: string; - - /** Write columns. */ - public columns: string[]; - - /** Write values. */ - public values: google.protobuf.IListValue[]; - - /** - * Creates a new Write instance using the specified properties. - * @param [properties] Properties to set - * @returns Write instance - */ - public static create(properties?: google.spanner.v1.Mutation.IWrite): google.spanner.v1.Mutation.Write; - - /** - * Encodes the specified Write message. Does not implicitly {@link google.spanner.v1.Mutation.Write.verify|verify} messages. - * @param message Write message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.Mutation.IWrite, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Write message, length delimited. Does not implicitly {@link google.spanner.v1.Mutation.Write.verify|verify} messages. - * @param message Write message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.Mutation.IWrite, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Write message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Write - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.Mutation.Write; - - /** - * Decodes a Write message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Write - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.Mutation.Write; - - /** - * Verifies a Write message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Write message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Write - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.Mutation.Write; - - /** - * Creates a plain object from a Write message. Also converts values to other types if specified. - * @param message Write - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.Mutation.Write, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Write to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Write - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Delete. */ - interface IDelete { - - /** Delete table */ - table?: (string|null); - - /** Delete keySet */ - keySet?: (google.spanner.v1.IKeySet|null); - } - - /** Represents a Delete. */ - class Delete implements IDelete { - - /** - * Constructs a new Delete. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.Mutation.IDelete); - - /** Delete table. */ - public table: string; - - /** Delete keySet. */ - public keySet?: (google.spanner.v1.IKeySet|null); - - /** - * Creates a new Delete instance using the specified properties. - * @param [properties] Properties to set - * @returns Delete instance - */ - public static create(properties?: google.spanner.v1.Mutation.IDelete): google.spanner.v1.Mutation.Delete; - - /** - * Encodes the specified Delete message. Does not implicitly {@link google.spanner.v1.Mutation.Delete.verify|verify} messages. - * @param message Delete message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.Mutation.IDelete, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Delete message, length delimited. Does not implicitly {@link google.spanner.v1.Mutation.Delete.verify|verify} messages. - * @param message Delete message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.Mutation.IDelete, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Delete message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Delete - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.Mutation.Delete; - - /** - * Decodes a Delete message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Delete - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.Mutation.Delete; - - /** - * Verifies a Delete message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Delete message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Delete - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.Mutation.Delete; - - /** - * Creates a plain object from a Delete message. Also converts values to other types if specified. - * @param message Delete - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.Mutation.Delete, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Delete to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Delete - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Send. */ - interface ISend { - - /** Send queue */ - queue?: (string|null); - - /** Send key */ - key?: (google.protobuf.IListValue|null); - - /** Send deliverTime */ - deliverTime?: (google.protobuf.ITimestamp|null); - - /** Send payload */ - payload?: (google.protobuf.IValue|null); - } - - /** Represents a Send. */ - class Send implements ISend { - - /** - * Constructs a new Send. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.Mutation.ISend); - - /** Send queue. */ - public queue: string; - - /** Send key. */ - public key?: (google.protobuf.IListValue|null); - - /** Send deliverTime. */ - public deliverTime?: (google.protobuf.ITimestamp|null); - - /** Send payload. */ - public payload?: (google.protobuf.IValue|null); - - /** - * Creates a new Send instance using the specified properties. - * @param [properties] Properties to set - * @returns Send instance - */ - public static create(properties?: google.spanner.v1.Mutation.ISend): google.spanner.v1.Mutation.Send; - - /** - * Encodes the specified Send message. Does not implicitly {@link google.spanner.v1.Mutation.Send.verify|verify} messages. - * @param message Send message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.Mutation.ISend, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Send message, length delimited. Does not implicitly {@link google.spanner.v1.Mutation.Send.verify|verify} messages. - * @param message Send message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.Mutation.ISend, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Send message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Send - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.Mutation.Send; - - /** - * Decodes a Send message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Send - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.Mutation.Send; - - /** - * Verifies a Send message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Send message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Send - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.Mutation.Send; - - /** - * Creates a plain object from a Send message. Also converts values to other types if specified. - * @param message Send - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.Mutation.Send, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Send to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Send - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an Ack. */ - interface IAck { - - /** Ack queue */ - queue?: (string|null); - - /** Ack key */ - key?: (google.protobuf.IListValue|null); - - /** Ack ignoreNotFound */ - ignoreNotFound?: (boolean|null); - } - - /** Represents an Ack. */ - class Ack implements IAck { - - /** - * Constructs a new Ack. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.Mutation.IAck); - - /** Ack queue. */ - public queue: string; - - /** Ack key. */ - public key?: (google.protobuf.IListValue|null); - - /** Ack ignoreNotFound. */ - public ignoreNotFound: boolean; - - /** - * Creates a new Ack instance using the specified properties. - * @param [properties] Properties to set - * @returns Ack instance - */ - public static create(properties?: google.spanner.v1.Mutation.IAck): google.spanner.v1.Mutation.Ack; - - /** - * Encodes the specified Ack message. Does not implicitly {@link google.spanner.v1.Mutation.Ack.verify|verify} messages. - * @param message Ack message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.Mutation.IAck, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Ack message, length delimited. Does not implicitly {@link google.spanner.v1.Mutation.Ack.verify|verify} messages. - * @param message Ack message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.Mutation.IAck, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Ack message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Ack - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.Mutation.Ack; - - /** - * Decodes an Ack message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Ack - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.Mutation.Ack; - - /** - * Verifies an Ack message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Ack message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Ack - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.Mutation.Ack; - - /** - * Creates a plain object from an Ack message. Also converts values to other types if specified. - * @param message Ack - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.Mutation.Ack, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Ack to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Ack - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a PlanNode. */ - interface IPlanNode { - - /** PlanNode index */ - index?: (number|null); - - /** PlanNode kind */ - kind?: (google.spanner.v1.PlanNode.Kind|keyof typeof google.spanner.v1.PlanNode.Kind|null); - - /** PlanNode displayName */ - displayName?: (string|null); - - /** PlanNode childLinks */ - childLinks?: (google.spanner.v1.PlanNode.IChildLink[]|null); - - /** PlanNode shortRepresentation */ - shortRepresentation?: (google.spanner.v1.PlanNode.IShortRepresentation|null); - - /** PlanNode metadata */ - metadata?: (google.protobuf.IStruct|null); - - /** PlanNode executionStats */ - executionStats?: (google.protobuf.IStruct|null); - } - - /** Represents a PlanNode. */ - class PlanNode implements IPlanNode { - - /** - * Constructs a new PlanNode. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.IPlanNode); - - /** PlanNode index. */ - public index: number; - - /** PlanNode kind. */ - public kind: (google.spanner.v1.PlanNode.Kind|keyof typeof google.spanner.v1.PlanNode.Kind); - - /** PlanNode displayName. */ - public displayName: string; - - /** PlanNode childLinks. */ - public childLinks: google.spanner.v1.PlanNode.IChildLink[]; - - /** PlanNode shortRepresentation. */ - public shortRepresentation?: (google.spanner.v1.PlanNode.IShortRepresentation|null); - - /** PlanNode metadata. */ - public metadata?: (google.protobuf.IStruct|null); - - /** PlanNode executionStats. */ - public executionStats?: (google.protobuf.IStruct|null); - - /** - * Creates a new PlanNode instance using the specified properties. - * @param [properties] Properties to set - * @returns PlanNode instance - */ - public static create(properties?: google.spanner.v1.IPlanNode): google.spanner.v1.PlanNode; - - /** - * Encodes the specified PlanNode message. Does not implicitly {@link google.spanner.v1.PlanNode.verify|verify} messages. - * @param message PlanNode message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.IPlanNode, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PlanNode message, length delimited. Does not implicitly {@link google.spanner.v1.PlanNode.verify|verify} messages. - * @param message PlanNode message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.IPlanNode, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PlanNode message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PlanNode - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.PlanNode; - - /** - * Decodes a PlanNode message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PlanNode - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.PlanNode; - - /** - * Verifies a PlanNode message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PlanNode message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PlanNode - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.PlanNode; - - /** - * Creates a plain object from a PlanNode message. Also converts values to other types if specified. - * @param message PlanNode - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.PlanNode, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PlanNode to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PlanNode - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace PlanNode { - - /** Kind enum. */ - enum Kind { - KIND_UNSPECIFIED = 0, - RELATIONAL = 1, - SCALAR = 2 - } - - /** Properties of a ChildLink. */ - interface IChildLink { - - /** ChildLink childIndex */ - childIndex?: (number|null); - - /** ChildLink type */ - type?: (string|null); - - /** ChildLink variable */ - variable?: (string|null); - } - - /** Represents a ChildLink. */ - class ChildLink implements IChildLink { - - /** - * Constructs a new ChildLink. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.PlanNode.IChildLink); - - /** ChildLink childIndex. */ - public childIndex: number; - - /** ChildLink type. */ - public type: string; - - /** ChildLink variable. */ - public variable: string; - - /** - * Creates a new ChildLink instance using the specified properties. - * @param [properties] Properties to set - * @returns ChildLink instance - */ - public static create(properties?: google.spanner.v1.PlanNode.IChildLink): google.spanner.v1.PlanNode.ChildLink; - - /** - * Encodes the specified ChildLink message. Does not implicitly {@link google.spanner.v1.PlanNode.ChildLink.verify|verify} messages. - * @param message ChildLink message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.PlanNode.IChildLink, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ChildLink message, length delimited. Does not implicitly {@link google.spanner.v1.PlanNode.ChildLink.verify|verify} messages. - * @param message ChildLink message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.PlanNode.IChildLink, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ChildLink message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ChildLink - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.PlanNode.ChildLink; - - /** - * Decodes a ChildLink message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ChildLink - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.PlanNode.ChildLink; - - /** - * Verifies a ChildLink message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ChildLink message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ChildLink - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.PlanNode.ChildLink; - - /** - * Creates a plain object from a ChildLink message. Also converts values to other types if specified. - * @param message ChildLink - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.PlanNode.ChildLink, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ChildLink to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ChildLink - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ShortRepresentation. */ - interface IShortRepresentation { - - /** ShortRepresentation description */ - description?: (string|null); - - /** ShortRepresentation subqueries */ - subqueries?: ({ [k: string]: number }|null); - } - - /** Represents a ShortRepresentation. */ - class ShortRepresentation implements IShortRepresentation { - - /** - * Constructs a new ShortRepresentation. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.PlanNode.IShortRepresentation); - - /** ShortRepresentation description. */ - public description: string; - - /** ShortRepresentation subqueries. */ - public subqueries: { [k: string]: number }; - - /** - * Creates a new ShortRepresentation instance using the specified properties. - * @param [properties] Properties to set - * @returns ShortRepresentation instance - */ - public static create(properties?: google.spanner.v1.PlanNode.IShortRepresentation): google.spanner.v1.PlanNode.ShortRepresentation; - - /** - * Encodes the specified ShortRepresentation message. Does not implicitly {@link google.spanner.v1.PlanNode.ShortRepresentation.verify|verify} messages. - * @param message ShortRepresentation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.PlanNode.IShortRepresentation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ShortRepresentation message, length delimited. Does not implicitly {@link google.spanner.v1.PlanNode.ShortRepresentation.verify|verify} messages. - * @param message ShortRepresentation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.PlanNode.IShortRepresentation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ShortRepresentation message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ShortRepresentation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.PlanNode.ShortRepresentation; - - /** - * Decodes a ShortRepresentation message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ShortRepresentation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.PlanNode.ShortRepresentation; - - /** - * Verifies a ShortRepresentation message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ShortRepresentation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ShortRepresentation - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.PlanNode.ShortRepresentation; - - /** - * Creates a plain object from a ShortRepresentation message. Also converts values to other types if specified. - * @param message ShortRepresentation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.PlanNode.ShortRepresentation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ShortRepresentation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ShortRepresentation - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a QueryAdvisorResult. */ - interface IQueryAdvisorResult { - - /** QueryAdvisorResult indexAdvice */ - indexAdvice?: (google.spanner.v1.QueryAdvisorResult.IIndexAdvice[]|null); - } - - /** Represents a QueryAdvisorResult. */ - class QueryAdvisorResult implements IQueryAdvisorResult { - - /** - * Constructs a new QueryAdvisorResult. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.IQueryAdvisorResult); - - /** QueryAdvisorResult indexAdvice. */ - public indexAdvice: google.spanner.v1.QueryAdvisorResult.IIndexAdvice[]; - - /** - * Creates a new QueryAdvisorResult instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryAdvisorResult instance - */ - public static create(properties?: google.spanner.v1.IQueryAdvisorResult): google.spanner.v1.QueryAdvisorResult; - - /** - * Encodes the specified QueryAdvisorResult message. Does not implicitly {@link google.spanner.v1.QueryAdvisorResult.verify|verify} messages. - * @param message QueryAdvisorResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.IQueryAdvisorResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryAdvisorResult message, length delimited. Does not implicitly {@link google.spanner.v1.QueryAdvisorResult.verify|verify} messages. - * @param message QueryAdvisorResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.IQueryAdvisorResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryAdvisorResult message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryAdvisorResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.QueryAdvisorResult; - - /** - * Decodes a QueryAdvisorResult message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryAdvisorResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.QueryAdvisorResult; - - /** - * Verifies a QueryAdvisorResult message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryAdvisorResult message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryAdvisorResult - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.QueryAdvisorResult; - - /** - * Creates a plain object from a QueryAdvisorResult message. Also converts values to other types if specified. - * @param message QueryAdvisorResult - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.QueryAdvisorResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryAdvisorResult to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for QueryAdvisorResult - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace QueryAdvisorResult { - - /** Properties of an IndexAdvice. */ - interface IIndexAdvice { - - /** IndexAdvice ddl */ - ddl?: (string[]|null); - - /** IndexAdvice improvementFactor */ - improvementFactor?: (number|null); - } - - /** Represents an IndexAdvice. */ - class IndexAdvice implements IIndexAdvice { - - /** - * Constructs a new IndexAdvice. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.QueryAdvisorResult.IIndexAdvice); - - /** IndexAdvice ddl. */ - public ddl: string[]; - - /** IndexAdvice improvementFactor. */ - public improvementFactor: number; - - /** - * Creates a new IndexAdvice instance using the specified properties. - * @param [properties] Properties to set - * @returns IndexAdvice instance - */ - public static create(properties?: google.spanner.v1.QueryAdvisorResult.IIndexAdvice): google.spanner.v1.QueryAdvisorResult.IndexAdvice; - - /** - * Encodes the specified IndexAdvice message. Does not implicitly {@link google.spanner.v1.QueryAdvisorResult.IndexAdvice.verify|verify} messages. - * @param message IndexAdvice message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.QueryAdvisorResult.IIndexAdvice, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified IndexAdvice message, length delimited. Does not implicitly {@link google.spanner.v1.QueryAdvisorResult.IndexAdvice.verify|verify} messages. - * @param message IndexAdvice message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.QueryAdvisorResult.IIndexAdvice, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an IndexAdvice message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns IndexAdvice - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.QueryAdvisorResult.IndexAdvice; - - /** - * Decodes an IndexAdvice message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns IndexAdvice - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.QueryAdvisorResult.IndexAdvice; - - /** - * Verifies an IndexAdvice message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an IndexAdvice message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns IndexAdvice - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.QueryAdvisorResult.IndexAdvice; - - /** - * Creates a plain object from an IndexAdvice message. Also converts values to other types if specified. - * @param message IndexAdvice - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.QueryAdvisorResult.IndexAdvice, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this IndexAdvice to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for IndexAdvice - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a QueryPlan. */ - interface IQueryPlan { - - /** QueryPlan planNodes */ - planNodes?: (google.spanner.v1.IPlanNode[]|null); - - /** QueryPlan queryAdvice */ - queryAdvice?: (google.spanner.v1.IQueryAdvisorResult|null); - } - - /** Represents a QueryPlan. */ - class QueryPlan implements IQueryPlan { - - /** - * Constructs a new QueryPlan. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.IQueryPlan); - - /** QueryPlan planNodes. */ - public planNodes: google.spanner.v1.IPlanNode[]; - - /** QueryPlan queryAdvice. */ - public queryAdvice?: (google.spanner.v1.IQueryAdvisorResult|null); - - /** - * Creates a new QueryPlan instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryPlan instance - */ - public static create(properties?: google.spanner.v1.IQueryPlan): google.spanner.v1.QueryPlan; - - /** - * Encodes the specified QueryPlan message. Does not implicitly {@link google.spanner.v1.QueryPlan.verify|verify} messages. - * @param message QueryPlan message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.IQueryPlan, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryPlan message, length delimited. Does not implicitly {@link google.spanner.v1.QueryPlan.verify|verify} messages. - * @param message QueryPlan message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.IQueryPlan, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryPlan message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryPlan - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.QueryPlan; - - /** - * Decodes a QueryPlan message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryPlan - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.QueryPlan; - - /** - * Verifies a QueryPlan message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryPlan message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryPlan - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.QueryPlan; - - /** - * Creates a plain object from a QueryPlan message. Also converts values to other types if specified. - * @param message QueryPlan - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.QueryPlan, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryPlan to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for QueryPlan - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ResultSet. */ - interface IResultSet { - - /** ResultSet metadata */ - metadata?: (google.spanner.v1.IResultSetMetadata|null); - - /** ResultSet rows */ - rows?: (google.protobuf.IListValue[]|null); - - /** ResultSet stats */ - stats?: (google.spanner.v1.IResultSetStats|null); - - /** ResultSet precommitToken */ - precommitToken?: (google.spanner.v1.IMultiplexedSessionPrecommitToken|null); - - /** ResultSet cacheUpdate */ - cacheUpdate?: (google.spanner.v1.ICacheUpdate|null); - } - - /** Represents a ResultSet. */ - class ResultSet implements IResultSet { - - /** - * Constructs a new ResultSet. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.IResultSet); - - /** ResultSet metadata. */ - public metadata?: (google.spanner.v1.IResultSetMetadata|null); - - /** ResultSet rows. */ - public rows: google.protobuf.IListValue[]; - - /** ResultSet stats. */ - public stats?: (google.spanner.v1.IResultSetStats|null); - - /** ResultSet precommitToken. */ - public precommitToken?: (google.spanner.v1.IMultiplexedSessionPrecommitToken|null); - - /** ResultSet cacheUpdate. */ - public cacheUpdate?: (google.spanner.v1.ICacheUpdate|null); - - /** - * Creates a new ResultSet instance using the specified properties. - * @param [properties] Properties to set - * @returns ResultSet instance - */ - public static create(properties?: google.spanner.v1.IResultSet): google.spanner.v1.ResultSet; - - /** - * Encodes the specified ResultSet message. Does not implicitly {@link google.spanner.v1.ResultSet.verify|verify} messages. - * @param message ResultSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.IResultSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ResultSet message, length delimited. Does not implicitly {@link google.spanner.v1.ResultSet.verify|verify} messages. - * @param message ResultSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.IResultSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ResultSet message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ResultSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.ResultSet; - - /** - * Decodes a ResultSet message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ResultSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.ResultSet; - - /** - * Verifies a ResultSet message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ResultSet message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ResultSet - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.ResultSet; - - /** - * Creates a plain object from a ResultSet message. Also converts values to other types if specified. - * @param message ResultSet - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.ResultSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ResultSet to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ResultSet - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PartialResultSet. */ - interface IPartialResultSet { - - /** PartialResultSet metadata */ - metadata?: (google.spanner.v1.IResultSetMetadata|null); - - /** PartialResultSet values */ - values?: (google.protobuf.IValue[]|null); - - /** PartialResultSet chunkedValue */ - chunkedValue?: (boolean|null); - - /** PartialResultSet resumeToken */ - resumeToken?: (Uint8Array|Buffer|string|null); - - /** PartialResultSet stats */ - stats?: (google.spanner.v1.IResultSetStats|null); - - /** PartialResultSet precommitToken */ - precommitToken?: (google.spanner.v1.IMultiplexedSessionPrecommitToken|null); - - /** PartialResultSet last */ - last?: (boolean|null); - - /** PartialResultSet cacheUpdate */ - cacheUpdate?: (google.spanner.v1.ICacheUpdate|null); - } - - /** Represents a PartialResultSet. */ - class PartialResultSet implements IPartialResultSet { - - /** - * Constructs a new PartialResultSet. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.IPartialResultSet); - - /** PartialResultSet metadata. */ - public metadata?: (google.spanner.v1.IResultSetMetadata|null); - - /** PartialResultSet values. */ - public values: google.protobuf.IValue[]; - - /** PartialResultSet chunkedValue. */ - public chunkedValue: boolean; - - /** PartialResultSet resumeToken. */ - public resumeToken: (Uint8Array|Buffer|string); - - /** PartialResultSet stats. */ - public stats?: (google.spanner.v1.IResultSetStats|null); - - /** PartialResultSet precommitToken. */ - public precommitToken?: (google.spanner.v1.IMultiplexedSessionPrecommitToken|null); - - /** PartialResultSet last. */ - public last: boolean; - - /** PartialResultSet cacheUpdate. */ - public cacheUpdate?: (google.spanner.v1.ICacheUpdate|null); - - /** - * Creates a new PartialResultSet instance using the specified properties. - * @param [properties] Properties to set - * @returns PartialResultSet instance - */ - public static create(properties?: google.spanner.v1.IPartialResultSet): google.spanner.v1.PartialResultSet; - - /** - * Encodes the specified PartialResultSet message. Does not implicitly {@link google.spanner.v1.PartialResultSet.verify|verify} messages. - * @param message PartialResultSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.IPartialResultSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PartialResultSet message, length delimited. Does not implicitly {@link google.spanner.v1.PartialResultSet.verify|verify} messages. - * @param message PartialResultSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.IPartialResultSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PartialResultSet message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PartialResultSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.PartialResultSet; - - /** - * Decodes a PartialResultSet message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PartialResultSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.PartialResultSet; - - /** - * Verifies a PartialResultSet message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PartialResultSet message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PartialResultSet - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.PartialResultSet; - - /** - * Creates a plain object from a PartialResultSet message. Also converts values to other types if specified. - * @param message PartialResultSet - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.PartialResultSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PartialResultSet to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PartialResultSet - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ResultSetMetadata. */ - interface IResultSetMetadata { - - /** ResultSetMetadata rowType */ - rowType?: (google.spanner.v1.IStructType|null); - - /** ResultSetMetadata transaction */ - transaction?: (google.spanner.v1.ITransaction|null); - - /** ResultSetMetadata undeclaredParameters */ - undeclaredParameters?: (google.spanner.v1.IStructType|null); - } - - /** Represents a ResultSetMetadata. */ - class ResultSetMetadata implements IResultSetMetadata { - - /** - * Constructs a new ResultSetMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.IResultSetMetadata); - - /** ResultSetMetadata rowType. */ - public rowType?: (google.spanner.v1.IStructType|null); - - /** ResultSetMetadata transaction. */ - public transaction?: (google.spanner.v1.ITransaction|null); - - /** ResultSetMetadata undeclaredParameters. */ - public undeclaredParameters?: (google.spanner.v1.IStructType|null); - - /** - * Creates a new ResultSetMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns ResultSetMetadata instance - */ - public static create(properties?: google.spanner.v1.IResultSetMetadata): google.spanner.v1.ResultSetMetadata; - - /** - * Encodes the specified ResultSetMetadata message. Does not implicitly {@link google.spanner.v1.ResultSetMetadata.verify|verify} messages. - * @param message ResultSetMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.IResultSetMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ResultSetMetadata message, length delimited. Does not implicitly {@link google.spanner.v1.ResultSetMetadata.verify|verify} messages. - * @param message ResultSetMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.IResultSetMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ResultSetMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ResultSetMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.ResultSetMetadata; - - /** - * Decodes a ResultSetMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ResultSetMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.ResultSetMetadata; - - /** - * Verifies a ResultSetMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ResultSetMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ResultSetMetadata - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.ResultSetMetadata; - - /** - * Creates a plain object from a ResultSetMetadata message. Also converts values to other types if specified. - * @param message ResultSetMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.ResultSetMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ResultSetMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ResultSetMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ResultSetStats. */ - interface IResultSetStats { - - /** ResultSetStats queryPlan */ - queryPlan?: (google.spanner.v1.IQueryPlan|null); - - /** ResultSetStats queryStats */ - queryStats?: (google.protobuf.IStruct|null); - - /** ResultSetStats rowCountExact */ - rowCountExact?: (number|Long|string|null); - - /** ResultSetStats rowCountLowerBound */ - rowCountLowerBound?: (number|Long|string|null); - } - - /** Represents a ResultSetStats. */ - class ResultSetStats implements IResultSetStats { - - /** - * Constructs a new ResultSetStats. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.IResultSetStats); - - /** ResultSetStats queryPlan. */ - public queryPlan?: (google.spanner.v1.IQueryPlan|null); - - /** ResultSetStats queryStats. */ - public queryStats?: (google.protobuf.IStruct|null); - - /** ResultSetStats rowCountExact. */ - public rowCountExact?: (number|Long|string|null); - - /** ResultSetStats rowCountLowerBound. */ - public rowCountLowerBound?: (number|Long|string|null); - - /** ResultSetStats rowCount. */ - public rowCount?: ("rowCountExact"|"rowCountLowerBound"); - - /** - * Creates a new ResultSetStats instance using the specified properties. - * @param [properties] Properties to set - * @returns ResultSetStats instance - */ - public static create(properties?: google.spanner.v1.IResultSetStats): google.spanner.v1.ResultSetStats; - - /** - * Encodes the specified ResultSetStats message. Does not implicitly {@link google.spanner.v1.ResultSetStats.verify|verify} messages. - * @param message ResultSetStats message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.IResultSetStats, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ResultSetStats message, length delimited. Does not implicitly {@link google.spanner.v1.ResultSetStats.verify|verify} messages. - * @param message ResultSetStats message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.IResultSetStats, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ResultSetStats message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ResultSetStats - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.ResultSetStats; - - /** - * Decodes a ResultSetStats message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ResultSetStats - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.ResultSetStats; - - /** - * Verifies a ResultSetStats message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ResultSetStats message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ResultSetStats - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.ResultSetStats; - - /** - * Creates a plain object from a ResultSetStats message. Also converts values to other types if specified. - * @param message ResultSetStats - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.ResultSetStats, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ResultSetStats to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ResultSetStats - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Represents a Spanner */ - class Spanner extends $protobuf.rpc.Service { - - /** - * Constructs a new Spanner service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - - /** - * Creates new Spanner 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): Spanner; - - /** - * Calls CreateSession. - * @param request CreateSessionRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Session - */ - public createSession(request: google.spanner.v1.ICreateSessionRequest, callback: google.spanner.v1.Spanner.CreateSessionCallback): void; - - /** - * Calls CreateSession. - * @param request CreateSessionRequest message or plain object - * @returns Promise - */ - public createSession(request: google.spanner.v1.ICreateSessionRequest): Promise; - - /** - * Calls BatchCreateSessions. - * @param request BatchCreateSessionsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and BatchCreateSessionsResponse - */ - public batchCreateSessions(request: google.spanner.v1.IBatchCreateSessionsRequest, callback: google.spanner.v1.Spanner.BatchCreateSessionsCallback): void; - - /** - * Calls BatchCreateSessions. - * @param request BatchCreateSessionsRequest message or plain object - * @returns Promise - */ - public batchCreateSessions(request: google.spanner.v1.IBatchCreateSessionsRequest): Promise; - - /** - * Calls GetSession. - * @param request GetSessionRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Session - */ - public getSession(request: google.spanner.v1.IGetSessionRequest, callback: google.spanner.v1.Spanner.GetSessionCallback): void; - - /** - * Calls GetSession. - * @param request GetSessionRequest message or plain object - * @returns Promise - */ - public getSession(request: google.spanner.v1.IGetSessionRequest): Promise; - - /** - * Calls ListSessions. - * @param request ListSessionsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListSessionsResponse - */ - public listSessions(request: google.spanner.v1.IListSessionsRequest, callback: google.spanner.v1.Spanner.ListSessionsCallback): void; - - /** - * Calls ListSessions. - * @param request ListSessionsRequest message or plain object - * @returns Promise - */ - public listSessions(request: google.spanner.v1.IListSessionsRequest): Promise; - - /** - * Calls DeleteSession. - * @param request DeleteSessionRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteSession(request: google.spanner.v1.IDeleteSessionRequest, callback: google.spanner.v1.Spanner.DeleteSessionCallback): void; - - /** - * Calls DeleteSession. - * @param request DeleteSessionRequest message or plain object - * @returns Promise - */ - public deleteSession(request: google.spanner.v1.IDeleteSessionRequest): Promise; - - /** - * Calls ExecuteSql. - * @param request ExecuteSqlRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ResultSet - */ - public executeSql(request: google.spanner.v1.IExecuteSqlRequest, callback: google.spanner.v1.Spanner.ExecuteSqlCallback): void; - - /** - * Calls ExecuteSql. - * @param request ExecuteSqlRequest message or plain object - * @returns Promise - */ - public executeSql(request: google.spanner.v1.IExecuteSqlRequest): Promise; - - /** - * Calls ExecuteStreamingSql. - * @param request ExecuteSqlRequest message or plain object - * @param callback Node-style callback called with the error, if any, and PartialResultSet - */ - public executeStreamingSql(request: google.spanner.v1.IExecuteSqlRequest, callback: google.spanner.v1.Spanner.ExecuteStreamingSqlCallback): void; - - /** - * Calls ExecuteStreamingSql. - * @param request ExecuteSqlRequest message or plain object - * @returns Promise - */ - public executeStreamingSql(request: google.spanner.v1.IExecuteSqlRequest): Promise; - - /** - * Calls ExecuteBatchDml. - * @param request ExecuteBatchDmlRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ExecuteBatchDmlResponse - */ - public executeBatchDml(request: google.spanner.v1.IExecuteBatchDmlRequest, callback: google.spanner.v1.Spanner.ExecuteBatchDmlCallback): void; - - /** - * Calls ExecuteBatchDml. - * @param request ExecuteBatchDmlRequest message or plain object - * @returns Promise - */ - public executeBatchDml(request: google.spanner.v1.IExecuteBatchDmlRequest): Promise; - - /** - * Calls Read. - * @param request ReadRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ResultSet - */ - public read(request: google.spanner.v1.IReadRequest, callback: google.spanner.v1.Spanner.ReadCallback): void; - - /** - * Calls Read. - * @param request ReadRequest message or plain object - * @returns Promise - */ - public read(request: google.spanner.v1.IReadRequest): Promise; - - /** - * Calls StreamingRead. - * @param request ReadRequest message or plain object - * @param callback Node-style callback called with the error, if any, and PartialResultSet - */ - public streamingRead(request: google.spanner.v1.IReadRequest, callback: google.spanner.v1.Spanner.StreamingReadCallback): void; - - /** - * Calls StreamingRead. - * @param request ReadRequest message or plain object - * @returns Promise - */ - public streamingRead(request: google.spanner.v1.IReadRequest): Promise; - - /** - * Calls BeginTransaction. - * @param request BeginTransactionRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Transaction - */ - public beginTransaction(request: google.spanner.v1.IBeginTransactionRequest, callback: google.spanner.v1.Spanner.BeginTransactionCallback): void; - - /** - * Calls BeginTransaction. - * @param request BeginTransactionRequest message or plain object - * @returns Promise - */ - public beginTransaction(request: google.spanner.v1.IBeginTransactionRequest): Promise; - - /** - * Calls Commit. - * @param request CommitRequest message or plain object - * @param callback Node-style callback called with the error, if any, and CommitResponse - */ - public commit(request: google.spanner.v1.ICommitRequest, callback: google.spanner.v1.Spanner.CommitCallback): void; - - /** - * Calls Commit. - * @param request CommitRequest message or plain object - * @returns Promise - */ - public commit(request: google.spanner.v1.ICommitRequest): Promise; - - /** - * Calls Rollback. - * @param request RollbackRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public rollback(request: google.spanner.v1.IRollbackRequest, callback: google.spanner.v1.Spanner.RollbackCallback): void; - - /** - * Calls Rollback. - * @param request RollbackRequest message or plain object - * @returns Promise - */ - public rollback(request: google.spanner.v1.IRollbackRequest): Promise; - - /** - * Calls PartitionQuery. - * @param request PartitionQueryRequest message or plain object - * @param callback Node-style callback called with the error, if any, and PartitionResponse - */ - public partitionQuery(request: google.spanner.v1.IPartitionQueryRequest, callback: google.spanner.v1.Spanner.PartitionQueryCallback): void; - - /** - * Calls PartitionQuery. - * @param request PartitionQueryRequest message or plain object - * @returns Promise - */ - public partitionQuery(request: google.spanner.v1.IPartitionQueryRequest): Promise; - - /** - * Calls PartitionRead. - * @param request PartitionReadRequest message or plain object - * @param callback Node-style callback called with the error, if any, and PartitionResponse - */ - public partitionRead(request: google.spanner.v1.IPartitionReadRequest, callback: google.spanner.v1.Spanner.PartitionReadCallback): void; - - /** - * Calls PartitionRead. - * @param request PartitionReadRequest message or plain object - * @returns Promise - */ - public partitionRead(request: google.spanner.v1.IPartitionReadRequest): Promise; - - /** - * Calls BatchWrite. - * @param request BatchWriteRequest message or plain object - * @param callback Node-style callback called with the error, if any, and BatchWriteResponse - */ - public batchWrite(request: google.spanner.v1.IBatchWriteRequest, callback: google.spanner.v1.Spanner.BatchWriteCallback): void; - - /** - * Calls BatchWrite. - * @param request BatchWriteRequest message or plain object - * @returns Promise - */ - public batchWrite(request: google.spanner.v1.IBatchWriteRequest): Promise; - } - - namespace Spanner { - - /** - * Callback as used by {@link google.spanner.v1.Spanner|createSession}. - * @param error Error, if any - * @param [response] Session - */ - type CreateSessionCallback = (error: (Error|null), response?: google.spanner.v1.Session) => void; - - /** - * Callback as used by {@link google.spanner.v1.Spanner|batchCreateSessions}. - * @param error Error, if any - * @param [response] BatchCreateSessionsResponse - */ - type BatchCreateSessionsCallback = (error: (Error|null), response?: google.spanner.v1.BatchCreateSessionsResponse) => void; - - /** - * Callback as used by {@link google.spanner.v1.Spanner|getSession}. - * @param error Error, if any - * @param [response] Session - */ - type GetSessionCallback = (error: (Error|null), response?: google.spanner.v1.Session) => void; - - /** - * Callback as used by {@link google.spanner.v1.Spanner|listSessions}. - * @param error Error, if any - * @param [response] ListSessionsResponse - */ - type ListSessionsCallback = (error: (Error|null), response?: google.spanner.v1.ListSessionsResponse) => void; - - /** - * Callback as used by {@link google.spanner.v1.Spanner|deleteSession}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteSessionCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.spanner.v1.Spanner|executeSql}. - * @param error Error, if any - * @param [response] ResultSet - */ - type ExecuteSqlCallback = (error: (Error|null), response?: google.spanner.v1.ResultSet) => void; - - /** - * Callback as used by {@link google.spanner.v1.Spanner|executeStreamingSql}. - * @param error Error, if any - * @param [response] PartialResultSet - */ - type ExecuteStreamingSqlCallback = (error: (Error|null), response?: google.spanner.v1.PartialResultSet) => void; - - /** - * Callback as used by {@link google.spanner.v1.Spanner|executeBatchDml}. - * @param error Error, if any - * @param [response] ExecuteBatchDmlResponse - */ - type ExecuteBatchDmlCallback = (error: (Error|null), response?: google.spanner.v1.ExecuteBatchDmlResponse) => void; - - /** - * Callback as used by {@link google.spanner.v1.Spanner|read}. - * @param error Error, if any - * @param [response] ResultSet - */ - type ReadCallback = (error: (Error|null), response?: google.spanner.v1.ResultSet) => void; - - /** - * Callback as used by {@link google.spanner.v1.Spanner|streamingRead}. - * @param error Error, if any - * @param [response] PartialResultSet - */ - type StreamingReadCallback = (error: (Error|null), response?: google.spanner.v1.PartialResultSet) => void; - - /** - * Callback as used by {@link google.spanner.v1.Spanner|beginTransaction}. - * @param error Error, if any - * @param [response] Transaction - */ - type BeginTransactionCallback = (error: (Error|null), response?: google.spanner.v1.Transaction) => void; - - /** - * Callback as used by {@link google.spanner.v1.Spanner|commit}. - * @param error Error, if any - * @param [response] CommitResponse - */ - type CommitCallback = (error: (Error|null), response?: google.spanner.v1.CommitResponse) => void; - - /** - * Callback as used by {@link google.spanner.v1.Spanner|rollback}. - * @param error Error, if any - * @param [response] Empty - */ - type RollbackCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.spanner.v1.Spanner|partitionQuery}. - * @param error Error, if any - * @param [response] PartitionResponse - */ - type PartitionQueryCallback = (error: (Error|null), response?: google.spanner.v1.PartitionResponse) => void; - - /** - * Callback as used by {@link google.spanner.v1.Spanner|partitionRead}. - * @param error Error, if any - * @param [response] PartitionResponse - */ - type PartitionReadCallback = (error: (Error|null), response?: google.spanner.v1.PartitionResponse) => void; - - /** - * Callback as used by {@link google.spanner.v1.Spanner|batchWrite}. - * @param error Error, if any - * @param [response] BatchWriteResponse - */ - type BatchWriteCallback = (error: (Error|null), response?: google.spanner.v1.BatchWriteResponse) => void; - } - - /** Properties of a CreateSessionRequest. */ - interface ICreateSessionRequest { - - /** CreateSessionRequest database */ - database?: (string|null); - - /** CreateSessionRequest session */ - session?: (google.spanner.v1.ISession|null); - } - - /** Represents a CreateSessionRequest. */ - class CreateSessionRequest implements ICreateSessionRequest { - - /** - * Constructs a new CreateSessionRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.ICreateSessionRequest); - - /** CreateSessionRequest database. */ - public database: string; - - /** CreateSessionRequest session. */ - public session?: (google.spanner.v1.ISession|null); - - /** - * Creates a new CreateSessionRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateSessionRequest instance - */ - public static create(properties?: google.spanner.v1.ICreateSessionRequest): google.spanner.v1.CreateSessionRequest; - - /** - * Encodes the specified CreateSessionRequest message. Does not implicitly {@link google.spanner.v1.CreateSessionRequest.verify|verify} messages. - * @param message CreateSessionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.ICreateSessionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateSessionRequest message, length delimited. Does not implicitly {@link google.spanner.v1.CreateSessionRequest.verify|verify} messages. - * @param message CreateSessionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.ICreateSessionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateSessionRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateSessionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.CreateSessionRequest; - - /** - * Decodes a CreateSessionRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateSessionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.CreateSessionRequest; - - /** - * Verifies a CreateSessionRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateSessionRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateSessionRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.CreateSessionRequest; - - /** - * Creates a plain object from a CreateSessionRequest message. Also converts values to other types if specified. - * @param message CreateSessionRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.CreateSessionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateSessionRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateSessionRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BatchCreateSessionsRequest. */ - interface IBatchCreateSessionsRequest { - - /** BatchCreateSessionsRequest database */ - database?: (string|null); - - /** BatchCreateSessionsRequest sessionTemplate */ - sessionTemplate?: (google.spanner.v1.ISession|null); - - /** BatchCreateSessionsRequest sessionCount */ - sessionCount?: (number|null); - } - - /** Represents a BatchCreateSessionsRequest. */ - class BatchCreateSessionsRequest implements IBatchCreateSessionsRequest { - - /** - * Constructs a new BatchCreateSessionsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.IBatchCreateSessionsRequest); - - /** BatchCreateSessionsRequest database. */ - public database: string; - - /** BatchCreateSessionsRequest sessionTemplate. */ - public sessionTemplate?: (google.spanner.v1.ISession|null); - - /** BatchCreateSessionsRequest sessionCount. */ - public sessionCount: number; - - /** - * Creates a new BatchCreateSessionsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns BatchCreateSessionsRequest instance - */ - public static create(properties?: google.spanner.v1.IBatchCreateSessionsRequest): google.spanner.v1.BatchCreateSessionsRequest; - - /** - * Encodes the specified BatchCreateSessionsRequest message. Does not implicitly {@link google.spanner.v1.BatchCreateSessionsRequest.verify|verify} messages. - * @param message BatchCreateSessionsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.IBatchCreateSessionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BatchCreateSessionsRequest message, length delimited. Does not implicitly {@link google.spanner.v1.BatchCreateSessionsRequest.verify|verify} messages. - * @param message BatchCreateSessionsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.IBatchCreateSessionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BatchCreateSessionsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BatchCreateSessionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.BatchCreateSessionsRequest; - - /** - * Decodes a BatchCreateSessionsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BatchCreateSessionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.BatchCreateSessionsRequest; - - /** - * Verifies a BatchCreateSessionsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BatchCreateSessionsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BatchCreateSessionsRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.BatchCreateSessionsRequest; - - /** - * Creates a plain object from a BatchCreateSessionsRequest message. Also converts values to other types if specified. - * @param message BatchCreateSessionsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.BatchCreateSessionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BatchCreateSessionsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BatchCreateSessionsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BatchCreateSessionsResponse. */ - interface IBatchCreateSessionsResponse { - - /** BatchCreateSessionsResponse session */ - session?: (google.spanner.v1.ISession[]|null); - } - - /** Represents a BatchCreateSessionsResponse. */ - class BatchCreateSessionsResponse implements IBatchCreateSessionsResponse { - - /** - * Constructs a new BatchCreateSessionsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.IBatchCreateSessionsResponse); - - /** BatchCreateSessionsResponse session. */ - public session: google.spanner.v1.ISession[]; - - /** - * Creates a new BatchCreateSessionsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns BatchCreateSessionsResponse instance - */ - public static create(properties?: google.spanner.v1.IBatchCreateSessionsResponse): google.spanner.v1.BatchCreateSessionsResponse; - - /** - * Encodes the specified BatchCreateSessionsResponse message. Does not implicitly {@link google.spanner.v1.BatchCreateSessionsResponse.verify|verify} messages. - * @param message BatchCreateSessionsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.IBatchCreateSessionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BatchCreateSessionsResponse message, length delimited. Does not implicitly {@link google.spanner.v1.BatchCreateSessionsResponse.verify|verify} messages. - * @param message BatchCreateSessionsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.IBatchCreateSessionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BatchCreateSessionsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BatchCreateSessionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.BatchCreateSessionsResponse; - - /** - * Decodes a BatchCreateSessionsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BatchCreateSessionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.BatchCreateSessionsResponse; - - /** - * Verifies a BatchCreateSessionsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BatchCreateSessionsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BatchCreateSessionsResponse - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.BatchCreateSessionsResponse; - - /** - * Creates a plain object from a BatchCreateSessionsResponse message. Also converts values to other types if specified. - * @param message BatchCreateSessionsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.BatchCreateSessionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BatchCreateSessionsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BatchCreateSessionsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Session. */ - interface ISession { - - /** Session name */ - name?: (string|null); - - /** Session labels */ - labels?: ({ [k: string]: string }|null); - - /** Session createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** Session approximateLastUseTime */ - approximateLastUseTime?: (google.protobuf.ITimestamp|null); - - /** Session creatorRole */ - creatorRole?: (string|null); - - /** Session multiplexed */ - multiplexed?: (boolean|null); - } - - /** Represents a Session. */ - class Session implements ISession { - - /** - * Constructs a new Session. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.ISession); - - /** Session name. */ - public name: string; - - /** Session labels. */ - public labels: { [k: string]: string }; - - /** Session createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** Session approximateLastUseTime. */ - public approximateLastUseTime?: (google.protobuf.ITimestamp|null); - - /** Session creatorRole. */ - public creatorRole: string; - - /** Session multiplexed. */ - public multiplexed: boolean; - - /** - * Creates a new Session instance using the specified properties. - * @param [properties] Properties to set - * @returns Session instance - */ - public static create(properties?: google.spanner.v1.ISession): google.spanner.v1.Session; - - /** - * Encodes the specified Session message. Does not implicitly {@link google.spanner.v1.Session.verify|verify} messages. - * @param message Session message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.ISession, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Session message, length delimited. Does not implicitly {@link google.spanner.v1.Session.verify|verify} messages. - * @param message Session message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.ISession, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Session message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Session - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.Session; - - /** - * Decodes a Session message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Session - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.Session; - - /** - * Verifies a Session message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Session message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Session - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.Session; - - /** - * Creates a plain object from a Session message. Also converts values to other types if specified. - * @param message Session - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.Session, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Session to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Session - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetSessionRequest. */ - interface IGetSessionRequest { - - /** GetSessionRequest name */ - name?: (string|null); - } - - /** Represents a GetSessionRequest. */ - class GetSessionRequest implements IGetSessionRequest { - - /** - * Constructs a new GetSessionRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.IGetSessionRequest); - - /** GetSessionRequest name. */ - public name: string; - - /** - * Creates a new GetSessionRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetSessionRequest instance - */ - public static create(properties?: google.spanner.v1.IGetSessionRequest): google.spanner.v1.GetSessionRequest; - - /** - * Encodes the specified GetSessionRequest message. Does not implicitly {@link google.spanner.v1.GetSessionRequest.verify|verify} messages. - * @param message GetSessionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.IGetSessionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetSessionRequest message, length delimited. Does not implicitly {@link google.spanner.v1.GetSessionRequest.verify|verify} messages. - * @param message GetSessionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.IGetSessionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetSessionRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetSessionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.GetSessionRequest; - - /** - * Decodes a GetSessionRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetSessionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.GetSessionRequest; - - /** - * Verifies a GetSessionRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetSessionRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetSessionRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.GetSessionRequest; - - /** - * Creates a plain object from a GetSessionRequest message. Also converts values to other types if specified. - * @param message GetSessionRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.GetSessionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetSessionRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetSessionRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListSessionsRequest. */ - interface IListSessionsRequest { - - /** ListSessionsRequest database */ - database?: (string|null); - - /** ListSessionsRequest pageSize */ - pageSize?: (number|null); - - /** ListSessionsRequest pageToken */ - pageToken?: (string|null); - - /** ListSessionsRequest filter */ - filter?: (string|null); - } - - /** Represents a ListSessionsRequest. */ - class ListSessionsRequest implements IListSessionsRequest { - - /** - * Constructs a new ListSessionsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.IListSessionsRequest); - - /** ListSessionsRequest database. */ - public database: string; - - /** ListSessionsRequest pageSize. */ - public pageSize: number; - - /** ListSessionsRequest pageToken. */ - public pageToken: string; - - /** ListSessionsRequest filter. */ - public filter: string; - - /** - * Creates a new ListSessionsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListSessionsRequest instance - */ - public static create(properties?: google.spanner.v1.IListSessionsRequest): google.spanner.v1.ListSessionsRequest; - - /** - * Encodes the specified ListSessionsRequest message. Does not implicitly {@link google.spanner.v1.ListSessionsRequest.verify|verify} messages. - * @param message ListSessionsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.IListSessionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListSessionsRequest message, length delimited. Does not implicitly {@link google.spanner.v1.ListSessionsRequest.verify|verify} messages. - * @param message ListSessionsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.IListSessionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListSessionsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListSessionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.ListSessionsRequest; - - /** - * Decodes a ListSessionsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListSessionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.ListSessionsRequest; - - /** - * Verifies a ListSessionsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListSessionsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListSessionsRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.ListSessionsRequest; - - /** - * Creates a plain object from a ListSessionsRequest message. Also converts values to other types if specified. - * @param message ListSessionsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.ListSessionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListSessionsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListSessionsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListSessionsResponse. */ - interface IListSessionsResponse { - - /** ListSessionsResponse sessions */ - sessions?: (google.spanner.v1.ISession[]|null); - - /** ListSessionsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListSessionsResponse. */ - class ListSessionsResponse implements IListSessionsResponse { - - /** - * Constructs a new ListSessionsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.IListSessionsResponse); - - /** ListSessionsResponse sessions. */ - public sessions: google.spanner.v1.ISession[]; - - /** ListSessionsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListSessionsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListSessionsResponse instance - */ - public static create(properties?: google.spanner.v1.IListSessionsResponse): google.spanner.v1.ListSessionsResponse; - - /** - * Encodes the specified ListSessionsResponse message. Does not implicitly {@link google.spanner.v1.ListSessionsResponse.verify|verify} messages. - * @param message ListSessionsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.IListSessionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListSessionsResponse message, length delimited. Does not implicitly {@link google.spanner.v1.ListSessionsResponse.verify|verify} messages. - * @param message ListSessionsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.IListSessionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListSessionsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListSessionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.ListSessionsResponse; - - /** - * Decodes a ListSessionsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListSessionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.ListSessionsResponse; - - /** - * Verifies a ListSessionsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListSessionsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListSessionsResponse - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.ListSessionsResponse; - - /** - * Creates a plain object from a ListSessionsResponse message. Also converts values to other types if specified. - * @param message ListSessionsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.ListSessionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListSessionsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListSessionsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteSessionRequest. */ - interface IDeleteSessionRequest { - - /** DeleteSessionRequest name */ - name?: (string|null); - } - - /** Represents a DeleteSessionRequest. */ - class DeleteSessionRequest implements IDeleteSessionRequest { - - /** - * Constructs a new DeleteSessionRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.IDeleteSessionRequest); - - /** DeleteSessionRequest name. */ - public name: string; - - /** - * Creates a new DeleteSessionRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteSessionRequest instance - */ - public static create(properties?: google.spanner.v1.IDeleteSessionRequest): google.spanner.v1.DeleteSessionRequest; - - /** - * Encodes the specified DeleteSessionRequest message. Does not implicitly {@link google.spanner.v1.DeleteSessionRequest.verify|verify} messages. - * @param message DeleteSessionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.IDeleteSessionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteSessionRequest message, length delimited. Does not implicitly {@link google.spanner.v1.DeleteSessionRequest.verify|verify} messages. - * @param message DeleteSessionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.IDeleteSessionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteSessionRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteSessionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.DeleteSessionRequest; - - /** - * Decodes a DeleteSessionRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteSessionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.DeleteSessionRequest; - - /** - * Verifies a DeleteSessionRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteSessionRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteSessionRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.DeleteSessionRequest; - - /** - * Creates a plain object from a DeleteSessionRequest message. Also converts values to other types if specified. - * @param message DeleteSessionRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.DeleteSessionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteSessionRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteSessionRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RequestOptions. */ - interface IRequestOptions { - - /** RequestOptions priority */ - priority?: (google.spanner.v1.RequestOptions.Priority|keyof typeof google.spanner.v1.RequestOptions.Priority|null); - - /** RequestOptions requestTag */ - requestTag?: (string|null); - - /** RequestOptions transactionTag */ - transactionTag?: (string|null); - - /** RequestOptions clientContext */ - clientContext?: (google.spanner.v1.RequestOptions.IClientContext|null); - } - - /** Represents a RequestOptions. */ - class RequestOptions implements IRequestOptions { - - /** - * Constructs a new RequestOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.IRequestOptions); - - /** RequestOptions priority. */ - public priority: (google.spanner.v1.RequestOptions.Priority|keyof typeof google.spanner.v1.RequestOptions.Priority); - - /** RequestOptions requestTag. */ - public requestTag: string; - - /** RequestOptions transactionTag. */ - public transactionTag: string; - - /** RequestOptions clientContext. */ - public clientContext?: (google.spanner.v1.RequestOptions.IClientContext|null); - - /** - * Creates a new RequestOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns RequestOptions instance - */ - public static create(properties?: google.spanner.v1.IRequestOptions): google.spanner.v1.RequestOptions; - - /** - * Encodes the specified RequestOptions message. Does not implicitly {@link google.spanner.v1.RequestOptions.verify|verify} messages. - * @param message RequestOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.IRequestOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RequestOptions message, length delimited. Does not implicitly {@link google.spanner.v1.RequestOptions.verify|verify} messages. - * @param message RequestOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.IRequestOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RequestOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RequestOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.RequestOptions; - - /** - * Decodes a RequestOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RequestOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.RequestOptions; - - /** - * Verifies a RequestOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RequestOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RequestOptions - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.RequestOptions; - - /** - * Creates a plain object from a RequestOptions message. Also converts values to other types if specified. - * @param message RequestOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.RequestOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RequestOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RequestOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace RequestOptions { - - /** Priority enum. */ - enum Priority { - PRIORITY_UNSPECIFIED = 0, - PRIORITY_LOW = 1, - PRIORITY_MEDIUM = 2, - PRIORITY_HIGH = 3 - } - - /** Properties of a ClientContext. */ - interface IClientContext { - - /** ClientContext secureContext */ - secureContext?: ({ [k: string]: google.protobuf.IValue }|null); - } - - /** Represents a ClientContext. */ - class ClientContext implements IClientContext { - - /** - * Constructs a new ClientContext. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.RequestOptions.IClientContext); - - /** ClientContext secureContext. */ - public secureContext: { [k: string]: google.protobuf.IValue }; - - /** - * Creates a new ClientContext instance using the specified properties. - * @param [properties] Properties to set - * @returns ClientContext instance - */ - public static create(properties?: google.spanner.v1.RequestOptions.IClientContext): google.spanner.v1.RequestOptions.ClientContext; - - /** - * Encodes the specified ClientContext message. Does not implicitly {@link google.spanner.v1.RequestOptions.ClientContext.verify|verify} messages. - * @param message ClientContext message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.RequestOptions.IClientContext, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ClientContext message, length delimited. Does not implicitly {@link google.spanner.v1.RequestOptions.ClientContext.verify|verify} messages. - * @param message ClientContext message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.RequestOptions.IClientContext, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ClientContext message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ClientContext - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.RequestOptions.ClientContext; - - /** - * Decodes a ClientContext message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ClientContext - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.RequestOptions.ClientContext; - - /** - * Verifies a ClientContext message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ClientContext message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ClientContext - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.RequestOptions.ClientContext; - - /** - * Creates a plain object from a ClientContext message. Also converts values to other types if specified. - * @param message ClientContext - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.RequestOptions.ClientContext, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ClientContext to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ClientContext - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a DirectedReadOptions. */ - interface IDirectedReadOptions { - - /** DirectedReadOptions includeReplicas */ - includeReplicas?: (google.spanner.v1.DirectedReadOptions.IIncludeReplicas|null); - - /** DirectedReadOptions excludeReplicas */ - excludeReplicas?: (google.spanner.v1.DirectedReadOptions.IExcludeReplicas|null); - } - - /** Represents a DirectedReadOptions. */ - class DirectedReadOptions implements IDirectedReadOptions { - - /** - * Constructs a new DirectedReadOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.IDirectedReadOptions); - - /** DirectedReadOptions includeReplicas. */ - public includeReplicas?: (google.spanner.v1.DirectedReadOptions.IIncludeReplicas|null); - - /** DirectedReadOptions excludeReplicas. */ - public excludeReplicas?: (google.spanner.v1.DirectedReadOptions.IExcludeReplicas|null); - - /** DirectedReadOptions replicas. */ - public replicas?: ("includeReplicas"|"excludeReplicas"); - - /** - * Creates a new DirectedReadOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns DirectedReadOptions instance - */ - public static create(properties?: google.spanner.v1.IDirectedReadOptions): google.spanner.v1.DirectedReadOptions; - - /** - * Encodes the specified DirectedReadOptions message. Does not implicitly {@link google.spanner.v1.DirectedReadOptions.verify|verify} messages. - * @param message DirectedReadOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.IDirectedReadOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DirectedReadOptions message, length delimited. Does not implicitly {@link google.spanner.v1.DirectedReadOptions.verify|verify} messages. - * @param message DirectedReadOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.IDirectedReadOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DirectedReadOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DirectedReadOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.DirectedReadOptions; - - /** - * Decodes a DirectedReadOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DirectedReadOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.DirectedReadOptions; - - /** - * Verifies a DirectedReadOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DirectedReadOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DirectedReadOptions - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.DirectedReadOptions; - - /** - * Creates a plain object from a DirectedReadOptions message. Also converts values to other types if specified. - * @param message DirectedReadOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.DirectedReadOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DirectedReadOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DirectedReadOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace DirectedReadOptions { - - /** Properties of a ReplicaSelection. */ - interface IReplicaSelection { - - /** ReplicaSelection location */ - location?: (string|null); - - /** ReplicaSelection type */ - type?: (google.spanner.v1.DirectedReadOptions.ReplicaSelection.Type|keyof typeof google.spanner.v1.DirectedReadOptions.ReplicaSelection.Type|null); - } - - /** Represents a ReplicaSelection. */ - class ReplicaSelection implements IReplicaSelection { - - /** - * Constructs a new ReplicaSelection. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.DirectedReadOptions.IReplicaSelection); - - /** ReplicaSelection location. */ - public location: string; - - /** ReplicaSelection type. */ - public type: (google.spanner.v1.DirectedReadOptions.ReplicaSelection.Type|keyof typeof google.spanner.v1.DirectedReadOptions.ReplicaSelection.Type); - - /** - * Creates a new ReplicaSelection instance using the specified properties. - * @param [properties] Properties to set - * @returns ReplicaSelection instance - */ - public static create(properties?: google.spanner.v1.DirectedReadOptions.IReplicaSelection): google.spanner.v1.DirectedReadOptions.ReplicaSelection; - - /** - * Encodes the specified ReplicaSelection message. Does not implicitly {@link google.spanner.v1.DirectedReadOptions.ReplicaSelection.verify|verify} messages. - * @param message ReplicaSelection message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.DirectedReadOptions.IReplicaSelection, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ReplicaSelection message, length delimited. Does not implicitly {@link google.spanner.v1.DirectedReadOptions.ReplicaSelection.verify|verify} messages. - * @param message ReplicaSelection message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.DirectedReadOptions.IReplicaSelection, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ReplicaSelection message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ReplicaSelection - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.DirectedReadOptions.ReplicaSelection; - - /** - * Decodes a ReplicaSelection message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ReplicaSelection - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.DirectedReadOptions.ReplicaSelection; - - /** - * Verifies a ReplicaSelection message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ReplicaSelection message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ReplicaSelection - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.DirectedReadOptions.ReplicaSelection; - - /** - * Creates a plain object from a ReplicaSelection message. Also converts values to other types if specified. - * @param message ReplicaSelection - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.DirectedReadOptions.ReplicaSelection, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ReplicaSelection to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ReplicaSelection - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ReplicaSelection { - - /** Type enum. */ - enum Type { - TYPE_UNSPECIFIED = 0, - READ_WRITE = 1, - READ_ONLY = 2 - } - } - - /** Properties of an IncludeReplicas. */ - interface IIncludeReplicas { - - /** IncludeReplicas replicaSelections */ - replicaSelections?: (google.spanner.v1.DirectedReadOptions.IReplicaSelection[]|null); - - /** IncludeReplicas autoFailoverDisabled */ - autoFailoverDisabled?: (boolean|null); - } - - /** Represents an IncludeReplicas. */ - class IncludeReplicas implements IIncludeReplicas { - - /** - * Constructs a new IncludeReplicas. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.DirectedReadOptions.IIncludeReplicas); - - /** IncludeReplicas replicaSelections. */ - public replicaSelections: google.spanner.v1.DirectedReadOptions.IReplicaSelection[]; - - /** IncludeReplicas autoFailoverDisabled. */ - public autoFailoverDisabled: boolean; - - /** - * Creates a new IncludeReplicas instance using the specified properties. - * @param [properties] Properties to set - * @returns IncludeReplicas instance - */ - public static create(properties?: google.spanner.v1.DirectedReadOptions.IIncludeReplicas): google.spanner.v1.DirectedReadOptions.IncludeReplicas; - - /** - * Encodes the specified IncludeReplicas message. Does not implicitly {@link google.spanner.v1.DirectedReadOptions.IncludeReplicas.verify|verify} messages. - * @param message IncludeReplicas message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.DirectedReadOptions.IIncludeReplicas, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified IncludeReplicas message, length delimited. Does not implicitly {@link google.spanner.v1.DirectedReadOptions.IncludeReplicas.verify|verify} messages. - * @param message IncludeReplicas message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.DirectedReadOptions.IIncludeReplicas, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an IncludeReplicas message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns IncludeReplicas - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.DirectedReadOptions.IncludeReplicas; - - /** - * Decodes an IncludeReplicas message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns IncludeReplicas - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.DirectedReadOptions.IncludeReplicas; - - /** - * Verifies an IncludeReplicas message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an IncludeReplicas message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns IncludeReplicas - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.DirectedReadOptions.IncludeReplicas; - - /** - * Creates a plain object from an IncludeReplicas message. Also converts values to other types if specified. - * @param message IncludeReplicas - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.DirectedReadOptions.IncludeReplicas, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this IncludeReplicas to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for IncludeReplicas - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an ExcludeReplicas. */ - interface IExcludeReplicas { - - /** ExcludeReplicas replicaSelections */ - replicaSelections?: (google.spanner.v1.DirectedReadOptions.IReplicaSelection[]|null); - } - - /** Represents an ExcludeReplicas. */ - class ExcludeReplicas implements IExcludeReplicas { - - /** - * Constructs a new ExcludeReplicas. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.DirectedReadOptions.IExcludeReplicas); - - /** ExcludeReplicas replicaSelections. */ - public replicaSelections: google.spanner.v1.DirectedReadOptions.IReplicaSelection[]; - - /** - * Creates a new ExcludeReplicas instance using the specified properties. - * @param [properties] Properties to set - * @returns ExcludeReplicas instance - */ - public static create(properties?: google.spanner.v1.DirectedReadOptions.IExcludeReplicas): google.spanner.v1.DirectedReadOptions.ExcludeReplicas; - - /** - * Encodes the specified ExcludeReplicas message. Does not implicitly {@link google.spanner.v1.DirectedReadOptions.ExcludeReplicas.verify|verify} messages. - * @param message ExcludeReplicas message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.DirectedReadOptions.IExcludeReplicas, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExcludeReplicas message, length delimited. Does not implicitly {@link google.spanner.v1.DirectedReadOptions.ExcludeReplicas.verify|verify} messages. - * @param message ExcludeReplicas message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.DirectedReadOptions.IExcludeReplicas, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExcludeReplicas message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExcludeReplicas - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.DirectedReadOptions.ExcludeReplicas; - - /** - * Decodes an ExcludeReplicas message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExcludeReplicas - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.DirectedReadOptions.ExcludeReplicas; - - /** - * Verifies an ExcludeReplicas message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ExcludeReplicas message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExcludeReplicas - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.DirectedReadOptions.ExcludeReplicas; - - /** - * Creates a plain object from an ExcludeReplicas message. Also converts values to other types if specified. - * @param message ExcludeReplicas - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.DirectedReadOptions.ExcludeReplicas, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExcludeReplicas to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExcludeReplicas - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an ExecuteSqlRequest. */ - interface IExecuteSqlRequest { - - /** ExecuteSqlRequest session */ - session?: (string|null); - - /** ExecuteSqlRequest transaction */ - transaction?: (google.spanner.v1.ITransactionSelector|null); - - /** ExecuteSqlRequest sql */ - sql?: (string|null); - - /** ExecuteSqlRequest params */ - params?: (google.protobuf.IStruct|null); - - /** ExecuteSqlRequest paramTypes */ - paramTypes?: ({ [k: string]: google.spanner.v1.IType }|null); - - /** ExecuteSqlRequest resumeToken */ - resumeToken?: (Uint8Array|Buffer|string|null); - - /** ExecuteSqlRequest queryMode */ - queryMode?: (google.spanner.v1.ExecuteSqlRequest.QueryMode|keyof typeof google.spanner.v1.ExecuteSqlRequest.QueryMode|null); - - /** ExecuteSqlRequest partitionToken */ - partitionToken?: (Uint8Array|Buffer|string|null); - - /** ExecuteSqlRequest seqno */ - seqno?: (number|Long|string|null); - - /** ExecuteSqlRequest queryOptions */ - queryOptions?: (google.spanner.v1.ExecuteSqlRequest.IQueryOptions|null); - - /** ExecuteSqlRequest requestOptions */ - requestOptions?: (google.spanner.v1.IRequestOptions|null); - - /** ExecuteSqlRequest directedReadOptions */ - directedReadOptions?: (google.spanner.v1.IDirectedReadOptions|null); - - /** ExecuteSqlRequest dataBoostEnabled */ - dataBoostEnabled?: (boolean|null); - - /** ExecuteSqlRequest lastStatement */ - lastStatement?: (boolean|null); - - /** ExecuteSqlRequest routingHint */ - routingHint?: (google.spanner.v1.IRoutingHint|null); - } - - /** Represents an ExecuteSqlRequest. */ - class ExecuteSqlRequest implements IExecuteSqlRequest { - - /** - * Constructs a new ExecuteSqlRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.IExecuteSqlRequest); - - /** ExecuteSqlRequest session. */ - public session: string; - - /** ExecuteSqlRequest transaction. */ - public transaction?: (google.spanner.v1.ITransactionSelector|null); - - /** ExecuteSqlRequest sql. */ - public sql: string; - - /** ExecuteSqlRequest params. */ - public params?: (google.protobuf.IStruct|null); - - /** ExecuteSqlRequest paramTypes. */ - public paramTypes: { [k: string]: google.spanner.v1.IType }; - - /** ExecuteSqlRequest resumeToken. */ - public resumeToken: (Uint8Array|Buffer|string); - - /** ExecuteSqlRequest queryMode. */ - public queryMode: (google.spanner.v1.ExecuteSqlRequest.QueryMode|keyof typeof google.spanner.v1.ExecuteSqlRequest.QueryMode); - - /** ExecuteSqlRequest partitionToken. */ - public partitionToken: (Uint8Array|Buffer|string); - - /** ExecuteSqlRequest seqno. */ - public seqno: (number|Long|string); - - /** ExecuteSqlRequest queryOptions. */ - public queryOptions?: (google.spanner.v1.ExecuteSqlRequest.IQueryOptions|null); - - /** ExecuteSqlRequest requestOptions. */ - public requestOptions?: (google.spanner.v1.IRequestOptions|null); - - /** ExecuteSqlRequest directedReadOptions. */ - public directedReadOptions?: (google.spanner.v1.IDirectedReadOptions|null); - - /** ExecuteSqlRequest dataBoostEnabled. */ - public dataBoostEnabled: boolean; - - /** ExecuteSqlRequest lastStatement. */ - public lastStatement: boolean; - - /** ExecuteSqlRequest routingHint. */ - public routingHint?: (google.spanner.v1.IRoutingHint|null); - - /** - * Creates a new ExecuteSqlRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ExecuteSqlRequest instance - */ - public static create(properties?: google.spanner.v1.IExecuteSqlRequest): google.spanner.v1.ExecuteSqlRequest; - - /** - * Encodes the specified ExecuteSqlRequest message. Does not implicitly {@link google.spanner.v1.ExecuteSqlRequest.verify|verify} messages. - * @param message ExecuteSqlRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.IExecuteSqlRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExecuteSqlRequest message, length delimited. Does not implicitly {@link google.spanner.v1.ExecuteSqlRequest.verify|verify} messages. - * @param message ExecuteSqlRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.IExecuteSqlRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExecuteSqlRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExecuteSqlRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.ExecuteSqlRequest; - - /** - * Decodes an ExecuteSqlRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExecuteSqlRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.ExecuteSqlRequest; - - /** - * Verifies an ExecuteSqlRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ExecuteSqlRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExecuteSqlRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.ExecuteSqlRequest; - - /** - * Creates a plain object from an ExecuteSqlRequest message. Also converts values to other types if specified. - * @param message ExecuteSqlRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.ExecuteSqlRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExecuteSqlRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExecuteSqlRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ExecuteSqlRequest { - - /** QueryMode enum. */ - enum QueryMode { - NORMAL = 0, - PLAN = 1, - PROFILE = 2, - WITH_STATS = 3, - WITH_PLAN_AND_STATS = 4 - } - - /** Properties of a QueryOptions. */ - interface IQueryOptions { - - /** QueryOptions optimizerVersion */ - optimizerVersion?: (string|null); - - /** QueryOptions optimizerStatisticsPackage */ - optimizerStatisticsPackage?: (string|null); - } - - /** Represents a QueryOptions. */ - class QueryOptions implements IQueryOptions { - - /** - * Constructs a new QueryOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.ExecuteSqlRequest.IQueryOptions); - - /** QueryOptions optimizerVersion. */ - public optimizerVersion: string; - - /** QueryOptions optimizerStatisticsPackage. */ - public optimizerStatisticsPackage: string; - - /** - * Creates a new QueryOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryOptions instance - */ - public static create(properties?: google.spanner.v1.ExecuteSqlRequest.IQueryOptions): google.spanner.v1.ExecuteSqlRequest.QueryOptions; - - /** - * Encodes the specified QueryOptions message. Does not implicitly {@link google.spanner.v1.ExecuteSqlRequest.QueryOptions.verify|verify} messages. - * @param message QueryOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.ExecuteSqlRequest.IQueryOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryOptions message, length delimited. Does not implicitly {@link google.spanner.v1.ExecuteSqlRequest.QueryOptions.verify|verify} messages. - * @param message QueryOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.ExecuteSqlRequest.IQueryOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.ExecuteSqlRequest.QueryOptions; - - /** - * Decodes a QueryOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.ExecuteSqlRequest.QueryOptions; - - /** - * Verifies a QueryOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryOptions - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.ExecuteSqlRequest.QueryOptions; - - /** - * Creates a plain object from a QueryOptions message. Also converts values to other types if specified. - * @param message QueryOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.ExecuteSqlRequest.QueryOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for QueryOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an ExecuteBatchDmlRequest. */ - interface IExecuteBatchDmlRequest { - - /** ExecuteBatchDmlRequest session */ - session?: (string|null); - - /** ExecuteBatchDmlRequest transaction */ - transaction?: (google.spanner.v1.ITransactionSelector|null); - - /** ExecuteBatchDmlRequest statements */ - statements?: (google.spanner.v1.ExecuteBatchDmlRequest.IStatement[]|null); - - /** ExecuteBatchDmlRequest seqno */ - seqno?: (number|Long|string|null); - - /** ExecuteBatchDmlRequest requestOptions */ - requestOptions?: (google.spanner.v1.IRequestOptions|null); - - /** ExecuteBatchDmlRequest lastStatements */ - lastStatements?: (boolean|null); - } - - /** Represents an ExecuteBatchDmlRequest. */ - class ExecuteBatchDmlRequest implements IExecuteBatchDmlRequest { - - /** - * Constructs a new ExecuteBatchDmlRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.IExecuteBatchDmlRequest); - - /** ExecuteBatchDmlRequest session. */ - public session: string; - - /** ExecuteBatchDmlRequest transaction. */ - public transaction?: (google.spanner.v1.ITransactionSelector|null); - - /** ExecuteBatchDmlRequest statements. */ - public statements: google.spanner.v1.ExecuteBatchDmlRequest.IStatement[]; - - /** ExecuteBatchDmlRequest seqno. */ - public seqno: (number|Long|string); - - /** ExecuteBatchDmlRequest requestOptions. */ - public requestOptions?: (google.spanner.v1.IRequestOptions|null); - - /** ExecuteBatchDmlRequest lastStatements. */ - public lastStatements: boolean; - - /** - * Creates a new ExecuteBatchDmlRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ExecuteBatchDmlRequest instance - */ - public static create(properties?: google.spanner.v1.IExecuteBatchDmlRequest): google.spanner.v1.ExecuteBatchDmlRequest; - - /** - * Encodes the specified ExecuteBatchDmlRequest message. Does not implicitly {@link google.spanner.v1.ExecuteBatchDmlRequest.verify|verify} messages. - * @param message ExecuteBatchDmlRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.IExecuteBatchDmlRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExecuteBatchDmlRequest message, length delimited. Does not implicitly {@link google.spanner.v1.ExecuteBatchDmlRequest.verify|verify} messages. - * @param message ExecuteBatchDmlRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.IExecuteBatchDmlRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExecuteBatchDmlRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExecuteBatchDmlRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.ExecuteBatchDmlRequest; - - /** - * Decodes an ExecuteBatchDmlRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExecuteBatchDmlRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.ExecuteBatchDmlRequest; - - /** - * Verifies an ExecuteBatchDmlRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ExecuteBatchDmlRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExecuteBatchDmlRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.ExecuteBatchDmlRequest; - - /** - * Creates a plain object from an ExecuteBatchDmlRequest message. Also converts values to other types if specified. - * @param message ExecuteBatchDmlRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.ExecuteBatchDmlRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExecuteBatchDmlRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExecuteBatchDmlRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ExecuteBatchDmlRequest { - - /** Properties of a Statement. */ - interface IStatement { - - /** Statement sql */ - sql?: (string|null); - - /** Statement params */ - params?: (google.protobuf.IStruct|null); - - /** Statement paramTypes */ - paramTypes?: ({ [k: string]: google.spanner.v1.IType }|null); - } - - /** Represents a Statement. */ - class Statement implements IStatement { - - /** - * Constructs a new Statement. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.ExecuteBatchDmlRequest.IStatement); - - /** Statement sql. */ - public sql: string; - - /** Statement params. */ - public params?: (google.protobuf.IStruct|null); - - /** Statement paramTypes. */ - public paramTypes: { [k: string]: google.spanner.v1.IType }; - - /** - * Creates a new Statement instance using the specified properties. - * @param [properties] Properties to set - * @returns Statement instance - */ - public static create(properties?: google.spanner.v1.ExecuteBatchDmlRequest.IStatement): google.spanner.v1.ExecuteBatchDmlRequest.Statement; - - /** - * Encodes the specified Statement message. Does not implicitly {@link google.spanner.v1.ExecuteBatchDmlRequest.Statement.verify|verify} messages. - * @param message Statement message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.ExecuteBatchDmlRequest.IStatement, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Statement message, length delimited. Does not implicitly {@link google.spanner.v1.ExecuteBatchDmlRequest.Statement.verify|verify} messages. - * @param message Statement message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.ExecuteBatchDmlRequest.IStatement, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Statement message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Statement - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.ExecuteBatchDmlRequest.Statement; - - /** - * Decodes a Statement message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Statement - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.ExecuteBatchDmlRequest.Statement; - - /** - * Verifies a Statement message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Statement message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Statement - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.ExecuteBatchDmlRequest.Statement; - - /** - * Creates a plain object from a Statement message. Also converts values to other types if specified. - * @param message Statement - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.ExecuteBatchDmlRequest.Statement, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Statement to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Statement - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an ExecuteBatchDmlResponse. */ - interface IExecuteBatchDmlResponse { - - /** ExecuteBatchDmlResponse resultSets */ - resultSets?: (google.spanner.v1.IResultSet[]|null); - - /** ExecuteBatchDmlResponse status */ - status?: (google.rpc.IStatus|null); - - /** ExecuteBatchDmlResponse precommitToken */ - precommitToken?: (google.spanner.v1.IMultiplexedSessionPrecommitToken|null); - } - - /** Represents an ExecuteBatchDmlResponse. */ - class ExecuteBatchDmlResponse implements IExecuteBatchDmlResponse { - - /** - * Constructs a new ExecuteBatchDmlResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.IExecuteBatchDmlResponse); - - /** ExecuteBatchDmlResponse resultSets. */ - public resultSets: google.spanner.v1.IResultSet[]; - - /** ExecuteBatchDmlResponse status. */ - public status?: (google.rpc.IStatus|null); - - /** ExecuteBatchDmlResponse precommitToken. */ - public precommitToken?: (google.spanner.v1.IMultiplexedSessionPrecommitToken|null); - - /** - * Creates a new ExecuteBatchDmlResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ExecuteBatchDmlResponse instance - */ - public static create(properties?: google.spanner.v1.IExecuteBatchDmlResponse): google.spanner.v1.ExecuteBatchDmlResponse; - - /** - * Encodes the specified ExecuteBatchDmlResponse message. Does not implicitly {@link google.spanner.v1.ExecuteBatchDmlResponse.verify|verify} messages. - * @param message ExecuteBatchDmlResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.IExecuteBatchDmlResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExecuteBatchDmlResponse message, length delimited. Does not implicitly {@link google.spanner.v1.ExecuteBatchDmlResponse.verify|verify} messages. - * @param message ExecuteBatchDmlResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.IExecuteBatchDmlResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExecuteBatchDmlResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExecuteBatchDmlResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.ExecuteBatchDmlResponse; - - /** - * Decodes an ExecuteBatchDmlResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExecuteBatchDmlResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.ExecuteBatchDmlResponse; - - /** - * Verifies an ExecuteBatchDmlResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ExecuteBatchDmlResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExecuteBatchDmlResponse - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.ExecuteBatchDmlResponse; - - /** - * Creates a plain object from an ExecuteBatchDmlResponse message. Also converts values to other types if specified. - * @param message ExecuteBatchDmlResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.ExecuteBatchDmlResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExecuteBatchDmlResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExecuteBatchDmlResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PartitionOptions. */ - interface IPartitionOptions { - - /** PartitionOptions partitionSizeBytes */ - partitionSizeBytes?: (number|Long|string|null); - - /** PartitionOptions maxPartitions */ - maxPartitions?: (number|Long|string|null); - } - - /** Represents a PartitionOptions. */ - class PartitionOptions implements IPartitionOptions { - - /** - * Constructs a new PartitionOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.IPartitionOptions); - - /** PartitionOptions partitionSizeBytes. */ - public partitionSizeBytes: (number|Long|string); - - /** PartitionOptions maxPartitions. */ - public maxPartitions: (number|Long|string); - - /** - * Creates a new PartitionOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns PartitionOptions instance - */ - public static create(properties?: google.spanner.v1.IPartitionOptions): google.spanner.v1.PartitionOptions; - - /** - * Encodes the specified PartitionOptions message. Does not implicitly {@link google.spanner.v1.PartitionOptions.verify|verify} messages. - * @param message PartitionOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.IPartitionOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PartitionOptions message, length delimited. Does not implicitly {@link google.spanner.v1.PartitionOptions.verify|verify} messages. - * @param message PartitionOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.IPartitionOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PartitionOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PartitionOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.PartitionOptions; - - /** - * Decodes a PartitionOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PartitionOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.PartitionOptions; - - /** - * Verifies a PartitionOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PartitionOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PartitionOptions - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.PartitionOptions; - - /** - * Creates a plain object from a PartitionOptions message. Also converts values to other types if specified. - * @param message PartitionOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.PartitionOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PartitionOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PartitionOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PartitionQueryRequest. */ - interface IPartitionQueryRequest { - - /** PartitionQueryRequest session */ - session?: (string|null); - - /** PartitionQueryRequest transaction */ - transaction?: (google.spanner.v1.ITransactionSelector|null); - - /** PartitionQueryRequest sql */ - sql?: (string|null); - - /** PartitionQueryRequest params */ - params?: (google.protobuf.IStruct|null); - - /** PartitionQueryRequest paramTypes */ - paramTypes?: ({ [k: string]: google.spanner.v1.IType }|null); - - /** PartitionQueryRequest partitionOptions */ - partitionOptions?: (google.spanner.v1.IPartitionOptions|null); - } - - /** Represents a PartitionQueryRequest. */ - class PartitionQueryRequest implements IPartitionQueryRequest { - - /** - * Constructs a new PartitionQueryRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.IPartitionQueryRequest); - - /** PartitionQueryRequest session. */ - public session: string; - - /** PartitionQueryRequest transaction. */ - public transaction?: (google.spanner.v1.ITransactionSelector|null); - - /** PartitionQueryRequest sql. */ - public sql: string; - - /** PartitionQueryRequest params. */ - public params?: (google.protobuf.IStruct|null); - - /** PartitionQueryRequest paramTypes. */ - public paramTypes: { [k: string]: google.spanner.v1.IType }; - - /** PartitionQueryRequest partitionOptions. */ - public partitionOptions?: (google.spanner.v1.IPartitionOptions|null); - - /** - * Creates a new PartitionQueryRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns PartitionQueryRequest instance - */ - public static create(properties?: google.spanner.v1.IPartitionQueryRequest): google.spanner.v1.PartitionQueryRequest; - - /** - * Encodes the specified PartitionQueryRequest message. Does not implicitly {@link google.spanner.v1.PartitionQueryRequest.verify|verify} messages. - * @param message PartitionQueryRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.IPartitionQueryRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PartitionQueryRequest message, length delimited. Does not implicitly {@link google.spanner.v1.PartitionQueryRequest.verify|verify} messages. - * @param message PartitionQueryRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.IPartitionQueryRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PartitionQueryRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PartitionQueryRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.PartitionQueryRequest; - - /** - * Decodes a PartitionQueryRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PartitionQueryRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.PartitionQueryRequest; - - /** - * Verifies a PartitionQueryRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PartitionQueryRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PartitionQueryRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.PartitionQueryRequest; - - /** - * Creates a plain object from a PartitionQueryRequest message. Also converts values to other types if specified. - * @param message PartitionQueryRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.PartitionQueryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PartitionQueryRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PartitionQueryRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PartitionReadRequest. */ - interface IPartitionReadRequest { - - /** PartitionReadRequest session */ - session?: (string|null); - - /** PartitionReadRequest transaction */ - transaction?: (google.spanner.v1.ITransactionSelector|null); - - /** PartitionReadRequest table */ - table?: (string|null); - - /** PartitionReadRequest index */ - index?: (string|null); - - /** PartitionReadRequest columns */ - columns?: (string[]|null); - - /** PartitionReadRequest keySet */ - keySet?: (google.spanner.v1.IKeySet|null); - - /** PartitionReadRequest partitionOptions */ - partitionOptions?: (google.spanner.v1.IPartitionOptions|null); - } - - /** Represents a PartitionReadRequest. */ - class PartitionReadRequest implements IPartitionReadRequest { - - /** - * Constructs a new PartitionReadRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.IPartitionReadRequest); - - /** PartitionReadRequest session. */ - public session: string; - - /** PartitionReadRequest transaction. */ - public transaction?: (google.spanner.v1.ITransactionSelector|null); - - /** PartitionReadRequest table. */ - public table: string; - - /** PartitionReadRequest index. */ - public index: string; - - /** PartitionReadRequest columns. */ - public columns: string[]; - - /** PartitionReadRequest keySet. */ - public keySet?: (google.spanner.v1.IKeySet|null); - - /** PartitionReadRequest partitionOptions. */ - public partitionOptions?: (google.spanner.v1.IPartitionOptions|null); - - /** - * Creates a new PartitionReadRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns PartitionReadRequest instance - */ - public static create(properties?: google.spanner.v1.IPartitionReadRequest): google.spanner.v1.PartitionReadRequest; - - /** - * Encodes the specified PartitionReadRequest message. Does not implicitly {@link google.spanner.v1.PartitionReadRequest.verify|verify} messages. - * @param message PartitionReadRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.IPartitionReadRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PartitionReadRequest message, length delimited. Does not implicitly {@link google.spanner.v1.PartitionReadRequest.verify|verify} messages. - * @param message PartitionReadRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.IPartitionReadRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PartitionReadRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PartitionReadRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.PartitionReadRequest; - - /** - * Decodes a PartitionReadRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PartitionReadRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.PartitionReadRequest; - - /** - * Verifies a PartitionReadRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PartitionReadRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PartitionReadRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.PartitionReadRequest; - - /** - * Creates a plain object from a PartitionReadRequest message. Also converts values to other types if specified. - * @param message PartitionReadRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.PartitionReadRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PartitionReadRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PartitionReadRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Partition. */ - interface IPartition { - - /** Partition partitionToken */ - partitionToken?: (Uint8Array|Buffer|string|null); - } - - /** Represents a Partition. */ - class Partition implements IPartition { - - /** - * Constructs a new Partition. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.IPartition); - - /** Partition partitionToken. */ - public partitionToken: (Uint8Array|Buffer|string); - - /** - * Creates a new Partition instance using the specified properties. - * @param [properties] Properties to set - * @returns Partition instance - */ - public static create(properties?: google.spanner.v1.IPartition): google.spanner.v1.Partition; - - /** - * Encodes the specified Partition message. Does not implicitly {@link google.spanner.v1.Partition.verify|verify} messages. - * @param message Partition message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.IPartition, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Partition message, length delimited. Does not implicitly {@link google.spanner.v1.Partition.verify|verify} messages. - * @param message Partition message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.IPartition, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Partition message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Partition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.Partition; - - /** - * Decodes a Partition message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Partition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.Partition; - - /** - * Verifies a Partition message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Partition message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Partition - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.Partition; - - /** - * Creates a plain object from a Partition message. Also converts values to other types if specified. - * @param message Partition - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.Partition, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Partition to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Partition - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PartitionResponse. */ - interface IPartitionResponse { - - /** PartitionResponse partitions */ - partitions?: (google.spanner.v1.IPartition[]|null); - - /** PartitionResponse transaction */ - transaction?: (google.spanner.v1.ITransaction|null); - } - - /** Represents a PartitionResponse. */ - class PartitionResponse implements IPartitionResponse { - - /** - * Constructs a new PartitionResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.IPartitionResponse); - - /** PartitionResponse partitions. */ - public partitions: google.spanner.v1.IPartition[]; - - /** PartitionResponse transaction. */ - public transaction?: (google.spanner.v1.ITransaction|null); - - /** - * Creates a new PartitionResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns PartitionResponse instance - */ - public static create(properties?: google.spanner.v1.IPartitionResponse): google.spanner.v1.PartitionResponse; - - /** - * Encodes the specified PartitionResponse message. Does not implicitly {@link google.spanner.v1.PartitionResponse.verify|verify} messages. - * @param message PartitionResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.IPartitionResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PartitionResponse message, length delimited. Does not implicitly {@link google.spanner.v1.PartitionResponse.verify|verify} messages. - * @param message PartitionResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.IPartitionResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PartitionResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PartitionResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.PartitionResponse; - - /** - * Decodes a PartitionResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PartitionResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.PartitionResponse; - - /** - * Verifies a PartitionResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PartitionResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PartitionResponse - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.PartitionResponse; - - /** - * Creates a plain object from a PartitionResponse message. Also converts values to other types if specified. - * @param message PartitionResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.PartitionResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PartitionResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PartitionResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ReadRequest. */ - interface IReadRequest { - - /** ReadRequest session */ - session?: (string|null); - - /** ReadRequest transaction */ - transaction?: (google.spanner.v1.ITransactionSelector|null); - - /** ReadRequest table */ - table?: (string|null); - - /** ReadRequest index */ - index?: (string|null); - - /** ReadRequest columns */ - columns?: (string[]|null); - - /** ReadRequest keySet */ - keySet?: (google.spanner.v1.IKeySet|null); - - /** ReadRequest limit */ - limit?: (number|Long|string|null); - - /** ReadRequest resumeToken */ - resumeToken?: (Uint8Array|Buffer|string|null); - - /** ReadRequest partitionToken */ - partitionToken?: (Uint8Array|Buffer|string|null); - - /** ReadRequest requestOptions */ - requestOptions?: (google.spanner.v1.IRequestOptions|null); - - /** ReadRequest directedReadOptions */ - directedReadOptions?: (google.spanner.v1.IDirectedReadOptions|null); - - /** ReadRequest dataBoostEnabled */ - dataBoostEnabled?: (boolean|null); - - /** ReadRequest orderBy */ - orderBy?: (google.spanner.v1.ReadRequest.OrderBy|keyof typeof google.spanner.v1.ReadRequest.OrderBy|null); - - /** ReadRequest lockHint */ - lockHint?: (google.spanner.v1.ReadRequest.LockHint|keyof typeof google.spanner.v1.ReadRequest.LockHint|null); - - /** ReadRequest routingHint */ - routingHint?: (google.spanner.v1.IRoutingHint|null); - } - - /** Represents a ReadRequest. */ - class ReadRequest implements IReadRequest { - - /** - * Constructs a new ReadRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.IReadRequest); - - /** ReadRequest session. */ - public session: string; - - /** ReadRequest transaction. */ - public transaction?: (google.spanner.v1.ITransactionSelector|null); - - /** ReadRequest table. */ - public table: string; - - /** ReadRequest index. */ - public index: string; - - /** ReadRequest columns. */ - public columns: string[]; - - /** ReadRequest keySet. */ - public keySet?: (google.spanner.v1.IKeySet|null); - - /** ReadRequest limit. */ - public limit: (number|Long|string); - - /** ReadRequest resumeToken. */ - public resumeToken: (Uint8Array|Buffer|string); - - /** ReadRequest partitionToken. */ - public partitionToken: (Uint8Array|Buffer|string); - - /** ReadRequest requestOptions. */ - public requestOptions?: (google.spanner.v1.IRequestOptions|null); - - /** ReadRequest directedReadOptions. */ - public directedReadOptions?: (google.spanner.v1.IDirectedReadOptions|null); - - /** ReadRequest dataBoostEnabled. */ - public dataBoostEnabled: boolean; - - /** ReadRequest orderBy. */ - public orderBy: (google.spanner.v1.ReadRequest.OrderBy|keyof typeof google.spanner.v1.ReadRequest.OrderBy); - - /** ReadRequest lockHint. */ - public lockHint: (google.spanner.v1.ReadRequest.LockHint|keyof typeof google.spanner.v1.ReadRequest.LockHint); - - /** ReadRequest routingHint. */ - public routingHint?: (google.spanner.v1.IRoutingHint|null); - - /** - * Creates a new ReadRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ReadRequest instance - */ - public static create(properties?: google.spanner.v1.IReadRequest): google.spanner.v1.ReadRequest; - - /** - * Encodes the specified ReadRequest message. Does not implicitly {@link google.spanner.v1.ReadRequest.verify|verify} messages. - * @param message ReadRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.IReadRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ReadRequest message, length delimited. Does not implicitly {@link google.spanner.v1.ReadRequest.verify|verify} messages. - * @param message ReadRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.IReadRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ReadRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ReadRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.ReadRequest; - - /** - * Decodes a ReadRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ReadRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.ReadRequest; - - /** - * Verifies a ReadRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ReadRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ReadRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.ReadRequest; - - /** - * Creates a plain object from a ReadRequest message. Also converts values to other types if specified. - * @param message ReadRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.ReadRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ReadRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ReadRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ReadRequest { - - /** OrderBy enum. */ - enum OrderBy { - ORDER_BY_UNSPECIFIED = 0, - ORDER_BY_PRIMARY_KEY = 1, - ORDER_BY_NO_ORDER = 2 - } - - /** LockHint enum. */ - enum LockHint { - LOCK_HINT_UNSPECIFIED = 0, - LOCK_HINT_SHARED = 1, - LOCK_HINT_EXCLUSIVE = 2 - } - } - - /** Properties of a BeginTransactionRequest. */ - interface IBeginTransactionRequest { - - /** BeginTransactionRequest session */ - session?: (string|null); - - /** BeginTransactionRequest options */ - options?: (google.spanner.v1.ITransactionOptions|null); - - /** BeginTransactionRequest requestOptions */ - requestOptions?: (google.spanner.v1.IRequestOptions|null); - - /** BeginTransactionRequest mutationKey */ - mutationKey?: (google.spanner.v1.IMutation|null); - } - - /** Represents a BeginTransactionRequest. */ - class BeginTransactionRequest implements IBeginTransactionRequest { - - /** - * Constructs a new BeginTransactionRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.IBeginTransactionRequest); - - /** BeginTransactionRequest session. */ - public session: string; - - /** BeginTransactionRequest options. */ - public options?: (google.spanner.v1.ITransactionOptions|null); - - /** BeginTransactionRequest requestOptions. */ - public requestOptions?: (google.spanner.v1.IRequestOptions|null); - - /** BeginTransactionRequest mutationKey. */ - public mutationKey?: (google.spanner.v1.IMutation|null); - - /** - * Creates a new BeginTransactionRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns BeginTransactionRequest instance - */ - public static create(properties?: google.spanner.v1.IBeginTransactionRequest): google.spanner.v1.BeginTransactionRequest; - - /** - * Encodes the specified BeginTransactionRequest message. Does not implicitly {@link google.spanner.v1.BeginTransactionRequest.verify|verify} messages. - * @param message BeginTransactionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.IBeginTransactionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BeginTransactionRequest message, length delimited. Does not implicitly {@link google.spanner.v1.BeginTransactionRequest.verify|verify} messages. - * @param message BeginTransactionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.IBeginTransactionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BeginTransactionRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BeginTransactionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.BeginTransactionRequest; - - /** - * Decodes a BeginTransactionRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BeginTransactionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.BeginTransactionRequest; - - /** - * Verifies a BeginTransactionRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BeginTransactionRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BeginTransactionRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.BeginTransactionRequest; - - /** - * Creates a plain object from a BeginTransactionRequest message. Also converts values to other types if specified. - * @param message BeginTransactionRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.BeginTransactionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BeginTransactionRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BeginTransactionRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CommitRequest. */ - interface ICommitRequest { - - /** CommitRequest session */ - session?: (string|null); - - /** CommitRequest transactionId */ - transactionId?: (Uint8Array|Buffer|string|null); - - /** CommitRequest singleUseTransaction */ - singleUseTransaction?: (google.spanner.v1.ITransactionOptions|null); - - /** CommitRequest mutations */ - mutations?: (google.spanner.v1.IMutation[]|null); - - /** CommitRequest returnCommitStats */ - returnCommitStats?: (boolean|null); - - /** CommitRequest maxCommitDelay */ - maxCommitDelay?: (google.protobuf.IDuration|null); - - /** CommitRequest requestOptions */ - requestOptions?: (google.spanner.v1.IRequestOptions|null); - - /** CommitRequest precommitToken */ - precommitToken?: (google.spanner.v1.IMultiplexedSessionPrecommitToken|null); - } - - /** Represents a CommitRequest. */ - class CommitRequest implements ICommitRequest { - - /** - * Constructs a new CommitRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.ICommitRequest); - - /** CommitRequest session. */ - public session: string; - - /** CommitRequest transactionId. */ - public transactionId?: (Uint8Array|Buffer|string|null); - - /** CommitRequest singleUseTransaction. */ - public singleUseTransaction?: (google.spanner.v1.ITransactionOptions|null); - - /** CommitRequest mutations. */ - public mutations: google.spanner.v1.IMutation[]; - - /** CommitRequest returnCommitStats. */ - public returnCommitStats: boolean; - - /** CommitRequest maxCommitDelay. */ - public maxCommitDelay?: (google.protobuf.IDuration|null); - - /** CommitRequest requestOptions. */ - public requestOptions?: (google.spanner.v1.IRequestOptions|null); - - /** CommitRequest precommitToken. */ - public precommitToken?: (google.spanner.v1.IMultiplexedSessionPrecommitToken|null); - - /** CommitRequest transaction. */ - public transaction?: ("transactionId"|"singleUseTransaction"); - - /** - * Creates a new CommitRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CommitRequest instance - */ - public static create(properties?: google.spanner.v1.ICommitRequest): google.spanner.v1.CommitRequest; - - /** - * Encodes the specified CommitRequest message. Does not implicitly {@link google.spanner.v1.CommitRequest.verify|verify} messages. - * @param message CommitRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.ICommitRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CommitRequest message, length delimited. Does not implicitly {@link google.spanner.v1.CommitRequest.verify|verify} messages. - * @param message CommitRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.ICommitRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CommitRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CommitRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.CommitRequest; - - /** - * Decodes a CommitRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CommitRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.CommitRequest; - - /** - * Verifies a CommitRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CommitRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CommitRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.CommitRequest; - - /** - * Creates a plain object from a CommitRequest message. Also converts values to other types if specified. - * @param message CommitRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.CommitRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CommitRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CommitRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RollbackRequest. */ - interface IRollbackRequest { - - /** RollbackRequest session */ - session?: (string|null); - - /** RollbackRequest transactionId */ - transactionId?: (Uint8Array|Buffer|string|null); - } - - /** Represents a RollbackRequest. */ - class RollbackRequest implements IRollbackRequest { - - /** - * Constructs a new RollbackRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.IRollbackRequest); - - /** RollbackRequest session. */ - public session: string; - - /** RollbackRequest transactionId. */ - public transactionId: (Uint8Array|Buffer|string); - - /** - * Creates a new RollbackRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns RollbackRequest instance - */ - public static create(properties?: google.spanner.v1.IRollbackRequest): google.spanner.v1.RollbackRequest; - - /** - * Encodes the specified RollbackRequest message. Does not implicitly {@link google.spanner.v1.RollbackRequest.verify|verify} messages. - * @param message RollbackRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.IRollbackRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RollbackRequest message, length delimited. Does not implicitly {@link google.spanner.v1.RollbackRequest.verify|verify} messages. - * @param message RollbackRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.IRollbackRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RollbackRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RollbackRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.RollbackRequest; - - /** - * Decodes a RollbackRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RollbackRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.RollbackRequest; - - /** - * Verifies a RollbackRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RollbackRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RollbackRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.RollbackRequest; - - /** - * Creates a plain object from a RollbackRequest message. Also converts values to other types if specified. - * @param message RollbackRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.RollbackRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RollbackRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RollbackRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BatchWriteRequest. */ - interface IBatchWriteRequest { - - /** BatchWriteRequest session */ - session?: (string|null); - - /** BatchWriteRequest requestOptions */ - requestOptions?: (google.spanner.v1.IRequestOptions|null); - - /** BatchWriteRequest mutationGroups */ - mutationGroups?: (google.spanner.v1.BatchWriteRequest.IMutationGroup[]|null); - - /** BatchWriteRequest excludeTxnFromChangeStreams */ - excludeTxnFromChangeStreams?: (boolean|null); - } - - /** Represents a BatchWriteRequest. */ - class BatchWriteRequest implements IBatchWriteRequest { - - /** - * Constructs a new BatchWriteRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.IBatchWriteRequest); - - /** BatchWriteRequest session. */ - public session: string; - - /** BatchWriteRequest requestOptions. */ - public requestOptions?: (google.spanner.v1.IRequestOptions|null); - - /** BatchWriteRequest mutationGroups. */ - public mutationGroups: google.spanner.v1.BatchWriteRequest.IMutationGroup[]; - - /** BatchWriteRequest excludeTxnFromChangeStreams. */ - public excludeTxnFromChangeStreams: boolean; - - /** - * Creates a new BatchWriteRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns BatchWriteRequest instance - */ - public static create(properties?: google.spanner.v1.IBatchWriteRequest): google.spanner.v1.BatchWriteRequest; - - /** - * Encodes the specified BatchWriteRequest message. Does not implicitly {@link google.spanner.v1.BatchWriteRequest.verify|verify} messages. - * @param message BatchWriteRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.IBatchWriteRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BatchWriteRequest message, length delimited. Does not implicitly {@link google.spanner.v1.BatchWriteRequest.verify|verify} messages. - * @param message BatchWriteRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.IBatchWriteRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BatchWriteRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BatchWriteRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.BatchWriteRequest; - - /** - * Decodes a BatchWriteRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BatchWriteRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.BatchWriteRequest; - - /** - * Verifies a BatchWriteRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BatchWriteRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BatchWriteRequest - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.BatchWriteRequest; - - /** - * Creates a plain object from a BatchWriteRequest message. Also converts values to other types if specified. - * @param message BatchWriteRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.BatchWriteRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BatchWriteRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BatchWriteRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace BatchWriteRequest { - - /** Properties of a MutationGroup. */ - interface IMutationGroup { - - /** MutationGroup mutations */ - mutations?: (google.spanner.v1.IMutation[]|null); - } - - /** Represents a MutationGroup. */ - class MutationGroup implements IMutationGroup { - - /** - * Constructs a new MutationGroup. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.BatchWriteRequest.IMutationGroup); - - /** MutationGroup mutations. */ - public mutations: google.spanner.v1.IMutation[]; - - /** - * Creates a new MutationGroup instance using the specified properties. - * @param [properties] Properties to set - * @returns MutationGroup instance - */ - public static create(properties?: google.spanner.v1.BatchWriteRequest.IMutationGroup): google.spanner.v1.BatchWriteRequest.MutationGroup; - - /** - * Encodes the specified MutationGroup message. Does not implicitly {@link google.spanner.v1.BatchWriteRequest.MutationGroup.verify|verify} messages. - * @param message MutationGroup message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.BatchWriteRequest.IMutationGroup, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MutationGroup message, length delimited. Does not implicitly {@link google.spanner.v1.BatchWriteRequest.MutationGroup.verify|verify} messages. - * @param message MutationGroup message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.BatchWriteRequest.IMutationGroup, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MutationGroup message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MutationGroup - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.BatchWriteRequest.MutationGroup; - - /** - * Decodes a MutationGroup message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MutationGroup - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.BatchWriteRequest.MutationGroup; - - /** - * Verifies a MutationGroup message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MutationGroup message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MutationGroup - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.BatchWriteRequest.MutationGroup; - - /** - * Creates a plain object from a MutationGroup message. Also converts values to other types if specified. - * @param message MutationGroup - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.BatchWriteRequest.MutationGroup, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MutationGroup to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MutationGroup - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a BatchWriteResponse. */ - interface IBatchWriteResponse { - - /** BatchWriteResponse indexes */ - indexes?: (number[]|null); - - /** BatchWriteResponse status */ - status?: (google.rpc.IStatus|null); - - /** BatchWriteResponse commitTimestamp */ - commitTimestamp?: (google.protobuf.ITimestamp|null); - } - - /** Represents a BatchWriteResponse. */ - class BatchWriteResponse implements IBatchWriteResponse { - - /** - * Constructs a new BatchWriteResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.spanner.v1.IBatchWriteResponse); - - /** BatchWriteResponse indexes. */ - public indexes: number[]; - - /** BatchWriteResponse status. */ - public status?: (google.rpc.IStatus|null); - - /** BatchWriteResponse commitTimestamp. */ - public commitTimestamp?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new BatchWriteResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns BatchWriteResponse instance - */ - public static create(properties?: google.spanner.v1.IBatchWriteResponse): google.spanner.v1.BatchWriteResponse; - - /** - * Encodes the specified BatchWriteResponse message. Does not implicitly {@link google.spanner.v1.BatchWriteResponse.verify|verify} messages. - * @param message BatchWriteResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.spanner.v1.IBatchWriteResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BatchWriteResponse message, length delimited. Does not implicitly {@link google.spanner.v1.BatchWriteResponse.verify|verify} messages. - * @param message BatchWriteResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.spanner.v1.IBatchWriteResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BatchWriteResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BatchWriteResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.BatchWriteResponse; - - /** - * Decodes a BatchWriteResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BatchWriteResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.BatchWriteResponse; - - /** - * Verifies a BatchWriteResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BatchWriteResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BatchWriteResponse - */ - public static fromObject(object: { [k: string]: any }): google.spanner.v1.BatchWriteResponse; - - /** - * Creates a plain object from a BatchWriteResponse message. Also converts values to other types if specified. - * @param message BatchWriteResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.spanner.v1.BatchWriteResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BatchWriteResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BatchWriteResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - } - - /** Namespace api. */ - namespace api { - - /** FieldBehavior enum. */ - enum FieldBehavior { - FIELD_BEHAVIOR_UNSPECIFIED = 0, - OPTIONAL = 1, - REQUIRED = 2, - OUTPUT_ONLY = 3, - INPUT_ONLY = 4, - IMMUTABLE = 5, - UNORDERED_LIST = 6, - NON_EMPTY_DEFAULT = 7, - IDENTIFIER = 8 - } - - /** Properties of a Http. */ - interface IHttp { - - /** Http rules */ - rules?: (google.api.IHttpRule[]|null); - - /** Http fullyDecodeReservedExpansion */ - fullyDecodeReservedExpansion?: (boolean|null); - } - - /** Represents a Http. */ - class Http implements IHttp { - - /** - * Constructs a new Http. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IHttp); - - /** Http rules. */ - public rules: google.api.IHttpRule[]; - - /** Http fullyDecodeReservedExpansion. */ - public fullyDecodeReservedExpansion: boolean; - - /** - * Creates a new Http instance using the specified properties. - * @param [properties] Properties to set - * @returns Http instance - */ - public static create(properties?: google.api.IHttp): google.api.Http; - - /** - * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @param message Http message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @param message Http message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Http message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Http - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Http; - - /** - * Decodes a Http message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Http - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Http; - - /** - * Verifies a Http message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Http message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Http - */ - public static fromObject(object: { [k: string]: any }): google.api.Http; - - /** - * Creates a plain object from a Http message. Also converts values to other types if specified. - * @param message Http - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Http to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Http - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a HttpRule. */ - interface IHttpRule { - - /** HttpRule selector */ - selector?: (string|null); - - /** HttpRule get */ - get?: (string|null); - - /** HttpRule put */ - put?: (string|null); - - /** HttpRule post */ - post?: (string|null); - - /** HttpRule delete */ - "delete"?: (string|null); - - /** HttpRule patch */ - patch?: (string|null); - - /** HttpRule custom */ - custom?: (google.api.ICustomHttpPattern|null); - - /** HttpRule body */ - body?: (string|null); - - /** HttpRule responseBody */ - responseBody?: (string|null); - - /** HttpRule additionalBindings */ - additionalBindings?: (google.api.IHttpRule[]|null); - } - - /** Represents a HttpRule. */ - class HttpRule implements IHttpRule { - - /** - * Constructs a new HttpRule. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IHttpRule); - - /** HttpRule selector. */ - public selector: string; - - /** HttpRule get. */ - public get?: (string|null); - - /** HttpRule put. */ - public put?: (string|null); - - /** HttpRule post. */ - public post?: (string|null); - - /** HttpRule delete. */ - public delete?: (string|null); - - /** HttpRule patch. */ - public patch?: (string|null); - - /** HttpRule custom. */ - public custom?: (google.api.ICustomHttpPattern|null); - - /** HttpRule body. */ - public body: string; - - /** HttpRule responseBody. */ - public responseBody: string; - - /** HttpRule additionalBindings. */ - public additionalBindings: google.api.IHttpRule[]; - - /** HttpRule pattern. */ - public pattern?: ("get"|"put"|"post"|"delete"|"patch"|"custom"); - - /** - * Creates a new HttpRule instance using the specified properties. - * @param [properties] Properties to set - * @returns HttpRule instance - */ - public static create(properties?: google.api.IHttpRule): google.api.HttpRule; - - /** - * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @param message HttpRule message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @param message HttpRule message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a HttpRule message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns HttpRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.HttpRule; - - /** - * Decodes a HttpRule message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns HttpRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.HttpRule; - - /** - * Verifies a HttpRule message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns HttpRule - */ - public static fromObject(object: { [k: string]: any }): google.api.HttpRule; - - /** - * Creates a plain object from a HttpRule message. Also converts values to other types if specified. - * @param message HttpRule - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.HttpRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this HttpRule to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for HttpRule - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CustomHttpPattern. */ - interface ICustomHttpPattern { - - /** CustomHttpPattern kind */ - kind?: (string|null); - - /** CustomHttpPattern path */ - path?: (string|null); - } - - /** Represents a CustomHttpPattern. */ - class CustomHttpPattern implements ICustomHttpPattern { - - /** - * Constructs a new CustomHttpPattern. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.ICustomHttpPattern); - - /** CustomHttpPattern kind. */ - public kind: string; - - /** CustomHttpPattern path. */ - public path: string; - - /** - * Creates a new CustomHttpPattern instance using the specified properties. - * @param [properties] Properties to set - * @returns CustomHttpPattern instance - */ - public static create(properties?: google.api.ICustomHttpPattern): google.api.CustomHttpPattern; - - /** - * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. - * @param message CustomHttpPattern message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. - * @param message CustomHttpPattern message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CustomHttpPattern message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CustomHttpPattern - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CustomHttpPattern; - - /** - * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CustomHttpPattern - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CustomHttpPattern; - - /** - * Verifies a CustomHttpPattern message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CustomHttpPattern - */ - public static fromObject(object: { [k: string]: any }): google.api.CustomHttpPattern; - - /** - * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. - * @param message CustomHttpPattern - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.CustomHttpPattern, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CustomHttpPattern to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CustomHttpPattern - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CommonLanguageSettings. */ - interface ICommonLanguageSettings { - - /** CommonLanguageSettings referenceDocsUri */ - referenceDocsUri?: (string|null); - - /** CommonLanguageSettings destinations */ - destinations?: (google.api.ClientLibraryDestination[]|null); - } - - /** Represents a CommonLanguageSettings. */ - class CommonLanguageSettings implements ICommonLanguageSettings { - - /** - * Constructs a new CommonLanguageSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.ICommonLanguageSettings); - - /** CommonLanguageSettings referenceDocsUri. */ - public referenceDocsUri: string; - - /** CommonLanguageSettings destinations. */ - public destinations: google.api.ClientLibraryDestination[]; - - /** - * Creates a new CommonLanguageSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns CommonLanguageSettings instance - */ - public static create(properties?: google.api.ICommonLanguageSettings): google.api.CommonLanguageSettings; - - /** - * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. - * @param message CommonLanguageSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. - * @param message CommonLanguageSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CommonLanguageSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CommonLanguageSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CommonLanguageSettings; - - /** - * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CommonLanguageSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CommonLanguageSettings; - - /** - * Verifies a CommonLanguageSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CommonLanguageSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.CommonLanguageSettings; - - /** - * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. - * @param message CommonLanguageSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.CommonLanguageSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CommonLanguageSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CommonLanguageSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ClientLibrarySettings. */ - interface IClientLibrarySettings { - - /** ClientLibrarySettings version */ - version?: (string|null); - - /** ClientLibrarySettings launchStage */ - launchStage?: (google.api.LaunchStage|keyof typeof google.api.LaunchStage|null); - - /** ClientLibrarySettings restNumericEnums */ - restNumericEnums?: (boolean|null); - - /** ClientLibrarySettings javaSettings */ - javaSettings?: (google.api.IJavaSettings|null); - - /** ClientLibrarySettings cppSettings */ - cppSettings?: (google.api.ICppSettings|null); - - /** ClientLibrarySettings phpSettings */ - phpSettings?: (google.api.IPhpSettings|null); - - /** ClientLibrarySettings pythonSettings */ - pythonSettings?: (google.api.IPythonSettings|null); - - /** ClientLibrarySettings nodeSettings */ - nodeSettings?: (google.api.INodeSettings|null); - - /** ClientLibrarySettings dotnetSettings */ - dotnetSettings?: (google.api.IDotnetSettings|null); - - /** ClientLibrarySettings rubySettings */ - rubySettings?: (google.api.IRubySettings|null); - - /** ClientLibrarySettings goSettings */ - goSettings?: (google.api.IGoSettings|null); - } - - /** Represents a ClientLibrarySettings. */ - class ClientLibrarySettings implements IClientLibrarySettings { - - /** - * Constructs a new ClientLibrarySettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IClientLibrarySettings); - - /** ClientLibrarySettings version. */ - public version: string; - - /** ClientLibrarySettings launchStage. */ - public launchStage: (google.api.LaunchStage|keyof typeof google.api.LaunchStage); - - /** ClientLibrarySettings restNumericEnums. */ - public restNumericEnums: boolean; - - /** ClientLibrarySettings javaSettings. */ - public javaSettings?: (google.api.IJavaSettings|null); - - /** ClientLibrarySettings cppSettings. */ - public cppSettings?: (google.api.ICppSettings|null); - - /** ClientLibrarySettings phpSettings. */ - public phpSettings?: (google.api.IPhpSettings|null); - - /** ClientLibrarySettings pythonSettings. */ - public pythonSettings?: (google.api.IPythonSettings|null); - - /** ClientLibrarySettings nodeSettings. */ - public nodeSettings?: (google.api.INodeSettings|null); - - /** ClientLibrarySettings dotnetSettings. */ - public dotnetSettings?: (google.api.IDotnetSettings|null); - - /** ClientLibrarySettings rubySettings. */ - public rubySettings?: (google.api.IRubySettings|null); - - /** ClientLibrarySettings goSettings. */ - public goSettings?: (google.api.IGoSettings|null); - - /** - * Creates a new ClientLibrarySettings instance using the specified properties. - * @param [properties] Properties to set - * @returns ClientLibrarySettings instance - */ - public static create(properties?: google.api.IClientLibrarySettings): google.api.ClientLibrarySettings; - - /** - * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. - * @param message ClientLibrarySettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. - * @param message ClientLibrarySettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ClientLibrarySettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ClientLibrarySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ClientLibrarySettings; - - /** - * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ClientLibrarySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ClientLibrarySettings; - - /** - * Verifies a ClientLibrarySettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ClientLibrarySettings - */ - public static fromObject(object: { [k: string]: any }): google.api.ClientLibrarySettings; - - /** - * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. - * @param message ClientLibrarySettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.ClientLibrarySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ClientLibrarySettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ClientLibrarySettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Publishing. */ - interface IPublishing { - - /** Publishing methodSettings */ - methodSettings?: (google.api.IMethodSettings[]|null); - - /** Publishing newIssueUri */ - newIssueUri?: (string|null); - - /** Publishing documentationUri */ - documentationUri?: (string|null); - - /** Publishing apiShortName */ - apiShortName?: (string|null); - - /** Publishing githubLabel */ - githubLabel?: (string|null); - - /** Publishing codeownerGithubTeams */ - codeownerGithubTeams?: (string[]|null); - - /** Publishing docTagPrefix */ - docTagPrefix?: (string|null); - - /** Publishing organization */ - organization?: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization|null); - - /** Publishing librarySettings */ - librarySettings?: (google.api.IClientLibrarySettings[]|null); - - /** Publishing protoReferenceDocumentationUri */ - protoReferenceDocumentationUri?: (string|null); - - /** Publishing restReferenceDocumentationUri */ - restReferenceDocumentationUri?: (string|null); - } - - /** Represents a Publishing. */ - class Publishing implements IPublishing { - - /** - * Constructs a new Publishing. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IPublishing); - - /** Publishing methodSettings. */ - public methodSettings: google.api.IMethodSettings[]; - - /** Publishing newIssueUri. */ - public newIssueUri: string; - - /** Publishing documentationUri. */ - public documentationUri: string; - - /** Publishing apiShortName. */ - public apiShortName: string; - - /** Publishing githubLabel. */ - public githubLabel: string; - - /** Publishing codeownerGithubTeams. */ - public codeownerGithubTeams: string[]; - - /** Publishing docTagPrefix. */ - public docTagPrefix: string; - - /** Publishing organization. */ - public organization: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization); - - /** Publishing librarySettings. */ - public librarySettings: google.api.IClientLibrarySettings[]; - - /** Publishing protoReferenceDocumentationUri. */ - public protoReferenceDocumentationUri: string; - - /** Publishing restReferenceDocumentationUri. */ - public restReferenceDocumentationUri: string; - - /** - * Creates a new Publishing instance using the specified properties. - * @param [properties] Properties to set - * @returns Publishing instance - */ - public static create(properties?: google.api.IPublishing): google.api.Publishing; - - /** - * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. - * @param message Publishing message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. - * @param message Publishing message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Publishing message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Publishing - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Publishing; - - /** - * Decodes a Publishing message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Publishing - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Publishing; - - /** - * Verifies a Publishing message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Publishing message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Publishing - */ - public static fromObject(object: { [k: string]: any }): google.api.Publishing; - - /** - * Creates a plain object from a Publishing message. Also converts values to other types if specified. - * @param message Publishing - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.Publishing, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Publishing to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Publishing - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a JavaSettings. */ - interface IJavaSettings { - - /** JavaSettings libraryPackage */ - libraryPackage?: (string|null); - - /** JavaSettings serviceClassNames */ - serviceClassNames?: ({ [k: string]: string }|null); - - /** JavaSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a JavaSettings. */ - class JavaSettings implements IJavaSettings { - - /** - * Constructs a new JavaSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IJavaSettings); - - /** JavaSettings libraryPackage. */ - public libraryPackage: string; - - /** JavaSettings serviceClassNames. */ - public serviceClassNames: { [k: string]: string }; - - /** JavaSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new JavaSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns JavaSettings instance - */ - public static create(properties?: google.api.IJavaSettings): google.api.JavaSettings; - - /** - * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. - * @param message JavaSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. - * @param message JavaSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a JavaSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns JavaSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.JavaSettings; - - /** - * Decodes a JavaSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns JavaSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.JavaSettings; - - /** - * Verifies a JavaSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns JavaSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.JavaSettings; - - /** - * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. - * @param message JavaSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.JavaSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this JavaSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for JavaSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CppSettings. */ - interface ICppSettings { - - /** CppSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a CppSettings. */ - class CppSettings implements ICppSettings { - - /** - * Constructs a new CppSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.ICppSettings); - - /** CppSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new CppSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns CppSettings instance - */ - public static create(properties?: google.api.ICppSettings): google.api.CppSettings; - - /** - * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. - * @param message CppSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. - * @param message CppSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CppSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CppSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CppSettings; - - /** - * Decodes a CppSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CppSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CppSettings; - - /** - * Verifies a CppSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CppSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.CppSettings; - - /** - * Creates a plain object from a CppSettings message. Also converts values to other types if specified. - * @param message CppSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.CppSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CppSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CppSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PhpSettings. */ - interface IPhpSettings { - - /** PhpSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a PhpSettings. */ - class PhpSettings implements IPhpSettings { - - /** - * Constructs a new PhpSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IPhpSettings); - - /** PhpSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new PhpSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns PhpSettings instance - */ - public static create(properties?: google.api.IPhpSettings): google.api.PhpSettings; - - /** - * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. - * @param message PhpSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. - * @param message PhpSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PhpSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PhpSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PhpSettings; - - /** - * Decodes a PhpSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PhpSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PhpSettings; - - /** - * Verifies a PhpSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PhpSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.PhpSettings; - - /** - * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. - * @param message PhpSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.PhpSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PhpSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PhpSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PythonSettings. */ - interface IPythonSettings { - - /** PythonSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a PythonSettings. */ - class PythonSettings implements IPythonSettings { - - /** - * Constructs a new PythonSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IPythonSettings); - - /** PythonSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new PythonSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns PythonSettings instance - */ - public static create(properties?: google.api.IPythonSettings): google.api.PythonSettings; - - /** - * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. - * @param message PythonSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. - * @param message PythonSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PythonSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PythonSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PythonSettings; - - /** - * Decodes a PythonSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PythonSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PythonSettings; - - /** - * Verifies a PythonSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PythonSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.PythonSettings; - - /** - * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. - * @param message PythonSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.PythonSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PythonSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PythonSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a NodeSettings. */ - interface INodeSettings { - - /** NodeSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a NodeSettings. */ - class NodeSettings implements INodeSettings { - - /** - * Constructs a new NodeSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.INodeSettings); - - /** NodeSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new NodeSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns NodeSettings instance - */ - public static create(properties?: google.api.INodeSettings): google.api.NodeSettings; - - /** - * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. - * @param message NodeSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. - * @param message NodeSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a NodeSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns NodeSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.NodeSettings; - - /** - * Decodes a NodeSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns NodeSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.NodeSettings; - - /** - * Verifies a NodeSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns NodeSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.NodeSettings; - - /** - * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. - * @param message NodeSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.NodeSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this NodeSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for NodeSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DotnetSettings. */ - interface IDotnetSettings { - - /** DotnetSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - - /** DotnetSettings renamedServices */ - renamedServices?: ({ [k: string]: string }|null); - - /** DotnetSettings renamedResources */ - renamedResources?: ({ [k: string]: string }|null); - - /** DotnetSettings ignoredResources */ - ignoredResources?: (string[]|null); - - /** DotnetSettings forcedNamespaceAliases */ - forcedNamespaceAliases?: (string[]|null); - - /** DotnetSettings handwrittenSignatures */ - handwrittenSignatures?: (string[]|null); - } - - /** Represents a DotnetSettings. */ - class DotnetSettings implements IDotnetSettings { - - /** - * Constructs a new DotnetSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IDotnetSettings); - - /** DotnetSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** DotnetSettings renamedServices. */ - public renamedServices: { [k: string]: string }; - - /** DotnetSettings renamedResources. */ - public renamedResources: { [k: string]: string }; - - /** DotnetSettings ignoredResources. */ - public ignoredResources: string[]; - - /** DotnetSettings forcedNamespaceAliases. */ - public forcedNamespaceAliases: string[]; - - /** DotnetSettings handwrittenSignatures. */ - public handwrittenSignatures: string[]; - - /** - * Creates a new DotnetSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns DotnetSettings instance - */ - public static create(properties?: google.api.IDotnetSettings): google.api.DotnetSettings; - - /** - * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. - * @param message DotnetSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. - * @param message DotnetSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DotnetSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DotnetSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.DotnetSettings; - - /** - * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DotnetSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.DotnetSettings; - - /** - * Verifies a DotnetSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DotnetSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.DotnetSettings; - - /** - * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. - * @param message DotnetSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.DotnetSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DotnetSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DotnetSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RubySettings. */ - interface IRubySettings { - - /** RubySettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a RubySettings. */ - class RubySettings implements IRubySettings { - - /** - * Constructs a new RubySettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IRubySettings); - - /** RubySettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new RubySettings instance using the specified properties. - * @param [properties] Properties to set - * @returns RubySettings instance - */ - public static create(properties?: google.api.IRubySettings): google.api.RubySettings; - - /** - * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. - * @param message RubySettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. - * @param message RubySettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RubySettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RubySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.RubySettings; - - /** - * Decodes a RubySettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RubySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.RubySettings; - - /** - * Verifies a RubySettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RubySettings - */ - public static fromObject(object: { [k: string]: any }): google.api.RubySettings; - - /** - * Creates a plain object from a RubySettings message. Also converts values to other types if specified. - * @param message RubySettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.RubySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RubySettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RubySettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GoSettings. */ - interface IGoSettings { - - /** GoSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a GoSettings. */ - class GoSettings implements IGoSettings { - - /** - * Constructs a new GoSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IGoSettings); - - /** GoSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new GoSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns GoSettings instance - */ - public static create(properties?: google.api.IGoSettings): google.api.GoSettings; - - /** - * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. - * @param message GoSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. - * @param message GoSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GoSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GoSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.GoSettings; - - /** - * Decodes a GoSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GoSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.GoSettings; - - /** - * Verifies a GoSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GoSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.GoSettings; - - /** - * Creates a plain object from a GoSettings message. Also converts values to other types if specified. - * @param message GoSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.GoSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GoSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GoSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a MethodSettings. */ - interface IMethodSettings { - - /** MethodSettings selector */ - selector?: (string|null); - - /** MethodSettings longRunning */ - longRunning?: (google.api.MethodSettings.ILongRunning|null); - - /** MethodSettings autoPopulatedFields */ - autoPopulatedFields?: (string[]|null); - } - - /** Represents a MethodSettings. */ - class MethodSettings implements IMethodSettings { - - /** - * Constructs a new MethodSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IMethodSettings); - - /** MethodSettings selector. */ - public selector: string; - - /** MethodSettings longRunning. */ - public longRunning?: (google.api.MethodSettings.ILongRunning|null); - - /** MethodSettings autoPopulatedFields. */ - public autoPopulatedFields: string[]; - - /** - * Creates a new MethodSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns MethodSettings instance - */ - public static create(properties?: google.api.IMethodSettings): google.api.MethodSettings; - - /** - * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. - * @param message MethodSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. - * @param message MethodSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MethodSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MethodSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.MethodSettings; - - /** - * Decodes a MethodSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MethodSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.MethodSettings; - - /** - * Verifies a MethodSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MethodSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.MethodSettings; - - /** - * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. - * @param message MethodSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.MethodSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MethodSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MethodSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace MethodSettings { - - /** Properties of a LongRunning. */ - interface ILongRunning { - - /** LongRunning initialPollDelay */ - initialPollDelay?: (google.protobuf.IDuration|null); - - /** LongRunning pollDelayMultiplier */ - pollDelayMultiplier?: (number|null); - - /** LongRunning maxPollDelay */ - maxPollDelay?: (google.protobuf.IDuration|null); - - /** LongRunning totalPollTimeout */ - totalPollTimeout?: (google.protobuf.IDuration|null); - } - - /** Represents a LongRunning. */ - class LongRunning implements ILongRunning { - - /** - * Constructs a new LongRunning. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.MethodSettings.ILongRunning); - - /** LongRunning initialPollDelay. */ - public initialPollDelay?: (google.protobuf.IDuration|null); - - /** LongRunning pollDelayMultiplier. */ - public pollDelayMultiplier: number; - - /** LongRunning maxPollDelay. */ - public maxPollDelay?: (google.protobuf.IDuration|null); - - /** LongRunning totalPollTimeout. */ - public totalPollTimeout?: (google.protobuf.IDuration|null); - - /** - * Creates a new LongRunning instance using the specified properties. - * @param [properties] Properties to set - * @returns LongRunning instance - */ - public static create(properties?: google.api.MethodSettings.ILongRunning): google.api.MethodSettings.LongRunning; - - /** - * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. - * @param message LongRunning message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. - * @param message LongRunning message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a LongRunning message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns LongRunning - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.MethodSettings.LongRunning; - - /** - * Decodes a LongRunning message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns LongRunning - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.MethodSettings.LongRunning; - - /** - * Verifies a LongRunning message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LongRunning - */ - public static fromObject(object: { [k: string]: any }): google.api.MethodSettings.LongRunning; - - /** - * Creates a plain object from a LongRunning message. Also converts values to other types if specified. - * @param message LongRunning - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.MethodSettings.LongRunning, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this LongRunning to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for LongRunning - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** ClientLibraryOrganization enum. */ - enum ClientLibraryOrganization { - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0, - CLOUD = 1, - ADS = 2, - PHOTOS = 3, - STREET_VIEW = 4, - SHOPPING = 5, - GEO = 6, - GENERATIVE_AI = 7 - } - - /** ClientLibraryDestination enum. */ - enum ClientLibraryDestination { - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0, - GITHUB = 10, - PACKAGE_MANAGER = 20 - } - - /** LaunchStage enum. */ - enum LaunchStage { - LAUNCH_STAGE_UNSPECIFIED = 0, - UNIMPLEMENTED = 6, - PRELAUNCH = 7, - EARLY_ACCESS = 1, - ALPHA = 2, - BETA = 3, - GA = 4, - DEPRECATED = 5 - } - - /** Properties of a ResourceDescriptor. */ - interface IResourceDescriptor { - - /** ResourceDescriptor type */ - type?: (string|null); - - /** ResourceDescriptor pattern */ - pattern?: (string[]|null); - - /** ResourceDescriptor nameField */ - nameField?: (string|null); - - /** ResourceDescriptor history */ - history?: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History|null); - - /** ResourceDescriptor plural */ - plural?: (string|null); - - /** ResourceDescriptor singular */ - singular?: (string|null); - - /** ResourceDescriptor style */ - style?: (google.api.ResourceDescriptor.Style[]|null); - } - - /** Represents a ResourceDescriptor. */ - class ResourceDescriptor implements IResourceDescriptor { - - /** - * Constructs a new ResourceDescriptor. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IResourceDescriptor); - - /** ResourceDescriptor type. */ - public type: string; - - /** ResourceDescriptor pattern. */ - public pattern: string[]; - - /** ResourceDescriptor nameField. */ - public nameField: string; - - /** ResourceDescriptor history. */ - public history: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History); - - /** ResourceDescriptor plural. */ - public plural: string; - - /** ResourceDescriptor singular. */ - public singular: string; - - /** ResourceDescriptor style. */ - public style: google.api.ResourceDescriptor.Style[]; - - /** - * Creates a new ResourceDescriptor instance using the specified properties. - * @param [properties] Properties to set - * @returns ResourceDescriptor instance - */ - public static create(properties?: google.api.IResourceDescriptor): google.api.ResourceDescriptor; - - /** - * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. - * @param message ResourceDescriptor message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. - * @param message ResourceDescriptor message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ResourceDescriptor message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ResourceDescriptor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceDescriptor; - - /** - * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ResourceDescriptor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceDescriptor; - - /** - * Verifies a ResourceDescriptor message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ResourceDescriptor - */ - public static fromObject(object: { [k: string]: any }): google.api.ResourceDescriptor; - - /** - * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. - * @param message ResourceDescriptor - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.ResourceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ResourceDescriptor to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ResourceDescriptor - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ResourceDescriptor { - - /** History enum. */ - enum History { - HISTORY_UNSPECIFIED = 0, - ORIGINALLY_SINGLE_PATTERN = 1, - FUTURE_MULTI_PATTERN = 2 - } - - /** Style enum. */ - enum Style { - STYLE_UNSPECIFIED = 0, - DECLARATIVE_FRIENDLY = 1 - } - } - - /** Properties of a ResourceReference. */ - interface IResourceReference { - - /** ResourceReference type */ - type?: (string|null); - - /** ResourceReference childType */ - childType?: (string|null); - } - - /** Represents a ResourceReference. */ - class ResourceReference implements IResourceReference { - - /** - * Constructs a new ResourceReference. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IResourceReference); - - /** ResourceReference type. */ - public type: string; - - /** ResourceReference childType. */ - public childType: string; - - /** - * Creates a new ResourceReference instance using the specified properties. - * @param [properties] Properties to set - * @returns ResourceReference instance - */ - public static create(properties?: google.api.IResourceReference): google.api.ResourceReference; - - /** - * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. - * @param message ResourceReference message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. - * @param message ResourceReference message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ResourceReference message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ResourceReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceReference; - - /** - * Decodes a ResourceReference message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ResourceReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceReference; - - /** - * Verifies a ResourceReference message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ResourceReference - */ - public static fromObject(object: { [k: string]: any }): google.api.ResourceReference; - - /** - * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. - * @param message ResourceReference - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.ResourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ResourceReference to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ResourceReference - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Namespace rpc. */ - namespace rpc { - - /** Properties of a Status. */ - interface IStatus { - - /** Status code */ - code?: (number|null); - - /** Status message */ - message?: (string|null); - - /** Status details */ - details?: (google.protobuf.IAny[]|null); - } - - /** Represents a Status. */ - class Status implements IStatus { - - /** - * Constructs a new Status. - * @param [properties] Properties to set - */ - constructor(properties?: google.rpc.IStatus); - - /** Status code. */ - public code: number; - - /** Status message. */ - public message: string; - - /** Status details. */ - public details: google.protobuf.IAny[]; - - /** - * Creates a new Status instance using the specified properties. - * @param [properties] Properties to set - * @returns Status instance - */ - public static create(properties?: google.rpc.IStatus): google.rpc.Status; - - /** - * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. - * @param message Status message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. - * @param message Status message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Status message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Status - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.rpc.Status; - - /** - * Decodes a Status message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Status - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.rpc.Status; - - /** - * Verifies a Status message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Status message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Status - */ - public static fromObject(object: { [k: string]: any }): google.rpc.Status; - - /** - * Creates a plain object from a Status message. Also converts values to other types if specified. - * @param message Status - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.rpc.Status, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Status to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Status - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } -} diff --git a/owl-bot-staging/v1/protos/protos.js b/owl-bot-staging/v1/protos/protos.js deleted file mode 100644 index 2aa5a7c34..000000000 --- a/owl-bot-staging/v1/protos/protos.js +++ /dev/null @@ -1,45218 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ -(function(global, factory) { /* global define, require, module */ - - /* AMD */ if (typeof define === 'function' && define.amd) - define(["protobufjs/minimal"], factory); - - /* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports) - module.exports = factory(require("google-gax/build/src/protobuf").protobufMinimal); - -})(this, function($protobuf) { - "use strict"; - - // Common aliases - var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; - - // Exported root namespace - var $root = $protobuf.roots._google_cloud_spanner_protos || ($protobuf.roots._google_cloud_spanner_protos = {}); - - $root.google = (function() { - - /** - * Namespace google. - * @exports google - * @namespace - */ - var google = {}; - - google.protobuf = (function() { - - /** - * Namespace protobuf. - * @memberof google - * @namespace - */ - var protobuf = {}; - - protobuf.Struct = (function() { - - /** - * Properties of a Struct. - * @memberof google.protobuf - * @interface IStruct - * @property {Object.|null} [fields] Struct fields - */ - - /** - * Constructs a new Struct. - * @memberof google.protobuf - * @classdesc Represents a Struct. - * @implements IStruct - * @constructor - * @param {google.protobuf.IStruct=} [properties] Properties to set - */ - function Struct(properties) { - this.fields = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Struct fields. - * @member {Object.} fields - * @memberof google.protobuf.Struct - * @instance - */ - Struct.prototype.fields = $util.emptyObject; - - /** - * Creates a new Struct instance using the specified properties. - * @function create - * @memberof google.protobuf.Struct - * @static - * @param {google.protobuf.IStruct=} [properties] Properties to set - * @returns {google.protobuf.Struct} Struct instance - */ - Struct.create = function create(properties) { - return new Struct(properties); - }; - - /** - * Encodes the specified Struct message. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Struct - * @static - * @param {google.protobuf.IStruct} message Struct message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Struct.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.fields != null && Object.hasOwnProperty.call(message, "fields")) - for (var keys = Object.keys(message.fields), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.protobuf.Value.encode(message.fields[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - return writer; - }; - - /** - * Encodes the specified Struct message, length delimited. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Struct - * @static - * @param {google.protobuf.IStruct} message Struct message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Struct.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Struct message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Struct - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Struct} Struct - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Struct.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Struct(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (message.fields === $util.emptyObject) - message.fields = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = null; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = $root.google.protobuf.Value.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.fields[key] = value; - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Struct message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Struct - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Struct} Struct - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Struct.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Struct message. - * @function verify - * @memberof google.protobuf.Struct - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Struct.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.fields != null && message.hasOwnProperty("fields")) { - if (!$util.isObject(message.fields)) - return "fields: object expected"; - var key = Object.keys(message.fields); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.protobuf.Value.verify(message.fields[key[i]]); - if (error) - return "fields." + error; - } - } - return null; - }; - - /** - * Creates a Struct message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Struct - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Struct} Struct - */ - Struct.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Struct) - return object; - var message = new $root.google.protobuf.Struct(); - if (object.fields) { - if (typeof object.fields !== "object") - throw TypeError(".google.protobuf.Struct.fields: object expected"); - message.fields = {}; - for (var keys = Object.keys(object.fields), i = 0; i < keys.length; ++i) { - if (typeof object.fields[keys[i]] !== "object") - throw TypeError(".google.protobuf.Struct.fields: object expected"); - message.fields[keys[i]] = $root.google.protobuf.Value.fromObject(object.fields[keys[i]]); - } - } - return message; - }; - - /** - * Creates a plain object from a Struct message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Struct - * @static - * @param {google.protobuf.Struct} message Struct - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Struct.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.fields = {}; - var keys2; - if (message.fields && (keys2 = Object.keys(message.fields)).length) { - object.fields = {}; - for (var j = 0; j < keys2.length; ++j) - object.fields[keys2[j]] = $root.google.protobuf.Value.toObject(message.fields[keys2[j]], options); - } - return object; - }; - - /** - * Converts this Struct to JSON. - * @function toJSON - * @memberof google.protobuf.Struct - * @instance - * @returns {Object.} JSON object - */ - Struct.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Struct - * @function getTypeUrl - * @memberof google.protobuf.Struct - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Struct.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Struct"; - }; - - return Struct; - })(); - - protobuf.Value = (function() { - - /** - * Properties of a Value. - * @memberof google.protobuf - * @interface IValue - * @property {google.protobuf.NullValue|null} [nullValue] Value nullValue - * @property {number|null} [numberValue] Value numberValue - * @property {string|null} [stringValue] Value stringValue - * @property {boolean|null} [boolValue] Value boolValue - * @property {google.protobuf.IStruct|null} [structValue] Value structValue - * @property {google.protobuf.IListValue|null} [listValue] Value listValue - */ - - /** - * Constructs a new Value. - * @memberof google.protobuf - * @classdesc Represents a Value. - * @implements IValue - * @constructor - * @param {google.protobuf.IValue=} [properties] Properties to set - */ - function Value(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Value nullValue. - * @member {google.protobuf.NullValue|null|undefined} nullValue - * @memberof google.protobuf.Value - * @instance - */ - Value.prototype.nullValue = null; - - /** - * Value numberValue. - * @member {number|null|undefined} numberValue - * @memberof google.protobuf.Value - * @instance - */ - Value.prototype.numberValue = null; - - /** - * Value stringValue. - * @member {string|null|undefined} stringValue - * @memberof google.protobuf.Value - * @instance - */ - Value.prototype.stringValue = null; - - /** - * Value boolValue. - * @member {boolean|null|undefined} boolValue - * @memberof google.protobuf.Value - * @instance - */ - Value.prototype.boolValue = null; - - /** - * Value structValue. - * @member {google.protobuf.IStruct|null|undefined} structValue - * @memberof google.protobuf.Value - * @instance - */ - Value.prototype.structValue = null; - - /** - * Value listValue. - * @member {google.protobuf.IListValue|null|undefined} listValue - * @memberof google.protobuf.Value - * @instance - */ - Value.prototype.listValue = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Value kind. - * @member {"nullValue"|"numberValue"|"stringValue"|"boolValue"|"structValue"|"listValue"|undefined} kind - * @memberof google.protobuf.Value - * @instance - */ - Object.defineProperty(Value.prototype, "kind", { - get: $util.oneOfGetter($oneOfFields = ["nullValue", "numberValue", "stringValue", "boolValue", "structValue", "listValue"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Value instance using the specified properties. - * @function create - * @memberof google.protobuf.Value - * @static - * @param {google.protobuf.IValue=} [properties] Properties to set - * @returns {google.protobuf.Value} Value instance - */ - Value.create = function create(properties) { - return new Value(properties); - }; - - /** - * Encodes the specified Value message. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Value - * @static - * @param {google.protobuf.IValue} message Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Value.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.nullValue != null && Object.hasOwnProperty.call(message, "nullValue")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.nullValue); - if (message.numberValue != null && Object.hasOwnProperty.call(message, "numberValue")) - writer.uint32(/* id 2, wireType 1 =*/17).double(message.numberValue); - if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.stringValue); - if (message.boolValue != null && Object.hasOwnProperty.call(message, "boolValue")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.boolValue); - if (message.structValue != null && Object.hasOwnProperty.call(message, "structValue")) - $root.google.protobuf.Struct.encode(message.structValue, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.listValue != null && Object.hasOwnProperty.call(message, "listValue")) - $root.google.protobuf.ListValue.encode(message.listValue, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Value message, length delimited. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Value - * @static - * @param {google.protobuf.IValue} message Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Value.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Value message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Value} Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Value.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Value(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.nullValue = reader.int32(); - break; - } - case 2: { - message.numberValue = reader.double(); - break; - } - case 3: { - message.stringValue = reader.string(); - break; - } - case 4: { - message.boolValue = reader.bool(); - break; - } - case 5: { - message.structValue = $root.google.protobuf.Struct.decode(reader, reader.uint32()); - break; - } - case 6: { - message.listValue = $root.google.protobuf.ListValue.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Value message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Value} Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Value.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Value message. - * @function verify - * @memberof google.protobuf.Value - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Value.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.nullValue != null && message.hasOwnProperty("nullValue")) { - properties.kind = 1; - switch (message.nullValue) { - default: - return "nullValue: enum value expected"; - case 0: - break; - } - } - if (message.numberValue != null && message.hasOwnProperty("numberValue")) { - if (properties.kind === 1) - return "kind: multiple values"; - properties.kind = 1; - if (typeof message.numberValue !== "number") - return "numberValue: number expected"; - } - if (message.stringValue != null && message.hasOwnProperty("stringValue")) { - if (properties.kind === 1) - return "kind: multiple values"; - properties.kind = 1; - if (!$util.isString(message.stringValue)) - return "stringValue: string expected"; - } - if (message.boolValue != null && message.hasOwnProperty("boolValue")) { - if (properties.kind === 1) - return "kind: multiple values"; - properties.kind = 1; - if (typeof message.boolValue !== "boolean") - return "boolValue: boolean expected"; - } - if (message.structValue != null && message.hasOwnProperty("structValue")) { - if (properties.kind === 1) - return "kind: multiple values"; - properties.kind = 1; - { - var error = $root.google.protobuf.Struct.verify(message.structValue); - if (error) - return "structValue." + error; - } - } - if (message.listValue != null && message.hasOwnProperty("listValue")) { - if (properties.kind === 1) - return "kind: multiple values"; - properties.kind = 1; - { - var error = $root.google.protobuf.ListValue.verify(message.listValue); - if (error) - return "listValue." + error; - } - } - return null; - }; - - /** - * Creates a Value message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Value - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Value} Value - */ - Value.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Value) - return object; - var message = new $root.google.protobuf.Value(); - switch (object.nullValue) { - default: - if (typeof object.nullValue === "number") { - message.nullValue = object.nullValue; - break; - } - break; - case "NULL_VALUE": - case 0: - message.nullValue = 0; - break; - } - if (object.numberValue != null) - message.numberValue = Number(object.numberValue); - if (object.stringValue != null) - message.stringValue = String(object.stringValue); - if (object.boolValue != null) - message.boolValue = Boolean(object.boolValue); - if (object.structValue != null) { - if (typeof object.structValue !== "object") - throw TypeError(".google.protobuf.Value.structValue: object expected"); - message.structValue = $root.google.protobuf.Struct.fromObject(object.structValue); - } - if (object.listValue != null) { - if (typeof object.listValue !== "object") - throw TypeError(".google.protobuf.Value.listValue: object expected"); - message.listValue = $root.google.protobuf.ListValue.fromObject(object.listValue); - } - return message; - }; - - /** - * Creates a plain object from a Value message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Value - * @static - * @param {google.protobuf.Value} message Value - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Value.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.nullValue != null && message.hasOwnProperty("nullValue")) { - object.nullValue = options.enums === String ? $root.google.protobuf.NullValue[message.nullValue] === undefined ? message.nullValue : $root.google.protobuf.NullValue[message.nullValue] : message.nullValue; - if (options.oneofs) - object.kind = "nullValue"; - } - if (message.numberValue != null && message.hasOwnProperty("numberValue")) { - object.numberValue = options.json && !isFinite(message.numberValue) ? String(message.numberValue) : message.numberValue; - if (options.oneofs) - object.kind = "numberValue"; - } - if (message.stringValue != null && message.hasOwnProperty("stringValue")) { - object.stringValue = message.stringValue; - if (options.oneofs) - object.kind = "stringValue"; - } - if (message.boolValue != null && message.hasOwnProperty("boolValue")) { - object.boolValue = message.boolValue; - if (options.oneofs) - object.kind = "boolValue"; - } - if (message.structValue != null && message.hasOwnProperty("structValue")) { - object.structValue = $root.google.protobuf.Struct.toObject(message.structValue, options); - if (options.oneofs) - object.kind = "structValue"; - } - if (message.listValue != null && message.hasOwnProperty("listValue")) { - object.listValue = $root.google.protobuf.ListValue.toObject(message.listValue, options); - if (options.oneofs) - object.kind = "listValue"; - } - return object; - }; - - /** - * Converts this Value to JSON. - * @function toJSON - * @memberof google.protobuf.Value - * @instance - * @returns {Object.} JSON object - */ - Value.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Value - * @function getTypeUrl - * @memberof google.protobuf.Value - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Value"; - }; - - return Value; - })(); - - /** - * NullValue enum. - * @name google.protobuf.NullValue - * @enum {number} - * @property {number} NULL_VALUE=0 NULL_VALUE value - */ - protobuf.NullValue = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "NULL_VALUE"] = 0; - return values; - })(); - - protobuf.ListValue = (function() { - - /** - * Properties of a ListValue. - * @memberof google.protobuf - * @interface IListValue - * @property {Array.|null} [values] ListValue values - */ - - /** - * Constructs a new ListValue. - * @memberof google.protobuf - * @classdesc Represents a ListValue. - * @implements IListValue - * @constructor - * @param {google.protobuf.IListValue=} [properties] Properties to set - */ - function ListValue(properties) { - this.values = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListValue values. - * @member {Array.} values - * @memberof google.protobuf.ListValue - * @instance - */ - ListValue.prototype.values = $util.emptyArray; - - /** - * Creates a new ListValue instance using the specified properties. - * @function create - * @memberof google.protobuf.ListValue - * @static - * @param {google.protobuf.IListValue=} [properties] Properties to set - * @returns {google.protobuf.ListValue} ListValue instance - */ - ListValue.create = function create(properties) { - return new ListValue(properties); - }; - - /** - * Encodes the specified ListValue message. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ListValue - * @static - * @param {google.protobuf.IListValue} message ListValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListValue.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.values != null && message.values.length) - for (var i = 0; i < message.values.length; ++i) - $root.google.protobuf.Value.encode(message.values[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ListValue message, length delimited. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ListValue - * @static - * @param {google.protobuf.IListValue} message ListValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListValue message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ListValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ListValue} ListValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListValue.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ListValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.values && message.values.length)) - message.values = []; - message.values.push($root.google.protobuf.Value.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ListValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ListValue} ListValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListValue message. - * @function verify - * @memberof google.protobuf.ListValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListValue.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.values != null && message.hasOwnProperty("values")) { - if (!Array.isArray(message.values)) - return "values: array expected"; - for (var i = 0; i < message.values.length; ++i) { - var error = $root.google.protobuf.Value.verify(message.values[i]); - if (error) - return "values." + error; - } - } - return null; - }; - - /** - * Creates a ListValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ListValue - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ListValue} ListValue - */ - ListValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ListValue) - return object; - var message = new $root.google.protobuf.ListValue(); - if (object.values) { - if (!Array.isArray(object.values)) - throw TypeError(".google.protobuf.ListValue.values: array expected"); - message.values = []; - for (var i = 0; i < object.values.length; ++i) { - if (typeof object.values[i] !== "object") - throw TypeError(".google.protobuf.ListValue.values: object expected"); - message.values[i] = $root.google.protobuf.Value.fromObject(object.values[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a ListValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ListValue - * @static - * @param {google.protobuf.ListValue} message ListValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListValue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.values = []; - if (message.values && message.values.length) { - object.values = []; - for (var j = 0; j < message.values.length; ++j) - object.values[j] = $root.google.protobuf.Value.toObject(message.values[j], options); - } - return object; - }; - - /** - * Converts this ListValue to JSON. - * @function toJSON - * @memberof google.protobuf.ListValue - * @instance - * @returns {Object.} JSON object - */ - ListValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListValue - * @function getTypeUrl - * @memberof google.protobuf.ListValue - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.ListValue"; - }; - - return ListValue; - })(); - - protobuf.Timestamp = (function() { - - /** - * Properties of a Timestamp. - * @memberof google.protobuf - * @interface ITimestamp - * @property {number|Long|null} [seconds] Timestamp seconds - * @property {number|null} [nanos] Timestamp nanos - */ - - /** - * Constructs a new Timestamp. - * @memberof google.protobuf - * @classdesc Represents a Timestamp. - * @implements ITimestamp - * @constructor - * @param {google.protobuf.ITimestamp=} [properties] Properties to set - */ - function Timestamp(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Timestamp seconds. - * @member {number|Long} seconds - * @memberof google.protobuf.Timestamp - * @instance - */ - Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Timestamp nanos. - * @member {number} nanos - * @memberof google.protobuf.Timestamp - * @instance - */ - Timestamp.prototype.nanos = 0; - - /** - * Creates a new Timestamp instance using the specified properties. - * @function create - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.ITimestamp=} [properties] Properties to set - * @returns {google.protobuf.Timestamp} Timestamp instance - */ - Timestamp.create = function create(properties) { - return new Timestamp(properties); - }; - - /** - * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Timestamp.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); - if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); - return writer; - }; - - /** - * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Timestamp.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Timestamp message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Timestamp - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Timestamp} Timestamp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Timestamp.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.seconds = reader.int64(); - break; - } - case 2: { - message.nanos = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Timestamp message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Timestamp - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Timestamp} Timestamp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Timestamp.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Timestamp message. - * @function verify - * @memberof google.protobuf.Timestamp - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Timestamp.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) - return "seconds: integer|Long expected"; - if (message.nanos != null && message.hasOwnProperty("nanos")) - if (!$util.isInteger(message.nanos)) - return "nanos: integer expected"; - return null; - }; - - /** - * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Timestamp - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Timestamp} Timestamp - */ - Timestamp.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Timestamp) - return object; - var message = new $root.google.protobuf.Timestamp(); - if (object.seconds != null) - if ($util.Long) - (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; - else if (typeof object.seconds === "string") - message.seconds = parseInt(object.seconds, 10); - else if (typeof object.seconds === "number") - message.seconds = object.seconds; - else if (typeof object.seconds === "object") - message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); - if (object.nanos != null) - message.nanos = object.nanos | 0; - return message; - }; - - /** - * Creates a plain object from a Timestamp message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.Timestamp} message Timestamp - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Timestamp.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.seconds = options.longs === String ? "0" : 0; - object.nanos = 0; - } - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (typeof message.seconds === "number") - object.seconds = options.longs === String ? String(message.seconds) : message.seconds; - else - object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; - if (message.nanos != null && message.hasOwnProperty("nanos")) - object.nanos = message.nanos; - return object; - }; - - /** - * Converts this Timestamp to JSON. - * @function toJSON - * @memberof google.protobuf.Timestamp - * @instance - * @returns {Object.} JSON object - */ - Timestamp.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Timestamp - * @function getTypeUrl - * @memberof google.protobuf.Timestamp - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Timestamp"; - }; - - return Timestamp; - })(); - - protobuf.FileDescriptorSet = (function() { - - /** - * Properties of a FileDescriptorSet. - * @memberof google.protobuf - * @interface IFileDescriptorSet - * @property {Array.|null} [file] FileDescriptorSet file - */ - - /** - * Constructs a new FileDescriptorSet. - * @memberof google.protobuf - * @classdesc Represents a FileDescriptorSet. - * @implements IFileDescriptorSet - * @constructor - * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set - */ - function FileDescriptorSet(properties) { - this.file = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FileDescriptorSet file. - * @member {Array.} file - * @memberof google.protobuf.FileDescriptorSet - * @instance - */ - FileDescriptorSet.prototype.file = $util.emptyArray; - - /** - * Creates a new FileDescriptorSet instance using the specified properties. - * @function create - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance - */ - FileDescriptorSet.create = function create(properties) { - return new FileDescriptorSet(properties); - }; - - /** - * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorSet.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.file != null && message.file.length) - for (var i = 0; i < message.file.length; ++i) - $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FileDescriptorSet message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorSet.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.file && message.file.length)) - message.file = []; - message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FileDescriptorSet message. - * @function verify - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FileDescriptorSet.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.file != null && message.hasOwnProperty("file")) { - if (!Array.isArray(message.file)) - return "file: array expected"; - for (var i = 0; i < message.file.length; ++i) { - var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]); - if (error) - return "file." + error; - } - } - return null; - }; - - /** - * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet - */ - FileDescriptorSet.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FileDescriptorSet) - return object; - var message = new $root.google.protobuf.FileDescriptorSet(); - if (object.file) { - if (!Array.isArray(object.file)) - throw TypeError(".google.protobuf.FileDescriptorSet.file: array expected"); - message.file = []; - for (var i = 0; i < object.file.length; ++i) { - if (typeof object.file[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected"); - message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FileDescriptorSet.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.file = []; - if (message.file && message.file.length) { - object.file = []; - for (var j = 0; j < message.file.length; ++j) - object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options); - } - return object; - }; - - /** - * Converts this FileDescriptorSet to JSON. - * @function toJSON - * @memberof google.protobuf.FileDescriptorSet - * @instance - * @returns {Object.} JSON object - */ - FileDescriptorSet.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FileDescriptorSet - * @function getTypeUrl - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FileDescriptorSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FileDescriptorSet"; - }; - - return FileDescriptorSet; - })(); - - /** - * Edition enum. - * @name google.protobuf.Edition - * @enum {number} - * @property {number} EDITION_UNKNOWN=0 EDITION_UNKNOWN value - * @property {number} EDITION_PROTO2=998 EDITION_PROTO2 value - * @property {number} EDITION_PROTO3=999 EDITION_PROTO3 value - * @property {number} EDITION_2023=1000 EDITION_2023 value - * @property {number} EDITION_2024=1001 EDITION_2024 value - * @property {number} EDITION_1_TEST_ONLY=1 EDITION_1_TEST_ONLY value - * @property {number} EDITION_2_TEST_ONLY=2 EDITION_2_TEST_ONLY value - * @property {number} EDITION_99997_TEST_ONLY=99997 EDITION_99997_TEST_ONLY value - * @property {number} EDITION_99998_TEST_ONLY=99998 EDITION_99998_TEST_ONLY value - * @property {number} EDITION_99999_TEST_ONLY=99999 EDITION_99999_TEST_ONLY value - * @property {number} EDITION_MAX=2147483647 EDITION_MAX value - */ - protobuf.Edition = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "EDITION_UNKNOWN"] = 0; - values[valuesById[998] = "EDITION_PROTO2"] = 998; - values[valuesById[999] = "EDITION_PROTO3"] = 999; - values[valuesById[1000] = "EDITION_2023"] = 1000; - values[valuesById[1001] = "EDITION_2024"] = 1001; - values[valuesById[1] = "EDITION_1_TEST_ONLY"] = 1; - values[valuesById[2] = "EDITION_2_TEST_ONLY"] = 2; - values[valuesById[99997] = "EDITION_99997_TEST_ONLY"] = 99997; - values[valuesById[99998] = "EDITION_99998_TEST_ONLY"] = 99998; - values[valuesById[99999] = "EDITION_99999_TEST_ONLY"] = 99999; - values[valuesById[2147483647] = "EDITION_MAX"] = 2147483647; - return values; - })(); - - protobuf.FileDescriptorProto = (function() { - - /** - * Properties of a FileDescriptorProto. - * @memberof google.protobuf - * @interface IFileDescriptorProto - * @property {string|null} [name] FileDescriptorProto name - * @property {string|null} ["package"] FileDescriptorProto package - * @property {Array.|null} [dependency] FileDescriptorProto dependency - * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency - * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency - * @property {Array.|null} [messageType] FileDescriptorProto messageType - * @property {Array.|null} [enumType] FileDescriptorProto enumType - * @property {Array.|null} [service] FileDescriptorProto service - * @property {Array.|null} [extension] FileDescriptorProto extension - * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options - * @property {google.protobuf.ISourceCodeInfo|null} [sourceCodeInfo] FileDescriptorProto sourceCodeInfo - * @property {string|null} [syntax] FileDescriptorProto syntax - * @property {google.protobuf.Edition|null} [edition] FileDescriptorProto edition - */ - - /** - * Constructs a new FileDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a FileDescriptorProto. - * @implements IFileDescriptorProto - * @constructor - * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set - */ - function FileDescriptorProto(properties) { - this.dependency = []; - this.publicDependency = []; - this.weakDependency = []; - this.messageType = []; - this.enumType = []; - this.service = []; - this.extension = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FileDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.name = ""; - - /** - * FileDescriptorProto package. - * @member {string} package - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype["package"] = ""; - - /** - * FileDescriptorProto dependency. - * @member {Array.} dependency - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.dependency = $util.emptyArray; - - /** - * FileDescriptorProto publicDependency. - * @member {Array.} publicDependency - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.publicDependency = $util.emptyArray; - - /** - * FileDescriptorProto weakDependency. - * @member {Array.} weakDependency - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.weakDependency = $util.emptyArray; - - /** - * FileDescriptorProto messageType. - * @member {Array.} messageType - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.messageType = $util.emptyArray; - - /** - * FileDescriptorProto enumType. - * @member {Array.} enumType - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.enumType = $util.emptyArray; - - /** - * FileDescriptorProto service. - * @member {Array.} service - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.service = $util.emptyArray; - - /** - * FileDescriptorProto extension. - * @member {Array.} extension - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.extension = $util.emptyArray; - - /** - * FileDescriptorProto options. - * @member {google.protobuf.IFileOptions|null|undefined} options - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.options = null; - - /** - * FileDescriptorProto sourceCodeInfo. - * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.sourceCodeInfo = null; - - /** - * FileDescriptorProto syntax. - * @member {string} syntax - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.syntax = ""; - - /** - * FileDescriptorProto edition. - * @member {google.protobuf.Edition} edition - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.edition = 0; - - /** - * Creates a new FileDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance - */ - FileDescriptorProto.create = function create(properties) { - return new FileDescriptorProto(properties); - }; - - /** - * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); - if (message.dependency != null && message.dependency.length) - for (var i = 0; i < message.dependency.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); - if (message.messageType != null && message.messageType.length) - for (var i = 0; i < message.messageType.length; ++i) - $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.enumType != null && message.enumType.length) - for (var i = 0; i < message.enumType.length; ++i) - $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.service != null && message.service.length) - for (var i = 0; i < message.service.length; ++i) - $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.extension != null && message.extension.length) - for (var i = 0; i < message.extension.length; ++i) - $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo")) - $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.publicDependency != null && message.publicDependency.length) - for (var i = 0; i < message.publicDependency.length; ++i) - writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]); - if (message.weakDependency != null && message.weakDependency.length) - for (var i = 0; i < message.weakDependency.length; ++i) - writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); - if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); - if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) - writer.uint32(/* id 14, wireType 0 =*/112).int32(message.edition); - return writer; - }; - - /** - * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorProto.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message["package"] = reader.string(); - break; - } - case 3: { - if (!(message.dependency && message.dependency.length)) - message.dependency = []; - message.dependency.push(reader.string()); - break; - } - case 10: { - if (!(message.publicDependency && message.publicDependency.length)) - message.publicDependency = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.publicDependency.push(reader.int32()); - } else - message.publicDependency.push(reader.int32()); - break; - } - case 11: { - if (!(message.weakDependency && message.weakDependency.length)) - message.weakDependency = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.weakDependency.push(reader.int32()); - } else - message.weakDependency.push(reader.int32()); - break; - } - case 4: { - if (!(message.messageType && message.messageType.length)) - message.messageType = []; - message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); - break; - } - case 5: { - if (!(message.enumType && message.enumType.length)) - message.enumType = []; - message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 6: { - if (!(message.service && message.service.length)) - message.service = []; - message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 7: { - if (!(message.extension && message.extension.length)) - message.extension = []; - message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 8: { - message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32()); - break; - } - case 9: { - message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32()); - break; - } - case 12: { - message.syntax = reader.string(); - break; - } - case 14: { - message.edition = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FileDescriptorProto message. - * @function verify - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FileDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message["package"] != null && message.hasOwnProperty("package")) - if (!$util.isString(message["package"])) - return "package: string expected"; - if (message.dependency != null && message.hasOwnProperty("dependency")) { - if (!Array.isArray(message.dependency)) - return "dependency: array expected"; - for (var i = 0; i < message.dependency.length; ++i) - if (!$util.isString(message.dependency[i])) - return "dependency: string[] expected"; - } - if (message.publicDependency != null && message.hasOwnProperty("publicDependency")) { - if (!Array.isArray(message.publicDependency)) - return "publicDependency: array expected"; - for (var i = 0; i < message.publicDependency.length; ++i) - if (!$util.isInteger(message.publicDependency[i])) - return "publicDependency: integer[] expected"; - } - if (message.weakDependency != null && message.hasOwnProperty("weakDependency")) { - if (!Array.isArray(message.weakDependency)) - return "weakDependency: array expected"; - for (var i = 0; i < message.weakDependency.length; ++i) - if (!$util.isInteger(message.weakDependency[i])) - return "weakDependency: integer[] expected"; - } - if (message.messageType != null && message.hasOwnProperty("messageType")) { - if (!Array.isArray(message.messageType)) - return "messageType: array expected"; - for (var i = 0; i < message.messageType.length; ++i) { - var error = $root.google.protobuf.DescriptorProto.verify(message.messageType[i]); - if (error) - return "messageType." + error; - } - } - if (message.enumType != null && message.hasOwnProperty("enumType")) { - if (!Array.isArray(message.enumType)) - return "enumType: array expected"; - for (var i = 0; i < message.enumType.length; ++i) { - var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); - if (error) - return "enumType." + error; - } - } - if (message.service != null && message.hasOwnProperty("service")) { - if (!Array.isArray(message.service)) - return "service: array expected"; - for (var i = 0; i < message.service.length; ++i) { - var error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i]); - if (error) - return "service." + error; - } - } - if (message.extension != null && message.hasOwnProperty("extension")) { - if (!Array.isArray(message.extension)) - return "extension: array expected"; - for (var i = 0; i < message.extension.length; ++i) { - var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); - if (error) - return "extension." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.FileOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) { - var error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo); - if (error) - return "sourceCodeInfo." + error; - } - if (message.syntax != null && message.hasOwnProperty("syntax")) - if (!$util.isString(message.syntax)) - return "syntax: string expected"; - if (message.edition != null && message.hasOwnProperty("edition")) - switch (message.edition) { - default: - return "edition: enum value expected"; - case 0: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - return null; - }; - - /** - * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto - */ - FileDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FileDescriptorProto) - return object; - var message = new $root.google.protobuf.FileDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object["package"] != null) - message["package"] = String(object["package"]); - if (object.dependency) { - if (!Array.isArray(object.dependency)) - throw TypeError(".google.protobuf.FileDescriptorProto.dependency: array expected"); - message.dependency = []; - for (var i = 0; i < object.dependency.length; ++i) - message.dependency[i] = String(object.dependency[i]); - } - if (object.publicDependency) { - if (!Array.isArray(object.publicDependency)) - throw TypeError(".google.protobuf.FileDescriptorProto.publicDependency: array expected"); - message.publicDependency = []; - for (var i = 0; i < object.publicDependency.length; ++i) - message.publicDependency[i] = object.publicDependency[i] | 0; - } - if (object.weakDependency) { - if (!Array.isArray(object.weakDependency)) - throw TypeError(".google.protobuf.FileDescriptorProto.weakDependency: array expected"); - message.weakDependency = []; - for (var i = 0; i < object.weakDependency.length; ++i) - message.weakDependency[i] = object.weakDependency[i] | 0; - } - if (object.messageType) { - if (!Array.isArray(object.messageType)) - throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); - message.messageType = []; - for (var i = 0; i < object.messageType.length; ++i) { - if (typeof object.messageType[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.messageType: object expected"); - message.messageType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.messageType[i]); - } - } - if (object.enumType) { - if (!Array.isArray(object.enumType)) - throw TypeError(".google.protobuf.FileDescriptorProto.enumType: array expected"); - message.enumType = []; - for (var i = 0; i < object.enumType.length; ++i) { - if (typeof object.enumType[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.enumType: object expected"); - message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); - } - } - if (object.service) { - if (!Array.isArray(object.service)) - throw TypeError(".google.protobuf.FileDescriptorProto.service: array expected"); - message.service = []; - for (var i = 0; i < object.service.length; ++i) { - if (typeof object.service[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.service: object expected"); - message.service[i] = $root.google.protobuf.ServiceDescriptorProto.fromObject(object.service[i]); - } - } - if (object.extension) { - if (!Array.isArray(object.extension)) - throw TypeError(".google.protobuf.FileDescriptorProto.extension: array expected"); - message.extension = []; - for (var i = 0; i < object.extension.length; ++i) { - if (typeof object.extension[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.extension: object expected"); - message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.FileOptions.fromObject(object.options); - } - if (object.sourceCodeInfo != null) { - if (typeof object.sourceCodeInfo !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.sourceCodeInfo: object expected"); - message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.fromObject(object.sourceCodeInfo); - } - if (object.syntax != null) - message.syntax = String(object.syntax); - switch (object.edition) { - default: - if (typeof object.edition === "number") { - message.edition = object.edition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.edition = 0; - break; - case "EDITION_PROTO2": - case 998: - message.edition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.edition = 999; - break; - case "EDITION_2023": - case 1000: - message.edition = 1000; - break; - case "EDITION_2024": - case 1001: - message.edition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.edition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.edition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.edition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.edition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.edition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.edition = 2147483647; - break; - } - return message; - }; - - /** - * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FileDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.dependency = []; - object.messageType = []; - object.enumType = []; - object.service = []; - object.extension = []; - object.publicDependency = []; - object.weakDependency = []; - } - if (options.defaults) { - object.name = ""; - object["package"] = ""; - object.options = null; - object.sourceCodeInfo = null; - object.syntax = ""; - object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message["package"] != null && message.hasOwnProperty("package")) - object["package"] = message["package"]; - if (message.dependency && message.dependency.length) { - object.dependency = []; - for (var j = 0; j < message.dependency.length; ++j) - object.dependency[j] = message.dependency[j]; - } - if (message.messageType && message.messageType.length) { - object.messageType = []; - for (var j = 0; j < message.messageType.length; ++j) - object.messageType[j] = $root.google.protobuf.DescriptorProto.toObject(message.messageType[j], options); - } - if (message.enumType && message.enumType.length) { - object.enumType = []; - for (var j = 0; j < message.enumType.length; ++j) - object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); - } - if (message.service && message.service.length) { - object.service = []; - for (var j = 0; j < message.service.length; ++j) - object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options); - } - if (message.extension && message.extension.length) { - object.extension = []; - for (var j = 0; j < message.extension.length; ++j) - object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.FileOptions.toObject(message.options, options); - if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) - object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options); - if (message.publicDependency && message.publicDependency.length) { - object.publicDependency = []; - for (var j = 0; j < message.publicDependency.length; ++j) - object.publicDependency[j] = message.publicDependency[j]; - } - if (message.weakDependency && message.weakDependency.length) { - object.weakDependency = []; - for (var j = 0; j < message.weakDependency.length; ++j) - object.weakDependency[j] = message.weakDependency[j]; - } - if (message.syntax != null && message.hasOwnProperty("syntax")) - object.syntax = message.syntax; - if (message.edition != null && message.hasOwnProperty("edition")) - object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; - return object; - }; - - /** - * Converts this FileDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.FileDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - FileDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FileDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FileDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FileDescriptorProto"; - }; - - return FileDescriptorProto; - })(); - - protobuf.DescriptorProto = (function() { - - /** - * Properties of a DescriptorProto. - * @memberof google.protobuf - * @interface IDescriptorProto - * @property {string|null} [name] DescriptorProto name - * @property {Array.|null} [field] DescriptorProto field - * @property {Array.|null} [extension] DescriptorProto extension - * @property {Array.|null} [nestedType] DescriptorProto nestedType - * @property {Array.|null} [enumType] DescriptorProto enumType - * @property {Array.|null} [extensionRange] DescriptorProto extensionRange - * @property {Array.|null} [oneofDecl] DescriptorProto oneofDecl - * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options - * @property {Array.|null} [reservedRange] DescriptorProto reservedRange - * @property {Array.|null} [reservedName] DescriptorProto reservedName - */ - - /** - * Constructs a new DescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a DescriptorProto. - * @implements IDescriptorProto - * @constructor - * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set - */ - function DescriptorProto(properties) { - this.field = []; - this.extension = []; - this.nestedType = []; - this.enumType = []; - this.extensionRange = []; - this.oneofDecl = []; - this.reservedRange = []; - this.reservedName = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DescriptorProto name. - * @member {string} name - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.name = ""; - - /** - * DescriptorProto field. - * @member {Array.} field - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.field = $util.emptyArray; - - /** - * DescriptorProto extension. - * @member {Array.} extension - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.extension = $util.emptyArray; - - /** - * DescriptorProto nestedType. - * @member {Array.} nestedType - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.nestedType = $util.emptyArray; - - /** - * DescriptorProto enumType. - * @member {Array.} enumType - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.enumType = $util.emptyArray; - - /** - * DescriptorProto extensionRange. - * @member {Array.} extensionRange - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.extensionRange = $util.emptyArray; - - /** - * DescriptorProto oneofDecl. - * @member {Array.} oneofDecl - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.oneofDecl = $util.emptyArray; - - /** - * DescriptorProto options. - * @member {google.protobuf.IMessageOptions|null|undefined} options - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.options = null; - - /** - * DescriptorProto reservedRange. - * @member {Array.} reservedRange - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.reservedRange = $util.emptyArray; - - /** - * DescriptorProto reservedName. - * @member {Array.} reservedName - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.reservedName = $util.emptyArray; - - /** - * Creates a new DescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.DescriptorProto - * @static - * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.DescriptorProto} DescriptorProto instance - */ - DescriptorProto.create = function create(properties) { - return new DescriptorProto(properties); - }; - - /** - * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.DescriptorProto - * @static - * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.field != null && message.field.length) - for (var i = 0; i < message.field.length; ++i) - $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.nestedType != null && message.nestedType.length) - for (var i = 0; i < message.nestedType.length; ++i) - $root.google.protobuf.DescriptorProto.encode(message.nestedType[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.enumType != null && message.enumType.length) - for (var i = 0; i < message.enumType.length; ++i) - $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.extensionRange != null && message.extensionRange.length) - for (var i = 0; i < message.extensionRange.length; ++i) - $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extensionRange[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.extension != null && message.extension.length) - for (var i = 0; i < message.extension.length; ++i) - $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.oneofDecl != null && message.oneofDecl.length) - for (var i = 0; i < message.oneofDecl.length; ++i) - $root.google.protobuf.OneofDescriptorProto.encode(message.oneofDecl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.reservedRange != null && message.reservedRange.length) - for (var i = 0; i < message.reservedRange.length; ++i) - $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.reservedName != null && message.reservedName.length) - for (var i = 0; i < message.reservedName.length; ++i) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); - return writer; - }; - - /** - * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.DescriptorProto - * @static - * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.DescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DescriptorProto} DescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DescriptorProto.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - if (!(message.field && message.field.length)) - message.field = []; - message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 6: { - if (!(message.extension && message.extension.length)) - message.extension = []; - message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 3: { - if (!(message.nestedType && message.nestedType.length)) - message.nestedType = []; - message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); - break; - } - case 4: { - if (!(message.enumType && message.enumType.length)) - message.enumType = []; - message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 5: { - if (!(message.extensionRange && message.extensionRange.length)) - message.extensionRange = []; - message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32())); - break; - } - case 8: { - if (!(message.oneofDecl && message.oneofDecl.length)) - message.oneofDecl = []; - message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 7: { - message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32()); - break; - } - case 9: { - if (!(message.reservedRange && message.reservedRange.length)) - message.reservedRange = []; - message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32())); - break; - } - case 10: { - if (!(message.reservedName && message.reservedName.length)) - message.reservedName = []; - message.reservedName.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.DescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DescriptorProto} DescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DescriptorProto message. - * @function verify - * @memberof google.protobuf.DescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.field != null && message.hasOwnProperty("field")) { - if (!Array.isArray(message.field)) - return "field: array expected"; - for (var i = 0; i < message.field.length; ++i) { - var error = $root.google.protobuf.FieldDescriptorProto.verify(message.field[i]); - if (error) - return "field." + error; - } - } - if (message.extension != null && message.hasOwnProperty("extension")) { - if (!Array.isArray(message.extension)) - return "extension: array expected"; - for (var i = 0; i < message.extension.length; ++i) { - var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); - if (error) - return "extension." + error; - } - } - if (message.nestedType != null && message.hasOwnProperty("nestedType")) { - if (!Array.isArray(message.nestedType)) - return "nestedType: array expected"; - for (var i = 0; i < message.nestedType.length; ++i) { - var error = $root.google.protobuf.DescriptorProto.verify(message.nestedType[i]); - if (error) - return "nestedType." + error; - } - } - if (message.enumType != null && message.hasOwnProperty("enumType")) { - if (!Array.isArray(message.enumType)) - return "enumType: array expected"; - for (var i = 0; i < message.enumType.length; ++i) { - var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); - if (error) - return "enumType." + error; - } - } - if (message.extensionRange != null && message.hasOwnProperty("extensionRange")) { - if (!Array.isArray(message.extensionRange)) - return "extensionRange: array expected"; - for (var i = 0; i < message.extensionRange.length; ++i) { - var error = $root.google.protobuf.DescriptorProto.ExtensionRange.verify(message.extensionRange[i]); - if (error) - return "extensionRange." + error; - } - } - if (message.oneofDecl != null && message.hasOwnProperty("oneofDecl")) { - if (!Array.isArray(message.oneofDecl)) - return "oneofDecl: array expected"; - for (var i = 0; i < message.oneofDecl.length; ++i) { - var error = $root.google.protobuf.OneofDescriptorProto.verify(message.oneofDecl[i]); - if (error) - return "oneofDecl." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.MessageOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { - if (!Array.isArray(message.reservedRange)) - return "reservedRange: array expected"; - for (var i = 0; i < message.reservedRange.length; ++i) { - var error = $root.google.protobuf.DescriptorProto.ReservedRange.verify(message.reservedRange[i]); - if (error) - return "reservedRange." + error; - } - } - if (message.reservedName != null && message.hasOwnProperty("reservedName")) { - if (!Array.isArray(message.reservedName)) - return "reservedName: array expected"; - for (var i = 0; i < message.reservedName.length; ++i) - if (!$util.isString(message.reservedName[i])) - return "reservedName: string[] expected"; - } - return null; - }; - - /** - * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.DescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.DescriptorProto} DescriptorProto - */ - DescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DescriptorProto) - return object; - var message = new $root.google.protobuf.DescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.field) { - if (!Array.isArray(object.field)) - throw TypeError(".google.protobuf.DescriptorProto.field: array expected"); - message.field = []; - for (var i = 0; i < object.field.length; ++i) { - if (typeof object.field[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.field: object expected"); - message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i]); - } - } - if (object.extension) { - if (!Array.isArray(object.extension)) - throw TypeError(".google.protobuf.DescriptorProto.extension: array expected"); - message.extension = []; - for (var i = 0; i < object.extension.length; ++i) { - if (typeof object.extension[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.extension: object expected"); - message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); - } - } - if (object.nestedType) { - if (!Array.isArray(object.nestedType)) - throw TypeError(".google.protobuf.DescriptorProto.nestedType: array expected"); - message.nestedType = []; - for (var i = 0; i < object.nestedType.length; ++i) { - if (typeof object.nestedType[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.nestedType: object expected"); - message.nestedType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nestedType[i]); - } - } - if (object.enumType) { - if (!Array.isArray(object.enumType)) - throw TypeError(".google.protobuf.DescriptorProto.enumType: array expected"); - message.enumType = []; - for (var i = 0; i < object.enumType.length; ++i) { - if (typeof object.enumType[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.enumType: object expected"); - message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); - } - } - if (object.extensionRange) { - if (!Array.isArray(object.extensionRange)) - throw TypeError(".google.protobuf.DescriptorProto.extensionRange: array expected"); - message.extensionRange = []; - for (var i = 0; i < object.extensionRange.length; ++i) { - if (typeof object.extensionRange[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.extensionRange: object expected"); - message.extensionRange[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extensionRange[i]); - } - } - if (object.oneofDecl) { - if (!Array.isArray(object.oneofDecl)) - throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: array expected"); - message.oneofDecl = []; - for (var i = 0; i < object.oneofDecl.length; ++i) { - if (typeof object.oneofDecl[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: object expected"); - message.oneofDecl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneofDecl[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.DescriptorProto.options: object expected"); - message.options = $root.google.protobuf.MessageOptions.fromObject(object.options); - } - if (object.reservedRange) { - if (!Array.isArray(object.reservedRange)) - throw TypeError(".google.protobuf.DescriptorProto.reservedRange: array expected"); - message.reservedRange = []; - for (var i = 0; i < object.reservedRange.length; ++i) { - if (typeof object.reservedRange[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.reservedRange: object expected"); - message.reservedRange[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reservedRange[i]); - } - } - if (object.reservedName) { - if (!Array.isArray(object.reservedName)) - throw TypeError(".google.protobuf.DescriptorProto.reservedName: array expected"); - message.reservedName = []; - for (var i = 0; i < object.reservedName.length; ++i) - message.reservedName[i] = String(object.reservedName[i]); - } - return message; - }; - - /** - * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.DescriptorProto - * @static - * @param {google.protobuf.DescriptorProto} message DescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.field = []; - object.nestedType = []; - object.enumType = []; - object.extensionRange = []; - object.extension = []; - object.oneofDecl = []; - object.reservedRange = []; - object.reservedName = []; - } - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.field && message.field.length) { - object.field = []; - for (var j = 0; j < message.field.length; ++j) - object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options); - } - if (message.nestedType && message.nestedType.length) { - object.nestedType = []; - for (var j = 0; j < message.nestedType.length; ++j) - object.nestedType[j] = $root.google.protobuf.DescriptorProto.toObject(message.nestedType[j], options); - } - if (message.enumType && message.enumType.length) { - object.enumType = []; - for (var j = 0; j < message.enumType.length; ++j) - object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); - } - if (message.extensionRange && message.extensionRange.length) { - object.extensionRange = []; - for (var j = 0; j < message.extensionRange.length; ++j) - object.extensionRange[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extensionRange[j], options); - } - if (message.extension && message.extension.length) { - object.extension = []; - for (var j = 0; j < message.extension.length; ++j) - object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options); - if (message.oneofDecl && message.oneofDecl.length) { - object.oneofDecl = []; - for (var j = 0; j < message.oneofDecl.length; ++j) - object.oneofDecl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneofDecl[j], options); - } - if (message.reservedRange && message.reservedRange.length) { - object.reservedRange = []; - for (var j = 0; j < message.reservedRange.length; ++j) - object.reservedRange[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reservedRange[j], options); - } - if (message.reservedName && message.reservedName.length) { - object.reservedName = []; - for (var j = 0; j < message.reservedName.length; ++j) - object.reservedName[j] = message.reservedName[j]; - } - return object; - }; - - /** - * Converts this DescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.DescriptorProto - * @instance - * @returns {Object.} JSON object - */ - DescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.DescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.DescriptorProto"; - }; - - DescriptorProto.ExtensionRange = (function() { - - /** - * Properties of an ExtensionRange. - * @memberof google.protobuf.DescriptorProto - * @interface IExtensionRange - * @property {number|null} [start] ExtensionRange start - * @property {number|null} [end] ExtensionRange end - * @property {google.protobuf.IExtensionRangeOptions|null} [options] ExtensionRange options - */ - - /** - * Constructs a new ExtensionRange. - * @memberof google.protobuf.DescriptorProto - * @classdesc Represents an ExtensionRange. - * @implements IExtensionRange - * @constructor - * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set - */ - function ExtensionRange(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExtensionRange start. - * @member {number} start - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - */ - ExtensionRange.prototype.start = 0; - - /** - * ExtensionRange end. - * @member {number} end - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - */ - ExtensionRange.prototype.end = 0; - - /** - * ExtensionRange options. - * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - */ - ExtensionRange.prototype.options = null; - - /** - * Creates a new ExtensionRange instance using the specified properties. - * @function create - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance - */ - ExtensionRange.create = function create(properties) { - return new ExtensionRange(properties); - }; - - /** - * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @function encode - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtensionRange.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.start != null && Object.hasOwnProperty.call(message, "start")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExtensionRange message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtensionRange.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.start = reader.int32(); - break; - } - case 2: { - message.end = reader.int32(); - break; - } - case 3: { - message.options = $root.google.protobuf.ExtensionRangeOptions.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtensionRange.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExtensionRange message. - * @function verify - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExtensionRange.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.start != null && message.hasOwnProperty("start")) - if (!$util.isInteger(message.start)) - return "start: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.ExtensionRangeOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange - */ - ExtensionRange.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange) - return object; - var message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); - if (object.start != null) - message.start = object.start | 0; - if (object.end != null) - message.end = object.end | 0; - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange.options: object expected"); - message.options = $root.google.protobuf.ExtensionRangeOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExtensionRange.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.start = 0; - object.end = 0; - object.options = null; - } - if (message.start != null && message.hasOwnProperty("start")) - object.start = message.start; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.ExtensionRangeOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this ExtensionRange to JSON. - * @function toJSON - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - * @returns {Object.} JSON object - */ - ExtensionRange.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExtensionRange - * @function getTypeUrl - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExtensionRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.DescriptorProto.ExtensionRange"; - }; - - return ExtensionRange; - })(); - - DescriptorProto.ReservedRange = (function() { - - /** - * Properties of a ReservedRange. - * @memberof google.protobuf.DescriptorProto - * @interface IReservedRange - * @property {number|null} [start] ReservedRange start - * @property {number|null} [end] ReservedRange end - */ - - /** - * Constructs a new ReservedRange. - * @memberof google.protobuf.DescriptorProto - * @classdesc Represents a ReservedRange. - * @implements IReservedRange - * @constructor - * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set - */ - function ReservedRange(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ReservedRange start. - * @member {number} start - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @instance - */ - ReservedRange.prototype.start = 0; - - /** - * ReservedRange end. - * @member {number} end - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @instance - */ - ReservedRange.prototype.end = 0; - - /** - * Creates a new ReservedRange instance using the specified properties. - * @function create - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance - */ - ReservedRange.create = function create(properties) { - return new ReservedRange(properties); - }; - - /** - * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @function encode - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReservedRange.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.start != null && Object.hasOwnProperty.call(message, "start")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); - return writer; - }; - - /** - * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ReservedRange message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReservedRange.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ReservedRange(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.start = reader.int32(); - break; - } - case 2: { - message.end = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ReservedRange message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReservedRange.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ReservedRange message. - * @function verify - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ReservedRange.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.start != null && message.hasOwnProperty("start")) - if (!$util.isInteger(message.start)) - return "start: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - return null; - }; - - /** - * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange - */ - ReservedRange.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange) - return object; - var message = new $root.google.protobuf.DescriptorProto.ReservedRange(); - if (object.start != null) - message.start = object.start | 0; - if (object.end != null) - message.end = object.end | 0; - return message; - }; - - /** - * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ReservedRange.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.start = 0; - object.end = 0; - } - if (message.start != null && message.hasOwnProperty("start")) - object.start = message.start; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - return object; - }; - - /** - * Converts this ReservedRange to JSON. - * @function toJSON - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @instance - * @returns {Object.} JSON object - */ - ReservedRange.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ReservedRange - * @function getTypeUrl - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.DescriptorProto.ReservedRange"; - }; - - return ReservedRange; - })(); - - return DescriptorProto; - })(); - - protobuf.ExtensionRangeOptions = (function() { - - /** - * Properties of an ExtensionRangeOptions. - * @memberof google.protobuf - * @interface IExtensionRangeOptions - * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption - * @property {Array.|null} [declaration] ExtensionRangeOptions declaration - * @property {google.protobuf.IFeatureSet|null} [features] ExtensionRangeOptions features - * @property {google.protobuf.ExtensionRangeOptions.VerificationState|null} [verification] ExtensionRangeOptions verification - */ - - /** - * Constructs a new ExtensionRangeOptions. - * @memberof google.protobuf - * @classdesc Represents an ExtensionRangeOptions. - * @implements IExtensionRangeOptions - * @constructor - * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set - */ - function ExtensionRangeOptions(properties) { - this.uninterpretedOption = []; - this.declaration = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExtensionRangeOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - */ - ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * ExtensionRangeOptions declaration. - * @member {Array.} declaration - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - */ - ExtensionRangeOptions.prototype.declaration = $util.emptyArray; - - /** - * ExtensionRangeOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - */ - ExtensionRangeOptions.prototype.features = null; - - /** - * ExtensionRangeOptions verification. - * @member {google.protobuf.ExtensionRangeOptions.VerificationState} verification - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - */ - ExtensionRangeOptions.prototype.verification = 1; - - /** - * Creates a new ExtensionRangeOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions instance - */ - ExtensionRangeOptions.create = function create(properties) { - return new ExtensionRangeOptions(properties); - }; - - /** - * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtensionRangeOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.declaration != null && message.declaration.length) - for (var i = 0; i < message.declaration.length; ++i) - $root.google.protobuf.ExtensionRangeOptions.Declaration.encode(message.declaration[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.verification != null && Object.hasOwnProperty.call(message, "verification")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.verification); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtensionRangeOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 2: { - if (!(message.declaration && message.declaration.length)) - message.declaration = []; - message.declaration.push($root.google.protobuf.ExtensionRangeOptions.Declaration.decode(reader, reader.uint32())); - break; - } - case 50: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 3: { - message.verification = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtensionRangeOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExtensionRangeOptions message. - * @function verify - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExtensionRangeOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message.declaration != null && message.hasOwnProperty("declaration")) { - if (!Array.isArray(message.declaration)) - return "declaration: array expected"; - for (var i = 0; i < message.declaration.length; ++i) { - var error = $root.google.protobuf.ExtensionRangeOptions.Declaration.verify(message.declaration[i]); - if (error) - return "declaration." + error; - } - } - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.verification != null && message.hasOwnProperty("verification")) - switch (message.verification) { - default: - return "verification: enum value expected"; - case 0: - case 1: - break; - } - return null; - }; - - /** - * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions - */ - ExtensionRangeOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ExtensionRangeOptions) - return object; - var message = new $root.google.protobuf.ExtensionRangeOptions(); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object.declaration) { - if (!Array.isArray(object.declaration)) - throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: array expected"); - message.declaration = []; - for (var i = 0; i < object.declaration.length; ++i) { - if (typeof object.declaration[i] !== "object") - throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: object expected"); - message.declaration[i] = $root.google.protobuf.ExtensionRangeOptions.Declaration.fromObject(object.declaration[i]); - } - } - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.ExtensionRangeOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - switch (object.verification) { - case "DECLARATION": - case 0: - message.verification = 0; - break; - default: - if (typeof object.verification === "number") { - message.verification = object.verification; - break; - } - break; - case "UNVERIFIED": - case 1: - message.verification = 1; - break; - } - return message; - }; - - /** - * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExtensionRangeOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.declaration = []; - object.uninterpretedOption = []; - } - if (options.defaults) { - object.verification = options.enums === String ? "UNVERIFIED" : 1; - object.features = null; - } - if (message.declaration && message.declaration.length) { - object.declaration = []; - for (var j = 0; j < message.declaration.length; ++j) - object.declaration[j] = $root.google.protobuf.ExtensionRangeOptions.Declaration.toObject(message.declaration[j], options); - } - if (message.verification != null && message.hasOwnProperty("verification")) - object.verification = options.enums === String ? $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] === undefined ? message.verification : $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] : message.verification; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; - - /** - * Converts this ExtensionRangeOptions to JSON. - * @function toJSON - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - * @returns {Object.} JSON object - */ - ExtensionRangeOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExtensionRangeOptions - * @function getTypeUrl - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExtensionRangeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions"; - }; - - ExtensionRangeOptions.Declaration = (function() { - - /** - * Properties of a Declaration. - * @memberof google.protobuf.ExtensionRangeOptions - * @interface IDeclaration - * @property {number|null} [number] Declaration number - * @property {string|null} [fullName] Declaration fullName - * @property {string|null} [type] Declaration type - * @property {boolean|null} [reserved] Declaration reserved - * @property {boolean|null} [repeated] Declaration repeated - */ - - /** - * Constructs a new Declaration. - * @memberof google.protobuf.ExtensionRangeOptions - * @classdesc Represents a Declaration. - * @implements IDeclaration - * @constructor - * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set - */ - function Declaration(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Declaration number. - * @member {number} number - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.number = 0; - - /** - * Declaration fullName. - * @member {string} fullName - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.fullName = ""; - - /** - * Declaration type. - * @member {string} type - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.type = ""; - - /** - * Declaration reserved. - * @member {boolean} reserved - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.reserved = false; - - /** - * Declaration repeated. - * @member {boolean} repeated - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.repeated = false; - - /** - * Creates a new Declaration instance using the specified properties. - * @function create - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set - * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration instance - */ - Declaration.create = function create(properties) { - return new Declaration(properties); - }; - - /** - * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Declaration.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.number != null && Object.hasOwnProperty.call(message, "number")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.number); - if (message.fullName != null && Object.hasOwnProperty.call(message, "fullName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.fullName); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.type); - if (message.reserved != null && Object.hasOwnProperty.call(message, "reserved")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.reserved); - if (message.repeated != null && Object.hasOwnProperty.call(message, "repeated")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.repeated); - return writer; - }; - - /** - * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Declaration.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Declaration message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Declaration.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.number = reader.int32(); - break; - } - case 2: { - message.fullName = reader.string(); - break; - } - case 3: { - message.type = reader.string(); - break; - } - case 5: { - message.reserved = reader.bool(); - break; - } - case 6: { - message.repeated = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Declaration message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Declaration.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Declaration message. - * @function verify - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Declaration.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.number != null && message.hasOwnProperty("number")) - if (!$util.isInteger(message.number)) - return "number: integer expected"; - if (message.fullName != null && message.hasOwnProperty("fullName")) - if (!$util.isString(message.fullName)) - return "fullName: string expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.reserved != null && message.hasOwnProperty("reserved")) - if (typeof message.reserved !== "boolean") - return "reserved: boolean expected"; - if (message.repeated != null && message.hasOwnProperty("repeated")) - if (typeof message.repeated !== "boolean") - return "repeated: boolean expected"; - return null; - }; - - /** - * Creates a Declaration message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration - */ - Declaration.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ExtensionRangeOptions.Declaration) - return object; - var message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); - if (object.number != null) - message.number = object.number | 0; - if (object.fullName != null) - message.fullName = String(object.fullName); - if (object.type != null) - message.type = String(object.type); - if (object.reserved != null) - message.reserved = Boolean(object.reserved); - if (object.repeated != null) - message.repeated = Boolean(object.repeated); - return message; - }; - - /** - * Creates a plain object from a Declaration message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {google.protobuf.ExtensionRangeOptions.Declaration} message Declaration - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Declaration.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.number = 0; - object.fullName = ""; - object.type = ""; - object.reserved = false; - object.repeated = false; - } - if (message.number != null && message.hasOwnProperty("number")) - object.number = message.number; - if (message.fullName != null && message.hasOwnProperty("fullName")) - object.fullName = message.fullName; - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.reserved != null && message.hasOwnProperty("reserved")) - object.reserved = message.reserved; - if (message.repeated != null && message.hasOwnProperty("repeated")) - object.repeated = message.repeated; - return object; - }; - - /** - * Converts this Declaration to JSON. - * @function toJSON - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - * @returns {Object.} JSON object - */ - Declaration.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Declaration - * @function getTypeUrl - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Declaration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions.Declaration"; - }; - - return Declaration; - })(); - - /** - * VerificationState enum. - * @name google.protobuf.ExtensionRangeOptions.VerificationState - * @enum {number} - * @property {number} DECLARATION=0 DECLARATION value - * @property {number} UNVERIFIED=1 UNVERIFIED value - */ - ExtensionRangeOptions.VerificationState = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "DECLARATION"] = 0; - values[valuesById[1] = "UNVERIFIED"] = 1; - return values; - })(); - - return ExtensionRangeOptions; - })(); - - protobuf.FieldDescriptorProto = (function() { - - /** - * Properties of a FieldDescriptorProto. - * @memberof google.protobuf - * @interface IFieldDescriptorProto - * @property {string|null} [name] FieldDescriptorProto name - * @property {number|null} [number] FieldDescriptorProto number - * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label - * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type - * @property {string|null} [typeName] FieldDescriptorProto typeName - * @property {string|null} [extendee] FieldDescriptorProto extendee - * @property {string|null} [defaultValue] FieldDescriptorProto defaultValue - * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex - * @property {string|null} [jsonName] FieldDescriptorProto jsonName - * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options - * @property {boolean|null} [proto3Optional] FieldDescriptorProto proto3Optional - */ - - /** - * Constructs a new FieldDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a FieldDescriptorProto. - * @implements IFieldDescriptorProto - * @constructor - * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set - */ - function FieldDescriptorProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FieldDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.name = ""; - - /** - * FieldDescriptorProto number. - * @member {number} number - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.number = 0; - - /** - * FieldDescriptorProto label. - * @member {google.protobuf.FieldDescriptorProto.Label} label - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.label = 1; - - /** - * FieldDescriptorProto type. - * @member {google.protobuf.FieldDescriptorProto.Type} type - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.type = 1; - - /** - * FieldDescriptorProto typeName. - * @member {string} typeName - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.typeName = ""; - - /** - * FieldDescriptorProto extendee. - * @member {string} extendee - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.extendee = ""; - - /** - * FieldDescriptorProto defaultValue. - * @member {string} defaultValue - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.defaultValue = ""; - - /** - * FieldDescriptorProto oneofIndex. - * @member {number} oneofIndex - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.oneofIndex = 0; - - /** - * FieldDescriptorProto jsonName. - * @member {string} jsonName - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.jsonName = ""; - - /** - * FieldDescriptorProto options. - * @member {google.protobuf.IFieldOptions|null|undefined} options - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.options = null; - - /** - * FieldDescriptorProto proto3Optional. - * @member {boolean} proto3Optional - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.proto3Optional = false; - - /** - * Creates a new FieldDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance - */ - FieldDescriptorProto.create = function create(properties) { - return new FieldDescriptorProto(properties); - }; - - /** - * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); - if (message.number != null && Object.hasOwnProperty.call(message, "number")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); - if (message.label != null && Object.hasOwnProperty.call(message, "label")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); - if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); - if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); - if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); - if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) - writer.uint32(/* id 17, wireType 0 =*/136).bool(message.proto3Optional); - return writer; - }; - - /** - * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldDescriptorProto.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 3: { - message.number = reader.int32(); - break; - } - case 4: { - message.label = reader.int32(); - break; - } - case 5: { - message.type = reader.int32(); - break; - } - case 6: { - message.typeName = reader.string(); - break; - } - case 2: { - message.extendee = reader.string(); - break; - } - case 7: { - message.defaultValue = reader.string(); - break; - } - case 9: { - message.oneofIndex = reader.int32(); - break; - } - case 10: { - message.jsonName = reader.string(); - break; - } - case 8: { - message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); - break; - } - case 17: { - message.proto3Optional = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FieldDescriptorProto message. - * @function verify - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FieldDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.number != null && message.hasOwnProperty("number")) - if (!$util.isInteger(message.number)) - return "number: integer expected"; - if (message.label != null && message.hasOwnProperty("label")) - switch (message.label) { - default: - return "label: enum value expected"; - case 1: - case 3: - case 2: - break; - } - if (message.type != null && message.hasOwnProperty("type")) - switch (message.type) { - default: - return "type: enum value expected"; - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - case 10: - case 11: - case 12: - case 13: - case 14: - case 15: - case 16: - case 17: - case 18: - break; - } - if (message.typeName != null && message.hasOwnProperty("typeName")) - if (!$util.isString(message.typeName)) - return "typeName: string expected"; - if (message.extendee != null && message.hasOwnProperty("extendee")) - if (!$util.isString(message.extendee)) - return "extendee: string expected"; - if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) - if (!$util.isString(message.defaultValue)) - return "defaultValue: string expected"; - if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) - if (!$util.isInteger(message.oneofIndex)) - return "oneofIndex: integer expected"; - if (message.jsonName != null && message.hasOwnProperty("jsonName")) - if (!$util.isString(message.jsonName)) - return "jsonName: string expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.FieldOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) - if (typeof message.proto3Optional !== "boolean") - return "proto3Optional: boolean expected"; - return null; - }; - - /** - * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto - */ - FieldDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldDescriptorProto) - return object; - var message = new $root.google.protobuf.FieldDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.number != null) - message.number = object.number | 0; - switch (object.label) { - default: - if (typeof object.label === "number") { - message.label = object.label; - break; - } - break; - case "LABEL_OPTIONAL": - case 1: - message.label = 1; - break; - case "LABEL_REPEATED": - case 3: - message.label = 3; - break; - case "LABEL_REQUIRED": - case 2: - message.label = 2; - break; - } - switch (object.type) { - default: - if (typeof object.type === "number") { - message.type = object.type; - break; - } - break; - case "TYPE_DOUBLE": - case 1: - message.type = 1; - break; - case "TYPE_FLOAT": - case 2: - message.type = 2; - break; - case "TYPE_INT64": - case 3: - message.type = 3; - break; - case "TYPE_UINT64": - case 4: - message.type = 4; - break; - case "TYPE_INT32": - case 5: - message.type = 5; - break; - case "TYPE_FIXED64": - case 6: - message.type = 6; - break; - case "TYPE_FIXED32": - case 7: - message.type = 7; - break; - case "TYPE_BOOL": - case 8: - message.type = 8; - break; - case "TYPE_STRING": - case 9: - message.type = 9; - break; - case "TYPE_GROUP": - case 10: - message.type = 10; - break; - case "TYPE_MESSAGE": - case 11: - message.type = 11; - break; - case "TYPE_BYTES": - case 12: - message.type = 12; - break; - case "TYPE_UINT32": - case 13: - message.type = 13; - break; - case "TYPE_ENUM": - case 14: - message.type = 14; - break; - case "TYPE_SFIXED32": - case 15: - message.type = 15; - break; - case "TYPE_SFIXED64": - case 16: - message.type = 16; - break; - case "TYPE_SINT32": - case 17: - message.type = 17; - break; - case "TYPE_SINT64": - case 18: - message.type = 18; - break; - } - if (object.typeName != null) - message.typeName = String(object.typeName); - if (object.extendee != null) - message.extendee = String(object.extendee); - if (object.defaultValue != null) - message.defaultValue = String(object.defaultValue); - if (object.oneofIndex != null) - message.oneofIndex = object.oneofIndex | 0; - if (object.jsonName != null) - message.jsonName = String(object.jsonName); - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.FieldOptions.fromObject(object.options); - } - if (object.proto3Optional != null) - message.proto3Optional = Boolean(object.proto3Optional); - return message; - }; - - /** - * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FieldDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.extendee = ""; - object.number = 0; - object.label = options.enums === String ? "LABEL_OPTIONAL" : 1; - object.type = options.enums === String ? "TYPE_DOUBLE" : 1; - object.typeName = ""; - object.defaultValue = ""; - object.options = null; - object.oneofIndex = 0; - object.jsonName = ""; - object.proto3Optional = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.extendee != null && message.hasOwnProperty("extendee")) - object.extendee = message.extendee; - if (message.number != null && message.hasOwnProperty("number")) - object.number = message.number; - if (message.label != null && message.hasOwnProperty("label")) - object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] === undefined ? message.label : $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] === undefined ? message.type : $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; - if (message.typeName != null && message.hasOwnProperty("typeName")) - object.typeName = message.typeName; - if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) - object.defaultValue = message.defaultValue; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options); - if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) - object.oneofIndex = message.oneofIndex; - if (message.jsonName != null && message.hasOwnProperty("jsonName")) - object.jsonName = message.jsonName; - if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) - object.proto3Optional = message.proto3Optional; - return object; - }; - - /** - * Converts this FieldDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.FieldDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - FieldDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FieldDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FieldDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FieldDescriptorProto"; - }; - - /** - * Type enum. - * @name google.protobuf.FieldDescriptorProto.Type - * @enum {number} - * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value - * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value - * @property {number} TYPE_INT64=3 TYPE_INT64 value - * @property {number} TYPE_UINT64=4 TYPE_UINT64 value - * @property {number} TYPE_INT32=5 TYPE_INT32 value - * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value - * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value - * @property {number} TYPE_BOOL=8 TYPE_BOOL value - * @property {number} TYPE_STRING=9 TYPE_STRING value - * @property {number} TYPE_GROUP=10 TYPE_GROUP value - * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value - * @property {number} TYPE_BYTES=12 TYPE_BYTES value - * @property {number} TYPE_UINT32=13 TYPE_UINT32 value - * @property {number} TYPE_ENUM=14 TYPE_ENUM value - * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value - * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value - * @property {number} TYPE_SINT32=17 TYPE_SINT32 value - * @property {number} TYPE_SINT64=18 TYPE_SINT64 value - */ - FieldDescriptorProto.Type = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[1] = "TYPE_DOUBLE"] = 1; - values[valuesById[2] = "TYPE_FLOAT"] = 2; - values[valuesById[3] = "TYPE_INT64"] = 3; - values[valuesById[4] = "TYPE_UINT64"] = 4; - values[valuesById[5] = "TYPE_INT32"] = 5; - values[valuesById[6] = "TYPE_FIXED64"] = 6; - values[valuesById[7] = "TYPE_FIXED32"] = 7; - values[valuesById[8] = "TYPE_BOOL"] = 8; - values[valuesById[9] = "TYPE_STRING"] = 9; - values[valuesById[10] = "TYPE_GROUP"] = 10; - values[valuesById[11] = "TYPE_MESSAGE"] = 11; - values[valuesById[12] = "TYPE_BYTES"] = 12; - values[valuesById[13] = "TYPE_UINT32"] = 13; - values[valuesById[14] = "TYPE_ENUM"] = 14; - values[valuesById[15] = "TYPE_SFIXED32"] = 15; - values[valuesById[16] = "TYPE_SFIXED64"] = 16; - values[valuesById[17] = "TYPE_SINT32"] = 17; - values[valuesById[18] = "TYPE_SINT64"] = 18; - return values; - })(); - - /** - * Label enum. - * @name google.protobuf.FieldDescriptorProto.Label - * @enum {number} - * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value - * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value - * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value - */ - FieldDescriptorProto.Label = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[1] = "LABEL_OPTIONAL"] = 1; - values[valuesById[3] = "LABEL_REPEATED"] = 3; - values[valuesById[2] = "LABEL_REQUIRED"] = 2; - return values; - })(); - - return FieldDescriptorProto; - })(); - - protobuf.OneofDescriptorProto = (function() { - - /** - * Properties of an OneofDescriptorProto. - * @memberof google.protobuf - * @interface IOneofDescriptorProto - * @property {string|null} [name] OneofDescriptorProto name - * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options - */ - - /** - * Constructs a new OneofDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents an OneofDescriptorProto. - * @implements IOneofDescriptorProto - * @constructor - * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set - */ - function OneofDescriptorProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * OneofDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.OneofDescriptorProto - * @instance - */ - OneofDescriptorProto.prototype.name = ""; - - /** - * OneofDescriptorProto options. - * @member {google.protobuf.IOneofOptions|null|undefined} options - * @memberof google.protobuf.OneofDescriptorProto - * @instance - */ - OneofDescriptorProto.prototype.options = null; - - /** - * Creates a new OneofDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance - */ - OneofDescriptorProto.create = function create(properties) { - return new OneofDescriptorProto(properties); - }; - - /** - * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofDescriptorProto.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OneofDescriptorProto message. - * @function verify - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OneofDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.OneofOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto - */ - OneofDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.OneofDescriptorProto) - return object; - var message = new $root.google.protobuf.OneofDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.OneofOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OneofDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this OneofDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.OneofDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - OneofDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OneofDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OneofDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.OneofDescriptorProto"; - }; - - return OneofDescriptorProto; - })(); - - protobuf.EnumDescriptorProto = (function() { - - /** - * Properties of an EnumDescriptorProto. - * @memberof google.protobuf - * @interface IEnumDescriptorProto - * @property {string|null} [name] EnumDescriptorProto name - * @property {Array.|null} [value] EnumDescriptorProto value - * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options - * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange - * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName - */ - - /** - * Constructs a new EnumDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents an EnumDescriptorProto. - * @implements IEnumDescriptorProto - * @constructor - * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set - */ - function EnumDescriptorProto(properties) { - this.value = []; - this.reservedRange = []; - this.reservedName = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.name = ""; - - /** - * EnumDescriptorProto value. - * @member {Array.} value - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.value = $util.emptyArray; - - /** - * EnumDescriptorProto options. - * @member {google.protobuf.IEnumOptions|null|undefined} options - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.options = null; - - /** - * EnumDescriptorProto reservedRange. - * @member {Array.} reservedRange - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; - - /** - * EnumDescriptorProto reservedName. - * @member {Array.} reservedName - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.reservedName = $util.emptyArray; - - /** - * Creates a new EnumDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance - */ - EnumDescriptorProto.create = function create(properties) { - return new EnumDescriptorProto(properties); - }; - - /** - * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.value != null && message.value.length) - for (var i = 0; i < message.value.length; ++i) - $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.reservedRange != null && message.reservedRange.length) - for (var i = 0; i < message.reservedRange.length; ++i) - $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.reservedName != null && message.reservedName.length) - for (var i = 0; i < message.reservedName.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); - return writer; - }; - - /** - * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumDescriptorProto.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - if (!(message.value && message.value.length)) - message.value = []; - message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 3: { - message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); - break; - } - case 4: { - if (!(message.reservedRange && message.reservedRange.length)) - message.reservedRange = []; - message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32())); - break; - } - case 5: { - if (!(message.reservedName && message.reservedName.length)) - message.reservedName = []; - message.reservedName.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumDescriptorProto message. - * @function verify - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.value != null && message.hasOwnProperty("value")) { - if (!Array.isArray(message.value)) - return "value: array expected"; - for (var i = 0; i < message.value.length; ++i) { - var error = $root.google.protobuf.EnumValueDescriptorProto.verify(message.value[i]); - if (error) - return "value." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.EnumOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { - if (!Array.isArray(message.reservedRange)) - return "reservedRange: array expected"; - for (var i = 0; i < message.reservedRange.length; ++i) { - var error = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.verify(message.reservedRange[i]); - if (error) - return "reservedRange." + error; - } - } - if (message.reservedName != null && message.hasOwnProperty("reservedName")) { - if (!Array.isArray(message.reservedName)) - return "reservedName: array expected"; - for (var i = 0; i < message.reservedName.length; ++i) - if (!$util.isString(message.reservedName[i])) - return "reservedName: string[] expected"; - } - return null; - }; - - /** - * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto - */ - EnumDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumDescriptorProto) - return object; - var message = new $root.google.protobuf.EnumDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.value) { - if (!Array.isArray(object.value)) - throw TypeError(".google.protobuf.EnumDescriptorProto.value: array expected"); - message.value = []; - for (var i = 0; i < object.value.length; ++i) { - if (typeof object.value[i] !== "object") - throw TypeError(".google.protobuf.EnumDescriptorProto.value: object expected"); - message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.EnumDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.EnumOptions.fromObject(object.options); - } - if (object.reservedRange) { - if (!Array.isArray(object.reservedRange)) - throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: array expected"); - message.reservedRange = []; - for (var i = 0; i < object.reservedRange.length; ++i) { - if (typeof object.reservedRange[i] !== "object") - throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: object expected"); - message.reservedRange[i] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.fromObject(object.reservedRange[i]); - } - } - if (object.reservedName) { - if (!Array.isArray(object.reservedName)) - throw TypeError(".google.protobuf.EnumDescriptorProto.reservedName: array expected"); - message.reservedName = []; - for (var i = 0; i < object.reservedName.length; ++i) - message.reservedName[i] = String(object.reservedName[i]); - } - return message; - }; - - /** - * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.value = []; - object.reservedRange = []; - object.reservedName = []; - } - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.value && message.value.length) { - object.value = []; - for (var j = 0; j < message.value.length; ++j) - object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options); - if (message.reservedRange && message.reservedRange.length) { - object.reservedRange = []; - for (var j = 0; j < message.reservedRange.length; ++j) - object.reservedRange[j] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.toObject(message.reservedRange[j], options); - } - if (message.reservedName && message.reservedName.length) { - object.reservedName = []; - for (var j = 0; j < message.reservedName.length; ++j) - object.reservedName[j] = message.reservedName[j]; - } - return object; - }; - - /** - * Converts this EnumDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.EnumDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - EnumDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto"; - }; - - EnumDescriptorProto.EnumReservedRange = (function() { - - /** - * Properties of an EnumReservedRange. - * @memberof google.protobuf.EnumDescriptorProto - * @interface IEnumReservedRange - * @property {number|null} [start] EnumReservedRange start - * @property {number|null} [end] EnumReservedRange end - */ - - /** - * Constructs a new EnumReservedRange. - * @memberof google.protobuf.EnumDescriptorProto - * @classdesc Represents an EnumReservedRange. - * @implements IEnumReservedRange - * @constructor - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set - */ - function EnumReservedRange(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumReservedRange start. - * @member {number} start - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @instance - */ - EnumReservedRange.prototype.start = 0; - - /** - * EnumReservedRange end. - * @member {number} end - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @instance - */ - EnumReservedRange.prototype.end = 0; - - /** - * Creates a new EnumReservedRange instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set - * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance - */ - EnumReservedRange.create = function create(properties) { - return new EnumReservedRange(properties); - }; - - /** - * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumReservedRange.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.start != null && Object.hasOwnProperty.call(message, "start")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); - return writer; - }; - - /** - * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumReservedRange message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumReservedRange.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.start = reader.int32(); - break; - } - case 2: { - message.end = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumReservedRange.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumReservedRange message. - * @function verify - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumReservedRange.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.start != null && message.hasOwnProperty("start")) - if (!$util.isInteger(message.start)) - return "start: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - return null; - }; - - /** - * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange - */ - EnumReservedRange.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumDescriptorProto.EnumReservedRange) - return object; - var message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); - if (object.start != null) - message.start = object.start | 0; - if (object.end != null) - message.end = object.end | 0; - return message; - }; - - /** - * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {google.protobuf.EnumDescriptorProto.EnumReservedRange} message EnumReservedRange - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumReservedRange.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.start = 0; - object.end = 0; - } - if (message.start != null && message.hasOwnProperty("start")) - object.start = message.start; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - return object; - }; - - /** - * Converts this EnumReservedRange to JSON. - * @function toJSON - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @instance - * @returns {Object.} JSON object - */ - EnumReservedRange.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumReservedRange - * @function getTypeUrl - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto.EnumReservedRange"; - }; - - return EnumReservedRange; - })(); - - return EnumDescriptorProto; - })(); - - protobuf.EnumValueDescriptorProto = (function() { - - /** - * Properties of an EnumValueDescriptorProto. - * @memberof google.protobuf - * @interface IEnumValueDescriptorProto - * @property {string|null} [name] EnumValueDescriptorProto name - * @property {number|null} [number] EnumValueDescriptorProto number - * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options - */ - - /** - * Constructs a new EnumValueDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents an EnumValueDescriptorProto. - * @implements IEnumValueDescriptorProto - * @constructor - * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set - */ - function EnumValueDescriptorProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumValueDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - */ - EnumValueDescriptorProto.prototype.name = ""; - - /** - * EnumValueDescriptorProto number. - * @member {number} number - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - */ - EnumValueDescriptorProto.prototype.number = 0; - - /** - * EnumValueDescriptorProto options. - * @member {google.protobuf.IEnumValueOptions|null|undefined} options - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - */ - EnumValueDescriptorProto.prototype.options = null; - - /** - * Creates a new EnumValueDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance - */ - EnumValueDescriptorProto.create = function create(properties) { - return new EnumValueDescriptorProto(properties); - }; - - /** - * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.number != null && Object.hasOwnProperty.call(message, "number")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueDescriptorProto.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.number = reader.int32(); - break; - } - case 3: { - message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumValueDescriptorProto message. - * @function verify - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumValueDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.number != null && message.hasOwnProperty("number")) - if (!$util.isInteger(message.number)) - return "number: integer expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.EnumValueOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto - */ - EnumValueDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) - return object; - var message = new $root.google.protobuf.EnumValueDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.number != null) - message.number = object.number | 0; - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumValueDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.number = 0; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.number != null && message.hasOwnProperty("number")) - object.number = message.number; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this EnumValueDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - EnumValueDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumValueDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumValueDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumValueDescriptorProto"; - }; - - return EnumValueDescriptorProto; - })(); - - protobuf.ServiceDescriptorProto = (function() { - - /** - * Properties of a ServiceDescriptorProto. - * @memberof google.protobuf - * @interface IServiceDescriptorProto - * @property {string|null} [name] ServiceDescriptorProto name - * @property {Array.|null} [method] ServiceDescriptorProto method - * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options - */ - - /** - * Constructs a new ServiceDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a ServiceDescriptorProto. - * @implements IServiceDescriptorProto - * @constructor - * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set - */ - function ServiceDescriptorProto(properties) { - this.method = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ServiceDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - */ - ServiceDescriptorProto.prototype.name = ""; - - /** - * ServiceDescriptorProto method. - * @member {Array.} method - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - */ - ServiceDescriptorProto.prototype.method = $util.emptyArray; - - /** - * ServiceDescriptorProto options. - * @member {google.protobuf.IServiceOptions|null|undefined} options - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - */ - ServiceDescriptorProto.prototype.options = null; - - /** - * Creates a new ServiceDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance - */ - ServiceDescriptorProto.create = function create(properties) { - return new ServiceDescriptorProto(properties); - }; - - /** - * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.method != null && message.method.length) - for (var i = 0; i < message.method.length; ++i) - $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceDescriptorProto.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - if (!(message.method && message.method.length)) - message.method = []; - message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 3: { - message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ServiceDescriptorProto message. - * @function verify - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ServiceDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.method != null && message.hasOwnProperty("method")) { - if (!Array.isArray(message.method)) - return "method: array expected"; - for (var i = 0; i < message.method.length; ++i) { - var error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i]); - if (error) - return "method." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.ServiceOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto - */ - ServiceDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ServiceDescriptorProto) - return object; - var message = new $root.google.protobuf.ServiceDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.method) { - if (!Array.isArray(object.method)) - throw TypeError(".google.protobuf.ServiceDescriptorProto.method: array expected"); - message.method = []; - for (var i = 0; i < object.method.length; ++i) { - if (typeof object.method[i] !== "object") - throw TypeError(".google.protobuf.ServiceDescriptorProto.method: object expected"); - message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ServiceDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.method = []; - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.method && message.method.length) { - object.method = []; - for (var j = 0; j < message.method.length; ++j) - object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this ServiceDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - ServiceDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ServiceDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ServiceDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.ServiceDescriptorProto"; - }; - - return ServiceDescriptorProto; - })(); - - protobuf.MethodDescriptorProto = (function() { - - /** - * Properties of a MethodDescriptorProto. - * @memberof google.protobuf - * @interface IMethodDescriptorProto - * @property {string|null} [name] MethodDescriptorProto name - * @property {string|null} [inputType] MethodDescriptorProto inputType - * @property {string|null} [outputType] MethodDescriptorProto outputType - * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options - * @property {boolean|null} [clientStreaming] MethodDescriptorProto clientStreaming - * @property {boolean|null} [serverStreaming] MethodDescriptorProto serverStreaming - */ - - /** - * Constructs a new MethodDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a MethodDescriptorProto. - * @implements IMethodDescriptorProto - * @constructor - * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set - */ - function MethodDescriptorProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MethodDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.name = ""; - - /** - * MethodDescriptorProto inputType. - * @member {string} inputType - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.inputType = ""; - - /** - * MethodDescriptorProto outputType. - * @member {string} outputType - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.outputType = ""; - - /** - * MethodDescriptorProto options. - * @member {google.protobuf.IMethodOptions|null|undefined} options - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.options = null; - - /** - * MethodDescriptorProto clientStreaming. - * @member {boolean} clientStreaming - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.clientStreaming = false; - - /** - * MethodDescriptorProto serverStreaming. - * @member {boolean} serverStreaming - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.serverStreaming = false; - - /** - * Creates a new MethodDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance - */ - MethodDescriptorProto.create = function create(properties) { - return new MethodDescriptorProto(properties); - }; - - /** - * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); - if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); - if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); - return writer; - }; - - /** - * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodDescriptorProto.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.inputType = reader.string(); - break; - } - case 3: { - message.outputType = reader.string(); - break; - } - case 4: { - message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); - break; - } - case 5: { - message.clientStreaming = reader.bool(); - break; - } - case 6: { - message.serverStreaming = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MethodDescriptorProto message. - * @function verify - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MethodDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.inputType != null && message.hasOwnProperty("inputType")) - if (!$util.isString(message.inputType)) - return "inputType: string expected"; - if (message.outputType != null && message.hasOwnProperty("outputType")) - if (!$util.isString(message.outputType)) - return "outputType: string expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.MethodOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) - if (typeof message.clientStreaming !== "boolean") - return "clientStreaming: boolean expected"; - if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) - if (typeof message.serverStreaming !== "boolean") - return "serverStreaming: boolean expected"; - return null; - }; - - /** - * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto - */ - MethodDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.MethodDescriptorProto) - return object; - var message = new $root.google.protobuf.MethodDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.inputType != null) - message.inputType = String(object.inputType); - if (object.outputType != null) - message.outputType = String(object.outputType); - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.MethodOptions.fromObject(object.options); - } - if (object.clientStreaming != null) - message.clientStreaming = Boolean(object.clientStreaming); - if (object.serverStreaming != null) - message.serverStreaming = Boolean(object.serverStreaming); - return message; - }; - - /** - * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MethodDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.inputType = ""; - object.outputType = ""; - object.options = null; - object.clientStreaming = false; - object.serverStreaming = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.inputType != null && message.hasOwnProperty("inputType")) - object.inputType = message.inputType; - if (message.outputType != null && message.hasOwnProperty("outputType")) - object.outputType = message.outputType; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options); - if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) - object.clientStreaming = message.clientStreaming; - if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) - object.serverStreaming = message.serverStreaming; - return object; - }; - - /** - * Converts this MethodDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.MethodDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - MethodDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MethodDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MethodDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.MethodDescriptorProto"; - }; - - return MethodDescriptorProto; - })(); - - protobuf.FileOptions = (function() { - - /** - * Properties of a FileOptions. - * @memberof google.protobuf - * @interface IFileOptions - * @property {string|null} [javaPackage] FileOptions javaPackage - * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname - * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles - * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash - * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8 - * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor - * @property {string|null} [goPackage] FileOptions goPackage - * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices - * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices - * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices - * @property {boolean|null} [deprecated] FileOptions deprecated - * @property {boolean|null} [ccEnableArenas] FileOptions ccEnableArenas - * @property {string|null} [objcClassPrefix] FileOptions objcClassPrefix - * @property {string|null} [csharpNamespace] FileOptions csharpNamespace - * @property {string|null} [swiftPrefix] FileOptions swiftPrefix - * @property {string|null} [phpClassPrefix] FileOptions phpClassPrefix - * @property {string|null} [phpNamespace] FileOptions phpNamespace - * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace - * @property {string|null} [rubyPackage] FileOptions rubyPackage - * @property {google.protobuf.IFeatureSet|null} [features] FileOptions features - * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption - * @property {Array.|null} [".google.api.resourceDefinition"] FileOptions .google.api.resourceDefinition - */ - - /** - * Constructs a new FileOptions. - * @memberof google.protobuf - * @classdesc Represents a FileOptions. - * @implements IFileOptions - * @constructor - * @param {google.protobuf.IFileOptions=} [properties] Properties to set - */ - function FileOptions(properties) { - this.uninterpretedOption = []; - this[".google.api.resourceDefinition"] = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FileOptions javaPackage. - * @member {string} javaPackage - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaPackage = ""; - - /** - * FileOptions javaOuterClassname. - * @member {string} javaOuterClassname - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaOuterClassname = ""; - - /** - * FileOptions javaMultipleFiles. - * @member {boolean} javaMultipleFiles - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaMultipleFiles = false; - - /** - * FileOptions javaGenerateEqualsAndHash. - * @member {boolean} javaGenerateEqualsAndHash - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaGenerateEqualsAndHash = false; - - /** - * FileOptions javaStringCheckUtf8. - * @member {boolean} javaStringCheckUtf8 - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaStringCheckUtf8 = false; - - /** - * FileOptions optimizeFor. - * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.optimizeFor = 1; - - /** - * FileOptions goPackage. - * @member {string} goPackage - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.goPackage = ""; - - /** - * FileOptions ccGenericServices. - * @member {boolean} ccGenericServices - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.ccGenericServices = false; - - /** - * FileOptions javaGenericServices. - * @member {boolean} javaGenericServices - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaGenericServices = false; - - /** - * FileOptions pyGenericServices. - * @member {boolean} pyGenericServices - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.pyGenericServices = false; - - /** - * FileOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.deprecated = false; - - /** - * FileOptions ccEnableArenas. - * @member {boolean} ccEnableArenas - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.ccEnableArenas = true; - - /** - * FileOptions objcClassPrefix. - * @member {string} objcClassPrefix - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.objcClassPrefix = ""; - - /** - * FileOptions csharpNamespace. - * @member {string} csharpNamespace - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.csharpNamespace = ""; - - /** - * FileOptions swiftPrefix. - * @member {string} swiftPrefix - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.swiftPrefix = ""; - - /** - * FileOptions phpClassPrefix. - * @member {string} phpClassPrefix - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.phpClassPrefix = ""; - - /** - * FileOptions phpNamespace. - * @member {string} phpNamespace - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.phpNamespace = ""; - - /** - * FileOptions phpMetadataNamespace. - * @member {string} phpMetadataNamespace - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.phpMetadataNamespace = ""; - - /** - * FileOptions rubyPackage. - * @member {string} rubyPackage - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.rubyPackage = ""; - - /** - * FileOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.features = null; - - /** - * FileOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * FileOptions .google.api.resourceDefinition. - * @member {Array.} .google.api.resourceDefinition - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray; - - /** - * Creates a new FileOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.FileOptions - * @static - * @param {google.protobuf.IFileOptions=} [properties] Properties to set - * @returns {google.protobuf.FileOptions} FileOptions instance - */ - FileOptions.create = function create(properties) { - return new FileOptions(properties); - }; - - /** - * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FileOptions - * @static - * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); - if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); - if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); - if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) - writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); - if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); - if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) - writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); - if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) - writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); - if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) - writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); - if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) - writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); - if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) - writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); - if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) - writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); - if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) - writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); - if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) - writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); - if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) - writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); - if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) - writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); - if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) - writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); - if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) - writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); - if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) - writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.resourceDefinition"] != null && message[".google.api.resourceDefinition"].length) - for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) - $root.google.api.ResourceDescriptor.encode(message[".google.api.resourceDefinition"][i], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FileOptions - * @static - * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FileOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FileOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FileOptions} FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.javaPackage = reader.string(); - break; - } - case 8: { - message.javaOuterClassname = reader.string(); - break; - } - case 10: { - message.javaMultipleFiles = reader.bool(); - break; - } - case 20: { - message.javaGenerateEqualsAndHash = reader.bool(); - break; - } - case 27: { - message.javaStringCheckUtf8 = reader.bool(); - break; - } - case 9: { - message.optimizeFor = reader.int32(); - break; - } - case 11: { - message.goPackage = reader.string(); - break; - } - case 16: { - message.ccGenericServices = reader.bool(); - break; - } - case 17: { - message.javaGenericServices = reader.bool(); - break; - } - case 18: { - message.pyGenericServices = reader.bool(); - break; - } - case 23: { - message.deprecated = reader.bool(); - break; - } - case 31: { - message.ccEnableArenas = reader.bool(); - break; - } - case 36: { - message.objcClassPrefix = reader.string(); - break; - } - case 37: { - message.csharpNamespace = reader.string(); - break; - } - case 39: { - message.swiftPrefix = reader.string(); - break; - } - case 40: { - message.phpClassPrefix = reader.string(); - break; - } - case 41: { - message.phpNamespace = reader.string(); - break; - } - case 44: { - message.phpMetadataNamespace = reader.string(); - break; - } - case 45: { - message.rubyPackage = reader.string(); - break; - } - case 50: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 1053: { - if (!(message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length)) - message[".google.api.resourceDefinition"] = []; - message[".google.api.resourceDefinition"].push($root.google.api.ResourceDescriptor.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FileOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FileOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FileOptions} FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FileOptions message. - * @function verify - * @memberof google.protobuf.FileOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FileOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) - if (!$util.isString(message.javaPackage)) - return "javaPackage: string expected"; - if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) - if (!$util.isString(message.javaOuterClassname)) - return "javaOuterClassname: string expected"; - if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) - if (typeof message.javaMultipleFiles !== "boolean") - return "javaMultipleFiles: boolean expected"; - if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) - if (typeof message.javaGenerateEqualsAndHash !== "boolean") - return "javaGenerateEqualsAndHash: boolean expected"; - if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) - if (typeof message.javaStringCheckUtf8 !== "boolean") - return "javaStringCheckUtf8: boolean expected"; - if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) - switch (message.optimizeFor) { - default: - return "optimizeFor: enum value expected"; - case 1: - case 2: - case 3: - break; - } - if (message.goPackage != null && message.hasOwnProperty("goPackage")) - if (!$util.isString(message.goPackage)) - return "goPackage: string expected"; - if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) - if (typeof message.ccGenericServices !== "boolean") - return "ccGenericServices: boolean expected"; - if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) - if (typeof message.javaGenericServices !== "boolean") - return "javaGenericServices: boolean expected"; - if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) - if (typeof message.pyGenericServices !== "boolean") - return "pyGenericServices: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) - if (typeof message.ccEnableArenas !== "boolean") - return "ccEnableArenas: boolean expected"; - if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) - if (!$util.isString(message.objcClassPrefix)) - return "objcClassPrefix: string expected"; - if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) - if (!$util.isString(message.csharpNamespace)) - return "csharpNamespace: string expected"; - if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) - if (!$util.isString(message.swiftPrefix)) - return "swiftPrefix: string expected"; - if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) - if (!$util.isString(message.phpClassPrefix)) - return "phpClassPrefix: string expected"; - if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) - if (!$util.isString(message.phpNamespace)) - return "phpNamespace: string expected"; - if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) - if (!$util.isString(message.phpMetadataNamespace)) - return "phpMetadataNamespace: string expected"; - if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) - if (!$util.isString(message.rubyPackage)) - return "rubyPackage: string expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".google.api.resourceDefinition"] != null && message.hasOwnProperty(".google.api.resourceDefinition")) { - if (!Array.isArray(message[".google.api.resourceDefinition"])) - return ".google.api.resourceDefinition: array expected"; - for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) { - var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resourceDefinition"][i]); - if (error) - return ".google.api.resourceDefinition." + error; - } - } - return null; - }; - - /** - * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FileOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FileOptions} FileOptions - */ - FileOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FileOptions) - return object; - var message = new $root.google.protobuf.FileOptions(); - if (object.javaPackage != null) - message.javaPackage = String(object.javaPackage); - if (object.javaOuterClassname != null) - message.javaOuterClassname = String(object.javaOuterClassname); - if (object.javaMultipleFiles != null) - message.javaMultipleFiles = Boolean(object.javaMultipleFiles); - if (object.javaGenerateEqualsAndHash != null) - message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash); - if (object.javaStringCheckUtf8 != null) - message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); - switch (object.optimizeFor) { - default: - if (typeof object.optimizeFor === "number") { - message.optimizeFor = object.optimizeFor; - break; - } - break; - case "SPEED": - case 1: - message.optimizeFor = 1; - break; - case "CODE_SIZE": - case 2: - message.optimizeFor = 2; - break; - case "LITE_RUNTIME": - case 3: - message.optimizeFor = 3; - break; - } - if (object.goPackage != null) - message.goPackage = String(object.goPackage); - if (object.ccGenericServices != null) - message.ccGenericServices = Boolean(object.ccGenericServices); - if (object.javaGenericServices != null) - message.javaGenericServices = Boolean(object.javaGenericServices); - if (object.pyGenericServices != null) - message.pyGenericServices = Boolean(object.pyGenericServices); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.ccEnableArenas != null) - message.ccEnableArenas = Boolean(object.ccEnableArenas); - if (object.objcClassPrefix != null) - message.objcClassPrefix = String(object.objcClassPrefix); - if (object.csharpNamespace != null) - message.csharpNamespace = String(object.csharpNamespace); - if (object.swiftPrefix != null) - message.swiftPrefix = String(object.swiftPrefix); - if (object.phpClassPrefix != null) - message.phpClassPrefix = String(object.phpClassPrefix); - if (object.phpNamespace != null) - message.phpNamespace = String(object.phpNamespace); - if (object.phpMetadataNamespace != null) - message.phpMetadataNamespace = String(object.phpMetadataNamespace); - if (object.rubyPackage != null) - message.rubyPackage = String(object.rubyPackage); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.FileOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".google.api.resourceDefinition"]) { - if (!Array.isArray(object[".google.api.resourceDefinition"])) - throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: array expected"); - message[".google.api.resourceDefinition"] = []; - for (var i = 0; i < object[".google.api.resourceDefinition"].length; ++i) { - if (typeof object[".google.api.resourceDefinition"][i] !== "object") - throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: object expected"); - message[".google.api.resourceDefinition"][i] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resourceDefinition"][i]); - } - } - return message; - }; - - /** - * Creates a plain object from a FileOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FileOptions - * @static - * @param {google.protobuf.FileOptions} message FileOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FileOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.uninterpretedOption = []; - object[".google.api.resourceDefinition"] = []; - } - if (options.defaults) { - object.javaPackage = ""; - object.javaOuterClassname = ""; - object.optimizeFor = options.enums === String ? "SPEED" : 1; - object.javaMultipleFiles = false; - object.goPackage = ""; - object.ccGenericServices = false; - object.javaGenericServices = false; - object.pyGenericServices = false; - object.javaGenerateEqualsAndHash = false; - object.deprecated = false; - object.javaStringCheckUtf8 = false; - object.ccEnableArenas = true; - object.objcClassPrefix = ""; - object.csharpNamespace = ""; - object.swiftPrefix = ""; - object.phpClassPrefix = ""; - object.phpNamespace = ""; - object.phpMetadataNamespace = ""; - object.rubyPackage = ""; - object.features = null; - } - if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) - object.javaPackage = message.javaPackage; - if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) - object.javaOuterClassname = message.javaOuterClassname; - if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) - object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] === undefined ? message.optimizeFor : $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; - if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) - object.javaMultipleFiles = message.javaMultipleFiles; - if (message.goPackage != null && message.hasOwnProperty("goPackage")) - object.goPackage = message.goPackage; - if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) - object.ccGenericServices = message.ccGenericServices; - if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) - object.javaGenericServices = message.javaGenericServices; - if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) - object.pyGenericServices = message.pyGenericServices; - if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) - object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) - object.javaStringCheckUtf8 = message.javaStringCheckUtf8; - if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) - object.ccEnableArenas = message.ccEnableArenas; - if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) - object.objcClassPrefix = message.objcClassPrefix; - if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) - object.csharpNamespace = message.csharpNamespace; - if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) - object.swiftPrefix = message.swiftPrefix; - if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) - object.phpClassPrefix = message.phpClassPrefix; - if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) - object.phpNamespace = message.phpNamespace; - if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) - object.phpMetadataNamespace = message.phpMetadataNamespace; - if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) - object.rubyPackage = message.rubyPackage; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length) { - object[".google.api.resourceDefinition"] = []; - for (var j = 0; j < message[".google.api.resourceDefinition"].length; ++j) - object[".google.api.resourceDefinition"][j] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resourceDefinition"][j], options); - } - return object; - }; - - /** - * Converts this FileOptions to JSON. - * @function toJSON - * @memberof google.protobuf.FileOptions - * @instance - * @returns {Object.} JSON object - */ - FileOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FileOptions - * @function getTypeUrl - * @memberof google.protobuf.FileOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FileOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FileOptions"; - }; - - /** - * OptimizeMode enum. - * @name google.protobuf.FileOptions.OptimizeMode - * @enum {number} - * @property {number} SPEED=1 SPEED value - * @property {number} CODE_SIZE=2 CODE_SIZE value - * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value - */ - FileOptions.OptimizeMode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[1] = "SPEED"] = 1; - values[valuesById[2] = "CODE_SIZE"] = 2; - values[valuesById[3] = "LITE_RUNTIME"] = 3; - return values; - })(); - - return FileOptions; - })(); - - protobuf.MessageOptions = (function() { - - /** - * Properties of a MessageOptions. - * @memberof google.protobuf - * @interface IMessageOptions - * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat - * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor - * @property {boolean|null} [deprecated] MessageOptions deprecated - * @property {boolean|null} [mapEntry] MessageOptions mapEntry - * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] MessageOptions deprecatedLegacyJsonFieldConflicts - * @property {google.protobuf.IFeatureSet|null} [features] MessageOptions features - * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption - * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource - */ - - /** - * Constructs a new MessageOptions. - * @memberof google.protobuf - * @classdesc Represents a MessageOptions. - * @implements IMessageOptions - * @constructor - * @param {google.protobuf.IMessageOptions=} [properties] Properties to set - */ - function MessageOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MessageOptions messageSetWireFormat. - * @member {boolean} messageSetWireFormat - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.messageSetWireFormat = false; - - /** - * MessageOptions noStandardDescriptorAccessor. - * @member {boolean} noStandardDescriptorAccessor - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.noStandardDescriptorAccessor = false; - - /** - * MessageOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.deprecated = false; - - /** - * MessageOptions mapEntry. - * @member {boolean} mapEntry - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.mapEntry = false; - - /** - * MessageOptions deprecatedLegacyJsonFieldConflicts. - * @member {boolean} deprecatedLegacyJsonFieldConflicts - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; - - /** - * MessageOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.features = null; - - /** - * MessageOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * MessageOptions .google.api.resource. - * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".google.api.resource"] = null; - - /** - * Creates a new MessageOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.IMessageOptions=} [properties] Properties to set - * @returns {google.protobuf.MessageOptions} MessageOptions instance - */ - MessageOptions.create = function create(properties) { - return new MessageOptions(properties); - }; - - /** - * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MessageOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); - if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) - writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); - if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) - writer.uint32(/* id 11, wireType 0 =*/88).bool(message.deprecatedLegacyJsonFieldConflicts); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.resource"] != null && Object.hasOwnProperty.call(message, ".google.api.resource")) - $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MessageOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.MessageOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.MessageOptions} MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MessageOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.messageSetWireFormat = reader.bool(); - break; - } - case 2: { - message.noStandardDescriptorAccessor = reader.bool(); - break; - } - case 3: { - message.deprecated = reader.bool(); - break; - } - case 7: { - message.mapEntry = reader.bool(); - break; - } - case 11: { - message.deprecatedLegacyJsonFieldConflicts = reader.bool(); - break; - } - case 12: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 1053: { - message[".google.api.resource"] = $root.google.api.ResourceDescriptor.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MessageOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.MessageOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.MessageOptions} MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MessageOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MessageOptions message. - * @function verify - * @memberof google.protobuf.MessageOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MessageOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) - if (typeof message.messageSetWireFormat !== "boolean") - return "messageSetWireFormat: boolean expected"; - if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) - if (typeof message.noStandardDescriptorAccessor !== "boolean") - return "noStandardDescriptorAccessor: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) - if (typeof message.mapEntry !== "boolean") - return "mapEntry: boolean expected"; - if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) - if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") - return "deprecatedLegacyJsonFieldConflicts: boolean expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) { - var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resource"]); - if (error) - return ".google.api.resource." + error; - } - return null; - }; - - /** - * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.MessageOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.MessageOptions} MessageOptions - */ - MessageOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.MessageOptions) - return object; - var message = new $root.google.protobuf.MessageOptions(); - if (object.messageSetWireFormat != null) - message.messageSetWireFormat = Boolean(object.messageSetWireFormat); - if (object.noStandardDescriptorAccessor != null) - message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.mapEntry != null) - message.mapEntry = Boolean(object.mapEntry); - if (object.deprecatedLegacyJsonFieldConflicts != null) - message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.MessageOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".google.api.resource"] != null) { - if (typeof object[".google.api.resource"] !== "object") - throw TypeError(".google.protobuf.MessageOptions..google.api.resource: object expected"); - message[".google.api.resource"] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resource"]); - } - return message; - }; - - /** - * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.MessageOptions} message MessageOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MessageOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) { - object.messageSetWireFormat = false; - object.noStandardDescriptorAccessor = false; - object.deprecated = false; - object.mapEntry = false; - object.deprecatedLegacyJsonFieldConflicts = false; - object.features = null; - object[".google.api.resource"] = null; - } - if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) - object.messageSetWireFormat = message.messageSetWireFormat; - if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) - object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) - object.mapEntry = message.mapEntry; - if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) - object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) - object[".google.api.resource"] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resource"], options); - return object; - }; - - /** - * Converts this MessageOptions to JSON. - * @function toJSON - * @memberof google.protobuf.MessageOptions - * @instance - * @returns {Object.} JSON object - */ - MessageOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MessageOptions - * @function getTypeUrl - * @memberof google.protobuf.MessageOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MessageOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.MessageOptions"; - }; - - return MessageOptions; - })(); - - protobuf.FieldOptions = (function() { - - /** - * Properties of a FieldOptions. - * @memberof google.protobuf - * @interface IFieldOptions - * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype - * @property {boolean|null} [packed] FieldOptions packed - * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype - * @property {boolean|null} [lazy] FieldOptions lazy - * @property {boolean|null} [unverifiedLazy] FieldOptions unverifiedLazy - * @property {boolean|null} [deprecated] FieldOptions deprecated - * @property {boolean|null} [weak] FieldOptions weak - * @property {boolean|null} [debugRedact] FieldOptions debugRedact - * @property {google.protobuf.FieldOptions.OptionRetention|null} [retention] FieldOptions retention - * @property {Array.|null} [targets] FieldOptions targets - * @property {Array.|null} [editionDefaults] FieldOptions editionDefaults - * @property {google.protobuf.IFeatureSet|null} [features] FieldOptions features - * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption - * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior - * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference - */ - - /** - * Constructs a new FieldOptions. - * @memberof google.protobuf - * @classdesc Represents a FieldOptions. - * @implements IFieldOptions - * @constructor - * @param {google.protobuf.IFieldOptions=} [properties] Properties to set - */ - function FieldOptions(properties) { - this.targets = []; - this.editionDefaults = []; - this.uninterpretedOption = []; - this[".google.api.fieldBehavior"] = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FieldOptions ctype. - * @member {google.protobuf.FieldOptions.CType} ctype - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.ctype = 0; - - /** - * FieldOptions packed. - * @member {boolean} packed - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.packed = false; - - /** - * FieldOptions jstype. - * @member {google.protobuf.FieldOptions.JSType} jstype - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.jstype = 0; - - /** - * FieldOptions lazy. - * @member {boolean} lazy - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.lazy = false; - - /** - * FieldOptions unverifiedLazy. - * @member {boolean} unverifiedLazy - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.unverifiedLazy = false; - - /** - * FieldOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.deprecated = false; - - /** - * FieldOptions weak. - * @member {boolean} weak - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.weak = false; - - /** - * FieldOptions debugRedact. - * @member {boolean} debugRedact - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.debugRedact = false; - - /** - * FieldOptions retention. - * @member {google.protobuf.FieldOptions.OptionRetention} retention - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.retention = 0; - - /** - * FieldOptions targets. - * @member {Array.} targets - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.targets = $util.emptyArray; - - /** - * FieldOptions editionDefaults. - * @member {Array.} editionDefaults - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.editionDefaults = $util.emptyArray; - - /** - * FieldOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.features = null; - - /** - * FieldOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * FieldOptions .google.api.fieldBehavior. - * @member {Array.} .google.api.fieldBehavior - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; - - /** - * FieldOptions .google.api.resourceReference. - * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".google.api.resourceReference"] = null; - - /** - * Creates a new FieldOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.IFieldOptions=} [properties] Properties to set - * @returns {google.protobuf.FieldOptions} FieldOptions instance - */ - FieldOptions.create = function create(properties) { - return new FieldOptions(properties); - }; - - /** - * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); - if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); - if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); - if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) - writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); - if (message.unverifiedLazy != null && Object.hasOwnProperty.call(message, "unverifiedLazy")) - writer.uint32(/* id 15, wireType 0 =*/120).bool(message.unverifiedLazy); - if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) - writer.uint32(/* id 16, wireType 0 =*/128).bool(message.debugRedact); - if (message.retention != null && Object.hasOwnProperty.call(message, "retention")) - writer.uint32(/* id 17, wireType 0 =*/136).int32(message.retention); - if (message.targets != null && message.targets.length) - for (var i = 0; i < message.targets.length; ++i) - writer.uint32(/* id 19, wireType 0 =*/152).int32(message.targets[i]); - if (message.editionDefaults != null && message.editionDefaults.length) - for (var i = 0; i < message.editionDefaults.length; ++i) - $root.google.protobuf.FieldOptions.EditionDefault.encode(message.editionDefaults[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) - for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) - writer.uint32(/* id 1052, wireType 0 =*/8416).int32(message[".google.api.fieldBehavior"][i]); - if (message[".google.api.resourceReference"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceReference")) - $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FieldOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FieldOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldOptions} FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.ctype = reader.int32(); - break; - } - case 2: { - message.packed = reader.bool(); - break; - } - case 6: { - message.jstype = reader.int32(); - break; - } - case 5: { - message.lazy = reader.bool(); - break; - } - case 15: { - message.unverifiedLazy = reader.bool(); - break; - } - case 3: { - message.deprecated = reader.bool(); - break; - } - case 10: { - message.weak = reader.bool(); - break; - } - case 16: { - message.debugRedact = reader.bool(); - break; - } - case 17: { - message.retention = reader.int32(); - break; - } - case 19: { - if (!(message.targets && message.targets.length)) - message.targets = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.targets.push(reader.int32()); - } else - message.targets.push(reader.int32()); - break; - } - case 20: { - if (!(message.editionDefaults && message.editionDefaults.length)) - message.editionDefaults = []; - message.editionDefaults.push($root.google.protobuf.FieldOptions.EditionDefault.decode(reader, reader.uint32())); - break; - } - case 21: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 1052: { - if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) - message[".google.api.fieldBehavior"] = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message[".google.api.fieldBehavior"].push(reader.int32()); - } else - message[".google.api.fieldBehavior"].push(reader.int32()); - break; - } - case 1055: { - message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FieldOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FieldOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldOptions} FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FieldOptions message. - * @function verify - * @memberof google.protobuf.FieldOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FieldOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.ctype != null && message.hasOwnProperty("ctype")) - switch (message.ctype) { - default: - return "ctype: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.packed != null && message.hasOwnProperty("packed")) - if (typeof message.packed !== "boolean") - return "packed: boolean expected"; - if (message.jstype != null && message.hasOwnProperty("jstype")) - switch (message.jstype) { - default: - return "jstype: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.lazy != null && message.hasOwnProperty("lazy")) - if (typeof message.lazy !== "boolean") - return "lazy: boolean expected"; - if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) - if (typeof message.unverifiedLazy !== "boolean") - return "unverifiedLazy: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.weak != null && message.hasOwnProperty("weak")) - if (typeof message.weak !== "boolean") - return "weak: boolean expected"; - if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) - if (typeof message.debugRedact !== "boolean") - return "debugRedact: boolean expected"; - if (message.retention != null && message.hasOwnProperty("retention")) - switch (message.retention) { - default: - return "retention: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.targets != null && message.hasOwnProperty("targets")) { - if (!Array.isArray(message.targets)) - return "targets: array expected"; - for (var i = 0; i < message.targets.length; ++i) - switch (message.targets[i]) { - default: - return "targets: enum value[] expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - break; - } - } - if (message.editionDefaults != null && message.hasOwnProperty("editionDefaults")) { - if (!Array.isArray(message.editionDefaults)) - return "editionDefaults: array expected"; - for (var i = 0; i < message.editionDefaults.length; ++i) { - var error = $root.google.protobuf.FieldOptions.EditionDefault.verify(message.editionDefaults[i]); - if (error) - return "editionDefaults." + error; - } - } - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".google.api.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) { - if (!Array.isArray(message[".google.api.fieldBehavior"])) - return ".google.api.fieldBehavior: array expected"; - for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) - switch (message[".google.api.fieldBehavior"][i]) { - default: - return ".google.api.fieldBehavior: enum value[] expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - break; - } - } - if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) { - var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"]); - if (error) - return ".google.api.resourceReference." + error; - } - return null; - }; - - /** - * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FieldOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FieldOptions} FieldOptions - */ - FieldOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldOptions) - return object; - var message = new $root.google.protobuf.FieldOptions(); - switch (object.ctype) { - default: - if (typeof object.ctype === "number") { - message.ctype = object.ctype; - break; - } - break; - case "STRING": - case 0: - message.ctype = 0; - break; - case "CORD": - case 1: - message.ctype = 1; - break; - case "STRING_PIECE": - case 2: - message.ctype = 2; - break; - } - if (object.packed != null) - message.packed = Boolean(object.packed); - switch (object.jstype) { - default: - if (typeof object.jstype === "number") { - message.jstype = object.jstype; - break; - } - break; - case "JS_NORMAL": - case 0: - message.jstype = 0; - break; - case "JS_STRING": - case 1: - message.jstype = 1; - break; - case "JS_NUMBER": - case 2: - message.jstype = 2; - break; - } - if (object.lazy != null) - message.lazy = Boolean(object.lazy); - if (object.unverifiedLazy != null) - message.unverifiedLazy = Boolean(object.unverifiedLazy); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.weak != null) - message.weak = Boolean(object.weak); - if (object.debugRedact != null) - message.debugRedact = Boolean(object.debugRedact); - switch (object.retention) { - default: - if (typeof object.retention === "number") { - message.retention = object.retention; - break; - } - break; - case "RETENTION_UNKNOWN": - case 0: - message.retention = 0; - break; - case "RETENTION_RUNTIME": - case 1: - message.retention = 1; - break; - case "RETENTION_SOURCE": - case 2: - message.retention = 2; - break; - } - if (object.targets) { - if (!Array.isArray(object.targets)) - throw TypeError(".google.protobuf.FieldOptions.targets: array expected"); - message.targets = []; - for (var i = 0; i < object.targets.length; ++i) - switch (object.targets[i]) { - default: - if (typeof object.targets[i] === "number") { - message.targets[i] = object.targets[i]; - break; - } - case "TARGET_TYPE_UNKNOWN": - case 0: - message.targets[i] = 0; - break; - case "TARGET_TYPE_FILE": - case 1: - message.targets[i] = 1; - break; - case "TARGET_TYPE_EXTENSION_RANGE": - case 2: - message.targets[i] = 2; - break; - case "TARGET_TYPE_MESSAGE": - case 3: - message.targets[i] = 3; - break; - case "TARGET_TYPE_FIELD": - case 4: - message.targets[i] = 4; - break; - case "TARGET_TYPE_ONEOF": - case 5: - message.targets[i] = 5; - break; - case "TARGET_TYPE_ENUM": - case 6: - message.targets[i] = 6; - break; - case "TARGET_TYPE_ENUM_ENTRY": - case 7: - message.targets[i] = 7; - break; - case "TARGET_TYPE_SERVICE": - case 8: - message.targets[i] = 8; - break; - case "TARGET_TYPE_METHOD": - case 9: - message.targets[i] = 9; - break; - } - } - if (object.editionDefaults) { - if (!Array.isArray(object.editionDefaults)) - throw TypeError(".google.protobuf.FieldOptions.editionDefaults: array expected"); - message.editionDefaults = []; - for (var i = 0; i < object.editionDefaults.length; ++i) { - if (typeof object.editionDefaults[i] !== "object") - throw TypeError(".google.protobuf.FieldOptions.editionDefaults: object expected"); - message.editionDefaults[i] = $root.google.protobuf.FieldOptions.EditionDefault.fromObject(object.editionDefaults[i]); - } - } - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.FieldOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".google.api.fieldBehavior"]) { - if (!Array.isArray(object[".google.api.fieldBehavior"])) - throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected"); - message[".google.api.fieldBehavior"] = []; - for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i) - switch (object[".google.api.fieldBehavior"][i]) { - default: - if (typeof object[".google.api.fieldBehavior"][i] === "number") { - message[".google.api.fieldBehavior"][i] = object[".google.api.fieldBehavior"][i]; - break; - } - case "FIELD_BEHAVIOR_UNSPECIFIED": - case 0: - message[".google.api.fieldBehavior"][i] = 0; - break; - case "OPTIONAL": - case 1: - message[".google.api.fieldBehavior"][i] = 1; - break; - case "REQUIRED": - case 2: - message[".google.api.fieldBehavior"][i] = 2; - break; - case "OUTPUT_ONLY": - case 3: - message[".google.api.fieldBehavior"][i] = 3; - break; - case "INPUT_ONLY": - case 4: - message[".google.api.fieldBehavior"][i] = 4; - break; - case "IMMUTABLE": - case 5: - message[".google.api.fieldBehavior"][i] = 5; - break; - case "UNORDERED_LIST": - case 6: - message[".google.api.fieldBehavior"][i] = 6; - break; - case "NON_EMPTY_DEFAULT": - case 7: - message[".google.api.fieldBehavior"][i] = 7; - break; - case "IDENTIFIER": - case 8: - message[".google.api.fieldBehavior"][i] = 8; - break; - } - } - if (object[".google.api.resourceReference"] != null) { - if (typeof object[".google.api.resourceReference"] !== "object") - throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected"); - message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"]); - } - return message; - }; - - /** - * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.FieldOptions} message FieldOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FieldOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.targets = []; - object.editionDefaults = []; - object.uninterpretedOption = []; - object[".google.api.fieldBehavior"] = []; - } - if (options.defaults) { - object.ctype = options.enums === String ? "STRING" : 0; - object.packed = false; - object.deprecated = false; - object.lazy = false; - object.jstype = options.enums === String ? "JS_NORMAL" : 0; - object.weak = false; - object.unverifiedLazy = false; - object.debugRedact = false; - object.retention = options.enums === String ? "RETENTION_UNKNOWN" : 0; - object.features = null; - object[".google.api.resourceReference"] = null; - } - if (message.ctype != null && message.hasOwnProperty("ctype")) - object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] === undefined ? message.ctype : $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; - if (message.packed != null && message.hasOwnProperty("packed")) - object.packed = message.packed; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.lazy != null && message.hasOwnProperty("lazy")) - object.lazy = message.lazy; - if (message.jstype != null && message.hasOwnProperty("jstype")) - object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] === undefined ? message.jstype : $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; - if (message.weak != null && message.hasOwnProperty("weak")) - object.weak = message.weak; - if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) - object.unverifiedLazy = message.unverifiedLazy; - if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) - object.debugRedact = message.debugRedact; - if (message.retention != null && message.hasOwnProperty("retention")) - object.retention = options.enums === String ? $root.google.protobuf.FieldOptions.OptionRetention[message.retention] === undefined ? message.retention : $root.google.protobuf.FieldOptions.OptionRetention[message.retention] : message.retention; - if (message.targets && message.targets.length) { - object.targets = []; - for (var j = 0; j < message.targets.length; ++j) - object.targets[j] = options.enums === String ? $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] === undefined ? message.targets[j] : $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] : message.targets[j]; - } - if (message.editionDefaults && message.editionDefaults.length) { - object.editionDefaults = []; - for (var j = 0; j < message.editionDefaults.length; ++j) - object.editionDefaults[j] = $root.google.protobuf.FieldOptions.EditionDefault.toObject(message.editionDefaults[j], options); - } - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length) { - object[".google.api.fieldBehavior"] = []; - for (var j = 0; j < message[".google.api.fieldBehavior"].length; ++j) - object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] === undefined ? message[".google.api.fieldBehavior"][j] : $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; - } - if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) - object[".google.api.resourceReference"] = $root.google.api.ResourceReference.toObject(message[".google.api.resourceReference"], options); - return object; - }; - - /** - * Converts this FieldOptions to JSON. - * @function toJSON - * @memberof google.protobuf.FieldOptions - * @instance - * @returns {Object.} JSON object - */ - FieldOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FieldOptions - * @function getTypeUrl - * @memberof google.protobuf.FieldOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FieldOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FieldOptions"; - }; - - /** - * CType enum. - * @name google.protobuf.FieldOptions.CType - * @enum {number} - * @property {number} STRING=0 STRING value - * @property {number} CORD=1 CORD value - * @property {number} STRING_PIECE=2 STRING_PIECE value - */ - FieldOptions.CType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STRING"] = 0; - values[valuesById[1] = "CORD"] = 1; - values[valuesById[2] = "STRING_PIECE"] = 2; - return values; - })(); - - /** - * JSType enum. - * @name google.protobuf.FieldOptions.JSType - * @enum {number} - * @property {number} JS_NORMAL=0 JS_NORMAL value - * @property {number} JS_STRING=1 JS_STRING value - * @property {number} JS_NUMBER=2 JS_NUMBER value - */ - FieldOptions.JSType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "JS_NORMAL"] = 0; - values[valuesById[1] = "JS_STRING"] = 1; - values[valuesById[2] = "JS_NUMBER"] = 2; - return values; - })(); - - /** - * OptionRetention enum. - * @name google.protobuf.FieldOptions.OptionRetention - * @enum {number} - * @property {number} RETENTION_UNKNOWN=0 RETENTION_UNKNOWN value - * @property {number} RETENTION_RUNTIME=1 RETENTION_RUNTIME value - * @property {number} RETENTION_SOURCE=2 RETENTION_SOURCE value - */ - FieldOptions.OptionRetention = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "RETENTION_UNKNOWN"] = 0; - values[valuesById[1] = "RETENTION_RUNTIME"] = 1; - values[valuesById[2] = "RETENTION_SOURCE"] = 2; - return values; - })(); - - /** - * OptionTargetType enum. - * @name google.protobuf.FieldOptions.OptionTargetType - * @enum {number} - * @property {number} TARGET_TYPE_UNKNOWN=0 TARGET_TYPE_UNKNOWN value - * @property {number} TARGET_TYPE_FILE=1 TARGET_TYPE_FILE value - * @property {number} TARGET_TYPE_EXTENSION_RANGE=2 TARGET_TYPE_EXTENSION_RANGE value - * @property {number} TARGET_TYPE_MESSAGE=3 TARGET_TYPE_MESSAGE value - * @property {number} TARGET_TYPE_FIELD=4 TARGET_TYPE_FIELD value - * @property {number} TARGET_TYPE_ONEOF=5 TARGET_TYPE_ONEOF value - * @property {number} TARGET_TYPE_ENUM=6 TARGET_TYPE_ENUM value - * @property {number} TARGET_TYPE_ENUM_ENTRY=7 TARGET_TYPE_ENUM_ENTRY value - * @property {number} TARGET_TYPE_SERVICE=8 TARGET_TYPE_SERVICE value - * @property {number} TARGET_TYPE_METHOD=9 TARGET_TYPE_METHOD value - */ - FieldOptions.OptionTargetType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TARGET_TYPE_UNKNOWN"] = 0; - values[valuesById[1] = "TARGET_TYPE_FILE"] = 1; - values[valuesById[2] = "TARGET_TYPE_EXTENSION_RANGE"] = 2; - values[valuesById[3] = "TARGET_TYPE_MESSAGE"] = 3; - values[valuesById[4] = "TARGET_TYPE_FIELD"] = 4; - values[valuesById[5] = "TARGET_TYPE_ONEOF"] = 5; - values[valuesById[6] = "TARGET_TYPE_ENUM"] = 6; - values[valuesById[7] = "TARGET_TYPE_ENUM_ENTRY"] = 7; - values[valuesById[8] = "TARGET_TYPE_SERVICE"] = 8; - values[valuesById[9] = "TARGET_TYPE_METHOD"] = 9; - return values; - })(); - - FieldOptions.EditionDefault = (function() { - - /** - * Properties of an EditionDefault. - * @memberof google.protobuf.FieldOptions - * @interface IEditionDefault - * @property {google.protobuf.Edition|null} [edition] EditionDefault edition - * @property {string|null} [value] EditionDefault value - */ - - /** - * Constructs a new EditionDefault. - * @memberof google.protobuf.FieldOptions - * @classdesc Represents an EditionDefault. - * @implements IEditionDefault - * @constructor - * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set - */ - function EditionDefault(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EditionDefault edition. - * @member {google.protobuf.Edition} edition - * @memberof google.protobuf.FieldOptions.EditionDefault - * @instance - */ - EditionDefault.prototype.edition = 0; - - /** - * EditionDefault value. - * @member {string} value - * @memberof google.protobuf.FieldOptions.EditionDefault - * @instance - */ - EditionDefault.prototype.value = ""; - - /** - * Creates a new EditionDefault instance using the specified properties. - * @function create - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set - * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault instance - */ - EditionDefault.create = function create(properties) { - return new EditionDefault(properties); - }; - - /** - * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EditionDefault.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); - if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); - return writer; - }; - - /** - * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EditionDefault.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EditionDefault message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EditionDefault.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions.EditionDefault(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 3: { - message.edition = reader.int32(); - break; - } - case 2: { - message.value = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EditionDefault message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EditionDefault.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EditionDefault message. - * @function verify - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EditionDefault.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.edition != null && message.hasOwnProperty("edition")) - switch (message.edition) { - default: - return "edition: enum value expected"; - case 0: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isString(message.value)) - return "value: string expected"; - return null; - }; - - /** - * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault - */ - EditionDefault.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldOptions.EditionDefault) - return object; - var message = new $root.google.protobuf.FieldOptions.EditionDefault(); - switch (object.edition) { - default: - if (typeof object.edition === "number") { - message.edition = object.edition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.edition = 0; - break; - case "EDITION_PROTO2": - case 998: - message.edition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.edition = 999; - break; - case "EDITION_2023": - case 1000: - message.edition = 1000; - break; - case "EDITION_2024": - case 1001: - message.edition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.edition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.edition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.edition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.edition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.edition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.edition = 2147483647; - break; - } - if (object.value != null) - message.value = String(object.value); - return message; - }; - - /** - * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {google.protobuf.FieldOptions.EditionDefault} message EditionDefault - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EditionDefault.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.value = ""; - object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; - } - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - if (message.edition != null && message.hasOwnProperty("edition")) - object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; - return object; - }; - - /** - * Converts this EditionDefault to JSON. - * @function toJSON - * @memberof google.protobuf.FieldOptions.EditionDefault - * @instance - * @returns {Object.} JSON object - */ - EditionDefault.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EditionDefault - * @function getTypeUrl - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FieldOptions.EditionDefault"; - }; - - return EditionDefault; - })(); - - return FieldOptions; - })(); - - protobuf.OneofOptions = (function() { - - /** - * Properties of an OneofOptions. - * @memberof google.protobuf - * @interface IOneofOptions - * @property {google.protobuf.IFeatureSet|null} [features] OneofOptions features - * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption - */ - - /** - * Constructs a new OneofOptions. - * @memberof google.protobuf - * @classdesc Represents an OneofOptions. - * @implements IOneofOptions - * @constructor - * @param {google.protobuf.IOneofOptions=} [properties] Properties to set - */ - function OneofOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * OneofOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.OneofOptions - * @instance - */ - OneofOptions.prototype.features = null; - - /** - * OneofOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.OneofOptions - * @instance - */ - OneofOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * Creates a new OneofOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.IOneofOptions=} [properties] Properties to set - * @returns {google.protobuf.OneofOptions} OneofOptions instance - */ - OneofOptions.create = function create(properties) { - return new OneofOptions(properties); - }; - - /** - * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OneofOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.OneofOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.OneofOptions} OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OneofOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.OneofOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.OneofOptions} OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OneofOptions message. - * @function verify - * @memberof google.protobuf.OneofOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OneofOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - return null; - }; - - /** - * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.OneofOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.OneofOptions} OneofOptions - */ - OneofOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.OneofOptions) - return object; - var message = new $root.google.protobuf.OneofOptions(); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.OneofOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.OneofOptions} message OneofOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OneofOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) - object.features = null; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; - - /** - * Converts this OneofOptions to JSON. - * @function toJSON - * @memberof google.protobuf.OneofOptions - * @instance - * @returns {Object.} JSON object - */ - OneofOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OneofOptions - * @function getTypeUrl - * @memberof google.protobuf.OneofOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OneofOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.OneofOptions"; - }; - - return OneofOptions; - })(); - - protobuf.EnumOptions = (function() { - - /** - * Properties of an EnumOptions. - * @memberof google.protobuf - * @interface IEnumOptions - * @property {boolean|null} [allowAlias] EnumOptions allowAlias - * @property {boolean|null} [deprecated] EnumOptions deprecated - * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] EnumOptions deprecatedLegacyJsonFieldConflicts - * @property {google.protobuf.IFeatureSet|null} [features] EnumOptions features - * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption - */ - - /** - * Constructs a new EnumOptions. - * @memberof google.protobuf - * @classdesc Represents an EnumOptions. - * @implements IEnumOptions - * @constructor - * @param {google.protobuf.IEnumOptions=} [properties] Properties to set - */ - function EnumOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumOptions allowAlias. - * @member {boolean} allowAlias - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.allowAlias = false; - - /** - * EnumOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.deprecated = false; - - /** - * EnumOptions deprecatedLegacyJsonFieldConflicts. - * @member {boolean} deprecatedLegacyJsonFieldConflicts - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; - - /** - * EnumOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.features = null; - - /** - * EnumOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * Creates a new EnumOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.IEnumOptions=} [properties] Properties to set - * @returns {google.protobuf.EnumOptions} EnumOptions instance - */ - EnumOptions.create = function create(properties) { - return new EnumOptions(properties); - }; - - /** - * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.deprecatedLegacyJsonFieldConflicts); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumOptions} EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - message.allowAlias = reader.bool(); - break; - } - case 3: { - message.deprecated = reader.bool(); - break; - } - case 6: { - message.deprecatedLegacyJsonFieldConflicts = reader.bool(); - break; - } - case 7: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumOptions} EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumOptions message. - * @function verify - * @memberof google.protobuf.EnumOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) - if (typeof message.allowAlias !== "boolean") - return "allowAlias: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) - if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") - return "deprecatedLegacyJsonFieldConflicts: boolean expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - return null; - }; - - /** - * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumOptions} EnumOptions - */ - EnumOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumOptions) - return object; - var message = new $root.google.protobuf.EnumOptions(); - if (object.allowAlias != null) - message.allowAlias = Boolean(object.allowAlias); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.deprecatedLegacyJsonFieldConflicts != null) - message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.EnumOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.EnumOptions} message EnumOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) { - object.allowAlias = false; - object.deprecated = false; - object.deprecatedLegacyJsonFieldConflicts = false; - object.features = null; - } - if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) - object.allowAlias = message.allowAlias; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) - object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; - - /** - * Converts this EnumOptions to JSON. - * @function toJSON - * @memberof google.protobuf.EnumOptions - * @instance - * @returns {Object.} JSON object - */ - EnumOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumOptions - * @function getTypeUrl - * @memberof google.protobuf.EnumOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumOptions"; - }; - - return EnumOptions; - })(); - - protobuf.EnumValueOptions = (function() { - - /** - * Properties of an EnumValueOptions. - * @memberof google.protobuf - * @interface IEnumValueOptions - * @property {boolean|null} [deprecated] EnumValueOptions deprecated - * @property {google.protobuf.IFeatureSet|null} [features] EnumValueOptions features - * @property {boolean|null} [debugRedact] EnumValueOptions debugRedact - * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption - */ - - /** - * Constructs a new EnumValueOptions. - * @memberof google.protobuf - * @classdesc Represents an EnumValueOptions. - * @implements IEnumValueOptions - * @constructor - * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set - */ - function EnumValueOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumValueOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.deprecated = false; - - /** - * EnumValueOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.features = null; - - /** - * EnumValueOptions debugRedact. - * @member {boolean} debugRedact - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.debugRedact = false; - - /** - * EnumValueOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * Creates a new EnumValueOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance - */ - EnumValueOptions.create = function create(properties) { - return new EnumValueOptions(properties); - }; - - /** - * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.debugRedact); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumValueOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.deprecated = reader.bool(); - break; - } - case 2: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 3: { - message.debugRedact = reader.bool(); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumValueOptions message. - * @function verify - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumValueOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) - if (typeof message.debugRedact !== "boolean") - return "debugRedact: boolean expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - return null; - }; - - /** - * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions - */ - EnumValueOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumValueOptions) - return object; - var message = new $root.google.protobuf.EnumValueOptions(); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.EnumValueOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.debugRedact != null) - message.debugRedact = Boolean(object.debugRedact); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.EnumValueOptions} message EnumValueOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumValueOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) { - object.deprecated = false; - object.features = null; - object.debugRedact = false; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) - object.debugRedact = message.debugRedact; - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; - - /** - * Converts this EnumValueOptions to JSON. - * @function toJSON - * @memberof google.protobuf.EnumValueOptions - * @instance - * @returns {Object.} JSON object - */ - EnumValueOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumValueOptions - * @function getTypeUrl - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumValueOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumValueOptions"; - }; - - return EnumValueOptions; - })(); - - protobuf.ServiceOptions = (function() { - - /** - * Properties of a ServiceOptions. - * @memberof google.protobuf - * @interface IServiceOptions - * @property {google.protobuf.IFeatureSet|null} [features] ServiceOptions features - * @property {boolean|null} [deprecated] ServiceOptions deprecated - * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption - * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost - * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes - * @property {string|null} [".google.api.apiVersion"] ServiceOptions .google.api.apiVersion - */ - - /** - * Constructs a new ServiceOptions. - * @memberof google.protobuf - * @classdesc Represents a ServiceOptions. - * @implements IServiceOptions - * @constructor - * @param {google.protobuf.IServiceOptions=} [properties] Properties to set - */ - function ServiceOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ServiceOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype.features = null; - - /** - * ServiceOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype.deprecated = false; - - /** - * ServiceOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * ServiceOptions .google.api.defaultHost. - * @member {string} .google.api.defaultHost - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype[".google.api.defaultHost"] = ""; - - /** - * ServiceOptions .google.api.oauthScopes. - * @member {string} .google.api.oauthScopes - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype[".google.api.oauthScopes"] = ""; - - /** - * ServiceOptions .google.api.apiVersion. - * @member {string} .google.api.apiVersion - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype[".google.api.apiVersion"] = ""; - - /** - * Creates a new ServiceOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.IServiceOptions=} [properties] Properties to set - * @returns {google.protobuf.ServiceOptions} ServiceOptions instance - */ - ServiceOptions.create = function create(properties) { - return new ServiceOptions(properties); - }; - - /** - * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 34, wireType 2 =*/274).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) - writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); - if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) - writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); - if (message[".google.api.apiVersion"] != null && Object.hasOwnProperty.call(message, ".google.api.apiVersion")) - writer.uint32(/* id 525000001, wireType 2 =*/4200000010).string(message[".google.api.apiVersion"]); - return writer; - }; - - /** - * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ServiceOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ServiceOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ServiceOptions} ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 34: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 33: { - message.deprecated = reader.bool(); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 1049: { - message[".google.api.defaultHost"] = reader.string(); - break; - } - case 1050: { - message[".google.api.oauthScopes"] = reader.string(); - break; - } - case 525000001: { - message[".google.api.apiVersion"] = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ServiceOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ServiceOptions} ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ServiceOptions message. - * @function verify - * @memberof google.protobuf.ServiceOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ServiceOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) - if (!$util.isString(message[".google.api.defaultHost"])) - return ".google.api.defaultHost: string expected"; - if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) - if (!$util.isString(message[".google.api.oauthScopes"])) - return ".google.api.oauthScopes: string expected"; - if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) - if (!$util.isString(message[".google.api.apiVersion"])) - return ".google.api.apiVersion: string expected"; - return null; - }; - - /** - * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ServiceOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ServiceOptions} ServiceOptions - */ - ServiceOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ServiceOptions) - return object; - var message = new $root.google.protobuf.ServiceOptions(); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.ServiceOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".google.api.defaultHost"] != null) - message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); - if (object[".google.api.oauthScopes"] != null) - message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); - if (object[".google.api.apiVersion"] != null) - message[".google.api.apiVersion"] = String(object[".google.api.apiVersion"]); - return message; - }; - - /** - * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.ServiceOptions} message ServiceOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ServiceOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) { - object.deprecated = false; - object.features = null; - object[".google.api.defaultHost"] = ""; - object[".google.api.oauthScopes"] = ""; - object[".google.api.apiVersion"] = ""; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) - object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; - if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) - object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; - if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) - object[".google.api.apiVersion"] = message[".google.api.apiVersion"]; - return object; - }; - - /** - * Converts this ServiceOptions to JSON. - * @function toJSON - * @memberof google.protobuf.ServiceOptions - * @instance - * @returns {Object.} JSON object - */ - ServiceOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ServiceOptions - * @function getTypeUrl - * @memberof google.protobuf.ServiceOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.ServiceOptions"; - }; - - return ServiceOptions; - })(); - - protobuf.MethodOptions = (function() { - - /** - * Properties of a MethodOptions. - * @memberof google.protobuf - * @interface IMethodOptions - * @property {boolean|null} [deprecated] MethodOptions deprecated - * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel - * @property {google.protobuf.IFeatureSet|null} [features] MethodOptions features - * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption - * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http - * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature - */ - - /** - * Constructs a new MethodOptions. - * @memberof google.protobuf - * @classdesc Represents a MethodOptions. - * @implements IMethodOptions - * @constructor - * @param {google.protobuf.IMethodOptions=} [properties] Properties to set - */ - function MethodOptions(properties) { - this.uninterpretedOption = []; - this[".google.api.methodSignature"] = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MethodOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype.deprecated = false; - - /** - * MethodOptions idempotencyLevel. - * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype.idempotencyLevel = 0; - - /** - * MethodOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype.features = null; - - /** - * MethodOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * MethodOptions .google.api.http. - * @member {google.api.IHttpRule|null|undefined} .google.api.http - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype[".google.api.http"] = null; - - /** - * MethodOptions .google.api.methodSignature. - * @member {Array.} .google.api.methodSignature - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; - - /** - * Creates a new MethodOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.MethodOptions - * @static - * @param {google.protobuf.IMethodOptions=} [properties] Properties to set - * @returns {google.protobuf.MethodOptions} MethodOptions instance - */ - MethodOptions.create = function create(properties) { - return new MethodOptions(properties); - }; - - /** - * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.MethodOptions - * @static - * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); - if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel")) - writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 35, wireType 2 =*/282).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.methodSignature"] != null && message[".google.api.methodSignature"].length) - for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) - writer.uint32(/* id 1051, wireType 2 =*/8410).string(message[".google.api.methodSignature"][i]); - if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http")) - $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.MethodOptions - * @static - * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MethodOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.MethodOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.MethodOptions} MethodOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 33: { - message.deprecated = reader.bool(); - break; - } - case 34: { - message.idempotencyLevel = reader.int32(); - break; - } - case 35: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 72295728: { - message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); - break; - } - case 1051: { - if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) - message[".google.api.methodSignature"] = []; - message[".google.api.methodSignature"].push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MethodOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.MethodOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.MethodOptions} MethodOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MethodOptions message. - * @function verify - * @memberof google.protobuf.MethodOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MethodOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) - switch (message.idempotencyLevel) { - default: - return "idempotencyLevel: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) { - var error = $root.google.api.HttpRule.verify(message[".google.api.http"]); - if (error) - return ".google.api.http." + error; - } - if (message[".google.api.methodSignature"] != null && message.hasOwnProperty(".google.api.methodSignature")) { - if (!Array.isArray(message[".google.api.methodSignature"])) - return ".google.api.methodSignature: array expected"; - for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) - if (!$util.isString(message[".google.api.methodSignature"][i])) - return ".google.api.methodSignature: string[] expected"; - } - return null; - }; - - /** - * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.MethodOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.MethodOptions} MethodOptions - */ - MethodOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.MethodOptions) - return object; - var message = new $root.google.protobuf.MethodOptions(); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - switch (object.idempotencyLevel) { - default: - if (typeof object.idempotencyLevel === "number") { - message.idempotencyLevel = object.idempotencyLevel; - break; - } - break; - case "IDEMPOTENCY_UNKNOWN": - case 0: - message.idempotencyLevel = 0; - break; - case "NO_SIDE_EFFECTS": - case 1: - message.idempotencyLevel = 1; - break; - case "IDEMPOTENT": - case 2: - message.idempotencyLevel = 2; - break; - } - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.MethodOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".google.api.http"] != null) { - if (typeof object[".google.api.http"] !== "object") - throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected"); - message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"]); - } - if (object[".google.api.methodSignature"]) { - if (!Array.isArray(object[".google.api.methodSignature"])) - throw TypeError(".google.protobuf.MethodOptions..google.api.methodSignature: array expected"); - message[".google.api.methodSignature"] = []; - for (var i = 0; i < object[".google.api.methodSignature"].length; ++i) - message[".google.api.methodSignature"][i] = String(object[".google.api.methodSignature"][i]); - } - return message; - }; - - /** - * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.MethodOptions - * @static - * @param {google.protobuf.MethodOptions} message MethodOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MethodOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.uninterpretedOption = []; - object[".google.api.methodSignature"] = []; - } - if (options.defaults) { - object.deprecated = false; - object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0; - object.features = null; - object[".google.api.http"] = null; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) - object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] === undefined ? message.idempotencyLevel : $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length) { - object[".google.api.methodSignature"] = []; - for (var j = 0; j < message[".google.api.methodSignature"].length; ++j) - object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j]; - } - if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) - object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); - return object; - }; - - /** - * Converts this MethodOptions to JSON. - * @function toJSON - * @memberof google.protobuf.MethodOptions - * @instance - * @returns {Object.} JSON object - */ - MethodOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MethodOptions - * @function getTypeUrl - * @memberof google.protobuf.MethodOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MethodOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.MethodOptions"; - }; - - /** - * IdempotencyLevel enum. - * @name google.protobuf.MethodOptions.IdempotencyLevel - * @enum {number} - * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value - * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value - * @property {number} IDEMPOTENT=2 IDEMPOTENT value - */ - MethodOptions.IdempotencyLevel = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0; - values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1; - values[valuesById[2] = "IDEMPOTENT"] = 2; - return values; - })(); - - return MethodOptions; - })(); - - protobuf.UninterpretedOption = (function() { - - /** - * Properties of an UninterpretedOption. - * @memberof google.protobuf - * @interface IUninterpretedOption - * @property {Array.|null} [name] UninterpretedOption name - * @property {string|null} [identifierValue] UninterpretedOption identifierValue - * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue - * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue - * @property {number|null} [doubleValue] UninterpretedOption doubleValue - * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue - * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue - */ - - /** - * Constructs a new UninterpretedOption. - * @memberof google.protobuf - * @classdesc Represents an UninterpretedOption. - * @implements IUninterpretedOption - * @constructor - * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set - */ - function UninterpretedOption(properties) { - this.name = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UninterpretedOption name. - * @member {Array.} name - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.name = $util.emptyArray; - - /** - * UninterpretedOption identifierValue. - * @member {string} identifierValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.identifierValue = ""; - - /** - * UninterpretedOption positiveIntValue. - * @member {number|Long} positiveIntValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * UninterpretedOption negativeIntValue. - * @member {number|Long} negativeIntValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * UninterpretedOption doubleValue. - * @member {number} doubleValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.doubleValue = 0; - - /** - * UninterpretedOption stringValue. - * @member {Uint8Array} stringValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.stringValue = $util.newBuffer([]); - - /** - * UninterpretedOption aggregateValue. - * @member {string} aggregateValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.aggregateValue = ""; - - /** - * Creates a new UninterpretedOption instance using the specified properties. - * @function create - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance - */ - UninterpretedOption.create = function create(properties) { - return new UninterpretedOption(properties); - }; - - /** - * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @function encode - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UninterpretedOption.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && message.name.length) - for (var i = 0; i < message.name.length; ++i) - $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); - if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) - writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); - if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) - writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); - if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) - writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); - if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) - writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); - if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); - return writer; - }; - - /** - * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UninterpretedOption.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - if (!(message.name && message.name.length)) - message.name = []; - message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); - break; - } - case 3: { - message.identifierValue = reader.string(); - break; - } - case 4: { - message.positiveIntValue = reader.uint64(); - break; - } - case 5: { - message.negativeIntValue = reader.int64(); - break; - } - case 6: { - message.doubleValue = reader.double(); - break; - } - case 7: { - message.stringValue = reader.bytes(); - break; - } - case 8: { - message.aggregateValue = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UninterpretedOption message. - * @function verify - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UninterpretedOption.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) { - if (!Array.isArray(message.name)) - return "name: array expected"; - for (var i = 0; i < message.name.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]); - if (error) - return "name." + error; - } - } - if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) - if (!$util.isString(message.identifierValue)) - return "identifierValue: string expected"; - if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) - if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high))) - return "positiveIntValue: integer|Long expected"; - if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) - if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high))) - return "negativeIntValue: integer|Long expected"; - if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) - if (typeof message.doubleValue !== "number") - return "doubleValue: number expected"; - if (message.stringValue != null && message.hasOwnProperty("stringValue")) - if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue))) - return "stringValue: buffer expected"; - if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) - if (!$util.isString(message.aggregateValue)) - return "aggregateValue: string expected"; - return null; - }; - - /** - * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption - */ - UninterpretedOption.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.UninterpretedOption) - return object; - var message = new $root.google.protobuf.UninterpretedOption(); - if (object.name) { - if (!Array.isArray(object.name)) - throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); - message.name = []; - for (var i = 0; i < object.name.length; ++i) { - if (typeof object.name[i] !== "object") - throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); - message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); - } - } - if (object.identifierValue != null) - message.identifierValue = String(object.identifierValue); - if (object.positiveIntValue != null) - if ($util.Long) - (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; - else if (typeof object.positiveIntValue === "string") - message.positiveIntValue = parseInt(object.positiveIntValue, 10); - else if (typeof object.positiveIntValue === "number") - message.positiveIntValue = object.positiveIntValue; - else if (typeof object.positiveIntValue === "object") - message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); - if (object.negativeIntValue != null) - if ($util.Long) - (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false; - else if (typeof object.negativeIntValue === "string") - message.negativeIntValue = parseInt(object.negativeIntValue, 10); - else if (typeof object.negativeIntValue === "number") - message.negativeIntValue = object.negativeIntValue; - else if (typeof object.negativeIntValue === "object") - message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); - if (object.doubleValue != null) - message.doubleValue = Number(object.doubleValue); - if (object.stringValue != null) - if (typeof object.stringValue === "string") - $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); - else if (object.stringValue.length >= 0) - message.stringValue = object.stringValue; - if (object.aggregateValue != null) - message.aggregateValue = String(object.aggregateValue); - return message; - }; - - /** - * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.UninterpretedOption} message UninterpretedOption - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UninterpretedOption.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.name = []; - if (options.defaults) { - object.identifierValue = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.positiveIntValue = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.negativeIntValue = options.longs === String ? "0" : 0; - object.doubleValue = 0; - if (options.bytes === String) - object.stringValue = ""; - else { - object.stringValue = []; - if (options.bytes !== Array) - object.stringValue = $util.newBuffer(object.stringValue); - } - object.aggregateValue = ""; - } - if (message.name && message.name.length) { - object.name = []; - for (var j = 0; j < message.name.length; ++j) - object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); - } - if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) - object.identifierValue = message.identifierValue; - if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) - if (typeof message.positiveIntValue === "number") - object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue; - else - object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue; - if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) - if (typeof message.negativeIntValue === "number") - object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue; - else - object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue; - if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) - object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; - if (message.stringValue != null && message.hasOwnProperty("stringValue")) - object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue; - if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) - object.aggregateValue = message.aggregateValue; - return object; - }; - - /** - * Converts this UninterpretedOption to JSON. - * @function toJSON - * @memberof google.protobuf.UninterpretedOption - * @instance - * @returns {Object.} JSON object - */ - UninterpretedOption.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UninterpretedOption - * @function getTypeUrl - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UninterpretedOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.UninterpretedOption"; - }; - - UninterpretedOption.NamePart = (function() { - - /** - * Properties of a NamePart. - * @memberof google.protobuf.UninterpretedOption - * @interface INamePart - * @property {string} namePart NamePart namePart - * @property {boolean} isExtension NamePart isExtension - */ - - /** - * Constructs a new NamePart. - * @memberof google.protobuf.UninterpretedOption - * @classdesc Represents a NamePart. - * @implements INamePart - * @constructor - * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set - */ - function NamePart(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * NamePart namePart. - * @member {string} namePart - * @memberof google.protobuf.UninterpretedOption.NamePart - * @instance - */ - NamePart.prototype.namePart = ""; - - /** - * NamePart isExtension. - * @member {boolean} isExtension - * @memberof google.protobuf.UninterpretedOption.NamePart - * @instance - */ - NamePart.prototype.isExtension = false; - - /** - * Creates a new NamePart instance using the specified properties. - * @function create - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance - */ - NamePart.create = function create(properties) { - return new NamePart(properties); - }; - - /** - * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @function encode - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NamePart.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart); - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension); - return writer; - }; - - /** - * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NamePart.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a NamePart message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NamePart.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.namePart = reader.string(); - break; - } - case 2: { - message.isExtension = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - if (!message.hasOwnProperty("namePart")) - throw $util.ProtocolError("missing required 'namePart'", { instance: message }); - if (!message.hasOwnProperty("isExtension")) - throw $util.ProtocolError("missing required 'isExtension'", { instance: message }); - return message; - }; - - /** - * Decodes a NamePart message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NamePart.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a NamePart message. - * @function verify - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - NamePart.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (!$util.isString(message.namePart)) - return "namePart: string expected"; - if (typeof message.isExtension !== "boolean") - return "isExtension: boolean expected"; - return null; - }; - - /** - * Creates a NamePart message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart - */ - NamePart.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) - return object; - var message = new $root.google.protobuf.UninterpretedOption.NamePart(); - if (object.namePart != null) - message.namePart = String(object.namePart); - if (object.isExtension != null) - message.isExtension = Boolean(object.isExtension); - return message; - }; - - /** - * Creates a plain object from a NamePart message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - NamePart.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.namePart = ""; - object.isExtension = false; - } - if (message.namePart != null && message.hasOwnProperty("namePart")) - object.namePart = message.namePart; - if (message.isExtension != null && message.hasOwnProperty("isExtension")) - object.isExtension = message.isExtension; - return object; - }; - - /** - * Converts this NamePart to JSON. - * @function toJSON - * @memberof google.protobuf.UninterpretedOption.NamePart - * @instance - * @returns {Object.} JSON object - */ - NamePart.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for NamePart - * @function getTypeUrl - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - NamePart.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.UninterpretedOption.NamePart"; - }; - - return NamePart; - })(); - - return UninterpretedOption; - })(); - - protobuf.FeatureSet = (function() { - - /** - * Properties of a FeatureSet. - * @memberof google.protobuf - * @interface IFeatureSet - * @property {google.protobuf.FeatureSet.FieldPresence|null} [fieldPresence] FeatureSet fieldPresence - * @property {google.protobuf.FeatureSet.EnumType|null} [enumType] FeatureSet enumType - * @property {google.protobuf.FeatureSet.RepeatedFieldEncoding|null} [repeatedFieldEncoding] FeatureSet repeatedFieldEncoding - * @property {google.protobuf.FeatureSet.Utf8Validation|null} [utf8Validation] FeatureSet utf8Validation - * @property {google.protobuf.FeatureSet.MessageEncoding|null} [messageEncoding] FeatureSet messageEncoding - * @property {google.protobuf.FeatureSet.JsonFormat|null} [jsonFormat] FeatureSet jsonFormat - */ - - /** - * Constructs a new FeatureSet. - * @memberof google.protobuf - * @classdesc Represents a FeatureSet. - * @implements IFeatureSet - * @constructor - * @param {google.protobuf.IFeatureSet=} [properties] Properties to set - */ - function FeatureSet(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FeatureSet fieldPresence. - * @member {google.protobuf.FeatureSet.FieldPresence} fieldPresence - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.fieldPresence = 0; - - /** - * FeatureSet enumType. - * @member {google.protobuf.FeatureSet.EnumType} enumType - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.enumType = 0; - - /** - * FeatureSet repeatedFieldEncoding. - * @member {google.protobuf.FeatureSet.RepeatedFieldEncoding} repeatedFieldEncoding - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.repeatedFieldEncoding = 0; - - /** - * FeatureSet utf8Validation. - * @member {google.protobuf.FeatureSet.Utf8Validation} utf8Validation - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.utf8Validation = 0; - - /** - * FeatureSet messageEncoding. - * @member {google.protobuf.FeatureSet.MessageEncoding} messageEncoding - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.messageEncoding = 0; - - /** - * FeatureSet jsonFormat. - * @member {google.protobuf.FeatureSet.JsonFormat} jsonFormat - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.jsonFormat = 0; - - /** - * Creates a new FeatureSet instance using the specified properties. - * @function create - * @memberof google.protobuf.FeatureSet - * @static - * @param {google.protobuf.IFeatureSet=} [properties] Properties to set - * @returns {google.protobuf.FeatureSet} FeatureSet instance - */ - FeatureSet.create = function create(properties) { - return new FeatureSet(properties); - }; - - /** - * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FeatureSet - * @static - * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSet.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.fieldPresence != null && Object.hasOwnProperty.call(message, "fieldPresence")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.fieldPresence); - if (message.enumType != null && Object.hasOwnProperty.call(message, "enumType")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.enumType); - if (message.repeatedFieldEncoding != null && Object.hasOwnProperty.call(message, "repeatedFieldEncoding")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.repeatedFieldEncoding); - if (message.utf8Validation != null && Object.hasOwnProperty.call(message, "utf8Validation")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.utf8Validation); - if (message.messageEncoding != null && Object.hasOwnProperty.call(message, "messageEncoding")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.messageEncoding); - if (message.jsonFormat != null && Object.hasOwnProperty.call(message, "jsonFormat")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jsonFormat); - return writer; - }; - - /** - * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FeatureSet - * @static - * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSet.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FeatureSet message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FeatureSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FeatureSet} FeatureSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSet.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSet(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.fieldPresence = reader.int32(); - break; - } - case 2: { - message.enumType = reader.int32(); - break; - } - case 3: { - message.repeatedFieldEncoding = reader.int32(); - break; - } - case 4: { - message.utf8Validation = reader.int32(); - break; - } - case 5: { - message.messageEncoding = reader.int32(); - break; - } - case 6: { - message.jsonFormat = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FeatureSet message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FeatureSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FeatureSet} FeatureSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSet.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FeatureSet message. - * @function verify - * @memberof google.protobuf.FeatureSet - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FeatureSet.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) - switch (message.fieldPresence) { - default: - return "fieldPresence: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.enumType != null && message.hasOwnProperty("enumType")) - switch (message.enumType) { - default: - return "enumType: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) - switch (message.repeatedFieldEncoding) { - default: - return "repeatedFieldEncoding: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) - switch (message.utf8Validation) { - default: - return "utf8Validation: enum value expected"; - case 0: - case 2: - case 3: - break; - } - if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) - switch (message.messageEncoding) { - default: - return "messageEncoding: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) - switch (message.jsonFormat) { - default: - return "jsonFormat: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FeatureSet - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FeatureSet} FeatureSet - */ - FeatureSet.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FeatureSet) - return object; - var message = new $root.google.protobuf.FeatureSet(); - switch (object.fieldPresence) { - default: - if (typeof object.fieldPresence === "number") { - message.fieldPresence = object.fieldPresence; - break; - } - break; - case "FIELD_PRESENCE_UNKNOWN": - case 0: - message.fieldPresence = 0; - break; - case "EXPLICIT": - case 1: - message.fieldPresence = 1; - break; - case "IMPLICIT": - case 2: - message.fieldPresence = 2; - break; - case "LEGACY_REQUIRED": - case 3: - message.fieldPresence = 3; - break; - } - switch (object.enumType) { - default: - if (typeof object.enumType === "number") { - message.enumType = object.enumType; - break; - } - break; - case "ENUM_TYPE_UNKNOWN": - case 0: - message.enumType = 0; - break; - case "OPEN": - case 1: - message.enumType = 1; - break; - case "CLOSED": - case 2: - message.enumType = 2; - break; - } - switch (object.repeatedFieldEncoding) { - default: - if (typeof object.repeatedFieldEncoding === "number") { - message.repeatedFieldEncoding = object.repeatedFieldEncoding; - break; - } - break; - case "REPEATED_FIELD_ENCODING_UNKNOWN": - case 0: - message.repeatedFieldEncoding = 0; - break; - case "PACKED": - case 1: - message.repeatedFieldEncoding = 1; - break; - case "EXPANDED": - case 2: - message.repeatedFieldEncoding = 2; - break; - } - switch (object.utf8Validation) { - default: - if (typeof object.utf8Validation === "number") { - message.utf8Validation = object.utf8Validation; - break; - } - break; - case "UTF8_VALIDATION_UNKNOWN": - case 0: - message.utf8Validation = 0; - break; - case "VERIFY": - case 2: - message.utf8Validation = 2; - break; - case "NONE": - case 3: - message.utf8Validation = 3; - break; - } - switch (object.messageEncoding) { - default: - if (typeof object.messageEncoding === "number") { - message.messageEncoding = object.messageEncoding; - break; - } - break; - case "MESSAGE_ENCODING_UNKNOWN": - case 0: - message.messageEncoding = 0; - break; - case "LENGTH_PREFIXED": - case 1: - message.messageEncoding = 1; - break; - case "DELIMITED": - case 2: - message.messageEncoding = 2; - break; - } - switch (object.jsonFormat) { - default: - if (typeof object.jsonFormat === "number") { - message.jsonFormat = object.jsonFormat; - break; - } - break; - case "JSON_FORMAT_UNKNOWN": - case 0: - message.jsonFormat = 0; - break; - case "ALLOW": - case 1: - message.jsonFormat = 1; - break; - case "LEGACY_BEST_EFFORT": - case 2: - message.jsonFormat = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FeatureSet - * @static - * @param {google.protobuf.FeatureSet} message FeatureSet - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FeatureSet.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.fieldPresence = options.enums === String ? "FIELD_PRESENCE_UNKNOWN" : 0; - object.enumType = options.enums === String ? "ENUM_TYPE_UNKNOWN" : 0; - object.repeatedFieldEncoding = options.enums === String ? "REPEATED_FIELD_ENCODING_UNKNOWN" : 0; - object.utf8Validation = options.enums === String ? "UTF8_VALIDATION_UNKNOWN" : 0; - object.messageEncoding = options.enums === String ? "MESSAGE_ENCODING_UNKNOWN" : 0; - object.jsonFormat = options.enums === String ? "JSON_FORMAT_UNKNOWN" : 0; - } - if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) - object.fieldPresence = options.enums === String ? $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] === undefined ? message.fieldPresence : $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] : message.fieldPresence; - if (message.enumType != null && message.hasOwnProperty("enumType")) - object.enumType = options.enums === String ? $root.google.protobuf.FeatureSet.EnumType[message.enumType] === undefined ? message.enumType : $root.google.protobuf.FeatureSet.EnumType[message.enumType] : message.enumType; - if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) - object.repeatedFieldEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] === undefined ? message.repeatedFieldEncoding : $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] : message.repeatedFieldEncoding; - if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) - object.utf8Validation = options.enums === String ? $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] === undefined ? message.utf8Validation : $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] : message.utf8Validation; - if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) - object.messageEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] === undefined ? message.messageEncoding : $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] : message.messageEncoding; - if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) - object.jsonFormat = options.enums === String ? $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] === undefined ? message.jsonFormat : $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] : message.jsonFormat; - return object; - }; - - /** - * Converts this FeatureSet to JSON. - * @function toJSON - * @memberof google.protobuf.FeatureSet - * @instance - * @returns {Object.} JSON object - */ - FeatureSet.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FeatureSet - * @function getTypeUrl - * @memberof google.protobuf.FeatureSet - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FeatureSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FeatureSet"; - }; - - /** - * FieldPresence enum. - * @name google.protobuf.FeatureSet.FieldPresence - * @enum {number} - * @property {number} FIELD_PRESENCE_UNKNOWN=0 FIELD_PRESENCE_UNKNOWN value - * @property {number} EXPLICIT=1 EXPLICIT value - * @property {number} IMPLICIT=2 IMPLICIT value - * @property {number} LEGACY_REQUIRED=3 LEGACY_REQUIRED value - */ - FeatureSet.FieldPresence = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "FIELD_PRESENCE_UNKNOWN"] = 0; - values[valuesById[1] = "EXPLICIT"] = 1; - values[valuesById[2] = "IMPLICIT"] = 2; - values[valuesById[3] = "LEGACY_REQUIRED"] = 3; - return values; - })(); - - /** - * EnumType enum. - * @name google.protobuf.FeatureSet.EnumType - * @enum {number} - * @property {number} ENUM_TYPE_UNKNOWN=0 ENUM_TYPE_UNKNOWN value - * @property {number} OPEN=1 OPEN value - * @property {number} CLOSED=2 CLOSED value - */ - FeatureSet.EnumType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ENUM_TYPE_UNKNOWN"] = 0; - values[valuesById[1] = "OPEN"] = 1; - values[valuesById[2] = "CLOSED"] = 2; - return values; - })(); - - /** - * RepeatedFieldEncoding enum. - * @name google.protobuf.FeatureSet.RepeatedFieldEncoding - * @enum {number} - * @property {number} REPEATED_FIELD_ENCODING_UNKNOWN=0 REPEATED_FIELD_ENCODING_UNKNOWN value - * @property {number} PACKED=1 PACKED value - * @property {number} EXPANDED=2 EXPANDED value - */ - FeatureSet.RepeatedFieldEncoding = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "REPEATED_FIELD_ENCODING_UNKNOWN"] = 0; - values[valuesById[1] = "PACKED"] = 1; - values[valuesById[2] = "EXPANDED"] = 2; - return values; - })(); - - /** - * Utf8Validation enum. - * @name google.protobuf.FeatureSet.Utf8Validation - * @enum {number} - * @property {number} UTF8_VALIDATION_UNKNOWN=0 UTF8_VALIDATION_UNKNOWN value - * @property {number} VERIFY=2 VERIFY value - * @property {number} NONE=3 NONE value - */ - FeatureSet.Utf8Validation = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "UTF8_VALIDATION_UNKNOWN"] = 0; - values[valuesById[2] = "VERIFY"] = 2; - values[valuesById[3] = "NONE"] = 3; - return values; - })(); - - /** - * MessageEncoding enum. - * @name google.protobuf.FeatureSet.MessageEncoding - * @enum {number} - * @property {number} MESSAGE_ENCODING_UNKNOWN=0 MESSAGE_ENCODING_UNKNOWN value - * @property {number} LENGTH_PREFIXED=1 LENGTH_PREFIXED value - * @property {number} DELIMITED=2 DELIMITED value - */ - FeatureSet.MessageEncoding = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "MESSAGE_ENCODING_UNKNOWN"] = 0; - values[valuesById[1] = "LENGTH_PREFIXED"] = 1; - values[valuesById[2] = "DELIMITED"] = 2; - return values; - })(); - - /** - * JsonFormat enum. - * @name google.protobuf.FeatureSet.JsonFormat - * @enum {number} - * @property {number} JSON_FORMAT_UNKNOWN=0 JSON_FORMAT_UNKNOWN value - * @property {number} ALLOW=1 ALLOW value - * @property {number} LEGACY_BEST_EFFORT=2 LEGACY_BEST_EFFORT value - */ - FeatureSet.JsonFormat = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "JSON_FORMAT_UNKNOWN"] = 0; - values[valuesById[1] = "ALLOW"] = 1; - values[valuesById[2] = "LEGACY_BEST_EFFORT"] = 2; - return values; - })(); - - return FeatureSet; - })(); - - protobuf.FeatureSetDefaults = (function() { - - /** - * Properties of a FeatureSetDefaults. - * @memberof google.protobuf - * @interface IFeatureSetDefaults - * @property {Array.|null} [defaults] FeatureSetDefaults defaults - * @property {google.protobuf.Edition|null} [minimumEdition] FeatureSetDefaults minimumEdition - * @property {google.protobuf.Edition|null} [maximumEdition] FeatureSetDefaults maximumEdition - */ - - /** - * Constructs a new FeatureSetDefaults. - * @memberof google.protobuf - * @classdesc Represents a FeatureSetDefaults. - * @implements IFeatureSetDefaults - * @constructor - * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set - */ - function FeatureSetDefaults(properties) { - this.defaults = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FeatureSetDefaults defaults. - * @member {Array.} defaults - * @memberof google.protobuf.FeatureSetDefaults - * @instance - */ - FeatureSetDefaults.prototype.defaults = $util.emptyArray; - - /** - * FeatureSetDefaults minimumEdition. - * @member {google.protobuf.Edition} minimumEdition - * @memberof google.protobuf.FeatureSetDefaults - * @instance - */ - FeatureSetDefaults.prototype.minimumEdition = 0; - - /** - * FeatureSetDefaults maximumEdition. - * @member {google.protobuf.Edition} maximumEdition - * @memberof google.protobuf.FeatureSetDefaults - * @instance - */ - FeatureSetDefaults.prototype.maximumEdition = 0; - - /** - * Creates a new FeatureSetDefaults instance using the specified properties. - * @function create - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set - * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults instance - */ - FeatureSetDefaults.create = function create(properties) { - return new FeatureSetDefaults(properties); - }; - - /** - * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSetDefaults.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.defaults != null && message.defaults.length) - for (var i = 0; i < message.defaults.length; ++i) - $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.encode(message.defaults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.minimumEdition != null && Object.hasOwnProperty.call(message, "minimumEdition")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.minimumEdition); - if (message.maximumEdition != null && Object.hasOwnProperty.call(message, "maximumEdition")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maximumEdition); - return writer; - }; - - /** - * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSetDefaults.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FeatureSetDefaults message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSetDefaults.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.defaults && message.defaults.length)) - message.defaults = []; - message.defaults.push($root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.decode(reader, reader.uint32())); - break; - } - case 4: { - message.minimumEdition = reader.int32(); - break; - } - case 5: { - message.maximumEdition = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSetDefaults.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FeatureSetDefaults message. - * @function verify - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FeatureSetDefaults.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.defaults != null && message.hasOwnProperty("defaults")) { - if (!Array.isArray(message.defaults)) - return "defaults: array expected"; - for (var i = 0; i < message.defaults.length; ++i) { - var error = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify(message.defaults[i]); - if (error) - return "defaults." + error; - } - } - if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) - switch (message.minimumEdition) { - default: - return "minimumEdition: enum value expected"; - case 0: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) - switch (message.maximumEdition) { - default: - return "maximumEdition: enum value expected"; - case 0: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - return null; - }; - - /** - * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults - */ - FeatureSetDefaults.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FeatureSetDefaults) - return object; - var message = new $root.google.protobuf.FeatureSetDefaults(); - if (object.defaults) { - if (!Array.isArray(object.defaults)) - throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: array expected"); - message.defaults = []; - for (var i = 0; i < object.defaults.length; ++i) { - if (typeof object.defaults[i] !== "object") - throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: object expected"); - message.defaults[i] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fromObject(object.defaults[i]); - } - } - switch (object.minimumEdition) { - default: - if (typeof object.minimumEdition === "number") { - message.minimumEdition = object.minimumEdition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.minimumEdition = 0; - break; - case "EDITION_PROTO2": - case 998: - message.minimumEdition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.minimumEdition = 999; - break; - case "EDITION_2023": - case 1000: - message.minimumEdition = 1000; - break; - case "EDITION_2024": - case 1001: - message.minimumEdition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.minimumEdition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.minimumEdition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.minimumEdition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.minimumEdition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.minimumEdition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.minimumEdition = 2147483647; - break; - } - switch (object.maximumEdition) { - default: - if (typeof object.maximumEdition === "number") { - message.maximumEdition = object.maximumEdition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.maximumEdition = 0; - break; - case "EDITION_PROTO2": - case 998: - message.maximumEdition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.maximumEdition = 999; - break; - case "EDITION_2023": - case 1000: - message.maximumEdition = 1000; - break; - case "EDITION_2024": - case 1001: - message.maximumEdition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.maximumEdition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.maximumEdition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.maximumEdition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.maximumEdition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.maximumEdition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.maximumEdition = 2147483647; - break; - } - return message; - }; - - /** - * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {google.protobuf.FeatureSetDefaults} message FeatureSetDefaults - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FeatureSetDefaults.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.defaults = []; - if (options.defaults) { - object.minimumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; - object.maximumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; - } - if (message.defaults && message.defaults.length) { - object.defaults = []; - for (var j = 0; j < message.defaults.length; ++j) - object.defaults[j] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.toObject(message.defaults[j], options); - } - if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) - object.minimumEdition = options.enums === String ? $root.google.protobuf.Edition[message.minimumEdition] === undefined ? message.minimumEdition : $root.google.protobuf.Edition[message.minimumEdition] : message.minimumEdition; - if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) - object.maximumEdition = options.enums === String ? $root.google.protobuf.Edition[message.maximumEdition] === undefined ? message.maximumEdition : $root.google.protobuf.Edition[message.maximumEdition] : message.maximumEdition; - return object; - }; - - /** - * Converts this FeatureSetDefaults to JSON. - * @function toJSON - * @memberof google.protobuf.FeatureSetDefaults - * @instance - * @returns {Object.} JSON object - */ - FeatureSetDefaults.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FeatureSetDefaults - * @function getTypeUrl - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FeatureSetDefaults.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults"; - }; - - FeatureSetDefaults.FeatureSetEditionDefault = (function() { - - /** - * Properties of a FeatureSetEditionDefault. - * @memberof google.protobuf.FeatureSetDefaults - * @interface IFeatureSetEditionDefault - * @property {google.protobuf.Edition|null} [edition] FeatureSetEditionDefault edition - * @property {google.protobuf.IFeatureSet|null} [features] FeatureSetEditionDefault features - */ - - /** - * Constructs a new FeatureSetEditionDefault. - * @memberof google.protobuf.FeatureSetDefaults - * @classdesc Represents a FeatureSetEditionDefault. - * @implements IFeatureSetEditionDefault - * @constructor - * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set - */ - function FeatureSetEditionDefault(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FeatureSetEditionDefault edition. - * @member {google.protobuf.Edition} edition - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @instance - */ - FeatureSetEditionDefault.prototype.edition = 0; - - /** - * FeatureSetEditionDefault features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @instance - */ - FeatureSetEditionDefault.prototype.features = null; - - /** - * Creates a new FeatureSetEditionDefault instance using the specified properties. - * @function create - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set - * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault instance - */ - FeatureSetEditionDefault.create = function create(properties) { - return new FeatureSetEditionDefault(properties); - }; - - /** - * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSetEditionDefault.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); - return writer; - }; - - /** - * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSetEditionDefault.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSetEditionDefault.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 3: { - message.edition = reader.int32(); - break; - } - case 2: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSetEditionDefault.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FeatureSetEditionDefault message. - * @function verify - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FeatureSetEditionDefault.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.edition != null && message.hasOwnProperty("edition")) - switch (message.edition) { - default: - return "edition: enum value expected"; - case 0: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - return null; - }; - - /** - * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault - */ - FeatureSetEditionDefault.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault) - return object; - var message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); - switch (object.edition) { - default: - if (typeof object.edition === "number") { - message.edition = object.edition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.edition = 0; - break; - case "EDITION_PROTO2": - case 998: - message.edition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.edition = 999; - break; - case "EDITION_2023": - case 1000: - message.edition = 1000; - break; - case "EDITION_2024": - case 1001: - message.edition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.edition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.edition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.edition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.edition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.edition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.edition = 2147483647; - break; - } - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - return message; - }; - - /** - * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} message FeatureSetEditionDefault - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FeatureSetEditionDefault.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.features = null; - object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; - } - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.edition != null && message.hasOwnProperty("edition")) - object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; - return object; - }; - - /** - * Converts this FeatureSetEditionDefault to JSON. - * @function toJSON - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @instance - * @returns {Object.} JSON object - */ - FeatureSetEditionDefault.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FeatureSetEditionDefault - * @function getTypeUrl - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FeatureSetEditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault"; - }; - - return FeatureSetEditionDefault; - })(); - - return FeatureSetDefaults; - })(); - - protobuf.SourceCodeInfo = (function() { - - /** - * Properties of a SourceCodeInfo. - * @memberof google.protobuf - * @interface ISourceCodeInfo - * @property {Array.|null} [location] SourceCodeInfo location - */ - - /** - * Constructs a new SourceCodeInfo. - * @memberof google.protobuf - * @classdesc Represents a SourceCodeInfo. - * @implements ISourceCodeInfo - * @constructor - * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set - */ - function SourceCodeInfo(properties) { - this.location = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SourceCodeInfo location. - * @member {Array.} location - * @memberof google.protobuf.SourceCodeInfo - * @instance - */ - SourceCodeInfo.prototype.location = $util.emptyArray; - - /** - * Creates a new SourceCodeInfo instance using the specified properties. - * @function create - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance - */ - SourceCodeInfo.create = function create(properties) { - return new SourceCodeInfo(properties); - }; - - /** - * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @function encode - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SourceCodeInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.location != null && message.location.length) - for (var i = 0; i < message.location.length; ++i) - $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SourceCodeInfo.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.location && message.location.length)) - message.location = []; - message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SourceCodeInfo message. - * @function verify - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SourceCodeInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.location != null && message.hasOwnProperty("location")) { - if (!Array.isArray(message.location)) - return "location: array expected"; - for (var i = 0; i < message.location.length; ++i) { - var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]); - if (error) - return "location." + error; - } - } - return null; - }; - - /** - * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo - */ - SourceCodeInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.SourceCodeInfo) - return object; - var message = new $root.google.protobuf.SourceCodeInfo(); - if (object.location) { - if (!Array.isArray(object.location)) - throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); - message.location = []; - for (var i = 0; i < object.location.length; ++i) { - if (typeof object.location[i] !== "object") - throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); - message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SourceCodeInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.location = []; - if (message.location && message.location.length) { - object.location = []; - for (var j = 0; j < message.location.length; ++j) - object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options); - } - return object; - }; - - /** - * Converts this SourceCodeInfo to JSON. - * @function toJSON - * @memberof google.protobuf.SourceCodeInfo - * @instance - * @returns {Object.} JSON object - */ - SourceCodeInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SourceCodeInfo - * @function getTypeUrl - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SourceCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.SourceCodeInfo"; - }; - - SourceCodeInfo.Location = (function() { - - /** - * Properties of a Location. - * @memberof google.protobuf.SourceCodeInfo - * @interface ILocation - * @property {Array.|null} [path] Location path - * @property {Array.|null} [span] Location span - * @property {string|null} [leadingComments] Location leadingComments - * @property {string|null} [trailingComments] Location trailingComments - * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments - */ - - /** - * Constructs a new Location. - * @memberof google.protobuf.SourceCodeInfo - * @classdesc Represents a Location. - * @implements ILocation - * @constructor - * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set - */ - function Location(properties) { - this.path = []; - this.span = []; - this.leadingDetachedComments = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Location path. - * @member {Array.} path - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.path = $util.emptyArray; - - /** - * Location span. - * @member {Array.} span - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.span = $util.emptyArray; - - /** - * Location leadingComments. - * @member {string} leadingComments - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.leadingComments = ""; - - /** - * Location trailingComments. - * @member {string} trailingComments - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.trailingComments = ""; - - /** - * Location leadingDetachedComments. - * @member {Array.} leadingDetachedComments - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.leadingDetachedComments = $util.emptyArray; - - /** - * Creates a new Location instance using the specified properties. - * @function create - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set - * @returns {google.protobuf.SourceCodeInfo.Location} Location instance - */ - Location.create = function create(properties) { - return new Location(properties); - }; - - /** - * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @function encode - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Location.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && message.path.length) { - writer.uint32(/* id 1, wireType 2 =*/10).fork(); - for (var i = 0; i < message.path.length; ++i) - writer.int32(message.path[i]); - writer.ldelim(); - } - if (message.span != null && message.span.length) { - writer.uint32(/* id 2, wireType 2 =*/18).fork(); - for (var i = 0; i < message.span.length; ++i) - writer.int32(message.span[i]); - writer.ldelim(); - } - if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); - if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); - if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) - for (var i = 0; i < message.leadingDetachedComments.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); - return writer; - }; - - /** - * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Location.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Location message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.SourceCodeInfo.Location} Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Location.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.path && message.path.length)) - message.path = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.path.push(reader.int32()); - } else - message.path.push(reader.int32()); - break; - } - case 2: { - if (!(message.span && message.span.length)) - message.span = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.span.push(reader.int32()); - } else - message.span.push(reader.int32()); - break; - } - case 3: { - message.leadingComments = reader.string(); - break; - } - case 4: { - message.trailingComments = reader.string(); - break; - } - case 6: { - if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) - message.leadingDetachedComments = []; - message.leadingDetachedComments.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Location message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.SourceCodeInfo.Location} Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Location.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Location message. - * @function verify - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Location.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) { - if (!Array.isArray(message.path)) - return "path: array expected"; - for (var i = 0; i < message.path.length; ++i) - if (!$util.isInteger(message.path[i])) - return "path: integer[] expected"; - } - if (message.span != null && message.hasOwnProperty("span")) { - if (!Array.isArray(message.span)) - return "span: array expected"; - for (var i = 0; i < message.span.length; ++i) - if (!$util.isInteger(message.span[i])) - return "span: integer[] expected"; - } - if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) - if (!$util.isString(message.leadingComments)) - return "leadingComments: string expected"; - if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) - if (!$util.isString(message.trailingComments)) - return "trailingComments: string expected"; - if (message.leadingDetachedComments != null && message.hasOwnProperty("leadingDetachedComments")) { - if (!Array.isArray(message.leadingDetachedComments)) - return "leadingDetachedComments: array expected"; - for (var i = 0; i < message.leadingDetachedComments.length; ++i) - if (!$util.isString(message.leadingDetachedComments[i])) - return "leadingDetachedComments: string[] expected"; - } - return null; - }; - - /** - * Creates a Location message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.SourceCodeInfo.Location} Location - */ - Location.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) - return object; - var message = new $root.google.protobuf.SourceCodeInfo.Location(); - if (object.path) { - if (!Array.isArray(object.path)) - throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); - message.path = []; - for (var i = 0; i < object.path.length; ++i) - message.path[i] = object.path[i] | 0; - } - if (object.span) { - if (!Array.isArray(object.span)) - throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); - message.span = []; - for (var i = 0; i < object.span.length; ++i) - message.span[i] = object.span[i] | 0; - } - if (object.leadingComments != null) - message.leadingComments = String(object.leadingComments); - if (object.trailingComments != null) - message.trailingComments = String(object.trailingComments); - if (object.leadingDetachedComments) { - if (!Array.isArray(object.leadingDetachedComments)) - throw TypeError(".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected"); - message.leadingDetachedComments = []; - for (var i = 0; i < object.leadingDetachedComments.length; ++i) - message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]); - } - return message; - }; - - /** - * Creates a plain object from a Location message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.Location} message Location - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Location.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.path = []; - object.span = []; - object.leadingDetachedComments = []; - } - if (options.defaults) { - object.leadingComments = ""; - object.trailingComments = ""; - } - if (message.path && message.path.length) { - object.path = []; - for (var j = 0; j < message.path.length; ++j) - object.path[j] = message.path[j]; - } - if (message.span && message.span.length) { - object.span = []; - for (var j = 0; j < message.span.length; ++j) - object.span[j] = message.span[j]; - } - if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) - object.leadingComments = message.leadingComments; - if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) - object.trailingComments = message.trailingComments; - if (message.leadingDetachedComments && message.leadingDetachedComments.length) { - object.leadingDetachedComments = []; - for (var j = 0; j < message.leadingDetachedComments.length; ++j) - object.leadingDetachedComments[j] = message.leadingDetachedComments[j]; - } - return object; - }; - - /** - * Converts this Location to JSON. - * @function toJSON - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - * @returns {Object.} JSON object - */ - Location.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Location - * @function getTypeUrl - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Location.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.SourceCodeInfo.Location"; - }; - - return Location; - })(); - - return SourceCodeInfo; - })(); - - protobuf.GeneratedCodeInfo = (function() { - - /** - * Properties of a GeneratedCodeInfo. - * @memberof google.protobuf - * @interface IGeneratedCodeInfo - * @property {Array.|null} [annotation] GeneratedCodeInfo annotation - */ - - /** - * Constructs a new GeneratedCodeInfo. - * @memberof google.protobuf - * @classdesc Represents a GeneratedCodeInfo. - * @implements IGeneratedCodeInfo - * @constructor - * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set - */ - function GeneratedCodeInfo(properties) { - this.annotation = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GeneratedCodeInfo annotation. - * @member {Array.} annotation - * @memberof google.protobuf.GeneratedCodeInfo - * @instance - */ - GeneratedCodeInfo.prototype.annotation = $util.emptyArray; - - /** - * Creates a new GeneratedCodeInfo instance using the specified properties. - * @function create - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance - */ - GeneratedCodeInfo.create = function create(properties) { - return new GeneratedCodeInfo(properties); - }; - - /** - * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @function encode - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GeneratedCodeInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.annotation != null && message.annotation.length) - for (var i = 0; i < message.annotation.length; ++i) - $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GeneratedCodeInfo.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.annotation && message.annotation.length)) - message.annotation = []; - message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GeneratedCodeInfo message. - * @function verify - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GeneratedCodeInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.annotation != null && message.hasOwnProperty("annotation")) { - if (!Array.isArray(message.annotation)) - return "annotation: array expected"; - for (var i = 0; i < message.annotation.length; ++i) { - var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]); - if (error) - return "annotation." + error; - } - } - return null; - }; - - /** - * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo - */ - GeneratedCodeInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.GeneratedCodeInfo) - return object; - var message = new $root.google.protobuf.GeneratedCodeInfo(); - if (object.annotation) { - if (!Array.isArray(object.annotation)) - throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); - message.annotation = []; - for (var i = 0; i < object.annotation.length; ++i) { - if (typeof object.annotation[i] !== "object") - throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); - message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GeneratedCodeInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.annotation = []; - if (message.annotation && message.annotation.length) { - object.annotation = []; - for (var j = 0; j < message.annotation.length; ++j) - object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options); - } - return object; - }; - - /** - * Converts this GeneratedCodeInfo to JSON. - * @function toJSON - * @memberof google.protobuf.GeneratedCodeInfo - * @instance - * @returns {Object.} JSON object - */ - GeneratedCodeInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GeneratedCodeInfo - * @function getTypeUrl - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GeneratedCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo"; - }; - - GeneratedCodeInfo.Annotation = (function() { - - /** - * Properties of an Annotation. - * @memberof google.protobuf.GeneratedCodeInfo - * @interface IAnnotation - * @property {Array.|null} [path] Annotation path - * @property {string|null} [sourceFile] Annotation sourceFile - * @property {number|null} [begin] Annotation begin - * @property {number|null} [end] Annotation end - * @property {google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null} [semantic] Annotation semantic - */ - - /** - * Constructs a new Annotation. - * @memberof google.protobuf.GeneratedCodeInfo - * @classdesc Represents an Annotation. - * @implements IAnnotation - * @constructor - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set - */ - function Annotation(properties) { - this.path = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Annotation path. - * @member {Array.} path - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.path = $util.emptyArray; - - /** - * Annotation sourceFile. - * @member {string} sourceFile - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.sourceFile = ""; - - /** - * Annotation begin. - * @member {number} begin - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.begin = 0; - - /** - * Annotation end. - * @member {number} end - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.end = 0; - - /** - * Annotation semantic. - * @member {google.protobuf.GeneratedCodeInfo.Annotation.Semantic} semantic - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.semantic = 0; - - /** - * Creates a new Annotation instance using the specified properties. - * @function create - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance - */ - Annotation.create = function create(properties) { - return new Annotation(properties); - }; - - /** - * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @function encode - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Annotation.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && message.path.length) { - writer.uint32(/* id 1, wireType 2 =*/10).fork(); - for (var i = 0; i < message.path.length; ++i) - writer.int32(message.path[i]); - writer.ldelim(); - } - if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); - if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); - if (message.semantic != null && Object.hasOwnProperty.call(message, "semantic")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.semantic); - return writer; - }; - - /** - * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Annotation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Annotation message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Annotation.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.path && message.path.length)) - message.path = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.path.push(reader.int32()); - } else - message.path.push(reader.int32()); - break; - } - case 2: { - message.sourceFile = reader.string(); - break; - } - case 3: { - message.begin = reader.int32(); - break; - } - case 4: { - message.end = reader.int32(); - break; - } - case 5: { - message.semantic = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Annotation message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Annotation.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Annotation message. - * @function verify - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Annotation.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) { - if (!Array.isArray(message.path)) - return "path: array expected"; - for (var i = 0; i < message.path.length; ++i) - if (!$util.isInteger(message.path[i])) - return "path: integer[] expected"; - } - if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) - if (!$util.isString(message.sourceFile)) - return "sourceFile: string expected"; - if (message.begin != null && message.hasOwnProperty("begin")) - if (!$util.isInteger(message.begin)) - return "begin: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - if (message.semantic != null && message.hasOwnProperty("semantic")) - switch (message.semantic) { - default: - return "semantic: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates an Annotation message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation - */ - Annotation.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) - return object; - var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); - if (object.path) { - if (!Array.isArray(object.path)) - throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); - message.path = []; - for (var i = 0; i < object.path.length; ++i) - message.path[i] = object.path[i] | 0; - } - if (object.sourceFile != null) - message.sourceFile = String(object.sourceFile); - if (object.begin != null) - message.begin = object.begin | 0; - if (object.end != null) - message.end = object.end | 0; - switch (object.semantic) { - default: - if (typeof object.semantic === "number") { - message.semantic = object.semantic; - break; - } - break; - case "NONE": - case 0: - message.semantic = 0; - break; - case "SET": - case 1: - message.semantic = 1; - break; - case "ALIAS": - case 2: - message.semantic = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from an Annotation message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Annotation.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.path = []; - if (options.defaults) { - object.sourceFile = ""; - object.begin = 0; - object.end = 0; - object.semantic = options.enums === String ? "NONE" : 0; - } - if (message.path && message.path.length) { - object.path = []; - for (var j = 0; j < message.path.length; ++j) - object.path[j] = message.path[j]; - } - if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) - object.sourceFile = message.sourceFile; - if (message.begin != null && message.hasOwnProperty("begin")) - object.begin = message.begin; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - if (message.semantic != null && message.hasOwnProperty("semantic")) - object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] === undefined ? message.semantic : $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic; - return object; - }; - - /** - * Converts this Annotation to JSON. - * @function toJSON - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - * @returns {Object.} JSON object - */ - Annotation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Annotation - * @function getTypeUrl - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Annotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo.Annotation"; - }; - - /** - * Semantic enum. - * @name google.protobuf.GeneratedCodeInfo.Annotation.Semantic - * @enum {number} - * @property {number} NONE=0 NONE value - * @property {number} SET=1 SET value - * @property {number} ALIAS=2 ALIAS value - */ - Annotation.Semantic = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "NONE"] = 0; - values[valuesById[1] = "SET"] = 1; - values[valuesById[2] = "ALIAS"] = 2; - return values; - })(); - - return Annotation; - })(); - - return GeneratedCodeInfo; - })(); - - protobuf.Duration = (function() { - - /** - * Properties of a Duration. - * @memberof google.protobuf - * @interface IDuration - * @property {number|Long|null} [seconds] Duration seconds - * @property {number|null} [nanos] Duration nanos - */ - - /** - * Constructs a new Duration. - * @memberof google.protobuf - * @classdesc Represents a Duration. - * @implements IDuration - * @constructor - * @param {google.protobuf.IDuration=} [properties] Properties to set - */ - function Duration(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Duration seconds. - * @member {number|Long} seconds - * @memberof google.protobuf.Duration - * @instance - */ - Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Duration nanos. - * @member {number} nanos - * @memberof google.protobuf.Duration - * @instance - */ - Duration.prototype.nanos = 0; - - /** - * Creates a new Duration instance using the specified properties. - * @function create - * @memberof google.protobuf.Duration - * @static - * @param {google.protobuf.IDuration=} [properties] Properties to set - * @returns {google.protobuf.Duration} Duration instance - */ - Duration.create = function create(properties) { - return new Duration(properties); - }; - - /** - * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Duration - * @static - * @param {google.protobuf.IDuration} message Duration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Duration.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); - if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); - return writer; - }; - - /** - * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Duration - * @static - * @param {google.protobuf.IDuration} message Duration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Duration.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Duration message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Duration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Duration} Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Duration.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.seconds = reader.int64(); - break; - } - case 2: { - message.nanos = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Duration message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Duration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Duration} Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Duration.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Duration message. - * @function verify - * @memberof google.protobuf.Duration - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Duration.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) - return "seconds: integer|Long expected"; - if (message.nanos != null && message.hasOwnProperty("nanos")) - if (!$util.isInteger(message.nanos)) - return "nanos: integer expected"; - return null; - }; - - /** - * Creates a Duration message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Duration - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Duration} Duration - */ - Duration.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Duration) - return object; - var message = new $root.google.protobuf.Duration(); - if (object.seconds != null) - if ($util.Long) - (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; - else if (typeof object.seconds === "string") - message.seconds = parseInt(object.seconds, 10); - else if (typeof object.seconds === "number") - message.seconds = object.seconds; - else if (typeof object.seconds === "object") - message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); - if (object.nanos != null) - message.nanos = object.nanos | 0; - return message; - }; - - /** - * Creates a plain object from a Duration message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Duration - * @static - * @param {google.protobuf.Duration} message Duration - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Duration.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.seconds = options.longs === String ? "0" : 0; - object.nanos = 0; - } - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (typeof message.seconds === "number") - object.seconds = options.longs === String ? String(message.seconds) : message.seconds; - else - object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; - if (message.nanos != null && message.hasOwnProperty("nanos")) - object.nanos = message.nanos; - return object; - }; - - /** - * Converts this Duration to JSON. - * @function toJSON - * @memberof google.protobuf.Duration - * @instance - * @returns {Object.} JSON object - */ - Duration.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Duration - * @function getTypeUrl - * @memberof google.protobuf.Duration - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Duration"; - }; - - return Duration; - })(); - - protobuf.Empty = (function() { - - /** - * Properties of an Empty. - * @memberof google.protobuf - * @interface IEmpty - */ - - /** - * Constructs a new Empty. - * @memberof google.protobuf - * @classdesc Represents an Empty. - * @implements IEmpty - * @constructor - * @param {google.protobuf.IEmpty=} [properties] Properties to set - */ - function Empty(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Creates a new Empty instance using the specified properties. - * @function create - * @memberof google.protobuf.Empty - * @static - * @param {google.protobuf.IEmpty=} [properties] Properties to set - * @returns {google.protobuf.Empty} Empty instance - */ - Empty.create = function create(properties) { - return new Empty(properties); - }; - - /** - * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Empty - * @static - * @param {google.protobuf.IEmpty} message Empty message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Empty.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Empty - * @static - * @param {google.protobuf.IEmpty} message Empty message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Empty.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Empty message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Empty - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Empty} Empty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Empty.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Empty message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Empty - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Empty} Empty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Empty.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Empty message. - * @function verify - * @memberof google.protobuf.Empty - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Empty.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates an Empty message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Empty - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Empty} Empty - */ - Empty.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Empty) - return object; - return new $root.google.protobuf.Empty(); - }; - - /** - * Creates a plain object from an Empty message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Empty - * @static - * @param {google.protobuf.Empty} message Empty - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Empty.toObject = function toObject() { - return {}; - }; - - /** - * Converts this Empty to JSON. - * @function toJSON - * @memberof google.protobuf.Empty - * @instance - * @returns {Object.} JSON object - */ - Empty.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Empty - * @function getTypeUrl - * @memberof google.protobuf.Empty - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Empty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Empty"; - }; - - return Empty; - })(); - - protobuf.Any = (function() { - - /** - * Properties of an Any. - * @memberof google.protobuf - * @interface IAny - * @property {string|null} [type_url] Any type_url - * @property {Uint8Array|null} [value] Any value - */ - - /** - * Constructs a new Any. - * @memberof google.protobuf - * @classdesc Represents an Any. - * @implements IAny - * @constructor - * @param {google.protobuf.IAny=} [properties] Properties to set - */ - function Any(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Any type_url. - * @member {string} type_url - * @memberof google.protobuf.Any - * @instance - */ - Any.prototype.type_url = ""; - - /** - * Any value. - * @member {Uint8Array} value - * @memberof google.protobuf.Any - * @instance - */ - Any.prototype.value = $util.newBuffer([]); - - /** - * Creates a new Any instance using the specified properties. - * @function create - * @memberof google.protobuf.Any - * @static - * @param {google.protobuf.IAny=} [properties] Properties to set - * @returns {google.protobuf.Any} Any instance - */ - Any.create = function create(properties) { - return new Any(properties); - }; - - /** - * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Any - * @static - * @param {google.protobuf.IAny} message Any message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Any.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); - return writer; - }; - - /** - * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Any - * @static - * @param {google.protobuf.IAny} message Any message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Any.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Any message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Any - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Any} Any - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Any.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.type_url = reader.string(); - break; - } - case 2: { - message.value = reader.bytes(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Any message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Any - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Any} Any - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Any.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Any message. - * @function verify - * @memberof google.protobuf.Any - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Any.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.type_url != null && message.hasOwnProperty("type_url")) - if (!$util.isString(message.type_url)) - return "type_url: string expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) - return "value: buffer expected"; - return null; - }; - - /** - * Creates an Any message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Any - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Any} Any - */ - Any.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Any) - return object; - var message = new $root.google.protobuf.Any(); - if (object.type_url != null) - message.type_url = String(object.type_url); - if (object.value != null) - if (typeof object.value === "string") - $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); - else if (object.value.length >= 0) - message.value = object.value; - return message; - }; - - /** - * Creates a plain object from an Any message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Any - * @static - * @param {google.protobuf.Any} message Any - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Any.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.type_url = ""; - if (options.bytes === String) - object.value = ""; - else { - object.value = []; - if (options.bytes !== Array) - object.value = $util.newBuffer(object.value); - } - } - if (message.type_url != null && message.hasOwnProperty("type_url")) - object.type_url = message.type_url; - if (message.value != null && message.hasOwnProperty("value")) - object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; - return object; - }; - - /** - * Converts this Any to JSON. - * @function toJSON - * @memberof google.protobuf.Any - * @instance - * @returns {Object.} JSON object - */ - Any.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Any - * @function getTypeUrl - * @memberof google.protobuf.Any - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Any.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Any"; - }; - - return Any; - })(); - - return protobuf; - })(); - - google.spanner = (function() { - - /** - * Namespace spanner. - * @memberof google - * @namespace - */ - var spanner = {}; - - spanner.v1 = (function() { - - /** - * Namespace v1. - * @memberof google.spanner - * @namespace - */ - var v1 = {}; - - v1.ChangeStreamRecord = (function() { - - /** - * Properties of a ChangeStreamRecord. - * @memberof google.spanner.v1 - * @interface IChangeStreamRecord - * @property {google.spanner.v1.ChangeStreamRecord.IDataChangeRecord|null} [dataChangeRecord] ChangeStreamRecord dataChangeRecord - * @property {google.spanner.v1.ChangeStreamRecord.IHeartbeatRecord|null} [heartbeatRecord] ChangeStreamRecord heartbeatRecord - * @property {google.spanner.v1.ChangeStreamRecord.IPartitionStartRecord|null} [partitionStartRecord] ChangeStreamRecord partitionStartRecord - * @property {google.spanner.v1.ChangeStreamRecord.IPartitionEndRecord|null} [partitionEndRecord] ChangeStreamRecord partitionEndRecord - * @property {google.spanner.v1.ChangeStreamRecord.IPartitionEventRecord|null} [partitionEventRecord] ChangeStreamRecord partitionEventRecord - */ - - /** - * Constructs a new ChangeStreamRecord. - * @memberof google.spanner.v1 - * @classdesc Represents a ChangeStreamRecord. - * @implements IChangeStreamRecord - * @constructor - * @param {google.spanner.v1.IChangeStreamRecord=} [properties] Properties to set - */ - function ChangeStreamRecord(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ChangeStreamRecord dataChangeRecord. - * @member {google.spanner.v1.ChangeStreamRecord.IDataChangeRecord|null|undefined} dataChangeRecord - * @memberof google.spanner.v1.ChangeStreamRecord - * @instance - */ - ChangeStreamRecord.prototype.dataChangeRecord = null; - - /** - * ChangeStreamRecord heartbeatRecord. - * @member {google.spanner.v1.ChangeStreamRecord.IHeartbeatRecord|null|undefined} heartbeatRecord - * @memberof google.spanner.v1.ChangeStreamRecord - * @instance - */ - ChangeStreamRecord.prototype.heartbeatRecord = null; - - /** - * ChangeStreamRecord partitionStartRecord. - * @member {google.spanner.v1.ChangeStreamRecord.IPartitionStartRecord|null|undefined} partitionStartRecord - * @memberof google.spanner.v1.ChangeStreamRecord - * @instance - */ - ChangeStreamRecord.prototype.partitionStartRecord = null; - - /** - * ChangeStreamRecord partitionEndRecord. - * @member {google.spanner.v1.ChangeStreamRecord.IPartitionEndRecord|null|undefined} partitionEndRecord - * @memberof google.spanner.v1.ChangeStreamRecord - * @instance - */ - ChangeStreamRecord.prototype.partitionEndRecord = null; - - /** - * ChangeStreamRecord partitionEventRecord. - * @member {google.spanner.v1.ChangeStreamRecord.IPartitionEventRecord|null|undefined} partitionEventRecord - * @memberof google.spanner.v1.ChangeStreamRecord - * @instance - */ - ChangeStreamRecord.prototype.partitionEventRecord = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * ChangeStreamRecord record. - * @member {"dataChangeRecord"|"heartbeatRecord"|"partitionStartRecord"|"partitionEndRecord"|"partitionEventRecord"|undefined} record - * @memberof google.spanner.v1.ChangeStreamRecord - * @instance - */ - Object.defineProperty(ChangeStreamRecord.prototype, "record", { - get: $util.oneOfGetter($oneOfFields = ["dataChangeRecord", "heartbeatRecord", "partitionStartRecord", "partitionEndRecord", "partitionEventRecord"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new ChangeStreamRecord instance using the specified properties. - * @function create - * @memberof google.spanner.v1.ChangeStreamRecord - * @static - * @param {google.spanner.v1.IChangeStreamRecord=} [properties] Properties to set - * @returns {google.spanner.v1.ChangeStreamRecord} ChangeStreamRecord instance - */ - ChangeStreamRecord.create = function create(properties) { - return new ChangeStreamRecord(properties); - }; - - /** - * Encodes the specified ChangeStreamRecord message. Does not implicitly {@link google.spanner.v1.ChangeStreamRecord.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.ChangeStreamRecord - * @static - * @param {google.spanner.v1.IChangeStreamRecord} message ChangeStreamRecord message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ChangeStreamRecord.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.dataChangeRecord != null && Object.hasOwnProperty.call(message, "dataChangeRecord")) - $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.encode(message.dataChangeRecord, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.heartbeatRecord != null && Object.hasOwnProperty.call(message, "heartbeatRecord")) - $root.google.spanner.v1.ChangeStreamRecord.HeartbeatRecord.encode(message.heartbeatRecord, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.partitionStartRecord != null && Object.hasOwnProperty.call(message, "partitionStartRecord")) - $root.google.spanner.v1.ChangeStreamRecord.PartitionStartRecord.encode(message.partitionStartRecord, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.partitionEndRecord != null && Object.hasOwnProperty.call(message, "partitionEndRecord")) - $root.google.spanner.v1.ChangeStreamRecord.PartitionEndRecord.encode(message.partitionEndRecord, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.partitionEventRecord != null && Object.hasOwnProperty.call(message, "partitionEventRecord")) - $root.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.encode(message.partitionEventRecord, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ChangeStreamRecord message, length delimited. Does not implicitly {@link google.spanner.v1.ChangeStreamRecord.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.ChangeStreamRecord - * @static - * @param {google.spanner.v1.IChangeStreamRecord} message ChangeStreamRecord message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ChangeStreamRecord.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ChangeStreamRecord message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.ChangeStreamRecord - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.ChangeStreamRecord} ChangeStreamRecord - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ChangeStreamRecord.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.ChangeStreamRecord(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.dataChangeRecord = $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.decode(reader, reader.uint32()); - break; - } - case 2: { - message.heartbeatRecord = $root.google.spanner.v1.ChangeStreamRecord.HeartbeatRecord.decode(reader, reader.uint32()); - break; - } - case 3: { - message.partitionStartRecord = $root.google.spanner.v1.ChangeStreamRecord.PartitionStartRecord.decode(reader, reader.uint32()); - break; - } - case 4: { - message.partitionEndRecord = $root.google.spanner.v1.ChangeStreamRecord.PartitionEndRecord.decode(reader, reader.uint32()); - break; - } - case 5: { - message.partitionEventRecord = $root.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ChangeStreamRecord message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.ChangeStreamRecord - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.ChangeStreamRecord} ChangeStreamRecord - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ChangeStreamRecord.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ChangeStreamRecord message. - * @function verify - * @memberof google.spanner.v1.ChangeStreamRecord - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ChangeStreamRecord.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.dataChangeRecord != null && message.hasOwnProperty("dataChangeRecord")) { - properties.record = 1; - { - var error = $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.verify(message.dataChangeRecord); - if (error) - return "dataChangeRecord." + error; - } - } - if (message.heartbeatRecord != null && message.hasOwnProperty("heartbeatRecord")) { - if (properties.record === 1) - return "record: multiple values"; - properties.record = 1; - { - var error = $root.google.spanner.v1.ChangeStreamRecord.HeartbeatRecord.verify(message.heartbeatRecord); - if (error) - return "heartbeatRecord." + error; - } - } - if (message.partitionStartRecord != null && message.hasOwnProperty("partitionStartRecord")) { - if (properties.record === 1) - return "record: multiple values"; - properties.record = 1; - { - var error = $root.google.spanner.v1.ChangeStreamRecord.PartitionStartRecord.verify(message.partitionStartRecord); - if (error) - return "partitionStartRecord." + error; - } - } - if (message.partitionEndRecord != null && message.hasOwnProperty("partitionEndRecord")) { - if (properties.record === 1) - return "record: multiple values"; - properties.record = 1; - { - var error = $root.google.spanner.v1.ChangeStreamRecord.PartitionEndRecord.verify(message.partitionEndRecord); - if (error) - return "partitionEndRecord." + error; - } - } - if (message.partitionEventRecord != null && message.hasOwnProperty("partitionEventRecord")) { - if (properties.record === 1) - return "record: multiple values"; - properties.record = 1; - { - var error = $root.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.verify(message.partitionEventRecord); - if (error) - return "partitionEventRecord." + error; - } - } - return null; - }; - - /** - * Creates a ChangeStreamRecord message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.ChangeStreamRecord - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.ChangeStreamRecord} ChangeStreamRecord - */ - ChangeStreamRecord.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.ChangeStreamRecord) - return object; - var message = new $root.google.spanner.v1.ChangeStreamRecord(); - if (object.dataChangeRecord != null) { - if (typeof object.dataChangeRecord !== "object") - throw TypeError(".google.spanner.v1.ChangeStreamRecord.dataChangeRecord: object expected"); - message.dataChangeRecord = $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.fromObject(object.dataChangeRecord); - } - if (object.heartbeatRecord != null) { - if (typeof object.heartbeatRecord !== "object") - throw TypeError(".google.spanner.v1.ChangeStreamRecord.heartbeatRecord: object expected"); - message.heartbeatRecord = $root.google.spanner.v1.ChangeStreamRecord.HeartbeatRecord.fromObject(object.heartbeatRecord); - } - if (object.partitionStartRecord != null) { - if (typeof object.partitionStartRecord !== "object") - throw TypeError(".google.spanner.v1.ChangeStreamRecord.partitionStartRecord: object expected"); - message.partitionStartRecord = $root.google.spanner.v1.ChangeStreamRecord.PartitionStartRecord.fromObject(object.partitionStartRecord); - } - if (object.partitionEndRecord != null) { - if (typeof object.partitionEndRecord !== "object") - throw TypeError(".google.spanner.v1.ChangeStreamRecord.partitionEndRecord: object expected"); - message.partitionEndRecord = $root.google.spanner.v1.ChangeStreamRecord.PartitionEndRecord.fromObject(object.partitionEndRecord); - } - if (object.partitionEventRecord != null) { - if (typeof object.partitionEventRecord !== "object") - throw TypeError(".google.spanner.v1.ChangeStreamRecord.partitionEventRecord: object expected"); - message.partitionEventRecord = $root.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.fromObject(object.partitionEventRecord); - } - return message; - }; - - /** - * Creates a plain object from a ChangeStreamRecord message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.ChangeStreamRecord - * @static - * @param {google.spanner.v1.ChangeStreamRecord} message ChangeStreamRecord - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ChangeStreamRecord.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.dataChangeRecord != null && message.hasOwnProperty("dataChangeRecord")) { - object.dataChangeRecord = $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.toObject(message.dataChangeRecord, options); - if (options.oneofs) - object.record = "dataChangeRecord"; - } - if (message.heartbeatRecord != null && message.hasOwnProperty("heartbeatRecord")) { - object.heartbeatRecord = $root.google.spanner.v1.ChangeStreamRecord.HeartbeatRecord.toObject(message.heartbeatRecord, options); - if (options.oneofs) - object.record = "heartbeatRecord"; - } - if (message.partitionStartRecord != null && message.hasOwnProperty("partitionStartRecord")) { - object.partitionStartRecord = $root.google.spanner.v1.ChangeStreamRecord.PartitionStartRecord.toObject(message.partitionStartRecord, options); - if (options.oneofs) - object.record = "partitionStartRecord"; - } - if (message.partitionEndRecord != null && message.hasOwnProperty("partitionEndRecord")) { - object.partitionEndRecord = $root.google.spanner.v1.ChangeStreamRecord.PartitionEndRecord.toObject(message.partitionEndRecord, options); - if (options.oneofs) - object.record = "partitionEndRecord"; - } - if (message.partitionEventRecord != null && message.hasOwnProperty("partitionEventRecord")) { - object.partitionEventRecord = $root.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.toObject(message.partitionEventRecord, options); - if (options.oneofs) - object.record = "partitionEventRecord"; - } - return object; - }; - - /** - * Converts this ChangeStreamRecord to JSON. - * @function toJSON - * @memberof google.spanner.v1.ChangeStreamRecord - * @instance - * @returns {Object.} JSON object - */ - ChangeStreamRecord.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ChangeStreamRecord - * @function getTypeUrl - * @memberof google.spanner.v1.ChangeStreamRecord - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ChangeStreamRecord.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.ChangeStreamRecord"; - }; - - ChangeStreamRecord.DataChangeRecord = (function() { - - /** - * Properties of a DataChangeRecord. - * @memberof google.spanner.v1.ChangeStreamRecord - * @interface IDataChangeRecord - * @property {google.protobuf.ITimestamp|null} [commitTimestamp] DataChangeRecord commitTimestamp - * @property {string|null} [recordSequence] DataChangeRecord recordSequence - * @property {string|null} [serverTransactionId] DataChangeRecord serverTransactionId - * @property {boolean|null} [isLastRecordInTransactionInPartition] DataChangeRecord isLastRecordInTransactionInPartition - * @property {string|null} [table] DataChangeRecord table - * @property {Array.|null} [columnMetadata] DataChangeRecord columnMetadata - * @property {Array.|null} [mods] DataChangeRecord mods - * @property {google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType|null} [modType] DataChangeRecord modType - * @property {google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ValueCaptureType|null} [valueCaptureType] DataChangeRecord valueCaptureType - * @property {number|null} [numberOfRecordsInTransaction] DataChangeRecord numberOfRecordsInTransaction - * @property {number|null} [numberOfPartitionsInTransaction] DataChangeRecord numberOfPartitionsInTransaction - * @property {string|null} [transactionTag] DataChangeRecord transactionTag - * @property {boolean|null} [isSystemTransaction] DataChangeRecord isSystemTransaction - */ - - /** - * Constructs a new DataChangeRecord. - * @memberof google.spanner.v1.ChangeStreamRecord - * @classdesc Represents a DataChangeRecord. - * @implements IDataChangeRecord - * @constructor - * @param {google.spanner.v1.ChangeStreamRecord.IDataChangeRecord=} [properties] Properties to set - */ - function DataChangeRecord(properties) { - this.columnMetadata = []; - this.mods = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DataChangeRecord commitTimestamp. - * @member {google.protobuf.ITimestamp|null|undefined} commitTimestamp - * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord - * @instance - */ - DataChangeRecord.prototype.commitTimestamp = null; - - /** - * DataChangeRecord recordSequence. - * @member {string} recordSequence - * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord - * @instance - */ - DataChangeRecord.prototype.recordSequence = ""; - - /** - * DataChangeRecord serverTransactionId. - * @member {string} serverTransactionId - * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord - * @instance - */ - DataChangeRecord.prototype.serverTransactionId = ""; - - /** - * DataChangeRecord isLastRecordInTransactionInPartition. - * @member {boolean} isLastRecordInTransactionInPartition - * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord - * @instance - */ - DataChangeRecord.prototype.isLastRecordInTransactionInPartition = false; - - /** - * DataChangeRecord table. - * @member {string} table - * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord - * @instance - */ - DataChangeRecord.prototype.table = ""; - - /** - * DataChangeRecord columnMetadata. - * @member {Array.} columnMetadata - * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord - * @instance - */ - DataChangeRecord.prototype.columnMetadata = $util.emptyArray; - - /** - * DataChangeRecord mods. - * @member {Array.} mods - * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord - * @instance - */ - DataChangeRecord.prototype.mods = $util.emptyArray; - - /** - * DataChangeRecord modType. - * @member {google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType} modType - * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord - * @instance - */ - DataChangeRecord.prototype.modType = 0; - - /** - * DataChangeRecord valueCaptureType. - * @member {google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ValueCaptureType} valueCaptureType - * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord - * @instance - */ - DataChangeRecord.prototype.valueCaptureType = 0; - - /** - * DataChangeRecord numberOfRecordsInTransaction. - * @member {number} numberOfRecordsInTransaction - * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord - * @instance - */ - DataChangeRecord.prototype.numberOfRecordsInTransaction = 0; - - /** - * DataChangeRecord numberOfPartitionsInTransaction. - * @member {number} numberOfPartitionsInTransaction - * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord - * @instance - */ - DataChangeRecord.prototype.numberOfPartitionsInTransaction = 0; - - /** - * DataChangeRecord transactionTag. - * @member {string} transactionTag - * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord - * @instance - */ - DataChangeRecord.prototype.transactionTag = ""; - - /** - * DataChangeRecord isSystemTransaction. - * @member {boolean} isSystemTransaction - * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord - * @instance - */ - DataChangeRecord.prototype.isSystemTransaction = false; - - /** - * Creates a new DataChangeRecord instance using the specified properties. - * @function create - * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord - * @static - * @param {google.spanner.v1.ChangeStreamRecord.IDataChangeRecord=} [properties] Properties to set - * @returns {google.spanner.v1.ChangeStreamRecord.DataChangeRecord} DataChangeRecord instance - */ - DataChangeRecord.create = function create(properties) { - return new DataChangeRecord(properties); - }; - - /** - * Encodes the specified DataChangeRecord message. Does not implicitly {@link google.spanner.v1.ChangeStreamRecord.DataChangeRecord.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord - * @static - * @param {google.spanner.v1.ChangeStreamRecord.IDataChangeRecord} message DataChangeRecord message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DataChangeRecord.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.commitTimestamp != null && Object.hasOwnProperty.call(message, "commitTimestamp")) - $root.google.protobuf.Timestamp.encode(message.commitTimestamp, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.recordSequence != null && Object.hasOwnProperty.call(message, "recordSequence")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.recordSequence); - if (message.serverTransactionId != null && Object.hasOwnProperty.call(message, "serverTransactionId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.serverTransactionId); - if (message.isLastRecordInTransactionInPartition != null && Object.hasOwnProperty.call(message, "isLastRecordInTransactionInPartition")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.isLastRecordInTransactionInPartition); - if (message.table != null && Object.hasOwnProperty.call(message, "table")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.table); - if (message.columnMetadata != null && message.columnMetadata.length) - for (var i = 0; i < message.columnMetadata.length; ++i) - $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata.encode(message.columnMetadata[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.mods != null && message.mods.length) - for (var i = 0; i < message.mods.length; ++i) - $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod.encode(message.mods[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.modType != null && Object.hasOwnProperty.call(message, "modType")) - writer.uint32(/* id 8, wireType 0 =*/64).int32(message.modType); - if (message.valueCaptureType != null && Object.hasOwnProperty.call(message, "valueCaptureType")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.valueCaptureType); - if (message.numberOfRecordsInTransaction != null && Object.hasOwnProperty.call(message, "numberOfRecordsInTransaction")) - writer.uint32(/* id 10, wireType 0 =*/80).int32(message.numberOfRecordsInTransaction); - if (message.numberOfPartitionsInTransaction != null && Object.hasOwnProperty.call(message, "numberOfPartitionsInTransaction")) - writer.uint32(/* id 11, wireType 0 =*/88).int32(message.numberOfPartitionsInTransaction); - if (message.transactionTag != null && Object.hasOwnProperty.call(message, "transactionTag")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.transactionTag); - if (message.isSystemTransaction != null && Object.hasOwnProperty.call(message, "isSystemTransaction")) - writer.uint32(/* id 13, wireType 0 =*/104).bool(message.isSystemTransaction); - return writer; - }; - - /** - * Encodes the specified DataChangeRecord message, length delimited. Does not implicitly {@link google.spanner.v1.ChangeStreamRecord.DataChangeRecord.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord - * @static - * @param {google.spanner.v1.ChangeStreamRecord.IDataChangeRecord} message DataChangeRecord message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DataChangeRecord.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DataChangeRecord message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.ChangeStreamRecord.DataChangeRecord} DataChangeRecord - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DataChangeRecord.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.commitTimestamp = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 2: { - message.recordSequence = reader.string(); - break; - } - case 3: { - message.serverTransactionId = reader.string(); - break; - } - case 4: { - message.isLastRecordInTransactionInPartition = reader.bool(); - break; - } - case 5: { - message.table = reader.string(); - break; - } - case 6: { - if (!(message.columnMetadata && message.columnMetadata.length)) - message.columnMetadata = []; - message.columnMetadata.push($root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata.decode(reader, reader.uint32())); - break; - } - case 7: { - if (!(message.mods && message.mods.length)) - message.mods = []; - message.mods.push($root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod.decode(reader, reader.uint32())); - break; - } - case 8: { - message.modType = reader.int32(); - break; - } - case 9: { - message.valueCaptureType = reader.int32(); - break; - } - case 10: { - message.numberOfRecordsInTransaction = reader.int32(); - break; - } - case 11: { - message.numberOfPartitionsInTransaction = reader.int32(); - break; - } - case 12: { - message.transactionTag = reader.string(); - break; - } - case 13: { - message.isSystemTransaction = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DataChangeRecord message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.ChangeStreamRecord.DataChangeRecord} DataChangeRecord - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DataChangeRecord.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DataChangeRecord message. - * @function verify - * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DataChangeRecord.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.commitTimestamp != null && message.hasOwnProperty("commitTimestamp")) { - var error = $root.google.protobuf.Timestamp.verify(message.commitTimestamp); - if (error) - return "commitTimestamp." + error; - } - if (message.recordSequence != null && message.hasOwnProperty("recordSequence")) - if (!$util.isString(message.recordSequence)) - return "recordSequence: string expected"; - if (message.serverTransactionId != null && message.hasOwnProperty("serverTransactionId")) - if (!$util.isString(message.serverTransactionId)) - return "serverTransactionId: string expected"; - if (message.isLastRecordInTransactionInPartition != null && message.hasOwnProperty("isLastRecordInTransactionInPartition")) - if (typeof message.isLastRecordInTransactionInPartition !== "boolean") - return "isLastRecordInTransactionInPartition: boolean expected"; - if (message.table != null && message.hasOwnProperty("table")) - if (!$util.isString(message.table)) - return "table: string expected"; - if (message.columnMetadata != null && message.hasOwnProperty("columnMetadata")) { - if (!Array.isArray(message.columnMetadata)) - return "columnMetadata: array expected"; - for (var i = 0; i < message.columnMetadata.length; ++i) { - var error = $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata.verify(message.columnMetadata[i]); - if (error) - return "columnMetadata." + error; - } - } - if (message.mods != null && message.hasOwnProperty("mods")) { - if (!Array.isArray(message.mods)) - return "mods: array expected"; - for (var i = 0; i < message.mods.length; ++i) { - var error = $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod.verify(message.mods[i]); - if (error) - return "mods." + error; - } - } - if (message.modType != null && message.hasOwnProperty("modType")) - switch (message.modType) { - default: - return "modType: enum value expected"; - case 0: - case 10: - case 20: - case 30: - break; - } - if (message.valueCaptureType != null && message.hasOwnProperty("valueCaptureType")) - switch (message.valueCaptureType) { - default: - return "valueCaptureType: enum value expected"; - case 0: - case 10: - case 20: - case 30: - case 40: - break; - } - if (message.numberOfRecordsInTransaction != null && message.hasOwnProperty("numberOfRecordsInTransaction")) - if (!$util.isInteger(message.numberOfRecordsInTransaction)) - return "numberOfRecordsInTransaction: integer expected"; - if (message.numberOfPartitionsInTransaction != null && message.hasOwnProperty("numberOfPartitionsInTransaction")) - if (!$util.isInteger(message.numberOfPartitionsInTransaction)) - return "numberOfPartitionsInTransaction: integer expected"; - if (message.transactionTag != null && message.hasOwnProperty("transactionTag")) - if (!$util.isString(message.transactionTag)) - return "transactionTag: string expected"; - if (message.isSystemTransaction != null && message.hasOwnProperty("isSystemTransaction")) - if (typeof message.isSystemTransaction !== "boolean") - return "isSystemTransaction: boolean expected"; - return null; - }; - - /** - * Creates a DataChangeRecord message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.ChangeStreamRecord.DataChangeRecord} DataChangeRecord - */ - DataChangeRecord.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord) - return object; - var message = new $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord(); - if (object.commitTimestamp != null) { - if (typeof object.commitTimestamp !== "object") - throw TypeError(".google.spanner.v1.ChangeStreamRecord.DataChangeRecord.commitTimestamp: object expected"); - message.commitTimestamp = $root.google.protobuf.Timestamp.fromObject(object.commitTimestamp); - } - if (object.recordSequence != null) - message.recordSequence = String(object.recordSequence); - if (object.serverTransactionId != null) - message.serverTransactionId = String(object.serverTransactionId); - if (object.isLastRecordInTransactionInPartition != null) - message.isLastRecordInTransactionInPartition = Boolean(object.isLastRecordInTransactionInPartition); - if (object.table != null) - message.table = String(object.table); - if (object.columnMetadata) { - if (!Array.isArray(object.columnMetadata)) - throw TypeError(".google.spanner.v1.ChangeStreamRecord.DataChangeRecord.columnMetadata: array expected"); - message.columnMetadata = []; - for (var i = 0; i < object.columnMetadata.length; ++i) { - if (typeof object.columnMetadata[i] !== "object") - throw TypeError(".google.spanner.v1.ChangeStreamRecord.DataChangeRecord.columnMetadata: object expected"); - message.columnMetadata[i] = $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata.fromObject(object.columnMetadata[i]); - } - } - if (object.mods) { - if (!Array.isArray(object.mods)) - throw TypeError(".google.spanner.v1.ChangeStreamRecord.DataChangeRecord.mods: array expected"); - message.mods = []; - for (var i = 0; i < object.mods.length; ++i) { - if (typeof object.mods[i] !== "object") - throw TypeError(".google.spanner.v1.ChangeStreamRecord.DataChangeRecord.mods: object expected"); - message.mods[i] = $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod.fromObject(object.mods[i]); - } - } - switch (object.modType) { - default: - if (typeof object.modType === "number") { - message.modType = object.modType; - break; - } - break; - case "MOD_TYPE_UNSPECIFIED": - case 0: - message.modType = 0; - break; - case "INSERT": - case 10: - message.modType = 10; - break; - case "UPDATE": - case 20: - message.modType = 20; - break; - case "DELETE": - case 30: - message.modType = 30; - break; - } - switch (object.valueCaptureType) { - default: - if (typeof object.valueCaptureType === "number") { - message.valueCaptureType = object.valueCaptureType; - break; - } - break; - case "VALUE_CAPTURE_TYPE_UNSPECIFIED": - case 0: - message.valueCaptureType = 0; - break; - case "OLD_AND_NEW_VALUES": - case 10: - message.valueCaptureType = 10; - break; - case "NEW_VALUES": - case 20: - message.valueCaptureType = 20; - break; - case "NEW_ROW": - case 30: - message.valueCaptureType = 30; - break; - case "NEW_ROW_AND_OLD_VALUES": - case 40: - message.valueCaptureType = 40; - break; - } - if (object.numberOfRecordsInTransaction != null) - message.numberOfRecordsInTransaction = object.numberOfRecordsInTransaction | 0; - if (object.numberOfPartitionsInTransaction != null) - message.numberOfPartitionsInTransaction = object.numberOfPartitionsInTransaction | 0; - if (object.transactionTag != null) - message.transactionTag = String(object.transactionTag); - if (object.isSystemTransaction != null) - message.isSystemTransaction = Boolean(object.isSystemTransaction); - return message; - }; - - /** - * Creates a plain object from a DataChangeRecord message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord - * @static - * @param {google.spanner.v1.ChangeStreamRecord.DataChangeRecord} message DataChangeRecord - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DataChangeRecord.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.columnMetadata = []; - object.mods = []; - } - if (options.defaults) { - object.commitTimestamp = null; - object.recordSequence = ""; - object.serverTransactionId = ""; - object.isLastRecordInTransactionInPartition = false; - object.table = ""; - object.modType = options.enums === String ? "MOD_TYPE_UNSPECIFIED" : 0; - object.valueCaptureType = options.enums === String ? "VALUE_CAPTURE_TYPE_UNSPECIFIED" : 0; - object.numberOfRecordsInTransaction = 0; - object.numberOfPartitionsInTransaction = 0; - object.transactionTag = ""; - object.isSystemTransaction = false; - } - if (message.commitTimestamp != null && message.hasOwnProperty("commitTimestamp")) - object.commitTimestamp = $root.google.protobuf.Timestamp.toObject(message.commitTimestamp, options); - if (message.recordSequence != null && message.hasOwnProperty("recordSequence")) - object.recordSequence = message.recordSequence; - if (message.serverTransactionId != null && message.hasOwnProperty("serverTransactionId")) - object.serverTransactionId = message.serverTransactionId; - if (message.isLastRecordInTransactionInPartition != null && message.hasOwnProperty("isLastRecordInTransactionInPartition")) - object.isLastRecordInTransactionInPartition = message.isLastRecordInTransactionInPartition; - if (message.table != null && message.hasOwnProperty("table")) - object.table = message.table; - if (message.columnMetadata && message.columnMetadata.length) { - object.columnMetadata = []; - for (var j = 0; j < message.columnMetadata.length; ++j) - object.columnMetadata[j] = $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata.toObject(message.columnMetadata[j], options); - } - if (message.mods && message.mods.length) { - object.mods = []; - for (var j = 0; j < message.mods.length; ++j) - object.mods[j] = $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod.toObject(message.mods[j], options); - } - if (message.modType != null && message.hasOwnProperty("modType")) - object.modType = options.enums === String ? $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType[message.modType] === undefined ? message.modType : $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType[message.modType] : message.modType; - if (message.valueCaptureType != null && message.hasOwnProperty("valueCaptureType")) - object.valueCaptureType = options.enums === String ? $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ValueCaptureType[message.valueCaptureType] === undefined ? message.valueCaptureType : $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ValueCaptureType[message.valueCaptureType] : message.valueCaptureType; - if (message.numberOfRecordsInTransaction != null && message.hasOwnProperty("numberOfRecordsInTransaction")) - object.numberOfRecordsInTransaction = message.numberOfRecordsInTransaction; - if (message.numberOfPartitionsInTransaction != null && message.hasOwnProperty("numberOfPartitionsInTransaction")) - object.numberOfPartitionsInTransaction = message.numberOfPartitionsInTransaction; - if (message.transactionTag != null && message.hasOwnProperty("transactionTag")) - object.transactionTag = message.transactionTag; - if (message.isSystemTransaction != null && message.hasOwnProperty("isSystemTransaction")) - object.isSystemTransaction = message.isSystemTransaction; - return object; - }; - - /** - * Converts this DataChangeRecord to JSON. - * @function toJSON - * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord - * @instance - * @returns {Object.} JSON object - */ - DataChangeRecord.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DataChangeRecord - * @function getTypeUrl - * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DataChangeRecord.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.ChangeStreamRecord.DataChangeRecord"; - }; - - DataChangeRecord.ColumnMetadata = (function() { - - /** - * Properties of a ColumnMetadata. - * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord - * @interface IColumnMetadata - * @property {string|null} [name] ColumnMetadata name - * @property {google.spanner.v1.IType|null} [type] ColumnMetadata type - * @property {boolean|null} [isPrimaryKey] ColumnMetadata isPrimaryKey - * @property {number|Long|null} [ordinalPosition] ColumnMetadata ordinalPosition - */ - - /** - * Constructs a new ColumnMetadata. - * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord - * @classdesc Represents a ColumnMetadata. - * @implements IColumnMetadata - * @constructor - * @param {google.spanner.v1.ChangeStreamRecord.DataChangeRecord.IColumnMetadata=} [properties] Properties to set - */ - function ColumnMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ColumnMetadata name. - * @member {string} name - * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata - * @instance - */ - ColumnMetadata.prototype.name = ""; - - /** - * ColumnMetadata type. - * @member {google.spanner.v1.IType|null|undefined} type - * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata - * @instance - */ - ColumnMetadata.prototype.type = null; - - /** - * ColumnMetadata isPrimaryKey. - * @member {boolean} isPrimaryKey - * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata - * @instance - */ - ColumnMetadata.prototype.isPrimaryKey = false; - - /** - * ColumnMetadata ordinalPosition. - * @member {number|Long} ordinalPosition - * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata - * @instance - */ - ColumnMetadata.prototype.ordinalPosition = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Creates a new ColumnMetadata instance using the specified properties. - * @function create - * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata - * @static - * @param {google.spanner.v1.ChangeStreamRecord.DataChangeRecord.IColumnMetadata=} [properties] Properties to set - * @returns {google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata} ColumnMetadata instance - */ - ColumnMetadata.create = function create(properties) { - return new ColumnMetadata(properties); - }; - - /** - * Encodes the specified ColumnMetadata message. Does not implicitly {@link google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata - * @static - * @param {google.spanner.v1.ChangeStreamRecord.DataChangeRecord.IColumnMetadata} message ColumnMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ColumnMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - $root.google.spanner.v1.Type.encode(message.type, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.isPrimaryKey != null && Object.hasOwnProperty.call(message, "isPrimaryKey")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.isPrimaryKey); - if (message.ordinalPosition != null && Object.hasOwnProperty.call(message, "ordinalPosition")) - writer.uint32(/* id 4, wireType 0 =*/32).int64(message.ordinalPosition); - return writer; - }; - - /** - * Encodes the specified ColumnMetadata message, length delimited. Does not implicitly {@link google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata - * @static - * @param {google.spanner.v1.ChangeStreamRecord.DataChangeRecord.IColumnMetadata} message ColumnMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ColumnMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ColumnMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata} ColumnMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ColumnMetadata.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.type = $root.google.spanner.v1.Type.decode(reader, reader.uint32()); - break; - } - case 3: { - message.isPrimaryKey = reader.bool(); - break; - } - case 4: { - message.ordinalPosition = reader.int64(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ColumnMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata} ColumnMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ColumnMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ColumnMetadata message. - * @function verify - * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ColumnMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.type != null && message.hasOwnProperty("type")) { - var error = $root.google.spanner.v1.Type.verify(message.type); - if (error) - return "type." + error; - } - if (message.isPrimaryKey != null && message.hasOwnProperty("isPrimaryKey")) - if (typeof message.isPrimaryKey !== "boolean") - return "isPrimaryKey: boolean expected"; - if (message.ordinalPosition != null && message.hasOwnProperty("ordinalPosition")) - if (!$util.isInteger(message.ordinalPosition) && !(message.ordinalPosition && $util.isInteger(message.ordinalPosition.low) && $util.isInteger(message.ordinalPosition.high))) - return "ordinalPosition: integer|Long expected"; - return null; - }; - - /** - * Creates a ColumnMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata} ColumnMetadata - */ - ColumnMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata) - return object; - var message = new $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata(); - if (object.name != null) - message.name = String(object.name); - if (object.type != null) { - if (typeof object.type !== "object") - throw TypeError(".google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata.type: object expected"); - message.type = $root.google.spanner.v1.Type.fromObject(object.type); - } - if (object.isPrimaryKey != null) - message.isPrimaryKey = Boolean(object.isPrimaryKey); - if (object.ordinalPosition != null) - if ($util.Long) - (message.ordinalPosition = $util.Long.fromValue(object.ordinalPosition)).unsigned = false; - else if (typeof object.ordinalPosition === "string") - message.ordinalPosition = parseInt(object.ordinalPosition, 10); - else if (typeof object.ordinalPosition === "number") - message.ordinalPosition = object.ordinalPosition; - else if (typeof object.ordinalPosition === "object") - message.ordinalPosition = new $util.LongBits(object.ordinalPosition.low >>> 0, object.ordinalPosition.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from a ColumnMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata - * @static - * @param {google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata} message ColumnMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ColumnMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.type = null; - object.isPrimaryKey = false; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.ordinalPosition = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.ordinalPosition = options.longs === String ? "0" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.type != null && message.hasOwnProperty("type")) - object.type = $root.google.spanner.v1.Type.toObject(message.type, options); - if (message.isPrimaryKey != null && message.hasOwnProperty("isPrimaryKey")) - object.isPrimaryKey = message.isPrimaryKey; - if (message.ordinalPosition != null && message.hasOwnProperty("ordinalPosition")) - if (typeof message.ordinalPosition === "number") - object.ordinalPosition = options.longs === String ? String(message.ordinalPosition) : message.ordinalPosition; - else - object.ordinalPosition = options.longs === String ? $util.Long.prototype.toString.call(message.ordinalPosition) : options.longs === Number ? new $util.LongBits(message.ordinalPosition.low >>> 0, message.ordinalPosition.high >>> 0).toNumber() : message.ordinalPosition; - return object; - }; - - /** - * Converts this ColumnMetadata to JSON. - * @function toJSON - * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata - * @instance - * @returns {Object.} JSON object - */ - ColumnMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ColumnMetadata - * @function getTypeUrl - * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ColumnMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata"; - }; - - return ColumnMetadata; - })(); - - DataChangeRecord.ModValue = (function() { - - /** - * Properties of a ModValue. - * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord - * @interface IModValue - * @property {number|null} [columnMetadataIndex] ModValue columnMetadataIndex - * @property {google.protobuf.IValue|null} [value] ModValue value - */ - - /** - * Constructs a new ModValue. - * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord - * @classdesc Represents a ModValue. - * @implements IModValue - * @constructor - * @param {google.spanner.v1.ChangeStreamRecord.DataChangeRecord.IModValue=} [properties] Properties to set - */ - function ModValue(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ModValue columnMetadataIndex. - * @member {number} columnMetadataIndex - * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue - * @instance - */ - ModValue.prototype.columnMetadataIndex = 0; - - /** - * ModValue value. - * @member {google.protobuf.IValue|null|undefined} value - * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue - * @instance - */ - ModValue.prototype.value = null; - - /** - * Creates a new ModValue instance using the specified properties. - * @function create - * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue - * @static - * @param {google.spanner.v1.ChangeStreamRecord.DataChangeRecord.IModValue=} [properties] Properties to set - * @returns {google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue} ModValue instance - */ - ModValue.create = function create(properties) { - return new ModValue(properties); - }; - - /** - * Encodes the specified ModValue message. Does not implicitly {@link google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue - * @static - * @param {google.spanner.v1.ChangeStreamRecord.DataChangeRecord.IModValue} message ModValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ModValue.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.columnMetadataIndex != null && Object.hasOwnProperty.call(message, "columnMetadataIndex")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.columnMetadataIndex); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - $root.google.protobuf.Value.encode(message.value, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ModValue message, length delimited. Does not implicitly {@link google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue - * @static - * @param {google.spanner.v1.ChangeStreamRecord.DataChangeRecord.IModValue} message ModValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ModValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ModValue message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue} ModValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ModValue.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.columnMetadataIndex = reader.int32(); - break; - } - case 2: { - message.value = $root.google.protobuf.Value.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ModValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue} ModValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ModValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ModValue message. - * @function verify - * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ModValue.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.columnMetadataIndex != null && message.hasOwnProperty("columnMetadataIndex")) - if (!$util.isInteger(message.columnMetadataIndex)) - return "columnMetadataIndex: integer expected"; - if (message.value != null && message.hasOwnProperty("value")) { - var error = $root.google.protobuf.Value.verify(message.value); - if (error) - return "value." + error; - } - return null; - }; - - /** - * Creates a ModValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue} ModValue - */ - ModValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue) - return object; - var message = new $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue(); - if (object.columnMetadataIndex != null) - message.columnMetadataIndex = object.columnMetadataIndex | 0; - if (object.value != null) { - if (typeof object.value !== "object") - throw TypeError(".google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue.value: object expected"); - message.value = $root.google.protobuf.Value.fromObject(object.value); - } - return message; - }; - - /** - * Creates a plain object from a ModValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue - * @static - * @param {google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue} message ModValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ModValue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.columnMetadataIndex = 0; - object.value = null; - } - if (message.columnMetadataIndex != null && message.hasOwnProperty("columnMetadataIndex")) - object.columnMetadataIndex = message.columnMetadataIndex; - if (message.value != null && message.hasOwnProperty("value")) - object.value = $root.google.protobuf.Value.toObject(message.value, options); - return object; - }; - - /** - * Converts this ModValue to JSON. - * @function toJSON - * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue - * @instance - * @returns {Object.} JSON object - */ - ModValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ModValue - * @function getTypeUrl - * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ModValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue"; - }; - - return ModValue; - })(); - - DataChangeRecord.Mod = (function() { - - /** - * Properties of a Mod. - * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord - * @interface IMod - * @property {Array.|null} [keys] Mod keys - * @property {Array.|null} [oldValues] Mod oldValues - * @property {Array.|null} [newValues] Mod newValues - */ - - /** - * Constructs a new Mod. - * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord - * @classdesc Represents a Mod. - * @implements IMod - * @constructor - * @param {google.spanner.v1.ChangeStreamRecord.DataChangeRecord.IMod=} [properties] Properties to set - */ - function Mod(properties) { - this.keys = []; - this.oldValues = []; - this.newValues = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Mod keys. - * @member {Array.} keys - * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod - * @instance - */ - Mod.prototype.keys = $util.emptyArray; - - /** - * Mod oldValues. - * @member {Array.} oldValues - * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod - * @instance - */ - Mod.prototype.oldValues = $util.emptyArray; - - /** - * Mod newValues. - * @member {Array.} newValues - * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod - * @instance - */ - Mod.prototype.newValues = $util.emptyArray; - - /** - * Creates a new Mod instance using the specified properties. - * @function create - * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod - * @static - * @param {google.spanner.v1.ChangeStreamRecord.DataChangeRecord.IMod=} [properties] Properties to set - * @returns {google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod} Mod instance - */ - Mod.create = function create(properties) { - return new Mod(properties); - }; - - /** - * Encodes the specified Mod message. Does not implicitly {@link google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod - * @static - * @param {google.spanner.v1.ChangeStreamRecord.DataChangeRecord.IMod} message Mod message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Mod.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.keys != null && message.keys.length) - for (var i = 0; i < message.keys.length; ++i) - $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue.encode(message.keys[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.oldValues != null && message.oldValues.length) - for (var i = 0; i < message.oldValues.length; ++i) - $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue.encode(message.oldValues[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.newValues != null && message.newValues.length) - for (var i = 0; i < message.newValues.length; ++i) - $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue.encode(message.newValues[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Mod message, length delimited. Does not implicitly {@link google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod - * @static - * @param {google.spanner.v1.ChangeStreamRecord.DataChangeRecord.IMod} message Mod message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Mod.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Mod message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod} Mod - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Mod.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.keys && message.keys.length)) - message.keys = []; - message.keys.push($root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue.decode(reader, reader.uint32())); - break; - } - case 2: { - if (!(message.oldValues && message.oldValues.length)) - message.oldValues = []; - message.oldValues.push($root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue.decode(reader, reader.uint32())); - break; - } - case 3: { - if (!(message.newValues && message.newValues.length)) - message.newValues = []; - message.newValues.push($root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Mod message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod} Mod - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Mod.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Mod message. - * @function verify - * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Mod.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.keys != null && message.hasOwnProperty("keys")) { - if (!Array.isArray(message.keys)) - return "keys: array expected"; - for (var i = 0; i < message.keys.length; ++i) { - var error = $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue.verify(message.keys[i]); - if (error) - return "keys." + error; - } - } - if (message.oldValues != null && message.hasOwnProperty("oldValues")) { - if (!Array.isArray(message.oldValues)) - return "oldValues: array expected"; - for (var i = 0; i < message.oldValues.length; ++i) { - var error = $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue.verify(message.oldValues[i]); - if (error) - return "oldValues." + error; - } - } - if (message.newValues != null && message.hasOwnProperty("newValues")) { - if (!Array.isArray(message.newValues)) - return "newValues: array expected"; - for (var i = 0; i < message.newValues.length; ++i) { - var error = $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue.verify(message.newValues[i]); - if (error) - return "newValues." + error; - } - } - return null; - }; - - /** - * Creates a Mod message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod} Mod - */ - Mod.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod) - return object; - var message = new $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod(); - if (object.keys) { - if (!Array.isArray(object.keys)) - throw TypeError(".google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod.keys: array expected"); - message.keys = []; - for (var i = 0; i < object.keys.length; ++i) { - if (typeof object.keys[i] !== "object") - throw TypeError(".google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod.keys: object expected"); - message.keys[i] = $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue.fromObject(object.keys[i]); - } - } - if (object.oldValues) { - if (!Array.isArray(object.oldValues)) - throw TypeError(".google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod.oldValues: array expected"); - message.oldValues = []; - for (var i = 0; i < object.oldValues.length; ++i) { - if (typeof object.oldValues[i] !== "object") - throw TypeError(".google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod.oldValues: object expected"); - message.oldValues[i] = $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue.fromObject(object.oldValues[i]); - } - } - if (object.newValues) { - if (!Array.isArray(object.newValues)) - throw TypeError(".google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod.newValues: array expected"); - message.newValues = []; - for (var i = 0; i < object.newValues.length; ++i) { - if (typeof object.newValues[i] !== "object") - throw TypeError(".google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod.newValues: object expected"); - message.newValues[i] = $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue.fromObject(object.newValues[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a Mod message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod - * @static - * @param {google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod} message Mod - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Mod.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.keys = []; - object.oldValues = []; - object.newValues = []; - } - if (message.keys && message.keys.length) { - object.keys = []; - for (var j = 0; j < message.keys.length; ++j) - object.keys[j] = $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue.toObject(message.keys[j], options); - } - if (message.oldValues && message.oldValues.length) { - object.oldValues = []; - for (var j = 0; j < message.oldValues.length; ++j) - object.oldValues[j] = $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue.toObject(message.oldValues[j], options); - } - if (message.newValues && message.newValues.length) { - object.newValues = []; - for (var j = 0; j < message.newValues.length; ++j) - object.newValues[j] = $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue.toObject(message.newValues[j], options); - } - return object; - }; - - /** - * Converts this Mod to JSON. - * @function toJSON - * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod - * @instance - * @returns {Object.} JSON object - */ - Mod.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Mod - * @function getTypeUrl - * @memberof google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Mod.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod"; - }; - - return Mod; - })(); - - /** - * ModType enum. - * @name google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType - * @enum {number} - * @property {number} MOD_TYPE_UNSPECIFIED=0 MOD_TYPE_UNSPECIFIED value - * @property {number} INSERT=10 INSERT value - * @property {number} UPDATE=20 UPDATE value - * @property {number} DELETE=30 DELETE value - */ - DataChangeRecord.ModType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "MOD_TYPE_UNSPECIFIED"] = 0; - values[valuesById[10] = "INSERT"] = 10; - values[valuesById[20] = "UPDATE"] = 20; - values[valuesById[30] = "DELETE"] = 30; - return values; - })(); - - /** - * ValueCaptureType enum. - * @name google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ValueCaptureType - * @enum {number} - * @property {number} VALUE_CAPTURE_TYPE_UNSPECIFIED=0 VALUE_CAPTURE_TYPE_UNSPECIFIED value - * @property {number} OLD_AND_NEW_VALUES=10 OLD_AND_NEW_VALUES value - * @property {number} NEW_VALUES=20 NEW_VALUES value - * @property {number} NEW_ROW=30 NEW_ROW value - * @property {number} NEW_ROW_AND_OLD_VALUES=40 NEW_ROW_AND_OLD_VALUES value - */ - DataChangeRecord.ValueCaptureType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "VALUE_CAPTURE_TYPE_UNSPECIFIED"] = 0; - values[valuesById[10] = "OLD_AND_NEW_VALUES"] = 10; - values[valuesById[20] = "NEW_VALUES"] = 20; - values[valuesById[30] = "NEW_ROW"] = 30; - values[valuesById[40] = "NEW_ROW_AND_OLD_VALUES"] = 40; - return values; - })(); - - return DataChangeRecord; - })(); - - ChangeStreamRecord.HeartbeatRecord = (function() { - - /** - * Properties of a HeartbeatRecord. - * @memberof google.spanner.v1.ChangeStreamRecord - * @interface IHeartbeatRecord - * @property {google.protobuf.ITimestamp|null} [timestamp] HeartbeatRecord timestamp - */ - - /** - * Constructs a new HeartbeatRecord. - * @memberof google.spanner.v1.ChangeStreamRecord - * @classdesc Represents a HeartbeatRecord. - * @implements IHeartbeatRecord - * @constructor - * @param {google.spanner.v1.ChangeStreamRecord.IHeartbeatRecord=} [properties] Properties to set - */ - function HeartbeatRecord(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * HeartbeatRecord timestamp. - * @member {google.protobuf.ITimestamp|null|undefined} timestamp - * @memberof google.spanner.v1.ChangeStreamRecord.HeartbeatRecord - * @instance - */ - HeartbeatRecord.prototype.timestamp = null; - - /** - * Creates a new HeartbeatRecord instance using the specified properties. - * @function create - * @memberof google.spanner.v1.ChangeStreamRecord.HeartbeatRecord - * @static - * @param {google.spanner.v1.ChangeStreamRecord.IHeartbeatRecord=} [properties] Properties to set - * @returns {google.spanner.v1.ChangeStreamRecord.HeartbeatRecord} HeartbeatRecord instance - */ - HeartbeatRecord.create = function create(properties) { - return new HeartbeatRecord(properties); - }; - - /** - * Encodes the specified HeartbeatRecord message. Does not implicitly {@link google.spanner.v1.ChangeStreamRecord.HeartbeatRecord.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.ChangeStreamRecord.HeartbeatRecord - * @static - * @param {google.spanner.v1.ChangeStreamRecord.IHeartbeatRecord} message HeartbeatRecord message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HeartbeatRecord.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) - $root.google.protobuf.Timestamp.encode(message.timestamp, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified HeartbeatRecord message, length delimited. Does not implicitly {@link google.spanner.v1.ChangeStreamRecord.HeartbeatRecord.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.ChangeStreamRecord.HeartbeatRecord - * @static - * @param {google.spanner.v1.ChangeStreamRecord.IHeartbeatRecord} message HeartbeatRecord message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HeartbeatRecord.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a HeartbeatRecord message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.ChangeStreamRecord.HeartbeatRecord - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.ChangeStreamRecord.HeartbeatRecord} HeartbeatRecord - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HeartbeatRecord.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.ChangeStreamRecord.HeartbeatRecord(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.timestamp = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a HeartbeatRecord message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.ChangeStreamRecord.HeartbeatRecord - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.ChangeStreamRecord.HeartbeatRecord} HeartbeatRecord - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HeartbeatRecord.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a HeartbeatRecord message. - * @function verify - * @memberof google.spanner.v1.ChangeStreamRecord.HeartbeatRecord - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - HeartbeatRecord.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.timestamp != null && message.hasOwnProperty("timestamp")) { - var error = $root.google.protobuf.Timestamp.verify(message.timestamp); - if (error) - return "timestamp." + error; - } - return null; - }; - - /** - * Creates a HeartbeatRecord message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.ChangeStreamRecord.HeartbeatRecord - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.ChangeStreamRecord.HeartbeatRecord} HeartbeatRecord - */ - HeartbeatRecord.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.ChangeStreamRecord.HeartbeatRecord) - return object; - var message = new $root.google.spanner.v1.ChangeStreamRecord.HeartbeatRecord(); - if (object.timestamp != null) { - if (typeof object.timestamp !== "object") - throw TypeError(".google.spanner.v1.ChangeStreamRecord.HeartbeatRecord.timestamp: object expected"); - message.timestamp = $root.google.protobuf.Timestamp.fromObject(object.timestamp); - } - return message; - }; - - /** - * Creates a plain object from a HeartbeatRecord message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.ChangeStreamRecord.HeartbeatRecord - * @static - * @param {google.spanner.v1.ChangeStreamRecord.HeartbeatRecord} message HeartbeatRecord - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - HeartbeatRecord.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.timestamp = null; - if (message.timestamp != null && message.hasOwnProperty("timestamp")) - object.timestamp = $root.google.protobuf.Timestamp.toObject(message.timestamp, options); - return object; - }; - - /** - * Converts this HeartbeatRecord to JSON. - * @function toJSON - * @memberof google.spanner.v1.ChangeStreamRecord.HeartbeatRecord - * @instance - * @returns {Object.} JSON object - */ - HeartbeatRecord.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for HeartbeatRecord - * @function getTypeUrl - * @memberof google.spanner.v1.ChangeStreamRecord.HeartbeatRecord - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - HeartbeatRecord.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.ChangeStreamRecord.HeartbeatRecord"; - }; - - return HeartbeatRecord; - })(); - - ChangeStreamRecord.PartitionStartRecord = (function() { - - /** - * Properties of a PartitionStartRecord. - * @memberof google.spanner.v1.ChangeStreamRecord - * @interface IPartitionStartRecord - * @property {google.protobuf.ITimestamp|null} [startTimestamp] PartitionStartRecord startTimestamp - * @property {string|null} [recordSequence] PartitionStartRecord recordSequence - * @property {Array.|null} [partitionTokens] PartitionStartRecord partitionTokens - */ - - /** - * Constructs a new PartitionStartRecord. - * @memberof google.spanner.v1.ChangeStreamRecord - * @classdesc Represents a PartitionStartRecord. - * @implements IPartitionStartRecord - * @constructor - * @param {google.spanner.v1.ChangeStreamRecord.IPartitionStartRecord=} [properties] Properties to set - */ - function PartitionStartRecord(properties) { - this.partitionTokens = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PartitionStartRecord startTimestamp. - * @member {google.protobuf.ITimestamp|null|undefined} startTimestamp - * @memberof google.spanner.v1.ChangeStreamRecord.PartitionStartRecord - * @instance - */ - PartitionStartRecord.prototype.startTimestamp = null; - - /** - * PartitionStartRecord recordSequence. - * @member {string} recordSequence - * @memberof google.spanner.v1.ChangeStreamRecord.PartitionStartRecord - * @instance - */ - PartitionStartRecord.prototype.recordSequence = ""; - - /** - * PartitionStartRecord partitionTokens. - * @member {Array.} partitionTokens - * @memberof google.spanner.v1.ChangeStreamRecord.PartitionStartRecord - * @instance - */ - PartitionStartRecord.prototype.partitionTokens = $util.emptyArray; - - /** - * Creates a new PartitionStartRecord instance using the specified properties. - * @function create - * @memberof google.spanner.v1.ChangeStreamRecord.PartitionStartRecord - * @static - * @param {google.spanner.v1.ChangeStreamRecord.IPartitionStartRecord=} [properties] Properties to set - * @returns {google.spanner.v1.ChangeStreamRecord.PartitionStartRecord} PartitionStartRecord instance - */ - PartitionStartRecord.create = function create(properties) { - return new PartitionStartRecord(properties); - }; - - /** - * Encodes the specified PartitionStartRecord message. Does not implicitly {@link google.spanner.v1.ChangeStreamRecord.PartitionStartRecord.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.ChangeStreamRecord.PartitionStartRecord - * @static - * @param {google.spanner.v1.ChangeStreamRecord.IPartitionStartRecord} message PartitionStartRecord message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PartitionStartRecord.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.startTimestamp != null && Object.hasOwnProperty.call(message, "startTimestamp")) - $root.google.protobuf.Timestamp.encode(message.startTimestamp, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.recordSequence != null && Object.hasOwnProperty.call(message, "recordSequence")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.recordSequence); - if (message.partitionTokens != null && message.partitionTokens.length) - for (var i = 0; i < message.partitionTokens.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.partitionTokens[i]); - return writer; - }; - - /** - * Encodes the specified PartitionStartRecord message, length delimited. Does not implicitly {@link google.spanner.v1.ChangeStreamRecord.PartitionStartRecord.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.ChangeStreamRecord.PartitionStartRecord - * @static - * @param {google.spanner.v1.ChangeStreamRecord.IPartitionStartRecord} message PartitionStartRecord message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PartitionStartRecord.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PartitionStartRecord message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.ChangeStreamRecord.PartitionStartRecord - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.ChangeStreamRecord.PartitionStartRecord} PartitionStartRecord - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PartitionStartRecord.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.ChangeStreamRecord.PartitionStartRecord(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.startTimestamp = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 2: { - message.recordSequence = reader.string(); - break; - } - case 3: { - if (!(message.partitionTokens && message.partitionTokens.length)) - message.partitionTokens = []; - message.partitionTokens.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PartitionStartRecord message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.ChangeStreamRecord.PartitionStartRecord - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.ChangeStreamRecord.PartitionStartRecord} PartitionStartRecord - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PartitionStartRecord.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PartitionStartRecord message. - * @function verify - * @memberof google.spanner.v1.ChangeStreamRecord.PartitionStartRecord - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PartitionStartRecord.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.startTimestamp != null && message.hasOwnProperty("startTimestamp")) { - var error = $root.google.protobuf.Timestamp.verify(message.startTimestamp); - if (error) - return "startTimestamp." + error; - } - if (message.recordSequence != null && message.hasOwnProperty("recordSequence")) - if (!$util.isString(message.recordSequence)) - return "recordSequence: string expected"; - if (message.partitionTokens != null && message.hasOwnProperty("partitionTokens")) { - if (!Array.isArray(message.partitionTokens)) - return "partitionTokens: array expected"; - for (var i = 0; i < message.partitionTokens.length; ++i) - if (!$util.isString(message.partitionTokens[i])) - return "partitionTokens: string[] expected"; - } - return null; - }; - - /** - * Creates a PartitionStartRecord message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.ChangeStreamRecord.PartitionStartRecord - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.ChangeStreamRecord.PartitionStartRecord} PartitionStartRecord - */ - PartitionStartRecord.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.ChangeStreamRecord.PartitionStartRecord) - return object; - var message = new $root.google.spanner.v1.ChangeStreamRecord.PartitionStartRecord(); - if (object.startTimestamp != null) { - if (typeof object.startTimestamp !== "object") - throw TypeError(".google.spanner.v1.ChangeStreamRecord.PartitionStartRecord.startTimestamp: object expected"); - message.startTimestamp = $root.google.protobuf.Timestamp.fromObject(object.startTimestamp); - } - if (object.recordSequence != null) - message.recordSequence = String(object.recordSequence); - if (object.partitionTokens) { - if (!Array.isArray(object.partitionTokens)) - throw TypeError(".google.spanner.v1.ChangeStreamRecord.PartitionStartRecord.partitionTokens: array expected"); - message.partitionTokens = []; - for (var i = 0; i < object.partitionTokens.length; ++i) - message.partitionTokens[i] = String(object.partitionTokens[i]); - } - return message; - }; - - /** - * Creates a plain object from a PartitionStartRecord message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.ChangeStreamRecord.PartitionStartRecord - * @static - * @param {google.spanner.v1.ChangeStreamRecord.PartitionStartRecord} message PartitionStartRecord - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PartitionStartRecord.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.partitionTokens = []; - if (options.defaults) { - object.startTimestamp = null; - object.recordSequence = ""; - } - if (message.startTimestamp != null && message.hasOwnProperty("startTimestamp")) - object.startTimestamp = $root.google.protobuf.Timestamp.toObject(message.startTimestamp, options); - if (message.recordSequence != null && message.hasOwnProperty("recordSequence")) - object.recordSequence = message.recordSequence; - if (message.partitionTokens && message.partitionTokens.length) { - object.partitionTokens = []; - for (var j = 0; j < message.partitionTokens.length; ++j) - object.partitionTokens[j] = message.partitionTokens[j]; - } - return object; - }; - - /** - * Converts this PartitionStartRecord to JSON. - * @function toJSON - * @memberof google.spanner.v1.ChangeStreamRecord.PartitionStartRecord - * @instance - * @returns {Object.} JSON object - */ - PartitionStartRecord.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PartitionStartRecord - * @function getTypeUrl - * @memberof google.spanner.v1.ChangeStreamRecord.PartitionStartRecord - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PartitionStartRecord.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.ChangeStreamRecord.PartitionStartRecord"; - }; - - return PartitionStartRecord; - })(); - - ChangeStreamRecord.PartitionEndRecord = (function() { - - /** - * Properties of a PartitionEndRecord. - * @memberof google.spanner.v1.ChangeStreamRecord - * @interface IPartitionEndRecord - * @property {google.protobuf.ITimestamp|null} [endTimestamp] PartitionEndRecord endTimestamp - * @property {string|null} [recordSequence] PartitionEndRecord recordSequence - * @property {string|null} [partitionToken] PartitionEndRecord partitionToken - */ - - /** - * Constructs a new PartitionEndRecord. - * @memberof google.spanner.v1.ChangeStreamRecord - * @classdesc Represents a PartitionEndRecord. - * @implements IPartitionEndRecord - * @constructor - * @param {google.spanner.v1.ChangeStreamRecord.IPartitionEndRecord=} [properties] Properties to set - */ - function PartitionEndRecord(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PartitionEndRecord endTimestamp. - * @member {google.protobuf.ITimestamp|null|undefined} endTimestamp - * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEndRecord - * @instance - */ - PartitionEndRecord.prototype.endTimestamp = null; - - /** - * PartitionEndRecord recordSequence. - * @member {string} recordSequence - * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEndRecord - * @instance - */ - PartitionEndRecord.prototype.recordSequence = ""; - - /** - * PartitionEndRecord partitionToken. - * @member {string} partitionToken - * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEndRecord - * @instance - */ - PartitionEndRecord.prototype.partitionToken = ""; - - /** - * Creates a new PartitionEndRecord instance using the specified properties. - * @function create - * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEndRecord - * @static - * @param {google.spanner.v1.ChangeStreamRecord.IPartitionEndRecord=} [properties] Properties to set - * @returns {google.spanner.v1.ChangeStreamRecord.PartitionEndRecord} PartitionEndRecord instance - */ - PartitionEndRecord.create = function create(properties) { - return new PartitionEndRecord(properties); - }; - - /** - * Encodes the specified PartitionEndRecord message. Does not implicitly {@link google.spanner.v1.ChangeStreamRecord.PartitionEndRecord.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEndRecord - * @static - * @param {google.spanner.v1.ChangeStreamRecord.IPartitionEndRecord} message PartitionEndRecord message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PartitionEndRecord.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.endTimestamp != null && Object.hasOwnProperty.call(message, "endTimestamp")) - $root.google.protobuf.Timestamp.encode(message.endTimestamp, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.recordSequence != null && Object.hasOwnProperty.call(message, "recordSequence")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.recordSequence); - if (message.partitionToken != null && Object.hasOwnProperty.call(message, "partitionToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.partitionToken); - return writer; - }; - - /** - * Encodes the specified PartitionEndRecord message, length delimited. Does not implicitly {@link google.spanner.v1.ChangeStreamRecord.PartitionEndRecord.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEndRecord - * @static - * @param {google.spanner.v1.ChangeStreamRecord.IPartitionEndRecord} message PartitionEndRecord message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PartitionEndRecord.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PartitionEndRecord message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEndRecord - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.ChangeStreamRecord.PartitionEndRecord} PartitionEndRecord - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PartitionEndRecord.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.ChangeStreamRecord.PartitionEndRecord(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.endTimestamp = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 2: { - message.recordSequence = reader.string(); - break; - } - case 3: { - message.partitionToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PartitionEndRecord message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEndRecord - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.ChangeStreamRecord.PartitionEndRecord} PartitionEndRecord - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PartitionEndRecord.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PartitionEndRecord message. - * @function verify - * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEndRecord - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PartitionEndRecord.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.endTimestamp != null && message.hasOwnProperty("endTimestamp")) { - var error = $root.google.protobuf.Timestamp.verify(message.endTimestamp); - if (error) - return "endTimestamp." + error; - } - if (message.recordSequence != null && message.hasOwnProperty("recordSequence")) - if (!$util.isString(message.recordSequence)) - return "recordSequence: string expected"; - if (message.partitionToken != null && message.hasOwnProperty("partitionToken")) - if (!$util.isString(message.partitionToken)) - return "partitionToken: string expected"; - return null; - }; - - /** - * Creates a PartitionEndRecord message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEndRecord - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.ChangeStreamRecord.PartitionEndRecord} PartitionEndRecord - */ - PartitionEndRecord.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.ChangeStreamRecord.PartitionEndRecord) - return object; - var message = new $root.google.spanner.v1.ChangeStreamRecord.PartitionEndRecord(); - if (object.endTimestamp != null) { - if (typeof object.endTimestamp !== "object") - throw TypeError(".google.spanner.v1.ChangeStreamRecord.PartitionEndRecord.endTimestamp: object expected"); - message.endTimestamp = $root.google.protobuf.Timestamp.fromObject(object.endTimestamp); - } - if (object.recordSequence != null) - message.recordSequence = String(object.recordSequence); - if (object.partitionToken != null) - message.partitionToken = String(object.partitionToken); - return message; - }; - - /** - * Creates a plain object from a PartitionEndRecord message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEndRecord - * @static - * @param {google.spanner.v1.ChangeStreamRecord.PartitionEndRecord} message PartitionEndRecord - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PartitionEndRecord.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.endTimestamp = null; - object.recordSequence = ""; - object.partitionToken = ""; - } - if (message.endTimestamp != null && message.hasOwnProperty("endTimestamp")) - object.endTimestamp = $root.google.protobuf.Timestamp.toObject(message.endTimestamp, options); - if (message.recordSequence != null && message.hasOwnProperty("recordSequence")) - object.recordSequence = message.recordSequence; - if (message.partitionToken != null && message.hasOwnProperty("partitionToken")) - object.partitionToken = message.partitionToken; - return object; - }; - - /** - * Converts this PartitionEndRecord to JSON. - * @function toJSON - * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEndRecord - * @instance - * @returns {Object.} JSON object - */ - PartitionEndRecord.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PartitionEndRecord - * @function getTypeUrl - * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEndRecord - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PartitionEndRecord.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.ChangeStreamRecord.PartitionEndRecord"; - }; - - return PartitionEndRecord; - })(); - - ChangeStreamRecord.PartitionEventRecord = (function() { - - /** - * Properties of a PartitionEventRecord. - * @memberof google.spanner.v1.ChangeStreamRecord - * @interface IPartitionEventRecord - * @property {google.protobuf.ITimestamp|null} [commitTimestamp] PartitionEventRecord commitTimestamp - * @property {string|null} [recordSequence] PartitionEventRecord recordSequence - * @property {string|null} [partitionToken] PartitionEventRecord partitionToken - * @property {Array.|null} [moveInEvents] PartitionEventRecord moveInEvents - * @property {Array.|null} [moveOutEvents] PartitionEventRecord moveOutEvents - */ - - /** - * Constructs a new PartitionEventRecord. - * @memberof google.spanner.v1.ChangeStreamRecord - * @classdesc Represents a PartitionEventRecord. - * @implements IPartitionEventRecord - * @constructor - * @param {google.spanner.v1.ChangeStreamRecord.IPartitionEventRecord=} [properties] Properties to set - */ - function PartitionEventRecord(properties) { - this.moveInEvents = []; - this.moveOutEvents = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PartitionEventRecord commitTimestamp. - * @member {google.protobuf.ITimestamp|null|undefined} commitTimestamp - * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEventRecord - * @instance - */ - PartitionEventRecord.prototype.commitTimestamp = null; - - /** - * PartitionEventRecord recordSequence. - * @member {string} recordSequence - * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEventRecord - * @instance - */ - PartitionEventRecord.prototype.recordSequence = ""; - - /** - * PartitionEventRecord partitionToken. - * @member {string} partitionToken - * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEventRecord - * @instance - */ - PartitionEventRecord.prototype.partitionToken = ""; - - /** - * PartitionEventRecord moveInEvents. - * @member {Array.} moveInEvents - * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEventRecord - * @instance - */ - PartitionEventRecord.prototype.moveInEvents = $util.emptyArray; - - /** - * PartitionEventRecord moveOutEvents. - * @member {Array.} moveOutEvents - * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEventRecord - * @instance - */ - PartitionEventRecord.prototype.moveOutEvents = $util.emptyArray; - - /** - * Creates a new PartitionEventRecord instance using the specified properties. - * @function create - * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEventRecord - * @static - * @param {google.spanner.v1.ChangeStreamRecord.IPartitionEventRecord=} [properties] Properties to set - * @returns {google.spanner.v1.ChangeStreamRecord.PartitionEventRecord} PartitionEventRecord instance - */ - PartitionEventRecord.create = function create(properties) { - return new PartitionEventRecord(properties); - }; - - /** - * Encodes the specified PartitionEventRecord message. Does not implicitly {@link google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEventRecord - * @static - * @param {google.spanner.v1.ChangeStreamRecord.IPartitionEventRecord} message PartitionEventRecord message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PartitionEventRecord.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.commitTimestamp != null && Object.hasOwnProperty.call(message, "commitTimestamp")) - $root.google.protobuf.Timestamp.encode(message.commitTimestamp, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.recordSequence != null && Object.hasOwnProperty.call(message, "recordSequence")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.recordSequence); - if (message.partitionToken != null && Object.hasOwnProperty.call(message, "partitionToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.partitionToken); - if (message.moveInEvents != null && message.moveInEvents.length) - for (var i = 0; i < message.moveInEvents.length; ++i) - $root.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent.encode(message.moveInEvents[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.moveOutEvents != null && message.moveOutEvents.length) - for (var i = 0; i < message.moveOutEvents.length; ++i) - $root.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent.encode(message.moveOutEvents[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified PartitionEventRecord message, length delimited. Does not implicitly {@link google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEventRecord - * @static - * @param {google.spanner.v1.ChangeStreamRecord.IPartitionEventRecord} message PartitionEventRecord message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PartitionEventRecord.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PartitionEventRecord message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEventRecord - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.ChangeStreamRecord.PartitionEventRecord} PartitionEventRecord - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PartitionEventRecord.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.commitTimestamp = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 2: { - message.recordSequence = reader.string(); - break; - } - case 3: { - message.partitionToken = reader.string(); - break; - } - case 4: { - if (!(message.moveInEvents && message.moveInEvents.length)) - message.moveInEvents = []; - message.moveInEvents.push($root.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent.decode(reader, reader.uint32())); - break; - } - case 5: { - if (!(message.moveOutEvents && message.moveOutEvents.length)) - message.moveOutEvents = []; - message.moveOutEvents.push($root.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PartitionEventRecord message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEventRecord - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.ChangeStreamRecord.PartitionEventRecord} PartitionEventRecord - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PartitionEventRecord.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PartitionEventRecord message. - * @function verify - * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEventRecord - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PartitionEventRecord.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.commitTimestamp != null && message.hasOwnProperty("commitTimestamp")) { - var error = $root.google.protobuf.Timestamp.verify(message.commitTimestamp); - if (error) - return "commitTimestamp." + error; - } - if (message.recordSequence != null && message.hasOwnProperty("recordSequence")) - if (!$util.isString(message.recordSequence)) - return "recordSequence: string expected"; - if (message.partitionToken != null && message.hasOwnProperty("partitionToken")) - if (!$util.isString(message.partitionToken)) - return "partitionToken: string expected"; - if (message.moveInEvents != null && message.hasOwnProperty("moveInEvents")) { - if (!Array.isArray(message.moveInEvents)) - return "moveInEvents: array expected"; - for (var i = 0; i < message.moveInEvents.length; ++i) { - var error = $root.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent.verify(message.moveInEvents[i]); - if (error) - return "moveInEvents." + error; - } - } - if (message.moveOutEvents != null && message.hasOwnProperty("moveOutEvents")) { - if (!Array.isArray(message.moveOutEvents)) - return "moveOutEvents: array expected"; - for (var i = 0; i < message.moveOutEvents.length; ++i) { - var error = $root.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent.verify(message.moveOutEvents[i]); - if (error) - return "moveOutEvents." + error; - } - } - return null; - }; - - /** - * Creates a PartitionEventRecord message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEventRecord - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.ChangeStreamRecord.PartitionEventRecord} PartitionEventRecord - */ - PartitionEventRecord.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord) - return object; - var message = new $root.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord(); - if (object.commitTimestamp != null) { - if (typeof object.commitTimestamp !== "object") - throw TypeError(".google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.commitTimestamp: object expected"); - message.commitTimestamp = $root.google.protobuf.Timestamp.fromObject(object.commitTimestamp); - } - if (object.recordSequence != null) - message.recordSequence = String(object.recordSequence); - if (object.partitionToken != null) - message.partitionToken = String(object.partitionToken); - if (object.moveInEvents) { - if (!Array.isArray(object.moveInEvents)) - throw TypeError(".google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.moveInEvents: array expected"); - message.moveInEvents = []; - for (var i = 0; i < object.moveInEvents.length; ++i) { - if (typeof object.moveInEvents[i] !== "object") - throw TypeError(".google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.moveInEvents: object expected"); - message.moveInEvents[i] = $root.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent.fromObject(object.moveInEvents[i]); - } - } - if (object.moveOutEvents) { - if (!Array.isArray(object.moveOutEvents)) - throw TypeError(".google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.moveOutEvents: array expected"); - message.moveOutEvents = []; - for (var i = 0; i < object.moveOutEvents.length; ++i) { - if (typeof object.moveOutEvents[i] !== "object") - throw TypeError(".google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.moveOutEvents: object expected"); - message.moveOutEvents[i] = $root.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent.fromObject(object.moveOutEvents[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a PartitionEventRecord message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEventRecord - * @static - * @param {google.spanner.v1.ChangeStreamRecord.PartitionEventRecord} message PartitionEventRecord - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PartitionEventRecord.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.moveInEvents = []; - object.moveOutEvents = []; - } - if (options.defaults) { - object.commitTimestamp = null; - object.recordSequence = ""; - object.partitionToken = ""; - } - if (message.commitTimestamp != null && message.hasOwnProperty("commitTimestamp")) - object.commitTimestamp = $root.google.protobuf.Timestamp.toObject(message.commitTimestamp, options); - if (message.recordSequence != null && message.hasOwnProperty("recordSequence")) - object.recordSequence = message.recordSequence; - if (message.partitionToken != null && message.hasOwnProperty("partitionToken")) - object.partitionToken = message.partitionToken; - if (message.moveInEvents && message.moveInEvents.length) { - object.moveInEvents = []; - for (var j = 0; j < message.moveInEvents.length; ++j) - object.moveInEvents[j] = $root.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent.toObject(message.moveInEvents[j], options); - } - if (message.moveOutEvents && message.moveOutEvents.length) { - object.moveOutEvents = []; - for (var j = 0; j < message.moveOutEvents.length; ++j) - object.moveOutEvents[j] = $root.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent.toObject(message.moveOutEvents[j], options); - } - return object; - }; - - /** - * Converts this PartitionEventRecord to JSON. - * @function toJSON - * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEventRecord - * @instance - * @returns {Object.} JSON object - */ - PartitionEventRecord.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PartitionEventRecord - * @function getTypeUrl - * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEventRecord - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PartitionEventRecord.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.ChangeStreamRecord.PartitionEventRecord"; - }; - - PartitionEventRecord.MoveInEvent = (function() { - - /** - * Properties of a MoveInEvent. - * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEventRecord - * @interface IMoveInEvent - * @property {string|null} [sourcePartitionToken] MoveInEvent sourcePartitionToken - */ - - /** - * Constructs a new MoveInEvent. - * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEventRecord - * @classdesc Represents a MoveInEvent. - * @implements IMoveInEvent - * @constructor - * @param {google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.IMoveInEvent=} [properties] Properties to set - */ - function MoveInEvent(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MoveInEvent sourcePartitionToken. - * @member {string} sourcePartitionToken - * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent - * @instance - */ - MoveInEvent.prototype.sourcePartitionToken = ""; - - /** - * Creates a new MoveInEvent instance using the specified properties. - * @function create - * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent - * @static - * @param {google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.IMoveInEvent=} [properties] Properties to set - * @returns {google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent} MoveInEvent instance - */ - MoveInEvent.create = function create(properties) { - return new MoveInEvent(properties); - }; - - /** - * Encodes the specified MoveInEvent message. Does not implicitly {@link google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent - * @static - * @param {google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.IMoveInEvent} message MoveInEvent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MoveInEvent.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.sourcePartitionToken != null && Object.hasOwnProperty.call(message, "sourcePartitionToken")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.sourcePartitionToken); - return writer; - }; - - /** - * Encodes the specified MoveInEvent message, length delimited. Does not implicitly {@link google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent - * @static - * @param {google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.IMoveInEvent} message MoveInEvent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MoveInEvent.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MoveInEvent message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent} MoveInEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MoveInEvent.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.sourcePartitionToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MoveInEvent message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent} MoveInEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MoveInEvent.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MoveInEvent message. - * @function verify - * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MoveInEvent.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.sourcePartitionToken != null && message.hasOwnProperty("sourcePartitionToken")) - if (!$util.isString(message.sourcePartitionToken)) - return "sourcePartitionToken: string expected"; - return null; - }; - - /** - * Creates a MoveInEvent message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent} MoveInEvent - */ - MoveInEvent.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent) - return object; - var message = new $root.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent(); - if (object.sourcePartitionToken != null) - message.sourcePartitionToken = String(object.sourcePartitionToken); - return message; - }; - - /** - * Creates a plain object from a MoveInEvent message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent - * @static - * @param {google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent} message MoveInEvent - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MoveInEvent.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.sourcePartitionToken = ""; - if (message.sourcePartitionToken != null && message.hasOwnProperty("sourcePartitionToken")) - object.sourcePartitionToken = message.sourcePartitionToken; - return object; - }; - - /** - * Converts this MoveInEvent to JSON. - * @function toJSON - * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent - * @instance - * @returns {Object.} JSON object - */ - MoveInEvent.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MoveInEvent - * @function getTypeUrl - * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MoveInEvent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent"; - }; - - return MoveInEvent; - })(); - - PartitionEventRecord.MoveOutEvent = (function() { - - /** - * Properties of a MoveOutEvent. - * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEventRecord - * @interface IMoveOutEvent - * @property {string|null} [destinationPartitionToken] MoveOutEvent destinationPartitionToken - */ - - /** - * Constructs a new MoveOutEvent. - * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEventRecord - * @classdesc Represents a MoveOutEvent. - * @implements IMoveOutEvent - * @constructor - * @param {google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.IMoveOutEvent=} [properties] Properties to set - */ - function MoveOutEvent(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MoveOutEvent destinationPartitionToken. - * @member {string} destinationPartitionToken - * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent - * @instance - */ - MoveOutEvent.prototype.destinationPartitionToken = ""; - - /** - * Creates a new MoveOutEvent instance using the specified properties. - * @function create - * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent - * @static - * @param {google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.IMoveOutEvent=} [properties] Properties to set - * @returns {google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent} MoveOutEvent instance - */ - MoveOutEvent.create = function create(properties) { - return new MoveOutEvent(properties); - }; - - /** - * Encodes the specified MoveOutEvent message. Does not implicitly {@link google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent - * @static - * @param {google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.IMoveOutEvent} message MoveOutEvent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MoveOutEvent.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.destinationPartitionToken != null && Object.hasOwnProperty.call(message, "destinationPartitionToken")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.destinationPartitionToken); - return writer; - }; - - /** - * Encodes the specified MoveOutEvent message, length delimited. Does not implicitly {@link google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent - * @static - * @param {google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.IMoveOutEvent} message MoveOutEvent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MoveOutEvent.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MoveOutEvent message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent} MoveOutEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MoveOutEvent.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.destinationPartitionToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MoveOutEvent message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent} MoveOutEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MoveOutEvent.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MoveOutEvent message. - * @function verify - * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MoveOutEvent.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.destinationPartitionToken != null && message.hasOwnProperty("destinationPartitionToken")) - if (!$util.isString(message.destinationPartitionToken)) - return "destinationPartitionToken: string expected"; - return null; - }; - - /** - * Creates a MoveOutEvent message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent} MoveOutEvent - */ - MoveOutEvent.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent) - return object; - var message = new $root.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent(); - if (object.destinationPartitionToken != null) - message.destinationPartitionToken = String(object.destinationPartitionToken); - return message; - }; - - /** - * Creates a plain object from a MoveOutEvent message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent - * @static - * @param {google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent} message MoveOutEvent - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MoveOutEvent.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.destinationPartitionToken = ""; - if (message.destinationPartitionToken != null && message.hasOwnProperty("destinationPartitionToken")) - object.destinationPartitionToken = message.destinationPartitionToken; - return object; - }; - - /** - * Converts this MoveOutEvent to JSON. - * @function toJSON - * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent - * @instance - * @returns {Object.} JSON object - */ - MoveOutEvent.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MoveOutEvent - * @function getTypeUrl - * @memberof google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MoveOutEvent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent"; - }; - - return MoveOutEvent; - })(); - - return PartitionEventRecord; - })(); - - return ChangeStreamRecord; - })(); - - v1.Type = (function() { - - /** - * Properties of a Type. - * @memberof google.spanner.v1 - * @interface IType - * @property {google.spanner.v1.TypeCode|null} [code] Type code - * @property {google.spanner.v1.IType|null} [arrayElementType] Type arrayElementType - * @property {google.spanner.v1.IStructType|null} [structType] Type structType - * @property {google.spanner.v1.TypeAnnotationCode|null} [typeAnnotation] Type typeAnnotation - * @property {string|null} [protoTypeFqn] Type protoTypeFqn - */ - - /** - * Constructs a new Type. - * @memberof google.spanner.v1 - * @classdesc Represents a Type. - * @implements IType - * @constructor - * @param {google.spanner.v1.IType=} [properties] Properties to set - */ - function Type(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Type code. - * @member {google.spanner.v1.TypeCode} code - * @memberof google.spanner.v1.Type - * @instance - */ - Type.prototype.code = 0; - - /** - * Type arrayElementType. - * @member {google.spanner.v1.IType|null|undefined} arrayElementType - * @memberof google.spanner.v1.Type - * @instance - */ - Type.prototype.arrayElementType = null; - - /** - * Type structType. - * @member {google.spanner.v1.IStructType|null|undefined} structType - * @memberof google.spanner.v1.Type - * @instance - */ - Type.prototype.structType = null; - - /** - * Type typeAnnotation. - * @member {google.spanner.v1.TypeAnnotationCode} typeAnnotation - * @memberof google.spanner.v1.Type - * @instance - */ - Type.prototype.typeAnnotation = 0; - - /** - * Type protoTypeFqn. - * @member {string} protoTypeFqn - * @memberof google.spanner.v1.Type - * @instance - */ - Type.prototype.protoTypeFqn = ""; - - /** - * Creates a new Type instance using the specified properties. - * @function create - * @memberof google.spanner.v1.Type - * @static - * @param {google.spanner.v1.IType=} [properties] Properties to set - * @returns {google.spanner.v1.Type} Type instance - */ - Type.create = function create(properties) { - return new Type(properties); - }; - - /** - * Encodes the specified Type message. Does not implicitly {@link google.spanner.v1.Type.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.Type - * @static - * @param {google.spanner.v1.IType} message Type message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Type.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.code != null && Object.hasOwnProperty.call(message, "code")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); - if (message.arrayElementType != null && Object.hasOwnProperty.call(message, "arrayElementType")) - $root.google.spanner.v1.Type.encode(message.arrayElementType, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.structType != null && Object.hasOwnProperty.call(message, "structType")) - $root.google.spanner.v1.StructType.encode(message.structType, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.typeAnnotation != null && Object.hasOwnProperty.call(message, "typeAnnotation")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.typeAnnotation); - if (message.protoTypeFqn != null && Object.hasOwnProperty.call(message, "protoTypeFqn")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.protoTypeFqn); - return writer; - }; - - /** - * Encodes the specified Type message, length delimited. Does not implicitly {@link google.spanner.v1.Type.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.Type - * @static - * @param {google.spanner.v1.IType} message Type message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Type.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Type message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.Type - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.Type} Type - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Type.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.Type(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.code = reader.int32(); - break; - } - case 2: { - message.arrayElementType = $root.google.spanner.v1.Type.decode(reader, reader.uint32()); - break; - } - case 3: { - message.structType = $root.google.spanner.v1.StructType.decode(reader, reader.uint32()); - break; - } - case 4: { - message.typeAnnotation = reader.int32(); - break; - } - case 5: { - message.protoTypeFqn = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Type message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.Type - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.Type} Type - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Type.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Type message. - * @function verify - * @memberof google.spanner.v1.Type - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Type.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.code != null && message.hasOwnProperty("code")) - switch (message.code) { - default: - return "code: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 15: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - case 10: - case 11: - case 13: - case 14: - case 16: - case 17: - break; - } - if (message.arrayElementType != null && message.hasOwnProperty("arrayElementType")) { - var error = $root.google.spanner.v1.Type.verify(message.arrayElementType); - if (error) - return "arrayElementType." + error; - } - if (message.structType != null && message.hasOwnProperty("structType")) { - var error = $root.google.spanner.v1.StructType.verify(message.structType); - if (error) - return "structType." + error; - } - if (message.typeAnnotation != null && message.hasOwnProperty("typeAnnotation")) - switch (message.typeAnnotation) { - default: - return "typeAnnotation: enum value expected"; - case 0: - case 2: - case 3: - case 4: - break; - } - if (message.protoTypeFqn != null && message.hasOwnProperty("protoTypeFqn")) - if (!$util.isString(message.protoTypeFqn)) - return "protoTypeFqn: string expected"; - return null; - }; - - /** - * Creates a Type message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.Type - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.Type} Type - */ - Type.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.Type) - return object; - var message = new $root.google.spanner.v1.Type(); - switch (object.code) { - default: - if (typeof object.code === "number") { - message.code = object.code; - break; - } - break; - case "TYPE_CODE_UNSPECIFIED": - case 0: - message.code = 0; - break; - case "BOOL": - case 1: - message.code = 1; - break; - case "INT64": - case 2: - message.code = 2; - break; - case "FLOAT64": - case 3: - message.code = 3; - break; - case "FLOAT32": - case 15: - message.code = 15; - break; - case "TIMESTAMP": - case 4: - message.code = 4; - break; - case "DATE": - case 5: - message.code = 5; - break; - case "STRING": - case 6: - message.code = 6; - break; - case "BYTES": - case 7: - message.code = 7; - break; - case "ARRAY": - case 8: - message.code = 8; - break; - case "STRUCT": - case 9: - message.code = 9; - break; - case "NUMERIC": - case 10: - message.code = 10; - break; - case "JSON": - case 11: - message.code = 11; - break; - case "PROTO": - case 13: - message.code = 13; - break; - case "ENUM": - case 14: - message.code = 14; - break; - case "INTERVAL": - case 16: - message.code = 16; - break; - case "UUID": - case 17: - message.code = 17; - break; - } - if (object.arrayElementType != null) { - if (typeof object.arrayElementType !== "object") - throw TypeError(".google.spanner.v1.Type.arrayElementType: object expected"); - message.arrayElementType = $root.google.spanner.v1.Type.fromObject(object.arrayElementType); - } - if (object.structType != null) { - if (typeof object.structType !== "object") - throw TypeError(".google.spanner.v1.Type.structType: object expected"); - message.structType = $root.google.spanner.v1.StructType.fromObject(object.structType); - } - switch (object.typeAnnotation) { - default: - if (typeof object.typeAnnotation === "number") { - message.typeAnnotation = object.typeAnnotation; - break; - } - break; - case "TYPE_ANNOTATION_CODE_UNSPECIFIED": - case 0: - message.typeAnnotation = 0; - break; - case "PG_NUMERIC": - case 2: - message.typeAnnotation = 2; - break; - case "PG_JSONB": - case 3: - message.typeAnnotation = 3; - break; - case "PG_OID": - case 4: - message.typeAnnotation = 4; - break; - } - if (object.protoTypeFqn != null) - message.protoTypeFqn = String(object.protoTypeFqn); - return message; - }; - - /** - * Creates a plain object from a Type message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.Type - * @static - * @param {google.spanner.v1.Type} message Type - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Type.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.code = options.enums === String ? "TYPE_CODE_UNSPECIFIED" : 0; - object.arrayElementType = null; - object.structType = null; - object.typeAnnotation = options.enums === String ? "TYPE_ANNOTATION_CODE_UNSPECIFIED" : 0; - object.protoTypeFqn = ""; - } - if (message.code != null && message.hasOwnProperty("code")) - object.code = options.enums === String ? $root.google.spanner.v1.TypeCode[message.code] === undefined ? message.code : $root.google.spanner.v1.TypeCode[message.code] : message.code; - if (message.arrayElementType != null && message.hasOwnProperty("arrayElementType")) - object.arrayElementType = $root.google.spanner.v1.Type.toObject(message.arrayElementType, options); - if (message.structType != null && message.hasOwnProperty("structType")) - object.structType = $root.google.spanner.v1.StructType.toObject(message.structType, options); - if (message.typeAnnotation != null && message.hasOwnProperty("typeAnnotation")) - object.typeAnnotation = options.enums === String ? $root.google.spanner.v1.TypeAnnotationCode[message.typeAnnotation] === undefined ? message.typeAnnotation : $root.google.spanner.v1.TypeAnnotationCode[message.typeAnnotation] : message.typeAnnotation; - if (message.protoTypeFqn != null && message.hasOwnProperty("protoTypeFqn")) - object.protoTypeFqn = message.protoTypeFqn; - return object; - }; - - /** - * Converts this Type to JSON. - * @function toJSON - * @memberof google.spanner.v1.Type - * @instance - * @returns {Object.} JSON object - */ - Type.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Type - * @function getTypeUrl - * @memberof google.spanner.v1.Type - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Type.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.Type"; - }; - - return Type; - })(); - - v1.StructType = (function() { - - /** - * Properties of a StructType. - * @memberof google.spanner.v1 - * @interface IStructType - * @property {Array.|null} [fields] StructType fields - */ - - /** - * Constructs a new StructType. - * @memberof google.spanner.v1 - * @classdesc Represents a StructType. - * @implements IStructType - * @constructor - * @param {google.spanner.v1.IStructType=} [properties] Properties to set - */ - function StructType(properties) { - this.fields = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * StructType fields. - * @member {Array.} fields - * @memberof google.spanner.v1.StructType - * @instance - */ - StructType.prototype.fields = $util.emptyArray; - - /** - * Creates a new StructType instance using the specified properties. - * @function create - * @memberof google.spanner.v1.StructType - * @static - * @param {google.spanner.v1.IStructType=} [properties] Properties to set - * @returns {google.spanner.v1.StructType} StructType instance - */ - StructType.create = function create(properties) { - return new StructType(properties); - }; - - /** - * Encodes the specified StructType message. Does not implicitly {@link google.spanner.v1.StructType.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.StructType - * @static - * @param {google.spanner.v1.IStructType} message StructType message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StructType.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.fields != null && message.fields.length) - for (var i = 0; i < message.fields.length; ++i) - $root.google.spanner.v1.StructType.Field.encode(message.fields[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified StructType message, length delimited. Does not implicitly {@link google.spanner.v1.StructType.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.StructType - * @static - * @param {google.spanner.v1.IStructType} message StructType message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StructType.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a StructType message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.StructType - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.StructType} StructType - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StructType.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.StructType(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.fields && message.fields.length)) - message.fields = []; - message.fields.push($root.google.spanner.v1.StructType.Field.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a StructType message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.StructType - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.StructType} StructType - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StructType.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a StructType message. - * @function verify - * @memberof google.spanner.v1.StructType - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - StructType.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.fields != null && message.hasOwnProperty("fields")) { - if (!Array.isArray(message.fields)) - return "fields: array expected"; - for (var i = 0; i < message.fields.length; ++i) { - var error = $root.google.spanner.v1.StructType.Field.verify(message.fields[i]); - if (error) - return "fields." + error; - } - } - return null; - }; - - /** - * Creates a StructType message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.StructType - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.StructType} StructType - */ - StructType.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.StructType) - return object; - var message = new $root.google.spanner.v1.StructType(); - if (object.fields) { - if (!Array.isArray(object.fields)) - throw TypeError(".google.spanner.v1.StructType.fields: array expected"); - message.fields = []; - for (var i = 0; i < object.fields.length; ++i) { - if (typeof object.fields[i] !== "object") - throw TypeError(".google.spanner.v1.StructType.fields: object expected"); - message.fields[i] = $root.google.spanner.v1.StructType.Field.fromObject(object.fields[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a StructType message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.StructType - * @static - * @param {google.spanner.v1.StructType} message StructType - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - StructType.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.fields = []; - if (message.fields && message.fields.length) { - object.fields = []; - for (var j = 0; j < message.fields.length; ++j) - object.fields[j] = $root.google.spanner.v1.StructType.Field.toObject(message.fields[j], options); - } - return object; - }; - - /** - * Converts this StructType to JSON. - * @function toJSON - * @memberof google.spanner.v1.StructType - * @instance - * @returns {Object.} JSON object - */ - StructType.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for StructType - * @function getTypeUrl - * @memberof google.spanner.v1.StructType - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - StructType.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.StructType"; - }; - - StructType.Field = (function() { - - /** - * Properties of a Field. - * @memberof google.spanner.v1.StructType - * @interface IField - * @property {string|null} [name] Field name - * @property {google.spanner.v1.IType|null} [type] Field type - */ - - /** - * Constructs a new Field. - * @memberof google.spanner.v1.StructType - * @classdesc Represents a Field. - * @implements IField - * @constructor - * @param {google.spanner.v1.StructType.IField=} [properties] Properties to set - */ - function Field(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Field name. - * @member {string} name - * @memberof google.spanner.v1.StructType.Field - * @instance - */ - Field.prototype.name = ""; - - /** - * Field type. - * @member {google.spanner.v1.IType|null|undefined} type - * @memberof google.spanner.v1.StructType.Field - * @instance - */ - Field.prototype.type = null; - - /** - * Creates a new Field instance using the specified properties. - * @function create - * @memberof google.spanner.v1.StructType.Field - * @static - * @param {google.spanner.v1.StructType.IField=} [properties] Properties to set - * @returns {google.spanner.v1.StructType.Field} Field instance - */ - Field.create = function create(properties) { - return new Field(properties); - }; - - /** - * Encodes the specified Field message. Does not implicitly {@link google.spanner.v1.StructType.Field.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.StructType.Field - * @static - * @param {google.spanner.v1.StructType.IField} message Field message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Field.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - $root.google.spanner.v1.Type.encode(message.type, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Field message, length delimited. Does not implicitly {@link google.spanner.v1.StructType.Field.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.StructType.Field - * @static - * @param {google.spanner.v1.StructType.IField} message Field message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Field.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Field message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.StructType.Field - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.StructType.Field} Field - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Field.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.StructType.Field(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.type = $root.google.spanner.v1.Type.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Field message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.StructType.Field - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.StructType.Field} Field - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Field.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Field message. - * @function verify - * @memberof google.spanner.v1.StructType.Field - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Field.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.type != null && message.hasOwnProperty("type")) { - var error = $root.google.spanner.v1.Type.verify(message.type); - if (error) - return "type." + error; - } - return null; - }; - - /** - * Creates a Field message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.StructType.Field - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.StructType.Field} Field - */ - Field.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.StructType.Field) - return object; - var message = new $root.google.spanner.v1.StructType.Field(); - if (object.name != null) - message.name = String(object.name); - if (object.type != null) { - if (typeof object.type !== "object") - throw TypeError(".google.spanner.v1.StructType.Field.type: object expected"); - message.type = $root.google.spanner.v1.Type.fromObject(object.type); - } - return message; - }; - - /** - * Creates a plain object from a Field message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.StructType.Field - * @static - * @param {google.spanner.v1.StructType.Field} message Field - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Field.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.type = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.type != null && message.hasOwnProperty("type")) - object.type = $root.google.spanner.v1.Type.toObject(message.type, options); - return object; - }; - - /** - * Converts this Field to JSON. - * @function toJSON - * @memberof google.spanner.v1.StructType.Field - * @instance - * @returns {Object.} JSON object - */ - Field.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Field - * @function getTypeUrl - * @memberof google.spanner.v1.StructType.Field - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Field.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.StructType.Field"; - }; - - return Field; - })(); - - return StructType; - })(); - - /** - * TypeCode enum. - * @name google.spanner.v1.TypeCode - * @enum {number} - * @property {number} TYPE_CODE_UNSPECIFIED=0 TYPE_CODE_UNSPECIFIED value - * @property {number} BOOL=1 BOOL value - * @property {number} INT64=2 INT64 value - * @property {number} FLOAT64=3 FLOAT64 value - * @property {number} FLOAT32=15 FLOAT32 value - * @property {number} TIMESTAMP=4 TIMESTAMP value - * @property {number} DATE=5 DATE value - * @property {number} STRING=6 STRING value - * @property {number} BYTES=7 BYTES value - * @property {number} ARRAY=8 ARRAY value - * @property {number} STRUCT=9 STRUCT value - * @property {number} NUMERIC=10 NUMERIC value - * @property {number} JSON=11 JSON value - * @property {number} PROTO=13 PROTO value - * @property {number} ENUM=14 ENUM value - * @property {number} INTERVAL=16 INTERVAL value - * @property {number} UUID=17 UUID value - */ - v1.TypeCode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TYPE_CODE_UNSPECIFIED"] = 0; - values[valuesById[1] = "BOOL"] = 1; - values[valuesById[2] = "INT64"] = 2; - values[valuesById[3] = "FLOAT64"] = 3; - values[valuesById[15] = "FLOAT32"] = 15; - values[valuesById[4] = "TIMESTAMP"] = 4; - values[valuesById[5] = "DATE"] = 5; - values[valuesById[6] = "STRING"] = 6; - values[valuesById[7] = "BYTES"] = 7; - values[valuesById[8] = "ARRAY"] = 8; - values[valuesById[9] = "STRUCT"] = 9; - values[valuesById[10] = "NUMERIC"] = 10; - values[valuesById[11] = "JSON"] = 11; - values[valuesById[13] = "PROTO"] = 13; - values[valuesById[14] = "ENUM"] = 14; - values[valuesById[16] = "INTERVAL"] = 16; - values[valuesById[17] = "UUID"] = 17; - return values; - })(); - - /** - * TypeAnnotationCode enum. - * @name google.spanner.v1.TypeAnnotationCode - * @enum {number} - * @property {number} TYPE_ANNOTATION_CODE_UNSPECIFIED=0 TYPE_ANNOTATION_CODE_UNSPECIFIED value - * @property {number} PG_NUMERIC=2 PG_NUMERIC value - * @property {number} PG_JSONB=3 PG_JSONB value - * @property {number} PG_OID=4 PG_OID value - */ - v1.TypeAnnotationCode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TYPE_ANNOTATION_CODE_UNSPECIFIED"] = 0; - values[valuesById[2] = "PG_NUMERIC"] = 2; - values[valuesById[3] = "PG_JSONB"] = 3; - values[valuesById[4] = "PG_OID"] = 4; - return values; - })(); - - v1.CommitResponse = (function() { - - /** - * Properties of a CommitResponse. - * @memberof google.spanner.v1 - * @interface ICommitResponse - * @property {google.protobuf.ITimestamp|null} [commitTimestamp] CommitResponse commitTimestamp - * @property {google.spanner.v1.CommitResponse.ICommitStats|null} [commitStats] CommitResponse commitStats - * @property {google.spanner.v1.IMultiplexedSessionPrecommitToken|null} [precommitToken] CommitResponse precommitToken - * @property {google.protobuf.ITimestamp|null} [snapshotTimestamp] CommitResponse snapshotTimestamp - */ - - /** - * Constructs a new CommitResponse. - * @memberof google.spanner.v1 - * @classdesc Represents a CommitResponse. - * @implements ICommitResponse - * @constructor - * @param {google.spanner.v1.ICommitResponse=} [properties] Properties to set - */ - function CommitResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CommitResponse commitTimestamp. - * @member {google.protobuf.ITimestamp|null|undefined} commitTimestamp - * @memberof google.spanner.v1.CommitResponse - * @instance - */ - CommitResponse.prototype.commitTimestamp = null; - - /** - * CommitResponse commitStats. - * @member {google.spanner.v1.CommitResponse.ICommitStats|null|undefined} commitStats - * @memberof google.spanner.v1.CommitResponse - * @instance - */ - CommitResponse.prototype.commitStats = null; - - /** - * CommitResponse precommitToken. - * @member {google.spanner.v1.IMultiplexedSessionPrecommitToken|null|undefined} precommitToken - * @memberof google.spanner.v1.CommitResponse - * @instance - */ - CommitResponse.prototype.precommitToken = null; - - /** - * CommitResponse snapshotTimestamp. - * @member {google.protobuf.ITimestamp|null|undefined} snapshotTimestamp - * @memberof google.spanner.v1.CommitResponse - * @instance - */ - CommitResponse.prototype.snapshotTimestamp = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * CommitResponse MultiplexedSessionRetry. - * @member {"precommitToken"|undefined} MultiplexedSessionRetry - * @memberof google.spanner.v1.CommitResponse - * @instance - */ - Object.defineProperty(CommitResponse.prototype, "MultiplexedSessionRetry", { - get: $util.oneOfGetter($oneOfFields = ["precommitToken"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new CommitResponse instance using the specified properties. - * @function create - * @memberof google.spanner.v1.CommitResponse - * @static - * @param {google.spanner.v1.ICommitResponse=} [properties] Properties to set - * @returns {google.spanner.v1.CommitResponse} CommitResponse instance - */ - CommitResponse.create = function create(properties) { - return new CommitResponse(properties); - }; - - /** - * Encodes the specified CommitResponse message. Does not implicitly {@link google.spanner.v1.CommitResponse.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.CommitResponse - * @static - * @param {google.spanner.v1.ICommitResponse} message CommitResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CommitResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.commitTimestamp != null && Object.hasOwnProperty.call(message, "commitTimestamp")) - $root.google.protobuf.Timestamp.encode(message.commitTimestamp, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.commitStats != null && Object.hasOwnProperty.call(message, "commitStats")) - $root.google.spanner.v1.CommitResponse.CommitStats.encode(message.commitStats, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.precommitToken != null && Object.hasOwnProperty.call(message, "precommitToken")) - $root.google.spanner.v1.MultiplexedSessionPrecommitToken.encode(message.precommitToken, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.snapshotTimestamp != null && Object.hasOwnProperty.call(message, "snapshotTimestamp")) - $root.google.protobuf.Timestamp.encode(message.snapshotTimestamp, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CommitResponse message, length delimited. Does not implicitly {@link google.spanner.v1.CommitResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.CommitResponse - * @static - * @param {google.spanner.v1.ICommitResponse} message CommitResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CommitResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CommitResponse message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.CommitResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.CommitResponse} CommitResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CommitResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.CommitResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.commitTimestamp = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 2: { - message.commitStats = $root.google.spanner.v1.CommitResponse.CommitStats.decode(reader, reader.uint32()); - break; - } - case 4: { - message.precommitToken = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.decode(reader, reader.uint32()); - break; - } - case 5: { - message.snapshotTimestamp = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CommitResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.CommitResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.CommitResponse} CommitResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CommitResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CommitResponse message. - * @function verify - * @memberof google.spanner.v1.CommitResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CommitResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.commitTimestamp != null && message.hasOwnProperty("commitTimestamp")) { - var error = $root.google.protobuf.Timestamp.verify(message.commitTimestamp); - if (error) - return "commitTimestamp." + error; - } - if (message.commitStats != null && message.hasOwnProperty("commitStats")) { - var error = $root.google.spanner.v1.CommitResponse.CommitStats.verify(message.commitStats); - if (error) - return "commitStats." + error; - } - if (message.precommitToken != null && message.hasOwnProperty("precommitToken")) { - properties.MultiplexedSessionRetry = 1; - { - var error = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.verify(message.precommitToken); - if (error) - return "precommitToken." + error; - } - } - if (message.snapshotTimestamp != null && message.hasOwnProperty("snapshotTimestamp")) { - var error = $root.google.protobuf.Timestamp.verify(message.snapshotTimestamp); - if (error) - return "snapshotTimestamp." + error; - } - return null; - }; - - /** - * Creates a CommitResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.CommitResponse - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.CommitResponse} CommitResponse - */ - CommitResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.CommitResponse) - return object; - var message = new $root.google.spanner.v1.CommitResponse(); - if (object.commitTimestamp != null) { - if (typeof object.commitTimestamp !== "object") - throw TypeError(".google.spanner.v1.CommitResponse.commitTimestamp: object expected"); - message.commitTimestamp = $root.google.protobuf.Timestamp.fromObject(object.commitTimestamp); - } - if (object.commitStats != null) { - if (typeof object.commitStats !== "object") - throw TypeError(".google.spanner.v1.CommitResponse.commitStats: object expected"); - message.commitStats = $root.google.spanner.v1.CommitResponse.CommitStats.fromObject(object.commitStats); - } - if (object.precommitToken != null) { - if (typeof object.precommitToken !== "object") - throw TypeError(".google.spanner.v1.CommitResponse.precommitToken: object expected"); - message.precommitToken = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.fromObject(object.precommitToken); - } - if (object.snapshotTimestamp != null) { - if (typeof object.snapshotTimestamp !== "object") - throw TypeError(".google.spanner.v1.CommitResponse.snapshotTimestamp: object expected"); - message.snapshotTimestamp = $root.google.protobuf.Timestamp.fromObject(object.snapshotTimestamp); - } - return message; - }; - - /** - * Creates a plain object from a CommitResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.CommitResponse - * @static - * @param {google.spanner.v1.CommitResponse} message CommitResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CommitResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.commitTimestamp = null; - object.commitStats = null; - object.snapshotTimestamp = null; - } - if (message.commitTimestamp != null && message.hasOwnProperty("commitTimestamp")) - object.commitTimestamp = $root.google.protobuf.Timestamp.toObject(message.commitTimestamp, options); - if (message.commitStats != null && message.hasOwnProperty("commitStats")) - object.commitStats = $root.google.spanner.v1.CommitResponse.CommitStats.toObject(message.commitStats, options); - if (message.precommitToken != null && message.hasOwnProperty("precommitToken")) { - object.precommitToken = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.toObject(message.precommitToken, options); - if (options.oneofs) - object.MultiplexedSessionRetry = "precommitToken"; - } - if (message.snapshotTimestamp != null && message.hasOwnProperty("snapshotTimestamp")) - object.snapshotTimestamp = $root.google.protobuf.Timestamp.toObject(message.snapshotTimestamp, options); - return object; - }; - - /** - * Converts this CommitResponse to JSON. - * @function toJSON - * @memberof google.spanner.v1.CommitResponse - * @instance - * @returns {Object.} JSON object - */ - CommitResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CommitResponse - * @function getTypeUrl - * @memberof google.spanner.v1.CommitResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CommitResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.CommitResponse"; - }; - - CommitResponse.CommitStats = (function() { - - /** - * Properties of a CommitStats. - * @memberof google.spanner.v1.CommitResponse - * @interface ICommitStats - * @property {number|Long|null} [mutationCount] CommitStats mutationCount - */ - - /** - * Constructs a new CommitStats. - * @memberof google.spanner.v1.CommitResponse - * @classdesc Represents a CommitStats. - * @implements ICommitStats - * @constructor - * @param {google.spanner.v1.CommitResponse.ICommitStats=} [properties] Properties to set - */ - function CommitStats(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CommitStats mutationCount. - * @member {number|Long} mutationCount - * @memberof google.spanner.v1.CommitResponse.CommitStats - * @instance - */ - CommitStats.prototype.mutationCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Creates a new CommitStats instance using the specified properties. - * @function create - * @memberof google.spanner.v1.CommitResponse.CommitStats - * @static - * @param {google.spanner.v1.CommitResponse.ICommitStats=} [properties] Properties to set - * @returns {google.spanner.v1.CommitResponse.CommitStats} CommitStats instance - */ - CommitStats.create = function create(properties) { - return new CommitStats(properties); - }; - - /** - * Encodes the specified CommitStats message. Does not implicitly {@link google.spanner.v1.CommitResponse.CommitStats.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.CommitResponse.CommitStats - * @static - * @param {google.spanner.v1.CommitResponse.ICommitStats} message CommitStats message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CommitStats.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.mutationCount != null && Object.hasOwnProperty.call(message, "mutationCount")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.mutationCount); - return writer; - }; - - /** - * Encodes the specified CommitStats message, length delimited. Does not implicitly {@link google.spanner.v1.CommitResponse.CommitStats.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.CommitResponse.CommitStats - * @static - * @param {google.spanner.v1.CommitResponse.ICommitStats} message CommitStats message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CommitStats.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CommitStats message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.CommitResponse.CommitStats - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.CommitResponse.CommitStats} CommitStats - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CommitStats.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.CommitResponse.CommitStats(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.mutationCount = reader.int64(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CommitStats message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.CommitResponse.CommitStats - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.CommitResponse.CommitStats} CommitStats - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CommitStats.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CommitStats message. - * @function verify - * @memberof google.spanner.v1.CommitResponse.CommitStats - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CommitStats.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.mutationCount != null && message.hasOwnProperty("mutationCount")) - if (!$util.isInteger(message.mutationCount) && !(message.mutationCount && $util.isInteger(message.mutationCount.low) && $util.isInteger(message.mutationCount.high))) - return "mutationCount: integer|Long expected"; - return null; - }; - - /** - * Creates a CommitStats message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.CommitResponse.CommitStats - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.CommitResponse.CommitStats} CommitStats - */ - CommitStats.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.CommitResponse.CommitStats) - return object; - var message = new $root.google.spanner.v1.CommitResponse.CommitStats(); - if (object.mutationCount != null) - if ($util.Long) - (message.mutationCount = $util.Long.fromValue(object.mutationCount)).unsigned = false; - else if (typeof object.mutationCount === "string") - message.mutationCount = parseInt(object.mutationCount, 10); - else if (typeof object.mutationCount === "number") - message.mutationCount = object.mutationCount; - else if (typeof object.mutationCount === "object") - message.mutationCount = new $util.LongBits(object.mutationCount.low >>> 0, object.mutationCount.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from a CommitStats message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.CommitResponse.CommitStats - * @static - * @param {google.spanner.v1.CommitResponse.CommitStats} message CommitStats - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CommitStats.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.mutationCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.mutationCount = options.longs === String ? "0" : 0; - if (message.mutationCount != null && message.hasOwnProperty("mutationCount")) - if (typeof message.mutationCount === "number") - object.mutationCount = options.longs === String ? String(message.mutationCount) : message.mutationCount; - else - object.mutationCount = options.longs === String ? $util.Long.prototype.toString.call(message.mutationCount) : options.longs === Number ? new $util.LongBits(message.mutationCount.low >>> 0, message.mutationCount.high >>> 0).toNumber() : message.mutationCount; - return object; - }; - - /** - * Converts this CommitStats to JSON. - * @function toJSON - * @memberof google.spanner.v1.CommitResponse.CommitStats - * @instance - * @returns {Object.} JSON object - */ - CommitStats.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CommitStats - * @function getTypeUrl - * @memberof google.spanner.v1.CommitResponse.CommitStats - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CommitStats.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.CommitResponse.CommitStats"; - }; - - return CommitStats; - })(); - - return CommitResponse; - })(); - - v1.TransactionOptions = (function() { - - /** - * Properties of a TransactionOptions. - * @memberof google.spanner.v1 - * @interface ITransactionOptions - * @property {google.spanner.v1.TransactionOptions.IReadWrite|null} [readWrite] TransactionOptions readWrite - * @property {google.spanner.v1.TransactionOptions.IPartitionedDml|null} [partitionedDml] TransactionOptions partitionedDml - * @property {google.spanner.v1.TransactionOptions.IReadOnly|null} [readOnly] TransactionOptions readOnly - * @property {boolean|null} [excludeTxnFromChangeStreams] TransactionOptions excludeTxnFromChangeStreams - * @property {google.spanner.v1.TransactionOptions.IsolationLevel|null} [isolationLevel] TransactionOptions isolationLevel - */ - - /** - * Constructs a new TransactionOptions. - * @memberof google.spanner.v1 - * @classdesc Represents a TransactionOptions. - * @implements ITransactionOptions - * @constructor - * @param {google.spanner.v1.ITransactionOptions=} [properties] Properties to set - */ - function TransactionOptions(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TransactionOptions readWrite. - * @member {google.spanner.v1.TransactionOptions.IReadWrite|null|undefined} readWrite - * @memberof google.spanner.v1.TransactionOptions - * @instance - */ - TransactionOptions.prototype.readWrite = null; - - /** - * TransactionOptions partitionedDml. - * @member {google.spanner.v1.TransactionOptions.IPartitionedDml|null|undefined} partitionedDml - * @memberof google.spanner.v1.TransactionOptions - * @instance - */ - TransactionOptions.prototype.partitionedDml = null; - - /** - * TransactionOptions readOnly. - * @member {google.spanner.v1.TransactionOptions.IReadOnly|null|undefined} readOnly - * @memberof google.spanner.v1.TransactionOptions - * @instance - */ - TransactionOptions.prototype.readOnly = null; - - /** - * TransactionOptions excludeTxnFromChangeStreams. - * @member {boolean} excludeTxnFromChangeStreams - * @memberof google.spanner.v1.TransactionOptions - * @instance - */ - TransactionOptions.prototype.excludeTxnFromChangeStreams = false; - - /** - * TransactionOptions isolationLevel. - * @member {google.spanner.v1.TransactionOptions.IsolationLevel} isolationLevel - * @memberof google.spanner.v1.TransactionOptions - * @instance - */ - TransactionOptions.prototype.isolationLevel = 0; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * TransactionOptions mode. - * @member {"readWrite"|"partitionedDml"|"readOnly"|undefined} mode - * @memberof google.spanner.v1.TransactionOptions - * @instance - */ - Object.defineProperty(TransactionOptions.prototype, "mode", { - get: $util.oneOfGetter($oneOfFields = ["readWrite", "partitionedDml", "readOnly"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new TransactionOptions instance using the specified properties. - * @function create - * @memberof google.spanner.v1.TransactionOptions - * @static - * @param {google.spanner.v1.ITransactionOptions=} [properties] Properties to set - * @returns {google.spanner.v1.TransactionOptions} TransactionOptions instance - */ - TransactionOptions.create = function create(properties) { - return new TransactionOptions(properties); - }; - - /** - * Encodes the specified TransactionOptions message. Does not implicitly {@link google.spanner.v1.TransactionOptions.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.TransactionOptions - * @static - * @param {google.spanner.v1.ITransactionOptions} message TransactionOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TransactionOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.readWrite != null && Object.hasOwnProperty.call(message, "readWrite")) - $root.google.spanner.v1.TransactionOptions.ReadWrite.encode(message.readWrite, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.readOnly != null && Object.hasOwnProperty.call(message, "readOnly")) - $root.google.spanner.v1.TransactionOptions.ReadOnly.encode(message.readOnly, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.partitionedDml != null && Object.hasOwnProperty.call(message, "partitionedDml")) - $root.google.spanner.v1.TransactionOptions.PartitionedDml.encode(message.partitionedDml, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.excludeTxnFromChangeStreams != null && Object.hasOwnProperty.call(message, "excludeTxnFromChangeStreams")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.excludeTxnFromChangeStreams); - if (message.isolationLevel != null && Object.hasOwnProperty.call(message, "isolationLevel")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.isolationLevel); - return writer; - }; - - /** - * Encodes the specified TransactionOptions message, length delimited. Does not implicitly {@link google.spanner.v1.TransactionOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.TransactionOptions - * @static - * @param {google.spanner.v1.ITransactionOptions} message TransactionOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TransactionOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TransactionOptions message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.TransactionOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.TransactionOptions} TransactionOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TransactionOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.TransactionOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.readWrite = $root.google.spanner.v1.TransactionOptions.ReadWrite.decode(reader, reader.uint32()); - break; - } - case 3: { - message.partitionedDml = $root.google.spanner.v1.TransactionOptions.PartitionedDml.decode(reader, reader.uint32()); - break; - } - case 2: { - message.readOnly = $root.google.spanner.v1.TransactionOptions.ReadOnly.decode(reader, reader.uint32()); - break; - } - case 5: { - message.excludeTxnFromChangeStreams = reader.bool(); - break; - } - case 6: { - message.isolationLevel = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TransactionOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.TransactionOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.TransactionOptions} TransactionOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TransactionOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TransactionOptions message. - * @function verify - * @memberof google.spanner.v1.TransactionOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TransactionOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.readWrite != null && message.hasOwnProperty("readWrite")) { - properties.mode = 1; - { - var error = $root.google.spanner.v1.TransactionOptions.ReadWrite.verify(message.readWrite); - if (error) - return "readWrite." + error; - } - } - if (message.partitionedDml != null && message.hasOwnProperty("partitionedDml")) { - if (properties.mode === 1) - return "mode: multiple values"; - properties.mode = 1; - { - var error = $root.google.spanner.v1.TransactionOptions.PartitionedDml.verify(message.partitionedDml); - if (error) - return "partitionedDml." + error; - } - } - if (message.readOnly != null && message.hasOwnProperty("readOnly")) { - if (properties.mode === 1) - return "mode: multiple values"; - properties.mode = 1; - { - var error = $root.google.spanner.v1.TransactionOptions.ReadOnly.verify(message.readOnly); - if (error) - return "readOnly." + error; - } - } - if (message.excludeTxnFromChangeStreams != null && message.hasOwnProperty("excludeTxnFromChangeStreams")) - if (typeof message.excludeTxnFromChangeStreams !== "boolean") - return "excludeTxnFromChangeStreams: boolean expected"; - if (message.isolationLevel != null && message.hasOwnProperty("isolationLevel")) - switch (message.isolationLevel) { - default: - return "isolationLevel: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a TransactionOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.TransactionOptions - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.TransactionOptions} TransactionOptions - */ - TransactionOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.TransactionOptions) - return object; - var message = new $root.google.spanner.v1.TransactionOptions(); - if (object.readWrite != null) { - if (typeof object.readWrite !== "object") - throw TypeError(".google.spanner.v1.TransactionOptions.readWrite: object expected"); - message.readWrite = $root.google.spanner.v1.TransactionOptions.ReadWrite.fromObject(object.readWrite); - } - if (object.partitionedDml != null) { - if (typeof object.partitionedDml !== "object") - throw TypeError(".google.spanner.v1.TransactionOptions.partitionedDml: object expected"); - message.partitionedDml = $root.google.spanner.v1.TransactionOptions.PartitionedDml.fromObject(object.partitionedDml); - } - if (object.readOnly != null) { - if (typeof object.readOnly !== "object") - throw TypeError(".google.spanner.v1.TransactionOptions.readOnly: object expected"); - message.readOnly = $root.google.spanner.v1.TransactionOptions.ReadOnly.fromObject(object.readOnly); - } - if (object.excludeTxnFromChangeStreams != null) - message.excludeTxnFromChangeStreams = Boolean(object.excludeTxnFromChangeStreams); - switch (object.isolationLevel) { - default: - if (typeof object.isolationLevel === "number") { - message.isolationLevel = object.isolationLevel; - break; - } - break; - case "ISOLATION_LEVEL_UNSPECIFIED": - case 0: - message.isolationLevel = 0; - break; - case "SERIALIZABLE": - case 1: - message.isolationLevel = 1; - break; - case "REPEATABLE_READ": - case 2: - message.isolationLevel = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a TransactionOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.TransactionOptions - * @static - * @param {google.spanner.v1.TransactionOptions} message TransactionOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TransactionOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.excludeTxnFromChangeStreams = false; - object.isolationLevel = options.enums === String ? "ISOLATION_LEVEL_UNSPECIFIED" : 0; - } - if (message.readWrite != null && message.hasOwnProperty("readWrite")) { - object.readWrite = $root.google.spanner.v1.TransactionOptions.ReadWrite.toObject(message.readWrite, options); - if (options.oneofs) - object.mode = "readWrite"; - } - if (message.readOnly != null && message.hasOwnProperty("readOnly")) { - object.readOnly = $root.google.spanner.v1.TransactionOptions.ReadOnly.toObject(message.readOnly, options); - if (options.oneofs) - object.mode = "readOnly"; - } - if (message.partitionedDml != null && message.hasOwnProperty("partitionedDml")) { - object.partitionedDml = $root.google.spanner.v1.TransactionOptions.PartitionedDml.toObject(message.partitionedDml, options); - if (options.oneofs) - object.mode = "partitionedDml"; - } - if (message.excludeTxnFromChangeStreams != null && message.hasOwnProperty("excludeTxnFromChangeStreams")) - object.excludeTxnFromChangeStreams = message.excludeTxnFromChangeStreams; - if (message.isolationLevel != null && message.hasOwnProperty("isolationLevel")) - object.isolationLevel = options.enums === String ? $root.google.spanner.v1.TransactionOptions.IsolationLevel[message.isolationLevel] === undefined ? message.isolationLevel : $root.google.spanner.v1.TransactionOptions.IsolationLevel[message.isolationLevel] : message.isolationLevel; - return object; - }; - - /** - * Converts this TransactionOptions to JSON. - * @function toJSON - * @memberof google.spanner.v1.TransactionOptions - * @instance - * @returns {Object.} JSON object - */ - TransactionOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TransactionOptions - * @function getTypeUrl - * @memberof google.spanner.v1.TransactionOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TransactionOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.TransactionOptions"; - }; - - TransactionOptions.ReadWrite = (function() { - - /** - * Properties of a ReadWrite. - * @memberof google.spanner.v1.TransactionOptions - * @interface IReadWrite - * @property {google.spanner.v1.TransactionOptions.ReadWrite.ReadLockMode|null} [readLockMode] ReadWrite readLockMode - * @property {Uint8Array|null} [multiplexedSessionPreviousTransactionId] ReadWrite multiplexedSessionPreviousTransactionId - */ - - /** - * Constructs a new ReadWrite. - * @memberof google.spanner.v1.TransactionOptions - * @classdesc Represents a ReadWrite. - * @implements IReadWrite - * @constructor - * @param {google.spanner.v1.TransactionOptions.IReadWrite=} [properties] Properties to set - */ - function ReadWrite(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ReadWrite readLockMode. - * @member {google.spanner.v1.TransactionOptions.ReadWrite.ReadLockMode} readLockMode - * @memberof google.spanner.v1.TransactionOptions.ReadWrite - * @instance - */ - ReadWrite.prototype.readLockMode = 0; - - /** - * ReadWrite multiplexedSessionPreviousTransactionId. - * @member {Uint8Array} multiplexedSessionPreviousTransactionId - * @memberof google.spanner.v1.TransactionOptions.ReadWrite - * @instance - */ - ReadWrite.prototype.multiplexedSessionPreviousTransactionId = $util.newBuffer([]); - - /** - * Creates a new ReadWrite instance using the specified properties. - * @function create - * @memberof google.spanner.v1.TransactionOptions.ReadWrite - * @static - * @param {google.spanner.v1.TransactionOptions.IReadWrite=} [properties] Properties to set - * @returns {google.spanner.v1.TransactionOptions.ReadWrite} ReadWrite instance - */ - ReadWrite.create = function create(properties) { - return new ReadWrite(properties); - }; - - /** - * Encodes the specified ReadWrite message. Does not implicitly {@link google.spanner.v1.TransactionOptions.ReadWrite.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.TransactionOptions.ReadWrite - * @static - * @param {google.spanner.v1.TransactionOptions.IReadWrite} message ReadWrite message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReadWrite.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.readLockMode != null && Object.hasOwnProperty.call(message, "readLockMode")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.readLockMode); - if (message.multiplexedSessionPreviousTransactionId != null && Object.hasOwnProperty.call(message, "multiplexedSessionPreviousTransactionId")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.multiplexedSessionPreviousTransactionId); - return writer; - }; - - /** - * Encodes the specified ReadWrite message, length delimited. Does not implicitly {@link google.spanner.v1.TransactionOptions.ReadWrite.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.TransactionOptions.ReadWrite - * @static - * @param {google.spanner.v1.TransactionOptions.IReadWrite} message ReadWrite message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReadWrite.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ReadWrite message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.TransactionOptions.ReadWrite - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.TransactionOptions.ReadWrite} ReadWrite - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReadWrite.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.TransactionOptions.ReadWrite(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.readLockMode = reader.int32(); - break; - } - case 2: { - message.multiplexedSessionPreviousTransactionId = reader.bytes(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ReadWrite message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.TransactionOptions.ReadWrite - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.TransactionOptions.ReadWrite} ReadWrite - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReadWrite.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ReadWrite message. - * @function verify - * @memberof google.spanner.v1.TransactionOptions.ReadWrite - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ReadWrite.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.readLockMode != null && message.hasOwnProperty("readLockMode")) - switch (message.readLockMode) { - default: - return "readLockMode: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.multiplexedSessionPreviousTransactionId != null && message.hasOwnProperty("multiplexedSessionPreviousTransactionId")) - if (!(message.multiplexedSessionPreviousTransactionId && typeof message.multiplexedSessionPreviousTransactionId.length === "number" || $util.isString(message.multiplexedSessionPreviousTransactionId))) - return "multiplexedSessionPreviousTransactionId: buffer expected"; - return null; - }; - - /** - * Creates a ReadWrite message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.TransactionOptions.ReadWrite - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.TransactionOptions.ReadWrite} ReadWrite - */ - ReadWrite.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.TransactionOptions.ReadWrite) - return object; - var message = new $root.google.spanner.v1.TransactionOptions.ReadWrite(); - switch (object.readLockMode) { - default: - if (typeof object.readLockMode === "number") { - message.readLockMode = object.readLockMode; - break; - } - break; - case "READ_LOCK_MODE_UNSPECIFIED": - case 0: - message.readLockMode = 0; - break; - case "PESSIMISTIC": - case 1: - message.readLockMode = 1; - break; - case "OPTIMISTIC": - case 2: - message.readLockMode = 2; - break; - } - if (object.multiplexedSessionPreviousTransactionId != null) - if (typeof object.multiplexedSessionPreviousTransactionId === "string") - $util.base64.decode(object.multiplexedSessionPreviousTransactionId, message.multiplexedSessionPreviousTransactionId = $util.newBuffer($util.base64.length(object.multiplexedSessionPreviousTransactionId)), 0); - else if (object.multiplexedSessionPreviousTransactionId.length >= 0) - message.multiplexedSessionPreviousTransactionId = object.multiplexedSessionPreviousTransactionId; - return message; - }; - - /** - * Creates a plain object from a ReadWrite message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.TransactionOptions.ReadWrite - * @static - * @param {google.spanner.v1.TransactionOptions.ReadWrite} message ReadWrite - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ReadWrite.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.readLockMode = options.enums === String ? "READ_LOCK_MODE_UNSPECIFIED" : 0; - if (options.bytes === String) - object.multiplexedSessionPreviousTransactionId = ""; - else { - object.multiplexedSessionPreviousTransactionId = []; - if (options.bytes !== Array) - object.multiplexedSessionPreviousTransactionId = $util.newBuffer(object.multiplexedSessionPreviousTransactionId); - } - } - if (message.readLockMode != null && message.hasOwnProperty("readLockMode")) - object.readLockMode = options.enums === String ? $root.google.spanner.v1.TransactionOptions.ReadWrite.ReadLockMode[message.readLockMode] === undefined ? message.readLockMode : $root.google.spanner.v1.TransactionOptions.ReadWrite.ReadLockMode[message.readLockMode] : message.readLockMode; - if (message.multiplexedSessionPreviousTransactionId != null && message.hasOwnProperty("multiplexedSessionPreviousTransactionId")) - object.multiplexedSessionPreviousTransactionId = options.bytes === String ? $util.base64.encode(message.multiplexedSessionPreviousTransactionId, 0, message.multiplexedSessionPreviousTransactionId.length) : options.bytes === Array ? Array.prototype.slice.call(message.multiplexedSessionPreviousTransactionId) : message.multiplexedSessionPreviousTransactionId; - return object; - }; - - /** - * Converts this ReadWrite to JSON. - * @function toJSON - * @memberof google.spanner.v1.TransactionOptions.ReadWrite - * @instance - * @returns {Object.} JSON object - */ - ReadWrite.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ReadWrite - * @function getTypeUrl - * @memberof google.spanner.v1.TransactionOptions.ReadWrite - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ReadWrite.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.TransactionOptions.ReadWrite"; - }; - - /** - * ReadLockMode enum. - * @name google.spanner.v1.TransactionOptions.ReadWrite.ReadLockMode - * @enum {number} - * @property {number} READ_LOCK_MODE_UNSPECIFIED=0 READ_LOCK_MODE_UNSPECIFIED value - * @property {number} PESSIMISTIC=1 PESSIMISTIC value - * @property {number} OPTIMISTIC=2 OPTIMISTIC value - */ - ReadWrite.ReadLockMode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "READ_LOCK_MODE_UNSPECIFIED"] = 0; - values[valuesById[1] = "PESSIMISTIC"] = 1; - values[valuesById[2] = "OPTIMISTIC"] = 2; - return values; - })(); - - return ReadWrite; - })(); - - TransactionOptions.PartitionedDml = (function() { - - /** - * Properties of a PartitionedDml. - * @memberof google.spanner.v1.TransactionOptions - * @interface IPartitionedDml - */ - - /** - * Constructs a new PartitionedDml. - * @memberof google.spanner.v1.TransactionOptions - * @classdesc Represents a PartitionedDml. - * @implements IPartitionedDml - * @constructor - * @param {google.spanner.v1.TransactionOptions.IPartitionedDml=} [properties] Properties to set - */ - function PartitionedDml(properties) { - if (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 PartitionedDml instance using the specified properties. - * @function create - * @memberof google.spanner.v1.TransactionOptions.PartitionedDml - * @static - * @param {google.spanner.v1.TransactionOptions.IPartitionedDml=} [properties] Properties to set - * @returns {google.spanner.v1.TransactionOptions.PartitionedDml} PartitionedDml instance - */ - PartitionedDml.create = function create(properties) { - return new PartitionedDml(properties); - }; - - /** - * Encodes the specified PartitionedDml message. Does not implicitly {@link google.spanner.v1.TransactionOptions.PartitionedDml.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.TransactionOptions.PartitionedDml - * @static - * @param {google.spanner.v1.TransactionOptions.IPartitionedDml} message PartitionedDml message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PartitionedDml.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified PartitionedDml message, length delimited. Does not implicitly {@link google.spanner.v1.TransactionOptions.PartitionedDml.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.TransactionOptions.PartitionedDml - * @static - * @param {google.spanner.v1.TransactionOptions.IPartitionedDml} message PartitionedDml message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PartitionedDml.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PartitionedDml message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.TransactionOptions.PartitionedDml - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.TransactionOptions.PartitionedDml} PartitionedDml - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PartitionedDml.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.TransactionOptions.PartitionedDml(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PartitionedDml message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.TransactionOptions.PartitionedDml - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.TransactionOptions.PartitionedDml} PartitionedDml - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PartitionedDml.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PartitionedDml message. - * @function verify - * @memberof google.spanner.v1.TransactionOptions.PartitionedDml - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PartitionedDml.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a PartitionedDml message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.TransactionOptions.PartitionedDml - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.TransactionOptions.PartitionedDml} PartitionedDml - */ - PartitionedDml.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.TransactionOptions.PartitionedDml) - return object; - return new $root.google.spanner.v1.TransactionOptions.PartitionedDml(); - }; - - /** - * Creates a plain object from a PartitionedDml message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.TransactionOptions.PartitionedDml - * @static - * @param {google.spanner.v1.TransactionOptions.PartitionedDml} message PartitionedDml - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PartitionedDml.toObject = function toObject() { - return {}; - }; - - /** - * Converts this PartitionedDml to JSON. - * @function toJSON - * @memberof google.spanner.v1.TransactionOptions.PartitionedDml - * @instance - * @returns {Object.} JSON object - */ - PartitionedDml.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PartitionedDml - * @function getTypeUrl - * @memberof google.spanner.v1.TransactionOptions.PartitionedDml - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PartitionedDml.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.TransactionOptions.PartitionedDml"; - }; - - return PartitionedDml; - })(); - - TransactionOptions.ReadOnly = (function() { - - /** - * Properties of a ReadOnly. - * @memberof google.spanner.v1.TransactionOptions - * @interface IReadOnly - * @property {boolean|null} [strong] ReadOnly strong - * @property {google.protobuf.ITimestamp|null} [minReadTimestamp] ReadOnly minReadTimestamp - * @property {google.protobuf.IDuration|null} [maxStaleness] ReadOnly maxStaleness - * @property {google.protobuf.ITimestamp|null} [readTimestamp] ReadOnly readTimestamp - * @property {google.protobuf.IDuration|null} [exactStaleness] ReadOnly exactStaleness - * @property {boolean|null} [returnReadTimestamp] ReadOnly returnReadTimestamp - */ - - /** - * Constructs a new ReadOnly. - * @memberof google.spanner.v1.TransactionOptions - * @classdesc Represents a ReadOnly. - * @implements IReadOnly - * @constructor - * @param {google.spanner.v1.TransactionOptions.IReadOnly=} [properties] Properties to set - */ - function ReadOnly(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ReadOnly strong. - * @member {boolean|null|undefined} strong - * @memberof google.spanner.v1.TransactionOptions.ReadOnly - * @instance - */ - ReadOnly.prototype.strong = null; - - /** - * ReadOnly minReadTimestamp. - * @member {google.protobuf.ITimestamp|null|undefined} minReadTimestamp - * @memberof google.spanner.v1.TransactionOptions.ReadOnly - * @instance - */ - ReadOnly.prototype.minReadTimestamp = null; - - /** - * ReadOnly maxStaleness. - * @member {google.protobuf.IDuration|null|undefined} maxStaleness - * @memberof google.spanner.v1.TransactionOptions.ReadOnly - * @instance - */ - ReadOnly.prototype.maxStaleness = null; - - /** - * ReadOnly readTimestamp. - * @member {google.protobuf.ITimestamp|null|undefined} readTimestamp - * @memberof google.spanner.v1.TransactionOptions.ReadOnly - * @instance - */ - ReadOnly.prototype.readTimestamp = null; - - /** - * ReadOnly exactStaleness. - * @member {google.protobuf.IDuration|null|undefined} exactStaleness - * @memberof google.spanner.v1.TransactionOptions.ReadOnly - * @instance - */ - ReadOnly.prototype.exactStaleness = null; - - /** - * ReadOnly returnReadTimestamp. - * @member {boolean} returnReadTimestamp - * @memberof google.spanner.v1.TransactionOptions.ReadOnly - * @instance - */ - ReadOnly.prototype.returnReadTimestamp = false; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * ReadOnly timestampBound. - * @member {"strong"|"minReadTimestamp"|"maxStaleness"|"readTimestamp"|"exactStaleness"|undefined} timestampBound - * @memberof google.spanner.v1.TransactionOptions.ReadOnly - * @instance - */ - Object.defineProperty(ReadOnly.prototype, "timestampBound", { - get: $util.oneOfGetter($oneOfFields = ["strong", "minReadTimestamp", "maxStaleness", "readTimestamp", "exactStaleness"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new ReadOnly instance using the specified properties. - * @function create - * @memberof google.spanner.v1.TransactionOptions.ReadOnly - * @static - * @param {google.spanner.v1.TransactionOptions.IReadOnly=} [properties] Properties to set - * @returns {google.spanner.v1.TransactionOptions.ReadOnly} ReadOnly instance - */ - ReadOnly.create = function create(properties) { - return new ReadOnly(properties); - }; - - /** - * Encodes the specified ReadOnly message. Does not implicitly {@link google.spanner.v1.TransactionOptions.ReadOnly.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.TransactionOptions.ReadOnly - * @static - * @param {google.spanner.v1.TransactionOptions.IReadOnly} message ReadOnly message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReadOnly.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.strong != null && Object.hasOwnProperty.call(message, "strong")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.strong); - if (message.minReadTimestamp != null && Object.hasOwnProperty.call(message, "minReadTimestamp")) - $root.google.protobuf.Timestamp.encode(message.minReadTimestamp, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.maxStaleness != null && Object.hasOwnProperty.call(message, "maxStaleness")) - $root.google.protobuf.Duration.encode(message.maxStaleness, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.readTimestamp != null && Object.hasOwnProperty.call(message, "readTimestamp")) - $root.google.protobuf.Timestamp.encode(message.readTimestamp, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.exactStaleness != null && Object.hasOwnProperty.call(message, "exactStaleness")) - $root.google.protobuf.Duration.encode(message.exactStaleness, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.returnReadTimestamp != null && Object.hasOwnProperty.call(message, "returnReadTimestamp")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.returnReadTimestamp); - return writer; - }; - - /** - * Encodes the specified ReadOnly message, length delimited. Does not implicitly {@link google.spanner.v1.TransactionOptions.ReadOnly.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.TransactionOptions.ReadOnly - * @static - * @param {google.spanner.v1.TransactionOptions.IReadOnly} message ReadOnly message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReadOnly.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ReadOnly message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.TransactionOptions.ReadOnly - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.TransactionOptions.ReadOnly} ReadOnly - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReadOnly.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.TransactionOptions.ReadOnly(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.strong = reader.bool(); - break; - } - case 2: { - message.minReadTimestamp = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 3: { - message.maxStaleness = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 4: { - message.readTimestamp = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 5: { - message.exactStaleness = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 6: { - message.returnReadTimestamp = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ReadOnly message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.TransactionOptions.ReadOnly - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.TransactionOptions.ReadOnly} ReadOnly - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReadOnly.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ReadOnly message. - * @function verify - * @memberof google.spanner.v1.TransactionOptions.ReadOnly - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ReadOnly.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.strong != null && message.hasOwnProperty("strong")) { - properties.timestampBound = 1; - if (typeof message.strong !== "boolean") - return "strong: boolean expected"; - } - if (message.minReadTimestamp != null && message.hasOwnProperty("minReadTimestamp")) { - if (properties.timestampBound === 1) - return "timestampBound: multiple values"; - properties.timestampBound = 1; - { - var error = $root.google.protobuf.Timestamp.verify(message.minReadTimestamp); - if (error) - return "minReadTimestamp." + error; - } - } - if (message.maxStaleness != null && message.hasOwnProperty("maxStaleness")) { - if (properties.timestampBound === 1) - return "timestampBound: multiple values"; - properties.timestampBound = 1; - { - var error = $root.google.protobuf.Duration.verify(message.maxStaleness); - if (error) - return "maxStaleness." + error; - } - } - if (message.readTimestamp != null && message.hasOwnProperty("readTimestamp")) { - if (properties.timestampBound === 1) - return "timestampBound: multiple values"; - properties.timestampBound = 1; - { - var error = $root.google.protobuf.Timestamp.verify(message.readTimestamp); - if (error) - return "readTimestamp." + error; - } - } - if (message.exactStaleness != null && message.hasOwnProperty("exactStaleness")) { - if (properties.timestampBound === 1) - return "timestampBound: multiple values"; - properties.timestampBound = 1; - { - var error = $root.google.protobuf.Duration.verify(message.exactStaleness); - if (error) - return "exactStaleness." + error; - } - } - if (message.returnReadTimestamp != null && message.hasOwnProperty("returnReadTimestamp")) - if (typeof message.returnReadTimestamp !== "boolean") - return "returnReadTimestamp: boolean expected"; - return null; - }; - - /** - * Creates a ReadOnly message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.TransactionOptions.ReadOnly - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.TransactionOptions.ReadOnly} ReadOnly - */ - ReadOnly.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.TransactionOptions.ReadOnly) - return object; - var message = new $root.google.spanner.v1.TransactionOptions.ReadOnly(); - if (object.strong != null) - message.strong = Boolean(object.strong); - if (object.minReadTimestamp != null) { - if (typeof object.minReadTimestamp !== "object") - throw TypeError(".google.spanner.v1.TransactionOptions.ReadOnly.minReadTimestamp: object expected"); - message.minReadTimestamp = $root.google.protobuf.Timestamp.fromObject(object.minReadTimestamp); - } - if (object.maxStaleness != null) { - if (typeof object.maxStaleness !== "object") - throw TypeError(".google.spanner.v1.TransactionOptions.ReadOnly.maxStaleness: object expected"); - message.maxStaleness = $root.google.protobuf.Duration.fromObject(object.maxStaleness); - } - if (object.readTimestamp != null) { - if (typeof object.readTimestamp !== "object") - throw TypeError(".google.spanner.v1.TransactionOptions.ReadOnly.readTimestamp: object expected"); - message.readTimestamp = $root.google.protobuf.Timestamp.fromObject(object.readTimestamp); - } - if (object.exactStaleness != null) { - if (typeof object.exactStaleness !== "object") - throw TypeError(".google.spanner.v1.TransactionOptions.ReadOnly.exactStaleness: object expected"); - message.exactStaleness = $root.google.protobuf.Duration.fromObject(object.exactStaleness); - } - if (object.returnReadTimestamp != null) - message.returnReadTimestamp = Boolean(object.returnReadTimestamp); - return message; - }; - - /** - * Creates a plain object from a ReadOnly message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.TransactionOptions.ReadOnly - * @static - * @param {google.spanner.v1.TransactionOptions.ReadOnly} message ReadOnly - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ReadOnly.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.returnReadTimestamp = false; - if (message.strong != null && message.hasOwnProperty("strong")) { - object.strong = message.strong; - if (options.oneofs) - object.timestampBound = "strong"; - } - if (message.minReadTimestamp != null && message.hasOwnProperty("minReadTimestamp")) { - object.minReadTimestamp = $root.google.protobuf.Timestamp.toObject(message.minReadTimestamp, options); - if (options.oneofs) - object.timestampBound = "minReadTimestamp"; - } - if (message.maxStaleness != null && message.hasOwnProperty("maxStaleness")) { - object.maxStaleness = $root.google.protobuf.Duration.toObject(message.maxStaleness, options); - if (options.oneofs) - object.timestampBound = "maxStaleness"; - } - if (message.readTimestamp != null && message.hasOwnProperty("readTimestamp")) { - object.readTimestamp = $root.google.protobuf.Timestamp.toObject(message.readTimestamp, options); - if (options.oneofs) - object.timestampBound = "readTimestamp"; - } - if (message.exactStaleness != null && message.hasOwnProperty("exactStaleness")) { - object.exactStaleness = $root.google.protobuf.Duration.toObject(message.exactStaleness, options); - if (options.oneofs) - object.timestampBound = "exactStaleness"; - } - if (message.returnReadTimestamp != null && message.hasOwnProperty("returnReadTimestamp")) - object.returnReadTimestamp = message.returnReadTimestamp; - return object; - }; - - /** - * Converts this ReadOnly to JSON. - * @function toJSON - * @memberof google.spanner.v1.TransactionOptions.ReadOnly - * @instance - * @returns {Object.} JSON object - */ - ReadOnly.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ReadOnly - * @function getTypeUrl - * @memberof google.spanner.v1.TransactionOptions.ReadOnly - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ReadOnly.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.TransactionOptions.ReadOnly"; - }; - - return ReadOnly; - })(); - - /** - * IsolationLevel enum. - * @name google.spanner.v1.TransactionOptions.IsolationLevel - * @enum {number} - * @property {number} ISOLATION_LEVEL_UNSPECIFIED=0 ISOLATION_LEVEL_UNSPECIFIED value - * @property {number} SERIALIZABLE=1 SERIALIZABLE value - * @property {number} REPEATABLE_READ=2 REPEATABLE_READ value - */ - TransactionOptions.IsolationLevel = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ISOLATION_LEVEL_UNSPECIFIED"] = 0; - values[valuesById[1] = "SERIALIZABLE"] = 1; - values[valuesById[2] = "REPEATABLE_READ"] = 2; - return values; - })(); - - return TransactionOptions; - })(); - - v1.Transaction = (function() { - - /** - * Properties of a Transaction. - * @memberof google.spanner.v1 - * @interface ITransaction - * @property {Uint8Array|null} [id] Transaction id - * @property {google.protobuf.ITimestamp|null} [readTimestamp] Transaction readTimestamp - * @property {google.spanner.v1.IMultiplexedSessionPrecommitToken|null} [precommitToken] Transaction precommitToken - */ - - /** - * Constructs a new Transaction. - * @memberof google.spanner.v1 - * @classdesc Represents a Transaction. - * @implements ITransaction - * @constructor - * @param {google.spanner.v1.ITransaction=} [properties] Properties to set - */ - function Transaction(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Transaction id. - * @member {Uint8Array} id - * @memberof google.spanner.v1.Transaction - * @instance - */ - Transaction.prototype.id = $util.newBuffer([]); - - /** - * Transaction readTimestamp. - * @member {google.protobuf.ITimestamp|null|undefined} readTimestamp - * @memberof google.spanner.v1.Transaction - * @instance - */ - Transaction.prototype.readTimestamp = null; - - /** - * Transaction precommitToken. - * @member {google.spanner.v1.IMultiplexedSessionPrecommitToken|null|undefined} precommitToken - * @memberof google.spanner.v1.Transaction - * @instance - */ - Transaction.prototype.precommitToken = null; - - /** - * Creates a new Transaction instance using the specified properties. - * @function create - * @memberof google.spanner.v1.Transaction - * @static - * @param {google.spanner.v1.ITransaction=} [properties] Properties to set - * @returns {google.spanner.v1.Transaction} Transaction instance - */ - Transaction.create = function create(properties) { - return new Transaction(properties); - }; - - /** - * Encodes the specified Transaction message. Does not implicitly {@link google.spanner.v1.Transaction.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.Transaction - * @static - * @param {google.spanner.v1.ITransaction} message Transaction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Transaction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.id != null && Object.hasOwnProperty.call(message, "id")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.id); - if (message.readTimestamp != null && Object.hasOwnProperty.call(message, "readTimestamp")) - $root.google.protobuf.Timestamp.encode(message.readTimestamp, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.precommitToken != null && Object.hasOwnProperty.call(message, "precommitToken")) - $root.google.spanner.v1.MultiplexedSessionPrecommitToken.encode(message.precommitToken, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Transaction message, length delimited. Does not implicitly {@link google.spanner.v1.Transaction.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.Transaction - * @static - * @param {google.spanner.v1.ITransaction} message Transaction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Transaction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Transaction message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.Transaction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.Transaction} Transaction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Transaction.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.Transaction(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.id = reader.bytes(); - break; - } - case 2: { - message.readTimestamp = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 3: { - message.precommitToken = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Transaction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.Transaction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.Transaction} Transaction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Transaction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Transaction message. - * @function verify - * @memberof google.spanner.v1.Transaction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Transaction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.id != null && message.hasOwnProperty("id")) - if (!(message.id && typeof message.id.length === "number" || $util.isString(message.id))) - return "id: buffer expected"; - if (message.readTimestamp != null && message.hasOwnProperty("readTimestamp")) { - var error = $root.google.protobuf.Timestamp.verify(message.readTimestamp); - if (error) - return "readTimestamp." + error; - } - if (message.precommitToken != null && message.hasOwnProperty("precommitToken")) { - var error = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.verify(message.precommitToken); - if (error) - return "precommitToken." + error; - } - return null; - }; - - /** - * Creates a Transaction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.Transaction - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.Transaction} Transaction - */ - Transaction.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.Transaction) - return object; - var message = new $root.google.spanner.v1.Transaction(); - if (object.id != null) - if (typeof object.id === "string") - $util.base64.decode(object.id, message.id = $util.newBuffer($util.base64.length(object.id)), 0); - else if (object.id.length >= 0) - message.id = object.id; - if (object.readTimestamp != null) { - if (typeof object.readTimestamp !== "object") - throw TypeError(".google.spanner.v1.Transaction.readTimestamp: object expected"); - message.readTimestamp = $root.google.protobuf.Timestamp.fromObject(object.readTimestamp); - } - if (object.precommitToken != null) { - if (typeof object.precommitToken !== "object") - throw TypeError(".google.spanner.v1.Transaction.precommitToken: object expected"); - message.precommitToken = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.fromObject(object.precommitToken); - } - return message; - }; - - /** - * Creates a plain object from a Transaction message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.Transaction - * @static - * @param {google.spanner.v1.Transaction} message Transaction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Transaction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.id = ""; - else { - object.id = []; - if (options.bytes !== Array) - object.id = $util.newBuffer(object.id); - } - object.readTimestamp = null; - object.precommitToken = null; - } - if (message.id != null && message.hasOwnProperty("id")) - object.id = options.bytes === String ? $util.base64.encode(message.id, 0, message.id.length) : options.bytes === Array ? Array.prototype.slice.call(message.id) : message.id; - if (message.readTimestamp != null && message.hasOwnProperty("readTimestamp")) - object.readTimestamp = $root.google.protobuf.Timestamp.toObject(message.readTimestamp, options); - if (message.precommitToken != null && message.hasOwnProperty("precommitToken")) - object.precommitToken = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.toObject(message.precommitToken, options); - return object; - }; - - /** - * Converts this Transaction to JSON. - * @function toJSON - * @memberof google.spanner.v1.Transaction - * @instance - * @returns {Object.} JSON object - */ - Transaction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Transaction - * @function getTypeUrl - * @memberof google.spanner.v1.Transaction - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Transaction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.Transaction"; - }; - - return Transaction; - })(); - - v1.TransactionSelector = (function() { - - /** - * Properties of a TransactionSelector. - * @memberof google.spanner.v1 - * @interface ITransactionSelector - * @property {google.spanner.v1.ITransactionOptions|null} [singleUse] TransactionSelector singleUse - * @property {Uint8Array|null} [id] TransactionSelector id - * @property {google.spanner.v1.ITransactionOptions|null} [begin] TransactionSelector begin - */ - - /** - * Constructs a new TransactionSelector. - * @memberof google.spanner.v1 - * @classdesc Represents a TransactionSelector. - * @implements ITransactionSelector - * @constructor - * @param {google.spanner.v1.ITransactionSelector=} [properties] Properties to set - */ - function TransactionSelector(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TransactionSelector singleUse. - * @member {google.spanner.v1.ITransactionOptions|null|undefined} singleUse - * @memberof google.spanner.v1.TransactionSelector - * @instance - */ - TransactionSelector.prototype.singleUse = null; - - /** - * TransactionSelector id. - * @member {Uint8Array|null|undefined} id - * @memberof google.spanner.v1.TransactionSelector - * @instance - */ - TransactionSelector.prototype.id = null; - - /** - * TransactionSelector begin. - * @member {google.spanner.v1.ITransactionOptions|null|undefined} begin - * @memberof google.spanner.v1.TransactionSelector - * @instance - */ - TransactionSelector.prototype.begin = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * TransactionSelector selector. - * @member {"singleUse"|"id"|"begin"|undefined} selector - * @memberof google.spanner.v1.TransactionSelector - * @instance - */ - Object.defineProperty(TransactionSelector.prototype, "selector", { - get: $util.oneOfGetter($oneOfFields = ["singleUse", "id", "begin"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new TransactionSelector instance using the specified properties. - * @function create - * @memberof google.spanner.v1.TransactionSelector - * @static - * @param {google.spanner.v1.ITransactionSelector=} [properties] Properties to set - * @returns {google.spanner.v1.TransactionSelector} TransactionSelector instance - */ - TransactionSelector.create = function create(properties) { - return new TransactionSelector(properties); - }; - - /** - * Encodes the specified TransactionSelector message. Does not implicitly {@link google.spanner.v1.TransactionSelector.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.TransactionSelector - * @static - * @param {google.spanner.v1.ITransactionSelector} message TransactionSelector message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TransactionSelector.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.singleUse != null && Object.hasOwnProperty.call(message, "singleUse")) - $root.google.spanner.v1.TransactionOptions.encode(message.singleUse, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.id != null && Object.hasOwnProperty.call(message, "id")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.id); - if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) - $root.google.spanner.v1.TransactionOptions.encode(message.begin, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified TransactionSelector message, length delimited. Does not implicitly {@link google.spanner.v1.TransactionSelector.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.TransactionSelector - * @static - * @param {google.spanner.v1.ITransactionSelector} message TransactionSelector message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TransactionSelector.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TransactionSelector message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.TransactionSelector - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.TransactionSelector} TransactionSelector - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TransactionSelector.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.TransactionSelector(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.singleUse = $root.google.spanner.v1.TransactionOptions.decode(reader, reader.uint32()); - break; - } - case 2: { - message.id = reader.bytes(); - break; - } - case 3: { - message.begin = $root.google.spanner.v1.TransactionOptions.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TransactionSelector message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.TransactionSelector - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.TransactionSelector} TransactionSelector - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TransactionSelector.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TransactionSelector message. - * @function verify - * @memberof google.spanner.v1.TransactionSelector - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TransactionSelector.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.singleUse != null && message.hasOwnProperty("singleUse")) { - properties.selector = 1; - { - var error = $root.google.spanner.v1.TransactionOptions.verify(message.singleUse); - if (error) - return "singleUse." + error; - } - } - if (message.id != null && message.hasOwnProperty("id")) { - if (properties.selector === 1) - return "selector: multiple values"; - properties.selector = 1; - if (!(message.id && typeof message.id.length === "number" || $util.isString(message.id))) - return "id: buffer expected"; - } - if (message.begin != null && message.hasOwnProperty("begin")) { - if (properties.selector === 1) - return "selector: multiple values"; - properties.selector = 1; - { - var error = $root.google.spanner.v1.TransactionOptions.verify(message.begin); - if (error) - return "begin." + error; - } - } - return null; - }; - - /** - * Creates a TransactionSelector message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.TransactionSelector - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.TransactionSelector} TransactionSelector - */ - TransactionSelector.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.TransactionSelector) - return object; - var message = new $root.google.spanner.v1.TransactionSelector(); - if (object.singleUse != null) { - if (typeof object.singleUse !== "object") - throw TypeError(".google.spanner.v1.TransactionSelector.singleUse: object expected"); - message.singleUse = $root.google.spanner.v1.TransactionOptions.fromObject(object.singleUse); - } - if (object.id != null) - if (typeof object.id === "string") - $util.base64.decode(object.id, message.id = $util.newBuffer($util.base64.length(object.id)), 0); - else if (object.id.length >= 0) - message.id = object.id; - if (object.begin != null) { - if (typeof object.begin !== "object") - throw TypeError(".google.spanner.v1.TransactionSelector.begin: object expected"); - message.begin = $root.google.spanner.v1.TransactionOptions.fromObject(object.begin); - } - return message; - }; - - /** - * Creates a plain object from a TransactionSelector message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.TransactionSelector - * @static - * @param {google.spanner.v1.TransactionSelector} message TransactionSelector - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TransactionSelector.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.singleUse != null && message.hasOwnProperty("singleUse")) { - object.singleUse = $root.google.spanner.v1.TransactionOptions.toObject(message.singleUse, options); - if (options.oneofs) - object.selector = "singleUse"; - } - if (message.id != null && message.hasOwnProperty("id")) { - object.id = options.bytes === String ? $util.base64.encode(message.id, 0, message.id.length) : options.bytes === Array ? Array.prototype.slice.call(message.id) : message.id; - if (options.oneofs) - object.selector = "id"; - } - if (message.begin != null && message.hasOwnProperty("begin")) { - object.begin = $root.google.spanner.v1.TransactionOptions.toObject(message.begin, options); - if (options.oneofs) - object.selector = "begin"; - } - return object; - }; - - /** - * Converts this TransactionSelector to JSON. - * @function toJSON - * @memberof google.spanner.v1.TransactionSelector - * @instance - * @returns {Object.} JSON object - */ - TransactionSelector.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TransactionSelector - * @function getTypeUrl - * @memberof google.spanner.v1.TransactionSelector - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TransactionSelector.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.TransactionSelector"; - }; - - return TransactionSelector; - })(); - - v1.MultiplexedSessionPrecommitToken = (function() { - - /** - * Properties of a MultiplexedSessionPrecommitToken. - * @memberof google.spanner.v1 - * @interface IMultiplexedSessionPrecommitToken - * @property {Uint8Array|null} [precommitToken] MultiplexedSessionPrecommitToken precommitToken - * @property {number|null} [seqNum] MultiplexedSessionPrecommitToken seqNum - */ - - /** - * Constructs a new MultiplexedSessionPrecommitToken. - * @memberof google.spanner.v1 - * @classdesc Represents a MultiplexedSessionPrecommitToken. - * @implements IMultiplexedSessionPrecommitToken - * @constructor - * @param {google.spanner.v1.IMultiplexedSessionPrecommitToken=} [properties] Properties to set - */ - function MultiplexedSessionPrecommitToken(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MultiplexedSessionPrecommitToken precommitToken. - * @member {Uint8Array} precommitToken - * @memberof google.spanner.v1.MultiplexedSessionPrecommitToken - * @instance - */ - MultiplexedSessionPrecommitToken.prototype.precommitToken = $util.newBuffer([]); - - /** - * MultiplexedSessionPrecommitToken seqNum. - * @member {number} seqNum - * @memberof google.spanner.v1.MultiplexedSessionPrecommitToken - * @instance - */ - MultiplexedSessionPrecommitToken.prototype.seqNum = 0; - - /** - * Creates a new MultiplexedSessionPrecommitToken instance using the specified properties. - * @function create - * @memberof google.spanner.v1.MultiplexedSessionPrecommitToken - * @static - * @param {google.spanner.v1.IMultiplexedSessionPrecommitToken=} [properties] Properties to set - * @returns {google.spanner.v1.MultiplexedSessionPrecommitToken} MultiplexedSessionPrecommitToken instance - */ - MultiplexedSessionPrecommitToken.create = function create(properties) { - return new MultiplexedSessionPrecommitToken(properties); - }; - - /** - * Encodes the specified MultiplexedSessionPrecommitToken message. Does not implicitly {@link google.spanner.v1.MultiplexedSessionPrecommitToken.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.MultiplexedSessionPrecommitToken - * @static - * @param {google.spanner.v1.IMultiplexedSessionPrecommitToken} message MultiplexedSessionPrecommitToken message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MultiplexedSessionPrecommitToken.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.precommitToken != null && Object.hasOwnProperty.call(message, "precommitToken")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.precommitToken); - if (message.seqNum != null && Object.hasOwnProperty.call(message, "seqNum")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.seqNum); - return writer; - }; - - /** - * Encodes the specified MultiplexedSessionPrecommitToken message, length delimited. Does not implicitly {@link google.spanner.v1.MultiplexedSessionPrecommitToken.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.MultiplexedSessionPrecommitToken - * @static - * @param {google.spanner.v1.IMultiplexedSessionPrecommitToken} message MultiplexedSessionPrecommitToken message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MultiplexedSessionPrecommitToken.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MultiplexedSessionPrecommitToken message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.MultiplexedSessionPrecommitToken - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.MultiplexedSessionPrecommitToken} MultiplexedSessionPrecommitToken - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MultiplexedSessionPrecommitToken.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.MultiplexedSessionPrecommitToken(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.precommitToken = reader.bytes(); - break; - } - case 2: { - message.seqNum = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MultiplexedSessionPrecommitToken message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.MultiplexedSessionPrecommitToken - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.MultiplexedSessionPrecommitToken} MultiplexedSessionPrecommitToken - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MultiplexedSessionPrecommitToken.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MultiplexedSessionPrecommitToken message. - * @function verify - * @memberof google.spanner.v1.MultiplexedSessionPrecommitToken - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MultiplexedSessionPrecommitToken.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.precommitToken != null && message.hasOwnProperty("precommitToken")) - if (!(message.precommitToken && typeof message.precommitToken.length === "number" || $util.isString(message.precommitToken))) - return "precommitToken: buffer expected"; - if (message.seqNum != null && message.hasOwnProperty("seqNum")) - if (!$util.isInteger(message.seqNum)) - return "seqNum: integer expected"; - return null; - }; - - /** - * Creates a MultiplexedSessionPrecommitToken message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.MultiplexedSessionPrecommitToken - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.MultiplexedSessionPrecommitToken} MultiplexedSessionPrecommitToken - */ - MultiplexedSessionPrecommitToken.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.MultiplexedSessionPrecommitToken) - return object; - var message = new $root.google.spanner.v1.MultiplexedSessionPrecommitToken(); - if (object.precommitToken != null) - if (typeof object.precommitToken === "string") - $util.base64.decode(object.precommitToken, message.precommitToken = $util.newBuffer($util.base64.length(object.precommitToken)), 0); - else if (object.precommitToken.length >= 0) - message.precommitToken = object.precommitToken; - if (object.seqNum != null) - message.seqNum = object.seqNum | 0; - return message; - }; - - /** - * Creates a plain object from a MultiplexedSessionPrecommitToken message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.MultiplexedSessionPrecommitToken - * @static - * @param {google.spanner.v1.MultiplexedSessionPrecommitToken} message MultiplexedSessionPrecommitToken - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MultiplexedSessionPrecommitToken.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.precommitToken = ""; - else { - object.precommitToken = []; - if (options.bytes !== Array) - object.precommitToken = $util.newBuffer(object.precommitToken); - } - object.seqNum = 0; - } - if (message.precommitToken != null && message.hasOwnProperty("precommitToken")) - object.precommitToken = options.bytes === String ? $util.base64.encode(message.precommitToken, 0, message.precommitToken.length) : options.bytes === Array ? Array.prototype.slice.call(message.precommitToken) : message.precommitToken; - if (message.seqNum != null && message.hasOwnProperty("seqNum")) - object.seqNum = message.seqNum; - return object; - }; - - /** - * Converts this MultiplexedSessionPrecommitToken to JSON. - * @function toJSON - * @memberof google.spanner.v1.MultiplexedSessionPrecommitToken - * @instance - * @returns {Object.} JSON object - */ - MultiplexedSessionPrecommitToken.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MultiplexedSessionPrecommitToken - * @function getTypeUrl - * @memberof google.spanner.v1.MultiplexedSessionPrecommitToken - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MultiplexedSessionPrecommitToken.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.MultiplexedSessionPrecommitToken"; - }; - - return MultiplexedSessionPrecommitToken; - })(); - - v1.KeyRange = (function() { - - /** - * Properties of a KeyRange. - * @memberof google.spanner.v1 - * @interface IKeyRange - * @property {google.protobuf.IListValue|null} [startClosed] KeyRange startClosed - * @property {google.protobuf.IListValue|null} [startOpen] KeyRange startOpen - * @property {google.protobuf.IListValue|null} [endClosed] KeyRange endClosed - * @property {google.protobuf.IListValue|null} [endOpen] KeyRange endOpen - */ - - /** - * Constructs a new KeyRange. - * @memberof google.spanner.v1 - * @classdesc Represents a KeyRange. - * @implements IKeyRange - * @constructor - * @param {google.spanner.v1.IKeyRange=} [properties] Properties to set - */ - function KeyRange(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * KeyRange startClosed. - * @member {google.protobuf.IListValue|null|undefined} startClosed - * @memberof google.spanner.v1.KeyRange - * @instance - */ - KeyRange.prototype.startClosed = null; - - /** - * KeyRange startOpen. - * @member {google.protobuf.IListValue|null|undefined} startOpen - * @memberof google.spanner.v1.KeyRange - * @instance - */ - KeyRange.prototype.startOpen = null; - - /** - * KeyRange endClosed. - * @member {google.protobuf.IListValue|null|undefined} endClosed - * @memberof google.spanner.v1.KeyRange - * @instance - */ - KeyRange.prototype.endClosed = null; - - /** - * KeyRange endOpen. - * @member {google.protobuf.IListValue|null|undefined} endOpen - * @memberof google.spanner.v1.KeyRange - * @instance - */ - KeyRange.prototype.endOpen = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * KeyRange startKeyType. - * @member {"startClosed"|"startOpen"|undefined} startKeyType - * @memberof google.spanner.v1.KeyRange - * @instance - */ - Object.defineProperty(KeyRange.prototype, "startKeyType", { - get: $util.oneOfGetter($oneOfFields = ["startClosed", "startOpen"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * KeyRange endKeyType. - * @member {"endClosed"|"endOpen"|undefined} endKeyType - * @memberof google.spanner.v1.KeyRange - * @instance - */ - Object.defineProperty(KeyRange.prototype, "endKeyType", { - get: $util.oneOfGetter($oneOfFields = ["endClosed", "endOpen"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new KeyRange instance using the specified properties. - * @function create - * @memberof google.spanner.v1.KeyRange - * @static - * @param {google.spanner.v1.IKeyRange=} [properties] Properties to set - * @returns {google.spanner.v1.KeyRange} KeyRange instance - */ - KeyRange.create = function create(properties) { - return new KeyRange(properties); - }; - - /** - * Encodes the specified KeyRange message. Does not implicitly {@link google.spanner.v1.KeyRange.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.KeyRange - * @static - * @param {google.spanner.v1.IKeyRange} message KeyRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - KeyRange.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.startClosed != null && Object.hasOwnProperty.call(message, "startClosed")) - $root.google.protobuf.ListValue.encode(message.startClosed, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.startOpen != null && Object.hasOwnProperty.call(message, "startOpen")) - $root.google.protobuf.ListValue.encode(message.startOpen, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.endClosed != null && Object.hasOwnProperty.call(message, "endClosed")) - $root.google.protobuf.ListValue.encode(message.endClosed, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.endOpen != null && Object.hasOwnProperty.call(message, "endOpen")) - $root.google.protobuf.ListValue.encode(message.endOpen, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified KeyRange message, length delimited. Does not implicitly {@link google.spanner.v1.KeyRange.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.KeyRange - * @static - * @param {google.spanner.v1.IKeyRange} message KeyRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - KeyRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a KeyRange message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.KeyRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.KeyRange} KeyRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - KeyRange.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.KeyRange(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.startClosed = $root.google.protobuf.ListValue.decode(reader, reader.uint32()); - break; - } - case 2: { - message.startOpen = $root.google.protobuf.ListValue.decode(reader, reader.uint32()); - break; - } - case 3: { - message.endClosed = $root.google.protobuf.ListValue.decode(reader, reader.uint32()); - break; - } - case 4: { - message.endOpen = $root.google.protobuf.ListValue.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a KeyRange message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.KeyRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.KeyRange} KeyRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - KeyRange.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a KeyRange message. - * @function verify - * @memberof google.spanner.v1.KeyRange - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - KeyRange.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.startClosed != null && message.hasOwnProperty("startClosed")) { - properties.startKeyType = 1; - { - var error = $root.google.protobuf.ListValue.verify(message.startClosed); - if (error) - return "startClosed." + error; - } - } - if (message.startOpen != null && message.hasOwnProperty("startOpen")) { - if (properties.startKeyType === 1) - return "startKeyType: multiple values"; - properties.startKeyType = 1; - { - var error = $root.google.protobuf.ListValue.verify(message.startOpen); - if (error) - return "startOpen." + error; - } - } - if (message.endClosed != null && message.hasOwnProperty("endClosed")) { - properties.endKeyType = 1; - { - var error = $root.google.protobuf.ListValue.verify(message.endClosed); - if (error) - return "endClosed." + error; - } - } - if (message.endOpen != null && message.hasOwnProperty("endOpen")) { - if (properties.endKeyType === 1) - return "endKeyType: multiple values"; - properties.endKeyType = 1; - { - var error = $root.google.protobuf.ListValue.verify(message.endOpen); - if (error) - return "endOpen." + error; - } - } - return null; - }; - - /** - * Creates a KeyRange message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.KeyRange - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.KeyRange} KeyRange - */ - KeyRange.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.KeyRange) - return object; - var message = new $root.google.spanner.v1.KeyRange(); - if (object.startClosed != null) { - if (typeof object.startClosed !== "object") - throw TypeError(".google.spanner.v1.KeyRange.startClosed: object expected"); - message.startClosed = $root.google.protobuf.ListValue.fromObject(object.startClosed); - } - if (object.startOpen != null) { - if (typeof object.startOpen !== "object") - throw TypeError(".google.spanner.v1.KeyRange.startOpen: object expected"); - message.startOpen = $root.google.protobuf.ListValue.fromObject(object.startOpen); - } - if (object.endClosed != null) { - if (typeof object.endClosed !== "object") - throw TypeError(".google.spanner.v1.KeyRange.endClosed: object expected"); - message.endClosed = $root.google.protobuf.ListValue.fromObject(object.endClosed); - } - if (object.endOpen != null) { - if (typeof object.endOpen !== "object") - throw TypeError(".google.spanner.v1.KeyRange.endOpen: object expected"); - message.endOpen = $root.google.protobuf.ListValue.fromObject(object.endOpen); - } - return message; - }; - - /** - * Creates a plain object from a KeyRange message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.KeyRange - * @static - * @param {google.spanner.v1.KeyRange} message KeyRange - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - KeyRange.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.startClosed != null && message.hasOwnProperty("startClosed")) { - object.startClosed = $root.google.protobuf.ListValue.toObject(message.startClosed, options); - if (options.oneofs) - object.startKeyType = "startClosed"; - } - if (message.startOpen != null && message.hasOwnProperty("startOpen")) { - object.startOpen = $root.google.protobuf.ListValue.toObject(message.startOpen, options); - if (options.oneofs) - object.startKeyType = "startOpen"; - } - if (message.endClosed != null && message.hasOwnProperty("endClosed")) { - object.endClosed = $root.google.protobuf.ListValue.toObject(message.endClosed, options); - if (options.oneofs) - object.endKeyType = "endClosed"; - } - if (message.endOpen != null && message.hasOwnProperty("endOpen")) { - object.endOpen = $root.google.protobuf.ListValue.toObject(message.endOpen, options); - if (options.oneofs) - object.endKeyType = "endOpen"; - } - return object; - }; - - /** - * Converts this KeyRange to JSON. - * @function toJSON - * @memberof google.spanner.v1.KeyRange - * @instance - * @returns {Object.} JSON object - */ - KeyRange.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for KeyRange - * @function getTypeUrl - * @memberof google.spanner.v1.KeyRange - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - KeyRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.KeyRange"; - }; - - return KeyRange; - })(); - - v1.KeySet = (function() { - - /** - * Properties of a KeySet. - * @memberof google.spanner.v1 - * @interface IKeySet - * @property {Array.|null} [keys] KeySet keys - * @property {Array.|null} [ranges] KeySet ranges - * @property {boolean|null} [all] KeySet all - */ - - /** - * Constructs a new KeySet. - * @memberof google.spanner.v1 - * @classdesc Represents a KeySet. - * @implements IKeySet - * @constructor - * @param {google.spanner.v1.IKeySet=} [properties] Properties to set - */ - function KeySet(properties) { - this.keys = []; - this.ranges = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * KeySet keys. - * @member {Array.} keys - * @memberof google.spanner.v1.KeySet - * @instance - */ - KeySet.prototype.keys = $util.emptyArray; - - /** - * KeySet ranges. - * @member {Array.} ranges - * @memberof google.spanner.v1.KeySet - * @instance - */ - KeySet.prototype.ranges = $util.emptyArray; - - /** - * KeySet all. - * @member {boolean} all - * @memberof google.spanner.v1.KeySet - * @instance - */ - KeySet.prototype.all = false; - - /** - * Creates a new KeySet instance using the specified properties. - * @function create - * @memberof google.spanner.v1.KeySet - * @static - * @param {google.spanner.v1.IKeySet=} [properties] Properties to set - * @returns {google.spanner.v1.KeySet} KeySet instance - */ - KeySet.create = function create(properties) { - return new KeySet(properties); - }; - - /** - * Encodes the specified KeySet message. Does not implicitly {@link google.spanner.v1.KeySet.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.KeySet - * @static - * @param {google.spanner.v1.IKeySet} message KeySet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - KeySet.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.keys != null && message.keys.length) - for (var i = 0; i < message.keys.length; ++i) - $root.google.protobuf.ListValue.encode(message.keys[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.ranges != null && message.ranges.length) - for (var i = 0; i < message.ranges.length; ++i) - $root.google.spanner.v1.KeyRange.encode(message.ranges[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.all != null && Object.hasOwnProperty.call(message, "all")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.all); - return writer; - }; - - /** - * Encodes the specified KeySet message, length delimited. Does not implicitly {@link google.spanner.v1.KeySet.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.KeySet - * @static - * @param {google.spanner.v1.IKeySet} message KeySet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - KeySet.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a KeySet message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.KeySet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.KeySet} KeySet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - KeySet.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.KeySet(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.keys && message.keys.length)) - message.keys = []; - message.keys.push($root.google.protobuf.ListValue.decode(reader, reader.uint32())); - break; - } - case 2: { - if (!(message.ranges && message.ranges.length)) - message.ranges = []; - message.ranges.push($root.google.spanner.v1.KeyRange.decode(reader, reader.uint32())); - break; - } - case 3: { - message.all = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a KeySet message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.KeySet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.KeySet} KeySet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - KeySet.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a KeySet message. - * @function verify - * @memberof google.spanner.v1.KeySet - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - KeySet.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.keys != null && message.hasOwnProperty("keys")) { - if (!Array.isArray(message.keys)) - return "keys: array expected"; - for (var i = 0; i < message.keys.length; ++i) { - var error = $root.google.protobuf.ListValue.verify(message.keys[i]); - if (error) - return "keys." + error; - } - } - if (message.ranges != null && message.hasOwnProperty("ranges")) { - if (!Array.isArray(message.ranges)) - return "ranges: array expected"; - for (var i = 0; i < message.ranges.length; ++i) { - var error = $root.google.spanner.v1.KeyRange.verify(message.ranges[i]); - if (error) - return "ranges." + error; - } - } - if (message.all != null && message.hasOwnProperty("all")) - if (typeof message.all !== "boolean") - return "all: boolean expected"; - return null; - }; - - /** - * Creates a KeySet message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.KeySet - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.KeySet} KeySet - */ - KeySet.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.KeySet) - return object; - var message = new $root.google.spanner.v1.KeySet(); - if (object.keys) { - if (!Array.isArray(object.keys)) - throw TypeError(".google.spanner.v1.KeySet.keys: array expected"); - message.keys = []; - for (var i = 0; i < object.keys.length; ++i) { - if (typeof object.keys[i] !== "object") - throw TypeError(".google.spanner.v1.KeySet.keys: object expected"); - message.keys[i] = $root.google.protobuf.ListValue.fromObject(object.keys[i]); - } - } - if (object.ranges) { - if (!Array.isArray(object.ranges)) - throw TypeError(".google.spanner.v1.KeySet.ranges: array expected"); - message.ranges = []; - for (var i = 0; i < object.ranges.length; ++i) { - if (typeof object.ranges[i] !== "object") - throw TypeError(".google.spanner.v1.KeySet.ranges: object expected"); - message.ranges[i] = $root.google.spanner.v1.KeyRange.fromObject(object.ranges[i]); - } - } - if (object.all != null) - message.all = Boolean(object.all); - return message; - }; - - /** - * Creates a plain object from a KeySet message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.KeySet - * @static - * @param {google.spanner.v1.KeySet} message KeySet - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - KeySet.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.keys = []; - object.ranges = []; - } - if (options.defaults) - object.all = false; - if (message.keys && message.keys.length) { - object.keys = []; - for (var j = 0; j < message.keys.length; ++j) - object.keys[j] = $root.google.protobuf.ListValue.toObject(message.keys[j], options); - } - if (message.ranges && message.ranges.length) { - object.ranges = []; - for (var j = 0; j < message.ranges.length; ++j) - object.ranges[j] = $root.google.spanner.v1.KeyRange.toObject(message.ranges[j], options); - } - if (message.all != null && message.hasOwnProperty("all")) - object.all = message.all; - return object; - }; - - /** - * Converts this KeySet to JSON. - * @function toJSON - * @memberof google.spanner.v1.KeySet - * @instance - * @returns {Object.} JSON object - */ - KeySet.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for KeySet - * @function getTypeUrl - * @memberof google.spanner.v1.KeySet - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - KeySet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.KeySet"; - }; - - return KeySet; - })(); - - v1.Range = (function() { - - /** - * Properties of a Range. - * @memberof google.spanner.v1 - * @interface IRange - * @property {Uint8Array|null} [startKey] Range startKey - * @property {Uint8Array|null} [limitKey] Range limitKey - * @property {number|Long|null} [groupUid] Range groupUid - * @property {number|Long|null} [splitId] Range splitId - * @property {Uint8Array|null} [generation] Range generation - */ - - /** - * Constructs a new Range. - * @memberof google.spanner.v1 - * @classdesc Represents a Range. - * @implements IRange - * @constructor - * @param {google.spanner.v1.IRange=} [properties] Properties to set - */ - function Range(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Range startKey. - * @member {Uint8Array} startKey - * @memberof google.spanner.v1.Range - * @instance - */ - Range.prototype.startKey = $util.newBuffer([]); - - /** - * Range limitKey. - * @member {Uint8Array} limitKey - * @memberof google.spanner.v1.Range - * @instance - */ - Range.prototype.limitKey = $util.newBuffer([]); - - /** - * Range groupUid. - * @member {number|Long} groupUid - * @memberof google.spanner.v1.Range - * @instance - */ - Range.prototype.groupUid = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Range splitId. - * @member {number|Long} splitId - * @memberof google.spanner.v1.Range - * @instance - */ - Range.prototype.splitId = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Range generation. - * @member {Uint8Array} generation - * @memberof google.spanner.v1.Range - * @instance - */ - Range.prototype.generation = $util.newBuffer([]); - - /** - * Creates a new Range instance using the specified properties. - * @function create - * @memberof google.spanner.v1.Range - * @static - * @param {google.spanner.v1.IRange=} [properties] Properties to set - * @returns {google.spanner.v1.Range} Range instance - */ - Range.create = function create(properties) { - return new Range(properties); - }; - - /** - * Encodes the specified Range message. Does not implicitly {@link google.spanner.v1.Range.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.Range - * @static - * @param {google.spanner.v1.IRange} message Range message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Range.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.startKey != null && Object.hasOwnProperty.call(message, "startKey")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.startKey); - if (message.limitKey != null && Object.hasOwnProperty.call(message, "limitKey")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.limitKey); - if (message.groupUid != null && Object.hasOwnProperty.call(message, "groupUid")) - writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.groupUid); - if (message.splitId != null && Object.hasOwnProperty.call(message, "splitId")) - writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.splitId); - if (message.generation != null && Object.hasOwnProperty.call(message, "generation")) - writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.generation); - return writer; - }; - - /** - * Encodes the specified Range message, length delimited. Does not implicitly {@link google.spanner.v1.Range.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.Range - * @static - * @param {google.spanner.v1.IRange} message Range message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Range.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Range message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.Range - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.Range} Range - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Range.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.Range(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.startKey = reader.bytes(); - break; - } - case 2: { - message.limitKey = reader.bytes(); - break; - } - case 3: { - message.groupUid = reader.uint64(); - break; - } - case 4: { - message.splitId = reader.uint64(); - break; - } - case 5: { - message.generation = reader.bytes(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Range message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.Range - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.Range} Range - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Range.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Range message. - * @function verify - * @memberof google.spanner.v1.Range - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Range.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.startKey != null && message.hasOwnProperty("startKey")) - if (!(message.startKey && typeof message.startKey.length === "number" || $util.isString(message.startKey))) - return "startKey: buffer expected"; - if (message.limitKey != null && message.hasOwnProperty("limitKey")) - if (!(message.limitKey && typeof message.limitKey.length === "number" || $util.isString(message.limitKey))) - return "limitKey: buffer expected"; - if (message.groupUid != null && message.hasOwnProperty("groupUid")) - if (!$util.isInteger(message.groupUid) && !(message.groupUid && $util.isInteger(message.groupUid.low) && $util.isInteger(message.groupUid.high))) - return "groupUid: integer|Long expected"; - if (message.splitId != null && message.hasOwnProperty("splitId")) - if (!$util.isInteger(message.splitId) && !(message.splitId && $util.isInteger(message.splitId.low) && $util.isInteger(message.splitId.high))) - return "splitId: integer|Long expected"; - if (message.generation != null && message.hasOwnProperty("generation")) - if (!(message.generation && typeof message.generation.length === "number" || $util.isString(message.generation))) - return "generation: buffer expected"; - return null; - }; - - /** - * Creates a Range message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.Range - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.Range} Range - */ - Range.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.Range) - return object; - var message = new $root.google.spanner.v1.Range(); - if (object.startKey != null) - if (typeof object.startKey === "string") - $util.base64.decode(object.startKey, message.startKey = $util.newBuffer($util.base64.length(object.startKey)), 0); - else if (object.startKey.length >= 0) - message.startKey = object.startKey; - if (object.limitKey != null) - if (typeof object.limitKey === "string") - $util.base64.decode(object.limitKey, message.limitKey = $util.newBuffer($util.base64.length(object.limitKey)), 0); - else if (object.limitKey.length >= 0) - message.limitKey = object.limitKey; - if (object.groupUid != null) - if ($util.Long) - (message.groupUid = $util.Long.fromValue(object.groupUid)).unsigned = true; - else if (typeof object.groupUid === "string") - message.groupUid = parseInt(object.groupUid, 10); - else if (typeof object.groupUid === "number") - message.groupUid = object.groupUid; - else if (typeof object.groupUid === "object") - message.groupUid = new $util.LongBits(object.groupUid.low >>> 0, object.groupUid.high >>> 0).toNumber(true); - if (object.splitId != null) - if ($util.Long) - (message.splitId = $util.Long.fromValue(object.splitId)).unsigned = true; - else if (typeof object.splitId === "string") - message.splitId = parseInt(object.splitId, 10); - else if (typeof object.splitId === "number") - message.splitId = object.splitId; - else if (typeof object.splitId === "object") - message.splitId = new $util.LongBits(object.splitId.low >>> 0, object.splitId.high >>> 0).toNumber(true); - if (object.generation != null) - if (typeof object.generation === "string") - $util.base64.decode(object.generation, message.generation = $util.newBuffer($util.base64.length(object.generation)), 0); - else if (object.generation.length >= 0) - message.generation = object.generation; - return message; - }; - - /** - * Creates a plain object from a Range message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.Range - * @static - * @param {google.spanner.v1.Range} message Range - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Range.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.startKey = ""; - else { - object.startKey = []; - if (options.bytes !== Array) - object.startKey = $util.newBuffer(object.startKey); - } - if (options.bytes === String) - object.limitKey = ""; - else { - object.limitKey = []; - if (options.bytes !== Array) - object.limitKey = $util.newBuffer(object.limitKey); - } - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.groupUid = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.groupUid = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.splitId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.splitId = options.longs === String ? "0" : 0; - if (options.bytes === String) - object.generation = ""; - else { - object.generation = []; - if (options.bytes !== Array) - object.generation = $util.newBuffer(object.generation); - } - } - if (message.startKey != null && message.hasOwnProperty("startKey")) - object.startKey = options.bytes === String ? $util.base64.encode(message.startKey, 0, message.startKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.startKey) : message.startKey; - if (message.limitKey != null && message.hasOwnProperty("limitKey")) - object.limitKey = options.bytes === String ? $util.base64.encode(message.limitKey, 0, message.limitKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.limitKey) : message.limitKey; - if (message.groupUid != null && message.hasOwnProperty("groupUid")) - if (typeof message.groupUid === "number") - object.groupUid = options.longs === String ? String(message.groupUid) : message.groupUid; - else - object.groupUid = options.longs === String ? $util.Long.prototype.toString.call(message.groupUid) : options.longs === Number ? new $util.LongBits(message.groupUid.low >>> 0, message.groupUid.high >>> 0).toNumber(true) : message.groupUid; - if (message.splitId != null && message.hasOwnProperty("splitId")) - if (typeof message.splitId === "number") - object.splitId = options.longs === String ? String(message.splitId) : message.splitId; - else - object.splitId = options.longs === String ? $util.Long.prototype.toString.call(message.splitId) : options.longs === Number ? new $util.LongBits(message.splitId.low >>> 0, message.splitId.high >>> 0).toNumber(true) : message.splitId; - if (message.generation != null && message.hasOwnProperty("generation")) - object.generation = options.bytes === String ? $util.base64.encode(message.generation, 0, message.generation.length) : options.bytes === Array ? Array.prototype.slice.call(message.generation) : message.generation; - return object; - }; - - /** - * Converts this Range to JSON. - * @function toJSON - * @memberof google.spanner.v1.Range - * @instance - * @returns {Object.} JSON object - */ - Range.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Range - * @function getTypeUrl - * @memberof google.spanner.v1.Range - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Range.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.Range"; - }; - - return Range; - })(); - - v1.Tablet = (function() { - - /** - * Properties of a Tablet. - * @memberof google.spanner.v1 - * @interface ITablet - * @property {number|Long|null} [tabletUid] Tablet tabletUid - * @property {string|null} [serverAddress] Tablet serverAddress - * @property {string|null} [location] Tablet location - * @property {google.spanner.v1.Tablet.Role|null} [role] Tablet role - * @property {Uint8Array|null} [incarnation] Tablet incarnation - * @property {number|null} [distance] Tablet distance - * @property {boolean|null} [skip] Tablet skip - */ - - /** - * Constructs a new Tablet. - * @memberof google.spanner.v1 - * @classdesc Represents a Tablet. - * @implements ITablet - * @constructor - * @param {google.spanner.v1.ITablet=} [properties] Properties to set - */ - function Tablet(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Tablet tabletUid. - * @member {number|Long} tabletUid - * @memberof google.spanner.v1.Tablet - * @instance - */ - Tablet.prototype.tabletUid = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Tablet serverAddress. - * @member {string} serverAddress - * @memberof google.spanner.v1.Tablet - * @instance - */ - Tablet.prototype.serverAddress = ""; - - /** - * Tablet location. - * @member {string} location - * @memberof google.spanner.v1.Tablet - * @instance - */ - Tablet.prototype.location = ""; - - /** - * Tablet role. - * @member {google.spanner.v1.Tablet.Role} role - * @memberof google.spanner.v1.Tablet - * @instance - */ - Tablet.prototype.role = 0; - - /** - * Tablet incarnation. - * @member {Uint8Array} incarnation - * @memberof google.spanner.v1.Tablet - * @instance - */ - Tablet.prototype.incarnation = $util.newBuffer([]); - - /** - * Tablet distance. - * @member {number} distance - * @memberof google.spanner.v1.Tablet - * @instance - */ - Tablet.prototype.distance = 0; - - /** - * Tablet skip. - * @member {boolean} skip - * @memberof google.spanner.v1.Tablet - * @instance - */ - Tablet.prototype.skip = false; - - /** - * Creates a new Tablet instance using the specified properties. - * @function create - * @memberof google.spanner.v1.Tablet - * @static - * @param {google.spanner.v1.ITablet=} [properties] Properties to set - * @returns {google.spanner.v1.Tablet} Tablet instance - */ - Tablet.create = function create(properties) { - return new Tablet(properties); - }; - - /** - * Encodes the specified Tablet message. Does not implicitly {@link google.spanner.v1.Tablet.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.Tablet - * @static - * @param {google.spanner.v1.ITablet} message Tablet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Tablet.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tabletUid != null && Object.hasOwnProperty.call(message, "tabletUid")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.tabletUid); - if (message.serverAddress != null && Object.hasOwnProperty.call(message, "serverAddress")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.serverAddress); - if (message.location != null && Object.hasOwnProperty.call(message, "location")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.location); - if (message.role != null && Object.hasOwnProperty.call(message, "role")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.role); - if (message.incarnation != null && Object.hasOwnProperty.call(message, "incarnation")) - writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.incarnation); - if (message.distance != null && Object.hasOwnProperty.call(message, "distance")) - writer.uint32(/* id 6, wireType 0 =*/48).uint32(message.distance); - if (message.skip != null && Object.hasOwnProperty.call(message, "skip")) - writer.uint32(/* id 7, wireType 0 =*/56).bool(message.skip); - return writer; - }; - - /** - * Encodes the specified Tablet message, length delimited. Does not implicitly {@link google.spanner.v1.Tablet.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.Tablet - * @static - * @param {google.spanner.v1.ITablet} message Tablet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Tablet.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Tablet message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.Tablet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.Tablet} Tablet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Tablet.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.Tablet(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.tabletUid = reader.uint64(); - break; - } - case 2: { - message.serverAddress = reader.string(); - break; - } - case 3: { - message.location = reader.string(); - break; - } - case 4: { - message.role = reader.int32(); - break; - } - case 5: { - message.incarnation = reader.bytes(); - break; - } - case 6: { - message.distance = reader.uint32(); - break; - } - case 7: { - message.skip = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Tablet message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.Tablet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.Tablet} Tablet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Tablet.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Tablet message. - * @function verify - * @memberof google.spanner.v1.Tablet - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Tablet.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.tabletUid != null && message.hasOwnProperty("tabletUid")) - if (!$util.isInteger(message.tabletUid) && !(message.tabletUid && $util.isInteger(message.tabletUid.low) && $util.isInteger(message.tabletUid.high))) - return "tabletUid: integer|Long expected"; - if (message.serverAddress != null && message.hasOwnProperty("serverAddress")) - if (!$util.isString(message.serverAddress)) - return "serverAddress: string expected"; - if (message.location != null && message.hasOwnProperty("location")) - if (!$util.isString(message.location)) - return "location: string expected"; - if (message.role != null && message.hasOwnProperty("role")) - switch (message.role) { - default: - return "role: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.incarnation != null && message.hasOwnProperty("incarnation")) - if (!(message.incarnation && typeof message.incarnation.length === "number" || $util.isString(message.incarnation))) - return "incarnation: buffer expected"; - if (message.distance != null && message.hasOwnProperty("distance")) - if (!$util.isInteger(message.distance)) - return "distance: integer expected"; - if (message.skip != null && message.hasOwnProperty("skip")) - if (typeof message.skip !== "boolean") - return "skip: boolean expected"; - return null; - }; - - /** - * Creates a Tablet message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.Tablet - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.Tablet} Tablet - */ - Tablet.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.Tablet) - return object; - var message = new $root.google.spanner.v1.Tablet(); - if (object.tabletUid != null) - if ($util.Long) - (message.tabletUid = $util.Long.fromValue(object.tabletUid)).unsigned = true; - else if (typeof object.tabletUid === "string") - message.tabletUid = parseInt(object.tabletUid, 10); - else if (typeof object.tabletUid === "number") - message.tabletUid = object.tabletUid; - else if (typeof object.tabletUid === "object") - message.tabletUid = new $util.LongBits(object.tabletUid.low >>> 0, object.tabletUid.high >>> 0).toNumber(true); - if (object.serverAddress != null) - message.serverAddress = String(object.serverAddress); - if (object.location != null) - message.location = String(object.location); - switch (object.role) { - default: - if (typeof object.role === "number") { - message.role = object.role; - break; - } - break; - case "ROLE_UNSPECIFIED": - case 0: - message.role = 0; - break; - case "READ_WRITE": - case 1: - message.role = 1; - break; - case "READ_ONLY": - case 2: - message.role = 2; - break; - } - if (object.incarnation != null) - if (typeof object.incarnation === "string") - $util.base64.decode(object.incarnation, message.incarnation = $util.newBuffer($util.base64.length(object.incarnation)), 0); - else if (object.incarnation.length >= 0) - message.incarnation = object.incarnation; - if (object.distance != null) - message.distance = object.distance >>> 0; - if (object.skip != null) - message.skip = Boolean(object.skip); - return message; - }; - - /** - * Creates a plain object from a Tablet message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.Tablet - * @static - * @param {google.spanner.v1.Tablet} message Tablet - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Tablet.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.tabletUid = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.tabletUid = options.longs === String ? "0" : 0; - object.serverAddress = ""; - object.location = ""; - object.role = options.enums === String ? "ROLE_UNSPECIFIED" : 0; - if (options.bytes === String) - object.incarnation = ""; - else { - object.incarnation = []; - if (options.bytes !== Array) - object.incarnation = $util.newBuffer(object.incarnation); - } - object.distance = 0; - object.skip = false; - } - if (message.tabletUid != null && message.hasOwnProperty("tabletUid")) - if (typeof message.tabletUid === "number") - object.tabletUid = options.longs === String ? String(message.tabletUid) : message.tabletUid; - else - object.tabletUid = options.longs === String ? $util.Long.prototype.toString.call(message.tabletUid) : options.longs === Number ? new $util.LongBits(message.tabletUid.low >>> 0, message.tabletUid.high >>> 0).toNumber(true) : message.tabletUid; - if (message.serverAddress != null && message.hasOwnProperty("serverAddress")) - object.serverAddress = message.serverAddress; - if (message.location != null && message.hasOwnProperty("location")) - object.location = message.location; - if (message.role != null && message.hasOwnProperty("role")) - object.role = options.enums === String ? $root.google.spanner.v1.Tablet.Role[message.role] === undefined ? message.role : $root.google.spanner.v1.Tablet.Role[message.role] : message.role; - if (message.incarnation != null && message.hasOwnProperty("incarnation")) - object.incarnation = options.bytes === String ? $util.base64.encode(message.incarnation, 0, message.incarnation.length) : options.bytes === Array ? Array.prototype.slice.call(message.incarnation) : message.incarnation; - if (message.distance != null && message.hasOwnProperty("distance")) - object.distance = message.distance; - if (message.skip != null && message.hasOwnProperty("skip")) - object.skip = message.skip; - return object; - }; - - /** - * Converts this Tablet to JSON. - * @function toJSON - * @memberof google.spanner.v1.Tablet - * @instance - * @returns {Object.} JSON object - */ - Tablet.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Tablet - * @function getTypeUrl - * @memberof google.spanner.v1.Tablet - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Tablet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.Tablet"; - }; - - /** - * Role enum. - * @name google.spanner.v1.Tablet.Role - * @enum {number} - * @property {number} ROLE_UNSPECIFIED=0 ROLE_UNSPECIFIED value - * @property {number} READ_WRITE=1 READ_WRITE value - * @property {number} READ_ONLY=2 READ_ONLY value - */ - Tablet.Role = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ROLE_UNSPECIFIED"] = 0; - values[valuesById[1] = "READ_WRITE"] = 1; - values[valuesById[2] = "READ_ONLY"] = 2; - return values; - })(); - - return Tablet; - })(); - - v1.Group = (function() { - - /** - * Properties of a Group. - * @memberof google.spanner.v1 - * @interface IGroup - * @property {number|Long|null} [groupUid] Group groupUid - * @property {Array.|null} [tablets] Group tablets - * @property {number|null} [leaderIndex] Group leaderIndex - * @property {Uint8Array|null} [generation] Group generation - */ - - /** - * Constructs a new Group. - * @memberof google.spanner.v1 - * @classdesc Represents a Group. - * @implements IGroup - * @constructor - * @param {google.spanner.v1.IGroup=} [properties] Properties to set - */ - function Group(properties) { - this.tablets = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Group groupUid. - * @member {number|Long} groupUid - * @memberof google.spanner.v1.Group - * @instance - */ - Group.prototype.groupUid = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Group tablets. - * @member {Array.} tablets - * @memberof google.spanner.v1.Group - * @instance - */ - Group.prototype.tablets = $util.emptyArray; - - /** - * Group leaderIndex. - * @member {number} leaderIndex - * @memberof google.spanner.v1.Group - * @instance - */ - Group.prototype.leaderIndex = 0; - - /** - * Group generation. - * @member {Uint8Array} generation - * @memberof google.spanner.v1.Group - * @instance - */ - Group.prototype.generation = $util.newBuffer([]); - - /** - * Creates a new Group instance using the specified properties. - * @function create - * @memberof google.spanner.v1.Group - * @static - * @param {google.spanner.v1.IGroup=} [properties] Properties to set - * @returns {google.spanner.v1.Group} Group instance - */ - Group.create = function create(properties) { - return new Group(properties); - }; - - /** - * Encodes the specified Group message. Does not implicitly {@link google.spanner.v1.Group.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.Group - * @static - * @param {google.spanner.v1.IGroup} message Group message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Group.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.groupUid != null && Object.hasOwnProperty.call(message, "groupUid")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.groupUid); - if (message.tablets != null && message.tablets.length) - for (var i = 0; i < message.tablets.length; ++i) - $root.google.spanner.v1.Tablet.encode(message.tablets[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.leaderIndex != null && Object.hasOwnProperty.call(message, "leaderIndex")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.leaderIndex); - if (message.generation != null && Object.hasOwnProperty.call(message, "generation")) - writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.generation); - return writer; - }; - - /** - * Encodes the specified Group message, length delimited. Does not implicitly {@link google.spanner.v1.Group.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.Group - * @static - * @param {google.spanner.v1.IGroup} message Group message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Group.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Group message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.Group - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.Group} Group - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Group.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.Group(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.groupUid = reader.uint64(); - break; - } - case 2: { - if (!(message.tablets && message.tablets.length)) - message.tablets = []; - message.tablets.push($root.google.spanner.v1.Tablet.decode(reader, reader.uint32())); - break; - } - case 3: { - message.leaderIndex = reader.int32(); - break; - } - case 4: { - message.generation = reader.bytes(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Group message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.Group - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.Group} Group - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Group.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Group message. - * @function verify - * @memberof google.spanner.v1.Group - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Group.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.groupUid != null && message.hasOwnProperty("groupUid")) - if (!$util.isInteger(message.groupUid) && !(message.groupUid && $util.isInteger(message.groupUid.low) && $util.isInteger(message.groupUid.high))) - return "groupUid: integer|Long expected"; - if (message.tablets != null && message.hasOwnProperty("tablets")) { - if (!Array.isArray(message.tablets)) - return "tablets: array expected"; - for (var i = 0; i < message.tablets.length; ++i) { - var error = $root.google.spanner.v1.Tablet.verify(message.tablets[i]); - if (error) - return "tablets." + error; - } - } - if (message.leaderIndex != null && message.hasOwnProperty("leaderIndex")) - if (!$util.isInteger(message.leaderIndex)) - return "leaderIndex: integer expected"; - if (message.generation != null && message.hasOwnProperty("generation")) - if (!(message.generation && typeof message.generation.length === "number" || $util.isString(message.generation))) - return "generation: buffer expected"; - return null; - }; - - /** - * Creates a Group message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.Group - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.Group} Group - */ - Group.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.Group) - return object; - var message = new $root.google.spanner.v1.Group(); - if (object.groupUid != null) - if ($util.Long) - (message.groupUid = $util.Long.fromValue(object.groupUid)).unsigned = true; - else if (typeof object.groupUid === "string") - message.groupUid = parseInt(object.groupUid, 10); - else if (typeof object.groupUid === "number") - message.groupUid = object.groupUid; - else if (typeof object.groupUid === "object") - message.groupUid = new $util.LongBits(object.groupUid.low >>> 0, object.groupUid.high >>> 0).toNumber(true); - if (object.tablets) { - if (!Array.isArray(object.tablets)) - throw TypeError(".google.spanner.v1.Group.tablets: array expected"); - message.tablets = []; - for (var i = 0; i < object.tablets.length; ++i) { - if (typeof object.tablets[i] !== "object") - throw TypeError(".google.spanner.v1.Group.tablets: object expected"); - message.tablets[i] = $root.google.spanner.v1.Tablet.fromObject(object.tablets[i]); - } - } - if (object.leaderIndex != null) - message.leaderIndex = object.leaderIndex | 0; - if (object.generation != null) - if (typeof object.generation === "string") - $util.base64.decode(object.generation, message.generation = $util.newBuffer($util.base64.length(object.generation)), 0); - else if (object.generation.length >= 0) - message.generation = object.generation; - return message; - }; - - /** - * Creates a plain object from a Group message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.Group - * @static - * @param {google.spanner.v1.Group} message Group - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Group.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.tablets = []; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.groupUid = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.groupUid = options.longs === String ? "0" : 0; - object.leaderIndex = 0; - if (options.bytes === String) - object.generation = ""; - else { - object.generation = []; - if (options.bytes !== Array) - object.generation = $util.newBuffer(object.generation); - } - } - if (message.groupUid != null && message.hasOwnProperty("groupUid")) - if (typeof message.groupUid === "number") - object.groupUid = options.longs === String ? String(message.groupUid) : message.groupUid; - else - object.groupUid = options.longs === String ? $util.Long.prototype.toString.call(message.groupUid) : options.longs === Number ? new $util.LongBits(message.groupUid.low >>> 0, message.groupUid.high >>> 0).toNumber(true) : message.groupUid; - if (message.tablets && message.tablets.length) { - object.tablets = []; - for (var j = 0; j < message.tablets.length; ++j) - object.tablets[j] = $root.google.spanner.v1.Tablet.toObject(message.tablets[j], options); - } - if (message.leaderIndex != null && message.hasOwnProperty("leaderIndex")) - object.leaderIndex = message.leaderIndex; - if (message.generation != null && message.hasOwnProperty("generation")) - object.generation = options.bytes === String ? $util.base64.encode(message.generation, 0, message.generation.length) : options.bytes === Array ? Array.prototype.slice.call(message.generation) : message.generation; - return object; - }; - - /** - * Converts this Group to JSON. - * @function toJSON - * @memberof google.spanner.v1.Group - * @instance - * @returns {Object.} JSON object - */ - Group.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Group - * @function getTypeUrl - * @memberof google.spanner.v1.Group - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Group.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.Group"; - }; - - return Group; - })(); - - v1.KeyRecipe = (function() { - - /** - * Properties of a KeyRecipe. - * @memberof google.spanner.v1 - * @interface IKeyRecipe - * @property {string|null} [tableName] KeyRecipe tableName - * @property {string|null} [indexName] KeyRecipe indexName - * @property {number|Long|null} [operationUid] KeyRecipe operationUid - * @property {Array.|null} [part] KeyRecipe part - */ - - /** - * Constructs a new KeyRecipe. - * @memberof google.spanner.v1 - * @classdesc Represents a KeyRecipe. - * @implements IKeyRecipe - * @constructor - * @param {google.spanner.v1.IKeyRecipe=} [properties] Properties to set - */ - function KeyRecipe(properties) { - this.part = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * KeyRecipe tableName. - * @member {string|null|undefined} tableName - * @memberof google.spanner.v1.KeyRecipe - * @instance - */ - KeyRecipe.prototype.tableName = null; - - /** - * KeyRecipe indexName. - * @member {string|null|undefined} indexName - * @memberof google.spanner.v1.KeyRecipe - * @instance - */ - KeyRecipe.prototype.indexName = null; - - /** - * KeyRecipe operationUid. - * @member {number|Long|null|undefined} operationUid - * @memberof google.spanner.v1.KeyRecipe - * @instance - */ - KeyRecipe.prototype.operationUid = null; - - /** - * KeyRecipe part. - * @member {Array.} part - * @memberof google.spanner.v1.KeyRecipe - * @instance - */ - KeyRecipe.prototype.part = $util.emptyArray; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * KeyRecipe target. - * @member {"tableName"|"indexName"|"operationUid"|undefined} target - * @memberof google.spanner.v1.KeyRecipe - * @instance - */ - Object.defineProperty(KeyRecipe.prototype, "target", { - get: $util.oneOfGetter($oneOfFields = ["tableName", "indexName", "operationUid"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new KeyRecipe instance using the specified properties. - * @function create - * @memberof google.spanner.v1.KeyRecipe - * @static - * @param {google.spanner.v1.IKeyRecipe=} [properties] Properties to set - * @returns {google.spanner.v1.KeyRecipe} KeyRecipe instance - */ - KeyRecipe.create = function create(properties) { - return new KeyRecipe(properties); - }; - - /** - * Encodes the specified KeyRecipe message. Does not implicitly {@link google.spanner.v1.KeyRecipe.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.KeyRecipe - * @static - * @param {google.spanner.v1.IKeyRecipe} message KeyRecipe message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - KeyRecipe.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tableName != null && Object.hasOwnProperty.call(message, "tableName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.tableName); - if (message.indexName != null && Object.hasOwnProperty.call(message, "indexName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.indexName); - if (message.operationUid != null && Object.hasOwnProperty.call(message, "operationUid")) - writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.operationUid); - if (message.part != null && message.part.length) - for (var i = 0; i < message.part.length; ++i) - $root.google.spanner.v1.KeyRecipe.Part.encode(message.part[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified KeyRecipe message, length delimited. Does not implicitly {@link google.spanner.v1.KeyRecipe.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.KeyRecipe - * @static - * @param {google.spanner.v1.IKeyRecipe} message KeyRecipe message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - KeyRecipe.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a KeyRecipe message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.KeyRecipe - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.KeyRecipe} KeyRecipe - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - KeyRecipe.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.KeyRecipe(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.tableName = reader.string(); - break; - } - case 2: { - message.indexName = reader.string(); - break; - } - case 3: { - message.operationUid = reader.uint64(); - break; - } - case 4: { - if (!(message.part && message.part.length)) - message.part = []; - message.part.push($root.google.spanner.v1.KeyRecipe.Part.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a KeyRecipe message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.KeyRecipe - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.KeyRecipe} KeyRecipe - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - KeyRecipe.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a KeyRecipe message. - * @function verify - * @memberof google.spanner.v1.KeyRecipe - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - KeyRecipe.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.tableName != null && message.hasOwnProperty("tableName")) { - properties.target = 1; - if (!$util.isString(message.tableName)) - return "tableName: string expected"; - } - if (message.indexName != null && message.hasOwnProperty("indexName")) { - if (properties.target === 1) - return "target: multiple values"; - properties.target = 1; - if (!$util.isString(message.indexName)) - return "indexName: string expected"; - } - if (message.operationUid != null && message.hasOwnProperty("operationUid")) { - if (properties.target === 1) - return "target: multiple values"; - properties.target = 1; - if (!$util.isInteger(message.operationUid) && !(message.operationUid && $util.isInteger(message.operationUid.low) && $util.isInteger(message.operationUid.high))) - return "operationUid: integer|Long expected"; - } - if (message.part != null && message.hasOwnProperty("part")) { - if (!Array.isArray(message.part)) - return "part: array expected"; - for (var i = 0; i < message.part.length; ++i) { - var error = $root.google.spanner.v1.KeyRecipe.Part.verify(message.part[i]); - if (error) - return "part." + error; - } - } - return null; - }; - - /** - * Creates a KeyRecipe message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.KeyRecipe - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.KeyRecipe} KeyRecipe - */ - KeyRecipe.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.KeyRecipe) - return object; - var message = new $root.google.spanner.v1.KeyRecipe(); - if (object.tableName != null) - message.tableName = String(object.tableName); - if (object.indexName != null) - message.indexName = String(object.indexName); - if (object.operationUid != null) - if ($util.Long) - (message.operationUid = $util.Long.fromValue(object.operationUid)).unsigned = true; - else if (typeof object.operationUid === "string") - message.operationUid = parseInt(object.operationUid, 10); - else if (typeof object.operationUid === "number") - message.operationUid = object.operationUid; - else if (typeof object.operationUid === "object") - message.operationUid = new $util.LongBits(object.operationUid.low >>> 0, object.operationUid.high >>> 0).toNumber(true); - if (object.part) { - if (!Array.isArray(object.part)) - throw TypeError(".google.spanner.v1.KeyRecipe.part: array expected"); - message.part = []; - for (var i = 0; i < object.part.length; ++i) { - if (typeof object.part[i] !== "object") - throw TypeError(".google.spanner.v1.KeyRecipe.part: object expected"); - message.part[i] = $root.google.spanner.v1.KeyRecipe.Part.fromObject(object.part[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a KeyRecipe message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.KeyRecipe - * @static - * @param {google.spanner.v1.KeyRecipe} message KeyRecipe - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - KeyRecipe.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.part = []; - if (message.tableName != null && message.hasOwnProperty("tableName")) { - object.tableName = message.tableName; - if (options.oneofs) - object.target = "tableName"; - } - if (message.indexName != null && message.hasOwnProperty("indexName")) { - object.indexName = message.indexName; - if (options.oneofs) - object.target = "indexName"; - } - if (message.operationUid != null && message.hasOwnProperty("operationUid")) { - if (typeof message.operationUid === "number") - object.operationUid = options.longs === String ? String(message.operationUid) : message.operationUid; - else - object.operationUid = options.longs === String ? $util.Long.prototype.toString.call(message.operationUid) : options.longs === Number ? new $util.LongBits(message.operationUid.low >>> 0, message.operationUid.high >>> 0).toNumber(true) : message.operationUid; - if (options.oneofs) - object.target = "operationUid"; - } - if (message.part && message.part.length) { - object.part = []; - for (var j = 0; j < message.part.length; ++j) - object.part[j] = $root.google.spanner.v1.KeyRecipe.Part.toObject(message.part[j], options); - } - return object; - }; - - /** - * Converts this KeyRecipe to JSON. - * @function toJSON - * @memberof google.spanner.v1.KeyRecipe - * @instance - * @returns {Object.} JSON object - */ - KeyRecipe.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for KeyRecipe - * @function getTypeUrl - * @memberof google.spanner.v1.KeyRecipe - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - KeyRecipe.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.KeyRecipe"; - }; - - KeyRecipe.Part = (function() { - - /** - * Properties of a Part. - * @memberof google.spanner.v1.KeyRecipe - * @interface IPart - * @property {number|null} [tag] Part tag - * @property {google.spanner.v1.KeyRecipe.Part.Order|null} [order] Part order - * @property {google.spanner.v1.KeyRecipe.Part.NullOrder|null} [nullOrder] Part nullOrder - * @property {google.spanner.v1.IType|null} [type] Part type - * @property {string|null} [identifier] Part identifier - * @property {google.protobuf.IValue|null} [value] Part value - * @property {boolean|null} [random] Part random - * @property {Array.|null} [structIdentifiers] Part structIdentifiers - */ - - /** - * Constructs a new Part. - * @memberof google.spanner.v1.KeyRecipe - * @classdesc Represents a Part. - * @implements IPart - * @constructor - * @param {google.spanner.v1.KeyRecipe.IPart=} [properties] Properties to set - */ - function Part(properties) { - this.structIdentifiers = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Part tag. - * @member {number} tag - * @memberof google.spanner.v1.KeyRecipe.Part - * @instance - */ - Part.prototype.tag = 0; - - /** - * Part order. - * @member {google.spanner.v1.KeyRecipe.Part.Order} order - * @memberof google.spanner.v1.KeyRecipe.Part - * @instance - */ - Part.prototype.order = 0; - - /** - * Part nullOrder. - * @member {google.spanner.v1.KeyRecipe.Part.NullOrder} nullOrder - * @memberof google.spanner.v1.KeyRecipe.Part - * @instance - */ - Part.prototype.nullOrder = 0; - - /** - * Part type. - * @member {google.spanner.v1.IType|null|undefined} type - * @memberof google.spanner.v1.KeyRecipe.Part - * @instance - */ - Part.prototype.type = null; - - /** - * Part identifier. - * @member {string|null|undefined} identifier - * @memberof google.spanner.v1.KeyRecipe.Part - * @instance - */ - Part.prototype.identifier = null; - - /** - * Part value. - * @member {google.protobuf.IValue|null|undefined} value - * @memberof google.spanner.v1.KeyRecipe.Part - * @instance - */ - Part.prototype.value = null; - - /** - * Part random. - * @member {boolean|null|undefined} random - * @memberof google.spanner.v1.KeyRecipe.Part - * @instance - */ - Part.prototype.random = null; - - /** - * Part structIdentifiers. - * @member {Array.} structIdentifiers - * @memberof google.spanner.v1.KeyRecipe.Part - * @instance - */ - Part.prototype.structIdentifiers = $util.emptyArray; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Part valueType. - * @member {"identifier"|"value"|"random"|undefined} valueType - * @memberof google.spanner.v1.KeyRecipe.Part - * @instance - */ - Object.defineProperty(Part.prototype, "valueType", { - get: $util.oneOfGetter($oneOfFields = ["identifier", "value", "random"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Part instance using the specified properties. - * @function create - * @memberof google.spanner.v1.KeyRecipe.Part - * @static - * @param {google.spanner.v1.KeyRecipe.IPart=} [properties] Properties to set - * @returns {google.spanner.v1.KeyRecipe.Part} Part instance - */ - Part.create = function create(properties) { - return new Part(properties); - }; - - /** - * Encodes the specified Part message. Does not implicitly {@link google.spanner.v1.KeyRecipe.Part.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.KeyRecipe.Part - * @static - * @param {google.spanner.v1.KeyRecipe.IPart} message Part message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Part.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tag != null && Object.hasOwnProperty.call(message, "tag")) - writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.tag); - if (message.order != null && Object.hasOwnProperty.call(message, "order")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.order); - if (message.nullOrder != null && Object.hasOwnProperty.call(message, "nullOrder")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.nullOrder); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - $root.google.spanner.v1.Type.encode(message.type, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.identifier != null && Object.hasOwnProperty.call(message, "identifier")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.identifier); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - $root.google.protobuf.Value.encode(message.value, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.structIdentifiers != null && message.structIdentifiers.length) { - writer.uint32(/* id 7, wireType 2 =*/58).fork(); - for (var i = 0; i < message.structIdentifiers.length; ++i) - writer.int32(message.structIdentifiers[i]); - writer.ldelim(); - } - if (message.random != null && Object.hasOwnProperty.call(message, "random")) - writer.uint32(/* id 8, wireType 0 =*/64).bool(message.random); - return writer; - }; - - /** - * Encodes the specified Part message, length delimited. Does not implicitly {@link google.spanner.v1.KeyRecipe.Part.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.KeyRecipe.Part - * @static - * @param {google.spanner.v1.KeyRecipe.IPart} message Part message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Part.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Part message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.KeyRecipe.Part - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.KeyRecipe.Part} Part - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Part.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.KeyRecipe.Part(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.tag = reader.uint32(); - break; - } - case 2: { - message.order = reader.int32(); - break; - } - case 3: { - message.nullOrder = reader.int32(); - break; - } - case 4: { - message.type = $root.google.spanner.v1.Type.decode(reader, reader.uint32()); - break; - } - case 5: { - message.identifier = reader.string(); - break; - } - case 6: { - message.value = $root.google.protobuf.Value.decode(reader, reader.uint32()); - break; - } - case 8: { - message.random = reader.bool(); - break; - } - case 7: { - if (!(message.structIdentifiers && message.structIdentifiers.length)) - message.structIdentifiers = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.structIdentifiers.push(reader.int32()); - } else - message.structIdentifiers.push(reader.int32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Part message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.KeyRecipe.Part - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.KeyRecipe.Part} Part - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Part.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Part message. - * @function verify - * @memberof google.spanner.v1.KeyRecipe.Part - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Part.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.tag != null && message.hasOwnProperty("tag")) - if (!$util.isInteger(message.tag)) - return "tag: integer expected"; - if (message.order != null && message.hasOwnProperty("order")) - switch (message.order) { - default: - return "order: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.nullOrder != null && message.hasOwnProperty("nullOrder")) - switch (message.nullOrder) { - default: - return "nullOrder: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.type != null && message.hasOwnProperty("type")) { - var error = $root.google.spanner.v1.Type.verify(message.type); - if (error) - return "type." + error; - } - if (message.identifier != null && message.hasOwnProperty("identifier")) { - properties.valueType = 1; - if (!$util.isString(message.identifier)) - return "identifier: string expected"; - } - if (message.value != null && message.hasOwnProperty("value")) { - if (properties.valueType === 1) - return "valueType: multiple values"; - properties.valueType = 1; - { - var error = $root.google.protobuf.Value.verify(message.value); - if (error) - return "value." + error; - } - } - if (message.random != null && message.hasOwnProperty("random")) { - if (properties.valueType === 1) - return "valueType: multiple values"; - properties.valueType = 1; - if (typeof message.random !== "boolean") - return "random: boolean expected"; - } - if (message.structIdentifiers != null && message.hasOwnProperty("structIdentifiers")) { - if (!Array.isArray(message.structIdentifiers)) - return "structIdentifiers: array expected"; - for (var i = 0; i < message.structIdentifiers.length; ++i) - if (!$util.isInteger(message.structIdentifiers[i])) - return "structIdentifiers: integer[] expected"; - } - return null; - }; - - /** - * Creates a Part message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.KeyRecipe.Part - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.KeyRecipe.Part} Part - */ - Part.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.KeyRecipe.Part) - return object; - var message = new $root.google.spanner.v1.KeyRecipe.Part(); - if (object.tag != null) - message.tag = object.tag >>> 0; - switch (object.order) { - default: - if (typeof object.order === "number") { - message.order = object.order; - break; - } - break; - case "ORDER_UNSPECIFIED": - case 0: - message.order = 0; - break; - case "ASCENDING": - case 1: - message.order = 1; - break; - case "DESCENDING": - case 2: - message.order = 2; - break; - } - switch (object.nullOrder) { - default: - if (typeof object.nullOrder === "number") { - message.nullOrder = object.nullOrder; - break; - } - break; - case "NULL_ORDER_UNSPECIFIED": - case 0: - message.nullOrder = 0; - break; - case "NULLS_FIRST": - case 1: - message.nullOrder = 1; - break; - case "NULLS_LAST": - case 2: - message.nullOrder = 2; - break; - case "NOT_NULL": - case 3: - message.nullOrder = 3; - break; - } - if (object.type != null) { - if (typeof object.type !== "object") - throw TypeError(".google.spanner.v1.KeyRecipe.Part.type: object expected"); - message.type = $root.google.spanner.v1.Type.fromObject(object.type); - } - if (object.identifier != null) - message.identifier = String(object.identifier); - if (object.value != null) { - if (typeof object.value !== "object") - throw TypeError(".google.spanner.v1.KeyRecipe.Part.value: object expected"); - message.value = $root.google.protobuf.Value.fromObject(object.value); - } - if (object.random != null) - message.random = Boolean(object.random); - if (object.structIdentifiers) { - if (!Array.isArray(object.structIdentifiers)) - throw TypeError(".google.spanner.v1.KeyRecipe.Part.structIdentifiers: array expected"); - message.structIdentifiers = []; - for (var i = 0; i < object.structIdentifiers.length; ++i) - message.structIdentifiers[i] = object.structIdentifiers[i] | 0; - } - return message; - }; - - /** - * Creates a plain object from a Part message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.KeyRecipe.Part - * @static - * @param {google.spanner.v1.KeyRecipe.Part} message Part - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Part.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.structIdentifiers = []; - if (options.defaults) { - object.tag = 0; - object.order = options.enums === String ? "ORDER_UNSPECIFIED" : 0; - object.nullOrder = options.enums === String ? "NULL_ORDER_UNSPECIFIED" : 0; - object.type = null; - } - if (message.tag != null && message.hasOwnProperty("tag")) - object.tag = message.tag; - if (message.order != null && message.hasOwnProperty("order")) - object.order = options.enums === String ? $root.google.spanner.v1.KeyRecipe.Part.Order[message.order] === undefined ? message.order : $root.google.spanner.v1.KeyRecipe.Part.Order[message.order] : message.order; - if (message.nullOrder != null && message.hasOwnProperty("nullOrder")) - object.nullOrder = options.enums === String ? $root.google.spanner.v1.KeyRecipe.Part.NullOrder[message.nullOrder] === undefined ? message.nullOrder : $root.google.spanner.v1.KeyRecipe.Part.NullOrder[message.nullOrder] : message.nullOrder; - if (message.type != null && message.hasOwnProperty("type")) - object.type = $root.google.spanner.v1.Type.toObject(message.type, options); - if (message.identifier != null && message.hasOwnProperty("identifier")) { - object.identifier = message.identifier; - if (options.oneofs) - object.valueType = "identifier"; - } - if (message.value != null && message.hasOwnProperty("value")) { - object.value = $root.google.protobuf.Value.toObject(message.value, options); - if (options.oneofs) - object.valueType = "value"; - } - if (message.structIdentifiers && message.structIdentifiers.length) { - object.structIdentifiers = []; - for (var j = 0; j < message.structIdentifiers.length; ++j) - object.structIdentifiers[j] = message.structIdentifiers[j]; - } - if (message.random != null && message.hasOwnProperty("random")) { - object.random = message.random; - if (options.oneofs) - object.valueType = "random"; - } - return object; - }; - - /** - * Converts this Part to JSON. - * @function toJSON - * @memberof google.spanner.v1.KeyRecipe.Part - * @instance - * @returns {Object.} JSON object - */ - Part.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Part - * @function getTypeUrl - * @memberof google.spanner.v1.KeyRecipe.Part - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Part.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.KeyRecipe.Part"; - }; - - /** - * Order enum. - * @name google.spanner.v1.KeyRecipe.Part.Order - * @enum {number} - * @property {number} ORDER_UNSPECIFIED=0 ORDER_UNSPECIFIED value - * @property {number} ASCENDING=1 ASCENDING value - * @property {number} DESCENDING=2 DESCENDING value - */ - Part.Order = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ORDER_UNSPECIFIED"] = 0; - values[valuesById[1] = "ASCENDING"] = 1; - values[valuesById[2] = "DESCENDING"] = 2; - return values; - })(); - - /** - * NullOrder enum. - * @name google.spanner.v1.KeyRecipe.Part.NullOrder - * @enum {number} - * @property {number} NULL_ORDER_UNSPECIFIED=0 NULL_ORDER_UNSPECIFIED value - * @property {number} NULLS_FIRST=1 NULLS_FIRST value - * @property {number} NULLS_LAST=2 NULLS_LAST value - * @property {number} NOT_NULL=3 NOT_NULL value - */ - Part.NullOrder = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "NULL_ORDER_UNSPECIFIED"] = 0; - values[valuesById[1] = "NULLS_FIRST"] = 1; - values[valuesById[2] = "NULLS_LAST"] = 2; - values[valuesById[3] = "NOT_NULL"] = 3; - return values; - })(); - - return Part; - })(); - - return KeyRecipe; - })(); - - v1.RecipeList = (function() { - - /** - * Properties of a RecipeList. - * @memberof google.spanner.v1 - * @interface IRecipeList - * @property {Uint8Array|null} [schemaGeneration] RecipeList schemaGeneration - * @property {Array.|null} [recipe] RecipeList recipe - */ - - /** - * Constructs a new RecipeList. - * @memberof google.spanner.v1 - * @classdesc Represents a RecipeList. - * @implements IRecipeList - * @constructor - * @param {google.spanner.v1.IRecipeList=} [properties] Properties to set - */ - function RecipeList(properties) { - this.recipe = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RecipeList schemaGeneration. - * @member {Uint8Array} schemaGeneration - * @memberof google.spanner.v1.RecipeList - * @instance - */ - RecipeList.prototype.schemaGeneration = $util.newBuffer([]); - - /** - * RecipeList recipe. - * @member {Array.} recipe - * @memberof google.spanner.v1.RecipeList - * @instance - */ - RecipeList.prototype.recipe = $util.emptyArray; - - /** - * Creates a new RecipeList instance using the specified properties. - * @function create - * @memberof google.spanner.v1.RecipeList - * @static - * @param {google.spanner.v1.IRecipeList=} [properties] Properties to set - * @returns {google.spanner.v1.RecipeList} RecipeList instance - */ - RecipeList.create = function create(properties) { - return new RecipeList(properties); - }; - - /** - * Encodes the specified RecipeList message. Does not implicitly {@link google.spanner.v1.RecipeList.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.RecipeList - * @static - * @param {google.spanner.v1.IRecipeList} message RecipeList message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RecipeList.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.schemaGeneration != null && Object.hasOwnProperty.call(message, "schemaGeneration")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.schemaGeneration); - if (message.recipe != null && message.recipe.length) - for (var i = 0; i < message.recipe.length; ++i) - $root.google.spanner.v1.KeyRecipe.encode(message.recipe[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified RecipeList message, length delimited. Does not implicitly {@link google.spanner.v1.RecipeList.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.RecipeList - * @static - * @param {google.spanner.v1.IRecipeList} message RecipeList message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RecipeList.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RecipeList message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.RecipeList - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.RecipeList} RecipeList - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RecipeList.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.RecipeList(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.schemaGeneration = reader.bytes(); - break; - } - case 3: { - if (!(message.recipe && message.recipe.length)) - message.recipe = []; - message.recipe.push($root.google.spanner.v1.KeyRecipe.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RecipeList message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.RecipeList - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.RecipeList} RecipeList - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RecipeList.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RecipeList message. - * @function verify - * @memberof google.spanner.v1.RecipeList - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RecipeList.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.schemaGeneration != null && message.hasOwnProperty("schemaGeneration")) - if (!(message.schemaGeneration && typeof message.schemaGeneration.length === "number" || $util.isString(message.schemaGeneration))) - return "schemaGeneration: buffer expected"; - if (message.recipe != null && message.hasOwnProperty("recipe")) { - if (!Array.isArray(message.recipe)) - return "recipe: array expected"; - for (var i = 0; i < message.recipe.length; ++i) { - var error = $root.google.spanner.v1.KeyRecipe.verify(message.recipe[i]); - if (error) - return "recipe." + error; - } - } - return null; - }; - - /** - * Creates a RecipeList message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.RecipeList - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.RecipeList} RecipeList - */ - RecipeList.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.RecipeList) - return object; - var message = new $root.google.spanner.v1.RecipeList(); - if (object.schemaGeneration != null) - if (typeof object.schemaGeneration === "string") - $util.base64.decode(object.schemaGeneration, message.schemaGeneration = $util.newBuffer($util.base64.length(object.schemaGeneration)), 0); - else if (object.schemaGeneration.length >= 0) - message.schemaGeneration = object.schemaGeneration; - if (object.recipe) { - if (!Array.isArray(object.recipe)) - throw TypeError(".google.spanner.v1.RecipeList.recipe: array expected"); - message.recipe = []; - for (var i = 0; i < object.recipe.length; ++i) { - if (typeof object.recipe[i] !== "object") - throw TypeError(".google.spanner.v1.RecipeList.recipe: object expected"); - message.recipe[i] = $root.google.spanner.v1.KeyRecipe.fromObject(object.recipe[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a RecipeList message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.RecipeList - * @static - * @param {google.spanner.v1.RecipeList} message RecipeList - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RecipeList.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.recipe = []; - if (options.defaults) - if (options.bytes === String) - object.schemaGeneration = ""; - else { - object.schemaGeneration = []; - if (options.bytes !== Array) - object.schemaGeneration = $util.newBuffer(object.schemaGeneration); - } - if (message.schemaGeneration != null && message.hasOwnProperty("schemaGeneration")) - object.schemaGeneration = options.bytes === String ? $util.base64.encode(message.schemaGeneration, 0, message.schemaGeneration.length) : options.bytes === Array ? Array.prototype.slice.call(message.schemaGeneration) : message.schemaGeneration; - if (message.recipe && message.recipe.length) { - object.recipe = []; - for (var j = 0; j < message.recipe.length; ++j) - object.recipe[j] = $root.google.spanner.v1.KeyRecipe.toObject(message.recipe[j], options); - } - return object; - }; - - /** - * Converts this RecipeList to JSON. - * @function toJSON - * @memberof google.spanner.v1.RecipeList - * @instance - * @returns {Object.} JSON object - */ - RecipeList.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RecipeList - * @function getTypeUrl - * @memberof google.spanner.v1.RecipeList - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RecipeList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.RecipeList"; - }; - - return RecipeList; - })(); - - v1.CacheUpdate = (function() { - - /** - * Properties of a CacheUpdate. - * @memberof google.spanner.v1 - * @interface ICacheUpdate - * @property {number|Long|null} [databaseId] CacheUpdate databaseId - * @property {Array.|null} [range] CacheUpdate range - * @property {Array.|null} [group] CacheUpdate group - * @property {google.spanner.v1.IRecipeList|null} [keyRecipes] CacheUpdate keyRecipes - */ - - /** - * Constructs a new CacheUpdate. - * @memberof google.spanner.v1 - * @classdesc Represents a CacheUpdate. - * @implements ICacheUpdate - * @constructor - * @param {google.spanner.v1.ICacheUpdate=} [properties] Properties to set - */ - function CacheUpdate(properties) { - this.range = []; - this.group = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CacheUpdate databaseId. - * @member {number|Long} databaseId - * @memberof google.spanner.v1.CacheUpdate - * @instance - */ - CacheUpdate.prototype.databaseId = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * CacheUpdate range. - * @member {Array.} range - * @memberof google.spanner.v1.CacheUpdate - * @instance - */ - CacheUpdate.prototype.range = $util.emptyArray; - - /** - * CacheUpdate group. - * @member {Array.} group - * @memberof google.spanner.v1.CacheUpdate - * @instance - */ - CacheUpdate.prototype.group = $util.emptyArray; - - /** - * CacheUpdate keyRecipes. - * @member {google.spanner.v1.IRecipeList|null|undefined} keyRecipes - * @memberof google.spanner.v1.CacheUpdate - * @instance - */ - CacheUpdate.prototype.keyRecipes = null; - - /** - * Creates a new CacheUpdate instance using the specified properties. - * @function create - * @memberof google.spanner.v1.CacheUpdate - * @static - * @param {google.spanner.v1.ICacheUpdate=} [properties] Properties to set - * @returns {google.spanner.v1.CacheUpdate} CacheUpdate instance - */ - CacheUpdate.create = function create(properties) { - return new CacheUpdate(properties); - }; - - /** - * Encodes the specified CacheUpdate message. Does not implicitly {@link google.spanner.v1.CacheUpdate.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.CacheUpdate - * @static - * @param {google.spanner.v1.ICacheUpdate} message CacheUpdate message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CacheUpdate.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.databaseId != null && Object.hasOwnProperty.call(message, "databaseId")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.databaseId); - if (message.range != null && message.range.length) - for (var i = 0; i < message.range.length; ++i) - $root.google.spanner.v1.Range.encode(message.range[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.group != null && message.group.length) - for (var i = 0; i < message.group.length; ++i) - $root.google.spanner.v1.Group.encode(message.group[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.keyRecipes != null && Object.hasOwnProperty.call(message, "keyRecipes")) - $root.google.spanner.v1.RecipeList.encode(message.keyRecipes, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CacheUpdate message, length delimited. Does not implicitly {@link google.spanner.v1.CacheUpdate.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.CacheUpdate - * @static - * @param {google.spanner.v1.ICacheUpdate} message CacheUpdate message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CacheUpdate.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CacheUpdate message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.CacheUpdate - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.CacheUpdate} CacheUpdate - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CacheUpdate.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.CacheUpdate(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.databaseId = reader.uint64(); - break; - } - case 2: { - if (!(message.range && message.range.length)) - message.range = []; - message.range.push($root.google.spanner.v1.Range.decode(reader, reader.uint32())); - break; - } - case 3: { - if (!(message.group && message.group.length)) - message.group = []; - message.group.push($root.google.spanner.v1.Group.decode(reader, reader.uint32())); - break; - } - case 5: { - message.keyRecipes = $root.google.spanner.v1.RecipeList.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CacheUpdate message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.CacheUpdate - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.CacheUpdate} CacheUpdate - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CacheUpdate.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CacheUpdate message. - * @function verify - * @memberof google.spanner.v1.CacheUpdate - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CacheUpdate.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.databaseId != null && message.hasOwnProperty("databaseId")) - if (!$util.isInteger(message.databaseId) && !(message.databaseId && $util.isInteger(message.databaseId.low) && $util.isInteger(message.databaseId.high))) - return "databaseId: integer|Long expected"; - if (message.range != null && message.hasOwnProperty("range")) { - if (!Array.isArray(message.range)) - return "range: array expected"; - for (var i = 0; i < message.range.length; ++i) { - var error = $root.google.spanner.v1.Range.verify(message.range[i]); - if (error) - return "range." + error; - } - } - if (message.group != null && message.hasOwnProperty("group")) { - if (!Array.isArray(message.group)) - return "group: array expected"; - for (var i = 0; i < message.group.length; ++i) { - var error = $root.google.spanner.v1.Group.verify(message.group[i]); - if (error) - return "group." + error; - } - } - if (message.keyRecipes != null && message.hasOwnProperty("keyRecipes")) { - var error = $root.google.spanner.v1.RecipeList.verify(message.keyRecipes); - if (error) - return "keyRecipes." + error; - } - return null; - }; - - /** - * Creates a CacheUpdate message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.CacheUpdate - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.CacheUpdate} CacheUpdate - */ - CacheUpdate.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.CacheUpdate) - return object; - var message = new $root.google.spanner.v1.CacheUpdate(); - if (object.databaseId != null) - if ($util.Long) - (message.databaseId = $util.Long.fromValue(object.databaseId)).unsigned = true; - else if (typeof object.databaseId === "string") - message.databaseId = parseInt(object.databaseId, 10); - else if (typeof object.databaseId === "number") - message.databaseId = object.databaseId; - else if (typeof object.databaseId === "object") - message.databaseId = new $util.LongBits(object.databaseId.low >>> 0, object.databaseId.high >>> 0).toNumber(true); - if (object.range) { - if (!Array.isArray(object.range)) - throw TypeError(".google.spanner.v1.CacheUpdate.range: array expected"); - message.range = []; - for (var i = 0; i < object.range.length; ++i) { - if (typeof object.range[i] !== "object") - throw TypeError(".google.spanner.v1.CacheUpdate.range: object expected"); - message.range[i] = $root.google.spanner.v1.Range.fromObject(object.range[i]); - } - } - if (object.group) { - if (!Array.isArray(object.group)) - throw TypeError(".google.spanner.v1.CacheUpdate.group: array expected"); - message.group = []; - for (var i = 0; i < object.group.length; ++i) { - if (typeof object.group[i] !== "object") - throw TypeError(".google.spanner.v1.CacheUpdate.group: object expected"); - message.group[i] = $root.google.spanner.v1.Group.fromObject(object.group[i]); - } - } - if (object.keyRecipes != null) { - if (typeof object.keyRecipes !== "object") - throw TypeError(".google.spanner.v1.CacheUpdate.keyRecipes: object expected"); - message.keyRecipes = $root.google.spanner.v1.RecipeList.fromObject(object.keyRecipes); - } - return message; - }; - - /** - * Creates a plain object from a CacheUpdate message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.CacheUpdate - * @static - * @param {google.spanner.v1.CacheUpdate} message CacheUpdate - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CacheUpdate.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.range = []; - object.group = []; - } - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.databaseId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.databaseId = options.longs === String ? "0" : 0; - object.keyRecipes = null; - } - if (message.databaseId != null && message.hasOwnProperty("databaseId")) - if (typeof message.databaseId === "number") - object.databaseId = options.longs === String ? String(message.databaseId) : message.databaseId; - else - object.databaseId = options.longs === String ? $util.Long.prototype.toString.call(message.databaseId) : options.longs === Number ? new $util.LongBits(message.databaseId.low >>> 0, message.databaseId.high >>> 0).toNumber(true) : message.databaseId; - if (message.range && message.range.length) { - object.range = []; - for (var j = 0; j < message.range.length; ++j) - object.range[j] = $root.google.spanner.v1.Range.toObject(message.range[j], options); - } - if (message.group && message.group.length) { - object.group = []; - for (var j = 0; j < message.group.length; ++j) - object.group[j] = $root.google.spanner.v1.Group.toObject(message.group[j], options); - } - if (message.keyRecipes != null && message.hasOwnProperty("keyRecipes")) - object.keyRecipes = $root.google.spanner.v1.RecipeList.toObject(message.keyRecipes, options); - return object; - }; - - /** - * Converts this CacheUpdate to JSON. - * @function toJSON - * @memberof google.spanner.v1.CacheUpdate - * @instance - * @returns {Object.} JSON object - */ - CacheUpdate.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CacheUpdate - * @function getTypeUrl - * @memberof google.spanner.v1.CacheUpdate - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CacheUpdate.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.CacheUpdate"; - }; - - return CacheUpdate; - })(); - - v1.RoutingHint = (function() { - - /** - * Properties of a RoutingHint. - * @memberof google.spanner.v1 - * @interface IRoutingHint - * @property {number|Long|null} [operationUid] RoutingHint operationUid - * @property {number|Long|null} [databaseId] RoutingHint databaseId - * @property {Uint8Array|null} [schemaGeneration] RoutingHint schemaGeneration - * @property {Uint8Array|null} [key] RoutingHint key - * @property {Uint8Array|null} [limitKey] RoutingHint limitKey - * @property {number|Long|null} [groupUid] RoutingHint groupUid - * @property {number|Long|null} [splitId] RoutingHint splitId - * @property {number|Long|null} [tabletUid] RoutingHint tabletUid - * @property {Array.|null} [skippedTabletUid] RoutingHint skippedTabletUid - * @property {string|null} [clientLocation] RoutingHint clientLocation - */ - - /** - * Constructs a new RoutingHint. - * @memberof google.spanner.v1 - * @classdesc Represents a RoutingHint. - * @implements IRoutingHint - * @constructor - * @param {google.spanner.v1.IRoutingHint=} [properties] Properties to set - */ - function RoutingHint(properties) { - this.skippedTabletUid = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RoutingHint operationUid. - * @member {number|Long} operationUid - * @memberof google.spanner.v1.RoutingHint - * @instance - */ - RoutingHint.prototype.operationUid = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * RoutingHint databaseId. - * @member {number|Long} databaseId - * @memberof google.spanner.v1.RoutingHint - * @instance - */ - RoutingHint.prototype.databaseId = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * RoutingHint schemaGeneration. - * @member {Uint8Array} schemaGeneration - * @memberof google.spanner.v1.RoutingHint - * @instance - */ - RoutingHint.prototype.schemaGeneration = $util.newBuffer([]); - - /** - * RoutingHint key. - * @member {Uint8Array} key - * @memberof google.spanner.v1.RoutingHint - * @instance - */ - RoutingHint.prototype.key = $util.newBuffer([]); - - /** - * RoutingHint limitKey. - * @member {Uint8Array} limitKey - * @memberof google.spanner.v1.RoutingHint - * @instance - */ - RoutingHint.prototype.limitKey = $util.newBuffer([]); - - /** - * RoutingHint groupUid. - * @member {number|Long} groupUid - * @memberof google.spanner.v1.RoutingHint - * @instance - */ - RoutingHint.prototype.groupUid = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * RoutingHint splitId. - * @member {number|Long} splitId - * @memberof google.spanner.v1.RoutingHint - * @instance - */ - RoutingHint.prototype.splitId = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * RoutingHint tabletUid. - * @member {number|Long} tabletUid - * @memberof google.spanner.v1.RoutingHint - * @instance - */ - RoutingHint.prototype.tabletUid = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * RoutingHint skippedTabletUid. - * @member {Array.} skippedTabletUid - * @memberof google.spanner.v1.RoutingHint - * @instance - */ - RoutingHint.prototype.skippedTabletUid = $util.emptyArray; - - /** - * RoutingHint clientLocation. - * @member {string} clientLocation - * @memberof google.spanner.v1.RoutingHint - * @instance - */ - RoutingHint.prototype.clientLocation = ""; - - /** - * Creates a new RoutingHint instance using the specified properties. - * @function create - * @memberof google.spanner.v1.RoutingHint - * @static - * @param {google.spanner.v1.IRoutingHint=} [properties] Properties to set - * @returns {google.spanner.v1.RoutingHint} RoutingHint instance - */ - RoutingHint.create = function create(properties) { - return new RoutingHint(properties); - }; - - /** - * Encodes the specified RoutingHint message. Does not implicitly {@link google.spanner.v1.RoutingHint.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.RoutingHint - * @static - * @param {google.spanner.v1.IRoutingHint} message RoutingHint message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RoutingHint.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.operationUid != null && Object.hasOwnProperty.call(message, "operationUid")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.operationUid); - if (message.databaseId != null && Object.hasOwnProperty.call(message, "databaseId")) - writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.databaseId); - if (message.schemaGeneration != null && Object.hasOwnProperty.call(message, "schemaGeneration")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.schemaGeneration); - if (message.key != null && Object.hasOwnProperty.call(message, "key")) - writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.key); - if (message.limitKey != null && Object.hasOwnProperty.call(message, "limitKey")) - writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.limitKey); - if (message.groupUid != null && Object.hasOwnProperty.call(message, "groupUid")) - writer.uint32(/* id 6, wireType 0 =*/48).uint64(message.groupUid); - if (message.splitId != null && Object.hasOwnProperty.call(message, "splitId")) - writer.uint32(/* id 7, wireType 0 =*/56).uint64(message.splitId); - if (message.tabletUid != null && Object.hasOwnProperty.call(message, "tabletUid")) - writer.uint32(/* id 8, wireType 0 =*/64).uint64(message.tabletUid); - if (message.skippedTabletUid != null && message.skippedTabletUid.length) - for (var i = 0; i < message.skippedTabletUid.length; ++i) - $root.google.spanner.v1.RoutingHint.SkippedTablet.encode(message.skippedTabletUid[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.clientLocation != null && Object.hasOwnProperty.call(message, "clientLocation")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.clientLocation); - return writer; - }; - - /** - * Encodes the specified RoutingHint message, length delimited. Does not implicitly {@link google.spanner.v1.RoutingHint.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.RoutingHint - * @static - * @param {google.spanner.v1.IRoutingHint} message RoutingHint message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RoutingHint.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RoutingHint message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.RoutingHint - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.RoutingHint} RoutingHint - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RoutingHint.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.RoutingHint(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.operationUid = reader.uint64(); - break; - } - case 2: { - message.databaseId = reader.uint64(); - break; - } - case 3: { - message.schemaGeneration = reader.bytes(); - break; - } - case 4: { - message.key = reader.bytes(); - break; - } - case 5: { - message.limitKey = reader.bytes(); - break; - } - case 6: { - message.groupUid = reader.uint64(); - break; - } - case 7: { - message.splitId = reader.uint64(); - break; - } - case 8: { - message.tabletUid = reader.uint64(); - break; - } - case 9: { - if (!(message.skippedTabletUid && message.skippedTabletUid.length)) - message.skippedTabletUid = []; - message.skippedTabletUid.push($root.google.spanner.v1.RoutingHint.SkippedTablet.decode(reader, reader.uint32())); - break; - } - case 10: { - message.clientLocation = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RoutingHint message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.RoutingHint - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.RoutingHint} RoutingHint - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RoutingHint.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RoutingHint message. - * @function verify - * @memberof google.spanner.v1.RoutingHint - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RoutingHint.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.operationUid != null && message.hasOwnProperty("operationUid")) - if (!$util.isInteger(message.operationUid) && !(message.operationUid && $util.isInteger(message.operationUid.low) && $util.isInteger(message.operationUid.high))) - return "operationUid: integer|Long expected"; - if (message.databaseId != null && message.hasOwnProperty("databaseId")) - if (!$util.isInteger(message.databaseId) && !(message.databaseId && $util.isInteger(message.databaseId.low) && $util.isInteger(message.databaseId.high))) - return "databaseId: integer|Long expected"; - if (message.schemaGeneration != null && message.hasOwnProperty("schemaGeneration")) - if (!(message.schemaGeneration && typeof message.schemaGeneration.length === "number" || $util.isString(message.schemaGeneration))) - return "schemaGeneration: buffer expected"; - if (message.key != null && message.hasOwnProperty("key")) - if (!(message.key && typeof message.key.length === "number" || $util.isString(message.key))) - return "key: buffer expected"; - if (message.limitKey != null && message.hasOwnProperty("limitKey")) - if (!(message.limitKey && typeof message.limitKey.length === "number" || $util.isString(message.limitKey))) - return "limitKey: buffer expected"; - if (message.groupUid != null && message.hasOwnProperty("groupUid")) - if (!$util.isInteger(message.groupUid) && !(message.groupUid && $util.isInteger(message.groupUid.low) && $util.isInteger(message.groupUid.high))) - return "groupUid: integer|Long expected"; - if (message.splitId != null && message.hasOwnProperty("splitId")) - if (!$util.isInteger(message.splitId) && !(message.splitId && $util.isInteger(message.splitId.low) && $util.isInteger(message.splitId.high))) - return "splitId: integer|Long expected"; - if (message.tabletUid != null && message.hasOwnProperty("tabletUid")) - if (!$util.isInteger(message.tabletUid) && !(message.tabletUid && $util.isInteger(message.tabletUid.low) && $util.isInteger(message.tabletUid.high))) - return "tabletUid: integer|Long expected"; - if (message.skippedTabletUid != null && message.hasOwnProperty("skippedTabletUid")) { - if (!Array.isArray(message.skippedTabletUid)) - return "skippedTabletUid: array expected"; - for (var i = 0; i < message.skippedTabletUid.length; ++i) { - var error = $root.google.spanner.v1.RoutingHint.SkippedTablet.verify(message.skippedTabletUid[i]); - if (error) - return "skippedTabletUid." + error; - } - } - if (message.clientLocation != null && message.hasOwnProperty("clientLocation")) - if (!$util.isString(message.clientLocation)) - return "clientLocation: string expected"; - return null; - }; - - /** - * Creates a RoutingHint message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.RoutingHint - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.RoutingHint} RoutingHint - */ - RoutingHint.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.RoutingHint) - return object; - var message = new $root.google.spanner.v1.RoutingHint(); - if (object.operationUid != null) - if ($util.Long) - (message.operationUid = $util.Long.fromValue(object.operationUid)).unsigned = true; - else if (typeof object.operationUid === "string") - message.operationUid = parseInt(object.operationUid, 10); - else if (typeof object.operationUid === "number") - message.operationUid = object.operationUid; - else if (typeof object.operationUid === "object") - message.operationUid = new $util.LongBits(object.operationUid.low >>> 0, object.operationUid.high >>> 0).toNumber(true); - if (object.databaseId != null) - if ($util.Long) - (message.databaseId = $util.Long.fromValue(object.databaseId)).unsigned = true; - else if (typeof object.databaseId === "string") - message.databaseId = parseInt(object.databaseId, 10); - else if (typeof object.databaseId === "number") - message.databaseId = object.databaseId; - else if (typeof object.databaseId === "object") - message.databaseId = new $util.LongBits(object.databaseId.low >>> 0, object.databaseId.high >>> 0).toNumber(true); - if (object.schemaGeneration != null) - if (typeof object.schemaGeneration === "string") - $util.base64.decode(object.schemaGeneration, message.schemaGeneration = $util.newBuffer($util.base64.length(object.schemaGeneration)), 0); - else if (object.schemaGeneration.length >= 0) - message.schemaGeneration = object.schemaGeneration; - if (object.key != null) - if (typeof object.key === "string") - $util.base64.decode(object.key, message.key = $util.newBuffer($util.base64.length(object.key)), 0); - else if (object.key.length >= 0) - message.key = object.key; - if (object.limitKey != null) - if (typeof object.limitKey === "string") - $util.base64.decode(object.limitKey, message.limitKey = $util.newBuffer($util.base64.length(object.limitKey)), 0); - else if (object.limitKey.length >= 0) - message.limitKey = object.limitKey; - if (object.groupUid != null) - if ($util.Long) - (message.groupUid = $util.Long.fromValue(object.groupUid)).unsigned = true; - else if (typeof object.groupUid === "string") - message.groupUid = parseInt(object.groupUid, 10); - else if (typeof object.groupUid === "number") - message.groupUid = object.groupUid; - else if (typeof object.groupUid === "object") - message.groupUid = new $util.LongBits(object.groupUid.low >>> 0, object.groupUid.high >>> 0).toNumber(true); - if (object.splitId != null) - if ($util.Long) - (message.splitId = $util.Long.fromValue(object.splitId)).unsigned = true; - else if (typeof object.splitId === "string") - message.splitId = parseInt(object.splitId, 10); - else if (typeof object.splitId === "number") - message.splitId = object.splitId; - else if (typeof object.splitId === "object") - message.splitId = new $util.LongBits(object.splitId.low >>> 0, object.splitId.high >>> 0).toNumber(true); - if (object.tabletUid != null) - if ($util.Long) - (message.tabletUid = $util.Long.fromValue(object.tabletUid)).unsigned = true; - else if (typeof object.tabletUid === "string") - message.tabletUid = parseInt(object.tabletUid, 10); - else if (typeof object.tabletUid === "number") - message.tabletUid = object.tabletUid; - else if (typeof object.tabletUid === "object") - message.tabletUid = new $util.LongBits(object.tabletUid.low >>> 0, object.tabletUid.high >>> 0).toNumber(true); - if (object.skippedTabletUid) { - if (!Array.isArray(object.skippedTabletUid)) - throw TypeError(".google.spanner.v1.RoutingHint.skippedTabletUid: array expected"); - message.skippedTabletUid = []; - for (var i = 0; i < object.skippedTabletUid.length; ++i) { - if (typeof object.skippedTabletUid[i] !== "object") - throw TypeError(".google.spanner.v1.RoutingHint.skippedTabletUid: object expected"); - message.skippedTabletUid[i] = $root.google.spanner.v1.RoutingHint.SkippedTablet.fromObject(object.skippedTabletUid[i]); - } - } - if (object.clientLocation != null) - message.clientLocation = String(object.clientLocation); - return message; - }; - - /** - * Creates a plain object from a RoutingHint message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.RoutingHint - * @static - * @param {google.spanner.v1.RoutingHint} message RoutingHint - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RoutingHint.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.skippedTabletUid = []; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.operationUid = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.operationUid = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.databaseId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.databaseId = options.longs === String ? "0" : 0; - if (options.bytes === String) - object.schemaGeneration = ""; - else { - object.schemaGeneration = []; - if (options.bytes !== Array) - object.schemaGeneration = $util.newBuffer(object.schemaGeneration); - } - if (options.bytes === String) - object.key = ""; - else { - object.key = []; - if (options.bytes !== Array) - object.key = $util.newBuffer(object.key); - } - if (options.bytes === String) - object.limitKey = ""; - else { - object.limitKey = []; - if (options.bytes !== Array) - object.limitKey = $util.newBuffer(object.limitKey); - } - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.groupUid = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.groupUid = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.splitId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.splitId = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.tabletUid = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.tabletUid = options.longs === String ? "0" : 0; - object.clientLocation = ""; - } - if (message.operationUid != null && message.hasOwnProperty("operationUid")) - if (typeof message.operationUid === "number") - object.operationUid = options.longs === String ? String(message.operationUid) : message.operationUid; - else - object.operationUid = options.longs === String ? $util.Long.prototype.toString.call(message.operationUid) : options.longs === Number ? new $util.LongBits(message.operationUid.low >>> 0, message.operationUid.high >>> 0).toNumber(true) : message.operationUid; - if (message.databaseId != null && message.hasOwnProperty("databaseId")) - if (typeof message.databaseId === "number") - object.databaseId = options.longs === String ? String(message.databaseId) : message.databaseId; - else - object.databaseId = options.longs === String ? $util.Long.prototype.toString.call(message.databaseId) : options.longs === Number ? new $util.LongBits(message.databaseId.low >>> 0, message.databaseId.high >>> 0).toNumber(true) : message.databaseId; - if (message.schemaGeneration != null && message.hasOwnProperty("schemaGeneration")) - object.schemaGeneration = options.bytes === String ? $util.base64.encode(message.schemaGeneration, 0, message.schemaGeneration.length) : options.bytes === Array ? Array.prototype.slice.call(message.schemaGeneration) : message.schemaGeneration; - if (message.key != null && message.hasOwnProperty("key")) - object.key = options.bytes === String ? $util.base64.encode(message.key, 0, message.key.length) : options.bytes === Array ? Array.prototype.slice.call(message.key) : message.key; - if (message.limitKey != null && message.hasOwnProperty("limitKey")) - object.limitKey = options.bytes === String ? $util.base64.encode(message.limitKey, 0, message.limitKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.limitKey) : message.limitKey; - if (message.groupUid != null && message.hasOwnProperty("groupUid")) - if (typeof message.groupUid === "number") - object.groupUid = options.longs === String ? String(message.groupUid) : message.groupUid; - else - object.groupUid = options.longs === String ? $util.Long.prototype.toString.call(message.groupUid) : options.longs === Number ? new $util.LongBits(message.groupUid.low >>> 0, message.groupUid.high >>> 0).toNumber(true) : message.groupUid; - if (message.splitId != null && message.hasOwnProperty("splitId")) - if (typeof message.splitId === "number") - object.splitId = options.longs === String ? String(message.splitId) : message.splitId; - else - object.splitId = options.longs === String ? $util.Long.prototype.toString.call(message.splitId) : options.longs === Number ? new $util.LongBits(message.splitId.low >>> 0, message.splitId.high >>> 0).toNumber(true) : message.splitId; - if (message.tabletUid != null && message.hasOwnProperty("tabletUid")) - if (typeof message.tabletUid === "number") - object.tabletUid = options.longs === String ? String(message.tabletUid) : message.tabletUid; - else - object.tabletUid = options.longs === String ? $util.Long.prototype.toString.call(message.tabletUid) : options.longs === Number ? new $util.LongBits(message.tabletUid.low >>> 0, message.tabletUid.high >>> 0).toNumber(true) : message.tabletUid; - if (message.skippedTabletUid && message.skippedTabletUid.length) { - object.skippedTabletUid = []; - for (var j = 0; j < message.skippedTabletUid.length; ++j) - object.skippedTabletUid[j] = $root.google.spanner.v1.RoutingHint.SkippedTablet.toObject(message.skippedTabletUid[j], options); - } - if (message.clientLocation != null && message.hasOwnProperty("clientLocation")) - object.clientLocation = message.clientLocation; - return object; - }; - - /** - * Converts this RoutingHint to JSON. - * @function toJSON - * @memberof google.spanner.v1.RoutingHint - * @instance - * @returns {Object.} JSON object - */ - RoutingHint.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RoutingHint - * @function getTypeUrl - * @memberof google.spanner.v1.RoutingHint - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RoutingHint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.RoutingHint"; - }; - - RoutingHint.SkippedTablet = (function() { - - /** - * Properties of a SkippedTablet. - * @memberof google.spanner.v1.RoutingHint - * @interface ISkippedTablet - * @property {number|Long|null} [tabletUid] SkippedTablet tabletUid - * @property {Uint8Array|null} [incarnation] SkippedTablet incarnation - */ - - /** - * Constructs a new SkippedTablet. - * @memberof google.spanner.v1.RoutingHint - * @classdesc Represents a SkippedTablet. - * @implements ISkippedTablet - * @constructor - * @param {google.spanner.v1.RoutingHint.ISkippedTablet=} [properties] Properties to set - */ - function SkippedTablet(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SkippedTablet tabletUid. - * @member {number|Long} tabletUid - * @memberof google.spanner.v1.RoutingHint.SkippedTablet - * @instance - */ - SkippedTablet.prototype.tabletUid = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * SkippedTablet incarnation. - * @member {Uint8Array} incarnation - * @memberof google.spanner.v1.RoutingHint.SkippedTablet - * @instance - */ - SkippedTablet.prototype.incarnation = $util.newBuffer([]); - - /** - * Creates a new SkippedTablet instance using the specified properties. - * @function create - * @memberof google.spanner.v1.RoutingHint.SkippedTablet - * @static - * @param {google.spanner.v1.RoutingHint.ISkippedTablet=} [properties] Properties to set - * @returns {google.spanner.v1.RoutingHint.SkippedTablet} SkippedTablet instance - */ - SkippedTablet.create = function create(properties) { - return new SkippedTablet(properties); - }; - - /** - * Encodes the specified SkippedTablet message. Does not implicitly {@link google.spanner.v1.RoutingHint.SkippedTablet.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.RoutingHint.SkippedTablet - * @static - * @param {google.spanner.v1.RoutingHint.ISkippedTablet} message SkippedTablet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SkippedTablet.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tabletUid != null && Object.hasOwnProperty.call(message, "tabletUid")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.tabletUid); - if (message.incarnation != null && Object.hasOwnProperty.call(message, "incarnation")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.incarnation); - return writer; - }; - - /** - * Encodes the specified SkippedTablet message, length delimited. Does not implicitly {@link google.spanner.v1.RoutingHint.SkippedTablet.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.RoutingHint.SkippedTablet - * @static - * @param {google.spanner.v1.RoutingHint.ISkippedTablet} message SkippedTablet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SkippedTablet.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SkippedTablet message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.RoutingHint.SkippedTablet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.RoutingHint.SkippedTablet} SkippedTablet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SkippedTablet.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.RoutingHint.SkippedTablet(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.tabletUid = reader.uint64(); - break; - } - case 2: { - message.incarnation = reader.bytes(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SkippedTablet message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.RoutingHint.SkippedTablet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.RoutingHint.SkippedTablet} SkippedTablet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SkippedTablet.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SkippedTablet message. - * @function verify - * @memberof google.spanner.v1.RoutingHint.SkippedTablet - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SkippedTablet.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.tabletUid != null && message.hasOwnProperty("tabletUid")) - if (!$util.isInteger(message.tabletUid) && !(message.tabletUid && $util.isInteger(message.tabletUid.low) && $util.isInteger(message.tabletUid.high))) - return "tabletUid: integer|Long expected"; - if (message.incarnation != null && message.hasOwnProperty("incarnation")) - if (!(message.incarnation && typeof message.incarnation.length === "number" || $util.isString(message.incarnation))) - return "incarnation: buffer expected"; - return null; - }; - - /** - * Creates a SkippedTablet message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.RoutingHint.SkippedTablet - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.RoutingHint.SkippedTablet} SkippedTablet - */ - SkippedTablet.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.RoutingHint.SkippedTablet) - return object; - var message = new $root.google.spanner.v1.RoutingHint.SkippedTablet(); - if (object.tabletUid != null) - if ($util.Long) - (message.tabletUid = $util.Long.fromValue(object.tabletUid)).unsigned = true; - else if (typeof object.tabletUid === "string") - message.tabletUid = parseInt(object.tabletUid, 10); - else if (typeof object.tabletUid === "number") - message.tabletUid = object.tabletUid; - else if (typeof object.tabletUid === "object") - message.tabletUid = new $util.LongBits(object.tabletUid.low >>> 0, object.tabletUid.high >>> 0).toNumber(true); - if (object.incarnation != null) - if (typeof object.incarnation === "string") - $util.base64.decode(object.incarnation, message.incarnation = $util.newBuffer($util.base64.length(object.incarnation)), 0); - else if (object.incarnation.length >= 0) - message.incarnation = object.incarnation; - return message; - }; - - /** - * Creates a plain object from a SkippedTablet message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.RoutingHint.SkippedTablet - * @static - * @param {google.spanner.v1.RoutingHint.SkippedTablet} message SkippedTablet - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SkippedTablet.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.tabletUid = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.tabletUid = options.longs === String ? "0" : 0; - if (options.bytes === String) - object.incarnation = ""; - else { - object.incarnation = []; - if (options.bytes !== Array) - object.incarnation = $util.newBuffer(object.incarnation); - } - } - if (message.tabletUid != null && message.hasOwnProperty("tabletUid")) - if (typeof message.tabletUid === "number") - object.tabletUid = options.longs === String ? String(message.tabletUid) : message.tabletUid; - else - object.tabletUid = options.longs === String ? $util.Long.prototype.toString.call(message.tabletUid) : options.longs === Number ? new $util.LongBits(message.tabletUid.low >>> 0, message.tabletUid.high >>> 0).toNumber(true) : message.tabletUid; - if (message.incarnation != null && message.hasOwnProperty("incarnation")) - object.incarnation = options.bytes === String ? $util.base64.encode(message.incarnation, 0, message.incarnation.length) : options.bytes === Array ? Array.prototype.slice.call(message.incarnation) : message.incarnation; - return object; - }; - - /** - * Converts this SkippedTablet to JSON. - * @function toJSON - * @memberof google.spanner.v1.RoutingHint.SkippedTablet - * @instance - * @returns {Object.} JSON object - */ - SkippedTablet.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SkippedTablet - * @function getTypeUrl - * @memberof google.spanner.v1.RoutingHint.SkippedTablet - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SkippedTablet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.RoutingHint.SkippedTablet"; - }; - - return SkippedTablet; - })(); - - return RoutingHint; - })(); - - v1.Mutation = (function() { - - /** - * Properties of a Mutation. - * @memberof google.spanner.v1 - * @interface IMutation - * @property {google.spanner.v1.Mutation.IWrite|null} [insert] Mutation insert - * @property {google.spanner.v1.Mutation.IWrite|null} [update] Mutation update - * @property {google.spanner.v1.Mutation.IWrite|null} [insertOrUpdate] Mutation insertOrUpdate - * @property {google.spanner.v1.Mutation.IWrite|null} [replace] Mutation replace - * @property {google.spanner.v1.Mutation.IDelete|null} ["delete"] Mutation delete - * @property {google.spanner.v1.Mutation.ISend|null} [send] Mutation send - * @property {google.spanner.v1.Mutation.IAck|null} [ack] Mutation ack - */ - - /** - * Constructs a new Mutation. - * @memberof google.spanner.v1 - * @classdesc Represents a Mutation. - * @implements IMutation - * @constructor - * @param {google.spanner.v1.IMutation=} [properties] Properties to set - */ - function Mutation(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Mutation insert. - * @member {google.spanner.v1.Mutation.IWrite|null|undefined} insert - * @memberof google.spanner.v1.Mutation - * @instance - */ - Mutation.prototype.insert = null; - - /** - * Mutation update. - * @member {google.spanner.v1.Mutation.IWrite|null|undefined} update - * @memberof google.spanner.v1.Mutation - * @instance - */ - Mutation.prototype.update = null; - - /** - * Mutation insertOrUpdate. - * @member {google.spanner.v1.Mutation.IWrite|null|undefined} insertOrUpdate - * @memberof google.spanner.v1.Mutation - * @instance - */ - Mutation.prototype.insertOrUpdate = null; - - /** - * Mutation replace. - * @member {google.spanner.v1.Mutation.IWrite|null|undefined} replace - * @memberof google.spanner.v1.Mutation - * @instance - */ - Mutation.prototype.replace = null; - - /** - * Mutation delete. - * @member {google.spanner.v1.Mutation.IDelete|null|undefined} delete - * @memberof google.spanner.v1.Mutation - * @instance - */ - Mutation.prototype["delete"] = null; - - /** - * Mutation send. - * @member {google.spanner.v1.Mutation.ISend|null|undefined} send - * @memberof google.spanner.v1.Mutation - * @instance - */ - Mutation.prototype.send = null; - - /** - * Mutation ack. - * @member {google.spanner.v1.Mutation.IAck|null|undefined} ack - * @memberof google.spanner.v1.Mutation - * @instance - */ - Mutation.prototype.ack = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Mutation operation. - * @member {"insert"|"update"|"insertOrUpdate"|"replace"|"delete"|"send"|"ack"|undefined} operation - * @memberof google.spanner.v1.Mutation - * @instance - */ - Object.defineProperty(Mutation.prototype, "operation", { - get: $util.oneOfGetter($oneOfFields = ["insert", "update", "insertOrUpdate", "replace", "delete", "send", "ack"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Mutation instance using the specified properties. - * @function create - * @memberof google.spanner.v1.Mutation - * @static - * @param {google.spanner.v1.IMutation=} [properties] Properties to set - * @returns {google.spanner.v1.Mutation} Mutation instance - */ - Mutation.create = function create(properties) { - return new Mutation(properties); - }; - - /** - * Encodes the specified Mutation message. Does not implicitly {@link google.spanner.v1.Mutation.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.Mutation - * @static - * @param {google.spanner.v1.IMutation} message Mutation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Mutation.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.insert != null && Object.hasOwnProperty.call(message, "insert")) - $root.google.spanner.v1.Mutation.Write.encode(message.insert, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.update != null && Object.hasOwnProperty.call(message, "update")) - $root.google.spanner.v1.Mutation.Write.encode(message.update, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.insertOrUpdate != null && Object.hasOwnProperty.call(message, "insertOrUpdate")) - $root.google.spanner.v1.Mutation.Write.encode(message.insertOrUpdate, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.replace != null && Object.hasOwnProperty.call(message, "replace")) - $root.google.spanner.v1.Mutation.Write.encode(message.replace, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) - $root.google.spanner.v1.Mutation.Delete.encode(message["delete"], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.send != null && Object.hasOwnProperty.call(message, "send")) - $root.google.spanner.v1.Mutation.Send.encode(message.send, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.ack != null && Object.hasOwnProperty.call(message, "ack")) - $root.google.spanner.v1.Mutation.Ack.encode(message.ack, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Mutation message, length delimited. Does not implicitly {@link google.spanner.v1.Mutation.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.Mutation - * @static - * @param {google.spanner.v1.IMutation} message Mutation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Mutation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Mutation message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.Mutation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.Mutation} Mutation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Mutation.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.Mutation(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.insert = $root.google.spanner.v1.Mutation.Write.decode(reader, reader.uint32()); - break; - } - case 2: { - message.update = $root.google.spanner.v1.Mutation.Write.decode(reader, reader.uint32()); - break; - } - case 3: { - message.insertOrUpdate = $root.google.spanner.v1.Mutation.Write.decode(reader, reader.uint32()); - break; - } - case 4: { - message.replace = $root.google.spanner.v1.Mutation.Write.decode(reader, reader.uint32()); - break; - } - case 5: { - message["delete"] = $root.google.spanner.v1.Mutation.Delete.decode(reader, reader.uint32()); - break; - } - case 6: { - message.send = $root.google.spanner.v1.Mutation.Send.decode(reader, reader.uint32()); - break; - } - case 7: { - message.ack = $root.google.spanner.v1.Mutation.Ack.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Mutation message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.Mutation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.Mutation} Mutation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Mutation.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Mutation message. - * @function verify - * @memberof google.spanner.v1.Mutation - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Mutation.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.insert != null && message.hasOwnProperty("insert")) { - properties.operation = 1; - { - var error = $root.google.spanner.v1.Mutation.Write.verify(message.insert); - if (error) - return "insert." + error; - } - } - if (message.update != null && message.hasOwnProperty("update")) { - if (properties.operation === 1) - return "operation: multiple values"; - properties.operation = 1; - { - var error = $root.google.spanner.v1.Mutation.Write.verify(message.update); - if (error) - return "update." + error; - } - } - if (message.insertOrUpdate != null && message.hasOwnProperty("insertOrUpdate")) { - if (properties.operation === 1) - return "operation: multiple values"; - properties.operation = 1; - { - var error = $root.google.spanner.v1.Mutation.Write.verify(message.insertOrUpdate); - if (error) - return "insertOrUpdate." + error; - } - } - if (message.replace != null && message.hasOwnProperty("replace")) { - if (properties.operation === 1) - return "operation: multiple values"; - properties.operation = 1; - { - var error = $root.google.spanner.v1.Mutation.Write.verify(message.replace); - if (error) - return "replace." + error; - } - } - if (message["delete"] != null && message.hasOwnProperty("delete")) { - if (properties.operation === 1) - return "operation: multiple values"; - properties.operation = 1; - { - var error = $root.google.spanner.v1.Mutation.Delete.verify(message["delete"]); - if (error) - return "delete." + error; - } - } - if (message.send != null && message.hasOwnProperty("send")) { - if (properties.operation === 1) - return "operation: multiple values"; - properties.operation = 1; - { - var error = $root.google.spanner.v1.Mutation.Send.verify(message.send); - if (error) - return "send." + error; - } - } - if (message.ack != null && message.hasOwnProperty("ack")) { - if (properties.operation === 1) - return "operation: multiple values"; - properties.operation = 1; - { - var error = $root.google.spanner.v1.Mutation.Ack.verify(message.ack); - if (error) - return "ack." + error; - } - } - return null; - }; - - /** - * Creates a Mutation message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.Mutation - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.Mutation} Mutation - */ - Mutation.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.Mutation) - return object; - var message = new $root.google.spanner.v1.Mutation(); - if (object.insert != null) { - if (typeof object.insert !== "object") - throw TypeError(".google.spanner.v1.Mutation.insert: object expected"); - message.insert = $root.google.spanner.v1.Mutation.Write.fromObject(object.insert); - } - if (object.update != null) { - if (typeof object.update !== "object") - throw TypeError(".google.spanner.v1.Mutation.update: object expected"); - message.update = $root.google.spanner.v1.Mutation.Write.fromObject(object.update); - } - if (object.insertOrUpdate != null) { - if (typeof object.insertOrUpdate !== "object") - throw TypeError(".google.spanner.v1.Mutation.insertOrUpdate: object expected"); - message.insertOrUpdate = $root.google.spanner.v1.Mutation.Write.fromObject(object.insertOrUpdate); - } - if (object.replace != null) { - if (typeof object.replace !== "object") - throw TypeError(".google.spanner.v1.Mutation.replace: object expected"); - message.replace = $root.google.spanner.v1.Mutation.Write.fromObject(object.replace); - } - if (object["delete"] != null) { - if (typeof object["delete"] !== "object") - throw TypeError(".google.spanner.v1.Mutation.delete: object expected"); - message["delete"] = $root.google.spanner.v1.Mutation.Delete.fromObject(object["delete"]); - } - if (object.send != null) { - if (typeof object.send !== "object") - throw TypeError(".google.spanner.v1.Mutation.send: object expected"); - message.send = $root.google.spanner.v1.Mutation.Send.fromObject(object.send); - } - if (object.ack != null) { - if (typeof object.ack !== "object") - throw TypeError(".google.spanner.v1.Mutation.ack: object expected"); - message.ack = $root.google.spanner.v1.Mutation.Ack.fromObject(object.ack); - } - return message; - }; - - /** - * Creates a plain object from a Mutation message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.Mutation - * @static - * @param {google.spanner.v1.Mutation} message Mutation - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Mutation.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.insert != null && message.hasOwnProperty("insert")) { - object.insert = $root.google.spanner.v1.Mutation.Write.toObject(message.insert, options); - if (options.oneofs) - object.operation = "insert"; - } - if (message.update != null && message.hasOwnProperty("update")) { - object.update = $root.google.spanner.v1.Mutation.Write.toObject(message.update, options); - if (options.oneofs) - object.operation = "update"; - } - if (message.insertOrUpdate != null && message.hasOwnProperty("insertOrUpdate")) { - object.insertOrUpdate = $root.google.spanner.v1.Mutation.Write.toObject(message.insertOrUpdate, options); - if (options.oneofs) - object.operation = "insertOrUpdate"; - } - if (message.replace != null && message.hasOwnProperty("replace")) { - object.replace = $root.google.spanner.v1.Mutation.Write.toObject(message.replace, options); - if (options.oneofs) - object.operation = "replace"; - } - if (message["delete"] != null && message.hasOwnProperty("delete")) { - object["delete"] = $root.google.spanner.v1.Mutation.Delete.toObject(message["delete"], options); - if (options.oneofs) - object.operation = "delete"; - } - if (message.send != null && message.hasOwnProperty("send")) { - object.send = $root.google.spanner.v1.Mutation.Send.toObject(message.send, options); - if (options.oneofs) - object.operation = "send"; - } - if (message.ack != null && message.hasOwnProperty("ack")) { - object.ack = $root.google.spanner.v1.Mutation.Ack.toObject(message.ack, options); - if (options.oneofs) - object.operation = "ack"; - } - return object; - }; - - /** - * Converts this Mutation to JSON. - * @function toJSON - * @memberof google.spanner.v1.Mutation - * @instance - * @returns {Object.} JSON object - */ - Mutation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Mutation - * @function getTypeUrl - * @memberof google.spanner.v1.Mutation - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Mutation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.Mutation"; - }; - - Mutation.Write = (function() { - - /** - * Properties of a Write. - * @memberof google.spanner.v1.Mutation - * @interface IWrite - * @property {string|null} [table] Write table - * @property {Array.|null} [columns] Write columns - * @property {Array.|null} [values] Write values - */ - - /** - * Constructs a new Write. - * @memberof google.spanner.v1.Mutation - * @classdesc Represents a Write. - * @implements IWrite - * @constructor - * @param {google.spanner.v1.Mutation.IWrite=} [properties] Properties to set - */ - function Write(properties) { - this.columns = []; - this.values = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Write table. - * @member {string} table - * @memberof google.spanner.v1.Mutation.Write - * @instance - */ - Write.prototype.table = ""; - - /** - * Write columns. - * @member {Array.} columns - * @memberof google.spanner.v1.Mutation.Write - * @instance - */ - Write.prototype.columns = $util.emptyArray; - - /** - * Write values. - * @member {Array.} values - * @memberof google.spanner.v1.Mutation.Write - * @instance - */ - Write.prototype.values = $util.emptyArray; - - /** - * Creates a new Write instance using the specified properties. - * @function create - * @memberof google.spanner.v1.Mutation.Write - * @static - * @param {google.spanner.v1.Mutation.IWrite=} [properties] Properties to set - * @returns {google.spanner.v1.Mutation.Write} Write instance - */ - Write.create = function create(properties) { - return new Write(properties); - }; - - /** - * Encodes the specified Write message. Does not implicitly {@link google.spanner.v1.Mutation.Write.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.Mutation.Write - * @static - * @param {google.spanner.v1.Mutation.IWrite} message Write message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Write.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.table != null && Object.hasOwnProperty.call(message, "table")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.table); - if (message.columns != null && message.columns.length) - for (var i = 0; i < message.columns.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.columns[i]); - if (message.values != null && message.values.length) - for (var i = 0; i < message.values.length; ++i) - $root.google.protobuf.ListValue.encode(message.values[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Write message, length delimited. Does not implicitly {@link google.spanner.v1.Mutation.Write.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.Mutation.Write - * @static - * @param {google.spanner.v1.Mutation.IWrite} message Write message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Write.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Write message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.Mutation.Write - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.Mutation.Write} Write - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Write.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.Mutation.Write(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.table = reader.string(); - break; - } - case 2: { - if (!(message.columns && message.columns.length)) - message.columns = []; - message.columns.push(reader.string()); - break; - } - case 3: { - if (!(message.values && message.values.length)) - message.values = []; - message.values.push($root.google.protobuf.ListValue.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Write message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.Mutation.Write - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.Mutation.Write} Write - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Write.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Write message. - * @function verify - * @memberof google.spanner.v1.Mutation.Write - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Write.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.table != null && message.hasOwnProperty("table")) - if (!$util.isString(message.table)) - return "table: string expected"; - if (message.columns != null && message.hasOwnProperty("columns")) { - if (!Array.isArray(message.columns)) - return "columns: array expected"; - for (var i = 0; i < message.columns.length; ++i) - if (!$util.isString(message.columns[i])) - return "columns: string[] expected"; - } - if (message.values != null && message.hasOwnProperty("values")) { - if (!Array.isArray(message.values)) - return "values: array expected"; - for (var i = 0; i < message.values.length; ++i) { - var error = $root.google.protobuf.ListValue.verify(message.values[i]); - if (error) - return "values." + error; - } - } - return null; - }; - - /** - * Creates a Write message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.Mutation.Write - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.Mutation.Write} Write - */ - Write.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.Mutation.Write) - return object; - var message = new $root.google.spanner.v1.Mutation.Write(); - if (object.table != null) - message.table = String(object.table); - if (object.columns) { - if (!Array.isArray(object.columns)) - throw TypeError(".google.spanner.v1.Mutation.Write.columns: array expected"); - message.columns = []; - for (var i = 0; i < object.columns.length; ++i) - message.columns[i] = String(object.columns[i]); - } - if (object.values) { - if (!Array.isArray(object.values)) - throw TypeError(".google.spanner.v1.Mutation.Write.values: array expected"); - message.values = []; - for (var i = 0; i < object.values.length; ++i) { - if (typeof object.values[i] !== "object") - throw TypeError(".google.spanner.v1.Mutation.Write.values: object expected"); - message.values[i] = $root.google.protobuf.ListValue.fromObject(object.values[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a Write message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.Mutation.Write - * @static - * @param {google.spanner.v1.Mutation.Write} message Write - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Write.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.columns = []; - object.values = []; - } - if (options.defaults) - object.table = ""; - if (message.table != null && message.hasOwnProperty("table")) - object.table = message.table; - if (message.columns && message.columns.length) { - object.columns = []; - for (var j = 0; j < message.columns.length; ++j) - object.columns[j] = message.columns[j]; - } - if (message.values && message.values.length) { - object.values = []; - for (var j = 0; j < message.values.length; ++j) - object.values[j] = $root.google.protobuf.ListValue.toObject(message.values[j], options); - } - return object; - }; - - /** - * Converts this Write to JSON. - * @function toJSON - * @memberof google.spanner.v1.Mutation.Write - * @instance - * @returns {Object.} JSON object - */ - Write.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Write - * @function getTypeUrl - * @memberof google.spanner.v1.Mutation.Write - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Write.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.Mutation.Write"; - }; - - return Write; - })(); - - Mutation.Delete = (function() { - - /** - * Properties of a Delete. - * @memberof google.spanner.v1.Mutation - * @interface IDelete - * @property {string|null} [table] Delete table - * @property {google.spanner.v1.IKeySet|null} [keySet] Delete keySet - */ - - /** - * Constructs a new Delete. - * @memberof google.spanner.v1.Mutation - * @classdesc Represents a Delete. - * @implements IDelete - * @constructor - * @param {google.spanner.v1.Mutation.IDelete=} [properties] Properties to set - */ - function Delete(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Delete table. - * @member {string} table - * @memberof google.spanner.v1.Mutation.Delete - * @instance - */ - Delete.prototype.table = ""; - - /** - * Delete keySet. - * @member {google.spanner.v1.IKeySet|null|undefined} keySet - * @memberof google.spanner.v1.Mutation.Delete - * @instance - */ - Delete.prototype.keySet = null; - - /** - * Creates a new Delete instance using the specified properties. - * @function create - * @memberof google.spanner.v1.Mutation.Delete - * @static - * @param {google.spanner.v1.Mutation.IDelete=} [properties] Properties to set - * @returns {google.spanner.v1.Mutation.Delete} Delete instance - */ - Delete.create = function create(properties) { - return new Delete(properties); - }; - - /** - * Encodes the specified Delete message. Does not implicitly {@link google.spanner.v1.Mutation.Delete.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.Mutation.Delete - * @static - * @param {google.spanner.v1.Mutation.IDelete} message Delete message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Delete.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.table != null && Object.hasOwnProperty.call(message, "table")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.table); - if (message.keySet != null && Object.hasOwnProperty.call(message, "keySet")) - $root.google.spanner.v1.KeySet.encode(message.keySet, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Delete message, length delimited. Does not implicitly {@link google.spanner.v1.Mutation.Delete.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.Mutation.Delete - * @static - * @param {google.spanner.v1.Mutation.IDelete} message Delete message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Delete.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Delete message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.Mutation.Delete - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.Mutation.Delete} Delete - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Delete.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.Mutation.Delete(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.table = reader.string(); - break; - } - case 2: { - message.keySet = $root.google.spanner.v1.KeySet.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Delete message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.Mutation.Delete - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.Mutation.Delete} Delete - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Delete.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Delete message. - * @function verify - * @memberof google.spanner.v1.Mutation.Delete - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Delete.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.table != null && message.hasOwnProperty("table")) - if (!$util.isString(message.table)) - return "table: string expected"; - if (message.keySet != null && message.hasOwnProperty("keySet")) { - var error = $root.google.spanner.v1.KeySet.verify(message.keySet); - if (error) - return "keySet." + error; - } - return null; - }; - - /** - * Creates a Delete message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.Mutation.Delete - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.Mutation.Delete} Delete - */ - Delete.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.Mutation.Delete) - return object; - var message = new $root.google.spanner.v1.Mutation.Delete(); - if (object.table != null) - message.table = String(object.table); - if (object.keySet != null) { - if (typeof object.keySet !== "object") - throw TypeError(".google.spanner.v1.Mutation.Delete.keySet: object expected"); - message.keySet = $root.google.spanner.v1.KeySet.fromObject(object.keySet); - } - return message; - }; - - /** - * Creates a plain object from a Delete message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.Mutation.Delete - * @static - * @param {google.spanner.v1.Mutation.Delete} message Delete - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Delete.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.table = ""; - object.keySet = null; - } - if (message.table != null && message.hasOwnProperty("table")) - object.table = message.table; - if (message.keySet != null && message.hasOwnProperty("keySet")) - object.keySet = $root.google.spanner.v1.KeySet.toObject(message.keySet, options); - return object; - }; - - /** - * Converts this Delete to JSON. - * @function toJSON - * @memberof google.spanner.v1.Mutation.Delete - * @instance - * @returns {Object.} JSON object - */ - Delete.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Delete - * @function getTypeUrl - * @memberof google.spanner.v1.Mutation.Delete - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Delete.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.Mutation.Delete"; - }; - - return Delete; - })(); - - Mutation.Send = (function() { - - /** - * Properties of a Send. - * @memberof google.spanner.v1.Mutation - * @interface ISend - * @property {string|null} [queue] Send queue - * @property {google.protobuf.IListValue|null} [key] Send key - * @property {google.protobuf.ITimestamp|null} [deliverTime] Send deliverTime - * @property {google.protobuf.IValue|null} [payload] Send payload - */ - - /** - * Constructs a new Send. - * @memberof google.spanner.v1.Mutation - * @classdesc Represents a Send. - * @implements ISend - * @constructor - * @param {google.spanner.v1.Mutation.ISend=} [properties] Properties to set - */ - function Send(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Send queue. - * @member {string} queue - * @memberof google.spanner.v1.Mutation.Send - * @instance - */ - Send.prototype.queue = ""; - - /** - * Send key. - * @member {google.protobuf.IListValue|null|undefined} key - * @memberof google.spanner.v1.Mutation.Send - * @instance - */ - Send.prototype.key = null; - - /** - * Send deliverTime. - * @member {google.protobuf.ITimestamp|null|undefined} deliverTime - * @memberof google.spanner.v1.Mutation.Send - * @instance - */ - Send.prototype.deliverTime = null; - - /** - * Send payload. - * @member {google.protobuf.IValue|null|undefined} payload - * @memberof google.spanner.v1.Mutation.Send - * @instance - */ - Send.prototype.payload = null; - - /** - * Creates a new Send instance using the specified properties. - * @function create - * @memberof google.spanner.v1.Mutation.Send - * @static - * @param {google.spanner.v1.Mutation.ISend=} [properties] Properties to set - * @returns {google.spanner.v1.Mutation.Send} Send instance - */ - Send.create = function create(properties) { - return new Send(properties); - }; - - /** - * Encodes the specified Send message. Does not implicitly {@link google.spanner.v1.Mutation.Send.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.Mutation.Send - * @static - * @param {google.spanner.v1.Mutation.ISend} message Send message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Send.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.queue != null && Object.hasOwnProperty.call(message, "queue")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.queue); - if (message.key != null && Object.hasOwnProperty.call(message, "key")) - $root.google.protobuf.ListValue.encode(message.key, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.deliverTime != null && Object.hasOwnProperty.call(message, "deliverTime")) - $root.google.protobuf.Timestamp.encode(message.deliverTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.payload != null && Object.hasOwnProperty.call(message, "payload")) - $root.google.protobuf.Value.encode(message.payload, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Send message, length delimited. Does not implicitly {@link google.spanner.v1.Mutation.Send.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.Mutation.Send - * @static - * @param {google.spanner.v1.Mutation.ISend} message Send message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Send.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Send message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.Mutation.Send - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.Mutation.Send} Send - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Send.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.Mutation.Send(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.queue = reader.string(); - break; - } - case 2: { - message.key = $root.google.protobuf.ListValue.decode(reader, reader.uint32()); - break; - } - case 3: { - message.deliverTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 4: { - message.payload = $root.google.protobuf.Value.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Send message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.Mutation.Send - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.Mutation.Send} Send - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Send.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Send message. - * @function verify - * @memberof google.spanner.v1.Mutation.Send - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Send.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.queue != null && message.hasOwnProperty("queue")) - if (!$util.isString(message.queue)) - return "queue: string expected"; - if (message.key != null && message.hasOwnProperty("key")) { - var error = $root.google.protobuf.ListValue.verify(message.key); - if (error) - return "key." + error; - } - if (message.deliverTime != null && message.hasOwnProperty("deliverTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.deliverTime); - if (error) - return "deliverTime." + error; - } - if (message.payload != null && message.hasOwnProperty("payload")) { - var error = $root.google.protobuf.Value.verify(message.payload); - if (error) - return "payload." + error; - } - return null; - }; - - /** - * Creates a Send message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.Mutation.Send - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.Mutation.Send} Send - */ - Send.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.Mutation.Send) - return object; - var message = new $root.google.spanner.v1.Mutation.Send(); - if (object.queue != null) - message.queue = String(object.queue); - if (object.key != null) { - if (typeof object.key !== "object") - throw TypeError(".google.spanner.v1.Mutation.Send.key: object expected"); - message.key = $root.google.protobuf.ListValue.fromObject(object.key); - } - if (object.deliverTime != null) { - if (typeof object.deliverTime !== "object") - throw TypeError(".google.spanner.v1.Mutation.Send.deliverTime: object expected"); - message.deliverTime = $root.google.protobuf.Timestamp.fromObject(object.deliverTime); - } - if (object.payload != null) { - if (typeof object.payload !== "object") - throw TypeError(".google.spanner.v1.Mutation.Send.payload: object expected"); - message.payload = $root.google.protobuf.Value.fromObject(object.payload); - } - return message; - }; - - /** - * Creates a plain object from a Send message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.Mutation.Send - * @static - * @param {google.spanner.v1.Mutation.Send} message Send - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Send.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.queue = ""; - object.key = null; - object.deliverTime = null; - object.payload = null; - } - if (message.queue != null && message.hasOwnProperty("queue")) - object.queue = message.queue; - if (message.key != null && message.hasOwnProperty("key")) - object.key = $root.google.protobuf.ListValue.toObject(message.key, options); - if (message.deliverTime != null && message.hasOwnProperty("deliverTime")) - object.deliverTime = $root.google.protobuf.Timestamp.toObject(message.deliverTime, options); - if (message.payload != null && message.hasOwnProperty("payload")) - object.payload = $root.google.protobuf.Value.toObject(message.payload, options); - return object; - }; - - /** - * Converts this Send to JSON. - * @function toJSON - * @memberof google.spanner.v1.Mutation.Send - * @instance - * @returns {Object.} JSON object - */ - Send.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Send - * @function getTypeUrl - * @memberof google.spanner.v1.Mutation.Send - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Send.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.Mutation.Send"; - }; - - return Send; - })(); - - Mutation.Ack = (function() { - - /** - * Properties of an Ack. - * @memberof google.spanner.v1.Mutation - * @interface IAck - * @property {string|null} [queue] Ack queue - * @property {google.protobuf.IListValue|null} [key] Ack key - * @property {boolean|null} [ignoreNotFound] Ack ignoreNotFound - */ - - /** - * Constructs a new Ack. - * @memberof google.spanner.v1.Mutation - * @classdesc Represents an Ack. - * @implements IAck - * @constructor - * @param {google.spanner.v1.Mutation.IAck=} [properties] Properties to set - */ - function Ack(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Ack queue. - * @member {string} queue - * @memberof google.spanner.v1.Mutation.Ack - * @instance - */ - Ack.prototype.queue = ""; - - /** - * Ack key. - * @member {google.protobuf.IListValue|null|undefined} key - * @memberof google.spanner.v1.Mutation.Ack - * @instance - */ - Ack.prototype.key = null; - - /** - * Ack ignoreNotFound. - * @member {boolean} ignoreNotFound - * @memberof google.spanner.v1.Mutation.Ack - * @instance - */ - Ack.prototype.ignoreNotFound = false; - - /** - * Creates a new Ack instance using the specified properties. - * @function create - * @memberof google.spanner.v1.Mutation.Ack - * @static - * @param {google.spanner.v1.Mutation.IAck=} [properties] Properties to set - * @returns {google.spanner.v1.Mutation.Ack} Ack instance - */ - Ack.create = function create(properties) { - return new Ack(properties); - }; - - /** - * Encodes the specified Ack message. Does not implicitly {@link google.spanner.v1.Mutation.Ack.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.Mutation.Ack - * @static - * @param {google.spanner.v1.Mutation.IAck} message Ack message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Ack.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.queue != null && Object.hasOwnProperty.call(message, "queue")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.queue); - if (message.key != null && Object.hasOwnProperty.call(message, "key")) - $root.google.protobuf.ListValue.encode(message.key, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.ignoreNotFound != null && Object.hasOwnProperty.call(message, "ignoreNotFound")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.ignoreNotFound); - return writer; - }; - - /** - * Encodes the specified Ack message, length delimited. Does not implicitly {@link google.spanner.v1.Mutation.Ack.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.Mutation.Ack - * @static - * @param {google.spanner.v1.Mutation.IAck} message Ack message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Ack.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Ack message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.Mutation.Ack - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.Mutation.Ack} Ack - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Ack.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.Mutation.Ack(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.queue = reader.string(); - break; - } - case 2: { - message.key = $root.google.protobuf.ListValue.decode(reader, reader.uint32()); - break; - } - case 3: { - message.ignoreNotFound = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Ack message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.Mutation.Ack - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.Mutation.Ack} Ack - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Ack.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Ack message. - * @function verify - * @memberof google.spanner.v1.Mutation.Ack - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Ack.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.queue != null && message.hasOwnProperty("queue")) - if (!$util.isString(message.queue)) - return "queue: string expected"; - if (message.key != null && message.hasOwnProperty("key")) { - var error = $root.google.protobuf.ListValue.verify(message.key); - if (error) - return "key." + error; - } - if (message.ignoreNotFound != null && message.hasOwnProperty("ignoreNotFound")) - if (typeof message.ignoreNotFound !== "boolean") - return "ignoreNotFound: boolean expected"; - return null; - }; - - /** - * Creates an Ack message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.Mutation.Ack - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.Mutation.Ack} Ack - */ - Ack.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.Mutation.Ack) - return object; - var message = new $root.google.spanner.v1.Mutation.Ack(); - if (object.queue != null) - message.queue = String(object.queue); - if (object.key != null) { - if (typeof object.key !== "object") - throw TypeError(".google.spanner.v1.Mutation.Ack.key: object expected"); - message.key = $root.google.protobuf.ListValue.fromObject(object.key); - } - if (object.ignoreNotFound != null) - message.ignoreNotFound = Boolean(object.ignoreNotFound); - return message; - }; - - /** - * Creates a plain object from an Ack message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.Mutation.Ack - * @static - * @param {google.spanner.v1.Mutation.Ack} message Ack - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Ack.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.queue = ""; - object.key = null; - object.ignoreNotFound = false; - } - if (message.queue != null && message.hasOwnProperty("queue")) - object.queue = message.queue; - if (message.key != null && message.hasOwnProperty("key")) - object.key = $root.google.protobuf.ListValue.toObject(message.key, options); - if (message.ignoreNotFound != null && message.hasOwnProperty("ignoreNotFound")) - object.ignoreNotFound = message.ignoreNotFound; - return object; - }; - - /** - * Converts this Ack to JSON. - * @function toJSON - * @memberof google.spanner.v1.Mutation.Ack - * @instance - * @returns {Object.} JSON object - */ - Ack.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Ack - * @function getTypeUrl - * @memberof google.spanner.v1.Mutation.Ack - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Ack.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.Mutation.Ack"; - }; - - return Ack; - })(); - - return Mutation; - })(); - - v1.PlanNode = (function() { - - /** - * Properties of a PlanNode. - * @memberof google.spanner.v1 - * @interface IPlanNode - * @property {number|null} [index] PlanNode index - * @property {google.spanner.v1.PlanNode.Kind|null} [kind] PlanNode kind - * @property {string|null} [displayName] PlanNode displayName - * @property {Array.|null} [childLinks] PlanNode childLinks - * @property {google.spanner.v1.PlanNode.IShortRepresentation|null} [shortRepresentation] PlanNode shortRepresentation - * @property {google.protobuf.IStruct|null} [metadata] PlanNode metadata - * @property {google.protobuf.IStruct|null} [executionStats] PlanNode executionStats - */ - - /** - * Constructs a new PlanNode. - * @memberof google.spanner.v1 - * @classdesc Represents a PlanNode. - * @implements IPlanNode - * @constructor - * @param {google.spanner.v1.IPlanNode=} [properties] Properties to set - */ - function PlanNode(properties) { - this.childLinks = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PlanNode index. - * @member {number} index - * @memberof google.spanner.v1.PlanNode - * @instance - */ - PlanNode.prototype.index = 0; - - /** - * PlanNode kind. - * @member {google.spanner.v1.PlanNode.Kind} kind - * @memberof google.spanner.v1.PlanNode - * @instance - */ - PlanNode.prototype.kind = 0; - - /** - * PlanNode displayName. - * @member {string} displayName - * @memberof google.spanner.v1.PlanNode - * @instance - */ - PlanNode.prototype.displayName = ""; - - /** - * PlanNode childLinks. - * @member {Array.} childLinks - * @memberof google.spanner.v1.PlanNode - * @instance - */ - PlanNode.prototype.childLinks = $util.emptyArray; - - /** - * PlanNode shortRepresentation. - * @member {google.spanner.v1.PlanNode.IShortRepresentation|null|undefined} shortRepresentation - * @memberof google.spanner.v1.PlanNode - * @instance - */ - PlanNode.prototype.shortRepresentation = null; - - /** - * PlanNode metadata. - * @member {google.protobuf.IStruct|null|undefined} metadata - * @memberof google.spanner.v1.PlanNode - * @instance - */ - PlanNode.prototype.metadata = null; - - /** - * PlanNode executionStats. - * @member {google.protobuf.IStruct|null|undefined} executionStats - * @memberof google.spanner.v1.PlanNode - * @instance - */ - PlanNode.prototype.executionStats = null; - - /** - * Creates a new PlanNode instance using the specified properties. - * @function create - * @memberof google.spanner.v1.PlanNode - * @static - * @param {google.spanner.v1.IPlanNode=} [properties] Properties to set - * @returns {google.spanner.v1.PlanNode} PlanNode instance - */ - PlanNode.create = function create(properties) { - return new PlanNode(properties); - }; - - /** - * Encodes the specified PlanNode message. Does not implicitly {@link google.spanner.v1.PlanNode.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.PlanNode - * @static - * @param {google.spanner.v1.IPlanNode} message PlanNode message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PlanNode.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.index != null && Object.hasOwnProperty.call(message, "index")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.index); - if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.kind); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.displayName); - if (message.childLinks != null && message.childLinks.length) - for (var i = 0; i < message.childLinks.length; ++i) - $root.google.spanner.v1.PlanNode.ChildLink.encode(message.childLinks[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.shortRepresentation != null && Object.hasOwnProperty.call(message, "shortRepresentation")) - $root.google.spanner.v1.PlanNode.ShortRepresentation.encode(message.shortRepresentation, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.google.protobuf.Struct.encode(message.metadata, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.executionStats != null && Object.hasOwnProperty.call(message, "executionStats")) - $root.google.protobuf.Struct.encode(message.executionStats, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified PlanNode message, length delimited. Does not implicitly {@link google.spanner.v1.PlanNode.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.PlanNode - * @static - * @param {google.spanner.v1.IPlanNode} message PlanNode message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PlanNode.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PlanNode message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.PlanNode - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.PlanNode} PlanNode - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PlanNode.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.PlanNode(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.index = reader.int32(); - break; - } - case 2: { - message.kind = reader.int32(); - break; - } - case 3: { - message.displayName = reader.string(); - break; - } - case 4: { - if (!(message.childLinks && message.childLinks.length)) - message.childLinks = []; - message.childLinks.push($root.google.spanner.v1.PlanNode.ChildLink.decode(reader, reader.uint32())); - break; - } - case 5: { - message.shortRepresentation = $root.google.spanner.v1.PlanNode.ShortRepresentation.decode(reader, reader.uint32()); - break; - } - case 6: { - message.metadata = $root.google.protobuf.Struct.decode(reader, reader.uint32()); - break; - } - case 7: { - message.executionStats = $root.google.protobuf.Struct.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PlanNode message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.PlanNode - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.PlanNode} PlanNode - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PlanNode.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PlanNode message. - * @function verify - * @memberof google.spanner.v1.PlanNode - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PlanNode.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.index != null && message.hasOwnProperty("index")) - if (!$util.isInteger(message.index)) - return "index: integer expected"; - if (message.kind != null && message.hasOwnProperty("kind")) - switch (message.kind) { - default: - return "kind: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.childLinks != null && message.hasOwnProperty("childLinks")) { - if (!Array.isArray(message.childLinks)) - return "childLinks: array expected"; - for (var i = 0; i < message.childLinks.length; ++i) { - var error = $root.google.spanner.v1.PlanNode.ChildLink.verify(message.childLinks[i]); - if (error) - return "childLinks." + error; - } - } - if (message.shortRepresentation != null && message.hasOwnProperty("shortRepresentation")) { - var error = $root.google.spanner.v1.PlanNode.ShortRepresentation.verify(message.shortRepresentation); - if (error) - return "shortRepresentation." + error; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.google.protobuf.Struct.verify(message.metadata); - if (error) - return "metadata." + error; - } - if (message.executionStats != null && message.hasOwnProperty("executionStats")) { - var error = $root.google.protobuf.Struct.verify(message.executionStats); - if (error) - return "executionStats." + error; - } - return null; - }; - - /** - * Creates a PlanNode message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.PlanNode - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.PlanNode} PlanNode - */ - PlanNode.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.PlanNode) - return object; - var message = new $root.google.spanner.v1.PlanNode(); - if (object.index != null) - message.index = object.index | 0; - switch (object.kind) { - default: - if (typeof object.kind === "number") { - message.kind = object.kind; - break; - } - break; - case "KIND_UNSPECIFIED": - case 0: - message.kind = 0; - break; - case "RELATIONAL": - case 1: - message.kind = 1; - break; - case "SCALAR": - case 2: - message.kind = 2; - break; - } - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.childLinks) { - if (!Array.isArray(object.childLinks)) - throw TypeError(".google.spanner.v1.PlanNode.childLinks: array expected"); - message.childLinks = []; - for (var i = 0; i < object.childLinks.length; ++i) { - if (typeof object.childLinks[i] !== "object") - throw TypeError(".google.spanner.v1.PlanNode.childLinks: object expected"); - message.childLinks[i] = $root.google.spanner.v1.PlanNode.ChildLink.fromObject(object.childLinks[i]); - } - } - if (object.shortRepresentation != null) { - if (typeof object.shortRepresentation !== "object") - throw TypeError(".google.spanner.v1.PlanNode.shortRepresentation: object expected"); - message.shortRepresentation = $root.google.spanner.v1.PlanNode.ShortRepresentation.fromObject(object.shortRepresentation); - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".google.spanner.v1.PlanNode.metadata: object expected"); - message.metadata = $root.google.protobuf.Struct.fromObject(object.metadata); - } - if (object.executionStats != null) { - if (typeof object.executionStats !== "object") - throw TypeError(".google.spanner.v1.PlanNode.executionStats: object expected"); - message.executionStats = $root.google.protobuf.Struct.fromObject(object.executionStats); - } - return message; - }; - - /** - * Creates a plain object from a PlanNode message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.PlanNode - * @static - * @param {google.spanner.v1.PlanNode} message PlanNode - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PlanNode.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.childLinks = []; - if (options.defaults) { - object.index = 0; - object.kind = options.enums === String ? "KIND_UNSPECIFIED" : 0; - object.displayName = ""; - object.shortRepresentation = null; - object.metadata = null; - object.executionStats = null; - } - if (message.index != null && message.hasOwnProperty("index")) - object.index = message.index; - if (message.kind != null && message.hasOwnProperty("kind")) - object.kind = options.enums === String ? $root.google.spanner.v1.PlanNode.Kind[message.kind] === undefined ? message.kind : $root.google.spanner.v1.PlanNode.Kind[message.kind] : message.kind; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.childLinks && message.childLinks.length) { - object.childLinks = []; - for (var j = 0; j < message.childLinks.length; ++j) - object.childLinks[j] = $root.google.spanner.v1.PlanNode.ChildLink.toObject(message.childLinks[j], options); - } - if (message.shortRepresentation != null && message.hasOwnProperty("shortRepresentation")) - object.shortRepresentation = $root.google.spanner.v1.PlanNode.ShortRepresentation.toObject(message.shortRepresentation, options); - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.google.protobuf.Struct.toObject(message.metadata, options); - if (message.executionStats != null && message.hasOwnProperty("executionStats")) - object.executionStats = $root.google.protobuf.Struct.toObject(message.executionStats, options); - return object; - }; - - /** - * Converts this PlanNode to JSON. - * @function toJSON - * @memberof google.spanner.v1.PlanNode - * @instance - * @returns {Object.} JSON object - */ - PlanNode.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PlanNode - * @function getTypeUrl - * @memberof google.spanner.v1.PlanNode - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PlanNode.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.PlanNode"; - }; - - /** - * Kind enum. - * @name google.spanner.v1.PlanNode.Kind - * @enum {number} - * @property {number} KIND_UNSPECIFIED=0 KIND_UNSPECIFIED value - * @property {number} RELATIONAL=1 RELATIONAL value - * @property {number} SCALAR=2 SCALAR value - */ - PlanNode.Kind = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "KIND_UNSPECIFIED"] = 0; - values[valuesById[1] = "RELATIONAL"] = 1; - values[valuesById[2] = "SCALAR"] = 2; - return values; - })(); - - PlanNode.ChildLink = (function() { - - /** - * Properties of a ChildLink. - * @memberof google.spanner.v1.PlanNode - * @interface IChildLink - * @property {number|null} [childIndex] ChildLink childIndex - * @property {string|null} [type] ChildLink type - * @property {string|null} [variable] ChildLink variable - */ - - /** - * Constructs a new ChildLink. - * @memberof google.spanner.v1.PlanNode - * @classdesc Represents a ChildLink. - * @implements IChildLink - * @constructor - * @param {google.spanner.v1.PlanNode.IChildLink=} [properties] Properties to set - */ - function ChildLink(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ChildLink childIndex. - * @member {number} childIndex - * @memberof google.spanner.v1.PlanNode.ChildLink - * @instance - */ - ChildLink.prototype.childIndex = 0; - - /** - * ChildLink type. - * @member {string} type - * @memberof google.spanner.v1.PlanNode.ChildLink - * @instance - */ - ChildLink.prototype.type = ""; - - /** - * ChildLink variable. - * @member {string} variable - * @memberof google.spanner.v1.PlanNode.ChildLink - * @instance - */ - ChildLink.prototype.variable = ""; - - /** - * Creates a new ChildLink instance using the specified properties. - * @function create - * @memberof google.spanner.v1.PlanNode.ChildLink - * @static - * @param {google.spanner.v1.PlanNode.IChildLink=} [properties] Properties to set - * @returns {google.spanner.v1.PlanNode.ChildLink} ChildLink instance - */ - ChildLink.create = function create(properties) { - return new ChildLink(properties); - }; - - /** - * Encodes the specified ChildLink message. Does not implicitly {@link google.spanner.v1.PlanNode.ChildLink.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.PlanNode.ChildLink - * @static - * @param {google.spanner.v1.PlanNode.IChildLink} message ChildLink message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ChildLink.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.childIndex != null && Object.hasOwnProperty.call(message, "childIndex")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.childIndex); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.type); - if (message.variable != null && Object.hasOwnProperty.call(message, "variable")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.variable); - return writer; - }; - - /** - * Encodes the specified ChildLink message, length delimited. Does not implicitly {@link google.spanner.v1.PlanNode.ChildLink.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.PlanNode.ChildLink - * @static - * @param {google.spanner.v1.PlanNode.IChildLink} message ChildLink message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ChildLink.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ChildLink message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.PlanNode.ChildLink - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.PlanNode.ChildLink} ChildLink - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ChildLink.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.PlanNode.ChildLink(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.childIndex = reader.int32(); - break; - } - case 2: { - message.type = reader.string(); - break; - } - case 3: { - message.variable = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ChildLink message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.PlanNode.ChildLink - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.PlanNode.ChildLink} ChildLink - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ChildLink.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ChildLink message. - * @function verify - * @memberof google.spanner.v1.PlanNode.ChildLink - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ChildLink.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.childIndex != null && message.hasOwnProperty("childIndex")) - if (!$util.isInteger(message.childIndex)) - return "childIndex: integer expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.variable != null && message.hasOwnProperty("variable")) - if (!$util.isString(message.variable)) - return "variable: string expected"; - return null; - }; - - /** - * Creates a ChildLink message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.PlanNode.ChildLink - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.PlanNode.ChildLink} ChildLink - */ - ChildLink.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.PlanNode.ChildLink) - return object; - var message = new $root.google.spanner.v1.PlanNode.ChildLink(); - if (object.childIndex != null) - message.childIndex = object.childIndex | 0; - if (object.type != null) - message.type = String(object.type); - if (object.variable != null) - message.variable = String(object.variable); - return message; - }; - - /** - * Creates a plain object from a ChildLink message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.PlanNode.ChildLink - * @static - * @param {google.spanner.v1.PlanNode.ChildLink} message ChildLink - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ChildLink.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.childIndex = 0; - object.type = ""; - object.variable = ""; - } - if (message.childIndex != null && message.hasOwnProperty("childIndex")) - object.childIndex = message.childIndex; - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.variable != null && message.hasOwnProperty("variable")) - object.variable = message.variable; - return object; - }; - - /** - * Converts this ChildLink to JSON. - * @function toJSON - * @memberof google.spanner.v1.PlanNode.ChildLink - * @instance - * @returns {Object.} JSON object - */ - ChildLink.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ChildLink - * @function getTypeUrl - * @memberof google.spanner.v1.PlanNode.ChildLink - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ChildLink.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.PlanNode.ChildLink"; - }; - - return ChildLink; - })(); - - PlanNode.ShortRepresentation = (function() { - - /** - * Properties of a ShortRepresentation. - * @memberof google.spanner.v1.PlanNode - * @interface IShortRepresentation - * @property {string|null} [description] ShortRepresentation description - * @property {Object.|null} [subqueries] ShortRepresentation subqueries - */ - - /** - * Constructs a new ShortRepresentation. - * @memberof google.spanner.v1.PlanNode - * @classdesc Represents a ShortRepresentation. - * @implements IShortRepresentation - * @constructor - * @param {google.spanner.v1.PlanNode.IShortRepresentation=} [properties] Properties to set - */ - function ShortRepresentation(properties) { - this.subqueries = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ShortRepresentation description. - * @member {string} description - * @memberof google.spanner.v1.PlanNode.ShortRepresentation - * @instance - */ - ShortRepresentation.prototype.description = ""; - - /** - * ShortRepresentation subqueries. - * @member {Object.} subqueries - * @memberof google.spanner.v1.PlanNode.ShortRepresentation - * @instance - */ - ShortRepresentation.prototype.subqueries = $util.emptyObject; - - /** - * Creates a new ShortRepresentation instance using the specified properties. - * @function create - * @memberof google.spanner.v1.PlanNode.ShortRepresentation - * @static - * @param {google.spanner.v1.PlanNode.IShortRepresentation=} [properties] Properties to set - * @returns {google.spanner.v1.PlanNode.ShortRepresentation} ShortRepresentation instance - */ - ShortRepresentation.create = function create(properties) { - return new ShortRepresentation(properties); - }; - - /** - * Encodes the specified ShortRepresentation message. Does not implicitly {@link google.spanner.v1.PlanNode.ShortRepresentation.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.PlanNode.ShortRepresentation - * @static - * @param {google.spanner.v1.PlanNode.IShortRepresentation} message ShortRepresentation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ShortRepresentation.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.description); - if (message.subqueries != null && Object.hasOwnProperty.call(message, "subqueries")) - for (var keys = Object.keys(message.subqueries), i = 0; i < keys.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 0 =*/16).int32(message.subqueries[keys[i]]).ldelim(); - return writer; - }; - - /** - * Encodes the specified ShortRepresentation message, length delimited. Does not implicitly {@link google.spanner.v1.PlanNode.ShortRepresentation.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.PlanNode.ShortRepresentation - * @static - * @param {google.spanner.v1.PlanNode.IShortRepresentation} message ShortRepresentation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ShortRepresentation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ShortRepresentation message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.PlanNode.ShortRepresentation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.PlanNode.ShortRepresentation} ShortRepresentation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ShortRepresentation.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.PlanNode.ShortRepresentation(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.description = reader.string(); - break; - } - case 2: { - if (message.subqueries === $util.emptyObject) - message.subqueries = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = 0; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.int32(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.subqueries[key] = value; - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ShortRepresentation message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.PlanNode.ShortRepresentation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.PlanNode.ShortRepresentation} ShortRepresentation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ShortRepresentation.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ShortRepresentation message. - * @function verify - * @memberof google.spanner.v1.PlanNode.ShortRepresentation - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ShortRepresentation.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.subqueries != null && message.hasOwnProperty("subqueries")) { - if (!$util.isObject(message.subqueries)) - return "subqueries: object expected"; - var key = Object.keys(message.subqueries); - for (var i = 0; i < key.length; ++i) - if (!$util.isInteger(message.subqueries[key[i]])) - return "subqueries: integer{k:string} expected"; - } - return null; - }; - - /** - * Creates a ShortRepresentation message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.PlanNode.ShortRepresentation - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.PlanNode.ShortRepresentation} ShortRepresentation - */ - ShortRepresentation.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.PlanNode.ShortRepresentation) - return object; - var message = new $root.google.spanner.v1.PlanNode.ShortRepresentation(); - if (object.description != null) - message.description = String(object.description); - if (object.subqueries) { - if (typeof object.subqueries !== "object") - throw TypeError(".google.spanner.v1.PlanNode.ShortRepresentation.subqueries: object expected"); - message.subqueries = {}; - for (var keys = Object.keys(object.subqueries), i = 0; i < keys.length; ++i) - message.subqueries[keys[i]] = object.subqueries[keys[i]] | 0; - } - return message; - }; - - /** - * Creates a plain object from a ShortRepresentation message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.PlanNode.ShortRepresentation - * @static - * @param {google.spanner.v1.PlanNode.ShortRepresentation} message ShortRepresentation - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ShortRepresentation.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.subqueries = {}; - if (options.defaults) - object.description = ""; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - var keys2; - if (message.subqueries && (keys2 = Object.keys(message.subqueries)).length) { - object.subqueries = {}; - for (var j = 0; j < keys2.length; ++j) - object.subqueries[keys2[j]] = message.subqueries[keys2[j]]; - } - return object; - }; - - /** - * Converts this ShortRepresentation to JSON. - * @function toJSON - * @memberof google.spanner.v1.PlanNode.ShortRepresentation - * @instance - * @returns {Object.} JSON object - */ - ShortRepresentation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ShortRepresentation - * @function getTypeUrl - * @memberof google.spanner.v1.PlanNode.ShortRepresentation - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ShortRepresentation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.PlanNode.ShortRepresentation"; - }; - - return ShortRepresentation; - })(); - - return PlanNode; - })(); - - v1.QueryAdvisorResult = (function() { - - /** - * Properties of a QueryAdvisorResult. - * @memberof google.spanner.v1 - * @interface IQueryAdvisorResult - * @property {Array.|null} [indexAdvice] QueryAdvisorResult indexAdvice - */ - - /** - * Constructs a new QueryAdvisorResult. - * @memberof google.spanner.v1 - * @classdesc Represents a QueryAdvisorResult. - * @implements IQueryAdvisorResult - * @constructor - * @param {google.spanner.v1.IQueryAdvisorResult=} [properties] Properties to set - */ - function QueryAdvisorResult(properties) { - this.indexAdvice = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryAdvisorResult indexAdvice. - * @member {Array.} indexAdvice - * @memberof google.spanner.v1.QueryAdvisorResult - * @instance - */ - QueryAdvisorResult.prototype.indexAdvice = $util.emptyArray; - - /** - * Creates a new QueryAdvisorResult instance using the specified properties. - * @function create - * @memberof google.spanner.v1.QueryAdvisorResult - * @static - * @param {google.spanner.v1.IQueryAdvisorResult=} [properties] Properties to set - * @returns {google.spanner.v1.QueryAdvisorResult} QueryAdvisorResult instance - */ - QueryAdvisorResult.create = function create(properties) { - return new QueryAdvisorResult(properties); - }; - - /** - * Encodes the specified QueryAdvisorResult message. Does not implicitly {@link google.spanner.v1.QueryAdvisorResult.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.QueryAdvisorResult - * @static - * @param {google.spanner.v1.IQueryAdvisorResult} message QueryAdvisorResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryAdvisorResult.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.indexAdvice != null && message.indexAdvice.length) - for (var i = 0; i < message.indexAdvice.length; ++i) - $root.google.spanner.v1.QueryAdvisorResult.IndexAdvice.encode(message.indexAdvice[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryAdvisorResult message, length delimited. Does not implicitly {@link google.spanner.v1.QueryAdvisorResult.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.QueryAdvisorResult - * @static - * @param {google.spanner.v1.IQueryAdvisorResult} message QueryAdvisorResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryAdvisorResult.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryAdvisorResult message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.QueryAdvisorResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.QueryAdvisorResult} QueryAdvisorResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryAdvisorResult.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.QueryAdvisorResult(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.indexAdvice && message.indexAdvice.length)) - message.indexAdvice = []; - message.indexAdvice.push($root.google.spanner.v1.QueryAdvisorResult.IndexAdvice.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryAdvisorResult message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.QueryAdvisorResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.QueryAdvisorResult} QueryAdvisorResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryAdvisorResult.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryAdvisorResult message. - * @function verify - * @memberof google.spanner.v1.QueryAdvisorResult - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryAdvisorResult.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.indexAdvice != null && message.hasOwnProperty("indexAdvice")) { - if (!Array.isArray(message.indexAdvice)) - return "indexAdvice: array expected"; - for (var i = 0; i < message.indexAdvice.length; ++i) { - var error = $root.google.spanner.v1.QueryAdvisorResult.IndexAdvice.verify(message.indexAdvice[i]); - if (error) - return "indexAdvice." + error; - } - } - return null; - }; - - /** - * Creates a QueryAdvisorResult message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.QueryAdvisorResult - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.QueryAdvisorResult} QueryAdvisorResult - */ - QueryAdvisorResult.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.QueryAdvisorResult) - return object; - var message = new $root.google.spanner.v1.QueryAdvisorResult(); - if (object.indexAdvice) { - if (!Array.isArray(object.indexAdvice)) - throw TypeError(".google.spanner.v1.QueryAdvisorResult.indexAdvice: array expected"); - message.indexAdvice = []; - for (var i = 0; i < object.indexAdvice.length; ++i) { - if (typeof object.indexAdvice[i] !== "object") - throw TypeError(".google.spanner.v1.QueryAdvisorResult.indexAdvice: object expected"); - message.indexAdvice[i] = $root.google.spanner.v1.QueryAdvisorResult.IndexAdvice.fromObject(object.indexAdvice[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a QueryAdvisorResult message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.QueryAdvisorResult - * @static - * @param {google.spanner.v1.QueryAdvisorResult} message QueryAdvisorResult - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryAdvisorResult.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.indexAdvice = []; - if (message.indexAdvice && message.indexAdvice.length) { - object.indexAdvice = []; - for (var j = 0; j < message.indexAdvice.length; ++j) - object.indexAdvice[j] = $root.google.spanner.v1.QueryAdvisorResult.IndexAdvice.toObject(message.indexAdvice[j], options); - } - return object; - }; - - /** - * Converts this QueryAdvisorResult to JSON. - * @function toJSON - * @memberof google.spanner.v1.QueryAdvisorResult - * @instance - * @returns {Object.} JSON object - */ - QueryAdvisorResult.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for QueryAdvisorResult - * @function getTypeUrl - * @memberof google.spanner.v1.QueryAdvisorResult - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - QueryAdvisorResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.QueryAdvisorResult"; - }; - - QueryAdvisorResult.IndexAdvice = (function() { - - /** - * Properties of an IndexAdvice. - * @memberof google.spanner.v1.QueryAdvisorResult - * @interface IIndexAdvice - * @property {Array.|null} [ddl] IndexAdvice ddl - * @property {number|null} [improvementFactor] IndexAdvice improvementFactor - */ - - /** - * Constructs a new IndexAdvice. - * @memberof google.spanner.v1.QueryAdvisorResult - * @classdesc Represents an IndexAdvice. - * @implements IIndexAdvice - * @constructor - * @param {google.spanner.v1.QueryAdvisorResult.IIndexAdvice=} [properties] Properties to set - */ - function IndexAdvice(properties) { - this.ddl = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * IndexAdvice ddl. - * @member {Array.} ddl - * @memberof google.spanner.v1.QueryAdvisorResult.IndexAdvice - * @instance - */ - IndexAdvice.prototype.ddl = $util.emptyArray; - - /** - * IndexAdvice improvementFactor. - * @member {number} improvementFactor - * @memberof google.spanner.v1.QueryAdvisorResult.IndexAdvice - * @instance - */ - IndexAdvice.prototype.improvementFactor = 0; - - /** - * Creates a new IndexAdvice instance using the specified properties. - * @function create - * @memberof google.spanner.v1.QueryAdvisorResult.IndexAdvice - * @static - * @param {google.spanner.v1.QueryAdvisorResult.IIndexAdvice=} [properties] Properties to set - * @returns {google.spanner.v1.QueryAdvisorResult.IndexAdvice} IndexAdvice instance - */ - IndexAdvice.create = function create(properties) { - return new IndexAdvice(properties); - }; - - /** - * Encodes the specified IndexAdvice message. Does not implicitly {@link google.spanner.v1.QueryAdvisorResult.IndexAdvice.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.QueryAdvisorResult.IndexAdvice - * @static - * @param {google.spanner.v1.QueryAdvisorResult.IIndexAdvice} message IndexAdvice message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IndexAdvice.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.ddl != null && message.ddl.length) - for (var i = 0; i < message.ddl.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.ddl[i]); - if (message.improvementFactor != null && Object.hasOwnProperty.call(message, "improvementFactor")) - writer.uint32(/* id 2, wireType 1 =*/17).double(message.improvementFactor); - return writer; - }; - - /** - * Encodes the specified IndexAdvice message, length delimited. Does not implicitly {@link google.spanner.v1.QueryAdvisorResult.IndexAdvice.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.QueryAdvisorResult.IndexAdvice - * @static - * @param {google.spanner.v1.QueryAdvisorResult.IIndexAdvice} message IndexAdvice message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IndexAdvice.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an IndexAdvice message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.QueryAdvisorResult.IndexAdvice - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.QueryAdvisorResult.IndexAdvice} IndexAdvice - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IndexAdvice.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.QueryAdvisorResult.IndexAdvice(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.ddl && message.ddl.length)) - message.ddl = []; - message.ddl.push(reader.string()); - break; - } - case 2: { - message.improvementFactor = reader.double(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an IndexAdvice message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.QueryAdvisorResult.IndexAdvice - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.QueryAdvisorResult.IndexAdvice} IndexAdvice - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IndexAdvice.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an IndexAdvice message. - * @function verify - * @memberof google.spanner.v1.QueryAdvisorResult.IndexAdvice - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - IndexAdvice.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.ddl != null && message.hasOwnProperty("ddl")) { - if (!Array.isArray(message.ddl)) - return "ddl: array expected"; - for (var i = 0; i < message.ddl.length; ++i) - if (!$util.isString(message.ddl[i])) - return "ddl: string[] expected"; - } - if (message.improvementFactor != null && message.hasOwnProperty("improvementFactor")) - if (typeof message.improvementFactor !== "number") - return "improvementFactor: number expected"; - return null; - }; - - /** - * Creates an IndexAdvice message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.QueryAdvisorResult.IndexAdvice - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.QueryAdvisorResult.IndexAdvice} IndexAdvice - */ - IndexAdvice.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.QueryAdvisorResult.IndexAdvice) - return object; - var message = new $root.google.spanner.v1.QueryAdvisorResult.IndexAdvice(); - if (object.ddl) { - if (!Array.isArray(object.ddl)) - throw TypeError(".google.spanner.v1.QueryAdvisorResult.IndexAdvice.ddl: array expected"); - message.ddl = []; - for (var i = 0; i < object.ddl.length; ++i) - message.ddl[i] = String(object.ddl[i]); - } - if (object.improvementFactor != null) - message.improvementFactor = Number(object.improvementFactor); - return message; - }; - - /** - * Creates a plain object from an IndexAdvice message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.QueryAdvisorResult.IndexAdvice - * @static - * @param {google.spanner.v1.QueryAdvisorResult.IndexAdvice} message IndexAdvice - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - IndexAdvice.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.ddl = []; - if (options.defaults) - object.improvementFactor = 0; - if (message.ddl && message.ddl.length) { - object.ddl = []; - for (var j = 0; j < message.ddl.length; ++j) - object.ddl[j] = message.ddl[j]; - } - if (message.improvementFactor != null && message.hasOwnProperty("improvementFactor")) - object.improvementFactor = options.json && !isFinite(message.improvementFactor) ? String(message.improvementFactor) : message.improvementFactor; - return object; - }; - - /** - * Converts this IndexAdvice to JSON. - * @function toJSON - * @memberof google.spanner.v1.QueryAdvisorResult.IndexAdvice - * @instance - * @returns {Object.} JSON object - */ - IndexAdvice.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for IndexAdvice - * @function getTypeUrl - * @memberof google.spanner.v1.QueryAdvisorResult.IndexAdvice - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - IndexAdvice.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.QueryAdvisorResult.IndexAdvice"; - }; - - return IndexAdvice; - })(); - - return QueryAdvisorResult; - })(); - - v1.QueryPlan = (function() { - - /** - * Properties of a QueryPlan. - * @memberof google.spanner.v1 - * @interface IQueryPlan - * @property {Array.|null} [planNodes] QueryPlan planNodes - * @property {google.spanner.v1.IQueryAdvisorResult|null} [queryAdvice] QueryPlan queryAdvice - */ - - /** - * Constructs a new QueryPlan. - * @memberof google.spanner.v1 - * @classdesc Represents a QueryPlan. - * @implements IQueryPlan - * @constructor - * @param {google.spanner.v1.IQueryPlan=} [properties] Properties to set - */ - function QueryPlan(properties) { - this.planNodes = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryPlan planNodes. - * @member {Array.} planNodes - * @memberof google.spanner.v1.QueryPlan - * @instance - */ - QueryPlan.prototype.planNodes = $util.emptyArray; - - /** - * QueryPlan queryAdvice. - * @member {google.spanner.v1.IQueryAdvisorResult|null|undefined} queryAdvice - * @memberof google.spanner.v1.QueryPlan - * @instance - */ - QueryPlan.prototype.queryAdvice = null; - - /** - * Creates a new QueryPlan instance using the specified properties. - * @function create - * @memberof google.spanner.v1.QueryPlan - * @static - * @param {google.spanner.v1.IQueryPlan=} [properties] Properties to set - * @returns {google.spanner.v1.QueryPlan} QueryPlan instance - */ - QueryPlan.create = function create(properties) { - return new QueryPlan(properties); - }; - - /** - * Encodes the specified QueryPlan message. Does not implicitly {@link google.spanner.v1.QueryPlan.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.QueryPlan - * @static - * @param {google.spanner.v1.IQueryPlan} message QueryPlan message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryPlan.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.planNodes != null && message.planNodes.length) - for (var i = 0; i < message.planNodes.length; ++i) - $root.google.spanner.v1.PlanNode.encode(message.planNodes[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.queryAdvice != null && Object.hasOwnProperty.call(message, "queryAdvice")) - $root.google.spanner.v1.QueryAdvisorResult.encode(message.queryAdvice, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryPlan message, length delimited. Does not implicitly {@link google.spanner.v1.QueryPlan.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.QueryPlan - * @static - * @param {google.spanner.v1.IQueryPlan} message QueryPlan message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryPlan.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryPlan message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.QueryPlan - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.QueryPlan} QueryPlan - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryPlan.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.QueryPlan(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.planNodes && message.planNodes.length)) - message.planNodes = []; - message.planNodes.push($root.google.spanner.v1.PlanNode.decode(reader, reader.uint32())); - break; - } - case 2: { - message.queryAdvice = $root.google.spanner.v1.QueryAdvisorResult.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryPlan message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.QueryPlan - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.QueryPlan} QueryPlan - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryPlan.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryPlan message. - * @function verify - * @memberof google.spanner.v1.QueryPlan - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryPlan.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.planNodes != null && message.hasOwnProperty("planNodes")) { - if (!Array.isArray(message.planNodes)) - return "planNodes: array expected"; - for (var i = 0; i < message.planNodes.length; ++i) { - var error = $root.google.spanner.v1.PlanNode.verify(message.planNodes[i]); - if (error) - return "planNodes." + error; - } - } - if (message.queryAdvice != null && message.hasOwnProperty("queryAdvice")) { - var error = $root.google.spanner.v1.QueryAdvisorResult.verify(message.queryAdvice); - if (error) - return "queryAdvice." + error; - } - return null; - }; - - /** - * Creates a QueryPlan message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.QueryPlan - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.QueryPlan} QueryPlan - */ - QueryPlan.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.QueryPlan) - return object; - var message = new $root.google.spanner.v1.QueryPlan(); - if (object.planNodes) { - if (!Array.isArray(object.planNodes)) - throw TypeError(".google.spanner.v1.QueryPlan.planNodes: array expected"); - message.planNodes = []; - for (var i = 0; i < object.planNodes.length; ++i) { - if (typeof object.planNodes[i] !== "object") - throw TypeError(".google.spanner.v1.QueryPlan.planNodes: object expected"); - message.planNodes[i] = $root.google.spanner.v1.PlanNode.fromObject(object.planNodes[i]); - } - } - if (object.queryAdvice != null) { - if (typeof object.queryAdvice !== "object") - throw TypeError(".google.spanner.v1.QueryPlan.queryAdvice: object expected"); - message.queryAdvice = $root.google.spanner.v1.QueryAdvisorResult.fromObject(object.queryAdvice); - } - return message; - }; - - /** - * Creates a plain object from a QueryPlan message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.QueryPlan - * @static - * @param {google.spanner.v1.QueryPlan} message QueryPlan - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryPlan.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.planNodes = []; - if (options.defaults) - object.queryAdvice = null; - if (message.planNodes && message.planNodes.length) { - object.planNodes = []; - for (var j = 0; j < message.planNodes.length; ++j) - object.planNodes[j] = $root.google.spanner.v1.PlanNode.toObject(message.planNodes[j], options); - } - if (message.queryAdvice != null && message.hasOwnProperty("queryAdvice")) - object.queryAdvice = $root.google.spanner.v1.QueryAdvisorResult.toObject(message.queryAdvice, options); - return object; - }; - - /** - * Converts this QueryPlan to JSON. - * @function toJSON - * @memberof google.spanner.v1.QueryPlan - * @instance - * @returns {Object.} JSON object - */ - QueryPlan.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for QueryPlan - * @function getTypeUrl - * @memberof google.spanner.v1.QueryPlan - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - QueryPlan.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.QueryPlan"; - }; - - return QueryPlan; - })(); - - v1.ResultSet = (function() { - - /** - * Properties of a ResultSet. - * @memberof google.spanner.v1 - * @interface IResultSet - * @property {google.spanner.v1.IResultSetMetadata|null} [metadata] ResultSet metadata - * @property {Array.|null} [rows] ResultSet rows - * @property {google.spanner.v1.IResultSetStats|null} [stats] ResultSet stats - * @property {google.spanner.v1.IMultiplexedSessionPrecommitToken|null} [precommitToken] ResultSet precommitToken - * @property {google.spanner.v1.ICacheUpdate|null} [cacheUpdate] ResultSet cacheUpdate - */ - - /** - * Constructs a new ResultSet. - * @memberof google.spanner.v1 - * @classdesc Represents a ResultSet. - * @implements IResultSet - * @constructor - * @param {google.spanner.v1.IResultSet=} [properties] Properties to set - */ - function ResultSet(properties) { - this.rows = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ResultSet metadata. - * @member {google.spanner.v1.IResultSetMetadata|null|undefined} metadata - * @memberof google.spanner.v1.ResultSet - * @instance - */ - ResultSet.prototype.metadata = null; - - /** - * ResultSet rows. - * @member {Array.} rows - * @memberof google.spanner.v1.ResultSet - * @instance - */ - ResultSet.prototype.rows = $util.emptyArray; - - /** - * ResultSet stats. - * @member {google.spanner.v1.IResultSetStats|null|undefined} stats - * @memberof google.spanner.v1.ResultSet - * @instance - */ - ResultSet.prototype.stats = null; - - /** - * ResultSet precommitToken. - * @member {google.spanner.v1.IMultiplexedSessionPrecommitToken|null|undefined} precommitToken - * @memberof google.spanner.v1.ResultSet - * @instance - */ - ResultSet.prototype.precommitToken = null; - - /** - * ResultSet cacheUpdate. - * @member {google.spanner.v1.ICacheUpdate|null|undefined} cacheUpdate - * @memberof google.spanner.v1.ResultSet - * @instance - */ - ResultSet.prototype.cacheUpdate = null; - - /** - * Creates a new ResultSet instance using the specified properties. - * @function create - * @memberof google.spanner.v1.ResultSet - * @static - * @param {google.spanner.v1.IResultSet=} [properties] Properties to set - * @returns {google.spanner.v1.ResultSet} ResultSet instance - */ - ResultSet.create = function create(properties) { - return new ResultSet(properties); - }; - - /** - * Encodes the specified ResultSet message. Does not implicitly {@link google.spanner.v1.ResultSet.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.ResultSet - * @static - * @param {google.spanner.v1.IResultSet} message ResultSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResultSet.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.google.spanner.v1.ResultSetMetadata.encode(message.metadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.rows != null && message.rows.length) - for (var i = 0; i < message.rows.length; ++i) - $root.google.protobuf.ListValue.encode(message.rows[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.stats != null && Object.hasOwnProperty.call(message, "stats")) - $root.google.spanner.v1.ResultSetStats.encode(message.stats, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.precommitToken != null && Object.hasOwnProperty.call(message, "precommitToken")) - $root.google.spanner.v1.MultiplexedSessionPrecommitToken.encode(message.precommitToken, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.cacheUpdate != null && Object.hasOwnProperty.call(message, "cacheUpdate")) - $root.google.spanner.v1.CacheUpdate.encode(message.cacheUpdate, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ResultSet message, length delimited. Does not implicitly {@link google.spanner.v1.ResultSet.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.ResultSet - * @static - * @param {google.spanner.v1.IResultSet} message ResultSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResultSet.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ResultSet message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.ResultSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.ResultSet} ResultSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResultSet.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.ResultSet(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.metadata = $root.google.spanner.v1.ResultSetMetadata.decode(reader, reader.uint32()); - break; - } - case 2: { - if (!(message.rows && message.rows.length)) - message.rows = []; - message.rows.push($root.google.protobuf.ListValue.decode(reader, reader.uint32())); - break; - } - case 3: { - message.stats = $root.google.spanner.v1.ResultSetStats.decode(reader, reader.uint32()); - break; - } - case 5: { - message.precommitToken = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.decode(reader, reader.uint32()); - break; - } - case 6: { - message.cacheUpdate = $root.google.spanner.v1.CacheUpdate.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ResultSet message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.ResultSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.ResultSet} ResultSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResultSet.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ResultSet message. - * @function verify - * @memberof google.spanner.v1.ResultSet - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ResultSet.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.google.spanner.v1.ResultSetMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - if (message.rows != null && message.hasOwnProperty("rows")) { - if (!Array.isArray(message.rows)) - return "rows: array expected"; - for (var i = 0; i < message.rows.length; ++i) { - var error = $root.google.protobuf.ListValue.verify(message.rows[i]); - if (error) - return "rows." + error; - } - } - if (message.stats != null && message.hasOwnProperty("stats")) { - var error = $root.google.spanner.v1.ResultSetStats.verify(message.stats); - if (error) - return "stats." + error; - } - if (message.precommitToken != null && message.hasOwnProperty("precommitToken")) { - var error = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.verify(message.precommitToken); - if (error) - return "precommitToken." + error; - } - if (message.cacheUpdate != null && message.hasOwnProperty("cacheUpdate")) { - var error = $root.google.spanner.v1.CacheUpdate.verify(message.cacheUpdate); - if (error) - return "cacheUpdate." + error; - } - return null; - }; - - /** - * Creates a ResultSet message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.ResultSet - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.ResultSet} ResultSet - */ - ResultSet.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.ResultSet) - return object; - var message = new $root.google.spanner.v1.ResultSet(); - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".google.spanner.v1.ResultSet.metadata: object expected"); - message.metadata = $root.google.spanner.v1.ResultSetMetadata.fromObject(object.metadata); - } - if (object.rows) { - if (!Array.isArray(object.rows)) - throw TypeError(".google.spanner.v1.ResultSet.rows: array expected"); - message.rows = []; - for (var i = 0; i < object.rows.length; ++i) { - if (typeof object.rows[i] !== "object") - throw TypeError(".google.spanner.v1.ResultSet.rows: object expected"); - message.rows[i] = $root.google.protobuf.ListValue.fromObject(object.rows[i]); - } - } - if (object.stats != null) { - if (typeof object.stats !== "object") - throw TypeError(".google.spanner.v1.ResultSet.stats: object expected"); - message.stats = $root.google.spanner.v1.ResultSetStats.fromObject(object.stats); - } - if (object.precommitToken != null) { - if (typeof object.precommitToken !== "object") - throw TypeError(".google.spanner.v1.ResultSet.precommitToken: object expected"); - message.precommitToken = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.fromObject(object.precommitToken); - } - if (object.cacheUpdate != null) { - if (typeof object.cacheUpdate !== "object") - throw TypeError(".google.spanner.v1.ResultSet.cacheUpdate: object expected"); - message.cacheUpdate = $root.google.spanner.v1.CacheUpdate.fromObject(object.cacheUpdate); - } - return message; - }; - - /** - * Creates a plain object from a ResultSet message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.ResultSet - * @static - * @param {google.spanner.v1.ResultSet} message ResultSet - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResultSet.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.rows = []; - if (options.defaults) { - object.metadata = null; - object.stats = null; - object.precommitToken = null; - object.cacheUpdate = null; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.google.spanner.v1.ResultSetMetadata.toObject(message.metadata, options); - if (message.rows && message.rows.length) { - object.rows = []; - for (var j = 0; j < message.rows.length; ++j) - object.rows[j] = $root.google.protobuf.ListValue.toObject(message.rows[j], options); - } - if (message.stats != null && message.hasOwnProperty("stats")) - object.stats = $root.google.spanner.v1.ResultSetStats.toObject(message.stats, options); - if (message.precommitToken != null && message.hasOwnProperty("precommitToken")) - object.precommitToken = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.toObject(message.precommitToken, options); - if (message.cacheUpdate != null && message.hasOwnProperty("cacheUpdate")) - object.cacheUpdate = $root.google.spanner.v1.CacheUpdate.toObject(message.cacheUpdate, options); - return object; - }; - - /** - * Converts this ResultSet to JSON. - * @function toJSON - * @memberof google.spanner.v1.ResultSet - * @instance - * @returns {Object.} JSON object - */ - ResultSet.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ResultSet - * @function getTypeUrl - * @memberof google.spanner.v1.ResultSet - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ResultSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.ResultSet"; - }; - - return ResultSet; - })(); - - v1.PartialResultSet = (function() { - - /** - * Properties of a PartialResultSet. - * @memberof google.spanner.v1 - * @interface IPartialResultSet - * @property {google.spanner.v1.IResultSetMetadata|null} [metadata] PartialResultSet metadata - * @property {Array.|null} [values] PartialResultSet values - * @property {boolean|null} [chunkedValue] PartialResultSet chunkedValue - * @property {Uint8Array|null} [resumeToken] PartialResultSet resumeToken - * @property {google.spanner.v1.IResultSetStats|null} [stats] PartialResultSet stats - * @property {google.spanner.v1.IMultiplexedSessionPrecommitToken|null} [precommitToken] PartialResultSet precommitToken - * @property {boolean|null} [last] PartialResultSet last - * @property {google.spanner.v1.ICacheUpdate|null} [cacheUpdate] PartialResultSet cacheUpdate - */ - - /** - * Constructs a new PartialResultSet. - * @memberof google.spanner.v1 - * @classdesc Represents a PartialResultSet. - * @implements IPartialResultSet - * @constructor - * @param {google.spanner.v1.IPartialResultSet=} [properties] Properties to set - */ - function PartialResultSet(properties) { - this.values = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PartialResultSet metadata. - * @member {google.spanner.v1.IResultSetMetadata|null|undefined} metadata - * @memberof google.spanner.v1.PartialResultSet - * @instance - */ - PartialResultSet.prototype.metadata = null; - - /** - * PartialResultSet values. - * @member {Array.} values - * @memberof google.spanner.v1.PartialResultSet - * @instance - */ - PartialResultSet.prototype.values = $util.emptyArray; - - /** - * PartialResultSet chunkedValue. - * @member {boolean} chunkedValue - * @memberof google.spanner.v1.PartialResultSet - * @instance - */ - PartialResultSet.prototype.chunkedValue = false; - - /** - * PartialResultSet resumeToken. - * @member {Uint8Array} resumeToken - * @memberof google.spanner.v1.PartialResultSet - * @instance - */ - PartialResultSet.prototype.resumeToken = $util.newBuffer([]); - - /** - * PartialResultSet stats. - * @member {google.spanner.v1.IResultSetStats|null|undefined} stats - * @memberof google.spanner.v1.PartialResultSet - * @instance - */ - PartialResultSet.prototype.stats = null; - - /** - * PartialResultSet precommitToken. - * @member {google.spanner.v1.IMultiplexedSessionPrecommitToken|null|undefined} precommitToken - * @memberof google.spanner.v1.PartialResultSet - * @instance - */ - PartialResultSet.prototype.precommitToken = null; - - /** - * PartialResultSet last. - * @member {boolean} last - * @memberof google.spanner.v1.PartialResultSet - * @instance - */ - PartialResultSet.prototype.last = false; - - /** - * PartialResultSet cacheUpdate. - * @member {google.spanner.v1.ICacheUpdate|null|undefined} cacheUpdate - * @memberof google.spanner.v1.PartialResultSet - * @instance - */ - PartialResultSet.prototype.cacheUpdate = null; - - /** - * Creates a new PartialResultSet instance using the specified properties. - * @function create - * @memberof google.spanner.v1.PartialResultSet - * @static - * @param {google.spanner.v1.IPartialResultSet=} [properties] Properties to set - * @returns {google.spanner.v1.PartialResultSet} PartialResultSet instance - */ - PartialResultSet.create = function create(properties) { - return new PartialResultSet(properties); - }; - - /** - * Encodes the specified PartialResultSet message. Does not implicitly {@link google.spanner.v1.PartialResultSet.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.PartialResultSet - * @static - * @param {google.spanner.v1.IPartialResultSet} message PartialResultSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PartialResultSet.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.google.spanner.v1.ResultSetMetadata.encode(message.metadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.values != null && message.values.length) - for (var i = 0; i < message.values.length; ++i) - $root.google.protobuf.Value.encode(message.values[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.chunkedValue != null && Object.hasOwnProperty.call(message, "chunkedValue")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.chunkedValue); - if (message.resumeToken != null && Object.hasOwnProperty.call(message, "resumeToken")) - writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.resumeToken); - if (message.stats != null && Object.hasOwnProperty.call(message, "stats")) - $root.google.spanner.v1.ResultSetStats.encode(message.stats, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.precommitToken != null && Object.hasOwnProperty.call(message, "precommitToken")) - $root.google.spanner.v1.MultiplexedSessionPrecommitToken.encode(message.precommitToken, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.last != null && Object.hasOwnProperty.call(message, "last")) - writer.uint32(/* id 9, wireType 0 =*/72).bool(message.last); - if (message.cacheUpdate != null && Object.hasOwnProperty.call(message, "cacheUpdate")) - $root.google.spanner.v1.CacheUpdate.encode(message.cacheUpdate, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified PartialResultSet message, length delimited. Does not implicitly {@link google.spanner.v1.PartialResultSet.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.PartialResultSet - * @static - * @param {google.spanner.v1.IPartialResultSet} message PartialResultSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PartialResultSet.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PartialResultSet message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.PartialResultSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.PartialResultSet} PartialResultSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PartialResultSet.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.PartialResultSet(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.metadata = $root.google.spanner.v1.ResultSetMetadata.decode(reader, reader.uint32()); - break; - } - case 2: { - if (!(message.values && message.values.length)) - message.values = []; - message.values.push($root.google.protobuf.Value.decode(reader, reader.uint32())); - break; - } - case 3: { - message.chunkedValue = reader.bool(); - break; - } - case 4: { - message.resumeToken = reader.bytes(); - break; - } - case 5: { - message.stats = $root.google.spanner.v1.ResultSetStats.decode(reader, reader.uint32()); - break; - } - case 8: { - message.precommitToken = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.decode(reader, reader.uint32()); - break; - } - case 9: { - message.last = reader.bool(); - break; - } - case 10: { - message.cacheUpdate = $root.google.spanner.v1.CacheUpdate.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PartialResultSet message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.PartialResultSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.PartialResultSet} PartialResultSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PartialResultSet.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PartialResultSet message. - * @function verify - * @memberof google.spanner.v1.PartialResultSet - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PartialResultSet.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.google.spanner.v1.ResultSetMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - if (message.values != null && message.hasOwnProperty("values")) { - if (!Array.isArray(message.values)) - return "values: array expected"; - for (var i = 0; i < message.values.length; ++i) { - var error = $root.google.protobuf.Value.verify(message.values[i]); - if (error) - return "values." + error; - } - } - if (message.chunkedValue != null && message.hasOwnProperty("chunkedValue")) - if (typeof message.chunkedValue !== "boolean") - return "chunkedValue: boolean expected"; - if (message.resumeToken != null && message.hasOwnProperty("resumeToken")) - if (!(message.resumeToken && typeof message.resumeToken.length === "number" || $util.isString(message.resumeToken))) - return "resumeToken: buffer expected"; - if (message.stats != null && message.hasOwnProperty("stats")) { - var error = $root.google.spanner.v1.ResultSetStats.verify(message.stats); - if (error) - return "stats." + error; - } - if (message.precommitToken != null && message.hasOwnProperty("precommitToken")) { - var error = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.verify(message.precommitToken); - if (error) - return "precommitToken." + error; - } - if (message.last != null && message.hasOwnProperty("last")) - if (typeof message.last !== "boolean") - return "last: boolean expected"; - if (message.cacheUpdate != null && message.hasOwnProperty("cacheUpdate")) { - var error = $root.google.spanner.v1.CacheUpdate.verify(message.cacheUpdate); - if (error) - return "cacheUpdate." + error; - } - return null; - }; - - /** - * Creates a PartialResultSet message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.PartialResultSet - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.PartialResultSet} PartialResultSet - */ - PartialResultSet.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.PartialResultSet) - return object; - var message = new $root.google.spanner.v1.PartialResultSet(); - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".google.spanner.v1.PartialResultSet.metadata: object expected"); - message.metadata = $root.google.spanner.v1.ResultSetMetadata.fromObject(object.metadata); - } - if (object.values) { - if (!Array.isArray(object.values)) - throw TypeError(".google.spanner.v1.PartialResultSet.values: array expected"); - message.values = []; - for (var i = 0; i < object.values.length; ++i) { - if (typeof object.values[i] !== "object") - throw TypeError(".google.spanner.v1.PartialResultSet.values: object expected"); - message.values[i] = $root.google.protobuf.Value.fromObject(object.values[i]); - } - } - if (object.chunkedValue != null) - message.chunkedValue = Boolean(object.chunkedValue); - if (object.resumeToken != null) - if (typeof object.resumeToken === "string") - $util.base64.decode(object.resumeToken, message.resumeToken = $util.newBuffer($util.base64.length(object.resumeToken)), 0); - else if (object.resumeToken.length >= 0) - message.resumeToken = object.resumeToken; - if (object.stats != null) { - if (typeof object.stats !== "object") - throw TypeError(".google.spanner.v1.PartialResultSet.stats: object expected"); - message.stats = $root.google.spanner.v1.ResultSetStats.fromObject(object.stats); - } - if (object.precommitToken != null) { - if (typeof object.precommitToken !== "object") - throw TypeError(".google.spanner.v1.PartialResultSet.precommitToken: object expected"); - message.precommitToken = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.fromObject(object.precommitToken); - } - if (object.last != null) - message.last = Boolean(object.last); - if (object.cacheUpdate != null) { - if (typeof object.cacheUpdate !== "object") - throw TypeError(".google.spanner.v1.PartialResultSet.cacheUpdate: object expected"); - message.cacheUpdate = $root.google.spanner.v1.CacheUpdate.fromObject(object.cacheUpdate); - } - return message; - }; - - /** - * Creates a plain object from a PartialResultSet message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.PartialResultSet - * @static - * @param {google.spanner.v1.PartialResultSet} message PartialResultSet - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PartialResultSet.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.values = []; - if (options.defaults) { - object.metadata = null; - object.chunkedValue = false; - if (options.bytes === String) - object.resumeToken = ""; - else { - object.resumeToken = []; - if (options.bytes !== Array) - object.resumeToken = $util.newBuffer(object.resumeToken); - } - object.stats = null; - object.precommitToken = null; - object.last = false; - object.cacheUpdate = null; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.google.spanner.v1.ResultSetMetadata.toObject(message.metadata, options); - if (message.values && message.values.length) { - object.values = []; - for (var j = 0; j < message.values.length; ++j) - object.values[j] = $root.google.protobuf.Value.toObject(message.values[j], options); - } - if (message.chunkedValue != null && message.hasOwnProperty("chunkedValue")) - object.chunkedValue = message.chunkedValue; - if (message.resumeToken != null && message.hasOwnProperty("resumeToken")) - object.resumeToken = options.bytes === String ? $util.base64.encode(message.resumeToken, 0, message.resumeToken.length) : options.bytes === Array ? Array.prototype.slice.call(message.resumeToken) : message.resumeToken; - if (message.stats != null && message.hasOwnProperty("stats")) - object.stats = $root.google.spanner.v1.ResultSetStats.toObject(message.stats, options); - if (message.precommitToken != null && message.hasOwnProperty("precommitToken")) - object.precommitToken = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.toObject(message.precommitToken, options); - if (message.last != null && message.hasOwnProperty("last")) - object.last = message.last; - if (message.cacheUpdate != null && message.hasOwnProperty("cacheUpdate")) - object.cacheUpdate = $root.google.spanner.v1.CacheUpdate.toObject(message.cacheUpdate, options); - return object; - }; - - /** - * Converts this PartialResultSet to JSON. - * @function toJSON - * @memberof google.spanner.v1.PartialResultSet - * @instance - * @returns {Object.} JSON object - */ - PartialResultSet.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PartialResultSet - * @function getTypeUrl - * @memberof google.spanner.v1.PartialResultSet - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PartialResultSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.PartialResultSet"; - }; - - return PartialResultSet; - })(); - - v1.ResultSetMetadata = (function() { - - /** - * Properties of a ResultSetMetadata. - * @memberof google.spanner.v1 - * @interface IResultSetMetadata - * @property {google.spanner.v1.IStructType|null} [rowType] ResultSetMetadata rowType - * @property {google.spanner.v1.ITransaction|null} [transaction] ResultSetMetadata transaction - * @property {google.spanner.v1.IStructType|null} [undeclaredParameters] ResultSetMetadata undeclaredParameters - */ - - /** - * Constructs a new ResultSetMetadata. - * @memberof google.spanner.v1 - * @classdesc Represents a ResultSetMetadata. - * @implements IResultSetMetadata - * @constructor - * @param {google.spanner.v1.IResultSetMetadata=} [properties] Properties to set - */ - function ResultSetMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ResultSetMetadata rowType. - * @member {google.spanner.v1.IStructType|null|undefined} rowType - * @memberof google.spanner.v1.ResultSetMetadata - * @instance - */ - ResultSetMetadata.prototype.rowType = null; - - /** - * ResultSetMetadata transaction. - * @member {google.spanner.v1.ITransaction|null|undefined} transaction - * @memberof google.spanner.v1.ResultSetMetadata - * @instance - */ - ResultSetMetadata.prototype.transaction = null; - - /** - * ResultSetMetadata undeclaredParameters. - * @member {google.spanner.v1.IStructType|null|undefined} undeclaredParameters - * @memberof google.spanner.v1.ResultSetMetadata - * @instance - */ - ResultSetMetadata.prototype.undeclaredParameters = null; - - /** - * Creates a new ResultSetMetadata instance using the specified properties. - * @function create - * @memberof google.spanner.v1.ResultSetMetadata - * @static - * @param {google.spanner.v1.IResultSetMetadata=} [properties] Properties to set - * @returns {google.spanner.v1.ResultSetMetadata} ResultSetMetadata instance - */ - ResultSetMetadata.create = function create(properties) { - return new ResultSetMetadata(properties); - }; - - /** - * Encodes the specified ResultSetMetadata message. Does not implicitly {@link google.spanner.v1.ResultSetMetadata.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.ResultSetMetadata - * @static - * @param {google.spanner.v1.IResultSetMetadata} message ResultSetMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResultSetMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.rowType != null && Object.hasOwnProperty.call(message, "rowType")) - $root.google.spanner.v1.StructType.encode(message.rowType, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.transaction != null && Object.hasOwnProperty.call(message, "transaction")) - $root.google.spanner.v1.Transaction.encode(message.transaction, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.undeclaredParameters != null && Object.hasOwnProperty.call(message, "undeclaredParameters")) - $root.google.spanner.v1.StructType.encode(message.undeclaredParameters, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ResultSetMetadata message, length delimited. Does not implicitly {@link google.spanner.v1.ResultSetMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.ResultSetMetadata - * @static - * @param {google.spanner.v1.IResultSetMetadata} message ResultSetMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResultSetMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ResultSetMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.ResultSetMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.ResultSetMetadata} ResultSetMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResultSetMetadata.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.ResultSetMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.rowType = $root.google.spanner.v1.StructType.decode(reader, reader.uint32()); - break; - } - case 2: { - message.transaction = $root.google.spanner.v1.Transaction.decode(reader, reader.uint32()); - break; - } - case 3: { - message.undeclaredParameters = $root.google.spanner.v1.StructType.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ResultSetMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.ResultSetMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.ResultSetMetadata} ResultSetMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResultSetMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ResultSetMetadata message. - * @function verify - * @memberof google.spanner.v1.ResultSetMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ResultSetMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.rowType != null && message.hasOwnProperty("rowType")) { - var error = $root.google.spanner.v1.StructType.verify(message.rowType); - if (error) - return "rowType." + error; - } - if (message.transaction != null && message.hasOwnProperty("transaction")) { - var error = $root.google.spanner.v1.Transaction.verify(message.transaction); - if (error) - return "transaction." + error; - } - if (message.undeclaredParameters != null && message.hasOwnProperty("undeclaredParameters")) { - var error = $root.google.spanner.v1.StructType.verify(message.undeclaredParameters); - if (error) - return "undeclaredParameters." + error; - } - return null; - }; - - /** - * Creates a ResultSetMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.ResultSetMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.ResultSetMetadata} ResultSetMetadata - */ - ResultSetMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.ResultSetMetadata) - return object; - var message = new $root.google.spanner.v1.ResultSetMetadata(); - if (object.rowType != null) { - if (typeof object.rowType !== "object") - throw TypeError(".google.spanner.v1.ResultSetMetadata.rowType: object expected"); - message.rowType = $root.google.spanner.v1.StructType.fromObject(object.rowType); - } - if (object.transaction != null) { - if (typeof object.transaction !== "object") - throw TypeError(".google.spanner.v1.ResultSetMetadata.transaction: object expected"); - message.transaction = $root.google.spanner.v1.Transaction.fromObject(object.transaction); - } - if (object.undeclaredParameters != null) { - if (typeof object.undeclaredParameters !== "object") - throw TypeError(".google.spanner.v1.ResultSetMetadata.undeclaredParameters: object expected"); - message.undeclaredParameters = $root.google.spanner.v1.StructType.fromObject(object.undeclaredParameters); - } - return message; - }; - - /** - * Creates a plain object from a ResultSetMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.ResultSetMetadata - * @static - * @param {google.spanner.v1.ResultSetMetadata} message ResultSetMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResultSetMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.rowType = null; - object.transaction = null; - object.undeclaredParameters = null; - } - if (message.rowType != null && message.hasOwnProperty("rowType")) - object.rowType = $root.google.spanner.v1.StructType.toObject(message.rowType, options); - if (message.transaction != null && message.hasOwnProperty("transaction")) - object.transaction = $root.google.spanner.v1.Transaction.toObject(message.transaction, options); - if (message.undeclaredParameters != null && message.hasOwnProperty("undeclaredParameters")) - object.undeclaredParameters = $root.google.spanner.v1.StructType.toObject(message.undeclaredParameters, options); - return object; - }; - - /** - * Converts this ResultSetMetadata to JSON. - * @function toJSON - * @memberof google.spanner.v1.ResultSetMetadata - * @instance - * @returns {Object.} JSON object - */ - ResultSetMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ResultSetMetadata - * @function getTypeUrl - * @memberof google.spanner.v1.ResultSetMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ResultSetMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.ResultSetMetadata"; - }; - - return ResultSetMetadata; - })(); - - v1.ResultSetStats = (function() { - - /** - * Properties of a ResultSetStats. - * @memberof google.spanner.v1 - * @interface IResultSetStats - * @property {google.spanner.v1.IQueryPlan|null} [queryPlan] ResultSetStats queryPlan - * @property {google.protobuf.IStruct|null} [queryStats] ResultSetStats queryStats - * @property {number|Long|null} [rowCountExact] ResultSetStats rowCountExact - * @property {number|Long|null} [rowCountLowerBound] ResultSetStats rowCountLowerBound - */ - - /** - * Constructs a new ResultSetStats. - * @memberof google.spanner.v1 - * @classdesc Represents a ResultSetStats. - * @implements IResultSetStats - * @constructor - * @param {google.spanner.v1.IResultSetStats=} [properties] Properties to set - */ - function ResultSetStats(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ResultSetStats queryPlan. - * @member {google.spanner.v1.IQueryPlan|null|undefined} queryPlan - * @memberof google.spanner.v1.ResultSetStats - * @instance - */ - ResultSetStats.prototype.queryPlan = null; - - /** - * ResultSetStats queryStats. - * @member {google.protobuf.IStruct|null|undefined} queryStats - * @memberof google.spanner.v1.ResultSetStats - * @instance - */ - ResultSetStats.prototype.queryStats = null; - - /** - * ResultSetStats rowCountExact. - * @member {number|Long|null|undefined} rowCountExact - * @memberof google.spanner.v1.ResultSetStats - * @instance - */ - ResultSetStats.prototype.rowCountExact = null; - - /** - * ResultSetStats rowCountLowerBound. - * @member {number|Long|null|undefined} rowCountLowerBound - * @memberof google.spanner.v1.ResultSetStats - * @instance - */ - ResultSetStats.prototype.rowCountLowerBound = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * ResultSetStats rowCount. - * @member {"rowCountExact"|"rowCountLowerBound"|undefined} rowCount - * @memberof google.spanner.v1.ResultSetStats - * @instance - */ - Object.defineProperty(ResultSetStats.prototype, "rowCount", { - get: $util.oneOfGetter($oneOfFields = ["rowCountExact", "rowCountLowerBound"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new ResultSetStats instance using the specified properties. - * @function create - * @memberof google.spanner.v1.ResultSetStats - * @static - * @param {google.spanner.v1.IResultSetStats=} [properties] Properties to set - * @returns {google.spanner.v1.ResultSetStats} ResultSetStats instance - */ - ResultSetStats.create = function create(properties) { - return new ResultSetStats(properties); - }; - - /** - * Encodes the specified ResultSetStats message. Does not implicitly {@link google.spanner.v1.ResultSetStats.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.ResultSetStats - * @static - * @param {google.spanner.v1.IResultSetStats} message ResultSetStats message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResultSetStats.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.queryPlan != null && Object.hasOwnProperty.call(message, "queryPlan")) - $root.google.spanner.v1.QueryPlan.encode(message.queryPlan, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.queryStats != null && Object.hasOwnProperty.call(message, "queryStats")) - $root.google.protobuf.Struct.encode(message.queryStats, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.rowCountExact != null && Object.hasOwnProperty.call(message, "rowCountExact")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.rowCountExact); - if (message.rowCountLowerBound != null && Object.hasOwnProperty.call(message, "rowCountLowerBound")) - writer.uint32(/* id 4, wireType 0 =*/32).int64(message.rowCountLowerBound); - return writer; - }; - - /** - * Encodes the specified ResultSetStats message, length delimited. Does not implicitly {@link google.spanner.v1.ResultSetStats.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.ResultSetStats - * @static - * @param {google.spanner.v1.IResultSetStats} message ResultSetStats message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResultSetStats.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ResultSetStats message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.ResultSetStats - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.ResultSetStats} ResultSetStats - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResultSetStats.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.ResultSetStats(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.queryPlan = $root.google.spanner.v1.QueryPlan.decode(reader, reader.uint32()); - break; - } - case 2: { - message.queryStats = $root.google.protobuf.Struct.decode(reader, reader.uint32()); - break; - } - case 3: { - message.rowCountExact = reader.int64(); - break; - } - case 4: { - message.rowCountLowerBound = reader.int64(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ResultSetStats message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.ResultSetStats - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.ResultSetStats} ResultSetStats - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResultSetStats.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ResultSetStats message. - * @function verify - * @memberof google.spanner.v1.ResultSetStats - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ResultSetStats.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.queryPlan != null && message.hasOwnProperty("queryPlan")) { - var error = $root.google.spanner.v1.QueryPlan.verify(message.queryPlan); - if (error) - return "queryPlan." + error; - } - if (message.queryStats != null && message.hasOwnProperty("queryStats")) { - var error = $root.google.protobuf.Struct.verify(message.queryStats); - if (error) - return "queryStats." + error; - } - if (message.rowCountExact != null && message.hasOwnProperty("rowCountExact")) { - properties.rowCount = 1; - if (!$util.isInteger(message.rowCountExact) && !(message.rowCountExact && $util.isInteger(message.rowCountExact.low) && $util.isInteger(message.rowCountExact.high))) - return "rowCountExact: integer|Long expected"; - } - if (message.rowCountLowerBound != null && message.hasOwnProperty("rowCountLowerBound")) { - if (properties.rowCount === 1) - return "rowCount: multiple values"; - properties.rowCount = 1; - if (!$util.isInteger(message.rowCountLowerBound) && !(message.rowCountLowerBound && $util.isInteger(message.rowCountLowerBound.low) && $util.isInteger(message.rowCountLowerBound.high))) - return "rowCountLowerBound: integer|Long expected"; - } - return null; - }; - - /** - * Creates a ResultSetStats message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.ResultSetStats - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.ResultSetStats} ResultSetStats - */ - ResultSetStats.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.ResultSetStats) - return object; - var message = new $root.google.spanner.v1.ResultSetStats(); - if (object.queryPlan != null) { - if (typeof object.queryPlan !== "object") - throw TypeError(".google.spanner.v1.ResultSetStats.queryPlan: object expected"); - message.queryPlan = $root.google.spanner.v1.QueryPlan.fromObject(object.queryPlan); - } - if (object.queryStats != null) { - if (typeof object.queryStats !== "object") - throw TypeError(".google.spanner.v1.ResultSetStats.queryStats: object expected"); - message.queryStats = $root.google.protobuf.Struct.fromObject(object.queryStats); - } - if (object.rowCountExact != null) - if ($util.Long) - (message.rowCountExact = $util.Long.fromValue(object.rowCountExact)).unsigned = false; - else if (typeof object.rowCountExact === "string") - message.rowCountExact = parseInt(object.rowCountExact, 10); - else if (typeof object.rowCountExact === "number") - message.rowCountExact = object.rowCountExact; - else if (typeof object.rowCountExact === "object") - message.rowCountExact = new $util.LongBits(object.rowCountExact.low >>> 0, object.rowCountExact.high >>> 0).toNumber(); - if (object.rowCountLowerBound != null) - if ($util.Long) - (message.rowCountLowerBound = $util.Long.fromValue(object.rowCountLowerBound)).unsigned = false; - else if (typeof object.rowCountLowerBound === "string") - message.rowCountLowerBound = parseInt(object.rowCountLowerBound, 10); - else if (typeof object.rowCountLowerBound === "number") - message.rowCountLowerBound = object.rowCountLowerBound; - else if (typeof object.rowCountLowerBound === "object") - message.rowCountLowerBound = new $util.LongBits(object.rowCountLowerBound.low >>> 0, object.rowCountLowerBound.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from a ResultSetStats message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.ResultSetStats - * @static - * @param {google.spanner.v1.ResultSetStats} message ResultSetStats - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResultSetStats.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.queryPlan = null; - object.queryStats = null; - } - if (message.queryPlan != null && message.hasOwnProperty("queryPlan")) - object.queryPlan = $root.google.spanner.v1.QueryPlan.toObject(message.queryPlan, options); - if (message.queryStats != null && message.hasOwnProperty("queryStats")) - object.queryStats = $root.google.protobuf.Struct.toObject(message.queryStats, options); - if (message.rowCountExact != null && message.hasOwnProperty("rowCountExact")) { - if (typeof message.rowCountExact === "number") - object.rowCountExact = options.longs === String ? String(message.rowCountExact) : message.rowCountExact; - else - object.rowCountExact = options.longs === String ? $util.Long.prototype.toString.call(message.rowCountExact) : options.longs === Number ? new $util.LongBits(message.rowCountExact.low >>> 0, message.rowCountExact.high >>> 0).toNumber() : message.rowCountExact; - if (options.oneofs) - object.rowCount = "rowCountExact"; - } - if (message.rowCountLowerBound != null && message.hasOwnProperty("rowCountLowerBound")) { - if (typeof message.rowCountLowerBound === "number") - object.rowCountLowerBound = options.longs === String ? String(message.rowCountLowerBound) : message.rowCountLowerBound; - else - object.rowCountLowerBound = options.longs === String ? $util.Long.prototype.toString.call(message.rowCountLowerBound) : options.longs === Number ? new $util.LongBits(message.rowCountLowerBound.low >>> 0, message.rowCountLowerBound.high >>> 0).toNumber() : message.rowCountLowerBound; - if (options.oneofs) - object.rowCount = "rowCountLowerBound"; - } - return object; - }; - - /** - * Converts this ResultSetStats to JSON. - * @function toJSON - * @memberof google.spanner.v1.ResultSetStats - * @instance - * @returns {Object.} JSON object - */ - ResultSetStats.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ResultSetStats - * @function getTypeUrl - * @memberof google.spanner.v1.ResultSetStats - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ResultSetStats.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.ResultSetStats"; - }; - - return ResultSetStats; - })(); - - v1.Spanner = (function() { - - /** - * Constructs a new Spanner service. - * @memberof google.spanner.v1 - * @classdesc Represents a Spanner - * @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 Spanner(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (Spanner.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Spanner; - - /** - * Creates new Spanner service using the specified rpc implementation. - * @function create - * @memberof google.spanner.v1.Spanner - * @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 {Spanner} RPC service. Useful where requests and/or responses are streamed. - */ - Spanner.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.spanner.v1.Spanner|createSession}. - * @memberof google.spanner.v1.Spanner - * @typedef CreateSessionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.spanner.v1.Session} [response] Session - */ - - /** - * Calls CreateSession. - * @function createSession - * @memberof google.spanner.v1.Spanner - * @instance - * @param {google.spanner.v1.ICreateSessionRequest} request CreateSessionRequest message or plain object - * @param {google.spanner.v1.Spanner.CreateSessionCallback} callback Node-style callback called with the error, if any, and Session - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Spanner.prototype.createSession = function createSession(request, callback) { - return this.rpcCall(createSession, $root.google.spanner.v1.CreateSessionRequest, $root.google.spanner.v1.Session, request, callback); - }, "name", { value: "CreateSession" }); - - /** - * Calls CreateSession. - * @function createSession - * @memberof google.spanner.v1.Spanner - * @instance - * @param {google.spanner.v1.ICreateSessionRequest} request CreateSessionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.v1.Spanner|batchCreateSessions}. - * @memberof google.spanner.v1.Spanner - * @typedef BatchCreateSessionsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.spanner.v1.BatchCreateSessionsResponse} [response] BatchCreateSessionsResponse - */ - - /** - * Calls BatchCreateSessions. - * @function batchCreateSessions - * @memberof google.spanner.v1.Spanner - * @instance - * @param {google.spanner.v1.IBatchCreateSessionsRequest} request BatchCreateSessionsRequest message or plain object - * @param {google.spanner.v1.Spanner.BatchCreateSessionsCallback} callback Node-style callback called with the error, if any, and BatchCreateSessionsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Spanner.prototype.batchCreateSessions = function batchCreateSessions(request, callback) { - return this.rpcCall(batchCreateSessions, $root.google.spanner.v1.BatchCreateSessionsRequest, $root.google.spanner.v1.BatchCreateSessionsResponse, request, callback); - }, "name", { value: "BatchCreateSessions" }); - - /** - * Calls BatchCreateSessions. - * @function batchCreateSessions - * @memberof google.spanner.v1.Spanner - * @instance - * @param {google.spanner.v1.IBatchCreateSessionsRequest} request BatchCreateSessionsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.v1.Spanner|getSession}. - * @memberof google.spanner.v1.Spanner - * @typedef GetSessionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.spanner.v1.Session} [response] Session - */ - - /** - * Calls GetSession. - * @function getSession - * @memberof google.spanner.v1.Spanner - * @instance - * @param {google.spanner.v1.IGetSessionRequest} request GetSessionRequest message or plain object - * @param {google.spanner.v1.Spanner.GetSessionCallback} callback Node-style callback called with the error, if any, and Session - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Spanner.prototype.getSession = function getSession(request, callback) { - return this.rpcCall(getSession, $root.google.spanner.v1.GetSessionRequest, $root.google.spanner.v1.Session, request, callback); - }, "name", { value: "GetSession" }); - - /** - * Calls GetSession. - * @function getSession - * @memberof google.spanner.v1.Spanner - * @instance - * @param {google.spanner.v1.IGetSessionRequest} request GetSessionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.v1.Spanner|listSessions}. - * @memberof google.spanner.v1.Spanner - * @typedef ListSessionsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.spanner.v1.ListSessionsResponse} [response] ListSessionsResponse - */ - - /** - * Calls ListSessions. - * @function listSessions - * @memberof google.spanner.v1.Spanner - * @instance - * @param {google.spanner.v1.IListSessionsRequest} request ListSessionsRequest message or plain object - * @param {google.spanner.v1.Spanner.ListSessionsCallback} callback Node-style callback called with the error, if any, and ListSessionsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Spanner.prototype.listSessions = function listSessions(request, callback) { - return this.rpcCall(listSessions, $root.google.spanner.v1.ListSessionsRequest, $root.google.spanner.v1.ListSessionsResponse, request, callback); - }, "name", { value: "ListSessions" }); - - /** - * Calls ListSessions. - * @function listSessions - * @memberof google.spanner.v1.Spanner - * @instance - * @param {google.spanner.v1.IListSessionsRequest} request ListSessionsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.v1.Spanner|deleteSession}. - * @memberof google.spanner.v1.Spanner - * @typedef DeleteSessionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteSession. - * @function deleteSession - * @memberof google.spanner.v1.Spanner - * @instance - * @param {google.spanner.v1.IDeleteSessionRequest} request DeleteSessionRequest message or plain object - * @param {google.spanner.v1.Spanner.DeleteSessionCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Spanner.prototype.deleteSession = function deleteSession(request, callback) { - return this.rpcCall(deleteSession, $root.google.spanner.v1.DeleteSessionRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteSession" }); - - /** - * Calls DeleteSession. - * @function deleteSession - * @memberof google.spanner.v1.Spanner - * @instance - * @param {google.spanner.v1.IDeleteSessionRequest} request DeleteSessionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.v1.Spanner|executeSql}. - * @memberof google.spanner.v1.Spanner - * @typedef ExecuteSqlCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.spanner.v1.ResultSet} [response] ResultSet - */ - - /** - * Calls ExecuteSql. - * @function executeSql - * @memberof google.spanner.v1.Spanner - * @instance - * @param {google.spanner.v1.IExecuteSqlRequest} request ExecuteSqlRequest message or plain object - * @param {google.spanner.v1.Spanner.ExecuteSqlCallback} callback Node-style callback called with the error, if any, and ResultSet - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Spanner.prototype.executeSql = function executeSql(request, callback) { - return this.rpcCall(executeSql, $root.google.spanner.v1.ExecuteSqlRequest, $root.google.spanner.v1.ResultSet, request, callback); - }, "name", { value: "ExecuteSql" }); - - /** - * Calls ExecuteSql. - * @function executeSql - * @memberof google.spanner.v1.Spanner - * @instance - * @param {google.spanner.v1.IExecuteSqlRequest} request ExecuteSqlRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.v1.Spanner|executeStreamingSql}. - * @memberof google.spanner.v1.Spanner - * @typedef ExecuteStreamingSqlCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.spanner.v1.PartialResultSet} [response] PartialResultSet - */ - - /** - * Calls ExecuteStreamingSql. - * @function executeStreamingSql - * @memberof google.spanner.v1.Spanner - * @instance - * @param {google.spanner.v1.IExecuteSqlRequest} request ExecuteSqlRequest message or plain object - * @param {google.spanner.v1.Spanner.ExecuteStreamingSqlCallback} callback Node-style callback called with the error, if any, and PartialResultSet - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Spanner.prototype.executeStreamingSql = function executeStreamingSql(request, callback) { - return this.rpcCall(executeStreamingSql, $root.google.spanner.v1.ExecuteSqlRequest, $root.google.spanner.v1.PartialResultSet, request, callback); - }, "name", { value: "ExecuteStreamingSql" }); - - /** - * Calls ExecuteStreamingSql. - * @function executeStreamingSql - * @memberof google.spanner.v1.Spanner - * @instance - * @param {google.spanner.v1.IExecuteSqlRequest} request ExecuteSqlRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.v1.Spanner|executeBatchDml}. - * @memberof google.spanner.v1.Spanner - * @typedef ExecuteBatchDmlCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.spanner.v1.ExecuteBatchDmlResponse} [response] ExecuteBatchDmlResponse - */ - - /** - * Calls ExecuteBatchDml. - * @function executeBatchDml - * @memberof google.spanner.v1.Spanner - * @instance - * @param {google.spanner.v1.IExecuteBatchDmlRequest} request ExecuteBatchDmlRequest message or plain object - * @param {google.spanner.v1.Spanner.ExecuteBatchDmlCallback} callback Node-style callback called with the error, if any, and ExecuteBatchDmlResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Spanner.prototype.executeBatchDml = function executeBatchDml(request, callback) { - return this.rpcCall(executeBatchDml, $root.google.spanner.v1.ExecuteBatchDmlRequest, $root.google.spanner.v1.ExecuteBatchDmlResponse, request, callback); - }, "name", { value: "ExecuteBatchDml" }); - - /** - * Calls ExecuteBatchDml. - * @function executeBatchDml - * @memberof google.spanner.v1.Spanner - * @instance - * @param {google.spanner.v1.IExecuteBatchDmlRequest} request ExecuteBatchDmlRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.v1.Spanner|read}. - * @memberof google.spanner.v1.Spanner - * @typedef ReadCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.spanner.v1.ResultSet} [response] ResultSet - */ - - /** - * Calls Read. - * @function read - * @memberof google.spanner.v1.Spanner - * @instance - * @param {google.spanner.v1.IReadRequest} request ReadRequest message or plain object - * @param {google.spanner.v1.Spanner.ReadCallback} callback Node-style callback called with the error, if any, and ResultSet - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Spanner.prototype.read = function read(request, callback) { - return this.rpcCall(read, $root.google.spanner.v1.ReadRequest, $root.google.spanner.v1.ResultSet, request, callback); - }, "name", { value: "Read" }); - - /** - * Calls Read. - * @function read - * @memberof google.spanner.v1.Spanner - * @instance - * @param {google.spanner.v1.IReadRequest} request ReadRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.v1.Spanner|streamingRead}. - * @memberof google.spanner.v1.Spanner - * @typedef StreamingReadCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.spanner.v1.PartialResultSet} [response] PartialResultSet - */ - - /** - * Calls StreamingRead. - * @function streamingRead - * @memberof google.spanner.v1.Spanner - * @instance - * @param {google.spanner.v1.IReadRequest} request ReadRequest message or plain object - * @param {google.spanner.v1.Spanner.StreamingReadCallback} callback Node-style callback called with the error, if any, and PartialResultSet - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Spanner.prototype.streamingRead = function streamingRead(request, callback) { - return this.rpcCall(streamingRead, $root.google.spanner.v1.ReadRequest, $root.google.spanner.v1.PartialResultSet, request, callback); - }, "name", { value: "StreamingRead" }); - - /** - * Calls StreamingRead. - * @function streamingRead - * @memberof google.spanner.v1.Spanner - * @instance - * @param {google.spanner.v1.IReadRequest} request ReadRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.v1.Spanner|beginTransaction}. - * @memberof google.spanner.v1.Spanner - * @typedef BeginTransactionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.spanner.v1.Transaction} [response] Transaction - */ - - /** - * Calls BeginTransaction. - * @function beginTransaction - * @memberof google.spanner.v1.Spanner - * @instance - * @param {google.spanner.v1.IBeginTransactionRequest} request BeginTransactionRequest message or plain object - * @param {google.spanner.v1.Spanner.BeginTransactionCallback} callback Node-style callback called with the error, if any, and Transaction - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Spanner.prototype.beginTransaction = function beginTransaction(request, callback) { - return this.rpcCall(beginTransaction, $root.google.spanner.v1.BeginTransactionRequest, $root.google.spanner.v1.Transaction, request, callback); - }, "name", { value: "BeginTransaction" }); - - /** - * Calls BeginTransaction. - * @function beginTransaction - * @memberof google.spanner.v1.Spanner - * @instance - * @param {google.spanner.v1.IBeginTransactionRequest} request BeginTransactionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.v1.Spanner|commit}. - * @memberof google.spanner.v1.Spanner - * @typedef CommitCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.spanner.v1.CommitResponse} [response] CommitResponse - */ - - /** - * Calls Commit. - * @function commit - * @memberof google.spanner.v1.Spanner - * @instance - * @param {google.spanner.v1.ICommitRequest} request CommitRequest message or plain object - * @param {google.spanner.v1.Spanner.CommitCallback} callback Node-style callback called with the error, if any, and CommitResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Spanner.prototype.commit = function commit(request, callback) { - return this.rpcCall(commit, $root.google.spanner.v1.CommitRequest, $root.google.spanner.v1.CommitResponse, request, callback); - }, "name", { value: "Commit" }); - - /** - * Calls Commit. - * @function commit - * @memberof google.spanner.v1.Spanner - * @instance - * @param {google.spanner.v1.ICommitRequest} request CommitRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.v1.Spanner|rollback}. - * @memberof google.spanner.v1.Spanner - * @typedef RollbackCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls Rollback. - * @function rollback - * @memberof google.spanner.v1.Spanner - * @instance - * @param {google.spanner.v1.IRollbackRequest} request RollbackRequest message or plain object - * @param {google.spanner.v1.Spanner.RollbackCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Spanner.prototype.rollback = function rollback(request, callback) { - return this.rpcCall(rollback, $root.google.spanner.v1.RollbackRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "Rollback" }); - - /** - * Calls Rollback. - * @function rollback - * @memberof google.spanner.v1.Spanner - * @instance - * @param {google.spanner.v1.IRollbackRequest} request RollbackRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.v1.Spanner|partitionQuery}. - * @memberof google.spanner.v1.Spanner - * @typedef PartitionQueryCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.spanner.v1.PartitionResponse} [response] PartitionResponse - */ - - /** - * Calls PartitionQuery. - * @function partitionQuery - * @memberof google.spanner.v1.Spanner - * @instance - * @param {google.spanner.v1.IPartitionQueryRequest} request PartitionQueryRequest message or plain object - * @param {google.spanner.v1.Spanner.PartitionQueryCallback} callback Node-style callback called with the error, if any, and PartitionResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Spanner.prototype.partitionQuery = function partitionQuery(request, callback) { - return this.rpcCall(partitionQuery, $root.google.spanner.v1.PartitionQueryRequest, $root.google.spanner.v1.PartitionResponse, request, callback); - }, "name", { value: "PartitionQuery" }); - - /** - * Calls PartitionQuery. - * @function partitionQuery - * @memberof google.spanner.v1.Spanner - * @instance - * @param {google.spanner.v1.IPartitionQueryRequest} request PartitionQueryRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.v1.Spanner|partitionRead}. - * @memberof google.spanner.v1.Spanner - * @typedef PartitionReadCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.spanner.v1.PartitionResponse} [response] PartitionResponse - */ - - /** - * Calls PartitionRead. - * @function partitionRead - * @memberof google.spanner.v1.Spanner - * @instance - * @param {google.spanner.v1.IPartitionReadRequest} request PartitionReadRequest message or plain object - * @param {google.spanner.v1.Spanner.PartitionReadCallback} callback Node-style callback called with the error, if any, and PartitionResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Spanner.prototype.partitionRead = function partitionRead(request, callback) { - return this.rpcCall(partitionRead, $root.google.spanner.v1.PartitionReadRequest, $root.google.spanner.v1.PartitionResponse, request, callback); - }, "name", { value: "PartitionRead" }); - - /** - * Calls PartitionRead. - * @function partitionRead - * @memberof google.spanner.v1.Spanner - * @instance - * @param {google.spanner.v1.IPartitionReadRequest} request PartitionReadRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.spanner.v1.Spanner|batchWrite}. - * @memberof google.spanner.v1.Spanner - * @typedef BatchWriteCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.spanner.v1.BatchWriteResponse} [response] BatchWriteResponse - */ - - /** - * Calls BatchWrite. - * @function batchWrite - * @memberof google.spanner.v1.Spanner - * @instance - * @param {google.spanner.v1.IBatchWriteRequest} request BatchWriteRequest message or plain object - * @param {google.spanner.v1.Spanner.BatchWriteCallback} callback Node-style callback called with the error, if any, and BatchWriteResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Spanner.prototype.batchWrite = function batchWrite(request, callback) { - return this.rpcCall(batchWrite, $root.google.spanner.v1.BatchWriteRequest, $root.google.spanner.v1.BatchWriteResponse, request, callback); - }, "name", { value: "BatchWrite" }); - - /** - * Calls BatchWrite. - * @function batchWrite - * @memberof google.spanner.v1.Spanner - * @instance - * @param {google.spanner.v1.IBatchWriteRequest} request BatchWriteRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return Spanner; - })(); - - v1.CreateSessionRequest = (function() { - - /** - * Properties of a CreateSessionRequest. - * @memberof google.spanner.v1 - * @interface ICreateSessionRequest - * @property {string|null} [database] CreateSessionRequest database - * @property {google.spanner.v1.ISession|null} [session] CreateSessionRequest session - */ - - /** - * Constructs a new CreateSessionRequest. - * @memberof google.spanner.v1 - * @classdesc Represents a CreateSessionRequest. - * @implements ICreateSessionRequest - * @constructor - * @param {google.spanner.v1.ICreateSessionRequest=} [properties] Properties to set - */ - function CreateSessionRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateSessionRequest database. - * @member {string} database - * @memberof google.spanner.v1.CreateSessionRequest - * @instance - */ - CreateSessionRequest.prototype.database = ""; - - /** - * CreateSessionRequest session. - * @member {google.spanner.v1.ISession|null|undefined} session - * @memberof google.spanner.v1.CreateSessionRequest - * @instance - */ - CreateSessionRequest.prototype.session = null; - - /** - * Creates a new CreateSessionRequest instance using the specified properties. - * @function create - * @memberof google.spanner.v1.CreateSessionRequest - * @static - * @param {google.spanner.v1.ICreateSessionRequest=} [properties] Properties to set - * @returns {google.spanner.v1.CreateSessionRequest} CreateSessionRequest instance - */ - CreateSessionRequest.create = function create(properties) { - return new CreateSessionRequest(properties); - }; - - /** - * Encodes the specified CreateSessionRequest message. Does not implicitly {@link google.spanner.v1.CreateSessionRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.CreateSessionRequest - * @static - * @param {google.spanner.v1.ICreateSessionRequest} message CreateSessionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateSessionRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.database != null && Object.hasOwnProperty.call(message, "database")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.database); - if (message.session != null && Object.hasOwnProperty.call(message, "session")) - $root.google.spanner.v1.Session.encode(message.session, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CreateSessionRequest message, length delimited. Does not implicitly {@link google.spanner.v1.CreateSessionRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.CreateSessionRequest - * @static - * @param {google.spanner.v1.ICreateSessionRequest} message CreateSessionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateSessionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateSessionRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.CreateSessionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.CreateSessionRequest} CreateSessionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateSessionRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.CreateSessionRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.database = reader.string(); - break; - } - case 2: { - message.session = $root.google.spanner.v1.Session.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateSessionRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.CreateSessionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.CreateSessionRequest} CreateSessionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateSessionRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateSessionRequest message. - * @function verify - * @memberof google.spanner.v1.CreateSessionRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateSessionRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.database != null && message.hasOwnProperty("database")) - if (!$util.isString(message.database)) - return "database: string expected"; - if (message.session != null && message.hasOwnProperty("session")) { - var error = $root.google.spanner.v1.Session.verify(message.session); - if (error) - return "session." + error; - } - return null; - }; - - /** - * Creates a CreateSessionRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.CreateSessionRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.CreateSessionRequest} CreateSessionRequest - */ - CreateSessionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.CreateSessionRequest) - return object; - var message = new $root.google.spanner.v1.CreateSessionRequest(); - if (object.database != null) - message.database = String(object.database); - if (object.session != null) { - if (typeof object.session !== "object") - throw TypeError(".google.spanner.v1.CreateSessionRequest.session: object expected"); - message.session = $root.google.spanner.v1.Session.fromObject(object.session); - } - return message; - }; - - /** - * Creates a plain object from a CreateSessionRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.CreateSessionRequest - * @static - * @param {google.spanner.v1.CreateSessionRequest} message CreateSessionRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateSessionRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.database = ""; - object.session = null; - } - if (message.database != null && message.hasOwnProperty("database")) - object.database = message.database; - if (message.session != null && message.hasOwnProperty("session")) - object.session = $root.google.spanner.v1.Session.toObject(message.session, options); - return object; - }; - - /** - * Converts this CreateSessionRequest to JSON. - * @function toJSON - * @memberof google.spanner.v1.CreateSessionRequest - * @instance - * @returns {Object.} JSON object - */ - CreateSessionRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateSessionRequest - * @function getTypeUrl - * @memberof google.spanner.v1.CreateSessionRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateSessionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.CreateSessionRequest"; - }; - - return CreateSessionRequest; - })(); - - v1.BatchCreateSessionsRequest = (function() { - - /** - * Properties of a BatchCreateSessionsRequest. - * @memberof google.spanner.v1 - * @interface IBatchCreateSessionsRequest - * @property {string|null} [database] BatchCreateSessionsRequest database - * @property {google.spanner.v1.ISession|null} [sessionTemplate] BatchCreateSessionsRequest sessionTemplate - * @property {number|null} [sessionCount] BatchCreateSessionsRequest sessionCount - */ - - /** - * Constructs a new BatchCreateSessionsRequest. - * @memberof google.spanner.v1 - * @classdesc Represents a BatchCreateSessionsRequest. - * @implements IBatchCreateSessionsRequest - * @constructor - * @param {google.spanner.v1.IBatchCreateSessionsRequest=} [properties] Properties to set - */ - function BatchCreateSessionsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BatchCreateSessionsRequest database. - * @member {string} database - * @memberof google.spanner.v1.BatchCreateSessionsRequest - * @instance - */ - BatchCreateSessionsRequest.prototype.database = ""; - - /** - * BatchCreateSessionsRequest sessionTemplate. - * @member {google.spanner.v1.ISession|null|undefined} sessionTemplate - * @memberof google.spanner.v1.BatchCreateSessionsRequest - * @instance - */ - BatchCreateSessionsRequest.prototype.sessionTemplate = null; - - /** - * BatchCreateSessionsRequest sessionCount. - * @member {number} sessionCount - * @memberof google.spanner.v1.BatchCreateSessionsRequest - * @instance - */ - BatchCreateSessionsRequest.prototype.sessionCount = 0; - - /** - * Creates a new BatchCreateSessionsRequest instance using the specified properties. - * @function create - * @memberof google.spanner.v1.BatchCreateSessionsRequest - * @static - * @param {google.spanner.v1.IBatchCreateSessionsRequest=} [properties] Properties to set - * @returns {google.spanner.v1.BatchCreateSessionsRequest} BatchCreateSessionsRequest instance - */ - BatchCreateSessionsRequest.create = function create(properties) { - return new BatchCreateSessionsRequest(properties); - }; - - /** - * Encodes the specified BatchCreateSessionsRequest message. Does not implicitly {@link google.spanner.v1.BatchCreateSessionsRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.BatchCreateSessionsRequest - * @static - * @param {google.spanner.v1.IBatchCreateSessionsRequest} message BatchCreateSessionsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchCreateSessionsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.database != null && Object.hasOwnProperty.call(message, "database")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.database); - if (message.sessionTemplate != null && Object.hasOwnProperty.call(message, "sessionTemplate")) - $root.google.spanner.v1.Session.encode(message.sessionTemplate, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.sessionCount != null && Object.hasOwnProperty.call(message, "sessionCount")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.sessionCount); - return writer; - }; - - /** - * Encodes the specified BatchCreateSessionsRequest message, length delimited. Does not implicitly {@link google.spanner.v1.BatchCreateSessionsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.BatchCreateSessionsRequest - * @static - * @param {google.spanner.v1.IBatchCreateSessionsRequest} message BatchCreateSessionsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchCreateSessionsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BatchCreateSessionsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.BatchCreateSessionsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.BatchCreateSessionsRequest} BatchCreateSessionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchCreateSessionsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.BatchCreateSessionsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.database = reader.string(); - break; - } - case 2: { - message.sessionTemplate = $root.google.spanner.v1.Session.decode(reader, reader.uint32()); - break; - } - case 3: { - message.sessionCount = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BatchCreateSessionsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.BatchCreateSessionsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.BatchCreateSessionsRequest} BatchCreateSessionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchCreateSessionsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BatchCreateSessionsRequest message. - * @function verify - * @memberof google.spanner.v1.BatchCreateSessionsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BatchCreateSessionsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.database != null && message.hasOwnProperty("database")) - if (!$util.isString(message.database)) - return "database: string expected"; - if (message.sessionTemplate != null && message.hasOwnProperty("sessionTemplate")) { - var error = $root.google.spanner.v1.Session.verify(message.sessionTemplate); - if (error) - return "sessionTemplate." + error; - } - if (message.sessionCount != null && message.hasOwnProperty("sessionCount")) - if (!$util.isInteger(message.sessionCount)) - return "sessionCount: integer expected"; - return null; - }; - - /** - * Creates a BatchCreateSessionsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.BatchCreateSessionsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.BatchCreateSessionsRequest} BatchCreateSessionsRequest - */ - BatchCreateSessionsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.BatchCreateSessionsRequest) - return object; - var message = new $root.google.spanner.v1.BatchCreateSessionsRequest(); - if (object.database != null) - message.database = String(object.database); - if (object.sessionTemplate != null) { - if (typeof object.sessionTemplate !== "object") - throw TypeError(".google.spanner.v1.BatchCreateSessionsRequest.sessionTemplate: object expected"); - message.sessionTemplate = $root.google.spanner.v1.Session.fromObject(object.sessionTemplate); - } - if (object.sessionCount != null) - message.sessionCount = object.sessionCount | 0; - return message; - }; - - /** - * Creates a plain object from a BatchCreateSessionsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.BatchCreateSessionsRequest - * @static - * @param {google.spanner.v1.BatchCreateSessionsRequest} message BatchCreateSessionsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BatchCreateSessionsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.database = ""; - object.sessionTemplate = null; - object.sessionCount = 0; - } - if (message.database != null && message.hasOwnProperty("database")) - object.database = message.database; - if (message.sessionTemplate != null && message.hasOwnProperty("sessionTemplate")) - object.sessionTemplate = $root.google.spanner.v1.Session.toObject(message.sessionTemplate, options); - if (message.sessionCount != null && message.hasOwnProperty("sessionCount")) - object.sessionCount = message.sessionCount; - return object; - }; - - /** - * Converts this BatchCreateSessionsRequest to JSON. - * @function toJSON - * @memberof google.spanner.v1.BatchCreateSessionsRequest - * @instance - * @returns {Object.} JSON object - */ - BatchCreateSessionsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BatchCreateSessionsRequest - * @function getTypeUrl - * @memberof google.spanner.v1.BatchCreateSessionsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BatchCreateSessionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.BatchCreateSessionsRequest"; - }; - - return BatchCreateSessionsRequest; - })(); - - v1.BatchCreateSessionsResponse = (function() { - - /** - * Properties of a BatchCreateSessionsResponse. - * @memberof google.spanner.v1 - * @interface IBatchCreateSessionsResponse - * @property {Array.|null} [session] BatchCreateSessionsResponse session - */ - - /** - * Constructs a new BatchCreateSessionsResponse. - * @memberof google.spanner.v1 - * @classdesc Represents a BatchCreateSessionsResponse. - * @implements IBatchCreateSessionsResponse - * @constructor - * @param {google.spanner.v1.IBatchCreateSessionsResponse=} [properties] Properties to set - */ - function BatchCreateSessionsResponse(properties) { - this.session = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BatchCreateSessionsResponse session. - * @member {Array.} session - * @memberof google.spanner.v1.BatchCreateSessionsResponse - * @instance - */ - BatchCreateSessionsResponse.prototype.session = $util.emptyArray; - - /** - * Creates a new BatchCreateSessionsResponse instance using the specified properties. - * @function create - * @memberof google.spanner.v1.BatchCreateSessionsResponse - * @static - * @param {google.spanner.v1.IBatchCreateSessionsResponse=} [properties] Properties to set - * @returns {google.spanner.v1.BatchCreateSessionsResponse} BatchCreateSessionsResponse instance - */ - BatchCreateSessionsResponse.create = function create(properties) { - return new BatchCreateSessionsResponse(properties); - }; - - /** - * Encodes the specified BatchCreateSessionsResponse message. Does not implicitly {@link google.spanner.v1.BatchCreateSessionsResponse.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.BatchCreateSessionsResponse - * @static - * @param {google.spanner.v1.IBatchCreateSessionsResponse} message BatchCreateSessionsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchCreateSessionsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.session != null && message.session.length) - for (var i = 0; i < message.session.length; ++i) - $root.google.spanner.v1.Session.encode(message.session[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified BatchCreateSessionsResponse message, length delimited. Does not implicitly {@link google.spanner.v1.BatchCreateSessionsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.BatchCreateSessionsResponse - * @static - * @param {google.spanner.v1.IBatchCreateSessionsResponse} message BatchCreateSessionsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchCreateSessionsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BatchCreateSessionsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.BatchCreateSessionsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.BatchCreateSessionsResponse} BatchCreateSessionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchCreateSessionsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.BatchCreateSessionsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.session && message.session.length)) - message.session = []; - message.session.push($root.google.spanner.v1.Session.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BatchCreateSessionsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.BatchCreateSessionsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.BatchCreateSessionsResponse} BatchCreateSessionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchCreateSessionsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BatchCreateSessionsResponse message. - * @function verify - * @memberof google.spanner.v1.BatchCreateSessionsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BatchCreateSessionsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.session != null && message.hasOwnProperty("session")) { - if (!Array.isArray(message.session)) - return "session: array expected"; - for (var i = 0; i < message.session.length; ++i) { - var error = $root.google.spanner.v1.Session.verify(message.session[i]); - if (error) - return "session." + error; - } - } - return null; - }; - - /** - * Creates a BatchCreateSessionsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.BatchCreateSessionsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.BatchCreateSessionsResponse} BatchCreateSessionsResponse - */ - BatchCreateSessionsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.BatchCreateSessionsResponse) - return object; - var message = new $root.google.spanner.v1.BatchCreateSessionsResponse(); - if (object.session) { - if (!Array.isArray(object.session)) - throw TypeError(".google.spanner.v1.BatchCreateSessionsResponse.session: array expected"); - message.session = []; - for (var i = 0; i < object.session.length; ++i) { - if (typeof object.session[i] !== "object") - throw TypeError(".google.spanner.v1.BatchCreateSessionsResponse.session: object expected"); - message.session[i] = $root.google.spanner.v1.Session.fromObject(object.session[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a BatchCreateSessionsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.BatchCreateSessionsResponse - * @static - * @param {google.spanner.v1.BatchCreateSessionsResponse} message BatchCreateSessionsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BatchCreateSessionsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.session = []; - if (message.session && message.session.length) { - object.session = []; - for (var j = 0; j < message.session.length; ++j) - object.session[j] = $root.google.spanner.v1.Session.toObject(message.session[j], options); - } - return object; - }; - - /** - * Converts this BatchCreateSessionsResponse to JSON. - * @function toJSON - * @memberof google.spanner.v1.BatchCreateSessionsResponse - * @instance - * @returns {Object.} JSON object - */ - BatchCreateSessionsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BatchCreateSessionsResponse - * @function getTypeUrl - * @memberof google.spanner.v1.BatchCreateSessionsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BatchCreateSessionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.BatchCreateSessionsResponse"; - }; - - return BatchCreateSessionsResponse; - })(); - - v1.Session = (function() { - - /** - * Properties of a Session. - * @memberof google.spanner.v1 - * @interface ISession - * @property {string|null} [name] Session name - * @property {Object.|null} [labels] Session labels - * @property {google.protobuf.ITimestamp|null} [createTime] Session createTime - * @property {google.protobuf.ITimestamp|null} [approximateLastUseTime] Session approximateLastUseTime - * @property {string|null} [creatorRole] Session creatorRole - * @property {boolean|null} [multiplexed] Session multiplexed - */ - - /** - * Constructs a new Session. - * @memberof google.spanner.v1 - * @classdesc Represents a Session. - * @implements ISession - * @constructor - * @param {google.spanner.v1.ISession=} [properties] Properties to set - */ - function Session(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]]; - } - - /** - * Session name. - * @member {string} name - * @memberof google.spanner.v1.Session - * @instance - */ - Session.prototype.name = ""; - - /** - * Session labels. - * @member {Object.} labels - * @memberof google.spanner.v1.Session - * @instance - */ - Session.prototype.labels = $util.emptyObject; - - /** - * Session createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.spanner.v1.Session - * @instance - */ - Session.prototype.createTime = null; - - /** - * Session approximateLastUseTime. - * @member {google.protobuf.ITimestamp|null|undefined} approximateLastUseTime - * @memberof google.spanner.v1.Session - * @instance - */ - Session.prototype.approximateLastUseTime = null; - - /** - * Session creatorRole. - * @member {string} creatorRole - * @memberof google.spanner.v1.Session - * @instance - */ - Session.prototype.creatorRole = ""; - - /** - * Session multiplexed. - * @member {boolean} multiplexed - * @memberof google.spanner.v1.Session - * @instance - */ - Session.prototype.multiplexed = false; - - /** - * Creates a new Session instance using the specified properties. - * @function create - * @memberof google.spanner.v1.Session - * @static - * @param {google.spanner.v1.ISession=} [properties] Properties to set - * @returns {google.spanner.v1.Session} Session instance - */ - Session.create = function create(properties) { - return new Session(properties); - }; - - /** - * Encodes the specified Session message. Does not implicitly {@link google.spanner.v1.Session.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.Session - * @static - * @param {google.spanner.v1.ISession} message Session message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Session.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.approximateLastUseTime != null && Object.hasOwnProperty.call(message, "approximateLastUseTime")) - $root.google.protobuf.Timestamp.encode(message.approximateLastUseTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.creatorRole != null && Object.hasOwnProperty.call(message, "creatorRole")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.creatorRole); - if (message.multiplexed != null && Object.hasOwnProperty.call(message, "multiplexed")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.multiplexed); - return writer; - }; - - /** - * Encodes the specified Session message, length delimited. Does not implicitly {@link google.spanner.v1.Session.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.Session - * @static - * @param {google.spanner.v1.ISession} message Session message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Session.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Session message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.Session - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.Session} Session - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Session.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.Session(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.labels[key] = value; - break; - } - case 3: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 4: { - message.approximateLastUseTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 5: { - message.creatorRole = reader.string(); - break; - } - case 6: { - message.multiplexed = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Session message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.Session - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.Session} Session - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Session.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Session message. - * @function verify - * @memberof google.spanner.v1.Session - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Session.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.labels != null && message.hasOwnProperty("labels")) { - if (!$util.isObject(message.labels)) - return "labels: object expected"; - var key = Object.keys(message.labels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.labels[key[i]])) - return "labels: string{k:string} expected"; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.approximateLastUseTime != null && message.hasOwnProperty("approximateLastUseTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.approximateLastUseTime); - if (error) - return "approximateLastUseTime." + error; - } - if (message.creatorRole != null && message.hasOwnProperty("creatorRole")) - if (!$util.isString(message.creatorRole)) - return "creatorRole: string expected"; - if (message.multiplexed != null && message.hasOwnProperty("multiplexed")) - if (typeof message.multiplexed !== "boolean") - return "multiplexed: boolean expected"; - return null; - }; - - /** - * Creates a Session message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.Session - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.Session} Session - */ - Session.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.Session) - return object; - var message = new $root.google.spanner.v1.Session(); - if (object.name != null) - message.name = String(object.name); - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.spanner.v1.Session.labels: object expected"); - message.labels = {}; - for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) - message.labels[keys[i]] = String(object.labels[keys[i]]); - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.spanner.v1.Session.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.approximateLastUseTime != null) { - if (typeof object.approximateLastUseTime !== "object") - throw TypeError(".google.spanner.v1.Session.approximateLastUseTime: object expected"); - message.approximateLastUseTime = $root.google.protobuf.Timestamp.fromObject(object.approximateLastUseTime); - } - if (object.creatorRole != null) - message.creatorRole = String(object.creatorRole); - if (object.multiplexed != null) - message.multiplexed = Boolean(object.multiplexed); - return message; - }; - - /** - * Creates a plain object from a Session message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.Session - * @static - * @param {google.spanner.v1.Session} message Session - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Session.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.labels = {}; - if (options.defaults) { - object.name = ""; - object.createTime = null; - object.approximateLastUseTime = null; - object.creatorRole = ""; - object.multiplexed = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - var keys2; - if (message.labels && (keys2 = Object.keys(message.labels)).length) { - object.labels = {}; - for (var j = 0; j < keys2.length; ++j) - object.labels[keys2[j]] = message.labels[keys2[j]]; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.approximateLastUseTime != null && message.hasOwnProperty("approximateLastUseTime")) - object.approximateLastUseTime = $root.google.protobuf.Timestamp.toObject(message.approximateLastUseTime, options); - if (message.creatorRole != null && message.hasOwnProperty("creatorRole")) - object.creatorRole = message.creatorRole; - if (message.multiplexed != null && message.hasOwnProperty("multiplexed")) - object.multiplexed = message.multiplexed; - return object; - }; - - /** - * Converts this Session to JSON. - * @function toJSON - * @memberof google.spanner.v1.Session - * @instance - * @returns {Object.} JSON object - */ - Session.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Session - * @function getTypeUrl - * @memberof google.spanner.v1.Session - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Session.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.Session"; - }; - - return Session; - })(); - - v1.GetSessionRequest = (function() { - - /** - * Properties of a GetSessionRequest. - * @memberof google.spanner.v1 - * @interface IGetSessionRequest - * @property {string|null} [name] GetSessionRequest name - */ - - /** - * Constructs a new GetSessionRequest. - * @memberof google.spanner.v1 - * @classdesc Represents a GetSessionRequest. - * @implements IGetSessionRequest - * @constructor - * @param {google.spanner.v1.IGetSessionRequest=} [properties] Properties to set - */ - function GetSessionRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetSessionRequest name. - * @member {string} name - * @memberof google.spanner.v1.GetSessionRequest - * @instance - */ - GetSessionRequest.prototype.name = ""; - - /** - * Creates a new GetSessionRequest instance using the specified properties. - * @function create - * @memberof google.spanner.v1.GetSessionRequest - * @static - * @param {google.spanner.v1.IGetSessionRequest=} [properties] Properties to set - * @returns {google.spanner.v1.GetSessionRequest} GetSessionRequest instance - */ - GetSessionRequest.create = function create(properties) { - return new GetSessionRequest(properties); - }; - - /** - * Encodes the specified GetSessionRequest message. Does not implicitly {@link google.spanner.v1.GetSessionRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.GetSessionRequest - * @static - * @param {google.spanner.v1.IGetSessionRequest} message GetSessionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetSessionRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; - - /** - * Encodes the specified GetSessionRequest message, length delimited. Does not implicitly {@link google.spanner.v1.GetSessionRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.GetSessionRequest - * @static - * @param {google.spanner.v1.IGetSessionRequest} message GetSessionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetSessionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetSessionRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.GetSessionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.GetSessionRequest} GetSessionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetSessionRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.GetSessionRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetSessionRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.GetSessionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.GetSessionRequest} GetSessionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetSessionRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetSessionRequest message. - * @function verify - * @memberof google.spanner.v1.GetSessionRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetSessionRequest.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 GetSessionRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.GetSessionRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.GetSessionRequest} GetSessionRequest - */ - GetSessionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.GetSessionRequest) - return object; - var message = new $root.google.spanner.v1.GetSessionRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetSessionRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.GetSessionRequest - * @static - * @param {google.spanner.v1.GetSessionRequest} message GetSessionRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetSessionRequest.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 GetSessionRequest to JSON. - * @function toJSON - * @memberof google.spanner.v1.GetSessionRequest - * @instance - * @returns {Object.} JSON object - */ - GetSessionRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetSessionRequest - * @function getTypeUrl - * @memberof google.spanner.v1.GetSessionRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetSessionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.GetSessionRequest"; - }; - - return GetSessionRequest; - })(); - - v1.ListSessionsRequest = (function() { - - /** - * Properties of a ListSessionsRequest. - * @memberof google.spanner.v1 - * @interface IListSessionsRequest - * @property {string|null} [database] ListSessionsRequest database - * @property {number|null} [pageSize] ListSessionsRequest pageSize - * @property {string|null} [pageToken] ListSessionsRequest pageToken - * @property {string|null} [filter] ListSessionsRequest filter - */ - - /** - * Constructs a new ListSessionsRequest. - * @memberof google.spanner.v1 - * @classdesc Represents a ListSessionsRequest. - * @implements IListSessionsRequest - * @constructor - * @param {google.spanner.v1.IListSessionsRequest=} [properties] Properties to set - */ - function ListSessionsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListSessionsRequest database. - * @member {string} database - * @memberof google.spanner.v1.ListSessionsRequest - * @instance - */ - ListSessionsRequest.prototype.database = ""; - - /** - * ListSessionsRequest pageSize. - * @member {number} pageSize - * @memberof google.spanner.v1.ListSessionsRequest - * @instance - */ - ListSessionsRequest.prototype.pageSize = 0; - - /** - * ListSessionsRequest pageToken. - * @member {string} pageToken - * @memberof google.spanner.v1.ListSessionsRequest - * @instance - */ - ListSessionsRequest.prototype.pageToken = ""; - - /** - * ListSessionsRequest filter. - * @member {string} filter - * @memberof google.spanner.v1.ListSessionsRequest - * @instance - */ - ListSessionsRequest.prototype.filter = ""; - - /** - * Creates a new ListSessionsRequest instance using the specified properties. - * @function create - * @memberof google.spanner.v1.ListSessionsRequest - * @static - * @param {google.spanner.v1.IListSessionsRequest=} [properties] Properties to set - * @returns {google.spanner.v1.ListSessionsRequest} ListSessionsRequest instance - */ - ListSessionsRequest.create = function create(properties) { - return new ListSessionsRequest(properties); - }; - - /** - * Encodes the specified ListSessionsRequest message. Does not implicitly {@link google.spanner.v1.ListSessionsRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.ListSessionsRequest - * @static - * @param {google.spanner.v1.IListSessionsRequest} message ListSessionsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListSessionsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.database != null && Object.hasOwnProperty.call(message, "database")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.database); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); - return writer; - }; - - /** - * Encodes the specified ListSessionsRequest message, length delimited. Does not implicitly {@link google.spanner.v1.ListSessionsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.ListSessionsRequest - * @static - * @param {google.spanner.v1.IListSessionsRequest} message ListSessionsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListSessionsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListSessionsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.ListSessionsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.ListSessionsRequest} ListSessionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListSessionsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.ListSessionsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.database = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - case 4: { - message.filter = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListSessionsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.ListSessionsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.ListSessionsRequest} ListSessionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListSessionsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListSessionsRequest message. - * @function verify - * @memberof google.spanner.v1.ListSessionsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListSessionsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.database != null && message.hasOwnProperty("database")) - if (!$util.isString(message.database)) - return "database: 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.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - return null; - }; - - /** - * Creates a ListSessionsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.ListSessionsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.ListSessionsRequest} ListSessionsRequest - */ - ListSessionsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.ListSessionsRequest) - return object; - var message = new $root.google.spanner.v1.ListSessionsRequest(); - if (object.database != null) - message.database = String(object.database); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.filter != null) - message.filter = String(object.filter); - return message; - }; - - /** - * Creates a plain object from a ListSessionsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.ListSessionsRequest - * @static - * @param {google.spanner.v1.ListSessionsRequest} message ListSessionsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListSessionsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.database = ""; - object.pageSize = 0; - object.pageToken = ""; - object.filter = ""; - } - if (message.database != null && message.hasOwnProperty("database")) - object.database = message.database; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - return object; - }; - - /** - * Converts this ListSessionsRequest to JSON. - * @function toJSON - * @memberof google.spanner.v1.ListSessionsRequest - * @instance - * @returns {Object.} JSON object - */ - ListSessionsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListSessionsRequest - * @function getTypeUrl - * @memberof google.spanner.v1.ListSessionsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListSessionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.ListSessionsRequest"; - }; - - return ListSessionsRequest; - })(); - - v1.ListSessionsResponse = (function() { - - /** - * Properties of a ListSessionsResponse. - * @memberof google.spanner.v1 - * @interface IListSessionsResponse - * @property {Array.|null} [sessions] ListSessionsResponse sessions - * @property {string|null} [nextPageToken] ListSessionsResponse nextPageToken - */ - - /** - * Constructs a new ListSessionsResponse. - * @memberof google.spanner.v1 - * @classdesc Represents a ListSessionsResponse. - * @implements IListSessionsResponse - * @constructor - * @param {google.spanner.v1.IListSessionsResponse=} [properties] Properties to set - */ - function ListSessionsResponse(properties) { - this.sessions = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListSessionsResponse sessions. - * @member {Array.} sessions - * @memberof google.spanner.v1.ListSessionsResponse - * @instance - */ - ListSessionsResponse.prototype.sessions = $util.emptyArray; - - /** - * ListSessionsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.spanner.v1.ListSessionsResponse - * @instance - */ - ListSessionsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListSessionsResponse instance using the specified properties. - * @function create - * @memberof google.spanner.v1.ListSessionsResponse - * @static - * @param {google.spanner.v1.IListSessionsResponse=} [properties] Properties to set - * @returns {google.spanner.v1.ListSessionsResponse} ListSessionsResponse instance - */ - ListSessionsResponse.create = function create(properties) { - return new ListSessionsResponse(properties); - }; - - /** - * Encodes the specified ListSessionsResponse message. Does not implicitly {@link google.spanner.v1.ListSessionsResponse.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.ListSessionsResponse - * @static - * @param {google.spanner.v1.IListSessionsResponse} message ListSessionsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListSessionsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.sessions != null && message.sessions.length) - for (var i = 0; i < message.sessions.length; ++i) - $root.google.spanner.v1.Session.encode(message.sessions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - return writer; - }; - - /** - * Encodes the specified ListSessionsResponse message, length delimited. Does not implicitly {@link google.spanner.v1.ListSessionsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.ListSessionsResponse - * @static - * @param {google.spanner.v1.IListSessionsResponse} message ListSessionsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListSessionsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListSessionsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.ListSessionsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.ListSessionsResponse} ListSessionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListSessionsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.ListSessionsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.sessions && message.sessions.length)) - message.sessions = []; - message.sessions.push($root.google.spanner.v1.Session.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListSessionsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.ListSessionsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.ListSessionsResponse} ListSessionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListSessionsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListSessionsResponse message. - * @function verify - * @memberof google.spanner.v1.ListSessionsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListSessionsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.sessions != null && message.hasOwnProperty("sessions")) { - if (!Array.isArray(message.sessions)) - return "sessions: array expected"; - for (var i = 0; i < message.sessions.length; ++i) { - var error = $root.google.spanner.v1.Session.verify(message.sessions[i]); - if (error) - return "sessions." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListSessionsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.ListSessionsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.ListSessionsResponse} ListSessionsResponse - */ - ListSessionsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.ListSessionsResponse) - return object; - var message = new $root.google.spanner.v1.ListSessionsResponse(); - if (object.sessions) { - if (!Array.isArray(object.sessions)) - throw TypeError(".google.spanner.v1.ListSessionsResponse.sessions: array expected"); - message.sessions = []; - for (var i = 0; i < object.sessions.length; ++i) { - if (typeof object.sessions[i] !== "object") - throw TypeError(".google.spanner.v1.ListSessionsResponse.sessions: object expected"); - message.sessions[i] = $root.google.spanner.v1.Session.fromObject(object.sessions[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListSessionsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.ListSessionsResponse - * @static - * @param {google.spanner.v1.ListSessionsResponse} message ListSessionsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListSessionsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.sessions = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.sessions && message.sessions.length) { - object.sessions = []; - for (var j = 0; j < message.sessions.length; ++j) - object.sessions[j] = $root.google.spanner.v1.Session.toObject(message.sessions[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListSessionsResponse to JSON. - * @function toJSON - * @memberof google.spanner.v1.ListSessionsResponse - * @instance - * @returns {Object.} JSON object - */ - ListSessionsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListSessionsResponse - * @function getTypeUrl - * @memberof google.spanner.v1.ListSessionsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListSessionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.ListSessionsResponse"; - }; - - return ListSessionsResponse; - })(); - - v1.DeleteSessionRequest = (function() { - - /** - * Properties of a DeleteSessionRequest. - * @memberof google.spanner.v1 - * @interface IDeleteSessionRequest - * @property {string|null} [name] DeleteSessionRequest name - */ - - /** - * Constructs a new DeleteSessionRequest. - * @memberof google.spanner.v1 - * @classdesc Represents a DeleteSessionRequest. - * @implements IDeleteSessionRequest - * @constructor - * @param {google.spanner.v1.IDeleteSessionRequest=} [properties] Properties to set - */ - function DeleteSessionRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteSessionRequest name. - * @member {string} name - * @memberof google.spanner.v1.DeleteSessionRequest - * @instance - */ - DeleteSessionRequest.prototype.name = ""; - - /** - * Creates a new DeleteSessionRequest instance using the specified properties. - * @function create - * @memberof google.spanner.v1.DeleteSessionRequest - * @static - * @param {google.spanner.v1.IDeleteSessionRequest=} [properties] Properties to set - * @returns {google.spanner.v1.DeleteSessionRequest} DeleteSessionRequest instance - */ - DeleteSessionRequest.create = function create(properties) { - return new DeleteSessionRequest(properties); - }; - - /** - * Encodes the specified DeleteSessionRequest message. Does not implicitly {@link google.spanner.v1.DeleteSessionRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.DeleteSessionRequest - * @static - * @param {google.spanner.v1.IDeleteSessionRequest} message DeleteSessionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteSessionRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; - - /** - * Encodes the specified DeleteSessionRequest message, length delimited. Does not implicitly {@link google.spanner.v1.DeleteSessionRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.DeleteSessionRequest - * @static - * @param {google.spanner.v1.IDeleteSessionRequest} message DeleteSessionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteSessionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteSessionRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.DeleteSessionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.DeleteSessionRequest} DeleteSessionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteSessionRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.DeleteSessionRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteSessionRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.DeleteSessionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.DeleteSessionRequest} DeleteSessionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteSessionRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteSessionRequest message. - * @function verify - * @memberof google.spanner.v1.DeleteSessionRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteSessionRequest.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 DeleteSessionRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.DeleteSessionRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.DeleteSessionRequest} DeleteSessionRequest - */ - DeleteSessionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.DeleteSessionRequest) - return object; - var message = new $root.google.spanner.v1.DeleteSessionRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a DeleteSessionRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.DeleteSessionRequest - * @static - * @param {google.spanner.v1.DeleteSessionRequest} message DeleteSessionRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteSessionRequest.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 DeleteSessionRequest to JSON. - * @function toJSON - * @memberof google.spanner.v1.DeleteSessionRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteSessionRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteSessionRequest - * @function getTypeUrl - * @memberof google.spanner.v1.DeleteSessionRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteSessionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.DeleteSessionRequest"; - }; - - return DeleteSessionRequest; - })(); - - v1.RequestOptions = (function() { - - /** - * Properties of a RequestOptions. - * @memberof google.spanner.v1 - * @interface IRequestOptions - * @property {google.spanner.v1.RequestOptions.Priority|null} [priority] RequestOptions priority - * @property {string|null} [requestTag] RequestOptions requestTag - * @property {string|null} [transactionTag] RequestOptions transactionTag - * @property {google.spanner.v1.RequestOptions.IClientContext|null} [clientContext] RequestOptions clientContext - */ - - /** - * Constructs a new RequestOptions. - * @memberof google.spanner.v1 - * @classdesc Represents a RequestOptions. - * @implements IRequestOptions - * @constructor - * @param {google.spanner.v1.IRequestOptions=} [properties] Properties to set - */ - function RequestOptions(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RequestOptions priority. - * @member {google.spanner.v1.RequestOptions.Priority} priority - * @memberof google.spanner.v1.RequestOptions - * @instance - */ - RequestOptions.prototype.priority = 0; - - /** - * RequestOptions requestTag. - * @member {string} requestTag - * @memberof google.spanner.v1.RequestOptions - * @instance - */ - RequestOptions.prototype.requestTag = ""; - - /** - * RequestOptions transactionTag. - * @member {string} transactionTag - * @memberof google.spanner.v1.RequestOptions - * @instance - */ - RequestOptions.prototype.transactionTag = ""; - - /** - * RequestOptions clientContext. - * @member {google.spanner.v1.RequestOptions.IClientContext|null|undefined} clientContext - * @memberof google.spanner.v1.RequestOptions - * @instance - */ - RequestOptions.prototype.clientContext = null; - - /** - * Creates a new RequestOptions instance using the specified properties. - * @function create - * @memberof google.spanner.v1.RequestOptions - * @static - * @param {google.spanner.v1.IRequestOptions=} [properties] Properties to set - * @returns {google.spanner.v1.RequestOptions} RequestOptions instance - */ - RequestOptions.create = function create(properties) { - return new RequestOptions(properties); - }; - - /** - * Encodes the specified RequestOptions message. Does not implicitly {@link google.spanner.v1.RequestOptions.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.RequestOptions - * @static - * @param {google.spanner.v1.IRequestOptions} message RequestOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RequestOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.priority != null && Object.hasOwnProperty.call(message, "priority")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.priority); - if (message.requestTag != null && Object.hasOwnProperty.call(message, "requestTag")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestTag); - if (message.transactionTag != null && Object.hasOwnProperty.call(message, "transactionTag")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.transactionTag); - if (message.clientContext != null && Object.hasOwnProperty.call(message, "clientContext")) - $root.google.spanner.v1.RequestOptions.ClientContext.encode(message.clientContext, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified RequestOptions message, length delimited. Does not implicitly {@link google.spanner.v1.RequestOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.RequestOptions - * @static - * @param {google.spanner.v1.IRequestOptions} message RequestOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RequestOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RequestOptions message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.RequestOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.RequestOptions} RequestOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RequestOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.RequestOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.priority = reader.int32(); - break; - } - case 2: { - message.requestTag = reader.string(); - break; - } - case 3: { - message.transactionTag = reader.string(); - break; - } - case 4: { - message.clientContext = $root.google.spanner.v1.RequestOptions.ClientContext.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RequestOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.RequestOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.RequestOptions} RequestOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RequestOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RequestOptions message. - * @function verify - * @memberof google.spanner.v1.RequestOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RequestOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.priority != null && message.hasOwnProperty("priority")) - switch (message.priority) { - default: - return "priority: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.requestTag != null && message.hasOwnProperty("requestTag")) - if (!$util.isString(message.requestTag)) - return "requestTag: string expected"; - if (message.transactionTag != null && message.hasOwnProperty("transactionTag")) - if (!$util.isString(message.transactionTag)) - return "transactionTag: string expected"; - if (message.clientContext != null && message.hasOwnProperty("clientContext")) { - var error = $root.google.spanner.v1.RequestOptions.ClientContext.verify(message.clientContext); - if (error) - return "clientContext." + error; - } - return null; - }; - - /** - * Creates a RequestOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.RequestOptions - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.RequestOptions} RequestOptions - */ - RequestOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.RequestOptions) - return object; - var message = new $root.google.spanner.v1.RequestOptions(); - switch (object.priority) { - default: - if (typeof object.priority === "number") { - message.priority = object.priority; - break; - } - break; - case "PRIORITY_UNSPECIFIED": - case 0: - message.priority = 0; - break; - case "PRIORITY_LOW": - case 1: - message.priority = 1; - break; - case "PRIORITY_MEDIUM": - case 2: - message.priority = 2; - break; - case "PRIORITY_HIGH": - case 3: - message.priority = 3; - break; - } - if (object.requestTag != null) - message.requestTag = String(object.requestTag); - if (object.transactionTag != null) - message.transactionTag = String(object.transactionTag); - if (object.clientContext != null) { - if (typeof object.clientContext !== "object") - throw TypeError(".google.spanner.v1.RequestOptions.clientContext: object expected"); - message.clientContext = $root.google.spanner.v1.RequestOptions.ClientContext.fromObject(object.clientContext); - } - return message; - }; - - /** - * Creates a plain object from a RequestOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.RequestOptions - * @static - * @param {google.spanner.v1.RequestOptions} message RequestOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RequestOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.priority = options.enums === String ? "PRIORITY_UNSPECIFIED" : 0; - object.requestTag = ""; - object.transactionTag = ""; - object.clientContext = null; - } - if (message.priority != null && message.hasOwnProperty("priority")) - object.priority = options.enums === String ? $root.google.spanner.v1.RequestOptions.Priority[message.priority] === undefined ? message.priority : $root.google.spanner.v1.RequestOptions.Priority[message.priority] : message.priority; - if (message.requestTag != null && message.hasOwnProperty("requestTag")) - object.requestTag = message.requestTag; - if (message.transactionTag != null && message.hasOwnProperty("transactionTag")) - object.transactionTag = message.transactionTag; - if (message.clientContext != null && message.hasOwnProperty("clientContext")) - object.clientContext = $root.google.spanner.v1.RequestOptions.ClientContext.toObject(message.clientContext, options); - return object; - }; - - /** - * Converts this RequestOptions to JSON. - * @function toJSON - * @memberof google.spanner.v1.RequestOptions - * @instance - * @returns {Object.} JSON object - */ - RequestOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RequestOptions - * @function getTypeUrl - * @memberof google.spanner.v1.RequestOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RequestOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.RequestOptions"; - }; - - /** - * Priority enum. - * @name google.spanner.v1.RequestOptions.Priority - * @enum {number} - * @property {number} PRIORITY_UNSPECIFIED=0 PRIORITY_UNSPECIFIED value - * @property {number} PRIORITY_LOW=1 PRIORITY_LOW value - * @property {number} PRIORITY_MEDIUM=2 PRIORITY_MEDIUM value - * @property {number} PRIORITY_HIGH=3 PRIORITY_HIGH value - */ - RequestOptions.Priority = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "PRIORITY_UNSPECIFIED"] = 0; - values[valuesById[1] = "PRIORITY_LOW"] = 1; - values[valuesById[2] = "PRIORITY_MEDIUM"] = 2; - values[valuesById[3] = "PRIORITY_HIGH"] = 3; - return values; - })(); - - RequestOptions.ClientContext = (function() { - - /** - * Properties of a ClientContext. - * @memberof google.spanner.v1.RequestOptions - * @interface IClientContext - * @property {Object.|null} [secureContext] ClientContext secureContext - */ - - /** - * Constructs a new ClientContext. - * @memberof google.spanner.v1.RequestOptions - * @classdesc Represents a ClientContext. - * @implements IClientContext - * @constructor - * @param {google.spanner.v1.RequestOptions.IClientContext=} [properties] Properties to set - */ - function ClientContext(properties) { - this.secureContext = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ClientContext secureContext. - * @member {Object.} secureContext - * @memberof google.spanner.v1.RequestOptions.ClientContext - * @instance - */ - ClientContext.prototype.secureContext = $util.emptyObject; - - /** - * Creates a new ClientContext instance using the specified properties. - * @function create - * @memberof google.spanner.v1.RequestOptions.ClientContext - * @static - * @param {google.spanner.v1.RequestOptions.IClientContext=} [properties] Properties to set - * @returns {google.spanner.v1.RequestOptions.ClientContext} ClientContext instance - */ - ClientContext.create = function create(properties) { - return new ClientContext(properties); - }; - - /** - * Encodes the specified ClientContext message. Does not implicitly {@link google.spanner.v1.RequestOptions.ClientContext.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.RequestOptions.ClientContext - * @static - * @param {google.spanner.v1.RequestOptions.IClientContext} message ClientContext message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClientContext.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.secureContext != null && Object.hasOwnProperty.call(message, "secureContext")) - for (var keys = Object.keys(message.secureContext), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.protobuf.Value.encode(message.secureContext[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - return writer; - }; - - /** - * Encodes the specified ClientContext message, length delimited. Does not implicitly {@link google.spanner.v1.RequestOptions.ClientContext.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.RequestOptions.ClientContext - * @static - * @param {google.spanner.v1.RequestOptions.IClientContext} message ClientContext message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClientContext.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ClientContext message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.RequestOptions.ClientContext - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.RequestOptions.ClientContext} ClientContext - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClientContext.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.RequestOptions.ClientContext(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (message.secureContext === $util.emptyObject) - message.secureContext = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = null; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = $root.google.protobuf.Value.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.secureContext[key] = value; - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ClientContext message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.RequestOptions.ClientContext - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.RequestOptions.ClientContext} ClientContext - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClientContext.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ClientContext message. - * @function verify - * @memberof google.spanner.v1.RequestOptions.ClientContext - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ClientContext.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.secureContext != null && message.hasOwnProperty("secureContext")) { - if (!$util.isObject(message.secureContext)) - return "secureContext: object expected"; - var key = Object.keys(message.secureContext); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.protobuf.Value.verify(message.secureContext[key[i]]); - if (error) - return "secureContext." + error; - } - } - return null; - }; - - /** - * Creates a ClientContext message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.RequestOptions.ClientContext - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.RequestOptions.ClientContext} ClientContext - */ - ClientContext.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.RequestOptions.ClientContext) - return object; - var message = new $root.google.spanner.v1.RequestOptions.ClientContext(); - if (object.secureContext) { - if (typeof object.secureContext !== "object") - throw TypeError(".google.spanner.v1.RequestOptions.ClientContext.secureContext: object expected"); - message.secureContext = {}; - for (var keys = Object.keys(object.secureContext), i = 0; i < keys.length; ++i) { - if (typeof object.secureContext[keys[i]] !== "object") - throw TypeError(".google.spanner.v1.RequestOptions.ClientContext.secureContext: object expected"); - message.secureContext[keys[i]] = $root.google.protobuf.Value.fromObject(object.secureContext[keys[i]]); - } - } - return message; - }; - - /** - * Creates a plain object from a ClientContext message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.RequestOptions.ClientContext - * @static - * @param {google.spanner.v1.RequestOptions.ClientContext} message ClientContext - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ClientContext.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.secureContext = {}; - var keys2; - if (message.secureContext && (keys2 = Object.keys(message.secureContext)).length) { - object.secureContext = {}; - for (var j = 0; j < keys2.length; ++j) - object.secureContext[keys2[j]] = $root.google.protobuf.Value.toObject(message.secureContext[keys2[j]], options); - } - return object; - }; - - /** - * Converts this ClientContext to JSON. - * @function toJSON - * @memberof google.spanner.v1.RequestOptions.ClientContext - * @instance - * @returns {Object.} JSON object - */ - ClientContext.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ClientContext - * @function getTypeUrl - * @memberof google.spanner.v1.RequestOptions.ClientContext - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ClientContext.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.RequestOptions.ClientContext"; - }; - - return ClientContext; - })(); - - return RequestOptions; - })(); - - v1.DirectedReadOptions = (function() { - - /** - * Properties of a DirectedReadOptions. - * @memberof google.spanner.v1 - * @interface IDirectedReadOptions - * @property {google.spanner.v1.DirectedReadOptions.IIncludeReplicas|null} [includeReplicas] DirectedReadOptions includeReplicas - * @property {google.spanner.v1.DirectedReadOptions.IExcludeReplicas|null} [excludeReplicas] DirectedReadOptions excludeReplicas - */ - - /** - * Constructs a new DirectedReadOptions. - * @memberof google.spanner.v1 - * @classdesc Represents a DirectedReadOptions. - * @implements IDirectedReadOptions - * @constructor - * @param {google.spanner.v1.IDirectedReadOptions=} [properties] Properties to set - */ - function DirectedReadOptions(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DirectedReadOptions includeReplicas. - * @member {google.spanner.v1.DirectedReadOptions.IIncludeReplicas|null|undefined} includeReplicas - * @memberof google.spanner.v1.DirectedReadOptions - * @instance - */ - DirectedReadOptions.prototype.includeReplicas = null; - - /** - * DirectedReadOptions excludeReplicas. - * @member {google.spanner.v1.DirectedReadOptions.IExcludeReplicas|null|undefined} excludeReplicas - * @memberof google.spanner.v1.DirectedReadOptions - * @instance - */ - DirectedReadOptions.prototype.excludeReplicas = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * DirectedReadOptions replicas. - * @member {"includeReplicas"|"excludeReplicas"|undefined} replicas - * @memberof google.spanner.v1.DirectedReadOptions - * @instance - */ - Object.defineProperty(DirectedReadOptions.prototype, "replicas", { - get: $util.oneOfGetter($oneOfFields = ["includeReplicas", "excludeReplicas"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new DirectedReadOptions instance using the specified properties. - * @function create - * @memberof google.spanner.v1.DirectedReadOptions - * @static - * @param {google.spanner.v1.IDirectedReadOptions=} [properties] Properties to set - * @returns {google.spanner.v1.DirectedReadOptions} DirectedReadOptions instance - */ - DirectedReadOptions.create = function create(properties) { - return new DirectedReadOptions(properties); - }; - - /** - * Encodes the specified DirectedReadOptions message. Does not implicitly {@link google.spanner.v1.DirectedReadOptions.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.DirectedReadOptions - * @static - * @param {google.spanner.v1.IDirectedReadOptions} message DirectedReadOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DirectedReadOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.includeReplicas != null && Object.hasOwnProperty.call(message, "includeReplicas")) - $root.google.spanner.v1.DirectedReadOptions.IncludeReplicas.encode(message.includeReplicas, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.excludeReplicas != null && Object.hasOwnProperty.call(message, "excludeReplicas")) - $root.google.spanner.v1.DirectedReadOptions.ExcludeReplicas.encode(message.excludeReplicas, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified DirectedReadOptions message, length delimited. Does not implicitly {@link google.spanner.v1.DirectedReadOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.DirectedReadOptions - * @static - * @param {google.spanner.v1.IDirectedReadOptions} message DirectedReadOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DirectedReadOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DirectedReadOptions message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.DirectedReadOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.DirectedReadOptions} DirectedReadOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DirectedReadOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.DirectedReadOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.includeReplicas = $root.google.spanner.v1.DirectedReadOptions.IncludeReplicas.decode(reader, reader.uint32()); - break; - } - case 2: { - message.excludeReplicas = $root.google.spanner.v1.DirectedReadOptions.ExcludeReplicas.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DirectedReadOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.DirectedReadOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.DirectedReadOptions} DirectedReadOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DirectedReadOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DirectedReadOptions message. - * @function verify - * @memberof google.spanner.v1.DirectedReadOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DirectedReadOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.includeReplicas != null && message.hasOwnProperty("includeReplicas")) { - properties.replicas = 1; - { - var error = $root.google.spanner.v1.DirectedReadOptions.IncludeReplicas.verify(message.includeReplicas); - if (error) - return "includeReplicas." + error; - } - } - if (message.excludeReplicas != null && message.hasOwnProperty("excludeReplicas")) { - if (properties.replicas === 1) - return "replicas: multiple values"; - properties.replicas = 1; - { - var error = $root.google.spanner.v1.DirectedReadOptions.ExcludeReplicas.verify(message.excludeReplicas); - if (error) - return "excludeReplicas." + error; - } - } - return null; - }; - - /** - * Creates a DirectedReadOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.DirectedReadOptions - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.DirectedReadOptions} DirectedReadOptions - */ - DirectedReadOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.DirectedReadOptions) - return object; - var message = new $root.google.spanner.v1.DirectedReadOptions(); - if (object.includeReplicas != null) { - if (typeof object.includeReplicas !== "object") - throw TypeError(".google.spanner.v1.DirectedReadOptions.includeReplicas: object expected"); - message.includeReplicas = $root.google.spanner.v1.DirectedReadOptions.IncludeReplicas.fromObject(object.includeReplicas); - } - if (object.excludeReplicas != null) { - if (typeof object.excludeReplicas !== "object") - throw TypeError(".google.spanner.v1.DirectedReadOptions.excludeReplicas: object expected"); - message.excludeReplicas = $root.google.spanner.v1.DirectedReadOptions.ExcludeReplicas.fromObject(object.excludeReplicas); - } - return message; - }; - - /** - * Creates a plain object from a DirectedReadOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.DirectedReadOptions - * @static - * @param {google.spanner.v1.DirectedReadOptions} message DirectedReadOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DirectedReadOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.includeReplicas != null && message.hasOwnProperty("includeReplicas")) { - object.includeReplicas = $root.google.spanner.v1.DirectedReadOptions.IncludeReplicas.toObject(message.includeReplicas, options); - if (options.oneofs) - object.replicas = "includeReplicas"; - } - if (message.excludeReplicas != null && message.hasOwnProperty("excludeReplicas")) { - object.excludeReplicas = $root.google.spanner.v1.DirectedReadOptions.ExcludeReplicas.toObject(message.excludeReplicas, options); - if (options.oneofs) - object.replicas = "excludeReplicas"; - } - return object; - }; - - /** - * Converts this DirectedReadOptions to JSON. - * @function toJSON - * @memberof google.spanner.v1.DirectedReadOptions - * @instance - * @returns {Object.} JSON object - */ - DirectedReadOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DirectedReadOptions - * @function getTypeUrl - * @memberof google.spanner.v1.DirectedReadOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DirectedReadOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.DirectedReadOptions"; - }; - - DirectedReadOptions.ReplicaSelection = (function() { - - /** - * Properties of a ReplicaSelection. - * @memberof google.spanner.v1.DirectedReadOptions - * @interface IReplicaSelection - * @property {string|null} [location] ReplicaSelection location - * @property {google.spanner.v1.DirectedReadOptions.ReplicaSelection.Type|null} [type] ReplicaSelection type - */ - - /** - * Constructs a new ReplicaSelection. - * @memberof google.spanner.v1.DirectedReadOptions - * @classdesc Represents a ReplicaSelection. - * @implements IReplicaSelection - * @constructor - * @param {google.spanner.v1.DirectedReadOptions.IReplicaSelection=} [properties] Properties to set - */ - function ReplicaSelection(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ReplicaSelection location. - * @member {string} location - * @memberof google.spanner.v1.DirectedReadOptions.ReplicaSelection - * @instance - */ - ReplicaSelection.prototype.location = ""; - - /** - * ReplicaSelection type. - * @member {google.spanner.v1.DirectedReadOptions.ReplicaSelection.Type} type - * @memberof google.spanner.v1.DirectedReadOptions.ReplicaSelection - * @instance - */ - ReplicaSelection.prototype.type = 0; - - /** - * Creates a new ReplicaSelection instance using the specified properties. - * @function create - * @memberof google.spanner.v1.DirectedReadOptions.ReplicaSelection - * @static - * @param {google.spanner.v1.DirectedReadOptions.IReplicaSelection=} [properties] Properties to set - * @returns {google.spanner.v1.DirectedReadOptions.ReplicaSelection} ReplicaSelection instance - */ - ReplicaSelection.create = function create(properties) { - return new ReplicaSelection(properties); - }; - - /** - * Encodes the specified ReplicaSelection message. Does not implicitly {@link google.spanner.v1.DirectedReadOptions.ReplicaSelection.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.DirectedReadOptions.ReplicaSelection - * @static - * @param {google.spanner.v1.DirectedReadOptions.IReplicaSelection} message ReplicaSelection message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReplicaSelection.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.location != null && Object.hasOwnProperty.call(message, "location")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.location); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.type); - return writer; - }; - - /** - * Encodes the specified ReplicaSelection message, length delimited. Does not implicitly {@link google.spanner.v1.DirectedReadOptions.ReplicaSelection.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.DirectedReadOptions.ReplicaSelection - * @static - * @param {google.spanner.v1.DirectedReadOptions.IReplicaSelection} message ReplicaSelection message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReplicaSelection.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ReplicaSelection message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.DirectedReadOptions.ReplicaSelection - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.DirectedReadOptions.ReplicaSelection} ReplicaSelection - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReplicaSelection.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.DirectedReadOptions.ReplicaSelection(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.location = reader.string(); - break; - } - case 2: { - message.type = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ReplicaSelection message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.DirectedReadOptions.ReplicaSelection - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.DirectedReadOptions.ReplicaSelection} ReplicaSelection - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReplicaSelection.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ReplicaSelection message. - * @function verify - * @memberof google.spanner.v1.DirectedReadOptions.ReplicaSelection - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ReplicaSelection.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.location != null && message.hasOwnProperty("location")) - if (!$util.isString(message.location)) - return "location: string expected"; - if (message.type != null && message.hasOwnProperty("type")) - switch (message.type) { - default: - return "type: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a ReplicaSelection message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.DirectedReadOptions.ReplicaSelection - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.DirectedReadOptions.ReplicaSelection} ReplicaSelection - */ - ReplicaSelection.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.DirectedReadOptions.ReplicaSelection) - return object; - var message = new $root.google.spanner.v1.DirectedReadOptions.ReplicaSelection(); - if (object.location != null) - message.location = String(object.location); - switch (object.type) { - default: - if (typeof object.type === "number") { - message.type = object.type; - break; - } - break; - case "TYPE_UNSPECIFIED": - case 0: - message.type = 0; - break; - case "READ_WRITE": - case 1: - message.type = 1; - break; - case "READ_ONLY": - case 2: - message.type = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a ReplicaSelection message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.DirectedReadOptions.ReplicaSelection - * @static - * @param {google.spanner.v1.DirectedReadOptions.ReplicaSelection} message ReplicaSelection - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ReplicaSelection.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.location = ""; - object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; - } - if (message.location != null && message.hasOwnProperty("location")) - object.location = message.location; - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.spanner.v1.DirectedReadOptions.ReplicaSelection.Type[message.type] === undefined ? message.type : $root.google.spanner.v1.DirectedReadOptions.ReplicaSelection.Type[message.type] : message.type; - return object; - }; - - /** - * Converts this ReplicaSelection to JSON. - * @function toJSON - * @memberof google.spanner.v1.DirectedReadOptions.ReplicaSelection - * @instance - * @returns {Object.} JSON object - */ - ReplicaSelection.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ReplicaSelection - * @function getTypeUrl - * @memberof google.spanner.v1.DirectedReadOptions.ReplicaSelection - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ReplicaSelection.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.DirectedReadOptions.ReplicaSelection"; - }; - - /** - * Type enum. - * @name google.spanner.v1.DirectedReadOptions.ReplicaSelection.Type - * @enum {number} - * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value - * @property {number} READ_WRITE=1 READ_WRITE value - * @property {number} READ_ONLY=2 READ_ONLY value - */ - ReplicaSelection.Type = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "READ_WRITE"] = 1; - values[valuesById[2] = "READ_ONLY"] = 2; - return values; - })(); - - return ReplicaSelection; - })(); - - DirectedReadOptions.IncludeReplicas = (function() { - - /** - * Properties of an IncludeReplicas. - * @memberof google.spanner.v1.DirectedReadOptions - * @interface IIncludeReplicas - * @property {Array.|null} [replicaSelections] IncludeReplicas replicaSelections - * @property {boolean|null} [autoFailoverDisabled] IncludeReplicas autoFailoverDisabled - */ - - /** - * Constructs a new IncludeReplicas. - * @memberof google.spanner.v1.DirectedReadOptions - * @classdesc Represents an IncludeReplicas. - * @implements IIncludeReplicas - * @constructor - * @param {google.spanner.v1.DirectedReadOptions.IIncludeReplicas=} [properties] Properties to set - */ - function IncludeReplicas(properties) { - this.replicaSelections = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * IncludeReplicas replicaSelections. - * @member {Array.} replicaSelections - * @memberof google.spanner.v1.DirectedReadOptions.IncludeReplicas - * @instance - */ - IncludeReplicas.prototype.replicaSelections = $util.emptyArray; - - /** - * IncludeReplicas autoFailoverDisabled. - * @member {boolean} autoFailoverDisabled - * @memberof google.spanner.v1.DirectedReadOptions.IncludeReplicas - * @instance - */ - IncludeReplicas.prototype.autoFailoverDisabled = false; - - /** - * Creates a new IncludeReplicas instance using the specified properties. - * @function create - * @memberof google.spanner.v1.DirectedReadOptions.IncludeReplicas - * @static - * @param {google.spanner.v1.DirectedReadOptions.IIncludeReplicas=} [properties] Properties to set - * @returns {google.spanner.v1.DirectedReadOptions.IncludeReplicas} IncludeReplicas instance - */ - IncludeReplicas.create = function create(properties) { - return new IncludeReplicas(properties); - }; - - /** - * Encodes the specified IncludeReplicas message. Does not implicitly {@link google.spanner.v1.DirectedReadOptions.IncludeReplicas.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.DirectedReadOptions.IncludeReplicas - * @static - * @param {google.spanner.v1.DirectedReadOptions.IIncludeReplicas} message IncludeReplicas message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IncludeReplicas.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.replicaSelections != null && message.replicaSelections.length) - for (var i = 0; i < message.replicaSelections.length; ++i) - $root.google.spanner.v1.DirectedReadOptions.ReplicaSelection.encode(message.replicaSelections[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.autoFailoverDisabled != null && Object.hasOwnProperty.call(message, "autoFailoverDisabled")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.autoFailoverDisabled); - return writer; - }; - - /** - * Encodes the specified IncludeReplicas message, length delimited. Does not implicitly {@link google.spanner.v1.DirectedReadOptions.IncludeReplicas.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.DirectedReadOptions.IncludeReplicas - * @static - * @param {google.spanner.v1.DirectedReadOptions.IIncludeReplicas} message IncludeReplicas message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IncludeReplicas.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an IncludeReplicas message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.DirectedReadOptions.IncludeReplicas - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.DirectedReadOptions.IncludeReplicas} IncludeReplicas - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IncludeReplicas.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.DirectedReadOptions.IncludeReplicas(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.replicaSelections && message.replicaSelections.length)) - message.replicaSelections = []; - message.replicaSelections.push($root.google.spanner.v1.DirectedReadOptions.ReplicaSelection.decode(reader, reader.uint32())); - break; - } - case 2: { - message.autoFailoverDisabled = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an IncludeReplicas message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.DirectedReadOptions.IncludeReplicas - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.DirectedReadOptions.IncludeReplicas} IncludeReplicas - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IncludeReplicas.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an IncludeReplicas message. - * @function verify - * @memberof google.spanner.v1.DirectedReadOptions.IncludeReplicas - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - IncludeReplicas.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.replicaSelections != null && message.hasOwnProperty("replicaSelections")) { - if (!Array.isArray(message.replicaSelections)) - return "replicaSelections: array expected"; - for (var i = 0; i < message.replicaSelections.length; ++i) { - var error = $root.google.spanner.v1.DirectedReadOptions.ReplicaSelection.verify(message.replicaSelections[i]); - if (error) - return "replicaSelections." + error; - } - } - if (message.autoFailoverDisabled != null && message.hasOwnProperty("autoFailoverDisabled")) - if (typeof message.autoFailoverDisabled !== "boolean") - return "autoFailoverDisabled: boolean expected"; - return null; - }; - - /** - * Creates an IncludeReplicas message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.DirectedReadOptions.IncludeReplicas - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.DirectedReadOptions.IncludeReplicas} IncludeReplicas - */ - IncludeReplicas.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.DirectedReadOptions.IncludeReplicas) - return object; - var message = new $root.google.spanner.v1.DirectedReadOptions.IncludeReplicas(); - if (object.replicaSelections) { - if (!Array.isArray(object.replicaSelections)) - throw TypeError(".google.spanner.v1.DirectedReadOptions.IncludeReplicas.replicaSelections: array expected"); - message.replicaSelections = []; - for (var i = 0; i < object.replicaSelections.length; ++i) { - if (typeof object.replicaSelections[i] !== "object") - throw TypeError(".google.spanner.v1.DirectedReadOptions.IncludeReplicas.replicaSelections: object expected"); - message.replicaSelections[i] = $root.google.spanner.v1.DirectedReadOptions.ReplicaSelection.fromObject(object.replicaSelections[i]); - } - } - if (object.autoFailoverDisabled != null) - message.autoFailoverDisabled = Boolean(object.autoFailoverDisabled); - return message; - }; - - /** - * Creates a plain object from an IncludeReplicas message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.DirectedReadOptions.IncludeReplicas - * @static - * @param {google.spanner.v1.DirectedReadOptions.IncludeReplicas} message IncludeReplicas - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - IncludeReplicas.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.replicaSelections = []; - if (options.defaults) - object.autoFailoverDisabled = false; - if (message.replicaSelections && message.replicaSelections.length) { - object.replicaSelections = []; - for (var j = 0; j < message.replicaSelections.length; ++j) - object.replicaSelections[j] = $root.google.spanner.v1.DirectedReadOptions.ReplicaSelection.toObject(message.replicaSelections[j], options); - } - if (message.autoFailoverDisabled != null && message.hasOwnProperty("autoFailoverDisabled")) - object.autoFailoverDisabled = message.autoFailoverDisabled; - return object; - }; - - /** - * Converts this IncludeReplicas to JSON. - * @function toJSON - * @memberof google.spanner.v1.DirectedReadOptions.IncludeReplicas - * @instance - * @returns {Object.} JSON object - */ - IncludeReplicas.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for IncludeReplicas - * @function getTypeUrl - * @memberof google.spanner.v1.DirectedReadOptions.IncludeReplicas - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - IncludeReplicas.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.DirectedReadOptions.IncludeReplicas"; - }; - - return IncludeReplicas; - })(); - - DirectedReadOptions.ExcludeReplicas = (function() { - - /** - * Properties of an ExcludeReplicas. - * @memberof google.spanner.v1.DirectedReadOptions - * @interface IExcludeReplicas - * @property {Array.|null} [replicaSelections] ExcludeReplicas replicaSelections - */ - - /** - * Constructs a new ExcludeReplicas. - * @memberof google.spanner.v1.DirectedReadOptions - * @classdesc Represents an ExcludeReplicas. - * @implements IExcludeReplicas - * @constructor - * @param {google.spanner.v1.DirectedReadOptions.IExcludeReplicas=} [properties] Properties to set - */ - function ExcludeReplicas(properties) { - this.replicaSelections = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExcludeReplicas replicaSelections. - * @member {Array.} replicaSelections - * @memberof google.spanner.v1.DirectedReadOptions.ExcludeReplicas - * @instance - */ - ExcludeReplicas.prototype.replicaSelections = $util.emptyArray; - - /** - * Creates a new ExcludeReplicas instance using the specified properties. - * @function create - * @memberof google.spanner.v1.DirectedReadOptions.ExcludeReplicas - * @static - * @param {google.spanner.v1.DirectedReadOptions.IExcludeReplicas=} [properties] Properties to set - * @returns {google.spanner.v1.DirectedReadOptions.ExcludeReplicas} ExcludeReplicas instance - */ - ExcludeReplicas.create = function create(properties) { - return new ExcludeReplicas(properties); - }; - - /** - * Encodes the specified ExcludeReplicas message. Does not implicitly {@link google.spanner.v1.DirectedReadOptions.ExcludeReplicas.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.DirectedReadOptions.ExcludeReplicas - * @static - * @param {google.spanner.v1.DirectedReadOptions.IExcludeReplicas} message ExcludeReplicas message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExcludeReplicas.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.replicaSelections != null && message.replicaSelections.length) - for (var i = 0; i < message.replicaSelections.length; ++i) - $root.google.spanner.v1.DirectedReadOptions.ReplicaSelection.encode(message.replicaSelections[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ExcludeReplicas message, length delimited. Does not implicitly {@link google.spanner.v1.DirectedReadOptions.ExcludeReplicas.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.DirectedReadOptions.ExcludeReplicas - * @static - * @param {google.spanner.v1.DirectedReadOptions.IExcludeReplicas} message ExcludeReplicas message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExcludeReplicas.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExcludeReplicas message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.DirectedReadOptions.ExcludeReplicas - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.DirectedReadOptions.ExcludeReplicas} ExcludeReplicas - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExcludeReplicas.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.DirectedReadOptions.ExcludeReplicas(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.replicaSelections && message.replicaSelections.length)) - message.replicaSelections = []; - message.replicaSelections.push($root.google.spanner.v1.DirectedReadOptions.ReplicaSelection.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExcludeReplicas message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.DirectedReadOptions.ExcludeReplicas - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.DirectedReadOptions.ExcludeReplicas} ExcludeReplicas - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExcludeReplicas.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExcludeReplicas message. - * @function verify - * @memberof google.spanner.v1.DirectedReadOptions.ExcludeReplicas - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExcludeReplicas.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.replicaSelections != null && message.hasOwnProperty("replicaSelections")) { - if (!Array.isArray(message.replicaSelections)) - return "replicaSelections: array expected"; - for (var i = 0; i < message.replicaSelections.length; ++i) { - var error = $root.google.spanner.v1.DirectedReadOptions.ReplicaSelection.verify(message.replicaSelections[i]); - if (error) - return "replicaSelections." + error; - } - } - return null; - }; - - /** - * Creates an ExcludeReplicas message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.DirectedReadOptions.ExcludeReplicas - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.DirectedReadOptions.ExcludeReplicas} ExcludeReplicas - */ - ExcludeReplicas.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.DirectedReadOptions.ExcludeReplicas) - return object; - var message = new $root.google.spanner.v1.DirectedReadOptions.ExcludeReplicas(); - if (object.replicaSelections) { - if (!Array.isArray(object.replicaSelections)) - throw TypeError(".google.spanner.v1.DirectedReadOptions.ExcludeReplicas.replicaSelections: array expected"); - message.replicaSelections = []; - for (var i = 0; i < object.replicaSelections.length; ++i) { - if (typeof object.replicaSelections[i] !== "object") - throw TypeError(".google.spanner.v1.DirectedReadOptions.ExcludeReplicas.replicaSelections: object expected"); - message.replicaSelections[i] = $root.google.spanner.v1.DirectedReadOptions.ReplicaSelection.fromObject(object.replicaSelections[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an ExcludeReplicas message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.DirectedReadOptions.ExcludeReplicas - * @static - * @param {google.spanner.v1.DirectedReadOptions.ExcludeReplicas} message ExcludeReplicas - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExcludeReplicas.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.replicaSelections = []; - if (message.replicaSelections && message.replicaSelections.length) { - object.replicaSelections = []; - for (var j = 0; j < message.replicaSelections.length; ++j) - object.replicaSelections[j] = $root.google.spanner.v1.DirectedReadOptions.ReplicaSelection.toObject(message.replicaSelections[j], options); - } - return object; - }; - - /** - * Converts this ExcludeReplicas to JSON. - * @function toJSON - * @memberof google.spanner.v1.DirectedReadOptions.ExcludeReplicas - * @instance - * @returns {Object.} JSON object - */ - ExcludeReplicas.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExcludeReplicas - * @function getTypeUrl - * @memberof google.spanner.v1.DirectedReadOptions.ExcludeReplicas - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExcludeReplicas.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.DirectedReadOptions.ExcludeReplicas"; - }; - - return ExcludeReplicas; - })(); - - return DirectedReadOptions; - })(); - - v1.ExecuteSqlRequest = (function() { - - /** - * Properties of an ExecuteSqlRequest. - * @memberof google.spanner.v1 - * @interface IExecuteSqlRequest - * @property {string|null} [session] ExecuteSqlRequest session - * @property {google.spanner.v1.ITransactionSelector|null} [transaction] ExecuteSqlRequest transaction - * @property {string|null} [sql] ExecuteSqlRequest sql - * @property {google.protobuf.IStruct|null} [params] ExecuteSqlRequest params - * @property {Object.|null} [paramTypes] ExecuteSqlRequest paramTypes - * @property {Uint8Array|null} [resumeToken] ExecuteSqlRequest resumeToken - * @property {google.spanner.v1.ExecuteSqlRequest.QueryMode|null} [queryMode] ExecuteSqlRequest queryMode - * @property {Uint8Array|null} [partitionToken] ExecuteSqlRequest partitionToken - * @property {number|Long|null} [seqno] ExecuteSqlRequest seqno - * @property {google.spanner.v1.ExecuteSqlRequest.IQueryOptions|null} [queryOptions] ExecuteSqlRequest queryOptions - * @property {google.spanner.v1.IRequestOptions|null} [requestOptions] ExecuteSqlRequest requestOptions - * @property {google.spanner.v1.IDirectedReadOptions|null} [directedReadOptions] ExecuteSqlRequest directedReadOptions - * @property {boolean|null} [dataBoostEnabled] ExecuteSqlRequest dataBoostEnabled - * @property {boolean|null} [lastStatement] ExecuteSqlRequest lastStatement - * @property {google.spanner.v1.IRoutingHint|null} [routingHint] ExecuteSqlRequest routingHint - */ - - /** - * Constructs a new ExecuteSqlRequest. - * @memberof google.spanner.v1 - * @classdesc Represents an ExecuteSqlRequest. - * @implements IExecuteSqlRequest - * @constructor - * @param {google.spanner.v1.IExecuteSqlRequest=} [properties] Properties to set - */ - function ExecuteSqlRequest(properties) { - this.paramTypes = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExecuteSqlRequest session. - * @member {string} session - * @memberof google.spanner.v1.ExecuteSqlRequest - * @instance - */ - ExecuteSqlRequest.prototype.session = ""; - - /** - * ExecuteSqlRequest transaction. - * @member {google.spanner.v1.ITransactionSelector|null|undefined} transaction - * @memberof google.spanner.v1.ExecuteSqlRequest - * @instance - */ - ExecuteSqlRequest.prototype.transaction = null; - - /** - * ExecuteSqlRequest sql. - * @member {string} sql - * @memberof google.spanner.v1.ExecuteSqlRequest - * @instance - */ - ExecuteSqlRequest.prototype.sql = ""; - - /** - * ExecuteSqlRequest params. - * @member {google.protobuf.IStruct|null|undefined} params - * @memberof google.spanner.v1.ExecuteSqlRequest - * @instance - */ - ExecuteSqlRequest.prototype.params = null; - - /** - * ExecuteSqlRequest paramTypes. - * @member {Object.} paramTypes - * @memberof google.spanner.v1.ExecuteSqlRequest - * @instance - */ - ExecuteSqlRequest.prototype.paramTypes = $util.emptyObject; - - /** - * ExecuteSqlRequest resumeToken. - * @member {Uint8Array} resumeToken - * @memberof google.spanner.v1.ExecuteSqlRequest - * @instance - */ - ExecuteSqlRequest.prototype.resumeToken = $util.newBuffer([]); - - /** - * ExecuteSqlRequest queryMode. - * @member {google.spanner.v1.ExecuteSqlRequest.QueryMode} queryMode - * @memberof google.spanner.v1.ExecuteSqlRequest - * @instance - */ - ExecuteSqlRequest.prototype.queryMode = 0; - - /** - * ExecuteSqlRequest partitionToken. - * @member {Uint8Array} partitionToken - * @memberof google.spanner.v1.ExecuteSqlRequest - * @instance - */ - ExecuteSqlRequest.prototype.partitionToken = $util.newBuffer([]); - - /** - * ExecuteSqlRequest seqno. - * @member {number|Long} seqno - * @memberof google.spanner.v1.ExecuteSqlRequest - * @instance - */ - ExecuteSqlRequest.prototype.seqno = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * ExecuteSqlRequest queryOptions. - * @member {google.spanner.v1.ExecuteSqlRequest.IQueryOptions|null|undefined} queryOptions - * @memberof google.spanner.v1.ExecuteSqlRequest - * @instance - */ - ExecuteSqlRequest.prototype.queryOptions = null; - - /** - * ExecuteSqlRequest requestOptions. - * @member {google.spanner.v1.IRequestOptions|null|undefined} requestOptions - * @memberof google.spanner.v1.ExecuteSqlRequest - * @instance - */ - ExecuteSqlRequest.prototype.requestOptions = null; - - /** - * ExecuteSqlRequest directedReadOptions. - * @member {google.spanner.v1.IDirectedReadOptions|null|undefined} directedReadOptions - * @memberof google.spanner.v1.ExecuteSqlRequest - * @instance - */ - ExecuteSqlRequest.prototype.directedReadOptions = null; - - /** - * ExecuteSqlRequest dataBoostEnabled. - * @member {boolean} dataBoostEnabled - * @memberof google.spanner.v1.ExecuteSqlRequest - * @instance - */ - ExecuteSqlRequest.prototype.dataBoostEnabled = false; - - /** - * ExecuteSqlRequest lastStatement. - * @member {boolean} lastStatement - * @memberof google.spanner.v1.ExecuteSqlRequest - * @instance - */ - ExecuteSqlRequest.prototype.lastStatement = false; - - /** - * ExecuteSqlRequest routingHint. - * @member {google.spanner.v1.IRoutingHint|null|undefined} routingHint - * @memberof google.spanner.v1.ExecuteSqlRequest - * @instance - */ - ExecuteSqlRequest.prototype.routingHint = null; - - /** - * Creates a new ExecuteSqlRequest instance using the specified properties. - * @function create - * @memberof google.spanner.v1.ExecuteSqlRequest - * @static - * @param {google.spanner.v1.IExecuteSqlRequest=} [properties] Properties to set - * @returns {google.spanner.v1.ExecuteSqlRequest} ExecuteSqlRequest instance - */ - ExecuteSqlRequest.create = function create(properties) { - return new ExecuteSqlRequest(properties); - }; - - /** - * Encodes the specified ExecuteSqlRequest message. Does not implicitly {@link google.spanner.v1.ExecuteSqlRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.ExecuteSqlRequest - * @static - * @param {google.spanner.v1.IExecuteSqlRequest} message ExecuteSqlRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExecuteSqlRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.session != null && Object.hasOwnProperty.call(message, "session")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.session); - if (message.transaction != null && Object.hasOwnProperty.call(message, "transaction")) - $root.google.spanner.v1.TransactionSelector.encode(message.transaction, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.sql != null && Object.hasOwnProperty.call(message, "sql")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.sql); - if (message.params != null && Object.hasOwnProperty.call(message, "params")) - $root.google.protobuf.Struct.encode(message.params, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.paramTypes != null && Object.hasOwnProperty.call(message, "paramTypes")) - for (var keys = Object.keys(message.paramTypes), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.spanner.v1.Type.encode(message.paramTypes[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - if (message.resumeToken != null && Object.hasOwnProperty.call(message, "resumeToken")) - writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.resumeToken); - if (message.queryMode != null && Object.hasOwnProperty.call(message, "queryMode")) - writer.uint32(/* id 7, wireType 0 =*/56).int32(message.queryMode); - if (message.partitionToken != null && Object.hasOwnProperty.call(message, "partitionToken")) - writer.uint32(/* id 8, wireType 2 =*/66).bytes(message.partitionToken); - if (message.seqno != null && Object.hasOwnProperty.call(message, "seqno")) - writer.uint32(/* id 9, wireType 0 =*/72).int64(message.seqno); - if (message.queryOptions != null && Object.hasOwnProperty.call(message, "queryOptions")) - $root.google.spanner.v1.ExecuteSqlRequest.QueryOptions.encode(message.queryOptions, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.requestOptions != null && Object.hasOwnProperty.call(message, "requestOptions")) - $root.google.spanner.v1.RequestOptions.encode(message.requestOptions, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.directedReadOptions != null && Object.hasOwnProperty.call(message, "directedReadOptions")) - $root.google.spanner.v1.DirectedReadOptions.encode(message.directedReadOptions, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); - if (message.dataBoostEnabled != null && Object.hasOwnProperty.call(message, "dataBoostEnabled")) - writer.uint32(/* id 16, wireType 0 =*/128).bool(message.dataBoostEnabled); - if (message.lastStatement != null && Object.hasOwnProperty.call(message, "lastStatement")) - writer.uint32(/* id 17, wireType 0 =*/136).bool(message.lastStatement); - if (message.routingHint != null && Object.hasOwnProperty.call(message, "routingHint")) - $root.google.spanner.v1.RoutingHint.encode(message.routingHint, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ExecuteSqlRequest message, length delimited. Does not implicitly {@link google.spanner.v1.ExecuteSqlRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.ExecuteSqlRequest - * @static - * @param {google.spanner.v1.IExecuteSqlRequest} message ExecuteSqlRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExecuteSqlRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExecuteSqlRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.ExecuteSqlRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.ExecuteSqlRequest} ExecuteSqlRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExecuteSqlRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.ExecuteSqlRequest(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.session = reader.string(); - break; - } - case 2: { - message.transaction = $root.google.spanner.v1.TransactionSelector.decode(reader, reader.uint32()); - break; - } - case 3: { - message.sql = reader.string(); - break; - } - case 4: { - message.params = $root.google.protobuf.Struct.decode(reader, reader.uint32()); - break; - } - case 5: { - if (message.paramTypes === $util.emptyObject) - message.paramTypes = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = null; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = $root.google.spanner.v1.Type.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.paramTypes[key] = value; - break; - } - case 6: { - message.resumeToken = reader.bytes(); - break; - } - case 7: { - message.queryMode = reader.int32(); - break; - } - case 8: { - message.partitionToken = reader.bytes(); - break; - } - case 9: { - message.seqno = reader.int64(); - break; - } - case 10: { - message.queryOptions = $root.google.spanner.v1.ExecuteSqlRequest.QueryOptions.decode(reader, reader.uint32()); - break; - } - case 11: { - message.requestOptions = $root.google.spanner.v1.RequestOptions.decode(reader, reader.uint32()); - break; - } - case 15: { - message.directedReadOptions = $root.google.spanner.v1.DirectedReadOptions.decode(reader, reader.uint32()); - break; - } - case 16: { - message.dataBoostEnabled = reader.bool(); - break; - } - case 17: { - message.lastStatement = reader.bool(); - break; - } - case 18: { - message.routingHint = $root.google.spanner.v1.RoutingHint.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExecuteSqlRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.ExecuteSqlRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.ExecuteSqlRequest} ExecuteSqlRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExecuteSqlRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExecuteSqlRequest message. - * @function verify - * @memberof google.spanner.v1.ExecuteSqlRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExecuteSqlRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.session != null && message.hasOwnProperty("session")) - if (!$util.isString(message.session)) - return "session: string expected"; - if (message.transaction != null && message.hasOwnProperty("transaction")) { - var error = $root.google.spanner.v1.TransactionSelector.verify(message.transaction); - if (error) - return "transaction." + error; - } - if (message.sql != null && message.hasOwnProperty("sql")) - if (!$util.isString(message.sql)) - return "sql: string expected"; - if (message.params != null && message.hasOwnProperty("params")) { - var error = $root.google.protobuf.Struct.verify(message.params); - if (error) - return "params." + error; - } - if (message.paramTypes != null && message.hasOwnProperty("paramTypes")) { - if (!$util.isObject(message.paramTypes)) - return "paramTypes: object expected"; - var key = Object.keys(message.paramTypes); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.spanner.v1.Type.verify(message.paramTypes[key[i]]); - if (error) - return "paramTypes." + error; - } - } - if (message.resumeToken != null && message.hasOwnProperty("resumeToken")) - if (!(message.resumeToken && typeof message.resumeToken.length === "number" || $util.isString(message.resumeToken))) - return "resumeToken: buffer expected"; - if (message.queryMode != null && message.hasOwnProperty("queryMode")) - switch (message.queryMode) { - default: - return "queryMode: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - if (message.partitionToken != null && message.hasOwnProperty("partitionToken")) - if (!(message.partitionToken && typeof message.partitionToken.length === "number" || $util.isString(message.partitionToken))) - return "partitionToken: buffer expected"; - if (message.seqno != null && message.hasOwnProperty("seqno")) - if (!$util.isInteger(message.seqno) && !(message.seqno && $util.isInteger(message.seqno.low) && $util.isInteger(message.seqno.high))) - return "seqno: integer|Long expected"; - if (message.queryOptions != null && message.hasOwnProperty("queryOptions")) { - var error = $root.google.spanner.v1.ExecuteSqlRequest.QueryOptions.verify(message.queryOptions); - if (error) - return "queryOptions." + error; - } - if (message.requestOptions != null && message.hasOwnProperty("requestOptions")) { - var error = $root.google.spanner.v1.RequestOptions.verify(message.requestOptions); - if (error) - return "requestOptions." + error; - } - if (message.directedReadOptions != null && message.hasOwnProperty("directedReadOptions")) { - var error = $root.google.spanner.v1.DirectedReadOptions.verify(message.directedReadOptions); - if (error) - return "directedReadOptions." + error; - } - if (message.dataBoostEnabled != null && message.hasOwnProperty("dataBoostEnabled")) - if (typeof message.dataBoostEnabled !== "boolean") - return "dataBoostEnabled: boolean expected"; - if (message.lastStatement != null && message.hasOwnProperty("lastStatement")) - if (typeof message.lastStatement !== "boolean") - return "lastStatement: boolean expected"; - if (message.routingHint != null && message.hasOwnProperty("routingHint")) { - var error = $root.google.spanner.v1.RoutingHint.verify(message.routingHint); - if (error) - return "routingHint." + error; - } - return null; - }; - - /** - * Creates an ExecuteSqlRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.ExecuteSqlRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.ExecuteSqlRequest} ExecuteSqlRequest - */ - ExecuteSqlRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.ExecuteSqlRequest) - return object; - var message = new $root.google.spanner.v1.ExecuteSqlRequest(); - if (object.session != null) - message.session = String(object.session); - if (object.transaction != null) { - if (typeof object.transaction !== "object") - throw TypeError(".google.spanner.v1.ExecuteSqlRequest.transaction: object expected"); - message.transaction = $root.google.spanner.v1.TransactionSelector.fromObject(object.transaction); - } - if (object.sql != null) - message.sql = String(object.sql); - if (object.params != null) { - if (typeof object.params !== "object") - throw TypeError(".google.spanner.v1.ExecuteSqlRequest.params: object expected"); - message.params = $root.google.protobuf.Struct.fromObject(object.params); - } - if (object.paramTypes) { - if (typeof object.paramTypes !== "object") - throw TypeError(".google.spanner.v1.ExecuteSqlRequest.paramTypes: object expected"); - message.paramTypes = {}; - for (var keys = Object.keys(object.paramTypes), i = 0; i < keys.length; ++i) { - if (typeof object.paramTypes[keys[i]] !== "object") - throw TypeError(".google.spanner.v1.ExecuteSqlRequest.paramTypes: object expected"); - message.paramTypes[keys[i]] = $root.google.spanner.v1.Type.fromObject(object.paramTypes[keys[i]]); - } - } - if (object.resumeToken != null) - if (typeof object.resumeToken === "string") - $util.base64.decode(object.resumeToken, message.resumeToken = $util.newBuffer($util.base64.length(object.resumeToken)), 0); - else if (object.resumeToken.length >= 0) - message.resumeToken = object.resumeToken; - switch (object.queryMode) { - default: - if (typeof object.queryMode === "number") { - message.queryMode = object.queryMode; - break; - } - break; - case "NORMAL": - case 0: - message.queryMode = 0; - break; - case "PLAN": - case 1: - message.queryMode = 1; - break; - case "PROFILE": - case 2: - message.queryMode = 2; - break; - case "WITH_STATS": - case 3: - message.queryMode = 3; - break; - case "WITH_PLAN_AND_STATS": - case 4: - message.queryMode = 4; - break; - } - if (object.partitionToken != null) - if (typeof object.partitionToken === "string") - $util.base64.decode(object.partitionToken, message.partitionToken = $util.newBuffer($util.base64.length(object.partitionToken)), 0); - else if (object.partitionToken.length >= 0) - message.partitionToken = object.partitionToken; - if (object.seqno != null) - if ($util.Long) - (message.seqno = $util.Long.fromValue(object.seqno)).unsigned = false; - else if (typeof object.seqno === "string") - message.seqno = parseInt(object.seqno, 10); - else if (typeof object.seqno === "number") - message.seqno = object.seqno; - else if (typeof object.seqno === "object") - message.seqno = new $util.LongBits(object.seqno.low >>> 0, object.seqno.high >>> 0).toNumber(); - if (object.queryOptions != null) { - if (typeof object.queryOptions !== "object") - throw TypeError(".google.spanner.v1.ExecuteSqlRequest.queryOptions: object expected"); - message.queryOptions = $root.google.spanner.v1.ExecuteSqlRequest.QueryOptions.fromObject(object.queryOptions); - } - if (object.requestOptions != null) { - if (typeof object.requestOptions !== "object") - throw TypeError(".google.spanner.v1.ExecuteSqlRequest.requestOptions: object expected"); - message.requestOptions = $root.google.spanner.v1.RequestOptions.fromObject(object.requestOptions); - } - if (object.directedReadOptions != null) { - if (typeof object.directedReadOptions !== "object") - throw TypeError(".google.spanner.v1.ExecuteSqlRequest.directedReadOptions: object expected"); - message.directedReadOptions = $root.google.spanner.v1.DirectedReadOptions.fromObject(object.directedReadOptions); - } - if (object.dataBoostEnabled != null) - message.dataBoostEnabled = Boolean(object.dataBoostEnabled); - if (object.lastStatement != null) - message.lastStatement = Boolean(object.lastStatement); - if (object.routingHint != null) { - if (typeof object.routingHint !== "object") - throw TypeError(".google.spanner.v1.ExecuteSqlRequest.routingHint: object expected"); - message.routingHint = $root.google.spanner.v1.RoutingHint.fromObject(object.routingHint); - } - return message; - }; - - /** - * Creates a plain object from an ExecuteSqlRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.ExecuteSqlRequest - * @static - * @param {google.spanner.v1.ExecuteSqlRequest} message ExecuteSqlRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExecuteSqlRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.paramTypes = {}; - if (options.defaults) { - object.session = ""; - object.transaction = null; - object.sql = ""; - object.params = null; - if (options.bytes === String) - object.resumeToken = ""; - else { - object.resumeToken = []; - if (options.bytes !== Array) - object.resumeToken = $util.newBuffer(object.resumeToken); - } - object.queryMode = options.enums === String ? "NORMAL" : 0; - if (options.bytes === String) - object.partitionToken = ""; - else { - object.partitionToken = []; - if (options.bytes !== Array) - object.partitionToken = $util.newBuffer(object.partitionToken); - } - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.seqno = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.seqno = options.longs === String ? "0" : 0; - object.queryOptions = null; - object.requestOptions = null; - object.directedReadOptions = null; - object.dataBoostEnabled = false; - object.lastStatement = false; - object.routingHint = null; - } - if (message.session != null && message.hasOwnProperty("session")) - object.session = message.session; - if (message.transaction != null && message.hasOwnProperty("transaction")) - object.transaction = $root.google.spanner.v1.TransactionSelector.toObject(message.transaction, options); - if (message.sql != null && message.hasOwnProperty("sql")) - object.sql = message.sql; - if (message.params != null && message.hasOwnProperty("params")) - object.params = $root.google.protobuf.Struct.toObject(message.params, options); - var keys2; - if (message.paramTypes && (keys2 = Object.keys(message.paramTypes)).length) { - object.paramTypes = {}; - for (var j = 0; j < keys2.length; ++j) - object.paramTypes[keys2[j]] = $root.google.spanner.v1.Type.toObject(message.paramTypes[keys2[j]], options); - } - if (message.resumeToken != null && message.hasOwnProperty("resumeToken")) - object.resumeToken = options.bytes === String ? $util.base64.encode(message.resumeToken, 0, message.resumeToken.length) : options.bytes === Array ? Array.prototype.slice.call(message.resumeToken) : message.resumeToken; - if (message.queryMode != null && message.hasOwnProperty("queryMode")) - object.queryMode = options.enums === String ? $root.google.spanner.v1.ExecuteSqlRequest.QueryMode[message.queryMode] === undefined ? message.queryMode : $root.google.spanner.v1.ExecuteSqlRequest.QueryMode[message.queryMode] : message.queryMode; - if (message.partitionToken != null && message.hasOwnProperty("partitionToken")) - object.partitionToken = options.bytes === String ? $util.base64.encode(message.partitionToken, 0, message.partitionToken.length) : options.bytes === Array ? Array.prototype.slice.call(message.partitionToken) : message.partitionToken; - if (message.seqno != null && message.hasOwnProperty("seqno")) - if (typeof message.seqno === "number") - object.seqno = options.longs === String ? String(message.seqno) : message.seqno; - else - object.seqno = options.longs === String ? $util.Long.prototype.toString.call(message.seqno) : options.longs === Number ? new $util.LongBits(message.seqno.low >>> 0, message.seqno.high >>> 0).toNumber() : message.seqno; - if (message.queryOptions != null && message.hasOwnProperty("queryOptions")) - object.queryOptions = $root.google.spanner.v1.ExecuteSqlRequest.QueryOptions.toObject(message.queryOptions, options); - if (message.requestOptions != null && message.hasOwnProperty("requestOptions")) - object.requestOptions = $root.google.spanner.v1.RequestOptions.toObject(message.requestOptions, options); - if (message.directedReadOptions != null && message.hasOwnProperty("directedReadOptions")) - object.directedReadOptions = $root.google.spanner.v1.DirectedReadOptions.toObject(message.directedReadOptions, options); - if (message.dataBoostEnabled != null && message.hasOwnProperty("dataBoostEnabled")) - object.dataBoostEnabled = message.dataBoostEnabled; - if (message.lastStatement != null && message.hasOwnProperty("lastStatement")) - object.lastStatement = message.lastStatement; - if (message.routingHint != null && message.hasOwnProperty("routingHint")) - object.routingHint = $root.google.spanner.v1.RoutingHint.toObject(message.routingHint, options); - return object; - }; - - /** - * Converts this ExecuteSqlRequest to JSON. - * @function toJSON - * @memberof google.spanner.v1.ExecuteSqlRequest - * @instance - * @returns {Object.} JSON object - */ - ExecuteSqlRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExecuteSqlRequest - * @function getTypeUrl - * @memberof google.spanner.v1.ExecuteSqlRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExecuteSqlRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.ExecuteSqlRequest"; - }; - - /** - * QueryMode enum. - * @name google.spanner.v1.ExecuteSqlRequest.QueryMode - * @enum {number} - * @property {number} NORMAL=0 NORMAL value - * @property {number} PLAN=1 PLAN value - * @property {number} PROFILE=2 PROFILE value - * @property {number} WITH_STATS=3 WITH_STATS value - * @property {number} WITH_PLAN_AND_STATS=4 WITH_PLAN_AND_STATS value - */ - ExecuteSqlRequest.QueryMode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "NORMAL"] = 0; - values[valuesById[1] = "PLAN"] = 1; - values[valuesById[2] = "PROFILE"] = 2; - values[valuesById[3] = "WITH_STATS"] = 3; - values[valuesById[4] = "WITH_PLAN_AND_STATS"] = 4; - return values; - })(); - - ExecuteSqlRequest.QueryOptions = (function() { - - /** - * Properties of a QueryOptions. - * @memberof google.spanner.v1.ExecuteSqlRequest - * @interface IQueryOptions - * @property {string|null} [optimizerVersion] QueryOptions optimizerVersion - * @property {string|null} [optimizerStatisticsPackage] QueryOptions optimizerStatisticsPackage - */ - - /** - * Constructs a new QueryOptions. - * @memberof google.spanner.v1.ExecuteSqlRequest - * @classdesc Represents a QueryOptions. - * @implements IQueryOptions - * @constructor - * @param {google.spanner.v1.ExecuteSqlRequest.IQueryOptions=} [properties] Properties to set - */ - function QueryOptions(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryOptions optimizerVersion. - * @member {string} optimizerVersion - * @memberof google.spanner.v1.ExecuteSqlRequest.QueryOptions - * @instance - */ - QueryOptions.prototype.optimizerVersion = ""; - - /** - * QueryOptions optimizerStatisticsPackage. - * @member {string} optimizerStatisticsPackage - * @memberof google.spanner.v1.ExecuteSqlRequest.QueryOptions - * @instance - */ - QueryOptions.prototype.optimizerStatisticsPackage = ""; - - /** - * Creates a new QueryOptions instance using the specified properties. - * @function create - * @memberof google.spanner.v1.ExecuteSqlRequest.QueryOptions - * @static - * @param {google.spanner.v1.ExecuteSqlRequest.IQueryOptions=} [properties] Properties to set - * @returns {google.spanner.v1.ExecuteSqlRequest.QueryOptions} QueryOptions instance - */ - QueryOptions.create = function create(properties) { - return new QueryOptions(properties); - }; - - /** - * Encodes the specified QueryOptions message. Does not implicitly {@link google.spanner.v1.ExecuteSqlRequest.QueryOptions.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.ExecuteSqlRequest.QueryOptions - * @static - * @param {google.spanner.v1.ExecuteSqlRequest.IQueryOptions} message QueryOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.optimizerVersion != null && Object.hasOwnProperty.call(message, "optimizerVersion")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.optimizerVersion); - if (message.optimizerStatisticsPackage != null && Object.hasOwnProperty.call(message, "optimizerStatisticsPackage")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.optimizerStatisticsPackage); - return writer; - }; - - /** - * Encodes the specified QueryOptions message, length delimited. Does not implicitly {@link google.spanner.v1.ExecuteSqlRequest.QueryOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.ExecuteSqlRequest.QueryOptions - * @static - * @param {google.spanner.v1.ExecuteSqlRequest.IQueryOptions} message QueryOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryOptions message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.ExecuteSqlRequest.QueryOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.ExecuteSqlRequest.QueryOptions} QueryOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.ExecuteSqlRequest.QueryOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.optimizerVersion = reader.string(); - break; - } - case 2: { - message.optimizerStatisticsPackage = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.ExecuteSqlRequest.QueryOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.ExecuteSqlRequest.QueryOptions} QueryOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryOptions message. - * @function verify - * @memberof google.spanner.v1.ExecuteSqlRequest.QueryOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.optimizerVersion != null && message.hasOwnProperty("optimizerVersion")) - if (!$util.isString(message.optimizerVersion)) - return "optimizerVersion: string expected"; - if (message.optimizerStatisticsPackage != null && message.hasOwnProperty("optimizerStatisticsPackage")) - if (!$util.isString(message.optimizerStatisticsPackage)) - return "optimizerStatisticsPackage: string expected"; - return null; - }; - - /** - * Creates a QueryOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.ExecuteSqlRequest.QueryOptions - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.ExecuteSqlRequest.QueryOptions} QueryOptions - */ - QueryOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.ExecuteSqlRequest.QueryOptions) - return object; - var message = new $root.google.spanner.v1.ExecuteSqlRequest.QueryOptions(); - if (object.optimizerVersion != null) - message.optimizerVersion = String(object.optimizerVersion); - if (object.optimizerStatisticsPackage != null) - message.optimizerStatisticsPackage = String(object.optimizerStatisticsPackage); - return message; - }; - - /** - * Creates a plain object from a QueryOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.ExecuteSqlRequest.QueryOptions - * @static - * @param {google.spanner.v1.ExecuteSqlRequest.QueryOptions} message QueryOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.optimizerVersion = ""; - object.optimizerStatisticsPackage = ""; - } - if (message.optimizerVersion != null && message.hasOwnProperty("optimizerVersion")) - object.optimizerVersion = message.optimizerVersion; - if (message.optimizerStatisticsPackage != null && message.hasOwnProperty("optimizerStatisticsPackage")) - object.optimizerStatisticsPackage = message.optimizerStatisticsPackage; - return object; - }; - - /** - * Converts this QueryOptions to JSON. - * @function toJSON - * @memberof google.spanner.v1.ExecuteSqlRequest.QueryOptions - * @instance - * @returns {Object.} JSON object - */ - QueryOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for QueryOptions - * @function getTypeUrl - * @memberof google.spanner.v1.ExecuteSqlRequest.QueryOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - QueryOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.ExecuteSqlRequest.QueryOptions"; - }; - - return QueryOptions; - })(); - - return ExecuteSqlRequest; - })(); - - v1.ExecuteBatchDmlRequest = (function() { - - /** - * Properties of an ExecuteBatchDmlRequest. - * @memberof google.spanner.v1 - * @interface IExecuteBatchDmlRequest - * @property {string|null} [session] ExecuteBatchDmlRequest session - * @property {google.spanner.v1.ITransactionSelector|null} [transaction] ExecuteBatchDmlRequest transaction - * @property {Array.|null} [statements] ExecuteBatchDmlRequest statements - * @property {number|Long|null} [seqno] ExecuteBatchDmlRequest seqno - * @property {google.spanner.v1.IRequestOptions|null} [requestOptions] ExecuteBatchDmlRequest requestOptions - * @property {boolean|null} [lastStatements] ExecuteBatchDmlRequest lastStatements - */ - - /** - * Constructs a new ExecuteBatchDmlRequest. - * @memberof google.spanner.v1 - * @classdesc Represents an ExecuteBatchDmlRequest. - * @implements IExecuteBatchDmlRequest - * @constructor - * @param {google.spanner.v1.IExecuteBatchDmlRequest=} [properties] Properties to set - */ - function ExecuteBatchDmlRequest(properties) { - this.statements = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExecuteBatchDmlRequest session. - * @member {string} session - * @memberof google.spanner.v1.ExecuteBatchDmlRequest - * @instance - */ - ExecuteBatchDmlRequest.prototype.session = ""; - - /** - * ExecuteBatchDmlRequest transaction. - * @member {google.spanner.v1.ITransactionSelector|null|undefined} transaction - * @memberof google.spanner.v1.ExecuteBatchDmlRequest - * @instance - */ - ExecuteBatchDmlRequest.prototype.transaction = null; - - /** - * ExecuteBatchDmlRequest statements. - * @member {Array.} statements - * @memberof google.spanner.v1.ExecuteBatchDmlRequest - * @instance - */ - ExecuteBatchDmlRequest.prototype.statements = $util.emptyArray; - - /** - * ExecuteBatchDmlRequest seqno. - * @member {number|Long} seqno - * @memberof google.spanner.v1.ExecuteBatchDmlRequest - * @instance - */ - ExecuteBatchDmlRequest.prototype.seqno = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * ExecuteBatchDmlRequest requestOptions. - * @member {google.spanner.v1.IRequestOptions|null|undefined} requestOptions - * @memberof google.spanner.v1.ExecuteBatchDmlRequest - * @instance - */ - ExecuteBatchDmlRequest.prototype.requestOptions = null; - - /** - * ExecuteBatchDmlRequest lastStatements. - * @member {boolean} lastStatements - * @memberof google.spanner.v1.ExecuteBatchDmlRequest - * @instance - */ - ExecuteBatchDmlRequest.prototype.lastStatements = false; - - /** - * Creates a new ExecuteBatchDmlRequest instance using the specified properties. - * @function create - * @memberof google.spanner.v1.ExecuteBatchDmlRequest - * @static - * @param {google.spanner.v1.IExecuteBatchDmlRequest=} [properties] Properties to set - * @returns {google.spanner.v1.ExecuteBatchDmlRequest} ExecuteBatchDmlRequest instance - */ - ExecuteBatchDmlRequest.create = function create(properties) { - return new ExecuteBatchDmlRequest(properties); - }; - - /** - * Encodes the specified ExecuteBatchDmlRequest message. Does not implicitly {@link google.spanner.v1.ExecuteBatchDmlRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.ExecuteBatchDmlRequest - * @static - * @param {google.spanner.v1.IExecuteBatchDmlRequest} message ExecuteBatchDmlRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExecuteBatchDmlRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.session != null && Object.hasOwnProperty.call(message, "session")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.session); - if (message.transaction != null && Object.hasOwnProperty.call(message, "transaction")) - $root.google.spanner.v1.TransactionSelector.encode(message.transaction, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.statements != null && message.statements.length) - for (var i = 0; i < message.statements.length; ++i) - $root.google.spanner.v1.ExecuteBatchDmlRequest.Statement.encode(message.statements[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.seqno != null && Object.hasOwnProperty.call(message, "seqno")) - writer.uint32(/* id 4, wireType 0 =*/32).int64(message.seqno); - if (message.requestOptions != null && Object.hasOwnProperty.call(message, "requestOptions")) - $root.google.spanner.v1.RequestOptions.encode(message.requestOptions, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.lastStatements != null && Object.hasOwnProperty.call(message, "lastStatements")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.lastStatements); - return writer; - }; - - /** - * Encodes the specified ExecuteBatchDmlRequest message, length delimited. Does not implicitly {@link google.spanner.v1.ExecuteBatchDmlRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.ExecuteBatchDmlRequest - * @static - * @param {google.spanner.v1.IExecuteBatchDmlRequest} message ExecuteBatchDmlRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExecuteBatchDmlRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExecuteBatchDmlRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.ExecuteBatchDmlRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.ExecuteBatchDmlRequest} ExecuteBatchDmlRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExecuteBatchDmlRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.ExecuteBatchDmlRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.session = reader.string(); - break; - } - case 2: { - message.transaction = $root.google.spanner.v1.TransactionSelector.decode(reader, reader.uint32()); - break; - } - case 3: { - if (!(message.statements && message.statements.length)) - message.statements = []; - message.statements.push($root.google.spanner.v1.ExecuteBatchDmlRequest.Statement.decode(reader, reader.uint32())); - break; - } - case 4: { - message.seqno = reader.int64(); - break; - } - case 5: { - message.requestOptions = $root.google.spanner.v1.RequestOptions.decode(reader, reader.uint32()); - break; - } - case 6: { - message.lastStatements = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExecuteBatchDmlRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.ExecuteBatchDmlRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.ExecuteBatchDmlRequest} ExecuteBatchDmlRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExecuteBatchDmlRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExecuteBatchDmlRequest message. - * @function verify - * @memberof google.spanner.v1.ExecuteBatchDmlRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExecuteBatchDmlRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.session != null && message.hasOwnProperty("session")) - if (!$util.isString(message.session)) - return "session: string expected"; - if (message.transaction != null && message.hasOwnProperty("transaction")) { - var error = $root.google.spanner.v1.TransactionSelector.verify(message.transaction); - if (error) - return "transaction." + error; - } - if (message.statements != null && message.hasOwnProperty("statements")) { - if (!Array.isArray(message.statements)) - return "statements: array expected"; - for (var i = 0; i < message.statements.length; ++i) { - var error = $root.google.spanner.v1.ExecuteBatchDmlRequest.Statement.verify(message.statements[i]); - if (error) - return "statements." + error; - } - } - if (message.seqno != null && message.hasOwnProperty("seqno")) - if (!$util.isInteger(message.seqno) && !(message.seqno && $util.isInteger(message.seqno.low) && $util.isInteger(message.seqno.high))) - return "seqno: integer|Long expected"; - if (message.requestOptions != null && message.hasOwnProperty("requestOptions")) { - var error = $root.google.spanner.v1.RequestOptions.verify(message.requestOptions); - if (error) - return "requestOptions." + error; - } - if (message.lastStatements != null && message.hasOwnProperty("lastStatements")) - if (typeof message.lastStatements !== "boolean") - return "lastStatements: boolean expected"; - return null; - }; - - /** - * Creates an ExecuteBatchDmlRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.ExecuteBatchDmlRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.ExecuteBatchDmlRequest} ExecuteBatchDmlRequest - */ - ExecuteBatchDmlRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.ExecuteBatchDmlRequest) - return object; - var message = new $root.google.spanner.v1.ExecuteBatchDmlRequest(); - if (object.session != null) - message.session = String(object.session); - if (object.transaction != null) { - if (typeof object.transaction !== "object") - throw TypeError(".google.spanner.v1.ExecuteBatchDmlRequest.transaction: object expected"); - message.transaction = $root.google.spanner.v1.TransactionSelector.fromObject(object.transaction); - } - if (object.statements) { - if (!Array.isArray(object.statements)) - throw TypeError(".google.spanner.v1.ExecuteBatchDmlRequest.statements: array expected"); - message.statements = []; - for (var i = 0; i < object.statements.length; ++i) { - if (typeof object.statements[i] !== "object") - throw TypeError(".google.spanner.v1.ExecuteBatchDmlRequest.statements: object expected"); - message.statements[i] = $root.google.spanner.v1.ExecuteBatchDmlRequest.Statement.fromObject(object.statements[i]); - } - } - if (object.seqno != null) - if ($util.Long) - (message.seqno = $util.Long.fromValue(object.seqno)).unsigned = false; - else if (typeof object.seqno === "string") - message.seqno = parseInt(object.seqno, 10); - else if (typeof object.seqno === "number") - message.seqno = object.seqno; - else if (typeof object.seqno === "object") - message.seqno = new $util.LongBits(object.seqno.low >>> 0, object.seqno.high >>> 0).toNumber(); - if (object.requestOptions != null) { - if (typeof object.requestOptions !== "object") - throw TypeError(".google.spanner.v1.ExecuteBatchDmlRequest.requestOptions: object expected"); - message.requestOptions = $root.google.spanner.v1.RequestOptions.fromObject(object.requestOptions); - } - if (object.lastStatements != null) - message.lastStatements = Boolean(object.lastStatements); - return message; - }; - - /** - * Creates a plain object from an ExecuteBatchDmlRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.ExecuteBatchDmlRequest - * @static - * @param {google.spanner.v1.ExecuteBatchDmlRequest} message ExecuteBatchDmlRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExecuteBatchDmlRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.statements = []; - if (options.defaults) { - object.session = ""; - object.transaction = null; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.seqno = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.seqno = options.longs === String ? "0" : 0; - object.requestOptions = null; - object.lastStatements = false; - } - if (message.session != null && message.hasOwnProperty("session")) - object.session = message.session; - if (message.transaction != null && message.hasOwnProperty("transaction")) - object.transaction = $root.google.spanner.v1.TransactionSelector.toObject(message.transaction, options); - if (message.statements && message.statements.length) { - object.statements = []; - for (var j = 0; j < message.statements.length; ++j) - object.statements[j] = $root.google.spanner.v1.ExecuteBatchDmlRequest.Statement.toObject(message.statements[j], options); - } - if (message.seqno != null && message.hasOwnProperty("seqno")) - if (typeof message.seqno === "number") - object.seqno = options.longs === String ? String(message.seqno) : message.seqno; - else - object.seqno = options.longs === String ? $util.Long.prototype.toString.call(message.seqno) : options.longs === Number ? new $util.LongBits(message.seqno.low >>> 0, message.seqno.high >>> 0).toNumber() : message.seqno; - if (message.requestOptions != null && message.hasOwnProperty("requestOptions")) - object.requestOptions = $root.google.spanner.v1.RequestOptions.toObject(message.requestOptions, options); - if (message.lastStatements != null && message.hasOwnProperty("lastStatements")) - object.lastStatements = message.lastStatements; - return object; - }; - - /** - * Converts this ExecuteBatchDmlRequest to JSON. - * @function toJSON - * @memberof google.spanner.v1.ExecuteBatchDmlRequest - * @instance - * @returns {Object.} JSON object - */ - ExecuteBatchDmlRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExecuteBatchDmlRequest - * @function getTypeUrl - * @memberof google.spanner.v1.ExecuteBatchDmlRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExecuteBatchDmlRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.ExecuteBatchDmlRequest"; - }; - - ExecuteBatchDmlRequest.Statement = (function() { - - /** - * Properties of a Statement. - * @memberof google.spanner.v1.ExecuteBatchDmlRequest - * @interface IStatement - * @property {string|null} [sql] Statement sql - * @property {google.protobuf.IStruct|null} [params] Statement params - * @property {Object.|null} [paramTypes] Statement paramTypes - */ - - /** - * Constructs a new Statement. - * @memberof google.spanner.v1.ExecuteBatchDmlRequest - * @classdesc Represents a Statement. - * @implements IStatement - * @constructor - * @param {google.spanner.v1.ExecuteBatchDmlRequest.IStatement=} [properties] Properties to set - */ - function Statement(properties) { - this.paramTypes = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Statement sql. - * @member {string} sql - * @memberof google.spanner.v1.ExecuteBatchDmlRequest.Statement - * @instance - */ - Statement.prototype.sql = ""; - - /** - * Statement params. - * @member {google.protobuf.IStruct|null|undefined} params - * @memberof google.spanner.v1.ExecuteBatchDmlRequest.Statement - * @instance - */ - Statement.prototype.params = null; - - /** - * Statement paramTypes. - * @member {Object.} paramTypes - * @memberof google.spanner.v1.ExecuteBatchDmlRequest.Statement - * @instance - */ - Statement.prototype.paramTypes = $util.emptyObject; - - /** - * Creates a new Statement instance using the specified properties. - * @function create - * @memberof google.spanner.v1.ExecuteBatchDmlRequest.Statement - * @static - * @param {google.spanner.v1.ExecuteBatchDmlRequest.IStatement=} [properties] Properties to set - * @returns {google.spanner.v1.ExecuteBatchDmlRequest.Statement} Statement instance - */ - Statement.create = function create(properties) { - return new Statement(properties); - }; - - /** - * Encodes the specified Statement message. Does not implicitly {@link google.spanner.v1.ExecuteBatchDmlRequest.Statement.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.ExecuteBatchDmlRequest.Statement - * @static - * @param {google.spanner.v1.ExecuteBatchDmlRequest.IStatement} message Statement message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Statement.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.sql != null && Object.hasOwnProperty.call(message, "sql")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.sql); - if (message.params != null && Object.hasOwnProperty.call(message, "params")) - $root.google.protobuf.Struct.encode(message.params, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.paramTypes != null && Object.hasOwnProperty.call(message, "paramTypes")) - for (var keys = Object.keys(message.paramTypes), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.spanner.v1.Type.encode(message.paramTypes[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - return writer; - }; - - /** - * Encodes the specified Statement message, length delimited. Does not implicitly {@link google.spanner.v1.ExecuteBatchDmlRequest.Statement.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.ExecuteBatchDmlRequest.Statement - * @static - * @param {google.spanner.v1.ExecuteBatchDmlRequest.IStatement} message Statement message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Statement.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Statement message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.ExecuteBatchDmlRequest.Statement - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.ExecuteBatchDmlRequest.Statement} Statement - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Statement.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.ExecuteBatchDmlRequest.Statement(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.sql = reader.string(); - break; - } - case 2: { - message.params = $root.google.protobuf.Struct.decode(reader, reader.uint32()); - break; - } - case 3: { - if (message.paramTypes === $util.emptyObject) - message.paramTypes = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = null; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = $root.google.spanner.v1.Type.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.paramTypes[key] = value; - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Statement message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.ExecuteBatchDmlRequest.Statement - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.ExecuteBatchDmlRequest.Statement} Statement - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Statement.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Statement message. - * @function verify - * @memberof google.spanner.v1.ExecuteBatchDmlRequest.Statement - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Statement.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.sql != null && message.hasOwnProperty("sql")) - if (!$util.isString(message.sql)) - return "sql: string expected"; - if (message.params != null && message.hasOwnProperty("params")) { - var error = $root.google.protobuf.Struct.verify(message.params); - if (error) - return "params." + error; - } - if (message.paramTypes != null && message.hasOwnProperty("paramTypes")) { - if (!$util.isObject(message.paramTypes)) - return "paramTypes: object expected"; - var key = Object.keys(message.paramTypes); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.spanner.v1.Type.verify(message.paramTypes[key[i]]); - if (error) - return "paramTypes." + error; - } - } - return null; - }; - - /** - * Creates a Statement message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.ExecuteBatchDmlRequest.Statement - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.ExecuteBatchDmlRequest.Statement} Statement - */ - Statement.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.ExecuteBatchDmlRequest.Statement) - return object; - var message = new $root.google.spanner.v1.ExecuteBatchDmlRequest.Statement(); - if (object.sql != null) - message.sql = String(object.sql); - if (object.params != null) { - if (typeof object.params !== "object") - throw TypeError(".google.spanner.v1.ExecuteBatchDmlRequest.Statement.params: object expected"); - message.params = $root.google.protobuf.Struct.fromObject(object.params); - } - if (object.paramTypes) { - if (typeof object.paramTypes !== "object") - throw TypeError(".google.spanner.v1.ExecuteBatchDmlRequest.Statement.paramTypes: object expected"); - message.paramTypes = {}; - for (var keys = Object.keys(object.paramTypes), i = 0; i < keys.length; ++i) { - if (typeof object.paramTypes[keys[i]] !== "object") - throw TypeError(".google.spanner.v1.ExecuteBatchDmlRequest.Statement.paramTypes: object expected"); - message.paramTypes[keys[i]] = $root.google.spanner.v1.Type.fromObject(object.paramTypes[keys[i]]); - } - } - return message; - }; - - /** - * Creates a plain object from a Statement message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.ExecuteBatchDmlRequest.Statement - * @static - * @param {google.spanner.v1.ExecuteBatchDmlRequest.Statement} message Statement - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Statement.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.paramTypes = {}; - if (options.defaults) { - object.sql = ""; - object.params = null; - } - if (message.sql != null && message.hasOwnProperty("sql")) - object.sql = message.sql; - if (message.params != null && message.hasOwnProperty("params")) - object.params = $root.google.protobuf.Struct.toObject(message.params, options); - var keys2; - if (message.paramTypes && (keys2 = Object.keys(message.paramTypes)).length) { - object.paramTypes = {}; - for (var j = 0; j < keys2.length; ++j) - object.paramTypes[keys2[j]] = $root.google.spanner.v1.Type.toObject(message.paramTypes[keys2[j]], options); - } - return object; - }; - - /** - * Converts this Statement to JSON. - * @function toJSON - * @memberof google.spanner.v1.ExecuteBatchDmlRequest.Statement - * @instance - * @returns {Object.} JSON object - */ - Statement.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Statement - * @function getTypeUrl - * @memberof google.spanner.v1.ExecuteBatchDmlRequest.Statement - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Statement.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.ExecuteBatchDmlRequest.Statement"; - }; - - return Statement; - })(); - - return ExecuteBatchDmlRequest; - })(); - - v1.ExecuteBatchDmlResponse = (function() { - - /** - * Properties of an ExecuteBatchDmlResponse. - * @memberof google.spanner.v1 - * @interface IExecuteBatchDmlResponse - * @property {Array.|null} [resultSets] ExecuteBatchDmlResponse resultSets - * @property {google.rpc.IStatus|null} [status] ExecuteBatchDmlResponse status - * @property {google.spanner.v1.IMultiplexedSessionPrecommitToken|null} [precommitToken] ExecuteBatchDmlResponse precommitToken - */ - - /** - * Constructs a new ExecuteBatchDmlResponse. - * @memberof google.spanner.v1 - * @classdesc Represents an ExecuteBatchDmlResponse. - * @implements IExecuteBatchDmlResponse - * @constructor - * @param {google.spanner.v1.IExecuteBatchDmlResponse=} [properties] Properties to set - */ - function ExecuteBatchDmlResponse(properties) { - this.resultSets = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExecuteBatchDmlResponse resultSets. - * @member {Array.} resultSets - * @memberof google.spanner.v1.ExecuteBatchDmlResponse - * @instance - */ - ExecuteBatchDmlResponse.prototype.resultSets = $util.emptyArray; - - /** - * ExecuteBatchDmlResponse status. - * @member {google.rpc.IStatus|null|undefined} status - * @memberof google.spanner.v1.ExecuteBatchDmlResponse - * @instance - */ - ExecuteBatchDmlResponse.prototype.status = null; - - /** - * ExecuteBatchDmlResponse precommitToken. - * @member {google.spanner.v1.IMultiplexedSessionPrecommitToken|null|undefined} precommitToken - * @memberof google.spanner.v1.ExecuteBatchDmlResponse - * @instance - */ - ExecuteBatchDmlResponse.prototype.precommitToken = null; - - /** - * Creates a new ExecuteBatchDmlResponse instance using the specified properties. - * @function create - * @memberof google.spanner.v1.ExecuteBatchDmlResponse - * @static - * @param {google.spanner.v1.IExecuteBatchDmlResponse=} [properties] Properties to set - * @returns {google.spanner.v1.ExecuteBatchDmlResponse} ExecuteBatchDmlResponse instance - */ - ExecuteBatchDmlResponse.create = function create(properties) { - return new ExecuteBatchDmlResponse(properties); - }; - - /** - * Encodes the specified ExecuteBatchDmlResponse message. Does not implicitly {@link google.spanner.v1.ExecuteBatchDmlResponse.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.ExecuteBatchDmlResponse - * @static - * @param {google.spanner.v1.IExecuteBatchDmlResponse} message ExecuteBatchDmlResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExecuteBatchDmlResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.resultSets != null && message.resultSets.length) - for (var i = 0; i < message.resultSets.length; ++i) - $root.google.spanner.v1.ResultSet.encode(message.resultSets[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.status != null && Object.hasOwnProperty.call(message, "status")) - $root.google.rpc.Status.encode(message.status, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.precommitToken != null && Object.hasOwnProperty.call(message, "precommitToken")) - $root.google.spanner.v1.MultiplexedSessionPrecommitToken.encode(message.precommitToken, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ExecuteBatchDmlResponse message, length delimited. Does not implicitly {@link google.spanner.v1.ExecuteBatchDmlResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.ExecuteBatchDmlResponse - * @static - * @param {google.spanner.v1.IExecuteBatchDmlResponse} message ExecuteBatchDmlResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExecuteBatchDmlResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExecuteBatchDmlResponse message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.ExecuteBatchDmlResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.ExecuteBatchDmlResponse} ExecuteBatchDmlResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExecuteBatchDmlResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.ExecuteBatchDmlResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.resultSets && message.resultSets.length)) - message.resultSets = []; - message.resultSets.push($root.google.spanner.v1.ResultSet.decode(reader, reader.uint32())); - break; - } - case 2: { - message.status = $root.google.rpc.Status.decode(reader, reader.uint32()); - break; - } - case 3: { - message.precommitToken = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExecuteBatchDmlResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.ExecuteBatchDmlResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.ExecuteBatchDmlResponse} ExecuteBatchDmlResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExecuteBatchDmlResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExecuteBatchDmlResponse message. - * @function verify - * @memberof google.spanner.v1.ExecuteBatchDmlResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExecuteBatchDmlResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.resultSets != null && message.hasOwnProperty("resultSets")) { - if (!Array.isArray(message.resultSets)) - return "resultSets: array expected"; - for (var i = 0; i < message.resultSets.length; ++i) { - var error = $root.google.spanner.v1.ResultSet.verify(message.resultSets[i]); - if (error) - return "resultSets." + error; - } - } - if (message.status != null && message.hasOwnProperty("status")) { - var error = $root.google.rpc.Status.verify(message.status); - if (error) - return "status." + error; - } - if (message.precommitToken != null && message.hasOwnProperty("precommitToken")) { - var error = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.verify(message.precommitToken); - if (error) - return "precommitToken." + error; - } - return null; - }; - - /** - * Creates an ExecuteBatchDmlResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.ExecuteBatchDmlResponse - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.ExecuteBatchDmlResponse} ExecuteBatchDmlResponse - */ - ExecuteBatchDmlResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.ExecuteBatchDmlResponse) - return object; - var message = new $root.google.spanner.v1.ExecuteBatchDmlResponse(); - if (object.resultSets) { - if (!Array.isArray(object.resultSets)) - throw TypeError(".google.spanner.v1.ExecuteBatchDmlResponse.resultSets: array expected"); - message.resultSets = []; - for (var i = 0; i < object.resultSets.length; ++i) { - if (typeof object.resultSets[i] !== "object") - throw TypeError(".google.spanner.v1.ExecuteBatchDmlResponse.resultSets: object expected"); - message.resultSets[i] = $root.google.spanner.v1.ResultSet.fromObject(object.resultSets[i]); - } - } - if (object.status != null) { - if (typeof object.status !== "object") - throw TypeError(".google.spanner.v1.ExecuteBatchDmlResponse.status: object expected"); - message.status = $root.google.rpc.Status.fromObject(object.status); - } - if (object.precommitToken != null) { - if (typeof object.precommitToken !== "object") - throw TypeError(".google.spanner.v1.ExecuteBatchDmlResponse.precommitToken: object expected"); - message.precommitToken = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.fromObject(object.precommitToken); - } - return message; - }; - - /** - * Creates a plain object from an ExecuteBatchDmlResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.ExecuteBatchDmlResponse - * @static - * @param {google.spanner.v1.ExecuteBatchDmlResponse} message ExecuteBatchDmlResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExecuteBatchDmlResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.resultSets = []; - if (options.defaults) { - object.status = null; - object.precommitToken = null; - } - if (message.resultSets && message.resultSets.length) { - object.resultSets = []; - for (var j = 0; j < message.resultSets.length; ++j) - object.resultSets[j] = $root.google.spanner.v1.ResultSet.toObject(message.resultSets[j], options); - } - if (message.status != null && message.hasOwnProperty("status")) - object.status = $root.google.rpc.Status.toObject(message.status, options); - if (message.precommitToken != null && message.hasOwnProperty("precommitToken")) - object.precommitToken = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.toObject(message.precommitToken, options); - return object; - }; - - /** - * Converts this ExecuteBatchDmlResponse to JSON. - * @function toJSON - * @memberof google.spanner.v1.ExecuteBatchDmlResponse - * @instance - * @returns {Object.} JSON object - */ - ExecuteBatchDmlResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExecuteBatchDmlResponse - * @function getTypeUrl - * @memberof google.spanner.v1.ExecuteBatchDmlResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExecuteBatchDmlResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.ExecuteBatchDmlResponse"; - }; - - return ExecuteBatchDmlResponse; - })(); - - v1.PartitionOptions = (function() { - - /** - * Properties of a PartitionOptions. - * @memberof google.spanner.v1 - * @interface IPartitionOptions - * @property {number|Long|null} [partitionSizeBytes] PartitionOptions partitionSizeBytes - * @property {number|Long|null} [maxPartitions] PartitionOptions maxPartitions - */ - - /** - * Constructs a new PartitionOptions. - * @memberof google.spanner.v1 - * @classdesc Represents a PartitionOptions. - * @implements IPartitionOptions - * @constructor - * @param {google.spanner.v1.IPartitionOptions=} [properties] Properties to set - */ - function PartitionOptions(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PartitionOptions partitionSizeBytes. - * @member {number|Long} partitionSizeBytes - * @memberof google.spanner.v1.PartitionOptions - * @instance - */ - PartitionOptions.prototype.partitionSizeBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * PartitionOptions maxPartitions. - * @member {number|Long} maxPartitions - * @memberof google.spanner.v1.PartitionOptions - * @instance - */ - PartitionOptions.prototype.maxPartitions = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Creates a new PartitionOptions instance using the specified properties. - * @function create - * @memberof google.spanner.v1.PartitionOptions - * @static - * @param {google.spanner.v1.IPartitionOptions=} [properties] Properties to set - * @returns {google.spanner.v1.PartitionOptions} PartitionOptions instance - */ - PartitionOptions.create = function create(properties) { - return new PartitionOptions(properties); - }; - - /** - * Encodes the specified PartitionOptions message. Does not implicitly {@link google.spanner.v1.PartitionOptions.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.PartitionOptions - * @static - * @param {google.spanner.v1.IPartitionOptions} message PartitionOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PartitionOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.partitionSizeBytes != null && Object.hasOwnProperty.call(message, "partitionSizeBytes")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.partitionSizeBytes); - if (message.maxPartitions != null && Object.hasOwnProperty.call(message, "maxPartitions")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.maxPartitions); - return writer; - }; - - /** - * Encodes the specified PartitionOptions message, length delimited. Does not implicitly {@link google.spanner.v1.PartitionOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.PartitionOptions - * @static - * @param {google.spanner.v1.IPartitionOptions} message PartitionOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PartitionOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PartitionOptions message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.PartitionOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.PartitionOptions} PartitionOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PartitionOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.PartitionOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.partitionSizeBytes = reader.int64(); - break; - } - case 2: { - message.maxPartitions = reader.int64(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PartitionOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.PartitionOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.PartitionOptions} PartitionOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PartitionOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PartitionOptions message. - * @function verify - * @memberof google.spanner.v1.PartitionOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PartitionOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.partitionSizeBytes != null && message.hasOwnProperty("partitionSizeBytes")) - if (!$util.isInteger(message.partitionSizeBytes) && !(message.partitionSizeBytes && $util.isInteger(message.partitionSizeBytes.low) && $util.isInteger(message.partitionSizeBytes.high))) - return "partitionSizeBytes: integer|Long expected"; - if (message.maxPartitions != null && message.hasOwnProperty("maxPartitions")) - if (!$util.isInteger(message.maxPartitions) && !(message.maxPartitions && $util.isInteger(message.maxPartitions.low) && $util.isInteger(message.maxPartitions.high))) - return "maxPartitions: integer|Long expected"; - return null; - }; - - /** - * Creates a PartitionOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.PartitionOptions - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.PartitionOptions} PartitionOptions - */ - PartitionOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.PartitionOptions) - return object; - var message = new $root.google.spanner.v1.PartitionOptions(); - if (object.partitionSizeBytes != null) - if ($util.Long) - (message.partitionSizeBytes = $util.Long.fromValue(object.partitionSizeBytes)).unsigned = false; - else if (typeof object.partitionSizeBytes === "string") - message.partitionSizeBytes = parseInt(object.partitionSizeBytes, 10); - else if (typeof object.partitionSizeBytes === "number") - message.partitionSizeBytes = object.partitionSizeBytes; - else if (typeof object.partitionSizeBytes === "object") - message.partitionSizeBytes = new $util.LongBits(object.partitionSizeBytes.low >>> 0, object.partitionSizeBytes.high >>> 0).toNumber(); - if (object.maxPartitions != null) - if ($util.Long) - (message.maxPartitions = $util.Long.fromValue(object.maxPartitions)).unsigned = false; - else if (typeof object.maxPartitions === "string") - message.maxPartitions = parseInt(object.maxPartitions, 10); - else if (typeof object.maxPartitions === "number") - message.maxPartitions = object.maxPartitions; - else if (typeof object.maxPartitions === "object") - message.maxPartitions = new $util.LongBits(object.maxPartitions.low >>> 0, object.maxPartitions.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from a PartitionOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.PartitionOptions - * @static - * @param {google.spanner.v1.PartitionOptions} message PartitionOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PartitionOptions.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.partitionSizeBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.partitionSizeBytes = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.maxPartitions = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.maxPartitions = options.longs === String ? "0" : 0; - } - if (message.partitionSizeBytes != null && message.hasOwnProperty("partitionSizeBytes")) - if (typeof message.partitionSizeBytes === "number") - object.partitionSizeBytes = options.longs === String ? String(message.partitionSizeBytes) : message.partitionSizeBytes; - else - object.partitionSizeBytes = options.longs === String ? $util.Long.prototype.toString.call(message.partitionSizeBytes) : options.longs === Number ? new $util.LongBits(message.partitionSizeBytes.low >>> 0, message.partitionSizeBytes.high >>> 0).toNumber() : message.partitionSizeBytes; - if (message.maxPartitions != null && message.hasOwnProperty("maxPartitions")) - if (typeof message.maxPartitions === "number") - object.maxPartitions = options.longs === String ? String(message.maxPartitions) : message.maxPartitions; - else - object.maxPartitions = options.longs === String ? $util.Long.prototype.toString.call(message.maxPartitions) : options.longs === Number ? new $util.LongBits(message.maxPartitions.low >>> 0, message.maxPartitions.high >>> 0).toNumber() : message.maxPartitions; - return object; - }; - - /** - * Converts this PartitionOptions to JSON. - * @function toJSON - * @memberof google.spanner.v1.PartitionOptions - * @instance - * @returns {Object.} JSON object - */ - PartitionOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PartitionOptions - * @function getTypeUrl - * @memberof google.spanner.v1.PartitionOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PartitionOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.PartitionOptions"; - }; - - return PartitionOptions; - })(); - - v1.PartitionQueryRequest = (function() { - - /** - * Properties of a PartitionQueryRequest. - * @memberof google.spanner.v1 - * @interface IPartitionQueryRequest - * @property {string|null} [session] PartitionQueryRequest session - * @property {google.spanner.v1.ITransactionSelector|null} [transaction] PartitionQueryRequest transaction - * @property {string|null} [sql] PartitionQueryRequest sql - * @property {google.protobuf.IStruct|null} [params] PartitionQueryRequest params - * @property {Object.|null} [paramTypes] PartitionQueryRequest paramTypes - * @property {google.spanner.v1.IPartitionOptions|null} [partitionOptions] PartitionQueryRequest partitionOptions - */ - - /** - * Constructs a new PartitionQueryRequest. - * @memberof google.spanner.v1 - * @classdesc Represents a PartitionQueryRequest. - * @implements IPartitionQueryRequest - * @constructor - * @param {google.spanner.v1.IPartitionQueryRequest=} [properties] Properties to set - */ - function PartitionQueryRequest(properties) { - this.paramTypes = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PartitionQueryRequest session. - * @member {string} session - * @memberof google.spanner.v1.PartitionQueryRequest - * @instance - */ - PartitionQueryRequest.prototype.session = ""; - - /** - * PartitionQueryRequest transaction. - * @member {google.spanner.v1.ITransactionSelector|null|undefined} transaction - * @memberof google.spanner.v1.PartitionQueryRequest - * @instance - */ - PartitionQueryRequest.prototype.transaction = null; - - /** - * PartitionQueryRequest sql. - * @member {string} sql - * @memberof google.spanner.v1.PartitionQueryRequest - * @instance - */ - PartitionQueryRequest.prototype.sql = ""; - - /** - * PartitionQueryRequest params. - * @member {google.protobuf.IStruct|null|undefined} params - * @memberof google.spanner.v1.PartitionQueryRequest - * @instance - */ - PartitionQueryRequest.prototype.params = null; - - /** - * PartitionQueryRequest paramTypes. - * @member {Object.} paramTypes - * @memberof google.spanner.v1.PartitionQueryRequest - * @instance - */ - PartitionQueryRequest.prototype.paramTypes = $util.emptyObject; - - /** - * PartitionQueryRequest partitionOptions. - * @member {google.spanner.v1.IPartitionOptions|null|undefined} partitionOptions - * @memberof google.spanner.v1.PartitionQueryRequest - * @instance - */ - PartitionQueryRequest.prototype.partitionOptions = null; - - /** - * Creates a new PartitionQueryRequest instance using the specified properties. - * @function create - * @memberof google.spanner.v1.PartitionQueryRequest - * @static - * @param {google.spanner.v1.IPartitionQueryRequest=} [properties] Properties to set - * @returns {google.spanner.v1.PartitionQueryRequest} PartitionQueryRequest instance - */ - PartitionQueryRequest.create = function create(properties) { - return new PartitionQueryRequest(properties); - }; - - /** - * Encodes the specified PartitionQueryRequest message. Does not implicitly {@link google.spanner.v1.PartitionQueryRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.PartitionQueryRequest - * @static - * @param {google.spanner.v1.IPartitionQueryRequest} message PartitionQueryRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PartitionQueryRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.session != null && Object.hasOwnProperty.call(message, "session")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.session); - if (message.transaction != null && Object.hasOwnProperty.call(message, "transaction")) - $root.google.spanner.v1.TransactionSelector.encode(message.transaction, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.sql != null && Object.hasOwnProperty.call(message, "sql")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.sql); - if (message.params != null && Object.hasOwnProperty.call(message, "params")) - $root.google.protobuf.Struct.encode(message.params, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.paramTypes != null && Object.hasOwnProperty.call(message, "paramTypes")) - for (var keys = Object.keys(message.paramTypes), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.spanner.v1.Type.encode(message.paramTypes[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - if (message.partitionOptions != null && Object.hasOwnProperty.call(message, "partitionOptions")) - $root.google.spanner.v1.PartitionOptions.encode(message.partitionOptions, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified PartitionQueryRequest message, length delimited. Does not implicitly {@link google.spanner.v1.PartitionQueryRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.PartitionQueryRequest - * @static - * @param {google.spanner.v1.IPartitionQueryRequest} message PartitionQueryRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PartitionQueryRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PartitionQueryRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.PartitionQueryRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.PartitionQueryRequest} PartitionQueryRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PartitionQueryRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.PartitionQueryRequest(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.session = reader.string(); - break; - } - case 2: { - message.transaction = $root.google.spanner.v1.TransactionSelector.decode(reader, reader.uint32()); - break; - } - case 3: { - message.sql = reader.string(); - break; - } - case 4: { - message.params = $root.google.protobuf.Struct.decode(reader, reader.uint32()); - break; - } - case 5: { - if (message.paramTypes === $util.emptyObject) - message.paramTypes = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = null; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = $root.google.spanner.v1.Type.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.paramTypes[key] = value; - break; - } - case 6: { - message.partitionOptions = $root.google.spanner.v1.PartitionOptions.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PartitionQueryRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.PartitionQueryRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.PartitionQueryRequest} PartitionQueryRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PartitionQueryRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PartitionQueryRequest message. - * @function verify - * @memberof google.spanner.v1.PartitionQueryRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PartitionQueryRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.session != null && message.hasOwnProperty("session")) - if (!$util.isString(message.session)) - return "session: string expected"; - if (message.transaction != null && message.hasOwnProperty("transaction")) { - var error = $root.google.spanner.v1.TransactionSelector.verify(message.transaction); - if (error) - return "transaction." + error; - } - if (message.sql != null && message.hasOwnProperty("sql")) - if (!$util.isString(message.sql)) - return "sql: string expected"; - if (message.params != null && message.hasOwnProperty("params")) { - var error = $root.google.protobuf.Struct.verify(message.params); - if (error) - return "params." + error; - } - if (message.paramTypes != null && message.hasOwnProperty("paramTypes")) { - if (!$util.isObject(message.paramTypes)) - return "paramTypes: object expected"; - var key = Object.keys(message.paramTypes); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.spanner.v1.Type.verify(message.paramTypes[key[i]]); - if (error) - return "paramTypes." + error; - } - } - if (message.partitionOptions != null && message.hasOwnProperty("partitionOptions")) { - var error = $root.google.spanner.v1.PartitionOptions.verify(message.partitionOptions); - if (error) - return "partitionOptions." + error; - } - return null; - }; - - /** - * Creates a PartitionQueryRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.PartitionQueryRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.PartitionQueryRequest} PartitionQueryRequest - */ - PartitionQueryRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.PartitionQueryRequest) - return object; - var message = new $root.google.spanner.v1.PartitionQueryRequest(); - if (object.session != null) - message.session = String(object.session); - if (object.transaction != null) { - if (typeof object.transaction !== "object") - throw TypeError(".google.spanner.v1.PartitionQueryRequest.transaction: object expected"); - message.transaction = $root.google.spanner.v1.TransactionSelector.fromObject(object.transaction); - } - if (object.sql != null) - message.sql = String(object.sql); - if (object.params != null) { - if (typeof object.params !== "object") - throw TypeError(".google.spanner.v1.PartitionQueryRequest.params: object expected"); - message.params = $root.google.protobuf.Struct.fromObject(object.params); - } - if (object.paramTypes) { - if (typeof object.paramTypes !== "object") - throw TypeError(".google.spanner.v1.PartitionQueryRequest.paramTypes: object expected"); - message.paramTypes = {}; - for (var keys = Object.keys(object.paramTypes), i = 0; i < keys.length; ++i) { - if (typeof object.paramTypes[keys[i]] !== "object") - throw TypeError(".google.spanner.v1.PartitionQueryRequest.paramTypes: object expected"); - message.paramTypes[keys[i]] = $root.google.spanner.v1.Type.fromObject(object.paramTypes[keys[i]]); - } - } - if (object.partitionOptions != null) { - if (typeof object.partitionOptions !== "object") - throw TypeError(".google.spanner.v1.PartitionQueryRequest.partitionOptions: object expected"); - message.partitionOptions = $root.google.spanner.v1.PartitionOptions.fromObject(object.partitionOptions); - } - return message; - }; - - /** - * Creates a plain object from a PartitionQueryRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.PartitionQueryRequest - * @static - * @param {google.spanner.v1.PartitionQueryRequest} message PartitionQueryRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PartitionQueryRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.paramTypes = {}; - if (options.defaults) { - object.session = ""; - object.transaction = null; - object.sql = ""; - object.params = null; - object.partitionOptions = null; - } - if (message.session != null && message.hasOwnProperty("session")) - object.session = message.session; - if (message.transaction != null && message.hasOwnProperty("transaction")) - object.transaction = $root.google.spanner.v1.TransactionSelector.toObject(message.transaction, options); - if (message.sql != null && message.hasOwnProperty("sql")) - object.sql = message.sql; - if (message.params != null && message.hasOwnProperty("params")) - object.params = $root.google.protobuf.Struct.toObject(message.params, options); - var keys2; - if (message.paramTypes && (keys2 = Object.keys(message.paramTypes)).length) { - object.paramTypes = {}; - for (var j = 0; j < keys2.length; ++j) - object.paramTypes[keys2[j]] = $root.google.spanner.v1.Type.toObject(message.paramTypes[keys2[j]], options); - } - if (message.partitionOptions != null && message.hasOwnProperty("partitionOptions")) - object.partitionOptions = $root.google.spanner.v1.PartitionOptions.toObject(message.partitionOptions, options); - return object; - }; - - /** - * Converts this PartitionQueryRequest to JSON. - * @function toJSON - * @memberof google.spanner.v1.PartitionQueryRequest - * @instance - * @returns {Object.} JSON object - */ - PartitionQueryRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PartitionQueryRequest - * @function getTypeUrl - * @memberof google.spanner.v1.PartitionQueryRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PartitionQueryRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.PartitionQueryRequest"; - }; - - return PartitionQueryRequest; - })(); - - v1.PartitionReadRequest = (function() { - - /** - * Properties of a PartitionReadRequest. - * @memberof google.spanner.v1 - * @interface IPartitionReadRequest - * @property {string|null} [session] PartitionReadRequest session - * @property {google.spanner.v1.ITransactionSelector|null} [transaction] PartitionReadRequest transaction - * @property {string|null} [table] PartitionReadRequest table - * @property {string|null} [index] PartitionReadRequest index - * @property {Array.|null} [columns] PartitionReadRequest columns - * @property {google.spanner.v1.IKeySet|null} [keySet] PartitionReadRequest keySet - * @property {google.spanner.v1.IPartitionOptions|null} [partitionOptions] PartitionReadRequest partitionOptions - */ - - /** - * Constructs a new PartitionReadRequest. - * @memberof google.spanner.v1 - * @classdesc Represents a PartitionReadRequest. - * @implements IPartitionReadRequest - * @constructor - * @param {google.spanner.v1.IPartitionReadRequest=} [properties] Properties to set - */ - function PartitionReadRequest(properties) { - this.columns = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PartitionReadRequest session. - * @member {string} session - * @memberof google.spanner.v1.PartitionReadRequest - * @instance - */ - PartitionReadRequest.prototype.session = ""; - - /** - * PartitionReadRequest transaction. - * @member {google.spanner.v1.ITransactionSelector|null|undefined} transaction - * @memberof google.spanner.v1.PartitionReadRequest - * @instance - */ - PartitionReadRequest.prototype.transaction = null; - - /** - * PartitionReadRequest table. - * @member {string} table - * @memberof google.spanner.v1.PartitionReadRequest - * @instance - */ - PartitionReadRequest.prototype.table = ""; - - /** - * PartitionReadRequest index. - * @member {string} index - * @memberof google.spanner.v1.PartitionReadRequest - * @instance - */ - PartitionReadRequest.prototype.index = ""; - - /** - * PartitionReadRequest columns. - * @member {Array.} columns - * @memberof google.spanner.v1.PartitionReadRequest - * @instance - */ - PartitionReadRequest.prototype.columns = $util.emptyArray; - - /** - * PartitionReadRequest keySet. - * @member {google.spanner.v1.IKeySet|null|undefined} keySet - * @memberof google.spanner.v1.PartitionReadRequest - * @instance - */ - PartitionReadRequest.prototype.keySet = null; - - /** - * PartitionReadRequest partitionOptions. - * @member {google.spanner.v1.IPartitionOptions|null|undefined} partitionOptions - * @memberof google.spanner.v1.PartitionReadRequest - * @instance - */ - PartitionReadRequest.prototype.partitionOptions = null; - - /** - * Creates a new PartitionReadRequest instance using the specified properties. - * @function create - * @memberof google.spanner.v1.PartitionReadRequest - * @static - * @param {google.spanner.v1.IPartitionReadRequest=} [properties] Properties to set - * @returns {google.spanner.v1.PartitionReadRequest} PartitionReadRequest instance - */ - PartitionReadRequest.create = function create(properties) { - return new PartitionReadRequest(properties); - }; - - /** - * Encodes the specified PartitionReadRequest message. Does not implicitly {@link google.spanner.v1.PartitionReadRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.PartitionReadRequest - * @static - * @param {google.spanner.v1.IPartitionReadRequest} message PartitionReadRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PartitionReadRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.session != null && Object.hasOwnProperty.call(message, "session")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.session); - if (message.transaction != null && Object.hasOwnProperty.call(message, "transaction")) - $root.google.spanner.v1.TransactionSelector.encode(message.transaction, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.table != null && Object.hasOwnProperty.call(message, "table")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.table); - if (message.index != null && Object.hasOwnProperty.call(message, "index")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.index); - if (message.columns != null && message.columns.length) - for (var i = 0; i < message.columns.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.columns[i]); - if (message.keySet != null && Object.hasOwnProperty.call(message, "keySet")) - $root.google.spanner.v1.KeySet.encode(message.keySet, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.partitionOptions != null && Object.hasOwnProperty.call(message, "partitionOptions")) - $root.google.spanner.v1.PartitionOptions.encode(message.partitionOptions, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified PartitionReadRequest message, length delimited. Does not implicitly {@link google.spanner.v1.PartitionReadRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.PartitionReadRequest - * @static - * @param {google.spanner.v1.IPartitionReadRequest} message PartitionReadRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PartitionReadRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PartitionReadRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.PartitionReadRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.PartitionReadRequest} PartitionReadRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PartitionReadRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.PartitionReadRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.session = reader.string(); - break; - } - case 2: { - message.transaction = $root.google.spanner.v1.TransactionSelector.decode(reader, reader.uint32()); - break; - } - case 3: { - message.table = reader.string(); - break; - } - case 4: { - message.index = reader.string(); - break; - } - case 5: { - if (!(message.columns && message.columns.length)) - message.columns = []; - message.columns.push(reader.string()); - break; - } - case 6: { - message.keySet = $root.google.spanner.v1.KeySet.decode(reader, reader.uint32()); - break; - } - case 9: { - message.partitionOptions = $root.google.spanner.v1.PartitionOptions.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PartitionReadRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.PartitionReadRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.PartitionReadRequest} PartitionReadRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PartitionReadRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PartitionReadRequest message. - * @function verify - * @memberof google.spanner.v1.PartitionReadRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PartitionReadRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.session != null && message.hasOwnProperty("session")) - if (!$util.isString(message.session)) - return "session: string expected"; - if (message.transaction != null && message.hasOwnProperty("transaction")) { - var error = $root.google.spanner.v1.TransactionSelector.verify(message.transaction); - if (error) - return "transaction." + error; - } - if (message.table != null && message.hasOwnProperty("table")) - if (!$util.isString(message.table)) - return "table: string expected"; - if (message.index != null && message.hasOwnProperty("index")) - if (!$util.isString(message.index)) - return "index: string expected"; - if (message.columns != null && message.hasOwnProperty("columns")) { - if (!Array.isArray(message.columns)) - return "columns: array expected"; - for (var i = 0; i < message.columns.length; ++i) - if (!$util.isString(message.columns[i])) - return "columns: string[] expected"; - } - if (message.keySet != null && message.hasOwnProperty("keySet")) { - var error = $root.google.spanner.v1.KeySet.verify(message.keySet); - if (error) - return "keySet." + error; - } - if (message.partitionOptions != null && message.hasOwnProperty("partitionOptions")) { - var error = $root.google.spanner.v1.PartitionOptions.verify(message.partitionOptions); - if (error) - return "partitionOptions." + error; - } - return null; - }; - - /** - * Creates a PartitionReadRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.PartitionReadRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.PartitionReadRequest} PartitionReadRequest - */ - PartitionReadRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.PartitionReadRequest) - return object; - var message = new $root.google.spanner.v1.PartitionReadRequest(); - if (object.session != null) - message.session = String(object.session); - if (object.transaction != null) { - if (typeof object.transaction !== "object") - throw TypeError(".google.spanner.v1.PartitionReadRequest.transaction: object expected"); - message.transaction = $root.google.spanner.v1.TransactionSelector.fromObject(object.transaction); - } - if (object.table != null) - message.table = String(object.table); - if (object.index != null) - message.index = String(object.index); - if (object.columns) { - if (!Array.isArray(object.columns)) - throw TypeError(".google.spanner.v1.PartitionReadRequest.columns: array expected"); - message.columns = []; - for (var i = 0; i < object.columns.length; ++i) - message.columns[i] = String(object.columns[i]); - } - if (object.keySet != null) { - if (typeof object.keySet !== "object") - throw TypeError(".google.spanner.v1.PartitionReadRequest.keySet: object expected"); - message.keySet = $root.google.spanner.v1.KeySet.fromObject(object.keySet); - } - if (object.partitionOptions != null) { - if (typeof object.partitionOptions !== "object") - throw TypeError(".google.spanner.v1.PartitionReadRequest.partitionOptions: object expected"); - message.partitionOptions = $root.google.spanner.v1.PartitionOptions.fromObject(object.partitionOptions); - } - return message; - }; - - /** - * Creates a plain object from a PartitionReadRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.PartitionReadRequest - * @static - * @param {google.spanner.v1.PartitionReadRequest} message PartitionReadRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PartitionReadRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.columns = []; - if (options.defaults) { - object.session = ""; - object.transaction = null; - object.table = ""; - object.index = ""; - object.keySet = null; - object.partitionOptions = null; - } - if (message.session != null && message.hasOwnProperty("session")) - object.session = message.session; - if (message.transaction != null && message.hasOwnProperty("transaction")) - object.transaction = $root.google.spanner.v1.TransactionSelector.toObject(message.transaction, options); - if (message.table != null && message.hasOwnProperty("table")) - object.table = message.table; - if (message.index != null && message.hasOwnProperty("index")) - object.index = message.index; - if (message.columns && message.columns.length) { - object.columns = []; - for (var j = 0; j < message.columns.length; ++j) - object.columns[j] = message.columns[j]; - } - if (message.keySet != null && message.hasOwnProperty("keySet")) - object.keySet = $root.google.spanner.v1.KeySet.toObject(message.keySet, options); - if (message.partitionOptions != null && message.hasOwnProperty("partitionOptions")) - object.partitionOptions = $root.google.spanner.v1.PartitionOptions.toObject(message.partitionOptions, options); - return object; - }; - - /** - * Converts this PartitionReadRequest to JSON. - * @function toJSON - * @memberof google.spanner.v1.PartitionReadRequest - * @instance - * @returns {Object.} JSON object - */ - PartitionReadRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PartitionReadRequest - * @function getTypeUrl - * @memberof google.spanner.v1.PartitionReadRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PartitionReadRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.PartitionReadRequest"; - }; - - return PartitionReadRequest; - })(); - - v1.Partition = (function() { - - /** - * Properties of a Partition. - * @memberof google.spanner.v1 - * @interface IPartition - * @property {Uint8Array|null} [partitionToken] Partition partitionToken - */ - - /** - * Constructs a new Partition. - * @memberof google.spanner.v1 - * @classdesc Represents a Partition. - * @implements IPartition - * @constructor - * @param {google.spanner.v1.IPartition=} [properties] Properties to set - */ - function Partition(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Partition partitionToken. - * @member {Uint8Array} partitionToken - * @memberof google.spanner.v1.Partition - * @instance - */ - Partition.prototype.partitionToken = $util.newBuffer([]); - - /** - * Creates a new Partition instance using the specified properties. - * @function create - * @memberof google.spanner.v1.Partition - * @static - * @param {google.spanner.v1.IPartition=} [properties] Properties to set - * @returns {google.spanner.v1.Partition} Partition instance - */ - Partition.create = function create(properties) { - return new Partition(properties); - }; - - /** - * Encodes the specified Partition message. Does not implicitly {@link google.spanner.v1.Partition.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.Partition - * @static - * @param {google.spanner.v1.IPartition} message Partition message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Partition.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.partitionToken != null && Object.hasOwnProperty.call(message, "partitionToken")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.partitionToken); - return writer; - }; - - /** - * Encodes the specified Partition message, length delimited. Does not implicitly {@link google.spanner.v1.Partition.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.Partition - * @static - * @param {google.spanner.v1.IPartition} message Partition message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Partition.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Partition message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.Partition - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.Partition} Partition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Partition.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.Partition(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.partitionToken = reader.bytes(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Partition message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.Partition - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.Partition} Partition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Partition.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Partition message. - * @function verify - * @memberof google.spanner.v1.Partition - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Partition.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.partitionToken != null && message.hasOwnProperty("partitionToken")) - if (!(message.partitionToken && typeof message.partitionToken.length === "number" || $util.isString(message.partitionToken))) - return "partitionToken: buffer expected"; - return null; - }; - - /** - * Creates a Partition message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.Partition - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.Partition} Partition - */ - Partition.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.Partition) - return object; - var message = new $root.google.spanner.v1.Partition(); - if (object.partitionToken != null) - if (typeof object.partitionToken === "string") - $util.base64.decode(object.partitionToken, message.partitionToken = $util.newBuffer($util.base64.length(object.partitionToken)), 0); - else if (object.partitionToken.length >= 0) - message.partitionToken = object.partitionToken; - return message; - }; - - /** - * Creates a plain object from a Partition message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.Partition - * @static - * @param {google.spanner.v1.Partition} message Partition - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Partition.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - if (options.bytes === String) - object.partitionToken = ""; - else { - object.partitionToken = []; - if (options.bytes !== Array) - object.partitionToken = $util.newBuffer(object.partitionToken); - } - if (message.partitionToken != null && message.hasOwnProperty("partitionToken")) - object.partitionToken = options.bytes === String ? $util.base64.encode(message.partitionToken, 0, message.partitionToken.length) : options.bytes === Array ? Array.prototype.slice.call(message.partitionToken) : message.partitionToken; - return object; - }; - - /** - * Converts this Partition to JSON. - * @function toJSON - * @memberof google.spanner.v1.Partition - * @instance - * @returns {Object.} JSON object - */ - Partition.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Partition - * @function getTypeUrl - * @memberof google.spanner.v1.Partition - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Partition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.Partition"; - }; - - return Partition; - })(); - - v1.PartitionResponse = (function() { - - /** - * Properties of a PartitionResponse. - * @memberof google.spanner.v1 - * @interface IPartitionResponse - * @property {Array.|null} [partitions] PartitionResponse partitions - * @property {google.spanner.v1.ITransaction|null} [transaction] PartitionResponse transaction - */ - - /** - * Constructs a new PartitionResponse. - * @memberof google.spanner.v1 - * @classdesc Represents a PartitionResponse. - * @implements IPartitionResponse - * @constructor - * @param {google.spanner.v1.IPartitionResponse=} [properties] Properties to set - */ - function PartitionResponse(properties) { - this.partitions = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PartitionResponse partitions. - * @member {Array.} partitions - * @memberof google.spanner.v1.PartitionResponse - * @instance - */ - PartitionResponse.prototype.partitions = $util.emptyArray; - - /** - * PartitionResponse transaction. - * @member {google.spanner.v1.ITransaction|null|undefined} transaction - * @memberof google.spanner.v1.PartitionResponse - * @instance - */ - PartitionResponse.prototype.transaction = null; - - /** - * Creates a new PartitionResponse instance using the specified properties. - * @function create - * @memberof google.spanner.v1.PartitionResponse - * @static - * @param {google.spanner.v1.IPartitionResponse=} [properties] Properties to set - * @returns {google.spanner.v1.PartitionResponse} PartitionResponse instance - */ - PartitionResponse.create = function create(properties) { - return new PartitionResponse(properties); - }; - - /** - * Encodes the specified PartitionResponse message. Does not implicitly {@link google.spanner.v1.PartitionResponse.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.PartitionResponse - * @static - * @param {google.spanner.v1.IPartitionResponse} message PartitionResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PartitionResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.partitions != null && message.partitions.length) - for (var i = 0; i < message.partitions.length; ++i) - $root.google.spanner.v1.Partition.encode(message.partitions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.transaction != null && Object.hasOwnProperty.call(message, "transaction")) - $root.google.spanner.v1.Transaction.encode(message.transaction, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified PartitionResponse message, length delimited. Does not implicitly {@link google.spanner.v1.PartitionResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.PartitionResponse - * @static - * @param {google.spanner.v1.IPartitionResponse} message PartitionResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PartitionResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PartitionResponse message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.PartitionResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.PartitionResponse} PartitionResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PartitionResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.PartitionResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.partitions && message.partitions.length)) - message.partitions = []; - message.partitions.push($root.google.spanner.v1.Partition.decode(reader, reader.uint32())); - break; - } - case 2: { - message.transaction = $root.google.spanner.v1.Transaction.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PartitionResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.PartitionResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.PartitionResponse} PartitionResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PartitionResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PartitionResponse message. - * @function verify - * @memberof google.spanner.v1.PartitionResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PartitionResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.partitions != null && message.hasOwnProperty("partitions")) { - if (!Array.isArray(message.partitions)) - return "partitions: array expected"; - for (var i = 0; i < message.partitions.length; ++i) { - var error = $root.google.spanner.v1.Partition.verify(message.partitions[i]); - if (error) - return "partitions." + error; - } - } - if (message.transaction != null && message.hasOwnProperty("transaction")) { - var error = $root.google.spanner.v1.Transaction.verify(message.transaction); - if (error) - return "transaction." + error; - } - return null; - }; - - /** - * Creates a PartitionResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.PartitionResponse - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.PartitionResponse} PartitionResponse - */ - PartitionResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.PartitionResponse) - return object; - var message = new $root.google.spanner.v1.PartitionResponse(); - if (object.partitions) { - if (!Array.isArray(object.partitions)) - throw TypeError(".google.spanner.v1.PartitionResponse.partitions: array expected"); - message.partitions = []; - for (var i = 0; i < object.partitions.length; ++i) { - if (typeof object.partitions[i] !== "object") - throw TypeError(".google.spanner.v1.PartitionResponse.partitions: object expected"); - message.partitions[i] = $root.google.spanner.v1.Partition.fromObject(object.partitions[i]); - } - } - if (object.transaction != null) { - if (typeof object.transaction !== "object") - throw TypeError(".google.spanner.v1.PartitionResponse.transaction: object expected"); - message.transaction = $root.google.spanner.v1.Transaction.fromObject(object.transaction); - } - return message; - }; - - /** - * Creates a plain object from a PartitionResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.PartitionResponse - * @static - * @param {google.spanner.v1.PartitionResponse} message PartitionResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PartitionResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.partitions = []; - if (options.defaults) - object.transaction = null; - if (message.partitions && message.partitions.length) { - object.partitions = []; - for (var j = 0; j < message.partitions.length; ++j) - object.partitions[j] = $root.google.spanner.v1.Partition.toObject(message.partitions[j], options); - } - if (message.transaction != null && message.hasOwnProperty("transaction")) - object.transaction = $root.google.spanner.v1.Transaction.toObject(message.transaction, options); - return object; - }; - - /** - * Converts this PartitionResponse to JSON. - * @function toJSON - * @memberof google.spanner.v1.PartitionResponse - * @instance - * @returns {Object.} JSON object - */ - PartitionResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PartitionResponse - * @function getTypeUrl - * @memberof google.spanner.v1.PartitionResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PartitionResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.PartitionResponse"; - }; - - return PartitionResponse; - })(); - - v1.ReadRequest = (function() { - - /** - * Properties of a ReadRequest. - * @memberof google.spanner.v1 - * @interface IReadRequest - * @property {string|null} [session] ReadRequest session - * @property {google.spanner.v1.ITransactionSelector|null} [transaction] ReadRequest transaction - * @property {string|null} [table] ReadRequest table - * @property {string|null} [index] ReadRequest index - * @property {Array.|null} [columns] ReadRequest columns - * @property {google.spanner.v1.IKeySet|null} [keySet] ReadRequest keySet - * @property {number|Long|null} [limit] ReadRequest limit - * @property {Uint8Array|null} [resumeToken] ReadRequest resumeToken - * @property {Uint8Array|null} [partitionToken] ReadRequest partitionToken - * @property {google.spanner.v1.IRequestOptions|null} [requestOptions] ReadRequest requestOptions - * @property {google.spanner.v1.IDirectedReadOptions|null} [directedReadOptions] ReadRequest directedReadOptions - * @property {boolean|null} [dataBoostEnabled] ReadRequest dataBoostEnabled - * @property {google.spanner.v1.ReadRequest.OrderBy|null} [orderBy] ReadRequest orderBy - * @property {google.spanner.v1.ReadRequest.LockHint|null} [lockHint] ReadRequest lockHint - * @property {google.spanner.v1.IRoutingHint|null} [routingHint] ReadRequest routingHint - */ - - /** - * Constructs a new ReadRequest. - * @memberof google.spanner.v1 - * @classdesc Represents a ReadRequest. - * @implements IReadRequest - * @constructor - * @param {google.spanner.v1.IReadRequest=} [properties] Properties to set - */ - function ReadRequest(properties) { - this.columns = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ReadRequest session. - * @member {string} session - * @memberof google.spanner.v1.ReadRequest - * @instance - */ - ReadRequest.prototype.session = ""; - - /** - * ReadRequest transaction. - * @member {google.spanner.v1.ITransactionSelector|null|undefined} transaction - * @memberof google.spanner.v1.ReadRequest - * @instance - */ - ReadRequest.prototype.transaction = null; - - /** - * ReadRequest table. - * @member {string} table - * @memberof google.spanner.v1.ReadRequest - * @instance - */ - ReadRequest.prototype.table = ""; - - /** - * ReadRequest index. - * @member {string} index - * @memberof google.spanner.v1.ReadRequest - * @instance - */ - ReadRequest.prototype.index = ""; - - /** - * ReadRequest columns. - * @member {Array.} columns - * @memberof google.spanner.v1.ReadRequest - * @instance - */ - ReadRequest.prototype.columns = $util.emptyArray; - - /** - * ReadRequest keySet. - * @member {google.spanner.v1.IKeySet|null|undefined} keySet - * @memberof google.spanner.v1.ReadRequest - * @instance - */ - ReadRequest.prototype.keySet = null; - - /** - * ReadRequest limit. - * @member {number|Long} limit - * @memberof google.spanner.v1.ReadRequest - * @instance - */ - ReadRequest.prototype.limit = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * ReadRequest resumeToken. - * @member {Uint8Array} resumeToken - * @memberof google.spanner.v1.ReadRequest - * @instance - */ - ReadRequest.prototype.resumeToken = $util.newBuffer([]); - - /** - * ReadRequest partitionToken. - * @member {Uint8Array} partitionToken - * @memberof google.spanner.v1.ReadRequest - * @instance - */ - ReadRequest.prototype.partitionToken = $util.newBuffer([]); - - /** - * ReadRequest requestOptions. - * @member {google.spanner.v1.IRequestOptions|null|undefined} requestOptions - * @memberof google.spanner.v1.ReadRequest - * @instance - */ - ReadRequest.prototype.requestOptions = null; - - /** - * ReadRequest directedReadOptions. - * @member {google.spanner.v1.IDirectedReadOptions|null|undefined} directedReadOptions - * @memberof google.spanner.v1.ReadRequest - * @instance - */ - ReadRequest.prototype.directedReadOptions = null; - - /** - * ReadRequest dataBoostEnabled. - * @member {boolean} dataBoostEnabled - * @memberof google.spanner.v1.ReadRequest - * @instance - */ - ReadRequest.prototype.dataBoostEnabled = false; - - /** - * ReadRequest orderBy. - * @member {google.spanner.v1.ReadRequest.OrderBy} orderBy - * @memberof google.spanner.v1.ReadRequest - * @instance - */ - ReadRequest.prototype.orderBy = 0; - - /** - * ReadRequest lockHint. - * @member {google.spanner.v1.ReadRequest.LockHint} lockHint - * @memberof google.spanner.v1.ReadRequest - * @instance - */ - ReadRequest.prototype.lockHint = 0; - - /** - * ReadRequest routingHint. - * @member {google.spanner.v1.IRoutingHint|null|undefined} routingHint - * @memberof google.spanner.v1.ReadRequest - * @instance - */ - ReadRequest.prototype.routingHint = null; - - /** - * Creates a new ReadRequest instance using the specified properties. - * @function create - * @memberof google.spanner.v1.ReadRequest - * @static - * @param {google.spanner.v1.IReadRequest=} [properties] Properties to set - * @returns {google.spanner.v1.ReadRequest} ReadRequest instance - */ - ReadRequest.create = function create(properties) { - return new ReadRequest(properties); - }; - - /** - * Encodes the specified ReadRequest message. Does not implicitly {@link google.spanner.v1.ReadRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.ReadRequest - * @static - * @param {google.spanner.v1.IReadRequest} message ReadRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReadRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.session != null && Object.hasOwnProperty.call(message, "session")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.session); - if (message.transaction != null && Object.hasOwnProperty.call(message, "transaction")) - $root.google.spanner.v1.TransactionSelector.encode(message.transaction, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.table != null && Object.hasOwnProperty.call(message, "table")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.table); - if (message.index != null && Object.hasOwnProperty.call(message, "index")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.index); - if (message.columns != null && message.columns.length) - for (var i = 0; i < message.columns.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.columns[i]); - if (message.keySet != null && Object.hasOwnProperty.call(message, "keySet")) - $root.google.spanner.v1.KeySet.encode(message.keySet, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) - writer.uint32(/* id 8, wireType 0 =*/64).int64(message.limit); - if (message.resumeToken != null && Object.hasOwnProperty.call(message, "resumeToken")) - writer.uint32(/* id 9, wireType 2 =*/74).bytes(message.resumeToken); - if (message.partitionToken != null && Object.hasOwnProperty.call(message, "partitionToken")) - writer.uint32(/* id 10, wireType 2 =*/82).bytes(message.partitionToken); - if (message.requestOptions != null && Object.hasOwnProperty.call(message, "requestOptions")) - $root.google.spanner.v1.RequestOptions.encode(message.requestOptions, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.directedReadOptions != null && Object.hasOwnProperty.call(message, "directedReadOptions")) - $root.google.spanner.v1.DirectedReadOptions.encode(message.directedReadOptions, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); - if (message.dataBoostEnabled != null && Object.hasOwnProperty.call(message, "dataBoostEnabled")) - writer.uint32(/* id 15, wireType 0 =*/120).bool(message.dataBoostEnabled); - if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) - writer.uint32(/* id 16, wireType 0 =*/128).int32(message.orderBy); - if (message.lockHint != null && Object.hasOwnProperty.call(message, "lockHint")) - writer.uint32(/* id 17, wireType 0 =*/136).int32(message.lockHint); - if (message.routingHint != null && Object.hasOwnProperty.call(message, "routingHint")) - $root.google.spanner.v1.RoutingHint.encode(message.routingHint, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ReadRequest message, length delimited. Does not implicitly {@link google.spanner.v1.ReadRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.ReadRequest - * @static - * @param {google.spanner.v1.IReadRequest} message ReadRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReadRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ReadRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.ReadRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.ReadRequest} ReadRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReadRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.ReadRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.session = reader.string(); - break; - } - case 2: { - message.transaction = $root.google.spanner.v1.TransactionSelector.decode(reader, reader.uint32()); - break; - } - case 3: { - message.table = reader.string(); - break; - } - case 4: { - message.index = reader.string(); - break; - } - case 5: { - if (!(message.columns && message.columns.length)) - message.columns = []; - message.columns.push(reader.string()); - break; - } - case 6: { - message.keySet = $root.google.spanner.v1.KeySet.decode(reader, reader.uint32()); - break; - } - case 8: { - message.limit = reader.int64(); - break; - } - case 9: { - message.resumeToken = reader.bytes(); - break; - } - case 10: { - message.partitionToken = reader.bytes(); - break; - } - case 11: { - message.requestOptions = $root.google.spanner.v1.RequestOptions.decode(reader, reader.uint32()); - break; - } - case 14: { - message.directedReadOptions = $root.google.spanner.v1.DirectedReadOptions.decode(reader, reader.uint32()); - break; - } - case 15: { - message.dataBoostEnabled = reader.bool(); - break; - } - case 16: { - message.orderBy = reader.int32(); - break; - } - case 17: { - message.lockHint = reader.int32(); - break; - } - case 18: { - message.routingHint = $root.google.spanner.v1.RoutingHint.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ReadRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.ReadRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.ReadRequest} ReadRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReadRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ReadRequest message. - * @function verify - * @memberof google.spanner.v1.ReadRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ReadRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.session != null && message.hasOwnProperty("session")) - if (!$util.isString(message.session)) - return "session: string expected"; - if (message.transaction != null && message.hasOwnProperty("transaction")) { - var error = $root.google.spanner.v1.TransactionSelector.verify(message.transaction); - if (error) - return "transaction." + error; - } - if (message.table != null && message.hasOwnProperty("table")) - if (!$util.isString(message.table)) - return "table: string expected"; - if (message.index != null && message.hasOwnProperty("index")) - if (!$util.isString(message.index)) - return "index: string expected"; - if (message.columns != null && message.hasOwnProperty("columns")) { - if (!Array.isArray(message.columns)) - return "columns: array expected"; - for (var i = 0; i < message.columns.length; ++i) - if (!$util.isString(message.columns[i])) - return "columns: string[] expected"; - } - if (message.keySet != null && message.hasOwnProperty("keySet")) { - var error = $root.google.spanner.v1.KeySet.verify(message.keySet); - if (error) - return "keySet." + error; - } - if (message.limit != null && message.hasOwnProperty("limit")) - if (!$util.isInteger(message.limit) && !(message.limit && $util.isInteger(message.limit.low) && $util.isInteger(message.limit.high))) - return "limit: integer|Long expected"; - if (message.resumeToken != null && message.hasOwnProperty("resumeToken")) - if (!(message.resumeToken && typeof message.resumeToken.length === "number" || $util.isString(message.resumeToken))) - return "resumeToken: buffer expected"; - if (message.partitionToken != null && message.hasOwnProperty("partitionToken")) - if (!(message.partitionToken && typeof message.partitionToken.length === "number" || $util.isString(message.partitionToken))) - return "partitionToken: buffer expected"; - if (message.requestOptions != null && message.hasOwnProperty("requestOptions")) { - var error = $root.google.spanner.v1.RequestOptions.verify(message.requestOptions); - if (error) - return "requestOptions." + error; - } - if (message.directedReadOptions != null && message.hasOwnProperty("directedReadOptions")) { - var error = $root.google.spanner.v1.DirectedReadOptions.verify(message.directedReadOptions); - if (error) - return "directedReadOptions." + error; - } - if (message.dataBoostEnabled != null && message.hasOwnProperty("dataBoostEnabled")) - if (typeof message.dataBoostEnabled !== "boolean") - return "dataBoostEnabled: boolean expected"; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - switch (message.orderBy) { - default: - return "orderBy: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.lockHint != null && message.hasOwnProperty("lockHint")) - switch (message.lockHint) { - default: - return "lockHint: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.routingHint != null && message.hasOwnProperty("routingHint")) { - var error = $root.google.spanner.v1.RoutingHint.verify(message.routingHint); - if (error) - return "routingHint." + error; - } - return null; - }; - - /** - * Creates a ReadRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.ReadRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.ReadRequest} ReadRequest - */ - ReadRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.ReadRequest) - return object; - var message = new $root.google.spanner.v1.ReadRequest(); - if (object.session != null) - message.session = String(object.session); - if (object.transaction != null) { - if (typeof object.transaction !== "object") - throw TypeError(".google.spanner.v1.ReadRequest.transaction: object expected"); - message.transaction = $root.google.spanner.v1.TransactionSelector.fromObject(object.transaction); - } - if (object.table != null) - message.table = String(object.table); - if (object.index != null) - message.index = String(object.index); - if (object.columns) { - if (!Array.isArray(object.columns)) - throw TypeError(".google.spanner.v1.ReadRequest.columns: array expected"); - message.columns = []; - for (var i = 0; i < object.columns.length; ++i) - message.columns[i] = String(object.columns[i]); - } - if (object.keySet != null) { - if (typeof object.keySet !== "object") - throw TypeError(".google.spanner.v1.ReadRequest.keySet: object expected"); - message.keySet = $root.google.spanner.v1.KeySet.fromObject(object.keySet); - } - if (object.limit != null) - if ($util.Long) - (message.limit = $util.Long.fromValue(object.limit)).unsigned = false; - else if (typeof object.limit === "string") - message.limit = parseInt(object.limit, 10); - else if (typeof object.limit === "number") - message.limit = object.limit; - else if (typeof object.limit === "object") - message.limit = new $util.LongBits(object.limit.low >>> 0, object.limit.high >>> 0).toNumber(); - if (object.resumeToken != null) - if (typeof object.resumeToken === "string") - $util.base64.decode(object.resumeToken, message.resumeToken = $util.newBuffer($util.base64.length(object.resumeToken)), 0); - else if (object.resumeToken.length >= 0) - message.resumeToken = object.resumeToken; - if (object.partitionToken != null) - if (typeof object.partitionToken === "string") - $util.base64.decode(object.partitionToken, message.partitionToken = $util.newBuffer($util.base64.length(object.partitionToken)), 0); - else if (object.partitionToken.length >= 0) - message.partitionToken = object.partitionToken; - if (object.requestOptions != null) { - if (typeof object.requestOptions !== "object") - throw TypeError(".google.spanner.v1.ReadRequest.requestOptions: object expected"); - message.requestOptions = $root.google.spanner.v1.RequestOptions.fromObject(object.requestOptions); - } - if (object.directedReadOptions != null) { - if (typeof object.directedReadOptions !== "object") - throw TypeError(".google.spanner.v1.ReadRequest.directedReadOptions: object expected"); - message.directedReadOptions = $root.google.spanner.v1.DirectedReadOptions.fromObject(object.directedReadOptions); - } - if (object.dataBoostEnabled != null) - message.dataBoostEnabled = Boolean(object.dataBoostEnabled); - switch (object.orderBy) { - default: - if (typeof object.orderBy === "number") { - message.orderBy = object.orderBy; - break; - } - break; - case "ORDER_BY_UNSPECIFIED": - case 0: - message.orderBy = 0; - break; - case "ORDER_BY_PRIMARY_KEY": - case 1: - message.orderBy = 1; - break; - case "ORDER_BY_NO_ORDER": - case 2: - message.orderBy = 2; - break; - } - switch (object.lockHint) { - default: - if (typeof object.lockHint === "number") { - message.lockHint = object.lockHint; - break; - } - break; - case "LOCK_HINT_UNSPECIFIED": - case 0: - message.lockHint = 0; - break; - case "LOCK_HINT_SHARED": - case 1: - message.lockHint = 1; - break; - case "LOCK_HINT_EXCLUSIVE": - case 2: - message.lockHint = 2; - break; - } - if (object.routingHint != null) { - if (typeof object.routingHint !== "object") - throw TypeError(".google.spanner.v1.ReadRequest.routingHint: object expected"); - message.routingHint = $root.google.spanner.v1.RoutingHint.fromObject(object.routingHint); - } - return message; - }; - - /** - * Creates a plain object from a ReadRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.ReadRequest - * @static - * @param {google.spanner.v1.ReadRequest} message ReadRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ReadRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.columns = []; - if (options.defaults) { - object.session = ""; - object.transaction = null; - object.table = ""; - object.index = ""; - object.keySet = null; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.limit = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.limit = options.longs === String ? "0" : 0; - if (options.bytes === String) - object.resumeToken = ""; - else { - object.resumeToken = []; - if (options.bytes !== Array) - object.resumeToken = $util.newBuffer(object.resumeToken); - } - if (options.bytes === String) - object.partitionToken = ""; - else { - object.partitionToken = []; - if (options.bytes !== Array) - object.partitionToken = $util.newBuffer(object.partitionToken); - } - object.requestOptions = null; - object.directedReadOptions = null; - object.dataBoostEnabled = false; - object.orderBy = options.enums === String ? "ORDER_BY_UNSPECIFIED" : 0; - object.lockHint = options.enums === String ? "LOCK_HINT_UNSPECIFIED" : 0; - object.routingHint = null; - } - if (message.session != null && message.hasOwnProperty("session")) - object.session = message.session; - if (message.transaction != null && message.hasOwnProperty("transaction")) - object.transaction = $root.google.spanner.v1.TransactionSelector.toObject(message.transaction, options); - if (message.table != null && message.hasOwnProperty("table")) - object.table = message.table; - if (message.index != null && message.hasOwnProperty("index")) - object.index = message.index; - if (message.columns && message.columns.length) { - object.columns = []; - for (var j = 0; j < message.columns.length; ++j) - object.columns[j] = message.columns[j]; - } - if (message.keySet != null && message.hasOwnProperty("keySet")) - object.keySet = $root.google.spanner.v1.KeySet.toObject(message.keySet, options); - if (message.limit != null && message.hasOwnProperty("limit")) - if (typeof message.limit === "number") - object.limit = options.longs === String ? String(message.limit) : message.limit; - else - object.limit = options.longs === String ? $util.Long.prototype.toString.call(message.limit) : options.longs === Number ? new $util.LongBits(message.limit.low >>> 0, message.limit.high >>> 0).toNumber() : message.limit; - if (message.resumeToken != null && message.hasOwnProperty("resumeToken")) - object.resumeToken = options.bytes === String ? $util.base64.encode(message.resumeToken, 0, message.resumeToken.length) : options.bytes === Array ? Array.prototype.slice.call(message.resumeToken) : message.resumeToken; - if (message.partitionToken != null && message.hasOwnProperty("partitionToken")) - object.partitionToken = options.bytes === String ? $util.base64.encode(message.partitionToken, 0, message.partitionToken.length) : options.bytes === Array ? Array.prototype.slice.call(message.partitionToken) : message.partitionToken; - if (message.requestOptions != null && message.hasOwnProperty("requestOptions")) - object.requestOptions = $root.google.spanner.v1.RequestOptions.toObject(message.requestOptions, options); - if (message.directedReadOptions != null && message.hasOwnProperty("directedReadOptions")) - object.directedReadOptions = $root.google.spanner.v1.DirectedReadOptions.toObject(message.directedReadOptions, options); - if (message.dataBoostEnabled != null && message.hasOwnProperty("dataBoostEnabled")) - object.dataBoostEnabled = message.dataBoostEnabled; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - object.orderBy = options.enums === String ? $root.google.spanner.v1.ReadRequest.OrderBy[message.orderBy] === undefined ? message.orderBy : $root.google.spanner.v1.ReadRequest.OrderBy[message.orderBy] : message.orderBy; - if (message.lockHint != null && message.hasOwnProperty("lockHint")) - object.lockHint = options.enums === String ? $root.google.spanner.v1.ReadRequest.LockHint[message.lockHint] === undefined ? message.lockHint : $root.google.spanner.v1.ReadRequest.LockHint[message.lockHint] : message.lockHint; - if (message.routingHint != null && message.hasOwnProperty("routingHint")) - object.routingHint = $root.google.spanner.v1.RoutingHint.toObject(message.routingHint, options); - return object; - }; - - /** - * Converts this ReadRequest to JSON. - * @function toJSON - * @memberof google.spanner.v1.ReadRequest - * @instance - * @returns {Object.} JSON object - */ - ReadRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ReadRequest - * @function getTypeUrl - * @memberof google.spanner.v1.ReadRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ReadRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.ReadRequest"; - }; - - /** - * OrderBy enum. - * @name google.spanner.v1.ReadRequest.OrderBy - * @enum {number} - * @property {number} ORDER_BY_UNSPECIFIED=0 ORDER_BY_UNSPECIFIED value - * @property {number} ORDER_BY_PRIMARY_KEY=1 ORDER_BY_PRIMARY_KEY value - * @property {number} ORDER_BY_NO_ORDER=2 ORDER_BY_NO_ORDER value - */ - ReadRequest.OrderBy = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ORDER_BY_UNSPECIFIED"] = 0; - values[valuesById[1] = "ORDER_BY_PRIMARY_KEY"] = 1; - values[valuesById[2] = "ORDER_BY_NO_ORDER"] = 2; - return values; - })(); - - /** - * LockHint enum. - * @name google.spanner.v1.ReadRequest.LockHint - * @enum {number} - * @property {number} LOCK_HINT_UNSPECIFIED=0 LOCK_HINT_UNSPECIFIED value - * @property {number} LOCK_HINT_SHARED=1 LOCK_HINT_SHARED value - * @property {number} LOCK_HINT_EXCLUSIVE=2 LOCK_HINT_EXCLUSIVE value - */ - ReadRequest.LockHint = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "LOCK_HINT_UNSPECIFIED"] = 0; - values[valuesById[1] = "LOCK_HINT_SHARED"] = 1; - values[valuesById[2] = "LOCK_HINT_EXCLUSIVE"] = 2; - return values; - })(); - - return ReadRequest; - })(); - - v1.BeginTransactionRequest = (function() { - - /** - * Properties of a BeginTransactionRequest. - * @memberof google.spanner.v1 - * @interface IBeginTransactionRequest - * @property {string|null} [session] BeginTransactionRequest session - * @property {google.spanner.v1.ITransactionOptions|null} [options] BeginTransactionRequest options - * @property {google.spanner.v1.IRequestOptions|null} [requestOptions] BeginTransactionRequest requestOptions - * @property {google.spanner.v1.IMutation|null} [mutationKey] BeginTransactionRequest mutationKey - */ - - /** - * Constructs a new BeginTransactionRequest. - * @memberof google.spanner.v1 - * @classdesc Represents a BeginTransactionRequest. - * @implements IBeginTransactionRequest - * @constructor - * @param {google.spanner.v1.IBeginTransactionRequest=} [properties] Properties to set - */ - function BeginTransactionRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BeginTransactionRequest session. - * @member {string} session - * @memberof google.spanner.v1.BeginTransactionRequest - * @instance - */ - BeginTransactionRequest.prototype.session = ""; - - /** - * BeginTransactionRequest options. - * @member {google.spanner.v1.ITransactionOptions|null|undefined} options - * @memberof google.spanner.v1.BeginTransactionRequest - * @instance - */ - BeginTransactionRequest.prototype.options = null; - - /** - * BeginTransactionRequest requestOptions. - * @member {google.spanner.v1.IRequestOptions|null|undefined} requestOptions - * @memberof google.spanner.v1.BeginTransactionRequest - * @instance - */ - BeginTransactionRequest.prototype.requestOptions = null; - - /** - * BeginTransactionRequest mutationKey. - * @member {google.spanner.v1.IMutation|null|undefined} mutationKey - * @memberof google.spanner.v1.BeginTransactionRequest - * @instance - */ - BeginTransactionRequest.prototype.mutationKey = null; - - /** - * Creates a new BeginTransactionRequest instance using the specified properties. - * @function create - * @memberof google.spanner.v1.BeginTransactionRequest - * @static - * @param {google.spanner.v1.IBeginTransactionRequest=} [properties] Properties to set - * @returns {google.spanner.v1.BeginTransactionRequest} BeginTransactionRequest instance - */ - BeginTransactionRequest.create = function create(properties) { - return new BeginTransactionRequest(properties); - }; - - /** - * Encodes the specified BeginTransactionRequest message. Does not implicitly {@link google.spanner.v1.BeginTransactionRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.BeginTransactionRequest - * @static - * @param {google.spanner.v1.IBeginTransactionRequest} message BeginTransactionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BeginTransactionRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.session != null && Object.hasOwnProperty.call(message, "session")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.session); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.spanner.v1.TransactionOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.requestOptions != null && Object.hasOwnProperty.call(message, "requestOptions")) - $root.google.spanner.v1.RequestOptions.encode(message.requestOptions, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.mutationKey != null && Object.hasOwnProperty.call(message, "mutationKey")) - $root.google.spanner.v1.Mutation.encode(message.mutationKey, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified BeginTransactionRequest message, length delimited. Does not implicitly {@link google.spanner.v1.BeginTransactionRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.BeginTransactionRequest - * @static - * @param {google.spanner.v1.IBeginTransactionRequest} message BeginTransactionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BeginTransactionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BeginTransactionRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.BeginTransactionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.BeginTransactionRequest} BeginTransactionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BeginTransactionRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.BeginTransactionRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.session = reader.string(); - break; - } - case 2: { - message.options = $root.google.spanner.v1.TransactionOptions.decode(reader, reader.uint32()); - break; - } - case 3: { - message.requestOptions = $root.google.spanner.v1.RequestOptions.decode(reader, reader.uint32()); - break; - } - case 4: { - message.mutationKey = $root.google.spanner.v1.Mutation.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BeginTransactionRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.BeginTransactionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.BeginTransactionRequest} BeginTransactionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BeginTransactionRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BeginTransactionRequest message. - * @function verify - * @memberof google.spanner.v1.BeginTransactionRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BeginTransactionRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.session != null && message.hasOwnProperty("session")) - if (!$util.isString(message.session)) - return "session: string expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.spanner.v1.TransactionOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.requestOptions != null && message.hasOwnProperty("requestOptions")) { - var error = $root.google.spanner.v1.RequestOptions.verify(message.requestOptions); - if (error) - return "requestOptions." + error; - } - if (message.mutationKey != null && message.hasOwnProperty("mutationKey")) { - var error = $root.google.spanner.v1.Mutation.verify(message.mutationKey); - if (error) - return "mutationKey." + error; - } - return null; - }; - - /** - * Creates a BeginTransactionRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.BeginTransactionRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.BeginTransactionRequest} BeginTransactionRequest - */ - BeginTransactionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.BeginTransactionRequest) - return object; - var message = new $root.google.spanner.v1.BeginTransactionRequest(); - if (object.session != null) - message.session = String(object.session); - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.spanner.v1.BeginTransactionRequest.options: object expected"); - message.options = $root.google.spanner.v1.TransactionOptions.fromObject(object.options); - } - if (object.requestOptions != null) { - if (typeof object.requestOptions !== "object") - throw TypeError(".google.spanner.v1.BeginTransactionRequest.requestOptions: object expected"); - message.requestOptions = $root.google.spanner.v1.RequestOptions.fromObject(object.requestOptions); - } - if (object.mutationKey != null) { - if (typeof object.mutationKey !== "object") - throw TypeError(".google.spanner.v1.BeginTransactionRequest.mutationKey: object expected"); - message.mutationKey = $root.google.spanner.v1.Mutation.fromObject(object.mutationKey); - } - return message; - }; - - /** - * Creates a plain object from a BeginTransactionRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.BeginTransactionRequest - * @static - * @param {google.spanner.v1.BeginTransactionRequest} message BeginTransactionRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BeginTransactionRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.session = ""; - object.options = null; - object.requestOptions = null; - object.mutationKey = null; - } - if (message.session != null && message.hasOwnProperty("session")) - object.session = message.session; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.spanner.v1.TransactionOptions.toObject(message.options, options); - if (message.requestOptions != null && message.hasOwnProperty("requestOptions")) - object.requestOptions = $root.google.spanner.v1.RequestOptions.toObject(message.requestOptions, options); - if (message.mutationKey != null && message.hasOwnProperty("mutationKey")) - object.mutationKey = $root.google.spanner.v1.Mutation.toObject(message.mutationKey, options); - return object; - }; - - /** - * Converts this BeginTransactionRequest to JSON. - * @function toJSON - * @memberof google.spanner.v1.BeginTransactionRequest - * @instance - * @returns {Object.} JSON object - */ - BeginTransactionRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BeginTransactionRequest - * @function getTypeUrl - * @memberof google.spanner.v1.BeginTransactionRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BeginTransactionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.BeginTransactionRequest"; - }; - - return BeginTransactionRequest; - })(); - - v1.CommitRequest = (function() { - - /** - * Properties of a CommitRequest. - * @memberof google.spanner.v1 - * @interface ICommitRequest - * @property {string|null} [session] CommitRequest session - * @property {Uint8Array|null} [transactionId] CommitRequest transactionId - * @property {google.spanner.v1.ITransactionOptions|null} [singleUseTransaction] CommitRequest singleUseTransaction - * @property {Array.|null} [mutations] CommitRequest mutations - * @property {boolean|null} [returnCommitStats] CommitRequest returnCommitStats - * @property {google.protobuf.IDuration|null} [maxCommitDelay] CommitRequest maxCommitDelay - * @property {google.spanner.v1.IRequestOptions|null} [requestOptions] CommitRequest requestOptions - * @property {google.spanner.v1.IMultiplexedSessionPrecommitToken|null} [precommitToken] CommitRequest precommitToken - */ - - /** - * Constructs a new CommitRequest. - * @memberof google.spanner.v1 - * @classdesc Represents a CommitRequest. - * @implements ICommitRequest - * @constructor - * @param {google.spanner.v1.ICommitRequest=} [properties] Properties to set - */ - function CommitRequest(properties) { - this.mutations = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CommitRequest session. - * @member {string} session - * @memberof google.spanner.v1.CommitRequest - * @instance - */ - CommitRequest.prototype.session = ""; - - /** - * CommitRequest transactionId. - * @member {Uint8Array|null|undefined} transactionId - * @memberof google.spanner.v1.CommitRequest - * @instance - */ - CommitRequest.prototype.transactionId = null; - - /** - * CommitRequest singleUseTransaction. - * @member {google.spanner.v1.ITransactionOptions|null|undefined} singleUseTransaction - * @memberof google.spanner.v1.CommitRequest - * @instance - */ - CommitRequest.prototype.singleUseTransaction = null; - - /** - * CommitRequest mutations. - * @member {Array.} mutations - * @memberof google.spanner.v1.CommitRequest - * @instance - */ - CommitRequest.prototype.mutations = $util.emptyArray; - - /** - * CommitRequest returnCommitStats. - * @member {boolean} returnCommitStats - * @memberof google.spanner.v1.CommitRequest - * @instance - */ - CommitRequest.prototype.returnCommitStats = false; - - /** - * CommitRequest maxCommitDelay. - * @member {google.protobuf.IDuration|null|undefined} maxCommitDelay - * @memberof google.spanner.v1.CommitRequest - * @instance - */ - CommitRequest.prototype.maxCommitDelay = null; - - /** - * CommitRequest requestOptions. - * @member {google.spanner.v1.IRequestOptions|null|undefined} requestOptions - * @memberof google.spanner.v1.CommitRequest - * @instance - */ - CommitRequest.prototype.requestOptions = null; - - /** - * CommitRequest precommitToken. - * @member {google.spanner.v1.IMultiplexedSessionPrecommitToken|null|undefined} precommitToken - * @memberof google.spanner.v1.CommitRequest - * @instance - */ - CommitRequest.prototype.precommitToken = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * CommitRequest transaction. - * @member {"transactionId"|"singleUseTransaction"|undefined} transaction - * @memberof google.spanner.v1.CommitRequest - * @instance - */ - Object.defineProperty(CommitRequest.prototype, "transaction", { - get: $util.oneOfGetter($oneOfFields = ["transactionId", "singleUseTransaction"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new CommitRequest instance using the specified properties. - * @function create - * @memberof google.spanner.v1.CommitRequest - * @static - * @param {google.spanner.v1.ICommitRequest=} [properties] Properties to set - * @returns {google.spanner.v1.CommitRequest} CommitRequest instance - */ - CommitRequest.create = function create(properties) { - return new CommitRequest(properties); - }; - - /** - * Encodes the specified CommitRequest message. Does not implicitly {@link google.spanner.v1.CommitRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.CommitRequest - * @static - * @param {google.spanner.v1.ICommitRequest} message CommitRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CommitRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.session != null && Object.hasOwnProperty.call(message, "session")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.session); - if (message.transactionId != null && Object.hasOwnProperty.call(message, "transactionId")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.transactionId); - if (message.singleUseTransaction != null && Object.hasOwnProperty.call(message, "singleUseTransaction")) - $root.google.spanner.v1.TransactionOptions.encode(message.singleUseTransaction, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.mutations != null && message.mutations.length) - for (var i = 0; i < message.mutations.length; ++i) - $root.google.spanner.v1.Mutation.encode(message.mutations[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.returnCommitStats != null && Object.hasOwnProperty.call(message, "returnCommitStats")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.returnCommitStats); - if (message.requestOptions != null && Object.hasOwnProperty.call(message, "requestOptions")) - $root.google.spanner.v1.RequestOptions.encode(message.requestOptions, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.maxCommitDelay != null && Object.hasOwnProperty.call(message, "maxCommitDelay")) - $root.google.protobuf.Duration.encode(message.maxCommitDelay, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.precommitToken != null && Object.hasOwnProperty.call(message, "precommitToken")) - $root.google.spanner.v1.MultiplexedSessionPrecommitToken.encode(message.precommitToken, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CommitRequest message, length delimited. Does not implicitly {@link google.spanner.v1.CommitRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.CommitRequest - * @static - * @param {google.spanner.v1.ICommitRequest} message CommitRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CommitRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CommitRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.CommitRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.CommitRequest} CommitRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CommitRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.CommitRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.session = reader.string(); - break; - } - case 2: { - message.transactionId = reader.bytes(); - break; - } - case 3: { - message.singleUseTransaction = $root.google.spanner.v1.TransactionOptions.decode(reader, reader.uint32()); - break; - } - case 4: { - if (!(message.mutations && message.mutations.length)) - message.mutations = []; - message.mutations.push($root.google.spanner.v1.Mutation.decode(reader, reader.uint32())); - break; - } - case 5: { - message.returnCommitStats = reader.bool(); - break; - } - case 8: { - message.maxCommitDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 6: { - message.requestOptions = $root.google.spanner.v1.RequestOptions.decode(reader, reader.uint32()); - break; - } - case 9: { - message.precommitToken = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CommitRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.CommitRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.CommitRequest} CommitRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CommitRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CommitRequest message. - * @function verify - * @memberof google.spanner.v1.CommitRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CommitRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.session != null && message.hasOwnProperty("session")) - if (!$util.isString(message.session)) - return "session: string expected"; - if (message.transactionId != null && message.hasOwnProperty("transactionId")) { - properties.transaction = 1; - if (!(message.transactionId && typeof message.transactionId.length === "number" || $util.isString(message.transactionId))) - return "transactionId: buffer expected"; - } - if (message.singleUseTransaction != null && message.hasOwnProperty("singleUseTransaction")) { - if (properties.transaction === 1) - return "transaction: multiple values"; - properties.transaction = 1; - { - var error = $root.google.spanner.v1.TransactionOptions.verify(message.singleUseTransaction); - if (error) - return "singleUseTransaction." + error; - } - } - if (message.mutations != null && message.hasOwnProperty("mutations")) { - if (!Array.isArray(message.mutations)) - return "mutations: array expected"; - for (var i = 0; i < message.mutations.length; ++i) { - var error = $root.google.spanner.v1.Mutation.verify(message.mutations[i]); - if (error) - return "mutations." + error; - } - } - if (message.returnCommitStats != null && message.hasOwnProperty("returnCommitStats")) - if (typeof message.returnCommitStats !== "boolean") - return "returnCommitStats: boolean expected"; - if (message.maxCommitDelay != null && message.hasOwnProperty("maxCommitDelay")) { - var error = $root.google.protobuf.Duration.verify(message.maxCommitDelay); - if (error) - return "maxCommitDelay." + error; - } - if (message.requestOptions != null && message.hasOwnProperty("requestOptions")) { - var error = $root.google.spanner.v1.RequestOptions.verify(message.requestOptions); - if (error) - return "requestOptions." + error; - } - if (message.precommitToken != null && message.hasOwnProperty("precommitToken")) { - var error = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.verify(message.precommitToken); - if (error) - return "precommitToken." + error; - } - return null; - }; - - /** - * Creates a CommitRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.CommitRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.CommitRequest} CommitRequest - */ - CommitRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.CommitRequest) - return object; - var message = new $root.google.spanner.v1.CommitRequest(); - if (object.session != null) - message.session = String(object.session); - if (object.transactionId != null) - if (typeof object.transactionId === "string") - $util.base64.decode(object.transactionId, message.transactionId = $util.newBuffer($util.base64.length(object.transactionId)), 0); - else if (object.transactionId.length >= 0) - message.transactionId = object.transactionId; - if (object.singleUseTransaction != null) { - if (typeof object.singleUseTransaction !== "object") - throw TypeError(".google.spanner.v1.CommitRequest.singleUseTransaction: object expected"); - message.singleUseTransaction = $root.google.spanner.v1.TransactionOptions.fromObject(object.singleUseTransaction); - } - if (object.mutations) { - if (!Array.isArray(object.mutations)) - throw TypeError(".google.spanner.v1.CommitRequest.mutations: array expected"); - message.mutations = []; - for (var i = 0; i < object.mutations.length; ++i) { - if (typeof object.mutations[i] !== "object") - throw TypeError(".google.spanner.v1.CommitRequest.mutations: object expected"); - message.mutations[i] = $root.google.spanner.v1.Mutation.fromObject(object.mutations[i]); - } - } - if (object.returnCommitStats != null) - message.returnCommitStats = Boolean(object.returnCommitStats); - if (object.maxCommitDelay != null) { - if (typeof object.maxCommitDelay !== "object") - throw TypeError(".google.spanner.v1.CommitRequest.maxCommitDelay: object expected"); - message.maxCommitDelay = $root.google.protobuf.Duration.fromObject(object.maxCommitDelay); - } - if (object.requestOptions != null) { - if (typeof object.requestOptions !== "object") - throw TypeError(".google.spanner.v1.CommitRequest.requestOptions: object expected"); - message.requestOptions = $root.google.spanner.v1.RequestOptions.fromObject(object.requestOptions); - } - if (object.precommitToken != null) { - if (typeof object.precommitToken !== "object") - throw TypeError(".google.spanner.v1.CommitRequest.precommitToken: object expected"); - message.precommitToken = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.fromObject(object.precommitToken); - } - return message; - }; - - /** - * Creates a plain object from a CommitRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.CommitRequest - * @static - * @param {google.spanner.v1.CommitRequest} message CommitRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CommitRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.mutations = []; - if (options.defaults) { - object.session = ""; - object.returnCommitStats = false; - object.requestOptions = null; - object.maxCommitDelay = null; - object.precommitToken = null; - } - if (message.session != null && message.hasOwnProperty("session")) - object.session = message.session; - if (message.transactionId != null && message.hasOwnProperty("transactionId")) { - object.transactionId = options.bytes === String ? $util.base64.encode(message.transactionId, 0, message.transactionId.length) : options.bytes === Array ? Array.prototype.slice.call(message.transactionId) : message.transactionId; - if (options.oneofs) - object.transaction = "transactionId"; - } - if (message.singleUseTransaction != null && message.hasOwnProperty("singleUseTransaction")) { - object.singleUseTransaction = $root.google.spanner.v1.TransactionOptions.toObject(message.singleUseTransaction, options); - if (options.oneofs) - object.transaction = "singleUseTransaction"; - } - if (message.mutations && message.mutations.length) { - object.mutations = []; - for (var j = 0; j < message.mutations.length; ++j) - object.mutations[j] = $root.google.spanner.v1.Mutation.toObject(message.mutations[j], options); - } - if (message.returnCommitStats != null && message.hasOwnProperty("returnCommitStats")) - object.returnCommitStats = message.returnCommitStats; - if (message.requestOptions != null && message.hasOwnProperty("requestOptions")) - object.requestOptions = $root.google.spanner.v1.RequestOptions.toObject(message.requestOptions, options); - if (message.maxCommitDelay != null && message.hasOwnProperty("maxCommitDelay")) - object.maxCommitDelay = $root.google.protobuf.Duration.toObject(message.maxCommitDelay, options); - if (message.precommitToken != null && message.hasOwnProperty("precommitToken")) - object.precommitToken = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.toObject(message.precommitToken, options); - return object; - }; - - /** - * Converts this CommitRequest to JSON. - * @function toJSON - * @memberof google.spanner.v1.CommitRequest - * @instance - * @returns {Object.} JSON object - */ - CommitRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CommitRequest - * @function getTypeUrl - * @memberof google.spanner.v1.CommitRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CommitRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.CommitRequest"; - }; - - return CommitRequest; - })(); - - v1.RollbackRequest = (function() { - - /** - * Properties of a RollbackRequest. - * @memberof google.spanner.v1 - * @interface IRollbackRequest - * @property {string|null} [session] RollbackRequest session - * @property {Uint8Array|null} [transactionId] RollbackRequest transactionId - */ - - /** - * Constructs a new RollbackRequest. - * @memberof google.spanner.v1 - * @classdesc Represents a RollbackRequest. - * @implements IRollbackRequest - * @constructor - * @param {google.spanner.v1.IRollbackRequest=} [properties] Properties to set - */ - function RollbackRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RollbackRequest session. - * @member {string} session - * @memberof google.spanner.v1.RollbackRequest - * @instance - */ - RollbackRequest.prototype.session = ""; - - /** - * RollbackRequest transactionId. - * @member {Uint8Array} transactionId - * @memberof google.spanner.v1.RollbackRequest - * @instance - */ - RollbackRequest.prototype.transactionId = $util.newBuffer([]); - - /** - * Creates a new RollbackRequest instance using the specified properties. - * @function create - * @memberof google.spanner.v1.RollbackRequest - * @static - * @param {google.spanner.v1.IRollbackRequest=} [properties] Properties to set - * @returns {google.spanner.v1.RollbackRequest} RollbackRequest instance - */ - RollbackRequest.create = function create(properties) { - return new RollbackRequest(properties); - }; - - /** - * Encodes the specified RollbackRequest message. Does not implicitly {@link google.spanner.v1.RollbackRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.RollbackRequest - * @static - * @param {google.spanner.v1.IRollbackRequest} message RollbackRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RollbackRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.session != null && Object.hasOwnProperty.call(message, "session")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.session); - if (message.transactionId != null && Object.hasOwnProperty.call(message, "transactionId")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.transactionId); - return writer; - }; - - /** - * Encodes the specified RollbackRequest message, length delimited. Does not implicitly {@link google.spanner.v1.RollbackRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.RollbackRequest - * @static - * @param {google.spanner.v1.IRollbackRequest} message RollbackRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RollbackRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RollbackRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.RollbackRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.RollbackRequest} RollbackRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RollbackRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.RollbackRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.session = reader.string(); - break; - } - case 2: { - message.transactionId = reader.bytes(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RollbackRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.RollbackRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.RollbackRequest} RollbackRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RollbackRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RollbackRequest message. - * @function verify - * @memberof google.spanner.v1.RollbackRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RollbackRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.session != null && message.hasOwnProperty("session")) - if (!$util.isString(message.session)) - return "session: string expected"; - if (message.transactionId != null && message.hasOwnProperty("transactionId")) - if (!(message.transactionId && typeof message.transactionId.length === "number" || $util.isString(message.transactionId))) - return "transactionId: buffer expected"; - return null; - }; - - /** - * Creates a RollbackRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.RollbackRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.RollbackRequest} RollbackRequest - */ - RollbackRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.RollbackRequest) - return object; - var message = new $root.google.spanner.v1.RollbackRequest(); - if (object.session != null) - message.session = String(object.session); - if (object.transactionId != null) - if (typeof object.transactionId === "string") - $util.base64.decode(object.transactionId, message.transactionId = $util.newBuffer($util.base64.length(object.transactionId)), 0); - else if (object.transactionId.length >= 0) - message.transactionId = object.transactionId; - return message; - }; - - /** - * Creates a plain object from a RollbackRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.RollbackRequest - * @static - * @param {google.spanner.v1.RollbackRequest} message RollbackRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RollbackRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.session = ""; - if (options.bytes === String) - object.transactionId = ""; - else { - object.transactionId = []; - if (options.bytes !== Array) - object.transactionId = $util.newBuffer(object.transactionId); - } - } - if (message.session != null && message.hasOwnProperty("session")) - object.session = message.session; - if (message.transactionId != null && message.hasOwnProperty("transactionId")) - object.transactionId = options.bytes === String ? $util.base64.encode(message.transactionId, 0, message.transactionId.length) : options.bytes === Array ? Array.prototype.slice.call(message.transactionId) : message.transactionId; - return object; - }; - - /** - * Converts this RollbackRequest to JSON. - * @function toJSON - * @memberof google.spanner.v1.RollbackRequest - * @instance - * @returns {Object.} JSON object - */ - RollbackRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RollbackRequest - * @function getTypeUrl - * @memberof google.spanner.v1.RollbackRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RollbackRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.RollbackRequest"; - }; - - return RollbackRequest; - })(); - - v1.BatchWriteRequest = (function() { - - /** - * Properties of a BatchWriteRequest. - * @memberof google.spanner.v1 - * @interface IBatchWriteRequest - * @property {string|null} [session] BatchWriteRequest session - * @property {google.spanner.v1.IRequestOptions|null} [requestOptions] BatchWriteRequest requestOptions - * @property {Array.|null} [mutationGroups] BatchWriteRequest mutationGroups - * @property {boolean|null} [excludeTxnFromChangeStreams] BatchWriteRequest excludeTxnFromChangeStreams - */ - - /** - * Constructs a new BatchWriteRequest. - * @memberof google.spanner.v1 - * @classdesc Represents a BatchWriteRequest. - * @implements IBatchWriteRequest - * @constructor - * @param {google.spanner.v1.IBatchWriteRequest=} [properties] Properties to set - */ - function BatchWriteRequest(properties) { - this.mutationGroups = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BatchWriteRequest session. - * @member {string} session - * @memberof google.spanner.v1.BatchWriteRequest - * @instance - */ - BatchWriteRequest.prototype.session = ""; - - /** - * BatchWriteRequest requestOptions. - * @member {google.spanner.v1.IRequestOptions|null|undefined} requestOptions - * @memberof google.spanner.v1.BatchWriteRequest - * @instance - */ - BatchWriteRequest.prototype.requestOptions = null; - - /** - * BatchWriteRequest mutationGroups. - * @member {Array.} mutationGroups - * @memberof google.spanner.v1.BatchWriteRequest - * @instance - */ - BatchWriteRequest.prototype.mutationGroups = $util.emptyArray; - - /** - * BatchWriteRequest excludeTxnFromChangeStreams. - * @member {boolean} excludeTxnFromChangeStreams - * @memberof google.spanner.v1.BatchWriteRequest - * @instance - */ - BatchWriteRequest.prototype.excludeTxnFromChangeStreams = false; - - /** - * Creates a new BatchWriteRequest instance using the specified properties. - * @function create - * @memberof google.spanner.v1.BatchWriteRequest - * @static - * @param {google.spanner.v1.IBatchWriteRequest=} [properties] Properties to set - * @returns {google.spanner.v1.BatchWriteRequest} BatchWriteRequest instance - */ - BatchWriteRequest.create = function create(properties) { - return new BatchWriteRequest(properties); - }; - - /** - * Encodes the specified BatchWriteRequest message. Does not implicitly {@link google.spanner.v1.BatchWriteRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.BatchWriteRequest - * @static - * @param {google.spanner.v1.IBatchWriteRequest} message BatchWriteRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchWriteRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.session != null && Object.hasOwnProperty.call(message, "session")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.session); - if (message.requestOptions != null && Object.hasOwnProperty.call(message, "requestOptions")) - $root.google.spanner.v1.RequestOptions.encode(message.requestOptions, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.mutationGroups != null && message.mutationGroups.length) - for (var i = 0; i < message.mutationGroups.length; ++i) - $root.google.spanner.v1.BatchWriteRequest.MutationGroup.encode(message.mutationGroups[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.excludeTxnFromChangeStreams != null && Object.hasOwnProperty.call(message, "excludeTxnFromChangeStreams")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.excludeTxnFromChangeStreams); - return writer; - }; - - /** - * Encodes the specified BatchWriteRequest message, length delimited. Does not implicitly {@link google.spanner.v1.BatchWriteRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.BatchWriteRequest - * @static - * @param {google.spanner.v1.IBatchWriteRequest} message BatchWriteRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchWriteRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BatchWriteRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.BatchWriteRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.BatchWriteRequest} BatchWriteRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchWriteRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.BatchWriteRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.session = reader.string(); - break; - } - case 3: { - message.requestOptions = $root.google.spanner.v1.RequestOptions.decode(reader, reader.uint32()); - break; - } - case 4: { - if (!(message.mutationGroups && message.mutationGroups.length)) - message.mutationGroups = []; - message.mutationGroups.push($root.google.spanner.v1.BatchWriteRequest.MutationGroup.decode(reader, reader.uint32())); - break; - } - case 5: { - message.excludeTxnFromChangeStreams = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BatchWriteRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.BatchWriteRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.BatchWriteRequest} BatchWriteRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchWriteRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BatchWriteRequest message. - * @function verify - * @memberof google.spanner.v1.BatchWriteRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BatchWriteRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.session != null && message.hasOwnProperty("session")) - if (!$util.isString(message.session)) - return "session: string expected"; - if (message.requestOptions != null && message.hasOwnProperty("requestOptions")) { - var error = $root.google.spanner.v1.RequestOptions.verify(message.requestOptions); - if (error) - return "requestOptions." + error; - } - if (message.mutationGroups != null && message.hasOwnProperty("mutationGroups")) { - if (!Array.isArray(message.mutationGroups)) - return "mutationGroups: array expected"; - for (var i = 0; i < message.mutationGroups.length; ++i) { - var error = $root.google.spanner.v1.BatchWriteRequest.MutationGroup.verify(message.mutationGroups[i]); - if (error) - return "mutationGroups." + error; - } - } - if (message.excludeTxnFromChangeStreams != null && message.hasOwnProperty("excludeTxnFromChangeStreams")) - if (typeof message.excludeTxnFromChangeStreams !== "boolean") - return "excludeTxnFromChangeStreams: boolean expected"; - return null; - }; - - /** - * Creates a BatchWriteRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.BatchWriteRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.BatchWriteRequest} BatchWriteRequest - */ - BatchWriteRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.BatchWriteRequest) - return object; - var message = new $root.google.spanner.v1.BatchWriteRequest(); - if (object.session != null) - message.session = String(object.session); - if (object.requestOptions != null) { - if (typeof object.requestOptions !== "object") - throw TypeError(".google.spanner.v1.BatchWriteRequest.requestOptions: object expected"); - message.requestOptions = $root.google.spanner.v1.RequestOptions.fromObject(object.requestOptions); - } - if (object.mutationGroups) { - if (!Array.isArray(object.mutationGroups)) - throw TypeError(".google.spanner.v1.BatchWriteRequest.mutationGroups: array expected"); - message.mutationGroups = []; - for (var i = 0; i < object.mutationGroups.length; ++i) { - if (typeof object.mutationGroups[i] !== "object") - throw TypeError(".google.spanner.v1.BatchWriteRequest.mutationGroups: object expected"); - message.mutationGroups[i] = $root.google.spanner.v1.BatchWriteRequest.MutationGroup.fromObject(object.mutationGroups[i]); - } - } - if (object.excludeTxnFromChangeStreams != null) - message.excludeTxnFromChangeStreams = Boolean(object.excludeTxnFromChangeStreams); - return message; - }; - - /** - * Creates a plain object from a BatchWriteRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.BatchWriteRequest - * @static - * @param {google.spanner.v1.BatchWriteRequest} message BatchWriteRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BatchWriteRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.mutationGroups = []; - if (options.defaults) { - object.session = ""; - object.requestOptions = null; - object.excludeTxnFromChangeStreams = false; - } - if (message.session != null && message.hasOwnProperty("session")) - object.session = message.session; - if (message.requestOptions != null && message.hasOwnProperty("requestOptions")) - object.requestOptions = $root.google.spanner.v1.RequestOptions.toObject(message.requestOptions, options); - if (message.mutationGroups && message.mutationGroups.length) { - object.mutationGroups = []; - for (var j = 0; j < message.mutationGroups.length; ++j) - object.mutationGroups[j] = $root.google.spanner.v1.BatchWriteRequest.MutationGroup.toObject(message.mutationGroups[j], options); - } - if (message.excludeTxnFromChangeStreams != null && message.hasOwnProperty("excludeTxnFromChangeStreams")) - object.excludeTxnFromChangeStreams = message.excludeTxnFromChangeStreams; - return object; - }; - - /** - * Converts this BatchWriteRequest to JSON. - * @function toJSON - * @memberof google.spanner.v1.BatchWriteRequest - * @instance - * @returns {Object.} JSON object - */ - BatchWriteRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BatchWriteRequest - * @function getTypeUrl - * @memberof google.spanner.v1.BatchWriteRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BatchWriteRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.BatchWriteRequest"; - }; - - BatchWriteRequest.MutationGroup = (function() { - - /** - * Properties of a MutationGroup. - * @memberof google.spanner.v1.BatchWriteRequest - * @interface IMutationGroup - * @property {Array.|null} [mutations] MutationGroup mutations - */ - - /** - * Constructs a new MutationGroup. - * @memberof google.spanner.v1.BatchWriteRequest - * @classdesc Represents a MutationGroup. - * @implements IMutationGroup - * @constructor - * @param {google.spanner.v1.BatchWriteRequest.IMutationGroup=} [properties] Properties to set - */ - function MutationGroup(properties) { - this.mutations = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MutationGroup mutations. - * @member {Array.} mutations - * @memberof google.spanner.v1.BatchWriteRequest.MutationGroup - * @instance - */ - MutationGroup.prototype.mutations = $util.emptyArray; - - /** - * Creates a new MutationGroup instance using the specified properties. - * @function create - * @memberof google.spanner.v1.BatchWriteRequest.MutationGroup - * @static - * @param {google.spanner.v1.BatchWriteRequest.IMutationGroup=} [properties] Properties to set - * @returns {google.spanner.v1.BatchWriteRequest.MutationGroup} MutationGroup instance - */ - MutationGroup.create = function create(properties) { - return new MutationGroup(properties); - }; - - /** - * Encodes the specified MutationGroup message. Does not implicitly {@link google.spanner.v1.BatchWriteRequest.MutationGroup.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.BatchWriteRequest.MutationGroup - * @static - * @param {google.spanner.v1.BatchWriteRequest.IMutationGroup} message MutationGroup message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MutationGroup.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.mutations != null && message.mutations.length) - for (var i = 0; i < message.mutations.length; ++i) - $root.google.spanner.v1.Mutation.encode(message.mutations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified MutationGroup message, length delimited. Does not implicitly {@link google.spanner.v1.BatchWriteRequest.MutationGroup.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.BatchWriteRequest.MutationGroup - * @static - * @param {google.spanner.v1.BatchWriteRequest.IMutationGroup} message MutationGroup message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MutationGroup.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MutationGroup message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.BatchWriteRequest.MutationGroup - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.BatchWriteRequest.MutationGroup} MutationGroup - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MutationGroup.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.BatchWriteRequest.MutationGroup(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.mutations && message.mutations.length)) - message.mutations = []; - message.mutations.push($root.google.spanner.v1.Mutation.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MutationGroup message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.BatchWriteRequest.MutationGroup - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.BatchWriteRequest.MutationGroup} MutationGroup - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MutationGroup.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MutationGroup message. - * @function verify - * @memberof google.spanner.v1.BatchWriteRequest.MutationGroup - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MutationGroup.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.mutations != null && message.hasOwnProperty("mutations")) { - if (!Array.isArray(message.mutations)) - return "mutations: array expected"; - for (var i = 0; i < message.mutations.length; ++i) { - var error = $root.google.spanner.v1.Mutation.verify(message.mutations[i]); - if (error) - return "mutations." + error; - } - } - return null; - }; - - /** - * Creates a MutationGroup message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.BatchWriteRequest.MutationGroup - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.BatchWriteRequest.MutationGroup} MutationGroup - */ - MutationGroup.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.BatchWriteRequest.MutationGroup) - return object; - var message = new $root.google.spanner.v1.BatchWriteRequest.MutationGroup(); - if (object.mutations) { - if (!Array.isArray(object.mutations)) - throw TypeError(".google.spanner.v1.BatchWriteRequest.MutationGroup.mutations: array expected"); - message.mutations = []; - for (var i = 0; i < object.mutations.length; ++i) { - if (typeof object.mutations[i] !== "object") - throw TypeError(".google.spanner.v1.BatchWriteRequest.MutationGroup.mutations: object expected"); - message.mutations[i] = $root.google.spanner.v1.Mutation.fromObject(object.mutations[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a MutationGroup message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.BatchWriteRequest.MutationGroup - * @static - * @param {google.spanner.v1.BatchWriteRequest.MutationGroup} message MutationGroup - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MutationGroup.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.mutations = []; - if (message.mutations && message.mutations.length) { - object.mutations = []; - for (var j = 0; j < message.mutations.length; ++j) - object.mutations[j] = $root.google.spanner.v1.Mutation.toObject(message.mutations[j], options); - } - return object; - }; - - /** - * Converts this MutationGroup to JSON. - * @function toJSON - * @memberof google.spanner.v1.BatchWriteRequest.MutationGroup - * @instance - * @returns {Object.} JSON object - */ - MutationGroup.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MutationGroup - * @function getTypeUrl - * @memberof google.spanner.v1.BatchWriteRequest.MutationGroup - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MutationGroup.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.BatchWriteRequest.MutationGroup"; - }; - - return MutationGroup; - })(); - - return BatchWriteRequest; - })(); - - v1.BatchWriteResponse = (function() { - - /** - * Properties of a BatchWriteResponse. - * @memberof google.spanner.v1 - * @interface IBatchWriteResponse - * @property {Array.|null} [indexes] BatchWriteResponse indexes - * @property {google.rpc.IStatus|null} [status] BatchWriteResponse status - * @property {google.protobuf.ITimestamp|null} [commitTimestamp] BatchWriteResponse commitTimestamp - */ - - /** - * Constructs a new BatchWriteResponse. - * @memberof google.spanner.v1 - * @classdesc Represents a BatchWriteResponse. - * @implements IBatchWriteResponse - * @constructor - * @param {google.spanner.v1.IBatchWriteResponse=} [properties] Properties to set - */ - function BatchWriteResponse(properties) { - this.indexes = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BatchWriteResponse indexes. - * @member {Array.} indexes - * @memberof google.spanner.v1.BatchWriteResponse - * @instance - */ - BatchWriteResponse.prototype.indexes = $util.emptyArray; - - /** - * BatchWriteResponse status. - * @member {google.rpc.IStatus|null|undefined} status - * @memberof google.spanner.v1.BatchWriteResponse - * @instance - */ - BatchWriteResponse.prototype.status = null; - - /** - * BatchWriteResponse commitTimestamp. - * @member {google.protobuf.ITimestamp|null|undefined} commitTimestamp - * @memberof google.spanner.v1.BatchWriteResponse - * @instance - */ - BatchWriteResponse.prototype.commitTimestamp = null; - - /** - * Creates a new BatchWriteResponse instance using the specified properties. - * @function create - * @memberof google.spanner.v1.BatchWriteResponse - * @static - * @param {google.spanner.v1.IBatchWriteResponse=} [properties] Properties to set - * @returns {google.spanner.v1.BatchWriteResponse} BatchWriteResponse instance - */ - BatchWriteResponse.create = function create(properties) { - return new BatchWriteResponse(properties); - }; - - /** - * Encodes the specified BatchWriteResponse message. Does not implicitly {@link google.spanner.v1.BatchWriteResponse.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.BatchWriteResponse - * @static - * @param {google.spanner.v1.IBatchWriteResponse} message BatchWriteResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchWriteResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.indexes != null && message.indexes.length) { - writer.uint32(/* id 1, wireType 2 =*/10).fork(); - for (var i = 0; i < message.indexes.length; ++i) - writer.int32(message.indexes[i]); - writer.ldelim(); - } - if (message.status != null && Object.hasOwnProperty.call(message, "status")) - $root.google.rpc.Status.encode(message.status, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.commitTimestamp != null && Object.hasOwnProperty.call(message, "commitTimestamp")) - $root.google.protobuf.Timestamp.encode(message.commitTimestamp, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified BatchWriteResponse message, length delimited. Does not implicitly {@link google.spanner.v1.BatchWriteResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.BatchWriteResponse - * @static - * @param {google.spanner.v1.IBatchWriteResponse} message BatchWriteResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchWriteResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BatchWriteResponse message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.BatchWriteResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.BatchWriteResponse} BatchWriteResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchWriteResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.BatchWriteResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.indexes && message.indexes.length)) - message.indexes = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.indexes.push(reader.int32()); - } else - message.indexes.push(reader.int32()); - break; - } - case 2: { - message.status = $root.google.rpc.Status.decode(reader, reader.uint32()); - break; - } - case 3: { - message.commitTimestamp = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BatchWriteResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.BatchWriteResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.BatchWriteResponse} BatchWriteResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchWriteResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BatchWriteResponse message. - * @function verify - * @memberof google.spanner.v1.BatchWriteResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BatchWriteResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.indexes != null && message.hasOwnProperty("indexes")) { - if (!Array.isArray(message.indexes)) - return "indexes: array expected"; - for (var i = 0; i < message.indexes.length; ++i) - if (!$util.isInteger(message.indexes[i])) - return "indexes: integer[] expected"; - } - if (message.status != null && message.hasOwnProperty("status")) { - var error = $root.google.rpc.Status.verify(message.status); - if (error) - return "status." + error; - } - if (message.commitTimestamp != null && message.hasOwnProperty("commitTimestamp")) { - var error = $root.google.protobuf.Timestamp.verify(message.commitTimestamp); - if (error) - return "commitTimestamp." + error; - } - return null; - }; - - /** - * Creates a BatchWriteResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.BatchWriteResponse - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.BatchWriteResponse} BatchWriteResponse - */ - BatchWriteResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.BatchWriteResponse) - return object; - var message = new $root.google.spanner.v1.BatchWriteResponse(); - if (object.indexes) { - if (!Array.isArray(object.indexes)) - throw TypeError(".google.spanner.v1.BatchWriteResponse.indexes: array expected"); - message.indexes = []; - for (var i = 0; i < object.indexes.length; ++i) - message.indexes[i] = object.indexes[i] | 0; - } - if (object.status != null) { - if (typeof object.status !== "object") - throw TypeError(".google.spanner.v1.BatchWriteResponse.status: object expected"); - message.status = $root.google.rpc.Status.fromObject(object.status); - } - if (object.commitTimestamp != null) { - if (typeof object.commitTimestamp !== "object") - throw TypeError(".google.spanner.v1.BatchWriteResponse.commitTimestamp: object expected"); - message.commitTimestamp = $root.google.protobuf.Timestamp.fromObject(object.commitTimestamp); - } - return message; - }; - - /** - * Creates a plain object from a BatchWriteResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.BatchWriteResponse - * @static - * @param {google.spanner.v1.BatchWriteResponse} message BatchWriteResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BatchWriteResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.indexes = []; - if (options.defaults) { - object.status = null; - object.commitTimestamp = null; - } - if (message.indexes && message.indexes.length) { - object.indexes = []; - for (var j = 0; j < message.indexes.length; ++j) - object.indexes[j] = message.indexes[j]; - } - if (message.status != null && message.hasOwnProperty("status")) - object.status = $root.google.rpc.Status.toObject(message.status, options); - if (message.commitTimestamp != null && message.hasOwnProperty("commitTimestamp")) - object.commitTimestamp = $root.google.protobuf.Timestamp.toObject(message.commitTimestamp, options); - return object; - }; - - /** - * Converts this BatchWriteResponse to JSON. - * @function toJSON - * @memberof google.spanner.v1.BatchWriteResponse - * @instance - * @returns {Object.} JSON object - */ - BatchWriteResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BatchWriteResponse - * @function getTypeUrl - * @memberof google.spanner.v1.BatchWriteResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BatchWriteResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.BatchWriteResponse"; - }; - - return BatchWriteResponse; - })(); - - return v1; - })(); - - return spanner; - })(); - - google.api = (function() { - - /** - * Namespace api. - * @memberof google - * @namespace - */ - var api = {}; - - /** - * FieldBehavior enum. - * @name google.api.FieldBehavior - * @enum {number} - * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value - * @property {number} OPTIONAL=1 OPTIONAL value - * @property {number} REQUIRED=2 REQUIRED value - * @property {number} OUTPUT_ONLY=3 OUTPUT_ONLY value - * @property {number} INPUT_ONLY=4 INPUT_ONLY value - * @property {number} IMMUTABLE=5 IMMUTABLE value - * @property {number} UNORDERED_LIST=6 UNORDERED_LIST value - * @property {number} NON_EMPTY_DEFAULT=7 NON_EMPTY_DEFAULT value - * @property {number} IDENTIFIER=8 IDENTIFIER value - */ - api.FieldBehavior = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "FIELD_BEHAVIOR_UNSPECIFIED"] = 0; - values[valuesById[1] = "OPTIONAL"] = 1; - values[valuesById[2] = "REQUIRED"] = 2; - values[valuesById[3] = "OUTPUT_ONLY"] = 3; - values[valuesById[4] = "INPUT_ONLY"] = 4; - values[valuesById[5] = "IMMUTABLE"] = 5; - values[valuesById[6] = "UNORDERED_LIST"] = 6; - values[valuesById[7] = "NON_EMPTY_DEFAULT"] = 7; - values[valuesById[8] = "IDENTIFIER"] = 8; - return values; - })(); - - api.Http = (function() { - - /** - * Properties of a Http. - * @memberof google.api - * @interface IHttp - * @property {Array.|null} [rules] Http rules - * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion - */ - - /** - * Constructs a new Http. - * @memberof google.api - * @classdesc Represents a Http. - * @implements IHttp - * @constructor - * @param {google.api.IHttp=} [properties] Properties to set - */ - function Http(properties) { - this.rules = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Http rules. - * @member {Array.} rules - * @memberof google.api.Http - * @instance - */ - Http.prototype.rules = $util.emptyArray; - - /** - * Http fullyDecodeReservedExpansion. - * @member {boolean} fullyDecodeReservedExpansion - * @memberof google.api.Http - * @instance - */ - Http.prototype.fullyDecodeReservedExpansion = false; - - /** - * Creates a new Http instance using the specified properties. - * @function create - * @memberof google.api.Http - * @static - * @param {google.api.IHttp=} [properties] Properties to set - * @returns {google.api.Http} Http instance - */ - Http.create = function create(properties) { - return new Http(properties); - }; - - /** - * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @function encode - * @memberof google.api.Http - * @static - * @param {google.api.IHttp} message Http message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Http.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.rules != null && message.rules.length) - for (var i = 0; i < message.rules.length; ++i) - $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); - return writer; - }; - - /** - * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.Http - * @static - * @param {google.api.IHttp} message Http message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Http.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Http message from the specified reader or buffer. - * @function decode - * @memberof google.api.Http - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.Http} Http - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Http.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.rules && message.rules.length)) - message.rules = []; - message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); - break; - } - case 2: { - message.fullyDecodeReservedExpansion = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Http message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.Http - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.Http} Http - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Http.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Http message. - * @function verify - * @memberof google.api.Http - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Http.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.rules != null && message.hasOwnProperty("rules")) { - if (!Array.isArray(message.rules)) - return "rules: array expected"; - for (var i = 0; i < message.rules.length; ++i) { - var error = $root.google.api.HttpRule.verify(message.rules[i]); - if (error) - return "rules." + error; - } - } - if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) - if (typeof message.fullyDecodeReservedExpansion !== "boolean") - return "fullyDecodeReservedExpansion: boolean expected"; - return null; - }; - - /** - * Creates a Http message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.Http - * @static - * @param {Object.} object Plain object - * @returns {google.api.Http} Http - */ - Http.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.Http) - return object; - var message = new $root.google.api.Http(); - if (object.rules) { - if (!Array.isArray(object.rules)) - throw TypeError(".google.api.Http.rules: array expected"); - message.rules = []; - for (var i = 0; i < object.rules.length; ++i) { - if (typeof object.rules[i] !== "object") - throw TypeError(".google.api.Http.rules: object expected"); - message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); - } - } - if (object.fullyDecodeReservedExpansion != null) - message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); - return message; - }; - - /** - * Creates a plain object from a Http message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.Http - * @static - * @param {google.api.Http} message Http - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Http.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.rules = []; - if (options.defaults) - object.fullyDecodeReservedExpansion = false; - if (message.rules && message.rules.length) { - object.rules = []; - for (var j = 0; j < message.rules.length; ++j) - object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); - } - if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) - object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; - return object; - }; - - /** - * Converts this Http to JSON. - * @function toJSON - * @memberof google.api.Http - * @instance - * @returns {Object.} JSON object - */ - Http.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Http - * @function getTypeUrl - * @memberof google.api.Http - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Http.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.Http"; - }; - - return Http; - })(); - - api.HttpRule = (function() { - - /** - * Properties of a HttpRule. - * @memberof google.api - * @interface IHttpRule - * @property {string|null} [selector] HttpRule selector - * @property {string|null} [get] HttpRule get - * @property {string|null} [put] HttpRule put - * @property {string|null} [post] HttpRule post - * @property {string|null} ["delete"] HttpRule delete - * @property {string|null} [patch] HttpRule patch - * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom - * @property {string|null} [body] HttpRule body - * @property {string|null} [responseBody] HttpRule responseBody - * @property {Array.|null} [additionalBindings] HttpRule additionalBindings - */ - - /** - * Constructs a new HttpRule. - * @memberof google.api - * @classdesc Represents a HttpRule. - * @implements IHttpRule - * @constructor - * @param {google.api.IHttpRule=} [properties] Properties to set - */ - function HttpRule(properties) { - this.additionalBindings = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * HttpRule selector. - * @member {string} selector - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.selector = ""; - - /** - * HttpRule get. - * @member {string|null|undefined} get - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.get = null; - - /** - * HttpRule put. - * @member {string|null|undefined} put - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.put = null; - - /** - * HttpRule post. - * @member {string|null|undefined} post - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.post = null; - - /** - * HttpRule delete. - * @member {string|null|undefined} delete - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype["delete"] = null; - - /** - * HttpRule patch. - * @member {string|null|undefined} patch - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.patch = null; - - /** - * HttpRule custom. - * @member {google.api.ICustomHttpPattern|null|undefined} custom - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.custom = null; - - /** - * HttpRule body. - * @member {string} body - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.body = ""; - - /** - * HttpRule responseBody. - * @member {string} responseBody - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.responseBody = ""; - - /** - * HttpRule additionalBindings. - * @member {Array.} additionalBindings - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.additionalBindings = $util.emptyArray; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * HttpRule pattern. - * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern - * @memberof google.api.HttpRule - * @instance - */ - Object.defineProperty(HttpRule.prototype, "pattern", { - get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new HttpRule instance using the specified properties. - * @function create - * @memberof google.api.HttpRule - * @static - * @param {google.api.IHttpRule=} [properties] Properties to set - * @returns {google.api.HttpRule} HttpRule instance - */ - HttpRule.create = function create(properties) { - return new HttpRule(properties); - }; - - /** - * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @function encode - * @memberof google.api.HttpRule - * @static - * @param {google.api.IHttpRule} message HttpRule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HttpRule.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); - if (message.get != null && Object.hasOwnProperty.call(message, "get")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); - if (message.put != null && Object.hasOwnProperty.call(message, "put")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); - if (message.post != null && Object.hasOwnProperty.call(message, "post")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); - if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); - if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); - if (message.body != null && Object.hasOwnProperty.call(message, "body")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); - if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) - $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.additionalBindings != null && message.additionalBindings.length) - for (var i = 0; i < message.additionalBindings.length; ++i) - $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); - return writer; - }; - - /** - * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.HttpRule - * @static - * @param {google.api.IHttpRule} message HttpRule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HttpRule.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a HttpRule message from the specified reader or buffer. - * @function decode - * @memberof google.api.HttpRule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.HttpRule} HttpRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HttpRule.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.selector = reader.string(); - break; - } - case 2: { - message.get = reader.string(); - break; - } - case 3: { - message.put = reader.string(); - break; - } - case 4: { - message.post = reader.string(); - break; - } - case 5: { - message["delete"] = reader.string(); - break; - } - case 6: { - message.patch = reader.string(); - break; - } - case 8: { - message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); - break; - } - case 7: { - message.body = reader.string(); - break; - } - case 12: { - message.responseBody = reader.string(); - break; - } - case 11: { - if (!(message.additionalBindings && message.additionalBindings.length)) - message.additionalBindings = []; - message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a HttpRule message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.HttpRule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.HttpRule} HttpRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HttpRule.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a HttpRule message. - * @function verify - * @memberof google.api.HttpRule - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - HttpRule.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.selector != null && message.hasOwnProperty("selector")) - if (!$util.isString(message.selector)) - return "selector: string expected"; - if (message.get != null && message.hasOwnProperty("get")) { - properties.pattern = 1; - if (!$util.isString(message.get)) - return "get: string expected"; - } - if (message.put != null && message.hasOwnProperty("put")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message.put)) - return "put: string expected"; - } - if (message.post != null && message.hasOwnProperty("post")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message.post)) - return "post: string expected"; - } - if (message["delete"] != null && message.hasOwnProperty("delete")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message["delete"])) - return "delete: string expected"; - } - if (message.patch != null && message.hasOwnProperty("patch")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message.patch)) - return "patch: string expected"; - } - if (message.custom != null && message.hasOwnProperty("custom")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - { - var error = $root.google.api.CustomHttpPattern.verify(message.custom); - if (error) - return "custom." + error; - } - } - if (message.body != null && message.hasOwnProperty("body")) - if (!$util.isString(message.body)) - return "body: string expected"; - if (message.responseBody != null && message.hasOwnProperty("responseBody")) - if (!$util.isString(message.responseBody)) - return "responseBody: string expected"; - if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) { - if (!Array.isArray(message.additionalBindings)) - return "additionalBindings: array expected"; - for (var i = 0; i < message.additionalBindings.length; ++i) { - var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]); - if (error) - return "additionalBindings." + error; - } - } - return null; - }; - - /** - * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.HttpRule - * @static - * @param {Object.} object Plain object - * @returns {google.api.HttpRule} HttpRule - */ - HttpRule.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.HttpRule) - return object; - var message = new $root.google.api.HttpRule(); - if (object.selector != null) - message.selector = String(object.selector); - if (object.get != null) - message.get = String(object.get); - if (object.put != null) - message.put = String(object.put); - if (object.post != null) - message.post = String(object.post); - if (object["delete"] != null) - message["delete"] = String(object["delete"]); - if (object.patch != null) - message.patch = String(object.patch); - if (object.custom != null) { - if (typeof object.custom !== "object") - throw TypeError(".google.api.HttpRule.custom: object expected"); - message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); - } - if (object.body != null) - message.body = String(object.body); - if (object.responseBody != null) - message.responseBody = String(object.responseBody); - if (object.additionalBindings) { - if (!Array.isArray(object.additionalBindings)) - throw TypeError(".google.api.HttpRule.additionalBindings: array expected"); - message.additionalBindings = []; - for (var i = 0; i < object.additionalBindings.length; ++i) { - if (typeof object.additionalBindings[i] !== "object") - throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); - message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a HttpRule message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.HttpRule - * @static - * @param {google.api.HttpRule} message HttpRule - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - HttpRule.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.additionalBindings = []; - if (options.defaults) { - object.selector = ""; - object.body = ""; - object.responseBody = ""; - } - if (message.selector != null && message.hasOwnProperty("selector")) - object.selector = message.selector; - if (message.get != null && message.hasOwnProperty("get")) { - object.get = message.get; - if (options.oneofs) - object.pattern = "get"; - } - if (message.put != null && message.hasOwnProperty("put")) { - object.put = message.put; - if (options.oneofs) - object.pattern = "put"; - } - if (message.post != null && message.hasOwnProperty("post")) { - object.post = message.post; - if (options.oneofs) - object.pattern = "post"; - } - if (message["delete"] != null && message.hasOwnProperty("delete")) { - object["delete"] = message["delete"]; - if (options.oneofs) - object.pattern = "delete"; - } - if (message.patch != null && message.hasOwnProperty("patch")) { - object.patch = message.patch; - if (options.oneofs) - object.pattern = "patch"; - } - if (message.body != null && message.hasOwnProperty("body")) - object.body = message.body; - if (message.custom != null && message.hasOwnProperty("custom")) { - object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); - if (options.oneofs) - object.pattern = "custom"; - } - if (message.additionalBindings && message.additionalBindings.length) { - object.additionalBindings = []; - for (var j = 0; j < message.additionalBindings.length; ++j) - object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options); - } - if (message.responseBody != null && message.hasOwnProperty("responseBody")) - object.responseBody = message.responseBody; - return object; - }; - - /** - * Converts this HttpRule to JSON. - * @function toJSON - * @memberof google.api.HttpRule - * @instance - * @returns {Object.} JSON object - */ - HttpRule.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for HttpRule - * @function getTypeUrl - * @memberof google.api.HttpRule - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - HttpRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.HttpRule"; - }; - - return HttpRule; - })(); - - api.CustomHttpPattern = (function() { - - /** - * Properties of a CustomHttpPattern. - * @memberof google.api - * @interface ICustomHttpPattern - * @property {string|null} [kind] CustomHttpPattern kind - * @property {string|null} [path] CustomHttpPattern path - */ - - /** - * Constructs a new CustomHttpPattern. - * @memberof google.api - * @classdesc Represents a CustomHttpPattern. - * @implements ICustomHttpPattern - * @constructor - * @param {google.api.ICustomHttpPattern=} [properties] Properties to set - */ - function CustomHttpPattern(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CustomHttpPattern kind. - * @member {string} kind - * @memberof google.api.CustomHttpPattern - * @instance - */ - CustomHttpPattern.prototype.kind = ""; - - /** - * CustomHttpPattern path. - * @member {string} path - * @memberof google.api.CustomHttpPattern - * @instance - */ - CustomHttpPattern.prototype.path = ""; - - /** - * Creates a new CustomHttpPattern instance using the specified properties. - * @function create - * @memberof google.api.CustomHttpPattern - * @static - * @param {google.api.ICustomHttpPattern=} [properties] Properties to set - * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance - */ - CustomHttpPattern.create = function create(properties) { - return new CustomHttpPattern(properties); - }; - - /** - * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. - * @function encode - * @memberof google.api.CustomHttpPattern - * @static - * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CustomHttpPattern.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); - if (message.path != null && Object.hasOwnProperty.call(message, "path")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); - return writer; - }; - - /** - * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.CustomHttpPattern - * @static - * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CustomHttpPattern message from the specified reader or buffer. - * @function decode - * @memberof google.api.CustomHttpPattern - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.CustomHttpPattern} CustomHttpPattern - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CustomHttpPattern.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.kind = reader.string(); - break; - } - case 2: { - message.path = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.CustomHttpPattern - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.CustomHttpPattern} CustomHttpPattern - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CustomHttpPattern message. - * @function verify - * @memberof google.api.CustomHttpPattern - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CustomHttpPattern.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.kind != null && message.hasOwnProperty("kind")) - if (!$util.isString(message.kind)) - return "kind: string expected"; - if (message.path != null && message.hasOwnProperty("path")) - if (!$util.isString(message.path)) - return "path: string expected"; - return null; - }; - - /** - * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.CustomHttpPattern - * @static - * @param {Object.} object Plain object - * @returns {google.api.CustomHttpPattern} CustomHttpPattern - */ - CustomHttpPattern.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.CustomHttpPattern) - return object; - var message = new $root.google.api.CustomHttpPattern(); - if (object.kind != null) - message.kind = String(object.kind); - if (object.path != null) - message.path = String(object.path); - return message; - }; - - /** - * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.CustomHttpPattern - * @static - * @param {google.api.CustomHttpPattern} message CustomHttpPattern - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CustomHttpPattern.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.kind = ""; - object.path = ""; - } - if (message.kind != null && message.hasOwnProperty("kind")) - object.kind = message.kind; - if (message.path != null && message.hasOwnProperty("path")) - object.path = message.path; - return object; - }; - - /** - * Converts this CustomHttpPattern to JSON. - * @function toJSON - * @memberof google.api.CustomHttpPattern - * @instance - * @returns {Object.} JSON object - */ - CustomHttpPattern.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CustomHttpPattern - * @function getTypeUrl - * @memberof google.api.CustomHttpPattern - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CustomHttpPattern.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.CustomHttpPattern"; - }; - - return CustomHttpPattern; - })(); - - api.CommonLanguageSettings = (function() { - - /** - * Properties of a CommonLanguageSettings. - * @memberof google.api - * @interface ICommonLanguageSettings - * @property {string|null} [referenceDocsUri] CommonLanguageSettings referenceDocsUri - * @property {Array.|null} [destinations] CommonLanguageSettings destinations - */ - - /** - * Constructs a new CommonLanguageSettings. - * @memberof google.api - * @classdesc Represents a CommonLanguageSettings. - * @implements ICommonLanguageSettings - * @constructor - * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set - */ - function CommonLanguageSettings(properties) { - this.destinations = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CommonLanguageSettings referenceDocsUri. - * @member {string} referenceDocsUri - * @memberof google.api.CommonLanguageSettings - * @instance - */ - CommonLanguageSettings.prototype.referenceDocsUri = ""; - - /** - * CommonLanguageSettings destinations. - * @member {Array.} destinations - * @memberof google.api.CommonLanguageSettings - * @instance - */ - CommonLanguageSettings.prototype.destinations = $util.emptyArray; - - /** - * Creates a new CommonLanguageSettings instance using the specified properties. - * @function create - * @memberof google.api.CommonLanguageSettings - * @static - * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set - * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings instance - */ - CommonLanguageSettings.create = function create(properties) { - return new CommonLanguageSettings(properties); - }; - - /** - * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. - * @function encode - * @memberof google.api.CommonLanguageSettings - * @static - * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CommonLanguageSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.referenceDocsUri != null && Object.hasOwnProperty.call(message, "referenceDocsUri")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.referenceDocsUri); - if (message.destinations != null && message.destinations.length) { - writer.uint32(/* id 2, wireType 2 =*/18).fork(); - for (var i = 0; i < message.destinations.length; ++i) - writer.int32(message.destinations[i]); - writer.ldelim(); - } - return writer; - }; - - /** - * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.CommonLanguageSettings - * @static - * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CommonLanguageSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CommonLanguageSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.CommonLanguageSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CommonLanguageSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CommonLanguageSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.referenceDocsUri = reader.string(); - break; - } - case 2: { - if (!(message.destinations && message.destinations.length)) - message.destinations = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.destinations.push(reader.int32()); - } else - message.destinations.push(reader.int32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.CommonLanguageSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CommonLanguageSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CommonLanguageSettings message. - * @function verify - * @memberof google.api.CommonLanguageSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CommonLanguageSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) - if (!$util.isString(message.referenceDocsUri)) - return "referenceDocsUri: string expected"; - if (message.destinations != null && message.hasOwnProperty("destinations")) { - if (!Array.isArray(message.destinations)) - return "destinations: array expected"; - for (var i = 0; i < message.destinations.length; ++i) - switch (message.destinations[i]) { - default: - return "destinations: enum value[] expected"; - case 0: - case 10: - case 20: - break; - } - } - return null; - }; - - /** - * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.CommonLanguageSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings - */ - CommonLanguageSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.CommonLanguageSettings) - return object; - var message = new $root.google.api.CommonLanguageSettings(); - if (object.referenceDocsUri != null) - message.referenceDocsUri = String(object.referenceDocsUri); - if (object.destinations) { - if (!Array.isArray(object.destinations)) - throw TypeError(".google.api.CommonLanguageSettings.destinations: array expected"); - message.destinations = []; - for (var i = 0; i < object.destinations.length; ++i) - switch (object.destinations[i]) { - default: - if (typeof object.destinations[i] === "number") { - message.destinations[i] = object.destinations[i]; - break; - } - case "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": - case 0: - message.destinations[i] = 0; - break; - case "GITHUB": - case 10: - message.destinations[i] = 10; - break; - case "PACKAGE_MANAGER": - case 20: - message.destinations[i] = 20; - break; - } - } - return message; - }; - - /** - * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.CommonLanguageSettings - * @static - * @param {google.api.CommonLanguageSettings} message CommonLanguageSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CommonLanguageSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.destinations = []; - if (options.defaults) - object.referenceDocsUri = ""; - if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) - object.referenceDocsUri = message.referenceDocsUri; - if (message.destinations && message.destinations.length) { - object.destinations = []; - for (var j = 0; j < message.destinations.length; ++j) - object.destinations[j] = options.enums === String ? $root.google.api.ClientLibraryDestination[message.destinations[j]] === undefined ? message.destinations[j] : $root.google.api.ClientLibraryDestination[message.destinations[j]] : message.destinations[j]; - } - return object; - }; - - /** - * Converts this CommonLanguageSettings to JSON. - * @function toJSON - * @memberof google.api.CommonLanguageSettings - * @instance - * @returns {Object.} JSON object - */ - CommonLanguageSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CommonLanguageSettings - * @function getTypeUrl - * @memberof google.api.CommonLanguageSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CommonLanguageSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.CommonLanguageSettings"; - }; - - return CommonLanguageSettings; - })(); - - api.ClientLibrarySettings = (function() { - - /** - * Properties of a ClientLibrarySettings. - * @memberof google.api - * @interface IClientLibrarySettings - * @property {string|null} [version] ClientLibrarySettings version - * @property {google.api.LaunchStage|null} [launchStage] ClientLibrarySettings launchStage - * @property {boolean|null} [restNumericEnums] ClientLibrarySettings restNumericEnums - * @property {google.api.IJavaSettings|null} [javaSettings] ClientLibrarySettings javaSettings - * @property {google.api.ICppSettings|null} [cppSettings] ClientLibrarySettings cppSettings - * @property {google.api.IPhpSettings|null} [phpSettings] ClientLibrarySettings phpSettings - * @property {google.api.IPythonSettings|null} [pythonSettings] ClientLibrarySettings pythonSettings - * @property {google.api.INodeSettings|null} [nodeSettings] ClientLibrarySettings nodeSettings - * @property {google.api.IDotnetSettings|null} [dotnetSettings] ClientLibrarySettings dotnetSettings - * @property {google.api.IRubySettings|null} [rubySettings] ClientLibrarySettings rubySettings - * @property {google.api.IGoSettings|null} [goSettings] ClientLibrarySettings goSettings - */ - - /** - * Constructs a new ClientLibrarySettings. - * @memberof google.api - * @classdesc Represents a ClientLibrarySettings. - * @implements IClientLibrarySettings - * @constructor - * @param {google.api.IClientLibrarySettings=} [properties] Properties to set - */ - function ClientLibrarySettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ClientLibrarySettings version. - * @member {string} version - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.version = ""; - - /** - * ClientLibrarySettings launchStage. - * @member {google.api.LaunchStage} launchStage - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.launchStage = 0; - - /** - * ClientLibrarySettings restNumericEnums. - * @member {boolean} restNumericEnums - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.restNumericEnums = false; - - /** - * ClientLibrarySettings javaSettings. - * @member {google.api.IJavaSettings|null|undefined} javaSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.javaSettings = null; - - /** - * ClientLibrarySettings cppSettings. - * @member {google.api.ICppSettings|null|undefined} cppSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.cppSettings = null; - - /** - * ClientLibrarySettings phpSettings. - * @member {google.api.IPhpSettings|null|undefined} phpSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.phpSettings = null; - - /** - * ClientLibrarySettings pythonSettings. - * @member {google.api.IPythonSettings|null|undefined} pythonSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.pythonSettings = null; - - /** - * ClientLibrarySettings nodeSettings. - * @member {google.api.INodeSettings|null|undefined} nodeSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.nodeSettings = null; - - /** - * ClientLibrarySettings dotnetSettings. - * @member {google.api.IDotnetSettings|null|undefined} dotnetSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.dotnetSettings = null; - - /** - * ClientLibrarySettings rubySettings. - * @member {google.api.IRubySettings|null|undefined} rubySettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.rubySettings = null; - - /** - * ClientLibrarySettings goSettings. - * @member {google.api.IGoSettings|null|undefined} goSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.goSettings = null; - - /** - * Creates a new ClientLibrarySettings instance using the specified properties. - * @function create - * @memberof google.api.ClientLibrarySettings - * @static - * @param {google.api.IClientLibrarySettings=} [properties] Properties to set - * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings instance - */ - ClientLibrarySettings.create = function create(properties) { - return new ClientLibrarySettings(properties); - }; - - /** - * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. - * @function encode - * @memberof google.api.ClientLibrarySettings - * @static - * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClientLibrarySettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); - if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.launchStage); - if (message.restNumericEnums != null && Object.hasOwnProperty.call(message, "restNumericEnums")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.restNumericEnums); - if (message.javaSettings != null && Object.hasOwnProperty.call(message, "javaSettings")) - $root.google.api.JavaSettings.encode(message.javaSettings, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); - if (message.cppSettings != null && Object.hasOwnProperty.call(message, "cppSettings")) - $root.google.api.CppSettings.encode(message.cppSettings, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); - if (message.phpSettings != null && Object.hasOwnProperty.call(message, "phpSettings")) - $root.google.api.PhpSettings.encode(message.phpSettings, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); - if (message.pythonSettings != null && Object.hasOwnProperty.call(message, "pythonSettings")) - $root.google.api.PythonSettings.encode(message.pythonSettings, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); - if (message.nodeSettings != null && Object.hasOwnProperty.call(message, "nodeSettings")) - $root.google.api.NodeSettings.encode(message.nodeSettings, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); - if (message.dotnetSettings != null && Object.hasOwnProperty.call(message, "dotnetSettings")) - $root.google.api.DotnetSettings.encode(message.dotnetSettings, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); - if (message.rubySettings != null && Object.hasOwnProperty.call(message, "rubySettings")) - $root.google.api.RubySettings.encode(message.rubySettings, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); - if (message.goSettings != null && Object.hasOwnProperty.call(message, "goSettings")) - $root.google.api.GoSettings.encode(message.goSettings, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.ClientLibrarySettings - * @static - * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClientLibrarySettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ClientLibrarySettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.ClientLibrarySettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClientLibrarySettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ClientLibrarySettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.version = reader.string(); - break; - } - case 2: { - message.launchStage = reader.int32(); - break; - } - case 3: { - message.restNumericEnums = reader.bool(); - break; - } - case 21: { - message.javaSettings = $root.google.api.JavaSettings.decode(reader, reader.uint32()); - break; - } - case 22: { - message.cppSettings = $root.google.api.CppSettings.decode(reader, reader.uint32()); - break; - } - case 23: { - message.phpSettings = $root.google.api.PhpSettings.decode(reader, reader.uint32()); - break; - } - case 24: { - message.pythonSettings = $root.google.api.PythonSettings.decode(reader, reader.uint32()); - break; - } - case 25: { - message.nodeSettings = $root.google.api.NodeSettings.decode(reader, reader.uint32()); - break; - } - case 26: { - message.dotnetSettings = $root.google.api.DotnetSettings.decode(reader, reader.uint32()); - break; - } - case 27: { - message.rubySettings = $root.google.api.RubySettings.decode(reader, reader.uint32()); - break; - } - case 28: { - message.goSettings = $root.google.api.GoSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.ClientLibrarySettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClientLibrarySettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ClientLibrarySettings message. - * @function verify - * @memberof google.api.ClientLibrarySettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ClientLibrarySettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.version != null && message.hasOwnProperty("version")) - if (!$util.isString(message.version)) - return "version: string expected"; - if (message.launchStage != null && message.hasOwnProperty("launchStage")) - switch (message.launchStage) { - default: - return "launchStage: enum value expected"; - case 0: - case 6: - case 7: - case 1: - case 2: - case 3: - case 4: - case 5: - break; - } - if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) - if (typeof message.restNumericEnums !== "boolean") - return "restNumericEnums: boolean expected"; - if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) { - var error = $root.google.api.JavaSettings.verify(message.javaSettings); - if (error) - return "javaSettings." + error; - } - if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) { - var error = $root.google.api.CppSettings.verify(message.cppSettings); - if (error) - return "cppSettings." + error; - } - if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) { - var error = $root.google.api.PhpSettings.verify(message.phpSettings); - if (error) - return "phpSettings." + error; - } - if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) { - var error = $root.google.api.PythonSettings.verify(message.pythonSettings); - if (error) - return "pythonSettings." + error; - } - if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) { - var error = $root.google.api.NodeSettings.verify(message.nodeSettings); - if (error) - return "nodeSettings." + error; - } - if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) { - var error = $root.google.api.DotnetSettings.verify(message.dotnetSettings); - if (error) - return "dotnetSettings." + error; - } - if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) { - var error = $root.google.api.RubySettings.verify(message.rubySettings); - if (error) - return "rubySettings." + error; - } - if (message.goSettings != null && message.hasOwnProperty("goSettings")) { - var error = $root.google.api.GoSettings.verify(message.goSettings); - if (error) - return "goSettings." + error; - } - return null; - }; - - /** - * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.ClientLibrarySettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings - */ - ClientLibrarySettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.ClientLibrarySettings) - return object; - var message = new $root.google.api.ClientLibrarySettings(); - if (object.version != null) - message.version = String(object.version); - switch (object.launchStage) { - default: - if (typeof object.launchStage === "number") { - message.launchStage = object.launchStage; - break; - } - break; - case "LAUNCH_STAGE_UNSPECIFIED": - case 0: - message.launchStage = 0; - break; - case "UNIMPLEMENTED": - case 6: - message.launchStage = 6; - break; - case "PRELAUNCH": - case 7: - message.launchStage = 7; - break; - case "EARLY_ACCESS": - case 1: - message.launchStage = 1; - break; - case "ALPHA": - case 2: - message.launchStage = 2; - break; - case "BETA": - case 3: - message.launchStage = 3; - break; - case "GA": - case 4: - message.launchStage = 4; - break; - case "DEPRECATED": - case 5: - message.launchStage = 5; - break; - } - if (object.restNumericEnums != null) - message.restNumericEnums = Boolean(object.restNumericEnums); - if (object.javaSettings != null) { - if (typeof object.javaSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.javaSettings: object expected"); - message.javaSettings = $root.google.api.JavaSettings.fromObject(object.javaSettings); - } - if (object.cppSettings != null) { - if (typeof object.cppSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.cppSettings: object expected"); - message.cppSettings = $root.google.api.CppSettings.fromObject(object.cppSettings); - } - if (object.phpSettings != null) { - if (typeof object.phpSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.phpSettings: object expected"); - message.phpSettings = $root.google.api.PhpSettings.fromObject(object.phpSettings); - } - if (object.pythonSettings != null) { - if (typeof object.pythonSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.pythonSettings: object expected"); - message.pythonSettings = $root.google.api.PythonSettings.fromObject(object.pythonSettings); - } - if (object.nodeSettings != null) { - if (typeof object.nodeSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.nodeSettings: object expected"); - message.nodeSettings = $root.google.api.NodeSettings.fromObject(object.nodeSettings); - } - if (object.dotnetSettings != null) { - if (typeof object.dotnetSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.dotnetSettings: object expected"); - message.dotnetSettings = $root.google.api.DotnetSettings.fromObject(object.dotnetSettings); - } - if (object.rubySettings != null) { - if (typeof object.rubySettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.rubySettings: object expected"); - message.rubySettings = $root.google.api.RubySettings.fromObject(object.rubySettings); - } - if (object.goSettings != null) { - if (typeof object.goSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.goSettings: object expected"); - message.goSettings = $root.google.api.GoSettings.fromObject(object.goSettings); - } - return message; - }; - - /** - * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.ClientLibrarySettings - * @static - * @param {google.api.ClientLibrarySettings} message ClientLibrarySettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ClientLibrarySettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.version = ""; - object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; - object.restNumericEnums = false; - object.javaSettings = null; - object.cppSettings = null; - object.phpSettings = null; - object.pythonSettings = null; - object.nodeSettings = null; - object.dotnetSettings = null; - object.rubySettings = null; - object.goSettings = null; - } - if (message.version != null && message.hasOwnProperty("version")) - object.version = message.version; - if (message.launchStage != null && message.hasOwnProperty("launchStage")) - object.launchStage = options.enums === String ? $root.google.api.LaunchStage[message.launchStage] === undefined ? message.launchStage : $root.google.api.LaunchStage[message.launchStage] : message.launchStage; - if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) - object.restNumericEnums = message.restNumericEnums; - if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) - object.javaSettings = $root.google.api.JavaSettings.toObject(message.javaSettings, options); - if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) - object.cppSettings = $root.google.api.CppSettings.toObject(message.cppSettings, options); - if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) - object.phpSettings = $root.google.api.PhpSettings.toObject(message.phpSettings, options); - if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) - object.pythonSettings = $root.google.api.PythonSettings.toObject(message.pythonSettings, options); - if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) - object.nodeSettings = $root.google.api.NodeSettings.toObject(message.nodeSettings, options); - if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) - object.dotnetSettings = $root.google.api.DotnetSettings.toObject(message.dotnetSettings, options); - if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) - object.rubySettings = $root.google.api.RubySettings.toObject(message.rubySettings, options); - if (message.goSettings != null && message.hasOwnProperty("goSettings")) - object.goSettings = $root.google.api.GoSettings.toObject(message.goSettings, options); - return object; - }; - - /** - * Converts this ClientLibrarySettings to JSON. - * @function toJSON - * @memberof google.api.ClientLibrarySettings - * @instance - * @returns {Object.} JSON object - */ - ClientLibrarySettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ClientLibrarySettings - * @function getTypeUrl - * @memberof google.api.ClientLibrarySettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ClientLibrarySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.ClientLibrarySettings"; - }; - - return ClientLibrarySettings; - })(); - - api.Publishing = (function() { - - /** - * Properties of a Publishing. - * @memberof google.api - * @interface IPublishing - * @property {Array.|null} [methodSettings] Publishing methodSettings - * @property {string|null} [newIssueUri] Publishing newIssueUri - * @property {string|null} [documentationUri] Publishing documentationUri - * @property {string|null} [apiShortName] Publishing apiShortName - * @property {string|null} [githubLabel] Publishing githubLabel - * @property {Array.|null} [codeownerGithubTeams] Publishing codeownerGithubTeams - * @property {string|null} [docTagPrefix] Publishing docTagPrefix - * @property {google.api.ClientLibraryOrganization|null} [organization] Publishing organization - * @property {Array.|null} [librarySettings] Publishing librarySettings - * @property {string|null} [protoReferenceDocumentationUri] Publishing protoReferenceDocumentationUri - * @property {string|null} [restReferenceDocumentationUri] Publishing restReferenceDocumentationUri - */ - - /** - * Constructs a new Publishing. - * @memberof google.api - * @classdesc Represents a Publishing. - * @implements IPublishing - * @constructor - * @param {google.api.IPublishing=} [properties] Properties to set - */ - function Publishing(properties) { - this.methodSettings = []; - this.codeownerGithubTeams = []; - this.librarySettings = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Publishing methodSettings. - * @member {Array.} methodSettings - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.methodSettings = $util.emptyArray; - - /** - * Publishing newIssueUri. - * @member {string} newIssueUri - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.newIssueUri = ""; - - /** - * Publishing documentationUri. - * @member {string} documentationUri - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.documentationUri = ""; - - /** - * Publishing apiShortName. - * @member {string} apiShortName - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.apiShortName = ""; - - /** - * Publishing githubLabel. - * @member {string} githubLabel - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.githubLabel = ""; - - /** - * Publishing codeownerGithubTeams. - * @member {Array.} codeownerGithubTeams - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.codeownerGithubTeams = $util.emptyArray; - - /** - * Publishing docTagPrefix. - * @member {string} docTagPrefix - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.docTagPrefix = ""; - - /** - * Publishing organization. - * @member {google.api.ClientLibraryOrganization} organization - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.organization = 0; - - /** - * Publishing librarySettings. - * @member {Array.} librarySettings - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.librarySettings = $util.emptyArray; - - /** - * Publishing protoReferenceDocumentationUri. - * @member {string} protoReferenceDocumentationUri - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.protoReferenceDocumentationUri = ""; - - /** - * Publishing restReferenceDocumentationUri. - * @member {string} restReferenceDocumentationUri - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.restReferenceDocumentationUri = ""; - - /** - * Creates a new Publishing instance using the specified properties. - * @function create - * @memberof google.api.Publishing - * @static - * @param {google.api.IPublishing=} [properties] Properties to set - * @returns {google.api.Publishing} Publishing instance - */ - Publishing.create = function create(properties) { - return new Publishing(properties); - }; - - /** - * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. - * @function encode - * @memberof google.api.Publishing - * @static - * @param {google.api.IPublishing} message Publishing message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Publishing.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.methodSettings != null && message.methodSettings.length) - for (var i = 0; i < message.methodSettings.length; ++i) - $root.google.api.MethodSettings.encode(message.methodSettings[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.newIssueUri != null && Object.hasOwnProperty.call(message, "newIssueUri")) - writer.uint32(/* id 101, wireType 2 =*/810).string(message.newIssueUri); - if (message.documentationUri != null && Object.hasOwnProperty.call(message, "documentationUri")) - writer.uint32(/* id 102, wireType 2 =*/818).string(message.documentationUri); - if (message.apiShortName != null && Object.hasOwnProperty.call(message, "apiShortName")) - writer.uint32(/* id 103, wireType 2 =*/826).string(message.apiShortName); - if (message.githubLabel != null && Object.hasOwnProperty.call(message, "githubLabel")) - writer.uint32(/* id 104, wireType 2 =*/834).string(message.githubLabel); - if (message.codeownerGithubTeams != null && message.codeownerGithubTeams.length) - for (var i = 0; i < message.codeownerGithubTeams.length; ++i) - writer.uint32(/* id 105, wireType 2 =*/842).string(message.codeownerGithubTeams[i]); - if (message.docTagPrefix != null && Object.hasOwnProperty.call(message, "docTagPrefix")) - writer.uint32(/* id 106, wireType 2 =*/850).string(message.docTagPrefix); - if (message.organization != null && Object.hasOwnProperty.call(message, "organization")) - writer.uint32(/* id 107, wireType 0 =*/856).int32(message.organization); - if (message.librarySettings != null && message.librarySettings.length) - for (var i = 0; i < message.librarySettings.length; ++i) - $root.google.api.ClientLibrarySettings.encode(message.librarySettings[i], writer.uint32(/* id 109, wireType 2 =*/874).fork()).ldelim(); - if (message.protoReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "protoReferenceDocumentationUri")) - writer.uint32(/* id 110, wireType 2 =*/882).string(message.protoReferenceDocumentationUri); - if (message.restReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "restReferenceDocumentationUri")) - writer.uint32(/* id 111, wireType 2 =*/890).string(message.restReferenceDocumentationUri); - return writer; - }; - - /** - * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.Publishing - * @static - * @param {google.api.IPublishing} message Publishing message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Publishing.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Publishing message from the specified reader or buffer. - * @function decode - * @memberof google.api.Publishing - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.Publishing} Publishing - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Publishing.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Publishing(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - if (!(message.methodSettings && message.methodSettings.length)) - message.methodSettings = []; - message.methodSettings.push($root.google.api.MethodSettings.decode(reader, reader.uint32())); - break; - } - case 101: { - message.newIssueUri = reader.string(); - break; - } - case 102: { - message.documentationUri = reader.string(); - break; - } - case 103: { - message.apiShortName = reader.string(); - break; - } - case 104: { - message.githubLabel = reader.string(); - break; - } - case 105: { - if (!(message.codeownerGithubTeams && message.codeownerGithubTeams.length)) - message.codeownerGithubTeams = []; - message.codeownerGithubTeams.push(reader.string()); - break; - } - case 106: { - message.docTagPrefix = reader.string(); - break; - } - case 107: { - message.organization = reader.int32(); - break; - } - case 109: { - if (!(message.librarySettings && message.librarySettings.length)) - message.librarySettings = []; - message.librarySettings.push($root.google.api.ClientLibrarySettings.decode(reader, reader.uint32())); - break; - } - case 110: { - message.protoReferenceDocumentationUri = reader.string(); - break; - } - case 111: { - message.restReferenceDocumentationUri = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Publishing message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.Publishing - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.Publishing} Publishing - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Publishing.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Publishing message. - * @function verify - * @memberof google.api.Publishing - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Publishing.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.methodSettings != null && message.hasOwnProperty("methodSettings")) { - if (!Array.isArray(message.methodSettings)) - return "methodSettings: array expected"; - for (var i = 0; i < message.methodSettings.length; ++i) { - var error = $root.google.api.MethodSettings.verify(message.methodSettings[i]); - if (error) - return "methodSettings." + error; - } - } - if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) - if (!$util.isString(message.newIssueUri)) - return "newIssueUri: string expected"; - if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) - if (!$util.isString(message.documentationUri)) - return "documentationUri: string expected"; - if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) - if (!$util.isString(message.apiShortName)) - return "apiShortName: string expected"; - if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) - if (!$util.isString(message.githubLabel)) - return "githubLabel: string expected"; - if (message.codeownerGithubTeams != null && message.hasOwnProperty("codeownerGithubTeams")) { - if (!Array.isArray(message.codeownerGithubTeams)) - return "codeownerGithubTeams: array expected"; - for (var i = 0; i < message.codeownerGithubTeams.length; ++i) - if (!$util.isString(message.codeownerGithubTeams[i])) - return "codeownerGithubTeams: string[] expected"; - } - if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) - if (!$util.isString(message.docTagPrefix)) - return "docTagPrefix: string expected"; - if (message.organization != null && message.hasOwnProperty("organization")) - switch (message.organization) { - default: - return "organization: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - break; - } - if (message.librarySettings != null && message.hasOwnProperty("librarySettings")) { - if (!Array.isArray(message.librarySettings)) - return "librarySettings: array expected"; - for (var i = 0; i < message.librarySettings.length; ++i) { - var error = $root.google.api.ClientLibrarySettings.verify(message.librarySettings[i]); - if (error) - return "librarySettings." + error; - } - } - if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) - if (!$util.isString(message.protoReferenceDocumentationUri)) - return "protoReferenceDocumentationUri: string expected"; - if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) - if (!$util.isString(message.restReferenceDocumentationUri)) - return "restReferenceDocumentationUri: string expected"; - return null; - }; - - /** - * Creates a Publishing message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.Publishing - * @static - * @param {Object.} object Plain object - * @returns {google.api.Publishing} Publishing - */ - Publishing.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.Publishing) - return object; - var message = new $root.google.api.Publishing(); - if (object.methodSettings) { - if (!Array.isArray(object.methodSettings)) - throw TypeError(".google.api.Publishing.methodSettings: array expected"); - message.methodSettings = []; - for (var i = 0; i < object.methodSettings.length; ++i) { - if (typeof object.methodSettings[i] !== "object") - throw TypeError(".google.api.Publishing.methodSettings: object expected"); - message.methodSettings[i] = $root.google.api.MethodSettings.fromObject(object.methodSettings[i]); - } - } - if (object.newIssueUri != null) - message.newIssueUri = String(object.newIssueUri); - if (object.documentationUri != null) - message.documentationUri = String(object.documentationUri); - if (object.apiShortName != null) - message.apiShortName = String(object.apiShortName); - if (object.githubLabel != null) - message.githubLabel = String(object.githubLabel); - if (object.codeownerGithubTeams) { - if (!Array.isArray(object.codeownerGithubTeams)) - throw TypeError(".google.api.Publishing.codeownerGithubTeams: array expected"); - message.codeownerGithubTeams = []; - for (var i = 0; i < object.codeownerGithubTeams.length; ++i) - message.codeownerGithubTeams[i] = String(object.codeownerGithubTeams[i]); - } - if (object.docTagPrefix != null) - message.docTagPrefix = String(object.docTagPrefix); - switch (object.organization) { - default: - if (typeof object.organization === "number") { - message.organization = object.organization; - break; - } - break; - case "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": - case 0: - message.organization = 0; - break; - case "CLOUD": - case 1: - message.organization = 1; - break; - case "ADS": - case 2: - message.organization = 2; - break; - case "PHOTOS": - case 3: - message.organization = 3; - break; - case "STREET_VIEW": - case 4: - message.organization = 4; - break; - case "SHOPPING": - case 5: - message.organization = 5; - break; - case "GEO": - case 6: - message.organization = 6; - break; - case "GENERATIVE_AI": - case 7: - message.organization = 7; - break; - } - if (object.librarySettings) { - if (!Array.isArray(object.librarySettings)) - throw TypeError(".google.api.Publishing.librarySettings: array expected"); - message.librarySettings = []; - for (var i = 0; i < object.librarySettings.length; ++i) { - if (typeof object.librarySettings[i] !== "object") - throw TypeError(".google.api.Publishing.librarySettings: object expected"); - message.librarySettings[i] = $root.google.api.ClientLibrarySettings.fromObject(object.librarySettings[i]); - } - } - if (object.protoReferenceDocumentationUri != null) - message.protoReferenceDocumentationUri = String(object.protoReferenceDocumentationUri); - if (object.restReferenceDocumentationUri != null) - message.restReferenceDocumentationUri = String(object.restReferenceDocumentationUri); - return message; - }; - - /** - * Creates a plain object from a Publishing message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.Publishing - * @static - * @param {google.api.Publishing} message Publishing - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Publishing.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.methodSettings = []; - object.codeownerGithubTeams = []; - object.librarySettings = []; - } - if (options.defaults) { - object.newIssueUri = ""; - object.documentationUri = ""; - object.apiShortName = ""; - object.githubLabel = ""; - object.docTagPrefix = ""; - object.organization = options.enums === String ? "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED" : 0; - object.protoReferenceDocumentationUri = ""; - object.restReferenceDocumentationUri = ""; - } - if (message.methodSettings && message.methodSettings.length) { - object.methodSettings = []; - for (var j = 0; j < message.methodSettings.length; ++j) - object.methodSettings[j] = $root.google.api.MethodSettings.toObject(message.methodSettings[j], options); - } - if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) - object.newIssueUri = message.newIssueUri; - if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) - object.documentationUri = message.documentationUri; - if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) - object.apiShortName = message.apiShortName; - if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) - object.githubLabel = message.githubLabel; - if (message.codeownerGithubTeams && message.codeownerGithubTeams.length) { - object.codeownerGithubTeams = []; - for (var j = 0; j < message.codeownerGithubTeams.length; ++j) - object.codeownerGithubTeams[j] = message.codeownerGithubTeams[j]; - } - if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) - object.docTagPrefix = message.docTagPrefix; - if (message.organization != null && message.hasOwnProperty("organization")) - object.organization = options.enums === String ? $root.google.api.ClientLibraryOrganization[message.organization] === undefined ? message.organization : $root.google.api.ClientLibraryOrganization[message.organization] : message.organization; - if (message.librarySettings && message.librarySettings.length) { - object.librarySettings = []; - for (var j = 0; j < message.librarySettings.length; ++j) - object.librarySettings[j] = $root.google.api.ClientLibrarySettings.toObject(message.librarySettings[j], options); - } - if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) - object.protoReferenceDocumentationUri = message.protoReferenceDocumentationUri; - if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) - object.restReferenceDocumentationUri = message.restReferenceDocumentationUri; - return object; - }; - - /** - * Converts this Publishing to JSON. - * @function toJSON - * @memberof google.api.Publishing - * @instance - * @returns {Object.} JSON object - */ - Publishing.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Publishing - * @function getTypeUrl - * @memberof google.api.Publishing - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Publishing.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.Publishing"; - }; - - return Publishing; - })(); - - api.JavaSettings = (function() { - - /** - * Properties of a JavaSettings. - * @memberof google.api - * @interface IJavaSettings - * @property {string|null} [libraryPackage] JavaSettings libraryPackage - * @property {Object.|null} [serviceClassNames] JavaSettings serviceClassNames - * @property {google.api.ICommonLanguageSettings|null} [common] JavaSettings common - */ - - /** - * Constructs a new JavaSettings. - * @memberof google.api - * @classdesc Represents a JavaSettings. - * @implements IJavaSettings - * @constructor - * @param {google.api.IJavaSettings=} [properties] Properties to set - */ - function JavaSettings(properties) { - this.serviceClassNames = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * JavaSettings libraryPackage. - * @member {string} libraryPackage - * @memberof google.api.JavaSettings - * @instance - */ - JavaSettings.prototype.libraryPackage = ""; - - /** - * JavaSettings serviceClassNames. - * @member {Object.} serviceClassNames - * @memberof google.api.JavaSettings - * @instance - */ - JavaSettings.prototype.serviceClassNames = $util.emptyObject; - - /** - * JavaSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.JavaSettings - * @instance - */ - JavaSettings.prototype.common = null; - - /** - * Creates a new JavaSettings instance using the specified properties. - * @function create - * @memberof google.api.JavaSettings - * @static - * @param {google.api.IJavaSettings=} [properties] Properties to set - * @returns {google.api.JavaSettings} JavaSettings instance - */ - JavaSettings.create = function create(properties) { - return new JavaSettings(properties); - }; - - /** - * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. - * @function encode - * @memberof google.api.JavaSettings - * @static - * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - JavaSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.libraryPackage != null && Object.hasOwnProperty.call(message, "libraryPackage")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.libraryPackage); - if (message.serviceClassNames != null && Object.hasOwnProperty.call(message, "serviceClassNames")) - for (var keys = Object.keys(message.serviceClassNames), i = 0; i < keys.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.serviceClassNames[keys[i]]).ldelim(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.JavaSettings - * @static - * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - JavaSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a JavaSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.JavaSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.JavaSettings} JavaSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - JavaSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.JavaSettings(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.libraryPackage = reader.string(); - break; - } - case 2: { - if (message.serviceClassNames === $util.emptyObject) - message.serviceClassNames = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.serviceClassNames[key] = value; - break; - } - case 3: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a JavaSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.JavaSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.JavaSettings} JavaSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - JavaSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a JavaSettings message. - * @function verify - * @memberof google.api.JavaSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - JavaSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) - if (!$util.isString(message.libraryPackage)) - return "libraryPackage: string expected"; - if (message.serviceClassNames != null && message.hasOwnProperty("serviceClassNames")) { - if (!$util.isObject(message.serviceClassNames)) - return "serviceClassNames: object expected"; - var key = Object.keys(message.serviceClassNames); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.serviceClassNames[key[i]])) - return "serviceClassNames: string{k:string} expected"; - } - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.JavaSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.JavaSettings} JavaSettings - */ - JavaSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.JavaSettings) - return object; - var message = new $root.google.api.JavaSettings(); - if (object.libraryPackage != null) - message.libraryPackage = String(object.libraryPackage); - if (object.serviceClassNames) { - if (typeof object.serviceClassNames !== "object") - throw TypeError(".google.api.JavaSettings.serviceClassNames: object expected"); - message.serviceClassNames = {}; - for (var keys = Object.keys(object.serviceClassNames), i = 0; i < keys.length; ++i) - message.serviceClassNames[keys[i]] = String(object.serviceClassNames[keys[i]]); - } - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.JavaSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.JavaSettings - * @static - * @param {google.api.JavaSettings} message JavaSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - JavaSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.serviceClassNames = {}; - if (options.defaults) { - object.libraryPackage = ""; - object.common = null; - } - if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) - object.libraryPackage = message.libraryPackage; - var keys2; - if (message.serviceClassNames && (keys2 = Object.keys(message.serviceClassNames)).length) { - object.serviceClassNames = {}; - for (var j = 0; j < keys2.length; ++j) - object.serviceClassNames[keys2[j]] = message.serviceClassNames[keys2[j]]; - } - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this JavaSettings to JSON. - * @function toJSON - * @memberof google.api.JavaSettings - * @instance - * @returns {Object.} JSON object - */ - JavaSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for JavaSettings - * @function getTypeUrl - * @memberof google.api.JavaSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - JavaSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.JavaSettings"; - }; - - return JavaSettings; - })(); - - api.CppSettings = (function() { - - /** - * Properties of a CppSettings. - * @memberof google.api - * @interface ICppSettings - * @property {google.api.ICommonLanguageSettings|null} [common] CppSettings common - */ - - /** - * Constructs a new CppSettings. - * @memberof google.api - * @classdesc Represents a CppSettings. - * @implements ICppSettings - * @constructor - * @param {google.api.ICppSettings=} [properties] Properties to set - */ - function CppSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CppSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.CppSettings - * @instance - */ - CppSettings.prototype.common = null; - - /** - * Creates a new CppSettings instance using the specified properties. - * @function create - * @memberof google.api.CppSettings - * @static - * @param {google.api.ICppSettings=} [properties] Properties to set - * @returns {google.api.CppSettings} CppSettings instance - */ - CppSettings.create = function create(properties) { - return new CppSettings(properties); - }; - - /** - * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. - * @function encode - * @memberof google.api.CppSettings - * @static - * @param {google.api.ICppSettings} message CppSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CppSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.CppSettings - * @static - * @param {google.api.ICppSettings} message CppSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CppSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CppSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.CppSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.CppSettings} CppSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CppSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CppSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CppSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.CppSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.CppSettings} CppSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CppSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CppSettings message. - * @function verify - * @memberof google.api.CppSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CppSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.CppSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.CppSettings} CppSettings - */ - CppSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.CppSettings) - return object; - var message = new $root.google.api.CppSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.CppSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a CppSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.CppSettings - * @static - * @param {google.api.CppSettings} message CppSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CppSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this CppSettings to JSON. - * @function toJSON - * @memberof google.api.CppSettings - * @instance - * @returns {Object.} JSON object - */ - CppSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CppSettings - * @function getTypeUrl - * @memberof google.api.CppSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CppSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.CppSettings"; - }; - - return CppSettings; - })(); - - api.PhpSettings = (function() { - - /** - * Properties of a PhpSettings. - * @memberof google.api - * @interface IPhpSettings - * @property {google.api.ICommonLanguageSettings|null} [common] PhpSettings common - */ - - /** - * Constructs a new PhpSettings. - * @memberof google.api - * @classdesc Represents a PhpSettings. - * @implements IPhpSettings - * @constructor - * @param {google.api.IPhpSettings=} [properties] Properties to set - */ - function PhpSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PhpSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.PhpSettings - * @instance - */ - PhpSettings.prototype.common = null; - - /** - * Creates a new PhpSettings instance using the specified properties. - * @function create - * @memberof google.api.PhpSettings - * @static - * @param {google.api.IPhpSettings=} [properties] Properties to set - * @returns {google.api.PhpSettings} PhpSettings instance - */ - PhpSettings.create = function create(properties) { - return new PhpSettings(properties); - }; - - /** - * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. - * @function encode - * @memberof google.api.PhpSettings - * @static - * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PhpSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.PhpSettings - * @static - * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PhpSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PhpSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.PhpSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.PhpSettings} PhpSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PhpSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PhpSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PhpSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.PhpSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.PhpSettings} PhpSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PhpSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PhpSettings message. - * @function verify - * @memberof google.api.PhpSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PhpSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.PhpSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.PhpSettings} PhpSettings - */ - PhpSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.PhpSettings) - return object; - var message = new $root.google.api.PhpSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.PhpSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.PhpSettings - * @static - * @param {google.api.PhpSettings} message PhpSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PhpSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this PhpSettings to JSON. - * @function toJSON - * @memberof google.api.PhpSettings - * @instance - * @returns {Object.} JSON object - */ - PhpSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PhpSettings - * @function getTypeUrl - * @memberof google.api.PhpSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PhpSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.PhpSettings"; - }; - - return PhpSettings; - })(); - - api.PythonSettings = (function() { - - /** - * Properties of a PythonSettings. - * @memberof google.api - * @interface IPythonSettings - * @property {google.api.ICommonLanguageSettings|null} [common] PythonSettings common - */ - - /** - * Constructs a new PythonSettings. - * @memberof google.api - * @classdesc Represents a PythonSettings. - * @implements IPythonSettings - * @constructor - * @param {google.api.IPythonSettings=} [properties] Properties to set - */ - function PythonSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PythonSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.PythonSettings - * @instance - */ - PythonSettings.prototype.common = null; - - /** - * Creates a new PythonSettings instance using the specified properties. - * @function create - * @memberof google.api.PythonSettings - * @static - * @param {google.api.IPythonSettings=} [properties] Properties to set - * @returns {google.api.PythonSettings} PythonSettings instance - */ - PythonSettings.create = function create(properties) { - return new PythonSettings(properties); - }; - - /** - * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. - * @function encode - * @memberof google.api.PythonSettings - * @static - * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PythonSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.PythonSettings - * @static - * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PythonSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PythonSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.PythonSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.PythonSettings} PythonSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PythonSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PythonSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PythonSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.PythonSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.PythonSettings} PythonSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PythonSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PythonSettings message. - * @function verify - * @memberof google.api.PythonSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PythonSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.PythonSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.PythonSettings} PythonSettings - */ - PythonSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.PythonSettings) - return object; - var message = new $root.google.api.PythonSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.PythonSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.PythonSettings - * @static - * @param {google.api.PythonSettings} message PythonSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PythonSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this PythonSettings to JSON. - * @function toJSON - * @memberof google.api.PythonSettings - * @instance - * @returns {Object.} JSON object - */ - PythonSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PythonSettings - * @function getTypeUrl - * @memberof google.api.PythonSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PythonSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.PythonSettings"; - }; - - return PythonSettings; - })(); - - api.NodeSettings = (function() { - - /** - * Properties of a NodeSettings. - * @memberof google.api - * @interface INodeSettings - * @property {google.api.ICommonLanguageSettings|null} [common] NodeSettings common - */ - - /** - * Constructs a new NodeSettings. - * @memberof google.api - * @classdesc Represents a NodeSettings. - * @implements INodeSettings - * @constructor - * @param {google.api.INodeSettings=} [properties] Properties to set - */ - function NodeSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * NodeSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.NodeSettings - * @instance - */ - NodeSettings.prototype.common = null; - - /** - * Creates a new NodeSettings instance using the specified properties. - * @function create - * @memberof google.api.NodeSettings - * @static - * @param {google.api.INodeSettings=} [properties] Properties to set - * @returns {google.api.NodeSettings} NodeSettings instance - */ - NodeSettings.create = function create(properties) { - return new NodeSettings(properties); - }; - - /** - * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. - * @function encode - * @memberof google.api.NodeSettings - * @static - * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NodeSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.NodeSettings - * @static - * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NodeSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a NodeSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.NodeSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.NodeSettings} NodeSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NodeSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.NodeSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a NodeSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.NodeSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.NodeSettings} NodeSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NodeSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a NodeSettings message. - * @function verify - * @memberof google.api.NodeSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - NodeSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.NodeSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.NodeSettings} NodeSettings - */ - NodeSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.NodeSettings) - return object; - var message = new $root.google.api.NodeSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.NodeSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.NodeSettings - * @static - * @param {google.api.NodeSettings} message NodeSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - NodeSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this NodeSettings to JSON. - * @function toJSON - * @memberof google.api.NodeSettings - * @instance - * @returns {Object.} JSON object - */ - NodeSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for NodeSettings - * @function getTypeUrl - * @memberof google.api.NodeSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - NodeSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.NodeSettings"; - }; - - return NodeSettings; - })(); - - api.DotnetSettings = (function() { - - /** - * Properties of a DotnetSettings. - * @memberof google.api - * @interface IDotnetSettings - * @property {google.api.ICommonLanguageSettings|null} [common] DotnetSettings common - * @property {Object.|null} [renamedServices] DotnetSettings renamedServices - * @property {Object.|null} [renamedResources] DotnetSettings renamedResources - * @property {Array.|null} [ignoredResources] DotnetSettings ignoredResources - * @property {Array.|null} [forcedNamespaceAliases] DotnetSettings forcedNamespaceAliases - * @property {Array.|null} [handwrittenSignatures] DotnetSettings handwrittenSignatures - */ - - /** - * Constructs a new DotnetSettings. - * @memberof google.api - * @classdesc Represents a DotnetSettings. - * @implements IDotnetSettings - * @constructor - * @param {google.api.IDotnetSettings=} [properties] Properties to set - */ - function DotnetSettings(properties) { - this.renamedServices = {}; - this.renamedResources = {}; - this.ignoredResources = []; - this.forcedNamespaceAliases = []; - this.handwrittenSignatures = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DotnetSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.common = null; - - /** - * DotnetSettings renamedServices. - * @member {Object.} renamedServices - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.renamedServices = $util.emptyObject; - - /** - * DotnetSettings renamedResources. - * @member {Object.} renamedResources - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.renamedResources = $util.emptyObject; - - /** - * DotnetSettings ignoredResources. - * @member {Array.} ignoredResources - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.ignoredResources = $util.emptyArray; - - /** - * DotnetSettings forcedNamespaceAliases. - * @member {Array.} forcedNamespaceAliases - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.forcedNamespaceAliases = $util.emptyArray; - - /** - * DotnetSettings handwrittenSignatures. - * @member {Array.} handwrittenSignatures - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.handwrittenSignatures = $util.emptyArray; - - /** - * Creates a new DotnetSettings instance using the specified properties. - * @function create - * @memberof google.api.DotnetSettings - * @static - * @param {google.api.IDotnetSettings=} [properties] Properties to set - * @returns {google.api.DotnetSettings} DotnetSettings instance - */ - DotnetSettings.create = function create(properties) { - return new DotnetSettings(properties); - }; - - /** - * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. - * @function encode - * @memberof google.api.DotnetSettings - * @static - * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DotnetSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.renamedServices != null && Object.hasOwnProperty.call(message, "renamedServices")) - for (var keys = Object.keys(message.renamedServices), i = 0; i < keys.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedServices[keys[i]]).ldelim(); - if (message.renamedResources != null && Object.hasOwnProperty.call(message, "renamedResources")) - for (var keys = Object.keys(message.renamedResources), i = 0; i < keys.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedResources[keys[i]]).ldelim(); - if (message.ignoredResources != null && message.ignoredResources.length) - for (var i = 0; i < message.ignoredResources.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.ignoredResources[i]); - if (message.forcedNamespaceAliases != null && message.forcedNamespaceAliases.length) - for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.forcedNamespaceAliases[i]); - if (message.handwrittenSignatures != null && message.handwrittenSignatures.length) - for (var i = 0; i < message.handwrittenSignatures.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.handwrittenSignatures[i]); - return writer; - }; - - /** - * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.DotnetSettings - * @static - * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DotnetSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DotnetSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.DotnetSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.DotnetSettings} DotnetSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DotnetSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.DotnetSettings(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - case 2: { - if (message.renamedServices === $util.emptyObject) - message.renamedServices = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.renamedServices[key] = value; - break; - } - case 3: { - if (message.renamedResources === $util.emptyObject) - message.renamedResources = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.renamedResources[key] = value; - break; - } - case 4: { - if (!(message.ignoredResources && message.ignoredResources.length)) - message.ignoredResources = []; - message.ignoredResources.push(reader.string()); - break; - } - case 5: { - if (!(message.forcedNamespaceAliases && message.forcedNamespaceAliases.length)) - message.forcedNamespaceAliases = []; - message.forcedNamespaceAliases.push(reader.string()); - break; - } - case 6: { - if (!(message.handwrittenSignatures && message.handwrittenSignatures.length)) - message.handwrittenSignatures = []; - message.handwrittenSignatures.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.DotnetSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.DotnetSettings} DotnetSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DotnetSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DotnetSettings message. - * @function verify - * @memberof google.api.DotnetSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DotnetSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - if (message.renamedServices != null && message.hasOwnProperty("renamedServices")) { - if (!$util.isObject(message.renamedServices)) - return "renamedServices: object expected"; - var key = Object.keys(message.renamedServices); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.renamedServices[key[i]])) - return "renamedServices: string{k:string} expected"; - } - if (message.renamedResources != null && message.hasOwnProperty("renamedResources")) { - if (!$util.isObject(message.renamedResources)) - return "renamedResources: object expected"; - var key = Object.keys(message.renamedResources); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.renamedResources[key[i]])) - return "renamedResources: string{k:string} expected"; - } - if (message.ignoredResources != null && message.hasOwnProperty("ignoredResources")) { - if (!Array.isArray(message.ignoredResources)) - return "ignoredResources: array expected"; - for (var i = 0; i < message.ignoredResources.length; ++i) - if (!$util.isString(message.ignoredResources[i])) - return "ignoredResources: string[] expected"; - } - if (message.forcedNamespaceAliases != null && message.hasOwnProperty("forcedNamespaceAliases")) { - if (!Array.isArray(message.forcedNamespaceAliases)) - return "forcedNamespaceAliases: array expected"; - for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) - if (!$util.isString(message.forcedNamespaceAliases[i])) - return "forcedNamespaceAliases: string[] expected"; - } - if (message.handwrittenSignatures != null && message.hasOwnProperty("handwrittenSignatures")) { - if (!Array.isArray(message.handwrittenSignatures)) - return "handwrittenSignatures: array expected"; - for (var i = 0; i < message.handwrittenSignatures.length; ++i) - if (!$util.isString(message.handwrittenSignatures[i])) - return "handwrittenSignatures: string[] expected"; - } - return null; - }; - - /** - * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.DotnetSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.DotnetSettings} DotnetSettings - */ - DotnetSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.DotnetSettings) - return object; - var message = new $root.google.api.DotnetSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.DotnetSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - if (object.renamedServices) { - if (typeof object.renamedServices !== "object") - throw TypeError(".google.api.DotnetSettings.renamedServices: object expected"); - message.renamedServices = {}; - for (var keys = Object.keys(object.renamedServices), i = 0; i < keys.length; ++i) - message.renamedServices[keys[i]] = String(object.renamedServices[keys[i]]); - } - if (object.renamedResources) { - if (typeof object.renamedResources !== "object") - throw TypeError(".google.api.DotnetSettings.renamedResources: object expected"); - message.renamedResources = {}; - for (var keys = Object.keys(object.renamedResources), i = 0; i < keys.length; ++i) - message.renamedResources[keys[i]] = String(object.renamedResources[keys[i]]); - } - if (object.ignoredResources) { - if (!Array.isArray(object.ignoredResources)) - throw TypeError(".google.api.DotnetSettings.ignoredResources: array expected"); - message.ignoredResources = []; - for (var i = 0; i < object.ignoredResources.length; ++i) - message.ignoredResources[i] = String(object.ignoredResources[i]); - } - if (object.forcedNamespaceAliases) { - if (!Array.isArray(object.forcedNamespaceAliases)) - throw TypeError(".google.api.DotnetSettings.forcedNamespaceAliases: array expected"); - message.forcedNamespaceAliases = []; - for (var i = 0; i < object.forcedNamespaceAliases.length; ++i) - message.forcedNamespaceAliases[i] = String(object.forcedNamespaceAliases[i]); - } - if (object.handwrittenSignatures) { - if (!Array.isArray(object.handwrittenSignatures)) - throw TypeError(".google.api.DotnetSettings.handwrittenSignatures: array expected"); - message.handwrittenSignatures = []; - for (var i = 0; i < object.handwrittenSignatures.length; ++i) - message.handwrittenSignatures[i] = String(object.handwrittenSignatures[i]); - } - return message; - }; - - /** - * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.DotnetSettings - * @static - * @param {google.api.DotnetSettings} message DotnetSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DotnetSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.ignoredResources = []; - object.forcedNamespaceAliases = []; - object.handwrittenSignatures = []; - } - if (options.objects || options.defaults) { - object.renamedServices = {}; - object.renamedResources = {}; - } - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - var keys2; - if (message.renamedServices && (keys2 = Object.keys(message.renamedServices)).length) { - object.renamedServices = {}; - for (var j = 0; j < keys2.length; ++j) - object.renamedServices[keys2[j]] = message.renamedServices[keys2[j]]; - } - if (message.renamedResources && (keys2 = Object.keys(message.renamedResources)).length) { - object.renamedResources = {}; - for (var j = 0; j < keys2.length; ++j) - object.renamedResources[keys2[j]] = message.renamedResources[keys2[j]]; - } - if (message.ignoredResources && message.ignoredResources.length) { - object.ignoredResources = []; - for (var j = 0; j < message.ignoredResources.length; ++j) - object.ignoredResources[j] = message.ignoredResources[j]; - } - if (message.forcedNamespaceAliases && message.forcedNamespaceAliases.length) { - object.forcedNamespaceAliases = []; - for (var j = 0; j < message.forcedNamespaceAliases.length; ++j) - object.forcedNamespaceAliases[j] = message.forcedNamespaceAliases[j]; - } - if (message.handwrittenSignatures && message.handwrittenSignatures.length) { - object.handwrittenSignatures = []; - for (var j = 0; j < message.handwrittenSignatures.length; ++j) - object.handwrittenSignatures[j] = message.handwrittenSignatures[j]; - } - return object; - }; - - /** - * Converts this DotnetSettings to JSON. - * @function toJSON - * @memberof google.api.DotnetSettings - * @instance - * @returns {Object.} JSON object - */ - DotnetSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DotnetSettings - * @function getTypeUrl - * @memberof google.api.DotnetSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DotnetSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.DotnetSettings"; - }; - - return DotnetSettings; - })(); - - api.RubySettings = (function() { - - /** - * Properties of a RubySettings. - * @memberof google.api - * @interface IRubySettings - * @property {google.api.ICommonLanguageSettings|null} [common] RubySettings common - */ - - /** - * Constructs a new RubySettings. - * @memberof google.api - * @classdesc Represents a RubySettings. - * @implements IRubySettings - * @constructor - * @param {google.api.IRubySettings=} [properties] Properties to set - */ - function RubySettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RubySettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.RubySettings - * @instance - */ - RubySettings.prototype.common = null; - - /** - * Creates a new RubySettings instance using the specified properties. - * @function create - * @memberof google.api.RubySettings - * @static - * @param {google.api.IRubySettings=} [properties] Properties to set - * @returns {google.api.RubySettings} RubySettings instance - */ - RubySettings.create = function create(properties) { - return new RubySettings(properties); - }; - - /** - * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. - * @function encode - * @memberof google.api.RubySettings - * @static - * @param {google.api.IRubySettings} message RubySettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RubySettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.RubySettings - * @static - * @param {google.api.IRubySettings} message RubySettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RubySettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RubySettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.RubySettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.RubySettings} RubySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RubySettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.RubySettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RubySettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.RubySettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.RubySettings} RubySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RubySettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RubySettings message. - * @function verify - * @memberof google.api.RubySettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RubySettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.RubySettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.RubySettings} RubySettings - */ - RubySettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.RubySettings) - return object; - var message = new $root.google.api.RubySettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.RubySettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a RubySettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.RubySettings - * @static - * @param {google.api.RubySettings} message RubySettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RubySettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this RubySettings to JSON. - * @function toJSON - * @memberof google.api.RubySettings - * @instance - * @returns {Object.} JSON object - */ - RubySettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RubySettings - * @function getTypeUrl - * @memberof google.api.RubySettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RubySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.RubySettings"; - }; - - return RubySettings; - })(); - - api.GoSettings = (function() { - - /** - * Properties of a GoSettings. - * @memberof google.api - * @interface IGoSettings - * @property {google.api.ICommonLanguageSettings|null} [common] GoSettings common - */ - - /** - * Constructs a new GoSettings. - * @memberof google.api - * @classdesc Represents a GoSettings. - * @implements IGoSettings - * @constructor - * @param {google.api.IGoSettings=} [properties] Properties to set - */ - function GoSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GoSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.GoSettings - * @instance - */ - GoSettings.prototype.common = null; - - /** - * Creates a new GoSettings instance using the specified properties. - * @function create - * @memberof google.api.GoSettings - * @static - * @param {google.api.IGoSettings=} [properties] Properties to set - * @returns {google.api.GoSettings} GoSettings instance - */ - GoSettings.create = function create(properties) { - return new GoSettings(properties); - }; - - /** - * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. - * @function encode - * @memberof google.api.GoSettings - * @static - * @param {google.api.IGoSettings} message GoSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GoSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.GoSettings - * @static - * @param {google.api.IGoSettings} message GoSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GoSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GoSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.GoSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.GoSettings} GoSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GoSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.GoSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GoSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.GoSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.GoSettings} GoSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GoSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GoSettings message. - * @function verify - * @memberof google.api.GoSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GoSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.GoSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.GoSettings} GoSettings - */ - GoSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.GoSettings) - return object; - var message = new $root.google.api.GoSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.GoSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a GoSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.GoSettings - * @static - * @param {google.api.GoSettings} message GoSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GoSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this GoSettings to JSON. - * @function toJSON - * @memberof google.api.GoSettings - * @instance - * @returns {Object.} JSON object - */ - GoSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GoSettings - * @function getTypeUrl - * @memberof google.api.GoSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GoSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.GoSettings"; - }; - - return GoSettings; - })(); - - api.MethodSettings = (function() { - - /** - * Properties of a MethodSettings. - * @memberof google.api - * @interface IMethodSettings - * @property {string|null} [selector] MethodSettings selector - * @property {google.api.MethodSettings.ILongRunning|null} [longRunning] MethodSettings longRunning - * @property {Array.|null} [autoPopulatedFields] MethodSettings autoPopulatedFields - */ - - /** - * Constructs a new MethodSettings. - * @memberof google.api - * @classdesc Represents a MethodSettings. - * @implements IMethodSettings - * @constructor - * @param {google.api.IMethodSettings=} [properties] Properties to set - */ - function MethodSettings(properties) { - this.autoPopulatedFields = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MethodSettings selector. - * @member {string} selector - * @memberof google.api.MethodSettings - * @instance - */ - MethodSettings.prototype.selector = ""; - - /** - * MethodSettings longRunning. - * @member {google.api.MethodSettings.ILongRunning|null|undefined} longRunning - * @memberof google.api.MethodSettings - * @instance - */ - MethodSettings.prototype.longRunning = null; - - /** - * MethodSettings autoPopulatedFields. - * @member {Array.} autoPopulatedFields - * @memberof google.api.MethodSettings - * @instance - */ - MethodSettings.prototype.autoPopulatedFields = $util.emptyArray; - - /** - * Creates a new MethodSettings instance using the specified properties. - * @function create - * @memberof google.api.MethodSettings - * @static - * @param {google.api.IMethodSettings=} [properties] Properties to set - * @returns {google.api.MethodSettings} MethodSettings instance - */ - MethodSettings.create = function create(properties) { - return new MethodSettings(properties); - }; - - /** - * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. - * @function encode - * @memberof google.api.MethodSettings - * @static - * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); - if (message.longRunning != null && Object.hasOwnProperty.call(message, "longRunning")) - $root.google.api.MethodSettings.LongRunning.encode(message.longRunning, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.autoPopulatedFields != null && message.autoPopulatedFields.length) - for (var i = 0; i < message.autoPopulatedFields.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.autoPopulatedFields[i]); - return writer; - }; - - /** - * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.MethodSettings - * @static - * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MethodSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.MethodSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.MethodSettings} MethodSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.selector = reader.string(); - break; - } - case 2: { - message.longRunning = $root.google.api.MethodSettings.LongRunning.decode(reader, reader.uint32()); - break; - } - case 3: { - if (!(message.autoPopulatedFields && message.autoPopulatedFields.length)) - message.autoPopulatedFields = []; - message.autoPopulatedFields.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MethodSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.MethodSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.MethodSettings} MethodSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MethodSettings message. - * @function verify - * @memberof google.api.MethodSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MethodSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.selector != null && message.hasOwnProperty("selector")) - if (!$util.isString(message.selector)) - return "selector: string expected"; - if (message.longRunning != null && message.hasOwnProperty("longRunning")) { - var error = $root.google.api.MethodSettings.LongRunning.verify(message.longRunning); - if (error) - return "longRunning." + error; - } - if (message.autoPopulatedFields != null && message.hasOwnProperty("autoPopulatedFields")) { - if (!Array.isArray(message.autoPopulatedFields)) - return "autoPopulatedFields: array expected"; - for (var i = 0; i < message.autoPopulatedFields.length; ++i) - if (!$util.isString(message.autoPopulatedFields[i])) - return "autoPopulatedFields: string[] expected"; - } - return null; - }; - - /** - * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.MethodSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.MethodSettings} MethodSettings - */ - MethodSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.MethodSettings) - return object; - var message = new $root.google.api.MethodSettings(); - if (object.selector != null) - message.selector = String(object.selector); - if (object.longRunning != null) { - if (typeof object.longRunning !== "object") - throw TypeError(".google.api.MethodSettings.longRunning: object expected"); - message.longRunning = $root.google.api.MethodSettings.LongRunning.fromObject(object.longRunning); - } - if (object.autoPopulatedFields) { - if (!Array.isArray(object.autoPopulatedFields)) - throw TypeError(".google.api.MethodSettings.autoPopulatedFields: array expected"); - message.autoPopulatedFields = []; - for (var i = 0; i < object.autoPopulatedFields.length; ++i) - message.autoPopulatedFields[i] = String(object.autoPopulatedFields[i]); - } - return message; - }; - - /** - * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.MethodSettings - * @static - * @param {google.api.MethodSettings} message MethodSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MethodSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.autoPopulatedFields = []; - if (options.defaults) { - object.selector = ""; - object.longRunning = null; - } - if (message.selector != null && message.hasOwnProperty("selector")) - object.selector = message.selector; - if (message.longRunning != null && message.hasOwnProperty("longRunning")) - object.longRunning = $root.google.api.MethodSettings.LongRunning.toObject(message.longRunning, options); - if (message.autoPopulatedFields && message.autoPopulatedFields.length) { - object.autoPopulatedFields = []; - for (var j = 0; j < message.autoPopulatedFields.length; ++j) - object.autoPopulatedFields[j] = message.autoPopulatedFields[j]; - } - return object; - }; - - /** - * Converts this MethodSettings to JSON. - * @function toJSON - * @memberof google.api.MethodSettings - * @instance - * @returns {Object.} JSON object - */ - MethodSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MethodSettings - * @function getTypeUrl - * @memberof google.api.MethodSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MethodSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.MethodSettings"; - }; - - MethodSettings.LongRunning = (function() { - - /** - * Properties of a LongRunning. - * @memberof google.api.MethodSettings - * @interface ILongRunning - * @property {google.protobuf.IDuration|null} [initialPollDelay] LongRunning initialPollDelay - * @property {number|null} [pollDelayMultiplier] LongRunning pollDelayMultiplier - * @property {google.protobuf.IDuration|null} [maxPollDelay] LongRunning maxPollDelay - * @property {google.protobuf.IDuration|null} [totalPollTimeout] LongRunning totalPollTimeout - */ - - /** - * Constructs a new LongRunning. - * @memberof google.api.MethodSettings - * @classdesc Represents a LongRunning. - * @implements ILongRunning - * @constructor - * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set - */ - function LongRunning(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * LongRunning initialPollDelay. - * @member {google.protobuf.IDuration|null|undefined} initialPollDelay - * @memberof google.api.MethodSettings.LongRunning - * @instance - */ - LongRunning.prototype.initialPollDelay = null; - - /** - * LongRunning pollDelayMultiplier. - * @member {number} pollDelayMultiplier - * @memberof google.api.MethodSettings.LongRunning - * @instance - */ - LongRunning.prototype.pollDelayMultiplier = 0; - - /** - * LongRunning maxPollDelay. - * @member {google.protobuf.IDuration|null|undefined} maxPollDelay - * @memberof google.api.MethodSettings.LongRunning - * @instance - */ - LongRunning.prototype.maxPollDelay = null; - - /** - * LongRunning totalPollTimeout. - * @member {google.protobuf.IDuration|null|undefined} totalPollTimeout - * @memberof google.api.MethodSettings.LongRunning - * @instance - */ - LongRunning.prototype.totalPollTimeout = null; - - /** - * Creates a new LongRunning instance using the specified properties. - * @function create - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set - * @returns {google.api.MethodSettings.LongRunning} LongRunning instance - */ - LongRunning.create = function create(properties) { - return new LongRunning(properties); - }; - - /** - * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. - * @function encode - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LongRunning.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.initialPollDelay != null && Object.hasOwnProperty.call(message, "initialPollDelay")) - $root.google.protobuf.Duration.encode(message.initialPollDelay, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.pollDelayMultiplier != null && Object.hasOwnProperty.call(message, "pollDelayMultiplier")) - writer.uint32(/* id 2, wireType 5 =*/21).float(message.pollDelayMultiplier); - if (message.maxPollDelay != null && Object.hasOwnProperty.call(message, "maxPollDelay")) - $root.google.protobuf.Duration.encode(message.maxPollDelay, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.totalPollTimeout != null && Object.hasOwnProperty.call(message, "totalPollTimeout")) - $root.google.protobuf.Duration.encode(message.totalPollTimeout, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LongRunning.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a LongRunning message from the specified reader or buffer. - * @function decode - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.MethodSettings.LongRunning} LongRunning - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LongRunning.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings.LongRunning(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.initialPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 2: { - message.pollDelayMultiplier = reader.float(); - break; - } - case 3: { - message.maxPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 4: { - message.totalPollTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a LongRunning message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.MethodSettings.LongRunning} LongRunning - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LongRunning.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a LongRunning message. - * @function verify - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LongRunning.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) { - var error = $root.google.protobuf.Duration.verify(message.initialPollDelay); - if (error) - return "initialPollDelay." + error; - } - if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) - if (typeof message.pollDelayMultiplier !== "number") - return "pollDelayMultiplier: number expected"; - if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) { - var error = $root.google.protobuf.Duration.verify(message.maxPollDelay); - if (error) - return "maxPollDelay." + error; - } - if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) { - var error = $root.google.protobuf.Duration.verify(message.totalPollTimeout); - if (error) - return "totalPollTimeout." + error; - } - return null; - }; - - /** - * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {Object.} object Plain object - * @returns {google.api.MethodSettings.LongRunning} LongRunning - */ - LongRunning.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.MethodSettings.LongRunning) - return object; - var message = new $root.google.api.MethodSettings.LongRunning(); - if (object.initialPollDelay != null) { - if (typeof object.initialPollDelay !== "object") - throw TypeError(".google.api.MethodSettings.LongRunning.initialPollDelay: object expected"); - message.initialPollDelay = $root.google.protobuf.Duration.fromObject(object.initialPollDelay); - } - if (object.pollDelayMultiplier != null) - message.pollDelayMultiplier = Number(object.pollDelayMultiplier); - if (object.maxPollDelay != null) { - if (typeof object.maxPollDelay !== "object") - throw TypeError(".google.api.MethodSettings.LongRunning.maxPollDelay: object expected"); - message.maxPollDelay = $root.google.protobuf.Duration.fromObject(object.maxPollDelay); - } - if (object.totalPollTimeout != null) { - if (typeof object.totalPollTimeout !== "object") - throw TypeError(".google.api.MethodSettings.LongRunning.totalPollTimeout: object expected"); - message.totalPollTimeout = $root.google.protobuf.Duration.fromObject(object.totalPollTimeout); - } - return message; - }; - - /** - * Creates a plain object from a LongRunning message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {google.api.MethodSettings.LongRunning} message LongRunning - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LongRunning.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.initialPollDelay = null; - object.pollDelayMultiplier = 0; - object.maxPollDelay = null; - object.totalPollTimeout = null; - } - if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) - object.initialPollDelay = $root.google.protobuf.Duration.toObject(message.initialPollDelay, options); - if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) - object.pollDelayMultiplier = options.json && !isFinite(message.pollDelayMultiplier) ? String(message.pollDelayMultiplier) : message.pollDelayMultiplier; - if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) - object.maxPollDelay = $root.google.protobuf.Duration.toObject(message.maxPollDelay, options); - if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) - object.totalPollTimeout = $root.google.protobuf.Duration.toObject(message.totalPollTimeout, options); - return object; - }; - - /** - * Converts this LongRunning to JSON. - * @function toJSON - * @memberof google.api.MethodSettings.LongRunning - * @instance - * @returns {Object.} JSON object - */ - LongRunning.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for LongRunning - * @function getTypeUrl - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - LongRunning.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.MethodSettings.LongRunning"; - }; - - return LongRunning; - })(); - - return MethodSettings; - })(); - - /** - * ClientLibraryOrganization enum. - * @name google.api.ClientLibraryOrganization - * @enum {number} - * @property {number} CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED=0 CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED value - * @property {number} CLOUD=1 CLOUD value - * @property {number} ADS=2 ADS value - * @property {number} PHOTOS=3 PHOTOS value - * @property {number} STREET_VIEW=4 STREET_VIEW value - * @property {number} SHOPPING=5 SHOPPING value - * @property {number} GEO=6 GEO value - * @property {number} GENERATIVE_AI=7 GENERATIVE_AI value - */ - api.ClientLibraryOrganization = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED"] = 0; - values[valuesById[1] = "CLOUD"] = 1; - values[valuesById[2] = "ADS"] = 2; - values[valuesById[3] = "PHOTOS"] = 3; - values[valuesById[4] = "STREET_VIEW"] = 4; - values[valuesById[5] = "SHOPPING"] = 5; - values[valuesById[6] = "GEO"] = 6; - values[valuesById[7] = "GENERATIVE_AI"] = 7; - return values; - })(); - - /** - * ClientLibraryDestination enum. - * @name google.api.ClientLibraryDestination - * @enum {number} - * @property {number} CLIENT_LIBRARY_DESTINATION_UNSPECIFIED=0 CLIENT_LIBRARY_DESTINATION_UNSPECIFIED value - * @property {number} GITHUB=10 GITHUB value - * @property {number} PACKAGE_MANAGER=20 PACKAGE_MANAGER value - */ - api.ClientLibraryDestination = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED"] = 0; - values[valuesById[10] = "GITHUB"] = 10; - values[valuesById[20] = "PACKAGE_MANAGER"] = 20; - return values; - })(); - - /** - * LaunchStage enum. - * @name google.api.LaunchStage - * @enum {number} - * @property {number} LAUNCH_STAGE_UNSPECIFIED=0 LAUNCH_STAGE_UNSPECIFIED value - * @property {number} UNIMPLEMENTED=6 UNIMPLEMENTED value - * @property {number} PRELAUNCH=7 PRELAUNCH value - * @property {number} EARLY_ACCESS=1 EARLY_ACCESS value - * @property {number} ALPHA=2 ALPHA value - * @property {number} BETA=3 BETA value - * @property {number} GA=4 GA value - * @property {number} DEPRECATED=5 DEPRECATED value - */ - api.LaunchStage = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "LAUNCH_STAGE_UNSPECIFIED"] = 0; - values[valuesById[6] = "UNIMPLEMENTED"] = 6; - values[valuesById[7] = "PRELAUNCH"] = 7; - values[valuesById[1] = "EARLY_ACCESS"] = 1; - values[valuesById[2] = "ALPHA"] = 2; - values[valuesById[3] = "BETA"] = 3; - values[valuesById[4] = "GA"] = 4; - values[valuesById[5] = "DEPRECATED"] = 5; - return values; - })(); - - api.ResourceDescriptor = (function() { - - /** - * Properties of a ResourceDescriptor. - * @memberof google.api - * @interface IResourceDescriptor - * @property {string|null} [type] ResourceDescriptor type - * @property {Array.|null} [pattern] ResourceDescriptor pattern - * @property {string|null} [nameField] ResourceDescriptor nameField - * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history - * @property {string|null} [plural] ResourceDescriptor plural - * @property {string|null} [singular] ResourceDescriptor singular - * @property {Array.|null} [style] ResourceDescriptor style - */ - - /** - * Constructs a new ResourceDescriptor. - * @memberof google.api - * @classdesc Represents a ResourceDescriptor. - * @implements IResourceDescriptor - * @constructor - * @param {google.api.IResourceDescriptor=} [properties] Properties to set - */ - function ResourceDescriptor(properties) { - this.pattern = []; - this.style = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ResourceDescriptor type. - * @member {string} type - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.type = ""; - - /** - * ResourceDescriptor pattern. - * @member {Array.} pattern - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.pattern = $util.emptyArray; - - /** - * ResourceDescriptor nameField. - * @member {string} nameField - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.nameField = ""; - - /** - * ResourceDescriptor history. - * @member {google.api.ResourceDescriptor.History} history - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.history = 0; - - /** - * ResourceDescriptor plural. - * @member {string} plural - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.plural = ""; - - /** - * ResourceDescriptor singular. - * @member {string} singular - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.singular = ""; - - /** - * ResourceDescriptor style. - * @member {Array.} style - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.style = $util.emptyArray; - - /** - * Creates a new ResourceDescriptor instance using the specified properties. - * @function create - * @memberof google.api.ResourceDescriptor - * @static - * @param {google.api.IResourceDescriptor=} [properties] Properties to set - * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance - */ - ResourceDescriptor.create = function create(properties) { - return new ResourceDescriptor(properties); - }; - - /** - * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. - * @function encode - * @memberof google.api.ResourceDescriptor - * @static - * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceDescriptor.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); - if (message.pattern != null && message.pattern.length) - for (var i = 0; i < message.pattern.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.pattern[i]); - if (message.nameField != null && Object.hasOwnProperty.call(message, "nameField")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); - if (message.history != null && Object.hasOwnProperty.call(message, "history")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); - if (message.plural != null && Object.hasOwnProperty.call(message, "plural")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); - if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); - if (message.style != null && message.style.length) { - writer.uint32(/* id 10, wireType 2 =*/82).fork(); - for (var i = 0; i < message.style.length; ++i) - writer.int32(message.style[i]); - writer.ldelim(); - } - return writer; - }; - - /** - * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.ResourceDescriptor - * @static - * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ResourceDescriptor message from the specified reader or buffer. - * @function decode - * @memberof google.api.ResourceDescriptor - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.ResourceDescriptor} ResourceDescriptor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceDescriptor.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceDescriptor(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.type = reader.string(); - break; - } - case 2: { - if (!(message.pattern && message.pattern.length)) - message.pattern = []; - message.pattern.push(reader.string()); - break; - } - case 3: { - message.nameField = reader.string(); - break; - } - case 4: { - message.history = reader.int32(); - break; - } - case 5: { - message.plural = reader.string(); - break; - } - case 6: { - message.singular = reader.string(); - break; - } - case 10: { - if (!(message.style && message.style.length)) - message.style = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.style.push(reader.int32()); - } else - message.style.push(reader.int32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.ResourceDescriptor - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.ResourceDescriptor} ResourceDescriptor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ResourceDescriptor message. - * @function verify - * @memberof google.api.ResourceDescriptor - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ResourceDescriptor.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.pattern != null && message.hasOwnProperty("pattern")) { - if (!Array.isArray(message.pattern)) - return "pattern: array expected"; - for (var i = 0; i < message.pattern.length; ++i) - if (!$util.isString(message.pattern[i])) - return "pattern: string[] expected"; - } - if (message.nameField != null && message.hasOwnProperty("nameField")) - if (!$util.isString(message.nameField)) - return "nameField: string expected"; - if (message.history != null && message.hasOwnProperty("history")) - switch (message.history) { - default: - return "history: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.plural != null && message.hasOwnProperty("plural")) - if (!$util.isString(message.plural)) - return "plural: string expected"; - if (message.singular != null && message.hasOwnProperty("singular")) - if (!$util.isString(message.singular)) - return "singular: string expected"; - if (message.style != null && message.hasOwnProperty("style")) { - if (!Array.isArray(message.style)) - return "style: array expected"; - for (var i = 0; i < message.style.length; ++i) - switch (message.style[i]) { - default: - return "style: enum value[] expected"; - case 0: - case 1: - break; - } - } - return null; - }; - - /** - * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.ResourceDescriptor - * @static - * @param {Object.} object Plain object - * @returns {google.api.ResourceDescriptor} ResourceDescriptor - */ - ResourceDescriptor.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.ResourceDescriptor) - return object; - var message = new $root.google.api.ResourceDescriptor(); - if (object.type != null) - message.type = String(object.type); - if (object.pattern) { - if (!Array.isArray(object.pattern)) - throw TypeError(".google.api.ResourceDescriptor.pattern: array expected"); - message.pattern = []; - for (var i = 0; i < object.pattern.length; ++i) - message.pattern[i] = String(object.pattern[i]); - } - if (object.nameField != null) - message.nameField = String(object.nameField); - switch (object.history) { - default: - if (typeof object.history === "number") { - message.history = object.history; - break; - } - break; - case "HISTORY_UNSPECIFIED": - case 0: - message.history = 0; - break; - case "ORIGINALLY_SINGLE_PATTERN": - case 1: - message.history = 1; - break; - case "FUTURE_MULTI_PATTERN": - case 2: - message.history = 2; - break; - } - if (object.plural != null) - message.plural = String(object.plural); - if (object.singular != null) - message.singular = String(object.singular); - if (object.style) { - if (!Array.isArray(object.style)) - throw TypeError(".google.api.ResourceDescriptor.style: array expected"); - message.style = []; - for (var i = 0; i < object.style.length; ++i) - switch (object.style[i]) { - default: - if (typeof object.style[i] === "number") { - message.style[i] = object.style[i]; - break; - } - case "STYLE_UNSPECIFIED": - case 0: - message.style[i] = 0; - break; - case "DECLARATIVE_FRIENDLY": - case 1: - message.style[i] = 1; - break; - } - } - return message; - }; - - /** - * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.ResourceDescriptor - * @static - * @param {google.api.ResourceDescriptor} message ResourceDescriptor - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResourceDescriptor.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.pattern = []; - object.style = []; - } - if (options.defaults) { - object.type = ""; - object.nameField = ""; - object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; - object.plural = ""; - object.singular = ""; - } - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.pattern && message.pattern.length) { - object.pattern = []; - for (var j = 0; j < message.pattern.length; ++j) - object.pattern[j] = message.pattern[j]; - } - if (message.nameField != null && message.hasOwnProperty("nameField")) - object.nameField = message.nameField; - if (message.history != null && message.hasOwnProperty("history")) - object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] === undefined ? message.history : $root.google.api.ResourceDescriptor.History[message.history] : message.history; - if (message.plural != null && message.hasOwnProperty("plural")) - object.plural = message.plural; - if (message.singular != null && message.hasOwnProperty("singular")) - object.singular = message.singular; - if (message.style && message.style.length) { - object.style = []; - for (var j = 0; j < message.style.length; ++j) - object.style[j] = options.enums === String ? $root.google.api.ResourceDescriptor.Style[message.style[j]] === undefined ? message.style[j] : $root.google.api.ResourceDescriptor.Style[message.style[j]] : message.style[j]; - } - return object; - }; - - /** - * Converts this ResourceDescriptor to JSON. - * @function toJSON - * @memberof google.api.ResourceDescriptor - * @instance - * @returns {Object.} JSON object - */ - ResourceDescriptor.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ResourceDescriptor - * @function getTypeUrl - * @memberof google.api.ResourceDescriptor - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ResourceDescriptor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.ResourceDescriptor"; - }; - - /** - * History enum. - * @name google.api.ResourceDescriptor.History - * @enum {number} - * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value - * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value - * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value - */ - ResourceDescriptor.History = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "HISTORY_UNSPECIFIED"] = 0; - values[valuesById[1] = "ORIGINALLY_SINGLE_PATTERN"] = 1; - values[valuesById[2] = "FUTURE_MULTI_PATTERN"] = 2; - return values; - })(); - - /** - * Style enum. - * @name google.api.ResourceDescriptor.Style - * @enum {number} - * @property {number} STYLE_UNSPECIFIED=0 STYLE_UNSPECIFIED value - * @property {number} DECLARATIVE_FRIENDLY=1 DECLARATIVE_FRIENDLY value - */ - ResourceDescriptor.Style = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STYLE_UNSPECIFIED"] = 0; - values[valuesById[1] = "DECLARATIVE_FRIENDLY"] = 1; - return values; - })(); - - return ResourceDescriptor; - })(); - - api.ResourceReference = (function() { - - /** - * Properties of a ResourceReference. - * @memberof google.api - * @interface IResourceReference - * @property {string|null} [type] ResourceReference type - * @property {string|null} [childType] ResourceReference childType - */ - - /** - * Constructs a new ResourceReference. - * @memberof google.api - * @classdesc Represents a ResourceReference. - * @implements IResourceReference - * @constructor - * @param {google.api.IResourceReference=} [properties] Properties to set - */ - function ResourceReference(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ResourceReference type. - * @member {string} type - * @memberof google.api.ResourceReference - * @instance - */ - ResourceReference.prototype.type = ""; - - /** - * ResourceReference childType. - * @member {string} childType - * @memberof google.api.ResourceReference - * @instance - */ - ResourceReference.prototype.childType = ""; - - /** - * Creates a new ResourceReference instance using the specified properties. - * @function create - * @memberof google.api.ResourceReference - * @static - * @param {google.api.IResourceReference=} [properties] Properties to set - * @returns {google.api.ResourceReference} ResourceReference instance - */ - ResourceReference.create = function create(properties) { - return new ResourceReference(properties); - }; - - /** - * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. - * @function encode - * @memberof google.api.ResourceReference - * @static - * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceReference.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); - if (message.childType != null && Object.hasOwnProperty.call(message, "childType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); - return writer; - }; - - /** - * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.ResourceReference - * @static - * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ResourceReference message from the specified reader or buffer. - * @function decode - * @memberof google.api.ResourceReference - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.ResourceReference} ResourceReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceReference.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceReference(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.type = reader.string(); - break; - } - case 2: { - message.childType = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ResourceReference message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.ResourceReference - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.ResourceReference} ResourceReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceReference.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ResourceReference message. - * @function verify - * @memberof google.api.ResourceReference - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ResourceReference.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.childType != null && message.hasOwnProperty("childType")) - if (!$util.isString(message.childType)) - return "childType: string expected"; - return null; - }; - - /** - * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.ResourceReference - * @static - * @param {Object.} object Plain object - * @returns {google.api.ResourceReference} ResourceReference - */ - ResourceReference.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.ResourceReference) - return object; - var message = new $root.google.api.ResourceReference(); - if (object.type != null) - message.type = String(object.type); - if (object.childType != null) - message.childType = String(object.childType); - return message; - }; - - /** - * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.ResourceReference - * @static - * @param {google.api.ResourceReference} message ResourceReference - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResourceReference.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.type = ""; - object.childType = ""; - } - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.childType != null && message.hasOwnProperty("childType")) - object.childType = message.childType; - return object; - }; - - /** - * Converts this ResourceReference to JSON. - * @function toJSON - * @memberof google.api.ResourceReference - * @instance - * @returns {Object.} JSON object - */ - ResourceReference.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ResourceReference - * @function getTypeUrl - * @memberof google.api.ResourceReference - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ResourceReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.ResourceReference"; - }; - - return ResourceReference; - })(); - - return api; - })(); - - google.rpc = (function() { - - /** - * Namespace rpc. - * @memberof google - * @namespace - */ - var rpc = {}; - - rpc.Status = (function() { - - /** - * Properties of a Status. - * @memberof google.rpc - * @interface IStatus - * @property {number|null} [code] Status code - * @property {string|null} [message] Status message - * @property {Array.|null} [details] Status details - */ - - /** - * Constructs a new Status. - * @memberof google.rpc - * @classdesc Represents a Status. - * @implements IStatus - * @constructor - * @param {google.rpc.IStatus=} [properties] Properties to set - */ - function Status(properties) { - this.details = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Status code. - * @member {number} code - * @memberof google.rpc.Status - * @instance - */ - Status.prototype.code = 0; - - /** - * Status message. - * @member {string} message - * @memberof google.rpc.Status - * @instance - */ - Status.prototype.message = ""; - - /** - * Status details. - * @member {Array.} details - * @memberof google.rpc.Status - * @instance - */ - Status.prototype.details = $util.emptyArray; - - /** - * Creates a new Status instance using the specified properties. - * @function create - * @memberof google.rpc.Status - * @static - * @param {google.rpc.IStatus=} [properties] Properties to set - * @returns {google.rpc.Status} Status instance - */ - Status.create = function create(properties) { - return new Status(properties); - }; - - /** - * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. - * @function encode - * @memberof google.rpc.Status - * @static - * @param {google.rpc.IStatus} message Status message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Status.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.code != null && Object.hasOwnProperty.call(message, "code")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); - if (message.message != null && Object.hasOwnProperty.call(message, "message")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); - if (message.details != null && message.details.length) - for (var i = 0; i < message.details.length; ++i) - $root.google.protobuf.Any.encode(message.details[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. - * @function encodeDelimited - * @memberof google.rpc.Status - * @static - * @param {google.rpc.IStatus} message Status message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Status.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Status message from the specified reader or buffer. - * @function decode - * @memberof google.rpc.Status - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.rpc.Status} Status - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Status.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.rpc.Status(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.code = reader.int32(); - break; - } - case 2: { - message.message = reader.string(); - break; - } - case 3: { - if (!(message.details && message.details.length)) - message.details = []; - message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Status message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.rpc.Status - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.rpc.Status} Status - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Status.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Status message. - * @function verify - * @memberof google.rpc.Status - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Status.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.code != null && message.hasOwnProperty("code")) - if (!$util.isInteger(message.code)) - return "code: integer expected"; - if (message.message != null && message.hasOwnProperty("message")) - if (!$util.isString(message.message)) - return "message: string expected"; - if (message.details != null && message.hasOwnProperty("details")) { - if (!Array.isArray(message.details)) - return "details: array expected"; - for (var i = 0; i < message.details.length; ++i) { - var error = $root.google.protobuf.Any.verify(message.details[i]); - if (error) - return "details." + error; - } - } - return null; - }; - - /** - * Creates a Status message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.rpc.Status - * @static - * @param {Object.} object Plain object - * @returns {google.rpc.Status} Status - */ - Status.fromObject = function fromObject(object) { - if (object instanceof $root.google.rpc.Status) - return object; - var message = new $root.google.rpc.Status(); - if (object.code != null) - message.code = object.code | 0; - if (object.message != null) - message.message = String(object.message); - if (object.details) { - if (!Array.isArray(object.details)) - throw TypeError(".google.rpc.Status.details: array expected"); - message.details = []; - for (var i = 0; i < object.details.length; ++i) { - if (typeof object.details[i] !== "object") - throw TypeError(".google.rpc.Status.details: object expected"); - message.details[i] = $root.google.protobuf.Any.fromObject(object.details[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a Status message. Also converts values to other types if specified. - * @function toObject - * @memberof google.rpc.Status - * @static - * @param {google.rpc.Status} message Status - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Status.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.details = []; - if (options.defaults) { - object.code = 0; - object.message = ""; - } - if (message.code != null && message.hasOwnProperty("code")) - object.code = message.code; - if (message.message != null && message.hasOwnProperty("message")) - object.message = message.message; - if (message.details && message.details.length) { - object.details = []; - for (var j = 0; j < message.details.length; ++j) - object.details[j] = $root.google.protobuf.Any.toObject(message.details[j], options); - } - return object; - }; - - /** - * Converts this Status to JSON. - * @function toJSON - * @memberof google.rpc.Status - * @instance - * @returns {Object.} JSON object - */ - Status.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Status - * @function getTypeUrl - * @memberof google.rpc.Status - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Status.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.rpc.Status"; - }; - - return Status; - })(); - - return rpc; - })(); - - return google; - })(); - - return $root; -}); diff --git a/owl-bot-staging/v1/protos/protos.json b/owl-bot-staging/v1/protos/protos.json deleted file mode 100644 index 64305ac31..000000000 --- a/owl-bot-staging/v1/protos/protos.json +++ /dev/null @@ -1,4346 +0,0 @@ -{ - "nested": { - "google": { - "nested": { - "protobuf": { - "options": { - "go_package": "google.golang.org/protobuf/types/descriptorpb", - "java_package": "com.google.protobuf", - "java_outer_classname": "DescriptorProtos", - "csharp_namespace": "Google.Protobuf.Reflection", - "objc_class_prefix": "GPB", - "cc_enable_arenas": true, - "optimize_for": "SPEED" - }, - "nested": { - "Struct": { - "fields": { - "fields": { - "keyType": "string", - "type": "Value", - "id": 1 - } - } - }, - "Value": { - "oneofs": { - "kind": { - "oneof": [ - "nullValue", - "numberValue", - "stringValue", - "boolValue", - "structValue", - "listValue" - ] - } - }, - "fields": { - "nullValue": { - "type": "NullValue", - "id": 1 - }, - "numberValue": { - "type": "double", - "id": 2 - }, - "stringValue": { - "type": "string", - "id": 3 - }, - "boolValue": { - "type": "bool", - "id": 4 - }, - "structValue": { - "type": "Struct", - "id": 5 - }, - "listValue": { - "type": "ListValue", - "id": 6 - } - } - }, - "NullValue": { - "values": { - "NULL_VALUE": 0 - } - }, - "ListValue": { - "fields": { - "values": { - "rule": "repeated", - "type": "Value", - "id": 1 - } - } - }, - "Timestamp": { - "fields": { - "seconds": { - "type": "int64", - "id": 1 - }, - "nanos": { - "type": "int32", - "id": 2 - } - } - }, - "FileDescriptorSet": { - "edition": "proto2", - "fields": { - "file": { - "rule": "repeated", - "type": "FileDescriptorProto", - "id": 1 - } - } - }, - "Edition": { - "edition": "proto2", - "values": { - "EDITION_UNKNOWN": 0, - "EDITION_PROTO2": 998, - "EDITION_PROTO3": 999, - "EDITION_2023": 1000, - "EDITION_2024": 1001, - "EDITION_1_TEST_ONLY": 1, - "EDITION_2_TEST_ONLY": 2, - "EDITION_99997_TEST_ONLY": 99997, - "EDITION_99998_TEST_ONLY": 99998, - "EDITION_99999_TEST_ONLY": 99999, - "EDITION_MAX": 2147483647 - } - }, - "FileDescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "package": { - "type": "string", - "id": 2 - }, - "dependency": { - "rule": "repeated", - "type": "string", - "id": 3 - }, - "publicDependency": { - "rule": "repeated", - "type": "int32", - "id": 10 - }, - "weakDependency": { - "rule": "repeated", - "type": "int32", - "id": 11 - }, - "messageType": { - "rule": "repeated", - "type": "DescriptorProto", - "id": 4 - }, - "enumType": { - "rule": "repeated", - "type": "EnumDescriptorProto", - "id": 5 - }, - "service": { - "rule": "repeated", - "type": "ServiceDescriptorProto", - "id": 6 - }, - "extension": { - "rule": "repeated", - "type": "FieldDescriptorProto", - "id": 7 - }, - "options": { - "type": "FileOptions", - "id": 8 - }, - "sourceCodeInfo": { - "type": "SourceCodeInfo", - "id": 9 - }, - "syntax": { - "type": "string", - "id": 12 - }, - "edition": { - "type": "Edition", - "id": 14 - } - } - }, - "DescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "field": { - "rule": "repeated", - "type": "FieldDescriptorProto", - "id": 2 - }, - "extension": { - "rule": "repeated", - "type": "FieldDescriptorProto", - "id": 6 - }, - "nestedType": { - "rule": "repeated", - "type": "DescriptorProto", - "id": 3 - }, - "enumType": { - "rule": "repeated", - "type": "EnumDescriptorProto", - "id": 4 - }, - "extensionRange": { - "rule": "repeated", - "type": "ExtensionRange", - "id": 5 - }, - "oneofDecl": { - "rule": "repeated", - "type": "OneofDescriptorProto", - "id": 8 - }, - "options": { - "type": "MessageOptions", - "id": 7 - }, - "reservedRange": { - "rule": "repeated", - "type": "ReservedRange", - "id": 9 - }, - "reservedName": { - "rule": "repeated", - "type": "string", - "id": 10 - } - }, - "nested": { - "ExtensionRange": { - "fields": { - "start": { - "type": "int32", - "id": 1 - }, - "end": { - "type": "int32", - "id": 2 - }, - "options": { - "type": "ExtensionRangeOptions", - "id": 3 - } - } - }, - "ReservedRange": { - "fields": { - "start": { - "type": "int32", - "id": 1 - }, - "end": { - "type": "int32", - "id": 2 - } - } - } - } - }, - "ExtensionRangeOptions": { - "edition": "proto2", - "fields": { - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - }, - "declaration": { - "rule": "repeated", - "type": "Declaration", - "id": 2, - "options": { - "retention": "RETENTION_SOURCE" - } - }, - "features": { - "type": "FeatureSet", - "id": 50 - }, - "verification": { - "type": "VerificationState", - "id": 3, - "options": { - "default": "UNVERIFIED", - "retention": "RETENTION_SOURCE" - } - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "nested": { - "Declaration": { - "fields": { - "number": { - "type": "int32", - "id": 1 - }, - "fullName": { - "type": "string", - "id": 2 - }, - "type": { - "type": "string", - "id": 3 - }, - "reserved": { - "type": "bool", - "id": 5 - }, - "repeated": { - "type": "bool", - "id": 6 - } - }, - "reserved": [ - [ - 4, - 4 - ] - ] - }, - "VerificationState": { - "values": { - "DECLARATION": 0, - "UNVERIFIED": 1 - } - } - } - }, - "FieldDescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "number": { - "type": "int32", - "id": 3 - }, - "label": { - "type": "Label", - "id": 4 - }, - "type": { - "type": "Type", - "id": 5 - }, - "typeName": { - "type": "string", - "id": 6 - }, - "extendee": { - "type": "string", - "id": 2 - }, - "defaultValue": { - "type": "string", - "id": 7 - }, - "oneofIndex": { - "type": "int32", - "id": 9 - }, - "jsonName": { - "type": "string", - "id": 10 - }, - "options": { - "type": "FieldOptions", - "id": 8 - }, - "proto3Optional": { - "type": "bool", - "id": 17 - } - }, - "nested": { - "Type": { - "values": { - "TYPE_DOUBLE": 1, - "TYPE_FLOAT": 2, - "TYPE_INT64": 3, - "TYPE_UINT64": 4, - "TYPE_INT32": 5, - "TYPE_FIXED64": 6, - "TYPE_FIXED32": 7, - "TYPE_BOOL": 8, - "TYPE_STRING": 9, - "TYPE_GROUP": 10, - "TYPE_MESSAGE": 11, - "TYPE_BYTES": 12, - "TYPE_UINT32": 13, - "TYPE_ENUM": 14, - "TYPE_SFIXED32": 15, - "TYPE_SFIXED64": 16, - "TYPE_SINT32": 17, - "TYPE_SINT64": 18 - } - }, - "Label": { - "values": { - "LABEL_OPTIONAL": 1, - "LABEL_REPEATED": 3, - "LABEL_REQUIRED": 2 - } - } - } - }, - "OneofDescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "options": { - "type": "OneofOptions", - "id": 2 - } - } - }, - "EnumDescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "value": { - "rule": "repeated", - "type": "EnumValueDescriptorProto", - "id": 2 - }, - "options": { - "type": "EnumOptions", - "id": 3 - }, - "reservedRange": { - "rule": "repeated", - "type": "EnumReservedRange", - "id": 4 - }, - "reservedName": { - "rule": "repeated", - "type": "string", - "id": 5 - } - }, - "nested": { - "EnumReservedRange": { - "fields": { - "start": { - "type": "int32", - "id": 1 - }, - "end": { - "type": "int32", - "id": 2 - } - } - } - } - }, - "EnumValueDescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "number": { - "type": "int32", - "id": 2 - }, - "options": { - "type": "EnumValueOptions", - "id": 3 - } - } - }, - "ServiceDescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "method": { - "rule": "repeated", - "type": "MethodDescriptorProto", - "id": 2 - }, - "options": { - "type": "ServiceOptions", - "id": 3 - } - } - }, - "MethodDescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "inputType": { - "type": "string", - "id": 2 - }, - "outputType": { - "type": "string", - "id": 3 - }, - "options": { - "type": "MethodOptions", - "id": 4 - }, - "clientStreaming": { - "type": "bool", - "id": 5, - "options": { - "default": false - } - }, - "serverStreaming": { - "type": "bool", - "id": 6, - "options": { - "default": false - } - } - } - }, - "FileOptions": { - "edition": "proto2", - "fields": { - "javaPackage": { - "type": "string", - "id": 1 - }, - "javaOuterClassname": { - "type": "string", - "id": 8 - }, - "javaMultipleFiles": { - "type": "bool", - "id": 10, - "options": { - "default": false - } - }, - "javaGenerateEqualsAndHash": { - "type": "bool", - "id": 20, - "options": { - "deprecated": true - } - }, - "javaStringCheckUtf8": { - "type": "bool", - "id": 27, - "options": { - "default": false - } - }, - "optimizeFor": { - "type": "OptimizeMode", - "id": 9, - "options": { - "default": "SPEED" - } - }, - "goPackage": { - "type": "string", - "id": 11 - }, - "ccGenericServices": { - "type": "bool", - "id": 16, - "options": { - "default": false - } - }, - "javaGenericServices": { - "type": "bool", - "id": 17, - "options": { - "default": false - } - }, - "pyGenericServices": { - "type": "bool", - "id": 18, - "options": { - "default": false - } - }, - "deprecated": { - "type": "bool", - "id": 23, - "options": { - "default": false - } - }, - "ccEnableArenas": { - "type": "bool", - "id": 31, - "options": { - "default": true - } - }, - "objcClassPrefix": { - "type": "string", - "id": 36 - }, - "csharpNamespace": { - "type": "string", - "id": 37 - }, - "swiftPrefix": { - "type": "string", - "id": 39 - }, - "phpClassPrefix": { - "type": "string", - "id": 40 - }, - "phpNamespace": { - "type": "string", - "id": 41 - }, - "phpMetadataNamespace": { - "type": "string", - "id": 44 - }, - "rubyPackage": { - "type": "string", - "id": 45 - }, - "features": { - "type": "FeatureSet", - "id": 50 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "reserved": [ - [ - 42, - 42 - ], - [ - 38, - 38 - ] - ], - "nested": { - "OptimizeMode": { - "values": { - "SPEED": 1, - "CODE_SIZE": 2, - "LITE_RUNTIME": 3 - } - } - } - }, - "MessageOptions": { - "edition": "proto2", - "fields": { - "messageSetWireFormat": { - "type": "bool", - "id": 1, - "options": { - "default": false - } - }, - "noStandardDescriptorAccessor": { - "type": "bool", - "id": 2, - "options": { - "default": false - } - }, - "deprecated": { - "type": "bool", - "id": 3, - "options": { - "default": false - } - }, - "mapEntry": { - "type": "bool", - "id": 7 - }, - "deprecatedLegacyJsonFieldConflicts": { - "type": "bool", - "id": 11, - "options": { - "deprecated": true - } - }, - "features": { - "type": "FeatureSet", - "id": 12 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "reserved": [ - [ - 4, - 4 - ], - [ - 5, - 5 - ], - [ - 6, - 6 - ], - [ - 8, - 8 - ], - [ - 9, - 9 - ] - ] - }, - "FieldOptions": { - "edition": "proto2", - "fields": { - "ctype": { - "type": "CType", - "id": 1, - "options": { - "default": "STRING" - } - }, - "packed": { - "type": "bool", - "id": 2 - }, - "jstype": { - "type": "JSType", - "id": 6, - "options": { - "default": "JS_NORMAL" - } - }, - "lazy": { - "type": "bool", - "id": 5, - "options": { - "default": false - } - }, - "unverifiedLazy": { - "type": "bool", - "id": 15, - "options": { - "default": false - } - }, - "deprecated": { - "type": "bool", - "id": 3, - "options": { - "default": false - } - }, - "weak": { - "type": "bool", - "id": 10, - "options": { - "default": false - } - }, - "debugRedact": { - "type": "bool", - "id": 16, - "options": { - "default": false - } - }, - "retention": { - "type": "OptionRetention", - "id": 17 - }, - "targets": { - "rule": "repeated", - "type": "OptionTargetType", - "id": 19 - }, - "editionDefaults": { - "rule": "repeated", - "type": "EditionDefault", - "id": 20 - }, - "features": { - "type": "FeatureSet", - "id": 21 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "reserved": [ - [ - 4, - 4 - ], - [ - 18, - 18 - ] - ], - "nested": { - "CType": { - "values": { - "STRING": 0, - "CORD": 1, - "STRING_PIECE": 2 - } - }, - "JSType": { - "values": { - "JS_NORMAL": 0, - "JS_STRING": 1, - "JS_NUMBER": 2 - } - }, - "OptionRetention": { - "values": { - "RETENTION_UNKNOWN": 0, - "RETENTION_RUNTIME": 1, - "RETENTION_SOURCE": 2 - } - }, - "OptionTargetType": { - "values": { - "TARGET_TYPE_UNKNOWN": 0, - "TARGET_TYPE_FILE": 1, - "TARGET_TYPE_EXTENSION_RANGE": 2, - "TARGET_TYPE_MESSAGE": 3, - "TARGET_TYPE_FIELD": 4, - "TARGET_TYPE_ONEOF": 5, - "TARGET_TYPE_ENUM": 6, - "TARGET_TYPE_ENUM_ENTRY": 7, - "TARGET_TYPE_SERVICE": 8, - "TARGET_TYPE_METHOD": 9 - } - }, - "EditionDefault": { - "fields": { - "edition": { - "type": "Edition", - "id": 3 - }, - "value": { - "type": "string", - "id": 2 - } - } - } - } - }, - "OneofOptions": { - "edition": "proto2", - "fields": { - "features": { - "type": "FeatureSet", - "id": 1 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ] - }, - "EnumOptions": { - "edition": "proto2", - "fields": { - "allowAlias": { - "type": "bool", - "id": 2 - }, - "deprecated": { - "type": "bool", - "id": 3, - "options": { - "default": false - } - }, - "deprecatedLegacyJsonFieldConflicts": { - "type": "bool", - "id": 6, - "options": { - "deprecated": true - } - }, - "features": { - "type": "FeatureSet", - "id": 7 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "reserved": [ - [ - 5, - 5 - ] - ] - }, - "EnumValueOptions": { - "edition": "proto2", - "fields": { - "deprecated": { - "type": "bool", - "id": 1, - "options": { - "default": false - } - }, - "features": { - "type": "FeatureSet", - "id": 2 - }, - "debugRedact": { - "type": "bool", - "id": 3, - "options": { - "default": false - } - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ] - }, - "ServiceOptions": { - "edition": "proto2", - "fields": { - "features": { - "type": "FeatureSet", - "id": 34 - }, - "deprecated": { - "type": "bool", - "id": 33, - "options": { - "default": false - } - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ] - }, - "MethodOptions": { - "edition": "proto2", - "fields": { - "deprecated": { - "type": "bool", - "id": 33, - "options": { - "default": false - } - }, - "idempotencyLevel": { - "type": "IdempotencyLevel", - "id": 34, - "options": { - "default": "IDEMPOTENCY_UNKNOWN" - } - }, - "features": { - "type": "FeatureSet", - "id": 35 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "nested": { - "IdempotencyLevel": { - "values": { - "IDEMPOTENCY_UNKNOWN": 0, - "NO_SIDE_EFFECTS": 1, - "IDEMPOTENT": 2 - } - } - } - }, - "UninterpretedOption": { - "edition": "proto2", - "fields": { - "name": { - "rule": "repeated", - "type": "NamePart", - "id": 2 - }, - "identifierValue": { - "type": "string", - "id": 3 - }, - "positiveIntValue": { - "type": "uint64", - "id": 4 - }, - "negativeIntValue": { - "type": "int64", - "id": 5 - }, - "doubleValue": { - "type": "double", - "id": 6 - }, - "stringValue": { - "type": "bytes", - "id": 7 - }, - "aggregateValue": { - "type": "string", - "id": 8 - } - }, - "nested": { - "NamePart": { - "fields": { - "namePart": { - "rule": "required", - "type": "string", - "id": 1 - }, - "isExtension": { - "rule": "required", - "type": "bool", - "id": 2 - } - } - } - } - }, - "FeatureSet": { - "edition": "proto2", - "fields": { - "fieldPresence": { - "type": "FieldPresence", - "id": 1, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_2023", - "edition_defaults.value": "EXPLICIT" - } - }, - "enumType": { - "type": "EnumType", - "id": 2, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO3", - "edition_defaults.value": "OPEN" - } - }, - "repeatedFieldEncoding": { - "type": "RepeatedFieldEncoding", - "id": 3, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO3", - "edition_defaults.value": "PACKED" - } - }, - "utf8Validation": { - "type": "Utf8Validation", - "id": 4, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO3", - "edition_defaults.value": "VERIFY" - } - }, - "messageEncoding": { - "type": "MessageEncoding", - "id": 5, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO2", - "edition_defaults.value": "LENGTH_PREFIXED" - } - }, - "jsonFormat": { - "type": "JsonFormat", - "id": 6, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO3", - "edition_defaults.value": "ALLOW" - } - } - }, - "extensions": [ - [ - 1000, - 1000 - ], - [ - 1001, - 1001 - ], - [ - 1002, - 1002 - ], - [ - 9990, - 9990 - ], - [ - 9995, - 9999 - ], - [ - 10000, - 10000 - ] - ], - "reserved": [ - [ - 999, - 999 - ] - ], - "nested": { - "FieldPresence": { - "values": { - "FIELD_PRESENCE_UNKNOWN": 0, - "EXPLICIT": 1, - "IMPLICIT": 2, - "LEGACY_REQUIRED": 3 - } - }, - "EnumType": { - "values": { - "ENUM_TYPE_UNKNOWN": 0, - "OPEN": 1, - "CLOSED": 2 - } - }, - "RepeatedFieldEncoding": { - "values": { - "REPEATED_FIELD_ENCODING_UNKNOWN": 0, - "PACKED": 1, - "EXPANDED": 2 - } - }, - "Utf8Validation": { - "values": { - "UTF8_VALIDATION_UNKNOWN": 0, - "VERIFY": 2, - "NONE": 3 - } - }, - "MessageEncoding": { - "values": { - "MESSAGE_ENCODING_UNKNOWN": 0, - "LENGTH_PREFIXED": 1, - "DELIMITED": 2 - } - }, - "JsonFormat": { - "values": { - "JSON_FORMAT_UNKNOWN": 0, - "ALLOW": 1, - "LEGACY_BEST_EFFORT": 2 - } - } - } - }, - "FeatureSetDefaults": { - "edition": "proto2", - "fields": { - "defaults": { - "rule": "repeated", - "type": "FeatureSetEditionDefault", - "id": 1 - }, - "minimumEdition": { - "type": "Edition", - "id": 4 - }, - "maximumEdition": { - "type": "Edition", - "id": 5 - } - }, - "nested": { - "FeatureSetEditionDefault": { - "fields": { - "edition": { - "type": "Edition", - "id": 3 - }, - "features": { - "type": "FeatureSet", - "id": 2 - } - } - } - } - }, - "SourceCodeInfo": { - "edition": "proto2", - "fields": { - "location": { - "rule": "repeated", - "type": "Location", - "id": 1 - } - }, - "nested": { - "Location": { - "fields": { - "path": { - "rule": "repeated", - "type": "int32", - "id": 1, - "options": { - "packed": true - } - }, - "span": { - "rule": "repeated", - "type": "int32", - "id": 2, - "options": { - "packed": true - } - }, - "leadingComments": { - "type": "string", - "id": 3 - }, - "trailingComments": { - "type": "string", - "id": 4 - }, - "leadingDetachedComments": { - "rule": "repeated", - "type": "string", - "id": 6 - } - } - } - } - }, - "GeneratedCodeInfo": { - "edition": "proto2", - "fields": { - "annotation": { - "rule": "repeated", - "type": "Annotation", - "id": 1 - } - }, - "nested": { - "Annotation": { - "fields": { - "path": { - "rule": "repeated", - "type": "int32", - "id": 1, - "options": { - "packed": true - } - }, - "sourceFile": { - "type": "string", - "id": 2 - }, - "begin": { - "type": "int32", - "id": 3 - }, - "end": { - "type": "int32", - "id": 4 - }, - "semantic": { - "type": "Semantic", - "id": 5 - } - }, - "nested": { - "Semantic": { - "values": { - "NONE": 0, - "SET": 1, - "ALIAS": 2 - } - } - } - } - } - }, - "Duration": { - "fields": { - "seconds": { - "type": "int64", - "id": 1 - }, - "nanos": { - "type": "int32", - "id": 2 - } - } - }, - "Empty": { - "fields": {} - }, - "Any": { - "fields": { - "type_url": { - "type": "string", - "id": 1 - }, - "value": { - "type": "bytes", - "id": 2 - } - } - } - } - }, - "spanner": { - "nested": { - "v1": { - "options": { - "csharp_namespace": "Google.Cloud.Spanner.V1", - "go_package": "cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb", - "java_multiple_files": true, - "java_outer_classname": "SpannerProto", - "java_package": "com.google.spanner.v1", - "php_namespace": "Google\\Cloud\\Spanner\\V1", - "ruby_package": "Google::Cloud::Spanner::V1", - "(google.api.resource_definition).type": "spanner.googleapis.com/Database", - "(google.api.resource_definition).pattern": "projects/{project}/instances/{instance}/databases/{database}" - }, - "nested": { - "ChangeStreamRecord": { - "oneofs": { - "record": { - "oneof": [ - "dataChangeRecord", - "heartbeatRecord", - "partitionStartRecord", - "partitionEndRecord", - "partitionEventRecord" - ] - } - }, - "fields": { - "dataChangeRecord": { - "type": "DataChangeRecord", - "id": 1 - }, - "heartbeatRecord": { - "type": "HeartbeatRecord", - "id": 2 - }, - "partitionStartRecord": { - "type": "PartitionStartRecord", - "id": 3 - }, - "partitionEndRecord": { - "type": "PartitionEndRecord", - "id": 4 - }, - "partitionEventRecord": { - "type": "PartitionEventRecord", - "id": 5 - } - }, - "nested": { - "DataChangeRecord": { - "fields": { - "commitTimestamp": { - "type": "google.protobuf.Timestamp", - "id": 1 - }, - "recordSequence": { - "type": "string", - "id": 2 - }, - "serverTransactionId": { - "type": "string", - "id": 3 - }, - "isLastRecordInTransactionInPartition": { - "type": "bool", - "id": 4 - }, - "table": { - "type": "string", - "id": 5 - }, - "columnMetadata": { - "rule": "repeated", - "type": "ColumnMetadata", - "id": 6 - }, - "mods": { - "rule": "repeated", - "type": "Mod", - "id": 7 - }, - "modType": { - "type": "ModType", - "id": 8 - }, - "valueCaptureType": { - "type": "ValueCaptureType", - "id": 9 - }, - "numberOfRecordsInTransaction": { - "type": "int32", - "id": 10 - }, - "numberOfPartitionsInTransaction": { - "type": "int32", - "id": 11 - }, - "transactionTag": { - "type": "string", - "id": 12 - }, - "isSystemTransaction": { - "type": "bool", - "id": 13 - } - }, - "nested": { - "ColumnMetadata": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "type": { - "type": "Type", - "id": 2 - }, - "isPrimaryKey": { - "type": "bool", - "id": 3 - }, - "ordinalPosition": { - "type": "int64", - "id": 4 - } - } - }, - "ModValue": { - "fields": { - "columnMetadataIndex": { - "type": "int32", - "id": 1 - }, - "value": { - "type": "google.protobuf.Value", - "id": 2 - } - } - }, - "Mod": { - "fields": { - "keys": { - "rule": "repeated", - "type": "ModValue", - "id": 1 - }, - "oldValues": { - "rule": "repeated", - "type": "ModValue", - "id": 2 - }, - "newValues": { - "rule": "repeated", - "type": "ModValue", - "id": 3 - } - } - }, - "ModType": { - "values": { - "MOD_TYPE_UNSPECIFIED": 0, - "INSERT": 10, - "UPDATE": 20, - "DELETE": 30 - } - }, - "ValueCaptureType": { - "values": { - "VALUE_CAPTURE_TYPE_UNSPECIFIED": 0, - "OLD_AND_NEW_VALUES": 10, - "NEW_VALUES": 20, - "NEW_ROW": 30, - "NEW_ROW_AND_OLD_VALUES": 40 - } - } - } - }, - "HeartbeatRecord": { - "fields": { - "timestamp": { - "type": "google.protobuf.Timestamp", - "id": 1 - } - } - }, - "PartitionStartRecord": { - "fields": { - "startTimestamp": { - "type": "google.protobuf.Timestamp", - "id": 1 - }, - "recordSequence": { - "type": "string", - "id": 2 - }, - "partitionTokens": { - "rule": "repeated", - "type": "string", - "id": 3 - } - } - }, - "PartitionEndRecord": { - "fields": { - "endTimestamp": { - "type": "google.protobuf.Timestamp", - "id": 1 - }, - "recordSequence": { - "type": "string", - "id": 2 - }, - "partitionToken": { - "type": "string", - "id": 3 - } - } - }, - "PartitionEventRecord": { - "fields": { - "commitTimestamp": { - "type": "google.protobuf.Timestamp", - "id": 1 - }, - "recordSequence": { - "type": "string", - "id": 2 - }, - "partitionToken": { - "type": "string", - "id": 3 - }, - "moveInEvents": { - "rule": "repeated", - "type": "MoveInEvent", - "id": 4 - }, - "moveOutEvents": { - "rule": "repeated", - "type": "MoveOutEvent", - "id": 5 - } - }, - "nested": { - "MoveInEvent": { - "fields": { - "sourcePartitionToken": { - "type": "string", - "id": 1 - } - } - }, - "MoveOutEvent": { - "fields": { - "destinationPartitionToken": { - "type": "string", - "id": 1 - } - } - } - } - } - } - }, - "Type": { - "fields": { - "code": { - "type": "TypeCode", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "arrayElementType": { - "type": "Type", - "id": 2 - }, - "structType": { - "type": "StructType", - "id": 3 - }, - "typeAnnotation": { - "type": "TypeAnnotationCode", - "id": 4 - }, - "protoTypeFqn": { - "type": "string", - "id": 5 - } - } - }, - "StructType": { - "fields": { - "fields": { - "rule": "repeated", - "type": "Field", - "id": 1 - } - }, - "nested": { - "Field": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "type": { - "type": "Type", - "id": 2 - } - } - } - } - }, - "TypeCode": { - "values": { - "TYPE_CODE_UNSPECIFIED": 0, - "BOOL": 1, - "INT64": 2, - "FLOAT64": 3, - "FLOAT32": 15, - "TIMESTAMP": 4, - "DATE": 5, - "STRING": 6, - "BYTES": 7, - "ARRAY": 8, - "STRUCT": 9, - "NUMERIC": 10, - "JSON": 11, - "PROTO": 13, - "ENUM": 14, - "INTERVAL": 16, - "UUID": 17 - } - }, - "TypeAnnotationCode": { - "values": { - "TYPE_ANNOTATION_CODE_UNSPECIFIED": 0, - "PG_NUMERIC": 2, - "PG_JSONB": 3, - "PG_OID": 4 - } - }, - "CommitResponse": { - "oneofs": { - "MultiplexedSessionRetry": { - "oneof": [ - "precommitToken" - ] - } - }, - "fields": { - "commitTimestamp": { - "type": "google.protobuf.Timestamp", - "id": 1 - }, - "commitStats": { - "type": "CommitStats", - "id": 2 - }, - "precommitToken": { - "type": "MultiplexedSessionPrecommitToken", - "id": 4 - }, - "snapshotTimestamp": { - "type": "google.protobuf.Timestamp", - "id": 5 - } - }, - "nested": { - "CommitStats": { - "fields": { - "mutationCount": { - "type": "int64", - "id": 1 - } - } - } - } - }, - "TransactionOptions": { - "oneofs": { - "mode": { - "oneof": [ - "readWrite", - "partitionedDml", - "readOnly" - ] - } - }, - "fields": { - "readWrite": { - "type": "ReadWrite", - "id": 1 - }, - "partitionedDml": { - "type": "PartitionedDml", - "id": 3 - }, - "readOnly": { - "type": "ReadOnly", - "id": 2 - }, - "excludeTxnFromChangeStreams": { - "type": "bool", - "id": 5 - }, - "isolationLevel": { - "type": "IsolationLevel", - "id": 6 - } - }, - "nested": { - "ReadWrite": { - "fields": { - "readLockMode": { - "type": "ReadLockMode", - "id": 1 - }, - "multiplexedSessionPreviousTransactionId": { - "type": "bytes", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "ReadLockMode": { - "values": { - "READ_LOCK_MODE_UNSPECIFIED": 0, - "PESSIMISTIC": 1, - "OPTIMISTIC": 2 - } - } - } - }, - "PartitionedDml": { - "fields": {} - }, - "ReadOnly": { - "oneofs": { - "timestampBound": { - "oneof": [ - "strong", - "minReadTimestamp", - "maxStaleness", - "readTimestamp", - "exactStaleness" - ] - } - }, - "fields": { - "strong": { - "type": "bool", - "id": 1 - }, - "minReadTimestamp": { - "type": "google.protobuf.Timestamp", - "id": 2 - }, - "maxStaleness": { - "type": "google.protobuf.Duration", - "id": 3 - }, - "readTimestamp": { - "type": "google.protobuf.Timestamp", - "id": 4 - }, - "exactStaleness": { - "type": "google.protobuf.Duration", - "id": 5 - }, - "returnReadTimestamp": { - "type": "bool", - "id": 6 - } - } - }, - "IsolationLevel": { - "values": { - "ISOLATION_LEVEL_UNSPECIFIED": 0, - "SERIALIZABLE": 1, - "REPEATABLE_READ": 2 - } - } - } - }, - "Transaction": { - "fields": { - "id": { - "type": "bytes", - "id": 1 - }, - "readTimestamp": { - "type": "google.protobuf.Timestamp", - "id": 2 - }, - "precommitToken": { - "type": "MultiplexedSessionPrecommitToken", - "id": 3 - } - } - }, - "TransactionSelector": { - "oneofs": { - "selector": { - "oneof": [ - "singleUse", - "id", - "begin" - ] - } - }, - "fields": { - "singleUse": { - "type": "TransactionOptions", - "id": 1 - }, - "id": { - "type": "bytes", - "id": 2 - }, - "begin": { - "type": "TransactionOptions", - "id": 3 - } - } - }, - "MultiplexedSessionPrecommitToken": { - "fields": { - "precommitToken": { - "type": "bytes", - "id": 1 - }, - "seqNum": { - "type": "int32", - "id": 2 - } - } - }, - "KeyRange": { - "oneofs": { - "startKeyType": { - "oneof": [ - "startClosed", - "startOpen" - ] - }, - "endKeyType": { - "oneof": [ - "endClosed", - "endOpen" - ] - } - }, - "fields": { - "startClosed": { - "type": "google.protobuf.ListValue", - "id": 1 - }, - "startOpen": { - "type": "google.protobuf.ListValue", - "id": 2 - }, - "endClosed": { - "type": "google.protobuf.ListValue", - "id": 3 - }, - "endOpen": { - "type": "google.protobuf.ListValue", - "id": 4 - } - } - }, - "KeySet": { - "fields": { - "keys": { - "rule": "repeated", - "type": "google.protobuf.ListValue", - "id": 1 - }, - "ranges": { - "rule": "repeated", - "type": "KeyRange", - "id": 2 - }, - "all": { - "type": "bool", - "id": 3 - } - } - }, - "Range": { - "fields": { - "startKey": { - "type": "bytes", - "id": 1 - }, - "limitKey": { - "type": "bytes", - "id": 2 - }, - "groupUid": { - "type": "uint64", - "id": 3 - }, - "splitId": { - "type": "uint64", - "id": 4 - }, - "generation": { - "type": "bytes", - "id": 5 - } - } - }, - "Tablet": { - "fields": { - "tabletUid": { - "type": "uint64", - "id": 1 - }, - "serverAddress": { - "type": "string", - "id": 2 - }, - "location": { - "type": "string", - "id": 3 - }, - "role": { - "type": "Role", - "id": 4 - }, - "incarnation": { - "type": "bytes", - "id": 5 - }, - "distance": { - "type": "uint32", - "id": 6 - }, - "skip": { - "type": "bool", - "id": 7 - } - }, - "nested": { - "Role": { - "values": { - "ROLE_UNSPECIFIED": 0, - "READ_WRITE": 1, - "READ_ONLY": 2 - } - } - } - }, - "Group": { - "fields": { - "groupUid": { - "type": "uint64", - "id": 1 - }, - "tablets": { - "rule": "repeated", - "type": "Tablet", - "id": 2 - }, - "leaderIndex": { - "type": "int32", - "id": 3 - }, - "generation": { - "type": "bytes", - "id": 4 - } - } - }, - "KeyRecipe": { - "oneofs": { - "target": { - "oneof": [ - "tableName", - "indexName", - "operationUid" - ] - } - }, - "fields": { - "tableName": { - "type": "string", - "id": 1 - }, - "indexName": { - "type": "string", - "id": 2 - }, - "operationUid": { - "type": "uint64", - "id": 3 - }, - "part": { - "rule": "repeated", - "type": "Part", - "id": 4 - } - }, - "nested": { - "Part": { - "oneofs": { - "valueType": { - "oneof": [ - "identifier", - "value", - "random" - ] - } - }, - "fields": { - "tag": { - "type": "uint32", - "id": 1 - }, - "order": { - "type": "Order", - "id": 2 - }, - "nullOrder": { - "type": "NullOrder", - "id": 3 - }, - "type": { - "type": "Type", - "id": 4 - }, - "identifier": { - "type": "string", - "id": 5 - }, - "value": { - "type": "google.protobuf.Value", - "id": 6 - }, - "random": { - "type": "bool", - "id": 8 - }, - "structIdentifiers": { - "rule": "repeated", - "type": "int32", - "id": 7 - } - }, - "nested": { - "Order": { - "values": { - "ORDER_UNSPECIFIED": 0, - "ASCENDING": 1, - "DESCENDING": 2 - } - }, - "NullOrder": { - "values": { - "NULL_ORDER_UNSPECIFIED": 0, - "NULLS_FIRST": 1, - "NULLS_LAST": 2, - "NOT_NULL": 3 - } - } - } - } - } - }, - "RecipeList": { - "fields": { - "schemaGeneration": { - "type": "bytes", - "id": 1 - }, - "recipe": { - "rule": "repeated", - "type": "KeyRecipe", - "id": 3 - } - } - }, - "CacheUpdate": { - "fields": { - "databaseId": { - "type": "uint64", - "id": 1 - }, - "range": { - "rule": "repeated", - "type": "Range", - "id": 2 - }, - "group": { - "rule": "repeated", - "type": "Group", - "id": 3 - }, - "keyRecipes": { - "type": "RecipeList", - "id": 5 - } - } - }, - "RoutingHint": { - "fields": { - "operationUid": { - "type": "uint64", - "id": 1 - }, - "databaseId": { - "type": "uint64", - "id": 2 - }, - "schemaGeneration": { - "type": "bytes", - "id": 3 - }, - "key": { - "type": "bytes", - "id": 4 - }, - "limitKey": { - "type": "bytes", - "id": 5 - }, - "groupUid": { - "type": "uint64", - "id": 6 - }, - "splitId": { - "type": "uint64", - "id": 7 - }, - "tabletUid": { - "type": "uint64", - "id": 8 - }, - "skippedTabletUid": { - "rule": "repeated", - "type": "SkippedTablet", - "id": 9 - }, - "clientLocation": { - "type": "string", - "id": 10 - } - }, - "nested": { - "SkippedTablet": { - "fields": { - "tabletUid": { - "type": "uint64", - "id": 1 - }, - "incarnation": { - "type": "bytes", - "id": 2 - } - } - } - } - }, - "Mutation": { - "oneofs": { - "operation": { - "oneof": [ - "insert", - "update", - "insertOrUpdate", - "replace", - "delete", - "send", - "ack" - ] - } - }, - "fields": { - "insert": { - "type": "Write", - "id": 1 - }, - "update": { - "type": "Write", - "id": 2 - }, - "insertOrUpdate": { - "type": "Write", - "id": 3 - }, - "replace": { - "type": "Write", - "id": 4 - }, - "delete": { - "type": "Delete", - "id": 5 - }, - "send": { - "type": "Send", - "id": 6 - }, - "ack": { - "type": "Ack", - "id": 7 - } - }, - "nested": { - "Write": { - "fields": { - "table": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "columns": { - "rule": "repeated", - "type": "string", - "id": 2 - }, - "values": { - "rule": "repeated", - "type": "google.protobuf.ListValue", - "id": 3 - } - } - }, - "Delete": { - "fields": { - "table": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "keySet": { - "type": "KeySet", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "Send": { - "fields": { - "queue": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "key": { - "type": "google.protobuf.ListValue", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "deliverTime": { - "type": "google.protobuf.Timestamp", - "id": 3 - }, - "payload": { - "type": "google.protobuf.Value", - "id": 4 - } - } - }, - "Ack": { - "fields": { - "queue": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "key": { - "type": "google.protobuf.ListValue", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "ignoreNotFound": { - "type": "bool", - "id": 3 - } - } - } - } - }, - "PlanNode": { - "fields": { - "index": { - "type": "int32", - "id": 1 - }, - "kind": { - "type": "Kind", - "id": 2 - }, - "displayName": { - "type": "string", - "id": 3 - }, - "childLinks": { - "rule": "repeated", - "type": "ChildLink", - "id": 4 - }, - "shortRepresentation": { - "type": "ShortRepresentation", - "id": 5 - }, - "metadata": { - "type": "google.protobuf.Struct", - "id": 6 - }, - "executionStats": { - "type": "google.protobuf.Struct", - "id": 7 - } - }, - "nested": { - "Kind": { - "values": { - "KIND_UNSPECIFIED": 0, - "RELATIONAL": 1, - "SCALAR": 2 - } - }, - "ChildLink": { - "fields": { - "childIndex": { - "type": "int32", - "id": 1 - }, - "type": { - "type": "string", - "id": 2 - }, - "variable": { - "type": "string", - "id": 3 - } - } - }, - "ShortRepresentation": { - "fields": { - "description": { - "type": "string", - "id": 1 - }, - "subqueries": { - "keyType": "string", - "type": "int32", - "id": 2 - } - } - } - } - }, - "QueryAdvisorResult": { - "fields": { - "indexAdvice": { - "rule": "repeated", - "type": "IndexAdvice", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "IndexAdvice": { - "fields": { - "ddl": { - "rule": "repeated", - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "improvementFactor": { - "type": "double", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - } - } - }, - "QueryPlan": { - "fields": { - "planNodes": { - "rule": "repeated", - "type": "PlanNode", - "id": 1 - }, - "queryAdvice": { - "type": "QueryAdvisorResult", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ResultSet": { - "fields": { - "metadata": { - "type": "ResultSetMetadata", - "id": 1 - }, - "rows": { - "rule": "repeated", - "type": "google.protobuf.ListValue", - "id": 2 - }, - "stats": { - "type": "ResultSetStats", - "id": 3 - }, - "precommitToken": { - "type": "MultiplexedSessionPrecommitToken", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "cacheUpdate": { - "type": "CacheUpdate", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "PartialResultSet": { - "fields": { - "metadata": { - "type": "ResultSetMetadata", - "id": 1 - }, - "values": { - "rule": "repeated", - "type": "google.protobuf.Value", - "id": 2 - }, - "chunkedValue": { - "type": "bool", - "id": 3 - }, - "resumeToken": { - "type": "bytes", - "id": 4 - }, - "stats": { - "type": "ResultSetStats", - "id": 5 - }, - "precommitToken": { - "type": "MultiplexedSessionPrecommitToken", - "id": 8, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "last": { - "type": "bool", - "id": 9, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "cacheUpdate": { - "type": "CacheUpdate", - "id": 10, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ResultSetMetadata": { - "fields": { - "rowType": { - "type": "StructType", - "id": 1 - }, - "transaction": { - "type": "Transaction", - "id": 2 - }, - "undeclaredParameters": { - "type": "StructType", - "id": 3 - } - } - }, - "ResultSetStats": { - "oneofs": { - "rowCount": { - "oneof": [ - "rowCountExact", - "rowCountLowerBound" - ] - } - }, - "fields": { - "queryPlan": { - "type": "QueryPlan", - "id": 1 - }, - "queryStats": { - "type": "google.protobuf.Struct", - "id": 2 - }, - "rowCountExact": { - "type": "int64", - "id": 3 - }, - "rowCountLowerBound": { - "type": "int64", - "id": 4 - } - } - }, - "Spanner": { - "options": { - "(google.api.default_host)": "spanner.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/spanner.data" - }, - "methods": { - "CreateSession": { - "requestType": "CreateSessionRequest", - "responseType": "Session", - "options": { - "(google.api.http).post": "/v1/{database=projects/*/instances/*/databases/*}/sessions", - "(google.api.http).body": "*", - "(google.api.method_signature)": "database" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{database=projects/*/instances/*/databases/*}/sessions", - "body": "*" - } - }, - { - "(google.api.method_signature)": "database" - } - ] - }, - "BatchCreateSessions": { - "requestType": "BatchCreateSessionsRequest", - "responseType": "BatchCreateSessionsResponse", - "options": { - "(google.api.http).post": "/v1/{database=projects/*/instances/*/databases/*}/sessions:batchCreate", - "(google.api.http).body": "*", - "(google.api.method_signature)": "database,session_count" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{database=projects/*/instances/*/databases/*}/sessions:batchCreate", - "body": "*" - } - }, - { - "(google.api.method_signature)": "database,session_count" - } - ] - }, - "GetSession": { - "requestType": "GetSessionRequest", - "responseType": "Session", - "options": { - "(google.api.http).get": "/v1/{name=projects/*/instances/*/databases/*/sessions/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=projects/*/instances/*/databases/*/sessions/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListSessions": { - "requestType": "ListSessionsRequest", - "responseType": "ListSessionsResponse", - "options": { - "(google.api.http).get": "/v1/{database=projects/*/instances/*/databases/*}/sessions", - "(google.api.method_signature)": "database" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{database=projects/*/instances/*/databases/*}/sessions" - } - }, - { - "(google.api.method_signature)": "database" - } - ] - }, - "DeleteSession": { - "requestType": "DeleteSessionRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v1/{name=projects/*/instances/*/databases/*/sessions/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1/{name=projects/*/instances/*/databases/*/sessions/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ExecuteSql": { - "requestType": "ExecuteSqlRequest", - "responseType": "ResultSet", - "options": { - "(google.api.http).post": "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:executeSql", - "(google.api.http).body": "*" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:executeSql", - "body": "*" - } - } - ] - }, - "ExecuteStreamingSql": { - "requestType": "ExecuteSqlRequest", - "responseType": "PartialResultSet", - "responseStream": true, - "options": { - "(google.api.http).post": "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:executeStreamingSql", - "(google.api.http).body": "*" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:executeStreamingSql", - "body": "*" - } - } - ] - }, - "ExecuteBatchDml": { - "requestType": "ExecuteBatchDmlRequest", - "responseType": "ExecuteBatchDmlResponse", - "options": { - "(google.api.http).post": "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:executeBatchDml", - "(google.api.http).body": "*" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:executeBatchDml", - "body": "*" - } - } - ] - }, - "Read": { - "requestType": "ReadRequest", - "responseType": "ResultSet", - "options": { - "(google.api.http).post": "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:read", - "(google.api.http).body": "*" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:read", - "body": "*" - } - } - ] - }, - "StreamingRead": { - "requestType": "ReadRequest", - "responseType": "PartialResultSet", - "responseStream": true, - "options": { - "(google.api.http).post": "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:streamingRead", - "(google.api.http).body": "*" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:streamingRead", - "body": "*" - } - } - ] - }, - "BeginTransaction": { - "requestType": "BeginTransactionRequest", - "responseType": "Transaction", - "options": { - "(google.api.http).post": "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:beginTransaction", - "(google.api.http).body": "*", - "(google.api.method_signature)": "session,options" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:beginTransaction", - "body": "*" - } - }, - { - "(google.api.method_signature)": "session,options" - } - ] - }, - "Commit": { - "requestType": "CommitRequest", - "responseType": "CommitResponse", - "options": { - "(google.api.http).post": "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:commit", - "(google.api.http).body": "*", - "(google.api.method_signature)": "session,single_use_transaction,mutations" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:commit", - "body": "*" - } - }, - { - "(google.api.method_signature)": "session,transaction_id,mutations" - }, - { - "(google.api.method_signature)": "session,single_use_transaction,mutations" - } - ] - }, - "Rollback": { - "requestType": "RollbackRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).post": "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:rollback", - "(google.api.http).body": "*", - "(google.api.method_signature)": "session,transaction_id" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:rollback", - "body": "*" - } - }, - { - "(google.api.method_signature)": "session,transaction_id" - } - ] - }, - "PartitionQuery": { - "requestType": "PartitionQueryRequest", - "responseType": "PartitionResponse", - "options": { - "(google.api.http).post": "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:partitionQuery", - "(google.api.http).body": "*" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:partitionQuery", - "body": "*" - } - } - ] - }, - "PartitionRead": { - "requestType": "PartitionReadRequest", - "responseType": "PartitionResponse", - "options": { - "(google.api.http).post": "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:partitionRead", - "(google.api.http).body": "*" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:partitionRead", - "body": "*" - } - } - ] - }, - "BatchWrite": { - "requestType": "BatchWriteRequest", - "responseType": "BatchWriteResponse", - "responseStream": true, - "options": { - "(google.api.http).post": "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:batchWrite", - "(google.api.http).body": "*", - "(google.api.method_signature)": "session,mutation_groups" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:batchWrite", - "body": "*" - } - }, - { - "(google.api.method_signature)": "session,mutation_groups" - } - ] - } - } - }, - "CreateSessionRequest": { - "fields": { - "database": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/Database" - } - }, - "session": { - "type": "Session", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "BatchCreateSessionsRequest": { - "fields": { - "database": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/Database" - } - }, - "sessionTemplate": { - "type": "Session", - "id": 2 - }, - "sessionCount": { - "type": "int32", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "BatchCreateSessionsResponse": { - "fields": { - "session": { - "rule": "repeated", - "type": "Session", - "id": 1 - } - } - }, - "Session": { - "options": { - "(google.api.resource).type": "spanner.googleapis.com/Session", - "(google.api.resource).pattern": "projects/{project}/instances/{instance}/databases/{database}/sessions/{session}", - "(google.api.resource).plural": "sessions", - "(google.api.resource).singular": "session" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 2 - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "approximateLastUseTime": { - "type": "google.protobuf.Timestamp", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "creatorRole": { - "type": "string", - "id": 5 - }, - "multiplexed": { - "type": "bool", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "GetSessionRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/Session" - } - } - } - }, - "ListSessionsRequest": { - "fields": { - "database": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/Database" - } - }, - "pageSize": { - "type": "int32", - "id": 2 - }, - "pageToken": { - "type": "string", - "id": 3 - }, - "filter": { - "type": "string", - "id": 4 - } - } - }, - "ListSessionsResponse": { - "fields": { - "sessions": { - "rule": "repeated", - "type": "Session", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "DeleteSessionRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/Session" - } - } - } - }, - "RequestOptions": { - "fields": { - "priority": { - "type": "Priority", - "id": 1 - }, - "requestTag": { - "type": "string", - "id": 2 - }, - "transactionTag": { - "type": "string", - "id": 3 - }, - "clientContext": { - "type": "ClientContext", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "Priority": { - "values": { - "PRIORITY_UNSPECIFIED": 0, - "PRIORITY_LOW": 1, - "PRIORITY_MEDIUM": 2, - "PRIORITY_HIGH": 3 - } - }, - "ClientContext": { - "fields": { - "secureContext": { - "keyType": "string", - "type": "google.protobuf.Value", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - } - } - }, - "DirectedReadOptions": { - "oneofs": { - "replicas": { - "oneof": [ - "includeReplicas", - "excludeReplicas" - ] - } - }, - "fields": { - "includeReplicas": { - "type": "IncludeReplicas", - "id": 1 - }, - "excludeReplicas": { - "type": "ExcludeReplicas", - "id": 2 - } - }, - "nested": { - "ReplicaSelection": { - "fields": { - "location": { - "type": "string", - "id": 1 - }, - "type": { - "type": "Type", - "id": 2 - } - }, - "nested": { - "Type": { - "values": { - "TYPE_UNSPECIFIED": 0, - "READ_WRITE": 1, - "READ_ONLY": 2 - } - } - } - }, - "IncludeReplicas": { - "fields": { - "replicaSelections": { - "rule": "repeated", - "type": "ReplicaSelection", - "id": 1 - }, - "autoFailoverDisabled": { - "type": "bool", - "id": 2 - } - } - }, - "ExcludeReplicas": { - "fields": { - "replicaSelections": { - "rule": "repeated", - "type": "ReplicaSelection", - "id": 1 - } - } - } - } - }, - "ExecuteSqlRequest": { - "fields": { - "session": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/Session" - } - }, - "transaction": { - "type": "TransactionSelector", - "id": 2 - }, - "sql": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "params": { - "type": "google.protobuf.Struct", - "id": 4 - }, - "paramTypes": { - "keyType": "string", - "type": "Type", - "id": 5 - }, - "resumeToken": { - "type": "bytes", - "id": 6 - }, - "queryMode": { - "type": "QueryMode", - "id": 7 - }, - "partitionToken": { - "type": "bytes", - "id": 8 - }, - "seqno": { - "type": "int64", - "id": 9 - }, - "queryOptions": { - "type": "QueryOptions", - "id": 10 - }, - "requestOptions": { - "type": "RequestOptions", - "id": 11 - }, - "directedReadOptions": { - "type": "DirectedReadOptions", - "id": 15 - }, - "dataBoostEnabled": { - "type": "bool", - "id": 16 - }, - "lastStatement": { - "type": "bool", - "id": 17, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "routingHint": { - "type": "RoutingHint", - "id": 18, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "QueryMode": { - "values": { - "NORMAL": 0, - "PLAN": 1, - "PROFILE": 2, - "WITH_STATS": 3, - "WITH_PLAN_AND_STATS": 4 - } - }, - "QueryOptions": { - "fields": { - "optimizerVersion": { - "type": "string", - "id": 1 - }, - "optimizerStatisticsPackage": { - "type": "string", - "id": 2 - } - } - } - } - }, - "ExecuteBatchDmlRequest": { - "fields": { - "session": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/Session" - } - }, - "transaction": { - "type": "TransactionSelector", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "statements": { - "rule": "repeated", - "type": "Statement", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "seqno": { - "type": "int64", - "id": 4, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "requestOptions": { - "type": "RequestOptions", - "id": 5 - }, - "lastStatements": { - "type": "bool", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "Statement": { - "fields": { - "sql": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "params": { - "type": "google.protobuf.Struct", - "id": 2 - }, - "paramTypes": { - "keyType": "string", - "type": "Type", - "id": 3 - } - } - } - } - }, - "ExecuteBatchDmlResponse": { - "fields": { - "resultSets": { - "rule": "repeated", - "type": "ResultSet", - "id": 1 - }, - "status": { - "type": "google.rpc.Status", - "id": 2 - }, - "precommitToken": { - "type": "MultiplexedSessionPrecommitToken", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "PartitionOptions": { - "fields": { - "partitionSizeBytes": { - "type": "int64", - "id": 1 - }, - "maxPartitions": { - "type": "int64", - "id": 2 - } - } - }, - "PartitionQueryRequest": { - "fields": { - "session": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/Session" - } - }, - "transaction": { - "type": "TransactionSelector", - "id": 2 - }, - "sql": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "params": { - "type": "google.protobuf.Struct", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "paramTypes": { - "keyType": "string", - "type": "Type", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "partitionOptions": { - "type": "PartitionOptions", - "id": 6 - } - } - }, - "PartitionReadRequest": { - "fields": { - "session": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/Session" - } - }, - "transaction": { - "type": "TransactionSelector", - "id": 2 - }, - "table": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "index": { - "type": "string", - "id": 4 - }, - "columns": { - "rule": "repeated", - "type": "string", - "id": 5 - }, - "keySet": { - "type": "KeySet", - "id": 6, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "partitionOptions": { - "type": "PartitionOptions", - "id": 9 - } - } - }, - "Partition": { - "fields": { - "partitionToken": { - "type": "bytes", - "id": 1 - } - } - }, - "PartitionResponse": { - "fields": { - "partitions": { - "rule": "repeated", - "type": "Partition", - "id": 1 - }, - "transaction": { - "type": "Transaction", - "id": 2 - } - } - }, - "ReadRequest": { - "fields": { - "session": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/Session" - } - }, - "transaction": { - "type": "TransactionSelector", - "id": 2 - }, - "table": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "index": { - "type": "string", - "id": 4 - }, - "columns": { - "rule": "repeated", - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "keySet": { - "type": "KeySet", - "id": 6, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "limit": { - "type": "int64", - "id": 8 - }, - "resumeToken": { - "type": "bytes", - "id": 9 - }, - "partitionToken": { - "type": "bytes", - "id": 10 - }, - "requestOptions": { - "type": "RequestOptions", - "id": 11 - }, - "directedReadOptions": { - "type": "DirectedReadOptions", - "id": 14 - }, - "dataBoostEnabled": { - "type": "bool", - "id": 15 - }, - "orderBy": { - "type": "OrderBy", - "id": 16, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "lockHint": { - "type": "LockHint", - "id": 17, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "routingHint": { - "type": "RoutingHint", - "id": 18, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "OrderBy": { - "values": { - "ORDER_BY_UNSPECIFIED": 0, - "ORDER_BY_PRIMARY_KEY": 1, - "ORDER_BY_NO_ORDER": 2 - } - }, - "LockHint": { - "values": { - "LOCK_HINT_UNSPECIFIED": 0, - "LOCK_HINT_SHARED": 1, - "LOCK_HINT_EXCLUSIVE": 2 - } - } - } - }, - "BeginTransactionRequest": { - "fields": { - "session": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/Session" - } - }, - "options": { - "type": "TransactionOptions", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "requestOptions": { - "type": "RequestOptions", - "id": 3 - }, - "mutationKey": { - "type": "Mutation", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "CommitRequest": { - "oneofs": { - "transaction": { - "oneof": [ - "transactionId", - "singleUseTransaction" - ] - } - }, - "fields": { - "session": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/Session" - } - }, - "transactionId": { - "type": "bytes", - "id": 2 - }, - "singleUseTransaction": { - "type": "TransactionOptions", - "id": 3 - }, - "mutations": { - "rule": "repeated", - "type": "Mutation", - "id": 4 - }, - "returnCommitStats": { - "type": "bool", - "id": 5 - }, - "maxCommitDelay": { - "type": "google.protobuf.Duration", - "id": 8, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "requestOptions": { - "type": "RequestOptions", - "id": 6 - }, - "precommitToken": { - "type": "MultiplexedSessionPrecommitToken", - "id": 9, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "RollbackRequest": { - "fields": { - "session": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/Session" - } - }, - "transactionId": { - "type": "bytes", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "BatchWriteRequest": { - "fields": { - "session": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "spanner.googleapis.com/Session" - } - }, - "requestOptions": { - "type": "RequestOptions", - "id": 3 - }, - "mutationGroups": { - "rule": "repeated", - "type": "MutationGroup", - "id": 4, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "excludeTxnFromChangeStreams": { - "type": "bool", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "MutationGroup": { - "fields": { - "mutations": { - "rule": "repeated", - "type": "Mutation", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - } - } - }, - "BatchWriteResponse": { - "fields": { - "indexes": { - "rule": "repeated", - "type": "int32", - "id": 1 - }, - "status": { - "type": "google.rpc.Status", - "id": 2 - }, - "commitTimestamp": { - "type": "google.protobuf.Timestamp", - "id": 3 - } - } - } - } - } - } - }, - "api": { - "options": { - "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", - "java_multiple_files": true, - "java_outer_classname": "ResourceProto", - "java_package": "com.google.api", - "objc_class_prefix": "GAPI", - "cc_enable_arenas": true - }, - "nested": { - "fieldBehavior": { - "rule": "repeated", - "type": "google.api.FieldBehavior", - "id": 1052, - "extend": "google.protobuf.FieldOptions", - "options": { - "packed": false - } - }, - "FieldBehavior": { - "values": { - "FIELD_BEHAVIOR_UNSPECIFIED": 0, - "OPTIONAL": 1, - "REQUIRED": 2, - "OUTPUT_ONLY": 3, - "INPUT_ONLY": 4, - "IMMUTABLE": 5, - "UNORDERED_LIST": 6, - "NON_EMPTY_DEFAULT": 7, - "IDENTIFIER": 8 - } - }, - "http": { - "type": "HttpRule", - "id": 72295728, - "extend": "google.protobuf.MethodOptions" - }, - "Http": { - "fields": { - "rules": { - "rule": "repeated", - "type": "HttpRule", - "id": 1 - }, - "fullyDecodeReservedExpansion": { - "type": "bool", - "id": 2 - } - } - }, - "HttpRule": { - "oneofs": { - "pattern": { - "oneof": [ - "get", - "put", - "post", - "delete", - "patch", - "custom" - ] - } - }, - "fields": { - "selector": { - "type": "string", - "id": 1 - }, - "get": { - "type": "string", - "id": 2 - }, - "put": { - "type": "string", - "id": 3 - }, - "post": { - "type": "string", - "id": 4 - }, - "delete": { - "type": "string", - "id": 5 - }, - "patch": { - "type": "string", - "id": 6 - }, - "custom": { - "type": "CustomHttpPattern", - "id": 8 - }, - "body": { - "type": "string", - "id": 7 - }, - "responseBody": { - "type": "string", - "id": 12 - }, - "additionalBindings": { - "rule": "repeated", - "type": "HttpRule", - "id": 11 - } - } - }, - "CustomHttpPattern": { - "fields": { - "kind": { - "type": "string", - "id": 1 - }, - "path": { - "type": "string", - "id": 2 - } - } - }, - "methodSignature": { - "rule": "repeated", - "type": "string", - "id": 1051, - "extend": "google.protobuf.MethodOptions" - }, - "defaultHost": { - "type": "string", - "id": 1049, - "extend": "google.protobuf.ServiceOptions" - }, - "oauthScopes": { - "type": "string", - "id": 1050, - "extend": "google.protobuf.ServiceOptions" - }, - "apiVersion": { - "type": "string", - "id": 525000001, - "extend": "google.protobuf.ServiceOptions" - }, - "CommonLanguageSettings": { - "fields": { - "referenceDocsUri": { - "type": "string", - "id": 1, - "options": { - "deprecated": true - } - }, - "destinations": { - "rule": "repeated", - "type": "ClientLibraryDestination", - "id": 2 - } - } - }, - "ClientLibrarySettings": { - "fields": { - "version": { - "type": "string", - "id": 1 - }, - "launchStage": { - "type": "LaunchStage", - "id": 2 - }, - "restNumericEnums": { - "type": "bool", - "id": 3 - }, - "javaSettings": { - "type": "JavaSettings", - "id": 21 - }, - "cppSettings": { - "type": "CppSettings", - "id": 22 - }, - "phpSettings": { - "type": "PhpSettings", - "id": 23 - }, - "pythonSettings": { - "type": "PythonSettings", - "id": 24 - }, - "nodeSettings": { - "type": "NodeSettings", - "id": 25 - }, - "dotnetSettings": { - "type": "DotnetSettings", - "id": 26 - }, - "rubySettings": { - "type": "RubySettings", - "id": 27 - }, - "goSettings": { - "type": "GoSettings", - "id": 28 - } - } - }, - "Publishing": { - "fields": { - "methodSettings": { - "rule": "repeated", - "type": "MethodSettings", - "id": 2 - }, - "newIssueUri": { - "type": "string", - "id": 101 - }, - "documentationUri": { - "type": "string", - "id": 102 - }, - "apiShortName": { - "type": "string", - "id": 103 - }, - "githubLabel": { - "type": "string", - "id": 104 - }, - "codeownerGithubTeams": { - "rule": "repeated", - "type": "string", - "id": 105 - }, - "docTagPrefix": { - "type": "string", - "id": 106 - }, - "organization": { - "type": "ClientLibraryOrganization", - "id": 107 - }, - "librarySettings": { - "rule": "repeated", - "type": "ClientLibrarySettings", - "id": 109 - }, - "protoReferenceDocumentationUri": { - "type": "string", - "id": 110 - }, - "restReferenceDocumentationUri": { - "type": "string", - "id": 111 - } - } - }, - "JavaSettings": { - "fields": { - "libraryPackage": { - "type": "string", - "id": 1 - }, - "serviceClassNames": { - "keyType": "string", - "type": "string", - "id": 2 - }, - "common": { - "type": "CommonLanguageSettings", - "id": 3 - } - } - }, - "CppSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "PhpSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "PythonSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "NodeSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "DotnetSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - }, - "renamedServices": { - "keyType": "string", - "type": "string", - "id": 2 - }, - "renamedResources": { - "keyType": "string", - "type": "string", - "id": 3 - }, - "ignoredResources": { - "rule": "repeated", - "type": "string", - "id": 4 - }, - "forcedNamespaceAliases": { - "rule": "repeated", - "type": "string", - "id": 5 - }, - "handwrittenSignatures": { - "rule": "repeated", - "type": "string", - "id": 6 - } - } - }, - "RubySettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "GoSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "MethodSettings": { - "fields": { - "selector": { - "type": "string", - "id": 1 - }, - "longRunning": { - "type": "LongRunning", - "id": 2 - }, - "autoPopulatedFields": { - "rule": "repeated", - "type": "string", - "id": 3 - } - }, - "nested": { - "LongRunning": { - "fields": { - "initialPollDelay": { - "type": "google.protobuf.Duration", - "id": 1 - }, - "pollDelayMultiplier": { - "type": "float", - "id": 2 - }, - "maxPollDelay": { - "type": "google.protobuf.Duration", - "id": 3 - }, - "totalPollTimeout": { - "type": "google.protobuf.Duration", - "id": 4 - } - } - } - } - }, - "ClientLibraryOrganization": { - "values": { - "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": 0, - "CLOUD": 1, - "ADS": 2, - "PHOTOS": 3, - "STREET_VIEW": 4, - "SHOPPING": 5, - "GEO": 6, - "GENERATIVE_AI": 7 - } - }, - "ClientLibraryDestination": { - "values": { - "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": 0, - "GITHUB": 10, - "PACKAGE_MANAGER": 20 - } - }, - "LaunchStage": { - "values": { - "LAUNCH_STAGE_UNSPECIFIED": 0, - "UNIMPLEMENTED": 6, - "PRELAUNCH": 7, - "EARLY_ACCESS": 1, - "ALPHA": 2, - "BETA": 3, - "GA": 4, - "DEPRECATED": 5 - } - }, - "resourceReference": { - "type": "google.api.ResourceReference", - "id": 1055, - "extend": "google.protobuf.FieldOptions" - }, - "resourceDefinition": { - "rule": "repeated", - "type": "google.api.ResourceDescriptor", - "id": 1053, - "extend": "google.protobuf.FileOptions" - }, - "resource": { - "type": "google.api.ResourceDescriptor", - "id": 1053, - "extend": "google.protobuf.MessageOptions" - }, - "ResourceDescriptor": { - "fields": { - "type": { - "type": "string", - "id": 1 - }, - "pattern": { - "rule": "repeated", - "type": "string", - "id": 2 - }, - "nameField": { - "type": "string", - "id": 3 - }, - "history": { - "type": "History", - "id": 4 - }, - "plural": { - "type": "string", - "id": 5 - }, - "singular": { - "type": "string", - "id": 6 - }, - "style": { - "rule": "repeated", - "type": "Style", - "id": 10 - } - }, - "nested": { - "History": { - "values": { - "HISTORY_UNSPECIFIED": 0, - "ORIGINALLY_SINGLE_PATTERN": 1, - "FUTURE_MULTI_PATTERN": 2 - } - }, - "Style": { - "values": { - "STYLE_UNSPECIFIED": 0, - "DECLARATIVE_FRIENDLY": 1 - } - } - } - }, - "ResourceReference": { - "fields": { - "type": { - "type": "string", - "id": 1 - }, - "childType": { - "type": "string", - "id": 2 - } - } - } - } - }, - "rpc": { - "options": { - "cc_enable_arenas": true, - "go_package": "google.golang.org/genproto/googleapis/rpc/status;status", - "java_multiple_files": true, - "java_outer_classname": "StatusProto", - "java_package": "com.google.rpc", - "objc_class_prefix": "RPC" - }, - "nested": { - "Status": { - "fields": { - "code": { - "type": "int32", - "id": 1 - }, - "message": { - "type": "string", - "id": 2 - }, - "details": { - "rule": "repeated", - "type": "google.protobuf.Any", - "id": 3 - } - } - } - } - } - } - } - } -} \ No newline at end of file diff --git a/owl-bot-staging/v1/src/index.ts b/owl-bot-staging/v1/src/index.ts deleted file mode 100644 index 2703db602..000000000 --- a/owl-bot-staging/v1/src/index.ts +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as v1 from './v1'; -const SpannerClient = v1.SpannerClient; -type SpannerClient = v1.SpannerClient; -export {v1, SpannerClient}; -export default {v1, SpannerClient}; -import * as protos from '../protos/protos'; -export {protos} diff --git a/owl-bot-staging/v1/src/v1/gapic_metadata.json b/owl-bot-staging/v1/src/v1/gapic_metadata.json deleted file mode 100644 index 3354d9b87..000000000 --- a/owl-bot-staging/v1/src/v1/gapic_metadata.json +++ /dev/null @@ -1,172 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "typescript", - "protoPackage": "google.spanner.v1", - "libraryPackage": "@google-cloud/spanner", - "services": { - "Spanner": { - "clients": { - "grpc": { - "libraryClient": "SpannerClient", - "rpcs": { - "CreateSession": { - "methods": [ - "createSession" - ] - }, - "BatchCreateSessions": { - "methods": [ - "batchCreateSessions" - ] - }, - "GetSession": { - "methods": [ - "getSession" - ] - }, - "DeleteSession": { - "methods": [ - "deleteSession" - ] - }, - "ExecuteSql": { - "methods": [ - "executeSql" - ] - }, - "ExecuteBatchDml": { - "methods": [ - "executeBatchDml" - ] - }, - "Read": { - "methods": [ - "read" - ] - }, - "BeginTransaction": { - "methods": [ - "beginTransaction" - ] - }, - "Commit": { - "methods": [ - "commit" - ] - }, - "Rollback": { - "methods": [ - "rollback" - ] - }, - "PartitionQuery": { - "methods": [ - "partitionQuery" - ] - }, - "PartitionRead": { - "methods": [ - "partitionRead" - ] - }, - "ExecuteStreamingSql": { - "methods": [ - "executeStreamingSql" - ] - }, - "StreamingRead": { - "methods": [ - "streamingRead" - ] - }, - "BatchWrite": { - "methods": [ - "batchWrite" - ] - }, - "ListSessions": { - "methods": [ - "listSessions", - "listSessionsStream", - "listSessionsAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "SpannerClient", - "rpcs": { - "CreateSession": { - "methods": [ - "createSession" - ] - }, - "BatchCreateSessions": { - "methods": [ - "batchCreateSessions" - ] - }, - "GetSession": { - "methods": [ - "getSession" - ] - }, - "DeleteSession": { - "methods": [ - "deleteSession" - ] - }, - "ExecuteSql": { - "methods": [ - "executeSql" - ] - }, - "ExecuteBatchDml": { - "methods": [ - "executeBatchDml" - ] - }, - "Read": { - "methods": [ - "read" - ] - }, - "BeginTransaction": { - "methods": [ - "beginTransaction" - ] - }, - "Commit": { - "methods": [ - "commit" - ] - }, - "Rollback": { - "methods": [ - "rollback" - ] - }, - "PartitionQuery": { - "methods": [ - "partitionQuery" - ] - }, - "PartitionRead": { - "methods": [ - "partitionRead" - ] - }, - "ListSessions": { - "methods": [ - "listSessions", - "listSessionsStream", - "listSessionsAsync" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/v1/src/v1/index.ts b/owl-bot-staging/v1/src/v1/index.ts deleted file mode 100644 index aa14c15b6..000000000 --- a/owl-bot-staging/v1/src/v1/index.ts +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -export {SpannerClient} from './spanner_client'; diff --git a/owl-bot-staging/v1/src/v1/spanner_client.ts b/owl-bot-staging/v1/src/v1/spanner_client.ts deleted file mode 100644 index c7a1f8be6..000000000 --- a/owl-bot-staging/v1/src/v1/spanner_client.ts +++ /dev/null @@ -1,2584 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -/* global window */ -import type * as gax from 'google-gax'; -import type {Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback, GaxCall} from 'google-gax'; -import {Transform, PassThrough} from 'stream'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; - -/** - * Client JSON configuration object, loaded from - * `src/v1/spanner_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './spanner_client_config.json'; -const version = require('../../../package.json').version; - -/** - * Cloud Spanner API - * - * The Cloud Spanner API can be used to manage sessions and execute - * transactions on data stored in Cloud Spanner databases. - * @class - * @memberof v1 - */ -export class SpannerClient { - private _terminated = false; - private _opts: ClientOptions; - private _providedCustomServicePath: boolean; - private _gaxModule: typeof gax | typeof gax.fallback; - private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; - private _protos: {}; - private _defaults: {[method: string]: gax.CallSettings}; - private _universeDomain: string; - private _servicePath: string; - private _log = logging.log('spanner'); - - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - pathTemplates: {[name: string]: gax.PathTemplate}; - spannerStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of SpannerClient. - * - * @param {object} [options] - The configuration object. - * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). - * The common options are: - * @param {object} [options.credentials] - Credentials object. - * @param {string} [options.credentials.client_email] - * @param {string} [options.credentials.private_key] - * @param {string} [options.email] - Account email address. Required when - * using a .pem or .p12 keyFilename. - * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or - * .p12 key downloaded from the Google Developers Console. If you provide - * a path to a JSON file, the projectId option below is not necessary. - * NOTE: .pem and .p12 require you to specify options.email as well. - * @param {number} [options.port] - The port on which to connect to - * the remote host. - * @param {string} [options.projectId] - The project ID from the Google - * Developer's Console, e.g. 'grape-spaceship-123'. We will also check - * the environment variable GCLOUD_PROJECT for your project ID. If your - * app is running in an environment which supports - * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. - * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. - * For more information, please check the - * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. - * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you - * need to avoid loading the default gRPC version and want to use the fallback - * HTTP implementation. Load only fallback version and pass it to the constructor: - * ``` - * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new SpannerClient({fallback: true}, gax); - * ``` - */ - constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { - // Ensure that options include all the required fields. - const staticMembers = this.constructor as typeof SpannerClient; - if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { - throw new Error('Please set either universe_domain or universeDomain, but not both.'); - } - const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; - this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; - this._servicePath = 'spanner.' + this._universeDomain; - const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; - this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); - const port = opts?.port || staticMembers.port; - const clientConfig = opts?.clientConfig ?? {}; - const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); - opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); - - // Request numeric enum values if REST transport is used. - opts.numericEnums = true; - - // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. - if (servicePath !== this._servicePath && !('scopes' in opts)) { - opts['scopes'] = staticMembers.scopes; - } - - // Load google-gax module synchronously if needed - if (!gaxInstance) { - gaxInstance = require('google-gax') as typeof gax; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; - - // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. - this._gaxGrpc = new this._gaxModule.GrpcClient(opts); - - // Save options to use in initialize() method. - this._opts = opts; - - // Save the auth object to the client, for use by other methods. - this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); - - // Set useJWTAccessWithScope on the auth object. - this.auth.useJWTAccessWithScope = true; - - // Set defaultServicePath on the auth object. - this.auth.defaultServicePath = this._servicePath; - - // Set the default scopes in auth client if needed. - if (servicePath === this._servicePath) { - this.auth.defaultScopes = staticMembers.scopes; - } - - // Determine the client header string. - const clientHeader = [ - `gax/${this._gaxModule.version}`, - `gapic/${version}`, - ]; - if (typeof process === 'object' && 'versions' in process) { - clientHeader.push(`gl-node/${process.versions.node}`); - } else { - clientHeader.push(`gl-web/${this._gaxModule.version}`); - } - if (!opts.fallback) { - clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else { - clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); - } - if (opts.libName && opts.libVersion) { - clientHeader.push(`${opts.libName}/${opts.libVersion}`); - } - // Load the applicable protos. - this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); - - // This API contains "path templates"; forward-slash-separated - // identifiers to uniquely identify resources within the API. - // Create useful helper objects for these. - this.pathTemplates = { - databasePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/instances/{instance}/databases/{database}' - ), - sessionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/instances/{instance}/databases/{database}/sessions/{session}' - ), - }; - - // 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 = { - listSessions: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'sessions') - }; - - // Some of the methods on this service provide streaming responses. - // Provide descriptors for these. - this.descriptors.stream = { - executeStreamingSql: new this._gaxModule.StreamDescriptor(this._gaxModule.StreamType.SERVER_STREAMING, !!opts.fallback, !!opts.gaxServerStreamingRetries), - streamingRead: new this._gaxModule.StreamDescriptor(this._gaxModule.StreamType.SERVER_STREAMING, !!opts.fallback, !!opts.gaxServerStreamingRetries), - batchWrite: new this._gaxModule.StreamDescriptor(this._gaxModule.StreamType.SERVER_STREAMING, !!opts.fallback, !!opts.gaxServerStreamingRetries) - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.spanner.v1.Spanner', gapicConfig as gax.ClientConfig, - opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); - - // Set up a dictionary of "inner API calls"; the core implementation - // of calling the API is handled in `google-gax`, with this code - // merely providing the destination and request information. - this.innerApiCalls = {}; - - // Add a warn function to the client constructor so it can be easily tested. - this.warn = this._gaxModule.warn; - } - - /** - * Initialize the client. - * Performs asynchronous operations (such as authentication) and prepares the client. - * This function will be called automatically when any class method is called for the - * first time, but if you need to initialize it before calling an actual method, - * feel free to call initialize() directly. - * - * You can await on this method if you want to make sure the client is initialized. - * - * @returns {Promise} A promise that resolves to an authenticated service stub. - */ - initialize() { - // If the client stub promise is already initialized, return immediately. - if (this.spannerStub) { - return this.spannerStub; - } - - // Put together the "service stub" for - // google.spanner.v1.Spanner. - this.spannerStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.spanner.v1.Spanner') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.spanner.v1.Spanner, - this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; - - // Iterate over each of the methods that the service provides - // and create an API call method for each. - const spannerStubMethods = - ['createSession', 'batchCreateSessions', 'getSession', 'listSessions', 'deleteSession', 'executeSql', 'executeStreamingSql', 'executeBatchDml', 'read', 'streamingRead', 'beginTransaction', 'commit', 'rollback', 'partitionQuery', 'partitionRead', 'batchWrite']; - for (const methodName of spannerStubMethods) { - const callPromise = this.spannerStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - if (methodName in this.descriptors.stream) { - const stream = new PassThrough({objectMode: true}); - setImmediate(() => { - stream.emit('error', new this._gaxModule.GoogleError('The client has already been closed.')); - }); - return stream; - } - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, - (err: Error|null|undefined) => () => { - throw err; - }); - - const descriptor = - this.descriptors.page[methodName] || - this.descriptors.stream[methodName] || - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor, - this._opts.fallback - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.spannerStub; - } - - /** - * The DNS address for this API service. - * @deprecated Use the apiEndpoint method of the client instance. - * @returns {string} The DNS address for this service. - */ - static get servicePath() { - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); - } - return 'spanner.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath. - * @deprecated Use the apiEndpoint method of the client instance. - * @returns {string} The DNS address for this service. - */ - static get apiEndpoint() { - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); - } - return 'spanner.googleapis.com'; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - get apiEndpoint() { - return this._servicePath; - } - - get universeDomain() { - return this._universeDomain; - } - - /** - * The port for this API service. - * @returns {number} The default port for this service. - */ - static get port() { - return 443; - } - - /** - * The scopes needed to make gRPC calls for every method defined - * in this service. - * @returns {string[]} List of default scopes. - */ - static get scopes() { - return [ - 'https://www.googleapis.com/auth/cloud-platform', - 'https://www.googleapis.com/auth/spanner.data' - ]; - } - - getProjectId(): Promise; - getProjectId(callback: Callback): void; - /** - * Return the project ID used by this class. - * @returns {Promise} A promise that resolves to string containing the project ID. - */ - getProjectId(callback?: Callback): - Promise|void { - if (callback) { - this.auth.getProjectId(callback); - return; - } - return this.auth.getProjectId(); - } - - // ------------------- - // -- Service calls -- - // ------------------- -/** - * Creates a new session. A session can be used to perform - * transactions that read and/or modify data in a Cloud Spanner database. - * Sessions are meant to be reused for many consecutive - * transactions. - * - * Sessions can only execute one transaction at a time. To execute - * multiple concurrent read-write/write-only transactions, create - * multiple sessions. Note that standalone reads and queries use a - * transaction internally, and count toward the one transaction - * limit. - * - * Active sessions use additional server resources, so it's a good idea to - * delete idle and unneeded sessions. - * Aside from explicit deletes, Cloud Spanner can delete sessions when no - * operations are sent for more than an hour. If a session is deleted, - * requests to it return `NOT_FOUND`. - * - * Idle sessions can be kept alive by sending a trivial SQL query - * periodically, for example, `"SELECT 1"`. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.database - * Required. The database in which the new session is created. - * @param {google.spanner.v1.Session} request.session - * Required. The session to create. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.spanner.v1.Session|Session}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - */ - createSession( - request?: protos.google.spanner.v1.ICreateSessionRequest, - options?: CallOptions): - Promise<[ - protos.google.spanner.v1.ISession, - protos.google.spanner.v1.ICreateSessionRequest|undefined, {}|undefined - ]>; - createSession( - request: protos.google.spanner.v1.ICreateSessionRequest, - options: CallOptions, - callback: Callback< - protos.google.spanner.v1.ISession, - protos.google.spanner.v1.ICreateSessionRequest|null|undefined, - {}|null|undefined>): void; - createSession( - request: protos.google.spanner.v1.ICreateSessionRequest, - callback: Callback< - protos.google.spanner.v1.ISession, - protos.google.spanner.v1.ICreateSessionRequest|null|undefined, - {}|null|undefined>): void; - createSession( - request?: protos.google.spanner.v1.ICreateSessionRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.spanner.v1.ISession, - protos.google.spanner.v1.ICreateSessionRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.spanner.v1.ISession, - protos.google.spanner.v1.ICreateSessionRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.spanner.v1.ISession, - protos.google.spanner.v1.ICreateSessionRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'database': request.database ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('createSession request %j', request); - const wrappedCallback: Callback< - protos.google.spanner.v1.ISession, - protos.google.spanner.v1.ICreateSessionRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('createSession response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.createSession(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.spanner.v1.ISession, - protos.google.spanner.v1.ICreateSessionRequest|undefined, - {}|undefined - ]) => { - this._log.info('createSession response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Creates multiple new sessions. - * - * This API can be used to initialize a session cache on the clients. - * See https://goo.gl/TgSFN2 for best practices on session cache management. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.database - * Required. The database in which the new sessions are created. - * @param {google.spanner.v1.Session} request.sessionTemplate - * Parameters to apply to each created session. - * @param {number} request.sessionCount - * Required. The number of sessions to be created in this batch call. At least - * one session is created. The API can return fewer than the requested number - * of sessions. If a specific number of sessions are desired, the client can - * make additional calls to `BatchCreateSessions` (adjusting - * {@link protos.google.spanner.v1.BatchCreateSessionsRequest.session_count|session_count} - * as necessary). - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.spanner.v1.BatchCreateSessionsResponse|BatchCreateSessionsResponse}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - */ - batchCreateSessions( - request?: protos.google.spanner.v1.IBatchCreateSessionsRequest, - options?: CallOptions): - Promise<[ - protos.google.spanner.v1.IBatchCreateSessionsResponse, - protos.google.spanner.v1.IBatchCreateSessionsRequest|undefined, {}|undefined - ]>; - batchCreateSessions( - request: protos.google.spanner.v1.IBatchCreateSessionsRequest, - options: CallOptions, - callback: Callback< - protos.google.spanner.v1.IBatchCreateSessionsResponse, - protos.google.spanner.v1.IBatchCreateSessionsRequest|null|undefined, - {}|null|undefined>): void; - batchCreateSessions( - request: protos.google.spanner.v1.IBatchCreateSessionsRequest, - callback: Callback< - protos.google.spanner.v1.IBatchCreateSessionsResponse, - protos.google.spanner.v1.IBatchCreateSessionsRequest|null|undefined, - {}|null|undefined>): void; - batchCreateSessions( - request?: protos.google.spanner.v1.IBatchCreateSessionsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.spanner.v1.IBatchCreateSessionsResponse, - protos.google.spanner.v1.IBatchCreateSessionsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.spanner.v1.IBatchCreateSessionsResponse, - protos.google.spanner.v1.IBatchCreateSessionsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.spanner.v1.IBatchCreateSessionsResponse, - protos.google.spanner.v1.IBatchCreateSessionsRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'database': request.database ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('batchCreateSessions request %j', request); - const wrappedCallback: Callback< - protos.google.spanner.v1.IBatchCreateSessionsResponse, - protos.google.spanner.v1.IBatchCreateSessionsRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('batchCreateSessions response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.batchCreateSessions(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.spanner.v1.IBatchCreateSessionsResponse, - protos.google.spanner.v1.IBatchCreateSessionsRequest|undefined, - {}|undefined - ]) => { - this._log.info('batchCreateSessions response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Gets a session. Returns `NOT_FOUND` if the session doesn't exist. - * This is mainly useful for determining whether a session is still - * alive. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the session to retrieve. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.spanner.v1.Session|Session}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - */ - getSession( - request?: protos.google.spanner.v1.IGetSessionRequest, - options?: CallOptions): - Promise<[ - protos.google.spanner.v1.ISession, - protos.google.spanner.v1.IGetSessionRequest|undefined, {}|undefined - ]>; - getSession( - request: protos.google.spanner.v1.IGetSessionRequest, - options: CallOptions, - callback: Callback< - protos.google.spanner.v1.ISession, - protos.google.spanner.v1.IGetSessionRequest|null|undefined, - {}|null|undefined>): void; - getSession( - request: protos.google.spanner.v1.IGetSessionRequest, - callback: Callback< - protos.google.spanner.v1.ISession, - protos.google.spanner.v1.IGetSessionRequest|null|undefined, - {}|null|undefined>): void; - getSession( - request?: protos.google.spanner.v1.IGetSessionRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.spanner.v1.ISession, - protos.google.spanner.v1.IGetSessionRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.spanner.v1.ISession, - protos.google.spanner.v1.IGetSessionRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.spanner.v1.ISession, - protos.google.spanner.v1.IGetSessionRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('getSession request %j', request); - const wrappedCallback: Callback< - protos.google.spanner.v1.ISession, - protos.google.spanner.v1.IGetSessionRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getSession response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getSession(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.spanner.v1.ISession, - protos.google.spanner.v1.IGetSessionRequest|undefined, - {}|undefined - ]) => { - this._log.info('getSession response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Ends a session, releasing server resources associated with it. This - * asynchronously triggers the cancellation of any operations that are running - * with this session. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the session to delete. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - */ - deleteSession( - request?: protos.google.spanner.v1.IDeleteSessionRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.spanner.v1.IDeleteSessionRequest|undefined, {}|undefined - ]>; - deleteSession( - request: protos.google.spanner.v1.IDeleteSessionRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.spanner.v1.IDeleteSessionRequest|null|undefined, - {}|null|undefined>): void; - deleteSession( - request: protos.google.spanner.v1.IDeleteSessionRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.spanner.v1.IDeleteSessionRequest|null|undefined, - {}|null|undefined>): void; - deleteSession( - request?: protos.google.spanner.v1.IDeleteSessionRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.spanner.v1.IDeleteSessionRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.spanner.v1.IDeleteSessionRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.spanner.v1.IDeleteSessionRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('deleteSession request %j', request); - const wrappedCallback: Callback< - protos.google.protobuf.IEmpty, - protos.google.spanner.v1.IDeleteSessionRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('deleteSession response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.deleteSession(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.protobuf.IEmpty, - protos.google.spanner.v1.IDeleteSessionRequest|undefined, - {}|undefined - ]) => { - this._log.info('deleteSession response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Executes an SQL statement, returning all results in a single reply. This - * method can't be used to return a result set larger than 10 MiB; - * if the query yields more data than that, the query fails with - * a `FAILED_PRECONDITION` error. - * - * Operations inside read-write transactions might return `ABORTED`. If - * this occurs, the application should restart the transaction from - * the beginning. See {@link protos.google.spanner.v1.Transaction|Transaction} for more - * details. - * - * Larger result sets can be fetched in streaming fashion by calling - * {@link protos.google.spanner.v1.Spanner.ExecuteStreamingSql|ExecuteStreamingSql} - * instead. - * - * The query string can be SQL or [Graph Query Language - * (GQL)](https://cloud.google.com/spanner/docs/reference/standard-sql/graph-intro). - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.session - * Required. The session in which the SQL query should be performed. - * @param {google.spanner.v1.TransactionSelector} request.transaction - * The transaction to use. - * - * For queries, if none is provided, the default is a temporary read-only - * transaction with strong concurrency. - * - * Standard DML statements require a read-write transaction. To protect - * against replays, single-use transactions are not supported. The caller - * must either supply an existing transaction ID or begin a new transaction. - * - * Partitioned DML requires an existing Partitioned DML transaction ID. - * @param {string} request.sql - * Required. The SQL string. - * @param {google.protobuf.Struct} request.params - * Parameter names and values that bind to placeholders in the SQL string. - * - * A parameter placeholder consists of the `@` character followed by the - * parameter name (for example, `@firstName`). Parameter names must conform - * to the naming requirements of identifiers as specified at - * https://cloud.google.com/spanner/docs/lexical#identifiers. - * - * Parameters can appear anywhere that a literal value is expected. The same - * parameter name can be used more than once, for example: - * - * `"WHERE id > @msg_id AND id < @msg_id + 100"` - * - * It's an error to execute a SQL statement with unbound parameters. - * @param {number[]} request.paramTypes - * It isn't always possible for Cloud Spanner to infer the right SQL type - * from a JSON value. For example, values of type `BYTES` and values - * of type `STRING` both appear in - * {@link protos.google.spanner.v1.ExecuteSqlRequest.params|params} as JSON strings. - * - * In these cases, you can use `param_types` to specify the exact - * SQL type for some or all of the SQL statement parameters. See the - * definition of {@link protos.google.spanner.v1.Type|Type} for more information - * about SQL types. - * @param {Buffer} request.resumeToken - * If this request is resuming a previously interrupted SQL statement - * execution, `resume_token` should be copied from the last - * {@link protos.google.spanner.v1.PartialResultSet|PartialResultSet} yielded before the - * interruption. Doing this enables the new SQL statement execution to resume - * where the last one left off. The rest of the request parameters must - * exactly match the request that yielded this token. - * @param {google.spanner.v1.ExecuteSqlRequest.QueryMode} request.queryMode - * Used to control the amount of debugging information returned in - * {@link protos.google.spanner.v1.ResultSetStats|ResultSetStats}. If - * {@link protos.google.spanner.v1.ExecuteSqlRequest.partition_token|partition_token} is - * set, {@link protos.google.spanner.v1.ExecuteSqlRequest.query_mode|query_mode} can only - * be set to - * {@link protos.google.spanner.v1.ExecuteSqlRequest.QueryMode.NORMAL|QueryMode.NORMAL}. - * @param {Buffer} request.partitionToken - * If present, results are restricted to the specified partition - * previously created using `PartitionQuery`. There must be an exact - * match for the values of fields common to this message and the - * `PartitionQueryRequest` message used to create this `partition_token`. - * @param {number} request.seqno - * A per-transaction sequence number used to identify this request. This field - * makes each request idempotent such that if the request is received multiple - * times, at most one succeeds. - * - * The sequence number must be monotonically increasing within the - * transaction. If a request arrives for the first time with an out-of-order - * sequence number, the transaction can be aborted. Replays of previously - * handled requests yield the same response as the first execution. - * - * Required for DML statements. Ignored for queries. - * @param {google.spanner.v1.ExecuteSqlRequest.QueryOptions} request.queryOptions - * Query optimizer configuration to use for the given query. - * @param {google.spanner.v1.RequestOptions} request.requestOptions - * Common options for this request. - * @param {google.spanner.v1.DirectedReadOptions} request.directedReadOptions - * Directed read options for this request. - * @param {boolean} request.dataBoostEnabled - * If this is for a partitioned query and this field is set to `true`, the - * request is executed with Spanner Data Boost independent compute resources. - * - * If the field is set to `true` but the request doesn't set - * `partition_token`, the API returns an `INVALID_ARGUMENT` error. - * @param {boolean} [request.lastStatement] - * Optional. If set to `true`, this statement marks the end of the - * transaction. After this statement executes, you must commit or abort the - * transaction. Attempts to execute any other requests against this - * transaction (including reads and queries) are rejected. - * - * For DML statements, setting this option might cause some error reporting to - * be deferred until commit time (for example, validation of unique - * constraints). Given this, successful execution of a DML statement shouldn't - * be assumed until a subsequent `Commit` call completes successfully. - * @param {google.spanner.v1.RoutingHint} [request.routingHint] - * Optional. If present, it makes the Spanner requests location-aware. - * - * It gives the server hints that can be used to route the request - * to an appropriate server, potentially significantly decreasing latency and - * improving throughput. To achieve improved performance, most fields must be - * filled in with accurate values. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.spanner.v1.ResultSet|ResultSet}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - */ - executeSql( - request?: protos.google.spanner.v1.IExecuteSqlRequest, - options?: CallOptions): - Promise<[ - protos.google.spanner.v1.IResultSet, - protos.google.spanner.v1.IExecuteSqlRequest|undefined, {}|undefined - ]>; - executeSql( - request: protos.google.spanner.v1.IExecuteSqlRequest, - options: CallOptions, - callback: Callback< - protos.google.spanner.v1.IResultSet, - protos.google.spanner.v1.IExecuteSqlRequest|null|undefined, - {}|null|undefined>): void; - executeSql( - request: protos.google.spanner.v1.IExecuteSqlRequest, - callback: Callback< - protos.google.spanner.v1.IResultSet, - protos.google.spanner.v1.IExecuteSqlRequest|null|undefined, - {}|null|undefined>): void; - executeSql( - request?: protos.google.spanner.v1.IExecuteSqlRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.spanner.v1.IResultSet, - protos.google.spanner.v1.IExecuteSqlRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.spanner.v1.IResultSet, - protos.google.spanner.v1.IExecuteSqlRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.spanner.v1.IResultSet, - protos.google.spanner.v1.IExecuteSqlRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'session': request.session ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('executeSql request %j', request); - const wrappedCallback: Callback< - protos.google.spanner.v1.IResultSet, - protos.google.spanner.v1.IExecuteSqlRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('executeSql response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.executeSql(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.spanner.v1.IResultSet, - protos.google.spanner.v1.IExecuteSqlRequest|undefined, - {}|undefined - ]) => { - this._log.info('executeSql response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Executes a batch of SQL DML statements. This method allows many statements - * to be run with lower latency than submitting them sequentially with - * {@link protos.google.spanner.v1.Spanner.ExecuteSql|ExecuteSql}. - * - * Statements are executed in sequential order. A request can succeed even if - * a statement fails. The - * {@link protos.google.spanner.v1.ExecuteBatchDmlResponse.status|ExecuteBatchDmlResponse.status} - * field in the response provides information about the statement that failed. - * Clients must inspect this field to determine whether an error occurred. - * - * Execution stops after the first failed statement; the remaining statements - * are not executed. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.session - * Required. The session in which the DML statements should be performed. - * @param {google.spanner.v1.TransactionSelector} request.transaction - * Required. The transaction to use. Must be a read-write transaction. - * - * To protect against replays, single-use transactions are not supported. The - * caller must either supply an existing transaction ID or begin a new - * transaction. - * @param {number[]} request.statements - * Required. The list of statements to execute in this batch. Statements are - * executed serially, such that the effects of statement `i` are visible to - * statement `i+1`. Each statement must be a DML statement. Execution stops at - * the first failed statement; the remaining statements are not executed. - * - * Callers must provide at least one statement. - * @param {number} request.seqno - * Required. A per-transaction sequence number used to identify this request. - * This field makes each request idempotent such that if the request is - * received multiple times, at most one succeeds. - * - * The sequence number must be monotonically increasing within the - * transaction. If a request arrives for the first time with an out-of-order - * sequence number, the transaction might be aborted. Replays of previously - * handled requests yield the same response as the first execution. - * @param {google.spanner.v1.RequestOptions} request.requestOptions - * Common options for this request. - * @param {boolean} [request.lastStatements] - * Optional. If set to `true`, this request marks the end of the transaction. - * After these statements execute, you must commit or abort the transaction. - * Attempts to execute any other requests against this transaction - * (including reads and queries) are rejected. - * - * Setting this option might cause some error reporting to be deferred until - * commit time (for example, validation of unique constraints). Given this, - * successful execution of statements shouldn't be assumed until a subsequent - * `Commit` call completes successfully. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.spanner.v1.ExecuteBatchDmlResponse|ExecuteBatchDmlResponse}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - */ - executeBatchDml( - request?: protos.google.spanner.v1.IExecuteBatchDmlRequest, - options?: CallOptions): - Promise<[ - protos.google.spanner.v1.IExecuteBatchDmlResponse, - protos.google.spanner.v1.IExecuteBatchDmlRequest|undefined, {}|undefined - ]>; - executeBatchDml( - request: protos.google.spanner.v1.IExecuteBatchDmlRequest, - options: CallOptions, - callback: Callback< - protos.google.spanner.v1.IExecuteBatchDmlResponse, - protos.google.spanner.v1.IExecuteBatchDmlRequest|null|undefined, - {}|null|undefined>): void; - executeBatchDml( - request: protos.google.spanner.v1.IExecuteBatchDmlRequest, - callback: Callback< - protos.google.spanner.v1.IExecuteBatchDmlResponse, - protos.google.spanner.v1.IExecuteBatchDmlRequest|null|undefined, - {}|null|undefined>): void; - executeBatchDml( - request?: protos.google.spanner.v1.IExecuteBatchDmlRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.spanner.v1.IExecuteBatchDmlResponse, - protos.google.spanner.v1.IExecuteBatchDmlRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.spanner.v1.IExecuteBatchDmlResponse, - protos.google.spanner.v1.IExecuteBatchDmlRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.spanner.v1.IExecuteBatchDmlResponse, - protos.google.spanner.v1.IExecuteBatchDmlRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'session': request.session ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('executeBatchDml request %j', request); - const wrappedCallback: Callback< - protos.google.spanner.v1.IExecuteBatchDmlResponse, - protos.google.spanner.v1.IExecuteBatchDmlRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('executeBatchDml response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.executeBatchDml(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.spanner.v1.IExecuteBatchDmlResponse, - protos.google.spanner.v1.IExecuteBatchDmlRequest|undefined, - {}|undefined - ]) => { - this._log.info('executeBatchDml response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Reads rows from the database using key lookups and scans, as a - * simple key/value style alternative to - * {@link protos.google.spanner.v1.Spanner.ExecuteSql|ExecuteSql}. This method can't be - * used to return a result set larger than 10 MiB; if the read matches more - * data than that, the read fails with a `FAILED_PRECONDITION` - * error. - * - * Reads inside read-write transactions might return `ABORTED`. If - * this occurs, the application should restart the transaction from - * the beginning. See {@link protos.google.spanner.v1.Transaction|Transaction} for more - * details. - * - * Larger result sets can be yielded in streaming fashion by calling - * {@link protos.google.spanner.v1.Spanner.StreamingRead|StreamingRead} instead. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.session - * Required. The session in which the read should be performed. - * @param {google.spanner.v1.TransactionSelector} request.transaction - * The transaction to use. If none is provided, the default is a - * temporary read-only transaction with strong concurrency. - * @param {string} request.table - * Required. The name of the table in the database to be read. - * @param {string} request.index - * If non-empty, the name of an index on - * {@link protos.google.spanner.v1.ReadRequest.table|table}. This index is used instead of - * the table primary key when interpreting - * {@link protos.google.spanner.v1.ReadRequest.key_set|key_set} and sorting result rows. - * See {@link protos.google.spanner.v1.ReadRequest.key_set|key_set} for further - * information. - * @param {string[]} request.columns - * Required. The columns of {@link protos.google.spanner.v1.ReadRequest.table|table} to be - * returned for each row matching this request. - * @param {google.spanner.v1.KeySet} request.keySet - * Required. `key_set` identifies the rows to be yielded. `key_set` names the - * primary keys of the rows in {@link protos.google.spanner.v1.ReadRequest.table|table} to - * be yielded, unless {@link protos.google.spanner.v1.ReadRequest.index|index} is present. - * If {@link protos.google.spanner.v1.ReadRequest.index|index} is present, then - * {@link protos.google.spanner.v1.ReadRequest.key_set|key_set} instead names index keys - * in {@link protos.google.spanner.v1.ReadRequest.index|index}. - * - * If the {@link protos.google.spanner.v1.ReadRequest.partition_token|partition_token} - * field is empty, rows are yielded in table primary key order (if - * {@link protos.google.spanner.v1.ReadRequest.index|index} is empty) or index key order - * (if {@link protos.google.spanner.v1.ReadRequest.index|index} is non-empty). If the - * {@link protos.google.spanner.v1.ReadRequest.partition_token|partition_token} field - * isn't empty, rows are yielded in an unspecified order. - * - * It isn't an error for the `key_set` to name rows that don't - * exist in the database. Read yields nothing for nonexistent rows. - * @param {number} request.limit - * If greater than zero, only the first `limit` rows are yielded. If `limit` - * is zero, the default is no limit. A limit can't be specified if - * `partition_token` is set. - * @param {Buffer} request.resumeToken - * If this request is resuming a previously interrupted read, - * `resume_token` should be copied from the last - * {@link protos.google.spanner.v1.PartialResultSet|PartialResultSet} yielded before the - * interruption. Doing this enables the new read to resume where the last read - * left off. The rest of the request parameters must exactly match the request - * that yielded this token. - * @param {Buffer} request.partitionToken - * If present, results are restricted to the specified partition - * previously created using `PartitionRead`. There must be an exact - * match for the values of fields common to this message and the - * PartitionReadRequest message used to create this partition_token. - * @param {google.spanner.v1.RequestOptions} request.requestOptions - * Common options for this request. - * @param {google.spanner.v1.DirectedReadOptions} request.directedReadOptions - * Directed read options for this request. - * @param {boolean} request.dataBoostEnabled - * If this is for a partitioned read and this field is set to `true`, the - * request is executed with Spanner Data Boost independent compute resources. - * - * If the field is set to `true` but the request doesn't set - * `partition_token`, the API returns an `INVALID_ARGUMENT` error. - * @param {google.spanner.v1.ReadRequest.OrderBy} [request.orderBy] - * Optional. Order for the returned rows. - * - * By default, Spanner returns result rows in primary key order except for - * PartitionRead requests. For applications that don't require rows to be - * returned in primary key (`ORDER_BY_PRIMARY_KEY`) order, setting - * `ORDER_BY_NO_ORDER` option allows Spanner to optimize row retrieval, - * resulting in lower latencies in certain cases (for example, bulk point - * lookups). - * @param {google.spanner.v1.ReadRequest.LockHint} [request.lockHint] - * Optional. Lock Hint for the request, it can only be used with read-write - * transactions. - * @param {google.spanner.v1.RoutingHint} [request.routingHint] - * Optional. If present, it makes the Spanner requests location-aware. - * - * It gives the server hints that can be used to route the request - * to an appropriate server, potentially significantly decreasing latency and - * improving throughput. To achieve improved performance, most fields must be - * filled in with accurate values. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.spanner.v1.ResultSet|ResultSet}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - */ - read( - request?: protos.google.spanner.v1.IReadRequest, - options?: CallOptions): - Promise<[ - protos.google.spanner.v1.IResultSet, - protos.google.spanner.v1.IReadRequest|undefined, {}|undefined - ]>; - read( - request: protos.google.spanner.v1.IReadRequest, - options: CallOptions, - callback: Callback< - protos.google.spanner.v1.IResultSet, - protos.google.spanner.v1.IReadRequest|null|undefined, - {}|null|undefined>): void; - read( - request: protos.google.spanner.v1.IReadRequest, - callback: Callback< - protos.google.spanner.v1.IResultSet, - protos.google.spanner.v1.IReadRequest|null|undefined, - {}|null|undefined>): void; - read( - request?: protos.google.spanner.v1.IReadRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.spanner.v1.IResultSet, - protos.google.spanner.v1.IReadRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.spanner.v1.IResultSet, - protos.google.spanner.v1.IReadRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.spanner.v1.IResultSet, - protos.google.spanner.v1.IReadRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'session': request.session ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('read request %j', request); - const wrappedCallback: Callback< - protos.google.spanner.v1.IResultSet, - protos.google.spanner.v1.IReadRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('read response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.read(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.spanner.v1.IResultSet, - protos.google.spanner.v1.IReadRequest|undefined, - {}|undefined - ]) => { - this._log.info('read response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Begins a new transaction. This step can often be skipped: - * {@link protos.google.spanner.v1.Spanner.Read|Read}, - * {@link protos.google.spanner.v1.Spanner.ExecuteSql|ExecuteSql} and - * {@link protos.google.spanner.v1.Spanner.Commit|Commit} can begin a new transaction as a - * side-effect. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.session - * Required. The session in which the transaction runs. - * @param {google.spanner.v1.TransactionOptions} request.options - * Required. Options for the new transaction. - * @param {google.spanner.v1.RequestOptions} request.requestOptions - * Common options for this request. - * Priority is ignored for this request. Setting the priority in this - * `request_options` struct doesn't do anything. To set the priority for a - * transaction, set it on the reads and writes that are part of this - * transaction instead. - * @param {google.spanner.v1.Mutation} [request.mutationKey] - * Optional. Required for read-write transactions on a multiplexed session - * that commit mutations but don't perform any reads or queries. You must - * randomly select one of the mutations from the mutation set and send it as a - * part of this request. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.spanner.v1.Transaction|Transaction}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - */ - beginTransaction( - request?: protos.google.spanner.v1.IBeginTransactionRequest, - options?: CallOptions): - Promise<[ - protos.google.spanner.v1.ITransaction, - protos.google.spanner.v1.IBeginTransactionRequest|undefined, {}|undefined - ]>; - beginTransaction( - request: protos.google.spanner.v1.IBeginTransactionRequest, - options: CallOptions, - callback: Callback< - protos.google.spanner.v1.ITransaction, - protos.google.spanner.v1.IBeginTransactionRequest|null|undefined, - {}|null|undefined>): void; - beginTransaction( - request: protos.google.spanner.v1.IBeginTransactionRequest, - callback: Callback< - protos.google.spanner.v1.ITransaction, - protos.google.spanner.v1.IBeginTransactionRequest|null|undefined, - {}|null|undefined>): void; - beginTransaction( - request?: protos.google.spanner.v1.IBeginTransactionRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.spanner.v1.ITransaction, - protos.google.spanner.v1.IBeginTransactionRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.spanner.v1.ITransaction, - protos.google.spanner.v1.IBeginTransactionRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.spanner.v1.ITransaction, - protos.google.spanner.v1.IBeginTransactionRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'session': request.session ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('beginTransaction request %j', request); - const wrappedCallback: Callback< - protos.google.spanner.v1.ITransaction, - protos.google.spanner.v1.IBeginTransactionRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('beginTransaction response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.beginTransaction(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.spanner.v1.ITransaction, - protos.google.spanner.v1.IBeginTransactionRequest|undefined, - {}|undefined - ]) => { - this._log.info('beginTransaction response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Commits a transaction. The request includes the mutations to be - * applied to rows in the database. - * - * `Commit` might return an `ABORTED` error. This can occur at any time; - * commonly, the cause is conflicts with concurrent - * transactions. However, it can also happen for a variety of other - * reasons. If `Commit` returns `ABORTED`, the caller should retry - * the transaction from the beginning, reusing the same session. - * - * On very rare occasions, `Commit` might return `UNKNOWN`. This can happen, - * for example, if the client job experiences a 1+ hour networking failure. - * At that point, Cloud Spanner has lost track of the transaction outcome and - * we recommend that you perform another read from the database to see the - * state of things as they are now. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.session - * Required. The session in which the transaction to be committed is running. - * @param {Buffer} request.transactionId - * Commit a previously-started transaction. - * @param {google.spanner.v1.TransactionOptions} request.singleUseTransaction - * Execute mutations in a temporary transaction. Note that unlike - * commit of a previously-started transaction, commit with a - * temporary transaction is non-idempotent. That is, if the - * `CommitRequest` is sent to Cloud Spanner more than once (for - * instance, due to retries in the application, or in the - * transport library), it's possible that the mutations are - * executed more than once. If this is undesirable, use - * {@link protos.google.spanner.v1.Spanner.BeginTransaction|BeginTransaction} and - * {@link protos.google.spanner.v1.Spanner.Commit|Commit} instead. - * @param {number[]} request.mutations - * The mutations to be executed when this transaction commits. All - * mutations are applied atomically, in the order they appear in - * this list. - * @param {boolean} request.returnCommitStats - * If `true`, then statistics related to the transaction is included in - * the {@link protos.google.spanner.v1.CommitResponse.commit_stats|CommitResponse}. - * Default value is `false`. - * @param {google.protobuf.Duration} [request.maxCommitDelay] - * Optional. The amount of latency this request is configured to incur in - * order to improve throughput. If this field isn't set, Spanner assumes - * requests are relatively latency sensitive and automatically determines an - * appropriate delay time. You can specify a commit delay value between 0 and - * 500 ms. - * @param {google.spanner.v1.RequestOptions} request.requestOptions - * Common options for this request. - * @param {google.spanner.v1.MultiplexedSessionPrecommitToken} [request.precommitToken] - * Optional. If the read-write transaction was executed on a multiplexed - * session, then you must include the precommit token with the highest - * sequence number received in this transaction attempt. Failing to do so - * results in a `FailedPrecondition` error. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.spanner.v1.CommitResponse|CommitResponse}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - */ - commit( - request?: protos.google.spanner.v1.ICommitRequest, - options?: CallOptions): - Promise<[ - protos.google.spanner.v1.ICommitResponse, - protos.google.spanner.v1.ICommitRequest|undefined, {}|undefined - ]>; - commit( - request: protos.google.spanner.v1.ICommitRequest, - options: CallOptions, - callback: Callback< - protos.google.spanner.v1.ICommitResponse, - protos.google.spanner.v1.ICommitRequest|null|undefined, - {}|null|undefined>): void; - commit( - request: protos.google.spanner.v1.ICommitRequest, - callback: Callback< - protos.google.spanner.v1.ICommitResponse, - protos.google.spanner.v1.ICommitRequest|null|undefined, - {}|null|undefined>): void; - commit( - request?: protos.google.spanner.v1.ICommitRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.spanner.v1.ICommitResponse, - protos.google.spanner.v1.ICommitRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.spanner.v1.ICommitResponse, - protos.google.spanner.v1.ICommitRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.spanner.v1.ICommitResponse, - protos.google.spanner.v1.ICommitRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'session': request.session ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('commit request %j', request); - const wrappedCallback: Callback< - protos.google.spanner.v1.ICommitResponse, - protos.google.spanner.v1.ICommitRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('commit response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.commit(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.spanner.v1.ICommitResponse, - protos.google.spanner.v1.ICommitRequest|undefined, - {}|undefined - ]) => { - this._log.info('commit response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Rolls back a transaction, releasing any locks it holds. It's a good - * idea to call this for any transaction that includes one or more - * {@link protos.google.spanner.v1.Spanner.Read|Read} or - * {@link protos.google.spanner.v1.Spanner.ExecuteSql|ExecuteSql} requests and ultimately - * decides not to commit. - * - * `Rollback` returns `OK` if it successfully aborts the transaction, the - * transaction was already aborted, or the transaction isn't - * found. `Rollback` never returns `ABORTED`. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.session - * Required. The session in which the transaction to roll back is running. - * @param {Buffer} request.transactionId - * Required. The transaction to roll back. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - */ - rollback( - request?: protos.google.spanner.v1.IRollbackRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.spanner.v1.IRollbackRequest|undefined, {}|undefined - ]>; - rollback( - request: protos.google.spanner.v1.IRollbackRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.spanner.v1.IRollbackRequest|null|undefined, - {}|null|undefined>): void; - rollback( - request: protos.google.spanner.v1.IRollbackRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.spanner.v1.IRollbackRequest|null|undefined, - {}|null|undefined>): void; - rollback( - request?: protos.google.spanner.v1.IRollbackRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.spanner.v1.IRollbackRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.spanner.v1.IRollbackRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.spanner.v1.IRollbackRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'session': request.session ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('rollback request %j', request); - const wrappedCallback: Callback< - protos.google.protobuf.IEmpty, - protos.google.spanner.v1.IRollbackRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('rollback response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.rollback(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.protobuf.IEmpty, - protos.google.spanner.v1.IRollbackRequest|undefined, - {}|undefined - ]) => { - this._log.info('rollback response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Creates a set of partition tokens that can be used to execute a query - * operation in parallel. Each of the returned partition tokens can be used - * by {@link protos.google.spanner.v1.Spanner.ExecuteStreamingSql|ExecuteStreamingSql} to - * specify a subset of the query result to read. The same session and - * read-only transaction must be used by the `PartitionQueryRequest` used to - * create the partition tokens and the `ExecuteSqlRequests` that use the - * partition tokens. - * - * Partition tokens become invalid when the session used to create them - * is deleted, is idle for too long, begins a new transaction, or becomes too - * old. When any of these happen, it isn't possible to resume the query, and - * the whole operation must be restarted from the beginning. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.session - * Required. The session used to create the partitions. - * @param {google.spanner.v1.TransactionSelector} request.transaction - * Read-only snapshot transactions are supported, read and write and - * single-use transactions are not. - * @param {string} request.sql - * Required. The query request to generate partitions for. The request fails - * if the query isn't root partitionable. For a query to be root - * partitionable, it needs to satisfy a few conditions. For example, if the - * query execution plan contains a distributed union operator, then it must be - * the first operator in the plan. For more information about other - * conditions, see [Read data in - * parallel](https://cloud.google.com/spanner/docs/reads#read_data_in_parallel). - * - * The query request must not contain DML commands, such as `INSERT`, - * `UPDATE`, or `DELETE`. Use - * {@link protos.google.spanner.v1.Spanner.ExecuteStreamingSql|`ExecuteStreamingSql`} with - * a `PartitionedDml` transaction for large, partition-friendly DML - * operations. - * @param {google.protobuf.Struct} [request.params] - * Optional. Parameter names and values that bind to placeholders in the SQL - * string. - * - * A parameter placeholder consists of the `@` character followed by the - * parameter name (for example, `@firstName`). Parameter names can contain - * letters, numbers, and underscores. - * - * Parameters can appear anywhere that a literal value is expected. The same - * parameter name can be used more than once, for example: - * - * `"WHERE id > @msg_id AND id < @msg_id + 100"` - * - * It's an error to execute a SQL statement with unbound parameters. - * @param {number[]} [request.paramTypes] - * Optional. It isn't always possible for Cloud Spanner to infer the right SQL - * type from a JSON value. For example, values of type `BYTES` and values of - * type `STRING` both appear in - * {@link protos.google.spanner.v1.PartitionQueryRequest.params|params} as JSON strings. - * - * In these cases, `param_types` can be used to specify the exact - * SQL type for some or all of the SQL query parameters. See the - * definition of {@link protos.google.spanner.v1.Type|Type} for more information - * about SQL types. - * @param {google.spanner.v1.PartitionOptions} request.partitionOptions - * Additional options that affect how many partitions are created. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.spanner.v1.PartitionResponse|PartitionResponse}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - */ - partitionQuery( - request?: protos.google.spanner.v1.IPartitionQueryRequest, - options?: CallOptions): - Promise<[ - protos.google.spanner.v1.IPartitionResponse, - protos.google.spanner.v1.IPartitionQueryRequest|undefined, {}|undefined - ]>; - partitionQuery( - request: protos.google.spanner.v1.IPartitionQueryRequest, - options: CallOptions, - callback: Callback< - protos.google.spanner.v1.IPartitionResponse, - protos.google.spanner.v1.IPartitionQueryRequest|null|undefined, - {}|null|undefined>): void; - partitionQuery( - request: protos.google.spanner.v1.IPartitionQueryRequest, - callback: Callback< - protos.google.spanner.v1.IPartitionResponse, - protos.google.spanner.v1.IPartitionQueryRequest|null|undefined, - {}|null|undefined>): void; - partitionQuery( - request?: protos.google.spanner.v1.IPartitionQueryRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.spanner.v1.IPartitionResponse, - protos.google.spanner.v1.IPartitionQueryRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.spanner.v1.IPartitionResponse, - protos.google.spanner.v1.IPartitionQueryRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.spanner.v1.IPartitionResponse, - protos.google.spanner.v1.IPartitionQueryRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'session': request.session ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('partitionQuery request %j', request); - const wrappedCallback: Callback< - protos.google.spanner.v1.IPartitionResponse, - protos.google.spanner.v1.IPartitionQueryRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('partitionQuery response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.partitionQuery(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.spanner.v1.IPartitionResponse, - protos.google.spanner.v1.IPartitionQueryRequest|undefined, - {}|undefined - ]) => { - this._log.info('partitionQuery response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Creates a set of partition tokens that can be used to execute a read - * operation in parallel. Each of the returned partition tokens can be used - * by {@link protos.google.spanner.v1.Spanner.StreamingRead|StreamingRead} to specify a - * subset of the read result to read. The same session and read-only - * transaction must be used by the `PartitionReadRequest` used to create the - * partition tokens and the `ReadRequests` that use the partition tokens. - * There are no ordering guarantees on rows returned among the returned - * partition tokens, or even within each individual `StreamingRead` call - * issued with a `partition_token`. - * - * Partition tokens become invalid when the session used to create them - * is deleted, is idle for too long, begins a new transaction, or becomes too - * old. When any of these happen, it isn't possible to resume the read, and - * the whole operation must be restarted from the beginning. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.session - * Required. The session used to create the partitions. - * @param {google.spanner.v1.TransactionSelector} request.transaction - * Read only snapshot transactions are supported, read/write and single use - * transactions are not. - * @param {string} request.table - * Required. The name of the table in the database to be read. - * @param {string} request.index - * If non-empty, the name of an index on - * {@link protos.google.spanner.v1.PartitionReadRequest.table|table}. This index is used - * instead of the table primary key when interpreting - * {@link protos.google.spanner.v1.PartitionReadRequest.key_set|key_set} and sorting - * result rows. See {@link protos.google.spanner.v1.PartitionReadRequest.key_set|key_set} - * for further information. - * @param {string[]} request.columns - * The columns of {@link protos.google.spanner.v1.PartitionReadRequest.table|table} to be - * returned for each row matching this request. - * @param {google.spanner.v1.KeySet} request.keySet - * Required. `key_set` identifies the rows to be yielded. `key_set` names the - * primary keys of the rows in - * {@link protos.google.spanner.v1.PartitionReadRequest.table|table} to be yielded, unless - * {@link protos.google.spanner.v1.PartitionReadRequest.index|index} is present. If - * {@link protos.google.spanner.v1.PartitionReadRequest.index|index} is present, then - * {@link protos.google.spanner.v1.PartitionReadRequest.key_set|key_set} instead names - * index keys in {@link protos.google.spanner.v1.PartitionReadRequest.index|index}. - * - * It isn't an error for the `key_set` to name rows that don't - * exist in the database. Read yields nothing for nonexistent rows. - * @param {google.spanner.v1.PartitionOptions} request.partitionOptions - * Additional options that affect how many partitions are created. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.spanner.v1.PartitionResponse|PartitionResponse}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - */ - partitionRead( - request?: protos.google.spanner.v1.IPartitionReadRequest, - options?: CallOptions): - Promise<[ - protos.google.spanner.v1.IPartitionResponse, - protos.google.spanner.v1.IPartitionReadRequest|undefined, {}|undefined - ]>; - partitionRead( - request: protos.google.spanner.v1.IPartitionReadRequest, - options: CallOptions, - callback: Callback< - protos.google.spanner.v1.IPartitionResponse, - protos.google.spanner.v1.IPartitionReadRequest|null|undefined, - {}|null|undefined>): void; - partitionRead( - request: protos.google.spanner.v1.IPartitionReadRequest, - callback: Callback< - protos.google.spanner.v1.IPartitionResponse, - protos.google.spanner.v1.IPartitionReadRequest|null|undefined, - {}|null|undefined>): void; - partitionRead( - request?: protos.google.spanner.v1.IPartitionReadRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.spanner.v1.IPartitionResponse, - protos.google.spanner.v1.IPartitionReadRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.spanner.v1.IPartitionResponse, - protos.google.spanner.v1.IPartitionReadRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.spanner.v1.IPartitionResponse, - protos.google.spanner.v1.IPartitionReadRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'session': request.session ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('partitionRead request %j', request); - const wrappedCallback: Callback< - protos.google.spanner.v1.IPartitionResponse, - protos.google.spanner.v1.IPartitionReadRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('partitionRead response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.partitionRead(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.spanner.v1.IPartitionResponse, - protos.google.spanner.v1.IPartitionReadRequest|undefined, - {}|undefined - ]) => { - this._log.info('partitionRead response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } - -/** - * Like {@link protos.google.spanner.v1.Spanner.ExecuteSql|ExecuteSql}, except returns the - * result set as a stream. Unlike - * {@link protos.google.spanner.v1.Spanner.ExecuteSql|ExecuteSql}, there is no limit on - * the size of the returned result set. However, no individual row in the - * result set can exceed 100 MiB, and no column value can exceed 10 MiB. - * - * The query string can be SQL or [Graph Query Language - * (GQL)](https://cloud.google.com/spanner/docs/reference/standard-sql/graph-intro). - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.session - * Required. The session in which the SQL query should be performed. - * @param {google.spanner.v1.TransactionSelector} request.transaction - * The transaction to use. - * - * For queries, if none is provided, the default is a temporary read-only - * transaction with strong concurrency. - * - * Standard DML statements require a read-write transaction. To protect - * against replays, single-use transactions are not supported. The caller - * must either supply an existing transaction ID or begin a new transaction. - * - * Partitioned DML requires an existing Partitioned DML transaction ID. - * @param {string} request.sql - * Required. The SQL string. - * @param {google.protobuf.Struct} request.params - * Parameter names and values that bind to placeholders in the SQL string. - * - * A parameter placeholder consists of the `@` character followed by the - * parameter name (for example, `@firstName`). Parameter names must conform - * to the naming requirements of identifiers as specified at - * https://cloud.google.com/spanner/docs/lexical#identifiers. - * - * Parameters can appear anywhere that a literal value is expected. The same - * parameter name can be used more than once, for example: - * - * `"WHERE id > @msg_id AND id < @msg_id + 100"` - * - * It's an error to execute a SQL statement with unbound parameters. - * @param {number[]} request.paramTypes - * It isn't always possible for Cloud Spanner to infer the right SQL type - * from a JSON value. For example, values of type `BYTES` and values - * of type `STRING` both appear in - * {@link protos.google.spanner.v1.ExecuteSqlRequest.params|params} as JSON strings. - * - * In these cases, you can use `param_types` to specify the exact - * SQL type for some or all of the SQL statement parameters. See the - * definition of {@link protos.google.spanner.v1.Type|Type} for more information - * about SQL types. - * @param {Buffer} request.resumeToken - * If this request is resuming a previously interrupted SQL statement - * execution, `resume_token` should be copied from the last - * {@link protos.google.spanner.v1.PartialResultSet|PartialResultSet} yielded before the - * interruption. Doing this enables the new SQL statement execution to resume - * where the last one left off. The rest of the request parameters must - * exactly match the request that yielded this token. - * @param {google.spanner.v1.ExecuteSqlRequest.QueryMode} request.queryMode - * Used to control the amount of debugging information returned in - * {@link protos.google.spanner.v1.ResultSetStats|ResultSetStats}. If - * {@link protos.google.spanner.v1.ExecuteSqlRequest.partition_token|partition_token} is - * set, {@link protos.google.spanner.v1.ExecuteSqlRequest.query_mode|query_mode} can only - * be set to - * {@link protos.google.spanner.v1.ExecuteSqlRequest.QueryMode.NORMAL|QueryMode.NORMAL}. - * @param {Buffer} request.partitionToken - * If present, results are restricted to the specified partition - * previously created using `PartitionQuery`. There must be an exact - * match for the values of fields common to this message and the - * `PartitionQueryRequest` message used to create this `partition_token`. - * @param {number} request.seqno - * A per-transaction sequence number used to identify this request. This field - * makes each request idempotent such that if the request is received multiple - * times, at most one succeeds. - * - * The sequence number must be monotonically increasing within the - * transaction. If a request arrives for the first time with an out-of-order - * sequence number, the transaction can be aborted. Replays of previously - * handled requests yield the same response as the first execution. - * - * Required for DML statements. Ignored for queries. - * @param {google.spanner.v1.ExecuteSqlRequest.QueryOptions} request.queryOptions - * Query optimizer configuration to use for the given query. - * @param {google.spanner.v1.RequestOptions} request.requestOptions - * Common options for this request. - * @param {google.spanner.v1.DirectedReadOptions} request.directedReadOptions - * Directed read options for this request. - * @param {boolean} request.dataBoostEnabled - * If this is for a partitioned query and this field is set to `true`, the - * request is executed with Spanner Data Boost independent compute resources. - * - * If the field is set to `true` but the request doesn't set - * `partition_token`, the API returns an `INVALID_ARGUMENT` error. - * @param {boolean} [request.lastStatement] - * Optional. If set to `true`, this statement marks the end of the - * transaction. After this statement executes, you must commit or abort the - * transaction. Attempts to execute any other requests against this - * transaction (including reads and queries) are rejected. - * - * For DML statements, setting this option might cause some error reporting to - * be deferred until commit time (for example, validation of unique - * constraints). Given this, successful execution of a DML statement shouldn't - * be assumed until a subsequent `Commit` call completes successfully. - * @param {google.spanner.v1.RoutingHint} [request.routingHint] - * Optional. If present, it makes the Spanner requests location-aware. - * - * It gives the server hints that can be used to route the request - * to an appropriate server, potentially significantly decreasing latency and - * improving throughput. To achieve improved performance, most fields must be - * filled in with accurate values. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits {@link protos.google.spanner.v1.PartialResultSet|PartialResultSet} on 'data' event. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#server-streaming | documentation } - * for more details and examples. - */ - executeStreamingSql( - request?: protos.google.spanner.v1.IExecuteSqlRequest, - options?: CallOptions): - gax.CancellableStream{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'session': request.session ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('executeStreamingSql stream %j', options); - return this.innerApiCalls.executeStreamingSql(request, options); - } - -/** - * Like {@link protos.google.spanner.v1.Spanner.Read|Read}, except returns the result set - * as a stream. Unlike {@link protos.google.spanner.v1.Spanner.Read|Read}, there is no - * limit on the size of the returned result set. However, no individual row in - * the result set can exceed 100 MiB, and no column value can exceed - * 10 MiB. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.session - * Required. The session in which the read should be performed. - * @param {google.spanner.v1.TransactionSelector} request.transaction - * The transaction to use. If none is provided, the default is a - * temporary read-only transaction with strong concurrency. - * @param {string} request.table - * Required. The name of the table in the database to be read. - * @param {string} request.index - * If non-empty, the name of an index on - * {@link protos.google.spanner.v1.ReadRequest.table|table}. This index is used instead of - * the table primary key when interpreting - * {@link protos.google.spanner.v1.ReadRequest.key_set|key_set} and sorting result rows. - * See {@link protos.google.spanner.v1.ReadRequest.key_set|key_set} for further - * information. - * @param {string[]} request.columns - * Required. The columns of {@link protos.google.spanner.v1.ReadRequest.table|table} to be - * returned for each row matching this request. - * @param {google.spanner.v1.KeySet} request.keySet - * Required. `key_set` identifies the rows to be yielded. `key_set` names the - * primary keys of the rows in {@link protos.google.spanner.v1.ReadRequest.table|table} to - * be yielded, unless {@link protos.google.spanner.v1.ReadRequest.index|index} is present. - * If {@link protos.google.spanner.v1.ReadRequest.index|index} is present, then - * {@link protos.google.spanner.v1.ReadRequest.key_set|key_set} instead names index keys - * in {@link protos.google.spanner.v1.ReadRequest.index|index}. - * - * If the {@link protos.google.spanner.v1.ReadRequest.partition_token|partition_token} - * field is empty, rows are yielded in table primary key order (if - * {@link protos.google.spanner.v1.ReadRequest.index|index} is empty) or index key order - * (if {@link protos.google.spanner.v1.ReadRequest.index|index} is non-empty). If the - * {@link protos.google.spanner.v1.ReadRequest.partition_token|partition_token} field - * isn't empty, rows are yielded in an unspecified order. - * - * It isn't an error for the `key_set` to name rows that don't - * exist in the database. Read yields nothing for nonexistent rows. - * @param {number} request.limit - * If greater than zero, only the first `limit` rows are yielded. If `limit` - * is zero, the default is no limit. A limit can't be specified if - * `partition_token` is set. - * @param {Buffer} request.resumeToken - * If this request is resuming a previously interrupted read, - * `resume_token` should be copied from the last - * {@link protos.google.spanner.v1.PartialResultSet|PartialResultSet} yielded before the - * interruption. Doing this enables the new read to resume where the last read - * left off. The rest of the request parameters must exactly match the request - * that yielded this token. - * @param {Buffer} request.partitionToken - * If present, results are restricted to the specified partition - * previously created using `PartitionRead`. There must be an exact - * match for the values of fields common to this message and the - * PartitionReadRequest message used to create this partition_token. - * @param {google.spanner.v1.RequestOptions} request.requestOptions - * Common options for this request. - * @param {google.spanner.v1.DirectedReadOptions} request.directedReadOptions - * Directed read options for this request. - * @param {boolean} request.dataBoostEnabled - * If this is for a partitioned read and this field is set to `true`, the - * request is executed with Spanner Data Boost independent compute resources. - * - * If the field is set to `true` but the request doesn't set - * `partition_token`, the API returns an `INVALID_ARGUMENT` error. - * @param {google.spanner.v1.ReadRequest.OrderBy} [request.orderBy] - * Optional. Order for the returned rows. - * - * By default, Spanner returns result rows in primary key order except for - * PartitionRead requests. For applications that don't require rows to be - * returned in primary key (`ORDER_BY_PRIMARY_KEY`) order, setting - * `ORDER_BY_NO_ORDER` option allows Spanner to optimize row retrieval, - * resulting in lower latencies in certain cases (for example, bulk point - * lookups). - * @param {google.spanner.v1.ReadRequest.LockHint} [request.lockHint] - * Optional. Lock Hint for the request, it can only be used with read-write - * transactions. - * @param {google.spanner.v1.RoutingHint} [request.routingHint] - * Optional. If present, it makes the Spanner requests location-aware. - * - * It gives the server hints that can be used to route the request - * to an appropriate server, potentially significantly decreasing latency and - * improving throughput. To achieve improved performance, most fields must be - * filled in with accurate values. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits {@link protos.google.spanner.v1.PartialResultSet|PartialResultSet} on 'data' event. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#server-streaming | documentation } - * for more details and examples. - */ - streamingRead( - request?: protos.google.spanner.v1.IReadRequest, - options?: CallOptions): - gax.CancellableStream{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'session': request.session ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('streamingRead stream %j', options); - return this.innerApiCalls.streamingRead(request, options); - } - -/** - * Batches the supplied mutation groups in a collection of efficient - * transactions. All mutations in a group are committed atomically. However, - * mutations across groups can be committed non-atomically in an unspecified - * order and thus, they must be independent of each other. Partial failure is - * possible, that is, some groups might have been committed successfully, - * while some might have failed. The results of individual batches are - * streamed into the response as the batches are applied. - * - * `BatchWrite` requests are not replay protected, meaning that each mutation - * group can be applied more than once. Replays of non-idempotent mutations - * can have undesirable effects. For example, replays of an insert mutation - * can produce an already exists error or if you use generated or commit - * timestamp-based keys, it can result in additional rows being added to the - * mutation's table. We recommend structuring your mutation groups to be - * idempotent to avoid this issue. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.session - * Required. The session in which the batch request is to be run. - * @param {google.spanner.v1.RequestOptions} request.requestOptions - * Common options for this request. - * @param {number[]} request.mutationGroups - * Required. The groups of mutations to be applied. - * @param {boolean} [request.excludeTxnFromChangeStreams] - * Optional. If you don't set the `exclude_txn_from_change_streams` option or - * if it's set to `false`, then any change streams monitoring columns modified - * by transactions will capture the updates made within that transaction. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits {@link protos.google.spanner.v1.BatchWriteResponse|BatchWriteResponse} on 'data' event. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#server-streaming | documentation } - * for more details and examples. - */ - batchWrite( - request?: protos.google.spanner.v1.IBatchWriteRequest, - options?: CallOptions): - gax.CancellableStream{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'session': request.session ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('batchWrite stream %j', options); - return this.innerApiCalls.batchWrite(request, options); - } - - /** - * Lists all sessions in a given database. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.database - * Required. The database in which to list sessions. - * @param {number} request.pageSize - * Number of sessions to be returned in the response. If 0 or less, defaults - * to the server's maximum allowed page size. - * @param {string} request.pageToken - * If non-empty, `page_token` should contain a - * {@link protos.google.spanner.v1.ListSessionsResponse.next_page_token|next_page_token} - * from a previous - * {@link protos.google.spanner.v1.ListSessionsResponse|ListSessionsResponse}. - * @param {string} request.filter - * An expression for filtering the results of the request. Filter rules are - * case insensitive. The fields eligible for filtering are: - * - * * `labels.key` where key is the name of a label - * - * Some examples of using filters are: - * - * * `labels.env:*` --> The session has the label "env". - * * `labels.env:dev` --> The session has the label "env" and the value of - * the label contains the string "dev". - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.spanner.v1.Session|Session}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listSessionsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listSessions( - request?: protos.google.spanner.v1.IListSessionsRequest, - options?: CallOptions): - Promise<[ - protos.google.spanner.v1.ISession[], - protos.google.spanner.v1.IListSessionsRequest|null, - protos.google.spanner.v1.IListSessionsResponse - ]>; - listSessions( - request: protos.google.spanner.v1.IListSessionsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.spanner.v1.IListSessionsRequest, - protos.google.spanner.v1.IListSessionsResponse|null|undefined, - protos.google.spanner.v1.ISession>): void; - listSessions( - request: protos.google.spanner.v1.IListSessionsRequest, - callback: PaginationCallback< - protos.google.spanner.v1.IListSessionsRequest, - protos.google.spanner.v1.IListSessionsResponse|null|undefined, - protos.google.spanner.v1.ISession>): void; - listSessions( - request?: protos.google.spanner.v1.IListSessionsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.spanner.v1.IListSessionsRequest, - protos.google.spanner.v1.IListSessionsResponse|null|undefined, - protos.google.spanner.v1.ISession>, - callback?: PaginationCallback< - protos.google.spanner.v1.IListSessionsRequest, - protos.google.spanner.v1.IListSessionsResponse|null|undefined, - protos.google.spanner.v1.ISession>): - Promise<[ - protos.google.spanner.v1.ISession[], - protos.google.spanner.v1.IListSessionsRequest|null, - protos.google.spanner.v1.IListSessionsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'database': request.database ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.spanner.v1.IListSessionsRequest, - protos.google.spanner.v1.IListSessionsResponse|null|undefined, - protos.google.spanner.v1.ISession>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listSessions values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listSessions request %j', request); - return this.innerApiCalls - .listSessions(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.spanner.v1.ISession[], - protos.google.spanner.v1.IListSessionsRequest|null, - protos.google.spanner.v1.IListSessionsResponse - ]) => { - this._log.info('listSessions values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listSessions`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.database - * Required. The database in which to list sessions. - * @param {number} request.pageSize - * Number of sessions to be returned in the response. If 0 or less, defaults - * to the server's maximum allowed page size. - * @param {string} request.pageToken - * If non-empty, `page_token` should contain a - * {@link protos.google.spanner.v1.ListSessionsResponse.next_page_token|next_page_token} - * from a previous - * {@link protos.google.spanner.v1.ListSessionsResponse|ListSessionsResponse}. - * @param {string} request.filter - * An expression for filtering the results of the request. Filter rules are - * case insensitive. The fields eligible for filtering are: - * - * * `labels.key` where key is the name of a label - * - * Some examples of using filters are: - * - * * `labels.env:*` --> The session has the label "env". - * * `labels.env:dev` --> The session has the label "env" and the value of - * the label contains the string "dev". - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.spanner.v1.Session|Session} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listSessionsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listSessionsStream( - request?: protos.google.spanner.v1.IListSessionsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'database': request.database ?? '', - }); - const defaultCallSettings = this._defaults['listSessions']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listSessions stream %j', request); - return this.descriptors.page.listSessions.createStream( - this.innerApiCalls.listSessions as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listSessions`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.database - * Required. The database in which to list sessions. - * @param {number} request.pageSize - * Number of sessions to be returned in the response. If 0 or less, defaults - * to the server's maximum allowed page size. - * @param {string} request.pageToken - * If non-empty, `page_token` should contain a - * {@link protos.google.spanner.v1.ListSessionsResponse.next_page_token|next_page_token} - * from a previous - * {@link protos.google.spanner.v1.ListSessionsResponse|ListSessionsResponse}. - * @param {string} request.filter - * An expression for filtering the results of the request. Filter rules are - * case insensitive. The fields eligible for filtering are: - * - * * `labels.key` where key is the name of a label - * - * Some examples of using filters are: - * - * * `labels.env:*` --> The session has the label "env". - * * `labels.env:dev` --> The session has the label "env" and the value of - * the label contains the string "dev". - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.spanner.v1.Session|Session}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listSessionsAsync( - request?: protos.google.spanner.v1.IListSessionsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'database': request.database ?? '', - }); - const defaultCallSettings = this._defaults['listSessions']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listSessions iterate %j', request); - return this.descriptors.page.listSessions.asyncIterate( - this.innerApiCalls['listSessions'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified database resource name string. - * - * @param {string} project - * @param {string} instance - * @param {string} database - * @returns {string} Resource name string. - */ - databasePath(project:string,instance:string,database:string) { - return this.pathTemplates.databasePathTemplate.render({ - project: project, - instance: instance, - database: database, - }); - } - - /** - * Parse the project from Database resource. - * - * @param {string} databaseName - * A fully-qualified path representing Database resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDatabaseName(databaseName: string) { - return this.pathTemplates.databasePathTemplate.match(databaseName).project; - } - - /** - * Parse the instance from Database resource. - * - * @param {string} databaseName - * A fully-qualified path representing Database resource. - * @returns {string} A string representing the instance. - */ - matchInstanceFromDatabaseName(databaseName: string) { - return this.pathTemplates.databasePathTemplate.match(databaseName).instance; - } - - /** - * Parse the database from Database resource. - * - * @param {string} databaseName - * A fully-qualified path representing Database resource. - * @returns {string} A string representing the database. - */ - matchDatabaseFromDatabaseName(databaseName: string) { - return this.pathTemplates.databasePathTemplate.match(databaseName).database; - } - - /** - * Return a fully-qualified session resource name string. - * - * @param {string} project - * @param {string} instance - * @param {string} database - * @param {string} session - * @returns {string} Resource name string. - */ - sessionPath(project:string,instance:string,database:string,session:string) { - return this.pathTemplates.sessionPathTemplate.render({ - project: project, - instance: instance, - database: database, - session: session, - }); - } - - /** - * Parse the project from Session resource. - * - * @param {string} sessionName - * A fully-qualified path representing Session resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSessionName(sessionName: string) { - return this.pathTemplates.sessionPathTemplate.match(sessionName).project; - } - - /** - * Parse the instance from Session resource. - * - * @param {string} sessionName - * A fully-qualified path representing Session resource. - * @returns {string} A string representing the instance. - */ - matchInstanceFromSessionName(sessionName: string) { - return this.pathTemplates.sessionPathTemplate.match(sessionName).instance; - } - - /** - * Parse the database from Session resource. - * - * @param {string} sessionName - * A fully-qualified path representing Session resource. - * @returns {string} A string representing the database. - */ - matchDatabaseFromSessionName(sessionName: string) { - return this.pathTemplates.sessionPathTemplate.match(sessionName).database; - } - - /** - * Parse the session from Session resource. - * - * @param {string} sessionName - * A fully-qualified path representing Session resource. - * @returns {string} A string representing the session. - */ - matchSessionFromSessionName(sessionName: string) { - return this.pathTemplates.sessionPathTemplate.match(sessionName).session; - } - - /** - * Terminate the gRPC channel and close the client. - * - * The client will no longer be usable and all future behavior is undefined. - * @returns {Promise} A promise that resolves when the client is closed. - */ - close(): Promise { - if (this.spannerStub && !this._terminated) { - return this.spannerStub.then(stub => { - this._log.info('ending gRPC channel'); - this._terminated = true; - stub.close(); - }); - } - return Promise.resolve(); - } -} \ No newline at end of file diff --git a/owl-bot-staging/v1/src/v1/spanner_client_config.json b/owl-bot-staging/v1/src/v1/spanner_client_config.json deleted file mode 100644 index 3d5086946..000000000 --- a/owl-bot-staging/v1/src/v1/spanner_client_config.json +++ /dev/null @@ -1,119 +0,0 @@ -{ - "interfaces": { - "google.spanner.v1.Spanner": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ], - "resource_exhausted_unavailable": [ - "RESOURCE_EXHAUSTED", - "UNAVAILABLE" - ] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - }, - "9442ca297df43f7314712e1a19d003838e738a45": { - "initial_retry_delay_millis": 250, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 32000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "CreateSession": { - "timeout_millis": 30000, - "retry_codes_name": "resource_exhausted_unavailable", - "retry_params_name": "9442ca297df43f7314712e1a19d003838e738a45" - }, - "BatchCreateSessions": { - "timeout_millis": 60000, - "retry_codes_name": "resource_exhausted_unavailable", - "retry_params_name": "9442ca297df43f7314712e1a19d003838e738a45" - }, - "GetSession": { - "timeout_millis": 30000, - "retry_codes_name": "resource_exhausted_unavailable", - "retry_params_name": "9442ca297df43f7314712e1a19d003838e738a45" - }, - "ListSessions": { - "timeout_millis": 3600000, - "retry_codes_name": "resource_exhausted_unavailable", - "retry_params_name": "9442ca297df43f7314712e1a19d003838e738a45" - }, - "DeleteSession": { - "timeout_millis": 30000, - "retry_codes_name": "resource_exhausted_unavailable", - "retry_params_name": "9442ca297df43f7314712e1a19d003838e738a45" - }, - "ExecuteSql": { - "timeout_millis": 30000, - "retry_codes_name": "resource_exhausted_unavailable", - "retry_params_name": "9442ca297df43f7314712e1a19d003838e738a45" - }, - "ExecuteStreamingSql": { - "timeout_millis": 3600000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ExecuteBatchDml": { - "timeout_millis": 30000, - "retry_codes_name": "resource_exhausted_unavailable", - "retry_params_name": "9442ca297df43f7314712e1a19d003838e738a45" - }, - "Read": { - "timeout_millis": 30000, - "retry_codes_name": "resource_exhausted_unavailable", - "retry_params_name": "9442ca297df43f7314712e1a19d003838e738a45" - }, - "StreamingRead": { - "timeout_millis": 3600000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "BeginTransaction": { - "timeout_millis": 30000, - "retry_codes_name": "resource_exhausted_unavailable", - "retry_params_name": "9442ca297df43f7314712e1a19d003838e738a45" - }, - "Commit": { - "timeout_millis": 3600000, - "retry_codes_name": "resource_exhausted_unavailable", - "retry_params_name": "9442ca297df43f7314712e1a19d003838e738a45" - }, - "Rollback": { - "timeout_millis": 30000, - "retry_codes_name": "resource_exhausted_unavailable", - "retry_params_name": "9442ca297df43f7314712e1a19d003838e738a45" - }, - "PartitionQuery": { - "timeout_millis": 30000, - "retry_codes_name": "resource_exhausted_unavailable", - "retry_params_name": "9442ca297df43f7314712e1a19d003838e738a45" - }, - "PartitionRead": { - "timeout_millis": 30000, - "retry_codes_name": "resource_exhausted_unavailable", - "retry_params_name": "9442ca297df43f7314712e1a19d003838e738a45" - }, - "BatchWrite": { - "timeout_millis": 3600000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/v1/src/v1/spanner_proto_list.json b/owl-bot-staging/v1/src/v1/spanner_proto_list.json deleted file mode 100644 index a27ba58ca..000000000 --- a/owl-bot-staging/v1/src/v1/spanner_proto_list.json +++ /dev/null @@ -1,12 +0,0 @@ -[ - "../../protos/google/spanner/v1/change_stream.proto", - "../../protos/google/spanner/v1/commit_response.proto", - "../../protos/google/spanner/v1/keys.proto", - "../../protos/google/spanner/v1/location.proto", - "../../protos/google/spanner/v1/mutation.proto", - "../../protos/google/spanner/v1/query_plan.proto", - "../../protos/google/spanner/v1/result_set.proto", - "../../protos/google/spanner/v1/spanner.proto", - "../../protos/google/spanner/v1/transaction.proto", - "../../protos/google/spanner/v1/type.proto" -] diff --git a/owl-bot-staging/v1/test/gapic_spanner_v1.ts b/owl-bot-staging/v1/test/gapic_spanner_v1.ts deleted file mode 100644 index e308561cb..000000000 --- a/owl-bot-staging/v1/test/gapic_spanner_v1.ts +++ /dev/null @@ -1,2337 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as protos from '../protos/protos'; -import * as assert from 'assert'; -import * as sinon from 'sinon'; -import {SinonStub} from 'sinon'; -import {describe, it} from 'mocha'; -import * as spannerModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf} from 'google-gax'; - -// Dynamically loaded proto JSON is needed to get the type information -// to fill in default values for request objects -const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); - -// eslint-disable-next-line @typescript-eslint/no-unused-vars -function getTypeDefaultValue(typeName: string, fields: string[]) { - let type = root.lookupType(typeName) as protobuf.Type; - for (const field of fields.slice(0, -1)) { - type = type.fields[field]?.resolvedType as protobuf.Type; - } - return type.fields[fields[fields.length - 1]]?.defaultValue; -} - -function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message) - .toObject(instance as protobuf.Message, {defaults: true}); - return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; -} - -function stubSimpleCall(response?: ResponseType, error?: Error) { - return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); -} - -function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { - return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); -} - -function stubServerStreamingCall(response?: ResponseType, error?: Error) { - const transformStub = error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); - const mockStream = new PassThrough({ - objectMode: true, - transform: transformStub, - }); - // write something to the stream to trigger transformStub and send the response back to the client - setImmediate(() => { mockStream.write({}); }); - setImmediate(() => { mockStream.end(); }); - return sinon.stub().returns(mockStream); -} - -function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { - const pagingStub = sinon.stub(); - if (responses) { - for (let i = 0; i < responses.length; ++i) { - pagingStub.onCall(i).callsArgWith(2, null, responses[i]); - } - } - const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; - const mockStream = new PassThrough({ - objectMode: true, - transform: transformStub, - }); - // trigger as many responses as needed - if (responses) { - for (let i = 0; i < responses.length; ++i) { - setImmediate(() => { mockStream.write({}); }); - } - setImmediate(() => { mockStream.end(); }); - } else { - setImmediate(() => { mockStream.write({}); }); - setImmediate(() => { mockStream.end(); }); - } - return sinon.stub().returns(mockStream); -} - -function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { - let counter = 0; - const asyncIterable = { - [Symbol.asyncIterator]() { - return { - async next() { - if (error) { - return Promise.reject(error); - } - if (counter >= responses!.length) { - return Promise.resolve({done: true, value: undefined}); - } - return Promise.resolve({done: false, value: responses![counter++]}); - } - }; - } - }; - return sinon.stub().returns(asyncIterable); -} - -describe('v1.SpannerClient', () => { - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new spannerModule.v1.SpannerClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'spanner.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new spannerModule.v1.SpannerClient(); - const universeDomain = client.universeDomain; - assert.strictEqual(universeDomain, "googleapis.com"); - }); - - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - it('throws DeprecationWarning if static servicePath is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const servicePath = spannerModule.v1.SpannerClient.servicePath; - assert.strictEqual(servicePath, 'spanner.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - - it('throws DeprecationWarning if static apiEndpoint is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const apiEndpoint = spannerModule.v1.SpannerClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'spanner.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new spannerModule.v1.SpannerClient({universeDomain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'spanner.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new spannerModule.v1.SpannerClient({universe_domain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'spanner.example.com'); - }); - - if (typeof process === 'object' && 'env' in process) { - describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { - it('sets apiEndpoint from environment variable', () => { - const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; - const client = new spannerModule.v1.SpannerClient(); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'spanner.example.com'); - if (saved) { - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; - } else { - delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - } - }); - - it('value configured in code has priority over environment variable', () => { - const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; - const client = new spannerModule.v1.SpannerClient({universeDomain: 'configured.example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'spanner.configured.example.com'); - if (saved) { - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; - } else { - delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - } - }); - }); - } - it('does not allow setting both universeDomain and universe_domain', () => { - assert.throws(() => { new spannerModule.v1.SpannerClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); - }); - - it('has port', () => { - const port = spannerModule.v1.SpannerClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new spannerModule.v1.SpannerClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new spannerModule.v1.SpannerClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new spannerModule.v1.SpannerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.spannerStub, undefined); - await client.initialize(); - assert(client.spannerStub); - }); - - it('has close method for the initialized client', done => { - const client = new spannerModule.v1.SpannerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize().catch(err => {throw err}); - assert(client.spannerStub); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has close method for the non-initialized client', done => { - const client = new spannerModule.v1.SpannerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.spannerStub, undefined); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new spannerModule.v1.SpannerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); - const result = await client.getProjectId(); - assert.strictEqual(result, fakeProjectId); - assert((client.auth.getProjectId as SinonStub).calledWithExactly()); - }); - - it('has getProjectId method with callback', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new spannerModule.v1.SpannerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); - const promise = new Promise((resolve, reject) => { - client.getProjectId((err?: Error|null, projectId?: string|null) => { - if (err) { - reject(err); - } else { - resolve(projectId); - } - }); - }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); - }); - }); - - describe('createSession', () => { - it('invokes createSession without error', async () => { - const client = new spannerModule.v1.SpannerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.v1.CreateSessionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.v1.CreateSessionRequest', ['database']); - request.database = defaultValue1; - const expectedHeaderRequestParams = `database=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.spanner.v1.Session() - ); - client.innerApiCalls.createSession = stubSimpleCall(expectedResponse); - const [response] = await client.createSession(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createSession as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createSession as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createSession without error using callback', async () => { - const client = new spannerModule.v1.SpannerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.v1.CreateSessionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.v1.CreateSessionRequest', ['database']); - request.database = defaultValue1; - const expectedHeaderRequestParams = `database=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.spanner.v1.Session() - ); - client.innerApiCalls.createSession = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createSession( - request, - (err?: Error|null, result?: protos.google.spanner.v1.ISession|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createSession as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createSession as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createSession with error', async () => { - const client = new spannerModule.v1.SpannerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.v1.CreateSessionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.v1.CreateSessionRequest', ['database']); - request.database = defaultValue1; - const expectedHeaderRequestParams = `database=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.createSession = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createSession(request), expectedError); - const actualRequest = (client.innerApiCalls.createSession as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createSession as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createSession with closed client', async () => { - const client = new spannerModule.v1.SpannerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.v1.CreateSessionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.v1.CreateSessionRequest', ['database']); - request.database = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.createSession(request), expectedError); - }); - }); - - describe('batchCreateSessions', () => { - it('invokes batchCreateSessions without error', async () => { - const client = new spannerModule.v1.SpannerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.v1.BatchCreateSessionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.v1.BatchCreateSessionsRequest', ['database']); - request.database = defaultValue1; - const expectedHeaderRequestParams = `database=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.spanner.v1.BatchCreateSessionsResponse() - ); - client.innerApiCalls.batchCreateSessions = stubSimpleCall(expectedResponse); - const [response] = await client.batchCreateSessions(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.batchCreateSessions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchCreateSessions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes batchCreateSessions without error using callback', async () => { - const client = new spannerModule.v1.SpannerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.v1.BatchCreateSessionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.v1.BatchCreateSessionsRequest', ['database']); - request.database = defaultValue1; - const expectedHeaderRequestParams = `database=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.spanner.v1.BatchCreateSessionsResponse() - ); - client.innerApiCalls.batchCreateSessions = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.batchCreateSessions( - request, - (err?: Error|null, result?: protos.google.spanner.v1.IBatchCreateSessionsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.batchCreateSessions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchCreateSessions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes batchCreateSessions with error', async () => { - const client = new spannerModule.v1.SpannerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.v1.BatchCreateSessionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.v1.BatchCreateSessionsRequest', ['database']); - request.database = defaultValue1; - const expectedHeaderRequestParams = `database=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.batchCreateSessions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.batchCreateSessions(request), expectedError); - const actualRequest = (client.innerApiCalls.batchCreateSessions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchCreateSessions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes batchCreateSessions with closed client', async () => { - const client = new spannerModule.v1.SpannerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.v1.BatchCreateSessionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.v1.BatchCreateSessionsRequest', ['database']); - request.database = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.batchCreateSessions(request), expectedError); - }); - }); - - describe('getSession', () => { - it('invokes getSession without error', async () => { - const client = new spannerModule.v1.SpannerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.v1.GetSessionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.v1.GetSessionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.spanner.v1.Session() - ); - client.innerApiCalls.getSession = stubSimpleCall(expectedResponse); - const [response] = await client.getSession(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getSession as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getSession as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getSession without error using callback', async () => { - const client = new spannerModule.v1.SpannerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.v1.GetSessionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.v1.GetSessionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.spanner.v1.Session() - ); - client.innerApiCalls.getSession = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getSession( - request, - (err?: Error|null, result?: protos.google.spanner.v1.ISession|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getSession as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getSession as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getSession with error', async () => { - const client = new spannerModule.v1.SpannerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.v1.GetSessionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.v1.GetSessionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.getSession = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getSession(request), expectedError); - const actualRequest = (client.innerApiCalls.getSession as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getSession as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getSession with closed client', async () => { - const client = new spannerModule.v1.SpannerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.v1.GetSessionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.v1.GetSessionRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getSession(request), expectedError); - }); - }); - - describe('deleteSession', () => { - it('invokes deleteSession without error', async () => { - const client = new spannerModule.v1.SpannerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.v1.DeleteSessionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.v1.DeleteSessionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteSession = stubSimpleCall(expectedResponse); - const [response] = await client.deleteSession(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteSession as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteSession as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteSession without error using callback', async () => { - const client = new spannerModule.v1.SpannerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.v1.DeleteSessionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.v1.DeleteSessionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteSession = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteSession( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteSession as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteSession as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteSession with error', async () => { - const client = new spannerModule.v1.SpannerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.v1.DeleteSessionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.v1.DeleteSessionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteSession = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteSession(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteSession as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteSession as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteSession with closed client', async () => { - const client = new spannerModule.v1.SpannerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.v1.DeleteSessionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.v1.DeleteSessionRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.deleteSession(request), expectedError); - }); - }); - - describe('executeSql', () => { - it('invokes executeSql without error', async () => { - const client = new spannerModule.v1.SpannerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.v1.ExecuteSqlRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.v1.ExecuteSqlRequest', ['session']); - request.session = defaultValue1; - const expectedHeaderRequestParams = `session=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.spanner.v1.ResultSet() - ); - client.innerApiCalls.executeSql = stubSimpleCall(expectedResponse); - const [response] = await client.executeSql(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.executeSql as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.executeSql as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes executeSql without error using callback', async () => { - const client = new spannerModule.v1.SpannerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.v1.ExecuteSqlRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.v1.ExecuteSqlRequest', ['session']); - request.session = defaultValue1; - const expectedHeaderRequestParams = `session=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.spanner.v1.ResultSet() - ); - client.innerApiCalls.executeSql = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.executeSql( - request, - (err?: Error|null, result?: protos.google.spanner.v1.IResultSet|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.executeSql as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.executeSql as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes executeSql with error', async () => { - const client = new spannerModule.v1.SpannerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.v1.ExecuteSqlRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.v1.ExecuteSqlRequest', ['session']); - request.session = defaultValue1; - const expectedHeaderRequestParams = `session=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.executeSql = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.executeSql(request), expectedError); - const actualRequest = (client.innerApiCalls.executeSql as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.executeSql as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes executeSql with closed client', async () => { - const client = new spannerModule.v1.SpannerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.v1.ExecuteSqlRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.v1.ExecuteSqlRequest', ['session']); - request.session = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.executeSql(request), expectedError); - }); - }); - - describe('executeBatchDml', () => { - it('invokes executeBatchDml without error', async () => { - const client = new spannerModule.v1.SpannerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.v1.ExecuteBatchDmlRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.v1.ExecuteBatchDmlRequest', ['session']); - request.session = defaultValue1; - const expectedHeaderRequestParams = `session=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.spanner.v1.ExecuteBatchDmlResponse() - ); - client.innerApiCalls.executeBatchDml = stubSimpleCall(expectedResponse); - const [response] = await client.executeBatchDml(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.executeBatchDml as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.executeBatchDml as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes executeBatchDml without error using callback', async () => { - const client = new spannerModule.v1.SpannerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.v1.ExecuteBatchDmlRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.v1.ExecuteBatchDmlRequest', ['session']); - request.session = defaultValue1; - const expectedHeaderRequestParams = `session=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.spanner.v1.ExecuteBatchDmlResponse() - ); - client.innerApiCalls.executeBatchDml = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.executeBatchDml( - request, - (err?: Error|null, result?: protos.google.spanner.v1.IExecuteBatchDmlResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.executeBatchDml as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.executeBatchDml as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes executeBatchDml with error', async () => { - const client = new spannerModule.v1.SpannerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.v1.ExecuteBatchDmlRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.v1.ExecuteBatchDmlRequest', ['session']); - request.session = defaultValue1; - const expectedHeaderRequestParams = `session=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.executeBatchDml = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.executeBatchDml(request), expectedError); - const actualRequest = (client.innerApiCalls.executeBatchDml as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.executeBatchDml as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes executeBatchDml with closed client', async () => { - const client = new spannerModule.v1.SpannerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.v1.ExecuteBatchDmlRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.v1.ExecuteBatchDmlRequest', ['session']); - request.session = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.executeBatchDml(request), expectedError); - }); - }); - - describe('read', () => { - it('invokes read without error', async () => { - const client = new spannerModule.v1.SpannerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.v1.ReadRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.v1.ReadRequest', ['session']); - request.session = defaultValue1; - const expectedHeaderRequestParams = `session=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.spanner.v1.ResultSet() - ); - client.innerApiCalls.read = stubSimpleCall(expectedResponse); - const [response] = await client.read(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.read as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.read as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes read without error using callback', async () => { - const client = new spannerModule.v1.SpannerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.v1.ReadRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.v1.ReadRequest', ['session']); - request.session = defaultValue1; - const expectedHeaderRequestParams = `session=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.spanner.v1.ResultSet() - ); - client.innerApiCalls.read = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.read( - request, - (err?: Error|null, result?: protos.google.spanner.v1.IResultSet|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.read as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.read as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes read with error', async () => { - const client = new spannerModule.v1.SpannerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.v1.ReadRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.v1.ReadRequest', ['session']); - request.session = defaultValue1; - const expectedHeaderRequestParams = `session=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.read = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.read(request), expectedError); - const actualRequest = (client.innerApiCalls.read as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.read as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes read with closed client', async () => { - const client = new spannerModule.v1.SpannerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.v1.ReadRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.v1.ReadRequest', ['session']); - request.session = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.read(request), expectedError); - }); - }); - - describe('beginTransaction', () => { - it('invokes beginTransaction without error', async () => { - const client = new spannerModule.v1.SpannerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.v1.BeginTransactionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.v1.BeginTransactionRequest', ['session']); - request.session = defaultValue1; - const expectedHeaderRequestParams = `session=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.spanner.v1.Transaction() - ); - client.innerApiCalls.beginTransaction = stubSimpleCall(expectedResponse); - const [response] = await client.beginTransaction(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.beginTransaction as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.beginTransaction as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes beginTransaction without error using callback', async () => { - const client = new spannerModule.v1.SpannerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.v1.BeginTransactionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.v1.BeginTransactionRequest', ['session']); - request.session = defaultValue1; - const expectedHeaderRequestParams = `session=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.spanner.v1.Transaction() - ); - client.innerApiCalls.beginTransaction = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.beginTransaction( - request, - (err?: Error|null, result?: protos.google.spanner.v1.ITransaction|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.beginTransaction as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.beginTransaction as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes beginTransaction with error', async () => { - const client = new spannerModule.v1.SpannerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.v1.BeginTransactionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.v1.BeginTransactionRequest', ['session']); - request.session = defaultValue1; - const expectedHeaderRequestParams = `session=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.beginTransaction = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.beginTransaction(request), expectedError); - const actualRequest = (client.innerApiCalls.beginTransaction as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.beginTransaction as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes beginTransaction with closed client', async () => { - const client = new spannerModule.v1.SpannerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.v1.BeginTransactionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.v1.BeginTransactionRequest', ['session']); - request.session = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.beginTransaction(request), expectedError); - }); - }); - - describe('commit', () => { - it('invokes commit without error', async () => { - const client = new spannerModule.v1.SpannerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.v1.CommitRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.v1.CommitRequest', ['session']); - request.session = defaultValue1; - const expectedHeaderRequestParams = `session=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.spanner.v1.CommitResponse() - ); - client.innerApiCalls.commit = stubSimpleCall(expectedResponse); - const [response] = await client.commit(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.commit as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.commit as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes commit without error using callback', async () => { - const client = new spannerModule.v1.SpannerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.v1.CommitRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.v1.CommitRequest', ['session']); - request.session = defaultValue1; - const expectedHeaderRequestParams = `session=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.spanner.v1.CommitResponse() - ); - client.innerApiCalls.commit = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.commit( - request, - (err?: Error|null, result?: protos.google.spanner.v1.ICommitResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.commit as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.commit as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes commit with error', async () => { - const client = new spannerModule.v1.SpannerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.v1.CommitRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.v1.CommitRequest', ['session']); - request.session = defaultValue1; - const expectedHeaderRequestParams = `session=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.commit = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.commit(request), expectedError); - const actualRequest = (client.innerApiCalls.commit as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.commit as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes commit with closed client', async () => { - const client = new spannerModule.v1.SpannerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.v1.CommitRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.v1.CommitRequest', ['session']); - request.session = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.commit(request), expectedError); - }); - }); - - describe('rollback', () => { - it('invokes rollback without error', async () => { - const client = new spannerModule.v1.SpannerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.v1.RollbackRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.v1.RollbackRequest', ['session']); - request.session = defaultValue1; - const expectedHeaderRequestParams = `session=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.rollback = stubSimpleCall(expectedResponse); - const [response] = await client.rollback(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.rollback as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.rollback as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes rollback without error using callback', async () => { - const client = new spannerModule.v1.SpannerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.v1.RollbackRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.v1.RollbackRequest', ['session']); - request.session = defaultValue1; - const expectedHeaderRequestParams = `session=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.rollback = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.rollback( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.rollback as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.rollback as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes rollback with error', async () => { - const client = new spannerModule.v1.SpannerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.v1.RollbackRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.v1.RollbackRequest', ['session']); - request.session = defaultValue1; - const expectedHeaderRequestParams = `session=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.rollback = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.rollback(request), expectedError); - const actualRequest = (client.innerApiCalls.rollback as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.rollback as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes rollback with closed client', async () => { - const client = new spannerModule.v1.SpannerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.v1.RollbackRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.v1.RollbackRequest', ['session']); - request.session = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.rollback(request), expectedError); - }); - }); - - describe('partitionQuery', () => { - it('invokes partitionQuery without error', async () => { - const client = new spannerModule.v1.SpannerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.v1.PartitionQueryRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.v1.PartitionQueryRequest', ['session']); - request.session = defaultValue1; - const expectedHeaderRequestParams = `session=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.spanner.v1.PartitionResponse() - ); - client.innerApiCalls.partitionQuery = stubSimpleCall(expectedResponse); - const [response] = await client.partitionQuery(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.partitionQuery as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.partitionQuery as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes partitionQuery without error using callback', async () => { - const client = new spannerModule.v1.SpannerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.v1.PartitionQueryRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.v1.PartitionQueryRequest', ['session']); - request.session = defaultValue1; - const expectedHeaderRequestParams = `session=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.spanner.v1.PartitionResponse() - ); - client.innerApiCalls.partitionQuery = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.partitionQuery( - request, - (err?: Error|null, result?: protos.google.spanner.v1.IPartitionResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.partitionQuery as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.partitionQuery as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes partitionQuery with error', async () => { - const client = new spannerModule.v1.SpannerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.v1.PartitionQueryRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.v1.PartitionQueryRequest', ['session']); - request.session = defaultValue1; - const expectedHeaderRequestParams = `session=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.partitionQuery = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.partitionQuery(request), expectedError); - const actualRequest = (client.innerApiCalls.partitionQuery as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.partitionQuery as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes partitionQuery with closed client', async () => { - const client = new spannerModule.v1.SpannerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.v1.PartitionQueryRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.v1.PartitionQueryRequest', ['session']); - request.session = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.partitionQuery(request), expectedError); - }); - }); - - describe('partitionRead', () => { - it('invokes partitionRead without error', async () => { - const client = new spannerModule.v1.SpannerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.v1.PartitionReadRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.v1.PartitionReadRequest', ['session']); - request.session = defaultValue1; - const expectedHeaderRequestParams = `session=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.spanner.v1.PartitionResponse() - ); - client.innerApiCalls.partitionRead = stubSimpleCall(expectedResponse); - const [response] = await client.partitionRead(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.partitionRead as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.partitionRead as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes partitionRead without error using callback', async () => { - const client = new spannerModule.v1.SpannerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.v1.PartitionReadRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.v1.PartitionReadRequest', ['session']); - request.session = defaultValue1; - const expectedHeaderRequestParams = `session=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.spanner.v1.PartitionResponse() - ); - client.innerApiCalls.partitionRead = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.partitionRead( - request, - (err?: Error|null, result?: protos.google.spanner.v1.IPartitionResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.partitionRead as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.partitionRead as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes partitionRead with error', async () => { - const client = new spannerModule.v1.SpannerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.v1.PartitionReadRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.v1.PartitionReadRequest', ['session']); - request.session = defaultValue1; - const expectedHeaderRequestParams = `session=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.partitionRead = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.partitionRead(request), expectedError); - const actualRequest = (client.innerApiCalls.partitionRead as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.partitionRead as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes partitionRead with closed client', async () => { - const client = new spannerModule.v1.SpannerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.v1.PartitionReadRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.v1.PartitionReadRequest', ['session']); - request.session = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.partitionRead(request), expectedError); - }); - }); - - describe('executeStreamingSql', () => { - it('invokes executeStreamingSql without error', async () => { - const client = new spannerModule.v1.SpannerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.v1.ExecuteSqlRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.v1.ExecuteSqlRequest', ['session']); - request.session = defaultValue1; - const expectedHeaderRequestParams = `session=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.spanner.v1.PartialResultSet() - ); - client.innerApiCalls.executeStreamingSql = stubServerStreamingCall(expectedResponse); - const stream = client.executeStreamingSql(request); - const promise = new Promise((resolve, reject) => { - stream.on('data', (response: protos.google.spanner.v1.PartialResultSet) => { - resolve(response); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.executeStreamingSql as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.executeStreamingSql as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes executeStreamingSql without error and gaxServerStreamingRetries enabled', async () => { - const client = new spannerModule.v1.SpannerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - gaxServerStreamingRetries: true - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.v1.ExecuteSqlRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.v1.ExecuteSqlRequest', ['session']); - request.session = defaultValue1; - const expectedHeaderRequestParams = `session=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.spanner.v1.PartialResultSet() - ); - client.innerApiCalls.executeStreamingSql = stubServerStreamingCall(expectedResponse); - const stream = client.executeStreamingSql(request); - const promise = new Promise((resolve, reject) => { - stream.on('data', (response: protos.google.spanner.v1.PartialResultSet) => { - resolve(response); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.executeStreamingSql as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.executeStreamingSql as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes executeStreamingSql with error', async () => { - const client = new spannerModule.v1.SpannerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.v1.ExecuteSqlRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.v1.ExecuteSqlRequest', ['session']); - request.session = defaultValue1; - const expectedHeaderRequestParams = `session=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.executeStreamingSql = stubServerStreamingCall(undefined, expectedError); - const stream = client.executeStreamingSql(request); - const promise = new Promise((resolve, reject) => { - stream.on('data', (response: protos.google.spanner.v1.PartialResultSet) => { - resolve(response); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - const actualRequest = (client.innerApiCalls.executeStreamingSql as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.executeStreamingSql as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes executeStreamingSql with closed client', async () => { - const client = new spannerModule.v1.SpannerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.v1.ExecuteSqlRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.v1.ExecuteSqlRequest', ['session']); - request.session = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - const stream = client.executeStreamingSql(request, {retryRequestOptions: {noResponseRetries: 0}}); - const promise = new Promise((resolve, reject) => { - stream.on('data', (response: protos.google.spanner.v1.PartialResultSet) => { - resolve(response); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - }); - it('should create a client with gaxServerStreamingRetries enabled', () => { - const client = new spannerModule.v1.SpannerClient({ - gaxServerStreamingRetries: true, - }); - assert(client); - }); - }); - - describe('streamingRead', () => { - it('invokes streamingRead without error', async () => { - const client = new spannerModule.v1.SpannerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.v1.ReadRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.v1.ReadRequest', ['session']); - request.session = defaultValue1; - const expectedHeaderRequestParams = `session=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.spanner.v1.PartialResultSet() - ); - client.innerApiCalls.streamingRead = stubServerStreamingCall(expectedResponse); - const stream = client.streamingRead(request); - const promise = new Promise((resolve, reject) => { - stream.on('data', (response: protos.google.spanner.v1.PartialResultSet) => { - resolve(response); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.streamingRead as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.streamingRead as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes streamingRead without error and gaxServerStreamingRetries enabled', async () => { - const client = new spannerModule.v1.SpannerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - gaxServerStreamingRetries: true - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.v1.ReadRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.v1.ReadRequest', ['session']); - request.session = defaultValue1; - const expectedHeaderRequestParams = `session=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.spanner.v1.PartialResultSet() - ); - client.innerApiCalls.streamingRead = stubServerStreamingCall(expectedResponse); - const stream = client.streamingRead(request); - const promise = new Promise((resolve, reject) => { - stream.on('data', (response: protos.google.spanner.v1.PartialResultSet) => { - resolve(response); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.streamingRead as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.streamingRead as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes streamingRead with error', async () => { - const client = new spannerModule.v1.SpannerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.v1.ReadRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.v1.ReadRequest', ['session']); - request.session = defaultValue1; - const expectedHeaderRequestParams = `session=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.streamingRead = stubServerStreamingCall(undefined, expectedError); - const stream = client.streamingRead(request); - const promise = new Promise((resolve, reject) => { - stream.on('data', (response: protos.google.spanner.v1.PartialResultSet) => { - resolve(response); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - const actualRequest = (client.innerApiCalls.streamingRead as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.streamingRead as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes streamingRead with closed client', async () => { - const client = new spannerModule.v1.SpannerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.v1.ReadRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.v1.ReadRequest', ['session']); - request.session = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - const stream = client.streamingRead(request, {retryRequestOptions: {noResponseRetries: 0}}); - const promise = new Promise((resolve, reject) => { - stream.on('data', (response: protos.google.spanner.v1.PartialResultSet) => { - resolve(response); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - }); - it('should create a client with gaxServerStreamingRetries enabled', () => { - const client = new spannerModule.v1.SpannerClient({ - gaxServerStreamingRetries: true, - }); - assert(client); - }); - }); - - describe('batchWrite', () => { - it('invokes batchWrite without error', async () => { - const client = new spannerModule.v1.SpannerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.v1.BatchWriteRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.v1.BatchWriteRequest', ['session']); - request.session = defaultValue1; - const expectedHeaderRequestParams = `session=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.spanner.v1.BatchWriteResponse() - ); - client.innerApiCalls.batchWrite = stubServerStreamingCall(expectedResponse); - const stream = client.batchWrite(request); - const promise = new Promise((resolve, reject) => { - stream.on('data', (response: protos.google.spanner.v1.BatchWriteResponse) => { - resolve(response); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.batchWrite as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchWrite as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes batchWrite without error and gaxServerStreamingRetries enabled', async () => { - const client = new spannerModule.v1.SpannerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - gaxServerStreamingRetries: true - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.v1.BatchWriteRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.v1.BatchWriteRequest', ['session']); - request.session = defaultValue1; - const expectedHeaderRequestParams = `session=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.spanner.v1.BatchWriteResponse() - ); - client.innerApiCalls.batchWrite = stubServerStreamingCall(expectedResponse); - const stream = client.batchWrite(request); - const promise = new Promise((resolve, reject) => { - stream.on('data', (response: protos.google.spanner.v1.BatchWriteResponse) => { - resolve(response); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.batchWrite as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchWrite as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes batchWrite with error', async () => { - const client = new spannerModule.v1.SpannerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.v1.BatchWriteRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.v1.BatchWriteRequest', ['session']); - request.session = defaultValue1; - const expectedHeaderRequestParams = `session=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.batchWrite = stubServerStreamingCall(undefined, expectedError); - const stream = client.batchWrite(request); - const promise = new Promise((resolve, reject) => { - stream.on('data', (response: protos.google.spanner.v1.BatchWriteResponse) => { - resolve(response); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - const actualRequest = (client.innerApiCalls.batchWrite as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchWrite as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes batchWrite with closed client', async () => { - const client = new spannerModule.v1.SpannerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.v1.BatchWriteRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.v1.BatchWriteRequest', ['session']); - request.session = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - const stream = client.batchWrite(request, {retryRequestOptions: {noResponseRetries: 0}}); - const promise = new Promise((resolve, reject) => { - stream.on('data', (response: protos.google.spanner.v1.BatchWriteResponse) => { - resolve(response); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - }); - it('should create a client with gaxServerStreamingRetries enabled', () => { - const client = new spannerModule.v1.SpannerClient({ - gaxServerStreamingRetries: true, - }); - assert(client); - }); - }); - - describe('listSessions', () => { - it('invokes listSessions without error', async () => { - const client = new spannerModule.v1.SpannerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.v1.ListSessionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.v1.ListSessionsRequest', ['database']); - request.database = defaultValue1; - const expectedHeaderRequestParams = `database=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.spanner.v1.Session()), - generateSampleMessage(new protos.google.spanner.v1.Session()), - generateSampleMessage(new protos.google.spanner.v1.Session()), - ]; - client.innerApiCalls.listSessions = stubSimpleCall(expectedResponse); - const [response] = await client.listSessions(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listSessions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listSessions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listSessions without error using callback', async () => { - const client = new spannerModule.v1.SpannerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.v1.ListSessionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.v1.ListSessionsRequest', ['database']); - request.database = defaultValue1; - const expectedHeaderRequestParams = `database=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.spanner.v1.Session()), - generateSampleMessage(new protos.google.spanner.v1.Session()), - generateSampleMessage(new protos.google.spanner.v1.Session()), - ]; - client.innerApiCalls.listSessions = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listSessions( - request, - (err?: Error|null, result?: protos.google.spanner.v1.ISession[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listSessions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listSessions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listSessions with error', async () => { - const client = new spannerModule.v1.SpannerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.v1.ListSessionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.v1.ListSessionsRequest', ['database']); - request.database = defaultValue1; - const expectedHeaderRequestParams = `database=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.listSessions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listSessions(request), expectedError); - const actualRequest = (client.innerApiCalls.listSessions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listSessions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listSessionsStream without error', async () => { - const client = new spannerModule.v1.SpannerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.v1.ListSessionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.v1.ListSessionsRequest', ['database']); - request.database = defaultValue1; - const expectedHeaderRequestParams = `database=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.spanner.v1.Session()), - generateSampleMessage(new protos.google.spanner.v1.Session()), - generateSampleMessage(new protos.google.spanner.v1.Session()), - ]; - client.descriptors.page.listSessions.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listSessionsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.spanner.v1.Session[] = []; - stream.on('data', (response: protos.google.spanner.v1.Session) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listSessions.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listSessions, request)); - assert( - (client.descriptors.page.listSessions.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listSessionsStream with error', async () => { - const client = new spannerModule.v1.SpannerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.v1.ListSessionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.v1.ListSessionsRequest', ['database']); - request.database = defaultValue1; - const expectedHeaderRequestParams = `database=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listSessions.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listSessionsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.spanner.v1.Session[] = []; - stream.on('data', (response: protos.google.spanner.v1.Session) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listSessions.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listSessions, request)); - assert( - (client.descriptors.page.listSessions.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listSessions without error', async () => { - const client = new spannerModule.v1.SpannerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.v1.ListSessionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.v1.ListSessionsRequest', ['database']); - request.database = defaultValue1; - const expectedHeaderRequestParams = `database=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.spanner.v1.Session()), - generateSampleMessage(new protos.google.spanner.v1.Session()), - generateSampleMessage(new protos.google.spanner.v1.Session()), - ]; - client.descriptors.page.listSessions.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.spanner.v1.ISession[] = []; - const iterable = client.listSessionsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listSessions.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listSessions.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listSessions with error', async () => { - const client = new spannerModule.v1.SpannerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.spanner.v1.ListSessionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.spanner.v1.ListSessionsRequest', ['database']); - request.database = defaultValue1; - const expectedHeaderRequestParams = `database=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listSessions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listSessionsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.spanner.v1.ISession[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listSessions.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listSessions.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('Path templates', () => { - - describe('database', async () => { - const fakePath = "/rendered/path/database"; - const expectedParameters = { - project: "projectValue", - instance: "instanceValue", - database: "databaseValue", - }; - const client = new spannerModule.v1.SpannerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.databasePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.databasePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('databasePath', () => { - const result = client.databasePath("projectValue", "instanceValue", "databaseValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.databasePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDatabaseName', () => { - const result = client.matchProjectFromDatabaseName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.databasePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchInstanceFromDatabaseName', () => { - const result = client.matchInstanceFromDatabaseName(fakePath); - assert.strictEqual(result, "instanceValue"); - assert((client.pathTemplates.databasePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatabaseFromDatabaseName', () => { - const result = client.matchDatabaseFromDatabaseName(fakePath); - assert.strictEqual(result, "databaseValue"); - assert((client.pathTemplates.databasePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('session', async () => { - const fakePath = "/rendered/path/session"; - const expectedParameters = { - project: "projectValue", - instance: "instanceValue", - database: "databaseValue", - session: "sessionValue", - }; - const client = new spannerModule.v1.SpannerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.sessionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.sessionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('sessionPath', () => { - const result = client.sessionPath("projectValue", "instanceValue", "databaseValue", "sessionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.sessionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSessionName', () => { - const result = client.matchProjectFromSessionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.sessionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchInstanceFromSessionName', () => { - const result = client.matchInstanceFromSessionName(fakePath); - assert.strictEqual(result, "instanceValue"); - assert((client.pathTemplates.sessionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatabaseFromSessionName', () => { - const result = client.matchDatabaseFromSessionName(fakePath); - assert.strictEqual(result, "databaseValue"); - assert((client.pathTemplates.sessionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSessionFromSessionName', () => { - const result = client.matchSessionFromSessionName(fakePath); - assert.strictEqual(result, "sessionValue"); - assert((client.pathTemplates.sessionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/v1/tsconfig.json b/owl-bot-staging/v1/tsconfig.json deleted file mode 100644 index ca73e7bfc..000000000 --- a/owl-bot-staging/v1/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "extends": "./node_modules/gts/tsconfig-google.json", - "compilerOptions": { - "rootDir": ".", - "outDir": "build", - "resolveJsonModule": true, - "lib": [ - "es2023", - "dom" - ] - }, - "include": [ - "src/*.ts", - "src/**/*.ts", - "test/*.ts", - "test/**/*.ts", - "system-test/*.ts", - "src/**/*.json", - "samples/**/*.json", - "protos/protos.json" - ] -} diff --git a/owl-bot-staging/v1/webpack.config.js b/owl-bot-staging/v1/webpack.config.js deleted file mode 100644 index ee59a7326..000000000 --- a/owl-bot-staging/v1/webpack.config.js +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -const path = require('path'); - -module.exports = { - entry: './src/index.ts', - output: { - library: 'spanner', - filename: './spanner.js', - }, - node: { - child_process: 'empty', - fs: 'empty', - crypto: 'empty', - }, - resolve: { - alias: { - '../../../package.json': path.resolve(__dirname, 'package.json'), - }, - extensions: ['.js', '.json', '.ts'], - }, - module: { - rules: [ - { - test: /\.tsx?$/, - use: 'ts-loader', - exclude: /node_modules/ - }, - { - test: /node_modules[\\/]@grpc[\\/]grpc-js/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]grpc/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]retry-request/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]https?-proxy-agent/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]gtoken/, - use: 'null-loader' - }, - ], - }, - mode: 'production', -}; diff --git a/protos/google/spanner/v1/change_stream.proto b/protos/google/spanner/v1/change_stream.proto index 53c71078d..e7d12e608 100644 --- a/protos/google/spanner/v1/change_stream.proto +++ b/protos/google/spanner/v1/change_stream.proto @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/protos/google/spanner/v1/commit_response.proto b/protos/google/spanner/v1/commit_response.proto index b29663501..6e4459122 100644 --- a/protos/google/spanner/v1/commit_response.proto +++ b/protos/google/spanner/v1/commit_response.proto @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/protos/google/spanner/v1/keys.proto b/protos/google/spanner/v1/keys.proto index bce2a07b0..5e30e831e 100644 --- a/protos/google/spanner/v1/keys.proto +++ b/protos/google/spanner/v1/keys.proto @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/protos/google/spanner/v1/location.proto b/protos/google/spanner/v1/location.proto index a3b27aa4b..870dc0ec0 100644 --- a/protos/google/spanner/v1/location.proto +++ b/protos/google/spanner/v1/location.proto @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/protos/google/spanner/v1/mutation.proto b/protos/google/spanner/v1/mutation.proto index 99641cea9..7e3306a20 100644 --- a/protos/google/spanner/v1/mutation.proto +++ b/protos/google/spanner/v1/mutation.proto @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/protos/google/spanner/v1/query_plan.proto b/protos/google/spanner/v1/query_plan.proto index 8e8e587b0..5850ff97f 100644 --- a/protos/google/spanner/v1/query_plan.proto +++ b/protos/google/spanner/v1/query_plan.proto @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/protos/google/spanner/v1/result_set.proto b/protos/google/spanner/v1/result_set.proto index 4d446709b..3851d688c 100644 --- a/protos/google/spanner/v1/result_set.proto +++ b/protos/google/spanner/v1/result_set.proto @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -61,6 +61,14 @@ message ResultSet { // [Commit][google.spanner.v1.Spanner.Commit] request for this transaction. MultiplexedSessionPrecommitToken precommit_token = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A cache update expresses a set of changes the client should + // incorporate into its location cache. The client should discard the changes + // if they are older than the data it already has. This data can be obtained + // in response to requests that included a `RoutingHint` field, but may also + // be obtained by explicit location-fetching RPCs which may be added in the + // future. + CacheUpdate cache_update = 6 [(google.api.field_behavior) = OPTIONAL]; } // Partial results from a streaming read or SQL query. Streaming reads and diff --git a/protos/google/spanner/v1/spanner.proto b/protos/google/spanner/v1/spanner.proto index 91456ebb5..525cc2ba4 100644 --- a/protos/google/spanner/v1/spanner.proto +++ b/protos/google/spanner/v1/spanner.proto @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -544,8 +544,9 @@ message RequestOptions { // A tag used for statistics collection about this transaction. // Both `request_tag` and `transaction_tag` can be specified for a read or // query that belongs to a transaction. - // The value of transaction_tag should be the same for all requests belonging - // to the same transaction. + // To enable tagging on a transaction, `transaction_tag` must be set to the + // same value for all requests belonging to the same transaction, including + // [BeginTransaction][google.spanner.v1.Spanner.BeginTransaction]. // If this request doesn't belong to any transaction, `transaction_tag` is // ignored. // Legal characters for `transaction_tag` values are all printable characters @@ -1018,7 +1019,8 @@ message PartitionQueryRequest { // operations. string sql = 3 [(google.api.field_behavior) = REQUIRED]; - // Parameter names and values that bind to placeholders in the SQL string. + // Optional. Parameter names and values that bind to placeholders in the SQL + // string. // // A parameter placeholder consists of the `@` character followed by the // parameter name (for example, `@firstName`). Parameter names can contain @@ -1030,18 +1032,18 @@ message PartitionQueryRequest { // `"WHERE id > @msg_id AND id < @msg_id + 100"` // // It's an error to execute a SQL statement with unbound parameters. - google.protobuf.Struct params = 4; + google.protobuf.Struct params = 4 [(google.api.field_behavior) = OPTIONAL]; - // It isn't always possible for Cloud Spanner to infer the right SQL type - // from a JSON value. For example, values of type `BYTES` and values - // of type `STRING` both appear in + // Optional. It isn't always possible for Cloud Spanner to infer the right SQL + // type from a JSON value. For example, values of type `BYTES` and values of + // type `STRING` both appear in // [params][google.spanner.v1.PartitionQueryRequest.params] as JSON strings. // // In these cases, `param_types` can be used to specify the exact // SQL type for some or all of the SQL query parameters. See the // definition of [Type][google.spanner.v1.Type] for more information // about SQL types. - map param_types = 5; + map param_types = 5 [(google.api.field_behavior) = OPTIONAL]; // Additional options that affect how many partitions are created. PartitionOptions partition_options = 6; @@ -1407,6 +1409,11 @@ message BatchWriteResponse { google.rpc.Status status = 2; // The commit timestamp of the transaction that applied this batch. - // Present if `status` is `OK`, absent otherwise. + // Present if status is OK and the mutation groups were applied, absent + // otherwise. + // + // For mutation groups with conditions, a status=OK and missing + // commit_timestamp means that the mutation groups were not applied due to the + // condition not being satisfied after evaluation. google.protobuf.Timestamp commit_timestamp = 3; } diff --git a/protos/google/spanner/v1/transaction.proto b/protos/google/spanner/v1/transaction.proto index 4d2a54202..dfdf3b11a 100644 --- a/protos/google/spanner/v1/transaction.proto +++ b/protos/google/spanner/v1/transaction.proto @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/protos/google/spanner/v1/type.proto b/protos/google/spanner/v1/type.proto index 3e01729fc..e3e85a770 100644 --- a/protos/google/spanner/v1/type.proto +++ b/protos/google/spanner/v1/type.proto @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/protos/protos.d.ts b/protos/protos.d.ts index 103c6a802..4e4a305d0 100644 --- a/protos/protos.d.ts +++ b/protos/protos.d.ts @@ -36293,6 +36293,9 @@ export namespace google { /** ResultSet precommitToken */ precommitToken?: (google.spanner.v1.IMultiplexedSessionPrecommitToken|null); + + /** ResultSet cacheUpdate */ + cacheUpdate?: (google.spanner.v1.ICacheUpdate|null); } /** Represents a ResultSet. */ @@ -36316,6 +36319,9 @@ export namespace google { /** ResultSet precommitToken. */ public precommitToken?: (google.spanner.v1.IMultiplexedSessionPrecommitToken|null); + /** ResultSet cacheUpdate. */ + public cacheUpdate?: (google.spanner.v1.ICacheUpdate|null); + /** * Creates a new ResultSet instance using the specified properties. * @param [properties] Properties to set diff --git a/protos/protos.js b/protos/protos.js index fb25c835b..5d953ab1b 100644 --- a/protos/protos.js +++ b/protos/protos.js @@ -94419,6 +94419,7 @@ * @property {Array.|null} [rows] ResultSet rows * @property {google.spanner.v1.IResultSetStats|null} [stats] ResultSet stats * @property {google.spanner.v1.IMultiplexedSessionPrecommitToken|null} [precommitToken] ResultSet precommitToken + * @property {google.spanner.v1.ICacheUpdate|null} [cacheUpdate] ResultSet cacheUpdate */ /** @@ -94469,6 +94470,14 @@ */ ResultSet.prototype.precommitToken = null; + /** + * ResultSet cacheUpdate. + * @member {google.spanner.v1.ICacheUpdate|null|undefined} cacheUpdate + * @memberof google.spanner.v1.ResultSet + * @instance + */ + ResultSet.prototype.cacheUpdate = null; + /** * Creates a new ResultSet instance using the specified properties. * @function create @@ -94502,6 +94511,8 @@ $root.google.spanner.v1.ResultSetStats.encode(message.stats, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); if (message.precommitToken != null && Object.hasOwnProperty.call(message, "precommitToken")) $root.google.spanner.v1.MultiplexedSessionPrecommitToken.encode(message.precommitToken, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.cacheUpdate != null && Object.hasOwnProperty.call(message, "cacheUpdate")) + $root.google.spanner.v1.CacheUpdate.encode(message.cacheUpdate, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); return writer; }; @@ -94556,6 +94567,10 @@ message.precommitToken = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.decode(reader, reader.uint32()); break; } + case 6: { + message.cacheUpdate = $root.google.spanner.v1.CacheUpdate.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -94615,6 +94630,11 @@ if (error) return "precommitToken." + error; } + if (message.cacheUpdate != null && message.hasOwnProperty("cacheUpdate")) { + var error = $root.google.spanner.v1.CacheUpdate.verify(message.cacheUpdate); + if (error) + return "cacheUpdate." + error; + } return null; }; @@ -94655,6 +94675,11 @@ throw TypeError(".google.spanner.v1.ResultSet.precommitToken: object expected"); message.precommitToken = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.fromObject(object.precommitToken); } + if (object.cacheUpdate != null) { + if (typeof object.cacheUpdate !== "object") + throw TypeError(".google.spanner.v1.ResultSet.cacheUpdate: object expected"); + message.cacheUpdate = $root.google.spanner.v1.CacheUpdate.fromObject(object.cacheUpdate); + } return message; }; @@ -94677,6 +94702,7 @@ object.metadata = null; object.stats = null; object.precommitToken = null; + object.cacheUpdate = null; } if (message.metadata != null && message.hasOwnProperty("metadata")) object.metadata = $root.google.spanner.v1.ResultSetMetadata.toObject(message.metadata, options); @@ -94689,6 +94715,8 @@ object.stats = $root.google.spanner.v1.ResultSetStats.toObject(message.stats, options); if (message.precommitToken != null && message.hasOwnProperty("precommitToken")) object.precommitToken = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.toObject(message.precommitToken, options); + if (message.cacheUpdate != null && message.hasOwnProperty("cacheUpdate")) + object.cacheUpdate = $root.google.spanner.v1.CacheUpdate.toObject(message.cacheUpdate, options); return object; }; diff --git a/protos/protos.json b/protos/protos.json index 6d612dffc..9576bee24 100644 --- a/protos/protos.json +++ b/protos/protos.json @@ -8743,12 +8743,18 @@ }, "params": { "type": "google.protobuf.Struct", - "id": 4 + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "paramTypes": { "keyType": "string", "type": "Type", - "id": 5 + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "partitionOptions": { "type": "PartitionOptions", @@ -9848,6 +9854,13 @@ "options": { "(google.api.field_behavior)": "OPTIONAL" } + }, + "cacheUpdate": { + "type": "CacheUpdate", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, diff --git a/samples/README.md b/samples/README.md index c37709bf0..03b68647e 100644 --- a/samples/README.md +++ b/samples/README.md @@ -116,8 +116,8 @@ and automatic, synchronous replication for high availability. * [Queryoptions](#queryoptions) * [Quickstart](#quickstart) * [Read data with database role](#read-data-with-database-role) - * [Performs a read-write transaction with isolation level option](#performs-a-read-write-transaction-with-isolation-level-option) * [Performs a read-write transaction with read lock mode option](#performs-a-read-write-transaction-with-read-lock-mode-option) + * [Performs a read-write transaction with isolation level option](#performs-a-read-write-transaction-with-isolation-level-option) * [Sets a request tag for a single query](#sets-a-request-tag-for-a-single-query) * [Run Batch update with RPC priority](#run-batch-update-with-rpc-priority) * [Run partitioned update with RPC priority](#run-partitioned-update-with-rpc-priority) @@ -1890,16 +1890,16 @@ __Usage:__ -### Performs a read-write transaction with isolation level option +### Performs a read-write transaction with read lock mode option -View the [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/repeatable-reads.js). +View the [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/read-lock-mode.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/repeatable-reads.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/read-lock-mode.js,samples/README.md) __Usage:__ -`node repeatable-reads.js ` +`node read-lock-mode.js ` ----- @@ -1907,15 +1907,17 @@ __Usage:__ -### Performs a read-write transaction with read lock mode option +### Performs a read-write transaction with isolation level option -View the [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/read-lock-mode.js). +View the [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/repeatable-reads.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/read-lock-mode.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/repeatable-reads.js,samples/README.md) __Usage:__ -`node read-lock-mode.js ` + +`node repeatable-reads.js ` + ----- diff --git a/src/v1/spanner_client.ts b/src/v1/spanner_client.ts index 82ef9eb3e..07a538fbd 100644 --- a/src/v1/spanner_client.ts +++ b/src/v1/spanner_client.ts @@ -2056,8 +2056,9 @@ export class SpannerClient { * {@link protos.google.spanner.v1.Spanner.ExecuteStreamingSql|`ExecuteStreamingSql`} with * a `PartitionedDml` transaction for large, partition-friendly DML * operations. - * @param {google.protobuf.Struct} request.params - * Parameter names and values that bind to placeholders in the SQL string. + * @param {google.protobuf.Struct} [request.params] + * Optional. Parameter names and values that bind to placeholders in the SQL + * string. * * A parameter placeholder consists of the `@` character followed by the * parameter name (for example, `@firstName`). Parameter names can contain @@ -2069,10 +2070,10 @@ export class SpannerClient { * `"WHERE id > @msg_id AND id < @msg_id + 100"` * * It's an error to execute a SQL statement with unbound parameters. - * @param {number[]} request.paramTypes - * It isn't always possible for Cloud Spanner to infer the right SQL type - * from a JSON value. For example, values of type `BYTES` and values - * of type `STRING` both appear in + * @param {number[]} [request.paramTypes] + * Optional. It isn't always possible for Cloud Spanner to infer the right SQL + * type from a JSON value. For example, values of type `BYTES` and values of + * type `STRING` both appear in * {@link protos.google.spanner.v1.PartitionQueryRequest.params|params} as JSON strings. * * In these cases, `param_types` can be used to specify the exact